From 4b7bf6b97b5acb8c10d5fac96fbe4c6acbb22039 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Wed, 8 Mar 2023 01:27:32 +0400 Subject: [PATCH] Build --- .env | 4 ++-- ...6382aaf84f5.chunk.js => 104.be090b1ee184fa23f913.chunk.js} | 4 ++-- ...4f5.chunk.js.map => 104.be090b1ee184fa23f913.chunk.js.map} | 2 +- ...4adf7dd36.bundle.js => 110.109af56006a419549840.bundle.js} | 4 ++-- ...6.bundle.js.map => 110.109af56006a419549840.bundle.js.map} | 2 +- ...cc526f48754.chunk.js => 147.52e5e3f41bb7eb15ae10.chunk.js} | 4 ++-- ...754.chunk.js.map => 147.52e5e3f41bb7eb15ae10.chunk.js.map} | 2 +- public/297.30de9795e39435a29676.chunk.js | 2 ++ public/297.30de9795e39435a29676.chunk.js.map | 1 + ...938e5f14eb7.chunk.js => 508.dfcdc07d46a7ba4348a1.chunk.js} | 2 +- ...eb7.chunk.js.map => 508.dfcdc07d46a7ba4348a1.chunk.js.map} | 2 +- ...911cb9f8422c.chunk.js => 61.8c05eb6b6906de5287fa.chunk.js} | 2 +- ...422c.chunk.js.map => 61.8c05eb6b6906de5287fa.chunk.js.map} | 2 +- public/742.4a4829b5ed21258b69e6.chunk.js | 2 -- public/742.4a4829b5ed21258b69e6.chunk.js.map | 1 - ...5.chunk.js => crypto.worker.c036d5d715f9894c08a3.chunk.js} | 2 +- ...js.map => crypto.worker.c036d5d715f9894c08a3.chunk.js.map} | 2 +- public/index.html | 4 ++-- public/main.228ad639cd68cb5735ce.bundle.js.map | 1 - public/main.5760f7380bcaa29519f1.css | 4 ++++ public/main.5760f7380bcaa29519f1.css.map | 1 + public/main.6e3cb54d0a85ecdda73e.css | 4 ---- public/main.6e3cb54d0a85ecdda73e.css.map | 1 - ...cb5735ce.bundle.js => main.b611b259692b9fd072db.bundle.js} | 4 ++-- public/main.b611b259692b9fd072db.bundle.js.map | 1 + public/mtproto.worker.44189744893b344288e7.chunk.js | 2 -- public/mtproto.worker.44189744893b344288e7.chunk.js.map | 1 - public/mtproto.worker.c9d58d1702ff11ef9b30.chunk.js | 2 ++ public/mtproto.worker.c9d58d1702ff11ef9b30.chunk.js.map | 1 + public/report.html | 4 ++-- ...b45b5ad95353.chunk.js => sw.ee91e25d52a3425cb42c.chunk.js} | 2 +- ...5353.chunk.js.map => sw.ee91e25d52a3425cb42c.chunk.js.map} | 2 +- public/version | 2 +- 33 files changed, 38 insertions(+), 38 deletions(-) rename public/{104.f1b4b4be86382aaf84f5.chunk.js => 104.be090b1ee184fa23f913.chunk.js} (62%) rename public/{104.f1b4b4be86382aaf84f5.chunk.js.map => 104.be090b1ee184fa23f913.chunk.js.map} (69%) rename public/{110.b39868e78bf4adf7dd36.bundle.js => 110.109af56006a419549840.bundle.js} (99%) rename public/{110.b39868e78bf4adf7dd36.bundle.js.map => 110.109af56006a419549840.bundle.js.map} (99%) rename public/{147.bb5274ee5cc526f48754.chunk.js => 147.52e5e3f41bb7eb15ae10.chunk.js} (68%) rename public/{147.bb5274ee5cc526f48754.chunk.js.map => 147.52e5e3f41bb7eb15ae10.chunk.js.map} (77%) create mode 100644 public/297.30de9795e39435a29676.chunk.js create mode 100644 public/297.30de9795e39435a29676.chunk.js.map rename public/{508.864916919938e5f14eb7.chunk.js => 508.dfcdc07d46a7ba4348a1.chunk.js} (98%) rename public/{508.864916919938e5f14eb7.chunk.js.map => 508.dfcdc07d46a7ba4348a1.chunk.js.map} (99%) rename public/{61.043c67ed911cb9f8422c.chunk.js => 61.8c05eb6b6906de5287fa.chunk.js} (99%) rename public/{61.043c67ed911cb9f8422c.chunk.js.map => 61.8c05eb6b6906de5287fa.chunk.js.map} (99%) delete mode 100644 public/742.4a4829b5ed21258b69e6.chunk.js delete mode 100644 public/742.4a4829b5ed21258b69e6.chunk.js.map rename public/{crypto.worker.7fb5055c6558e4a5c265.chunk.js => crypto.worker.c036d5d715f9894c08a3.chunk.js} (99%) rename public/{crypto.worker.7fb5055c6558e4a5c265.chunk.js.map => crypto.worker.c036d5d715f9894c08a3.chunk.js.map} (99%) delete mode 100644 public/main.228ad639cd68cb5735ce.bundle.js.map create mode 100644 public/main.5760f7380bcaa29519f1.css create mode 100644 public/main.5760f7380bcaa29519f1.css.map delete mode 100644 public/main.6e3cb54d0a85ecdda73e.css delete mode 100644 public/main.6e3cb54d0a85ecdda73e.css.map rename public/{main.228ad639cd68cb5735ce.bundle.js => main.b611b259692b9fd072db.bundle.js} (85%) create mode 100644 public/main.b611b259692b9fd072db.bundle.js.map delete mode 100644 public/mtproto.worker.44189744893b344288e7.chunk.js delete mode 100644 public/mtproto.worker.44189744893b344288e7.chunk.js.map create mode 100644 public/mtproto.worker.c9d58d1702ff11ef9b30.chunk.js create mode 100644 public/mtproto.worker.c9d58d1702ff11ef9b30.chunk.js.map rename public/{sw.a4cbb23cb45b5ad95353.chunk.js => sw.ee91e25d52a3425cb42c.chunk.js} (99%) rename public/{sw.a4cbb23cb45b5ad95353.chunk.js.map => sw.ee91e25d52a3425cb42c.chunk.js.map} (99%) diff --git a/.env b/.env index 3858f056..8b698c69 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ API_ID=1025907 API_HASH=452b0359b988148995f22ff0f4229750 VERSION=1.7.3 -VERSION_FULL=1.7.3 (314) -BUILD=314 +VERSION_FULL=1.7.3 (315) +BUILD=315 diff --git a/public/104.f1b4b4be86382aaf84f5.chunk.js b/public/104.be090b1ee184fa23f913.chunk.js similarity index 62% rename from public/104.f1b4b4be86382aaf84f5.chunk.js rename to public/104.be090b1ee184fa23f913.chunk.js index 23b69ad9..b20c1470 100644 --- a/public/104.f1b4b4be86382aaf84f5.chunk.js +++ b/public/104.be090b1ee184fa23f913.chunk.js @@ -1,2 +1,2 @@ -"use strict";(this.webpackChunktweb=this.webpackChunktweb||[]).push([[104],{9104:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a});const a={Animations:"Animations",AttachAlbum:"Album","Appearance.Color.Hex":"HEX","Appearance.Color.RGB":"RGB","BlockModal.Search.Placeholder":"Block user...",DarkMode:"Dark Mode",FilterIncludeExcludeInfo:"Choose chats and types of chats that will\nappear and never appear in this folder.",FilterMenuDelete:"Delete Folder",FilterHeaderEdit:"Edit Folder",FilterAllGroups:"All Groups",FilterAllContacts:"All Contacts",FilterAllNonContacts:"All Non-Contacts",FilterAllChannels:"All Channels",FilterAllBots:"All Bots","EditContact.OriginalName":"original name","EditProfile.FirstNameLabel":"Name","EditProfile.BioLabel":"Bio (optional)","EditProfile.Username.Label":"Username (optional)","EditProfile.Username.Available":"Username is available","EditProfile.Username.Taken":"Username is already taken","EditProfile.Username.Invalid":"Username is invalid","ExceptionModal.Search.Placeholder":"Add exception...","Chat.Menu.SelectMessages":"Select Messages","Chat.Menu.ClearSelection":"Clear Selection","Chat.Menu.Hint":"To **edit** or **reply**, close this menu.\nThen tap next to a message.","Chat.Input.UnpinAll":"Unpin All Messages","Chat.Input.Attach.PhotoOrVideo":"Photo or Video","Chat.Input.Attach.Document":"Document","Chat.Subscribe":"SUBSCRIBE","Chat.Selection.LimitToast":"Max selection count reached.","Chat.Search.MessagesFound":{one_value:"%d message found",other_value:"%d messages found"},"Chat.Search.NoMessagesFound":"No messages found","Chat.Search.PrivateSearch":"Private Search","Chat.Service.TopicEdited.Mixed":"%1$@ changed the topic name and icon to %2$@","Chat.Service.TopicEdited.You.Mixed":"You changed the topic name and icon to %2$@","Chat.Service.TopicEdited.Mixed.IconRemoved":'%1$@ changed the topic name to "%1$@" and removed icon',"Chat.Service.TopicEdited.You.Mixed.IconRemoved":'You changed the topic name to "%1$@" and removed icon',"ChatList.Main.EmptyPlaceholder.Title":"Your chats will appear here","ChatList.Main.EmptyPlaceholder.Subtitle":"You have %s on Telegram","ChatList.Main.EmptyPlaceholder.SubtitleNoContacts":"Use Telegram app on your [Android](https://telegram.org/android) or [iOS](https://telegram.org/dl/ios) device to sync your contacts","ChatList.Menu.SwitchTo.Webogram":"Switch to Old Version","ChatList.Menu.SwitchTo.Z":"Switch to Z version","ChatMigration.From":"Migrated from %s","ChatMigration.To":"Migrated to %s","ConnectionStatus.ForceReconnect":"force reconnect","ConnectionStatus.ReconnectIn":"Reconnect in %ds, %s","ConnectionStatus.Reconnect":"reconnect","ConnectionStatus.Reconnecting":"Reconnecting...","ConnectionStatus.TimedOut":"Request timed out, %s","ConnectionStatus.Waiting":"Waiting for network...","Contacts.Count":{one_value:"%d contact",other_value:"%d contacts"},"Deactivated.Title":"Too many tabs...","Deactivated.Subtitle":"Telegram supports only one active tab with the app.\nClick anywhere to continue using this tab.","Deactivated.Version.Title":"WebK has updated...","Deactivated.Version.Subtitle":"Another tab is running a newer version of Telegram.\nClick anywhere to reload this tab.","General.Keyboard":"Keyboard","General.SendShortcut.Enter":"Send by Enter","General.SendShortcut.CtrlEnter":"Send by %s + Enter","General.SendShortcut.NewLine.ShiftEnter":"New line by Shift + Enter","General.SendShortcut.NewLine.Enter":"New line by Enter","General.TimeFormat":"Time Format","General.TimeFormat.h12":"12-hour","General.TimeFormat.h23":"24-hour","ChatBackground.UploadWallpaper":"Upload Wallpaper","ChatBackground.Blur":"Blur Wallpaper Image","Notifications.Sound":"Notification Sound",NewPrivateChat:"New Private Chat","NewPoll.OptionLabel":"Option %d","Message.Context.Selection.Copy":"Copy selected","Message.Context.Selection.Clear":"Clear selection","Message.Context.Selection.Delete":"Delete selected","Message.Context.Selection.Forward":"Forward selected","Message.Context.Selection.Download":"Download selected","Message.Context.Selection.SendNow":"Send Now selected","Message.Unsupported.Desktop":"__This message is currently not supported on Telegram Web. Try [getdesktop.telegram.org](https://getdesktop.telegram.org/)__","Message.Unsupported.Mobile":"__This message is currently not supported on Telegram Web. Try [telegram.org/dl](https://telegram.org/dl/)__","Checkbox.Enabled":"Enabled","Checkbox.Disabled":"Disabled","Error.PreviewSender.CaptionTooLong":"Caption is too long.","PreviewSender.GroupItems":"Group items","PreviewSender.SendAlbum":{one_value:"Send Album",other_value:"Send %d Albums"},"Presence.YourChat":"chat with yourself","Privacy.Devices":{one_value:"%1$d device",other_value:"%1$d devices"},"Privacy.Websites":{one_value:"%1$d website",other_value:"%1$d websites"},"Privacy.SensitiveContent":"Sensitive Content","PrivacyModal.Search.Placeholder":"Add Users or Groups...","Permissions.NoExceptions":"No exceptions","Permissions.ExceptionsCount":{one_value:"%d exception",other_value:"%d exceptions"},"Permissions.RemoveFromGroup":"Are you sure you want to remove **%s** from the group?","PWA.Install":"Install App","Link.Available":"Link is available","Link.Taken":"Link is already taken","Link.Invalid":"Link is invalid","LiteMode.Key.chat.Title":"Chat Animations","LiteMode.Key.chat_background.Title":"Background rotation","LiteMode.Key.chat_spoilers.Title":"Animated spoiler effect","LiteMode.Key.stickers_panel.Title":"Autoplay in panel","LiteMode.Key.stickers_chat.Title":"Autoplay in chat","LiteMode.Key.emoji_panel.Title":"Autoplay in panel","LiteMode.Key.emoji_messages.Title":"Autoplay in messages","LiteMode.Key.effects.Title":"Interactive Effects","LiteMode.Key.effects_reactions.Title":"Reaction effect","LiteMode.Key.effects_premiumstickers.Title":"Premium stickers effect","LiteMode.Key.effects_emoji.Title":"Emoji effect","StickersTab.SearchPlaceholder":"Search Stickers",ForwardedFrom:"Forwarded from %s","Popup.Avatar.Title":"Drag to Reposition","Popup.Unpin.AllTitle":"Unpin all messages","Popup.Unpin.HideTitle":"Hide pinned messages","Popup.Unpin.HideDescription":"Do you want to hide the pinned message bar? It wil stay hidden until a new message is pinned.","Popup.Unpin.Hide":"Hide","Popup.Attach.GroupMedia":"Group all media","Popup.Attach.UngroupMedia":"Ungroup all media","Popup.Attach.AsMedia":"Send as media","Popup.Attach.EnableSpoilers":"Hide all with spoilers","Popup.Attach.RemoveSpoilers":"Remove all spoilers","TwoStepAuth.EmailCodeChangeEmail":"Change Email","MarkupTooltip.LinkPlaceholder":"Enter URL...","MediaViewer.Context.Download":"Download",Profile:"Profile",Saved:"Saved",Deleted:"Deleted",ReportBug:"Report Bug","Notifications.Count":{one_value:"%d notification",other_value:"%d notifications"},"Notifications.Forwarded":{one_value:"Forwarded %d message",other_value:"Forwarded %d messages"},"Notifications.New":"New notification","PushNotification.Action.Mute1d":"Mute background alerts for 1 day","PushNotification.Action.Settings":"Background alerts settings","PushNotification.Action.Mute1d.Mobile":"Mute for 24H","PushNotification.Action.Settings.Mobile":"Alerts settings","PushNotification.Message.NoPreview":"You have a new message","LogOut.Description":"Are you sure you want to log out?\n\nNote that you can seamlessly use Telegram on all your devices at once.","VoiceChat.DiscussionGroup":"discussion group","PaymentInfo.CVV":"CVV Code","PaymentInfo.Card.Title":"Enter your card information","PaymentInfo.Billing.Title":"Enter your billing address","PaymentInfo.Done":"PROCEED TO CHECKOUT","PaymentCard.Error.Invalid":"Invalid card number","PaymentCard.Error.Incomplete":"Incomplete card number","LimitReached.Ok":"OK, GOT IT","Username.Purchase":"**This username is already taken.** However, it is currently available for purchase. [Learn more…]()","Video.Unsupported.Desktop":"__Unfortunately, this video can't be played on Telegram Web. Try opening it with our [desktop app](https://getdesktop.telegram.org/) instead.__","Video.Unsupported.Mobile":"__Unfortunately, this video can't be played on Telegram Web. Try opening it with our [mobile app](https://telegram.org/dl/) instead.__",AccDescrEditing:"Editing",ActionCreateChannel:"Channel created",ActionCreateGroup:"un1 created the group",ActionChangedTitle:"un1 changed the group name to un2",ActionRemovedPhoto:"un1 removed the group photo",ActionChangedPhoto:"un1 changed the group photo",ActionChangedVideo:"un1 changed the group video",ActionAddUser:"un1 added un2",ActionAddUserSelf:"un1 returned to the group",ActionAddUserSelfYou:"You returned to the group",ActionAddUserSelfMega:"un1 joined the group",ActionLeftUser:"un1 left the group",ActionKickUser:"un1 removed un2",ActionInviteUser:"un1 joined the group via invite link",ActionPinnedNoText:"un1 pinned a message",ActionMigrateFromGroup:"This group was upgraded to a supergroup",ActionYouScored:"You scored %1$s",ActionUserScored:"un1 scored %1$s",ActionYouScoredInGame:"You scored %1$s in un2",ActionUserScoredInGame:"un1 scored %1$s in un2",AndOther:{one_value:"and %1$d other",other_value:"and %1$d others"},AttachPhoto:"Photo",AttachVideo:"Video",AttachGif:"GIF",AttachLocation:"Location",AttachLiveLocation:"Live Location",AttachContact:"Contact",AttachSticker:"Sticker",AttachAudio:"Voice message",AttachRound:"Video message",AttachGame:"Game",Bot:"bot",ChannelMegaJoined:"You joined this group",EnterChannelName:"Channel name",DescriptionOptionalPlaceholder:"Description (optional)",DescriptionPlaceholder:"Description",DiscussionStarted:"Discussion started",Draft:"Draft",FilterAlwaysShow:"Include Chats",FilterNeverShow:"Exclude Chats",FilterInclude:"Included Chats",FilterExclude:"Excluded Chats",FilterChatTypes:"Chat types",FilterChats:"Chats",FilterNew:"New Folder",Filters:"Folders",FilterRecommended:"Recommended Folders",FilterShowMoreChats:{one_value:"Show %1$d More Chat",other_value:"Show %1$d More Chats"},ForwardedMessageCount:{one_value:"Forwarded message",other_value:"%1$d forwarded messages"},FromYou:"You",Add:"Add",Chats:{one_value:"%1$d chat",other_value:"%1$d chats"},Channels:{one_value:"%1$d channel",other_value:"%1$d channels"},Comments:{one_value:"%1$d Comment",other_value:"%1$d Comments"},Groups:{one_value:"%1$d group",other_value:"%1$d groups"},Users:{one_value:"%1$d user",other_value:"%1$d users"},Members:{one_value:"%1$d member",other_value:"%1$d members"},messages:{one_value:"%1$d message",other_value:"%1$d messages"},UsernameHelpLink:"This link opens a chat with you:\n%1$s",NewChannel:"New Channel",NewGroup:"New Group",Contacts:"Contacts",SavedMessages:"Saved Messages",Settings:"Settings",SettingsHelp:"Help",General:"General",TextSize:"Message Text Size",ChatBackground:"Chat Background",EnableAnimations:"Enable Animations",AutoDownloadMedia:"Auto-Download Media",AutodownloadContacts:"Contacts",AutodownloadPrivateChats:"Private Chats",AutodownloadGroupChats:"Group Chats",AutodownloadChannels:"Channels",AutoplayGIF:"GIFs",AutoplayVideo:"Videos",NotificationsForGroups:"Notifications for groups",NotificationsForPrivateChats:"Notifications for private chats",NotificationsForChannels:"Notifications for channels",NotificationsPrivateChats:"Private Chats",NotificationsGroups:"Groups",NotificationsChannels:"Channels",NotificationsOther:"Other",MarkAsUnread:"Mark as unread",MarkAsRead:"Mark as read",ContactJoined:"Contact joined Telegram",Loading:"Loading...",Unblock:"Unblock",BlockedUsers:"Blocked Users",BlockedUsersInfo:"Blocked users will not be able to contact you and will not see your Last Seen time.",BlockedEmpty:"None",TwoStepVerification:"Two-Step Verification",TwoStepVerificationTitle:"Two-Step Verification",PinnedMessage:"Pinned Message",PinnedMessagesCount:{one_value:"Pinned Message",other_value:"%1$d Pinned Messages"},PrivacyExceptions:"Exceptions",PrivacyLastSeen:"Last Seen & Online",PrivacySettings:"Privacy and Security",PrivacyTitle:"Privacy",PrivacyPhone:"Phone Number",PrivacyPhoneTitle:"Who can see my phone number?",PrivacyPhoneTitle2:"Who can find me by my number?",PrivacyPhoneInfo:"Users who have your number saved in their contacts will also see it on Telegram.",PrivacyPhoneInfo3:"Users who add your number to their contacts will see it on Telegram only if they are your contacts.",PrivacyProfilePhoto:"Profile Photos",PrivacyProfilePhotoTitle:"Who can see my profile photos & videos?",PrivacyP2PHeader:"Peer-to-Peer",PrivacyForwardsTitle:"Who can add a link to my account when forwarding my messages?",Reminders:"Reminders",ScheduledMessages:"Scheduled Messages",LastSeenTitle:"Who can see your Last Seen time?",SessionsTitle:"Active Sessions",CurrentSession:"This device",TerminateAllSessions:"Terminate All Other Sessions",TerminateSessionText:"Are you sure you want to terminate this session?",OtherSessions:"Active sessions",AreYouSureDeleteSingleMessage:"Are you sure you want to delete this message?",AreYouSureDeleteFewMessages:"Are you sure you want to delete these messages?",AreYouSureDeleteSingleMessageMega:"Are you sure you want to delete this message for everyone?",AreYouSureDeleteFewMessagesMega:"Are you sure you want to delete these messages for everyone?",AreYouSureDeleteAndExitName:"Are you sure you want to delete and leave the group **%1$s**?",AreYouSureDeleteThisChatSavedMessages:"Are you sure you want to delete **Saved Messages**?",AreYouSureDeleteThisChatWithUser:"Are you sure you want to delete the chat with **%1$s**?",AreYouSureSessionTitle:"Terminate session",AreYouSureSessionsTitle:"Terminate sessions",AreYouSureSessions:"Are you sure you want to terminate all other sessions?",Terminate:"Terminate",WhoCanCallMe:"Who can call me?",WhoCanAddMe:"Who can add me to group chats?",ArchivedChats:"Archived Chats",Cancel:"Cancel",HistoryCleared:"History was cleared",Archive:"Archive",Unarchive:"Unarchive",Delete:"Delete",Reply:"Reply",Edit:"Edit",Forward:"Forward",CopyLink:"Copy Link",Copy:"Copy",Search:"Search",LinkCopied:"Link copied to clipboard",LinkCopiedPrivateInfo:"This link will only work for members of this chat.",GroupAddMembers:"Add Members",SendMessageTo:"Add people...",JumpToDate:"Jump to Date",Caption:"Caption",Message:"Message",Poll:"Poll",SharedFilesTab2:"Files",SharedMediaTab2:"Media",SharedLinksTab2:"Links",SharedMusicTab2:"Music",SharedVoiceTab2:"Voice",NewPoll:"New Poll",PollOptions:"Poll options",AskAQuestion:"Ask a Question",AddAnExplanationInfo:"Users will see this text after choosing the wrong answer, good for educational purposes.",AccDescrQuizExplanation:"Explanation",PhoneCopied:"Phone copied to clipboard",UsernameCopied:"Username copied to clipboard.",BioCopied:"Bio copied to clipboard.",UserBio:"Bio",Username:"Username",UsernameAlso:"also %1$s",UsernameHelp:"You can choose a username on **Telegram**. If you do, people will be able to find you by this username and contact you without needing your phone number.\n\nYou can use **a–z**, **0–9** and underscores. Minimum length is **5** characters.",Phone:"Phone",Notifications:"Notifications",AreYouSureDeleteContact:"Are you sure you want to delete this contact?",AreYouSureDeleteAndExit:"Are you sure you want to delete and leave the group?",AreYouSureDeleteAndExitChannel:"Do you want to delete and leave the channel?",DeleteContact:"Delete contact",GroupType:"Group Type",ChannelType:"Channel Type",TypePrivate:"Private",TypePublic:"Public",TypePrivateGroup:"Private",TypePublicGroup:"Public",GroupMembers:"Members",DeleteMega:"Delete Group",DeleteMegaMenu:"Delete group",DeleteAndExitButton:"Delete and Leave Group",ChannelDelete:"Delete Channel",ChannelDeleteMenu:"Delete channel",ChannelPermissions:"Permissions",ChannelPermissionsHeader:"What can members of this group do?",ChannelAddException:"Add Exception",ChannelBlockedUsers:"Removed users",NoBlockedUsers:"No removed users",UserRestrictions:"User Permissions",UserRestrictionsDisabled:"This option is disabled for all members in Group Permissions",UserRestrictionsCanDo:"What can this user do?",UserRestrictionsRead:"Read Messages",UserRestrictionsSend:"Send Messages",UserRestrictionsSendMedia:"Send Media",UserRestrictionsSendPolls:"Send Polls",UserRestrictionsSendStickers:"Send Stickers and GIFs",UserRestrictionsSendPhotos:"Send Photos",UserRestrictionsSendVideos:"Send Videos",UserRestrictionsSendMusic:"Send Music",UserRestrictionsSendFiles:"Send Files",UserRestrictionsSendVoices:"Send Voice Messages",UserRestrictionsSendRound:"Send Video Messages",UserRestrictionsEmbedLinks:"Embed Links",UserRestrictionsChangeInfo:"Change Chat Info",UserRestrictionsPinMessages:"Pin Messages",UserRestrictionsInviteUsers:"Add Users",UserRestrictionsNoSend:"can't send messages",UserRestrictionsNoSendMedia:"no media",UserRestrictionsNoSendPolls:"no polls",UserRestrictionsNoSendStickers:"no stickers & GIFs",UserRestrictionsNoSendPhotos:"no photos",UserRestrictionsNoSendVideos:"no videos",UserRestrictionsNoSendMusic:"no music",UserRestrictionsNoSendDocs:"no files",UserRestrictionsNoSendVoice:"no voice",UserRestrictionsNoSendRound:"no round",UserRestrictionsNoEmbedLinks:"no embed links",UserRestrictionsNoChangeInfo:"can't change Info",UserRestrictionsNoPinMessages:"no pins",UserRestrictionsNoInviteUsers:"can't add users",UserRestrictionsBlock:"Ban and remove from group",ChannelPublic:"Public Channel",MegaPublic:"Public Group",ChannelPublicInfo:"Public channels can be found in search, anyone can join them.",MegaPublicInfo:"Public groups can be found in search, chat history is available to everyone and anyone can join.",ChannelPrivate:"Private Channel",MegaPrivate:"Private Group",ChannelPrivateInfo:"Private channels can only be joined via an invite link.",MegaPrivateInfo:"Private groups can only be joined if you were invited or have an invite link.",ChannelPrivateLinkHelp:"People can join your channel by following this link. You can revoke the link any time.",MegaPrivateLinkHelp:"People can join your group by following this link. You can revoke the link any time.",RevokeButton:"Revoke",RevokeLink:"Revoke Link",RevokeAlert:"Are you sure you want to revoke this link? Once the link is revoked, no one will be able to join using it.",SetUrlPlaceholder:"Link",Subscribers:{one_value:"%1$d subscriber",other_value:"%1$d subscribers"},SearchGifsTitle:"Search GIFs",PinMessageAlert:"Pin this message in the group?",PinMessageAlertTitle:"Pin message",PinMessageAlertChannel:"Do you want to pin this message in this channel?",PinMessageAlertChat:"Do you want to pin this message at the top of the chat?",UnpinMessageAlertTitle:"Unpin message",UnpinMessageAlert:"Do you want to unpin this message?",PinNotify:"Notify all members",PinMessage:"Pin",UnpinMessage:"Unpin",PinAlsoFor:"Also pin for %1$s",DeleteMessagesTitle:"Delete %1$s",DeleteSingleMessagesTitle:"Delete message",DeleteMessagesOption:"Unsend My Messages",DeleteMessagesOptionAlso:"Also delete for %1$s",DeleteForAll:"Delete for all members",DeleteMessagesTextGroup:'You can also delete the %1$s you sent from the inboxes of other group members by checking "Unsend my messages".',LeaveChannel:"Leave Channel",LeaveChannelMenu:"Leave channel",ChannelLeaveAlertWithName:"Are you sure you want to leave **%1$s**?",LeaveMegaMenu:"Leave group",DeleteChatUser:"Delete chat",PleaseEnterCurrentPassword:"Enter your password",PleaseEnterFirstPassword:"Enter a password",PleaseReEnterPassword:"Re-enter your password",Continue:"Continue",YourEmailSkip:"Skip",YourEmailSkipWarning:"Warning",YourEmailSkipWarningText:"No, seriously.\n\nIf you forget your password, you will lose access to your Telegram account. There will be no way to restore it.",TurnPasswordOffQuestionTitle:"Disable password",TurnPasswordOffQuestion:"Are you sure you want to disable your password?",Disable:"Disable",TwoStepVerificationSetPassword:"Set Password",TwoStepVerificationPasswordSet:"Password Set!",TwoStepVerificationPasswordSetInfo:"This password will be required when you log in on a new device in addition to the code you get in the SMS.",TwoStepVerificationPasswordReturnSettings:"Return to Settings",RecoveryEmail:"Recovery email",RecoveryEmailTitle:"Recovery Email",ResendCode:"Resend code",PasswordAsHintError:"Hint must be different from your password",AddStickersCount:"ADD %1$s",RemoveStickersCount:"REMOVE %1$s",Stickers:{one_value:"%1$d sticker",other_value:"%1$d stickers"},HidAccount:"The account was hidden by the user",TelegramFeatures:"Telegram Features",SetColor:"Set a color",Open:"Open",OpenUrlTitle:"Open Link",OpenUrlAlert2:"Do you want to open %1$s?",FilterNoChatsToDisplay:"Folder is empty",FilterNoChatsToDisplayInfo:"No chats currently belong to this folder.",SupportStatus:"support",Lately:"last seen recently",WithinAWeek:"last seen within a week",WithinAMonth:"last seen within a month",ALongTimeAgo:"last seen a long time ago",Online:"online",MessageScheduleSend:"Send Now",MessageScheduleEditTime:"Reschedule",YouLeft:"You left this group",Recent:"Recent",Of:"%1$d of %2$d",NoResult:"No results",Updating:"Updating...",Emoji:"Emoji",AddContactTitle:"Add Contact",HiddenName:"Deleted Account",Seconds:{one_value:"%1$d second",other_value:"%1$d seconds"},Minutes:{one_value:"%1$d minute",other_value:"%1$d minutes"},Hours:{one_value:"%1$d hour",other_value:"%1$d hours"},Days:{one_value:"%1$d day",other_value:"%1$d days"},Weeks:{one_value:"%1$d week",other_value:"%1$d weeks"},Months:{one_value:"%1$d month",other_value:"%1$d months"},Years:{one_value:"%1$d year",other_value:"%1$d years"},TodayAtFormattedWithToday:"today at %1$s",formatDateAtTime:"%1$s at %2$s",JoinByPeekChannelTitle:"Join Channel",JoinByPeekGroupTitle:"Join Group",YouWereKicked:"you were removed",ViaBot:"via",InviteExpired:"This invite link has expired.",NoUsernameFound:"There is no Telegram account with this username.",PrivacyDeleteCloudDrafts:"Delete All Cloud Drafts",AreYouSureClearDraftsTitle:"Delete cloud drafts",AreYouSureClearDrafts:"Are you sure you want to delete all cloud drafts?",BotInfoTitle:"What can this bot do?",ChatYourSelf:"forward here to save",GroupEmptyTitle1:"You have created a **group**.",GroupEmptyTitle2:"Groups can have:",GroupDescription1:"Up to 200,000 members",GroupDescription2:"Persistent chat history",GroupDescription3:"Public links such as t.me/title",GroupDescription4:"Admins with different rights",ChatYourSelfDescription1:"Forward messages here to save them",ChatYourSelfDescription2:"Send media and files to store them",ChatYourSelfDescription3:"Access this chat from any device",ChatYourSelfDescription4:"Use search to quickly find things",ChatYourSelfTitle:"Your cloud storage",ActionYouCreateGroup:"You created the group",NoMessages:"No messages here yet...",NoScheduledMessages:"No scheduled messages here yet...",NoMessagesGreetingsDescription:"Send a message or tap the greeting below.",InviteToGroupError:"Sorry, you can't add this user to groups because of user's privacy settings.",InviteToChannelError:"Sorry, you can't add this user to channels because of user's privacy settings.",AddMembersAlertTitle:"Add %1$s",AddOneMemberAlertTitle:"Add member",AddMembersAlertNamesText:"Are you sure you want to add %1$s to **%2$s**?",AddMembersAlertCountText:"Are you sure you want to add %1$s to **%2$s**?",AddMembersForwardMessages:"Show the last 100 messages to the new members",AddOneMemberForwardMessages:"Show the last 100 messages to **%1$s**",PinToTopLimitReached2:"Sorry, you can only pin %1$s to the top in the main list. More chats can be pinned in Chat Folders and your Archive.",FiltersSetupPinAlert:"Set Up Folders",AppName:"Telegram",OK:"OK",PinFolderLimitReached:"Sorry, you can't pin any more chats to the top.",Send:"Send",ChannelJoin:"JOIN",Yesterday:"yesterday",LeaveAComment:"Leave a comment",ViewInChat:"View in chat",LinkNotFound:"Unfortunately, you can't access this message. You are not a member of the chat where it was posted.",Create:"Create",ViewDiscussion:"View discussion",MessageScheduledUntilOnline:"Scheduled until online",ReportChat:"Report",ReportChatSpam:"Spam",ReportChatViolence:"Violence",ReportChatPornography:"Pornography",ReportChatChild:"Child Abuse",ReportChatOther:"Other",ReportChatDescription:"Description",ReportInfo:"Please enter any additional details relevant to your report.",ReportSentInfo:"Telegram moderators will review your report.\nThank you for your cooperation!",ReportHint:"Additional details...",ChatHistory:"Chat history for new members",ShareContact:"Share contact",SendMessageTitle:"Send message",SendContactToGroupText:"Do you want to send this contact to **%1$s**?",ChannelBroadcast:"Broadcast",ChannelSilentBroadcast:"Silent Broadcast",Comment:"Comment",SendAnonymously:"Send anonymously",DiscardVoiceMessageTitle:"Discard Voice Message",DiscardVoiceMessageDescription:"Are you sure you want to stop recording and discard your voice message?",DiscardVoiceMessageAction:"Discard",AddContact:"Add to contacts",BlockUser:"Block user",MobileHidden:"Mobile hidden",MobileHiddenExceptionInfo:"Phone number will be visible once %1$s adds you as a contact.",FirstName:"First name (required)",LastName:"Last name (optional)",AreYouSureBlockContact2:"Are you sure you want to block **%1$s**?",UserBlocked:"User blocked",UserUnblocked:"User unblocked",AudioUnknownArtist:"Unknown artist",AudioUnknownTitle:"Unknown title",LogOut:"Log out",OnlineCount:{one_value:"%1$d online",other_value:"%1$d online"},EditedMessage:"edited",GlobalSearch:"Global search",SearchMessages:"Messages",SearchAllChatsShort:"Chats",ClearButton:"Clear",FilterAllChats:"All Chats",FilterAllChatsShort:"All",Call:"Call",VideoCall:"Video Call",CallMessageOutgoing:"Outgoing Call",CallMessageIncoming:"Incoming Call",CallMessageVideoOutgoing:"Outgoing Video Call",CallMessageVideoIncoming:"Incoming Video Call",VoipExchangingKeys:"Exchanging encryption keys",VoipUnmute:"Unmute",SavingContentTitle:"Saving content",RestrictSavingContent:"Restrict saving content",RestrictSavingContentInfoGroup:"Members won't be able to copy, save and forward content from this group.",RestrictSavingContentInfoChannel:"Subscribers won't be able to copy, save and forward content from this channel.",ClearOtherSessionsHelp:"Logs out all devices except for this one.",SessionsListInfo:"The official Telegram app is available for Android, iPhone, iPad, Windows, macOS and Linux.",SponsoredMessage:"sponsored",OpenChannelPost:"VIEW POST",FilterNameHint:"Folder name",BotStart:"START",BotUnblock:"RESTART",BotStop:"Stop bot",BotRestart:"Restart bot",ShareYouPhoneNumberTitle:"Share your phone number?",AreYouSureShareMyContactInfoBot:"The bot will know your phone number. This can be useful for integration with other services.",DistanceUnitsTitle:"Distance units",DistanceUnitsKilometers:"Kilometers",DistanceUnitsMiles:"Miles",PeopleNearby:"People Nearby",MakeMyselfVisible:"Make Myself Visible",MakeMyselfVisibleTitle:"Show Your Profile?",MakeMyselfVisibleInfo:"Users nearby will be able to view your profile and send you messages. This may help you find new friends, but could also attract excessive attention. You can stop sharing your profile at any time.\n\nYour phone number will remain hidden.",StopShowingMe:"Stop Showing Me",PeopleNearbyInfo2:"Exchange contact info with people nearby and find new friends.",NearbyCreateGroup:"Create a Local group",AwayTo:"%1$s away",MessagePreview:"Message Preview",KMetersAway2:"%1$s km away",MetersAway2:"%1$s m away",MilesAway:"%1$s mi away",FootsAway:"%1$s ft away",PeopleNearbyHeader:"People nearby",ChatsNearbyHeader:"Groups nearby",ChatLocation:"Location",RequestToJoinGroupDescription:"This group accepts new members only after they are approved by its admins.",RequestToJoinChannelDescription:"This channel accepts new subscribers only after they are approved by its admins.",RequestToJoinSent:"Join request sent",RequestToJoinGroupApproved:"Your request to join the group was approved",RequestToJoinChannelApproved:"Your request to join the channel was approved",Update:"UPDATE",Reactions:"Reactions",DoubleTapSetting:"Quick Reaction",EnableReactions:"Enable Reactions",EnableReactionsChannelInfo:"Allow subscribers to react to channel posts.",EnableReactionsGroupInfo:"Allow members to react to group messages.",AvailableReactions:"Available reactions",NobodyViewed:"Nobody viewed",MessageSeen:{one_value:"Seen",other_value:"%1$d Seen"},DataSettings:"Data and Storage",GroupsAndChannelsHelp:"Change who can add you to groups and channels.",SessionsInfo:"Control your sessions on other devices.",StickersBotInfo:"Artists are welcome to add their own sticker sets using our @stickers bot.",AutomaticMediaDownload:"Automatic media download",AutoDownloadPhotos:"Photos",AutoDownloadVideos:"Videos",AutoDownloadFiles:"Files",AutoDownloadOnAllChats:"On in all chats",AutoDownloadUpToOnAllChats:"Up to %1$s in all chats",AutoDownloadOff:"Off",AutoDownloadOnUpToFor:"Up to %1$s for %2$s",AutoDownloadOnFor:"On for %1$s",AutoDownloadContacts:"Contacts",AutoDownloadPm:"PM",AutoDownloadGroups:"Groups",AutoDownloadChannels:"Channels",AutoDownloadAudioInfo:"Voice messages are tiny, so they're always downloaded automatically.",AutoplayMedia:"Auto-play media",AutoDownloadPhotosTitle:"Auto-download photos",AutoDownloadVideosTitle:"Auto-download videos and GIFs",AutoDownloadFilesTitle:"Auto-download files and music",AutoDownloadMaxFileSize:"Maximum file size",AutodownloadSizeLimitUpTo:"up to %1$s",ResetAutomaticMediaDownload:"Reset Auto-Download Settings",ResetAutomaticMediaDownloadAlertTitle:"Reset settings",ResetAutomaticMediaDownloadAlert:"Are you sure you want to reset auto-download settings?",Reset:"Reset",SendMessageAsTitle:"Send message as...",Devices:"Devices",LanguageName:"English",EditCantEditPermissionsPublic:"This permission is not available in public groups.",VoipUserMicrophoneIsOff:"%s's microphone is off",VoipUserCameraIsOff:"%s's camera is off",PrivacyPhoneInfo4:"This public link opens a chat with you:",ReportChatIllegalDrugs:"Illegal Drugs",ReportChatPersonalDetails:"Personal Details",VoipPeerIncompatible:"**%1$s**'s app is using an incompatible protocol. They need to update their app before you can call them.",TelegramFeaturesUrl:"https://t.me/TelegramTips",ScamMessage:"SCAM",FakeMessage:"FAKE",TextCopied:"Text copied to clipboard",PaymentInvoice:"INVOICE",PaymentTestInvoice:"TEST INVOICE",PaymentReceipt:"Receipt",PaymentCheckout:"Checkout",PaymentTransactionTotal:"Total",PaymentTip:"Tip",PaymentTipOptional:"Tip (Optional)",PaymentCheckoutPay:"PAY %1$s",PaymentCheckoutMethod:"Payment method",PaymentCheckoutProvider:"Payment provider",PaymentCardNumber:"Card Number",PaymentCardSavePaymentInformation:"Save Payment Information",PaymentCardInfo:"Payment info",PaymentCardSavePaymentInformationInfoLine1:"You can save your payment info for future use. It will be stored directly with the payment provider. Telegram has no access to your credit card data.",Done:"Done",PaymentShippingMethod:"Shipping methods",PaymentNoShippingMethod:"Sorry, it is not possible to deliver to your address.",PaymentShippingInfo:"Shipping Information",PaymentShippingAddress:"Shipping address",PaymentShippingAddress1Placeholder:"Address 1 (Street)",PaymentShippingAddress2Placeholder:"Address 2 (Street)",PaymentShippingCityPlaceholder:"City",PaymentShippingStatePlaceholder:"State",PaymentShippingCountry:"Country",PaymentShippingZipPlaceholder:"Postcode",PaymentShippingReceiver:"Receiver",PaymentShippingName:"Full Name",PaymentShippingEmailPlaceholder:"Email",PaymentCheckoutPhoneNumber:"Phone number",PaymentCheckoutShippingMethod:"Shipping method",PaymentShippingSave:"Save Shipping Information",PaymentShippingSaveInfo:"You can save your shipping info for future use.",PaymentInfoHint:"You paid **%1$s** for **%2$s**.",PrivacyPayments:"Payments",PrivacyPaymentsClearInfo:"You can delete your shipping info and instruct all payment providers to remove your saved credit cards. Note that Telegram never stores your credit card data.",PrivacyPaymentsClear:"Clear Payment and Shipping Info",PrivacyPaymentsClearAlertTitle:"Clear payment info",PrivacyPaymentsClearAlertText:"Are you sure you want to clear your payment and shipping info?",PrivacyPaymentsPaymentInfoCleared:"Payment info cleared.",PrivacyPaymentsShippingInfoCleared:"Shipping info cleared.",PrivacyPaymentsPaymentShippingCleared:"Payment and shipping info cleared.",PrivacyClearShipping:"Shipping info",PrivacyClearPayment:"Payment info",Clear:"Clear",Save:"Save",PaymentCheckoutName:"Name",ClearRecentStickersAlertTitle:"Clear recent stickers",ClearRecentStickersAlertMessage:"Do you want to clear all your recent stickers?",PremiumStickersShort:"Premium",FavoriteStickers:"Favorites",AddToFavorites:"Add to Favorites",AddedToFavorites:"Sticker added to Favorites.",RemovedFromFavorites:"Sticker was removed from Favorites",RemovedFromRecent:"Sticker was removed from Recent",DeleteFromFavorites:"Delete from Favorites",DeleteFromRecent:"Remove from Recent",NewChatsFromNonContacts:"New chats from unknown users",ArchiveAndMute:"Archive and Mute",ArchiveAndMuteInfo:"Automatically archive and mute new chats, groups and channels from non-contacts.",PrivacyVoiceMessages:"Voice Messages",PrivacyVoiceMessagesTitle:"Who can send me voice or video messages?",PrivacyVoiceMessagesInfo:"You can restrict who can send you voice or video messages with granular precision.",PrivacyVoiceMessagesPremiumOnly:"Only subscribers of *Telegram Premium* can restrict receiving voice messages.",EmojiCount:{other_value:"%1$d emoji"},AddEmojiNotFound:"Emoji pack not found.",MessageContainsEmojiPack:"This message contains emoji from %s pack.",MessageContainsEmojiPacks:{other_value:"This message contains emoji from **%d Packs**."},EmojiPackCount:{one_value:"%1$d Emoji Pack",other_value:"%1$d Emoji Packs"},ReactionsAll:"All",EnableSomeReactionsInfo:"Members of the group can use only certain approved emoji as reactions to messages.",EnableAllReactionsInfo:"Members of the group can use any emoji as reactions to messages.",DisableReactionsInfo:"Members of the group can’t add any reactions to messages.",OnlyAllowThisReactions:"Only allow these reactions",AllReactions:"All reactions",SomeReactions:"Some reactions",NoReactions:"No reactions",LimitReached:"Limit Reached",LimitReachedPinDialogs:"You can't pin more than %1$d chats to the top. Unpin some that are currently pinned – or subscribe to **Telegram Premium** to double the limit to **%2$d** chats.",LimitReachedPinDialogsPremium:"Sorry, you can't pin more than %1$d chats to the top. Unpin some that are currently pinned.",LimitReachedPinDialogsLocked:"Sorry, you can't pin more than %1$d chats to the top. Unpin some that are currently pinned. We are working to let you increase this limit in the future.",IncreaseLimit:"Increase Limit",LimitFree:"Free",LimitPremium:"Premium",ActionTTLChanged:"un1 set messages to auto-delete in %1$s",ActionTTLYouChanged:"You set messages to auto-delete in %1$s",ActionTTLChannelChanged:"Messages in this channel will be automatically deleted after %1$s",ActionTTLChannelDisabled:"Messages in this channel will no longer be automatically deleted",ActionTTLDisabled:"un1 disabled the auto-delete timer",ActionTTLYouDisabled:"You disabled the auto-delete timer",UsernamesProfileHeader:"Username order",UsernamesProfileHelp:"Drag and drop links to change the order in which they will be displayed on your info page.",UsernamesChannelHelp:"Drag and drop links to change the order in which they will be displayed on the channel info page.",UsernameLinkEditable:"tap to edit",UsernameLinkActive:"active",UsernameLinkInactive:"not active",UsernameActivateLink:"Activate link",UsernameDeactivateLink:"Deactivate link",UsernameActivateLinkProfileMessage:"Do you want to show this link on your info page?",UsernameDeactivateLinkProfileMessage:"Do you want to hide this link from your info page?",UsernameActivateLinkChannelMessage:"Do you want to show this link on the channel info page?",UsernameDeactivateLinkChannelMessage:"Do you want to hide this link from the channel info page?",Hide:"Hide",Show:"Show",UsernameActivateErrorTitle:"Too many active links",UsernameActivateErrorMessage:"Sorry, you have too many active public links already. Please hide one of your active public links first.",ChannelSignMessages:"Sign Messages",TopicWasCreatedAction:"%s was created",Topics:"Topics",ForumToggleDescription:"The group chat will be divided into topics created by admins or users.",AnonymousNumber:"Anonymous Number",Info:"Info",BotSettings:"Settings",OpenMessage:"VIEW MESSAGE",OpenGroup:"VIEW GROUP",CloseTopic:"Close topic",RestartTopic:"Reopen topic",LimitReachedPinnedTopics:"Sorry, you can't pin more than %d topics to the top.",TopicProfileStatus:"In %s",AccDescrTopic:"Topic",DeleteTopics:{one_value:"Delete topic",other_value:"Delete topics"},DeleteSelectedTopic:"Are you sure you want delete %s?",NewTopic:"New Topic",CreateTopicTitle:"Choose a topic name and icon",CreateGeneralTopicTitle:"Choose topic name",EditTopicHide:"Show in Topics",EditTopicHideInfo:"If the 'General' topic is hidden, group members can pull down in the topic list to view it.",OpenUrlOption1:"Log in to %1$s as **%2$s**",OpenUrlOption2:"Allow **%1$s** to send me messages",OtherWebSessions:"Connected websites",WebSessionsTitle:"Logged In with Telegram",TerminateWebSessionText:"Are you sure you want to disconnect %1$s?",Disconnect:"Disconnect",TerminateAllWebSessions:"Disconnect All Websites",AreYouSureWebSessions:"Are you sure you want to disconnect all websites where you logged in with Telegram?",ClearOtherWebSessionsHelp:"You can log in on websites that support signing in with Telegram.",TerminateWebSessionInfo:"Tap to disconnect from your Telegram account.",EnablePhotoSpoiler:"Hide with spoiler",DisablePhotoSpoiler:"Remove spoiler",LimitReachedFolders:"You have reached the limit of **%1$d** folders. You can double the limit to **%2$d** folders by subscribing to **Telegram Premium**.",LimitReachedFoldersPremium:"You have reached the limit of **%1$d** folders for this account.",LimitReachedFoldersLocked:"You have reached the limit of **%1$d** folders for this account. We are working to let you increase this limit in the future.",FwdMessageToSavedMessages:"Message forwarded to **Saved Messages**.",FwdMessagesToSavedMessages:"Messages forwarded to **Saved Messages**.",ColorTheme:"Color theme",SendAsFile:"Send as file",SendAsFiles:"Send as files",ChatThemeChangedYou:"You changed the chat theme to %1$s",ChatThemeChangedTo:"%1$s changed the chat theme to %2$s",ChatThemeDisabled:"%1$s disabled the chat theme",ChatThemeDisabledYou:"You disabled the chat theme",ThemeDay:"Day",ThemeNight:"Night",AutoNightSystemDefault:"System Default",GlobalAttachPlainRestricted:"Sending text messages isn't allowed in this group.",GlobalAttachDocumentsRestricted:"Sending documents isn't allowed in this group.",GlobalAttachMediaRestricted:"Sending media isn't allowed in this group.",GlobalAttachAudioRestricted:"Sending music isn't allowed in this group.",GlobalAttachPhotoRestricted:"Sending photos isn't allowed in this group.",GlobalAttachVideoRestricted:"Sending videos isn't allowed in this group.",GlobalAttachVoiceRestricted:"Sending voice isn't allowed in this group.",GlobalAttachRoundRestricted:"Sending round videos isn't allowed in this group.",GlobalAttachInlineRestricted:"Sending inline content isn't allowed in this group.",GlobalAttachStickersRestricted:"Stickers aren't allowed in this group.",GlobalAttachGifRestricted:"Sending GIFs is not allowed in this group.",GlobalAttachEmojiRestricted:"Text messages aren't allowed in this group.",GlobalSendMessageRestricted:"Sending messages is not allowed in this group.",ErrorSendRestrictedPollsAll:"Sorry, sending polls is not allowed in this group.",Remove:"Remove",ChannelBlockUser:"Remove User",StickersName:"Stickers and Emoji",LoopAnimatedStickersInfo:"Animated stickers will play continuously in chats.",SuggestStickersAll:"All Sets",SuggestStickersInstalled:"My Sets",SuggestStickersNone:"None",DynamicPackOrder:"Dynamic Pack Order",DynamicPackOrderInfo:"Automatically place recently used sticker packs at the front of the panel.","AccountSettings.Filters":"Chat Folders","AccountSettings.Notifications":"Notifications and Sounds","AccountSettings.PrivacyAndSecurity":"Privacy and Security","AccountSettings.Language":"Language","Alert.UserDoesntExists":"Sorry, this user doesn't seem to exist.","Alert.Confirm.Discard":"Discard","Appearance.Reset":"Reset to Defaults","AutoDownloadSettings.Delimeter":", ","AutoDownloadSettings.LastDelimeter":" and ","Bio.Description":"Any details such as age, occupation or city.\nExample: 23 y.o. designer from San Francisco","Call.Accept":"Accept","Call.Decline":"Decline","Call.End":"End","Call.Camera":"Camera","Call.Mute":"Mute","Call.Recall":"Recall","Call.Close":"Close","Call.Screen":"Screen","Call.Confirm.Discard.Voice.Header":"Video Chat in Progress","Call.Confirm.Discard.Voice.ToVoice.Text":'Leave video chat in "%1$@" and start a new one in "%2$@"?',"Call.Confirm.Discard.Voice.ToCall.Text":'Leave video chat in "%1$@" and start a call with "%2$@"?',"Call.Confirm.Discard.Call.Header":"Call in Progress","Call.Confirm.Discard.Call.ToVoice.Text":'End call with "%1$@" and start a video chat in "%2$@"?',"Call.Confirm.Discard.Call.ToCall.Text":'End call with "%1$@" and start a video chat in "%2$@"?',"Call.PrivacyErrorMessage":"Sorry, you cannot call %@ because of their privacy settings.","Call.StatusRequesting":"Contacting...","Call.StatusRinging":"Ringing...","Call.StatusConnecting":"Connecting...","Call.StatusEnded":"Call Ended","Call.StatusFailed":"Call Failed","Call.StatusBusy":"Busy","Call.StatusCalling":"is calling you...","Contacts.PhoneNumber.NotRegistred":"The person with this phone number is not registered on Telegram yet.","Channel.UsernameAboutChannel":"People can share this link with others and can find your channel using Telegram search.","Channel.UsernameAboutGroup":"People can share this link with others and find your group using Telegram search.","Chat.Accessory.Forward":{one_value:"Forward Message",other_value:"Forward %d Messages"},"Chat.Accessory.Forward.You":"You","Chat.Accessory.Forward.From":"From","Chat.Accessory.Hidden":{one_value:"Forward Message (sender's name hidden)",other_value:"Forward %d Messages (senders' names hidden)"},"Chat.Alert.Forward.Action.Another":"Forward to Another Chat","Chat.Alert.Forward.Action.Hide1":{one_value:"Hide Sender's Name",other_value:"Hide Senders' Names"},"Chat.Alert.Forward.Action.Show1":{one_value:"Show Sender's Name",other_value:"Show Senders' Names"},"Chat.Alert.Forward.Action.ShowCaption":{one_value:"Show Caption",other_value:"Show Captions"},"Chat.Alert.Forward.Action.HideCaption":{one_value:"Hide Caption",other_value:"Hide Captions"},"Chat.CopySelectedText":"Copy Selected Text","Chat.Confirm.Unpin":"Would you like to unpin this message?","Chat.Context.Reacted":"%1$@/%2$@ Reacted","Chat.Context.ReactedFast":{other_value:"%d Reacted"},"Chat.Date.ScheduledFor":"Scheduled for %@","Chat.Date.ScheduledForToday":"Scheduled for today","Chat.DropTitle":"Drop files here to send them","Chat.DropQuickDesc":"in a quick way","Chat.DropAsFilesDesc":"without compression","Chat.Edit.Cancel.Text":"Are you sure you want to discard all changes?","Chat.Input.ReplyToAnswer":"Reply to message in topics","Chat.SendVoice.PrivacyError":"%@ doesn't accept voice and video messages","Chat.Service.Call.Cancelled":"Cancelled","Chat.Service.Call.Missed":"Missed","Chat.Service.PeerJoinedTelegram":"%@ joined Telegram","Chat.Service.Channel.UpdatedTitle":'Channel renamed to "%@"',"Chat.Service.Channel.UpdatedPhoto":"Channel photo updated","Chat.Service.Channel.RemovedPhoto":"Channel photo removed","Chat.Service.Channel.UpdatedVideo":"Channel video updated","Chat.Service.BotPermissionAllowed":"You allowed this bot to message you when you logged in on %@","Chat.Service.Group.UpdatedPinnedMessage":'%@ pinned "%@"',"Chat.Service.Group.TopicEdited.Icon":"%1$@ changed topic icon to %2$@","Chat.Service.Group.TopicEdited.Icon.Removed":"%1$@ removed icon","Chat.Service.Group.TopicEdited.Title":'%1$@ changed topic name to "%2$@"',"Chat.Service.Group.TopicEdited.Paused":"%1$@ closed topic","Chat.Service.Group.TopicEdited.Resumed":"%1$@ restarted topic","Chat.Service.Group.TopicEdited.You.Icon":"You changed topic icon to %1$@","Chat.Service.Group.TopicEdited.You.Icon.Removed":"You removed icon","Chat.Service.Group.TopicEdited.You.Title":'You changed topic name to "%1$@"',"Chat.Service.Group.TopicEdited.You.Paused":"You closed topic","Chat.Service.Group.TopicEdited.You.Resumed":"You restarted topic","Chat.Service.Group.TopicEdited.You.Hided":"You hid the general topic","Chat.Service.Group.TopicEdited.You.Unhided":"You unhid the general topic","Chat.Service.Group.TopicEdited.Hided":"%1$@ hid the general topic","Chat.Service.Group.TopicEdited.Unhided":"%1$@ unhid the general topic","Chat.Service.PaymentSent1":"You have successfully transferred **%1$@** to **%2$@** for **%3$@**","Chat.Service.PaymentSent1NoTitle":"You have successfully transferred **%1$@** to **%2$@**","Chat.Service.PaymentSentRecurringInit":"You successfully transferred **%1$@** to **%2$@** for **%3$@** and allowed future recurring payments","Chat.Service.PaymentSentRecurringInitNoTitle":"You successfully transferred **%1$@** to **%2$@** and allowed future recurring payments","Chat.Service.PaymentSentRecurringUsed":"You have just successfully transferred **%1$@** to **%2$@** for **%3$@** via recurrent payments","Chat.Service.PaymentSentRecurringUsedNoTitle":"You have just successfully transferred **%1$@** to **%2$@** via recurrent payments","Chat.Service.VoiceChatStarted":"%1$@ started a [video chat](open)","Chat.Service.VoiceChatStartedYou":"You started a [video chat](open)","Chat.Service.VoiceChatStarted.Channel":"[Live Stream](open) started","Chat.Service.VoiceChatFinished":"%1$@ ended the video chat (%2$@)","Chat.Service.VoiceChatFinishedYou":"You ended the video chat (%@)","Chat.Service.VoiceChatFinished.Channel":"Live Stream ended (%1$@)","Chat.Service.VoiceChatInvitation":"%1$@ invited %2$@ to the [video chat](open)","Chat.Service.VoiceChatInvitationByYou":"You invited %1$@ to the [video chat](open)","Chat.Service.VoiceChatInvitationForYou":"%1$@ invited you to the [video chat](open)","ChatService.UserJoinedGroupByRequest":"%@ was accepted to the group","ChatService.UserJoinedChannelByRequest":"%@ joined the channel by request","ChatList.Service.VoiceChatScheduled":"%1$@ scheduled a video chat for %2$@","ChatList.Service.VoiceChatScheduledYou":"You scheduled a video chat for %2$@","Chat.Poll.Unvote":"Retract Vote","Chat.Poll.Stop":"Stop Poll","Chat.Poll.ViewResults":"View Results","Chat.Poll.SubmitVote":"Vote","Chat.Poll.Type.Anonymous":"Anonymous Poll","Chat.Poll.Type.Public":"Poll","Chat.Poll.Type.AnonymousQuiz":"Anonymous Quiz","Chat.Poll.Type.Quiz":"Quiz","Chat.Poll.Type.Closed":"Final Results","Chat.Poll.TotalVotes1":{one_value:"%d vote",other_value:"%d votes"},"Chat.Quiz.TotalVotes":{one_value:"%d answer",other_value:"%d answers"},"Chat.Poll.TotalVotesEmpty":"No votes yet","Chat.Poll.TotalVotesResultEmpty":"No votes","Chat.Quiz.TotalVotesEmpty":"No answers yet","Chat.Quiz.TotalVotesResultEmpty":"No answers","Chat.Pinned.DontShow":"Don't Show Pinned Messages","Chat.Title.Comments":{one_value:"%d Comment",other_value:"%d Comments"},"ChatTitle.ReportMessages":"Report Messages","Chat.Send.WithoutSound":"Send Without Sound","Chat.Send.SetReminder":"Set a Reminder","Chat.Send.ScheduledMessage":"Schedule Message","Chat.SendAs.PersonalAccount":"personal account","Chat.UnpinAllMessagesConfirmation":{one_value:"Do you want to unpin %d message in this chat?",other_value:"Do you want to unpin all %d messages in this chat?"},"Chat.Message.Ad.Text":"Unlike other apps, Telegram never uses your private data to target ads. Sponsored messages on Telegram are based solely on the topic of the public channels in which they are shown. This means that no user data is mined or analyzed to display ads, and every user viewing a channel on Telegram sees the same sponsored messages.\n\nUnlike other apps, Telegram doesn't track whether you tapped on a sponsored message and doesn't profile you based on your activity. We also prevent external links in sponsored messages to ensure that third parties can’t spy on our users. We believe that everyone has the right to privacy, and technological platforms should respect that.\n\nTelegram offers a free and unlimited service to hundreds of millions of users, which involves significant server and traffic costs. In order to remain independent and stay true to its values, Telegram developed a paid tool to promote messages with user privacy in mind. We welcome responsible advertisers at:\n\n%@\n\nSponsored Messages are currently in test mode. Once they are fully launched and allow Telegram to cover its basic costs, we will start sharing ad revenue with the owners of public channels in which sponsored messages are displayed.\n\nOnline ads should no longer be synonymous with abuse of user privacy. Let us redefine how a tech company should operate – together.","Chat.Message.Ad.ReadMore":"Read More","Chat.Message.ViewChannel":"VIEW CHANNEL","Chat.Message.ViewBot":"VIEW BOT","Chat.Message.ViewGroup":"VIEW GROUP","Chat.Message.Sponsored.What":"What are sponsored messages?","Chat.Message.Sponsored.Link":"https://promote.telegram.org","Chat.Voice.Transribe.Error":"No speech detected","Checkout.2FA.Text":"Saving payment details is only available with 2-Step Verification.","Checkout.NewCard.CardholderNamePlaceholder":"Cardholder Name","Checkout.PasswordEntry.Title":"Payment Confirmation","Checkout.PasswordEntry.Pay":"Pay","Checkout.PasswordEntry.Text":"Your card %@ is on file. To pay with this card, please enter your 2-Step-Verification password.","Checkout.PayPrice":"Pay %@","Checkout.WebConfirmation.Title":"Complete Payment","ChatList.Context.Mute":"Mute","ChatList.Context.Unmute":"Unmute","ChatList.Context.Pin":"Pin","ChatList.Context.Unpin":"Unpin","ChatList.Context.DeleteChat":"Delete Chat","ChatList.Context.DeleteAndExit":"Delete and Leave","ChatList.Context.LeaveChannel":"Leave Channel","ChatList.Context.LeaveGroup":"Leave Group","ChatList.Service.Call.incoming":"Incoming Call (%@)","ChatList.Service.Call.outgoing":"Outgoing Call (%@)","ChatList.Service.VideoCall.incoming":"Incoming Video Call (%@)","ChatList.Service.VideoCall.outgoing":"Outgoing Video Call (%@)","ChatList.Service.Call.Cancelled":"Cancelled Call","ChatList.Service.Call.Missed":"Missed Call","ChatList.Service.VideoCall.Cancelled":"Cancelled Video Call","ChatList.Service.VideoCall.Missed":"Missed Video Call","ChatList.Service.VoiceChatScheduled.Channel":"Voice chat scheduled for %@","ChatList.Filter.Header":"Create folders for different groups of chats and quickly switch between them.","ChatList.Filter.NewTitle":"Create Folder","ChatList.Filter.List.Title":"Chat Folders","ChatList.Filter.Include.AddChat":"Add Chats","ChatList.Filter.Exclude.AddChat":"Add Chats","ChatList.Filter.Contacts":"Contacts","ChatList.Filter.NonContacts":"Non-Contacts","ChatList.Filter.Groups":"Groups","ChatList.Filter.Channels":"Channels","ChatList.Filter.Bots":"Bots","ChatList.Filter.MutedChats":"Muted","ChatList.Filter.ReadChats":"Read","ChatList.Filter.Archive":"Archived","ChatList.Filter.Include.LimitReached":"Sorry, you can only add up to 100 individual chats. Try using chat types.","ChatList.Filter.Exclude.LimitReached":"Sorry, you can only add up to 100 individual chats. Try using chat types.","ChatList.Filter.Confirm.Remove.Header":"Remove Folder","ChatList.Filter.Confirm.Remove.Text":"Are you sure you want to remove this folder? Your chats will not be deleted.","ChatList.Mute.1Hour":"For 1 Hour","ChatList.Mute.4Hours":"For 4 Hours","ChatList.Mute.8Hours":"For 8 Hours","ChatList.Mute.1Day":"For 1 Day","ChatList.Mute.3Days":"For 3 Days","ChatList.Mute.Forever":"Forever","Channel.DescriptionHolderDescrpiton":"You can provide an optional description for your channel.","Channel.Persmission.MessageBlock":"Text is not Allowed","ChannelVisibility.Confirm.MakePrivate.Channel":"If you make this channel private, the name @%@ will be removed. Anyone else will be able to take it for their public groups or channels.","ChannelVisibility.Confirm.MakePrivate.Group":"If you make this group private, the name @%@ will be removed. Anyone else will be able to take it for their public groups or channels.","Context.ViewStickerSet":"View Sticker Set","CreateGroup.NameHolder":"Group Name","CustomEmoji.PremiumAlert":"Subscribe to Telegram Premium to unlock this emoji. [Read More]()","Date.Today":"Today","DeleteChat.DeleteGroupForAll":"Delete for all members",DeleteChannelForAll:"Delete for all subscribers","ForumTopic.Context.Info":"Group Info","ForumTopic.Context.AddMember":"Add Members","ForumTopic.Context.ShowAsMessages":"View as Messages","ForumTopic.Context.New":"Create Topic","ForumTopic.Name.Placeholder":"Topic Name","ForumTopic.Title.Edit":"Edit Topic","EditAccount.Username":"Username","EditAccount.Title":"Edit Profile","EditAccount.Logout":"Log Out","Emoji.Recent":"Frequently Used","Emoji.SmilesAndPeople":"Smileys & People","Emoji.AnimalsAndNature":"Animals & Nature","Emoji.FoodAndDrink":"Food & Drink","Emoji.ActivityAndSport":"Activity & Sport","Emoji.TravelAndPlaces":"Travel & Places","Emoji.Objects":"Objects","Emoji.Flags":"Flags","Error.AnError":"An error occurred. Please try again later.","FileSize.B":"%@ B","FileSize.KB":"%@ KB","FileSize.MB":"%@ MB","FileSize.GB":"%@ GB","InstalledStickers.LoopAnimated":"Loop Animated Stickers","LastSeen.HoursAgo":{one_value:"last seen %d hour ago",other_value:"last seen %d hours ago"},"Login.Register.LastName.Placeholder":"Last Name","LiteMode.Title":"Power Saving","LiteMode.Key.emoji.Title":"Emoji Animations","LiteMode.Key.gif.Title":"Autoplay GIFs","LiteMode.Key.video.Title":"Autoplay Videos","LiteMode.Key.stickers.Title":"Sticker Animations","LiteMode.Key.animations.Title":"Interface Animations","LiteMode.Info":"Reduce all power-intensive animations and improve performance.","LiteMode.EnableText":"Power Saving Mode","LiteMode.DisableAlert":"Disable Power Saving Mode","Message.Context.Select":"Select","Message.Context.Pin":"Pin","Message.Context.Unpin":"Unpin","Message.Context.Goto":"Show Message","Message.ReplyActionButtonShowReceipt":"Show Receipt","MessageContext.CopyMessageLink1":"Copy Message Link","Modal.Send":"Send","NewContact.Exception.ShareMyPhoneNumber":"Share My Phone Number","NewContact.Exception.ShareMyPhoneNumber.Desc":"You can make your phone visible to %@.","NewPoll.Anonymous":"Anonymous Voting","NewPoll.Explanation.Placeholder":"Add a Comment (Optional)","NewPoll.OptionsAddOption":"Add an Option","NewPoll.MultipleChoice":"Multiple Answers","NewPoll.Quiz":"Quiz Mode","Notification.Contact.Reacted":'%1$@ to your "%2$@"',"Payments.Recurrent.Accept":"I accept [Terms of Service]() of **%@**.","Peer.Activity.User.PlayingGame":"playing a game","Peer.Activity.User.TypingText":"typing","Peer.Activity.User.SendingPhoto":"sending a photo","Peer.Activity.User.RecordingVideo":"recording video","Peer.Activity.User.SendingVideo":"sending a video","Peer.Activity.User.RecordingAudio":"recording voice","Peer.Activity.User.SendingFile":"sending file","Peer.Activity.User.ChoosingSticker":"choosing a sticker","Peer.Activity.User.EnjoyingAnimations":"watching %@","Peer.Activity.Chat.PlayingGame":"%@ is playing a game","Peer.Activity.Chat.TypingText":"%@ is typing","Peer.Activity.Chat.SendingPhoto":"%@ is sending a photo","Peer.Activity.Chat.RecordingVideo":"%@ is recording video","Peer.Activity.Chat.SendingVideo":"%@ is sending a video","Peer.Activity.Chat.RecordingAudio":"%@ is recording voice","Peer.Activity.Chat.SendingFile":"%@ is sending a file","Peer.Activity.Chat.ChoosingSticker":"%@ is choosing a sticker","Peer.Activity.Chat.EnjoyingAnimations":"%@ is watching %@","Peer.Activity.Chat.Multi.PlayingGame1":"%@ and %d others are playing a game","Peer.Activity.Chat.Multi.TypingText1":"%@ and %d others are typing","Peer.Activity.Chat.Multi.SendingPhoto1":"%@ and %d others are sending photos","Peer.Activity.Chat.Multi.RecordingVideo1":"%@ and %d others are recording video","Peer.Activity.Chat.Multi.SendingVideo1":"%@ and %d others are sending videos","Peer.Activity.Chat.Multi.RecordingAudio1":"%@ and %d others are recording voice","Peer.Activity.Chat.Multi.SendingFile1":"%@ and %d others are sending files","Peer.Activity.Chat.Multi.ChoosingSticker1":"%@ and %d others are choosing stickers","Peer.ServiceNotifications":"service notifications","Peer.RepliesNotifications":"Reply Notifications","Peer.Status.justNow":"last seen just now","Peer.Status.Today":"today","Peer.Status.Yesterday":"yesterday","Peer.Status.LastSeenAt":"last seen %@ at %@","Peer.Status.minAgo":{one_value:"last seen %d minute ago",other_value:"last seen %d minutes ago"},"Peer.Status.Member":{one_value:"%d member",other_value:"%d members"},"Peer.Status.Subscribers":{one_value:"%d subscriber",other_value:"%d subscribers"},"PeerInfo.Administrators":"Administrators","PeerInfo.DeleteChannel":"Delete Channel","PeerInfo.Discussion":"Discussion","PeerInfo.Discussion.Add":"Add","PeerInfo.SharedMedia":"Shared Media","PeerInfo.Subscribers":"Subscribers","PeerInfo.DeleteContact":"Delete Contact","PeerInfo.Action.VoiceChat":"Video Chat","PeerInfo.Action.LiveStream":"Live Stream","PeerInfo.Phone.AnonymousInfo":"This number is not tied to a SIM card and was acquired on [Fragment]().","PeerMedia.Members":"Members","PollResults.Title.Poll":"Poll Results","PollResults.Title.Quiz":"Quiz Results","PollResults.LoadMore":{other_value:"Show More (%d)"},"Preview.Dragging.AddItems":{one_value:"Add Item",other_value:"Add Items"},"PreviewSender.CaptionPlaceholder":"Add a caption...","PreviewSender.CompressFile":"Send compressed","PreviewSender.SendFile":{one_value:"Send File",other_value:"Send %d Files"},"PreviewSender.SendPhoto":{one_value:"Send Photo",other_value:"Send %d Photos"},"PreviewSender.SendVideo":{one_value:"Send Video",other_value:"Send %d Videos"},"PrivacyAndSecurity.Item.On":"On","PrivacyAndSecurity.Item.Off":"Off","PrivacyAndSecurity.SensitiveText":"Disable filtering","PrivacyAndSecurity.SensitiveDesc":"Display sensitive media in public channels on all your Telegram devices.","PrivacySettings.VoiceCalls":"Calls","PrivacySettings.Forwards":"Forwarded Messages","PrivacySettings.Groups":"Groups and Channels","PrivacySettingsController.AddUsers":"Add Users","PrivacySettingsController.GroupDescription":"You can restrict who can add you to groups and channels with granular precision.","PrivacySettingsController.Forwards.CustomHelp":"You can restrict who can add a link to your account when forwarding your messages.","PrivacySettingsController.P2p.Desc":"Disabling peer-to-peer will relay all calls through Telegram servers to avoid revealing your IP address, but may slightly decrease audio and video quality.","PrivacySettingsController.PhoneCallDescription":"You can restrict who can call you with granular precision.","PrivacySettingsController.ProfilePhoto.CustomHelp":"You can restrict who can see your profile photo with granular precision.","PrivacySettingsController.LastSeenDescription":"You won't see Last Seen and Online statuses for people with whom you don't share yours. Approximate last seen will be shown instead (recently, within a week, within a month).","PrivacySettingsController.PeerInfo":"You can add users or entire groups as exceptions that will override the settings above.","PrivacySettingsController.Everbody":"Everybody","PrivacySettingsController.MyContacts":"My Contacts","PrivacySettingsController.Nobody":"Nobody","PrivacySettingsController.NeverShare":"Never Share With","PrivacySettingsController.AlwaysShare":"Always Share With","PrivacySettingsController.NeverAllow":"Never Allow","PrivacySettingsController.AlwaysAllow":"Always Allow","PrivacySettingsController.UserCount":{one_value:"%d user",other_value:"%d users"},"RecentSessions.Error.FreshReset":"For security reasons, you can't terminate older sessions from a device that you've just connected. Please use an earlier connection or wait for a few hours.","RequestJoin.Button":"Request to Join","Stickers.SearchAdd":"Add","Stickers.SearchAdded":"Added","Stickers.SuggestStickers":"Suggest Stickers by Emoji","ShareModal.Search.Placeholder":"Share to...","ShareModal.Search.ForwardPlaceholder":"Forward to...","Telegram.GeneralSettingsViewController":"General Settings","Telegram.InstalledStickerPacksController":"Stickers","Telegram.NotificationSettingsViewController":"Notifications","Telegram.LanguageViewController":"Language","Text.CopyLabel_About":"Copy About","Text.CopyLabel_Bio":"Copy Bio","Text.CopyLabel_PhoneNumber":"Copy Phone Number","Text.CopyLabel_Username":"Copy Username","Text.CopyLabel_ShareLink":"Copy Share Link","GeneralSettings.BigEmoji":"Large Emoji","GeneralSettings.EmojiPrediction":"Suggest Emoji","GroupPermission.Delete":"Delete Exception","Search.Confirm.ClearHistory":"Are you sure you want to clear your search history?","SecureId.Identity.Placeholder.ExpiryDate":"Expiry Date","Separator.ShowMore":"show more","Separator.ShowLess":"show less","ScheduleController.at":"at","Schedule.SendToday":"Send today at %@","Schedule.SendDate":"Send on %@ at %@","Schedule.SendWhenOnline":"Send When Online","Sticker.Premium.Click.Info":"This pack contains premium stickers like this one. [View Pack]()","Stickers.Recent":"Recent","StickerSet.DontExist":"Sorry, this sticker set doesn't seem to exist.","Text.Context.Copy.Username":"Copy Username","Text.Context.Copy.Hashtag":"Copy Hashtag","Time.TomorrowAt":"tomorrow at %@","TwoStepAuth.SetPasswordHelp":"You can set a password that will be required when you log in on a new device in addition to the code you get in the SMS.","TwoStepAuth.GenericHelp":"You have enabled Two-Step verification.\nYou'll need the password you set up here to log in to your Telegram account.","TwoStepAuth.ChangePassword":"Change Password","TwoStepAuth.RemovePassword":"Turn Password Off","TwoStepAuth.SetupEmail":"Set Recovery Email","TwoStepAuth.ChangeEmail":"Change Recovery Email","TwoStepAuth.ConfirmEmailCodeDesc":"Please enter the code we've just emailed to %@.","TwoStepAuth.RecoveryTitle":"Email Code","TwoStepAuth.RecoveryCode":"Code","TwoStepAuth.RecoveryCodeInvalid":"Invalid code. Please try again.","TwoStepAuth.RecoveryCodeExpired":"Code Expired","TwoStepAuth.SetupHintTitle":"Password Hint","TwoStepAuth.SetupHintPlaceholder":"Hint","VoiceChat.Chat.StartNew":"Video chat ended. Start a new one?","VoiceChat.Chat.StartNew.OK":"Start","VoiceChat.Chat.Ended":"Video chat ended.","VoiceChat.Invite.InviteMembers":"Invite members","VoiceChat.Status.Connecting":"Connecting...","VoiceChat.Status.Members":{one_value:"%d participant",other_value:"%d participants"},"VoiceChat.Status.MutedForYou":"muted for you","VoiceChat.Status.Speaking":"speaking","VoiceChat.Status.Listening":"listening","VoiceChat.Status.WantsSpeak":"wants to speak","VoiceChat.Status.Muted":"muted","VoiceChat.Status.You":"This is you","VoiceChat.Video.Stream.Video":"video","VoiceChat.Video.Stream.Screencast":"screen","VoiceChat.Video.Stream.More":"more","VoiceChat.Leave":"Leave","VoiceChat.End.Title":"Leave video chat","VoiceChat.End.Text":"Are you sure you want to leave this video chat?","VoiceChat.End.Third":"End Video Chat","VoiceChat.End.OK":"Leave","VoiceChat.MutePeer":"Mute","VoiceChat.UnmutePeer":"Allow To Speak","VoiceChat.RemovePeer":"Remove","VoiceChat.OpenProfile":"Open Profile","VoiceChat.MuteForMe":"Mute For Me","VoiceChat.UnmuteForMe":"Unmute For Me","VoiceChat.RemovePeer.Confirm.Channel":"Do you want to remove %1$@ from the channel?","VoiceChat.RemovePeer.Confirm":"Are you sure you want to remove %1$@ from the group?","VoiceChat.RemovePeer.Confirm.OK":"Remove"}}}]); -//# sourceMappingURL=104.f1b4b4be86382aaf84f5.chunk.js.map \ No newline at end of file +"use strict";(this.webpackChunktweb=this.webpackChunktweb||[]).push([[104],{9104:(e,t,o)=>{o.r(t),o.d(t,{default:()=>a});const a={Animations:"Animations",AttachAlbum:"Album","Appearance.Color.Hex":"HEX","Appearance.Color.RGB":"RGB","BlockModal.Search.Placeholder":"Block user...",DarkMode:"Dark Mode",FilterIncludeExcludeInfo:"Choose chats and types of chats that will\nappear and never appear in this folder.",FilterMenuDelete:"Delete Folder",FilterHeaderEdit:"Edit Folder",FilterAllGroups:"All Groups",FilterAllContacts:"All Contacts",FilterAllNonContacts:"All Non-Contacts",FilterAllChannels:"All Channels",FilterAllBots:"All Bots","EditContact.OriginalName":"original name","EditProfile.FirstNameLabel":"Name","EditProfile.BioLabel":"Bio (optional)","EditProfile.Username.Label":"Username (optional)","EditProfile.Username.Available":"Username is available","EditProfile.Username.Taken":"Username is already taken","EditProfile.Username.Invalid":"Username is invalid","ExceptionModal.Search.Placeholder":"Add exception...","Chat.Menu.SelectMessages":"Select Messages","Chat.Menu.ClearSelection":"Clear Selection","Chat.Menu.Hint":"To **edit** or **reply**, close this menu.\nThen tap next to a message.","Chat.Input.UnpinAll":"Unpin All Messages","Chat.Input.Attach.PhotoOrVideo":"Photo or Video","Chat.Input.Attach.Document":"Document","Chat.Subscribe":"SUBSCRIBE","Chat.Selection.LimitToast":"Max selection count reached.","Chat.Search.MessagesFound":{one_value:"%d message found",other_value:"%d messages found"},"Chat.Search.NoMessagesFound":"No messages found","Chat.Search.PrivateSearch":"Private Search","Chat.Service.TopicEdited.Mixed":"%1$@ changed the topic name and icon to %2$@","Chat.Service.TopicEdited.You.Mixed":"You changed the topic name and icon to %2$@","Chat.Service.TopicEdited.Mixed.IconRemoved":'%1$@ changed the topic name to "%1$@" and removed icon',"Chat.Service.TopicEdited.You.Mixed.IconRemoved":'You changed the topic name to "%1$@" and removed icon',"ChatList.Main.EmptyPlaceholder.Title":"Your chats will appear here","ChatList.Main.EmptyPlaceholder.Subtitle":"You have %s on Telegram","ChatList.Main.EmptyPlaceholder.SubtitleNoContacts":"Use Telegram app on your [Android](https://telegram.org/android) or [iOS](https://telegram.org/dl/ios) device to sync your contacts","ChatList.Menu.SwitchTo.Webogram":"Switch to Old Version","ChatList.Menu.SwitchTo.Z":"Switch to Z version","ChatMigration.From":"Migrated from %s","ChatMigration.To":"Migrated to %s","ConnectionStatus.ForceReconnect":"force reconnect","ConnectionStatus.ReconnectIn":"Reconnect in %ds, %s","ConnectionStatus.Reconnect":"reconnect","ConnectionStatus.Reconnecting":"Reconnecting...","ConnectionStatus.TimedOut":"Request timed out, %s","ConnectionStatus.Waiting":"Waiting for network...","Contacts.Count":{one_value:"%d contact",other_value:"%d contacts"},"Deactivated.Title":"Too many tabs...","Deactivated.Subtitle":"Telegram supports only one active tab with the app.\nClick anywhere to continue using this tab.","Deactivated.Version.Title":"WebK has updated...","Deactivated.Version.Subtitle":"Another tab is running a newer version of Telegram.\nClick anywhere to reload this tab.","General.Keyboard":"Keyboard","General.SendShortcut.Enter":"Send by Enter","General.SendShortcut.CtrlEnter":"Send by %s + Enter","General.SendShortcut.NewLine.ShiftEnter":"New line by Shift + Enter","General.SendShortcut.NewLine.Enter":"New line by Enter","General.TimeFormat":"Time Format","General.TimeFormat.h12":"12-hour","General.TimeFormat.h23":"24-hour","ChatBackground.UploadWallpaper":"Upload Wallpaper","ChatBackground.Blur":"Blur Wallpaper Image","Notifications.Sound":"Notification Sound",NewPrivateChat:"New Private Chat","NewPoll.OptionLabel":"Option %d","Message.Context.Selection.Copy":"Copy selected","Message.Context.Selection.Clear":"Clear selection","Message.Context.Selection.Delete":"Delete selected","Message.Context.Selection.Forward":"Forward selected","Message.Context.Selection.Download":"Download selected","Message.Context.Selection.SendNow":"Send Now selected","Message.Unsupported.Desktop":"__This message is currently not supported on Telegram Web. Try [getdesktop.telegram.org](https://getdesktop.telegram.org/)__","Message.Unsupported.Mobile":"__This message is currently not supported on Telegram Web. Try [telegram.org/dl](https://telegram.org/dl/)__","Checkbox.Enabled":"Enabled","Checkbox.Disabled":"Disabled","Error.PreviewSender.CaptionTooLong":"Caption is too long.","PreviewSender.GroupItems":"Group items","PreviewSender.SendAlbum":{one_value:"Send Album",other_value:"Send %d Albums"},"Presence.YourChat":"chat with yourself","Privacy.Devices":{one_value:"%1$d device",other_value:"%1$d devices"},"Privacy.Websites":{one_value:"%1$d website",other_value:"%1$d websites"},"Privacy.SensitiveContent":"Sensitive Content","PrivacyModal.Search.Placeholder":"Add Users or Groups...","Permissions.NoExceptions":"No exceptions","Permissions.ExceptionsCount":{one_value:"%d exception",other_value:"%d exceptions"},"Permissions.RemoveFromGroup":"Are you sure you want to remove **%s** from the group?","PWA.Install":"Install App","Link.Available":"Link is available","Link.Taken":"Link is already taken","Link.Invalid":"Link is invalid","LiteMode.Key.chat.Title":"Chat Animations","LiteMode.Key.chat_background.Title":"Background rotation","LiteMode.Key.chat_spoilers.Title":"Animated spoiler effect","LiteMode.Key.stickers_panel.Title":"Autoplay in panel","LiteMode.Key.stickers_chat.Title":"Autoplay in chat","LiteMode.Key.emoji_panel.Title":"Autoplay in panel","LiteMode.Key.emoji_messages.Title":"Autoplay in messages","LiteMode.Key.effects.Title":"Interactive Effects","LiteMode.Key.effects_reactions.Title":"Reaction effect","LiteMode.Key.effects_premiumstickers.Title":"Premium stickers effect","LiteMode.Key.effects_emoji.Title":"Emoji effect","StickersTab.SearchPlaceholder":"Search Stickers",ForwardedFrom:"Forwarded from %s","Popup.Avatar.Title":"Drag to Reposition","Popup.Unpin.AllTitle":"Unpin all messages","Popup.Unpin.HideTitle":"Hide pinned messages","Popup.Unpin.HideDescription":"Do you want to hide the pinned message bar? It wil stay hidden until a new message is pinned.","Popup.Unpin.Hide":"Hide","Popup.Attach.GroupMedia":"Group all media","Popup.Attach.UngroupMedia":"Ungroup all media","Popup.Attach.AsMedia":"Send as media","Popup.Attach.EnableSpoilers":"Hide all with spoilers","Popup.Attach.RemoveSpoilers":"Remove all spoilers","TwoStepAuth.EmailCodeChangeEmail":"Change Email","MarkupTooltip.LinkPlaceholder":"Enter URL...","MediaViewer.Context.Download":"Download",Profile:"Profile",Saved:"Saved",Deleted:"Deleted",ReportBug:"Report Bug","Notifications.Count":{one_value:"%d notification",other_value:"%d notifications"},"Notifications.Forwarded":{one_value:"Forwarded %d message",other_value:"Forwarded %d messages"},"Notifications.New":"New notification","PushNotification.Action.Mute1d":"Mute background alerts for 1 day","PushNotification.Action.Settings":"Background alerts settings","PushNotification.Action.Mute1d.Mobile":"Mute for 24H","PushNotification.Action.Settings.Mobile":"Alerts settings","PushNotification.Message.NoPreview":"You have a new message","LogOut.Description":"Are you sure you want to log out?\n\nNote that you can seamlessly use Telegram on all your devices at once.","VoiceChat.DiscussionGroup":"discussion group","PaymentInfo.CVV":"CVV Code","PaymentInfo.Card.Title":"Enter your card information","PaymentInfo.Billing.Title":"Enter your billing address","PaymentInfo.Done":"PROCEED TO CHECKOUT","PaymentCard.Error.Invalid":"Invalid card number","PaymentCard.Error.Incomplete":"Incomplete card number","LimitReached.Ok":"OK, GOT IT","Username.Purchase":"**This username is already taken.** However, it is currently available for purchase. [Learn more…]()","Video.Unsupported.Desktop":"__Unfortunately, this video can't be played on Telegram Web. Try opening it with our [desktop app](https://getdesktop.telegram.org/) instead.__","Video.Unsupported.Mobile":"__Unfortunately, this video can't be played on Telegram Web. Try opening it with our [mobile app](https://telegram.org/dl/) instead.__",AccDescrEditing:"Editing",ActionCreateChannel:"Channel created",ActionCreateGroup:"un1 created the group",ActionChangedTitle:"un1 changed the group name to un2",ActionRemovedPhoto:"un1 removed the group photo",ActionChangedPhoto:"un1 changed the group photo",ActionChangedVideo:"un1 changed the group video",ActionAddUser:"un1 added un2",ActionAddUserSelf:"un1 returned to the group",ActionAddUserSelfYou:"You returned to the group",ActionAddUserSelfMega:"un1 joined the group",ActionLeftUser:"un1 left the group",ActionKickUser:"un1 removed un2",ActionInviteUser:"un1 joined the group via invite link",ActionPinnedNoText:"un1 pinned a message",ActionMigrateFromGroup:"This group was upgraded to a supergroup",ActionYouScored:"You scored %1$s",ActionUserScored:"un1 scored %1$s",ActionYouScoredInGame:"You scored %1$s in un2",ActionUserScoredInGame:"un1 scored %1$s in un2",AndOther:{one_value:"and %1$d other",other_value:"and %1$d others"},AttachPhoto:"Photo",AttachVideo:"Video",AttachGif:"GIF",AttachLocation:"Location",AttachLiveLocation:"Live Location",AttachContact:"Contact",AttachSticker:"Sticker",AttachAudio:"Voice message",AttachRound:"Video message",AttachGame:"Game",Bot:"bot",ChannelMegaJoined:"You joined this group",EnterChannelName:"Channel name",DescriptionOptionalPlaceholder:"Description (optional)",DescriptionPlaceholder:"Description",DiscussionStarted:"Discussion started",Draft:"Draft",FilterAlwaysShow:"Include Chats",FilterNeverShow:"Exclude Chats",FilterInclude:"Included Chats",FilterExclude:"Excluded Chats",FilterChatTypes:"Chat types",FilterChats:"Chats",FilterNew:"New Folder",Filters:"Folders",FilterRecommended:"Recommended Folders",FilterShowMoreChats:{one_value:"Show %1$d More Chat",other_value:"Show %1$d More Chats"},ForwardedMessageCount:{one_value:"Forwarded message",other_value:"%1$d forwarded messages"},FromYou:"You",Add:"Add",Chats:{one_value:"%1$d chat",other_value:"%1$d chats"},Channels:{one_value:"%1$d channel",other_value:"%1$d channels"},Comments:{one_value:"%1$d Comment",other_value:"%1$d Comments"},Groups:{one_value:"%1$d group",other_value:"%1$d groups"},Users:{one_value:"%1$d user",other_value:"%1$d users"},Members:{one_value:"%1$d member",other_value:"%1$d members"},messages:{one_value:"%1$d message",other_value:"%1$d messages"},UsernameHelpLink:"This link opens a chat with you:\n%1$s",NewChannel:"New Channel",NewGroup:"New Group",Contacts:"Contacts",SavedMessages:"Saved Messages",Settings:"Settings",SettingsHelp:"Help",General:"General",TextSize:"Message Text Size",ChatBackground:"Chat Background",EnableAnimations:"Enable Animations",AutoDownloadMedia:"Auto-Download Media",AutodownloadContacts:"Contacts",AutodownloadPrivateChats:"Private Chats",AutodownloadGroupChats:"Group Chats",AutodownloadChannels:"Channels",AutoplayGIF:"GIFs",AutoplayVideo:"Videos",NotificationsForGroups:"Notifications for groups",NotificationsForPrivateChats:"Notifications for private chats",NotificationsForChannels:"Notifications for channels",NotificationsPrivateChats:"Private Chats",NotificationsGroups:"Groups",NotificationsChannels:"Channels",NotificationsOther:"Other",MarkAsUnread:"Mark as unread",MarkAsRead:"Mark as read",ContactJoined:"Contact joined Telegram",Loading:"Loading...",Unblock:"Unblock",BlockedUsers:"Blocked Users",BlockedUsersInfo:"Blocked users will not be able to contact you and will not see your Last Seen time.",BlockedEmpty:"None",TwoStepVerification:"Two-Step Verification",TwoStepVerificationTitle:"Two-Step Verification",PinnedMessage:"Pinned Message",PinnedMessagesCount:{one_value:"Pinned Message",other_value:"%1$d Pinned Messages"},PrivacyExceptions:"Exceptions",PrivacyLastSeen:"Last Seen & Online",PrivacySettings:"Privacy and Security",PrivacyTitle:"Privacy",PrivacyPhone:"Phone Number",PrivacyPhoneTitle:"Who can see my phone number?",PrivacyPhoneTitle2:"Who can find me by my number?",PrivacyPhoneInfo:"Users who have your number saved in their contacts will also see it on Telegram.",PrivacyPhoneInfo3:"Users who add your number to their contacts will see it on Telegram only if they are your contacts.",PrivacyProfilePhoto:"Profile Photos",PrivacyProfilePhotoTitle:"Who can see my profile photos & videos?",PrivacyP2PHeader:"Peer-to-Peer",PrivacyForwardsTitle:"Who can add a link to my account when forwarding my messages?",Reminders:"Reminders",ScheduledMessages:"Scheduled Messages",LastSeenTitle:"Who can see your Last Seen time?",SessionsTitle:"Active Sessions",CurrentSession:"This device",TerminateAllSessions:"Terminate All Other Sessions",TerminateSessionText:"Are you sure you want to terminate this session?",OtherSessions:"Active sessions",AreYouSureDeleteSingleMessage:"Are you sure you want to delete this message?",AreYouSureDeleteFewMessages:"Are you sure you want to delete these messages?",AreYouSureDeleteSingleMessageMega:"Are you sure you want to delete this message for everyone?",AreYouSureDeleteFewMessagesMega:"Are you sure you want to delete these messages for everyone?",AreYouSureDeleteAndExitName:"Are you sure you want to delete and leave the group **%1$s**?",AreYouSureDeleteThisChatSavedMessages:"Are you sure you want to delete **Saved Messages**?",AreYouSureDeleteThisChatWithUser:"Are you sure you want to delete the chat with **%1$s**?",AreYouSureSessionTitle:"Terminate session",AreYouSureSessionsTitle:"Terminate sessions",AreYouSureSessions:"Are you sure you want to terminate all other sessions?",Terminate:"Terminate",WhoCanCallMe:"Who can call me?",WhoCanAddMe:"Who can add me to group chats?",ArchivedChats:"Archived Chats",Cancel:"Cancel",HistoryCleared:"History was cleared",Archive:"Archive",Unarchive:"Unarchive",Delete:"Delete",Reply:"Reply",Edit:"Edit",Forward:"Forward",CopyLink:"Copy Link",Copy:"Copy",Search:"Search",LinkCopied:"Link copied to clipboard",LinkCopiedPrivateInfo:"This link will only work for members of this chat.",GroupAddMembers:"Add Members",SendMessageTo:"Add people...",JumpToDate:"Jump to Date",Caption:"Caption",Message:"Message",Poll:"Poll",SharedFilesTab2:"Files",SharedMediaTab2:"Media",SharedLinksTab2:"Links",SharedMusicTab2:"Music",SharedVoiceTab2:"Voice",NewPoll:"New Poll",PollOptions:"Poll options",AskAQuestion:"Ask a Question",AddAnExplanationInfo:"Users will see this text after choosing the wrong answer, good for educational purposes.",AccDescrQuizExplanation:"Explanation",PhoneCopied:"Phone copied to clipboard",UsernameCopied:"Username copied to clipboard.",BioCopied:"Bio copied to clipboard.",UserBio:"Bio",Username:"Username",UsernameAlso:"also %1$s",UsernameHelp:"You can choose a username on **Telegram**. If you do, people will be able to find you by this username and contact you without needing your phone number.\n\nYou can use **a–z**, **0–9** and underscores. Minimum length is **5** characters.",Phone:"Phone",Notifications:"Notifications",AreYouSureDeleteContact:"Are you sure you want to delete this contact?",AreYouSureDeleteAndExit:"Are you sure you want to delete and leave the group?",AreYouSureDeleteAndExitChannel:"Do you want to delete and leave the channel?",DeleteContact:"Delete contact",GroupType:"Group Type",ChannelType:"Channel Type",TypePrivate:"Private",TypePublic:"Public",TypePrivateGroup:"Private",TypePublicGroup:"Public",GroupMembers:"Members",DeleteMega:"Delete Group",DeleteMegaMenu:"Delete group",DeleteAndExitButton:"Delete and Leave Group",ChannelDelete:"Delete Channel",ChannelDeleteMenu:"Delete channel",ChannelPermissions:"Permissions",ChannelPermissionsHeader:"What can members of this group do?",ChannelAddException:"Add Exception",ChannelBlockedUsers:"Removed users",NoBlockedUsers:"No removed users",UserRestrictions:"User Permissions",UserRestrictionsDisabled:"This option is disabled for all members in Group Permissions",UserRestrictionsCanDo:"What can this user do?",UserRestrictionsRead:"Read Messages",UserRestrictionsSend:"Send Messages",UserRestrictionsSendMedia:"Send Media",UserRestrictionsSendPolls:"Send Polls",UserRestrictionsSendStickers:"Send Stickers and GIFs",UserRestrictionsSendPhotos:"Send Photos",UserRestrictionsSendVideos:"Send Videos",UserRestrictionsSendMusic:"Send Music",UserRestrictionsSendFiles:"Send Files",UserRestrictionsSendVoices:"Send Voice Messages",UserRestrictionsSendRound:"Send Video Messages",UserRestrictionsEmbedLinks:"Embed Links",UserRestrictionsChangeInfo:"Change Chat Info",UserRestrictionsPinMessages:"Pin Messages",UserRestrictionsInviteUsers:"Add Users",UserRestrictionsNoSend:"can't send messages",UserRestrictionsNoSendMedia:"no media",UserRestrictionsNoSendPolls:"no polls",UserRestrictionsNoSendStickers:"no stickers & GIFs",UserRestrictionsNoSendPhotos:"no photos",UserRestrictionsNoSendVideos:"no videos",UserRestrictionsNoSendMusic:"no music",UserRestrictionsNoSendDocs:"no files",UserRestrictionsNoSendVoice:"no voice",UserRestrictionsNoSendRound:"no round",UserRestrictionsNoEmbedLinks:"no embed links",UserRestrictionsNoChangeInfo:"can't change Info",UserRestrictionsNoPinMessages:"no pins",UserRestrictionsNoInviteUsers:"can't add users",UserRestrictionsBlock:"Ban and remove from group",ChannelPublic:"Public Channel",MegaPublic:"Public Group",ChannelPublicInfo:"Public channels can be found in search, anyone can join them.",MegaPublicInfo:"Public groups can be found in search, chat history is available to everyone and anyone can join.",ChannelPrivate:"Private Channel",MegaPrivate:"Private Group",ChannelPrivateInfo:"Private channels can only be joined via an invite link.",MegaPrivateInfo:"Private groups can only be joined if you were invited or have an invite link.",ChannelPrivateLinkHelp:"People can join your channel by following this link. You can revoke the link any time.",MegaPrivateLinkHelp:"People can join your group by following this link. You can revoke the link any time.",RevokeButton:"Revoke",RevokeLink:"Revoke Link",RevokeAlert:"Are you sure you want to revoke this link? Once the link is revoked, no one will be able to join using it.",SetUrlPlaceholder:"Link",Subscribers:{one_value:"%1$d subscriber",other_value:"%1$d subscribers"},SearchGifsTitle:"Search GIFs",PinMessageAlert:"Pin this message in the group?",PinMessageAlertTitle:"Pin message",PinMessageAlertChannel:"Do you want to pin this message in this channel?",PinMessageAlertChat:"Do you want to pin this message at the top of the chat?",UnpinMessageAlertTitle:"Unpin message",UnpinMessageAlert:"Do you want to unpin this message?",PinNotify:"Notify all members",PinMessage:"Pin",UnpinMessage:"Unpin",PinAlsoFor:"Also pin for %1$s",DeleteMessagesTitle:"Delete %1$s",DeleteSingleMessagesTitle:"Delete message",DeleteMessagesOption:"Unsend My Messages",DeleteMessagesOptionAlso:"Also delete for %1$s",DeleteForAll:"Delete for all members",DeleteMessagesTextGroup:'You can also delete the %1$s you sent from the inboxes of other group members by checking "Unsend my messages".',LeaveChannel:"Leave Channel",LeaveChannelMenu:"Leave channel",ChannelLeaveAlertWithName:"Are you sure you want to leave **%1$s**?",LeaveMegaMenu:"Leave group",DeleteChatUser:"Delete chat",PleaseEnterCurrentPassword:"Enter your password",PleaseEnterFirstPassword:"Enter a password",PleaseReEnterPassword:"Re-enter your password",Continue:"Continue",YourEmailSkip:"Skip",YourEmailSkipWarning:"Warning",YourEmailSkipWarningText:"No, seriously.\n\nIf you forget your password, you will lose access to your Telegram account. There will be no way to restore it.",TurnPasswordOffQuestionTitle:"Disable password",TurnPasswordOffQuestion:"Are you sure you want to disable your password?",Disable:"Disable",TwoStepVerificationSetPassword:"Set Password",TwoStepVerificationPasswordSet:"Password Set!",TwoStepVerificationPasswordSetInfo:"This password will be required when you log in on a new device in addition to the code you get in the SMS.",TwoStepVerificationPasswordReturnSettings:"Return to Settings",RecoveryEmail:"Recovery email",RecoveryEmailTitle:"Recovery Email",ResendCode:"Resend code",PasswordAsHintError:"Hint must be different from your password",AddStickersCount:"ADD %1$s",RemoveStickersCount:"REMOVE %1$s",Stickers:{one_value:"%1$d sticker",other_value:"%1$d stickers"},HidAccount:"The account was hidden by the user",TelegramFeatures:"Telegram Features",SetColor:"Set a color",Open:"Open",OpenUrlTitle:"Open Link",OpenUrlAlert2:"Do you want to open %1$s?",FilterNoChatsToDisplay:"Folder is empty",FilterNoChatsToDisplayInfo:"No chats currently belong to this folder.",SupportStatus:"support",Lately:"last seen recently",WithinAWeek:"last seen within a week",WithinAMonth:"last seen within a month",ALongTimeAgo:"last seen a long time ago",Online:"online",MessageScheduleSend:"Send Now",MessageScheduleEditTime:"Reschedule",YouLeft:"You left this group",Recent:"Recent",Of:"%1$d of %2$d",NoResult:"No results",Updating:"Updating...",Emoji:"Emoji",AddContactTitle:"Add Contact",HiddenName:"Deleted Account",Seconds:{one_value:"%1$d second",other_value:"%1$d seconds"},Minutes:{one_value:"%1$d minute",other_value:"%1$d minutes"},Hours:{one_value:"%1$d hour",other_value:"%1$d hours"},Days:{one_value:"%1$d day",other_value:"%1$d days"},Weeks:{one_value:"%1$d week",other_value:"%1$d weeks"},Months:{one_value:"%1$d month",other_value:"%1$d months"},Years:{one_value:"%1$d year",other_value:"%1$d years"},TodayAtFormattedWithToday:"today at %1$s",formatDateAtTime:"%1$s at %2$s",JoinByPeekChannelTitle:"Join Channel",JoinByPeekGroupTitle:"Join Group",YouWereKicked:"you were removed",ViaBot:"via",InviteExpired:"This invite link has expired.",NoUsernameFound:"There is no Telegram account with this username.",PrivacyDeleteCloudDrafts:"Delete All Cloud Drafts",AreYouSureClearDraftsTitle:"Delete cloud drafts",AreYouSureClearDrafts:"Are you sure you want to delete all cloud drafts?",BotInfoTitle:"What can this bot do?",ChatYourSelf:"forward here to save",GroupEmptyTitle1:"You have created a **group**.",GroupEmptyTitle2:"Groups can have:",GroupDescription1:"Up to 200,000 members",GroupDescription2:"Persistent chat history",GroupDescription3:"Public links such as t.me/title",GroupDescription4:"Admins with different rights",ChatYourSelfDescription1:"Forward messages here to save them",ChatYourSelfDescription2:"Send media and files to store them",ChatYourSelfDescription3:"Access this chat from any device",ChatYourSelfDescription4:"Use search to quickly find things",ChatYourSelfTitle:"Your cloud storage",ActionYouCreateGroup:"You created the group",NoMessages:"No messages here yet...",NoScheduledMessages:"No scheduled messages here yet...",NoMessagesGreetingsDescription:"Send a message or tap the greeting below.",InviteToGroupError:"Sorry, you can't add this user to groups because of user's privacy settings.",InviteToChannelError:"Sorry, you can't add this user to channels because of user's privacy settings.",AddMembersAlertTitle:"Add %1$s",AddOneMemberAlertTitle:"Add member",AddMembersAlertNamesText:"Are you sure you want to add %1$s to **%2$s**?",AddMembersAlertCountText:"Are you sure you want to add %1$s to **%2$s**?",AddMembersForwardMessages:"Show the last 100 messages to the new members",AddOneMemberForwardMessages:"Show the last 100 messages to **%1$s**",PinToTopLimitReached2:"Sorry, you can only pin %1$s to the top in the main list. More chats can be pinned in Chat Folders and your Archive.",FiltersSetupPinAlert:"Set Up Folders",AppName:"Telegram",OK:"OK",PinFolderLimitReached:"Sorry, you can't pin any more chats to the top.",Send:"Send",ChannelJoin:"JOIN",Yesterday:"yesterday",LeaveAComment:"Leave a comment",ViewInChat:"View in chat",LinkNotFound:"Unfortunately, you can't access this message. You are not a member of the chat where it was posted.",Create:"Create",ViewDiscussion:"View discussion",MessageScheduledUntilOnline:"Scheduled until online",ReportChat:"Report",ReportChatSpam:"Spam",ReportChatViolence:"Violence",ReportChatPornography:"Pornography",ReportChatChild:"Child Abuse",ReportChatOther:"Other",ReportChatDescription:"Description",ReportInfo:"Please enter any additional details relevant to your report.",ReportSentInfo:"Telegram moderators will review your report.\nThank you for your cooperation!",ReportHint:"Additional details...",ChatHistory:"Chat history for new members",ShareContact:"Share contact",SendMessageTitle:"Send message",SendContactToGroupText:"Do you want to send this contact to **%1$s**?",ChannelBroadcast:"Broadcast",ChannelSilentBroadcast:"Silent Broadcast",Comment:"Comment",SendAnonymously:"Send anonymously",DiscardVoiceMessageTitle:"Discard Voice Message",DiscardVoiceMessageDescription:"Are you sure you want to stop recording and discard your voice message?",DiscardVoiceMessageAction:"Discard",AddContact:"Add to contacts",BlockUser:"Block user",MobileHidden:"Mobile hidden",MobileHiddenExceptionInfo:"Phone number will be visible once %1$s adds you as a contact.",FirstName:"First name (required)",LastName:"Last name (optional)",AreYouSureBlockContact2:"Are you sure you want to block **%1$s**?",UserBlocked:"User blocked",UserUnblocked:"User unblocked",AudioUnknownArtist:"Unknown artist",AudioUnknownTitle:"Unknown title",LogOut:"Log out",OnlineCount:{one_value:"%1$d online",other_value:"%1$d online"},EditedMessage:"edited",GlobalSearch:"Global search",SearchMessages:"Messages",SearchAllChatsShort:"Chats",ClearButton:"Clear",FilterAllChats:"All Chats",FilterAllChatsShort:"All",Call:"Call",VideoCall:"Video Call",CallMessageOutgoing:"Outgoing Call",CallMessageIncoming:"Incoming Call",CallMessageVideoOutgoing:"Outgoing Video Call",CallMessageVideoIncoming:"Incoming Video Call",VoipExchangingKeys:"Exchanging encryption keys",VoipUnmute:"Unmute",SavingContentTitle:"Saving content",RestrictSavingContent:"Restrict saving content",RestrictSavingContentInfoGroup:"Members won't be able to copy, save and forward content from this group.",RestrictSavingContentInfoChannel:"Subscribers won't be able to copy, save and forward content from this channel.",ClearOtherSessionsHelp:"Logs out all devices except for this one.",SessionsListInfo:"The official Telegram app is available for Android, iPhone, iPad, Windows, macOS and Linux.",SponsoredMessage:"sponsored",OpenChannelPost:"VIEW POST",FilterNameHint:"Folder name",BotStart:"START",BotUnblock:"RESTART",BotStop:"Stop bot",BotRestart:"Restart bot",ShareYouPhoneNumberTitle:"Share your phone number?",AreYouSureShareMyContactInfoBot:"The bot will know your phone number. This can be useful for integration with other services.",DistanceUnitsTitle:"Distance units",DistanceUnitsKilometers:"Kilometers",DistanceUnitsMiles:"Miles",PeopleNearby:"People Nearby",MakeMyselfVisible:"Make Myself Visible",MakeMyselfVisibleTitle:"Show Your Profile?",MakeMyselfVisibleInfo:"Users nearby will be able to view your profile and send you messages. This may help you find new friends, but could also attract excessive attention. You can stop sharing your profile at any time.\n\nYour phone number will remain hidden.",StopShowingMe:"Stop Showing Me",PeopleNearbyInfo2:"Exchange contact info with people nearby and find new friends.",NearbyCreateGroup:"Create a Local group",AwayTo:"%1$s away",MessagePreview:"Message Preview",KMetersAway2:"%1$s km away",MetersAway2:"%1$s m away",MilesAway:"%1$s mi away",FootsAway:"%1$s ft away",PeopleNearbyHeader:"People nearby",ChatsNearbyHeader:"Groups nearby",ChatLocation:"Location",RequestToJoinGroupDescription:"This group accepts new members only after they are approved by its admins.",RequestToJoinChannelDescription:"This channel accepts new subscribers only after they are approved by its admins.",RequestToJoinSent:"Join request sent",RequestToJoinGroupApproved:"Your request to join the group was approved",RequestToJoinChannelApproved:"Your request to join the channel was approved",Update:"UPDATE",Reactions:"Reactions",DoubleTapSetting:"Quick Reaction",EnableReactions:"Enable Reactions",EnableReactionsChannelInfo:"Allow subscribers to react to channel posts.",EnableReactionsGroupInfo:"Allow members to react to group messages.",AvailableReactions:"Available reactions",NobodyViewed:"Nobody viewed",MessageSeen:{one_value:"Seen",other_value:"%1$d Seen"},DataSettings:"Data and Storage",GroupsAndChannelsHelp:"Change who can add you to groups and channels.",SessionsInfo:"Control your sessions on other devices.",StickersBotInfo:"Artists are welcome to add their own sticker sets using our @stickers bot.",AutomaticMediaDownload:"Automatic media download",AutoDownloadPhotos:"Photos",AutoDownloadVideos:"Videos",AutoDownloadFiles:"Files",AutoDownloadOnAllChats:"On in all chats",AutoDownloadUpToOnAllChats:"Up to %1$s in all chats",AutoDownloadOff:"Off",AutoDownloadOnUpToFor:"Up to %1$s for %2$s",AutoDownloadOnFor:"On for %1$s",AutoDownloadContacts:"Contacts",AutoDownloadPm:"PM",AutoDownloadGroups:"Groups",AutoDownloadChannels:"Channels",AutoDownloadAudioInfo:"Voice messages are tiny, so they're always downloaded automatically.",AutoplayMedia:"Auto-play media",AutoDownloadPhotosTitle:"Auto-download photos",AutoDownloadVideosTitle:"Auto-download videos and GIFs",AutoDownloadFilesTitle:"Auto-download files and music",AutoDownloadMaxFileSize:"Maximum file size",AutodownloadSizeLimitUpTo:"up to %1$s",ResetAutomaticMediaDownload:"Reset Auto-Download Settings",ResetAutomaticMediaDownloadAlertTitle:"Reset settings",ResetAutomaticMediaDownloadAlert:"Are you sure you want to reset auto-download settings?",Reset:"Reset",SendMessageAsTitle:"Send message as...",Devices:"Devices",LanguageName:"English",EditCantEditPermissionsPublic:"This permission is not available in public groups.",VoipUserMicrophoneIsOff:"%s's microphone is off",VoipUserCameraIsOff:"%s's camera is off",PrivacyPhoneInfo4:"This public link opens a chat with you:",ReportChatIllegalDrugs:"Illegal Drugs",ReportChatPersonalDetails:"Personal Details",VoipPeerIncompatible:"**%1$s**'s app is using an incompatible protocol. They need to update their app before you can call them.",TelegramFeaturesUrl:"https://t.me/TelegramTips",ScamMessage:"SCAM",FakeMessage:"FAKE",TextCopied:"Text copied to clipboard",PaymentInvoice:"INVOICE",PaymentTestInvoice:"TEST INVOICE",PaymentReceipt:"Receipt",PaymentCheckout:"Checkout",PaymentTransactionTotal:"Total",PaymentTip:"Tip",PaymentTipOptional:"Tip (Optional)",PaymentCheckoutPay:"PAY %1$s",PaymentCheckoutMethod:"Payment method",PaymentCheckoutProvider:"Payment provider",PaymentCardNumber:"Card Number",PaymentCardSavePaymentInformation:"Save Payment Information",PaymentCardInfo:"Payment info",PaymentCardSavePaymentInformationInfoLine1:"You can save your payment info for future use. It will be stored directly with the payment provider. Telegram has no access to your credit card data.",Done:"Done",PaymentShippingMethod:"Shipping methods",PaymentNoShippingMethod:"Sorry, it is not possible to deliver to your address.",PaymentShippingInfo:"Shipping Information",PaymentShippingAddress:"Shipping address",PaymentShippingAddress1Placeholder:"Address 1 (Street)",PaymentShippingAddress2Placeholder:"Address 2 (Street)",PaymentShippingCityPlaceholder:"City",PaymentShippingStatePlaceholder:"State",PaymentShippingCountry:"Country",PaymentShippingZipPlaceholder:"Postcode",PaymentShippingReceiver:"Receiver",PaymentShippingName:"Full Name",PaymentShippingEmailPlaceholder:"Email",PaymentCheckoutPhoneNumber:"Phone number",PaymentCheckoutShippingMethod:"Shipping method",PaymentShippingSave:"Save Shipping Information",PaymentShippingSaveInfo:"You can save your shipping info for future use.",PaymentInfoHint:"You paid **%1$s** for **%2$s**.",PrivacyPayments:"Payments",PrivacyPaymentsClearInfo:"You can delete your shipping info and instruct all payment providers to remove your saved credit cards. Note that Telegram never stores your credit card data.",PrivacyPaymentsClear:"Clear Payment and Shipping Info",PrivacyPaymentsClearAlertTitle:"Clear payment info",PrivacyPaymentsClearAlertText:"Are you sure you want to clear your payment and shipping info?",PrivacyPaymentsPaymentInfoCleared:"Payment info cleared.",PrivacyPaymentsShippingInfoCleared:"Shipping info cleared.",PrivacyPaymentsPaymentShippingCleared:"Payment and shipping info cleared.",PrivacyClearShipping:"Shipping info",PrivacyClearPayment:"Payment info",Clear:"Clear",Save:"Save",PaymentCheckoutName:"Name",ClearRecentStickersAlertTitle:"Clear recent stickers",ClearRecentStickersAlertMessage:"Do you want to clear all your recent stickers?",PremiumStickersShort:"Premium",FavoriteStickers:"Favorites",AddToFavorites:"Add to Favorites",AddedToFavorites:"Sticker added to Favorites.",RemovedFromFavorites:"Sticker was removed from Favorites",RemovedFromRecent:"Sticker was removed from Recent",DeleteFromFavorites:"Delete from Favorites",DeleteFromRecent:"Remove from Recent",NewChatsFromNonContacts:"New chats from unknown users",ArchiveAndMute:"Archive and Mute",ArchiveAndMuteInfo:"Automatically archive and mute new chats, groups and channels from non-contacts.",PrivacyVoiceMessages:"Voice Messages",PrivacyVoiceMessagesTitle:"Who can send me voice or video messages?",PrivacyVoiceMessagesInfo:"You can restrict who can send you voice or video messages with granular precision.",PrivacyVoiceMessagesPremiumOnly:"Only subscribers of *Telegram Premium* can restrict receiving voice messages.",EmojiCount:{other_value:"%1$d emoji"},AddEmojiNotFound:"Emoji pack not found.",MessageContainsEmojiPack:"This message contains emoji from %s pack.",MessageContainsEmojiPacks:{other_value:"This message contains emoji from **%d Packs**."},EmojiPackCount:{one_value:"%1$d Emoji Pack",other_value:"%1$d Emoji Packs"},ReactionsAll:"All",EnableSomeReactionsInfo:"Members of the group can use only certain approved emoji as reactions to messages.",EnableAllReactionsInfo:"Members of the group can use any emoji as reactions to messages.",DisableReactionsInfo:"Members of the group can’t add any reactions to messages.",OnlyAllowThisReactions:"Only allow these reactions",AllReactions:"All reactions",SomeReactions:"Some reactions",NoReactions:"No reactions",LimitReached:"Limit Reached",LimitReachedPinDialogs:"You can't pin more than %1$d chats to the top. Unpin some that are currently pinned – or subscribe to **Telegram Premium** to double the limit to **%2$d** chats.",LimitReachedPinDialogsPremium:"Sorry, you can't pin more than %1$d chats to the top. Unpin some that are currently pinned.",LimitReachedPinDialogsLocked:"Sorry, you can't pin more than %1$d chats to the top. Unpin some that are currently pinned. We are working to let you increase this limit in the future.",IncreaseLimit:"Increase Limit",LimitFree:"Free",LimitPremium:"Premium",ActionTTLChanged:"un1 set messages to auto-delete in %1$s",ActionTTLYouChanged:"You set messages to auto-delete in %1$s",ActionTTLChannelChanged:"Messages in this channel will be automatically deleted after %1$s",ActionTTLChannelDisabled:"Messages in this channel will no longer be automatically deleted",ActionTTLDisabled:"un1 disabled the auto-delete timer",ActionTTLYouDisabled:"You disabled the auto-delete timer",UsernamesProfileHeader:"Username order",UsernamesProfileHelp:"Drag and drop links to change the order in which they will be displayed on your info page.",UsernamesChannelHelp:"Drag and drop links to change the order in which they will be displayed on the channel info page.",UsernameLinkEditable:"tap to edit",UsernameLinkActive:"active",UsernameLinkInactive:"not active",UsernameActivateLink:"Activate link",UsernameDeactivateLink:"Deactivate link",UsernameActivateLinkProfileMessage:"Do you want to show this link on your info page?",UsernameDeactivateLinkProfileMessage:"Do you want to hide this link from your info page?",UsernameActivateLinkChannelMessage:"Do you want to show this link on the channel info page?",UsernameDeactivateLinkChannelMessage:"Do you want to hide this link from the channel info page?",Hide:"Hide",Show:"Show",UsernameActivateErrorTitle:"Too many active links",UsernameActivateErrorMessage:"Sorry, you have too many active public links already. Please hide one of your active public links first.",ChannelSignMessages:"Sign Messages",TopicWasCreatedAction:"%s was created",Topics:"Topics",ForumToggleDescription:"The group chat will be divided into topics created by admins or users.",AnonymousNumber:"Anonymous Number",Info:"Info",BotSettings:"Settings",OpenMessage:"VIEW MESSAGE",OpenGroup:"VIEW GROUP",CloseTopic:"Close topic",RestartTopic:"Reopen topic",LimitReachedPinnedTopics:"Sorry, you can't pin more than %d topics to the top.",TopicProfileStatus:"In %s",AccDescrTopic:"Topic",DeleteTopics:{one_value:"Delete topic",other_value:"Delete topics"},DeleteSelectedTopic:"Are you sure you want delete %s?",NewTopic:"New Topic",CreateTopicTitle:"Choose a topic name and icon",CreateGeneralTopicTitle:"Choose topic name",EditTopicHide:"Show in Topics",EditTopicHideInfo:"If the 'General' topic is hidden, group members can pull down in the topic list to view it.",OpenUrlOption1:"Log in to %1$s as **%2$s**",OpenUrlOption2:"Allow **%1$s** to send me messages",OtherWebSessions:"Connected websites",WebSessionsTitle:"Logged In with Telegram",TerminateWebSessionText:"Are you sure you want to disconnect %1$s?",Disconnect:"Disconnect",TerminateAllWebSessions:"Disconnect All Websites",AreYouSureWebSessions:"Are you sure you want to disconnect all websites where you logged in with Telegram?",ClearOtherWebSessionsHelp:"You can log in on websites that support signing in with Telegram.",TerminateWebSessionInfo:"Tap to disconnect from your Telegram account.",EnablePhotoSpoiler:"Hide with spoiler",DisablePhotoSpoiler:"Remove spoiler",LimitReachedFolders:"You have reached the limit of **%1$d** folders. You can double the limit to **%2$d** folders by subscribing to **Telegram Premium**.",LimitReachedFoldersPremium:"You have reached the limit of **%1$d** folders for this account.",LimitReachedFoldersLocked:"You have reached the limit of **%1$d** folders for this account. We are working to let you increase this limit in the future.",FwdMessageToSavedMessages:"Message forwarded to **Saved Messages**.",FwdMessagesToSavedMessages:"Messages forwarded to **Saved Messages**.",ColorTheme:"Color theme",SendAsFile:"Send as file",SendAsFiles:"Send as files",ChatThemeChangedYou:"You changed the chat theme to %1$s",ChatThemeChangedTo:"%1$s changed the chat theme to %2$s",ChatThemeDisabled:"%1$s disabled the chat theme",ChatThemeDisabledYou:"You disabled the chat theme",ThemeDay:"Day",ThemeNight:"Night",AutoNightSystemDefault:"System Default",GlobalAttachPlainRestricted:"Sending text messages isn't allowed in this group.",GlobalAttachDocumentsRestricted:"Sending documents isn't allowed in this group.",GlobalAttachMediaRestricted:"Sending media isn't allowed in this group.",GlobalAttachAudioRestricted:"Sending music isn't allowed in this group.",GlobalAttachPhotoRestricted:"Sending photos isn't allowed in this group.",GlobalAttachVideoRestricted:"Sending videos isn't allowed in this group.",GlobalAttachVoiceRestricted:"Sending voice isn't allowed in this group.",GlobalAttachRoundRestricted:"Sending round videos isn't allowed in this group.",GlobalAttachInlineRestricted:"Sending inline content isn't allowed in this group.",GlobalAttachStickersRestricted:"Stickers aren't allowed in this group.",GlobalAttachGifRestricted:"Sending GIFs is not allowed in this group.",GlobalAttachEmojiRestricted:"Text messages aren't allowed in this group.",GlobalSendMessageRestricted:"Sending messages is not allowed in this group.",ErrorSendRestrictedPollsAll:"Sorry, sending polls is not allowed in this group.",Remove:"Remove",ChannelBlockUser:"Remove User",StickersName:"Stickers and Emoji",LoopAnimatedStickersInfo:"Animated stickers will play continuously in chats.",SuggestStickersAll:"All Sets",SuggestStickersInstalled:"My Sets",SuggestStickersNone:"None",DynamicPackOrder:"Dynamic Pack Order",DynamicPackOrderInfo:"Automatically place recently used sticker packs at the front of the panel.",GiftPremium:"Gift Premium",GiftTelegramPremiumTitle:"Gift Telegram Premium",GiftTelegramPremiumDescription:"Give **%1$s** access to exclusive features with **Telegram Premium**.",PricePerMonth:"%1$s / month",GiftSubscriptionFor:"Gift Subscription for %1$s","AccountSettings.Filters":"Chat Folders","AccountSettings.Notifications":"Notifications and Sounds","AccountSettings.PrivacyAndSecurity":"Privacy and Security","AccountSettings.Language":"Language","Alert.UserDoesntExists":"Sorry, this user doesn't seem to exist.","Alert.Confirm.Discard":"Discard","Appearance.Reset":"Reset to Defaults","AutoDownloadSettings.Delimeter":", ","AutoDownloadSettings.LastDelimeter":" and ","Bio.Description":"Any details such as age, occupation or city.\nExample: 23 y.o. designer from San Francisco","Call.Accept":"Accept","Call.Decline":"Decline","Call.End":"End","Call.Camera":"Camera","Call.Mute":"Mute","Call.Recall":"Recall","Call.Close":"Close","Call.Screen":"Screen","Call.Confirm.Discard.Voice.Header":"Video Chat in Progress","Call.Confirm.Discard.Voice.ToVoice.Text":'Leave video chat in "%1$@" and start a new one in "%2$@"?',"Call.Confirm.Discard.Voice.ToCall.Text":'Leave video chat in "%1$@" and start a call with "%2$@"?',"Call.Confirm.Discard.Call.Header":"Call in Progress","Call.Confirm.Discard.Call.ToVoice.Text":'End call with "%1$@" and start a video chat in "%2$@"?',"Call.Confirm.Discard.Call.ToCall.Text":'End call with "%1$@" and start a video chat in "%2$@"?',"Call.PrivacyErrorMessage":"Sorry, you cannot call %@ because of their privacy settings.","Call.StatusRequesting":"Contacting...","Call.StatusRinging":"Ringing...","Call.StatusConnecting":"Connecting...","Call.StatusEnded":"Call Ended","Call.StatusFailed":"Call Failed","Call.StatusBusy":"Busy","Call.StatusCalling":"is calling you...","Contacts.PhoneNumber.NotRegistred":"The person with this phone number is not registered on Telegram yet.","Channel.UsernameAboutChannel":"People can share this link with others and can find your channel using Telegram search.","Channel.UsernameAboutGroup":"People can share this link with others and find your group using Telegram search.","Chat.Accessory.Forward":{one_value:"Forward Message",other_value:"Forward %d Messages"},"Chat.Accessory.Forward.You":"You","Chat.Accessory.Forward.From":"From","Chat.Accessory.Hidden":{one_value:"Forward Message (sender's name hidden)",other_value:"Forward %d Messages (senders' names hidden)"},"Chat.Alert.Forward.Action.Another":"Forward to Another Chat","Chat.Alert.Forward.Action.Hide1":{one_value:"Hide Sender's Name",other_value:"Hide Senders' Names"},"Chat.Alert.Forward.Action.Show1":{one_value:"Show Sender's Name",other_value:"Show Senders' Names"},"Chat.Alert.Forward.Action.ShowCaption":{one_value:"Show Caption",other_value:"Show Captions"},"Chat.Alert.Forward.Action.HideCaption":{one_value:"Hide Caption",other_value:"Hide Captions"},"Chat.CopySelectedText":"Copy Selected Text","Chat.Confirm.Unpin":"Would you like to unpin this message?","Chat.Context.Reacted":"%1$@/%2$@ Reacted","Chat.Context.ReactedFast":{other_value:"%d Reacted"},"Chat.Date.ScheduledFor":"Scheduled for %@","Chat.Date.ScheduledForToday":"Scheduled for today","Chat.DropTitle":"Drop files here to send them","Chat.DropQuickDesc":"in a quick way","Chat.DropAsFilesDesc":"without compression","Chat.Edit.Cancel.Text":"Are you sure you want to discard all changes?","Chat.Input.ReplyToAnswer":"Reply to message in topics","Chat.SendVoice.PrivacyError":"%@ doesn't accept voice and video messages","Chat.Service.Call.Cancelled":"Cancelled","Chat.Service.Call.Missed":"Missed","Chat.Service.PeerJoinedTelegram":"%@ joined Telegram","Chat.Service.Channel.UpdatedTitle":'Channel renamed to "%@"',"Chat.Service.Channel.UpdatedPhoto":"Channel photo updated","Chat.Service.Channel.RemovedPhoto":"Channel photo removed","Chat.Service.Channel.UpdatedVideo":"Channel video updated","Chat.Service.BotPermissionAllowed":"You allowed this bot to message you when you logged in on %@","Chat.Service.Group.UpdatedPinnedMessage":'%@ pinned "%@"',"Chat.Service.Group.TopicEdited.Icon":"%1$@ changed topic icon to %2$@","Chat.Service.Group.TopicEdited.Icon.Removed":"%1$@ removed icon","Chat.Service.Group.TopicEdited.Title":'%1$@ changed topic name to "%2$@"',"Chat.Service.Group.TopicEdited.Paused":"%1$@ closed topic","Chat.Service.Group.TopicEdited.Resumed":"%1$@ restarted topic","Chat.Service.Group.TopicEdited.You.Icon":"You changed topic icon to %1$@","Chat.Service.Group.TopicEdited.You.Icon.Removed":"You removed icon","Chat.Service.Group.TopicEdited.You.Title":'You changed topic name to "%1$@"',"Chat.Service.Group.TopicEdited.You.Paused":"You closed topic","Chat.Service.Group.TopicEdited.You.Resumed":"You restarted topic","Chat.Service.Group.TopicEdited.You.Hided":"You hid the general topic","Chat.Service.Group.TopicEdited.You.Unhided":"You unhid the general topic","Chat.Service.Group.TopicEdited.Hided":"%1$@ hid the general topic","Chat.Service.Group.TopicEdited.Unhided":"%1$@ unhid the general topic","Chat.Service.PaymentSent1":"You have successfully transferred **%1$@** to **%2$@** for **%3$@**","Chat.Service.PaymentSent1NoTitle":"You have successfully transferred **%1$@** to **%2$@**","Chat.Service.PaymentSentRecurringInit":"You successfully transferred **%1$@** to **%2$@** for **%3$@** and allowed future recurring payments","Chat.Service.PaymentSentRecurringInitNoTitle":"You successfully transferred **%1$@** to **%2$@** and allowed future recurring payments","Chat.Service.PaymentSentRecurringUsed":"You have just successfully transferred **%1$@** to **%2$@** for **%3$@** via recurrent payments","Chat.Service.PaymentSentRecurringUsedNoTitle":"You have just successfully transferred **%1$@** to **%2$@** via recurrent payments","Chat.Service.VoiceChatStarted":"%1$@ started a [video chat](open)","Chat.Service.VoiceChatStartedYou":"You started a [video chat](open)","Chat.Service.VoiceChatStarted.Channel":"[Live Stream](open) started","Chat.Service.VoiceChatFinished":"%1$@ ended the video chat (%2$@)","Chat.Service.VoiceChatFinishedYou":"You ended the video chat (%@)","Chat.Service.VoiceChatFinished.Channel":"Live Stream ended (%1$@)","Chat.Service.VoiceChatInvitation":"%1$@ invited %2$@ to the [video chat](open)","Chat.Service.VoiceChatInvitationByYou":"You invited %1$@ to the [video chat](open)","Chat.Service.VoiceChatInvitationForYou":"%1$@ invited you to the [video chat](open)","ChatService.UserJoinedGroupByRequest":"%@ was accepted to the group","ChatService.UserJoinedChannelByRequest":"%@ joined the channel by request","ChatList.Service.VoiceChatScheduled":"%1$@ scheduled a video chat for %2$@","ChatList.Service.VoiceChatScheduledYou":"You scheduled a video chat for %2$@","Chat.Poll.Unvote":"Retract Vote","Chat.Poll.Stop":"Stop Poll","Chat.Poll.ViewResults":"View Results","Chat.Poll.SubmitVote":"Vote","Chat.Poll.Type.Anonymous":"Anonymous Poll","Chat.Poll.Type.Public":"Poll","Chat.Poll.Type.AnonymousQuiz":"Anonymous Quiz","Chat.Poll.Type.Quiz":"Quiz","Chat.Poll.Type.Closed":"Final Results","Chat.Poll.TotalVotes1":{one_value:"%d vote",other_value:"%d votes"},"Chat.Quiz.TotalVotes":{one_value:"%d answer",other_value:"%d answers"},"Chat.Poll.TotalVotesEmpty":"No votes yet","Chat.Poll.TotalVotesResultEmpty":"No votes","Chat.Quiz.TotalVotesEmpty":"No answers yet","Chat.Quiz.TotalVotesResultEmpty":"No answers","Chat.Pinned.DontShow":"Don't Show Pinned Messages","Chat.Title.Comments":{one_value:"%d Comment",other_value:"%d Comments"},"ChatTitle.ReportMessages":"Report Messages","Chat.Send.WithoutSound":"Send Without Sound","Chat.Send.SetReminder":"Set a Reminder","Chat.Send.ScheduledMessage":"Schedule Message","Chat.SendAs.PersonalAccount":"personal account","Chat.UnpinAllMessagesConfirmation":{one_value:"Do you want to unpin %d message in this chat?",other_value:"Do you want to unpin all %d messages in this chat?"},"Chat.Message.Ad.Text":"Unlike other apps, Telegram never uses your private data to target ads. Sponsored messages on Telegram are based solely on the topic of the public channels in which they are shown. This means that no user data is mined or analyzed to display ads, and every user viewing a channel on Telegram sees the same sponsored messages.\n\nUnlike other apps, Telegram doesn't track whether you tapped on a sponsored message and doesn't profile you based on your activity. We also prevent external links in sponsored messages to ensure that third parties can’t spy on our users. We believe that everyone has the right to privacy, and technological platforms should respect that.\n\nTelegram offers a free and unlimited service to hundreds of millions of users, which involves significant server and traffic costs. In order to remain independent and stay true to its values, Telegram developed a paid tool to promote messages with user privacy in mind. We welcome responsible advertisers at:\n\n%@\n\nSponsored Messages are currently in test mode. Once they are fully launched and allow Telegram to cover its basic costs, we will start sharing ad revenue with the owners of public channels in which sponsored messages are displayed.\n\nOnline ads should no longer be synonymous with abuse of user privacy. Let us redefine how a tech company should operate – together.","Chat.Message.Ad.ReadMore":"Read More","Chat.Message.ViewChannel":"VIEW CHANNEL","Chat.Message.ViewBot":"VIEW BOT","Chat.Message.ViewGroup":"VIEW GROUP","Chat.Message.Sponsored.What":"What are sponsored messages?","Chat.Message.Sponsored.Link":"https://promote.telegram.org","Chat.Voice.Transribe.Error":"No speech detected","Checkout.2FA.Text":"Saving payment details is only available with 2-Step Verification.","Checkout.NewCard.CardholderNamePlaceholder":"Cardholder Name","Checkout.PasswordEntry.Title":"Payment Confirmation","Checkout.PasswordEntry.Pay":"Pay","Checkout.PasswordEntry.Text":"Your card %@ is on file. To pay with this card, please enter your 2-Step-Verification password.","Checkout.PayPrice":"Pay %@","Checkout.WebConfirmation.Title":"Complete Payment","ChatList.Context.Mute":"Mute","ChatList.Context.Unmute":"Unmute","ChatList.Context.Pin":"Pin","ChatList.Context.Unpin":"Unpin","ChatList.Context.DeleteChat":"Delete Chat","ChatList.Context.DeleteAndExit":"Delete and Leave","ChatList.Context.LeaveChannel":"Leave Channel","ChatList.Context.LeaveGroup":"Leave Group","ChatList.Service.Call.incoming":"Incoming Call (%@)","ChatList.Service.Call.outgoing":"Outgoing Call (%@)","ChatList.Service.VideoCall.incoming":"Incoming Video Call (%@)","ChatList.Service.VideoCall.outgoing":"Outgoing Video Call (%@)","ChatList.Service.Call.Cancelled":"Cancelled Call","ChatList.Service.Call.Missed":"Missed Call","ChatList.Service.VideoCall.Cancelled":"Cancelled Video Call","ChatList.Service.VideoCall.Missed":"Missed Video Call","ChatList.Service.VoiceChatScheduled.Channel":"Voice chat scheduled for %@","ChatList.Filter.Header":"Create folders for different groups of chats and quickly switch between them.","ChatList.Filter.NewTitle":"Create Folder","ChatList.Filter.List.Title":"Chat Folders","ChatList.Filter.Include.AddChat":"Add Chats","ChatList.Filter.Exclude.AddChat":"Add Chats","ChatList.Filter.Contacts":"Contacts","ChatList.Filter.NonContacts":"Non-Contacts","ChatList.Filter.Groups":"Groups","ChatList.Filter.Channels":"Channels","ChatList.Filter.Bots":"Bots","ChatList.Filter.MutedChats":"Muted","ChatList.Filter.ReadChats":"Read","ChatList.Filter.Archive":"Archived","ChatList.Filter.Include.LimitReached":"Sorry, you can only add up to 100 individual chats. Try using chat types.","ChatList.Filter.Exclude.LimitReached":"Sorry, you can only add up to 100 individual chats. Try using chat types.","ChatList.Filter.Confirm.Remove.Header":"Remove Folder","ChatList.Filter.Confirm.Remove.Text":"Are you sure you want to remove this folder? Your chats will not be deleted.","ChatList.Mute.1Hour":"For 1 Hour","ChatList.Mute.4Hours":"For 4 Hours","ChatList.Mute.8Hours":"For 8 Hours","ChatList.Mute.1Day":"For 1 Day","ChatList.Mute.3Days":"For 3 Days","ChatList.Mute.Forever":"Forever","Channel.DescriptionHolderDescrpiton":"You can provide an optional description for your channel.","Channel.Persmission.MessageBlock":"Text is not Allowed","ChannelVisibility.Confirm.MakePrivate.Channel":"If you make this channel private, the name @%@ will be removed. Anyone else will be able to take it for their public groups or channels.","ChannelVisibility.Confirm.MakePrivate.Group":"If you make this group private, the name @%@ will be removed. Anyone else will be able to take it for their public groups or channels.","Context.ViewStickerSet":"View Sticker Set","CreateGroup.NameHolder":"Group Name","CustomEmoji.PremiumAlert":"Subscribe to Telegram Premium to unlock this emoji. [Read More]()","Date.Today":"Today","DeleteChat.DeleteGroupForAll":"Delete for all members",DeleteChannelForAll:"Delete for all subscribers","ForumTopic.Context.Info":"Group Info","ForumTopic.Context.AddMember":"Add Members","ForumTopic.Context.ShowAsMessages":"View as Messages","ForumTopic.Context.New":"Create Topic","ForumTopic.Name.Placeholder":"Topic Name","ForumTopic.Title.Edit":"Edit Topic","EditAccount.Username":"Username","EditAccount.Title":"Edit Profile","EditAccount.Logout":"Log Out","Emoji.Recent":"Frequently Used","Emoji.SmilesAndPeople":"Smileys & People","Emoji.AnimalsAndNature":"Animals & Nature","Emoji.FoodAndDrink":"Food & Drink","Emoji.ActivityAndSport":"Activity & Sport","Emoji.TravelAndPlaces":"Travel & Places","Emoji.Objects":"Objects","Emoji.Flags":"Flags","Error.AnError":"An error occurred. Please try again later.","FileSize.B":"%@ B","FileSize.KB":"%@ KB","FileSize.MB":"%@ MB","FileSize.GB":"%@ GB","InstalledStickers.LoopAnimated":"Loop Animated Stickers","LastSeen.HoursAgo":{one_value:"last seen %d hour ago",other_value:"last seen %d hours ago"},"Login.Register.LastName.Placeholder":"Last Name","LiteMode.Title":"Power Saving","LiteMode.Key.emoji.Title":"Emoji Animations","LiteMode.Key.gif.Title":"Autoplay GIFs","LiteMode.Key.video.Title":"Autoplay Videos","LiteMode.Key.stickers.Title":"Sticker Animations","LiteMode.Key.animations.Title":"Interface Animations","LiteMode.Info":"Reduce all power-intensive animations and improve performance.","LiteMode.EnableText":"Power Saving Mode","LiteMode.DisableAlert":"Disable Power Saving Mode","Message.Context.Select":"Select","Message.Context.Pin":"Pin","Message.Context.Unpin":"Unpin","Message.Context.Goto":"Show Message","Message.ReplyActionButtonShowReceipt":"Show Receipt","MessageContext.CopyMessageLink1":"Copy Message Link","Modal.Send":"Send","NewContact.Exception.ShareMyPhoneNumber":"Share My Phone Number","NewContact.Exception.ShareMyPhoneNumber.Desc":"You can make your phone visible to %@.","NewPoll.Anonymous":"Anonymous Voting","NewPoll.Explanation.Placeholder":"Add a Comment (Optional)","NewPoll.OptionsAddOption":"Add an Option","NewPoll.MultipleChoice":"Multiple Answers","NewPoll.Quiz":"Quiz Mode","Notification.Contact.Reacted":'%1$@ to your "%2$@"',"Payments.Recurrent.Accept":"I accept [Terms of Service]() of **%@**.","Peer.Activity.User.PlayingGame":"playing a game","Peer.Activity.User.TypingText":"typing","Peer.Activity.User.SendingPhoto":"sending a photo","Peer.Activity.User.RecordingVideo":"recording video","Peer.Activity.User.SendingVideo":"sending a video","Peer.Activity.User.RecordingAudio":"recording voice","Peer.Activity.User.SendingFile":"sending file","Peer.Activity.User.ChoosingSticker":"choosing a sticker","Peer.Activity.User.EnjoyingAnimations":"watching %@","Peer.Activity.Chat.PlayingGame":"%@ is playing a game","Peer.Activity.Chat.TypingText":"%@ is typing","Peer.Activity.Chat.SendingPhoto":"%@ is sending a photo","Peer.Activity.Chat.RecordingVideo":"%@ is recording video","Peer.Activity.Chat.SendingVideo":"%@ is sending a video","Peer.Activity.Chat.RecordingAudio":"%@ is recording voice","Peer.Activity.Chat.SendingFile":"%@ is sending a file","Peer.Activity.Chat.ChoosingSticker":"%@ is choosing a sticker","Peer.Activity.Chat.EnjoyingAnimations":"%@ is watching %@","Peer.Activity.Chat.Multi.PlayingGame1":"%@ and %d others are playing a game","Peer.Activity.Chat.Multi.TypingText1":"%@ and %d others are typing","Peer.Activity.Chat.Multi.SendingPhoto1":"%@ and %d others are sending photos","Peer.Activity.Chat.Multi.RecordingVideo1":"%@ and %d others are recording video","Peer.Activity.Chat.Multi.SendingVideo1":"%@ and %d others are sending videos","Peer.Activity.Chat.Multi.RecordingAudio1":"%@ and %d others are recording voice","Peer.Activity.Chat.Multi.SendingFile1":"%@ and %d others are sending files","Peer.Activity.Chat.Multi.ChoosingSticker1":"%@ and %d others are choosing stickers","Peer.ServiceNotifications":"service notifications","Peer.RepliesNotifications":"Reply Notifications","Peer.Status.justNow":"last seen just now","Peer.Status.Today":"today","Peer.Status.Yesterday":"yesterday","Peer.Status.LastSeenAt":"last seen %@ at %@","Peer.Status.minAgo":{one_value:"last seen %d minute ago",other_value:"last seen %d minutes ago"},"Peer.Status.Member":{one_value:"%d member",other_value:"%d members"},"Peer.Status.Subscribers":{one_value:"%d subscriber",other_value:"%d subscribers"},"PeerInfo.Administrators":"Administrators","PeerInfo.DeleteChannel":"Delete Channel","PeerInfo.Discussion":"Discussion","PeerInfo.Discussion.Add":"Add","PeerInfo.SharedMedia":"Shared Media","PeerInfo.Subscribers":"Subscribers","PeerInfo.DeleteContact":"Delete Contact","PeerInfo.Action.VoiceChat":"Video Chat","PeerInfo.Action.LiveStream":"Live Stream","PeerInfo.Phone.AnonymousInfo":"This number is not tied to a SIM card and was acquired on [Fragment]().","PeerMedia.Members":"Members","PollResults.Title.Poll":"Poll Results","PollResults.Title.Quiz":"Quiz Results","PollResults.LoadMore":{other_value:"Show More (%d)"},"Preview.Dragging.AddItems":{one_value:"Add Item",other_value:"Add Items"},"PreviewSender.CaptionPlaceholder":"Add a caption...","PreviewSender.CompressFile":"Send compressed","PreviewSender.SendFile":{one_value:"Send File",other_value:"Send %d Files"},"PreviewSender.SendPhoto":{one_value:"Send Photo",other_value:"Send %d Photos"},"PreviewSender.SendVideo":{one_value:"Send Video",other_value:"Send %d Videos"},"PrivacyAndSecurity.Item.On":"On","PrivacyAndSecurity.Item.Off":"Off","PrivacyAndSecurity.SensitiveText":"Disable filtering","PrivacyAndSecurity.SensitiveDesc":"Display sensitive media in public channels on all your Telegram devices.","PrivacySettings.VoiceCalls":"Calls","PrivacySettings.Forwards":"Forwarded Messages","PrivacySettings.Groups":"Groups and Channels","PrivacySettingsController.AddUsers":"Add Users","PrivacySettingsController.GroupDescription":"You can restrict who can add you to groups and channels with granular precision.","PrivacySettingsController.Forwards.CustomHelp":"You can restrict who can add a link to your account when forwarding your messages.","PrivacySettingsController.P2p.Desc":"Disabling peer-to-peer will relay all calls through Telegram servers to avoid revealing your IP address, but may slightly decrease audio and video quality.","PrivacySettingsController.PhoneCallDescription":"You can restrict who can call you with granular precision.","PrivacySettingsController.ProfilePhoto.CustomHelp":"You can restrict who can see your profile photo with granular precision.","PrivacySettingsController.LastSeenDescription":"You won't see Last Seen and Online statuses for people with whom you don't share yours. Approximate last seen will be shown instead (recently, within a week, within a month).","PrivacySettingsController.PeerInfo":"You can add users or entire groups as exceptions that will override the settings above.","PrivacySettingsController.Everbody":"Everybody","PrivacySettingsController.MyContacts":"My Contacts","PrivacySettingsController.Nobody":"Nobody","PrivacySettingsController.NeverShare":"Never Share With","PrivacySettingsController.AlwaysShare":"Always Share With","PrivacySettingsController.NeverAllow":"Never Allow","PrivacySettingsController.AlwaysAllow":"Always Allow","PrivacySettingsController.UserCount":{one_value:"%d user",other_value:"%d users"},"RecentSessions.Error.FreshReset":"For security reasons, you can't terminate older sessions from a device that you've just connected. Please use an earlier connection or wait for a few hours.","RequestJoin.Button":"Request to Join","Stickers.SearchAdd":"Add","Stickers.SearchAdded":"Added","Stickers.SuggestStickers":"Suggest Stickers by Emoji","ShareModal.Search.Placeholder":"Share to...","ShareModal.Search.ForwardPlaceholder":"Forward to...","Telegram.GeneralSettingsViewController":"General Settings","Telegram.InstalledStickerPacksController":"Stickers","Telegram.NotificationSettingsViewController":"Notifications","Telegram.LanguageViewController":"Language","Text.CopyLabel_About":"Copy About","Text.CopyLabel_Bio":"Copy Bio","Text.CopyLabel_PhoneNumber":"Copy Phone Number","Text.CopyLabel_Username":"Copy Username","Text.CopyLabel_ShareLink":"Copy Share Link","GeneralSettings.BigEmoji":"Large Emoji","GeneralSettings.EmojiPrediction":"Suggest Emoji","GroupPermission.Delete":"Delete Exception","Search.Confirm.ClearHistory":"Are you sure you want to clear your search history?","SecureId.Identity.Placeholder.ExpiryDate":"Expiry Date","Separator.ShowMore":"show more","Separator.ShowLess":"show less","ScheduleController.at":"at","Schedule.SendToday":"Send today at %@","Schedule.SendDate":"Send on %@ at %@","Schedule.SendWhenOnline":"Send When Online","Sticker.Premium.Click.Info":"This pack contains premium stickers like this one. [View Pack]()","Stickers.Recent":"Recent","StickerSet.DontExist":"Sorry, this sticker set doesn't seem to exist.","Text.Context.Copy.Username":"Copy Username","Text.Context.Copy.Hashtag":"Copy Hashtag","Time.TomorrowAt":"tomorrow at %@","TwoStepAuth.SetPasswordHelp":"You can set a password that will be required when you log in on a new device in addition to the code you get in the SMS.","TwoStepAuth.GenericHelp":"You have enabled Two-Step verification.\nYou'll need the password you set up here to log in to your Telegram account.","TwoStepAuth.ChangePassword":"Change Password","TwoStepAuth.RemovePassword":"Turn Password Off","TwoStepAuth.SetupEmail":"Set Recovery Email","TwoStepAuth.ChangeEmail":"Change Recovery Email","TwoStepAuth.ConfirmEmailCodeDesc":"Please enter the code we've just emailed to %@.","TwoStepAuth.RecoveryTitle":"Email Code","TwoStepAuth.RecoveryCode":"Code","TwoStepAuth.RecoveryCodeInvalid":"Invalid code. Please try again.","TwoStepAuth.RecoveryCodeExpired":"Code Expired","TwoStepAuth.SetupHintTitle":"Password Hint","TwoStepAuth.SetupHintPlaceholder":"Hint","VoiceChat.Chat.StartNew":"Video chat ended. Start a new one?","VoiceChat.Chat.StartNew.OK":"Start","VoiceChat.Chat.Ended":"Video chat ended.","VoiceChat.Invite.InviteMembers":"Invite members","VoiceChat.Status.Connecting":"Connecting...","VoiceChat.Status.Members":{one_value:"%d participant",other_value:"%d participants"},"VoiceChat.Status.MutedForYou":"muted for you","VoiceChat.Status.Speaking":"speaking","VoiceChat.Status.Listening":"listening","VoiceChat.Status.WantsSpeak":"wants to speak","VoiceChat.Status.Muted":"muted","VoiceChat.Status.You":"This is you","VoiceChat.Video.Stream.Video":"video","VoiceChat.Video.Stream.Screencast":"screen","VoiceChat.Video.Stream.More":"more","VoiceChat.Leave":"Leave","VoiceChat.End.Title":"Leave video chat","VoiceChat.End.Text":"Are you sure you want to leave this video chat?","VoiceChat.End.Third":"End Video Chat","VoiceChat.End.OK":"Leave","VoiceChat.MutePeer":"Mute","VoiceChat.UnmutePeer":"Allow To Speak","VoiceChat.RemovePeer":"Remove","VoiceChat.OpenProfile":"Open Profile","VoiceChat.MuteForMe":"Mute For Me","VoiceChat.UnmuteForMe":"Unmute For Me","VoiceChat.RemovePeer.Confirm.Channel":"Do you want to remove %1$@ from the channel?","VoiceChat.RemovePeer.Confirm":"Are you sure you want to remove %1$@ from the group?","VoiceChat.RemovePeer.Confirm.OK":"Remove"}}}]); +//# sourceMappingURL=104.be090b1ee184fa23f913.chunk.js.map \ No newline at end of file diff --git a/public/104.f1b4b4be86382aaf84f5.chunk.js.map b/public/104.be090b1ee184fa23f913.chunk.js.map similarity index 69% rename from public/104.f1b4b4be86382aaf84f5.chunk.js.map rename to public/104.be090b1ee184fa23f913.chunk.js.map index 37bdd00f..21fa0c75 100644 --- a/public/104.f1b4b4be86382aaf84f5.chunk.js.map +++ b/public/104.be090b1ee184fa23f913.chunk.js.map @@ -1 +1 @@ -{"version":3,"file":"104.f1b4b4be86382aaf84f5.chunk.js","mappings":"yHAAA,MAy4CA,EAz4Ca,CACX,WAAc,aACd,YAAe,QACf,uBAAwB,MACxB,uBAAwB,MACxB,gCAAiC,gBACjC,SAAY,YACZ,yBAA4B,qFAC5B,iBAAoB,gBACpB,iBAAoB,cACpB,gBAAmB,aACnB,kBAAqB,eACrB,qBAAwB,mBACxB,kBAAqB,eACrB,cAAiB,WACjB,2BAA4B,gBAC5B,6BAA8B,OAC9B,uBAAwB,iBACxB,6BAA8B,sBAC9B,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qBAC1B,0BAA2B,wBAC3B,mCAAoC,kDACpC,4BAA6B,aAC7B,2BAA4B,OAC5B,kCAAmC,kCACnC,kCAAmC,eACnC,6BAA8B,gBAC9B,mCAAoC,OACpC,0BAA2B,qCAC3B,6BAA8B,QAC9B,uBAAwB,oBACxB,iCAAkC,iBAClC,8BAA+B,gBAC/B,2BAA4B,CAC1B,UAAa,iBACb,YAAe,mBAEjB,+BAAgC,gBAChC,4BAA6B,WAC7B,6BAA8B,YAC9B,8BAA+B,iBAC/B,yBAA0B,QAC1B,uBAAwB,cACxB,+BAAgC,QAChC,oCAAqC,SACrC,8BAA+B,OAC/B,kBAAmB,QACnB,sBAAuB,mBACvB,qBAAsB,kDACtB,sBAAuB,iBACvB,mBAAoB,QACpB,qBAAsB,OACtB,uBAAwB,iBACxB,uBAAwB,SACxB,wBAAyB,eACzB,sBAAuB,cACvB,wBAAyB,gBACzB,uCAAwC,+CACxC,+BAAgC,uDAChC,kCAAmC,S","sources":["webpack://tweb/./src/lang.ts"],"sourcesContent":["const lang = {\n 'Animations': 'Animations',\n 'AttachAlbum': 'Album',\n 'Appearance.Color.Hex': 'HEX',\n 'Appearance.Color.RGB': 'RGB',\n 'BlockModal.Search.Placeholder': 'Block user...',\n 'DarkMode': 'Dark Mode',\n 'FilterIncludeExcludeInfo': 'Choose chats and types of chats that will\\nappear and never appear in this folder.',\n 'FilterMenuDelete': 'Delete Folder',\n 'FilterHeaderEdit': 'Edit Folder',\n 'FilterAllGroups': 'All Groups',\n 'FilterAllContacts': 'All Contacts',\n 'FilterAllNonContacts': 'All Non-Contacts',\n 'FilterAllChannels': 'All Channels',\n 'FilterAllBots': 'All Bots',\n 'EditContact.OriginalName': 'original name',\n 'EditProfile.FirstNameLabel': 'Name',\n 'EditProfile.BioLabel': 'Bio (optional)',\n 'EditProfile.Username.Label': 'Username (optional)',\n 'EditProfile.Username.Available': 'Username is available',\n 'EditProfile.Username.Taken': 'Username is already taken',\n 'EditProfile.Username.Invalid': 'Username is invalid',\n 'ExceptionModal.Search.Placeholder': 'Add exception...',\n 'Chat.Menu.SelectMessages': 'Select Messages',\n 'Chat.Menu.ClearSelection': 'Clear Selection',\n 'Chat.Menu.Hint': 'To **edit** or **reply**, close this menu.\\nThen tap next to a message.',\n 'Chat.Input.UnpinAll': 'Unpin All Messages',\n 'Chat.Input.Attach.PhotoOrVideo': 'Photo or Video',\n 'Chat.Input.Attach.Document': 'Document',\n 'Chat.Subscribe': 'SUBSCRIBE',\n 'Chat.Selection.LimitToast': 'Max selection count reached.',\n 'Chat.Search.MessagesFound': {\n 'one_value': '%d message found',\n 'other_value': '%d messages found'\n },\n 'Chat.Search.NoMessagesFound': 'No messages found',\n 'Chat.Search.PrivateSearch': 'Private Search',\n 'Chat.Service.TopicEdited.Mixed': '%1$@ changed the topic name and icon to %2$@',\n 'Chat.Service.TopicEdited.You.Mixed': 'You changed the topic name and icon to %2$@',\n 'Chat.Service.TopicEdited.Mixed.IconRemoved': '%1$@ changed the topic name to \"%1$@\" and removed icon',\n 'Chat.Service.TopicEdited.You.Mixed.IconRemoved': 'You changed the topic name to \"%1$@\" and removed icon',\n 'ChatList.Main.EmptyPlaceholder.Title': 'Your chats will appear here',\n 'ChatList.Main.EmptyPlaceholder.Subtitle': 'You have %s on Telegram',\n 'ChatList.Main.EmptyPlaceholder.SubtitleNoContacts': 'Use Telegram app on your [Android](https://telegram.org/android) or [iOS](https://telegram.org/dl/ios) device to sync your contacts',\n // \"ChatList.Menu.Archived\": \"Archived\",\n 'ChatList.Menu.SwitchTo.Webogram': 'Switch to Old Version',\n 'ChatList.Menu.SwitchTo.Z': 'Switch to Z version',\n 'ChatMigration.From': 'Migrated from %s',\n 'ChatMigration.To': 'Migrated to %s',\n 'ConnectionStatus.ForceReconnect': 'force reconnect',\n 'ConnectionStatus.ReconnectIn': 'Reconnect in %ds, %s',\n 'ConnectionStatus.Reconnect': 'reconnect',\n 'ConnectionStatus.Reconnecting': 'Reconnecting...',\n 'ConnectionStatus.TimedOut': 'Request timed out, %s',\n 'ConnectionStatus.Waiting': 'Waiting for network...',\n 'Contacts.Count': {\n 'one_value': '%d contact',\n 'other_value': '%d contacts'\n },\n 'Deactivated.Title': 'Too many tabs...',\n 'Deactivated.Subtitle': 'Telegram supports only one active tab with the app.\\nClick anywhere to continue using this tab.',\n 'Deactivated.Version.Title': 'WebK has updated...',\n 'Deactivated.Version.Subtitle': 'Another tab is running a newer version of Telegram.\\nClick anywhere to reload this tab.',\n // \"Drafts\": {\n // \"one_value\": \"%d draft\",\n // \"other_value\": \"%d drafts\",\n // },\n 'General.Keyboard': 'Keyboard',\n 'General.SendShortcut.Enter': 'Send by Enter',\n 'General.SendShortcut.CtrlEnter': 'Send by %s + Enter',\n 'General.SendShortcut.NewLine.ShiftEnter': 'New line by Shift + Enter',\n 'General.SendShortcut.NewLine.Enter': 'New line by Enter',\n 'General.TimeFormat': 'Time Format',\n 'General.TimeFormat.h12': '12-hour',\n 'General.TimeFormat.h23': '24-hour',\n 'ChatBackground.UploadWallpaper': 'Upload Wallpaper',\n 'ChatBackground.Blur': 'Blur Wallpaper Image',\n 'Notifications.Sound': 'Notification Sound',\n 'NewPrivateChat': 'New Private Chat',\n 'NewPoll.OptionLabel': 'Option %d',\n 'Message.Context.Selection.Copy': 'Copy selected',\n 'Message.Context.Selection.Clear': 'Clear selection',\n 'Message.Context.Selection.Delete': 'Delete selected',\n 'Message.Context.Selection.Forward': 'Forward selected',\n 'Message.Context.Selection.Download': 'Download selected',\n 'Message.Context.Selection.SendNow': 'Send Now selected',\n 'Message.Unsupported.Desktop': '__This message is currently not supported on Telegram Web. Try [getdesktop.telegram.org](https://getdesktop.telegram.org/)__',\n 'Message.Unsupported.Mobile': '__This message is currently not supported on Telegram Web. Try [telegram.org/dl](https://telegram.org/dl/)__',\n 'Checkbox.Enabled': 'Enabled',\n 'Checkbox.Disabled': 'Disabled',\n 'Error.PreviewSender.CaptionTooLong': 'Caption is too long.',\n 'PreviewSender.GroupItems': 'Group items',\n 'PreviewSender.SendAlbum': {\n 'one_value': 'Send Album',\n 'other_value': 'Send %d Albums'\n },\n 'Presence.YourChat': 'chat with yourself',\n 'Privacy.Devices': {\n 'one_value': '%1$d device',\n 'other_value': '%1$d devices'\n },\n 'Privacy.Websites': {\n 'one_value': '%1$d website',\n 'other_value': '%1$d websites'\n },\n 'Privacy.SensitiveContent': 'Sensitive Content',\n 'PrivacyModal.Search.Placeholder': 'Add Users or Groups...',\n 'Permissions.NoExceptions': 'No exceptions',\n 'Permissions.ExceptionsCount': {\n 'one_value': '%d exception',\n 'other_value': '%d exceptions'\n },\n 'Permissions.RemoveFromGroup': 'Are you sure you want to remove **%s** from the group?',\n 'PWA.Install': 'Install App',\n 'Link.Available': 'Link is available',\n 'Link.Taken': 'Link is already taken',\n 'Link.Invalid': 'Link is invalid',\n 'LiteMode.Key.chat.Title': 'Chat Animations',\n 'LiteMode.Key.chat_background.Title': 'Background rotation',\n 'LiteMode.Key.chat_spoilers.Title': 'Animated spoiler effect',\n 'LiteMode.Key.stickers_panel.Title': 'Autoplay in panel',\n 'LiteMode.Key.stickers_chat.Title': 'Autoplay in chat',\n 'LiteMode.Key.emoji_panel.Title': 'Autoplay in panel',\n 'LiteMode.Key.emoji_messages.Title': 'Autoplay in messages',\n 'LiteMode.Key.effects.Title': 'Interactive Effects',\n 'LiteMode.Key.effects_reactions.Title': 'Reaction effect',\n 'LiteMode.Key.effects_premiumstickers.Title': 'Premium stickers effect',\n 'LiteMode.Key.effects_emoji.Title': 'Emoji effect',\n 'StickersTab.SearchPlaceholder': 'Search Stickers',\n 'ForwardedFrom': 'Forwarded from %s',\n 'Popup.Avatar.Title': 'Drag to Reposition',\n 'Popup.Unpin.AllTitle': 'Unpin all messages',\n 'Popup.Unpin.HideTitle': 'Hide pinned messages',\n 'Popup.Unpin.HideDescription': 'Do you want to hide the pinned message bar? It wil stay hidden until a new message is pinned.',\n 'Popup.Unpin.Hide': 'Hide',\n 'Popup.Attach.GroupMedia': 'Group all media',\n 'Popup.Attach.UngroupMedia': 'Ungroup all media',\n 'Popup.Attach.AsMedia': 'Send as media',\n 'Popup.Attach.EnableSpoilers': 'Hide all with spoilers',\n 'Popup.Attach.RemoveSpoilers': 'Remove all spoilers',\n 'TwoStepAuth.EmailCodeChangeEmail': 'Change Email',\n 'MarkupTooltip.LinkPlaceholder': 'Enter URL...',\n 'MediaViewer.Context.Download': 'Download',\n 'Profile': 'Profile',\n 'Saved': 'Saved',\n 'Deleted': 'Deleted',\n 'ReportBug': 'Report Bug',\n 'Notifications.Count': {\n 'one_value': '%d notification',\n 'other_value': '%d notifications'\n },\n 'Notifications.Forwarded': {\n 'one_value': 'Forwarded %d message',\n 'other_value': 'Forwarded %d messages'\n },\n 'Notifications.New': 'New notification',\n 'PushNotification.Action.Mute1d': 'Mute background alerts for 1 day',\n 'PushNotification.Action.Settings': 'Background alerts settings',\n 'PushNotification.Action.Mute1d.Mobile': 'Mute for 24H',\n 'PushNotification.Action.Settings.Mobile': 'Alerts settings',\n 'PushNotification.Message.NoPreview': 'You have a new message',\n 'LogOut.Description': 'Are you sure you want to log out?\\n\\nNote that you can seamlessly use Telegram on all your devices at once.',\n // \"PushNotification.Action.Mute1d.Success\": \"Notification settings were successfully saved.\",\n // it is from iOS\n 'VoiceChat.DiscussionGroup': 'discussion group',\n 'PaymentInfo.CVV': 'CVV Code',\n 'PaymentInfo.Card.Title': 'Enter your card information',\n 'PaymentInfo.Billing.Title': 'Enter your billing address',\n 'PaymentInfo.Done': 'PROCEED TO CHECKOUT',\n 'PaymentCard.Error.Invalid': 'Invalid card number',\n 'PaymentCard.Error.Incomplete': 'Incomplete card number',\n 'LimitReached.Ok': 'OK, GOT IT',\n 'Username.Purchase': '**This username is already taken.** However, it is currently available for purchase. [Learn more…]()',\n 'Video.Unsupported.Desktop': '__Unfortunately, this video can\\'t be played on Telegram Web. Try opening it with our [desktop app](https://getdesktop.telegram.org/) instead.__',\n 'Video.Unsupported.Mobile': '__Unfortunately, this video can\\'t be played on Telegram Web. Try opening it with our [mobile app](https://telegram.org/dl/) instead.__',\n\n // * android\n 'AccDescrEditing': 'Editing',\n 'ActionCreateChannel': 'Channel created',\n 'ActionCreateGroup': 'un1 created the group',\n 'ActionChangedTitle': 'un1 changed the group name to un2',\n 'ActionRemovedPhoto': 'un1 removed the group photo',\n 'ActionChangedPhoto': 'un1 changed the group photo',\n 'ActionChangedVideo': 'un1 changed the group video',\n 'ActionAddUser': 'un1 added un2',\n 'ActionAddUserSelf': 'un1 returned to the group',\n 'ActionAddUserSelfYou': 'You returned to the group',\n 'ActionAddUserSelfMega': 'un1 joined the group',\n 'ActionLeftUser': 'un1 left the group',\n 'ActionKickUser': 'un1 removed un2',\n 'ActionInviteUser': 'un1 joined the group via invite link',\n 'ActionPinnedNoText': 'un1 pinned a message',\n 'ActionMigrateFromGroup': 'This group was upgraded to a supergroup',\n 'ActionYouScored': 'You scored %1$s',\n 'ActionUserScored': 'un1 scored %1$s',\n 'ActionYouScoredInGame': 'You scored %1$s in un2',\n 'ActionUserScoredInGame': 'un1 scored %1$s in un2',\n 'AndOther': {\n 'one_value': 'and %1$d other',\n 'other_value': 'and %1$d others'\n },\n 'AttachPhoto': 'Photo',\n 'AttachVideo': 'Video',\n 'AttachGif': 'GIF',\n 'AttachLocation': 'Location',\n 'AttachLiveLocation': 'Live Location',\n 'AttachContact': 'Contact',\n // \"AttachDocument\": \"File\",\n 'AttachSticker': 'Sticker',\n 'AttachAudio': 'Voice message',\n 'AttachRound': 'Video message',\n 'AttachGame': 'Game',\n 'Bot': 'bot',\n // \"ChannelJoined\": \"You joined this channel\",\n 'ChannelMegaJoined': 'You joined this group',\n 'EnterChannelName': 'Channel name',\n 'DescriptionOptionalPlaceholder': 'Description (optional)',\n 'DescriptionPlaceholder': 'Description',\n 'DiscussionStarted': 'Discussion started',\n 'Draft': 'Draft',\n 'FilterAlwaysShow': 'Include Chats',\n 'FilterNeverShow': 'Exclude Chats',\n 'FilterInclude': 'Included Chats',\n 'FilterExclude': 'Excluded Chats',\n 'FilterChatTypes': 'Chat types',\n 'FilterChats': 'Chats',\n 'FilterNew': 'New Folder',\n 'Filters': 'Folders',\n 'FilterRecommended': 'Recommended Folders',\n 'FilterShowMoreChats': {\n 'one_value': 'Show %1$d More Chat',\n 'other_value': 'Show %1$d More Chats'\n },\n 'ForwardedMessageCount': {\n 'one_value': 'Forwarded message',\n 'other_value': '%1$d forwarded messages'\n },\n 'FromYou': 'You',\n 'Add': 'Add',\n 'Chats': {\n 'one_value': '%1$d chat',\n 'other_value': '%1$d chats'\n },\n 'Channels': {\n 'one_value': '%1$d channel',\n 'other_value': '%1$d channels'\n },\n 'Comments': {\n 'one_value': '%1$d Comment',\n 'other_value': '%1$d Comments'\n },\n 'Groups': {\n 'one_value': '%1$d group',\n 'other_value': '%1$d groups'\n },\n 'Users': {\n 'one_value': '%1$d user',\n 'other_value': '%1$d users'\n },\n 'Members': {\n 'one_value': '%1$d member',\n 'other_value': '%1$d members'\n },\n 'messages': {\n 'one_value': '%1$d message',\n 'other_value': '%1$d messages'\n },\n 'UsernameHelpLink': 'This link opens a chat with you:\\n%1$s',\n 'NewChannel': 'New Channel',\n 'NewGroup': 'New Group',\n 'Contacts': 'Contacts',\n 'SavedMessages': 'Saved Messages',\n 'Settings': 'Settings',\n 'SettingsHelp': 'Help',\n 'General': 'General',\n 'TextSize': 'Message Text Size',\n 'ChatBackground': 'Chat Background',\n 'EnableAnimations': 'Enable Animations',\n 'AutoDownloadMedia': 'Auto-Download Media',\n 'AutodownloadContacts': 'Contacts',\n 'AutodownloadPrivateChats': 'Private Chats',\n 'AutodownloadGroupChats': 'Group Chats',\n 'AutodownloadChannels': 'Channels',\n 'AutoplayGIF': 'GIFs',\n 'AutoplayVideo': 'Videos',\n 'NotificationsForGroups': 'Notifications for groups',\n 'NotificationsForPrivateChats': 'Notifications for private chats',\n 'NotificationsForChannels': 'Notifications for channels',\n 'NotificationsPrivateChats': 'Private Chats',\n 'NotificationsGroups': 'Groups',\n 'NotificationsChannels': 'Channels',\n 'NotificationsOther': 'Other',\n 'MarkAsUnread': 'Mark as unread',\n 'MarkAsRead': 'Mark as read',\n 'ContactJoined': 'Contact joined Telegram',\n 'Loading': 'Loading...',\n 'Unblock': 'Unblock',\n 'BlockedUsers': 'Blocked Users',\n 'BlockedUsersInfo': 'Blocked users will not be able to contact you and will not see your Last Seen time.',\n 'BlockedEmpty': 'None',\n 'TwoStepVerification': 'Two-Step Verification',\n 'TwoStepVerificationTitle': 'Two-Step Verification',\n 'PinnedMessage': 'Pinned Message',\n 'PinnedMessagesCount': {\n 'one_value': 'Pinned Message',\n 'other_value': '%1$d Pinned Messages'\n },\n // \"PreviousPinnedMessage\": \"Previous Message\",\n 'PrivacyExceptions': 'Exceptions',\n 'PrivacyLastSeen': 'Last Seen & Online',\n 'PrivacySettings': 'Privacy and Security',\n 'PrivacyTitle': 'Privacy',\n 'PrivacyPhone': 'Phone Number',\n 'PrivacyPhoneTitle': 'Who can see my phone number?',\n 'PrivacyPhoneTitle2': 'Who can find me by my number?',\n 'PrivacyPhoneInfo': 'Users who have your number saved in their contacts will also see it on Telegram.',\n 'PrivacyPhoneInfo3': 'Users who add your number to their contacts will see it on Telegram only if they are your contacts.',\n 'PrivacyProfilePhoto': 'Profile Photos',\n 'PrivacyProfilePhotoTitle': 'Who can see my profile photos & videos?',\n 'PrivacyP2PHeader': 'Peer-to-Peer',\n 'PrivacyForwardsTitle': 'Who can add a link to my account when forwarding my messages?',\n 'Reminders': 'Reminders',\n 'ScheduledMessages': 'Scheduled Messages',\n 'LastSeenTitle': 'Who can see your Last Seen time?',\n 'SessionsTitle': 'Active Sessions',\n 'CurrentSession': 'This device',\n 'TerminateAllSessions': 'Terminate All Other Sessions',\n 'TerminateSessionText': 'Are you sure you want to terminate this session?',\n 'OtherSessions': 'Active sessions',\n 'AreYouSureDeleteSingleMessage': 'Are you sure you want to delete this message?',\n 'AreYouSureDeleteFewMessages': 'Are you sure you want to delete these messages?',\n 'AreYouSureDeleteSingleMessageMega': 'Are you sure you want to delete this message for everyone?',\n 'AreYouSureDeleteFewMessagesMega': 'Are you sure you want to delete these messages for everyone?',\n 'AreYouSureDeleteAndExitName': 'Are you sure you want to delete and leave the group **%1$s**?',\n 'AreYouSureDeleteThisChatSavedMessages': 'Are you sure you want to delete **Saved Messages**?',\n 'AreYouSureDeleteThisChatWithUser': 'Are you sure you want to delete the chat with **%1$s**?',\n 'AreYouSureSessionTitle': 'Terminate session',\n 'AreYouSureSessionsTitle': 'Terminate sessions',\n 'AreYouSureSessions': 'Are you sure you want to terminate all other sessions?',\n 'Terminate': 'Terminate',\n 'WhoCanCallMe': 'Who can call me?',\n 'WhoCanAddMe': 'Who can add me to group chats?',\n 'ArchivedChats': 'Archived Chats',\n 'Cancel': 'Cancel',\n 'HistoryCleared': 'History was cleared',\n 'Archive': 'Archive',\n 'Unarchive': 'Unarchive',\n 'Delete': 'Delete',\n 'Reply': 'Reply',\n 'Edit': 'Edit',\n 'Forward': 'Forward',\n 'CopyLink': 'Copy Link',\n 'Copy': 'Copy',\n 'Search': 'Search',\n 'LinkCopied': 'Link copied to clipboard',\n 'LinkCopiedPrivateInfo': 'This link will only work for members of this chat.',\n 'GroupAddMembers': 'Add Members',\n 'SendMessageTo': 'Add people...',\n // \"SelectChat\": \"Select Chat\",\n 'JumpToDate': 'Jump to Date',\n 'Caption': 'Caption',\n 'Message': 'Message',\n 'Poll': 'Poll',\n 'SharedFilesTab2': 'Files',\n 'SharedMediaTab2': 'Media',\n // \"SharedMediaTabFull2\": \"Shared Media\",\n // \"SharedGroupsTab2\": \"Groups\",\n 'SharedLinksTab2': 'Links',\n 'SharedMusicTab2': 'Music',\n 'SharedVoiceTab2': 'Voice',\n // \"SharedGIFsTab2\": \"GIFs\",\n 'NewPoll': 'New Poll',\n 'PollOptions': 'Poll options',\n 'AskAQuestion': 'Ask a Question',\n 'AddAnExplanationInfo': 'Users will see this text after choosing the wrong answer, good for educational purposes.',\n 'AccDescrQuizExplanation': 'Explanation',\n 'PhoneCopied': 'Phone copied to clipboard',\n 'UsernameCopied': 'Username copied to clipboard.',\n // \"HashtagCopied\": \"Hashtag copied to clipboard.\",\n 'BioCopied': 'Bio copied to clipboard.',\n 'UserBio': 'Bio',\n 'Username': 'Username',\n 'UsernameAlso': 'also %1$s',\n 'UsernameHelp': 'You can choose a username on **Telegram**. If you do, people will be able to find you by this username and contact you without needing your phone number.\\n\\nYou can use **a–z**, **0–9** and underscores. Minimum length is **5** characters.',\n 'Phone': 'Phone',\n 'Notifications': 'Notifications',\n 'AreYouSureDeleteContact': 'Are you sure you want to delete this contact?',\n 'AreYouSureDeleteAndExit': 'Are you sure you want to delete and leave the group?',\n 'AreYouSureDeleteAndExitChannel': 'Do you want to delete and leave the channel?',\n 'DeleteContact': 'Delete contact',\n 'GroupType': 'Group Type',\n 'ChannelType': 'Channel Type',\n 'TypePrivate': 'Private',\n 'TypePublic': 'Public',\n 'TypePrivateGroup': 'Private',\n 'TypePublicGroup': 'Public',\n 'GroupMembers': 'Members',\n 'DeleteMega': 'Delete Group',\n 'DeleteMegaMenu': 'Delete group',\n 'DeleteAndExitButton': 'Delete and Leave Group',\n 'ChannelDelete': 'Delete Channel',\n 'ChannelDeleteMenu': 'Delete channel',\n 'ChannelPermissions': 'Permissions',\n 'ChannelPermissionsHeader': 'What can members of this group do?',\n 'ChannelAddException': 'Add Exception',\n 'ChannelBlockedUsers': 'Removed users',\n 'NoBlockedUsers': 'No removed users',\n 'UserRestrictions': 'User Permissions',\n 'UserRestrictionsDisabled': 'This option is disabled for all members in Group Permissions',\n 'UserRestrictionsCanDo': 'What can this user do?',\n 'UserRestrictionsRead': 'Read Messages',\n 'UserRestrictionsSend': 'Send Messages',\n 'UserRestrictionsSendMedia': 'Send Media',\n 'UserRestrictionsSendPolls': 'Send Polls',\n 'UserRestrictionsSendStickers': 'Send Stickers and GIFs',\n 'UserRestrictionsSendPhotos': 'Send Photos',\n 'UserRestrictionsSendVideos': 'Send Videos',\n 'UserRestrictionsSendMusic': 'Send Music',\n 'UserRestrictionsSendFiles': 'Send Files',\n 'UserRestrictionsSendVoices': 'Send Voice Messages',\n 'UserRestrictionsSendRound': 'Send Video Messages',\n 'UserRestrictionsEmbedLinks': 'Embed Links',\n 'UserRestrictionsChangeInfo': 'Change Chat Info',\n 'UserRestrictionsPinMessages': 'Pin Messages',\n 'UserRestrictionsInviteUsers': 'Add Users',\n // \"UserRestrictionsNoRead\": \"can't read\",\n 'UserRestrictionsNoSend': 'can\\'t send messages',\n 'UserRestrictionsNoSendMedia': 'no media',\n 'UserRestrictionsNoSendPolls': 'no polls',\n 'UserRestrictionsNoSendStickers': 'no stickers & GIFs',\n 'UserRestrictionsNoSendPhotos': 'no photos',\n 'UserRestrictionsNoSendVideos': 'no videos',\n 'UserRestrictionsNoSendMusic': 'no music',\n 'UserRestrictionsNoSendDocs': 'no files',\n 'UserRestrictionsNoSendVoice': 'no voice',\n 'UserRestrictionsNoSendRound': 'no round',\n 'UserRestrictionsNoEmbedLinks': 'no embed links',\n 'UserRestrictionsNoChangeInfo': 'can\\'t change Info',\n 'UserRestrictionsNoPinMessages': 'no pins',\n 'UserRestrictionsNoInviteUsers': 'can\\'t add users',\n 'UserRestrictionsBlock': 'Ban and remove from group',\n 'ChannelPublic': 'Public Channel',\n 'MegaPublic': 'Public Group',\n // \"MegaLocation\": \"Location-based Group\",\n 'ChannelPublicInfo': 'Public channels can be found in search, anyone can join them.',\n 'MegaPublicInfo': 'Public groups can be found in search, chat history is available to everyone and anyone can join.',\n 'ChannelPrivate': 'Private Channel',\n 'MegaPrivate': 'Private Group',\n 'ChannelPrivateInfo': 'Private channels can only be joined via an invite link.',\n 'MegaPrivateInfo': 'Private groups can only be joined if you were invited or have an invite link.',\n 'ChannelPrivateLinkHelp': 'People can join your channel by following this link. You can revoke the link any time.',\n 'MegaPrivateLinkHelp': 'People can join your group by following this link. You can revoke the link any time.',\n 'RevokeButton': 'Revoke',\n 'RevokeLink': 'Revoke Link',\n 'RevokeAlert': 'Are you sure you want to revoke this link? Once the link is revoked, no one will be able to join using it.',\n 'SetUrlPlaceholder': 'Link',\n 'Subscribers': {\n 'one_value': '%1$d subscriber',\n 'other_value': '%1$d subscribers'\n },\n 'SearchGifsTitle': 'Search GIFs',\n 'PinMessageAlert': 'Pin this message in the group?',\n 'PinMessageAlertTitle': 'Pin message',\n 'PinMessageAlertChannel': 'Do you want to pin this message in this channel?',\n 'PinMessageAlertChat': 'Do you want to pin this message at the top of the chat?',\n 'UnpinMessageAlertTitle': 'Unpin message',\n 'UnpinMessageAlert': 'Do you want to unpin this message?',\n 'PinNotify': 'Notify all members',\n 'PinMessage': 'Pin',\n 'UnpinMessage': 'Unpin',\n 'PinAlsoFor': 'Also pin for %1$s',\n 'DeleteMessagesTitle': 'Delete %1$s',\n 'DeleteSingleMessagesTitle': 'Delete message',\n 'DeleteMessagesOption': 'Unsend My Messages',\n 'DeleteMessagesOptionAlso': 'Also delete for %1$s',\n 'DeleteForAll': 'Delete for all members',\n 'DeleteMessagesTextGroup': 'You can also delete the %1$s you sent from the inboxes of other group members by checking \"Unsend my messages\".',\n 'LeaveChannel': 'Leave Channel',\n 'LeaveChannelMenu': 'Leave channel',\n 'ChannelLeaveAlertWithName': 'Are you sure you want to leave **%1$s**?',\n 'LeaveMegaMenu': 'Leave group',\n 'DeleteChatUser': 'Delete chat',\n 'PleaseEnterCurrentPassword': 'Enter your password',\n 'PleaseEnterFirstPassword': 'Enter a password',\n 'PleaseReEnterPassword': 'Re-enter your password',\n 'Continue': 'Continue',\n 'YourEmailSkip': 'Skip',\n 'YourEmailSkipWarning': 'Warning',\n 'YourEmailSkipWarningText': 'No, seriously.\\n\\nIf you forget your password, you will lose access to your Telegram account. There will be no way to restore it.',\n 'TurnPasswordOffQuestionTitle': 'Disable password',\n 'TurnPasswordOffQuestion': 'Are you sure you want to disable your password?',\n 'Disable': 'Disable',\n 'TwoStepVerificationSetPassword': 'Set Password',\n 'TwoStepVerificationPasswordSet': 'Password Set!',\n 'TwoStepVerificationPasswordSetInfo': 'This password will be required when you log in on a new device in addition to the code you get in the SMS.',\n 'TwoStepVerificationPasswordReturnSettings': 'Return to Settings',\n 'RecoveryEmail': 'Recovery email',\n 'RecoveryEmailTitle': 'Recovery Email',\n 'ResendCode': 'Resend code',\n 'PasswordAsHintError': 'Hint must be different from your password',\n 'AddStickersCount': 'ADD %1$s',\n 'RemoveStickersCount': 'REMOVE %1$s',\n 'Stickers': {\n 'one_value': '%1$d sticker',\n 'other_value': '%1$d stickers'\n },\n 'HidAccount': 'The account was hidden by the user',\n 'TelegramFeatures': 'Telegram Features',\n 'SetColor': 'Set a color',\n 'Open': 'Open',\n 'OpenUrlTitle': 'Open Link',\n 'OpenUrlAlert2': 'Do you want to open %1$s?',\n 'FilterNoChatsToDisplay': 'Folder is empty',\n 'FilterNoChatsToDisplayInfo': 'No chats currently belong to this folder.',\n 'SupportStatus': 'support',\n 'Lately': 'last seen recently',\n 'WithinAWeek': 'last seen within a week',\n 'WithinAMonth': 'last seen within a month',\n 'ALongTimeAgo': 'last seen a long time ago',\n 'Online': 'online',\n 'MessageScheduleSend': 'Send Now',\n 'MessageScheduleEditTime': 'Reschedule',\n 'YouLeft': 'You left this group',\n 'Recent': 'Recent',\n 'Of': '%1$d of %2$d',\n 'NoResult': 'No results',\n 'Updating': 'Updating...',\n 'Emoji': 'Emoji',\n 'AddContactTitle': 'Add Contact',\n 'HiddenName': 'Deleted Account',\n 'Seconds': {\n 'one_value': '%1$d second',\n 'other_value': '%1$d seconds'\n },\n 'Minutes': {\n 'one_value': '%1$d minute',\n 'other_value': '%1$d minutes'\n },\n 'Hours': {\n 'one_value': '%1$d hour',\n 'other_value': '%1$d hours'\n },\n 'Days': {\n 'one_value': '%1$d day',\n 'other_value': '%1$d days'\n },\n 'Weeks': {\n 'one_value': '%1$d week',\n 'other_value': '%1$d weeks'\n },\n 'Months': {\n 'one_value': '%1$d month',\n 'other_value': '%1$d months'\n },\n 'Years': {\n 'one_value': '%1$d year',\n 'other_value': '%1$d years'\n },\n 'TodayAtFormattedWithToday': 'today at %1$s',\n 'formatDateAtTime': '%1$s at %2$s',\n 'JoinByPeekChannelTitle': 'Join Channel',\n 'JoinByPeekGroupTitle': 'Join Group',\n 'YouWereKicked': 'you were removed',\n 'ViaBot': 'via',\n 'InviteExpired': 'This invite link has expired.',\n 'NoUsernameFound': 'There is no Telegram account with this username.',\n 'PrivacyDeleteCloudDrafts': 'Delete All Cloud Drafts',\n 'AreYouSureClearDraftsTitle': 'Delete cloud drafts',\n 'AreYouSureClearDrafts': 'Are you sure you want to delete all cloud drafts?',\n 'BotInfoTitle': 'What can this bot do?',\n 'ChatYourSelf': 'forward here to save',\n 'GroupEmptyTitle1': 'You have created a **group**.',\n 'GroupEmptyTitle2': 'Groups can have:',\n 'GroupDescription1': 'Up to 200,000 members',\n 'GroupDescription2': 'Persistent chat history',\n 'GroupDescription3': 'Public links such as t.me/title',\n 'GroupDescription4': 'Admins with different rights',\n 'ChatYourSelfDescription1': 'Forward messages here to save them',\n 'ChatYourSelfDescription2': 'Send media and files to store them',\n 'ChatYourSelfDescription3': 'Access this chat from any device',\n 'ChatYourSelfDescription4': 'Use search to quickly find things',\n 'ChatYourSelfTitle': 'Your cloud storage',\n 'ActionYouCreateGroup': 'You created the group',\n 'NoMessages': 'No messages here yet...',\n 'NoScheduledMessages': 'No scheduled messages here yet...',\n 'NoMessagesGreetingsDescription': 'Send a message or tap the greeting below.',\n 'InviteToGroupError': 'Sorry, you can\\'t add this user to groups because of user\\'s privacy settings.',\n 'InviteToChannelError': 'Sorry, you can\\'t add this user to channels because of user\\'s privacy settings.',\n 'AddMembersAlertTitle': 'Add %1$s',\n 'AddOneMemberAlertTitle': 'Add member',\n 'AddMembersAlertNamesText': 'Are you sure you want to add %1$s to **%2$s**?',\n 'AddMembersAlertCountText': 'Are you sure you want to add %1$s to **%2$s**?',\n 'AddMembersForwardMessages': 'Show the last 100 messages to the new members',\n 'AddOneMemberForwardMessages': 'Show the last 100 messages to **%1$s**',\n 'PinToTopLimitReached2': 'Sorry, you can only pin %1$s to the top in the main list. More chats can be pinned in Chat Folders and your Archive.',\n 'FiltersSetupPinAlert': 'Set Up Folders',\n 'AppName': 'Telegram',\n 'OK': 'OK',\n 'PinFolderLimitReached': 'Sorry, you can\\'t pin any more chats to the top.',\n 'Send': 'Send',\n 'ChannelJoin': 'JOIN',\n 'Yesterday': 'yesterday',\n 'LeaveAComment': 'Leave a comment',\n 'ViewInChat': 'View in chat',\n 'LinkNotFound': 'Unfortunately, you can\\'t access this message. You are not a member of the chat where it was posted.',\n 'Create': 'Create',\n 'ViewDiscussion': 'View discussion',\n 'MessageScheduledUntilOnline': 'Scheduled until online',\n 'ReportChat': 'Report',\n 'ReportChatSpam': 'Spam',\n // \"ReportChatFakeAccount\": \"Fake Account\",\n 'ReportChatViolence': 'Violence',\n 'ReportChatPornography': 'Pornography',\n 'ReportChatChild': 'Child Abuse',\n 'ReportChatOther': 'Other',\n 'ReportChatDescription': 'Description',\n 'ReportInfo': 'Please enter any additional details relevant to your report.',\n 'ReportSentInfo': 'Telegram moderators will review your report.\\nThank you for your cooperation!',\n 'ReportHint': 'Additional details...',\n 'ChatHistory': 'Chat history for new members',\n 'ShareContact': 'Share contact',\n 'SendMessageTitle': 'Send message',\n 'SendContactToGroupText': 'Do you want to send this contact to **%1$s**?',\n 'ChannelBroadcast': 'Broadcast',\n 'ChannelSilentBroadcast': 'Silent Broadcast',\n 'Comment': 'Comment',\n 'SendAnonymously': 'Send anonymously',\n 'DiscardVoiceMessageTitle': 'Discard Voice Message',\n 'DiscardVoiceMessageDescription': 'Are you sure you want to stop recording and discard your voice message?',\n 'DiscardVoiceMessageAction': 'Discard',\n 'AddContact': 'Add to contacts',\n 'BlockUser': 'Block user',\n 'MobileHidden': 'Mobile hidden',\n 'MobileHiddenExceptionInfo': 'Phone number will be visible once %1$s adds you as a contact.',\n 'FirstName': 'First name (required)',\n 'LastName': 'Last name (optional)',\n 'AreYouSureBlockContact2': 'Are you sure you want to block **%1$s**?',\n 'UserBlocked': 'User blocked',\n 'UserUnblocked': 'User unblocked',\n 'AudioUnknownArtist': 'Unknown artist',\n 'AudioUnknownTitle': 'Unknown title',\n 'LogOut': 'Log out',\n 'OnlineCount': {\n 'one_value': '%1$d online',\n 'other_value': '%1$d online'\n },\n 'EditedMessage': 'edited',\n 'GlobalSearch': 'Global search',\n 'SearchMessages': 'Messages',\n 'SearchAllChatsShort': 'Chats',\n 'ClearButton': 'Clear',\n 'FilterAllChats': 'All Chats',\n 'FilterAllChatsShort': 'All',\n 'Call': 'Call',\n 'VideoCall': 'Video Call',\n 'CallMessageOutgoing': 'Outgoing Call',\n 'CallMessageIncoming': 'Incoming Call',\n 'CallMessageVideoOutgoing': 'Outgoing Video Call',\n 'CallMessageVideoIncoming': 'Incoming Video Call',\n 'VoipExchangingKeys': 'Exchanging encryption keys',\n 'VoipUnmute': 'Unmute',\n 'SavingContentTitle': 'Saving content',\n 'RestrictSavingContent': 'Restrict saving content',\n 'RestrictSavingContentInfoGroup': 'Members won\\'t be able to copy, save and forward content from this group.',\n 'RestrictSavingContentInfoChannel': 'Subscribers won\\'t be able to copy, save and forward content from this channel.',\n 'ClearOtherSessionsHelp': 'Logs out all devices except for this one.',\n 'SessionsListInfo': 'The official Telegram app is available for Android, iPhone, iPad, Windows, macOS and Linux.',\n 'SponsoredMessage': 'sponsored',\n 'OpenChannelPost': 'VIEW POST',\n 'FilterNameHint': 'Folder name',\n 'BotStart': 'START',\n 'BotUnblock': 'RESTART',\n 'BotStop': 'Stop bot',\n 'BotRestart': 'Restart bot',\n 'ShareYouPhoneNumberTitle': 'Share your phone number?',\n 'AreYouSureShareMyContactInfoBot': 'The bot will know your phone number. This can be useful for integration with other services.',\n 'DistanceUnitsTitle': 'Distance units',\n 'DistanceUnitsKilometers': 'Kilometers',\n 'DistanceUnitsMiles': 'Miles',\n 'PeopleNearby': 'People Nearby',\n 'MakeMyselfVisible': 'Make Myself Visible',\n 'MakeMyselfVisibleTitle': 'Show Your Profile?',\n 'MakeMyselfVisibleInfo': 'Users nearby will be able to view your profile and send you messages. This may help you find new friends, but could also attract excessive attention. You can stop sharing your profile at any time.\\n\\nYour phone number will remain hidden.',\n 'StopShowingMe': 'Stop Showing Me',\n 'PeopleNearbyInfo2': 'Exchange contact info with people nearby and find new friends.',\n 'NearbyCreateGroup': 'Create a Local group',\n 'AwayTo': '%1$s away',\n 'MessagePreview': 'Message Preview',\n 'KMetersAway2': '%1$s km away',\n 'MetersAway2': '%1$s m away',\n 'MilesAway': '%1$s mi away',\n 'FootsAway': '%1$s ft away',\n 'PeopleNearbyHeader': 'People nearby',\n 'ChatsNearbyHeader': 'Groups nearby',\n 'ChatLocation': 'Location',\n 'RequestToJoinGroupDescription': 'This group accepts new members only after they are approved by its admins.',\n 'RequestToJoinChannelDescription': 'This channel accepts new subscribers only after they are approved by its admins.',\n 'RequestToJoinSent': 'Join request sent',\n 'RequestToJoinGroupApproved': 'Your request to join the group was approved',\n 'RequestToJoinChannelApproved': 'Your request to join the channel was approved',\n 'Update': 'UPDATE',\n 'Reactions': 'Reactions',\n 'DoubleTapSetting': 'Quick Reaction',\n 'EnableReactions': 'Enable Reactions',\n 'EnableReactionsChannelInfo': 'Allow subscribers to react to channel posts.',\n 'EnableReactionsGroupInfo': 'Allow members to react to group messages.',\n 'AvailableReactions': 'Available reactions',\n 'NobodyViewed': 'Nobody viewed',\n 'MessageSeen': {\n 'one_value': 'Seen',\n 'other_value': '%1$d Seen'\n },\n // \"Close\": \"Close\",\n 'DataSettings': 'Data and Storage',\n 'GroupsAndChannelsHelp': 'Change who can add you to groups and channels.',\n 'SessionsInfo': 'Control your sessions on other devices.',\n 'StickersBotInfo': 'Artists are welcome to add their own sticker sets using our @stickers bot.',\n 'AutomaticMediaDownload': 'Automatic media download',\n 'AutoDownloadPhotos': 'Photos',\n 'AutoDownloadVideos': 'Videos',\n 'AutoDownloadFiles': 'Files',\n 'AutoDownloadOnAllChats': 'On in all chats',\n 'AutoDownloadUpToOnAllChats': 'Up to %1$s in all chats',\n 'AutoDownloadOff': 'Off',\n 'AutoDownloadOnUpToFor': 'Up to %1$s for %2$s',\n 'AutoDownloadOnFor': 'On for %1$s',\n 'AutoDownloadContacts': 'Contacts',\n 'AutoDownloadPm': 'PM',\n 'AutoDownloadGroups': 'Groups',\n 'AutoDownloadChannels': 'Channels',\n 'AutoDownloadAudioInfo': 'Voice messages are tiny, so they\\'re always downloaded automatically.',\n 'AutoplayMedia': 'Auto-play media',\n 'AutoDownloadPhotosTitle': 'Auto-download photos',\n 'AutoDownloadVideosTitle': 'Auto-download videos and GIFs',\n 'AutoDownloadFilesTitle': 'Auto-download files and music',\n 'AutoDownloadMaxFileSize': 'Maximum file size',\n 'AutodownloadSizeLimitUpTo': 'up to %1$s',\n 'ResetAutomaticMediaDownload': 'Reset Auto-Download Settings',\n 'ResetAutomaticMediaDownloadAlertTitle': 'Reset settings',\n 'ResetAutomaticMediaDownloadAlert': 'Are you sure you want to reset auto-download settings?',\n 'Reset': 'Reset',\n 'SendMessageAsTitle': 'Send message as...',\n 'Devices': 'Devices',\n 'LanguageName': 'English',\n 'EditCantEditPermissionsPublic': 'This permission is not available in public groups.',\n 'VoipUserMicrophoneIsOff': '%s\\'s microphone is off',\n 'VoipUserCameraIsOff': '%s\\'s camera is off',\n 'PrivacyPhoneInfo4': 'This public link opens a chat with you:',\n 'ReportChatIllegalDrugs': 'Illegal Drugs',\n 'ReportChatPersonalDetails': 'Personal Details',\n 'VoipPeerIncompatible': '**%1$s**\\'s app is using an incompatible protocol. They need to update their app before you can call them.',\n 'TelegramFeaturesUrl': 'https://t.me/TelegramTips',\n 'ScamMessage': 'SCAM',\n 'FakeMessage': 'FAKE',\n 'TextCopied': 'Text copied to clipboard',\n 'PaymentInvoice': 'INVOICE',\n 'PaymentTestInvoice': 'TEST INVOICE',\n 'PaymentReceipt': 'Receipt',\n 'PaymentCheckout': 'Checkout',\n 'PaymentTransactionTotal': 'Total',\n 'PaymentTip': 'Tip',\n 'PaymentTipOptional': 'Tip (Optional)',\n 'PaymentCheckoutPay': 'PAY %1$s',\n 'PaymentCheckoutMethod': 'Payment method',\n 'PaymentCheckoutProvider': 'Payment provider',\n 'PaymentCardNumber': 'Card Number',\n 'PaymentCardSavePaymentInformation': 'Save Payment Information',\n 'PaymentCardInfo': 'Payment info',\n 'PaymentCardSavePaymentInformationInfoLine1': 'You can save your payment info for future use. It will be stored directly with the payment provider. Telegram has no access to your credit card data.',\n 'Done': 'Done',\n 'PaymentShippingMethod': 'Shipping methods',\n 'PaymentNoShippingMethod': 'Sorry, it is not possible to deliver to your address.',\n 'PaymentShippingInfo': 'Shipping Information',\n 'PaymentShippingAddress': 'Shipping address',\n 'PaymentShippingAddress1Placeholder': 'Address 1 (Street)',\n 'PaymentShippingAddress2Placeholder': 'Address 2 (Street)',\n 'PaymentShippingCityPlaceholder': 'City',\n 'PaymentShippingStatePlaceholder': 'State',\n 'PaymentShippingCountry': 'Country',\n 'PaymentShippingZipPlaceholder': 'Postcode',\n 'PaymentShippingReceiver': 'Receiver',\n 'PaymentShippingName': 'Full Name',\n 'PaymentShippingEmailPlaceholder': 'Email',\n 'PaymentCheckoutPhoneNumber': 'Phone number',\n 'PaymentCheckoutShippingMethod': 'Shipping method',\n 'PaymentShippingSave': 'Save Shipping Information',\n 'PaymentShippingSaveInfo': 'You can save your shipping info for future use.',\n 'PaymentInfoHint': 'You paid **%1$s** for **%2$s**.',\n 'PrivacyPayments': 'Payments',\n 'PrivacyPaymentsClearInfo': 'You can delete your shipping info and instruct all payment providers to remove your saved credit cards. Note that Telegram never stores your credit card data.',\n 'PrivacyPaymentsClear': 'Clear Payment and Shipping Info',\n 'PrivacyPaymentsClearAlertTitle': 'Clear payment info',\n 'PrivacyPaymentsClearAlertText': 'Are you sure you want to clear your payment and shipping info?',\n 'PrivacyPaymentsPaymentInfoCleared': 'Payment info cleared.',\n 'PrivacyPaymentsShippingInfoCleared': 'Shipping info cleared.',\n 'PrivacyPaymentsPaymentShippingCleared': 'Payment and shipping info cleared.',\n 'PrivacyClearShipping': 'Shipping info',\n 'PrivacyClearPayment': 'Payment info',\n 'Clear': 'Clear',\n 'Save': 'Save',\n 'PaymentCheckoutName': 'Name',\n 'ClearRecentStickersAlertTitle': 'Clear recent stickers',\n 'ClearRecentStickersAlertMessage': 'Do you want to clear all your recent stickers?',\n 'PremiumStickersShort': 'Premium',\n 'FavoriteStickers': 'Favorites',\n 'AddToFavorites': 'Add to Favorites',\n 'AddedToFavorites': 'Sticker added to Favorites.',\n 'RemovedFromFavorites': 'Sticker was removed from Favorites',\n 'RemovedFromRecent': 'Sticker was removed from Recent',\n 'DeleteFromFavorites': 'Delete from Favorites',\n 'DeleteFromRecent': 'Remove from Recent',\n 'NewChatsFromNonContacts': 'New chats from unknown users',\n 'ArchiveAndMute': 'Archive and Mute',\n 'ArchiveAndMuteInfo': 'Automatically archive and mute new chats, groups and channels from non-contacts.',\n 'PrivacyVoiceMessages': 'Voice Messages',\n 'PrivacyVoiceMessagesTitle': 'Who can send me voice or video messages?',\n 'PrivacyVoiceMessagesInfo': 'You can restrict who can send you voice or video messages with granular precision.',\n 'PrivacyVoiceMessagesPremiumOnly': 'Only subscribers of *Telegram Premium* can restrict receiving voice messages.',\n 'EmojiCount': {\n 'other_value': '%1$d emoji'\n },\n 'AddEmojiNotFound': 'Emoji pack not found.',\n 'MessageContainsEmojiPack': 'This message contains emoji from %s pack.',\n 'MessageContainsEmojiPacks': {\n 'other_value': 'This message contains emoji from **%d Packs**.'\n },\n 'EmojiPackCount': {\n 'one_value': '%1$d Emoji Pack',\n 'other_value': '%1$d Emoji Packs'\n },\n 'ReactionsAll': 'All',\n 'EnableSomeReactionsInfo': 'Members of the group can use only certain approved emoji as reactions to messages.',\n 'EnableAllReactionsInfo': 'Members of the group can use any emoji as reactions to messages.',\n 'DisableReactionsInfo': 'Members of the group can’t add any reactions to messages.',\n 'OnlyAllowThisReactions': 'Only allow these reactions',\n 'AllReactions': 'All reactions',\n 'SomeReactions': 'Some reactions',\n 'NoReactions': 'No reactions',\n 'LimitReached': 'Limit Reached',\n 'LimitReachedPinDialogs': 'You can\\'t pin more than %1$d chats to the top. Unpin some that are currently pinned – or subscribe to **Telegram Premium** to double the limit to **%2$d** chats.',\n 'LimitReachedPinDialogsPremium': 'Sorry, you can\\'t pin more than %1$d chats to the top. Unpin some that are currently pinned.',\n 'LimitReachedPinDialogsLocked': 'Sorry, you can\\'t pin more than %1$d chats to the top. Unpin some that are currently pinned. We are working to let you increase this limit in the future.',\n 'IncreaseLimit': 'Increase Limit',\n 'LimitFree': 'Free',\n 'LimitPremium': 'Premium',\n 'ActionTTLChanged': 'un1 set messages to auto-delete in %1$s',\n 'ActionTTLYouChanged': 'You set messages to auto-delete in %1$s',\n 'ActionTTLChannelChanged': 'Messages in this channel will be automatically deleted after %1$s',\n 'ActionTTLChannelDisabled': 'Messages in this channel will no longer be automatically deleted',\n 'ActionTTLDisabled': 'un1 disabled the auto-delete timer',\n 'ActionTTLYouDisabled': 'You disabled the auto-delete timer',\n 'UsernamesProfileHeader': 'Username order',\n 'UsernamesProfileHelp': 'Drag and drop links to change the order in which they will be displayed on your info page.',\n 'UsernamesChannelHelp': 'Drag and drop links to change the order in which they will be displayed on the channel info page.',\n 'UsernameLinkEditable': 'tap to edit',\n 'UsernameLinkActive': 'active',\n 'UsernameLinkInactive': 'not active',\n 'UsernameActivateLink': 'Activate link',\n 'UsernameDeactivateLink': 'Deactivate link',\n 'UsernameActivateLinkProfileMessage': 'Do you want to show this link on your info page?',\n 'UsernameDeactivateLinkProfileMessage': 'Do you want to hide this link from your info page?',\n 'UsernameActivateLinkChannelMessage': 'Do you want to show this link on the channel info page?',\n 'UsernameDeactivateLinkChannelMessage': 'Do you want to hide this link from the channel info page?',\n 'Hide': 'Hide',\n 'Show': 'Show',\n 'UsernameActivateErrorTitle': 'Too many active links',\n 'UsernameActivateErrorMessage': 'Sorry, you have too many active public links already. Please hide one of your active public links first.',\n 'ChannelSignMessages': 'Sign Messages',\n // 'ChannelSignMessagesInfo': 'Add names of admins to the messages they post',\n 'TopicWasCreatedAction': '%s was created',\n 'Topics': 'Topics',\n 'ForumToggleDescription': 'The group chat will be divided into topics created by admins or users.',\n 'AnonymousNumber': 'Anonymous Number',\n 'Info': 'Info',\n 'BotSettings': 'Settings',\n 'OpenMessage': 'VIEW MESSAGE',\n 'OpenGroup': 'VIEW GROUP',\n 'CloseTopic': 'Close topic',\n 'RestartTopic': 'Reopen topic',\n 'LimitReachedPinnedTopics': 'Sorry, you can\\'t pin more than %d topics to the top.',\n 'TopicProfileStatus': 'In %s',\n 'AccDescrTopic': 'Topic',\n 'DeleteTopics': {\n 'one_value': 'Delete topic',\n 'other_value': 'Delete topics'\n },\n 'DeleteSelectedTopic': 'Are you sure you want delete %s?',\n 'NewTopic': 'New Topic',\n 'CreateTopicTitle': 'Choose a topic name and icon',\n 'CreateGeneralTopicTitle': 'Choose topic name',\n 'EditTopicHide': 'Show in Topics',\n 'EditTopicHideInfo': 'If the \\'General\\' topic is hidden, group members can pull down in the topic list to view it.',\n 'OpenUrlOption1': 'Log in to %1$s as **%2$s**',\n 'OpenUrlOption2': 'Allow **%1$s** to send me messages',\n 'OtherWebSessions': 'Connected websites',\n 'WebSessionsTitle': 'Logged In with Telegram',\n 'TerminateWebSessionText': 'Are you sure you want to disconnect %1$s?',\n 'Disconnect': 'Disconnect',\n 'TerminateAllWebSessions': 'Disconnect All Websites',\n 'AreYouSureWebSessions': 'Are you sure you want to disconnect all websites where you logged in with Telegram?',\n 'ClearOtherWebSessionsHelp': 'You can log in on websites that support signing in with Telegram.',\n 'TerminateWebSessionInfo': 'Tap to disconnect from your Telegram account.',\n 'EnablePhotoSpoiler': 'Hide with spoiler',\n 'DisablePhotoSpoiler': 'Remove spoiler',\n 'LimitReachedFolders': 'You have reached the limit of **%1$d** folders. You can double the limit to **%2$d** folders by subscribing to **Telegram Premium**.',\n 'LimitReachedFoldersPremium': 'You have reached the limit of **%1$d** folders for this account.',\n 'LimitReachedFoldersLocked': 'You have reached the limit of **%1$d** folders for this account. We are working to let you increase this limit in the future.',\n 'FwdMessageToSavedMessages': 'Message forwarded to **Saved Messages**.',\n 'FwdMessagesToSavedMessages': 'Messages forwarded to **Saved Messages**.',\n 'ColorTheme': 'Color theme',\n 'SendAsFile': 'Send as file',\n 'SendAsFiles': 'Send as files',\n 'ChatThemeChangedYou': 'You changed the chat theme to %1$s',\n 'ChatThemeChangedTo': '%1$s changed the chat theme to %2$s',\n 'ChatThemeDisabled': '%1$s disabled the chat theme',\n 'ChatThemeDisabledYou': 'You disabled the chat theme',\n 'ThemeDay': 'Day',\n 'ThemeNight': 'Night',\n 'AutoNightSystemDefault': 'System Default',\n 'GlobalAttachPlainRestricted': 'Sending text messages isn\\'t allowed in this group.',\n 'GlobalAttachDocumentsRestricted': 'Sending documents isn\\'t allowed in this group.',\n 'GlobalAttachMediaRestricted': 'Sending media isn\\'t allowed in this group.',\n 'GlobalAttachAudioRestricted': 'Sending music isn\\'t allowed in this group.',\n 'GlobalAttachPhotoRestricted': 'Sending photos isn\\'t allowed in this group.',\n 'GlobalAttachVideoRestricted': 'Sending videos isn\\'t allowed in this group.',\n 'GlobalAttachVoiceRestricted': 'Sending voice isn\\'t allowed in this group.',\n 'GlobalAttachRoundRestricted': 'Sending round videos isn\\'t allowed in this group.',\n 'GlobalAttachInlineRestricted': 'Sending inline content isn\\'t allowed in this group.',\n 'GlobalAttachStickersRestricted': 'Stickers aren\\'t allowed in this group.',\n 'GlobalAttachGifRestricted': 'Sending GIFs is not allowed in this group.',\n 'GlobalAttachEmojiRestricted': 'Text messages aren\\'t allowed in this group.',\n 'GlobalSendMessageRestricted': 'Sending messages is not allowed in this group.',\n 'ErrorSendRestrictedPollsAll': 'Sorry, sending polls is not allowed in this group.',\n 'Remove': 'Remove',\n 'ChannelBlockUser': 'Remove User',\n 'StickersName': 'Stickers and Emoji',\n 'LoopAnimatedStickersInfo': 'Animated stickers will play continuously in chats.',\n 'SuggestStickersAll': 'All Sets',\n 'SuggestStickersInstalled': 'My Sets',\n 'SuggestStickersNone': 'None',\n 'DynamicPackOrder': 'Dynamic Pack Order',\n 'DynamicPackOrderInfo': 'Automatically place recently used sticker packs at the front of the panel.',\n\n // * macos\n 'AccountSettings.Filters': 'Chat Folders',\n 'AccountSettings.Notifications': 'Notifications and Sounds',\n 'AccountSettings.PrivacyAndSecurity': 'Privacy and Security',\n 'AccountSettings.Language': 'Language',\n 'Alert.UserDoesntExists': 'Sorry, this user doesn\\'t seem to exist.',\n 'Alert.Confirm.Discard': 'Discard',\n 'Appearance.Reset': 'Reset to Defaults',\n 'AutoDownloadSettings.Delimeter': ', ',\n 'AutoDownloadSettings.LastDelimeter': ' and ',\n 'Bio.Description': 'Any details such as age, occupation or city.\\nExample: 23 y.o. designer from San Francisco',\n 'Call.Accept': 'Accept',\n 'Call.Decline': 'Decline',\n 'Call.End': 'End',\n 'Call.Camera': 'Camera',\n 'Call.Mute': 'Mute',\n 'Call.Recall': 'Recall',\n 'Call.Close': 'Close',\n 'Call.Screen': 'Screen',\n 'Call.Confirm.Discard.Voice.Header': 'Video Chat in Progress',\n 'Call.Confirm.Discard.Voice.ToVoice.Text': 'Leave video chat in \"%1$@\" and start a new one in \"%2$@\"?',\n 'Call.Confirm.Discard.Voice.ToCall.Text': 'Leave video chat in \"%1$@\" and start a call with \"%2$@\"?',\n 'Call.Confirm.Discard.Call.Header': 'Call in Progress',\n 'Call.Confirm.Discard.Call.ToVoice.Text': 'End call with \"%1$@\" and start a video chat in \"%2$@\"?',\n 'Call.Confirm.Discard.Call.ToCall.Text': 'End call with \"%1$@\" and start a video chat in \"%2$@\"?',\n 'Call.PrivacyErrorMessage': 'Sorry, you cannot call %@ because of their privacy settings.',\n 'Call.StatusRequesting': 'Contacting...',\n 'Call.StatusRinging': 'Ringing...',\n 'Call.StatusConnecting': 'Connecting...',\n 'Call.StatusEnded': 'Call Ended',\n 'Call.StatusFailed': 'Call Failed',\n 'Call.StatusBusy': 'Busy',\n 'Call.StatusCalling': 'is calling you...',\n 'Contacts.PhoneNumber.NotRegistred': 'The person with this phone number is not registered on Telegram yet.',\n 'Channel.UsernameAboutChannel': 'People can share this link with others and can find your channel using Telegram search.',\n 'Channel.UsernameAboutGroup': 'People can share this link with others and find your group using Telegram search.',\n 'Chat.Accessory.Forward': {\n 'one_value': 'Forward Message',\n 'other_value': 'Forward %d Messages'\n },\n 'Chat.Accessory.Forward.You': 'You',\n 'Chat.Accessory.Forward.From': 'From',\n 'Chat.Accessory.Hidden': {\n 'one_value': 'Forward Message (sender\\'s name hidden)',\n 'other_value': 'Forward %d Messages (senders\\' names hidden)'\n },\n 'Chat.Alert.Forward.Action.Another': 'Forward to Another Chat',\n 'Chat.Alert.Forward.Action.Hide1': {\n 'one_value': 'Hide Sender\\'s Name',\n 'other_value': 'Hide Senders\\' Names'\n },\n 'Chat.Alert.Forward.Action.Show1': {\n 'one_value': 'Show Sender\\'s Name',\n 'other_value': 'Show Senders\\' Names'\n },\n 'Chat.Alert.Forward.Action.ShowCaption': {\n 'one_value': 'Show Caption',\n 'other_value': 'Show Captions'\n },\n 'Chat.Alert.Forward.Action.HideCaption': {\n 'one_value': 'Hide Caption',\n 'other_value': 'Hide Captions'\n },\n 'Chat.CopySelectedText': 'Copy Selected Text',\n 'Chat.Confirm.Unpin': 'Would you like to unpin this message?',\n 'Chat.Context.Reacted': '%1$@/%2$@ Reacted',\n 'Chat.Context.ReactedFast': {\n 'other_value': '%d Reacted'\n },\n 'Chat.Date.ScheduledFor': 'Scheduled for %@',\n 'Chat.Date.ScheduledForToday': 'Scheduled for today',\n 'Chat.DropTitle': 'Drop files here to send them',\n 'Chat.DropQuickDesc': 'in a quick way',\n 'Chat.DropAsFilesDesc': 'without compression',\n 'Chat.Edit.Cancel.Text': 'Are you sure you want to discard all changes?',\n 'Chat.Input.ReplyToAnswer': 'Reply to message in topics',\n 'Chat.SendVoice.PrivacyError': '%@ doesn\\'t accept voice and video messages',\n 'Chat.Service.Call.Cancelled': 'Cancelled',\n 'Chat.Service.Call.Missed': 'Missed',\n 'Chat.Service.PeerJoinedTelegram': '%@ joined Telegram',\n 'Chat.Service.Channel.UpdatedTitle': 'Channel renamed to \"%@\"',\n 'Chat.Service.Channel.UpdatedPhoto': 'Channel photo updated',\n 'Chat.Service.Channel.RemovedPhoto': 'Channel photo removed',\n 'Chat.Service.Channel.UpdatedVideo': 'Channel video updated',\n 'Chat.Service.BotPermissionAllowed': 'You allowed this bot to message you when you logged in on %@',\n 'Chat.Service.Group.UpdatedPinnedMessage': '%@ pinned \"%@\"',\n 'Chat.Service.Group.TopicEdited.Icon': '%1$@ changed topic icon to %2$@',\n 'Chat.Service.Group.TopicEdited.Icon.Removed': '%1$@ removed icon',\n 'Chat.Service.Group.TopicEdited.Title': '%1$@ changed topic name to \"%2$@\"',\n 'Chat.Service.Group.TopicEdited.Paused': '%1$@ closed topic',\n 'Chat.Service.Group.TopicEdited.Resumed': '%1$@ restarted topic',\n 'Chat.Service.Group.TopicEdited.You.Icon': 'You changed topic icon to %1$@',\n 'Chat.Service.Group.TopicEdited.You.Icon.Removed': 'You removed icon',\n 'Chat.Service.Group.TopicEdited.You.Title': 'You changed topic name to \"%1$@\"',\n 'Chat.Service.Group.TopicEdited.You.Paused': 'You closed topic',\n 'Chat.Service.Group.TopicEdited.You.Resumed': 'You restarted topic',\n 'Chat.Service.Group.TopicEdited.You.Hided': 'You hid the general topic',\n 'Chat.Service.Group.TopicEdited.You.Unhided': 'You unhid the general topic',\n 'Chat.Service.Group.TopicEdited.Hided': '%1$@ hid the general topic',\n 'Chat.Service.Group.TopicEdited.Unhided': '%1$@ unhid the general topic',\n 'Chat.Service.PaymentSent1': 'You have successfully transferred **%1$@** to **%2$@** for **%3$@**',\n 'Chat.Service.PaymentSent1NoTitle': 'You have successfully transferred **%1$@** to **%2$@**',\n 'Chat.Service.PaymentSentRecurringInit': 'You successfully transferred **%1$@** to **%2$@** for **%3$@** and allowed future recurring payments',\n 'Chat.Service.PaymentSentRecurringInitNoTitle': 'You successfully transferred **%1$@** to **%2$@** and allowed future recurring payments',\n 'Chat.Service.PaymentSentRecurringUsed': 'You have just successfully transferred **%1$@** to **%2$@** for **%3$@** via recurrent payments',\n 'Chat.Service.PaymentSentRecurringUsedNoTitle': 'You have just successfully transferred **%1$@** to **%2$@** via recurrent payments',\n 'Chat.Service.VoiceChatStarted': '%1$@ started a [video chat](open)',\n 'Chat.Service.VoiceChatStartedYou': 'You started a [video chat](open)',\n 'Chat.Service.VoiceChatStarted.Channel': '[Live Stream](open) started',\n 'Chat.Service.VoiceChatFinished': '%1$@ ended the video chat (%2$@)',\n 'Chat.Service.VoiceChatFinishedYou': 'You ended the video chat (%@)',\n 'Chat.Service.VoiceChatFinished.Channel': 'Live Stream ended (%1$@)',\n 'Chat.Service.VoiceChatInvitation': '%1$@ invited %2$@ to the [video chat](open)',\n 'Chat.Service.VoiceChatInvitationByYou': 'You invited %1$@ to the [video chat](open)',\n 'Chat.Service.VoiceChatInvitationForYou': '%1$@ invited you to the [video chat](open)',\n 'ChatService.UserJoinedGroupByRequest': '%@ was accepted to the group',\n 'ChatService.UserJoinedChannelByRequest': '%@ joined the channel by request',\n 'ChatList.Service.VoiceChatScheduled': '%1$@ scheduled a video chat for %2$@',\n 'ChatList.Service.VoiceChatScheduledYou': 'You scheduled a video chat for %2$@',\n 'Chat.Poll.Unvote': 'Retract Vote',\n 'Chat.Poll.Stop': 'Stop Poll',\n 'Chat.Poll.ViewResults': 'View Results',\n 'Chat.Poll.SubmitVote': 'Vote',\n 'Chat.Poll.Type.Anonymous': 'Anonymous Poll',\n 'Chat.Poll.Type.Public': 'Poll',\n 'Chat.Poll.Type.AnonymousQuiz': 'Anonymous Quiz',\n 'Chat.Poll.Type.Quiz': 'Quiz',\n 'Chat.Poll.Type.Closed': 'Final Results',\n 'Chat.Poll.TotalVotes1': {\n 'one_value': '%d vote',\n 'other_value': '%d votes'\n },\n 'Chat.Quiz.TotalVotes': {\n 'one_value': '%d answer',\n 'other_value': '%d answers'\n },\n 'Chat.Poll.TotalVotesEmpty': 'No votes yet',\n 'Chat.Poll.TotalVotesResultEmpty': 'No votes',\n 'Chat.Quiz.TotalVotesEmpty': 'No answers yet',\n 'Chat.Quiz.TotalVotesResultEmpty': 'No answers',\n // \"Chat.Poll.Stop.Confirm.Header\": \"Stop Poll?\",\n // \"Chat.Poll.Stop.Confirm.Text\": \"If you stop this poll now, nobody will be able to vote in it anymore. This action cannot be undone.\",\n // \"Chat.Pinned.UnpinAll\": {\n // \"one_value\": \"Unpin %d Message\",\n // \"other_value\": \"Unpin All %d Messages\"\n // },\n 'Chat.Pinned.DontShow': 'Don\\'t Show Pinned Messages',\n 'Chat.Title.Comments': {\n 'one_value': '%d Comment',\n 'other_value': '%d Comments'\n },\n 'ChatTitle.ReportMessages': 'Report Messages',\n 'Chat.Send.WithoutSound': 'Send Without Sound',\n 'Chat.Send.SetReminder': 'Set a Reminder',\n 'Chat.Send.ScheduledMessage': 'Schedule Message',\n 'Chat.SendAs.PersonalAccount': 'personal account',\n 'Chat.UnpinAllMessagesConfirmation': {\n 'one_value': 'Do you want to unpin %d message in this chat?',\n 'other_value': 'Do you want to unpin all %d messages in this chat?'\n },\n 'Chat.Message.Ad.Text': 'Unlike other apps, Telegram never uses your private data to target ads. Sponsored messages on Telegram are based solely on the topic of the public channels in which they are shown. This means that no user data is mined or analyzed to display ads, and every user viewing a channel on Telegram sees the same sponsored messages.\\n\\nUnlike other apps, Telegram doesn\\'t track whether you tapped on a sponsored message and doesn\\'t profile you based on your activity. We also prevent external links in sponsored messages to ensure that third parties can’t spy on our users. We believe that everyone has the right to privacy, and technological platforms should respect that.\\n\\nTelegram offers a free and unlimited service to hundreds of millions of users, which involves significant server and traffic costs. In order to remain independent and stay true to its values, Telegram developed a paid tool to promote messages with user privacy in mind. We welcome responsible advertisers at:\\n\\n%@\\n\\nSponsored Messages are currently in test mode. Once they are fully launched and allow Telegram to cover its basic costs, we will start sharing ad revenue with the owners of public channels in which sponsored messages are displayed.\\n\\nOnline ads should no longer be synonymous with abuse of user privacy. Let us redefine how a tech company should operate – together.',\n 'Chat.Message.Ad.ReadMore': 'Read More',\n 'Chat.Message.ViewChannel': 'VIEW CHANNEL',\n 'Chat.Message.ViewBot': 'VIEW BOT',\n 'Chat.Message.ViewGroup': 'VIEW GROUP',\n 'Chat.Message.Sponsored.What': 'What are sponsored messages?',\n 'Chat.Message.Sponsored.Link': 'https://promote.telegram.org',\n 'Chat.Voice.Transribe.Error': 'No speech detected',\n 'Checkout.2FA.Text': 'Saving payment details is only available with 2-Step Verification.',\n 'Checkout.NewCard.CardholderNamePlaceholder': 'Cardholder Name',\n 'Checkout.PasswordEntry.Title': 'Payment Confirmation',\n 'Checkout.PasswordEntry.Pay': 'Pay',\n 'Checkout.PasswordEntry.Text': 'Your card %@ is on file. To pay with this card, please enter your 2-Step-Verification password.',\n 'Checkout.PayPrice': 'Pay %@',\n 'Checkout.WebConfirmation.Title': 'Complete Payment',\n 'ChatList.Context.Mute': 'Mute',\n 'ChatList.Context.Unmute': 'Unmute',\n 'ChatList.Context.Pin': 'Pin',\n 'ChatList.Context.Unpin': 'Unpin',\n 'ChatList.Context.DeleteChat': 'Delete Chat',\n 'ChatList.Context.DeleteAndExit': 'Delete and Leave',\n 'ChatList.Context.LeaveChannel': 'Leave Channel',\n 'ChatList.Context.LeaveGroup': 'Leave Group',\n 'ChatList.Service.Call.incoming': 'Incoming Call (%@)',\n 'ChatList.Service.Call.outgoing': 'Outgoing Call (%@)',\n 'ChatList.Service.VideoCall.incoming': 'Incoming Video Call (%@)',\n 'ChatList.Service.VideoCall.outgoing': 'Outgoing Video Call (%@)',\n 'ChatList.Service.Call.Cancelled': 'Cancelled Call',\n 'ChatList.Service.Call.Missed': 'Missed Call',\n 'ChatList.Service.VideoCall.Cancelled': 'Cancelled Video Call',\n 'ChatList.Service.VideoCall.Missed': 'Missed Video Call',\n 'ChatList.Service.VoiceChatScheduled.Channel': 'Voice chat scheduled for %@',\n 'ChatList.Filter.Header': 'Create folders for different groups of chats and quickly switch between them.',\n 'ChatList.Filter.NewTitle': 'Create Folder',\n 'ChatList.Filter.List.Title': 'Chat Folders',\n 'ChatList.Filter.Include.AddChat': 'Add Chats',\n 'ChatList.Filter.Exclude.AddChat': 'Add Chats',\n // \"ChatList.Filter.All\": \"All\",\n 'ChatList.Filter.Contacts': 'Contacts',\n 'ChatList.Filter.NonContacts': 'Non-Contacts',\n 'ChatList.Filter.Groups': 'Groups',\n 'ChatList.Filter.Channels': 'Channels',\n 'ChatList.Filter.Bots': 'Bots',\n 'ChatList.Filter.MutedChats': 'Muted',\n 'ChatList.Filter.ReadChats': 'Read',\n 'ChatList.Filter.Archive': 'Archived',\n 'ChatList.Filter.Include.LimitReached': 'Sorry, you can only add up to 100 individual chats. Try using chat types.',\n 'ChatList.Filter.Exclude.LimitReached': 'Sorry, you can only add up to 100 individual chats. Try using chat types.',\n 'ChatList.Filter.Confirm.Remove.Header': 'Remove Folder',\n 'ChatList.Filter.Confirm.Remove.Text': 'Are you sure you want to remove this folder? Your chats will not be deleted.',\n 'ChatList.Mute.1Hour': 'For 1 Hour',\n 'ChatList.Mute.4Hours': 'For 4 Hours',\n 'ChatList.Mute.8Hours': 'For 8 Hours',\n 'ChatList.Mute.1Day': 'For 1 Day',\n 'ChatList.Mute.3Days': 'For 3 Days',\n 'ChatList.Mute.Forever': 'Forever',\n 'Channel.DescriptionHolderDescrpiton': 'You can provide an optional description for your channel.',\n 'Channel.Persmission.MessageBlock': 'Text is not Allowed',\n 'ChannelVisibility.Confirm.MakePrivate.Channel': 'If you make this channel private, the name @%@ will be removed. Anyone else will be able to take it for their public groups or channels.',\n 'ChannelVisibility.Confirm.MakePrivate.Group': 'If you make this group private, the name @%@ will be removed. Anyone else will be able to take it for their public groups or channels.',\n 'Context.ViewStickerSet': 'View Sticker Set',\n 'CreateGroup.NameHolder': 'Group Name',\n 'CustomEmoji.PremiumAlert': 'Subscribe to Telegram Premium to unlock this emoji. [Read More]()',\n 'Date.Today': 'Today',\n 'DeleteChat.DeleteGroupForAll': 'Delete for all members',\n 'DeleteChannelForAll': 'Delete for all subscribers',\n 'ForumTopic.Context.Info': 'Group Info',\n 'ForumTopic.Context.AddMember': 'Add Members',\n 'ForumTopic.Context.ShowAsMessages': 'View as Messages',\n 'ForumTopic.Context.New': 'Create Topic',\n 'ForumTopic.Name.Placeholder': 'Topic Name',\n 'ForumTopic.Title.Edit': 'Edit Topic',\n 'EditAccount.Username': 'Username',\n 'EditAccount.Title': 'Edit Profile',\n 'EditAccount.Logout': 'Log Out',\n 'Emoji.Recent': 'Frequently Used',\n 'Emoji.SmilesAndPeople': 'Smileys & People',\n 'Emoji.AnimalsAndNature': 'Animals & Nature',\n 'Emoji.FoodAndDrink': 'Food & Drink',\n 'Emoji.ActivityAndSport': 'Activity & Sport',\n 'Emoji.TravelAndPlaces': 'Travel & Places',\n 'Emoji.Objects': 'Objects',\n // \"Emoji.Symbols\": \"Symbols\",\n 'Emoji.Flags': 'Flags',\n 'Error.AnError': 'An error occurred. Please try again later.',\n 'FileSize.B': '%@ B',\n 'FileSize.KB': '%@ KB',\n 'FileSize.MB': '%@ MB',\n 'FileSize.GB': '%@ GB',\n 'InstalledStickers.LoopAnimated': 'Loop Animated Stickers',\n 'LastSeen.HoursAgo': {\n 'one_value': 'last seen %d hour ago',\n 'other_value': 'last seen %d hours ago'\n },\n 'Login.Register.LastName.Placeholder': 'Last Name',\n 'LiteMode.Title': 'Power Saving',\n 'LiteMode.Key.emoji.Title': 'Emoji Animations',\n 'LiteMode.Key.gif.Title': 'Autoplay GIFs',\n 'LiteMode.Key.video.Title': 'Autoplay Videos',\n 'LiteMode.Key.stickers.Title': 'Sticker Animations',\n 'LiteMode.Key.animations.Title': 'Interface Animations',\n // 'LiteMode.Key.emoji.Info': 'Loop animated emoji in messages, reactions and statuses.',\n // 'LiteMode.Key.gif.Info': 'Autoplay and loop GIFs in chats and in the keyboard.',\n // 'LiteMode.Key.video.Info': 'Autoplay and loop videos and video messages in chats.',\n // 'LiteMode.Key.stickers.Info': 'Loop animated stickers, in chats and in the keyboard.',\n // 'LiteMode.Key.animations.Info': 'Other animations that make Telegram look amazing.',\n 'LiteMode.Info': 'Reduce all power-intensive animations and improve performance.',\n 'LiteMode.EnableText': 'Power Saving Mode',\n 'LiteMode.DisableAlert': 'Disable Power Saving Mode',\n 'Message.Context.Select': 'Select',\n 'Message.Context.Pin': 'Pin',\n 'Message.Context.Unpin': 'Unpin',\n 'Message.Context.Goto': 'Show Message',\n 'Message.ReplyActionButtonShowReceipt': 'Show Receipt',\n 'MessageContext.CopyMessageLink1': 'Copy Message Link',\n 'Modal.Send': 'Send',\n 'NewContact.Exception.ShareMyPhoneNumber': 'Share My Phone Number',\n 'NewContact.Exception.ShareMyPhoneNumber.Desc': 'You can make your phone visible to %@.',\n 'NewPoll.Anonymous': 'Anonymous Voting',\n 'NewPoll.Explanation.Placeholder': 'Add a Comment (Optional)',\n 'NewPoll.OptionsAddOption': 'Add an Option',\n 'NewPoll.MultipleChoice': 'Multiple Answers',\n 'NewPoll.Quiz': 'Quiz Mode',\n 'Notification.Contact.Reacted': '%1$@ to your \"%2$@\"',\n // \"Notification.Group.Reacted\": \"%1$@: %2$@ to your \"%3$@\"\",\n 'Payments.Recurrent.Accept': 'I accept [Terms of Service]() of **%@**.',\n 'Peer.Activity.User.PlayingGame': 'playing a game',\n 'Peer.Activity.User.TypingText': 'typing',\n 'Peer.Activity.User.SendingPhoto': 'sending a photo',\n 'Peer.Activity.User.RecordingVideo': 'recording video',\n 'Peer.Activity.User.SendingVideo': 'sending a video',\n 'Peer.Activity.User.RecordingAudio': 'recording voice',\n 'Peer.Activity.User.SendingFile': 'sending file',\n 'Peer.Activity.User.ChoosingSticker': 'choosing a sticker',\n 'Peer.Activity.User.EnjoyingAnimations': 'watching %@',\n 'Peer.Activity.Chat.PlayingGame': '%@ is playing a game',\n 'Peer.Activity.Chat.TypingText': '%@ is typing',\n 'Peer.Activity.Chat.SendingPhoto': '%@ is sending a photo',\n 'Peer.Activity.Chat.RecordingVideo': '%@ is recording video',\n 'Peer.Activity.Chat.SendingVideo': '%@ is sending a video',\n 'Peer.Activity.Chat.RecordingAudio': '%@ is recording voice',\n 'Peer.Activity.Chat.SendingFile': '%@ is sending a file',\n 'Peer.Activity.Chat.ChoosingSticker': '%@ is choosing a sticker',\n 'Peer.Activity.Chat.EnjoyingAnimations': '%@ is watching %@',\n 'Peer.Activity.Chat.Multi.PlayingGame1': '%@ and %d others are playing a game',\n 'Peer.Activity.Chat.Multi.TypingText1': '%@ and %d others are typing',\n 'Peer.Activity.Chat.Multi.SendingPhoto1': '%@ and %d others are sending photos',\n 'Peer.Activity.Chat.Multi.RecordingVideo1': '%@ and %d others are recording video',\n 'Peer.Activity.Chat.Multi.SendingVideo1': '%@ and %d others are sending videos',\n 'Peer.Activity.Chat.Multi.RecordingAudio1': '%@ and %d others are recording voice',\n // \"Peer.Activity.Chat.Multi.SendingAudio1\": \"%@ and %d others are sending audio\",\n 'Peer.Activity.Chat.Multi.SendingFile1': '%@ and %d others are sending files',\n 'Peer.Activity.Chat.Multi.ChoosingSticker1': '%@ and %d others are choosing stickers',\n 'Peer.ServiceNotifications': 'service notifications',\n 'Peer.RepliesNotifications': 'Reply Notifications',\n 'Peer.Status.justNow': 'last seen just now',\n 'Peer.Status.Today': 'today',\n 'Peer.Status.Yesterday': 'yesterday',\n 'Peer.Status.LastSeenAt': 'last seen %@ at %@',\n 'Peer.Status.minAgo': {\n 'one_value': 'last seen %d minute ago',\n 'other_value': 'last seen %d minutes ago'\n },\n 'Peer.Status.Member': {\n 'one_value': '%d member',\n 'other_value': '%d members'\n },\n 'Peer.Status.Subscribers': {\n 'one_value': '%d subscriber',\n 'other_value': '%d subscribers'\n },\n 'PeerInfo.Administrators': 'Administrators',\n 'PeerInfo.DeleteChannel': 'Delete Channel',\n 'PeerInfo.Discussion': 'Discussion',\n 'PeerInfo.Discussion.Add': 'Add',\n 'PeerInfo.SharedMedia': 'Shared Media',\n 'PeerInfo.Subscribers': 'Subscribers',\n 'PeerInfo.DeleteContact': 'Delete Contact',\n // \"PeerInfo.Confirm.RemovePeer\": \"Remove %@ from the group?\",\n 'PeerInfo.Action.VoiceChat': 'Video Chat',\n 'PeerInfo.Action.LiveStream': 'Live Stream',\n 'PeerInfo.Phone.AnonymousInfo': 'This number is not tied to a SIM card and was acquired on [Fragment]().',\n 'PeerMedia.Members': 'Members',\n 'PollResults.Title.Poll': 'Poll Results',\n 'PollResults.Title.Quiz': 'Quiz Results',\n 'PollResults.LoadMore': {\n 'other_value': 'Show More (%d)'\n },\n // \"PeerInfo.Confirm.DeleteGroupConfirmation\": \"Wait! Deleting this group will remove all members and all messages will be lost. Delete the group anyway?\",\n 'Preview.Dragging.AddItems': {\n 'one_value': 'Add Item',\n 'other_value': 'Add Items'\n },\n 'PreviewSender.CaptionPlaceholder': 'Add a caption...',\n 'PreviewSender.CompressFile': 'Send compressed',\n 'PreviewSender.SendFile': {\n 'one_value': 'Send File',\n 'other_value': 'Send %d Files'\n },\n 'PreviewSender.SendPhoto': {\n 'one_value': 'Send Photo',\n 'other_value': 'Send %d Photos'\n },\n 'PreviewSender.SendVideo': {\n 'one_value': 'Send Video',\n 'other_value': 'Send %d Videos'\n },\n 'PrivacyAndSecurity.Item.On': 'On',\n 'PrivacyAndSecurity.Item.Off': 'Off',\n 'PrivacyAndSecurity.SensitiveText': 'Disable filtering',\n 'PrivacyAndSecurity.SensitiveDesc': 'Display sensitive media in public channels on all your Telegram devices.',\n 'PrivacySettings.VoiceCalls': 'Calls',\n 'PrivacySettings.Forwards': 'Forwarded Messages',\n 'PrivacySettings.Groups': 'Groups and Channels',\n 'PrivacySettingsController.AddUsers': 'Add Users',\n 'PrivacySettingsController.GroupDescription': 'You can restrict who can add you to groups and channels with granular precision.',\n 'PrivacySettingsController.Forwards.CustomHelp': 'You can restrict who can add a link to your account when forwarding your messages.',\n 'PrivacySettingsController.P2p.Desc': 'Disabling peer-to-peer will relay all calls through Telegram servers to avoid revealing your IP address, but may slightly decrease audio and video quality.',\n 'PrivacySettingsController.PhoneCallDescription': 'You can restrict who can call you with granular precision.',\n 'PrivacySettingsController.ProfilePhoto.CustomHelp': 'You can restrict who can see your profile photo with granular precision.',\n 'PrivacySettingsController.LastSeenDescription': 'You won\\'t see Last Seen and Online statuses for people with whom you don\\'t share yours. Approximate last seen will be shown instead (recently, within a week, within a month).',\n 'PrivacySettingsController.PeerInfo': 'You can add users or entire groups as exceptions that will override the settings above.',\n 'PrivacySettingsController.Everbody': 'Everybody',\n 'PrivacySettingsController.MyContacts': 'My Contacts',\n 'PrivacySettingsController.Nobody': 'Nobody',\n 'PrivacySettingsController.NeverShare': 'Never Share With',\n 'PrivacySettingsController.AlwaysShare': 'Always Share With',\n 'PrivacySettingsController.NeverAllow': 'Never Allow',\n 'PrivacySettingsController.AlwaysAllow': 'Always Allow',\n 'PrivacySettingsController.UserCount': {\n 'one_value': '%d user',\n 'other_value': '%d users'\n },\n 'RecentSessions.Error.FreshReset': 'For security reasons, you can\\'t terminate older sessions from a device that you\\'ve just connected. Please use an earlier connection or wait for a few hours.',\n 'RequestJoin.Button': 'Request to Join',\n 'Stickers.SearchAdd': 'Add',\n 'Stickers.SearchAdded': 'Added',\n 'Stickers.SuggestStickers': 'Suggest Stickers by Emoji',\n 'ShareModal.Search.Placeholder': 'Share to...',\n 'ShareModal.Search.ForwardPlaceholder': 'Forward to...',\n 'Telegram.GeneralSettingsViewController': 'General Settings',\n 'Telegram.InstalledStickerPacksController': 'Stickers',\n 'Telegram.NotificationSettingsViewController': 'Notifications',\n 'Telegram.LanguageViewController': 'Language',\n 'Text.CopyLabel_About': 'Copy About',\n 'Text.CopyLabel_Bio': 'Copy Bio',\n 'Text.CopyLabel_PhoneNumber': 'Copy Phone Number',\n 'Text.CopyLabel_Username': 'Copy Username',\n 'Text.CopyLabel_ShareLink': 'Copy Share Link',\n 'GeneralSettings.BigEmoji': 'Large Emoji',\n 'GeneralSettings.EmojiPrediction': 'Suggest Emoji',\n 'GroupPermission.Delete': 'Delete Exception',\n 'Search.Confirm.ClearHistory': 'Are you sure you want to clear your search history?',\n 'SecureId.Identity.Placeholder.ExpiryDate': 'Expiry Date',\n 'Separator.ShowMore': 'show more',\n 'Separator.ShowLess': 'show less',\n 'ScheduleController.at': 'at',\n 'Schedule.SendToday': 'Send today at %@',\n 'Schedule.SendDate': 'Send on %@ at %@',\n 'Schedule.SendWhenOnline': 'Send When Online',\n 'Sticker.Premium.Click.Info': 'This pack contains premium stickers like this one. [View Pack]()',\n 'Stickers.Recent': 'Recent',\n // \"Stickers.Favorite\": \"Favorite\",\n 'StickerSet.DontExist': 'Sorry, this sticker set doesn\\'t seem to exist.',\n 'Text.Context.Copy.Username': 'Copy Username',\n 'Text.Context.Copy.Hashtag': 'Copy Hashtag',\n 'Time.TomorrowAt': 'tomorrow at %@',\n 'TwoStepAuth.SetPasswordHelp': 'You can set a password that will be required when you log in on a new device in addition to the code you get in the SMS.',\n 'TwoStepAuth.GenericHelp': 'You have enabled Two-Step verification.\\nYou\\'ll need the password you set up here to log in to your Telegram account.',\n 'TwoStepAuth.ChangePassword': 'Change Password',\n 'TwoStepAuth.RemovePassword': 'Turn Password Off',\n 'TwoStepAuth.SetupEmail': 'Set Recovery Email',\n 'TwoStepAuth.ChangeEmail': 'Change Recovery Email',\n 'TwoStepAuth.ConfirmEmailCodeDesc': 'Please enter the code we\\'ve just emailed to %@.',\n 'TwoStepAuth.RecoveryTitle': 'Email Code',\n 'TwoStepAuth.RecoveryCode': 'Code',\n 'TwoStepAuth.RecoveryCodeInvalid': 'Invalid code. Please try again.',\n 'TwoStepAuth.RecoveryCodeExpired': 'Code Expired',\n 'TwoStepAuth.SetupHintTitle': 'Password Hint',\n 'TwoStepAuth.SetupHintPlaceholder': 'Hint',\n 'VoiceChat.Chat.StartNew': 'Video chat ended. Start a new one?',\n 'VoiceChat.Chat.StartNew.OK': 'Start',\n 'VoiceChat.Chat.Ended': 'Video chat ended.',\n 'VoiceChat.Invite.InviteMembers': 'Invite members',\n 'VoiceChat.Status.Connecting': 'Connecting...',\n 'VoiceChat.Status.Members': {\n 'one_value': '%d participant',\n 'other_value': '%d participants'\n },\n 'VoiceChat.Status.MutedForYou': 'muted for you',\n 'VoiceChat.Status.Speaking': 'speaking',\n 'VoiceChat.Status.Listening': 'listening',\n 'VoiceChat.Status.WantsSpeak': 'wants to speak',\n 'VoiceChat.Status.Muted': 'muted',\n 'VoiceChat.Status.You': 'This is you',\n 'VoiceChat.Video.Stream.Video': 'video',\n 'VoiceChat.Video.Stream.Screencast': 'screen',\n 'VoiceChat.Video.Stream.More': 'more',\n 'VoiceChat.Leave': 'Leave',\n 'VoiceChat.End.Title': 'Leave video chat',\n 'VoiceChat.End.Text': 'Are you sure you want to leave this video chat?',\n 'VoiceChat.End.Third': 'End Video Chat',\n 'VoiceChat.End.OK': 'Leave',\n 'VoiceChat.MutePeer': 'Mute',\n 'VoiceChat.UnmutePeer': 'Allow To Speak',\n 'VoiceChat.RemovePeer': 'Remove',\n 'VoiceChat.OpenProfile': 'Open Profile',\n 'VoiceChat.MuteForMe': 'Mute For Me',\n 'VoiceChat.UnmuteForMe': 'Unmute For Me',\n 'VoiceChat.RemovePeer.Confirm.Channel': 'Do you want to remove %1$@ from the channel?',\n 'VoiceChat.RemovePeer.Confirm': 'Are you sure you want to remove %1$@ from the group?',\n 'VoiceChat.RemovePeer.Confirm.OK': 'Remove'\n};\n\nexport default lang;\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"104.be090b1ee184fa23f913.chunk.js","mappings":"yHAAA,MA84CA,EA94Ca,CACX,WAAc,aACd,YAAe,QACf,uBAAwB,MACxB,uBAAwB,MACxB,gCAAiC,gBACjC,SAAY,YACZ,yBAA4B,qFAC5B,iBAAoB,gBACpB,iBAAoB,cACpB,gBAAmB,aACnB,kBAAqB,eACrB,qBAAwB,mBAC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A8B,mEAC9B,kBAAmB,SAEnB,uBAAwB,iDACxB,6BAA8B,gBAC9B,4BAA6B,eAC7B,kBAAmB,iBACnB,8BAA+B,2HAC/B,0BAA2B,wHAC3B,6BAA8B,kBAC9B,6BAA8B,oBAC9B,yBAA0B,qBAC1B,0BAA2B,wBAC3B,mCAAoC,kDACpC,4BAA6B,aAC7B,2BAA4B,OAC5B,kCAAmC,kCACnC,kCAAmC,eACnC,6BAA8B,gBAC9B,mCAAoC,OACpC,0BAA2B,qCAC3B,6BAA8B,QAC9B,uBAAwB,oBACxB,iCAAkC,iBAClC,8BAA+B,gBAC/B,2BAA4B,CAC1B,UAAa,iBACb,YAAe,mBAEjB,+BAAgC,gBAChC,4BAA6B,WAC7B,6BAA8B,YAC9B,8BAA+B,iBAC/B,yBAA0B,QAC1B,uBAAwB,cACxB,+BAAgC,QAChC,oCAAqC,SACrC,8BAA+B,OAC/B,kBAAmB,QACnB,sBAAuB,mBACvB,qBAAsB,kDACtB,sBAAuB,iBACvB,mBAAoB,QACpB,qBAAsB,OACtB,uBAAwB,iBACxB,uBAAwB,SACxB,wBAAyB,eACzB,sBAAuB,cACvB,wBAAyB,gBACzB,uCAAwC,+CACxC,+BAAgC,uDAChC,kCAAmC,S","sources":["webpack://tweb/./src/lang.ts"],"sourcesContent":["const lang = {\n 'Animations': 'Animations',\n 'AttachAlbum': 'Album',\n 'Appearance.Color.Hex': 'HEX',\n 'Appearance.Color.RGB': 'RGB',\n 'BlockModal.Search.Placeholder': 'Block user...',\n 'DarkMode': 'Dark Mode',\n 'FilterIncludeExcludeInfo': 'Choose chats and types of chats that will\\nappear and never appear in this folder.',\n 'FilterMenuDelete': 'Delete Folder',\n 'FilterHeaderEdit': 'Edit Folder',\n 'FilterAllGroups': 'All Groups',\n 'FilterAllContacts': 'All Contacts',\n 'FilterAllNonContacts': 'All Non-Contacts',\n 'FilterAllChannels': 'All Channels',\n 'FilterAllBots': 'All Bots',\n 'EditContact.OriginalName': 'original name',\n 'EditProfile.FirstNameLabel': 'Name',\n 'EditProfile.BioLabel': 'Bio (optional)',\n 'EditProfile.Username.Label': 'Username (optional)',\n 'EditProfile.Username.Available': 'Username is available',\n 'EditProfile.Username.Taken': 'Username is already taken',\n 'EditProfile.Username.Invalid': 'Username is invalid',\n 'ExceptionModal.Search.Placeholder': 'Add exception...',\n 'Chat.Menu.SelectMessages': 'Select Messages',\n 'Chat.Menu.ClearSelection': 'Clear Selection',\n 'Chat.Menu.Hint': 'To **edit** or **reply**, close this menu.\\nThen tap next to a message.',\n 'Chat.Input.UnpinAll': 'Unpin All Messages',\n 'Chat.Input.Attach.PhotoOrVideo': 'Photo or Video',\n 'Chat.Input.Attach.Document': 'Document',\n 'Chat.Subscribe': 'SUBSCRIBE',\n 'Chat.Selection.LimitToast': 'Max selection count reached.',\n 'Chat.Search.MessagesFound': {\n 'one_value': '%d message found',\n 'other_value': '%d messages found'\n },\n 'Chat.Search.NoMessagesFound': 'No messages found',\n 'Chat.Search.PrivateSearch': 'Private Search',\n 'Chat.Service.TopicEdited.Mixed': '%1$@ changed the topic name and icon to %2$@',\n 'Chat.Service.TopicEdited.You.Mixed': 'You changed the topic name and icon to %2$@',\n 'Chat.Service.TopicEdited.Mixed.IconRemoved': '%1$@ changed the topic name to \"%1$@\" and removed icon',\n 'Chat.Service.TopicEdited.You.Mixed.IconRemoved': 'You changed the topic name to \"%1$@\" and removed icon',\n 'ChatList.Main.EmptyPlaceholder.Title': 'Your chats will appear here',\n 'ChatList.Main.EmptyPlaceholder.Subtitle': 'You have %s on Telegram',\n 'ChatList.Main.EmptyPlaceholder.SubtitleNoContacts': 'Use Telegram app on your [Android](https://telegram.org/android) or [iOS](https://telegram.org/dl/ios) device to sync your contacts',\n // \"ChatList.Menu.Archived\": \"Archived\",\n 'ChatList.Menu.SwitchTo.Webogram': 'Switch to Old Version',\n 'ChatList.Menu.SwitchTo.Z': 'Switch to Z version',\n 'ChatMigration.From': 'Migrated from %s',\n 'ChatMigration.To': 'Migrated to %s',\n 'ConnectionStatus.ForceReconnect': 'force reconnect',\n 'ConnectionStatus.ReconnectIn': 'Reconnect in %ds, %s',\n 'ConnectionStatus.Reconnect': 'reconnect',\n 'ConnectionStatus.Reconnecting': 'Reconnecting...',\n 'ConnectionStatus.TimedOut': 'Request timed out, %s',\n 'ConnectionStatus.Waiting': 'Waiting for network...',\n 'Contacts.Count': {\n 'one_value': '%d contact',\n 'other_value': '%d contacts'\n },\n 'Deactivated.Title': 'Too many tabs...',\n 'Deactivated.Subtitle': 'Telegram supports only one active tab with the app.\\nClick anywhere to continue using this tab.',\n 'Deactivated.Version.Title': 'WebK has updated...',\n 'Deactivated.Version.Subtitle': 'Another tab is running a newer version of Telegram.\\nClick anywhere to reload this tab.',\n // \"Drafts\": {\n // \"one_value\": \"%d draft\",\n // \"other_value\": \"%d drafts\",\n // },\n 'General.Keyboard': 'Keyboard',\n 'General.SendShortcut.Enter': 'Send by Enter',\n 'General.SendShortcut.CtrlEnter': 'Send by %s + Enter',\n 'General.SendShortcut.NewLine.ShiftEnter': 'New line by Shift + Enter',\n 'General.SendShortcut.NewLine.Enter': 'New line by Enter',\n 'General.TimeFormat': 'Time Format',\n 'General.TimeFormat.h12': '12-hour',\n 'General.TimeFormat.h23': '24-hour',\n 'ChatBackground.UploadWallpaper': 'Upload Wallpaper',\n 'ChatBackground.Blur': 'Blur Wallpaper Image',\n 'Notifications.Sound': 'Notification Sound',\n 'NewPrivateChat': 'New Private Chat',\n 'NewPoll.OptionLabel': 'Option %d',\n 'Message.Context.Selection.Copy': 'Copy selected',\n 'Message.Context.Selection.Clear': 'Clear selection',\n 'Message.Context.Selection.Delete': 'Delete selected',\n 'Message.Context.Selection.Forward': 'Forward selected',\n 'Message.Context.Selection.Download': 'Download selected',\n 'Message.Context.Selection.SendNow': 'Send Now selected',\n 'Message.Unsupported.Desktop': '__This message is currently not supported on Telegram Web. Try [getdesktop.telegram.org](https://getdesktop.telegram.org/)__',\n 'Message.Unsupported.Mobile': '__This message is currently not supported on Telegram Web. Try [telegram.org/dl](https://telegram.org/dl/)__',\n 'Checkbox.Enabled': 'Enabled',\n 'Checkbox.Disabled': 'Disabled',\n 'Error.PreviewSender.CaptionTooLong': 'Caption is too long.',\n 'PreviewSender.GroupItems': 'Group items',\n 'PreviewSender.SendAlbum': {\n 'one_value': 'Send Album',\n 'other_value': 'Send %d Albums'\n },\n 'Presence.YourChat': 'chat with yourself',\n 'Privacy.Devices': {\n 'one_value': '%1$d device',\n 'other_value': '%1$d devices'\n },\n 'Privacy.Websites': {\n 'one_value': '%1$d website',\n 'other_value': '%1$d websites'\n },\n 'Privacy.SensitiveContent': 'Sensitive Content',\n 'PrivacyModal.Search.Placeholder': 'Add Users or Groups...',\n 'Permissions.NoExceptions': 'No exceptions',\n 'Permissions.ExceptionsCount': {\n 'one_value': '%d exception',\n 'other_value': '%d exceptions'\n },\n 'Permissions.RemoveFromGroup': 'Are you sure you want to remove **%s** from the group?',\n 'PWA.Install': 'Install App',\n 'Link.Available': 'Link is available',\n 'Link.Taken': 'Link is already taken',\n 'Link.Invalid': 'Link is invalid',\n 'LiteMode.Key.chat.Title': 'Chat Animations',\n 'LiteMode.Key.chat_background.Title': 'Background rotation',\n 'LiteMode.Key.chat_spoilers.Title': 'Animated spoiler effect',\n 'LiteMode.Key.stickers_panel.Title': 'Autoplay in panel',\n 'LiteMode.Key.stickers_chat.Title': 'Autoplay in chat',\n 'LiteMode.Key.emoji_panel.Title': 'Autoplay in panel',\n 'LiteMode.Key.emoji_messages.Title': 'Autoplay in messages',\n 'LiteMode.Key.effects.Title': 'Interactive Effects',\n 'LiteMode.Key.effects_reactions.Title': 'Reaction effect',\n 'LiteMode.Key.effects_premiumstickers.Title': 'Premium stickers effect',\n 'LiteMode.Key.effects_emoji.Title': 'Emoji effect',\n 'StickersTab.SearchPlaceholder': 'Search Stickers',\n 'ForwardedFrom': 'Forwarded from %s',\n 'Popup.Avatar.Title': 'Drag to Reposition',\n 'Popup.Unpin.AllTitle': 'Unpin all messages',\n 'Popup.Unpin.HideTitle': 'Hide pinned messages',\n 'Popup.Unpin.HideDescription': 'Do you want to hide the pinned message bar? It wil stay hidden until a new message is pinned.',\n 'Popup.Unpin.Hide': 'Hide',\n 'Popup.Attach.GroupMedia': 'Group all media',\n 'Popup.Attach.UngroupMedia': 'Ungroup all media',\n 'Popup.Attach.AsMedia': 'Send as media',\n 'Popup.Attach.EnableSpoilers': 'Hide all with spoilers',\n 'Popup.Attach.RemoveSpoilers': 'Remove all spoilers',\n 'TwoStepAuth.EmailCodeChangeEmail': 'Change Email',\n 'MarkupTooltip.LinkPlaceholder': 'Enter URL...',\n 'MediaViewer.Context.Download': 'Download',\n 'Profile': 'Profile',\n 'Saved': 'Saved',\n 'Deleted': 'Deleted',\n 'ReportBug': 'Report Bug',\n 'Notifications.Count': {\n 'one_value': '%d notification',\n 'other_value': '%d notifications'\n },\n 'Notifications.Forwarded': {\n 'one_value': 'Forwarded %d message',\n 'other_value': 'Forwarded %d messages'\n },\n 'Notifications.New': 'New notification',\n 'PushNotification.Action.Mute1d': 'Mute background alerts for 1 day',\n 'PushNotification.Action.Settings': 'Background alerts settings',\n 'PushNotification.Action.Mute1d.Mobile': 'Mute for 24H',\n 'PushNotification.Action.Settings.Mobile': 'Alerts settings',\n 'PushNotification.Message.NoPreview': 'You have a new message',\n 'LogOut.Description': 'Are you sure you want to log out?\\n\\nNote that you can seamlessly use Telegram on all your devices at once.',\n // \"PushNotification.Action.Mute1d.Success\": \"Notification settings were successfully saved.\",\n // it is from iOS\n 'VoiceChat.DiscussionGroup': 'discussion group',\n 'PaymentInfo.CVV': 'CVV Code',\n 'PaymentInfo.Card.Title': 'Enter your card information',\n 'PaymentInfo.Billing.Title': 'Enter your billing address',\n 'PaymentInfo.Done': 'PROCEED TO CHECKOUT',\n 'PaymentCard.Error.Invalid': 'Invalid card number',\n 'PaymentCard.Error.Incomplete': 'Incomplete card number',\n 'LimitReached.Ok': 'OK, GOT IT',\n 'Username.Purchase': '**This username is already taken.** However, it is currently available for purchase. [Learn more…]()',\n 'Video.Unsupported.Desktop': '__Unfortunately, this video can\\'t be played on Telegram Web. Try opening it with our [desktop app](https://getdesktop.telegram.org/) instead.__',\n 'Video.Unsupported.Mobile': '__Unfortunately, this video can\\'t be played on Telegram Web. Try opening it with our [mobile app](https://telegram.org/dl/) instead.__',\n\n // * android\n 'AccDescrEditing': 'Editing',\n 'ActionCreateChannel': 'Channel created',\n 'ActionCreateGroup': 'un1 created the group',\n 'ActionChangedTitle': 'un1 changed the group name to un2',\n 'ActionRemovedPhoto': 'un1 removed the group photo',\n 'ActionChangedPhoto': 'un1 changed the group photo',\n 'ActionChangedVideo': 'un1 changed the group video',\n 'ActionAddUser': 'un1 added un2',\n 'ActionAddUserSelf': 'un1 returned to the group',\n 'ActionAddUserSelfYou': 'You returned to the group',\n 'ActionAddUserSelfMega': 'un1 joined the group',\n 'ActionLeftUser': 'un1 left the group',\n 'ActionKickUser': 'un1 removed un2',\n 'ActionInviteUser': 'un1 joined the group via invite link',\n 'ActionPinnedNoText': 'un1 pinned a message',\n 'ActionMigrateFromGroup': 'This group was upgraded to a supergroup',\n 'ActionYouScored': 'You scored %1$s',\n 'ActionUserScored': 'un1 scored %1$s',\n 'ActionYouScoredInGame': 'You scored %1$s in un2',\n 'ActionUserScoredInGame': 'un1 scored %1$s in un2',\n 'AndOther': {\n 'one_value': 'and %1$d other',\n 'other_value': 'and %1$d others'\n },\n 'AttachPhoto': 'Photo',\n 'AttachVideo': 'Video',\n 'AttachGif': 'GIF',\n 'AttachLocation': 'Location',\n 'AttachLiveLocation': 'Live Location',\n 'AttachContact': 'Contact',\n // \"AttachDocument\": \"File\",\n 'AttachSticker': 'Sticker',\n 'AttachAudio': 'Voice message',\n 'AttachRound': 'Video message',\n 'AttachGame': 'Game',\n 'Bot': 'bot',\n // \"ChannelJoined\": \"You joined this channel\",\n 'ChannelMegaJoined': 'You joined this group',\n 'EnterChannelName': 'Channel name',\n 'DescriptionOptionalPlaceholder': 'Description (optional)',\n 'DescriptionPlaceholder': 'Description',\n 'DiscussionStarted': 'Discussion started',\n 'Draft': 'Draft',\n 'FilterAlwaysShow': 'Include Chats',\n 'FilterNeverShow': 'Exclude Chats',\n 'FilterInclude': 'Included Chats',\n 'FilterExclude': 'Excluded Chats',\n 'FilterChatTypes': 'Chat types',\n 'FilterChats': 'Chats',\n 'FilterNew': 'New Folder',\n 'Filters': 'Folders',\n 'FilterRecommended': 'Recommended Folders',\n 'FilterShowMoreChats': {\n 'one_value': 'Show %1$d More Chat',\n 'other_value': 'Show %1$d More Chats'\n },\n 'ForwardedMessageCount': {\n 'one_value': 'Forwarded message',\n 'other_value': '%1$d forwarded messages'\n },\n 'FromYou': 'You',\n 'Add': 'Add',\n 'Chats': {\n 'one_value': '%1$d chat',\n 'other_value': '%1$d chats'\n },\n 'Channels': {\n 'one_value': '%1$d channel',\n 'other_value': '%1$d channels'\n },\n 'Comments': {\n 'one_value': '%1$d Comment',\n 'other_value': '%1$d Comments'\n },\n 'Groups': {\n 'one_value': '%1$d group',\n 'other_value': '%1$d groups'\n },\n 'Users': {\n 'one_value': '%1$d user',\n 'other_value': '%1$d users'\n },\n 'Members': {\n 'one_value': '%1$d member',\n 'other_value': '%1$d members'\n },\n 'messages': {\n 'one_value': '%1$d message',\n 'other_value': '%1$d messages'\n },\n 'UsernameHelpLink': 'This link opens a chat with you:\\n%1$s',\n 'NewChannel': 'New Channel',\n 'NewGroup': 'New Group',\n 'Contacts': 'Contacts',\n 'SavedMessages': 'Saved Messages',\n 'Settings': 'Settings',\n 'SettingsHelp': 'Help',\n 'General': 'General',\n 'TextSize': 'Message Text Size',\n 'ChatBackground': 'Chat Background',\n 'EnableAnimations': 'Enable Animations',\n 'AutoDownloadMedia': 'Auto-Download Media',\n 'AutodownloadContacts': 'Contacts',\n 'AutodownloadPrivateChats': 'Private Chats',\n 'AutodownloadGroupChats': 'Group Chats',\n 'AutodownloadChannels': 'Channels',\n 'AutoplayGIF': 'GIFs',\n 'AutoplayVideo': 'Videos',\n 'NotificationsForGroups': 'Notifications for groups',\n 'NotificationsForPrivateChats': 'Notifications for private chats',\n 'NotificationsForChannels': 'Notifications for channels',\n 'NotificationsPrivateChats': 'Private Chats',\n 'NotificationsGroups': 'Groups',\n 'NotificationsChannels': 'Channels',\n 'NotificationsOther': 'Other',\n 'MarkAsUnread': 'Mark as unread',\n 'MarkAsRead': 'Mark as read',\n 'ContactJoined': 'Contact joined Telegram',\n 'Loading': 'Loading...',\n 'Unblock': 'Unblock',\n 'BlockedUsers': 'Blocked Users',\n 'BlockedUsersInfo': 'Blocked users will not be able to contact you and will not see your Last Seen time.',\n 'BlockedEmpty': 'None',\n 'TwoStepVerification': 'Two-Step Verification',\n 'TwoStepVerificationTitle': 'Two-Step Verification',\n 'PinnedMessage': 'Pinned Message',\n 'PinnedMessagesCount': {\n 'one_value': 'Pinned Message',\n 'other_value': '%1$d Pinned Messages'\n },\n // \"PreviousPinnedMessage\": \"Previous Message\",\n 'PrivacyExceptions': 'Exceptions',\n 'PrivacyLastSeen': 'Last Seen & Online',\n 'PrivacySettings': 'Privacy and Security',\n 'PrivacyTitle': 'Privacy',\n 'PrivacyPhone': 'Phone Number',\n 'PrivacyPhoneTitle': 'Who can see my phone number?',\n 'PrivacyPhoneTitle2': 'Who can find me by my number?',\n 'PrivacyPhoneInfo': 'Users who have your number saved in their contacts will also see it on Telegram.',\n 'PrivacyPhoneInfo3': 'Users who add your number to their contacts will see it on Telegram only if they are your contacts.',\n 'PrivacyProfilePhoto': 'Profile Photos',\n 'PrivacyProfilePhotoTitle': 'Who can see my profile photos & videos?',\n 'PrivacyP2PHeader': 'Peer-to-Peer',\n 'PrivacyForwardsTitle': 'Who can add a link to my account when forwarding my messages?',\n 'Reminders': 'Reminders',\n 'ScheduledMessages': 'Scheduled Messages',\n 'LastSeenTitle': 'Who can see your Last Seen time?',\n 'SessionsTitle': 'Active Sessions',\n 'CurrentSession': 'This device',\n 'TerminateAllSessions': 'Terminate All Other Sessions',\n 'TerminateSessionText': 'Are you sure you want to terminate this session?',\n 'OtherSessions': 'Active sessions',\n 'AreYouSureDeleteSingleMessage': 'Are you sure you want to delete this message?',\n 'AreYouSureDeleteFewMessages': 'Are you sure you want to delete these messages?',\n 'AreYouSureDeleteSingleMessageMega': 'Are you sure you want to delete this message for everyone?',\n 'AreYouSureDeleteFewMessagesMega': 'Are you sure you want to delete these messages for everyone?',\n 'AreYouSureDeleteAndExitName': 'Are you sure you want to delete and leave the group **%1$s**?',\n 'AreYouSureDeleteThisChatSavedMessages': 'Are you sure you want to delete **Saved Messages**?',\n 'AreYouSureDeleteThisChatWithUser': 'Are you sure you want to delete the chat with **%1$s**?',\n 'AreYouSureSessionTitle': 'Terminate session',\n 'AreYouSureSessionsTitle': 'Terminate sessions',\n 'AreYouSureSessions': 'Are you sure you want to terminate all other sessions?',\n 'Terminate': 'Terminate',\n 'WhoCanCallMe': 'Who can call me?',\n 'WhoCanAddMe': 'Who can add me to group chats?',\n 'ArchivedChats': 'Archived Chats',\n 'Cancel': 'Cancel',\n 'HistoryCleared': 'History was cleared',\n 'Archive': 'Archive',\n 'Unarchive': 'Unarchive',\n 'Delete': 'Delete',\n 'Reply': 'Reply',\n 'Edit': 'Edit',\n 'Forward': 'Forward',\n 'CopyLink': 'Copy Link',\n 'Copy': 'Copy',\n 'Search': 'Search',\n 'LinkCopied': 'Link copied to clipboard',\n 'LinkCopiedPrivateInfo': 'This link will only work for members of this chat.',\n 'GroupAddMembers': 'Add Members',\n 'SendMessageTo': 'Add people...',\n // \"SelectChat\": \"Select Chat\",\n 'JumpToDate': 'Jump to Date',\n 'Caption': 'Caption',\n 'Message': 'Message',\n 'Poll': 'Poll',\n 'SharedFilesTab2': 'Files',\n 'SharedMediaTab2': 'Media',\n // \"SharedMediaTabFull2\": \"Shared Media\",\n // \"SharedGroupsTab2\": \"Groups\",\n 'SharedLinksTab2': 'Links',\n 'SharedMusicTab2': 'Music',\n 'SharedVoiceTab2': 'Voice',\n // \"SharedGIFsTab2\": \"GIFs\",\n 'NewPoll': 'New Poll',\n 'PollOptions': 'Poll options',\n 'AskAQuestion': 'Ask a Question',\n 'AddAnExplanationInfo': 'Users will see this text after choosing the wrong answer, good for educational purposes.',\n 'AccDescrQuizExplanation': 'Explanation',\n 'PhoneCopied': 'Phone copied to clipboard',\n 'UsernameCopied': 'Username copied to clipboard.',\n // \"HashtagCopied\": \"Hashtag copied to clipboard.\",\n 'BioCopied': 'Bio copied to clipboard.',\n 'UserBio': 'Bio',\n 'Username': 'Username',\n 'UsernameAlso': 'also %1$s',\n 'UsernameHelp': 'You can choose a username on **Telegram**. If you do, people will be able to find you by this username and contact you without needing your phone number.\\n\\nYou can use **a–z**, **0–9** and underscores. Minimum length is **5** characters.',\n 'Phone': 'Phone',\n 'Notifications': 'Notifications',\n 'AreYouSureDeleteContact': 'Are you sure you want to delete this contact?',\n 'AreYouSureDeleteAndExit': 'Are you sure you want to delete and leave the group?',\n 'AreYouSureDeleteAndExitChannel': 'Do you want to delete and leave the channel?',\n 'DeleteContact': 'Delete contact',\n 'GroupType': 'Group Type',\n 'ChannelType': 'Channel Type',\n 'TypePrivate': 'Private',\n 'TypePublic': 'Public',\n 'TypePrivateGroup': 'Private',\n 'TypePublicGroup': 'Public',\n 'GroupMembers': 'Members',\n 'DeleteMega': 'Delete Group',\n 'DeleteMegaMenu': 'Delete group',\n 'DeleteAndExitButton': 'Delete and Leave Group',\n 'ChannelDelete': 'Delete Channel',\n 'ChannelDeleteMenu': 'Delete channel',\n 'ChannelPermissions': 'Permissions',\n 'ChannelPermissionsHeader': 'What can members of this group do?',\n 'ChannelAddException': 'Add Exception',\n 'ChannelBlockedUsers': 'Removed users',\n 'NoBlockedUsers': 'No removed users',\n 'UserRestrictions': 'User Permissions',\n 'UserRestrictionsDisabled': 'This option is disabled for all members in Group Permissions',\n 'UserRestrictionsCanDo': 'What can this user do?',\n 'UserRestrictionsRead': 'Read Messages',\n 'UserRestrictionsSend': 'Send Messages',\n 'UserRestrictionsSendMedia': 'Send Media',\n 'UserRestrictionsSendPolls': 'Send Polls',\n 'UserRestrictionsSendStickers': 'Send Stickers and GIFs',\n 'UserRestrictionsSendPhotos': 'Send Photos',\n 'UserRestrictionsSendVideos': 'Send Videos',\n 'UserRestrictionsSendMusic': 'Send Music',\n 'UserRestrictionsSendFiles': 'Send Files',\n 'UserRestrictionsSendVoices': 'Send Voice Messages',\n 'UserRestrictionsSendRound': 'Send Video Messages',\n 'UserRestrictionsEmbedLinks': 'Embed Links',\n 'UserRestrictionsChangeInfo': 'Change Chat Info',\n 'UserRestrictionsPinMessages': 'Pin Messages',\n 'UserRestrictionsInviteUsers': 'Add Users',\n // \"UserRestrictionsNoRead\": \"can't read\",\n 'UserRestrictionsNoSend': 'can\\'t send messages',\n 'UserRestrictionsNoSendMedia': 'no media',\n 'UserRestrictionsNoSendPolls': 'no polls',\n 'UserRestrictionsNoSendStickers': 'no stickers & GIFs',\n 'UserRestrictionsNoSendPhotos': 'no photos',\n 'UserRestrictionsNoSendVideos': 'no videos',\n 'UserRestrictionsNoSendMusic': 'no music',\n 'UserRestrictionsNoSendDocs': 'no files',\n 'UserRestrictionsNoSendVoice': 'no voice',\n 'UserRestrictionsNoSendRound': 'no round',\n 'UserRestrictionsNoEmbedLinks': 'no embed links',\n 'UserRestrictionsNoChangeInfo': 'can\\'t change Info',\n 'UserRestrictionsNoPinMessages': 'no pins',\n 'UserRestrictionsNoInviteUsers': 'can\\'t add users',\n 'UserRestrictionsBlock': 'Ban and remove from group',\n 'ChannelPublic': 'Public Channel',\n 'MegaPublic': 'Public Group',\n // \"MegaLocation\": \"Location-based Group\",\n 'ChannelPublicInfo': 'Public channels can be found in search, anyone can join them.',\n 'MegaPublicInfo': 'Public groups can be found in search, chat history is available to everyone and anyone can join.',\n 'ChannelPrivate': 'Private Channel',\n 'MegaPrivate': 'Private Group',\n 'ChannelPrivateInfo': 'Private channels can only be joined via an invite link.',\n 'MegaPrivateInfo': 'Private groups can only be joined if you were invited or have an invite link.',\n 'ChannelPrivateLinkHelp': 'People can join your channel by following this link. You can revoke the link any time.',\n 'MegaPrivateLinkHelp': 'People can join your group by following this link. You can revoke the link any time.',\n 'RevokeButton': 'Revoke',\n 'RevokeLink': 'Revoke Link',\n 'RevokeAlert': 'Are you sure you want to revoke this link? Once the link is revoked, no one will be able to join using it.',\n 'SetUrlPlaceholder': 'Link',\n 'Subscribers': {\n 'one_value': '%1$d subscriber',\n 'other_value': '%1$d subscribers'\n },\n 'SearchGifsTitle': 'Search GIFs',\n 'PinMessageAlert': 'Pin this message in the group?',\n 'PinMessageAlertTitle': 'Pin message',\n 'PinMessageAlertChannel': 'Do you want to pin this message in this channel?',\n 'PinMessageAlertChat': 'Do you want to pin this message at the top of the chat?',\n 'UnpinMessageAlertTitle': 'Unpin message',\n 'UnpinMessageAlert': 'Do you want to unpin this message?',\n 'PinNotify': 'Notify all members',\n 'PinMessage': 'Pin',\n 'UnpinMessage': 'Unpin',\n 'PinAlsoFor': 'Also pin for %1$s',\n 'DeleteMessagesTitle': 'Delete %1$s',\n 'DeleteSingleMessagesTitle': 'Delete message',\n 'DeleteMessagesOption': 'Unsend My Messages',\n 'DeleteMessagesOptionAlso': 'Also delete for %1$s',\n 'DeleteForAll': 'Delete for all members',\n 'DeleteMessagesTextGroup': 'You can also delete the %1$s you sent from the inboxes of other group members by checking \"Unsend my messages\".',\n 'LeaveChannel': 'Leave Channel',\n 'LeaveChannelMenu': 'Leave channel',\n 'ChannelLeaveAlertWithName': 'Are you sure you want to leave **%1$s**?',\n 'LeaveMegaMenu': 'Leave group',\n 'DeleteChatUser': 'Delete chat',\n 'PleaseEnterCurrentPassword': 'Enter your password',\n 'PleaseEnterFirstPassword': 'Enter a password',\n 'PleaseReEnterPassword': 'Re-enter your password',\n 'Continue': 'Continue',\n 'YourEmailSkip': 'Skip',\n 'YourEmailSkipWarning': 'Warning',\n 'YourEmailSkipWarningText': 'No, seriously.\\n\\nIf you forget your password, you will lose access to your Telegram account. There will be no way to restore it.',\n 'TurnPasswordOffQuestionTitle': 'Disable password',\n 'TurnPasswordOffQuestion': 'Are you sure you want to disable your password?',\n 'Disable': 'Disable',\n 'TwoStepVerificationSetPassword': 'Set Password',\n 'TwoStepVerificationPasswordSet': 'Password Set!',\n 'TwoStepVerificationPasswordSetInfo': 'This password will be required when you log in on a new device in addition to the code you get in the SMS.',\n 'TwoStepVerificationPasswordReturnSettings': 'Return to Settings',\n 'RecoveryEmail': 'Recovery email',\n 'RecoveryEmailTitle': 'Recovery Email',\n 'ResendCode': 'Resend code',\n 'PasswordAsHintError': 'Hint must be different from your password',\n 'AddStickersCount': 'ADD %1$s',\n 'RemoveStickersCount': 'REMOVE %1$s',\n 'Stickers': {\n 'one_value': '%1$d sticker',\n 'other_value': '%1$d stickers'\n },\n 'HidAccount': 'The account was hidden by the user',\n 'TelegramFeatures': 'Telegram Features',\n 'SetColor': 'Set a color',\n 'Open': 'Open',\n 'OpenUrlTitle': 'Open Link',\n 'OpenUrlAlert2': 'Do you want to open %1$s?',\n 'FilterNoChatsToDisplay': 'Folder is empty',\n 'FilterNoChatsToDisplayInfo': 'No chats currently belong to this folder.',\n 'SupportStatus': 'support',\n 'Lately': 'last seen recently',\n 'WithinAWeek': 'last seen within a week',\n 'WithinAMonth': 'last seen within a month',\n 'ALongTimeAgo': 'last seen a long time ago',\n 'Online': 'online',\n 'MessageScheduleSend': 'Send Now',\n 'MessageScheduleEditTime': 'Reschedule',\n 'YouLeft': 'You left this group',\n 'Recent': 'Recent',\n 'Of': '%1$d of %2$d',\n 'NoResult': 'No results',\n 'Updating': 'Updating...',\n 'Emoji': 'Emoji',\n 'AddContactTitle': 'Add Contact',\n 'HiddenName': 'Deleted Account',\n 'Seconds': {\n 'one_value': '%1$d second',\n 'other_value': '%1$d seconds'\n },\n 'Minutes': {\n 'one_value': '%1$d minute',\n 'other_value': '%1$d minutes'\n },\n 'Hours': {\n 'one_value': '%1$d hour',\n 'other_value': '%1$d hours'\n },\n 'Days': {\n 'one_value': '%1$d day',\n 'other_value': '%1$d days'\n },\n 'Weeks': {\n 'one_value': '%1$d week',\n 'other_value': '%1$d weeks'\n },\n 'Months': {\n 'one_value': '%1$d month',\n 'other_value': '%1$d months'\n },\n 'Years': {\n 'one_value': '%1$d year',\n 'other_value': '%1$d years'\n },\n 'TodayAtFormattedWithToday': 'today at %1$s',\n 'formatDateAtTime': '%1$s at %2$s',\n 'JoinByPeekChannelTitle': 'Join Channel',\n 'JoinByPeekGroupTitle': 'Join Group',\n 'YouWereKicked': 'you were removed',\n 'ViaBot': 'via',\n 'InviteExpired': 'This invite link has expired.',\n 'NoUsernameFound': 'There is no Telegram account with this username.',\n 'PrivacyDeleteCloudDrafts': 'Delete All Cloud Drafts',\n 'AreYouSureClearDraftsTitle': 'Delete cloud drafts',\n 'AreYouSureClearDrafts': 'Are you sure you want to delete all cloud drafts?',\n 'BotInfoTitle': 'What can this bot do?',\n 'ChatYourSelf': 'forward here to save',\n 'GroupEmptyTitle1': 'You have created a **group**.',\n 'GroupEmptyTitle2': 'Groups can have:',\n 'GroupDescription1': 'Up to 200,000 members',\n 'GroupDescription2': 'Persistent chat history',\n 'GroupDescription3': 'Public links such as t.me/title',\n 'GroupDescription4': 'Admins with different rights',\n 'ChatYourSelfDescription1': 'Forward messages here to save them',\n 'ChatYourSelfDescription2': 'Send media and files to store them',\n 'ChatYourSelfDescription3': 'Access this chat from any device',\n 'ChatYourSelfDescription4': 'Use search to quickly find things',\n 'ChatYourSelfTitle': 'Your cloud storage',\n 'ActionYouCreateGroup': 'You created the group',\n 'NoMessages': 'No messages here yet...',\n 'NoScheduledMessages': 'No scheduled messages here yet...',\n 'NoMessagesGreetingsDescription': 'Send a message or tap the greeting below.',\n 'InviteToGroupError': 'Sorry, you can\\'t add this user to groups because of user\\'s privacy settings.',\n 'InviteToChannelError': 'Sorry, you can\\'t add this user to channels because of user\\'s privacy settings.',\n 'AddMembersAlertTitle': 'Add %1$s',\n 'AddOneMemberAlertTitle': 'Add member',\n 'AddMembersAlertNamesText': 'Are you sure you want to add %1$s to **%2$s**?',\n 'AddMembersAlertCountText': 'Are you sure you want to add %1$s to **%2$s**?',\n 'AddMembersForwardMessages': 'Show the last 100 messages to the new members',\n 'AddOneMemberForwardMessages': 'Show the last 100 messages to **%1$s**',\n 'PinToTopLimitReached2': 'Sorry, you can only pin %1$s to the top in the main list. More chats can be pinned in Chat Folders and your Archive.',\n 'FiltersSetupPinAlert': 'Set Up Folders',\n 'AppName': 'Telegram',\n 'OK': 'OK',\n 'PinFolderLimitReached': 'Sorry, you can\\'t pin any more chats to the top.',\n 'Send': 'Send',\n 'ChannelJoin': 'JOIN',\n 'Yesterday': 'yesterday',\n 'LeaveAComment': 'Leave a comment',\n 'ViewInChat': 'View in chat',\n 'LinkNotFound': 'Unfortunately, you can\\'t access this message. You are not a member of the chat where it was posted.',\n 'Create': 'Create',\n 'ViewDiscussion': 'View discussion',\n 'MessageScheduledUntilOnline': 'Scheduled until online',\n 'ReportChat': 'Report',\n 'ReportChatSpam': 'Spam',\n // \"ReportChatFakeAccount\": \"Fake Account\",\n 'ReportChatViolence': 'Violence',\n 'ReportChatPornography': 'Pornography',\n 'ReportChatChild': 'Child Abuse',\n 'ReportChatOther': 'Other',\n 'ReportChatDescription': 'Description',\n 'ReportInfo': 'Please enter any additional details relevant to your report.',\n 'ReportSentInfo': 'Telegram moderators will review your report.\\nThank you for your cooperation!',\n 'ReportHint': 'Additional details...',\n 'ChatHistory': 'Chat history for new members',\n 'ShareContact': 'Share contact',\n 'SendMessageTitle': 'Send message',\n 'SendContactToGroupText': 'Do you want to send this contact to **%1$s**?',\n 'ChannelBroadcast': 'Broadcast',\n 'ChannelSilentBroadcast': 'Silent Broadcast',\n 'Comment': 'Comment',\n 'SendAnonymously': 'Send anonymously',\n 'DiscardVoiceMessageTitle': 'Discard Voice Message',\n 'DiscardVoiceMessageDescription': 'Are you sure you want to stop recording and discard your voice message?',\n 'DiscardVoiceMessageAction': 'Discard',\n 'AddContact': 'Add to contacts',\n 'BlockUser': 'Block user',\n 'MobileHidden': 'Mobile hidden',\n 'MobileHiddenExceptionInfo': 'Phone number will be visible once %1$s adds you as a contact.',\n 'FirstName': 'First name (required)',\n 'LastName': 'Last name (optional)',\n 'AreYouSureBlockContact2': 'Are you sure you want to block **%1$s**?',\n 'UserBlocked': 'User blocked',\n 'UserUnblocked': 'User unblocked',\n 'AudioUnknownArtist': 'Unknown artist',\n 'AudioUnknownTitle': 'Unknown title',\n 'LogOut': 'Log out',\n 'OnlineCount': {\n 'one_value': '%1$d online',\n 'other_value': '%1$d online'\n },\n 'EditedMessage': 'edited',\n 'GlobalSearch': 'Global search',\n 'SearchMessages': 'Messages',\n 'SearchAllChatsShort': 'Chats',\n 'ClearButton': 'Clear',\n 'FilterAllChats': 'All Chats',\n 'FilterAllChatsShort': 'All',\n 'Call': 'Call',\n 'VideoCall': 'Video Call',\n 'CallMessageOutgoing': 'Outgoing Call',\n 'CallMessageIncoming': 'Incoming Call',\n 'CallMessageVideoOutgoing': 'Outgoing Video Call',\n 'CallMessageVideoIncoming': 'Incoming Video Call',\n 'VoipExchangingKeys': 'Exchanging encryption keys',\n 'VoipUnmute': 'Unmute',\n 'SavingContentTitle': 'Saving content',\n 'RestrictSavingContent': 'Restrict saving content',\n 'RestrictSavingContentInfoGroup': 'Members won\\'t be able to copy, save and forward content from this group.',\n 'RestrictSavingContentInfoChannel': 'Subscribers won\\'t be able to copy, save and forward content from this channel.',\n 'ClearOtherSessionsHelp': 'Logs out all devices except for this one.',\n 'SessionsListInfo': 'The official Telegram app is available for Android, iPhone, iPad, Windows, macOS and Linux.',\n 'SponsoredMessage': 'sponsored',\n 'OpenChannelPost': 'VIEW POST',\n 'FilterNameHint': 'Folder name',\n 'BotStart': 'START',\n 'BotUnblock': 'RESTART',\n 'BotStop': 'Stop bot',\n 'BotRestart': 'Restart bot',\n 'ShareYouPhoneNumberTitle': 'Share your phone number?',\n 'AreYouSureShareMyContactInfoBot': 'The bot will know your phone number. This can be useful for integration with other services.',\n 'DistanceUnitsTitle': 'Distance units',\n 'DistanceUnitsKilometers': 'Kilometers',\n 'DistanceUnitsMiles': 'Miles',\n 'PeopleNearby': 'People Nearby',\n 'MakeMyselfVisible': 'Make Myself Visible',\n 'MakeMyselfVisibleTitle': 'Show Your Profile?',\n 'MakeMyselfVisibleInfo': 'Users nearby will be able to view your profile and send you messages. This may help you find new friends, but could also attract excessive attention. You can stop sharing your profile at any time.\\n\\nYour phone number will remain hidden.',\n 'StopShowingMe': 'Stop Showing Me',\n 'PeopleNearbyInfo2': 'Exchange contact info with people nearby and find new friends.',\n 'NearbyCreateGroup': 'Create a Local group',\n 'AwayTo': '%1$s away',\n 'MessagePreview': 'Message Preview',\n 'KMetersAway2': '%1$s km away',\n 'MetersAway2': '%1$s m away',\n 'MilesAway': '%1$s mi away',\n 'FootsAway': '%1$s ft away',\n 'PeopleNearbyHeader': 'People nearby',\n 'ChatsNearbyHeader': 'Groups nearby',\n 'ChatLocation': 'Location',\n 'RequestToJoinGroupDescription': 'This group accepts new members only after they are approved by its admins.',\n 'RequestToJoinChannelDescription': 'This channel accepts new subscribers only after they are approved by its admins.',\n 'RequestToJoinSent': 'Join request sent',\n 'RequestToJoinGroupApproved': 'Your request to join the group was approved',\n 'RequestToJoinChannelApproved': 'Your request to join the channel was approved',\n 'Update': 'UPDATE',\n 'Reactions': 'Reactions',\n 'DoubleTapSetting': 'Quick Reaction',\n 'EnableReactions': 'Enable Reactions',\n 'EnableReactionsChannelInfo': 'Allow subscribers to react to channel posts.',\n 'EnableReactionsGroupInfo': 'Allow members to react to group messages.',\n 'AvailableReactions': 'Available reactions',\n 'NobodyViewed': 'Nobody viewed',\n 'MessageSeen': {\n 'one_value': 'Seen',\n 'other_value': '%1$d Seen'\n },\n // \"Close\": \"Close\",\n 'DataSettings': 'Data and Storage',\n 'GroupsAndChannelsHelp': 'Change who can add you to groups and channels.',\n 'SessionsInfo': 'Control your sessions on other devices.',\n 'StickersBotInfo': 'Artists are welcome to add their own sticker sets using our @stickers bot.',\n 'AutomaticMediaDownload': 'Automatic media download',\n 'AutoDownloadPhotos': 'Photos',\n 'AutoDownloadVideos': 'Videos',\n 'AutoDownloadFiles': 'Files',\n 'AutoDownloadOnAllChats': 'On in all chats',\n 'AutoDownloadUpToOnAllChats': 'Up to %1$s in all chats',\n 'AutoDownloadOff': 'Off',\n 'AutoDownloadOnUpToFor': 'Up to %1$s for %2$s',\n 'AutoDownloadOnFor': 'On for %1$s',\n 'AutoDownloadContacts': 'Contacts',\n 'AutoDownloadPm': 'PM',\n 'AutoDownloadGroups': 'Groups',\n 'AutoDownloadChannels': 'Channels',\n 'AutoDownloadAudioInfo': 'Voice messages are tiny, so they\\'re always downloaded automatically.',\n 'AutoplayMedia': 'Auto-play media',\n 'AutoDownloadPhotosTitle': 'Auto-download photos',\n 'AutoDownloadVideosTitle': 'Auto-download videos and GIFs',\n 'AutoDownloadFilesTitle': 'Auto-download files and music',\n 'AutoDownloadMaxFileSize': 'Maximum file size',\n 'AutodownloadSizeLimitUpTo': 'up to %1$s',\n 'ResetAutomaticMediaDownload': 'Reset Auto-Download Settings',\n 'ResetAutomaticMediaDownloadAlertTitle': 'Reset settings',\n 'ResetAutomaticMediaDownloadAlert': 'Are you sure you want to reset auto-download settings?',\n 'Reset': 'Reset',\n 'SendMessageAsTitle': 'Send message as...',\n 'Devices': 'Devices',\n 'LanguageName': 'English',\n 'EditCantEditPermissionsPublic': 'This permission is not available in public groups.',\n 'VoipUserMicrophoneIsOff': '%s\\'s microphone is off',\n 'VoipUserCameraIsOff': '%s\\'s camera is off',\n 'PrivacyPhoneInfo4': 'This public link opens a chat with you:',\n 'ReportChatIllegalDrugs': 'Illegal Drugs',\n 'ReportChatPersonalDetails': 'Personal Details',\n 'VoipPeerIncompatible': '**%1$s**\\'s app is using an incompatible protocol. They need to update their app before you can call them.',\n 'TelegramFeaturesUrl': 'https://t.me/TelegramTips',\n 'ScamMessage': 'SCAM',\n 'FakeMessage': 'FAKE',\n 'TextCopied': 'Text copied to clipboard',\n 'PaymentInvoice': 'INVOICE',\n 'PaymentTestInvoice': 'TEST INVOICE',\n 'PaymentReceipt': 'Receipt',\n 'PaymentCheckout': 'Checkout',\n 'PaymentTransactionTotal': 'Total',\n 'PaymentTip': 'Tip',\n 'PaymentTipOptional': 'Tip (Optional)',\n 'PaymentCheckoutPay': 'PAY %1$s',\n 'PaymentCheckoutMethod': 'Payment method',\n 'PaymentCheckoutProvider': 'Payment provider',\n 'PaymentCardNumber': 'Card Number',\n 'PaymentCardSavePaymentInformation': 'Save Payment Information',\n 'PaymentCardInfo': 'Payment info',\n 'PaymentCardSavePaymentInformationInfoLine1': 'You can save your payment info for future use. It will be stored directly with the payment provider. Telegram has no access to your credit card data.',\n 'Done': 'Done',\n 'PaymentShippingMethod': 'Shipping methods',\n 'PaymentNoShippingMethod': 'Sorry, it is not possible to deliver to your address.',\n 'PaymentShippingInfo': 'Shipping Information',\n 'PaymentShippingAddress': 'Shipping address',\n 'PaymentShippingAddress1Placeholder': 'Address 1 (Street)',\n 'PaymentShippingAddress2Placeholder': 'Address 2 (Street)',\n 'PaymentShippingCityPlaceholder': 'City',\n 'PaymentShippingStatePlaceholder': 'State',\n 'PaymentShippingCountry': 'Country',\n 'PaymentShippingZipPlaceholder': 'Postcode',\n 'PaymentShippingReceiver': 'Receiver',\n 'PaymentShippingName': 'Full Name',\n 'PaymentShippingEmailPlaceholder': 'Email',\n 'PaymentCheckoutPhoneNumber': 'Phone number',\n 'PaymentCheckoutShippingMethod': 'Shipping method',\n 'PaymentShippingSave': 'Save Shipping Information',\n 'PaymentShippingSaveInfo': 'You can save your shipping info for future use.',\n 'PaymentInfoHint': 'You paid **%1$s** for **%2$s**.',\n 'PrivacyPayments': 'Payments',\n 'PrivacyPaymentsClearInfo': 'You can delete your shipping info and instruct all payment providers to remove your saved credit cards. Note that Telegram never stores your credit card data.',\n 'PrivacyPaymentsClear': 'Clear Payment and Shipping Info',\n 'PrivacyPaymentsClearAlertTitle': 'Clear payment info',\n 'PrivacyPaymentsClearAlertText': 'Are you sure you want to clear your payment and shipping info?',\n 'PrivacyPaymentsPaymentInfoCleared': 'Payment info cleared.',\n 'PrivacyPaymentsShippingInfoCleared': 'Shipping info cleared.',\n 'PrivacyPaymentsPaymentShippingCleared': 'Payment and shipping info cleared.',\n 'PrivacyClearShipping': 'Shipping info',\n 'PrivacyClearPayment': 'Payment info',\n 'Clear': 'Clear',\n 'Save': 'Save',\n 'PaymentCheckoutName': 'Name',\n 'ClearRecentStickersAlertTitle': 'Clear recent stickers',\n 'ClearRecentStickersAlertMessage': 'Do you want to clear all your recent stickers?',\n 'PremiumStickersShort': 'Premium',\n 'FavoriteStickers': 'Favorites',\n 'AddToFavorites': 'Add to Favorites',\n 'AddedToFavorites': 'Sticker added to Favorites.',\n 'RemovedFromFavorites': 'Sticker was removed from Favorites',\n 'RemovedFromRecent': 'Sticker was removed from Recent',\n 'DeleteFromFavorites': 'Delete from Favorites',\n 'DeleteFromRecent': 'Remove from Recent',\n 'NewChatsFromNonContacts': 'New chats from unknown users',\n 'ArchiveAndMute': 'Archive and Mute',\n 'ArchiveAndMuteInfo': 'Automatically archive and mute new chats, groups and channels from non-contacts.',\n 'PrivacyVoiceMessages': 'Voice Messages',\n 'PrivacyVoiceMessagesTitle': 'Who can send me voice or video messages?',\n 'PrivacyVoiceMessagesInfo': 'You can restrict who can send you voice or video messages with granular precision.',\n 'PrivacyVoiceMessagesPremiumOnly': 'Only subscribers of *Telegram Premium* can restrict receiving voice messages.',\n 'EmojiCount': {\n 'other_value': '%1$d emoji'\n },\n 'AddEmojiNotFound': 'Emoji pack not found.',\n 'MessageContainsEmojiPack': 'This message contains emoji from %s pack.',\n 'MessageContainsEmojiPacks': {\n 'other_value': 'This message contains emoji from **%d Packs**.'\n },\n 'EmojiPackCount': {\n 'one_value': '%1$d Emoji Pack',\n 'other_value': '%1$d Emoji Packs'\n },\n 'ReactionsAll': 'All',\n 'EnableSomeReactionsInfo': 'Members of the group can use only certain approved emoji as reactions to messages.',\n 'EnableAllReactionsInfo': 'Members of the group can use any emoji as reactions to messages.',\n 'DisableReactionsInfo': 'Members of the group can’t add any reactions to messages.',\n 'OnlyAllowThisReactions': 'Only allow these reactions',\n 'AllReactions': 'All reactions',\n 'SomeReactions': 'Some reactions',\n 'NoReactions': 'No reactions',\n 'LimitReached': 'Limit Reached',\n 'LimitReachedPinDialogs': 'You can\\'t pin more than %1$d chats to the top. Unpin some that are currently pinned – or subscribe to **Telegram Premium** to double the limit to **%2$d** chats.',\n 'LimitReachedPinDialogsPremium': 'Sorry, you can\\'t pin more than %1$d chats to the top. Unpin some that are currently pinned.',\n 'LimitReachedPinDialogsLocked': 'Sorry, you can\\'t pin more than %1$d chats to the top. Unpin some that are currently pinned. We are working to let you increase this limit in the future.',\n 'IncreaseLimit': 'Increase Limit',\n 'LimitFree': 'Free',\n 'LimitPremium': 'Premium',\n 'ActionTTLChanged': 'un1 set messages to auto-delete in %1$s',\n 'ActionTTLYouChanged': 'You set messages to auto-delete in %1$s',\n 'ActionTTLChannelChanged': 'Messages in this channel will be automatically deleted after %1$s',\n 'ActionTTLChannelDisabled': 'Messages in this channel will no longer be automatically deleted',\n 'ActionTTLDisabled': 'un1 disabled the auto-delete timer',\n 'ActionTTLYouDisabled': 'You disabled the auto-delete timer',\n 'UsernamesProfileHeader': 'Username order',\n 'UsernamesProfileHelp': 'Drag and drop links to change the order in which they will be displayed on your info page.',\n 'UsernamesChannelHelp': 'Drag and drop links to change the order in which they will be displayed on the channel info page.',\n 'UsernameLinkEditable': 'tap to edit',\n 'UsernameLinkActive': 'active',\n 'UsernameLinkInactive': 'not active',\n 'UsernameActivateLink': 'Activate link',\n 'UsernameDeactivateLink': 'Deactivate link',\n 'UsernameActivateLinkProfileMessage': 'Do you want to show this link on your info page?',\n 'UsernameDeactivateLinkProfileMessage': 'Do you want to hide this link from your info page?',\n 'UsernameActivateLinkChannelMessage': 'Do you want to show this link on the channel info page?',\n 'UsernameDeactivateLinkChannelMessage': 'Do you want to hide this link from the channel info page?',\n 'Hide': 'Hide',\n 'Show': 'Show',\n 'UsernameActivateErrorTitle': 'Too many active links',\n 'UsernameActivateErrorMessage': 'Sorry, you have too many active public links already. Please hide one of your active public links first.',\n 'ChannelSignMessages': 'Sign Messages',\n // 'ChannelSignMessagesInfo': 'Add names of admins to the messages they post',\n 'TopicWasCreatedAction': '%s was created',\n 'Topics': 'Topics',\n 'ForumToggleDescription': 'The group chat will be divided into topics created by admins or users.',\n 'AnonymousNumber': 'Anonymous Number',\n 'Info': 'Info',\n 'BotSettings': 'Settings',\n 'OpenMessage': 'VIEW MESSAGE',\n 'OpenGroup': 'VIEW GROUP',\n 'CloseTopic': 'Close topic',\n 'RestartTopic': 'Reopen topic',\n 'LimitReachedPinnedTopics': 'Sorry, you can\\'t pin more than %d topics to the top.',\n 'TopicProfileStatus': 'In %s',\n 'AccDescrTopic': 'Topic',\n 'DeleteTopics': {\n 'one_value': 'Delete topic',\n 'other_value': 'Delete topics'\n },\n 'DeleteSelectedTopic': 'Are you sure you want delete %s?',\n 'NewTopic': 'New Topic',\n 'CreateTopicTitle': 'Choose a topic name and icon',\n 'CreateGeneralTopicTitle': 'Choose topic name',\n 'EditTopicHide': 'Show in Topics',\n 'EditTopicHideInfo': 'If the \\'General\\' topic is hidden, group members can pull down in the topic list to view it.',\n 'OpenUrlOption1': 'Log in to %1$s as **%2$s**',\n 'OpenUrlOption2': 'Allow **%1$s** to send me messages',\n 'OtherWebSessions': 'Connected websites',\n 'WebSessionsTitle': 'Logged In with Telegram',\n 'TerminateWebSessionText': 'Are you sure you want to disconnect %1$s?',\n 'Disconnect': 'Disconnect',\n 'TerminateAllWebSessions': 'Disconnect All Websites',\n 'AreYouSureWebSessions': 'Are you sure you want to disconnect all websites where you logged in with Telegram?',\n 'ClearOtherWebSessionsHelp': 'You can log in on websites that support signing in with Telegram.',\n 'TerminateWebSessionInfo': 'Tap to disconnect from your Telegram account.',\n 'EnablePhotoSpoiler': 'Hide with spoiler',\n 'DisablePhotoSpoiler': 'Remove spoiler',\n 'LimitReachedFolders': 'You have reached the limit of **%1$d** folders. You can double the limit to **%2$d** folders by subscribing to **Telegram Premium**.',\n 'LimitReachedFoldersPremium': 'You have reached the limit of **%1$d** folders for this account.',\n 'LimitReachedFoldersLocked': 'You have reached the limit of **%1$d** folders for this account. We are working to let you increase this limit in the future.',\n 'FwdMessageToSavedMessages': 'Message forwarded to **Saved Messages**.',\n 'FwdMessagesToSavedMessages': 'Messages forwarded to **Saved Messages**.',\n 'ColorTheme': 'Color theme',\n 'SendAsFile': 'Send as file',\n 'SendAsFiles': 'Send as files',\n 'ChatThemeChangedYou': 'You changed the chat theme to %1$s',\n 'ChatThemeChangedTo': '%1$s changed the chat theme to %2$s',\n 'ChatThemeDisabled': '%1$s disabled the chat theme',\n 'ChatThemeDisabledYou': 'You disabled the chat theme',\n 'ThemeDay': 'Day',\n 'ThemeNight': 'Night',\n 'AutoNightSystemDefault': 'System Default',\n 'GlobalAttachPlainRestricted': 'Sending text messages isn\\'t allowed in this group.',\n 'GlobalAttachDocumentsRestricted': 'Sending documents isn\\'t allowed in this group.',\n 'GlobalAttachMediaRestricted': 'Sending media isn\\'t allowed in this group.',\n 'GlobalAttachAudioRestricted': 'Sending music isn\\'t allowed in this group.',\n 'GlobalAttachPhotoRestricted': 'Sending photos isn\\'t allowed in this group.',\n 'GlobalAttachVideoRestricted': 'Sending videos isn\\'t allowed in this group.',\n 'GlobalAttachVoiceRestricted': 'Sending voice isn\\'t allowed in this group.',\n 'GlobalAttachRoundRestricted': 'Sending round videos isn\\'t allowed in this group.',\n 'GlobalAttachInlineRestricted': 'Sending inline content isn\\'t allowed in this group.',\n 'GlobalAttachStickersRestricted': 'Stickers aren\\'t allowed in this group.',\n 'GlobalAttachGifRestricted': 'Sending GIFs is not allowed in this group.',\n 'GlobalAttachEmojiRestricted': 'Text messages aren\\'t allowed in this group.',\n 'GlobalSendMessageRestricted': 'Sending messages is not allowed in this group.',\n 'ErrorSendRestrictedPollsAll': 'Sorry, sending polls is not allowed in this group.',\n 'Remove': 'Remove',\n 'ChannelBlockUser': 'Remove User',\n 'StickersName': 'Stickers and Emoji',\n 'LoopAnimatedStickersInfo': 'Animated stickers will play continuously in chats.',\n 'SuggestStickersAll': 'All Sets',\n 'SuggestStickersInstalled': 'My Sets',\n 'SuggestStickersNone': 'None',\n 'DynamicPackOrder': 'Dynamic Pack Order',\n 'DynamicPackOrderInfo': 'Automatically place recently used sticker packs at the front of the panel.',\n 'GiftPremium': 'Gift Premium',\n 'GiftTelegramPremiumTitle': 'Gift Telegram Premium',\n 'GiftTelegramPremiumDescription': 'Give **%1$s** access to exclusive features with **Telegram Premium**.',\n 'PricePerMonth': '%1$s / month',\n 'GiftSubscriptionFor': 'Gift Subscription for %1$s',\n\n // * macos\n 'AccountSettings.Filters': 'Chat Folders',\n 'AccountSettings.Notifications': 'Notifications and Sounds',\n 'AccountSettings.PrivacyAndSecurity': 'Privacy and Security',\n 'AccountSettings.Language': 'Language',\n 'Alert.UserDoesntExists': 'Sorry, this user doesn\\'t seem to exist.',\n 'Alert.Confirm.Discard': 'Discard',\n 'Appearance.Reset': 'Reset to Defaults',\n 'AutoDownloadSettings.Delimeter': ', ',\n 'AutoDownloadSettings.LastDelimeter': ' and ',\n 'Bio.Description': 'Any details such as age, occupation or city.\\nExample: 23 y.o. designer from San Francisco',\n 'Call.Accept': 'Accept',\n 'Call.Decline': 'Decline',\n 'Call.End': 'End',\n 'Call.Camera': 'Camera',\n 'Call.Mute': 'Mute',\n 'Call.Recall': 'Recall',\n 'Call.Close': 'Close',\n 'Call.Screen': 'Screen',\n 'Call.Confirm.Discard.Voice.Header': 'Video Chat in Progress',\n 'Call.Confirm.Discard.Voice.ToVoice.Text': 'Leave video chat in \"%1$@\" and start a new one in \"%2$@\"?',\n 'Call.Confirm.Discard.Voice.ToCall.Text': 'Leave video chat in \"%1$@\" and start a call with \"%2$@\"?',\n 'Call.Confirm.Discard.Call.Header': 'Call in Progress',\n 'Call.Confirm.Discard.Call.ToVoice.Text': 'End call with \"%1$@\" and start a video chat in \"%2$@\"?',\n 'Call.Confirm.Discard.Call.ToCall.Text': 'End call with \"%1$@\" and start a video chat in \"%2$@\"?',\n 'Call.PrivacyErrorMessage': 'Sorry, you cannot call %@ because of their privacy settings.',\n 'Call.StatusRequesting': 'Contacting...',\n 'Call.StatusRinging': 'Ringing...',\n 'Call.StatusConnecting': 'Connecting...',\n 'Call.StatusEnded': 'Call Ended',\n 'Call.StatusFailed': 'Call Failed',\n 'Call.StatusBusy': 'Busy',\n 'Call.StatusCalling': 'is calling you...',\n 'Contacts.PhoneNumber.NotRegistred': 'The person with this phone number is not registered on Telegram yet.',\n 'Channel.UsernameAboutChannel': 'People can share this link with others and can find your channel using Telegram search.',\n 'Channel.UsernameAboutGroup': 'People can share this link with others and find your group using Telegram search.',\n 'Chat.Accessory.Forward': {\n 'one_value': 'Forward Message',\n 'other_value': 'Forward %d Messages'\n },\n 'Chat.Accessory.Forward.You': 'You',\n 'Chat.Accessory.Forward.From': 'From',\n 'Chat.Accessory.Hidden': {\n 'one_value': 'Forward Message (sender\\'s name hidden)',\n 'other_value': 'Forward %d Messages (senders\\' names hidden)'\n },\n 'Chat.Alert.Forward.Action.Another': 'Forward to Another Chat',\n 'Chat.Alert.Forward.Action.Hide1': {\n 'one_value': 'Hide Sender\\'s Name',\n 'other_value': 'Hide Senders\\' Names'\n },\n 'Chat.Alert.Forward.Action.Show1': {\n 'one_value': 'Show Sender\\'s Name',\n 'other_value': 'Show Senders\\' Names'\n },\n 'Chat.Alert.Forward.Action.ShowCaption': {\n 'one_value': 'Show Caption',\n 'other_value': 'Show Captions'\n },\n 'Chat.Alert.Forward.Action.HideCaption': {\n 'one_value': 'Hide Caption',\n 'other_value': 'Hide Captions'\n },\n 'Chat.CopySelectedText': 'Copy Selected Text',\n 'Chat.Confirm.Unpin': 'Would you like to unpin this message?',\n 'Chat.Context.Reacted': '%1$@/%2$@ Reacted',\n 'Chat.Context.ReactedFast': {\n 'other_value': '%d Reacted'\n },\n 'Chat.Date.ScheduledFor': 'Scheduled for %@',\n 'Chat.Date.ScheduledForToday': 'Scheduled for today',\n 'Chat.DropTitle': 'Drop files here to send them',\n 'Chat.DropQuickDesc': 'in a quick way',\n 'Chat.DropAsFilesDesc': 'without compression',\n 'Chat.Edit.Cancel.Text': 'Are you sure you want to discard all changes?',\n 'Chat.Input.ReplyToAnswer': 'Reply to message in topics',\n 'Chat.SendVoice.PrivacyError': '%@ doesn\\'t accept voice and video messages',\n 'Chat.Service.Call.Cancelled': 'Cancelled',\n 'Chat.Service.Call.Missed': 'Missed',\n 'Chat.Service.PeerJoinedTelegram': '%@ joined Telegram',\n 'Chat.Service.Channel.UpdatedTitle': 'Channel renamed to \"%@\"',\n 'Chat.Service.Channel.UpdatedPhoto': 'Channel photo updated',\n 'Chat.Service.Channel.RemovedPhoto': 'Channel photo removed',\n 'Chat.Service.Channel.UpdatedVideo': 'Channel video updated',\n 'Chat.Service.BotPermissionAllowed': 'You allowed this bot to message you when you logged in on %@',\n 'Chat.Service.Group.UpdatedPinnedMessage': '%@ pinned \"%@\"',\n 'Chat.Service.Group.TopicEdited.Icon': '%1$@ changed topic icon to %2$@',\n 'Chat.Service.Group.TopicEdited.Icon.Removed': '%1$@ removed icon',\n 'Chat.Service.Group.TopicEdited.Title': '%1$@ changed topic name to \"%2$@\"',\n 'Chat.Service.Group.TopicEdited.Paused': '%1$@ closed topic',\n 'Chat.Service.Group.TopicEdited.Resumed': '%1$@ restarted topic',\n 'Chat.Service.Group.TopicEdited.You.Icon': 'You changed topic icon to %1$@',\n 'Chat.Service.Group.TopicEdited.You.Icon.Removed': 'You removed icon',\n 'Chat.Service.Group.TopicEdited.You.Title': 'You changed topic name to \"%1$@\"',\n 'Chat.Service.Group.TopicEdited.You.Paused': 'You closed topic',\n 'Chat.Service.Group.TopicEdited.You.Resumed': 'You restarted topic',\n 'Chat.Service.Group.TopicEdited.You.Hided': 'You hid the general topic',\n 'Chat.Service.Group.TopicEdited.You.Unhided': 'You unhid the general topic',\n 'Chat.Service.Group.TopicEdited.Hided': '%1$@ hid the general topic',\n 'Chat.Service.Group.TopicEdited.Unhided': '%1$@ unhid the general topic',\n 'Chat.Service.PaymentSent1': 'You have successfully transferred **%1$@** to **%2$@** for **%3$@**',\n 'Chat.Service.PaymentSent1NoTitle': 'You have successfully transferred **%1$@** to **%2$@**',\n 'Chat.Service.PaymentSentRecurringInit': 'You successfully transferred **%1$@** to **%2$@** for **%3$@** and allowed future recurring payments',\n 'Chat.Service.PaymentSentRecurringInitNoTitle': 'You successfully transferred **%1$@** to **%2$@** and allowed future recurring payments',\n 'Chat.Service.PaymentSentRecurringUsed': 'You have just successfully transferred **%1$@** to **%2$@** for **%3$@** via recurrent payments',\n 'Chat.Service.PaymentSentRecurringUsedNoTitle': 'You have just successfully transferred **%1$@** to **%2$@** via recurrent payments',\n 'Chat.Service.VoiceChatStarted': '%1$@ started a [video chat](open)',\n 'Chat.Service.VoiceChatStartedYou': 'You started a [video chat](open)',\n 'Chat.Service.VoiceChatStarted.Channel': '[Live Stream](open) started',\n 'Chat.Service.VoiceChatFinished': '%1$@ ended the video chat (%2$@)',\n 'Chat.Service.VoiceChatFinishedYou': 'You ended the video chat (%@)',\n 'Chat.Service.VoiceChatFinished.Channel': 'Live Stream ended (%1$@)',\n 'Chat.Service.VoiceChatInvitation': '%1$@ invited %2$@ to the [video chat](open)',\n 'Chat.Service.VoiceChatInvitationByYou': 'You invited %1$@ to the [video chat](open)',\n 'Chat.Service.VoiceChatInvitationForYou': '%1$@ invited you to the [video chat](open)',\n 'ChatService.UserJoinedGroupByRequest': '%@ was accepted to the group',\n 'ChatService.UserJoinedChannelByRequest': '%@ joined the channel by request',\n 'ChatList.Service.VoiceChatScheduled': '%1$@ scheduled a video chat for %2$@',\n 'ChatList.Service.VoiceChatScheduledYou': 'You scheduled a video chat for %2$@',\n 'Chat.Poll.Unvote': 'Retract Vote',\n 'Chat.Poll.Stop': 'Stop Poll',\n 'Chat.Poll.ViewResults': 'View Results',\n 'Chat.Poll.SubmitVote': 'Vote',\n 'Chat.Poll.Type.Anonymous': 'Anonymous Poll',\n 'Chat.Poll.Type.Public': 'Poll',\n 'Chat.Poll.Type.AnonymousQuiz': 'Anonymous Quiz',\n 'Chat.Poll.Type.Quiz': 'Quiz',\n 'Chat.Poll.Type.Closed': 'Final Results',\n 'Chat.Poll.TotalVotes1': {\n 'one_value': '%d vote',\n 'other_value': '%d votes'\n },\n 'Chat.Quiz.TotalVotes': {\n 'one_value': '%d answer',\n 'other_value': '%d answers'\n },\n 'Chat.Poll.TotalVotesEmpty': 'No votes yet',\n 'Chat.Poll.TotalVotesResultEmpty': 'No votes',\n 'Chat.Quiz.TotalVotesEmpty': 'No answers yet',\n 'Chat.Quiz.TotalVotesResultEmpty': 'No answers',\n // \"Chat.Poll.Stop.Confirm.Header\": \"Stop Poll?\",\n // \"Chat.Poll.Stop.Confirm.Text\": \"If you stop this poll now, nobody will be able to vote in it anymore. This action cannot be undone.\",\n // \"Chat.Pinned.UnpinAll\": {\n // \"one_value\": \"Unpin %d Message\",\n // \"other_value\": \"Unpin All %d Messages\"\n // },\n 'Chat.Pinned.DontShow': 'Don\\'t Show Pinned Messages',\n 'Chat.Title.Comments': {\n 'one_value': '%d Comment',\n 'other_value': '%d Comments'\n },\n 'ChatTitle.ReportMessages': 'Report Messages',\n 'Chat.Send.WithoutSound': 'Send Without Sound',\n 'Chat.Send.SetReminder': 'Set a Reminder',\n 'Chat.Send.ScheduledMessage': 'Schedule Message',\n 'Chat.SendAs.PersonalAccount': 'personal account',\n 'Chat.UnpinAllMessagesConfirmation': {\n 'one_value': 'Do you want to unpin %d message in this chat?',\n 'other_value': 'Do you want to unpin all %d messages in this chat?'\n },\n 'Chat.Message.Ad.Text': 'Unlike other apps, Telegram never uses your private data to target ads. Sponsored messages on Telegram are based solely on the topic of the public channels in which they are shown. This means that no user data is mined or analyzed to display ads, and every user viewing a channel on Telegram sees the same sponsored messages.\\n\\nUnlike other apps, Telegram doesn\\'t track whether you tapped on a sponsored message and doesn\\'t profile you based on your activity. We also prevent external links in sponsored messages to ensure that third parties can’t spy on our users. We believe that everyone has the right to privacy, and technological platforms should respect that.\\n\\nTelegram offers a free and unlimited service to hundreds of millions of users, which involves significant server and traffic costs. In order to remain independent and stay true to its values, Telegram developed a paid tool to promote messages with user privacy in mind. We welcome responsible advertisers at:\\n\\n%@\\n\\nSponsored Messages are currently in test mode. Once they are fully launched and allow Telegram to cover its basic costs, we will start sharing ad revenue with the owners of public channels in which sponsored messages are displayed.\\n\\nOnline ads should no longer be synonymous with abuse of user privacy. Let us redefine how a tech company should operate – together.',\n 'Chat.Message.Ad.ReadMore': 'Read More',\n 'Chat.Message.ViewChannel': 'VIEW CHANNEL',\n 'Chat.Message.ViewBot': 'VIEW BOT',\n 'Chat.Message.ViewGroup': 'VIEW GROUP',\n 'Chat.Message.Sponsored.What': 'What are sponsored messages?',\n 'Chat.Message.Sponsored.Link': 'https://promote.telegram.org',\n 'Chat.Voice.Transribe.Error': 'No speech detected',\n 'Checkout.2FA.Text': 'Saving payment details is only available with 2-Step Verification.',\n 'Checkout.NewCard.CardholderNamePlaceholder': 'Cardholder Name',\n 'Checkout.PasswordEntry.Title': 'Payment Confirmation',\n 'Checkout.PasswordEntry.Pay': 'Pay',\n 'Checkout.PasswordEntry.Text': 'Your card %@ is on file. To pay with this card, please enter your 2-Step-Verification password.',\n 'Checkout.PayPrice': 'Pay %@',\n 'Checkout.WebConfirmation.Title': 'Complete Payment',\n 'ChatList.Context.Mute': 'Mute',\n 'ChatList.Context.Unmute': 'Unmute',\n 'ChatList.Context.Pin': 'Pin',\n 'ChatList.Context.Unpin': 'Unpin',\n 'ChatList.Context.DeleteChat': 'Delete Chat',\n 'ChatList.Context.DeleteAndExit': 'Delete and Leave',\n 'ChatList.Context.LeaveChannel': 'Leave Channel',\n 'ChatList.Context.LeaveGroup': 'Leave Group',\n 'ChatList.Service.Call.incoming': 'Incoming Call (%@)',\n 'ChatList.Service.Call.outgoing': 'Outgoing Call (%@)',\n 'ChatList.Service.VideoCall.incoming': 'Incoming Video Call (%@)',\n 'ChatList.Service.VideoCall.outgoing': 'Outgoing Video Call (%@)',\n 'ChatList.Service.Call.Cancelled': 'Cancelled Call',\n 'ChatList.Service.Call.Missed': 'Missed Call',\n 'ChatList.Service.VideoCall.Cancelled': 'Cancelled Video Call',\n 'ChatList.Service.VideoCall.Missed': 'Missed Video Call',\n 'ChatList.Service.VoiceChatScheduled.Channel': 'Voice chat scheduled for %@',\n 'ChatList.Filter.Header': 'Create folders for different groups of chats and quickly switch between them.',\n 'ChatList.Filter.NewTitle': 'Create Folder',\n 'ChatList.Filter.List.Title': 'Chat Folders',\n 'ChatList.Filter.Include.AddChat': 'Add Chats',\n 'ChatList.Filter.Exclude.AddChat': 'Add Chats',\n // \"ChatList.Filter.All\": \"All\",\n 'ChatList.Filter.Contacts': 'Contacts',\n 'ChatList.Filter.NonContacts': 'Non-Contacts',\n 'ChatList.Filter.Groups': 'Groups',\n 'ChatList.Filter.Channels': 'Channels',\n 'ChatList.Filter.Bots': 'Bots',\n 'ChatList.Filter.MutedChats': 'Muted',\n 'ChatList.Filter.ReadChats': 'Read',\n 'ChatList.Filter.Archive': 'Archived',\n 'ChatList.Filter.Include.LimitReached': 'Sorry, you can only add up to 100 individual chats. Try using chat types.',\n 'ChatList.Filter.Exclude.LimitReached': 'Sorry, you can only add up to 100 individual chats. Try using chat types.',\n 'ChatList.Filter.Confirm.Remove.Header': 'Remove Folder',\n 'ChatList.Filter.Confirm.Remove.Text': 'Are you sure you want to remove this folder? Your chats will not be deleted.',\n 'ChatList.Mute.1Hour': 'For 1 Hour',\n 'ChatList.Mute.4Hours': 'For 4 Hours',\n 'ChatList.Mute.8Hours': 'For 8 Hours',\n 'ChatList.Mute.1Day': 'For 1 Day',\n 'ChatList.Mute.3Days': 'For 3 Days',\n 'ChatList.Mute.Forever': 'Forever',\n 'Channel.DescriptionHolderDescrpiton': 'You can provide an optional description for your channel.',\n 'Channel.Persmission.MessageBlock': 'Text is not Allowed',\n 'ChannelVisibility.Confirm.MakePrivate.Channel': 'If you make this channel private, the name @%@ will be removed. Anyone else will be able to take it for their public groups or channels.',\n 'ChannelVisibility.Confirm.MakePrivate.Group': 'If you make this group private, the name @%@ will be removed. Anyone else will be able to take it for their public groups or channels.',\n 'Context.ViewStickerSet': 'View Sticker Set',\n 'CreateGroup.NameHolder': 'Group Name',\n 'CustomEmoji.PremiumAlert': 'Subscribe to Telegram Premium to unlock this emoji. [Read More]()',\n 'Date.Today': 'Today',\n 'DeleteChat.DeleteGroupForAll': 'Delete for all members',\n 'DeleteChannelForAll': 'Delete for all subscribers',\n 'ForumTopic.Context.Info': 'Group Info',\n 'ForumTopic.Context.AddMember': 'Add Members',\n 'ForumTopic.Context.ShowAsMessages': 'View as Messages',\n 'ForumTopic.Context.New': 'Create Topic',\n 'ForumTopic.Name.Placeholder': 'Topic Name',\n 'ForumTopic.Title.Edit': 'Edit Topic',\n 'EditAccount.Username': 'Username',\n 'EditAccount.Title': 'Edit Profile',\n 'EditAccount.Logout': 'Log Out',\n 'Emoji.Recent': 'Frequently Used',\n 'Emoji.SmilesAndPeople': 'Smileys & People',\n 'Emoji.AnimalsAndNature': 'Animals & Nature',\n 'Emoji.FoodAndDrink': 'Food & Drink',\n 'Emoji.ActivityAndSport': 'Activity & Sport',\n 'Emoji.TravelAndPlaces': 'Travel & Places',\n 'Emoji.Objects': 'Objects',\n // \"Emoji.Symbols\": \"Symbols\",\n 'Emoji.Flags': 'Flags',\n 'Error.AnError': 'An error occurred. Please try again later.',\n 'FileSize.B': '%@ B',\n 'FileSize.KB': '%@ KB',\n 'FileSize.MB': '%@ MB',\n 'FileSize.GB': '%@ GB',\n 'InstalledStickers.LoopAnimated': 'Loop Animated Stickers',\n 'LastSeen.HoursAgo': {\n 'one_value': 'last seen %d hour ago',\n 'other_value': 'last seen %d hours ago'\n },\n 'Login.Register.LastName.Placeholder': 'Last Name',\n 'LiteMode.Title': 'Power Saving',\n 'LiteMode.Key.emoji.Title': 'Emoji Animations',\n 'LiteMode.Key.gif.Title': 'Autoplay GIFs',\n 'LiteMode.Key.video.Title': 'Autoplay Videos',\n 'LiteMode.Key.stickers.Title': 'Sticker Animations',\n 'LiteMode.Key.animations.Title': 'Interface Animations',\n // 'LiteMode.Key.emoji.Info': 'Loop animated emoji in messages, reactions and statuses.',\n // 'LiteMode.Key.gif.Info': 'Autoplay and loop GIFs in chats and in the keyboard.',\n // 'LiteMode.Key.video.Info': 'Autoplay and loop videos and video messages in chats.',\n // 'LiteMode.Key.stickers.Info': 'Loop animated stickers, in chats and in the keyboard.',\n // 'LiteMode.Key.animations.Info': 'Other animations that make Telegram look amazing.',\n 'LiteMode.Info': 'Reduce all power-intensive animations and improve performance.',\n 'LiteMode.EnableText': 'Power Saving Mode',\n 'LiteMode.DisableAlert': 'Disable Power Saving Mode',\n 'Message.Context.Select': 'Select',\n 'Message.Context.Pin': 'Pin',\n 'Message.Context.Unpin': 'Unpin',\n 'Message.Context.Goto': 'Show Message',\n 'Message.ReplyActionButtonShowReceipt': 'Show Receipt',\n 'MessageContext.CopyMessageLink1': 'Copy Message Link',\n 'Modal.Send': 'Send',\n 'NewContact.Exception.ShareMyPhoneNumber': 'Share My Phone Number',\n 'NewContact.Exception.ShareMyPhoneNumber.Desc': 'You can make your phone visible to %@.',\n 'NewPoll.Anonymous': 'Anonymous Voting',\n 'NewPoll.Explanation.Placeholder': 'Add a Comment (Optional)',\n 'NewPoll.OptionsAddOption': 'Add an Option',\n 'NewPoll.MultipleChoice': 'Multiple Answers',\n 'NewPoll.Quiz': 'Quiz Mode',\n 'Notification.Contact.Reacted': '%1$@ to your \"%2$@\"',\n // \"Notification.Group.Reacted\": \"%1$@: %2$@ to your \"%3$@\"\",\n 'Payments.Recurrent.Accept': 'I accept [Terms of Service]() of **%@**.',\n 'Peer.Activity.User.PlayingGame': 'playing a game',\n 'Peer.Activity.User.TypingText': 'typing',\n 'Peer.Activity.User.SendingPhoto': 'sending a photo',\n 'Peer.Activity.User.RecordingVideo': 'recording video',\n 'Peer.Activity.User.SendingVideo': 'sending a video',\n 'Peer.Activity.User.RecordingAudio': 'recording voice',\n 'Peer.Activity.User.SendingFile': 'sending file',\n 'Peer.Activity.User.ChoosingSticker': 'choosing a sticker',\n 'Peer.Activity.User.EnjoyingAnimations': 'watching %@',\n 'Peer.Activity.Chat.PlayingGame': '%@ is playing a game',\n 'Peer.Activity.Chat.TypingText': '%@ is typing',\n 'Peer.Activity.Chat.SendingPhoto': '%@ is sending a photo',\n 'Peer.Activity.Chat.RecordingVideo': '%@ is recording video',\n 'Peer.Activity.Chat.SendingVideo': '%@ is sending a video',\n 'Peer.Activity.Chat.RecordingAudio': '%@ is recording voice',\n 'Peer.Activity.Chat.SendingFile': '%@ is sending a file',\n 'Peer.Activity.Chat.ChoosingSticker': '%@ is choosing a sticker',\n 'Peer.Activity.Chat.EnjoyingAnimations': '%@ is watching %@',\n 'Peer.Activity.Chat.Multi.PlayingGame1': '%@ and %d others are playing a game',\n 'Peer.Activity.Chat.Multi.TypingText1': '%@ and %d others are typing',\n 'Peer.Activity.Chat.Multi.SendingPhoto1': '%@ and %d others are sending photos',\n 'Peer.Activity.Chat.Multi.RecordingVideo1': '%@ and %d others are recording video',\n 'Peer.Activity.Chat.Multi.SendingVideo1': '%@ and %d others are sending videos',\n 'Peer.Activity.Chat.Multi.RecordingAudio1': '%@ and %d others are recording voice',\n // \"Peer.Activity.Chat.Multi.SendingAudio1\": \"%@ and %d others are sending audio\",\n 'Peer.Activity.Chat.Multi.SendingFile1': '%@ and %d others are sending files',\n 'Peer.Activity.Chat.Multi.ChoosingSticker1': '%@ and %d others are choosing stickers',\n 'Peer.ServiceNotifications': 'service notifications',\n 'Peer.RepliesNotifications': 'Reply Notifications',\n 'Peer.Status.justNow': 'last seen just now',\n 'Peer.Status.Today': 'today',\n 'Peer.Status.Yesterday': 'yesterday',\n 'Peer.Status.LastSeenAt': 'last seen %@ at %@',\n 'Peer.Status.minAgo': {\n 'one_value': 'last seen %d minute ago',\n 'other_value': 'last seen %d minutes ago'\n },\n 'Peer.Status.Member': {\n 'one_value': '%d member',\n 'other_value': '%d members'\n },\n 'Peer.Status.Subscribers': {\n 'one_value': '%d subscriber',\n 'other_value': '%d subscribers'\n },\n 'PeerInfo.Administrators': 'Administrators',\n 'PeerInfo.DeleteChannel': 'Delete Channel',\n 'PeerInfo.Discussion': 'Discussion',\n 'PeerInfo.Discussion.Add': 'Add',\n 'PeerInfo.SharedMedia': 'Shared Media',\n 'PeerInfo.Subscribers': 'Subscribers',\n 'PeerInfo.DeleteContact': 'Delete Contact',\n // \"PeerInfo.Confirm.RemovePeer\": \"Remove %@ from the group?\",\n 'PeerInfo.Action.VoiceChat': 'Video Chat',\n 'PeerInfo.Action.LiveStream': 'Live Stream',\n 'PeerInfo.Phone.AnonymousInfo': 'This number is not tied to a SIM card and was acquired on [Fragment]().',\n 'PeerMedia.Members': 'Members',\n 'PollResults.Title.Poll': 'Poll Results',\n 'PollResults.Title.Quiz': 'Quiz Results',\n 'PollResults.LoadMore': {\n 'other_value': 'Show More (%d)'\n },\n // \"PeerInfo.Confirm.DeleteGroupConfirmation\": \"Wait! Deleting this group will remove all members and all messages will be lost. Delete the group anyway?\",\n 'Preview.Dragging.AddItems': {\n 'one_value': 'Add Item',\n 'other_value': 'Add Items'\n },\n 'PreviewSender.CaptionPlaceholder': 'Add a caption...',\n 'PreviewSender.CompressFile': 'Send compressed',\n 'PreviewSender.SendFile': {\n 'one_value': 'Send File',\n 'other_value': 'Send %d Files'\n },\n 'PreviewSender.SendPhoto': {\n 'one_value': 'Send Photo',\n 'other_value': 'Send %d Photos'\n },\n 'PreviewSender.SendVideo': {\n 'one_value': 'Send Video',\n 'other_value': 'Send %d Videos'\n },\n 'PrivacyAndSecurity.Item.On': 'On',\n 'PrivacyAndSecurity.Item.Off': 'Off',\n 'PrivacyAndSecurity.SensitiveText': 'Disable filtering',\n 'PrivacyAndSecurity.SensitiveDesc': 'Display sensitive media in public channels on all your Telegram devices.',\n 'PrivacySettings.VoiceCalls': 'Calls',\n 'PrivacySettings.Forwards': 'Forwarded Messages',\n 'PrivacySettings.Groups': 'Groups and Channels',\n 'PrivacySettingsController.AddUsers': 'Add Users',\n 'PrivacySettingsController.GroupDescription': 'You can restrict who can add you to groups and channels with granular precision.',\n 'PrivacySettingsController.Forwards.CustomHelp': 'You can restrict who can add a link to your account when forwarding your messages.',\n 'PrivacySettingsController.P2p.Desc': 'Disabling peer-to-peer will relay all calls through Telegram servers to avoid revealing your IP address, but may slightly decrease audio and video quality.',\n 'PrivacySettingsController.PhoneCallDescription': 'You can restrict who can call you with granular precision.',\n 'PrivacySettingsController.ProfilePhoto.CustomHelp': 'You can restrict who can see your profile photo with granular precision.',\n 'PrivacySettingsController.LastSeenDescription': 'You won\\'t see Last Seen and Online statuses for people with whom you don\\'t share yours. Approximate last seen will be shown instead (recently, within a week, within a month).',\n 'PrivacySettingsController.PeerInfo': 'You can add users or entire groups as exceptions that will override the settings above.',\n 'PrivacySettingsController.Everbody': 'Everybody',\n 'PrivacySettingsController.MyContacts': 'My Contacts',\n 'PrivacySettingsController.Nobody': 'Nobody',\n 'PrivacySettingsController.NeverShare': 'Never Share With',\n 'PrivacySettingsController.AlwaysShare': 'Always Share With',\n 'PrivacySettingsController.NeverAllow': 'Never Allow',\n 'PrivacySettingsController.AlwaysAllow': 'Always Allow',\n 'PrivacySettingsController.UserCount': {\n 'one_value': '%d user',\n 'other_value': '%d users'\n },\n 'RecentSessions.Error.FreshReset': 'For security reasons, you can\\'t terminate older sessions from a device that you\\'ve just connected. Please use an earlier connection or wait for a few hours.',\n 'RequestJoin.Button': 'Request to Join',\n 'Stickers.SearchAdd': 'Add',\n 'Stickers.SearchAdded': 'Added',\n 'Stickers.SuggestStickers': 'Suggest Stickers by Emoji',\n 'ShareModal.Search.Placeholder': 'Share to...',\n 'ShareModal.Search.ForwardPlaceholder': 'Forward to...',\n 'Telegram.GeneralSettingsViewController': 'General Settings',\n 'Telegram.InstalledStickerPacksController': 'Stickers',\n 'Telegram.NotificationSettingsViewController': 'Notifications',\n 'Telegram.LanguageViewController': 'Language',\n 'Text.CopyLabel_About': 'Copy About',\n 'Text.CopyLabel_Bio': 'Copy Bio',\n 'Text.CopyLabel_PhoneNumber': 'Copy Phone Number',\n 'Text.CopyLabel_Username': 'Copy Username',\n 'Text.CopyLabel_ShareLink': 'Copy Share Link',\n 'GeneralSettings.BigEmoji': 'Large Emoji',\n 'GeneralSettings.EmojiPrediction': 'Suggest Emoji',\n 'GroupPermission.Delete': 'Delete Exception',\n 'Search.Confirm.ClearHistory': 'Are you sure you want to clear your search history?',\n 'SecureId.Identity.Placeholder.ExpiryDate': 'Expiry Date',\n 'Separator.ShowMore': 'show more',\n 'Separator.ShowLess': 'show less',\n 'ScheduleController.at': 'at',\n 'Schedule.SendToday': 'Send today at %@',\n 'Schedule.SendDate': 'Send on %@ at %@',\n 'Schedule.SendWhenOnline': 'Send When Online',\n 'Sticker.Premium.Click.Info': 'This pack contains premium stickers like this one. [View Pack]()',\n 'Stickers.Recent': 'Recent',\n // \"Stickers.Favorite\": \"Favorite\",\n 'StickerSet.DontExist': 'Sorry, this sticker set doesn\\'t seem to exist.',\n 'Text.Context.Copy.Username': 'Copy Username',\n 'Text.Context.Copy.Hashtag': 'Copy Hashtag',\n 'Time.TomorrowAt': 'tomorrow at %@',\n 'TwoStepAuth.SetPasswordHelp': 'You can set a password that will be required when you log in on a new device in addition to the code you get in the SMS.',\n 'TwoStepAuth.GenericHelp': 'You have enabled Two-Step verification.\\nYou\\'ll need the password you set up here to log in to your Telegram account.',\n 'TwoStepAuth.ChangePassword': 'Change Password',\n 'TwoStepAuth.RemovePassword': 'Turn Password Off',\n 'TwoStepAuth.SetupEmail': 'Set Recovery Email',\n 'TwoStepAuth.ChangeEmail': 'Change Recovery Email',\n 'TwoStepAuth.ConfirmEmailCodeDesc': 'Please enter the code we\\'ve just emailed to %@.',\n 'TwoStepAuth.RecoveryTitle': 'Email Code',\n 'TwoStepAuth.RecoveryCode': 'Code',\n 'TwoStepAuth.RecoveryCodeInvalid': 'Invalid code. Please try again.',\n 'TwoStepAuth.RecoveryCodeExpired': 'Code Expired',\n 'TwoStepAuth.SetupHintTitle': 'Password Hint',\n 'TwoStepAuth.SetupHintPlaceholder': 'Hint',\n 'VoiceChat.Chat.StartNew': 'Video chat ended. Start a new one?',\n 'VoiceChat.Chat.StartNew.OK': 'Start',\n 'VoiceChat.Chat.Ended': 'Video chat ended.',\n 'VoiceChat.Invite.InviteMembers': 'Invite members',\n 'VoiceChat.Status.Connecting': 'Connecting...',\n 'VoiceChat.Status.Members': {\n 'one_value': '%d participant',\n 'other_value': '%d participants'\n },\n 'VoiceChat.Status.MutedForYou': 'muted for you',\n 'VoiceChat.Status.Speaking': 'speaking',\n 'VoiceChat.Status.Listening': 'listening',\n 'VoiceChat.Status.WantsSpeak': 'wants to speak',\n 'VoiceChat.Status.Muted': 'muted',\n 'VoiceChat.Status.You': 'This is you',\n 'VoiceChat.Video.Stream.Video': 'video',\n 'VoiceChat.Video.Stream.Screencast': 'screen',\n 'VoiceChat.Video.Stream.More': 'more',\n 'VoiceChat.Leave': 'Leave',\n 'VoiceChat.End.Title': 'Leave video chat',\n 'VoiceChat.End.Text': 'Are you sure you want to leave this video chat?',\n 'VoiceChat.End.Third': 'End Video Chat',\n 'VoiceChat.End.OK': 'Leave',\n 'VoiceChat.MutePeer': 'Mute',\n 'VoiceChat.UnmutePeer': 'Allow To Speak',\n 'VoiceChat.RemovePeer': 'Remove',\n 'VoiceChat.OpenProfile': 'Open Profile',\n 'VoiceChat.MuteForMe': 'Mute For Me',\n 'VoiceChat.UnmuteForMe': 'Unmute For Me',\n 'VoiceChat.RemovePeer.Confirm.Channel': 'Do you want to remove %1$@ from the channel?',\n 'VoiceChat.RemovePeer.Confirm': 'Are you sure you want to remove %1$@ from the group?',\n 'VoiceChat.RemovePeer.Confirm.OK': 'Remove'\n};\n\nexport default lang;\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/public/110.b39868e78bf4adf7dd36.bundle.js b/public/110.109af56006a419549840.bundle.js similarity index 99% rename from public/110.b39868e78bf4adf7dd36.bundle.js rename to public/110.109af56006a419549840.bundle.js index 9857a671..afa38cdc 100644 --- a/public/110.b39868e78bf4adf7dd36.bundle.js +++ b/public/110.109af56006a419549840.bundle.js @@ -1,2 +1,2 @@ -"use strict";(this.webpackChunktweb=this.webpackChunktweb||[]).push([[110],{4159:(d,e,u)=>{var t;u.d(e,{Z:()=>s});const f=["web.telegram.org","webk.telegram.org"],r=Math.min(4,null!==(t=navigator.hardwareConcurrency)&&void 0!==t?t:4),c={id:1025907,hash:"452b0359b988148995f22ff0f4229750",version:"1.7.3",versionFull:"1.7.3 (314)",build:314,langPackVersion:"1.0.1",langPack:"webk",langPackCode:"en",domains:f,baseDcId:2,isMainDomain:f.includes(location.hostname),suffix:"K",threads:r,cryptoWorkers:r};c.isMainDomain&&(c.id=2496,c.hash="8da85b0d5bfe62527e5b244c209159c3");const s=c},3127:(d,e,u)=>{u.d(e,{Z:()=>t});const t={name:"tweb",version:7,stores:[{name:"session"},{name:"stickerSets"},{name:"users"},{name:"chats"},{name:"dialogs"},{name:"messages"}]}},8975:(d,e,u)=>{u.d(e,{Z:()=>f});var t=u(7119);function f(d,e=""){Array.isArray(d)||(d=[d]);const u=(0,t.Z)(e);return new Blob(d,{type:u})}},7119:(d,e,u)=>{function t(d){return-1===["image/jpeg","image/png","image/gif","image/svg+xml","image/webp","image/bmp","video/mp4","video/webm","video/quicktime","audio/ogg","audio/mpeg","audio/mp4","audio/wav","application/json","application/pdf"].indexOf(d)?"application/octet-stream":d}u.d(e,{Z:()=>t})},4903:(d,e,u)=>{function t(...d){const e=d.reduce(((d,e)=>d+(e.byteLength||e.length)),0),u=new Uint8Array(e);let t=0;return d.forEach((d=>{u.set(d instanceof ArrayBuffer?new Uint8Array(d):d,t),t+=d.byteLength||d.length})),u}u.d(e,{Z:()=>t})},3725:(d,e,u)=>{u.d(e,{Z:()=>f});var t=u(319);function f(){const d={isFulfilled:!1,isRejected:!1,notify:()=>{},notifyAll:(...e)=>{d.lastNotify=e,d.listeners.forEach((d=>d(...e)))},listeners:[],addNotifyListener:e=>{d.lastNotify&&e(...d.lastNotify),d.listeners.push(e)}},e=new Promise(((u,t)=>{d.resolve=d=>{e.isFulfilled||e.isRejected||(e.isFulfilled=!0,u(d))},d.reject=(...d)=>{e.isRejected||e.isFulfilled||(e.isRejected=!0,t(...d))}}));return e.catch(t.Z).finally((()=>{e.notify=e.notifyAll=e.lastNotify=null,e.listeners.length=0,e.cancel&&(e.cancel=t.Z)})),Object.assign(e,d),e}},1352:(d,e,u)=>{u.d(e,{N5:()=>f,SU:()=>t,kC:()=>r});const t="undefined"!=typeof ServiceWorkerGlobalScope&&self instanceof ServiceWorkerGlobalScope,f="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&!t,r=f||t,c=(d,...e)=>{try{d.postMessage(...e)}catch(d){console.error("[worker] postMessage error:",d,e)}},s=(d,...e)=>{self.clients.matchAll({includeUncontrolled:!1,type:"window"}).then((u=>{u.length&&u.slice(d?0:-1).forEach((d=>{c(d,...e)}))}))};t&&s.bind(null,!1),t&&s.bind(null,!0)},319:(d,e,u)=>{function t(){}u.d(e,{Z:()=>t})},8479:(d,e,u)=>{function t(d){if(null===d||"object"!=typeof d)return d;if(d instanceof Date)return new Date(d.getTime());if(Array.isArray(d))return d.map((d=>t(d)));if(ArrayBuffer.isView(d))return d.slice();const e=new d.constructor;for(var u in d)d.hasOwnProperty(u)&&(e[u]=t(d[u]));return e}u.d(e,{Z:()=>t})},6848:(d,e,u)=>{function t(d,e){const u=Object.keys,f=typeof d;return d&&e&&"object"===f&&f===typeof e?u(d).length===u(e).length&&u(d).every((u=>t(d[u],e[u]))):d===e}u.d(e,{Z:()=>t})},5880:(d,e,u)=>{function t(d){return"object"==typeof d&&null!==d}u.d(e,{Z:()=>t})},5953:(d,e,u)=>{function t(d,e){if(e)for(const u in e)void 0!==e[u]&&(d[u]=e[u]);return d}u.d(e,{Z:()=>t})},946:(d,e,u)=>{u.d(e,{Z:()=>r});var t=u(8479),f=u(5880);function r(d,e,u,c,s,n){for(const o in d){const i=n?`${n}.${o}`:o;(null==s?void 0:s.has(i))||(typeof e[o]!=typeof d[o]?(e[o]=(0,t.Z)(d[o]),null==u||u(c||o)):(0,f.Z)(d[o])&&r(d[o],e[o],u,c||o,s,i))}}},4110:(d,e,u)=>{var t=u(7361),f=u(617);String.prototype.toUserId=function(){return(+this).toUserId()},String.prototype.toChatId=function(){return(+this).toChatId()},String.prototype.toPeerId=function(d){return(+this).toPeerId(d)},String.prototype.isPeerId=function(){return/^[\d-]/.test(this.toString())},Number.prototype.toUserId=function(){return this},Number.prototype.toChatId=function(){return Math.abs(this)},Number.prototype.toPeerId=function(d){return void 0===d?this:d?-Math.abs(this):this},Number.prototype.isPeerId=function(){return!0},[["isUser",f.Z],["isAnyChat",t.Z]].forEach((d=>{const e=Array.isArray(d)?d[0]:d,u=Array.isArray(d)?d[1]:d;String.prototype[e]=function(){return u.call(null,this.toString())},Number.prototype[e]=function(){return u.call(null,this)}}))},144:(d,e,u)=>{u.d(e,{a:()=>r,d:()=>f});const t={8:new Uint8Array(1),16:new Uint16Array(1),32:new Uint32Array(1)};function f(d){const e=t[d];return crypto.getRandomValues(e),e[0]}function r(){return""+f(32)+f(32)%16777215}},5466:(d,e,u)=>{u.d(e,{$:()=>f});var t=u(5289);function f(d){return(...e)=>function(d,e,u){const f=performance.now();return(u||console).warn((0,t.Z)(),"start",e),d.then((()=>{(u||console).warn((0,t.Z)(),"end",e,performance.now()-f)})),d}(...e,d)}},5418:(d,e,u)=>{function t(d){return new Promise((e=>{setTimeout(e,d)}))}u.d(e,{Z:()=>t})},6724:(d,e,u)=>{function t(d,e,u=!0){let t,f,r=null;return(...c)=>{t=!0,f=c,r||(u&&(t=!1,d(...f)),r=setInterval((()=>{if(!t)return clearInterval(r),void(r=null);t=!1,d(...f)}),e))}}u.d(e,{Z:()=>t})},9005:(d,e,u)=>{function t(d){return d.charAt(0).toUpperCase()+d.slice(1)}u.d(e,{Z:()=>t})},8453:(d,e,u)=>{u.d(e,{Z:()=>s});var t=u(5936),f=u(3989),r=u(7487),c=u(319);function s(d,e){return Promise.all([f.Z.toggleStorage(d,e),t.Z.toggleStorage(d,e),r.Z.toggleStorage(d,e)]).then(c.Z,c.Z)}},7298:(d,e,u)=>{function t(d){const e=Date.now();return d?e/1e3|0:e}u.d(e,{Z:()=>t})},2790:(d,e,u)=>{u.d(e,{Z:()=>f});var t=u(7082);function f(d){return function(d,e){const u=t.t;if(d{u.d(e,{o:()=>t,t:()=>f});const t=65536,f=4294967295},7361:(d,e,u)=>{function t(d){return+d<0}u.d(e,{Z:()=>t})},617:(d,e,u)=>{function t(d){return+d>=0}u.d(e,{Z:()=>t})},8630:(d,e,u)=>{u.d(e,{Z:()=>n});var t=u(153),f=u(410),r=u(1352);class c extends t.Z{constructor(){super("CRYPTO"),this.lastIndex=-1}invokeCryptoNew({method:d,args:e,transfer:u}){const t={method:d,args:e},f=this.listeners.invoke;if(null==f?void 0:f.length){let d=f[0].callback(t);return r.kC||d instanceof Promise||(d=Promise.resolve(d)),d}const c="aes-encrypt"===d||"aes-decrypt"===d?this.lastIndex=(this.lastIndex+1)%this.sendPorts.length:0;return this.invoke("invoke",t,void 0,this.sendPorts[c],u)}invokeCrypto(d,...e){return this.invokeCryptoNew({method:d,args:e})}}const s=new c;f.GO&&(f.GO.cryptoMessagePort=s);const n=s},5936:(d,e,u)=>{u.d(e,{Z:()=>n});var t=u(1267),f=u(8975),r=u(5753),c=u(5471),s=u(3725);class n{constructor(d){this.dbName=d,this.useStorage=!0,t.Z.test&&(this.dbName+="_test"),n.STORAGES.length&&(this.useStorage=n.STORAGES[0].useStorage),this.openDatabase(),n.STORAGES.push(this)}openDatabase(){var d;return null!==(d=this.openDbPromise)&&void 0!==d?d:this.openDbPromise=caches.open(this.dbName)}delete(d){return this.timeoutOperation((e=>e.delete("/"+d)))}deleteAll(){return caches.delete(this.dbName)}get(d){return this.timeoutOperation((e=>e.match("/"+d)))}save(d,e){return this.timeoutOperation((u=>u.put("/"+d,e)))}getFile(d,e="blob"){return this.get(d).then((d=>{if(!d)throw(0,c.Z)("NO_ENTRY_FOUND");return d[e]()}))}saveFile(d,e){e instanceof Blob||(e=(0,f.Z)(e));const u=new Response(e,{headers:{"Content-Length":""+e.size}});return this.save(d,u).then((()=>e))}timeoutOperation(d){return this.useStorage?new Promise(((e,u)=>{return t=this,f=void 0,c=function*(){let t=!1;const f=setTimeout((()=>{u(),t=!0}),15e3);try{const u=yield this.openDatabase();if(!u)throw this.useStorage=!1,this.openDbPromise=void 0,"no cache?";const f=yield d(u);if(t)return;e(f)}catch(d){u(d)}clearTimeout(f)},new((r=void 0)||(r=Promise))((function(d,e){function u(d){try{n(c.next(d))}catch(d){e(d)}}function s(d){try{n(c.throw(d))}catch(d){e(d)}}function n(e){var t;e.done?d(e.value):(t=e.value,t instanceof r?t:new r((function(d){d(t)}))).then(u,s)}n((c=c.apply(t,f||[])).next())}));var t,f,r,c})):Promise.reject((0,c.Z)("STORAGE_OFFLINE"))}prepareWriting(d,e,u){return{deferred:(0,s.Z)(),getWriter:()=>new r.Z(u,e,(e=>this.saveFile(d,e).catch((()=>e))))}}static toggleStorage(d,e){return Promise.all(this.STORAGES.map((u=>{if(u.useStorage=d,e)return d?void 0:u.deleteAll()})))}}n.STORAGES=[]},5753:(d,e,u)=>{u.d(e,{Z:()=>f});var t=u(8975);class f{constructor(d,e,u){this.mimeType=d,this.size=e,this.saveFileCallback=u,this.bytes=new Uint8Array(e)}write(d,e){return u=this,t=void 0,r=function*(){const u=e+d.byteLength;if(u>this.bytes.byteLength){const d=new Uint8Array(u);d.set(this.bytes,0),this.bytes=d}this.bytes.set(d,e)},new((f=void 0)||(f=Promise))((function(d,e){function c(d){try{n(r.next(d))}catch(d){e(d)}}function s(d){try{n(r.throw(d))}catch(d){e(d)}}function n(e){var u;e.done?d(e.value):(u=e.value,u instanceof f?u:new f((function(d){d(u)}))).then(c,s)}n((r=r.apply(u,t||[])).next())}));var u,t,f,r}truncate(){this.bytes=new Uint8Array}trim(d){this.bytes=this.bytes.slice(0,d)}finalize(d=!0){const e=(0,t.Z)(this.bytes,this.mimeType);return d&&this.saveFileCallback&&this.saveFileCallback(e),e}getParts(){return this.bytes}replaceParts(d){this.bytes=d}}},5003:(d,e,u)=>{u.d(e,{kg:()=>l,v9:()=>t});var t,f=u(410),r=u(4762),c=u(1352),s=u(5289);!function(d){d[d.None=0]="None",d[d.Error=1]="Error",d[d.Warn=2]="Warn",d[d.Log=4]="Log",d[d.Debug=8]="Debug"}(t||(t={}));const n=[t.None,t.Error,t.Warn,t.Log,t.Debug],o=!(r.IS_SAFARI||r.IS_FIREFOX),i="",a="",h=[["debug",t.Debug],["info",t.Log],["warn",t.Warn],["error",t.Error],["assert",t.Error],["trace",t.Log],["group",t.Log],["groupCollapsed",t.Log],["groupEnd",t.Log]];function l(d,e=t.Log|t.Warn|t.Error,u=!1,r=""){let b;f.ZP||u||(e=t.Error),o?r||(c.SU?r=i:c.N5&&(r=a)):r="";const g=r;r=r?`%s ${r}%s`:"%s";const p=function(...u){return e&t.Log&&console.log(r,(0,s.Z)(),d,...u)};return h.forEach((([u,t])=>{p[u]=function(...f){return e&t&&console[u](r,(0,s.Z)(),d,...f)}})),p.setPrefix=function(e){b=e,d="["+e+"]"},p.setPrefix(d),p.setLevel=function(d){e=n.slice(0,d+1).reduce(((d,e)=>d|e),0)},p.bindPrefix=function(d){return l(`${b}] [${d}`,e,u,g)},p}},3206:(d,e,u)=>{u.d(e,{Z:()=>r});var t=u(410),f=u(153);class r extends f.Z{constructor(){super("MTPROTO"),r.INSTANCE=this,t.GO&&(t.GO.mtprotoMessagePort=this)}static getInstance(){return this.INSTANCE}}},690:(d,e,u)=>{var t=u(4903);Uint8Array.prototype.concat=function(...d){return(0,t.Z)(this,...d)},Uint8Array.prototype.toJSON=function(){return[...this]},Promise.prototype.finally=Promise.prototype.finally||function(d){const e=e=>Promise.resolve(d()).then(e);return this.then((d=>e((()=>d))),(d=>e((()=>Promise.reject(d)))))}},6637:(d,e,u)=>{u.d(e,{Z:()=>f});var t=u(2423);function f(d){return d?d.match(t.bu):null}},3655:(d,e,u)=>{u.d(e,{Z:()=>r});var t=u(153),f=u(410);class r extends t.Z{constructor(){super("SERVICE"),f.GO&&(f.GO.serviceMessagePort=this)}}},7487:(d,e,u)=>{u.d(e,{Z:()=>i});var t=u(410),f=u(1267),r=u(1352),c=u(3206);class s{constructor(){this.prefix="",this.cache={},this.useStorage=!0,f.Z.test&&(this.prefix="t_")}get(d,e=!0){if(this.cache.hasOwnProperty(d)&&e)return this.cache[d];if(this.useStorage){let e;try{e=localStorage.getItem(this.prefix+d)}catch(d){this.useStorage=!1}if(null!==e)try{e=JSON.parse(e)}catch(d){}else e=void 0;return e}}set(d,e=!1){for(const u in d)if(d.hasOwnProperty(u)){const t=d[u];if(this.cache[u]=t,this.useStorage&&!e)try{const d=JSON.stringify(t);localStorage.setItem(this.prefix+u,d)}catch(d){this.useStorage=!1}}}delete(d,e=!1){d=""+d,e||delete this.cache[d];try{localStorage.removeItem(this.prefix+d)}catch(d){}}clear(){const d=["dc","server_time_offset","xt_instance","user_auth","state_id","k_build"];for(let e=1;e<=5;++e)d.push(`dc${e}_server_salt`),d.push(`dc${e}_auth_key`);for(const e of d)this.delete(e,!0)}toggleStorage(d,e){if(this.useStorage=d,e)return d?this.set(this.cache):void this.clear()}}class n{constructor(){n.STORAGES.push(this),r.kC||(this.storage=new s)}proxy(d,...e){return u=this,t=void 0,s=function*(){return r.kC?c.Z.getInstance().invoke("localStorageProxy",{type:d,args:e}):(e=Array.prototype.slice.call(e),this.storage[d].apply(this.storage,e))},new((f=void 0)||(f=Promise))((function(d,e){function r(d){try{n(s.next(d))}catch(d){e(d)}}function c(d){try{n(s.throw(d))}catch(d){e(d)}}function n(e){var u;e.done?d(e.value):(u=e.value,u instanceof f?u:new f((function(d){d(u)}))).then(r,c)}n((s=s.apply(u,t||[])).next())}));var u,t,f,s}get(d,e){return this.proxy("get",d,e)}set(d,e){return this.proxy("set",d,e)}delete(d,e){return this.proxy("delete",d,e)}clear(){return this.proxy("clear")}toggleStorage(d,e){return this.proxy("toggleStorage",d,e)}}n.STORAGES=[];const o=new n;t.GO.appStorage=o;const i=o},7922:(d,e,u)=>{u.d(e,{Z:()=>n});var t=u(410),f=u(3989),r=u(3127);class c extends f.Z{constructor(){super(r.Z,"session")}}const s=new c;t.GO.stateStorage=s;const n=s},3989:(d,e,u)=>{u.d(e,{Z:()=>i});var t=u(410),f=u(3725),r=u(1352),c=u(6724),s=u(6666),n=function(d,e,u,t){return new(u||(u=Promise))((function(f,r){function c(d){try{n(t.next(d))}catch(d){r(d)}}function s(d){try{n(t.throw(d))}catch(d){r(d)}}function n(d){var e;d.done?f(d.value):(e=d.value,e instanceof u?e:new u((function(d){d(e)}))).then(c,s)}n((t=t.apply(d,e||[])).next())}))};function o(){}class i{constructor(d,e){this.db=d,this.storeName=e,this.cache={},this.getPromises=new Map,this.keysToSet=new Set,this.saveDeferred=(0,f.Z)(),this.keysToDelete=new Set,this.deleteDeferred=(0,f.Z)(),this.storage=new s.Z(d,e),i.STORAGES.length?this.useStorage=i.STORAGES[0].useStorage:this.useStorage=!0,this.savingFreezed=!1,i.STORAGES.push(this),this.saveThrottled=(0,c.Z)((()=>n(this,void 0,void 0,(function*(){const d=this.saveDeferred;this.saveDeferred=(0,f.Z)();const e=this.keysToSet;if(e.size){const d=Array.from(e.values());e.clear();const u=d.map((d=>this.cache[d]));try{yield this.storage.save(d,u)}catch(e){console.error("[AS]: set error:",e,d,u)}}d.resolve(),e.size&&this.saveThrottled()}))),16,!1),this.deleteThrottled=(0,c.Z)((()=>n(this,void 0,void 0,(function*(){const d=this.deleteDeferred;this.deleteDeferred=(0,f.Z)();const e=this.keysToDelete;if(e.size){const d=Array.from(e.values());e.clear();try{yield this.storage.delete(d)}catch(e){console.error("[AS]: delete error:",e,d)}}d.resolve(),e.size&&this.deleteThrottled()}))),16,!1),this.getThrottled=(0,c.Z)((()=>n(this,void 0,void 0,(function*(){const d=Array.from(this.getPromises.keys());this.storage.get(d).then((e=>{for(let u=0,t=d.length;u{new Set(["NO_ENTRY_FOUND","STORAGE_OFFLINE"]).has(u.type)||(this.useStorage=!1,console.error("[AS]: get error:",u,d,e));for(let e=0,u=d.length;e{this.getPromises.size&&this.getThrottled()}))}))),16,!1)}isAvailable(){return this.useStorage}getCache(){return this.cache}getFromCache(d){return this.cache[d]}setToCache(d,e){return this.cache[d]=e}get(d,e=!0){return n(this,void 0,void 0,(function*(){if(this.cache.hasOwnProperty(d)&&e)return this.getFromCache(d);if(this.useStorage){const e=this.getPromises.get(d);if(e)return e;const u=(0,f.Z)();return this.getPromises.set(d,u),this.getThrottled(),u}}))}getAll(){return this.storage.getAll().catch((()=>[]))}set(d,e=!1){const u=this.useStorage&&!e&&!this.savingFreezed;for(const e in d)if(d.hasOwnProperty(e)){const t=d[e];this.setToCache(e,t),u&&(this.keysToSet.add(e),this.keysToDelete.delete(e),this.saveThrottled())}return u?this.saveDeferred:Promise.resolve()}delete(d,e=!1){return d=""+d,e||delete this.cache[d],this.useStorage&&(this.keysToSet.delete(d),this.keysToDelete.add(d),this.deleteThrottled()),this.useStorage?this.deleteDeferred:Promise.resolve()}clear(d=!1){if(!d)for(const d in this.cache)delete this.cache[d];return this.storage.clear().catch(o)}static toggleStorage(d,e){return Promise.all(this.STORAGES.map((u=>{if(u.useStorage=d,r.kC&&e)return d?u.set(u.cache):(u.keysToSet.clear(),u.keysToDelete.clear(),u.getPromises.forEach((d=>d.resolve(void 0))),u.getPromises.clear(),u.clear(!0))}))).catch(o)}static freezeSaving(d,e){this.STORAGES.forEach((d=>d.savingFreezed=!0));try{d()}catch(d){console.error("freezeSaving callback error:",d)}this.STORAGES.forEach((d=>d.savingFreezed=!1))}}i.STORAGES=[],t.GO&&(t.GO.AppStorage=i)},1229:(d,e,u)=>{u.d(e,{Z:()=>t});const t="((?:👨🏻‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👨🏼‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👨🏽‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👨🏾‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👨🏿‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👩🏻‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👩🏻‍❤️?‍💋‍👩\ud83c[\udffb-\udfff]|👩🏼‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👩🏼‍❤️?‍💋‍👩\ud83c[\udffb-\udfff]|👩🏽‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👩🏽‍❤️?‍💋‍👩\ud83c[\udffb-\udfff]|👩🏾‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👩🏾‍❤️?‍💋‍👩\ud83c[\udffb-\udfff]|👩🏿‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👩🏿‍❤️?‍💋‍👩\ud83c[\udffb-\udfff]|🧑🏻‍❤️?‍💋‍🧑\ud83c[\udffc-\udfff]|🧑🏼‍❤️?‍💋‍🧑\ud83c[\udffb\udffd-\udfff]|🧑🏽‍❤️?‍💋‍🧑\ud83c[\udffb\udffc\udffe\udfff]|🧑🏾‍❤️?‍💋‍🧑\ud83c[\udffb-\udffd\udfff]|🧑🏿‍❤️?‍💋‍🧑\ud83c[\udffb-\udffe]|👨🏻‍❤️?‍👨\ud83c[\udffb-\udfff]|👨🏻‍🤝‍👨\ud83c[\udffc-\udfff]|👨🏼‍❤️?‍👨\ud83c[\udffb-\udfff]|👨🏼‍🤝‍👨\ud83c[\udffb\udffd-\udfff]|👨🏽‍❤️?‍👨\ud83c[\udffb-\udfff]|👨🏽‍🤝‍👨\ud83c[\udffb\udffc\udffe\udfff]|👨🏾‍❤️?‍👨\ud83c[\udffb-\udfff]|👨🏾‍🤝‍👨\ud83c[\udffb-\udffd\udfff]|👨🏿‍❤️?‍👨\ud83c[\udffb-\udfff]|👨🏿‍🤝‍👨\ud83c[\udffb-\udffe]|👩🏻‍❤️?‍👨\ud83c[\udffb-\udfff]|👩🏻‍❤️?‍👩\ud83c[\udffb-\udfff]|👩🏻‍🤝‍👨\ud83c[\udffc-\udfff]|👩🏻‍🤝‍👩\ud83c[\udffc-\udfff]|👩🏼‍❤️?‍👨\ud83c[\udffb-\udfff]|👩🏼‍❤️?‍👩\ud83c[\udffb-\udfff]|👩🏼‍🤝‍👨\ud83c[\udffb\udffd-\udfff]|👩🏼‍🤝‍👩\ud83c[\udffb\udffd-\udfff]|👩🏽‍❤️?‍👨\ud83c[\udffb-\udfff]|👩🏽‍❤️?‍👩\ud83c[\udffb-\udfff]|👩🏽‍🤝‍👨\ud83c[\udffb\udffc\udffe\udfff]|👩🏽‍🤝‍👩\ud83c[\udffb\udffc\udffe\udfff]|👩🏾‍❤️?‍👨\ud83c[\udffb-\udfff]|👩🏾‍❤️?‍👩\ud83c[\udffb-\udfff]|👩🏾‍🤝‍👨\ud83c[\udffb-\udffd\udfff]|👩🏾‍🤝‍👩\ud83c[\udffb-\udffd\udfff]|👩🏿‍❤️?‍👨\ud83c[\udffb-\udfff]|👩🏿‍❤️?‍👩\ud83c[\udffb-\udfff]|👩🏿‍🤝‍👨\ud83c[\udffb-\udffe]|👩🏿‍🤝‍👩\ud83c[\udffb-\udffe]|🧑🏻‍❤️?‍🧑\ud83c[\udffc-\udfff]|🧑🏻‍🤝‍🧑\ud83c[\udffb-\udfff]|🧑🏼‍❤️?‍🧑\ud83c[\udffb\udffd-\udfff]|🧑🏼‍🤝‍🧑\ud83c[\udffb-\udfff]|🧑🏽‍❤️?‍🧑\ud83c[\udffb\udffc\udffe\udfff]|🧑🏽‍🤝‍🧑\ud83c[\udffb-\udfff]|🧑🏾‍❤️?‍🧑\ud83c[\udffb-\udffd\udfff]|🧑🏾‍🤝‍🧑\ud83c[\udffb-\udfff]|🧑🏿‍❤️?‍🧑\ud83c[\udffb-\udffe]|🧑🏿‍🤝‍🧑\ud83c[\udffb-\udfff]|👨‍❤️?‍💋‍👨|👩‍❤️?‍💋‍\ud83d[\udc68\udc69]|🫱🏻‍🫲\ud83c[\udffc-\udfff]|🫱🏼‍🫲\ud83c[\udffb\udffd-\udfff]|🫱🏽‍🫲\ud83c[\udffb\udffc\udffe\udfff]|🫱🏾‍🫲\ud83c[\udffb-\udffd\udfff]|🫱🏿‍🫲\ud83c[\udffb-\udffe]|👨‍❤️?‍👨|👩‍❤️?‍\ud83d[\udc68\udc69]|🧑‍🤝‍🧑|👫\ud83c[\udffb-\udfff]|👬\ud83c[\udffb-\udfff]|👭\ud83c[\udffb-\udfff]|💏\ud83c[\udffb-\udfff]|💑\ud83c[\udffb-\udfff]|🤝\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d\udc8f\udc91]|🤝)|(?:\ud83d[\udc68\udc69]|🧑)(?:\ud83c[\udffb-\udfff])?‍(?:⚕️?|⚖️?|✈️?|\ud83c[\udf3e\udf73\udf7c\udf84\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|⛹)(?:(?:\ud83c[\udffb-\udfff]|️?)‍[♀♂]️?)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd4\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?‍[♀♂]️?|(?:👨‍👨‍👦‍👦|👨‍👨‍👧‍\ud83d[\udc66\udc67]|👨‍👩‍👦‍👦|👨‍👩‍👧‍\ud83d[\udc66\udc67]|👩‍👩‍👦‍👦|👩‍👩‍👧‍\ud83d[\udc66\udc67]|👨‍👦‍👦|👨‍👧‍\ud83d[\udc66\udc67]|👨‍👨‍\ud83d[\udc66\udc67]|👨‍👩‍\ud83d[\udc66\udc67]|👩‍👦‍👦|👩‍👧‍\ud83d[\udc66\udc67]|👩‍👩‍\ud83d[\udc66\udc67]|🏳️?‍⚧️?|🏳️?‍🌈|😶‍🌫️?|❤️?‍🔥|❤️?‍🩹|🏴‍☠️?|🐕‍🦺|🐻‍❄️?|👁‍🗨|👨‍\ud83d[\udc66\udc67]|👩‍\ud83d[\udc66\udc67]|👯‍♀️?|👯‍♂️?|😮‍💨|😵‍💫|🤼‍♀️?|🤼‍♂️?|🧞‍♀️?|🧞‍♂️?|🧟‍♀️?|🧟‍♂️?|🐈‍⬛)|[#*0-9]️??⃣|(?:[©®™♟]️?)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[‼⁉ℹ↔-↙↩↪⌚⌛⌨⏏⏭-⏯⏱⏲⏸-⏺Ⓜ▪▫▶◀◻-◾☀-☄☎☑☔☕☘☠☢☣☦☪☮☯☸-☺♀♂♈-♓♠♣♥♦♨♻♿⚒-⚗⚙⚛⚜⚠⚡⚧⚪⚫⚰⚱⚽⚾⛄⛅⛈⛏⛑⛓⛔⛩⛪⛰-⛵⛸⛺⛽✂✈✉✏✒✔✖✝✡✳✴❄❇❗❣❤➡⤴⤵⬅-⬇⬛⬜⭐⭕〰〽㊗㊙])(?:️?|(?!︎))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[☝⛷⛹✌✍])(?:️?|(?!︎))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd\udec3-\udec5\udef0-\udef6]|[✊✋]))(?:\ud83c[\udffb-\udfff])?|(?:🏴󠁧󠁢󠁥󠁮󠁧󠁿|🏴󠁧󠁢󠁳󠁣󠁴󠁿|🏴󠁧󠁢󠁷󠁬󠁳󠁿|🇦\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|🇧\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|🇨\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|🇩\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|🇪\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|🇫\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|🇬\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|🇭\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|🇮\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|🇯\ud83c[\uddea\uddf2\uddf4\uddf5]|🇰\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|🇱\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|🇲\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|🇳\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|🇴🇲|🇵\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|🇶🇦|🇷\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|🇸\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|🇹\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|🇺\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|🇻\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|🇼\ud83c[\uddeb\uddf8]|🇽🇰|🇾\ud83c[\uddea\uddf9]|🇿\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udc8e\udc90\udc92-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5-\uded7\udedd-\udedf\udeeb\udeec\udef4-\udefc\udfe0-\udfeb\udff0]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78-\uddb4\uddb7\uddba\uddbc-\uddcc\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7c\ude80-\ude86\ude90-\udeac\udeb0-\udeba\udec0-\udec2\uded0-\uded9\udee0-\udee7]|[⏩-⏬⏰⏳♾⛎✅✨❌❎❓-❕➕-➗➰➿])|️)"}}]); -//# sourceMappingURL=110.b39868e78bf4adf7dd36.bundle.js.map \ No newline at end of file +"use strict";(this.webpackChunktweb=this.webpackChunktweb||[]).push([[110],{4159:(d,e,u)=>{var t;u.d(e,{Z:()=>s});const f=["web.telegram.org","webk.telegram.org"],r=Math.min(4,null!==(t=navigator.hardwareConcurrency)&&void 0!==t?t:4),c={id:1025907,hash:"452b0359b988148995f22ff0f4229750",version:"1.7.3",versionFull:"1.7.3 (315)",build:315,langPackVersion:"1.0.3",langPack:"webk",langPackCode:"en",domains:f,baseDcId:2,isMainDomain:f.includes(location.hostname),suffix:"K",threads:r,cryptoWorkers:r};c.isMainDomain&&(c.id=2496,c.hash="8da85b0d5bfe62527e5b244c209159c3");const s=c},3127:(d,e,u)=>{u.d(e,{Z:()=>t});const t={name:"tweb",version:7,stores:[{name:"session"},{name:"stickerSets"},{name:"users"},{name:"chats"},{name:"dialogs"},{name:"messages"}]}},8975:(d,e,u)=>{u.d(e,{Z:()=>f});var t=u(7119);function f(d,e=""){Array.isArray(d)||(d=[d]);const u=(0,t.Z)(e);return new Blob(d,{type:u})}},7119:(d,e,u)=>{function t(d){return-1===["image/jpeg","image/png","image/gif","image/svg+xml","image/webp","image/bmp","video/mp4","video/webm","video/quicktime","audio/ogg","audio/mpeg","audio/mp4","audio/wav","application/json","application/pdf"].indexOf(d)?"application/octet-stream":d}u.d(e,{Z:()=>t})},4903:(d,e,u)=>{function t(...d){const e=d.reduce(((d,e)=>d+(e.byteLength||e.length)),0),u=new Uint8Array(e);let t=0;return d.forEach((d=>{u.set(d instanceof ArrayBuffer?new Uint8Array(d):d,t),t+=d.byteLength||d.length})),u}u.d(e,{Z:()=>t})},3725:(d,e,u)=>{u.d(e,{Z:()=>f});var t=u(319);function f(){const d={isFulfilled:!1,isRejected:!1,notify:()=>{},notifyAll:(...e)=>{d.lastNotify=e,d.listeners.forEach((d=>d(...e)))},listeners:[],addNotifyListener:e=>{d.lastNotify&&e(...d.lastNotify),d.listeners.push(e)}},e=new Promise(((u,t)=>{d.resolve=d=>{e.isFulfilled||e.isRejected||(e.isFulfilled=!0,u(d))},d.reject=(...d)=>{e.isRejected||e.isFulfilled||(e.isRejected=!0,t(...d))}}));return e.catch(t.Z).finally((()=>{e.notify=e.notifyAll=e.lastNotify=null,e.listeners.length=0,e.cancel&&(e.cancel=t.Z)})),Object.assign(e,d),e}},1352:(d,e,u)=>{u.d(e,{N5:()=>f,SU:()=>t,kC:()=>r});const t="undefined"!=typeof ServiceWorkerGlobalScope&&self instanceof ServiceWorkerGlobalScope,f="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&!t,r=f||t,c=(d,...e)=>{try{d.postMessage(...e)}catch(d){console.error("[worker] postMessage error:",d,e)}},s=(d,...e)=>{self.clients.matchAll({includeUncontrolled:!1,type:"window"}).then((u=>{u.length&&u.slice(d?0:-1).forEach((d=>{c(d,...e)}))}))};t&&s.bind(null,!1),t&&s.bind(null,!0)},319:(d,e,u)=>{function t(){}u.d(e,{Z:()=>t})},8479:(d,e,u)=>{function t(d){if(null===d||"object"!=typeof d)return d;if(d instanceof Date)return new Date(d.getTime());if(Array.isArray(d))return d.map((d=>t(d)));if(ArrayBuffer.isView(d))return d.slice();const e=new d.constructor;for(var u in d)d.hasOwnProperty(u)&&(e[u]=t(d[u]));return e}u.d(e,{Z:()=>t})},6848:(d,e,u)=>{function t(d,e){const u=Object.keys,f=typeof d;return d&&e&&"object"===f&&f===typeof e?u(d).length===u(e).length&&u(d).every((u=>t(d[u],e[u]))):d===e}u.d(e,{Z:()=>t})},5880:(d,e,u)=>{function t(d){return"object"==typeof d&&null!==d}u.d(e,{Z:()=>t})},5953:(d,e,u)=>{function t(d,e){if(e)for(const u in e)void 0!==e[u]&&(d[u]=e[u]);return d}u.d(e,{Z:()=>t})},946:(d,e,u)=>{u.d(e,{Z:()=>r});var t=u(8479),f=u(5880);function r(d,e,u,c,s,n){for(const o in d){const i=n?`${n}.${o}`:o;(null==s?void 0:s.has(i))||(typeof e[o]!=typeof d[o]?(e[o]=(0,t.Z)(d[o]),null==u||u(c||o)):(0,f.Z)(d[o])&&r(d[o],e[o],u,c||o,s,i))}}},4110:(d,e,u)=>{var t=u(7361),f=u(617);String.prototype.toUserId=function(){return(+this).toUserId()},String.prototype.toChatId=function(){return(+this).toChatId()},String.prototype.toPeerId=function(d){return(+this).toPeerId(d)},String.prototype.isPeerId=function(){return/^[\d-]/.test(this.toString())},Number.prototype.toUserId=function(){return this},Number.prototype.toChatId=function(){return Math.abs(this)},Number.prototype.toPeerId=function(d){return void 0===d?this:d?-Math.abs(this):this},Number.prototype.isPeerId=function(){return!0},[["isUser",f.Z],["isAnyChat",t.Z]].forEach((d=>{const e=Array.isArray(d)?d[0]:d,u=Array.isArray(d)?d[1]:d;String.prototype[e]=function(){return u.call(null,this.toString())},Number.prototype[e]=function(){return u.call(null,this)}}))},144:(d,e,u)=>{u.d(e,{a:()=>r,d:()=>f});const t={8:new Uint8Array(1),16:new Uint16Array(1),32:new Uint32Array(1)};function f(d){const e=t[d];return crypto.getRandomValues(e),e[0]}function r(){return""+f(32)+f(32)%16777215}},5466:(d,e,u)=>{u.d(e,{$:()=>f});var t=u(5289);function f(d){return(...e)=>function(d,e,u){const f=performance.now();return(u||console).warn((0,t.Z)(),"start",e),d.then((()=>{(u||console).warn((0,t.Z)(),"end",e,performance.now()-f)})),d}(...e,d)}},5418:(d,e,u)=>{function t(d){return new Promise((e=>{setTimeout(e,d)}))}u.d(e,{Z:()=>t})},6724:(d,e,u)=>{function t(d,e,u=!0){let t,f,r=null;return(...c)=>{t=!0,f=c,r||(u&&(t=!1,d(...f)),r=setInterval((()=>{if(!t)return clearInterval(r),void(r=null);t=!1,d(...f)}),e))}}u.d(e,{Z:()=>t})},9005:(d,e,u)=>{function t(d){return d.charAt(0).toUpperCase()+d.slice(1)}u.d(e,{Z:()=>t})},8453:(d,e,u)=>{u.d(e,{Z:()=>s});var t=u(5936),f=u(3989),r=u(7487),c=u(319);function s(d,e){return Promise.all([f.Z.toggleStorage(d,e),t.Z.toggleStorage(d,e),r.Z.toggleStorage(d,e)]).then(c.Z,c.Z)}},7298:(d,e,u)=>{function t(d){const e=Date.now();return d?e/1e3|0:e}u.d(e,{Z:()=>t})},2790:(d,e,u)=>{u.d(e,{Z:()=>f});var t=u(7082);function f(d){return function(d,e){const u=t.t;if(d{u.d(e,{o:()=>t,t:()=>f});const t=65536,f=4294967295},7361:(d,e,u)=>{function t(d){return+d<0}u.d(e,{Z:()=>t})},617:(d,e,u)=>{function t(d){return+d>=0}u.d(e,{Z:()=>t})},8630:(d,e,u)=>{u.d(e,{Z:()=>n});var t=u(153),f=u(410),r=u(1352);class c extends t.Z{constructor(){super("CRYPTO"),this.lastIndex=-1}invokeCryptoNew({method:d,args:e,transfer:u}){const t={method:d,args:e},f=this.listeners.invoke;if(null==f?void 0:f.length){let d=f[0].callback(t);return r.kC||d instanceof Promise||(d=Promise.resolve(d)),d}const c="aes-encrypt"===d||"aes-decrypt"===d?this.lastIndex=(this.lastIndex+1)%this.sendPorts.length:0;return this.invoke("invoke",t,void 0,this.sendPorts[c],u)}invokeCrypto(d,...e){return this.invokeCryptoNew({method:d,args:e})}}const s=new c;f.GO&&(f.GO.cryptoMessagePort=s);const n=s},5936:(d,e,u)=>{u.d(e,{Z:()=>n});var t=u(1267),f=u(8975),r=u(5753),c=u(5471),s=u(3725);class n{constructor(d){this.dbName=d,this.useStorage=!0,t.Z.test&&(this.dbName+="_test"),n.STORAGES.length&&(this.useStorage=n.STORAGES[0].useStorage),this.openDatabase(),n.STORAGES.push(this)}openDatabase(){var d;return null!==(d=this.openDbPromise)&&void 0!==d?d:this.openDbPromise=caches.open(this.dbName)}delete(d){return this.timeoutOperation((e=>e.delete("/"+d)))}deleteAll(){return caches.delete(this.dbName)}get(d){return this.timeoutOperation((e=>e.match("/"+d)))}save(d,e){return this.timeoutOperation((u=>u.put("/"+d,e)))}getFile(d,e="blob"){return this.get(d).then((d=>{if(!d)throw(0,c.Z)("NO_ENTRY_FOUND");return d[e]()}))}saveFile(d,e){e instanceof Blob||(e=(0,f.Z)(e));const u=new Response(e,{headers:{"Content-Length":""+e.size}});return this.save(d,u).then((()=>e))}timeoutOperation(d){return this.useStorage?new Promise(((e,u)=>{return t=this,f=void 0,c=function*(){let t=!1;const f=setTimeout((()=>{u(),t=!0}),15e3);try{const u=yield this.openDatabase();if(!u)throw this.useStorage=!1,this.openDbPromise=void 0,"no cache?";const f=yield d(u);if(t)return;e(f)}catch(d){u(d)}clearTimeout(f)},new((r=void 0)||(r=Promise))((function(d,e){function u(d){try{n(c.next(d))}catch(d){e(d)}}function s(d){try{n(c.throw(d))}catch(d){e(d)}}function n(e){var t;e.done?d(e.value):(t=e.value,t instanceof r?t:new r((function(d){d(t)}))).then(u,s)}n((c=c.apply(t,f||[])).next())}));var t,f,r,c})):Promise.reject((0,c.Z)("STORAGE_OFFLINE"))}prepareWriting(d,e,u){return{deferred:(0,s.Z)(),getWriter:()=>new r.Z(u,e,(e=>this.saveFile(d,e).catch((()=>e))))}}static toggleStorage(d,e){return Promise.all(this.STORAGES.map((u=>{if(u.useStorage=d,e)return d?void 0:u.deleteAll()})))}}n.STORAGES=[]},5753:(d,e,u)=>{u.d(e,{Z:()=>f});var t=u(8975);class f{constructor(d,e,u){this.mimeType=d,this.size=e,this.saveFileCallback=u,this.bytes=new Uint8Array(e)}write(d,e){return u=this,t=void 0,r=function*(){const u=e+d.byteLength;if(u>this.bytes.byteLength){const d=new Uint8Array(u);d.set(this.bytes,0),this.bytes=d}this.bytes.set(d,e)},new((f=void 0)||(f=Promise))((function(d,e){function c(d){try{n(r.next(d))}catch(d){e(d)}}function s(d){try{n(r.throw(d))}catch(d){e(d)}}function n(e){var u;e.done?d(e.value):(u=e.value,u instanceof f?u:new f((function(d){d(u)}))).then(c,s)}n((r=r.apply(u,t||[])).next())}));var u,t,f,r}truncate(){this.bytes=new Uint8Array}trim(d){this.bytes=this.bytes.slice(0,d)}finalize(d=!0){const e=(0,t.Z)(this.bytes,this.mimeType);return d&&this.saveFileCallback&&this.saveFileCallback(e),e}getParts(){return this.bytes}replaceParts(d){this.bytes=d}}},5003:(d,e,u)=>{u.d(e,{kg:()=>l,v9:()=>t});var t,f=u(410),r=u(4762),c=u(1352),s=u(5289);!function(d){d[d.None=0]="None",d[d.Error=1]="Error",d[d.Warn=2]="Warn",d[d.Log=4]="Log",d[d.Debug=8]="Debug"}(t||(t={}));const n=[t.None,t.Error,t.Warn,t.Log,t.Debug],o=!(r.IS_SAFARI||r.IS_FIREFOX),i="",a="",h=[["debug",t.Debug],["info",t.Log],["warn",t.Warn],["error",t.Error],["assert",t.Error],["trace",t.Log],["group",t.Log],["groupCollapsed",t.Log],["groupEnd",t.Log]];function l(d,e=t.Log|t.Warn|t.Error,u=!1,r=""){let b;f.ZP||u||(e=t.Error),o?r||(c.SU?r=i:c.N5&&(r=a)):r="";const g=r;r=r?`%s ${r}%s`:"%s";const p=function(...u){return e&t.Log&&console.log(r,(0,s.Z)(),d,...u)};return h.forEach((([u,t])=>{p[u]=function(...f){return e&t&&console[u](r,(0,s.Z)(),d,...f)}})),p.setPrefix=function(e){b=e,d="["+e+"]"},p.setPrefix(d),p.setLevel=function(d){e=n.slice(0,d+1).reduce(((d,e)=>d|e),0)},p.bindPrefix=function(d){return l(`${b}] [${d}`,e,u,g)},p}},3206:(d,e,u)=>{u.d(e,{Z:()=>r});var t=u(410),f=u(153);class r extends f.Z{constructor(){super("MTPROTO"),r.INSTANCE=this,t.GO&&(t.GO.mtprotoMessagePort=this)}static getInstance(){return this.INSTANCE}}},690:(d,e,u)=>{var t=u(4903);Uint8Array.prototype.concat=function(...d){return(0,t.Z)(this,...d)},Uint8Array.prototype.toJSON=function(){return[...this]},Promise.prototype.finally=Promise.prototype.finally||function(d){const e=e=>Promise.resolve(d()).then(e);return this.then((d=>e((()=>d))),(d=>e((()=>Promise.reject(d)))))}},6637:(d,e,u)=>{u.d(e,{Z:()=>f});var t=u(2423);function f(d){return d?d.match(t.bu):null}},3655:(d,e,u)=>{u.d(e,{Z:()=>r});var t=u(153),f=u(410);class r extends t.Z{constructor(){super("SERVICE"),f.GO&&(f.GO.serviceMessagePort=this)}}},7487:(d,e,u)=>{u.d(e,{Z:()=>i});var t=u(410),f=u(1267),r=u(1352),c=u(3206);class s{constructor(){this.prefix="",this.cache={},this.useStorage=!0,f.Z.test&&(this.prefix="t_")}get(d,e=!0){if(this.cache.hasOwnProperty(d)&&e)return this.cache[d];if(this.useStorage){let e;try{e=localStorage.getItem(this.prefix+d)}catch(d){this.useStorage=!1}if(null!==e)try{e=JSON.parse(e)}catch(d){}else e=void 0;return e}}set(d,e=!1){for(const u in d)if(d.hasOwnProperty(u)){const t=d[u];if(this.cache[u]=t,this.useStorage&&!e)try{const d=JSON.stringify(t);localStorage.setItem(this.prefix+u,d)}catch(d){this.useStorage=!1}}}delete(d,e=!1){d=""+d,e||delete this.cache[d];try{localStorage.removeItem(this.prefix+d)}catch(d){}}clear(){const d=["dc","server_time_offset","xt_instance","user_auth","state_id","k_build"];for(let e=1;e<=5;++e)d.push(`dc${e}_server_salt`),d.push(`dc${e}_auth_key`);for(const e of d)this.delete(e,!0)}toggleStorage(d,e){if(this.useStorage=d,e)return d?this.set(this.cache):void this.clear()}}class n{constructor(){n.STORAGES.push(this),r.kC||(this.storage=new s)}proxy(d,...e){return u=this,t=void 0,s=function*(){return r.kC?c.Z.getInstance().invoke("localStorageProxy",{type:d,args:e}):(e=Array.prototype.slice.call(e),this.storage[d].apply(this.storage,e))},new((f=void 0)||(f=Promise))((function(d,e){function r(d){try{n(s.next(d))}catch(d){e(d)}}function c(d){try{n(s.throw(d))}catch(d){e(d)}}function n(e){var u;e.done?d(e.value):(u=e.value,u instanceof f?u:new f((function(d){d(u)}))).then(r,c)}n((s=s.apply(u,t||[])).next())}));var u,t,f,s}get(d,e){return this.proxy("get",d,e)}set(d,e){return this.proxy("set",d,e)}delete(d,e){return this.proxy("delete",d,e)}clear(){return this.proxy("clear")}toggleStorage(d,e){return this.proxy("toggleStorage",d,e)}}n.STORAGES=[];const o=new n;t.GO.appStorage=o;const i=o},7922:(d,e,u)=>{u.d(e,{Z:()=>n});var t=u(410),f=u(3989),r=u(3127);class c extends f.Z{constructor(){super(r.Z,"session")}}const s=new c;t.GO.stateStorage=s;const n=s},3989:(d,e,u)=>{u.d(e,{Z:()=>i});var t=u(410),f=u(3725),r=u(1352),c=u(6724),s=u(6666),n=function(d,e,u,t){return new(u||(u=Promise))((function(f,r){function c(d){try{n(t.next(d))}catch(d){r(d)}}function s(d){try{n(t.throw(d))}catch(d){r(d)}}function n(d){var e;d.done?f(d.value):(e=d.value,e instanceof u?e:new u((function(d){d(e)}))).then(c,s)}n((t=t.apply(d,e||[])).next())}))};function o(){}class i{constructor(d,e){this.db=d,this.storeName=e,this.cache={},this.getPromises=new Map,this.keysToSet=new Set,this.saveDeferred=(0,f.Z)(),this.keysToDelete=new Set,this.deleteDeferred=(0,f.Z)(),this.storage=new s.Z(d,e),i.STORAGES.length?this.useStorage=i.STORAGES[0].useStorage:this.useStorage=!0,this.savingFreezed=!1,i.STORAGES.push(this),this.saveThrottled=(0,c.Z)((()=>n(this,void 0,void 0,(function*(){const d=this.saveDeferred;this.saveDeferred=(0,f.Z)();const e=this.keysToSet;if(e.size){const d=Array.from(e.values());e.clear();const u=d.map((d=>this.cache[d]));try{yield this.storage.save(d,u)}catch(e){console.error("[AS]: set error:",e,d,u)}}d.resolve(),e.size&&this.saveThrottled()}))),16,!1),this.deleteThrottled=(0,c.Z)((()=>n(this,void 0,void 0,(function*(){const d=this.deleteDeferred;this.deleteDeferred=(0,f.Z)();const e=this.keysToDelete;if(e.size){const d=Array.from(e.values());e.clear();try{yield this.storage.delete(d)}catch(e){console.error("[AS]: delete error:",e,d)}}d.resolve(),e.size&&this.deleteThrottled()}))),16,!1),this.getThrottled=(0,c.Z)((()=>n(this,void 0,void 0,(function*(){const d=Array.from(this.getPromises.keys());this.storage.get(d).then((e=>{for(let u=0,t=d.length;u{new Set(["NO_ENTRY_FOUND","STORAGE_OFFLINE"]).has(u.type)||(this.useStorage=!1,console.error("[AS]: get error:",u,d,e));for(let e=0,u=d.length;e{this.getPromises.size&&this.getThrottled()}))}))),16,!1)}isAvailable(){return this.useStorage}getCache(){return this.cache}getFromCache(d){return this.cache[d]}setToCache(d,e){return this.cache[d]=e}get(d,e=!0){return n(this,void 0,void 0,(function*(){if(this.cache.hasOwnProperty(d)&&e)return this.getFromCache(d);if(this.useStorage){const e=this.getPromises.get(d);if(e)return e;const u=(0,f.Z)();return this.getPromises.set(d,u),this.getThrottled(),u}}))}getAll(){return this.storage.getAll().catch((()=>[]))}set(d,e=!1){const u=this.useStorage&&!e&&!this.savingFreezed;for(const e in d)if(d.hasOwnProperty(e)){const t=d[e];this.setToCache(e,t),u&&(this.keysToSet.add(e),this.keysToDelete.delete(e),this.saveThrottled())}return u?this.saveDeferred:Promise.resolve()}delete(d,e=!1){return d=""+d,e||delete this.cache[d],this.useStorage&&(this.keysToSet.delete(d),this.keysToDelete.add(d),this.deleteThrottled()),this.useStorage?this.deleteDeferred:Promise.resolve()}clear(d=!1){if(!d)for(const d in this.cache)delete this.cache[d];return this.storage.clear().catch(o)}static toggleStorage(d,e){return Promise.all(this.STORAGES.map((u=>{if(u.useStorage=d,r.kC&&e)return d?u.set(u.cache):(u.keysToSet.clear(),u.keysToDelete.clear(),u.getPromises.forEach((d=>d.resolve(void 0))),u.getPromises.clear(),u.clear(!0))}))).catch(o)}static freezeSaving(d,e){this.STORAGES.forEach((d=>d.savingFreezed=!0));try{d()}catch(d){console.error("freezeSaving callback error:",d)}this.STORAGES.forEach((d=>d.savingFreezed=!1))}}i.STORAGES=[],t.GO&&(t.GO.AppStorage=i)},1229:(d,e,u)=>{u.d(e,{Z:()=>t});const t="((?:👨🏻‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👨🏼‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👨🏽‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👨🏾‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👨🏿‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👩🏻‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👩🏻‍❤️?‍💋‍👩\ud83c[\udffb-\udfff]|👩🏼‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👩🏼‍❤️?‍💋‍👩\ud83c[\udffb-\udfff]|👩🏽‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👩🏽‍❤️?‍💋‍👩\ud83c[\udffb-\udfff]|👩🏾‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👩🏾‍❤️?‍💋‍👩\ud83c[\udffb-\udfff]|👩🏿‍❤️?‍💋‍👨\ud83c[\udffb-\udfff]|👩🏿‍❤️?‍💋‍👩\ud83c[\udffb-\udfff]|🧑🏻‍❤️?‍💋‍🧑\ud83c[\udffc-\udfff]|🧑🏼‍❤️?‍💋‍🧑\ud83c[\udffb\udffd-\udfff]|🧑🏽‍❤️?‍💋‍🧑\ud83c[\udffb\udffc\udffe\udfff]|🧑🏾‍❤️?‍💋‍🧑\ud83c[\udffb-\udffd\udfff]|🧑🏿‍❤️?‍💋‍🧑\ud83c[\udffb-\udffe]|👨🏻‍❤️?‍👨\ud83c[\udffb-\udfff]|👨🏻‍🤝‍👨\ud83c[\udffc-\udfff]|👨🏼‍❤️?‍👨\ud83c[\udffb-\udfff]|👨🏼‍🤝‍👨\ud83c[\udffb\udffd-\udfff]|👨🏽‍❤️?‍👨\ud83c[\udffb-\udfff]|👨🏽‍🤝‍👨\ud83c[\udffb\udffc\udffe\udfff]|👨🏾‍❤️?‍👨\ud83c[\udffb-\udfff]|👨🏾‍🤝‍👨\ud83c[\udffb-\udffd\udfff]|👨🏿‍❤️?‍👨\ud83c[\udffb-\udfff]|👨🏿‍🤝‍👨\ud83c[\udffb-\udffe]|👩🏻‍❤️?‍👨\ud83c[\udffb-\udfff]|👩🏻‍❤️?‍👩\ud83c[\udffb-\udfff]|👩🏻‍🤝‍👨\ud83c[\udffc-\udfff]|👩🏻‍🤝‍👩\ud83c[\udffc-\udfff]|👩🏼‍❤️?‍👨\ud83c[\udffb-\udfff]|👩🏼‍❤️?‍👩\ud83c[\udffb-\udfff]|👩🏼‍🤝‍👨\ud83c[\udffb\udffd-\udfff]|👩🏼‍🤝‍👩\ud83c[\udffb\udffd-\udfff]|👩🏽‍❤️?‍👨\ud83c[\udffb-\udfff]|👩🏽‍❤️?‍👩\ud83c[\udffb-\udfff]|👩🏽‍🤝‍👨\ud83c[\udffb\udffc\udffe\udfff]|👩🏽‍🤝‍👩\ud83c[\udffb\udffc\udffe\udfff]|👩🏾‍❤️?‍👨\ud83c[\udffb-\udfff]|👩🏾‍❤️?‍👩\ud83c[\udffb-\udfff]|👩🏾‍🤝‍👨\ud83c[\udffb-\udffd\udfff]|👩🏾‍🤝‍👩\ud83c[\udffb-\udffd\udfff]|👩🏿‍❤️?‍👨\ud83c[\udffb-\udfff]|👩🏿‍❤️?‍👩\ud83c[\udffb-\udfff]|👩🏿‍🤝‍👨\ud83c[\udffb-\udffe]|👩🏿‍🤝‍👩\ud83c[\udffb-\udffe]|🧑🏻‍❤️?‍🧑\ud83c[\udffc-\udfff]|🧑🏻‍🤝‍🧑\ud83c[\udffb-\udfff]|🧑🏼‍❤️?‍🧑\ud83c[\udffb\udffd-\udfff]|🧑🏼‍🤝‍🧑\ud83c[\udffb-\udfff]|🧑🏽‍❤️?‍🧑\ud83c[\udffb\udffc\udffe\udfff]|🧑🏽‍🤝‍🧑\ud83c[\udffb-\udfff]|🧑🏾‍❤️?‍🧑\ud83c[\udffb-\udffd\udfff]|🧑🏾‍🤝‍🧑\ud83c[\udffb-\udfff]|🧑🏿‍❤️?‍🧑\ud83c[\udffb-\udffe]|🧑🏿‍🤝‍🧑\ud83c[\udffb-\udfff]|👨‍❤️?‍💋‍👨|👩‍❤️?‍💋‍\ud83d[\udc68\udc69]|🫱🏻‍🫲\ud83c[\udffc-\udfff]|🫱🏼‍🫲\ud83c[\udffb\udffd-\udfff]|🫱🏽‍🫲\ud83c[\udffb\udffc\udffe\udfff]|🫱🏾‍🫲\ud83c[\udffb-\udffd\udfff]|🫱🏿‍🫲\ud83c[\udffb-\udffe]|👨‍❤️?‍👨|👩‍❤️?‍\ud83d[\udc68\udc69]|🧑‍🤝‍🧑|👫\ud83c[\udffb-\udfff]|👬\ud83c[\udffb-\udfff]|👭\ud83c[\udffb-\udfff]|💏\ud83c[\udffb-\udfff]|💑\ud83c[\udffb-\udfff]|🤝\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d\udc8f\udc91]|🤝)|(?:\ud83d[\udc68\udc69]|🧑)(?:\ud83c[\udffb-\udfff])?‍(?:⚕️?|⚖️?|✈️?|\ud83c[\udf3e\udf73\udf7c\udf84\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|⛹)(?:(?:\ud83c[\udffb-\udfff]|️?)‍[♀♂]️?)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd4\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?‍[♀♂]️?|(?:👨‍👨‍👦‍👦|👨‍👨‍👧‍\ud83d[\udc66\udc67]|👨‍👩‍👦‍👦|👨‍👩‍👧‍\ud83d[\udc66\udc67]|👩‍👩‍👦‍👦|👩‍👩‍👧‍\ud83d[\udc66\udc67]|👨‍👦‍👦|👨‍👧‍\ud83d[\udc66\udc67]|👨‍👨‍\ud83d[\udc66\udc67]|👨‍👩‍\ud83d[\udc66\udc67]|👩‍👦‍👦|👩‍👧‍\ud83d[\udc66\udc67]|👩‍👩‍\ud83d[\udc66\udc67]|🏳️?‍⚧️?|🏳️?‍🌈|😶‍🌫️?|❤️?‍🔥|❤️?‍🩹|🏴‍☠️?|🐕‍🦺|🐻‍❄️?|👁‍🗨|👨‍\ud83d[\udc66\udc67]|👩‍\ud83d[\udc66\udc67]|👯‍♀️?|👯‍♂️?|😮‍💨|😵‍💫|🤼‍♀️?|🤼‍♂️?|🧞‍♀️?|🧞‍♂️?|🧟‍♀️?|🧟‍♂️?|🐈‍⬛)|[#*0-9]️??⃣|(?:[©®™♟]️?)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[‼⁉ℹ↔-↙↩↪⌚⌛⌨⏏⏭-⏯⏱⏲⏸-⏺Ⓜ▪▫▶◀◻-◾☀-☄☎☑☔☕☘☠☢☣☦☪☮☯☸-☺♀♂♈-♓♠♣♥♦♨♻♿⚒-⚗⚙⚛⚜⚠⚡⚧⚪⚫⚰⚱⚽⚾⛄⛅⛈⛏⛑⛓⛔⛩⛪⛰-⛵⛸⛺⛽✂✈✉✏✒✔✖✝✡✳✴❄❇❗❣❤➡⤴⤵⬅-⬇⬛⬜⭐⭕〰〽㊗㊙])(?:️?|(?!︎))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[☝⛷⛹✌✍])(?:️?|(?!︎))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd\udec3-\udec5\udef0-\udef6]|[✊✋]))(?:\ud83c[\udffb-\udfff])?|(?:🏴󠁧󠁢󠁥󠁮󠁧󠁿|🏴󠁧󠁢󠁳󠁣󠁴󠁿|🏴󠁧󠁢󠁷󠁬󠁳󠁿|🇦\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|🇧\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|🇨\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|🇩\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|🇪\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|🇫\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|🇬\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|🇭\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|🇮\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|🇯\ud83c[\uddea\uddf2\uddf4\uddf5]|🇰\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|🇱\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|🇲\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|🇳\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|🇴🇲|🇵\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|🇶🇦|🇷\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|🇸\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|🇹\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|🇺\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|🇻\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|🇼\ud83c[\uddeb\uddf8]|🇽🇰|🇾\ud83c[\uddea\uddf9]|🇿\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udc8e\udc90\udc92-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5-\uded7\udedd-\udedf\udeeb\udeec\udef4-\udefc\udfe0-\udfeb\udff0]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78-\uddb4\uddb7\uddba\uddbc-\uddcc\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7c\ude80-\ude86\ude90-\udeac\udeb0-\udeba\udec0-\udec2\uded0-\uded9\udee0-\udee7]|[⏩-⏬⏰⏳♾⛎✅✨❌❎❓-❕➕-➗➰➿])|️)"}}]); +//# sourceMappingURL=110.109af56006a419549840.bundle.js.map \ No newline at end of file diff --git a/public/110.b39868e78bf4adf7dd36.bundle.js.map b/public/110.109af56006a419549840.bundle.js.map similarity index 99% rename from public/110.b39868e78bf4adf7dd36.bundle.js.map rename to public/110.109af56006a419549840.bundle.js.map index 72eee4a8..0d503b88 100644 --- a/public/110.b39868e78bf4adf7dd36.bundle.js.map +++ b/public/110.109af56006a419549840.bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"110.b39868e78bf4adf7dd36.bundle.js","mappings":"kHAaO,MAAMA,EAAe,CAAC,mBAAoB,qBAE3CC,EAAUC,KAAKC,IAAI,EAAgC,QAA7B,EAAAC,UAAUC,2BAAmB,QAAI,GAEvDC,EAAM,CACVC,GAAI,QACJC,KAAM,mCACNC,QAAS,QACTC,YAAa,cACbC,MAAO,IACPC,gBAAiB,QACjBC,SAAU,OACVC,aAAc,KACdC,QAASf,EACTgB,SAAU,EACVC,aAAcjB,EAAakB,SAASC,SAASC,UAC7CC,OAAQ,IACRpB,UACAqB,cAAerB,GAGdK,EAAIW,eACLX,EAAIC,GAAK,KACTD,EAAIE,KAAO,oCAGb,S,kCC9BA,MA8BA,EA9ByG,CACvGe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,oBAA6ClL,EAAqBkR,GACvE5M,KAAK+E,SAASjK,SAAS+L,GAAYA,EAAQ+E,eAAgB,IAC3D,IACElQ,G,CACA,MAAMqB,GACNC,QAAQC,MAAM,+BAAgCF,E,CAEhDiD,KAAK+E,SAASjK,SAAS+L,GAAYA,EAAQ+E,eAAgB,GAC7D,EArRe,EAAA7G,SAA6C,GA4R9D,OAAmB,gBAA4BmG,E,kCCvU/C,MACA,EADuB,gwN","sources":["webpack://tweb/./src/config/app.ts","webpack://tweb/./src/config/databases/state.ts","webpack://tweb/./src/helpers/blob/blobConstruct.ts","webpack://tweb/./src/helpers/blob/blobSafeMimeType.ts","webpack://tweb/./src/helpers/bytes/bufferConcats.ts","webpack://tweb/./src/helpers/cancellablePromise.ts","webpack://tweb/./src/helpers/context.ts","webpack://tweb/./src/helpers/noop.ts","webpack://tweb/./src/helpers/object/copy.ts","webpack://tweb/./src/helpers/object/deepEqual.ts","webpack://tweb/./src/helpers/object/isObject.ts","webpack://tweb/./src/helpers/object/safeAssign.ts","webpack://tweb/./src/helpers/object/validateInitObject.ts","webpack://tweb/./src/helpers/peerIdPolyfill.ts","webpack://tweb/./src/helpers/random.ts","webpack://tweb/./src/helpers/recordPromise.ts","webpack://tweb/./src/helpers/schedulers/pause.ts","webpack://tweb/./src/helpers/schedulers/throttle.ts","webpack://tweb/./src/helpers/string/capitalizeFirstLetter.ts","webpack://tweb/./src/helpers/toggleStorages.ts","webpack://tweb/./src/helpers/tsNow.ts","webpack://tweb/./src/lib/appManagers/utils/messageId/getServerMessageId.ts","webpack://tweb/./src/lib/appManagers/utils/messageId/clearMessageId.ts","webpack://tweb/./src/lib/appManagers/utils/messageId/index.ts","webpack://tweb/./src/lib/appManagers/utils/peers/isAnyChat.ts","webpack://tweb/./src/lib/appManagers/utils/peers/isUser.ts","webpack://tweb/./src/lib/crypto/cryptoMessagePort.ts","webpack://tweb/./src/lib/files/cacheStorage.ts","webpack://tweb/./src/lib/files/memoryWriter.ts","webpack://tweb/./src/lib/logger.ts","webpack://tweb/./src/lib/mtproto/mtprotoMessagePort.ts","webpack://tweb/./src/lib/polyfill.ts","webpack://tweb/./src/lib/richTextProcessor/matchUrlProtocol.ts","webpack://tweb/./src/lib/serviceWorker/serviceMessagePort.ts","webpack://tweb/./src/lib/localStorage.ts","webpack://tweb/./src/lib/sessionStorage.ts","webpack://tweb/./src/lib/stateStorage.ts","webpack://tweb/./src/lib/storage.ts","webpack://tweb/./src/vendor/emoji/regex.ts"],"sourcesContent":["/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {DcId} from '../types';\n\nexport const MAIN_DOMAINS = ['web.telegram.org', 'webk.telegram.org'];\n\nconst threads = Math.min(4, navigator.hardwareConcurrency ?? 4);\n\nconst App = {\n id: +process.env.API_ID,\n hash: process.env.API_HASH,\n version: process.env.VERSION,\n versionFull: process.env.VERSION_FULL,\n build: +process.env.BUILD,\n langPackVersion: '1.0.1',\n langPack: 'webk',\n langPackCode: 'en',\n domains: MAIN_DOMAINS,\n baseDcId: 2 as DcId,\n isMainDomain: MAIN_DOMAINS.includes(location.hostname),\n suffix: 'K',\n threads,\n cryptoWorkers: threads\n};\n\nif(App.isMainDomain) { // use Webogram credentials then\n App.id = 2496;\n App.hash = '8da85b0d5bfe62527e5b244c209159c3';\n}\n\nexport default App;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Database} from '.';\nimport type {IDBIndex} from '../../lib/files/idb';\n\nconst DATABASE_STATE: Database<'session' | 'stickerSets' | 'users' | 'chats' | 'messages' | 'dialogs'> = {\n name: 'tweb',\n version: 7,\n stores: [{\n name: 'session'\n }, {\n name: 'stickerSets'\n }, {\n name: 'users'\n }, {\n name: 'chats'\n }, {\n name: 'dialogs'\n // indexes: [\n // ...(new Array(20 + 2).fill(0)).map((_, idx) => {\n // const name = `index_${idx}`;\n // const index: IDBIndex = {\n // indexName: name,\n // keyPath: name,\n // objectParameters: {}\n // };\n\n // return index\n // })\n // ]\n }, {\n name: 'messages'\n }]\n};\n\nexport default DATABASE_STATE;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport blobSafeMimeType from './blobSafeMimeType';\n\nexport default function blobConstruct(blobParts: Array | T, mimeType: string = ''): Blob {\n if(!Array.isArray(blobParts)) {\n blobParts = [blobParts];\n }\n\n const safeMimeType = blobSafeMimeType(mimeType);\n const blob = new Blob(blobParts, {type: safeMimeType});\n return blob;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\n// https://www.iana.org/assignments/media-types/media-types.xhtml\nexport default function blobSafeMimeType(mimeType: string) {\n if([\n 'image/jpeg',\n 'image/png',\n 'image/gif',\n 'image/svg+xml',\n 'image/webp',\n 'image/bmp',\n 'video/mp4',\n 'video/webm',\n 'video/quicktime',\n 'audio/ogg',\n 'audio/mpeg',\n 'audio/mp4',\n 'audio/wav', // though it is not in list\n 'application/json',\n 'application/pdf'\n ].indexOf(mimeType) === -1) {\n return 'application/octet-stream';\n }\n\n return mimeType;\n}\n","export default function bufferConcats(...args: (ArrayBuffer | Uint8Array | number[])[]) {\n const length = args.reduce((acc, v) => acc + ((v as ArrayBuffer).byteLength || (v as Uint8Array).length), 0);\n\n const tmp = new Uint8Array(length);\n\n let lastLength = 0;\n args.forEach((b) => {\n tmp.set(b instanceof ArrayBuffer ? new Uint8Array(b) : b, lastLength);\n lastLength += (b as ArrayBuffer).byteLength || (b as Uint8Array).length;\n });\n\n return tmp/* .buffer */;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport noop from './noop';\n\nexport interface CancellablePromise extends Promise {\n resolve?: (value: T) => void,\n reject?: (...args: any[]) => void,\n cancel?: (reason?: any) => void,\n\n notify?: (...args: any[]) => void,\n notifyAll?: (...args: any[]) => void,\n lastNotify?: any,\n listeners?: Array<(...args: any[]) => void>,\n addNotifyListener?: (callback: (...args: any[]) => void) => void,\n\n isFulfilled?: boolean,\n isRejected?: boolean\n}\n\nexport default function deferredPromise() {\n const deferredHelper: any = {\n isFulfilled: false,\n isRejected: false,\n\n notify: () => {},\n notifyAll: (...args: any[]) => {\n deferredHelper.lastNotify = args;\n deferredHelper.listeners.forEach((callback: any) => callback(...args));\n },\n\n listeners: [],\n addNotifyListener: (callback: (...args: any[]) => void) => {\n if(deferredHelper.lastNotify) {\n callback(...deferredHelper.lastNotify);\n }\n\n deferredHelper.listeners.push(callback);\n }\n };\n\n const deferred: CancellablePromise = new Promise((resolve, reject) => {\n deferredHelper.resolve = (value: T) => {\n if(deferred.isFulfilled || deferred.isRejected) return;\n\n deferred.isFulfilled = true;\n resolve(value);\n };\n\n deferredHelper.reject = (...args: any[]) => {\n if(deferred.isRejected || deferred.isFulfilled) return;\n\n deferred.isRejected = true;\n reject(...args);\n };\n });\n\n // @ts-ignore\n /* deferred.then = (resolve: (value: T) => any, reject: (...args: any[]) => any) => {\n const n = deferredPromise>();\n\n }; */\n\n deferred.catch(noop).finally(() => {\n deferred.notify = deferred.notifyAll = deferred.lastNotify = null;\n deferred.listeners.length = 0;\n\n if(deferred.cancel) {\n deferred.cancel = noop;\n }\n });\n\n Object.assign(deferred, deferredHelper);\n\n return deferred;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// в SW может быть сразу две переменных TRUE\nexport const IS_SERVICE_WORKER = typeof ServiceWorkerGlobalScope !== 'undefined' && self instanceof ServiceWorkerGlobalScope;\nexport const IS_WEB_WORKER = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope && !IS_SERVICE_WORKER;\nexport const IS_WORKER = IS_WEB_WORKER || IS_SERVICE_WORKER;\n\nexport const getWindowClients = () => {\n return (self as any as ServiceWorkerGlobalScope)\n .clients\n .matchAll({includeUncontrolled: false, type: 'window'});\n};\n\nexport const getLastWindowClient = () => getWindowClients().then((windowClients) => windowClients.slice(-1)[0]);\n\nconst postMessage = (listener: WindowClient | DedicatedWorkerGlobalScope, ...args: any[]) => {\n try {\n // @ts-ignore\n listener.postMessage(...args);\n } catch(err) {\n console.error('[worker] postMessage error:', err, args);\n }\n};\n\nconst notifyServiceWorker = (all: boolean, ...args: any[]) => {\n getWindowClients().then((listeners) => {\n if(!listeners.length) {\n // console.trace('no listeners?', self, listeners);\n return;\n }\n\n listeners.slice(all ? 0 : -1).forEach((listener) => {\n postMessage(listener, ...args);\n });\n });\n};\n\nconst notifyWorker = (...args: any[]) => {\n postMessage(self as any as DedicatedWorkerGlobalScope, ...args);\n};\n\nconst noop = () => {};\n\nexport const notifySomeone = IS_SERVICE_WORKER ? notifyServiceWorker.bind(null, false) : (IS_WEB_WORKER ? notifyWorker : noop);\nexport const notifyAll = IS_SERVICE_WORKER ? notifyServiceWorker.bind(null, true) : (IS_WEB_WORKER ? notifyWorker : noop);\n","export default function noop() {}\n","export default function copy(obj: T): T {\n // in case of premitives\n if(obj === null || typeof(obj) !== 'object') {\n return obj;\n }\n\n // date objects should be\n if(obj instanceof Date) {\n return new Date(obj.getTime()) as any;\n }\n\n // handle Array\n if(Array.isArray(obj)) {\n // @ts-ignore\n const clonedArr: T = obj.map((el) => copy(el)) as any as T;\n return clonedArr;\n }\n\n if(ArrayBuffer.isView(obj)) {\n // @ts-ignore\n return obj.slice();\n }\n\n // lastly, handle objects\n // @ts-ignore\n const clonedObj = new obj.constructor();\n for(var prop in obj) {\n if(obj.hasOwnProperty(prop)) {\n clonedObj[prop] = copy(obj[prop]);\n }\n }\n return clonedObj;\n}\n","export default function deepEqual(x: any, y: any): boolean {\n const ok = Object.keys, tx = typeof x, ty = typeof y;\n return x && y && tx === 'object' && tx === ty ? (\n ok(x).length === ok(y).length &&\n ok(x).every((key) => deepEqual(x[key], y[key]))\n ) : (x === y);\n}\n","export default function isObject>(object: any): object is T {\n return typeof(object) === 'object' && object !== null;\n}\n","export default function safeAssign(object: T, fromObject: any) {\n if(fromObject) {\n for(const i in fromObject) {\n if(fromObject[i] !== undefined) {\n // @ts-ignore\n object[i] = fromObject[i];\n }\n }\n }\n\n return object;\n}\n","import copy from './copy';\nimport isObject from './isObject';\n\nexport default function validateInitObject(\n initObject: any,\n currentObject: any,\n onReplace?: (key: string) => void,\n previousKey?: string,\n ignorePaths?: Set,\n path?: string\n) {\n for(const key in initObject) {\n const _path = path ? `${path}.${key}` : key;\n if(ignorePaths?.has(_path)) {\n continue;\n }\n\n if(typeof(currentObject[key]) !== typeof(initObject[key])) {\n currentObject[key] = copy(initObject[key]);\n onReplace?.(previousKey || key);\n } else if(isObject(initObject[key])) {\n validateInitObject(initObject[key], currentObject[key], onReplace, previousKey || key, ignorePaths, _path);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport isAnyChat from '../lib/appManagers/utils/peers/isAnyChat';\nimport isUser from '../lib/appManagers/utils/peers/isUser';\n\nString.prototype.toUserId = function() {\n return (+this).toUserId();\n};\n\nString.prototype.toChatId = function() {\n return (+this).toChatId();\n};\n\nString.prototype.toPeerId = function(isChat?: boolean) {\n return (+this).toPeerId(isChat);\n};\n\nString.prototype.isPeerId = function() {\n return /^[\\d-]/.test(this.toString());\n};\n\nNumber.prototype.toUserId = function() {\n return this as any;\n};\n\nNumber.prototype.toChatId = function() {\n return Math.abs(this as any);\n};\n\nNumber.prototype.toPeerId = function(isChat?: boolean) {\n return isChat === undefined ? this as number : (isChat ? -Math.abs(this as number) : this as number);\n};\n\nNumber.prototype.isPeerId = function() {\n return true;\n};\n\n[\n ['isUser' as const, isUser],\n ['isAnyChat' as const, isAnyChat]\n].forEach((value) => {\n const newMethod = Array.isArray(value) ? value[0] : value;\n const originMethod = Array.isArray(value) ? value[1] : value;\n // @ts-ignore\n String.prototype[newMethod] = function() {\n // @ts-ignore\n // eslint-disable-next-line no-useless-call\n return originMethod.call(null, this.toString());\n };\n\n // @ts-ignore\n Number.prototype[newMethod] = function() {\n // @ts-ignore\n // eslint-disable-next-line no-useless-call\n return originMethod.call(null, this);\n };\n});\n\ndeclare global {\n interface String {\n toUserId(): UserId;\n toChatId(): ChatId;\n toPeerId(isChat?: boolean): PeerId;\n isPeerId(): this is string;\n\n isUser(): boolean;\n isAnyChat(): boolean;\n }\n\n interface Number {\n toUserId(): UserId;\n toChatId(): ChatId;\n toPeerId(isChat?: boolean): PeerId;\n isPeerId(): this is PeerId;\n\n isUser(): boolean;\n isAnyChat(): boolean;\n }\n}\n\nexport {};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nconst arrays = {\n 8: new Uint8Array(1),\n 16: new Uint16Array(1),\n 32: new Uint32Array(1)\n};\nexport function nextRandomUint(bits: 8 | 16 | 32) {\n const array = arrays[bits];\n crypto.getRandomValues(array);\n return array[0];\n}\n\nexport function randomLong() {\n return '' + nextRandomUint(32) + nextRandomUint(32) % 0xFFFFFF;\n}\n","import {logger} from '../lib/logger';\nimport dT from './dT';\n\nexport function recordPromise>(promise: T, description: string, log?: ReturnType | Console) {\n const perf = performance.now();\n (log || console).warn(dT(), 'start', description);\n promise.then(() => {\n (log || console).warn(dT(), 'end', description, performance.now() - perf);\n });\n return promise;\n}\n\nexport function recordPromiseBound(log: ReturnType | Console) {\n return (...args: [Parameters[0], Parameters[1]]) => {\n return recordPromise(...args, log);\n };\n}\n","export default function pause(ms: number) {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n","// * Jolly Cobra's schedulers\n\nimport {AnyToVoidFunction} from '../../types';\n\nexport default function throttle(\n fn: F,\n ms: number,\n shouldRunFirst = true\n) {\n let interval: number | null = null;\n let isPending: boolean;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n isPending = true;\n args = _args;\n\n if(!interval) {\n if(shouldRunFirst) {\n isPending = false;\n // @ts-ignore\n fn(...args);\n }\n\n interval = setInterval(() => {\n if(!isPending) {\n clearInterval(interval!);\n interval = null;\n return;\n }\n\n isPending = false;\n // @ts-ignore\n fn(...args);\n }, ms) as any;\n }\n };\n}\n","export default function capitalizeFirstLetter(string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport CacheStorageController from '../lib/files/cacheStorage';\nimport AppStorage from '../lib/storage';\nimport sessionStorage from '../lib/sessionStorage';\nimport noop from './noop';\n\nexport default function toggleStorages(enabled: boolean, clearWrite: boolean) {\n return Promise.all([\n AppStorage.toggleStorage(enabled, clearWrite),\n CacheStorageController.toggleStorage(enabled, clearWrite),\n sessionStorage.toggleStorage(enabled, clearWrite)\n ]).then(noop, noop);\n}\n","export default function tsNow(seconds?: true) {\n const t = Date.now();\n return seconds ? t / 1000 | 0 : t;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport clearMessageId from './clearMessageId';\n\n/**\n * * will ignore outgoing offset\n */\nexport default function getServerMessageId(messageId: number) {\n return clearMessageId(messageId, true);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MESSAGE_ID_OFFSET, MESSAGE_ID_INCREMENT} from '.';\n\nexport default function clearMessageId(messageId: number, toServer?: boolean) {\n const q = MESSAGE_ID_OFFSET;\n if(messageId < q) { // id 0 -> mid 0xFFFFFFFF, so 0xFFFFFFFF must convert to 0\n return messageId;\n }\n\n const l = MESSAGE_ID_INCREMENT - 1;\n const used = messageId & l;\n if(used !== l) {\n messageId -= used + 1;\n }\n\n return toServer ? (messageId - q) / MESSAGE_ID_INCREMENT : messageId;\n}\n","export const MESSAGE_ID_INCREMENT = 0x10000;\nexport const MESSAGE_ID_OFFSET = 0xFFFFFFFF;\n","export default function isAnyChat(peerId: PeerId) {\n return +peerId < 0;\n}\n","export default function isUser(peerId: PeerId) {\n return +peerId >= 0;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {CryptoMethods} from './crypto_methods';\nimport SuperMessagePort from '../mtproto/superMessagePort';\nimport {Awaited} from '../../types';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport {IS_WORKER} from '../../helpers/context';\n\ntype CryptoEvent = {\n invoke: (payload: {method: T, args: Parameters}) => ReturnType,\n port: (payload: void, source: MessageEventSource, event: MessageEvent) => void,\n terminate: () => void\n};\n\nexport class CryptoMessagePort extends SuperMessagePort {\n private lastIndex: number;\n\n constructor() {\n super('CRYPTO');\n this.lastIndex = -1;\n }\n\n public invokeCryptoNew({method, args, transfer}: {\n method: T,\n args: Parameters,\n transfer?: Transferable[]\n }): Promise>> {\n const payload = {method, args};\n const listeners = this.listeners['invoke'];\n if(listeners?.length) { // already in worker\n // try {\n // @ts-ignore\n let result: any = listeners[0].callback(payload);\n if(!IS_WORKER && !(result instanceof Promise)) {\n result = Promise.resolve(result);\n }\n\n return result;\n // } catch(err) {\n // return Promise.reject(err);\n // }\n }\n\n const sendPortIndex = method === 'aes-encrypt' || method === 'aes-decrypt' ?\n this.lastIndex = (this.lastIndex + 1) % this.sendPorts.length :\n 0;\n // @ts-ignore\n return this.invoke('invoke', payload, undefined, this.sendPorts[sendPortIndex], transfer);\n }\n\n public invokeCrypto(method: T, ...args: Parameters): Promise>> {\n return this.invokeCryptoNew({method, args});\n }\n}\n\nconst cryptoMessagePort = new CryptoMessagePort();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.cryptoMessagePort = cryptoMessagePort);\nexport default cryptoMessagePort;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Modes from '../../config/modes';\nimport blobConstruct from '../../helpers/blob/blobConstruct';\nimport MemoryWriter from './memoryWriter';\nimport FileManager from './memoryWriter';\nimport FileStorage from './fileStorage';\nimport makeError from '../../helpers/makeError';\nimport deferredPromise from '../../helpers/cancellablePromise';\n\nexport type CacheStorageDbName = 'cachedFiles' | 'cachedStreamChunks' | 'cachedAssets';\n\nexport default class CacheStorageController implements FileStorage {\n private static STORAGES: CacheStorageController[] = [];\n private openDbPromise: Promise;\n\n private useStorage = true;\n\n // private log: ReturnType = logger('CS');\n\n constructor(private dbName: CacheStorageDbName) {\n if(Modes.test) {\n this.dbName += '_test';\n }\n\n if(CacheStorageController.STORAGES.length) {\n this.useStorage = CacheStorageController.STORAGES[0].useStorage;\n }\n\n this.openDatabase();\n CacheStorageController.STORAGES.push(this);\n }\n\n private openDatabase(): Promise {\n return this.openDbPromise ?? (this.openDbPromise = caches.open(this.dbName));\n }\n\n public delete(entryName: string) {\n return this.timeoutOperation((cache) => cache.delete('/' + entryName));\n }\n\n public deleteAll() {\n return caches.delete(this.dbName);\n }\n\n public get(entryName: string) {\n return this.timeoutOperation((cache) => cache.match('/' + entryName));\n }\n\n public save(entryName: string, response: Response) {\n // return new Promise((resolve) => {}); // DEBUG\n return this.timeoutOperation((cache) => cache.put('/' + entryName, response));\n }\n\n public getFile(fileName: string, method: 'blob' | 'json' | 'text' = 'blob'): Promise {\n // if(method === 'blob') {\n // return Promise.reject(makeError('NO_ENTRY_FOUND'));\n // }\n\n // const str = `get fileName: ${fileName}`;\n // console.time(str);\n return this.get(fileName).then((response) => {\n if(!response) {\n // console.warn('getFile:', response, fileName);\n throw makeError('NO_ENTRY_FOUND');\n }\n\n const promise = response[method]();\n // promise.then(() => {\n // console.timeEnd(str);\n // });\n return promise;\n });\n }\n\n public saveFile(fileName: string, blob: Blob | Uint8Array) {\n // return Promise.resolve(blobConstruct([blob]));\n if(!(blob instanceof Blob)) {\n blob = blobConstruct(blob);\n }\n\n const response = new Response(blob, {\n headers: {\n 'Content-Length': '' + blob.size\n }\n });\n\n return this.save(fileName, response).then(() => blob as Blob);\n }\n\n public timeoutOperation(callback: (cache: Cache) => Promise) {\n if(!this.useStorage) {\n return Promise.reject(makeError('STORAGE_OFFLINE'));\n }\n\n return new Promise(async(resolve, reject) => {\n let rejected = false;\n const timeout = setTimeout(() => {\n reject();\n // console.warn('CACHESTORAGE TIMEOUT');\n rejected = true;\n }, 15e3);\n\n try {\n const cache = await this.openDatabase();\n if(!cache) {\n this.useStorage = false;\n this.openDbPromise = undefined;\n throw 'no cache?';\n }\n\n const res = await callback(cache);\n\n if(rejected) return;\n resolve(res);\n } catch(err) {\n reject(err);\n }\n\n clearTimeout(timeout);\n });\n }\n\n public prepareWriting(fileName: string, fileSize: number, mimeType: string) {\n return {\n deferred: deferredPromise(),\n getWriter: () => {\n const writer = new MemoryWriter(mimeType, fileSize, (blob) => {\n return this.saveFile(fileName, blob).catch(() => blob);\n });\n\n return writer;\n }\n };\n }\n\n public static toggleStorage(enabled: boolean, clearWrite: boolean) {\n return Promise.all(this.STORAGES.map((storage) => {\n storage.useStorage = enabled;\n\n if(!clearWrite) {\n return;\n }\n\n if(!enabled) {\n return storage.deleteAll();\n }\n }));\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport blobConstruct from '../../helpers/blob/blobConstruct';\nimport StreamWriter from './streamWriter';\n\nexport default class MemoryWriter implements StreamWriter {\n private bytes: Uint8Array;\n\n constructor(\n private mimeType: string,\n private size: number,\n private saveFileCallback?: (blob: Blob) => Promise\n ) {\n this.bytes = new Uint8Array(size);\n }\n\n public async write(part: Uint8Array, offset: number) {\n // sometimes file size can be bigger than the prov\n const endOffset = offset + part.byteLength;\n if(endOffset > this.bytes.byteLength) {\n const newBytes = new Uint8Array(endOffset);\n newBytes.set(this.bytes, 0);\n this.bytes = newBytes;\n }\n\n this.bytes.set(part, offset);\n };\n\n public truncate() {\n this.bytes = new Uint8Array();\n }\n\n public trim(size: number) {\n this.bytes = this.bytes.slice(0, size);\n }\n\n public finalize(saveToStorage = true) {\n const blob = blobConstruct(this.bytes, this.mimeType);\n\n if(saveToStorage && this.saveFileCallback) {\n this.saveFileCallback(blob);\n }\n\n return blob;\n }\n\n public getParts() {\n return this.bytes;\n }\n\n public replaceParts(parts: Uint8Array) {\n this.bytes = parts;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport DEBUG from '../config/debug';\nimport {IS_FIREFOX, IS_SAFARI} from '../environment/userAgent';\nimport {IS_SERVICE_WORKER, IS_WEB_WORKER} from '../helpers/context';\nimport dT from '../helpers/dT';\n\nexport enum LogTypes {\n None = 0,\n Error = 1,\n Warn = 2,\n Log = 4,\n Debug = 8\n};\n\nexport const LOG_LEVELS = [LogTypes.None, LogTypes.Error, LogTypes.Warn, LogTypes.Log, LogTypes.Debug];\n\nconst IS_WEBKIT = IS_SAFARI || IS_FIREFOX;\n\n// let getCallerFunctionNameFromLine: (line: string) => string;\n// if(IS_WEBKIT) {\n// getCallerFunctionNameFromLine = (line) => {\n// const splitted = line.split('@');\n// return splitted[0];\n// };\n// } else {\n// getCallerFunctionNameFromLine = (line: string) => {\n// const splitted = line.trim().split(' ');\n// if(splitted.length === 3) {\n// return splitted[1].slice(splitted[1].lastIndexOf('.') + 1);\n// }\n// };\n// }\n\nconst STYLES_SUPPORTED = !IS_WEBKIT;\n// const LINE_INDEX = IS_WEBKIT ? 2 : 3;\n\n// function getCallerFunctionName() {\n// const stack = new Error().stack;\n// const lines = stack.split('\\n');\n// const line = lines[LINE_INDEX] || lines[lines.length - 1];\n// // const match = line.match(/\\.([^\\.]+?)\\s/);\n// // line = match ? match[1] : line.trim();\n// const caller = getCallerFunctionNameFromLine(line) || '';\n// return '[' + caller + ']';\n// }\n\nexport const LOGGER_STYLES = {\n reset: '\\x1b[0m',\n bright: '\\x1b[1m',\n dim: '\\x1b[2m',\n underscore: '\\x1b[4m',\n blink: '\\x1b[5m',\n reverse: '\\x1b[7m',\n hidden: '\\x1b[8m',\n // Foreground (text) colors\n fg: {\n black: '\\x1b[30m',\n red: '\\x1b[31m',\n green: '\\x1b[32m',\n yellow: '\\x1b[33m',\n blue: '\\x1b[34m',\n magenta: '\\x1b[35m',\n cyan: '\\x1b[36m',\n white: '\\x1b[37m'\n },\n // Background colors\n bg: {\n black: '\\x1b[40m',\n red: '\\x1b[41m',\n green: '\\x1b[42m',\n yellow: '\\x1b[43m',\n blue: '\\x1b[44m',\n magenta: '\\x1b[45m',\n cyan: '\\x1b[46m',\n white: '\\x1b[47m'\n }\n};\n\nexport type Logger = {\n (...args: any[]): void;\n warn(...args: any[]): void;\n info(...args: any[]): void;\n error(...args: any[]): void;\n trace(...args: any[]): void;\n debug(...args: any[]): void;\n assert(...args: any[]): void;\n // log(...args: any[]): void;\n group(...args: any[]): void;\n groupCollapsed(...args: any[]): void;\n groupEnd(...args: any[]): void;\n setPrefix(newPrefix: string): void;\n setLevel(level: 0 | 1 | 2 | 3 | 4): void;\n bindPrefix(prefix: string): Logger;\n};\n\nconst methods: ['debug' | 'info' | 'warn' | 'error' | 'assert' | 'trace'/* | 'log' */ | 'group' | 'groupCollapsed' | 'groupEnd', LogTypes][] = [\n ['debug', LogTypes.Debug],\n ['info', LogTypes.Log],\n ['warn', LogTypes.Warn],\n ['error', LogTypes.Error],\n ['assert', LogTypes.Error],\n ['trace', LogTypes.Log],\n ['group', LogTypes.Log],\n ['groupCollapsed', LogTypes.Log],\n ['groupEnd', LogTypes.Log]\n // [\"log\", LogTypes.Log]\n];\n\nexport function logger(prefix: string, type: LogTypes = LogTypes.Log | LogTypes.Warn | LogTypes.Error, ignoreDebugReset = false, style = ''): Logger {\n let originalPrefix: string;\n if(!DEBUG && !ignoreDebugReset/* || true */) {\n type = LogTypes.Error;\n }\n\n if(!STYLES_SUPPORTED) {\n style = '';\n } else if(!style) {\n if(IS_SERVICE_WORKER) style = LOGGER_STYLES.fg.yellow;\n else if(IS_WEB_WORKER) style = LOGGER_STYLES.fg.cyan;\n }\n\n const originalStyle = style;\n if(style) style = `%s ${style}%s`;\n else style = '%s';\n\n // level = LogLevels.log | LogLevels.warn | LogLevels.error | LogLevels.debug\n\n const log: Logger = function(...args: any[]) {\n return type & LogTypes.Log && console.log(style, dT(), prefix, /* getCallerFunctionName(), */ ...args);\n } as any;\n\n methods.forEach(([method, logType]) => {\n log[method] = function(...args: any[]) {\n return type & logType && console[method](style, dT(), prefix, /* getCallerFunctionName(), */ ...args);\n };\n });\n\n log.setPrefix = function(newPrefix: string) {\n originalPrefix = newPrefix;\n prefix = '[' + newPrefix + ']';\n };\n\n log.setPrefix(prefix);\n\n log.setLevel = function(level: 0 | 1 | 2 | 3 | 4) {\n type = LOG_LEVELS.slice(0, level + 1).reduce((acc, v) => acc | v, 0) as any;\n };\n\n log.bindPrefix = function(prefix: string) {\n return logger(`${originalPrefix}] [${prefix}`, type, ignoreDebugReset, originalStyle);\n };\n\n return log;\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport type {getEnvironment} from '../../environment/utils';\nimport type loadState from '../appManagers/utils/state/loadState';\nimport type {StoragesResults} from '../appManagers/utils/storages/loadStorages';\nimport type {LocalStorageProxyTask} from '../localStorage';\nimport type {Awaited} from '../../types';\nimport type {Mirrors, MirrorTaskPayload, NotificationBuildTaskPayload, TabState} from './mtprotoworker';\nimport type toggleStorages from '../../helpers/toggleStorages';\nimport SuperMessagePort from './superMessagePort';\n\nexport type MTProtoManagerTaskPayload = {name: string, method: string, args: any[]};\n\ntype MTProtoBroadcastEvent = {\n event: (payload: {name: string, args: any[]}, source: MessageEventSource) => void\n};\n\nexport default class MTProtoMessagePort extends SuperMessagePort<{\n environment: (environment: ReturnType) => void,\n crypto: (payload: {method: string, args: any[]}) => Promise,\n state: (payload: {userId: UserId} & Awaited> & {storagesResults?: StoragesResults}) => void,\n manager: (payload: MTProtoManagerTaskPayload) => any,\n toggleStorages: (payload: {enabled: boolean, clearWrite: boolean}) => ReturnType,\n serviceWorkerOnline: (online: boolean) => void,\n serviceWorkerPort: (payload: void, source: MessageEventSource, event: MessageEvent) => void,\n cryptoPort: (payload: void, source: MessageEventSource, event: MessageEvent) => void,\n createObjectURL: (blob: Blob) => string,\n tabState: (payload: TabState, source: MessageEventSource) => void,\n createProxyWorkerURLs: (payload: {originalUrl: string, blob: Blob}) => string[],\n} & MTProtoBroadcastEvent, {\n convertWebp: (payload: {fileName: string, bytes: Uint8Array}) => Promise,\n convertOpus: (payload: {fileName: string, bytes: Uint8Array}) => Promise,\n localStorageProxy: (payload: LocalStorageProxyTask['payload']) => Promise,\n mirror: (payload: MirrorTaskPayload) => void,\n notificationBuild: (payload: NotificationBuildTaskPayload) => void,\n // hello: () => void\n} & MTProtoBroadcastEvent, Master> {\n private static INSTANCE: MTProtoMessagePort;\n\n constructor() {\n super('MTPROTO');\n\n MTProtoMessagePort.INSTANCE = this;\n\n MOUNT_CLASS_TO && (MOUNT_CLASS_TO.mtprotoMessagePort = this);\n }\n\n public static getInstance() {\n return this.INSTANCE as MTProtoMessagePort;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport bufferConcats from '../helpers/bytes/bufferConcats';\n\nUint8Array.prototype.concat = function(...args: Array) {\n return bufferConcats(this, ...args);\n};\n\n/* Uint8Array.prototype.toString = function() {\n return String.fromCharCode.apply(null, [...this]);\n}; */\n\nUint8Array.prototype.toJSON = function() {\n return [...this];\n // return {type: 'bytes', value: [...this]};\n};\n\nPromise.prototype.finally = Promise.prototype.finally || function(this: Promise, fn: () => any) {\n const onFinally = (callback: typeof fn) => Promise.resolve(fn()).then(callback);\n return this.then(\n result => onFinally(() => result),\n reason => onFinally(() => Promise.reject(reason))\n );\n};\n\ndeclare global {\n interface Uint8Array {\n concat: (...args: Array) => Uint8Array,\n // toString: () => string,\n toJSON: () => number[],\n // toJSON: () => {type: 'bytes', value: number[]},\n }\n\n interface Promise {\n finally: (onfinally?: () => void) => Promise;\n }\n}\n","import {URL_ANY_PROTOCOL_REG_EXP} from '.';\n\nexport default function matchUrlProtocol(text: string) {\n return !text ? null : text.match(URL_ANY_PROTOCOL_REG_EXP);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {WebPushApiManager} from '../mtproto/webPushApiManager';\nimport type {PushNotificationObject} from './push';\nimport type {MyUploadFile} from '../mtproto/apiFileManager';\nimport SuperMessagePort from '../mtproto/superMessagePort';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\n\nexport type ServicePushPingTaskPayload = {\n localNotifications: boolean,\n lang: {\n push_action_mute1d: string\n push_action_settings: string\n push_message_nopreview: string\n },\n settings: WebPushApiManager['settings']\n};\n\nexport type ServiceRequestFilePartTaskPayload = {\n docId: DocId,\n dcId: number,\n offset: number,\n limit: number\n};\n\nexport type ServiceDownloadTaskPayload = {\n headers: any,\n id: string\n};\n\nexport type ServiceEvent = {\n port: (payload: void, source: MessageEventSource, event: MessageEvent) => void\n};\n\nexport default class ServiceMessagePort extends SuperMessagePort<{\n // from main thread to service worker\n notificationsClear: () => void,\n toggleStorages: (payload: {enabled: boolean, clearWrite: boolean}) => void,\n pushPing: (payload: ServicePushPingTaskPayload, source: MessageEventSource, event: MessageEvent) => void,\n hello: (payload: void, source: MessageEventSource, event: MessageEvent) => void,\n shownNotification: (payload: string) => void,\n\n // from mtproto worker\n download: (payload: ServiceDownloadTaskPayload) => void,\n downloadChunk: (payload: {id: ServiceDownloadTaskPayload['id'], chunk: Uint8Array}) => void\n downloadFinalize: (payload: ServiceDownloadTaskPayload['id']) => void,\n downloadCancel: (payload: ServiceDownloadTaskPayload['id']) => void\n}, {\n // to main thread\n pushClick: (payload: PushNotificationObject) => void,\n hello: (payload: void, source: MessageEventSource) => void,\n share: (payload: ShareData) => void,\n\n // to mtproto worker\n requestFilePart: (payload: ServiceRequestFilePartTaskPayload) => Promise | MyUploadFile\n} & ServiceEvent, Master> {\n constructor() {\n super('SERVICE');\n\n MOUNT_CLASS_TO && (MOUNT_CLASS_TO.serviceMessagePort = this);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport Modes from '../config/modes';\nimport {IS_WORKER} from '../helpers/context';\nimport {WorkerTaskTemplate} from '../types';\nimport MTProtoMessagePort from './mtproto/mtprotoMessagePort';\n// import { stringify } from '../helpers/json';\n\nclass LocalStorage> {\n private prefix = '';\n private cache: Partial = {};\n private useStorage = true;\n\n constructor(/* private preserveKeys: (keyof Storage)[] */) {\n if(Modes.test) {\n this.prefix = 't_';\n }\n }\n\n public get(key: T, useCache = true): Storage[T] {\n if(this.cache.hasOwnProperty(key) && useCache) {\n return this.cache[key];\n } else if(this.useStorage) {\n let value: Storage[T];\n try {\n value = localStorage.getItem(this.prefix + (key as string)) as any;\n } catch(err) {\n this.useStorage = false;\n }\n\n if(value !== null) {\n try {\n value = JSON.parse(value);\n } catch(err) {\n // console.error(err);\n }\n } else {\n value = undefined;\n }\n\n return value;\n }/* else {\n throw 'something went wrong';\n } */\n }\n\n public set(obj: Partial, onlyLocal = false) {\n for(const key in obj) {\n if(obj.hasOwnProperty(key)) {\n const value = obj[key];\n this.cache[key] = value;\n\n if(this.useStorage && !onlyLocal) {\n try {\n const stringified = JSON.stringify(value);\n localStorage.setItem(this.prefix + key, stringified);\n } catch(err) {\n this.useStorage = false;\n }\n }\n }\n }\n }\n\n public delete(key: keyof Storage, saveLocal = false) {\n // ! it is needed here\n key = '' + (key as string);\n\n if(!saveLocal) {\n delete this.cache[key];\n }\n\n // if(this.useStorage) {\n try {\n localStorage.removeItem(this.prefix + (key as string));\n } catch(err) {\n\n }\n // }\n }\n\n /* public clear(preserveKeys: (keyof Storage)[] = this.preserveKeys) {\n // if(this.useStorage) {\n try {\n let obj: Partial = {};\n if(preserveKeys) {\n preserveKeys.forEach((key) => {\n const value = this.get(key);\n if(value !== undefined) {\n obj[key] = value;\n }\n });\n }\n\n localStorage.clear();\n\n if(preserveKeys) {\n this.set(obj);\n }\n } catch(err) {\n\n }\n // }\n } */\n\n public clear() {\n const keys: string[] = ['dc', 'server_time_offset', 'xt_instance', 'user_auth', 'state_id', 'k_build'];\n for(let i = 1; i <= 5; ++i) {\n keys.push(`dc${i}_server_salt`);\n keys.push(`dc${i}_auth_key`);\n }\n\n for(const key of keys) {\n this.delete(key, true);\n }\n }\n\n public toggleStorage(enabled: boolean, clearWrite: boolean) {\n this.useStorage = enabled;\n\n if(!clearWrite) {\n return;\n }\n\n if(!enabled) {\n this.clear();\n } else {\n return this.set(this.cache);\n }\n }\n}\n\nexport interface LocalStorageProxyTask extends WorkerTaskTemplate {\n type: 'localStorageProxy',\n payload: {\n type: 'set' | 'get' | 'delete' | 'clear' | 'toggleStorage',\n args: any[]\n }\n};\n\nexport interface LocalStorageProxyTaskResponse extends WorkerTaskTemplate {\n type: 'localStorageProxy',\n payload: any\n};\n\nexport default class LocalStorageController> {\n private static STORAGES: LocalStorageController[] = [];\n // private log = (...args: any[]) => console.log('[SW LS]', ...args);\n // private log = (...args: any[]) => {};\n\n private storage: LocalStorage;\n\n constructor(/* private preserveKeys: (keyof Storage)[] = [] */) {\n LocalStorageController.STORAGES.push(this);\n\n if(!IS_WORKER) {\n this.storage = new LocalStorage(/* preserveKeys */);\n }\n }\n\n private async proxy(type: LocalStorageProxyTask['payload']['type'], ...args: LocalStorageProxyTask['payload']['args']): Promise {\n if(IS_WORKER) {\n const port = MTProtoMessagePort.getInstance();\n return port.invoke('localStorageProxy', {type, args});\n }\n\n args = Array.prototype.slice.call(args);\n\n // @ts-ignore\n return this.storage[type].apply(this.storage, args as any);\n }\n\n public get(key: T, useCache?: boolean) {\n return this.proxy('get', key, useCache);\n }\n\n public set(obj: Partial, onlyLocal?: boolean) {\n return this.proxy('set', obj, onlyLocal);\n }\n\n public delete(key: keyof Storage, saveLocal?: boolean) {\n return this.proxy('delete', key, saveLocal);\n }\n\n public clear(/* preserveKeys?: (keyof Storage)[] */) {\n return this.proxy('clear'/* , preserveKeys */);\n }\n\n public toggleStorage(enabled: boolean, clearWrite: boolean) {\n return this.proxy('toggleStorage', enabled, clearWrite);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AppInstance} from './mtproto/singleInstance';\nimport type {UserAuth} from './mtproto/mtproto_config';\nimport type {DcId} from '../types';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport LocalStorageController from './localStorage';\n\nconst sessionStorage = new LocalStorageController<{\n dc: DcId,\n user_auth: UserAuth,\n state_id: number,\n dc1_auth_key: string,\n dc2_auth_key: string,\n dc3_auth_key: string,\n dc4_auth_key: string,\n dc5_auth_key: string,\n dc1_server_salt: string,\n dc2_server_salt: string,\n dc3_server_salt: string,\n dc4_server_salt: string,\n dc5_server_salt: string,\n server_time_offset: number,\n xt_instance: AppInstance,\n kz_version: 'K' | 'Z',\n tgme_sync: {\n canRedirect: boolean,\n ts: number\n },\n k_build: number\n}>(/* ['kz_version'] */);\nMOUNT_CLASS_TO.appStorage = sessionStorage;\nexport default sessionStorage;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {ChatSavedPosition} from './appManagers/appImManager';\nimport type {AppDraftsManager} from './appManagers/appDraftsManager';\nimport type {State} from '../config/state';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport {LangPackDifference} from '../layer';\nimport AppStorage from './storage';\nimport DATABASE_STATE from '../config/databases/state';\n\nclass StateStorage extends AppStorage<{\n chatPositions: {\n [peerId_threadId: string]: ChatSavedPosition\n },\n langPack: LangPackDifference,\n drafts: AppDraftsManager['drafts'],\n user_auth: any, // support old webk format\n} & State, typeof DATABASE_STATE> {\n constructor() {\n super(DATABASE_STATE, 'session');\n }\n}\n\nconst stateStorage = new StateStorage();\nMOUNT_CLASS_TO.stateStorage = stateStorage;\nexport default stateStorage;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {Database} from '../config/databases';\nimport {MOUNT_CLASS_TO} from '../config/debug';\n// import DATABASE_SESSION from \"../config/databases/session\";\nimport deferredPromise, {CancellablePromise} from '../helpers/cancellablePromise';\nimport {IS_WORKER} from '../helpers/context';\nimport throttle from '../helpers/schedulers/throttle';\n// import { WorkerTaskTemplate } from \"../types\";\nimport IDBStorage from './files/idb';\n\nfunction noop() {}\n\n/* export interface LocalStorageProxySetTask extends WorkerTaskTemplate {\n type: 'localStorageProxy',\n payload: {\n type: 'set',\n keys: string[],\n values: any[]\n }\n};\n\nexport interface LocalStorageProxyDeleteTask extends WorkerTaskTemplate {\n type: 'localStorageProxy',\n payload: {\n type: 'delete',\n keys: string[]\n }\n}; */\n\nconst THROTTLE_TIME = 16;\n\n/* Storage extends {[name: string]: any} *//* Storage extends Record */\nexport default class AppStorage<\n Storage extends Record,\n T extends Database\n> {\n private static STORAGES: AppStorage>[] = [];\n private storage: IDBStorage;// new CacheStorageController('session');\n\n // private cache: Partial<{[key: string]: Storage[typeof key]}> = {};\n private cache: Partial = {};\n private useStorage: boolean;\n private savingFreezed: boolean;\n\n private getPromises: Map> = new Map();\n private getThrottled: () => void;\n\n private keysToSet: Set = new Set();\n private saveThrottled: () => void;\n private saveDeferred = deferredPromise();\n\n private keysToDelete: Set = new Set();\n private deleteThrottled: () => void;\n private deleteDeferred = deferredPromise();\n\n constructor(private db: T, private storeName: typeof db['stores'][number]['name']) {\n this.storage = new IDBStorage(db, storeName);\n\n if(AppStorage.STORAGES.length) {\n this.useStorage = AppStorage.STORAGES[0].useStorage;\n } else {\n this.useStorage = true;\n }\n\n this.savingFreezed = false;\n\n AppStorage.STORAGES.push(this);\n\n this.saveThrottled = throttle(async() => {\n const deferred = this.saveDeferred;\n this.saveDeferred = deferredPromise();\n\n const set = this.keysToSet;\n if(set.size) {\n const keys = Array.from(set.values()) as string[];\n set.clear();\n\n const values = keys.map((key) => this.cache[key]);\n try {\n // console.log('setItem: will set', key/* , value */);\n // await this.cacheStorage.delete(key); // * try to prevent memory leak in Chrome leading to 'Unexpected internal error.'\n // await this.storage.save(key, new Response(value, {headers: {'Content-Type': 'application/json'}}));\n\n /* if(db === DATABASE_SESSION && !('localStorage' in self)) { // * support legacy Webogram's localStorage\n self.postMessage({\n type: 'localStorageProxy',\n payload: {\n type: 'set',\n keys,\n values\n }\n } as LocalStorageProxySetTask);\n } */\n\n await this.storage.save(keys, values);\n // console.log('setItem: have set', key/* , value */);\n } catch(e) {\n // this.useCS = false;\n console.error('[AS]: set error:', e, keys, values);\n }\n }\n\n deferred.resolve();\n\n if(set.size) {\n this.saveThrottled();\n }\n }, THROTTLE_TIME, false);\n\n this.deleteThrottled = throttle(async() => {\n const deferred = this.deleteDeferred;\n this.deleteDeferred = deferredPromise();\n\n const set = this.keysToDelete;\n if(set.size) {\n const keys = Array.from(set.values()) as string[];\n set.clear();\n\n try {\n /* if(db === DATABASE_SESSION && !('localStorage' in self)) { // * support legacy Webogram's localStorage\n self.postMessage({\n type: 'localStorageProxy',\n payload: {\n type: 'delete',\n keys\n }\n } as LocalStorageProxyDeleteTask);\n } */\n\n await this.storage.delete(keys);\n } catch(e) {\n console.error('[AS]: delete error:', e, keys);\n }\n }\n\n deferred.resolve();\n\n if(set.size) {\n this.deleteThrottled();\n }\n }, THROTTLE_TIME, false);\n\n this.getThrottled = throttle(async() => {\n const keys = Array.from(this.getPromises.keys());\n\n // const perf = performance.now();\n this.storage.get(keys as string[]).then((values) => {\n for(let i = 0, length = keys.length; i < length; ++i) {\n const key = keys[i];\n const deferred = this.getPromises.get(key);\n if(deferred) {\n // @ts-ignore\n deferred.resolve(this.cache[key] = values[i]);\n this.getPromises.delete(key);\n }\n }\n\n // console.log('[AS]: get time', keys, performance.now() - perf);\n }, (error: ApiError) => {\n const ignoreErrors: Set = new Set(['NO_ENTRY_FOUND', 'STORAGE_OFFLINE']);\n if(!ignoreErrors.has(error.type)) {\n this.useStorage = false;\n console.error('[AS]: get error:', error, keys, storeName);\n }\n\n for(let i = 0, length = keys.length; i < length; ++i) {\n const key = keys[i];\n const deferred = this.getPromises.get(key);\n if(deferred) {\n // deferred.reject(error);\n deferred.resolve(undefined);\n this.getPromises.delete(key);\n }\n }\n }).finally(() => {\n if(this.getPromises.size) {\n this.getThrottled();\n }\n });\n }, THROTTLE_TIME, false);\n }\n\n public isAvailable() {\n return this.useStorage;\n }\n\n public getCache() {\n return this.cache;\n }\n\n public getFromCache(key: T) {\n return this.cache[key];\n }\n\n public setToCache(key: keyof Storage, value: Storage[typeof key]) {\n return this.cache[key] = value;\n }\n\n public async get(key: T, useCache = true): Promise {\n if(this.cache.hasOwnProperty(key) && useCache) {\n return this.getFromCache(key);\n } else if(this.useStorage) {\n const r = this.getPromises.get(key);\n if(r) return r as any;\n\n const p = deferredPromise();\n this.getPromises.set(key, p as any);\n\n this.getThrottled();\n\n return p;\n }/* else {\n throw 'something went wrong';\n } */\n }\n\n public getAll() {\n return this.storage.getAll().catch(() => []);\n }\n\n public set(obj: Partial, onlyLocal = false) {\n // console.log('storageSetValue', obj, callback, arguments);\n\n const canUseStorage = this.useStorage && !onlyLocal && !this.savingFreezed;\n for(const key in obj) {\n if(obj.hasOwnProperty(key)) {\n const value = obj[key];\n this.setToCache(key, value);\n\n // let perf = /* DEBUG */false ? performance.now() : 0;\n // value = JSON.stringify(value);\n\n // if(perf) {\n // let elapsedTime = performance.now() - perf;\n // if(elapsedTime > 10) {\n // console.warn('LocalStorage set: stringify time by JSON.stringify:', elapsedTime, key);\n // }\n // }\n\n /* perf = performance.now();\n value = stringify(value);\n console.log('LocalStorage set: stringify time by own stringify:', performance.now() - perf); */\n\n if(canUseStorage) {\n this.keysToSet.add(key);\n this.keysToDelete.delete(key);\n this.saveThrottled();\n }\n }\n }\n\n return canUseStorage ? this.saveDeferred : Promise.resolve();\n }\n\n public delete(key: keyof Storage, saveLocal = false) {\n /* if(!this.cache.hasOwnProperty(key)) {\n return;\n } */\n\n // ! it is needed here\n key = '' + (key as string);\n\n if(!saveLocal) {\n delete this.cache[key];\n }\n\n if(this.useStorage) {\n this.keysToSet.delete(key);\n this.keysToDelete.add(key);\n this.deleteThrottled();\n }\n\n return this.useStorage ? this.deleteDeferred : Promise.resolve();\n }\n\n public clear(saveLocal = false) {\n if(!saveLocal) {\n for(const i in this.cache) {\n delete this.cache[i];\n }\n }\n\n return this.storage.clear().catch(noop);\n }\n\n public static toggleStorage(enabled: boolean, clearWrite: boolean) {\n return Promise.all(this.STORAGES.map((storage) => {\n storage.useStorage = enabled;\n\n if(!IS_WORKER || !clearWrite) {\n return;\n }\n\n if(!enabled) {\n storage.keysToSet.clear();\n storage.keysToDelete.clear();\n storage.getPromises.forEach((deferred) => deferred.resolve(undefined));\n storage.getPromises.clear();\n return storage.clear(true);\n } else {\n return storage.set(storage.cache);\n }\n })).catch(noop);\n }\n\n public static freezeSaving>(callback: () => any, names: T['stores'][number]['name'][]) {\n this.STORAGES.forEach((storage) => storage.savingFreezed = true);\n try {\n callback();\n } catch(err) {\n console.error('freezeSaving callback error:', err);\n }\n this.STORAGES.forEach((storage) => storage.savingFreezed = false);\n }\n\n /* public deleteDatabase() {\n return IDBStorage.deleteDatabase().catch(noop);\n } */\n}\n\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.AppStorage = AppStorage);\n","// Copyright Twitter Inc. Licensed under MIT\n// https://github.com/twitter/twemoji-parser/blob/master/LICENSE.md\n\nconst originalString = '((?:\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f?\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f?\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f?\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f?\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f?\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\udef1\\ud83c\\udffb\\u200d\\ud83e\\udef2\\ud83c[\\udffc-\\udfff]|\\ud83e\\udef1\\ud83c\\udffc\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\udef1\\ud83c\\udffd\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\udef1\\ud83c\\udffe\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\udef1\\ud83c\\udfff\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f?\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1|\\ud83d\\udc6b\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6c\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6d\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc8f\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc91\\ud83c[\\udffb-\\udfff]|\\ud83e\\udd1d\\ud83c[\\udffb-\\udfff]|\\ud83d[\\udc6b-\\udc6d\\udc8f\\udc91]|\\ud83e\\udd1d)|(?:\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1)(?:\\ud83c[\\udffb-\\udfff])?\\u200d(?:\\u2695\\ufe0f?|\\u2696\\ufe0f?|\\u2708\\ufe0f?|\\ud83c[\\udf3e\\udf73\\udf7c\\udf84\\udf93\\udfa4\\udfa8\\udfeb\\udfed]|\\ud83d[\\udcbb\\udcbc\\udd27\\udd2c\\ude80\\ude92]|\\ud83e[\\uddaf-\\uddb3\\uddbc\\uddbd])|(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75]|\\u26f9)(?:(?:\\ud83c[\\udffb-\\udfff]|\\ufe0f?)\\u200d[\\u2640\\u2642]\\ufe0f?)|(?:\\ud83c[\\udfc3\\udfc4\\udfca]|\\ud83d[\\udc6e\\udc70\\udc71\\udc73\\udc77\\udc81\\udc82\\udc86\\udc87\\ude45-\\ude47\\ude4b\\ude4d\\ude4e\\udea3\\udeb4-\\udeb6]|\\ud83e[\\udd26\\udd35\\udd37-\\udd39\\udd3d\\udd3e\\uddb8\\uddb9\\uddcd-\\uddcf\\uddd4\\uddd6-\\udddd])(?:\\ud83c[\\udffb-\\udfff])?\\u200d[\\u2640\\u2642]\\ufe0f?|(?:\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83c\\udff3\\ufe0f?\\u200d\\u26a7\\ufe0f?|\\ud83c\\udff3\\ufe0f?\\u200d\\ud83c\\udf08|\\ud83d\\ude36\\u200d\\ud83c\\udf2b\\ufe0f?|\\u2764\\ufe0f?\\u200d\\ud83d\\udd25|\\u2764\\ufe0f?\\u200d\\ud83e\\ude79|\\ud83c\\udff4\\u200d\\u2620\\ufe0f?|\\ud83d\\udc15\\u200d\\ud83e\\uddba|\\ud83d\\udc3b\\u200d\\u2744\\ufe0f?|\\ud83d\\udc41\\u200d\\ud83d\\udde8|\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc6f\\u200d\\u2640\\ufe0f?|\\ud83d\\udc6f\\u200d\\u2642\\ufe0f?|\\ud83d\\ude2e\\u200d\\ud83d\\udca8|\\ud83d\\ude35\\u200d\\ud83d\\udcab|\\ud83e\\udd3c\\u200d\\u2640\\ufe0f?|\\ud83e\\udd3c\\u200d\\u2642\\ufe0f?|\\ud83e\\uddde\\u200d\\u2640\\ufe0f?|\\ud83e\\uddde\\u200d\\u2642\\ufe0f?|\\ud83e\\udddf\\u200d\\u2640\\ufe0f?|\\ud83e\\udddf\\u200d\\u2642\\ufe0f?|\\ud83d\\udc08\\u200d\\u2b1b)|[#*0-9]\\ufe0f??\\u20e3|(?:[©®\\u2122\\u265f]\\ufe0f?)|(?:\\ud83c[\\udc04\\udd70\\udd71\\udd7e\\udd7f\\ude02\\ude1a\\ude2f\\ude37\\udf21\\udf24-\\udf2c\\udf36\\udf7d\\udf96\\udf97\\udf99-\\udf9b\\udf9e\\udf9f\\udfcd\\udfce\\udfd4-\\udfdf\\udff3\\udff5\\udff7]|\\ud83d[\\udc3f\\udc41\\udcfd\\udd49\\udd4a\\udd6f\\udd70\\udd73\\udd76-\\udd79\\udd87\\udd8a-\\udd8d\\udda5\\udda8\\uddb1\\uddb2\\uddbc\\uddc2-\\uddc4\\uddd1-\\uddd3\\udddc-\\uddde\\udde1\\udde3\\udde8\\uddef\\uddf3\\uddfa\\udecb\\udecd-\\udecf\\udee0-\\udee5\\udee9\\udef0\\udef3]|[\\u203c\\u2049\\u2139\\u2194-\\u2199\\u21a9\\u21aa\\u231a\\u231b\\u2328\\u23cf\\u23ed-\\u23ef\\u23f1\\u23f2\\u23f8-\\u23fa\\u24c2\\u25aa\\u25ab\\u25b6\\u25c0\\u25fb-\\u25fe\\u2600-\\u2604\\u260e\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262a\\u262e\\u262f\\u2638-\\u263a\\u2640\\u2642\\u2648-\\u2653\\u2660\\u2663\\u2665\\u2666\\u2668\\u267b\\u267f\\u2692-\\u2697\\u2699\\u269b\\u269c\\u26a0\\u26a1\\u26a7\\u26aa\\u26ab\\u26b0\\u26b1\\u26bd\\u26be\\u26c4\\u26c5\\u26c8\\u26cf\\u26d1\\u26d3\\u26d4\\u26e9\\u26ea\\u26f0-\\u26f5\\u26f8\\u26fa\\u26fd\\u2702\\u2708\\u2709\\u270f\\u2712\\u2714\\u2716\\u271d\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u2764\\u27a1\\u2934\\u2935\\u2b05-\\u2b07\\u2b1b\\u2b1c\\u2b50\\u2b55\\u3030\\u303d\\u3297\\u3299])(?:\\ufe0f?|(?!\\ufe0e))|(?:(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75\\udd90]|[\\u261d\\u26f7\\u26f9\\u270c\\u270d])(?:\\ufe0f?|(?!\\ufe0e))|(?:\\ud83c[\\udf85\\udfc2-\\udfc4\\udfc7\\udfca]|\\ud83d[\\udc42\\udc43\\udc46-\\udc50\\udc66-\\udc69\\udc6e\\udc70-\\udc78\\udc7c\\udc81-\\udc83\\udc85-\\udc87\\udcaa\\udd7a\\udd95\\udd96\\ude45-\\ude47\\ude4b-\\ude4f\\udea3\\udeb4-\\udeb6\\udec0\\udecc]|\\ud83e[\\udd0c\\udd0f\\udd18-\\udd1c\\udd1e\\udd1f\\udd26\\udd30-\\udd39\\udd3d\\udd3e\\udd77\\uddb5\\uddb6\\uddb8\\uddb9\\uddbb\\uddcd-\\uddcf\\uddd1-\\udddd\\udec3-\\udec5\\udef0-\\udef6]|[\\u270a\\u270b]))(?:\\ud83c[\\udffb-\\udfff])?|(?:\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc65\\udb40\\udc6e\\udb40\\udc67\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc73\\udb40\\udc63\\udb40\\udc74\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc77\\udb40\\udc6c\\udb40\\udc73\\udb40\\udc7f|\\ud83c\\udde6\\ud83c[\\udde8-\\uddec\\uddee\\uddf1\\uddf2\\uddf4\\uddf6-\\uddfa\\uddfc\\uddfd\\uddff]|\\ud83c\\udde7\\ud83c[\\udde6\\udde7\\udde9-\\uddef\\uddf1-\\uddf4\\uddf6-\\uddf9\\uddfb\\uddfc\\uddfe\\uddff]|\\ud83c\\udde8\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\uddee\\uddf0-\\uddf5\\uddf7\\uddfa-\\uddff]|\\ud83c\\udde9\\ud83c[\\uddea\\uddec\\uddef\\uddf0\\uddf2\\uddf4\\uddff]|\\ud83c\\uddea\\ud83c[\\udde6\\udde8\\uddea\\uddec\\udded\\uddf7-\\uddfa]|\\ud83c\\uddeb\\ud83c[\\uddee-\\uddf0\\uddf2\\uddf4\\uddf7]|\\ud83c\\uddec\\ud83c[\\udde6\\udde7\\udde9-\\uddee\\uddf1-\\uddf3\\uddf5-\\uddfa\\uddfc\\uddfe]|\\ud83c\\udded\\ud83c[\\uddf0\\uddf2\\uddf3\\uddf7\\uddf9\\uddfa]|\\ud83c\\uddee\\ud83c[\\udde8-\\uddea\\uddf1-\\uddf4\\uddf6-\\uddf9]|\\ud83c\\uddef\\ud83c[\\uddea\\uddf2\\uddf4\\uddf5]|\\ud83c\\uddf0\\ud83c[\\uddea\\uddec-\\uddee\\uddf2\\uddf3\\uddf5\\uddf7\\uddfc\\uddfe\\uddff]|\\ud83c\\uddf1\\ud83c[\\udde6-\\udde8\\uddee\\uddf0\\uddf7-\\uddfb\\uddfe]|\\ud83c\\uddf2\\ud83c[\\udde6\\udde8-\\udded\\uddf0-\\uddff]|\\ud83c\\uddf3\\ud83c[\\udde6\\udde8\\uddea-\\uddec\\uddee\\uddf1\\uddf4\\uddf5\\uddf7\\uddfa\\uddff]|\\ud83c\\uddf4\\ud83c\\uddf2|\\ud83c\\uddf5\\ud83c[\\udde6\\uddea-\\udded\\uddf0-\\uddf3\\uddf7-\\uddf9\\uddfc\\uddfe]|\\ud83c\\uddf6\\ud83c\\udde6|\\ud83c\\uddf7\\ud83c[\\uddea\\uddf4\\uddf8\\uddfa\\uddfc]|\\ud83c\\uddf8\\ud83c[\\udde6-\\uddea\\uddec-\\uddf4\\uddf7-\\uddf9\\uddfb\\uddfd-\\uddff]|\\ud83c\\uddf9\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\udded\\uddef-\\uddf4\\uddf7\\uddf9\\uddfb\\uddfc\\uddff]|\\ud83c\\uddfa\\ud83c[\\udde6\\uddec\\uddf2\\uddf3\\uddf8\\uddfe\\uddff]|\\ud83c\\uddfb\\ud83c[\\udde6\\udde8\\uddea\\uddec\\uddee\\uddf3\\uddfa]|\\ud83c\\uddfc\\ud83c[\\uddeb\\uddf8]|\\ud83c\\uddfd\\ud83c\\uddf0|\\ud83c\\uddfe\\ud83c[\\uddea\\uddf9]|\\ud83c\\uddff\\ud83c[\\udde6\\uddf2\\uddfc]|\\ud83c[\\udccf\\udd8e\\udd91-\\udd9a\\udde6-\\uddff\\ude01\\ude32-\\ude36\\ude38-\\ude3a\\ude50\\ude51\\udf00-\\udf20\\udf2d-\\udf35\\udf37-\\udf7c\\udf7e-\\udf84\\udf86-\\udf93\\udfa0-\\udfc1\\udfc5\\udfc6\\udfc8\\udfc9\\udfcf-\\udfd3\\udfe0-\\udff0\\udff4\\udff8-\\udfff]|\\ud83d[\\udc00-\\udc3e\\udc40\\udc44\\udc45\\udc51-\\udc65\\udc6a\\udc6f\\udc79-\\udc7b\\udc7d-\\udc80\\udc84\\udc88-\\udc8e\\udc90\\udc92-\\udca9\\udcab-\\udcfc\\udcff-\\udd3d\\udd4b-\\udd4e\\udd50-\\udd67\\udda4\\uddfb-\\ude44\\ude48-\\ude4a\\ude80-\\udea2\\udea4-\\udeb3\\udeb7-\\udebf\\udec1-\\udec5\\uded0-\\uded2\\uded5-\\uded7\\udedd-\\udedf\\udeeb\\udeec\\udef4-\\udefc\\udfe0-\\udfeb\\udff0]|\\ud83e[\\udd0d\\udd0e\\udd10-\\udd17\\udd20-\\udd25\\udd27-\\udd2f\\udd3a\\udd3c\\udd3f-\\udd45\\udd47-\\udd76\\udd78-\\uddb4\\uddb7\\uddba\\uddbc-\\uddcc\\uddd0\\uddde-\\uddff\\ude70-\\ude74\\ude78-\\ude7c\\ude80-\\ude86\\ude90-\\udeac\\udeb0-\\udeba\\udec0-\\udec2\\uded0-\\uded9\\udee0-\\udee7]|[\\u23e9-\\u23ec\\u23f0\\u23f3\\u267e\\u26ce\\u2705\\u2728\\u274c\\u274e\\u2753-\\u2755\\u2795-\\u2797\\u27b0\\u27bf\\ue50a])|\\ufe0f)';\nexport default originalString;\n"],"names":["MAIN_DOMAINS","threads","Math","min","navigator","hardwareConcurrency","App","id","hash","version","versionFull","build","langPackVersion","langPack","langPackCode","domains","baseDcId","isMainDomain","includes","location","hostname","suffix","cryptoWorkers","name","stores","blobConstruct","blobParts","mimeType","Array","isArray","safeMimeType","Blob","type","blobSafeMimeType","indexOf","bufferConcats","args","length","reduce","acc","v","byteLength","tmp","Uint8Array","lastLength","forEach","b","set","ArrayBuffer","deferredPromise","deferredHelper","isFulfilled","isRejected","notify","notifyAll","lastNotify","listeners","callback","addNotifyListener","push","deferred","Promise","resolve","reject","value","catch","finally","cancel","Object","assign","IS_SERVICE_WORKER","ServiceWorkerGlobalScope","self","IS_WEB_WORKER","WorkerGlobalScope","IS_WORKER","postMessage","listener","err","console","error","notifyServiceWorker","all","clients","matchAll","includeUncontrolled","then","slice","bind","noop","copy","obj","Date","getTime","map","el","isView","clonedObj","constructor","prop","hasOwnProperty","deepEqual","x","y","ok","keys","tx","every","key","isObject","object","safeAssign","fromObject","i","undefined","validateInitObject","initObject","currentObject","onReplace","previousKey","ignorePaths","path","_path","has","String","prototype","toUserId","this","toChatId","toPeerId","isChat","isPeerId","test","toString","Number","abs","newMethod","originMethod","call","arrays","Uint16Array","Uint32Array","nextRandomUint","bits","array","crypto","getRandomValues","randomLong","recordPromiseBound","log","promise","description","perf","performance","now","warn","recordPromise","pause","ms","setTimeout","throttle","fn","shouldRunFirst","isPending","interval","_args","setInterval","clearInterval","capitalizeFirstLetter","string","charAt","toUpperCase","toggleStorages","enabled","clearWrite","tsNow","seconds","t","getServerMessageId","messageId","toServer","q","l","used","clearMessageId","MESSAGE_ID_INCREMENT","MESSAGE_ID_OFFSET","isAnyChat","peerId","isUser","CryptoMessagePort","super","lastIndex","invokeCryptoNew","method","transfer","payload","result","sendPortIndex","sendPorts","invoke","invokeCrypto","cryptoMessagePort","CacheStorageController","dbName","useStorage","STORAGES","openDatabase","openDbPromise","caches","open","delete","entryName","timeoutOperation","cache","deleteAll","get","match","save","response","put","getFile","fileName","saveFile","blob","Response","headers","size","rejected","timeout","res","clearTimeout","prepareWriting","fileSize","getWriter","static","storage","MemoryWriter","saveFileCallback","bytes","write","part","offset","endOffset","newBytes","truncate","trim","finalize","saveToStorage","getParts","replaceParts","parts","LogTypes","LOG_LEVELS","None","Error","Warn","Log","Debug","STYLES_SUPPORTED","IS_SAFARI","IS_FIREFOX","LOGGER_STYLES","methods","logger","prefix","ignoreDebugReset","style","originalPrefix","originalStyle","logType","setPrefix","newPrefix","setLevel","level","bindPrefix","MTProtoMessagePort","INSTANCE","concat","toJSON","onFinally","reason","matchUrlProtocol","text","ServiceMessagePort","LocalStorage","useCache","localStorage","getItem","JSON","parse","onlyLocal","stringified","stringify","setItem","saveLocal","removeItem","clear","toggleStorage","LocalStorageController","proxy","apply","sessionStorage","StateStorage","stateStorage","AppStorage","db","storeName","getPromises","Map","keysToSet","Set","saveDeferred","keysToDelete","deleteDeferred","savingFreezed","saveThrottled","from","values","e","deleteThrottled","getThrottled","isAvailable","getCache","getFromCache","setToCache","r","p","getAll","canUseStorage","add","names"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"110.109af56006a419549840.bundle.js","mappings":"kHAaO,MAAMA,EAAe,CAAC,mBAAoB,qBAE3CC,EAAUC,KAAKC,IAAI,EAAgC,QAA7B,EAAAC,UAAUC,2BAAmB,QAAI,GAEvDC,EAAM,CACVC,GAAI,QACJC,KAAM,mCACNC,QAAS,QACTC,YAAa,cACbC,MAAO,IACPC,gBAAiB,QACjBC,SAAU,OACVC,aAAc,KACdC,QAASf,EACTgB,SAAU,EACVC,aAAcjB,EAAakB,SAASC,SAASC,UAC7CC,OAAQ,IACRpB,UACAqB,cAAerB,GAGdK,EAAIW,eACLX,EAAIC,GAAK,KACTD,EAAIE,KAAO,oCAGb,S,kCC9BA,MA8BA,EA9ByG,CACvGe,KAAM,OACNd,QAAS,EACTe,OAAQ,CAAC,CACPD,KAAM,WACL,CACDA,KAAM,eACL,CACDA,KAAM,SACL,CACDA,KAAM,SACL,CACDA,KAAM,WAaL,CACDA,KAAM,a,gDCtBK,SAASE,EAA6CC,EAAyBC,EAAmB,IAC3GC,MAAMC,QAAQH,KAChBA,EAAY,CAACA,IAGf,MAAMI,GAAe,OAAiBH,GAEtC,OADa,IAAII,KAAKL,EAAW,CAACM,KAAMF,GAE1C,C,iBCTe,SAASG,EAAiBN,GACvC,OAgByB,IAhBtB,CACD,aACA,YACA,YACA,gBACA,aACA,YACA,YACA,aACA,kBACA,YACA,aACA,YACA,YACA,mBACA,mBACAO,QAAQP,GACD,2BAGFA,CACT,C,iCClCe,SAASQ,KAAiBC,GACvC,MAAMC,EAASD,EAAKE,QAAO,CAACC,EAAKC,IAAMD,GAAQC,EAAkBC,YAAeD,EAAiBH,SAAS,GAEpGK,EAAM,IAAIC,WAAWN,GAE3B,IAAIO,EAAa,EAMjB,OALAR,EAAKS,SAASC,IACZJ,EAAIK,IAAID,aAAaE,YAAc,IAAIL,WAA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AK2L,eAAiB7P,QAAQC,SACzD,CAEO2O,MAAMF,GAAY,GACvB,IAAIA,EACF,IAAI,MAAMtL,KAAKc,KAAKuF,aACXvF,KAAKuF,MAAMrG,GAItB,OAAOc,KAAK6G,QAAQ6D,QAAQxO,MAAMwB,EACpC,CAEOkJ,qBAAqB9D,EAAkBC,GAC5C,OAAOjH,QAAQqB,IAAI6C,KAAK+E,SAAShH,KAAK8I,IAGpC,GAFAA,EAAQ/B,WAAahC,EAEjB,MAAcC,EAIlB,OAAID,EAOK+D,EAAQ7L,IAAI6L,EAAQtB,QAN3BsB,EAAQ0E,UAAUb,QAClB7D,EAAQ6E,aAAahB,QACrB7D,EAAQwE,YAAYvQ,SAASe,GAAaA,EAASE,aAAQoD,KAC3D0H,EAAQwE,YAAYX,QACb7D,EAAQ6D,OAAM,G,KAIrBxO,MAAMwB,EACZ,CAEOkJ,oBAA6ClL,EAAqBkR,GACvE5M,KAAK+E,SAASjK,SAAS+L,GAAYA,EAAQ+E,eAAgB,IAC3D,IACElQ,G,CACA,MAAMqB,GACNC,QAAQC,MAAM,+BAAgCF,E,CAEhDiD,KAAK+E,SAASjK,SAAS+L,GAAYA,EAAQ+E,eAAgB,GAC7D,EArRe,EAAA7G,SAA6C,GA4R9D,OAAmB,gBAA4BmG,E,kCCvU/C,MACA,EADuB,gwN","sources":["webpack://tweb/./src/config/app.ts","webpack://tweb/./src/config/databases/state.ts","webpack://tweb/./src/helpers/blob/blobConstruct.ts","webpack://tweb/./src/helpers/blob/blobSafeMimeType.ts","webpack://tweb/./src/helpers/bytes/bufferConcats.ts","webpack://tweb/./src/helpers/cancellablePromise.ts","webpack://tweb/./src/helpers/context.ts","webpack://tweb/./src/helpers/noop.ts","webpack://tweb/./src/helpers/object/copy.ts","webpack://tweb/./src/helpers/object/deepEqual.ts","webpack://tweb/./src/helpers/object/isObject.ts","webpack://tweb/./src/helpers/object/safeAssign.ts","webpack://tweb/./src/helpers/object/validateInitObject.ts","webpack://tweb/./src/helpers/peerIdPolyfill.ts","webpack://tweb/./src/helpers/random.ts","webpack://tweb/./src/helpers/recordPromise.ts","webpack://tweb/./src/helpers/schedulers/pause.ts","webpack://tweb/./src/helpers/schedulers/throttle.ts","webpack://tweb/./src/helpers/string/capitalizeFirstLetter.ts","webpack://tweb/./src/helpers/toggleStorages.ts","webpack://tweb/./src/helpers/tsNow.ts","webpack://tweb/./src/lib/appManagers/utils/messageId/getServerMessageId.ts","webpack://tweb/./src/lib/appManagers/utils/messageId/clearMessageId.ts","webpack://tweb/./src/lib/appManagers/utils/messageId/index.ts","webpack://tweb/./src/lib/appManagers/utils/peers/isAnyChat.ts","webpack://tweb/./src/lib/appManagers/utils/peers/isUser.ts","webpack://tweb/./src/lib/crypto/cryptoMessagePort.ts","webpack://tweb/./src/lib/files/cacheStorage.ts","webpack://tweb/./src/lib/files/memoryWriter.ts","webpack://tweb/./src/lib/logger.ts","webpack://tweb/./src/lib/mtproto/mtprotoMessagePort.ts","webpack://tweb/./src/lib/polyfill.ts","webpack://tweb/./src/lib/richTextProcessor/matchUrlProtocol.ts","webpack://tweb/./src/lib/serviceWorker/serviceMessagePort.ts","webpack://tweb/./src/lib/localStorage.ts","webpack://tweb/./src/lib/sessionStorage.ts","webpack://tweb/./src/lib/stateStorage.ts","webpack://tweb/./src/lib/storage.ts","webpack://tweb/./src/vendor/emoji/regex.ts"],"sourcesContent":["/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {DcId} from '../types';\n\nexport const MAIN_DOMAINS = ['web.telegram.org', 'webk.telegram.org'];\n\nconst threads = Math.min(4, navigator.hardwareConcurrency ?? 4);\n\nconst App = {\n id: +process.env.API_ID,\n hash: process.env.API_HASH,\n version: process.env.VERSION,\n versionFull: process.env.VERSION_FULL,\n build: +process.env.BUILD,\n langPackVersion: '1.0.3',\n langPack: 'webk',\n langPackCode: 'en',\n domains: MAIN_DOMAINS,\n baseDcId: 2 as DcId,\n isMainDomain: MAIN_DOMAINS.includes(location.hostname),\n suffix: 'K',\n threads,\n cryptoWorkers: threads\n};\n\nif(App.isMainDomain) { // use Webogram credentials then\n App.id = 2496;\n App.hash = '8da85b0d5bfe62527e5b244c209159c3';\n}\n\nexport default App;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Database} from '.';\nimport type {IDBIndex} from '../../lib/files/idb';\n\nconst DATABASE_STATE: Database<'session' | 'stickerSets' | 'users' | 'chats' | 'messages' | 'dialogs'> = {\n name: 'tweb',\n version: 7,\n stores: [{\n name: 'session'\n }, {\n name: 'stickerSets'\n }, {\n name: 'users'\n }, {\n name: 'chats'\n }, {\n name: 'dialogs'\n // indexes: [\n // ...(new Array(20 + 2).fill(0)).map((_, idx) => {\n // const name = `index_${idx}`;\n // const index: IDBIndex = {\n // indexName: name,\n // keyPath: name,\n // objectParameters: {}\n // };\n\n // return index\n // })\n // ]\n }, {\n name: 'messages'\n }]\n};\n\nexport default DATABASE_STATE;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport blobSafeMimeType from './blobSafeMimeType';\n\nexport default function blobConstruct(blobParts: Array | T, mimeType: string = ''): Blob {\n if(!Array.isArray(blobParts)) {\n blobParts = [blobParts];\n }\n\n const safeMimeType = blobSafeMimeType(mimeType);\n const blob = new Blob(blobParts, {type: safeMimeType});\n return blob;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\n// https://www.iana.org/assignments/media-types/media-types.xhtml\nexport default function blobSafeMimeType(mimeType: string) {\n if([\n 'image/jpeg',\n 'image/png',\n 'image/gif',\n 'image/svg+xml',\n 'image/webp',\n 'image/bmp',\n 'video/mp4',\n 'video/webm',\n 'video/quicktime',\n 'audio/ogg',\n 'audio/mpeg',\n 'audio/mp4',\n 'audio/wav', // though it is not in list\n 'application/json',\n 'application/pdf'\n ].indexOf(mimeType) === -1) {\n return 'application/octet-stream';\n }\n\n return mimeType;\n}\n","export default function bufferConcats(...args: (ArrayBuffer | Uint8Array | number[])[]) {\n const length = args.reduce((acc, v) => acc + ((v as ArrayBuffer).byteLength || (v as Uint8Array).length), 0);\n\n const tmp = new Uint8Array(length);\n\n let lastLength = 0;\n args.forEach((b) => {\n tmp.set(b instanceof ArrayBuffer ? new Uint8Array(b) : b, lastLength);\n lastLength += (b as ArrayBuffer).byteLength || (b as Uint8Array).length;\n });\n\n return tmp/* .buffer */;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport noop from './noop';\n\nexport interface CancellablePromise extends Promise {\n resolve?: (value: T) => void,\n reject?: (...args: any[]) => void,\n cancel?: (reason?: any) => void,\n\n notify?: (...args: any[]) => void,\n notifyAll?: (...args: any[]) => void,\n lastNotify?: any,\n listeners?: Array<(...args: any[]) => void>,\n addNotifyListener?: (callback: (...args: any[]) => void) => void,\n\n isFulfilled?: boolean,\n isRejected?: boolean\n}\n\nexport default function deferredPromise() {\n const deferredHelper: any = {\n isFulfilled: false,\n isRejected: false,\n\n notify: () => {},\n notifyAll: (...args: any[]) => {\n deferredHelper.lastNotify = args;\n deferredHelper.listeners.forEach((callback: any) => callback(...args));\n },\n\n listeners: [],\n addNotifyListener: (callback: (...args: any[]) => void) => {\n if(deferredHelper.lastNotify) {\n callback(...deferredHelper.lastNotify);\n }\n\n deferredHelper.listeners.push(callback);\n }\n };\n\n const deferred: CancellablePromise = new Promise((resolve, reject) => {\n deferredHelper.resolve = (value: T) => {\n if(deferred.isFulfilled || deferred.isRejected) return;\n\n deferred.isFulfilled = true;\n resolve(value);\n };\n\n deferredHelper.reject = (...args: any[]) => {\n if(deferred.isRejected || deferred.isFulfilled) return;\n\n deferred.isRejected = true;\n reject(...args);\n };\n });\n\n // @ts-ignore\n /* deferred.then = (resolve: (value: T) => any, reject: (...args: any[]) => any) => {\n const n = deferredPromise>();\n\n }; */\n\n deferred.catch(noop).finally(() => {\n deferred.notify = deferred.notifyAll = deferred.lastNotify = null;\n deferred.listeners.length = 0;\n\n if(deferred.cancel) {\n deferred.cancel = noop;\n }\n });\n\n Object.assign(deferred, deferredHelper);\n\n return deferred;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// в SW может быть сразу две переменных TRUE\nexport const IS_SERVICE_WORKER = typeof ServiceWorkerGlobalScope !== 'undefined' && self instanceof ServiceWorkerGlobalScope;\nexport const IS_WEB_WORKER = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope && !IS_SERVICE_WORKER;\nexport const IS_WORKER = IS_WEB_WORKER || IS_SERVICE_WORKER;\n\nexport const getWindowClients = () => {\n return (self as any as ServiceWorkerGlobalScope)\n .clients\n .matchAll({includeUncontrolled: false, type: 'window'});\n};\n\nexport const getLastWindowClient = () => getWindowClients().then((windowClients) => windowClients.slice(-1)[0]);\n\nconst postMessage = (listener: WindowClient | DedicatedWorkerGlobalScope, ...args: any[]) => {\n try {\n // @ts-ignore\n listener.postMessage(...args);\n } catch(err) {\n console.error('[worker] postMessage error:', err, args);\n }\n};\n\nconst notifyServiceWorker = (all: boolean, ...args: any[]) => {\n getWindowClients().then((listeners) => {\n if(!listeners.length) {\n // console.trace('no listeners?', self, listeners);\n return;\n }\n\n listeners.slice(all ? 0 : -1).forEach((listener) => {\n postMessage(listener, ...args);\n });\n });\n};\n\nconst notifyWorker = (...args: any[]) => {\n postMessage(self as any as DedicatedWorkerGlobalScope, ...args);\n};\n\nconst noop = () => {};\n\nexport const notifySomeone = IS_SERVICE_WORKER ? notifyServiceWorker.bind(null, false) : (IS_WEB_WORKER ? notifyWorker : noop);\nexport const notifyAll = IS_SERVICE_WORKER ? notifyServiceWorker.bind(null, true) : (IS_WEB_WORKER ? notifyWorker : noop);\n","export default function noop() {}\n","export default function copy(obj: T): T {\n // in case of premitives\n if(obj === null || typeof(obj) !== 'object') {\n return obj;\n }\n\n // date objects should be\n if(obj instanceof Date) {\n return new Date(obj.getTime()) as any;\n }\n\n // handle Array\n if(Array.isArray(obj)) {\n // @ts-ignore\n const clonedArr: T = obj.map((el) => copy(el)) as any as T;\n return clonedArr;\n }\n\n if(ArrayBuffer.isView(obj)) {\n // @ts-ignore\n return obj.slice();\n }\n\n // lastly, handle objects\n // @ts-ignore\n const clonedObj = new obj.constructor();\n for(var prop in obj) {\n if(obj.hasOwnProperty(prop)) {\n clonedObj[prop] = copy(obj[prop]);\n }\n }\n return clonedObj;\n}\n","export default function deepEqual(x: any, y: any): boolean {\n const ok = Object.keys, tx = typeof x, ty = typeof y;\n return x && y && tx === 'object' && tx === ty ? (\n ok(x).length === ok(y).length &&\n ok(x).every((key) => deepEqual(x[key], y[key]))\n ) : (x === y);\n}\n","export default function isObject>(object: any): object is T {\n return typeof(object) === 'object' && object !== null;\n}\n","export default function safeAssign(object: T, fromObject: any) {\n if(fromObject) {\n for(const i in fromObject) {\n if(fromObject[i] !== undefined) {\n // @ts-ignore\n object[i] = fromObject[i];\n }\n }\n }\n\n return object;\n}\n","import copy from './copy';\nimport isObject from './isObject';\n\nexport default function validateInitObject(\n initObject: any,\n currentObject: any,\n onReplace?: (key: string) => void,\n previousKey?: string,\n ignorePaths?: Set,\n path?: string\n) {\n for(const key in initObject) {\n const _path = path ? `${path}.${key}` : key;\n if(ignorePaths?.has(_path)) {\n continue;\n }\n\n if(typeof(currentObject[key]) !== typeof(initObject[key])) {\n currentObject[key] = copy(initObject[key]);\n onReplace?.(previousKey || key);\n } else if(isObject(initObject[key])) {\n validateInitObject(initObject[key], currentObject[key], onReplace, previousKey || key, ignorePaths, _path);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport isAnyChat from '../lib/appManagers/utils/peers/isAnyChat';\nimport isUser from '../lib/appManagers/utils/peers/isUser';\n\nString.prototype.toUserId = function() {\n return (+this).toUserId();\n};\n\nString.prototype.toChatId = function() {\n return (+this).toChatId();\n};\n\nString.prototype.toPeerId = function(isChat?: boolean) {\n return (+this).toPeerId(isChat);\n};\n\nString.prototype.isPeerId = function() {\n return /^[\\d-]/.test(this.toString());\n};\n\nNumber.prototype.toUserId = function() {\n return this as any;\n};\n\nNumber.prototype.toChatId = function() {\n return Math.abs(this as any);\n};\n\nNumber.prototype.toPeerId = function(isChat?: boolean) {\n return isChat === undefined ? this as number : (isChat ? -Math.abs(this as number) : this as number);\n};\n\nNumber.prototype.isPeerId = function() {\n return true;\n};\n\n[\n ['isUser' as const, isUser],\n ['isAnyChat' as const, isAnyChat]\n].forEach((value) => {\n const newMethod = Array.isArray(value) ? value[0] : value;\n const originMethod = Array.isArray(value) ? value[1] : value;\n // @ts-ignore\n String.prototype[newMethod] = function() {\n // @ts-ignore\n // eslint-disable-next-line no-useless-call\n return originMethod.call(null, this.toString());\n };\n\n // @ts-ignore\n Number.prototype[newMethod] = function() {\n // @ts-ignore\n // eslint-disable-next-line no-useless-call\n return originMethod.call(null, this);\n };\n});\n\ndeclare global {\n interface String {\n toUserId(): UserId;\n toChatId(): ChatId;\n toPeerId(isChat?: boolean): PeerId;\n isPeerId(): this is string;\n\n isUser(): boolean;\n isAnyChat(): boolean;\n }\n\n interface Number {\n toUserId(): UserId;\n toChatId(): ChatId;\n toPeerId(isChat?: boolean): PeerId;\n isPeerId(): this is PeerId;\n\n isUser(): boolean;\n isAnyChat(): boolean;\n }\n}\n\nexport {};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nconst arrays = {\n 8: new Uint8Array(1),\n 16: new Uint16Array(1),\n 32: new Uint32Array(1)\n};\nexport function nextRandomUint(bits: 8 | 16 | 32) {\n const array = arrays[bits];\n crypto.getRandomValues(array);\n return array[0];\n}\n\nexport function randomLong() {\n return '' + nextRandomUint(32) + nextRandomUint(32) % 0xFFFFFF;\n}\n","import {logger} from '../lib/logger';\nimport dT from './dT';\n\nexport function recordPromise>(promise: T, description: string, log?: ReturnType | Console) {\n const perf = performance.now();\n (log || console).warn(dT(), 'start', description);\n promise.then(() => {\n (log || console).warn(dT(), 'end', description, performance.now() - perf);\n });\n return promise;\n}\n\nexport function recordPromiseBound(log: ReturnType | Console) {\n return (...args: [Parameters[0], Parameters[1]]) => {\n return recordPromise(...args, log);\n };\n}\n","export default function pause(ms: number) {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n","// * Jolly Cobra's schedulers\n\nimport {AnyToVoidFunction} from '../../types';\n\nexport default function throttle(\n fn: F,\n ms: number,\n shouldRunFirst = true\n) {\n let interval: number | null = null;\n let isPending: boolean;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n isPending = true;\n args = _args;\n\n if(!interval) {\n if(shouldRunFirst) {\n isPending = false;\n // @ts-ignore\n fn(...args);\n }\n\n interval = setInterval(() => {\n if(!isPending) {\n clearInterval(interval!);\n interval = null;\n return;\n }\n\n isPending = false;\n // @ts-ignore\n fn(...args);\n }, ms) as any;\n }\n };\n}\n","export default function capitalizeFirstLetter(string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport CacheStorageController from '../lib/files/cacheStorage';\nimport AppStorage from '../lib/storage';\nimport sessionStorage from '../lib/sessionStorage';\nimport noop from './noop';\n\nexport default function toggleStorages(enabled: boolean, clearWrite: boolean) {\n return Promise.all([\n AppStorage.toggleStorage(enabled, clearWrite),\n CacheStorageController.toggleStorage(enabled, clearWrite),\n sessionStorage.toggleStorage(enabled, clearWrite)\n ]).then(noop, noop);\n}\n","export default function tsNow(seconds?: true) {\n const t = Date.now();\n return seconds ? t / 1000 | 0 : t;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport clearMessageId from './clearMessageId';\n\n/**\n * * will ignore outgoing offset\n */\nexport default function getServerMessageId(messageId: number) {\n return clearMessageId(messageId, true);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MESSAGE_ID_OFFSET, MESSAGE_ID_INCREMENT} from '.';\n\nexport default function clearMessageId(messageId: number, toServer?: boolean) {\n const q = MESSAGE_ID_OFFSET;\n if(messageId < q) { // id 0 -> mid 0xFFFFFFFF, so 0xFFFFFFFF must convert to 0\n return messageId;\n }\n\n const l = MESSAGE_ID_INCREMENT - 1;\n const used = messageId & l;\n if(used !== l) {\n messageId -= used + 1;\n }\n\n return toServer ? (messageId - q) / MESSAGE_ID_INCREMENT : messageId;\n}\n","export const MESSAGE_ID_INCREMENT = 0x10000;\nexport const MESSAGE_ID_OFFSET = 0xFFFFFFFF;\n","export default function isAnyChat(peerId: PeerId) {\n return +peerId < 0;\n}\n","export default function isUser(peerId: PeerId) {\n return +peerId >= 0;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {CryptoMethods} from './crypto_methods';\nimport SuperMessagePort from '../mtproto/superMessagePort';\nimport {Awaited} from '../../types';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport {IS_WORKER} from '../../helpers/context';\n\ntype CryptoEvent = {\n invoke: (payload: {method: T, args: Parameters}) => ReturnType,\n port: (payload: void, source: MessageEventSource, event: MessageEvent) => void,\n terminate: () => void\n};\n\nexport class CryptoMessagePort extends SuperMessagePort {\n private lastIndex: number;\n\n constructor() {\n super('CRYPTO');\n this.lastIndex = -1;\n }\n\n public invokeCryptoNew({method, args, transfer}: {\n method: T,\n args: Parameters,\n transfer?: Transferable[]\n }): Promise>> {\n const payload = {method, args};\n const listeners = this.listeners['invoke'];\n if(listeners?.length) { // already in worker\n // try {\n // @ts-ignore\n let result: any = listeners[0].callback(payload);\n if(!IS_WORKER && !(result instanceof Promise)) {\n result = Promise.resolve(result);\n }\n\n return result;\n // } catch(err) {\n // return Promise.reject(err);\n // }\n }\n\n const sendPortIndex = method === 'aes-encrypt' || method === 'aes-decrypt' ?\n this.lastIndex = (this.lastIndex + 1) % this.sendPorts.length :\n 0;\n // @ts-ignore\n return this.invoke('invoke', payload, undefined, this.sendPorts[sendPortIndex], transfer);\n }\n\n public invokeCrypto(method: T, ...args: Parameters): Promise>> {\n return this.invokeCryptoNew({method, args});\n }\n}\n\nconst cryptoMessagePort = new CryptoMessagePort();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.cryptoMessagePort = cryptoMessagePort);\nexport default cryptoMessagePort;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Modes from '../../config/modes';\nimport blobConstruct from '../../helpers/blob/blobConstruct';\nimport MemoryWriter from './memoryWriter';\nimport FileManager from './memoryWriter';\nimport FileStorage from './fileStorage';\nimport makeError from '../../helpers/makeError';\nimport deferredPromise from '../../helpers/cancellablePromise';\n\nexport type CacheStorageDbName = 'cachedFiles' | 'cachedStreamChunks' | 'cachedAssets';\n\nexport default class CacheStorageController implements FileStorage {\n private static STORAGES: CacheStorageController[] = [];\n private openDbPromise: Promise;\n\n private useStorage = true;\n\n // private log: ReturnType = logger('CS');\n\n constructor(private dbName: CacheStorageDbName) {\n if(Modes.test) {\n this.dbName += '_test';\n }\n\n if(CacheStorageController.STORAGES.length) {\n this.useStorage = CacheStorageController.STORAGES[0].useStorage;\n }\n\n this.openDatabase();\n CacheStorageController.STORAGES.push(this);\n }\n\n private openDatabase(): Promise {\n return this.openDbPromise ?? (this.openDbPromise = caches.open(this.dbName));\n }\n\n public delete(entryName: string) {\n return this.timeoutOperation((cache) => cache.delete('/' + entryName));\n }\n\n public deleteAll() {\n return caches.delete(this.dbName);\n }\n\n public get(entryName: string) {\n return this.timeoutOperation((cache) => cache.match('/' + entryName));\n }\n\n public save(entryName: string, response: Response) {\n // return new Promise((resolve) => {}); // DEBUG\n return this.timeoutOperation((cache) => cache.put('/' + entryName, response));\n }\n\n public getFile(fileName: string, method: 'blob' | 'json' | 'text' = 'blob'): Promise {\n // if(method === 'blob') {\n // return Promise.reject(makeError('NO_ENTRY_FOUND'));\n // }\n\n // const str = `get fileName: ${fileName}`;\n // console.time(str);\n return this.get(fileName).then((response) => {\n if(!response) {\n // console.warn('getFile:', response, fileName);\n throw makeError('NO_ENTRY_FOUND');\n }\n\n const promise = response[method]();\n // promise.then(() => {\n // console.timeEnd(str);\n // });\n return promise;\n });\n }\n\n public saveFile(fileName: string, blob: Blob | Uint8Array) {\n // return Promise.resolve(blobConstruct([blob]));\n if(!(blob instanceof Blob)) {\n blob = blobConstruct(blob);\n }\n\n const response = new Response(blob, {\n headers: {\n 'Content-Length': '' + blob.size\n }\n });\n\n return this.save(fileName, response).then(() => blob as Blob);\n }\n\n public timeoutOperation(callback: (cache: Cache) => Promise) {\n if(!this.useStorage) {\n return Promise.reject(makeError('STORAGE_OFFLINE'));\n }\n\n return new Promise(async(resolve, reject) => {\n let rejected = false;\n const timeout = setTimeout(() => {\n reject();\n // console.warn('CACHESTORAGE TIMEOUT');\n rejected = true;\n }, 15e3);\n\n try {\n const cache = await this.openDatabase();\n if(!cache) {\n this.useStorage = false;\n this.openDbPromise = undefined;\n throw 'no cache?';\n }\n\n const res = await callback(cache);\n\n if(rejected) return;\n resolve(res);\n } catch(err) {\n reject(err);\n }\n\n clearTimeout(timeout);\n });\n }\n\n public prepareWriting(fileName: string, fileSize: number, mimeType: string) {\n return {\n deferred: deferredPromise(),\n getWriter: () => {\n const writer = new MemoryWriter(mimeType, fileSize, (blob) => {\n return this.saveFile(fileName, blob).catch(() => blob);\n });\n\n return writer;\n }\n };\n }\n\n public static toggleStorage(enabled: boolean, clearWrite: boolean) {\n return Promise.all(this.STORAGES.map((storage) => {\n storage.useStorage = enabled;\n\n if(!clearWrite) {\n return;\n }\n\n if(!enabled) {\n return storage.deleteAll();\n }\n }));\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport blobConstruct from '../../helpers/blob/blobConstruct';\nimport StreamWriter from './streamWriter';\n\nexport default class MemoryWriter implements StreamWriter {\n private bytes: Uint8Array;\n\n constructor(\n private mimeType: string,\n private size: number,\n private saveFileCallback?: (blob: Blob) => Promise\n ) {\n this.bytes = new Uint8Array(size);\n }\n\n public async write(part: Uint8Array, offset: number) {\n // sometimes file size can be bigger than the prov\n const endOffset = offset + part.byteLength;\n if(endOffset > this.bytes.byteLength) {\n const newBytes = new Uint8Array(endOffset);\n newBytes.set(this.bytes, 0);\n this.bytes = newBytes;\n }\n\n this.bytes.set(part, offset);\n };\n\n public truncate() {\n this.bytes = new Uint8Array();\n }\n\n public trim(size: number) {\n this.bytes = this.bytes.slice(0, size);\n }\n\n public finalize(saveToStorage = true) {\n const blob = blobConstruct(this.bytes, this.mimeType);\n\n if(saveToStorage && this.saveFileCallback) {\n this.saveFileCallback(blob);\n }\n\n return blob;\n }\n\n public getParts() {\n return this.bytes;\n }\n\n public replaceParts(parts: Uint8Array) {\n this.bytes = parts;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport DEBUG from '../config/debug';\nimport {IS_FIREFOX, IS_SAFARI} from '../environment/userAgent';\nimport {IS_SERVICE_WORKER, IS_WEB_WORKER} from '../helpers/context';\nimport dT from '../helpers/dT';\n\nexport enum LogTypes {\n None = 0,\n Error = 1,\n Warn = 2,\n Log = 4,\n Debug = 8\n};\n\nexport const LOG_LEVELS = [LogTypes.None, LogTypes.Error, LogTypes.Warn, LogTypes.Log, LogTypes.Debug];\n\nconst IS_WEBKIT = IS_SAFARI || IS_FIREFOX;\n\n// let getCallerFunctionNameFromLine: (line: string) => string;\n// if(IS_WEBKIT) {\n// getCallerFunctionNameFromLine = (line) => {\n// const splitted = line.split('@');\n// return splitted[0];\n// };\n// } else {\n// getCallerFunctionNameFromLine = (line: string) => {\n// const splitted = line.trim().split(' ');\n// if(splitted.length === 3) {\n// return splitted[1].slice(splitted[1].lastIndexOf('.') + 1);\n// }\n// };\n// }\n\nconst STYLES_SUPPORTED = !IS_WEBKIT;\n// const LINE_INDEX = IS_WEBKIT ? 2 : 3;\n\n// function getCallerFunctionName() {\n// const stack = new Error().stack;\n// const lines = stack.split('\\n');\n// const line = lines[LINE_INDEX] || lines[lines.length - 1];\n// // const match = line.match(/\\.([^\\.]+?)\\s/);\n// // line = match ? match[1] : line.trim();\n// const caller = getCallerFunctionNameFromLine(line) || '';\n// return '[' + caller + ']';\n// }\n\nexport const LOGGER_STYLES = {\n reset: '\\x1b[0m',\n bright: '\\x1b[1m',\n dim: '\\x1b[2m',\n underscore: '\\x1b[4m',\n blink: '\\x1b[5m',\n reverse: '\\x1b[7m',\n hidden: '\\x1b[8m',\n // Foreground (text) colors\n fg: {\n black: '\\x1b[30m',\n red: '\\x1b[31m',\n green: '\\x1b[32m',\n yellow: '\\x1b[33m',\n blue: '\\x1b[34m',\n magenta: '\\x1b[35m',\n cyan: '\\x1b[36m',\n white: '\\x1b[37m'\n },\n // Background colors\n bg: {\n black: '\\x1b[40m',\n red: '\\x1b[41m',\n green: '\\x1b[42m',\n yellow: '\\x1b[43m',\n blue: '\\x1b[44m',\n magenta: '\\x1b[45m',\n cyan: '\\x1b[46m',\n white: '\\x1b[47m'\n }\n};\n\nexport type Logger = {\n (...args: any[]): void;\n warn(...args: any[]): void;\n info(...args: any[]): void;\n error(...args: any[]): void;\n trace(...args: any[]): void;\n debug(...args: any[]): void;\n assert(...args: any[]): void;\n // log(...args: any[]): void;\n group(...args: any[]): void;\n groupCollapsed(...args: any[]): void;\n groupEnd(...args: any[]): void;\n setPrefix(newPrefix: string): void;\n setLevel(level: 0 | 1 | 2 | 3 | 4): void;\n bindPrefix(prefix: string): Logger;\n};\n\nconst methods: ['debug' | 'info' | 'warn' | 'error' | 'assert' | 'trace'/* | 'log' */ | 'group' | 'groupCollapsed' | 'groupEnd', LogTypes][] = [\n ['debug', LogTypes.Debug],\n ['info', LogTypes.Log],\n ['warn', LogTypes.Warn],\n ['error', LogTypes.Error],\n ['assert', LogTypes.Error],\n ['trace', LogTypes.Log],\n ['group', LogTypes.Log],\n ['groupCollapsed', LogTypes.Log],\n ['groupEnd', LogTypes.Log]\n // [\"log\", LogTypes.Log]\n];\n\nexport function logger(prefix: string, type: LogTypes = LogTypes.Log | LogTypes.Warn | LogTypes.Error, ignoreDebugReset = false, style = ''): Logger {\n let originalPrefix: string;\n if(!DEBUG && !ignoreDebugReset/* || true */) {\n type = LogTypes.Error;\n }\n\n if(!STYLES_SUPPORTED) {\n style = '';\n } else if(!style) {\n if(IS_SERVICE_WORKER) style = LOGGER_STYLES.fg.yellow;\n else if(IS_WEB_WORKER) style = LOGGER_STYLES.fg.cyan;\n }\n\n const originalStyle = style;\n if(style) style = `%s ${style}%s`;\n else style = '%s';\n\n // level = LogLevels.log | LogLevels.warn | LogLevels.error | LogLevels.debug\n\n const log: Logger = function(...args: any[]) {\n return type & LogTypes.Log && console.log(style, dT(), prefix, /* getCallerFunctionName(), */ ...args);\n } as any;\n\n methods.forEach(([method, logType]) => {\n log[method] = function(...args: any[]) {\n return type & logType && console[method](style, dT(), prefix, /* getCallerFunctionName(), */ ...args);\n };\n });\n\n log.setPrefix = function(newPrefix: string) {\n originalPrefix = newPrefix;\n prefix = '[' + newPrefix + ']';\n };\n\n log.setPrefix(prefix);\n\n log.setLevel = function(level: 0 | 1 | 2 | 3 | 4) {\n type = LOG_LEVELS.slice(0, level + 1).reduce((acc, v) => acc | v, 0) as any;\n };\n\n log.bindPrefix = function(prefix: string) {\n return logger(`${originalPrefix}] [${prefix}`, type, ignoreDebugReset, originalStyle);\n };\n\n return log;\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport type {getEnvironment} from '../../environment/utils';\nimport type loadState from '../appManagers/utils/state/loadState';\nimport type {StoragesResults} from '../appManagers/utils/storages/loadStorages';\nimport type {LocalStorageProxyTask} from '../localStorage';\nimport type {Awaited} from '../../types';\nimport type {Mirrors, MirrorTaskPayload, NotificationBuildTaskPayload, TabState} from './mtprotoworker';\nimport type toggleStorages from '../../helpers/toggleStorages';\nimport SuperMessagePort from './superMessagePort';\n\nexport type MTProtoManagerTaskPayload = {name: string, method: string, args: any[]};\n\ntype MTProtoBroadcastEvent = {\n event: (payload: {name: string, args: any[]}, source: MessageEventSource) => void\n};\n\nexport default class MTProtoMessagePort extends SuperMessagePort<{\n environment: (environment: ReturnType) => void,\n crypto: (payload: {method: string, args: any[]}) => Promise,\n state: (payload: {userId: UserId} & Awaited> & {storagesResults?: StoragesResults}) => void,\n manager: (payload: MTProtoManagerTaskPayload) => any,\n toggleStorages: (payload: {enabled: boolean, clearWrite: boolean}) => ReturnType,\n serviceWorkerOnline: (online: boolean) => void,\n serviceWorkerPort: (payload: void, source: MessageEventSource, event: MessageEvent) => void,\n cryptoPort: (payload: void, source: MessageEventSource, event: MessageEvent) => void,\n createObjectURL: (blob: Blob) => string,\n tabState: (payload: TabState, source: MessageEventSource) => void,\n createProxyWorkerURLs: (payload: {originalUrl: string, blob: Blob}) => string[],\n} & MTProtoBroadcastEvent, {\n convertWebp: (payload: {fileName: string, bytes: Uint8Array}) => Promise,\n convertOpus: (payload: {fileName: string, bytes: Uint8Array}) => Promise,\n localStorageProxy: (payload: LocalStorageProxyTask['payload']) => Promise,\n mirror: (payload: MirrorTaskPayload) => void,\n notificationBuild: (payload: NotificationBuildTaskPayload) => void,\n // hello: () => void\n} & MTProtoBroadcastEvent, Master> {\n private static INSTANCE: MTProtoMessagePort;\n\n constructor() {\n super('MTPROTO');\n\n MTProtoMessagePort.INSTANCE = this;\n\n MOUNT_CLASS_TO && (MOUNT_CLASS_TO.mtprotoMessagePort = this);\n }\n\n public static getInstance() {\n return this.INSTANCE as MTProtoMessagePort;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport bufferConcats from '../helpers/bytes/bufferConcats';\n\nUint8Array.prototype.concat = function(...args: Array) {\n return bufferConcats(this, ...args);\n};\n\n/* Uint8Array.prototype.toString = function() {\n return String.fromCharCode.apply(null, [...this]);\n}; */\n\nUint8Array.prototype.toJSON = function() {\n return [...this];\n // return {type: 'bytes', value: [...this]};\n};\n\nPromise.prototype.finally = Promise.prototype.finally || function(this: Promise, fn: () => any) {\n const onFinally = (callback: typeof fn) => Promise.resolve(fn()).then(callback);\n return this.then(\n result => onFinally(() => result),\n reason => onFinally(() => Promise.reject(reason))\n );\n};\n\ndeclare global {\n interface Uint8Array {\n concat: (...args: Array) => Uint8Array,\n // toString: () => string,\n toJSON: () => number[],\n // toJSON: () => {type: 'bytes', value: number[]},\n }\n\n interface Promise {\n finally: (onfinally?: () => void) => Promise;\n }\n}\n","import {URL_ANY_PROTOCOL_REG_EXP} from '.';\n\nexport default function matchUrlProtocol(text: string) {\n return !text ? null : text.match(URL_ANY_PROTOCOL_REG_EXP);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {WebPushApiManager} from '../mtproto/webPushApiManager';\nimport type {PushNotificationObject} from './push';\nimport type {MyUploadFile} from '../mtproto/apiFileManager';\nimport SuperMessagePort from '../mtproto/superMessagePort';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\n\nexport type ServicePushPingTaskPayload = {\n localNotifications: boolean,\n lang: {\n push_action_mute1d: string\n push_action_settings: string\n push_message_nopreview: string\n },\n settings: WebPushApiManager['settings']\n};\n\nexport type ServiceRequestFilePartTaskPayload = {\n docId: DocId,\n dcId: number,\n offset: number,\n limit: number\n};\n\nexport type ServiceDownloadTaskPayload = {\n headers: any,\n id: string\n};\n\nexport type ServiceEvent = {\n port: (payload: void, source: MessageEventSource, event: MessageEvent) => void\n};\n\nexport default class ServiceMessagePort extends SuperMessagePort<{\n // from main thread to service worker\n notificationsClear: () => void,\n toggleStorages: (payload: {enabled: boolean, clearWrite: boolean}) => void,\n pushPing: (payload: ServicePushPingTaskPayload, source: MessageEventSource, event: MessageEvent) => void,\n hello: (payload: void, source: MessageEventSource, event: MessageEvent) => void,\n shownNotification: (payload: string) => void,\n\n // from mtproto worker\n download: (payload: ServiceDownloadTaskPayload) => void,\n downloadChunk: (payload: {id: ServiceDownloadTaskPayload['id'], chunk: Uint8Array}) => void\n downloadFinalize: (payload: ServiceDownloadTaskPayload['id']) => void,\n downloadCancel: (payload: ServiceDownloadTaskPayload['id']) => void\n}, {\n // to main thread\n pushClick: (payload: PushNotificationObject) => void,\n hello: (payload: void, source: MessageEventSource) => void,\n share: (payload: ShareData) => void,\n\n // to mtproto worker\n requestFilePart: (payload: ServiceRequestFilePartTaskPayload) => Promise | MyUploadFile\n} & ServiceEvent, Master> {\n constructor() {\n super('SERVICE');\n\n MOUNT_CLASS_TO && (MOUNT_CLASS_TO.serviceMessagePort = this);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport Modes from '../config/modes';\nimport {IS_WORKER} from '../helpers/context';\nimport {WorkerTaskTemplate} from '../types';\nimport MTProtoMessagePort from './mtproto/mtprotoMessagePort';\n// import { stringify } from '../helpers/json';\n\nclass LocalStorage> {\n private prefix = '';\n private cache: Partial = {};\n private useStorage = true;\n\n constructor(/* private preserveKeys: (keyof Storage)[] */) {\n if(Modes.test) {\n this.prefix = 't_';\n }\n }\n\n public get(key: T, useCache = true): Storage[T] {\n if(this.cache.hasOwnProperty(key) && useCache) {\n return this.cache[key];\n } else if(this.useStorage) {\n let value: Storage[T];\n try {\n value = localStorage.getItem(this.prefix + (key as string)) as any;\n } catch(err) {\n this.useStorage = false;\n }\n\n if(value !== null) {\n try {\n value = JSON.parse(value);\n } catch(err) {\n // console.error(err);\n }\n } else {\n value = undefined;\n }\n\n return value;\n }/* else {\n throw 'something went wrong';\n } */\n }\n\n public set(obj: Partial, onlyLocal = false) {\n for(const key in obj) {\n if(obj.hasOwnProperty(key)) {\n const value = obj[key];\n this.cache[key] = value;\n\n if(this.useStorage && !onlyLocal) {\n try {\n const stringified = JSON.stringify(value);\n localStorage.setItem(this.prefix + key, stringified);\n } catch(err) {\n this.useStorage = false;\n }\n }\n }\n }\n }\n\n public delete(key: keyof Storage, saveLocal = false) {\n // ! it is needed here\n key = '' + (key as string);\n\n if(!saveLocal) {\n delete this.cache[key];\n }\n\n // if(this.useStorage) {\n try {\n localStorage.removeItem(this.prefix + (key as string));\n } catch(err) {\n\n }\n // }\n }\n\n /* public clear(preserveKeys: (keyof Storage)[] = this.preserveKeys) {\n // if(this.useStorage) {\n try {\n let obj: Partial = {};\n if(preserveKeys) {\n preserveKeys.forEach((key) => {\n const value = this.get(key);\n if(value !== undefined) {\n obj[key] = value;\n }\n });\n }\n\n localStorage.clear();\n\n if(preserveKeys) {\n this.set(obj);\n }\n } catch(err) {\n\n }\n // }\n } */\n\n public clear() {\n const keys: string[] = ['dc', 'server_time_offset', 'xt_instance', 'user_auth', 'state_id', 'k_build'];\n for(let i = 1; i <= 5; ++i) {\n keys.push(`dc${i}_server_salt`);\n keys.push(`dc${i}_auth_key`);\n }\n\n for(const key of keys) {\n this.delete(key, true);\n }\n }\n\n public toggleStorage(enabled: boolean, clearWrite: boolean) {\n this.useStorage = enabled;\n\n if(!clearWrite) {\n return;\n }\n\n if(!enabled) {\n this.clear();\n } else {\n return this.set(this.cache);\n }\n }\n}\n\nexport interface LocalStorageProxyTask extends WorkerTaskTemplate {\n type: 'localStorageProxy',\n payload: {\n type: 'set' | 'get' | 'delete' | 'clear' | 'toggleStorage',\n args: any[]\n }\n};\n\nexport interface LocalStorageProxyTaskResponse extends WorkerTaskTemplate {\n type: 'localStorageProxy',\n payload: any\n};\n\nexport default class LocalStorageController> {\n private static STORAGES: LocalStorageController[] = [];\n // private log = (...args: any[]) => console.log('[SW LS]', ...args);\n // private log = (...args: any[]) => {};\n\n private storage: LocalStorage;\n\n constructor(/* private preserveKeys: (keyof Storage)[] = [] */) {\n LocalStorageController.STORAGES.push(this);\n\n if(!IS_WORKER) {\n this.storage = new LocalStorage(/* preserveKeys */);\n }\n }\n\n private async proxy(type: LocalStorageProxyTask['payload']['type'], ...args: LocalStorageProxyTask['payload']['args']): Promise {\n if(IS_WORKER) {\n const port = MTProtoMessagePort.getInstance();\n return port.invoke('localStorageProxy', {type, args});\n }\n\n args = Array.prototype.slice.call(args);\n\n // @ts-ignore\n return this.storage[type].apply(this.storage, args as any);\n }\n\n public get(key: T, useCache?: boolean) {\n return this.proxy('get', key, useCache);\n }\n\n public set(obj: Partial, onlyLocal?: boolean) {\n return this.proxy('set', obj, onlyLocal);\n }\n\n public delete(key: keyof Storage, saveLocal?: boolean) {\n return this.proxy('delete', key, saveLocal);\n }\n\n public clear(/* preserveKeys?: (keyof Storage)[] */) {\n return this.proxy('clear'/* , preserveKeys */);\n }\n\n public toggleStorage(enabled: boolean, clearWrite: boolean) {\n return this.proxy('toggleStorage', enabled, clearWrite);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AppInstance} from './mtproto/singleInstance';\nimport type {UserAuth} from './mtproto/mtproto_config';\nimport type {DcId} from '../types';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport LocalStorageController from './localStorage';\n\nconst sessionStorage = new LocalStorageController<{\n dc: DcId,\n user_auth: UserAuth,\n state_id: number,\n dc1_auth_key: string,\n dc2_auth_key: string,\n dc3_auth_key: string,\n dc4_auth_key: string,\n dc5_auth_key: string,\n dc1_server_salt: string,\n dc2_server_salt: string,\n dc3_server_salt: string,\n dc4_server_salt: string,\n dc5_server_salt: string,\n server_time_offset: number,\n xt_instance: AppInstance,\n kz_version: 'K' | 'Z',\n tgme_sync: {\n canRedirect: boolean,\n ts: number\n },\n k_build: number\n}>(/* ['kz_version'] */);\nMOUNT_CLASS_TO.appStorage = sessionStorage;\nexport default sessionStorage;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {ChatSavedPosition} from './appManagers/appImManager';\nimport type {AppDraftsManager} from './appManagers/appDraftsManager';\nimport type {State} from '../config/state';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport {LangPackDifference} from '../layer';\nimport AppStorage from './storage';\nimport DATABASE_STATE from '../config/databases/state';\n\nclass StateStorage extends AppStorage<{\n chatPositions: {\n [peerId_threadId: string]: ChatSavedPosition\n },\n langPack: LangPackDifference,\n drafts: AppDraftsManager['drafts'],\n user_auth: any, // support old webk format\n} & State, typeof DATABASE_STATE> {\n constructor() {\n super(DATABASE_STATE, 'session');\n }\n}\n\nconst stateStorage = new StateStorage();\nMOUNT_CLASS_TO.stateStorage = stateStorage;\nexport default stateStorage;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {Database} from '../config/databases';\nimport {MOUNT_CLASS_TO} from '../config/debug';\n// import DATABASE_SESSION from \"../config/databases/session\";\nimport deferredPromise, {CancellablePromise} from '../helpers/cancellablePromise';\nimport {IS_WORKER} from '../helpers/context';\nimport throttle from '../helpers/schedulers/throttle';\n// import { WorkerTaskTemplate } from \"../types\";\nimport IDBStorage from './files/idb';\n\nfunction noop() {}\n\n/* export interface LocalStorageProxySetTask extends WorkerTaskTemplate {\n type: 'localStorageProxy',\n payload: {\n type: 'set',\n keys: string[],\n values: any[]\n }\n};\n\nexport interface LocalStorageProxyDeleteTask extends WorkerTaskTemplate {\n type: 'localStorageProxy',\n payload: {\n type: 'delete',\n keys: string[]\n }\n}; */\n\nconst THROTTLE_TIME = 16;\n\n/* Storage extends {[name: string]: any} *//* Storage extends Record */\nexport default class AppStorage<\n Storage extends Record,\n T extends Database\n> {\n private static STORAGES: AppStorage>[] = [];\n private storage: IDBStorage;// new CacheStorageController('session');\n\n // private cache: Partial<{[key: string]: Storage[typeof key]}> = {};\n private cache: Partial = {};\n private useStorage: boolean;\n private savingFreezed: boolean;\n\n private getPromises: Map> = new Map();\n private getThrottled: () => void;\n\n private keysToSet: Set = new Set();\n private saveThrottled: () => void;\n private saveDeferred = deferredPromise();\n\n private keysToDelete: Set = new Set();\n private deleteThrottled: () => void;\n private deleteDeferred = deferredPromise();\n\n constructor(private db: T, private storeName: typeof db['stores'][number]['name']) {\n this.storage = new IDBStorage(db, storeName);\n\n if(AppStorage.STORAGES.length) {\n this.useStorage = AppStorage.STORAGES[0].useStorage;\n } else {\n this.useStorage = true;\n }\n\n this.savingFreezed = false;\n\n AppStorage.STORAGES.push(this);\n\n this.saveThrottled = throttle(async() => {\n const deferred = this.saveDeferred;\n this.saveDeferred = deferredPromise();\n\n const set = this.keysToSet;\n if(set.size) {\n const keys = Array.from(set.values()) as string[];\n set.clear();\n\n const values = keys.map((key) => this.cache[key]);\n try {\n // console.log('setItem: will set', key/* , value */);\n // await this.cacheStorage.delete(key); // * try to prevent memory leak in Chrome leading to 'Unexpected internal error.'\n // await this.storage.save(key, new Response(value, {headers: {'Content-Type': 'application/json'}}));\n\n /* if(db === DATABASE_SESSION && !('localStorage' in self)) { // * support legacy Webogram's localStorage\n self.postMessage({\n type: 'localStorageProxy',\n payload: {\n type: 'set',\n keys,\n values\n }\n } as LocalStorageProxySetTask);\n } */\n\n await this.storage.save(keys, values);\n // console.log('setItem: have set', key/* , value */);\n } catch(e) {\n // this.useCS = false;\n console.error('[AS]: set error:', e, keys, values);\n }\n }\n\n deferred.resolve();\n\n if(set.size) {\n this.saveThrottled();\n }\n }, THROTTLE_TIME, false);\n\n this.deleteThrottled = throttle(async() => {\n const deferred = this.deleteDeferred;\n this.deleteDeferred = deferredPromise();\n\n const set = this.keysToDelete;\n if(set.size) {\n const keys = Array.from(set.values()) as string[];\n set.clear();\n\n try {\n /* if(db === DATABASE_SESSION && !('localStorage' in self)) { // * support legacy Webogram's localStorage\n self.postMessage({\n type: 'localStorageProxy',\n payload: {\n type: 'delete',\n keys\n }\n } as LocalStorageProxyDeleteTask);\n } */\n\n await this.storage.delete(keys);\n } catch(e) {\n console.error('[AS]: delete error:', e, keys);\n }\n }\n\n deferred.resolve();\n\n if(set.size) {\n this.deleteThrottled();\n }\n }, THROTTLE_TIME, false);\n\n this.getThrottled = throttle(async() => {\n const keys = Array.from(this.getPromises.keys());\n\n // const perf = performance.now();\n this.storage.get(keys as string[]).then((values) => {\n for(let i = 0, length = keys.length; i < length; ++i) {\n const key = keys[i];\n const deferred = this.getPromises.get(key);\n if(deferred) {\n // @ts-ignore\n deferred.resolve(this.cache[key] = values[i]);\n this.getPromises.delete(key);\n }\n }\n\n // console.log('[AS]: get time', keys, performance.now() - perf);\n }, (error: ApiError) => {\n const ignoreErrors: Set = new Set(['NO_ENTRY_FOUND', 'STORAGE_OFFLINE']);\n if(!ignoreErrors.has(error.type)) {\n this.useStorage = false;\n console.error('[AS]: get error:', error, keys, storeName);\n }\n\n for(let i = 0, length = keys.length; i < length; ++i) {\n const key = keys[i];\n const deferred = this.getPromises.get(key);\n if(deferred) {\n // deferred.reject(error);\n deferred.resolve(undefined);\n this.getPromises.delete(key);\n }\n }\n }).finally(() => {\n if(this.getPromises.size) {\n this.getThrottled();\n }\n });\n }, THROTTLE_TIME, false);\n }\n\n public isAvailable() {\n return this.useStorage;\n }\n\n public getCache() {\n return this.cache;\n }\n\n public getFromCache(key: T) {\n return this.cache[key];\n }\n\n public setToCache(key: keyof Storage, value: Storage[typeof key]) {\n return this.cache[key] = value;\n }\n\n public async get(key: T, useCache = true): Promise {\n if(this.cache.hasOwnProperty(key) && useCache) {\n return this.getFromCache(key);\n } else if(this.useStorage) {\n const r = this.getPromises.get(key);\n if(r) return r as any;\n\n const p = deferredPromise();\n this.getPromises.set(key, p as any);\n\n this.getThrottled();\n\n return p;\n }/* else {\n throw 'something went wrong';\n } */\n }\n\n public getAll() {\n return this.storage.getAll().catch(() => []);\n }\n\n public set(obj: Partial, onlyLocal = false) {\n // console.log('storageSetValue', obj, callback, arguments);\n\n const canUseStorage = this.useStorage && !onlyLocal && !this.savingFreezed;\n for(const key in obj) {\n if(obj.hasOwnProperty(key)) {\n const value = obj[key];\n this.setToCache(key, value);\n\n // let perf = /* DEBUG */false ? performance.now() : 0;\n // value = JSON.stringify(value);\n\n // if(perf) {\n // let elapsedTime = performance.now() - perf;\n // if(elapsedTime > 10) {\n // console.warn('LocalStorage set: stringify time by JSON.stringify:', elapsedTime, key);\n // }\n // }\n\n /* perf = performance.now();\n value = stringify(value);\n console.log('LocalStorage set: stringify time by own stringify:', performance.now() - perf); */\n\n if(canUseStorage) {\n this.keysToSet.add(key);\n this.keysToDelete.delete(key);\n this.saveThrottled();\n }\n }\n }\n\n return canUseStorage ? this.saveDeferred : Promise.resolve();\n }\n\n public delete(key: keyof Storage, saveLocal = false) {\n /* if(!this.cache.hasOwnProperty(key)) {\n return;\n } */\n\n // ! it is needed here\n key = '' + (key as string);\n\n if(!saveLocal) {\n delete this.cache[key];\n }\n\n if(this.useStorage) {\n this.keysToSet.delete(key);\n this.keysToDelete.add(key);\n this.deleteThrottled();\n }\n\n return this.useStorage ? this.deleteDeferred : Promise.resolve();\n }\n\n public clear(saveLocal = false) {\n if(!saveLocal) {\n for(const i in this.cache) {\n delete this.cache[i];\n }\n }\n\n return this.storage.clear().catch(noop);\n }\n\n public static toggleStorage(enabled: boolean, clearWrite: boolean) {\n return Promise.all(this.STORAGES.map((storage) => {\n storage.useStorage = enabled;\n\n if(!IS_WORKER || !clearWrite) {\n return;\n }\n\n if(!enabled) {\n storage.keysToSet.clear();\n storage.keysToDelete.clear();\n storage.getPromises.forEach((deferred) => deferred.resolve(undefined));\n storage.getPromises.clear();\n return storage.clear(true);\n } else {\n return storage.set(storage.cache);\n }\n })).catch(noop);\n }\n\n public static freezeSaving>(callback: () => any, names: T['stores'][number]['name'][]) {\n this.STORAGES.forEach((storage) => storage.savingFreezed = true);\n try {\n callback();\n } catch(err) {\n console.error('freezeSaving callback error:', err);\n }\n this.STORAGES.forEach((storage) => storage.savingFreezed = false);\n }\n\n /* public deleteDatabase() {\n return IDBStorage.deleteDatabase().catch(noop);\n } */\n}\n\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.AppStorage = AppStorage);\n","// Copyright Twitter Inc. Licensed under MIT\n// https://github.com/twitter/twemoji-parser/blob/master/LICENSE.md\n\nconst originalString = '((?:\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f?\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f?\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f?\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f?\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f?\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc8b\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\udef1\\ud83c\\udffb\\u200d\\ud83e\\udef2\\ud83c[\\udffc-\\udfff]|\\ud83e\\udef1\\ud83c\\udffc\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\udef1\\ud83c\\udffd\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\udef1\\ud83c\\udffe\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\udef1\\ud83c\\udfff\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f?\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f?\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1|\\ud83d\\udc6b\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6c\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6d\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc8f\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc91\\ud83c[\\udffb-\\udfff]|\\ud83e\\udd1d\\ud83c[\\udffb-\\udfff]|\\ud83d[\\udc6b-\\udc6d\\udc8f\\udc91]|\\ud83e\\udd1d)|(?:\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1)(?:\\ud83c[\\udffb-\\udfff])?\\u200d(?:\\u2695\\ufe0f?|\\u2696\\ufe0f?|\\u2708\\ufe0f?|\\ud83c[\\udf3e\\udf73\\udf7c\\udf84\\udf93\\udfa4\\udfa8\\udfeb\\udfed]|\\ud83d[\\udcbb\\udcbc\\udd27\\udd2c\\ude80\\ude92]|\\ud83e[\\uddaf-\\uddb3\\uddbc\\uddbd])|(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75]|\\u26f9)(?:(?:\\ud83c[\\udffb-\\udfff]|\\ufe0f?)\\u200d[\\u2640\\u2642]\\ufe0f?)|(?:\\ud83c[\\udfc3\\udfc4\\udfca]|\\ud83d[\\udc6e\\udc70\\udc71\\udc73\\udc77\\udc81\\udc82\\udc86\\udc87\\ude45-\\ude47\\ude4b\\ude4d\\ude4e\\udea3\\udeb4-\\udeb6]|\\ud83e[\\udd26\\udd35\\udd37-\\udd39\\udd3d\\udd3e\\uddb8\\uddb9\\uddcd-\\uddcf\\uddd4\\uddd6-\\udddd])(?:\\ud83c[\\udffb-\\udfff])?\\u200d[\\u2640\\u2642]\\ufe0f?|(?:\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83c\\udff3\\ufe0f?\\u200d\\u26a7\\ufe0f?|\\ud83c\\udff3\\ufe0f?\\u200d\\ud83c\\udf08|\\ud83d\\ude36\\u200d\\ud83c\\udf2b\\ufe0f?|\\u2764\\ufe0f?\\u200d\\ud83d\\udd25|\\u2764\\ufe0f?\\u200d\\ud83e\\ude79|\\ud83c\\udff4\\u200d\\u2620\\ufe0f?|\\ud83d\\udc15\\u200d\\ud83e\\uddba|\\ud83d\\udc3b\\u200d\\u2744\\ufe0f?|\\ud83d\\udc41\\u200d\\ud83d\\udde8|\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc6f\\u200d\\u2640\\ufe0f?|\\ud83d\\udc6f\\u200d\\u2642\\ufe0f?|\\ud83d\\ude2e\\u200d\\ud83d\\udca8|\\ud83d\\ude35\\u200d\\ud83d\\udcab|\\ud83e\\udd3c\\u200d\\u2640\\ufe0f?|\\ud83e\\udd3c\\u200d\\u2642\\ufe0f?|\\ud83e\\uddde\\u200d\\u2640\\ufe0f?|\\ud83e\\uddde\\u200d\\u2642\\ufe0f?|\\ud83e\\udddf\\u200d\\u2640\\ufe0f?|\\ud83e\\udddf\\u200d\\u2642\\ufe0f?|\\ud83d\\udc08\\u200d\\u2b1b)|[#*0-9]\\ufe0f??\\u20e3|(?:[©®\\u2122\\u265f]\\ufe0f?)|(?:\\ud83c[\\udc04\\udd70\\udd71\\udd7e\\udd7f\\ude02\\ude1a\\ude2f\\ude37\\udf21\\udf24-\\udf2c\\udf36\\udf7d\\udf96\\udf97\\udf99-\\udf9b\\udf9e\\udf9f\\udfcd\\udfce\\udfd4-\\udfdf\\udff3\\udff5\\udff7]|\\ud83d[\\udc3f\\udc41\\udcfd\\udd49\\udd4a\\udd6f\\udd70\\udd73\\udd76-\\udd79\\udd87\\udd8a-\\udd8d\\udda5\\udda8\\uddb1\\uddb2\\uddbc\\uddc2-\\uddc4\\uddd1-\\uddd3\\udddc-\\uddde\\udde1\\udde3\\udde8\\uddef\\uddf3\\uddfa\\udecb\\udecd-\\udecf\\udee0-\\udee5\\udee9\\udef0\\udef3]|[\\u203c\\u2049\\u2139\\u2194-\\u2199\\u21a9\\u21aa\\u231a\\u231b\\u2328\\u23cf\\u23ed-\\u23ef\\u23f1\\u23f2\\u23f8-\\u23fa\\u24c2\\u25aa\\u25ab\\u25b6\\u25c0\\u25fb-\\u25fe\\u2600-\\u2604\\u260e\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262a\\u262e\\u262f\\u2638-\\u263a\\u2640\\u2642\\u2648-\\u2653\\u2660\\u2663\\u2665\\u2666\\u2668\\u267b\\u267f\\u2692-\\u2697\\u2699\\u269b\\u269c\\u26a0\\u26a1\\u26a7\\u26aa\\u26ab\\u26b0\\u26b1\\u26bd\\u26be\\u26c4\\u26c5\\u26c8\\u26cf\\u26d1\\u26d3\\u26d4\\u26e9\\u26ea\\u26f0-\\u26f5\\u26f8\\u26fa\\u26fd\\u2702\\u2708\\u2709\\u270f\\u2712\\u2714\\u2716\\u271d\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u2764\\u27a1\\u2934\\u2935\\u2b05-\\u2b07\\u2b1b\\u2b1c\\u2b50\\u2b55\\u3030\\u303d\\u3297\\u3299])(?:\\ufe0f?|(?!\\ufe0e))|(?:(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75\\udd90]|[\\u261d\\u26f7\\u26f9\\u270c\\u270d])(?:\\ufe0f?|(?!\\ufe0e))|(?:\\ud83c[\\udf85\\udfc2-\\udfc4\\udfc7\\udfca]|\\ud83d[\\udc42\\udc43\\udc46-\\udc50\\udc66-\\udc69\\udc6e\\udc70-\\udc78\\udc7c\\udc81-\\udc83\\udc85-\\udc87\\udcaa\\udd7a\\udd95\\udd96\\ude45-\\ude47\\ude4b-\\ude4f\\udea3\\udeb4-\\udeb6\\udec0\\udecc]|\\ud83e[\\udd0c\\udd0f\\udd18-\\udd1c\\udd1e\\udd1f\\udd26\\udd30-\\udd39\\udd3d\\udd3e\\udd77\\uddb5\\uddb6\\uddb8\\uddb9\\uddbb\\uddcd-\\uddcf\\uddd1-\\udddd\\udec3-\\udec5\\udef0-\\udef6]|[\\u270a\\u270b]))(?:\\ud83c[\\udffb-\\udfff])?|(?:\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc65\\udb40\\udc6e\\udb40\\udc67\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc73\\udb40\\udc63\\udb40\\udc74\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc77\\udb40\\udc6c\\udb40\\udc73\\udb40\\udc7f|\\ud83c\\udde6\\ud83c[\\udde8-\\uddec\\uddee\\uddf1\\uddf2\\uddf4\\uddf6-\\uddfa\\uddfc\\uddfd\\uddff]|\\ud83c\\udde7\\ud83c[\\udde6\\udde7\\udde9-\\uddef\\uddf1-\\uddf4\\uddf6-\\uddf9\\uddfb\\uddfc\\uddfe\\uddff]|\\ud83c\\udde8\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\uddee\\uddf0-\\uddf5\\uddf7\\uddfa-\\uddff]|\\ud83c\\udde9\\ud83c[\\uddea\\uddec\\uddef\\uddf0\\uddf2\\uddf4\\uddff]|\\ud83c\\uddea\\ud83c[\\udde6\\udde8\\uddea\\uddec\\udded\\uddf7-\\uddfa]|\\ud83c\\uddeb\\ud83c[\\uddee-\\uddf0\\uddf2\\uddf4\\uddf7]|\\ud83c\\uddec\\ud83c[\\udde6\\udde7\\udde9-\\uddee\\uddf1-\\uddf3\\uddf5-\\uddfa\\uddfc\\uddfe]|\\ud83c\\udded\\ud83c[\\uddf0\\uddf2\\uddf3\\uddf7\\uddf9\\uddfa]|\\ud83c\\uddee\\ud83c[\\udde8-\\uddea\\uddf1-\\uddf4\\uddf6-\\uddf9]|\\ud83c\\uddef\\ud83c[\\uddea\\uddf2\\uddf4\\uddf5]|\\ud83c\\uddf0\\ud83c[\\uddea\\uddec-\\uddee\\uddf2\\uddf3\\uddf5\\uddf7\\uddfc\\uddfe\\uddff]|\\ud83c\\uddf1\\ud83c[\\udde6-\\udde8\\uddee\\uddf0\\uddf7-\\uddfb\\uddfe]|\\ud83c\\uddf2\\ud83c[\\udde6\\udde8-\\udded\\uddf0-\\uddff]|\\ud83c\\uddf3\\ud83c[\\udde6\\udde8\\uddea-\\uddec\\uddee\\uddf1\\uddf4\\uddf5\\uddf7\\uddfa\\uddff]|\\ud83c\\uddf4\\ud83c\\uddf2|\\ud83c\\uddf5\\ud83c[\\udde6\\uddea-\\udded\\uddf0-\\uddf3\\uddf7-\\uddf9\\uddfc\\uddfe]|\\ud83c\\uddf6\\ud83c\\udde6|\\ud83c\\uddf7\\ud83c[\\uddea\\uddf4\\uddf8\\uddfa\\uddfc]|\\ud83c\\uddf8\\ud83c[\\udde6-\\uddea\\uddec-\\uddf4\\uddf7-\\uddf9\\uddfb\\uddfd-\\uddff]|\\ud83c\\uddf9\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\udded\\uddef-\\uddf4\\uddf7\\uddf9\\uddfb\\uddfc\\uddff]|\\ud83c\\uddfa\\ud83c[\\udde6\\uddec\\uddf2\\uddf3\\uddf8\\uddfe\\uddff]|\\ud83c\\uddfb\\ud83c[\\udde6\\udde8\\uddea\\uddec\\uddee\\uddf3\\uddfa]|\\ud83c\\uddfc\\ud83c[\\uddeb\\uddf8]|\\ud83c\\uddfd\\ud83c\\uddf0|\\ud83c\\uddfe\\ud83c[\\uddea\\uddf9]|\\ud83c\\uddff\\ud83c[\\udde6\\uddf2\\uddfc]|\\ud83c[\\udccf\\udd8e\\udd91-\\udd9a\\udde6-\\uddff\\ude01\\ude32-\\ude36\\ude38-\\ude3a\\ude50\\ude51\\udf00-\\udf20\\udf2d-\\udf35\\udf37-\\udf7c\\udf7e-\\udf84\\udf86-\\udf93\\udfa0-\\udfc1\\udfc5\\udfc6\\udfc8\\udfc9\\udfcf-\\udfd3\\udfe0-\\udff0\\udff4\\udff8-\\udfff]|\\ud83d[\\udc00-\\udc3e\\udc40\\udc44\\udc45\\udc51-\\udc65\\udc6a\\udc6f\\udc79-\\udc7b\\udc7d-\\udc80\\udc84\\udc88-\\udc8e\\udc90\\udc92-\\udca9\\udcab-\\udcfc\\udcff-\\udd3d\\udd4b-\\udd4e\\udd50-\\udd67\\udda4\\uddfb-\\ude44\\ude48-\\ude4a\\ude80-\\udea2\\udea4-\\udeb3\\udeb7-\\udebf\\udec1-\\udec5\\uded0-\\uded2\\uded5-\\uded7\\udedd-\\udedf\\udeeb\\udeec\\udef4-\\udefc\\udfe0-\\udfeb\\udff0]|\\ud83e[\\udd0d\\udd0e\\udd10-\\udd17\\udd20-\\udd25\\udd27-\\udd2f\\udd3a\\udd3c\\udd3f-\\udd45\\udd47-\\udd76\\udd78-\\uddb4\\uddb7\\uddba\\uddbc-\\uddcc\\uddd0\\uddde-\\uddff\\ude70-\\ude74\\ude78-\\ude7c\\ude80-\\ude86\\ude90-\\udeac\\udeb0-\\udeba\\udec0-\\udec2\\uded0-\\uded9\\udee0-\\udee7]|[\\u23e9-\\u23ec\\u23f0\\u23f3\\u267e\\u26ce\\u2705\\u2728\\u274c\\u274e\\u2753-\\u2755\\u2795-\\u2797\\u27b0\\u27bf\\ue50a])|\\ufe0f)';\nexport default originalString;\n"],"names":["MAIN_DOMAINS","threads","Math","min","navigator","hardwareConcurrency","App","id","hash","version","versionFull","build","langPackVersion","langPack","langPackCode","domains","baseDcId","isMainDomain","includes","location","hostname","suffix","cryptoWorkers","name","stores","blobConstruct","blobParts","mimeType","Array","isArray","safeMimeType","Blob","type","blobSafeMimeType","indexOf","bufferConcats","args","length","reduce","acc","v","byteLength","tmp","Uint8Array","lastLength","forEach","b","set","ArrayBuffer","deferredPromise","deferredHelper","isFulfilled","isRejected","notify","notifyAll","lastNotify","listeners","callback","addNotifyListener","push","deferred","Promise","resolve","reject","value","catch","finally","cancel","Object","assign","IS_SERVICE_WORKER","ServiceWorkerGlobalScope","self","IS_WEB_WORKER","WorkerGlobalScope","IS_WORKER","postMessage","listener","err","console","error","notifyServiceWorker","all","clients","matchAll","includeUncontrolled","then","slice","bind","noop","copy","obj","Date","getTime","map","el","isView","clonedObj","constructor","prop","hasOwnProperty","deepEqual","x","y","ok","keys","tx","every","key","isObject","object","safeAssign","fromObject","i","undefined","validateInitObject","initObject","currentObject","onReplace","previousKey","ignorePaths","path","_path","has","String","prototype","toUserId","this","toChatId","toPeerId","isChat","isPeerId","test","toString","Number","abs","newMethod","originMethod","call","arrays","Uint16Array","Uint32Array","nextRandomUint","bits","array","crypto","getRandomValues","randomLong","recordPromiseBound","log","promise","description","perf","performance","now","warn","recordPromise","pause","ms","setTimeout","throttle","fn","shouldRunFirst","isPending","interval","_args","setInterval","clearInterval","capitalizeFirstLetter","string","charAt","toUpperCase","toggleStorages","enabled","clearWrite","tsNow","seconds","t","getServerMessageId","messageId","toServer","q","l","used","clearMessageId","MESSAGE_ID_INCREMENT","MESSAGE_ID_OFFSET","isAnyChat","peerId","isUser","CryptoMessagePort","super","lastIndex","invokeCryptoNew","method","transfer","payload","result","sendPortIndex","sendPorts","invoke","invokeCrypto","cryptoMessagePort","CacheStorageController","dbName","useStorage","STORAGES","openDatabase","openDbPromise","caches","open","delete","entryName","timeoutOperation","cache","deleteAll","get","match","save","response","put","getFile","fileName","saveFile","blob","Response","headers","size","rejected","timeout","res","clearTimeout","prepareWriting","fileSize","getWriter","static","storage","MemoryWriter","saveFileCallback","bytes","write","part","offset","endOffset","newBytes","truncate","trim","finalize","saveToStorage","getParts","replaceParts","parts","LogTypes","LOG_LEVELS","None","Error","Warn","Log","Debug","STYLES_SUPPORTED","IS_SAFARI","IS_FIREFOX","LOGGER_STYLES","methods","logger","prefix","ignoreDebugReset","style","originalPrefix","originalStyle","logType","setPrefix","newPrefix","setLevel","level","bindPrefix","MTProtoMessagePort","INSTANCE","concat","toJSON","onFinally","reason","matchUrlProtocol","text","ServiceMessagePort","LocalStorage","useCache","localStorage","getItem","JSON","parse","onlyLocal","stringified","stringify","setItem","saveLocal","removeItem","clear","toggleStorage","LocalStorageController","proxy","apply","sessionStorage","StateStorage","stateStorage","AppStorage","db","storeName","getPromises","Map","keysToSet","Set","saveDeferred","keysToDelete","deleteDeferred","savingFreezed","saveThrottled","from","values","e","deleteThrottled","getThrottled","isAvailable","getCache","getFromCache","setToCache","r","p","getAll","canUseStorage","add","names"],"sourceRoot":""} \ No newline at end of file diff --git a/public/147.bb5274ee5cc526f48754.chunk.js b/public/147.52e5e3f41bb7eb15ae10.chunk.js similarity index 68% rename from public/147.bb5274ee5cc526f48754.chunk.js rename to public/147.52e5e3f41bb7eb15ae10.chunk.js index 0075684b..a6a61b27 100644 --- a/public/147.bb5274ee5cc526f48754.chunk.js +++ b/public/147.52e5e3f41bb7eb15ae10.chunk.js @@ -1,2 +1,2 @@ -"use strict";(this.webpackChunktweb=this.webpackChunktweb||[]).push([[147],{4421:(e,t,s)=>{s.d(t,{Z:()=>a});var n=s(1655),i=s(6724),o=s(5003);const r=new Set(["NO_ENTRY_FOUND","STORAGE_OFFLINE","MIDDLEWARE","NO_AUTO_DOWNLOAD"]);class a{constructor(e=8){this.parallelLimit=e,this.queueId=0,this.queue=[],this.inProcess=new Set,this.lockPromise=null,this.unlockResolve=null,this.log=(0,o.kg)("LL",o.v9.Error),this.processQueue=(0,i.Z)((()=>this._processQueue()),8,!1)}clear(){this.inProcess.clear(),this.queue.length=0}lock(){this.lockPromise||(this.lockPromise=new Promise(((e,t)=>{this.unlockResolve=e})))}unlock(){this.unlockResolve&&(this.unlockResolve(),this.unlockResolve=this.lockPromise=null,this.processQueue())}processItem(e){return t=this,s=void 0,i=function*(){if(!this.lockPromise){this.inProcess.add(e);try{yield this.loadItem(e)}catch(e){r.has(null==e?void 0:e.type)||this.log.error("loadMediaQueue error:",e)}this.inProcess.delete(e),this.processQueue()}},new((n=void 0)||(n=Promise))((function(e,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var s;t.done?e(t.value):(s=t.value,s instanceof n?s:new n((function(e){e(s)}))).then(r,a)}l((i=i.apply(t,s||[])).next())}));var t,s,n,i}loadItem(e){return e.load()}getItem(){return this.queue.shift()}addElement(e,t){this.queue[e](t),this.processQueue()}_processQueue(e){if(!(!this.queue.length||this.lockPromise||this.parallelLimit>0&&this.inProcess.size>=this.parallelLimit))do{if(e?(0,n.Z)(this.queue,e):e=this.getItem(),!e)break;this.processItem(e),e=null}while(this.inProcess.size{s.d(t,{Z:()=>n});const n={Á:"A",Ă:"A",Ắ:"A",Ặ:"A",Ằ:"A",Ẳ:"A",Ẵ:"A",Ǎ:"A",Â:"A",Ấ:"A",Ậ:"A",Ầ:"A",Ẩ:"A",Ẫ:"A",Ä:"A",Ǟ:"A",Ȧ:"A",Ǡ:"A",Ạ:"A",Ȁ:"A",À:"A",Ả:"A",Ȃ:"A",Ā:"A",Ą:"A",Å:"A",Ǻ:"A",Ḁ:"A",Ⱥ:"A",Ã:"A",Ꜳ:"AA",Æ:"AE",Ǽ:"AE",Ǣ:"AE",Ꜵ:"AO",Ꜷ:"AU",Ꜹ:"AV",Ꜻ:"AV",Ꜽ:"AY",Ḃ:"B",Ḅ:"B",Ɓ:"B",Ḇ:"B",Ƀ:"B",Ƃ:"B",Ć:"C",Č:"C",Ç:"C",Ḉ:"C",Ĉ:"C",Ċ:"C",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ủ:"U",Ư:"U",Ứ:"U",Ự:"U",Ừ:"U",Ử:"U",Ữ:"U",Ȗ:"U",Ū:"U",Ṻ:"U",Ų:"U",Ů:"U",Ũ:"U",Ṹ:"U",Ṵ:"U",Ꝟ:"V",Ṿ:"V",Ʋ:"V",Ṽ:"V",Ꝡ:"VY",Ẃ:"W",Ŵ:"W",Ẅ:"W",Ẇ:"W",Ẉ:"W",Ẁ:"W",Ⱳ:"W",Ẍ:"X",Ẋ:"X",Ý:"Y",Ŷ:"Y",Ÿ:"Y",Ẏ:"Y",Ỵ:"Y",Ỳ:"Y",Ƴ:"Y",Ỷ:"Y",Ỿ:"Y",Ȳ:"Y",Ɏ:"Y",Ỹ:"Y",Ź:"Z",Ž:"Z",Ẑ:"Z",Ⱬ:"Z",Ż:"Z",Ẓ:"Z",Ȥ:"Z",Ẕ:"Z",Ƶ:"Z",IJ:"IJ",Œ:"OE",ᴀ:"A",ᴁ:"AE",ʙ:"B",ᴃ:"B",ᴄ:"C",ᴅ:"D",ᴇ:"E",ꜰ:"F",ɢ:"G",ʛ:"G",ʜ:"H",ɪ:"I",ʁ:"R",ᴊ:"J",ᴋ:"K",ʟ:"L",ᴌ:"L",ᴍ:"M",ɴ:"N",ᴏ:"O",ɶ:"OE",ᴐ:"O",ᴕ:"OU",ᴘ:"P",ʀ:"R",ᴎ:"N",ᴙ:"R",ꜱ:"S",ᴛ:"T",ⱻ:"E",ᴚ:"R",ᴜ:"U",ᴠ:"V",ᴡ:"W",ʏ:"Y",ᴢ:"Z",á:"a",ă:"a",ắ:"a",ặ:"a",ằ:"a",ẳ:"a",ẵ:"a",ǎ:"a",â:"a",ấ:"a",ậ:"a",ầ:"a",ẩ:"a",ẫ:"a",ä:"a",ǟ:"a",ȧ:"a",ǡ:"a",ạ:"a",ȁ:"a",à:"a",ả:"a",ȃ:"a",ā:"a",ą:"a",ᶏ:"a",ẚ:"a",å:"a",ǻ:"a",ḁ:"a",ⱥ:"a",ã:"a",ꜳ:"aa",æ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",ɿ:"r",ś:"s",ṥ:"s",š:"s",ṧ:"s",ş:"s",ŝ:"s",ș:"s",ṡ:"s",ṣ:"s",ṩ:"s",ʂ:"s",ᵴ:"s",ᶊ:"s",ȿ:"s",ɡ:"g",ß:"ss",ᴑ:"o",ᴓ:"o",ᴝ:"u",ť:"t",ţ:"t",ṱ:"t",ț:"t",ȶ:"t",ẗ:"t",ⱦ:"t",ṫ:"t",ṭ:"t",ƭ:"t",ṯ:"t",ᵵ:"t",ƫ:"t",ʈ:"t",ŧ:"t",ᵺ:"th",ɐ:"a",ᴂ:"ae",ǝ:"e",ᵷ:"g",ɥ:"h",ʮ:"h",ʯ:"h",ᴉ:"i",ʞ:"k",ꞁ:"l",ɯ:"m",ɰ:"m",ᴔ:"oe",ɹ:"r",ɻ:"r",ɺ:"r",ⱹ:"r",ʇ:"t",ʌ:"v",ʍ:"w",ʎ:"y",ꜩ:"tz",ú:"u",ŭ:"u",ǔ:"u",û:"u",ṷ:"u",ü:"u",ǘ:"u",ǚ:"u",ǜ:"u",ǖ:"u",ṳ:"u",ụ:"u",ű:"u",ȕ:"u",ù:"u",ủ:"u",ư:"u",ứ:"u",ự:"u",ừ:"u",ử:"u",ữ:"u",ȗ:"u",ū:"u",ṻ:"u",ų:"u",ᶙ:"u",ů:"u",ũ:"u",ṹ:"u",ṵ:"u",ᵫ:"ue",ꝸ:"um",ⱴ:"v",ꝟ:"v",ṿ:"v",ʋ:"v",ᶌ:"v",ⱱ:"v",ṽ:"v",ꝡ:"vy",ẃ:"w",ŵ:"w",ẅ:"w",ẇ:"w",ẉ:"w",ẁ:"w",ⱳ:"w",ẘ:"w",ẍ:"x",ẋ:"x",ᶍ:"x",ý:"y",ŷ:"y",ÿ:"y",ẏ:"y",ỵ:"y",ỳ:"y",ƴ:"y",ỷ:"y",ỿ:"y",ȳ:"y",ẙ:"y",ɏ:"y",ỹ:"y",ź:"z",ž:"z",ẑ:"z",ʑ:"z",ⱬ:"z",ż:"z",ẓ:"z",ȥ:"z",ẕ:"z",ᵶ:"z",ᶎ:"z",ʐ:"z",ƶ:"z",ɀ:"z",ff:"ff",ffi:"ffi",ffl:"ffl",fi:"fi",fl:"fl",ij:"ij",œ:"oe",st:"st",ₐ:"a",ₑ:"e",ᵢ:"i",ⱼ:"j",ₒ:"o",ᵣ:"r",ᵤ:"u",ᵥ:"v",ₓ:"x",Ё:"YO",Й:"I",Ц:"TS",У:"U",К:"K",Е:"E",Н:"N",Г:"G",Ш:"SH",Щ:"SCH",З:"Z",Х:"H",Ъ:"",ё:"yo",й:"i",ц:"ts",у:"u",к:"k",е:"e",н:"n",г:"g",ш:"sh",щ:"sch",з:"z",х:"h",ъ:"",Ф:"F",Ы:"I",В:"V",А:"A",П:"P",Р:"R",О:"O",Л:"L",Д:"D",Ж:"ZH",Э:"E",ф:"f",ы:"i",в:"v",а:"a",п:"p",р:"r",о:"o",л:"l",д:"d",ж:"zh",э:"e",Я:"Ya",Ч:"CH",С:"S",М:"M",И:"I",Т:"T",Ь:"",Б:"B",Ю:"YU",я:"ya",ч:"ch",с:"s",м:"m",и:"i",т:"t",ь:"",б:"b",ю:"yu"}},6690:(e,t,s)=>{function n(e){return[...new Set(e)]}s.d(t,{Z:()=>n})},7238:(e,t,s)=>{function n(e){return e.reduce(((e,t)=>(e.push(...t),e)),[])}s.d(t,{Z:()=>n})},7625:(e,t,s)=>{function n(e,t){for(let s=e.length-1;s>=0;--s)t(e[s],s,e)}s.d(t,{Z:()=>n})},6519:(e,t,s)=>{function n(e,t,s,n){if("function"!=typeof s){const e=s;s=t=>t[e]}const i=s(t);if(void 0===n&&-1!==(n=e.indexOf(t))){const t=e[n-1],o=e[n+1];if((!t||s(t)>=i)&&(!o||s(o)<=i))return n;e.splice(n,1)}const o=e.length;if(!o||i<=s(e[o-1]))return e.push(t)-1;if(i>=s(e[0]))return e.unshift(t),0;for(let n=0;ns(e[n]))return e.splice(n,0,t),n;return console.error("wtf",e,t),e.indexOf(t)}s.d(t,{Z:()=>n})},8938:(e,t,s)=>{function n(e){}s.d(t,{Z:()=>n})},3019:(e,t,s)=>{function n(e,t){return new Promise((s=>{const n=new FileReader;n.addEventListener("loadend",(e=>{s(e.target.result)})),n[t](e)}))}s.d(t,{Z:()=>n})},9895:(e,t,s)=>{function n(e,t){const s=e.length;if(s!==t.length)return!1;for(let n=0;nn})},3306:(e,t,s)=>{function n(e){const t=e.length,s=new Uint8Array(Math.ceil(t/2));let n=0;t%2&&(s[n++]=parseInt(e.charAt(0),16));for(let i=n;in})},9818:(e,t,s)=>{function n(e){return e instanceof Uint8Array?e:"string"==typeof e?(new TextEncoder).encode(e):new Uint8Array(e)}s.d(t,{Z:()=>n})},6654:(e,t,s)=>{function n(e,t){return e instanceof Promise?e.then(t):t(e)}s.d(t,{Z:()=>n})},2202:(e,t,s)=>{s.d(t,{Z:()=>o});var n=s(2219);let i=0;function o(e){let t;const s=null==e?void 0:e.type;if(s){const e=`${n.Z}_${i++}.${s.split("/")[1]}`;t=["image/jpeg","image/png","image/bmp"].indexOf(s)>=0?"photo"+e:0===s.indexOf("audio/")||["video/ogg"].indexOf(s)>=0?"audio"+e:0===s.indexOf("video/")?"video"+e:"document"+e}else t=`upload-${n.Z}_${i++}`;return t}},3624:(e,t,s)=>{s.d(t,{k:()=>r});var n=s(1655);const i=(0,s(5471).Z)("MIDDLEWARE");class o{constructor(){this.details={cleaned:!1,inner:[],onCleanCallbacks:[]},this.onDestroyCallbacks=[],this.onDestroy=e=>{if(this.destroyed)return e();this.onDestroyCallbacks.push(e)}}clean(){const e=this.details;e.cleaned=!0,e.inner.splice(0,e.inner.length).forEach((e=>e.destroy())),e.onCleanCallbacks.splice(0,e.onCleanCallbacks.length).forEach((e=>e())),this.details={cleaned:!1,inner:[],onCleanCallbacks:[]}}destroy(){this.destroyed=!0,this.clean(),this.onDestroyCallbacks.splice(0,this.onDestroyCallbacks.length).forEach((e=>e())),this.parent&&((0,n.Z)(this.parent.details.inner,this),this.parent=void 0)}get(e){const t=this.details,s=()=>!t.cleaned&&(!e||e());return s.create=()=>{if(!s())throw i;const e=r();return e.parent=this,t.inner.push(e),e},s.onClean=e=>{if(!s())return e();t.onCleanCallbacks.push(e)},s.onDestroy=this.onDestroy,s}}function r(){return new o}},8027:(e,t,s)=>{function n(e,t){const s={writable:!0,configurable:!0},n={};t.forEach((t=>{e.hasOwnProperty(t)||(n[t]=s)})),Object.defineProperties(e,n)}s.d(t,{Z:()=>n})},9750:(e,t,s)=>{function n(e,t){const s=t.split(".");let n=e;return s.forEach((e=>{e&&(n=n[e])})),n}s.d(t,{Z:()=>n})},7401:(e,t,s)=>{function n(e,t="asc"){if(!e)return[];const s=e instanceof Map?[...e.keys()]:Object.keys(e).map((e=>+e));return"asc"===t?s.sort(((e,t)=>e-t)):s.sort(((e,t)=>t-e))}s.d(t,{Z:()=>n})},5701:(e,t,s)=>{s.d(t,{Z:()=>o});var n=s(6761),i=s(319);function o(e,t,s=!0,o=!0){let r,a,l,c,u=!1;const h=t=>{const s=l,n=c;try{s(e.apply(null,t))}catch(e){console.error("debounce error",e),n(e)}},d=(...e)=>{a||(a=new Promise(((e,t)=>(l=e,c=t)))),r?(clearTimeout(r),u=!0,c(),a=new Promise(((e,t)=>(l=e,c=t)))):s&&(h(e),u=!1);const d=n.Z.setTimeout((()=>{!o||s&&!u||h(e),r===d&&(r=a=l=c=void 0,u=!1)}),t);return r=d,a.catch(i.Z),a};return d.clearTimeout=()=>{r&&(n.Z.clearTimeout(r),c(),r=a=l=c=void 0,u=!1)},d.isDebounced=()=>!!r,d}},252:(e,t,s)=>{s.d(t,{D:()=>n,Z:()=>a});var n,i=s(410),o=s(1655);function r(e,t){if(e.toExponential){const s=e-t;return s<0?-1:s>0?1:0}return function(e,t){const s=e.length;if(s!==t.length){const e=s-t.length;return e<0?-1:e>0?1:0}for(let n=0;n=2)for(let t=0,s=this.slices.length;t=0)return{slice:t,offset:e===t[n]?n:n-1}}if(t&&t.isEnd(n.Top))return{slice:t,offset:t.length}}sliceMe(e,t,s){let i=this.slice,o=0,r=0;if(e){const t=this.findSliceOffset(e);if(!t)return;i=t.slice,o=r=t.offset,i.includes(e)&&(r+=1)}const a=Math.max(r+t,0),l=r+t+s,c=i.slice(a,l),u=t<0?s+t:s,h=Math.abs(t),d=i.length-r>=u||!!i.isEnd(n.Top)&&(c.setEnd(n.Top),!0),f=r-h>=0||!!i.isEnd(n.Bottom)&&(c.setEnd(n.Bottom),!0);return{slice:c,offsetIdOffset:o,fulfilled:n.None|(d&&f?n.Both:(d?n.Top:n.None)|(f?n.Bottom:n.None))}}unshift(...e){let t=this.first;t.length?t.isEnd(n.Bottom)||(t=this.constructSlice(),t.setEnd(n.Bottom),this.slices.unshift(t)):t.setEnd(n.Bottom),t.unshift(...e)}push(...e){let t=this.last;t.length?t.isEnd(n.Top)||(t=this.constructSlice(),t.setEnd(n.Top),this.slices.push(t)):t.setEnd(n.Top),t.push(...e)}delete(e){const t=this.findSlice(e);return!!t&&(t.slice.splice(t.index,1),!0)}deleteSlice(e){(0,o.Z)(this.slices,e)}toJSON(){const e={slices:this.slices.map((e=>({values:e.slice(),isEnd:e.getEnds()})))};return JSON.stringify(e)}static fromJSON(e){const t=JSON.parse(e),s=new a;return t.slices.forEach((e=>{const t=s.insertSlice(e.values)||s.first;e.isEnd.top&&t.setEnd(n.Top),e.isEnd.bottom&&t.setEnd(n.Bottom)})),s}}i.GO&&(i.GO.SlicedArray=a)},8794:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(1507);function i(e){return e.icons.find((e=>e.name===n.BP))}},2566:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(2946);function i(e){return e.peer?(0,n.Z)(e.peer):e.user_id.toPeerId()}},7120:(e,t,s)=>{function n(e,t,s,n){if(!e)return!1;if(e.pFlags.deactivated&&"view_messages"!==t)return!1;const i=void 0===s;if(e.pFlags.creator&&i)return!0;if("chatForbidden"===e._||"channelForbidden"===e._||e.pFlags.left&&!e.pFlags.megagroup)return!1;if(!s&&!(s=e.admin_rights||e.banned_rights||e.default_banned_rights))return!1;let o={};s&&(o=s.pFlags);const r="chatAdminRights"===s._;switch(t){case"embed_links":case"send_games":case"send_gifs":case"send_inline":case"send_media":case"send_messages":case"send_polls":case"send_stickers":case"send_photos":case"send_videos":case"send_roundvideos":case"send_audios":case"send_voices":case"send_docs":case"send_plain":if(!n&&e.pFlags.left)return!1;if("chatBannedRights"===s._&&o[t])return!1;if("channel"===e._&&!e.pFlags.megagroup&&!o.post_messages)return!1;break;case"delete_messages":case"manage_call":return!!o[t];case"pin_messages":return r?o[t]||!!o.post_messages:!o[t];case"change_info":case"invite_users":return r?!!o[t]:!o[t];case"change_type":case"delete_chat":return!1;case"edit_messages":case"manage_topics":return r&&!!o[t];case"ban_users":case"change_permissions":return r&&!!o.ban_users;case"view_participants":return!("chat"!==e._&&e.pFlags.broadcast&&!e.pFlags.creator&&!e.admin_rights)}return!0}s.d(t,{Z:()=>n})},8050:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(3385);function i(e,t=(0,n.Z)(e.folder_id)){return null==e?void 0:e[t]}},3385:(e,t,s)=>{function n(e=0){return`index_${e}`}s.d(t,{Z:()=>n})},6658:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(7072);function i(e,t,s,i){const o=(0,n.Z)(e,null==t?void 0:t.type);let r;return r="photoSize"===(null==t?void 0:t._)?e.sticker?"image/webp":e.mime_type.startsWith("image/")?e.mime_type:"image/jpeg":e.mime_type||"application/octet-stream",{dcId:e.dc_id,location:o,size:t?t.size:e.size,mimeType:r,fileName:e.file_name,queueId:s,onlyCache:i}}},7072:(e,t,s)=>{function n(e,t){return{_:"inputDocumentFileLocation",id:e.id,access_hash:e.access_hash,file_reference:e.file_reference,thumb_size:t}}s.d(t,{Z:()=>n})},7086:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(8801);function i(e){return(0,n.P)(e.location,e)}},1243:(e,t,s)=>{s.d(t,{Z:()=>a});var n=s(6658),i=s(7667),o=s(3114),r=s(7086);function a(e){const{media:t,thumb:s,queueId:a,onlyCache:l}=e;let c;var u;return"document"===t._?c=(0,n.Z)(t,s,a,l):"photo"===t._?c=(0,i.Z)(t,s,a,l):(0,o.Z)(t)&&(c={dcId:0,location:{_:"inputWebFileLocation",access_hash:(u=t).access_hash,url:u.url},size:u.size,mimeType:u.mime_type}),c.downloadId=e.downloadId,{fileName:(0,r.Z)(c),downloadOptions:c}}},6034:(e,t,s)=>{s.d(t,{Z:()=>o});var n=s(6848),i=s(5880);function o(e,t){if(typeof e!=typeof t)return!1;if(!(0,i.Z)(e))return!0;if(e._!==t._)return!1;if("draftMessage"===e._&&t._===e._){if(e.reply_to_msg_id!==t.reply_to_msg_id)return!1;if(!(0,n.Z)(e.entities,t.entities))return!1;if(e.message!==t.message)return!1;if(e.pFlags.no_webpage!==t.pFlags.no_webpage)return!1}return!0}},515:(e,t,s)=>{function n(e,t){return e+"_"+t}s.d(t,{Z:()=>n})},3781:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(7082);function i(e){const t=n.t;return e>=t?e:t+e*n.o}},6566:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(2342);function i(e,t,s){if("inputMessagesFilterEmpty"===e)return t;const i=[];if(!t.length)return i;let o=!0;const r={},a=[],l=[];switch(e){case"inputMessagesFilterPhotos":r.messageMediaPhoto=!0;break;case"inputMessagesFilterPhotoVideo":r.messageMediaPhoto=!0,r.messageMediaDocument=!0,a.push("video");break;case"inputMessagesFilterVideo":r.messageMediaDocument=!0,a.push("video");break;case"inputMessagesFilterDocument":r.messageMediaDocument=!0,a.push(void 0,"photo","pdf");break;case"inputMessagesFilterVoice":r.messageMediaDocument=!0,a.push("voice");break;case"inputMessagesFilterRoundVoice":r.messageMediaDocument=!0,a.push("round","voice");break;case"inputMessagesFilterRoundVideo":r.messageMediaDocument=!0,a.push("round");break;case"inputMessagesFilterMusic":r.messageMediaDocument=!0,a.push("audio");break;case"inputMessagesFilterUrl":r.url=!0;break;case"inputMessagesFilterChatPhotos":r.avatar=!0;break;default:o=!1}if(!o)return i;for(let e=0,o=t.length;ee.includes(t._)))||(0,n.Z)(o.message))&&(c=!0)}}else r.avatar&&o.action&&["messageActionChannelEditPhoto","messageActionChatEditPhoto","messageActionChannelEditVideo","messageActionChatEditVideo"].includes(o.action._)&&(c=!0);if(c&&(i.push(o),i.length>=s))break}return i}},2381:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(8938);function i(e){let t,s=0;for(const i of e)if((0,n.Z)(i),i.message){if(++s>1)break;t=i}return s>1&&(t=void 0),t}},4993:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(1507);function i(e,t){var s;let i;const o=e.reply_to;return!o||t&&!o.pFlags.forum_topic?t&&(i="messageService"===e._&&"messageActionTopicCreate"===(null===(s=e.action)||void 0===s?void 0:s._)?e.mid:n.Ox):i=o.reply_to_top_id||o.reply_to_msg_id,i}},5102:(e,t,s)=>{function n(e){if(!e)return[];const t=e.usernames;return t?t.filter((e=>e.pFlags.active)).map((e=>e.username)):e.username?[e.username]:[]}s.d(t,{Z:()=>n})},7256:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(7419);function i(e){if(e&&!(0,n.Z)(e))return null==e?void 0:e.photo}},7419:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(677);function i(e){const t=null==e?void 0:e.restriction_reason;return!!(t&&e.pFlags.restricted&&(0,n.X)(t))}},7667:(e,t,s)=>{function n(e,t,s,n){const i="document"===e._;if(!t||"photoSizeEmpty"===t._)throw new Error("photoSizeEmpty!");const o=!("photoSize"!==t._&&"photoSizeProgressive"!==t._||!e.access_hash||!e.file_reference),r={_:i?"inputDocumentFileLocation":"inputPhotoFileLocation",id:e.id,access_hash:e.access_hash,file_reference:e.file_reference,thumb_size:t.type};return{dcId:e.dc_id,location:r,size:o?t.size:void 0,mimeType:"image/jpeg",queueId:s,onlyCache:n}}s.d(t,{Z:()=>n})},5285:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(6848);function i(e,t){return(0,n.Z)(e,t)}},13:(e,t,s)=>{function n(e){var t;return null===(t=e.video_thumbs)||void 0===t?void 0:t[0]}s.d(t,{Z:()=>n})},8493:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(1507);function i(e){return!(!e||e.pFlags.deleted||e.id.toPeerId()===n.hj)}},3114:(e,t,s)=>{function n(e){return!(!e||"webDocument"!==e._&&"webDocumentNoProxy"!==e._)}s.d(t,{Z:()=>n})},9174:(e,t,s)=>{var n;s.d(t,{Q:()=>n}),function(e){e[e.Connected=0]="Connected",e[e.Connecting=1]="Connecting",e[e.Closed=2]="Closed",e[e.TimedOut=3]="TimedOut"}(n||(n={}))},6875:(e,t,s)=>{s.d(t,{Z:()=>i});const n=new Set(["messageEntityBold","messageEntityItalic","messageEntityCode","messageEntityPre","messageEntityUnderline","messageEntityStrike","messageEntityBlockquote","messageEntitySpoiler"]);function i(e){for(let t=0;tn.has(e._)&&i!==t&&e._===s._&&e.offset-s.length===s.offset)),-1!==i){const t=e[i];s.length+=t.length,e.splice(i,1)}}while(-1!==i)}}},1379:(e,t,s)=>{function n(e,t){const s=e.slice(0,t.offset),n=function(e){const t="⠁⠂⠄⠈⠐⠠⡀⢀⠃⠅⠆⠉⠊⠌⠑⠒⠔⠘⠡⠢⠤⠨⠰⡁⡂⡄⡈⡐⡠⢁⢂⢄⢈⢐⢠⣀⠇⠋⠍⠎⠓⠕⠖⠙⠚⠜⠣⠥⠦⠩⠪⠬⠱⠲⠴⠸⡃⡅⡆⡉⡊⡌⡑⡒⡔⡘⡡⡢⡤⡨⡰⢃⢅⢆⢉⢊⢌⢑⢒⢔⢘⢡⢢⢤⢨⢰⣁⣂⣄⣈⣐⣠⠏⠗⠛⠝⠞⠧⠫⠭⠮⠳⠵⠶⠹⠺⠼⡇⡋⡍⡎⡓⡕⡖⡙⡚⡜⡣⡥⡦⡩⡪⡬⡱⡲⡴⡸⢇⢋⢍⢎⢓⢕⢖⢙⢚⢜⢣⢥⢦⢩⢪⢬⢱⢲⢴⢸⣃⣅⣆⣉⣊⣌⣑⣒⣔⣘⣡⣢⣤⣨⣰⠟⠯⠷⠻⠽⠾⡏⡗⡛⡝⡞⡧⡫⡭⡮⡳⡵⡶⡹⡺⡼⢏⢗⢛⢝⢞⢧⢫⢭⢮⢳⢵⢶⢹⢺⢼⣇⣋⣍⣎⣓⣕⣖⣙⣚⣜⣣⣥⣦⣩⣪⣬⣱⣲⣴⣸⠿⡟⡯⡷⡻⡽⡾⢟⢯⢷⢻⢽⢾⣏⣗⣛⣝⣞⣧⣫⣭⣮⣳⣵⣶⣹⣺⣼⡿⢿⣟⣯⣷⣻⣽⣾⣿",s=t.length,n=[];for(let i=0;in})},8859:(e,t,s)=>{s.d(t,{Z:()=>o});var n=s(2423);const i=new Set(["messageEntityPre","messageEntityCode"]);function o(e,t){let s=-1;return e.find((e=>(i.has(e._)&&(s=e.offset+e.length),t.offset=e.offset&&t.length+t.offset<=e.length+e.offset))))}},7746:(e,t,s)=>{function n(e,t){return e.replace(/[\u2640\u2642\u2764](?!\ufe0f)/g,((e,s,n)=>{if(t){const n=e.length;s+=n,t.forEach((e=>{const t=e.offset+e.length;t===s?e.length+=n:t>s&&(e.offset+=n)}))}return e+"️"}))}s.d(t,{Z:()=>n})},2342:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(2423);function i(e){return e?e.match(n.it):null}},6241:(e,t,s)=>{s.d(t,{Z:()=>o});var n=s(8859),i=s(1346);function o(e,t){const s=t.filter((t=>!(0,n.Z)(e,t)));e.push(...s),(0,i.Z)(e);for(let t=0;t{s.d(t,{Z:()=>c});var n=s(2423);const i=["abogado","ac","academy","accountants","active","actor","ad","adult","ae","aero","af","ag","agency","ai","airforce","al","allfinanz","alsace","am","amsterdam","an","android","ao","apartments","aq","aquarelle","ar","archi","army","arpa","as","asia","associates","at","attorney","au","auction","audio","autos","aw","ax","axa","az","ba","band","bank","bar","barclaycard","barclays","bargains","bayern","bb","bd","be","beer","berlin","best","bf","bg","bh","bi","bid","bike","bingo","bio","biz","bj","black","blackfriday","bloomberg","blue","bm","bmw","bn","bnpparibas","bo","boo","boutique","br","brussels","bs","bt","budapest","build","builders","business","buzz","bv","bw","by","bz","bzh","ca","cab","cal","camera","camp","cancerresearch","canon","capetown","capital","caravan","cards","care","career","careers","cartier","casa","cash","cat","catering","cc","cd","center","ceo","cern","cf","cg","ch","channel","chat","cheap","christmas","chrome","church","ci","citic","city","ck","cl","claims","cleaning","click","clinic","clothing","club","cm","cn","co","coach","codes","coffee","college","cologne","com","community","company","computer","condos","construction","consulting","contractors","cooking","cool","coop","country","cr","credit","creditcard","cricket","crs","cruises","cu","cuisinella","cv","cw","cx","cy","cymru","cz","dabur","dad","dance","dating","day","dclk","de","deals","degree","delivery","democrat","dental","dentist","desi","design","dev","diamonds","diet","digital","direct","directory","discount","dj","dk","dm","dnp","do","docs","domains","doosan","durban","dvag","dz","eat","ec","edu","education","ee","eg","email","emerck","energy","engineer","engineering","enterprises","equipment","er","es","esq","estate","et","eu","eurovision","eus","events","everbank","exchange","expert","exposed","fail","farm","fashion","feedback","fi","finance","financial","firmdale","fish","fishing","fit","fitness","fj","fk","flights","florist","flowers","flsmidth","fly","fm","fo","foo","forsale","foundation","fr","frl","frogans","fund","furniture","futbol","ga","gal","gallery","garden","gb","gbiz","gd","ge","gent","gf","gg","ggee","gh","gi","gift","gifts","gives","gl","glass","gle","global","globo","gm","gmail","gmo","gmx","gn","goog","google","gop","gov","gp","gq","gr","graphics","gratis","green","gripe","gs","gt","gu","guide","guitars","guru","gw","gy","hamburg","hangout","haus","healthcare","help","here","hermes","hiphop","hiv","hk","hm","hn","holdings","holiday","homes","horse","host","hosting","house","how","hr","ht","hu","ibm","id","ie","ifm","il","im","immo","immobilien","in","industries","info","ing","ink","institute","insure","int","international","investments","io","iq","ir","irish","is","it","iwc","jcb","je","jetzt","jm","jo","jobs","joburg","jp","juegos","kaufen","kddi","ke","kg","kh","ki","kim","kitchen","kiwi","km","kn","koeln","kp","kr","krd","kred","kw","ky","kyoto","kz","la","lacaixa","land","lat","latrobe","lawyer","lb","lc","lds","lease","legal","lgbt","li","lidl","life","lighting","limited","limo","link","lk","loans","london","lotte","lotto","lr","ls","lt","ltda","lu","luxe","luxury","lv","ly","ma","madrid","maison","management","mango","market","marketing","marriott","mc","md","me","media","meet","melbourne","meme","memorial","menu","mg","mh","miami","mil","mini","mk","ml","mm","mn","mo","mobi","moda","moe","monash","money","mormon","mortgage","moscow","motorcycles","mov","mp","mq","mr","ms","mt","mu","museum","mv","mw","mx","my","mz","na","nagoya","name","navy","nc","ne","net","network","neustar","new","nexus","nf","ng","ngo","nhk","ni","nico","ninja","nl","no","np","nr","nra","nrw","ntt","nu","nyc","nz","okinawa","om","one","ong","onl","ooo","org","organic","osaka","otsuka","ovh","pa","paris","partners","parts","party","pe","pf","pg","ph","pharmacy","photo","photography","photos","physio","pics","pictures","pink","pizza","pk","pl","place","plumbing","pm","pn","pohl","poker","porn","post","pr","praxi","press","pro","prod","productions","prof","properties","property","ps","pt","pub","pw","py","qa","qpon","quebec","re","realtor","recipes","red","rehab","reise","reisen","reit","ren","rentals","repair","report","republican","rest","restaurant","reviews","rich","rio","rip","ro","rocks","rodeo","rs","rsvp","ru","ruhr","rw","ryukyu","sa","saarland","sale","samsung","sarl","saxo","sb","sc","sca","scb","schmidt","schule","schwarz","science","scot","sd","se","services","sew","sexy","sg","sh","shiksha","shoes","shriram","si","singles","sj","sk","sky","sl","sm","sn","so","social","software","sohu","solar","solutions","soy","space","spiegel","sr","st","style","su","supplies","supply","support","surf","surgery","suzuki","sv","sx","sy","sydney","systems","sz","taipei","tatar","tattoo","tax","tc","td","technology","tel","temasek","tennis","tf","tg","th","tienda","tips","tires","tirol","tj","tk","tl","tm","tn","to","today","tokyo","tools","top","toshiba","town","toys","tp","tr","trade","training","travel","trust","tt","tui","tv","tw","tz","ua","ug","uk","university","uno","uol","us","uy","uz","va","vacations","vc","ve","vegas","ventures","versicherung","vet","vg","vi","viajes","video","villas","vision","vlaanderen","vn","vodka","vote","voting","voto","voyage","vu","wales","wang","watch","webcam","website","wed","wedding","wf","whoswho","wien","wiki","williamhill","wme","work","works","world","ws","wtc","wtf","佛山","集团","在线","한국","ভারত","八卦","موقع","公益","公司","移动","我爱你","москва","қаз","онлайн","сайт","срб","淡马锡","орг","삼성","சிங்கப்பூர்","商标","商店","商城","дети","мкд","中文网","中信","中国","中國","谷歌","భారత్","ලංකා","ભારત","भारत","网店","संगठन","网络","укр","香港","台湾","台灣","手机","мон","الجزائر","عمان","ایران","امارات","بازار","الاردن","بھارت","المغرب","السعودية","مليسيا","شبكة","გე","机构","组织机构","ไทย","سورية","рус","рф","تونس","みんな","グーグル","世界","ਭਾਰਤ","网址","游戏","vermögensberater","vermögensberatung","企业","مصر","قطر","广东","இலங்கை","இந்தியா","新加坡","فلسطين","政务","xxx","xyz","yachts","yandex","ye","yoga","yokohama","youtube","yt","za","zip","zm","zone","zuerich","zw"];function o(e){for(var t=e.length,s=e.split("(").length-1,n=e.split(")").length-1;n>s&&")"===e.charAt(t-1);)e=e.substr(0,t-1),n--,t--;return s>n&&(e=e.replace(/\)+$/,"")),e}var r=s(3447),a=s(671);function l(e){const t=(0,a.N0)(e).replace(/-?fe0f/g,"");if(r.Z.hasOwnProperty(t))return t}function c(e){let t,s=e;const r=[];let a,c=0;for(n.$2.lastIndex=0;t=s.match(n.$2);){if(a=c+t.index,t[3])r.push({_:"messageEntityMention",offset:a+t[1].length,length:t[2].length+t[3].length});else if(t[4])if(n.E.test(t[4]))r.push({_:"messageEntityEmail",offset:a,length:t[4].length});else{let e,s=t[5];const n=t[6];if(n){if(s||"xn--"!==n.substr(0,4)&&-1===i.indexOf(n.toLowerCase())||(s="http://"),s){const n=o(t[4]);n.length!==t[4].length&&(t[4]=n),e=(t[5]?"":s)+t[4]}}else e=(t[5]?"":"http://")+t[4];e&&r.push({_:"messageEntityUrl",offset:a,length:t[4].length})}else if(t[7])r.push({_:"messageEntityLinebreak",offset:a,length:1});else if(t[8]){const e=l(t[8]);e&&r.push({_:"messageEntityEmoji",offset:a,length:t[8].length,unicode:e})}else if(t[11])r.push({_:"messageEntityHashtag",offset:a+(t[10]?t[10].length:0),length:t[11].length});else if(t[13])r.push({_:"messageEntityBotCommand",offset:a+(t[11]?t[11].length:0)+(t[12]?t[12].length:0),length:1+t[13].length+(t[14]?1+t[14].length:0),unsafe:!0});else if(t[16]){const e=t[16],s=e.split(":"),n=s.length,i=3===n?+s[0]:0,o=+s[3===n?1:0],l=+s[n-1];r.push({_:"messageEntityTimestamp",offset:a+(/\D/.test(t[0][0])?1:0),length:e.length,raw:e,time:3600*i+60*o+l})}s=s.substr(t.index+t[0].length),c+=t.index+t[0].length}return r}},2821:(e,t,s)=>{s.d(t,{Z:()=>a});var n=s(2423),i=s(6875),o=s(8859),r=s(6241);function a(e,t,s){const a=[];let l=!1;const c=e=>(0,o.Z)(t,e)?l=!1:(a.push(e),l=!0),u=[];let h,d=0;for(;h=e.match(n.QB);){const t=d+h.index;u.push(e.substr(0,h.index));const s=h[3]||h[8]||h[11]||h[13];let i;if(d-=s.length,d+=s.length,l=!1,s.match(/^`*$/))u.push(h[0]);else if(h[3])i={_:"messageEntityPre",language:"",offset:t+h[1].length,length:s.length},c(i)&&("\n"===h[5]&&(h[5]="",d-=1),u.push(h[1]+s+h[5]),d-=h[2].length+h[4].length);else if(h[7]){const e=""===h[6];i={_:n.SC[h[7]],offset:t+(e?0:h[6].length),length:s.length},c(i)&&(e?u.push(s):u.push(h[6]+s+h[9]),d-=2*h[7].length+(e?2:0))}else h[11]?(i={_:"messageEntityMentionName",user_id:h[10].toUserId(),offset:t,length:s.length},c(i)&&(u.push(s),d-=h[0].length-s.length)):h[12]&&(i={_:"messageEntityTextUrl",url:h[14],offset:t,length:s.length},c(i)&&(u.push(s),d-=h[12].length-s.length));l||u.push(h[0]),e=e.substr(h.index+h[0].length),d+=h.index+h[0].length}u.push(e);let f=u.join("");f.replace(/\s+/g,"").length||(f=e,a.splice(0,a.length)),(0,r.Z)(t,a),(0,i.Z)(t);let g=f.length;if(!s){f=f.replace(/^\s*/,"");let e=g-f.length;e&&t.forEach((t=>{t.offset=Math.max(0,t.offset-e)})),f=f.replace(/\s*$/,""),e=g-f.length,g=f.length,e&&t.forEach((e=>{e.offset+e.length>g&&(e.length=g-e.offset)}))}return f}},1346:(e,t,s)=>{function n(e){e.sort(((e,t)=>e.offset-t.offset||t.length-e.length))}s.d(t,{Z:()=>n})},2491:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(1379);function i(e,t=[]){return t.forEach((t=>{"messageEntitySpoiler"===t._&&(e=(0,n.Z)(e,t).text)})),e}},7381:(e,t,s)=>{s.d(t,{Z:()=>o});var n=s(467),i=s(7238);class o{constructor(e,t=0){this.options=e,this.minChars=t,this.fullTexts=new Map}indexObject(e,t){if(this.options&&t.trim()&&(t=(0,n.gV)(t,this.options)),!t)return this.fullTexts.delete(e),!1;this.fullTexts.set(e,t)}_search(e){const t=[],s=this.fullTexts,n=e.split(" "),i=n.length;return s.forEach(((e,s)=>{let o=!0,r=0;for(let t=0;tthis._search(e))));return s.sort(((e,t)=>e.fullTextLength-t.fullTextLength||t.foundChars-e.foundChars)),new Set(s.map((e=>e.what)))}}}}]); -//# sourceMappingURL=147.bb5274ee5cc526f48754.chunk.js.map \ No newline at end of file +"use strict";(this.webpackChunktweb=this.webpackChunktweb||[]).push([[147],{4421:(e,t,s)=>{s.d(t,{Z:()=>a});var n=s(1655),i=s(6724),o=s(5003);const r=new Set(["NO_ENTRY_FOUND","STORAGE_OFFLINE","MIDDLEWARE","NO_AUTO_DOWNLOAD"]);class a{constructor(e=8){this.parallelLimit=e,this.queueId=0,this.queue=[],this.inProcess=new Set,this.lockPromise=null,this.unlockResolve=null,this.log=(0,o.kg)("LL",o.v9.Error),this.processQueue=(0,i.Z)((()=>this._processQueue()),8,!1)}clear(){this.inProcess.clear(),this.queue.length=0}lock(){this.lockPromise||(this.lockPromise=new Promise(((e,t)=>{this.unlockResolve=e})))}unlock(){this.unlockResolve&&(this.unlockResolve(),this.unlockResolve=this.lockPromise=null,this.processQueue())}processItem(e){return t=this,s=void 0,i=function*(){if(!this.lockPromise){this.inProcess.add(e);try{yield this.loadItem(e)}catch(e){r.has(null==e?void 0:e.type)||this.log.error("loadMediaQueue error:",e)}this.inProcess.delete(e),this.processQueue()}},new((n=void 0)||(n=Promise))((function(e,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var s;t.done?e(t.value):(s=t.value,s instanceof n?s:new n((function(e){e(s)}))).then(r,a)}l((i=i.apply(t,s||[])).next())}));var t,s,n,i}loadItem(e){return e.load()}getItem(){return this.queue.shift()}addElement(e,t){this.queue[e](t),this.processQueue()}_processQueue(e){if(!(!this.queue.length||this.lockPromise||this.parallelLimit>0&&this.inProcess.size>=this.parallelLimit))do{if(e?(0,n.Z)(this.queue,e):e=this.getItem(),!e)break;this.processItem(e),e=null}while(this.inProcess.size{s.d(t,{Z:()=>n});const n={Á:"A",Ă:"A",Ắ:"A",Ặ:"A",Ằ:"A",Ẳ:"A",Ẵ:"A",Ǎ:"A",Â:"A",Ấ:"A",Ậ:"A",Ầ:"A",Ẩ:"A",Ẫ:"A",Ä:"A",Ǟ:"A",Ȧ:"A",Ǡ:"A",Ạ:"A",Ȁ:"A",À:"A",Ả:"A",Ȃ:"A",Ā:"A",Ą:"A",Å:"A",Ǻ:"A",Ḁ:"A",Ⱥ:"A",Ã:"A",Ꜳ:"AA",Æ:"AE",Ǽ:"AE",Ǣ:"AE",Ꜵ:"AO",Ꜷ:"AU",Ꜹ:"AV",Ꜻ:"AV",Ꜽ:"AY",Ḃ:"B",Ḅ:"B",Ɓ:"B",Ḇ:"B",Ƀ:"B",Ƃ:"B",Ć:"C",Č:"C",Ç:"C",Ḉ:"C",Ĉ:"C",Ċ:"C",Ƈ:"C",Ȼ:"C",Ď:"D",Ḑ:"D",Ḓ:"D",Ḋ:"D",Ḍ:"D",Ɗ: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"U",Ṻ:"U",Ų:"U",Ů:"U",Ũ:"U",Ṹ:"U",Ṵ:"U",Ꝟ:"V",Ṿ:"V",Ʋ:"V",Ṽ:"V",Ꝡ:"VY",Ẃ:"W",Ŵ:"W",Ẅ:"W",Ẇ:"W",Ẉ:"W",Ẁ:"W",Ⱳ:"W",Ẍ:"X",Ẋ:"X",Ý:"Y",Ŷ:"Y",Ÿ:"Y",Ẏ:"Y",Ỵ:"Y",Ỳ:"Y",Ƴ:"Y",Ỷ:"Y",Ỿ:"Y",Ȳ:"Y",Ɏ:"Y",Ỹ:"Y",Ź:"Z",Ž:"Z",Ẑ:"Z",Ⱬ:"Z",Ż:"Z",Ẓ:"Z",Ȥ:"Z",Ẕ:"Z",Ƶ:"Z",IJ:"IJ",Œ:"OE",ᴀ:"A",ᴁ:"AE",ʙ:"B",ᴃ:"B",ᴄ:"C",ᴅ:"D",ᴇ:"E",ꜰ:"F",ɢ:"G",ʛ:"G",ʜ:"H",ɪ:"I",ʁ:"R",ᴊ:"J",ᴋ:"K",ʟ:"L",ᴌ:"L",ᴍ:"M",ɴ:"N",ᴏ:"O",ɶ:"OE",ᴐ:"O",ᴕ:"OU",ᴘ:"P",ʀ:"R",ᴎ:"N",ᴙ:"R",ꜱ:"S",ᴛ:"T",ⱻ:"E",ᴚ:"R",ᴜ:"U",ᴠ:"V",ᴡ:"W",ʏ:"Y",ᴢ:"Z",á:"a",ă:"a",ắ:"a",ặ:"a",ằ:"a",ẳ:"a",ẵ:"a",ǎ:"a",â:"a",ấ:"a",ậ:"a",ầ:"a",ẩ:"a",ẫ:"a",ä:"a",ǟ:"a",ȧ:"a",ǡ:"a",ạ:"a",ȁ:"a",à:"a",ả:"a",ȃ:"a",ā:"a",ą:"a",ᶏ:"a",ẚ:"a",å:"a",ǻ:"a",ḁ:"a",ⱥ:"a",ã:"a",ꜳ:"aa",æ:"ae",ǽ:"ae",ǣ:"ae",ꜵ:"ao",ꜷ:"au",ꜹ:"av",ꜻ:"av",ꜽ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"ffi",ffl:"ffl",fi:"fi",fl:"fl",ij:"ij",œ:"oe",st:"st",ₐ:"a",ₑ:"e",ᵢ:"i",ⱼ:"j",ₒ:"o",ᵣ:"r",ᵤ:"u",ᵥ:"v",ₓ:"x",Ё:"YO",Й:"I",Ц:"TS",У:"U",К:"K",Е:"E",Н:"N",Г:"G",Ш:"SH",Щ:"SCH",З:"Z",Х:"H",Ъ:"",ё:"yo",й:"i",ц:"ts",у:"u",к:"k",е:"e",н:"n",г:"g",ш:"sh",щ:"sch",з:"z",х:"h",ъ:"",Ф:"F",Ы:"I",В:"V",А:"A",П:"P",Р:"R",О:"O",Л:"L",Д:"D",Ж:"ZH",Э:"E",ф:"f",ы:"i",в:"v",а:"a",п:"p",р:"r",о:"o",л:"l",д:"d",ж:"zh",э:"e",Я:"Ya",Ч:"CH",С:"S",М:"M",И:"I",Т:"T",Ь:"",Б:"B",Ю:"YU",я:"ya",ч:"ch",с:"s",м:"m",и:"i",т:"t",ь:"",б:"b",ю:"yu"}},6690:(e,t,s)=>{function n(e){return[...new Set(e)]}s.d(t,{Z:()=>n})},7238:(e,t,s)=>{function n(e){return e.reduce(((e,t)=>(e.push(...t),e)),[])}s.d(t,{Z:()=>n})},7625:(e,t,s)=>{function n(e,t){for(let s=e.length-1;s>=0;--s)t(e[s],s,e)}s.d(t,{Z:()=>n})},6519:(e,t,s)=>{function n(e,t,s,n){if("function"!=typeof s){const e=s;s=t=>t[e]}const i=s(t);if(void 0===n&&-1!==(n=e.indexOf(t))){const t=e[n-1],o=e[n+1];if((!t||s(t)>=i)&&(!o||s(o)<=i))return n;e.splice(n,1)}const o=e.length;if(!o||i<=s(e[o-1]))return e.push(t)-1;if(i>=s(e[0]))return e.unshift(t),0;for(let n=0;ns(e[n]))return e.splice(n,0,t),n;return console.error("wtf",e,t),e.indexOf(t)}s.d(t,{Z:()=>n})},8938:(e,t,s)=>{function n(e){}s.d(t,{Z:()=>n})},3019:(e,t,s)=>{function n(e,t){return new Promise((s=>{const n=new FileReader;n.addEventListener("loadend",(e=>{s(e.target.result)})),n[t](e)}))}s.d(t,{Z:()=>n})},9895:(e,t,s)=>{function n(e,t){const s=e.length;if(s!==t.length)return!1;for(let n=0;nn})},3306:(e,t,s)=>{function n(e){const t=e.length,s=new Uint8Array(Math.ceil(t/2));let n=0;t%2&&(s[n++]=parseInt(e.charAt(0),16));for(let i=n;in})},9818:(e,t,s)=>{function n(e){return e instanceof Uint8Array?e:"string"==typeof e?(new TextEncoder).encode(e):new Uint8Array(e)}s.d(t,{Z:()=>n})},6654:(e,t,s)=>{function n(e,t){return e instanceof Promise?e.then(t):t(e)}s.d(t,{Z:()=>n})},2202:(e,t,s)=>{s.d(t,{Z:()=>o});var n=s(2219);let i=0;function o(e){let t;const s=null==e?void 0:e.type;if(s){const e=`${n.Z}_${i++}.${s.split("/")[1]}`;t=["image/jpeg","image/png","image/bmp"].indexOf(s)>=0?"photo"+e:0===s.indexOf("audio/")||["video/ogg"].indexOf(s)>=0?"audio"+e:0===s.indexOf("video/")?"video"+e:"document"+e}else t=`upload-${n.Z}_${i++}`;return t}},3624:(e,t,s)=>{s.d(t,{k:()=>r});var n=s(1655);const i=(0,s(5471).Z)("MIDDLEWARE");class o{constructor(){this.details={cleaned:!1,inner:[],onCleanCallbacks:[]},this.onDestroyCallbacks=[],this.onDestroy=e=>{if(this.destroyed)return e();this.onDestroyCallbacks.push(e)}}clean(){const e=this.details;e.cleaned=!0,e.inner.splice(0,e.inner.length).forEach((e=>e.destroy())),e.onCleanCallbacks.splice(0,e.onCleanCallbacks.length).forEach((e=>e())),this.details={cleaned:!1,inner:[],onCleanCallbacks:[]}}destroy(){this.destroyed=!0,this.clean(),this.onDestroyCallbacks.splice(0,this.onDestroyCallbacks.length).forEach((e=>e())),this.parent&&((0,n.Z)(this.parent.details.inner,this),this.parent=void 0)}get(e){const t=this.details,s=()=>!t.cleaned&&(!e||e());return s.create=()=>{if(!s())throw i;const e=r();return e.parent=this,t.inner.push(e),e},s.onClean=e=>{if(!s())return e();t.onCleanCallbacks.push(e)},s.onDestroy=this.onDestroy,s}}function r(){return new o}},8027:(e,t,s)=>{function n(e,t){const s={writable:!0,configurable:!0},n={};t.forEach((t=>{e.hasOwnProperty(t)||(n[t]=s)})),Object.defineProperties(e,n)}s.d(t,{Z:()=>n})},9750:(e,t,s)=>{function n(e,t){const s=t.split(".");let n=e;return s.forEach((e=>{e&&(n=n[e])})),n}s.d(t,{Z:()=>n})},7401:(e,t,s)=>{function n(e,t="asc"){if(!e)return[];const s=e instanceof Map?[...e.keys()]:Object.keys(e).map((e=>+e));return"asc"===t?s.sort(((e,t)=>e-t)):s.sort(((e,t)=>t-e))}s.d(t,{Z:()=>n})},5701:(e,t,s)=>{s.d(t,{Z:()=>o});var n=s(6761),i=s(319);function o(e,t,s=!0,o=!0){let r,a,l,c,u=!1;const h=t=>{const s=l,n=c;try{s(e.apply(null,t))}catch(e){console.error("debounce error",e),n(e)}},d=(...e)=>{a||(a=new Promise(((e,t)=>(l=e,c=t)))),r?(clearTimeout(r),u=!0,c(),a=new Promise(((e,t)=>(l=e,c=t)))):s&&(h(e),u=!1);const d=n.Z.setTimeout((()=>{!o||s&&!u||h(e),r===d&&(r=a=l=c=void 0,u=!1)}),t);return r=d,a.catch(i.Z),a};return d.clearTimeout=()=>{r&&(n.Z.clearTimeout(r),c(),r=a=l=c=void 0,u=!1)},d.isDebounced=()=>!!r,d}},252:(e,t,s)=>{s.d(t,{D:()=>n,Z:()=>a});var n,i=s(410),o=s(1655);function r(e,t){if(e.toExponential){const s=e-t;return s<0?-1:s>0?1:0}return function(e,t){const s=e.length;if(s!==t.length){const e=s-t.length;return e<0?-1:e>0?1:0}for(let n=0;n=2)for(let t=0,s=this.slices.length;t=0)return{slice:t,offset:e===t[n]?n:n-1}}if(t&&t.isEnd(n.Top))return{slice:t,offset:t.length}}sliceMe(e,t,s){let i=this.slice,o=0,r=0;if(e){const t=this.findSliceOffset(e);if(!t)return;i=t.slice,o=r=t.offset,i.includes(e)&&(r+=1)}const a=Math.max(r+t,0),l=r+t+s,c=i.slice(a,l),u=t<0?s+t:s,h=Math.abs(t),d=i.length-r>=u||!!i.isEnd(n.Top)&&(c.setEnd(n.Top),!0),f=r-h>=0||!!i.isEnd(n.Bottom)&&(c.setEnd(n.Bottom),!0);return{slice:c,offsetIdOffset:o,fulfilled:n.None|(d&&f?n.Both:(d?n.Top:n.None)|(f?n.Bottom:n.None))}}unshift(...e){let t=this.first;t.length?t.isEnd(n.Bottom)||(t=this.constructSlice(),t.setEnd(n.Bottom),this.slices.unshift(t)):t.setEnd(n.Bottom),t.unshift(...e)}push(...e){let t=this.last;t.length?t.isEnd(n.Top)||(t=this.constructSlice(),t.setEnd(n.Top),this.slices.push(t)):t.setEnd(n.Top),t.push(...e)}delete(e){const t=this.findSlice(e);return!!t&&(t.slice.splice(t.index,1),!0)}deleteSlice(e){(0,o.Z)(this.slices,e)}toJSON(){const e={slices:this.slices.map((e=>({values:e.slice(),isEnd:e.getEnds()})))};return JSON.stringify(e)}static fromJSON(e){const t=JSON.parse(e),s=new a;return t.slices.forEach((e=>{const t=s.insertSlice(e.values)||s.first;e.isEnd.top&&t.setEnd(n.Top),e.isEnd.bottom&&t.setEnd(n.Bottom)})),s}}i.GO&&(i.GO.SlicedArray=a)},8794:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(1507);function i(e){return e.icons.find((e=>e.name===n.BP))}},2566:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(2946);function i(e){return e.peer?(0,n.Z)(e.peer):e.user_id.toPeerId()}},7120:(e,t,s)=>{function n(e,t,s,n){if(!e)return!1;if(e.pFlags.deactivated&&"view_messages"!==t)return!1;const i=void 0===s;if(e.pFlags.creator&&i)return!0;if("chatForbidden"===e._||"channelForbidden"===e._||e.pFlags.left&&!e.pFlags.megagroup)return!1;if(!s&&!(s=e.admin_rights||e.banned_rights||e.default_banned_rights))return!1;let o={};s&&(o=s.pFlags);const r="chatAdminRights"===s._;switch(t){case"embed_links":case"send_games":case"send_gifs":case"send_inline":case"send_media":case"send_messages":case"send_polls":case"send_stickers":case"send_photos":case"send_videos":case"send_roundvideos":case"send_audios":case"send_voices":case"send_docs":case"send_plain":if(!n&&e.pFlags.left)return!1;if("chatBannedRights"===s._&&o[t])return!1;if("channel"===e._&&!e.pFlags.megagroup&&!o.post_messages)return!1;break;case"delete_messages":case"manage_call":return!!o[t];case"pin_messages":return r?o[t]||!!o.post_messages:!o[t];case"change_info":case"invite_users":return r?!!o[t]:!o[t];case"change_type":case"delete_chat":return!1;case"edit_messages":case"manage_topics":return r&&!!o[t];case"ban_users":case"change_permissions":return r&&!!o.ban_users;case"view_participants":return!("chat"!==e._&&e.pFlags.broadcast&&!e.pFlags.creator&&!e.admin_rights)}return!0}s.d(t,{Z:()=>n})},8050:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(3385);function i(e,t=(0,n.Z)(e.folder_id)){return null==e?void 0:e[t]}},3385:(e,t,s)=>{function n(e=0){return`index_${e}`}s.d(t,{Z:()=>n})},6658:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(7072);function i(e,t,s,i){const o=(0,n.Z)(e,null==t?void 0:t.type);let r;return r="photoSize"===(null==t?void 0:t._)?e.sticker?"image/webp":e.mime_type.startsWith("image/")?e.mime_type:"image/jpeg":e.mime_type||"application/octet-stream",{dcId:e.dc_id,location:o,size:t?t.size:e.size,mimeType:r,fileName:e.file_name,queueId:s,onlyCache:i}}},7072:(e,t,s)=>{function n(e,t){return{_:"inputDocumentFileLocation",id:e.id,access_hash:e.access_hash,file_reference:e.file_reference,thumb_size:t}}s.d(t,{Z:()=>n})},7086:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(8801);function i(e){return(0,n.P)(e.location,e)}},1243:(e,t,s)=>{s.d(t,{Z:()=>a});var n=s(6658),i=s(7667),o=s(3114),r=s(7086);function a(e){const{media:t,thumb:s,queueId:a,onlyCache:l}=e;let c;var u;return"document"===t._?c=(0,n.Z)(t,s,a,l):"photo"===t._?c=(0,i.Z)(t,s,a,l):(0,o.Z)(t)&&(c={dcId:0,location:{_:"inputWebFileLocation",access_hash:(u=t).access_hash,url:u.url},size:u.size,mimeType:u.mime_type}),c.downloadId=e.downloadId,{fileName:(0,r.Z)(c),downloadOptions:c}}},6034:(e,t,s)=>{s.d(t,{Z:()=>o});var n=s(6848),i=s(5880);function o(e,t){if(typeof e!=typeof t)return!1;if(!(0,i.Z)(e))return!0;if(e._!==t._)return!1;if("draftMessage"===e._&&t._===e._){if(e.reply_to_msg_id!==t.reply_to_msg_id)return!1;if(!(0,n.Z)(e.entities,t.entities))return!1;if(e.message!==t.message)return!1;if(e.pFlags.no_webpage!==t.pFlags.no_webpage)return!1}return!0}},515:(e,t,s)=>{function n(e,t){return e+"_"+t}s.d(t,{Z:()=>n})},3781:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(7082);function i(e){const t=n.t;return e>=t?e:t+e*n.o}},6566:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(2342);function i(e,t,s){if("inputMessagesFilterEmpty"===e)return t;const i=[];if(!t.length)return i;let o=!0;const r={},a=[],l=[];switch(e){case"inputMessagesFilterPhotos":r.messageMediaPhoto=!0;break;case"inputMessagesFilterPhotoVideo":r.messageMediaPhoto=!0,r.messageMediaDocument=!0,a.push("video");break;case"inputMessagesFilterVideo":r.messageMediaDocument=!0,a.push("video");break;case"inputMessagesFilterDocument":r.messageMediaDocument=!0,a.push(void 0,"photo","pdf");break;case"inputMessagesFilterVoice":r.messageMediaDocument=!0,a.push("voice");break;case"inputMessagesFilterRoundVoice":r.messageMediaDocument=!0,a.push("round","voice");break;case"inputMessagesFilterRoundVideo":r.messageMediaDocument=!0,a.push("round");break;case"inputMessagesFilterMusic":r.messageMediaDocument=!0,a.push("audio");break;case"inputMessagesFilterUrl":r.url=!0;break;case"inputMessagesFilterChatPhotos":r.avatar=!0;break;default:o=!1}if(!o)return i;for(let e=0,o=t.length;ee.includes(t._)))||(0,n.Z)(o.message))&&(c=!0)}}else r.avatar&&o.action&&["messageActionChannelEditPhoto","messageActionChatEditPhoto","messageActionChannelEditVideo","messageActionChatEditVideo"].includes(o.action._)&&(c=!0);if(c&&(i.push(o),i.length>=s))break}return i}},2381:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(8938);function i(e){let t,s=0;for(const i of e)if((0,n.Z)(i),i.message){if(++s>1)break;t=i}return s>1&&(t=void 0),t}},4993:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(1507);function i(e,t){var s;let i;const o=e.reply_to;return!o||t&&!o.pFlags.forum_topic?t&&(i="messageService"===e._&&"messageActionTopicCreate"===(null===(s=e.action)||void 0===s?void 0:s._)?e.mid:n.Ox):i=o.reply_to_top_id||o.reply_to_msg_id,i}},5102:(e,t,s)=>{function n(e){if(!e)return[];const t=e.usernames;return t?t.filter((e=>e.pFlags.active)).map((e=>e.username)):e.username?[e.username]:[]}s.d(t,{Z:()=>n})},7256:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(7419);function i(e){if(e&&!(0,n.Z)(e))return null==e?void 0:e.photo}},7419:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(677);function i(e){const t=null==e?void 0:e.restriction_reason;return!!(t&&e.pFlags.restricted&&(0,n.X)(t))}},7667:(e,t,s)=>{function n(e,t,s,n){const i="document"===e._;if(!t||"photoSizeEmpty"===t._)throw new Error("photoSizeEmpty!");const o=!("photoSize"!==t._&&"photoSizeProgressive"!==t._||!e.access_hash||!e.file_reference),r={_:i?"inputDocumentFileLocation":"inputPhotoFileLocation",id:e.id,access_hash:e.access_hash,file_reference:e.file_reference,thumb_size:t.type};return{dcId:e.dc_id,location:r,size:o?t.size:void 0,mimeType:"image/jpeg",queueId:s,onlyCache:n}}s.d(t,{Z:()=>n})},5285:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(6848);function i(e,t){return(0,n.Z)(e,t)}},13:(e,t,s)=>{function n(e){var t;return null===(t=e.video_thumbs)||void 0===t?void 0:t[0]}s.d(t,{Z:()=>n})},8493:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(1507);function i(e){return!(!e||e.pFlags.deleted||e.id.toPeerId()===n.hj)}},3114:(e,t,s)=>{function n(e){return!(!e||"webDocument"!==e._&&"webDocumentNoProxy"!==e._)}s.d(t,{Z:()=>n})},9174:(e,t,s)=>{var n;s.d(t,{Q:()=>n}),function(e){e[e.Connected=0]="Connected",e[e.Connecting=1]="Connecting",e[e.Closed=2]="Closed",e[e.TimedOut=3]="TimedOut"}(n||(n={}))},6875:(e,t,s)=>{s.d(t,{Z:()=>i});const n=new Set(["messageEntityBold","messageEntityItalic","messageEntityCode","messageEntityPre","messageEntityUnderline","messageEntityStrike","messageEntityBlockquote","messageEntitySpoiler"]);function i(e){for(let t=0;tn.has(e._)&&i!==t&&e._===s._&&e.offset-s.length===s.offset)),-1!==i){const t=e[i];s.length+=t.length,e.splice(i,1)}}while(-1!==i)}}},1379:(e,t,s)=>{function n(e,t){const s=e.slice(0,t.offset),n=function(e){const t="⠁⠂⠄⠈⠐⠠⡀⢀⠃⠅⠆⠉⠊⠌⠑⠒⠔⠘⠡⠢⠤⠨⠰⡁⡂⡄⡈⡐⡠⢁⢂⢄⢈⢐⢠⣀⠇⠋⠍⠎⠓⠕⠖⠙⠚⠜⠣⠥⠦⠩⠪⠬⠱⠲⠴⠸⡃⡅⡆⡉⡊⡌⡑⡒⡔⡘⡡⡢⡤⡨⡰⢃⢅⢆⢉⢊⢌⢑⢒⢔⢘⢡⢢⢤⢨⢰⣁⣂⣄⣈⣐⣠⠏⠗⠛⠝⠞⠧⠫⠭⠮⠳⠵⠶⠹⠺⠼⡇⡋⡍⡎⡓⡕⡖⡙⡚⡜⡣⡥⡦⡩⡪⡬⡱⡲⡴⡸⢇⢋⢍⢎⢓⢕⢖⢙⢚⢜⢣⢥⢦⢩⢪⢬⢱⢲⢴⢸⣃⣅⣆⣉⣊⣌⣑⣒⣔⣘⣡⣢⣤⣨⣰⠟⠯⠷⠻⠽⠾⡏⡗⡛⡝⡞⡧⡫⡭⡮⡳⡵⡶⡹⡺⡼⢏⢗⢛⢝⢞⢧⢫⢭⢮⢳⢵⢶⢹⢺⢼⣇⣋⣍⣎⣓⣕⣖⣙⣚⣜⣣⣥⣦⣩⣪⣬⣱⣲⣴⣸⠿⡟⡯⡷⡻⡽⡾⢟⢯⢷⢻⢽⢾⣏⣗⣛⣝⣞⣧⣫⣭⣮⣳⣵⣶⣹⣺⣼⡿⢿⣟⣯⣷⣻⣽⣾⣿",s=t.length,n=[];for(let i=0;in})},8859:(e,t,s)=>{s.d(t,{Z:()=>o});var n=s(2423);const i=new Set(["messageEntityPre","messageEntityCode"]);function o(e,t){let s=-1;return e.find((e=>(i.has(e._)&&(s=e.offset+e.length),!!(t.offset=e.offset&&t.length+t.offset<=e.length+e.offset))))}},7746:(e,t,s)=>{function n(e,t){return e.replace(/[\u2640\u2642\u2764](?!\ufe0f)/g,((e,s,n)=>{if(t){const n=e.length;s+=n,t.forEach((e=>{const t=e.offset+e.length;t===s?e.length+=n:t>s&&(e.offset+=n)}))}return e+"️"}))}s.d(t,{Z:()=>n})},2342:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(2423);function i(e){return e?e.match(n.it):null}},6241:(e,t,s)=>{s.d(t,{Z:()=>o});var n=s(8859),i=s(1346);function o(e,t){const s=t.filter((t=>!(0,n.Z)(e,t)));e.push(...s),(0,i.Z)(e);for(let t=0;t{s.d(t,{Z:()=>c});var n=s(2423);const i=["abogado","ac","academy","accountants","active","actor","ad","adult","ae","aero","af","ag","agency","ai","airforce","al","allfinanz","alsace","am","amsterdam","an","android","ao","apartments","aq","aquarelle","ar","archi","army","arpa","as","asia","associates","at","attorney","au","auction","audio","autos","aw","ax","axa","az","ba","band","bank","bar","barclaycard","barclays","bargains","bayern","bb","bd","be","beer","berlin","best","bf","bg","bh","bi","bid","bike","bingo","bio","biz","bj","black","blackfriday","bloomberg","blue","bm","bmw","bn","bnpparibas","bo","boo","boutique","br","brussels","bs","bt","budapest","build","builders","business","buzz","bv","bw","by","bz","bzh","ca","cab","cal","camera","camp","cancerresearch","canon","capetown","capital","caravan","cards","care","career","careers","cartier","casa","cash","cat","catering","cc","cd","center","ceo","cern","cf","cg","ch","channel","chat","cheap","christmas","chrome","church","ci","citic","city","ck","cl","claims","cleaning","click","clinic","clothing","club","cm","cn","co","coach","codes","coffee","college","cologne","com","community","company","computer","condos","construction","consulting","contractors","cooking","cool","coop","country","cr","credit","creditcard","cricket","crs","cruises","cu","cuisinella","cv","cw","cx","cy","cymru","cz","dabur","dad","dance","dating","day","dclk","de","deals","degree","delivery","democrat","dental","dentist","desi","design","dev","diamonds","diet","digital","direct","directory","discount","dj","dk","dm","dnp","do","docs","domains","doosan","durban","dvag","dz","eat","ec","edu","education","ee","eg","email","emerck","energy","engineer","engineering","enterprises","equipment","er","es","esq","estate","et","eu","eurovision","eus","events","everbank","exchange","expert","exposed","fail","farm","fashion","feedback","fi","finance","financial","firmdale","fish","fishing","fit","fitness","fj","fk","flights","florist","flowers","flsmidth","fly","fm","fo","foo","forsale","foundation","fr","frl","frogans","fund","furniture","futbol","ga","gal","gallery","garden","gb","gbiz","gd","ge","gent","gf","gg","ggee","gh","gi","gift","gifts","gives","gl","glass","gle","global","globo","gm","gmail","gmo","gmx","gn","goog","google","gop","gov","gp","gq","gr","graphics","gratis","green","gripe","gs","gt","gu","guide","guitars","guru","gw","gy","hamburg","hangout","haus","healthcare","help","here","hermes","hiphop","hiv","hk","hm","hn","holdings","holiday","homes","horse","host","hosting","house","how","hr","ht","hu","ibm","id","ie","ifm","il","im","immo","immobilien","in","industries","info","ing","ink","institute","insure","int","international","investments","io","iq","ir","irish","is","it","iwc","jcb","je","jetzt","jm","jo","jobs","joburg","jp","juegos","kaufen","kddi","ke","kg","kh","ki","kim","kitchen","kiwi","km","kn","koeln","kp","kr","krd","kred","kw","ky","kyoto","kz","la","lacaixa","land","lat","latrobe","lawyer","lb","lc","lds","lease","legal","lgbt","li","lidl","life","lighting","limited","limo","link","lk","loans","london","lotte","lotto","lr","ls","lt","ltda","lu","luxe","luxury","lv","ly","ma","madrid","maison","management","mango","market","marketing","marriott","mc","md","me","media","meet","melbourne","meme","memorial","menu","mg","mh","miami","mil","mini","mk","ml","mm","mn","mo","mobi","moda","moe","monash","money","mormon","mortgage","moscow","motorcycles","mov","mp","mq","mr","ms","mt","mu","museum","mv","mw","mx","my","mz","na","nagoya","name","navy","nc","ne","net","network","neustar","new","nexus","nf","ng","ngo","nhk","ni","nico","ninja","nl","no","np","nr","nra","nrw","ntt","nu","nyc","nz","okinawa","om","one","ong","onl","ooo","org","organic","osaka","otsuka","ovh","pa","paris","partners","parts","party","pe","pf","pg","ph","pharmacy","photo","photography","photos","physio","pics","pictures","pink","pizza","pk","pl","place","plumbing","pm","pn","pohl","poker","porn","post","pr","praxi","press","pro","prod","productions","prof","properties","property","ps","pt","pub","pw","py","qa","qpon","quebec","re","realtor","recipes","red","rehab","reise","reisen","reit","ren","rentals","repair","report","republican","rest","restaurant","reviews","rich","rio","rip","ro","rocks","rodeo","rs","rsvp","ru","ruhr","rw","ryukyu","sa","saarland","sale","samsung","sarl","saxo","sb","sc","sca","scb","schmidt","schule","schwarz","science","scot","sd","se","services","sew","sexy","sg","sh","shiksha","shoes","shriram","si","singles","sj","sk","sky","sl","sm","sn","so","social","software","sohu","solar","solutions","soy","space","spiegel","sr","st","style","su","supplies","supply","support","surf","surgery","suzuki","sv","sx","sy","sydney","systems","sz","taipei","tatar","tattoo","tax","tc","td","technology","tel","temasek","tennis","tf","tg","th","tienda","tips","tires","tirol","tj","tk","tl","tm","tn","to","today","tokyo","tools","top","toshiba","town","toys","tp","tr","trade","training","travel","trust","tt","tui","tv","tw","tz","ua","ug","uk","university","uno","uol","us","uy","uz","va","vacations","vc","ve","vegas","ventures","versicherung","vet","vg","vi","viajes","video","villas","vision","vlaanderen","vn","vodka","vote","voting","voto","voyage","vu","wales","wang","watch","webcam","website","wed","wedding","wf","whoswho","wien","wiki","williamhill","wme","work","works","world","ws","wtc","wtf","佛山","集团","在线","한국","ভারত","八卦","موقع","公益","公司","移动","我爱你","москва","қаз","онлайн","сайт","срб","淡马锡","орг","삼성","சிங்கப்பூர்","商标","商店","商城","дети","мкд","中文网","中信","中国","中國","谷歌","భారత్","ලංකා","ભારત","भारत","网店","संगठन","网络","укр","香港","台湾","台灣","手机","мон","الجزائر","عمان","ایران","امارات","بازار","الاردن","بھارت","المغرب","السعودية","مليسيا","شبكة","გე","机构","组织机构","ไทย","سورية","рус","рф","تونس","みんな","グーグル","世界","ਭਾਰਤ","网址","游戏","vermögensberater","vermögensberatung","企业","مصر","قطر","广东","இலங்கை","இந்தியா","新加坡","فلسطين","政务","xxx","xyz","yachts","yandex","ye","yoga","yokohama","youtube","yt","za","zip","zm","zone","zuerich","zw"];function o(e){for(var t=e.length,s=e.split("(").length-1,n=e.split(")").length-1;n>s&&")"===e.charAt(t-1);)e=e.substr(0,t-1),n--,t--;return s>n&&(e=e.replace(/\)+$/,"")),e}var r=s(3447),a=s(671);function l(e){const t=(0,a.N0)(e).replace(/-?fe0f/g,"");if(r.Z.hasOwnProperty(t))return t}function c(e){let t,s=e;const r=[];let a,c=0;for(n.$2.lastIndex=0;t=s.match(n.$2);){if(a=c+t.index,t[3])r.push({_:"messageEntityMention",offset:a+t[1].length,length:t[2].length+t[3].length});else if(t[4])if(n.E.test(t[4]))r.push({_:"messageEntityEmail",offset:a,length:t[4].length});else{let e,s=t[5];const n=t[6];if(n){if(s||"xn--"!==n.substr(0,4)&&-1===i.indexOf(n.toLowerCase())||(s="http://"),s){const n=o(t[4]);n.length!==t[4].length&&(t[4]=n),e=(t[5]?"":s)+t[4]}}else e=(t[5]?"":"http://")+t[4];e&&r.push({_:"messageEntityUrl",offset:a,length:t[4].length})}else if(t[7])r.push({_:"messageEntityLinebreak",offset:a,length:1});else if(t[8]){const e=l(t[8]);e&&r.push({_:"messageEntityEmoji",offset:a,length:t[8].length,unicode:e})}else if(t[11])r.push({_:"messageEntityHashtag",offset:a+(t[10]?t[10].length:0),length:t[11].length});else if(t[13])r.push({_:"messageEntityBotCommand",offset:a+(t[11]?t[11].length:0)+(t[12]?t[12].length:0),length:1+t[13].length+(t[14]?1+t[14].length:0),unsafe:!0});else if(t[16]){const e=t[16],s=e.split(":"),n=s.length,i=3===n?+s[0]:0,o=+s[3===n?1:0],l=+s[n-1];r.push({_:"messageEntityTimestamp",offset:a+(/\D/.test(t[0][0])?1:0),length:e.length,raw:e,time:3600*i+60*o+l})}s=s.substr(t.index+t[0].length),c+=t.index+t[0].length}return r}},2821:(e,t,s)=>{s.d(t,{Z:()=>a});var n=s(2423),i=s(6875),o=s(8859),r=s(6241);function a(e,t,s){const a=[];let l=!1;const c=e=>(0,o.Z)(t,e)?l=!1:(a.push(e),l=!0),u=[];let h,d=0;for(;h=e.match(n.QB);){const t=d+h.index;u.push(e.substr(0,h.index));const s=h[3]||h[8]||h[11]||h[13];let i;if(d-=s.length,d+=s.length,l=!1,s.match(/^`*$/))u.push(h[0]);else if(h[3])i={_:"messageEntityPre",language:"",offset:t+h[1].length,length:s.length},c(i)&&("\n"===h[5]&&(h[5]="",d-=1),u.push(h[1]+s+h[5]),d-=h[2].length+h[4].length);else if(h[7]){const e=""===h[6];i={_:n.SC[h[7]],offset:t+(e?0:h[6].length),length:s.length},c(i)&&(e?u.push(s):u.push(h[6]+s+h[9]),d-=2*h[7].length+(e?2:0))}else h[11]?(i={_:"messageEntityMentionName",user_id:h[10].toUserId(),offset:t,length:s.length},c(i)&&(u.push(s),d-=h[0].length-s.length)):h[12]&&(i={_:"messageEntityTextUrl",url:h[14],offset:t,length:s.length},c(i)&&(u.push(s),d-=h[12].length-s.length));l||u.push(h[0]),e=e.substr(h.index+h[0].length),d+=h.index+h[0].length}u.push(e);let f=u.join("");f.replace(/\s+/g,"").length||(f=e,a.splice(0,a.length)),(0,r.Z)(t,a),(0,i.Z)(t);let g=f.length;if(!s){f=f.replace(/^\s*/,"");let e=g-f.length;e&&t.forEach((t=>{t.offset=Math.max(0,t.offset-e)})),f=f.replace(/\s*$/,""),e=g-f.length,g=f.length,e&&t.forEach((e=>{e.offset+e.length>g&&(e.length=g-e.offset)}))}return f}},1346:(e,t,s)=>{function n(e){e.sort(((e,t)=>e.offset-t.offset||t.length-e.length))}s.d(t,{Z:()=>n})},2491:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s(1379);function i(e,t=[]){return t.forEach((t=>{"messageEntitySpoiler"===t._&&(e=(0,n.Z)(e,t).text)})),e}},7381:(e,t,s)=>{s.d(t,{Z:()=>o});var n=s(467),i=s(7238);class o{constructor(e,t=0){this.options=e,this.minChars=t,this.fullTexts=new Map}indexObject(e,t){if(this.options&&t.trim()&&(t=(0,n.gV)(t,this.options)),!t)return this.fullTexts.delete(e),!1;this.fullTexts.set(e,t)}_search(e){const t=[],s=this.fullTexts,n=e.split(" "),i=n.length;return s.forEach(((e,s)=>{let o=!0,r=0;for(let t=0;tthis._search(e))));return s.sort(((e,t)=>e.fullTextLength-t.fullTextLength||t.foundChars-e.foundChars)),new Set(s.map((e=>e.what)))}}}}]); +//# sourceMappingURL=147.52e5e3f41bb7eb15ae10.chunk.js.map \ No newline at end of file diff --git a/public/147.bb5274ee5cc526f48754.chunk.js.map b/public/147.52e5e3f41bb7eb15ae10.chunk.js.map similarity index 77% rename from public/147.bb5274ee5cc526f48754.chunk.js.map rename to public/147.52e5e3f41bb7eb15ae10.chunk.js.map index 8e321be1..c389fb01 100644 --- a/public/147.bb5274ee5cc526f48754.chunk.js.map +++ b/public/147.52e5e3f41bb7eb15ae10.chunk.js.map @@ -1 +1 @@ -{"version":3,"file":"147.bb5274ee5cc526f48754.chunk.js","mappings":"8IAWA,MACMA,EAAgC,IAAIC,IAAI,CAAC,iBAAkB,kBAAmB,aAAc,qBAOnF,MAAMC,EAWnBC,YAAsBC,EAnBD,GAmBC,KAAAA,cAAAA,EAVf,KAAAC,QAAU,EACP,KAAAC,MAAoC,GACpC,KAAAC,UAAsC,IA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IAAIjZ,EAAI,EAAGA,EAAI8Y,IAAoB9Y,EAAG,CACxC,MAAMkZ,EAAOL,EAAW7Y,GAClBsJ,EAAMyP,EAASvY,QAAQ0Y,GAC7B,IAAY,IAAT5P,GAAuB,IAARA,GAAmC,MAAtByP,EAASzP,EAAM,GAA0D,CACtGiC,GAAQ,EACR,K,CAGF0N,GAAcC,EAAKnb,M,CAGrB,GAAGwN,EAAO,CACR0N,GAAcH,EAAmB,EACjC,MAAMK,EAAiBJ,EAAShb,QAC7BJ,KAAKya,UAAYa,GAAcE,GAAkBF,IAClDL,EAAavZ,KAAK,CAAC0Z,WAAUI,iBAAgBH,OAAMC,c,KAKlDL,CACT,CAEOQ,OAAOT,GACThb,KAAK8R,UACNkJ,GAAQ,QAAkBA,EAAOhb,KAAK8R,UAGxC,MAAM4J,EAAUV,EAAM1V,MAAM,KACtB2V,GAAe,OAAQS,EAAQ1T,KAAKgT,GAAUhb,KAAK+a,QAAQC,MAOjE,OALAC,EAAarT,MAAK,CAACK,EAAGC,IAAMD,EAAEuT,eAAiBtT,EAAEsT,gBAAkBtT,EAAEoT,WAAarT,EAAEqT,aAG7C,IAAIhc,IAAI2b,EAAajT,KAAKN,GAAMA,EAAE2T,OAG3E,E","sources":["webpack://tweb/./src/components/lazyLoadQueueBase.ts","webpack://tweb/./src/config/latinizeMap.ts","webpack://tweb/./src/helpers/array/filterUnique.ts","webpack://tweb/./src/helpers/array/flatten.ts","webpack://tweb/./src/helpers/array/forEachReverse.ts","webpack://tweb/./src/helpers/array/insertInDescendSortedArray.ts","webpack://tweb/./src/helpers/assumeType.ts","webpack://tweb/./src/helpers/blob/readBlobAs.ts","webpack://tweb/./src/helpers/bytes/bytesCmp.ts","webpack://tweb/./src/helpers/bytes/bytesFromHex.ts","webpack://tweb/./src/helpers/bytes/convertToUint8Array.ts","webpack://tweb/./src/helpers/callbackify.ts","webpack://tweb/./src/helpers/getFileNameForUpload.ts","webpack://tweb/./src/helpers/middleware.ts","webpack://tweb/./src/helpers/object/defineNotNumerableProperties.ts","webpack://tweb/./src/helpers/object/getDeepProperty.ts","webpack://tweb/./src/helpers/object/getObjectKeysAndSort.ts","webpack://tweb/./src/helpers/schedulers/debounce.ts","webpack://tweb/./src/helpers/slicedArray.ts","webpack://tweb/./src/helpers/compareValue.ts","webpack://tweb/./src/helpers/long/compareLong.ts","webpack://tweb/./src/lib/appManagers/utils/attachMenuBots/getAttachMenuBotIcon.ts","webpack://tweb/./src/lib/appManagers/utils/chats/getParticipantPeerId.ts","webpack://tweb/./src/lib/appManagers/utils/chats/hasRights.ts","webpack://tweb/./src/lib/appManagers/utils/dialogs/getDialogIndex.ts","webpack://tweb/./src/lib/appManagers/utils/dialogs/getDialogIndexKey.ts","webpack://tweb/./src/lib/appManagers/utils/docs/getDocumentDownloadOptions.ts","webpack://tweb/./src/lib/appManagers/utils/docs/getDocumentInputFileLocation.ts","webpack://tweb/./src/lib/appManagers/utils/download/getDownloadFileNameFromOptions.ts","webpack://tweb/./src/lib/appManagers/utils/download/getDownloadMediaDetails.ts","webpack://tweb/./src/lib/appManagers/utils/webDocs/getWebDocumentDownloadOptions.ts","webpack://tweb/./src/lib/appManagers/utils/drafts/draftsAreEqual.ts","webpack://tweb/./src/lib/appManagers/utils/inlineBots/generateQId.ts","webpack://tweb/./src/lib/appManagers/utils/messageId/generateMessageId.ts","webpack://tweb/./src/lib/appManagers/utils/messages/filterMessagesByInputFilter.ts","webpack://tweb/./src/lib/appManagers/utils/messages/getAlbumText.ts","webpack://tweb/./src/lib/appManagers/utils/messages/getMessageThreadId.ts","webpack://tweb/./src/lib/appManagers/utils/peers/getPeerActiveUsernames.ts","webpack://tweb/./src/lib/appManagers/utils/peers/getPeerPhoto.ts","webpack://tweb/./src/lib/appManagers/utils/peers/isPeerRestricted.ts","webpack://tweb/./src/lib/appManagers/utils/photos/getPhotoDownloadOptions.ts","webpack://tweb/./src/lib/appManagers/utils/reactions/reactionsEqual.ts","webpack://tweb/./src/lib/appManagers/utils/stickers/getStickerEffectThumb.ts","webpack://tweb/./src/lib/appManagers/utils/users/canSendToUser.ts","webpack://tweb/./src/lib/appManagers/utils/webDocs/isWebDocument.ts","webpack://tweb/./src/lib/mtproto/connectionStatus.ts","webpack://tweb/./src/lib/richTextProcessor/combineSameEntities.ts","webpack://tweb/./src/lib/richTextProcessor/encodeSpoiler.ts","webpack://tweb/./src/lib/richTextProcessor/spoiler.ts","webpack://tweb/./src/lib/richTextProcessor/findConflictingEntity.ts","webpack://tweb/./src/lib/richTextProcessor/fixEmoji.ts","webpack://tweb/./src/lib/richTextProcessor/matchUrl.ts","webpack://tweb/./src/lib/richTextProcessor/mergeEntities.ts","webpack://tweb/./src/config/tld.ts","webpack://tweb/./src/lib/richTextProcessor/checkBrackets.ts","webpack://tweb/./src/lib/richTextProcessor/getEmojiUnified.ts","webpack://tweb/./src/lib/richTextProcessor/parseEntities.ts","webpack://tweb/./src/lib/richTextProcessor/parseMarkdown.ts","webpack://tweb/./src/lib/richTextProcessor/sortEntities.ts","webpack://tweb/./src/lib/richTextProcessor/wrapPlainText.ts","webpack://tweb/./src/lib/searchIndex.ts"],"sourcesContent":["/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport indexOfAndSplice from '../helpers/array/indexOfAndSplice';\nimport {Middleware} from '../helpers/middleware';\nimport throttle from '../helpers/schedulers/throttle';\nimport {logger, LogTypes} from '../lib/logger';\n\nconst PARALLEL_LIMIT = 8;\nconst IGNORE_ERRORS: Set = new Set(['NO_ENTRY_FOUND', 'STORAGE_OFFLINE', 'MIDDLEWARE', 'NO_AUTO_DOWNLOAD']);\n\nexport type LazyLoadElementBase = {\n load: () => Promise,\n middleware?: Middleware\n};\n\nexport default class LazyLoadQueueBase {\n public queueId = 0;\n protected queue: Array = [];\n protected inProcess: Set = new Set();\n\n protected lockPromise: Promise = null;\n protected unlockResolve: () => void = null;\n\n protected log = logger('LL', LogTypes.Error);\n protected processQueue: () => void;\n\n constructor(protected parallelLimit = PARALLEL_LIMIT) {\n this.processQueue = throttle(() => this._processQueue(), 8, false);\n }\n\n public clear() {\n this.inProcess.clear(); // ацтеки забьются, будет плохо\n\n this.queue.length = 0;\n // unreachable code\n /* for(let item of this.inProcess) {\n this.lazyLoadMedia.push(item);\n } */\n }\n\n public lock() {\n if(this.lockPromise) return;\n\n // const perf = performance.now();\n this.lockPromise = new Promise((resolve, reject) => {\n this.unlockResolve = resolve;\n });\n\n /* if(DEBUG) {\n this.lockPromise.then(() => {\n this.log('was locked for:', performance.now() - perf);\n });\n } */\n }\n\n public unlock() {\n if(!this.unlockResolve) return;\n\n this.unlockResolve();\n this.unlockResolve = this.lockPromise = null;\n\n this.processQueue();\n }\n\n protected async processItem(item: LazyLoadElementBase) {\n if(this.lockPromise) {\n return;\n }\n\n this.inProcess.add(item);\n\n /* if(DEBUG) {\n this.log('will load media', this.lockPromise, item);\n } */\n\n try {\n // await new Promise((resolve) => setTimeout(resolve, 2e3));\n // await new Promise((resolve, reject) => window.requestAnimationFrame(() => window.requestAnimationFrame(resolve)));\n // await item.load(item.div);\n await this.loadItem(item);\n } catch(err) {\n if(!IGNORE_ERRORS.has((err as ApiError)?.type)) {\n this.log.error('loadMediaQueue error:', err/* , item */);\n }\n }\n\n this.inProcess.delete(item);\n\n /* if(DEBUG) {\n this.log('loaded media', item);\n } */\n\n this.processQueue();\n }\n\n protected loadItem(item: LazyLoadElementBase) {\n return item.load();\n }\n\n protected getItem() {\n return this.queue.shift();\n }\n\n protected addElement(method: 'push' | 'unshift', el: LazyLoadElementBase) {\n this.queue[method](el);\n this.processQueue();\n }\n\n protected _processQueue(item?: LazyLoadElementBase) {\n if(!this.queue.length || this.lockPromise || (this.parallelLimit > 0 && this.inProcess.size >= this.parallelLimit)) return;\n\n // console.log('_processQueue start');\n // let added = 0;\n do {\n if(item) {\n indexOfAndSplice(this.queue, item);\n } else {\n item = this.getItem();\n }\n\n if(item) {\n this.processItem(item);\n } else {\n break;\n }\n\n item = null;\n // ++added;\n } while(this.inProcess.size < this.parallelLimit && this.queue.length);\n // console.log('_processQueue end, added', added, this.queue.length);\n }\n\n public push(el: LazyLoadElementBase) {\n this.addElement('push', el);\n }\n\n public unshift(el: LazyLoadElementBase) {\n this.addElement('unshift', el);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\n// From https://raw.githubusercontent.com/FGRibreau/latenize/master/latinize_map.js\nconst LatinizeMap: {[k: string]: string} = {'Á': 'A', 'Ă': 'A', 'Ắ': 'A', 'Ặ': 'A', 'Ằ': 'A', 'Ẳ': 'A', 'Ẵ': 'A', 'Ǎ': 'A', 'Â': 'A', 'Ấ': 'A', 'Ậ': 'A', 'Ầ': 'A', 'Ẩ': 'A', 'Ẫ': 'A', 'Ä': 'A', 'Ǟ': 'A', 'Ȧ': 'A', 'Ǡ': 'A', 'Ạ': 'A', 'Ȁ': 'A', 'À': 'A', 'Ả': 'A', 'Ȃ': 'A', 'Ā': 'A', 'Ą': 'A', 'Å': 'A', 'Ǻ': 'A', 'Ḁ': 'A', 'Ⱥ': 'A', 'Ã': 'A', 'Ꜳ': 'AA', 'Æ': 'AE', 'Ǽ': 'AE', 'Ǣ': 'AE', 'Ꜵ': 'AO', 'Ꜷ': 'AU', 'Ꜹ': 'AV', 'Ꜻ': 'AV', 'Ꜽ': 'AY', 'Ḃ': 'B', 'Ḅ': 'B', 'Ɓ': 'B', 'Ḇ': 'B', 'Ƀ': 'B', 'Ƃ': 'B', 'Ć': 'C', 'Č': 'C', 'Ç': 'C', 'Ḉ': 'C', 'Ĉ': 'C', 'Ċ': 'C', 'Ƈ': 'C', 'Ȼ': 'C', 'Ď': 'D', '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y', 'ỿ': 'y', 'ȳ': 'y', 'ẙ': 'y', 'ɏ': 'y', 'ỹ': 'y', 'ź': 'z', 'ž': 'z', 'ẑ': 'z', 'ʑ': 'z', 'ⱬ': 'z', 'ż': 'z', 'ẓ': 'z', 'ȥ': 'z', 'ẕ': 'z', 'ᵶ': 'z', 'ᶎ': 'z', 'ʐ': 'z', 'ƶ': 'z', 'ɀ': 'z', 'ff': 'ff', 'ffi': 'ffi', 'ffl': 'ffl', 'fi': 'fi', 'fl': 'fl', 'ij': 'ij', 'œ': 'oe', 'st': 'st', 'ₐ': 'a', 'ₑ': 'e', 'ᵢ': 'i', 'ⱼ': 'j', 'ₒ': 'o', 'ᵣ': 'r', 'ᵤ': 'u', 'ᵥ': 'v', 'ₓ': 'x', 'Ё': 'YO', 'Й': 'I', 'Ц': 'TS', 'У': 'U', 'К': 'K', 'Е': 'E', 'Н': 'N', 'Г': 'G', 'Ш': 'SH', 'Щ': 'SCH', 'З': 'Z', 'Х': 'H', 'Ъ': '', 'ё': 'yo', 'й': 'i', 'ц': 'ts', 'у': 'u', 'к': 'k', 'е': 'e', 'н': 'n', 'г': 'g', 'ш': 'sh', 'щ': 'sch', 'з': 'z', 'х': 'h', 'ъ': '', 'Ф': 'F', 'Ы': 'I', 'В': 'V', 'А': 'A', 'П': 'P', 'Р': 'R', 'О': 'O', 'Л': 'L', 'Д': 'D', 'Ж': 'ZH', 'Э': 'E', 'ф': 'f', 'ы': 'i', 'в': 'v', 'а': 'a', 'п': 'p', 'р': 'r', 'о': 'o', 'л': 'l', 'д': 'd', 'ж': 'zh', 'э': 'e', 'Я': 'Ya', 'Ч': 'CH', 'С': 'S', 'М': 'M', 'И': 'I', 'Т': 'T', 'Ь': '', 'Б': 'B', 'Ю': 'YU', 'я': 'ya', 'ч': 'ch', 'с': 's', 'м': 'm', 'и': 'i', 'т': 't', 'ь': '', 'б': 'b', 'ю': 'yu'};\n\nexport default LatinizeMap;\n","export default function filterUnique>(arr: T): T {\n return [...new Set(arr)] as T;\n}\n","export default function flatten(arr: T[][]): T[] {\n return arr.reduce((acc, val) => (acc.push(...val), acc), []);\n}\n","export default function forEachReverse(array: Array, callback: (value: T, index?: number, array?: Array) => void) {\n for(let length = array.length, i = length - 1; i >= 0; --i) {\n callback(array[i], i, array);\n }\n};\n","export default function insertInDescendSortedArray(array: Array, element: T, getProperty: K, pos?: number): number;\nexport default function insertInDescendSortedArray(array: Array, element: T, getProperty: (element: T) => number, pos?: number): number;\nexport default function insertInDescendSortedArray(array: Array, element: T, getProperty: K | ((element: T) => T[K]), pos?: number): number {\n if(typeof(getProperty) !== 'function') {\n const property = getProperty;\n getProperty = (element) => element[property];\n }\n\n const sortProperty: number = getProperty(element);\n\n if(pos === undefined) {\n pos = array.indexOf(element);\n if(pos !== -1) {\n const prev = array[pos - 1];\n const next = array[pos + 1];\n if((!prev || getProperty(prev) >= sortProperty) && (!next || getProperty(next) <= sortProperty)) {\n // console.warn('same pos', pos, sortProperty, prev, next);\n return pos;\n }\n\n array.splice(pos, 1);\n }\n }\n\n const len = array.length;\n if(!len || sortProperty <= getProperty(array[len - 1])) {\n return array.push(element) - 1;\n } else if(sortProperty >= getProperty(array[0])) {\n array.unshift(element);\n return 0;\n } else {\n for(let i = 0; i < len; i++) {\n if(sortProperty > getProperty(array[i])) {\n array.splice(i, 0, element);\n return i;\n }\n }\n }\n\n console.error('wtf', array, element);\n return array.indexOf(element);\n}\n","export default function assumeType(x: unknown): asserts x is T {\n return; // ¯\\_(ツ)_/¯\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import { IS_WEB_WORKER } from \"../context\";\n\n// const id = IS_WEB_WORKER ? Math.random() * 0x1000 | 0 : 0;\nexport default function readBlobAs(blob: Blob, method: 'readAsText'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsDataURL'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsArrayBuffer'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsArrayBuffer' | 'readAsText' | 'readAsDataURL'): Promise {\n // const perf = performance.now();\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.addEventListener('loadend', (e) => {\n // console.log(`readBlobAs [${id}] ${method} time ${performance.now() - perf}`);\n resolve(e.target.result);\n });\n reader[method](blob);\n });\n}\n","export default function bytesCmp(bytes1: number[] | Uint8Array, bytes2: number[] | Uint8Array) {\n const len = bytes1.length;\n if(len !== bytes2.length) {\n return false;\n }\n\n for(let i = 0; i < len; ++i) {\n if(bytes1[i] !== bytes2[i]) {\n return false;\n }\n }\n\n return true;\n}\n","export default function bytesFromHex(hexString: string) {\n const len = hexString.length;\n const bytes = new Uint8Array(Math.ceil(len / 2));\n let start = 0;\n\n if(len % 2) { // read 0x581 as 0x0581\n bytes[start++] = parseInt(hexString.charAt(0), 16);\n }\n\n for(let i = start; i < len; i += 2) {\n bytes[start++] = parseInt(hexString.substr(i, 2), 16);\n }\n\n return bytes;\n}\n","export default function convertToUint8Array(bytes: Uint8Array | ArrayBuffer | number[] | string): Uint8Array {\n if(bytes instanceof Uint8Array) {\n return bytes;\n } else if(typeof(bytes) === 'string') {\n return new TextEncoder().encode(bytes);\n }\n\n return new Uint8Array(bytes);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Awaited} from '../types';\n\nexport default function callbackify, R>(\n smth: T,\n callback: (result: Awaited) => R\n): T extends Promise ? Promise> : R {\n if(smth instanceof Promise) {\n // @ts-ignore\n return smth.then(callback);\n } else {\n return callback(smth as any) as any;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport tabId from '../config/tabId';\n\nlet uploadId = 0;\nexport default function getFileNameForUpload(file: File | Blob) {\n let fileName: string;\n const mimeType = file?.type;\n if(mimeType) { // the same like apiFileName in appMessagesManager for upload!\n const ext = `${tabId}_${uploadId++}.${mimeType.split('/')[1]}`;\n\n if(['image/jpeg', 'image/png', 'image/bmp'].indexOf(mimeType) >= 0) {\n fileName = 'photo' + ext;\n } else if(mimeType.indexOf('audio/') === 0 || ['video/ogg'].indexOf(mimeType) >= 0) {\n fileName = 'audio' + ext;\n } else if(mimeType.indexOf('video/') === 0) {\n fileName = 'video' + ext;\n } else {\n fileName = 'document' + ext;\n }\n } else {\n fileName = `upload-${tabId}_${uploadId++}`;\n }\n\n return fileName;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport indexOfAndSplice from './array/indexOfAndSplice';\nimport makeError from './makeError';\n\nexport type Middleware = {\n (): boolean;\n create(): MiddlewareHelper;\n onClean: (callback: VoidFunction) => void;\n onDestroy: (callback: VoidFunction) => void;\n};\n\nconst createDetails = (): {\n cleaned?: boolean,\n inner: MiddlewareHelper[],\n onCleanCallbacks: VoidFunction[]\n} => ({\n cleaned: false,\n inner: [],\n onCleanCallbacks: []\n});\n\nconst MIDDLEWARE_ERROR = makeError('MIDDLEWARE');\n\n// * onClean == cancel promises, etc\n// * onDestroy == destructor\nexport class MiddlewareHelper {\n private details = createDetails();\n private onDestroyCallbacks: VoidFunction[] = [];\n private parent: MiddlewareHelper;\n private destroyed: boolean;\n\n public clean() {\n const details = this.details;\n details.cleaned = true;\n details.inner.splice(0, details.inner.length).forEach((helper) => helper.destroy());\n details.onCleanCallbacks.splice(0, details.onCleanCallbacks.length).forEach((callback) => callback());\n this.details = createDetails();\n }\n\n public destroy() {\n this.destroyed = true;\n this.clean();\n this.onDestroyCallbacks.splice(0, this.onDestroyCallbacks.length).forEach((callback) => callback());\n\n if(this.parent) {\n indexOfAndSplice(this.parent.details.inner, this);\n this.parent = undefined;\n }\n }\n\n public get(additionalCallback?: () => boolean) {\n const details = this.details;\n\n const middleware: Middleware = () => {\n return !details.cleaned && (!additionalCallback || additionalCallback());\n };\n\n middleware.create = () => {\n if(!middleware()) throw MIDDLEWARE_ERROR;\n const helper = getMiddleware();\n helper.parent = this;\n details.inner.push(helper);\n return helper;\n };\n\n middleware.onClean = (callback) => {\n if(!middleware()) return callback();\n details.onCleanCallbacks.push(callback);\n };\n\n middleware.onDestroy = this.onDestroy;\n\n return middleware;\n }\n\n public onDestroy = (callback: VoidFunction) => {\n if(this.destroyed) return callback();\n this.onDestroyCallbacks.push(callback);\n };\n}\n\n// * will change .cleaned and new instance will be created\nexport function getMiddleware() {\n return new MiddlewareHelper();\n}\n","export default function defineNotNumerableProperties(obj: T, names: (keyof T)[]) {\n // const perf = performance.now();\n const props = {writable: true, configurable: true};\n const out: {[name in keyof T]?: typeof props} = {};\n names.forEach((name) => {\n if(!obj.hasOwnProperty(name)) {\n out[name] = props;\n }\n });\n Object.defineProperties(obj, out);\n // console.log('defineNotNumerableProperties time:', performance.now() - perf);\n}\n","export default function getDeepProperty(object: any, key: string) {\n const splitted = key.split('.');\n let o: any = object;\n splitted.forEach((key) => {\n if(!key) {\n return;\n }\n\n // @ts-ignore\n o = o[key];\n });\n\n return o;\n}\n","export default function getObjectKeysAndSort(object: {[key: string]: any} | Map, sort: 'asc' | 'desc' = 'asc') {\n if(!object) return [];\n const ids = object instanceof Map ? [...object.keys()] : Object.keys(object).map((i) => +i);\n if(sort === 'asc') return ids.sort((a, b) => a - b);\n else return ids.sort((a, b) => b - a);\n}\n","// * Jolly Cobra's schedulers\n\nimport ctx from '../../environment/ctx';\nimport {AnyFunction, Awaited} from '../../types';\nimport noop from '../noop';\n\nexport type DebounceReturnType = {\n (...args: Parameters): Promise>>;\n clearTimeout(): void;\n isDebounced(): boolean;\n};\n\nexport default function debounce(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n shouldRunLast = true\n): DebounceReturnType {\n let waitingTimeout: number;\n let waitingPromise: Promise>>, resolve: (result: any) => void, reject: () => void;\n let hadNewCall = false;\n\n const invoke = (args: Parameters) => {\n const _resolve = resolve, _reject = reject;\n try {\n const result = fn.apply(null, args);\n _resolve(result);\n } catch(err) {\n console.error('debounce error', err);\n // @ts-ignore\n _reject(err);\n }\n };\n\n const debounce = (...args: Parameters) => {\n if(!waitingPromise) waitingPromise = new Promise((_resolve, _reject) => (resolve = _resolve, reject = _reject));\n\n if(waitingTimeout) {\n clearTimeout(waitingTimeout);\n hadNewCall = true;\n reject();\n waitingPromise = new Promise((_resolve, _reject) => (resolve = _resolve, reject = _reject));\n } else if(shouldRunFirst) {\n invoke(args);\n hadNewCall = false;\n }\n\n const _waitingTimeout = ctx.setTimeout(() => {\n // will run if should run last or first but with new call\n if(shouldRunLast && (!shouldRunFirst || hadNewCall)) {\n invoke(args);\n }\n\n // if debounce was called during invoking\n if(waitingTimeout === _waitingTimeout) {\n waitingTimeout = waitingPromise = resolve = reject = undefined;\n hadNewCall = false;\n }\n }, ms);\n\n waitingTimeout = _waitingTimeout;\n waitingPromise.catch(noop);\n return waitingPromise;\n };\n\n debounce.clearTimeout = () => {\n if(waitingTimeout) {\n ctx.clearTimeout(waitingTimeout);\n reject();\n waitingTimeout = waitingPromise = resolve = reject = undefined;\n hadNewCall = false;\n }\n };\n\n debounce.isDebounced = () => !!waitingTimeout;\n\n return debounce;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport indexOfAndSplice from './array/indexOfAndSplice';\nimport compareValue from './compareValue';\n\n/**\n * Descend sorted storage\n */\n\ntype ItemType = number | string;\n\nexport enum SliceEnd {\n None = 0,\n Top = 1,\n Bottom = 2,\n Both = SliceEnd.Top | SliceEnd.Bottom\n};\n\nexport interface Slice extends Array {\n // slicedArray: SlicedArray;\n end: SliceEnd;\n\n isEnd: (side: SliceEnd) => boolean;\n setEnd: (side: SliceEnd) => void;\n unsetEnd: (side: SliceEnd) => void;\n getEnds: () => {top: boolean, bottom: boolean, both: boolean};\n\n slice: (from?: number, to?: number) => Slice;\n splice: (start: number, deleteCount: number, ...items: ItemType[]) => Slice;\n}\n\nexport interface SliceConstructor {\n // new(...items: T[]): Slice;\n new(length: number): Slice;\n}\n\nexport type SliceSerialized = {\n values: Slice,\n isEnd: {\n top: boolean,\n bottom: boolean,\n both: boolean\n }\n};\n\nexport type SlicedArraySerialized = {\n slices: SliceSerialized[]\n};\n\nexport default class SlicedArray {\n private slices: Slice[]/* = [[7,6,5],[4,3,2],[1,0,-1]] */;\n private sliceConstructor: SliceConstructor;\n\n constructor() {\n // @ts-ignore\n this.sliceConstructor = SlicedArray.getSliceConstructor(this);\n\n const first = this.constructSlice();\n // first.setEnd(SliceEnd.Bottom);\n this.slices = [first];\n }\n\n private static getSliceConstructor(slicedArray: SlicedArray) {\n return class Slice extends Array implements Slice {\n // slicedArray: SlicedArray;\n end: SliceEnd = SliceEnd.None;\n\n /* constructor(...items: ItemType[]) {\n super(...items);\n //this.slicedArray = slicedArray;\n } */\n\n isEnd(side: SliceEnd): boolean {\n if((this.end & side) === side) {\n return true;\n }/* else if(!this.slicedArray) {\n return false;\n } */\n\n let isEnd = false;\n if(side === SliceEnd.Top) {\n const slice = slicedArray.last;\n isEnd = slice.end & side ? this.includes(slice[slice.length - 1])/* || !slice.length */ : false;\n } else if(side === SliceEnd.Bottom) {\n const slice = slicedArray.first;\n isEnd = slice.end & side ? this.includes(slice[0])/* || !slice.length */ : false;\n } else if(side === SliceEnd.Both) {\n return this.isEnd(SliceEnd.Top) && this.isEnd(SliceEnd.Bottom);\n }\n\n if(isEnd) {\n this.setEnd(side);\n }\n\n return isEnd;\n }\n\n getEnds() {\n return {\n top: this.isEnd(SliceEnd.Top),\n bottom: this.isEnd(SliceEnd.Bottom),\n both: this.isEnd(SliceEnd.Both)\n };\n }\n\n setEnd(side: SliceEnd) {\n this.end |= side;\n }\n\n unsetEnd(side: SliceEnd) {\n this.end &= ~side;\n }\n\n splice(start: number, deleteCount: number, ...items: ItemType[]) {\n const ret = super.splice(start, deleteCount, ...items);\n\n if(!this.length) {\n const slices = slicedArray.slices as ItemType[][];\n const idx = slices.indexOf(this);\n if(idx !== -1) {\n if(slices.length === 1) { // left empty slice without ends\n this.unsetEnd(SliceEnd.Both);\n } else { // delete this slice\n slices.splice(idx, 1);\n }\n }\n }\n\n return ret;\n }\n }\n }\n\n public constructSlice(...items: T[]) {\n // const slice = new Slice(this, ...items);\n // can't pass items directly to constructor because first argument is length\n const slice = new this.sliceConstructor(items.length);\n for(let i = 0, length = items.length; i < length; ++i) {\n slice[i] = items[i];\n }\n return slice;\n\n // ! code below will slow execution in 15 times\n /* const self = this;\n const p: Slice = new Proxy(slice, {\n get: function(target, name: any) {\n if(name === 'constructor') {\n const p = new Proxy(Slice, {\n construct: (target, args) => {\n return self.constructSlice(...args);\n }\n });\n\n return p;\n }\n\n return target[name];\n }\n });\n\n return p; */\n\n /*\n var p = slicedArray.constructSlice();\n p.length = 100000;\n p.fill(255);\n\n var a = new Array(100000);\n a.fill(255);\n\n var b = 0;\n var perf = performance.now();\n for(var i = 0; i < p.length; ++i) {\n b += p[i];\n }\n\n console.log('perf 1', performance.now() - perf);\n\n b = 0;\n perf = performance.now();\n for(var i = 0; i < a.length; ++i) {\n b += a[i];\n }\n\n console.log('perf 2', performance.now() - perf);\n */\n }\n\n public insertSlice(slice: T[], flatten = true) {\n if(!slice.length) {\n return;\n }\n\n const first = this.slices[0];\n if(!first.length) {\n first.push(...slice);\n return first;\n }\n\n const lowerBound = slice[slice.length - 1];\n const upperBound = slice[0];\n\n let foundSlice: Slice, lowerIndex = -1, upperIndex = -1, foundSliceIndex = 0;\n for(; foundSliceIndex < this.slices.length; ++foundSliceIndex) {\n foundSlice = this.slices[foundSliceIndex];\n lowerIndex = foundSlice.indexOf(lowerBound);\n upperIndex = foundSlice.indexOf(upperBound);\n\n if(upperIndex !== -1 && -1 !== lowerIndex) {\n break;\n } else if(upperIndex !== -1 || -1 !== lowerIndex) {\n break;\n }\n }\n\n if(upperIndex !== -1 && -1 !== lowerIndex) {\n\n } else if(upperIndex !== -1) { // ([1, 2, 3] | [1, 2, 3, 4, 5]) -> [1, 2, 3, 4, 5]\n const sliced = slice.slice(foundSlice.length - upperIndex);\n foundSlice.push(...sliced);\n } else if(lowerIndex !== -1) { // ([1, 2, 3] | [-1, 0, 1]) -> [-1, 0, 1, 2, 3]\n const sliced = slice.slice(0, slice.length - lowerIndex - 1);\n foundSlice.unshift(...sliced);\n } else {\n let insertIndex = 0;\n for(const length = this.slices.length; insertIndex < length; ++insertIndex) { // * maybe should iterate from the end, could be faster ?\n const s = this.slices[insertIndex];\n if(compareValue(slice[0], s[0]) === 1) {\n break;\n }\n }\n\n this.slices.splice(insertIndex, 0, this.constructSlice(...slice));\n foundSliceIndex = insertIndex;\n }\n\n if(flatten) {\n return this.flatten(foundSliceIndex);\n }\n }\n\n private flatten(foundSliceIndex: number) {\n if(this.slices.length >= 2) {\n for(let i = 0, length = this.slices.length; i < (length - 1); ++i) {\n const prevSlice = this.slices[i];\n const nextSlice = this.slices[i + 1];\n\n const upperIndex = prevSlice.indexOf(nextSlice[0]);\n if(upperIndex !== -1) {\n prevSlice.setEnd(nextSlice.end);\n this.slices.splice(i + 1, 1);\n\n if(i < foundSliceIndex) {\n --foundSliceIndex;\n }\n\n --length; // respect array bounds\n --i; // repeat from the same place\n\n this.insertSlice(nextSlice, false);\n }\n }\n }\n\n return this.slices[foundSliceIndex];\n }\n\n // *\n\n get first() {\n return this.slices[0];\n }\n\n get last() {\n return this.slices[this.slices.length - 1];\n }\n\n get slice() {\n return this.first;\n }\n\n get length() {\n return this.slice.length;\n }\n\n public findSlice(item: T) {\n for(let i = 0, length = this.slices.length; i < length; ++i) {\n const slice = this.slices[i];\n const index = slice.indexOf(item);\n if(index !== -1) {\n return {slice, index};\n }\n }\n\n return undefined;\n }\n\n public findSliceOffset(maxId: T) {\n let slice: Slice;\n for(let i = 0; i < this.slices.length; ++i) {\n let offset = 0;\n slice = this.slices[i];\n if(slice.length < 2) {\n continue;\n }\n\n for(; offset < slice.length; ++offset) {\n if(compareValue(maxId, slice[offset]) >= 0) {\n /* if(!offset) { // because can't find 3 in [[5,4], [2,1]]\n return undefined;\n } */\n\n return {\n slice,\n offset: maxId === slice[offset] ? offset : offset - 1\n };\n }\n }\n }\n\n if(slice && slice.isEnd(SliceEnd.Top)) {\n return {\n slice,\n offset: slice.length\n };\n }\n\n return undefined;\n }\n\n // * https://core.telegram.org/api/offsets\n public sliceMe(offsetId: T, add_offset: number, limit: number) {\n let slice = this.slice;\n let offset = 0;\n let sliceOffset = 0;\n\n if(offsetId) {\n const pos = this.findSliceOffset(offsetId);\n if(!pos) {\n return undefined;\n }\n\n slice = pos.slice;\n offset = sliceOffset = pos.offset;\n\n if(slice.includes(offsetId)) {\n sliceOffset += 1;\n }\n\n /* if(slice.includes(offsetId) && add_offset < 0) {\n add_offset += 1;\n } */\n }\n\n const sliceStart = Math.max(sliceOffset + add_offset, 0);\n const sliceEnd = sliceOffset + add_offset + limit;\n // const fixHalfBackLimit = add_offset && !(limit / add_offset % 2) && (sliceEnd % 2) ? 1 : 0;\n // sliceEnd += fixHalfBackLimit;\n\n const sliced = slice.slice(sliceStart, sliceEnd) as Slice;\n\n const topWasMeantToLoad = add_offset < 0 ? limit + add_offset : limit;\n const bottomWasMeantToLoad = Math.abs(add_offset);\n\n // can use 'slice' here to check because if it's end, then 'sliced' is out of 'slice'\n // useful when there is only 1 message in chat on its reopening\n const topFulfilled = (slice.length - sliceOffset) >= topWasMeantToLoad || (slice.isEnd(SliceEnd.Top) ? (sliced.setEnd(SliceEnd.Top), true) : false);\n const bottomFulfilled = (sliceOffset - bottomWasMeantToLoad) >= 0 || (slice.isEnd(SliceEnd.Bottom) ? (sliced.setEnd(SliceEnd.Bottom), true) : false);\n\n // if(topFulfilled) sliced.isEnd(SliceEnd.Top);\n // if(bottomFulfilled) sliced.isEnd(SliceEnd.Bottom);\n\n return {\n slice: sliced,\n offsetIdOffset: offset,\n fulfilled: SliceEnd.None | (topFulfilled && bottomFulfilled ? SliceEnd.Both : ((topFulfilled ? SliceEnd.Top : SliceEnd.None) | (bottomFulfilled ? SliceEnd.Bottom : SliceEnd.None)))\n };\n }\n\n public unshift(...items: T[]) {\n let slice = this.first;\n if(!slice.length) {\n slice.setEnd(SliceEnd.Bottom);\n } else if(!slice.isEnd(SliceEnd.Bottom)) {\n slice = this.constructSlice();\n slice.setEnd(SliceEnd.Bottom);\n this.slices.unshift(slice);\n }\n\n slice.unshift(...items);\n }\n\n public push(...items: T[]) {\n let slice = this.last;\n if(!slice.length) {\n slice.setEnd(SliceEnd.Top);\n } else if(!slice.isEnd(SliceEnd.Top)) {\n slice = this.constructSlice();\n slice.setEnd(SliceEnd.Top);\n this.slices.push(slice);\n }\n\n slice.push(...items);\n }\n\n public delete(item: T) {\n const found = this.findSlice(item);\n if(found) {\n found.slice.splice(found.index, 1);\n return true;\n }\n\n return false;\n }\n\n public deleteSlice(slice: Slice) {\n indexOfAndSplice(this.slices, slice);\n }\n\n public toJSON() {\n const slices: SlicedArraySerialized['slices'] = this.slices.map((slice) => {\n return {\n values: slice.slice(),\n isEnd: slice.getEnds()\n };\n });\n\n const serialized: SlicedArraySerialized = {\n slices\n };\n\n return JSON.stringify(serialized);\n }\n\n public static fromJSON(json: string) {\n const parsed: SlicedArraySerialized = JSON.parse(json);\n const sliced = new SlicedArray();\n parsed.slices.forEach((slice) => {\n const inserted = sliced.insertSlice(slice.values) || sliced.first;\n if(slice.isEnd.top) inserted.setEnd(SliceEnd.Top);\n if(slice.isEnd.bottom) inserted.setEnd(SliceEnd.Bottom);\n });\n\n return sliced;\n }\n}\n\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.SlicedArray = SlicedArray);\n","import compareLong from './long/compareLong';\n\nexport default function compareValue(val1: string | number, val2: typeof val1) {\n if((val1 as number).toExponential) {\n const diff = (val1 as number) - (val2 as number);\n return diff < 0 ? -1 : (diff > 0 ? 1 : 0);\n }\n\n return compareLong(val1 as string, val2 as string);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function compareLong(str1: string, str2: string) {\n const str1Length = str1.length;\n if(str1Length !== str2.length) {\n const diff = str1Length - str2.length;\n return diff < 0 ? -1 : (diff > 0 ? 1 : 0);\n }\n\n const maxPartLength = 15;\n for(let i = 0; i < str1Length; i += maxPartLength) {\n const v1 = +str1.slice(i, i + maxPartLength);\n const v2 = +str2.slice(i, i + maxPartLength);\n const diff = v1 - v2;\n if(diff) {\n return diff;\n }\n }\n\n return 0;\n}\n","import {AttachMenuBot} from '../../../../layer';\nimport {ATTACH_MENU_BOT_ICON_NAME} from '../../../mtproto/mtproto_config';\n\nexport default function getAttachMenuBotIcon(attachMenuBot: AttachMenuBot) {\n return attachMenuBot.icons.find((icon) => icon.name === ATTACH_MENU_BOT_ICON_NAME);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {ChannelParticipant, ChatParticipant} from '../../../../layer';\nimport getPeerId from '../peers/getPeerId';\n\nexport default function getParticipantPeerId(participant: ChannelParticipant | ChatParticipant): PeerId {\n const peerId = (participant as ChannelParticipant.channelParticipantBanned).peer ?\n getPeerId((participant as ChannelParticipant.channelParticipantBanned).peer) :\n (participant as ChatParticipant.chatParticipant).user_id.toPeerId();\n return peerId;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Chat, ChatAdminRights, ChatBannedRights} from '../../../../layer';\nimport {ChatRights} from '../../appChatsManager';\n\n/**\n * Check the user's ability to do an action in chat\n * @param id\n * @param action creator can still send messages to left channel. so this function shows server rights. see canSendToPeer for local rights in messages manager.\n * @param rights do not provide this parameter when checking rights for self\n * @param isThread\n * @returns\n */\nexport default function hasRights(chat: Exclude, action: ChatRights, rights?: ChatAdminRights | ChatBannedRights, isThread?: boolean) {\n if(!chat) return false;\n\n if((chat as Chat.chat).pFlags.deactivated && action !== 'view_messages') {\n return false;\n }\n\n const isCheckingRightsForSelf = rights === undefined;\n if((chat as Chat.chat).pFlags.creator && isCheckingRightsForSelf) {\n return true;\n }\n\n if(chat._ === 'chatForbidden' ||\n chat._ === 'channelForbidden' ||\n // (chat as any).pFlags.kicked ||\n (chat.pFlags.left && !(chat as Chat.channel).pFlags.megagroup)) {\n return false;\n }\n\n // const adminRights = chat.admin_rights;\n // const bannedRights = (chat as Chat.channel).banned_rights || chat.default_banned_rights;\n\n if(!rights) {\n rights = chat.admin_rights || (chat as Chat.channel).banned_rights || chat.default_banned_rights;\n\n if(!rights) {\n return false;\n }\n }\n\n let myFlags: Partial<{[flag in keyof ChatBannedRights['pFlags'] | keyof ChatAdminRights['pFlags']]: true}> = {};\n if(rights) {\n myFlags = rights.pFlags as any;\n }\n\n // const adminFlags = adminRights?.pFlags || {};\n // const bannedFlags = bannedRights?.pFlags || {};\n\n const isAdmin = rights._ === 'chatAdminRights';\n\n switch(action) {\n case 'embed_links':\n case 'send_games':\n case 'send_gifs':\n case 'send_inline':\n case 'send_media':\n case 'send_messages':\n case 'send_polls':\n case 'send_stickers':\n case 'send_photos':\n case 'send_videos':\n case 'send_roundvideos':\n case 'send_audios':\n case 'send_voices':\n case 'send_docs':\n case 'send_plain': {\n if(!isThread && chat.pFlags.left) {\n return false;\n }\n\n if(rights._ === 'chatBannedRights' && myFlags[action]) {\n return false;\n }\n\n if(chat._ === 'channel') {\n if(!chat.pFlags.megagroup && !myFlags.post_messages) {\n return false;\n }\n }\n\n break;\n }\n\n // * revoke foreign messages\n case 'delete_messages':\n case 'manage_call': {\n return !!myFlags[action];\n }\n\n case 'pin_messages': {\n return isAdmin ? myFlags[action] || !!myFlags.post_messages : !myFlags[action];\n }\n\n // case 'change_info': {\n // return adminRights || isCheckingRightsForSelf ? adminFlags[action] : !myFlags[action];\n // }\n\n case 'change_info':\n case 'invite_users': {\n return isAdmin ? !!myFlags[action] : !myFlags[action];\n }\n\n // * only creator can do that\n case 'change_type':\n case 'delete_chat': {\n return false;\n }\n\n case 'edit_messages':\n case 'manage_topics': {\n return isAdmin && !!myFlags[action];\n }\n\n case 'ban_users':\n case 'change_permissions': {\n return isAdmin && !!myFlags['ban_users'];\n }\n\n case 'view_participants': {\n return !!(chat._ === 'chat' || !chat.pFlags.broadcast || chat.pFlags.creator || chat.admin_rights);\n }\n }\n\n return true;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Dialog, ForumTopic} from '../../../../layer';\nimport type {REAL_FOLDER_ID} from '../../../mtproto/mtproto_config';\nimport getDialogIndexKey from './getDialogIndexKey';\n\nexport default function getDialogIndex(\n dialog: Dialog.dialog | ForumTopic.forumTopic,\n indexKey: ReturnType = getDialogIndexKey((dialog as Dialog).folder_id as REAL_FOLDER_ID)\n) {\n return dialog?.[indexKey as 'index_0'];\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {DialogFilter} from '../../../../layer';\n\nexport default function getDialogIndexKey(localId: DialogFilter.dialogFilter['localId'] = 0) {\n return `index_${localId}` as const;\n // return filterId !== undefined && filterId > 1 ? `filter_${filterId}` as const : 'main' as const;\n // const indexStr = filterId > 1 ?\n // `index_${filterId}` as const :\n // 'index' as const;\n\n // return indexStr;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Document, PhotoSize, VideoSize} from '../../../../layer';\nimport type {DownloadOptions} from '../../../mtproto/apiFileManager';\nimport getDocumentInputFileLocation from './getDocumentInputFileLocation';\n\nexport default function getDocumentDownloadOptions(\n doc: Document.document,\n thumb?: PhotoSize.photoSize | Extract,\n queueId?: number,\n onlyCache?: boolean\n): DownloadOptions {\n const inputFileLocation = getDocumentInputFileLocation(doc, thumb?.type);\n\n let mimeType: MTMimeType;\n if(thumb?._ === 'photoSize') {\n mimeType = doc.sticker ? 'image/webp' : (doc.mime_type.startsWith('image/') ? doc.mime_type : 'image/jpeg');\n } else {\n mimeType = doc.mime_type || 'application/octet-stream';\n }\n\n return {\n dcId: doc.dc_id,\n location: inputFileLocation,\n size: thumb ? thumb.size : doc.size,\n mimeType,\n fileName: doc.file_name,\n queueId,\n onlyCache\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Document, InputFileLocation} from '../../../../layer';\n\nexport default function getDocumentInputFileLocation(doc: Document.document, thumbSize?: string): InputFileLocation.inputDocumentFileLocation {\n return {\n _: 'inputDocumentFileLocation',\n id: doc.id,\n access_hash: doc.access_hash,\n file_reference: doc.file_reference,\n thumb_size: thumbSize\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {getFileNameByLocation} from '../../../../helpers/fileName';\nimport {DownloadOptions} from '../../../mtproto/apiFileManager';\n\nexport default function getDownloadFileNameFromOptions(options: DownloadOptions) {\n return getFileNameByLocation(options.location, options);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {DownloadMediaOptions, DownloadOptions} from '../../../mtproto/apiFileManager';\nimport getDocumentDownloadOptions from '../docs/getDocumentDownloadOptions';\nimport getPhotoDownloadOptions from '../photos/getPhotoDownloadOptions';\nimport getWebDocumentDownloadOptions from '../webDocs/getWebDocumentDownloadOptions';\nimport isWebDocument from '../webDocs/isWebDocument';\nimport getDownloadFileNameFromOptions from './getDownloadFileNameFromOptions';\n\nexport default function getDownloadMediaDetails(options: DownloadMediaOptions) {\n const {media, thumb, queueId, onlyCache} = options;\n\n let downloadOptions: DownloadOptions;\n if(media._ === 'document') downloadOptions = getDocumentDownloadOptions(media, thumb as any, queueId, onlyCache);\n else if(media._ === 'photo') downloadOptions = getPhotoDownloadOptions(media, thumb as any, queueId, onlyCache);\n else if(isWebDocument(media)) downloadOptions = getWebDocumentDownloadOptions(media);\n\n downloadOptions.downloadId = options.downloadId;\n\n const fileName = getDownloadFileNameFromOptions(downloadOptions);\n return {fileName, downloadOptions};\n}\n","import {WebDocument} from '../../../../layer';\nimport {DownloadOptions} from '../../../mtproto/apiFileManager';\n\nexport default function getWebDocumentDownloadOptions(webDocument: WebDocument): DownloadOptions {\n return {\n dcId: 0,\n location: {\n _: 'inputWebFileLocation',\n access_hash: (webDocument as WebDocument.webDocument).access_hash,\n url: webDocument.url\n },\n size: webDocument.size,\n mimeType: webDocument.mime_type\n };\n}\n","import deepEqual from '../../../../helpers/object/deepEqual';\nimport isObject from '../../../../helpers/object/isObject';\nimport {DraftMessage} from '../../../../layer';\n\nexport default function draftsAreEqual(draft1: DraftMessage, draft2: DraftMessage) {\n if(typeof(draft1) !== typeof(draft2)) {\n return false;\n }\n\n if(!isObject(draft1)) {\n return true;\n }\n\n if(draft1._ !== draft2._) {\n return false;\n }\n\n if(draft1._ === 'draftMessage' && draft2._ === draft1._) {\n if(draft1.reply_to_msg_id !== draft2.reply_to_msg_id) {\n return false;\n }\n\n if(!deepEqual(draft1.entities, draft2.entities)) {\n return false;\n }\n\n if(draft1.message !== draft2.message) {\n return false;\n }\n\n if(draft1.pFlags.no_webpage !== draft2.pFlags.no_webpage) {\n return false;\n }\n }\n\n return true;\n}\n","import {MessagesBotResults} from '../../../../layer';\n\nexport default function generateQId(queryId: MessagesBotResults.messagesBotResults['query_id'], resultId: string) {\n return queryId + '_' + resultId;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MESSAGE_ID_OFFSET, MESSAGE_ID_INCREMENT} from '.';\n\nexport default function generateMessageId(messageId: number) {\n const q = MESSAGE_ID_OFFSET;\n if(messageId >= q) {\n return messageId;\n }\n\n return q + (messageId * MESSAGE_ID_INCREMENT);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Message, MessageMedia, MessageEntity, MessageAction} from '../../../../layer';\nimport matchUrl from '../../../richTextProcessor/matchUrl';\nimport type {MyDocument} from '../../appDocsManager';\nimport type {MyInputMessagesFilter, MyMessage} from '../../appMessagesManager';\n\nexport default function filterMessagesByInputFilter(inputFilter: MyInputMessagesFilter, history: Array, limit: number) {\n if(inputFilter === 'inputMessagesFilterEmpty') {\n return history;\n }\n\n const foundMsgs: MyMessage[] = [];\n if(!history.length) {\n return foundMsgs;\n }\n\n let filtering = true;\n const neededContents: Partial<{\n [messageMediaType in MessageMedia['_']]: boolean\n }> & Partial<{\n avatar: boolean,\n url: boolean\n }> = {},\n neededDocTypes: MyDocument['type'][] = [],\n excludeDocTypes: MyDocument['type'][] = []/* ,\n neededFlags: string[] = [] */;\n\n switch(inputFilter) {\n case 'inputMessagesFilterPhotos':\n neededContents['messageMediaPhoto'] = true;\n break;\n\n case 'inputMessagesFilterPhotoVideo':\n neededContents['messageMediaPhoto'] = true;\n neededContents['messageMediaDocument'] = true;\n neededDocTypes.push('video');\n break;\n\n case 'inputMessagesFilterVideo':\n neededContents['messageMediaDocument'] = true;\n neededDocTypes.push('video');\n break;\n\n case 'inputMessagesFilterDocument':\n neededContents['messageMediaDocument'] = true;\n // excludeDocTypes.push('video');\n neededDocTypes.push(undefined, 'photo', 'pdf');\n break;\n\n case 'inputMessagesFilterVoice':\n neededContents['messageMediaDocument'] = true;\n neededDocTypes.push('voice');\n break;\n\n case 'inputMessagesFilterRoundVoice':\n neededContents['messageMediaDocument'] = true;\n neededDocTypes.push('round', 'voice');\n break;\n\n case 'inputMessagesFilterRoundVideo':\n neededContents['messageMediaDocument'] = true;\n neededDocTypes.push('round');\n break;\n\n case 'inputMessagesFilterMusic':\n neededContents['messageMediaDocument'] = true;\n neededDocTypes.push('audio');\n break;\n\n case 'inputMessagesFilterUrl':\n neededContents['url'] = true;\n break;\n\n case 'inputMessagesFilterChatPhotos':\n neededContents['avatar'] = true;\n break;\n\n /* case 'inputMessagesFilterPinned':\n neededFlags.push('pinned');\n break; */\n\n /* case 'inputMessagesFilterMyMentions':\n neededContents['mentioned'] = true;\n break; */\n\n default:\n filtering = false;\n break;\n /* return Promise.resolve({\n count: 0,\n next_rate: 0,\n history: [] as number[]\n }); */\n }\n\n if(!filtering) {\n return foundMsgs;\n }\n\n for(let i = 0, length = history.length; i < length; ++i) {\n const message: Message.message | Message.messageService = history[i];\n if(!message) continue;\n\n // || (neededContents['mentioned'] && message.totalEntities.find((e: any) => e._ === 'messageEntityMention'));\n\n let found = false;\n if(message._ === 'message') {\n if(message.media && neededContents[message.media._]/* && !message.fwd_from */) {\n const doc = (message.media as MessageMedia.messageMediaDocument).document as MyDocument;\n if(doc &&\n (\n (neededDocTypes.length && !neededDocTypes.includes(doc.type)) ||\n excludeDocTypes.includes(doc.type)\n )\n ) {\n continue;\n }\n\n found = true;\n } else if(neededContents['url'] && message.message) {\n const goodEntities = ['messageEntityTextUrl', 'messageEntityUrl'];\n if((message.totalEntities as MessageEntity[]).find((e) => goodEntities.includes(e._)) || matchUrl(message.message)) {\n found = true;\n }\n }\n } else if(neededContents['avatar'] &&\n message.action &&\n ([\n 'messageActionChannelEditPhoto' as const,\n 'messageActionChatEditPhoto' as const,\n 'messageActionChannelEditVideo' as const,\n 'messageActionChatEditVideo' as const\n ] as MessageAction['_'][]).includes(message.action._)) {\n found = true;\n }/* else if(neededFlags.find((flag) => message.pFlags[flag])) {\n found = true;\n } */\n\n if(found) {\n foundMsgs.push(message);\n if(foundMsgs.length >= limit) {\n break;\n }\n }\n }\n\n return foundMsgs;\n}\n","import assumeType from '../../../../helpers/assumeType';\nimport {Message} from '../../../../layer';\n\nexport default function getAlbumText(messages: Message.message[]) {\n let foundMessages = 0, message: Message.message;\n for(const m of messages) {\n assumeType(m);\n if(m.message) {\n if(++foundMessages > 1) break;\n message = m;\n }\n }\n\n if(foundMessages > 1) {\n message = undefined;\n }\n\n return message;\n}\n","import {Message} from '../../../../layer';\nimport {GENERAL_TOPIC_ID} from '../../../mtproto/mtproto_config';\n\nexport default function getMessageThreadId(message: Message.message | Message.messageService, isForum?: boolean) {\n let threadId: number;\n const replyTo = message.reply_to;\n if(replyTo && (!isForum || replyTo.pFlags.forum_topic)) {\n threadId = replyTo.reply_to_top_id || replyTo.reply_to_msg_id;\n } else if(isForum) {\n if(message._ === 'messageService' && message.action?._ === 'messageActionTopicCreate') {\n threadId = message.mid;\n } else {\n threadId = GENERAL_TOPIC_ID;\n }\n }\n\n return threadId;\n}\n","import {Chat, User} from '../../../../layer';\n\nexport default function getPeerActiveUsernames(peer: User | Chat) {\n if(!peer) {\n return [];\n }\n\n const usernames = (peer as Chat.channel).usernames;\n if(usernames) {\n return usernames\n .filter((username) => username.pFlags.active)\n // .sort((a, b) => +!!b.pFlags.editable - +!!a.pFlags.editable)\n .map((username) => username.username);\n }\n\n return (peer as Chat.channel).username ? [(peer as Chat.channel).username] : [];\n}\n","import {Chat, ChatPhoto, User, UserProfilePhoto} from '../../../../layer';\nimport isPeerRestricted from './isPeerRestricted';\n\nexport default function getPeerPhoto(peer: User | Chat) {\n if(!peer || isPeerRestricted(peer)) {\n return;\n }\n\n return (peer as User.user | Chat.channel)?.photo as UserProfilePhoto.userProfilePhoto | ChatPhoto.chatPhoto;\n}\n","import {isRestricted} from '../../../../helpers/restrictions';\nimport {Chat, User} from '../../../../layer';\n\nexport default function isPeerRestricted(peer: Chat | User) {\n const restrictionReasons = (peer as Chat.channel)?.restriction_reason;\n return !!(restrictionReasons && (peer as Chat.channel).pFlags.restricted && isRestricted(restrictionReasons));\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {PhotoSize, InputFileLocation} from '../../../../layer';\nimport type {DownloadOptions} from '../../../mtproto/apiFileManager';\nimport type {MyDocument} from '../../appDocsManager';\nimport type {MyPhoto} from '../../appPhotosManager';\n\nexport default function getPhotoDownloadOptions(photo: MyPhoto | MyDocument, photoSize: PhotoSize, queueId?: number, onlyCache?: boolean): DownloadOptions {\n const isDocument = photo._ === 'document';\n\n if(!photoSize || photoSize._ === 'photoSizeEmpty') {\n // console.error('no photoSize by photo:', photo);\n throw new Error('photoSizeEmpty!');\n }\n\n // maybe it's a thumb\n const isPhoto = !!((photoSize._ === 'photoSize' || photoSize._ === 'photoSizeProgressive') && photo.access_hash && photo.file_reference);\n const location: InputFileLocation.inputPhotoFileLocation | InputFileLocation.inputDocumentFileLocation = {\n _: isDocument ? 'inputDocumentFileLocation' : 'inputPhotoFileLocation',\n id: photo.id,\n access_hash: photo.access_hash,\n file_reference: photo.file_reference,\n thumb_size: photoSize.type\n };\n\n return {\n dcId: photo.dc_id,\n location,\n size: isPhoto ? (photoSize as PhotoSize.photoSize).size : undefined,\n mimeType: 'image/jpeg',\n queueId,\n onlyCache\n };\n}\n","import deepEqual from '../../../../helpers/object/deepEqual';\nimport {Reaction} from '../../../../layer';\n\nexport default function reactionsEqual(r1: Reaction, r2: Reaction) {\n return deepEqual(r1, r2);\n}\n","import {MyDocument} from '../../appDocsManager';\nimport {VideoSize} from '../../../../layer';\n\nexport default function getStickerEffectThumb(doc: MyDocument) {\n return doc.video_thumbs?.[0] as Extract;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {User} from '../../../../layer';\nimport {REPLIES_PEER_ID} from '../../../mtproto/mtproto_config';\n\nexport default function canSendToUser(user: User.user) {\n return !!(user && !user.pFlags.deleted && user.id.toPeerId() !== REPLIES_PEER_ID);\n}\n","import {WebDocument} from '../../../../layer';\n\nexport default function isWebDocument(webDocument: any): webDocument is WebDocument {\n return !!(webDocument && (webDocument._ === 'webDocument' || webDocument._ === 'webDocumentNoProxy'));\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport enum ConnectionStatus {\n Connected,\n Connecting,\n Closed,\n TimedOut\n};\n\nexport type ConnectionStatusChange = {\n _: 'networkerStatus',\n status: ConnectionStatus,\n dcId: number,\n name: string,\n isFileNetworker: boolean,\n isFileDownload: boolean,\n isFileUpload: boolean,\n retryAt?: number\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\n\nconst CAN_COMBINE_ENTITIES: Set = new Set([\n 'messageEntityBold',\n 'messageEntityItalic',\n 'messageEntityCode',\n 'messageEntityPre',\n 'messageEntityUnderline',\n 'messageEntityStrike',\n 'messageEntityBlockquote',\n 'messageEntitySpoiler'\n]);\nexport default function combineSameEntities(entities: MessageEntity[]) {\n // entities = entities.slice();\n for(let i = 0; i < entities.length; ++i) {\n const entity = entities[i];\n\n let nextEntityIdx = -1;\n do {\n nextEntityIdx = entities.findIndex((e, _i) => {\n return CAN_COMBINE_ENTITIES.has(e._) && _i !== i && e._ === entity._ && (e.offset - entity.length) === entity.offset;\n });\n\n if(nextEntityIdx !== -1) {\n const nextEntity = entities[nextEntityIdx];\n entity.length += nextEntity.length;\n entities.splice(nextEntityIdx, 1);\n }\n } while(nextEntityIdx !== -1);\n }\n // return entities;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\nimport spoiler from './spoiler';\n\nexport default function encodeSpoiler(text: string, entity: MessageEntity.messageEntitySpoiler) {\n const before = text.slice(0, entity.offset);\n const spoilerBefore = text.slice(entity.offset, entity.offset + entity.length);\n const spoilerAfter = spoiler(spoilerBefore)/* '▚'.repeat(entity.length) */;\n const after = text.slice(entity.offset + entity.length);\n text = before + spoilerAfter + after;\n return {text, entityText: spoilerAfter};\n};\n","export default function spoiler(text: string): string {\n const chars = '⠁⠂⠄⠈⠐⠠⡀⢀⠃⠅⠆⠉⠊⠌⠑⠒⠔⠘⠡⠢⠤⠨⠰⡁⡂⡄⡈⡐⡠⢁⢂⢄⢈⢐⢠⣀⠇⠋⠍⠎⠓⠕⠖⠙⠚⠜⠣⠥⠦⠩⠪⠬⠱⠲⠴⠸⡃⡅⡆⡉⡊⡌⡑⡒⡔⡘⡡⡢⡤⡨⡰⢃⢅⢆⢉⢊⢌⢑⢒⢔⢘⢡⢢⢤⢨⢰⣁⣂⣄⣈⣐⣠⠏⠗⠛⠝⠞⠧⠫⠭⠮⠳⠵⠶⠹⠺⠼⡇⡋⡍⡎⡓⡕⡖⡙⡚⡜⡣⡥⡦⡩⡪⡬⡱⡲⡴⡸⢇⢋⢍⢎⢓⢕⢖⢙⢚⢜⢣⢥⢦⢩⢪⢬⢱⢲⢴⢸⣃⣅⣆⣉⣊⣌⣑⣒⣔⣘⣡⣢⣤⣨⣰⠟⠯⠷⠻⠽⠾⡏⡗⡛⡝⡞⡧⡫⡭⡮⡳⡵⡶⡹⡺⡼⢏⢗⢛⢝⢞⢧⢫⢭⢮⢳⢵⢶⢹⢺⢼⣇⣋⣍⣎⣓⣕⣖⣙⣚⣜⣣⣥⣦⣩⣪⣬⣱⣲⣴⣸⠿⡟⡯⡷⡻⡽⡾⢟⢯⢷⢻⢽⢾⣏⣗⣛⣝⣞⣧⣫⣭⣮⣳⣵⣶⣹⣺⣼⡿⢿⣟⣯⣷⣻⣽⣾⣿';\n const charsLength = chars.length;\n\n const out: string[] = [];\n for(let i = 0; i < text.length; ++i) {\n const char = text.charCodeAt(i);\n out.push(chars[char % charsLength]);\n }\n\n return out.join('');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {PASS_CONFLICTING_ENTITIES} from '.';\nimport {MessageEntity} from '../../layer';\n\nconst SINGLE_ENTITIES: Set = new Set(['messageEntityPre', 'messageEntityCode']);\n\nexport default function findConflictingEntity(currentEntities: MessageEntity[], newEntity: MessageEntity) {\n let singleEnd = -1;\n return currentEntities.find((currentEntity) => {\n if(SINGLE_ENTITIES.has(currentEntity._)) {\n singleEnd = currentEntity.offset + currentEntity.length;\n }\n\n if(newEntity.offset < singleEnd && !PASS_CONFLICTING_ENTITIES.has(newEntity._)) {\n return true;\n }\n\n const isConflictingTypes = newEntity._ === currentEntity._ ||\n (!PASS_CONFLICTING_ENTITIES.has(newEntity._) && !PASS_CONFLICTING_ENTITIES.has(currentEntity._));\n\n if(!isConflictingTypes) {\n return false;\n }\n\n const isConflictingOffset = newEntity.offset >= currentEntity.offset &&\n (newEntity.length + newEntity.offset) <= (currentEntity.length + currentEntity.offset);\n\n return isConflictingOffset;\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\n\nexport default function fixEmoji(text: string, entities?: MessageEntity[]) {\n /* if(!IS_EMOJI_SUPPORTED) {\n return text;\n } */\n // '$`\\ufe0f'\n\n text = text.replace(/[\\u2640\\u2642\\u2764](?!\\ufe0f)/g, (match, offset, string) => {\n if(entities) {\n const length = match.length;\n\n offset += length;\n entities.forEach((entity) => {\n const end = entity.offset + entity.length;\n if(end === offset) { // current entity\n entity.length += length;\n } else if(end > offset) {\n entity.offset += length;\n }\n });\n }\n\n // console.log([match, offset, string]);\n return match + '\\ufe0f';\n });\n\n return text;\n}\n","import {URL_REG_EXP} from '.';\n\nexport default function matchUrl(text: string) {\n return !text ? null : text.match(URL_REG_EXP);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\nimport findConflictingEntity from './findConflictingEntity';\nimport sortEntities from './sortEntities';\n\nexport default function mergeEntities(currentEntities: MessageEntity[], newEntities: MessageEntity[]) {\n const filtered = newEntities.filter((e) => {\n return !findConflictingEntity(currentEntities, e);\n });\n\n currentEntities.push(...filtered);\n sortEntities(currentEntities);\n // currentEntities.sort((a, b) => a.offset - b.offset);\n // currentEntities.sort((a, b) => (a.offset - b.offset) || (a._ === 'messageEntityCaret' && -1));\n\n // * fix splitted emoji. messageEntityTextUrl can split the emoji if starts before its end (e.g. on fe0f)\n // * have to fix even if emoji supported since it's being wrapped in span\n // if(!IS_EMOJI_SUPPORTED) {\n for(let i = 0; i < currentEntities.length; ++i) {\n const entity = currentEntities[i];\n if(entity._ === 'messageEntityEmoji') {\n const nextEntity = currentEntities[i + 1];\n if(nextEntity /* && nextEntity._ !== 'messageEntityCaret' */ && nextEntity.offset < (entity.offset + entity.length)) {\n entity.length = nextEntity.offset - entity.offset;\n }\n }\n }\n // }\n\n return currentEntities;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\n// From https://github.com/stephenmathieson/node-tlds/blob/master/index.js\nconst TLD = ['abogado', 'ac', 'academy', 'accountants', 'active', 'actor', 'ad', 'adult', 'ae', 'aero', 'af', 'ag', 'agency', 'ai', 'airforce', 'al', 'allfinanz', 'alsace', 'am', 'amsterdam', 'an', 'android', 'ao', 'apartments', 'aq', 'aquarelle', 'ar', 'archi', 'army', 'arpa', 'as', 'asia', 'associates', 'at', 'attorney', 'au', 'auction', 'audio', 'autos', 'aw', 'ax', 'axa', 'az', 'ba', 'band', 'bank', 'bar', 'barclaycard', 'barclays', 'bargains', 'bayern', 'bb', 'bd', 'be', 'beer', 'berlin', 'best', 'bf', 'bg', 'bh', 'bi', 'bid', 'bike', 'bingo', 'bio', 'biz', 'bj', 'black', 'blackfriday', 'bloomberg', 'blue', 'bm', 'bmw', 'bn', 'bnpparibas', 'bo', 'boo', 'boutique', 'br', 'brussels', 'bs', 'bt', 'budapest', 'build', 'builders', 'business', 'buzz', 'bv', 'bw', 'by', 'bz', 'bzh', 'ca', 'cab', 'cal', 'camera', 'camp', 'cancerresearch', 'canon', 'capetown', 'capital', 'caravan', 'cards', 'care', 'career', 'careers', 'cartier', 'casa', 'cash', 'cat', 'catering', 'cc', 'cd', 'center', 'ceo', 'cern', 'cf', 'cg', 'ch', 'channel', 'chat', 'cheap', 'christmas', 'chrome', 'church', 'ci', 'citic', 'city', 'ck', 'cl', 'claims', 'cleaning', 'click', 'clinic', 'clothing', 'club', 'cm', 'cn', 'co', 'coach', 'codes', 'coffee', 'college', 'cologne', 'com', 'community', 'company', 'computer', 'condos', 'construction', 'consulting', 'contractors', 'cooking', 'cool', 'coop', 'country', 'cr', 'credit', 'creditcard', 'cricket', 'crs', 'cruises', 'cu', 'cuisinella', 'cv', 'cw', 'cx', 'cy', 'cymru', 'cz', 'dabur', 'dad', 'dance', 'dating', 'day', 'dclk', 'de', 'deals', 'degree', 'delivery', 'democrat', 'dental', 'dentist', 'desi', 'design', 'dev', 'diamonds', 'diet', 'digital', 'direct', 'directory', 'discount', 'dj', 'dk', 'dm', 'dnp', 'do', 'docs', 'domains', 'doosan', 'durban', 'dvag', 'dz', 'eat', 'ec', 'edu', 'education', 'ee', 'eg', 'email', 'emerck', 'energy', 'engineer', 'engineering', 'enterprises', 'equipment', 'er', 'es', 'esq', 'estate', 'et', 'eu', 'eurovision', 'eus', 'events', 'everbank', 'exchange', 'expert', 'exposed', 'fail', 'farm', 'fashion', 'feedback', 'fi', 'finance', 'financial', 'firmdale', 'fish', 'fishing', 'fit', 'fitness', 'fj', 'fk', 'flights', 'florist', 'flowers', 'flsmidth', 'fly', 'fm', 'fo', 'foo', 'forsale', 'foundation', 'fr', 'frl', 'frogans', 'fund', 'furniture', 'futbol', 'ga', 'gal', 'gallery', 'garden', 'gb', 'gbiz', 'gd', 'ge', 'gent', 'gf', 'gg', 'ggee', 'gh', 'gi', 'gift', 'gifts', 'gives', 'gl', 'glass', 'gle', 'global', 'globo', 'gm', 'gmail', 'gmo', 'gmx', 'gn', 'goog', 'google', 'gop', 'gov', 'gp', 'gq', 'gr', 'graphics', 'gratis', 'green', 'gripe', 'gs', 'gt', 'gu', 'guide', 'guitars', 'guru', 'gw', 'gy', 'hamburg', 'hangout', 'haus', 'healthcare', 'help', 'here', 'hermes', 'hiphop', 'hiv', 'hk', 'hm', 'hn', 'holdings', 'holiday', 'homes', 'horse', 'host', 'hosting', 'house', 'how', 'hr', 'ht', 'hu', 'ibm', 'id', 'ie', 'ifm', 'il', 'im', 'immo', 'immobilien', 'in', 'industries', 'info', 'ing', 'ink', 'institute', 'insure', 'int', 'international', 'investments', 'io', 'iq', 'ir', 'irish', 'is', 'it', 'iwc', 'jcb', 'je', 'jetzt', 'jm', 'jo', 'jobs', 'joburg', 'jp', 'juegos', 'kaufen', 'kddi', 'ke', 'kg', 'kh', 'ki', 'kim', 'kitchen', 'kiwi', 'km', 'kn', 'koeln', 'kp', 'kr', 'krd', 'kred', 'kw', 'ky', 'kyoto', 'kz', 'la', 'lacaixa', 'land', 'lat', 'latrobe', 'lawyer', 'lb', 'lc', 'lds', 'lease', 'legal', 'lgbt', 'li', 'lidl', 'life', 'lighting', 'limited', 'limo', 'link', 'lk', 'loans', 'london', 'lotte', 'lotto', 'lr', 'ls', 'lt', 'ltda', 'lu', 'luxe', 'luxury', 'lv', 'ly', 'ma', 'madrid', 'maison', 'management', 'mango', 'market', 'marketing', 'marriott', 'mc', 'md', 'me', 'media', 'meet', 'melbourne', 'meme', 'memorial', 'menu', 'mg', 'mh', 'miami', 'mil', 'mini', 'mk', 'ml', 'mm', 'mn', 'mo', 'mobi', 'moda', 'moe', 'monash', 'money', 'mormon', 'mortgage', 'moscow', 'motorcycles', 'mov', 'mp', 'mq', 'mr', 'ms', 'mt', 'mu', 'museum', 'mv', 'mw', 'mx', 'my', 'mz', 'na', 'nagoya', 'name', 'navy', 'nc', 'ne', 'net', 'network', 'neustar', 'new', 'nexus', 'nf', 'ng', 'ngo', 'nhk', 'ni', 'nico', 'ninja', 'nl', 'no', 'np', 'nr', 'nra', 'nrw', 'ntt', 'nu', 'nyc', 'nz', 'okinawa', 'om', 'one', 'ong', 'onl', 'ooo', 'org', 'organic', 'osaka', 'otsuka', 'ovh', 'pa', 'paris', 'partners', 'parts', 'party', 'pe', 'pf', 'pg', 'ph', 'pharmacy', 'photo', 'photography', 'photos', 'physio', 'pics', 'pictures', 'pink', 'pizza', 'pk', 'pl', 'place', 'plumbing', 'pm', 'pn', 'pohl', 'poker', 'porn', 'post', 'pr', 'praxi', 'press', 'pro', 'prod', 'productions', 'prof', 'properties', 'property', 'ps', 'pt', 'pub', 'pw', 'py', 'qa', 'qpon', 'quebec', 're', 'realtor', 'recipes', 'red', 'rehab', 'reise', 'reisen', 'reit', 'ren', 'rentals', 'repair', 'report', 'republican', 'rest', 'restaurant', 'reviews', 'rich', 'rio', 'rip', 'ro', 'rocks', 'rodeo', 'rs', 'rsvp', 'ru', 'ruhr', 'rw', 'ryukyu', 'sa', 'saarland', 'sale', 'samsung', 'sarl', 'saxo', 'sb', 'sc', 'sca', 'scb', 'schmidt', 'schule', 'schwarz', 'science', 'scot', 'sd', 'se', 'services', 'sew', 'sexy', 'sg', 'sh', 'shiksha', 'shoes', 'shriram', 'si', 'singles', 'sj', 'sk', 'sky', 'sl', 'sm', 'sn', 'so', 'social', 'software', 'sohu', 'solar', 'solutions', 'soy', 'space', 'spiegel', 'sr', 'st', 'style', 'su', 'supplies', 'supply', 'support', 'surf', 'surgery', 'suzuki', 'sv', 'sx', 'sy', 'sydney', 'systems', 'sz', 'taipei', 'tatar', 'tattoo', 'tax', 'tc', 'td', 'technology', 'tel', 'temasek', 'tennis', 'tf', 'tg', 'th', 'tienda', 'tips', 'tires', 'tirol', 'tj', 'tk', 'tl', 'tm', 'tn', 'to', 'today', 'tokyo', 'tools', 'top', 'toshiba', 'town', 'toys', 'tp', 'tr', 'trade', 'training', 'travel', 'trust', 'tt', 'tui', 'tv', 'tw', 'tz', 'ua', 'ug', 'uk', 'university', 'uno', 'uol', 'us', 'uy', 'uz', 'va', 'vacations', 'vc', 've', 'vegas', 'ventures', 'versicherung', 'vet', 'vg', 'vi', 'viajes', 'video', 'villas', 'vision', 'vlaanderen', 'vn', 'vodka', 'vote', 'voting', 'voto', 'voyage', 'vu', 'wales', 'wang', 'watch', 'webcam', 'website', 'wed', 'wedding', 'wf', 'whoswho', 'wien', 'wiki', 'williamhill', 'wme', 'work', 'works', 'world', 'ws', 'wtc', 'wtf', '佛山', '集团', '在线', '한국', 'ভারত', '八卦', 'موقع', '公益', '公司', '移动', '我爱你', 'москва', 'қаз', 'онлайн', 'сайт', 'срб', '淡马锡', 'орг', '삼성', 'சிங்கப்பூர்', '商标', '商店', '商城', 'дети', 'мкд', '中文网', '中信', '中国', '中國', '谷歌', 'భారత్', 'ලංකා', 'ભારત', 'भारत', '网店', 'संगठन', '网络', 'укр', '香港', '台湾', '台灣', '手机', 'мон', 'الجزائر', 'عمان', 'ایران', 'امارات', 'بازار', 'الاردن', 'بھارت', 'المغرب', 'السعودية', 'مليسيا', 'شبكة', 'გე', '机构', '组织机构', 'ไทย', 'سورية', 'рус', 'рф', 'تونس', 'みんな', 'グーグル', '世界', 'ਭਾਰਤ', '网址', '游戏', 'vermögensberater', 'vermögensberatung', '企业', 'مصر', 'قطر', '广东', 'இலங்கை', 'இந்தியா', '新加坡', 'فلسطين', '政务', 'xxx', 'xyz', 'yachts', 'yandex', 'ye', 'yoga', 'yokohama', 'youtube', 'yt', 'za', 'zip', 'zm', 'zone', 'zuerich', 'zw'];\n\nexport default TLD;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nexport default function checkBrackets(url: string) {\n var urlLength = url.length;\n var urlOpenBrackets = url.split('(').length - 1;\n var urlCloseBrackets = url.split(')').length - 1;\n while(urlCloseBrackets > urlOpenBrackets &&\n url.charAt(urlLength - 1) === ')') {\n url = url.substr(0, urlLength - 1)\n urlCloseBrackets--;\n urlLength--;\n }\n if(urlOpenBrackets > urlCloseBrackets) {\n url = url.replace(/\\)+$/, '');\n }\n return url;\n}\n","import Emoji from '../../config/emoji';\nimport {encodeEmoji} from '../../vendor/emoji';\n\nexport default function getEmojiUnified(emojiCode: string) {\n const unified = encodeEmoji(emojiCode).replace(/-?fe0f/g, '');\n\n /* if(unified === '1f441-200d-1f5e8') {\n //unified = '1f441-fe0f-200d-1f5e8-fe0f';\n unified = '1f441-fe0f-200d-1f5e8';\n } */\n\n if(!Emoji.hasOwnProperty(unified)\n // && !emojiData.hasOwnProperty(unified.replace(/-?fe0f$/, ''))\n ) {\n // console.error('lol', unified);\n return;\n }\n\n return unified;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {EMAIL_REG_EXP, FULL_REG_EXP} from '.';\nimport TLD from '../../config/tld';\nimport {MessageEntity} from '../../layer';\nimport checkBrackets from './checkBrackets';\nimport getEmojiUnified from './getEmojiUnified';\n\nexport default function parseEntities(text: string) {\n let match: RegExpMatchArray;\n let raw = text;\n const entities: MessageEntity[] = [];\n let matchIndex;\n let rawOffset = 0;\n // var start = tsNow()\n FULL_REG_EXP.lastIndex = 0;\n while(match = raw.match(FULL_REG_EXP)) {\n matchIndex = rawOffset + match.index;\n\n // console.log('parseEntities match:', match);\n\n if(match[3]) { // mentions\n entities.push({\n _: 'messageEntityMention',\n offset: matchIndex + match[1].length,\n length: match[2].length + match[3].length\n });\n } else if(match[4]) {\n if(EMAIL_REG_EXP.test(match[4])) { // email\n entities.push({\n _: 'messageEntityEmail',\n offset: matchIndex,\n length: match[4].length\n });\n } else {\n let url: string;\n let protocol = match[5];\n const tld = match[6];\n // let excluded = '';\n if(tld) { // URL\n if(!protocol && (tld.substr(0, 4) === 'xn--' || TLD.indexOf(tld.toLowerCase()) !== -1)) {\n protocol = 'http://';\n }\n\n if(protocol) {\n const balanced = checkBrackets(match[4]);\n if(balanced.length !== match[4].length) {\n // excluded = match[4].substring(balanced.length);\n match[4] = balanced;\n }\n\n url = (match[5] ? '' : protocol) + match[4];\n }\n } else { // IP address\n url = (match[5] ? '' : 'http://') + match[4];\n }\n\n if(url) {\n entities.push({\n _: 'messageEntityUrl',\n offset: matchIndex,\n length: match[4].length\n });\n }\n }\n } else if(match[7]) { // New line\n entities.push({\n _: 'messageEntityLinebreak',\n offset: matchIndex,\n length: 1\n });\n } else if(match[8]) { // Emoji\n const unified = getEmojiUnified(match[8]);\n if(unified) {\n entities.push({\n _: 'messageEntityEmoji',\n offset: matchIndex,\n length: match[8].length,\n unicode: unified\n });\n }\n } else if(match[11]) { // Hashtag\n entities.push({\n _: 'messageEntityHashtag',\n offset: matchIndex + (match[10] ? match[10].length : 0),\n length: match[11].length\n });\n } else if(match[13]) { // Bot command\n entities.push({\n _: 'messageEntityBotCommand',\n offset: matchIndex + (match[11] ? match[11].length : 0) + (match[12] ? match[12].length : 0),\n length: 1 + match[13].length + (match[14] ? 1 + match[14].length : 0),\n unsafe: true\n });\n } else if(match[16]) { // Media timestamp\n const timestamp = match[16];\n const splitted: string[] = timestamp.split(':');\n const splittedLength = splitted.length;\n const hours = splittedLength === 3 ? +splitted[0] : 0;\n const minutes = +splitted[splittedLength === 3 ? 1 : 0];\n const seconds = +splitted[splittedLength - 1];\n entities.push({\n _: 'messageEntityTimestamp',\n offset: matchIndex + (/\\D/.test(match[0][0]) ? 1 : 0),\n length: timestamp.length,\n raw: timestamp,\n time: hours * 3600 + minutes * 60 + seconds\n });\n }\n\n raw = raw.substr(match.index + match[0].length);\n rawOffset += match.index + match[0].length;\n }\n\n // if (entities.length) {\n // console.log('parse entities', text, entities.slice())\n // }\n return entities;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {MARKDOWN_ENTITIES, MARKDOWN_REG_EXP} from '.';\nimport {MessageEntity} from '../../layer';\nimport combineSameEntities from './combineSameEntities';\nimport findConflictingEntity from './findConflictingEntity';\nimport mergeEntities from './mergeEntities';\n\nexport default function parseMarkdown(raw: string, currentEntities: MessageEntity[], noTrim?: boolean): string {\n /* if(!markdownTestRegExp.test(text)) {\n return noTrim ? text : text.trim();\n } */\n\n const entities: MessageEntity[] = [];\n let pushedEntity = false;\n const pushEntity = (entity: MessageEntity) => !findConflictingEntity(currentEntities, entity) ? (entities.push(entity), pushedEntity = true) : pushedEntity = false;\n\n const newTextParts: string[] = [];\n let rawOffset = 0, match;\n while(match = raw.match(MARKDOWN_REG_EXP)) {\n const matchIndex = rawOffset + match.index;\n newTextParts.push(raw.substr(0, match.index));\n const text = (match[3] || match[8] || match[11] || match[13]);\n rawOffset -= text.length;\n // text = text.replace(/^\\s+|\\s+$/g, '');\n rawOffset += text.length;\n\n let entity: MessageEntity;\n pushedEntity = false;\n if(text.match(/^`*$/)) {\n newTextParts.push(match[0]);\n } else if(match[3]) { // pre\n entity = {\n _: 'messageEntityPre',\n language: '',\n offset: matchIndex + match[1].length,\n length: text.length\n };\n\n if(pushEntity(entity)) {\n if(match[5] === '\\n') {\n match[5] = '';\n rawOffset -= 1;\n }\n\n newTextParts.push(match[1] + text + match[5]);\n\n rawOffset -= match[2].length + match[4].length;\n }\n } else if(match[7]) { // code|italic|bold\n const isSOH = match[6] === '\\x01';\n\n entity = {\n _: MARKDOWN_ENTITIES[match[7]] as (MessageEntity.messageEntityBold | MessageEntity.messageEntityCode | MessageEntity.messageEntityItalic | MessageEntity.messageEntitySpoiler)['_'],\n // offset: matchIndex + match[6].length,\n offset: matchIndex + (isSOH ? 0 : match[6].length),\n length: text.length\n };\n\n if(pushEntity(entity)) {\n if(!isSOH) {\n newTextParts.push(match[6] + text + match[9]);\n } else {\n newTextParts.push(text);\n }\n\n rawOffset -= match[7].length * 2 + (isSOH ? 2 : 0);\n }\n } else if(match[11]) { // custom mention\n entity = {\n _: 'messageEntityMentionName',\n user_id: match[10].toUserId(),\n offset: matchIndex,\n length: text.length\n };\n\n if(pushEntity(entity)) {\n newTextParts.push(text);\n\n rawOffset -= match[0].length - text.length;\n }\n } else if(match[12]) { // text url\n entity = {\n _: 'messageEntityTextUrl',\n url: match[14],\n offset: matchIndex,\n length: text.length\n };\n\n if(pushEntity(entity)) {\n newTextParts.push(text);\n\n rawOffset -= match[12].length - text.length;\n }\n }\n\n if(!pushedEntity) {\n newTextParts.push(match[0]);\n }\n\n raw = raw.substr(match.index + match[0].length);\n rawOffset += match.index + match[0].length;\n }\n\n newTextParts.push(raw);\n let newText = newTextParts.join('');\n if(!newText.replace(/\\s+/g, '').length) {\n newText = raw;\n entities.splice(0, entities.length);\n }\n\n // ! idk what it was here for\n // if(!entities.length && !noTrim) {\n // newText = newText.trim();\n // }\n\n mergeEntities(currentEntities, entities);\n combineSameEntities(currentEntities);\n\n let length = newText.length;\n if(!noTrim) {\n // trim left\n newText = newText.replace(/^\\s*/, '');\n\n let diff = length - newText.length;\n if(diff) {\n currentEntities.forEach((entity) => {\n entity.offset = Math.max(0, entity.offset - diff);\n });\n }\n\n // trim right\n newText = newText.replace(/\\s*$/, '');\n diff = length - newText.length;\n length = newText.length;\n if(diff) {\n currentEntities.forEach((entity) => {\n if((entity.offset + entity.length) > length) {\n entity.length = length - entity.offset;\n }\n });\n }\n }\n\n return newText;\n}\n","import {MessageEntity} from '../../layer';\n\nexport default function sortEntities(entities: MessageEntity[]) {\n entities.sort((a, b) => {\n return (a.offset - b.offset) || (b.length - a.length);\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\nimport encodeSpoiler from './encodeSpoiler';\n\n/**\n * ! This function is still unsafe to use with .innerHTML\n */\nexport default function wrapPlainText(text: string, entities: MessageEntity[] = []) {\n entities.forEach((entity) => {\n if(entity._ === 'messageEntitySpoiler') {\n text = encodeSpoiler(text, entity).text;\n }\n });\n\n return text;\n // if(entities?.length) {\n // entities = entities.filter((entity) => entity._ === 'messageEntitySpoiler');\n // }\n\n // return wrapRichText(text, {\n // entities,\n // noEncoding: true,\n // noTextFormat: true,\n // noLinebreaks: true,\n // noLinks: true\n // }).textContent;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {processSearchText, ProcessSearchTextOptions} from '../helpers/cleanSearchText';\nimport flatten from '../helpers/array/flatten';\n\nexport default class SearchIndex {\n private fullTexts: Map = new Map();\n\n // minChars can be 0 because it requires at least one word (one symbol) to be found\n constructor(private options?: ProcessSearchTextOptions, private minChars = 0) {\n }\n\n public indexObject(id: SearchWhat, searchText: string) {\n /* if(searchIndex.fullTexts.hasOwnProperty(id)) {\n return false;\n } */\n\n if(this.options && searchText.trim()) {\n searchText = processSearchText(searchText, this.options);\n }\n\n if(!searchText) {\n this.fullTexts.delete(id);\n return false;\n }\n\n this.fullTexts.set(id, searchText);\n\n /* const shortIndexes = searchIndex.shortIndexes;\n searchText.split(' ').forEach((searchWord) => {\n let len = Math.min(searchWord.length, 3),\n wordPart, i;\n for(i = 1; i <= len; i++) {\n wordPart = searchWord.substr(0, i);\n if(shortIndexes[wordPart] === undefined) {\n shortIndexes[wordPart] = [id];\n } else {\n shortIndexes[wordPart].push(id);\n }\n }\n }); */\n }\n\n private _search(query: string) {\n const newFoundObjs: Array<{fullText: string, fullTextLength: number, what: SearchWhat, foundChars: number}> = [];\n const fullTexts = this.fullTexts;\n const queryWords = query.split(' ');\n const queryWordsLength = queryWords.length;\n fullTexts.forEach((fullText, what) => {\n let found = true;\n let foundChars = 0;\n for(let i = 0; i < queryWordsLength; ++i) { // * verify that all words are found\n const word = queryWords[i];\n const idx = fullText.indexOf(word);\n if(idx === -1 || (idx !== 0 && fullText[idx - 1] !== ' '/* && !badCharsRe.test(fullText[idx - 1]) */)) { // * search only from word beginning\n found = false;\n break;\n }\n\n foundChars += word.length;\n }\n\n if(found) {\n foundChars += queryWordsLength - 1;\n const fullTextLength = fullText.length;\n if(this.minChars <= foundChars || fullTextLength <= foundChars) {\n newFoundObjs.push({fullText, fullTextLength, what, foundChars});\n }\n }\n });\n\n return newFoundObjs;\n }\n\n public search(query: string) {\n if(this.options) {\n query = processSearchText(query, this.options);\n }\n\n const queries = query.split('\\x01');\n const newFoundObjs = flatten(queries.map((query) => this._search(query)));\n\n newFoundObjs.sort((a, b) => a.fullTextLength - b.fullTextLength || b.foundChars - a.foundChars);\n\n // newFoundObjs.sort((a, b) => a.fullText.localeCompare(b.fullText));\n const newFoundObjs2: Set = new Set(newFoundObjs.map((o) => o.what));\n\n return newFoundObjs2;\n }\n}\n"],"names":["IGNORE_ERRORS","Set","LazyLoadQueueBase","constructor","parallelLimit","queueId","queue","inProcess","lockPromise","unlockResolve","log","this","processQueue","_processQueue","clear","length","lock","Promise","resolve","reject","unlock","processItem","item","add","loadItem","err","has","type","error","delete","load","getItem","shift","addElement","method","el","size","push","unshift","filterUnique","arr","flatten","reduce","acc","val","forEachReverse","array","callback","i","insertInDescendSortedArray","element","getProperty","pos","property","sortProperty","undefined","indexOf","prev","next","splice","len","console","assumeType","x","readBlobAs","blob","reader","FileReader","addEventListener","e","target","result","bytesCmp","bytes1","bytes2","bytesFromHex","hexString","bytes","Uint8Array","Math","ceil","start","parseInt","charAt","substr","convertToUint8Array","TextEncoder","encode","callbackify","smth","then","uploadId","getFileNameForUpload","file","fileName","mimeType","ext","split","MIDDLEWARE_ERROR","MiddlewareHelper","details","cleaned","inner","onCleanCallbacks","onDestroyCallbacks","onDestroy","destroyed","clean","forEach","helper","destroy","parent","get","additionalCallback","middleware","create","getMiddleware","onClean","defineNotNumerableProperties","obj","names","props","writable","configurable","out","name","hasOwnProperty","Object","defineProperties","getDeepProperty","object","key","splitted","o","getObjectKeysAndSort","sort","ids","Map","keys","map","a","b","debounce","fn","ms","shouldRunFirst","shouldRunLast","waitingTimeout","waitingPromise","hadNewCall","invoke","args","_resolve","_reject","apply","clearTimeout","_waitingTimeout","catch","isDebounced","SliceEnd","compareValue","val1","val2","toExponential","diff","str1","str2","str1Length","slice","compareLong","SlicedArray","sliceConstructor","getSliceConstructor","first","constructSlice","slices","static","slicedArray","Array","end","None","isEnd","side","Top","last","includes","Bottom","Both","setEnd","getEnds","top","bottom","both","unsetEnd","deleteCount","items","ret","super","idx","insertSlice","lowerBound","upperBound","foundSlice","lowerIndex","upperIndex","foundSliceIndex","sliced","insertIndex","s","prevSlice","nextSlice","findSlice","index","findSliceOffset","maxId","offset","sliceMe","offsetId","add_offset","limit","sliceOffset","sliceStart","max","sliceEnd","topWasMeantToLoad","bottomWasMeantToLoad","abs","topFulfilled","bottomFulfilled","offsetIdOffset","fulfilled","found","deleteSlice","indexOfAndSplice","toJSON","serialized","values","JSON","stringify","json","parsed","parse","inserted","getAttachMenuBotIcon","attachMenuBot","icons","find","icon","getParticipantPeerId","participant","peer","user_id","toPeerId","hasRights","chat","action","rights","isThread","pFlags","deactivated","isCheckingRightsForSelf","creator","_","left","megagroup","admin_rights","banned_rights","default_banned_rights","myFlags","isAdmin","post_messages","broadcast","getDialogIndex","dialog","indexKey","folder_id","getDialogIndexKey","localId","getDocumentDownloadOptions","doc","thumb","onlyCache","inputFileLocation","sticker","mime_type","startsWith","dcId","dc_id","location","file_name","getDocumentInputFileLocation","thumbSize","id","access_hash","file_reference","thumb_size","getDownloadFileNameFromOptions","options","getDownloadMediaDetails","media","downloadOptions","webDocument","getPhotoDownloadOptions","isWebDocument","url","downloadId","draftsAreEqual","draft1","draft2","reply_to_msg_id","entities","message","no_webpage","generateQId","queryId","resultId","generateMessageId","messageId","q","filterMessagesByInputFilter","inputFilter","history","foundMsgs","filtering","neededContents","neededDocTypes","excludeDocTypes","document","goodEntities","totalEntities","getAlbumText","messages","foundMessages","m","getMessageThreadId","isForum","threadId","replyTo","reply_to","forum_topic","mid","reply_to_top_id","getPeerActiveUsernames","usernames","filter","username","active","getPeerPhoto","photo","isPeerRestricted","restrictionReasons","restriction_reason","restricted","photoSize","isDocument","Error","isPhoto","reactionsEqual","r1","r2","getStickerEffectThumb","video_thumbs","canSendToUser","user","deleted","ConnectionStatus","CAN_COMBINE_ENTITIES","combineSameEntities","entity","nextEntityIdx","findIndex","_i","nextEntity","encodeSpoiler","text","before","spoilerAfter","chars","charsLength","char","charCodeAt","join","spoiler","after","entityText","SINGLE_ENTITIES","findConflictingEntity","currentEntities","newEntity","singleEnd","currentEntity","fixEmoji","replace","match","string","matchUrl","mergeEntities","newEntities","filtered","checkBrackets","urlLength","urlOpenBrackets","urlCloseBrackets","getEmojiUnified","emojiCode","unified","parseEntities","raw","matchIndex","rawOffset","E","protocol","tld","toLowerCase","balanced","unicode","unsafe","timestamp","splittedLength","hours","minutes","seconds","test","time","parseMarkdown","noTrim","pushedEntity","pushEntity","newTextParts","language","isSOH","toUserId","newText","sortEntities","wrapPlainText","SearchIndex","minChars","fullTexts","indexObject","searchText","trim","set","_search","query","newFoundObjs","queryWords","queryWordsLength","fullText","what","foundChars","word","fullTextLength","search","queries"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"147.52e5e3f41bb7eb15ae10.chunk.js","mappings":"8IAWA,MACMA,EAAgC,IAAIC,IAAI,CAAC,iBAAkB,kBAAmB,aAAc,qBAOnF,MAAMC,EAWnBC,YAAsBC,EAnBD,GAmBC,KAAAA,cAAAA,EAVf,KAAAC,QAAU,EACP,KAAAC,MAAoC,GACpC,KAAAC,UAAsC,IAAIN,IAE1C,KAAAO,YAA6B,KAC7B,KAAAC,cAA4B,KAE5B,KAAAC,KAAM,QAAO,KAAM,YAI3BC,KAAKC,cAAe,QAAS,IAAMD,KAAKE,iBAAiB,GAAG,EAC9D,CAEOC,QACLH,KAAKJ,UAAUO,QAEfH,KAAKL,MAAMS,OAAS,CAKtB,CAEOC,OACFL,KAAKH,cAGRG,KAAKH,YAAc,IAAIS,SAAQ,CAACC,EAASC,KACvCR,KAAKF,cAAgBS,CAAO,IAQhC,CAEOE,SACDT,KAAKF,gBAETE,KAAKF,gBACLE,KAAKF,cAAgBE,KAAKH,YAAc,KAExCG,KAAKC,eACP,CAEgBS,YA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lDL,CACT,CAEOQ,OAAOT,GACThb,KAAK8R,UACNkJ,GAAQ,QAAkBA,EAAOhb,KAAK8R,UAGxC,MAAM4J,EAAUV,EAAM1V,MAAM,KACtB2V,GAAe,OAAQS,EAAQ1T,KAAKgT,GAAUhb,KAAK+a,QAAQC,MAOjE,OALAC,EAAarT,MAAK,CAACK,EAAGC,IAAMD,EAAEuT,eAAiBtT,EAAEsT,gBAAkBtT,EAAEoT,WAAarT,EAAEqT,aAG7C,IAAIhc,IAAI2b,EAAajT,KAAKN,GAAMA,EAAE2T,OAG3E,E","sources":["webpack://tweb/./src/components/lazyLoadQueueBase.ts","webpack://tweb/./src/config/latinizeMap.ts","webpack://tweb/./src/helpers/array/filterUnique.ts","webpack://tweb/./src/helpers/array/flatten.ts","webpack://tweb/./src/helpers/array/forEachReverse.ts","webpack://tweb/./src/helpers/array/insertInDescendSortedArray.ts","webpack://tweb/./src/helpers/assumeType.ts","webpack://tweb/./src/helpers/blob/readBlobAs.ts","webpack://tweb/./src/helpers/bytes/bytesCmp.ts","webpack://tweb/./src/helpers/bytes/bytesFromHex.ts","webpack://tweb/./src/helpers/bytes/convertToUint8Array.ts","webpack://tweb/./src/helpers/callbackify.ts","webpack://tweb/./src/helpers/getFileNameForUpload.ts","webpack://tweb/./src/helpers/middleware.ts","webpack://tweb/./src/helpers/object/defineNotNumerableProperties.ts","webpack://tweb/./src/helpers/object/getDeepProperty.ts","webpack://tweb/./src/helpers/object/getObjectKeysAndSort.ts","webpack://tweb/./src/helpers/schedulers/debounce.ts","webpack://tweb/./src/helpers/slicedArray.ts","webpack://tweb/./src/helpers/compareValue.ts","webpack://tweb/./src/helpers/long/compareLong.ts","webpack://tweb/./src/lib/appManagers/utils/attachMenuBots/getAttachMenuBotIcon.ts","webpack://tweb/./src/lib/appManagers/utils/chats/getParticipantPeerId.ts","webpack://tweb/./src/lib/appManagers/utils/chats/hasRights.ts","webpack://tweb/./src/lib/appManagers/utils/dialogs/getDialogIndex.ts","webpack://tweb/./src/lib/appManagers/utils/dialogs/getDialogIndexKey.ts","webpack://tweb/./src/lib/appManagers/utils/docs/getDocumentDownloadOptions.ts","webpack://tweb/./src/lib/appManagers/utils/docs/getDocumentInputFileLocation.ts","webpack://tweb/./src/lib/appManagers/utils/download/getDownloadFileNameFromOptions.ts","webpack://tweb/./src/lib/appManagers/utils/download/getDownloadMediaDetails.ts","webpack://tweb/./src/lib/appManagers/utils/webDocs/getWebDocumentDownloadOptions.ts","webpack://tweb/./src/lib/appManagers/utils/drafts/draftsAreEqual.ts","webpack://tweb/./src/lib/appManagers/utils/inlineBots/generateQId.ts","webpack://tweb/./src/lib/appManagers/utils/messageId/generateMessageId.ts","webpack://tweb/./src/lib/appManagers/utils/messages/filterMessagesByInputFilter.ts","webpack://tweb/./src/lib/appManagers/utils/messages/getAlbumText.ts","webpack://tweb/./src/lib/appManagers/utils/messages/getMessageThreadId.ts","webpack://tweb/./src/lib/appManagers/utils/peers/getPeerActiveUsernames.ts","webpack://tweb/./src/lib/appManagers/utils/peers/getPeerPhoto.ts","webpack://tweb/./src/lib/appManagers/utils/peers/isPeerRestricted.ts","webpack://tweb/./src/lib/appManagers/utils/photos/getPhotoDownloadOptions.ts","webpack://tweb/./src/lib/appManagers/utils/reactions/reactionsEqual.ts","webpack://tweb/./src/lib/appManagers/utils/stickers/getStickerEffectThumb.ts","webpack://tweb/./src/lib/appManagers/utils/users/canSendToUser.ts","webpack://tweb/./src/lib/appManagers/utils/webDocs/isWebDocument.ts","webpack://tweb/./src/lib/mtproto/connectionStatus.ts","webpack://tweb/./src/lib/richTextProcessor/combineSameEntities.ts","webpack://tweb/./src/lib/richTextProcessor/encodeSpoiler.ts","webpack://tweb/./src/lib/richTextProcessor/spoiler.ts","webpack://tweb/./src/lib/richTextProcessor/findConflictingEntity.ts","webpack://tweb/./src/lib/richTextProcessor/fixEmoji.ts","webpack://tweb/./src/lib/richTextProcessor/matchUrl.ts","webpack://tweb/./src/lib/richTextProcessor/mergeEntities.ts","webpack://tweb/./src/config/tld.ts","webpack://tweb/./src/lib/richTextProcessor/checkBrackets.ts","webpack://tweb/./src/lib/richTextProcessor/getEmojiUnified.ts","webpack://tweb/./src/lib/richTextProcessor/parseEntities.ts","webpack://tweb/./src/lib/richTextProcessor/parseMarkdown.ts","webpack://tweb/./src/lib/richTextProcessor/sortEntities.ts","webpack://tweb/./src/lib/richTextProcessor/wrapPlainText.ts","webpack://tweb/./src/lib/searchIndex.ts"],"sourcesContent":["/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport indexOfAndSplice from '../helpers/array/indexOfAndSplice';\nimport {Middleware} from '../helpers/middleware';\nimport throttle from '../helpers/schedulers/throttle';\nimport {logger, LogTypes} from '../lib/logger';\n\nconst PARALLEL_LIMIT = 8;\nconst IGNORE_ERRORS: Set = new Set(['NO_ENTRY_FOUND', 'STORAGE_OFFLINE', 'MIDDLEWARE', 'NO_AUTO_DOWNLOAD']);\n\nexport type LazyLoadElementBase = {\n load: () => Promise,\n middleware?: Middleware\n};\n\nexport default class LazyLoadQueueBase {\n public queueId = 0;\n protected queue: Array = [];\n protected inProcess: Set = new Set();\n\n protected lockPromise: Promise = null;\n protected unlockResolve: () => void = null;\n\n protected log = logger('LL', LogTypes.Error);\n protected processQueue: () => void;\n\n constructor(protected parallelLimit = PARALLEL_LIMIT) {\n this.processQueue = throttle(() => this._processQueue(), 8, false);\n }\n\n public clear() {\n this.inProcess.clear(); // ацтеки забьются, будет плохо\n\n this.queue.length = 0;\n // unreachable code\n /* for(let item of this.inProcess) {\n this.lazyLoadMedia.push(item);\n } */\n }\n\n public lock() {\n if(this.lockPromise) return;\n\n // const perf = performance.now();\n this.lockPromise = new Promise((resolve, reject) => {\n this.unlockResolve = resolve;\n });\n\n /* if(DEBUG) {\n this.lockPromise.then(() => {\n this.log('was locked for:', performance.now() - perf);\n });\n } */\n }\n\n public unlock() {\n if(!this.unlockResolve) return;\n\n this.unlockResolve();\n this.unlockResolve = this.lockPromise = null;\n\n this.processQueue();\n }\n\n protected async processItem(item: LazyLoadElementBase) {\n if(this.lockPromise) {\n return;\n }\n\n this.inProcess.add(item);\n\n /* if(DEBUG) {\n this.log('will load media', this.lockPromise, item);\n } */\n\n try {\n // await new Promise((resolve) => setTimeout(resolve, 2e3));\n // await new Promise((resolve, reject) => window.requestAnimationFrame(() => window.requestAnimationFrame(resolve)));\n // await item.load(item.div);\n await this.loadItem(item);\n } catch(err) {\n if(!IGNORE_ERRORS.has((err as ApiError)?.type)) {\n this.log.error('loadMediaQueue error:', err/* , item */);\n }\n }\n\n this.inProcess.delete(item);\n\n /* if(DEBUG) {\n this.log('loaded media', item);\n } */\n\n this.processQueue();\n }\n\n protected loadItem(item: LazyLoadElementBase) {\n return item.load();\n }\n\n protected getItem() {\n return this.queue.shift();\n }\n\n protected addElement(method: 'push' | 'unshift', el: LazyLoadElementBase) {\n this.queue[method](el);\n this.processQueue();\n }\n\n protected _processQueue(item?: LazyLoadElementBase) {\n if(!this.queue.length || this.lockPromise || (this.parallelLimit > 0 && this.inProcess.size >= this.parallelLimit)) return;\n\n // console.log('_processQueue start');\n // let added = 0;\n do {\n if(item) {\n indexOfAndSplice(this.queue, item);\n } else {\n item = this.getItem();\n }\n\n if(item) {\n this.processItem(item);\n } else {\n break;\n }\n\n item = null;\n // ++added;\n } while(this.inProcess.size < this.parallelLimit && this.queue.length);\n // console.log('_processQueue end, added', added, this.queue.length);\n }\n\n public push(el: LazyLoadElementBase) {\n this.addElement('push', el);\n }\n\n public unshift(el: LazyLoadElementBase) {\n this.addElement('unshift', el);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\n//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 'o', 'ᵣ': 'r', 'ᵤ': 'u', 'ᵥ': 'v', 'ₓ': 'x', 'Ё': 'YO', 'Й': 'I', 'Ц': 'TS', 'У': 'U', 'К': 'K', 'Е': 'E', 'Н': 'N', 'Г': 'G', 'Ш': 'SH', 'Щ': 'SCH', 'З': 'Z', 'Х': 'H', 'Ъ': '', 'ё': 'yo', 'й': 'i', 'ц': 'ts', 'у': 'u', 'к': 'k', 'е': 'e', 'н': 'n', 'г': 'g', 'ш': 'sh', 'щ': 'sch', 'з': 'z', 'х': 'h', 'ъ': '', 'Ф': 'F', 'Ы': 'I', 'В': 'V', 'А': 'A', 'П': 'P', 'Р': 'R', 'О': 'O', 'Л': 'L', 'Д': 'D', 'Ж': 'ZH', 'Э': 'E', 'ф': 'f', 'ы': 'i', 'в': 'v', 'а': 'a', 'п': 'p', 'р': 'r', 'о': 'o', 'л': 'l', 'д': 'd', 'ж': 'zh', 'э': 'e', 'Я': 'Ya', 'Ч': 'CH', 'С': 'S', 'М': 'M', 'И': 'I', 'Т': 'T', 'Ь': '', 'Б': 'B', 'Ю': 'YU', 'я': 'ya', 'ч': 'ch', 'с': 's', 'м': 'm', 'и': 'i', 'т': 't', 'ь': '', 'б': 'b', 'ю': 'yu'};\n\nexport default LatinizeMap;\n","export default function filterUnique>(arr: T): T {\n return [...new Set(arr)] as T;\n}\n","export default function flatten(arr: T[][]): T[] {\n return arr.reduce((acc, val) => (acc.push(...val), acc), []);\n}\n","export default function forEachReverse(array: Array, callback: (value: T, index?: number, array?: Array) => void) {\n for(let length = array.length, i = length - 1; i >= 0; --i) {\n callback(array[i], i, array);\n }\n};\n","export default function insertInDescendSortedArray(array: Array, element: T, getProperty: K, pos?: number): number;\nexport default function insertInDescendSortedArray(array: Array, element: T, getProperty: (element: T) => number, pos?: number): number;\nexport default function insertInDescendSortedArray(array: Array, element: T, getProperty: K | ((element: T) => T[K]), pos?: number): number {\n if(typeof(getProperty) !== 'function') {\n const property = getProperty;\n getProperty = (element) => element[property];\n }\n\n const sortProperty: number = getProperty(element);\n\n if(pos === undefined) {\n pos = array.indexOf(element);\n if(pos !== -1) {\n const prev = array[pos - 1];\n const next = array[pos + 1];\n if((!prev || getProperty(prev) >= sortProperty) && (!next || getProperty(next) <= sortProperty)) {\n // console.warn('same pos', pos, sortProperty, prev, next);\n return pos;\n }\n\n array.splice(pos, 1);\n }\n }\n\n const len = array.length;\n if(!len || sortProperty <= getProperty(array[len - 1])) {\n return array.push(element) - 1;\n } else if(sortProperty >= getProperty(array[0])) {\n array.unshift(element);\n return 0;\n } else {\n for(let i = 0; i < len; i++) {\n if(sortProperty > getProperty(array[i])) {\n array.splice(i, 0, element);\n return i;\n }\n }\n }\n\n console.error('wtf', array, element);\n return array.indexOf(element);\n}\n","export default function assumeType(x: unknown): asserts x is T {\n return; // ¯\\_(ツ)_/¯\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import { IS_WEB_WORKER } from \"../context\";\n\n// const id = IS_WEB_WORKER ? Math.random() * 0x1000 | 0 : 0;\nexport default function readBlobAs(blob: Blob, method: 'readAsText'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsDataURL'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsArrayBuffer'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsArrayBuffer' | 'readAsText' | 'readAsDataURL'): Promise {\n // const perf = performance.now();\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.addEventListener('loadend', (e) => {\n // console.log(`readBlobAs [${id}] ${method} time ${performance.now() - perf}`);\n resolve(e.target.result);\n });\n reader[method](blob);\n });\n}\n","export default function bytesCmp(bytes1: number[] | Uint8Array, bytes2: number[] | Uint8Array) {\n const len = bytes1.length;\n if(len !== bytes2.length) {\n return false;\n }\n\n for(let i = 0; i < len; ++i) {\n if(bytes1[i] !== bytes2[i]) {\n return false;\n }\n }\n\n return true;\n}\n","export default function bytesFromHex(hexString: string) {\n const len = hexString.length;\n const bytes = new Uint8Array(Math.ceil(len / 2));\n let start = 0;\n\n if(len % 2) { // read 0x581 as 0x0581\n bytes[start++] = parseInt(hexString.charAt(0), 16);\n }\n\n for(let i = start; i < len; i += 2) {\n bytes[start++] = parseInt(hexString.substr(i, 2), 16);\n }\n\n return bytes;\n}\n","export default function convertToUint8Array(bytes: Uint8Array | ArrayBuffer | number[] | string): Uint8Array {\n if(bytes instanceof Uint8Array) {\n return bytes;\n } else if(typeof(bytes) === 'string') {\n return new TextEncoder().encode(bytes);\n }\n\n return new Uint8Array(bytes);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Awaited} from '../types';\n\nexport default function callbackify, R>(\n smth: T,\n callback: (result: Awaited) => R\n): T extends Promise ? Promise> : R {\n if(smth instanceof Promise) {\n // @ts-ignore\n return smth.then(callback);\n } else {\n return callback(smth as any) as any;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport tabId from '../config/tabId';\n\nlet uploadId = 0;\nexport default function getFileNameForUpload(file: File | Blob) {\n let fileName: string;\n const mimeType = file?.type;\n if(mimeType) { // the same like apiFileName in appMessagesManager for upload!\n const ext = `${tabId}_${uploadId++}.${mimeType.split('/')[1]}`;\n\n if(['image/jpeg', 'image/png', 'image/bmp'].indexOf(mimeType) >= 0) {\n fileName = 'photo' + ext;\n } else if(mimeType.indexOf('audio/') === 0 || ['video/ogg'].indexOf(mimeType) >= 0) {\n fileName = 'audio' + ext;\n } else if(mimeType.indexOf('video/') === 0) {\n fileName = 'video' + ext;\n } else {\n fileName = 'document' + ext;\n }\n } else {\n fileName = `upload-${tabId}_${uploadId++}`;\n }\n\n return fileName;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport indexOfAndSplice from './array/indexOfAndSplice';\nimport makeError from './makeError';\n\nexport type Middleware = {\n (): boolean;\n create(): MiddlewareHelper;\n onClean: (callback: VoidFunction) => void;\n onDestroy: (callback: VoidFunction) => void;\n};\n\nconst createDetails = (): {\n cleaned?: boolean,\n inner: MiddlewareHelper[],\n onCleanCallbacks: VoidFunction[]\n} => ({\n cleaned: false,\n inner: [],\n onCleanCallbacks: []\n});\n\nconst MIDDLEWARE_ERROR = makeError('MIDDLEWARE');\n\n// * onClean == cancel promises, etc\n// * onDestroy == destructor\nexport class MiddlewareHelper {\n private details = createDetails();\n private onDestroyCallbacks: VoidFunction[] = [];\n private parent: MiddlewareHelper;\n private destroyed: boolean;\n\n public clean() {\n const details = this.details;\n details.cleaned = true;\n details.inner.splice(0, details.inner.length).forEach((helper) => helper.destroy());\n details.onCleanCallbacks.splice(0, details.onCleanCallbacks.length).forEach((callback) => callback());\n this.details = createDetails();\n }\n\n public destroy() {\n this.destroyed = true;\n this.clean();\n this.onDestroyCallbacks.splice(0, this.onDestroyCallbacks.length).forEach((callback) => callback());\n\n if(this.parent) {\n indexOfAndSplice(this.parent.details.inner, this);\n this.parent = undefined;\n }\n }\n\n public get(additionalCallback?: () => boolean) {\n const details = this.details;\n\n const middleware: Middleware = () => {\n return !details.cleaned && (!additionalCallback || additionalCallback());\n };\n\n middleware.create = () => {\n if(!middleware()) throw MIDDLEWARE_ERROR;\n const helper = getMiddleware();\n helper.parent = this;\n details.inner.push(helper);\n return helper;\n };\n\n middleware.onClean = (callback) => {\n if(!middleware()) return callback();\n details.onCleanCallbacks.push(callback);\n };\n\n middleware.onDestroy = this.onDestroy;\n\n return middleware;\n }\n\n public onDestroy = (callback: VoidFunction) => {\n if(this.destroyed) return callback();\n this.onDestroyCallbacks.push(callback);\n };\n}\n\n// * will change .cleaned and new instance will be created\nexport function getMiddleware() {\n return new MiddlewareHelper();\n}\n","export default function defineNotNumerableProperties(obj: T, names: (keyof T)[]) {\n // const perf = performance.now();\n const props = {writable: true, configurable: true};\n const out: {[name in keyof T]?: typeof props} = {};\n names.forEach((name) => {\n if(!obj.hasOwnProperty(name)) {\n out[name] = props;\n }\n });\n Object.defineProperties(obj, out);\n // console.log('defineNotNumerableProperties time:', performance.now() - perf);\n}\n","export default function getDeepProperty(object: any, key: string) {\n const splitted = key.split('.');\n let o: any = object;\n splitted.forEach((key) => {\n if(!key) {\n return;\n }\n\n // @ts-ignore\n o = o[key];\n });\n\n return o;\n}\n","export default function getObjectKeysAndSort(object: {[key: string]: any} | Map, sort: 'asc' | 'desc' = 'asc') {\n if(!object) return [];\n const ids = object instanceof Map ? [...object.keys()] : Object.keys(object).map((i) => +i);\n if(sort === 'asc') return ids.sort((a, b) => a - b);\n else return ids.sort((a, b) => b - a);\n}\n","// * Jolly Cobra's schedulers\n\nimport ctx from '../../environment/ctx';\nimport {AnyFunction, Awaited} from '../../types';\nimport noop from '../noop';\n\nexport type DebounceReturnType = {\n (...args: Parameters): Promise>>;\n clearTimeout(): void;\n isDebounced(): boolean;\n};\n\nexport default function debounce(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n shouldRunLast = true\n): DebounceReturnType {\n let waitingTimeout: number;\n let waitingPromise: Promise>>, resolve: (result: any) => void, reject: () => void;\n let hadNewCall = false;\n\n const invoke = (args: Parameters) => {\n const _resolve = resolve, _reject = reject;\n try {\n const result = fn.apply(null, args);\n _resolve(result);\n } catch(err) {\n console.error('debounce error', err);\n // @ts-ignore\n _reject(err);\n }\n };\n\n const debounce = (...args: Parameters) => {\n if(!waitingPromise) waitingPromise = new Promise((_resolve, _reject) => (resolve = _resolve, reject = _reject));\n\n if(waitingTimeout) {\n clearTimeout(waitingTimeout);\n hadNewCall = true;\n reject();\n waitingPromise = new Promise((_resolve, _reject) => (resolve = _resolve, reject = _reject));\n } else if(shouldRunFirst) {\n invoke(args);\n hadNewCall = false;\n }\n\n const _waitingTimeout = ctx.setTimeout(() => {\n // will run if should run last or first but with new call\n if(shouldRunLast && (!shouldRunFirst || hadNewCall)) {\n invoke(args);\n }\n\n // if debounce was called during invoking\n if(waitingTimeout === _waitingTimeout) {\n waitingTimeout = waitingPromise = resolve = reject = undefined;\n hadNewCall = false;\n }\n }, ms);\n\n waitingTimeout = _waitingTimeout;\n waitingPromise.catch(noop);\n return waitingPromise;\n };\n\n debounce.clearTimeout = () => {\n if(waitingTimeout) {\n ctx.clearTimeout(waitingTimeout);\n reject();\n waitingTimeout = waitingPromise = resolve = reject = undefined;\n hadNewCall = false;\n }\n };\n\n debounce.isDebounced = () => !!waitingTimeout;\n\n return debounce;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport indexOfAndSplice from './array/indexOfAndSplice';\nimport compareValue from './compareValue';\n\n/**\n * Descend sorted storage\n */\n\ntype ItemType = number | string;\n\nexport enum SliceEnd {\n None = 0,\n Top = 1,\n Bottom = 2,\n Both = SliceEnd.Top | SliceEnd.Bottom\n};\n\nexport interface Slice extends Array {\n // slicedArray: SlicedArray;\n end: SliceEnd;\n\n isEnd: (side: SliceEnd) => boolean;\n setEnd: (side: SliceEnd) => void;\n unsetEnd: (side: SliceEnd) => void;\n getEnds: () => {top: boolean, bottom: boolean, both: boolean};\n\n slice: (from?: number, to?: number) => Slice;\n splice: (start: number, deleteCount: number, ...items: ItemType[]) => Slice;\n}\n\nexport interface SliceConstructor {\n // new(...items: T[]): Slice;\n new(length: number): Slice;\n}\n\nexport type SliceSerialized = {\n values: Slice,\n isEnd: {\n top: boolean,\n bottom: boolean,\n both: boolean\n }\n};\n\nexport type SlicedArraySerialized = {\n slices: SliceSerialized[]\n};\n\nexport default class SlicedArray {\n private slices: Slice[]/* = [[7,6,5],[4,3,2],[1,0,-1]] */;\n private sliceConstructor: SliceConstructor;\n\n constructor() {\n // @ts-ignore\n this.sliceConstructor = SlicedArray.getSliceConstructor(this);\n\n const first = this.constructSlice();\n // first.setEnd(SliceEnd.Bottom);\n this.slices = [first];\n }\n\n private static getSliceConstructor(slicedArray: SlicedArray) {\n return class Slice extends Array implements Slice {\n // slicedArray: SlicedArray;\n end: SliceEnd = SliceEnd.None;\n\n /* constructor(...items: ItemType[]) {\n super(...items);\n //this.slicedArray = slicedArray;\n } */\n\n isEnd(side: SliceEnd): boolean {\n if((this.end & side) === side) {\n return true;\n }/* else if(!this.slicedArray) {\n return false;\n } */\n\n let isEnd = false;\n if(side === SliceEnd.Top) {\n const slice = slicedArray.last;\n isEnd = slice.end & side ? this.includes(slice[slice.length - 1])/* || !slice.length */ : false;\n } else if(side === SliceEnd.Bottom) {\n const slice = slicedArray.first;\n isEnd = slice.end & side ? this.includes(slice[0])/* || !slice.length */ : false;\n } else if(side === SliceEnd.Both) {\n return this.isEnd(SliceEnd.Top) && this.isEnd(SliceEnd.Bottom);\n }\n\n if(isEnd) {\n this.setEnd(side);\n }\n\n return isEnd;\n }\n\n getEnds() {\n return {\n top: this.isEnd(SliceEnd.Top),\n bottom: this.isEnd(SliceEnd.Bottom),\n both: this.isEnd(SliceEnd.Both)\n };\n }\n\n setEnd(side: SliceEnd) {\n this.end |= side;\n }\n\n unsetEnd(side: SliceEnd) {\n this.end &= ~side;\n }\n\n splice(start: number, deleteCount: number, ...items: ItemType[]) {\n const ret = super.splice(start, deleteCount, ...items);\n\n if(!this.length) {\n const slices = slicedArray.slices as ItemType[][];\n const idx = slices.indexOf(this);\n if(idx !== -1) {\n if(slices.length === 1) { // left empty slice without ends\n this.unsetEnd(SliceEnd.Both);\n } else { // delete this slice\n slices.splice(idx, 1);\n }\n }\n }\n\n return ret;\n }\n }\n }\n\n public constructSlice(...items: T[]) {\n // const slice = new Slice(this, ...items);\n // can't pass items directly to constructor because first argument is length\n const slice = new this.sliceConstructor(items.length);\n for(let i = 0, length = items.length; i < length; ++i) {\n slice[i] = items[i];\n }\n return slice;\n\n // ! code below will slow execution in 15 times\n /* const self = this;\n const p: Slice = new Proxy(slice, {\n get: function(target, name: any) {\n if(name === 'constructor') {\n const p = new Proxy(Slice, {\n construct: (target, args) => {\n return self.constructSlice(...args);\n }\n });\n\n return p;\n }\n\n return target[name];\n }\n });\n\n return p; */\n\n /*\n var p = slicedArray.constructSlice();\n p.length = 100000;\n p.fill(255);\n\n var a = new Array(100000);\n a.fill(255);\n\n var b = 0;\n var perf = performance.now();\n for(var i = 0; i < p.length; ++i) {\n b += p[i];\n }\n\n console.log('perf 1', performance.now() - perf);\n\n b = 0;\n perf = performance.now();\n for(var i = 0; i < a.length; ++i) {\n b += a[i];\n }\n\n console.log('perf 2', performance.now() - perf);\n */\n }\n\n public insertSlice(slice: T[], flatten = true) {\n if(!slice.length) {\n return;\n }\n\n const first = this.slices[0];\n if(!first.length) {\n first.push(...slice);\n return first;\n }\n\n const lowerBound = slice[slice.length - 1];\n const upperBound = slice[0];\n\n let foundSlice: Slice, lowerIndex = -1, upperIndex = -1, foundSliceIndex = 0;\n for(; foundSliceIndex < this.slices.length; ++foundSliceIndex) {\n foundSlice = this.slices[foundSliceIndex];\n lowerIndex = foundSlice.indexOf(lowerBound);\n upperIndex = foundSlice.indexOf(upperBound);\n\n if(upperIndex !== -1 && -1 !== lowerIndex) {\n break;\n } else if(upperIndex !== -1 || -1 !== lowerIndex) {\n break;\n }\n }\n\n if(upperIndex !== -1 && -1 !== lowerIndex) {\n\n } else if(upperIndex !== -1) { // ([1, 2, 3] | [1, 2, 3, 4, 5]) -> [1, 2, 3, 4, 5]\n const sliced = slice.slice(foundSlice.length - upperIndex);\n foundSlice.push(...sliced);\n } else if(lowerIndex !== -1) { // ([1, 2, 3] | [-1, 0, 1]) -> [-1, 0, 1, 2, 3]\n const sliced = slice.slice(0, slice.length - lowerIndex - 1);\n foundSlice.unshift(...sliced);\n } else {\n let insertIndex = 0;\n for(const length = this.slices.length; insertIndex < length; ++insertIndex) { // * maybe should iterate from the end, could be faster ?\n const s = this.slices[insertIndex];\n if(compareValue(slice[0], s[0]) === 1) {\n break;\n }\n }\n\n this.slices.splice(insertIndex, 0, this.constructSlice(...slice));\n foundSliceIndex = insertIndex;\n }\n\n if(flatten) {\n return this.flatten(foundSliceIndex);\n }\n }\n\n private flatten(foundSliceIndex: number) {\n if(this.slices.length >= 2) {\n for(let i = 0, length = this.slices.length; i < (length - 1); ++i) {\n const prevSlice = this.slices[i];\n const nextSlice = this.slices[i + 1];\n\n const upperIndex = prevSlice.indexOf(nextSlice[0]);\n if(upperIndex !== -1) {\n prevSlice.setEnd(nextSlice.end);\n this.slices.splice(i + 1, 1);\n\n if(i < foundSliceIndex) {\n --foundSliceIndex;\n }\n\n --length; // respect array bounds\n --i; // repeat from the same place\n\n this.insertSlice(nextSlice, false);\n }\n }\n }\n\n return this.slices[foundSliceIndex];\n }\n\n // *\n\n get first() {\n return this.slices[0];\n }\n\n get last() {\n return this.slices[this.slices.length - 1];\n }\n\n get slice() {\n return this.first;\n }\n\n get length() {\n return this.slice.length;\n }\n\n public findSlice(item: T) {\n for(let i = 0, length = this.slices.length; i < length; ++i) {\n const slice = this.slices[i];\n const index = slice.indexOf(item);\n if(index !== -1) {\n return {slice, index};\n }\n }\n\n return undefined;\n }\n\n public findSliceOffset(maxId: T) {\n let slice: Slice;\n for(let i = 0; i < this.slices.length; ++i) {\n let offset = 0;\n slice = this.slices[i];\n if(slice.length < 2) {\n continue;\n }\n\n for(; offset < slice.length; ++offset) {\n if(compareValue(maxId, slice[offset]) >= 0) {\n /* if(!offset) { // because can't find 3 in [[5,4], [2,1]]\n return undefined;\n } */\n\n return {\n slice,\n offset: maxId === slice[offset] ? offset : offset - 1\n };\n }\n }\n }\n\n if(slice && slice.isEnd(SliceEnd.Top)) {\n return {\n slice,\n offset: slice.length\n };\n }\n\n return undefined;\n }\n\n // * https://core.telegram.org/api/offsets\n public sliceMe(offsetId: T, add_offset: number, limit: number) {\n let slice = this.slice;\n let offset = 0;\n let sliceOffset = 0;\n\n if(offsetId) {\n const pos = this.findSliceOffset(offsetId);\n if(!pos) {\n return undefined;\n }\n\n slice = pos.slice;\n offset = sliceOffset = pos.offset;\n\n if(slice.includes(offsetId)) {\n sliceOffset += 1;\n }\n\n /* if(slice.includes(offsetId) && add_offset < 0) {\n add_offset += 1;\n } */\n }\n\n const sliceStart = Math.max(sliceOffset + add_offset, 0);\n const sliceEnd = sliceOffset + add_offset + limit;\n // const fixHalfBackLimit = add_offset && !(limit / add_offset % 2) && (sliceEnd % 2) ? 1 : 0;\n // sliceEnd += fixHalfBackLimit;\n\n const sliced = slice.slice(sliceStart, sliceEnd) as Slice;\n\n const topWasMeantToLoad = add_offset < 0 ? limit + add_offset : limit;\n const bottomWasMeantToLoad = Math.abs(add_offset);\n\n // can use 'slice' here to check because if it's end, then 'sliced' is out of 'slice'\n // useful when there is only 1 message in chat on its reopening\n const topFulfilled = (slice.length - sliceOffset) >= topWasMeantToLoad || (slice.isEnd(SliceEnd.Top) ? (sliced.setEnd(SliceEnd.Top), true) : false);\n const bottomFulfilled = (sliceOffset - bottomWasMeantToLoad) >= 0 || (slice.isEnd(SliceEnd.Bottom) ? (sliced.setEnd(SliceEnd.Bottom), true) : false);\n\n // if(topFulfilled) sliced.isEnd(SliceEnd.Top);\n // if(bottomFulfilled) sliced.isEnd(SliceEnd.Bottom);\n\n return {\n slice: sliced,\n offsetIdOffset: offset,\n fulfilled: SliceEnd.None | (topFulfilled && bottomFulfilled ? SliceEnd.Both : ((topFulfilled ? SliceEnd.Top : SliceEnd.None) | (bottomFulfilled ? SliceEnd.Bottom : SliceEnd.None)))\n };\n }\n\n public unshift(...items: T[]) {\n let slice = this.first;\n if(!slice.length) {\n slice.setEnd(SliceEnd.Bottom);\n } else if(!slice.isEnd(SliceEnd.Bottom)) {\n slice = this.constructSlice();\n slice.setEnd(SliceEnd.Bottom);\n this.slices.unshift(slice);\n }\n\n slice.unshift(...items);\n }\n\n public push(...items: T[]) {\n let slice = this.last;\n if(!slice.length) {\n slice.setEnd(SliceEnd.Top);\n } else if(!slice.isEnd(SliceEnd.Top)) {\n slice = this.constructSlice();\n slice.setEnd(SliceEnd.Top);\n this.slices.push(slice);\n }\n\n slice.push(...items);\n }\n\n public delete(item: T) {\n const found = this.findSlice(item);\n if(found) {\n found.slice.splice(found.index, 1);\n return true;\n }\n\n return false;\n }\n\n public deleteSlice(slice: Slice) {\n indexOfAndSplice(this.slices, slice);\n }\n\n public toJSON() {\n const slices: SlicedArraySerialized['slices'] = this.slices.map((slice) => {\n return {\n values: slice.slice(),\n isEnd: slice.getEnds()\n };\n });\n\n const serialized: SlicedArraySerialized = {\n slices\n };\n\n return JSON.stringify(serialized);\n }\n\n public static fromJSON(json: string) {\n const parsed: SlicedArraySerialized = JSON.parse(json);\n const sliced = new SlicedArray();\n parsed.slices.forEach((slice) => {\n const inserted = sliced.insertSlice(slice.values) || sliced.first;\n if(slice.isEnd.top) inserted.setEnd(SliceEnd.Top);\n if(slice.isEnd.bottom) inserted.setEnd(SliceEnd.Bottom);\n });\n\n return sliced;\n }\n}\n\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.SlicedArray = SlicedArray);\n","import compareLong from './long/compareLong';\n\nexport default function compareValue(val1: string | number, val2: typeof val1) {\n if((val1 as number).toExponential) {\n const diff = (val1 as number) - (val2 as number);\n return diff < 0 ? -1 : (diff > 0 ? 1 : 0);\n }\n\n return compareLong(val1 as string, val2 as string);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function compareLong(str1: string, str2: string) {\n const str1Length = str1.length;\n if(str1Length !== str2.length) {\n const diff = str1Length - str2.length;\n return diff < 0 ? -1 : (diff > 0 ? 1 : 0);\n }\n\n const maxPartLength = 15;\n for(let i = 0; i < str1Length; i += maxPartLength) {\n const v1 = +str1.slice(i, i + maxPartLength);\n const v2 = +str2.slice(i, i + maxPartLength);\n const diff = v1 - v2;\n if(diff) {\n return diff;\n }\n }\n\n return 0;\n}\n","import {AttachMenuBot} from '../../../../layer';\nimport {ATTACH_MENU_BOT_ICON_NAME} from '../../../mtproto/mtproto_config';\n\nexport default function getAttachMenuBotIcon(attachMenuBot: AttachMenuBot) {\n return attachMenuBot.icons.find((icon) => icon.name === ATTACH_MENU_BOT_ICON_NAME);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {ChannelParticipant, ChatParticipant} from '../../../../layer';\nimport getPeerId from '../peers/getPeerId';\n\nexport default function getParticipantPeerId(participant: ChannelParticipant | ChatParticipant): PeerId {\n const peerId = (participant as ChannelParticipant.channelParticipantBanned).peer ?\n getPeerId((participant as ChannelParticipant.channelParticipantBanned).peer) :\n (participant as ChatParticipant.chatParticipant).user_id.toPeerId();\n return peerId;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Chat, ChatAdminRights, ChatBannedRights} from '../../../../layer';\nimport {ChatRights} from '../../appChatsManager';\n\n/**\n * Check the user's ability to do an action in chat\n * @param id\n * @param action creator can still send messages to left channel. so this function shows server rights. see canSendToPeer for local rights in messages manager.\n * @param rights do not provide this parameter when checking rights for self\n * @param isThread\n * @returns\n */\nexport default function hasRights(chat: Exclude, action: ChatRights, rights?: ChatAdminRights | ChatBannedRights, isThread?: boolean) {\n if(!chat) return false;\n\n if((chat as Chat.chat).pFlags.deactivated && action !== 'view_messages') {\n return false;\n }\n\n const isCheckingRightsForSelf = rights === undefined;\n if((chat as Chat.chat).pFlags.creator && isCheckingRightsForSelf) {\n return true;\n }\n\n if(chat._ === 'chatForbidden' ||\n chat._ === 'channelForbidden' ||\n // (chat as any).pFlags.kicked ||\n (chat.pFlags.left && !(chat as Chat.channel).pFlags.megagroup)) {\n return false;\n }\n\n // const adminRights = chat.admin_rights;\n // const bannedRights = (chat as Chat.channel).banned_rights || chat.default_banned_rights;\n\n if(!rights) {\n rights = chat.admin_rights || (chat as Chat.channel).banned_rights || chat.default_banned_rights;\n\n if(!rights) {\n return false;\n }\n }\n\n let myFlags: Partial<{[flag in keyof ChatBannedRights['pFlags'] | keyof ChatAdminRights['pFlags']]: true}> = {};\n if(rights) {\n myFlags = rights.pFlags as any;\n }\n\n // const adminFlags = adminRights?.pFlags || {};\n // const bannedFlags = bannedRights?.pFlags || {};\n\n const isAdmin = rights._ === 'chatAdminRights';\n\n switch(action) {\n case 'embed_links':\n case 'send_games':\n case 'send_gifs':\n case 'send_inline':\n case 'send_media':\n case 'send_messages':\n case 'send_polls':\n case 'send_stickers':\n case 'send_photos':\n case 'send_videos':\n case 'send_roundvideos':\n case 'send_audios':\n case 'send_voices':\n case 'send_docs':\n case 'send_plain': {\n if(!isThread && chat.pFlags.left) {\n return false;\n }\n\n if(rights._ === 'chatBannedRights' && myFlags[action]) {\n return false;\n }\n\n if(chat._ === 'channel') {\n if(!chat.pFlags.megagroup && !myFlags.post_messages) {\n return false;\n }\n }\n\n break;\n }\n\n // * revoke foreign messages\n case 'delete_messages':\n case 'manage_call': {\n return !!myFlags[action];\n }\n\n case 'pin_messages': {\n return isAdmin ? myFlags[action] || !!myFlags.post_messages : !myFlags[action];\n }\n\n // case 'change_info': {\n // return adminRights || isCheckingRightsForSelf ? adminFlags[action] : !myFlags[action];\n // }\n\n case 'change_info':\n case 'invite_users': {\n return isAdmin ? !!myFlags[action] : !myFlags[action];\n }\n\n // * only creator can do that\n case 'change_type':\n case 'delete_chat': {\n return false;\n }\n\n case 'edit_messages':\n case 'manage_topics': {\n return isAdmin && !!myFlags[action];\n }\n\n case 'ban_users':\n case 'change_permissions': {\n return isAdmin && !!myFlags['ban_users'];\n }\n\n case 'view_participants': {\n return !!(chat._ === 'chat' || !chat.pFlags.broadcast || chat.pFlags.creator || chat.admin_rights);\n }\n }\n\n return true;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Dialog, ForumTopic} from '../../../../layer';\nimport type {REAL_FOLDER_ID} from '../../../mtproto/mtproto_config';\nimport getDialogIndexKey from './getDialogIndexKey';\n\nexport default function getDialogIndex(\n dialog: Dialog.dialog | ForumTopic.forumTopic,\n indexKey: ReturnType = getDialogIndexKey((dialog as Dialog).folder_id as REAL_FOLDER_ID)\n) {\n return dialog?.[indexKey as 'index_0'];\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {DialogFilter} from '../../../../layer';\n\nexport default function getDialogIndexKey(localId: DialogFilter.dialogFilter['localId'] = 0) {\n return `index_${localId}` as const;\n // return filterId !== undefined && filterId > 1 ? `filter_${filterId}` as const : 'main' as const;\n // const indexStr = filterId > 1 ?\n // `index_${filterId}` as const :\n // 'index' as const;\n\n // return indexStr;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Document, PhotoSize, VideoSize} from '../../../../layer';\nimport type {DownloadOptions} from '../../../mtproto/apiFileManager';\nimport getDocumentInputFileLocation from './getDocumentInputFileLocation';\n\nexport default function getDocumentDownloadOptions(\n doc: Document.document,\n thumb?: PhotoSize.photoSize | Extract,\n queueId?: number,\n onlyCache?: boolean\n): DownloadOptions {\n const inputFileLocation = getDocumentInputFileLocation(doc, thumb?.type);\n\n let mimeType: MTMimeType;\n if(thumb?._ === 'photoSize') {\n mimeType = doc.sticker ? 'image/webp' : (doc.mime_type.startsWith('image/') ? doc.mime_type : 'image/jpeg');\n } else {\n mimeType = doc.mime_type || 'application/octet-stream';\n }\n\n return {\n dcId: doc.dc_id,\n location: inputFileLocation,\n size: thumb ? thumb.size : doc.size,\n mimeType,\n fileName: doc.file_name,\n queueId,\n onlyCache\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Document, InputFileLocation} from '../../../../layer';\n\nexport default function getDocumentInputFileLocation(doc: Document.document, thumbSize?: string): InputFileLocation.inputDocumentFileLocation {\n return {\n _: 'inputDocumentFileLocation',\n id: doc.id,\n access_hash: doc.access_hash,\n file_reference: doc.file_reference,\n thumb_size: thumbSize\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {getFileNameByLocation} from '../../../../helpers/fileName';\nimport {DownloadOptions} from '../../../mtproto/apiFileManager';\n\nexport default function getDownloadFileNameFromOptions(options: DownloadOptions) {\n return getFileNameByLocation(options.location, options);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {DownloadMediaOptions, DownloadOptions} from '../../../mtproto/apiFileManager';\nimport getDocumentDownloadOptions from '../docs/getDocumentDownloadOptions';\nimport getPhotoDownloadOptions from '../photos/getPhotoDownloadOptions';\nimport getWebDocumentDownloadOptions from '../webDocs/getWebDocumentDownloadOptions';\nimport isWebDocument from '../webDocs/isWebDocument';\nimport getDownloadFileNameFromOptions from './getDownloadFileNameFromOptions';\n\nexport default function getDownloadMediaDetails(options: DownloadMediaOptions) {\n const {media, thumb, queueId, onlyCache} = options;\n\n let downloadOptions: DownloadOptions;\n if(media._ === 'document') downloadOptions = getDocumentDownloadOptions(media, thumb as any, queueId, onlyCache);\n else if(media._ === 'photo') downloadOptions = getPhotoDownloadOptions(media, thumb as any, queueId, onlyCache);\n else if(isWebDocument(media)) downloadOptions = getWebDocumentDownloadOptions(media);\n\n downloadOptions.downloadId = options.downloadId;\n\n const fileName = getDownloadFileNameFromOptions(downloadOptions);\n return {fileName, downloadOptions};\n}\n","import {WebDocument} from '../../../../layer';\nimport {DownloadOptions} from '../../../mtproto/apiFileManager';\n\nexport default function getWebDocumentDownloadOptions(webDocument: WebDocument): DownloadOptions {\n return {\n dcId: 0,\n location: {\n _: 'inputWebFileLocation',\n access_hash: (webDocument as WebDocument.webDocument).access_hash,\n url: webDocument.url\n },\n size: webDocument.size,\n mimeType: webDocument.mime_type\n };\n}\n","import deepEqual from '../../../../helpers/object/deepEqual';\nimport isObject from '../../../../helpers/object/isObject';\nimport {DraftMessage} from '../../../../layer';\n\nexport default function draftsAreEqual(draft1: DraftMessage, draft2: DraftMessage) {\n if(typeof(draft1) !== typeof(draft2)) {\n return false;\n }\n\n if(!isObject(draft1)) {\n return true;\n }\n\n if(draft1._ !== draft2._) {\n return false;\n }\n\n if(draft1._ === 'draftMessage' && draft2._ === draft1._) {\n if(draft1.reply_to_msg_id !== draft2.reply_to_msg_id) {\n return false;\n }\n\n if(!deepEqual(draft1.entities, draft2.entities)) {\n return false;\n }\n\n if(draft1.message !== draft2.message) {\n return false;\n }\n\n if(draft1.pFlags.no_webpage !== draft2.pFlags.no_webpage) {\n return false;\n }\n }\n\n return true;\n}\n","import {MessagesBotResults} from '../../../../layer';\n\nexport default function generateQId(queryId: MessagesBotResults.messagesBotResults['query_id'], resultId: string) {\n return queryId + '_' + resultId;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MESSAGE_ID_OFFSET, MESSAGE_ID_INCREMENT} from '.';\n\nexport default function generateMessageId(messageId: number) {\n const q = MESSAGE_ID_OFFSET;\n if(messageId >= q) {\n return messageId;\n }\n\n return q + (messageId * MESSAGE_ID_INCREMENT);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Message, MessageMedia, MessageEntity, MessageAction} from '../../../../layer';\nimport matchUrl from '../../../richTextProcessor/matchUrl';\nimport type {MyDocument} from '../../appDocsManager';\nimport type {MyInputMessagesFilter, MyMessage} from '../../appMessagesManager';\n\nexport default function filterMessagesByInputFilter(inputFilter: MyInputMessagesFilter, history: Array, limit: number) {\n if(inputFilter === 'inputMessagesFilterEmpty') {\n return history;\n }\n\n const foundMsgs: MyMessage[] = [];\n if(!history.length) {\n return foundMsgs;\n }\n\n let filtering = true;\n const neededContents: Partial<{\n [messageMediaType in MessageMedia['_']]: boolean\n }> & Partial<{\n avatar: boolean,\n url: boolean\n }> = {},\n neededDocTypes: MyDocument['type'][] = [],\n excludeDocTypes: MyDocument['type'][] = []/* ,\n neededFlags: string[] = [] */;\n\n switch(inputFilter) {\n case 'inputMessagesFilterPhotos':\n neededContents['messageMediaPhoto'] = true;\n break;\n\n case 'inputMessagesFilterPhotoVideo':\n neededContents['messageMediaPhoto'] = true;\n neededContents['messageMediaDocument'] = true;\n neededDocTypes.push('video');\n break;\n\n case 'inputMessagesFilterVideo':\n neededContents['messageMediaDocument'] = true;\n neededDocTypes.push('video');\n break;\n\n case 'inputMessagesFilterDocument':\n neededContents['messageMediaDocument'] = true;\n // excludeDocTypes.push('video');\n neededDocTypes.push(undefined, 'photo', 'pdf');\n break;\n\n case 'inputMessagesFilterVoice':\n neededContents['messageMediaDocument'] = true;\n neededDocTypes.push('voice');\n break;\n\n case 'inputMessagesFilterRoundVoice':\n neededContents['messageMediaDocument'] = true;\n neededDocTypes.push('round', 'voice');\n break;\n\n case 'inputMessagesFilterRoundVideo':\n neededContents['messageMediaDocument'] = true;\n neededDocTypes.push('round');\n break;\n\n case 'inputMessagesFilterMusic':\n neededContents['messageMediaDocument'] = true;\n neededDocTypes.push('audio');\n break;\n\n case 'inputMessagesFilterUrl':\n neededContents['url'] = true;\n break;\n\n case 'inputMessagesFilterChatPhotos':\n neededContents['avatar'] = true;\n break;\n\n /* case 'inputMessagesFilterPinned':\n neededFlags.push('pinned');\n break; */\n\n /* case 'inputMessagesFilterMyMentions':\n neededContents['mentioned'] = true;\n break; */\n\n default:\n filtering = false;\n break;\n /* return Promise.resolve({\n count: 0,\n next_rate: 0,\n history: [] as number[]\n }); */\n }\n\n if(!filtering) {\n return foundMsgs;\n }\n\n for(let i = 0, length = history.length; i < length; ++i) {\n const message: Message.message | Message.messageService = history[i];\n if(!message) continue;\n\n // || (neededContents['mentioned'] && message.totalEntities.find((e: any) => e._ === 'messageEntityMention'));\n\n let found = false;\n if(message._ === 'message') {\n if(message.media && neededContents[message.media._]/* && !message.fwd_from */) {\n const doc = (message.media as MessageMedia.messageMediaDocument).document as MyDocument;\n if(doc &&\n (\n (neededDocTypes.length && !neededDocTypes.includes(doc.type)) ||\n excludeDocTypes.includes(doc.type)\n )\n ) {\n continue;\n }\n\n found = true;\n } else if(neededContents['url'] && message.message) {\n const goodEntities = ['messageEntityTextUrl', 'messageEntityUrl'];\n if((message.totalEntities as MessageEntity[]).find((e) => goodEntities.includes(e._)) || matchUrl(message.message)) {\n found = true;\n }\n }\n } else if(neededContents['avatar'] &&\n message.action &&\n ([\n 'messageActionChannelEditPhoto' as const,\n 'messageActionChatEditPhoto' as const,\n 'messageActionChannelEditVideo' as const,\n 'messageActionChatEditVideo' as const\n ] as MessageAction['_'][]).includes(message.action._)) {\n found = true;\n }/* else if(neededFlags.find((flag) => message.pFlags[flag])) {\n found = true;\n } */\n\n if(found) {\n foundMsgs.push(message);\n if(foundMsgs.length >= limit) {\n break;\n }\n }\n }\n\n return foundMsgs;\n}\n","import assumeType from '../../../../helpers/assumeType';\nimport {Message} from '../../../../layer';\n\nexport default function getAlbumText(messages: Message.message[]) {\n let foundMessages = 0, message: Message.message;\n for(const m of messages) {\n assumeType(m);\n if(m.message) {\n if(++foundMessages > 1) break;\n message = m;\n }\n }\n\n if(foundMessages > 1) {\n message = undefined;\n }\n\n return message;\n}\n","import {Message} from '../../../../layer';\nimport {GENERAL_TOPIC_ID} from '../../../mtproto/mtproto_config';\n\nexport default function getMessageThreadId(message: Message.message | Message.messageService, isForum?: boolean) {\n let threadId: number;\n const replyTo = message.reply_to;\n if(replyTo && (!isForum || replyTo.pFlags.forum_topic)) {\n threadId = replyTo.reply_to_top_id || replyTo.reply_to_msg_id;\n } else if(isForum) {\n if(message._ === 'messageService' && message.action?._ === 'messageActionTopicCreate') {\n threadId = message.mid;\n } else {\n threadId = GENERAL_TOPIC_ID;\n }\n }\n\n return threadId;\n}\n","import {Chat, User} from '../../../../layer';\n\nexport default function getPeerActiveUsernames(peer: User | Chat) {\n if(!peer) {\n return [];\n }\n\n const usernames = (peer as Chat.channel).usernames;\n if(usernames) {\n return usernames\n .filter((username) => username.pFlags.active)\n // .sort((a, b) => +!!b.pFlags.editable - +!!a.pFlags.editable)\n .map((username) => username.username);\n }\n\n return (peer as Chat.channel).username ? [(peer as Chat.channel).username] : [];\n}\n","import {Chat, ChatPhoto, User, UserProfilePhoto} from '../../../../layer';\nimport isPeerRestricted from './isPeerRestricted';\n\nexport default function getPeerPhoto(peer: User | Chat) {\n if(!peer || isPeerRestricted(peer)) {\n return;\n }\n\n return (peer as User.user | Chat.channel)?.photo as UserProfilePhoto.userProfilePhoto | ChatPhoto.chatPhoto;\n}\n","import {isRestricted} from '../../../../helpers/restrictions';\nimport {Chat, User} from '../../../../layer';\n\nexport default function isPeerRestricted(peer: Chat | User) {\n const restrictionReasons = (peer as Chat.channel)?.restriction_reason;\n return !!(restrictionReasons && (peer as Chat.channel).pFlags.restricted && isRestricted(restrictionReasons));\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {PhotoSize, InputFileLocation} from '../../../../layer';\nimport type {DownloadOptions} from '../../../mtproto/apiFileManager';\nimport type {MyDocument} from '../../appDocsManager';\nimport type {MyPhoto} from '../../appPhotosManager';\n\nexport default function getPhotoDownloadOptions(photo: MyPhoto | MyDocument, photoSize: PhotoSize, queueId?: number, onlyCache?: boolean): DownloadOptions {\n const isDocument = photo._ === 'document';\n\n if(!photoSize || photoSize._ === 'photoSizeEmpty') {\n // console.error('no photoSize by photo:', photo);\n throw new Error('photoSizeEmpty!');\n }\n\n // maybe it's a thumb\n const isPhoto = !!((photoSize._ === 'photoSize' || photoSize._ === 'photoSizeProgressive') && photo.access_hash && photo.file_reference);\n const location: InputFileLocation.inputPhotoFileLocation | InputFileLocation.inputDocumentFileLocation = {\n _: isDocument ? 'inputDocumentFileLocation' : 'inputPhotoFileLocation',\n id: photo.id,\n access_hash: photo.access_hash,\n file_reference: photo.file_reference,\n thumb_size: photoSize.type\n };\n\n return {\n dcId: photo.dc_id,\n location,\n size: isPhoto ? (photoSize as PhotoSize.photoSize).size : undefined,\n mimeType: 'image/jpeg',\n queueId,\n onlyCache\n };\n}\n","import deepEqual from '../../../../helpers/object/deepEqual';\nimport {Reaction} from '../../../../layer';\n\nexport default function reactionsEqual(r1: Reaction, r2: Reaction) {\n return deepEqual(r1, r2);\n}\n","import {MyDocument} from '../../appDocsManager';\nimport {VideoSize} from '../../../../layer';\n\nexport default function getStickerEffectThumb(doc: MyDocument) {\n return doc.video_thumbs?.[0] as Extract;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {User} from '../../../../layer';\nimport {REPLIES_PEER_ID} from '../../../mtproto/mtproto_config';\n\nexport default function canSendToUser(user: User.user) {\n return !!(user && !user.pFlags.deleted && user.id.toPeerId() !== REPLIES_PEER_ID);\n}\n","import {WebDocument} from '../../../../layer';\n\nexport default function isWebDocument(webDocument: any): webDocument is WebDocument {\n return !!(webDocument && (webDocument._ === 'webDocument' || webDocument._ === 'webDocumentNoProxy'));\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport enum ConnectionStatus {\n Connected,\n Connecting,\n Closed,\n TimedOut\n};\n\nexport type ConnectionStatusChange = {\n _: 'networkerStatus',\n status: ConnectionStatus,\n dcId: number,\n name: string,\n isFileNetworker: boolean,\n isFileDownload: boolean,\n isFileUpload: boolean,\n retryAt?: number\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\n\nconst CAN_COMBINE_ENTITIES: Set = new Set([\n 'messageEntityBold',\n 'messageEntityItalic',\n 'messageEntityCode',\n 'messageEntityPre',\n 'messageEntityUnderline',\n 'messageEntityStrike',\n 'messageEntityBlockquote',\n 'messageEntitySpoiler'\n]);\nexport default function combineSameEntities(entities: MessageEntity[]) {\n // entities = entities.slice();\n for(let i = 0; i < entities.length; ++i) {\n const entity = entities[i];\n\n let nextEntityIdx = -1;\n do {\n nextEntityIdx = entities.findIndex((e, _i) => {\n return CAN_COMBINE_ENTITIES.has(e._) && _i !== i && e._ === entity._ && (e.offset - entity.length) === entity.offset;\n });\n\n if(nextEntityIdx !== -1) {\n const nextEntity = entities[nextEntityIdx];\n entity.length += nextEntity.length;\n entities.splice(nextEntityIdx, 1);\n }\n } while(nextEntityIdx !== -1);\n }\n // return entities;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\nimport spoiler from './spoiler';\n\nexport default function encodeSpoiler(text: string, entity: MessageEntity.messageEntitySpoiler) {\n const before = text.slice(0, entity.offset);\n const spoilerBefore = text.slice(entity.offset, entity.offset + entity.length);\n const spoilerAfter = spoiler(spoilerBefore)/* '▚'.repeat(entity.length) */;\n const after = text.slice(entity.offset + entity.length);\n text = before + spoilerAfter + after;\n return {text, entityText: spoilerAfter};\n};\n","export default function spoiler(text: string): string {\n const chars = '⠁⠂⠄⠈⠐⠠⡀⢀⠃⠅⠆⠉⠊⠌⠑⠒⠔⠘⠡⠢⠤⠨⠰⡁⡂⡄⡈⡐⡠⢁⢂⢄⢈⢐⢠⣀⠇⠋⠍⠎⠓⠕⠖⠙⠚⠜⠣⠥⠦⠩⠪⠬⠱⠲⠴⠸⡃⡅⡆⡉⡊⡌⡑⡒⡔⡘⡡⡢⡤⡨⡰⢃⢅⢆⢉⢊⢌⢑⢒⢔⢘⢡⢢⢤⢨⢰⣁⣂⣄⣈⣐⣠⠏⠗⠛⠝⠞⠧⠫⠭⠮⠳⠵⠶⠹⠺⠼⡇⡋⡍⡎⡓⡕⡖⡙⡚⡜⡣⡥⡦⡩⡪⡬⡱⡲⡴⡸⢇⢋⢍⢎⢓⢕⢖⢙⢚⢜⢣⢥⢦⢩⢪⢬⢱⢲⢴⢸⣃⣅⣆⣉⣊⣌⣑⣒⣔⣘⣡⣢⣤⣨⣰⠟⠯⠷⠻⠽⠾⡏⡗⡛⡝⡞⡧⡫⡭⡮⡳⡵⡶⡹⡺⡼⢏⢗⢛⢝⢞⢧⢫⢭⢮⢳⢵⢶⢹⢺⢼⣇⣋⣍⣎⣓⣕⣖⣙⣚⣜⣣⣥⣦⣩⣪⣬⣱⣲⣴⣸⠿⡟⡯⡷⡻⡽⡾⢟⢯⢷⢻⢽⢾⣏⣗⣛⣝⣞⣧⣫⣭⣮⣳⣵⣶⣹⣺⣼⡿⢿⣟⣯⣷⣻⣽⣾⣿';\n const charsLength = chars.length;\n\n const out: string[] = [];\n for(let i = 0; i < text.length; ++i) {\n const char = text.charCodeAt(i);\n out.push(chars[char % charsLength]);\n }\n\n return out.join('');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MARKDOWN_ENTITIES_TYPES, PASS_CONFLICTING_ENTITIES} from '.';\nimport {MessageEntity} from '../../layer';\n\nconst SINGLE_ENTITIES: Set = new Set(['messageEntityPre', 'messageEntityCode']);\n\nexport default function findConflictingEntity(currentEntities: MessageEntity[], newEntity: MessageEntity) {\n let singleEnd = -1;\n return currentEntities.find((currentEntity) => {\n if(SINGLE_ENTITIES.has(currentEntity._)) {\n singleEnd = currentEntity.offset + currentEntity.length;\n }\n\n if(newEntity.offset < singleEnd && MARKDOWN_ENTITIES_TYPES.has(newEntity._)) {\n return true;\n }\n\n const isConflictingTypes = newEntity._ === currentEntity._ ||\n (!PASS_CONFLICTING_ENTITIES.has(newEntity._) && !PASS_CONFLICTING_ENTITIES.has(currentEntity._));\n\n if(!isConflictingTypes) {\n return false;\n }\n\n const isConflictingOffset = newEntity.offset >= currentEntity.offset &&\n (newEntity.length + newEntity.offset) <= (currentEntity.length + currentEntity.offset);\n\n return isConflictingOffset;\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\n\nexport default function fixEmoji(text: string, entities?: MessageEntity[]) {\n /* if(!IS_EMOJI_SUPPORTED) {\n return text;\n } */\n // '$`\\ufe0f'\n\n text = text.replace(/[\\u2640\\u2642\\u2764](?!\\ufe0f)/g, (match, offset, string) => {\n if(entities) {\n const length = match.length;\n\n offset += length;\n entities.forEach((entity) => {\n const end = entity.offset + entity.length;\n if(end === offset) { // current entity\n entity.length += length;\n } else if(end > offset) {\n entity.offset += length;\n }\n });\n }\n\n // console.log([match, offset, string]);\n return match + '\\ufe0f';\n });\n\n return text;\n}\n","import {URL_REG_EXP} from '.';\n\nexport default function matchUrl(text: string) {\n return !text ? null : text.match(URL_REG_EXP);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\nimport findConflictingEntity from './findConflictingEntity';\nimport sortEntities from './sortEntities';\n\nexport default function mergeEntities(currentEntities: MessageEntity[], newEntities: MessageEntity[]) {\n const filtered = newEntities.filter((e) => {\n return !findConflictingEntity(currentEntities, e);\n });\n\n currentEntities.push(...filtered);\n sortEntities(currentEntities);\n // currentEntities.sort((a, b) => a.offset - b.offset);\n // currentEntities.sort((a, b) => (a.offset - b.offset) || (a._ === 'messageEntityCaret' && -1));\n\n // * fix splitted emoji. messageEntityTextUrl can split the emoji if starts before its end (e.g. on fe0f)\n // * have to fix even if emoji supported since it's being wrapped in span\n // if(!IS_EMOJI_SUPPORTED) {\n for(let i = 0; i < currentEntities.length; ++i) {\n const entity = currentEntities[i];\n if(entity._ === 'messageEntityEmoji') {\n const nextEntity = currentEntities[i + 1];\n if(nextEntity /* && nextEntity._ !== 'messageEntityCaret' */ && nextEntity.offset < (entity.offset + entity.length)) {\n entity.length = nextEntity.offset - entity.offset;\n }\n }\n }\n // }\n\n return currentEntities;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\n// From https://github.com/stephenmathieson/node-tlds/blob/master/index.js\nconst TLD = ['abogado', 'ac', 'academy', 'accountants', 'active', 'actor', 'ad', 'adult', 'ae', 'aero', 'af', 'ag', 'agency', 'ai', 'airforce', 'al', 'allfinanz', 'alsace', 'am', 'amsterdam', 'an', 'android', 'ao', 'apartments', 'aq', 'aquarelle', 'ar', 'archi', 'army', 'arpa', 'as', 'asia', 'associates', 'at', 'attorney', 'au', 'auction', 'audio', 'autos', 'aw', 'ax', 'axa', 'az', 'ba', 'band', 'bank', 'bar', 'barclaycard', 'barclays', 'bargains', 'bayern', 'bb', 'bd', 'be', 'beer', 'berlin', 'best', 'bf', 'bg', 'bh', 'bi', 'bid', 'bike', 'bingo', 'bio', 'biz', 'bj', 'black', 'blackfriday', 'bloomberg', 'blue', 'bm', 'bmw', 'bn', 'bnpparibas', 'bo', 'boo', 'boutique', 'br', 'brussels', 'bs', 'bt', 'budapest', 'build', 'builders', 'business', 'buzz', 'bv', 'bw', 'by', 'bz', 'bzh', 'ca', 'cab', 'cal', 'camera', 'camp', 'cancerresearch', 'canon', 'capetown', 'capital', 'caravan', 'cards', 'care', 'career', 'careers', 'cartier', 'casa', 'cash', 'cat', 'catering', 'cc', 'cd', 'center', 'ceo', 'cern', 'cf', 'cg', 'ch', 'channel', 'chat', 'cheap', 'christmas', 'chrome', 'church', 'ci', 'citic', 'city', 'ck', 'cl', 'claims', 'cleaning', 'click', 'clinic', 'clothing', 'club', 'cm', 'cn', 'co', 'coach', 'codes', 'coffee', 'college', 'cologne', 'com', 'community', 'company', 'computer', 'condos', 'construction', 'consulting', 'contractors', 'cooking', 'cool', 'coop', 'country', 'cr', 'credit', 'creditcard', 'cricket', 'crs', 'cruises', 'cu', 'cuisinella', 'cv', 'cw', 'cx', 'cy', 'cymru', 'cz', 'dabur', 'dad', 'dance', 'dating', 'day', 'dclk', 'de', 'deals', 'degree', 'delivery', 'democrat', 'dental', 'dentist', 'desi', 'design', 'dev', 'diamonds', 'diet', 'digital', 'direct', 'directory', 'discount', 'dj', 'dk', 'dm', 'dnp', 'do', 'docs', 'domains', 'doosan', 'durban', 'dvag', 'dz', 'eat', 'ec', 'edu', 'education', 'ee', 'eg', 'email', 'emerck', 'energy', 'engineer', 'engineering', 'enterprises', 'equipment', 'er', 'es', 'esq', 'estate', 'et', 'eu', 'eurovision', 'eus', 'events', 'everbank', 'exchange', 'expert', 'exposed', 'fail', 'farm', 'fashion', 'feedback', 'fi', 'finance', 'financial', 'firmdale', 'fish', 'fishing', 'fit', 'fitness', 'fj', 'fk', 'flights', 'florist', 'flowers', 'flsmidth', 'fly', 'fm', 'fo', 'foo', 'forsale', 'foundation', 'fr', 'frl', 'frogans', 'fund', 'furniture', 'futbol', 'ga', 'gal', 'gallery', 'garden', 'gb', 'gbiz', 'gd', 'ge', 'gent', 'gf', 'gg', 'ggee', 'gh', 'gi', 'gift', 'gifts', 'gives', 'gl', 'glass', 'gle', 'global', 'globo', 'gm', 'gmail', 'gmo', 'gmx', 'gn', 'goog', 'google', 'gop', 'gov', 'gp', 'gq', 'gr', 'graphics', 'gratis', 'green', 'gripe', 'gs', 'gt', 'gu', 'guide', 'guitars', 'guru', 'gw', 'gy', 'hamburg', 'hangout', 'haus', 'healthcare', 'help', 'here', 'hermes', 'hiphop', 'hiv', 'hk', 'hm', 'hn', 'holdings', 'holiday', 'homes', 'horse', 'host', 'hosting', 'house', 'how', 'hr', 'ht', 'hu', 'ibm', 'id', 'ie', 'ifm', 'il', 'im', 'immo', 'immobilien', 'in', 'industries', 'info', 'ing', 'ink', 'institute', 'insure', 'int', 'international', 'investments', 'io', 'iq', 'ir', 'irish', 'is', 'it', 'iwc', 'jcb', 'je', 'jetzt', 'jm', 'jo', 'jobs', 'joburg', 'jp', 'juegos', 'kaufen', 'kddi', 'ke', 'kg', 'kh', 'ki', 'kim', 'kitchen', 'kiwi', 'km', 'kn', 'koeln', 'kp', 'kr', 'krd', 'kred', 'kw', 'ky', 'kyoto', 'kz', 'la', 'lacaixa', 'land', 'lat', 'latrobe', 'lawyer', 'lb', 'lc', 'lds', 'lease', 'legal', 'lgbt', 'li', 'lidl', 'life', 'lighting', 'limited', 'limo', 'link', 'lk', 'loans', 'london', 'lotte', 'lotto', 'lr', 'ls', 'lt', 'ltda', 'lu', 'luxe', 'luxury', 'lv', 'ly', 'ma', 'madrid', 'maison', 'management', 'mango', 'market', 'marketing', 'marriott', 'mc', 'md', 'me', 'media', 'meet', 'melbourne', 'meme', 'memorial', 'menu', 'mg', 'mh', 'miami', 'mil', 'mini', 'mk', 'ml', 'mm', 'mn', 'mo', 'mobi', 'moda', 'moe', 'monash', 'money', 'mormon', 'mortgage', 'moscow', 'motorcycles', 'mov', 'mp', 'mq', 'mr', 'ms', 'mt', 'mu', 'museum', 'mv', 'mw', 'mx', 'my', 'mz', 'na', 'nagoya', 'name', 'navy', 'nc', 'ne', 'net', 'network', 'neustar', 'new', 'nexus', 'nf', 'ng', 'ngo', 'nhk', 'ni', 'nico', 'ninja', 'nl', 'no', 'np', 'nr', 'nra', 'nrw', 'ntt', 'nu', 'nyc', 'nz', 'okinawa', 'om', 'one', 'ong', 'onl', 'ooo', 'org', 'organic', 'osaka', 'otsuka', 'ovh', 'pa', 'paris', 'partners', 'parts', 'party', 'pe', 'pf', 'pg', 'ph', 'pharmacy', 'photo', 'photography', 'photos', 'physio', 'pics', 'pictures', 'pink', 'pizza', 'pk', 'pl', 'place', 'plumbing', 'pm', 'pn', 'pohl', 'poker', 'porn', 'post', 'pr', 'praxi', 'press', 'pro', 'prod', 'productions', 'prof', 'properties', 'property', 'ps', 'pt', 'pub', 'pw', 'py', 'qa', 'qpon', 'quebec', 're', 'realtor', 'recipes', 'red', 'rehab', 'reise', 'reisen', 'reit', 'ren', 'rentals', 'repair', 'report', 'republican', 'rest', 'restaurant', 'reviews', 'rich', 'rio', 'rip', 'ro', 'rocks', 'rodeo', 'rs', 'rsvp', 'ru', 'ruhr', 'rw', 'ryukyu', 'sa', 'saarland', 'sale', 'samsung', 'sarl', 'saxo', 'sb', 'sc', 'sca', 'scb', 'schmidt', 'schule', 'schwarz', 'science', 'scot', 'sd', 'se', 'services', 'sew', 'sexy', 'sg', 'sh', 'shiksha', 'shoes', 'shriram', 'si', 'singles', 'sj', 'sk', 'sky', 'sl', 'sm', 'sn', 'so', 'social', 'software', 'sohu', 'solar', 'solutions', 'soy', 'space', 'spiegel', 'sr', 'st', 'style', 'su', 'supplies', 'supply', 'support', 'surf', 'surgery', 'suzuki', 'sv', 'sx', 'sy', 'sydney', 'systems', 'sz', 'taipei', 'tatar', 'tattoo', 'tax', 'tc', 'td', 'technology', 'tel', 'temasek', 'tennis', 'tf', 'tg', 'th', 'tienda', 'tips', 'tires', 'tirol', 'tj', 'tk', 'tl', 'tm', 'tn', 'to', 'today', 'tokyo', 'tools', 'top', 'toshiba', 'town', 'toys', 'tp', 'tr', 'trade', 'training', 'travel', 'trust', 'tt', 'tui', 'tv', 'tw', 'tz', 'ua', 'ug', 'uk', 'university', 'uno', 'uol', 'us', 'uy', 'uz', 'va', 'vacations', 'vc', 've', 'vegas', 'ventures', 'versicherung', 'vet', 'vg', 'vi', 'viajes', 'video', 'villas', 'vision', 'vlaanderen', 'vn', 'vodka', 'vote', 'voting', 'voto', 'voyage', 'vu', 'wales', 'wang', 'watch', 'webcam', 'website', 'wed', 'wedding', 'wf', 'whoswho', 'wien', 'wiki', 'williamhill', 'wme', 'work', 'works', 'world', 'ws', 'wtc', 'wtf', '佛山', '集团', '在线', '한국', 'ভারত', '八卦', 'موقع', '公益', '公司', '移动', '我爱你', 'москва', 'қаз', 'онлайн', 'сайт', 'срб', '淡马锡', 'орг', '삼성', 'சிங்கப்பூர்', '商标', '商店', '商城', 'дети', 'мкд', '中文网', '中信', '中国', '中國', '谷歌', 'భారత్', 'ලංකා', 'ભારત', 'भारत', '网店', 'संगठन', '网络', 'укр', '香港', '台湾', '台灣', '手机', 'мон', 'الجزائر', 'عمان', 'ایران', 'امارات', 'بازار', 'الاردن', 'بھارت', 'المغرب', 'السعودية', 'مليسيا', 'شبكة', 'გე', '机构', '组织机构', 'ไทย', 'سورية', 'рус', 'рф', 'تونس', 'みんな', 'グーグル', '世界', 'ਭਾਰਤ', '网址', '游戏', 'vermögensberater', 'vermögensberatung', '企业', 'مصر', 'قطر', '广东', 'இலங்கை', 'இந்தியா', '新加坡', 'فلسطين', '政务', 'xxx', 'xyz', 'yachts', 'yandex', 'ye', 'yoga', 'yokohama', 'youtube', 'yt', 'za', 'zip', 'zm', 'zone', 'zuerich', 'zw'];\n\nexport default TLD;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nexport default function checkBrackets(url: string) {\n var urlLength = url.length;\n var urlOpenBrackets = url.split('(').length - 1;\n var urlCloseBrackets = url.split(')').length - 1;\n while(urlCloseBrackets > urlOpenBrackets &&\n url.charAt(urlLength - 1) === ')') {\n url = url.substr(0, urlLength - 1)\n urlCloseBrackets--;\n urlLength--;\n }\n if(urlOpenBrackets > urlCloseBrackets) {\n url = url.replace(/\\)+$/, '');\n }\n return url;\n}\n","import Emoji from '../../config/emoji';\nimport {encodeEmoji} from '../../vendor/emoji';\n\nexport default function getEmojiUnified(emojiCode: string) {\n const unified = encodeEmoji(emojiCode).replace(/-?fe0f/g, '');\n\n /* if(unified === '1f441-200d-1f5e8') {\n //unified = '1f441-fe0f-200d-1f5e8-fe0f';\n unified = '1f441-fe0f-200d-1f5e8';\n } */\n\n if(!Emoji.hasOwnProperty(unified)\n // && !emojiData.hasOwnProperty(unified.replace(/-?fe0f$/, ''))\n ) {\n // console.error('lol', unified);\n return;\n }\n\n return unified;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {EMAIL_REG_EXP, FULL_REG_EXP} from '.';\nimport TLD from '../../config/tld';\nimport {MessageEntity} from '../../layer';\nimport checkBrackets from './checkBrackets';\nimport getEmojiUnified from './getEmojiUnified';\n\nexport default function parseEntities(text: string) {\n let match: RegExpMatchArray;\n let raw = text;\n const entities: MessageEntity[] = [];\n let matchIndex;\n let rawOffset = 0;\n // var start = tsNow()\n FULL_REG_EXP.lastIndex = 0;\n while(match = raw.match(FULL_REG_EXP)) {\n matchIndex = rawOffset + match.index;\n\n // console.log('parseEntities match:', match);\n\n if(match[3]) { // mentions\n entities.push({\n _: 'messageEntityMention',\n offset: matchIndex + match[1].length,\n length: match[2].length + match[3].length\n });\n } else if(match[4]) {\n if(EMAIL_REG_EXP.test(match[4])) { // email\n entities.push({\n _: 'messageEntityEmail',\n offset: matchIndex,\n length: match[4].length\n });\n } else {\n let url: string;\n let protocol = match[5];\n const tld = match[6];\n // let excluded = '';\n if(tld) { // URL\n if(!protocol && (tld.substr(0, 4) === 'xn--' || TLD.indexOf(tld.toLowerCase()) !== -1)) {\n protocol = 'http://';\n }\n\n if(protocol) {\n const balanced = checkBrackets(match[4]);\n if(balanced.length !== match[4].length) {\n // excluded = match[4].substring(balanced.length);\n match[4] = balanced;\n }\n\n url = (match[5] ? '' : protocol) + match[4];\n }\n } else { // IP address\n url = (match[5] ? '' : 'http://') + match[4];\n }\n\n if(url) {\n entities.push({\n _: 'messageEntityUrl',\n offset: matchIndex,\n length: match[4].length\n });\n }\n }\n } else if(match[7]) { // New line\n entities.push({\n _: 'messageEntityLinebreak',\n offset: matchIndex,\n length: 1\n });\n } else if(match[8]) { // Emoji\n const unified = getEmojiUnified(match[8]);\n if(unified) {\n entities.push({\n _: 'messageEntityEmoji',\n offset: matchIndex,\n length: match[8].length,\n unicode: unified\n });\n }\n } else if(match[11]) { // Hashtag\n entities.push({\n _: 'messageEntityHashtag',\n offset: matchIndex + (match[10] ? match[10].length : 0),\n length: match[11].length\n });\n } else if(match[13]) { // Bot command\n entities.push({\n _: 'messageEntityBotCommand',\n offset: matchIndex + (match[11] ? match[11].length : 0) + (match[12] ? match[12].length : 0),\n length: 1 + match[13].length + (match[14] ? 1 + match[14].length : 0),\n unsafe: true\n });\n } else if(match[16]) { // Media timestamp\n const timestamp = match[16];\n const splitted: string[] = timestamp.split(':');\n const splittedLength = splitted.length;\n const hours = splittedLength === 3 ? +splitted[0] : 0;\n const minutes = +splitted[splittedLength === 3 ? 1 : 0];\n const seconds = +splitted[splittedLength - 1];\n entities.push({\n _: 'messageEntityTimestamp',\n offset: matchIndex + (/\\D/.test(match[0][0]) ? 1 : 0),\n length: timestamp.length,\n raw: timestamp,\n time: hours * 3600 + minutes * 60 + seconds\n });\n }\n\n raw = raw.substr(match.index + match[0].length);\n rawOffset += match.index + match[0].length;\n }\n\n // if (entities.length) {\n // console.log('parse entities', text, entities.slice())\n // }\n return entities;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {MARKDOWN_ENTITIES, MARKDOWN_REG_EXP} from '.';\nimport {MessageEntity} from '../../layer';\nimport combineSameEntities from './combineSameEntities';\nimport findConflictingEntity from './findConflictingEntity';\nimport mergeEntities from './mergeEntities';\n\nexport default function parseMarkdown(raw: string, currentEntities: MessageEntity[], noTrim?: boolean): string {\n /* if(!markdownTestRegExp.test(text)) {\n return noTrim ? text : text.trim();\n } */\n\n const entities: MessageEntity[] = [];\n let pushedEntity = false;\n const pushEntity = (entity: MessageEntity) => !findConflictingEntity(currentEntities, entity) ? (entities.push(entity), pushedEntity = true) : pushedEntity = false;\n\n const newTextParts: string[] = [];\n let rawOffset = 0, match;\n while(match = raw.match(MARKDOWN_REG_EXP)) {\n const matchIndex = rawOffset + match.index;\n newTextParts.push(raw.substr(0, match.index));\n const text = (match[3] || match[8] || match[11] || match[13]);\n rawOffset -= text.length;\n // text = text.replace(/^\\s+|\\s+$/g, '');\n rawOffset += text.length;\n\n let entity: MessageEntity;\n pushedEntity = false;\n if(text.match(/^`*$/)) {\n newTextParts.push(match[0]);\n } else if(match[3]) { // pre\n entity = {\n _: 'messageEntityPre',\n language: '',\n offset: matchIndex + match[1].length,\n length: text.length\n };\n\n if(pushEntity(entity)) {\n if(match[5] === '\\n') {\n match[5] = '';\n rawOffset -= 1;\n }\n\n newTextParts.push(match[1] + text + match[5]);\n\n rawOffset -= match[2].length + match[4].length;\n }\n } else if(match[7]) { // code|italic|bold\n const isSOH = match[6] === '\\x01';\n\n entity = {\n _: MARKDOWN_ENTITIES[match[7]] as (MessageEntity.messageEntityBold | MessageEntity.messageEntityCode | MessageEntity.messageEntityItalic | MessageEntity.messageEntitySpoiler)['_'],\n // offset: matchIndex + match[6].length,\n offset: matchIndex + (isSOH ? 0 : match[6].length),\n length: text.length\n };\n\n if(pushEntity(entity)) {\n if(!isSOH) {\n newTextParts.push(match[6] + text + match[9]);\n } else {\n newTextParts.push(text);\n }\n\n rawOffset -= match[7].length * 2 + (isSOH ? 2 : 0);\n }\n } else if(match[11]) { // custom mention\n entity = {\n _: 'messageEntityMentionName',\n user_id: match[10].toUserId(),\n offset: matchIndex,\n length: text.length\n };\n\n if(pushEntity(entity)) {\n newTextParts.push(text);\n\n rawOffset -= match[0].length - text.length;\n }\n } else if(match[12]) { // text url\n entity = {\n _: 'messageEntityTextUrl',\n url: match[14],\n offset: matchIndex,\n length: text.length\n };\n\n if(pushEntity(entity)) {\n newTextParts.push(text);\n\n rawOffset -= match[12].length - text.length;\n }\n }\n\n if(!pushedEntity) {\n newTextParts.push(match[0]);\n }\n\n raw = raw.substr(match.index + match[0].length);\n rawOffset += match.index + match[0].length;\n }\n\n newTextParts.push(raw);\n let newText = newTextParts.join('');\n if(!newText.replace(/\\s+/g, '').length) {\n newText = raw;\n entities.splice(0, entities.length);\n }\n\n // ! idk what it was here for\n // if(!entities.length && !noTrim) {\n // newText = newText.trim();\n // }\n\n mergeEntities(currentEntities, entities);\n combineSameEntities(currentEntities);\n\n let length = newText.length;\n if(!noTrim) {\n // trim left\n newText = newText.replace(/^\\s*/, '');\n\n let diff = length - newText.length;\n if(diff) {\n currentEntities.forEach((entity) => {\n entity.offset = Math.max(0, entity.offset - diff);\n });\n }\n\n // trim right\n newText = newText.replace(/\\s*$/, '');\n diff = length - newText.length;\n length = newText.length;\n if(diff) {\n currentEntities.forEach((entity) => {\n if((entity.offset + entity.length) > length) {\n entity.length = length - entity.offset;\n }\n });\n }\n }\n\n return newText;\n}\n","import {MessageEntity} from '../../layer';\n\nexport default function sortEntities(entities: MessageEntity[]) {\n entities.sort((a, b) => {\n return (a.offset - b.offset) || (b.length - a.length);\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\nimport encodeSpoiler from './encodeSpoiler';\n\n/**\n * ! This function is still unsafe to use with .innerHTML\n */\nexport default function wrapPlainText(text: string, entities: MessageEntity[] = []) {\n entities.forEach((entity) => {\n if(entity._ === 'messageEntitySpoiler') {\n text = encodeSpoiler(text, entity).text;\n }\n });\n\n return text;\n // if(entities?.length) {\n // entities = entities.filter((entity) => entity._ === 'messageEntitySpoiler');\n // }\n\n // return wrapRichText(text, {\n // entities,\n // noEncoding: true,\n // noTextFormat: true,\n // noLinebreaks: true,\n // noLinks: true\n // }).textContent;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {processSearchText, ProcessSearchTextOptions} from '../helpers/cleanSearchText';\nimport flatten from '../helpers/array/flatten';\n\nexport default class SearchIndex {\n private fullTexts: Map = new Map();\n\n // minChars can be 0 because it requires at least one word (one symbol) to be found\n constructor(private options?: ProcessSearchTextOptions, private minChars = 0) {\n }\n\n public indexObject(id: SearchWhat, searchText: string) {\n /* if(searchIndex.fullTexts.hasOwnProperty(id)) {\n return false;\n } */\n\n if(this.options && searchText.trim()) {\n searchText = processSearchText(searchText, this.options);\n }\n\n if(!searchText) {\n this.fullTexts.delete(id);\n return false;\n }\n\n this.fullTexts.set(id, searchText);\n\n /* const shortIndexes = searchIndex.shortIndexes;\n searchText.split(' ').forEach((searchWord) => {\n let len = Math.min(searchWord.length, 3),\n wordPart, i;\n for(i = 1; i <= len; i++) {\n wordPart = searchWord.substr(0, i);\n if(shortIndexes[wordPart] === undefined) {\n shortIndexes[wordPart] = [id];\n } else {\n shortIndexes[wordPart].push(id);\n }\n }\n }); */\n }\n\n private _search(query: string) {\n const newFoundObjs: Array<{fullText: string, fullTextLength: number, what: SearchWhat, foundChars: number}> = [];\n const fullTexts = this.fullTexts;\n const queryWords = query.split(' ');\n const queryWordsLength = queryWords.length;\n fullTexts.forEach((fullText, what) => {\n let found = true;\n let foundChars = 0;\n for(let i = 0; i < queryWordsLength; ++i) { // * verify that all words are found\n const word = queryWords[i];\n const idx = fullText.indexOf(word);\n if(idx === -1 || (idx !== 0 && fullText[idx - 1] !== ' '/* && !badCharsRe.test(fullText[idx - 1]) */)) { // * search only from word beginning\n found = false;\n break;\n }\n\n foundChars += word.length;\n }\n\n if(found) {\n foundChars += queryWordsLength - 1;\n const fullTextLength = fullText.length;\n if(this.minChars <= foundChars || fullTextLength <= foundChars) {\n newFoundObjs.push({fullText, fullTextLength, what, foundChars});\n }\n }\n });\n\n return newFoundObjs;\n }\n\n public search(query: string) {\n if(this.options) {\n query = processSearchText(query, this.options);\n }\n\n const queries = query.split('\\x01');\n const newFoundObjs = flatten(queries.map((query) => this._search(query)));\n\n newFoundObjs.sort((a, b) => a.fullTextLength - b.fullTextLength || b.foundChars - a.foundChars);\n\n // newFoundObjs.sort((a, b) => a.fullText.localeCompare(b.fullText));\n const newFoundObjs2: Set = new Set(newFoundObjs.map((o) => o.what));\n\n return newFoundObjs2;\n }\n}\n"],"names":["IGNORE_ERRORS","Set","LazyLoadQueueBase","constructor","parallelLimit","queueId","queue","inProcess","lockPromise","unlockResolve","log","this","processQueue","_processQueue","clear","length","lock","Promise","resolve","reject","unlock","processItem","item","add","loadItem","err","has","type","error","delete","load","getItem","shift","addElement","method","el","size","push","unshift","filterUnique","arr","flatten","reduce","acc","val","forEachReverse","array","callback","i","insertInDescendSortedArray","element","getProperty","pos","property","sortProperty","undefined","indexOf","prev","next","splice","len","console","assumeType","x","readBlobAs","blob","reader","FileReader","addEventListener","e","target","result","bytesCmp","bytes1","bytes2","bytesFromHex","hexString","bytes","Uint8Array","Math","ceil","start","parseInt","charAt","substr","convertToUint8Array","TextEncoder","encode","callbackify","smth","then","uploadId","getFileNameForUpload","file","fileName","mimeType","ext","split","MIDDLEWARE_ERROR","MiddlewareHelper","details","cleaned","inner","onCleanCallbacks","onDestroyCallbacks","onDestroy","destroyed","clean","forEach","helper","destroy","parent","get","additionalCallback","middleware","create","getMiddleware","onClean","defineNotNumerableProperties","obj","names","props","writable","configurable","out","name","hasOwnProperty","Object","defineProperties","getDeepProperty","object","key","splitted","o","getObjectKeysAndSort","sort","ids","Map","keys","map","a","b","debounce","fn","ms","shouldRunFirst","shouldRunLast","waitingTimeout","waitingPromise","hadNewCall","invoke","args","_resolve","_reject","apply","clearTimeout","_waitingTimeout","catch","isDebounced","SliceEnd","compareValue","val1","val2","toExponential","diff","str1","str2","str1Length","slice","compareLong","SlicedArray","sliceConstructor","getSliceConstructor","first","constructSlice","slices","static","slicedArray","Array","end","None","isEnd","side","Top","last","includes","Bottom","Both","setEnd","getEnds","top","bottom","both","unsetEnd","deleteCount","items","ret","super","idx","insertSlice","lowerBound","upperBound","foundSlice","lowerIndex","upperIndex","foundSliceIndex","sliced","insertIndex","s","prevSlice","nextSlice","findSlice","index","findSliceOffset","maxId","offset","sliceMe","offsetId","add_offset","limit","sliceOffset","sliceStart","max","sliceEnd","topWasMeantToLoad","bottomWasMeantToLoad","abs","topFulfilled","bottomFulfilled","offsetIdOffset","fulfilled","found","deleteSlice","indexOfAndSplice","toJSON","serialized","values","JSON","stringify","json","parsed","parse","inserted","getAttachMenuBotIcon","attachMenuBot","icons","find","icon","getParticipantPeerId","participant","peer","user_id","toPeerId","hasRights","chat","action","rights","isThread","pFlags","deactivated","isCheckingRightsForSelf","creator","_","left","megagroup","admin_rights","banned_rights","default_banned_rights","myFlags","isAdmin","post_messages","broadcast","getDialogIndex","dialog","indexKey","folder_id","getDialogIndexKey","localId","getDocumentDownloadOptions","doc","thumb","onlyCache","inputFileLocation","sticker","mime_type","startsWith","dcId","dc_id","location","file_name","getDocumentInputFileLocation","thumbSize","id","access_hash","file_reference","thumb_size","getDownloadFileNameFromOptions","options","getDownloadMediaDetails","media","downloadOptions","webDocument","getPhotoDownloadOptions","isWebDocument","url","downloadId","draftsAreEqual","draft1","draft2","reply_to_msg_id","entities","message","no_webpage","generateQId","queryId","resultId","generateMessageId","messageId","q","filterMessagesByInputFilter","inputFilter","history","foundMsgs","filtering","neededContents","neededDocTypes","excludeDocTypes","document","goodEntities","totalEntities","getAlbumText","messages","foundMessages","m","getMessageThreadId","isForum","threadId","replyTo","reply_to","forum_topic","mid","reply_to_top_id","getPeerActiveUsernames","usernames","filter","username","active","getPeerPhoto","photo","isPeerRestricted","restrictionReasons","restriction_reason","restricted","photoSize","isDocument","Error","isPhoto","reactionsEqual","r1","r2","getStickerEffectThumb","video_thumbs","canSendToUser","user","deleted","ConnectionStatus","CAN_COMBINE_ENTITIES","combineSameEntities","entity","nextEntityIdx","findIndex","_i","nextEntity","encodeSpoiler","text","before","spoilerAfter","chars","charsLength","char","charCodeAt","join","spoiler","after","entityText","SINGLE_ENTITIES","findConflictingEntity","currentEntities","newEntity","singleEnd","currentEntity","fixEmoji","replace","match","string","matchUrl","mergeEntities","newEntities","filtered","checkBrackets","urlLength","urlOpenBrackets","urlCloseBrackets","getEmojiUnified","emojiCode","unified","parseEntities","raw","matchIndex","rawOffset","E","protocol","tld","toLowerCase","balanced","unicode","unsafe","timestamp","splittedLength","hours","minutes","seconds","test","time","parseMarkdown","noTrim","pushedEntity","pushEntity","newTextParts","language","isSOH","toUserId","newText","sortEntities","wrapPlainText","SearchIndex","minChars","fullTexts","indexObject","searchText","trim","set","_search","query","newFoundObjs","queryWords","queryWordsLength","fullText","what","foundChars","word","fullTextLength","search","queries"],"sourceRoot":""} \ No newline at end of file diff --git a/public/297.30de9795e39435a29676.chunk.js b/public/297.30de9795e39435a29676.chunk.js new file mode 100644 index 00000000..abcd2208 --- /dev/null +++ b/public/297.30de9795e39435a29676.chunk.js @@ -0,0 +1,2 @@ +(this.webpackChunktweb=this.webpackChunktweb||[]).push([[297],{5814:(e,t,i)=>{"use strict";i.d(t,{Z:()=>m});var s=i(5400),n=i(3512),a=i(4762),o=i(410),r=i(8487),d=i(3772),l=i(1655),c=i(7625),h=i(2586),u=i(3013),p=i(3035);const f=new class{constructor(){this.observer=new IntersectionObserver((e=>{for(const t of e){const e=t.target;for(const i in this.byGroups){if(this.intersectionLockedGroups[i])continue;const s=this.byGroups[i].find((t=>t.el===e));if(s){if(t.isIntersecting)this.visible.add(s),this.checkAnimation(s,!1);else{this.visible.delete(s),this.checkAnimation(s,!0);const e=s.animation;e instanceof d.Z&&e.clearCache()}break}}}})),this.visible=new Set,this.overrideIdleGroups=new Set,this.byGroups={},this.byPlayer=new Map,this.lockedGroups={},this.onlyOnePlayableGroup="",this.intersectionLockedGroups={},this.videosLocked=!1,u.Z.addEventListener("play",(({doc:e})=>{"round"===e.type&&(this.videosLocked=!0,this.checkAnimations2())})),u.Z.addEventListener("pause",(()=>{this.videosLocked&&(this.videosLocked=!1,this.checkAnimations2())})),h.Z.addEventListener("change",(e=>{this.checkAnimations2(e)}))}setOverrideIdleGroup(e,t){t?this.overrideIdleGroups.add(e):this.overrideIdleGroups.delete(e)}getAnimations(e){const t=[];for(const i in this.byGroups)for(const s of this.byGroups[i])s.el===e&&t.push(s);return t}removeAnimation(e){const{el:t,animation:i}=e;i instanceof HTMLVideoElement||i.remove(),i instanceof HTMLVideoElement&&a.IS_SAFARI&&setTimeout((()=>{i.src="",i.load()}),1e3);const s=this.byGroups[e.group];s&&((0,l.Z)(s,e),s.length||delete this.byGroups[e.group]),this.observer.unobserve(t),this.visible.delete(e),this.byPlayer.delete(i)}removeAnimationByPlayer(e){const t=this.byPlayer.get(e);t&&this.removeAnimation(t)}addAnimation(e){var t,i,a,o;let{animation:r,group:l="",observeElement:c,controlled:h,liteModeKey:u}=e;if("none"===l||this.byPlayer.has(r))return;c||(r instanceof d.Z?c=r.el[0]:r instanceof s.KZ?c=r.canvas:r instanceof s.LD?c=null!==(t=r.placeholder)&&void 0!==t?t:r:r instanceof HTMLElement&&(c=r));const p={el:c,animation:r,group:l,controlled:h,liteModeKey:u};h&&"boolean"!=typeof h&&h.onClean((()=>{this.removeAnimationByPlayer(r)})),r instanceof d.Z&&!n.Z.settings.stickers.loop&&r.loop&&(r.loop=n.Z.settings.stickers.loop),(null!==(i=(a=this.byGroups)[o=l])&&void 0!==i?i:a[o]=[]).push(p),this.observer.observe(p.el),this.byPlayer.set(r,p)}checkAnimations(e,t,i,s){if(void 0!==t&&!this.byGroups[t])return;const n=void 0!==t?[t]:Object.keys(this.byGroups);for(const t of n){if(s&&this.intersectionLockedGroups[t])continue;const n=this.byGroups[t];(0,c.Z)(n,(t=>{this.checkAnimation(t,e,i)}))}}checkAnimations2(e){this.checkAnimations(e,void 0,void 0,!0)}checkAnimation(e,t,i){const{el:s,animation:n,group:a}=e;i||!this.lockedGroups[a]&&!(0,r.Z)(s)?e.controlled&&!i||this.removeAnimation(e):t||this.onlyOnePlayableGroup&&this.onlyOnePlayableGroup!==a||n instanceof HTMLVideoElement&&this.videosLocked?n.paused||n.pause():!(n.paused&&this.visible.has(e)&&n.autoplay)||this.onlyOnePlayableGroup&&this.onlyOnePlayableGroup!==a||h.Z.isIdle&&!this.overrideIdleGroups.has(e.group)||n.play()}getOnlyOnePlayableGroup(){return this.onlyOnePlayableGroup}setOnlyOnePlayableGroup(e=""){this.onlyOnePlayableGroup=e}lockGroup(e){this.lockedGroups[e]=!0}unlockGroup(e){delete this.lockedGroups[e],this.checkAnimations(void 0,e)}refreshGroup(e){const t=this.byGroups[e];(null==t?void 0:t.length)&&(t.forEach((e=>{this.observer.unobserve(e.el)})),(0,p.T2)((()=>{t.forEach((e=>{this.observer.observe(e.el)}))})))}lockIntersectionGroup(e){this.intersectionLockedGroups[e]=!0}unlockIntersectionGroup(e){delete this.intersectionLockedGroups[e],this.refreshGroup(e)}toggleIntersectionGroup(e,t){t?this.lockIntersectionGroup(e):this.unlockIntersectionGroup(e)}setAutoplay(e,t){let i=!1;return this.byPlayer.forEach(((s,a)=>{s.liteModeKey===t&&(i=!0,a.autoplay=!!e&&!!+s.el.dataset.stickerPlay,a.loop=!!e&&!!+s.el.dataset.stickerLoop&&n.Z.settings.stickers.loop)})),i}setLoop(e){let t=!1;return this.byPlayer.forEach(((i,s)=>{+i.el.dataset.stickerLoop&&s.loop!==e&&(s instanceof d.Z||s instanceof HTMLVideoElement)&&(t=!0,s.loop=e,s.autoplay=!!+i.el.dataset.stickerPlay)})),t}};o.GO&&(o.GO.animationIntersector=f);const m=f},3013:(e,t,i)=>{"use strict";i.d(t,{Z:()=>L});var s=i(3512),n=i(3725),a=i(4762),o=i(410),r=i(6669),d=i(5432),l=i(2325),c=i(3719),h=i(8479),u=i(6848),p=i(3699),f=i(7530),m=i(493),g=i(2312),v=i(925),b=i(3241),y=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const w=(()=>{try{return a.IS_SAFARI&&+navigator.userAgent.match(/ Version\/(\d+)/)[1]<14}catch(e){return!1}})();class S extends b.Z{constructor(){super(...arguments),this.media=new Map,this.scheduled=new Map,this.mediaDetails=new Map,this.waitingMediaForLoad=new Map,this.waitingScheduledMediaForLoad=new Map,this.waitingDocumentsForLoad={},this.playbackRates={voice:1,video:1,audio:1},this.seekBackward=(e,t=this.playingMedia)=>{t&&(t.currentTime=Math.max(0,t.currentTime-(e.seekOffset||10)))},this.seekForward=(e,t=this.playingMedia)=>{t&&(t.currentTime=Math.min(t.duration,t.currentTime+(e.seekOffset||10)))},this.seekTo=(e,t=this.playingMedia)=>{t&&(t.currentTime=e.seekTime)},this.onMediaDocumentLoad=e=>y(this,void 0,void 0,(function*(){const t=this.mediaDetails.get(e),i=yield this.managers.appDocsManager.getDoc(t.docId);"audio"===i.type&&i.supportsStreaming&&w&&this.handleSafariStreamable(e);const s=yield this.managers.thumbsStorage.getCacheContext(i);e.src=s.url,this.playingMedia===e&&(e.playbackRate=this.playbackRate,"audio"===i.type&&(e.loop=this.loop));const n=this.waitingDocumentsForLoad[i.id];n&&(n.delete(e),n.size||delete this.waitingDocumentsForLoad[i.id])})),this.onPlay=e=>{const t=e.target,i=this.mediaDetails.get(t),{peerId:s,mid:n}=i,a=this.pip;a&&a.pause();const o=this.getMessageByMedia(t);if(this.playingMedia!==t){this.stop(),this.setMedia(t,o);const e=e=>e.mid===n&&e.peerId===s,i=this.listLoader,a=i.getCurrent();if(!a||!e(a)){let t;for(const s of[!1,!0]){const n=i.getPrevious(s);let a=n.findIndex(e);if(-1!==a?t=-(n.length-a):(a=i.getNext(s).findIndex(e),-1!==a&&(t=a+1)),void 0!==t)break}t?this.go(t,!1):this.setTargets({peerId:s,mid:n})}}setTimeout((()=>{this.playingMedia===t&&(this.dispatchEvent("play",this.getPlayingDetails()),this.pauseMediaInOtherTabs())}),0)},this.onPause=e=>{this.dispatchEvent("pause")},this.onEnded=e=>{if(e&&!e.isTrusted)return;this.onPause(e);const t=this.listLoader;!this.lockedSwitchers&&(this.round||!t.current||t.next.length)&&t.getNext(!0).length&&this.next()||(this.stop(),this.dispatchEvent("stop"))},this.play=()=>this.toggle(!0),this.pause=()=>this.toggle(!1),this.stop=(e=this.playingMedia,t)=>{if(!e)return!1;if(e.paused||e.pause(),e.currentTime=0,(0,r.Z)(e,"ended"),e===this.playingMedia){const t=this.mediaDetails.get(e);if(null==t?void 0:t.clean){e.src="";const i=t.peerId,s=t.isScheduled?this.scheduled:this.media,n=s.get(i);n&&(n.delete(t.mid),n.size||s.delete(i)),e.remove(),this.mediaDetails.delete(e)}this.playingMedia=void 0,this.playingMediaType=void 0}return t&&this.dispatchEvent("stop"),!0},this.playItem=e=>{const{peerId:t,mid:i}=e,s=this.searchContext.isScheduled;this.getMedia(t,i,s).play(),setTimeout((()=>{this.resolveWaitingForLoadMedia(t,i,s)}),0)},this.go=(e,t)=>{const i=this.listLoader;if(!this.lockedSwitchers&&i)return"audio"===this.playingMediaType?i.goRound(e,t):i.go(e,t)},this.browserPlay=this.bindBrowserCallback((e=>this.toggle(!0,e))),this.browserPause=this.bindBrowserCallback((e=>this.toggle(!1,e))),this.browserStop=this.bindBrowserCallback((e=>this.stop(e))),this.browserSeekBackward=this.bindBrowserCallback(((e,t)=>this.seekBackward(t,e))),this.browserSeekForward=this.bindBrowserCallback(((e,t)=>this.seekForward(t,e))),this.browserSeekTo=this.bindBrowserCallback(((e,t)=>this.seekTo(t,e))),this.browserNext=this.bindBrowserCallback((e=>e||this.next())),this.browserPrevious=this.bindBrowserCallback((e=>e?this.seekToStart(e):this.previous())),this.next=()=>this.go(1),this.previous=()=>{if(!this.seekToStart(this.playingMedia))return this.go(-1)}}construct(e){if(this.managers=e,this.container=document.createElement("div"),this.container.style.cssText="display: none;",document.body.append(this.container),navigator.mediaSession){const e={play:this.browserPlay,pause:this.browserPause,stop:this.browserStop,seekbackward:this.browserSeekBackward,seekforward:this.browserSeekForward,seekto:this.browserSeekTo,previoustrack:this.browserPrevious,nexttrack:this.browserNext};for(const t in e)try{navigator.mediaSession.setActionHandler(t,e[t])}catch(e){console.warn("MediaSession action is not supported:",t)}}s.Z.addEventListener("document_downloaded",(e=>{const t=this.waitingDocumentsForLoad[e];if(t)for(const e of t)this.onMediaDocumentLoad(e)})),s.Z.addEventListener("media_play",(()=>{this.skipMediaPlayEvent?this.skipMediaPlayEvent=!1:!this.pause()&&this.pip&&this.pip.pause()}));const t={};["volume","muted","playbackRate","loop","round"].forEach((e=>{const i="_"+e;t[e]={get:()=>this[i],set:t=>{this[i]!==t&&(this[i]=t,!this.playingMedia||"loop"===e&&"audio"!==this.playingMediaType||"round"===e||(this.playingMedia[e]=t),"playbackRate"===e&&void 0!==this.playingMediaType&&(this.playbackRates[this.playingMediaType]=t),this.dispatchPlaybackParams())}}})),Object.defineProperties(this,t)}dispatchPlaybackParams(){this.dispatchEvent("playbackParams",this.getPlaybackParams())}getPlaybackParams(){const{volume:e,muted:t,playbackRate:i,playbackRates:s,loop:n,round:a}=this;return{volume:e,muted:t,playbackRate:i,playbackRates:s,loop:n,round:a}}setPlaybackParams(e){this.playbackRates=e.playbackRates,this._volume=e.volume,this._muted=e.muted,this._playbackRate=e.playbackRate,this._loop=e.loop,this._round=e.round}addMedia(e,t,i){const{peerId:a,mid:o}=e,r=e.pFlags.is_scheduled?this.scheduled:this.media;let d=r.get(e.peerId);d||r.set(e.peerId,d=new Map);let l=d.get(o);if(l)return l;const c=(0,f.Z)(e,!0);d.set(o,l=document.createElement("round"===c.type||"video"===c.type?"video":"audio")),"round"===c.type&&l.setAttribute("playsinline","true");const h={peerId:a,mid:o,docId:c.id,doc:c,message:e,clean:i,isScheduled:e.pFlags.is_scheduled};this.mediaDetails.set(l,h),l.volume=1,this.container.append(l),l.addEventListener("play",this.onPlay),l.addEventListener("pause",this.onPause),l.addEventListener("ended",this.onEnded),"audio"!==c.type&&(null==e?void 0:e.pFlags.media_unread)&&e.fromId!==s.Z.myId&&l.addEventListener("timeupdate",(()=>{this.managers.appMessagesManager.readMessages(a,[o])}),{once:!0});const u=(0,n.Z)();if(t)u.resolve();else{const t=e.pFlags.is_scheduled?this.waitingScheduledMediaForLoad:this.waitingMediaForLoad;let i=t.get(a);i||t.set(a,i=new Map),i.set(o,u)}return u.then((()=>y(this,void 0,void 0,(function*(){if(c.supportsStreaming||(yield this.managers.thumbsStorage.getCacheContext(c)).url)this.onMediaDocumentLoad(l);else{let e=this.waitingDocumentsForLoad[c.id];e||(e=this.waitingDocumentsForLoad[c.id]=new Set),e.add(l),g.Z.downloadMediaURL({media:c})}})))),l}getMedia(e,t,i){const s=(i?this.scheduled:this.media).get(e);return null==s?void 0:s.get(t)}handleSafariStreamable(e){e.addEventListener("play",(()=>{const t=e.currentTime;e.addEventListener("progress",(()=>{e.currentTime=e.duration-1,e.addEventListener("progress",(()=>{e.currentTime=t,e.paused||e.play()}),{once:!0})}),{once:!0})}))}resolveWaitingForLoadMedia(e,t,i){const s=i?this.waitingScheduledMediaForLoad:this.waitingMediaForLoad,n=s.get(e);if(!n)return;const a=n.get(t);a&&(a.resolve(),n.delete(t),n.size||s.delete(e))}isSafariBuffering(e){return!!e.safariBuffering}setSafariBuffering(e,t){e.safariBuffering=t}setNewMediadata(e,t=this.playingMedia){var i,s;return y(this,void 0,void 0,(function*(){if(document.pictureInPictureElement)return;yield(0,v.Z)(t,void 0,!1);const n=(0,f.Z)(e,!0),o=[],r="voice"===n.type||"round"===n.type;let c="",h="";if(null===(i=n.thumbs)||void 0===i?void 0:i.length){const i=n.thumbs[n.thumbs.length-1];if(!i.bytes){const s=yield this.managers.thumbsStorage.getCacheContext(n,i.type);s.url?o.push({src:s.url,sizes:`${i.w}x${i.h}`,type:"image/jpeg"}):g.Z.downloadMediaURL({media:n,thumb:i}).then((()=>{this.playingMedia===t&&s.url&&this.setNewMediadata(e)}))}}else if(r){const t=e.fromId||e.peerId;yield this.managers.appPeersManager.getPeerPhoto(t),c=yield(0,m.Z)({peerId:t,plainText:!0,onlyFirstName:!1}),h=l.ZP.format("voice"===n.type?"AttachAudio":"AttachRound",!0)}if(!r){const e=n.attributes.find((e=>"documentAttributeAudio"===e._));c=null!==(s=null==e?void 0:e.title)&&void 0!==s?s:n.file_name,h=null==e?void 0:e.performer}o.length||(a.IS_APPLE?d.Z?o.push({src:"assets/img/apple-touch-icon-precomposed.png",sizes:"180x180",type:"image/png"}):o.push({src:"assets/img/apple-touch-icon.png",sizes:"180x180",type:"image/png"}):[72,96,144,192,256,384,512].forEach((e=>{const t=`${e}x${e}`;o.push({src:`assets/img/android-chrome-${t}.png`,sizes:t,type:"image/png"})})));const u=new MediaMetadata({title:c,artist:h,artwork:o});navigator.mediaSession.metadata=u}))}setCurrentMediadata(){const{playingMedia:e}=this;if(!e)return;const t=this.getMessageByMedia(e);this.setNewMediadata(t,e)}getMessageByMedia(e){return this.mediaDetails.get(e).message}getPlayingDetails(){const{playingMedia:e}=this;if(!e)return;const t=this.getMessageByMedia(e);return{doc:(0,f.Z)(t,!0),message:t,media:e,playbackParams:this.getPlaybackParams()}}pauseMediaInOtherTabs(){this.skipMediaPlayEvent=!0,s.Z.dispatchEvent("media_play")}toggle(e,t=this.playingMedia){return!!t&&(void 0===e&&(e=t.paused),t.paused===e&&(e?t.play():t.pause(),!0))}bindBrowserCallback(e){return t=>{e(this.pip,t)}}seekToStart(e){return(null==e?void 0:e.currentTime)>5&&(e.currentTime=0,this.toggle(!0,e),!0)}willBePlayed(e){this.willBePlayedMedia=e}setSearchContext(e){return!(0,u.Z)(this.searchContext,e)&&(this.searchContext=(0,h.Z)(e),!0)}getSearchContext(){return this.searchContext}setTargets(e,t,i){let s=this.listLoader;s?s.reset():s=this.listLoader=new c.Z({loadCount:10,loadWhenLeft:5,processItem:e=>(this.addMedia(e,!1),{peerId:e.peerId,mid:e.mid}),onJump:(e,t)=>{this.playItem(e)},onEmptied:()=>{this.dispatchEvent("stop"),this.stop()}});const n=void 0===this.searchContext.folderId;t?s.setTargets(t,i,n):s.reverse=n,s.setSearchContext(this.searchContext),s.current=e,s.load(!0),s.load(!1)}getPlaybackMediaTypeFromMessage(e){const t=(0,f.Z)(e,!0);let i="audio";return(null==t?void 0:t.type)&&("voice"===t.type||"round"===t.type?i="voice":"video"===t.type&&(i="video")),i}setMedia(e,t){const i=this.getPlaybackMediaTypeFromMessage(t);this._playbackRate=this.playbackRates[i],this.playingMedia=e,this.playingMediaType=i,this.playingMedia.volume=this.volume,this.playingMedia.muted=this.muted,this.playingMedia.playbackRate=this.playbackRate,"audio"===i&&(this.playingMedia.loop=this.loop),"mediaSession"in navigator&&this.setNewMediadata(t)}setSingleMedia(e,t){const i=this.playingMedia,s=this.pause();let n;return e?(n=()=>{const e=this.pip;e&&e.pause(),this.pauseMediaInOtherTabs()},e.paused||n(),e.addEventListener("play",n)):this.pauseMediaInOtherTabs(),this.willBePlayed(void 0),e?this.setMedia(e,t):this.playingMedia=void 0,this.toggleSwitchers(!1),(t=s)=>{this.toggleSwitchers(!0),i&&(this.mediaDetails.get(i)?this.setMedia(i,this.getMessageByMedia(i)):this.next()||this.previous()),this.playingMedia===e&&(this.playingMedia=void 0,this.playingMediaType=void 0),e&&e.removeEventListener("play",n),t&&this.play()}}toggleSwitchers(e){this.lockedSwitchers=!e}setPictureInPicture(e){this.pip=e;const t=new p.Z;t.add(e)("leavepictureinpicture",(()=>{this.pip===e&&(this.pip=void 0,t.removeAll())}),{once:!0}),t.add(e)("play",(t=>{this.playingMedia!==e&&this.pause(),this.pauseMediaInOtherTabs()}))}}const C=new S;o.GO.appMediaPlaybackController=C;const L=C},1784:(e,t,i)=>{"use strict";i.d(t,{Z:()=>I});var s=i(2341),n=i(3910),a=i(2738),o=i(8497),r=i(4668),d=i(130),l=i(4755),c=i(3719),h=i(2312),u=i(7030),p=i(3709),f=i(7530),m=i(5400),g=i(8544),v=i(5128),b=i(4524),y=i(8805),w=i(4332),S=i(1669),C=i(1168),L=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class I extends g.Z{get searchContext(){return this.listLoader.searchContext}constructor(){let e;super(new c.Z({processItem:e=>{const t="inputMessagesFilterDocument"===this.searchContext.inputFilter._,{mid:i,peerId:s}=e,n=(0,f.Z)(e,!0);if(n&&(!t||I.isMediaCompatibleForDocumentViewer(n)))return{element:null,mid:i,peerId:s}}}),["delete","forward"]),this.onPrevClick=e=>L(this,void 0,void 0,(function*(){this.openMedia({message:yield this.getMessageByPeer(e.peerId,e.mid),target:e.element,fromRight:-1})})),this.onNextClick=e=>L(this,void 0,void 0,(function*(){this.openMedia({message:yield this.getMessageByPeer(e.peerId,e.mid),target:e.element,fromRight:1})})),this.onDeleteClick=()=>{const e=this.target;C.Z.createPopup(v.Z,e.peerId,[e.mid],"chat",(()=>{this.target={element:this.content.media},this.close()}))},this.onForwardClick=()=>{const e=this.target;e.mid&&C.Z.createPopup(b.Z,{[e.peerId]:[e.mid]},(()=>this.close()))},this.onAuthorClick=e=>L(this,void 0,void 0,(function*(){const{mid:t,peerId:i}=this.target;if(t&&t!==Number.MAX_SAFE_INTEGER){const s=this.searchContext.threadId,n=yield this.getMessageByPeer(i,t);this.close(e).then((()=>L(this,void 0,void 0,(function*(){if(l.Z.isMobile){const e=w.ZP.getTab(S.Z);e&&e.close()}u.ZP.setInnerPeer({peerId:n.peerId,lastMsgId:t,type:s?"discussion":void 0,threadId:s})}))))}})),this.onDownloadClick=()=>{const{message:e}=this.target,t=(0,f.Z)(e,!0);t&&h.Z.downloadToDisc({media:t,queueId:u.ZP.chat.bubbles.lazyLoadQueue.queueId})},this.listLoader.onEmptied=()=>{this.close()},this.content.caption=document.createElement("div"),this.content.caption.classList.add(g.x+"-caption","spoilers-container");const t=()=>{e&&clearTimeout(e),e=window.setTimeout((()=>{e=void 0,this.content.caption.classList.remove("is-focused")}),800)};this.content.caption.addEventListener("touchstart",(()=>{l.Z.isMobile&&(this.content.caption.classList.add("is-focused"),e&&(clearTimeout(e),e=void 0),document.addEventListener("touchend",t,{once:!0}))})),new y.ZP(this.content.caption).onAdditionalScroll=t,this.wholeDiv.append(this.content.caption),(0,a.fc)(this.buttons.delete,this.onDeleteClick);const i=[this.btnMenuForward={icon:"forward",text:"Forward",onClick:this.onForwardClick},this.btnMenuDownload={icon:"download",text:"MediaViewer.Context.Download",onClick:this.onDownloadClick},this.btnMenuDelete={icon:"delete danger",text:"Delete",onClick:this.onDeleteClick}];this.setBtnMenuToggle(i),this.setListeners()}setListeners(){super.setListeners(),(0,a.fc)(this.buttons.forward,this.onForwardClick),(0,a.fc)(this.author.container,this.onAuthorClick);const e=t=>{const i=(0,r.Z)(t.target,"A");if(i.classList.contains("timestamp"))return;const s=(0,o.Z)(t.target,"spoiler");if(i instanceof HTMLAnchorElement&&(!s||this.content.caption.classList.contains("is-spoiler-visible"))){const s=i.getAttribute("onclick");if(!s||s.includes("showMaskedAlert"))return;return(0,n.Z)(t),this.close().then((()=>{this.content.caption.removeEventListener("click",e,{capture:!0}),i.click()})),!1}};this.content.caption.addEventListener("click",e,{capture:!0})}getMessageByPeer(e,t){return this.searchContext.isScheduled?this.managers.appMessagesManager.getScheduledMessageByPeer(e,t):this.managers.appMessagesManager.getMessageByPeer(e,t)}setCaption(e){const t=e.message;let i="";if(t){const s=(0,f.Z)(e,!0);i=(0,m.ZP)(t,{entities:e.totalEntities,maxMediaTimestamp:"video"===(null==s?void 0:s.type)&&s.duration||void 0})}(0,d.Z)(this.content.caption.firstElementChild,i),this.content.caption.classList.toggle("hide",!t)}setSearchContext(e){return this.listLoader.setSearchContext(e),this}openMedia({message:e,target:t,fromRight:i=0,reverse:s=!1,prevTargets:n=[],nextTargets:a=[],mediaTimestamp:o}){const r=Object.create(null,{_openMedia:{get:()=>super._openMedia}});return L(this,void 0,void 0,(function*(){if(this.setMoverPromise)return this.setMoverPromise;const d=e.mid,l=e.fwd_from&&!e.fromId?e.fwd_from.from_name:e.fromId,c=(0,f.Z)(e,!0),h=yield this.managers.appPeersManager.noForwards(e.peerId),u="messageService"===e._,m=u||!(yield this.managers.appMessagesManager.canForward(e)),g=(u?h:m)||!(0,p.Z)(e);[[[this.buttons.forward,this.btnMenuForward],m],[[this.buttons.download,this.btnMenuDownload],g],[[this.buttons.delete,this.btnMenuDelete],!(yield this.managers.appMessagesManager.canDeleteMessage(e))]].forEach((([e,t])=>{e.forEach((e=>{e instanceof HTMLElement?e.classList.toggle("hide",t):e.verify=()=>!t}))})),this.wholeDiv.classList.toggle("no-forwards",g),this.setCaption(e);const v=r._openMedia.call(this,{media:c,timestamp:e.date,fromId:l,fromRight:i,target:t,reverse:s,prevTargets:n,nextTargets:a,message:e,mediaTimestamp:o});return this.target.mid=d,this.target.peerId=e.peerId,this.target.message=e,v}))}static isMediaCompatibleForDocumentViewer(e){return"photo"===e._||s.Z.has(e.mime_type)}}},8544:(e,t,i)=>{"use strict";i.d(t,{x:()=>te,Z:()=>ie});var s=i(3725),n=i(4755),a=i(5432),o=i(4762),r=i(5003),d=i(3013),l=i(3910),c=i(3699),h=i(3003),u=i(5322),p=i(7529),f=i(6733),m=i(5157),g=i(7207),v=i(8427),b=i(5701),y=i(3815),w=i(925),S=i(2738);class C extends p.Z{constructor({video:e,play:t=!1,streamable:i=!1,duration:s,onPlaybackRackMenuToggle:n,onPip:a,onPipClose:o}){if(super(),this.video=e,this.wrapper=document.createElement("div"),this.wrapper.classList.add("ckin__player"),this.onPlaybackRackMenuToggle=n,this.onPip=a,this.onPipClose=o,this.listenerSetter=new c.Z,this.setup({element:this.wrapper,listenerSetter:this.listenerSetter,canHideControls:()=>!(this.video.paused||this.playbackRateButton&&this.playbackRateButton.classList.contains("menu-open")),showOnLeaveToClassName:"media-viewer-caption",ignoreClickClassName:"ckin__controls"}),e.parentNode.insertBefore(this.wrapper,e),this.wrapper.appendChild(e),this.skin="default",this.stylePlayer(s),this.setBtnMenuToggle(),"default"===this.skin){const t=this.wrapper.querySelector(".default__controls.ckin__controls");this.progress=new g.Z({onSeekStart:()=>{this.wrapper.classList.add("is-seeking")},onSeekEnd:()=>{this.wrapper.classList.remove("is-seeking")}}),this.progress.setMedia({media:e,streamable:i,duration:s}),t.prepend(this.progress.container)}t&&e.play().catch((t=>{"NotAllowedError"===t.name&&(e.muted=!0,e.autoplay=!0,e.play())})).finally((()=>{this.wrapper.classList.toggle("is-playing",!this.video.paused)}))}stylePlayer(e){const{wrapper:t,video:i,skin:s,listenerSetter:n}=this;t.classList.add(s);const o=this.buildControls();let r;if(t.insertAdjacentHTML("beforeend",o),"default"===s){this.playbackRateButton=this.wrapper.querySelector(".playback-rate"),this.pipButton=this.wrapper.querySelector(".pip");const e=t.querySelectorAll(".toggle"),s=t.querySelector(".fullscreen"),o=t.querySelector("#time-elapsed");r=t.querySelector("#time-duration"),r.textContent=(0,m.Z)(0|i.duration);const c=new v.Z(n),h=t.querySelector(".left-controls");if(c.btn.classList.remove("btn-icon"),h.insertBefore(c.btn,o.parentElement),Array.from(e).forEach((e=>{(0,S.fc)(e,(()=>{this.togglePlay()}),{listenerSetter:this.listenerSetter})})),this.pipButton){(0,S.fc)(this.pipButton,(()=>{this.video.requestPictureInPicture()}),{listenerSetter:this.listenerSetter});const e=e=>{this.wrapper.style.visibility=e?"hidden":"",this.onPip&&this.onPip(e)},t=20,s=(0,b.Z)(e,t,!1,!0);n.add(i)("enterpictureinpicture",(()=>{s(!0),n.add(i)("leavepictureinpicture",(()=>{const e=n.add(i)("pause",(()=>{clearTimeout(s),this.onPipClose&&this.onPipClose()}),{once:!0}),s=setTimeout((()=>{n.remove(e)}),t)}),{once:!0})})),n.add(i)("leavepictureinpicture",(()=>{s(!1)}))}a.Z||((0,S.fc)(i,(()=>{this.togglePlay()}),{listenerSetter:this.listenerSetter}),n.add(document)("keydown",(e=>{if(y.Z.overlaysActive>1||document.pictureInPictureElement===i)return;const{key:s,code:n}=e;let a=!0;if("KeyF"===n)this.toggleFullScreen();else if("KeyM"===n)d.Z.muted=!d.Z.muted;else if("Space"===n)this.togglePlay();else if(!e.altKey||"Equal"!==n&&"Minus"!==n)!t.classList.contains("ckin__fullscreen")||"ArrowLeft"!==s&&"ArrowRight"!==s?a=!1:"ArrowLeft"===s?d.Z.seekBackward({action:"seekbackward"}):d.Z.seekForward({action:"seekforward"});else{const e="Equal"===n?1:-1,t=d.Z.playbackRate,i=C.PLAYBACK_RATES.indexOf(t)+e;i>=0&&i{a.Z||this.toggleFullScreen()})),(0,S.fc)(s,(()=>{this.toggleFullScreen()}),{listenerSetter:this.listenerSetter}),(0,f.Ms)(t,this.onFullScreen.bind(this,s),n),n.add(i)("timeupdate",(()=>{o.textContent=(0,m.Z)(0|i.currentTime)})),n.add(i)("play",(()=>{t.classList.add("played"),a.Z||n.add(i)("play",(()=>{this.hideControls(!0)}))}),{once:!0}),n.add(i)("pause",(()=>{this.showControls(!1)})),n.add(d.Z)("playbackParams",(()=>{this.setPlaybackRateIcon()}))}n.add(i)("play",(()=>{t.classList.add("is-playing")})),n.add(i)("pause",(()=>{t.classList.remove("is-playing")})),i.duration||e?r.textContent=(0,m.Z)(Math.round(i.duration||e)):(0,w.Z)(i).then((()=>{r.textContent=(0,m.Z)(Math.round(i.duration))}))}togglePlay(e=this.video.paused){this.video[e?"play":"pause"]()}buildControls(){const e=this.skin;if("default"===e)return`\n \n
\n
\n
\n
\n \n
\n \n / \n \n
\n
\n
\n \n ${!o.IS_MOBILE&&document.pictureInPictureEnabled?``:""}\n \n
\n
\n
`}setBtnMenuToggle(){const e=C.PLAYBACK_RATES.map(((e,t)=>({regularText:e+"x",onClick:()=>{d.Z.playbackRate=e}}))),t=(0,h.b)({buttons:e});t.classList.add("top-left"),(0,u.v)({el:this.playbackRateButton,onOpen:this.onPlaybackRackMenuToggle?()=>{this.onPlaybackRackMenuToggle(!0)}:void 0,onClose:this.onPlaybackRackMenuToggle?()=>{this.onPlaybackRackMenuToggle(!1)}:void 0}),this.playbackRateButton.append(t),this.setPlaybackRateIcon()}setPlaybackRateIcon(){const e=this.playbackRateButton;C.PLAYBACK_RATES_ICONS.forEach((t=>{t="tgico-"+t,e.classList.remove(t)}));let t=C.PLAYBACK_RATES.indexOf(d.Z.playbackRate);-1===t&&(t=C.PLAYBACK_RATES.indexOf(1)),e.classList.add("tgico-"+C.PLAYBACK_RATES_ICONS[t])}toggleFullScreen(){const e=this.wrapper;if(o.IS_APPLE_MOBILE){const e=this.video;return e.webkitEnterFullscreen(),void e.enterFullscreen()}(0,f.rB)()?(0,f.C8)():(0,f.Dj)(e)}onFullScreen(e){const t=(0,f.rB)();this.wrapper.classList.toggle("ckin__fullscreen",t),t?(e.classList.remove("tgico-fullscreen"),e.classList.add("tgico-smallscreen"),e.setAttribute("title","Exit Full Screen")):(e.classList.remove("tgico-smallscreen"),e.classList.add("tgico-fullscreen"),e.setAttribute("title","Full Screen"))}setTimestamp(e){this.video.currentTime=e,this.togglePlay(!0)}cleanup(){super.cleanup(),this.listenerSetter.removeAll(),this.progress.removeListeners(),this.onPlaybackRackMenuToggle=this.onPip=void 0}}C.PLAYBACK_RATES=[.5,1,1.5,2],C.PLAYBACK_RATES_ICONS=["playback_05","playback_1x","playback_15","playback_2x"];var L=i(3512),I=i(5814),E=i(9331),P=i(2230),Z=i(3442),M=i(3757),T=i(632),k=i(5824),x=i(8497),A=i(6740),_=i(8204),F=i(9171),D=i(5565),R=i(3035),B=i(65),N=i(241),O=i(3241),U=i(1507),H=i(7660),z=i(8580),j=i(1713),G=i(8115),V=i(4421),K=i(2312),W=i(7362),$=i(2796),q=i(3228);function Y(e,t,i){return e>=t&&e<=i}var Q=i(5975),X=i(5994),J=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const ee=.5,te="media-viewer";class ie extends O.Z{get target(){return this.listLoader.current}set target(e){this.listLoader.current=e}constructor(e,t){super(!1),this.listLoader=e,this.author={},this.content={},this.buttons={},this.tempId=0,this.preloader=null,this.preloaderStreamable=null,this.isFirstOpen=!0,this.pageEl=document.getElementById("page-chats"),this.zoomElements={},this.transform={x:0,y:0,scale:1},this.lastTransform=this.transform,this.lastZoomCenter=this.transform,this.lastDragOffset=this.transform,this.lastDragDelta=this.transform,this.onSwipeFirst=e=>{this.lastDragOffset=this.lastDragDelta={x:0,y:0},this.lastTransform=Object.assign({},this.transform),"wheel"===(null==e?void 0:e.type)&&this.ctrlKeyDown||(this.moversContainer.classList.add("no-transition"),this.zoomElements.rangeSelector.container.classList.remove("with-transition")),this.isGesturingNow=!0,this.lastGestureTime=Date.now(),this.clampZoomDebounced.clearTimeout(),this.lastTransform.x||this.lastTransform.y||this.isZooming||(this.initialContentRect=this.content.media.getBoundingClientRect())},this.onSwipeReset=e=>{this.moversContainer.classList.remove("no-transition"),this.zoomElements.rangeSelector.container.classList.add("with-transition"),this.clampZoomDebounced.clearTimeout(),"mouseup"===(null==e?void 0:e.type)&&"mousemove"===this.draggingType&&(this.ignoreNextClick=!0);const{draggingType:t}=this;if(this.isZoomingNow=!1,this.isGesturingNow=!1,this.draggingType=void 0,!this.closing)if(this.transform.scale>1){const e=Math.min(this.transform.scale,4),i=e/this.transform.scale;let s=this.transform.x*i+(this.lastZoomCenter.x-i*this.lastZoomCenter.x),n=this.transform.y*i+(this.lastZoomCenter.y-i*this.lastZoomCenter.y);if(t&&"wheel"!==t&&this.lastTransform.scale===this.transform.scale){const e=.1,t=Math.max(1,Date.now()-this.lastGestureTime),i=Math.abs(this.lastDragOffset.x)/t,a=Math.abs(this.lastDragOffset.y)/t;s-=Math.abs(this.lastDragOffset.x)*i*e*-this.lastDragDelta.x,n-=Math.abs(this.lastDragOffset.y)*a*e*-this.lastDragDelta.y}const[a]=this.calculateOffsetBoundaries({x:s,y:n,scale:e});this.lastTransform=a,this.setTransform(a)}else this.transform.scale<1&&this.resetZoom()},this.onZoom=({initialCenterX:e,initialCenterY:t,zoom:i,zoomAdd:s,currentCenterX:n,currentCenterY:a,dragOffsetX:o,dragOffsetY:r,zoomFactor:d})=>{e||(e=N.Z.width/2),t||(t=N.Z.height/2),n||(n=N.Z.width/2),a||(a=N.Z.height/2),this.isZoomingNow=!0;const l=void 0!==s?(0,q.Z)(this.lastTransform.scale+s,ee,12):null!=i?i:(0,q.Z)(this.lastTransform.scale*d,ee,12),c=l/this.lastTransform.scale,h=Math.abs(Math.min(this.lastTransform.x,0)),u=Math.abs(Math.min(this.lastTransform.y,0));this.lastZoomCenter={x:n,y:a};const p=h+e,f=u+t,{scaleOffsetX:m,scaleOffsetY:g}=this.calculateScaleOffset({x:p,y:f,scale:c}),[v]=this.calculateOffsetBoundaries({x:this.lastTransform.x+m+o,y:this.lastTransform.y+g+r,scale:l});this.setTransform(v)},this.calculateOffsetBoundaries=({x:e,y:t,scale:i},s=0)=>{if(!this.initialContentRect)return[{x:e,y:t,scale:i},!0,!0];let n=!0,a=!0;const{minX:o,maxX:r,minY:d,maxY:l}=this.getZoomBoundaries(i,s);return n=Y(e,r,o),e=(0,q.Z)(e,r,o),a=Y(t,l,d),[{x:e,y:t=(0,q.Z)(t,l,d),scale:i},n,a]},this.setZoomValue=(e=this.transform.scale)=>{var t;null!==(t=this.initialContentRect)&&void 0!==t||(this.initialContentRect=this.content.media.getBoundingClientRect()),1===e&&(this.transform.x=0,this.transform.y=0),this.moversContainer.style.transform=`translate3d(${this.transform.x.toFixed(3)}px, ${this.transform.y.toFixed(3)}px, 0px) scale(${e.toFixed(3)})`,this.zoomElements.btnOut.classList.toggle("inactive",e<=ee),this.zoomElements.btnIn.classList.toggle("inactive",e>=4),this.toggleZoom(1!==e)},this.onClick=e=>{if(this.ignoreNextClick)return void(this.ignoreNextClick=void 0);if(this.setMoverAnimationPromise)return;const t=e.target;if("A"===t.tagName)return;if((0,l.Z)(e),a.Z)return this.highlightSwitchersTimeout?clearTimeout(this.highlightSwitchersTimeout):this.wholeDiv.classList.add("highlight-switchers"),void(this.highlightSwitchersTimeout=window.setTimeout((()=>{this.wholeDiv.classList.remove("highlight-switchers"),this.highlightSwitchersTimeout=0}),3e3));if((0,S.Cf)(e))return;const i=this.isZooming&&!1;let s=null;const n=["ckin__player","media-viewer-buttons","media-viewer-author","media-viewer-caption","zoom-container"];i&&n.push("media-viewer-movers"),n.find((e=>{try{if(s=(0,x.Z)(t,e),s)return!0}catch(e){return!1}})),s&&(i||"IMG"!==t.tagName&&"image"!==t.tagName)||this.close()},this.onKeyDown=e=>{if(y.Z.overlaysActive>1)return;const t=e.key;let i=!0;"ArrowRight"===t?!this.isZooming&&this.buttons.next.click():"ArrowLeft"===t?!this.isZooming&&this.buttons.prev.click():"-"===t||"="===t?this.ctrlKeyDown&&this.addZoomStep("="===t):i=!1,(e.ctrlKey||e.metaKey)&&(this.ctrlKeyDown=!0),i&&(0,l.Z)(e)},this.onKeyUp=e=>{y.Z.overlaysActive>1||e.ctrlKey||e.metaKey||(this.ctrlKeyDown=!1,this.isZooming&&this.setZoomValue())},this.managers=L.Z.managers,this.log=(0,r.kg)("AMV"),this.preloader=new Z.Z,this.preloaderStreamable=new Z.Z({cancelable:!1,streamable:!0}),this.preloader.construct(),this.preloaderStreamable.construct(),this.lazyLoadQueue=new V.Z,this.wholeDiv=document.createElement("div"),this.wholeDiv.classList.add(te+"-whole"),this.overlaysDiv=document.createElement("div"),this.overlaysDiv.classList.add("overlays");const i=document.createElement("div");i.classList.add(te);const s=this.topbar=document.createElement("div");s.classList.add(te+"-topbar",te+"-appear");const n=document.createElement("div");n.classList.add(te+"-topbar-left"),this.buttons["mobile-close"]=(0,P.Z)("close",{onlyMobile:!0}),this.author.container=document.createElement("div"),this.author.container.classList.add(te+"-author","no-select");const o=document.createElement("div");this.author.avatarEl=new E.Z,this.author.avatarEl.classList.add(te+"-userpic","avatar-44"),this.author.nameEl=document.createElement("div"),this.author.nameEl.classList.add(te+"-name"),this.author.date=document.createElement("div"),this.author.date.classList.add(te+"-date"),o.append(this.author.nameEl,this.author.date),this.author.container.append(this.author.avatarEl,o);const d=document.createElement("div");d.classList.add(te+"-buttons"),t.concat(["download","zoom","close"]).forEach((e=>{const t=(0,P.Z)(e,{noRipple:!0});this.buttons[e]=t,d.append(t)})),this.buttons.zoom.classList.add("zoom-in"),this.zoomElements.container=document.createElement("div"),this.zoomElements.container.classList.add("zoom-container"),this.zoomElements.btnOut=(0,P.Z)("zoomout",{noRipple:!0}),(0,S.fc)(this.zoomElements.btnOut,(()=>this.addZoomStep(!1))),this.zoomElements.btnIn=(0,P.Z)("zoomin",{noRipple:!0}),(0,S.fc)(this.zoomElements.btnIn,(()=>this.addZoomStep(!0))),this.zoomElements.rangeSelector=new B.Z({step:.01,min:ee,max:4,withTransition:!0},1),this.zoomElements.rangeSelector.setListeners(),this.zoomElements.rangeSelector.setHandlers({onScrub:e=>{var t;const i=e-this.transform.scale;this.addZoom(i),null===(t=this.clampZoomDebounced)||void 0===t||t.clearTimeout()},onMouseDown:()=>{this.onSwipeFirst()},onMouseUp:()=>{this.onSwipeReset()}}),this.zoomElements.container.append(this.zoomElements.btnOut,this.zoomElements.rangeSelector.container,this.zoomElements.btnIn),a.Z||this.wholeDiv.append(this.zoomElements.container),this.content.main=document.createElement("div"),this.content.main.classList.add(te+"-content"),this.content.container=document.createElement("div"),this.content.container.classList.add(te+"-container"),this.content.media=document.createElement("div"),this.content.media.classList.add(te+"-media"),this.content.container.append(this.content.media),this.content.main.append(this.content.container),i.append(this.content.main),this.overlaysDiv.append(i),n.append(this.buttons["mobile-close"],this.author.container),s.append(n,d),this.buttons.prev=document.createElement("div"),this.buttons.prev.className=`${te}-switcher ${te}-switcher-left`,this.buttons.prev.innerHTML=``,this.buttons.next=document.createElement("div"),this.buttons.next.className=`${te}-switcher ${te}-switcher-right`,this.buttons.next.innerHTML=``,this.moversContainer=document.createElement("div"),this.moversContainer.classList.add(te+"-movers"),this.moversContainer.append(this.buttons.prev,this.buttons.next),this.wholeDiv.append(this.overlaysDiv,this.topbar,this.moversContainer),this.listLoader.onLoadedMore=()=>{this.buttons.prev.classList.toggle("hide",!this.listLoader.previous.length),this.buttons.next.classList.toggle("hide",!this.listLoader.next.length)},this.setNewMover()}setListeners(){(0,S.fc)(this.buttons.download,this.onDownloadClick),[this.buttons.close,this.buttons["mobile-close"],this.preloaderStreamable.preloader].forEach((e=>{(0,S.fc)(e,this.close.bind(this))})),[[-1,this.buttons.prev],[1,this.buttons.next]].forEach((([e,t])=>{t.addEventListener("click",(t=>{(0,l.Z)(t),this.setMoverPromise||this.listLoader.go(e)}))})),(0,S.fc)(this.buttons.zoom,(()=>{this.isZooming?this.resetZoom():this.addZoomStep(!0)})),this.wholeDiv.addEventListener("click",this.onClick),this.listLoader.onJump=(e,t)=>{t?this.onNextClick(e):this.onPrevClick(e)};const e=(e,t)=>{const[i,s]=[e-this.lastDragOffset.x,t-this.lastDragOffset.y],[n,a,o]=this.calculateOffsetBoundaries({x:this.transform.x+i,y:this.transform.y+s,scale:this.transform.scale});return this.lastDragDelta={x:i,y:s},this.lastDragOffset={x:e,y:t},this.setTransform(n),{inBoundsX:a,inBoundsY:o}},t=(0,b.Z)((()=>{this.lastGestureTime=Date.now()}),500,!1,!0);this.clampZoomDebounced=(0,b.Z)((()=>{this.onSwipeReset()}),300,!1,!0),this.swipeHandler=new M.Z({element:this.wholeDiv,onReset:this.onSwipeReset,onFirstSwipe:this.onSwipeFirst,onSwipe:(i,s,n,o)=>{if(!(0,f.rB)())if(!this.isZooming||this.isZoomingNow){if(!this.isZoomingNow&&a.Z)return Math.abs(i)/N.Z.width>.2||Math.abs(i)>125?(i>0?this.buttons.prev.click():this.buttons.next.click(),!0):(Math.abs(s)/N.Z.height>.2||Math.abs(s)>125)&&(this.close(),!0)}else{t(),this.draggingType=n.type;const{inBoundsX:a,inBoundsY:r}=e(i,s);null==o||o(!a,!r)}},onZoom:this.onZoom,onDoubleClick:({centerX:e,centerY:t})=>{if(this.isZooming)this.resetZoom();else{const i=3;this.changeZoomByPosition(e,t,i)}},verifyTouchTarget:e=>!((0,f.rB)()||(0,Q.Z)(e.target,this.zoomElements.container)||(0,x.Z)(e.target,"ckin__controls")||(0,x.Z)(e.target,"media-viewer-caption")||(0,x.Z)(e.target,"media-viewer-topbar")&&"wheel"!==e.type),cursor:""})}changeZoomByPosition(e,t,i){const{scaleOffsetX:s,scaleOffsetY:n}=this.calculateScaleOffset({x:e,y:t,scale:i}),a=this.calculateOffsetBoundaries({x:s,y:n,scale:i})[0];this.setTransform(a)}setTransform(e){this.transform=e,this.changeZoom(e.scale)}calculateScaleOffset({x:e,y:t,scale:i}){return{scaleOffsetX:e-i*e,scaleOffsetY:t-i*t}}toggleZoom(e){const t=this.isZooming,i=void 0===e;if((this.zoomElements.rangeSelector.mousedown||this.ctrlKeyDown)&&(e=!0),null!=e||(e=!t),t!==e){if(this.buttons.zoom.classList.toggle("zoom-in",!e),this.zoomElements.container.classList.toggle("is-visible",this.isZooming=e),this.wholeDiv.classList.toggle("is-zooming",e),i||!e){const t=e?this.transform.scale:1;this.setZoomValue(t),this.zoomElements.rangeSelector.setProgress(t)}this.videoPlayer&&this.videoPlayer.lockControls(!e&&void 0)}}addZoomStep(e){this.addZoom(.5*(e?1:-1))}resetZoom(){this.setTransform({x:0,y:0,scale:1})}changeZoom(e=this.transform.scale){this.transform.scale=e,this.zoomElements.rangeSelector.setProgress(e),this.setZoomValue(e)}addZoom(e){this.lastTransform=this.transform,this.onZoom({zoomAdd:e,currentCenterX:0,currentCenterY:0,initialCenterX:0,initialCenterY:0,dragOffsetX:0,dragOffsetY:0}),this.lastTransform=this.transform,this.clampZoomDebounced()}getZoomBounce(){return this.isGesturingNow&&a.Z?50:0}getZoomBoundaries(e=this.transform.scale,t=0){if(!this.initialContentRect)return{minX:0,maxX:0,minY:0,maxY:0};const i=(N.Z.width-N.Z.width*e)/2,s=(N.Z.height-N.Z.height*e)/2;return{minX:Math.max(-this.initialContentRect.left*e,i),maxX:N.Z.width-this.initialContentRect.right*e,minY:Math.max(-this.initialContentRect.top*e+t,s),maxY:N.Z.height-this.initialContentRect.bottom*e}}setBtnMenuToggle(e){const t=(0,u.Z)({buttonOptions:{onlyMobile:!0},direction:"bottom-left",buttons:e});this.topbar.append(t)}close(e){var t,i;if(e&&(0,l.Z)(e),this.setMoverAnimationPromise)return Promise.reject();this.closing=!0,null===(t=this.swipeHandler)||void 0===t||t.removeListeners(),this.navigationItem&&k.Z.removeItem(this.navigationItem),this.lazyLoadQueue.clear();const s=this.setMoverToTarget(null===(i=this.target)||void 0===i?void 0:i.element,!0).then((({onAnimationEnd:e})=>e));return this.listLoader.reset(),this.listLoader.cleanup&&this.listLoader.cleanup(),this.setMoverPromise=null,this.tempId=-1,window.appMediaViewer===this&&(window.appMediaViewer=void 0),this.removeGlobalListeners(),s.finally((()=>{this.wholeDiv.remove(),this.toggleOverlay(!1)})),s}toggleOverlay(e){y.Z.isOverlayActive=e,I.Z.checkAnimations2(e)}toggleGlobalListeners(e){e?this.setGlobalListeners():this.removeGlobalListeners()}removeGlobalListeners(){window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp)}setGlobalListeners(){window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp)}setMediaTimestamp(e){var t;null===(t=this.videoPlayer)||void 0===t||t.setTimestamp(e)}setMoverToTarget(e,t=!1,i=0){return J(this,void 0,void 0,(function*(){this.dispatchEvent("setMoverBefore");const n=this.content.mover;t||(n.innerHTML="");const a=this.isZooming&&t?this.transform.scale:1;this.removeCenterFromMover(n);const o=0!==i,r=X.Z.isAvailable("animations")?o?350:200:0;let d,l;e&&(e instanceof E.Z||e.classList.contains("grid-item")?(d=e,l=e.getBoundingClientRect()):e instanceof SVGImageElement||e.parentElement instanceof SVGForeignObjectElement?(d=(0,x.Z)(e,"attachment"),l=d.getBoundingClientRect()):e.classList.contains("profile-avatars-avatar")&&(d=(0,x.Z)(e,"profile-avatars-container"),l=d.getBoundingClientRect(),t&&e.getBoundingClientRect().left!==l.left&&(e=d=l=void 0))),e||(e=this.content.media),l||(d=e.parentElement,l=e.getBoundingClientRect());let c=!1;if(e!==this.content.media&&!e.classList.contains("profile-avatars-avatar")){const i=(0,x.Z)(d,"scrollable"),s=(0,_.Z)(d,i,!0);!t||s&&2!==s.overflow.vertical&&2!==s.overflow.horizontal?!s||1!==s.overflow.vertical&&1!==s.overflow.horizontal||(c=!0):(d=(e=this.content.media).parentElement,l=e.getBoundingClientRect())}const h=this.content.media.getBoundingClientRect();let u,p,f,m="";if(o?(u=1===i?N.Z.width:-h.width,p=h.top):(u=l.left,p=l.top),m+=`translate3d(${u}px,${p}px,0) `,e instanceof HTMLImageElement||e instanceof HTMLVideoElement||"DIV"===e.tagName){if(n.firstElementChild&&n.firstElementChild.classList.contains("media-viewer-aspecter")){f=n.firstElementChild;const e=f.querySelector(".ckin__player");if(e){const t=e.firstElementChild;f.append(t),e.remove()}f.style.cssText||(n.classList.remove("active"),this.setFullAspect(f,h,l),n.offsetLeft,n.classList.add("active"))}else f=document.createElement("div"),f.classList.add("media-viewer-aspecter"),n.prepend(f);f.style.cssText=`width: ${l.width}px; height: ${l.height}px; transform: scale3d(${h.width/l.width}, ${h.height/l.height}, 1);`}n.style.width=h.width+"px",n.style.height=h.height+"px";const g=l.width/h.width,v=l.height/h.height;o||(m+=`scale3d(${g},${v},1) `);let b=window.getComputedStyle(d).getPropertyValue("border-radius");const y=function(e){const t=e.split(" ");if(4!==t.length){t[0]||(t[0]="0px");for(let e=t.length;e<4;++e)t[e]=t[e%2]||t[0]||"0px"}return t}(b);if(b=y.map((e=>parseInt(e)/g+"px")).join(" "),o||(n.style.borderRadius=b),t&&1!==a){const e=l.left-(N.Z.width*g-l.width)/2,t=l.top-(N.Z.height*v-l.height)/2;this.moversContainer.style.transform=`matrix(${g}, 0, 0, ${v}, ${e}, ${t})`}else n.style.transform=m;let w;c&&(n.style.opacity="0");const S=e.classList.contains("is-out"),C=this.setMoverAnimationPromise=(0,s.Z)(),L={onAnimationEnd:C},I=setTimeout((()=>{C.isFulfilled||C.isRejected||C.resolve()}),1e3);if(C.finally((()=>{this.dispatchEvent("setMoverAfter"),this.setMoverAnimationPromise===C&&(this.setMoverAnimationPromise=null),clearTimeout(I)})),t)return e instanceof SVGSVGElement&&(w=n.querySelector("path"),w&&this.sizeTailPath(w,h,g,r,!1,S,b)),e.classList.contains("media-viewer-media")&&n.classList.add("hiding"),this.toggleWholeActive(!1),setTimeout((()=>{n.style.borderRadius=b,n.firstElementChild&&(n.firstElementChild.style.borderRadius=b)}),r/2),setTimeout((()=>{n.innerHTML="",n.classList.remove("moving","active","hiding"),n.style.cssText="display: none;",C.resolve()}),r),n.classList.remove("opening"),L;{let t,i;const s="video, img, .canvas-thumbnail",a=e.matches(s)?e.parentElement:e,r=Array.from(a.querySelectorAll(s));if(r.length){e=r.pop();const t=document.createElement("canvas"),i=t.getContext("2d");e instanceof HTMLImageElement?(t.width=e.naturalWidth,t.height=e.naturalHeight):e instanceof HTMLVideoElement?(t.width=e.videoWidth,t.height=e.videoHeight):e instanceof HTMLCanvasElement&&(t.width=e.width,t.height=e.height),t.className="canvas-thumbnail thumbnail media-photo",i.drawImage(e,0,0),e=t}if("DIV"===e.tagName||"AVATAR-ELEMENT"===e.tagName){const s=Array.from(e.querySelectorAll("img")).pop();s&&(t=new Image,i=s.src,n.append(t))}else if(e instanceof HTMLImageElement)t=new Image,i=e.src;else if(e instanceof HTMLVideoElement)t=(0,H.Z)(),t.src=e.src;else if(e instanceof SVGSVGElement){const t=e.dataset.clipId,i=t+"-mv",{width:s,height:a}=h,o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttributeNS(null,"width",""+s),o.setAttributeNS(null,"height",""+a),o.setAttributeNS(null,"viewBox",`0 0 ${s} ${a}`),o.setAttributeNS(null,"preserveAspectRatio","xMidYMid meet"),o.insertAdjacentHTML("beforeend",e.firstElementChild.outerHTML.replace(t,i)),o.insertAdjacentHTML("beforeend",e.lastElementChild.outerHTML.replace(t,i));const r=o.firstElementChild,d=r.firstElementChild.firstElementChild;if(d instanceof SVGUseElement){let e,t=d.getAttributeNS(null,"transform");t=t.replace(/translate\((.+?), (.+?)\) scale\((.+?), (.+?)\)/,((e,t,i,n,o)=>`translate(${t=2!=(t=+t)?s-2/g:2/g}, ${a}) scale(${+n/g}, ${+o/v})`)),d.setAttributeNS(null,"transform",t),w=r.firstElementChild.lastElementChild;const i=b.split(" ").map((e=>parseInt(e)));e=S?(0,F.Z)(0,0,s-9/g,a,...i):(0,F.Z)(9/g,0,s-9/g,a,...i),w.setAttributeNS(null,"d",e)}const l=o.lastElementChild;l.setAttributeNS(null,"width",""+h.width),l.setAttributeNS(null,"height",""+h.height),n.prepend(o)}else e instanceof HTMLCanvasElement&&(t=e);f&&(f.style.borderRadius=b,t&&f.append(t)),t=n.querySelector("video, img"),t instanceof HTMLImageElement&&(t.classList.add("thumbnail"),f||(t.style.width=h.width+"px",t.style.height=h.height+"px"),i&&(yield(0,A.cj)(t,i))),n.style.display="",(0,R.T2)((()=>{n.classList.add(o?"moving":"active")}))}return n.classList.add("opening"),yield(0,R.d1)(),n.style.transform=`translate3d(${h.left}px,${h.top}px,0) scale3d(1,1,1)`,c&&(n.style.opacity=""),f&&this.setFullAspect(f,h,l),setTimeout((()=>{n.style.borderRadius="",n.firstElementChild&&(n.firstElementChild.style.borderRadius="")}),0),n.dataset.timeout=""+setTimeout((()=>{n.classList.remove("moving","opening"),f&&(n.querySelector("video"),n.classList.remove("active"),f.style.cssText="",n.offsetLeft),n.classList.add("center","no-transition"),n.classList.add("active"),delete n.dataset.timeout,C.resolve()}),r),w&&this.sizeTailPath(w,h,g,r,!0,S,b),L}))}toggleWholeActive(e){e?this.wholeDiv.classList.add("active"):(this.wholeDiv.classList.add("backwards"),setTimeout((()=>{this.wholeDiv.classList.remove("active")}),0))}setFullAspect(e,t,i){const s=t.width/t.height;let{width:n,height:a}=i;s>0?n=a*s:a=n*s,e.style.cssText=`width: ${n}px; height: ${a}px; transform: scale3d(${t.width/n}, ${t.height/a}, 1);`}sizeTailPath(e,t,i,s,n,a,o){const r=Date.now(),{width:d,height:l}=t;s/=2;const c=o.split(" ").map((e=>parseInt(e))),h=()=>{const t=Date.now()-r;let o=s?t/s:1;o>1&&(o=1),n&&(o=1-o);const u=c.map((e=>e*o));let p;p=a?(0,F.Z)(0,0,d-9/i*o,l,...u):(0,F.Z)(9/i*o,0,d,l,...u),e.setAttributeNS(null,"d",p),t{const a=t?-s.width:i;return e.replace(n,a+"px")}));e.style.transform=n,setTimeout((()=>{e.remove()}),350)}setNewMover(){const e=document.createElement("div");return e.classList.add("media-viewer-mover"),e.style.display="none",this.content.mover?this.content.mover.parentElement.append(e):this.moversContainer.append(e),this.content.mover=e}updateMediaSource(e,t,i){const s=e.tagName.toLowerCase()===i?e:e.querySelector(i);if(s&&!(0,x.Z)(e,"document")){if((0,x.Z)(e,"attachment")){const t=e.parentElement.parentElement.querySelector(".preloader-container");if(t){if("video"===i)return void(t.classList.contains("manual")&&t.click());t.remove()}}s.src!==t&&(0,A.ZP)(s,t),s.classList.contains("thumbnail")&&s.parentElement.classList.contains("media-container-aspecter")&&s.classList.remove("thumbnail")}}setAuthorInfo(e,t){const i=e.isPeerId();let s;if(i)s=(0,W.Z)({peerId:e,dialog:!1,onlyFirstName:!1,plainText:!1});else{const t=s=document.createElement("span");t.append((0,G.Z)(e)),t.classList.add("peer-title")}const n=this.author.avatarEl,a=this.author.avatarEl=n.cloneNode();return Promise.all([this.author.avatarEl.updateWithOptions({peerId:e||U.NM,peerTitle:i?void 0:""+e}),s]).then((([e,i])=>{this.author.avatarEl===a&&((0,D.Z)(this.author.date,(0,T.OD)(t)),(0,D.Z)(this.author.nameEl,i),n.replaceWith(this.author.avatarEl))}))}_openMedia({media:e,timestamp:t,fromId:i,fromRight:s,target:a,reverse:r=!1,prevTargets:c=[],nextTargets:h=[],message:u,mediaTimestamp:p}){return J(this,void 0,void 0,(function*(){if(this.setMoverPromise)return this.setMoverPromise;const f=this.setAuthorInfo(i,t),m="document"===e._,g=m&&e.mime_type&&(["video","gif"].includes(e.type)||0===e.mime_type.indexOf("video/"));this.isFirstOpen&&(this.isFirstOpen=!1,this.listLoader.setTargets(c,h,r),window.appMediaViewer=this),this.listLoader.next.length<10&&setTimeout((()=>{this.listLoader.load(!0)}),0),this.buttons.prev.classList.toggle("hide",!this.listLoader.previous.length),this.buttons.next.classList.toggle("hide",!this.listLoader.next.length);const v=this.content.media,b=!a||a===v;b&&(a=v),this.target={element:a};const y=++this.tempId;v.firstElementChild&&v.replaceChildren(),0!==s?(this.moveTheMover(this.content.mover,1===s),this.setNewMover()):(this.navigationItem={type:"media",onPop:e=>{if(this.setMoverAnimationPromise)return!1;!e&&o.IS_MOBILE_SAFARI&&this.wholeDiv.remove(),this.close()}},k.Z.pushItem(this.navigationItem),this.toggleOverlay(!0),this.setGlobalListeners(),yield f,this.wholeDiv.parentElement||(this.pageEl.insertBefore(this.wholeDiv,document.getElementById("main-columns")),this.wholeDiv.offsetLeft),this.toggleWholeActive(!0));const w=this.content.mover,S=N.Z.width;let L=0;const I=N.Z.height;I<1e6&&!n.Z.isMobile&&(L=120);const E=I-120-L;let P=Promise.resolve();const Z=(0,j.Z)(e,v,S,E,!n.Z.isMobile,void 0,!!(m&&e.w&&e.h)).photoSize;if(b){const t=yield this.managers.thumbsStorage.getCacheContext(e,Z.type);let i;if(t.downloaded)i=new Image,i.src=t.url;else{const s=(0,z.Z)(e,t,!0);s&&(P=s.loadPromise,i=s.image)}i&&(i.classList.add("thumbnail"),v.append(i))}const M=!(!m||!e.supportsStreaming),T=M?this.preloaderStreamable:this.preloader,x=(t=(null==Z?void 0:Z.type))=>this.managers.thumbsStorage.getCacheContext(e,t);let _;if(g){const t=u&&"gif"!==e.type,i=(0,H.Z)({pip:t});this.wholeDiv.classList.contains("no-forwards")&&i.addEventListener("contextmenu",l.Z);const n=()=>this.setMoverToTarget(a,!1,s).then((({onAnimationEnd:s})=>{const n=w.firstElementChild&&w.firstElementChild.classList.contains("media-viewer-aspecter")?w.firstElementChild:w,r=w.querySelector("video");r&&r.remove(),i.setAttribute("playsinline","true"),i.addEventListener("timeupdate",(()=>{this.tempId!==y&&i.pause()})),this.addEventListener("setMoverAfter",(()=>{i.src="",i.load()}),{once:!0}),o.IS_SAFARI&&(i.autoplay=!0),"gif"===e.type?(i.muted=!0,i.autoplay=!0,i.loop=!0):e.duration<60&&(i.loop=!0),void 0!==p&&(i.currentTime=p),n.append(i);const c=new Promise((e=>{i.addEventListener("canplay",e,{once:!0})})),h=()=>{"gif"!==e.type&&(i.dataset.ckin="default",i.dataset.overlay="1",Promise.all([c,s]).then((()=>{this.tempId===y&&((this.videoPlayer=new C({video:i,play:!0,streamable:M,onPlaybackRackMenuToggle:e=>{this.wholeDiv.classList.toggle("hide-caption",!!e)},onPip:e=>{const s=window.appMediaViewer;if(!e&&s&&s!==this)return this.releaseSingleMedia=void 0,void this.close();this.moversContainer.lastElementChild.classList.toggle("hiding",e),this.toggleWholeActive(!e),this.toggleOverlay(!e),this.toggleGlobalListeners(!e),this.navigationItem&&(e?k.Z.removeItem(this.navigationItem):k.Z.pushItem(this.navigationItem)),t&&(e?(this.releaseSingleMedia(!1),this.releaseSingleMedia=void 0,d.Z.setPictureInPicture(i)):this.releaseSingleMedia=d.Z.setSingleMedia(i,u))},onPipClose:()=>{this.close()}})).addEventListener("toggleControls",(e=>{this.wholeDiv.classList.toggle("has-video-controls",e)})),this.addEventListener("setMoverBefore",(()=>{this.wholeDiv.classList.remove("has-video-controls"),this.videoPlayer.cleanup(),this.videoPlayer=void 0}),{once:!0}),this.isZooming&&this.videoPlayer.lockControls(!1))})))};if(M){s.then((()=>{i.readyState{i.addEventListener("canplay",(()=>{T.detach(),i.parentElement.classList.remove("is-buffering")}),{once:!0})};i.addEventListener("waiting",(()=>{const t=i.networkState===i.NETWORK_LOADING,s=i.readyState{(0,l.Z)(e)})),e()}this.lazyLoadQueue.unshift({load:()=>J(this,void 0,void 0,(function*(){const r=M?Promise.resolve():K.Z.downloadMediaURL({media:e});return M||s.then((()=>J(this,void 0,void 0,(function*(){(yield x()).url||T.attach(w,!0,r)})))),Promise.all([r,s]).then((()=>J(this,void 0,void 0,(function*(){if(this.tempId!==y)return void this.log.warn("media viewer changed video");const e=(yield x()).url;i.addEventListener("error",(()=>{(0,$.bC)({langPackKey:o.IS_MOBILE?"Video.Unsupported.Mobile":"Video.Unsupported.Desktop"}),4!==i.error.code&&this.log.error("Error "+i.error.code+"; details: "+i.error.message),null==T||T.detach()}),{once:!0}),a instanceof SVGSVGElement?n.firstElementChild.lastElementChild.append(i):(0,A.ZP)(i,e),t&&(this.releaseSingleMedia=d.Z.setSingleMedia(i,u),this.addEventListener("setMoverBefore",(()=>{this.releaseSingleMedia&&(this.releaseSingleMedia(),this.releaseSingleMedia=void 0)}),{once:!0})),this.updateMediaSource(a,e,"video"),h()})))),r}))})}));_=P.then(n)}else{const t=()=>this.setMoverToTarget(a,!1,s).then((({onAnimationEnd:t})=>{this.lazyLoadQueue.unshift({load:()=>J(this,void 0,void 0,(function*(){const i=m?K.Z.downloadMediaURL({media:e}):K.Z.downloadMediaURL({media:e,thumb:Z}),s=!m&&e.sizes.slice().filter((e=>e.w));s&&s.sort(((e,t)=>t.size-e.size));const o=null==s?void 0:s[0],r=!m&&o!==Z&&K.Z.downloadMediaURL({media:e,thumb:o});return t.then((()=>J(this,void 0,void 0,(function*(){(yield x()).url||this.preloader.attachPromise(i)})))),Promise.all([t,i]).then((()=>J(this,void 0,void 0,(function*(){var e;if(this.tempId!==y)return void this.log.warn("media viewer changed photo");const t=(yield x()).url;if(a instanceof SVGSVGElement)this.updateMediaSource(a,t,"img"),this.updateMediaSource(w,t,"img"),n.Z.isMobile&&w.querySelectorAll("img").forEach((e=>{e.classList.remove("thumbnail")}));else{const i=w.firstElementChild&&w.firstElementChild.classList.contains("media-viewer-aspecter")?w.firstElementChild:w,s=["CANVAS","IMG"].includes(null===(e=i.firstElementChild)||void 0===e?void 0:e.tagName)?i.firstElementChild:null;if((null==s?void 0:s.src)!==t){const e=new Image;e.classList.add("thumbnail"),(0,A.ZP)(e,t,(()=>{(0,R.T2)((()=>{this.updateMediaSource(a,t,"img"),s&&(0,R.T2)((()=>{s.remove()})),i.append(e)}))}),!1),r&&r.then((t=>{const i=new Image;i.classList.add("thumbnail"),(0,A.ZP)(i,t,(()=>{(0,R.T2)((()=>{e.replaceWith(i)}))}),!1)}))}}})))).catch((e=>{this.log.error(e),this.preloader.attach(w),this.preloader.setManual()})),i}))})}));_=P.then(t)}return this.setMoverPromise=_.catch((()=>{this.setMoverAnimationPromise=null})).finally((()=>{this.setMoverPromise=null}))}))}}},5824:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(410),n=i(4762),a=i(5003),o=i(8799),r=i(3910),d=i(3444),l=i(1655);const c=new class{constructor(){if(this.onPopState=e=>{const t=window.location.hash,i=e.state;if(this.debug&&this.log("popstate",e,this.isPossibleSwipe,t),t!==this.currentHash)if(this.debug&&this.log.warn(`hash changed, new=${t}, current=${this.currentHash}, overridden=${this.overriddenHash}`),i===this.id&&this.overriddenHash&&this.overriddenHash!==t)this.overrideHash(this.overriddenHash);else{if(!i||this.overriddenHash||!t)return this.currentHash=t,void(this.onHashChange&&this.onHashChange());this.overrideHash()}if(i!==this.id&&(this.pushState(),!this.navigations.length))return;const s=this.navigations.pop();s?(this.manual=!this.isPossibleSwipe,this.handleItem(s)):this.pushState()},this.onKeyDown=e=>{const t=this.navigations[this.navigations.length-1];t&&("Escape"!==e.key||t.onEscape&&!t.onEscape()||((0,r.Z)(e),this.back(t.type)))},this.onTouchStart=e=>{e.touches.length>1||(this.debug&&this.log("touchstart"),(0,d.Z)(e)&&(this.isPossibleSwipe=!0,window.addEventListener("touchend",(()=>{setTimeout((()=>{this.isPossibleSwipe=!1}),100)}),{passive:!0,once:!0})))},this.navigations=[],this.id=Date.now(),this.manual=!1,this.log=(0,a.kg)("NC"),this.debug=!0,this.currentHash=window.location.hash,this.overriddenHash="",this.isPossibleSwipe=!1,window.addEventListener("popstate",this.onPopState),window.addEventListener("keydown",this.onKeyDown,{capture:!0,passive:!1}),n.IS_MOBILE_SAFARI){const e={passive:!0};window.addEventListener("touchstart",this.onTouchStart,e)}history.scrollRestoration="manual",this.pushState()}overrideHash(e=""){e&&"#"!==e[0]?e="#"+e:"#"===e&&(e=""),this.currentHash!==e&&(this.overriddenHash=this.currentHash=e,this.replaceState(),this.pushState())}handleItem(e){const t=e.onPop(!!this.manual&&void 0);this.debug&&this.log("popstate, navigation:",e,this.navigations),!1===t?this.pushItem(e):e.noBlurOnPop||(0,o.Z)(),this.manual=!1}findItemByType(e){for(let t=this.navigations.length-1;t>=0;--t){const i=this.navigations[t];if(i.type===e)return{item:i,index:t}}}back(e){if(e){const t=this.findItemByType(e);if(t)return void this.backByItem(t.item,t.index)}history.back()}backByItem(e,t=this.navigations.indexOf(e)){this.manual=!0,this.navigations.splice(t,1),this.handleItem(e)}onItemAdded(e){this.debug&&this.log("onItemAdded",e,this.navigations),e.noHistory||this.pushState()}pushItem(e){this.navigations.push(e),this.onItemAdded(e)}unshiftItem(e){this.navigations.unshift(e),this.onItemAdded(e)}spliceItems(e,t,...i){this.navigations.splice(e,t,...i),i.forEach((e=>{this.onItemAdded(e)}))}pushState(){this.debug&&this.log("push"),this.manual=!1,history.pushState(this.id,"")}replaceState(){this.debug&&this.log.warn("replace");const e=location.origin+location.pathname+location.search+this.overriddenHash;history.replaceState(this.id,"",e)}removeItem(e){e&&(0,l.Z)(this.navigations,e)}removeByType(e,t=!1){for(let i=this.navigations.length-1;i>=0&&(this.navigations[i].type!==e||(this.navigations.splice(i,1),!t));--i);}};s.GO.appNavigationController=c;const h=c},5884:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l,z:()=>d});var s=i(5005),n=i(8805),a=i(5565),o=i(2325),r=i(3512);class d{constructor(e,t,i=!0,n,a=!0,r=!0,d,l){this.name=e,this.type=t,this.clearable=i,this.autonomous=r,this.onFound=d,this.noIcons=l,this.list=s.default.createChatList(),this.container=document.createElement("div"),n&&(this.container.className=n),e&&(this.nameEl=document.createElement("div"),this.nameEl.classList.add("search-group__name"),"string"==typeof e&&this.nameEl.append((0,o.ag)(e)),this.container.append(this.nameEl)),this.container.classList.add("search-group","search-group-"+t),this.container.append(this.list),this.container.style.display="none",a&&s.default.setListClickListener(this.list,d,void 0,r)}clear(){this.container.style.display="none",this.clearable&&(this.list.innerHTML="")}setActive(){this.container.style.display=""}toggle(){this.list.childElementCount?this.setActive():this.clear()}}class l{constructor(e,t,i,s,a){this.container=e,this.searchInput=t,this.searchGroups=i,this.onSearch=s,this.noIcons=a,this.minMsgId=0,this.loadedCount=-1,this.foundCount=-1,this.searchPromise=null,this.searchTimeout=0,this.query="",this.listsContainer=null,this.threadId=0,this.scrollable=new n.ZP(this.container),this.listsContainer=this.scrollable.container;for(const e in this.searchGroups)this.listsContainer.append(this.searchGroups[e].container);this.searchGroups.messages&&this.scrollable.setVirtualContainer(this.searchGroups.messages.list),this.searchInput.onChange=e=>{this.query=e,this.reset(!1),this.searchMore()},this.scrollable.onScrolledBottom=()=>{this.query.trim()&&(this.searchTimeout||(this.searchTimeout=window.setTimeout((()=>{this.searchMore(),this.searchTimeout=0}),0)))}}reset(e=!0){e&&(this.searchInput.value="",this.query="",this.peerId=void 0,this.threadId=0),this.minMsgId=0,this.loadedCount=-1,this.foundCount=-1;for(const e in this.searchGroups)this.searchGroups[e].clear();this.searchPromise=null}beginSearch(e,t=0,i=""){this.peerId=e,this.threadId=t,this.query!==i&&(this.searchInput.inputField.value=i),this.searchInput.input.focus()}searchMore(){if(this.searchPromise)return this.searchPromise;const e=this.query;if(!e.trim())return void(this.onSearch&&this.onSearch(0));if(-1!==this.foundCount&&this.loadedCount>=this.foundCount)return Promise.resolve();const t=this.minMsgId||0;return this.searchPromise=r.Z.managers.appMessagesManager.getSearch({peerId:this.peerId,query:e,inputFilter:{_:"inputMessagesFilterEmpty"},maxId:t,limit:20,threadId:this.threadId}).then((t=>{if(this.searchPromise=null,this.searchInput.value!==e)return;const{count:i,history:n}=t;n.length&&n[0].mid===this.minMsgId&&n.shift();const r=this.searchGroups.messages;n.forEach((t=>{try{const i=this.peerId?t.fromId:t.peerId;s.default.addDialogAndSetLastMessage({peerId:i,container:this.scrollable,avatarSize:"bigger",meAsSaved:!1,message:t,query:e,noIcons:this.noIcons})}catch(e){console.error("[appSearch] render search result",e)}})),r.toggle(),this.minMsgId=n.length&&n[n.length-1].mid,-1===this.loadedCount&&(this.loadedCount=0),this.loadedCount+=n.length,-1===this.foundCount&&(this.foundCount=i,r.nameEl&&(0,a.Z)(r.nameEl,(0,o.ag)(i?"Chat.Search.MessagesFound":"Chat.Search.NoMessagesFound",[i])),this.onSearch&&this.onSearch(this.foundCount))})).catch((e=>{console.error("search error",e),this.searchPromise=null}))}}},6360:(e,t,i)=>{"use strict";i.d(t,{Z:()=>ve});var s=i(5005),n=i(5003),a=i(3512),o=i(5884),r=i(6008),d=i(2153),l=i(279),c=i(1405),h=i(8805),u=i(8594),p=i(2325),f=i(8497),m=i(3624),g=i(2894),v=i(4668),b=i(4332),y=i(4755),w=i(7030),S=i(4484),C=i(467),L=i(5432),I=i(1154),E=i(241),P=i(6272),Z=i(3003),M=i(4524),T=i(5128),k=i(7479),x=i(5705),A=i(6054),_=i(3910),F=i(2738),D=i(1784),R=i(8479),B=i(7401),N=i(5953),O=i(3738),U=i(4064),H=i(130),z=i(9687),j=i(2498),G=i(1336),V=i(5798),K=i(2342),W=i(2491),$=i(5400),q=i(5671),Y=i(1604),Q=i(7530),X=i(6566),J=i(177),ee=i(3061),te=i(2566),ie=i(6976),se=i(3416),ne=i(1483),ae=i(3855),oe=i(3699),re=i(296),de=i(9492),le=i(2887),ce=i(319),he=i(6131),ue=i(2353),pe=i(4499),fe=i(1168),me=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class ge{constructor(e,t,i){this.attachTo=e,this.searchSuper=t,this.listenerSetter=i,this.onGotoClick=()=>{w.ZP.setInnerPeer({peerId:this.peerId,lastMsgId:this.mid,threadId:this.searchSuper.searchContext.threadId})},this.onForwardClick=()=>{this.searchSuper.selection.isSelecting?(0,F.tH)(this.searchSuper.selection.selectionForwardBtn):fe.Z.createPopup(M.Z,{[this.peerId]:[this.mid]})},this.onSelectClick=()=>{this.searchSuper.selection.toggleByElement(this.target)},this.onClearSelectionClick=()=>{this.searchSuper.selection.cancelSelection()},this.onDeleteClick=()=>{this.searchSuper.selection.isSelecting?(0,F.tH)(this.searchSuper.selection.selectionDeleteBtn):fe.Z.createPopup(T.Z,this.peerId,[this.mid],"chat")},this.managers=t.managers;L.Z||(0,ie.E)({element:e,callback:e=>{let i;this.init&&(this.init(),this.init=null);try{i=(0,f.Z)(e.target,"search-super-item")}catch(e){}if(i){if(e instanceof MouseEvent&&e.preventDefault(),this.element.classList.contains("active"))return!1;e instanceof MouseEvent&&(e.cancelBubble=!0),(()=>{me(this,void 0,void 0,(function*(){this.target=i,this.peerId=i.dataset.peerId.toPeerId(),this.mid=+i.dataset.mid,this.isSelected=t.selection.isMidSelected(this.peerId,this.mid),this.message=yield this.managers.appMessagesManager.getMessageByPeer(this.peerId,this.mid),this.noForwards=t.selection.isSelecting?this.searchSuper.selection.selectionForwardBtn.classList.contains("hide"):!(yield this.managers.appMessagesManager.canForward(this.message)),this.selectedMessages=t.selection.isSelecting?yield t.selection.getSelectedMessages():void 0,yield Promise.all(this.buttons.map((e=>me(this,void 0,void 0,(function*(){let t;t=!(this.searchSuper.selection.isSelecting&&!e.withSelection||e.verify&&!(yield e.verify())),e.element.classList.toggle("hide",!t)}))))),i.classList.add("menu-open"),(0,ne.Z)(e,this.element),se.Z.openBtnMenu(this.element,(()=>{i.classList.remove("menu-open")}))}))})()}},listenerSetter:i})}init(){this.buttons=[{icon:"forward",text:"Forward",onClick:this.onForwardClick,verify:()=>!this.noForwards},{icon:"forward",text:"Message.Context.Selection.Forward",onClick:this.onForwardClick,verify:()=>this.searchSuper.selection.isSelecting&&!this.noForwards,withSelection:!0},{icon:"download",text:"MediaViewer.Context.Download",onClick:()=>pe.Z.onDownloadClick(this.message,this.noForwards),verify:()=>!this.searchSuper.selection.isSelecting&&pe.Z.canDownload(this.message,void 0,this.noForwards)},{icon:"download",text:"Message.Context.Selection.Download",onClick:()=>pe.Z.onDownloadClick(this.selectedMessages,this.noForwards),verify:()=>this.searchSuper.selection.isSelecting&&pe.Z.canDownload(this.selectedMessages,void 0,this.noForwards),withSelection:!0},{icon:"message",text:"Message.Context.Goto",onClick:this.onGotoClick,withSelection:!0},{icon:"select",text:"Message.Context.Select",onClick:this.onSelectClick,verify:()=>!this.isSelected,withSelection:!0},{icon:"select",text:"Message.Context.Selection.Clear",onClick:this.onClearSelectionClick,verify:()=>this.isSelected,withSelection:!0},{icon:"delete danger",text:"Delete",onClick:this.onDeleteClick,verify:()=>!this.searchSuper.selection.isSelecting&&this.managers.appMessagesManager.canDeleteMessage(this.message)},{icon:"delete danger",text:"Message.Context.Selection.Delete",onClick:this.onDeleteClick,verify:()=>this.searchSuper.selection.isSelecting&&!this.searchSuper.selection.selectionDeleteBtn.classList.contains("hide"),withSelection:!0}],this.element=(0,Z.b)({buttons:this.buttons,listenerSetter:this.listenerSetter}),this.element.classList.add("search-contextmenu","contextmenu"),document.getElementById("page-chats").append(this.element)}}class ve{constructor(e){this.tabs={},this.prevTabId=-1,this.lazyLoadQueue=new d.Z,this.middleware=(0,m.k)(),this.historyStorage={},this.usedFromHistory={},this.loadMutex=Promise.resolve(),this.nextRates={},this.loadPromises={},this.loaded={},this.loadedChats=!1,this.firstLoad=!0,this.log=(0,n.kg)("SEARCH-SUPER"),this.monthContainers={},this.mediaTabsMap=new Map,this.asChatList=!1,this.groupByMonth=!0,this.hideEmptyTabs=!0,this.showSender=!1,this.onTransitionStart=()=>{this.container.classList.add("sliding")},this.onTransitionEnd=()=>{this.container.classList.remove("sliding")},(0,N.Z)(this,e),this.container=document.createElement("div"),this.container.classList.add("search-super"),this.listenerSetter=new oe.Z,this.searchContextMenu=new ge(this.container,this,this.listenerSetter),this.selection=new A.e(this,this.managers,this.listenerSetter);const t=this.navScrollableContainer=document.createElement("div");t.classList.add("search-super-tabs-scrollable","menu-horizontal-scrollable","sticky");const i=this.navScrollable=new h.v7(t);i.container.classList.add("search-super-nav-scrollable");const s=this.nav=document.createElement("nav");s.classList.add("search-super-tabs","menu-horizontal-div"),this.tabsMenu=s,i.container.append(s);for(const e of this.mediaTabs){const t=document.createElement("div");t.classList.add("menu-horizontal-div-item");const i=document.createElement("span"),s=document.createElement("i");i.append((0,p.ag)(e.name)),i.append(s),t.append(i),(0,c.Z)(t),this.tabsMenu.append(t),this.mediaTabsMap.set(e.type,e),e.menuTab=t}let a;this.tabsContainer=document.createElement("div"),this.tabsContainer.classList.add("search-super-tabs-container","tabs-container"),L.Z&&(this.swipeHandler=(0,I.Z)({element:this.tabsContainer,onSwipe:(e,t,i)=>{e*=-1;const s=this.selectTab.prevId(),n=Array.from(this.tabsMenu.children);let o;if(e>0){for(let e=s+1;e=0;--e)if(!n[e].classList.contains("hide")){o=e;break}void 0!==o&&(a=function(e){const t=e=>{(0,_.Z)(e)};let i=2;const s=()=>{--i||e.removeEventListener("touchmove",t,{capture:!0})};return e.addEventListener("touchmove",t,{capture:!0,passive:!1}),e.addEventListener("touchend",s,{once:!0}),s}(this.tabsContainer),this.selectTab(o))},verifyTouchTarget:e=>!(0,f.Z)(e.target,"scrollable-x")}));for(const e of this.mediaTabs){const t=document.createElement("div");t.classList.add("search-super-container-"+e.type,"tabs-tab");const i=document.createElement("div");i.classList.add("search-super-content-"+e.type),t.append(i),this.tabsContainer.append(t),this.tabs[e.inputFilter]=i,e.contentTab=i}this.container.append(t,this.tabsContainer),this.searchGroupMedia=new o.z(!1,"messages",!0),this.scrollable.onScrolledBottom=()=>{this.mediaTab.contentTab&&this.canLoadMediaTab(this.mediaTab)&&this.load(!0)},this.selectTab=(0,r.X)(this.tabsMenu,this.tabsContainer,((e,t,i)=>{if(this.prevTabId===e&&!this.skipScroll)return void this.scrollable.scrollIntoViewNew({element:this.container,position:"start",startCallback:this.scrollStartCallback});const s=this.mediaTabs[e];this.onChangeTab&&this.onChangeTab(s);const n=this.mediaTab;if(this.mediaTab=s,-1!==this.prevTabId&&i&&this.onTransitionStart(),this.skipScroll)this.skipScroll=!1;else{const e=this.container.offsetTop;let t=this.scrollable.scrollTop;if(tn&&(s.scroll={scrollTop:n,scrollHeight:0})}if(s.scroll){const e=n.scroll.scrollTop-s.scroll.scrollTop;e&&(s.contentTab.style.transform=`translateY(${e}px)`)}}-1===this.prevTabId||s.contentTab.childElementCount||this.load(!0),this.prevTabId=e}),(()=>{this.scrollable.onScroll(),void 0!==this.mediaTab.scroll&&(this.mediaTab.contentTab.style.transform="",this.scrollable.scrollTop=this.mediaTab.scroll.scrollTop),a&&(a(),a=void 0),this.onTransitionEnd()}),void 0,i,this.listenerSetter),(0,F.fc)(this.tabsContainer,(e=>{this.selection.isSelecting&&((0,_.Z)(e),this.selection.toggleByElement((0,f.Z)(e.target,"search-super-item")))}),{capture:!0,passive:!1,listenerSetter:this.listenerSetter});const l=(e,t,i,s)=>me(this,void 0,void 0,(function*(){const n=(0,f.Z)(s.target,e);if(!n)return;const a=+n.dataset.mid;if(!a)return void this.log.warn("no messageId by click on target:",n);const o=n.querySelector(".media-spoiler-container");if(o)return void(0,he.kN)({event:s,mediaSpoiler:o});const r=n.dataset.peerId.toPeerId(),d=Array.from(this.tabs[i].querySelectorAll("."+t)).map((t=>{const i=(0,f.Z)(t,e);return{element:t,mid:+i.dataset.mid,peerId:i.dataset.peerId.toPeerId()}})),l=d.findIndex((e=>e.mid===a&&e.peerId===r)),c=yield this.managers.appMessagesManager.getMessageByPeer(r,a);(new D.Z).setSearchContext(this.copySearchContext(i)).openMedia({message:c,target:d[l].element,fromRight:0,reverse:!1,prevTargets:d.slice(0,l),nextTargets:d.slice(l+1)})}));(0,F.fc)(this.tabs.inputMessagesFilterPhotoVideo,l.bind(null,"grid-item","grid-item","inputMessagesFilterPhotoVideo"),{listenerSetter:this.listenerSetter}),(0,F.fc)(this.tabs.inputMessagesFilterDocument,l.bind(null,"document-with-thumb","media-container","inputMessagesFilterDocument"),{listenerSetter:this.listenerSetter}),this.mediaTab=this.mediaTabs[0],(0,u.ZP)((()=>{this.lazyLoadQueue.lock()}),(()=>{this.lazyLoadQueue.unlockAndRefresh()}),this.listenerSetter)}filterMessagesByType(e,t){return(0,X.Z)(t,e,e.length)}processEmptyFilter({message:e,searchGroup:t}){const i=[],n=s.default.addDialogNew({peerId:e.peerId,container:t.list,avatarSize:"bigger",loadPromises:i}),a=s.default.setLastMessageN({dialog:{_:"dialog",peerId:e.peerId},lastMessage:e,dialogElement:n,highlightWord:this.searchContext.query});return i.push(a),Promise.all(i).then(ce.Z)}processPhotoVideoFilter({message:e,promises:t,middleware:i}){return me(this,void 0,void 0,(function*(){const s=(0,Q.Z)(e,!0),n=document.createElement("div");let a;n.classList.add("grid-item");const o=(0,z.Z)(s,200,200);if(a="photo"!==s._?yield(yield(0,le.Z)({doc:s,message:e,container:n,boxWidth:0,boxHeight:0,lazyLoadQueue:this.lazyLoadQueue,middleware:i,onlyPreview:!0,withoutPreloader:!0,noPlayButton:!0,photoSize:o})).thumb:yield(0,de.Z)({photo:s,message:e,container:n,boxWidth:0,boxHeight:0,lazyLoadQueue:this.lazyLoadQueue,middleware:i,withoutPreloader:!0,noBlur:!0,size:o}),e.media.pFlags.spoiler){const e=yield(0,he.ZP)({animationGroup:"chat",media:s,middleware:i,width:140,height:140,multiply:.3});n.append(e)}return[a.images.thumb,a.images.full].filter(Boolean).forEach((e=>{e.classList.add("grid-item-media")})),t.push(a.loadPromises.thumb),{element:n,message:e}}))}processDocumentFilter({message:e,inputFilter:t}){return me(this,void 0,void 0,(function*(){const i=(0,Q.Z)(e,!0),s=this.showSender||["voice","round"].includes(i.type),n=yield(0,re.Z)({message:e,withTime:!s,fontWeight:400,voiceAsMusic:!0,showSender:s,searchContext:this.copySearchContext(t),lazyLoadQueue:this.lazyLoadQueue,autoDownloadSize:0,getSize:()=>320});return["audio","voice","round"].includes(i.type)&&n.classList.add("audio-48"),{message:e,element:n}}))}processUrlFilter({message:e,promises:t,middleware:i}){var s;return me(this,void 0,void 0,(function*(){let n=null===(s=e.media)||void 0===s?void 0:s.webpage;if(!n){const t=e.totalEntities?e.totalEntities.find((e=>"messageEntityUrl"===e._||"messageEntityTextUrl"===e._)):null;let i,s,a;if(t)a=e.message.slice(t.offset,t.offset+t.length);else{const t=(0,K.Z)(e.message);if(!t)return;i=t[0]}i="messageEntityTextUrl"===(null==t?void 0:t._)?t.url:i||a,s=i;const o=e.message===i;i.match(/^(ftp|http|https):\/\//)||(s="https://"+i,i=i.includes("@")?i:"https://"+i),s=new URL(s).hostname,n={_:"webPage",url:i,display_url:s,id:"",hash:0},o||(n.description=e.message)}if("webPageEmpty"===n._)return;const a=document.createElement("div");a.classList.add("preview"),n.photo?(0,de.Z)({container:a,message:null,photo:n.photo,boxWidth:0,boxHeight:0,withoutPreloader:!0,lazyLoadQueue:this.lazyLoadQueue,middleware:i,size:(0,z.Z)(n.photo,60,60,!1),loadPromises:t,noBlur:!0}):(a.classList.add("empty"),(0,H.Z)(a,(0,V.Z)(n.title||n.display_url||n.description||n.url,!0)));const o=(0,G.Z)(n),r=(0,j.Z)(n),d=(0,x.Z)((0,$.ZP)(n.url||"")).firstElementChild;if(d instanceof HTMLAnchorElement)try{d.innerText=decodeURIComponent(d.href)}catch(e){}r.firstChild&&r.append("\n"),r.append(d),this.showSender&&r.append("\n",yield(0,q.Z)(e)),o.textContent||o.append((0,W.Z)(n.display_url.split("/",1)[0]));const l=new k.ZP({title:o,titleRight:(0,Y.Z)(e),subtitle:r,havePadding:!0,clickable:!0,noRipple:!0});return l.applyMediaElement(a,"big"),l.container.innerText.trim().length?{message:e,element:l.container}:void 0}))}performSearchResult(e,t,i=!0){return me(this,void 0,void 0,(function*(){const s=[],n=t.contentTab,a=[],o=this.middleware.get();let r,d=t.inputFilter;yield(0,u.e9)(),"inputMessagesFilterPhotoVideo"===d&&this.searchContext.query.trim()?(d="inputMessagesFilterEmpty",r=this.searchGroupMedia,n.append(r.container)):"inputMessagesFilterEmpty"===d&&(r=this.searchGroups.messages);const l={elemsToAppend:s,inputFilter:d,message:void 0,middleware:o,promises:a,searchGroup:r};let c;switch(d){case"inputMessagesFilterEmpty":c=this.processEmptyFilter;break;case"inputMessagesFilterPhotoVideo":c=this.processPhotoVideoFilter;break;case"inputMessagesFilterVoice":case"inputMessagesFilterRoundVoice":case"inputMessagesFilterMusic":case"inputMessagesFilterDocument":c=this.processDocumentFilter;break;case"inputMessagesFilterUrl":c=this.processUrlFilter}if(c){c=c.bind(this);const t=e.map((e=>me(this,void 0,void 0,(function*(){try{return l.message=e,yield c(l)}catch(t){this.log.error("error rendering filter",d,l,e,t)}})))),i=(yield Promise.all(t)).filter(Boolean);s.push(...i)}if(r&&r.list.childElementCount&&r.setActive(),this.loadMutex&&a.push(this.loadMutex),!a.length||(yield Promise.all(a),o())){if(s.length){const e=i?"append":"prepend";s.forEach((t=>{var i;const{element:s,message:n}=t,a=this.getMonthContainerByTimestamp(this.groupByMonth?n.date:0,d);s.classList.add("search-super-item"),s.dataset.mid=""+n.mid,s.dataset.peerId=""+n.peerId,a.items[e](s),(null===(i=this.selection)||void 0===i?void 0:i.isSelecting)&&this.selection.toggleElementCheckbox(s,!0)}))}this.afterPerforming("inputMessagesFilterEmpty"===d?1:s.length,n)}}))}afterPerforming(e,t){if(t){const i=t.parentElement;if(Array.from(i.children).slice(1).forEach((e=>{e.remove()})),!e&&!t.childElementCount){const e=document.createElement("div");e.innerText="Nothing interesting here yet...",e.classList.add("position-center","text-center","content-empty","no-select"),i.append(e)}}}loadChats(){const e=new Set,t=this.middleware.get();for(const e in this.searchGroups){const t=this.searchGroups[e];this.tabs.inputMessagesFilterEmpty.append(t.container),t.clear()}const i=this.searchContext.query;if(i){const n=(t,n,o=!1)=>{t.map((t=>{if(e.has(t))return;e.add(t);const{dom:i}=s.default.addDialogNew({peerId:t,container:n.list,avatarSize:"abitbigger",autonomous:n.autonomous});return{dom:i,peerId:t}})).filter(Boolean).forEach((({dom:e,peerId:t})=>me(this,void 0,void 0,(function*(){const s=yield this.managers.appPeersManager.getPeer(t);if(o&&(s.participants_count||s.participants)){const s=new RegExp(`(${(0,O.Z)(i)}|${(0,O.Z)((0,C.ZP)(i))})`,"gi");e.titleSpan.innerHTML=e.titleSpan.innerHTML.replace(s,"$1"),e.lastMessageSpan.append(yield(0,J.Z)(t.toChatId()))}else if(t===a.Z.myId)e.lastMessageSpan.append((0,p.ag)("Presence.YourChat"));else{let i=yield this.managers.appPeersManager.getPeerUsername(t);if(i)i="@"+i;else{const e=yield this.managers.appUsersManager.getUser(t);e&&e.phone&&(i="+"+(0,P.u)(e.phone).formatted)}e.lastMessageSpan.textContent=i}})))),n.toggle()},o=e=>{if(t())return e};return Promise.all([this.managers.appUsersManager.getContactsPeerIds(i,!0,void 0,10).then(o).then((e=>{e&&n(e,this.searchGroups.contacts,!0)})),this.managers.appUsersManager.searchContacts(i,20).then(o).then((e=>{if(e&&(n(e.my_results,this.searchGroups.contacts,!0),n(e.results,this.searchGroups.globalContacts),this.searchGroups.globalContacts.container.classList.add("is-short"),this.searchGroups.globalContacts.nameEl.lastElementChild!==this.searchGroups.globalContacts.nameEl.firstElementChild&&this.searchGroups.globalContacts.nameEl.lastElementChild.remove(),this.searchGroups.globalContacts.list.childElementCount>3)){const e=document.createElement("div");e.classList.add("search-group__show-more");const t=new p.ZP.IntlElement({key:"Separator.ShowMore"});e.append(t.element),this.searchGroups.globalContacts.nameEl.append(e),(0,F.fc)(e,(()=>{const e=this.searchGroups.globalContacts.container.classList.toggle("is-short");t.key=e?"Separator.ShowMore":"Separator.ShowLess",t.update()}))}})),this.managers.dialogsStorage.getDialogs({query:i,offsetIndex:0,limit:20,filterId:0}).then(o).then((e=>{e&&n(e.dialogs.map((e=>e.peerId)),this.searchGroups.contacts,!0)}))])}if(this.searchContext.peerId||this.searchContext.minDate)return Promise.resolve();{const e=(e=!0)=>ae.Z.getState().then((i=>{t()&&(this.searchGroups.recent.list.replaceChildren(),i.recentSearch.slice(0,20).forEach((e=>me(this,void 0,void 0,(function*(){const{dom:t}=s.default.addDialogNew({peerId:e,container:this.searchGroups.recent.list,meAsSaved:!0,avatarSize:"abitbigger",autonomous:!0});t.lastMessageSpan.append(yield e.isUser()?(0,ee.Z)(yield this.managers.appUsersManager.getUser(e.toUserId())):(0,J.Z)(e.toChatId()))})))),i.recentSearch.length?e&&this.searchGroups.recent.setActive():this.searchGroups.recent.clear())}));return Promise.all([this.managers.appUsersManager.getTopPeers("correspondents").then((e=>{if(!t())return;const i=e.findIndex((e=>e.id===a.Z.myId));-1!==i&&(e=e.slice()).splice(i,1),e.forEach((e=>{const{dom:t}=s.default.addDialogNew({peerId:e.id,container:this.searchGroups.people.list,onlyFirstName:!0,avatarSize:"bigger",autonomous:!1,noIcons:this.searchGroups.people.noIcons});t.subtitleEl.remove()})),this.searchGroups.people.toggle()})),e()])}}loadMembers(e){return me(this,void 0,void 0,(function*(){const t="members"===e.type?this.searchContext.peerId.toChatId():void 0,i="groups"===e.type?this.searchContext.peerId.toUserId():void 0,n=this.middleware.get();let a;const o=a=>me(this,void 0,void 0,(function*(){if(this.loadMutex&&(yield this.loadMutex,!n()))return;let o=this.membersList;o||(o=this.membersList=new g.Z({lazyLoadQueue:this.lazyLoadQueue,rippleEnabled:!1,managers:this.managers}),(0,F.fc)(o.list,(e=>{const t=(0,v.Z)(e.target,s.DIALOG_LIST_ELEMENT_TAG);if(!t)return;const i=t.dataset.peerId.toPeerId();let n=Promise.resolve();y.Z.isMobile&&(n=b.ZP.toggleSidebar(!1)),n.then((()=>{w.ZP.setInnerPeer({peerId:i})}))})),e.contentTab.append(o.list),this.afterPerforming(1,e.contentTab));const r=a.map((e=>{const s=i?e.id.toPeerId(!0):(0,te.Z)(e);if(!(t?s.isAnyChat():s.isUser()))return s})).filter(Boolean),d=yield(0,ue.Z)(r,(e=>me(this,void 0,void 0,(function*(){const t=yield this.managers.appPeersManager.getPeer(e);return!!n()&&!(!t||t.pFlags.deleted)}))));for(const e of d)o.add(e)}));if(i){const t=this.membersList?200:50;a=this.managers.appUsersManager.getCommonChats(i,t,this.nextRates[e.inputFilter]).then((i=>{if(!n())return;const s=i.chats[i.chats.length-1];return this.nextRates[e.inputFilter]=null==s?void 0:s.id,i.chats.length{if(!n())return;const s=e.contentTab.firstElementChild;return this.nextRates[e.inputFilter]=(s?s.childElementCount:0)+t.participants.length,t.participants.length{if(!n())return;this.loaded[e.inputFilter]=!0;const i=t.participants;return"chatParticipantsForbidden"!==i._?o(i.participants):void 0}));return this.loadPromises[e.inputFilter]=a.finally((()=>{n()&&(this.loadPromises[e.inputFilter]=null)}))}))}loadType(e,t,i,s){var n,a;const o=e.inputFilter;if(this.loadPromises[o])return this.loadPromises[o];if("members"===e.type||"groups"===e.type)return this.loadMembers(e);const r=null!==(n=(a=this.historyStorage)[o])&&void 0!==n?n:a[o]=[];if(!("inputMessagesFilterEmpty"!==o||r.length||(this.loadedChats||(this.loadChats(),this.loadedChats=!0),this.searchContext.query.trim()||this.searchContext.peerId||this.searchContext.minDate)))return this.loaded[o]=!0,Promise.resolve();const d=this.loadPromises[o]=Promise.resolve().then((()=>me(this,void 0,void 0,(function*(){var n,a;if(r.length&&this.usedFromHistory[o]this.managers.appMessagesManager.getMessageByPeer(e.peerId,e.mid))));t.push(...this.filterMessagesByType(a,o))}while(n{setTimeout((()=>{this.scrollable.checkForTriggers()}),0)}))}const l=r.length?r[r.length-1].mid:0,c=yield this.managers.appMessagesManager.getSearch(Object.assign(Object.assign({},this.searchContext),{inputFilter:{_:o},maxId:l,limit:i,nextRate:null!==(n=(a=this.nextRates)[o])&&void 0!==n?n:a[o]=0}));if(r.push(...c.history.map((e=>({mid:e.mid,peerId:e.peerId})))),s()&&((c.history.length{setTimeout((()=>{if(s()&&this.mediaTab===e){const e=this.load(!0,!0);e&&e.then((()=>{s()&&setTimeout((()=>{this.scrollable.checkForTriggers()}),0)}))}}),0)})),this.performSearchResult(this.filterMessagesByType(c.history,o),e)})))).catch((e=>{this.log.error("load error:",e)})).finally((()=>{this.loadPromises[o]=null}));return d}canLoadMediaTab(e){const t=e.inputFilter;return!this.loaded[t]||this.historyStorage[t]&&this.usedFromHistory[t]"inputMessagesFilterEmpty"!==e.inputFilter)),n=s.map((e=>({_:e.inputFilter}))),[a,o,r]=yield Promise.all([this.managers.appMessagesManager.getSearchCounters(t,n,void 0,i),this.canViewMembers(),this.canViewGroups()]);if(!e())return;if(this.loadMutex&&(yield this.loadMutex,!e()))return;let d,l=0;s.forEach((e=>{const t=a.find((t=>t.filter._===e.inputFilter));e.menuTab.classList.toggle("hide",!t.count),e.menuTab.classList.remove("active"),t.count&&(void 0===d&&(d=e),++l)}));const c=this.mediaTabsMap.get("members");[[c,o],[this.mediaTabsMap.get("groups"),r]].forEach((([e,t])=>{e&&(e.menuTab.classList.toggle("hide",!t),t&&++l)})),o&&(d=c),this.container.classList.toggle("hide",!d),this.container.parentElement.classList.toggle("search-empty",!d),d&&(this.skipScroll=!0,this.selectTab(this.mediaTabs.indexOf(d),!1),this.navScrollableContainer.classList.toggle("hide",l<=1))}))}load(e=!1,t=!1){var i;return me(this,void 0,void 0,(function*(){const s=this.searchContext.peerId;this.log("load",e,s,this.loadPromises);const n=this.middleware.get();if(this.firstLoad){if(yield null!==(i=this.loadFirstTimePromise)&&void 0!==i?i:this.loadFirstTimePromise=this.loadFirstTime(),!n())return;this.loadFirstTimePromise=void 0,this.firstLoad=!1}let a=e?[this.mediaTab]:this.mediaTabs.filter((e=>e!==this.mediaTab));if(a=a.filter((e=>this.canLoadMediaTab(e))),s.isUser()?(0,U.Z)(a,(e=>"members"===e.type)):(0,U.Z)(a,(e=>"groups"===e.type)),!a.length)return;const o=t?50:Math.round(3*(E.Z.height/130|0)*1.25),r=a.map((e=>this.loadType(e,t,o,n)));return Promise.all(r).catch((e=>{this.log.error("Load error all promises:",e)}))}))}getMonthContainerByTimestamp(e,t){var i;const s=new Date(1e3*e);s.setHours(0,0,0),s.setDate(1);const n=s.getTime(),a=null!==(i=this.monthContainers[t])&&void 0!==i?i:this.monthContainers[t]={};if(!(n in a)){const e=document.createElement("div");e.className="search-super-month";const i=document.createElement("div");i.classList.add("search-super-month-name");const o={month:"long"};s.getFullYear()!==(new Date).getFullYear()&&(o.year="numeric");const r=new p.ZP.IntlDateElement({date:s,options:o}).element;i.append(r),e.append(i);const d=document.createElement("div");d.classList.add("search-super-month-items"),e.append(i,d);const l=(0,B.Z)(a,"desc");let c=0;for(;cl[c]);++c);a[n]={container:e,items:d},(0,S.Z)(e,this.tabs[t],c)}return a[n]}canViewMembers(){const{peerId:e}=this.searchContext;if(!e.isAnyChat()||!this.mediaTabsMap.has("members"))return Promise.resolve(!1);const t=e.toChatId();return Promise.all([this.managers.appChatsManager.isBroadcast(t),this.managers.appChatsManager.hasRights(t,"view_participants"),this.managers.appChatsManager.isForum(t)]).then((([e,t,i])=>!e&&t&&(!this.searchContext.threadId||!i)))}canViewGroups(){return me(this,void 0,void 0,(function*(){const{peerId:e}=this.searchContext;return!(!e.isUser()||!this.mediaTabsMap.has("groups"))&&!!(yield this.managers.appProfileManager.getProfile(e.toUserId())).common_chats_count}))}cleanup(){var e;this.loadPromises={},this.loaded={},this.loadedChats=!1,this.nextRates={},this.firstLoad=!0,this.prevTabId=-1,this.lazyLoadQueue.clear(),this.mediaTabs.forEach((e=>{this.usedFromHistory[e.inputFilter]=-1})),(null===(e=this.selection)||void 0===e?void 0:e.isSelecting)&&this.selection.cancelSelection(),this.middleware.clean(),this.loadFirstTimePromise=void 0,this.cleanScrollPositions(),this.membersList=void 0}cleanScrollPositions(){this.mediaTabs.forEach((e=>{e.scroll=void 0}))}cleanupHTML(e=!1){this.mediaTabs.forEach((e=>{if(e.contentTab.replaceChildren(),this.hideEmptyTabs&&(this.container.classList.add("hide"),this.container.parentElement.classList.add("search-empty")),"chats"!==e.type&&!this.historyStorage[e.inputFilter]){const t=e.contentTab.parentElement;t.querySelector(".preloader")||(0,l.y)(t,!0);const i=t.querySelector(".content-empty");i&&i.remove()}})),this.monthContainers={},this.searchGroupMedia.clear(),this.scrollable.scrollTop=0}copySearchContext(e){const t=(0,R.Z)(this.searchContext);return t.inputFilter={_:e},t.nextRate=this.nextRates[e],t}setQuery({peerId:e,query:t,threadId:i,historyStorage:s,folderId:n,minDate:a,maxDate:o}){this.searchContext={peerId:e,query:t||"",inputFilter:{_:this.mediaTab.inputFilter},threadId:i,folderId:n,minDate:a,maxDate:o},this.historyStorage=null!=s?s:{},this.cleanup()}destroy(){var e,t;this.cleanup(),this.listenerSetter.removeAll(),this.scrollable.destroy(),null===(e=this.swipeHandler)||void 0===e||e.removeListeners(),null===(t=this.selection)||void 0===t||t.cleanup(),this.scrollStartCallback=void 0,this.onChangeTab=void 0,this.selectTab=void 0,this.searchContextMenu=void 0,this.swipeHandler=void 0,this.selection=void 0}}},5644:(e,t,i)=>{"use strict";i.d(t,{Z:()=>_});var s=i(5005),n=i(3512),a=i(8805),o=i(4789),r=i(9807),d=i(2325),l=i(8763),c=i(8497),h=i(8842),u=i(3910),p=i(5565),f=i(5701),m=i(241),g=i(2738),v=i(6690),b=i(1655),y=i(5953),w=i(4064),S=i(9331),C=i(2353),L=i(2566),I=i(177),E=i(3061),P=i(8493),Z=i(7120),M=i(8050),T=i(36),k=i(5029),x=i(5994),A=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class _{constructor(e){this.container=document.createElement("div"),this.list=s.default.createChatList(),this.chatsContainer=document.createElement("div"),this.selected=new Set,this.freezed=!1,this.folderId=0,this.offsetIndex=0,this.query="",this.loadedWhat={},this.renderedPeerIds=new Set,this.peerType=["dialogs"],this.multiSelect=!0,this.rippleEnabled=!0,this.avatarSize="abitbigger",this.exceptSelf=!1,this.tempIds={},this.selfPresence="Presence.YourChat",this.needSwitchList=!1,this.design="round",this.onInput=()=>{const e=this.input.value;if(this.query!==e){(this.peerType.includes("contacts")||this.peerType.includes("dialogs"))&&(this.cachedContacts=void 0),this.peerType.includes("dialogs")&&(this.folderId=0,this.offsetIndex=0);for(const e in this.tempIds)++this.tempIds[e];this.list=s.default.createChatList(),this.promise=void 0,this.loadedWhat={},this.query=e,this.renderedPeerIds.clear(),this.needSwitchList=!0,this.getMoreResults()}},this.checkForTriggers=()=>{this.scrollable.checkForTriggers()},(0,y.Z)(this,e),this.container.classList.add("selector","selector-"+this.design);const t=(this.renderResultsFunc||this.renderResults).bind(this);if(this.renderResultsFunc=e=>A(this,void 0,void 0,(function*(){return this.needSwitchList&&(this.scrollable.splitUp.replaceWith(this.list),this.scrollable.setVirtualContainer(this.list),this.needSwitchList=!1),e=e.filter((e=>{const t=!this.renderedPeerIds.has(e);return t&&this.renderedPeerIds.add(e),t})),this.filterPeerTypeBy&&(e=yield(0,C.Z)(e,(e=>A(this,void 0,void 0,(function*(){if(e.isPeerId()&&(yield this.managers.appPeersManager.getPeer(e)))for(const t of this.filterPeerTypeBy)if(yield this.managers.appPeersManager[t](e))return!0;return!0}))))),t(e)})),this.input=document.createElement("input"),this.input.classList.add("selector-search-input"),this.placeholder?(0,d.$d)(this.input,this.placeholder,void 0,"placeholder"):(0,d.$d)(this.input,"SendMessageTo",void 0,"placeholder"),this.input.type="text",this.multiSelect){const e=new k.Z({});e.innerContainer.classList.add("selector-search-section");const t=document.createElement("div");t.classList.add("selector-search-container"),this.selectedContainer=document.createElement("div"),this.selectedContainer.classList.add("selector-search"),this.selectedContainer.append(this.input),t.append(this.selectedContainer),this.selectedScrollable=new a.ZP(t),(0,g.fc)(this.selectedContainer,(e=>{if(this.freezed)return;let t=e.target;if(t=(0,c.Z)(t,"selector-user"),!t)return;const i=t.dataset.key,s=this.chatsContainer.querySelector('[data-peer-id="'+i+'"]');s?(0,g.tH)(s):this.remove(i.toPeerId())})),e.content.append(t),this.container.append(e.container)}this.chatsContainer.classList.add("chatlist-container");const i=new k.Z({name:this.sectionNameLangPackKey,noShadow:!0});i.content.append(this.list),this.chatsContainer.append(i.container),this.scrollable=new a.ZP(this.chatsContainer),this.scrollable.setVirtualContainer(this.list),(0,g.fc)(this.chatsContainer,(e=>{const t=(0,l.Z)(e.target,"data-peer-id");if((0,u.Z)(e),!t)return;if(this.freezed)return;let i=t.dataset.peerId;if(i=i.isPeerId()?i.toPeerId():i,!this.multiSelect)return void this.add(i);this.selected.has(i)?this.remove(i):this.add(i);const s=t.querySelector("input");s.checked=!s.checked}));const n=(0,f.Z)(this.onInput,200,!1,!0);this.input.addEventListener("input",n),this.scrollable.onScrolledBottom=()=>{this.getMoreResults()},this.scrollable.container.prepend((0,T.G)()),this.container.append(this.chatsContainer),this.appendTo.append(this.container),setTimeout((()=>{const t=this.getMoreResults();e.onFirstRender&&t.then((()=>{e.onFirstRender()}))}),0)}renderSaved(){return A(this,void 0,void 0,(function*(){this.exceptSelf||this.offsetIndex||0!==this.folderId||!this.peerType.includes("dialogs")||this.query&&!(yield this.managers.appUsersManager.testSelfSearch(this.query))||(yield this.renderResultsFunc([n.Z.myId]))}))}getTempId(e){var t,i;null!==(t=(i=this.tempIds)[e])&&void 0!==t||(i[e]=0);const s=++this.tempIds[e];return{tempId:s,middleware:()=>this.tempIds[e]===s}}getMoreDialogs(){return A(this,void 0,void 0,(function*(){if(this.loadedWhat.dialogs&&this.loadedWhat.archived)return;const e=m.Z.height/56*1.25|0,{middleware:t}=this.getTempId("dialogs"),i=this.managers.dialogsStorage.getDialogs({query:this.query,offsetIndex:this.offsetIndex,limit:e,filterId:this.folderId,skipMigrated:!0});i.catch((()=>{t()&&(this.loadedWhat[this.loadedWhat.dialogs?"archived":"dialogs"]=!0)}));const s=yield i;if(!t())return;let a=s.dialogs;if(a.length){const e=(0,M.Z)(a[a.length-1])||0;if(a=a.slice(),(0,w.Z)(a,(e=>e.peerId===n.Z.myId)),this.chatRightsActions&&(a=yield(0,C.Z)(a,(e=>this.filterByRights(e.peerId))),!t()))return;if(yield this.renderSaved(),!t())return;this.offsetIndex=e}if(this.renderResultsFunc(a.map((e=>e.peerId))),s.isEnd){if(!this.loadedWhat.dialogs){if(yield this.renderSaved(),!t())return;return this.loadedWhat.dialogs=!0,this.offsetIndex=0,this.folderId=1,this.getMoreDialogs()}if(this.loadedWhat.archived=!0,!this.loadedWhat.contacts)return this.getMoreContacts()}}))}filterByRights(e){return A(this,void 0,void 0,(function*(){const t=yield this.managers.appPeersManager.getPeer(e);return e.isUser()?"send_plain"!==this.chatRightsActions[0]||(0,P.Z)(t):!!this.chatRightsActions.every((e=>(0,Z.Z)(t,e)))||void 0}))}getMoreContacts(){return A(this,void 0,void 0,(function*(){if(this.loadedWhat.contacts)return;const e=this.peerType.includes("contacts");if(!this.cachedContacts){const{middleware:t}=this.getTempId("contacts"),i=Promise.all([e?this.managers.appUsersManager.getContactsPeerIds(this.query):[],this.query?this.managers.appUsersManager.searchContacts(this.query):void 0]);i.catch((()=>{t()&&(this.loadedWhat.contacts=!0)}));const[s,a]=yield i;if(!t())return;if(a){let i=e?a.my_results.concat(a.results):a.my_results;if(this.chatRightsActions&&(i=yield(0,C.Z)(i,(e=>this.filterByRights(e))),!t()))return;this.peerType.includes("dialogs")||(i=i.filter((e=>e.isUser()))),this.cachedContacts=(0,v.Z)(s.concat(i))}else this.cachedContacts=s.slice();(0,b.Z)(this.cachedContacts,n.Z.myId)}const t=m.Z.height/56*1.25|0,i=this.cachedContacts.splice(0,t);this.renderResultsFunc(i),this.cachedContacts.length||(this.loadedWhat.contacts=!0)}))}getMoreChannelParticipants(){var e;return A(this,void 0,void 0,(function*(){if(this.loadedWhat.channelParticipants)return;const{middleware:t}=this.getTempId("channelParticipants"),i=this.managers.appProfileManager.getParticipants(this.peerId.toChatId(),{_:"channelParticipantsSearch",q:this.query},50,this.list.childElementCount);i.catch((()=>{t()&&(this.loadedWhat.channelParticipants=!0)}));const s=yield i;if(!t())return;const{participants:a}=s,o=a.map((e=>(0,L.Z)(e)));(0,b.Z)(o,n.Z.myId),this.renderResultsFunc(o);const r=null!==(e=s.count)&&void 0!==e?e:a.length;(this.list.childElementCount>=r||a.length<50)&&(this.loadedWhat.channelParticipants=!0)}))}getMoreResults(){if(this.promise)return this.promise;const e=(()=>this.peerType.includes("dialogs")&&!this.loadedWhat.archived?this.getMoreSomething("dialogs"):!this.peerType.includes("contacts")&&!this.peerType.includes("dialogs")||this.loadedWhat.contacts?this.peerType.includes("channelParticipants")&&!this.loadedWhat.channelParticipants?this.getMoreSomething("channelParticipants"):void 0:this.getMoreSomething("contacts"))();if(!e)return Promise.resolve();const t=this.promise=e.catch((e=>{console.error("get more result error",e)})).finally((()=>{this.promise===t&&(this.promise=void 0),this.checkForTriggers()}));return t}getMoreSomething(e){return{dialogs:this.getMoreDialogs,contacts:this.getMoreContacts,channelParticipants:this.getMoreChannelParticipants}[e].call(this)}renderResults(e){return A(this,void 0,void 0,(function*(){!this.peerType.includes("dialogs")&&this.loadedWhat.contacts&&(e=yield(0,C.Z)(e,(e=>this.managers.appUsersManager.isNonContactUser(e)))),e.forEach((e=>A(this,void 0,void 0,(function*(){const{dom:t}=s.default.addDialogNew({peerId:e,container:this.scrollable,rippleEnabled:this.rippleEnabled,avatarSize:this.avatarSize});if(this.multiSelect){const i=this.selected.has(e),s=new r.Z;i&&(s.input.checked=!0),t.containerEl.prepend(s.label)}let i;i=e.isAnyChat()?yield(0,I.Z)(e.toChatId()):e===n.Z.myId?(0,d.ag)(this.selfPresence):(0,E.Z)(yield this.managers.appUsersManager.getUser(e.toUserId())),t.lastMessageSpan.append(i)}))))}))}add(e,t,i=!0){var s;if(this.selected.add(e),!this.multiSelect)return void this.onChange(this.selected.size);this.query.trim()&&(this.input.value="",this.onInput());const n=document.createElement("div");n.classList.add("selector-user","scale-in");const a=new S.Z;if(a.classList.add("selector-user-avatar","tgico","avatar-32"),a.isDialog=!0,n.dataset.key=""+e,e.isPeerId()){if(void 0===t){const i=new h.Z;i.update({peerId:e.toPeerId(),dialog:!0}),t=i.element}a.updateWithOptions({peerId:e})}return t&&("string"==typeof t?n.innerHTML=t:((0,p.Z)(n,t),n.append(t))),n.insertAdjacentElement("afterbegin",a),this.selectedContainer.insertBefore(n,this.input),null===(s=this.onChange)||void 0===s||s.call(this,this.selected.size),i&&this.selectedScrollable.scrollIntoViewNew({element:this.input,position:"center"}),n}remove(e){if(!this.multiSelect)return;const t=this.selectedContainer.querySelector(`[data-key="${e}"]`);t.classList.remove("scale-in"),t.offsetWidth,t.classList.add("scale-out");const i=()=>{this.selected.delete(e),t.remove(),this.onChange&&this.onChange(this.selected.size)};x.Z.isAvailable("animations")?t.addEventListener("animationend",i,{once:!0}):i()}getSelected(){return[...this.selected]}addInitial(e){e.forEach((e=>{this.add(e,void 0,!1)})),window.requestAnimationFrame((()=>{this.selectedScrollable.scrollIntoViewNew({element:this.input,position:"center",forceDirection:o.f.Static})}))}}},8448:(e,t,i)=>{"use strict";i.d(t,{ZP:()=>D,ns:()=>F});var s=i(3442),n=i(3013),a=i(4755),o=i(4762),r=i(3512),d=i(3910),l=i(2738),c=i(3725),h=i(3699),u=i(319),p=i(8497),f=i(2325),m=i(3251),g=i(632),v=i(9966),b=i(1507),y=i(4081),w=i(5296),S=i(3228),C=i(5157),L=i(7207),I=i(130),E=i(8115),P=i(5671),Z=i(1604),M=i(7530),T=i(2312),k=i(9492),x=i(3035),A=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function _(e=!0){const t=new s.Z({cancelable:!0,tryAgainOnFail:e});return t.construct(),e||(t.circle.setAttributeNS(null,"r","23"),t.totalLength=143.58203125),t}r.Z.addEventListener("messages_media_read",(({mids:e,peerId:t})=>{e.forEach((e=>{const i=`[data-mid="${e}"][data-peer-id="${t}"]`;Array.from(document.querySelectorAll(`audio-element.is-unread${i}, .media-round.is-unread${i}`)).forEach((e=>{e.classList.remove("is-unread")}))}))}));const F=(e,t)=>{let i,s;const n=!e.classList.contains("search-super-item"),a=(0,p.Z)(e,n?"bubbles-inner":"tabs-tab");if(a){const t=':not([data-is-outgoing="1"])',o=`.audio:not(.is-voice)${t}`;let r;if(r=e.matches(o)?[o]:[`.audio.is-voice${t}`,`.media-round${t}`],n){const e=".bubble:not(.webpage) ";r=r.map((t=>e+t))}const d=r.join(", "),l=Array.from(a.querySelectorAll(d)),c=l.indexOf(e),h=l.map((e=>({peerId:e.dataset.peerId.toPeerId(),mid:+e.dataset.mid})));i=h.slice(0,c),s=h.slice(c+1)}return(s.length&&s[0].midt)&&([i,s]=[s.reverse(),i.reverse()]),[i,s]};class D extends HTMLElement{constructor(){super(...arguments),this.withTime=!1,this.voiceAsMusic=!1,this.showSender=!1,this.listenerSetter=new h.Z}render(){var e,t,i;return A(this,void 0,void 0,(function*(){this.classList.add("audio"),this.managers=r.Z.managers,this.dataset.mid=""+this.message.mid,this.dataset.peerId=""+this.message.peerId;const s=(0,M.Z)(this.message),o="voice"===s.type,h=!this.voiceAsMusic&&o,b=this.message.pFlags.is_outgoing,F=null===(e=this.message)||void 0===e?void 0:e.uploadingFileName,D=()=>{const e=this.audio&&this.audio.readyState>=this.audio.HAVE_CURRENT_DATA?this.audio.duration:s.duration;return(0,C.Z)(0|e)};this.innerHTML='\n
\n
\n
\n
\n
\n
';const R=this.firstElementChild,B=document.createElement("div");B.classList.add("audio-download"),"audio"!==s.type&&this.message&&this.message.pFlags.media_unread&&this.classList.add("is-unread"),F&&(this.classList.add("is-outgoing"),this.append(B));const N=yield h?function(e){return A(this,void 0,void 0,(function*(){e.classList.add("is-voice");const t=e.message,i=(0,M.Z)(t);t.pFlags.out&&e.classList.add("is-out");let s=i.attributes.find((e=>"documentAttributeAudio"===e._)).waveform||new Uint8Array([]);s=function(e){e instanceof Uint8Array||(e=new Uint8Array(e));const t=8*e.length/5|0;if(!t)return new Uint8Array([]);let i;try{const s=new DataView(e.buffer);i=new Uint8Array(t);for(let e=0;e>n&31}}catch(e){i=new Uint8Array([])}return i}(s.slice(0,63));const{svg:n,container:o,availW:r}=function(e,t){const i=a.Z.isMobile?16:23,s=a.Z.isMobile?152:190,n=a.Z.isMobile?190:256,o=(0,S.Z)(t/60*n,s,n),r=Math.max(...e),d=e.length,l=Math.min(o/4|0,d);let c=0;const h=i-4;let u,p,f="";for(let t=0,s=0,n=0;t=d){n=n+l-d,n<(l+1)/2&&c`,s+=4,c=n<(l+1)/2?0:a}else c',t.append(i),t.onclick=()=>{const n=((0,p.Z)(e,"document-wrapper")||(0,p.Z)(e,"quote-text")).querySelector(".audio-transcribed-text");if(0===e.transcriptionState)if(n)n.classList.remove("hide"),i.classList.remove("tgico-transcribe"),i.classList.add("tgico-up"),e.transcriptionState=2;else{const i=e.message;if(i.pFlags.is_outgoing)return;e.transcriptionState=1,!s.parentElement&&t.append(s),(0,x.d1)().then((()=>{1===e.transcriptionState&&s.classList.add("active")})),e.managers.appMessagesManager.transcribeAudio(i).catch(u.Z)}else 2===e.transcriptionState&&(n.classList.add("hide"),i.classList.remove("tgico-up"),i.classList.add("tgico-transcribe"),e.transcriptionState=0)},e.append(t)}let m,g=n;return g||(m=new L.Z,h.append(m.container)),()=>{let t=e.audio;const s=()=>{c&&(c.style.width=t.currentTime/t.duration*100+"%")};(!t.paused||t.currentTime>0&&t.currentTime!==t.duration)&&s();const n=(0,v.Z)(s);return e.addAudioListener("timeupdate",n),e.addAudioListener("ended",n),e.addAudioListener("play",(()=>{(0,w.cK)((()=>!!t&&(s(),!t.paused)),e)})),g&&e.readyPromise.then((()=>{let i=!1,s=!1;function n(e){let i;if(e instanceof MouseEvent)i=e.offsetX;else{const t=e.target.getBoundingClientRect();i=e.targetTouches[0].pageX-t.left}const s=i/r*t.duration;t.currentTime=s}g.addEventListener("mouseleave",(t=>{i&&(e.togglePlay(void 0,!0),i=!1),s=!1})),g.addEventListener("mousemove",(e=>{s=!0,i&&n(e)})),g.addEventListener("mousedown",(s=>{s.preventDefault(),0===s.button&&(t.paused||e.togglePlay(void 0,!1),n(s),i=!0)})),g.addEventListener("mouseup",(t=>{s&&i&&(e.togglePlay(void 0,!0),i=!1)})),(0,l.fc)(g,(e=>{(0,d.Z)(e),t.paused||n(e)}))}),u.Z),!g&&m.setMedia({media:t,streamable:i.supportsStreaming,duration:i.duration}),()=>{null==g||g.remove(),g=null,t=null}}}))}(this):function(e){var t;return A(this,void 0,void 0,(function*(){const i=e.withTime,s=e.message,n=(0,M.Z)(s),a="voice"===n.type||"round"===n.type,o=document.createElement("div");o.classList.add("audio-description");const r=n.attributes.find((e=>"documentAttributeAudio"===e._));if(!a){const t=[];(null==r?void 0:r.performer)&&t.push((0,E.Z)(r.performer)),i?t.push((0,g.OD)(s.date)):t.length||t.push((0,y.Z)(n.size)),e.showSender&&t.push(yield(0,P.Z)(s)),o.append(...(0,f.A1)(t," • "))}e.insertAdjacentHTML("beforeend",'\n
\n
\n
\n
');const d=e.querySelector(".audio-title"),l=new m.I;l.dataset.fontWeight=e.dataset.fontWeight,l.dataset.fontSize=e.dataset.fontSize,l.dataset.sizeType=e.dataset.sizeType,l.getSize=e.getSize,a?l.append(yield(0,P.Z)(s)):(0,I.Z)(l,(0,E.Z)(null!==(t=null==r?void 0:r.title)&&void 0!==t?t:n.file_name)),d.append(l),e.showSender&&d.append((0,Z.Z)(s));const c=e.querySelector(".audio-subtitle");return c.append(o),()=>{let t=!1,i=new L.Z;i.setMedia({media:e.audio,streamable:n.supportsStreaming,duration:n.duration}),e.addAudioListener("ended",(()=>{e.classList.remove("audio-show-progress"),c.lastChild.replaceWith(o),t=!1}));const s=()=>{t||(e.classList.add("audio-show-progress"),t=!0,i&&c.lastChild.replaceWith(i.container))};return e.addAudioListener("play",s),(!e.audio.paused||e.audio.currentTime>0)&&s(),()=>{i.removeListeners(),i.container.remove(),i=null}}}))}(this),O=this.querySelector(".audio-time");O.textContent=D();const U=this.onLoad=e=>{this.onLoad=void 0;const t=this.audio=n.Z.addMedia(this.message,e),i=this.readyPromise=(0,c.Z)();this.audio.readyState>=this.audio.HAVE_CURRENT_DATA?i.resolve():this.addAudioListener("canplay",(()=>i.resolve()),{once:!0}),this.onTypeDisconnect=N();const s=()=>(0,C.Z)(0|t.currentTime)+(h?" / "+D():""),a=()=>{O.innerText=s(),R.classList.toggle("playing",!t.paused)};(!t.paused||t.currentTime>0&&t.currentTime!==t.duration)&&a(),(0,l.fc)(R,(e=>this.togglePlay(e)),{listenerSetter:this.listenerSetter}),this.addAudioListener("ended",(()=>{R.classList.remove("playing"),O.innerText=D()})),this.addAudioListener("timeupdate",(()=>{!t.currentTime&&t.paused||n.Z.isSafariBuffering(t)||(O.innerText=s())})),this.addAudioListener("pause",(()=>{R.classList.remove("playing")})),this.addAudioListener("play",a)};if(null===(t=s.thumbs)||void 0===t?void 0:t.length){const e=[],t=yield(0,k.Z)({photo:s,message:null,container:R,boxWidth:48,boxHeight:48,loadPromises:this.loadPromises,withoutPreloader:!0,lazyLoadQueue:this.lazyLoadQueue});R.style.width=R.style.height="",t.images.thumb&&e.push(t.images.thumb),t.images.full&&e.push(t.images.full),this.classList.add("audio-with-thumb"),e.forEach((e=>e.classList.add("audio-thumb")))}if(b)F&&(this.preloader=_(!1),this.preloader.attachPromise(T.Z.getUpload(F)),this.dataset.isOutgoing="1",this.preloader.attach(B,!1));else{let e=this.preloader;const t="audio"!==s.type;U(t);const a=this.load=(t,i)=>{if(this.load=void 0,!this.audio.src){if(n.Z.resolveWaitingForLoadMedia(this.message.peerId,this.message.mid,this.message.pFlags.is_scheduled),this.onDownloadInit(t),!e)if(s.supportsStreaming){let e;this.classList.add("corner-download");const i=()=>{const i=_(!1),s=(0,c.Z)();s.notifyAll({done:75,total:100}),s.catch((()=>{this.audio.pause(),n.Z.willBePlayed(void 0)})),s.cancel=()=>{s.cancel=u.Z;const e=new Error;e.type="CANCELED",s.reject(e)},i.attach(B,!1,s),e=this.addAudioListener("pause",(()=>{s.cancel()}),{once:!0}),this.onDownloadInit(t)},s=this.addAudioListener("play",i);this.readyPromise.then((()=>{this.listenerSetter.remove(s),e&&this.listenerSetter.remove(e)}))}else{e=_(),t||(this.readyPromise=(0,c.Z)());const i=()=>{this.onDownloadInit(t);const i=T.Z.downloadMediaURL({media:s});return t||i.then((()=>{this.readyPromise.resolve()})),e.attach(B,!1,i),{download:i}};e.setDownloadFunction(i),i()}this.classList.contains("corner-download")?R.append(B):this.append(B),this.classList.add("downloading"),this.readyPromise.then((()=>{this.classList.remove("downloading"),B.classList.add("downloaded"),setTimeout((()=>{B.remove()}),200),i||n.Z.willBePlayedMedia!==this.audio||(this.audio.play(),n.Z.willBePlayed(void 0))}))}};(null===(i=this.audio)||void 0===i?void 0:i.src)||(t?a(!1):(0,l.fc)(R,(()=>{a(!0)}),{once:!0,capture:!0,passive:!1,listenerSetter:this.listenerSetter}))}}))}onDownloadInit(e){e&&(n.Z.willBePlayed(this.audio),o.IS_SAFARI&&!this.audio.autoplay&&(this.audio.autoplay=!0))}togglePlay(e,t=this.audio.paused){e&&(0,d.Z)(e),t?(this.setTargetsIfNeeded(),this.audio.play().catch((()=>{}))):this.audio.pause()}setTargetsIfNeeded(){const e=!!this.searchContext;if(n.Z.setSearchContext(this.searchContext||{peerId:b.NM,inputFilter:{_:"inputMessagesFilterEmpty"},useSearch:!1})){const[t,i]=e?F(this,this.message.mid):[];n.Z.setTargets({peerId:this.message.peerId,mid:this.message.mid},t,i)}}playWithTimestamp(e){var t;null===(t=this.load)||void 0===t||t.call(this,!0),this.audio.currentTime=e,this.togglePlay(void 0,!0)}get addAudioListener(){return this.listenerSetter.add(this.audio)}disconnectedCallback(){setTimeout((()=>{this.isConnected||(this.onTypeDisconnect&&(this.onTypeDisconnect(),this.onTypeDisconnect=null),this.readyPromise&&this.readyPromise.reject(),this.listenerSetter&&(this.listenerSetter.removeAll(),this.listenerSetter=null),this.preloader&&(this.preloader=null))}),100)}}customElements.define("audio-element",D)},9331:(e,t,i)=>{"use strict";i.d(t,{Z:()=>C,C:()=>b});var s=i(3512),n=i(2738),a=i(3910),o=i(1784),r=i(6074);class d extends r.Z{constructor(e){super(Object.assign(Object.assign({},e),{loadMore:(e,t,i)=>{if(this.peerId.isAnyChat()||!t)return Promise.resolve({count:0,items:[]});const s=null==e?void 0:e.photoId;return this.managers.appPhotosManager.getUserPhotos(this.peerId,s,i).then((e=>{const t=e.photos.map((e=>({element:null,photoId:e})));return{count:e.count,items:t}}))}})),this.loadedAllUp=!0,this.peerId=e.peerId}}var l=i(2312),c=i(7030),h=i(8544);class u extends h.Z{constructor(e){super(new d({peerId:e,managers:s.Z.managers}),[]),this.onPrevClick=e=>{this.openMedia({photoId:e.photoId,target:e.element,fromRight:-1})},this.onNextClick=e=>{this.openMedia({photoId:e.photoId,target:e.element,fromRight:1})},this.onDownloadClick=()=>{l.Z.downloadToDisc({media:this.target.photo,queueId:c.ZP.chat.bubbles.lazyLoadQueue.queueId})},this.peerId=e,this.setBtnMenuToggle([{icon:"download",text:"MediaViewer.Context.Download",onClick:this.onDownloadClick}]),this.setListeners()}openMedia({photoId:e,target:t,fromRight:i=0,prevTargets:s,nextTargets:n}){const a=Object.create(null,{_openMedia:{get:()=>super._openMedia}});return o=this,r=void 0,l=function*(){if(this.setMoverPromise)return this.setMoverPromise;const o=yield this.managers.appPhotosManager.getPhoto(e),r=a._openMedia.call(this,{media:o,timestamp:o.date,fromId:this.peerId,fromRight:i,target:t,reverse:!1,prevTargets:s,nextTargets:n});return this.target.photoId=o.id,this.target.photo=o,r},new((d=void 0)||(d=Promise))((function(e,t){function i(e){try{n(l.next(e))}catch(e){t(e)}}function s(e){try{n(l.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof d?n:new d((function(e){e(n)}))).then(i,s)}n((l=l.apply(o,r||[])).next())}));var o,r,d,l}}var p=i(5880),f=i(9931),m=i(3624),g=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const v=({peerId:e,threadId:t})=>{let i='avatar-element[data-peer-id="'+e+'"]';t&&(i+='[data-thread-id="'+t+'"]'),Array.from(document.querySelectorAll(i)).forEach((e=>{e.update()}))};function b(e,t,i,n,a,r){return g(this,void 0,void 0,(function*(){let d=yield s.Z.managers.appProfileManager.getFullPhoto(t);if(!i()||!d)return;const l=()=>Array.from(e.querySelectorAll("img")).find((e=>!e.classList.contains("emoji")))?e:null;if(t.isAnyChat()){const e=!!n,c="inputMessagesFilterChatPhotos";if(!n&&(n=yield s.Z.managers.appMessagesManager.getSearch({peerId:t,inputFilter:{_:c},maxId:0,limit:1}).then((e=>e.history[0])),!i()))return;if(n){n.action.photo.id!==d.id&&(e||(n=s.Z.managers.appMessagesManager.generateFakeAvatarMessage(t,d)));const i=e=>e.map((e=>({element:e.element,mid:e.item.mid,peerId:e.item.peerId})));return void(new o.Z).setSearchContext({peerId:t,inputFilter:{_:c}}).openMedia({message:n,target:l(),prevTargets:a?i(a):void 0,nextTargets:r?i(r):void 0})}}if(d){!(0,p.Z)(n)&&n&&(d=yield s.Z.managers.appPhotosManager.getPhoto(n));const e=e=>e.map((e=>({element:e.element,photoId:e.item})));new u(t).openMedia({photoId:d.id,target:l(),prevTargets:a?e(a):void 0,nextTargets:r?e(r):void 0})}}))}s.Z.addEventListener("avatar_update",v),s.Z.addEventListener("peer_title_edit",(e=>g(void 0,void 0,void 0,(function*(){(yield s.Z.managers.appAvatarsManager.isAvatarCached(e.peerId))||v(e)}))));const y=new Map,w=new Set;function S(e,t){return e+(t?"_"+t:"")}class C extends HTMLElement{constructor(){super(),this.addedToQueue=!1,this.classList.add("avatar-like"),this.middlewareHelper=(0,m.k)()}disconnectedCallback(){var e;const t=S(this.peerId,this.threadId),i=y.get(t);(null==i?void 0:i.has(this))&&(i.delete(this),i.size||y.delete(t)),null===(e=this.lazyLoadQueue)||void 0===e||e.delete({div:this})}attachClickEvent(){let e=!1;(0,n.fc)(this,(t=>g(this,void 0,void 0,(function*(){if((0,a.Z)(t),e)return;const i=this.peerId;e=!0,yield b(this,this.peerId,(()=>this.peerId===i)),e=!1}))))}updateOptions(e){for(const t in e)this[t]=e[t]}updateWithOptions(e){var t;const i=this.peerId,s=this.threadId;this.updateOptions(e);const n=this.peerId,a=this.threadId;if(i===n&&s===a)return;if(this.dataset.peerId=""+n,a?this.dataset.threadId=""+a:s&&delete this.dataset.threadId,i){const e=S(i,s),t=y.get(e);t&&(t.delete(this),t.size||y.delete(e))}const o=null===(t=e.wrapOptions)||void 0===t?void 0:t.middleware;return this.middlewareHelper.destroy(),o?this.middlewareHelper=o.create():this.middlewareHelper.destroy(),this.update()}remove(){this.middlewareHelper.destroy(),super.remove()}r(e=!1){const t=(0,f.Z)({div:this,peerId:this.peerId,isDialog:this.isDialog,title:this.peerTitle,onlyThumb:e,isBig:this.isBig,threadId:this.threadId,wrapOptions:Object.assign({middleware:this.middlewareHelper.get()},this.wrapOptions||{})});return this.loadPromises&&(this.loadPromises.push(t),t.finally((()=>{this.loadPromises=void 0}))),t}update(){if(this.lazyLoadQueue){if(!w.has(this.peerId)){if(this.addedToQueue)return;this.addedToQueue=!0;const e=S(this.peerId,this.threadId);let t=y.get(e);return t||y.set(e,t=new Set),t.add(this),this.lazyLoadQueue.push({div:this,load:()=>(w.add(this.peerId),this.update())}),this.r(!0)}this.addedToQueue&&this.lazyLoadQueue.delete({div:this})}w.add(this.peerId);const e=this.r();this.addedToQueue&&e.finally((()=>{this.addedToQueue=!1}));const t=S(this.peerId,this.threadId),i=y.get(t);if(i){i.delete(this);const e=Array.from(i);y.delete(t);for(let t=0,i=e.length;t{"use strict";i.d(t,{Z:()=>o});var s=i(2738),n=i(1168),a=i(6765);class o{constructor(e,t){this.container=document.createElement("div"),this.container.classList.add("avatar-edit"),this.canvas=document.createElement("canvas"),this.canvas.classList.add("avatar-edit-canvas"),this.icon=document.createElement("span"),this.icon.classList.add("tgico","tgico-cameraadd"),this.container.append(this.canvas,this.icon),(0,s.fc)(this.container,(()=>{n.Z.createPopup(a.Z,t).open(this.canvas,e)}))}clear(){this.canvas.getContext("2d").clearRect(0,0,this.canvas.width,this.canvas.height)}}},4494:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(2325),n=i(1405);function a(e,t={}){const i=document.createElement(t.asLink?"a":t.asDiv?"div":"button");return i.className=e+(t.icon?" tgico-"+t.icon:""),t.noRipple||(t.rippleSquare&&i.classList.add("rp-square"),(0,n.Z)(i)),t.onlyMobile&&i.classList.add("only-handhelds"),t.disabled&&i.setAttribute("disabled","true"),t.text&&i.append((0,s.ag)(t.text,t.textArgs)),i}},8119:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(4494);const n=(e={})=>{const t=(0,s.Z)("btn-circle btn-corner z-depth-1"+(e.className?" "+e.className:""),e);return t.tabIndex=-1,t}},2230:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(4494);const n=(e,t={})=>(0,s.Z)("btn-icon",Object.assign({icon:e||void 0},t))},3003:(e,t,i)=>{"use strict";i.d(t,{Z:()=>v,b:()=>g});var s=i(7238),n=i(3416),a=i(3910),o=i(2738),r=i(8497),d=i(130),l=i(2325),c=i(9492),h=i(8812),u=i(8222),p=i(4762),f=i(1405);function m(e){if(e.element)return[e.separator,e.element].filter(Boolean);const{icon:t,iconDoc:i,text:s,onClick:m,checkboxField:g,noCheckboxClickListener:v}=e,b=document.createElement("div");b.className="btn-menu-item rp-overflow"+(t?" tgico-"+t:""),p.IS_MOBILE&&(0,f.Z)(b);let y=e.textElement;if(y||(y=e.textElement=s?(0,l.ag)(s,e.textArgs):document.createElement("span"),e.regularText&&(0,d.Z)(y,e.regularText)),i){const t=document.createElement("span");t.classList.add("btn-menu-item-icon"),b.append(t),e.loadPromise=(0,c.Z)({container:t,photo:i,boxWidth:24,boxHeight:24,withoutPreloader:!0,noFadeIn:!0,noBlur:!0,processUrl:e=>fetch(e).then((e=>e.text())).then((e=>{const t=u.Z.getProperty("primary-text-color"),i=(new DOMParser).parseFromString(e,"image/svg+xml").firstElementChild;return i.querySelectorAll("path").forEach((e=>{e.setAttributeNS(null,"fill",t),e.style.stroke=t,e.style.strokeWidth=".25px"})),(0,h.Z)(i.outerHTML)}))}).then((e=>e.loadPromises.thumb))}y.classList.add("btn-menu-item-text"),b.append(y);const w=!!g||!!e.keepOpen;return m&&(0,o.fc)(b,(t=>{var i;(0,a.Z)(t);const s=(0,r.Z)(t.target,"btn-menu");s&&!s.classList.contains("active")||(m(t),!1!==(null===(i=e.checkForClose)||void 0===i?void 0:i.call(e))&&(w||n.Z.close(),g&&!v&&(g.checked="radio"===g.input.type||!g.checked)))}),e.options),g&&b.append(g.label),!0===e.separator&&(e.separator=document.createElement("hr")),e.multiline&&b.classList.add("is-multiline"),[e.separator,e.element=b].filter(Boolean)}function g({listenerSetter:e,buttons:t}){const i=document.createElement("div");i.classList.add("btn-menu"),e&&t.forEach((t=>{t.options?t.options.listenerSetter=e:t.options={listenerSetter:e}}));const n=t.map(m);return i.append(...(0,s.Z)(n)),i}function v(e){return t=this,i=void 0,n=function*(){const t=g(e);return yield Promise.all(e.buttons.map((({loadPromise:e})=>e))),t},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n}},5322:(e,t,i)=>{"use strict";i.d(t,{Z:()=>u,v:()=>h});var s=i(3416),n=i(3910),a=i(2738),o=i(3699),r=i(2230),d=i(3003),l=i(2353),c=i(3035);function h({el:e,onOpen:t,options:i,onClose:o}){((null==i?void 0:i.listenerSetter)?i.listenerSetter.add(e):e.addEventListener.bind(e))(a.pf,(i=>{if(!e.classList.contains("btn-menu-toggle")||(0,a.Cf)(i))return!1;if((0,n.Z)(i),e.classList.contains("menu-open"))s.Z.close();else{const n=null==t?void 0:t(i),a=()=>{const t=e.querySelector(".btn-menu");s.Z.openBtnMenu(t,o)};n instanceof Promise?n.then(a):a()}}))}function u({buttonOptions:e,listenerSetter:t,container:i,direction:s,buttons:n,onOpenBefore:a,onOpen:u,onClose:p,onCloseAfter:f}){e&&(e.asDiv=!0);const m=null!=i?i:(0,r.Z)("more",e);m.classList.add("btn-menu-toggle");const g=new o.Z;let v,b;return h({el:m,onOpen:e=>{return t=this,i=void 0,r=function*(){if(yield null==a?void 0:a(e),b)return clearTimeout(b),void(b=void 0);const t=yield(i=n,(0,l.Z)(i,(e=>{var t,i;return null===(i=null===(t=null==e?void 0:e.verify)||void 0===t?void 0:t.call(e))||void 0===i||i})));var i;if(!t.length)return;const o=v=yield(0,d.Z)({buttons:t,listenerSetter:g});o.classList.add(s),yield null==u?void 0:u(e,o),m.append(o),yield(0,c.d1)()},new((o=void 0)||(o=Promise))((function(e,s){function n(e){try{d(r.next(e))}catch(e){s(e)}}function a(e){try{d(r.throw(e))}catch(e){s(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(n,a)}d((r=r.apply(t,i||[])).next())}));var t,i,o,r},options:{listenerSetter:t},onClose:()=>{null==p||p(),b=window.setTimeout((()=>{null==f||f(),b=void 0,g.removeAll(),n.forEach((e=>e.element=void 0)),v.remove()}),300)}}),m}},5729:(e,t,i)=>{"use strict";i.d(t,{zp:()=>Dt,O3:()=>Ot,ZP:()=>Gt,ZK:()=>Vt});var s=i(5432),n=i(3512),a=i(1655),o=i(6519),r=i(4484),d=i(9331),l=i(1507),c=i(7625),h=i(54),u=i(4993);class p{constructor(e,t,i){this.container=document.createElement("div"),this.container.classList.add("bubbles-group"),this.chat=e,this.groups=t,this.items=[],this.dateTimestamp=i,this.offset=0}createAvatar(e){if(this.avatarLoadPromise)return this.avatarLoadPromise;if("messageService"===e._)return;this.avatarContainer=document.createElement("div"),this.avatarContainer.classList.add("bubbles-group-avatar-container"),++this.offset;const t=e.fwd_from,i=e.fwdFromId,s=e.from_id&&"peerChannel"===e.from_id._&&e.fromId===i,a=this.chat.peerId;this.avatar=new d.Z,this.avatar.classList.add("bubbles-group-avatar","user-avatar","avatar-40");const o=(t&&(a===n.Z.myId||a===l.hj)||s?i:e.fromId)||l.NM,r=this.avatar.updateWithOptions({lazyLoadQueue:this.chat.bubbles.lazyLoadQueue,peerId:o,peerTitle:!i&&t&&t.from_name?t.from_name:void 0});return this.avatarLoadPromise=r,this.avatarContainer.append(this.avatar),this.container.append(this.avatarContainer),this.avatarLoadPromise}get firstTimestamp(){return this.firstItem.timestamp}get firstMid(){return this.firstItem.mid}get firstItem(){return this.items[this.items.length-1]}get lastTimestamp(){return this.lastItem.timestamp}get lastMid(){return this.lastItem.mid}get lastItem(){return this.items[0]}updateClassNames(){const e=this.items,t=e.length;if(!t)return;const i=e[t-1].bubble;if(1===e.length)return void i.classList.add("is-group-first","is-group-last");i.classList.remove("is-group-last"),i.classList.add("is-group-first");for(let i=1,s=t-1;i{this.mountItem(e,s-1-i,t)})),e&&this.updateClassNames(),this.onItemMount()}mountItem(e,t=this.items.indexOf(e),i=this.offset){e.mounted||((0,r.Z)(e.bubble,this.container,i+t),e.mounted=!0)}unmountItem(e){e.mounted&&(e.bubble.remove(),e.mounted=!1,this.onItemUnmount())}onItemMount(){if(this.mounted)return;const e=this.chat.bubbles.getDateContainerByTimestamp(this.dateTimestamp/1e3),t=this.groups.groups.filter((e=>e.dateTimestamp===this.dateTimestamp)),i=t.length,s=t.indexOf(this),n=t.slice(s+1).reduce(((e,t)=>e+(t.mounted?0:1)),0);(0,r.Z)(this.container,e.container,Ot+i-1-s-n),this.mounted=!0}onItemUnmount(){this.mounted&&(this.items.length?this.updateClassNames():(this.container.remove(),this.chat.bubbles.deleteEmptyDateGroups(),this.mounted=!1))}}class f{constructor(e){this.chat=e,this.itemsArr=[],this.itemsMap=new Map,this.groups=[],this.newGroupDiff=121,this.sortItemsKey="scheduled"===e.type?"timestamp":"mid",this.sortGroupsKey="scheduled"===e.type?"lastTimestamp":"lastMid",this.sortGroupItemsKey="groupMid"}removeItem(e){var t;null===(t=e.group)||void 0===t||t.removeItem(e),this.removeItemFromCache(e)}removeAndUnmountBubble(e){const t=this.getItemByBubble(e);if(!t)return e.parentElement&&e.remove(),!1;const i=this.itemsArr,s=i.indexOf(t),n=this.getSiblingsAtIndex(s,i),a=t.group;this.removeItem(t);const o=new Set;a&&(a.unmountItem(t),o.add(a));const[r,d]=n;if(r&&d&&this.canItemsBeGrouped(r,d)&&r.group!==d.group){const e=d.group;this.f(d.group.items),e.onItemUnmount(),o.add(r.group),this.groupUngrouped()}return this.mountUnmountGroups(Array.from(o)),!0}mountUnmountGroups(e){const[t,i]=(0,h.Z)(e,(e=>!!e.items.length));i.forEach((e=>{e.onItemUnmount()})),t.forEach((e=>{e.mount(!0)}))}f(e,t=0,i=e.length){for(;ts.add(e)))}}return s}cleanup(){this.itemsArr=[],this.groups=[],this.itemsMap.clear()}}var m=i(2986),g=i(4524),v=i(9298),b=i(3442),y=i(8805),w=i(5117),S=i(5814),C=i(4755),L=i(4762),I=i(2325),E=i(1405),P=i(632),Z=i(130),M=i(2559),T=i(2946),k=i(8115),x=i(8842),A=i(6700),_=i(5565),F=i(2149);const D="replies-element";n.Z.addEventListener("replies_updated",(e=>{Array.from(document.querySelectorAll(D+`[data-post-key="${e.peerId}_${e.mid}"]`)).forEach((t=>{t.message=e,t.render()}))}));class R extends HTMLElement{constructor(){super(),this.updated=!1,this.managers=n.Z.managers}init(){this.render(),this.dataset.postKey=this.message.peerId+"_"+this.message.mid,this.classList.add("replies","replies-"+this.type)}render(){const e=this.message.replies;if("footer"===this.type){let t;this.firstElementChild&&(t=this.firstElementChild),(null==e?void 0:e.recent_repliers)?(t&&!t.classList.contains("replies-footer-avatars")&&(this.innerHTML="",t=null),this.stackedAvatars||(this.stackedAvatars=new F.Z({lazyLoadQueue:this.lazyLoadQueue,avatarSize:30}),this.stackedAvatars.container.classList.add("replies-footer-avatars")),t=this.stackedAvatars.container,this.stackedAvatars.render(e.recent_repliers.map((e=>(0,T.Z)(e))),this.loadPromises)):(t&&!t.classList.contains("tgico-comments")&&(t.remove(),t=null),t||(t=document.createElement("span"),t.classList.add("tgico-comments"))),t.parentElement||this.prepend(t),this.text||(this.text=new I.ZP.IntlElement);const i=this.text;if(e?e.replies?i.compareAndUpdate({key:"Comments",args:[e.replies]}):i.compareAndUpdate({key:"LeaveAComment"}):i.compareAndUpdate({key:"ViewInChat"}),e){let t=!1;e.replies&&void 0!==e.read_max_id&&void 0!==e.max_id&&(t=e.read_max_id${(null==e?void 0:e.replies)?(0,M.Z)(e.replies,0):""}`;!e||this.updated||this.message.pFlags.is_outgoing||(this.managers.appMessagesManager.subscribeRepliesThread(this.message.peerId,this.message.mid),this.managers.appMessagesManager.updateMessage(this.message.peerId,this.message.mid,"replies_updated"),this.updated=!0),this.loadPromises&&(this.loadPromises=void 0)}}customElements.define(D,R);const B=()=>{const e=document.createElement("i");return e.classList.add("edited"),(0,I.$d)(e,"EditedMessage"),e},N=()=>(0,I.ag)("SponsoredMessage");var O;!function(e){e.setTime=e=>{var t;const{chatType:i,message:s}=e,n=new Date(1e3*s.date),a=[];let o,r;const d=!!s.pFlags.sponsored,l=!("action"in s)&&!d,c=d?void 0:(0,P.mr)(n);if(l){if(s.views){const e=s.post_author||(null===(t=s.fwd_from)||void 0===t?void 0:t.post_author),i=document.createElement("span");i.classList.add("post-views"),i.innerHTML=(0,M.Z)(s.views,1);const n=document.createElement("i");if(n.classList.add("tgico-channelviews","time-icon"),a.push(i,n),e){const t=document.createElement("span");(0,Z.Z)(t,(0,k.Z)(e)),t.insertAdjacentHTML("beforeend",", "),a.push(t)}}if(s.edit_date&&"scheduled"!==i&&!s.pFlags.edit_hide&&a.unshift(o=B()),"pinned"!==i&&s.pFlags.pinned){const e=document.createElement("i");e.classList.add("tgico-pinnedchat","time-icon"),a.unshift(e)}}else d&&a.push(r=N());c&&a.push(c);let h=d?void 0:(0,P.xE)(n);l&&(h+=(s.edit_date&&!s.pFlags.edit_hide?`\nEdited: ${(0,P.xE)(new Date(1e3*s.edit_date))}`:"")+(s.fwd_from?`\nOriginal: ${(0,P.xE)(new Date(1e3*s.fwd_from.date))}`:""));const u=document.createElement("span");u.classList.add("time","tgico"),u.append(...a);const p=document.createElement("div");p.classList.add("inner","tgico"),h&&(p.title=h);let f=a;return o&&(f[f.indexOf(o)]=B()),r&&(f[f.indexOf(r)]=N()),f=f.map((e=>e instanceof HTMLElement&&!e.classList.contains("i18n")&&!e.classList.contains("reactions")?e.cloneNode(!0):e)),c&&(f[f.length-1]=(0,P.mr)(n)),p.append(...f),u.append(p),u},e.renderReplies=({bubble:e,bubbleContainer:t,message:i,messageDiv:s,loadPromises:n,lazyLoadQueue:a})=>{const o=!e.classList.contains("sticker")&&!e.classList.contains("emoji-big")&&!e.classList.contains("round"),r=new R;return r.message=i,r.type=o?"footer":"beside",r.loadPromises=n,r.lazyLoadQueue=a,r.init(),t.prepend(r),o},e.setReply=({chat:e,bubble:t,bubbleContainer:i,message:s})=>{return a=this,o=void 0,d=function*(){const a=!i;a&&(i=t.querySelector(".bubble-content"));const o=a?i.querySelector(".reply"):null;if(!s.reply_to_mid)return null==o||o.remove(),void t.classList.remove("is-reply");const r=s.reply_to.reply_to_peer_id?(0,T.Z)(s.reply_to.reply_to_peer_id):e.peerId,d=yield n.Z.managers.appMessagesManager.getMessageByPeer(r,s.reply_to_mid);let l,c;if(d){const e=d.fwdFromId;c=s.fwdFromId&&s.fwdFromId===e?s.fwdFromId:d.fromId||e,l=new x.Z({peerId:c,dialog:!1,onlyFirstName:!1,plainText:!1}).element}else n.Z.managers.appMessagesManager.fetchMessageReplyTo(s),e.bubbles.needUpdate.push({replyToPeerId:r,replyMid:s.reply_to_mid,mid:s.mid}),l=(0,I.ag)("Loading");const{container:h,fillPromise:u}=(0,A.Z)(l,void 0,e.animationGroup,d,e.isAnyGroup?c:void 0);return yield u,o?(o.classList.contains("floating-part")&&h.classList.add("floating-part"),o.replaceWith(h)):i.append(h),t.classList.add("is-reply"),h},new((r=void 0)||(r=Promise))((function(e,t){function i(e){try{n(d.next(e))}catch(e){t(e)}}function s(e){try{n(d.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,s)}n((d=d.apply(a,o||[])).next())}));var a,o,r,d}}(O||(O={}));var U=i(2153),H=i(3699),z=i(8448),j=i(4789),G=i(8594),V=i(3035),K=i(3725),W=i(410),$=i(252),q=i(8497),Y=i(4668),Q=i(2796),X=i(3624),J=i(3910),ee=i(2738),te=i(5705),ie=i(2359),se=i(2648),ne=i(5296),ae=i(8938),oe=i(5701),re=i(586),de=i(241),le=i(6272),ce=i(1784),he=i(9099),ue=i(2416),pe=i(8763),fe=i(5975),me=i(8939),ge=i(993),ve=i(4494),be=i(8204),ye=i(1842),we=i(8737),Se=i(8947),Ce=i(5418),Le=i(286),Ie=i(7401),Ee=i(4881);class Pe{constructor(e){this.observing=new Map,this.observingQueue=new Map,this.freezedObservingNew=!1,this.observer=new IntersectionObserver((e=>{const t=this.observing;for(let i=0,s=e.length;i({w:e.size.w,h:e.size.h}))),maxWidth:C.Z.active.album.width,minWidth:100,spacing:2,forMedia:!0});const{width:p,height:f}=t.style,m=parseInt(p),g=parseInt(f);u.forEach(((e,s)=>{var n;const{size:r,media:u,message:p}=e,f=!!(null===(n=p.media.pFlags)||void 0===n?void 0:n.spoiler),v=t.children[s];v.dataset.mid=""+p.mid,v.dataset.peerId=""+p.peerId;const b=v.firstElementChild;let y;if(y="photo"===u._?(0,nt.Z)({photo:u,message:p,container:b,boxWidth:0,boxHeight:0,isOut:o,lazyLoadQueue:a,middleware:i,size:r,loadPromises:d,autoDownloadSize:l.photo,managers:c}):(0,at.Z)({doc:u,container:b,message:p,boxWidth:0,boxHeight:0,withTail:!1,isOut:o,lazyLoadQueue:a,middleware:i,loadPromises:d,autoDownload:l,managers:c,noAutoplayAttribute:f}),y&&(null==d||d.push(y)),f){const e=(y||Promise.resolve()).then((()=>{return e=this,t=void 0,n=function*(){if(!i())return;const{width:e,height:t}=v.style,s=+e.slice(0,-1)/100*m,n=+t.slice(0,-1)/100*g,a=yield(0,st.ZP)({media:u,animationGroup:h,middleware:i,width:s,height:n});i()&&b.append(a)},new((s=void 0)||(s=Promise))((function(i,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,r)}d((n=n.apply(e,t||[])).next())}));var e,t,s,n}));null==d||d.push(e)}}))}var rt=i(296);function dt(e){var t;if(!e)return;const i=null===(t=e.media)||void 0===t?void 0:t.document;return["voice","audio","video"].includes(null==i?void 0:i.type)&&i.duration||void 0}var lt=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))},ct=i(7030),ht=i(4332),ut=i(3552),pt=i(5005);class ft extends ut._{init(e){return t=this,i=void 0,n=function*(){this.container.id="poll-results-container",this.container.classList.add("chatlist-container"),this.resultsDiv=document.createElement("div"),this.resultsDiv.classList.add("poll-results"),this.scrollable.append(this.resultsDiv);const t=yield this.managers.appPollsManager.getPoll(e.media.poll.id);this.setTitle(t.poll.pFlags.quiz?"PollResults.Title.Quiz":"PollResults.Title.Poll");const i=document.createElement("h3");(0,Z.Z)(i,(0,k.Z)(t.poll.question));const s=t.results.results.map((e=>e.voters/t.results.total_voters*100));bt(s);const n=document.createDocumentFragment();t.results.results.forEach(((i,a)=>{if(!i.voters)return;const o=document.createElement("hr"),r=t.poll.answers[a],d=document.createElement("div");d.classList.add("poll-results-answer");const l=document.createElement("div");(0,Z.Z)(l,(0,k.Z)(r.text));const c=document.createElement("div");c.innerText=Math.round(s[a])+"%",d.append(l,c);const h=pt.default.createChatList();h.classList.add("poll-results-voters"),pt.default.setListClickListener(h,(()=>{ht.ZP.onCloseBtnClick()}),void 0,!0),h.style.minHeight=48*Math.min(i.voters,4)+"px",n.append(o,d,h);let u,p=4,f=!1,m=Math.max(0,i.voters-4);const g=()=>{f||(f=!0,this.managers.appPollsManager.getVotes(e,r.option,u,p).then((e=>{e.votes.forEach((e=>{const{dom:t}=pt.default.addDialogNew({peerId:e.user_id.toPeerId(!1),container:h,rippleEnabled:!1,meAsSaved:!1,avatarSize:"small"});t.lastMessageSpan.parentElement.remove()})),u&&(m=Math.max(0,m-e.votes.length),m&&v.lastElementChild.replaceWith((0,I.ag)("PollResults.LoadMore",[Math.min(20,m)]))),u=e.next_offset,p=20,m&&e.votes.length||v.remove()})).finally((()=>{f=!1})))},v=(0,ve.Z)("poll-results-more btn btn-primary btn-transparent",{icon:"down"});v.addEventListener("click",g),v.append((0,I.ag)("PollResults.LoadMore",[Math.min(20,m)])),n.append(v),g()})),this.resultsDiv.append(i,n),ht.ZP.toggleSidebar(!0).then((()=>{}))},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n}}var mt=i(5157),gt=i(5994);let vt=0;const bt=e=>{const t=e.reduce(((e,t)=>e+Math.round(t)),0);if(t>100){const i=t-100,s=e.length;for(let t=0;t=.5&&si&&(i=s,t=n)}if(-1===t)return;e[t]+=1-i}}};n.Z.addEventListener("poll_update",(({poll:e,results:t})=>{Array.from(document.querySelectorAll(`poll-element[poll-id="${e.id}"]`)).forEach((i=>{i.isClosed=!!e.pFlags.closed,i.performResults(t,e.chosenIndexes)}))})),C.Z.addEventListener("resize",(()=>{It.setMaxLength(),It.resizePolls()})),C.Z.addEventListener("changeScreen",(()=>{It.setMaxLength()}));const yt=(e,t,i)=>{e.classList.remove("active"),clearTimeout(i),setTimeout((()=>{t(),e.remove(),wt===e&&St===t&&Ct===i&&(wt=St=null,Ct=0)}),200)};let wt,St,Ct,Lt=!1;class It extends HTMLElement{constructor(){super(...arguments),this.isClosed=!1,this.isQuiz=!1,this.isRetracted=!1,this.isPublic=!1,this.isMultiple=!1,this.chosenIndexes=[],this.chosingIndexes=[],this.sentVote=!1,this.clickHandler=e=>{const t=(0,q.Z)(e.target,"poll-answer");if(!t)return;(0,J.Z)(e);const i=+t.dataset.index;if(this.isMultiple){t.classList.toggle("is-chosing");const e=this.chosingIndexes.indexOf(i);-1!==e?this.chosingIndexes.splice(e,1):this.chosingIndexes.push(i)}else this.sendVotes([i])}}static setMaxLength(){const e=de.Z.width<=360?de.Z.width-120:C.Z.active.poll.width;this.MAX_LENGTH=e+9+this.MAX_OFFSET+-13.7}static resizePolls(){this.MAX_LENGTH&&Array.from(document.querySelectorAll("poll-element.is-voted")).forEach((e=>{e.svgLines.forEach(((t,i)=>{e.setLineProgress(i,1)}))}))}render(){return e=this,t=void 0,s=function*(){vt||(vt=document.getElementById("poll-line").getTotalLength(),It.setMaxLength());const{poll:e,results:t}=this.message.media;let i;this.message.pFlags.is_scheduled&&this.classList.add("disable-hover"),e.pFlags&&(this.isPublic=!!e.pFlags.public_voters,this.isQuiz=!!e.pFlags.quiz,this.isClosed=!!e.pFlags.closed,this.isMultiple=!!e.pFlags.multiple_choice,this.isClosed?(i="Chat.Poll.Type.Closed",this.classList.add("is-closed")):i=this.isQuiz?this.isPublic?"Chat.Poll.Type.Quiz":"Chat.Poll.Type.AnonymousQuiz":this.isPublic?"Chat.Poll.Type.Public":"Chat.Poll.Type.Anonymous"),this.classList.toggle("is-multiple",this.isMultiple);const s=this.isMultiple?'':"",a=e.answers.map(((e,t)=>`\n
\n
\n
\n \n \n \n ${s}\n
\n
\n
\n \n \n
\n `)).join("");if(this.innerHTML=`\n
\n
\n
\n
\n
\n ${a}`,(0,Z.Z)(this.firstElementChild,(0,k.Z)(e.question)),Array.from(this.querySelectorAll(".poll-answer-text")).forEach(((t,i)=>{(0,Z.Z)(t,(0,k.Z)(e.answers[i].text))})),this.descDiv=this.firstElementChild.nextElementSibling,this.typeDiv=this.descDiv.firstElementChild,this.avatarsDiv=this.descDiv.lastElementChild,i&&this.typeDiv.append((0,I.ag)(i)),this.isQuiz&&(this.classList.add("is-quiz"),e.close_period&&e.close_date)){const t=document.createElement("div");t.classList.add("poll-time"),this.descDiv.append(t);const i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.classList.add("poll-quiz-timer"),this.quizTimer=i;const s=2,a=7,o=2*Math.PI*a,r=document.createElementNS("http://www.w3.org/2000/svg","circle");r.classList.add("poll-quiz-timer-circle"),r.setAttributeNS(null,"cx","16"),r.setAttributeNS(null,"cy","16"),r.setAttributeNS(null,"r",""+a),r.setAttributeNS(null,"stroke-width",""+s),i.append(r),this.descDiv.append(i);const d=1e3*e.close_period,l=1e3*(e.close_date-(yield n.Z.managers.timeManager.getServerTimeOffset()));this.quizInterval=window.setInterval((()=>{const e=Date.now(),i=(l-e)/d,s=(l-e)/1e3+1|0;t.innerHTML=(0,mt.Z)(s),s<=5&&(t.style.color="#ee545c",r.style.stroke="#ee545c"),r.style.strokeDashoffset=o+i*o,r.style.strokeDasharray=`${o} ${o}`,e>=l&&(clearInterval(this.quizInterval),t.innerHTML="",r.style.strokeDashoffset=o,this.quizInterval=0,setTimeout((()=>{this.managers.appPollsManager.getResults(this.message)}),3e3))}),1e3)}this.answerDivs=Array.from(this.querySelectorAll(".poll-answer")),this.svgLines=Array.from(this.querySelectorAll(".poll-line")),this.numberDivs=Array.from(this.querySelectorAll(".poll-answer-percents"));const o=document.createElement("div");o.classList.add("poll-footer"),this.viewResults=document.createElement("div"),this.viewResults.className="poll-footer-button poll-view-results hide",this.viewResults.append((0,I.ag)("Chat.Poll.ViewResults")),this.votersCountDiv=document.createElement("div"),this.votersCountDiv.className="poll-votes-count",o.append(this.viewResults,this.votersCountDiv),this.append(o),this.viewResults.addEventListener("click",(e=>{(0,J.Z)(e),ht.ZP.isTabExists(ft)||ht.ZP.createTab(ft).open(this.message)})),(0,E.Z)(this.viewResults),this.isMultiple&&(this.sendVoteBtn=document.createElement("div"),this.sendVoteBtn.classList.add("poll-footer-button","poll-send-vote"),this.sendVoteBtn.append((0,I.ag)("Chat.Poll.SubmitVote")),(0,E.Z)(this.sendVoteBtn),e.chosenIndexes.length||this.votersCountDiv.classList.add("hide"),(0,ee.fc)(this.sendVoteBtn,(e=>{(0,J.Z)(e),this.chosingIndexes.length&&this.sendVotes(this.chosingIndexes).then((()=>{this.chosingIndexes.length=0,this.answerDivs.forEach((e=>{e.classList.remove("is-chosing")}))}))})),o.append(this.sendVoteBtn));const r=!(e.chosenIndexes.length||this.isClosed);r&&!this.isPublic||this.performResults(t,e.chosenIndexes,!1),r&&(this.setVotersCount(t),this.detachClickEvent=(0,ee.fc)(this,this.clickHandler))},new((i=void 0)||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}));var e,t,i,s}initQuizHint(e){if(e.solution&&e.solution_entities){const t=document.createElement("div");if(t.classList.add("tgico-tip","poll-hint"),this.descDiv.append(t),(0,ee.fc)(t,(i=>{(0,J.Z)(i),t.classList.add("active"),((e,t,i)=>{wt&&yt(wt,St,Ct);const n=document.createElement("div");n.classList.add("quiz-hint");const a=document.createElement("div");a.classList.add("container","tgico");const o=document.createElement("div");o.classList.add("text"),a.append(o),n.append(a),(0,Z.Z)(o,(0,_e.ZP)(e,{entities:t})),ct.ZP.chat.bubbles.container.append(n),n.offsetLeft,n.classList.add("active"),wt=n,St=i,Ct=window.setTimeout((()=>{yt(n,i,Ct)}),s.Z?5e3:7e3),Lt||(Lt=!0,ct.ZP.addEventListener("peer_changed",(()=>{wt&&yt(wt,St,Ct)})))})(e.solution,e.solution_entities,(()=>{t.classList.remove("active")}))})),this.sentVote){const i=e.results.find((e=>e.pFlags.correct));i&&!i.pFlags.chosen&&(0,ee.tH)(t)}}}sendVotes(e){if(this.sendVotePromise)return this.sendVotePromise;const t=this.answerDivs.filter(((t,i)=>e.includes(i)));return t.forEach((e=>{e.classList.add("is-voting")})),this.classList.add("disable-hover"),this.sentVote=!0,this.sendVotePromise=this.managers.appPollsManager.sendVote(this.message,e).then((()=>{t.forEach((e=>{e.classList.remove("is-voting")})),this.classList.remove("disable-hover")})).catch((()=>{this.sentVote=!1})).finally((()=>{this.sendVotePromise=null}))}performResults(e,t,i=!0){var s,n,a;if(gt.Z.isAvailable("animations")||(i=!1),this.isQuiz&&((null===(s=e.results)||void 0===s?void 0:s.length)||this.isClosed)){this.answerDivs.forEach(((t,i)=>{t.classList.toggle("is-correct",!!e.results[i].pFlags.correct)})),this.initQuizHint&&(this.initQuizHint(e),this.initQuizHint=null),this.quizInterval&&(clearInterval(this.quizInterval),this.quizInterval=0),(null===(n=this.quizTimer)||void 0===n?void 0:n.parentElement)&&this.quizTimer.remove();const t=this.descDiv.querySelector(".poll-time");t&&t.remove()}if(this.isClosed&&(this.classList.add("is-closed"),(0,_.Z)(this.typeDiv,(0,I.ag)("Chat.Poll.Type.Closed"))),(this.chosenIndexes.length!==t.length||this.isClosed)&&(this.isRetracted=this.chosenIndexes.length&&!t.length,this.chosenIndexes=t.slice(),this.isRetracted?this.detachClickEvent=(0,ee.fc)(this,this.clickHandler):(null===(a=this.detachClickEvent)||void 0===a||a.call(this),this.detachClickEvent=void 0)),this.chosenIndexes.length||this.isRetracted||this.isClosed){const t=e.results.map((t=>e.total_voters?t.voters/e.total_voters*100:0));this.classList.toggle("no-transition",!i),i&&(0,he.Z)({element:this,className:"",forwards:!this.isRetracted,duration:340}),(0,V.T2)((()=>{this.setResults(this.isRetracted?this.percents:t,this.chosenIndexes,i),this.percents=t,this.isRetracted=!1}))}if(this.setVotersCount(e),this.isPublic){this.isMultiple||(this.viewResults.classList.toggle("hide",!e.total_voters||!this.chosenIndexes.length),this.votersCountDiv.classList.toggle("hide",!!this.chosenIndexes.length));const t=(e.recent_voters||[]).map((e=>e.toPeerId())),i=new F.Z({avatarSize:16});i.render(t),(0,_.Z)(this.avatarsDiv,i.container)}if(this.isMultiple){const t=!!this.chosenIndexes.length,i=this.isClosed||t,s=!this.isPublic||!e.total_voters||!t&&!this.isClosed;this.sendVoteBtn.classList.toggle("hide",i),this.viewResults.classList.toggle("hide",s),this.votersCountDiv.classList.toggle("hide",!i||!s)}}setResults(e,t,i){this.svgLines.forEach((e=>e.style.display="")),this.answerDivs.forEach(((e,i)=>{e.classList.toggle("is-chosen",t.includes(i))}));const s=Math.max(...e);if(this.maxPercents=e.map((e=>e/s)),this.isRetracted)this.svgLines.forEach(((e,t)=>{this.setLineProgress(t,-1)}));else{const e=()=>{this.svgLines.forEach(((e,t)=>{this.setLineProgress(t,1)}))};i?(0,V.T2)(e):e()}let n;e=e.slice(),bt(e);const a=t=>{e.forEach(((e,i)=>{const s=n(e,t);this.numberDivs[i].innerText=s+"%"}))};if(this.isRetracted)if(n=(e,t)=>Math.round(e/10*t),i)for(let e=9,t=0;e>=0;--e,++t)setTimeout((()=>{a(e)}),34*t);else a(0);else if(n=(e,t)=>Math.round(e/10*(t+1)),i)for(let e=0;e<10;++e)setTimeout((()=>{a(e)}),34*e);else a(9);if(this.isRetracted){i&&this.classList.add("is-retracting"),this.classList.remove("is-voted");const e=()=>{this.svgLines.forEach((e=>e.style.display="none"))};i?setTimeout((()=>{this.classList.remove("is-retracting"),e()}),340):e()}else this.classList.add("is-voted")}setVotersCount(e){const t=e.total_voters||0;let i;const s=[t];i=this.isClosed?this.isQuiz?t?"Chat.Quiz.TotalVotes":"Chat.Quiz.TotalVotesResultEmpty":t?"Chat.Poll.TotalVotes1":"Chat.Poll.TotalVotesResultEmpty":this.isQuiz?t?"Chat.Quiz.TotalVotes":"Chat.Quiz.TotalVotesEmpty":t?"Chat.Poll.TotalVotes1":"Chat.Poll.TotalVotesEmpty",(0,_.Z)(this.votersCountDiv,(0,I.ag)(i,s))}setLineProgress(e,t){const i=this.svgLines[e];-1===t?(i.style.strokeDasharray="",i.style.strokeDashoffset=""):(i.style.strokeDasharray=t*this.maxPercents[e]*It.MAX_LENGTH+", 485.9",i.style.strokeDashoffset=""+t*It.MAX_OFFSET)}}It.MAX_OFFSET=-46.5,It.MAX_LENGTH=0,customElements.define("poll-element",It);const Et="֑-߿יִ-﷽ﹰ-ﻼ",Pt=(new RegExp("^[^A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿]*["+Et+"]"),new RegExp("["+Et+"]"));var Zt=i(1564),Mt=i(6628),Tt=i(5345),kt=i(3591),xt=i(9102),At=i(1656),_t=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const Ft=new Map([["messageActionHistoryClear",!0],["messageActionChatCreate",e=>e.pFlags.out]]),Dt=new Set;ge.Z&&Dt.add("messageActionPhoneCall");const Rt=void 0;let Bt=Rt,Nt=0;const Ot=3,Ut=new Error("peer changed"),Ht={1:96,2:90,3:84,4:72,5:60,6:48,7:36},zt=Object.keys(Ht).length;function jt(e){return Math.max(...e)}class Gt{constructor(e,t){let i;this.chat=e,this.managers=t,this.unreadOut=new Set,this.needUpdate=[],this.bubbles={},this.skippedMids=new Set,this.bubblesNewByGroupedId={},this.bubblesNew={},this.dateMessages={},this.scrolledDown=!0,this.isScrollingTimeout=0,this.unreaded=new Map,this.unreadedSeen=new Set,this.preloader=null,this.messagesQueueOnRenderAdditional=null,this.firstUnreadBubble=null,this.middlewareHelper=(0,X.k)(),this.followStack=[],this.isHeavyAnimationInProgress=!1,this.isFirstLoad=!0,this.passEntities={},this.viewsMids=new Set,this.isTopPaddingSet=!1,this.renderingMessages=new Set,this.bubblesToEject=new Set,this.bubblesToReplace=new Map,this.setPeerTempId=0,this.renderNewPromises=new Set,this.extendedMediaMessages=new Set,this.unreadedObserverCallback=e=>{if(e.isIntersecting){const t=e.target,i=this.unreaded.get(t);this.onUnreadedInViewport(t,i)}},this.viewsObserverCallback=e=>{if(e.isIntersecting){const t=+e.target.dataset.mid;if(this.observer.unobserve(e.target,this.viewsObserverCallback),t)this.viewsMids.add(t),this.sendViewCountersDebounced();else{const{sponsoredMessage:e}=this,t=null==e?void 0:e.random_id;t&&(this.managers.appChatsManager.viewSponsoredMessage(this.peerId.toChatId(),t),delete e.random_id)}}},this.stickerEffectObserverCallback=e=>{if(e.isIntersecting){this.observer.unobserve(e.target,this.stickerEffectObserverCallback);const t=e.target.querySelector(".attachment");(0,G.e9)().then((()=>{(0,Ye.Z)(t)&&(0,ee.tH)(t)}))}},this.onBubblesMouseMove=e=>_t(this,void 0,void 0,(function*(){const t=(0,q.Z)(e.target,"bubble-content");if("scheduled"===this.chat.type||!t||this.chat.selection.isSelecting||(0,q.Z)(e.target,"service")||(0,q.Z)(e.target,"bubble-beside-button"))this.unhoverPrevious();else{const e=(0,q.Z)(t,"bubble");if(!this.chat.selection.canSelectBubble(e))return void this.unhoverPrevious();let{hoverBubble:i,hoverReaction:s}=this;if(e===i)return;if(this.unhoverPrevious(),i=this.hoverBubble=e,s=this.hoverReaction,s)s.dataset.loaded&&this.setHoverVisible(s,!0);else{s=this.hoverReaction=document.createElement("div"),s.classList.add("bubble-hover-reaction");const i=document.createElement("div");i.classList.add("bubble-hover-reaction-sticker"),s.append(i),t.append(s);let n=yield this.chat.getMessage(+e.dataset.mid);if("message"!==(null==n?void 0:n._))return void this.unhoverPrevious();n=yield this.managers.appMessagesManager.getGroupsFirstMessage(n);const a=this.getMiddleware((()=>this.hoverReaction===s));Promise.all([this.managers.appReactionsManager.getAvailableReactionsByMessage(n),(0,Ce.Z)(400)]).then((([e])=>{const t=e[0];t?(0,et.ZP)({div:i,doc:t.select_animation,width:18,height:18,needUpscale:!0,middleware:a,group:this.chat.animationGroup,withThumb:!1,needFadeIn:!1}).then((({render:e})=>e)).then((e=>{(0,ae.Z)(e),e.addEventListener("firstFrame",(()=>{a()&&(s.dataset.loaded="1",this.setHoverVisible(s,!0))}),{once:!0}),(0,ee.fc)(s,(e=>{(0,J.Z)(e),this.managers.appReactionsManager.sendReaction(n,t),this.unhoverPrevious()}),{listenerSetter:this.listenerSetter})}),Ke.Z):s.remove()}))}}})),this.unhoverPrevious=()=>{const{hoverBubble:e,hoverReaction:t}=this;e&&(this.setHoverVisible(t,!1),this.hoverBubble=void 0,this.hoverReaction=void 0)},this.onBubblesClick=e=>_t(this,void 0,void 0,(function*(){var t;let i=e.target,n=null;try{n=(0,q.Z)(i,"bubble")}catch(e){}if(!n&&!this.chat.selection.isSelecting){const e=(0,q.Z)(i,"user-avatar");if(!e)return;const t=e.dataset.peerId.toPeerId();return void(t!==l.NM?this.chat.appImManager.setInnerPeer({peerId:t}):(0,Q.Am)(I.ZP.format("HidAccount",!0)))}if(n.classList.contains("is-date")&&(0,q.Z)(i,"bubble-content")){if(n.classList.contains("is-fake")&&(n=n.previousElementSibling),n.classList.contains("is-sticky")&&!this.chatInner.classList.contains("is-scrolling"))return;for(const e in this.dateMessages)if(this.dateMessages[e].div===n){Te.Z.createPopup(m.Z,new Date(+e),this.onDatePick).show();break}return}if(!s.Z&&(0,q.Z)(i,"time"))return void this.chat.selection.toggleByElement(n);if(this.chat.selection.isSelecting&&e.isTrusted){if(n.classList.contains("service")&&void 0===n.dataset.mid)return;return(0,J.Z)(e),s.Z&&this.chat.selection.selectedText?void(this.chat.selection.selectedText=void 0):void this.chat.selection.toggleByElement((0,q.Z)(i,"grouped-item")||n)}const a=(0,q.Z)(i,"media-spoiler-container");if(a)return void(0,st.kN)({event:e,mediaSpoiler:a});const o=(0,q.Z)(i,"contact");if(o){const t=o.dataset.peerId.toPeerId();if(t)this.chat.appImManager.setInnerPeer({peerId:t});else{const t=o.querySelector(".contact-number");(0,Me.T)(t.innerText.replace(/\s/g,"")),(0,Q.bC)({langPackKey:"PhoneCopied"}),(0,J.Z)(e)}return}const r=(0,q.Z)(i,"bubble-call");if(r)return void this.chat.appImManager.callUser(this.peerId.toUserId(),r.dataset.type);if((0,q.Z)(i,"is-buy")){(0,J.Z)(e);const t=yield this.chat.getMessage(+n.dataset.mid);if(!t)return;return void Te.Z.createPopup(qe.ZP,t,yield this.managers.appPaymentsManager.getInputInvoiceByPeerId(t.peerId,t.mid))}const d=(0,Y.Z)(i,"REACTION-ELEMENT");if(d){if((0,J.Z)(e),d.classList.contains("is-inactive"))return;const t=d.parentElement,i=t.getReactionCount(d),s=t.getMessage();return void this.managers.appReactionsManager.sendReaction(s,i.reaction)}const c=(0,pe.Z)(i,"data-sticker-emoji");if(c&&1===c.parentElement.querySelectorAll("[data-sticker-emoji]").length&&n.classList.contains("emoji-big"))return void(0,et._2)({event:e,container:c,managers:this.managers,middleware:this.getMiddleware(),peerId:this.peerId});if((0,q.Z)(i,"replies")){const e=+n.dataset.mid;if(this.peerId===l.hj){const t=yield this.chat.getMessage(e),i=(0,T.Z)(t.reply_to.reply_to_peer_id),s=t.reply_to.reply_to_top_id,n=t.fwd_from.saved_from_msg_id;this.chat.appImManager.openThread({peerId:i,lastMsgId:n,threadId:s})}else{const t=yield this.chat.getMessage(e),i=yield this.managers.appMessagesManager.getMessageWithReplies(t),s=i.replies;s&&this.managers.appMessagesManager.getDiscussionMessage(this.peerId,i.mid).then((e=>{this.chat.appImManager.setInnerPeer({peerId:s.channel_id.toPeerId(!0),type:"discussion",threadId:e.mid})}))}return}const h=(0,q.Z)(i,"is-via");if(h){const t=h.querySelector(".peer-title");if(i===t||(0,fe.Z)(i,t)){const i=t.innerText+" ";return this.managers.appDraftsManager.setDraft(this.peerId,this.chat.threadId,i),void(0,J.Z)(e)}}const u=(0,q.Z)(i,"peer-title")||(0,Y.Z)(i,"AVATAR-ELEMENT")||(0,pe.Z)(i,"data-saved-from");if(u&&u!==n){i=u||i;const e=i.dataset.peerId||i.getAttribute("peer")||i.peerId,t=i.dataset.savedFrom;if("string"==typeof e||t)if(t){const[e,s]=t.split("_");if(i.classList.contains("is-receipt-link")){const t=yield this.managers.appMessagesManager.getMessageByPeer(e.toPeerId(),+s);if(t){const e=yield this.managers.appPaymentsManager.getInputInvoiceByPeerId(this.peerId,+n.dataset.mid);Te.Z.createPopup(qe.ZP,t,e,void 0,!0)}}else this.chat.appImManager.setInnerPeer({peerId:e.toPeerId(),lastMsgId:+s})}else{const t=e.toPeerId();t!==l.NM?this.chat.appImManager.setInnerPeer({peerId:t}):(0,Q.Am)(I.ZP.format("HidAccount",!0))}}else if(n.classList.contains("sticker")&&i.parentElement.classList.contains("attachment")){const e=+n.dataset.mid,i=null===(t=(yield this.chat.getMessage(e)).media)||void 0===t?void 0:t.document;(null==i?void 0:i.stickerSetInput)&&Te.Z.createPopup(v.Z,i.stickerSetInput).show()}else if(!(yield this.checkTargetForMediaViewer(i,e))&&(-1===["IMG","DIV","SPAN"].indexOf(i.tagName)&&(i=(0,Y.Z)(i,"DIV")),-1!==["DIV","SPAN"].indexOf(i.tagName))){if(i.classList.contains("goto-original")){const e=n.dataset.savedFrom,[t,i]=e.split("_");return void this.chat.appImManager.setInnerPeer({peerId:t.toPeerId(),lastMsgId:+i})}if(i.classList.contains("forward")){const e=+n.dataset.mid,t=yield this.managers.appMessagesManager.getMessageByPeer(this.peerId,e);return void Te.Z.createPopup(g.Z,{[this.peerId]:yield this.managers.appMessagesManager.getMidsByMessage(t)})}let t=!1;try{t=!!(0,q.Z)(e.target,"reply")}catch(e){}if(t&&n.classList.contains("is-reply")){const e=+n.dataset.mid;this.followStack.push(e);const t=yield this.chat.getMessage(e),i=t.reply_to.reply_to_peer_id?(0,T.Z)(t.reply_to.reply_to_peer_id):this.peerId,s=t.reply_to.reply_to_msg_id;this.chat.appImManager.setInnerPeer({peerId:i,lastMsgId:s,type:this.chat.type,threadId:this.chat.threadId})}}})),this.onScroll=(e,t,i)=>{var s,n,a,o,r;if(this.isHeavyAnimationInProgress){if(null===(s=this.sliceViewportDebounced)||void 0===s||s.clearTimeout(),this.scrolledDown&&!e)return}else null===(n=this.chat.topbar.pinnedMessage)||void 0===n||n.setCorrectIndexThrottled(this.scrollable.lastScrollDirection),null===(a=this.sliceViewportDebounced)||void 0===a||a.call(this),this.setStickyDateManually();if(t&&t.distanceToEnd<300&&this.scrolledDown)return;const d=i?0:null!==(o=null==t?void 0:t.distanceToEnd)&&void 0!==o?o:this.scrollable.getDistanceToEnd();(0!==this.scrollable.lastScrollDirection&&d>0||t||i)&&(this.isScrollingTimeout?clearTimeout(this.isScrollingTimeout):this.chatInner.classList.contains("is-scrolling")||this.chatInner.classList.add("is-scrolling"),this.isScrollingTimeout=window.setTimeout((()=>{this.chatInner.classList.remove("is-scrolling"),this.isScrollingTimeout=0}),1350+(null!==(r=null==t?void 0:t.duration)&&void 0!==r?r:0))),d<300&&(i||this.scrollable.loadedAll.bottom||this.chat.setPeerPromise||!this.peerId)?(this.container.classList.add("scrolled-down"),this.scrolledDown=!0):this.container.classList.contains("scrolled-down")&&(this.container.classList.remove("scrolled-down"),this.scrolledDown=!1)},this.processBatch=(...e)=>_t(this,void 0,void 0,(function*(){var t,i,s;let[n,a,o]=e;const r=e=>e.filter((e=>e&&this.bubbles[e.bubble.dataset.mid]===e.bubble));n=r(n),o("messages rendered");const d=null===(t=n[0])||void 0===t?void 0:t.reverse,{groups:l,avatarPromises:c}=this.groupBubbles(n.filter((e=>e.updatePosition))),h=n.reduce(((e,t)=>{const i=performance.now(),s=t.promises.slice(),n=s.map((e=>_t(this,void 0,void 0,(function*(){return yield e,performance.now()-i}))));return Promise.all(n).then((e=>{o.groupCollapsed("media message time",performance.now()-i,t,e),e.forEach(((e,t)=>{o("media message time",e,t,s[t])})),o.groupEnd()})),e.push(...t.promises),e}),[]);h.push(...c),o("media promises to call",h,n,this.isHeavyAnimationInProgress),yield a(Promise.all([...h,this.setUnreadDelimiter()]).catch(Ke.Z)),yield a((0,V.AD)()),o("media promises end"),n=r(n);const{restoreScroll:u,scrollSaver:p}=this.prepareToSaveScroll(d);null===(i=this.messagesQueueOnRenderAdditional)||void 0===i||i.call(this),this.ejectBubbles();for(const[e,t]of this.bubblesToReplace){if(p&&p.replaceSaved(t,e),!n.find((t=>t.bubble===e)))continue;const i=this.bubbleGroups.getItemByBubble(e);i?(i.mounted=!1,l.includes(i.group)||l.push(i.group)):this.log.error("NO ITEM BY BUBBLE",e),this.bubblesToReplace.delete(e)}this.chat.selection.isSelecting&&n.forEach((({bubble:e})=>{this.chat.selection.toggleElementCheckbox(e,!0)})),n.forEach((({message:e,bubble:t,updatePosition:i})=>{e.pFlags.local&&i&&this.chatInner[e.pFlags.sponsored?"append":"prepend"](t)})),this.bubbleGroups.mountUnmountGroups(l),null===(s=this.updatePlaceholderPosition)||void 0===s||s.call(this),null==u||u(),(0,Ce.Z)(this.chat.setPeerPromise?1e3:0).then((()=>(0,G.e9)())).then((()=>{this.lazyLoadQueue.setAllSeen()}))})),this.onDatePick=e=>{const t=this.peerId;this.managers.appMessagesManager.requestHistory(t,0,2,-1,e,this.chat.threadId).then((e=>{var i;(null===(i=null==e?void 0:e.messages)||void 0===i?void 0:i.length)?this.peerId===t&&this.chat.setMessageId(e.messages[0].mid):this.log.error("no history!")}))},this.log=this.chat.log,this.listenerSetter=new H.Z,this.constructBubbles(),this.batchProcessor=new Tt.s({log:this.log,process:this.processBatch,possibleError:Ut}),this.bubbleGroups=new f(this.chat),this.preloader=new b.Z({cancelable:!1}),this.lazyLoadQueue=new U.Z(void 0,!0),this.lazyLoadQueue.queueId=++Nt,this.listenerSetter.add(n.Z)("history_update",(({storageKey:e,sequential:t,message:i})=>_t(this,void 0,void 0,(function*(){if(this.chat.messagesStorageKey!==e||"scheduled"===this.chat.type)return;const{mid:s}=i,o=this.bubbles[s];if(!o)return;if(this.renderNewPromises.size&&(yield Promise.all(Array.from(this.renderNewPromises))),this.messagesQueuePromise&&(yield this.messagesQueuePromise),this.bubbles[s]!==o)return;const r=this.bubbleGroups.getItemByBubble(o);if(!r)return;if(r.mid===s)return;if(t){const e=r.group,d=this.bubbleGroups.createItem(o,i),l=this.bubbleGroups.itemsArr.slice();(0,a.Z)(l,r);const c=this.bubbleGroups.findGroupSiblingByItem(d,l);if(e===(null==c?void 0:c.group)||e===this.bubbleGroups.getLastGroup()&&1===e.items.length&&d.dateTimestamp===r.dateTimestamp||this.peerId===n.Z.myId&&t&&d.dateTimestamp===r.dateTimestamp)return void this.bubbleGroups.changeBubbleMid(o,s)}this.bubbleGroups.removeAndUnmountBubble(o);const{groups:d}=this.groupBubbles([{bubble:o,message:i}]);this.bubbleGroups.mountUnmountGroups(d),this.scrollingToBubble&&this.scrollToEnd()})))),this.listenerSetter.add(n.Z)("dialog_flush",(({peerId:e})=>{this.peerId===e&&this.deleteMessagesByIds(Object.keys(this.bubbles).map((e=>+e)))})),this.listenerSetter.add(n.Z)("message_sent",(e=>_t(this,void 0,void 0,(function*(){const{storageKey:t,tempId:i,tempMessage:s,mid:a,message:o}=e;if(this.chat.messagesStorageKey!==t)return;const r=this.bubbles,d=r[i];if(d){const e=r[i];r[a]=e,e.dataset.mid=""+a,delete r[i],(0,V.T2)((()=>{const t=+e.dataset.mid;r[t]===e&&e.classList.contains("is-outgoing")&&(e.classList.remove("is-sending","is-outgoing"),e.classList.add(this.peerId===n.Z.myId&&"scheduled"!==this.chat.type||!this.unreadOut.has(t)?"is-read":"is-sent"))}))}if(this.unreadOut.has(i)&&(this.unreadOut.delete(i),this.unreadOut.add(a)),"scheduled"===this.chat.type&&(Date.now()/1e3|0)>=s.date-10&&this.deleteMessagesByIds([a]),!d)return;let l,c;const h=o.grouped_id;if(h){l=yield this.managers.appMessagesManager.getMessagesByAlbum(h);const e=l.map((({mid:e})=>e));if(!e.length||jt(e)!==a||r[a]!==d)return;if(r[a]!==d)return;c=Array.from(d.querySelectorAll(".grouped-item")).map((e=>+e.dataset.mid))}else l=[o],c=[i];const u=Array.from(d.querySelectorAll("reactions-element"));u.length&&u.forEach((e=>{e.changeMessage(o)})),l.forEach(((e,t)=>{var i,a,o,r,l;if(!e)return;const u=c[t],p=e.mid,f=d.querySelector(`.document-container[data-mid="${p}"]`)||d;if("message"!==e._)return;if(e.replies){const t=d.querySelector("replies-element");t&&(t.message=e,t.init())}const m=null!==(i=e.media)&&void 0!==i?i:{},g=m.document,v=m.poll,b=m.webpage;if(g){const t=f.querySelector(`.document-container[data-mid="${u}"] .document`);if(t){const i=(0,q.Z)(t,"document-container");!(null===(r=null===(o=null===(a=s.media)||void 0===a?void 0:a.document)||void 0===o?void 0:o.thumbs)||void 0===r?void 0:r.length)&&(null===(l=g.thumbs)||void 0===l?void 0:l.length)&&(0,G.e9)().then((()=>_t(this,void 0,void 0,(function*(){const i=t.querySelector(".time"),s=yield(0,rt.Z)({message:e,fontSize:n.Z.settings.messagesTextSize});t.replaceWith(s),i&&(s.querySelector(".document")||s).append(i)})))),i&&(i.dataset.mid=""+p)}const i=f.querySelector(`audio-element[data-mid="${u}"], .document[data-doc-id="${u}"], .media-round[data-mid="${u}"]`);i&&(i instanceof z.ZP||i.classList.contains("media-round")?(i.dataset.mid=""+e.mid,delete i.dataset.isOutgoing,i.message=e,i.onLoad(!0)):(i.dataset.docId=""+g.id,i.doc=g))}else if(v){const t=f.querySelector("poll-element");t&&(t.message=e,t.setAttribute("poll-id",""+v.id),t.setAttribute("message-id",""+p))}else b&&!f.querySelector(".web")&&(0,G.e9)().then((()=>{this.safeRenderMessage(e,!0,f),this.scrollToBubbleIfLast(f)}));if(h){const e=f.querySelector(`.grouped-item[data-mid="${u}"]`)||f;e&&(e.dataset.mid=""+p)}}))})))),this.listenerSetter.add(n.Z)("message_edit",(({storageKey:e,message:t})=>_t(this,void 0,void 0,(function*(){if(e!==this.chat.messagesStorageKey)return;const i=this.bubbles[t.mid];i&&(yield(0,G.e9)(),this.bubbles[t.mid]===i&&this.safeRenderMessage(t,!0,i))})))),this.listenerSetter.add(n.Z)("message_error",(({storageKey:e,tempId:t})=>_t(this,void 0,void 0,(function*(){if(e!==this.chat.messagesStorageKey)return;const i=this.bubbles[t];i&&(yield(0,G.e9)(),this.bubbles[t]===i&&(i.classList.remove("is-outgoing"),i.classList.add("is-error")))})))),this.listenerSetter.add(n.Z)("message_transcribed",(({peerId:e,mid:t,text:i,pending:s})=>{if(e!==this.peerId)return;const n=this.bubbles[t];if(!n)return;const a=n.querySelector("audio-element");if(!a)return;const o=n.querySelector(".document-wrapper, .quote-text.has-document"),r=a.querySelector(".audio-to-text-button span"),d=a.querySelector(".loader");if(o&&r){let e=o.querySelector(".audio-transcribed-text");if(e){if(!s){const t=e.querySelector(".audio-transcribing-dots");null==t||t.remove()}}else if(e=document.createElement("div"),e.classList.add("audio-transcribed-text"),e.append(document.createTextNode("")),o.classList.contains("document-wrapper")?a.before(e):o.append(e),s){const t=document.createElement("span");t.classList.add("audio-transcribing-dots"),e.append(t)}i||s?i&&(e.firstChild.textContent=i):(e.replaceChildren((0,I.ag)("Chat.Voice.Transribe.Error")),e.classList.add("is-error")),r.classList.remove("tgico-transcribe"),r.classList.add("tgico-up"),!s&&d&&(d.classList.remove("active"),setTimeout((()=>{d.remove()}),300)),a.transcriptionState=2}})),this.listenerSetter.add(n.Z)("album_edit",(({peerId:e,messages:t,deletedMids:i})=>{if(e!==this.peerId)return;const s=t.map((({mid:e})=>e)),n=jt(s.concat(Array.from(i))),a=this.bubbles[n];if(!a)return;const o=jt(s),r=t.find((e=>e.mid===o));this.safeRenderMessage(r,!0,a)})),this.listenerSetter.add(n.Z)("messages_reactions",(e=>_t(this,void 0,void 0,(function*(){if("scheduled"===this.chat.type)return;let t;const i=e.map((({message:e,changedResults:t})=>_t(this,void 0,void 0,(function*(){if(this.peerId!==e.peerId)return;const i=yield this.getMountedBubble(e.mid,e);return i?{bubble:(0,q.Z)(i.bubble,"bubble"),message:e,changedResults:t}:void 0}))));(yield Promise.all(i)).filter(Boolean).forEach((({bubble:e,message:i,changedResults:s})=>{t||(t=this.createScrollSaver(!1),t.save());const n=i.peerId+"_"+i.mid,a=Se.G.get(n);if(a)for(const e of a)e.update(i,s);else{if(!i.reactions||!i.reactions.results.length)return;this.appendReactionsElementToBubble(e,i,i,s)}})),t&&t.restore()})))),this.listenerSetter.add(n.Z)("messages_downloaded",(({peerId:e,mids:t})=>_t(this,void 0,void 0,(function*(){const i=this.getMiddleware();yield(0,G.e9)(),i()&&t.forEach((t=>{this.needUpdate;const s=[];(0,c.Z)(this.needUpdate,((i,n)=>{i.replyMid===t&&i.replyToPeerId===e&&(this.needUpdate.splice(n,1)[0],s.push(i))})),s.forEach((({mid:e,replyMid:t,replyToPeerId:s})=>_t(this,void 0,void 0,(function*(){const n=this.bubbles[e];if(!n)return;const[a,o]=yield Promise.all([yield this.chat.getMessage(e),yield this.managers.appMessagesManager.getMessageByPeer(s,t)]);if(!i())return;let r;O.setReply({chat:this.chat,bubble:n,message:a});const d=n.querySelectorAll(".timestamp");o&&(r=dt(o))&&d.forEach((e=>{+e.dataset.timestamp{const t=e.target;return t.closest(".attachment.media-sticker-wrapper")||(0,q.Z)(t,"attachment")&&t.closest(".custom-emoji")}}),(0,ee.fc)(this.scrollable.container,this.onBubblesClick,{listenerSetter:this.listenerSetter}),this.listenerSetter.add(this.scrollable.container)("mousedown",(e=>{if(0!==e.button)return;const t=(0,Y.Z)(e.target,"CODE");if(t){(0,J.Z)(e),i=t,(0,Me.T)(i.textContent);const s=e=>{(0,J.Z)(e),(0,Q.bC)({langPackKey:"TextCopied",onClose:()=>{n()}})},n=(0,ee.fc)(window,s,{listenerSetter:this.listenerSetter,once:!0,capture:!0})}else var i})),this.stickyIntersector=new w.Z(this.scrollable.container,((e,t)=>{for(const i in this.dateMessages){const s=this.dateMessages[i];if(s.container===t){const t=s.div;t.classList.toggle("is-sticky",e),e&&(this.previousStickyDate=t);break}}this.previousStickyDate})),L.IS_SAFARI||(this.sliceViewportDebounced=(0,oe.Z)(this.sliceViewport.bind(this),3e3,!1,!0)),(0,G.ZP)((()=>{this.isHeavyAnimationInProgress=!0,this.lazyLoadQueue.lock(),i=this.getMiddleware()}),(()=>{this.isHeavyAnimationInProgress=!1,(null==i?void 0:i())&&this.lazyLoadQueue.unlockAndRefresh(),i=null}),this.listenerSetter)}constructBubbles(){const e=this.container=document.createElement("div");e.classList.add("bubbles","scrolled-down"),(this.chatInner=document.createElement("div")).classList.add("bubbles-inner"),this.setScroll(),e.append(this.scrollable.container)}attachContainerListeners(){const e=this.container;if(this.chat.contextMenu.attachTo(e),this.chat.selection.attachListeners(e,new H.Z),W.ZP&&this.listenerSetter.add(e)("dblclick",(e=>_t(this,void 0,void 0,(function*(){const t=(0,q.Z)(e.target,"grouped-item")||(0,q.Z)(e.target,"bubble");if(t){const e=+t.dataset.mid;this.log("debug message:",yield this.chat.getMessage(e)),this.highlightBubble(t)}})))),L.IS_MOBILE){if(s.Z){const t="is-gesturing-reply",i=64,s=.75*i;let n,a,o,r=!1;(0,ue.Z)({element:e,verifyTouchTarget:e=>_t(this,void 0,void 0,(function*(){if("pinned"===this.chat.type||this.chat.selection.isSelecting||!(yield this.chat.canSend()))return!1;if(n=(0,q.Z)(e.target,"bubble"),n){try{const e=n.parentElement.querySelector(".bubbles-group-avatar");e&&(0,be.Z)(e,n)&&(o=e)}catch(e){}[n,o].filter(Boolean).forEach((e=>{(0,he.Z)({element:e,className:t,forwards:!0,duration:250}),e.offsetLeft})),a?(a.classList.remove("is-visible"),a.style.opacity=""):(a=document.createElement("span"),a.classList.add("tgico-reply_filled","bubble-gesture-reply-icon")),n.append(a)}return!!n})),onSwipe:e=>{r=e>=s,r&&!a.classList.contains("is-visible")&&a.classList.add("is-visible"),a.style.opacity=""+Math.min(1,e/s);const t=`translateX(${-Math.max(0,Math.min(i,e))}px)`;n.style.transform=t,o&&(o.style.transform=t),(0,ze.s)()},onReset:()=>{const e=n,i=o;n=o=void 0;const s=()=>{a.parentElement===e&&(a.classList.remove("is-visible"),a.remove())};[e,i].filter(Boolean).forEach(((e,i)=>{(0,he.Z)({element:e,className:t,forwards:!1,duration:250,onTransitionEnd:0===i?s:void 0})})),(0,V.T2)((()=>{if(e.style.transform="",i&&(i.style.transform=""),r){const{mid:t}=e.dataset;this.chat.input.initMessageReply(+t),r=!1}}))},listenerOptions:{capture:!0}})}}else this.listenerSetter.add(e)("dblclick",(e=>_t(this,void 0,void 0,(function*(){if("pinned"===this.chat.type||this.chat.selection.isSelecting||!(yield this.chat.canSend()))return;const t=e.target,i=t.classList.contains("bubble")?t:t.classList.contains("document-selection")?t.parentElement:null;if(i&&!i.classList.contains("bubble-first")){const e=+i.dataset.mid;if((yield this.chat.getMessage(e)).pFlags.is_outgoing)return;this.chat.input.initMessageReply(e)}}))))}constructPeerHelpers(){this.listenerSetter.add(n.Z)("history_append",(({storageKey:e,message:t})=>_t(this,void 0,void 0,(function*(){e===this.chat.messagesStorageKey&&"scheduled"!==this.chat.type&&(gt.Z.isAvailable("chat_background")&&(this.updateGradient=!0),this.scrollable.loadedAll.bottom?this.renderNewMessage(t,!0):this.chat.setMessageId())})))),this.listenerSetter.add(n.Z)("history_multiappend",(e=>{this.peerId===e.peerId&&"scheduled"!==this.chat.type&&this.renderNewMessage(e)})),this.listenerSetter.add(n.Z)("history_delete",(({peerId:e,msgs:t})=>{e===this.peerId&&"scheduled"!==this.chat.type&&this.deleteMessagesByIds(Array.from(t))})),this.listenerSetter.add(n.Z)("dialog_unread",(({peerId:e})=>{e===this.peerId&&(this.chat.input.setUnreadCount(),(0,G.e9)().then((()=>{this.updateUnreadByDialog()})))})),this.listenerSetter.add(n.Z)("dialogs_multiupdate",(e=>{e.has(this.peerId)&&"scheduled"!==this.chat.type&&this.chat.input.setUnreadCount()})),this.listenerSetter.add(n.Z)("dialog_notify_settings",(e=>{this.peerId===e.peerId&&"scheduled"!==this.chat.type&&this.chat.input.setUnreadCount()})),this.listenerSetter.add(n.Z)("chat_update",(e=>_t(this,void 0,void 0,(function*(){const{peerId:t}=this;if(t!==e.toPeerId(!0))return;const i=yield this.managers.appChatsManager.getChat(e),s=this.chatInner.classList.contains("has-rights"),n=this.chat.input.canSendPlain(),[a,o,r]=yield Promise.all([this.chat.canSend("send_messages"),this.chat.canSend("send_plain"),this.chat.canSend("embed_links")]);s===a&&n===o||(yield Promise.all([this.finishPeerChange(),this.chat.input.finishPeerChange()])).forEach((e=>e())),(r&&!this.chat.input.willSendWebPage||!r&&this.chat.input.willSendWebPage)&&(this.chat.input.lastUrl="",this.chat.input.onMessageInput()),!!i.pFlags.forum!==this.chat.isForum&&"chat"===this.chat.type&&(this.chat.peerId=0,this.chat.appImManager.setPeer({peerId:t}))})))),this.listenerSetter.add(n.Z)("history_reload",(e=>{if(e!==this.peerId)return;const t=(0,Ie.Z)(this.bubbles,"desc").filter((e=>e>0)),i=this.getMiddleware();this.managers.appMessagesManager.reloadMessages(this.peerId,t).then((e=>{if(!i())return;const s=[];e.forEach(((e,i)=>{const n=t[i];if(e){const t=this.bubbles[e.mid];if(!t)return;this.safeRenderMessage(e,!0,t)}else s.push(n)})),this.deleteMessagesByIds(s),this.setLoaded("top",!1),this.setLoaded("bottom",!1),this.scrollable.checkForTriggers()}))})),this.listenerSetter.add(n.Z)("settings_updated",(({key:e})=>_t(this,void 0,void 0,(function*(){if("settings.emoji.big"===e){const e=this.getMiddleware(),t=(0,Ie.Z)(this.bubbles,"desc").map((e=>_t(this,void 0,void 0,(function*(){const t=this.bubbles[e];if(t.classList.contains("can-have-big-emoji"))return{bubble:t,message:yield this.chat.getMessage(e)}})))),i=yield Promise.all(t);if(!e())return;i.filter(Boolean).forEach((({bubble:e,message:t})=>{this.bubbles[t.mid]===e&&this.safeRenderMessage(t,!0,e)}))}})))),this.listenerSetter.add(n.Z)("messages_views",(e=>{"scheduled"!==this.chat.type&&(0,V.T2)((()=>{let t;for(const{peerId:i,views:s,mid:n}of e){if(this.peerId!==i)continue;const e=this.bubbles[n];if(!e)continue;const a=Array.from(e.querySelectorAll(".post-views"));if(!a.length)continue;const o=(0,M.Z)(s,1);let r=!1;a.forEach((e=>{(r||e.textContent!==o)&&(t||(t=this.createScrollSaver(!0),t.save()),r=!0,e.textContent=o)}))}null==t||t.restore()}))})),this.observer=new Pe({root:this.scrollable.container}),this.sendViewCountersDebounced=(0,oe.Z)((()=>{const e=[...this.viewsMids];this.viewsMids.clear(),this.managers.appMessagesManager.incrementMessageViews(this.peerId,e)}),1e3,!1,!0),this.listenerSetter.add(n.Z)("peer_pinned_messages",(({peerId:e,mids:t,pinned:i})=>{"pinned"===this.chat.type&&e===this.peerId&&t&&(i||this.deleteMessagesByIds(t))}));const e=()=>_t(this,void 0,void 0,(function*(){this.chat.topbar.setTitle((yield this.managers.appMessagesManager.getScheduledMessagesStorage(this.peerId)).size)}));this.listenerSetter.add(n.Z)("scheduled_new",(t=>{"scheduled"===this.chat.type&&t.peerId===this.peerId&&(this.renderNewMessage(t),e())})),this.listenerSetter.add(n.Z)("scheduled_delete",(({peerId:t,mids:i})=>{"scheduled"===this.chat.type&&t===this.peerId&&(this.deleteMessagesByIds(i),e())}))}get peerId(){return this.chat.peerId}get messagesQueuePromise(){return this.batchProcessor.queuePromise}createScrollSaver(e=!0){return new Le.Z(this.scrollable,".bubble:not(.is-date)",e)}createResizeObserver(){if(!("ResizeObserver"in window)||this.resizeObserver)return;const e=this.scrollable.container;let t=0,i=!1,s=!1,n=0,a=0,o=0;const r=()=>{const r=e.offsetHeight,d=this.scrollable.isScrolledDown;r===t||s&&d||(a+=t-r),a&&this.scrollable.setScrollTopSilently(this.scrollable.scrollTop+Math.round(a)),t=r,n=0,o=0,a=0,i=!1,s=!1},d=e=>{o&&window.cancelAnimationFrame(o),o=window.requestAnimationFrame(e?r:()=>{o=window.requestAnimationFrame(r)})};(this.resizeObserver=new ResizeObserver((e=>{if(s)return void d(!1);const o=e[0].contentRect.height;if(!t)return void(t=o);const r=t-o;let l=r+a;const c=l%1;if(l-=c,!i&&(i=!0,r<0&&this.scrollable.isScrolledDown))return a=-r,s=!0,void d(!1);if(n+=l,l){const e=this.scrollable.scrollTop+l;this.scrollable.setScrollTopSilently(e)}d(!1),a=c,t=o}))).observe(e)}destroyResizeObserver(){const e=this.resizeObserver;e&&(e.disconnect(),this.resizeObserver=void 0)}setReactionsHoverListeners(){this.listenerSetter.add(je.Z)("toggle",this.unhoverPrevious),this.listenerSetter.add(He.Z)("change",this.unhoverPrevious),this.listenerSetter.add(this.chat.selection)("toggle",this.unhoverPrevious),this.listenerSetter.add(this.container)("mousemove",this.onBubblesMouseMove)}setHoverVisible(e,t){e.parentElement&&e.parentElement.classList.toggle("hover-reaction-visible",t),(0,he.Z)({element:e,className:"is-visible",forwards:t,duration:200,onTransitionEnd:t?void 0:()=>{e.remove()},useRafs:2})}setStickyDateManually(){}getRenderedLength(){return Object.keys(this.bubbles).length-this.skippedMids.size}onUnreadedInViewport(e,t){this.unreadedSeen.add(t),this.observer.unobserve(e,this.unreadedObserverCallback),this.unreaded.delete(e),this.readUnreaded()}readUnreaded(){if(this.readPromise)return;const e=this.getMiddleware();this.readPromise=Ue.Z.getFocusPromise().then((()=>_t(this,void 0,void 0,(function*(){if(!e())return;let t=Math.max(...Array.from(this.unreadedSeen));if(this.scrollable.loadedAll.bottom){const e=Math.max(...Object.keys(this.bubbles).map((e=>+e)));t>=e&&(t=Math.max((yield this.chat.getHistoryMaxId())||0,t))}this.unreaded.forEach(((e,i)=>{e<=t&&this.onUnreadedInViewport(i,e)}));const i=[];for(const e of this.unreadedSeen)De(yield this.chat.getMessage(e))&&i.push(e);return this.managers.appMessagesManager.readMessages(this.peerId,i),this.unreadedSeen.clear(),W.ZP&&this.log("will readHistory by maxId:",t),this.managers.appMessagesManager.readHistory(this.peerId,t,this.chat.threadId).catch((e=>{this.log.error("readHistory err:",e),this.managers.appMessagesManager.readHistory(this.peerId,t,this.chat.threadId)})).finally((()=>{e()&&(this.readPromise=void 0,this.unreadedSeen.size&&this.readUnreaded())}))}))))}checkTargetForMediaViewer(e,t,i){return _t(this,void 0,void 0,(function*(){const s=(0,q.Z)(e,"bubble"),n=(0,q.Z)(e,"document-with-thumb");if("IMG"===e.tagName&&!e.classList.contains("emoji")&&!e.classList.contains("document-thumb")||e.classList.contains("album-item")||"VIDEO"===e.tagName&&!s.classList.contains("round")||n&&!n.querySelector(".preloader-container")||e.classList.contains("canvas-thumbnail")){const a=(0,q.Z)(e,"album-item")||(0,q.Z)(e,"document-container"),o=(a||s).querySelector(".preloader-container");if(o&&t)return(0,ee.tH)(o),void(0,J.Z)(t);(0,J.Z)(t);const r=+(a||s).dataset.mid,d=yield this.chat.getMessage(r);if(!d)return void this.log.warn("no message by messageId:",r);const l="webpage",c=s.classList.contains(l),h=n?e=>ce.Z.isMediaCompatibleForDocumentViewer(e):e=>"photo"===e._||["video","gif"].includes(e.type),u=[],p=c?[r]:(yield Promise.all(Object.keys(this.bubbles).map((e=>+e)).map((e=>_t(this,void 0,void 0,(function*(){const t=yield this.chat.getMessage(e),i=(0,Re.Z)(t);return i&&h(i)&&e})))))).filter(Boolean).sort(((e,t)=>e-t));p.forEach((e=>{let t;n?t=".document-container":(t=".album-item video, .album-item img, .preview video, .preview img, ",t+=this.bubbles[e].classList.contains("with-media-tail")?".bubble__media-container":".attachment video, .attachment img");const i=Array.from(this.bubbles[e].querySelectorAll(t)),s=new Set;if(n)i.forEach((e=>{u.push({element:e.querySelector(".document-ico"),mid:+e.dataset.mid,peerId:this.peerId})}));else{const t=!!this.bubbles[e].querySelector(".media-container-aspecter");i.forEach((i=>{if(t&&!(0,q.Z)(i,"media-container-aspecter"))return;const n=(0,q.Z)(i,"album-item"),a=n||i.parentElement;s.has(a)||(s.add(a),u.push({element:i,mid:n?+n.dataset.mid:e,peerId:this.peerId}))}))}})),u.sort(((e,t)=>e.mid-t.mid));const f=u.findIndex((e=>e.mid===r));return W.ZP&&this.log("open mediaViewer single with ids:",p,f,u),u[f]?((new ce.Z).setSearchContext({threadId:this.chat.threadId,peerId:this.peerId,inputFilter:{_:n?"inputMessagesFilterDocument":"inputMessagesFilterPhotoVideo"},useSearch:"scheduled"!==this.chat.type&&!c,isScheduled:"scheduled"===this.chat.type}).openMedia({message:d,target:u[f].element,fromRight:0,reverse:!0,prevTargets:u.slice(0,f),nextTargets:u.slice(f+1),mediaTimestamp:i}),!0):void this.log("no target for media viewer!",e)}}))}onGoDownClick(){return _t(this,void 0,void 0,(function*(){if(!this.followStack.length)return void this.chat.setMessageId();const e=this.getMiddleware(),t=this.followStack.slice(),i=yield Promise.all(t.map((e=>this.chat.getMessage(e))));if(!e())return;t.forEach(((e,t)=>{const s=i[t],n=this.bubbles[e];let a=!0;if(n){const e=n.getBoundingClientRect();a=de.Z.height/2>e.top}else s&&(a=!1);a&&this.followStack.splice(this.followStack.indexOf(e),1)})),this.followStack.sort(((e,t)=>t-e));const s=this.followStack.pop();this.chat.setMessageId(s)}))}getBubbleByPoint(e){const t=this.getViewportSlice(),i=t.visible["top"===e?0:t.visible.length-1];return null==i?void 0:i.element}getGroupedBubble(e){return _t(this,void 0,void 0,(function*(){const t=yield this.managers.appMessagesManager.getMidsByAlbum(e);for(const e of t)if(this.bubbles[e]&&!this.skippedMids.has(e))return{bubble:this.bubbles[e],mid:e}}))}getBubbleGroupedItems(e){return Array.from(e.querySelectorAll(".grouped-item"))}getMountedBubble(e,t){return _t(this,void 0,void 0,(function*(){if(void 0===t&&(t=yield this.chat.getMessage(e)),!t)return;const i=t.grouped_id;if(i){const t=yield this.getGroupedBubble(i);if(t)return t.bubble=t.bubble.querySelector(`.document-container[data-mid="${e}"]`)||t.bubble,t}const s=this.bubbles[e];return s&&!this.skippedMids.has(e)?{bubble:s,mid:e}:void 0}))}findNextMountedBubbleByMsgId(e,t){const i=(0,Ie.Z)(this.bubbles,t?"desc":"asc");let s;s=t?t=>te{var t;return!!s(e)&&!!(null===(t=this.bubbles[e])||void 0===t?void 0:t.parentElement)}));return this.bubbles[n]}loadMoreHistory(e,t=!1){if(!this.peerId||this.chat.setPeerPromise||this.isHeavyAnimationInProgress||e&&(this.getHistoryTopPromise||this.scrollable.loadedAll.top)||!e&&(this.getHistoryBottomPromise||this.scrollable.loadedAll.bottom))return;const i=Object.keys(this.bubbles).map((e=>+e)).filter((e=>e>0&&!this.skippedMids.has(e))).sort(((e,t)=>e-t));i.length||i.push(0),e?(W.ZP&&this.log("Will load more (up) history by id:",i[0],"maxId:",i[i.length-1],t),this.getHistory1(i[0],!0,void 0,void 0,t)):(W.ZP&&this.log("Will load more (down) history by id:",i[i.length-1],t),this.getHistory1(i[i.length-1],!1,!0,void 0,t))}setScroll(){this.scrollable&&this.destroyScrollable(),this.scrollable=new y.ZP(null,"IM",300),this.setLoaded("top",!1,!1),this.setLoaded("bottom",!1,!1),this.scrollable.container.append(this.chatInner),this.scrollable.onAdditionalScroll=this.onScroll,this.scrollable.onScrolledTop=()=>this.loadMoreHistory(!0),this.scrollable.onScrolledBottom=()=>this.loadMoreHistory(!1),s.Z}updateUnreadByDialog(){return _t(this,void 0,void 0,(function*(){const e=yield this.chat.getHistoryStorage(),t=this.peerId===n.Z.myId?e.readMaxId:e.readOutboxMaxId;for(const e of this.unreadOut)if(e>0&&e<=t){const t=this.bubbles[e];if(t){if(this.unreadOut.delete(e),t.classList.contains("is-outgoing")||t.classList.contains("is-error"))continue;t.classList.remove("is-sent","is-sending","is-outgoing"),t.classList.add("is-read")}}}))}destroyBubble(e,t=+e.dataset.mid){e.middlewareHelper.destroy(),this.bubbles[t]===e&&delete this.bubbles[t],this.skippedMids.delete(t),this.firstUnreadBubble===e&&(this.firstUnreadBubble=null),this.bubbleGroups.removeAndUnmountBubble(e),this.observer&&(this.observer.unobserve(e,this.unreadedObserverCallback),this.unreaded.delete(e),this.observer.unobserve(e,this.viewsObserverCallback),this.viewsMids.delete(t),this.observer.unobserve(e,this.stickerEffectObserverCallback))}deleteMessagesByIds(e,t=!0,i){let s=!1;e.forEach((e=>{const t=this.bubbles[e];t&&(this.destroyBubble(t,e),s=!0)})),s&&(this.scrollable.ignoreNextScrollEvent(),t&&this.chat.selection.isSelecting&&this.chat.selection.deleteSelectedMids(this.peerId,e),S.Z.checkAnimations(!1,this.chat.animationGroup),this.deleteEmptyDateGroups(),i||this.scrollable.onScroll())}pollExtendedMediaMessages(){const e=Array.from(this.extendedMediaMessages);return this.managers.appMessagesManager.getExtendedMedia(this.peerId,e)}setExtendedMediaMessagesPollInterval(){!this.pollExtendedMediaMessagesPromise&&this.extendedMediaMessages.size&&(this.pollExtendedMediaMessagesPromise=(0,Ce.Z)(3e4).then((()=>this.pollExtendedMediaMessages())).then((()=>this.setExtendedMediaMessagesPollInterval())))}setTopPadding(e=this.getMiddleware()){let t,i=!1;if(!this.isTopPaddingSet&&"scheduled"!==this.chat.type){const{clientHeight:e,scrollHeight:s}=this.scrollable.container;i=e===s,i&&(t=this.chatInner,t.style.paddingTop=e+"px",this.scrollable.setScrollTopSilently(s),this.isTopPaddingSet=!0)}return{isPaddingNeeded:i,unsetPadding:i?()=>{e()&&i&&(t.style.paddingTop="",this.isTopPaddingSet=!1)}:void 0}}renderNewMessage(e,t){const i=this._renderNewMessage(e,t);return this.renderNewPromises.add(i),i.catch(Ke.Z).finally((()=>{this.renderNewPromises.delete(i)})),i}_renderNewMessage(e,t){return _t(this,void 0,void 0,(function*(){if(!this.scrollable.loadedAll.bottom){const t=this.chat.setPeerPromise;if(t){const i=this.getMiddleware();t.then((()=>_t(this,void 0,void 0,(function*(){if(!i())return;const t=yield this.chat.getMessage(e.mid);i()&&this.renderNewMessage(t)}))))}return}if(this.chat.threadId&&(0,u.Z)(e,this.chat.isForum)!==this.chat.threadId)return;if(this.bubbles[e.mid])return;t||(t=this.scrolledDown&&(!this.scrollingToBubble||this.scrollingToBubble===this.getLastBubble()||this.scrollingToBubble===this.chatInner));const i=this.getMiddleware(),{isPaddingNeeded:s,unsetPadding:n}=this.setTopPadding(i),a=this.performHistoryResult({history:[e]},!1);return t&&a.then((()=>{if(!i())return;let t;"scheduled"===this.chat.type&&(t=this.bubbles[e.mid]);const a=t?this.scrollToBubbleEnd(t):this.scrollToEnd();s&&a.then(n)})),a}))}getLastBubble(){var e;const t=this.bubbleGroups.getLastGroup();return null===(e=null==t?void 0:t.lastItem)||void 0===e?void 0:e.bubble}scrollToBubble(e,t,i,s){const n=(0,q.Z)(e,"bubble");let a;if(e.parentElement||this.log.error("element is not connected",n),n&&"end"!==t){const e=this.bubbleGroups.getItemByBubble(n);e&&e.group.firstItem===e&&(0,se.Z)(e.group.container)===(this.stickyIntersector?Ot:1)&&(a=e.group.container.parentElement)}const o=this.chat.input.messageInput&&this.chat.input.messageInput.classList.contains("is-changing-height")||this.chat.container.classList.contains("is-toggling-helper"),r=this.scrollable.scrollIntoViewNew({element:e,position:t,margin:4,forceDirection:i,forceDuration:s,axis:"y",getNormalSize:o?({rect:e})=>{let t=de.Z.height;return t-=this.container.offsetTop,t-=C.Z.isMobile||de.Z.height<570?58:78,t}:void 0,fallbackToElementStartWhenCentering:a,startCallback:e=>{if(this.onScroll(!0,e),this.updateGradient){const{gradientRenderer:t}=this.chat;null==t||t.toNextPosition(e.getProgress),this.updateGradient=void 0}}});return i===j.f.Static&&(this.scrollable.lastScrollPosition=this.scrollable.scrollTop),r}scrollToEnd(){return this.scrollToBubbleEnd(this.chatInner)}scrollToBubbleEnd(e){return _t(this,void 0,void 0,(function*(){if(e){this.scrollingToBubble=e;const t=this.getMiddleware();if(yield this.scrollToBubble(e,"end",void 0,void 0),!t())return;this.scrollingToBubble=void 0}}))}scrollToBubbleIfLast(e){return _t(this,void 0,void 0,(function*(){if(this.getLastBubble()===e)return this.scrollToEnd()}))}highlightBubble(e){const t="highlightTimeout";e.dataset[t]&&(clearTimeout(+e.dataset[t]),e.classList.remove("is-highlighted"),e.offsetWidth),e.classList.add("is-highlighted"),e.dataset[t]=""+setTimeout((()=>{e.classList.remove("is-highlighted"),delete e.dataset[t]}),2e3)}createDateBubble(e,t=new Date(1e3*e)){let i;const s=new Date;s.setHours(0,0,0,0);const n="scheduled"===this.chat.type;if(s.getTime()===t.getTime())i=(0,I.ag)(n?"Chat.Date.ScheduledForToday":"Date.Today");else if(n&&e===re._)i=(0,I.ag)("MessageScheduledUntilOnline");else{const e={day:"numeric",month:"long"};t.getFullYear()!==s.getFullYear()&&(e.year="numeric"),i=new I.ZP.IntlDateElement({date:t,options:e}).element,n&&(i=(0,I.ag)("Chat.Date.ScheduledFor",[i]))}const a=document.createElement("div");a.className="bubble service is-date";const o=document.createElement("div");o.classList.add("bubble-content");const r=document.createElement("div");return r.classList.add("service-msg"),r.append(i),o.append(r),a.append(o),a}getDateForDateContainer(e){const t=new Date(1e3*e);return t.setHours(0,0,0),{date:t,dateTimestamp:t.getTime()}}getDateContainerByTimestamp(e){var t;const{date:i,dateTimestamp:s}=this.getDateForDateContainer(e);let n=this.dateMessages[s];if(n)return n;const a=this.createDateBubble(e,i),o=this.createDateBubble(e,i);o.classList.add("is-fake");const r=document.createElement("section");r.className="bubbles-date-group",r.append(a,o),n=this.dateMessages[s]={div:a,container:r,firstTimestamp:i.getTime()};const d=(0,Ie.Z)(this.dateMessages,"asc"),l=d.length;let c,h=0;for(;hthis.setPeerTempId===r,u=(0,Ge.Z)(h,Ut);i||(yield u(this.chat.onChangePeer(e,u)));const p=this.chat.type;("scheduled"===p||this.chat.isRestricted)&&(a=0);const f=yield u(this.chat.getHistoryStorage()),m="pinned"===p?yield u(this.managers.appMessagesManager.getPinnedMessagesMaxId(s,this.chat.threadId)):null!==(t=f.maxId)&&void 0!==t?t:0,g=void 0!==a;let v,b,y,w=0;if(!g)if(i||(b=this.chat.appImManager.getChatSavedPosition(this.chat)),b);else if(m){w=yield u(this.managers.appMessagesManager.getReadMaxIdIfUnread(s,this.chat.threadId));const e=yield u(this.chat.getDialogOrTopic());if(!w||i||e&&1===e.unread_count)a=m;else{const e=f.history.findSliceOffset(w);e&&e.slice.isEnd($.D.Bottom)&&(y=e.slice[e.offset-25]||e.slice[0]||w),v=!g,a=w}}const C=a!==m;if(void 0===o&&(yield u(this.chat.isStartButtonNeeded()))&&(o=l.gZ),i){n&&a&&this.followStack.push(n);const t=yield u(this.getMountedBubble(a));if(t)return g?(this.scrollToBubble(t.bubble,"center"),this.highlightBubble(t.bubble),this.chat.dispatchEvent("setPeer",a,!1)):m&&!C&&(this.scrollToEnd(),this.chat.dispatchEvent("setPeer",a,!0)),void 0!==o&&this.chat.input.setStartParam(o),e.mediaTimestamp&&(0,G.e9)().then((()=>{this.playMediaWithTimestampAndMid({lastMsgId:a,middleware:h,mediaTimestamp:e.mediaTimestamp})})),null}else this.peerId&&(this.lazyLoadQueue.queueId=++Nt,this.managers.apiFileManager.setQueueId(this.chat.bubbles.lazyLoadQueue.queueId)),this.followStack.length=0,this.passEntities={messageEntityBotCommand:(yield u(this.managers.appPeersManager.isAnyGroup(s)))||this.chat.isBot};W.ZP&&c("setPeer peerId:",s,f,a,m);const L=null!=y?y:C||"scheduled"===p||this.chat.isRestricted?0:m;let I=0;if(i){const e=this.getBubbleByPoint("bottom");e&&(I=+e.dataset.mid),I<=0&&(I=Math.max(...Object.keys(this.bubbles).map((e=>+e))))}else this.isFirstLoad=!0,this.destroyResizeObserver();const E=this.chatInner,P=this.emptyPlaceholderBubble;this.cleanup();const Z=this.chatInner=document.createElement("div");i?(Z.className=E.className,Z.classList.remove("disable-hover","is-scrolling")):Z.classList.add("bubbles-inner"),this.lazyLoadQueue.lock();const M=i||m&&C||g,T=I>0&&(!a||Ithis.performHistoryResult({history:b.mids},!0))),cached:!0,waitPromise:Promise.resolve()}:yield u(this.getHistory1(a,!0,C,L)),this.setPeerCached=A.cached,c.warn("got history");const{promise:F,cached:D}=A;D||i||(yield u(this.chat.finishPeerChange(g,C,a,o)),this.scrollable.container.textContent="",this.preloader.attach(this.container)),S.Z.lockGroup(this.chat.animationGroup);const R=u(F).then((()=>_t(this,void 0,void 0,(function*(){var t;c.warn("promise fulfilled");const n=M?yield u(a?this.getMountedBubble(a):{bubble:this.getLastBubble()}):void 0;D&&!i&&(c.warn("finishing peer change"),yield u(this.chat.finishPeerChange(g,C,a,o)),c.warn("finished peer change")),this.preloader.detach(),this.resolveLadderAnimation&&(this.resolveLadderAnimation(),this.resolveLadderAnimation=void 0),this.setPeerCached=void 0;const r=this.scrollable;if(r.lastScrollDirection=0,r.lastScrollPosition=0,(0,_.Z)(r.container,Z),P&&this.cleanupPlaceholders(P),this.attachPlaceholderOnRender&&this.attachPlaceholderOnRender(),!g&&this.chat.isPinnedMessagesNeeded()&&(null===(t=this.chat.topbar.pinnedMessage)||void 0===t||t.setCorrectIndex(0)),this.container.classList.toggle("has-groups",!!Object.keys(this.dateMessages).length),c.warn("mounted chat",this.chatInner===Z,this.chatInner.parentElement,performance.now()-d),S.Z.unlockGroup(this.chat.animationGroup),S.Z.checkAnimations(!1,this.chat.animationGroup),this.lazyLoadQueue.unlock(),b)r.setScrollTopSilently(b.top);else if(M){let e;if(k)r.setScrollTopSilently(99999);else if(x){const t=this.setTopPadding();t.isPaddingNeeded&&(e=t.unsetPadding),r.setScrollTopSilently(0)}let t,s=v&&this.firstUnreadBubble||(null==n?void 0:n.bubble);if((null==s?void 0:s.parentElement)||(s=this.findNextMountedBubbleByMsgId(a,!1)||this.findNextMountedBubbleByMsgId(a,!0)),s){const e=this.getLastBubble(),n=v?"start":C||g||e!==s?"center":"end";t="end"===n&&e===s&&i?this.scrollToEnd():this.scrollToBubble(s,n,i?void 0:j.f.Static),!v&&g&&this.highlightBubble(s)}e&&(t||Promise.resolve()).then((()=>{e()}))}else r.setScrollTopSilently(99999);this.onRenderScrollSet(),this.onScroll();const l=Promise.all([R,(0,G.e9)()]);if(l.then((()=>{h()&&(r.checkForTriggers(),void 0!==e.mediaTimestamp)&&(D&&!i&>.Z.isAvailable("animations")&&this.chat.appImManager.chats.length>1?(0,Ce.Z)(400):Promise.resolve()).then((()=>this.playMediaWithTimestampAndMid({lastMsgId:a,middleware:h,mediaTimestamp:e.mediaTimestamp})))})),this.chat.dispatchEvent("setPeer",a,!C),Promise.all([this.setFetchReactionsInterval(l),this.setFetchHistoryInterval({afterSetPromise:l,lastMsgId:a,samePeer:i,savedPosition:b,topMessage:m})]).then((()=>{c("scrolledAllDown:",r.loadedAll.bottom),r.loadedAll.bottom&&m&&!this.unreaded.size&&this.onScrolledAllDown()})),"chat"===p&&!this.chat.isForumTopic){const e=yield u(this.managers.appMessagesManager.getDialogOnly(s));(null==e?void 0:e.pFlags.unread_mark)&&this.managers.appMessagesManager.markDialogUnread(s,!0)}})))).catch((e=>{throw c.error("setPeer promise error:",e),h()||this.preloader.detach(),e}));return{cached:D,promise:R}}))}playMediaWithTimestampAndMid({middleware:e,lastMsgId:t,mediaTimestamp:i}){this.getMountedBubble(t).then((t=>{e()&&t&&this.playMediaWithTimestamp(t.bubble,i)}))}playMediaWithTimestamp(e,t){const i=(0,q.Z)(e,"bubble"),s=(0,q.Z)(e,"grouped-item"),n=s?+s.dataset.mid:+i.dataset.textMid;let a=i.querySelector(".attachment");if(a){n&&(a=a.querySelector(`[data-mid="${n}"]`));const e=a.querySelector("img, video, canvas");return void this.checkTargetForMediaViewer(e,void 0,t)}const o=(s||i).querySelector(".audio");if(o)return void o.playWithTimestamp(t);const r=i.dataset.replyToPeerId.toPeerId(),d=+i.dataset.replyToMid;r&&d&&(r===this.peerId?this.chat.setMessageId(d,t):this.chat.appImManager.setInnerPeer({peerId:r,mediaTimestamp:t}))}setFetchReactionsInterval(e){return _t(this,void 0,void 0,(function*(){const t=this.getMiddleware();if(this.chat.isChannel){const i=()=>_t(this,void 0,void 0,(function*(){if(!t())return;const e=[];for(const t in this.bubbles){let i=yield this.chat.getMessage(+t);"message"===(null==i?void 0:i._)&&(i=yield this.managers.appMessagesManager.getGroupsFirstMessage(i),e.push(i.mid))}(e.length?this.managers.appReactionsManager.getMessagesReactions(this.peerId,e):Promise.resolve()).then((()=>{setTimeout(i,1e4)}))}));Promise.all([e,(0,G.e9)(),(0,Ce.Z)(500)]).then((()=>{i()}))}}))}setFetchHistoryInterval({lastMsgId:e,topMessage:t,afterSetPromise:i,savedPosition:s,samePeer:n}){return _t(this,void 0,void 0,(function*(){const e=this.peerId;if(e.isUser())return;const t=this.getMiddleware(),n=yield this.managers.appMessagesManager.isFetchIntervalNeeded(e);if(!s&&!n)return;if(yield i,!t())return;const a=e.toChatId();t.onClean((()=>{this.managers.apiUpdatesManager.unsubscribeFromChannelUpdates(a)})),this.managers.apiUpdatesManager.subscribeToChannelUpdates(a)}))}onScrolledAllDown(){return _t(this,void 0,void 0,(function*(){if("chat"===this.chat.type||"discussion"===this.chat.type){const e=yield this.chat.getHistoryMaxId();this.managers.appMessagesManager.readHistory(this.peerId,e,this.chat.threadId,!0)}}))}finishPeerChange(){return _t(this,void 0,void 0,(function*(){const[e,t,i]=yield Promise.all([this.chat.isChannel,this.chat.canSend(),this.chat.isAnyGroup]);return()=>{this.chatInner.classList.toggle("has-rights",t),this.container.classList.toggle("is-chat-input-hidden",!t),this.chatInner.classList.toggle("is-chat",i),this.chatInner.classList.toggle("is-channel",e),this.createResizeObserver()}}))}renderMessagesQueue(e){return this.batchProcessor.addToQueue(e)}ejectBubbles(){for(const e of this.bubblesToEject)e.remove();this.bubblesToEject.clear()}groupBubbles(e){let t;"scheduled"===this.chat.type&&(t=new Set,e.forEach((({bubble:e,message:i})=>{const s=this.bubbleGroups.getItemByBubble(e),n=null==s?void 0:s.group;n&&s.message.date!==i.date&&(this.bubbleGroups.removeItem(s),t.add(n))}))),e.forEach((({bubble:e,message:t})=>{this.bubbleGroups.prepareForGrouping(e,t)}));const i=this.bubbleGroups.groupUngrouped(),s=Array.from(i).map((e=>{if(e.avatar)return;const t=e.firstItem;return t&&this.chat.isAvatarNeeded(t.message)?e.createAvatar(t.message):void 0})).filter(Boolean);if(t)for(const e of t)i.add(e);return{groups:[...i],avatarPromises:s}}getMiddleware(e){return this.middlewareHelper.get(e)}wrapMediaSpoiler({media:e,promise:t,middleware:i,attachmentDiv:s}){return _t(this,void 0,void 0,(function*(){if(yield t,!i())return;const{width:n,height:a}=s.style,o=yield(0,st.ZP)({media:e,width:parseInt(n),height:parseInt(a),middleware:i,animationGroup:this.chat.animationGroup});i()&&s.append(o)}))}safeRenderMessage(e,t,i,s=!0,n){return _t(this,void 0,void 0,(function*(){if(!e||this.renderingMessages.has(e.mid)||this.bubbles[e.mid]&&!i)return;const a=this.getMiddleware().create(),o=a.get();let r;try{this.renderingMessages.add(e.mid);const d=document.createElement("div");d.middlewareHelper=a,d.dataset.mid=""+e.mid,d.dataset.peerId=""+e.peerId,d.dataset.timestamp=""+e.date,i&&(i.middlewareHelper.destroy(),this.skippedMids.delete(e.mid),this.bubblesToEject.add(i),this.bubblesToReplace.delete(i),this.bubblesToReplace.set(d,i),this.bubbleGroups.changeBubbleByBubble(i,d)),i=this.bubbles[e.mid]=d;let l=this.renderMessage(e,t,i,o);n&&(l=n(l,i));const c=l.then((e=>e&&o()?Object.assign(Object.assign({},e),{updatePosition:s}):void 0));if(this.renderMessagesQueue(c.catch((()=>{}))),r=yield c,!o())return;r||this.skippedMids.add(+e.mid)}catch(e){this.log.error("renderMessage error:",e)}return o()?(this.renderingMessages.delete(e.mid),r):void 0}))}renderMessage(e,t=!1,i,s){var a,o,r;return _t(this,void 0,void 0,(function*(){const c="message"===e._,h=c&&e.grouped_id;let p,f;const m=h?yield this.managers.appMessagesManager.getMessagesByAlbum(h):void 0,v="pinned"!==this.chat.type;if(h&&v){p=m.map((e=>e.mid));const t=jt(p);if(e.mid!==t)return}c&&(f=h?m[0]:e);const b=this.chat.isOurMessage(e),y=document.createElement("div");y.classList.add("message","spoilers-container");const w=document.createElement("div");w.classList.add("bubble-content-wrapper");const S=document.createElement("div");S.classList.add("bubble-content"),i.classList.add("bubble"),w.append(S),i.append(w);let P=!b&&!e.pFlags.out&&(e.pFlags.unread||De(e));if(!P&&this.chat.peerId.isAnyChat()){const t=yield this.managers.appMessagesManager.getReadMaxIdIfUnread(this.chat.peerId,this.chat.threadId);void 0!==t&&t"messageEntityEmoji"===e._)),t=F.replace(/\s/g,"").length;if(e.reduce(((e,t)=>e+t.length),0)===t){H=Math.min(zt,e.length),U=C.Z.active.customEmoji;const t=Ht[H];t&&(U=(0,Je.C)(t,t),i.style.setProperty("--emoji-size",t+"px"))}}null!=U||(U=this.chat.appImManager.customEmojiSize);let z=dt(R||e);if(R&&N&&(i.dataset.textMid=""+R.mid),e.reply_to){const t=e.reply_to.reply_to_peer_id?(0,T.Z)(e.reply_to.reply_to_peer_id):this.peerId;if(i.dataset.replyToPeerId=""+t,i.dataset.replyToMid=""+e.reply_to_mid,void 0===z){const i=yield n.Z.managers.appMessagesManager.getMessageByPeer(t,e.reply_to_mid);z=i?dt(i):1/0}}const j={entities:D,passEntities:this.passEntities,loadPromises:M,lazyLoadQueue:this.lazyLoadQueue,customEmojiSize:U,middleware:s,animationGroup:this.chat.animationGroup,maxMediaTimestamp:z},G=F?(0,_e.ZP)(F,j):"";let V,K=!0,W=!1;if(H){if(n.Z.settings.emoji.big){const e=1===H&&!D.find((e=>"messageEntityCustomEmoji"===e._))&&(yield this.managers.appStickersManager.getAnimatedEmojiSticker(F));1===H&&!B&&e?B={_:"messageMediaDocument",document:e,pFlags:{}}:(V=document.createElement("div"),V.classList.add("attachment","spoilers-container"),(0,Z.Z)(V,G),S.append(V)),i.classList.add("is-message-empty","emoji-big"),W=!0,K=!1,N=!1}i.classList.add("can-have-big-emoji")}N&&(0,Z.Z)(y,G);const $=(Y=F,Pt.test(Y));var Y;const X=O.setTime({chatType:this.chat.type,message:e,reactionsMessage:f});let ie;if(y.append(X),S.prepend(y),$&&X.classList.add("is-block"),c&&this.chat.isAllMessagesForum){const t=yield(0,xt.Z)({peerId:this.peerId,threadId:(0,u.Z)(e,this.chat.isForum),lastMsgId:e.mid,wrapOptions:{middleware:s},withIcons:!0}),{element:i}=t;ie=document.createElement("div"),ie.classList.add("topic-name-button-container"),ie.append(i)}if(c&&e.views){if(i.classList.add("channel-post"),!(null===(a=e.fwd_from)||void 0===a?void 0:a.saved_from_msg_id)&&"pinned"!==this.chat.type){const e=document.createElement("div");e.classList.add("bubble-beside-button","forward","tgico-forward_filled"),S.prepend(e),i.classList.add("with-beside-button")}!e.pFlags.is_outgoing&&this.observer&&this.observer.observe(i,this.viewsObserverCallback)}const ne=c&&e.reply_markup;let ae="replyInlineMarkup"===(null==ne?void 0:ne._)&&ne.rows;if(ae&&(ae=ae.filter((e=>e.buttons.length))),ae){const t=document.createElement("div");t.classList.add("reply-markup"),ae.forEach((i=>{const s=i.buttons,n=document.createElement("div");n.classList.add("reply-markup-row"),s.forEach((t=>{let i,s=(0,_e.ZP)(t.text,{noLinks:!0,noLinebreaks:!0});switch(t._){case"keyboardButtonUrl":{const e=(0,_e.ZP)(" ",{entities:[{_:"messageEntityTextUrl",length:1,offset:0,url:t.url}]});i=(0,te.Z)(e).firstElementChild,i.classList.add("is-link");break}case"keyboardButtonSwitchInline":i=document.createElement("button"),i.classList.add("is-switch-inline"),(0,ee.fc)(i,(i=>{(0,J.Z)(i);const s=e.viaBotId||e.fromId;let n;n=t.pFlags.same_peer?Promise.resolve(this.peerId):this.managers.appInlineBotsManager.checkSwitchReturn(s).then((e=>e||new Promise(((e,t)=>{const i=Te.Z.createPopup(g.Z,void 0,(t=>{e(t)}));i.addEventListener("close",(()=>{t()}))})))),n.then((e=>{const i=this.peerId===e?this.chat.threadId:void 0;this.chat.appImManager.setInnerPeer({peerId:e}),this.managers.appInlineBotsManager.switchInlineQuery(e,i,s,t.query)}))}));break;case"keyboardButtonBuy":{const e="messageMediaInvoice"===B._?B:void 0;if(null==e?void 0:e.extended_media)break;i=document.createElement("button"),i.classList.add("is-buy"),(null==e?void 0:e.receipt_msg_id)&&(s=(0,I.ag)("Message.ReplyActionButtonShowReceipt"));break}case"keyboardButtonUrlAuth":{i=document.createElement("button"),i.classList.add("is-url-auth");const{peerId:s}=this,{mid:n}=e,{url:a,button_id:o}=t;(0,ee.fc)(i,(()=>{const e=(0,At.Z)([i],!0);this.chat.appImManager.handleUrlAuth({peerId:s,mid:n,url:a,buttonId:o}).then((()=>{e()}))}));break}default:i=document.createElement("button")}if(!i)return;i.classList.add("reply-markup-button","rp","tgico");const a=document.createElement("span");a.classList.add("reply-markup-button-text"),"string"==typeof s?a.insertAdjacentHTML("beforeend",s):a.append(s),(0,E.Z)(i),i.append(a),n.append(i)})),n.childElementCount&&t.append(n)}));const s=!!t.childElementCount;s&&(0,ee.fc)(t,(t=>{let i=t.target;if(i.classList.contains("reply-markup-button")||(i=(0,q.Z)(i,"reply-markup-button")),!i||i.classList.contains("is-link")||i.classList.contains("is-switch-inline")||i.classList.contains("is-buy")||i.classList.contains("is-url-auth"))return;(0,J.Z)(t);const s=(0,se.Z)(i),n=ae[(0,se.Z)(i.parentElement)];if(!n.buttons||!n.buttons[s])return void this.log.warn("no such button",n,s,e);const a=n.buttons[s];this.managers.appInlineBotsManager.callbackButtonClick(this.peerId,e.mid,a).then((e=>{"string"==typeof e.message&&e.message.length&&(0,Q.Am)((0,_e.ZP)(e.message,{noLinks:!0,noLinebreaks:!0}))}))})),s&&(i.classList.add("with-reply-markup"),w.append(t))}const oe=e.pFlags.is_outgoing;if(b){(e.pFlags.unread||oe)&&this.unreadOut.add(e.mid);let t="";t=e.error?"is-error":oe?"is-sending":e.pFlags.unread||e.pFlags.is_scheduled?"is-sent":"is-read",i.classList.add(t)}oe&&!e.error&&i.classList.add("is-outgoing");const re=c&&(yield this.managers.appMessagesManager.getMessageWithCommentReplies(e)),de=!!re&&e.mid>0;de&&i.classList.add("with-replies");const ce=c&&e.fwd_from,he=c&&e.fwdFromId,ue=this.chat.isOutMessage(e);let pe=S;const fe=!(e.viaBotId||e.fromId!==n.Z.myId&&e.pFlags.out),ge=!F;let ve;if(B){V=document.createElement("div"),V.classList.add("attachment"),ge&&i.classList.add("is-message-empty");let t=!1;switch(B._){case"messageMediaPhoto":{const t=B.photo;if(ge&&(K=!1),fe&&i.classList.add("hide-name"),i.classList.add("photo"),v&&h&&1!==p.length){i.classList.add("is-album","is-grouped"),ot({messages:m,attachmentDiv:V,middleware:this.getMiddleware(),isOut:b,lazyLoadQueue:this.lazyLoadQueue,chat:this.chat,loadPromises:M,autoDownload:this.chat.autoDownload});break}const n=!L.IS_ANDROID&&K&&!de&&!1;n&&i.classList.add("with-media-tail");const a=(0,nt.Z)({photo:t,message:e,container:V,withTail:n,isOut:ue,lazyLoadQueue:this.lazyLoadQueue,middleware:this.getMiddleware(),loadPromises:M,autoDownloadSize:this.chat.autoDownload.photo});B.pFlags.spoiler&&M.push(this.wrapMediaSpoiler({media:t,promise:a,middleware:s,attachmentDiv:V}));break}case"messageMediaWebPage":{t=!0;const s=B.webpage;if("webPage"!==s._)break;const a=(0,kt.Z)(s.url);if("im"===(null==a?void 0:a.onclick)){const e={telegram_channel:"Chat.Message.ViewChannel",telegram_megagroup:"OpenGroup",telegram_bot:"Chat.Message.ViewBot"}[s.type]||"OpenMessage";ve=this.makeViewButton({text:e,asLink:!0}),ve.href=a.url,ve.setAttribute("onclick",`${a.onclick}(this)`)}i.classList.add("webpage");const o=document.createElement("div");o.classList.add("web");const r=document.createElement("div");let d,l;r.classList.add("quote");const c=s.photo;(c||s.document)&&(d=document.createElement("div"),d.classList.add("preview-resizer"),l=document.createElement("div"),l.classList.add("preview"),d.append(l));const h=document.createElement("div");h.classList.add("quote-text");const u=s.document;if(u)if("gif"===u.type||"video"===u.type||"round"===u.type){const t="round"===u.type?C.Z.active.round:C.Z.active.webpage;"round"===u.type?(i.classList.add("round"),l.classList.add("is-round")):i.classList.add("video"),(0,at.Z)({doc:u,container:l,message:e,boxWidth:t.width,boxHeight:t.height,lazyLoadQueue:this.lazyLoadQueue,middleware:this.getMiddleware(),isOut:ue,group:this.chat.animationGroup,loadPromises:M,autoDownload:this.chat.autoDownload,noInfo:e.mid<0})}else{const t=yield(0,rt.Z)({message:e,autoDownloadSize:this.chat.autoDownload.file,lazyLoadQueue:this.lazyLoadQueue,loadPromises:M,sizeType:"documentName",searchContext:{useSearch:!1,peerId:this.peerId,inputFilter:{_:"inputMessagesFilterEmpty"}},fontSize:n.Z.settings.messagesTextSize,canTranscribeVoice:!0});l.append(t),l.classList.add("preview-with-document"),h.classList.add("has-document")}let p;if(d&&h.append(d),s.site_name){const e=(0,_e.ZP)(s.url),t=(0,te.Z)(e).firstElementChild;t.classList.add("webpage-name");const i=document.createElement("strong");(0,Z.Z)(i,(0,k.Z)(s.site_name)),t.textContent="",t.append(i),h.append(t),p=t}const f=(0,Ae.Z)(s);if(f.textContent){const e=document.createElement("div");e.classList.add("title");const t=document.createElement("strong");(0,Z.Z)(t,f),e.append(t),h.append(e),p=e}const m=(0,xe.Z)(s);if(m.textContent){const e=document.createElement("div");e.classList.add("text"),(0,Z.Z)(e,m),h.append(e),p=e}if(r.append(h),c&&!u){i.classList.add("photo");const t=c.sizes[c.sizes.length-1];let s=!1;t.w===t.h&&p?(i.classList.add("is-square-photo"),s=!0,(0,ke.Z)(c,l,48,48,!1)):t.h>t.w&&i.classList.add("is-vertical-photo"),(0,nt.Z)({photo:c,message:e,container:l,boxWidth:s?0:C.Z.active.webpage.width,boxHeight:s?0:C.Z.active.webpage.height,isOut:ue,lazyLoadQueue:this.lazyLoadQueue,middleware:this.getMiddleware(),loadPromises:M,withoutPreloader:s,autoDownloadSize:this.chat.autoDownload.photo})}o.append(r),y.insertBefore(o,X);break}case"messageMediaDocument":{const a=B.document;if(a.sticker){i.classList.add("sticker"),K=!1,W=!0,a.animated&&i.classList.add("sticker-animated");const e=C.Z.active,t=i.classList.contains("emoji-big"),n=t?e.emojiSticker:a.animated?e.animatedSticker:e.staticSticker;(0,ke.Z)(a,V,n.width,n.height),S.style.minWidth=V.style.width,S.style.minHeight=V.style.height,(0,et.ZP)({doc:a,div:V,middleware:s,lazyLoadQueue:this.lazyLoadQueue,group:this.chat.animationGroup,play:!0,liteModeKey:"stickers_chat",loop:!0,emoji:t?F:void 0,withThumb:!0,loadPromises:M,isOut:ue,noPremium:null===(o=null==B?void 0:B.pFlags)||void 0===o?void 0:o.nopremium}),((0,Qe.Z)(a)||t)&&(P||oe)&&this.observer.observe(i,this.stickerEffectObserverCallback)}else if("video"===a.type||"gif"===a.type||"round"===a.type){const t="round"===a.type;if(t&&(W=!0),(t||ge)&&(K=!1),fe&&i.classList.add("hide-name"),i.classList.add(t?"round":"video"),v&&h&&1!==p.length)i.classList.add("is-album","is-grouped"),ot({messages:m,attachmentDiv:V,middleware:s,isOut:b,lazyLoadQueue:this.lazyLoadQueue,chat:this.chat,loadPromises:M,autoDownload:this.chat.autoDownload});else{const n=!L.IS_ANDROID&&!L.IS_APPLE&&!t&&K&&!de&&!1;n&&i.classList.add("with-media-tail");const o=(0,at.Z)({doc:a,container:V,message:e,boxWidth:C.Z.active.regular.width,boxHeight:C.Z.active.regular.height,withTail:n,isOut:ue,lazyLoadQueue:this.lazyLoadQueue,middleware:s,group:this.chat.animationGroup,loadPromises:M,autoDownload:this.chat.autoDownload,searchContext:t?{peerId:this.peerId,inputFilter:{_:"inputMessagesFilterRoundVoice"},threadId:this.chat.threadId,useSearch:!e.pFlags.is_scheduled,isScheduled:e.pFlags.is_scheduled}:void 0,noInfo:e.mid<0,noAutoplayAttribute:!!B.pFlags.spoiler});B.pFlags.spoiler&&M.push(this.wrapMediaSpoiler({media:a,promise:o,middleware:s,attachmentDiv:V}))}}else{const s=yield function({albumMustBeRenderedFull:e,message:t,bubble:i,messageDiv:s,chat:n,loadPromises:a,autoDownloadSize:o,lazyLoadQueue:r,searchContext:d,useSearch:l,sizeType:c,managers:h,fontWeight:u,fontSize:p,richTextFragment:f,richTextOptions:m,canTranscribeVoice:g}){return lt(this,void 0,void 0,(function*(){let l;const v=e?yield n.getMidsByMid(t.mid):[t.mid],b=v.map(((e,t)=>lt(this,void 0,void 0,(function*(){const i=yield n.getMessage(e),s=yield(0,rt.Z)({message:i,loadPromises:a,autoDownloadSize:o,lazyLoadQueue:r,searchContext:d,sizeType:c,managers:h,fontWeight:u,fontSize:p,canTranscribeVoice:g}),b=document.createElement("div");b.classList.add("document-container"),b.dataset.mid=""+e,b.dataset.peerId=""+i.peerId;const y=document.createElement("div");if(y.classList.add("document-wrapper"),i.message){const e=document.createElement("div");e.classList.add("document-message");let t=f;t||(t=(0,_e.ZP)(i.message,Object.assign(Object.assign({},m),{entities:i.totalEntities,maxMediaTimestamp:dt(i)}))),(0,Z.Z)(e,t),y.append(e)}if(v.length>1){const e=document.createElement("div");e.classList.add("document-selection"),b.append(e),b.classList.add("grouped-item"),0===t&&(l=y)}return y.append(s),b.append(y),b})))),y=yield Promise.all(b);return s.append(...y),v.length>1&&i.classList.add("is-multiple-documents","is-grouped"),l}))}({albumMustBeRenderedFull:v,message:e,bubble:i,messageDiv:y,chat:this.chat,loadPromises:M,autoDownloadSize:this.chat.autoDownload.file,lazyLoadQueue:this.lazyLoadQueue,searchContext:"voice"===a.type||"audio"===a.type?{peerId:this.peerId,inputFilter:{_:"voice"===a.type?"inputMessagesFilterRoundVoice":"inputMessagesFilterMusic"},threadId:this.chat.threadId,useSearch:!e.pFlags.is_scheduled,isScheduled:e.pFlags.is_scheduled}:void 0,sizeType:"documentName",fontSize:n.Z.settings.messagesTextSize,richTextFragment:"string"==typeof G?void 0:G,richTextOptions:j,canTranscribeVoice:!0});s&&(pe=s);const o=y.lastElementChild.querySelector(".document-message, .document, .audio");o&&o.append(X),i.classList.remove("is-message-empty");const r=(["photo","pdf"].includes(a.type)?"document":a.type||"document")+"-message";y.classList.add(r),"audio"!==a.type&&"voice"!==a.type||i.classList.add("min-content"),t=!0}break}case"messageMediaCall":{const e=B.action,s=document.createElement("div");s.classList.add("bubble-call",e.pFlags.video?"tgico-videocamera":"tgico-phone");const n=e.pFlags.video?"video":"voice";s.dataset.type=n;const a=document.createElement("div");a.classList.add("bubble-call-title"),(0,I.$d)(a,ue?e.pFlags.video?"CallMessageVideoOutgoing":"CallMessageOutgoing":e.pFlags.video?"CallMessageVideoIncoming":"CallMessageIncoming");const o=document.createElement("div");if(o.classList.add("bubble-call-subtitle"),void 0!==e.duration)o.append((0,me.Z)(e.duration));else{let t;switch(e.reason._){case"phoneCallDiscardReasonBusy":t="Call.StatusBusy";break;case"phoneCallDiscardReasonMissed":t="Chat.Service.Call.Missed";break;default:t="Chat.Service.Call.Cancelled"}o.classList.add("is-reason"),(0,I.$d)(o,t)}o.classList.add("tgico","arrow-"+(void 0!==e.duration?"green":"red")),s.append(a,o),t=!0,i.classList.remove("is-message-empty"),y.classList.add("call-message"),y.append(s);break}case"messageMediaContact":{const e=B,s=document.createElement("div");s.classList.add("contact"),s.dataset.peerId=""+e.user_id,t=!0;const n=document.createElement("div");n.className="contact-details";const a=document.createElement("div");a.className="contact-name";const o=[e.first_name,e.last_name].filter(Boolean).join(" ");a.append(o.trim()?(0,k.Z)(o):(0,I.ag)("AttachContact"));const r=document.createElement("div");r.className="contact-number",r.textContent=e.phone_number?"+"+(0,le.u)(e.phone_number).formatted:"Unknown phone number",s.append(n),n.append(a,r);const l=new d.Z;l.updateWithOptions({lazyLoadQueue:this.lazyLoadQueue,peerId:e.user_id.toPeerId(),peerTitle:e.user_id?void 0:o.trim()?o:I.ZP.format("AttachContact",!0)[0]}),l.classList.add("contact-avatar","avatar-54"),s.prepend(l),i.classList.remove("is-message-empty"),y.classList.add("contact-message"),y.append(s);break}case"messageMediaPoll":{i.classList.remove("is-message-empty");const t=function(e,t=n.Z.managers){const i=new It;return i.message=e,i.managers=t,i.setAttribute("peer-id",""+e.peerId),i.setAttribute("poll-id",e.media.poll.id),i.setAttribute("message-id",""+e.mid),i.render(),i}(e);y.prepend(t),y.classList.add("poll-message");break}case"messageMediaInvoice":{const t=B.pFlags.test,n=B.extended_media,a="messageExtendedMedia"===(null==n?void 0:n._),o="messageExtendedMediaPreview"===(null==n?void 0:n._);let r=a?n.media.photo||n.media.document:B.photo;const d=(0,$e.Z)(B.total_amount,B.currency);let l,c;if(n){if(o&&(l=document.createElement("span"),l.classList.add("extended-media-buy","tgico-premium_lock"),V.classList.add("is-buy"),(0,I.$d)(l,"Checkout.PayPrice",[d]),void 0!==n.video_duration)){const e=document.createElement("span");e.classList.add("video-time"),e.textContent=(0,mt.Z)(n.video_duration,!1),V.append(e)}}else{l=document.createElement(r?"span":"div");const e=document.createDocumentFragment(),i=(0,I.ag)(B.receipt_msg_id?"PaymentReceipt":t?"PaymentTestInvoice":"PaymentInvoice");i.classList.add("text-uppercase");const s=" "+Zt.Z,n=document.createElement("span");if(n.classList.add("text-bold"),n.textContent=d+s,e.append(n,i),t&&B.receipt_msg_id){const t=document.createElement("span");t.classList.add("text-uppercase","pre-wrap"),t.append(s+"(Test)"),e.append(t)}(0,Z.Z)(l,e)}if(o&&(n.thumb.w=n.w,n.thumb.h=n.h,r={_:"photo",access_hash:"",pFlags:{},date:0,dc_id:0,file_reference:[],id:0,sizes:[n.thumb]}),r){const t=n?C.Z.active.extendedInvoice:C.Z.active.invoice;"document"===r._?((0,at.Z)({doc:r,container:V,withTail:!1,isOut:ue,lazyLoadQueue:this.lazyLoadQueue,middleware:s,loadPromises:M,boxWidth:t.width,boxHeight:t.height,group:this.chat.animationGroup,message:e}),i.classList.add("video")):((0,nt.Z)({photo:r,container:V,withTail:!1,isOut:ue,lazyLoadQueue:this.lazyLoadQueue,middleware:s,loadPromises:M,boxWidth:t.width,boxHeight:t.height,message:a?e:void 0}),i.classList.add("photo")),l&&(n||l.classList.add("video-time"),V.append(l))}else V=void 0;if(o){const{mid:t}=e;this.extendedMediaMessages.add(t),s.onClean((()=>{this.extendedMediaMessages.delete(t)})),this.setExtendedMediaMessagesPollInterval();const{width:i,height:n}=V.style,a=Mt.Z.create({width:parseInt(i),height:parseInt(n),middleware:s,animationGroup:this.chat.animationGroup});V.append(a.canvas)}n||(c=document.createElement("div"),c.classList.add("bubble-primary-color"),(0,Z.Z)(c,(0,k.Z)(B.title)));const h=a?void 0:(0,k.Z)(B.description);y.prepend(...[c,!r&&l,h].filter(Boolean)),h?i.classList.remove("is-message-empty"):K=!1,i.classList.add("is-invoice");break}default:V=void 0,i.classList.remove("is-message-empty"),y.append((0,I.ag)(I.nK),X),this.log.warn("unrecognized media type:",B._,e)}!t&&V&&S.append(V)}W&&i.classList.add("just-media"),ve&&X.before(ve);let be="";const ye=e.fromId!==n.Z.myId&&this.chat.isAnyGroup||e.viaBotId||e.pFlags.sponsored;if(ye||ce||e.reply_to_mid||ie){let t,s;const a="peerChannel"===(null===(r=e.from_id)||void 0===r?void 0:r._)&&e.fromId===he,o=!!e.viaBotId,d=ce&&!ce.from_id;e.viaBotId&&(s=document.createElement("span"),s.innerText="@"+(yield this.managers.appPeersManager.getPeerUsername(e.viaBotId)),s.classList.add("peer-title")),o&&i.classList.add("must-have-name");const h=he||ce;let u,p;if(d?(t=document.createElement("span"),(0,Z.Z)(t,(0,k.Z)(ce.from_name)),t.classList.add("peer-title"),i.classList.add("hidden-profile")):t=new x.Z({peerId:he||e.fromId,withPremiumIcon:!h,wrapOptions:_}).element,c&&e.reply_to_mid&&e.reply_to_mid!==this.chat.threadId&&(!this.chat.isAllMessagesForum||e.reply_to.reply_to_top_id)&&(u=yield O.setReply({chat:this.chat,bubble:i,bubbleContainer:S,message:e})),h)if(this.peerId===n.Z.myId||a||i.classList.add("forwarded"),e.savedFrom&&(be=e.savedFrom,t.dataset.savedFrom=be),p=document.createElement("div"),t.dataset.peerId=""+he,this.peerId!==n.Z.myId&&this.peerId!==l.hj&&!a||W){const e=[t];if(W){const t=document.createElement("br");t.classList.add("hide-ol"),e.unshift(t)}p.append((0,I.ag)("ForwardedFrom",[e]))}else p.style.color=(0,Be.Z)(he,!1),p.classList.add("colored-name"),p.append(t);else if(!e.viaBotId)if(!W&&ye){p=document.createElement("div"),p.append(t);const i=yield this.managers.appPeersManager.getPeer(e.fromId),s=null==i?void 0:i.pFlags;s&&(s.scam||s.fake)&&p.append((0,Ze.Z)(s.scam)),b||(p.style.color=(0,Be.Z)(e.fromId,!1),p.classList.add("colored-name")),p.dataset.peerId=""+e.fromId}else i.classList.add("hide-name");if(e.viaBotId){p?p.append(" "):p=document.createElement("div");const e=document.createElement("span");e.append((0,I.ag)("ViaBot")," ",s),e.classList.add("is-via"),p.append(e)}ie&&(W?ie.classList.add("floating-part"):(p||(p=document.createElement("div")),p.append(ie),i.classList.remove("hide-name"))),p?(p.classList.add("name"),W?(pe.append(pe=document.createElement("div")),pe.classList.add("name-with-reply","floating-part")):p.classList.add("floating-part"),pe.append(p),W&&u&&pe.append(u)):W&&u&&u.classList.add("floating-part"),ie&&W&&(V?V.after(ie):this.log.error("no attachment div?",i,e))}else i.classList.add("hide-name");if("pinned"===this.chat.type&&(be=`${this.chat.peerId}_${e.mid}`),re&&re.mid===this.chat.threadId&&i.classList.add("is-thread-starter","is-group-last"),be&&("pinned"===this.chat.type||ce.saved_from_msg_id)&&this.peerId!==l.hj){const e=document.createElement("div");e.classList.add("bubble-beside-button","goto-original","tgico-arrow_next"),S.append(e),i.dataset.savedFrom=be,i.classList.add("with-beside-button")}return i.classList.add(ue?"is-out":"is-in"),de&&(O.renderReplies({bubble:i,bubbleContainer:S,message:re,messageDiv:y,loadPromises:M,lazyLoadQueue:this.lazyLoadQueue})?K=!0:i.classList.add("with-beside-replies")),c&&this.appendReactionsElementToBubble(i,e,f),K&&(i.classList.add("can-have-tail"),S.append(Vt())),A}))}appendReactionsElementToBubble(e,t,i,s){if(this.peerId.isUser(),!(null==i?void 0:i.reactions)||!i.reactions.results.length)return;const n=new Se.Z;if(n.init(i,"block",e.middlewareHelper.get()),n.render(s),e.classList.contains("is-message-empty"))e.querySelector(".bubble-content-wrapper").append(n);else{const s=e.querySelector(".message");if(e.classList.contains("is-multiple-documents")){const e=s.lastElementChild;let a=e.querySelector(".document-message"),o=a&&a.querySelector(".time");o||(o=O.setTime({chatType:this.chat.type,message:t,reactionsMessage:i})),n.append(o),a||(a=document.createElement("div"),a.classList.add("document-message"),e.querySelector(".document-wrapper").prepend(a)),a.append(n)}else{const t=Array.from(e.querySelectorAll(".time")).pop();n.append(t),s.append(n)}}}prepareToSaveScroll(e){if(!this.chatInner.parentElement)return{};const t=this.log.bindPrefix("prepareToSaveScroll");t("save");const i=this.createScrollSaver(e);if(i.save(),this.getRenderedLength()&&!this.chat.setPeerPromise){const e=this.getViewportSlice();this.deleteViewportSlice(e,!0)}return{restoreScroll:()=>{t("restore"),i.restore(e),this.onRenderScrollSet(i.getSaved())},scrollSaver:i}}performHistoryResult(e,t){var i;return _t(this,void 0,void 0,(function*(){let s=e.history;s=s.slice(),this.needReflowScroll&&((0,ie.Z)(this.scrollable.container),this.needReflowScroll=!1);const n=yield Promise.all(s.map((e=>"number"==typeof e?this.chat.getMessage(e):e))),a=[];if(!this.scrollable.loadedAll.bottom||!this.scrollable.loadedAll.top){let t=e.isEnd;if(!t){const e=yield this.chat.getHistoryStorage(),i=e.history.first,n=e.history.last;t={top:!1,bottom:!1,both:!1},!i.isEnd($.D.Bottom)||i.length&&!s.includes(i[0])||(t.bottom=!0),!n.isEnd($.D.Top)||n.length&&!s.includes(n[n.length-1])||(t.top=!0)}if(!t.bottom&&this.setPeerOptions){const{lastMsgId:e,topMessage:i,savedPosition:s}=this.setPeerOptions;this.setPeerOptions=void 0,(!e&&!s||this.bubbles[i]||e===i)&&(t.bottom=!0)}t.top&&a.push(this.setLoaded("top",!0)),t.bottom&&a.push(this.setLoaded("bottom",!0))}yield Promise.all(a);const o=n.map((e=>e?e.pFlags.local?this.processLocalMessageRender(e):this.safeRenderMessage(e,t):void 0));yield Promise.all(o),yield this.messagesQueuePromise,this.scrollable.loadedAll.top&&this.messagesQueueOnRenderAdditional&&(this.messagesQueueOnRenderAdditional(),null===(i=this.messagesQueueOnRenderAdditional)||void 0===i||i.call(this))}))}onRenderScrollSet(e){const t="has-sticky-dates";if(this.container.classList.contains(t)||this.preloader.detached&&(null!=e||(e={scrollHeight:this.scrollable.scrollHeight,clientHeight:this.scrollable.container.clientHeight}),e.scrollHeight===e.clientHeight))this.willScrollOnLoad=void 0;else{const e=this.getMiddleware(),i=()=>{e()&&this.container.classList.add(t)};this.willScrollOnLoad?i():setTimeout(i,600)}}requestHistory(e,t,i){return"chat"===this.chat.type||"discussion"===this.chat.type?this.managers.acknowledged.appMessagesManager.getHistory(this.peerId,e,t,i,this.chat.threadId):"pinned"===this.chat.type?this.managers.acknowledged.appMessagesManager.getSearch({peerId:this.peerId,inputFilter:{_:"inputMessagesFilterPinned"},maxId:e,limit:t,backLimit:i}).then((e=>({cached:e.cached,result:Promise.resolve(e.result).then((e=>({history:e.history.map((e=>e.mid))})))}))):"scheduled"===this.chat.type?this.managers.acknowledged.appMessagesManager.getScheduledMessages(this.peerId).then((e=>({cached:e.cached,result:Promise.resolve(e.result).then((e=>({history:e.slice().reverse()})))}))):void 0}animateAsLadder(e,t,i,s,n){return _t(this,void 0,void 0,(function*(){const a=this.log.bindPrefix("ladder");if(this.chat.setPeerPromise&&!this.resolveLadderAnimation)return a.warn("will be delayed"),void(this.resolveLadderAnimation=this.animateAsLadder.bind(this,e,t,i,s,n));if(!Object.keys(this.bubbles).length)return void a.warn("no bubbles");let o,r=(0,Ie.Z)(this.bubbles,"desc");i&&t.length&&(r=r.filter((e=>!t.includes(e)))),o=s?n||Math.max(...r):e||Math.max(...r);const d=r.slice(r.findIndex((e=>o>e))),l=i?[]:[o],c=i?[]:r.slice(0,r.findIndex((e=>o>=e))).reverse();W.ZP&&a("targeting mid:",o,n,e,d.map((e=>(0,Ne.Z)(e))),c.map((e=>(0,Ne.Z)(e))));const h=[];this.chatInner.classList.add("zoom-fading");const u=i?10:40,p=i?0:1,f=(e,t=0)=>{const i=(0,K.Z)();let s=0;return e.forEach(((n,o)=>{const r=this.bubbles[n];if(!r||this.skippedMids.has(n))return void a.warn("no bubble by mid:",n);s=(o+t||.1)*u;const d=r.lastElementChild,l=[d],c=this.bubbleGroups.getItemByBubble(r);if(c&&c.group.avatar&&c.group.lastItem===c&&l.push(c.group.avatar),l.forEach((e=>{e.classList.add("zoom-fade","can-zoom-fade"),e.style.transitionDelay=s+"ms"})),o===e.length-1){const e=t=>{t.target===d&&(i.resolve(),d.removeEventListener("transitionend",e))};d.addEventListener("transitionend",e)}h.push(...l)})),e.length||i.resolve(),{lastMsDelay:s,animationPromise:i}},m=f(d,p),g=f(l),v=f(c,p),b=[m.animationPromise,g.animationPromise,v.animationPromise],y=[m.lastMsDelay,g.lastMsDelay,v.lastMsDelay];let w;return this.onAnimateLadder&&(yield this.onAnimateLadder()),(0,V.T2)((()=>{this.setStickyDateManually(),h.forEach((e=>{e.classList.remove("zoom-fade")}))})),(d.length||l.length||c.length)&&(w=Promise.all(b),(0,G.YW)(w,Math.max(...y)+200).then((()=>{(0,V.T2)((()=>{h.forEach((e=>{e.style.transitionDelay="",e.classList.remove("can-zoom-fade")})),this.chatInner.classList.remove("zoom-fading")}))}))),w}))}renderEmptyPlaceholder(e,t,i,s){return _t(this,void 0,void 0,(function*(){const i="empty-bubble-placeholder";let n,a;if(t.classList.add(i,i+"-"+e),"group"===e?n=(0,I.ag)("GroupEmptyTitle1"):"saved"===e?n=(0,I.ag)("ChatYourSelfTitle"):"noMessages"===e||"greeting"===e?n=(0,I.ag)("NoMessages"):"noScheduledMessages"===e?n=(0,I.ag)("NoScheduledMessages"):"restricted"===e&&(n=document.createElement("span"),n.innerText=yield this.managers.appPeersManager.getRestrictionReasonText(this.peerId)),n.classList.add("center",i+"-title"),s.push(n),"group"===e)s.push((0,I.ag)("GroupEmptyTitle2")),a=[(0,I.ag)("GroupDescription1"),(0,I.ag)("GroupDescription2"),(0,I.ag)("GroupDescription3"),(0,I.ag)("GroupDescription4")];else if("saved"===e)a=[(0,I.ag)("ChatYourSelfDescription1"),(0,I.ag)("ChatYourSelfDescription2"),(0,I.ag)("ChatYourSelfDescription3"),(0,I.ag)("ChatYourSelfDescription4")];else if("greeting"===e){const e=(0,I.ag)("NoMessagesGreetingsDescription");e.classList.add("center",i+"-subtitle");const t=document.createElement("div");t.classList.add(i+"-sticker");const n=this.getMiddleware();yield this.managers.appStickersManager.getGreetingSticker().then((e=>_t(this,void 0,void 0,(function*(){if(!n())return;const i=[];return yield(0,et.ZP)({doc:e,div:t,middleware:n,lazyLoadQueue:this.lazyLoadQueue,group:this.chat.animationGroup,play:!0,loop:!0,withThumb:!0,loadPromises:i,liteModeKey:"stickers_chat"}),(0,ee.fc)(t,(e=>{(0,J.Z)(e),Ve.Jo.onMediaClick({target:e.target})})),Promise.all(i)})))),s.push(e,t)}a&&(s.push(...a.map((e=>{const t=document.createElement("span");return t.classList.add(i+"-list-item"),t.append(e),t}))),"group"===e?a.forEach((e=>{const t=document.createElement("span");t.classList.add("tgico-check"),e.prepend(t)})):"saved"===e&&a.forEach((e=>{const t=document.createElement("span");t.classList.add(i+"-list-bullet"),t.innerText="•",e.prepend(t)}))),s.length>1&&t.classList.add("has-description"),s.forEach((e=>e.classList.add(i+"-line")))}))}processLocalMessageRender(e,t,i=this.getMiddleware()){return _t(this,void 0,void 0,(function*(){const s=!!e.pFlags.sponsored,o=(0,Ge.Z)(i);return this.safeRenderMessage(e,!s,void 0,!1,(i=>_t(this,void 0,void 0,(function*(){const{bubble:r}=yield o(i);if(!r)return i;r.message=e,r.classList.add("is-group-last","is-group-first");const d=()=>{this.updatePlaceholderPosition===d&&(this.updatePlaceholderPosition=void 0),u[p](r)};s||(r.classList.add("bubble-first"),r.classList.remove("can-have-tail","is-in"));const l=[],c=this.chat.isBot;let h,u=this.container,p="append";if(this.chat.isRestricted)h=this.renderEmptyPlaceholder("restricted",r,e,l);else if(s){let i,s,n,a;r.classList.add("avoid-selection"),r.style.order="999999";const o=this.sponsoredMessage=e.sponsoredMessage,d=(0,T.Z)(o.from_id);o.channel_post?(i="OpenChannelPost",s=(0,Oe.Z)(o.channel_post)):o.start_param||c?(i="Chat.Message.ViewBot",n=o.start_param):i=(yield this.managers.appPeersManager.isAnyGroup(d))?"Chat.Message.ViewGroup":"Chat.Message.ViewChannel",a=o.chat_invite?()=>{Te.Z.createPopup(ye.Z,o.chat_invite_hash,o.chat_invite)}:o.chat_invite_hash?()=>{const e={_:we.z.JOIN_CHAT,invite:o.chat_invite_hash};this.chat.appImManager.processInternalLink(e)}:()=>{this.chat.appImManager.setInnerPeer({peerId:d,lastMsgId:s,startParam:n})};const l=this.makeViewButton({text:i});this.observer.observe(l,this.viewsObserverCallback),a&&(0,ee.fc)(l,a),r.querySelector(".bubble-content").prepend(l),u=this.chatInner,p="append",t=!1}else if(c&&"message"===e._){const e=document.createElement("b");e.append((0,I.ag)("BotInfoTitle")),l.push(e,"\n\n"),u=this.chatInner,p="prepend"}else h=this.chat.isAnyGroup&&(yield o(this.managers.appPeersManager.getPeer(this.peerId))).pFlags.creator?this.renderEmptyPlaceholder("group",r,e,l):"scheduled"===this.chat.type?this.renderEmptyPlaceholder("noScheduledMessages",r,e,l):n.Z.myId===this.peerId?this.renderEmptyPlaceholder("saved",r,e,l):this.peerId.isUser()&&!c&&(yield o(this.chat.canSend()))&&"chat"===this.chat.type?this.renderEmptyPlaceholder("greeting",r,e,l):this.renderEmptyPlaceholder("noMessages",r,e,l);h&&(yield h),l.length&&r.querySelector(".message, .service-msg").prepend(...l);const f=!!this.messagesQueueOnRenderAdditional,m=this.setPeerCached&&!f;if(m){const e=r.firstElementChild;e.classList.add("no-transition"),this.chat.setPeerPromise&&this.chat.setPeerPromise.catch(Ke.Z).finally((()=>{e.classList.remove("no-transition")}))}if(void 0!==t||m||(t=!0),f||t?(this.updatePlaceholderPosition=d,this.onAnimateLadder=()=>{if(this.onAnimateLadder=void 0,!this.messagesQueuePromise)return(0,V.AD)()}):this.chat.setPeerPromise?this.attachPlaceholderOnRender=()=>{this.attachPlaceholderOnRender=void 0,d()}:this.updatePlaceholderPosition=d,!f&&t){yield o((0,G.e9)());const t=(0,Ie.Z)(this.bubbles);(0,a.Z)(t,e.mid),this.animateAsLadder(e.mid,t,!1,0,0)}return r.middlewareHelper.onDestroy((()=>{this.emptyPlaceholderBubble===r&&(this.emptyPlaceholderBubble=void 0)})),this.emptyPlaceholderBubble=r,i}))))}))}makeViewButton(e){return(0,ve.Z)("btn-primary btn-primary-transparent bubble-view-button",e)}generateLocalMessageId(e=0){const t=("scheduled"===this.chat.type?-1:0)+e,i=-Math.abs(t);return{id:i,mid:-Math.abs((0,Oe.Z)(i))}}generateLocalFirstMessage(e,t,i=0){return _t(this,void 0,void 0,(function*(){const{id:s,mid:n}=this.generateLocalMessageId(i);let a={_:e?"messageService":"message",date:0,id:s,mid:n,peer_id:yield this.managers.appPeersManager.getOutputPeer(this.peerId),pFlags:{local:!0}};return e||(a.message=""),(0,ae.Z)(a),t&&t(a),a=(yield this.managers.appMessagesManager.saveMessages([a],{storage:new Map}))[0],a.mid=n,a}))}getViewportSlice(){return(0,Ee.Z)({overflowElement:this.scrollable.container,selector:".bubbles-date-group .bubble:not(.is-date)",extraSize:2*Math.max(700,de.Z.height)})}deleteViewportSlice(e,t){const{invisibleTop:i,invisibleBottom:s}=e,n=i.concat(s);if(!n.length)return;i.length&&(this.setLoaded("top",!1),this.getHistoryTopPromise=void 0),s.length&&(this.setLoaded("bottom",!1),this.getHistoryBottomPromise=void 0);const a=n.map((({element:e})=>+e.dataset.mid));let o;t||(o=this.createScrollSaver(!!i.length),o.save()),this.deleteMessagesByIds(a,!1,!0),o?o.restore():i.length&&(this.scrollable.lastScrollPosition=this.scrollable.scrollTop)}sliceViewport(e){if(L.IS_SAFARI||this.isHeavyAnimationInProgress&&!e)return;const t=this.getViewportSlice();this.deleteViewportSlice(t)}setLoaded(e,t,i=!0){return _t(this,void 0,void 0,(function*(){if(this.scrollable.loadedAll[e]!==t)return this.log.bindPrefix("setLoaded")("change",e,t),this.scrollable.loadedAll[e]=t,this.scrollable.onScroll(),i?!this.chat.isRestricted&&("bottom"===e&&this.chat.isBroadcast&&this.toggleSponsoredMessage(t),"top"===e&&t&&this.chat.isBot)?this.renderBotPlaceholder():this.checkIfEmptyPlaceholderNeeded():void 0}))}toggleSponsoredMessage(e){return _t(this,void 0,void 0,(function*(){const t=this.log.bindPrefix("sponsored");t("checking");const{mid:i}=this.generateLocalMessageId(1);if(e){const e=this.getMiddleware((()=>this.scrollable.loadedAll.bottom&&this.getSponsoredMessagePromise===i)),i=this.getSponsoredMessagePromise=this.managers.appChatsManager.getSponsoredMessage(this.peerId.toChatId()).then((i=>_t(this,void 0,void 0,(function*(){if(!e()||"messages.sponsoredMessagesEmpty"===i._)return;const s=i.messages[0];if(!s)return void t("no message");const n=this.generateLocalFirstMessage(!1,(e=>{e.message=s.message,e.from_id=s.from_id,e.entities=s.entities,e.pFlags.sponsored=!0,e.sponsoredMessage=s}),1);return Promise.all([n,this.getHistoryTopPromise,this.messagesQueuePromise]).then((([i])=>{if(e())return t("rendering",i),this.performHistoryResult({history:[i]},!1)}))})))).finally((()=>{this.getSponsoredMessagePromise===i&&(this.getSponsoredMessagePromise=void 0)}))}else t("clearing rendered",i),this.getSponsoredMessagePromise=void 0,this.deleteMessagesByIds([i])}))}renderBotPlaceholder(){return _t(this,void 0,void 0,(function*(){const e=this.log.bindPrefix("bot placeholder"),t=this.getMiddleware(),i=yield this.managers.acknowledged.appProfileManager.getProfile(this.peerId.toUserId());e("getting profile, cached:",i.cached);const s=i.result.then((s=>_t(this,void 0,void 0,(function*(){var n;if(!t())return;if(!(null===(n=s.bot_info)||void 0===n?void 0:n.description))return e.warn("no description"),this.checkIfEmptyPlaceholderNeeded();const a=yield this.generateLocalFirstMessage(!1,(e=>{const t=s.bot_info;e.message=t.description,t.description_document&&(e.media={_:"messageMediaDocument",document:t.description_document,pFlags:{}}),t.description_photo&&(e.media={_:"messageMediaPhoto",photo:t.description_photo,pFlags:{}})}));return t()?(e("rendering"),{renderPromise:this.processLocalMessageRender(a,!i.cached).then((()=>{e("done")}))}):void 0}))));if(i.cached)return s}))}checkIfEmptyPlaceholderNeeded(){return _t(this,void 0,void 0,(function*(){if(this.scrollable.loadedAll.top&&this.scrollable.loadedAll.bottom&&void 0===this.emptyPlaceholderBubble&&(this.chat.isRestricted||!(yield this.chat.getHistoryStorage()).count||Object.keys(this.bubbles).length&&!this.getRenderedLength()||"scheduled"===this.chat.type&&!Object.keys(this.bubbles).length)){this.log("inject empty peer placeholder");const e=yield this.generateLocalFirstMessage(!0);return{renderPromise:this.processLocalMessageRender(e)}}}))}getHistory1(e,t,i,s,n){const a=this.getMiddleware(n?void 0:()=>(t?this.getHistoryTopPromise:this.getHistoryBottomPromise)===r),o=this.getHistory(e,t,i,s,n,a),r=o.then((e=>e&&(e.waitPromise||e.promise)));return t?this.getHistoryTopPromise=r:this.getHistoryBottomPromise=r,r.then((()=>{a()&&(t?this.getHistoryTopPromise=void 0:this.getHistoryBottomPromise=void 0,n||"chat"===this.chat.type&&setTimeout((()=>{t?this.loadMoreHistory(!0,!0):this.loadMoreHistory(!1,!0)}),0))})),o}getHistory(e=0,t=!1,i=!1,s=0,n=!1,a){return _t(this,void 0,void 0,(function*(){const o=this.peerId,r=this.chat.isBroadcast,d=Math.min(30,de.Z.height/40|0);let l=r?20:Object.keys(this.bubbles).length>0?Math.max(35,d):d;if(void 0!==Bt){if(!Bt)return{cached:!1,promise:Promise.resolve(),waitPromise:Promise.resolve()};Object.keys(this.bubbles).length>0&&--Bt}let c,h=0;if(i&&(h=l,t||(l=0)),s&&!i)if("pinned"===this.chat.type)c=[s];else{const t=(yield this.chat.getHistoryStorage()).history.slice;if(t.length=0;--e){const t=yield this.chat.getMessage(c[e]);if(!(null==t?void 0:t.grouped_id))break;c.splice(e,1)}e=c[c.length-1]||e}}let u,p=yield this.requestHistory(e,l,h);this.log("i vin brehnya",p,e,l,h);const f=(null==c?void 0:c.length)&&!p.cached,m=this.isFirstLoad&&h&&!p.cached||f;f&&(u=p.result,p={cached:!0,result:Promise.resolve({history:c})}),this.isFirstLoad=!1;const g=e=>_t(this,void 0,void 0,(function*(){var t;if(null===(t=e.isEnd)||void 0===t?void 0:t.top){if("discussion"===this.chat.type){const t=yield this.managers.appMessagesManager.getThreadServiceMessageId(this.peerId,this.chat.threadId);t&&e.history.push(t);const i=yield this.chat.getMidsByMid(this.chat.threadId);e.history.push(...i.reverse())}yield this.managers.appProfileManager.getProfileByPeerId(o)}})),v=e=>(0,G.e9)().then((()=>g(e))).then((()=>(!f&&s&&e.history.unshift(s),this.performHistoryResult(e,t)))),b=e=>{const t=Promise.resolve(e).then((e=>{if(a&&!a())throw Ut;if(!n)return v(e);this.scrollable.onScroll()}),(e=>{throw this.log.error("getHistory error:",e),e}));return t};let y,w;if(p.cached){if(n)return this.scrollable.onScroll(),null;w=!0,y=v(yield p.result)}else w=!1,y=b(p.result);const S=f?b(u):y;if(m&>.Z.isAvailable("animations")){let i=f?2:1;this.messagesQueueOnRenderAdditional=()=>{this.log("messagesQueueOnRenderAdditional"),--i||(this.messagesQueueOnRenderAdditional=void 0,this.animateAsLadder(s,c,f,h,e).then((()=>{setTimeout((()=>{this.loadMoreHistory(t,!0)}),0)})))}}else this.messagesQueueOnRenderAdditional=void 0;return n?null:{cached:w,promise:y,waitPromise:S}}))}setUnreadDelimiter(){return _t(this,void 0,void 0,(function*(){if("chat"!==this.chat.type&&"discussion"!==this.chat.type)return;if(this.attachedUnreadBubble)return;const e=yield this.chat.getHistoryMaxId();let t=yield this.managers.appMessagesManager.getReadMaxIdIfUnread(this.peerId,this.chat.threadId);if(t&&(t=Object.keys(this.bubbles).filter((e=>!this.bubbles[e].classList.contains("is-out"))).map((e=>+e)).sort(((e,t)=>e-t)).find((e=>e>t)),t&&this.bubbles[t])){const i=this.bubbles[t];this.firstUnreadBubble&&this.firstUnreadBubble!==i&&(this.firstUnreadBubble.classList.remove("is-first-unread"),this.firstUnreadBubble=null),t!==e&&i.classList.add("is-first-unread"),this.firstUnreadBubble=i,this.attachedUnreadBubble=!0}}))}deleteEmptyDateGroups(){const e=this.stickyIntersector?Ot:1;let t=!1;for(const i in this.dateMessages){const s=this.dateMessages[i];s.container.childElementCount===e&&(s.container.remove(),this.stickyIntersector&&this.stickyIntersector.unobserve(s.container,s.div),delete this.dateMessages[i],t=!0)}t&&(Object.keys(this.dateMessages).length||this.container.classList.remove("has-groups"),this.checkIfEmptyPlaceholderNeeded(),this.setStickyDateManually())}}function Vt(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttributeNS(null,"viewBox","0 0 11 20"),e.setAttributeNS(null,"width","11"),e.setAttributeNS(null,"height","20"),e.classList.add("bubble-tail");const t=document.createElementNS("http://www.w3.org/2000/svg","use");return t.setAttributeNS(null,"href","#message-tail-filled"),e.append(t),e}},4499:(e,t,i)=>{"use strict";i.d(t,{Z:()=>we});var s=i(5432),n=i(3003),a=i(5128),o=i(4524),r=i(684),d=i(2166),l=i(1962),c=i(2796),h=i(2325),u=i(8497),p=i(3910),f=i(2738),m=i(1452),g=i(1168),v=i(2648),b=i(6787),y=i(4494),w=i(8127),S=i(503),C=i(5772);class L extends w.Z{constructor(e,t,i,s){super("popup-report-messages-confirm",{noTitle:!0,descriptionLangKey:"ReportInfo",buttons:[{langKey:"ReportChat",callback:()=>{a.isValid()&&(s&&s(),this.managers.appMessagesManager.reportMessages(e,t,i,a.value).then((e=>{e&&(0,c.bC)({langPackKey:"ReportSentInfo"})})))}}],body:!0});const n=document.createElement("div");(0,C.Z)({div:n,emoji:L.STICKER_EMOJI,width:100,height:100}).then((({render:e})=>e)).finally((()=>{this.show()})),this.header.replaceWith(n);const a=new S.ZP({label:"ReportHint",maxLength:512,placeholder:"ReportChatDescription"});a.input.addEventListener("input",(()=>{this.buttons[0].element.toggleAttribute("disabled",!a.isValid())})),this.body.append(a.container)}}L.STICKER_EMOJI="👮‍♀️";class I extends w.Z{constructor(e,t,i){super("popup-report-messages",{titleLangKey:"ChatTitle.ReportMessages",buttons:[],body:!0}),t=t.slice();const s=[["ReportChatSpam","inputReportReasonSpam"],["ReportChatViolence","inputReportReasonViolence"],["ReportChatChild","inputReportReasonChildAbuse"],["ReportChatPornography","inputReportReasonPornography"],["ReportChatOther","inputReportReasonOther"],["ReportChatPersonalDetails","inputReportReasonPersonalDetails"],["ReportChatIllegalDrugs","inputReportReasonIllegalDrugs"]];s.forEach((e=>{const t=(0,y.Z)("btn-primary btn-transparent",{text:e[0]});this.body.append(t)}));const n=(0,b.Z)(L.STICKER_EMOJI);(0,f.fc)(this.body,(a=>{const o=(0,u.Z)(a.target,"btn-primary"),r=s[(0,v.Z)(o)][1];n.then((()=>{this.hide(),g.Z.createPopup(L,e,t,r,i)}))}),{listenerSetter:this.listenerSetter}),this.buttonsEl.style.marginTop=".5rem",this.show()}}var E=i(8938);class P extends w.Z{constructor(){super("popup-sponsored",{titleLangKey:"Chat.Message.Sponsored.What",descriptionLangKey:"Chat.Message.Ad.Text",descriptionLangArgs:[(0,h.ag)("Chat.Message.Sponsored.Link")],buttons:[{langKey:"OK",isCancel:!0},{langKey:"Chat.Message.Ad.ReadMore",callback:()=>{window.open(h.ZP.format("Chat.Message.Sponsored.Link",!0))},isCancel:!0}],scrollable:!0}),this.scrollable.append(this.description),this.show()}}var Z=i(3699),M=i(3624),T=i(8842),k=i(2149),x=i(4762),A=i(8947),_=i(6008),F=i(8805),D=i(8936),R=i(5005),B=i(5565),N=i(3541),O=i(2482),U=i(3061),H=i(9405),z=i(9083),j=i(5029),G=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class V extends g.Z{constructor(e){super("popup-reacted-list",{closable:!0,overlayClosable:!0,body:!0}),this.message=e,this.init()}init(){return G(this,void 0,void 0,(function*(){const e=this.middlewareHelper.get(),t=yield this.managers.appMessagesManager.getGroupsFirstMessage(this.message);if(!e())return;const i=yield this.managers.appMessagesManager.canViewMessageReadParticipants(t);if(!e())return;const s=new A.Z,n=Object.assign(Object.assign({},t),{mid:0,id:0,reactions:Object.assign(Object.assign({_:"messageReactions",results:[]},t.reactions),{pFlags:{},recent_reactions:[]})});n.reactions.results=n.reactions.results.map((e=>Object.assign(Object.assign({},e),{chosen_order:void 0,pFlags:{}}))),s.init(n,"block",this.middlewareHelper.get()),s.render(),s.classList.add("no-stripe"),s.classList.remove("has-no-reactions"),s.append(this.btnClose),this.header.append(s);const a=document.createElement("div");a.classList.add("tabs-container"),a.dataset.animation="tabs";const o=new Map;let r=!1;if(n.reactions.results.length){const e=this.createFakeReaction("reactions",n.reactions.results.reduce(((e,t)=>e+t.count),0));s.prepend(e),n.reactions.results.unshift(e.reactionCount),r=!0}let d=!1;if(i)try{const i=yield this.managers.appMessagesManager.getMessageReadParticipants(t.peerId,t.mid);if(!e())return;if(!i.length)throw"";const a=this.createFakeReaction("checks",i.length);s.prepend(a),n.reactions.results.unshift(a.reactionCount),d=!0}catch(e){}n.reactions.results.forEach((i=>{const s=new F.ZP(void 0);s.container.classList.add("tabs-tab");const n=new j.Z({noShadow:!0,noDelimiter:!0}),r=R.default.createChatList({dialogSize:72});R.default.setListClickListener(r,(()=>{this.hide()}),void 0,!1,!0),n.content.append(r),s.container.append(n.container);const d="checks"!==i.reaction,l="checks"===i.reaction;["checks","reactions"].includes(i.reaction)&&(i.reaction=void 0);const c=(0,H.C)(24,24);let h;const u=new D.Z({scrollable:s,getPromise:()=>G(this,void 0,void 0,(function*(){const s=yield this.managers.appMessagesManager.getMessageReactionsListAndReadParticipants(t,void 0,i.reaction,h,d,l);return h=s.nextOffset,yield Promise.all(s.combined.map((({peerId:t,reaction:i})=>G(this,void 0,void 0,(function*(){const{dom:s}=R.default.addDialogNew({peerId:t,autonomous:!0,container:r,avatarSize:"abitbigger",rippleEnabled:!1,meAsSaved:!1});if(i){const t=document.createElement("div");if(t.classList.add("reacted-list-reaction-icon"),"reactionEmoji"===i._){const s=yield this.managers.appReactionsManager.getReactionCached(i.emoticon);(0,N.ZP)({doc:s.static_icon,div:t,width:24,height:24,middleware:e})}else"reactionCustomEmoji"===i._&&t.append((0,z.Z)({docIds:[i.document_id],customEmojiSize:c,middleware:e}));s.listEl.append(t)}(0,B.Z)(s.lastMessageSpan,(0,U.Z)(yield this.managers.appUsersManager.getUser(t.toUserId())))}))))),!h}))});o.set(s.container,u),a.append(s.container)})),this.body.append(a);const l=(0,_.X)(s,a,((e,t)=>{if(e===s.childElementCount-1)return!1;const i=s.children[e],n=l.prevId();-1!==n&&s.children[n].setIsChosen(!1),i.setIsChosen(!0),o.get(t).load()}),void 0,void 0,void 0,this.listenerSetter);l(0,!1),this.show()}))}createFakeReaction(e,t){const i=new O.ZP;i.init("block",this.middlewareHelper.get()),i.reactionCount={_:"reactionCount",count:t,reaction:e},i.setCanRenderAvatars(!1),i.renderCounter();const s=document.createElement("div");return s.classList.add("reaction-counter","reaction-sticker-icon","tgico-"+e),i.prepend(s),i}}var K=i(6654),W=i(8204),$=i(5994),q=i(319),Y=i(3035),Q=i(1447),X=i(3512),J=i(5814);const ee="btn-menu-reactions",te=ee+"-reaction",ie=!x.IS_SAFARI;class se{constructor(e,t,i){this.managers=e,this.type=t,this.onScroll=()=>{this.reactionsMap.forEach(((e,t)=>{this.onScrollProcessItem(t,e)}))},this.onMouseMove=e=>{var t;const i=(0,u.Z)(e.target,te);if(!i)return;const s=this.reactionsMap.get(i);if(!s)return;if(!(null===(t=s.appear)||void 0===t?void 0:t.paused))return;const n=s.select;n&&n.paused&&(n.autoplay=!0,n.restart())};const n=this.widthContainer=document.createElement("div");n.classList.add(ee+"-container"),n.classList.add(ee+"-container-"+t);const a=this.container=document.createElement("div");a.classList.add(ee);const o=this.scrollable="vertical"===t?new F.ZP(void 0):new F.v7(void 0);a.append(o.container),o.onAdditionalScroll=this.onScroll,o.setListeners(),o.container.classList.add("no-scrollbar"),this.reactionsMap=new Map,this.animationGroup=`CHAT-MENU-REACTIONS-${Date.now()}`,J.Z.setOverrideIdleGroup(this.animationGroup,!0),s.Z||a.addEventListener("mousemove",this.onMouseMove),(0,f.fc)(a,(e=>{const t=(0,u.Z)(e.target,te);if(!t)return;const i=this.reactionsMap.get(t);i&&this.managers.appReactionsManager.sendReaction(this.message,i.reaction)})),n.append(a),this.middleware=null!=i?i:(0,M.k)()}init(e){this.message=e;const t=this.middleware.get(),i=this.managers.appReactionsManager.getAvailableReactionsByMessage(e);(0,K.Z)(i,(e=>{if(!t()||!e.length)return;e.forEach((e=>{e.pFlags.premium&&!X.Z.premium||this.renderReaction(e)}));const s=()=>{this.container.classList.add("is-visible")};i instanceof Promise?(0,Y.T2)(s):s()}))}cleanup(){this.middleware.clean(),this.scrollable.removeListeners(),this.reactionsMap.clear(),J.Z.setOverrideIdleGroup(this.animationGroup,!1),J.Z.checkAnimations(!0,this.animationGroup,!0)}canUseAnimations(){return $.Z.isAvailable("animations")&&$.Z.isAvailable("stickers_chat")&&!x.IS_MOBILE}renderReaction(e){const t=document.createElement("div");t.classList.add(te);const i=document.createElement("div");i.classList.add(te+"-scale");const n=document.createElement("div");let a;n.classList.add(te+"-appear"),this.canUseAnimations()&&(a=document.createElement("div"),a.classList.add(te+"-select","hide"));const o={selectWrapper:a,appearWrapper:n,reaction:{_:"reactionEmoji",emoticon:e.reaction}};this.reactionsMap.set(t,o);const r=this.middleware.get(),d=26*(s.Z?1:1.25),l={width:d,height:d,skipRatio:1,needFadeIn:!1,withThumb:!1,group:this.animationGroup,middleware:r};if(this.canUseAnimations()){let t=!0;(0,N.ZP)(Object.assign({doc:e.appear_animation,div:n,play:!0,liteModeKey:!1},l)).then((({render:e})=>e)).then((e=>{(0,E.Z)(e),o.appear=e,e.addEventListener("enterFrame",(s=>{e.maxFrame===s&&i.then((e=>{(0,E.Z)(e),n.classList.add("hide"),a.classList.remove("hide"),t&&(o.select=e,t=!1)}),q.Z)}))}),q.Z);const i=(0,N.ZP)(Object.assign({doc:e.select_animation,div:a,liteModeKey:!1},l)).then((({render:e})=>e)).then((e=>((0,E.Z)(e),Q.Z.waitForFirstFrame(e)))).catch(q.Z)}else delete l.needFadeIn,delete l.withThumb,(0,N.ZP)(Object.assign({doc:e.static_icon,div:n,liteModeKey:!1},l));i.append(n),a&&i.append(a),t.append(i),this.scrollable.append(t)}onScrollProcessItem(e,t){const i=e.firstElementChild,s=(0,W.Z)(e,this.scrollable.container);let n;if(s)if(s.overflow.left||s.overflow.right){const e=Math.abs(s.rect.left-s.rect.right);n="scale("+Math.min(Math.pow(e,2)/Math.pow(34,2),1)+")"}else n="";else{if(!t.appearWrapper.classList.contains("hide")||!t.appear)return;t.select&&t.select.stop(),t.appear.stop(),t.appear.autoplay=!0,t.appearWrapper.classList.remove("hide"),t.selectWrapper.classList.add("hide"),n=""}ie&&(i.style.transform=n)}}var ne=i(2946),ae=i(2790),oe=i(1483),re=i(3416),de=i(6976),le=i(2353),ce=i(2312),he=i(1507),ue=i(6690),pe=i(8115),fe=i(3725),me=i(9298),ge=i(7530),ve=i(3709),be=i(2381),ye=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class we{constructor(e,t){this.chat=e,this.managers=t,this.onContextMenu=e=>{let t,i;try{i=(0,u.Z)(e.target,"bubble-content-wrapper"),t=i?i.parentElement:(0,u.Z)(e.target,"bubble")}catch(e){}if(!t||t.classList.contains("bubble-first"))return;let s=this.element;if((e instanceof MouseEvent||e.hasOwnProperty("preventDefault"))&&e.preventDefault(),s&&s.classList.contains("active"))return!1;(e instanceof MouseEvent||e.hasOwnProperty("cancelBubble"))&&(e.cancelBubble=!0);let n=+t.dataset.mid;n&&(()=>{ye(this,void 0,void 0,(function*(){const a=this.isSponsored=n<0;this.isSelectable=this.chat.selection.canSelectBubble(t),this.peerId=this.chat.peerId,this.target=e.target,this.isTextSelected=!(0,m.Z)(),this.isAnchorTarget="A"===this.target.tagName&&("_blank"===this.target.target||this.target.classList.contains("anchor-url")),this.isUsernameTarget="A"===this.target.tagName&&this.target.classList.contains("mention");const o=yield this.chat.getMidsByMid(n);if(this.chat.selection.isSelecting&&!i){if(a)return;if(o.length>1){const e=this.chat.selection.isMidSelected(this.peerId,n)?n:o.find((e=>this.chat.selection.isMidSelected(this.peerId,e)));e&&(n=e)}}this.isOverBubble=!!i;const r=(0,u.Z)(this.target,"grouped-item");this.isTargetAGroupedItem=!!r,this.mid=r?+r.dataset.mid:n,this.isSelected=this.chat.selection.isMidSelected(this.peerId,this.mid),this.message=t.message||(yield this.chat.getMessage(this.mid)),this.albumMessages=this.message.grouped_id?yield this.managers.appMessagesManager.getMessagesByAlbum(this.message.grouped_id):void 0,this.noForwards=!a&&!(yield this.managers.appMessagesManager.canForward(this.message)),this.viewerPeerId=void 0,this.canOpenReactedList=void 0,this.linkToMessage=yield this.getUrlToMessage(),this.selectedMessagesText=yield this.getSelectedMessagesText(),this.selectedMessages=this.chat.selection.isSelecting?yield this.chat.selection.getSelectedMessages():void 0;const d=yield this.init();if(!d)return;s=d.element;const{cleanup:l,destroy:c,menuPadding:h,reactionsMenu:p,reactionsMenuPosition:f}=d;let g=!1;if(p){const e="is-visible";if(g=p.container.classList.contains(e),g&&p.container.classList.remove(e),"horizontal"===f){const e=s.offsetWidth,t=(e-8)/34%1,i=.65;if(t{p&&p.container.classList.remove("is-visible"),this.mid=0,this.peerId=void 0,this.target=null,this.viewerPeerId=void 0,this.canOpenReactedList=void 0,l(),setTimeout((()=>{c()}),300)})),g&&p.container.classList.add("is-visible")}))})()},this.onSendScheduledClick=()=>ye(this,void 0,void 0,(function*(){this.chat.selection.isSelecting?(0,f.tH)(this.chat.selection.selectionSendNowBtn):g.Z.createPopup(l.Z,this.peerId,yield this.chat.getMidsByMid(this.mid))})),this.onReplyClick=()=>{this.chat.input.initMessageReply(this.mid)},this.onFaveStickerClick=e=>{const t=this.message.media.document.id;this.managers.appStickersManager.faveSticker(t,e)},this.onEditClick=()=>{const e=this.getMessageWithText();this.chat.input.initMessageEditing(this.isTargetAGroupedItem?this.mid:e.mid)},this.onCopyClick=()=>ye(this,void 0,void 0,(function*(){(0,m.Z)()?(0,d.T)(this.selectedMessagesText):document.execCommand("copy")})),this.onCopyAnchorLinkClick=()=>{(0,d.T)(this.target.href)},this.onCopyLinkClick=()=>{const{url:e,isPrivate:t}=this.linkToMessage,i=t?"LinkCopiedPrivateInfo":"LinkCopied";(0,c.Am)(h.ZP.format(i,!0)),(0,d.T)(e)},this.onPinClick=()=>{g.Z.createPopup(r.Z,this.peerId,this.mid)},this.onUnpinClick=()=>{g.Z.createPopup(r.Z,this.peerId,this.mid,!0)},this.onRetractVote=()=>{this.managers.appPollsManager.sendVote(this.message,[])},this.onStopPoll=()=>{this.managers.appPollsManager.stopPoll(this.message)},this.onForwardClick=()=>ye(this,void 0,void 0,(function*(){if(this.chat.selection.isSelecting)(0,f.tH)(this.chat.selection.selectionForwardBtn);else{const e=this.peerId,t=this.isTargetAGroupedItem?[this.mid]:yield this.chat.getMidsByMid(this.mid);o.Z.create({[e]:t})}})),this.onSelectClick=()=>{this.chat.selection.toggleByElement((0,u.Z)(this.target,"grouped-item")||(0,u.Z)(this.target,"bubble"))},this.onClearSelectionClick=()=>{this.chat.selection.cancelSelection()},this.onDeleteClick=()=>ye(this,void 0,void 0,(function*(){this.chat.selection.isSelecting?(0,f.tH)(this.chat.selection.selectionDeleteBtn):g.Z.createPopup(a.Z,this.peerId,this.isTargetAGroupedItem?[this.mid]:yield this.chat.getMidsByMid(this.mid),this.chat.type)})),this.listenerSetter=new Z.Z,this.attachListenerSetter=new Z.Z,this.middleware=(0,M.k)()}attachTo(e){this.attachListenerSetter.removeAll(),s.Z?(0,f.fc)(e,(e=>{this.chat.selection.isSelecting||(this.chat.log("touchend",e),!e.target.closest([".name",".peer-title",".reply",".document","audio-element","avatar-element","a",".bubble-beside-button","replies-element","[data-saved-from]:not(.bubble)","poll-element",".attachment",".reply-markup-button"].join(", "))&&((0,p.Z)(e),this.onContextMenu(e)))}),{listenerSetter:this.attachListenerSetter}):(0,de.E)({element:e,callback:this.onContextMenu,listenerSetter:this.attachListenerSetter})}cleanup(){this.listenerSetter.removeAll(),this.reactionsMenu&&this.reactionsMenu.cleanup(),this.middleware.clean()}destroy(){this.cleanup(),this.attachListenerSetter.removeAll()}filterButtons(e){return ye(this,void 0,void 0,(function*(){return this.isSponsored?e.filter((e=>e.isSponsored)):(0,le.Z)(e,(e=>ye(this,void 0,void 0,(function*(){let t;return this.chat.selection.isSelecting&&!e.withSelection?t=!1:(this.isOverBubble||s.Z,t=yield e.verify()),!!t}))))}))}setButtons(){const e=e=>ye(this,void 0,void 0,(function*(){var t;const i=null===(t=this.message.media)||void 0===t?void 0:t.document;if(!(null==i?void 0:i.sticker))return!1;const s=yield this.managers.acknowledged.appStickersManager.getFavedStickersStickers();if(!s.cached)return!1;const n=(yield s.result).some((e=>e.id===i.id));return e?!n:n}));this.buttons=[{icon:"send2",text:"MessageScheduleSend",onClick:this.onSendScheduledClick,verify:()=>"scheduled"===this.chat.type&&!this.message.pFlags.is_outgoing},{icon:"send2",text:"Message.Context.Selection.SendNow",onClick:this.onSendScheduledClick,verify:()=>"scheduled"===this.chat.type&&this.isSelected&&!this.chat.selection.selectionSendNowBtn.hasAttribute("disabled"),notDirect:()=>!0,withSelection:!0},{icon:"schedule",text:"MessageScheduleEditTime",onClick:()=>{this.chat.input.scheduleSending((()=>{(0,E.Z)(this.message),this.managers.appMessagesManager.editMessage(this.message,this.message.message,{scheduleDate:this.chat.input.scheduleDate,entities:this.message.entities}),this.chat.input.onMessageSent(!1,!1)}),new Date(1e3*this.message.date))},verify:()=>"scheduled"===this.chat.type},{icon:"reply",text:"Reply",onClick:this.onReplyClick,verify:()=>ye(this,void 0,void 0,(function*(){return(yield this.chat.canSend())&&!this.message.pFlags.is_outgoing&&!!this.chat.input.messageInput&&"scheduled"!==this.chat.type}))},{icon:"favourites",text:"AddToFavorites",onClick:this.onFaveStickerClick.bind(this,!1),verify:()=>e(!0)},{icon:"favourites",text:"DeleteFromFavorites",onClick:this.onFaveStickerClick.bind(this,!0),verify:()=>e(!1)},{icon:"edit",text:"Edit",onClick:this.onEditClick,verify:()=>ye(this,void 0,void 0,(function*(){return(yield this.managers.appMessagesManager.canEditMessage(this.message,"text"))&&!!this.chat.input.messageInput}))},{icon:"copy",text:"Copy",onClick:this.onCopyClick,verify:()=>!(this.noForwards||!this.message.message||this.isTextSelected||this.isAnchorTarget&&this.message.message===this.target.innerText)},{icon:"copy",text:"Chat.CopySelectedText",onClick:this.onCopyClick,verify:()=>!this.noForwards&&!!this.message.message&&this.isTextSelected},{icon:"copy",text:"Message.Context.Selection.Copy",onClick:this.onCopyClick,verify:()=>ye(this,void 0,void 0,(function*(){if(!this.isSelected||this.noForwards)return!1;for(const[e,t]of this.chat.selection.selectedMids){const i=`${e}_${"scheduled"===this.chat.type?"scheduled":"history"}`;for(const e of t)if((yield this.managers.appMessagesManager.getMessageFromStorage(i,e)).message)return!0}return!1})),notDirect:()=>!0,withSelection:!0},{icon:"copy",text:"CopyLink",onClick:this.onCopyAnchorLinkClick,verify:()=>this.isAnchorTarget,withSelection:!0},{icon:"copy",text:"Text.Context.Copy.Username",onClick:()=>{(0,d.T)(this.target.innerHTML)},verify:()=>this.isUsernameTarget,withSelection:!0},{icon:"copy",text:"Text.Context.Copy.Hashtag",onClick:()=>{(0,d.T)(this.target.innerHTML)},verify:()=>this.target.classList.contains("anchor-hashtag"),withSelection:!0},{icon:"link",text:"MessageContext.CopyMessageLink1",onClick:this.onCopyLinkClick,verify:()=>ye(this,void 0,void 0,(function*(){return(yield this.managers.appPeersManager.isChannel(this.peerId))&&!this.message.pFlags.is_outgoing}))},{icon:"pin",text:"Message.Context.Pin",onClick:this.onPinClick,verify:()=>ye(this,void 0,void 0,(function*(){return!this.message.pFlags.is_outgoing&&"messageService"!==this.message._&&!this.message.pFlags.pinned&&(yield this.managers.appPeersManager.canPinMessage(this.peerId))&&"scheduled"!==this.chat.type}))},{icon:"unpin",text:"Message.Context.Unpin",onClick:this.onUnpinClick,verify:()=>ye(this,void 0,void 0,(function*(){return this.message.pFlags.pinned&&(yield this.managers.appPeersManager.canPinMessage(this.peerId))}))},{icon:"download",text:"MediaViewer.Context.Download",onClick:()=>we.onDownloadClick(this.message,this.noForwards),verify:()=>we.canDownload(this.message,this.target,this.noForwards)},{icon:"checkretract",text:"Chat.Poll.Unvote",onClick:this.onRetractVote,verify:()=>{var e;const t=null===(e=this.message.media)||void 0===e?void 0:e.poll;return t&&t.chosenIndexes.length&&!t.pFlags.closed&&!t.pFlags.quiz}},{icon:"stop",text:"Chat.Poll.Stop",onClick:this.onStopPoll,verify:()=>ye(this,void 0,void 0,(function*(){var e;const t=null===(e=this.message.media)||void 0===e?void 0:e.poll;return(yield this.managers.appMessagesManager.canEditMessage(this.message,"poll"))&&t&&!t.pFlags.closed&&!this.message.pFlags.is_outgoing}))},{icon:"forward",text:"Forward",onClick:this.onForwardClick,verify:()=>!(this.noForwards||"scheduled"===this.chat.type||this.message.pFlags.is_outgoing&&this.message.fromId!==he.yF||"messageService"===this.message._)},{icon:"forward",text:"Message.Context.Selection.Forward",onClick:this.onForwardClick,verify:()=>this.chat.selection.selectionForwardBtn&&this.isSelected&&!this.chat.selection.selectionForwardBtn.hasAttribute("disabled"),notDirect:()=>!0,withSelection:!0},{icon:"download",text:"Message.Context.Selection.Download",onClick:()=>we.onDownloadClick(this.selectedMessages,this.noForwards),verify:()=>this.selectedMessages&&we.canDownload(this.selectedMessages,void 0,this.noForwards),withSelection:!0},{icon:"flag",text:"ReportChat",onClick:()=>{g.Z.createPopup(I,this.peerId,[this.mid])},verify:()=>ye(this,void 0,void 0,(function*(){return!this.message.pFlags.out&&"message"===this.message._&&!this.message.pFlags.is_outgoing&&(yield this.managers.appPeersManager.isChannel(this.peerId))})),notDirect:()=>!0,withSelection:!0},{icon:"select",text:"Message.Context.Select",onClick:this.onSelectClick,verify:()=>!this.message.action&&!this.isSelected&&this.isSelectable,notDirect:()=>!0,withSelection:!0},{icon:"select",text:"Message.Context.Selection.Clear",onClick:this.onClearSelectionClick,verify:()=>this.isSelected,notDirect:()=>!0,withSelection:!0},{onClick:()=>{if(this.viewerPeerId)this.chat.appImManager.setInnerPeer({peerId:this.viewerPeerId});else{if(!this.canOpenReactedList)return!1;g.Z.createPopup(V,this.message)}},verify:()=>ye(this,void 0,void 0,(function*(){var e,t;return!this.peerId.isUser()&&(!!(null===(t=null===(e=this.message.reactions)||void 0===e?void 0:e.recent_reactions)||void 0===t?void 0:t.length)||(yield this.managers.appMessagesManager.canViewMessageReadParticipants(this.message)))})),notDirect:()=>!0,localName:"views"},{icon:"delete danger",text:"Delete",onClick:this.onDeleteClick,verify:()=>ye(this,void 0,void 0,(function*(){return this.managers.appMessagesManager.canDeleteMessage(this.message)}))},{icon:"delete danger",text:"Message.Context.Selection.Delete",onClick:this.onDeleteClick,verify:()=>this.isSelected&&!this.chat.selection.selectionDeleteBtn.hasAttribute("disabled"),notDirect:()=>!0,withSelection:!0},{icon:"info",text:"Chat.Message.Sponsored.What",onClick:()=>{g.Z.createPopup(P)},verify:()=>!1,isSponsored:!0},{text:"Loading",onClick:()=>{this.emojiInputsPromise.then((e=>{g.Z.createPopup(me.Z,e,!0).show()}))},verify:()=>!!this.getUniqueCustomEmojisFromMessage().length,notDirect:()=>!0,localName:"emojis"}]}static canDownload(e,t,i){var n,a;if(Array.isArray(e))return e.some((e=>we.canDownload(e,t,i)));if(!(0,ve.Z)(e)||i)return!1;let o=!1;if(null===(n=e.media)||void 0===n?void 0:n.photo)o=!0;else{if(!(null===(a=e.media)||void 0===a?void 0:a.document))return!1;o=!0}let r=!t||!!s.Z;return o&&t&&(r||(r=!!((0,u.Z)(t,"document")||(0,u.Z)(t,"audio")||(0,u.Z)(t,"media-sticker-wrapper")||(0,u.Z)(t,"media-photo")||(0,u.Z)(t,"media-video")))),o&&r}getMessageWithText(){return this.albumMessages&&(0,be.Z)(this.albumMessages)||this.message}getUniqueCustomEmojisFromMessage(){const e=[],t=this.getMessageWithText(),i=t.entities;if(i){const t=i.filter((e=>"messageEntityCustomEmoji"===e._));e.push(...t.map((e=>e.document_id)))}const s=t.reactions;if(s){const t=s.results.filter((e=>"reactionCustomEmoji"===e.reaction._));e.push(...t.map((e=>e.reaction.document_id)))}return(0,ue.Z)(e)}init(){return ye(this,void 0,void 0,(function*(){this.cleanup(),this.setButtons();const e=yield this.filterButtons(this.buttons);if(!e.length)return;const t=this.element=yield(0,n.Z)({buttons:e,listenerSetter:this.listenerSetter});t.id="bubble-contextmenu",t.classList.add("contextmenu");const i=e.find((e=>"views"===e.localName));if(i){const e=this.message.reactions,t=null==e?void 0:e.recent_reactions,s=!!(null==t?void 0:t.length),n=(yield this.managers.appMessagesManager.canViewMessageReadParticipants(this.message))?(yield this.managers.appPeersManager.getPeer(this.peerId)).participants_count:void 0,a=e?e.results.reduce(((e,t)=>e+t.count),0):void 0;i.element.classList.add("tgico-"+(s?"reactions":"checks"));const o=new h.ZP.IntlElement({key:s?void 0===n?"Chat.Context.ReactedFast":"Chat.Context.Reacted":"NobodyViewed",args:s?void 0===n?[a]:[n,n]:void 0,element:i.textElement});let r;r=s?void 0===n?(0,h.ag)("Chat.Context.ReactedFast",[a]):(0,h.ag)(t.length===n?"Chat.Context.ReactedFast":"Chat.Context.Reacted",[t.length,n]):(0,h.ag)("Loading"),r.classList.add("btn-menu-item-text-fake"),i.element.append(r);const d=22,l=3,c=1.125;o.element.style.visibility="hidden",o.element.style.paddingRight=s?c*Math.min(l,t.length)+"rem":"1rem";const u=this.middleware.get();this.managers.appMessagesManager.getMessageReactionsListAndReadParticipants(this.message).then((e=>{if(!u())return;r&&r.remove();const a=e.combined,p=void 0===n?e.reactionsCount:s?a.filter((e=>e.reaction)).length:a.length;let f;if(1===a.length)f=new T.Z({peerId:a[0].peerId,onlyFirstName:!0,dialog:!1}).element,(!s||e.readParticipants.length<=1)&&(this.viewerPeerId=a[0].peerId);else if(s){const e=p===a.length||void 0===n;f=(0,h.ag)(e?"Chat.Context.ReactedFast":"Chat.Context.Reacted",e?[p]:[p,a.length])}else a.length?f=(0,h.ag)("MessageSeen",[a.length]):o.element.style.visibility="";if(f&&(f.style.paddingRight=c*Math.min(l,p)+"rem",f.classList.add("btn-menu-item-text-fake"),i.element.append(f)),a.length){const e=new k.Z({avatarSize:d});e.render(t?t.map((e=>(0,ne.Z)(e.peer_id))):a.map((e=>e.peerId))),i.element.append(e.container),this.canOpenReactedList=!0}}))}let a,o,r;if(!("message"!==this.message._||this.chat.selection.isSelecting||this.message.pFlags.is_outgoing||this.message.pFlags.is_scheduled||this.message.pFlags.local)){r=x.IS_APPLE||s.Z?"horizontal":"vertical",o=this.reactionsMenu=new se(this.managers,r,this.middleware),o.init(yield this.managers.appMessagesManager.getGroupsFirstMessage(this.message));const e=44,t=0;a="vertical"===r?{top:t,left:e}:{top:e,right:0,left:t}}const d=e.find((e=>"emojis"===e.localName));if(d){d.element.classList.add("is-multiline"),d.element.parentElement.insertBefore(document.createElement("hr"),d.element);const e=()=>{null!=a||(a={}),a.bottom=24},t=this.getUniqueCustomEmojisFromMessage(),i=this.emojiInputsPromise=(0,fe.Z)();yield this.managers.appEmojiManager.getCachedCustomEmojiDocuments(t).then((s=>ye(this,void 0,void 0,(function*(){const n=t=>ye(this,void 0,void 0,(function*(){const s=new Map;t.forEach((e=>{e&&!s.has(e.stickerSetInput.id)&&s.set(e.stickerSetInput.id,e.stickerSetInput)}));const n=[...s.values()];if(i.resolve(n),1===s.size){const t=yield this.managers.acknowledged.appStickersManager.getStickerSet(n[0]),i=t.result.then((e=>{const t=(0,h.ag)("MessageContainsEmojiPack",[(0,pe.Z)(e.set.title)]);(0,B.Z)(d.textElement,t)}));return t.cached?i:void e()}(0,B.Z)(d.textElement,(0,h.ag)("MessageContainsEmojiPacks",[s.size]))}));if(!s.some((e=>!e)))return n(s);e(),this.managers.appEmojiManager.getCustomEmojiDocuments(t).then(n)}))))}return this.chat.container.append(t),{element:t,cleanup:()=>{this.cleanup(),o&&o.cleanup()},destroy:()=>{t.remove(),o&&o.widthContainer.remove()},menuPadding:a,reactionsMenu:o,reactionsMenuPosition:r}}))}getUrlToMessage(){return ye(this,void 0,void 0,(function*(){if(this.peerId.isUser())return;let e;const{peerId:t,mid:i}=this,s=this.chat.threadId;"discussion"===this.chat.type&&(e=yield this.managers.appMessagesManager.getMessageByPeer(t,s));const n=yield this.managers.appPeersManager.getPeerUsername(e?e.fromId:t),a=(0,ae.Z)(i);let o="https://t.me/";return n?(o+=n,o+=e?`/${(0,ae.Z)(e.fwd_from.channel_post)}?comment=${a}`:s?`/${(0,ae.Z)(s)}/${a}`:"/"+a):(o+="c/"+t.toChatId(),o+=e?`/${a}?thread=${(0,ae.Z)(e.mid)}`:s?`/${(0,ae.Z)(s)}/${a}`:"/"+a),{url:o,isPrivate:!n}}))}getSelectedMessagesText(){return ye(this,void 0,void 0,(function*(){if(!(0,m.Z)())return"";const e=this.chat.selection.isSelecting?[...this.chat.selection.selectedMids.get(this.peerId)].sort(((e,t)=>e-t)):[this.mid];return(yield Promise.all(e.map((e=>ye(this,void 0,void 0,(function*(){const t=yield this.chat.getMessage(e);return(null==t?void 0:t.message)?t.message+"\n":""})))))).join("")}))}static onDownloadClick(e,t){return Array.isArray(e)?e.map((e=>this.onDownloadClick(e))):this.canDownload(e,void 0,t)?ce.Z.downloadToDisc({media:(0,ge.Z)(e,!0)}):void 0}}},1571:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(5296),n=i(2064);class a{constructor(){this._width=50,this._height=50,this._tails=90,this._scrollTails=50,this._curve=[0,.25,.5,.75,1,1.5,2,2.5,3,3.5,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,18.3,18.6,18.9,19.2,19.5,19.8,20.1,20.4,20.7,21,21.3,21.6,21.9,22.2,22.5,22.8,23.1,23.4,23.7,24,24.3,24.6,24.9,25.2,25.5,25.8,26.1,26.3,26.4,26.5,26.6,26.7,26.8,26.9,27],this._positions=[{x:.8,y:.1},{x:.6,y:.2},{x:.35,y:.25},{x:.25,y:.6},{x:.2,y:.9},{x:.4,y:.8},{x:.65,y:.75},{x:.75,y:.4}],this._phases=this._positions.length,this.onWheel=e=>{this._animatingToNextPosition||(this._scrollDelta+=e.deltaY,void 0===this._onWheelRAF&&(this._onWheelRAF=requestAnimationFrame(this.drawOnWheel)))},this.drawOnWheel=()=>{const e=this._scrollDelta/this._scrollTails;this._scrollDelta%=this._scrollTails;const t=e>0?Math.floor(e):Math.ceil(e);t&&this.changeTailAndDraw(t),this._onWheelRAF=void 0},this.drawNextPositionAnimated=e=>{var t;let i,s;if(e){const s=e();i=s>=1;const a=-1*(n=s)*(n-2),o=null!==(t=this._nextPositionTail)&&void 0!==t?t:0,r=(this._nextPositionTail=this._nextPositionTails*a)-o;r&&(this._nextPositionLeft-=r,this.changeTailAndDraw(r))}else{const e=this._frames;s=e.shift(),i=!e.length}var n;return s&&this.drawImageData(s),i&&(this._nextPositionLeft=void 0,this._nextPositionTails=void 0,this._nextPositionTail=void 0,this._animatingToNextPosition=void 0),!i};const e=this._tails/this._curve[this._curve.length-1];for(let t=0,i=this._curve.length;t{var s;return e-(null!==(s=i[t-1])&&void 0!==s?s:0)}))}hexToRgb(e){const t=(0,n.oo)(e);return{r:t[0],g:t[1],b:t[2]}}getPositions(e){const t=this._positions.slice();t.push(...t.splice(0,e));const i=[];for(let e=0;e({x:(e.x-s[i].x)/t,y:(e.y-s[i].y)/t})));return i.map((e=>n.map(((t,i)=>({x:s[i].x+t.x*e,y:s[i].y+t.y*e})))))}curPosition(e,t){return this.getNextPositions(e,this._tails,[t])[0]}changeTail(e){for(this._tail+=e;this._tail>=this._tails;)this._tail-=this._tails,++this._phase>=this._phases&&(this._phase-=this._phases);for(;this._tail<0;)this._tail+=this._tails,--this._phase<0&&(this._phase+=this._phases)}changeTailAndDraw(e){this.changeTail(e);const t=this.curPosition(this._phase,this._tail);this.drawGradient(t)}getGradientImageData(e){const t=this._hctx.createImageData(this._width,this._height),i=t.data;let s=0;for(let t=0;tthis.hexToRgb(e))),this._hc||(this._hc=document.createElement("canvas"),this._hc.width=this._width,this._hc.height=this._height,this._hctx=this._hc.getContext("2d",{alpha:!1})),this._canvas=e,this._ctx=this._canvas.getContext("2d",{alpha:!1}),this.update()}update(){if(this._colors.length<2){const e=this._colors[0];return this._ctx.fillStyle=`rgb(${e.r}, ${e.g}, ${e.b})`,void this._ctx.fillRect(0,0,this._width,this._height)}const e=this.curPosition(this._phase,this._tail);this.drawGradient(e)}toNextPosition(e){var t,i;if(this._colors.length<2)return;if(e)return this._nextPositionLeft=this._tails+(null!==(t=this._nextPositionLeft)&&void 0!==t?t:0),this._nextPositionTails=this._nextPositionLeft,this._nextPositionTail=void 0,this._animatingToNextPosition=!0,void(0,s.cK)(this.drawNextPositionAnimated.bind(this,e),this);const n=this._tail,a=this._tails;let o;const r=[];for(let e=0,t=this._incrementalCurve.length;ea&&void 0===o&&(o=e,s%=a),r.push(s)}[r.slice(0,o),void 0!==o?r.slice(o):[]].forEach(((e,t,i)=>{const s=e[e.length-1];if(void 0!==s&&s>a&&(e[e.length-1]=+s.toFixed(2)),this._tail=null!=s?s:0,!e.length)return;const n=this.getNextPositions(this._phase,a,e);t!==i.length-1&&++this._phase>=this._phases&&(this._phase-=this._phases);const o=n.map((e=>this.getGradientImageData(e)));this._frames.push(...o)})),this._animatingToNextPosition=!0,(0,s.cK)(this.drawNextPositionAnimated,this)}scrollAnimate(e){}cleanup(){this.scrollAnimate(!1)}static createCanvas(e){const t=document.createElement("canvas");return t.width=50,t.height=50,void 0!==e&&(t.dataset.colors=e),t}static create(e){const t=this.createCanvas(e),i=new a;return i.init(t),{gradientRenderer:i,canvas:t}}}},8843:(e,t,i)=>{"use strict";i.d(t,{m:()=>Bt,Z:()=>Nt});var s=i(7030),n=i(4329),a=i.n(n),o=i(5432),r=i(9043),d=i(3003),l=i(3173),c=i(1168),h=i(9807),u=i(503),p=i(1218),f=i(8805),m=i(6676),g=i(2325),v=i(4668),b=i(3910),y=i(1293),w=i(2648),S=i(2738),C=i(9336),L=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class I extends c.Z{constructor(e){super("popup-create-poll popup-new-media",{closable:!0,withConfirm:"Create",body:!0,title:"NewPoll"}),this.chat=e,this.tempId=0,this.onSubmitClick=()=>{this.send()},this.onInput=e=>{const t=e.target,i=(0,v.Z)(t,"LABEL"),s=(0,y.Z)(t);s||(t.parentElement.classList.add("is-filled"),i.classList.remove("hidden-widget"),i.firstElementChild.removeAttribute("disabled")),!i.nextElementSibling&&!s&&this.questions.childElementCount<10&&this.appendMoreField(),this.handleChange()},this.onDeleteClick=e=>{const t=e.target,i=(0,v.Z)(t,"LABEL"),s=(0,w.Z)(i);this.correctAnswers&&this.correctAnswers[0][0]===s&&(this.correctAnswers=void 0),i.remove(),this.optionInputFields.splice(s,1),this.optionInputFields.forEach(((e,t)=>{e.options.labelOptions.length=0,e.options.labelOptions.push(t+1),g.ZP.weakMap.get(e.label.firstElementChild).update()})),this.handleChange()},this.construct()}construct(){return L(this,void 0,void 0,(function*(){if(this.questionInputField=new u.ZP({placeholder:"AskAQuestion",label:"AskAQuestion",name:"question",maxLength:255}),this.listenerSetter.add(this.questionInputField.input)("input",(()=>{this.handleChange()})),this.optionInputFields=[],"scheduled"!==this.chat.type){const e=new m.Z({onSilentClick:()=>{this.chat.input.sendSilent=!0,this.send()},onScheduleClick:()=>{this.chat.input.scheduleSending((()=>{this.send()}))},openSide:"bottom-left",onContextElement:this.btnConfirm});e.setPeerId(this.chat.peerId),this.header.append(e.sendMenu)}this.header.append(this.questionInputField.container);const e=document.createElement("hr"),t=document.createElement("div");t.classList.add("caption"),(0,g.$d)(t,"PollOptions"),this.questions=document.createElement("form"),this.questions.classList.add("poll-create-questions");const i=document.createElement("div");i.classList.add("poll-create-settings");const s=document.createElement("div");s.classList.add("caption"),(0,g.$d)(s,"Settings"),(yield this.chat.managers.appPeersManager.isBroadcast(this.chat.peerId))||(this.anonymousCheckboxField=new h.Z({text:"NewPoll.Anonymous",name:"anonymous"}),this.anonymousCheckboxField.input.checked=!0,i.append(this.anonymousCheckboxField.label)),this.multipleCheckboxField=new h.Z({text:"NewPoll.MultipleChoice",name:"multiple"}),this.quizCheckboxField=new h.Z({text:"NewPoll.Quiz",name:"quiz"}),this.listenerSetter.add(this.multipleCheckboxField.input)("change",(()=>{const e=this.multipleCheckboxField.input.checked;this.quizCheckboxField.input.toggleAttribute("disabled",e)})),this.listenerSetter.add(this.quizCheckboxField.input)("change",(()=>{const e=this.quizCheckboxField.input.checked;Array.from(this.questions.children).map((t=>{t.classList.toggle("radio-field",e)})),e||(this.correctAnswers=void 0,this.quizSolutionField.setValueSilently("")),n.forEach((t=>t.classList.toggle("hide",!e))),this.multipleCheckboxField.input.toggleAttribute("disabled",e),this.handleChange()})),i.append(this.multipleCheckboxField.label,this.quizCheckboxField.label);const n=[],a=document.createElement("div");a.classList.add("caption"),(0,g.$d)(a,"AccDescrQuizExplanation");const o=document.createElement("hr"),r=document.createElement("div");r.classList.add("poll-create-questions"),this.quizSolutionField=new u.ZP({placeholder:"NewPoll.Explanation.Placeholder",label:"NewPoll.Explanation.Placeholder",name:"solution",maxLength:200}),this.listenerSetter.add(this.questionInputField.input)("input",(()=>{this.handleChange()}));const d=document.createElement("div");d.classList.add("subtitle"),(0,g.$d)(d,"AddAnExplanationInfo"),r.append(this.quizSolutionField.container,d),n.push(o,a,r),n.forEach((e=>e.classList.add("hide"))),this.body.parentElement.insertBefore(e,this.body),this.body.append(t,this.questions,document.createElement("hr"),s,i,...n),(0,S.fc)(this.btnConfirm,this.onSubmitClick,{listenerSetter:this.listenerSetter}),this.scrollable=new f.ZP(this.body),this.appendMoreField(),this.onEscape=()=>!this.getFilledAnswers().length,this.handleChange()}))}getFilledAnswers(){return Array.from(this.questions.children).map(((e,t)=>{const i=e.querySelector(".input-field-input");return i instanceof HTMLInputElement?i.value:(0,C.Z)(i,!1,!1).value})).filter((e=>!!e.trim()))}validate(){var e;const t=this.questionInputField.value;if(!t)return!1;if(t.length>255)return!1;if(this.quizCheckboxField.input.checked&&!(null===(e=this.correctAnswers)||void 0===e?void 0:e.length))return!1;const i=this.getFilledAnswers();if(i.length<2)return!1;if(i.find((e=>e.length>100)))return!1;const{value:s}=(0,C.Z)(this.quizSolutionField.input,!1,!1);return!(s.length>200)}handleChange(){const e=this.validate();this.btnConfirm.toggleAttribute("disabled",!e)}send(e=!1){return L(this,void 0,void 0,(function*(){const t=this.questionInputField.value,i=this.getFilledAnswers(),{value:s,entities:n}=(0,C.Z)(this.quizSolutionField.input,!0,!1);if("scheduled"===this.chat.type&&!e)return void this.chat.input.scheduleSending((()=>{this.send(!0)}));this.hide();const a={};this.anonymousCheckboxField&&!this.anonymousCheckboxField.input.checked&&(a.public_voters=!0),this.multipleCheckboxField.input.checked&&(a.multiple_choice=!0),this.quizCheckboxField.input.checked&&(a.quiz=!0);const o={_:"poll",pFlags:a,question:t,answers:i.map(((e,t)=>({_:"pollAnswer",text:e,option:new Uint8Array([t])}))),id:void 0},r=yield this.chat.managers.appPollsManager.getInputMediaPoll(o,this.correctAnswers,s,n);this.chat.managers.appMessagesManager.sendOther(this.chat.peerId,r,Object.assign({},this.chat.getMessageSendingParams())),"reply"===this.chat.input.helperType&&this.chat.input.clearHelper(),this.chat.input.onMessageSent(!1,!1)}))}appendMoreField(){const e=this.tempId++,t=this.questions.childElementCount+1,i=new u.ZP({placeholder:"NewPoll.OptionsAddOption",label:"NewPoll.OptionLabel",labelOptions:[t],name:"question-"+e,maxLength:100});this.listenerSetter.add(i.input)("input",this.onInput);const s=new p.Z({text:"",name:"question"});s.main.append(i.container),(0,S.fc)(i.input,b.Z,{listenerSetter:this.listenerSetter}),s.label.classList.add("hidden-widget"),s.input.disabled=!0,this.quizCheckboxField.input.checked||s.label.classList.remove("radio-field"),this.listenerSetter.add(s.input)("change",(()=>{if(s.input.checked){const e=(0,w.Z)(s.label);this.correctAnswers=[new Uint8Array([e])],this.handleChange()}}));const n=document.createElement("span");n.classList.add("btn-icon","tgico-close"),i.container.append(n),(0,S.fc)(n,this.onDeleteClick,{listenerSetter:this.listenerSetter,once:!0}),this.questions.append(s.label),this.scrollable.scrollIntoViewNew({element:this.questions.lastElementChild,position:"center"}),this.optionInputFields.push(i)}}var E=i(4524),P=i(805),Z=i(2796),M=i(3699),T=i(4755),k=i(6787),x=i(3512),A=i(6057),_=i(2153),F=i(9259),D=i(4789),R=i(5975),B=i(8497);const N="keydown",O="active",U=["ArrowUp","ArrowDown"],H=["ArrowLeft","ArrowRight"];function z({list:e,type:t,onSelect:i,once:s,waitForKey:n}){let a=(null==n?void 0:n.length)?new Set(n):void 0;const o=new Set("xy"===t?U.concat(H):"x"===t?H:U);let r;const d=()=>r||e.querySelector("."+O)||e.firstElementChild,l=(e,i)=>{if(r===e)return;let s=!1;r&&(s=!0,r.classList.remove(O)),r=e,r&&(r.classList.add(O),s&&p&&i&&(0,D.Z)({container:p,element:r,position:"center",forceDuration:100,axis:"x"===t?"x":"y"}))},c=(t,i)=>{let s;return s=i?t.nextElementSibling||e.firstElementChild:t.previousElementSibling||e.lastElementChild,s};let h;h="xy"===t?(t,i)=>"ArrowUp"===i||"ArrowDown"===i?((t,i)=>{const s=i?"nextElementSibling":"previousElementSibling",n=i?"firstElementChild":"lastElementChild",a=t.getBoundingClientRect();let o=t[s]||e[n];for(;o!==t;){const t=o.getBoundingClientRect();if(t.x===a.x&&t.y!==a.y)break;o=o[s]||e[n]}return o})(t,"ArrowDown"===i):c(t,"ArrowRight"===i):(e,t)=>c(e,"ArrowRight"===t||"ArrowDown"===t);let u=i=>{const s=i.key;if(o.has(s)){if((0,b.Z)(i),e.childElementCount>1){let e=d();e=h(e,s),l(e,!0)}}else("Enter"===s||"xy"!==t&&"Tab"===s)&&((0,b.Z)(i),g(d()))};const p=(0,B.Z)(e,"scrollable");e.classList.add("navigable-list");const f=t=>{const i=(0,R.Z)(t.target,e);i&&l(i,!1)},m=t=>{(0,b.Z)(t);const i=(0,R.Z)(t.target,e);i&&(l(i,!1),g(d()))},g=e=>{return t=this,n=void 0,o=function*(){const t=yield i(e);(void 0!==t?!t:s)&&C()},new((a=void 0)||(a=Promise))((function(e,i){function s(e){try{d(o.next(e))}catch(e){i(e)}}function r(e){try{d(o.throw(e))}catch(e){i(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(s,r)}d((o=o.apply(t,n||[])).next())}));var t,n,a,o};let v,y=!1;const w=()=>{y||(y=!0,document.addEventListener(N,u,{capture:!0,passive:!1}),e.addEventListener("mousemove",f,{passive:!0}),v=(0,S.fc)(e,m))},C=()=>{y&&(y=!1,document.removeEventListener(N,u,{capture:!0}),e.removeEventListener("mousemove",f),v(),v=void 0)},L=()=>{a||l(e.firstElementChild,!1)};if(a){const e=u;u=t=>{a.has(t.key)&&((0,b.Z)(t),document.removeEventListener(N,u,{capture:!0}),u=e,document.addEventListener(N,u,{capture:!0,passive:!1}),a=void 0,L())}}else L();return w(),{attach:w,detach:C,resetTarget:L}}var j=i(3241),G=i(4762),V=i(5824),K=i(9099),W=i(5953),$=i(5994);class q extends j.Z{constructor(e){var t;super(!1),this.hidden=!0,this.onVisible=()=>{var e;null===(e=this.detach)||void 0===e||e.call(this);const t=this.list,{attach:i,detach:s,resetTarget:n}=z({list:t,type:this.listType,onSelect:this.onSelect,once:!0,waitForKey:this.waitForKey});this.attach=i,this.detach=s,this.resetTarget=n,G.IS_MOBILE||this.navigationItem||(this.navigationItem={type:"autocomplete-helper",onPop:()=>{this.navigationItem=void 0,this.toggle(!0)},noBlurOnPop:!0},V.Z.pushItem(this.navigationItem)),this.addEventListener("hidden",(()=>{this.resetTarget=void 0,this.attach=void 0,this.detach=void 0,t.innerHTML="",s(),this.navigationItem&&(V.Z.removeItem(this.navigationItem),this.navigationItem=void 0)}),{once:!0})},(0,W.Z)(this,e),this.container=document.createElement("div"),this.container.classList.add("autocomplete-helper","z-depth-1"),e.appendTo.append(this.container),this.attachNavigation(),null===(t=this.controller)||void 0===t||t.addHelper(this)}toggleListNavigation(e){var t,i;e?null===(t=this.attach)||void 0===t||t.call(this):null===(i=this.detach)||void 0===i||i.call(this)}attachNavigation(){this.addEventListener("visible",this.onVisible)}toggle(e,t=!1,i){var s;if(this.init)return;if(void 0===e&&(e=this.container.classList.contains("is-visible")&&!this.container.classList.contains("backwards")),this.hidden===e)return void(e||this.dispatchEvent("visible"));this.hidden=e,e?(this.navigationItem&&(V.Z.removeItem(this.navigationItem),this.navigationItem=void 0),!t&&this.controller&&this.controller.hideOtherHelpers(),null===(s=this.detach)||void 0===s||s.call(this)):(this.controller&&this.controller.hideOtherHelpers(this),this.dispatchEvent("visible"));const n=this.controller||e?0:2;e&&this.dispatchEvent("hiding"),(0,K.Z)({element:this.container,className:"is-visible",forwards:!e,duration:$.Z.isAvailable("animations")&&!i?300:0,onTransitionEnd:()=>{this.hidden&&this.dispatchEvent("hidden")},useRafs:n})}}class Y extends q{constructor(e,t,i,s){super({appendTo:e,controller:t,listType:"xy",onSelect:e=>{return t=this,i=void 0,n=function*(){return!(yield l.Jo.onMediaClick({target:e},!0))},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n},waitForKey:["ArrowUp","ArrowDown"]}),this.chat=i,this.managers=s,this.container.classList.add("stickers-helper"),this.addEventListener("visible",(()=>{setTimeout((()=>{this.scrollable.container.scrollTop=0}),0),x.Z.dispatchEvent("choosing_sticker",!0)})),this.addEventListener("hidden",(()=>{this.onChangeScreen&&(T.Z.removeEventListener("changeScreen",this.onChangeScreen),this.onChangeScreen=void 0,this.listenerSetter.removeAll(),this.listenerSetter=void 0),x.Z.dispatchEvent("choosing_sticker",!1)}))}checkEmoticon(e){var t;const i=this.controller.getMiddleware();null===(t=this.lazyLoadQueue)||void 0===t||t.clear(),(0,k.Z)(e),this.managers.appStickersManager.getStickersByEmoticon(e,!0,"all"===x.Z.settings.stickers.suggest).then((e=>{if(!i())return;this.init&&(this.init(),this.init=null);const t=this.list.cloneNode();let s;this.lazyLoadQueue.clear(),s=e.length?new Promise((i=>{const s=[];e.forEach((e=>{t.append(this.superStickerRenderer.renderSticker(e,void 0,s))})),Promise.all(s).finally(i)})):Promise.resolve(),s.then((()=>{this.list.replaceWith(t),this.list=t,this.onChangeScreen||(this.onChangeScreen=()=>{const e=this.list.childElementCount*T.Z.active.esgSticker.width+(this.list.childElementCount-1);this.list.style.width=e+"px"},T.Z.addEventListener("changeScreen",this.onChangeScreen),this.listenerSetter=new M.Z,(0,F.Z)({listenTo:this.container,listenerSetter:this.listenerSetter})),this.onChangeScreen(),this.toggle(!e.length),this.scrollable.scrollTop=0}))}))}init(){this.list=document.createElement("div"),this.list.classList.add("stickers-helper-stickers","super-stickers"),this.container.append(this.list),this.scrollable=new f.ZP(this.container),this.lazyLoadQueue=new _.Z,this.superStickerRenderer=new A.vT(this.lazyLoadQueue,this.chat.animationGroup,this.managers)}}var Q=i(2230),X=i(5322),J=i(4494),ee=i(586),te=i(2986);const ie=()=>{const e=new Date;return e.setHours(0,0,0,0),e},se=()=>{const e=new Date;return e.setFullYear(e.getFullYear()+1),e.setDate(e.getDate()-1),e};class ne extends te.Z{constructor(e,t,i){var s;if(super((s=e).getTime()>se().getTime()?new Date:s,t,{noButtons:!0,noTitle:!0,closable:!0,withConfirm:!0,minDate:ie(),maxDate:se(),withTime:!0,showOverflowMonths:!0,confirmShortcutIsSendShortcut:!0,title:!0}),this.element.classList.add("popup-schedule"),this.header.append(this.controlsDiv),this.title.replaceWith(this.monthTitle),this.body.append(this.btnConfirm),i){const e=(0,J.Z)("btn-primary btn-secondary btn-primary-transparent primary",{text:"Schedule.SendWhenOnline"});this.body.append(e),(0,S.fc)(e,(()=>{t(ee._),this.hide()}))}}}var ae=i(684),oe=i(7298),re=i(5729),de=i(8119),le=i(8799),ce=i(6760),he=i(6299),ue=i(2398),pe=i(6039);class fe extends q{constructor(e,t,i,s){super({appendTo:e,controller:t,listType:"x",onSelect:e=>{i.onEmojiSelected((0,pe.xG)(e),!0)}}),this.managers=s,this.container.classList.add("emoji-helper")}init(){this.list=document.createElement("div"),this.list.classList.add("emoji-helper-emojis","super-emojis"),this.container.append(this.list),this.scrollable=new f.v7(this.container),this.addEventListener("visible",(()=>{setTimeout((()=>{this.scrollable.container.scrollLeft=0}),0)}))}render(e,t){if(this.init){if(!e.length)return;this.init(),this.init=null}(e=e.slice(0,80)).length&&(this.list.innerHTML="",e.forEach((e=>{(0,pe.IA)(e,this.list,!1,!0)}))),this.waitForKey=t?["ArrowUp","ArrowDown"]:void 0,this.toggle(!e.length)}checkQuery(e,t){const i=this.controller.getMiddleware();this.managers.appEmojiManager.getBothEmojiKeywords().then((()=>{return s=this,n=void 0,o=function*(){if(!i())return;const s=e.replace(/^:/,""),n=yield this.managers.appEmojiManager.searchEmojis(s);i()&&this.render(n,":"!==t)},new((a=void 0)||(a=Promise))((function(e,t){function i(e){try{d(o.next(e))}catch(e){t(e)}}function r(e){try{d(o.throw(e))}catch(e){t(e)}}function d(t){var s;t.done?e(t.value):(s=t.value,s instanceof a?s:new a((function(e){e(s)}))).then(i,r)}d((o=o.apply(s,n||[])).next())}));var s,n,a,o}))}}var me=i(130),ge=i(8115),ve=i(9331),be=i(8842);class ye extends q{constructor(e,t,i,s){super({appendTo:e,controller:t,listType:"y",onSelect:s}),this.className=i,this.container.classList.add(ye.BASE_CLASS,i)}init(){this.list=document.createElement("div"),this.list.classList.add(ye.BASE_CLASS+"-list",this.className+"-list"),this.container.append(this.list),this.scrollable=new f.ZP(this.container),this.addEventListener("visible",(()=>{setTimeout((()=>{this.scrollable.container.scrollTop=0}),0)}))}render(e,t){if(this.init){if(!e.length)return;this.init(),this.init=null}e.length&&(this.list.innerHTML="",e.forEach((e=>{const t=ye.listElement({className:this.className,peerId:e.peerId,name:e.name,description:e.description});this.list.append(t)}))),t||this.toggle(!e.length)}static listElement(e){const t=ye.BASE_CLASS_LIST_ELEMENT;e.className+="-list-element";const i=document.createElement("div");i.classList.add(t,e.className),i.dataset.peerId=""+e.peerId;const s=new ve.Z;s.classList.add("avatar-30",t+"-avatar",e.className+"-avatar"),s.updateWithOptions({isDialog:!1,peerId:e.peerId});const n=document.createElement("div");if(n.classList.add(t+"-name",e.className+"-name"),e.name?(0,me.Z)(n,(0,ge.Z)(e.name)):n.append(new be.Z({peerId:e.peerId,dialog:!1,onlyFirstName:!1,plainText:!1}).element),i.append(s,n),e.description){const s=document.createElement("div");s.classList.add(t+"-description",e.className+"-description"),(0,me.Z)(s,(0,ge.Z)(e.description)),i.append(s)}return i}}ye.BASE_CLASS="autocomplete-peer-helper",ye.BASE_CLASS_LIST_ELEMENT=ye.BASE_CLASS+"-list-element";var we=i(7381);function Se(e,t,i){const s=[].concat(t.bot_info);let n;void 0!==i&&(n=new we.Z({ignoreCase:!0}));const a=new Map;let o;if(s.forEach((t=>{t.commands&&t.commands.forEach((({command:i,description:s},o)=>{const r="/"+i;a.set(i,{peerId:t.user_id?t.user_id.toPeerId(!1):e,command:i,name:r,description:s,index:o}),n&&n.indexObject(i,r)}))})),n){const e=n.search(i);o=Array.from(e).map((e=>a.get(e)))}else o=[...a.values()];return o=o.sort(((e,t)=>a.get(e.command).index-a.get(t.command).index)),o}class Ce extends ye{constructor(e,t,i,s){super(e,t,"commands-helper",(e=>{const t=e.querySelector(`.${ye.BASE_CLASS_LIST_ELEMENT}-name`).innerHTML;return i.getReadyToSend((()=>{i.messageInput.innerHTML=t,i.sendMessage(!0)}))})),this.managers=s}checkQuery(e,t){return i=this,s=void 0,a=function*(){if(!(yield this.managers.appUsersManager.isBot(t)))return!1;const i=this.controller.getMiddleware();return this.managers.appProfileManager.getProfileByPeerId(t).then((s=>{if(!i())return;const n=Se(t,s,e);this.render(n)})),!0},new((n=void 0)||(n=Promise))((function(e,t){function o(e){try{d(a.next(e))}catch(e){t(e)}}function r(e){try{d(a.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(i,s||[])).next())}));var i,s,n,a}}var Le=i(3624);class Ie{constructor(){this.helpers=new Set,this.middleware=(0,Le.k)()}toggleListNavigation(e){for(const t of this.helpers)t.toggleListNavigation(e)}getMiddleware(){return this.middleware.clean(),this.middleware.get()}addHelper(e){this.helpers.add(e)}hideOtherHelpers(e){this.helpers.forEach((t=>{t!==e&&t.toggle(!0,!0)})),e||this.middleware.clean()}}var Ee=i(5102),Pe=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class Ze extends ye{constructor(e,t,i,s){super(e,t,"mentions-helper",(e=>{const t=e.dataset.peerId.toUserId();Promise.resolve(s.appUsersManager.getUser(t)).then((e=>{let t,s="";const n=(0,Ee.Z)(e);n[0]?s="@"+n[0]:(s=e.first_name||e.last_name,t={_:"messageEntityMentionName",length:s.length,offset:0,user_id:e.id}),s+=" ",i.insertAtCaret(s,t)}))})),this.managers=s}checkQuery(e,t,i){const s=e.trim();if(e.length!==s.length)return!1;const n=this.controller.getMiddleware();return this.managers.appProfileManager.getMentions(t&&t.toChatId(),s,i).then((e=>Pe(this,void 0,void 0,(function*(){if(!n())return;e=e.filter((e=>e!==x.Z.myId));const t=e.map((e=>Pe(this,void 0,void 0,(function*(){const t=yield this.managers.appUsersManager.getUser(e),i=(0,Ee.Z)(t);return{peerId:e,description:i[0]?"@"+i[0]:void 0}}))));this.render((yield Promise.all(t)).filter(Boolean))})))),!0}}var Me=i(5494),Te=i(6339),ke=i(8594),xe=i(5592),Ae=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class _e extends Te.Z{constructor(e){super({element:document.createElement("div")}),this.onBodyTouchStart=e=>{const t=e.touches[0].target;(0,R.Z)(t,this.element)||t===this.btnHover||((0,b.Z)(e),this.toggle(!1))},(0,W.Z)(this,e),this.element.classList.add(_e.BASE_CLASS),this.element.style.display="none",this.scrollable=new f.ZP,this.element.append(this.scrollable.container),this.attachButtonListener(this.btnHover,this.listenerSetter),this.listenerSetter.add(x.Z)("history_reply_markup",(({peerId:e})=>Ae(this,void 0,void 0,(function*(){this.peerId===e&&(this.checkAvailability()&&this.isActive()&&(yield this.render()),(0,ke.e9)().then((()=>{this.checkForceReply()})))}))))}init(){return this.appendTo.append(this.element),this.listenerSetter.add(this)("open",(()=>Ae(this,void 0,void 0,(function*(){yield this.render(),o.Z&&(this.touchListener=this.listenerSetter.add(document.body)("touchstart",this.onBodyTouchStart,{passive:!1,capture:!0}),this.listenerSetter.add(this)("close",(()=>{this.listenerSetter.remove(this.touchListener)}),{once:!0}))})))),(0,S.fc)(this.element,(e=>{const t=(0,B.Z)(e.target,"btn");if(!t)return;const i=t.dataset.type,{peerId:s}=this;"keyboardButtonRequestPhone"===i?(0,xe.Z)({titleLangKey:"ShareYouPhoneNumberTitle",button:{langKey:"OK"},descriptionLangKey:"AreYouSureShareMyContactInfoBot"}).then((()=>{this.managers.appMessagesManager.sendContact(s,x.Z.myId)})):this.managers.appMessagesManager.sendText(s,t.dataset.text),this.toggle(!1)}),{listenerSetter:this.listenerSetter}),super.init()}checkForceReply(){return Ae(this,void 0,void 0,(function*(){const e=yield this.getReplyMarkup();"replyKeyboardForceReply"!==e._||e.pFlags.hidden||e.pFlags.used||(e.pFlags.used=!0,this.chatInput.initMessageReply(e.mid))}))}getReplyMarkup(){var e;return Ae(this,void 0,void 0,(function*(){return null!==(e=(yield this.managers.appMessagesManager.getHistoryStorageTransferable(this.peerId)).replyMarkup)&&void 0!==e?e:{_:"replyKeyboardHide",pFlags:{}}}))}render(e){return Ae(this,void 0,void 0,(function*(){void 0===e&&(e=yield this.getReplyMarkup()),this.scrollable.container.replaceChildren();for(const t of e.rows){const e=document.createElement("div");e.classList.add(_e.BASE_CLASS+"-row");for(const i of t.buttons){const t=document.createElement("button");t.classList.add(_e.BASE_CLASS+"-button","btn"),(0,me.Z)(t,(0,ge.Z)(i.text)),t.dataset.text=i.text,t.dataset.type=i._,e.append(t)}this.scrollable.container.append(e)}}))}checkAvailability(e){var t;return Ae(this,void 0,void 0,(function*(){void 0===e&&(e=yield this.getReplyMarkup());const i="replyKeyboardHide"===e._||!(null===(t=e.rows)||void 0===t?void 0:t.length);return this.btnHover.classList.toggle("hide",i),i&&this.toggle(!1),!i}))}setPeer(e){this.peerId=e,this.checkAvailability(),this.checkForceReply()}}_e.BASE_CLASS="reply-keyboard";var Fe=i(5701),De=i(8938),Re=i(1080),Be=i(8678),Ne=i(2830),Oe=i(5400),Ue=i(515),He=i(2312),ze=i(9492);const je="INLINE-HELPER";class Ge extends q{constructor(e,t,i,s){super({appendTo:e,controller:t,listType:"xy",waitForKey:["ArrowUp","ArrowDown"],onSelect:e=>{if(!e)return!1;const{peerId:t,botId:i,queryId:s}=this.list.dataset;return this.chat.input.getReadyToSend((()=>{const n=(0,Ue.Z)(s,e.dataset.resultId);this.managers.appInlineBotsManager.sendInlineResult(t.toPeerId(),i,n,Object.assign(Object.assign({},this.chat.getMessageSendingParams()),{clearDraft:!0})),this.chat.input.onMessageSent(!0,!0)}))}}),this.chat=i,this.managers=s,this._checkQuery=(e,t,i,s)=>{return n=this,a=void 0,r=function*(){const n=this.controller.getMiddleware(),a=yield this.managers.appUsersManager.resolveUsername(t);if(!n())throw"PEER_CHANGED";if("user"!==a._||!a.pFlags.bot)throw"NOT_A_BOT";if(!s){if(!n())throw"PEER_CHANGED";throw this.init&&(this.init(),this.init=null),this.container.classList.add("cant-send"),this.toggle(!1),"NO_INLINES"}const o=this.managers.appInlineBotsManager.getInlineResults(e,a.id,i).then((t=>{if(!n())throw"PEER_CHANGED";this.init&&(this.init(),this.init=null);const i=this.list.cloneNode();i.dataset.peerId=""+e,i.dataset.botId=""+a.id,i.dataset.queryId=""+t.query_id;const s=new Re.Z(null,je,this.scrollable,!1);this.lazyLoadQueue.clear(),this.superStickerRenderer.clear();const o=[],r=!!t.pFlags.gallery;for(const e of t.results){const t=document.createElement("div");t.classList.add("inline-helper-result"),t.dataset.resultId=e.id;const a=r?void 0:document.createElement("div");if(a&&(a.classList.add("inline-helper-result-preview"),t.append(a)),i.append(t),r)t.classList.add("grid-item");else{a.classList.add("empty"),(0,me.Z)(a,(0,ge.Z)([...e.title.trim()][0]));const s=document.createElement("div");s.classList.add("inline-helper-result-title"),(0,me.Z)(s,(0,ge.Z)(e.title));const n=document.createElement("div");n.classList.add("inline-helper-result-description"),(0,me.Z)(n,(0,Oe.ZP)(e.description,{noCommands:!0,noLinks:!0})),t.append(s,n);const o=document.createElement("div");o.classList.add("inline-helper-separator"),i.append(o)}if("botInlineResult"===e._){if(e.thumb&&0===e.thumb.mime_type.indexOf("image/")){let i;a?(i=document.createElement("div"),a.append(i)):i=t,i.classList.add("media-container"),r&&i.classList.add("no-border-radius"),this.lazyLoadQueue.push({div:t,load:()=>He.Z.download({dcId:4,location:{_:"inputWebFileLocation",access_hash:e.thumb.access_hash,url:e.thumb.url},size:e.thumb.size,mimeType:e.thumb.mime_type}).then((e=>{const t=new Image;t.classList.add("media-photo"),(0,Be.Z)(e).then((e=>{(0,Ne.Z)(i,t,e,!0)}))}))})}}else{const i=e.document||e.photo;if(["sticker","gif"].includes(null==i?void 0:i.type)&&r)(0,De.Z)(i),"gif"===i.type?s.add(i,t):"sticker"===i.type&&(t.classList.add("super-sticker"),this.superStickerRenderer.renderSticker(i,t,o),i.animated&&this.superStickerRenderer.observeAnimated(t));else if(i){const e=r?48:void 0;r&&t.classList.add("no-border-radius"),(0,ze.Z)({photo:i,container:r?t:a,boxWidth:e,boxHeight:e,middleware:n,lazyLoadQueue:this.lazyLoadQueue,loadPromises:o})}}}return Promise.all(o).then((()=>{var o;if(!n())return void s.clear();i.classList.toggle("is-gallery",r),i.classList.toggle("super-stickers",r),this.container.classList.toggle("is-gallery",r);const d=this.list.parentElement;if(d.textContent="",t.switch_pm){const i=(0,J.Z)("btn-primary btn-secondary btn-primary-transparent primary");(0,me.Z)(i,(0,ge.Z)(t.switch_pm.text)),(0,S.fc)(i,(i=>{this.chat.appImManager.setInnerPeer({peerId:e}),this.managers.appInlineBotsManager.switchToPM(e,a.id,t.switch_pm.start_param)})),d.append(i)}d.append(this.list=i),this.container.classList.remove("cant-send"),null===(o=this.gifsMasonry)||void 0===o||o.detach(),this.gifsMasonry=s,s.attach(),this.onChangeScreen||(this.onChangeScreen=()=>{if(this.list.classList.contains("is-gallery")){const e=this.list.childElementCount*T.Z.active.popupSticker.width+(this.list.childElementCount-1);this.list.style.width=e+"px"}else this.list.style.width=""},T.Z.addEventListener("changeScreen",this.onChangeScreen)),this.onChangeScreen(),this.toggle(!t.results.length&&!t.switch_pm),this.scrollable.scrollTop=0}))}));return{user:a,renderPromise:o}},new((o=void 0)||(o=Promise))((function(e,t){function i(e){try{d(r.next(e))}catch(e){t(e)}}function s(e){try{d(r.throw(e))}catch(e){t(e)}}function d(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(i,s)}d((r=r.apply(n,a||[])).next())}));var n,a,o,r},this.container.classList.add("inline-helper"),this.addEventListener("visible",(()=>{setTimeout((()=>{this.scrollable.container.scrollTop=0}),0)})),this.checkQuery=(0,Fe.Z)(this._checkQuery,200,!0,!0),this.addEventListener("hidden",(()=>{this.onChangeScreen&&(T.Z.removeEventListener("changeScreen",this.onChangeScreen),this.onChangeScreen=void 0)}))}init(){this.list=document.createElement("div"),this.list.classList.add("inline-helper-results"),this.container.append(this.list),this.scrollable=new f.ZP(this.container),this.lazyLoadQueue=new _.Z,this.superStickerRenderer=new A.vT(this.lazyLoadQueue,je,this.managers);const e=(0,g.ag)(Bt.send_inline);e.classList.add("inline-helper-cant-send"),this.container.append(e)}}var Ve=i(279),Ke=i(3035),We=i(5128),$e=i(8090),qe=i(8127),Ye=i(3013),Qe=i(1507),Xe=i(5133),Je=i(1656),et=i(6654);class tt extends ye{constructor(e,t,i){super(e,void 0,"bot-commands",(e=>{const i=e.querySelector(`.${ye.BASE_CLASS_LIST_ELEMENT}-name`).innerHTML;return t.getReadyToSend((()=>{t.messageInput.innerHTML=i,t.sendMessage(!0),this.toggle(!0)}))})),this.managers=i}setUserId(e,t){var i;if(this.userId!==e||!(null===(i=this.list)||void 0===i?void 0:i.childElementCount))return this.userId=e,(0,et.Z)(this.managers.appProfileManager.getProfile(e),(i=>{if(!t())return;const s=Se(e.toPeerId(!1),i),n=50*s.length+8+24;this.container.style.setProperty("--height",n+"px"),this.render(s)}));this.toggle(!1)}}var it=i(8479),st=i(5157),nt=(i(1544),i(7197)),at=i(6241),ot=i(6535),rt=i(2821),dt=i(3066),lt=i(496),ct=i(2790),ht=i(3416),ut=i(671);function pt(e){return t=this,i=void 0,n=function*(){return{cached:e.cached,result:e.cached?yield e.result:e.result}},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n}function ft(e){return e.then(pt)}var mt=i(1655),gt=i(2946),vt=i(177),bt=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class yt{constructor(e,t,i){this.managers=e,this.onReady=t,this.onChange=i,this.middleware=(0,Le.k)(),this.listenerSetter=new M.Z,this.construct()}construct(){this.container=document.createElement("div"),this.container.classList.add("new-message-send-as-container"),this.closeBtn=document.createElement("div"),this.closeBtn.classList.add("new-message-send-as-close","new-message-send-as-avatar","tgico-close");const e=[{text:"SendMessageAsTitle",onClick:void 0}];let t;this.buttons=[];const i=e=>{e&&(t=this.avatar);const i=this.avatar!==t,s=!e&&i?2:0;(0,K.Z)({element:this.closeBtn,className:"is-visible",forwards:e,duration:300,useRafs:s}),i||(0,K.Z)({element:t,className:"is-visible",forwards:!e,duration:300,useRafs:s})};(0,X.Z)({buttonOptions:{noRipple:!0},listenerSetter:this.listenerSetter,container:this.container,direction:"top-right",buttons:e,onOpenBefore:()=>{i(!0)},onOpen:(t,i)=>{e[0].element.classList.add("btn-menu-item-header"),this.btnMenu=i,this.btnMenu.classList.add("scrollable","scrollable-y"),this.btnMenu.append(...this.buttons.map((e=>e.element)))},onClose:()=>{i(!1)},onCloseAfter:()=>{this.btnMenu=void 0}}),this.container.append(this.closeBtn)}updateButtons(e){var t;return bt(this,void 0,void 0,(function*(){const i=e.map(((e,t)=>bt(this,void 0,void 0,(function*(){const i=document.createElement("div"),s=document.createElement("div");return s.classList.add("btn-menu-item-subtitle"),e.isUser()?s.append((0,g.ag)("Chat.SendAs.PersonalAccount")):e===this.peerId?s.append((0,g.ag)("VoiceChat.DiscussionGroup")):s.append(yield(0,vt.Z)(e.toChatId())),i.append(new be.Z({peerId:e}).element,s),{onClick:t?()=>bt(this,void 0,void 0,(function*(){const t=this.peerId;this.changeSendAsPeerId(e);const i=this.middleware.get(),s=()=>{if(this.sendAsPeerId!==e||!i())return;const t=this.sendAsPeerIds.slice();(0,mt.Z)(t,e),t.unshift(e),this.updateButtons(t)};$.Z.isAvailable("animations")?setTimeout(s,250):s(),this.managers.appMessagesManager.saveDefaultSendAs(t,e)})):void 0,textElement:i}})))),s=yield Promise.all(i);(0,d.b)({buttons:s}),s.forEach(((t,i)=>{const s=e[i],n=new ve.Z;n.classList.add("avatar-26","btn-menu-item-icon"),n.updateWithOptions({peerId:s}),i||n.classList.add("active"),t.element.prepend(n)})),this.buttons=s,null===(t=this.btnMenu)||void 0===t||t.append(...this.buttons.map((e=>e.element)))}))}updateAvatar(e,t){return bt(this,void 0,void 0,(function*(){const i=this.avatar;if(i&&i.peerId===e)return;i||(t=!0);const s=t?0:2,n=t?0:300,a=this.avatar=new ve.Z;a.classList.add("new-message-send-as-avatar","avatar-30"),yield a.updateWithOptions({isDialog:!1,peerId:e}),(0,K.Z)({element:a,className:"is-visible",forwards:!0,duration:n,useRafs:s}),i&&(0,K.Z)({element:i,className:"is-visible",forwards:!1,duration:n,onTransitionEnd:()=>{i.remove()},useRafs:s}),this.container.append(a)}))}changeSendAsPeerId(e,t){return this.sendAsPeerId=e,this.onChange(e),this.updateAvatar(e,t)}getDefaultSendAs(){return this.managers.acknowledged.appProfileManager.getChannelFull(this.peerId.toChatId()).then((e=>({cached:e.cached,result:e.result.then((e=>e.default_send_as?(0,gt.Z)(e.default_send_as):void 0))})))}updateManual(e){return bt(this,void 0,void 0,(function*(){const t=this.peerId;if(this.updatingPromise||!(yield this.managers.appPeersManager.isChannel(t)))return;const i=this.middleware.get((()=>!this.updatingPromise||this.updatingPromise===d)),{container:s}=this,n=t.toChatId(),a=(yield ft(this.getDefaultSendAs())).result,o=e;a instanceof Promise&&(e=void 0);const r=o&&!e,d=this.updatingPromise=(0,et.Z)(a,(t=>bt(this,void 0,void 0,(function*(){if(!i()||void 0===t)return;if(yield this.changeSendAsPeerId(t,e),!i())return;this.managers.appChatsManager.getSendAs(n).then((e=>{if(!i())return;const s=e.filter((e=>!e.pFlags.premium_required)).map((e=>e.peer)).map((e=>(0,gt.Z)(e)));this.sendAsPeerIds=s.slice(),(0,mt.Z)(s,t),s.unshift(t),this.updateButtons(s)}));const a=()=>{this.onReady(s,e),this.addedListener||(this.listenerSetter.add(x.Z)("peer_full_update",(e=>{this.peerId===e&&this.update()})),this.addedListener=!0)};if(!r)return a;a()}))));return d.finally((()=>{this.updatingPromise===d&&(this.updatingPromise=void 0)})),r?void 0:d}))}update(e){return this.updateManual(e).then((e=>null==e?void 0:e()))}setPeerId(e){this.middleware.clean(),this.updatingPromise=void 0,this.peerId=e}destroy(){this.container.remove(),this.setPeerId(),this.listenerSetter.removeAll()}}var wt=i(2353),St=i(9496),Ct=i(13),Lt=i(9298),It=i(7362),Et=i(6700),Pt=i(7545),Zt=i(669),Mt=i(6034),Tt=i(1452),kt=i(8794),xt=i(1439),At=i(7625),_t=i(2423),Ft=i(1174),Dt=i(554),Rt=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const Bt={send_voices:"GlobalAttachVoiceRestricted",send_stickers:"GlobalAttachStickersRestricted",send_gifs:"GlobalAttachGifRestricted",send_media:"GlobalAttachMediaRestricted",send_plain:"GlobalSendMessageRestricted",send_polls:"ErrorSendRestrictedPollsAll",send_inline:"GlobalAttachInlineRestricted"};class Nt{constructor(e,t,i){this.chat=e,this.appImManager=t,this.managers=i,this.lastUrl="",this.lastTimeType=0,this.replyElements={},this.willSendWebPage=null,this.recording=!1,this.recordCanceled=!1,this.recordStartTime=0,this.lockRedo=!1,this.canRedoFromHTML="",this.undoHistory=[],this.executedHistory=[],this.canUndoFromHTML="",this.onCancelRecordClick=e=>{e&&(0,b.Z)(e),this.recordCanceled=!0,this.recorder.stop(),r.Z.setKeepAlive(!1)},this.onEmoticonsOpen=()=>{const e=o.Z?"flip-icon":"active";this.btnToggleEmoticons.classList.toggle(e,!0)},this.onEmoticonsClose=()=>{const e=o.Z?"flip-icon":"active";this.btnToggleEmoticons.classList.toggle(e,!1)},this.scheduleSending=(e=this.sendMessage.bind(this,!0),t=new Date)=>Rt(this,void 0,void 0,(function*(){const{peerId:i}=this.chat,s=this.chat.bubbles.getMiddleware(),n=x.Z.myId!==i&&i.isUser()&&(yield this.managers.appUsersManager.isUserOnlineVisible(i));c.Z.createPopup(ne,t,(t=>{s()&&(t<=10+(Date.now()/1e3|0)&&(t=void 0),this.scheduleDate=t,e(),"scheduled"!==this.chat.type&&t&&setTimeout((()=>{s()&&(c.Z.getPopups(Lt.Z).forEach((e=>e.hide())),this.appImManager.openScheduled(i))}),0))}),n).show()})),this.prepareDocumentExecute=()=>(this.executedHistory.push(this.messageInput.innerHTML),()=>this.canUndoFromHTML=this.messageInput.innerHTML),this.undoRedo=(e,t,i)=>{(0,b.Z)(e);let s=this.messageInput.innerHTML;if(s&&s!==i){this.lockRedo=!0;let e=0;do{document.execCommand(t,!1,null);const i=this.messageInput.innerHTML;if(s===i){if(++e>2)break}else e=0;s=i}while(s!==i);this.lockRedo=!1}},this.handleMarkdownShortcut=e=>{const t={KeyB:"bold",KeyI:"italic",KeyU:"underline",KeyS:"strikethrough",KeyM:"monospace",KeyP:"spoiler"};this.appImManager.markupTooltip&&(t.KeyK="link");const i=e.code,s=t[i],n=document.getSelection();if(!(0,Tt.Z)(n)&&s&&("KeyK"===i?this.appImManager.markupTooltip.showLinkEditor():this.applyMarkdown(s),(0,b.Z)(e)),"KeyZ"===i){let t=this.messageInput.innerHTML;e.shiftKey?this.undoHistory.length&&(this.executedHistory.push(t),t=this.undoHistory.pop(),this.undoRedo(e,"redo",t),t=this.messageInput.innerHTML,this.canRedoFromHTML=this.undoHistory.length?t:"",this.canUndoFromHTML=t):!this.executedHistory.length||this.canUndoFromHTML&&t!==this.canUndoFromHTML||(this.undoHistory.push(t),t=this.executedHistory.pop(),this.undoRedo(e,"undo",t),this.canUndoFromHTML=this.canRedoFromHTML=this.messageInput.innerHTML)}},this.onMessageInput=e=>{var t,i,s;const{value:n,entities:a,caretPos:o}=(0,C.Z)(this.messageInputField.input),r=(0,rt.Z)(n,a,!0),d=(0,at.Z)(a,(0,ot.Z)(r));this.canRedoFromHTML&&!this.lockRedo&&this.messageInput.innerHTML!==this.canRedoFromHTML&&(this.canRedoFromHTML="",this.undoHistory.length=0);const l=(!(null===(t=this.editMessage)||void 0===t?void 0:t.media)||"messageMediaWebPage"===this.editMessage.media._)&&d.filter((e=>"messageEntityUrl"===e._||"messageEntityTextUrl"===e._));if(l.length)for(const e of l){let t;if("messageEntityTextUrl"===e._)t=e.url;else if(t=n.slice(e.offset,e.offset+e.length),!t.includes("http://")&&!t.includes("https://"))continue;if(this.lastUrl!==t){this.lastUrl=t;const e=this.getWebPagePromise=Promise.all([this.managers.appWebPagesManager.getWebPage(t),this.chat.canSend("embed_links")]).then((([i,s])=>{this.getWebPagePromise===e&&(this.getWebPagePromise=void 0),this.lastUrl===t&&("webPage"===(null==i?void 0:i._)&&s?(this.setTopInfo("webpage",(()=>{}),i.site_name||i.title||"Webpage",i.description||i.url||""),delete this.noWebPage,this.willSendWebPage=i):this.willSendWebPage&&this.onHelperCancel())}))}break}else this.lastUrl&&(this.lastUrl="",delete this.noWebPage,this.willSendWebPage=null,this.helperType?this.helperFunc():this.clearHelper());if(n.trim()){const t=Date.now();t-this.lastTimeType>=6e3&&(null==e?void 0:e.isTrusted)&&(this.lastTimeType=t,this.managers.appMessagesManager.setTyping(this.chat.peerId,{_:"sendMessageTypingAction"},void 0,this.chat.threadId)),null===(s=this.botCommands)||void 0===s||s.toggle(!0)}else this.lastTimeType&&this.managers.appMessagesManager.setTyping(this.chat.peerId,{_:"sendMessageCancelAction"},void 0,this.chat.threadId),null===(i=this.appImManager.markupTooltip)||void 0===i||i.hide(),document.activeElement!==this.messageInput||G.IS_MOBILE||setTimeout((()=>{document.activeElement===this.messageInput&&(this.messageInput.textContent="1",(0,ue.Z)(this.messageInput),this.messageInput.textContent="")}),0);this.botCommands&&this.updateBotCommandsToggle(),this.editMsgId||this.saveDraftDebounced(),this.checkAutocomplete(n,o,d),this.updateSendBtn()},this.onEmojiSelected=(e,t)=>{const i=e.docId?{_:"messageEntityCustomEmoji",document_id:e.docId,length:e.emoji.length,offset:0}:(0,nt.Z)(e.emoji);this.insertAtCaret(e.emoji,i,t)},this.onBtnSendClick=e=>Rt(this,void 0,void 0,(function*(){if((0,b.Z)(e),!this.recorder||this.recording||!this.isInputEmpty()||this.forwarding||this.editMsgId)this.recording?Date.now()-this.recordStartTime<500?this.onCancelRecordClick():this.recorder.stop():this.sendMessage();else{const e=this.chat.peerId.isAnyChat(),t="send_voices";if(e&&!(yield this.chat.canSend(t)))return void(0,Z.bC)({langPackKey:Bt[t]});this.chatInput.classList.add("is-locked"),(0,le.Z)();let i=!1;if(!e){const e=yield this.managers.appProfileManager.getProfile(this.chat.peerId.toUserId());(null==e?void 0:e.pFlags.voice_messages_forbidden)&&((0,Z.bC)({langPackKey:"Chat.SendVoice.PrivacyError",langPackArguments:[yield(0,It.Z)({peerId:this.chat.peerId})]}),i=!0)}if(i)return void this.chatInput.classList.remove("is-locked");this.recorder.start().then((()=>{this.releaseMediaPlayback=Ye.Z.setSingleMedia(),this.recordCanceled=!1,this.setRecording(!0),r.Z.setKeepAlive(!0);const e=()=>{c.Z.createPopup(qe.Z,"popup-cancel-record",{titleLangKey:"DiscardVoiceMessageTitle",descriptionLangKey:"DiscardVoiceMessageDescription",buttons:[{langKey:"DiscardVoiceMessageAction",callback:()=>{(0,S.tH)(this.btnCancelRecord)}},{langKey:"Continue",isCancel:!0}]}).show()};this.recordingOverlayListener=this.listenerSetter.add(document.body)("mousedown",(t=>{(0,B.Z)(t.target,"chat-input")||(0,B.Z)(t.target,"popup-cancel-record")||((0,b.Z)(t),e())}),{capture:!0,passive:!1}),V.Z.pushItem(this.recordingNavigationItem={type:"voice",onPop:()=>(setTimeout((()=>{e()}),0),!1)}),this.recordStartTime=Date.now();const t=this.recorder.sourceNode,i=t.context.createAnalyser();t.connect(i),i.fftSize=32;const s=new Uint8Array(i.frequencyBinCount),n=255*s.length,a=()=>{if(!this.recording)return;i.getByteFrequencyData(s);let e=0;s.forEach((t=>{e+=t}));const t=Math.min(1,e/n+.36);this.recordRippleEl.style.transform=`scale(${t})`;const o=Date.now()-this.recordStartTime,r=o%1e3,d=(0,st.Z)(o/1e3)+","+("00"+Math.round(r/10)).slice(-2);this.recordTimeEl.innerText=d,(0,Ke.T2)(a)};a()})).catch((e=>{switch(e.name){case"NotAllowedError":(0,Z.Am)("Please allow access to your microphone");break;case"NotReadableError":(0,Z.Am)(e.message);break;default:console.error("Recorder start error:",e,e.name,e.message),(0,Z.Am)(e.message)}this.setRecording(!1),this.chatInput.classList.remove("is-locked")}))}})),this.onHelperCancel=(e,t)=>Rt(this,void 0,void 0,(function*(){var i;if(e&&(0,b.Z)(e),this.willSendWebPage){const e=this.lastUrl;let t=!1;if(this.helperType&&(yield this.helperFunc(),t=!0),this.lastUrl=e,this.noWebPage=!0,this.willSendWebPage=null,t)return}if("edit"===this.helperType&&!t){const e=this.editMessage,t=this.getCurrentInputAsDraft(!0);t&&delete t.pFlags.no_webpage;const s=Object.assign(Object.assign({},e),{_:"draftMessage"});if(null===(i=s.entities)||void 0===i?void 0:i.length){const e=new Set(Object.values(_t.SC));s.entities=s.entities.slice(),(0,At.Z)(s.entities,((t,i,s)=>{e.has(t._)||s.splice(i,1)})),s.entities.length||delete s.entities}if(!(0,Mt.Z)(t,s))return void c.Z.createPopup(qe.Z,"discard-editing",{buttons:[{langKey:"Alert.Confirm.Discard",callback:()=>{this.onHelperCancel(void 0,!0)}}],descriptionLangKey:"Chat.Edit.Cancel.Text"}).show()}this.clearHelper(),this.updateSendBtn()})),this.onHelperClick=e=>{if((0,b.Z)(e),(0,B.Z)(e.target,"reply"))if("forward"===this.helperType){const{forwardElements:e}=this;e&&o.Z&&!e.container.classList.contains("active")&&ht.Z.openBtnMenu(e.container)}else"reply"===this.helperType?this.chat.setMessageId(this.replyToMsgId):"edit"===this.helperType&&this.chat.setMessageId(this.editMsgId)},this.listenerSetter=new M.Z}construct(){this.chatInput=document.createElement("div"),this.chatInput.classList.add("chat-input","hide"),this.inputContainer=document.createElement("div"),this.inputContainer.classList.add("chat-input-container"),this.rowsWrapperWrapper=document.createElement("div"),this.rowsWrapperWrapper.classList.add("rows-wrapper-wrapper"),this.rowsWrapper=document.createElement("div"),this.rowsWrapper.classList.add("rows-wrapper","chat-input-wrapper"),this.rowsWrapperWrapper.append(this.rowsWrapper);const e=(0,re.ZK)();this.rowsWrapper.append(e);const t=this.fakeRowsWrapper=document.createElement("div");t.classList.add("fake-wrapper","fake-rows-wrapper");const i=this.fakeSelectionWrapper=document.createElement("div");i.classList.add("fake-wrapper","fake-selection-wrapper"),this.inputContainer.append(this.rowsWrapperWrapper,t,i),this.chatInput.append(this.inputContainer),this.goDownBtn=(0,de.Z)({icon:"arrow_down",className:"bubbles-corner-button chat-secondary-button bubbles-go-down hide"}),this.inputContainer.append(this.goDownBtn),(0,S.fc)(this.goDownBtn,(e=>{(0,b.Z)(e),this.chat.bubbles.onGoDownClick()}),{listenerSetter:this.listenerSetter});const s=this.controlContainer=document.createElement("div");s.classList.add("chat-input-control","chat-input-wrapper"),this.inputContainer.append(s)}createButtonIcon(...e){const t=(0,Q.Z)(...e);return t.tabIndex=-1,t}constructPeerHelpers(){this.replyElements.container=document.createElement("div"),this.replyElements.container.classList.add("reply-wrapper"),this.replyElements.iconBtn=this.createButtonIcon(""),this.replyElements.cancelBtn=this.createButtonIcon("close reply-cancel",{noRipple:!0}),this.replyElements.container.append(this.replyElements.iconBtn,this.replyElements.cancelBtn);const e=()=>{s=!0},t=()=>{s=!1},i=this.forwardElements={};let s=!1;const n=[i.showSender={text:"Chat.Alert.Forward.Action.Show1",onClick:e,checkForClose:()=>this.canToggleHideAuthor(),checkboxField:new h.Z({checked:!0})},i.hideSender={text:"Chat.Alert.Forward.Action.Hide1",onClick:e,checkForClose:()=>this.canToggleHideAuthor(),checkboxField:new h.Z({checked:!1})},i.showCaption={text:"Chat.Alert.Forward.Action.ShowCaption",onClick:t,checkboxField:new h.Z({checked:!0})},i.hideCaption={text:"Chat.Alert.Forward.Action.HideCaption",onClick:t,checkboxField:new h.Z({checked:!1})},i.changePeer={text:"Chat.Alert.Forward.Action.Another",onClick:()=>{this.changeForwardRecipient()},icon:"replace"}],u=i.container=(0,d.b)({buttons:n,listenerSetter:this.listenerSetter}),p=Array.from(u.children);[{elements:p.slice(0,2),onChange:(e,t)=>{const n=!!+e;s&&(this.forwardWasDroppingAuthor=!n);const a=this.replyElements.container.querySelector(".reply-title");if(a){const e=a.firstElementChild,t=g.ZP.weakMap.get(e),s=i.showSender.checkboxField.checked?"Chat.Accessory.Forward":"Chat.Accessory.Hidden";t.key=s,t.update()}}},{elements:p.slice(2,4),onChange:e=>{const t=!!+e;let s;s=t&&void 0!==this.forwardWasDroppingAuthor?this.forwardWasDroppingAuthor?i.hideSender:i.showSender:t?i.showSender:i.hideSender,s.checkboxField.checked=!0}}].forEach((e=>{const t=(0,Xe.Z)(e.elements.map((e=>({container:e,input:e.querySelector("input")}))),e.onChange),i=document.createElement("hr");t.append(i),u.append(t)})),u.append(i.changePeer.element),o.Z||(this.forwardHover=new Te.Z({element:u})),i.modifyArgs=n.slice(0,-1),this.replyElements.container.append(u),i.modifyArgs.forEach(((e,t)=>{const{input:i}=e.checkboxField;i.type="radio",i.name=t<2?"author":"caption",i.value=""+ +!(t%2)})),this.newMessageWrapper=document.createElement("div"),this.newMessageWrapper.classList.add("new-message-wrapper"),this.replyInTopicOverlay=document.createElement("div"),this.replyInTopicOverlay.classList.add("reply-in-topic-overlay","hide"),this.replyInTopicOverlay.append((0,g.ag)("Chat.Input.ReplyToAnswer")),this.btnToggleEmoticons=this.createButtonIcon("none toggle-emoticons",{noRipple:!0}),this.inputMessageContainer=document.createElement("div"),this.inputMessageContainer.classList.add("input-message-container"),this.goDownUnreadBadge=document.createElement("span"),this.goDownUnreadBadge.classList.add("badge","badge-24","badge-primary"),this.goDownBtn.append(this.goDownUnreadBadge),this.goMentionBtn=(0,de.Z)({icon:"mention",className:"bubbles-corner-button chat-secondary-button bubbles-go-mention"}),this.goMentionUnreadBadge=document.createElement("span"),this.goMentionUnreadBadge.classList.add("badge","badge-24","badge-primary"),this.goMentionBtn.append(this.goMentionUnreadBadge),this.inputContainer.append(this.goMentionBtn),(0,S.fc)(this.goMentionBtn,(e=>{(0,b.Z)(e);const t=this.chat.bubbles.getMiddleware();this.managers.appMessagesManager.goToNextMention(this.chat.peerId,this.chat.threadId).then((e=>{t()&&e&&this.chat.setMessageId(e)}))}),{listenerSetter:this.listenerSetter}),this.btnScheduled=this.createButtonIcon("scheduled btn-scheduled float hide",{noRipple:!0}),(0,S.fc)(this.btnScheduled,(e=>{this.appImManager.openScheduled(this.chat.peerId)}),{listenerSetter:this.listenerSetter}),this.listenerSetter.add(x.Z)("scheduled_new",(({peerId:e})=>{this.chat.peerId===e&&this.btnScheduled.classList.remove("hide")})),this.listenerSetter.add(x.Z)("scheduled_delete",(({peerId:e})=>{this.chat.peerId===e&&this.managers.appMessagesManager.getScheduledMessages(this.chat.peerId).then((e=>{this.btnScheduled.classList.toggle("hide",!e.length)}))})),this.btnToggleReplyMarkup=this.createButtonIcon("botcom toggle-reply-markup float hide",{noRipple:!0}),this.replyKeyboard=new _e({appendTo:this.rowsWrapper,listenerSetter:this.listenerSetter,managers:this.managers,btnHover:this.btnToggleReplyMarkup,chatInput:this}),this.listenerSetter.add(this.replyKeyboard)("open",(()=>this.btnToggleReplyMarkup.classList.add("active"))),this.listenerSetter.add(this.replyKeyboard)("close",(()=>this.btnToggleReplyMarkup.classList.remove("active"))),this.botCommands=new tt(this.rowsWrapper,this,this.managers),this.botCommandsToggle=document.createElement("div"),this.botCommandsToggle.classList.add("new-message-bot-commands");const f=document.createElement("div");f.classList.add("new-message-bot-commands-icon-scale");const v=this.botCommandsIcon=document.createElement("div");v.classList.add("animated-menu-icon","animated-menu-close-icon"),f.append(v),this.botCommandsToggle.append(f),(0,S.fc)(this.botCommandsToggle,(e=>{(0,b.Z)(e),v.classList.contains("state-back")?(this.botCommands.toggle(!0),v.classList.remove("state-back")):(this.botCommands.setUserId(this.chat.peerId.toUserId(),this.chat.bubbles.getMiddleware()),v.classList.add("state-back"))}),{listenerSetter:this.listenerSetter}),this.botCommands.addEventListener("visible",(()=>{v.classList.add("state-back")})),this.botCommands.addEventListener("hiding",(()=>{v.classList.remove("state-back")}));const y=(e,t)=>{this.fileInput.value="";const i=[...e?Ft.Z:[],...t?Dt.Z:[]].join(", ");this.fileInput.setAttribute("accept",i),this.willAttachType="media",this.fileInput.click()};this.attachMenuButtons=[{icon:"image",text:"Chat.Input.Attach.PhotoOrVideo",onClick:()=>y(!0,!0)},{icon:"document",text:"Chat.Input.Attach.Document",onClick:()=>{this.fileInput.value="",this.fileInput.removeAttribute("accept"),this.willAttachType="document",this.fileInput.click()}},{icon:"gift",text:"GiftPremium",onClick:()=>this.chat.appImManager.giftPremium(this.chat.peerId),verify:()=>this.chat.canGiftPremium()},{icon:"poll",text:"Poll",onClick:()=>Rt(this,void 0,void 0,(function*(){const e="send_polls";(yield this.chat.canSend(e))?c.Z.createPopup(I,this.chat).show():(0,Z.bC)({langPackKey:Bt[e]})})),verify:()=>this.chat.peerId.isAnyChat()||this.chat.isBot}],this.managers.appAttachMenuBotsManager.getAttachMenuBots();const w=this.attachMenuButtons.slice();this.attachMenu=(0,X.Z)({buttonOptions:{noRipple:!0},listenerSetter:this.listenerSetter,direction:"top-left",buttons:this.attachMenuButtons,onOpenBefore:()=>Rt(this,void 0,void 0,(function*(){const e=yield this.managers.appAttachMenuBotsManager.getAttachMenuBots(),t=w.slice(),i=e.filter((e=>!e.pFlags.inactive)).map((e=>{const t=(0,kt.Z)(e);return{regularText:(0,ge.Z)(e.short_name),onClick:()=>{this.managers.appAttachMenuBotsManager.requestWebView(Object.assign({botId:e.bot_id,peerId:this.chat.peerId},this.chat.getMessageSendingParams())).then((t=>{const i=["allow-scripts","allow-same-origin","allow-popups","allow-forms","allow-modals","allow-storage-access-by-user-activation"].join(" ");class s extends c.Z{constructor(t){super("popup-payment popup-payment-verification",{closable:!0,overlayClosable:!0,body:!0,titleRaw:e.short_name}),this.url=t,this.d()}destroy(){return this.telegramWebView.destroy(),super.destroy()}d(){const e=this.telegramWebView=new xt.Z({url:this.url,sandbox:i});e.iframe.classList.add("payment-verification"),this.body.append(e.iframe),this.show(),e.onMount()}}new s(t.url)}))},iconDoc:null==t?void 0:t.icon,verify:()=>Rt(this,void 0,void 0,(function*(){let t=!1;const i={attachMenuPeerTypeSameBotPM:()=>this.chat.peerId.toUserId()===e.bot_id,attachMenuPeerTypeBotPM:()=>this.chat.isBot,attachMenuPeerTypePM:()=>this.chat.peerId.isUser(),attachMenuPeerTypeChat:()=>this.chat.isAnyGroup,attachMenuPeerTypeBroadcast:()=>this.chat.isBroadcast};for(const s of e.peer_types){const e=i[s._];if(t=yield e(),t)break}return t}))}}));t.splice(t.length,0,...i),this.attachMenuButtons.splice(0,this.attachMenuButtons.length,...t)}))}),this.attachMenu.classList.add("attach-file","tgico-attach"),this.attachMenu.classList.remove("tgico-more"),this.recordTimeEl=document.createElement("div"),this.recordTimeEl.classList.add("record-time"),this.fileInput=document.createElement("input"),this.fileInput.type="file",this.fileInput.multiple=!0,this.fileInput.style.display="none",this.newMessageWrapper.append(...[this.botCommandsToggle,this.btnToggleEmoticons,this.inputMessageContainer,this.btnScheduled,this.btnToggleReplyMarkup,this.attachMenu,this.recordTimeEl,this.fileInput].filter(Boolean)),this.rowsWrapper.append(this.replyElements.container),this.autocompleteHelperController=new Ie,this.stickersHelper=new Y(this.rowsWrapper,this.autocompleteHelperController,this.chat,this.managers),this.emojiHelper=new fe(this.rowsWrapper,this.autocompleteHelperController,this,this.managers),this.commandsHelper=new Ce(this.rowsWrapper,this.autocompleteHelperController,this,this.managers),this.mentionsHelper=new Ze(this.rowsWrapper,this.autocompleteHelperController,this,this.managers),this.inlineHelper=new Ge(this.rowsWrapper,this.autocompleteHelperController,this.chat,this.managers),this.rowsWrapper.append(this.newMessageWrapper),this.btnCancelRecord=this.createButtonIcon("binfilled btn-circle btn-record-cancel chat-secondary-button"),this.btnSendContainer=document.createElement("div"),this.btnSendContainer.classList.add("btn-send-container"),this.recordRippleEl=document.createElement("div"),this.recordRippleEl.classList.add("record-ripple"),this.btnSend=this.createButtonIcon("none btn-circle btn-send animated-button-icon"),this.btnSend.insertAdjacentHTML("afterbegin",'\n \n \n \n \n '),this.btnSendContainer.append(this.recordRippleEl,this.btnSend),this.sendMenu=new m.Z({onSilentClick:()=>{this.sendSilent=!0,this.sendMessage()},onScheduleClick:()=>{this.scheduleSending(void 0)},listenerSetter:this.listenerSetter,openSide:"top-left",onContextElement:this.btnSend,onOpen:()=>!("scheduled"===this.chat.type||this.isInputEmpty()&&!Object.keys(this.forwarding).length)}),this.btnSendContainer.append(this.sendMenu.sendMenu),this.inputContainer.append(this.btnCancelRecord,this.btnSendContainer),l.ZP.attachButtonListener(this.btnToggleEmoticons,this.listenerSetter),this.listenerSetter.add(l.ZP)("open",this.onEmoticonsOpen),this.listenerSetter.add(l.ZP)("close",this.onEmoticonsClose),this.attachMessageInputField(),this.listenerSetter.add(x.Z)("settings_updated",(()=>{var e;(this.stickersHelper||this.emojiHelper)&&(this.previousQuery="",this.checkAutocomplete()),null===(e=this.messageInputField)||void 0===e||e.onFakeInput()})),this.listenerSetter.add(x.Z)("draft_updated",(({peerId:e,threadId:t,draft:i,force:s})=>{this.chat.threadId===t&&this.chat.peerId===e&&"scheduled"!==this.chat.type&&this.setDraft(i,!0,s)})),this.listenerSetter.add(this.appImManager)("peer_changing",(e=>{this.chat!==e||"chat"!==this.chat.type&&"discussion"!==this.chat.type||this.saveDraft()})),this.listenerSetter.add(this.appImManager)("chat_changing",(({from:e,to:t})=>{this.chat===e?this.autocompleteHelperController.toggleListNavigation(!1):this.chat===t&&this.autocompleteHelperController.toggleListNavigation(!0)})),this.listenerSetter.add(x.Z)("scheduled_delete",(({peerId:e,mids:t})=>{"scheduled"===this.chat.type&&this.chat.peerId===e&&t.includes(this.editMsgId)&&this.onMessageSent()})),this.listenerSetter.add(x.Z)("history_delete",(({peerId:e,msgs:t})=>{this.chat.peerId===e&&"scheduled"!==this.chat.type&&(t.has(this.editMsgId)&&this.onMessageSent(),this.replyToMsgId&&t.has(this.replyToMsgId)&&this.clearHelper("reply"))})),this.listenerSetter.add(x.Z)("dialogs_multiupdate",(e=>{!e.has(this.chat.peerId)||"chat"!==this.chat.type&&"discussion"!==this.chat.type||(this.startParam===Qe.gZ?this.setStartParam():this.center(!0))}));try{this.recorder=new(a())({encoderSampleRate:48e3,monitorGain:0,numberOfChannels:1,recordingGain:1,reuseWorker:!0})}catch(e){console.error("Recorder constructor error:",e)}this.updateSendBtn(),this.listenerSetter.add(this.fileInput)("change",(e=>{const t=e.target.files;t.length&&(c.Z.createPopup(P.Z,this.chat,Array.from(t).slice(),this.willAttachType),this.fileInput.value="")}),!1),(0,S.fc)(this.btnSend,this.onBtnSendClick,{listenerSetter:this.listenerSetter,touchMouseDown:!0}),this.recorder&&((0,S.fc)(this.btnCancelRecord,this.onCancelRecordClick,{listenerSetter:this.listenerSetter}),this.recorder.onstop=()=>{this.setRecording(!1),this.chatInput.classList.remove("is-locked"),this.recordRippleEl.style.transform=""},this.recorder.ondataavailable=e=>{if(this.releaseMediaPlayback&&(this.releaseMediaPlayback(),this.releaseMediaPlayback=void 0),this.recordingOverlayListener&&(this.listenerSetter.remove(this.recordingOverlayListener),this.recordingOverlayListener=void 0),this.recordingNavigationItem&&(V.Z.removeItem(this.recordingNavigationItem),this.recordingNavigationItem=void 0),this.recordCanceled)return;const{peerId:t,threadId:i}=this.chat,s=this.replyToMsgId,n=(Date.now()-this.recordStartTime)/1e3|0,a=new Blob([e],{type:"audio/ogg"});r.Z.decode(e,!0).then((e=>{r.Z.setKeepAlive(!1),this.managers.appMessagesManager.sendFile(t,{file:a,isVoiceMessage:!0,isMedia:!0,duration:n,waveform:e.waveform,objectURL:e.url,replyToMsgId:s,threadId:i,clearDraft:!0}),this.onMessageSent(!1,!0)}))}),(0,S.fc)(this.replyElements.cancelBtn,this.onHelperCancel,{listenerSetter:this.listenerSetter}),(0,S.fc)(this.replyElements.container,this.onHelperClick,{listenerSetter:this.listenerSetter}),this.saveDraftDebounced=(0,Fe.Z)((()=>this.saveDraft()),2500,!1,!0),this.botStartBtn=(0,J.Z)("btn-primary btn-transparent text-bold chat-input-control-button"),this.botStartBtn.append((0,g.ag)("BotStart")),(0,S.fc)(this.botStartBtn,(()=>{const{startParam:e}=this;if(void 0===e)return;const t=this.toggleBotStartBtnDisability=(0,Je.Z)([this.botStartBtn],!0),i=this.chat.peerId,s=this.chat.bubbles.getMiddleware((()=>this.chat.peerId===i&&this.startParam===e&&this.toggleBotStartBtnDisability===t));this.managers.appMessagesManager.startBot(i.toUserId(),void 0,e).then((()=>{s()&&(t(),this.toggleBotStartBtnDisability=void 0,this.setStartParam())}))}),{listenerSetter:this.listenerSetter}),this.controlContainer.append(this.botStartBtn,this.replyInTopicOverlay),this.pinnedControlBtn=(0,J.Z)("btn-primary btn-transparent text-bold chat-input-control-button",{icon:"unpin"}),this.controlContainer.append(this.pinnedControlBtn),this.listenerSetter.add(this.pinnedControlBtn)("click",(()=>{const e=this.chat.peerId;c.Z.createPopup(ae.Z,e,0,!0,(()=>{this.chat.appImManager.setPeer();const e=this.chat.appImManager.chat;e.topbar.pinnedMessage&&e.topbar.pinnedMessage.pinnedMessageContainer.toggle(!0)}))}))}_center(e,t){if(!e&&!this.inputContainer.classList.contains("is-centering"))return;if(e===this.fakeWrapperTo)return;const i=e||this.fakeWrapperTo,s=!!e,n=this.fakeWrapperTo;let a,o="",r="";const d=i.getBoundingClientRect(),l=this.fakeRowsWrapper.getBoundingClientRect(),c=l.width,h=d.width;if(c!==h){const e=h/c,t=(c-h)/2;if(a=d.left-l.left-t,s&&(o=`translateX(${a}px) scaleX(${e})`,e<1)){const t=16;r=t+t*(1-e)+"px"}}this.fakeWrapperTo=e;const u=t?200:0;return(0,K.Z)({element:this.inputContainer,className:"is-centering",forwards:s,duration:u}),(0,K.Z)({element:this.rowsWrapperWrapper,className:"is-centering-to-control",forwards:!!(s&&e&&e.classList.contains("chat-input-control")),duration:u}),this.rowsWrapper.style.transform=o,this.rowsWrapper.style.borderRadius=r,{transform:o,borderRadius:r,needTranslateX:n&&(e&&e.classList.contains("chat-input-control")&&n===this.fakeSelectionWrapper||n.classList.contains("chat-input-control"))?-.5*a:a,widthFrom:c,widthTo:h}}center(e=!1){return Rt(this,void 0,void 0,(function*(){return this._center(yield this.getNeededFakeContainer(),e)}))}setStartParam(e){this.startParam!==e&&(this.startParam=e,this.center(!0))}isReplyInTopicOverlayNeeded(){return this.chat.isForum&&!this.chat.isForumTopic&&!this.replyToMsgId&&"chat"===this.chat.type}getNeededFakeContainer(e=this.startParam){return Rt(this,void 0,void 0,(function*(){return this.chat.selection.isSelecting?this.fakeSelectionWrapper:void 0!==e||"pinned"===this.chat.type||(yield this.chat.isStartButtonNeeded())||this.isReplyInTopicOverlayNeeded()?this.controlContainer:void 0}))}getReadyToSend(e){return"scheduled"===this.chat.type?(this.scheduleSending(e),!0):(e(),!1)}setUnreadCount(){return Rt(this,void 0,void 0,(function*(){if(!this.goDownUnreadBadge)return;const e=yield this.managers.dialogsStorage.getDialogOrTopic(this.chat.peerId,"discussion"===this.chat.type?void 0:this.chat.threadId),t=null==e?void 0:e.unread_count;if(this.goDownUnreadBadge.innerText=""+(t||""),this.goDownUnreadBadge.classList.toggle("badge-gray",yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:this.chat.peerId,respectType:!0,threadId:this.chat.threadId})),this.goMentionUnreadBadge&&"chat"===this.chat.type){const t=!(!(null==e?void 0:e.unread_mentions_count)||!e.unread_count);this.goMentionUnreadBadge.innerText=t?""+e.unread_mentions_count:"",this.goMentionBtn.classList.toggle("is-visible",t)}}))}getCurrentInputAsDraft(e){const{value:t,entities:i}=(0,C.Z)(this.messageInputField.input,!0,!1);let s;return(t.length||e||this.replyToMsgId)&&(s={_:"draftMessage",date:(0,oe.Z)(!0),message:t,entities:i.length?i:void 0,pFlags:{no_webpage:this.noWebPage},reply_to_msg_id:this.replyToMsgId}),s}saveDraft(){if(!this.chat.peerId||this.editMsgId||"scheduled"===this.chat.type)return;const e=this.getCurrentInputAsDraft();this.managers.appDraftsManager.syncDraft(this.chat.peerId,this.chat.threadId,e)}destroy(){this.listenerSetter.removeAll()}cleanup(e=!0){this.chat.peerId||(this.chatInput.classList.add("hide"),this.goDownBtn.classList.add("hide")),(0,ce.Z)(),this.lastTimeType=0,this.startParam=void 0,this.toggleBotStartBtnDisability&&(this.toggleBotStartBtnDisability(),this.toggleBotStartBtnDisability=void 0),this.messageInput&&(this.clearInput(),e&&this.clearHelper())}setDraft(e,t=!0,i=!1){return Rt(this,void 0,void 0,(function*(){if(!i&&!(0,y.Z)(this.messageInput)||"scheduled"===this.chat.type)return!1;if(!e&&!(e=yield this.managers.appDraftsManager.getDraft(this.chat.peerId,this.chat.threadId)))return i&&(this.chat.container.classList.contains("is-helper-active")&&this.t(),this.messageInputField.inputFake.textContent="",this.messageInputField.onFakeInput(!1),(this.chat.bubbles.messagesQueuePromise||Promise.resolve()).then((()=>{(0,Ke.T2)((()=>{this.onMessageSent()}))}))),!1;const s=function(e,t,i){const s=(0,ot.Z)(e.message),n=e.entities||[],a=(0,at.Z)(n.slice(),s);return(0,dt.Z)(e.message,{entities:a,wrappingForPeerId:t,loadPromises:void 0})}(e,this.chat.peerId),n=this.getCurrentInputAsDraft();return!((0,Mt.Z)(e,n)&&this.replyToMsgId===e.reply_to_msg_id||(t&&this.clearHelper(),this.noWebPage=e.pFlags.no_webpage,e.reply_to_msg_id&&this.initMessageReply(e.reply_to_msg_id),this.setInputValue(s,t,t),0))}))}createSendAs(){if(this.sendAsPeerId=void 0,"chat"===this.chat.type||"discussion"===this.chat.type){let e=!0;this.sendAs=new yt(this.managers,((e,t)=>{let i=0;e.parentElement||(this.newMessageWrapper.prepend(e),i=2),this.updateOffset("as",!0,t,i)}),(t=>{this.sendAsPeerId=t,e?e=!1:this.getPlaceholderKey().then((e=>{this.updateMessageInputPlaceholder(e)}))}))}else this.sendAs=void 0;return this.sendAs}finishPeerChange(e){return Rt(this,void 0,void 0,(function*(){const t=this.chat.peerId,{forwardElements:i,btnScheduled:s,replyKeyboard:n,sendMenu:a,goDownBtn:o,chatInput:r,botCommandsToggle:d}=this,l=this.sendAs,c=this.createSendAs(),[h,u,p,f,m,v,b,y,w,S]=yield Promise.all([this.managers.appPeersManager.isBroadcast(t),this.managers.appPeersManager.canPinMessage(t),this.managers.appPeersManager.isBot(t),this.chat.canSend("send_messages"),this.chat.canSend("send_plain"),this.getNeededFakeContainer(e),ft(this.managers.acknowledged.appProfileManager.getProfileByPeerId(t)),s?ft(this.managers.acknowledged.appMessagesManager.getScheduledMessages(t)):void 0,c?(c.setPeerId(this.chat.peerId),c.updateManual(!0)):void 0,this.filterAttachMenuButtons()]),C=this.messageInput?yield this.getPlaceholderKey(m):void 0;return()=>{var c;if(r.classList.remove("hide"),o.classList.toggle("is-broadcast",h),o.classList.remove("hide"),this.goDownUnreadBadge&&this.setUnreadCount(),"pinned"===this.chat.type&&r.classList.toggle("can-pin",u),i&&(this.forwardWasDroppingAuthor=!1,i.showCaption.checkboxField.setValueSilently(!0),i.showSender.checkboxField.setValueSilently(!0)),s&&y){s.classList.add("hide");const e=this.chat.bubbles.getMiddleware();(0,et.Z)(y.result,(t=>{e()&&t&&s.classList.toggle("hide",!t.length)}))}if(this.newMessageWrapper&&this.updateOffset(null,!1,!0),d&&(this.hasBotCommands=void 0,this.botCommands.toggle(!0,void 0,!0),this.updateBotCommandsToggle(!0),d.remove(),p)){const e=this.chat.bubbles.getMiddleware(),t=b.result;(0,et.Z)(t,(i=>{e()&&this.updateBotCommands(i,!(t instanceof Promise))}))}null==l||l.destroy(),null==w||w(),null==n||n.setPeer(t),null==a||a.setPeerId(t),this.messageInput&&(this.updateMessageInput(f,m,C,S),this.messageInput.dataset.peerId=""+t),null===(c=this.messageInputField)||void 0===c||c.onFakeInput(void 0,!0);let L=!1;if(this.pinnedControlBtn){const e="pinned"===this.chat.type;L||(L=e),this.pinnedControlBtn.classList.toggle("hide",!e),this.pinnedControlBtn.replaceChildren((0,g.ag)(u?"Chat.Input.UnpinAll":"Chat.Pinned.DontShow"))}{const e=this.chat.isForum&&!this.chat.isForumTopic&&"chat"===this.chat.type;L||(L=e),this.replyInTopicOverlay.classList.toggle("hide",!e)}this.botStartBtn.classList.toggle("hide",L),this.startParam=e,this._center(v,!1)}}))}updateOffset(e,t,i,s){e?this.newMessageWrapper.dataset.offset=e:delete this.newMessageWrapper.dataset.offset,(0,K.Z)({element:this.newMessageWrapper,className:"has-offset",forwards:t,duration:i?0:300,useRafs:s})}updateBotCommands(e,t){var i,s;this.hasBotCommands=!!(null===(s=null===(i=e.bot_info)||void 0===i?void 0:i.commands)||void 0===s?void 0:s.length),this.updateBotCommandsToggle(t)}updateBotCommandsToggle(e){const{botCommandsToggle:t,hasBotCommands:i}=this,s=!!i&&this.isInputEmpty();if(!i){if(!t.parentElement)return;t.remove()}const n=s,a=t.parentElement?0:2;t.parentElement||this.newMessageWrapper.prepend(t),this.updateOffset("commands",n,e,a)}getPlaceholderKey(e){return Rt(this,void 0,void 0,(function*(){null!=e||(e=yield this.chat.canSend("send_plain"));const{peerId:t,threadId:i,isForum:s}=this.chat;let n;return n=e?i&&!s?"Comment":(yield this.managers.appPeersManager.isBroadcast(t))?"ChannelBroadcast":void 0!==this.sendAsPeerId&&this.sendAsPeerId!==x.Z.myId||(yield this.managers.appMessagesManager.isAnonymousSending(t))?"SendAnonymously":"Message":"Channel.Persmission.MessageBlock",n}))}updateMessageInputPlaceholder(e){const t=g.ZP.weakMap.get(this.messageInput);if(!t)return;const i=t.key;return t.compareAndUpdate({key:e}),{oldKey:i,newKey:e}}filterAttachMenuButtons(){if(this.attachMenuButtons)return(0,wt.Z)(this.attachMenuButtons,(e=>!e.verify||e.verify()))}updateMessageInput(e,t,i,s){const{chatInput:n,attachMenu:a,messageInput:o}=this;n.classList.contains("is-hidden")!==!e&&(n.classList.add("no-transition"),n.classList.toggle("is-hidden",!e),n.offsetLeft,n.classList.remove("no-transition"));const r=e&&!t&&this.restoreInputLock;!r&&this.updateMessageInputPlaceholder(i),r?this.restoreInputLock=()=>{this.updateMessageInputPlaceholder(i),this.messageInput.contentEditable="false"}:e&&t?(this.restoreInputLock=void 0,o.contentEditable="true",this.setDraft(void 0,!1),o.innerHTML||this.messageInputField.onFakeInput(void 0,!0)):(o.contentEditable="false",t||this.messageInputField.onFakeInput(void 0,!0)),a&&(a.toggleAttribute("disabled",!s.length),a.classList.toggle("btn-disabled",!s.length)),this.updateSendBtn()}attachMessageInputField(){const e=this.messageInputField;this.messageInputField=new St.Z({placeholder:"Message",name:"message",withLinebreaks:!0}),this.messageInputField.input.tabIndex=-1,this.messageInputField.input.classList.replace("input-field-input","input-message-input"),this.messageInputField.inputFake.classList.replace("input-field-input","input-message-input"),this.messageInput=this.messageInputField.input,this.attachMessageInputListeners(),$e.T&&(0,$e.Z)(this.messageInput),e?(e.input.replaceWith(this.messageInputField.input),e.inputFake.replaceWith(this.messageInputField.inputFake)):this.inputMessageContainer.append(this.messageInputField.input,this.messageInputField.inputFake)}attachMessageInputListeners(){this.listenerSetter.add(this.messageInput)("keydown",(e=>{const t=e.key;if((0,he.Z)(e))(0,b.Z)(e),this.sendMessage();else if(e.ctrlKey||e.metaKey)this.handleMarkdownShortcut(e);else if(("PageUp"===t||"PageDown"===t)&&!e.shiftKey)if(e.preventDefault(),"PageUp"===t){const e=document.createRange(),t=window.getSelection();e.setStart(this.messageInput.childNodes[0]||this.messageInput,0),e.collapse(!0),t.removeAllRanges(),t.addRange(e)}else(0,ue.Z)(this.messageInput)})),(0,S.fc)(this.messageInput,(e=>{this.canSendPlain()||(0,Z.bC)({langPackKey:Bt.send_plain})}),{listenerSetter:this.listenerSetter}),o.Z&&(0,S.fc)(this.messageInput,(e=>{if(l.ZP.isActive())return l.ZP.toggle(!1),(0,le.Z)(),void(0,b.Z)(e);this.appImManager.selectTab(s.oo.CHAT)}),{listenerSetter:this.listenerSetter}),this.listenerSetter.add(this.messageInput)("input",this.onMessageInput),this.listenerSetter.add(this.messageInput)("keyup",(()=>{this.checkAutocomplete()})),this.listenerSetter.add(this.messageInput)("focusin",(()=>{"chat"!==this.chat.type&&"discussion"!==this.chat.type||!this.chat.bubbles.scrollable.loadedAll.bottom||this.managers.appMessagesManager.readAllHistory(this.chat.peerId,this.chat.threadId)}))}canSendPlain(){return!(!this.messageInput.isContentEditable&&!this.chatInput.classList.contains("is-hidden"))}applyMarkdown(e,t){var i;const s={link:t?()=>document.execCommand("createLink",!1,t):()=>document.execCommand("unlink",!1,null)},n=e=>{s[e]=()=>{const t=(a.includes(e)?a:[e]).filter((e=>c[e]));return(0,mt.Z)(t,e)||t.push(e),t.length?document.execCommand("fontName",!1,"markup-"+t.join("-")):this.resetCurrentFontFormatting()}},a=["bold","italic","underline","strikethrough","spoiler"];if(a.forEach((e=>{n(e)})),n("monospace"),!s[e])return!1;const o=s[e],r=[],d=Zt.Z.getInstance().prepareApplyingMarkdown(),l=this.listenerSetter.add(this.messageInput)("input",b.Z,{capture:!0,passive:!1});r.push(document.execCommand("styleWithCSS",!1,"true"));const c=(0,Pt.Z)(Object.keys(s));return c.monospace&&"link"===e&&r.push(this.resetCurrentFormatting()),r.push("function"==typeof o?o():document.execCommand(o,!1,null)),r.push(document.execCommand("styleWithCSS",!1,"false")),d(),null===(i=this.appImManager.markupTooltip)||void 0===i||i.setActiveMarkupButton(),this.listenerSetter.remove(l),this.messageInputField.simulateInputEvent(),!0}resetCurrentFormatting(){return document.execCommand("removeFormat",!1,null)}resetCurrentFontFormatting(){return document.execCommand("fontName",!1,"Roboto")}insertAtCaret(e,t,i=!0){if(!this.canSendPlain())return void(0,Z.bC)({langPackKey:Bt.send_plain});Zt.Z.getInstance().makeFocused(this.messageInput);const{value:s,caretPos:n,entities:a}=(0,C.Z)(this.messageInput),o=n>=0?n:s.length,r=s.substr(0,o),d=(s.substr(o),i?r.match(Nt.AUTO_COMPLETE_REG_EXP):null),l=d?d.index+(d[0].length-d[2].length):r.length;if(r.slice(0,l),i&&-1!==n){const e=d[2],t=document.getSelection();let i=0;for(;t.toString()!==e;){if(++i>=1e4)throw new Error("lolwhat");t.modify("extend","backward","character")}}(0,u.rf)(this.messageInput,e,t?[t]:void 0,this.chat.peerId)}checkAutocomplete(e,t,i){return Rt(this,void 0,void 0,(function*(){const s=void 0!==e;if(!s){const s=(0,C.Z)(this.messageInputField.input,!0,!0);e=s.value,t=s.caretPos,i=s.entities}if(-1===t&&(t=e.length),void 0===i||!s){const t=(0,rt.Z)(e,i,!0);i=(0,at.Z)(i,(0,ot.Z)(t))}if(e=e.slice(0,t),this.previousQuery===e)return;this.previousQuery=e;const n=e.match(Nt.AUTO_COMPLETE_REG_EXP);let a,o;if(n){const t=i[0];let s=n[2];const o=s[0];if(this.stickersHelper&&"none"!==x.Z.settings.stickers.suggest&&(yield this.chat.canSend("send_stickers"))&&"messageEntityEmoji"===(null==t?void 0:t._)&&t.length===e.length&&!t.offset)a=this.stickersHelper,this.stickersHelper.checkEmoticon(e);else if("@"===o){const e=this.chat.threadId?(0,ct.Z)(this.chat.threadId):void 0;(yield this.mentionsHelper.checkQuery(s,this.chat.peerId.isUser()?Qe.NM:this.chat.peerId,e))&&(a=this.mentionsHelper)}else n[1]||"/"!==o?x.Z.settings.emoji.suggest&&(s=s.replace(/^\s*/,""),e.match(/^\s*:(.+):\s*$/)||e.match(/:[;!@#$%^&*()-=|]/)||!s||(a=this.emojiHelper,this.emojiHelper.checkQuery(s,o))):(yield this.commandsHelper.checkQuery(s,this.chat.peerId))&&(a=this.commandsHelper)}a||(o=yield this.chat.canSend("send_inline")),a=this.checkInlineAutocomplete(e,o,a),this.autocompleteHelperController.hideOtherHelpers(a)}))}checkInlineAutocomplete(e,t,i){let s=!1;const n=e=>{this.btnPreloader&&(e&&!t&&(e=!1),(0,K.Z)({element:this.btnPreloader,className:"show",forwards:e,duration:400}))};if(!i){const a=e.match(/^@([a-zA-Z\\d_]{3,32})\s/);if(a){const o=a[1],r=e.slice(a[0].length);s=a[0].length===e.length,i=this.inlineHelper,this.btnPreloader?n(!0):(this.btnPreloader=this.createButtonIcon("none btn-preloader float show disable-hover",{noRipple:!0}),(0,Ve.y)(this.btnPreloader,!0),this.inputMessageContainer.parentElement.insertBefore(this.btnPreloader,this.inputMessageContainer.nextSibling)),this.inlineHelper.checkQuery(this.chat.peerId,o,r,t).then((({user:e,renderPromise:t})=>{s&&e.bot_inline_placeholder&&(this.messageInput.dataset.inlinePlaceholder=e.bot_inline_placeholder),t.then((()=>{n(!1)}))})).catch((e=>{n(!1)}))}}return s||delete this.messageInput.dataset.inlinePlaceholder,i!==this.inlineHelper&&n(!1),i}setRecording(e){this.recording!==e&&((0,K.Z)({element:this.chatInput,className:"is-recording",forwards:e,duration:200}),this.recording=e,this.updateSendBtn())}changeForwardRecipient(){if(this.helperWaitingForward)return;this.helperWaitingForward=!0;const e=(0,it.Z)(this.forwarding),t=this.helperFunc;this.clearHelper(),this.updateSendBtn();let i=!1;c.Z.createPopup(E.Z,e,(()=>{i=!0})).addEventListener("close",(()=>{this.helperWaitingForward=!1,i||t()}))}clearInput(e=!0,t=!0,i=""){return Rt(this,void 0,void 0,(function*(){if(document.activeElement===this.messageInput&&G.IS_MOBILE_SAFARI){const e=document.createElement("input");document.body.append(e),(0,Me.Z)(e),this.messageInputField.setValueSilently(i),(0,Me.Z)(this.messageInput),e.remove()}else this.messageInputField.setValueSilently(i);o.Z||(this.canRedoFromHTML="",this.undoHistory.length=0,this.executedHistory.length=0,this.canUndoFromHTML="");let s=!1;e&&(s=yield this.setDraft(void 0,!1)),!s&&t&&this.onMessageInput()}))}isInputEmpty(){return(0,y.Z)(this.messageInput)}updateSendBtn(){let e;const t=this.isInputEmpty();e=this.editMsgId?"edit":!this.recorder||this.recording||!t||this.forwarding?"scheduled"===this.chat.type?"schedule":"send":"record",["send","record","edit","schedule"].forEach((t=>{this.btnSend.classList.toggle(t,e===t)})),this.btnScheduled&&this.btnScheduled.classList.toggle("show",t&&"scheduled"!==this.chat.type),this.btnToggleReplyMarkup&&this.btnToggleReplyMarkup.classList.toggle("show",t&&"scheduled"!==this.chat.type)}getValueAndEntities(e){const{entities:t,value:i}=(0,C.Z)(e,!0,!1),s=(0,ot.Z)(i);return{value:i,totalEntities:(0,at.Z)(t,s)}}onMessageSent(e=!0,t){"scheduled"!==this.chat.type&&this.managers.appMessagesManager.readAllHistory(this.chat.peerId,this.chat.threadId,!0),this.scheduleDate=void 0,this.sendSilent=void 0;const{totalEntities:i}=this.getValueAndEntities(this.messageInput);let s=0;i.filter((e=>{if("messageEntityEmoji"===e._||"messageEntityCustomEmoji"===e._){const t=e.offset+e.length;return!(t<=s||(s=t,0))}return!1})).forEach((e=>{const t="messageEntityEmoji"===e._?{emoji:(0,ut.zu)(e.unicode)}:{docId:e.document_id,emoji:""};this.managers.appEmojiManager.pushRecentEmoji(t)})),e&&(this.lastUrl="",delete this.noWebPage,this.willSendWebPage=null,this.clearInput()),(t||e)&&this.clearHelper(),this.updateSendBtn()}sendMessage(e=!1){const{editMsgId:t,chat:i}=this;if("scheduled"===i.type&&!e&&!t)return void this.scheduleSending();const{peerId:s}=i,{noWebPage:n}=this,a=this.chat.getMessageSendingParams(),{value:o,entities:r}=(0,C.Z)(this.messageInputField.input,!0,!1);if(t){const e=this.editMessage;if(!o.trim()&&!e.media)return void c.Z.createPopup(We.Z,s,[t],i.type);this.managers.appMessagesManager.editMessage(e,o,{entities:r,noWebPage:n}),this.onMessageSent()}else o.trim()&&(this.managers.appMessagesManager.sendText(s,o,Object.assign(Object.assign({entities:r},a),{noWebPage:n,webPage:this.getWebPagePromise?void 0:this.willSendWebPage,clearDraft:!0})),"scheduled"===this.chat.type?this.onMessageSent(!0):this.onMessageSent(!1,!1));if(this.forwarding){const e=(0,it.Z)(this.forwarding);for(const t in e)this.managers.appMessagesManager.forwardMessages(s,t.toPeerId(),e[t],Object.assign(Object.assign({},a),{dropAuthor:this.forwardElements&&this.forwardElements.hideSender.checkboxField.checked,dropCaptions:this.isDroppingCaptions()})).catch((e=>Rt(this,void 0,void 0,(function*(){"VOICE_MESSAGES_FORBIDDEN"===e.type&&(0,Z.bC)({langPackKey:"Chat.SendVoice.PrivacyError",langPackArguments:[yield(0,It.Z)({peerId:s})]})}))));o||this.onMessageSent()}}sendMessageWithDocument(e,t=!1,i=!1,s=!1){return Rt(this,void 0,void 0,(function*(){const n="sticker"===(e=yield this.managers.appDocsManager.getDoc(e)).type?"send_stickers":"gif"===e.type?"send_gifs":"send_media";return this.chat.peerId.isAnyChat()&&!(yield this.chat.canSend(n))?((0,Z.bC)({langPackKey:Bt[n]}),!1):"scheduled"!==this.chat.type||t?!(!e||e.sticker&&(0,Ct.Z)(e)&&!x.Z.premium||(this.managers.appMessagesManager.sendFile(this.chat.peerId,Object.assign(Object.assign({},this.chat.getMessageSendingParams()),{file:e,isMedia:!0,clearDraft:i,silent:s})),this.onMessageSent(i,!0),"sticker"===e.type&&this.managers.appStickersManager.saveRecentSticker(e.id),0)):(this.scheduleSending((()=>this.sendMessageWithDocument(e,!0,i,s))),!1)}))}canToggleHideAuthor(){const{forwardElements:e}=this;if(!e)return!1;const t=e.hideCaption.checkboxField;return!t.checked||(0,v.Z)(t.label,"FORM").classList.contains("hide")}isDroppingCaptions(){return!this.canToggleHideAuthor()}initMessageEditing(e){return Rt(this,void 0,void 0,(function*(){const t=yield this.chat.getMessage(e);let i=(0,dt.Z)(t.message,{entities:t.totalEntities,wrappingForPeerId:this.chat.peerId});const s=()=>Rt(this,void 0,void 0,(function*(){let n;if(!this.messageInput.isContentEditable){const e=yield this.getPlaceholderKey(!0),{contentEditable:t}=this.messageInput;this.messageInput.contentEditable="true";const{oldKey:i}=this.updateMessageInputPlaceholder(e);n=()=>{this.messageInput.contentEditable=t,this.updateMessageInputPlaceholder(i)}}const a=yield(0,lt.Z)({message:t,usingMids:[t.mid]});this.setTopInfo("edit",s,(0,g.ag)("AccDescrEditing"),a,i,t),this.editMsgId=e,this.editMessage=t,i=void 0,this.restoreInputLock=n}));s()}))}initMessagesForward(e){const t=()=>Rt(this,void 0,void 0,(function*(){const i=Object.keys(e).map((e=>e.toPeerId())),s=new Set;let n=0,a=0;const o=i.map((t=>Rt(this,void 0,void 0,(function*(){const i=e[t],o=i.map((e=>Rt(this,void 0,void 0,(function*(){var i;const n=yield this.managers.appMessagesManager.getMessageByPeer(t,e);!(null===(i=n.fwd_from)||void 0===i?void 0:i.from_name)||n.fromId||n.fwdFromId?s.add("P"+n.fromId):s.add("N"+n.fwd_from.from_name),n.media&&n.message&&++a}))));yield Promise.all(o),n+=i.length}))));yield Promise.all(o);const r=s.size>2,d=[...s].map((e=>{const t=e[0];if(e=e.slice(1),"P"===t){const t=e.toPeerId();return t===x.Z.myId?(0,g.ag)("Chat.Accessory.Forward.You"):new be.Z({peerId:t,dialog:!1,onlyFirstName:r}).element}return r?e.split(" ")[0]:e})),{forwardElements:l}=this;(0,v.Z)(l.showCaption.checkboxField.label,"FORM").classList.toggle("hide",!a);const c=l.hideCaption.checkboxField.checked;a&&c?l.hideSender.checkboxField.setValueSilently(!0):void 0!==this.forwardWasDroppingAuthor&&(this.forwardWasDroppingAuthor?l.hideSender:l.showSender).checkboxField.setValueSilently(!0);const h=l.showSender.checkboxField.checked?"Chat.Accessory.Forward":"Chat.Accessory.Hidden",u=(0,g.ag)(h,[n]),p=document.createDocumentFragment();let f,m;if(d.length<3?p.append(...(0,g.v_)(d,!1)):p.append(d[0],(0,g.ag)("AndOther",[d.length-1])),1===i.length){const t=i[0],s=e[t];if(f=yield this.managers.appMessagesManager.getMessageByPeer(t,s[0]),m=!!f.grouped_id,m){const e=yield this.managers.appMessagesManager.getMidsByMessage(f);(e.length!==n||e.find((e=>!s.includes(e))))&&(m=!1)}}const b=document.createDocumentFragment();if(m||1===n){const t=e[i[0]],s=yield(0,lt.Z)({message:f,usingMids:t});b.append(p,": ",s)}else b.append((0,g.ag)("Chat.Accessory.Forward.From"),": ",p);const y=this.setTopInfo("forward",t,u,b);l.modifyArgs.forEach(((e,t)=>{const s=e.textElement,n=g.ZP.weakMap.get(s);n.args=[t<2?i.length:a],n.update()})),this.forwardHover&&this.forwardHover.attachButtonListener(y,this.listenerSetter),this.forwarding=e}));t()}initMessageReply(e){return Rt(this,void 0,void 0,(function*(){if(this.replyToMsgId===e)return;let t=yield this.chat.getMessage(e);const i=()=>{let s;t?s=new be.Z({peerId:t.fromId,dialog:!1}).element:(s=(0,g.ag)("Loading"),this.managers.appMessagesManager.reloadMessages(this.chat.peerId,e).then((s=>{this.replyToMsgId===e&&(t=s,t?i():this.clearHelper("reply"))}))),this.setTopInfo("reply",i,s,t&&t.message,void 0,t),this.setReplyToMsgId(e)};i()}))}setReplyToMsgId(e){this.replyToMsgId=e,this.center(!0)}clearHelper(e){var t;"edit"===this.helperType&&"edit"!==e&&this.clearInput(),e&&(this.lastUrl="",delete this.noWebPage,this.willSendWebPage=null),"reply"!==e&&(this.setReplyToMsgId(void 0),this.forwarding=void 0),this.editMsgId=this.editMessage=void 0,this.helperType=this.helperFunc=void 0,this.restoreInputLock&&(null===(t=this.restoreInputLock)||void 0===t||t.call(this),this.restoreInputLock=void 0),this.chat.container.classList.contains("is-helper-active")&&(V.Z.removeByType("input-helper"),this.chat.container.classList.remove("is-helper-active"),this.t())}t(){const e="is-toggling-helper";(0,K.Z)({element:this.chat.container,className:e,forwards:!0,duration:150,onTransitionEnd:()=>{this.chat.container.classList.remove(e)}})}setInputValue(e,t=!0,i=!0){e||(e=""),t?this.clearInput(!1,!1,e):this.messageInputField.setValueSilently(e),(0,Ke.T2)((()=>{i&&(0,ue.Z)(this.messageInput),this.onMessageInput(),this.messageInput.scrollTop=this.messageInput.scrollHeight}))}setTopInfo(e,t,i="",s="",n,a){if(this.willSendWebPage&&"reply"===e)return;"webpage"!==e&&(this.clearHelper(e),this.helperType=e,this.helperFunc=t);const o=this.replyElements.container,r=o.lastElementChild.previousElementSibling,d=r.classList.contains("reply");this.replyElements.iconBtn.replaceWith(this.replyElements.iconBtn=this.createButtonIcon(("webpage"===e?"link":e)+" active reply-icon",{noRipple:!0}));const{container:l}=(0,Et.Z)(i,s,this.chat.animationGroup,a);return d?r.replaceWith(l):o.insertBefore(l,o.lastElementChild),"webpage"===e&&(l.style.cursor="default"),this.chat.container.classList.contains("is-helper-active")||(this.chat.container.classList.add("is-helper-active"),this.t()),G.IS_MOBILE||V.Z.pushItem({type:"input-helper",onPop:()=>{this.onHelperCancel()}}),void 0!==n&&this.setInputValue(n),setTimeout((()=>{this.updateSendBtn()}),0),l}}Nt.AUTO_COMPLETE_REG_EXP=/(\s|^)((?:(?:@|^\/)\S*)|(?::|^[^:@\/])(?!.*[:@\/]).*)$/},2482:(e,t,i)=>{"use strict";i.d(t,{U7:()=>b,ZP:()=>y});var s=i(6654),n=i(2559),a=i(2946),o=i(3512),r=i(9099),d=i(2149),l=i(3541),c=i(9083),h=i(6775),u=i(9405),p=i(3035),f=i(319),m=i(5994);const g="reaction",v=g+"-element",b=4;class y extends HTMLElement{constructor(){super(),this.classList.add(g),this.managers=o.Z.managers}get reactionCount(){return this._reactionCount}set reactionCount(e){this._reactionCount=e}get count(){return this.reactionCount.count}init(e,t){this.type=e,this.classList.add(g+"-"+e),this.middleware=t}setCanRenderAvatars(e){this.canRenderAvatars=e}render(e){const t=!!this.stickerContainer;t||(this.stickerContainer=document.createElement("div"),this.stickerContainer.classList.add(g+"-sticker"),this.append(this.stickerContainer));const i=this.reactionCount;if(!e&&!t){const e=i.reaction;if("reactionEmoji"===e._){const t=this.managers.appReactionsManager.getReaction(e.emoticon);(0,s.Z)(t,(e=>{var t;e.center_icon||this.stickerContainer.classList.add("is-static"),e.pFlags.inactive&&this.classList.add("is-inactive"),this.renderDoc(null!==(t=e.center_icon)&&void 0!==t?t:e.static_icon)}))}else if("reactionCustomEmoji"===e._){this.stickerContainer.classList.add("is-custom");const t=(0,c.Z)({docIds:[e.document_id],customEmojiSize:(0,u.C)(22,22)});this.stickerContainer.append(t)}}}renderDoc(e){const t="inline"===this.type?14:22,i=this.wrapStickerPromise=(0,l.ZP)({div:this.stickerContainer,doc:e,width:t,height:t,static:!0,managers:this.managers,middleware:this.middleware}).then((({render:e})=>e)).finally((()=>{this.wrapStickerPromise===i&&(this.wrapStickerPromise=void 0)}))}renderCounter(){var e;const t=this.reactionCount,i="inline"===this.type?2:b;if(t.count>=i||"block"===this.type&&!this.canRenderAvatars){this.counter||(this.counter=document.createElement("inline"===this.type?"i":"span"),this.counter.classList.add(g+"-counter"));const e=(0,n.Z)(t.count);this.counter.textContent!==e&&(this.counter.textContent=e),this.counter.parentElement||this.append(this.counter)}else(null===(e=this.counter)||void 0===e?void 0:e.parentElement)&&(this.counter.remove(),this.counter=void 0)}renderAvatars(e){"inline"!==this.type&&(this.reactionCount.count>=b||!this.canRenderAvatars?this.stackedAvatars&&(this.stackedAvatars.container.remove(),this.stackedAvatars=void 0):(this.stackedAvatars||(this.stackedAvatars=new d.Z({avatarSize:24}),this.append(this.stackedAvatars.container)),this.stackedAvatars.render(e.map((e=>(0,a.Z)(e.peer_id))))))}setIsChosen(e=void 0!==this.reactionCount.chosen_order){"inline"!==this.type&&(this.classList.contains("is-chosen")&&!this.classList.contains("backwards"))!==e&&(0,r.Z)({element:this,className:"is-chosen",forwards:e,duration:this.isConnected?300:0})}fireAroundAnimation(){if(!m.Z.isAvailable("effects_reactions"))return;const e=this.reactionCount.reaction;"reactionEmoji"===e._&&(0,s.Z)(this.managers.appReactionsManager.getReaction(e.emoticon),(e=>{const t="inline"===this.type?28:40,i=document.createElement("div");i.classList.add(g+"-sticker-activate"),Promise.all([(0,l.ZP)({div:i,doc:e.center_icon,width:t,height:t,withThumb:!1,needUpscale:!0,play:!1,skipRatio:1,group:"none",needFadeIn:!1,managers:this.managers,middleware:this.middleware}).then((({render:e})=>e)),(0,h.Z)({doc:e.around_animation,size:80,target:this.stickerContainer,side:"center",skipRatio:1,play:!1,managers:this.managers,middleware:this.middleware}).stickerPromise.catch(f.Z)]).then((([e,t])=>{const s=()=>{e.remove(),i.remove(),this.stickerContainer.classList.remove("has-animation")};if(!t)return void s();const n=()=>{(0,p.T2)(s)};e.addEventListener("enterFrame",(t=>{t===e.maxFrame&&(this.wrapStickerPromise?this.wrapStickerPromise.then((()=>{setTimeout(n,1e3)})):n())})),e.addEventListener("firstFrame",(()=>{this.stickerContainer.append(i),this.stickerContainer.classList.add("has-animation"),e.play(),t.play()}),{once:!0})}))}))}}customElements.define(v,y)},8947:(e,t,i)=>{"use strict";i.d(t,{G:()=>h,Z:()=>u});var s=i(7625),n=i(4484),a=i(7030),o=i(5285),r=i(3512),d=i(2482);const l="reactions",c=l+"-element",h=new Map;class u extends HTMLElement{constructor(){super(),this.classList.add(l),this.sorted=[],this.middlewareHelpers=new Map,this.managers=r.Z.managers}connectedCallback(){let e=h.get(this.key);e||h.set(this.key,e=new Set),e.add(this),this.onConnectCallback&&this.isConnected&&(this.onConnectCallback(),this.onConnectCallback=void 0)}disconnectedCallback(){const e=h.get(this.key);e.delete(this),e.size||h.delete(this.key)}getReactionCount(e){return this.sorted[this.sorted.indexOf(e)].reactionCount}getMessage(){return this.message}init(e,t,i,s=this.isPlaceholder){void 0!==this.key&&this.disconnectedCallback(),this.middleware!==i&&i.onDestroy((()=>{this.middlewareHelpers.clear()})),this.message=e,this.key=this.message.peerId+"_"+this.message.mid,this.middleware=i,this.isPlaceholder=s,this.type!==t&&(this.type=t,this.classList.add(l+"-"+t)),this.connectedCallback()}changeMessage(e){return this.init(e,this.type,this.middleware)}update(e,t){this.message=e,this.render(t)}render(e){const t=this.message.reactions,i=!(!t||!t.results.length);if(this.classList.toggle("has-no-reactions",!i),!i&&!this.sorted.length)return;this.managers.appReactionsManager.getAvailableReactions();const a=i?t.results:[];a.sort(((e,t)=>{var i,s;return t.count-e.count||(null!==(i=e.chosen_order)&&void 0!==i?i:0)-(null!==(s=t.chosen_order)&&void 0!==s?s:0)})),(0,s.Z)(this.sorted,((e,t,i)=>{const s=e.reactionCount.reaction;a.some((e=>(0,o.Z)(e.reaction,s)))||(this.middlewareHelpers.get(e).destroy(),this.middlewareHelpers.delete(e),i.splice(t,1),e.remove())}));const r=a.reduce(((e,t)=>e+t.count),0),l=t&&(!!t.pFlags.can_see_list||this.message.peerId.isUser())&&r{let s=this.sorted.find((t=>(0,o.Z)(t.reactionCount.reaction,e.reaction)));if(!s){const e=this.middleware.create();s=new d.ZP,s.init(this.type,e.get()),this.middlewareHelpers.set(s,e)}(0,n.Z)(s,this,i);const a=t.recent_reactions?t.recent_reactions.filter((t=>(0,o.Z)(t.reaction,e.reaction))):[];return s.reactionCount=Object.assign({},e),s.setCanRenderAvatars(l),s.render(this.isPlaceholder),s.renderCounter(),s.renderAvatars(a),s.setIsChosen(),s})),!this.isPlaceholder&&(null==e?void 0:e.length)&&(this.isConnected?this.handleChangedResults(e):this.onConnectCallback=()=>{this.handleChangedResults(e)}),!this.sorted.length&&"block"===this.type){const e=this.parentElement;if(this.remove(),e.classList.contains("document-message")&&!e.childNodes.length)return void e.remove();const t=this.querySelector(".time");t&&e.append(t)}}handleChangedResults(e){this.message.peerId===a.ZP.chat.peerId&&e.forEach((e=>{const t=this.sorted.find((t=>(0,o.Z)(t.reactionCount.reaction,e.reaction)));null==t||t.fireAroundAnimation()}))}}customElements.define(c,u)},3484:(e,t,i)=>{"use strict";i.d(t,{Z:()=>g,o:()=>m});var s=i(5565),n=i(8456),a=i(7030),o=i(9687),r=i(8115),d=i(4561),l=i(496),c=i(9492),h=i(3541),u=i(2887),p=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const f=32;function m(e){var t;return p(this,void 0,void 0,(function*(){let{title:i,titleEl:d,subtitle:p,subtitleEl:m,mediaEl:g,message:v,loadPromises:b,animationGroup:y}=e;void 0!==i&&("string"==typeof i&&(i=(0,n.Z)(i,140),i=(0,r.Z)(i)),(0,s.Z)(d,i)),b||(b=[]);let w=null==v?void 0:v.media,S=!1,C=!1;const L=g?Array.from(g.children).slice():[];let I;if(w&&g){m.textContent="",m.append(yield(0,l.Z)({message:v,animationGroup:y,withoutMediaType:!0})),w=w.webpage||w;const e=w.photo,i=w.document;if(e||i&&(null===(t=i.thumbs)||void 0===t?void 0:t.length)){I=a.ZP.chat.bubbles.getMiddleware();const t=a.ZP.chat.bubbles.lazyLoadQueue;if("sticker"===(null==i?void 0:i.type))yield(0,h.ZP)({doc:i,div:g,lazyLoadQueue:t,group:y,width:f,height:f,middleware:I,loadPromises:b}),S=!0;else if("gif"===(null==i?void 0:i.type)&&i.video_thumbs)S=!0,yield(0,u.Z)({doc:i,container:g,boxWidth:f,boxHeight:f,lazyLoadQueue:t,noPlayButton:!0,noInfo:!0,middleware:I,loadPromises:b,withoutPreloader:!0,videoSize:i.video_thumbs[0],group:y});else{const s=e||i;C="round"===(null==i?void 0:i.type);try{yield(0,c.Z)({photo:s,container:g,boxWidth:f,boxHeight:f,size:(0,o.Z)(s,f,f),middleware:I,lazyLoadQueue:t,noBlur:!0,withoutPreloader:!0,loadPromises:b}),S=!0}catch(e){}}}}else v?(m.textContent="",m.append(yield(0,l.Z)({message:v}))):("string"==typeof p&&(p=(0,n.Z)(p,140),p=(0,r.Z)(p)),(0,s.Z)(m,p||""));return Promise.all(b).then((()=>{I&&!I()||(L.forEach((e=>e.remove())),g&&g.classList.toggle("is-round",C))})),S}))}class g extends d.Z{constructor(e,t){super(e,((e,i="",s)=>p(this,void 0,void 0,(function*(){this.mediaEl||(this.mediaEl=document.createElement("div"),this.mediaEl.classList.add(this.className+"-media"));const n=yield m({title:e,titleEl:this.title,subtitle:i,subtitleEl:this.subtitle,mediaEl:this.mediaEl,message:s,animationGroup:t});this.container.classList.toggle("is-media",n),n?this.content.prepend(this.mediaEl):this.mediaEl.remove()})))),this.className=e,this.animationGroup=t}}},6054:(e,t,i)=>{"use strict";i.d(t,{e:()=>x,Z:()=>A});var s=i(5432),n=i(4494),a=i(2230),o=i(9807),r=i(5128),d=i(4524),l=i(9099),c=i(1962),h=i(5824),u=i(4762),p=i(2325),f=i(8497),m=i(8799),g=i(3910),v=i(6760),b=i(5565),y=i(8487),w=i(144),S=i(2738),C=i(5975),L=i(3241),I=i(5953),E=i(6976),P=(i(6690),i(7030)),Z=i(1168),M=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const T=e=>[...e.values()].reduce(((e,t)=>e+t.size),0);class k extends L.Z{constructor(e){super(!1),this.selectedMids=new Map,this.isSelecting=!1,this.onMouseDown=e=>{const t=(0,f.Z)(e.target,this.targetLookupClassName);if(0!==e.button)return;if(this.verifyTarget&&!this.verifyTarget(e,t))return;const i=new Map;let s,n=t;const a=(e,t=!0)=>{const o=+e.dataset.mid;if(!o||!e.dataset.peerId)return;const r=e.dataset.peerId.toPeerId();(0,y.Z)(n)||(n=e);let d=i.get(r);if(d||i.set(r,d=new Set),d.has(o))return;const l=this.isMidSelected(r,o);if(void 0===s&&(s=!l),d.add(o),s&&!l||!s&&l){const s=T(i);if(this.toggleByElement&&t){s<2&&(0,C.Z)(e,n)&&(n=e);const t=this.getElementsBetween(n,e);t.length&&t.forEach((e=>{a(e,!1)}))}if(this.selectedMids.size)this.toggleByElement&&this.toggleByElement(e);else if(2===s&&this.toggleByMid)for(const[e,t]of i)for(const i of t)this.toggleByMid(e,i)}};let o=!1;const r=e=>{o||((0,v.Z)(),o=!0);const t=this.getElementFromTarget(e.target);if(t)return this.verifyMouseMoveTarget&&!this.verifyMouseMoveTarget(e,t,s)?(this.listenerSetter.removeManual(this.listenElement,"mousemove",r),void this.listenerSetter.removeManual(document,"mouseup",d,l)):void a(t)},d=e=>{i.size&&(0,S.fc)(window,g.Z,{capture:!0,once:!0,passive:!1}),this.listenerSetter.removeManual(this.listenElement,"mousemove",r),(0,v.Z)()},l={once:!0};this.listenerSetter.add(this.listenElement)("mousemove",r),this.listenerSetter.add(document)("mouseup",d,l)},this.getElementsBetween=(e,t)=>{if(e===t)return[];const i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),n=(i.top-s.top||i.left-s.left)<0,a=(0,f.Z)(e,this.lookupBetweenParentClassName);if(!a)return[];const o=Array.from(a.querySelectorAll(this.lookupBetweenElementsQuery));let r=o.indexOf(e),d=o.indexOf(t);return n||([d,r]=[r,d]),o.slice(r+1,d)},this.cancelSelection=e=>M(this,void 0,void 0,(function*(){e&&(this.doNotAnimate=!0),this.onCancelSelection&&(yield this.onCancelSelection()),this.selectedMids.clear(),this.toggleSelection(),(0,v.Z)(),e&&(this.doNotAnimate=void 0)})),(0,I.Z)(this,e),this.navigationType="multiselect-"+(0,w.a)()}attachListeners(e,t){if(this.listenElement&&this.listenerSetter.removeAll(),this.listenElement=e,this.listenerSetter=t,e)return s.Z?(t.add(e)("touchend",(()=>{this.isSelecting&&(this.selectedText=window.getSelection?window.getSelection().toString():document.selection?document.selection.createRange().text:"")})),void(0,E.E)({element:e,callback:t=>{if(this.isSelecting||this.verifyTouchLongPress&&!this.verifyTouchLongPress())return;document.body.classList.add("no-select"),e.addEventListener("touchend",(e=>{(0,g.Z)(e),document.body.classList.remove("no-select")}),{once:!0,capture:!0}),(0,v.Z)();const i=this.getElementFromTarget(t.target);i&&this.toggleByElement(i)},listenerSetter:t})):void t.add(e)("mousedown",this.onMouseDown)}isElementShouldBeSelected(e){return this.isMidSelected(e.dataset.peerId.toPeerId(),+e.dataset.mid)}appendCheckbox(e,t){e.prepend(t.label)}toggleElementCheckbox(e,t){const i=!!this.getCheckboxInputFromElement(e);if(t){if(i)return!1;const t=new o.Z({name:e.dataset.mid,round:!0});this.isSelecting&&this.isElementShouldBeSelected(e)&&(t.input.checked=!0,e.classList.add("is-selected")),this.appendCheckbox(e,t)}else i&&(this.getCheckboxInputFromElement(e).parentElement.remove(),(0,l.Z)({element:e,className:"is-selected",forwards:!1,duration:200}));return!0}getCheckboxInputFromElement(e){var t;return"LABEL"===(null===(t=e.firstElementChild)||void 0===t?void 0:t.tagName)&&e.firstElementChild.firstElementChild}updateContainer(e=!1){var t;return M(this,void 0,void 0,(function*(){const i=this.selectedMids.size;if(!i&&!e)return;let s=!i,n=!i;const a=!i;for(const[e,t]of this.selectedMids){const i=this.getStorageKey(e),a=yield this.managers.appMessagesManager.cantForwardDeleteMids(i,Array.from(t));if(s=a.cantForward,n=a.cantDelete,s&&n)break}null===(t=this.onUpdateContainer)||void 0===t||t.call(this,s,n,a)}))}getStorageKey(e){return`${e}_${this.isScheduled?"scheduled":"history"}`}getSelectedMessages(){const e=[];return this.selectedMids.forEach(((t,i)=>{const s=this.getStorageKey(i),n=Array.from(t).map((e=>this.managers.appMessagesManager.getMessageFromStorage(s,e)));e.push(...n)})),Promise.all(e)}toggleSelection(e=!0,t=!1){var i;const n=this.isSelecting,a=this.selectedMids.size;if(this.isSelecting=!!a||t,n===this.isSelecting)return!1;this.dispatchEvent("toggle",this.isSelecting),s.Z||(this.listenElement.classList.toggle("no-select",this.isSelecting),n&&(0,v.Z)()),(0,m.Z)();const o=!!a||t,r=null===(i=this.onToggleSelection)||void 0===i?void 0:i.call(this,o,!this.doNotAnimate);return u.IS_MOBILE_SAFARI||(o?h.Z.pushItem({type:this.navigationType,onPop:()=>{this.cancelSelection()}}):h.Z.removeByType(this.navigationType)),t&&(r||Promise.resolve()).then((()=>this.updateContainer(t))),!0}cleanup(){this.doNotAnimate=!0,this.selectedMids.clear(),this.toggleSelection(!1),this.doNotAnimate=void 0}updateElementSelection(e,t){this.toggleElementCheckbox(e,!0),this.getCheckboxInputFromElement(e).checked=t,this.toggleSelection(),this.updateContainer(),(0,l.Z)({element:e,className:"is-selected",forwards:t,duration:200})}isMidSelected(e,t){const i=this.selectedMids.get(e);return!!(null==i?void 0:i.has(t))}length(){return T(this.selectedMids)}toggleMid(e,t,i){let s=this.selectedMids.get(e);return i||void 0===i&&(null==s?void 0:s.has(t))?s&&(s.delete(t),s.size||this.selectedMids.delete(e)):(s||(s=new Set,this.selectedMids.set(e,s)),s.add(t)),!0}deleteSelectedMids(e,t){const i=this.selectedMids.get(e);i&&(t.forEach((e=>{i.delete(e)})),i.size||this.selectedMids.delete(e),this.updateContainer(),this.toggleSelection())}}class x extends k{constructor(e,t,i){super({managers:t,verifyTarget:(e,t)=>!!t&&this.isSelecting,getElementFromTarget:e=>(0,f.Z)(e,"search-super-item"),targetLookupClassName:"search-super-item",lookupBetweenParentClassName:"tabs-tab",lookupBetweenElementsQuery:".search-super-item"}),this.searchSuper=e,this.toggleByElement=e=>{const t=+e.dataset.mid,i=e.dataset.peerId.toPeerId();this.toggleMid(i,t)&&this.updateElementSelection(e,this.isMidSelected(i,t))},this.toggleByMid=(e,t)=>{const i=this.searchSuper.mediaTab.contentTab.querySelector(`.search-super-item[data-peer-id="${e}"][data-mid="${t}"]`);this.toggleByElement(i)},this.onUpdateContainer=(e,t,i)=>{const s=this.length();(0,b.Z)(this.selectionCountEl,(0,p.ag)("messages",[s])),this.selectionGotoBtn.classList.toggle("hide",1!==s),this.selectionForwardBtn.classList.toggle("hide",e),this.selectionDeleteBtn&&this.selectionDeleteBtn.classList.toggle("hide",t)},this.onToggleSelection=(e,t)=>{if((0,l.Z)({element:this.searchSuper.navScrollableContainer,className:"is-selecting",forwards:e,duration:t?200:0,onTransitionEnd:()=>{this.isSelecting||(this.selectionContainer.remove(),this.selectionContainer=this.selectionForwardBtn=this.selectionDeleteBtn=null,this.selectedText=void 0)}}),(0,l.Z)({element:this.searchSuper.container,className:"is-selecting",forwards:e,duration:200}),this.isSelecting&&!this.selectionContainer){const e="search-super-selection";this.selectionContainer=document.createElement("div"),this.selectionContainer.classList.add(e+"-container");const t=(0,a.Z)(`close ${e}-cancel`,{noRipple:!0});(0,S.fc)(t,(()=>this.cancelSelection()),{listenerSetter:this.listenerSetter,once:!0}),this.selectionCountEl=document.createElement("div"),this.selectionCountEl.classList.add(e+"-count"),this.selectionGotoBtn=(0,a.Z)(`message ${e}-goto`);const i={listenerSetter:this.listenerSetter};(0,S.fc)(this.selectionGotoBtn,(()=>{const e=[...this.selectedMids.keys()][0],t=[...this.selectedMids.get(e)][0];this.cancelSelection(),P.ZP.setInnerPeer({peerId:e,lastMsgId:t})}),i),this.selectionForwardBtn=(0,a.Z)(`forward ${e}-forward`),(0,S.fc)(this.selectionForwardBtn,(()=>{const e={};for(const[t,i]of this.selectedMids)e[t]=Array.from(i).sort(((e,t)=>e-t));Z.Z.createPopup(d.Z,e,(()=>{this.cancelSelection()}))}),i),this.isPrivate&&(this.selectionDeleteBtn=(0,a.Z)(`delete danger ${e}-delete`),(0,S.fc)(this.selectionDeleteBtn,(()=>{const e=[...this.selectedMids.keys()][0];Z.Z.createPopup(r.Z,e,[...this.selectedMids.get(e)],"chat",(()=>{this.cancelSelection()}))}),i)),this.selectionContainer.append(...[t,this.selectionCountEl,this.selectionGotoBtn,this.selectionForwardBtn,this.selectionDeleteBtn].filter(Boolean));const s=this.selectionContainer;s.style.opacity="0",this.searchSuper.navScrollableContainer.append(s),s.offsetLeft,s.style.opacity=""}},this.isPrivate=!e.showSender,this.attachListeners(e.container,i)}toggleSelection(e=!0,t=!1){const i=super.toggleSelection(e,t);return i&&e&&Array.from(this.searchSuper.tabsContainer.querySelectorAll(".search-super-item")).forEach((e=>{this.toggleElementCheckbox(e,this.isSelecting)})),i}}class A extends k{constructor(e,t,i,s){super({managers:s,getElementFromTarget:e=>(0,f.Z)(e,"grouped-item")||(0,f.Z)(e,"bubble"),verifyTarget:(e,t)=>!(!this.selectedMids.size&&!e.target.classList.contains("bubble")&&!e.target.classList.contains("document-selection")&&t),verifyMouseMoveTarget:(e,t,i)=>!(e.target!==t&&!e.target.classList.contains("document-selection")&&void 0===i&&!this.selectedMids.size),verifyTouchLongPress:()=>!this.chat.input.recording,targetLookupClassName:"bubble",lookupBetweenParentClassName:"bubbles-inner",lookupBetweenElementsQuery:".bubble:not(.is-multiple-documents), .grouped-item",isScheduled:"scheduled"===e.type}),this.chat=e,this.bubbles=t,this.input=i,this.toggleByElement=e=>{if(!this.canSelectBubble(e))return;const t=+e.dataset.mid;if(e.classList.contains("is-grouped")){if(!this.isGroupedBubbleSelected(e)){const t=this.selectedMids.get(this.chat.peerId);t&&this.getMidsFromGroupContainer(e).forEach((e=>t.delete(e)))}this.bubbles.getBubbleGroupedItems(e).map(this.toggleByElement)}else if(this.toggleMid(this.chat.peerId,t)){if(e.classList.contains("grouped-item")){const t=(0,f.Z)(e,"bubble"),i=this.isGroupedBubbleSelected(t),s=this.isGroupedMidsSelected(t);(s||i)&&this.updateElementSelection(t,s)}this.updateElementSelection(e,this.isMidSelected(this.chat.peerId,t))}},this.toggleByMid=(e,t)=>M(this,void 0,void 0,(function*(){const e=yield this.bubbles.getMountedBubble(t);e&&this.toggleByElement(e.bubble)})),this.onToggleSelection=(e,t)=>M(this,void 0,void 0,(function*(){const{needTranslateX:i,widthFrom:s,widthTo:o}=yield this.chat.input.center(t);(0,l.Z)({element:this.listenElement,className:"is-selecting",forwards:e,duration:t?200:0,onTransitionEnd:()=>{this.isSelecting||(this.selectionInputWrapper.remove(),this.selectionInputWrapper=this.selectionContainer=this.selectionSendNowBtn=this.selectionForwardBtn=this.selectionDeleteBtn=this.selectionLeft=this.selectionRight=null,this.selectedText=void 0)}});const h=sthis.cancelSelection()),{once:!0,listenerSetter:this.listenerSetter}),this.selectionCountEl=document.createElement("div"),this.selectionCountEl.classList.add("selection-container-count"),"scheduled"===this.chat.type?(this.selectionSendNowBtn=(0,n.Z)("btn-primary btn-transparent btn-short text-bold selection-container-send",{icon:"send2"}),this.selectionSendNowBtn.append((0,p.ag)("MessageScheduleSend")),(0,S.fc)(this.selectionSendNowBtn,(()=>{Z.Z.createPopup(c.Z,this.chat.peerId,[...this.selectedMids.get(this.chat.peerId)],(()=>{this.cancelSelection()}))}),e)):(this.selectionForwardBtn=(0,n.Z)("btn-primary btn-transparent text-bold selection-container-forward",{icon:"forward"}),this.selectionForwardBtn.append((0,p.ag)("Forward")),(0,S.fc)(this.selectionForwardBtn,(()=>{const e={};for(const[t,i]of this.selectedMids)e[t]=Array.from(i).sort(((e,t)=>e-t));Z.Z.createPopup(d.Z,e,(()=>{this.cancelSelection()}))}),e)),this.selectionDeleteBtn=(0,n.Z)("btn-primary btn-transparent danger text-bold selection-container-delete",{icon:"delete"}),this.selectionDeleteBtn.append((0,p.ag)("Delete")),(0,S.fc)(this.selectionDeleteBtn,(()=>{Z.Z.createPopup(r.Z,this.chat.peerId,[...this.selectedMids.get(this.chat.peerId)],this.chat.type,(()=>{this.cancelSelection()}))}),e);const i=this.selectionLeft=document.createElement("div");i.classList.add("selection-container-left"),i.append(t,this.selectionCountEl);const s=this.selectionRight=document.createElement("div");s.classList.add("selection-container-right"),s.append(...[this.selectionSendNowBtn,this.selectionForwardBtn,this.selectionDeleteBtn].filter(Boolean)),void 0!==h&&(i.style.transform=`translateX(${-h}px)`,s.style.transform=`translateX(${h}px)`),this.selectionContainer.append(i,s),this.selectionInputWrapper.style.opacity="0",this.selectionInputWrapper.append(this.selectionContainer),this.input.inputContainer.append(this.selectionInputWrapper),this.selectionInputWrapper.offsetLeft,this.selectionInputWrapper.style.opacity=""}this.selectionLeft.style.transform="",this.selectionRight.style.transform=""}else this.selectionLeft&&void 0!==h&&(this.selectionLeft.style.transform=`translateX(-${h}px)`,this.selectionRight.style.transform=`translateX(${h}px)`)})),this.onUpdateContainer=(e,t,i)=>{(0,b.Z)(this.selectionCountEl,(0,p.ag)("messages",[this.length()])),this.selectionSendNowBtn&&this.selectionSendNowBtn.toggleAttribute("disabled",i),this.selectionForwardBtn&&this.selectionForwardBtn.toggleAttribute("disabled",e),this.selectionDeleteBtn&&this.selectionDeleteBtn.toggleAttribute("disabled",t)},this.onCancelSelection=()=>M(this,void 0,void 0,(function*(){}))}appendCheckbox(e,t){t.label.classList.add("bubble-select-checkbox"),e.classList.contains("document-container")?e.querySelector(".document, audio-element").append(t.label):super.appendCheckbox(e,t)}toggleSelection(e=!0,t=!1){const i=super.toggleSelection(e,t);if(i&&e)for(const e in this.bubbles.bubbles){if(this.bubbles.skippedMids.has(+e))continue;const t=this.bubbles.bubbles[e];this.toggleElementCheckbox(t,this.isSelecting)}return i}toggleElementCheckbox(e,t){if(!this.canSelectBubble(e))return;const i=super.toggleElementCheckbox(e,t);return i&&e.classList.contains("is-grouped")&&this.bubbles.getBubbleGroupedItems(e).forEach((e=>this.toggleElementCheckbox(e,t))),i}isElementShouldBeSelected(e){const t=e.classList.contains("is-grouped");return super.isElementShouldBeSelected(e)&&(!t||this.isGroupedMidsSelected(e))}isGroupedBubbleSelected(e){const t=this.getCheckboxInputFromElement(e);return null==t?void 0:t.checked}getMidsFromGroupContainer(e){const t=this.chat.bubbles.getBubbleGroupedItems(e);return t.length||t.push(e),t.map((e=>+e.dataset.mid))}isGroupedMidsSelected(e){const t=this.getMidsFromGroupContainer(e),i=t.filter((e=>this.isMidSelected(this.chat.peerId,e)));return t.length===i.length}getCheckboxInputFromElement(e){return e.classList.contains("document-container")?e.querySelector("label input"):super.getCheckboxInputFromElement(e)}canSelectBubble(e){return!(e.classList.contains("service")||e.classList.contains("is-outgoing")||e.classList.contains("is-error")||e.classList.contains("bubble-first")||e.classList.contains("avoid-selection"))}}},6676:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(3416),n=i(6976),a=i(3910),o=i(3512),r=i(3003);class d{constructor(e){this.sendMenuButtons=[{icon:"mute",text:"Chat.Send.WithoutSound",onClick:e.onSilentClick,verify:()=>"schedule"===this.type},{icon:"schedule",text:"Chat.Send.ScheduledMessage",onClick:e.onScheduleClick,verify:()=>"schedule"===this.type},{icon:"schedule",text:"Chat.Send.SetReminder",onClick:e.onScheduleClick,verify:()=>"reminder"===this.type}],this.sendMenu=(0,r.b)({buttons:this.sendMenuButtons,listenerSetter:e.listenerSetter}),this.sendMenu.classList.add("menu-send",e.openSide),(0,n.E)({element:e.onContextElement,callback:t=>{e.onOpen&&!e.onOpen()||(this.sendMenuButtons.forEach((e=>{e.element.classList.toggle("hide",!e.verify())})),(0,a.Z)(t),s.Z.openBtnMenu(this.sendMenu))},listenerSetter:e.listenerSetter})}setPeerId(e){this.type=e===o.Z.myId?"reminder":"schedule"}}},9807:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var s=i(1405),n=i(2325),a=i(9750),o=i(3512),r=i(3855),d=i(6669);class l{constructor(e={}){const t=this.label=document.createElement("label");t.classList.add("checkbox-field"),e.restriction&&!e.toggle&&t.classList.add("checkbox-field-restriction"),e.round&&t.classList.add("checkbox-field-round"),e.disabled&&this.toggleDisability(!0),this.listenerSetter=e.listenerSetter;const i=this.input=document.createElement("input");if(i.classList.add("checkbox-field-input"),i.type=e.asRadio?"radio":"checkbox",e.name&&(i[e.asRadio?"name":"id"]="input-"+e.name),e.checked&&(i.checked=!0),e.stateKey){let t=!1;const s=()=>{if(!t)return;let s;e.stateValues?s=e.stateValues[i.checked?1:0]:(s=i.checked,e.stateValueReverse&&(s=!s)),o.Z.managers.appStateManager.setByKey(e.stateKey,s)};void 0===e.checked&&r.Z.getState().then((i=>{t=!0;const s=(0,a.Z)(i,e.stateKey);let n;e.stateValues?n=1===e.stateValues.indexOf(s):(n=s,e.stateValueReverse&&(n=!n)),this.setValueSilently(n)})),e.listenerSetter?e.listenerSetter.add(i)("change",s):i.addEventListener("change",s)}let d;if(e.text?(d=this.span=document.createElement("span"),d.classList.add("checkbox-caption"),(0,n.$d)(d,e.text,e.textArgs)):t.classList.add("checkbox-without-caption"),t.append(i),e.toggle){t.classList.add("checkbox-field-toggle"),e.restriction&&t.classList.add("checkbox-field-toggle-restriction");const i=document.createElement("div");i.classList.add("checkbox-toggle"),t.append(i)}else{const e=document.createElement("div");e.classList.add("checkbox-box");const i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.classList.add("checkbox-box-check"),i.setAttributeNS(null,"viewBox","0 0 24 24");const s=document.createElementNS("http://www.w3.org/2000/svg","use");s.setAttributeNS(null,"href","#check"),s.setAttributeNS(null,"x","-1"),i.append(s);const n=document.createElement("div");n.classList.add("checkbox-box-background");const a=document.createElement("div");a.classList.add("checkbox-box-border"),e.append(a,n,i),t.append(e)}d&&t.append(d),e.withRipple?(t.classList.add("checkbox-ripple","hover-effect"),(0,s.Z)(t,void 0,void 0,!0)):e.withHover&&t.classList.add("hover-effect")}get checked(){return this.input.checked}set checked(e){this.setValueSilently(e),(0,d.Z)(this.input,"change")}setValueSilently(e){this.input.checked=e}isDisabled(){return this.label.classList.contains("checkbox-disabled")}toggleDisability(e){return this.label.classList.toggle("checkbox-disabled",e),this.input.disabled=e,()=>this.toggleDisability(!e)}}},8610:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(3910),n=i(2738),a=i(5975),o=i(5953),r=i(2325),d=i(9807),l=i(7479),c=i(2796);class h{constructor(e){(0,o.Z)(this,e)}createField(e,t){var i;if(e.nestedTo&&!t)return;const o=e.row=new l.ZP({titleLangKey:t?void 0:e.text,checkboxField:e.checkboxField=new d.Z({text:t?e.text:void 0,checked:!e.nested&&e.checked,toggle:!t,listenerSetter:this.listenerSetter,restriction:this.asRestrictions&&!t,name:e.name}),listenerSetter:this.listenerSetter,subtitleLangKey:e.description,clickable:e.nested?e=>{(0,a.Z)(e.target,o.checkboxField.label)||((0,s.Z)(e),o.container.classList.toggle("accordion-toggler-expanded"),u.classList.toggle("is-expanded"))}:void 0});e.restrictionText&&(e.checkboxField.input.disabled=!0,(0,n.fc)(e.checkboxField.label,(t=>{(0,c.Am)(r.ZP.format(e.restrictionText,!0))}),{listenerSetter:this.listenerSetter}));const h=[o.container];let u,p;if(e.nested){const t=u=document.createElement("div");t.classList.add("accordion"),t.style.setProperty("--max-height",48*e.nested.length+"px");const s=e;e.nested.forEach((e=>{var i;null!==(i=e.nestedTo)&&void 0!==i||(e.nestedTo=s),t.append(...this.createField(e,!0).nodes)})),h.push(t);const n=document.createElement("span");n.classList.add("tgico-down","accordion-icon"),p=e.nestedCounter=document.createElement("b"),this.setNestedCounter(e),o.title.append(" ",p," ",n),o.container.classList.add("accordion-toggler"),o.titleRow.classList.add("with-delimiter"),o.checkboxField.setValueSilently(this.getNestedCheckedLength(e)===e.nested.length),null!==(i=e.toggleWith)&&void 0!==i||(e.toggleWith={checked:e.nested,unchecked:e.nested})}if(e.toggleWith||e.nestedTo){const t=e.toggleWith?e=>{const{toggleWith:i,nested:s}=e,n=e.checkboxField.checked,a=n?i.checked:i.unchecked;a&&(this.fields.filter((e=>a.includes(e))).forEach((e=>{e.checkboxField.setValueSilently(n),e.nestedTo&&!s&&this.setNestedCounter(e.nestedTo),e.toggleWith&&t(e)})),e.nested&&this.setNestedCounter(e))}:void 0,i=e.nestedTo?()=>{const t=this.getNestedCheckedLength(e.nestedTo);e.nestedTo.checkboxField.setValueSilently(t===e.nestedTo.nested.length),this.setNestedCounter(e.nestedTo,t)}:void 0;this.listenerSetter.add(e.checkboxField.input)("change",(()=>{null==t||t(e),null==i||i()}))}return{row:o,nodes:h}}getNestedCheckedLength(e){return e.nested.reduce(((e,t)=>e+ +t.checkboxField.checked),0)}setNestedCounter(e,t=this.getNestedCheckedLength(e)){e.nestedCounter.textContent=`${t}/${e.nested.length}`}}},4489:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(503);class n extends s.ZP{constructor(e){super(Object.assign(e,{plainText:!0})),this.options=e;const t=this.input;t.type="tel",t.setAttribute("required",""),t.autocomplete="off";let i=0;this.input.addEventListener("input",(t=>{this.input.classList.remove("error"),this.setLabel();const s=this.value.replace(/\D/g,"").slice(0,e.length);this.setValueSilently(s);const n=this.value.length;if(n===e.length)e.onFill(this.value);else if(n===i)return;i=n}))}}},5592:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(1168),n=i(8127);function a(e){return new Promise(((t,i)=>{var a;const{button:o,checkbox:r}=e;o.callback=i=>{t(r||!i?i?!!i.size:void 0:e.checkboxes.map((e=>i.has(e.text))))};const d=(0,s.x)(e.buttons||[o]),l=d.find((e=>e.isCancel));l.callback=()=>{i()},e.buttons=d,null!==(a=e.checkboxes)&&void 0!==a||(e.checkboxes=r&&[r]),s.Z.createPopup(n.Z,"popup-confirmation",e).show()}))}},5431:(e,t,i)=>{"use strict";i.d(t,{Z:()=>S});var s=i(9976),n=i(3910),a=i(8497),o=i(4668),r=i(5565),d=i(130),l=i(4789),c=i(144),h=i(2325),u=i(8115),p=i(3512),f=i(671),m=i(503),g=i(8805);let v;const b=()=>{v=h.ZP.countriesList.filter((e=>{var t;return!(null===(t=e.pFlags)||void 0===t?void 0:t.hidden)})).sort(((e,t)=>(e.name||e.default_name).localeCompare(t.name||t.default_name)))};let y=()=>{b(),p.Z.addEventListener("language_change",(()=>{b()}))};const w=new Set(["FT"]);class S extends m.ZP{constructor(e={}){super(Object.assign({label:"Country",name:(0,c.a)()},e)),this.options=e,this.hidePicker=()=>{void 0===this.hideTimeout&&(this.selectWrapper.classList.remove("active"),this.hideTimeout=window.setTimeout((()=>{this.selectWrapper.classList.add("hide"),this.hideTimeout=void 0}),200))},this.selectCountryByTarget=e=>{var t,i;const s=e.querySelector("[data-default-name]").dataset.defaultName,n=e.querySelector(".phone-code"),a=null==n?void 0:n.innerText,o=a&&a.replace(/\D/g,"");(0,r.Z)(this.input,(0,h.ag)(s)),this.simulateInputEvent(),this.lastCountrySelected=v.find((e=>e.default_name===s)),this.lastCountryCodeSelected=o&&this.lastCountrySelected.country_codes.find((e=>e.country_code===o)),null===(i=(t=this.options).onCountryChange)||void 0===i||i.call(t,this.lastCountrySelected,this.lastCountryCodeSelected),this.hidePicker()},y&&(y(),y=void 0),this.liMap=new Map,this.container.classList.add("input-select");const t=this.selectWrapper=document.createElement("div");t.classList.add("select-wrapper","z-depth-3","hide");const i=document.createElement("span");i.classList.add("arrow","arrow-down"),this.container.append(i);const p=document.createElement("ul");t.appendChild(p),new g.ZP(t);let m=()=>{m=null,v.forEach((t=>{if(e.noPhoneCodes&&w.has(t.iso2))return;const i=(0,f.Ml)(t.iso2),n=[];for(let a=0,o=Math.min(t.country_codes.length,e.noPhoneCodes?1:1/0);a{if(0!==e.button)return;const t=(0,o.Z)(e.target,"LI");this.selectCountryByTarget(t)})),this.container.appendChild(t)};m(),this.input.addEventListener("focus",(e=>{m?m():v.forEach((e=>{const t=this.liMap.get(e.iso2);t&&t.forEach((e=>e.style.display=""))})),clearTimeout(this.hideTimeout),this.hideTimeout=void 0,t.classList.remove("hide"),t.offsetWidth,t.classList.add("active"),this.select(),(0,l.Z)({container:(0,a.Z)(this.container,"scrollable-y"),element:this.input,position:"start",margin:4}),setTimeout((()=>{b||(document.addEventListener("mousedown",S,{capture:!0}),b=!0)}),0)}));let b=!1;const S=e=>{(0,a.Z)(e.target,"input-select")||e.target!==this.input&&(this.hidePicker(),document.removeEventListener("mousedown",S,{capture:!0}),b=!1)},C=e=>{const t=e.key;if(e.ctrlKey||"Control"===t)return!1;const i=this.value.toLowerCase(),s=[];v.forEach((e=>{const t=this.liMap.get(e.iso2);if(!t)return;const n=[e.name,e.default_name,e.iso2];n.filter(Boolean).forEach((e=>{const t=e.split(" ").filter((e=>/\w/.test(e))).map((e=>e[0])).join("");t.length>1&&n.push(t)}));const a=!!n.filter(Boolean).find((e=>-1!==e.toLowerCase().indexOf(i)));t.forEach((e=>e.style.display=a?"":"none")),a&&s.push(e)})),0===s.length?v.forEach((e=>{const t=this.liMap.get(e.iso2);t&&t.forEach((e=>e.style.display=""))})):1===s.length&&"Enter"===t&&((0,n.Z)(e),this.selectCountryByTarget(this.liMap.get(s[0].iso2)[0]))};this.input.addEventListener("keyup",C),this.input.addEventListener("keydown",(e=>{"Enter"===e.key&&C(e)})),i.addEventListener("mousedown",(e=>{this.input.matches(":focus")?(this.hidePicker(),this.input.blur()):(e.cancelBubble=!0,e.preventDefault(),this.input.focus())}))}getSelected(){return{country:this.lastCountrySelected,code:this.lastCountryCodeSelected}}selectCountryByIso2(e){this.selectCountryByTarget(this.liMap.get(e)[0])}override(e,t,i){var s,n;(0,r.Z)(this.input,e?(0,h.ag)(e.default_name):i),this.lastCountrySelected=e,this.lastCountryCodeSelected=t,null===(n=(s=this.options).onCountryChange)||void 0===n||n.call(s,this.lastCountrySelected,this.lastCountryCodeSelected)}}},4561:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(130);class n{constructor(e,t){this.className=e,this.fill=t,this.container=document.createElement("div"),this.container.className=e,this.border=document.createElement("div"),this.border.classList.add(e+"-border"),this.content=document.createElement("div"),this.content.classList.add(e+"-content"),this.title=document.createElement("div"),this.title.classList.add(e+"-title"),(0,s.m)(this.title),this.subtitle=document.createElement("div"),this.subtitle.classList.add(e+"-subtitle"),(0,s.m)(this.subtitle),this.content.append(this.title,this.subtitle),this.container.append(this.border,this.content)}}},6628:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(4762),n=i(5296),a=i(5994),o=i(3228),r=i(5814);class d{constructor(e,t,i){this.width=e,this.height=t,this.multiply=i,this.loop=!0;const s=this.canvas=document.createElement("canvas"),n=this.dpr=window.devicePixelRatio;s.width=e*n,s.height=t*n,s.classList.add("canvas-thumbnail","canvas-dots"),this.paused=!0,this.autoplay=!0,this.tempId=0,this.context=s.getContext("2d")}prepare(){let e=Math.round(this.width*this.height/(35*(s.IS_MOBILE?2:1)));e*=this.multiply||1,e=Math.min(a.Z.isAvailable("chat_spoilers")?s.IS_MOBILE?1e3:2200:400,e),e=Math.round(e);const t=this.dots=new Array(e);for(let i=0;i=.8?1:.5)*this.dpr,a=new Path2D;return a.arc(t,i,n,0,2*Math.PI,!1),{x:t,y:i,opacity:s,radius:n,mOpacity:s,adding:null!=e?e:Math.random()>=.5,counter:0,path:a}}draw(){const{context:e,canvas:t,dots:i}=this;e.clearRect(0,0,t.width,t.height),e.fillStyle="#fff";for(let t=0,s=i.length;t=1&&(i[t]=this.generateDot(s.adding))):s.mOpacity>=1&&(s.adding=!1)}}remove(){this.pause()}pause(){this.paused||(this.paused=!0,++this.tempId)}renderFirstFrame(){this.dots||this.prepare(),this.draw()}play(){if(!this.paused)return;this.paused=!1;const e=++this.tempId;this.dots||this.prepare(),(0,n.jt)((()=>this.tempId===e&&!this.paused&&(this.draw(),!0)))}static create({width:e,height:t,middleware:i,animationGroup:s,multiply:n}){const a=new d(e,t,n);return a.renderFirstFrame(),r.Z.addAnimation({animation:a,group:s,observeElement:a.canvas,controlled:i}),a}}},2621:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(187),n=i(9331),a=i(8119),o=i(5953),r=i(1507);class d{constructor(e){this._disabled=!1,this.avatarSize=120,this.isChanged=()=>{if(this.uploadAvatar)return!0;let e=0,t=0,i=0;return this.inputFields.forEach((s=>{s.isValid()&&(s.isChanged()&&++e,s.required&&++i),s.required&&++t})),t===i&&e>0},this.handleChange=()=>{this.nextBtn.classList.toggle("is-visible",this.isChanged())},(0,o.Z)(this,e),this.peerId||(this.peerId=r.NM),this.nextBtn?this.nextBtn.classList.contains("btn-corner")||(this.handleChange=()=>{this.nextBtn.toggleAttribute("disabled",!this.isChanged()||this.disabled)}):this.nextBtn=(0,a.Z)({icon:"check"}),e.withoutAvatar||(this.avatarElem=new n.Z,this.avatarElem.classList.add("avatar-placeholder","avatar-"+this.avatarSize),this.avatarElem.updateWithOptions({peerId:this.peerId}),e.doNotEditAvatar||(this.avatarEdit=new s.Z((e=>{this.uploadAvatar=e,this.handleChange(),this.avatarElem.remove()}),e.popupOptions),this.avatarEdit.container.append(this.avatarElem))),this.inputFields.forEach((e=>{this.listenerSetter.add(e.input)("input",this.handleChange)})),this.handleChange()}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this.inputFields.forEach((t=>t.input.toggleAttribute("disabled",e))),this.handleChange()}lockWithPromise(e,t=!1){this.disabled=!0,e.then((()=>{t&&(this.disabled=!1)}),(()=>{this.disabled=!1}))}}},3173:(e,t,i)=>{"use strict";i.d(t,{Yd:()=>ee,Jo:()=>ie,ZP:()=>ne});var s=i(5432),n=i(7030),a=i(3512),o=i(5814),r=i(6008),d=i(2153),l=i(4332),c=i(5117),h=i(6039),u=i(1080),p=i(8805),f=i(279),m=i(2738);class g{constructor(e){this.managers=e}init(){this.content=document.getElementById("content-gifs");const e=this.content.firstElementChild;(0,m.fc)(e,ie.onMediaClick);const t=this.scrollable=new p.ZP(this.content,"GIFS"),i=new u.Z(e,ee,t),s=(0,f.y)(this.content,!0);this.managers.appDocsManager.getGifs().then((e=>{e.forEach((e=>{i.add(e)})),s.remove()})),ne.addLazyLoadQueueRepeat(i.lazyLoadQueue,i.processInvisibleDiv),this.init=null}onClose(){}}var v=i(6057),b=i(410),y=i(3552),w=i(3607),S=i(4755),C=i(8497),L=i(1507),I=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const E="GIFS-SEARCH";class P extends y._{constructor(){super(...arguments),this.nextOffset="",this.loadedAll=!1,this.onGifsClick=e=>I(this,void 0,void 0,(function*(){const t=(0,C.Z)(e.target,"gif");if(!t)return;const i=t.dataset.docId;(yield n.ZP.chat.input.sendMessageWithDocument(i))?S.Z.isMobile&&l.ZP.onCloseBtnClick():console.warn("got no doc by id:",i)}))}init(){this.container.id="search-gifs-container",this.inputSearch=new w.Z("SearchGifsTitle",(e=>{this.reset(),this.search(e)})),this.title.replaceWith(this.inputSearch.container),this.gifsDiv=document.createElement("div"),this.gifsDiv.classList.add("gifs-masonry"),(0,m.fc)(this.gifsDiv,this.onGifsClick,{listenerSetter:this.listenerSetter}),this.scrollable.append(this.gifsDiv),this.masonry=new u.Z(this.gifsDiv,E,this.scrollable),l.ZP.toggleSidebar(!0).then((()=>{this.search("",!0),this.scrollable.onScrolledBottom=()=>{this.search(this.inputSearch.value,!1)}}))}onClose(){this.scrollable.onScrolledBottom=()=>{}}onCloseAfterTimeout(){return this.reset(),this.gifsDiv.innerHTML="",o.Z.checkAnimations(void 0,E),this.inputSearch.remove(),super.onCloseAfterTimeout()}reset(){this.searchPromise=null,this.nextOffset="",this.loadedAll=!1,this.masonry.clear()}search(e,t=!0){return I(this,void 0,void 0,(function*(){if(!this.searchPromise&&!this.loadedAll){this.gifBotPeerId||(this.gifBotPeerId=(yield this.managers.appUsersManager.resolveUsername("gif")).id.toPeerId(!1));try{this.searchPromise=this.managers.appInlineBotsManager.getInlineResults(L.NM,this.gifBotPeerId,e,this.nextOffset);const{results:i,next_offset:s}=yield this.searchPromise;if(this.inputSearch.value!==e)return;this.searchPromise=null,this.nextOffset=s,t&&(this.gifsDiv.innerHTML=""),i.length?i.forEach((e=>{"botInlineMediaResult"===e._&&e.document&&this.masonry.add(e.document)})):this.loadedAll=!0,this.scrollable.onScroll()}catch(e){throw this.searchPromise=null,console.error("gifs loading error:",e),e}}}))}}var Z=i(9298),M=i(2325),T=i(7625),k=i(130),x=i(8115),A=i(9259),_=i(3541),F=i(1168);class D extends y._{init(){this.container.id="stickers-container",this.container.classList.add("chatlist-container"),this.lazyLoadQueue=new d.Z,this.inputSearch=new w.Z("StickersTab.SearchPlaceholder",(e=>{this.search(e)})),this.title.replaceWith(this.inputSearch.container),this.setsDiv=document.createElement("div"),this.setsDiv.classList.add("sticker-sets"),this.scrollable.append(this.setsDiv),(0,A.Z)({listenTo:this.setsDiv,listenerSetter:this.listenerSetter}),(0,m.fc)(this.setsDiv,(e=>{const t=(0,C.Z)(e.target,"sticker-set-sticker");if(t){const e=t.dataset.docId;return void n.ZP.chat.input.sendMessageWithDocument(e)}const i=(0,C.Z)(e.target,"sticker-set");if(!i)return;const s=i.dataset.stickerSet,a=i.dataset.access_hash,o=(0,C.Z)(e.target,"sticker-set-button");o?(e.preventDefault(),e.cancelBubble=!0,o.setAttribute("disabled","true"),this.managers.appStickersManager.getStickerSet({id:s,access_hash:a}).then((e=>{this.managers.appStickersManager.toggleStickerSet(e.set).then((t=>{t&&(o.textContent="",o.append((0,M.ag)(e.set.installed_date?"Stickers.SearchAdded":"Stickers.SearchAdd")),o.classList.toggle("gray",!!e.set.installed_date))})).finally((()=>{o.removeAttribute("disabled")}))}))):this.managers.appStickersManager.getStickerSet({id:s,access_hash:a}).then((e=>{F.Z.createPopup(Z.Z,e.set).show()}))}),{listenerSetter:this.listenerSetter}),l.ZP.toggleSidebar(!0).then((()=>{this.renderFeatured()}))}onCloseAfterTimeout(){return this.setsDiv.innerHTML="",o.Z.checkAnimations(void 0,"STICKERS-SEARCH"),super.onCloseAfterTimeout()}renderSet(e){const t=document.createElement("div");t.classList.add("sticker-set");const i=document.createElement("div");i.classList.add("sticker-set-header");const s=document.createElement("div");s.classList.add("sticker-set-details"),s.innerHTML='
',(0,k.Z)(s.firstElementChild,(0,x.Z)(e.title));const n=document.createElement("div");n.classList.add("sticker-set-count"),n.append((0,M.ag)("Stickers",[e.count])),s.append(n);const a=document.createElement("button");a.classList.add("btn-primary","btn-color-primary","sticker-set-button"),a.append((0,M.ag)(e.installed_date?"Stickers.SearchAdded":"Stickers.SearchAdd")),e.installed_date&&a.classList.add("gray"),i.append(s,a);const o=document.createElement("div");o.classList.add("sticker-set-stickers");const r=Math.min(5,e.count);for(let e=0;e{for(let t=0;t{this.inputSearch.value||(e=this.filterRendered("",e)).forEach((e=>{this.renderSet(e.set)}))}))}filterRendered(e,t){t=t.slice();const i=Array.from(this.setsDiv.children);return(0,T.Z)(i,(i=>{const s=i.dataset.stickerSet,n=t.findIndex((e=>e.set.id===s));-1!==n?t.splice(n,1):e&&i.dataset.title.toLowerCase().includes(e.toLowerCase())||i.remove()})),o.Z.checkAnimations(void 0,"STICKERS-SEARCH"),t}search(e){return e?this.managers.appStickersManager.searchStickerSets(e,!1).then((t=>{this.inputSearch.value===e&&(t=this.filterRendered(e,t)).forEach((e=>{this.renderSet(e.set)}))})):this.renderFeatured()}}var R,B=i(4668),N=i(8799),O=i(2648),U=i(3910),H=i(6339),z=i(5418),j=i(4762),G=i(3815),V=i(319),K=i(4789),W=i(6802),$=i.n(W),q=i(669),Y=i(3299),Q=i(2796),X=i(8843),J=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const ee="emoticons-dropdown",te={forceDuration:200,transitionFunction:$()(.42,0,.58,1)};class ie extends H.Z{constructor(){super({element:document.getElementById("emoji-dropdown"),ignoreOutClickClassName:"input-message-input"}),this.tabId=-1,this.onSelectTabClick=e=>{if(this.tabId===e){const{tab:e}=this;return void this.scrollTo(e,e.scrollable.container.firstElementChild)}const t={[this.stickersTab.tabId]:"send_stickers",[this.gifsTab.tabId]:"send_gifs"}[e];if(t&&!this.rights[t])return(0,Q.bC)({langPackKey:X.m[t]}),!1;o.Z.checkAnimations(!0,ee),this.tabId=e,this.searchButton.classList.toggle("hide",this.tabId===this.emojiTab.tabId),this.deleteBtn.classList.toggle("hide",this.tabId!==this.emojiTab.tabId)},this.checkRights=()=>J(this,void 0,void 0,(function*(){const{peerId:e,threadId:t}=n.ZP.chat,i=Object.keys(this.rights),s=yield Promise.all(i.map((i=>this.managers.appMessagesManager.canSendToPeer(e,t,i))));i.forEach(((e,t)=>{this.rights[e]=s[t]}));const a=this.tabsEl.querySelector(".active");!a||(0,O.Z)(a)===this.emojiTab.tabId+1||this.rights.send_stickers&&this.rights.send_gifs||this.selectTab(this.emojiTab.tabId,!1)})),this.rights={send_gifs:void 0,send_stickers:void 0},this.addEventListener("open",(()=>J(this,void 0,void 0,(function*(){var e;s.Z&&(0,N.Z)()&&(yield(0,z.Z)(100)),this.element.parentElement!==n.ZP.chat.input.chatInput&&n.ZP.chat.input.chatInput.append(this.element),this.savedRange=this.getGoodRange(),ie.lazyLoadQueue.lock(),o.Z.lockIntersectionGroup(ee);const t=this.tab;null===(e=t.onOpen)||void 0===e||e.call(t)})))),this.addEventListener("opened",(()=>{var e;o.Z.unlockIntersectionGroup(ee),ie.lazyLoadQueue.unlockAndRefresh();const t=this.tab;null===(e=t.onOpened)||void 0===e||e.call(t)})),this.addEventListener("close",(()=>{var e;ie.lazyLoadQueue.lock(),o.Z.lockIntersectionGroup(ee),o.Z.checkAnimations(!0,ee);const t=this.tab;null===(e=t.onClose)||void 0===e||e.call(t)})),this.addEventListener("closed",(()=>{var e;o.Z.unlockIntersectionGroup(ee),ie.lazyLoadQueue.unlock(),ie.lazyLoadQueue.refresh(),this.savedRange=void 0;const t=this.tab;null===(e=t.onClosed)||void 0===e||e.call(t)}))}get tab(){return this.tabs[this.tabId]}init(){this.managers=a.Z.managers,this.emojiTab=new h.ZP({managers:this.managers}),this.stickersTab=new v.ZP(this.managers),this.gifsTab=new g(this.managers),this.tabs={},[this.emojiTab,this.stickersTab,this.gifsTab].forEach(((e,t)=>{e.tabId=t,this.tabs[t]=e})),this.container=this.element.querySelector(".emoji-container .tabs-container"),this.container.prepend(this.emojiTab.container,this.stickersTab.container),this.tabsEl=this.element.querySelector(".emoji-tabs"),this.selectTab=(0,r.X)(this.tabsEl,this.container,this.onSelectTabClick,(()=>{var e;const{tab:t}=this;null===(e=t.init)||void 0===e||e.call(t),o.Z.checkAnimations(!1,ee)})),this.searchButton=this.element.querySelector(".emoji-tabs-search"),this.searchButton.addEventListener("click",(()=>{this.tabId===this.stickersTab.tabId?l.ZP.isTabExists(D)||l.ZP.createTab(D).open():l.ZP.isTabExists(P)||l.ZP.createTab(P).open()})),this.deleteBtn=this.element.querySelector(".emoji-tabs-delete"),(0,m.fc)(this.deleteBtn,(e=>{(0,U.Z)(e);const t=n.ZP.chat.input.messageInput;let i=q.Z.getInstance().getSavedRange(t);i||(i=document.createRange(),i.setStartAfter(t.lastChild));const s=i.cloneRange();if(i.collapsed){const{node:e,offset:n}=(0,Y.q)(t,i.endContainer,i.endOffset);let a;if(n)a=e;else{if(a=e.previousSibling,!a)return;for(;a.nodeType===a.TEXT_NODE&&!a.nodeValue&&(a=a.previousSibling););if(a.nodeType===a.ELEMENT_NODE&&!a.isContentEditable)return}if(a.nodeType===a.ELEMENT_NODE&&"IMG"===a.tagName)s.selectNode(a);else{const e=[...a.textContent];let t;if(n){let i=0;t=e.find((e=>(i+=e.length,i>=n)))}else t=e.pop()||"";const i=n?n-t.length:a.textContent.length-t.length;s.setStart(a,i)}}s.deleteContents(),n.ZP.chat.input.messageInputField.simulateInputEvent()}));const e=j.IS_APPLE_MOBILE&&!1,t=e?this.stickersTab.tabId:this.emojiTab.tabId;if(e&&this.tabsEl.children[1].classList.add("hide"),(0,m.tH)(this.tabsEl.children[t+1]),this.tabs[t].init&&this.tabs[t].init(),!s.Z){let e,t=!1;const i=t=>{e=t};G.Z.addEventListener("change",(s=>{s?t||(document.body.addEventListener("mousemove",i),t=!0):t&&(document.body.removeEventListener("mousemove",i),e&&this.onMouseOut(e))}))}return n.ZP.addEventListener("peer_changing",(()=>{this.toggle(!1)})),n.ZP.addEventListener("peer_changed",this.checkRights),this.checkRights(),super.init()}getElement(){return this.element}scrollTo(e,t){e.scrollable.scrollIntoViewNew(Object.assign({element:t,axis:"y",position:"start"},te))}static sendDocId(e,t,i){return J(this,void 0,void 0,(function*(){return(yield n.ZP.chat.input.sendMessageWithDocument(e,void 0,t,i))?(se.container&&(se.forceClose=!0,se.toggle(!1)),!0):(console.warn("got no doc by id:",e),!1)}))}addLazyLoadQueueRepeat(e,t){this.addEventListener("close",(()=>{e.lock()})),this.addEventListener("closed",(()=>{const i=e.intersector.getVisible();for(const e of i)t(e);e.intersector.clearVisible()})),this.addEventListener("opened",(()=>{e.unlockAndRefresh()}))}getSavedRange(){return this.getGoodRange()||this.savedRange}getGoodRange(){const e=document.getSelection();if(e.rangeCount&&document.activeElement===n.ZP.chat.input.messageInput)return e.getRangeAt(0)}}R=ie,ie.lazyLoadQueue=new d.Z(1),ie.menuOnClick=(e,t,i,s,n,a)=>{let o=-1;const r=(e,t=!0)=>{if(e===n)return!1;let i=!1;return n&&(n.elements.menuTab.classList.remove("active"),n.menuScroll&&n.menuScroll!==e.menuScroll&&(i=!0,n.menuScroll.container.parentElement.classList.remove("active"),n.menuScroll.scrollIntoViewNew(Object.assign({element:n.menuScroll.container.firstElementChild,forceDirection:t?void 0:K.f.Static,position:"center",axis:"x"},te)))),e.elements.menuTab.classList.add("active"),e.menuScroll&&(e.menuScroll.container.parentElement.classList.add("active"),t&&s.scrollIntoViewNew(Object.assign({element:e.menuScroll.container.parentElement,position:"center",axis:"x"},te))),n&&((e,t)=>{const i=e.menuScroll||s;i&&i.scrollIntoViewNew(Object.assign({element:e.elements.menuTab,position:"center",axis:"x",getElementPosition:t?({elementPosition:e})=>e-106:void 0},te))})(e,i),n=e,!0};let d=!1;const l=new c.Z(i.container,((t,s)=>{if(d)return;if(Math.abs(o-i.container.scrollTop)<=1)return;o=-1;const n=e.getCategoryByContainer(s),a=(0,O.Z)(s);(t||!a&&!n.menuScroll)&&r(n)}));(0,m.fc)(t,(t=>{let s=(0,C.Z)(t.target,"menu-horizontal-div-item");if(!s){if(s=(0,C.Z)(t.target,"menu-horizontal-inner"),!s||s.classList.contains("active"))return;s=s.firstElementChild.firstElementChild}const n=(0,O.Z)(s),a=e.getCategoryByMenuTab(s);r(a);let l=0,c=0;if(n>0||a.menuScroll){const e=a.elements.container;c=1,l=e.offsetTop+c}o=l,d=!0,i.scrollIntoViewNew(Object.assign({element:l?a.elements.container:i.container.firstElementChild,position:"start",axis:"y",getElementPosition:l?({elementPosition:e})=>e+c:void 0},te)).finally((()=>{r(a),d=!1}))}),{listenerSetter:a});const h=i.onAdditionalScroll?i.onAdditionalScroll.bind(i):V.Z;return i.onAdditionalScroll=()=>{e.content.parentElement.classList.toggle("scrolled-top",!i.scrollTop),h()},{stickyIntersector:l,setActive:r,setActiveStatic:t=>{if(null==n?void 0:n.local)return;e.scrollable.scrollTop=t.elements.container.offsetTop+1;const i=e.menuScroll.container,s=t.elements.menuTab;i.scrollLeft=s.offsetLeft-i.clientWidth/2+s.offsetWidth/2,r(t,!1)}}},ie.onMediaClick=(e,t=!1,i)=>J(void 0,void 0,void 0,(function*(){const s=(0,B.Z)(e.target,"DIV");if(!s)return!1;const n=s.dataset.docId;return!!n&&R.sendDocId(n,t,i)}));const se=new ie;b.GO.emoticonsDropdown=se;const ne=se},6039:(e,t,i)=>{"use strict";i.d(t,{IA:()=>R,ZP:()=>V,xG:()=>B});var s=i(3173),n=i(3910),a=i(8497),o=i(3035),r=i(5418),d=i(7030),l=i(3512),c=i(671),h=i(279),u=i(8805),p=i(9976),f=i(5432),m=i(8799),g=i(3447),v=i(7746),b=i(8115),y=i(7197),w=i(5400),S=i(2738),C=i(6057),L=i(9405),I=i(2940),E=i(4755),P=i(1273),Z=i(9259),M=i(4064),T=i(4484),k=i(9298),x=i(2796),A=i(5953),_=i(5994),F=i(1168);const D=new Set;function R(e,t,i=!1,s=!1){var n;const a=document.createElement("span");let r;if(a.classList.add("super-emoji"),s&&!p.Z?r=function(e){return(0,w.ZP)(e,{entities:[(0,y.Z)(e)]})}(e):(e=(0,v.Z)(e),r=(0,b.Z)(e)),a.append(r),a.children.length>1){const e=a.firstElementChild;a.innerHTML="",a.append(e)}if("IMG"===(null===(n=a.firstElementChild)||void 0===n?void 0:n.tagName)){const e=a.firstElementChild,t=e.src;if(!D.has(t)){e.setAttribute("loading","lazy");const i=document.createElement("span");i.classList.add("emoji-placeholder"),_.Z.isAvailable("animations")&&(e.style.opacity="0",i.style.opacity="1"),e.addEventListener("load",(()=>{(0,o.T2)((()=>{_.Z.isAvailable("animations")&&(e.style.opacity="",i.style.opacity=""),a.classList.remove("empty"),D.add(t)}))}),{once:!0}),a.append(i)}}return t&&(i?t.prepend(a):t.appendChild(a)),a}function B(e){const t=(0,a.Z)(e,"super-emoji");if(!t)return;const i=t.firstElementChild;return i&&i.classList.contains("custom-emoji")?{emoji:i.dataset.stickerEmoji,docId:i.dataset.docId}:e.nodeType===e.TEXT_NODE?{emoji:e.nodeValue}:("SPAN"===e.tagName&&!e.classList.contains("emoji")&&e.firstElementChild&&(e=e.firstElementChild),{emoji:e.getAttribute("alt")||e.innerText})}const N="Emoji.Recent",O=[N,"recent"],U=["",""],H=[["Emoji.SmilesAndPeople","smile"],["Emoji.AnimalsAndNature","animals"],["Emoji.FoodAndDrink","eats"],["Emoji.TravelAndPlaces","car"],["Emoji.ActivityAndSport","sport"],["Emoji.Objects","lamp"],["Emoji.Flags","flag"],["Skin Tones",""]];let z;function j(){if(z)return z;z=new Map([[U,[]],[O,[]]]);for(const e in g.Z){const t=""+g.Z[e],i=H[+t[0]-1];if(!i)continue;let s=z.get(i);s||(s=[],z.set(i,s)),s[+t.slice(1)||0]=e}z.delete(H.pop()),H.unshift(U,O);const e=H.map((([e])=>e)),t=[...z.entries()].sort(((t,i)=>e.indexOf(t[0][0])-e.indexOf(i[0][0])));return z=new Map(t),z}const G=(0,L.C)(42,42);class V extends C.pw{constructor(e){super(e.managers,"super-emojis",(()=>G),16,4,0),this.onCategoryVisibility=({target:e,visible:t})=>{const i=this.categoriesMap.get(e),s=i.elements.renderer,n=[];if(s){n.push(s);const e=new Map;t?(n.push(...i.items.map((({docId:t,element:i})=>{if(!t)return i;const s=i.firstElementChild;return s.clear(!1),e.set(s.docId,new Set([s])),i}))),s.add(e,void 0,void 0,!1)):(s.clearCanvas(),s.middlewareHelper.clean())}else t&&n.push(...i.items.map((({element:e})=>e)));if(i.elements.items.replaceChildren(...n),s&&!t){const e=new Map;i.items.forEach((({docId:t,element:i})=>{if(!t)return;const s=i.firstElementChild;s.clear(),e.set(s.docId,new Set([s]))})),s.add(e,void 0,!0)}},this.onContentClick=e=>{(0,n.Z)(e);const{target:t}=e,i=(0,a.Z)(t,"emoji-category"),s=this.categoriesMap.get(i);if((0,a.Z)(t,"category-title")){if(s.local)return;return void F.Z.createPopup(k.Z,{id:s.set.id,access_hash:s.set.access_hash},!0).show()}const o=B(t);if(o){if(o.docId&&!l.Z.premium&&(this.isStandalone?""!==s.id:this.peerId!==l.Z.myId)){const e=document.createElement("a");return e.onclick=()=>{d.ZP.openPremiumBot(),(0,x.PE)()},void(0,x.bC)({langPackKey:"CustomEmoji.PremiumAlert",langPackArguments:[e]})}this.onClick?this.onClick(Object.assign(Object.assign({},o),{element:(0,a.Z)(t,"super-emoji").firstElementChild})):d.ZP.chat.input.onEmojiSelected(o,!1),f.Z&&(0,m.Z)()}},(0,A.Z)(this,e),this.container.classList.add("emoji-padding"),this.content.id="content-emoji",this.activeElements=[]}destroy(){var e;super.destroy(),null===(e=this.menuInnerScroll)||void 0===e||e.destroy()}init(){super.init(),this.init=void 0;const e={root:this.isStandalone?this.content:s.ZP.getElement()};this.categoriesIntersector=new I.Z(this.onCategoryVisibility,e),this.menuOnClickResult=s.Jo.menuOnClick(this,this.menu,this.scrollable,this.menuScroll,void 0,this.listenerSetter);const t=(0,h.y)(this.content,!0);let i,n;if(!this.isStandalone){const e=this.menuInnerScroll=new u.v7(void 0);e.container.classList.add("menu-horizontal-inner-scroll"),i=document.createElement("div"),i.classList.add("menu-horizontal-inner"),i.append(e.container)}j(),n=this.noRegularEmoji?new Map([[[U[0],"recent"],[]]]):j(),n.forEach(((e,[t,i])=>{const s=this.createLocalCategory(t,t,i,!i);s.elements.container.classList.remove("hide"),s.elements.items.classList.add(i&&!this.isStandalone?"is-local":"not-local"),e.forEach((e=>{const t=(0,c.zu)(e);this.addEmojiToCategory({category:s,emoji:{emoji:t},batch:!0})}))}));const a=Promise.all([this.isStandalone?void 0:(0,r.Z)(200),!this.noRegularEmoji&&this.managers.appEmojiManager.getRecentEmojis("native"),!this.isStandalone&&this.managers.appEmojiManager.getRecentEmojis("custom"),this.stickerSetId&&this.managers.appStickersManager.getLocalStickerSet(this.stickerSetId),this.managers.appEmojiManager.getCustomEmojis()]).then((([e,n,a,o,r])=>{t.remove(),o&&(a=o.documents.map((e=>e.id)));const c=this.categories[N],h=this.categories[""];if(this.isStandalone||[c&&[c,n],h&&[h,a]].filter(Boolean).forEach((([e,t])=>{e.limit=32,t.splice(32,t.length-32)})),c&&n)for(const e of n)this.addEmojiToCategory({category:c,emoji:{emoji:e},batch:!0});if(h){if(this.createRendererForCategory(h),a)for(const e of a)this.addEmojiToCategory({category:h,emoji:{emoji:"",docId:e},batch:!0});h.elements.container.style.paddingTop=".5rem"}H.forEach((([e])=>{const t=this.categories[e];t&&(this.toggleLocalCategory(t,!0),e!==N&&""!==e&&(t.menuScroll=this.menuInnerScroll,this.menuInnerScroll.container.append(t.elements.menuTab)))})),this.resizeCategories(),c&&i&&c.elements.menuTab.after(i),r.sets.forEach((e=>{this.renderStickerSet(e)})),this.listenerSetter.add(l.Z)("premium_toggle",(()=>{this.toggleCustomCategory()})),this.listenerSetter.add(l.Z)("stickers_top",this.postponedEvent((e=>{const t=this.categories[e];t&&(this.positionCategory(t,!0),this.listenerSetter.add(s.ZP)("openAfterLayout",(()=>{this.menuOnClickResult.setActiveStatic(t)}),{once:!0}))})));const u=e=>{for(const t in this.categories){const i=this.categories[t].elements.renderer;i&&(i.ignoreSettingDimensions=e,e||i.setDimensionsFromRect(void 0,!0))}};!this.isStandalone&&this.listenerSetter.add(s.ZP)("opened",(()=>{u(!1)})),!this.isStandalone&&this.listenerSetter.add(s.ZP)("close",(()=>{u(!0)})),this.listenerSetter.add(l.Z)("stickers_installed",(e=>{!this.categories[e.id]&&e.pFlags.emojis&&this.renderStickerSet(e,!0)})),this.listenerSetter.add(l.Z)("stickers_deleted",(e=>{const t=this.categories[e.id];if(this.deleteCategory(t)){const{renderer:e}=t.elements;e&&e.middlewareHelper.clean()}})),!this.isStandalone&&this.listenerSetter.add(l.Z)("emoji_recent",this.postponedEvent((e=>{const t=this.categories[e.docId?"":N];if(!t)return;const i=e.docId?t=>t.docId===e.docId:t=>t.emoji===e.emoji,s=(0,M.Z)(t.items,i);if(s){if(t.items.unshift(s),this.isCategoryVisible(t)){const{renderer:e}=t.elements;(0,T.Z)(s.element,t.elements.items,e?1:0,-1),null==e||e.forceRender()}}else this.addEmojiToCategory({category:t,emoji:e,batch:!1,prepend:!0});0===this.closeScrollTop&&this.menuOnClickResult.setActive(e.docId?this.categories[N]:t)}))),!this.isStandalone&&this.listenerSetter.add(d.ZP)("peer_changed",(()=>{this.toggleCustomCategory()})),this.toggleCustomCategory(),this.menuOnClickResult.setActive(null!=c?c:h)}));return(0,S.fc)(this.content,this.onContentClick,{listenerSetter:this.listenerSetter}),(0,Z.Z)({listenTo:this.content,listenerSetter:this.listenerSetter}),a}renderStickerSet(e,t){const i=this.createCategory(e,(0,b.Z)(e.title));this.positionCategory(i,t);const{container:n,menuTabPadding:a}=i.elements;i.elements.items.classList.add("not-local"),i.elements.container.classList.add("is-premium-set"),i.elements.title.classList.add("tgico"),this.createRendererForCategory(i),this.managers.appStickersManager.getStickerSet(e).then((({documents:e})=>{e.forEach((e=>{this.addEmojiToCategory({category:i,emoji:{docId:e.id,emoji:e.stickerEmojiRaw},batch:!0})})),this.onCategoryVisibility({target:i.elements.container,visible:this.isCategoryVisible(i)}),i.setCategoryItemsHeight(),n.classList.remove("hide")})),(0,P.Z)({set:e,container:a,group:s.Yd,lazyLoadQueue:s.Jo.lazyLoadQueue,width:32,height:32,autoplay:!1})}get peerId(){return d.ZP.chat.peerId}getCustomCategory(){return this.categories[""]}toggleCustomCategory(){const e=this.categories[""],t=l.Z.premium||this.peerId===l.Z.myId,i=t||this.isStandalone;super.toggleLocalCategory(e,!!e.items.length&&i),this.content.classList.toggle("has-premium",t)}toggleLocalCategory(e,t){""!==e.id?super.toggleLocalCategory(e,t):this.toggleCustomCategory()}createRendererForCategory(e){const t=w.KZ.create({animationGroup:s.Yd,customEmojiSize:E.Z.active.esgCustomEmoji});e.elements.renderer=t,e.elements.items.append(t)}addEmojiToCategory(e){const{category:t,emoji:i,batch:s,prepend:n}=e;let a=e.element;if(a){const e=document.createElement("span");e.classList.add("super-emoji"),e.append(a),a=e}else if(i.docId){const e=w.LD.create(i.docId),t=document.createElement("span");t.classList.add("super-emoji"),t.append(e),a=t}else a=R(i.emoji,void 0,!1);const o=Object.assign(Object.assign({},i||{emoji:void 0}),{element:a});(e.active||this.activeEmoji&&(o.docId?this.activeEmoji.docId===o.docId:this.activeEmoji.emoji===o.emoji))&&(this.activeEmoji,this.activeElements.push(o),a.classList.add("active")),t.items[n?"unshift":"push"](o),s||this.spliceExceed(t)||this.onLocalCategoryUpdate(t)}setActive(e){var t,i;(e===this.activeEmoji||(null==e?void 0:e.docId)?e.docId!==(null===(t=this.activeEmoji)||void 0===t?void 0:t.docId):(null==e?void 0:e.emoji)!==(null===(i=this.activeEmoji)||void 0===i?void 0:i.emoji))&&(this.activeEmoji=e,this.activeElements.forEach((e=>{e.element.classList.remove("active")})),this.activeElements.length=0,this.categoriesMap.forEach((t=>{t.items.forEach((t=>{(e.docId?t.docId===e.docId:t.emoji===e.emoji)&&(t.element.classList.add("active"),this.activeElements.push(t))}))})))}onClose(){this.closeScrollTop=this.scrollable.scrollTop}}},6057:(e,t,i)=>{"use strict";i.d(t,{pw:()=>R,vT:()=>F,ZP:()=>B});var s=i(3173),n=i(8497),a=i(4755),o=i(2325),r=i(8115),d=i(3512),l=i(5814),c=i(1655),h=i(7009),u=i(2940);class p extends h.Z{constructor(e,t,i){super(e),this.onVisibilityChange=t,this.elementsMap=new Map,this.intersector=new u.Z((e=>{var t;const{target:i,visible:s}=e,n=this.elementsMap.get(i);n.visible=s,s?(n.wasSeen=!0,this.queue.includes(n)||this.queue.push(n)):(0,c.Z)(this.queue,n),null===(t=this.onVisibilityChange)||void 0===t||t.call(this,e),this.setProcessQueueTimeout()}),i)}clear(){super.clear(),this.elementsMap.clear()}observe(e){this.elementsMap.set(e.div,e),super.observe(e)}unobserve(e){this.elementsMap.delete(e.div),super.unobserve(e)}}var f=i(279),m=i(9298),g=i(8805),v=i(4064),b=i(2738),y=i(4484),w=i(319),S=i(2230),C=i(5592),L=i(3163),I=i(5975),E=i(7625),P=i(9259),Z=i(3699),M=i(3541),T=i(1273),k=i(8222),x=i(241),A=i(1168),_=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class F{constructor(e,t,i,s){this.regularLazyLoadQueue=e,this.group=t,this.managers=i,this.options=s,this.animated=new Set,this.checkAnimationContainer=(e,t)=>{l.Z.getAnimations(e).forEach((e=>{t?l.Z.checkAnimation(e,!1):l.Z.removeAnimation(e)}))},this.processVisible=e=>_(this,void 0,void 0,(function*(){const t=e.dataset.docId,i=yield this.managers.appDocsManager.getDoc(t),s=a.Z.active.esgSticker.width,n=(0,M.ZP)({doc:i,div:e,width:s,height:s,lazyLoadQueue:null,group:this.group,onlyThumb:!1,play:!0,loop:!0,withLock:!0}).then((({render:e})=>e));return n.then((()=>{this.checkAnimationContainer(e,this.lazyLoadQueue.intersector.isVisible(e))})),n})),this.processInvisible=e=>_(this,void 0,void 0,(function*(){const t=e.dataset.docId,i=yield this.managers.appDocsManager.getDoc(t);this.checkAnimationContainer(e,!1),e.textContent="",this.renderSticker(i,e)})),this.lazyLoadQueue=new p(void 0,(({target:e,visible:t})=>{t||this.processInvisible(e)}),s)}clear(){this.lazyLoadQueue.clear()}renderSticker(e,t,i){return t||((t=document.createElement("div")).classList.add("grid-item","super-sticker"),t.dataset.docId=""+e.id,e.animated&&this.observeAnimated(t)),(0,M.ZP)({doc:e,div:t,lazyLoadQueue:this.regularLazyLoadQueue,group:this.group,onlyThumb:e.animated,loadPromises:i}),t}observeAnimated(e){this.animated.add(e),this.lazyLoadQueue.observe({div:e,load:this.processVisible})}unobserveAnimated(e){this.animated.delete(e),this.lazyLoadQueue.delete({div:e})}}class D{constructor(e){var t,i;const s=document.createElement("div");s.classList.add("emoji-category");const n=document.createElement("div");let a,o,r;n.classList.add("category-items"),e.title&&(a=document.createElement("div"),a.classList.add("category-title"),a.append(e.title)),e.noMenuTab||(o=(0,S.Z)(void 0,{noRipple:!0}),o.classList.add("menu-horizontal-div-item"),r=document.createElement("div"),r.classList.add("menu-horizontal-div-item-padding"),o.append(r)),a&&s.append(a),s.append(n),this.elements={container:s,title:a,items:n,menuTab:o,menuTabPadding:r},this.id=e.id,this.items=[],this.getContainerSize=e.getContainerSize,this.getElementMediaSize=e.getElementMediaSize,this.gapX=null!==(t=e.gapX)&&void 0!==t?t:0,this.gapY=null!==(i=e.gapY)&&void 0!==i?i:0}setCategoryItemsHeight(){const{width:e}=this.getContainerSize(),t=this.getElementMediaSize().width;let i=e/t;this.gapX&&(i-=Math.floor(i-1)*this.gapX/t),i=Math.floor(i);const s=Math.ceil(this.items.length/i);let n=s*t;this.gapY&&(n+=(s-1)*this.gapY),this.elements.items.style.minHeight=n+"px"}}class R{constructor(e,t,i,n,a,o){this.managers=e,this.categoryItemsClassName=t,this.getElementMediaSize=i,this.padding=n,this.gapX=a,this.gapY=o,this.mounted=!1,this.resizeCategories=()=>{for(const[e,t]of this.categoriesMap)t.setCategoryItemsHeight()},this.postponedEvent=e=>(...t)=>{s.ZP.isActive()?this.postponedEvents.push({cb:e,args:t}):e(...t)},this.categories={},this.categoriesMap=new Map,this.categoriesByMenuTabMap=new Map,this.localCategories=[],this.postponedEvents=[],this.listenerSetter=new Z.Z,this.container=document.createElement("div"),this.container.classList.add("tabs-tab","emoticons-container"),this.menuWrapper=document.createElement("div"),this.menuWrapper.classList.add("menu-wrapper","emoticons-menu-wrapper"),this.menu=document.createElement("nav"),this.menu.className="menu-horizontal-div no-stripe justify-start emoticons-menu",this.menuWrapper.append(this.menu),this.menuScroll=new g.v7(this.menuWrapper),this.content=document.createElement("div"),this.content.classList.add("emoticons-content"),this.container.append(this.menuWrapper,this.content),this.scrollable=new g.ZP(this.content,"STICKERS")}getCategoryByContainer(e){return this.categoriesMap.get(e)}getCategoryByMenuTab(e){return this.categoriesByMenuTabMap.get(e)}createCategory(e,t,i,s){const n=new D({id:""+e.id,title:t,overflowElement:this.content,getContainerSize:()=>{let e,t;if(this.getContainerSize){const i=this.getContainerSize();e=i.width,t=i.height}else{const t=k.Z.getPropertyAsSize("esg-width");e=void 0===t?x.Z.width:t}return{width:e-this.padding,height:t}},getElementMediaSize:this.getElementMediaSize,gapX:this.gapX,gapY:this.gapY,noMenuTab:s});this.categoryItemsClassName&&n.elements.items.classList.add(this.categoryItemsClassName);const a=n.elements.container;return a.classList.add("hide"),n.set=e,this.categories[e.id]=n,this.categoriesMap.set(a,n),!s&&this.categoriesByMenuTabMap.set(n.elements.menuTab,n),this.categoriesIntersector.observe(a),!s&&this.menuOnClickResult.stickyIntersector.observeStickyHeaderChanges(a),i||!s&&n.elements.menuTab.classList.add("not-local"),n}positionCategory(e,t){const{menuTab:i,container:s}=e.elements,n=t?this.localCategories.filter((e=>e.mounted)).length:65535;let a=!1;const o=t?this.localCategories.filter((e=>e.menuScroll&&!a?(a=!0,!0):e.mounted&&!e.menuScroll&&e.elements.menuTab)).length:65535;(0,y.Z)(s,this.scrollable.container,n),(0,y.Z)(i,this.menu,o)}isCategoryVisible(e){return this.categoriesIntersector.getVisible().includes(e.elements.container)}toggleLocalCategory(e,t){var i;if(t){const t=this.localCategories.indexOf(e),i=this.localCategories.slice(0,t);let s=0,n=0;i.forEach((e=>{e.mounted?e.elements.menuTab&&!e.menuScroll||++n:(++s,++n)}));const a=t-s,o=t-n;e.elements.menuTab&&(0,y.Z)(e.elements.menuTab,this.menu,o),(0,y.Z)(e.elements.container,this.scrollable.container,a)}else null===(i=e.elements.menuTab)||void 0===i||i.remove(),e.elements.container.remove();e.mounted=t}createLocalCategory(e,t,i,s){const n=this.createCategory({id:e},t&&(0,o.ag)(t),!0,s);return n.local=!0,this.localCategories.push(n),n.elements.title&&n.elements.title.classList.add("disable-hover"),s||(i&&n.elements.menuTab.classList.add("tgico","tgico-"+i),n.elements.menuTabPadding.remove()),this.toggleLocalCategory(n,!1),n}onLocalCategoryUpdate(e){e.setCategoryItemsHeight(),this.toggleLocalCategory(e,!!e.items.length)}deleteCategory(e){return!!e&&(e.elements.container.remove(),e.elements.menuTab.remove(),this.categoriesIntersector.unobserve(e.elements.container),delete this.categories[e.id],this.categoriesMap.delete(e.elements.container),this.categoriesByMenuTabMap.delete(e.elements.menuTab),!0)}spliceExceed(e){if(void 0===e.limit)return!1;const{items:t,limit:i}=e;return t.splice(i,t.length-i).forEach((({element:e})=>{e.remove()})),this.onLocalCategoryUpdate(e),!0}init(){this.listenerSetter.add(s.ZP)("closed",(()=>{this.postponedEvents.forEach((({cb:e,args:t})=>{e(...t)})),this.postponedEvents.length=0}))}destroy(){var e,t,i,s;this.getContainerSize=void 0,this.postponedEvents.length=0,null===(e=this.categoriesIntersector)||void 0===e||e.disconnect(),this.listenerSetter.removeAll(),this.scrollable.destroy(),null===(t=this.menuScroll)||void 0===t||t.destroy(),null===(s=null===(i=this.menuOnClickResult)||void 0===i?void 0:i.stickyIntersector)||void 0===s||s.disconnect()}}class B extends R{constructor(e){super(e,"super-stickers",(()=>a.Z.active.esgSticker),6,4,4),this.onCategoryVisibility=({target:e,visible:t,entry:i})=>{const s=this.categoriesMap.get(e);s.elements.items.replaceChildren(...t?s.items.map((({element:e})=>e)):[])},this.setTyping=(e=!1)=>{(e||s.ZP.isActive()&&s.ZP.tab===this)&&d.Z.dispatchEvent("choosing_sticker",!e)},this.container.classList.add("stickers-padding"),this.content.id="content-stickers"}setFavedLimit(e){this.categories.faved.limit=e}categoryAppendStickers(e,t){const{container:i}=e.elements;t.then((t=>{const s=this.isCategoryVisible(e);t.forEach((t=>{const i=this.superStickerRenderer.renderSticker(t);e.items.push({document:t,element:i}),s&&e.elements.items.append(i)})),e.setCategoryItemsHeight(),i.classList.remove("hide")}))}renderStickerSet(e,t=!1){return _(this,void 0,void 0,(function*(){const i=this.createCategory(e,(0,r.Z)(e.title)),{menuTabPadding:n}=i.elements,a=this.managers.appStickersManager.getStickerSet(e);this.categoryAppendStickers(i,a.then((e=>e.documents))),this.positionCategory(i,t),(0,T.Z)({set:e,container:n,group:s.Yd,lazyLoadQueue:s.Jo.lazyLoadQueue,width:32,height:32,autoplay:!1})}))}init(){super.init(),this.scrollable.onAdditionalScroll=()=>{this.setTyping()};const e={root:s.ZP.getElement()};this.categoriesIntersector=new u.Z(this.onCategoryVisibility,e);const t=e=>{e.elements.items.replaceChildren(),e.items.forEach((({element:e})=>this.superStickerRenderer.unobserveAnimated(e))),e.items.length=0};this.scrollable.container.addEventListener("click",(e=>{const t=e.target;if((0,n.Z)(t,"category-title")){const e=(0,n.Z)(t,"emoji-category"),i=this.categoriesMap.get(e);if(i.local)return;A.Z.createPopup(m.Z,{id:i.set.id,access_hash:i.set.access_hash}).show()}else s.Jo.onMediaClick(e)})),this.menuOnClickResult=s.Jo.menuOnClick(this,this.menu,this.scrollable,this.menuScroll);const i=(0,f.y)(this.content,!0),o=(e,t)=>{e.limit&&(t=t.slice(0,e.limit));const i=new Set(t.map((e=>e.id)));(0,E.Z)(e.items,(t=>{i.has(t.document.id)||this.deleteSticker(e,t.document,!0)})),this.toggleLocalCategory(e,!!t.length),(0,E.Z)(t,((t,i)=>{this.unshiftSticker(e,t,!0,i)})),this.spliceExceed(e),e.elements.container.classList.remove("hide")},r=this.createLocalCategory("faved","FavoriteStickers","savedmessages"),l=this.createLocalCategory("recent","Stickers.Recent","recent");l.limit=20;const c=(0,S.Z)("close",{noRipple:!0});l.elements.title.append(c),(0,b.fc)(c,(()=>{(0,C.Z)({titleLangKey:"ClearRecentStickersAlertTitle",descriptionLangKey:"ClearRecentStickersAlertMessage",button:{langKey:"Clear"}}).then((()=>{this.managers.appStickersManager.clearRecentStickers()}),w.Z)}));const h=this.createLocalCategory("premium","PremiumStickersShort"),p=document.createElement("span");p.classList.add("tgico-star","color-premium"),h.elements.menuTab.append(p);const g=[Promise.all([this.managers.apiManager.getLimit("favedStickers"),this.managers.appStickersManager.getFavedStickersStickers()]).then((([e,t])=>{this.setFavedLimit(e),o(r,t)})),this.managers.appStickersManager.getRecentStickersStickers().then((e=>{o(l,e)})),this.managers.appStickersManager.getAllStickers().then((e=>{for(const t of e.sets)this.renderStickerSet(t)})),this.managers.appStickersManager.getPremiumStickers().then((e=>{const t=e.length;this.toggleLocalCategory(h,d.Z.premium&&!!t),this.categoryAppendStickers(h,Promise.resolve(e)),d.Z.addEventListener("premium_toggle",(e=>{this.toggleLocalCategory(this.categories.premium,e&&!!t)}))}))];Promise.race(g).finally((()=>{i.remove()})),Promise.all(g).finally((()=>{this.mounted=!0,this.setTyping();const e=this.categories.faved,t=this.categories.recent;this.menuOnClickResult.setActive(e.items.length?e:t),d.Z.addEventListener("stickers_installed",(e=>{this.categories[e.id]||this.renderStickerSet(e,!0)}))})),this.superStickerRenderer=new F(s.Jo.lazyLoadQueue,s.Yd,this.managers,e);const v=this.superStickerRenderer.lazyLoadQueue;s.ZP.addLazyLoadQueueRepeat(v,this.superStickerRenderer.processInvisible),d.Z.addEventListener("sticker_updated",(({type:e,document:t,faved:i})=>{const s=this.categories["faved"===e?"faved":"recent"];s&&(i?this.unshiftSticker(s,t):this.deleteSticker(s,t))})),d.Z.addEventListener("stickers_deleted",(({id:e})=>{const i=this.categories[e];this.deleteCategory(i)&&t(i)})),d.Z.addEventListener("stickers_top",this.postponedEvent((e=>{const t=this.categories[e];t&&(this.positionCategory(t,!0),s.ZP.addEventListener("openAfterLayout",(()=>{this.menuOnClickResult.setActiveStatic(t)}),{once:!0}))}))),d.Z.addEventListener("stickers_order",(({type:e,order:t})=>{"stickers"===e&&t.forEach((e=>{const t=this.categories[e];t&&this.positionCategory(t,!1)}))})),d.Z.addEventListener("stickers_updated",(({type:e,stickers:t})=>{const i=this.categories["faved"===e?"faved":"recent"];i&&o(i,t)})),d.Z.addEventListener("app_config",(()=>{this.managers.apiManager.getLimit("favedStickers").then((e=>{this.setFavedLimit(e)}))})),a.Z.addEventListener("resize",this.resizeCategories),(0,P.Z)({listenTo:this.content,listenerSetter:new Z.Z});const y="menu";(0,L.Z)({listenTo:this.content,verifyRecent:e=>!!(0,I.Z)(e,this.categories.recent.elements.items),onOpen:()=>{s.ZP.setIgnoreMouseOut(y,!0)},onClose:()=>{s.ZP.setIgnoreMouseOut(y,!1)}}),this.init=null}deleteSticker(e,t,i){const s=(0,v.Z)(e.items,(e=>e.document.id===t.id));s&&(s.element.remove(),i||this.onLocalCategoryUpdate(e))}unshiftSticker(e,t,i,s){if(void 0!==s){const i=e.items[s];if(i&&i.document.id===t.id)return}let n=(0,v.Z)(e.items,(e=>e.document.id===t.id));n||(n={element:this.superStickerRenderer.renderSticker(t),document:t}),e.items.unshift(n),e.elements.items.prepend(n.element),i||this.spliceExceed(e)}unshiftRecentSticker(e){this.managers.appStickersManager.saveRecentSticker(e.id)}deleteRecentSticker(e){this.managers.appStickersManager.saveRecentSticker(e.id,!0)}onClosed(){this.setTyping(!0)}onOpened(){this.setTyping(),this.resizeCategories()}}},36:(e,t,i)=>{"use strict";i.d(t,{G:()=>s});const s=()=>{const e=document.createElement("div");return e.classList.add("gradient-delimiter"),e}},5948:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(2325);function n(e){const t=document.createElement("span");return t.classList.add("badge-fake"),(0,s.$d)(t,e?"ScamMessage":"FakeMessage"),t}},1080:(e,t,i)=>{"use strict";i.d(t,{Z:()=>f});var s=i(5814),n=i(3725),a=i(3035),o=i(3512),r=i(8847),d=i(7009),l=i(2940);class c extends d.Z{constructor(e,t){super(e),this.onVisibilityChange=t,this.intersector=new l.Z((e=>{const{target:t,visible:i}=e,s=(0,r.Z)(this.queue,(e=>e.div===t));i&&s.length&&s.forEach((e=>{this.queue.unshift(e)})),this.onVisibilityChange&&this.onVisibilityChange(e),this.setProcessQueueTimeout()}))}observe(e){super.observe(e)}}var h=i(2887),u=i(319),p=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class f{constructor(e,t,i,r=!0){this.element=e,this.group=t,this.scrollable=i,this.scrollPromise=Promise.resolve(),this.timeout=0,this.onScroll=()=>{this.timeout?clearTimeout(this.timeout):this.scrollPromise=(0,n.Z)(),this.timeout=window.setTimeout((()=>{this.timeout=0,this.scrollPromise.resolve()}),150)},this.processInvisibleDiv=e=>this.scrollPromise.then((()=>p(this,void 0,void 0,(function*(){if(this.lazyLoadQueue.intersector.isVisible(e))return;const t=e.querySelector("video"),i=e.querySelector("img, canvas");i&&(i.classList.remove("hide"),yield(0,a.d1)()),!this.lazyLoadQueue.intersector.isVisible(e)&&t&&(t.remove(),t.src="",t.load(),s.Z.getAnimations(t).forEach((e=>{s.Z.removeAnimation(e)})))})))),this.managers=o.Z.managers,this.lazyLoadQueue=new c(void 0,(({target:e,visible:t})=>{t?this.processVisibleDiv(e):this.processInvisibleDiv(e)})),r&&this.attach()}attach(){this.scrollable.container.addEventListener("scroll",this.onScroll)}detach(){this.clear(),this.scrollable.container.removeEventListener("scroll",this.onScroll)}clear(){this.lazyLoadQueue.clear()}processVisibleDiv(e){e.querySelector("video")||this.lazyLoadQueue.push({div:e,load:()=>{const t=e.dataset.docId;return Promise.all([this.managers.appDocsManager.getDoc(t),this.scrollPromise]).then((([t])=>p(this,void 0,void 0,(function*(){const i=(yield(0,h.Z)({doc:t,container:e,lazyLoadQueue:null,group:this.group,noInfo:!0,noPreview:!0})).loadPromise;return i.finally((()=>{const t=e.querySelector("video"),i=e.querySelector("img, canvas");i&&i.classList.add("hide"),t&&!t.parentElement&&setTimeout((()=>{t.src="",t.load(),s.Z.getAnimations(t).forEach((e=>{s.Z.removeAnimation(e)}))}),0),this.lazyLoadQueue.intersector.isVisible(e)||this.processInvisibleDiv(e)})),i}))))}})}add(e,t=this.element){const i=document.createElement("div");i.classList.add("gif","grid-item"),i.dataset.docId=""+e.id,t.append(i),this.lazyLoadQueue.observe({div:i,load:u.Z}),(0,h.Z)({doc:e,container:i,lazyLoadQueue:null,noInfo:!0,onlyPreview:!0})}}},6008:(e,t,i)=>{"use strict";i.d(t,{X:()=>c});var s=i(426),n=i(3035),a=i(4789),o=i(5975),r=i(2648),d=i(2738),l=i(5994);function c(e,t,i,c,h=200,u,p){const f=(0,s.Z)({content:t,type:e||"tabs"===t.dataset.animation?"tabs":"navigation",transitionTime:h,onTransitionEnd:c,listenerSetter:p});if(!e)return f;const m=new Proxy(f,{apply:(t,i,s)=>{const n=+s[0],a=void 0===s[1]||s[1],o=e.querySelector(`[data-tab="${n}"]`)||e.children[n];g(o,n,a)}}),g=(s,o,r=!0)=>{return d=this,c=void 0,m=function*(){const d=t.children[o];if(i){const e=i(o,d,r),t=e instanceof Promise?yield e:e;if(void 0!==t&&!t)return}u&&u.scrollIntoViewNew({element:s.parentElement.children[o],position:"center",forceDirection:r?void 0:a.f.Static,forceDuration:h,axis:"x"}),l.Z.isAvailable("animations")||(r=!1);const c=f.prevId();if(s.classList.contains("active")||o===c)return!1;const p=r?n.T2:e=>e(),m=e.querySelector(b.toLowerCase()+".active");m&&p((()=>{m.classList.remove("active")})),v&&-1!==c&&r&&p((()=>{const e=s.querySelector("i"),t=s.parentElement.children[c].querySelector("i");t.classList.remove("animate"),e.classList.remove("animate");const i=t.parentElement.parentElement.offsetLeft-e.parentElement.parentElement.offsetLeft,a=t.clientWidth/e.clientWidth;e.style.transform=`translate3d(${i}px, 0, 0) scale3d(${a}, 1, 1)`,(0,n.T2)((()=>{e.classList.add("animate"),e.style.transform="none"}))})),p((()=>{s.classList.add("active")})),f(o,r)},new((p=void 0)||(p=Promise))((function(e,t){function i(e){try{n(m.next(e))}catch(e){t(e)}}function s(e){try{n(m.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof p?n:new p((function(e){e(n)}))).then(i,s)}n((m=m.apply(d,c||[])).next())}));var d,c,p,m},v=!e.classList.contains("no-stripe"),b=e.firstElementChild.tagName;return(0,d.fc)(e,(t=>{let i,s=t.target;if(s=(0,o.Z)(s,e),!s)return!1;if(s.dataset.tab){if(i=+s.dataset.tab,-1===i)return!1}else i=(0,r.Z)(s);g(s,i)}),{listenerSetter:p}),m}},503:(e,t,i)=>{"use strict";i.d(t,{I1:()=>C,ZP:()=>E,rf:()=>w});var s=i(3910),n=i(6669),a=i(1544),o=i(8763),r=i(4668),d=i(3299),l=i(9336),c=i(1293),h=i(5565),u=i(669),p=i(130),f=i(2325),m=i(1507),g=i(6241),v=i(6535),b=i(3066),y=i(5400);function w(e,t,i,o){return r=this,l=void 0,h=function*(){const r=[],l=(null==i?void 0:i.some((e=>"messageEntityCustomEmoji"===e._)))?L():void 0,c=(0,b.Z)(t,{entities:i,wrappingForPeerId:o,loadPromises:r,customEmojiRenderer:l});c.querySelectorAll('[contenteditable="false"]').forEach((e=>{e.contentEditable="inherit",e.classList.add("pc")})),r.length&&(yield Promise.all(r)),c.querySelectorAll(".input-selectable").forEach((e=>{e.prepend((0,y.SZ)(!0))}));const h=u.Y?u.Z.getInstance():void 0,p=Array.from(c.querySelectorAll(".custom-emoji-placeholder")).map((e=>(e.dataset.ces="1",e.customEmojiElement))),f=(0,a.Z)(c);null==l||l.destroy();const m=(0,d.Z)(e);if(m.node);else{const t=document.createRange();let i=e.lastChild;i||e.append(i=document.createTextNode("")),t.setStartAfter(i),t.collapse(!0),m.selection.removeAllRanges(),m.selection.addRange(t)}e.addEventListener("input",s.Z,{capture:!0,once:!0,passive:!1}),null==h||h.onBeforeInput({inputType:"insertContent"}),window.document.execCommand("insertHTML",!1,f),Array.from(e.querySelectorAll("[data-ces]")).forEach(((e,t)=>{delete e.dataset.ces;const i=p[t];e.customEmojiElement=i,i.placeholder=e})),e.querySelectorAll(".pc").forEach((e=>{e.contentEditable="false"})),null==h||h.removeExtraBOMs(e),(0,n.Z)(e,"input")},new((c=void 0)||(c=Promise))((function(e,t){function i(e){try{n(h.next(e))}catch(e){t(e)}}function s(e){try{n(h.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof c?n:new c((function(e){e(n)}))).then(i,s)}n((h=h.apply(r,l||[])).next())}));var r,l,c,h}let S=()=>{document.addEventListener("paste",(e=>{const t=(0,o.Z)(e.target,'contenteditable="true"');if(!t)return;const i=!!t.dataset.noLinebreaks;let s,n;e.preventDefault();let a=(e.originalEvent||e).clipboardData.getData("text/plain"),r=!0,d=(e.originalEvent||e).clipboardData.getData("text/html");const c=e=>"messageEntityEmoji"===e._||"messageEntityLinebreak"===e._&&!i;if(i){const e=/[\r\n]/g;a=a.replace(e,""),d=d.replace(e,"")}const h=(t.dataset.peerId||m.NM).toPeerId();if(d.trim()){d=d.replace(//,""),d=d.replace(//,""),d=d.replace('
',"");const e=d.match(/([\s\S]*)<\/body>/);e&&(d=e[1].trim());const t=(new DOMParser).parseFromString(d,"text/html").body||document.createElement("body");let i=t.firstChild;for(;i;){const e=i.nextSibling;i.nodeType===i.TEXT_NODE&&(i.nodeValue.trim()||i.remove()),i=e}const o=(0,l.Z)(t,!0,!1);h||(o.entities=o.entities.filter((e=>"messageEntityCustomEmoji"!==e._)));{const e=o.value.split("\n");let t=0;for(let i=0;i{e.offset>=n&&(e.offset-=1)})),t+=a.length}t+=1}const i=e.join("\n");o.value=i}if(o.value.replace(/\s/g,"").length===a.replace(/\s/g,"").length||o.entities.find((e=>"messageEntityCustomEmoji"===e._))){s=o.value,n=o.entities,r=!1;let e=(0,v.Z)(s);e=e.filter(c),(0,g.Z)(n,e)}}r&&(s=a,n=(0,v.Z)(s),n=n.filter(c)),w(t,s,n,h)})),S=null};var C;function L(){return y.KZ.create({wrappingDraft:!0,isSelectable:!0})}function I(e){const t=Array.from(e.querySelectorAll(".custom-emoji, .custom-emoji-placeholder"));let i=e.querySelector(".custom-emoji-renderer");if(!i&&t.length)i=L(),e.prepend(i);else if(i&&!t.length)return void i.remove();if(!i)return;const s=new Map;t.forEach((e=>{const t=e instanceof y.LD?e:e.customEmojiElement,{docId:i}=t;let n=s.get(i);n||s.set(i,n=new Set),n.add(t)}));for(const[e,t]of s){let s=i.customEmojis.get(e);if(s)for(const e of s)t.has(e)||e.destroy();else s=new Set;for(const e of t)s.has(e)||e.connectedCallback()}i.add(s,!1),i.forceRender()}!function(e){e[e.Neutral=0]="Neutral",e[e.Valid=1]="Valid",e[e.Error=2]="Error"}(C||(C={}));class E{constructor(e={}){this.options=e,this.container=document.createElement("div"),this.container.classList.add("input-field"),this.required=e.required,this.validate=e.validate,void 0!==e.maxLength&&void 0===e.showLengthOn&&(e.showLengthOn=Math.min(40,Math.round(e.maxLength/3)));const{placeholder:t,maxLength:i,showLengthOn:s,name:n,plainText:a,canBeEdited:o=!0,autocomplete:d}=e,h=e.label||e.labelText,m=[];let g;if(a?(this.container.innerHTML=`\n \n `,g=this.container.firstElementChild):(S&&S(),this.container.innerHTML='
',g=this.container.firstElementChild,g.contentEditable=""+!!o,u.Z.getInstance(),g.addEventListener("mousedown",(e=>{var t;const i=document.getSelection();if(!i.isCollapsed)return;const s=(0,r.Z)(e.target,"IMG");if(!s)return;const n=s.getBoundingClientRect(),a=n.left+n.width/2,o=e.clientX>=a,d=document.createRange();d.setStartAfter(o?s:null!==(t=s.previousSibling)&&void 0!==t?t:s),i.removeAllRanges(),i.addRange(d)})),m.push((()=>{(0,c.Z)(g)&&g.replaceChildren(),u.Y&&Array.from(g.querySelectorAll("br:not(.br-not-br)")).forEach((e=>{e.remove()})),(0,y.Cx)(Array.from(g.querySelectorAll(".input-something"))),I(g)}))),(0,p.m)(g),e.inputMode&&(g.inputMode=e.inputMode),t&&(0,f.$d)(g,t,void 0,"placeholder"),h||t){const e=document.createElement("div");e.classList.add("input-field-border"),this.container.append(e)}if(h&&(this.label=document.createElement("label"),this.setLabel(),this.container.append(this.label)),i){const e=this.container.lastElementChild;let t=!1;const n=()=>{const n=g.classList.contains("error"),o=a?g.value.length:[...(0,l.Z)(g,!1,!1).value].length,r=i-o,d=r<0;g.classList.toggle("error",d),d||r<=s?(this.setLabel(),e.append(` (${i-o})`),t||(t=!0)):(n&&!d||t)&&(this.setLabel(),t=!1)};m.push(n)}!e.withLinebreaks&&!a&&(g.dataset.noLinebreaks="1",g.addEventListener("keypress",(e=>{if("Enter"===e.key)return e.preventDefault(),!1}))),m.length&&g.addEventListener("input",(()=>{m.forEach((e=>e()))})),this.input=g}select(){this.value&&(this.options.plainText?this.input.select():function(e){const t=document.createRange();t.selectNodeContents(e);const i=window.getSelection();i.removeAllRanges(),i.addRange(t)}(this.input))}setLabel(){this.label.textContent="",this.options.labelText?(0,p.Z)(this.label,this.options.labelText):this.label.append((0,f.ag)(this.options.label,this.options.labelOptions))}get value(){return this.options.plainText?this.input.value:(0,l.Z)(this.input,!1,!1).value}set value(e){this.setValueSilently(e,!0),this.simulateInputEvent()}simulateInputEvent(){(0,n.Z)(this.input,"input")}setValueSilently(e,t){this.options.plainText?this.input.value=e:((0,h.Z)(this.input,e),I(this.input))}isChanged(){return this.value!==this.originalValue}isValid(){return!this.input.classList.contains("error")&&(!this.validate||this.validate())&&(!this.required||!(0,c.Z)(this.input))}isValidToChange(){return this.isValid()&&this.isChanged()}setDraftValue(e="",t){this.options.plainText||(e=(0,a.Z)((0,b.Z)(e))),t?this.setValueSilently(e,!1):this.value=e}setOriginalValue(e="",t){this.originalValue=e,this.setDraftValue(e,t)}setState(e,t){t?(this.label.textContent="",this.label.append((0,f.ag)(t,this.options.labelOptions))):this.setLabel(),this.input.classList.toggle("error",!!(e&C.Error)),this.input.classList.toggle("valid",!!(e&C.Valid))}setError(e){this.setState(C.Error,e)}}},9496:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var s=i(669),n=i(6854),a=i(2325),o=i(503),r=i(9099);const d=new RegExp(`(${n.Z})|(
)`,"g");class l extends o.ZP{constructor(e){super(e),this.input.addEventListener("input",(()=>{this.updateInnerHTML(),this.onFakeInput()})),e.placeholder&&(0,a.$d)(this.inputFake,e.placeholder,void 0,"placeholder"),this.input.classList.add("scrollable","scrollable-y","no-scrollbar"),this.inputFake=document.createElement("div"),this.inputFake.contentEditable="true",this.inputFake.tabIndex=-1,this.inputFake.className=this.input.className+" input-field-input-fake"}onFakeInput(e=!0,t){var i;const{scrollHeight:s}=this.inputFake;null!=t||(t=!this.input.isContentEditable);const n=+this.input.style.height.replace("px","");if(n===s)return;const a=t?0:Math.round(50*Math.log(Math.abs(s-n)));this.input.style.transitionDuration=`${a}ms`,e&&(null===(i=this.onChangeHeight)||void 0===i||i.call(this,s),this.input.style.height=s?s+"px":"");const o="is-changing-height";(0,r.Z)({element:this.input,className:o,forwards:!0,duration:a,onTransitionEnd:()=>{this.input.classList.remove(o)}})}updateInnerHTML(e=this.input.innerHTML){e=e.replace(//,"").replace(/().+?\/custom-emoji-element>/g,"$1"),s.Y&&(e=e.replace(d,"")),this.inputFake.innerHTML=e}setValueSilently(e,t){super.setValueSilently(e,t),this.updateInnerHTML(),t||this.onFakeInput()}}},3607:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(503);class n{constructor(e,t){this.prevValue="",this.timeout=0,this.onInput=()=>{if(!this.onChange)return;const e=this.value;e!==this.prevValue&&(this.prevValue=e,clearTimeout(this.timeout),this.timeout=window.setTimeout((()=>{this.onChange(e)}),200))},this.onClearClick=()=>{this.value="",this.onChange&&this.onChange(""),this.onClear&&this.onClear()},this.inputField=new s.ZP({placeholder:e,plainText:!0}),this.container=this.inputField.container,this.container.classList.remove("input-field"),this.container.classList.add("input-search"),this.onChange=t,this.input=this.inputField.input,this.input.classList.add("input-search-input");const i=document.createElement("i");i.classList.add("tgico","tgico-search"),this.clearBtn=document.createElement("i"),this.clearBtn.classList.add("tgico","btn-icon","tgico-close"),this.input.addEventListener("input",this.onInput),this.clearBtn.addEventListener("click",this.onClearClick),this.container.append(i,this.clearBtn)}get value(){return this.inputField.value}set value(e){this.prevValue=e,clearTimeout(this.timeout),this.inputField.value=e}remove(){clearTimeout(this.timeout),this.input.removeEventListener("input",this.onInput),this.clearBtn.removeEventListener("click",this.onClearClick)}}},2153:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(2940),n=i(8847),a=i(4064),o=i(7009),r=i(8594);class d extends o.Z{constructor(e,t){super(e),this.onVisibilityChange=({target:e,visible:t})=>{(0,n.Z)(this.queue,(t=>t.div===e)).forEach((e=>{t&&(e.wasSeen=!0),e.visible=t;const i=this.queue.findIndex((e=>!e.visible));this.queue.splice(Math.max(0,i),0,e)})),this.setProcessQueueTimeout()},this.intersector=new s.Z(this.onVisibilityChange),!t&&(0,r.ZP)((()=>{this.lock()}),(()=>{this.unlockAndRefresh()}))}getItem(){return(0,a.Z)(this.queue,(e=>e.wasSeen))}processItem(e){const t=Object.create(null,{processItem:{get:()=>super.processItem}});return i=this,s=void 0,a=function*(){yield t.processItem.call(this,e),this.intersector.unobserve(e.div)},new((n=void 0)||(n=Promise))((function(e,t){function o(e){try{d(a.next(e))}catch(e){t(e)}}function r(e){try{d(a.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(i,s||[])).next())}));var i,s,n,a}addElement(e,t){var i;return!!super.addElement(e,t)&&(this.observe(t),null!==(i=t.wasSeen)&&void 0!==i||(t.wasSeen=!1),!0)}setAllSeen(){this.queue.forEach((e=>{e.wasSeen=!0})),this.setProcessQueueTimeout()}}},7009:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(8847),n=i(4421);class a extends n.Z{constructor(e){super(e),this.queue=[],this.inProcess=new Set}lock(){super.lock(),this.intersector.lock()}unlock(){super.unlock(),this.intersector.unlock()}unlockAndRefresh(){super.unlock(),this.intersector.unlockAndRefresh()}clear(){super.clear(),this.intersector.disconnect()}refresh(){this.intersector.refresh()}loadItem(e){return e.load(e.div)}addElement(e,t){if(this.queue.find((e=>e.div===t.div&&e.load===t.load)))return!1;for(const e of this.inProcess)if(e.div===t.div&&e.load===t.load)return!1;return this.queue[e](t),!0}setProcessQueueTimeout(){var e;null!==(e=this.intersectorTimeout)&&void 0!==e||(this.intersectorTimeout=window.setTimeout((()=>{this.intersectorTimeout=void 0,this.processQueue()}),0))}push(e){super.push(e)}unshift(e){super.unshift(e)}delete(e){(0,s.Z)(this.queue,(t=>t.div===e.div)),this.unobserve(e)}observe(e){this.intersector.observe(e.div)}unobserve(e){this.intersector.unobserve(e.div)}}},7207:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(3013),n=i(65);class a extends n.Z{constructor(e={}){super({step:1e3/60/1e3,min:0,max:1,withTransition:e.withTransition,useTransform:e.useTransform},0),this.options=e,this.onLoadedData=()=>{this.setSeekMax()},this.onEnded=()=>{this.setProgress()},this.onPlay=()=>{const e=()=>{this.setProgress(),this.progressRAF=this.media.paused?void 0:window.requestAnimationFrame(e)};this.progressRAF&&(window.cancelAnimationFrame(this.progressRAF),this.progressRAF=void 0),this.streamable&&this.setLoadProgress(),e()},this.onTimeUpdate=()=>{this.media.paused&&(this.setProgress(),this.streamable&&this.setLoadProgress())},this.onProgress=e=>{this.setLoadProgress()}}setMedia({media:e,streamable:t,duration:i}){this.media&&this.removeListeners(),t&&!this.filledLoad?(this.filledLoad=document.createElement("div"),this.filledLoad.classList.add("progress-line__filled","progress-line__loaded"),this.container.prepend(this.filledLoad)):this.filledLoad&&this.filledLoad.classList.toggle("hide",!t),this.media=e,this.streamable=t,(!e.paused||e.currentTime>0)&&this.onPlay();let s=!1;this.setSeekMax(i),this.setListeners(),this.setHandlers({onMouseDown:()=>{var e,t;s=!this.media.paused,s&&this.media.pause(),null===(t=null===(e=this.options)||void 0===e?void 0:e.onSeekStart)||void 0===t||t.call(e)},onMouseUp:e=>{var t,i;s&&this.media.play(),null===(i=null===(t=this.options)||void 0===t?void 0:t.onSeekEnd)||void 0===i||i.call(t)}})}scrub(e){const t=super.scrub(e);return this.media.currentTime=t,t}setLoadProgress(){if(s.Z.isSafariBuffering(this.media))return;const e=this.media.buffered,t=e.length,i=this.media.currentTime;let n=0,a=0;for(let s=0;s=t&&t>=n&&(n=t,a=e.end(s))}const o=this.max?a/this.max:0;this.filledLoad.style.width=100*o+"%"}setSeekMax(e){const t=this.media.duration||0;(void 0===e||t)&&(e=t),(this.max=e)?this.seek.setAttribute("max",""+this.max):this.media.addEventListener("loadeddata",this.onLoadedData)}setProgress(){if(s.Z.isSafariBuffering(this.media))return;const e=this.media.currentTime;super.setProgress(e)}setListeners(){super.setListeners(),this.media.addEventListener("ended",this.onEnded),this.media.addEventListener("play",this.onPlay),this.media.addEventListener("pause",this.onTimeUpdate),this.media.addEventListener("timeupdate",this.onTimeUpdate),this.streamable&&this.media.addEventListener("progress",this.onProgress)}removeListeners(){super.removeListeners(),this.media&&(this.media.removeEventListener("loadeddata",this.onLoadedData),this.media.removeEventListener("ended",this.onEnded),this.media.removeEventListener("play",this.onPlay),this.media.removeEventListener("pause",this.onTimeUpdate),this.media.removeEventListener("timeupdate",this.onTimeUpdate),this.streamable&&this.media.removeEventListener("progress",this.onProgress)),this.progressRAF&&(window.cancelAnimationFrame(this.progressRAF),this.progressRAF=void 0)}}},3251:(e,t,i)=>{"use strict";i.d(t,{I:()=>f});var s=i(3189),n=i(8097),a=i(4755),o=i(3228),r=i(3035);const d=new Map,l=new Set;let c=!1;function h(){c||(c=!0,(0,r.T2)((()=>{c=!1,l.forEach(p),l.clear()})))}function u(e){const t=e.getSize;if(t)return t();const i=e.dataset.sizeType;return i?a.Z.active[i].width:e.getBoundingClientRect().width}function p(e){let t=d.get(e);const i=!t;let{text:a,textLength:r,from:l,multiplier:c,font:h,textWidth:p,elementWidth:f}=t||{};if(i){a=e.textContent,r=a.length,l=50,c=l>0&&l/100;let i=e.dataset.fontSize;i&&+i&&(i+="px"),h=`${e.dataset.fontWeight||s.U9} ${i||s.Bf} ${s.bt}`,p=(0,n.Z)(a,h),f=u(e),t={text:a,textLength:r,from:l,multiplier:c,font:h,textWidth:p,elementWidth:f},d.set(e,t)}const m=u(e),g=i||f!==m;if(!i&&g&&(t.elementWidth=f=m),g)if(p>f){e.setAttribute("title",a);let i=a,s=f;for(;i.length>3;){const t=i.length,a=c&&(0,o.Z)(c*t<<0,1,t-2)||Math.max(t+l-1,1),r=i.substr(0,a).replace(/\s*$/,""),d=i.substr(a+1).replace(/^\s*/,"");if(i=r+d,s=(0,n.Z)(i+"…",h),s{for(const[e]of d)l.add(e);h()}),{capture:!0,passive:!0});class f extends HTMLElement{connectedCallback(){d.set(this,null),this.dataset.sizeType||this.getSize?p(this):(l.add(this),h())}disconnectedCallback(){d.delete(this),l.delete(this)}}customElements.define("middle-ellipsis-element",f)},4425:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(1447);class n{constructor(e,t){this.passwordInputField=e,this.size=t,this.needFrame=0,this.container=document.createElement("div"),this.container.classList.add("media-sticker-wrapper")}load(){return this.loadPromise?this.loadPromise:this.loadPromise=s.Z.loadAnimationAsAsset({container:this.container,loop:!1,autoplay:!1,width:this.size,height:this.size,noCache:!0},"TwoFactorSetupMonkeyPeek").then((e=>(this.animation=e,this.animation.addEventListener("enterFrame",(e=>{(1===this.animation.direction&&e>=this.needFrame||-1===this.animation.direction&&e<=this.needFrame)&&(this.animation.setSpeed(1),this.animation.pause())})),this.passwordInputField.helpers.onVisibilityClickAdditional=()=>{this.passwordInputField.helpers.passwordVisible?(this.animation.setDirection(1),this.animation.curFrame=0,this.needFrame=16,this.animation.play()):(this.animation.setDirection(-1),this.animation.curFrame=16,this.needFrame=0,this.animation.play())},s.Z.waitForFirstFrame(e))))}remove(){this.animation&&this.animation.remove()}}},3083:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(1447);class n{constructor(e,t){this.inputField=e,this.size=t,this.max=45,this.needFrame=0,this.container=document.createElement("div"),this.container.classList.add("media-sticker-wrapper");const i=e.input;i.addEventListener("blur",(()=>{this.playAnimation(0)})),i.addEventListener("input",(t=>{this.playAnimation(e.value.length)}))}playAnimation(e){if(!this.animation)return;let t;(e=Math.min(e,30))?(t=Math.round(Math.min(this.max,e)*(165/this.max)+11.33),this.idleAnimation&&(this.idleAnimation.stop(!0),this.idleAnimation.canvas[0].style.display="none"),this.animation.canvas[0].style.display=""):t=0;const i=this.needFrame>t?-1:1;this.animation.setDirection(i),0!==this.needFrame&&0===t&&this.animation.setSpeed(7),this.needFrame=t,this.animation.play()}load(){return this.loadPromise?this.loadPromise:this.loadPromise=Promise.all([s.Z.loadAnimationAsAsset({container:this.container,loop:!0,autoplay:!0,width:this.size,height:this.size},"TwoFactorSetupMonkeyIdle").then((e=>(this.idleAnimation=e,this.inputField.value.length||e.play(),s.Z.waitForFirstFrame(e)))),s.Z.loadAnimationAsAsset({container:this.container,loop:!1,autoplay:!1,width:this.size,height:this.size},"TwoFactorSetupMonkeyTracking").then((e=>(this.animation=e,this.inputField.value.length||(this.animation.canvas[0].style.display="none"),this.animation.addEventListener("enterFrame",(e=>{(1===this.animation.direction&&e>=this.needFrame||-1===this.animation.direction&&e<=this.needFrame)&&(this.animation.setSpeed(1),this.animation.pause()),0===e&&0===this.needFrame&&this.idleAnimation&&(this.idleAnimation.canvas[0].style.display="",this.idleAnimation.play(),this.animation.canvas[0].style.display="none")})),s.Z.waitForFirstFrame(e))))])}remove(){this.animation&&this.animation.remove(),this.idleAnimation&&this.idleAnimation.remove()}}},6830:(e,t,i)=>{"use strict";i.d(t,{T:()=>a,Z:()=>o});var s=i(3910),n=i(503);class a{constructor(e,t){this.container=e,this.input=t,this.passwordVisible=!1,this.onVisibilityClick=e=>{(0,s.Z)(e),this.passwordVisible=!this.passwordVisible,this.toggleVisible.classList.toggle("eye-hidden",this.passwordVisible),this.input.type=this.passwordVisible?"text":"password",this.onVisibilityClickAdditional&&this.onVisibilityClickAdditional()},t.type="password",t.setAttribute("required",""),t.name="notsearch_password",t.autocomplete="off";const i=document.createElement("input");i.classList.add("stealthy"),i.tabIndex=-1,i.type="password",t.parentElement.prepend(i),t.parentElement.insertBefore(i.cloneNode(),t.nextSibling);const n=this.toggleVisible=document.createElement("span");n.classList.add("toggle-visible","tgico"),e.classList.add("input-field-password"),e.append(n),n.addEventListener("click",this.onVisibilityClick),n.addEventListener("touchend",this.onVisibilityClick)}}class o extends n.ZP{constructor(e={}){super(Object.assign({plainText:!0},e)),this.helpers=new a(this.container,this.input)}}},8261:(e,t,i)=>{"use strict";i.d(t,{Z:()=>G});var s=i(2365),n=i(3725),a=i(2166),o=i(3532),r=i(2738),d=i(5565),l=i(130),c=i(3699),h=i(5471),u=i(9405),p=i(3624),f=i(8631),m=i(7030),g=i(2790),v=i(5102),b=i(2325),y=i(5400),w=i(3512),S=i(9331),C=i(9807),L=i(36),I=i(5432),E=i(4064),P=i(3910),Z=i(1708),M=i(6074),T=i(3035),k=i(9687),x=i(9931),A=i(3757),_=i(9492),F=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class D{constructor(e,t){this.scrollable=e,this.managers=t,this.processItem=e=>F(this,void 0,void 0,(function*(){const t=document.createElement("div");let i;t.classList.add(D.BASE_CLASS+"-avatar","media-container","hide"),this.avatars.append(t),e&&(i="object"!=typeof e?yield this.managers.appPhotosManager.getPhoto(e):e.action.photo);const s=new Image;s.classList.add("avatar-photo"),s.draggable=!1;const n=()=>F(this,void 0,void 0,(function*(){if(i){const e=yield(0,_.Z)({container:t,photo:i,size:(0,k.Z)(i,420,420,!1),withoutPreloader:!0});[e.images.thumb,e.images.full].filter(Boolean).forEach((e=>{e.classList.add("avatar-photo")}))}else{const e=yield this.managers.appPeersManager.getPeerPhoto(this.peerId);yield(0,x.Y)(t,this.peerId,e,"photo_big",s)}t.classList.remove("hide")}));return this.avatars.childElementCount<=3?yield n():(this.intersectionObserver.observe(t),this.loadCallbacks.set(t,n)),this.addTab(),e})),this.container=document.createElement("div"),this.container.classList.add(D.BASE_CLASS+"-container"),this.avatars=document.createElement("div"),this.avatars.classList.add(D.BASE_CLASS+"-avatars"),this.gradient=document.createElement("div"),this.gradient.classList.add(D.BASE_CLASS+"-gradient"),this.info=document.createElement("div"),this.info.classList.add(D.BASE_CLASS+"-info"),this.tabs=document.createElement("div"),this.tabs.classList.add(D.BASE_CLASS+"-tabs"),this.arrowPrevious=document.createElement("div"),this.arrowPrevious.classList.add(D.BASE_CLASS+"-arrow","tgico-avatarprevious"),this.arrowNext=document.createElement("div"),this.arrowNext.classList.add(D.BASE_CLASS+"-arrow",D.BASE_CLASS+"-arrow-next","tgico-avatarnext"),this.container.append(this.avatars,this.gradient,this.info,this.tabs,this.arrowPrevious,this.arrowNext),this.loadCallbacks=new Map,this.listenerSetter=new c.Z;const i=()=>0===this.scrollable.scrollTop||(this.scrollable.scrollIntoViewNew({element:this.scrollable.container.firstElementChild,position:"start"}),!1),s=1/3;let n=!1,a=!1;(0,r.fc)(this.container,(e=>F(this,void 0,void 0,(function*(){if(a)return void(0,P.Z)(e);if(n)return void(n=!1);if(!i())return;const t=this.container.getBoundingClientRect(),o=e.pageX,r=o-t.left;if(!this.listLoader.previous.length&&!this.listLoader.next.length||r>t.width*s&&r{t.push({element:this.avatars.children[i],item:e})}));const i=t.slice(0,this.listLoader.previous.length),s=t.slice(this.listLoader.previous.length+1),n=this.avatars.children[this.listLoader.previous.length];a=!0,(0,S.C)(n,e,(()=>e===this.peerId),this.listLoader.current,i,s),a=!1}else{const e=o>t.right-t.width/2;let i;this.avatars.classList.add("no-transition"),this.avatars.offsetLeft,i=0!==this.listLoader.index||e?this.listLoader.index===this.listLoader.count-1&&e?-(this.listLoader.count-1):e?1:-1:this.listLoader.count-1,this.listLoader.go(i),(0,T.T2)((()=>{this.avatars.classList.remove("no-transition")}))}}))),{listenerSetter:this.listenerSetter});const o=()=>{n=!0,document.body.addEventListener(I.Z?"touchend":"click",(e=>{n=!1}),{once:!0})};let d=0,l=0,h=0,u=0;this.swipeHandler=new A.Z({element:this.avatars,onSwipe:(e,t)=>{h=e*=-1;let i=l+e*-D.SCALE;return i>0?i=0:ii()?!this.container.classList.contains("is-single")&&!a:(o(),(0,P.Z)(e),!1),onFirstSwipe:()=>{const e=this.avatars.getBoundingClientRect();d=e.width,u=-d*(this.tabs.childElementCount-1),l=e.left-this.container.getBoundingClientRect().left,this.avatars.style.transform=D.TRANSLATE_TEMPLATE.replace("{x}",l+"px"),this.container.classList.add("is-swiping"),this.avatars.classList.add("no-transition"),this.avatars.offsetLeft},onReset:()=>{const e=Math.ceil(Math.abs(h)/(d/D.SCALE))*(h>=0?1:-1);o(),this.avatars.classList.remove("no-transition"),(0,T.T2)((()=>{this.listLoader.go(e),this.container.classList.remove("is-swiping")}))}}),this.intersectionObserver=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&this.loadNearestToTarget(e.target)}))}))}setPeer(e){return F(this,void 0,void 0,(function*(){this.peerId=e;const t=yield this.managers.appPeersManager.getPeerPhoto(e);if(!t)return;const i=this.listLoader=new M.Z({loadCount:50,loadMore:(t,s,n)=>{if(!s)return Promise.resolve({count:void 0,items:[]});if(e.isUser()){const i=t;return this.managers.appPhotosManager.getUserPhotos(e,i,n).then((e=>({count:e.count,items:e.photos})))}{const t=[];return i.current||t.push(this.managers.appProfileManager.getChatFull(e.toChatId())),t.push(this.managers.appMessagesManager.getSearch({peerId:e,maxId:Number.MAX_SAFE_INTEGER,inputFilter:{_:"inputMessagesFilterChatPhotos"},limit:n,backLimit:0})),Promise.all(t).then((e=>F(this,void 0,void 0,(function*(){const t=e.pop();if((0,Z.Z)(t),!i.current){const s=e[0],n=(0,E.Z)(t.history,(e=>e.action.photo.id===s.chat_photo.id));i.current=n||(yield this.managers.appMessagesManager.generateFakeAvatarMessage(this.peerId,s.chat_photo))}return{count:t.count,items:t.history}}))))}},processItem:this.processItem,onJump:(e,t)=>{const i=this.listLoader.index,s=100*D.SCALE*i;this.avatars.style.transform=D.TRANSLATE_TEMPLATE.replace("{x}",`-${s}%`);const n=this.tabs.querySelector(".active");n&&n.classList.remove("active"),this.tabs.children[i].classList.add("active"),this.loadNearestToTarget(this.avatars.children[i])}});"userProfilePhoto"===t._&&(i.current=t.photo_id),yield this.processItem(i.current),i.load(!0)}))}addTab(){const e=document.createElement("div");e.classList.add(D.BASE_CLASS+"-tab"),this.tabs.append(e),1===this.tabs.childElementCount&&e.classList.add("active"),this.container.classList.toggle("is-single",this.tabs.childElementCount<=1)}loadNearestToTarget(e){const t=Array.from(e.parentElement.children),i=t.indexOf(e);t.slice(Math.max(0,i-3),Math.min(t.length,i+3)).forEach((e=>{const t=this.loadCallbacks.get(e);t&&(t(),this.loadCallbacks.delete(e),this.intersectionObserver.unobserve(e))}))}cleanup(){var e;this.listenerSetter.removeAll(),this.swipeHandler.removeListeners(),null===(e=this.intersectionObserver)||void 0===e||e.disconnect()}}D.BASE_CLASS="profile-avatars",D.SCALE=s.Z?2:1,D.TRANSLATE_TEMPLATE=s.Z?`translate3d({x}, 0, -1px) scale(${D.SCALE})`:"translate({x}, 0)";var R=i(7479),B=i(5029),N=i(2796),O=i(8210),U=i(7362),H=i(9102),z=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const j=(e,t)=>{(0,l.Z)(t.title,e||""),t.container.style.display=e?"":"none"};class G{constructor(e,t,i,n=!0){this.managers=e,this.scrollable=t,this.listenerSetter=i,this.isDialog=n,s.Z||this.scrollable.container.classList.add("no-parallax"),i||(this.listenerSetter=new c.Z),this.middlewareHelper=(0,p.k)()}init(){this.init=null,this.element=document.createElement("div"),this.element.classList.add("profile-content"),this.section=new B.Z({noDelimiter:!0}),this.name=document.createElement("div"),this.name.classList.add("profile-name"),this.subtitle=document.createElement("div"),this.subtitle.classList.add("profile-subtitle"),this.bio=new R.ZP({title:" ",subtitle:!0,icon:"info",clickable:e=>{"A"!==e.target.tagName&&((0,a.T)(this.bio.title.textContent),(0,N.Am)(b.ZP.format("BioCopied",!0)))},listenerSetter:this.listenerSetter,contextMenu:{buttons:[{icon:"copy",text:"Text.CopyLabel_About",onClick:()=>{(0,r.tH)(this.bio.container)},verify:()=>!this.peerId.isUser()},{icon:"copy",text:"Text.CopyLabel_Bio",onClick:()=>{(0,r.tH)(this.bio.container)},verify:()=>this.peerId.isUser()}]}}),this.bio.title.classList.add("pre-wrap"),this.username=new R.ZP({title:" ",subtitleLangKey:"Username",icon:"username",clickable:()=>{(0,a.T)("@"+this.username.title.textContent),(0,N.Am)(b.ZP.format("UsernameCopied",!0))},listenerSetter:this.listenerSetter,contextMenu:{buttons:[{icon:"copy",text:"Text.CopyLabel_Username",onClick:()=>{(0,r.tH)(this.username.container)}}]}}),this.phone=new R.ZP({title:" ",subtitle:!0,icon:"phone",clickable:()=>{(0,a.T)(this.phone.title.textContent.replace(/\s/g,"")),(0,N.Am)(b.ZP.format("PhoneCopied",!0))},listenerSetter:this.listenerSetter,contextMenu:{buttons:[{icon:"copy",text:"Text.CopyLabel_PhoneNumber",onClick:()=>{(0,r.tH)(this.phone.container)}},{icon:"info",text:"PeerInfo.Phone.AnonymousInfo",textArgs:[document.createElement("a")],onClick:()=>{window.open("https://fragment.com/numbers","_blank")},separator:!0,multiline:!0,verify:()=>z(this,void 0,void 0,(function*(){const{isAnonymous:e}=(yield this.managers.appUsersManager.getUserPhone(this.peerId.toUserId()))||{};return e}))}]}}),this.link=new R.ZP({title:" ",subtitleLangKey:"SetUrlPlaceholder",icon:"link",clickable:()=>{const e=this.link.title.textContent;(0,a.T)(e);const t=e.includes("/c/");(0,N.Am)(b.ZP.format(t?"LinkCopiedPrivateInfo":"LinkCopied",!0))},listenerSetter:this.listenerSetter,contextMenu:{buttons:[{icon:"copy",text:"Text.CopyLabel_ShareLink",onClick:()=>{(0,r.tH)(this.link.container)}}]}}),this.location=new R.ZP({title:" ",subtitleLangKey:"ChatLocation",icon:"location"}),this.section.content.append(this.phone.container,this.username.container,this.location.container,this.bio.container,this.link.container);const{listenerSetter:e}=this;this.isDialog&&(this.notifications=new R.ZP({checkboxField:new C.Z({toggle:!0}),titleLangKey:"Notifications",icon:"unmute",listenerSetter:this.listenerSetter}),e.add(this.notifications.checkboxField.input)("change",(e=>{e.isTrusted&&this.managers.appMessagesManager.togglePeerMute({peerId:this.peerId,threadId:this.threadId})})),e.add(w.Z)("dialog_notify_settings",(e=>z(this,void 0,void 0,(function*(){if(this.peerId===e.peerId){const e=yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:this.peerId,respectType:!1,threadId:this.threadId});this.notifications.checkboxField.checked=!e}})))),this.section.content.append(this.notifications.container)),this.element.append(this.section.container),s.Z&&this.element.append((0,L.G)()),e.add(w.Z)("peer_typings",(({peerId:e})=>{this.peerId===e&&this.setPeerStatus()})),e.add(w.Z)("peer_bio_edit",(e=>{e===this.peerId&&this.setMoreDetails(!0)}));const t=({peerId:e,threadId:t})=>z(this,void 0,void 0,(function*(){return this.peerId===e&&(!(yield this.managers.appPeersManager.isForum(this.peerId))||!this.threadId||this.threadId===t)}));e.add(w.Z)("peer_title_edit",(e=>z(this,void 0,void 0,(function*(){(yield t(e))&&(this.fillUsername(),this.setMoreDetails(!0))})))),e.add(w.Z)("user_update",(e=>{this.peerId===e.toPeerId()&&this.setPeerStatus()})),e.add(w.Z)("contacts_update",(e=>z(this,void 0,void 0,(function*(){this.peerId===e.toPeerId()&&((yield this.managers.appUsersManager.getUser(e)).pFlags.self&&this.isDialog||this.fillUserPhone())})))),e.add(w.Z)("avatar_update",(e=>z(this,void 0,void 0,(function*(){(yield t(e))&&this.setAvatar()})))),this.setPeerStatusInterval=window.setInterval((()=>this.setPeerStatus()),6e4)}setPeerStatus(e=!1,t){return z(this,void 0,void 0,(function*(){const i=this.peerId,s=[];s.push((()=>{this.element.classList.toggle("is-me",i===w.Z.myId)}));let n=Promise.resolve();if(i&&(w.Z.myId!==i||!this.isDialog)){const t=yield this.managers.appPeersManager.isForum(this.peerId),a=this.middlewareHelper.get();n=t&&this.threadId?(0,H.Z)({peerId:i,wrapOptions:{middleware:a}}).then((({element:e})=>{this.subtitle.replaceChildren(e)})):m.ZP.setPeerStatus({peerId:i,element:this.subtitle,needClear:e,useWhitespace:!0,middleware:a,ignoreSelf:!this.isDialog}),n.then((e=>e&&s.push(e)))}const a=()=>s.forEach((e=>e()));return n.then((()=>{if(t)return a;a()}))}))}cleanupHTML(){[this.bio,this.phone,this.username,this.location,this.link].forEach((e=>{e.container.style.display="none"})),this.notifications&&(this.notifications.container.style.display="",this.notifications.checkboxField.checked=!0),this.clearSetMoreDetailsTimeout()}canBeDetailed(){return this.peerId!==w.Z.myId||!this.isDialog}createAvatar(){const e=new S.Z;return e.classList.add("profile-avatar","avatar-120"),e.isDialog=this.isDialog,e.attachClickEvent(),e}_setAvatar(){return z(this,void 0,void 0,(function*(){const{peerId:e}=this,t=!(!this.threadId||!(yield this.managers.appPeersManager.isForum(e)));if(this.canBeDetailed()&&!t&&(yield this.managers.appPeersManager.getPeerPhoto(e))){const t=this.avatars;return this.avatars=new D(this.scrollable,this.managers),yield this.avatars.setPeer(e),()=>{var e;this.avatars.info.append(this.name,this.subtitle),null===(e=this.avatar)||void 0===e||e.remove(),this.avatar=void 0,t?t.container.replaceWith(this.avatars.container):this.element.prepend(this.avatars.container),s.Z&&this.scrollable.container.classList.add("parallax")}}const i=this.createAvatar();return yield i.updateWithOptions({peerId:e,threadId:t?this.threadId:void 0,wrapOptions:{customEmojiSize:(0,u.C)(120,120),middleware:this.middlewareHelper.get()}}),()=>{var e;s.Z&&this.scrollable.container.classList.remove("parallax"),this.avatars&&(this.avatars.container.remove(),this.avatars.cleanup(),this.avatars=void 0),null===(e=this.avatar)||void 0===e||e.remove(),this.avatar=i,this.section.content.prepend(this.avatar,this.name,this.subtitle)}}))}setAvatar(e){const t=this._setAvatar();return e?t:t.then((e=>e()))}getUsernamesAlso(e){const t=e.slice(1);if(t.length){const e=t.map((e=>(0,o.Z)({username:e})));return(0,b.ag)("UsernameAlso",[(0,b.v_)(e,!1)])}}fillUsername(){return z(this,void 0,void 0,(function*(){const{peerId:e}=this;if(e.isUser()&&this.canBeDetailed()){const t=yield this.managers.appPeersManager.getPeerActiveUsernames(e),i=this.getUsernamesAlso(t);return()=>{this.username.subtitle.replaceChildren(i||(0,b.ag)("Username")),j(t[0],this.username)}}}))}fillUserPhone(){return z(this,void 0,void 0,(function*(){const{peerId:e}=this;if(e.isUser()&&this.canBeDetailed()){const{phone:t,isAnonymous:i}=(yield this.managers.appUsersManager.getUserPhone(e.toUserId()))||{};return()=>{this.phone.subtitle.replaceChildren((0,b.ag)(i?"AnonymousNumber":"Phone")),j(t?(0,O.Z)(t):void 0,this.phone)}}}))}fillNotifications(){return z(this,void 0,void 0,(function*(){const e=this.notifications;if(e){if(this.canBeDetailed()){const t=yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:this.peerId,respectType:!1,threadId:this.threadId});return()=>{e.checkboxField.checked=!t}}return()=>{e.container.style.display="none"}}}))}fillName(){return z(this,void 0,void 0,(function*(){const{peerId:e}=this,[t]=yield Promise.all([(0,U.Z)({peerId:e,dialog:this.isDialog,withIcons:!this.threadId,threadId:this.threadId})]);return()=>{(0,d.Z)(this.name,t)}}))}fillRows(e){return z(this,void 0,void 0,(function*(){return Promise.all([this.fillName(),this.fillUsername(),this.fillUserPhone(),this.fillNotifications(),this.setMoreDetails(void 0,e),this.setPeerStatus(!0,!0)]).then((e=>()=>{e.forEach((e=>null==e?void 0:e()))}))}))}fillProfileElements(){return z(this,void 0,void 0,(function*(){if(!this.cleaned)return;this.cleaned=!1,this.cleanupHTML();const e=(0,n.Z)();this.middlewareHelper.get().onClean((()=>{e.reject()}));const t=yield Promise.all([this.setAvatar(!0),this.fillRows(e)]);return()=>{e.resolve(),t.forEach((e=>null==e?void 0:e()))}}))}_setMoreDetails(e,t){return z(this,void 0,void 0,(function*(){const i=this.getMiddlewarePromise();if(this.threadId&&(yield i(this.managers.appPeersManager.isForum(e)))){let t="https://t.me/";const s=(0,g.Z)(this.threadId),n=yield i(this.managers.appPeersManager.getPeerUsername(e));return t+=n?`${n}/${s}`:`c/${e.toChatId()}/${s}`,()=>{j(t,this.link)}}const s=[];if(s.push((()=>{this.bio.subtitle.replaceChildren((0,b.ag)(e.isUser()?"UserBio":"Info")),j(t.about?(0,y.ZP)(t.about):void 0,this.bio)})),!e.isUser()){const n=yield i(this.managers.appChatsManager.getChat(e.toChatId())),a=(0,v.Z)(n);let o;if(a.length)o=this.getUsernamesAlso(a),s.push((()=>j("https://t.me/"+a[0],this.link)));else{const e=t.exported_invite;"chatInviteExported"===(null==e?void 0:e._)&&s.push((()=>j(e.link,this.link)))}s.push((()=>this.link.subtitle.replaceChildren(o||(0,b.ag)("SetUrlPlaceholder"))))}const n=t.location;return"channelLocation"==(null==n?void 0:n._)&&s.push((()=>j(n.address,this.location))),this.setMoreDetailsTimeout=window.setTimeout((()=>this.setMoreDetails(!0)),6e4),()=>{s.forEach((e=>e()))}}))}setMoreDetails(e,t){return z(this,void 0,void 0,(function*(){this.clearSetMoreDetailsTimeout();const{peerId:i}=this,s=this.getMiddlewarePromise();if(!i||!this.canBeDetailed()||(yield s(this.managers.appPeersManager.isPeerRestricted(i))))return;const n=yield s(this.managers.acknowledged.appProfileManager.getProfileByPeerId(i,e)),a=s(n.result).then((e=>z(this,void 0,void 0,(function*(){if(!(yield s(this.managers.appPeersManager.isPeerRestricted(i))))return yield s(this._setMoreDetails(i,e))}))));if(n.cached&&t)return a;(t||Promise.resolve()).then((()=>a)).then((e=>{null==e||e()}))}))}getMiddlewarePromise(){return(0,f.Z)(this.middlewareHelper.get(),(0,h.Z)("MIDDLEWARE"))}setPeer(e,t){var i;this.peerId===e&&this.threadId===t||(null===(i=this.init)||void 0===i||i.call(this),this.peerId=e,this.threadId=t,this.middlewareHelper.clean(),this.cleaned=!0)}clearSetMoreDetailsTimeout(){void 0!==this.setMoreDetailsTimeout&&(clearTimeout(this.setMoreDetailsTimeout),this.setMoreDetailsTimeout=void 0)}destroy(){var e;this.peerId=this.threadId=void 0,this.clearSetMoreDetailsTimeout(),clearInterval(this.setPeerStatusInterval),null===(e=this.avatars)||void 0===e||e.cleanup(),this.middlewareHelper.destroy()}}},8842:(e,t,i)=>{"use strict";i.d(t,{Z:()=>g});var s=i(3512),n=i(2325),a=i(5565),o=i(1507),r=i(8456),d=i(130),l=i(5953),c=i(8115),h=i(493),u=(i(4755),i(5948));i(3541);function p(e,t,i,n,a){return o=this,r=void 0,l=function*(){const t=[],o=yield s.Z.managers.appPeersManager.getPeer(e);if(o.pFlags.verified&&!i&&t.push(function(){const e=document.createElement("span");e.classList.add("verified-icon","tgico");const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"viewBox","0 0 26 26"),t.setAttributeNS(null,"width","26"),t.setAttributeNS(null,"height","26"),t.classList.add("verified-icon-svg");const i=document.createElementNS("http://www.w3.org/2000/svg","use");i.setAttributeNS(null,"href","#verified-icon-background"),i.classList.add("verified-icon-background");const s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttributeNS(null,"href","#verified-icon-check"),s.classList.add("verified-icon-check"),t.append(s,i),e.append(t),e}()),!o.pFlags.fake&&!o.pFlags.scam||n||t.push((0,u.Z)(o.pFlags.scam)),o.pFlags.premium&&!a){const e=o.emoji_status;e&&e._,t.push(function(){const e=document.createElement("span");return e.classList.add("premium-icon","tgico-star"),e}())}return t},new((d=void 0)||(d=Promise))((function(e,t){function i(e){try{n(l.next(e))}catch(e){t(e)}}function s(e){try{n(l.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof d?n:new d((function(e){e(n)}))).then(i,s)}n((l=l.apply(o,r||[])).next())}));var o,r,d,l}var f=i(9345);const m=new WeakMap;s.Z.addEventListener("peer_title_edit",(({peerId:e,threadId:t})=>{let i=`.peer-title[data-peer-id="${e}"]`;t&&(i+=`[data-thread-id="${t}"]`),Array.from(document.querySelectorAll(i)).forEach((e=>{const t=m.get(e);null==t||t.update()}))}));class g{constructor(e){this.element=document.createElement("span"),this.element.classList.add("peer-title"),(0,d.m)(this.element),this.options={},e&&this.update(e),m.set(this.element,this)}setOptions(e){if(e){(0,l.Z)(this.options,e);for(const t in e){const i=e[t];"object"!=typeof i&&"function"!=typeof i&&(this.element.dataset[t]=i?""+("boolean"==typeof i?+i:i):"0")}}}setHasInner(e){this.hasInner!==e&&(this.hasInner=e,this.element.classList.toggle("with-icons",e))}update(e){var t,i,l,u,m,g,v,b;return m=this,g=void 0,b=function*(){this.setOptions(e);let m,g=this.options.fromName;if(void 0!==g)return void 0!==this.options.limitSymbols&&(g=(0,r.Z)(g,this.options.limitSymbols,this.options.limitSymbols)),void(0,d.Z)(this.element,(0,c.Z)(g));null!==(t=(u=this.options).peerId)&&void 0!==t||(u.peerId=o.NM);const{peerId:v,threadId:b}=this.options;if(v===s.Z.myId&&this.options.dialog)(0,a.Z)(this.element,(0,n.ag)(this.options.onlyFirstName?"Saved":"SavedMessages"));else{if(b){const[e,t]=yield Promise.all([s.Z.managers.dialogsStorage.getForumTopic(v,b),s.Z.managers.appPeersManager.isForum(v)]);if(!e&&t)return s.Z.managers.dialogsStorage.getForumTopicById(v,b).then((e=>{if(!e&&this.options.threadId===b)return this.options.threadId=void 0,void this.update({threadId:void 0});this.update()}),(()=>{this.options.threadId===b&&(this.options.threadId=void 0,this.update({threadId:void 0}))})),(0,d.Z)(this.element,(0,n.ag)("Loading")),void this.setHasInner(!1)}const e=b&&this.options.withIcons?s.Z.managers.dialogsStorage.getForumTopic(v,b).then((e=>{var t;return(0,f.e)(Object.assign(Object.assign({},null!==(t=this.options.wrapOptions)&&void 0!==t?t:{}),{topic:e}))})):void 0,[t,a,o]=yield Promise.all([(0,h.Z)(this.options),this.options.withIcons&&p(v,null===(i=this.options.wrapOptions)||void 0===i||i.middleware)||this.options.withPremiumIcon&&p(v,null===(l=this.options.wrapOptions)||void 0===l||l.middleware,!0,!0),e]);if((null==a?void 0:a.length)||o){const e=document.createElement("span");e.classList.add("peer-title-inner"),m=!0,(0,d.Z)(e,t);const i=document.createDocumentFragment();i.append(...[o,e,...null!=a?a:[]].filter(Boolean)),(0,d.Z)(this.element,i)}else(0,d.Z)(this.element,t)}this.setHasInner(m)},new((v=void 0)||(v=Promise))((function(e,t){function i(e){try{n(b.next(e))}catch(e){t(e)}}function s(e){try{n(b.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof v?n:new v((function(e){e(n)}))).then(i,s)}n((b=b.apply(m,g||[])).next())}))}}},6765:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(1168),n=i(2325),a=i(2738),o=i(8678),r=i(2312);class d extends s.Z{constructor(e={}){super("popup-avatar",{closable:!0,withConfirm:!0}),this.image=new Image,this.cropper={crop:()=>{},removeHandlers:()=>{}},this.h6=document.createElement("h6"),(0,n.$d)(this.h6,"Popup.Avatar.Title"),this.btnClose.classList.remove("btn-icon"),this.header.append(this.h6),this.cropContainer=document.createElement("div"),this.cropContainer.classList.add("crop"),this.cropContainer.append(this.image),e.isForum&&this.cropContainer.classList.add("is-forum"),this.input=document.createElement("input"),this.input.type="file",this.input.style.display="none",this.listenerSetter.add(this.input)("change",(e=>{const t=e.target.files[0];t&&(0,o.Z)(t).then((e=>{this.image=new Image,this.cropContainer.append(this.image),this.image.src=e,this.image.onload=()=>{this.show(),this.cropper=function(e,t){let i,s,n,a={},o=0,r=0,d=0,l=0,c=0;function h(){e.classList.add("crop-blur"),e.draggable=!1,n=new Image,n.src=e.src,n.draggable=!1,n.classList.add("crop-overlay-image"),t||(t=document.createElement("canvas")),i=document.createElement("div"),i.classList.add("crop-component"),s=document.createElement("div"),s.classList.add("crop-overlay");const a=document.createElement("div");a.classList.add("crop-overlay-color"),i.appendChild(s),e.parentNode.appendChild(i),i.appendChild(n),i.appendChild(e),i.appendChild(a),s.appendChild(n),n.style.maxWidth=e.width+"px",c=e.naturalWidth/e.offsetWidth;const o=e.offsetWidth/2-100,r=e.offsetHeight/2-100;u(200,200),p(o,r),f(o,r),s.addEventListener("mousedown",b,!1),s.addEventListener("touchstart",b,!1),s.addEventListener("wheel",v,!1),document.addEventListener("keypress",g,!1)}function u(e,t){d=e*c,l=t*c,s.style.width=e+"px",s.style.height=t+"px"}function p(e,t){r=t*c,o=e*c,n.style.top=-t+"px",n.style.left=-e+"px"}function f(e,t){s.style.top=t+"px",s.style.left=e+"px"}function m(e){e=e*Math.PI*2;let t,i,a,o,r=Math.floor(s.clientWidth+e),d=Math.floor(s.clientHeight+e),l=n.clientWidth,c=n.clientHeight;r<50||r>l||(t=s.offsetLeft-e/2,i=s.offsetTop-e/2,a=t+r,o=i+d,t<0&&(t=0),i<0&&(i=0),a>l||o>c||(u(r,r),p(t,i),f(t,i)))}function g(e){switch(e.preventDefault(),String.fromCharCode(e.charCode)){case"+":m(4);break;case"-":m(-4)}}function v(e){e.preventDefault(),m(e.deltaY>0?1:-1)}function b(e){e.preventDefault(),e.stopPropagation(),function(e){a.container_width=s.offsetWidth,a.container_height=s.offsetHeight,a.container_left=s.offsetLeft,a.container_top=s.offsetTop,a.mouse_x=(e.clientX||e.pageX||e.touches&&e.touches[0].clientX)+window.scrollX,a.mouse_y=(e.clientY||e.pageY||e.touches&&e.touches[0].clientY)+window.scrollY}(e),document.addEventListener("mousemove",w),document.addEventListener("touchmove",w),document.addEventListener("mouseup",y),document.addEventListener("touchend",y)}function y(e){e.preventDefault(),document.removeEventListener("mouseup",y),document.removeEventListener("touchend",y),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",w)}function w(e){let t,i,o,r,d={x:0,y:0};e.preventDefault(),e.stopPropagation(),d.x=e.pageX||e.touches&&e.touches[0].pageX,d.y=e.pageY||e.touches&&e.touches[0].pageY,t=d.x-(a.mouse_x-a.container_left),i=d.y-(a.mouse_y-a.container_top),o=s.offsetWidth,r=s.offsetHeight,t<0?t=0:t>n.offsetWidth-o&&(t=n.offsetWidth-o),i<0?i=0:i>n.offsetHeight-r&&(i=n.offsetHeight-r),p(t,i),f(t,i)}return e.complete?h():e.onload=h,{crop:function(){t.width=d,t.height=l,t.getContext("2d").drawImage(e,o,r,d,l,0,0,d,l)},removeHandlers:function(){s.removeEventListener("mousedown",b),s.removeEventListener("touchstart",b),s.removeEventListener("wheel",v),document.removeEventListener("mouseup",y),document.removeEventListener("touchend",y),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",w),document.removeEventListener("keypress",g),i.remove(),s.remove(),n.remove()}}}(this.image,this.canvas),this.input.value=""}}))}),!1),this.btnConfirm.className="btn-primary btn-color-primary btn-circle btn-crop btn-icon tgico-check z-depth-1",(0,a.fc)(this.btnConfirm,(()=>{this.cropper.crop(),this.hide(),this.canvas.toBlob((e=>{this.blob=e,this.darkenCanvas(),this.resolve()}),"image/jpeg",1)}),{listenerSetter:this.listenerSetter}),this.container.append(this.cropContainer,this.btnConfirm,this.input),this.addEventListener("closeAfterTimeout",(()=>{this.cropper.removeHandlers(),this.image&&this.image.remove()}))}resolve(){this.onCrop((()=>r.Z.upload(this.blob)))}open(e,t){this.canvas=e,this.onCrop=t,this.input.click()}darkenCanvas(){const e=this.canvas.getContext("2d");e.fillStyle="rgba(0, 0, 0, 0.3)",e.fillRect(0,0,this.canvas.width,this.canvas.height)}}},2986:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(1168),n=i(2738),a=i(4755),o=i(2325),r=i(503);class d extends s.Z{constructor(e,t,i={}){if(super("popup-date-picker",Object.assign({body:!0,overlayClosable:!0,buttons:i.noButtons?[]:[{langKey:"JumpToDate",callback:()=>{this.onPick&&this.onPick(this.selectedDate.getTime()/1e3|0)}},{langKey:"Cancel",isCancel:!0}],title:!0},i)),this.onPick=t,this.options=i,this.onPrevClick=e=>{this.selectedMonth.setMonth(this.selectedMonth.getMonth()-1),this.setMonth(),this.selectedMonth.getTime()===this.minMonth.getTime()&&this.prevBtn.setAttribute("disabled","true"),this.nextBtn.removeAttribute("disabled")},this.onNextClick=e=>{this.selectedMonth.setMonth(this.selectedMonth.getMonth()+1),this.setMonth(),this.selectedMonth.getTime()===this.maxMonth.getTime()&&this.nextBtn.setAttribute("disabled","true"),this.prevBtn.removeAttribute("disabled")},this.onDateClick=e=>{const t=e.target;if(!t.dataset.timestamp)return;if(this.selectedEl){if(this.selectedEl===t)return;this.selectedEl.classList.remove("active")}this.selectedEl=t,t.classList.add("active");const i=+t.dataset.timestamp;this.selectedDate=new Date(i),this.setTitle(),this.setTimeTitle()},this.minDate=i.minDate||new Date("2013-08-01T00:00:00"),e{const n=""+e;this.listenerSetter.add(t.input)("input",(a=>{let o=t.value.replace(/\D/g,"");o.length>2?o=o.slice(0,2):(1===o.length&&+o[0]>+n[0]||2===o.length&&+o>e)&&(2===o.length&&s&&s(+o[1]),o="0"+o[0]),t.setValueSilently(o),i(o.length)}))};this.hoursInputField=new r.ZP({plainText:!0}),this.minutesInputField=new r.ZP({plainText:!0}),i(23,this.hoursInputField,(e=>{2===e&&this.minutesInputField.input.focus(),this.setTimeTitle()}),(e=>{this.minutesInputField.value=(e+this.minutesInputField.value).slice(0,2)})),i(59,this.minutesInputField,(e=>{e||this.hoursInputField.input.focus(),this.setTimeTitle()})),this.selectedDate=e,e.setMinutes(e.getMinutes()+10),this.hoursInputField.setValueSilently(("0"+e.getHours()).slice(-2)),this.minutesInputField.setValueSilently(("0"+e.getMinutes()).slice(-2)),e.setHours(0,0,0,0),this.timeDiv.append(this.hoursInputField.container,t,this.minutesInputField.container),(0,n.fc)(this.btnConfirm,(()=>{this.onPick&&(this.selectedDate.setHours(+this.hoursInputField.value||0,+this.minutesInputField.value||0,0,0),this.onPick(this.selectedDate.getTime()/1e3|0)),this.hide()}),{listenerSetter:this.listenerSetter}),this.body.append(this.timeDiv),this.prevBtn.classList.add("primary"),this.nextBtn.classList.add("primary")}const s=document.createElement("div");s.classList.add("popup-centerer"),s.append(this.container),this.element.append(s),e.setHours(0,0,0,0),this.selectedDate=e,this.maxDate=i.maxDate||new Date,this.maxDate.setHours(0,0,0,0),this.selectedMonth=new Date(this.selectedDate),this.selectedMonth.setDate(1),this.maxMonth=new Date(this.maxDate),this.maxMonth.setDate(1),this.minMonth=new Date(this.minDate),this.minMonth.setHours(0,0,0,0),this.minMonth.setDate(1),this.selectedMonth.getTime()===this.minMonth.getTime()&&this.prevBtn.setAttribute("disabled","true"),this.selectedMonth.getTime()===this.maxMonth.getTime()&&this.nextBtn.setAttribute("disabled","true"),i.noTitle&&(this.setTitle=()=>{}),this.setTimeTitle(),this.setTitle(),this.setMonth()}setTimeTitle(){if(this.btnConfirm&&this.selectedDate){let e;const t=[],i=new Date;i.setHours(0,0,0,0);const s={minute:"2-digit",hour:"2-digit"},n=new Date(this.selectedDate.getTime());if(n.setHours(+this.hoursInputField.value,+this.minutesInputField.value),this.selectedDate.getTime()===i.getTime())e="Schedule.SendToday";else{e="Schedule.SendDate";const s={month:"short",day:"numeric"};n.getFullYear()!==i.getFullYear()&&(s.year="numeric"),t.push(new o.ZP.IntlDateElement({date:n,options:s}).element)}t.push(new o.ZP.IntlDateElement({date:n,options:s}).element),this.btnConfirm.firstChild.replaceWith((0,o.ag)(e,t))}}setTitle(){this.title.textContent="",this.title.append(new o.ZP.IntlDateElement({date:this.selectedDate,options:{day:"numeric",month:"long",weekday:"short"}}).element)}renderElement(e,t=""){const i=document.createElement("button");return i.classList.add("btn-icon","date-picker-month-date"),e&&i.setAttribute("disabled","true"),t&&i.append(t),i}setMonth(){const e=new Date(this.selectedMonth),t={year:"numeric",month:this.timeDiv&&a.Z.isMobile?"short":"long"};this.monthTitle.textContent="",this.monthTitle.append(new o.ZP.IntlDateElement({date:e,options:t}).element),this.month&&this.month.remove(),this.month=document.createElement("div"),this.month.classList.add("date-picker-month");const i=new Date,s=i.getDay();1!==s&&i.setHours(-24*(s-1));for(let e=0;e<7;++e){const e=this.renderElement(!0,new o.ZP.IntlDateElement({date:i,options:{weekday:"narrow"}}).element);e.classList.remove("date-picker-month-date"),e.classList.add("date-picker-month-day"),this.month.append(e),i.setDate(i.getDate()+1)}let n=e.getDay()-1;-1===n&&(n=6);const r=new Date(e.getTime());r.setDate(r.getDate()-n-1);for(let e=0;ethis.maxDate||e{"use strict";i.d(t,{Z:()=>o});var s=i(1168),n=i(7362),a=i(8127);class o{constructor(e,t,i,s){this.peerId=e,this.peerType=t,this.onSelect=i,this.threadId=s,this.construct()}construct(){return e=this,t=void 0,o=function*(){let{peerId:e,peerType:t,onSelect:i,threadId:o}=this;const r=yield(0,n.Z)({peerId:e,threadId:o}),d=s.Z.MANAGERS;void 0===t&&(t=yield d.appPeersManager.getDialogType(e));const l=(t,s=g&&!!t.size)=>{let n=d.appChatsManager.leave(e.toChatId());s&&(n=n.then((()=>d.appMessagesManager.flushHistory(e)))),null==i||i(n)},c=t=>{let s;if(o)s=d.appMessagesManager.flushHistory(e,!1,!0,o);else if(e.isUser())s=d.appMessagesManager.flushHistory(e,!1,g?!!t.size:void 0);else{if(!t.size)return l(t);s=d.appChatsManager.delete(e.toChatId())}null==i||i(s)};let h,u,p,f,m,g;switch(t){case"channel":(yield d.appChatsManager.hasRights(e.toChatId(),"delete_chat"))?(h="ChannelDeleteMenu",p="AreYouSureDeleteAndExitChannel",m=[{langKey:"ChannelDeleteMenu",isDanger:!0,callback:c}],g=[{text:"DeleteChannelForAll"}]):(h="LeaveChannelMenu",p="ChannelLeaveAlertWithName",f=[r],m=[{langKey:"LeaveChannel",isDanger:!0,callback:l}]);break;case"chat":h="DeleteChatUser",p="AreYouSureDeleteThisChatWithUser",f=[r],m=[{langKey:"DeleteChatUser",isDanger:!0,callback:c}],g=[{text:"DeleteMessagesOptionAlso",textArgs:[yield(0,n.Z)({peerId:e})]}];break;case"saved":h="DeleteChatUser",p="AreYouSureDeleteThisChatSavedMessages",m=[{langKey:"DeleteChatUser",isDanger:!0,callback:c}];break;case"megagroup":case"group":o?(h="DeleteTopics",u=[1],p="DeleteSelectedTopic",f=[r],m=[{langKey:"Delete",isDanger:!0,callback:c}]):(yield d.appChatsManager.hasRights(e.toChatId(),"delete_chat"))?(h="DeleteMegaMenu",p="AreYouSureDeleteAndExit",m=[{langKey:"DeleteMegaMenu",isDanger:!0,callback:c}],g=[{text:"DeleteChat.DeleteGroupForAll"}]):(h="LeaveMegaMenu",p="AreYouSureDeleteAndExitName",f=[r],m=[{langKey:"DeleteChatUser",isDanger:!0,callback:e=>l(e,!0)}])}s.Z.createPopup(a.Z,"popup-delete-chat",{peerId:e,threadId:o,titleLangKey:h,titleLangArgs:u,descriptionLangKey:p,descriptionLangArgs:f,buttons:m,checkboxes:g}).show()},new((i=void 0)||(i=Promise))((function(s,n){function a(e){try{d(o.next(e))}catch(e){n(e)}}function r(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,r)}d((o=o.apply(e,t||[])).next())}));var e,t,i,o}}},5128:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(3512),n=i(1168),a=i(8127),o=i(2325),r=i(7120),d=i(2353),l=i(7362),c=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class h{constructor(e,t,i,s,n){this.peerId=e,this.mids=t,this.type=i,this.onConfirm=s,this.threadId=n,this.construct()}construct(){return c(this,void 0,void 0,(function*(){let{peerId:e,mids:t,type:i,onConfirm:h,threadId:u}=this;const p=yield(0,l.Z)({peerId:e,threadId:u}),f=n.Z.MANAGERS;t=t.slice();const m=(s,n)=>{h&&h(),"scheduled"===i?f.appMessagesManager.deleteScheduledMessages(e,t):f.appMessagesManager.deleteMessages(e,t,!!s.size||n)},g=[{langKey:"Delete",isDanger:!0,callback:m}],v=[];let b,y,w,S;if(1===t.length?b="DeleteSingleMessagesTitle":(b="DeleteMessagesTitle",y=[(0,o.ag)("messages",[t.length])]),w=(yield f.appPeersManager.isMegagroup(e))?1===t.length?"AreYouSureDeleteSingleMessageMega":"AreYouSureDeleteFewMessagesMega":1===t.length?"AreYouSureDeleteSingleMessage":"AreYouSureDeleteFewMessages",e===s.Z.myId||"scheduled"===i);else if(e.isUser())v.push({text:"DeleteMessagesOptionAlso",textArgs:[p]});else{const i=yield f.appChatsManager.getChat(e.toChatId()),n=(0,r.Z)(i,"delete_messages");if("chat"===i._){const i=n?t.slice():yield(0,d.Z)(t,(t=>c(this,void 0,void 0,(function*(){return(yield f.appMessagesManager.getMessageByPeer(e,t)).fromId===s.Z.myId}))));i.length&&(i.length===t.length?v.push({text:"DeleteForAll"}):(v.push({text:"DeleteMessagesOption"}),w="DeleteMessagesTextGroup",S=[(0,o.ag)("messages",[i.length])]))}else g[0].callback=e=>m(e,!0)}(0,n.x)(g),n.Z.createPopup(a.Z,"popup-delete-chat",{peerId:e,threadId:u,titleLangKey:b,titleLangArgs:y,descriptionLangKey:w,descriptionLangArgs:S,buttons:g,checkboxes:v}).show()}))}}},4524:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(7238),n=i(7030),a=i(3512),o=i(2796),r=i(2995),d=i(7530),l=i(1168),c=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class h extends r.Z{constructor(e,t,i=["send_plain"]){super({peerTypes:["dialogs","contacts"],onSelect:!e&&t?t:i=>c(this,void 0,void 0,(function*(){if(t){const e=t(i);e instanceof Promise&&(yield e)}if(i!==a.Z.myId)n.ZP.setInnerPeer({peerId:i}),n.ZP.chat.input.initMessagesForward(e);else{let t=0;for(const s in e){const n=e[s];t+=n.length,this.managers.appMessagesManager.forwardMessages(i,s.toPeerId(),n)}(0,o.bC)({langPackKey:t>0?"FwdMessagesToSavedMessages":"FwdMessageToSavedMessages"})}})),placeholder:"ShareModal.Search.ForwardPlaceholder",chatRightsActions:i,selfPresence:"ChatYourSelf"})}static create(...e){return c(this,void 0,void 0,(function*(){const[t]=e,i=Object.keys(t).map((e=>t[e].map((t=>a.Z.managers.appMessagesManager.getMessageByPeer(e.toPeerId(),t))))),n=yield Promise.all((0,s.Z)(i)),o=new Set;n.forEach((e=>{if(!e)return;const t=(0,d.Z)(e);let i;if(t)if("webPage"===t._)i="embed_links";else if("photo"===t._)i="send_photos";else if("game"===t._)i="send_games";else switch(t.type){case"audio":i="send_audios";break;case"gif":i="send_gifs";break;case"round":i="send_roundvideos";break;case"sticker":i="send_stickers";break;case"voice":i="send_voices";break;case"video":i="send_videos";break;default:i="send_docs"}else i=e.viaBotId?"send_inline":"send_plain";i&&o.add(i)})),l.Z.createPopup(h,e[0],e[1],Array.from(o))}))}}},1168:(e,t,i)=>{"use strict";i.d(t,{Z:()=>L,x:()=>I});var s=i(1405),n=i(5814),a=i(5824),o=i(2325),r=i(8497),d=i(8799),l=i(3699),c=i(2738),h=i(6299),u=i(3910),p=i(3241),f=i(6733),m=i(1655),g=i(3815),v=i(8805),b=i(3624),y=i(8115);const w=document.body;let S=w;const C=()=>{S=(0,f.W7)()||w,L.reAppend()};(0,f.Ms)(w,C);class L extends p.Z{constructor(e,t={}){if(super(!1),this.element=document.createElement("div"),this.container=document.createElement("div"),this.header=document.createElement("div"),this.title=document.createElement("div"),this.onEscape=()=>!0,this.hide=()=>{a.Z.backByItem(this.navigationItem)},this.element.classList.add("popup"),this.element.className="popup"+(e?" "+e:""),this.container.classList.add("popup-container","z-depth-1"),this.header.classList.add("popup-header"),(t.title||t.titleRaw)&&(this.title.classList.add("popup-title"),"string"==typeof t.title?(0,o.$d)(this.title,t.title):t.titleRaw&&this.title.append((0,y.Z)(t.titleRaw)),this.header.append(this.title)),this.middlewareHelper=(0,b.k)(),this.listenerSetter=new l.Z,this.managers=L.MANAGERS,this.confirmShortcutIsSendShortcut=t.confirmShortcutIsSendShortcut,t.closable&&(this.btnClose=document.createElement("span"),this.btnClose.classList.add("btn-icon","popup-close","tgico-close"),this.header.prepend(this.btnClose),(0,c.fc)(this.btnClose,this.hide,{listenerSetter:this.listenerSetter,once:!0})),this.withoutOverlay=t.withoutOverlay,this.withoutOverlay&&this.element.classList.add("no-overlay"),t.overlayClosable&&(0,c.fc)(this.element,(e=>{(0,r.Z)(e.target,"popup-container")||this.hide()}),{listenerSetter:this.listenerSetter}),t.withConfirm&&(this.btnConfirm=document.createElement("button"),this.btnConfirm.classList.add("btn-primary","btn-color-primary"),!0!==t.withConfirm&&this.btnConfirm.append((0,o.ag)(t.withConfirm)),this.header.append(this.btnConfirm),(0,s.Z)(this.btnConfirm)),this.container.append(this.header),t.body&&(this.body=document.createElement("div"),this.body.classList.add("popup-body"),this.container.append(this.body)),t.scrollable){const e=this.scrollable=new v.ZP(this.body);this.attachScrollableListeners(),this.body||this.container.insertBefore(e.container,this.header.nextSibling)}let i=this.btnConfirm;const n=this.buttons=t.buttons;if(null==n?void 0:n.length){const e=this.buttonsEl=document.createElement("div");e.classList.add("popup-buttons");const t=n.map((e=>{const t=document.createElement("button");return t.className="btn"+(e.isDanger?" danger":" primary"),e.noRipple||(0,s.Z)(t),e.text?t.textContent=e.text:t.append((0,o.ag)(e.langKey,e.langArgs)),(0,c.fc)(t,(()=>{var t;null===(t=e.callback)||void 0===t||t.call(e),this.destroy()}),{listenerSetter:this.listenerSetter,once:!0}),e.element=t}));if(!i&&2===n.length){const e=n.find((e=>!e.isCancel));e&&(i=e.element)}e.append(...t),this.container.append(e)}this.btnConfirmOnEnter=i,this.element.append(this.container),L.POPUPS.push(this)}attachScrollableListeners(e){return this.scrollable.attachBorderListeners(e)}onContentUpdate(){this.scrollable&&this.scrollable.onAdditionalScroll()}show(){this.navigationItem={type:"popup",onPop:()=>this.destroy(),onEscape:this.onEscape},a.Z.pushItem(this.navigationItem),(0,d.Z)(),S.append(this.element),this.element.offsetWidth,this.element.classList.add("active"),this.onContentUpdate(),this.withoutOverlay||(g.Z.isOverlayActive=!0,n.Z.checkAnimations2(!0)),setTimeout((()=>{this.element.classList.contains("active")&&this.listenerSetter.add(document.body)("keydown",(e=>{L.POPUPS[L.POPUPS.length-1]===this&&(this.confirmShortcutIsSendShortcut?(0,h.Z)(e):"Enter"===e.key)&&((0,c.tH)(this.btnConfirmOnEnter),(0,u.Z)(e))}))}),0)}destroy(){this.dispatchEvent("close"),this.element.classList.add("hiding"),this.element.classList.remove("active"),this.listenerSetter.removeAll(),this.middlewareHelper.destroy(),this.withoutOverlay||(g.Z.isOverlayActive=!1),a.Z.removeItem(this.navigationItem),this.navigationItem=void 0,(0,m.Z)(L.POPUPS,this),C(),setTimeout((()=>{var e;this.element.remove(),this.dispatchEvent("closeAfterTimeout"),this.cleanup(),null===(e=this.scrollable)||void 0===e||e.destroy(),this.withoutOverlay||n.Z.checkAnimations2(!1)}),150)}static reAppend(){this.POPUPS.forEach((e=>{const{element:t,container:i}=e,s=t.parentElement;s&&s!==S&&S!==i&&S.append(t)}))}static getPopups(e){return this.POPUPS.filter((t=>t instanceof e))}static createPopup(e,...t){return new e(...t)}}L.POPUPS=[];const I=e=>(e.find((e=>e.isCancel))||e.push({langKey:"Cancel",isCancel:!0}),e)},1842:(e,t,i)=>{"use strict";i.d(t,{Z:()=>f});var s=i(1168),n=i(130),a=i(2575),o=i(7030),r=i(2325),d=i(1507),l=i(8115),c=i(9331),h=i(9931),u=i(2796),p=i(9492);class f extends s.Z{constructor(e,t){super("popup-join-chat-invite",{closable:!0,overlayClosable:!0,body:!0,buttons:(0,s.x)([{langKey:t.pFlags.request_needed?"RequestJoin.Button":t.pFlags.broadcast?"JoinByPeekChannelTitle":"JoinByPeekGroupTitle",callback:()=>{this.managers.appChatsManager.importChatInvite(e).then((e=>{const t=e.toPeerId(!0);o.ZP.setInnerPeer({peerId:t})}),(e=>{"INVITE_REQUEST_SENT"===e.type&&(0,u.bC)({langPackKey:"RequestToJoinSent"})}))}}])}),this.hash=e,this.chatInvite=t,this.construct()}construct(){return e=this,t=void 0,s=function*(){this.header.remove();const{chatInvite:e,managers:t,hash:i}=this,s=new c.Z;s.classList.add("avatar-100"),s.isDialog=!1,"photo"===e.photo._?(e.photo=yield t.appPhotosManager.savePhoto(e.photo),(0,p.Z)({container:s,message:null,photo:e.photo,boxHeight:100,boxWidth:100,withoutPreloader:!0}),s.style.width=s.style.height=""):(0,h.Z)({div:s,peerId:d.NM,isDialog:!1,title:e.title});const o=document.createElement("div");o.classList.add("chat-title"),(0,n.Z)(o,(0,l.Z)(e.title));const u=e.pFlags.broadcast,f=(0,r.ag)(u?"Subscribers":"Members",[(0,a.Z)(e.participants_count)]);if(f.classList.add("chat-participants-count"),this.body.append(s,o,f),e.pFlags.request_needed){const e=document.createElement("div");(0,r.$d)(e,u?"RequestToJoinChannelDescription":"RequestToJoinGroupDescription"),e.classList.add("chat-participants-count","request-caption"),this.body.append(e)}this.show()},new((i=void 0)||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}));var e,t,i,s}}},3186:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(5994),n=i(3035),a=i(7030),o=i(2325),r=i(3512),d=i(8127);const l={pin:{title:"LimitReached",description:"LimitReachedPinDialogs",descriptionPremium:"LimitReachedPinDialogsPremium",descriptionLocked:"LimitReachedPinDialogsLocked",icon:"limit_pin"},folders:{title:"LimitReached",description:"LimitReachedFolders",descriptionPremium:"LimitReachedFoldersPremium",descriptionLocked:"LimitReachedFoldersLocked",icon:"limit_folders"}};class c extends d.Z{constructor(e,t){super("popup-limit",{buttons:void 0===e.isPremium?[{langKey:"LimitReached.Ok",isCancel:!0}]:e.isPremium?[{langKey:"OK",isCancel:!0}]:[{langKey:"IncreaseLimit",callback:()=>{a.ZP.openPremiumBot()},noRipple:!0},{langKey:"Cancel",isCancel:!0}],descriptionLangKey:void 0===e.isPremium?t.descriptionLocked:e.isPremium?t.descriptionPremium:t.description,descriptionLangArgs:e.isPremium?[e.limitPremium]:[e.limit,e.limitPremium],titleLangKey:t.title});const i=void 0===e.isPremium;if(i)this.element.classList.add("is-locked");else if(e.isPremium)this.element.classList.add("is-premium");else{const e=this.buttons.find((e=>!e.isCancel));e.element.classList.add("popup-limit-button");const t=document.createElement("i");t.classList.add("popup-limit-button-icon","tgico-premium_double"),e.element.append(t)}const r=document.createElement("div");r.classList.add("popup-limit-line");const d=document.createElement("div");d.classList.add("popup-limit-hint");const l=document.createElement("span");if(l.classList.add("popup-limit-hint-icon","tgico-"+t.icon),d.append(l,""+(e.isPremium?e.limitPremium:e.limit)),r.append(d),!i){const t=document.createElement("div");t.classList.add("limit-line");const i=document.createElement("div");i.classList.add("limit-line-free");const s=document.createElement("div");s.classList.add("limit-line-premium"),t.append(i,s),(0,o.$d)(i,"LimitFree"),s.append((0,o.ag)("LimitPremium"),""+e.limitPremium),r.append(t)}this.container.insertBefore(r,this.description);const c=()=>{d.classList.add("active")};s.Z.isAvailable("animations")?(0,n.d1)().then(c):c()}}function h(e){return function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const t=l[e],[i,s,n]=yield Promise.all([r.Z.managers.apiManager.getAppConfig(),...[!1,!0].map((t=>r.Z.managers.apiManager.getLimit(e,t)))]),a=i.premium_purchase_blocked;new c({isPremium:a?void 0:r.Z.premium,limit:s,limitPremium:n},t).show()}))}},3897:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(7298),n=i(1507),a=i(7479),o=i(8127);const r=[{value:3600,langPackKey:"ChatList.Mute.1Hour"},{value:14400,langPackKey:"ChatList.Mute.4Hours"},{value:28800,langPackKey:"ChatList.Mute.8Hours"},{value:86400,langPackKey:"ChatList.Mute.1Day"},{value:259200,langPackKey:"ChatList.Mute.3Days"},{value:-1,langPackKey:"ChatList.Mute.Forever",checked:!0}];class d extends o.Z{constructor(e,t){let i;super("popup-mute",{peerId:e,titleLangKey:"Notifications",buttons:[{langKey:"ChatList.Context.Mute",callback:()=>{this.managers.appMessagesManager.mutePeer({peerId:e,muteUntil:-1===i?n.rU:(0,s.Z)(!0)+i,threadId:t})}}],body:!0});const o=(0,a.ZC)(r,(e=>{i=+e}));this.body.append(o),this.show()}}},805:(e,t,i)=>{"use strict";i.d(t,{Z:()=>H,Y:()=>U});var s=i(1168),n=i(2796),a=i(6676),o=i(9405),r=i(7814);function d(e){let t,i;return e instanceof HTMLVideoElement?(t=e.videoWidth,i=e.videoHeight):(t=e.naturalWidth,i=e.naturalHeight),(0,r.Z)({media:e,mediaSize:(0,o.C)(t,i),boxSize:(0,o.C)(320,240),quality:.9})}var l=i(2325),c=i(9897),h=i(2398),u=i(2738),p=i(2341);function f(e){const t=e.src;return fetch(t).then((e=>e.arrayBuffer())).then((e=>{const t=new Uint8Array(e);let i=0;for(let e=0,s=t.length;e{const{input:e}=this.messageInputField;this.scrollable.onAdditionalScroll(),e.scrollTop>0&&e.scrollHeight>130&&this.scrollable.container.classList.remove("scrolled-bottom")},this.onKeyDown=e=>{const t=e.target,{input:i}=this.messageInputField;if(t!==i){if("INPUT"===t.tagName||t.isContentEditable)return;i.focus(),(0,h.Z)(i)}},this.attachFile=e=>{const t=this.willAttach,i=this.shouldCompress(e.type),s=document.createElement("div");s.classList.add("popup-item");const n={file:e};(0,P.Z)(n,["scaledBlob","middlewareHelper","itemDiv","mediaSpoiler"]),n.middlewareHelper=this.middlewareHelper.get().create(),n.itemDiv=s;const a=i?this.attachMedia(n):this.attachDocument(n);return t.sendFileDetails.push(n),a.catch((e=>{s.style.backgroundColor="#000",console.error("error rendering file",e)}))},this.animationGroup="",this.construct(i)}static canSend(e,t){return N(this,void 0,void 0,(function*(){const i=["send_photos","send_videos","send_docs","send_audios","send_gifs"],s=i.map((i=>!(e.isAnyChat()&&!t)||F.Z.managers.appChatsManager.hasRights(e.toChatId(),i))),n={},a=yield Promise.all(s);return i.forEach(((e,t)=>{n[e]=a[t]})),n}))}construct(e){return N(this,void 0,void 0,(function*(){this.willAttach={type:e,sendFileDetails:[],group:!0};const t=yield this.managers.apiManager.getLimit("caption");this.captionLengthMax=t;const i=yield H.canSend(this.chat.peerId,!0),s=i.send_photos,n=i.send_videos,o=i.send_docs;(0,u.fc)(this.btnConfirm,(()=>this.send()),{listenerSetter:this.listenerSetter});const r=yield(0,T.Z)({listenerSetter:this.listenerSetter,direction:"bottom-left",buttons:[{icon:"image",text:"Popup.Attach.AsMedia",onClick:()=>this.changeType("media"),verify:()=>{if(!this.hasAnyMedia()||"document"!==this.willAttach.type)return!1;if(!s&&!n)return!1;if(!s||!n){const e=s?A.Z:_.Z,{media:t,files:i}=this.partition(e);if(i.length)return!1}return!0}},{icon:"document",text:"SendAsFile",onClick:()=>this.changeType("document"),verify:()=>1===this.files.length&&"document"!==this.willAttach.type&&o},{icon:"document",text:"SendAsFiles",onClick:()=>this.changeType("document"),verify:()=>this.files.length>1&&"document"!==this.willAttach.type&&o},{icon:"groupmedia",text:"Popup.Attach.GroupMedia",onClick:()=>this.changeGroup(!0),verify:()=>!this.willAttach.group&&this.canGroupSomething()},{icon:"groupmediaoff",text:"Popup.Attach.UngroupMedia",onClick:()=>this.changeGroup(!1),verify:()=>this.willAttach.group&&this.canGroupSomething()},{icon:"mediaspoiler",text:"EnablePhotoSpoiler",onClick:()=>this.changeSpoilers(!0),verify:()=>this.canToggleSpoilers(!0,!0)},{icon:"mediaspoiler",text:"Popup.Attach.EnableSpoilers",onClick:()=>this.changeSpoilers(!0),verify:()=>this.canToggleSpoilers(!0,!1)},{icon:"mediaspoileroff",text:"DisablePhotoSpoiler",onClick:()=>this.changeSpoilers(!1),verify:()=>this.canToggleSpoilers(!1,!0)},{icon:"mediaspoileroff",text:"Popup.Attach.RemoveSpoilers",onClick:()=>this.changeSpoilers(!1),verify:()=>this.canToggleSpoilers(!1,!1)}]});this.header.append(r),this.btnConfirm.remove(),this.mediaContainer=document.createElement("div"),this.mediaContainer.classList.add("popup-photo"),this.scrollable.container.append(this.mediaContainer);const d=this.inputContainer=document.createElement("div");d.classList.add("popup-input-container");const l=document.createElement("div");let c,h,p;if(l.classList.add("popup-input-inputs","input-message-container"),this.messageInputField=new x.Z({placeholder:"PreviewSender.CaptionPlaceholder",name:"message",withLinebreaks:!0,maxLength:this.captionLengthMax}),this.listenerSetter.add(this.scrollable.container)("scroll",this.onScroll),this.listenerSetter.add(this.messageInputField.input)("scroll",this.onScroll),this.messageInputField.input.classList.replace("input-field-input","input-message-input"),this.messageInputField.inputFake.classList.replace("input-field-input","input-message-input"),l.append(this.messageInputField.input,this.messageInputField.inputFake),d.append(l,this.btnConfirm),this.ignoreInputValue||(this.messageInputField.value=this.wasInputValue=this.chat.input.messageInputField.input.innerHTML,this.chat.input.messageInputField.value=""),this.container.append(d),this.attachFiles(),this.addEventListener("close",(()=>{this.files.length=0,this.willAttach.sendFileDetails.length=0,O===this&&(O=void 0)})),(0,C.Z)({buttons:[{icon:"mediaspoiler",text:"EnablePhotoSpoiler",onClick:()=>{this.applyMediaSpoiler(p)},verify:()=>h&&!p.mediaSpoiler},{icon:"mediaspoileroff",text:"DisablePhotoSpoiler",onClick:()=>{this.removeMediaSpoiler(p)},verify:()=>!(!h||!p.mediaSpoiler)}],listenTo:this.mediaContainer,listenerSetter:this.listenerSetter,findElement:e=>(c=(0,L.Z)(e.target,"popup-item"),h=c.classList.contains("popup-item-media"),p=this.willAttach.sendFileDetails.find((e=>e.itemDiv===c)),c)}),"scheduled"!==this.chat.type){const e=new a.Z({onSilentClick:()=>{this.chat.input.sendSilent=!0,this.send()},onScheduleClick:()=>{this.chat.input.scheduleSending((()=>{this.send()}))},openSide:"top-left",onContextElement:this.btnConfirm,listenerSetter:this.listenerSetter});e.setPeerId(this.chat.peerId),this.container.append(e.sendMenu)}O=this}))}applyMediaSpoiler(e,t){return N(this,void 0,void 0,(function*(){const i=e.middlewareHelper.get(),{width:s,height:n}=e.itemDiv.style;let a,d;if(e.itemDiv.classList.contains("album-item")){const{width:t,height:i}=e.itemDiv.parentElement.style,o=parseInt(t),r=parseInt(i);a=+s.slice(0,-1)/100*o,d=+n.slice(0,-1)/100*r}else a=parseInt(s),d=parseInt(n);const{url:l}=yield(0,r.Z)({media:e.itemDiv.firstElementChild,boxSize:(0,o.C)(40,40),mediaSize:(0,o.C)(a,d),toDataURL:!0,quality:.2}),c=(0,Z.o)(l),h={_:"photoStrippedSize",bytes:c,type:"i"};e.strippedBytes=c;const u={_:"photo",sizes:[h],id:0,access_hash:0,date:0,dc_id:0,file_reference:[],pFlags:{}},p=yield(0,I.ZP)({middleware:i,width:a,height:d,animationGroup:this.animationGroup,media:u});i()&&(t||p.classList.add("is-revealing"),e.mediaSpoiler=p,e.itemDiv.append(p),yield(0,E.d1)(),i()&&(0,I.MR)({mediaSpoiler:p,reveal:!1}))}))}removeMediaSpoiler(e){(0,I.MR)({mediaSpoiler:e.mediaSpoiler,reveal:!0,destroyAfter:!0}),e.mediaSpoiler=void 0}appendDrops(e){this.body.append(e)}get type(){return this.willAttach.type}set type(e){this.willAttach.type=e}partition(e=p.Z){const[t,i]=(0,k.Z)(this.willAttach.sendFileDetails,(t=>e.has(t.file.type)));return{media:t,files:i}}mediaCount(){return this.partition().media.length}hasAnyMedia(){return this.mediaCount()>0}canGroupSomething(){const{media:e,files:t}=this.partition();return e.length>1||t.length>1}canToggleSpoilers(e,t){let i="media"===this.willAttach.type&&this.hasAnyMedia();if(t&&i&&(i=1===this.files.length),i){const s=this.willAttach.sendFileDetails.filter((e=>p.Z.has(e.file.type))),n=s.filter((e=>e.mediaSpoiler));i=!!t||s.length>1,i&&(i=e?s.length!==n.length:s.length===n.length)}return i}changeType(e){this.willAttach.type=e,this.attachFiles()}changeGroup(e){this.willAttach.group=e,this.attachFiles()}changeSpoilers(e){this.partition().media.forEach((t=>{e&&!t.mediaSpoiler?this.applyMediaSpoiler(t):!e&&t.mediaSpoiler&&this.removeMediaSpoiler(t)}))}addFiles(e){const t=e.filter((e=>!this.files.find((t=>t.lastModified===e.lastModified&&t.name===e.name&&t.size===e.size))));t.length&&(this.files.push(...t),this.attachFiles())}send(e=!1){return N(this,void 0,void 0,(function*(){let t=this.messageInputField.value;if(t.length>this.captionLengthMax)return void(0,n.Am)(l.ZP.format("Error.PreviewSender.CaptionTooLong",!0));const{peerId:i,input:s}=this.chat,a=yield H.canSend(i),o=this.willAttach;o.isMedia="media"===o.type||void 0;const{sendFileDetails:r,isMedia:d}=o;let c=!1;if(this.iterate((e=>{if(c)return;const t=e.map((e=>{const t=[[R,"GlobalAttachAudioRestricted","send_audios"],[()=>!p.Z.has(e.file.type),"GlobalAttachDocumentsRestricted","send_docs"]];d&&t.unshift([A.Z,"GlobalAttachPhotoRestricted","send_photos"],[()=>_.Z.has(e.file.type)&&e.noSound,"GlobalAttachGifRestricted","send_gifs"],[_.Z,"GlobalAttachVideoRestricted","send_videos"]);const i=t.find((([t])=>"function"==typeof t?t():t.has(e.file.type)));return i?a[i[2]]?void 0:i[1]:d||a.send_docs?void 0:"GlobalAttachDocumentsRestricted"})).find((e=>"string"==typeof e));t&&((0,n.bC)({langPackKey:t}),B.Z.isAvailable("animations")&&(0,D.Z)(this.body)),c||(c=!!t)})),c)return;if("scheduled"===this.chat.type&&!e)return void this.chat.input.scheduleSending((()=>{this.send(!0)}));const{length:h}=r,u=this.chat.getMessageSendingParams();this.iterate((e=>{t&&e.length!==h&&(this.managers.appMessagesManager.sendText(i,t,Object.assign(Object.assign({},u),{clearDraft:!0})),t=void 0);const s=e.map((e=>Object.assign(Object.assign({},e),{file:e.scaledBlob||e.file,spoiler:!!e.mediaSpoiler}))),n=Object.assign(Object.assign({},o),{sendFileDetails:s});this.managers.appMessagesManager.sendAlbum(i,Object.assign(Object.assign(Object.assign({},u),{caption:t,isMedia:d,clearDraft:!0}),n)),t=void 0})),s.replyToMsgId=this.chat.threadId,s.onMessageSent(),this.wasInputValue=void 0,this.hide()}))}modifyMimeTypeForTelegram(e){return"image/webp"===e?"image/jpeg":e}scaleImageForTelegram(e,t,i){return N(this,void 0,void 0,(function*(){const s=2560;let n,a=e.src;if("image/gif"!==t&&(Math.max(e.naturalWidth,e.naturalHeight)>s||i&&"image/webp"===t)){const{blob:i}=yield(0,r.Z)({media:e,boxSize:(0,o.C)(s,s),mediaSize:(0,o.C)(e.naturalWidth,e.naturalHeight),mimeType:this.modifyMimeTypeForTelegram(t)});n=i,URL.revokeObjectURL(a),a=yield y.Z.invoke("createObjectURL",i),yield(0,M.cj)(e,a)}return n&&{url:a,blob:n}}))}attachMedia(e){return N(this,void 0,void 0,(function*(){const{itemDiv:t}=e;t.classList.add("popup-item-media");const i=e.file;if(i.type.startsWith("video/")){const s=(0,g.Z)();let n;s.src=e.objectURL=yield y.Z.invoke("createObjectURL",i),s.autoplay=!0,s.controls=!1,s.muted=!0,s.addEventListener("timeupdate",(()=>{s.pause()}),{once:!0}),t.append(s);try{yield(0,b.Z)(s)}catch(e){n=e}if(e.width=s.videoWidth,e.height=s.videoHeight,e.duration=Math.floor(s.duration),n)throw n;const a=s.webkitAudioDecodedByteCount;void 0!==a&&(e.noSound=!a);const o=yield function(e){return new Promise(((t,i)=>{e.onseeked=()=>{e.onseeked=()=>{d(e).then(t),e.onseeked=void 0},e.currentTime=0},e.onerror=i,e.currentTime=Math.min(e.duration,1)}))}(s);e.thumb=Object.assign({url:yield y.Z.invoke("createObjectURL",o.blob)},o)}else{const s=new Image;t.append(s);const n=e.objectURL=yield y.Z.invoke("createObjectURL",i);yield(0,M.cj)(s,n);const a=e.file.type,o=yield this.scaleImageForTelegram(s,a,!0);if(o&&(e.objectURL=o.url,e.scaledBlob=o.blob),e.width=s.naturalWidth,e.height=s.naturalHeight,"image/gif"===i.type)return e.noSound=!0,Promise.all([f(s).then((t=>{e.duration=Math.ceil(t)})),d(s).then((t=>N(this,void 0,void 0,(function*(){e.thumb=Object.assign({url:yield y.Z.invoke("createObjectURL",t.blob)},t)}))))]).then((()=>{}))}}))}attachDocument(e){return N(this,void 0,void 0,(function*(){const{itemDiv:t}=e;t.classList.add("popup-item-document");const i=e.file,s=i.type.startsWith("image/"),n=R.has(i.type);(s||n||i.size<2e7)&&(e.objectURL||(e.objectURL=yield y.Z.invoke("createObjectURL",i)));const a=[];let o;if(s&&e.objectURL){o=new Image,yield(0,M.cj)(o,e.objectURL);const t=yield this.scaleImageForTelegram(o,e.file.type);t&&(e.objectURL=t.url)}if(n&&e.objectURL)try{const t=new Audio;t.src=e.objectURL,t.muted=!0,t.autoplay=!0,yield(0,b.Z)(t),e.duration=t.duration,a.push({_:"documentAttributeAudio",duration:e.duration,pFlags:{}})}catch(e){console.error("audio loading error",e)}const r={_:"document",file:i,file_name:i.name||"",size:i.size,type:n?"audio":s?"photo":void 0,access_hash:0,attributes:a,date:0,dc_id:0,file_reference:[],id:0,pFlags:{},duration:e.duration};let d;e.objectURL&&(d={url:e.objectURL,downloaded:i.size,type:w.Pt});const l=yield(0,S.Z)({message:{_:"message",pFlags:{is_outgoing:!0},mid:0,peerId:0,media:{_:"messageMediaDocument",document:r}},cacheContext:d});s&&(e.width=o.naturalWidth,e.height=o.naturalHeight),t.append(l)}))}shouldCompress(e){return"media"===this.willAttach.type&&p.Z.has(e)}onRender(){this.element.classList.contains("active")||(this.listenerSetter.add(document.body)("keydown",this.onKeyDown),!this.ignoreInputValue&&this.addEventListener("close",(()=>{this.wasInputValue&&(this.chat.input.messageInputField.value=this.wasInputValue)})),this.show())}setTitle(){const{willAttach:e,title:t,files:i}=this;let s;const n=[];if("document"===e.type)s="PreviewSender.SendFile",n.push(i.length);else{let e=0,t=0,a=0;i.forEach((i=>{i.type.startsWith("image/")?++e:i.type.startsWith("video/")?++t:++a})),[e,t,a].filter((e=>e>0)).length>1?(s="PreviewSender.SendFile",n.push(i.length)):e?(s="PreviewSender.SendPhoto",n.push(e)):t&&(s="PreviewSender.SendVideo",n.push(t))}(0,m.Z)(t,(0,l.ag)(s,n))}appendMediaToContainer(e){if(this.shouldCompress(e.file.type)){const t=(0,c.Z)(e.width,e.height,384,320);e.itemDiv.style.width=t.width+"px",e.itemDiv.style.height=t.height+"px"}this.mediaContainer.append(e.itemDiv)}iterate(e){const{sendFileDetails:t}=this.willAttach;if(!this.willAttach.group)return void t.forEach((t=>e([t])));const i=t.length;for(let s=0;s{e.middlewareHelper.destroy()}));const n=e.map((e=>this.attachFile(e)));Promise.all(n).then((()=>{i.replaceChildren(),e.length&&(this.setTitle(),this.iterate((e=>{const t=this.shouldCompress(e[0].file.type);if(t&&e.length>1){const t=document.createElement("div");t.classList.add("popup-item-album","popup-item"),t.append(...e.map((e=>e.itemDiv))),(0,v.Z)({container:t,items:e.map((e=>({w:e.width,h:e.height}))),maxWidth:384,minWidth:100,spacing:4}),i.append(t)}else e.forEach((e=>{this.appendMediaToContainer(e)}));t&&e.forEach((e=>{const t=s.find((t=>t.file===e.file));t&&t.mediaSpoiler&&this.applyMediaSpoiler(e,!0)}))})))})).then((()=>{this.onRender(),this.onScroll()}))}}window.PopupNewMedia=H},8683:(e,t,i)=>{"use strict";i.d(t,{BE:()=>Re,ZP:()=>Be,LI:()=>De});var s=i(1168),n=i(7445),a=i(3189),o=i(1470),r=i(8097);const d=function(e){const t={},i={};return s=>{var n,a;const o="_"+s;return null!==(n=(a="string"==typeof s?t:i)[o])&&void 0!==n?n:a[o]=e(s)}};function l(e){return e.replace(/\D/g,"")}const c={visa:/^4/,mastercard:/^(51|52|53|54|55|222|23|24|25|26|27)/,amex:/^(34|37)/,discover:/^(60|64|65)/,diners:/^(30|38|39)/,diners14:/^(36)/,jcb:/^(35)/,unionpay:/^(62[0-6,8-9]|627[0-6,8-9]|6277[0-7,9]|62778[1-9]|81)/,elo:/^(5067|509|636368|627780)/,mir:/^(220[0-4])/},h={visa:{minLength:16,maxLength:16,cvcMaxLength:3,cvcMinLength:null},mastercard:{minLength:16,maxLength:16,cvcMaxLength:3,cvcMinLength:null},amex:{minLength:15,maxLength:15,cvcMaxLength:4,cvcMinLength:3},unionpay:{minLength:13,maxLength:19,cvcMaxLength:3,cvcMinLength:null},diners:{minLength:16,maxLength:16,cvcMaxLength:3,cvcMinLength:null},diners14:{minLength:14,maxLength:14,cvcMaxLength:3,cvcMinLength:null},discover:{minLength:16,maxLength:16,cvcMaxLength:3,cvcMinLength:null},jcb:{minLength:16,maxLength:16,cvcMaxLength:3,cvcMinLength:null},elo:{minLength:16,maxLength:16,cvcMaxLength:3,cvcMinLength:null},mir:{minLength:16,maxLength:16,cvcMaxLength:3,cvcMinLength:null},unknown:{minLength:16,maxLength:16,cvcMaxLength:4,cvcMinLength:3}},u=d(((e="")=>{const t=Object.keys(c),i=l(e);let s,n=0;return t.forEach((e=>{const t=c[e],a=i.match(t);if(a){const t=a[0];t&&t.length>n&&(s=e,n=t.length)}})),s||"unknown"}));function p(e=""){return"diners14"===(t=u(e))?"diners":t;var t}var f=i(2738),m=i(5975),g=i(8497),v=i(2398),b=i(6740),y=i(5565),w=i(130),S=i(1656),C=i(6272),L=i(5180),I=i(286),E=i(7298),P=i(2325),Z=i(8115),M=i(5400),T=i(3512),k=i(9331),x=i(4494),A=i(9807),_=i(8842),F=i(279),D=i(7479),R=i(2796),B=i(7362),N=i(9492),O=i(4762);function U(e,t,i){const s=new Array(e);return s.fill(t),i?s.map(i):s}const H="0".charCodeAt(0)-"0".charCodeAt(0),z=/[0-9]/g;function j(e){return String.fromCharCode(e.charCodeAt(0)-H)}function G(e){return e.replace(z,j)}function V(e,t){return{type:"optional",result:e,consumed:t}}function K(e,t,i){return{type:"required",result:e,consumed:t,partial:i}}function W(e,t){return i=>{const s=new RegExp("^".concat(e.source.replace(/^\^/,""))),n=i.match(s),a=t?V:K;if(n){const e=n[0];return a(e,n.index+e.length)}return a("",i.length)}}const $=W(/1[0-2]|0?[1-9]|0/),q={digit:function(e){return W(/[0-9]/)(G(e))},capitalCharacter:function(e){const t=W(/\w/)(e);return t.result?K(t.result.toUpperCase(),t.consumed):t},month:e=>{const t=$(G(e)),i=l(t.result);return["0","1"].includes(t.result)&&1===e.length||"0"===t.result&&e.length>=2?K(t.result,e.length,!0):K(1===i.length?"0"+i:i,t.consumed)},formattingCharacter:e=>t=>{const i=e===t[0]?1:0;return function(e,t){return{type:"formatting",result:e,consumed:t}}(e,i)},optionalPattern:e=>t=>{const i=W(e,!0)(t);return i.result?i:V("",0)}},Y=q.digit,Q=q.capitalCharacter,X=q.formattingCharacter(" "),J=q.optionalPattern(/\d\d/),ee=[Y,Y,Y,Y,X,Y,Y,Y,Y,Y,Y,X,Y,Y,Y,Y,Y],te=[Y,Y,Y,Y,X,Y,Y,Y,Y,Y,Y,X,Y,Y,Y,Y],ie=new Set(["DZ","AR","AM","AU","AT","AZ","PT","BD","BY","BE","BA","BR","BN","BG","CA","IC","CN","CO","HR","CY","CZ","DK","EC","GB","EE","FO","FI","FR","GE","DE","GR","GL","GU","GG","NL","HU","IN","ID","IL","IT","JP","JE","KZ","KR","FM","KG","LV","LI","LT","LU","MK","MG","PT","MY","MH","MQ","YT","MX","MN","ME","NL","NZ","GB","NO","PK","PH","PL","FM","PT","PR","RE","RU","SA","SF","RS","SG","SK","SI","ZA","ES","LK","SX","VI","VI","SE","CH","TW","TJ","TH","TU","TN","TR","TM","VI","UA","GB","US","UY","UZ","VA","VN","GB","FM"]),se=d((e=>{const t=[];for(let i=0,s=0;i[q.month,q.formattingCharacter("/"),Y,Y,J],cardCvc:e=>ne.cardCvcFromBrand(u(e)),cardCvcFromBrand:d((e=>{const t=h[e],{cvcMinLength:i,cvcMaxLength:s}=t,n=U(i||s,Y);if(i&&i{switch(e){case"US":return U(5,Y);case"CA":return O.IS_ANDROID?null:[Q,Q,Q,X,Q,Q,Q];default:const t=U(10,q.optionalPattern(/\d/));return ie.has(e)&&(t[0]=Y),t}}))},ae=ne;function oe(e){return(0,o.Z)(e.map((e=>e.length)),0)}var re=i(1564);const de=new RegExp(re.Z,"g");function le(e){return e?{type:"invalid",code:e}:null}function ce(e,t={}){const{sanitized:i,minLength:s}=function(e){const t=l(e),i=u(e);return{sanitized:t,brand:i,minLength:h[i].minLength}}(e);return function(e,t,i){return e.length>=t?function(e){const t="0".charCodeAt(0),i=e.length%2;let s=0;for(let n=e.length-1;n>=0;--n){const a=i===n%2;let o=e.charCodeAt(n)-t;a&&(o*=2),o>9&&(o-=9),s+=o}return!(s%10)}(e)||"mir"===u(e)?null:le("invalid"):i?null:le("incomplete")}(i,s,t.ignoreIncomplete)}function he(e,t={}){const i=e.replace(de,"").split(/ ?\/ ?/),[s,n=""]=i,[a,o]=[s,n].map((e=>+e)),r=2===n.length?o%100:o;return n.length<2||3===n.length?t.ignoreIncomplete?null:le("incomplete"):le(function(e,t,i){const s=new Date(Date.now()),n=e<100?s.getFullYear()%100:s.getFullYear(),a=s.getMonth()+1;return isNaN(e)||isNaN(t)?(null==i?void 0:i.ignoreIncomplete)?null:"incomplete":e-n<0?"invalid_expiry_year_past":e-n>50?"invalid_expiry_year":!(e-n)&&t{this.dispatchEvent("finish"),this.hide(),this.openPathAfter&&ge.ZP.openUrl("https://t.me"+e.path_full)})),this.body.append(e.iframe),this.show(),e.onMount()}destroy(){return this.telegramWebView.destroy(),super.destroy()}}var we=i(6830),Se=i(5029);class Ce extends me.ZP{constructor(e){super(e),this.options=e,this.onKeyDown=e=>{var t,i;this.lastKeyDown=e.key,null===(i=(t=this.options).onKeyDown)||void 0===i||i.call(t,e)},this.onInput=()=>{var e,t;const i=this.value,s="Backspace"===this.lastKeyDown&&(this.lastTransformed&&this.lastTransformed.value.length||0)-i.length==1,n=this.lastTransformed=function(e){const{value:t,getPattern:i,deleting:s,input:n}=e,a=!s&&!!t.length,o=function(e,t,i={},s){const n=e(t);if(!n)return{value:t,selection:null,autocorrectComplete:!!t};const a=n.length,o=[],r=[];let d=0,l=0,c=0===i.selectionStart?0:null,h=0===i.selectionEnd?0:null;const u=e=>{e>0&&(null===c&&l+1>=i.selectionStart&&(c=oe(o)+(s?r.length:0)),null===h&&l+1>=i.selectionEnd&&(h=oe(o)+(s?r.length:0)),l+=e)};for(;d=t.length)break;r.push(a),++d,u(c)}}return s&&o.push(...r),{value:o.join(""),selection:{selectionStart:null===c||t.length&&i.selectionStart===t.length?oe(o):c,selectionEnd:null===h||t.length&&i.selectionEnd===t.length?oe(o):h},autocorrectComplete:d===a}}(i,t,{selectionStart:n?n.selectionStart:0,selectionEnd:n?n.selectionEnd:0},a),{value:r,selection:d}=o;return{value:r,meta:{autocorrectComplete:o.autocorrectComplete,empty:!r},selection:d}}({value:i,getPattern:this.options.formatMethod,deleting:s,input:this.input}),a=n.value;a!==i&&(this.setValueSilently(a),n.selection&&(this.input.selectionStart=n.selection.selectionStart,this.input.selectionEnd=n.selection.selectionEnd)),this.validateNew(a,{ignoreIncomplete:!0}),null===(t=(e=this.options).onChange)||void 0===t||t.call(e,n)},this.onBlur=()=>{var e;const t=null===(e=this.lastTransformed)||void 0===e?void 0:e.value;t&&this.validateNew(t)},this.validate=()=>this.validateNew(),this.input.addEventListener("keydown",this.onKeyDown),this.input.addEventListener("input",this.onInput),this.input.addEventListener("blur",this.onBlur)}update(){this.onInput()}validateNew(e,t,i){var s,n,a,o,r;let d;if(void 0===e&&(e=null!==(n=null===(s=this.lastTransformed)||void 0===s?void 0:s.value)&&void 0!==n?n:""),void 0===t&&(t={}),d=this.options.validateMethod?null===(o=(a=this.options).validateMethod)||void 0===o?void 0:o.call(a,e,t):function(e,t,i={}){return e.meta.autocorrectComplete||i.ignoreIncomplete?null:le("incomplete")}(this.lastTransformed,0,t),null==d?void 0:d.code){const e=null===(r=this.options.errorKeys)||void 0===r?void 0:r[d.code];return!i&&this.setState(me.I1.Error,e),!1}return!i&&this.setState(me.I1.Neutral),!0}}function Le(e,t){const i=()=>{const i=e.every((e=>"validateNew"in e?e.validateNew(void 0,void 0,!0):e.isValid()));t(i)};return e.forEach((e=>{if(e instanceof Ce){const t=e.options.onChange;e.options.onChange=(...e)=>{null==t||t(...e),i()},"update"in e&&e.update()}else e.input.addEventListener("input",i)})),{validate:i}}function Ie(e,t){let i,s;return(e||t)&&(e&&(i=new fe.Z({noPhoneCodes:!0,onCountryChange:()=>{null==s||s.update()},required:!0,autocomplete:"country"})),t&&(s=new Ce({label:"PaymentShippingZipPlaceholder",plainText:!0,inputMode:"numeric",autocomplete:"postal-code",formatMethod:()=>{const{country:e}=i.getSelected(),t=null==e?void 0:e.iso2;return ae.postalCodeFromCountry(t&&t.toUpperCase())}}))),{countryInputField:i,postcodeInputField:s}}const Ee=new Set(["stripe","smartglocal"]);class Pe extends s.Z{constructor(e,t){if(super("popup-payment popup-payment-card",{closable:!0,overlayClosable:!0,body:!0,scrollable:Ee.has(e.native_provider),title:"PaymentCardInfo"}),this.paymentForm=e,this.savedCard=t,Ee.has(e.native_provider))this.d();else{const t=this.telegramWebView=be({url:e.url});t.addEventListener("payment_form_submit",(t=>{const i={title:t.title,save:!1};this.dispatchEvent("finish",{token:t.credentials,card:i}),this.hide(),e.pFlags.can_save_credentials&&(0,pe.Z)({titleLangKey:"PaymentCardSavePaymentInformation",descriptionLangKey:"PaymentCardSavePaymentInformationInfoLine1",button:{langKey:"Save"}}).then((()=>{i.save=!0}),ue.Z)})),this.body.append(t.iframe),this.show(),t.onMount()}}destroy(){var e;return null===(e=this.telegramWebView)||void 0===e||e.destroy(),super.destroy()}d(){const e=this.savedCard,t=new Se.Z({name:"PaymentInfo.Card.Title",noDelimiter:!0,noShadow:!0}),i=JSON.parse(this.paymentForm.native_params.data);let s,n,a=0;const o=new Ce({label:"PaymentCardNumber",plainText:!0,inputMode:"numeric",autocomplete:"cc-number",formatMethod:ae.cardNumber,validateMethod:ce,errorKeys:{invalid:"PaymentCard.Error.Invalid",incomplete:"PaymentCard.Error.Incomplete"},onChange:e=>{(e=>{if(s===e)return;const t=++a;s=e;const i=De(e);if(!i)return void(n&&(n.remove(),n=void 0));const r=new Image;r.classList.add("input-field-icon"),(0,b.cj)(r,i,!1).then((()=>{a===t&&(n?n.replaceWith(r):o.container.append(r),n=r)}))})(p(e.value)),l.update()}});let r;i.need_cardholder_name&&(r=new me.ZP({label:"Checkout.NewCard.CardholderNamePlaceholder",maxLength:255,required:!0,autocomplete:"cc-name"}));const d=new Ce({label:"SecureId.Identity.Placeholder.ExpiryDate",plainText:!0,inputMode:"numeric",autocomplete:"cc-exp",formatMethod:ae.cardExpiry,validateMethod:he});d.input.addEventListener("input",(()=>{let e=d.value;if(e.length<5)return;const t=e.split("/");4===t[1].length&&(e=[t[0],t[1].slice(2)].join("/"),d.setValueSilently(e))}),{capture:!0});const l=new Ce({labelText:"CVC",plainText:!0,inputMode:"numeric",autocomplete:"cc-csc",name:"cvc",formatMethod:()=>ae.cardCvc(o.value)}),c=(new we.T(l.container,l.input),[o,d,l,r].filter(Boolean));c.forEach((e=>{const t=t=>{if(!e.value&&"Backspace"===t.key){const t=c[c.indexOf(e)-1];t&&(0,v.Z)(t.input,!0)}};if(e instanceof Ce){e.options.onKeyDown=t;const i=e.options.onChange;e.options.onChange=t=>{if(null==i||i(t),document.activeElement===e.input&&t.meta.autocorrectComplete)for(let t=c.indexOf(e),i=c.length;te.container))));const y=!!this.paymentForm.pFlags.can_save_credentials,w=new A.Z({text:"PaymentCardSavePaymentInformation",checked:!!y}),S=new D.ZP({checkboxField:w,subtitleLangKey:y?"PaymentCardSavePaymentInformationInfoLine1":"Checkout.2FA.Text"});y||S.container.classList.add("is-disabled"),(f||t).content.append(S.container),this.scrollable.append(...[t,f].filter(Boolean).map((e=>e.container)));const C=Re({key:"PaymentInfo.Done",onClick:()=>{return e=this,t=void 0,n=function*(){const e={cardNumber:o.value,expiryFull:d.value,expiryMonth:d.value.split("/")[0],expiryYear:d.value.split("/")[1],cvc:l.value,cardholderName:null==r?void 0:r.value,country:null==m?void 0:m.value,zip:null==g?void 0:g.value,save:null==w?void 0:w.checked},t=this.paymentForm.native_provider;let s;if("stripe"===t){const t=new URL("https://api.stripe.com/v1/tokens");t.search=new URLSearchParams({"card[number]":e.cardNumber,"card[exp_month]":e.expiryMonth,"card[exp_year]":e.expiryYear,"card[cvc]":e.cvc,"card[address_zip]":e.zip,"card[address_country]":e.country,"card[name]":e.cardholderName}).toString();const n=yield fetch(t.toString(),{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:`Bearer ${i.publishable_key}`}});s=yield n.json()}else if("smartglocal"===t){const t={card:{number:e.cardNumber.replace(/[^\d]+/g,""),expiration_month:e.expiryMonth,expiration_year:e.expiryYear,security_code:e.cvc.replace(/[^\d]+/g,"")}},n="https://tgb.smart-glocal.com/cds/v1/tokenize/card",a=yield fetch(n,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","X-PUBLIC-TOKEN":i.public_token},body:JSON.stringify(t)});s={type:"card",token:(yield a.json()).data.token}}this.dispatchEvent("finish",{token:s,card:e}),this.hide()},new((s=void 0)||(s=Promise))((function(i,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,r)}d((n=n.apply(e,t||[])).next())}));var e,t,s,n}});Le([o,r,d,l,m,g].filter(Boolean),(e=>{C.disabled=!e})),e&&(o.value=e.cardNumber,d.value=e.expiryFull,l.value=e.cvc,r&&(r.value=e.cardholderName),m&&(m.value=e.country),g&&(g.value=e.zip)),this.body.append(this.btnConfirmOnEnter=C),this.show(),o.validateNew(void 0,void 0,!0)||(0,v.Z)(o.input)}}class Ze extends s.Z{constructor(e,t){super("popup-payment popup-payment-card-confirmation",{closable:!0,overlayClosable:!0,body:!0,scrollable:!0,title:"Checkout.PasswordEntry.Title"});const i=new Se.Z({noDelimiter:!0,noShadow:!0,caption:"Checkout.PasswordEntry.Text",captionArgs:[e]}),s=new we.Z({labelText:t.hint});i.content.append(s.container),this.scrollable.append(i.container);const n=()=>{a.disabled=!s.value,s.setState(me.I1.Neutral)};s.input.addEventListener("input",n);const a=Re({key:"Checkout.PasswordEntry.Pay",onClick:()=>{return e=this,i=void 0,a=function*(){try{const e=yield this.managers.passwordManager.getInputCheckPassword(s.value,t),i=yield this.managers.apiManager.invokeApi("account.getTmpPassword",{password:e,period:60});this.dispatchEvent("finish",i),this.hide()}catch(e){throw"PASSWORD_HASH_INVALID"===e.type&&(e.handled=!0,s.setError("PASSWORD_HASH_INVALID")),e}},new((n=void 0)||(n=Promise))((function(t,s){function o(e){try{d(a.next(e))}catch(e){s(e)}}function r(e){try{d(a.throw(e))}catch(e){s(e)}}function d(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(e,i||[])).next())}));var e,i,n,a}});this.body.append(this.btnConfirmOnEnter=a),n(),this.show(),(0,v.Z)(s.input)}}var Me=i(1171),Te=i(709);class ke extends s.Z{constructor(e,t,i){super("popup-payment popup-payment-shipping",{closable:!0,overlayClosable:!0,body:!0,scrollable:!0,title:"PaymentShippingInfo"}),this.paymentForm=e,this.inputInvoice=t,this.focus=i,this.d()}d(){const e=this.paymentForm.invoice,t=this.paymentForm.saved_info;let i,s,n,a,o,r,d,l,c,h,u;if(e.pFlags.shipping_address_requested){i=new Se.Z({name:"PaymentShippingAddress",noDelimiter:!0,noShadow:!0}),s=new me.ZP({label:"PaymentShippingAddress1Placeholder",maxLength:64,required:!0}),n=new me.ZP({label:"PaymentShippingAddress2Placeholder",maxLength:64}),a=new me.ZP({label:"PaymentShippingCityPlaceholder",maxLength:64,required:!0}),o=new me.ZP({label:"PaymentShippingStatePlaceholder",maxLength:64});const e=Ie(!0,!0);r=e.countryInputField,d=e.postcodeInputField,i.content.append(...[s,n,a,o,r,d].filter(Boolean).map((e=>e.container)))}if([e.pFlags.name_requested,e.pFlags.email_requested,e.pFlags.phone_requested].includes(!0)){l=new Se.Z({name:"PaymentShippingReceiver",noDelimiter:!0,noShadow:!0});const t=()=>{const e=h.value,t=(0,Me.Z)(e);return!(!t||t[0].length!==e.length)},i=()=>!!u.value.match(/\d/);e.pFlags.name_requested&&(c=new me.ZP({label:"PaymentShippingName",maxLength:256,required:!0})),e.pFlags.email_requested&&(h=new me.ZP({label:"PaymentShippingEmailPlaceholder",maxLength:64,required:!0,validate:t})),e.pFlags.phone_requested&&(u=new Te.Z({required:!0,validate:i})),l.content.append(...[c,h,u].filter(Boolean).map((e=>e.container)))}const p=new A.Z({text:"PaymentShippingSave",checked:!0}),f=new D.ZP({checkboxField:p,subtitleLangKey:"PaymentShippingSaveInfo"});(l||i).content.append(f.container),this.scrollable.append(...[i,l].filter(Boolean).map((e=>e.container)));const m=Re({key:"PaymentInfo.Done",onClick:()=>{return e=this,t=void 0,l=function*(){const e=r&&r.getSelected().country,t={_:"paymentRequestedInfo",shipping_address:e&&{_:"postAddress",street_line1:s.value,street_line2:n.value,city:a.value,state:o.value,country_iso2:null==e?void 0:e.iso2,post_code:d.value},name:null==c?void 0:c.value,email:null==h?void 0:h.value,phone:null==u?void 0:u.value};try{const e=yield this.managers.appPaymentsManager.validateRequestedInfo(this.inputInvoice,t,null==p?void 0:p.checked);this.dispatchEvent("finish",{shippingAddress:t,requestedInfo:e}),this.hide()}catch(e){const t={ADDRESS_STREET_LINE1_INVALID:s,ADDRESS_STREET_LINE2_INVALID:n,ADDRESS_COUNTRY_INVALID:r,ADDRESS_CITY_INVALID:a,ADDRESS_STATE_INVALID:o,ADDRESS_POSTCODE_INVALID:d,REQ_INFO_NAME_INVALID:c,REQ_INFO_EMAIL_INVALID:h,REQ_INFO_PHONE_INVALID:u}[e.type];throw t&&(t.setError(),e.handled=!0),e}},new((i=void 0)||(i=Promise))((function(s,n){function a(e){try{r(l.next(e))}catch(e){n(e)}}function o(e){try{r(l.throw(e))}catch(e){n(e)}}function r(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}r((l=l.apply(e,t||[])).next())}));var e,t,i,l}});if(this.body.append(this.btnConfirmOnEnter=m),t){const e=t.shipping_address;e&&(s.value=e.street_line1,n.value=e.street_line2,a.value=e.city,o.value=e.state,r.selectCountryByIso2(e.country_iso2),d.value=e.post_code),t.name&&c&&(c.value=t.name),t.email&&h&&(h.value=t.email),t.phone&&u&&(u.value=t.phone)}const{validate:g}=Le([s,n,a,o,r,d,c,h,u].filter(Boolean),(e=>{m.disabled=!e}));let b;g(),this.show(),b=this.focus?{name:c,email:h,phone:u}[this.focus]:s,b&&(0,v.Z)(b.input)}}var xe=i(1218);class Ae extends s.Z{constructor(e,t,i){super("popup-payment popup-payment-shipping-methods",{closable:!0,overlayClosable:!0,body:!0,scrollable:!0,title:"PaymentShippingMethod"}),this.paymentForm=e,this.requestedInfo=t,this.shippingOption=i,this.d()}d(){const e=new Se.Z({name:"PaymentCheckoutShippingMethod",noDelimiter:!0,noShadow:!0}),t=this.requestedInfo.shipping_options.map((e=>new D.ZP({radioField:new xe.Z({text:e.title,name:"shipping-method",value:e.id}),subtitle:(0,L.Z)((0,o.Z)(e.prices.map((({amount:e})=>+e)),0),this.paymentForm.invoice.currency)})));let i;const s=(0,D.De)(t,(e=>{i=e}));this.shippingOption?t.find((e=>e.radioField.input.value===this.shippingOption.id)).radioField.checked=!0:t[0].radioField.checked=!0,e.content.append(s),this.scrollable.append(e.container);const n=Re({key:"PaymentInfo.Done",onClick:()=>{this.dispatchEvent("finish",this.requestedInfo.shipping_options.find((e=>e.id===i))),this.hide()}});this.body.append(this.btnConfirmOnEnter=n),this.show()}}var _e=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const Fe=["amex","card","diners","discover","jcb","mastercard","visa","unionpay","mir","logo"];function De(e){if(Fe.includes(e))return`assets/img/${e}.svg`}function Re(e){var t,i;const s=null!==(t=e.textEl)&&void 0!==t?t:new P.ZP.IntlElement({key:null!==(i=e.key)&&void 0!==i?i:"PaymentInfo.Done"}),n=s.key,a=(0,x.Z)("btn-primary btn-color-primary payment-item-pay");return a.append(s.element),(0,f.fc)(a,(()=>_e(this,void 0,void 0,(function*(){const t=e.onClick();if(!(t instanceof Promise))return;const i=(0,F.y)(a),o=(0,S.Z)([a],!0);s.compareAndUpdate({key:"PleaseWait"});try{yield t}catch(e){e.handled||console.error("payment button error",e),o(),s.compareAndUpdate({key:n}),i.remove()}})))),a}class Be extends s.Z{constructor(e,t,i,s){super("popup-payment",{closable:!0,overlayClosable:!0,body:!0,scrollable:!0,title:!0}),this.message=e,this.inputInvoice=t,this.paymentForm=i,this.isReceipt=s,this.tipButtonsMap=new Map,this.d().catch((e=>{console.error("payment popup error",e),this.hide()}))}d(){var e,t,i;return _e(this,void 0,void 0,(function*(){this.element.classList.add("is-loading"),this.show();let d=!1;const l=()=>{d||(d=!0,it&&it.hide(),this.hide())};let{paymentForm:c,message:h}=this;h&&this.listenerSetter.add(T.Z)("payment_sent",(({peerId:e,mid:t})=>{h.peerId===e&&h.mid===t&&l()}));const u=null==h?void 0:h.media,S=null!==(e=this.isReceipt)&&void 0!==e?e:u?!!u.receipt_msg_id||"messageExtendedMedia"===(null===(t=u.extended_media)||void 0===t?void 0:t._):"payments.paymentReceipt"===c._,O=u?u.pFlags.test:c.invoice.pFlags.test,U=u?u.photo:c.photo,H=u?u.title:c.title,z=u?u.description:c.description;(0,P.$d)(this.title,S?"PaymentReceipt":"PaymentCheckout"),O&&this.title.append(" (Test)");const j="payment-item",G=document.createElement("div");G.classList.add(j);const V=j+"-details",K=document.createElement("div");let W;K.classList.add(V),U&&(W=document.createElement("div"),W.classList.add(V+"-photo","media-container-contain"),(0,N.Z)({photo:U,container:W,boxWidth:100,boxHeight:100,size:{_:"photoSizeEmpty",type:""}}),K.append(W));const $=V+"-lines",q=document.createElement("div");q.classList.add($);const Y=document.createElement("div");Y.classList.add($+"-title");const Q=document.createElement("div");Q.classList.add($+"-description");const X=document.createElement("div");X.classList.add($+"-bot-name"),q.append(Y,Q,X),(0,w.Z)(Y,(0,Z.Z)(H)),(0,w.Z)(Q,(0,Z.Z)(z));const J=new _.Z;X.append(J.element),K.append(q),G.append(K),this.scrollable.append(G);const ee=document.createElement("div");ee.classList.add(j+"-preloader-container"),(0,F.y)(ee,!0),this.scrollable.container.append(ee);const te=this.inputInvoice;c||(c=S?yield this.managers.appPaymentsManager.getPaymentReceipt(h.peerId,u.receipt_msg_id||te.msg_id):yield this.managers.appPaymentsManager.getPaymentForm(te),this.paymentForm=c);let ie=c.saved_info||c.info;const se=null===(i=c.saved_credentials)||void 0===i?void 0:i[0];let[ne,ae,oe]=yield Promise.all([!S&&ie&&this.managers.appPaymentsManager.validateRequestedInfo(te,ie),se&&this.managers.passwordManager.getState(),(0,B.Z)({peerId:c.provider_id.toPeerId()})]);yield J.update({peerId:c.bot_id.toPeerId()}),ee.remove(),this.element.classList.remove("is-loading");const re=(e,t)=>(0,L.Z)(e,le,t),{invoice:de}=c,le=de.currency,ce=de.pFlags.recurring&&!S;yield J.update({peerId:c.bot_id.toPeerId()});const he=ce?yield(0,B.Z)({peerId:c.bot_id.toPeerId()}):void 0;ee.remove(),this.element.classList.remove("is-loading");const ue=()=>{const e=document.createElement("div");e.classList.add(pe+"-price");const t=document.createElement("span"),i=document.createElement("span");return e.append(t,i),{label:e,left:t,right:i}},pe=j+"-prices",fe=document.createElement("div");fe.classList.add(pe);const me=e=>e.map((e=>{const{amount:t,label:i}=e,s=ue();s.left.textContent=i;const n=re(t);return s.right.textContent=n,s.label})),ge=me(de.prices);let ve=()=>0,be=0;const we=()=>{const e=re(Le+ve()+be);Ce.right.textContent=e,Se.compareAndUpdate({key:"PaymentCheckoutPay",args:[e]})},Se=new P.ZP.IntlElement,Ce=ue();Ce.label.classList.add("is-total"),(0,P.$d)(Ce.left,"PaymentTransactionTotal");const Le=(0,o.Z)(de.prices.map((({amount:e})=>+e)),0),Ie=void 0!==de.max_tip_amount&&!S||!!c.tip_amount;if(Ie){const e=j+"-tips",t=n.Z[le];ve=()=>+i().replace(/\D/g,"");const i=()=>l.value,s=()=>{const e=(0,r.Z)(i(),`500 ${a.Bf} ${a.bt}`);l.style.width=e+"px"},o=e=>{e=Math.min(+e,+de.max_tip_amount);const t=re(e,!0);l.value=t,document.activeElement===l&&(0,v.Z)(l),C&&C();const i=this.tipButtonsMap.get(e);i&&i.classList.add("active"),s(),we()},d=ue();(0,P.$d)(d.left,S?"PaymentTip":"PaymentTipOptional");const l=document.createElement("input");l.type="tel",l.classList.add("input-clear",e+"-input"),d.right.append(l),S?d.label.classList.add("disable-hover"):d.label.style.cursor="text",d.label.addEventListener("mousedown",(e=>{(0,m.Z)(e.target,l)||(0,v.Z)(l)}));const h=l instanceof HTMLInputElement?1:2,u=()=>{y?--y:(y=h,(0,v.Z)(l))},p=()=>{setTimeout((()=>{y=h,(0,v.Z)(l),document.addEventListener("selectionchange",u)}),0)},b=()=>{l.addEventListener("focus",p,{once:!0}),document.removeEventListener("selectionchange",u)};let y;l.addEventListener("focusout",b),b(),l.addEventListener("input",(()=>{o(ve())}));const w=[t.symbol,t.space_between?" ":""];let C;if(t.symbol_left||w.reverse(),d.right[t.symbol_left?"prepend":"append"](w.join("")),ge.push(d.label),S)o(c.tip_amount);else{const t=document.createElement("div");t.classList.add(e);const i=e+"-tip",s=de.suggested_tip_amounts.map((e=>{const t=(0,x.Z)(i,{noRipple:!0});return t.textContent=re(e),this.tipButtonsMap.set(+e,t),t}));C=()=>{const e=t.querySelector(".active");e&&e.classList.remove("active")},(0,f.fc)(t,(e=>{const t=(0,g.Z)(e.target,i);if(!t)return;let s=0;if(t.classList.contains("active"))t.classList.remove("active");else{C(),t.classList.add("active");for(const[e,i]of this.tipButtonsMap)if(i===t){s=e;break}}o(s)})),o(0),t.append(...s),ge.push(t)}}else we();ge.push(Ce.label),fe.append(...ge),G.append(fe);const Ee=(e,t)=>_e(this,void 0,void 0,(function*(){const i=document.createElement("img");i.classList.add("media-photo"),yield(0,b.cj)(i,De(t));let s=e.media;s?(0,y.Z)(s,i):(s=e.createMedia("small"),s.classList.add("media-container-cover"),s.append(i)),e.container.classList.remove("row-with-icon")})),Me=e=>{e.titleLangKey&&(e.subtitleLangKey=e.titleLangKey),e.noWrap=!0;const t=new D.ZP(e);return t.container.classList.add(j+"-row"),e.titleLangKey&&t.subtitle.classList.add("hide"),t},Te=(e,t)=>{if(e.title.textContent=t,!t){const t=P.ZP.weakMap.get(e.subtitle.firstElementChild);e.title.append((0,P.ag)(t.key))}e.subtitle.classList.toggle("hide",!t)},xe=e=>{let t,i,s;"title"in e?(t=e.title.split(" ").shift(),i=e.title,s=e.icon):(t=p(e.cardNumber),i=t+" *"+e.cardNumber.split(" ").pop()),Oe.title.classList.remove("tgico","tgico-card_outline"),Ee(Oe,s||t.toLowerCase()),Te(Oe,i)},Fe=()=>{s.Z.createPopup(Pe,c,Be).addEventListener("finish",(({token:e,card:t})=>{Ne=e,Be=t,xe(t)}))};let Be,Ne;const Oe=Me({titleLangKey:"PaymentCheckoutMethod",clickable:S?void 0:Fe,icon:"card_outline"});Oe.container.classList.add(j+"-method-row"),se?xe(se):c.credentials_title&&xe({title:c.credentials_title});const Ue=Me({title:oe,subtitleLangKey:"PaymentCheckoutProvider"}),He=new k.Z;let ze,je,Ge,Ve,Ke,We,$e,qe;He.classList.add("avatar-32"),Ue.createMedia("small").append(He),He.updateWithOptions({peerId:c.provider_id.toPeerId()});const Ye=de.pFlags.shipping_address_requested?e=>{if(!e)return Ke.subtitle.classList.add("hide"),void(0,y.Z)(Ke.title,(0,P.ag)("PaymentShippingAddress"));const t=e.shipping_address;Te(ze,[t.city,t.street_line1,t.street_line2].filter(Boolean).join(", ")),Ke.container.classList.toggle("hide",!ne&&!S)}:void 0,Qe=e=>{Ye&&Ye(e),je&&Te(je,e.name),Ge&&Te(Ge,e.email),Ve&&Te(Ve,e.phone&&"+"+(0,C.u)(e.phone).formatted)};if(S||($e=e=>{s.Z.createPopup(ke,c,te,e).addEventListener("finish",(({shippingAddress:e,requestedInfo:t})=>{ne=t,ie=c.saved_info=e,Qe(e)}))}),de.pFlags.shipping_address_requested){const e=e=>{const i=new I.Z(this.scrollable,void 0,!0);if(i.save(),t&&t.forEach((e=>e.remove())),!e)return be=0,we(),i.restore(),void this.onContentUpdate();We=e,Te(Ke,e.title),be=(0,o.Z)(e.prices.map((({amount:e})=>+e)),0),t=me(e.prices);let s=Ce.label;Ie&&(s=s.previousElementSibling,S||(s=s.previousElementSibling)),t.forEach((e=>s.parentElement.insertBefore(e,s))),we(),i.restore(),this.onContentUpdate()};let t;ze=Me({icon:"location",titleLangKey:"PaymentShippingAddress",clickable:!S&&$e.bind(null,void 0)}),Ke=Me({icon:"shipping",titleLangKey:"PaymentCheckoutShippingMethod",clickable:!S&&(qe=()=>{s.Z.createPopup(Ae,c,ne,We).addEventListener("finish",(t=>{e(t)}))})}),Ke.container.classList.add("hide");const i=c.shipping;i&&e(i)}de.pFlags.name_requested&&(je=Me({icon:"newprivate",titleLangKey:"PaymentCheckoutName",clickable:!S&&$e.bind(null,"name")})),de.pFlags.email_requested&&(Ge=Me({icon:"mention",titleLangKey:"PaymentShippingEmailPlaceholder",clickable:!S&&$e.bind(null,"email")})),de.pFlags.phone_requested&&(Ve=Me({icon:"phone",titleLangKey:"PaymentCheckoutPhoneNumber",clickable:!S&&$e.bind(null,"phone")})),ie&&Qe(ie);const Xe=[Oe,Ue,ze,Ke,je,Ge,Ve].filter(Boolean),Je=ce&&new A.Z({text:"Payments.Recurrent.Accept",textArgs:[(0,M.ZP)(de.recurring_terms_url),he]}),et=ce&&Me({checkboxField:Je}),tt=ce?[document.createElement("hr"),et.container]:[];let it,st;this.scrollable.append(...[document.createElement("hr"),...Xe.map((e=>e.container)),...tt].filter(Boolean));const nt=()=>{at.disabled=!(!Je||Je.checked)};let at;at=Re(S?{onClick:()=>this.hide(),key:"Done"}:{onClick:()=>{const e=de.pFlags.name_requested&&!(null==ie?void 0:ie.name)?"name":de.pFlags.email_requested&&!(null==ie?void 0:ie.email)?"email":de.pFlags.phone_requested&&!(null==ie?void 0:ie.phone)?"phone":void 0;if(de.pFlags.shipping_address_requested){if(!ne)return void $e();if(!We)return void qe()}else if(e)return void $e(e);return Be||st?Promise.resolve().then((()=>_e(this,void 0,void 0,(function*(){const e=st?{_:"inputPaymentCredentialsSaved",id:se.id,tmp_password:st.tmp_password}:{_:"inputPaymentCredentials",data:{_:"dataJSON",data:JSON.stringify(Ne.token?Ne:{type:Ne.type,id:Ne.id})},pFlags:{save:Be.save||void 0}};try{const t=yield this.managers.appPaymentsManager.sendPaymentForm(te,c.form_id,null==ne?void 0:ne.id,null==We?void 0:We.id,e,ve());"payments.paymentResult"===t._?l():(it=s.Z.createPopup(ye,t.url,!u.extended_media),it.addEventListener("finish",(()=>{it=void 0,l()})),yield new Promise(((e,t)=>{it.addEventListener("close",(()=>{if(it=void 0,d)e();else{const e=new Error("payment not finished");e.handled=!0,t(e)}}))})))}catch(e){throw"BOT_PRECHECKOUT_TIMEOUT"===e.type?((0,R.bC)({langPackKey:"Error.AnError"}),e.handled=!0):"TMP_PASSWORD_INVALID"===e.type&&(ae=st=void 0,(0,f.tH)(at),e.handled=!0),e}})))):se?void Promise.resolve(null!=ae?ae:this.managers.passwordManager.getState()).then((e=>{s.Z.createPopup(Ze,se.title,e).addEventListener("finish",(e=>{ae=void 0,st=e,(0,f.tH)(at);const t=e.valid_until-(0,E.Z)(!0)-5;setTimeout((()=>{st===e&&(st=void 0)}),1e3*t)}))})):void Fe()},textEl:Se}),nt(),Je&&Je.input.addEventListener("change",nt),this.body.append(this.btnConfirmOnEnter=at),this.onContentUpdate()}))}}},8127:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(9331),n=i(1168),a=i(2325),o=i(9807),r=i(130);class d extends n.Z{constructor(e,t={}){if(super("popup-peer"+(e?" "+e:""),Object.assign(Object.assign({overlayClosable:!0},t),{title:!0,buttons:t.buttons&&(0,n.x)(t.buttons)})),this.className=e,t.peerId){const e=new s.Z;e.classList.add("avatar-32"),e.updateWithOptions({isDialog:!0,peerId:t.peerId,threadId:t.threadId,wrapOptions:{middleware:this.middlewareHelper.get()}}),this.header.prepend(e)}t.noTitle||(t.titleLangKey||!t.title?this.title.append((0,a.ag)(t.titleLangKey||"AppName",t.titleLangArgs)):t.title instanceof HTMLElement?this.title.append(t.title):this.title.innerText=t.title||"");const i=document.createDocumentFragment();if(t.descriptionLangKey||t.description){const e=this.description=document.createElement("p");e.classList.add("popup-description"),t.descriptionLangKey?e.append((0,a.ag)(t.descriptionLangKey,t.descriptionLangArgs)):t.description&&(0,r.Z)(e,t.description),i.append(e)}t.checkboxes&&(this.container.classList.add("have-checkbox"),t.checkboxes.forEach((e=>{e.withRipple=!0;const t=new o.Z(e);e.checkboxField=t,i.append(t.label)})),t.buttons.forEach((e=>{if(e.callback){const i=e.callback;e.callback=()=>{const e=new Set;t.checkboxes.forEach((t=>{t.checkboxField.checked&&e.add(t.text)})),i(e)}}}))),this.container.insertBefore(i,this.header.nextElementSibling)}}},2995:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(5432),n=i(5644),a=i(1168);class o extends a.Z{constructor(e){super("popup-forward",{closable:!0,overlayClosable:!0,body:!0,title:!0}),this.selector=new n.Z({appendTo:this.body,onChange:()=>{return t=this,i=void 0,n=function*(){const t=this.selector.getSelected(),i=t[t.length-1].toPeerId();if(e.onSelect){const t=e.onSelect(i);if(t instanceof Promise)try{yield t}catch(e){return}}this.selector=null,this.hide()},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n},peerType:e.peerTypes,onFirstRender:()=>{this.show(),this.selector.checkForTriggers(),s.Z||this.selector.input.focus()},chatRightsActions:e.chatRightsActions,multiSelect:!1,rippleEnabled:!1,avatarSize:"abitbigger",peerId:e.peerId,placeholder:e.placeholder,selfPresence:e.selfPresence,managers:this.managers}),this.scrollable=this.selector.scrollable,this.attachScrollableListeners(),this.title.append(this.selector.input)}}},1962:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(8127);class n extends s.Z{constructor(e,t,i){super("popup-delete-chat",{title:`Send Message${t.length>1?"s":""} Now`,description:t.length>1?"Send "+t.length+" messages now?":"Send message now?",buttons:[{langKey:"Send",callback:()=>{i&&i(),this.managers.appMessagesManager.sendScheduledMessages(e,t)}}]}),this.show()}}},9298:(e,t,i)=>{"use strict";i.d(t,{Z:()=>Z});var s=i(1168),n=i(3541),a=i(2153),o=i(279),r=i(5814),d=i(7030),l=i(4755),c=i(2325),h=i(4494),u=i(8497),p=i(1656),f=i(2738),m=i(2796),g=i(130),v=i(8115),b=i(3163),y=i(9259),w=i(7479),S=i(5565),C=i(3512),L=i(9083),I=i(3173),E=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const P="STICKERS-POPUP";class Z extends s.Z{constructor(e,t){super("popup-stickers",{closable:!0,overlayClosable:!0,body:!0,scrollable:!0,title:!0}),this.stickerSetInput=e,this.isEmojis=t,this.onStickersClick=e=>E(this,void 0,void 0,(function*(){const t=(0,u.Z)(e.target,"sticker-set-sticker");if(!t)return;const i=t.dataset.docId;(yield d.ZP.chat.input.sendMessageWithDocument(i))&&this.hide()})),this.title.append((0,c.ag)("Loading")),this.updateAdded={},I.ZP.setIgnoreMouseOut("popup",!0),this.addEventListener("close",(()=>{I.ZP.setIgnoreMouseOut("popup",!1),r.Z.setOnlyOnePlayableGroup()})),this.appendTo=this.scrollable.container,this.appendTo.classList.add("is-loading"),(0,o.y)(this.appendTo,!0),this.stickersFooter=document.createElement("div"),this.stickersFooter.classList.add("sticker-set-footer");const i=(0,h.Z)("btn-primary btn-primary-transparent disable-hover",{noRipple:!0,text:"Loading"});this.stickersFooter.append(i),this.body.append(this.stickersFooter),(0,y.Z)({listenTo:this.appendTo,listenerSetter:this.listenerSetter});const s=e=>{const t=this.sets.findIndex((t=>t.id===e.id));if(-1===t)return;this.sets[t]=e;const i=this.updateAdded[e.id];null==i||i(!!e.installed_date),this.updateButton()};this.listenerSetter.add(C.Z)("stickers_installed",s),this.listenerSetter.add(C.Z)("stickers_deleted",s),this.loadStickerSet()}createStickerSetElements(e){const t=document.createElement("div");let i,s;t.classList.add("sticker-set"),e&&(i=new w.ZP({title:(0,v.Z)(e.title),subtitle:(0,c.ag)(e.pFlags.emojis?"EmojiCount":"Stickers",[e.count]),buttonRight:!0}),s=e=>{(0,S.Z)(i.buttonRight,(0,c.ag)(e?"Stickers.SearchAdded":"Stickers.SearchAdd")),i.buttonRight.classList.toggle("active",e)},s(!!e.installed_date),t.append(i.container));const n=document.createElement("div");return n.classList.add("sticker-set-stickers"),t.append(n),{container:t,headerRow:i,updateAdded:s,itemsContainer:n}}loadStickerSet(){var e;return E(this,void 0,void 0,(function*(){const t=this.middlewareHelper.get(),i=(Array.isArray(this.stickerSetInput)?this.stickerSetInput:[this.stickerSetInput]).map((e=>this.managers.appStickersManager.getStickerSet(e)));let s=yield Promise.all(i);if(!t())return;let o=s[0];if(1===s.length&&!o)return(0,m.bC)({langPackKey:this.isEmojis?"AddEmojiNotFound":"StickerSet.DontExist"}),void this.hide();s=s.filter(Boolean),o=s[0],this.sets=s.map((e=>e.set));const d=null!==(e=this.isEmojis)&&void 0!==e?e:this.isEmojis=!!o.set.pFlags.emojis;if(!d){(0,f.fc)(this.appendTo,this.onStickersClick,{listenerSetter:this.listenerSetter});const{destroy:e}=(0,b.Z)({listenTo:this.appendTo,isStickerPack:!0,onSend:()=>this.hide()});this.addEventListener("close",e)}r.Z.setOnlyOnePlayableGroup(P);const u=new a.Z,y=[],w=s.map((e=>E(this,void 0,void 0,(function*(){const{container:i,itemsContainer:a,headerRow:o,updateAdded:r}=this.createStickerSetElements(s.length>1?e.set:void 0);let c;o&&(0,f.fc)(o.buttonRight,(()=>{this.managers.appStickersManager.toggleStickerSet(e.set)}),{listenerSetter:this.listenerSetter}),this.updateAdded[e.set.id]=r;const h=e.documents.filter((e=>"document"===(null==e?void 0:e._)));if(d){const e=(0,L.Z)({docIds:h.map((e=>e.id)),loadPromises:y,animationGroup:P,customEmojiSize:l.Z.active.esgCustomEmoji,middleware:t});Array.from(e.children).slice(1).forEach((e=>{const t=document.createElement("span");t.classList.add("super-emoji"),e.replaceWith(t),t.append(e)})),c=[e],a.classList.replace("sticker-set-stickers","super-emojis"),a.classList.add("is-emojis","not-local")}else c=yield Promise.all(h.map((e=>E(this,void 0,void 0,(function*(){const i=document.createElement("div");i.classList.add("sticker-set-sticker");const s=l.Z.active.popupSticker.width;return yield(0,n.ZP)({doc:e,div:i,lazyLoadQueue:u,group:P,play:!0,loop:!0,width:s,height:s,withLock:!0,loadPromises:y,middleware:t}),i})))));return a.append(...c.filter(Boolean)),i})))),S=yield Promise.all(w);yield Promise.all(y);const C=this.button=(0,h.Z)("",{noRipple:!0});this.updateButton(),(0,f.fc)(C,(()=>{const e=(0,p.Z)([C],!0);this.managers.appStickersManager.toggleStickerSets(s.map((e=>e.set))).then((()=>{this.hide()})).catch((()=>{e()}))}),{listenerSetter:this.listenerSetter}),1===s.length?(0,g.Z)(this.title,(0,v.Z)(o.set.title)):(0,g.Z)(this.title,(0,c.ag)("Emoji")),this.stickersFooter.textContent="",this.stickersFooter.append(C),this.appendTo.classList.remove("is-loading"),this.appendTo.textContent="",this.appendTo.append(...S),this.scrollable.onAdditionalScroll()}))}updateButton(){const{sets:e,isEmojis:t}=this;let i,s;if(1===e.length){const n=e[0];s=(0,c.ag)(t?"EmojiCount":"Stickers",[n.count]),i=!n.installed_date}else{const t=e.filter((e=>e.installed_date));let n;e.length===t.length?(i=!1,n=e.length):(i=!0,n=e.length-t.length),s=(0,c.ag)("EmojiPackCount",[n])}this.button.className=i?"btn-primary btn-color-primary":"btn-primary btn-primary-transparent danger",(0,S.Z)(this.button,(0,c.ag)(i?"AddStickersCount":"RemoveStickersCount",[s]))}}},684:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(1168),n=i(8127),a=i(3512),o=i(7362);class r{constructor(e,t,i,s){this.peerId=e,this.mid=t,this.unpin=i,this.onConfirm=s,this.construct()}construct(){return e=this,t=void 0,r=function*(){const{peerId:e,mid:t,unpin:i,onConfirm:r}=this;let d,l,c;const h=[],u=[],p=s.Z.MANAGERS,f=yield p.appPeersManager.canPinMessage(e),m=(s,n,a)=>{setTimeout((()=>{let s;s=i&&!t?f?p.appMessagesManager.unpinAllMessages(e):p.appMessagesManager.hidePinnedMessages(e):p.appMessagesManager.updatePinnedMessage(e,t,i,a,n),r&&s.then(r)}),300)};if(i){let i="UnpinMessage";t?(d="UnpinMessageAlertTitle",l="Chat.Confirm.Unpin"):f?(d="Popup.Unpin.AllTitle",l="Chat.UnpinAllMessagesConfirmation",c=[""+((yield p.appMessagesManager.getPinnedMessagesCount(e))||1)]):(d="Popup.Unpin.HideTitle",l="Popup.Unpin.HideDescription",i="Popup.Unpin.Hide"),h.push({langKey:i,isDanger:!0,callback:m})}else{d="PinMessageAlertTitle";const t="PinMessage";e.isAnyChat()?(h.push({langKey:t,callback:e=>m(0,!1,!e.size)}),(yield p.appChatsManager.isBroadcast(e.toChatId()))?l="PinMessageAlertChannel":(l="PinMessageAlert",u.push({text:"PinNotify",checked:!0}))):(l="PinMessageAlertChat",e===a.Z.myId?h.push({langKey:t,callback:m}):(h.push({langKey:t,callback:e=>m(0,!e.size)}),u.push({text:"PinAlsoFor",textArgs:[yield(0,o.Z)({peerId:e})],checked:!0})))}(0,s.x)(h),s.Z.createPopup(n.Z,"popup-delete-chat",{peerId:e,titleLangKey:d,descriptionLangKey:l,descriptionLangArgs:c,buttons:h,checkboxes:u}).show()},new((i=void 0)||(i=Promise))((function(s,n){function a(e){try{d(r.next(e))}catch(e){n(e)}}function o(e){try{d(r.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}d((r=r.apply(e,t||[])).next())}));var e,t,i,r}}},3442:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var s=i(9099),n=i(3035),a=i(3910),o=i(2738),r=i(8487),d=i(5953);class l{constructor(e){this.tempId=0,this.detached=!0,this.promise=null,this.isUpload=!1,this.cancelable=!0,this.streamable=!1,this.tryAgainOnFail=!0,this.attachMethod="append",this.onClick=e=>{var t,i,s;e&&(0,a.Z)(e),this.preloader.classList.contains("manual")?null===(t=this.loadFunc)||void 0===t||t.call(this,e):null===(s=null===(i=this.promise)||void 0===i?void 0:i.cancel)||void 0===s||s.call(i)},e&&(0,d.Z)(this,e),this.isUpload&&(this.tryAgainOnFail=!1)}constructContainer(e={}){this.preloader||(this.preloader=document.createElement("div"),this.preloader.classList.add("preloader-container"),e.color&&this.preloader.classList.add("preloader-"+e.color),e.bold&&this.preloader.classList.add("preloader-bold"),this.streamable&&this.preloader.classList.add("preloader-streamable"))}constructDownloadIcon(){this.constructContainer()}construct(){this.construct=null,this.constructContainer(),this.preloader.innerHTML=`\n
\n \n \n \n
`,this.streamable?this.totalLength=118.61124420166016:this.totalLength=149.82473754882812,this.cancelable?(this.preloader.innerHTML+='\n \n \n \n \n \n \n \n \n \n \n \n ',this.downloadSvg=this.preloader.lastElementChild,this.cancelSvg=this.downloadSvg.previousElementSibling):this.preloader.classList.add("preloader-swing"),this.circle=this.preloader.firstElementChild.firstElementChild.firstElementChild,this.cancelable&&(0,o.fc)(this.preloader,this.onClick)}setDownloadFunction(e){this.loadFunc=e}setManual(){this.preloader.classList.add("manual"),this.setProgress(0)}attachPromise(e){if(this.isUpload&&this.promise)return;this.promise=e;const t=--this.tempId,i=Date.now(),s=s=>{if(e.notify=e.notifyAll=null,t!==this.tempId)return;const a=Date.now()-i;if(!s&&this.cancelable){this.setProgress(100);const e=150;a{t===this.tempId&&this.detach()}),e)}else this.tryAgainOnFail?(this.attach(this.preloader.parentElement),(0,n.T2)((()=>{this.setManual()}))):this.detach();this.promise=e=null};e.then((()=>s(null))).catch((e=>s(e))),e.addNotifyListener&&e.addNotifyListener((e=>{if(t!==this.tempId)return;const i=e.done/e.total*100;this.setProgress(i)}))}attach(e,t=!1,i){var n;null===(n=this.construct)||void 0===n||n.call(this),this.preloader.parentElement&&this.preloader.classList.remove("manual"),this.detached=!1,i&&this.attachPromise(i);let a=0;(this.detached||this.preloader.parentElement!==e)&&(a=(0,r.Z)(this.preloader)?1:2,this.preloader.parentElement!==e&&e[this.attachMethod](this.preloader)),(0,s.Z)({element:this.preloader,className:"is-visible",forwards:!0,duration:200,useRafs:a}),this.cancelable&&t&&this.setProgress(0)}detach(){var e;this.detached||(this.detached=!0,(null===(e=this.preloader)||void 0===e?void 0:e.parentElement)&&(0,s.Z)({element:this.preloader,className:"is-visible",forwards:!1,duration:200,onTransitionEnd:()=>{this.preloader.remove()},useRafs:1}))}setProgress(e){if(this.totalLength||(0,r.Z)(this.circle))if(0!==e)try{this.totalLength||(this.totalLength=this.circle.getTotalLength()),this.circle.style.strokeDasharray=Math.max(5,e/100*this.totalLength)+", "+this.totalLength}catch(e){}else this.circle.style.strokeDasharray=""}}},2635:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(1470),n=i(3228);class a{constructor(e,t,i,n,o=t){this.sizes=e,this.maxWidth=t,this.minWidth=i,this.spacing=n,this.maxHeight=o,this.count=e.length,this.ratios=a.countRatios(e),this.proportions=a.countProportions(this.ratios),this.averageRatio=(0,s.Z)(this.ratios,1)/this.count,this.maxSizeRatio=t/this.maxHeight}layout(){return this.count?this.count>=5||this.ratios.find((e=>e>2))?new o(this.ratios,this.averageRatio,this.maxWidth,this.minWidth,this.spacing).layout():2===this.count?this.layoutTwo():3===this.count?this.layoutThree():this.layoutFour():[]}layoutTwo(){return"ww"===this.proportions&&this.averageRatio>1.4*this.maxSizeRatio&&this.ratios[1]-this.ratios[0]<.2?this.layoutTwoTopBottom():"ww"===this.proportions||"qq"===this.proportions?this.layoutTwoLeftRightEqual():this.layoutTwoLeftRight()}layoutThree(){return"n"===this.proportions[0]?this.layoutThreeLeftAndOther():this.layoutThreeTopAndOther()}layoutFour(){return"w"===this.proportions[0]?this.layoutFourTopAndOther():this.layoutFourLeftAndOther()}layoutTwoTopBottom(){const e=this.maxWidth,t=Math.round(Math.min(e/this.ratios[0],Math.min(e/this.ratios[1],(this.maxHeight-this.spacing)/2)));return[{geometry:{x:0,y:0,width:e,height:t},sides:11},{geometry:{x:0,y:t+this.spacing,width:e,height:t},sides:14}]}layoutTwoLeftRightEqual(){const e=(this.maxWidth-this.spacing)/2,t=Math.round(Math.min(e/this.ratios[0],Math.min(e/this.ratios[1],1*this.maxHeight)));return[{geometry:{x:0,y:0,width:e,height:t},sides:13},{geometry:{x:e+this.spacing,y:0,width:e,height:t},sides:7}]}layoutTwoLeftRight(){const e=Math.round(1.5*this.minWidth),t=Math.min(Math.round(Math.max(.4*(this.maxWidth-this.spacing),(this.maxWidth-this.spacing)/this.ratios[0]/(1/this.ratios[0]+1/this.ratios[1]))),this.maxWidth-this.spacing-e),i=this.maxWidth-t-this.spacing,s=Math.min(this.maxHeight,Math.round(Math.min(i/this.ratios[0],t/this.ratios[1])));return[{geometry:{x:0,y:0,width:i,height:s},sides:13},{geometry:{x:i+this.spacing,y:0,width:t,height:s},sides:7}]}layoutThreeLeftAndOther(){const e=this.maxHeight,t=Math.round(Math.min((this.maxHeight-this.spacing)/2,this.ratios[1]*(this.maxWidth-this.spacing)/(this.ratios[2]+this.ratios[1]))),i=e-t-this.spacing,s=Math.max(this.minWidth,Math.round(Math.min((this.maxWidth-this.spacing)/2,Math.min(t*this.ratios[2],i*this.ratios[1])))),n=Math.min(Math.round(e*this.ratios[0]),this.maxWidth-this.spacing-s);return[{geometry:{x:0,y:0,width:n,height:e},sides:13},{geometry:{x:n+this.spacing,y:0,width:s,height:i},sides:3},{geometry:{x:n+this.spacing,y:i+this.spacing,width:s,height:t},sides:6}]}layoutThreeTopAndOther(){const e=this.maxWidth,t=Math.round(Math.min(e/this.ratios[0],.66*(this.maxHeight-this.spacing))),i=(this.maxWidth-this.spacing)/2,s=Math.min(this.maxHeight-t-this.spacing,Math.round(Math.min(i/this.ratios[1],i/this.ratios[2]))),n=e-i-this.spacing;return[{geometry:{x:0,y:0,width:e,height:t},sides:11},{geometry:{x:0,y:t+this.spacing,width:i,height:s},sides:12},{geometry:{x:i+this.spacing,y:t+this.spacing,width:n,height:s},sides:6}]}layoutFourTopAndOther(){const e=this.maxWidth,t=Math.round(Math.min(e/this.ratios[0],.66*(this.maxHeight-this.spacing))),i=Math.round((this.maxWidth-2*this.spacing)/(this.ratios[1]+this.ratios[2]+this.ratios[3])),s=Math.max(this.minWidth,Math.round(Math.min(.4*(this.maxWidth-2*this.spacing),i*this.ratios[1]))),n=Math.round(Math.max(Math.max(1*this.minWidth,.33*(this.maxWidth-2*this.spacing)),i*this.ratios[3])),a=e-s-n-2*this.spacing,o=Math.min(this.maxHeight-t-this.spacing,i);return[{geometry:{x:0,y:0,width:e,height:t},sides:11},{geometry:{x:0,y:t+this.spacing,width:s,height:o},sides:12},{geometry:{x:s+this.spacing,y:t+this.spacing,width:a,height:o},sides:4},{geometry:{x:s+this.spacing+a+this.spacing,y:t+this.spacing,width:n,height:o},sides:6}]}layoutFourLeftAndOther(){const e=this.maxHeight,t=Math.round(Math.min(e*this.ratios[0],.6*(this.maxWidth-this.spacing))),i=Math.round((this.maxHeight-2*this.spacing)/(1/this.ratios[1]+1/this.ratios[2]+1/this.ratios[3])),s=Math.round(i/this.ratios[1]),n=Math.round(i/this.ratios[2]),a=e-s-n-2*this.spacing,o=Math.max(this.minWidth,Math.min(this.maxWidth-t-this.spacing,i));return[{geometry:{x:0,y:0,width:t,height:e},sides:13},{geometry:{x:t+this.spacing,y:0,width:o,height:s},sides:3},{geometry:{x:t+this.spacing,y:s+this.spacing,width:o,height:n},sides:2},{geometry:{x:t+this.spacing,y:s+n+2*this.spacing,width:o,height:a},sides:6}]}static countRatios(e){return e.map((e=>e.w/e.h))}static countProportions(e){return e.map((e=>e>1.2?"w":e<.8?"n":"q")).join("")}}class o{constructor(e,t,i,s,n,a=4*i/3){this.averageRatio=t,this.maxWidth=i,this.minWidth=s,this.spacing=n,this.maxHeight=a,this.ratios=o.cropRatios(e,t),this.count=e.length}static cropRatios(e,t){return e.map((e=>t>1.1?(0,n.Z)(e,1,2.75):(0,n.Z)(e,.6667,1)))}layout(){const e=new Array(this.count),t=[],i=(e,t)=>{const i=this.ratios.slice(e,e+t),n=(0,s.Z)(i,0);return(this.maxWidth-(t-1)*this.spacing)/n},n=e=>{const s=[];let n=0;for(const t of e)s.push(i(n,t)),n+=t;t.push({lineCounts:e,heights:s})};for(let e=1;e!==this.count;++e){const t=this.count-e;e>3||t>3||n([e,t])}for(let e=1;e!==this.count-1;++e)for(let t=1;t!==this.count-e;++t){const i=this.count-e-t;e>3||t>(this.averageRatio<.85?4:3)||i>3||n([e,t,i])}for(let e=1;e!==this.count-1;++e)for(let t=1;t!==this.count-e;++t)for(let i=1;i!==this.count-e-t;++i){const s=this.count-e-t-i;e>3||t>3||i>3||s>3||n([e,t,i,s])}let a=null,o=0;for(const e of t){const{heights:t,lineCounts:i}=e,n=i.length,r=(0,s.Z)(t,0)+this.spacing*(n-1),d=Math.min(...t),l=(Math.max(...t),d{for(let e=1;e!==n;++e)if(i[e-1]>i[e])return 1.5;return 1})(),h=Math.abs(r-this.maxHeight)*l*c;(!a||h2&e.sides)),s=i.geometry.width+i.geometry.x,n=t.find((e=>4&e.sides)),o=n.geometry.height+n.geometry.y,r=e.container;r.style.width=s+"px",r.style.height=o+"px";const d=r.children;t.forEach((({geometry:t,sides:i},n)=>{let a;if(a=d[n],a||(a=document.createElement("div"),r.append(a)),a.classList.add("album-item","grouped-item"),a.style.width=t.width/s*100+"%",a.style.height=t.height/o*100+"%",a.style.top=t.y/o*100+"%",a.style.left=t.x/s*100+"%",8&i&&1&i&&(a.style.borderTopLeftRadius="inherit"),8&i&&4&i&&(a.style.borderBottomLeftRadius="inherit"),2&i&&1&i&&(a.style.borderTopRightRadius="inherit"),2&i&&4&i&&(a.style.borderBottomRightRadius="inherit"),e.forMedia){const e=document.createElement("div");e.classList.add("album-item-media"),a.append(e)}}))}},9931:(e,t,i)=>{"use strict";i.d(t,{Z:()=>y,Y:()=>v});var s=i(4059),n=i(6740),a=i(5565),o=i(130),r=i(9674),d=i(5990),l=i(7256),c=i(1507),h=i(5798),u=i(3512),p=i(9345),f=i(319),m=i(5994),g=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function v(e,t,i,o,d=new Image,l=!1){return g(this,void 0,void 0,(function*(){const l=yield u.Z.managers.acknowledged.appAvatarsManager.loadAvatar(t,i,o),c=l.result,h=l.cached;let p,g,b;if(d.classList.add("avatar-photo"),h)g=()=>{(0,a.Z)(e,d),e.dataset.color=""};else{const l=m.Z.isAvailable("animations");l&&d.classList.add("fade-in");let c=!1;if("photo_big"===o){const s=yield v(e,t,i,"photo_small");p=s.loadThumbPromise||s.loadPromise,b=s.thumbImage}else if(i.stripped_thumb){b=new Image,e.classList.add("avatar-relative"),b.classList.add("avatar-photo","avatar-photo-thumbnail");const t=(0,s.Z)(i.stripped_thumb);p=(0,n.cj)(b,t).then((()=>{c||(0,a.Z)(e,b)}))}g=()=>{c=!0,b?e.append(d):(0,a.Z)(e,d),setTimeout((()=>{e.childElementCount&&r.Z.mutateElement(d,(()=>{e.dataset.color="",l&&d.classList.remove("fade-in"),null==b||b.remove()}))}),l?200:0)}}const y=c.then((e=>(0,n.cj)(d,e))).then(g);return p&&(yield p.catch(f.Z)),{cached:h,loadPromise:y,loadThumbPromise:h?y:p||Promise.resolve(),thumbImage:b}}))}function b(e,t,i,s,n,a){(0,o.Z)(e,t),e.dataset.color=i,e.classList.remove("tgico-saved","tgico-deletedaccount","tgico-reply_filled","is-forum","is-topic"),s&&e.classList.add(s),n&&e.classList.add("is-forum"),a&&e.classList.add("is-topic")}function y({div:e,peerId:t,isDialog:i=!1,title:s="",onlyThumb:n=!1,isBig:a,threadId:o,wrapOptions:r={}}){var f,m;return g(this,void 0,void 0,(function*(){const g=u.Z.myId;if(t===g&&i)return void b(e,"","","tgico-saved");const y=u.Z.managers;if(o){const i=yield y.dialogsStorage.getForumTopic(t,o);return b(e,"","",void 0,void 0,!0),r.customEmojiSize&&e.style.setProperty("--size",r.customEmojiSize.width+"px"),(0,p.e)(Object.assign(Object.assign({},r),{topic:i,lazyLoadQueue:!1})).then((t=>{e.replaceChildren(t)}))}const w=yield y.appPeersManager.getPeer(t);if(t!==c.NM&&t.isUser()&&(null===(f=null==w?void 0:w.pFlags)||void 0===f?void 0:f.deleted))return void b(e,"",(0,d.Z)(t),"tgico-deletedaccount");const S=!!(null===(m=null==w?void 0:w.pFlags)||void 0===m?void 0:m.forum),C=a?"photo_big":"photo_small",L=(0,l.Z)(w),I=!!L,E=!!e.firstElementChild&&!e.firstElementChild.classList.contains("emoji");if(!I||!E||!(yield y.appAvatarsManager.isAvatarCached(t,C))){let n="";if(!t||t===g&&i||(n=(0,d.Z)(t)),t===c.hj)return void b(e,"",n,"tgico-reply_filled");const a=s?(0,h.Z)(s):function(e){var t;let i="";return e&&(i=null!==(t=e.title)&&void 0!==t?t:[e.first_name,e.last_name].filter(Boolean).join(" ")),(0,h.Z)(i)}(w);b(e,a,n,"",S)}return I?v(e,t,L,C,void 0,n):void 0}))}},279:(e,t,i)=>{"use strict";function s(e,t=!1){const i='\n \n \n ';if(t){const t=document.createElement("div");return t.classList.add("preloader"),t.innerHTML=i,e&&e.appendChild(t),t}return e.insertAdjacentHTML("beforeend",i),e.lastElementChild}function n(e,t="check"){return e.classList.remove("tgico-"+t),e.disabled=!0,s(e),()=>{e.innerHTML="",e.classList.add("tgico-"+t),e.removeAttribute("disabled")}}i.d(t,{p:()=>n,y:()=>s}),i(410).GO.putPreloader=s},1218:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(6669),n=i(9750),a=i(2325),o=i(3855),r=i(3512);class d{constructor(e){const t=this.label=document.createElement("label");t.classList.add("radio-field"),e.alignRight&&t.classList.add("radio-field-right");const i=this.input=document.createElement("input");i.type="radio",i.name="input-radio-"+e.name,e.value&&(i.value=e.value,e.stateKey&&(o.Z.getState().then((t=>{i.checked=(0,n.Z)(t,e.stateKey)===e.value})),i.addEventListener("change",(()=>{r.Z.managers.appStateManager.setByKey(e.stateKey,e.value)}))));const s=this.main=document.createElement("div");s.classList.add("radio-field-main"),e.text?s.innerHTML=e.text:e.langKey&&(0,a.$d)(s,e.langKey),t.append(i,s)}get checked(){return this.input.checked}set checked(e){this.setValueSilently(e),(0,s.Z)(this.input,"change")}setValueSilently(e){this.input.checked=e}}},5133:(e,t,i)=>{"use strict";function s(e,t){const i=document.createElement("form");return e.forEach((e=>{const{container:s,input:n}=e;i.append(s),n.addEventListener("change",(e=>{n.checked&&t(n.value,e)}))})),i}i.d(t,{Z:()=>s})},65:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(5077),n=i(3228),a=i(5953);class o{constructor(e,t=0){this.mousedown=!1,this.events={},this.withTransition=!1,this.useTransform=!1,this.vertical=!1,this.onMouseMove=e=>{this.scrub(e)},this.onMouseDown=e=>{var t;this.rect=this.container.getBoundingClientRect(),this.mousedown=!0,this.scrub(e),this.container.classList.add("is-focused"),(null===(t=this.events)||void 0===t?void 0:t.onMouseDown)&&this.events.onMouseDown(e)},this.onMouseUp=e=>{var t;this.mousedown=!1,this.container.classList.remove("is-focused"),(null===(t=this.events)||void 0===t?void 0:t.onMouseUp)&&this.events.onMouseUp(e)},this.onInput=()=>{var e;const t=+this.seek.value;this.setFilled(t),(null===(e=this.events)||void 0===e?void 0:e.onScrub)&&this.events.onScrub(t)},(0,a.Z)(this,e),this.container=document.createElement("div"),this.container.classList.add("progress-line"),this.useTransform?this.container.classList.add("use-transform"):this.withTransition&&this.container.classList.add("with-transition"),this.filled=document.createElement("div"),this.filled.classList.add("progress-line__filled");const i=this.seek=document.createElement("input");i.classList.add("progress-line__seek"),i.type="range",i.step=""+this.step,i.min=""+this.min,i.max=""+this.max,i.value=""+t,t&&this.setProgress(t);const s=""+this.step,n=s.indexOf(".");this.decimals=-1===n?0:s.length-n-1,this.container.append(this.filled,i)}get value(){return+this.seek.value}setHandlers(e){this.events=e}setListeners(){this.seek.addEventListener("input",this.onInput),this._removeListeners=(0,s.Z)(this.container,this.onMouseDown,this.onMouseMove,this.onMouseUp)}setProgress(e){this.seek.value=""+e,this.setFilled(+this.seek.value)}addProgress(e){this.seek.value=""+(+this.seek.value+e),this.setFilled(+this.seek.value)}setFilled(e){let t=(e-this.min)/(this.max-this.min);t=(0,n.Z)(t,0,1),this.useTransform?this.filled.style.transform=`scaleX(${t})`:this.filled.style.width=100*t+"%"}scrub(e){var t;const i=this.vertical?this.rect.height:this.rect.width,s=(0,n.Z)(this.vertical?-(e.y-this.rect.bottom):e.x-this.rect.left,0,i);let a=this.min+s/i*(this.max-this.min);return a-this.min<(this.max-this.min)/2&&(a-=this.step/10),a=+a.toFixed(this.decimals),a=(0,n.Z)(a,this.min,this.max),this.setProgress(a),(null===(t=this.events)||void 0===t?void 0:t.onScrub)&&this.events.onScrub(a),a}removeListeners(){this._removeListeners&&(this._removeListeners(),this._removeListeners=null),this.seek.removeEventListener("input",this.onInput),this.events={}}}},1405:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var s=i(8497),n=i(9674),a=i(5432),o=i(5975),r=i(3035),d=i(5994);let l=0;function c(e,t=(()=>Promise.resolve()),i=null,c=!1,h=e){if(e.querySelector(".c-ripple"))return;e.classList.add("rp");const u=document.createElement("div");let p;u.classList.add("c-ripple"),e.classList.contains("rp-square")&&u.classList.add("is-square"),e[c?"prepend":"append"](u);const f=(e,s)=>{const o=Date.now(),d=document.createElement("div"),c=l++,h=1e3*+window.getComputedStyle(u).getPropertyValue("--ripple-duration").replace("s",""),f=p=()=>{const e=Date.now()-o,t=()=>{n.Z.mutate((()=>{d.remove()})),null==i||i(c)};if(ed.classList.add("hiding")),Math.max(i-h/2,0)),setTimeout(t,i)}else d.classList.add("hiding"),setTimeout(t,h/2);a.Z||(window.removeEventListener("contextmenu",p),window.removeEventListener("mousemove",p)),p=null,g=!1};null==t||t(c),(0,r.T2)((()=>{if(f!==p)return;const t=u.getBoundingClientRect();d.classList.add("c-ripple__circle");const i=e-t.left,n=s-t.top,a=Math.sqrt(Math.pow(Math.abs(n-t.height/2)+t.height/2,2)+Math.pow(Math.abs(i-t.width/2)+t.width/2,2)),o=i-a/2,r=n-a/2;d.style.width=d.style.height=a+"px",d.style.left=o+"px",d.style.top=r+"px",u.append(d)}))},m=t=>t.target!==e&&(["BUTTON","A"].includes(t.target.tagName)||(0,s.Z)(t.target,"c-ripple")!==u)&&(h===e||!(0,o.Z)(t.target,h))&&!(0,s.Z)(t.target,"checkbox-field");let g=!1;if(a.Z){const e=()=>{null==p||p()};h.addEventListener("touchstart",(t=>{if(!d.Z.isAvailable("animations"))return;if(t.touches.length>1||g||m(t))return;g=!0;const{clientX:i,clientY:s}=t.touches[0];f(i,s),h.addEventListener("touchend",e,{once:!0}),window.addEventListener("touchmove",(t=>{t.cancelBubble=!0,t.stopPropagation(),e(),h.removeEventListener("touchend",e)}),{once:!0})}),{passive:!0})}else h.addEventListener("mousedown",(e=>{if(![0,2].includes(e.button))return;if(!d.Z.isAvailable("animations"))return;if("0"===h.dataset.ripple||m(e))return;if(g)return void(g=!1);const{clientX:t,clientY:i}=e;f(t,i),window.addEventListener("mouseup",p,{once:!0,passive:!0}),window.addEventListener("contextmenu",p,{once:!0,passive:!0})}),{passive:!0})}},7479:(e,t,i)=>{"use strict";i.d(t,{De:()=>g,ZC:()=>v,ZP:()=>f,tG:()=>m});var s=i(9807),n=i(1218),a=i(1405),o=i(5133),r=i(2325),d=i(5565),l=i(130),c=i(2738),h=i(4494),u=i(4531);const p=(e,t)=>{!0===t||("string"==typeof t?(0,l.Z)(e,t):e.append(t))};class f{constructor(e={}){this.freezed=!1,e.checkboxFieldOptions&&(e.checkboxField=new s.Z(Object.assign({listenerSetter:e.listenerSetter},e.checkboxFieldOptions)));const t=e.asLink?"a":e.radioField||e.checkboxField?"label":"div";if(this.container=document.createElement(t),this.container.classList.add("row","no-subtitle"),e.noWrap&&this.container.classList.add("no-wrap"),e.subtitle){const t=this.subtitle;if(p(t,e.subtitle),e.noWrap&&t.classList.add("no-wrap"),e.subtitleRight){this.container.append(this.subtitleRow=this.createRow()),this.subtitleRow.classList.add("row-subtitle-row");const i=this.subtitleRight=document.createElement("div");i.classList.add("row-subtitle","row-subtitle-right"),p(i,e.subtitleRight),this.subtitleRow.append(t,i)}}else e.subtitleLangKey&&this.subtitle.append((0,r.ag)(e.subtitleLangKey,e.subtitleLangArgs));let i=!!e.havePadding;if(e.radioField||e.checkboxField){if(e.radioField&&(this.radioField=e.radioField,this.container.append(this.radioField.label),i=!0),e.checkboxField){this.checkboxField=e.checkboxField;const t=e.checkboxField.label.classList.contains("checkbox-field-toggle");if(t?(this.container.classList.add("row-with-toggle"),e.titleRight=this.checkboxField.label):(i=!0,this.checkboxField.span||this.checkboxField.label.classList.add("checkbox-field-absolute"),this.container.append(this.checkboxField.label)),e.withCheckboxSubtitle&&!t){const t=()=>{(0,d.Z)(this.subtitle,(0,r.ag)(this.checkboxField.input.checked?"Checkbox.Enabled":"Checkbox.Disabled"))};e.listenerSetter?e.listenerSetter.add(this.checkboxField.input)("change",t):this.checkboxField.input.addEventListener("change",t)}}(e.radioField||e.checkboxField).label.classList.add("disable-hover")}if(e.title||e.titleLangKey||e.titleRight||e.titleRightSecondary){let t;const i=e.titleRight||e.titleRightSecondary;if(i?(this.container.append(t=this.titleRow=this.createRow()),this.titleRow.classList.add("row-title-row")):t=this.container,this._title=this.createTitle(),e.noWrap&&this.title.classList.add("no-wrap"),e.title?p(this.title,e.title):e.titleLangKey&&this.title.append((0,r.ag)(e.titleLangKey)),t.append(this.title),i){const s=this.titleRight=document.createElement("div");s.classList.add("row-title","row-title-right"),e.titleRightSecondary&&s.classList.add("row-title-right-secondary"),p(s,i),t.append(s)}}e.icon&&(i=!0,this.container.classList.add("tgico","tgico-"+e.icon),this.container.classList.add("row-with-icon")),i&&this.container.classList.add("row-with-padding"),e.navigationTab&&(e.clickable=()=>e.navigationTab.open()),(e.clickable||e.radioField||e.checkboxField)&&("function"==typeof e.clickable&&(0,c.fc)(this.container,(t=>{this.freezed||e.clickable(t)}),{listenerSetter:e.listenerSetter}),this.container.classList.add("row-clickable","hover-effect"),e.noRipple||(0,a.Z)(this.container,void 0,void 0,!0)),(e.buttonRight||e.buttonRightLangKey)&&(this.buttonRight=e.buttonRight instanceof HTMLElement?e.buttonRight:(0,h.Z)("btn-primary btn-color-primary",{text:e.buttonRightLangKey}),this.container.append(this.buttonRight)),e.contextMenu&&(0,u.Z)(Object.assign(Object.assign({},e.contextMenu),{listenTo:this.container,listenerSetter:e.listenerSetter}))}get title(){return this._title}get subtitle(){var e;return null!==(e=this._subtitle)&&void 0!==e?e:this._subtitle=this.createSubtitle()}get midtitle(){var e;return null!==(e=this._midtitle)&&void 0!==e?e:this._midtitle=this.createMidtitle()}createRow(){const e=document.createElement("div");return e.classList.add("row-row"),e}createTitle(){const e=document.createElement("div");return e.classList.add("row-title"),(0,l.m)(e),e}createSubtitle(){const e=document.createElement("div");return e.classList.add("row-subtitle"),(0,l.m)(e),this.title?this.title.after(e):this.container.prepend(e),this.container.classList.remove("no-subtitle"),e}createMidtitle(){const e=document.createElement("div");return e.classList.add("row-midtitle"),this.subtitle.parentElement.insertBefore(e,this.subtitle),e}createMedia(e){const t=document.createElement("div");return this.applyMediaElement(t,e)}applyMediaElement(e,t){return this.container.classList.add("row-with-padding"),this.media=e,e.classList.add("row-media"),t&&e.classList.add("row-media-"+t),this.container.append(e),e}isDisabled(){return this.container.classList.contains("is-disabled")}toggleDisability(e=!this.container.classList.contains("is-disabled")){return this.container.classList.toggle("is-disabled",e),()=>this.toggleDisability(!e)}disableWithPromise(e){const t=this.toggleDisability(!0);e.finally((()=>{t()}))}makeSortable(){const e=document.createElement("span");this.container.classList.add("row-sortable","tgico"),e.classList.add("row-sortable-icon","tgico-menu"),this.container.append(e)}toggleSorting(e){this.container.classList.toggle("cant-sort",!e)}}const m=e=>new f({checkboxField:e,listenerSetter:e.listenerSetter}),g=(e,t)=>(0,o.Z)(e.map((e=>({container:e.container,input:e.radioField.input}))),t),v=(e,t)=>{const i="name-"+(8388607*Math.random()|0);let s;const a=e.map((({langPackKey:e,value:t,checked:a})=>{const o=new f({radioField:new n.Z({langKey:e,name:i,value:""+t})});return a&&(s=o.radioField),o})),o=g(a,t);return s&&(s.checked=!0),o}},8805:(e,t,i)=>{"use strict";i.d(t,{ZP:()=>l,v7:()=>c});var s=i(5432),n=i(5003),a=i(4789),o=i(8594),r=i(3910);class d{constructor(e,t="",i=document.createElement("div")){this.el=e,this.container=i,this.onScrollMeasure=0,this.lastScrollPosition=0,this.lastScrollDirection=0,this.isHeavyAnimationInProgress=!1,this.needCheckAfterAnimation=!1,this.onScroll=()=>{if(this.isHeavyAnimationInProgress)return this.cancelMeasure(),void(this.needCheckAfterAnimation=!0);(this.onScrolledTop||this.onScrolledBottom||this.splitUp||this.onAdditionalScroll)&&(this.onScrollMeasure||(this.onScrollMeasure=window.setTimeout((()=>{this.onScrollMeasure=0;const e=this.container[this.scrollProperty];this.lastScrollDirection=this.lastScrollPosition===e?0:this.lastScrollPositionthis.container.append(e))),e.append(this.container))}addScrollListener(){this.addedScrollListener||(this.addedScrollListener=!0,this.container.addEventListener("scroll",this.onScroll,{passive:!0,capture:!0}))}removeScrollListener(){this.addedScrollListener&&(this.addedScrollListener=!1,this.container.removeEventListener("scroll",this.onScroll,{capture:!0}))}setListeners(){this.removeHeavyAnimationListener||(window.addEventListener("resize",this.onScroll,{passive:!0}),this.addScrollListener(),this.removeHeavyAnimationListener=(0,o.ZP)((()=>{this.isHeavyAnimationInProgress=!0,this.onScrollMeasure&&(this.cancelMeasure(),this.needCheckAfterAnimation=!0)}),(()=>{this.isHeavyAnimationInProgress=!1,this.needCheckAfterAnimation&&(this.onScroll(),this.needCheckAfterAnimation=!1)})))}removeListeners(){this.removeHeavyAnimationListener&&(window.removeEventListener("resize",this.onScroll),this.removeScrollListener(),this.removeHeavyAnimationListener(),this.removeHeavyAnimationListener=void 0)}destroy(){this.removeListeners(),this.onAdditionalScroll=void 0,this.onScrolledTop=void 0,this.onScrolledBottom=void 0}append(...e){this.container.append(...e)}scrollIntoViewNew(e){return(0,a.Z)(Object.assign(Object.assign({},e),{container:this.container}))}cancelMeasure(){this.onScrollMeasure&&(clearTimeout(this.onScrollMeasure),this.onScrollMeasure=0)}}class l extends d{constructor(e,t="",i=300,s){super(e,t),this.onScrollOffset=i,this.loadedAll={top:!0,bottom:!1},this.checkForTriggers=()=>{if(!this.onScrolledTop&&!this.onScrolledBottom)return;if(this.isHeavyAnimationInProgress)return void this.onScroll();const e=this.container.scrollHeight;if(!e)return;const t=e-this.container.clientHeight,i=this.lastScrollPosition;this.onScrolledTop&&i<=this.onScrollOffset&&this.lastScrollDirection<=0&&this.onScrolledTop(),this.onScrolledBottom&&t-i<=this.onScrollOffset&&this.lastScrollDirection>=0&&this.onScrolledBottom()},this.container.classList.add("scrollable-y"),this.setListeners(),this.scrollProperty="scrollTop"}attachBorderListeners(e=this.container){const t=this.onAdditionalScroll;this.onAdditionalScroll=()=>{null==t||t(),e.classList.toggle("scrolled-top",!this.scrollTop),e.classList.toggle("scrolled-bottom",this.isScrolledDown)},e.classList.add("scrolled-top","scrolled-bottom","scrollable-y-bordered")}setVirtualContainer(e){this.splitUp=e,this.log("setVirtualContainer:",e,this)}prepend(...e){(this.splitUp||this.padding||this.container).prepend(...e)}append(...e){(this.splitUp||this.padding||this.container).append(...e)}getDistanceToEnd(){return this.scrollHeight-Math.round(this.scrollTop+this.container.offsetHeight)}get isScrolledDown(){return this.getDistanceToEnd()<=1}set scrollTop(e){this.container.scrollTop=e}get scrollTop(){return this.container.scrollTop}setScrollTopSilently(e){this.lastScrollPosition=e,this.ignoreNextScrollEvent(),this.scrollTop=e}ignoreNextScrollEvent(){this.removeHeavyAnimationListener&&(this.removeScrollListener(),this.container.addEventListener("scroll",(e=>{(0,r.Z)(e),this.addScrollListener()}),{capture:!0,passive:!1,once:!0}))}get scrollHeight(){return this.container.scrollHeight}}class c extends d{constructor(e,t="",i=300,n=15,a=document.createElement("div")){if(super(e,t,a),this.onScrollOffset=i,this.splitCount=n,this.container=a,this.container.classList.add("scrollable-x"),!s.Z){const e=e=>{!e.deltaX&&this.container.scrollWidth>this.container.clientWidth&&(this.container.scrollLeft+=e.deltaY/4,(0,r.Z)(e))};this.container.addEventListener("wheel",e,{passive:!1})}this.scrollProperty="scrollLeft"}}},5029:(e,t,i)=>{"use strict";i.d(t,{R:()=>r,Z:()=>o});var s=i(2325),n=i(36);const a="sidebar-left-section";class o{constructor(e={}){var t;const i=this.container=document.createElement("div");i.classList.add(a+"-container");const o=this.innerContainer=document.createElement("div");if(o.classList.add(a),e.noShadow&&o.classList.add("no-shadow"),e.fakeGradientDelimiter)o.append((0,n.G)()),o.classList.add("with-fake-delimiter");else if(e.noDelimiter)o.classList.add("no-delimiter");else{const e=document.createElement("hr");o.append(e)}const r=this.content=this.generateContentElement();if(e.name){const t=this.title=document.createElement("div");t.classList.add("sidebar-left-h2",a+"-name"),(0,s.XZ)({element:t,key:e.name,args:e.nameArgs}),r.append(t)}i.append(o);const d=null!==(t=e.caption)&&void 0!==t?t:e.captionOld;if(d){const t=this.caption=this.generateContentElement();t.classList.add(a+"-caption"),e.captionOld||i.append(t),!0!==d&&(0,s.XZ)({element:t,key:d,args:e.captionArgs})}}generateContentElement(){const e=document.createElement("div");return e.classList.add(a+"-content"),this.innerContainer.append(e),e}}const r=(e,t,i)=>{const s=new o({name:t,caption:i});return e.append(s.container),s.content}},7856:(e,t,i)=>{"use strict";i.d(t,{ir:()=>Qt,ZP:()=>ei});var s=i(7030),n=i(3512),a=i(5884),o=i(9331),r=i(8805),d=i(3607),l=i(3552),c=i(426),h=i(5005),u=i(503),p=i(187),f=i(2325),m=i(8119),g=i(3061),v=i(2738),b=i(5029);class y extends l._{constructor(){super(...arguments),this.uploadAvatar=null,this.isGeoChat=!1}init(e,t=!1){this.isGeoChat=t,this.peerIds=e,this.container.classList.add("new-group-container"),this.setTitle("NewGroup"),this.avatarEdit=new p.Z((e=>{this.uploadAvatar=e}));const i=new b.Z({}),n=document.createElement("div");n.classList.add("input-wrapper"),this.groupNameInputField=new u.ZP({label:"CreateGroup.NameHolder",maxLength:128}),this.groupLocationInputField=new u.ZP({label:"ChatLocation",name:"location",canBeEdited:!1}),n.append(this.groupNameInputField.container,this.groupLocationInputField.container),this.listenerSetter.add(this.groupNameInputField.input)("input",(()=>{let e=!!this.groupNameInputField.value.length&&!this.groupNameInputField.input.classList.contains("error");this.isGeoChat&&(e=e&&!!this.userLocationCoords&&!!this.userLocationAddress),this.nextBtn.classList.toggle("is-visible",!!e)})),this.nextBtn=(0,m.Z)({icon:"arrow_next"}),(0,v.fc)(this.nextBtn,(()=>{const e=this.groupNameInputField.value;let t;if(this.isGeoChat){if(!this.userLocationAddress||!this.userLocationCoords)return;t=this.managers.appChatsManager.createChannel({title:e,about:"",geo_point:Object.assign({_:"inputGeoPoint"},this.userLocationCoords),address:this.userLocationAddress,megagroup:!0}).then((e=>(this.uploadAvatar&&this.uploadAvatar().then((t=>{this.managers.appChatsManager.editPhoto(e,t)})),this.peerIds.length&&this.managers.appChatsManager.inviteToChannel(e,this.peerIds),e)))}else this.nextBtn.disabled=!0,t=this.managers.appChatsManager.createChat(e,this.peerIds.map((e=>e.toUserId()))).then((e=>(this.uploadAvatar&&this.uploadAvatar().then((t=>{this.managers.appChatsManager.editPhoto(e,t)})),e)));t&&t.then((e=>{this.close(),s.ZP.setInnerPeer({peerId:e.toPeerId(!0)})}))}),{listenerSetter:this.listenerSetter});const a=new b.Z({name:"Members",nameArgs:[this.peerIds.length]});this.peerIds.length||a.container.classList.add("hide");const o=this.list=h.default.createChatList({new:!0});a.content.append(o),i.content.append(this.avatarEdit.container,n),this.content.append(this.nextBtn),this.scrollable.append(i.container,a.container),t?(this.setTitle("NearbyCreateGroup"),this.groupLocationInputField.container.classList.remove("hide"),this.groupLocationInputField.setValueSilently(f.ZP.format("Loading",!0)),this.startLocating()):this.groupLocationInputField.container.classList.add("hide");const r=Promise.all(this.peerIds.map((e=>this.managers.appUsersManager.getUser(e.toUserId())))),d=this.managers.appUsersManager.getSelf(),l=r.then((e=>e.map((e=>{const{dom:t}=h.default.addDialogNew({peerId:e.id.toPeerId(!1),container:this.list,rippleEnabled:!1,avatarSize:"abitbigger"});t.lastMessageSpan.append((0,g.Z)(e))})))),c=this.peerIds.length>0&&this.peerIds.length<5?Promise.all([r,d]).then((([e,t])=>{const i=e.map((e=>[e.first_name,e.last_name].filter(Boolean).join(" ")));i.unshift(t.first_name);const s=(0,f.A1)(i,(e=>e?", ":" & ")).join("");this.groupNameInputField.setDraftValue(s)})):Promise.resolve();return Promise.all([l,c])}onCloseAfterTimeout(){this.avatarEdit.clear(),this.uploadAvatar=null,this.groupNameInputField.value="",this.groupLocationInputField.container.classList.add("hide"),this.nextBtn.disabled=!1}startLocating(){navigator.geolocation.getCurrentPosition((e=>{this.userLocationCoords={lat:e.coords.latitude,long:e.coords.longitude};let t="https://nominatim.openstreetmap.org/reverse";t+="?lat="+e.coords.latitude,t+="&lon="+e.coords.longitude,t+="&format=json",t+="&addressdetails=1",t+="&accept-language=en",fetch(t).then((e=>e.json())).then((e=>{this.userLocationAddress=e.display_name,this.groupLocationInputField.setValueSilently(e.display_name)}))}),(e=>{e instanceof GeolocationPositionError?this.groupLocationInputField.setValueSilently("Location permission denied. Please retry later."):this.groupLocationInputField.setValueSilently("An error has occurred. Please retry later.")}))}}var w,S=i(6360),C=i(632),L=i(410),I=i(5322),E=i(6024),P=i(7479),Z=i(5565),M=i(144);function T(e){const t=[],i={users:[],chats:[]},s={users:[],chats:[]};return e.forEach((e=>{switch(e._){case"privacyValueAllowAll":t.push(2);break;case"privacyValueDisallowAll":t.push(0);break;case"privacyValueAllowContacts":t.push(1);break;case"privacyValueAllowChatParticipants":i.chats.push(...e.chats);break;case"privacyValueAllowUsers":i.users.push(...e.users);break;case"privacyValueDisallowChatParticipants":s.chats.push(...e.chats);break;case"privacyValueDisallowUsers":s.users.push(...e.users)}})),{type:t[0],disallowPeers:s,allowPeers:i}}!function(e){e[e.Everybody=2]="Everybody",e[e.Contacts=1]="Contacts",e[e.Nobody=0]="Nobody"}(w||(w={}));const k=w;var x=i(1218),A=i(5670);class _{constructor(e){this.options=e,this.onRadioChange=e=>{e=+e,this.type=e;const t=this.options.captions[this.type],i=this.radioSection.caption;t?t instanceof HTMLElement?(0,Z.Z)(i,t):(0,f.$d)(i,t):i.innerHTML="",i.classList.toggle("hide",!t),this.exceptions&&(this.exceptions.get("allow").row.container.classList.toggle("hide",this.type===k.Everybody),this.exceptions.get("disallow").row.container.classList.toggle("hide",this.type===k.Nobody)),this.options.onRadioChange&&this.options.onRadioChange(e)},e.captions&&e.captions.reverse();const t=e.managers;this.radioSection=new b.Z({name:e.title,caption:!0}),this.radioRows=new Map;let i=[{type:k.Everybody,langKey:"PrivacySettingsController.Everbody"},{type:k.Contacts,langKey:"PrivacySettingsController.MyContacts"},{type:k.Nobody,langKey:"PrivacySettingsController.Nobody"}];e.skipTypes&&(i=i.filter((t=>!e.skipTypes.includes(t.type))));const s=(0,M.a)();i.forEach((({type:e,langKey:t})=>{const i=new P.ZP({radioField:new x.Z({langKey:t,name:s,value:""+e})});this.radioRows.set(e,i)}));const n=(0,P.De)([...this.radioRows.values()],this.onRadioChange);if(this.radioSection.content.append(n),e.appendTo&&e.appendTo.append(this.radioSection.container),!e.noExceptions){const t=(0,b.R)(e.appendTo,"PrivacyExceptions","PrivacySettingsController.PeerInfo");this.exceptions=new Map([["disallow",{titleLangKey:e.exceptionTexts[0],key:"disallow",row:null,icon:"deleteuser",subtitleLangKey:"PrivacySettingsController.AddUsers",clickable:!0}],["allow",{titleLangKey:e.exceptionTexts[1],key:"allow",row:null,icon:"adduser",subtitleLangKey:"PrivacySettingsController.AddUsers",clickable:!0}]]),this.exceptions.forEach((i=>{i.row=new P.ZP(i),i.row.container.addEventListener("click",(()=>{a.then((()=>{const t=this.peerIds[i.key];e.tab.slider.createTab(A.Z).open({type:"privacy",skippable:!0,title:i.titleLangKey,placeholder:"PrivacyModal.Search.Placeholder",takeOut:e=>{t.length=0,t.push(...e),i.row.subtitle.innerHTML="",i.row.subtitle.append(...this.generateStr(this.splitPeersByType(e)))},selectedPeerIds:t})}))})),t.append(i.row.container)}))}const a=t.appPrivacyManager.getPrivacy(e.inputKey).then((i=>{const s=T(i);this.setRadio(s.type),this.exceptions&&(this.peerIds={},["allow","disallow"].forEach((e=>{const t=[],i="allow"===e?s.allowPeers:s.disallowPeers;t.push(...i.users.map((e=>e.toPeerId()))),t.push(...i.chats.map((e=>e.toPeerId(!0)))),this.peerIds[e]=t;const n=this.exceptions.get(e).row.subtitle;n.innerHTML="",n.append(...this.generateStr(i))}))),e.tab.eventListener.addEventListener("destroy",(()=>{return i=this,s=void 0,a=function*(){const i=[];switch(this.type){case k.Everybody:i.push({_:"inputPrivacyValueAllowAll"});break;case k.Contacts:i.push({_:"inputPrivacyValueAllowContacts"});break;case k.Nobody:i.push({_:"inputPrivacyValueDisallowAll"})}if(this.exceptions){const e=[["allow","inputPrivacyValueAllowChatParticipants","inputPrivacyValueAllowUsers"],["disallow","inputPrivacyValueDisallowChatParticipants","inputPrivacyValueDisallowUsers"]];for(const[s,n,a]of e){if(this.exceptions.get(s).row.container.classList.contains("hide"))continue;const e=this.peerIds[s];if(e){const s=this.splitPeersByType(e);s.chats.length&&i.push({_:n,chats:s.chats}),s.users.length&&i.push({_:a,users:yield Promise.all(s.users.map((e=>t.appUsersManager.getUserInput(e))))})}}}t.appPrivacyManager.setPrivacy(e.inputKey,i)},new((n=void 0)||(n=Promise))((function(e,t){function o(e){try{d(a.next(e))}catch(e){t(e)}}function r(e){try{d(a.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(i,s||[])).next())}));var i,s,n,a}),{once:!0})}))}setRadio(e){const t=this.radioRows.get(e);this.onRadioChange(e),t.radioField.input.checked=!0}splitPeersByType(e){const t={users:[],chats:[]};return e.forEach((e=>{t[e.isAnyChat()?"chats":"users"].push(e.isAnyChat()?e.toChatId():e)})),t}generateStr(e){return e.users.length||e.chats.length?(0,f.v_)([e.users.length?(0,f.ag)("Users",[e.users.length]):null,e.chats.length?(0,f.ag)("Chats",[e.chats.length]):null].filter(Boolean),!1):[(0,f.ag)("PrivacySettingsController.AddUsers")]}}var F=i(3532);class D extends E.h{init(){return e=this,t=void 0,s=function*(){this.container.classList.add("privacy-tab","privacy-phone-number"),this.setTitle("PrivacyPhone");const e="+"+(yield this.managers.appUsersManager.getSelf()).phone,t=document.createElement("div");t.append((0,f.ag)("PrivacyPhoneInfo"),document.createElement("br"),document.createElement("br"),(0,f.ag)("PrivacyPhoneInfo4"),document.createElement("br"),(0,F.Z)({mePath:e}));const i=new _({tab:this,title:"PrivacyPhoneTitle",inputKey:"inputPrivacyKeyPhoneNumber",captions:[t,t,""],exceptionTexts:["PrivacySettingsController.NeverShare","PrivacySettingsController.AlwaysShare"],appendTo:this.scrollable,onRadioChange:e=>{n.setRadio(k.Everybody),n.radioSection.container.classList.toggle("hide",e!==k.Nobody)},managers:this.managers}),s="PrivacyPhoneInfo3",n=new _({tab:this,title:"PrivacyPhoneTitle2",inputKey:"inputPrivacyKeyAddedByPhone",captions:[s,s,""],noExceptions:!0,skipTypes:[k.Nobody],managers:this.managers});this.scrollable.container.insertBefore(n.radioSection.container,i.radioSection.container.nextSibling)},new((i=void 0)||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}));var e,t,i,s}}var R=i(4494),B=i(1168),N=i(8127),O=i(5772),U=i(279);class H extends l._{init(){this.container.classList.add("two-step-verification","two-step-verification-set"),this.setTitle("TwoStepVerificationPasswordSet");const e=new b.Z({captionOld:"TwoStepVerificationPasswordSetInfo",noDelimiter:!0}),t=document.createElement("div");(0,O.Z)({emoji:"🥳",div:t,width:160,height:160}),e.content.append(t);const i=e.generateContentElement(),s=document.createElement("div");s.classList.add("input-wrapper");const n=(0,R.Z)("btn-primary btn-color-primary",{text:"TwoStepVerificationPasswordReturnSettings"});(0,v.fc)(n,(e=>{this.close()})),this.slider.sliceTabsUntilTab(Tt,this),s.append(n),i.append(s),this.scrollable.container.append(e.container)}}var z=i(4489),j=i(4762);function G(e){return!j.IS_MOBILE_SAFARI||!e}var V=i(1656);class K extends l._{constructor(){super(...arguments),this.isFirst=!1}init(){this.container.classList.add("two-step-verification","two-step-verification-email-confirmation"),this.setTitle("TwoStepAuth.RecoveryTitle");const e=new b.Z({captionOld:!0,noDelimiter:!0});(0,f.$d)(e.caption,"TwoStepAuth.ConfirmEmailCodeDesc",[this.email]);const t=document.createElement("div");(0,O.Z)({div:t,width:160,height:160,emoji:"📬"}),e.content.append(t);const i=e.generateContentElement(),s=document.createElement("div");s.classList.add("input-wrapper");const n=this.codeInputField=new z.Z({name:"recovery-email-code",label:"TwoStepAuth.RecoveryCode",length:this.length,onFill:e=>{d(!0),this.managers.passwordManager.confirmPasswordEmail(""+e).then((e=>{r()})).catch((e=>{switch(e.type){case"CODE_INVALID":n.input.classList.add("error"),(0,Z.Z)(n.label,(0,f.ag)("TwoStepAuth.RecoveryCodeInvalid"));break;case"EMAIL_HASH_EXPIRED":n.input.classList.add("error"),(0,Z.Z)(n.label,(0,f.ag)("TwoStepAuth.RecoveryCodeExpired"));break;default:console.error("confirm error",e)}d(!1)}))}}),a=(0,R.Z)("btn-primary btn-primary-transparent primary",{text:"TwoStepAuth.EmailCodeChangeEmail"}),o=(0,R.Z)("btn-primary btn-secondary btn-primary-transparent primary",{text:"ResendCode"}),r=()=>{this.slider.createTab(H).open()},d=e=>{(0,V.Z)([n.input,a,o],e)};(0,v.fc)(a,(e=>{d(!0),this.managers.passwordManager.cancelPasswordEmail().then((e=>{this.slider.sliceTabsUntilTab(q,this),this.close()}),(()=>{d(!1)}))})),(0,v.fc)(o,(e=>{d(!0);const t=(0,U.y)(o);this.managers.passwordManager.resendPasswordEmail().then((e=>{t.remove(),d(!1)}))})),s.append(n.container,a,o),i.append(s),this.scrollable.container.append(e.container)}onOpenAfterTimeout(){G(this.isFirst)&&this.codeInputField.input.focus()}}var W=i(3910),$=i(1171);class q extends l._{constructor(){super(...arguments),this.isFirst=!1}init(){this.container.classList.add("two-step-verification","two-step-verification-email"),this.setTitle("RecoveryEmailTitle");const e=new b.Z({captionOld:!0,noDelimiter:!0}),t=document.createElement("div");(0,O.Z)({div:t,width:160,height:160,emoji:"💌"}),e.content.append(t);const i=e.generateContentElement(),s=document.createElement("div");s.classList.add("input-wrapper");const n=this.inputField=new u.ZP({name:"recovery-email",label:"RecoveryEmail",plainText:!0});n.input.addEventListener("keypress",(e=>{if("Enter"===e.key)return(0,W.Z)(e),d()})),n.input.addEventListener("input",(e=>{n.input.classList.remove("error")}));const a=(0,R.Z)("btn-primary btn-color-primary",{text:"Continue"}),o=(0,R.Z)("btn-primary btn-secondary btn-primary-transparent primary",{text:"YourEmailSkip"}),r=()=>{this.slider.createTab(H).open()},d=()=>{const e=n.value.trim(),t=(0,$.Z)(e);if(!t||t[0].length!==e.length)return void n.input.classList.add("error");l(!0);const i=(0,U.y)(a);this.managers.passwordManager.updateSettings({hint:this.hint,currentPassword:this.plainPassword,newPassword:this.newPassword,email:e}).then((e=>{r()}),(t=>{if(t.type.includes("EMAIL_UNCONFIRMED")){const i=+t.type.match(/^EMAIL_UNCONFIRMED_(\d+)/)[1],s=this.slider.createTab(K);s.state=this.state,s.email=e,s.length=i,s.open()}else console.log("password set error",t);l(!1),i.remove()}))};(0,v.fc)(a,d);const l=e=>{e?(a.setAttribute("disabled","true"),o.setAttribute("disabled","true")):(a.removeAttribute("disabled"),o.removeAttribute("disabled"))};(0,v.fc)(o,(e=>{B.Z.createPopup(N.Z,"popup-skip-email",{buttons:[{langKey:"Cancel",isCancel:!0},{langKey:"YourEmailSkip",callback:()=>{l(!0),(0,U.y)(o),this.managers.passwordManager.updateSettings({hint:this.hint,currentPassword:this.plainPassword,newPassword:this.newPassword,email:""}).then((()=>{r()}),(e=>{l(!1)}))},isDanger:!0}],titleLangKey:"YourEmailSkipWarning",descriptionLangKey:"YourEmailSkipWarningText"}).show()})),s.append(n.container,a,o),i.append(s),this.scrollable.container.append(e.container)}onOpenAfterTimeout(){G(this.isFirst)&&this.inputField.input.focus()}}var Y=i(130),Q=i(8115),X=i(4425),J=i(6830),ee=i(3083),te=i(2796);class ie extends l._{init(){this.container.classList.add("two-step-verification","two-step-verification-hint"),this.setTitle("TwoStepAuth.SetupHintTitle");const e=new b.Z({noDelimiter:!0}),t=document.createElement("div");(0,O.Z)({div:t,width:160,height:160,emoji:"💡"}),e.content.append(t);const i=document.createElement("div");i.classList.add("input-wrapper");const s=this.inputField=new u.ZP({name:"hint",label:"TwoStepAuth.SetupHintPlaceholder"});s.input.addEventListener("keypress",(e=>{if("Enter"===e.key)return(0,W.Z)(e),s.value?r():d()}));const n=(e,t)=>{e&&(0,W.Z)(e);const i=t?s.value:void 0;if(i&&this.newPassword===i)return void(0,te.Am)(f.ZP.format("PasswordAsHintError",!0));const n=this.slider.createTab(q);n.state=this.state,n.plainPassword=this.plainPassword,n.newPassword=this.newPassword,n.hint=i,n.open()},a=(0,R.Z)("btn-primary btn-color-primary",{text:"Continue"}),o=(0,R.Z)("btn-primary btn-secondary btn-primary-transparent primary",{text:"YourEmailSkip"}),r=e=>n(e,!0),d=e=>n(e,!1);(0,v.fc)(a,r),(0,v.fc)(o,d),i.append(s.container,a,o),e.content.append(i),this.scrollable.container.append(e.container)}onOpenAfterTimeout(){this.inputField.input.focus()}}class se extends l._{init(){this.container.classList.add("two-step-verification","two-step-verification-enter-password","two-step-verification-re-enter-password"),this.setTitle("PleaseReEnterPassword");const e=new b.Z({noDelimiter:!0}),t=document.createElement("div");t.classList.add("input-wrapper");const i=this.passwordInputField=new J.Z({name:"re-enter-password",label:"PleaseReEnterPassword"}),s=new ee.Z(i,157),n=(0,R.Z)("btn-primary btn-color-primary",{text:"Continue"});t.append(i.container,n),e.content.append(s.container,t),this.scrollable.container.append(e.container),i.input.addEventListener("keypress",(e=>{if(i.input.classList.contains("error")&&i.setState(u.I1.Neutral),"Enter"===e.key)return o()}));const a=()=>this.newPassword===i.value||(i.setError(),!1),o=e=>{if(e&&(0,W.Z)(e),!a())return;const t=this.slider.createTab(ie);t.state=this.state,t.plainPassword=this.plainPassword,t.newPassword=this.newPassword,t.open()};return(0,v.fc)(n,o),s.load()}onOpenAfterTimeout(){this.passwordInputField.input.focus()}}class ne extends l._{constructor(){super(...arguments),this.isFirst=!0}init(){const e=!this.state.pFlags.has_password||this.plainPassword;this.container.classList.add("two-step-verification","two-step-verification-enter-password"),this.setTitle(e?"PleaseEnterFirstPassword":"PleaseEnterCurrentPassword");const t=new b.Z({noDelimiter:!0}),i=document.createElement("div");i.classList.add("input-wrapper");const s=this.passwordInputField=new J.Z({name:"enter-password",label:e?"PleaseEnterFirstPassword":this.state.hint?void 0:"LoginPassword",labelText:!e&&this.state.hint?(0,Q.Z)(this.state.hint):void 0}),n=new X.Z(s,157),a=(0,R.Z)("btn-primary btn-color-primary"),o=new f.ZP.IntlElement({key:"Continue"});a.append(o.element),i.append(s.container,a),t.content.append(n.container,i),this.scrollable.container.append(t.container),s.input.addEventListener("keypress",(e=>{if(s.input.classList.contains("error")&&(s.input.classList.remove("error"),o.key="Continue",o.update()),"Enter"===e.key)return d()}));const r=()=>!!s.value.length||(s.input.classList.add("error"),!1);let d;if(e)d=e=>{if(e&&(0,W.Z)(e),!r())return;const t=this.slider.createTab(se);t.state=this.state,t.newPassword=s.value,t.plainPassword=this.plainPassword,t.open()};else{let e;const t=()=>(e||(e=window.setInterval(t,1e4)),this.managers.passwordManager.getState().then((e=>{this.state=e,this.state.hint?(0,Y.Z)(s.label,(0,Q.Z)(this.state.hint)):(0,Z.Z)(s.label,(0,f.ag)("LoginPassword"))})));d=i=>{if(!r())return void(0,W.Z)(i);a.setAttribute("disabled","true"),o.key="PleaseWait",o.update();const d=(0,U.y)(a),l=s.value;this.managers.passwordManager.check(s.value,this.state).then((t=>{if(console.log(t),"auth.authorization"===t._){clearInterval(e),n&&n.remove();const t=this.slider.createTab(ae);t.state=this.state,t.plainPassword=l,t.open(),this.slider.removeTabFromHistory(this)}}),(e=>{a.removeAttribute("disabled"),s.input.classList.add("error"),e.type,o.key="PASSWORD_HASH_INVALID",o.update(),d.remove(),s.select(),t()}))},t()}return(0,v.fc)(a,d),n.load()}onOpenAfterTimeout(){G(this.isFirst)&&this.passwordInputField.input.focus()}}class ae extends l._{init(){this.container.classList.add("two-step-verification","two-step-verification-main"),this.setTitle("TwoStepVerificationTitle");const e=new b.Z({captionOld:!0,noDelimiter:!0}),t=document.createElement("div");(0,O.Z)({div:t,width:168,height:168,emoji:"🔐"}),e.content.append(t);const i=e.generateContentElement();if(this.state.pFlags.has_password){(0,f.$d)(e.caption,"TwoStepAuth.GenericHelp");const t=(0,R.Z)("btn-primary btn-transparent",{icon:"edit",text:"TwoStepAuth.ChangePassword"}),s=(0,R.Z)("btn-primary btn-transparent",{icon:"passwordoff",text:"TwoStepAuth.RemovePassword"}),n=(0,R.Z)("btn-primary btn-transparent",{icon:"email",text:this.state.pFlags.has_recovery?"TwoStepAuth.ChangeEmail":"TwoStepAuth.SetupEmail"});(0,v.fc)(t,(()=>{const e=this.slider.createTab(ne);e.state=this.state,e.plainPassword=this.plainPassword,e.open()})),(0,v.fc)(s,(()=>{B.Z.createPopup(N.Z,"popup-disable-password",{buttons:[{langKey:"Disable",callback:()=>{this.managers.passwordManager.updateSettings({currentPassword:this.plainPassword}).then((()=>{this.slider.sliceTabsUntilTab(Tt,this),this.close()}))},isDanger:!0}],titleLangKey:"TurnPasswordOffQuestionTitle",descriptionLangKey:"TurnPasswordOffQuestion"}).show()})),(0,v.fc)(n,(()=>{const e=this.slider.createTab(q);e.state=this.state,e.hint=this.state.hint,e.plainPassword=this.plainPassword,e.newPassword=this.plainPassword,e.isFirst=!0,e.open()})),i.append(t,s,n)}else{(0,f.$d)(e.caption,"TwoStepAuth.SetPasswordHelp");const t=document.createElement("div");t.classList.add("input-wrapper");const s=(0,R.Z)("btn-primary btn-color-primary",{text:"TwoStepVerificationSetPassword"});t.append(s),i.append(t),(0,v.fc)(s,(e=>{const t=this.slider.createTab(ne);t.state=this.state,t.open()}))}this.scrollable.container.append(e.container)}}class oe extends E.h{init(){this.container.classList.add("privacy-tab","privacy-last-seen"),this.setTitle("PrivacyLastSeen");const e="PrivacySettingsController.LastSeenDescription";new _({tab:this,title:"LastSeenTitle",inputKey:"inputPrivacyKeyStatusTimestamp",captions:[e,e,e],exceptionTexts:["PrivacySettingsController.NeverShare","PrivacySettingsController.AlwaysShare"],appendTo:this.scrollable,managers:this.managers})}}class re extends E.h{init(){this.container.classList.add("privacy-tab","privacy-profile-photo"),this.setTitle("PrivacyProfilePhoto");const e="PrivacySettingsController.ProfilePhoto.CustomHelp";new _({tab:this,title:"PrivacyProfilePhotoTitle",inputKey:"inputPrivacyKeyProfilePhoto",captions:[e,e,e],exceptionTexts:["PrivacySettingsController.NeverShare","PrivacySettingsController.AlwaysShare"],appendTo:this.scrollable,skipTypes:[k.Nobody],managers:this.managers})}}class de extends E.h{init(){this.container.classList.add("privacy-tab","privacy-forward-messages"),this.setTitle("PrivacySettings.Forwards");const e="PrivacySettingsController.Forwards.CustomHelp";new _({tab:this,title:"PrivacyForwardsTitle",inputKey:"inputPrivacyKeyForwards",captions:[e,e,e],exceptionTexts:["PrivacySettingsController.NeverAllow","PrivacySettingsController.AlwaysAllow"],appendTo:this.scrollable,managers:this.managers})}}class le extends E.h{init(){this.container.classList.add("privacy-tab","privacy-add-to-groups"),this.setTitle("PrivacySettings.Groups");const e="PrivacySettingsController.GroupDescription";new _({tab:this,title:"WhoCanAddMe",inputKey:"inputPrivacyKeyChatInvite",captions:[e,e,e],exceptionTexts:["PrivacySettingsController.NeverAllow","PrivacySettingsController.AlwaysAllow"],appendTo:this.scrollable,skipTypes:[k.Nobody],managers:this.managers})}}class ce extends E.h{init(){this.container.classList.add("privacy-tab","privacy-calls"),this.setTitle("PrivacySettings.VoiceCalls");const e="PrivacySettingsController.PhoneCallDescription";new _({tab:this,title:"WhoCanCallMe",inputKey:"inputPrivacyKeyPhoneCall",captions:[e,e,e],exceptionTexts:["PrivacySettingsController.NeverAllow","PrivacySettingsController.AlwaysAllow"],appendTo:this.scrollable,managers:this.managers});{const e="PrivacySettingsController.P2p.Desc";new _({tab:this,title:"PrivacyP2PHeader",inputKey:"inputPrivacyKeyPhoneP2P",captions:[e,e,e],exceptionTexts:["PrivacySettingsController.NeverAllow","PrivacySettingsController.AlwaysAllow"],appendTo:this.scrollable,managers:this.managers})}}}var he=i(3003),ue=i(8497),pe=i(4064),fe=i(6976),me=i(1483),ge=i(3416);class ve extends E.h{init(){this.container.classList.add("active-sessions-container"),this.setTitle("SessionsTitle");const e=e=>{const t=new P.ZP({title:[e.app_name,e.app_version].join(" "),subtitle:[e.ip,e.country].join(" - "),clickable:!0,titleRight:e.pFlags.current?void 0:(0,C.zM)(new Date(1e3*Math.max(e.date_active,e.date_created)))});return t.container.dataset.hash=""+e.hash,t.midtitle.textContent=[e.device_model,e.system_version||e.platform].filter(Boolean).join(", "),t},t=this.authorizations.slice();{const n=new b.Z({name:"CurrentSession",caption:"ClearOtherSessionsHelp"}),a=(0,pe.Z)(t,(e=>e.pFlags.current)),o=e(a);if(n.content.append(o.container),t.length){const e=(0,R.Z)("btn-primary btn-transparent danger",{icon:"stop",text:"TerminateAllSessions"});(0,v.fc)(e,(t=>{B.Z.createPopup(N.Z,"revoke-session",{buttons:[{langKey:"Terminate",isDanger:!0,callback:()=>{const t=(0,V.Z)([e],!0);this.managers.apiManager.invokeApi("auth.resetAuthorizations").then((t=>{e.remove(),i.container.remove()}),s).finally((()=>{t()}))}}],titleLangKey:"AreYouSureSessionsTitle",descriptionLangKey:"AreYouSureSessions"}).show()}),{listenerSetter:this.listenerSetter}),n.content.append(e)}this.scrollable.append(n.container)}if(!t.length)return;const i=new b.Z({name:"OtherSessions",caption:"SessionsListInfo"});t.forEach((t=>{i.content.append(e(t).container)})),this.scrollable.append(i.container);const s=e=>{"FRESH_RESET_AUTHORISATION_FORBIDDEN"===e.type&&(0,te.Am)(f.ZP.format("RecentSessions.Error.FreshReset",!0))};let n;const a=()=>{const e=n.dataset.hash;B.Z.createPopup(N.Z,"revoke-session",{buttons:[{langKey:"Terminate",isDanger:!0,callback:()=>{this.managers.apiManager.invokeApi("account.resetAuthorization",{hash:e}).then((e=>{e&&n.remove()}),s)}}],titleLangKey:"AreYouSureSessionTitle",descriptionLangKey:"TerminateSessionText"}).show()},o=this.menuElement=(0,he.b)({buttons:[{icon:"stop",text:"Terminate",onClick:a}]});o.id="active-sessions-contextmenu",o.classList.add("contextmenu"),document.getElementById("page-chats").append(o),(0,fe.E)({element:this.scrollable.container,callback:e=>{n=(0,ue.Z)(e.target,"row"),n&&"0"!==n.dataset.hash&&(e instanceof MouseEvent&&e.preventDefault(),e instanceof MouseEvent&&(e.cancelBubble=!0),(0,me.Z)(e,o),ge.Z.openBtnMenu(o))},listenerSetter:this.listenerSetter}),(0,v.fc)(this.scrollable.container,(e=>{n=(0,ue.Z)(e.target,"row"),n&&"0"!==n.dataset.hash&&a()}),{listenerSetter:this.listenerSetter})}onCloseAfterTimeout(){var e;return null===(e=this.menuElement)||void 0===e||e.remove(),super.onCloseAfterTimeout()}}var be=i(2995),ye=i(4668),we=i(8210),Se=i(5102);class Ce extends l._{init(){this.container.classList.add("blocked-users-container"),this.setTitle("BlockedUsers");const e=new b.Z({caption:"BlockedUsersInfo"});e.caption.parentElement.prepend(e.caption),this.scrollable.append(e.container);const t=(0,m.Z)({icon:"add",className:"is-visible"});this.content.append(t),(0,v.fc)(t,(e=>{B.Z.createPopup(be.Z,{peerTypes:["contacts"],placeholder:"BlockModal.Search.Placeholder",onSelect:e=>{this.managers.appUsersManager.toggleBlock(e,!0)}})}),{listenerSetter:this.listenerSetter});const i=h.default.createChatList();this.scrollable.container.classList.add("chatlist-container"),e.content.append(i);const s=(e,t)=>{return s=this,n=void 0,o=function*(){const{dom:s}=h.default.addDialogNew({peerId:e,container:i,rippleEnabled:!0,avatarSize:"abitbigger",append:t}),n=yield this.managers.appUsersManager.getUser(e.toUserId());if(!n)return;const a=(0,Se.Z)(n)[0];n.pFlags.bot?s.lastMessageSpan.append("@"+a):n.phone?s.lastMessageSpan.innerHTML=(0,we.Z)(n.phone):s.lastMessageSpan.append(a?"@"+a:(0,g.Z)(n))},new((a=void 0)||(a=Promise))((function(e,t){function i(e){try{d(o.next(e))}catch(e){t(e)}}function r(e){try{d(o.throw(e))}catch(e){t(e)}}function d(t){var s;t.done?e(t.value):(s=t.value,s instanceof a?s:new a((function(e){e(s)}))).then(i,r)}d((o=o.apply(s,n||[])).next())}));var s,n,a,o};for(const e of this.peerIds)s(e,!0);let a;const o=this.menuElement=(0,he.b)({buttons:[{icon:"lockoff",text:"Unblock",onClick:()=>{const e=a.dataset.peerId.toPeerId();this.managers.appUsersManager.toggleBlock(e,!1)},options:{listenerSetter:this.listenerSetter}}]});o.id="blocked-users-contextmenu",o.classList.add("contextmenu"),document.getElementById("page-chats").append(o),(0,fe.E)({element:this.scrollable.container,callback:e=>{a=(0,ye.Z)(e.target,h.DIALOG_LIST_ELEMENT_TAG),a&&(e instanceof MouseEvent&&e.preventDefault(),e instanceof MouseEvent&&(e.cancelBubble=!0),(0,me.Z)(e,o),ge.Z.openBtnMenu(o))},listenerSetter:this.listenerSetter}),this.listenerSetter.add(n.Z)("peer_block",(e=>{const{peerId:t,blocked:n}=e,a=i.querySelector(`[data-peer-id="${t}"]`);n?a||s(t,!1):a&&a.remove()}));let r=!1;this.scrollable.onScrolledBottom=()=>{r||(r=!0,this.managers.appUsersManager.getBlocked(i.childElementCount,50).then((e=>{for(const t of e.peerIds)s(t,!0);(e.peerIds.length<50||i.childElementCount===e.count)&&(this.scrollable.onScrolledBottom=null),this.scrollable.checkForTriggers()})).finally((()=>{r=!1})))}}onOpenAfterTimeout(){this.scrollable.onScroll()}onCloseAfterTimeout(){return this.menuElement&&this.menuElement.remove(),super.onCloseAfterTimeout()}}var Le=i(9807);function Ie(e){return"input"+(e[0].toUpperCase()+e.slice(1))}var Ee=i(5592),Pe=i(319);class Ze extends E.h{init(){this.container.classList.add("privacy-tab","privacy-voices"),this.setTitle("PrivacyVoiceMessages");const e="PrivacyVoiceMessagesInfo";new _({tab:this,title:"PrivacyVoiceMessagesTitle",inputKey:"inputPrivacyKeyVoiceMessages",captions:[e,e,e],exceptionTexts:["PrivacySettingsController.NeverAllow","PrivacySettingsController.AlwaysAllow"],appendTo:this.scrollable,managers:this.managers})}}var Me=i(7362),Te=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class ke extends E.h{init(e){return Te(this,void 0,void 0,(function*(){this.container.classList.add("active-sessions-container"),this.setTitle("WebSessionsTitle");const t=e=>Te(this,void 0,void 0,(function*(){const t=e.bot_id.toPeerId(),i=new P.ZP({title:yield(0,Me.Z)({peerId:t}),subtitle:[e.ip,e.region].join(" - "),clickable:!0,titleRight:(0,C.zM)(new Date(1e3*Math.max(e.date_active,e.date_created)))}),s=i.createMedia("big"),n=new o.Z;return n.classList.add("avatar-48"),yield n.updateWithOptions({peerId:t}),s.append(n),i.container.dataset.hash=""+e.hash,i.container.dataset.peerId=""+t,i.midtitle.textContent=[e.domain,e.browser,e.platform].filter(Boolean).join(", "),i}));{const e=new b.Z({caption:"ClearOtherWebSessionsHelp"}),t=(0,R.Z)("btn-primary btn-transparent danger",{icon:"stop",text:"TerminateAllWebSessions"});(0,v.fc)(t,(()=>Te(this,void 0,void 0,(function*(){yield(0,Ee.Z)({descriptionLangKey:"AreYouSureWebSessions",button:{langKey:"Disconnect",isDanger:!0}}),(0,V.Z)([t],!0),this.managers.appSeamlessLoginManager.resetWebAuthorizations().then((()=>{this.close()}))}))),{listenerSetter:this.listenerSetter}),e.content.append(t),this.scrollable.append(e.container)}{const i=new b.Z({name:"OtherWebSessions",caption:"TerminateWebSessionInfo"}),s=yield Promise.all(e.map(t));i.content.append(...s.map((e=>e.container)));let n=s.length;(0,v.fc)(i.content,(e=>Te(this,void 0,void 0,(function*(){const t=(0,ue.Z)(e.target,"row");if(!t)return;yield(0,Ee.Z)({descriptionLangKey:"TerminateWebSessionText",descriptionLangArgs:[yield(0,Me.Z)({peerId:t.dataset.peerId.toPeerId()})],button:{langKey:"Disconnect",isDanger:!0}});const i=t.dataset.hash;t.classList.add("is-disabled"),this.managers.appSeamlessLoginManager.resetWebAuthorization(i).then((()=>{--n?t.remove():this.close()}))}))),{listenerSetter:this.listenerSetter}),this.scrollable.append(i.container)}}))}}class xe extends E.h{static getInitArgs(e){return{appConfig:e.managers.apiManager.getAppConfig(),globalPrivacy:e.managers.appPrivacyManager.getGlobalPrivacySettings(),contentSettings:e.managers.apiManager.invokeApi("account.getContentSettings"),webAuthorizations:e.managers.appSeamlessLoginManager.getWebAuthorizations()}}init(e){this.container.classList.add("dont-u-dare-block-me"),this.setTitle("PrivacySettings");const t="Loading",i=[];{const s=new b.Z({noDelimiter:!0,caption:"SessionsInfo"});let a;const o=new P.ZP({icon:"deleteuser",titleLangKey:"BlockedUsers",subtitleLangKey:t,clickable:()=>{const e=this.slider.createTab(Ce);e.peerIds=a,e.open()},listenerSetter:this.listenerSetter});let r;o.freezed=!0;const d={icon:"lock",titleLangKey:"TwoStepVerification",subtitleLangKey:t,clickable:e=>{let t;r.pFlags.has_password?t=this.slider.createTab(ne):r.email_unconfirmed_pattern?(t=this.slider.createTab(K),t.email=r.email_unconfirmed_pattern,t.length=6,t.isFirst=!0,this.managers.passwordManager.resendPasswordEmail()):t=this.slider.createTab(ae),t.state=r,t.open()},listenerSetter:this.listenerSetter},l=new P.ZP(d);l.freezed=!0;const c=this.activeSessionsRow=new P.ZP({icon:"activesessions",titleLangKey:"SessionsTitle",subtitleLangKey:t,clickable:()=>{const e=this.slider.createTab(ve);e.authorizations=this.authorizations,e.eventListener.addEventListener("destroy",(()=>{this.updateActiveSessions()}),{once:!0}),e.open()},listenerSetter:this.listenerSetter});c.freezed=!0;const h=this.websitesRow=new P.ZP({icon:"mention",titleLangKey:"OtherWebSessions",subtitleLangKey:t,clickable:()=>{const e=this.slider.createTab(ke);e.eventListener.addEventListener("destroy",(()=>{this.updateActiveWebsites()})),e.open(this.websites)},listenerSetter:this.listenerSetter});h.freezed=!0,s.content.append(o.container,l.container,c.container,h.container),this.scrollable.append(s.container);const u=e=>{e?(0,Z.Z)(o.subtitle,(0,f.ag)("PrivacySettingsController.UserCount",[e])):(0,Z.Z)(o.subtitle,(0,f.ag)("BlockedEmpty",[e]))};this.listenerSetter.add(n.Z)("peer_block",(()=>{p()}));const p=()=>{this.managers.appUsersManager.getBlocked().then((e=>{o.freezed=!1,u(e.count),a=e.peerIds}))};p(),this.managers.passwordManager.getState().then((e=>{r=e,(0,Z.Z)(l.subtitle,(0,f.ag)(e.pFlags.has_password?"PrivacyAndSecurity.Item.On":"PrivacyAndSecurity.Item.Off")),l.freezed=!1})),this.updateActiveSessions(),i.push(this.updateActiveWebsites(e.webAuthorizations))}{const e=new b.Z({name:"PrivacyTitle",caption:"GroupsAndChannelsHelp"});e.content.classList.add("privacy-navigation-container");const i={},s=i.inputPrivacyKeyPhoneNumber=new P.ZP({titleLangKey:"PrivacyPhoneTitle",subtitleLangKey:t,clickable:()=>{this.slider.createTab(D).open()},listenerSetter:this.listenerSetter}),a=i.inputPrivacyKeyStatusTimestamp=new P.ZP({titleLangKey:"LastSeenTitle",subtitleLangKey:t,clickable:()=>{this.slider.createTab(oe).open()},listenerSetter:this.listenerSetter}),o=i.inputPrivacyKeyProfilePhoto=new P.ZP({titleLangKey:"PrivacyProfilePhotoTitle",subtitleLangKey:t,clickable:()=>{this.slider.createTab(re).open()},listenerSetter:this.listenerSetter}),r=i.inputPrivacyKeyPhoneCall=new P.ZP({titleLangKey:"WhoCanCallMe",subtitleLangKey:t,clickable:()=>{this.slider.createTab(ce).open()},listenerSetter:this.listenerSetter}),d=i.inputPrivacyKeyForwards=new P.ZP({titleLangKey:"PrivacyForwardsTitle",subtitleLangKey:t,clickable:()=>{this.slider.createTab(de).open()},listenerSetter:this.listenerSetter}),l=i.inputPrivacyKeyChatInvite=new P.ZP({titleLangKey:"WhoCanAddMe",subtitleLangKey:t,clickable:()=>{this.slider.createTab(le).open()},listenerSetter:this.listenerSetter}),c=i.inputPrivacyKeyVoiceMessages=new P.ZP({titleLangKey:"PrivacyVoiceMessagesTitle",subtitleLangKey:t,clickable:()=>{n.Z.premium?this.slider.createTab(Ze).open():(0,te.bC)({langPackKey:"PrivacyVoiceMessagesPremiumOnly"})},listenerSetter:this.listenerSetter}),h=e=>{const t=i[e];t&&this.managers.appPrivacyManager.getPrivacy(e).then((e=>{const i=T(e),s=i.type===k.Everybody?"PrivacySettingsController.Everbody":i.type===k.Contacts?"PrivacySettingsController.MyContacts":"PrivacySettingsController.Nobody",n=i.disallowPeers.users.length+i.disallowPeers.chats.length,a=i.allowPeers.users.length+i.allowPeers.chats.length;t.subtitle.innerHTML="";const o=(0,f.ag)(s);t.subtitle.append(o),(n||a)&&t.subtitle.append(` (${[-n,a?"+"+a:0].filter(Boolean).join(", ")})`)}))};e.content.append(s.container,a.container,o.container,r.container,d.container,l.container,c.container),this.scrollable.append(e.container);for(const e in i)h(e);n.Z.addEventListener("privacy_update",(e=>{h(Ie(e.key._))}))}{const t=new b.Z({name:"NewChatsFromNonContacts",caption:"ArchiveAndMuteInfo"}),s=new Le.Z({text:"ArchiveAndMute"}),a=new P.ZP({checkboxField:s});let o,r;t.content.append(a.container),this.eventListener.addEventListener("destroy",(()=>{if(r=!0,void 0!==o&&o!==s.checked)return this.managers.appPrivacyManager.setGlobalPrivacySettings({_:"globalPrivacySettings",archive_and_mute_new_noncontact_peers:s.checked})}),{once:!0});const d=Promise.all([e.appConfig,e.globalPrivacy]).then((([e,i])=>{if(r)return;const a=i=>{t.container.classList.toggle("hide",!i&&!e.autoarchive_setting_available)};this.listenerSetter.add(n.Z)("premium_toggle",a),a(n.Z.premium),o=!!i.archive_and_mute_new_noncontact_peers,s.setValueSilently(o)}));i.push(d),this.scrollable.append(t.container)}{const t=new b.Z({name:"Privacy.SensitiveContent",caption:"PrivacyAndSecurity.SensitiveDesc"});t.container.classList.add("hide");const s=new Le.Z({text:"PrivacyAndSecurity.SensitiveText"}),n=new P.ZP({checkboxField:s});let a;t.content.append(n.container),this.eventListener.addEventListener("destroy",(()=>{if(void 0===a)return;const e=n.checkboxField.checked;return e!==a?this.managers.apiManager.invokeApi("account.setContentSettings",{sensitive_enabled:e}):void 0}),{once:!0});const o=e.contentSettings.then((e=>{e.pFlags.sensitive_can_change&&(a=!!e.pFlags.sensitive_enabled,s.setValueSilently(a),t.container.classList.remove("hide"))}));i.push(o),this.scrollable.append(t.container)}{const e=new b.Z({name:"PrivacyPayments",caption:"PrivacyPaymentsClearInfo"}),t=()=>{const e={titleLangKey:"PrivacyPaymentsClearAlertTitle",descriptionLangKey:"PrivacyPaymentsClearAlertText",button:{langKey:"Clear"},checkboxes:[{text:"PrivacyClearShipping",checked:!0},{text:"PrivacyClearPayment",checked:!0}]};(0,Ee.Z)(e).then((()=>{const[t,s]=e.checkboxes.map((e=>e.checkboxField.checked)),n=(0,V.Z)([i],!0);this.managers.appPaymentsManager.clearSavedInfo(t,s).then((()=>{(t||s)&&(n(),(0,te.bC)({langPackKey:t&&s?"PrivacyPaymentsPaymentShippingCleared":t?"PrivacyPaymentsShippingInfoCleared":"PrivacyPaymentsPaymentInfoCleared"}))}))}),Pe.Z)},i=(0,R.Z)("btn-primary btn-transparent",{icon:"delete",text:"PrivacyPaymentsClear"});this.listenerSetter.add(i)("click",t),e.content.append(i),this.scrollable.append(e.container)}{const e=new b.Z({name:"FilterChats"}),t=()=>{B.Z.createPopup(N.Z,"popup-delete-drafts",{buttons:[{langKey:"Delete",callback:()=>{const e=(0,V.Z)([i],!0);this.managers.appDraftsManager.clearAllDrafts().then((()=>{e()}))},isDanger:!0}],titleLangKey:"AreYouSureClearDraftsTitle",descriptionLangKey:"AreYouSureClearDrafts"}).show()},i=(0,R.Z)("btn-primary btn-transparent",{icon:"delete",text:"PrivacyDeleteCloudDrafts"});this.listenerSetter.add(i)("click",t),e.content.append(i),this.scrollable.append(e.container)}return Promise.all(i)}updateActiveSessions(){return this.managers.apiManager.invokeApi("account.getAuthorizations").then((e=>{this.activeSessionsRow.freezed=!1,this.authorizations=e.authorizations,(0,f.$d)(this.activeSessionsRow.subtitle,"Privacy.Devices",[this.authorizations.length])}))}updateActiveWebsites(e=this.managers.appSeamlessLoginManager.getWebAuthorizations()){return e.then((e=>{this.websitesRow.freezed=!1,this.websites=e,(0,f.$d)(this.websitesRow.subtitle,"Privacy.Websites",[this.websites.length]),this.websitesRow.container.classList.toggle("hide",!this.websites.length)}))}}var Ae=i(65),_e=i(9439),Fe=i(6761);var De=i(3731),Re=i(236),Be=i(6714),Ne=i(5994),Oe=i(7238),Ue=i(5418),He=i(8610);class ze extends E.Z{init(){this.container.classList.add("power-saving-container"),this.setTitle("LiteMode.Title");const e=document.createElement("form");let t;{const i=t=new b.Z({caption:"LiteMode.Info"});e.append(i.container)}const i=["all","video","gif",["stickers",["stickers_panel","stickers_chat"]],["effects",["effects_reactions","effects_premiumstickers","effects_emoji"]],["chat",["chat_background","chat_spoilers"]],"animations"];let s,a;{const o=new b.Z({}),r=e=>{const t=Array.isArray(e),i=t?e[0]:e,s=t?(0,Oe.Z)(e[1].map(r)):void 0,a=n.Z.settings.liteMode[i];return[{key:i,text:"all"===i?"LiteMode.EnableText":`LiteMode.Key.${i}.Title`,checked:"all"===i?a:!a,nested:s,name:"power-saving-"+i},...s||[]]};s=(0,Oe.Z)(i.map(r)),a=new He.Z({fields:s,listenerSetter:this.listenerSetter}),s.forEach(((e,i)=>{const s=a.createField(e);if(!s)return;const{row:n,nodes:r}=s;(0===i?t:o).content.append(...r)})),(0,v.fc)(o.content,(()=>{n.Z.settings.liteMode.all&&(0,te.bC)({langPackKey:"LiteMode.DisableAlert"})}),{listenerSetter:this.listenerSetter}),e.append(o.container)}const o=e=>{s.forEach((t=>{"all"!==t.key&&(t.nested&&a.setNestedCounter(t,e?0:void 0),t.checkboxField.input.classList.toggle("is-fake-disabled",e),t.row.toggleDisability(e))}))};this.listenerSetter.add(e)("change",(()=>{return e=this,t=void 0,a=function*(){const e={};s.forEach((t=>{const i=t.checkboxField.checked;e[t.key]="all"===t.key?i:!i}));const t=n.Z.settings.liteMode.all;t!==e.all&&(o(!t),e.all&&(yield(0,Ue.Z)(200))),yield this.managers.appStateManager.setByKey("settings.liteMode",n.Z.settings.liteMode=e)},new((i=void 0)||(i=Promise))((function(s,n){function o(e){try{d(a.next(e))}catch(e){n(e)}}function r(e){try{d(a.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((a=a.apply(e,t||[])).next())}));var e,t,i,a})),o(n.Z.settings.liteMode.all),this.scrollable.append(e)}}var je=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class Ge{constructor(e,t,i,s,n,a=!0){const o="range-setting-selector";this.container=document.createElement("div"),this.container.classList.add(o);const r=document.createElement("div");r.classList.add(o+"-details");const d=document.createElement("div");d.classList.add(o+"-name"),(0,f.$d)(d,e);const l=this.valueContainer=document.createElement("div");l.classList.add(o+"-value"),a&&(l.innerHTML=""+i),r.append(d,l),this.range=new Ae.Z({step:t,min:s,max:n},i),this.range.setListeners(),this.range.setHandlers({onScrub:e=>{this.onChange&&this.onChange(e),a&&(l.innerText=""+e)}}),this.container.append(r,this.range.container)}}class Ve extends E.h{static getInitArgs(){return{themes:n.Z.managers.appThemesManager.getThemes()}}init(e){this.container.classList.add("general-settings-container"),this.setTitle("General");const t=b.R.bind(null,this.scrollable),i=[];{const e=t("Settings"),i=new Ge("TextSize",1,n.Z.settings.messagesTextSize,12,20);i.onChange=e=>{n.Z.managers.appStateManager.setByKey("settings.messagesTextSize",e)};const s=(0,R.Z)("btn-primary btn-transparent",{icon:"image",text:"ChatBackground"}),a=_e.Z.getInitArgs();(0,v.fc)(s,(()=>{this.slider.createTab(_e.Z).open(a)}));const o=()=>n.Z.settings.liteMode.all?"Checkbox.Enabled":"Checkbox.Disabled",r=new f.ZP.IntlElement,d=()=>{r.compareAndUpdate({key:o()}),l.setValueSilently(Ne.Z.isAvailable("animations")),l.toggleDisability(Ne.Z.isEnabled())},l=new Le.Z({text:"EnableAnimations",name:"animations",stateKey:"settings.liteMode.animations",stateValueReverse:!0,checked:!1,listenerSetter:this.listenerSetter}),c=new P.ZP({checkboxField:l,clickable:()=>{l.isDisabled()&&(0,te.bC)({langPackKey:"LiteMode.DisableAlert"})},listenerSetter:this.listenerSetter}),h=new P.ZP({icon:"animations",titleLangKey:"LiteMode.EnableText",titleRightSecondary:r.element,clickable:()=>{this.slider.createTab(ze).open()},listenerSetter:this.listenerSetter});d(),this.listenerSetter.add(n.Z)("settings_updated",d),e.append(i.container,s,c.container,h.container)}{const s=t("ColorTheme"),a=new r.v7(null),o=a.container;o.classList.add("themes-container");const d=new Map;let l=Be.Z.getTheme(),c=Be.Z.isNight();const h=e=>{Be.Z.applyTheme(e.theme,e.container);const t=e.container.querySelector(".background-item");null==t||t.remove();const i=e.wallPaperContainers[c?"baseThemeNight":"baseThemeClassic"];i&&e.container.prepend(i)};let u;(0,v.fc)(o,(e=>je(this,void 0,void 0,(function*(){const t=(0,ue.Z)(e.target,"theme-container");if(!t)return;const i=o.querySelector(".active");i&&i.classList.remove("active");const s=d.get(t);if(t.classList.add("active"),yield Be.Z.applyNewTheme(s.theme),null==u||u(-1),s.player&&Ne.Z.isAvailable("animations"))if(j.IS_SAFARI)s.player.paused&&s.player.restart();else{s.player.paused&&s.player.stop(!0),s.player.el[0].style.transform="scale(2)";const e=u=t=>{s.player.maxFrame!==t&&-1!==t||(s.player.el[0].style.transform="",s.player.removeEventListener("enterFrame",e),u===e&&(u=void 0))};setTimeout((()=>{u===e&&(s.player.play(),s.player.addEventListener("enterFrame",e))}),250)}}))),{listenerSetter:this.listenerSetter});const p=new Set(["baseThemeClassic","baseThemeNight"]),f=e.themes.then((e=>je(this,void 0,void 0,(function*(){const t=e.filter((e=>e.pFlags.default));t.unshift(Re.t);const i=t.map((e=>je(this,void 0,void 0,(function*(){const t=document.createElement("div"),i={container:t,theme:e,wallPaperContainers:{}},s=e.settings.filter((e=>p.has(e.base_theme._))).map((e=>{const t=e.wallpaper,s=_e.Z.addWallPaper(t);return i.wallPaperContainers[e.base_theme._]=s.container,s}));d.set(t,i),h(i),e.id===l.id&&t.classList.add("active");const n=[];let a;if(e.emoticon){a=document.createElement("div"),a.classList.add("theme-emoticon");const t=49;(0,O.Z)({div:a,width:t,height:t,emoji:e.emoticon,managers:this.managers,loadPromises:n,middleware:this.middlewareHelper.get(),play:!1}).then((({render:e})=>e)).then((e=>{i.player=e}))}const o=document.createElement("div");o.classList.add("theme-bubble");const r=o.cloneNode();return r.classList.add("is-in"),o.classList.add("is-out"),n.push(...s.map((e=>e.loadPromise))),t.classList.add("theme-container"),yield Promise.all(n),a&&t.append(a),t.append(r,o),t})))),s=yield Promise.all(i);a.append(...s)}))));i.push(f);const m=document.createElement("form");m.style.marginTop=".5rem";const g="theme",b="settings.theme",y=new P.ZP({radioField:new x.Z({langKey:"ThemeDay",name:g,value:"day",stateKey:b})}),w=new P.ZP({radioField:new x.Z({langKey:"ThemeNight",name:g,value:"night",stateKey:b})}),S=new P.ZP({radioField:new x.Z({langKey:"AutoNightSystemDefault",name:g,value:"system",stateKey:b})});this.listenerSetter.add(n.Z)("settings_updated",(({key:e,value:t,settings:i})=>{e===b&&n.Z.dispatchEvent("theme_change")})),this.listenerSetter.add(n.Z)("theme_change",(()=>{l=Be.Z.getTheme();const e=Be.Z.isNight();if(c===e)return;c=e;const t=o.querySelector(".active");let i;t&&t.classList.remove("active"),d.forEach((e=>{h(e),e.theme.id===l.id&&(e.container.classList.add("active"),i=e.container)})),i&&a.scrollIntoViewNew({element:i,position:"center",axis:"x"})})),m.append(y.container,w.container,S.container),s.append(o,m)}{const e=t("General.Keyboard"),i=document.createElement("form"),s="send-shortcut",n="settings.sendShortcut",a=new P.ZP({radioField:new x.Z({langKey:"General.SendShortcut.Enter",name:s,value:"enter",stateKey:n}),subtitleLangKey:"General.SendShortcut.NewLine.ShiftEnter"}),o=new P.ZP({radioField:new x.Z({name:s,value:"ctrlEnter",stateKey:n}),subtitleLangKey:"General.SendShortcut.NewLine.Enter"});(0,f.$d)(o.radioField.main,"General.SendShortcut.CtrlEnter",[j.IS_APPLE?"⌘":"Ctrl"]),i.append(a.container,o.container),e.append(i)}if(De.Z){const e=t("DistanceUnitsTitle"),i=document.createElement("form"),s="distance-unit",n="settings.distanceUnit",a=new P.ZP({radioField:new x.Z({langKey:"DistanceUnitsKilometers",name:s,value:"kilometers",stateKey:n})}),o=new P.ZP({radioField:new x.Z({langKey:"DistanceUnitsMiles",name:s,value:"miles",stateKey:n})});i.append(a.container,o.container),e.append(i)}{const e=t("General.TimeFormat"),i=document.createElement("form"),s="time-format",n="settings.timeFormat",a=[["h12","General.TimeFormat.h12"],["h23","General.TimeFormat.h23"]],o=a.map((([e,t])=>new P.ZP({radioField:new x.Z({langKey:t,name:s,value:e,stateKey:n})}))),r=function(e,t=!0){return function(e,t,i=!0){const s=e;let n;return i||(e=Pe.Z),function i(){e(),n=Fe.Z.setTimeout(i,t())}(),e=s,()=>{clearTimeout(n)}}(e,(()=>1e3*(60-(new Date).getSeconds())),t)}((()=>{const e=new Date;a.forEach((([t],i)=>{const s=e.toLocaleTimeString("en-us-u-hc-"+t,{hour:"2-digit",minute:"2-digit"});o[i].subtitle.textContent=s}))}));this.eventListener.addEventListener("destroy",r),i.append(...o.map((e=>e.container))),e.append(i)}return Promise.all(i)}}var Ke=i(2010),We=i(1447),$e=i(534),qe=i(4484),Ye=i(1507),Qe=i(2914),Xe=i(2648),Je=i(1655),et=i(3186),tt=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class it extends l._{constructor(){super(...arguments),this.filtersRendered={}}static getInitArgs(){return{animationData:We.Z.loadAnimationFromURLManually("Folders_1"),filters:n.Z.managers.filtersStorage.getDialogFilters()}}renderFolder(e,t,i,s){return tt(this,void 0,void 0,(function*(){let n,a="";const o=[];if("dialogFilterSuggested"===e._)n=e.filter,a=e.description;else{if(n=e,1===Object.keys(n.pFlags).length){const e=n.pFlags;let t;e.contacts?t="FilterAllContacts":e.non_contacts?t="FilterAllNonContacts":e.groups?t="FilterAllGroups":e.broadcasts?t="FilterAllChannels":e.bots&&(t="FilterAllBots"),t&&o.push((0,f.ag)(t))}if(!o.length){const e=yield this.managers.dialogsStorage.getFolderDialogs(n.id);let t=0,i=0,s=0;yield Promise.all(e.map((e=>tt(this,void 0,void 0,(function*(){(yield this.managers.appPeersManager.isAnyGroup(e.peerId))?s++:(yield this.managers.appPeersManager.isBroadcast(e.peerId))?i++:t++}))))),t&&o.push((0,f.ag)("Chats",[t])),i&&o.push((0,f.ag)("Channels",[i])),s&&o.push((0,f.ag)("Groups",[s]))}}if(i)n.id!==Ye.J$&&(0,Z.Z)(i.title,(0,Q.Z)(n.title)),i.subtitle.textContent="",i.subtitle.append(...(0,f.v_)(o));else if(i=new P.ZP({title:n.id===Ye.J$?(0,f.ag)("FilterAllChats"):(0,Q.Z)(n.title),subtitle:a,clickable:!0,buttonRightLangKey:"dialogFilterSuggested"===e._?"Add":void 0}),o.length&&i.subtitle.append(...(0,f.v_)(o)),"dialogFilter"===e._){const e=n.id;if(!this.filtersRendered[n.id]&&n.id!==Ye.J$){const t=$e.Z.getInitArgs();(0,v.fc)(i.container,(()=>tt(this,void 0,void 0,(function*(){const i=yield this.managers.filtersStorage.getFilter(e),s=this.slider.createTab($e.Z);s.setInitFilter(i),s.open(t)}))),{listenerSetter:this.listenerSetter})}this.filtersRendered[n.id]=i,i.makeSortable()}const r=i.container;if(s){const e=n.localId;void 0!==e?(0,qe.Z)(r,r.parentElement||t,e):t&&t.append(r)}return i}))}init(e=it.getInitArgs()){this.container.classList.add("chat-folders-container"),this.setTitle("ChatList.Filter.List.Title"),this.scrollable.container.classList.add("chat-folders"),this.stickerContainer=document.createElement("div"),this.stickerContainer.classList.add("sticker-container");const t=document.createElement("div");t.classList.add("caption"),(0,f.XZ)({element:t,key:"ChatList.Filter.Header"}),this.createFolderBtn=(0,R.Z)("btn-primary btn-color-primary btn-control tgico",{text:"ChatList.Filter.NewTitle",icon:"add"}),this.foldersSection=new b.Z({name:"Filters"}),this.foldersSection.container.classList.add("hide"),this.list=document.createElement("div"),this.foldersSection.content.append(this.list),this.suggestedSection=new b.Z({name:"FilterRecommended"}),this.suggestedSection.container.classList.add("hide"),this.scrollable.append(this.stickerContainer,t,this.createFolderBtn,this.foldersSection.container,this.suggestedSection.container),(0,v.fc)(this.createFolderBtn,(()=>tt(this,void 0,void 0,(function*(){(yield this.canCreateFolder())?this.slider.createTab($e.Z).open():(0,et.Z)("folders")}))),{listenerSetter:this.listenerSetter});const i=()=>{this.foldersSection.container.classList.toggle("hide",!Object.keys(this.filtersRendered).length)},s=[],a=e.filters.then((e=>tt(this,void 0,void 0,(function*(){for(const t of e)t.id!==Ye.Zi&&(yield this.renderFolder(t,this.list,void 0,!0));this.toggleAllChats(),i()}))));return s.push(a),this.listenerSetter.add(n.Z)("filter_update",(e=>tt(this,void 0,void 0,(function*(){const t=this.filtersRendered[e.id];t?yield this.renderFolder(e,null,t):e.id!==Ye.Zi&&(yield this.renderFolder(e,this.list,void 0,!0)),i(),this.getSuggestedFilters()})))),this.listenerSetter.add(n.Z)("filter_delete",(e=>{const t=this.filtersRendered[e.id];t&&(this.getSuggestedFilters(),t.container.remove(),delete this.filtersRendered[e.id]),i()})),this.listenerSetter.add(n.Z)("filter_order",(e=>{e.filter((e=>!!this.filtersRendered[e])).forEach(((e,t)=>{const i=this.filtersRendered[e].container;(0,qe.Z)(i,i.parentElement,t+1)}))})),this.listenerSetter.add(n.Z)("premium_toggle",(()=>{this.toggleAllChats()})),this.loadAnimationPromise=e.animationData.then((e=>tt(this,void 0,void 0,(function*(){const t=yield e({container:this.stickerContainer,loop:!1,autoplay:!1,width:86,height:86});return this.animation=t,We.Z.waitForFirstFrame(t)})))),s.push(this.loadAnimationPromise),new Qe.Z({list:this.list,middleware:this.middlewareHelper.get(),onSort:(e,t)=>{let i=[];for(const e in this.filtersRendered){const t=this.filtersRendered[e];i[(0,Xe.Z)(t.container)]=+e}i=i.filter((e=>void 0!==e)),n.Z.premium||(0,Je.Z)(i,Ye.J$),this.managers.filtersStorage.updateDialogFiltersOrder(i)},scrollable:this.scrollable}),this.getSuggestedFilters(),Promise.all(s)}onOpenAfterTimeout(){return this.loadAnimationPromise.then((()=>{this.animation.autoplay=!0,this.animation.play()})),super.onOpenAfterTimeout()}toggleAllChats(){this.filtersRendered[Ye.J$].container.classList.toggle("hide",!n.Z.premium)}canCreateFolder(){return tt(this,void 0,void 0,(function*(){const[e,t]=yield Promise.all([this.managers.apiManager.getLimit("folders"),this.managers.filtersStorage.getDialogFilters()]);return t.filter((e=>!Ye.DZ.has(e.id))).lengthtt(this,void 0,void 0,(function*(){this.suggestedSection.container.classList.toggle("hide",!e.length),Array.from(this.suggestedSection.content.children).slice(1).forEach((e=>e.remove()));for(const t of e){const e=yield this.renderFolder(t);this.suggestedSection.content.append(e.container);const i=e.buttonRight;(0,v.fc)(i,(s=>tt(this,void 0,void 0,(function*(){if((0,W.Z)(s),!(yield this.canCreateFolder()))return void(0,et.Z)("folders");i.setAttribute("disabled","true");const n=t.filter;n.includePeerIds=[],n.excludePeerIds=[],n.pinnedPeerIds=[],this.managers.filtersStorage.createDialogFilter(n,!0).then((()=>{e.container.remove(),this.suggestedSection.container.classList.toggle("hide",1===this.suggestedSection.content.childElementCount)})).finally((()=>{i.removeAttribute("disabled")}))}))),{listenerSetter:this.listenerSetter})}}))))}}var st=i(8479),nt=i(3855),at=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class ot extends E.h{init(){this.container.classList.add("notifications-container"),this.setTitle("Telegram.NotificationSettingsViewController");const e=e=>{const t=new b.Z({name:e.name}),i=new P.ZP({checkboxField:new Le.Z({text:e.typeText,checked:!0}),subtitleLangKey:"Loading",listenerSetter:this.listenerSetter,withCheckboxSubtitle:!0}),s=new P.ZP({checkboxField:new Le.Z({text:"MessagePreview",checked:!0}),subtitleLangKey:"Loading",listenerSetter:this.listenerSetter,withCheckboxSubtitle:!0});t.content.append(i.container,s.container),this.scrollable.append(t.container);const a={_:e.inputKey},o=this.managers.appNotificationsManager.getNotifySettings(a);(o instanceof Promise?o:Promise.resolve(o)).then((t=>{const o=()=>at(this,void 0,void 0,(function*(){const e=yield this.managers.appNotificationsManager.isMuted(t);return i.checkboxField.checked=!e,s.checkboxField.checked=t.show_previews,e}));o(),this.eventListener.addEventListener("destroy",(()=>at(this,void 0,void 0,(function*(){const e=!i.checkboxField.checked,n=s.checkboxField.checked;if(e===(yield this.managers.appNotificationsManager.isMuted(t))&&n===t.show_previews)return;const o=(0,st.Z)(t);o._="inputPeerNotifySettings",o.mute_until=e?Ye.rU:0,o.show_previews=n,delete o.flags,this.managers.appNotificationsManager.updateNotifySettings(a,o)}))),{once:!0}),this.listenerSetter.add(n.Z)("notify_settings",(i=>{const s=Ie(i.peer._);e.inputKey===s&&(t=i.notify_settings,o())}))}))};e({name:"NotificationsPrivateChats",typeText:"NotificationsForPrivateChats",inputKey:"inputNotifyUsers"}),e({name:"NotificationsGroups",typeText:"NotificationsForGroups",inputKey:"inputNotifyChats"}),e({name:"NotificationsChannels",typeText:"NotificationsForChannels",inputKey:"inputNotifyBroadcasts"});{const e=new b.Z({name:"NotificationsOther"}),t=new P.ZP({checkboxField:new Le.Z({text:"ContactJoined",checked:!0}),subtitleLangKey:"Loading",listenerSetter:this.listenerSetter,withCheckboxSubtitle:!0}),i=new P.ZP({checkboxField:new Le.Z({text:"Notifications.Sound",checked:!0,stateKey:"settings.notifications.sound",listenerSetter:this.listenerSetter}),subtitleLangKey:"Loading",listenerSetter:this.listenerSetter,withCheckboxSubtitle:!0});nt.Z.getState().then((e=>{i.checkboxField.checked=e.settings.notifications.sound})),e.content.append(t.container,i.container),this.scrollable.append(e.container),this.managers.appNotificationsManager.getContactSignUpNotification().then((e=>{t.checkboxField.checked=e,this.eventListener.addEventListener("destroy",(()=>{const i=t.checkboxField.checked;e!==i&&this.managers.appNotificationsManager.setContactSignUpNotification(!i)}),{once:!0})}))}}}class rt extends l._{static getInitArgs(){return{languages1:n.Z.managers.apiManager.invokeApiCacheable("langpack.getLanguages",{lang_pack:"web"}),languages2:Promise.resolve([])}}init(e){this.header.classList.add("with-border"),this.container.classList.add("language-container"),this.setTitle("Telegram.LanguageViewController");const t=new b.Z({}),i=new Map,s=Promise.all([e.languages1,e.languages2]).then((([e,s])=>{const n=new Set,a=e.map((e=>e.lang_code)),o=(0,M.a)();e.concat(s).forEach((e=>{if(n.has(e.lang_code))return;n.add(e.lang_code);const t=new P.ZP({radioField:new x.Z({text:e.name,name:o,value:e.lang_code}),subtitle:e.native_name});i.set(e.lang_code,t)}));const r=(0,P.De)([...i.values()],(e=>{f.ZP.getLangPack(e,a.includes(e))}));f.ZP.getCacheLangPack().then((e=>{const t=i.get(e.lang_code);t?t.radioField.setValueSilently(!0):console.error("no row",t,e)})),t.content.append(r)}));return this.scrollable.append(t.container),s}}var dt=i(4081),lt=i(6848),ct=i(5701);function ht(e,t,i){const s=new b.Z({name:t}),n="settings.autoDownload."+e+".",a=new Le.Z({text:"AutodownloadContacts",name:"contacts",stateKey:n+"contacts",listenerSetter:i}),o=new Le.Z({text:"AutodownloadPrivateChats",name:"private",stateKey:n+"private",listenerSetter:i}),r=new Le.Z({text:"AutodownloadGroupChats",name:"groups",stateKey:n+"groups",listenerSetter:i}),d=new Le.Z({text:"AutodownloadChannels",name:"channels",stateKey:n+"channels",listenerSetter:i});return s.content.append((0,P.tG)(a).container,(0,P.tG)(o).container,(0,P.tG)(r).container,(0,P.tG)(d).container),s}class ut extends E.h{init(){this.setTitle("AutoDownloadPhotos");const e=ht("photo","AutoDownloadPhotosTitle",this.listenerSetter);this.scrollable.append(e.container)}}class pt extends E.h{init(){this.setTitle("AutoDownloadFiles");const e=(0,ct.Z)((e=>{this.managers.appStateManager.setByKey("settings.autoDownloadNew.file_size_max",e)}),200,!1,!0),t=ht("file","AutoDownloadFilesTitle",this.listenerSetter),i=524288,s=20447232,a=n.Z.settings.autoDownloadNew.file_size_max,o=Math.sqrt(Math.sqrt((a-i)/s)),r=new f.ZP.IntlElement({key:"AutodownloadSizeLimitUpTo",args:[(0,dt.Z)(a)]}),d=new Ge("AutoDownloadMaxFileSize",.01,o,0,1,!1);d.onChange=t=>{const n=Math.pow(t,4)*s+i|0;r.compareAndUpdate({args:[(0,dt.Z)(n)]}),e(n)},d.valueContainer.append(r.element),t.content.append(d.container),this.scrollable.append(t.container)}}class ft extends E.h{init(){this.setTitle("AutoDownloadVideos");const e=ht("video","AutoDownloadVideosTitle",this.listenerSetter);this.scrollable.append(e.container)}}const mt={contacts:"AutoDownloadContacts",private:"AutoDownloadPm",groups:"AutoDownloadGroups",channels:"AutoDownloadChannels"};class gt extends E.h{init(){this.setTitle("DataSettings");{const e=new b.Z({name:"AutomaticMediaDownload",caption:"AutoDownloadAudioInfo"}),t=new Le.Z({text:"AutoDownloadMedia",name:"auto",checked:!n.Z.settings.autoDownloadNew.pFlags.disabled,listenerSetter:this.listenerSetter}),i=new P.ZP({checkboxField:t,listenerSetter:this.listenerSetter}),s=()=>{(0,V.Z)([c],(0,lt.Z)(n.Z.settings.autoDownload,Re.h.settings.autoDownload)&&(0,lt.Z)(n.Z.settings.autoDownloadNew,Re.h.settings.autoDownloadNew))},a=()=>{this.setAutoDownloadSubtitle(r,n.Z.settings.autoDownload.photo),this.setAutoDownloadSubtitle(d,n.Z.settings.autoDownload.video),this.setAutoDownloadSubtitle(l,n.Z.settings.autoDownload.file,n.Z.settings.autoDownloadNew.file_size_max)},o=e=>{const t=this.slider.createTab(e);t.open(),this.listenerSetter.add(t.eventListener)("destroy",(()=>{a(),s()}),{once:!0})},r=new P.ZP({titleLangKey:"AutoDownloadPhotos",subtitle:"",clickable:()=>{o(ut)},listenerSetter:this.listenerSetter}),d=new P.ZP({titleLangKey:"AutoDownloadVideos",subtitle:"",clickable:()=>{o(ft)},listenerSetter:this.listenerSetter}),l=new P.ZP({titleLangKey:"AutoDownloadFiles",subtitle:"",clickable:()=>{o(pt)},listenerSetter:this.listenerSetter}),c=(0,R.Z)("btn-primary btn-transparent primary",{icon:"delete",text:"ResetAutomaticMediaDownload"});(0,v.fc)(c,(()=>{(0,Ee.Z)({titleLangKey:"ResetAutomaticMediaDownloadAlertTitle",descriptionLangKey:"ResetAutomaticMediaDownloadAlert",button:{langKey:"Reset"}}).then((()=>{const e=n.Z.settings;e.autoDownloadNew=(0,st.Z)(Re.h.settings.autoDownloadNew),e.autoDownload=(0,st.Z)(Re.h.settings.autoDownload),n.Z.settings=e,this.managers.appStateManager.setByKey("settings",e),a(),t.checked=!n.Z.settings.autoDownloadNew.pFlags.disabled}))}));const h=()=>{const e=!t.checked,i=n.Z.settings.autoDownloadNew;e?i.pFlags.disabled=!0:delete i.pFlags.disabled,[r,d,l].forEach((t=>{t.container.classList.toggle("is-disabled",e)})),this.managers.appStateManager.setByKey("settings.autoDownloadNew",i),s()};t.input.addEventListener("change",h),h(),a(),e.content.append(i.container,r.container,d.container,l.container,c),this.scrollable.append(e.container)}}setAutoDownloadSubtitle(e,t,i){let s;const n=[],a=Object.keys(t),o=a.map((e=>t[e]?mt[e]:void 0)).filter(Boolean);if(o.length&&0!==i){const e=o.length===a.length;if(void 0!==i?(s=e?"AutoDownloadUpToOnAllChats":"AutoDownloadOnUpToFor",n.push((0,dt.Z)(i))):s=e?"AutoDownloadOnAllChats":"AutoDownloadOnFor",!e){const e=document.createElement("span");e.append(...(0,f.v_)(o.map((e=>(0,f.ag)(e))),!0,!1)),n.push(e)}}else s="AutoDownloadOff";(0,Z.Z)(e.subtitle,(0,f.ag)(s,n))}}var vt=i(2230),bt=i(8261),yt=i(6765),wt=i(8938),St=i(4531),Ct=i(2153),Lt=i(9298),It=i(1273),Et=i(62);class Pt extends E.Z{init(){return this.setTitle("DoubleTapSetting"),this.container.classList.add("quick-reaction-container"),Promise.all([this.managers.appReactionsManager.getQuickReaction(),this.managers.appReactionsManager.getAvailableReactions()]).then((([e,t])=>{t=t.filter((e=>!e.pFlags.inactive));const i=new b.Z,s=t.map((t=>{const i=new x.Z({name:"quick-reaction",text:t.title,value:t.reaction,alignRight:!0}),s=new P.ZP({radioField:i,havePadding:!0});return i.main.classList.add("quick-reaction-title"),(0,Et.Z)({row:s,doc:t.static_icon,size:"small"}),t.reaction===e.reaction&&i.setValueSilently(!0),s})),n=(0,P.De)(s,(e=>{this.managers.appReactionsManager.setDefaultReaction({_:"reactionEmoji",emoticon:e})}));i.content.append(n),this.scrollable.append(i.container)}))}}class Zt extends E.Z{static getInitArgs(){return{allStickers:n.Z.managers.appStickersManager.getAllStickers(),quickReaction:n.Z.managers.appReactionsManager.getQuickReaction()}}init(e){this.container.classList.add("stickers-emoji-container"),this.setTitle("StickersName");const t=[];{const t=new b.Z({caption:"LoopAnimatedStickersInfo"}),i=new P.ZP({icon:"lamp",titleLangKey:"Stickers.SuggestStickers",clickable:!0,listenerSetter:this.listenerSetter,titleRightSecondary:!0}),s={all:"SuggestStickersAll",installed:"SuggestStickersInstalled",none:"SuggestStickersNone"},a=()=>{i.titleRight.replaceChildren((0,f.ag)(s[n.Z.settings.stickers.suggest]))};a();const o=e=>{if(n.Z.settings.stickers.suggest!==e)return n.Z.settings.stickers.suggest=e,a(),this.managers.appStateManager.setByKey("settings.stickers.suggest",e)};(0,St.Z)({buttons:[{icon:"stickers_face",text:"SuggestStickersAll",onClick:o.bind(this,"all")},{icon:"newprivate",text:"SuggestStickersInstalled",onClick:o.bind(this,"installed")},{icon:"stop",text:"SuggestStickersNone",onClick:o.bind(this,"none")}],listenTo:i.container,middleware:this.middlewareHelper.get(),listenForClick:!0});const r=new P.ZP({titleLangKey:"DoubleTapSetting",havePadding:!0,clickable:()=>{this.slider.createTab(Pt).open()},listenerSetter:this.listenerSetter}),d=()=>{e.quickReaction.then((e=>"availableReaction"===e._?e.static_icon:this.managers.appEmojiManager.getCustomEmojiDocument(e.document_id))).then((e=>{(0,Et.Z)({row:r,doc:e,size:"small"})}))};d(),this.listenerSetter.add(n.Z)("quick_reaction",(()=>{e=Zt.getInitArgs(),d()}));const l=new P.ZP({icon:"flip",titleLangKey:"InstalledStickers.LoopAnimated",checkboxField:new Le.Z({name:"loop",stateKey:"settings.stickers.loop",listenerSetter:this.listenerSetter,toggle:!0}),listenerSetter:this.listenerSetter});t.content.append(r.container,i.container,l.container),this.scrollable.append(t.container)}{const e=new b.Z({name:"Emoji"}),t=new P.ZP({icon:"lamp",titleLangKey:"GeneralSettings.EmojiPrediction",checkboxField:new Le.Z({name:"suggest-emoji",stateKey:"settings.emoji.suggest",listenerSetter:this.listenerSetter,toggle:!0}),listenerSetter:this.listenerSetter}),i=new P.ZP({icon:"smile",titleLangKey:"GeneralSettings.BigEmoji",checkboxField:new Le.Z({name:"emoji-big",stateKey:"settings.emoji.big",listenerSetter:this.listenerSetter,toggle:!0}),listenerSetter:this.listenerSetter});e.content.append(t.container,i.container),this.scrollable.append(e.container)}{const e=new b.Z({name:"DynamicPackOrder",caption:"DynamicPackOrderInfo"}),t=new P.ZP({titleLangKey:"DynamicPackOrder",checkboxField:new Le.Z({name:"dynamic-pack-order",stateKey:"settings.stickers.dynamicPackOrder",listenerSetter:this.listenerSetter,toggle:!0}),listenerSetter:this.listenerSetter});e.content.append(t.container),this.scrollable.append(e.container)}{const i=new b.Z({name:"Telegram.InstalledStickerPacksController",caption:"StickersBotInfo"}),s={},a=i.generateContentElement(),o=new Ct.Z,r=(e,t="append")=>{const i=new P.ZP({title:(0,Q.Z)(e.title),subtitleLangKey:"Stickers",subtitleLangArgs:[e.count],havePadding:!0,clickable:()=>{B.Z.createPopup(Lt.Z,{id:e.id,access_hash:e.access_hash}).show()},listenerSetter:this.listenerSetter});i.container.dataset.id=""+e.id,i.makeSortable(),s[e.id]=i;const n=document.createElement("div");n.classList.add("row-media"),(0,It.Z)({set:e,container:n,group:"GENERAL-SETTINGS",lazyLoadQueue:o,width:36,height:36,autoplay:!0,middleware:this.middlewareHelper.get()}),i.container.append(n),a[t](i.container)},d=e.allStickers.then((e=>{(0,wt.Z)(e);const t=e.sets.map((e=>r(e)));return Promise.all(t)}));t.push(d),this.listenerSetter.add(n.Z)("stickers_installed",(e=>{s[e.id]||r(e,"prepend")})),this.listenerSetter.add(n.Z)("stickers_deleted",(e=>{s[e.id]&&(s[e.id].container.remove(),delete s[e.id])})),this.listenerSetter.add(n.Z)("stickers_order",(({type:e,order:t})=>{"stickers"===e&&t.forEach(((e,t)=>{const i=s[e];i&&(0,qe.Z)(i.container,a,t)}))})),this.listenerSetter.add(n.Z)("stickers_top",(e=>{const t=s[e];t&&(0,qe.Z)(t.container,a,0)})),new Qe.Z({list:a,middleware:this.middlewareHelper.get(),onSort:(e,t)=>{const i=Array.from(a.children).map((e=>e.dataset.id));this.managers.appStickersManager.reorderStickerSets(i)}}),this.scrollable.append(i.container)}return Promise.all(t)}}var Mt=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class Tt extends l._{constructor(){super(...arguments),this.buttons={}}init(){return Mt(this,void 0,void 0,(function*(){this.container.classList.add("settings-container"),this.setTitle("Settings");const e=(0,I.Z)({listenerSetter:this.listenerSetter,direction:"bottom-left",buttons:[{icon:"logout",text:"EditAccount.Logout",onClick:()=>{B.Z.createPopup(N.Z,"logout",{titleLangKey:"LogOut",descriptionLangKey:"LogOut.Description",buttons:[{langKey:"LogOut",callback:()=>{this.managers.apiManager.logOut()},isDanger:!0}]}).show()}}]});this.buttons.edit=(0,vt.Z)("edit"),this.header.append(this.buttons.edit,e),this.profile=new bt.Z(this.managers,this.scrollable,this.listenerSetter,!1),this.profile.init(),this.profile.setPeer(n.Z.myId);const t=this.profile.fillProfileElements(),i=(0,m.Z)({icon:"cameraadd",className:"profile-change-avatar"});(0,v.fc)(i,(()=>{const e=document.createElement("canvas");B.Z.createPopup(yt.Z).open(e,(e=>{e().then((e=>this.managers.appProfileManager.uploadProfilePhoto(e)))}))}),{listenerSetter:this.listenerSetter}),this.profile.element.lastElementChild.firstElementChild.append(i);const s=()=>Mt(this,void 0,void 0,(function*(){var e;const t=yield this.managers.appUsersManager.getSelf();i.classList.toggle("hide","userProfilePhoto"!==(null===(e=t.photo)||void 0===e?void 0:e._))}));s(),this.listenerSetter.add(n.Z)("avatar_update",(({peerId:e})=>{n.Z.myId===e&&s()}));const a=document.createElement("div");a.classList.add("profile-buttons");const o=(e,t,i,s)=>{if(!s){const e=i.getInitArgs;e&&(s=()=>[e(this)])}return{icon:e,text:t,tabConstructor:i,getInitArgs:s,args:null==s?void 0:s()}},r=[o("unmute","AccountSettings.Notifications",ot),o("data","DataSettings",gt),o("lock","AccountSettings.PrivacyAndSecurity",xe),o("settings","Telegram.GeneralSettingsViewController",Ve),o("folder","AccountSettings.Filters",it),o("stickers_face","StickersName",Zt)].map((e=>{const{icon:t,text:i,tabConstructor:s,getInitArgs:n}=e;return new P.ZP({titleLangKey:i,icon:t,clickable:()=>Mt(this,void 0,void 0,(function*(){const t=e.args?yield e.args:[],i=this.slider.createTab(s);i.open(...t),i instanceof E.h&&n&&i.eventListener.addEventListener("destroyAfter",(t=>{e.args=t.then((()=>n()))}))})),listenerSetter:this.listenerSetter})})),d=rt.getInitArgs();r.push(this.devicesRow=new P.ZP({titleLangKey:"Devices",titleRightSecondary:" ",icon:"activesessions",clickable:()=>Mt(this,void 0,void 0,(function*(){this.authorizations||(yield this.updateActiveSessions());const e=this.slider.createTab(ve);e.authorizations=this.authorizations,e.eventListener.addEventListener("destroy",(()=>{this.authorizations=void 0,this.updateActiveSessions(!0)}),{once:!0}),e.open()})),listenerSetter:this.listenerSetter}),this.languageRow=new P.ZP({titleLangKey:"AccountSettings.Language",titleRightSecondary:(0,f.ag)("LanguageName"),icon:"language",clickable:()=>{this.slider.createTab(rt).open(d)},listenerSetter:this.listenerSetter})),a.append(...r.map((e=>e.container)));const l=new b.Z;l.content.append(a),this.scrollable.append(this.profile.element,l.container);const c=()=>{h=Ke.Z.getInitArgs()};let h;(0,v.fc)(this.buttons.edit,(()=>{this.slider.createTab(Ke.Z).open(h)}),{listenerSetter:this.listenerSetter}),c(),this.listenerSetter.add(n.Z)("user_update",(e=>{n.Z.myId.toUserId()===e&&c()})),We.Z.loadLottieWorkers(),this.updateActiveSessions(),(yield t)()}))}getAuthorizations(e){if(this.getAuthorizationsPromise&&!e)return this.getAuthorizationsPromise;const t=this.getAuthorizationsPromise=this.managers.apiManager.invokeApi("account.getAuthorizations").finally((()=>{this.getAuthorizationsPromise===t&&(this.getAuthorizationsPromise=void 0)}));return t}updateActiveSessions(e){return this.getAuthorizations(e).then((e=>{this.authorizations=e.authorizations,this.devicesRow.titleRight.textContent=""+this.authorizations.length}))}onCloseAfterTimeout(){return this.profile.destroy(),super.onCloseAfterTimeout()}}class kt extends l._{constructor(){super(...arguments),this.uploadAvatar=null}init(){this.container.classList.add("new-channel-container"),this.setTitle("NewChannel"),this.avatarEdit=new p.Z((e=>{this.uploadAvatar=e}));const e=new b.Z({caption:"Channel.DescriptionHolderDescrpiton"}),t=document.createElement("div");t.classList.add("input-wrapper"),this.channelNameInputField=new u.ZP({label:"EnterChannelName",maxLength:128}),this.channelDescriptionInputField=new u.ZP({label:"DescriptionOptionalPlaceholder",maxLength:255}),t.append(this.channelNameInputField.container,this.channelDescriptionInputField.container);const i=()=>{this.nextBtn.classList.toggle("is-visible",!!this.channelNameInputField.value.length&&!this.channelNameInputField.input.classList.contains("error")&&!this.channelDescriptionInputField.input.classList.contains("error"))};this.channelNameInputField.input.addEventListener("input",i),this.channelDescriptionInputField.input.addEventListener("input",i),this.nextBtn=(0,m.Z)({icon:"arrow_next"}),(0,v.fc)(this.nextBtn,(()=>{const e=this.channelNameInputField.value,t=this.channelDescriptionInputField.value;this.nextBtn.disabled=!0,this.managers.appChatsManager.createChannel({title:e,about:t,broadcast:!0}).then((e=>{this.uploadAvatar&&this.uploadAvatar().then((t=>{this.managers.appChatsManager.editPhoto(e,t)})),s.ZP.setInnerPeer({peerId:e.toPeerId(!0)}),ei.removeTabFromHistory(this),this.slider.createTab(A.Z).open({type:"channel",skippable:!0,title:"GroupAddMembers",placeholder:"SendMessageTo",takeOut:t=>this.managers.appChatsManager.inviteToChannel(e,t)})}))}),{listenerSetter:this.listenerSetter}),this.content.append(this.nextBtn),e.content.append(this.avatarEdit.container,t),this.scrollable.append(e.container)}onCloseAfterTimeout(){return this.avatarEdit.clear(),this.uploadAvatar=null,this.channelNameInputField.value="",this.channelDescriptionInputField.value="",this.nextBtn.disabled=!1,super.onCloseAfterTimeout()}}var xt=i(241),At=i(2621),_t=i(709),Ft=i(6272);class Dt extends B.Z{constructor(){super("popup-create-contact popup-send-photo popup-new-media",{closable:!0,withConfirm:"Add",title:"AddContactTitle"}),this.construct()}construct(){return e=this,t=void 0,s=function*(){(0,v.fc)(this.btnConfirm,(()=>{const e=this.managers.appUsersManager.importContact(i.value,s.value,n.value);e.then((()=>{this.hide()}),(e=>{"NO_USER"===e.type&&((0,te.bC)({langPackKey:"Contacts.PhoneNumber.NotRegistred"}),d.disabled=!1)})),d.lockWithPromise(e)}),{listenerSetter:this.listenerSetter});const e=[],t=document.createElement("div");t.classList.add("name-fields");const i=new u.ZP({label:"FirstName",name:"create-contact-name",maxLength:70,required:!0}),s=new u.ZP({label:"LastName",name:"create-contact-lastname",maxLength:70}),n=new _t.Z({required:!0});e.push(i,s,n);const a=()=>{const e=i.value+" "+s.value;d.avatarElem.peerTitle=e,d.avatarElem.update()};this.listenerSetter.add(i.input)("input",a),this.listenerSetter.add(s.input)("input",a),n.validate=()=>!!n.value.match(/\d/);const o=yield this.managers.appUsersManager.getSelf(),r=(0,Ft.u)(o.phone);r.code&&(n.value="+"+r.code.country_code);const d=new At.Z({inputFields:e,listenerSetter:this.listenerSetter,doNotEditAvatar:!0,nextBtn:this.btnConfirm,avatarSize:100});t.append(i.container,s.container,d.avatarElem),this.container.append(t,n.container),this.show()},new((i=void 0)||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}));var e,t,i,s}}var Rt=i(2894),Bt=i(3624);class Nt extends l._{init(){this.container.id="contacts-container";const e=(0,m.Z)({icon:"add",className:"is-visible"});this.content.append(e),(0,v.fc)(e,(()=>{B.Z.createPopup(Dt)}),{listenerSetter:this.listenerSetter}),this.inputSearch=new d.Z("Search",(e=>{this.openContacts(e)})),this.listenerSetter.add(n.Z)("contacts_update",(e=>{return t=this,i=void 0,n=function*(){const t=yield this.managers.appUsersManager.isContact(e),i=e.toPeerId();t?this.sortedUserList.add(i):this.sortedUserList.delete(i)},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n})),this.title.replaceWith(this.inputSearch.container),this.middleware=(0,Bt.k)(),this.openContacts()}createList(){const e=new Rt.Z({managers:this.managers}),t=e.list;return t.id="contacts",t.classList.add("contacts-container"),h.default.setListClickListener(t,(()=>{this.close()}),void 0,!0),e}onClose(){this.middleware.clean()}onOpenAfterTimeout(){!j.IS_MOBILE&&G(!0)&&this.inputSearch.input.focus()}openContacts(e){this.middleware.clean();const t=this.middleware.get();this.scrollable.onScrolledBottom=null,this.scrollable.container.textContent="",this.managers.appUsersManager.getContactsPeerIds(e,void 0,"online").then((e=>{if(!t())return;const i=this.sortedUserList=this.createList();let s=()=>{const t=xt.Z.height/56*1.25|0;e.splice(0,t).forEach((e=>{i.add(e)})),e.length||(s=void 0,this.scrollable.onScrolledBottom=null)};s(),this.scrollable.onScrolledBottom=()=>{s?s():this.scrollable.onScrolledBottom=null},(0,Z.Z)(this.scrollable.container,i.list)}))}}class Ot extends l._{init(){if(this.wasFilterId=h.default.filterId,this.container.id="chats-archived-container",this.setTitle("ArchivedChats"),this.header.classList.add("can-have-forum"),this.content.classList.add("can-have-forum"),!h.default.xds[Ot.filterId]){const{ul:e,scrollable:t}=h.default.l({title:void 0,id:Ot.filterId,localId:Ye.Zi});t.container.append(e)}const e=h.default.xds[Ot.filterId].scrollable;return this.scrollable.container.replaceWith(e.container),e.attachBorderListeners(this.container),h.default.setFilterIdAndChangeTab(Ot.filterId).then((({cached:e,renderPromise:t})=>{if(e)return t}))}onOpenAfterTimeout(){h.default.xds[this.wasFilterId].clear()}onClose(){this.scrollable.onAdditionalScroll=void 0,h.default.setFilterIdAndChangeTab(this.wasFilterId)}onCloseAfterTimeout(){return h.default.xds[Ot.filterId].clear(),super.onCloseAfterTimeout()}}Ot.filterId=Ye.Zi;class Ut extends l._{constructor(){super(...arguments),this.isLocationWatched=!1}parseDistance(e){return"miles"===n.Z.settings.distanceUnit?e>1609.34?(0,f.ag)("MilesAway",[Math.round(e/1609)]):(0,f.ag)("FootsAway",[Math.round(3.281*e)]):e>=1e3?(0,f.ag)("KMetersAway2",[e/1e3]):(0,f.ag)("MetersAway2",[e])}startWatching(){this.latestLocationSaved&&!this.isLocationWatched&&(this.isLocationWatched=!0,(0,te.Am)("Your position is now being shared. Do not close the page or it will be suspended."),this.managers.appUsersManager.getLocated(this.latestLocationSaved.latitude,this.latestLocationSaved.longitude,this.latestLocationSaved.accuracy,!0,2147483647),navigator.geolocation.watchPosition((e=>{const t=e.coords.longitude!==this.latestLocationSaved.longitude,i=e.coords.latitude!==this.latestLocationSaved.latitude,s=this.calculateDistance(e.coords.latitude,e.coords.longitude,this.latestLocationSaved.latitude,this.latestLocationSaved.longitude)>100;(i||t)&&s&&(this.managers.appUsersManager.getLocated(e.coords.latitude,e.coords.longitude,e.coords.accuracy,!0,2147483647),this.latestLocationSaved={latitude:e.coords.latitude,longitude:e.coords.longitude,accuracy:e.coords.accuracy})})))}stopWatching(){this.isLocationWatched&&(this.isLocationWatched=!1,(0,te.Am)("The sharing of your position has been stopped. You will no longer be visible to other users."),this.managers.appUsersManager.getLocated(0,0,0,!1,0))}calculateDistance(e,t,i,s){const n=.017453292519943295;return 12742*Math.asin(Math.sqrt(.5-Math.cos((i-e)*n)+Math.cos(e*n)*Math.cos(i*n)*(1-Math.cos((s-t)*n)/2)))}}var Ht=i(5824),zt=i(8842),jt=i(4159),Gt=i(7487),Vt=i(1405),Kt=i(2559),Wt=i(4755),$t=i(3035),qt=i(6472),Yt=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const Qt="is-left-column-shown";class Xt extends l.Z{constructor(){super({sidebarEl:document.getElementById("column-left"),navigationType:"left"}),this.searchGroups={}}construct(e){this.managers=e,this.inputSearch=new d.Z("Search");const t=this.sidebarEl.querySelector(".item-main .sidebar-header");t.append(this.inputSearch.container);const i=()=>{this.createTab(Nt).open()};this.backBtn=this.sidebarEl.querySelector(".sidebar-back-button");const a={icon:"archive",text:"ArchivedChats",onClick:()=>{this.createTab(Ot).open()},verify:()=>Yt(this,void 0,void 0,(function*(){return!!(yield this.managers.dialogsStorage.getFolderDialogs(Ye.Zi,!1)).length||!(yield this.managers.dialogsStorage.isDialogsLoaded(Ye.Zi))}))},o=new Le.Z({toggle:!0,checked:"night"===Be.Z.getTheme().name});o.input.addEventListener("change",(()=>Yt(this,void 0,void 0,(function*(){Be.Z.switchTheme(o.input.checked?"night":"day")})))),n.Z.addEventListener("theme_change",(()=>{o.setValueSilently("night"===Be.Z.getTheme().name)}));const r=[{icon:"savedmessages",text:"SavedMessages",onClick:()=>{setTimeout((()=>{s.ZP.setPeer({peerId:s.ZP.myId})}),0)}},a,{icon:"user",text:"Contacts",onClick:i},De.Z?{icon:"group",text:"PeopleNearby",onClick:()=>{this.createTab(Ut).open()}}:void 0,{icon:"settings",text:"Settings",onClick:()=>{this.createTab(Tt).open()}},{icon:"darkmode",text:"DarkMode",onClick:()=>{},checkboxField:o},{icon:"animations",text:"Animations",onClick:()=>{},checkboxField:new Le.Z({toggle:!0,checked:!0,stateKey:"settings.liteMode.animations",stateValueReverse:!0}),verify:()=>!Ne.Z.isEnabled()},{icon:"animations",text:"LiteMode.Title",onClick:()=>{this.createTab(ze).open()},verify:()=>Ne.Z.isEnabled()},{icon:"help",text:"TelegramFeatures",onClick:()=>{const e=f.ZP.format("TelegramFeaturesUrl",!0);s.ZP.openUrl(e)}},{icon:"bug",text:"ReportBug",onClick:()=>{const e=document.createElement("a");e.target="_blank",e.href="https://bugs.telegram.org/?tag_ids=40&sort=time",document.body.append(e),e.click(),setTimeout((()=>{e.remove()}),0)}},{icon:"char z",text:"ChatList.Menu.SwitchTo.Z",onClick:()=>{Promise.all([Gt.Z.set({kz_version:"Z"}),Gt.Z.delete("tgme_sync")]).then((()=>{location.href="https://web.telegram.org/z/"}))},verify:()=>jt.Z.isMainDomain},{icon:"download",text:"PWA.Install",onClick:()=>{const e=(0,qt.B)();null==e||e()},verify:()=>!!(0,qt.B)()}].filter(Boolean);this.toolsBtn=(0,I.Z)({direction:"bottom-right",buttons:r,onOpen:(e,t)=>{var i;const s=document.createElement("a");s.href="https://github.com/morethanwords/tweb/blob/master/CHANGELOG.md",s.target="_blank",s.rel="noopener noreferrer",s.classList.add("btn-menu-footer"),s.addEventListener(v.pf,(e=>{e.stopPropagation(),ge.Z.close()}));const n=document.createElement("span");n.classList.add("btn-menu-footer-text"),n.innerHTML="Telegram Web"+jt.Z.suffix+" "+jt.Z.versionFull,s.append(n),t.classList.add("has-footer"),t.append(s),null===(i=a.element)||void 0===i||i.append(this.archivedCount)}}),this.toolsBtn.classList.remove("tgico-more"),this.toolsBtn.classList.add("sidebar-tools-button","is-visible"),this.backBtn.parentElement.insertBefore(this.toolsBtn,this.backBtn),this.newBtnMenu=(0,I.Z)({direction:"top-left",buttons:[{icon:"newchannel",text:"NewChannel",onClick:()=>{this.createTab(kt).open()}},{icon:"newgroup",text:"NewGroup",onClick:()=>{this.createTab(A.Z).open({type:"chat",skippable:!0,takeOut:e=>this.createTab(y).open(e),title:"GroupAddMembers",placeholder:"SendMessageTo"})}},{icon:"newprivate",text:"NewPrivateChat",onClick:i}]}),this.newBtnMenu.className="btn-circle rp btn-corner z-depth-1 btn-menu-toggle animated-button-icon",this.newBtnMenu.tabIndex=-1,this.newBtnMenu.insertAdjacentHTML("afterbegin",'\n \n \n '),this.newBtnMenu.id="new-menu",t.nextElementSibling.append(this.newBtnMenu),this.updateBtn=document.createElement("div"),this.updateBtn.className="btn-circle rp btn-corner z-depth-1 btn-update is-hidden",this.updateBtn.tabIndex=-1,(0,Vt.Z)(this.updateBtn),this.updateBtn.append((0,f.ag)("Update")),(0,v.fc)(this.updateBtn,(()=>{this.updateBtn.classList.contains("is-hidden")||location.reload()})),t.nextElementSibling.append(this.updateBtn),this.inputSearch.input.addEventListener("focus",(()=>this.initSearch()),{once:!0}),this.archivedCount=document.createElement("span"),this.archivedCount.className="archived-count badge badge-24 badge-gray",n.Z.addEventListener("folder_unread",(e=>{if(e.id===Ye.Zi){const t=e.unreadPeerIds.size;this.archivedCount.textContent=""+(0,Kt.Z)(t,1),this.archivedCount.classList.toggle("hide",!t)}})),this.managers.appUsersManager.getTopPeers("correspondents");const l={type:"global-search-focus",onPop:()=>(setTimeout((()=>{this.inputSearch.input.focus()}),0),!1),noHistory:!0};Ht.Z.pushItem(l),nt.Z.getState().then((()=>{const e=setInterval((()=>{fetch("version",{cache:"no-cache"}).then((e=>200===e.status&&e.ok&&e.text()||Promise.reject())).then((t=>{t!==jt.Z.versionFull&&(this.hasUpdate=!0,clearInterval(e),this.newBtnMenu.classList.contains("is-hidden")||this.updateBtn.classList.remove("is-hidden"))})).catch(Pe.Z)}),18e5)}));const c=()=>{const e=this.rect=this.tabsContainer.getBoundingClientRect();document.documentElement.style.setProperty("--left-column-width",e.width+"px")};(0,$t.T2)(c),Wt.Z.addEventListener("resize",c)}initSearch(){const e=this.sidebarEl.querySelector("#search-container"),t=new r.ZP(e),i=()=>{(0,v.tH)(this.backBtn)};this.searchGroups={contacts:new a.z("SearchAllChatsShort","contacts",void 0,void 0,void 0,void 0,i),globalContacts:new a.z("GlobalSearch","contacts",void 0,void 0,void 0,void 0,i),messages:new a.z("SearchMessages","messages"),people:new a.z(!1,"contacts",!0,"search-group-people",!0,!1,i,!0),recent:new a.z("Recent","contacts",!0,"search-group-recent",!0,!0,i)};const s=this.searchSuper=new S.Z({mediaTabs:[{inputFilter:"inputMessagesFilterEmpty",name:"FilterChats",type:"chats"},{inputFilter:"inputMessagesFilterPhotoVideo",name:"SharedMediaTab2",type:"media"},{inputFilter:"inputMessagesFilterUrl",name:"SharedLinksTab2",type:"links"},{inputFilter:"inputMessagesFilterDocument",name:"SharedFilesTab2",type:"files"},{inputFilter:"inputMessagesFilterMusic",name:"SharedMusicTab2",type:"music"},{inputFilter:"inputMessagesFilterRoundVoice",name:"SharedVoiceTab2",type:"voice"}],scrollable:t,searchGroups:this.searchGroups,asChatList:!0,hideEmptyTabs:!1,showSender:!0,managers:this.managers});e.prepend(s.nav.parentElement.parentElement),t.container.append(s.container),s.setQuery({peerId:"".toPeerId(),folderId:0}),s.selectTab(0),s.load(!0);const n=[];let d="".toPeerId(),l=0,u=0;const p=()=>{this.inputSearch.container.classList.toggle("is-picked-twice",2===n.length),this.inputSearch.container.classList.toggle("is-picked",!!n.length),n.length?this.inputSearch.input.style.setProperty("--paddingLeft",n[n.length-1].getBoundingClientRect().right-this.inputSearch.input.getBoundingClientRect().left+"px"):this.inputSearch.input.style.removeProperty("--paddingLeft")},f=document.createElement("div");f.classList.add("search-helper"),f.addEventListener("click",(e=>{const t=(0,ue.Z)(e.target,"selector-user");if(!t)return;const i=t.dataset.key;if(0===i.indexOf("date_")){const[e,t,s]=i.split("_");l=+t,u=+s}else d=i.toPeerId();t.addEventListener("click",(()=>{g(t)})),this.inputSearch.container.append(t),this.inputSearch.onChange(this.inputSearch.value=""),n.push(t),p()})),s.nav.parentElement.append(f);const m=(e,t)=>{const i=document.createElement("div");i.classList.add("selector-user");const s=new o.Z;return s.classList.add("selector-user-avatar","tgico","avatar-32"),s.isDialog=!0,i.dataset.key=""+e,e.isPeerId()?(void 0===t&&(t=new zt.Z({peerId:e.toPeerId()}).element),s.updateWithOptions({peerId:e})):s.classList.add("tgico-calendarfilter"),t&&("string"==typeof t?i.innerHTML=t:((0,Z.Z)(i,t),i.append(t))),i.insertAdjacentElement("afterbegin",s),i},g=e=>{0===e.dataset.key.indexOf("date_")?l=u=0:d="".toPeerId(),e.remove(),(0,Je.Z)(n,e),setTimeout((()=>{p(),this.inputSearch.onChange(this.inputSearch.value)}),0)};this.inputSearch.onClear=()=>{n.forEach((e=>{g(e)}))},this.inputSearch.onChange=e=>{if(s.cleanupHTML(),s.setQuery({peerId:d,folderId:d?void 0:0,query:e,minDate:l,maxDate:u}),s.load(!0),f.innerHTML="",s.nav.classList.remove("hide"),!d&&e.trim()){const t=s.middleware.get();Promise.all([this.managers.dialogsStorage.getDialogs({query:e}).then((({dialogs:e})=>e.map((e=>e.peerId)))),this.managers.appUsersManager.getContactsPeerIds(e,!0)]).then((e=>{t()&&(new Set(e[0].concat(e[1])).forEach((e=>{f.append(m(e))})),s.nav.classList.toggle("hide",!!f.innerHTML))}))}if(!l&&e.trim()){const t=[];(0,C.fl)(e,t),t.forEach((e=>{f.append(m("date_"+e.minDate+"_"+e.maxDate,e.title))})),s.nav.classList.toggle("hide",!!f.innerHTML)}},s.tabs.inputMessagesFilterEmpty.addEventListener("mousedown",(e=>{const t=(0,ye.Z)(e.target,h.DIALOG_LIST_ELEMENT_TAG);if(!t)return;const i=(0,ue.Z)(t,"search-group");if(!i||i.classList.contains("search-group-recent")||i.classList.contains("search-group-people"))return;const s=t.getAttribute("data-peer-id").toPeerId();this.managers.appUsersManager.pushRecentSearch(s)}),{capture:!0});const b=document.createElement("div");b.classList.add("search-group-scrollable"),b.append(this.searchGroups.people.list),this.searchGroups.people.container.append(b),new r.v7(b);let y,w=!0;const L=(0,c.Z)({content:e.parentElement,type:"zoom-fade",transitionTime:150,onTransitionEnd:e=>{y&&clearTimeout(y),0!==e||w||(s.selectTab(0,!1),this.inputSearch.onClearClick(),y=window.setTimeout((()=>{y=0,this.newBtnMenu.classList.remove("is-hidden"),this.hasUpdate&&this.updateBtn.classList.remove("is-hidden")}),150)),w=!1}});L(0);const I="is-visible",E=()=>{this.toolsBtn.classList.remove(I),this.backBtn.classList.add(I),this.newBtnMenu.classList.add("is-hidden"),this.updateBtn.classList.add("is-hidden"),this.toolsBtn.parentElement.firstElementChild.classList.toggle("state-back",!0);const e="global-search";j.IS_MOBILE_SAFARI||Ht.Z.findItemByType(e)||Ht.Z.pushItem({onPop:()=>{i()},type:e}),L(1)};this.inputSearch.input.addEventListener("focus",E),E(),(0,v.fc)(this.backBtn,(e=>{this.toolsBtn.classList.add(I),this.backBtn.classList.remove(I),this.toolsBtn.parentElement.firstElementChild.classList.toggle("state-back",!1),Ht.Z.removeByType("global-search"),L(0)}));const P=(0,vt.Z)("close");this.searchGroups.recent.nameEl.append(P),P.addEventListener("click",(()=>{(0,Ee.Z)({descriptionLangKey:"Search.Confirm.ClearHistory",button:{langKey:"ClearButton",isDanger:!0}}).then((()=>this.managers.appUsersManager.clearRecentSearch().then((()=>{this.searchGroups.recent.clear()}))))}))}}const Jt=new Xt;L.GO.appSidebarLeft=Jt;const ei=Jt},5670:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(3552),n=i(5644),a=i(279),o=i(8119);class r extends s._{init(e){this.container.classList.add("add-members-container"),this.nextBtn=(0,o.Z)({icon:"arrow_next"}),this.content.append(this.nextBtn),this.scrollable.container.remove(),this.nextBtn.addEventListener("click",(()=>{const e=this.selector.getSelected().map((e=>e.toPeerId())),t=this.takeOut(e);!this.skippable||t instanceof Promise?t instanceof Promise?this.attachToPromise(t):void 0===t&&this.close():this.close()})),this.setTitle(e.title),this.peerType=e.type,this.takeOut=e.takeOut,this.skippable=e.skippable;const t="privacy"===this.peerType;this.selector=new n.Z({appendTo:this.content,onChange:this.skippable?null:e=>{this.nextBtn.classList.toggle("is-visible",!!e)},peerType:[t?"dialogs":"contacts"],placeholder:e.placeholder,exceptSelf:t,filterPeerTypeBy:t?["isAnyGroup","isUser"]:void 0,managers:this.managers,design:"square"}),e.selectedPeerIds&&this.selector.addInitial(e.selectedPeerIds),this.nextBtn.classList.add("tgico-arrow_next"),this.nextBtn.innerHTML="",this.nextBtn.disabled=!1,this.nextBtn.classList.toggle("is-visible",this.skippable)}attachToPromise(e){const t=(0,a.p)(this.nextBtn,"arrow_next");e.then((()=>{this.close()}),(()=>{t()}))}}},9439:(e,t,i)=>{"use strict";i.d(t,{Z:()=>B});var s=i(6740);function n(e){const t=e.getContext("2d"),i=new Array(4).fill(0),s=t.getImageData(0,0,e.width,e.height).data,n=s.length/4;for(let e=0;e0&&(i=Math.min(100,i+5+.1*(100-i))),s=Math.max(0,.65*s),`hsla(${t}, ${i}%, ${s}%, .4)`}var h=i(8479),u=i(9674),p=i(1571),f=i(2312),m=i(7030),g=i(3512),v=i(4494),b=i(9807),y=i(3442),w=i(3552),S=i(6724),C=i(6714),L=i(5077),I=i(3228),E=i(503);class P{constructor(){this.hue=0,this.saturation=100,this.lightness=50,this.alpha=1,this.elements={},this.onGrabStart=()=>{document.documentElement.style.cursor=this.elements.boxDragger.style.cursor="grabbing"},this.onGrabEnd=()=>{document.documentElement.style.cursor=this.elements.boxDragger.style.cursor=""},this.container=document.createElement("div"),this.container.classList.add(P.BASE_CLASS);const e=`\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n `;this.container.innerHTML=e,this.elements.box=this.container.firstElementChild,this.elements.boxDragger=this.elements.box.lastElementChild,this.elements.saturation=this.elements.box.firstElementChild.firstElementChild,this.elements.sliders=this.elements.box.nextElementSibling,this.elements.hue=this.elements.sliders.firstElementChild,this.elements.hueDragger=this.elements.hue.lastElementChild,this.hexInputField=new E.ZP({plainText:!0,label:"Appearance.Color.Hex"}),this.rgbInputField=new E.ZP({plainText:!0,label:"Appearance.Color.RGB"});const t=document.createElement("div");t.className=P.BASE_CLASS+"-inputs",t.append(this.hexInputField.container,this.rgbInputField.container),this.container.append(t),this.hexInputField.input.addEventListener("input",(()=>{let e=this.hexInputField.value.replace(/#/g,"").slice(0,6);const t=e.match(/([a-fA-F\d]+)/),i=t&&t[0].length===e.length&&[6].includes(e.length);this.hexInputField.setState(i?E.I1.Neutral:E.I1.Error),e="#"+e,this.hexInputField.setValueSilently(e),i&&this.setColor(e,!1,!0)}));const i=/^(?:rgb)?\(?([01]?\d\d?|2[0-4]\d|25[0-5])(?:\W+)([01]?\d\d?|2[0-4]\d|25[0-5])\W+(?:([01]?\d\d?|2[0-4]\d|25[0-5])\)?)$/;this.rgbInputField.input.addEventListener("input",(()=>{const e=this.rgbInputField.value.match(i);this.rgbInputField.setState(e?E.I1.Neutral:E.I1.Error),e&&this.setColor((0,l.dI)(+e[1],+e[2],+e[3]),!0,!1)})),this.attachBoxListeners(),this.attachHueListeners()}attachBoxListeners(){(0,L.Z)(this.elements.box,(()=>{this.onGrabStart(),this.boxRect=this.elements.box.getBoundingClientRect()}),(e=>{this.saturationHandler(e.x,e.y)}),(()=>{this.onGrabEnd()}))}attachHueListeners(){(0,L.Z)(this.elements.hue,(()=>{this.onGrabStart(),this.hueRect=this.elements.hue.getBoundingClientRect()}),(e=>{this.hueHandler(e.x)}),(()=>{this.onGrabEnd()}))}setColor(e,t=!0,i=!0){if(void 0===e)e={h:0,s:100,l:50,a:1};else if("string"==typeof e)if("#"===e[0])e=(0,l.cw)(e);else{const t=e.match(/[.?\d]+/g);e=(0,l.dI)(+t[0],+t[1],+t[2],void 0===t[3]?1:+t[3])}this.boxRect=this.elements.box.getBoundingClientRect();const s=this.boxRect.width/100*e.s,n=100-e.l/(100-e.s/2)*100,a=this.boxRect.height/100*n;this.saturationHandler(this.boxRect.left+s,this.boxRect.top+a,!1),this.hueRect=this.elements.hue.getBoundingClientRect();const o=e.h/360,r=this.hueRect.left+this.hueRect.width*o;this.hueHandler(r,!1),this.hue=e.h,this.saturation=e.s,this.lightness=e.l,this.alpha=e.a,this.updatePicker(t,i)}getCurrentColor(){const e=(0,l.Y6)(this.hue,this.saturation,this.lightness,this.alpha),t=(0,l.t1)(e),i=t.slice(0,-2);return{hsl:`hsl(${this.hue}, ${this.saturation}%, ${this.lightness}%)`,rgb:`rgb(${e[0]}, ${e[1]}, ${e[2]})`,hex:i,hsla:`hsla(${this.hue}, ${this.saturation}%, ${this.lightness}%, ${this.alpha})`,rgba:`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]})`,hexa:t,rgbaArray:e}}updatePicker(e=!0,t=!0){const i=this.getCurrentColor();this.elements.boxDragger.setAttributeNS(null,"fill",i.hex),e&&(this.hexInputField.setValueSilently(i.hex),this.hexInputField.setState(E.I1.Neutral)),t&&(this.rgbInputField.setValueSilently(i.rgbaArray.slice(0,-1).join(", ")),this.rgbInputField.setState(E.I1.Neutral)),this.onChange&&this.onChange(i)}hueHandler(e,t=!0){const i=(0,I.Z)(e-this.hueRect.left,0,this.hueRect.width)/this.hueRect.width;this.hue=Math.round(360*i);const s=`hsla(${this.hue}, 100%, 50%, ${this.alpha})`;this.elements.hueDragger.setAttributeNS(null,"x",100*i+"%"),this.elements.hueDragger.setAttributeNS(null,"fill",s),this.elements.saturation.lastElementChild.setAttributeNS(null,"stop-color",s),t&&this.updatePicker()}saturationHandler(e,t,i=!0){const s=this.boxRect.width,n=this.boxRect.height,a=(0,I.Z)(e-this.boxRect.left,0,s)/s*100,o=(0,I.Z)(t-this.boxRect.top,0,n)/n*100,r=this.elements.boxDragger;r.setAttributeNS(null,"x",a+"%"),r.setAttributeNS(null,"y",o+"%");const d=(0,I.Z)(a,0,100),l=100-d/2,c=100-(0,I.Z)(o,0,100),h=(0,I.Z)(c/100*l,0,100);this.saturation=d,this.lightness=h,i&&this.updatePicker()}}P.BASE_CLASS="color-picker";var Z=i(5029);class M extends w._{constructor(){super(...arguments),this._applyColor=(e,t=!0)=>{if(t)this.colorPicker.setColor(e);else{const t=(0,l.Pi)(e),i=this.theme.settings,s=c(t),n={_:"wallPaperNoFile",id:0,pFlags:{},settings:{_:"wallPaperSettings",background_color:parseInt(e.slice(1),16),pFlags:{}}};i.wallpaper=n,i.highlightningColor=s,this.managers.appStateManager.pushToState("settings",g.Z.settings),m.ZP.applyCurrentTheme(void 0,void 0,!0),this.setActive()}},this.onColorChange=e=>{this.applyColor(e.hex,!1)}}init(){this.container.classList.add("background-container","background-color-container"),this.setTitle("SetColor"),this.theme=C.Z.getTheme();const e=new Z.Z({});this.colorPicker=new P,e.content.append(this.colorPicker.container),this.scrollable.append(e.container);const t=new Z.Z({}),i=this.grid=document.createElement("div");i.classList.add("grid"),["#E6EBEE","#B2CEE1","#008DD0","#C6E7CB","#C4E1A6","#60B16E","#CCD0AF","#A6A997","#7A7072","#FDD7AF","#FDB76E","#DD8851"].forEach((e=>{const t=document.createElement("div");t.classList.add("grid-item"),t.dataset.color=e.toLowerCase();const s=document.createElement("div");s.classList.add("grid-item-media"),s.style.backgroundColor=e,t.append(s),i.append(t)})),(0,r.fc)(i,(e=>{const t=(0,d.Z)(e.target,"grid-item");if(!t||t.classList.contains("active"))return;const i=t.dataset.color;i&&this.applyColor(i)}),{listenerSetter:this.listenerSetter}),t.content.append(i),this.scrollable.append(t.container),this.applyColor=(0,S.Z)(this._applyColor,16,!0)}setActive(){const e=this.grid.querySelector(".active"),t=this.theme.settings.wallpaper.settings.background_color,i=t?this.grid.querySelector(`.grid-item[data-color="${t}"]`):null;e!==i&&(e&&e.classList.remove("active"),i&&i.classList.add("active"))}onOpen(){setTimeout((()=>{var e,t;const i=this.theme.settings,s=null===(t=null===(e=null==i?void 0:i.wallpaper)||void 0===e?void 0:e.settings)||void 0===t?void 0:t.background_color,n=!!s&&"wallPaperNoFile"===i.wallpaper._;n&&(this.colorPicker.onChange=this.onColorChange),this.colorPicker.setColor(s&&"#"+s.toString(16)||"#cccccc"),n||(this.colorPicker.onChange=this.onColorChange)}),0)}onCloseAfterTimeout(){return this.colorPicker.onChange=void 0,this.colorPicker=void 0,super.onCloseAfterTimeout()}}var T,k=i(9687),x=i(236),A=i(7814),_=i(9405),F=i(9492),D=i(7479),R=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class B extends w._{constructor(){super(...arguments),this.clicked=new Set,this.wallPapersByElement=new Map,this.elementsByKey=new Map,this.onUploadClick=()=>{(function(e){const t=document.createElement("input");t.type="file",t.style.display="none",e&&(t.accept=e),document.body.append(t);const i=new Promise(((e,i)=>{t.addEventListener("change",(t=>{const s=t.target.files[0];s?e(s):i("NO_FILE_SELECTED")}),{once:!0})})).finally((()=>{t.remove()}));return t.click(),i})("image/x-png,image/png,image/jpeg").then((e=>R(this,void 0,void 0,(function*(){if(e.name.endsWith(".png")){const t=document.createElement("img"),i=URL.createObjectURL(e);yield(0,s.cj)(t,i,!1);const n="image/jpeg",{blob:a}=yield(0,A.Z)({media:t,size:new _.c(t.naturalWidth,t.naturalHeight),mimeType:n});e=new File([a],e.name.replace(/\.png$/,".jpg"),{type:n})}const t=yield this.managers.appDocsManager.prepareWallPaperUpload(e),i=this.managers.appDocsManager.uploadWallPaper(t.id),n=f.Z.getNewDeferredForUpload(e.name,i),a=(0,o.Z)();a.addNotifyListener=n.addNotifyListener,a.cancel=n.cancel,n.then((e=>{this.clicked.delete(r),this.elementsByKey.delete(r),this.wallPapersByElement.set(l,e);const t=this.getWallPaperKey(e);this.elementsByKey.set(t,l),B.setBackgroundDocument(e).then(a.resolve,a.reject)}),a.reject);const r=this.getWallPaperKey(t);a.catch((()=>{l.remove()}));const d=new y.Z({isUpload:!0,cancelable:!0,tryAgainOnFail:!1}),{container:l}=yield this.addWallPaper(t,!1);this.clicked.add(r),d.attach(l,!1,a)}))))},this.onResetClick=()=>{var e,t,i,s;const n=x.h.settings.themes.find((e=>e.name===this.theme.name));n&&(++B.tempId,this.theme.settings=(0,h.Z)(n.settings),this.managers.appStateManager.pushToState("settings",g.Z.settings),m.ZP.applyCurrentTheme(void 0,void 0,!0),this.blurCheckboxField.setValueSilently(null===(s=null===(i=null===(t=null===(e=this.theme.settings)||void 0===e?void 0:e.wallpaper)||void 0===t?void 0:t.settings)||void 0===i?void 0:i.pFlags)||void 0===s?void 0:s.blur))},this.onGridClick=e=>{const t=(0,d.Z)(e.target,"grid-item");if(!t)return;const i=this.wallPapersByElement.get(t);if("wallPaperNoFile"===i._)return void B.setBackgroundDocument(i);const s=this.getWallPaperKey(i);if(this.clicked.has(s))return;this.clicked.add(s);const n=i.document,a=new y.Z({cancelable:!0,tryAgainOnFail:!1}),o=()=>R(this,void 0,void 0,(function*(){var e,s,o,r;const d=B.setBackgroundDocument(i);(yield this.managers.thumbsStorage.getCacheContext(n)).url&&!(null===(r=null===(o=null===(s=null===(e=this.theme.settings)||void 0===e?void 0:e.wallpaper)||void 0===s?void 0:s.settings)||void 0===o?void 0:o.pFlags)||void 0===r?void 0:r.blur)||a.attach(t,!0,d)}));a.construct(),(0,r.fc)(t,(e=>{a.preloader.parentElement?(a.onClick(e),a.detach()):o()}),{listenerSetter:this.listenerSetter}),o()},this.setActive=()=>{const e=this.grid.querySelector(".active"),t=this.elementsByKey.get(this.getWallPaperKeyFromTheme(this.theme));e!==t&&(e&&e.classList.remove("active"),t&&t.classList.add("active"))}}static getInitArgs(){return{backgrounds:g.Z.managers.appThemesManager.getWallPapers()}}get theme(){return C.Z.getTheme()}init(e=B.getInitArgs()){var t,i,s;this.container.classList.add("background-container","background-image-container"),this.setTitle("ChatBackground");{const e=(0,Z.R)(this.scrollable),n=(0,v.Z)("btn-primary btn-transparent",{icon:"cameraadd",text:"ChatBackground.UploadWallpaper"}),a=(0,v.Z)("btn-primary btn-transparent",{icon:"colorize",text:"SetColor"}),d=(0,v.Z)("btn-primary btn-transparent",{icon:"favourites",text:"Appearance.Reset"});(0,r.fc)(n,this.onUploadClick,{listenerSetter:this.listenerSetter}),(0,r.fc)(a,(()=>{this.slider.createTab(M).open()}),{listenerSetter:this.listenerSetter}),(0,r.fc)(d,this.onResetClick,{listenerSetter:this.listenerSetter});const l=null===(t=this.theme.settings)||void 0===t?void 0:t.wallpaper,c=this.blurCheckboxField=new b.Z({text:"ChatBackground.Blur",name:"blur",checked:null===(s=null===(i=null==l?void 0:l.settings)||void 0===i?void 0:i.pFlags)||void 0===s?void 0:s.blur});this.listenerSetter.add(c.input)("change",(()=>R(this,void 0,void 0,(function*(){this.theme.settings.wallpaper.settings.pFlags.blur=c.input.checked||void 0,yield this.managers.appStateManager.pushToState("settings",g.Z.settings),setTimeout((()=>{const e=o.querySelector(".active");if(!e)return;const t=this.wallPapersByElement.get(e);t.pFlags.pattern||"wallPaperNoFile"===t._||B.setBackgroundDocument(t)}),100)})))),e.append(n,a,d,(0,D.tG)(c).container)}g.Z.addEventListener("background_change",this.setActive);const n=e.backgrounds.then((e=>{const t=e.map((e=>this.addWallPaper(e)));return Promise.all(t)})),a=(0,Z.R)(this.scrollable),o=this.grid=document.createElement("div");return o.classList.add("grid"),(0,r.fc)(o,this.onGridClick,{listenerSetter:this.listenerSetter}),a.append(o),n}getWallPaperKey(e){return""+e.id}getWallPaperKeyFromTheme(e){var t;return""+(this.getWallPaperKey(null===(t=e.settings)||void 0===t?void 0:t.wallpaper)||"")}static addWallPaper(e,t=document.createElement("div")){var i;const s=(0,l.EM)(e),n="wallPaper"===e._;if(n&&e.pFlags.pattern&&!s)return;const a=!!e.pFlags.dark;let o=n?e.document:void 0;n&&!o&&(o={_:"webDocumentNoProxy",attributes:[],size:1e5,url:"assets/img/pattern.svg",w:1440,h:2960,mime_type:"image/svg+xml"}),t.classList.add("background-item"),t.dataset.id=""+e.id;const r=document.createElement("div");r.classList.add("background-item-media");const d=[];let c,h;if(n){h=(0,k.Z)(o,200,200),c=(0,F.Z)({photo:o,message:null,container:r,withoutPreloader:!0,size:h,noFadeIn:e.pFlags.pattern}),e.pFlags.pattern&&r.classList.add("is-pattern");const i=c.then((({loadPromises:e,images:t})=>R(this,void 0,void 0,(function*(){return(yield e.thumb)||e.full,t})))).then((i=>{var s;return e.pFlags.pattern&&(a?(i.full.style.display="none",i.thumb&&(i.thumb.style.display="none")):(null===(s=e.settings)||void 0===s?void 0:s.intensity)&&(i.full.style.opacity=""+Math.abs(e.settings.intensity)/100)),u.Z.mutate((()=>{t.append(r)}))}));d.push(i)}else t.append(r);if(null===(i=e.settings)||void 0===i?void 0:i.background_color){const{canvas:t}=p.Z.create(s);if(t.classList.add("background-colors-canvas"),a&&n){const i=c.then((({loadPromises:i})=>i.full.then((()=>R(this,void 0,void 0,(function*(){const i=yield g.Z.managers.thumbsStorage.getCacheContext(o,h.type);t.style.webkitMaskImage=`url(${i.url})`,t.style.opacity=""+(e.pFlags.dark?100+e.settings.intensity:e.settings.intensity)/100,r.append(t)}))))));d.push(i)}else r.append(t)}return{container:t,media:r,loadPromise:Promise.all(d)}}addWallPaper(e,t=!0){const i=B.addWallPaper(e);if(i){const{container:s,media:n}=i;s.classList.add("grid-item"),n.classList.add("grid-item-media");const a=this.getWallPaperKey(e);this.wallPapersByElement.set(s,e),this.elementsByKey.set(a,s),this.getWallPaperKeyFromTheme(this.theme)===a&&s.classList.add("active"),this.grid[t?"append":"prepend"](s)}return i&&i.loadPromise.then((()=>i))}}T=B,B.tempId=0,B.setBackgroundDocument=(e,t)=>{const i=++T.tempId,r=()=>i===T.tempId,d=e.document,h=(0,o.Z)();let u;d?(u=f.Z.downloadMediaURL({media:d,queueId:m.ZP.chat.bubbles?m.ZP.chat.bubbles.lazyLoadQueue.queueId:0}),h.addNotifyListener=u.addNotifyListener,h.cancel=u.cancel):u=Promise.resolve();const v=(e,t)=>{fetch(t).then((t=>{m.ZP.cacheStorage.save("backgrounds/"+e,t)}))};return u.then((()=>R(void 0,void 0,void 0,(function*(){var i,o,u;if(!r())return void h.resolve();const f=!!t;null!=t||(t=C.Z.getTheme().settings);const b=i=>{var a;let o;const d=(0,l.EM)(e);if(i&&!d)o=function(e){const t=document.createElement("img");return(0,s.cj)(t,e,!1).then((()=>function(e,t,i){const s=document.createElement("canvas"),a=t/i;return 1===a?(s.width=50,s.height=s.width/a):a>1?(s.height=50,s.width=s.height/a):s.width=s.height=50,s.getContext("2d").drawImage(e,0,0,t,i,0,0,s.width,s.height),n(s)}(t,t.naturalWidth,t.naturalHeight)))}(i);else{const{canvas:e}=p.Z.create(d);o=Promise.resolve(n(e))}const u=null!==(a=e.slug)&&void 0!==a?a:"";Promise.all([o,u&&v(u,i)]).then((([s])=>{if(!r())return void h.resolve();const n=c(Array.from(s));t.wallpaper=e,t.highlightningColor=n,f||g.Z.managers.appStateManager.pushToState("settings",g.Z.settings),m.ZP.applyCurrentTheme(u,i,!0).then(h.resolve)}))};if(!d)return void b();const y=yield g.Z.managers.thumbsStorage.getCacheContext(d);(null===(u=null===(o=null===(i=t.wallpaper)||void 0===i?void 0:i.settings)||void 0===o?void 0:o.pFlags)||void 0===u?void 0:u.blur)?setTimeout((()=>{const{canvas:e,promise:t}=(0,a.Z)(y.url,12,4);t.then((()=>{r()?b(e.toDataURL()):h.resolve()}))}),200):r()&&b(y.url)})))),h}},534:(e,t,i)=>{"use strict";i.d(t,{Z:()=>k});var s=i(5005),n=i(1447),a=i(3552),o=i(2796),r=i(503),d=i(2230),l=i(5322),c=i(4494),h=i(5644),u=i(9807),p=i(2325),f=i(8479),m=i(7625),g=i(130),v=i(8115),b=i(1507),y=i(3512),w=i(2738),S=i(5029),C=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class L extends a._{constructor(){super(...arguments),this.renderResults=e=>C(this,void 0,void 0,(function*(){yield this.managers.appUsersManager.getContacts(),e.forEach((e=>{const{dom:t}=s.default.addDialogNew({peerId:e,container:this.selector.scrollable,rippleEnabled:!0,avatarSize:"abitbigger"}),i=this.selector.selected.has(e);t.containerEl.append(this.checkbox(i));const n=[];this.dialogsByFilters.forEach(((t,i)=>{if(t.has(e)){const e=document.createElement("span");(0,g.Z)(e,(0,v.Z)(i.title)),n.push(e)}})),(0,p.v_)(n,!1).forEach((e=>{t.lastMessageSpan.append(e)}))}))})),this.onSelectChange=e=>{"included"===this.type&&(this.confirmBtn.style.display=e?"":"none")}}init(e,t,i){this.originalFilter=e,this.filter=(0,f.Z)(this.originalFilter),this.type=t,this.editFolderTab=i,this.content.remove(),this.container.classList.add("included-chatlist-container"),this.confirmBtn=(0,d.Z)("check btn-confirm blue",{noRipple:!0}),this.confirmBtn.style.display="none",this.header.append(this.confirmBtn),(0,w.fc)(this.confirmBtn,(()=>C(this,void 0,void 0,(function*(){const e=this.selector.getSelected();if("included"===this.type)for(const e in this.filter.pFlags)0!==e.indexOf("exclude_")&&delete this.filter.pFlags[e];else for(const e in this.filter.pFlags)0===e.indexOf("exclude_")&&delete this.filter.pFlags[e];const t=[];for(const i of e)i.isPeerId()?t.push(i.toPeerId()):this.filter.pFlags[i]=!0;let i;i="included"===this.type?e=>t.includes(e):e=>!t.includes(e),(0,m.Z)(this.filter.pinnedPeerIds,((e,t)=>{i(e)||(this.filter.pinnedPeerIds.splice(t,1),this.filter.pinned_peers.splice(t,1))}));const s="included"===this.type?"excludePeerIds":"includePeerIds",n="included"===this.type?"exclude_peers":"include_peers";(0,m.Z)(this.filter[s],((e,i)=>{t.includes(e)&&(this.filter[s].splice(i,1),this.filter[n].splice(i,1))})),this.filter["included"===this.type?"includePeerIds":"excludePeerIds"]=t,this.filter["included"===this.type?"include_peers":"exclude_peers"]=yield Promise.all(t.map((e=>this.managers.appPeersManager.getInputPeerById(e)))),this.editFolderTab.setFilter(this.filter,!1),this.close()}))),{listenerSetter:this.listenerSetter});const s=e=>{this.limit=y.Z.premium?e.dialog_filters_chats_limit_premium:e.dialog_filters_chats_limit_default};return this.listenerSetter.add(y.Z)("app_config",s),this.dialogsByFilters=new Map,Promise.all([this.managers.filtersStorage.getDialogFilters().then((e=>C(this,void 0,void 0,(function*(){yield Promise.all(e.filter((e=>!b.DZ.has(e.id))).map((e=>C(this,void 0,void 0,(function*(){const t=(yield this.managers.dialogsStorage.getFolderDialogs(e.id)).map((e=>e.peerId));this.dialogsByFilters.set(e,new Set(t))})))))})))),this.managers.apiManager.getAppConfig().then((e=>{s(e)}))])}checkbox(e){const t=new u.Z({round:!0});return e&&(t.input.checked=e),t.label}onOpen(){this.confirmBtn.style.display="excluded"===this.type?"":"none",this.setTitle("included"===this.type?"FilterAlwaysShow":"FilterNeverShow");const e=this.filter,t=new S.Z({noDelimiter:!0,name:"FilterChatTypes"});let i;t.container.classList.add("folder-categories"),i="excluded"===this.type?{exclude_muted:{ico:"mute",text:"ChatList.Filter.MutedChats"},exclude_archived:{ico:"archive",text:"ChatList.Filter.Archive"},exclude_read:{ico:"readchats",text:"ChatList.Filter.ReadChats"}}:{contacts:{ico:"newprivate",text:"ChatList.Filter.Contacts"},non_contacts:{ico:"noncontacts",text:"ChatList.Filter.NonContacts"},groups:{ico:"group",text:"ChatList.Filter.Groups"},broadcasts:{ico:"newchannel",text:"ChatList.Filter.Channels"},bots:{ico:"bots",text:"ChatList.Filter.Bots"}};const s=document.createDocumentFragment();for(const e in i){const t=(0,c.Z)("btn-primary btn-transparent folder-category-button",{icon:i[e].ico,text:i[e].text});t.dataset.peerId=e,t.append(this.checkbox()),s.append(t)}t.content.append(s);const n=("included"===this.type?e.includePeerIds:e.excludePeerIds).slice();this.selector=new h.Z({appendTo:this.container,onChange:this.onSelectChange,peerType:["dialogs"],renderResultsFunc:this.renderResults,placeholder:"Search",sectionNameLangPackKey:"FilterChats",managers:this.managers}),this.selector.selected=new Set(n);let a=!1;const r=this.selector.add.bind(this.selector);this.selector.add=(e,t,s)=>{if(this.selector.selected.size>=this.limit&&a&&!i[e]){const t=this.selector.list.querySelector(`[data-peer-id="${e}"] [type="checkbox"]`);t&&setTimeout((()=>{t.checked=!1}),0);const i=p.ZP.format("excluded"===this.type?"ChatList.Filter.Exclude.LimitReached":"ChatList.Filter.Include.LimitReached",!0);return void(0,o.Am)(i)}const n=r(e,i[e]?(0,p.ag)(i[e].text):void 0,s);return i[e]&&n.querySelector("avatar-element").classList.add("tgico-"+i[e].ico),n},this.selector.scrollable.container.append(t.container,this.selector.scrollable.container.lastElementChild),this.selector.addInitial(n),a=!0;for(const s in e.pFlags)i.hasOwnProperty(s)&&e.pFlags[s]&&(0,w.tH)(t.content.querySelector(`[data-peer-id="${s}"]`))}onCloseAfterTimeout(){return this.selector&&(this.selector.container.remove(),this.selector=null),super.onCloseAfterTimeout()}}var I=i(8127),E=i(6848),P=i(3066),Z=i(2353),M=i(1168),T=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class k extends a._{constructor(){super(...arguments),this.flags={}}static getInitArgs(){return{animationData:n.Z.loadAnimationFromURLManually("Folders_2")}}init(e=k.getInitArgs()){this.container.classList.add("edit-folder-container"),this.caption=document.createElement("div"),this.caption.classList.add("caption"),this.caption.append((0,p.ag)("FilterIncludeExcludeInfo")),this.stickerContainer=document.createElement("div"),this.stickerContainer.classList.add("sticker-container"),this.confirmBtn=(0,d.Z)("check btn-confirm hide blue");let t=!1;const i={icon:"delete danger",text:"FilterMenuDelete",onClick:()=>{M.Z.createPopup(I.Z,"filter-delete",{titleLangKey:"ChatList.Filter.Confirm.Remove.Header",descriptionLangKey:"ChatList.Filter.Confirm.Remove.Text",buttons:[{langKey:"Delete",callback:()=>{t||(t=!0,this.managers.filtersStorage.updateDialogFilter(this.filter,!0).then((e=>{this.close()})).finally((()=>{t=!1})))},isDanger:!0}]}).show()}};this.menuBtn=(0,l.Z)({listenerSetter:this.listenerSetter,direction:"bottom-left",buttons:[i]}),this.menuBtn.classList.add("hide"),this.header.append(this.confirmBtn,this.menuBtn);const s=new S.Z({}),a=document.createElement("div");a.classList.add("input-wrapper"),this.nameInputField=new r.ZP({label:"FilterNameHint",maxLength:12}),a.append(this.nameInputField.container),s.content.append(a);const h=(e,t,i,s)=>{const n=new S.Z({name:t,noDelimiter:!0});n.container.classList.add("folder-list",e);const a=n.generateContentElement();return a.classList.add("folder-categories"),i.forEach((e=>{const t=(0,c.Z)("folder-category-button btn btn-primary btn-transparent",{icon:e.icon,text:e.text,noRipple:!e.withRipple||void 0});e.name&&(s[e.name]=t),a.append(t)})),n};this.includePeerIds=h("folder-list-included","FilterInclude",[{icon:"add primary",text:"ChatList.Filter.Include.AddChat",withRipple:!0},{text:"ChatList.Filter.Contacts",icon:"newprivate",name:"contacts"},{text:"ChatList.Filter.NonContacts",icon:"noncontacts",name:"non_contacts"},{text:"ChatList.Filter.Groups",icon:"group",name:"groups"},{text:"ChatList.Filter.Channels",icon:"channel",name:"broadcasts"},{text:"ChatList.Filter.Bots",icon:"bots",name:"bots"}],this.flags),this.excludePeerIds=h("folder-list-excluded","FilterExclude",[{icon:"minus primary",text:"ChatList.Filter.Exclude.AddChat",withRipple:!0},{text:"ChatList.Filter.MutedChats",icon:"mute",name:"exclude_muted"},{text:"ChatList.Filter.Archive",icon:"archive",name:"exclude_archived"},{text:"ChatList.Filter.ReadChats",icon:"readchats",name:"exclude_read"}],this.flags),this.scrollable.append(this.stickerContainer,this.caption,s.container,this.includePeerIds.container,this.excludePeerIds.container);const u=this.includePeerIds.container.querySelector(".folder-categories"),f=this.excludePeerIds.container.querySelector(".folder-categories");(0,w.fc)(u.querySelector(".btn"),(()=>{this.slider.createTab(L).open(this.filter,"included",this)}),{listenerSetter:this.listenerSetter}),(0,w.fc)(f.querySelector(".btn"),(()=>{this.slider.createTab(L).open(this.filter,"excluded",this)}),{listenerSetter:this.listenerSetter}),(0,w.fc)(this.confirmBtn,(()=>{if(this.nameInputField.input.classList.contains("error"))return;if(!this.nameInputField.value.trim())return void this.nameInputField.input.classList.add("error");let e,t=Array.from(u.children).slice(1).reduce(((e,t)=>e+ +!t.style.display),0);t+=this.filter.include_peers.length,t?(this.confirmBtn.setAttribute("disabled","true"),e=this.filter.id?this.managers.filtersStorage.updateDialogFilter(this.filter):this.managers.filtersStorage.createDialogFilter(this.filter),e.then((e=>{this.close()})).catch((e=>{"DIALOG_FILTERS_TOO_MUCH"===e.type?(0,o.Am)("Sorry, you can't create more folders."):console.error("updateDialogFilter error:",e)})).finally((()=>{this.confirmBtn.removeAttribute("disabled")}))):(0,o.Am)("Please choose at least one chat for this folder.")}),{listenerSetter:this.listenerSetter}),this.listenerSetter.add(this.nameInputField.input)("input",(()=>{this.filter.title=this.nameInputField.value,this.editCheckForChange()}));const m="edit"===this.type?[this.managers.filtersStorage.reloadMissingPeerIds(this.filter.id,"pinned_peers"),this.managers.filtersStorage.reloadMissingPeerIds(this.filter.id,"include_peers"),this.managers.filtersStorage.reloadMissingPeerIds(this.filter.id,"exclude_peers")]:[];return Promise.all([this.loadAnimationPromise=e.animationData.then((e=>T(this,void 0,void 0,(function*(){const t=yield e({container:this.stickerContainer,loop:!1,autoplay:!1,width:86,height:86});return this.animation=t,n.Z.waitForFirstFrame(t)})))),...m]).then((()=>{"edit"===this.type?(this.setFilter(this.originalFilter,!0),this.onEditOpen()):(this.setInitFilter(),this.onCreateOpen())}))}onOpenAfterTimeout(){this.loadAnimationPromise.then((()=>{this.animation.autoplay=!0,this.animation.play()}))}onCreateOpen(){this.setTitle("FilterNew"),this.menuBtn.classList.add("hide"),this.confirmBtn.classList.remove("hide");for(const e in this.flags)this.flags[e].style.display="none"}onEditOpen(){this.setTitle("create"===this.type?"FilterNew":"FilterHeaderEdit"),"edit"===this.type&&(this.menuBtn.classList.remove("hide"),this.confirmBtn.classList.add("hide"));const e=this.filter;this.nameInputField.value=(0,P.Z)(e.title);for(const t in this.flags)this.flags[t].style.display=e.pFlags[t]?"":"none";["includePeerIds","excludePeerIds"].forEach((t=>T(this,void 0,void 0,(function*(){const i=this[t],n=s.default.createChatList({ignoreClick:!0});let a=e[t];const o=e=>T(this,void 0,void 0,(function*(){return!!(yield this.managers.appMessagesManager.getDialogOnly(e))||!!e.isUser()&&"user"===(yield this.managers.appUsersManager.getUser(e.toUserId()))._})),r=yield(0,Z.Z)(a,(e=>o(e)));a.length=0,a.push(...r),a=a.slice();const d=e=>T(this,void 0,void 0,(function*(){for(let t=0,i=Math.min(a.length,e);td(20)),{listenerSetter:this.listenerSetter}),l.append((0,p.ag)("FilterShowMoreChats",[a.length])),e.append(l)}d(4)}))))}editCheckForChange(){if("edit"===this.type){const e=!(0,E.Z)(this.originalFilter,this.filter);this.confirmBtn.classList.toggle("hide",!e),this.menuBtn.classList.toggle("hide",e)}}setFilter(e,t){this.container&&Array.from(this.container.querySelectorAll("ul, .load-more")).forEach((e=>e.remove())),t?(this.originalFilter=e,this.filter=(0,f.Z)(e)):(this.filter=e,this.onEditOpen(),this.editCheckForChange())}setInitFilter(e){void 0===e?(this.setFilter({_:"dialogFilter",id:0,title:"",pFlags:{},pinned_peers:[],include_peers:[],exclude_peers:[],pinnedPeerIds:[],includePeerIds:[],excludePeerIds:[]},!0),this.type="create"):(this.setFilter(e,!0),this.type="edit")}}},2010:(e,t,i)=>{"use strict";i.d(t,{J:()=>f,Z:()=>m});var s=i(503),n=i(3552),a=i(2621),o=i(6726),r=i(2325),d=i(2738),l=i(3512),c=i(2521),h=i(6082),u=i(5029),p=i(9522);function f(){const e=document.createElement("div"),t=(0,c.Z)(document.createElement("a")),i=(0,r.ag)("Username.Purchase",[t]);return i.classList.add("username-purchase-help"),e.append(i,document.createElement("br"),document.createElement("br")),e.classList.add("hide"),{element:e,setUsername:i=>{i&&(t.href="https://fragment.com/username/"+i),e.classList.toggle("hide",!i)}}}class m extends n._{static getInitArgs(){return{bioMaxLength:l.Z.managers.apiManager.getLimit("bio"),user:l.Z.managers.appUsersManager.getSelf(),userFull:l.Z.managers.appProfileManager.getProfile(l.Z.myId.toUserId())}}init(e){return t=this,i=void 0,c=function*(){this.container.classList.add("edit-profile-container"),this.setTitle("EditAccount.Title");const t=[],[i,n,c]=yield Promise.all([e.bioMaxLength,e.user,e.userFull]);{const e=(0,u.R)(this.scrollable,void 0,"Bio.Description"),n=document.createElement("div");n.classList.add("input-wrapper"),this.firstNameInputField=new s.ZP({label:"EditProfile.FirstNameLabel",name:"first-name",maxLength:70}),this.lastNameInputField=new s.ZP({label:"Login.Register.LastName.Placeholder",name:"last-name",maxLength:64}),this.bioInputField=new s.ZP({label:"EditProfile.BioLabel",name:"bio",maxLength:i}),n.append(this.firstNameInputField.container,this.lastNameInputField.container,this.bioInputField.container);const o=document.createElement("div");o.classList.add("caption"),(0,r.XZ)({element:o,key:"Bio.Description"}),t.push(this.firstNameInputField,this.lastNameInputField,this.bioInputField),this.editPeer=new a.Z({peerId:l.Z.myId,inputFields:t,listenerSetter:this.listenerSetter}),this.content.append(this.editPeer.nextBtn),e.append(this.editPeer.avatarEdit.container,n)}{const e=new u.Z({name:"EditAccount.Username",caption:!0}),i=document.createElement("div");i.classList.add("input-wrapper"),this.usernameInputField=new o.l({label:"EditProfile.Username.Label",name:"username",plainText:!0,listenerSetter:this.listenerSetter,onChange:()=>{this.editPeer.handleChange();const{error:e}=this.usernameInputField,t="USERNAME_PURCHASE_AVAILABLE"===(null==e?void 0:e.type);n(t?this.usernameInputField.value:void 0)},availableText:"EditProfile.Username.Available",takenText:"EditProfile.Username.Taken",invalidText:"EditProfile.Username.Invalid"},this.managers),i.append(this.usernameInputField.container);const s=e.caption,{setUsername:n,element:a}=f();s.append(a,(0,r.ag)("UsernameHelp")),t.push(this.usernameInputField),e.content.append(i),this.scrollable.append(e.container)}{const e=new p.Z({peerId:l.Z.myId,peer:n,listenerSetter:this.listenerSetter,usernameInputField:this.usernameInputField,middleware:this.middlewareHelper.get()});this.scrollable.append(e.container)}(0,d.fc)(this.editPeer.nextBtn,(()=>{this.editPeer.nextBtn.disabled=!0;const e=[],t=this.managers.appProfileManager.updateProfile(this.firstNameInputField.value,this.lastNameInputField.value,this.bioInputField.value);e.push(t.then((()=>{this.close()}),(e=>{console.error("updateProfile error:",e)}))),this.editPeer.uploadAvatar&&e.push(this.editPeer.uploadAvatar().then((e=>this.managers.appProfileManager.uploadProfilePhoto(e)))),this.usernameInputField.isValidToChange()&&e.push(this.managers.appUsersManager.updateUsername(this.usernameInputField.value)),Promise.race(e).finally((()=>{this.editPeer.nextBtn.removeAttribute("disabled")}))}),{listenerSetter:this.listenerSetter}),this.firstNameInputField.setOriginalValue(n.first_name,!0),this.lastNameInputField.setOriginalValue(n.last_name,!0),this.bioInputField.setOriginalValue(c.about,!0),this.usernameInputField.setOriginalValue((0,h.Z)(n),!0),this.editPeer.handleChange()},new((n=void 0)||(n=Promise))((function(e,s){function a(e){try{r(c.next(e))}catch(e){s(e)}}function o(e){try{r(c.throw(e))}catch(e){s(e)}}function r(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(a,o)}r((c=c.apply(t,i||[])).next())}));var t,i,n,c}}},4332:(e,t,i)=>{"use strict";i.d(t,{HQ:()=>d,ZP:()=>h});var s=i(7030),n=i(3552),a=i(4755),o=i(1669),r=i(410);const d="is-right-column-shown";class l extends n.Z{constructor(){super({sidebarEl:document.getElementById("column-right"),canHideFirst:!0,navigationType:"right"}),this.isColumnProportionSet=!1}construct(e){this.managers=e,a.Z.addEventListener("changeScreen",((e,t)=>{t===a._.medium&&e!==a._.mobile&&this.toggleSidebar(!1)})),a.Z.addEventListener("resize",(()=>{this.setColumnProportion()}))}createSharedMediaTab(){const e=this.createTab(o.Z,!1,!0);return e.slider=this,e}replaceSharedMediaTab(e){const t=this.sharedMediaTab;if(t){const i=this.historyTabIds.indexOf(t);this._selectTab.getFrom()===t.container&&this._selectTab.setFrom(null==e?void 0:e.container),e?(-1!==i&&(this.historyTabIds[i]=e),t.container.classList.contains("active")&&e.container.classList.add("active"),t.container.replaceWith(e.container)):(-1!==i&&this.historyTabIds.splice(i,1),t.container.remove())}else this.tabsContainer.prepend(e.container);this.sharedMediaTab=e}onCloseTab(e,t,i){this.historyTabIds.length||this.toggleSidebar(!1,t),super.onCloseTab(e,t,i)}setColumnProportion(){const e=this.sidebarEl.scrollWidth/this.sidebarEl.previousElementSibling.scrollWidth;document.documentElement.style.setProperty("--right-column-proportion",""+e)}toggleSidebar(e,t){const i=document.body.classList.contains(d);let n;if(void 0!==e?e?i||(n=!0):i&&(n=!0):n=!0,!n)return Promise.resolve();i||this.historyTabIds.length||this.sharedMediaTab.open(),this.isColumnProportionSet||(this.setColumnProportion(),this.isColumnProportionSet=!0);const a=s.ZP.selectTab(i?s.oo.CHAT:s.oo.PROFILE,t);return document.body.classList.toggle(d,e),a}}const c=new l;r.GO.appSidebarRight=c;const h=c},4240:(e,t,i)=>{"use strict";i.d(t,{Z:()=>S});var s=i(3552),n=i(503),a=i(2621),o=i(7479),r=i(9807),d=i(4494),l=i(8842),c=i(3512),h=i(8127),u=i(1168),p=i(2325),f=i(2738),m=i(1656),g=i(2946),v=i(8210),b=i(5029),y=i(7362),w=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class S extends s._{init(){return w(this,void 0,void 0,(function*(){const{peerId:e}=this,t=e.toUserId();this.container.classList.add("edit-peer-container","edit-contact-container");const[i,s]=yield Promise.all([this.managers.appUsersManager.isContact(t),this.managers.appPrivacyManager.getPrivacy("inputPrivacyKeyPhoneNumber")]),S=!i;this.setTitle(S?"AddContactTitle":"Edit");{const i=new b.Z({noDelimiter:!0}),s=[],d=document.createElement("div");if(d.classList.add("input-wrapper"),this.nameInputField=new n.ZP({label:"FirstName",name:"contact-name",maxLength:70,required:!0}),this.lastNameInputField=new n.ZP({label:"LastName",name:"contact-lastname",maxLength:70}),t){const e=yield this.managers.appUsersManager.getUser(t);S?(this.nameInputField.setDraftValue(e.first_name),this.lastNameInputField.setDraftValue(e.last_name)):(this.nameInputField.setOriginalValue(e.first_name),this.lastNameInputField.setOriginalValue(e.last_name))}if(d.append(this.nameInputField.container,this.lastNameInputField.container),s.push(this.nameInputField,this.lastNameInputField),this.editPeer=new a.Z({peerId:e,inputFields:s,listenerSetter:this.listenerSetter,doNotEditAvatar:!0}),this.content.append(this.editPeer.nextBtn),e){const s=document.createElement("div");s.classList.add("avatar-edit"),s.append(this.editPeer.avatarElem);const n=new r.Z({text:"Notifications"});n.input.addEventListener("change",(t=>{t.isTrusted&&this.managers.appMessagesManager.togglePeerMute({peerId:e})})),this.listenerSetter.add(c.Z)("notify_settings",(e=>w(this,void 0,void 0,(function*(){if("notifyPeer"!==e.peer._)return;const t=(0,g.Z)(e.peer.peer);if(t==t){const t=!(yield this.managers.appNotificationsManager.isMuted(e.notify_settings));t!==n.checked&&(n.checked=t)}}))));const a=document.createElement("div");a.classList.add("profile-name"),a.append(new l.Z({peerId:e}).element);const h=document.createElement("div");if(h.classList.add("profile-subtitle"),h.append((0,p.ag)("EditContact.OriginalName")),i.content.append(s,a,h,d),S){const s=yield this.managers.appUsersManager.getUser(t),n=new o.ZP({icon:"phone",titleLangKey:s.phone?void 0:"MobileHidden",title:s.phone?(0,v.Z)(s.phone):void 0,subtitleLangKey:s.phone?"Phone":"MobileHiddenExceptionInfo",subtitleLangArgs:s.phone?void 0:[new l.Z({peerId:e}).element]});i.content.append(n.container)}else{const t=new o.ZP({checkboxField:n,withCheckboxSubtitle:!0,listenerSetter:this.listenerSetter}),s=!(yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:e,respectType:!1}));n.checked=s,i.content.append(t.container)}}else i.content.append(d);this.scrollable.append(i.container)}if(S){if(s.some((e=>"privacyValueDisallowAll"===e._))&&!s.some((e=>"privacyValueAllowUsers"===e._&&e.users.includes(t)))){const e=new b.Z({caption:"NewContact.Exception.ShareMyPhoneNumber.Desc",captionArgs:[yield(0,y.Z)({peerId:this.peerId})]}),t=this.sharePhoneCheckboxField=new r.Z({text:"NewContact.Exception.ShareMyPhoneNumber",checked:!0}),i=(0,o.tG)(t);e.content.append(i.container),this.scrollable.append(e.container)}}else{const i=new b.Z,s=(0,d.Z)("btn-primary btn-transparent danger",{icon:"delete",text:"PeerInfo.DeleteContact"});(0,f.fc)(s,(()=>{u.Z.createPopup(h.Z,"popup-delete-contact",{peerId:e,titleLangKey:"DeleteContact",descriptionLangKey:"AreYouSureDeleteContact",buttons:(0,u.x)([{langKey:"Delete",callback:()=>{const e=(0,m.Z)([s],!0);this.managers.appUsersManager.deleteContacts([t]).then((()=>{this.close()}),(()=>{e()}))},isDanger:!0}])}).show()}),{listenerSetter:this.listenerSetter}),i.content.append(s),this.scrollable.append(i.container)}(0,f.fc)(this.editPeer.nextBtn,(()=>w(this,void 0,void 0,(function*(){var e;this.editPeer.nextBtn.disabled=!0,this.managers.appUsersManager.addContact(t,this.nameInputField.value,this.lastNameInputField.value,(yield this.managers.appUsersManager.getUser(t)).phone,null===(e=this.sharePhoneCheckboxField)||void 0===e?void 0:e.checked).finally((()=>{this.editPeer.nextBtn.removeAttribute("disabled"),this.close()}))}))),{listenerSetter:this.listenerSetter})}))}}},730:(e,t,i)=>{"use strict";i.d(t,{Z:()=>C});var s=i(2738),n=i(1656),a=i(9405),o=i(8479),r=i(6848),d=i(7030),l=i(1507),c=i(3785),h=i(2230),u=i(9807),p=i(6039),f=i(503),m=i(7479),g=i(5029),v=i(7856),b=i(6024),y=i(9345),w=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const S=(0,a.C)(64,64);class C extends b.Z{init(e,t){return w(this,void 0,void 0,(function*(){this.colorIndex=0;const i=!t,a=t===l.Ox;this.container.classList.add("edit-topic-container"),this.setTitle(i?"NewTopic":"ForumTopic.Title.Edit");const r=e.toChatId();t&&(this.topic=this.originalTopic=(0,o.Z)(yield this.managers.dialogsStorage.getForumTopic(e,t)));{const i=new g.Z({name:a?"CreateGeneralTopicTitle":"CreateTopicTitle"}),o=this.iconDiv=document.createElement("div");o.classList.add("edit-topic-icon-container"),!t&&(0,s.fc)(o,(()=>{this.topic.icon_emoji_id||(this.colorIndex=(this.colorIndex+1)%l.OS.length,this.setIcon())}),{listenerSetter:this.listenerSetter}),t&&o.classList.add("disable-hover");const c=document.createElement("div");c.classList.add("input-wrapper");const u=this.nameInputField=new f.ZP({label:"ForumTopic.Name.Placeholder",withLinebreaks:!1,name:"topic-name",maxLength:70,required:!0});this.topic&&u.setOriginalValue(this.topic.title,!0);const p=this.confirmBtn=(0,h.Z)("check btn-confirm blue hide",{noRipple:!0});this.header.append(p),(0,s.fc)(p,(()=>{const i=(0,n.Z)([p],!0);t?this.managers.appChatsManager.editForumTopic({chatId:r,topicId:t,title:u.value,iconEmojiId:this.topic.icon_emoji_id||0}).then((()=>{this.close()})).catch((e=>{console.error("edit topic error",e),i()})):this.managers.appChatsManager.createForumTopic({chatId:r,iconColor:l.OS[this.colorIndex],iconEmojiId:this.topic.icon_emoji_id,title:u.value}).then((t=>{this.close(),d.ZP.setInnerPeer({peerId:e,threadId:t})})).catch((e=>{console.error("create topic error",e),i()}))}),{listenerSetter:this.listenerSetter}),this.listenerSetter.add(u.input)("input",(()=>{var e;this.validate(),this.setIcon(null===(e=this.topic)||void 0===e?void 0:e.icon_emoji_id)})),c.append(u.container),i.content.append(o,c),this.scrollable.append(i.container)}const c=[];if(a){const e=new g.Z({caption:"EditTopicHideInfo"}),i=new u.Z({checked:!this.topic.pFlags.hidden,text:"EditTopicHide"});this.listenerSetter.add(i.input)("change",(()=>{const e=this.managers.appChatsManager.editForumTopic({chatId:r,topicId:t,hidden:!i.checked});s.disableWithPromise(e)}));const s=new m.ZP({checkboxField:i});e.content.append(s.container),this.scrollable.append(e.container)}else{const e=new g.Z({});e.container.classList.add("edit-topic-emoticons-container");const t=new p.ZP({managers:this.managers,isStandalone:!0,noRegularEmoji:!0,stickerSetId:"inputStickerSetEmojiDefaultTopicIcons",onClick:e=>{t.setActive(e.docId?e:{emoji:void 0,docId:void 0}),this.setIcon(e.docId)}});t.getContainerSize=()=>({width:v.ZP.rect.width,height:400}),this.middlewareHelper.onDestroy((()=>{t.destroy()})),t.container.classList.remove("tabs-tab"),this.emojiElement=document.createElement("span"),this.emojiElement.classList.add("super-emoji-topic-icon");const i=t.init().then((()=>w(this,void 0,void 0,(function*(){var e;const i=t.getCustomCategory(),s=null===(e=this.topic)||void 0===e?void 0:e.icon_emoji_id;t.addEmojiToCategory({category:i,element:this.emojiElement,batch:!1,prepend:!0,active:!s}),s&&t.setActive({docId:s,emoji:""})}))));c.push(i),e.content.replaceWith(t.container),this.scrollable.append(e.container)}return Promise.all(c).then((()=>this.s()))}))}validate(){let e=this.nameInputField.isValidToChange();!e&&this.originalTopic&&(e=this.topic.icon_emoji_id!==this.originalTopic.icon_emoji_id),this.confirmBtn.classList.toggle("hide",!e)}s(){var e,t;return(null===(e=this.topic)||void 0===e?void 0:e.icon_color)&&(this.colorIndex=l.OS.indexOf(this.topic.icon_color)),this.setIcon(null===(t=this.topic)||void 0===t?void 0:t.icon_emoji_id,void 0,!0)}setIcon(e,t=this.iconDiv,i){var s;return w(this,void 0,void 0,(function*(){const n=this.nameInputField.value,a=t===this.iconDiv;if(a){const t={id:null===(s=this.topic)||void 0===s?void 0:s.id,icon_color:l.OS[this.colorIndex],title:(0,c.Z)(n,!0).text||"A",icon_emoji_id:e},a=this.topic;if(this.topic=t,!i&&a&&a.icon_color===t.icon_color&&a.title===t.title||this.setIcon(void 0,this.emojiElement),(0,r.Z)(a,t)&&!i)return;this.validate()}const o=yield(0,y.e)({topic:a?this.topic:Object.assign(Object.assign({},this.topic),{icon_emoji_id:void 0}),customEmojiSize:S,middleware:this.middlewareHelper.get()}),d=document.createElement("div");d.classList.add("edit-topic-icon"),d.append(o);const h=t.lastElementChild;t.append(d);const u=(e,t)=>{const i=e.animate([{opacity:"0",transform:"scale(0.8)"},{opacity:"1",transform:"scale(1)"}],{duration:200,iterations:1,easing:"ease-in-out",fill:"forwards",direction:t?"normal":"reverse"});return new Promise((e=>{i.addEventListener("finish",(()=>{e()}),{once:!0})}))};h&&u(h,!1).then((()=>h.remove())),u(d,!0)}))}}},1669:(e,t,i)=>{"use strict";i.d(t,{Z:()=>pe});var s=i(3512),n=i(6360),a=i(3552),o=i(426),r=i(503),d=i(2621),l=i(7479),c=i(4494),h=i(2166),u=i(144),p=i(279),f=i(1218),m=i(2796),g=i(6726),v=i(6024),b=i(2325),y=i(8127),w=i(8119),S=i(2738),C=i(1656),L=i(9807),I=i(5029),E=i(9522),P=i(6082),Z=i(5102),M=i(2010),T=i(5592),k=i(1168),x=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class A extends v.h{init(){return x(this,void 0,void 0,(function*(){this.container.classList.add("edit-peer-container","group-type-container");const e=yield this.managers.appChatsManager.isBroadcast(this.chatId);this.setTitle(e?"ChannelType":"GroupType");const t=new I.Z({name:e?"ChannelType":"GroupType"}),i=(0,u.a)(),n=new l.ZP({radioField:new f.Z({langKey:e?"ChannelPrivate":"MegaPrivate",name:i,value:"private"}),subtitleLangKey:e?"ChannelPrivateInfo":"MegaPrivateInfo"}),a=new l.ZP({radioField:new f.Z({langKey:e?"ChannelPublic":"MegaPublic",name:i,value:"public"}),subtitleLangKey:e?"ChannelPublicInfo":"MegaPublicInfo"}),o=(0,l.De)([n,a],(e=>{const t=[[v.container],[z]];"public"===e&&t.reverse(),t[0].forEach((e=>e.classList.remove("hide"))),t[1].forEach((e=>e.classList.add("hide"))),B()}));let r=yield this.managers.appChatsManager.getChat(this.chatId);const d={basic:[]};this.listenerSetter.add(s.Z)("chat_update",(e=>x(this,void 0,void 0,(function*(){this.chatId===e&&(r=yield this.managers.appChatsManager.getChat(this.chatId),d.basic.forEach((e=>e())))})))),t.content.append(o);const v=new I.Z({}),A=new l.ZP({title:this.chatFull.exported_invite.link,subtitleLangKey:e?"ChannelPrivateLinkHelp":"MegaPrivateLinkHelp",clickable:()=>{(0,h.T)(this.chatFull.exported_invite.link),(0,m.Am)(b.ZP.format("LinkCopied",!0))},listenerSetter:this.listenerSetter}),_=(0,c.Z)("btn-primary btn-transparent danger",{icon:"delete",text:"RevokeLink"});(0,S.fc)(_,(()=>{k.Z.createPopup(y.Z,"revoke-link",{buttons:[{langKey:"RevokeButton",callback:()=>{const e=(0,C.Z)([_],!0);this.managers.appProfileManager.getChatInviteLink(this.chatId,!0).then((t=>{e(),A.title.innerHTML=t}))}}],titleLangKey:"RevokeLink",descriptionLangKey:"RevokeAlert"}).show()}),{listenerSetter:this.listenerSetter}),v.content.append(A.container,_);const F=new I.Z({caption:!0,noDelimiter:!0}),D=document.createElement("div");D.classList.add("input-wrapper");const R="t.me/",B=()=>{const e=n.radioField.checked&&j!==R||N.isValidToChange()&&N.input.classList.contains("valid");G.classList.toggle("is-visible",e);const{error:t}=N,i="USERNAME_PURCHASE_AVAILABLE"===(null==t?void 0:t.type);O(i?N.getValue():void 0)},N=new g.l({label:"SetUrlPlaceholder",name:"group-public-link",plainText:!0,listenerSetter:this.listenerSetter,availableText:"Link.Available",invalidText:"Link.Invalid",takenText:"Link.Taken",onChange:B,peerId:this.chatId.toPeerId(!0),head:R},this.managers),{setUsername:O,element:U}=(0,M.J)();F.caption.append(U,(0,b.ag)(e?"Channel.UsernameAboutChannel":"Channel.UsernameAboutGroup"));const H=new E.Z({peerId:this.chatId.toPeerId(!0),peer:r,listenerSetter:this.listenerSetter,usernameInputField:N,middleware:this.middlewareHelper.get()}),z=document.createElement("div");z.append(F.container,H.container);const j=R+((0,P.Z)(r)||"");D.append(N.container),F.content.append(D);const G=(0,w.Z)({icon:"check",className:"is-visible"});this.content.append(G),(0,S.fc)(G,(()=>x(this,void 0,void 0,(function*(){const t=a.radioField.checked?N.getValue():"";if(!t){const t=yield this.managers.appChatsManager.getChat(this.chatId),i=(0,P.Z)(t);i&&(yield(0,T.Z)({descriptionLangKey:e?"ChannelVisibility.Confirm.MakePrivate.Channel":"ChannelVisibility.Confirm.MakePrivate.Group",descriptionLangArgs:[i],button:{langKey:"OK"}}))}(0,p.p)(G),this.managers.appChatsManager.migrateChat(this.chatId).then((e=>t?this.managers.appChatsManager.updateUsername(e,t):this.managers.appChatsManager.makeChannelPrivate(e))).then((()=>{this.close()}))}))),{listenerSetter:this.listenerSetter}),(j!==R||(0,Z.Z)(r).length?a:n).radioField.checked=!0,N.setOriginalValue(j,!0),this.scrollable.append(t.container,v.container,z);{const t=new I.Z({name:"SavingContentTitle",caption:e?"RestrictSavingContentInfoChannel":"RestrictSavingContentInfoGroup"}),i=new L.Z({text:"RestrictSavingContent",withRipple:!0});this.listenerSetter.add(i.input)("change",(()=>{const e=i.toggleDisability(!0);this.managers.appChatsManager.toggleNoForwards(this.chatId,i.checked).then((()=>{e()}))}));const s=()=>{i.setValueSilently(!!r.pFlags.noforwards)};((e,t="basic")=>{d[t].push(e)})(s),s(),t.content.append(i.label),this.scrollable.append(t.container)}}))}}var _=i(4668),F=i(5565),D=i(8936),R=i(5005),B=i(8479),N=i(7120),O=i(2946),U=i(2995),H=i(6848),z=i(3061),j=i(7362),G=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class V extends v.h{init(){return G(this,void 0,void 0,(function*(){let e;this.container.classList.add("edit-peer-container","user-permissions-container"),this.setTitle("UserRestrictions");const t=yield this.managers.appChatsManager.isChannel(this.chatId);{const t=new I.Z({name:"UserRestrictionsCanDo"}),i=document.createElement("div");i.classList.add("chatlist-container"),t.content.insertBefore(i,t.title);const s=R.default.createChatList({new:!0});i.append(s);const{dom:n}=R.default.addDialogNew({peerId:this.userId.toPeerId(!1),container:s,rippleEnabled:!0,avatarSize:"abitbigger"});n.lastMessageSpan.append((0,z.Z)(yield this.managers.appUsersManager.getUser(this.userId)));const a=new $({chatId:this.chatId,listenerSetter:this.listenerSetter,appendTo:t.content,participant:"channelParticipantBanned"===this.participant._?this.participant:void 0},this.managers);e=()=>{const e=a.takeOut();"channelParticipantBanned"===this.participant._&&(0,H.Z)(this.participant.banned_rights.pFlags,e.pFlags)||this.managers.appChatsManager.editBanned(this.chatId,this.participant,e)},this.eventListener.addEventListener("destroy",e,{once:!0}),this.scrollable.append(t.container)}{const i=new I.Z({});if("channelParticipantBanned"===this.participant._){const t=(0,c.Z)("btn-primary btn-transparent danger",{icon:"delete",text:"GroupPermission.Delete"});(0,S.fc)(t,(()=>{const i=(0,C.Z)([t],!0);this.managers.appChatsManager.clearChannelParticipantBannedRights(this.chatId,this.participant).then((()=>{this.eventListener.removeEventListener("destroy",e),this.close()}),(()=>{i()}))}),{listenerSetter:this.listenerSetter}),i.content.append(t)}const s=(0,c.Z)("btn-primary btn-transparent danger",{icon:"deleteuser",text:"UserRestrictionsBlock"});(0,S.fc)(s,(()=>G(this,void 0,void 0,(function*(){const i=(0,C.Z)([s],!0);try{const e=this.userId.toPeerId();yield(0,T.Z)({peerId:this.chatId.toPeerId(!0),descriptionLangKey:"Permissions.RemoveFromGroup",descriptionLangArgs:[yield(0,j.Z)({peerId:e})],titleLangKey:"ChannelBlockUser",button:{langKey:"Remove",isDanger:!0}}),t?yield this.managers.appChatsManager.kickFromChannel(this.chatId,this.participant):yield this.managers.appChatsManager.kickFromChat(this.chatId,this.participant)}catch(e){return void i()}this.eventListener.removeEventListener("destroy",e),this.close()}))),{listenerSetter:this.listenerSetter}),i.content.append(s),this.scrollable.append(i.container)}}))}}var K=i(8610),W=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class $ extends K.Z{constructor(e,t){super({listenerSetter:e.listenerSetter,fields:[],asRestrictions:!0}),this.options=e,this.managers=t,this.construct()}construct(){return W(this,void 0,void 0,(function*(){const e=this.options,t=this.chat=yield this.managers.appChatsManager.getChat(e.chatId),i=this.defaultBannedRights=t.default_banned_rights,s=this.rights=e.participant?function(e,t){if(e.default_banned_rights){t=(0,B.Z)(t);const i=e.default_banned_rights.pFlags;for(const e in i)t.pFlags[e]=i[e]}return t}(t,e.participant.banned_rights):i,n=[{flags:["send_photos"],text:"UserRestrictionsSendPhotos",exceptionText:"UserRestrictionsNoSendPhotos"},{flags:["send_videos"],text:"UserRestrictionsSendVideos",exceptionText:"UserRestrictionsNoSendVideos"},{flags:["send_stickers","send_gifs"],text:"UserRestrictionsSendStickers",exceptionText:"UserRestrictionsNoSendStickers"},{flags:["send_audios"],text:"UserRestrictionsSendMusic",exceptionText:"UserRestrictionsNoSendMusic"},{flags:["send_docs"],text:"UserRestrictionsSendFiles",exceptionText:"UserRestrictionsNoSendDocs"},{flags:["send_voices"],text:"UserRestrictionsSendVoices",exceptionText:"UserRestrictionsNoSendVoice"},{flags:["send_roundvideos"],text:"UserRestrictionsSendRound",exceptionText:"UserRestrictionsNoSendRound"},{flags:["embed_links"],text:"UserRestrictionsEmbedLinks",exceptionText:"UserRestrictionsNoEmbedLinks"},{flags:["send_polls"],text:"UserRestrictionsSendPolls",exceptionText:"UserRestrictionsNoSendPolls"}],a=n,o=[{flags:["send_plain"],text:"UserRestrictionsSend",exceptionText:"UserRestrictionsNoSend"},{flags:["send_media"],text:"UserRestrictionsSendMedia",exceptionText:"UserRestrictionsNoSendMedia",nested:n},{flags:["invite_users"],text:"UserRestrictionsInviteUsers",exceptionText:"UserRestrictionsNoInviteUsers"},{flags:["pin_messages"],text:"UserRestrictionsPinMessages",exceptionText:"UserRestrictionsNoPinMessages"},{flags:["change_info"],text:"UserRestrictionsChangeInfo",exceptionText:"UserRestrictionsNoChangeInfo"}],r={};o.push(...n),o.forEach((e=>{const i=e.flags[0];r[i]=e,e.checked=(0,N.Z)(t,i,s)})),n.forEach((e=>e.nestedTo=r.send_media)),r.send_media.toggleWith={unchecked:a,checked:a},r.embed_links.toggleWith={checked:[r.send_plain]},r.send_plain.toggleWith={unchecked:[r.embed_links]},this.fields=o;for(const s of this.fields){if((this.options.participant&&i.pFlags[s.flags[0]]||(0,Z.Z)(t)[0]&&(s.flags.includes("pin_messages")||s.flags.includes("change_info")))&&(s.restrictionText=this.restrictionText),s.nestedTo)continue;const{nodes:n}=this.createField(s);e.appendTo.append(...n)}}))}takeOut(){const e={_:"chatBannedRights",until_date:2147483647,pFlags:{}},t=new Set(["send_media"]);for(const i of this.fields)!i.checkboxField.checked&&i.flags.forEach((i=>{t.has(i)||(e.pFlags[i]=!0)}));return e}}class q extends v.h{init(){return W(this,void 0,void 0,(function*(){let e;this.container.classList.add("edit-peer-container","group-permissions-container"),this.setTitle("ChannelPermissions");{const t=new I.Z({name:"ChannelPermissionsHeader"});e=new $({chatId:this.chatId,listenerSetter:this.listenerSetter,appendTo:t.content},this.managers),this.eventListener.addEventListener("destroy",(()=>{this.managers.appChatsManager.editChatDefaultBannedRights(this.chatId,e.takeOut())}),{once:!0}),this.scrollable.append(t.container)}{const t=new I.Z({name:"PrivacyExceptions"}),i=new l.ZP({titleLangKey:"ChannelAddException",subtitleLangKey:"Loading",icon:"adduser",clickable:()=>{k.Z.createPopup(U.Z,{peerTypes:["channelParticipants"],onSelect:e=>{setTimeout((()=>{n(e)}),0)},placeholder:"ExceptionModal.Search.Placeholder",peerId:-this.chatId})},listenerSetter:this.listenerSetter}),n=e=>W(this,void 0,void 0,(function*(){let t;try{t=yield this.managers.appProfileManager.getParticipant(this.chatId,e)}catch(e){return void(0,m.Am)("User is no longer participant")}const i=this.slider.createTab(V);i.participant=t,i.chatId=this.chatId,i.userId=e,i.open()}));t.content.append(i.container);const a=t.generateContentElement();a.classList.add("chatlist-container");const o=R.default.createChatList({new:!0});a.append(o),(0,S.fc)(o,(e=>{const t=(0,_.Z)(e.target,R.DIALOG_LIST_ELEMENT_TAG);if(!t)return;const i=t.dataset.peerId.toPeerId();n(i)}),{listenerSetter:this.listenerSetter});const r=(t,i)=>W(this,void 0,void 0,(function*(){const s=i.banned_rights,n=(yield this.managers.appChatsManager.getChat(this.chatId)).default_banned_rights,a=[];e.fields.forEach((e=>{const t=e.flags[0];s.pFlags[t]&&!n.pFlags[t]&&a.push(e.exceptionText)}));const o=t.lastMessageSpan;a.length&&o.replaceChildren(...(0,b.v_)(a.map((e=>(0,b.ag)(e))),!1)),o.classList.toggle("hide",!a.length)})),d=(e,t)=>{const{dom:i}=R.default.addDialogNew({peerId:(0,O.Z)(e.peer),container:o,rippleEnabled:!0,avatarSize:"abitbigger",append:t});i.listEl.dialogDom=i,r(i,e)};this.listenerSetter.add(s.Z)("chat_participant",(e=>{var t,i,s;const n="channelParticipantBanned"===(null===(t=e.new_participant)||void 0===t?void 0:t._)&&!e.new_participant.banned_rights.pFlags.view_messages,a=o.querySelector(`[data-peer-id="${e.user_id}"]`);n?(a?r(a.dialogDom,e.new_participant):d(e.new_participant,!1),"channelParticipantBanned"!==(null===(i=e.prev_participant)||void 0===i?void 0:i._)&&++u):(null==a||a.remove(),"channelParticipantBanned"===(null===(s=e.prev_participant)||void 0===s?void 0:s._)&&--u),c()}));const c=()=>{(0,F.Z)(i.subtitle,(0,b.ag)(u?"Permissions.ExceptionsCount":"Permissions.NoExceptions",[u]))};let h,u=0;const p=()=>(h=new D.Z({scrollable:this.scrollable,getPromise:()=>this.managers.appProfileManager.getChannelParticipants(this.chatId,{_:"channelParticipantsBanned",q:""},50,o.childElementCount).then((e=>{for(const t of e.participants)d(t,!0);return u=e.count,c(),e.participants.length<50||e.count===o.childElementCount}))}),h.load());this.scrollable.append(t.container),(yield this.managers.appChatsManager.isChannel(this.chatId))?yield p():(c(),this.listenerSetter.add(s.Z)("dialog_migrate",(({migrateFrom:e,migrateTo:t})=>{this.chatId===e&&(this.chatId=t,p())})))}}))}onOpenAfterTimeout(){this.scrollable.onScroll()}}var Y=i(6194),Q=i(5701),X=i(62),J=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class ee extends v.h{init(){var e;return J(this,void 0,void 0,(function*(){this.setTitle("Reactions");const t=yield this.managers.appReactionsManager.getActiveAvailableReactions(),i=yield this.managers.appProfileManager.getChatFull(this.chatId),s=yield this.managers.appChatsManager.isBroadcast(this.chatId);let n=null!==(e=i.available_reactions)&&void 0!==e?e:{_:"chatReactionsNone"},a=n,o=new Set("chatReactionsSome"===n._?n.reactions.map((e=>e.emoticon)):[]);const r=e=>e.map((e=>({_:"reactionEmoji",emoticon:e}))),d=()=>s?"EnableReactionsChannelInfo":"chatReactionsAll"===a._?"EnableAllReactionsInfo":"chatReactionsNone"===a._?"DisableReactionsInfo":"EnableSomeReactionsInfo",c=new I.Z({name:s?void 0:"AvailableReactions",caption:d()}),h=new I.Z({name:"OnlyAllowThisReactions"}),u=()=>{var e;const t=null!==(e=a.reactions)&&void 0!==e?e:[];o=new Set(t.map((({emoticon:e})=>e))),f.forEach(((e,t)=>{e.setValueSilently(o.has(t))}))};let p;if(s){p=new L.Z({toggle:!0,checked:"chatReactionsSome"===n._});const e=new l.ZP({checkboxField:p,titleLangKey:"EnableReactions",listenerSetter:this.listenerSetter});c.content.append(e.container),this.listenerSetter.add(p.input)("change",(()=>{let e=!0;p.checked?m.every((e=>!e.checked))?a={_:"chatReactionsSome",reactions:r(t.map((({reaction:e})=>e)))}:"chatReactionsSome"!==a._?a={_:"chatReactionsSome",reactions:r(Array.from(o))}:e=!1:a={_:"chatReactionsNone"},e&&(u(),v())}))}else{const e=[["chatReactionsAll","AllReactions"],["chatReactionsSome","SomeReactions"],["chatReactionsNone","NoReactions"]],t=()=>{h.container.classList.toggle("hide","chatReactionsSome"!==a._)};let i=n._;const s=(0,l.ZC)(e.map((([e,t])=>({langPackKey:t,value:e,checked:n._===e}))),(e=>{i=e,a="chatReactionsAll"===i?{_:i,pFlags:{allow_custom:!0}}:"chatReactionsNone"===i?{_:i}:{_:i,reactions:r(["👍","👎"])},(0,F.Z)(c.caption,(0,b.ag)(d())),u(),v(),t()}));c.content.append(s),t()}const f=new Map,m=t.map((e=>{const t=e.reaction,i=new L.Z({toggle:!0,checked:o.has(t)});f.set(t,i),this.listenerSetter.add(i.input)("change",(()=>{i.checked?(o.add(t),p&&!p.checked&&(p.checked=!0)):(o.delete(t),(null==p?void 0:p.checked)&&!o.size&&(p.checked=!1)),v()}));const s=new l.ZP({checkboxField:i,title:e.title,havePadding:!0,listenerSetter:this.listenerSetter});return(0,X.Z)({row:s,doc:e.static_icon,size:"small"}),h.content.append(s.container),i})),g=()=>J(this,void 0,void 0,(function*(){v.clearTimeout(),"chatReactionsSome"===a._&&(a.reactions=r(Array.from(o))),this.managers.appChatsManager.setChatAvailableReactions(this.chatId,a),n=a})),v=(0,Q.Z)(g,3e3,!1,!0);this.eventListener.addEventListener("destroy",(()=>{v.isDebounced()&&g()}),{once:!0}),this.scrollable.append(c.container,h.container)}))}}var te=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class ie extends a._{_init(){return te(this,void 0,void 0,(function*(){this.listenerSetter.removeAll(),this.scrollable.container.replaceChildren(),this.container.classList.add("edit-peer-container","edit-group-container"),this.setTitle("Edit");let[e,t,i,n,a,o,h,u]=yield Promise.all([this.managers.appProfileManager.getChatFull(this.chatId,!0),this.managers.appChatsManager.getChat(this.chatId),this.managers.appChatsManager.isBroadcast(this.chatId),this.managers.appChatsManager.isChannel(this.chatId),this.managers.appChatsManager.hasRights(this.chatId,"change_type"),this.managers.appChatsManager.hasRights(this.chatId,"change_permissions"),this.managers.appChatsManager.hasRights(this.chatId,"manage_topics"),this.managers.apiManager.getAppConfig()]);const p={full:[],basic:[]},f=(e,t="basic")=>{p[t].push(e)};this.listenerSetter.add(s.Z)("chat_update",(e=>te(this,void 0,void 0,(function*(){this.chatId===e&&(t=yield this.managers.appChatsManager.getChat(this.chatId),p.basic.forEach((e=>e())))})))),this.listenerSetter.add(s.Z)("chat_full_update",(t=>te(this,void 0,void 0,(function*(){this.chatId===t&&(e=(yield this.managers.appProfileManager.getCachedFullChat(t))||e,p.full.forEach((e=>e())))}))));const m=this.chatId.toPeerId(!0);{const s=new I.Z({noDelimiter:!0,caption:!0}),n=[],c=document.createElement("div");if(c.classList.add("input-wrapper"),this.chatNameInputField=new r.ZP({label:i?"EnterChannelName":"CreateGroup.NameHolder",name:"chat-name",maxLength:255,required:!0}),this.descriptionInputField=new r.ZP({label:"DescriptionPlaceholder",name:"chat-description",maxLength:255}),this.chatNameInputField.setOriginalValue(t.title),this.descriptionInputField.setOriginalValue(e.about),c.append(this.chatNameInputField.container,this.descriptionInputField.container),n.push(this.chatNameInputField,this.descriptionInputField),this.editPeer=new d.Z({peerId:m,inputFields:n,listenerSetter:this.listenerSetter,popupOptions:{isForum:t.pFlags.forum}}),this.content.append(this.editPeer.nextBtn),s.content.append(this.editPeer.avatarEdit.container,c),a){const n=new l.ZP({titleLangKey:i?"ChannelType":"GroupType",clickable:()=>{const t=this.slider.createTab(A);t.chatId=this.chatId,t.chatFull=e,t.open()},icon:"lock",listenerSetter:this.listenerSetter}),a=()=>{let e;const s=(0,Z.Z)(t)[0];e=i?s?"TypePublic":"TypePrivate":s?"TypePublicGroup":"TypePrivateGroup",n.subtitle.replaceChildren((0,b.ag)(e))};a(),f(a),s.content.append(n.container)}if(a||o){const t=new l.ZP({titleLangKey:"Reactions",icon:"reactions",clickable:()=>{const e=this.slider.createTab(ee);e.chatId=this.chatId,e.open()},listenerSetter:this.listenerSetter}),i=(yield this.managers.appReactionsManager.getAvailableReactions()).filter((e=>!e.pFlags.inactive)).length,n=()=>{var s;const n=null!==(s=e.available_reactions)&&void 0!==s?s:{_:"chatReactionsNone"};if("chatReactionsSome"===n._){const e=n.reactions.length;e===i?(0,F.Z)(t.subtitle,(0,b.ag)("ReactionsAll")):t.subtitle.textContent=e+"/"+i}else(0,F.Z)(t.subtitle,(0,b.ag)("chatReactionsAll"===n._?"ReactionsAll":"Checkbox.Disabled"))};n(),f(n,"full"),s.content.append(t.container)}if(o&&!i){const e=["send_stickers","send_polls","send_photos","send_videos","send_roundvideos","send_audios","send_voices","send_docs","send_plain","embed_links","invite_users","pin_messages","change_info"],i=new l.ZP({titleLangKey:"ChannelPermissions",clickable:()=>{const e=this.slider.createTab(q);e.chatId=this.chatId,e.open()},icon:"permissions",listenerSetter:this.listenerSetter}),n=()=>{i.subtitle.textContent=e.reduce(((e,i)=>e+ +(0,N.Z)(t,i,t.default_banned_rights)),0)+"/"+e.length};n(),f(n),s.content.append(i.container)}if(h&&(t.participants_count>=u.forum_upgrade_participants_min||t.pFlags.forum)&&!i){const e=new l.ZP({checkboxField:new L.Z({toggle:!0}),titleLangKey:"Topics",clickable:()=>{},icon:"topics",listenerSetter:this.listenerSetter}),i=()=>{const i=!!t.pFlags.forum;this.editPeer.avatarElem.parentElement.classList.toggle("is-forum",i),e.checkboxField.setValueSilently(i)};this.listenerSetter.add(e.checkboxField.input)("change",(t=>{if(!t.isTrusted)return;const i=this.managers.appChatsManager.toggleForum(this.chatId,e.checkboxField.checked);e.disableWithPromise(i)})),i(),f(i),s.caption.replaceChildren((0,b.ag)("ForumToggleDescription")),s.content.append(e.container)}if(s.caption.classList.toggle("hide",!s.caption.childElementCount),this.scrollable.append(s.container),(0,S.fc)(this.editPeer.nextBtn,(()=>{this.editPeer.nextBtn.disabled=!0;const e=[],t=this.chatId;this.chatNameInputField.isValidToChange()&&e.push(this.managers.appChatsManager.editTitle(t,this.chatNameInputField.value)),this.descriptionInputField.isValidToChange()&&e.push(this.managers.appChatsManager.editAbout(t,this.descriptionInputField.value)),this.editPeer.uploadAvatar&&e.push(this.editPeer.uploadAvatar().then((e=>this.managers.appChatsManager.editPhoto(t,e)))),Promise.race(e).finally((()=>{this.editPeer.nextBtn.removeAttribute("disabled"),this.close()}))}),{listenerSetter:this.listenerSetter}),i&&(yield this.managers.appChatsManager.hasRights(this.chatId,"change_info"))){const e=new L.Z({text:"ChannelSignMessages",checked:!!t.pFlags.signatures});this.listenerSetter.add(e.input)("change",(()=>{const t=e.toggleDisability(!0);this.managers.appChatsManager.toggleSignatures(this.chatId,e.checked).then((()=>{t()}))})),f((()=>{e.setValueSilently(!!t.pFlags.signatures)})),s.content.append((0,l.tG)(e).container)}}if(!i){const t=new I.Z({});if(!i&&a){const i=new L.Z({text:"ChatHistory"});this.listenerSetter.add(i.input)("change",(()=>{const e=i.toggleDisability(!0);this.managers.appChatsManager.togglePreHistoryHidden(this.chatId,!i.checked).then((()=>{e()}))}));const s=()=>{i.setValueSilently(n&&!e.pFlags.hidden_prehistory)};s(),f(s),t.content.append((0,l.tG)(i).container)}t.content.childElementCount&&this.scrollable.append(t.container)}if(yield this.managers.appChatsManager.hasRights(this.chatId,"delete_chat")){const e=new I.Z({}),t=(0,c.Z)("btn-primary btn-transparent danger",{icon:"delete",text:i?"PeerInfo.DeleteChannel":"DeleteAndExitButton"});(0,S.fc)(t,(()=>{k.Z.createPopup(Y.Z,m,void 0,(e=>{const i=(0,C.Z)([t],!0);e.then((()=>{this.close()}),(()=>{i()}))}))}),{listenerSetter:this.listenerSetter}),e.content.append(t),this.scrollable.append(e.container)}n||this.listenerSetter.add(s.Z)("dialog_migrate",(({migrateFrom:e,migrateTo:t})=>{m===e&&(this.chatId=t.toChatId(),this._init())}))}))}init(){return this._init()}}var se=i(8842),ne=i(4240),ae=i(2230),oe=i(5670),re=i(8261),de=i(4993),le=i(730),ce=i(5994),he=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const ue={};class pe extends a._{init(){this.container.classList.add("shared-media-container","profile-container");const e=(0,c.Z)("btn-icon sidebar-close-button",{noRipple:!0});this.closeBtn.replaceWith(e),this.closeBtn=e;const t=document.createElement("div");t.classList.add("animated-close-icon"),e.append(t),this.isFirst&&t.classList.add("state-back");const i=document.createElement("div");i.className="transition slide-fade";const a=document.createElement("div");a.classList.add("transition-item"),this.titleI18n=new b.ZP.IntlElement,this.title.append(this.titleI18n.element),this.editBtn=(0,ae.Z)("edit"),a.append(this.title,this.editBtn);const r=document.createElement("div");r.classList.add("transition-item");const d=this.title.cloneNode();d.append((0,b.ag)("PeerInfo.SharedMedia")),r.append(d),i.append(a,r),this.header.append(i),this.profile=new re.Z(this.managers,this.scrollable,this.listenerSetter),this.profile.init(),this.scrollable.append(this.profile.element),this.scrollable.onAdditionalScroll=()=>{const e=this.searchSuper.nav.getBoundingClientRect();if(!e.width)return;const t=e.top-1;l(t<=56)};const l=e=>{t.classList.toggle("state-back",this.isFirst||e),this.searchSuper.container.classList.toggle("is-full-viewport",e),h(+e),e||this.searchSuper.cleanScrollPositions()},h=(0,o.Z)({content:i,type:"slide-fade",transitionTime:400,isHeavy:!1});h(0),(0,S.fc)(this.closeBtn,(e=>{h.prevId()?(this.scrollable.scrollIntoViewNew({element:this.scrollable.container.firstElementChild,position:"start"}),h(0),this.isFirst||t.classList.remove("state-back")):this.scrollable.isHeavyAnimationInProgress||this.slider.onCloseBtnClick()}),{listenerSetter:this.listenerSetter}),(0,S.fc)(this.editBtn,(()=>he(this,void 0,void 0,(function*(){let e;const{peerId:t,threadId:i}=this;e=i&&(yield this.managers.appPeersManager.isForum(t))?this.slider.createTab(le.Z):t.isAnyChat()?this.slider.createTab(ie):this.slider.createTab(ne.Z),e&&(e instanceof le.Z?e.open(t,this.threadId):(e instanceof ie?e.chatId=t.toChatId():e.peerId=t,e.open()))}))),{listenerSetter:this.listenerSetter}),this.listenerSetter.add(s.Z)("contacts_update",(e=>{this.peerId===e&&this.toggleEditBtn()})),this.listenerSetter.add(s.Z)("chat_update",(e=>{this.peerId===e.toPeerId(!0)&&this.toggleEditBtn()})),this.listenerSetter.add(s.Z)("history_multiappend",(e=>{this.renderNewMessage(e)})),this.listenerSetter.add(s.Z)("history_delete",(({peerId:e,msgs:t})=>{this.deleteDeletedMessages(e,Array.from(t))})),this.listenerSetter.add(s.Z)("message_sent",(({message:e})=>{this.renderNewMessage(e)})),this.searchSuper=new n.Z({mediaTabs:[{inputFilter:"inputMessagesFilterEmpty",name:"PeerMedia.Members",type:"members"},{inputFilter:"inputMessagesFilterPhotoVideo",name:"SharedMediaTab2",type:"media"},{inputFilter:"inputMessagesFilterDocument",name:"SharedFilesTab2",type:"files"},{inputFilter:"inputMessagesFilterUrl",name:"SharedLinksTab2",type:"links"},{inputFilter:"inputMessagesFilterMusic",name:"SharedMusicTab2",type:"music"},{inputFilter:"inputMessagesFilterRoundVoice",name:"SharedVoiceTab2",type:"voice"},{inputFilter:"inputMessagesFilterEmpty",name:"ChatList.Filter.Groups",type:"groups"}],scrollable:this.scrollable,onChangeTab:e=>{const t="members"===e.type&&ce.Z.isAvailable("animations")?250:0;setTimeout((()=>{u.classList.toggle("is-hidden","members"!==e.type)}),t)},managers:this.managers}),this.searchSuper.scrollStartCallback=()=>{l(!0)},this.profile.element.append(this.searchSuper.container);const u=(0,w.Z)({icon:"addmember_filled"});this.content.append(u),(0,S.fc)(u,(()=>he(this,void 0,void 0,(function*(){const e=this.peerId,t=this.peerId.toChatId(),i=yield this.managers.appChatsManager.isChannel(t),s=(t,s)=>{let n,a,o,r,d;if(t.length>1)n="AddMembersAlertTitle",a=[(0,b.ag)("Members",[t.length])],o="AddMembersAlertCountText",r=t.map((e=>{const t=document.createElement("b");return t.append(new se.Z({peerId:e}).element),t})),i||(d=[{text:"AddMembersForwardMessages",checked:!0}]);else{n="AddOneMemberAlertTitle",o="AddMembersAlertNamesText";const e=document.createElement("b");e.append(new se.Z({peerId:t[0]}).element),r=[e],i||(d=[{text:"AddOneMemberForwardMessages",textArgs:[new se.Z({peerId:t[0]}).element],checked:!0}])}r.push(new se.Z({peerId:e}).element),k.Z.createPopup(y.Z,"popup-add-members",{peerId:e,titleLangKey:n,descriptionLangKey:o,descriptionLangArgs:r,buttons:[{langKey:"Add",callback:s}],checkboxes:d}).show()},n=e=>{"USER_PRIVACY_RESTRICTED"===e.type&&(0,m.bC)({langPackKey:"InviteToGroupError"})};if(i){const e=this.slider.createTab(oe.Z);e.open({type:"channel",skippable:!1,takeOut:i=>(s(i,(()=>{const s=this.managers.appChatsManager.inviteToChannel(t,i);s.catch(n),e.attachToPromise(s)})),!1),title:"GroupAddMembers",placeholder:"SendMessageTo"})}else k.Z.createPopup(U.Z,{peerTypes:["contacts"],placeholder:"Search",onSelect:e=>{setTimeout((()=>{s([e],(i=>{this.managers.appChatsManager.addChatUser(t,e,i.size?void 0:0).catch(n)}))}),0)}})}))),{listenerSetter:this.listenerSetter})}_renderNewMessage(e,t){var i;const s=null===(i=ue[e.peerId])||void 0===i?void 0:i[t];if(s)for(const t of this.searchSuper.mediaTabs){const i=t.inputFilter,n=s[i];if(!n)continue;const a=this.searchSuper.filterMessagesByType([e],i).filter((e=>!n.find((t=>t.mid===e.mid&&t.peerId===e.peerId))));a.length&&(n.unshift(...a.map((e=>({mid:e.mid,peerId:e.peerId})))),this.peerId===e.peerId&&-1!==this.searchSuper.usedFromHistory[i]&&(this.searchSuper.usedFromHistory[i]+=a.length,this.searchSuper.performSearchResult(a,t,!1)))}}renderNewMessage(e){return he(this,void 0,void 0,(function*(){if(this.init)return;const{peerId:t}=e,i=yield this.managers.appPeersManager.isForum(t),s=(0,de.Z)(e,i);this._renderNewMessage(e),s&&this._renderNewMessage(e,s)}))}_deleteDeletedMessages(e,t,i){for(const s of i)for(const i of this.searchSuper.mediaTabs){const n=i.inputFilter,a=e[n];if(!a)continue;const o=a.findIndex((e=>e.mid===s));if(-1!==o&&(a.splice(o,1),this.peerId===t)){const e=this.searchSuper.tabs[n].querySelector(`[data-mid="${s}"][data-peer-id="${t}"]`);e&&(this.searchSuper.selection.isSelecting&&this.searchSuper.selection.toggleByElement(e),e.remove()),this.searchSuper.usedFromHistory[n]>=o+1&&--this.searchSuper.usedFromHistory[n]}}}deleteDeletedMessages(e,t){if(this.init)return;const i=ue[e];if(i){for(const s in i)this._deleteDeletedMessages(i[s],e,t);this.scrollable.onScroll()}}cleanupHTML(){return he(this,void 0,void 0,(function*(){const e=this.peerId.isAnyChat(),[t,i]=yield Promise.all([!!e&&this.searchSuper.canViewMembers(),!!e&&this.managers.appChatsManager.hasRights(this.peerId.toChatId(),"invite_users")]);return()=>{this.profile.cleanupHTML(),this.editBtn.classList.add("hide"),this.searchSuper.cleanupHTML(!0),this.container.classList.toggle("can-add-members",t&&i)}}))}setLoadMutex(e){this.searchSuper.loadMutex=e}setPeer(e,t){var i,s,n;return(this.peerId!==e||this.threadId!==t)&&(this.peerId=e,this.threadId=t,this.peerChanged=!0,this.init&&(this.init(),this.init=null),this.searchSuper.setQuery({peerId:e,threadId:t,historyStorage:null!==(s=(n=null!==(i=ue[e])&&void 0!==i?i:ue[e]={})[t])&&void 0!==s?s:n[t]={}}),this.profile.setPeer(e,t),!0)}changeTitleKey(){return he(this,void 0,void 0,(function*(){const e=this.managers.appPeersManager.isForum(this.peerId);return()=>{this.titleI18n.compareAndUpdate({key:this.threadId&&e?"AccDescrTopic":"Profile"})}}))}fillProfileElements(){return he(this,void 0,void 0,(function*(){if(!this.peerChanged)return;this.peerChanged=!1;const e=yield Promise.all([this.cleanupHTML(),this.toggleEditBtn(!0),this.profile.fillProfileElements(),this.changeTitleKey()]);return()=>{e.forEach((e=>{null==e||e()}))}}))}toggleEditBtn(e){return he(this,void 0,void 0,(function*(){let t;if(this.peerId.isUser())t=this.peerId!==s.Z.myId&&(yield this.managers.appUsersManager.isContact(this.peerId.toUserId()));else{const e=this.peerId.toChatId(),i=this.threadId&&(yield this.managers.appChatsManager.isForum(e));t=yield this.managers.appChatsManager.hasRights(e,i?"manage_topics":"change_info")}const i=()=>{this.editBtn.classList.toggle("hide",!t)};return e?i:i()}))}loadSidebarMedia(e,t){this.searchSuper.load(e,t)}onOpenAfterTimeout(){super.onOpenAfterTimeout(),this.scrollable.onScroll()}onCloseAfterTimeout(){super.onCloseAfterTimeout(),this.destroyable&&(this.profile.destroy(),this.searchSuper.destroy())}destroy(){this.destroyable=!0,this.onCloseAfterTimeout()}}},9099:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(5994);const n=e=>{const{element:t,className:i,forwards:a,duration:o,onTransitionEnd:r,onTransitionStart:d,useRafs:l}=e,{timeout:c,raf:h}=t.dataset;if(void 0!==c&&clearTimeout(+c),void 0!==h&&(window.cancelAnimationFrame(+h),l||delete t.dataset.raf),l&&s.Z.isAvailable("animations")&&o)return void(t.dataset.raf=""+window.requestAnimationFrame((()=>{delete t.dataset.raf,n(Object.assign(Object.assign({},e),{useRafs:l-1}))})));a&&i&&t.classList.add(i);const u=()=>{delete t.dataset.timeout,!a&&i&&t.classList.remove("backwards",i),t.classList.remove("animating"),null==r||r()};if(null==d||d(),!s.Z.isAvailable("animations")||!o)return t.classList.remove("animating","backwards"),void u();t.classList.add("animating"),t.classList.toggle("backwards",!a),t.dataset.timeout=""+setTimeout(u,o)},a=n},3552:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l,_:()=>a.Z});var s=i(426),n=i(5824),a=i(6024),o=i(1655),r=i(5953),d=i(3624);class l{constructor(e){var t;this.historyTabIds=[],this.canHideFirst=!1,this.onCloseBtnClick=()=>{n.Z.findItemByType(this.navigationType)?n.Z.back(this.navigationType):this.historyTabIds.length&&this.closeTab(this.historyTabIds[this.historyTabIds.length-1])},this.closeTab=(e,t,i)=>{if(void 0!==e&&this.historyTabIds[this.historyTabIds.length-1]!==e)return this.removeTabFromHistory(e),!1;const s=this.historyTabIds.pop();this.onCloseTab(s,t,i);const n=this.historyTabIds[this.historyTabIds.length-1];return this._selectTab(void 0!==n?n instanceof a.Z?n.container:n:this.canHideFirst?-1:0,t),!0},(0,r.Z)(this,e),null!==(t=this.tabs)&&void 0!==t||(this.tabs=new Map),this.tabsContainer=this.sidebarEl.querySelector(".sidebar-slider"),this._selectTab=(0,s.Z)({content:this.tabsContainer,type:"navigation",transitionTime:250}),this.canHideFirst||this._selectTab(0),this.middlewareHelper=(0,d.k)()}getMiddleware(){return this.middlewareHelper.get()}selectTab(e){var t,i,s,o,r;return i=this,s=void 0,r=function*(){if(this.historyTabIds[this.historyTabIds.length-1]===e)return!1;const i=e instanceof a.Z?e:this.tabs.get(e);return this.onOpenTab&&(yield this.onOpenTab()),i&&(null===(t=i.onOpen)||void 0===t||t.call(i),i.onOpenAfterTimeout&&setTimeout((()=>{i.onOpenAfterTimeout()}),250)),n.Z.pushItem({type:this.navigationType,onPop:e=>(this.closeTab(void 0,e,!0),!0)}),this.historyTabIds.push(e),this._selectTab(e instanceof a.Z?e.container:e),!0},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{d(r.next(e))}catch(e){t(e)}}function a(e){try{d(r.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(n,a)}d((r=r.apply(i,s||[])).next())}))}removeTabFromHistory(e){(0,o.Z)(this.historyTabIds,e),this.onCloseTab(e,void 0)}sliceTabsUntilTab(e,t){for(let i=this.historyTabIds.length-1;i>=0;--i){const s=this.historyTabIds[i];if(s!==t){if(s instanceof e)break;this.removeTabFromHistory(s)}}}getTab(e){return this.historyTabIds.find((t=>t instanceof e))}getHistory(){return this.historyTabIds}isTabExists(e){return!!this.getTab(e)}onCloseTab(e,t,i){var s;i||n.Z.removeByType(this.navigationType,!0);const o=e instanceof a.Z?e:this.tabs.get(e);if(o){try{null===(s=o.onClose)||void 0===s||s.call(o)}catch(e){console.error("tab onClose error",o)}o.onCloseAfterTimeout&&setTimeout((()=>{o.onCloseAfterTimeout()}),280)}}addTab(e){e.container.parentElement||(this.tabsContainer.append(e.container),e.closeBtn&&e.closeBtn.addEventListener("click",this.onCloseBtnClick))}deleteTab(e){this.tabs.delete(e)}createTab(e,t=!0,i){const s=new e(i?void 0:this,t);return s.managers=this.managers,s}}},6024:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c,h:()=>h});var s=i(3241),n=i(3699),a=i(3624),o=i(319),r=i(2325),d=i(2230),l=i(8805);class c{constructor(e,t){this._constructor(e,t)}_constructor(e,t=!0){var i;this.slider=e,this.middlewareHelper=e?e.getMiddleware().create():(0,a.k)(),this.destroyable=t,this.container=document.createElement("div"),this.container.classList.add("tabs-tab","sidebar-slider-item"),this.header=document.createElement("div"),this.header.classList.add("sidebar-header"),this.closeBtn=(0,d.Z)("left sidebar-close-button",{noRipple:!0}),this.title=document.createElement("div"),this.title.classList.add("sidebar-header__title"),this.header.append(this.closeBtn,this.title),this.content=document.createElement("div"),this.content.classList.add("sidebar-content"),this.scrollable=new l.ZP(this.content,void 0,void 0,!0),this.scrollable.attachBorderListeners(this.container),this.container.append(this.header,this.content),null===(i=this.slider)||void 0===i||i.addTab(this),this.listenerSetter=new n.Z}close(){return this.slider.closeTab(this)}open(...e){return t=this,i=void 0,n=function*(){if(this.init)try{const t=this.init(...e);this.init=null,t instanceof Promise&&(yield t)}catch(e){console.error("open tab error",e)}this.slider.selectTab(this)},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n}init(...e){}onOpen(){}onOpenAfterTimeout(){}onClose(){}onCloseAfterTimeout(){var e,t,i;this.destroyable&&(null===(e=this.slider)||void 0===e||e.deleteTab(this),this.container.remove(),this.scrollable.destroy(),null===(t=this.listenerSetter)||void 0===t||t.removeAll(),null===(i=this.middlewareHelper)||void 0===i||i.destroy())}setTitle(e){this.title.replaceChildren((0,r.ag)(e))}}class h extends c{constructor(e){super(e),this.eventListener=new s.Z}onClose(){this.eventListener.dispatchEvent("close")}onCloseAfterTimeout(){const e=this.eventListener.dispatchResultableEvent("destroy");return this.eventListener.dispatchEvent("destroyAfter",Promise.all(e).then(o.Z,o.Z)),this.eventListener.cleanup(),super.onCloseAfterTimeout()}}},2894:(e,t,i)=>{"use strict";i.d(t,{Z:()=>f});var s=i(5005),n=i(8594),a=i(8487),o=i(4484),r=i(5565),d=i(3035),l=i(5345),c=i(5953),h=i(3061),u=i(177),p=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class f extends l.Z{constructor(e){let t;super({getIndex:e.getIndex||(e=>e.id.isAnyChat()?0:this.managers.appUsersManager.getUserStatusForSort(e.id)),onDelete:e=>{e.dom.listEl.remove(),this.onListLengthChange&&this.onListLengthChange()},onUpdate:e.onUpdate||(e=>p(this,void 0,void 0,(function*(){if(e.id.isAnyChat()){const t=yield(0,u.Z)(e.id.toChatId(),this.managers);(0,r.Z)(e.dom.lastMessageSpan,t)}else{const t=(0,h.Z)(yield this.managers.appUsersManager.getUser(e.id));(0,r.Z)(e.dom.lastMessageSpan,t)}}))),onSort:(e,t)=>{const i=e.dom.listEl.parentElement!==this.list;(0,o.Z)(e.dom.listEl,this.list,t),i&&this.onListLengthChange&&this.onListLengthChange()},onElementCreate:e=>{const{dom:t}=s.default.addDialogNew({peerId:e.id,container:!1,avatarSize:this.avatarSize,autonomous:this.autonomous,meAsSaved:!1,rippleEnabled:this.rippleEnabled,wrapOptions:{lazyLoadQueue:this.lazyLoadQueue}});return e.dom=t,e},updateElementWith:d.T2,updateListWith:e=>p(this,void 0,void 0,(function*(){return Array.from(this.elements.values()).some((e=>e.id.isUser()))&&(0,a.Z)(this.list)?(yield(0,n.e9)(),(0,a.Z)(this.list)?void e(!0):e(!1)):e(!1)}))}),this.avatarSize="abitbigger",this.rippleEnabled=!0,this.autonomous=!0,(0,c.Z)(this,e),this.list=s.default.createChatList(this.createChatListOptions);const i=()=>{t=window.setTimeout((()=>{this.updateList((e=>{e&&i()}))}),f.SORT_INTERVAL)};i()}}f.SORT_INTERVAL=3e4},2149:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(9331);const n="stacked-avatars",a=n+"-avatar",o=a+"-container";class r{constructor(e){this.lazyLoadQueue=e.lazyLoadQueue,this.avatarSize=e.avatarSize,this.container=document.createElement("div"),this.container.classList.add(n),this.container.style.setProperty("--avatar-size",e.avatarSize+"px")}render(e,t){const i=this.container.children;(e=e.slice().reverse()).length>3&&(e=e.slice(-3)),e.forEach(((e,n)=>{let r=i[n];r||(r=document.createElement("div"),r.classList.add(o));let d=r.firstElementChild;d||(d=new s.Z,d.classList.add("avatar-"+this.avatarSize,a),d.updateOptions({isDialog:!1,loadPromises:t})),d.updateWithOptions({lazyLoadQueue:this.lazyLoadQueue,peerId:e}),d.parentNode||r.append(d),r.parentNode||this.container.append(r)})),Array.from(i).slice(e.length).forEach((e=>e.remove()))}}},9259:(e,t,i)=>{"use strict";i.d(t,{Z:()=>E});var s=i(5432),n=i(3910),a=i(2738),o=i(5975),r=i(8497),d=i(8204),l=i(9405),c=i(3624),h=i(3035),u=i(5418),p=i(241),f=i(13),m=i(8115),g=i(5400),v=i(1447),b=i(3772),y=i(3512),w=i(5814),S=i(9099),C=i(3541),L=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};let I=!1;function E({listenTo:e,listenerSetter:t,selector:i,findTarget:E}){if(s.Z)return;const P=(t,s)=>{let n;if(E)n=E(t);else{const e=i||".media-sticker-wrapper";n=t.target.closest(e)}return!n||s&&!(0,o.Z)(n,e)?void 0:n},Z=y.Z.managers;t.add(e)("mousedown",(e=>{if(I||e.buttons>1||0!==e.button)return;let t=P(e);if(!t)return;const i=t.dataset.docId;if(!i)return;const s="sticker-viewer",y="STICKER-VIEWER",E=w.Z.getOnlyOnePlayableGroup(),M=(0,c.k)();let T,k;const x=({mediaContainer:e,doc:t,middleware:i,lockGroups:n,isSwitching:o})=>L(this,void 0,void 0,(function*(){const c=(0,f.Z)(t),S=e.getBoundingClientRect(),L=(0,l.C)(t.w,t.h),I=c?280:360,E=(0,l.C)(I,I),P=S.width===S.height?E:L.aspectFitted(E),M=(0,r.Z)(e,"bubble"),k=!M||M.classList.contains("is-out"),x=document.createElement("div");x.classList.add(s+"-transformer");const A=document.createElement("div");A.classList.add(s+"-sticker"),A.style.width=P.width+"px",A.style.height=P.height+"px";const _=document.createElement("div");if(_.classList.add(s+"-emoji"),_.append((0,m.Z)(t.stickerEmojiRaw)),c){const e=(I*C.Vp-I)/3*(k?1:-1);x.classList.add("has-effect"),x.style.setProperty("--translateX",`${e}px`),_.style.setProperty("--translateX",-e+"px")}const F=(0,r.Z)(e,"scrollable"),D=(0,d.Z)(e,F,!0,S);(D.overflow.vertical||D.overflow.horizontal)&&A.classList.add("is-overflow");const R=e.getBoundingClientRect(),B=R.width/P.width,N=R.height/P.height,O=R.left-(p.Z.width-R.width)/2,U=R.top-(p.Z.height-R.height)/2;x.style.transform=`translate(${O}px, ${U}px) scale(${B}, ${N})`,o&&x.classList.add("is-switching"),x.append(A,_),T.append(x);const H=yield(0,C.ZP)({doc:t,div:A,group:y,width:P.width,height:P.height,play:!1,loop:!0,middleware:i,managers:Z,needFadeIn:!1,isOut:k,withThumb:!1,relativeEffect:!0,loopEffect:!0}).then((({render:e})=>e));if(!i())return;T.parentElement||document.body.append(T);const z=Array.isArray(H)?H[0]:H,j=z instanceof b.Z?new Promise((e=>z.addEventListener("firstFrame",e,{once:!0}))):Promise.resolve();if(yield Promise.all([j,(0,h.d1)()]),yield(0,u.Z)(0),i()){if(n&&(w.Z.setOnlyOnePlayableGroup(y),w.Z.checkAnimations2(!0)),z instanceof b.Z){const t=e instanceof g.LD?e.player:v.Z.getAnimation(e);if(t){if(z.curFrame=t.curFrame,z.play(),yield new Promise((e=>{let t=0;const i=()=>{2==++t&&(e(),z.removeEventListener("enterFrame",i))};z.addEventListener("enterFrame",i)})),!i())return;z.pause()}}else if(z instanceof HTMLVideoElement){const t=e.querySelector("video");t&&(z.currentTime=t.currentTime)}return{ready:()=>{(z instanceof b.Z||z instanceof HTMLVideoElement)&&z.play(),c&&(0,a.tH)(A)},transformer:x}}})),A=window.setTimeout((()=>L(this,void 0,void 0,(function*(){document.removeEventListener("mousemove",F),T=document.createElement("div"),T.classList.add(s),I=!0;const e=M.get(),n=yield Z.appDocsManager.getDoc(i);if(!e())return;let a;try{if(a=yield x({doc:n,mediaContainer:t,middleware:e,lockGroups:!0}),!a)return}catch(e){return}const{ready:o,transformer:r}=a;k=r,(0,S.Z)({element:T,className:"is-visible",forwards:!0,duration:200,onTransitionEnd:()=>{e()&&o()}}),document.addEventListener("mousemove",_)}))),125),_=e=>L(this,void 0,void 0,(function*(){const i=P(e,!0);if(!i||t===i)return;const s=i.dataset.docId;if(!s)return;t=i,M.clean();const n=M.get(),a=yield Z.appDocsManager.getDoc(s);if(!n())return;let o;try{if(o=yield x({doc:a,mediaContainer:t,middleware:n,isSwitching:!0}),!o)return}catch(e){return void console.error("sticker viewer error",e)}const{ready:r,transformer:d}=o,l=k;(0,S.Z)({element:l,className:"is-switching",forwards:!0,duration:200,onTransitionEnd:()=>{l.remove()}}),k=d,(0,S.Z)({element:d,className:"is-switching",forwards:!1,duration:200,onTransitionEnd:()=>{n()&&r()}})})),F=e=>{(0,o.Z)(e.target,t)||D()},D=()=>{clearTimeout(A),M.clean(),T&&((0,S.Z)({element:T,className:"is-visible",forwards:!1,duration:200,onTransitionEnd:()=>{T.remove(),w.Z.setOnlyOnePlayableGroup(E),w.Z.checkAnimations2(!1),I=!1}}),(0,a.fc)(document.body,n.Z,{capture:!0,once:!0})),document.removeEventListener("mousemove",F),document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",D,{capture:!0})};document.addEventListener("mousemove",F),document.addEventListener("mouseup",D,{once:!0,capture:!0})}))}},5117:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});class s{constructor(e,t){this.container=e,this.handler=t,this.observeHeaders(),this.observeElements()}observeHeaders(){this.headersObserver=new IntersectionObserver((e=>{for(const t of e){const e=t.boundingClientRect,i=t.target.parentElement,s=t.rootBounds;e.bottom=s.top&&e.bottom{const t=e.filter((e=>e.boundingClientRect.tope.boundingClientRect.top-t.boundingClientRect.top))[0];if(!t)return;const i=t.isIntersecting?t.target:t.target.nextElementSibling;this.handler(!0,i)}),{root:this.container})}addSentinel(e,t){const i=document.createElement("div");return i.classList.add("sticky_sentinel",t),e.appendChild(i)}observeStickyHeaderChanges(e){const t=this.addSentinel(e,"sticky_sentinel--top");this.headersObserver.observe(t),this.elementsObserver.observe(e)}disconnect(){this.headersObserver.disconnect(),this.elementsObserver.disconnect()}unobserve(e,t){this.elementsObserver.unobserve(e),this.headersObserver.unobserve(t)}}},3757:(e,t,i)=>{"use strict";i.d(t,{Z:()=>I});var s=i(3910),n=i(5432),a=i(5953),o=i(3416),r=i(3699),d=i(6976),l=i(5418),c=i(3725),h=i(3228),u=i(5701),p=i(5003),f=i(3444),m=i(241);const g=e=>"touches"in e?e.touches[0]:e;function v(e,t){return t?Math.hypot(t.pageX-e.pageX,t.pageY-e.pageY):0}function b(e,t){return{x:(e.pageX+t.pageX)/2,y:(e.pageY+t.pageY)/2}}const y=document;let w=!1;o.Z.addEventListener("toggle",(e=>{w=e}));const S={passive:!1},C=!1,L={capture:!0,passive:!1};class I{constructor(e){var t,i,o,d,m;this.reset=e=>{var t,i,s;this.log("reset"),n.Z?this.listenerSetter.removeManual(y,"touchmove",this.handleMove,S):(this.listenerSetter.removeManual(y,"mousemove",this.handleMove,C),this.setCursorTo.style.cursor=""),this.hadMove&&(null===(t=this.onReset)||void 0===t||t.call(this,e)),null===(i=this.releaseWheelDrag)||void 0===i||i.clearTimeout(),null===(s=this.releaseWheelZoom)||void 0===s||s.clearTimeout(),this.resetValues()},this.handleStart=e=>{return t=this,i=void 0,o=function*(){var t,i;if(this.log("start"),this.isMouseDown){const t=e.touches;return void(2===(null==t?void 0:t.length)&&(this.initialDistance=v(t[0],t[1]),this.initialTouchCenter=b(t[0],t[1])))}const a=g(e);if(![0,1].includes(Math.max(0,null!==(t=a.button)&&void 0!==t?t:0)))return;if(1===a.button&&(0,s.Z)(e),(0,f.Z)(e))return;const o=++this.tempId,r=null===(i=this.verifyTouchTarget)||void 0===i?void 0:i.call(this,e);if(void 0!==r){let e;if(r instanceof Promise){if(e=yield r,this.tempId!==o)return}else e=r;if(!e)return this.reset()}if(this.isMouseDown=!0,this.withDelay&&!n.Z){const e=Object.assign(Object.assign({},C),{once:!0}),t=(0,c.Z)(),i=()=>t.resolve(),s=this.listenerSetter.add(y)("mousemove",i,e);if(yield Promise.race([(0,l.Z)(300),t]),t.resolve(),this.listenerSetter.remove(s),this.tempId!==o)return}this.xDown=a.clientX,this.yDown=a.clientY,this.eventUp=a,n.Z?this.listenerSetter.add(y)("touchmove",this.handleMove,S):this.listenerSetter.add(y)("mousemove",this.handleMove,C),this.onStart&&(this.onStart(),this.hadMove=!0,this.handleMove(a))},new((a=void 0)||(a=Promise))((function(e,s){function n(e){try{d(o.next(e))}catch(e){s(e)}}function r(e){try{d(o.throw(e))}catch(e){s(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(n,r)}d((o=o.apply(t,i||[])).next())}));var t,i,a,o},this.handleMove=e=>{var t,i;if(void 0===this.xDown||void 0===this.yDown||w)return void this.reset();if(this.cancelEvent&&(0,s.Z)(e),(null===(t=this.releaseWheelDrag)||void 0===t?void 0:t.isDebounced())||(null===(i=this.releaseWheelZoom)||void 0===i?void 0:i.isDebounced()))return;this.log("move");const n=this.eventUp=g(e),a=n.clientX,o=n.clientY,r=a-this.xDown+this.xAdded,d=o-this.yDown+this.yAdded;if(!this.hadMove){if(!r&&!d)return;this.setHadMove(e)}const l=e.touches;if(this.onZoom&&this.initialDistance>0&&2===l.length){const e=v(l[0],l[1]),t=b(l[0],l[1]),i=t.x-this.initialTouchCenter.x,s=t.y-this.initialTouchCenter.y,n={zoomFactor:e/this.initialDistance,initialCenterX:this.initialTouchCenter.x,initialCenterY:this.initialTouchCenter.y,dragOffsetX:i,dragOffsetY:s,currentCenterX:t.x,currentCenterY:t.y};this.onZoom(n)}this.dispatchOnSwipe(r,d,e)},this.handleWheel=e=>{var t;if(!this.hadMove&&this.verifyTouchTarget){const t=this.verifyTouchTarget(e);if(void 0!==t&&!t)return void this.reset(e)}if((0,s.Z)(e),this.log("wheel"),this.onDoubleClick&&Object.is(e.deltaX,-0)&&Object.is(e.deltaY,-0)&&e.ctrlKey)return this.onWheelCapture(e),this.onDoubleClick({centerX:e.pageX,centerY:e.pageY}),void this.reset();e.metaKey||e.ctrlKey||e.shiftKey?((null===(t=this.releaseWheelDrag)||void 0===t?void 0:t.isDebounced())&&this.reset(),this.onWheelZoom(e)):this.handleWheelDrag(e)},this.handleWheelDrag=e=>{this.log("wheel drag"),this.onWheelCapture(e),this.isDragCanceled.x&&Math.sign(this.initialDragOffset.x)!==Math.sign(e.deltaX)||(this.initialDragOffset.x-=e.deltaX),this.isDragCanceled.y&&Math.sign(this.initialDragOffset.y)!==Math.sign(e.deltaY)||(this.initialDragOffset.y-=e.deltaY);const{x:t,y:i}=this.initialDragOffset;this.releaseWheelDrag(e),this.dispatchOnSwipe(t,i,e,((e,t)=>{this.isDragCanceled={x:e,y:t}}))},this.onWheelCapture=e=>{this.hadMove||(this.log("wheel capture"),this.handleStart(e),this.setHadMove(e),this.initialTouchCenter={x:e.x,y:e.y})},this.onWheelZoom=e=>{if(!this.onZoom)return;this.log("wheel zoom"),this.onWheelCapture(e);const t=e.x-this.initialTouchCenter.x,i=e.y-this.initialTouchCenter.y,s=(0,h.Z)(e.deltaY,-25,25);this.wheelZoom-=.01*s;const n={zoomAdd:this.wheelZoom-1,initialCenterX:this.initialTouchCenter.x,initialCenterY:this.initialTouchCenter.y,dragOffsetX:t,dragOffsetY:i,currentCenterX:e.x,currentCenterY:e.y};this.onZoom(n),this.releaseWheelZoom(e)},(0,a.Z)(this,e),this.log=(0,p.kg)("SWIPE-HANDLER"),null!==(t=this.cursor)&&void 0!==t||(this.cursor="grabbing"),null!==(i=this.cancelEvent)&&void 0!==i||(this.cancelEvent=!0),null!==(o=this.listenerOptions)&&void 0!==o||(this.listenerOptions=S),null!==(d=this.setCursorTo)&&void 0!==d||(this.setCursorTo=this.element),this.listenerSetter=new r.Z,this.setListeners(),this.resetValues(),this.tempId=0,null===(m=e.middleware)||void 0===m||m.onDestroy((()=>{this.reset(),this.removeListeners()})),this.releaseWheelDrag=(0,u.Z)(this.reset,150,!1),this.releaseWheelZoom=(0,u.Z)(this.reset,150,!1)}setListeners(){n.Z?(this.withDelay?(0,d.E)({element:this.element,callback:e=>{(0,s.Z)(e),this.handleStart(e)},listenerSetter:this.listenerSetter,listenerOptions:this.listenerOptions}):this.listenerSetter.add(this.element)("touchstart",this.handleStart,this.listenerOptions),this.onDoubleClick&&this.listenerSetter.add(this.element)("dblclick",(e=>{this.onDoubleClick({centerX:e.pageX,centerY:e.pageY})})),this.listenerSetter.add(y)("touchend",this.reset)):(this.listenerSetter.add(this.element)("mousedown",this.handleStart,this.listenerOptions),this.listenerSetter.add(y)("mouseup",this.reset),(this.onZoom||this.onDoubleClick)&&this.listenerSetter.add(this.element)("wheel",this.handleWheel,L))}removeListeners(){this.log("remove listeners"),this.reset(),this.listenerSetter.removeAll()}setCursor(e=""){this.cursor=e,!n.Z&&this.hadMove&&this.setCursorTo.style.setProperty("cursor",this.cursor,"important")}add(e,t){this.xAdded=e,this.yAdded=t,this.handleMove({clientX:this.eventUp.clientX,clientY:this.eventUp.clientY,target:this.eventUp.target})}resetValues(){++this.tempId,this.hadMove=!1,this.xAdded=this.yAdded=0,this.xDown=this.yDown=this.eventUp=this.isMouseDown=void 0,this.onZoom&&(this.initialDistance=0,this.initialTouchCenter={x:m.Z.width/2,y:m.Z.height/2},this.initialDragOffset={x:0,y:0},this.isDragCanceled={x:!1,y:!1},this.wheelZoom=1)}setHadMove(e){var t;this.hadMove||(this.log("had move"),this.hadMove=!0,this.setCursorTo.style.setProperty("cursor",this.cursor,"important"),null===(t=this.onFirstSwipe)||void 0===t||t.call(this,e))}dispatchOnSwipe(...e){const t=this.onSwipe(...e);void 0!==t&&t&&this.reset()}}},709:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(2398),n=i(6272),a=i(4762),o=i(503);class r extends o.ZP{constructor(e={}){super(Object.assign({label:"Contacts.PhoneNumber.Placeholder",name:"phone"},e)),this.pasted=!1,this.lastValue="",this.container.classList.add("input-field-phone");const t=this.input;if(t instanceof HTMLInputElement)t.type="tel",t.autocomplete="rr55RandomRR55";else{t.inputMode="decimal";const e=window.devicePixelRatio;if(e>1){let i;a.IS_APPLE?i=-.16*e:a.IS_ANDROID&&(i=0),t.style.setProperty("--letter-spacing",i+"px")}const i=this.setValueSilently.bind(this);this.setValueSilently=e=>{i(e),(0,s.Z)(this.input,!0)}}t.addEventListener("input",(()=>{t.classList.remove("error");const i=this.value;let s;Math.abs(i.length-this.lastValue.length)>1&&!this.pasted&&a.IS_APPLE_MOBILE&&this.setValueSilently(this.lastValue+i),this.pasted=!1,this.setLabel();let o,r,d,l="";"+"===this.value.replace(/\++/,"+")?this.setValueSilently("+"):(s=(0,n.u)(this.value),o=s.formatted,r=s.country,l=s.leftPattern,d=s.code,this.setValueSilently(this.lastValue=o?"+"+o:"")),t.dataset.leftPattern=l,e.onInput&&e.onInput(s)})),t.addEventListener("paste",(()=>{this.pasted=!0})),t.addEventListener("keypress",(e=>{const t=e.key;if(/\D/.test(t)&&!e.metaKey&&!e.ctrlKey&&"Backspace"!==t&&("+"!==t||!e.shiftKey))return e.preventDefault(),!1}))}}},1439:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(3241);const n=new WeakMap;window.addEventListener("message",(e=>{const t=n.get(e.source);t&&t(JSON.parse(e.data))}));class a extends s.Z{constructor({url:e,sandbox:t}){super(!1),this.onTelegramWebViewEvent=({eventType:e,eventData:t})=>{""===t&&(t=void 0),console.log("onTelegramWebViewEvent",e,t),this.dispatchEvent(e,t)};const i=this.iframe=document.createElement("iframe");i.src=e,t&&i.setAttribute("sandbox",t)}onMount(){n.set(this.iframe.contentWindow,this.onTelegramWebViewEvent)}destroy(){this.cleanup(),n.delete(this.iframe.contentWindow)}}},2796:(e,t,i)=>{"use strict";i.d(t,{Am:()=>c,PE:()=>l,bC:()=>h});var s=i(5565),n=i(2296),a=i(2325);const o=document.createElement("div");let r;o.classList.add("toast");const d=new n.Z("toast");function l(){d.close(),o.classList.remove("is-visible"),r&&clearTimeout(+r),r=window.setTimeout((()=>{o.remove(),r=void 0}),200)}function c(e,t){d.close(),(0,s.Z)(o,e),o.parentElement||(document.body.append(o),o.offsetLeft),o.classList.add("is-visible"),r&&clearTimeout(+r),d.open(o),r=window.setTimeout(l,3e3),t&&d.addEventListener("toggle",t,{once:!0})}function h(e){c((0,a.ag)(e.langPackKey,e.langPackArguments),e.onClose)}d.addEventListener("toggle",(e=>{e||l()}))},426:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var s=i(3725),n=i(8594),a=i(2648),o=i(3910),r=i(5994);const d={navigation:{callback:(e,t,i)=>{const s=t.getBoundingClientRect().width,n=[e,t];return i&&n.reverse(),n[0].style.filter="brightness(80%)",n[0].style.transform=`translate3d(${.25*-s}px, 0, 0)`,n[1].style.transform=`translate3d(${s}px, 0, 0)`,e.classList.add("active"),e.offsetWidth,e.style.transform="",e.style.filter="",()=>{t.style.transform=t.style.filter=""}},animateFirst:!1},tabs:{callback:(e,t,i)=>{const s=t.getBoundingClientRect().width,n=[e,t];return i&&n.reverse(),n[0].style.transform=`translate3d(${-s}px, 0, 0)`,n[1].style.transform=`translate3d(${s}px, 0, 0)`,e.classList.add("active"),e.offsetWidth,e.style.transform="",()=>{t.style.transform=""}},animateFirst:!1}},l=e=>{let{content:t,type:i,transitionTime:l,onTransitionEnd:c,isHeavy:h=!0,once:u=!1,withAnimationListener:p=!0,listenerSetter:f,animateFirst:m=!1}=e;const{callback:g,animateFirst:v}=d[i]||{};t.dataset.animation=i,void 0!==v&&(m=v);const b=new Map;let y,w=null;if(p){const e=g?"transitionend":"animationend",i=s=>{if((0,o.Z)(s),s.target.parentElement!==t)return;const n=b.get(s.target);null==n||n(),s.target===w&&(!y&&h||(y&&(y.resolve(),y=void 0),null==c||c(S.prevId()),t.classList.remove("animating","backwards","disable-hover"),u&&(f?f.removeManual(t,e,i):t.removeEventListener(e,i),w=y=void 0,b.clear())))};f?f.add(t)(e,i):t.addEventListener(e,i)}function S(e,i=!0,o){o&&(w=o),e instanceof HTMLElement&&(e=(0,a.Z)(e));const d=S.prevId();if(e===d)return!1;const u=t.children[e];if(r.Z.isAvailable("animations")&&(-1!==d||m)||(i=!1),!p){const e=t.dataset.timeout;void 0!==e&&clearTimeout(+e),delete t.dataset.timeout}if(!i){if(w)w.classList.remove("active","to","from");else if(u){const e=b.get(u);null==e||e()}return u&&(u.classList.remove("to","from"),u.classList.add("active")),t.classList.remove("animating","backwards","disable-hover"),w=u,void(null==c||c(e))}p||(t.dataset.timeout=""+window.setTimeout((()=>{u.classList.remove("to"),w&&w.classList.remove("from"),t.classList.remove("animating","backwards","disable-hover"),delete t.dataset.timeout}),l)),w&&(w.classList.remove("to"),w.classList.add("from")),t.classList.add("animating");const f=d{u.classList.remove("to"),b.delete(u)}))}if(w){let e;const t=w,i=()=>{clearTimeout(e),t.classList.remove("active","from"),null==v||v(),b.delete(t)};u?(e=window.setTimeout(i,l+100),b.set(t,i)):(e=window.setTimeout(i,l),b.set(t,(()=>{clearTimeout(e),b.delete(t)}))),t.dataset.transitionTimeout=""+e,h&&(y||(y=(0,s.Z)()),(0,n.YW)(y,2*l))}w=u}return S.prevId=()=>w?(0,a.Z)(w):-1,S.getFrom=()=>w,S.setFrom=e=>w=e,S}},6726:(e,t,i)=>{"use strict";i.d(t,{l:()=>o});var s=i(5701),n=i(503);function a(e){return(e.length>=3&&e.length<=32||!e.length)&&/^[a-zA-Z0-9_]*$/.test(e)}class o extends n.ZP{constructor(e,t){super(e),this.managers=t,this.checkUsernameDebounced=(0,s.Z)(this.checkUsername.bind(this),150,!1,!0),e.listenerSetter.add(this.input)("input",(()=>{var e,t,i,s;const o=this.getValue();if(this.error=void 0,o===this.originalValue||!o.length)return this.setState(n.I1.Neutral),void(null===(t=(e=this.options).onChange)||void 0===t||t.call(e));a(o)?this.setState(n.I1.Neutral):this.setError(this.options.invalidText),this.input.classList.contains("error")?null===(s=(i=this.options).onChange)||void 0===s||s.call(i):this.checkUsernameDebounced(o)}))}getValue(){let e=this.value;return this.options.head&&(e=e.slice(this.options.head.length),this.setValueSilently(this.options.head+e)),e}checkUsername(e){if(this.checkUsernamePromise)return;let t;this.error=void 0,t=this.options.peerId?this.managers.appChatsManager.checkUsername(this.options.peerId.toChatId(),e):this.managers.appUsersManager.checkUsername(e);const i=this.checkUsernamePromise=t.then((t=>{this.getValue()===e&&(t?this.setState(n.I1.Valid,this.options.availableText):this.setError(this.options.takenText))}),(t=>{this.getValue()===e&&(this.error=t,"USERNAME_PURCHASE_AVAILABLE"===t.type?this.setError(this.options.takenText):this.setError(this.options.invalidText))})).then((()=>{var t,s;this.checkUsernamePromise===i&&(this.checkUsernamePromise=void 0),null===(s=(t=this.options).onChange)||void 0===s||s.call(t);const n=this.getValue();n!==e&&this.isValidToChange()&&a(n)&&this.checkUsername(n)}))}}},9522:(e,t,i)=>{"use strict";i.d(t,{Z:()=>g});var s=i(2738),n=i(5975),a=i(2398),o=i(4484),r=i(2914),d=i(319),l=i(5345),c=i(2325),h=i(3512),u=i(5592),p=i(7479),f=i(5029),m=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class g extends f.Z{constructor(e){super({name:"UsernamesProfileHeader",caption:e.peerId.isUser()?"UsernamesProfileHelp":"UsernamesChannelHelp"});const{peerId:t,peer:i,usernameInputField:f,listenerSetter:g,middleware:v}=e,b=h.Z.managers,y=t.isUser()?void 0:t.toChatId(),w=this,S="usernames",C=document.createElement("div");let L;C.classList.add(S);const I=new l.Z({getIndex:e=>L.length-L.findIndex((t=>t.username===e.id)),onDelete:e=>{e.row.container.remove()},onSort:(e,t)=>{(0,o.Z)(e.row.container,C,t)},onElementCreate:e=>{const t=L.find((t=>t.username===e.id)),i=new p.ZP({title:"@"+t.username,subtitle:!0,clickable:!0}),s=!!t.pFlags.editable,n=!!t.pFlags.active;return s&&(i.container.dataset.editable="1"),i.container.dataset.username=t.username,i.container.classList.add(S+"-username"),i.subtitle.classList.add(S+"-username-status"),i.createMedia("medium").classList.add(S+"-username-icon","tgico"),i.makeSortable(),E(i,n),e.row=i,e}}),E=(e,t)=>{e.subtitle.replaceChildren((0,c.ag)(e.container.dataset.editable?"UsernameLinkEditable":t?"UsernameLinkActive":"UsernameLinkInactive")),e.container.classList.toggle("active",t),e.toggleSorting(t)},P=(e=[])=>{L=e,I.getAll().forEach((t=>{e.some((e=>e.username===t.id))||I.delete(t.id)})),e.forEach((e=>{if(I.has(e.username)){const t=I.get(e.username);I.update(e.username,t),E(t.row,!!e.pFlags.active)}else I.add(e.username)})),w.container.classList.toggle("hide",!I.getAll().size)};P(i.usernames),g.add(h.Z)("peer_title_edit",(({peerId:e})=>m(this,void 0,void 0,(function*(){if(e!==t)return;const i=yield b.appPeersManager.getPeer(t);P(i.usernames)}))));let Z=!1;(0,s.fc)(C,(e=>m(this,void 0,void 0,(function*(){if(Z)return void(Z=!1);const t=(0,n.Z)(e.target,C);if(!t)return;if(t.dataset.editable)return void(0,a.Z)(f.input,!0,!0);const i=t.dataset.username,s=t.classList.contains("active");let o,r;s?(o="UsernameDeactivateLink",r=y?"UsernameDeactivateLinkChannelMessage":"UsernameDeactivateLinkProfileMessage"):(o="UsernameActivateLink",r=y?"UsernameActivateLinkChannelMessage":"UsernameActivateLinkProfileMessage");try{yield(0,u.Z)({titleLangKey:o,descriptionLangKey:r,button:{langKey:s?"Hide":"Show"}})}catch(e){return}const l=!s;let c;c=y?b.appChatsManager.toggleUsername(y,i,l):b.appUsersManager.toggleUsername(i,l),c.catch((e=>{"USERNAMES_ACTIVE_TOO_MUCH"===e.type?(0,u.Z)({titleLangKey:"UsernameActivateErrorTitle",descriptionLangKey:"UsernameActivateErrorMessage",button:{langKey:"OK",isCancel:!0}}).catch(d.Z):console.error("turn username error",e)}))})))),new r.Z({list:C,middleware:v,onSort:(e,t)=>{const i=L.splice(e,1)[0];L.splice(t,0,i),I.updateList();const s=L.filter((e=>e.pFlags.active)).map((e=>e.username));y?b.appChatsManager.reorderUsernames(y,s):b.appUsersManager.reorderUsernames(s)}}),w.content.append(C)}}},2940:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});class s{constructor(e,t){this.items=new Map,this.locked=!1,this.observer=new IntersectionObserver((t=>{if(this.locked)return;const i=[];t.forEach(((e,t)=>{const s=e.target;if(this.items.get(s)===e.isIntersecting)return;this.items.set(s,e.isIntersecting);const n={target:s,visible:e.isIntersecting,entry:e,index:t};i.push(n)})),i.forEach((t=>{e(t)}))}),t)}getVisible(){const e=[];return this.items.forEach(((t,i)=>{t&&e.push(i)})),e}clearVisible(){const e=this.getVisible();for(const t of e)this.items.set(t,!1)}isVisible(e){return this.items.get(e)}disconnect(){this.observer.disconnect(),this.items.clear()}refresh(){this.observer.disconnect();const e=[...this.items.keys()];for(const t of e)this.observer.observe(t)}refreshVisible(){const e=this.getVisible();for(const t of e)this.observer.unobserve(t);for(const t of e)this.observer.observe(t)}observe(e){this.items.set(e,!1),this.observer.observe(e)}unobserve(e){this.observer.unobserve(e),this.items.delete(e)}unlock(){this.locked=!1}unlockAndRefresh(){this.unlock(),this.refresh()}lock(){this.locked=!0}}},8427:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(3910),n=i(2738),a=i(3013),o=i(65);class r extends o.Z{constructor(e,t=!1){super({step:.01,min:0,max:1,vertical:t},1),this.listenerSetter=e,this.vertical=t,this.onMuteClick=e=>{e&&(0,s.Z)(e),a.Z.muted=!a.Z.muted},this.setVolume=()=>{const{volume:e,muted:t}=a.Z;let i;i=!e||t?0:e>.5?3:e>0&&e<.25?1:2,r.ICONS.forEach((e=>this.icon.classList.remove("tgico-"+e))),this.icon.classList.add("tgico-"+r.ICONS[i]),this.mousedown||this.setProgress(t?0:e)},this.setListeners(),this.setHandlers({onScrub:e=>{const t=Math.max(Math.min(e,1),0);a.Z.muted=!1,a.Z.volume=t}});const i="player-volume",o=this.btn=document.createElement("div");o.classList.add("btn-icon",i);const d=this.icon=document.createElement("span");d.classList.add(i+"__icon"),o.append(d,this.container),(0,n.fc)(d,this.onMuteClick,{listenerSetter:this.listenerSetter}),this.listenerSetter.add(a.Z)("playbackParams",this.setVolume),this.setVolume()}}r.ICONS=["volume_off","volume_mute","volume_down","volume_up"]},9083:(e,t,i)=>{"use strict";i.d(t,{N:()=>a,Z:()=>n});var s=i(5400);function n({docIds:e,loadPromises:t,middleware:i,lazyLoadQueue:n,customEmojiSize:a,animationGroup:o}){const r=" ".repeat(e.length),d=[];return e.forEach(((e,t)=>{d.push({_:"messageEntityCustomEmoji",offset:t,length:1,document_id:e})})),(0,s.ZP)(r,{entities:d,loadPromises:t,animationGroup:o,customEmojiSize:a,middleware:i,lazyLoadQueue:n})}function a(e){var t;const i=null!==(t=e.loadPromises)&&void 0!==t?t:e.loadPromises=[],s=n(e);return Promise.all(i).then((()=>s))}},296:(e,t,i)=>{"use strict";i.d(t,{Z:()=>P});var s=i(2341),n=i(467),a=i(632),o=i(2738),r=i(8497),d=i(4081),l=i(5994),c=i(319),h=i(2312),u=i(7030),p=i(1243),f=i(9687),m=i(2325),g=i(1507),v=i(2491),b=i(3512),y=i(8448),w=i(3251),S=i(3442),C=i(9492),L=i(5671),I=i(1604),E=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function P({message:e,withTime:t,fontWeight:i,voiceAsMusic:P,showSender:Z,searchContext:M,loadPromises:T,autoDownloadSize:k,lazyLoadQueue:x,sizeType:A,managers:_=b.Z.managers,cacheContext:F,fontSize:D,getSize:R,canTranscribeVoice:B}){var N;return E(this,void 0,void 0,(function*(){null!=i||(i=500),null!=A||(A=""),null!=D||(D=16);const b=0===k,O=e.media.document||e.media.webpage.document,U=null==e?void 0:e.uploadingFileName;if("audio"===O.type||"voice"===O.type||"round"===O.type){const s=new y.ZP;return s.withTime=t,s.message=e,s.noAutoDownload=b,s.lazyLoadQueue=x,s.loadPromises=T,B&&"voice"===O.type&&(s.transcriptionState=0),s.getSize=R,P&&(s.voiceAsMusic=P),M&&(s.searchContext=M),Z&&(s.showSender=Z),s.dataset.fontWeight=""+i,s.dataset.fontSize=""+D,s.dataset.sizeType=A,yield s.render(),s}const H=O.file_name?O.file_name.split("."):"";let z="";z=H.length>1&&Array.isArray(H)?(0,n.ST)(H.pop().split(" ",1)[0].toLowerCase()):"file";const j=document.createElement("div");j.classList.add("document",`ext-${z}`),j.dataset.docId=""+O.id,j.doc=O;const G=document.createElement("div");let V;G.classList.add("document-ico");const K=!!F,W=()=>K?F:_.thumbsStorage.getCacheContext(O);F=yield W();let $=!1;if((null===(N=O.thumbs)||void 0===N?void 0:N.length)||e.pFlags.is_outgoing&&F.url&&"photo"===O.type){j.classList.add("document-with-thumb"),$=!0;const t=[];if(e.pFlags.is_outgoing&&["photo","video"].includes(O.type)&&F.url)G.innerHTML=``,t.push(G.firstElementChild);else{performance.now();const e=yield(0,C.Z)({photo:O,message:null,container:G,boxWidth:54,boxHeight:54,loadPromises:T,withoutPreloader:!0,lazyLoadQueue:x,size:(0,f.Z)(O,54,54,!0),managers:_});G.style.width=G.style.height="",e.images.thumb&&t.push(e.images.thumb),e.images.full&&t.push(e.images.full)}t.forEach((e=>e.classList.add("document-thumb")))}else V=document.createElement("span"),V.classList.add("document-ico-text"),V.innerText=z,G.append(V);const q=O.file_name?(0,v.Z)(O.file_name):"Unknown.file";document.createElement("div").classList.add("document-description");const Y=document.createElement("span"),Q=[(0,d.Z)(O.size)];if(t&&Q.push((0,a.OD)(e.date)),Z&&Q.push(yield(0,L.Z)(e)),!t&&!Z){const e=document.createElement("span"),t=(0,d.Z)(O.size);e.append(" / ",t),e.style.visibility="hidden",Q.push(e)}j.innerHTML=`\n ${F.downloaded&&!U||!e.mid||!$?"":'
'}\n
\n
\n `;const X=j.querySelector(".document-name"),J=new w.I;J.dataset.fontWeight=""+i,J.dataset.fontSize=""+D,J.dataset.sizeType=A,J.getSize=R,J.textContent=q,e.mid||j.classList.add("downloaded"),X.append(J),Z&&X.append((0,I.Z)(e));const ee=j.querySelector(".document-size");if(Y.append(...(0,m.A1)(Q," · ")),ee.append(Y),j.prepend(G),!U&&e.pFlags.is_outgoing&&!e.mid)return j;let te,ie=null;const se=()=>{if(j.classList.remove("downloading"),O.size>g.Iw&&!U)return ie.setManual(),ie.attach(te),ie.preloader.classList.add("manual"),void ie.setDownloadFunction(ae);if(O.size<=g.Iw&&j.classList.add("downloaded"),te){if(te!==G){const e=te;setTimeout((()=>{e.remove()}),200)}te=null}ie&&(ie=null)},ne=e=>{j.classList.add("downloading");const t=document.createElement("span"),i=(0,d.Z)(O.size);t.style.position="absolute",t.style.left="0",e.then(se,c.Z).finally((()=>{Y.style.visibility="",t.remove()}));const s=e=>(0,d.Z)(e);let n=s(0);Y.style.visibility="hidden",t.append(n," / ",i),Y.parentElement.append(t),e.addNotifyListener((e=>{const t=s(e.done);n.replaceWith(t),n=t}))},ae=e=>{var t;const i=!e||e.isTrusted,n=j.doc;let a;const o=u.ZP.chat.bubbles?u.ZP.chat.bubbles.lazyLoadQueue.queueId:void 0;if(i)if("pdf"===n.type){const e=!ie||ie.detached;a=h.Z.downloadMediaURL({media:n,queueId:o}),e&&a.then((()=>{setTimeout((()=>E(this,void 0,void 0,(function*(){const e=(yield W()).url;window.open(e)}))),l.Z.isAvailable("animations")?250:0)}))}else a=s.Z.has(n.mime_type)&&(null===(t=n.thumbs)||void 0===t?void 0:t.length)?h.Z.downloadMediaURL({media:n,queueId:o}):h.Z.downloadToDisc({media:n,queueId:o});else a=h.Z.downloadToDisc({media:n,queueId:o},!0);a.catch((()=>{j.classList.remove("downloading")})),te&&(ie.attach(te,!0,a),ne(a))},{fileName:oe}=(0,p.Z)({media:O,downloadId:"1"});if(yield _.apiFileManager.isDownloading(oe)){te=j.querySelector(".document-download")||G;const e=h.Z.downloadToDisc({media:O},!0);ie=new S.Z,ie.attach(te,!1,e),ie.setDownloadFunction(ae),ne(e)}else if(!F.downloaded||U)if(te=j.querySelector(".document-download")||G,ie=new S.Z({isUpload:!!U}),U){const e=h.Z.getUpload(U);ie.attachPromise(e),ie.attach(te),ne(e)}else ie.construct(),ie.setManual(),ie.attach(te),ie.setDownloadFunction(ae),void 0!==k&&k>=O.size&&(0,o.tH)(ie.preloader);return(0,o.fc)(j,(e=>{(0,r.Z)(e.target,"time")||(ie?ie.onClick(e):ae(e))})),j}))}b.Z.addEventListener("document_downloading",(e=>{Array.from(document.querySelectorAll(`.document[data-doc-id="${e}"]`)).forEach((e=>{e.querySelector(".preloader-container.manual")&&(0,o.tH)(e)}))}))},8210:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(6272);function n(e){return"+"+(0,s.u)(e).formatted}},177:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(2575),n=i(2325),a=i(3512);function o(e,t=a.Z.managers){var i,o,r,d,l,c;return r=this,d=void 0,c=function*(){const a=yield t.appChatsManager.getChat(e);if("chatForbidden"===a._)return(0,n.ag)("YouWereKicked");const r=yield t.appProfileManager.getCachedFullChat(e);let d;d=r?"channelFull"===r._?r.participants_count:null===(i=r.participants.participants)||void 0===i?void 0:i.length:a.participants_count||(null===(o=a.participants)||void 0===o?void 0:o.participants.length),d=d||1;const l=a.pFlags.broadcast?"Peer.Status.Subscribers":"Peer.Status.Member";return(0,n.ag)(l,[(0,s.Z)(d)])},new((l=void 0)||(l=Promise))((function(e,t){function i(e){try{n(c.next(e))}catch(e){t(e)}}function s(e){try{n(c.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof l?n:new l((function(e){e(n)}))).then(i,s)}n((c=c.apply(r,d||[])).next())}))}},493:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(8456),n=i(5102),a=i(2325),o=i(8115),r=i(3512);function d(e){return t=this,i=void 0,l=function*(){const{peerId:t=r.Z.myId,plainText:i,onlyFirstName:d,limitSymbols:l,managers:c=r.Z.managers,threadId:h}=e;let u="";if(t.isUser()){const e=yield c.appUsersManager.getUser(t.toUserId());e&&(e.first_name&&(u+=e.first_name),!e.last_name||d&&u||(u+=" "+e.last_name)),u=u?u.trim():!e||e.pFlags.deleted?a.ZP.format(d?"Deleted":"HiddenName",!0):(0,n.Z)(e)[0]||""}else{if(h){const e=yield c.dialogsStorage.getForumTopic(t,h);u=(null==e?void 0:e.title)||""}if(!u){const e=yield c.appChatsManager.getChat(t.toChatId());u=(null==e?void 0:e.title)||""}d&&(u=u.split(" ")[0])}return void 0!==l&&(u=(0,s.Z)(u,l,l)),i?u:(0,o.Z)(u)},new((d=void 0)||(d=Promise))((function(e,s){function n(e){try{o(l.next(e))}catch(e){s(e)}}function a(e){try{o(l.throw(e))}catch(e){s(e)}}function o(t){var i;t.done?e(t.value):(i=t.value,i instanceof d?i:new d((function(e){e(i)}))).then(n,a)}o((l=l.apply(t,i||[])).next())}));var t,i,d,l}},3061:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(632),n=i(2325),a=i(1507);function o(e){var t;if(!e)return document.createElement("span");let i,o;switch(e.id){case a.hj.toUserId():i="Peer.RepliesNotifications";break;case a.yF.toUserId():i="Peer.ServiceNotifications";break;default:if(e.pFlags.bot){i="Bot";break}if(e.pFlags.support){i="SupportStatus";break}switch(null===(t=e.status)||void 0===t?void 0:t._){case"userStatusRecently":i="Lately";break;case"userStatusLastWeek":i="WithinAWeek";break;case"userStatusLastMonth":i="WithinAMonth";break;case"userStatusOffline":{const t=e.status.was_online,n=new Date,a=(n.getTime()/1e3|0)-t;if(a<60)i="Peer.Status.justNow";else if(a<3600)i="Peer.Status.minAgo",o=[a/60|0];else if(a<86400&&n.getDate()===new Date(1e3*t).getDate())i="LastSeen.HoursAgo",o=[a/3600|0];else{i="Peer.Status.LastSeenAt";const{dateEl:e,timeEl:n}=(0,s.rz)(t);o=[e,n]}break}case"userStatusOnline":i="Online";break;default:i="ALongTimeAgo"}}return(0,n.ag)(i,o)}},6131:(e,t,i)=>{"use strict";i.d(t,{MR:()=>d,ZP:()=>c,kN:()=>l});var s=i(3910),n=i(1046),a=i(319),o=i(6628),r=i(9099);function d(e){const{mediaSpoiler:t,reveal:i,destroyAfter:s}=e;(0,r.Z)({element:t,forwards:i,className:"is-revealing",duration:250,onTransitionEnd:()=>{i&&s&&(t.remove(),t.middlewareHelper.destroy())}})}function l(e){const{mediaSpoiler:t,event:i}=e;if((0,s.Z)(i),t.classList.contains("is-revealing"))return;const n=t.parentElement.querySelector("video");n&&!t.parentElement.querySelector(".video-play")&&(n.autoplay=!0,n.play().catch(a.Z)),d({mediaSpoiler:t,reveal:!0,destroyAfter:!0})}function c(e){return t=this,i=void 0,a=function*(){const{media:t}=e,i=(t.sizes||t.thumbs).find((e=>"photoStrippedSize"===e._));if(!i)return;const{image:s,loadPromise:a}=(0,n.Z)(t,i,!0);return yield a,function(e){const{middleware:t,image:i}=e;if(!t())return;i.classList.add("media-spoiler-thumbnail");const s=document.createElement("div");s.classList.add("media-spoiler-container"),s.middlewareHelper=t.create();const n=o.Z.create(Object.assign(Object.assign({},e),{middleware:s.middlewareHelper.get()}));return s.append(i,n.canvas),s}(Object.assign(Object.assign({},e),{image:s}))},new((s=void 0)||(s=Promise))((function(e,n){function o(e){try{d(a.next(e))}catch(e){n(e)}}function r(e){try{d(a.throw(e))}catch(e){n(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((a=a.apply(t,i||[])).next())}));var t,i,s,a}},6239:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(9345);function n(e){return t=this,i=void 0,a=function*(){try{return yield(0,s.Z)(e)}catch(t){return console.error("wrapMessageActionTextNewUnsafe error:",t),e.plain?"":document.createElement("span")}},new((n=void 0)||(n=Promise))((function(e,s){function o(e){try{d(a.next(e))}catch(e){s(e)}}function r(e){try{d(a.throw(e))}catch(e){s(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(t,i||[])).next())}));var t,i,n,a}},9345:(e,t,i)=>{"use strict";i.d(t,{Z:()=>F,e:()=>x});var s=i(1655),n=i(632),a=i(2614),o=i(130),r=i(8939),d=i(5180),l=i(2946),c=i(2325),h=i(1507),u=i(8115),p=i(2491),f=i(5400),m=i(3512),g=i(2064),v=i(5798);let b,y,w;const S=new Map;var C=i(9083),L=i(493),I=i(3591);function E(e){const t=e.action,{onclick:i,url:s}=(0,I.Z)(`tg://voicechat?chat_id=${e.peerId.toChatId()}&id=${t.call.id}&access_hash=${t.call.access_hash}`);if(!i)return document.createElement("span");const n=document.createElement("a");return n.href=s,n.setAttribute("onclick",i+"(this)"),n}var P=i(496),Z=i(7362),M=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function T(e){return M(this,void 0,void 0,(function*(){const t=yield(0,P.Z)(e);if(e.plain)return t;const i=document.createElement("i");return i.dataset.savedFrom=e.message.peerId+"_"+e.message.mid,i.dir="auto",i.append(t),i}))}function k(e,t){return t?e:(0,a.Z)((0,u.Z)(e))}function x(e){return M(this,void 0,void 0,(function*(){const t=e.topic;let i=null==t?void 0:t.icon_emoji_id;return(null==t?void 0:t.id)===h.Ox&&(i="5390854796011906616"),i?e.plain?m.Z.managers.appEmojiManager.getCustomEmojiDocument(i).then((e=>e.stickerEmojiRaw)):(0,C.N)(Object.assign(Object.assign({},e),{docIds:[i]})).then((e=>(e.lastElementChild.classList.add("topic-icon"),e))):e.plain?"":function(e,t){if(!b){w=document.getElementById("svg-defs");const e="http://www.w3.org/2000/svg";b=document.createElementNS(e,"svg"),b.setAttributeNS(null,"width","26"),b.setAttributeNS(null,"height","26"),b.setAttributeNS(null,"viewBox","0 0 26 26"),b.classList.add("topic-icon-svg");const t=document.createElementNS(e,"use");t.setAttributeNS(null,"href","#topic-icon"),b.append(t),y=document.createElement("span"),y.classList.add("topic-icon","avatar-like");const i=document.createElement("span");i.classList.add("topic-icon-content"),y.append(b,i)}e||(console.error("NO TOPIC ICON COLOR!"),e=h.OS[0]),t||(console.error("NO TOPIC NAME!"),t="");const i=e.toString(16),s=`topic-icon-gradient-${e}`;let n=S.get(e);if(!n){const{h:t,s:a,l:o,a:r}=(0,g.cw)("#"+i);w.insertAdjacentHTML("beforeend",`\n \n \n \n \n `),S.set(e,n=`hsla(${t}, ${a}%, ${Math.max(0,o-40)}%, ${r})`)}const a=y.cloneNode(!0);return a.firstElementChild.style.fill=`url(#${s})`,a.firstElementChild.style.stroke=n,a.lastElementChild.append((0,v.Z)(t,!0)),a}(null==t?void 0:t.icon_color,null==t?void 0:t.title)}))}function A(e){const t=e.message.action;return x(Object.assign(Object.assign({},e),{topic:t}))}function _(e){return M(this,void 0,void 0,(function*(){const t=e.message.action,i=document.createElement("span");return i.classList.add("topic-name"),i.append(yield A(e),k(t.title,e.plain)),i}))}function F(e){var t;return M(this,void 0,void 0,(function*(){const{plain:i,message:h,noLinks:g}=e,v=i?void 0:document.createElement("span"),b="action"in h&&h.action;if(b.message){const e=b.message;return i?(0,p.Z)(e):((0,o.Z)(v,(0,f.ZP)(e,{noLinebreaks:!0})),v)}{let o,p,y=b._;const w=m.Z.managers,S=(e,t)=>t?(0,L.Z)({peerId:e,plainText:t}):(0,Z.Z)({peerId:e});switch(b._){case"messageActionPhoneCall":y+="."+b.type,p=[(0,r.Z)(b.duration,i)];break;case"messageActionGroupCall":y+="."+b.type,p=[],y.endsWith("You")||h.pFlags.post||p.push(S(h.fromId,i)),void 0!==b.duration?p.push((0,r.Z)(b.duration,i)):g?p.push(""):p.push(E(h));break;case"messageActionInviteToGroupCall":{const e=[h.fromId,b.users[0].toPeerId()];let t="Chat.Service.VoiceChatInvitation";const n=m.Z.myId;e[0]===n?t+="ByYou":e[1]===n&&(t+="ForYou"),(0,s.Z)(e,n),o=t,p=e.map((e=>S(e,i))),p.push(g?"":E(h));break}case"messageActionGroupCallScheduled":{const e=new Date,t=new Date(1e3*b.schedule_date),s=(t.getTime()-e.getTime())/864e5,a=new Date(e);a.setDate(a.getDate()+1);const r=yield w.appPeersManager.isBroadcast(h.peerId);o=r?"ChatList.Service.VoiceChatScheduled.Channel":"ChatList.Service.VoiceChatScheduled",p=[];const d=m.Z.myId;let l;h.fromId===d?o+="You":r||p.push(S(h.fromId,i));const u=[];s<1&&t.getDate()===e.getDate()?l="TodayAtFormattedWithToday":s<2&&t.getDate()===a.getDate()?l="Time.TomorrowAt":(l="formatDateAtTime",u.push(new c.ZP.IntlDateElement({date:t,options:{day:"2-digit",month:"2-digit",year:"2-digit"}}).element)),u.push((0,n.mr)(t));const f=(0,c.ag)(l,u);p.push(f);break}case"messageActionChatCreate":{const e=m.Z.myId;h.fromId===e?y+="You":p=[S(h.fromId,i)];break}case"messageActionPinMessage":{const t=h.peerId,s=yield w.appMessagesManager.getMessageByPeer(t,h.reply_to_mid);p=[S(h.fromId,i)],s?p.push(T(Object.assign(Object.assign({},e),{message:s}))):(o="ActionPinnedNoText",h.reply_to_mid&&w.appMessagesManager.fetchMessageReplyTo(h));break}case"messageActionChatJoinedByRequest":{const e=yield w.appPeersManager.isBroadcast(h.peerId);h.pFlags.out?o=e?"RequestToJoinChannelApproved":"RequestToJoinGroupApproved":(o=e?"ChatService.UserJoinedChannelByRequest":"ChatService.UserJoinedGroupByRequest",p=[S(h.fromId,i)]);break}case"messageActionContactSignUp":case"messageActionChatReturn":case"messageActionChatLeave":case"messageActionChatJoined":case"messageActionChatEditPhoto":case"messageActionChatDeletePhoto":case"messageActionChatEditVideo":case"messageActionChatJoinedByLink":case"messageActionChannelEditVideo":case"messageActionChannelDeletePhoto":p=[S(h.fromId,i)];break;case"messageActionChannelEditTitle":case"messageActionChatEditTitle":p=[],"messageActionChatEditTitle"===b._&&p.push(S(h.fromId,i)),p.push(k(b.title));break;case"messageActionChatDeleteUser":case"messageActionChatAddUsers":case"messageActionChatAddUser":{const e=b.users||[b.user_id];if(p=[S(h.fromId,i)],e.length>1){const t=(0,c.v_)(yield Promise.all(e.map((e=>S(e.toPeerId(),i)))),!1,i);if(i)p.push(...t);else{const e=document.createElement("span");e.append(...t),p.push(e)}}else p.push(S(e[0].toPeerId(),i));break}case"messageActionBotAllowed":{const e=(0,f.ZP)(b.domain,{entities:[{_:"messageEntityUrl",length:b.domain.length,offset:0}],noLinks:g});p=[(0,a.Z)(e)];break}case"messageActionPaymentSent":{const s=b.pFlags.recurring_init,n=b.pFlags.recurring_used;if(o=n?"Chat.Service.PaymentSentRecurringUsedNoTitle":s?"Chat.Service.PaymentSentRecurringInitNoTitle":"Chat.Service.PaymentSent1NoTitle",p=[(0,d.Z)(b.total_amount,b.currency),S(h.peerId,i)],h.reply_to_mid){const i=yield w.appMessagesManager.getMessageByPeer((null===(t=h.reply_to)||void 0===t?void 0:t.reply_to_peer_id)?(0,l.Z)(h.reply_to.reply_to_peer_id):h.peerId,h.reply_to_mid);i?(o=n?"Chat.Service.PaymentSentRecurringUsed":s?"Chat.Service.PaymentSentRecurringInit":"Chat.Service.PaymentSent1",p.push(T(Object.assign(Object.assign({},e),{message:i})).then((e=>(e instanceof HTMLElement&&e.classList.add("is-receipt-link"),e))))):w.appMessagesManager.fetchMessageReplyTo(h)}break}case"messageActionSetMessagesTTL":{p=[];const e=yield w.appPeersManager.isBroadcast(h.peerId);if(b.period){let t;if(e?o="ActionTTLChannelChanged":h.fromId===m.Z.myId?o="ActionTTLYouChanged":(o="ActionTTLChanged",p.push(S(h.fromId,i))),b.period>1814400){let e;const s=[],a=31536e3;b.period>=a?(e="Years",s.push(b.period/a|0)):(e="Months",s.push(b.period/(30*n.s2)|0)),t=i?c.ZP.format(e,!0,s):(0,c.ag)(e,s)}else t=(0,r.Z)(b.period,i);p.push(t)}else e?o="ActionTTLChannelDisabled":h.fromId===m.Z.myId?o="ActionTTLYouDisabled":(o="ActionTTLDisabled",p.push(S(h.fromId,i)));break}case"messageActionTopicEdit":{let t,s,n;const a=!!h.pFlags.out,r=void 0!==b.icon_emoji_id,d=r&&!+b.icon_emoji_id,l=void 0!==b.title,c=void 0!==b.hidden;a||(n=S(h.fromId,i)),l&&(s=k(b.title)),r&&!d&&(t=A(e)),p=n?[n]:[],b.closed?o=a?"Chat.Service.Group.TopicEdited.You.Paused":"Chat.Service.Group.TopicEdited.Paused":!1===b.closed?o=a?"Chat.Service.Group.TopicEdited.You.Resumed":"Chat.Service.Group.TopicEdited.Resumed":d&&l?(o=a?"Chat.Service.TopicEdited.You.Mixed.IconRemoved":"Chat.Service.TopicEdited.Mixed.IconRemoved",p.push(s)):r&&l?(o=a?"Chat.Service.TopicEdited.You.Mixed":"Chat.Service.TopicEdited.Mixed",p.push(_(e))):d?o=a?"Chat.Service.Group.TopicEdited.You.Icon.Removed":"Chat.Service.Group.TopicEdited.Icon.Removed":l?(o=a?"Chat.Service.Group.TopicEdited.You.Title":"Chat.Service.Group.TopicEdited.Title",p.push(s)):r?(o=a?"Chat.Service.Group.TopicEdited.You.Icon":"Chat.Service.Group.TopicEdited.Icon",p.push(t)):c&&(o=a?b.hidden?"Chat.Service.Group.TopicEdited.You.Hided":"Chat.Service.Group.TopicEdited.You.Unhided":b.hidden?"Chat.Service.Group.TopicEdited.Hided":"Chat.Service.Group.TopicEdited.Unhided");break}case"messageActionTopicCreate":p=[_(e)],o="TopicWasCreatedAction";break;case"messageActionSetChatTheme":{const e=!!h.pFlags.out;let t;e||(t=S(h.fromId,i)),p=t?[t]:[],b.emoticon?(p.push((0,u.Z)(b.emoticon)),o=e?"ChatThemeChangedYou":"ChatThemeChangedTo"):o=e?"ChatThemeDisabledYou":"ChatThemeDisabled";break}default:o=c.Hz[y]||`[${b._}]`}o||(o=c.Hz[y],void 0===o&&(o="["+y+"]"));const C=p&&(yield Promise.all(p));return i?c.ZP.format(o,!0,C):(0,c.$d)(v,o,C)}}))}},496:(e,t,i)=>{"use strict";i.d(t,{Z:()=>v});var s=i(8938),n=i(5705),a=i(677),o=i(3738),r=i(8456),d=i(5381),l=i(2325),c=i(6535),h=i(1346),u=i(8115),p=i(2491),f=i(5400),m=i(3512),g=i(6239);function v(e){var t,i,v,b,y,w;return v=this,b=void 0,w=function*(){let{message:v,text:b,usingMids:y,plain:w,highlightWord:S,withoutMediaType:C}=e;null!=b||(b=v.message);const L=[];let I=!1;const E=(e,t)=>{if(e){if(void 0===t&&I)return;t=w?l.ZP.format(e,!0):(0,l.ag)(e)}if(w)L.push(t);else{const e=document.createElement("span");"string"==typeof t?e.innerHTML=t:e.append(t),L.push(e)}},P=m.Z.managers.appMessagesManager,Z=(0,d.Z)(v);let M=null!==(t=v.totalEntities)&&void 0!==t?t:v.entities;if(v.media&&!Z){(0,s.Z)(v);let e=!0;if(v.grouped_id){if(y){const t=yield P.getMidsByMessage(v);if(y.length===t.length){for(const i of t)if(!y.includes(i)){e=!1;break}}else e=!1}if(e){const e=yield P.getAlbumText(v.grouped_id);b=(null==e?void 0:e.message)||"",M=(null==e?void 0:e.totalEntities)||[],C||(E("AttachAlbum"),I=!0)}}else e=!1;if(!e&&!C||!b){const e=v.media;switch(e._){case"messageMediaPhoto":E("AttachPhoto");break;case"messageMediaDice":E(void 0,w?e.emoticon:(0,u.Z)(e.emoticon));break;case"messageMediaVenue":b=e.title,E("AttachLocation");break;case"messageMediaGeo":E("AttachLocation");break;case"messageMediaGeoLive":E("AttachLiveLocation");break;case"messageMediaPoll":const t="📊 "+(e.poll.question||"poll");E(void 0,w?t:(0,u.Z)(t));break;case"messageMediaContact":E("AttachContact");break;case"messageMediaGame":{const t="🎮 "+e.game.title;E(void 0,w?t:(0,u.Z)(t));break}case"messageMediaDocument":{const t=e.document;if("video"===t.type)E("AttachVideo");else if("voice"===t.type)E("AttachAudio");else if("gif"===t.type)E("AttachGif");else if("round"===t.type)E("AttachRound");else if("sticker"===t.type){const e=L.length;if(t.stickerEmojiRaw){const e=t.stickerEmojiRaw+" ";E(void 0,w?e:(0,u.Z)(e))}E("AttachSticker");const i=L.splice(e,2);if(w)L.push(i[0]+(i[1]?i[1]:""));else{const e=window.document.createElement("span");e.append(...i),L.push(e)}b=""}else if("audio"===t.type){const e=t.attributes.find((e=>"documentAttributeAudio"===e._&&(e.title||e.performer))),i="🎵 "+(e?[e.title,e.performer].filter(Boolean).join(" - "):t.file_name);E(void 0,w?i:(0,u.Z)(i))}else E(void 0,w?t.file_name:(0,u.Z)(t.file_name));break}case"messageMediaInvoice":"messageExtendedMediaPreview"===(null===(i=e.extended_media)||void 0===i?void 0:i._)?E(void 0,w?e.description:(0,u.Z)(e.description)):E(void 0,w?e.title:(0,u.Z)(e.title));break;case"messageMediaUnsupported":E(l.nK)}}const t=L.length;for(let e=1;e{"use strict";i.d(t,{Z:()=>n});var s=i(8842);function n(e){return t=this,i=void 0,a=function*(){const t=new s.Z;return yield t.update(e),t.element},new((n=void 0)||(n=Promise))((function(e,s){function o(e){try{d(a.next(e))}catch(e){s(e)}}function r(e){try{d(a.throw(e))}catch(e){s(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(t,i||[])).next())}));var t,i,n,a}},9492:(e,t,i)=>{"use strict";i.d(t,{Z:()=>b});var s=i(2830),n=i(4755),a=i(3512),o=i(3442),r=i(6705),d=i(8580),l=i(1713),c=i(9687),h=i(2312),u=i(3114),p=i(7660),f=i(319),m=i(1507),g=i(5994),v=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function b({photo:e,message:t,container:i,boxWidth:y,boxHeight:w,withTail:S,isOut:C,lazyLoadQueue:L,middleware:I,size:E,withoutPreloader:P,loadPromises:Z,autoDownloadSize:M,noBlur:T,noThumb:k,noFadeIn:x,blurAfter:A,managers:_=a.Z.managers,processUrl:F}){return v(this,void 0,void 0,(function*(){const a={loadPromises:{thumb:Promise.resolve(),full:Promise.resolve()},images:{thumb:null,full:null},preloader:null,aspecter:null},D="document"===e._,R=D&&e.mime_type.startsWith("image/")&&!E,B=(0,u.Z)(e);if(!(e.sizes||e.thumbs||B||R))return y&&w&&!E&&D&&(0,l.Z)(e,i,y,w,void 0,t),a;let N=0===M;E||(void 0===y&&(y=n.Z.active.regular.width),void 0===w&&(w=n.Z.active.regular.height)),i.classList.add("media-container");let O,U,H,z=i,j=!0,G=Promise.resolve();if(y&&w&&!E){const s=(0,l.Z)(e,i,y,w,void 0,t,void 0,R?{_:"photoSize",w:e.w,h:e.h,size:e.size,type:m.Pt}:void 0);if(E=s.photoSize,j=s.isFit,U=yield _.thumbsStorage.getCacheContext(e,E.type),!j&&!B){z=document.createElement("div"),z.classList.add("media-container-aspecter"),z.style.width=s.size.width+"px",z.style.height=s.size.height+"px";const n=(0,d.Z)(e,U,!T,!0);if(n){G=n.loadPromise;const e=n.image;e.classList.add("media-photo"),i.append(e)}else(yield b({container:i,message:t,photo:e,boxWidth:0,boxHeight:0,size:E,lazyLoadQueue:L,isOut:C,loadPromises:Z,middleware:I,withoutPreloader:P,withTail:S,autoDownloadSize:M,noBlur:T,noThumb:!0,blurAfter:!0,managers:_})).images.full.classList.add("media-photo","thumbnail");i.classList.add("media-container-fitted"),i.append(z)}}else E||(E=(0,c.Z)(e,y,w,!0)),U=yield _.thumbsStorage.getCacheContext(e,null==E?void 0:E.type);if(!k&&!B){const t=(0,d.Z)(e,U,!T);t&&(G=Promise.all([G,t.loadPromise]),a.loadPromises.thumb=a.loadPromises.full=G,O=a.images.thumb=t.image,O.classList.add("media-photo"),z.append(O))}if(a.aspecter=z,"photoSizeEmpty"===(null==E?void 0:E._)&&D||(null==E?void 0:E.bytes))return a;"videoSize"===(null==E?void 0:E._)?(H=a.images.full=(0,p.Z)(),H.autoplay=!0,H.loop=!0,H.muted=!0,H.classList.add("media-photo")):(H=a.images.full=new Image,H.classList.add("media-photo"));const V=(O||!U.downloaded)&&g.Z.isAvailable("animations")&&!x;let K;const W=null==t?void 0:t.uploadingFileName;P||(U.downloaded&&!W||(K=new o.Z({attachMethod:"prepend",isUpload:!!W})),W&&(K.attachPromise(h.Z.getUpload(W)),K.attach(i),N=void 0));const $=e=>(0,s.Z)(i,H,e,V,z,O),q=e=>v(this,void 0,void 0,(function*(){if(!I||I()){if(F&&(e=yield F(e)),A){const t=(0,r.Z)(e,12);return t.promise.then((()=>$(t.canvas.toDataURL())))}return $(e)}}));let Y;const Q=E.w>=150&&E.h>=150||N,X=()=>v(this,void 0,void 0,(function*(){N&&!P&&K&&(K.construct(),K.setManual());const t=(()=>{const t=R&&!E;return h.Z.downloadMediaURL({media:e,thumb:E,queueId:null==L?void 0:L.queueId,onlyCache:t?void 0:N})})(),s=yield _.thumbsStorage.getCacheContext(e,null==E?void 0:E.type);K&&!s.downloaded&&!P&&Q&&K.attach(i,!1,t),N=void 0;const n=t.then(q);return n.catch(f.Z),{download:t,render:n}}));return K&&K.setDownloadFunction(X),U.downloaded?G=Y=(yield X()).render:L?L.push({div:i,load:()=>X().then((({download:e})=>e))}):Y=(yield X()).render,Z&&G&&Z.push(G),yield G,a.loadPromises.thumb=G,a.loadPromises.full=Y||Promise.resolve(),a.preloader=K,a}))}},6700:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(2064),n=i(5990),a=i(3484);function o(e,t,i,o,r){const d=new a.Z("reply",i),l=d.fill(e,t,o);if(r){const e=(0,n.Z)(r,!1),[t,i,a]=(0,s.oo)(e);d.container.style.setProperty("--override-color",`${t}, ${i}, ${a}`),d.container.classList.add("is-overriding-color")}return{container:d.container,fillPromise:l}}},5671:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(2291),n=i(2325),a=i(3512),o=i(7362);function r(e){return t=this,i=void 0,d=function*(){const t=document.createElement("span");t.classList.add("sender-title");const i=e.fromId===a.Z.myId&&e.peerId!==a.Z.myId;if(t.append(i?(0,n.ag)("FromYou"):yield(0,o.Z)(Object.assign(Object.assign({},(0,s.Z)(e)),{dialog:e.peerId===a.Z.myId}))),(yield a.Z.managers.appPeersManager.isAnyGroup(e.peerId))||i){const i=yield(0,o.Z)({peerId:e.peerId});t.append(" ➝ ",i)}return t},new((r=void 0)||(r=Promise))((function(e,s){function n(e){try{o(d.next(e))}catch(e){s(e)}}function a(e){try{o(d.throw(e))}catch(e){s(e)}}function o(t){var i;t.done?e(t.value):(i=t.value,i instanceof r?i:new r((function(e){e(i)}))).then(n,a)}o((d=d.apply(t,i||[])).next())}));var t,i,r,d}},1604:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(632);function n(e){const t=document.createElement("span");return t.classList.add("sent-time"),t.append((0,s.zM)(new Date(1e3*e.date))),t}},3541:(e,t,i)=>{"use strict";i.d(t,{Vp:()=>R,ZP:()=>U,_2:()=>H,_i:()=>N});var s=i(5269),n=i(3725),a=i(3910),o=i(2738),r=i(7660),d=i(8497),l=i(6740),c=i(1046),h=i(1185),u=i(5471),p=i(9405),f=i(4755),m=i(925),g=i(3174),v=i(6724),b=i(9674),y=i(2312),w=i(7030),S=i(2790),C=i(9687),L=i(13),I=i(1447),E=i(3512),P=i(7730),Z=i(671),M=i(5814),T=i(9298),k=i(2796),x=i(6775),A=i(645),_=i(5994),F=i(1168),D=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const R=1.49,B={},N={},O=(e,t,i)=>{const s=()=>{e.removeEventListener("animationend",s),t(),clearTimeout(n)};e.addEventListener("animationend",s);const n=setTimeout(s,i)};function U({doc:e,div:t,middleware:i,loadStickerMiddleware:d,lazyLoadQueue:m,exportLoad:v,group:w,play:S,onlyThumb:U,emoji:H,width:z,height:j,withThumb:G,loop:V,loadPromises:K,needFadeIn:W,needUpscale:$,skipRatio:q,static:Y,managers:Q=E.Z.managers,fullThumb:X,isOut:J,noPremium:ee,withLock:te,relativeEffect:ie,loopEffect:se,isCustomEmoji:ne,syncedVideo:ae,liteModeKey:oe,isEffect:re}){var de;return D(this,void 0,void 0,(function*(){t=Array.isArray(t)?t:[t],null!=oe||(oe="stickers_panel"),ne&&(H=e.stickerEmojiRaw);const E=e.sticker;if(1===E&&(Y=!0),!z&&!j){const t=f.Z.active,i=H?t.emojiSticker:e.animated?t.animatedSticker:t.staticSticker,s=(0,p.C)(e.w,e.h).aspectFitted(i);z=s.width,j=s.height}let le;2===E&&I.Z.loadLottieWorkers(),V=!(H&&!ne)&&V,t.forEach((t=>{t.dataset.docId=""+e.id,H&&(t.dataset.stickerEmoji=H),t.dataset.stickerPlay=""+ +(S||!1),t.dataset.stickerLoop=""+ +(V||!1),t.classList.add("media-sticker-wrapper")})),!S||_.Z.isAvailable(oe)||ne||re||(S=!1,V=!1);const ce=(t=(null==le?void 0:le.type))=>D(this,void 0,void 0,(function*(){return le=yield Q.thumbsStorage.getCacheContext(e,t)})),he=!Y&&(2===E||3===E),ue=(0,L.Z)(e);void 0!==J&&ue&&!J&&t.forEach((e=>e.classList.add("reflect-x")));const pe=ue&&te;if(pe){const i=B[e.id];t.forEach((e=>{e.classList.add("is-premium-sticker","tgico-premium_lock"),i&&e.style.setProperty("--lock-url",`url(${i})`)}))}if(Y&&1!==E){const t=(0,C.Z)(e,z,j,!1);yield ce(t.type)}else yield ce(null==X?void 0:X.type);const fe=H&&!ne?(0,Z.tB)(H):-1,me=le.downloaded&&!W,ge=he,ve=2===E||3===E?yield Q.appDocsManager.getLottieCachedThumb(e.id,fe):void 0,be={render:void 0,load:void 0};let ye=(0,n.Z)(),we=!1;if(((null===(de=e.thumbs)||void 0===de?void 0:de.length)||ve)&&!t[0].firstElementChild&&(!me||ge||U)&&!1!==G){let n=ve||e.thumbs[0];const a=(e,t)=>{e.childElementCount?ye.resolve():b.Z.mutateElement(e,(()=>{e.childElementCount||(t.classList.add("media-sticker","thumbnail"),e.append(t)),ye.resolve()}))};if("url"in n)we=!0,t.forEach((e=>{const t=new Image;(0,l.ZP)(t,n.url,(()=>a(e,t)))}));else if("bytes"in n){if("photoPathSize"===n._){n.bytes.length||(n=e.thumbs.find((e=>{var t;return null===(t=e.bytes)||void 0===t?void 0:t.length}))||n);const i=function(e){let t="M";for(let i=0,s=e.length;i=192?t+="AACAAAAHAAALMAAAQASTAVAAAZaacaaaahaaalmaaaqastava.az0123456789-,"[s-128-64]:(s>=128?t+=",":s>=64&&(t+="-"),t+=""+(63&s))}return t+="z",t}(n.bytes),s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg");a.classList.add("rlottie-vector","media-sticker","thumbnail"),a.setAttributeNS(null,"viewBox",`0 0 ${e.w||512} ${e.h||512}`);const o=document.createElementNS(s,"path");o.setAttributeNS(null,"d",i),_.Z.isAvailable("animations")&&!ne&&o.setAttributeNS(null,"fill","url(#g)"),a.append(o),t.forEach(((e,t)=>e.append(t>0?a.cloneNode(!0):a))),we=!0,ye.resolve()}else if(fe<=0){const o=()=>{t.forEach((t=>{const i=new Image,s=(0,h.Z)(e,n,!0);(0,l.ZP)(i,s,(()=>a(t,i)))}))};s.Z||e.pFlags.stickerThumbConverted||le.url?(we=!0,o()):(we=!0,P.Z.convert("main-"+e.id,n.bytes).then((s=>{Q.appDocsManager.saveWebPConvertedStrippedThumb(e.id,s),n.bytes=s,e.pFlags.stickerThumbConverted=!0,i&&!i()||t[0].childElementCount?ye.resolve():o()})).catch((()=>ye.resolve())))}}else if((2===E&&fe<=0||3===E)&&(G||U)){const s=()=>D(this,void 0,void 0,(function*(){if(t[0].childElementCount||i&&!i())return void ye.resolve();const s=(e,t,s)=>{e.childElementCount||i&&!i()?ye.resolve():s?(0,l.ZP)(t,s,(()=>a(e,t))):a(e,t)};yield ce(),t.forEach((t=>{if(le.url)s(t,new Image,le.url);else if("bytes"in n){const i=(0,c.Z)(e,n,!0);i.loadPromise.then((()=>s(t,i.image,"")))}else y.Z.downloadMediaURL({media:e,thumb:n}).then((e=>D(this,void 0,void 0,(function*(){return s(t,new Image,e)}))))}))}));if(m&&U)return m.push({div:t[0],load:s}),ye.resolve(),be;s(),n.url&&(we=!0)}}if(K&&we&&K.push(ye),U)return be;const Se=(0,u.Z)("MIDDLEWARE"),Ce=()=>D(this,void 0,void 0,(function*(){if(i&&!i())throw Se;if(2===E&&!Y){const s=yield y.Z.downloadMedia({media:e,queueId:null==m?void 0:m.queueId,thumb:X});if(i&&!i())throw Se;const n=yield I.Z.loadAnimationWorker({container:t[0],loop:V,autoplay:S,animationData:s,width:z,height:j,name:"doc"+e.id,needUpscale:$,skipRatio:q,toneIndex:fe,sync:ne,middleware:null!=d?d:i,group:w,liteModeKey:oe||void 0}),a=pe?()=>{var i,s;const a=null!==(i=B[s=e.id])&&void 0!==i?i:B[s]=function(e){var t;const i=e.getContext("2d"),s=20*(null!==(t=e.dpr)&&void 0!==t?t:1),n=s,a=s,o=(e.width-n)/2,r=e.height-a-0,d=i.getImageData(o,r,n,a).data;let l=0,c=0,h=0,u=0;for(let e=0;ee.style.setProperty("--lock-url",`url(${a})`)))}:void 0,o=(e,t)=>{const i=e.firstElementChild!==t&&e.firstElementChild;!1!==W&&(W=(W||!i||"svg"===i.tagName)&&_.Z.isAvailable("animations"));const s=()=>{i&&i!==t&&"DIV"!==i.tagName&&i.remove()};W?b.Z.mutate((()=>{t&&t.classList.add("fade-in"),i&&i.classList.add("fade-out"),O(t||i,(()=>{b.Z.mutate((()=>{t&&t.classList.remove("fade-in"),s()}))}),400)})):i&&b.Z.mutate(s)};return n.addEventListener("firstFrame",(()=>{const i=n.canvas[0];(!1!==G||ne)&&(0,g.O)(e,i,fe),pe&&a(),ne||t.forEach(((e,t)=>{o(e,n.canvas[t])}))}),{once:!0}),H&&Q.appStickersManager.preloadAnimatedEmojiStickerAnimation(H),n}if(Y||3===E){const s=he&&ae,n=s?A.Z.generateName(""+e.id,0,0,void 0,void 0):void 0,a=N[n];if(a)return a;const o=(s?t.slice(0,1):t).map((()=>{let e;if(Y)e=new Image;else{const t=e=(0,r.Z)();if(t.muted=!0,S&&(t.autoplay=!0),V&&(t.loop=!0),V&&"number"==typeof V){let i=0,s=0;function n(){i>this.currentTime&&++s===V&&(this.autoplay=!1,this.loop=!1,this.pause(),t.removeEventListener("timeupdate",n)),i=this.currentTime}t.addEventListener("timeupdate",n)}}return e.classList.add("media-sticker"),e})),c=t.map(((e,t)=>e.firstElementChild!==o[t]&&e.firstElementChild));!1!==W&&(W=(W||!me||(Y?c[0]:!c[0]||"svg"===c[0].tagName))&&_.Z.isAvailable("animations")),W&&o.forEach((e=>e.classList.add("fade-in")));const h=new Promise(((n,a)=>D(this,void 0,void 0,(function*(){const r=()=>D(this,void 0,void 0,(function*(){if(i&&!i())return void a(Se);const r=o.length,d=[];let h;yield ce(),t.forEach(((t,u)=>{const p=o[u];p&&(h=(0,l.cj)(p,le.url)),h.then((()=>((t,o,l)=>{b.Z.mutateElement(t,(()=>{if(!i||i())if(o){if(o){const t=z*window.devicePixelRatio,i=j*window.devicePixelRatio;if(!(0,g.k)(e,fe,t,i)){const s=document.createElement("canvas");s.width=t,s.height=i,s.getContext("2d").drawImage(o,0,0,s.width,s.height),(0,g.O)(e,s,fe)}}s?n(o):(t.append(o),W?(l&&l.classList.add("fade-out"),O(o,(()=>{o.classList.remove("fade-in"),null==l||l.remove()}),400)):null==l||l.remove(),he&&M.Z.addAnimation({animation:o,observeElement:t,group:w,controlled:i,liteModeKey:oe||void 0}),d.push(o)===r&&n(d))}else s&&he||null==l||l.remove();else a(Se)}))})(t,p,c[u])))}))}));if(yield ce(),le.url)r();else{let t;if(1!==E&&Y){const i=(0,C.Z)(e,z,j,!1);t=y.Z.downloadMediaURL({media:e,thumb:i,queueId:null==m?void 0:m.queueId})}else t=y.Z.downloadMediaURL({media:e,queueId:null==m?void 0:m.queueId});t.then(r,a)}}))));return n&&(N[n]=h,d&&h.finally((()=>{d()||delete N[n]}))),h}}));if(v&&(1===v&&(!me||he)||2===v))return be.load=Ce,be;const Le=!m||me&&!he?Ce():(m.push({div:t[0],load:Ce}),Promise.resolve());return me&&Y&&(ye=Le,K&&K.push(ye)),2===E&&ue&&void 0!==J&&!ee&&function({container:e,doc:t,managers:i,middleware:s,isOut:n,width:r,loadPromise:d,relativeEffect:l,loopEffect:c}){i.appStickersManager.preloadSticker(t.id,!0);let h=!1;(0,o.fc)(e,(i=>D(this,void 0,void 0,(function*(){const o=_.Z.isAvailable("effects_premiumstickers")||l;if((0,a.Z)(i),!i.isTrusted&&!o)return;if(h||!o){const e=document.createElement("a");return e.onclick=()=>{(0,k.PE)(),F.Z.createPopup(T.Z,t.stickerSetInput).show()},void(0,k.bC)({langPackKey:"Sticker.Premium.Click.Info",langPackArguments:[e]})}h=!0,yield d;const{animationDiv:u,stickerPromise:p}=(0,x.Z)({doc:t,middleware:s,side:n?"right":"left",size:r*R,target:e,play:!0,fullThumb:(0,L.Z)(t),relativeEffect:l,loopEffect:c});void 0===n||n||u.classList.add("reflect-x"),p.then((e=>{e.addEventListener("destroy",(()=>{h=!1}))}))}))))}({container:t[0],doc:e,managers:Q,middleware:i,isOut:J,width:z,loadPromise:Le,relativeEffect:ie,loopEffect:se}),be.render=Le,be}))}function H({event:e,container:t,managers:i,peerId:s,middleware:n}){var o,r,l,c,h,u;return D(this,void 0,void 0,(function*(){(0,a.Z)(e);const p=(0,d.Z)(t,"bubble"),f=t.dataset.stickerEmoji,g=t.classList.contains("custom-emoji")?void 0:I.Z.getAnimation(t);if(null==g?void 0:g.paused){const e=yield i.appStickersManager.getAnimatedEmojiSoundDocument(f);if(e){const i=document.createElement("audio");i.style.display="none",t.parentElement.append(i);try{const t=yield y.Z.downloadMediaURL({media:e});i.src=t,i.play(),yield(0,m.Z)(i,void 0,!0),i.addEventListener("ended",(()=>{i.src="",i.remove()}),{once:!0})}catch(e){}}g.autoplay=!0,g.restart()}if(!s.isUser()||!_.Z.isAvailable("effects_emoji"))return;const b=null!==(o=(c=t).activeAnimations)&&void 0!==o?o:c.activeAnimations=new Set;if(b.size>=3)return;const C=yield i.appStickersManager.getAnimatedEmojiSticker(f,!0);if(!C)return;const L=null!==(r=(h=t).emojiData)&&void 0!==r?r:h.emojiData={a:[],v:1},E=null!==(l=(u=t).sendInteractionThrottled)&&void 0!==l?l:u.sendInteractionThrottled=(0,v.Z)((()=>{if(!L.a.length)return;const e=L.a[0].t;L.a.forEach((t=>{t.t=(t.t-e)/1e3}));const s=(0,d.Z)(t,"bubble");i.appMessagesManager.setTyping(w.ZP.chat.peerId,{_:"sendMessageEmojiInteraction",msg_id:(0,S.Z)(+s.dataset.mid),emoticon:f,interaction:{_:"dataJSON",data:JSON.stringify(L)}},!0,w.ZP.chat.threadId),L.a.length=0}),1e3,!1),P={};b.add(P);const Z=p?p.classList.contains("is-out"):void 0,{animationDiv:M}=(0,x.Z)({doc:C,middleware:n,side:Z?"right":"left",size:360,target:t,play:!0,withRandomOffset:!0,onUnmount:()=>{b.delete(P)}});void 0===Z||Z||M.classList.add("reflect-x"),e.isTrusted&&(L.a.push({i:1,t:Date.now()}),E())}))}},6775:(e,t,i)=>{"use strict";i.d(t,{Z:()=>u});var s=i(2131),n=i(8938),a=i(8487),o=i(5471),r=i(3624),d=i(9966),l=i(241),c=i(7030),h=i(3541);function u({size:e,doc:t,middleware:i,target:u,side:p,skipRatio:f,play:m,managers:g,fullThumb:v,withRandomOffset:b,relativeEffect:y,loopEffect:w,onUnmount:S}){var C;const L=document.createElement("div");let I;L.classList.add("emoji-animation"),L.style.width=e+"px",L.style.height=e+"px";const E=()=>{P.clean(),null==I||I.remove(),L.remove(),c.ZP.chat.bubbles.scrollable.container.removeEventListener("scroll",A),null==S||S()},P=null!==(C=null==i?void 0:i.create())&&void 0!==C?C:(0,r.k)();i=P.get();const Z=(0,h.ZP)({div:L,doc:t,middleware:i,withThumb:!1,needFadeIn:!1,loop:!!w,width:e,height:e,play:m,group:"none",skipRatio:f,managers:g,fullThumb:v,isEffect:!0}).then((({render:e})=>e)).then((e=>{if((0,n.Z)(e),!i())throw e.remove(),(0,o.Z)("MIDDLEWARE");return I=e,I.addEventListener("enterFrame",(e=>{(w||e!==I.maxFrame)&&(0,a.Z)(u)||E()})),s.Z&&I.addEventListener("firstFrame",(()=>{navigator.vibrate(100)}),{once:!0}),I})),M=e=>{const t=Math.random()*e*2;return t>e?-t%e:t},T=b?M(16):0,k=b?M(4):0,x=()=>{if(!(0,a.Z)(u))return void E();const t=u.getBoundingClientRect(),i=t.width/200,s="center"===p?0:16*("right"===p?1:-1)*i,n="center"===p?0:0*i,o="right"===p?t.right:t.left,r=t.top,d=("center"===p?(t.width-e)/2:"right"===p?-e:0)+s+T,c=(t.height-e)/2+n+k,h=o+d,f=r+c;f<=-e||f>=l.Z.height?E():y?("center"!==p?L.style[p]=-1*Math.abs(s)+"px":L.style.left=d+"px",L.style.top=c+"px"):(L.style.top=f+"px",L.style.left=h+"px")},A=(0,d.Z)(x);return c.ZP.chat.bubbles.scrollable.container.addEventListener("scroll",A),x(),y?(L.classList.add("is-relative"),u.parentElement.append(L)):c.ZP.emojiAnimationContainer.append(L),{animationDiv:L,stickerPromise:Z}}},5772:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(3512),n=i(3541);function a(e){return t=this,i=void 0,o=function*(){const{emoji:t,div:i,managers:a=s.Z.managers}=e,o=yield a.appStickersManager.getAnimatedEmojiSticker(t);if(!o)throw i.classList.add("media-sticker-wrapper"),new Error("no sticker");return(0,n.ZP)(Object.assign({doc:o,play:!0,loop:!1},e))},new((a=void 0)||(a=Promise))((function(e,s){function n(e){try{d(o.next(e))}catch(e){s(e)}}function r(e){try{d(o.throw(e))}catch(e){s(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(n,r)}d((o=o.apply(t,i||[])).next())}));var t,i,a,o}},1273:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(7660),n=i(6740),a=i(2312),o=i(1447),r=i(3512),d=i(5814),l=i(3541),c=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function h({set:e,lazyLoadQueue:t,container:i,group:h,autoplay:u,width:p,height:f,managers:m=r.Z.managers,middleware:g}){var v;return c(this,void 0,void 0,(function*(){if(null===(v=e.thumbs)||void 0===v?void 0:v.length)return i.classList.add("media-sticker-wrapper"),void t.push({div:i,load:()=>c(this,void 0,void 0,(function*(){const t=yield m.appStickersManager.getStickerSetThumbDownloadOptions(e),r=a.Z.download(t);if(e.pFlags.animated&&!e.pFlags.videos)return r.then((t=>{o.Z.loadAnimationWorker({container:i,loop:!0,autoplay:u,animationData:t,width:p,height:f,needUpscale:!0,name:"setThumb"+e.id,group:h,middleware:g})}));{let t;return e.pFlags.videos?(t=(0,s.Z)(),t.autoplay=!0,t.muted=!0,t.loop=!0):t=new Image,t.classList.add("media-sticker"),r.then((s=>{(0,n.ZP)(t,URL.createObjectURL(s),(()=>{i.append(t),e.pFlags.videos&&d.Z.addAnimation({animation:t,group:h})}))}))}}))});let r;r=e.thumb_document_id?m.appEmojiManager.getCustomEmojiDocument(e.thumb_document_id):m.appStickersManager.getStickerSet(e).then((e=>e.documents[0]));const b=yield r;"documentEmpty"!==b._&&(0,l.ZP)({doc:b,div:i,group:h,lazyLoadQueue:t,managers:m,width:p,height:f,middleware:g})}))}},62:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(3541);function n({doc:e,row:t,size:i,managers:n}){const a=t.media,o=t.createMedia("small");a&&o.classList.add("hide");const r=a?[]:void 0,d="small"===i?32:48,l=(0,s.ZP)({div:o,doc:e,width:d,height:d,loadPromises:r,managers:n}).then((({render:e})=>e));return r&&Promise.all(r).then((()=>{o.classList.remove("hide"),a.remove()})),l}},9102:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(2790),n=i(4497),a=i(7362);function o(e){return t=this,i=void 0,r=function*(){const{peerId:t,threadId:i,lastMsgId:o}=e,r=Promise.resolve(),d=(0,n.Z)("t.me/c/"+t.toChatId()+(i?"/"+(0,s.Z)(i):"")+(o?"/"+(0,s.Z)(o):""));return d.classList.add("topic-name","topic-name-button"),d.append(yield(0,a.Z)(e)),{cached:!0,element:d,loadPromise:r}},new((o=void 0)||(o=Promise))((function(e,s){function n(e){try{d(r.next(e))}catch(e){s(e)}}function a(e){try{d(r.throw(e))}catch(e){s(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(n,a)}d((r=r.apply(t,i||[])).next())}));var t,i,o,r}},2887:(e,t,i)=>{"use strict";i.d(t,{Z:()=>A});var s=i(4762),n=i(5296),a=i(3725),o=i(3910),r=i(2738),d=i(7660),l=i(8487),c=i(6740),h=i(8580),u=i(5994),p=i(5471),f=i(4755),m=i(319),g=i(925),v=i(3035),b=i(6724),y=i(9674),w=i(5157),S=i(2312),C=i(7030),L=i(1507),I=i(3512),E=i(5814),P=i(3013),Z=i(8448),M=i(3442),T=i(9492),k=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};let x=0;function A({doc:e,container:t,message:i,boxWidth:A,boxHeight:_,withTail:F,isOut:D,middleware:R,lazyLoadQueue:B,noInfo:N,group:O,onlyPreview:U,noPreview:H,withoutPreloader:z,loadPromises:j,noPlayButton:G,photoSize:V,videoSize:K,searchContext:W,autoDownload:$,managers:q=I.Z.managers,noAutoplayAttribute:Y}){var Q;return k(this,void 0,void 0,(function*(){const I=null==$?void 0:$.video;let X=0===I;const J=!(A&&_),ee=("video"!==e.type||e.size<=52428800&&!J)&&("gif"===e.type?u.Z.isAvailable("gif"):u.Z.isAvailable("video"));let te,ie;if(!N){te=document.createElement("span"),te.classList.add("video-time"),t.append(te);let i=!1;"gif"!==e.type?(te.innerText=(0,w.Z)(e.duration,!1),G||"round"===e.type||(ee&&!X?te.classList.add("tgico","can-autoplay"):i=!0)):(te.innerText="GIF",ee||G||(i=!0,X=void 0)),i&&(ie=document.createElement("span"),ie.classList.add("video-play","tgico-largeplay","btn-circle","position-center"),t.append(ie))}const se={};if("image/gif"===e.mime_type){const s=yield(0,T.Z)({photo:e,message:i,container:t,boxWidth:A,boxHeight:_,withTail:F,isOut:D,lazyLoadQueue:B,middleware:R,withoutPreloader:z,loadPromises:j,autoDownloadSize:I,size:V,managers:q});return se.thumb=s,se.loadPromise=s.loadPromises.full,se}let ne;const ae=(0,d.Z)();if(ae.classList.add("media-video"),ae.muted=!0,"round"===e.type){const s=document.createElement("div");s.classList.add("media-round","z-depth-1"),s.dataset.mid=""+i.mid,s.dataset.peerId=""+i.peerId,s.message=i;const a=f.Z.active.round,d=a.width/2,c=3.5,h=d-2*c;s.innerHTML=`\n \n `;const u=s.firstElementChild.firstElementChild;x||(x=2*Math.PI*h),u.style.strokeDasharray=x+" "+x,u.style.strokeDashoffset=""+x,te.classList.add("tgico"),i.pFlags.media_unread&&s.classList.add("is-unread");const p=document.createElement("canvas");p.width=p.height=e.w,s.prepend(p,te),s.append(ae),t.append(s);const m=p.getContext("2d"),g=()=>{const e=s.message,t=P.Z.addMedia(e,!X),i=()=>{(C.ZP.chat.setPeerPromise||Promise.resolve()).finally((()=>{(0,l.Z)(t)||(t.removeEventListener("play",h),t.removeEventListener("timeupdate",c),t.removeEventListener("pause",f),t.removeEventListener("ended",g))}))},a=()=>{m.drawImage(t,0,0);const e=x-t.currentTime/t.duration*x;return u.style.strokeDashoffset=""+e,!t.paused},d=()=>{t.duration&&((0,l.Z)(t)?(t.paused&&a(),te.innerText=(0,w.Z)(t.duration-t.currentTime,!1)):i())},c=(0,b.Z)((()=>{(0,v.T2)(d)}),1e3,!1),h=()=>{ae.classList.add("hide"),s.classList.remove("is-paused"),(0,n.cK)(a,p),ne&&ne.preloader&&ne.preloader.classList.contains("manual")&&ne.onClick()},f=()=>{(0,l.Z)(t)?s.classList.add("is-paused"):i()},g=()=>{ae.classList.remove("hide"),s.classList.add("is-paused"),ae.currentTime=0,te.innerText=(0,w.Z)(t.duration,!1),t.currentTime&&(t.currentTime=0)};t.addEventListener("play",h),t.addEventListener("timeupdate",c),t.addEventListener("pause",f),t.addEventListener("ended",g),(0,r.fc)(p,(i=>{if((0,o.Z)(i),ne&&!ne.detached&&ne.onClick(),t.paused){const i=!!W;if(P.Z.setSearchContext(W||{peerId:L.NM,inputFilter:{_:"inputMessagesFilterEmpty"},useSearch:!1})){const[t,n]=i?(0,Z.ns)(s,e.mid):[];P.Z.setTargets({peerId:e.peerId,mid:e.mid},t,n)}t.play()}else t.pause()})),t.paused?t.duration&&t.currentTime!==t.duration&&t.currentTime>0?(a(),d(),ae.classList.add("hide")):f():h()};i.pFlags.is_outgoing?(s.onLoad=g,s.dataset.isOutgoing="1"):g()}else Y||(ae.autoplay=!0);let oe,re;if(i){if(oe=yield(0,T.Z)({photo:e,message:i,container:t,boxWidth:A,boxHeight:_,withTail:F,isOut:D,lazyLoadQueue:B,middleware:R,withoutPreloader:!0,loadPromises:j,autoDownloadSize:null==$?void 0:$.photo,size:V,managers:q}),se.thumb=oe,!ee&&"gif"!==e.type||U)return se.loadPromise=oe.loadPromises.full,se;if(F){const e=(oe.images.thumb||oe.images.full).parentElement;ae.width=+e.getAttributeNS(null,"width"),ae.height=+e.getAttributeNS(null,"height"),e.append(ae)}}else if(!H){const i=(0,h.Z)(e,{},!0);if(i){const e=i.image;e.classList.add("media-poster"),t.append(e),se.thumb={loadPromises:{thumb:i.loadPromise,full:Promise.resolve()},images:{thumb:e,full:null},preloader:null,aspecter:null},null==j||j.push(i.loadPromise),se.loadPromise=i.loadPromise}}if(U)return se;!ae.parentElement&&t&&((null==oe?void 0:oe.aspecter)||t).append(ae);const de=()=>k(this,void 0,void 0,(function*(){return re=yield q.thumbsStorage.getCacheContext(e,null==K?void 0:K.type)}));yield de();const le=null==i?void 0:i.uploadingFileName;le?(ne=new M.Z({attachMethod:"prepend",isUpload:!0}),ne.attachPromise(S.Z.getUpload(le)),ne.attach(t,!1),X=void 0):re.downloaded||e.supportsStreaming||z?e.supportsStreaming&&(ne=new M.Z({cancelable:!1,attachMethod:"prepend"})):ne=new M.Z({attachMethod:"prepend"});const ce=(0,a.Z)();if(ae.addEventListener("error",(e=>{4!==ae.error.code&&console.error("Error "+ae.error.code+"; details: "+ae.error.message),ne&&!le&&ne.detach(),ce.isFulfilled||ce.resolve()}),{once:!0}),"video"===e.type){const e=()=>{ae.duration&&(te.innerText=(0,w.Z)(ae.duration-ae.currentTime,!1))},t=(0,b.Z)((()=>{(0,v.T2)(e)}),1e3,!1);ae.addEventListener("timeupdate",t),ie&&ae.addEventListener("timeupdate",(()=>{y.Z.mutateElement(ie,(()=>{ie.remove()}))}),{once:!0})}ae.muted=!0,ae.loop=!0,Y||(ae.autoplay=!0);let he=X&&(null===(Q=null==oe?void 0:oe.preloader)||void 0===Q?void 0:Q.loadFunc);const ue=()=>k(this,void 0,void 0,(function*(){ne&&X&&!z&&(ne.construct(),ne.setManual()),yield de();let n=Promise.resolve();if(ne&&!le||z)if(re.downloaded||e.supportsStreaming)e.supportsStreaming&&(X?n=Promise.reject((0,p.Z)("NO_AUTO_DOWNLOAD")):!re.downloaded&&ne&&(ne.attach(t,!1,null),ae.addEventListener(s.IS_SAFARI?"timeupdate":"canplay",(()=>{ne.detach()}),{once:!0})));else{const i=n=S.Z.downloadMediaURL({media:e,queueId:null==B?void 0:B.queueId,onlyCache:X,thumb:K});ne&&ne.attach(t,!1,i)}return!X&&he&&(he(),he=null),X=void 0,n.then((()=>k(this,void 0,void 0,(function*(){!R||R()?("round"===e.type&&P.Z.resolveWaitingForLoadMedia(i.peerId,i.mid,i.pFlags.is_scheduled),yield de(),(0,g.Z)(ae).then((()=>{O&&E.Z.addAnimation({animation:ae,group:O}),ne&&!le&&ne.detach(),ce.resolve()}),(e=>{console.error("video load error",e),te&&te.classList.add("is-error"),ce.reject(e)})),(0,c.ZP)(ae,re.url)):ce.resolve()}))),m.Z),{download:n,render:Promise.all([n,ce])}}));return ne&&!le&&ne.setDownloadFunction(ue),t.preloader=ne,"gif"!==e.type||ee?se.loadPromise=B?(B.push({div:t,load:()=>ue().then((({render:e})=>e))}),Promise.resolve()):(yield ue()).render:(0,r.fc)(t,(e=>{(0,o.Z)(e),ie.remove(),ue()}),{capture:!0,once:!0}),se.thumb&&(yield se.thumb.loadPromises.thumb),se}))}f.Z.addEventListener("changeScreen",((e,t)=>{if(t===f._.mobile||e===f._.mobile){const e=Array.from(document.querySelectorAll(".media-round .progress-ring")),t=f.Z.active.round.width,i=t/2,s=i-7;x=2*Math.PI*s,e.forEach((e=>{e.setAttributeNS(null,"width",""+t),e.setAttributeNS(null,"height",""+t);const n=e.firstElementChild;n.setAttributeNS(null,"cx",""+i),n.setAttributeNS(null,"cy",""+i),n.setAttributeNS(null,"r",""+s),n.style.strokeDasharray=x+" "+x,n.style.strokeDashoffset=""+x}))}}))},2498:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(8456),n=i(5400);function a(e){const t=(0,s.Z)(e.description||"",150,180);return(0,n.ZP)(t)}},1336:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(8456),n=i(5400);function a(e){let t=e.title||e.author||e.site_name||"";return t=(0,s.Z)(t,80,100),(0,n.ZP)(t,{noLinks:!0,noLinebreaks:!0})}},7445:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});const s={AED:{code:"AED",title:"United Arab Emirates Dirham",symbol:"AED",native:"د.إ.‏",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"367",max_amount:"3673030"},AFN:{code:"AFN",title:"Afghan Afghani",symbol:"AFN",native:"؋",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"8729",max_amount:"87299487"},ALL:{code:"ALL",title:"Albanian Lek",symbol:"ALL",native:"Lek",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!1,exp:2,min_amount:"11842",max_amount:"118421187"},AMD:{code:"AMD",title:"Armenian Dram",symbol:"AMD",native:"դր.",thousands_sep:",",decimal_sep:".",symbol_left:!1,space_between:!0,exp:2,min_amount:"40943",max_amount:"409436718"},ARS:{code:"ARS",title:"Argentine Peso",symbol:"ARS",native:"$",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!0,exp:2,min_amount:"14705",max_amount:"147059002"},AUD:{code:"AUD",title:"Australian Dollar",symbol:"AU$",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"153",max_amount:"1536825"},AZN:{code:"AZN",title:"Azerbaijani Manat",symbol:"AZN",native:"ман.",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"169",max_amount:"1699858"},BAM:{code:"BAM",title:"Bosnia & Herzegovina Convertible Mark",symbol:"BAM",native:"KM",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"199",max_amount:"1990677"},BDT:{code:"BDT",title:"Bangladeshi Taka",symbol:"BDT",native:"৳",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"10009",max_amount:"100094046"},BGN:{code:"BGN",title:"Bulgarian Lev",symbol:"BGN",native:"лв.",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"199",max_amount:"1993315"},BND:{code:"BND",title:"Brunei Dollar",symbol:"BND",native:"$",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!1,exp:2,min_amount:"142",max_amount:"1421883"},BOB:{code:"BOB",title:"Bolivian Boliviano",symbol:"BOB",native:"Bs",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!0,exp:2,min_amount:"683",max_amount:"6832607"},BRL:{code:"BRL",title:"Brazilian Real",symbol:"R$",native:"R$",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!0,exp:2,min_amount:"539",max_amount:"5397799"},BYN:{code:"BYN",title:"Belarusian ruble",symbol:"BYN",native:"BYN",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"249",max_amount:"2495801"},CAD:{code:"CAD",title:"Canadian Dollar",symbol:"CA$",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"136",max_amount:"1366860"},CHF:{code:"CHF",title:"Swiss Franc",symbol:"CHF",native:"CHF",thousands_sep:"'",decimal_sep:".",symbol_left:!1,space_between:!0,exp:2,min_amount:"97",max_amount:"976705"},CLP:{code:"CLP",title:"Chilean Peso",symbol:"CLP",native:"$",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!0,exp:0,min_amount:"963",max_amount:"9637495"},CNY:{code:"CNY",title:"Chinese Renminbi Yuan",symbol:"CN¥",native:"CN¥",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"709",max_amount:"7094102"},COP:{code:"COP",title:"Colombian Peso",symbol:"COP",native:"$",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!0,exp:2,min_amount:"452870",max_amount:"4528700000"},CRC:{code:"CRC",title:"Costa Rican Colón",symbol:"CRC",native:"₡",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!1,exp:2,min_amount:"62506",max_amount:"625061070"},CZK:{code:"CZK",title:"Czech Koruna",symbol:"CZK",native:"Kč",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"2497",max_amount:"24975029"},DKK:{code:"DKK",title:"Danish Krone",symbol:"DKK",native:"kr",thousands_sep:"",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"755",max_amount:"7555990"},DOP:{code:"DOP",title:"Dominican Peso",symbol:"DOP",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"5275",max_amount:"52757308"},DZD:{code:"DZD",title:"Algerian Dinar",symbol:"DZD",native:"د.ج.‏",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"14035",max_amount:"140353307"},EGP:{code:"EGP",title:"Egyptian Pound",symbol:"EGP",native:"ج.م.‏",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"1953",max_amount:"19537405"},ETB:{code:"ETB",title:"Ethiopian Birr",symbol:"ETB",native:"ብር",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"5224",max_amount:"52247069"},EUR:{code:"EUR",title:"Euro",symbol:"€",native:"€",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"101",max_amount:"1016045"},GBP:{code:"GBP",title:"British Pound",symbol:"£",native:"£",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"89",max_amount:"894445"},GEL:{code:"GEL",title:"Georgian Lari",symbol:"GEL",native:"GEL",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"283",max_amount:"2830234"},GTQ:{code:"GTQ",title:"Guatemalan Quetzal",symbol:"GTQ",native:"Q",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"778",max_amount:"7781323"},HKD:{code:"HKD",title:"Hong Kong Dollar",symbol:"HK$",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"784",max_amount:"7849750"},HNL:{code:"HNL",title:"Honduran Lempira",symbol:"HNL",native:"L",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"2441",max_amount:"24413729"},HRK:{code:"HRK",title:"Croatian Kuna",symbol:"HRK",native:"kn",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"764",max_amount:"7648805"},HUF:{code:"HUF",title:"Hungarian Forint",symbol:"HUF",native:"Ft",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"42685",max_amount:"426850229"},IDR:{code:"IDR",title:"Indonesian Rupiah",symbol:"IDR",native:"Rp",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!1,exp:2,min_amount:"1523370",max_amount:"15233700000"},ILS:{code:"ILS",title:"Israeli New Sheqel",symbol:"₪",native:"₪",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"354",max_amount:"3543350"},INR:{code:"INR",title:"Indian Rupee",symbol:"₹",native:"₹",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"8155",max_amount:"81555550"},ISK:{code:"ISK",title:"Icelandic Króna",symbol:"ISK",native:"kr",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!0,exp:0,min_amount:"142",max_amount:"1425603"},JMD:{code:"JMD",title:"Jamaican Dollar",symbol:"JMD",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"15013",max_amount:"150131044"},JPY:{code:"JPY",title:"Japanese Yen",symbol:"¥",native:"¥",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:0,min_amount:"144",max_amount:"1443065"},KES:{code:"KES",title:"Kenyan Shilling",symbol:"KES",native:"Ksh",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"12075",max_amount:"120750271"},KGS:{code:"KGS",title:"Kyrgyzstani Som",symbol:"KGS",native:"KGS",thousands_sep:" ",decimal_sep:"-",symbol_left:!1,space_between:!0,exp:2,min_amount:"8018",max_amount:"80182898"},KRW:{code:"KRW",title:"South Korean Won",symbol:"₩",native:"₩",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:0,min_amount:"1431",max_amount:"14315201"},KZT:{code:"KZT",title:"Kazakhstani Tenge",symbol:"KZT",native:"₸",thousands_sep:" ",decimal_sep:"-",symbol_left:!0,space_between:!1,exp:2,min_amount:"47186",max_amount:"471867112"},LBP:{code:"LBP",title:"Lebanese Pound",symbol:"LBP",native:"ل.ل.‏",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"150999",max_amount:"1509998778"},LKR:{code:"LKR",title:"Sri Lankan Rupee",symbol:"LKR",native:"රු.",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"35546",max_amount:"355469651"},MAD:{code:"MAD",title:"Moroccan Dirham",symbol:"MAD",native:"د.م.‏",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"1093",max_amount:"10938136"},MDL:{code:"MDL",title:"Moldovan Leu",symbol:"MDL",native:"MDL",thousands_sep:",",decimal_sep:".",symbol_left:!1,space_between:!0,exp:2,min_amount:"1926",max_amount:"19264439"},MNT:{code:"MNT",title:"Mongolian Tögrög",symbol:"MNT",native:"MNT",thousands_sep:" ",decimal_sep:",",symbol_left:!0,space_between:!1,exp:2,min_amount:"322444",max_amount:"3224442056"},MUR:{code:"MUR",title:"Mauritian Rupee",symbol:"MUR",native:"MUR",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"4453",max_amount:"44535174"},MVR:{code:"MVR",title:"Maldivian Rufiyaa",symbol:"MVR",native:"MVR",thousands_sep:",",decimal_sep:".",symbol_left:!1,space_between:!0,exp:2,min_amount:"1546",max_amount:"15460397"},MXN:{code:"MXN",title:"Mexican Peso",symbol:"MX$",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"2012",max_amount:"20122860"},MYR:{code:"MYR",title:"Malaysian Ringgit",symbol:"MYR",native:"RM",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"463",max_amount:"4632502"},MZN:{code:"MZN",title:"Mozambican Metical",symbol:"MZN",native:"MTn",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"6382",max_amount:"63829729"},NGN:{code:"NGN",title:"Nigerian Naira",symbol:"NGN",native:"₦",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"43203",max_amount:"432039828"},NIO:{code:"NIO",title:"Nicaraguan Córdoba",symbol:"NIO",native:"C$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"3556",max_amount:"35566412"},NOK:{code:"NOK",title:"Norwegian Krone",symbol:"NOK",native:"kr",thousands_sep:" ",decimal_sep:",",symbol_left:!0,space_between:!0,exp:2,min_amount:"1069",max_amount:"10690975"},NPR:{code:"NPR",title:"Nepalese Rupee",symbol:"NPR",native:"नेरू",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"12954",max_amount:"129546657"},NZD:{code:"NZD",title:"New Zealand Dollar",symbol:"NZ$",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"174",max_amount:"1746220"},PAB:{code:"PAB",title:"Panamanian Balboa",symbol:"PAB",native:"B/.",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"98",max_amount:"988722"},PEN:{code:"PEN",title:"Peruvian Nuevo Sol",symbol:"PEN",native:"S/.",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"390",max_amount:"3902208"},PHP:{code:"PHP",title:"Philippine Peso",symbol:"PHP",native:"₱",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"5862",max_amount:"58627496"},PKR:{code:"PKR",title:"Pakistani Rupee",symbol:"PKR",native:"₨",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"22642",max_amount:"226426805"},PLN:{code:"PLN",title:"Polish Złoty",symbol:"PLN",native:"zł",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"493",max_amount:"4932350"},PYG:{code:"PYG",title:"Paraguayan Guaraní",symbol:"PYG",native:"₲",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!0,exp:0,min_amount:"6977",max_amount:"69772317"},QAR:{code:"QAR",title:"Qatari Riyal",symbol:"QAR",native:"ر.ق.‏",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"364",max_amount:"3640989"},RON:{code:"RON",title:"Romanian Leu",symbol:"RON",native:"RON",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"502",max_amount:"5028645"},RSD:{code:"RSD",title:"Serbian Dinar",symbol:"RSD",native:"дин.",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"11918",max_amount:"119184990"},RUB:{code:"RUB",title:"Russian Ruble",symbol:"RUB",native:"₽",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"7128",max_amount:"71281218"},SAR:{code:"SAR",title:"Saudi Riyal",symbol:"SAR",native:"ر.س.‏",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"375",max_amount:"3756546"},SEK:{code:"SEK",title:"Swedish Krona",symbol:"SEK",native:"kr",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"1109",max_amount:"11094972"},SGD:{code:"SGD",title:"Singapore Dollar",symbol:"SGD",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"143",max_amount:"1430495"},THB:{code:"THB",title:"Thai Baht",symbol:"฿",native:"฿",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"3780",max_amount:"37800497"},TJS:{code:"TJS",title:"Tajikistani Somoni",symbol:"TJS",native:"TJS",thousands_sep:" ",decimal_sep:";",symbol_left:!1,space_between:!0,exp:2,min_amount:"975",max_amount:"9753854"},TRY:{code:"TRY",title:"Turkish Lira",symbol:"TRY",native:"TL",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"1854",max_amount:"18543598"},TTD:{code:"TTD",title:"Trinidad and Tobago Dollar",symbol:"TTD",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"672",max_amount:"6722681"},TWD:{code:"TWD",title:"New Taiwan Dollar",symbol:"NT$",native:"NT$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"3173",max_amount:"31738502"},TZS:{code:"TZS",title:"Tanzanian Shilling",symbol:"TZS",native:"TSh",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"233199",max_amount:"2331999890"},UAH:{code:"UAH",title:"Ukrainian Hryvnia",symbol:"UAH",native:"₴",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!1,exp:2,min_amount:"3633",max_amount:"36338830"},UGX:{code:"UGX",title:"Ugandan Shilling",symbol:"UGX",native:"USh",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:0,min_amount:"3816",max_amount:"38166726"},USD:{code:"USD",title:"United States Dollar",symbol:"$",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"100",max_amount:1e6},UYU:{code:"UYU",title:"Uruguayan Peso",symbol:"UYU",native:"$",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!0,exp:2,min_amount:"4080",max_amount:"40801205"},UZS:{code:"UZS",title:"Uzbekistani Som",symbol:"UZS",native:"UZS",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"1089058",max_amount:"10890583014"},VND:{code:"VND",title:"Vietnamese Đồng",symbol:"₫",native:"₫",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!0,exp:0,min_amount:"23862",max_amount:"238625000"},YER:{code:"YER",title:"Yemeni Rial",symbol:"YER",native:"ر.ي.‏",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"25030",max_amount:"250300677"},ZAR:{code:"ZAR",title:"South African Rand",symbol:"ZAR",native:"R",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"1789",max_amount:"17894299"}}},3447:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a,i:()=>s});const s={14:{"1f6dd":4867,"1f6de":4916,"1f6df":4923,"1f7f0":62832,"1f979":183,"1f9cc":1557,"1fa7b":61332,"1fa7c":61330,"1faa9":51093,"1faaa":61364,"1faab":61189,"1faac":51085,"1fab7":2651,"1fab8":2631,"1fab9":2672,"1faba":2673,"1fac3":1520,"1fac4":1521,"1fac5":1505,"1fad7":3793,"1fad8":3707,"1fad9":3804,"1fae0":111,"1fae1":136,"1fae2":132,"1fae3":133,"1fae4":174,"1fae5":142,"1fae6":1385,"1fae7":61353,"1faf0":1341,"1faf1":1332,"1faf2":1333,"1faf3":1334,"1faf4":1335,"1faf5":1351,"1faf6":1360,"1faf1-1f3fb-200d-1faf2-1f3fc":0,"1faf1-1f3fb-200d-1faf2-1f3fd":0,"1faf1-1f3fb-200d-1faf2-1f3fe":0,"1faf1-1f3fb-200d-1faf2-1f3ff":0,"1faf1-1f3fc-200d-1faf2-1f3fb":0,"1faf1-1f3fc-200d-1faf2-1f3fd":0,"1faf1-1f3fc-200d-1faf2-1f3fe":0,"1faf1-1f3fc-200d-1faf2-1f3ff":0,"1faf1-1f3fd-200d-1faf2-1f3fb":0,"1faf1-1f3fd-200d-1faf2-1f3fc":0,"1faf1-1f3fd-200d-1faf2-1f3fe":0,"1faf1-1f3fd-200d-1faf2-1f3ff":0,"1faf1-1f3fe-200d-1faf2-1f3fb":0,"1faf1-1f3fe-200d-1faf2-1f3fc":0,"1faf1-1f3fe-200d-1faf2-1f3fd":0,"1faf1-1f3fe-200d-1faf2-1f3ff":0,"1faf1-1f3ff-200d-1faf2-1f3fb":0,"1faf1-1f3ff-200d-1faf2-1f3fc":0,"1faf1-1f3ff-200d-1faf2-1f3fd":0,"1faf1-1f3ff-200d-1faf2-1f3fe":0,"1fac3-1f3fb":0,"1fac3-1f3fc":0,"1fac3-1f3fd":0,"1fac3-1f3fe":0,"1fac3-1f3ff":0,"1fac4-1f3fb":0,"1fac4-1f3fc":0,"1fac4-1f3fd":0,"1fac4-1f3fe":0,"1fac4-1f3ff":0,"1fac5-1f3fb":0,"1fac5-1f3fc":0,"1fac5-1f3fd":0,"1fac5-1f3fe":0,"1fac5-1f3ff":0,"1faf0-1f3fb":0,"1faf0-1f3fc":0,"1faf0-1f3fd":0,"1faf0-1f3fe":0,"1faf0-1f3ff":0,"1faf1-1f3fb":0,"1faf1-1f3fc":0,"1faf1-1f3fd":0,"1faf1-1f3fe":0,"1faf1-1f3ff":0,"1faf2-1f3fb":0,"1faf2-1f3fc":0,"1faf2-1f3fd":0,"1faf2-1f3fe":0,"1faf2-1f3ff":0,"1faf3-1f3fb":0,"1faf3-1f3fc":0,"1faf3-1f3fd":0,"1faf3-1f3fe":0,"1faf3-1f3ff":0,"1faf4-1f3fb":0,"1faf4-1f3fc":0,"1faf4-1f3fd":0,"1faf4-1f3fe":0,"1faf4-1f3ff":0,"1faf5-1f3fb":0,"1faf5-1f3fc":0,"1faf5-1f3fd":0,"1faf5-1f3fe":0,"1faf5-1f3ff":0,"1faf6-1f3fb":0,"1faf6-1f3fc":0,"1faf6-1f3fd":0,"1faf6-1f3fe":0,"1faf6-1f3ff":0},"":{2049:62835,2122:62863,2139:62888,2194:62764,2195:62763,2196:62762,2197:62756,2198:62758,2199:62760,2328:61194,2600:4990,2601:4998,2602:41013,2603:41018,2604:41020,2611:62851,2614:41014,2615:3781,2618:2667,2620:1106,2622:62753,2623:62754,2626:62783,2638:62780,2639:177,2648:62788,2649:62789,2650:62796,2651:62797,2652:62798,2653:62799,2660:51095,2663:51098,2665:51096,2666:51097,2668:4865,2692:61297,2693:4922,2694:61300,2696:61311,2697:61319,2699:61309,2702:61284,2705:62850,2708:4931,2709:61245,2712:61259,2714:62852,2716:62828,2721:62779,2728:51029,2733:62858,2734:62859,2744:41017,2747:62860,2753:62836,2754:62837,2755:62838,2757:62839,2763:1137,2764:1141,2795:62829,2796:62830,2797:62831,2934:62767,2935:62768,3030:62840,3297:62912,3299:62913,"0023-20e3":62864,"002a-20e3":62865,"0030-20e3":62866,"0031-20e3":62867,"0032-20e3":62868,"0033-20e3":62869,"0034-20e3":62870,"0035-20e3":62871,"0036-20e3":62872,"0037-20e3":62873,"0038-20e3":62874,"0039-20e3":62875,"00a9":62861,"00ae":62862,"1f004":51101,"1f0cf":51100,"1f170":62882,"1f171":62884,"1f17e":62893,"1f17f":62895,"1f18e":62883,"1f191":62885,"1f192":62886,"1f193":62887,"1f194":62889,"1f195":62891,"1f196":62892,"1f197":62894,"1f198":62896,"1f199":62897,"1f19a":62898,"1f1e6-1f1e8":71594,"1f1e6-1f1e9":71595,"1f1e6-1f1ea":71596,"1f1e6-1f1eb":71597,"1f1e6-1f1ec":71598,"1f1e6-1f1ee":71599,"1f1e6-1f1f1":71600,"1f1e6-1f1f2":71601,"1f1e6-1f1f4":71602,"1f1e6-1f1f6":71603,"1f1e6-1f1f7":71604,"1f1e6-1f1f8":71605,"1f1e6-1f1f9":71606,"1f1e6-1f1fa":71607,"1f1e6-1f1fc":71608,"1f1e6-1f1fd":71609,"1f1e6-1f1ff":71610,"1f1e7-1f1e6":71611,"1f1e7-1f1e7":71612,"1f1e7-1f1e9":71613,"1f1e7-1f1ea":71614,"1f1e7-1f1eb":71615,"1f1e7-1f1ec":71616,"1f1e7-1f1ed":71617,"1f1e7-1f1ee":71618,"1f1e7-1f1ef":71619,"1f1e7-1f1f1":71620,"1f1e7-1f1f2":71621,"1f1e7-1f1f3":71622,"1f1e7-1f1f4":71623,"1f1e7-1f1f6":71624,"1f1e7-1f1f7":71625,"1f1e7-1f1f8":71626,"1f1e7-1f1f9":71627,"1f1e7-1f1fb":71628,"1f1e7-1f1fc":71629,"1f1e7-1f1fe":71630,"1f1e7-1f1ff":71631,"1f1e8-1f1e6":71632,"1f1e8-1f1e8":71633,"1f1e8-1f1e9":71634,"1f1e8-1f1eb":71635,"1f1e8-1f1ec":71636,"1f1e8-1f1ed":71637,"1f1e8-1f1ee":71638,"1f1e8-1f1f0":71639,"1f1e8-1f1f1":71640,"1f1e8-1f1f2":71641,"1f1e8-1f1f3":71642,"1f1e8-1f1f4":71643,"1f1e8-1f1f5":71644,"1f1e8-1f1f7":71645,"1f1e8-1f1fa":71646,"1f1e8-1f1fb":71647,"1f1e8-1f1fc":71648,"1f1e8-1f1fd":71649,"1f1e8-1f1fe":71650,"1f1e8-1f1ff":71651,"1f1e9-1f1ea":71652,"1f1e9-1f1ec":71653,"1f1e9-1f1ef":71654,"1f1e9-1f1f0":71655,"1f1e9-1f1f2":71656,"1f1e9-1f1f4":71657,"1f1e9-1f1ff":71658,"1f1ea-1f1e6":71659,"1f1ea-1f1e8":71660,"1f1ea-1f1ea":71661,"1f1ea-1f1ec":71662,"1f1ea-1f1ed":71663,"1f1ea-1f1f7":71664,"1f1ea-1f1f8":71665,"1f1ea-1f1f9":71666,"1f1ea-1f1fa":71667,"1f1eb-1f1ee":71668,"1f1eb-1f1ef":71669,"1f1eb-1f1f0":71670,"1f1eb-1f1f2":71671,"1f1eb-1f1f4":71672,"1f1eb-1f1f7":71673,"1f1ec-1f1e6":71674,"1f1ec-1f1e7":71675,"1f1ec-1f1e9":71676,"1f1ec-1f1ea":71677,"1f1ec-1f1eb":71678,"1f1ec-1f1ec":71679,"1f1ec-1f1ed":71680,"1f1ec-1f1ee":71681,"1f1ec-1f1f1":71682,"1f1ec-1f1f2":71683,"1f1ec-1f1f3":71684,"1f1ec-1f1f5":71685,"1f1ec-1f1f6":71686,"1f1ec-1f1f7":71687,"1f1ec-1f1f8":71688,"1f1ec-1f1f9":71689,"1f1ec-1f1fa":71690,"1f1ec-1f1fc":71691,"1f1ec-1f1fe":71692,"1f1ed-1f1f0":71693,"1f1ed-1f1f2":71694,"1f1ed-1f1f3":71695,"1f1ed-1f1f7":71696,"1f1ed-1f1f9":71697,"1f1ed-1f1fa":71698,"1f1ee-1f1e8":71699,"1f1ee-1f1e9":71700,"1f1ee-1f1ea":71701,"1f1ee-1f1f1":71702,"1f1ee-1f1f2":71703,"1f1ee-1f1f3":71704,"1f1ee-1f1f4":71705,"1f1ee-1f1f6":71706,"1f1ee-1f1f7":71707,"1f1ee-1f1f8":71708,"1f1ee-1f1f9":71709,"1f1ef-1f1ea":71710,"1f1ef-1f1f2":71711,"1f1ef-1f1f4":71712,"1f1ef-1f1f5":71713,"1f1f0-1f1ea":71714,"1f1f0-1f1ec":71715,"1f1f0-1f1ed":71716,"1f1f0-1f1ee":71717,"1f1f0-1f1f2":71718,"1f1f0-1f1f3":71719,"1f1f0-1f1f5":71720,"1f1f0-1f1f7":71721,"1f1f0-1f1fc":71722,"1f1f0-1f1fe":71723,"1f1f0-1f1ff":71724,"1f1f1-1f1e6":71725,"1f1f1-1f1e7":71726,"1f1f1-1f1e8":71727,"1f1f1-1f1ee":71728,"1f1f1-1f1f0":71729,"1f1f1-1f1f7":71730,"1f1f1-1f1f8":71731,"1f1f1-1f1f9":71732,"1f1f1-1f1fa":71733,"1f1f1-1f1fb":71734,"1f1f1-1f1fe":71735,"1f1f2-1f1e6":71736,"1f1f2-1f1e8":71737,"1f1f2-1f1e9":71738,"1f1f2-1f1ea":71739,"1f1f2-1f1eb":71740,"1f1f2-1f1ec":71741,"1f1f2-1f1ed":71742,"1f1f2-1f1f0":71743,"1f1f2-1f1f1":71744,"1f1f2-1f1f2":71745,"1f1f2-1f1f3":71746,"1f1f2-1f1f4":71747,"1f1f2-1f1f5":71748,"1f1f2-1f1f6":71749,"1f1f2-1f1f7":71750,"1f1f2-1f1f8":71751,"1f1f2-1f1f9":71752,"1f1f2-1f1fa":71753,"1f1f2-1f1fb":71754,"1f1f2-1f1fc":71755,"1f1f2-1f1fd":71756,"1f1f2-1f1fe":71757,"1f1f2-1f1ff":71758,"1f1f3-1f1e6":71759,"1f1f3-1f1e8":71760,"1f1f3-1f1ea":71761,"1f1f3-1f1eb":71762,"1f1f3-1f1ec":71763,"1f1f3-1f1ee":71764,"1f1f3-1f1f1":71765,"1f1f3-1f1f4":71766,"1f1f3-1f1f5":71767,"1f1f3-1f1f7":71768,"1f1f3-1f1fa":71769,"1f1f3-1f1ff":71770,"1f1f4-1f1f2":71771,"1f1f5-1f1e6":71772,"1f1f5-1f1ea":71773,"1f1f5-1f1eb":71774,"1f1f5-1f1ec":71775,"1f1f5-1f1ed":71776,"1f1f5-1f1f0":71777,"1f1f5-1f1f1":71778,"1f1f5-1f1f2":71779,"1f1f5-1f1f3":71780,"1f1f5-1f1f7":71781,"1f1f5-1f1f8":71782,"1f1f5-1f1f9":71783,"1f1f5-1f1fc":71784,"1f1f5-1f1fe":71785,"1f1f6-1f1e6":71786,"1f1f7-1f1ea":71787,"1f1f7-1f1f4":71788,"1f1f7-1f1f8":71789,"1f1f7-1f1fa":71790,"1f1f7-1f1fc":71791,"1f1f8-1f1e6":71792,"1f1f8-1f1e7":71793,"1f1f8-1f1e8":71794,"1f1f8-1f1e9":71795,"1f1f8-1f1ea":71796,"1f1f8-1f1ec":71797,"1f1f8-1f1ed":71798,"1f1f8-1f1ee":71799,"1f1f8-1f1ef":71800,"1f1f8-1f1f0":71801,"1f1f8-1f1f1":71802,"1f1f8-1f1f2":71803,"1f1f8-1f1f3":71804,"1f1f8-1f1f4":71805,"1f1f8-1f1f7":71806,"1f1f8-1f1f8":71807,"1f1f8-1f1f9":71808,"1f1f8-1f1fb":71809,"1f1f8-1f1fd":71810,"1f1f8-1f1fe":71811,"1f1f8-1f1ff":71812,"1f1f9-1f1e6":71813,"1f1f9-1f1e8":71814,"1f1f9-1f1e9":71815,"1f1f9-1f1eb":71816,"1f1f9-1f1ec":71817,"1f1f9-1f1ed":71818,"1f1f9-1f1ef":71819,"1f1f9-1f1f0":71820,"1f1f9-1f1f1":71821,"1f1f9-1f1f2":71822,"1f1f9-1f1f3":71823,"1f1f9-1f1f4":71824,"1f1f9-1f1f7":71825,"1f1f9-1f1f9":71826,"1f1f9-1f1fb":71827,"1f1f9-1f1fc":71828,"1f1f9-1f1ff":71829,"1f1fa-1f1e6":71830,"1f1fa-1f1ec":71831,"1f1fa-1f1f2":71832,"1f1fa-1f1f3":71833,"1f1fa-1f1f8":71834,"1f1fa-1f1fe":71835,"1f1fa-1f1ff":71836,"1f1fb-1f1e6":71837,"1f1fb-1f1e8":71838,"1f1fb-1f1ea":71839,"1f1fb-1f1ec":71840,"1f1fb-1f1ee":71841,"1f1fb-1f1f3":71842,"1f1fb-1f1fa":71843,"1f1fc-1f1eb":71844,"1f1fc-1f1f8":71845,"1f1fd-1f1f0":71846,"1f1fe-1f1ea":71847,"1f1fe-1f1f9":71848,"1f1ff-1f1e6":71849,"1f1ff-1f1f2":71850,"1f1ff-1f1fc":71851,"1f201":62899,"1f202":62900,"1f21a":62906,"1f22f":62903,"1f232":62907,"1f233":62911,"1f234":62910,"1f235":62915,"1f236":62902,"1f237":62901,"1f238":62909,"1f239":62905,"1f23a":62914,"1f250":62904,"1f251":62908,"1f300":41010,"1f301":4857,"1f302":41012,"1f303":4858,"1f304":4860,"1f305":4861,"1f306":4862,"1f307":4863,"1f308":41011,"1f309":4864,"1f30a":41023,"1f30b":4815,"1f30c":4997,"1f30d":4806,"1f30e":4807,"1f30f":4808,"1f310":4809,"1f311":4977,"1f312":4978,"1f313":4979,"1f314":4980,"1f315":4981,"1f316":4982,"1f317":4983,"1f318":4984,"1f319":4985,"1f31a":4986,"1f31b":4987,"1f31c":4988,"1f31d":4991,"1f31e":4992,"1f31f":4995,"1f320":4996,"1f321":4989,"1f324":41001,"1f325":41002,"1f326":41003,"1f327":41004,"1f328":41005,"1f329":41006,"1f32a":41007,"1f32b":41008,"1f32c":41009,"1f32d":3725,"1f32e":3727,"1f32f":3728,"1f330":3708,"1f331":2659,"1f332":2661,"1f333":2662,"1f334":2663,"1f335":2664,"1f336":3698,"1f337":2658,"1f338":2649,"1f339":2653,"1f33a":2655,"1f33b":2656,"1f33c":2657,"1f33d":3697,"1f33e":2665,"1f33f":2666,"1f340":2668,"1f341":2669,"1f342":2670,"1f343":2671,"1f344":3705,"1f345":3690,"1f346":3694,"1f347":3674,"1f348":3675,"1f349":3676,"1f34a":3677,"1f34b":3678,"1f34c":3679,"1f34d":3680,"1f34e":3682,"1f34f":3683,"1f350":3684,"1f351":3685,"1f352":3686,"1f353":3687,"1f354":3722,"1f355":3724,"1f356":3718,"1f357":3719,"1f358":3744,"1f359":3745,"1f35a":3746,"1f35b":3747,"1f35c":3748,"1f35d":3749,"1f35e":3709,"1f35f":3723,"1f360":3750,"1f361":3756,"1f362":3751,"1f363":3752,"1f364":3753,"1f365":3754,"1f366":3765,"1f367":3766,"1f368":3767,"1f369":3768,"1f36a":3769,"1f36b":3774,"1f36c":3775,"1f36d":3776,"1f36e":3777,"1f36f":3778,"1f370":3771,"1f371":3743,"1f372":3735,"1f373":3733,"1f374":3801,"1f375":3783,"1f376":3784,"1f377":3786,"1f378":3787,"1f379":3788,"1f37a":3789,"1f37b":3790,"1f37c":3779,"1f37d":3800,"1f37e":3785,"1f37f":3739,"1f380":51040,"1f381":51041,"1f382":3770,"1f383":51024,"1f384":51025,"1f385":1527,"1f386":51026,"1f387":51027,"1f388":51030,"1f389":51031,"1f38a":51032,"1f38b":51033,"1f38c":71588,"1f38d":51034,"1f38e":51035,"1f38f":51036,"1f390":51037,"1f391":51038,"1f392":61134,"1f393":61147,"1f396":51045,"1f397":51042,"1f399":61167,"1f39a":61168,"1f39b":61169,"1f39e":61203,"1f39f":51043,"1f3a0":4866,"1f3a1":4868,"1f3a2":4869,"1f3a3":51072,"1f3a4":61170,"1f3a5":61202,"1f3a6":62819,"1f3a7":61171,"1f3a8":51105,"1f3a9":61146,"1f3aa":4871,"1f3ab":51044,"1f3ac":61205,"1f3ad":51103,"1f3ae":51086,"1f3af":51078,"1f3b0":51088,"1f3b1":51081,"1f3b2":51089,"1f3b3":51060,"1f3b4":51102,"1f3b5":61165,"1f3b6":61166,"1f3b7":61173,"1f3b8":61175,"1f3b9":61176,"1f3ba":61177,"1f3bb":61178,"1f3bc":61164,"1f3bd":51074,"1f3be":51058,"1f3bf":51075,"1f3c0":51054,"1f3c1":71586,"1f3c2":1600,"1f3c3-200d-2640":1584,"1f3c3-200d-2642":1583,"1f3c3":1582,"1f3c4-200d-2640":1606,"1f3c4-200d-2642":1605,"1f3c4":1604,"1f3c5":51047,"1f3c6":51046,"1f3c7":1598,"1f3c8":51056,"1f3c9":51057,"1f3ca-200d-2640":1612,"1f3ca-200d-2642":1611,"1f3ca":1610,"1f3cb-200d-2640":1618,"1f3cb-200d-2642":1617,"1f3cb":1616,"1f3cc-200d-2640":1603,"1f3cc-200d-2642":1602,"1f3cc":1601,"1f3cd":4902,"1f3ce":4901,"1f3cf":51061,"1f3d0":51055,"1f3d1":51062,"1f3d2":51063,"1f3d3":51065,"1f3d4":4813,"1f3d5":4817,"1f3d6":4818,"1f3d7":4824,"1f3d8":4829,"1f3d9":4859,"1f3da":4830,"1f3db":4823,"1f3dc":4819,"1f3dd":4820,"1f3de":4821,"1f3df":4822,"1f3e0":4831,"1f3e1":4832,"1f3e2":4833,"1f3e3":4834,"1f3e4":4835,"1f3e5":4836,"1f3e6":4837,"1f3e7":62729,"1f3e8":4838,"1f3e9":4839,"1f3ea":4840,"1f3eb":4841,"1f3ec":4842,"1f3ed":4843,"1f3ee":61216,"1f3ef":4844,"1f3f0":4845,"1f3f3-200d-1f308":71591,"1f3f3-200d-26a7":71592,"1f3f3":71590,"1f3f4-200d-2620":71593,"1f3f4-e0067-e0062-e0065-e006e-e0067-e007f":71852,"1f3f4-e0067-e0062-e0073-e0063-e0074-e007f":71853,"1f3f4-e0067-e0062-e0077-e006c-e0073-e007f":71854,"1f3f4":71589,"1f3f5":2652,"1f3f7":61234,"1f3f8":51066,"1f3f9":61303,"1f3fa":3805,"1f3fb":9525,"1f3fc":9526,"1f3fd":9527,"1f3fe":9528,"1f3ff":9529,"1f400":2576,"1f401":2575,"1f402":2556,"1f403":2557,"1f404":2558,"1f405":2547,"1f406":2548,"1f407":2579,"1f408-200d-2b1b":2544,"1f408":2543,"1f409":2618,"1f40a":2613,"1f40b":2622,"1f40c":2632,"1f40d":2616,"1f40e":2550,"1f40f":2563,"1f410":2565,"1f411":2564,"1f412":2531,"1f413":2596,"1f414":2595,"1f415-200d-1f9ba":2537,"1f415":2535,"1f416":2560,"1f417":2561,"1f418":2570,"1f419":2629,"1f41a":2630,"1f41b":2634,"1f41c":2635,"1f41d":2636,"1f41e":2638,"1f41f":2625,"1f420":2626,"1f421":2627,"1f422":2614,"1f423":2597,"1f424":2598,"1f425":2599,"1f426":2600,"1f427":2601,"1f428":2586,"1f429":2538,"1f42a":2566,"1f42b":2567,"1f42c":2623,"1f42d":2574,"1f42e":2555,"1f42f":2546,"1f430":2578,"1f431":2542,"1f432":2617,"1f433":2621,"1f434":2549,"1f435":2530,"1f436":2534,"1f437":2559,"1f438":2612,"1f439":2577,"1f43a":2539,"1f43b-200d-2744":2585,"1f43b":2584,"1f43c":2587,"1f43d":2562,"1f43e":2593,"1f43f":2580,"1f440":1381,"1f441-200d-1f5e8":1159,"1f441":1382,"1f442":1373,"1f443":1375,"1f444":1384,"1f445":1383,"1f446":1347,"1f447":1349,"1f448":1345,"1f449":1346,"1f44a":1355,"1f44b":1327,"1f44c":1336,"1f44d":1352,"1f44e":1353,"1f44f":1358,"1f450":1361,"1f451":61144,"1f452":61145,"1f453":61110,"1f454":61115,"1f455":61116,"1f456":61117,"1f457":61122,"1f458":61123,"1f459":61128,"1f45a":61129,"1f45b":61130,"1f45c":61131,"1f45d":61132,"1f45e":61136,"1f45f":61137,"1f460":61140,"1f461":61141,"1f462":61143,"1f463":1687,"1f464":1684,"1f465":1685,"1f466":1388,"1f467":1389,"1f468-200d-1f33e":1457,"1f468-200d-1f373":1460,"1f468-200d-1f37c":1524,"1f468-200d-1f393":1448,"1f468-200d-1f3a4":1478,"1f468-200d-1f3a8":1481,"1f468-200d-1f3eb":1451,"1f468-200d-1f3ed":1466,"1f468-200d-1f466-200d-1f466":1674,"1f468-200d-1f466":1673,"1f468-200d-1f467-200d-1f466":1676,"1f468-200d-1f467-200d-1f467":1677,"1f468-200d-1f467":1675,"1f468-200d-1f468-200d-1f466":1663,"1f468-200d-1f468-200d-1f466-200d-1f466":1666,"1f468-200d-1f468-200d-1f467":1664,"1f468-200d-1f468-200d-1f467-200d-1f466":1665,"1f468-200d-1f468-200d-1f467-200d-1f467":1667,"1f468-200d-1f469-200d-1f466":1658,"1f468-200d-1f469-200d-1f466-200d-1f466":1661,"1f468-200d-1f469-200d-1f467":1659,"1f468-200d-1f469-200d-1f467-200d-1f466":1660,"1f468-200d-1f469-200d-1f467-200d-1f467":1662,"1f468-200d-1f4bb":1475,"1f468-200d-1f4bc":1469,"1f468-200d-1f527":1463,"1f468-200d-1f52c":1472,"1f468-200d-1f680":1487,"1f468-200d-1f692":1490,"1f468-200d-1f9af":1574,"1f468-200d-1f9b0":1396,"1f468-200d-1f9b1":1397,"1f468-200d-1f9b2":1399,"1f468-200d-1f9b3":1398,"1f468-200d-1f9bc":1577,"1f468-200d-1f9bd":1580,"1f468-200d-2695":1445,"1f468-200d-2696":1454,"1f468-200d-2708":1484,"1f468-200d-2764-200d-1f468":1655,"1f468-200d-2764-200d-1f48b-200d-1f468":1651,"1f468":1392,"1f469-200d-1f33e":1458,"1f469-200d-1f373":1461,"1f469-200d-1f37c":1523,"1f469-200d-1f393":1449,"1f469-200d-1f3a4":1479,"1f469-200d-1f3a8":1482,"1f469-200d-1f3eb":1452,"1f469-200d-1f3ed":1467,"1f469-200d-1f466-200d-1f466":1679,"1f469-200d-1f466":1678,"1f469-200d-1f467-200d-1f466":1681,"1f469-200d-1f467-200d-1f467":1682,"1f469-200d-1f467":1680,"1f469-200d-1f469-200d-1f466":1668,"1f469-200d-1f469-200d-1f466-200d-1f466":1671,"1f469-200d-1f469-200d-1f467":1669,"1f469-200d-1f469-200d-1f467-200d-1f466":1670,"1f469-200d-1f469-200d-1f467-200d-1f467":1672,"1f469-200d-1f4bb":1476,"1f469-200d-1f4bc":1470,"1f469-200d-1f527":1464,"1f469-200d-1f52c":1473,"1f469-200d-1f680":1488,"1f469-200d-1f692":1491,"1f469-200d-1f9af":1575,"1f469-200d-1f9b0":1401,"1f469-200d-1f9b1":1403,"1f469-200d-1f9b2":1407,"1f469-200d-1f9b3":1405,"1f469-200d-1f9bc":1578,"1f469-200d-1f9bd":1581,"1f469-200d-2695":1446,"1f469-200d-2696":1455,"1f469-200d-2708":1485,"1f469-200d-2764-200d-1f468":1654,"1f469-200d-2764-200d-1f469":1656,"1f469-200d-2764-200d-1f48b-200d-1f468":1650,"1f469-200d-2764-200d-1f48b-200d-1f469":1652,"1f469":1400,"1f46a":1657,"1f46b":1647,"1f46c":1648,"1f46d":1646,"1f46e-200d-2640":1494,"1f46e-200d-2642":1493,"1f46e":1492,"1f46f-200d-2640":1590,"1f46f-200d-2642":1589,"1f46f":1588,"1f470-200d-2640":1518,"1f470-200d-2642":1517,"1f470":1516,"1f471-200d-2640":1409,"1f471-200d-2642":1410,"1f471":1391,"1f472":1511,"1f473-200d-2640":1510,"1f473-200d-2642":1509,"1f473":1508,"1f474":1412,"1f475":1413,"1f476":1386,"1f477-200d-2640":1504,"1f477-200d-2642":1503,"1f477":1502,"1f478":1507,"1f479":1109,"1f47a":1110,"1f47b":1111,"1f47c":1526,"1f47d":1112,"1f47e":1113,"1f47f":1104,"1f480":1105,"1f481-200d-2640":1428,"1f481-200d-2642":1427,"1f481":1426,"1f482-200d-2640":1500,"1f482-200d-2642":1499,"1f482":1498,"1f483":1585,"1f484":61152,"1f485":1366,"1f486-200d-2640":1560,"1f486-200d-2642":1559,"1f486":1558,"1f487-200d-2640":1563,"1f487-200d-2642":1562,"1f487":1561,"1f488":4870,"1f489":61326,"1f48a":61328,"1f48b":1127,"1f48c":1128,"1f48d":61153,"1f48e":61154,"1f48f":1649,"1f490":2648,"1f491":1653,"1f492":4846,"1f493":1133,"1f494":1138,"1f495":1135,"1f496":1131,"1f497":1132,"1f498":1129,"1f499":1145,"1f49a":1144,"1f49b":1143,"1f49c":1146,"1f49d":1130,"1f49e":1134,"1f49f":1136,"1f4a0":62946,"1f4a1":61214,"1f4a2":1151,"1f4a3":1157,"1f4a4":1163,"1f4a5":1152,"1f4a6":1154,"1f4a7":41022,"1f4a8":1155,"1f4a9":1107,"1f4aa":1368,"1f4ab":1153,"1f4ac":1158,"1f4ad":1162,"1f4ae":2650,"1f4af":1150,"1f4b0":61235,"1f4b1":62841,"1f4b2":62842,"1f4b3":61242,"1f4b4":61237,"1f4b5":61238,"1f4b6":61239,"1f4b7":61240,"1f4b8":61241,"1f4b9":61244,"1f4ba":4936,"1f4bb":61191,"1f4bc":61265,"1f4bd":61197,"1f4be":61198,"1f4bf":61199,"1f4c0":61200,"1f4c1":61266,"1f4c2":61267,"1f4c3":61227,"1f4c4":61229,"1f4c5":61269,"1f4c6":61270,"1f4c7":61273,"1f4c8":61274,"1f4c9":61275,"1f4ca":61276,"1f4cb":61277,"1f4cc":61278,"1f4cd":61279,"1f4ce":61280,"1f4cf":61282,"1f4d0":61283,"1f4d1":61232,"1f4d2":61226,"1f4d3":61225,"1f4d4":61218,"1f4d5":61219,"1f4d6":61220,"1f4d7":61221,"1f4d8":61222,"1f4d9":61223,"1f4da":61224,"1f4db":62847,"1f4dc":61228,"1f4dd":61264,"1f4de":61185,"1f4df":61186,"1f4e0":61187,"1f4e1":61325,"1f4e2":61159,"1f4e3":61160,"1f4e4":61249,"1f4e5":61250,"1f4e6":61251,"1f4e7":61246,"1f4e8":61247,"1f4e9":61248,"1f4ea":61253,"1f4eb":61252,"1f4ec":61254,"1f4ed":61255,"1f4ee":61256,"1f4ef":61161,"1f4f0":61230,"1f4f1":61182,"1f4f2":61183,"1f4f3":62823,"1f4f4":62824,"1f4f5":62751,"1f4f6":62822,"1f4f7":61207,"1f4f8":61208,"1f4f9":61209,"1f4fa":61206,"1f4fb":61172,"1f4fc":61210,"1f4fd":61204,"1f4ff":61151,"1f500":62801,"1f501":62802,"1f502":62803,"1f503":62769,"1f504":62770,"1f505":62820,"1f506":62821,"1f507":61155,"1f508":61156,"1f509":61157,"1f50a":61158,"1f50b":61188,"1f50c":61190,"1f50d":61211,"1f50e":61212,"1f50f":61290,"1f510":61291,"1f511":61292,"1f512":61288,"1f513":61289,"1f514":61162,"1f515":61163,"1f516":61233,"1f517":61313,"1f518":62947,"1f519":62771,"1f51a":62772,"1f51b":62773,"1f51c":62774,"1f51d":62775,"1f51e":62752,"1f51f":62876,"1f520":62877,"1f521":62878,"1f522":62879,"1f523":62880,"1f524":62881,"1f525":41021,"1f526":61215,"1f527":61306,"1f528":61294,"1f529":61308,"1f52a":3803,"1f52b":61301,"1f52c":61323,"1f52d":61324,"1f52e":51082,"1f52f":62787,"1f530":62848,"1f531":62846,"1f532":62949,"1f533":62948,"1f534":62916,"1f535":62920,"1f536":62940,"1f537":62941,"1f538":62942,"1f539":62943,"1f53a":62944,"1f53b":62945,"1f53c":62811,"1f53d":62813,"1f549":62778,"1f54a":2602,"1f54b":4854,"1f54c":4850,"1f54d":4852,"1f54e":62786,"1f550":4955,"1f551":4957,"1f552":4959,"1f553":4961,"1f554":4963,"1f555":4965,"1f556":4967,"1f557":4969,"1f558":4971,"1f559":4973,"1f55a":4975,"1f55b":4953,"1f55c":4956,"1f55d":4958,"1f55e":4960,"1f55f":4962,"1f560":4964,"1f561":4966,"1f562":4968,"1f563":4970,"1f564":4972,"1f565":4974,"1f566":4976,"1f567":4954,"1f56f":61213,"1f570":4952,"1f573":1156,"1f574":1587,"1f575-200d-2640":1497,"1f575-200d-2642":1496,"1f575":1495,"1f576":61111,"1f577":2641,"1f578":2642,"1f579":51087,"1f57a":1586,"1f587":61281,"1f58a":61261,"1f58b":61260,"1f58c":61262,"1f58d":61263,"1f590":1329,"1f595":1348,"1f596":1331,"1f5a4":1148,"1f5a5":61192,"1f5a8":61193,"1f5b1":61195,"1f5b2":61196,"1f5bc":51104,"1f5c2":61268,"1f5c3":61285,"1f5c4":61286,"1f5d1":61287,"1f5d2":61271,"1f5d3":61272,"1f5dc":61310,"1f5dd":61293,"1f5de":61231,"1f5e1":61299,"1f5e3":1683,"1f5e8":1160,"1f5ef":1161,"1f5f3":61257,"1f5fa":4810,"1f5fb":4816,"1f5fc":4847,"1f5fd":4848,"1f5fe":4811,"1f5ff":61362,"1f600":11,"1f601":14,"1f602":18,"1f603":12,"1f604":13,"1f605":16,"1f606":15,"1f607":114,"1f608":1103,"1f609":112,"1f60a":113,"1f60b":124,"1f60c":150,"1f60d":116,"1f60e":170,"1f60f":144,"1f610":139,"1f611":140,"1f612":145,"1f613":195,"1f614":151,"1f615":173,"1f616":192,"1f617":119,"1f618":118,"1f619":122,"1f61a":121,"1f61b":125,"1f61c":126,"1f61d":128,"1f61e":194,"1f61f":175,"1f620":1101,"1f621":1100,"1f622":189,"1f623":193,"1f624":199,"1f625":188,"1f626":184,"1f627":185,"1f628":186,"1f629":196,"1f62a":152,"1f62b":197,"1f62c":147,"1f62d":190,"1f62e-200d-1f4a8":148,"1f62e":178,"1f62f":179,"1f630":187,"1f631":191,"1f632":180,"1f633":181,"1f634":154,"1f635-200d-1f4ab":165,"1f635":164,"1f636-200d-1f32b":143,"1f636":141,"1f637":155,"1f638":1116,"1f639":1117,"1f63a":1115,"1f63b":1118,"1f63c":1119,"1f63d":1120,"1f63e":1123,"1f63f":1122,"1f640":1121,"1f641":176,"1f642":19,"1f643":110,"1f644":146,"1f645-200d-2640":1422,"1f645-200d-2642":1421,"1f645":1420,"1f646-200d-2640":1425,"1f646-200d-2642":1424,"1f646":1423,"1f647-200d-2640":1437,"1f647-200d-2642":1436,"1f647":1435,"1f648":1124,"1f649":1125,"1f64a":1126,"1f64b-200d-2640":1431,"1f64b-200d-2642":1430,"1f64b":1429,"1f64c":1359,"1f64d-200d-2640":1416,"1f64d-200d-2642":1415,"1f64d":1414,"1f64e-200d-2640":1419,"1f64e-200d-2642":1418,"1f64e":1417,"1f64f":1364,"1f680":4942,"1f681":4937,"1f682":4872,"1f683":4873,"1f684":4874,"1f685":4875,"1f686":4876,"1f687":4877,"1f688":4878,"1f689":4879,"1f68a":4880,"1f68b":4883,"1f68c":4884,"1f68d":4885,"1f68e":4886,"1f68f":4911,"1f690":4887,"1f691":4888,"1f692":4889,"1f693":4890,"1f694":4891,"1f695":4892,"1f696":4893,"1f697":4894,"1f698":4895,"1f699":4896,"1f69a":4898,"1f69b":4899,"1f69c":4900,"1f69d":4881,"1f69e":4882,"1f69f":4938,"1f6a0":4939,"1f6a1":4940,"1f6a2":4930,"1f6a3-200d-2640":1609,"1f6a3-200d-2642":1608,"1f6a3":1607,"1f6a4":4926,"1f6a5":4918,"1f6a6":4919,"1f6a7":4921,"1f6a8":4917,"1f6a9":71587,"1f6aa":61333,"1f6ab":62745,"1f6ac":61358,"1f6ad":62747,"1f6ae":62730,"1f6af":62748,"1f6b0":62731,"1f6b1":62749,"1f6b2":4907,"1f6b3":62746,"1f6b4-200d-2640":1621,"1f6b4-200d-2642":1620,"1f6b4":1619,"1f6b5-200d-2640":1624,"1f6b5-200d-2642":1623,"1f6b5":1622,"1f6b6-200d-2640":1566,"1f6b6-200d-2642":1565,"1f6b6":1564,"1f6b7":62750,"1f6b8":62743,"1f6b9":62733,"1f6ba":62734,"1f6bb":62735,"1f6bc":62736,"1f6bd":61340,"1f6be":62737,"1f6bf":61342,"1f6c0":1643,"1f6c1":61343,"1f6c2":62738,"1f6c3":62739,"1f6c4":62740,"1f6c5":62741,"1f6cb":61338,"1f6cc":1644,"1f6cd":61133,"1f6ce":4944,"1f6cf":61337,"1f6d0":62776,"1f6d1":4920,"1f6d2":61357,"1f6d5":4851,"1f6d6":4828,"1f6d7":61334,"1f6e0":61298,"1f6e1":61304,"1f6e2":4914,"1f6e3":4912,"1f6e4":4913,"1f6e5":4929,"1f6e9":4932,"1f6eb":4933,"1f6ec":4934,"1f6f0":4941,"1f6f3":4927,"1f6f4":4908,"1f6f5":4903,"1f6f6":4925,"1f6f7":51076,"1f6f8":4943,"1f6f9":4909,"1f6fa":4906,"1f6fb":4897,"1f6fc":4910,"1f7e0":62917,"1f7e1":62918,"1f7e2":62919,"1f7e3":62921,"1f7e4":62922,"1f7e5":62925,"1f7e6":62929,"1f7e7":62926,"1f7e8":62927,"1f7e9":62928,"1f7ea":62930,"1f7eb":62931,"1f90c":1337,"1f90d":1149,"1f90e":1147,"1f90f":1338,"1f910":137,"1f911":129,"1f912":156,"1f913":171,"1f914":135,"1f915":157,"1f916":1114,"1f917":130,"1f918":1343,"1f919":1344,"1f91a":1328,"1f91b":1356,"1f91c":1357,"1f91d":1363,"1f91e":1340,"1f91f":1342,"1f920":167,"1f921":1108,"1f922":158,"1f923":17,"1f924":153,"1f925":149,"1f926-200d-2640":1440,"1f926-200d-2642":1439,"1f926":1438,"1f927":160,"1f928":138,"1f929":117,"1f92a":127,"1f92b":134,"1f92c":1102,"1f92d":131,"1f92e":159,"1f92f":166,"1f930":1519,"1f931":1522,"1f932":1362,"1f933":1367,"1f934":1506,"1f935-200d-2640":1515,"1f935-200d-2642":1514,"1f935":1513,"1f936":1528,"1f937-200d-2640":1443,"1f937-200d-2642":1442,"1f937":1441,"1f938-200d-2640":1627,"1f938-200d-2642":1626,"1f938":1625,"1f939-200d-2640":1639,"1f939-200d-2642":1638,"1f939":1637,"1f93a":1597,"1f93c-200d-2640":1630,"1f93c-200d-2642":1629,"1f93c":1628,"1f93d-200d-2640":1633,"1f93d-200d-2642":1632,"1f93d":1631,"1f93e-200d-2640":1636,"1f93e-200d-2642":1635,"1f93e":1634,"1f93f":51073,"1f940":2654,"1f941":61180,"1f942":3791,"1f943":3792,"1f944":3802,"1f945":51069,"1f947":51048,"1f948":51049,"1f949":51050,"1f94a":51067,"1f94b":51068,"1f94c":51077,"1f94d":51064,"1f94e":51053,"1f94f":51059,"1f950":3710,"1f951":3693,"1f952":3700,"1f953":3721,"1f954":3695,"1f955":3696,"1f956":3711,"1f957":3738,"1f958":3734,"1f959":3730,"1f95a":3732,"1f95b":3780,"1f95c":3706,"1f95d":3689,"1f95e":3715,"1f95f":3757,"1f960":3758,"1f961":3759,"1f962":3799,"1f963":3737,"1f964":3794,"1f965":3692,"1f966":3702,"1f967":3773,"1f968":3713,"1f969":3720,"1f96a":3726,"1f96b":3742,"1f96c":3701,"1f96d":3681,"1f96e":3755,"1f96f":3714,"1f970":115,"1f971":198,"1f972":123,"1f973":168,"1f974":163,"1f975":161,"1f976":162,"1f977":1501,"1f978":169,"1f97a":182,"1f97b":61124,"1f97c":61113,"1f97d":61112,"1f97e":61138,"1f97f":61139,"1f980":3760,"1f981":2545,"1f982":2643,"1f983":2594,"1f984":2551,"1f985":2603,"1f986":2604,"1f987":2583,"1f988":2628,"1f989":2606,"1f98a":2540,"1f98b":2633,"1f98c":2553,"1f98d":2532,"1f98e":2615,"1f98f":2572,"1f990":3762,"1f991":3763,"1f992":2569,"1f993":2552,"1f994":2582,"1f995":2619,"1f996":2620,"1f997":2639,"1f998":2591,"1f999":2568,"1f99a":2610,"1f99b":2573,"1f99c":2611,"1f99d":2541,"1f99e":3761,"1f99f":2644,"1f9a0":2647,"1f9a1":2592,"1f9a2":2605,"1f9a3":2571,"1f9a4":2607,"1f9a5":2588,"1f9a6":2589,"1f9a7":2533,"1f9a8":2590,"1f9a9":2609,"1f9aa":3764,"1f9ab":2581,"1f9ac":2554,"1f9ad":2624,"1f9ae":2536,"1f9af":61312,"1f9b4":1380,"1f9b5":1371,"1f9b6":1372,"1f9b7":1379,"1f9b8-200d-2640":1532,"1f9b8-200d-2642":1531,"1f9b8":1530,"1f9b9-200d-2640":1535,"1f9b9-200d-2642":1534,"1f9b9":1533,"1f9ba":61114,"1f9bb":1374,"1f9bc":4905,"1f9bd":4904,"1f9be":1369,"1f9bf":1370,"1f9c0":3717,"1f9c1":3772,"1f9c2":3741,"1f9c3":3796,"1f9c4":3703,"1f9c5":3704,"1f9c6":3731,"1f9c7":3716,"1f9c8":3740,"1f9c9":3797,"1f9ca":3798,"1f9cb":3795,"1f9cd-200d-2640":1569,"1f9cd-200d-2642":1568,"1f9cd":1567,"1f9ce-200d-2640":1572,"1f9ce-200d-2642":1571,"1f9ce":1570,"1f9cf-200d-2640":1434,"1f9cf-200d-2642":1433,"1f9cf":1432,"1f9d0":172,"1f9d1-200d-1f33e":1456,"1f9d1-200d-1f373":1459,"1f9d1-200d-1f37c":1525,"1f9d1-200d-1f384":1529,"1f9d1-200d-1f393":1447,"1f9d1-200d-1f3a4":1477,"1f9d1-200d-1f3a8":1480,"1f9d1-200d-1f3eb":1450,"1f9d1-200d-1f3ed":1465,"1f9d1-200d-1f4bb":1474,"1f9d1-200d-1f4bc":1468,"1f9d1-200d-1f527":1462,"1f9d1-200d-1f52c":1471,"1f9d1-200d-1f680":1486,"1f9d1-200d-1f692":1489,"1f9d1-200d-1f91d-200d-1f9d1":1645,"1f9d1-200d-1f9af":1573,"1f9d1-200d-1f9b0":1402,"1f9d1-200d-1f9b1":1404,"1f9d1-200d-1f9b2":1408,"1f9d1-200d-1f9b3":1406,"1f9d1-200d-1f9bc":1576,"1f9d1-200d-1f9bd":1579,"1f9d1-200d-2695":1444,"1f9d1-200d-2696":1453,"1f9d1-200d-2708":1483,"1f9d1":1390,"1f9d2":1387,"1f9d3":1411,"1f9d4-200d-2640":1395,"1f9d4-200d-2642":1394,"1f9d4":1393,"1f9d5":1512,"1f9d6-200d-2640":1593,"1f9d6-200d-2642":1592,"1f9d6":1591,"1f9d7-200d-2640":1596,"1f9d7-200d-2642":1595,"1f9d7":1594,"1f9d8-200d-2640":1642,"1f9d8-200d-2642":1641,"1f9d8":1640,"1f9d9-200d-2640":1538,"1f9d9-200d-2642":1537,"1f9d9":1536,"1f9da-200d-2640":1541,"1f9da-200d-2642":1540,"1f9da":1539,"1f9db-200d-2640":1544,"1f9db-200d-2642":1543,"1f9db":1542,"1f9dc-200d-2640":1547,"1f9dc-200d-2642":1546,"1f9dc":1545,"1f9dd-200d-2640":1550,"1f9dd-200d-2642":1549,"1f9dd":1548,"1f9de-200d-2640":1553,"1f9de-200d-2642":1552,"1f9de":1551,"1f9df-200d-2640":1556,"1f9df-200d-2642":1555,"1f9df":1554,"1f9e0":1376,"1f9e1":1142,"1f9e2":61148,"1f9e3":61118,"1f9e4":61119,"1f9e5":61120,"1f9e6":61121,"1f9e7":51039,"1f9e8":51028,"1f9e9":51090,"1f9ea":61320,"1f9eb":61321,"1f9ec":61322,"1f9ed":4812,"1f9ee":61201,"1f9ef":61356,"1f9f0":61316,"1f9f1":4825,"1f9f2":61317,"1f9f3":4945,"1f9f4":61346,"1f9f5":51106,"1f9f6":51108,"1f9f7":61347,"1f9f8":51091,"1f9f9":61348,"1f9fa":61349,"1f9fb":61350,"1f9fc":61352,"1f9fd":61355,"1f9fe":61243,"1f9ff":51084,"1fa70":61142,"1fa71":61125,"1fa72":61126,"1fa73":61127,"1fa74":61135,"1fa78":61327,"1fa79":61329,"1fa7a":61331,"1fa80":51079,"1fa81":51080,"1fa82":4935,"1fa83":61302,"1fa84":51083,"1fa85":51092,"1fa86":51094,"1fa90":4993,"1fa91":61339,"1fa92":61345,"1fa93":61295,"1fa94":61217,"1fa95":61179,"1fa96":61149,"1fa97":61174,"1fa98":61181,"1fa99":61236,"1fa9a":61305,"1fa9b":61307,"1fa9c":61318,"1fa9d":61315,"1fa9e":61335,"1fa9f":61336,"1faa0":61341,"1faa1":51107,"1faa2":51109,"1faa3":61351,"1faa4":61344,"1faa5":61354,"1faa6":61360,"1faa7":61363,"1faa8":4826,"1fab0":2645,"1fab1":2646,"1fab2":2637,"1fab3":2640,"1fab4":2660,"1fab5":4827,"1fab6":2608,"1fac0":1377,"1fac1":1378,"1fac2":1686,"1fad0":3688,"1fad1":3699,"1fad2":3691,"1fad3":3712,"1fad4":3729,"1fad5":3736,"1fad6":3782,"203c":62834,"21a9":62765,"21aa":62766,"231a":4948,"231b":4946,"23cf":62818,"23e9":62805,"23ea":62809,"23eb":62812,"23ec":62814,"23ed":62806,"23ee":62810,"23ef":62807,"23f0":4949,"23f1":4950,"23f2":4951,"23f3":4947,"23f8":62815,"23f9":62816,"23fa":62817,"24c2":62890,"25aa":62938,"25ab":62939,"25b6":62804,"25c0":62808,"25fb":62935,"25fc":62934,"25fd":62937,"25fe":62936,"260e":61184,"261d":1350,"262a":62784,"262e":62785,"262f":62781,"263a":120,"264a":62790,"264b":62791,"264c":62792,"264d":62793,"264e":62794,"264f":62795,"265f":51099,"267b":62844,"267e":62833,"267f":62732,"269b":62777,"269c":62845,"26a0":62742,"26a1":41016,"26a7":62827,"26aa":62924,"26ab":62923,"26b0":61359,"26b1":61361,"26bd":51051,"26be":51052,"26c4":41019,"26c5":4999,"26c8":41e3,"26ce":62800,"26cf":61296,"26d1":61150,"26d3":61314,"26d4":62744,"26e9":4853,"26ea":4849,"26f0":4814,"26f1":41015,"26f2":4855,"26f3":51070,"26f4":4928,"26f5":4924,"26f7":1599,"26f8":51071,"26f9-200d-2640":1615,"26f9-200d-2642":1614,"26f9":1613,"26fa":4856,"26fd":4915,"270a":1354,"270b":1330,"270c":1339,"270d":1365,"270f":61258,"271d":62782,"274c":62853,"274e":62854,"2764-200d-1f525":1139,"2764-200d-1fa79":1140,"27a1":62757,"27b0":62855,"27bf":62856,"2b05":62761,"2b06":62755,"2b07":62759,"2b1b":62932,"2b1c":62933,"2b50":4994,"2b55":62849,"303d":62857,"1f385-1f3fb":0,"1f385-1f3fc":0,"1f385-1f3fd":0,"1f385-1f3fe":0,"1f385-1f3ff":0,"1f3c2-1f3fb":0,"1f3c2-1f3fc":0,"1f3c2-1f3fd":0,"1f3c2-1f3fe":0,"1f3c2-1f3ff":0,"1f3c3-1f3fb-200d-2640":0,"1f3c3-1f3fc-200d-2640":0,"1f3c3-1f3fd-200d-2640":0,"1f3c3-1f3fe-200d-2640":0,"1f3c3-1f3ff-200d-2640":0,"1f3c3-1f3fb-200d-2642":0,"1f3c3-1f3fc-200d-2642":0,"1f3c3-1f3fd-200d-2642":0,"1f3c3-1f3fe-200d-2642":0,"1f3c3-1f3ff-200d-2642":0,"1f3c3-1f3fb":0,"1f3c3-1f3fc":0,"1f3c3-1f3fd":0,"1f3c3-1f3fe":0,"1f3c3-1f3ff":0,"1f3c4-1f3fb-200d-2640":0,"1f3c4-1f3fc-200d-2640":0,"1f3c4-1f3fd-200d-2640":0,"1f3c4-1f3fe-200d-2640":0,"1f3c4-1f3ff-200d-2640":0,"1f3c4-1f3fb-200d-2642":0,"1f3c4-1f3fc-200d-2642":0,"1f3c4-1f3fd-200d-2642":0,"1f3c4-1f3fe-200d-2642":0,"1f3c4-1f3ff-200d-2642":0,"1f3c4-1f3fb":0,"1f3c4-1f3fc":0,"1f3c4-1f3fd":0,"1f3c4-1f3fe":0,"1f3c4-1f3ff":0,"1f3c7-1f3fb":0,"1f3c7-1f3fc":0,"1f3c7-1f3fd":0,"1f3c7-1f3fe":0,"1f3c7-1f3ff":0,"1f3ca-1f3fb-200d-2640":0,"1f3ca-1f3fc-200d-2640":0,"1f3ca-1f3fd-200d-2640":0,"1f3ca-1f3fe-200d-2640":0,"1f3ca-1f3ff-200d-2640":0,"1f3ca-1f3fb-200d-2642":0,"1f3ca-1f3fc-200d-2642":0,"1f3ca-1f3fd-200d-2642":0,"1f3ca-1f3fe-200d-2642":0,"1f3ca-1f3ff-200d-2642":0,"1f3ca-1f3fb":0,"1f3ca-1f3fc":0,"1f3ca-1f3fd":0,"1f3ca-1f3fe":0,"1f3ca-1f3ff":0,"1f3cb-1f3fb-200d-2640":0,"1f3cb-1f3fc-200d-2640":0,"1f3cb-1f3fd-200d-2640":0,"1f3cb-1f3fe-200d-2640":0,"1f3cb-1f3ff-200d-2640":0,"1f3cb-1f3fb-200d-2642":0,"1f3cb-1f3fc-200d-2642":0,"1f3cb-1f3fd-200d-2642":0,"1f3cb-1f3fe-200d-2642":0,"1f3cb-1f3ff-200d-2642":0,"1f3cb-1f3fb":0,"1f3cb-1f3fc":0,"1f3cb-1f3fd":0,"1f3cb-1f3fe":0,"1f3cb-1f3ff":0,"1f3cc-1f3fb-200d-2640":0,"1f3cc-1f3fc-200d-2640":0,"1f3cc-1f3fd-200d-2640":0,"1f3cc-1f3fe-200d-2640":0,"1f3cc-1f3ff-200d-2640":0,"1f3cc-1f3fb-200d-2642":0,"1f3cc-1f3fc-200d-2642":0,"1f3cc-1f3fd-200d-2642":0,"1f3cc-1f3fe-200d-2642":0,"1f3cc-1f3ff-200d-2642":0,"1f3cc-1f3fb":0,"1f3cc-1f3fc":0,"1f3cc-1f3fd":0,"1f3cc-1f3fe":0,"1f3cc-1f3ff":0,"1f442-1f3fb":0,"1f442-1f3fc":0,"1f442-1f3fd":0,"1f442-1f3fe":0,"1f442-1f3ff":0,"1f443-1f3fb":0,"1f443-1f3fc":0,"1f443-1f3fd":0,"1f443-1f3fe":0,"1f443-1f3ff":0,"1f446-1f3fb":0,"1f446-1f3fc":0,"1f446-1f3fd":0,"1f446-1f3fe":0,"1f446-1f3ff":0,"1f447-1f3fb":0,"1f447-1f3fc":0,"1f447-1f3fd":0,"1f447-1f3fe":0,"1f447-1f3ff":0,"1f448-1f3fb":0,"1f448-1f3fc":0,"1f448-1f3fd":0,"1f448-1f3fe":0,"1f448-1f3ff":0,"1f449-1f3fb":0,"1f449-1f3fc":0,"1f449-1f3fd":0,"1f449-1f3fe":0,"1f449-1f3ff":0,"1f44a-1f3fb":0,"1f44a-1f3fc":0,"1f44a-1f3fd":0,"1f44a-1f3fe":0,"1f44a-1f3ff":0,"1f44b-1f3fb":0,"1f44b-1f3fc":0,"1f44b-1f3fd":0,"1f44b-1f3fe":0,"1f44b-1f3ff":0,"1f44c-1f3fb":0,"1f44c-1f3fc":0,"1f44c-1f3fd":0,"1f44c-1f3fe":0,"1f44c-1f3ff":0,"1f44d-1f3fb":0,"1f44d-1f3fc":0,"1f44d-1f3fd":0,"1f44d-1f3fe":0,"1f44d-1f3ff":0,"1f44e-1f3fb":0,"1f44e-1f3fc":0,"1f44e-1f3fd":0,"1f44e-1f3fe":0,"1f44e-1f3ff":0,"1f44f-1f3fb":0,"1f44f-1f3fc":0,"1f44f-1f3fd":0,"1f44f-1f3fe":0,"1f44f-1f3ff":0,"1f450-1f3fb":0,"1f450-1f3fc":0,"1f450-1f3fd":0,"1f450-1f3fe":0,"1f450-1f3ff":0,"1f466-1f3fb":0,"1f466-1f3fc":0,"1f466-1f3fd":0,"1f466-1f3fe":0,"1f466-1f3ff":0,"1f467-1f3fb":0,"1f467-1f3fc":0,"1f467-1f3fd":0,"1f467-1f3fe":0,"1f467-1f3ff":0,"1f468-1f3fb-200d-1f33e":0,"1f468-1f3fc-200d-1f33e":0,"1f468-1f3fd-200d-1f33e":0,"1f468-1f3fe-200d-1f33e":0,"1f468-1f3ff-200d-1f33e":0,"1f468-1f3fb-200d-1f373":0,"1f468-1f3fc-200d-1f373":0,"1f468-1f3fd-200d-1f373":0,"1f468-1f3fe-200d-1f373":0,"1f468-1f3ff-200d-1f373":0,"1f468-1f3fb-200d-1f37c":0,"1f468-1f3fc-200d-1f37c":0,"1f468-1f3fd-200d-1f37c":0,"1f468-1f3fe-200d-1f37c":0,"1f468-1f3ff-200d-1f37c":0,"1f468-1f3fb-200d-1f393":0,"1f468-1f3fc-200d-1f393":0,"1f468-1f3fd-200d-1f393":0,"1f468-1f3fe-200d-1f393":0,"1f468-1f3ff-200d-1f393":0,"1f468-1f3fb-200d-1f3a4":0,"1f468-1f3fc-200d-1f3a4":0,"1f468-1f3fd-200d-1f3a4":0,"1f468-1f3fe-200d-1f3a4":0,"1f468-1f3ff-200d-1f3a4":0,"1f468-1f3fb-200d-1f3a8":0,"1f468-1f3fc-200d-1f3a8":0,"1f468-1f3fd-200d-1f3a8":0,"1f468-1f3fe-200d-1f3a8":0,"1f468-1f3ff-200d-1f3a8":0,"1f468-1f3fb-200d-1f3eb":0,"1f468-1f3fc-200d-1f3eb":0,"1f468-1f3fd-200d-1f3eb":0,"1f468-1f3fe-200d-1f3eb":0,"1f468-1f3ff-200d-1f3eb":0,"1f468-1f3fb-200d-1f3ed":0,"1f468-1f3fc-200d-1f3ed":0,"1f468-1f3fd-200d-1f3ed":0,"1f468-1f3fe-200d-1f3ed":0,"1f468-1f3ff-200d-1f3ed":0,"1f468-1f3fb-200d-1f4bb":0,"1f468-1f3fc-200d-1f4bb":0,"1f468-1f3fd-200d-1f4bb":0,"1f468-1f3fe-200d-1f4bb":0,"1f468-1f3ff-200d-1f4bb":0,"1f468-1f3fb-200d-1f4bc":0,"1f468-1f3fc-200d-1f4bc":0,"1f468-1f3fd-200d-1f4bc":0,"1f468-1f3fe-200d-1f4bc":0,"1f468-1f3ff-200d-1f4bc":0,"1f468-1f3fb-200d-1f527":0,"1f468-1f3fc-200d-1f527":0,"1f468-1f3fd-200d-1f527":0,"1f468-1f3fe-200d-1f527":0,"1f468-1f3ff-200d-1f527":0,"1f468-1f3fb-200d-1f52c":0,"1f468-1f3fc-200d-1f52c":0,"1f468-1f3fd-200d-1f52c":0,"1f468-1f3fe-200d-1f52c":0,"1f468-1f3ff-200d-1f52c":0,"1f468-1f3fb-200d-1f680":0,"1f468-1f3fc-200d-1f680":0,"1f468-1f3fd-200d-1f680":0,"1f468-1f3fe-200d-1f680":0,"1f468-1f3ff-200d-1f680":0,"1f468-1f3fb-200d-1f692":0,"1f468-1f3fc-200d-1f692":0,"1f468-1f3fd-200d-1f692":0,"1f468-1f3fe-200d-1f692":0,"1f468-1f3ff-200d-1f692":0,"1f468-1f3fb-200d-1f9af":0,"1f468-1f3fc-200d-1f9af":0,"1f468-1f3fd-200d-1f9af":0,"1f468-1f3fe-200d-1f9af":0,"1f468-1f3ff-200d-1f9af":0,"1f468-1f3fb-200d-1f9b0":0,"1f468-1f3fc-200d-1f9b0":0,"1f468-1f3fd-200d-1f9b0":0,"1f468-1f3fe-200d-1f9b0":0,"1f468-1f3ff-200d-1f9b0":0,"1f468-1f3fb-200d-1f9b1":0,"1f468-1f3fc-200d-1f9b1":0,"1f468-1f3fd-200d-1f9b1":0,"1f468-1f3fe-200d-1f9b1":0,"1f468-1f3ff-200d-1f9b1":0,"1f468-1f3fb-200d-1f9b2":0,"1f468-1f3fc-200d-1f9b2":0,"1f468-1f3fd-200d-1f9b2":0,"1f468-1f3fe-200d-1f9b2":0,"1f468-1f3ff-200d-1f9b2":0,"1f468-1f3fb-200d-1f9b3":0,"1f468-1f3fc-200d-1f9b3":0,"1f468-1f3fd-200d-1f9b3":0,"1f468-1f3fe-200d-1f9b3":0,"1f468-1f3ff-200d-1f9b3":0,"1f468-1f3fb-200d-1f9bc":0,"1f468-1f3fc-200d-1f9bc":0,"1f468-1f3fd-200d-1f9bc":0,"1f468-1f3fe-200d-1f9bc":0,"1f468-1f3ff-200d-1f9bc":0,"1f468-1f3fb-200d-1f9bd":0,"1f468-1f3fc-200d-1f9bd":0,"1f468-1f3fd-200d-1f9bd":0,"1f468-1f3fe-200d-1f9bd":0,"1f468-1f3ff-200d-1f9bd":0,"1f468-1f3fb-200d-2695":0,"1f468-1f3fc-200d-2695":0,"1f468-1f3fd-200d-2695":0,"1f468-1f3fe-200d-2695":0,"1f468-1f3ff-200d-2695":0,"1f468-1f3fb-200d-2696":0,"1f468-1f3fc-200d-2696":0,"1f468-1f3fd-200d-2696":0,"1f468-1f3fe-200d-2696":0,"1f468-1f3ff-200d-2696":0,"1f468-1f3fb-200d-2708":0,"1f468-1f3fc-200d-2708":0,"1f468-1f3fd-200d-2708":0,"1f468-1f3fe-200d-2708":0,"1f468-1f3ff-200d-2708":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fb":0,"1f468-1f3fc":0,"1f468-1f3fd":0,"1f468-1f3fe":0,"1f468-1f3ff":0,"1f469-1f3fb-200d-1f33e":0,"1f469-1f3fc-200d-1f33e":0,"1f469-1f3fd-200d-1f33e":0,"1f469-1f3fe-200d-1f33e":0,"1f469-1f3ff-200d-1f33e":0,"1f469-1f3fb-200d-1f373":0,"1f469-1f3fc-200d-1f373":0,"1f469-1f3fd-200d-1f373":0,"1f469-1f3fe-200d-1f373":0,"1f469-1f3ff-200d-1f373":0,"1f469-1f3fb-200d-1f37c":0,"1f469-1f3fc-200d-1f37c":0,"1f469-1f3fd-200d-1f37c":0,"1f469-1f3fe-200d-1f37c":0,"1f469-1f3ff-200d-1f37c":0,"1f469-1f3fb-200d-1f393":0,"1f469-1f3fc-200d-1f393":0,"1f469-1f3fd-200d-1f393":0,"1f469-1f3fe-200d-1f393":0,"1f469-1f3ff-200d-1f393":0,"1f469-1f3fb-200d-1f3a4":0,"1f469-1f3fc-200d-1f3a4":0,"1f469-1f3fd-200d-1f3a4":0,"1f469-1f3fe-200d-1f3a4":0,"1f469-1f3ff-200d-1f3a4":0,"1f469-1f3fb-200d-1f3a8":0,"1f469-1f3fc-200d-1f3a8":0,"1f469-1f3fd-200d-1f3a8":0,"1f469-1f3fe-200d-1f3a8":0,"1f469-1f3ff-200d-1f3a8":0,"1f469-1f3fb-200d-1f3eb":0,"1f469-1f3fc-200d-1f3eb":0,"1f469-1f3fd-200d-1f3eb":0,"1f469-1f3fe-200d-1f3eb":0,"1f469-1f3ff-200d-1f3eb":0,"1f469-1f3fb-200d-1f3ed":0,"1f469-1f3fc-200d-1f3ed":0,"1f469-1f3fd-200d-1f3ed":0,"1f469-1f3fe-200d-1f3ed":0,"1f469-1f3ff-200d-1f3ed":0,"1f469-1f3fb-200d-1f4bb":0,"1f469-1f3fc-200d-1f4bb":0,"1f469-1f3fd-200d-1f4bb":0,"1f469-1f3fe-200d-1f4bb":0,"1f469-1f3ff-200d-1f4bb":0,"1f469-1f3fb-200d-1f4bc":0,"1f469-1f3fc-200d-1f4bc":0,"1f469-1f3fd-200d-1f4bc":0,"1f469-1f3fe-200d-1f4bc":0,"1f469-1f3ff-200d-1f4bc":0,"1f469-1f3fb-200d-1f527":0,"1f469-1f3fc-200d-1f527":0,"1f469-1f3fd-200d-1f527":0,"1f469-1f3fe-200d-1f527":0,"1f469-1f3ff-200d-1f527":0,"1f469-1f3fb-200d-1f52c":0,"1f469-1f3fc-200d-1f52c":0,"1f469-1f3fd-200d-1f52c":0,"1f469-1f3fe-200d-1f52c":0,"1f469-1f3ff-200d-1f52c":0,"1f469-1f3fb-200d-1f680":0,"1f469-1f3fc-200d-1f680":0,"1f469-1f3fd-200d-1f680":0,"1f469-1f3fe-200d-1f680":0,"1f469-1f3ff-200d-1f680":0,"1f469-1f3fb-200d-1f692":0,"1f469-1f3fc-200d-1f692":0,"1f469-1f3fd-200d-1f692":0,"1f469-1f3fe-200d-1f692":0,"1f469-1f3ff-200d-1f692":0,"1f469-1f3fb-200d-1f9af":0,"1f469-1f3fc-200d-1f9af":0,"1f469-1f3fd-200d-1f9af":0,"1f469-1f3fe-200d-1f9af":0,"1f469-1f3ff-200d-1f9af":0,"1f469-1f3fb-200d-1f9b0":0,"1f469-1f3fc-200d-1f9b0":0,"1f469-1f3fd-200d-1f9b0":0,"1f469-1f3fe-200d-1f9b0":0,"1f469-1f3ff-200d-1f9b0":0,"1f469-1f3fb-200d-1f9b1":0,"1f469-1f3fc-200d-1f9b1":0,"1f469-1f3fd-200d-1f9b1":0,"1f469-1f3fe-200d-1f9b1":0,"1f469-1f3ff-200d-1f9b1":0,"1f469-1f3fb-200d-1f9b2":0,"1f469-1f3fc-200d-1f9b2":0,"1f469-1f3fd-200d-1f9b2":0,"1f469-1f3fe-200d-1f9b2":0,"1f469-1f3ff-200d-1f9b2":0,"1f469-1f3fb-200d-1f9b3":0,"1f469-1f3fc-200d-1f9b3":0,"1f469-1f3fd-200d-1f9b3":0,"1f469-1f3fe-200d-1f9b3":0,"1f469-1f3ff-200d-1f9b3":0,"1f469-1f3fb-200d-1f9bc":0,"1f469-1f3fc-200d-1f9bc":0,"1f469-1f3fd-200d-1f9bc":0,"1f469-1f3fe-200d-1f9bc":0,"1f469-1f3ff-200d-1f9bc":0,"1f469-1f3fb-200d-1f9bd":0,"1f469-1f3fc-200d-1f9bd":0,"1f469-1f3fd-200d-1f9bd":0,"1f469-1f3fe-200d-1f9bd":0,"1f469-1f3ff-200d-1f9bd":0,"1f469-1f3fb-200d-2695":0,"1f469-1f3fc-200d-2695":0,"1f469-1f3fd-200d-2695":0,"1f469-1f3fe-200d-2695":0,"1f469-1f3ff-200d-2695":0,"1f469-1f3fb-200d-2696":0,"1f469-1f3fc-200d-2696":0,"1f469-1f3fd-200d-2696":0,"1f469-1f3fe-200d-2696":0,"1f469-1f3ff-200d-2696":0,"1f469-1f3fb-200d-2708":0,"1f469-1f3fc-200d-2708":0,"1f469-1f3fd-200d-2708":0,"1f469-1f3fe-200d-2708":0,"1f469-1f3ff-200d-2708":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fb":0,"1f469-1f3fc":0,"1f469-1f3fd":0,"1f469-1f3fe":0,"1f469-1f3ff":0,"1f46b-1f3fb":0,"1f46b-1f3fc":0,"1f46b-1f3fd":0,"1f46b-1f3fe":0,"1f46b-1f3ff":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3fe":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3fe":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3fe":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fe":0,"1f46c-1f3fb":0,"1f46c-1f3fc":0,"1f46c-1f3fd":0,"1f46c-1f3fe":0,"1f46c-1f3ff":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3fe":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3fe":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3fe":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fe":0,"1f46d-1f3fb":0,"1f46d-1f3fc":0,"1f46d-1f3fd":0,"1f46d-1f3fe":0,"1f46d-1f3ff":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3fe":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3fe":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3fe":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fe":0,"1f46e-1f3fb-200d-2640":0,"1f46e-1f3fc-200d-2640":0,"1f46e-1f3fd-200d-2640":0,"1f46e-1f3fe-200d-2640":0,"1f46e-1f3ff-200d-2640":0,"1f46e-1f3fb-200d-2642":0,"1f46e-1f3fc-200d-2642":0,"1f46e-1f3fd-200d-2642":0,"1f46e-1f3fe-200d-2642":0,"1f46e-1f3ff-200d-2642":0,"1f46e-1f3fb":0,"1f46e-1f3fc":0,"1f46e-1f3fd":0,"1f46e-1f3fe":0,"1f46e-1f3ff":0,"1f470-1f3fb-200d-2640":0,"1f470-1f3fc-200d-2640":0,"1f470-1f3fd-200d-2640":0,"1f470-1f3fe-200d-2640":0,"1f470-1f3ff-200d-2640":0,"1f470-1f3fb-200d-2642":0,"1f470-1f3fc-200d-2642":0,"1f470-1f3fd-200d-2642":0,"1f470-1f3fe-200d-2642":0,"1f470-1f3ff-200d-2642":0,"1f470-1f3fb":0,"1f470-1f3fc":0,"1f470-1f3fd":0,"1f470-1f3fe":0,"1f470-1f3ff":0,"1f471-1f3fb-200d-2640":0,"1f471-1f3fc-200d-2640":0,"1f471-1f3fd-200d-2640":0,"1f471-1f3fe-200d-2640":0,"1f471-1f3ff-200d-2640":0,"1f471-1f3fb-200d-2642":0,"1f471-1f3fc-200d-2642":0,"1f471-1f3fd-200d-2642":0,"1f471-1f3fe-200d-2642":0,"1f471-1f3ff-200d-2642":0,"1f471-1f3fb":0,"1f471-1f3fc":0,"1f471-1f3fd":0,"1f471-1f3fe":0,"1f471-1f3ff":0,"1f472-1f3fb":0,"1f472-1f3fc":0,"1f472-1f3fd":0,"1f472-1f3fe":0,"1f472-1f3ff":0,"1f473-1f3fb-200d-2640":0,"1f473-1f3fc-200d-2640":0,"1f473-1f3fd-200d-2640":0,"1f473-1f3fe-200d-2640":0,"1f473-1f3ff-200d-2640":0,"1f473-1f3fb-200d-2642":0,"1f473-1f3fc-200d-2642":0,"1f473-1f3fd-200d-2642":0,"1f473-1f3fe-200d-2642":0,"1f473-1f3ff-200d-2642":0,"1f473-1f3fb":0,"1f473-1f3fc":0,"1f473-1f3fd":0,"1f473-1f3fe":0,"1f473-1f3ff":0,"1f474-1f3fb":0,"1f474-1f3fc":0,"1f474-1f3fd":0,"1f474-1f3fe":0,"1f474-1f3ff":0,"1f475-1f3fb":0,"1f475-1f3fc":0,"1f475-1f3fd":0,"1f475-1f3fe":0,"1f475-1f3ff":0,"1f476-1f3fb":0,"1f476-1f3fc":0,"1f476-1f3fd":0,"1f476-1f3fe":0,"1f476-1f3ff":0,"1f477-1f3fb-200d-2640":0,"1f477-1f3fc-200d-2640":0,"1f477-1f3fd-200d-2640":0,"1f477-1f3fe-200d-2640":0,"1f477-1f3ff-200d-2640":0,"1f477-1f3fb-200d-2642":0,"1f477-1f3fc-200d-2642":0,"1f477-1f3fd-200d-2642":0,"1f477-1f3fe-200d-2642":0,"1f477-1f3ff-200d-2642":0,"1f477-1f3fb":0,"1f477-1f3fc":0,"1f477-1f3fd":0,"1f477-1f3fe":0,"1f477-1f3ff":0,"1f478-1f3fb":0,"1f478-1f3fc":0,"1f478-1f3fd":0,"1f478-1f3fe":0,"1f478-1f3ff":0,"1f47c-1f3fb":0,"1f47c-1f3fc":0,"1f47c-1f3fd":0,"1f47c-1f3fe":0,"1f47c-1f3ff":0,"1f481-1f3fb-200d-2640":0,"1f481-1f3fc-200d-2640":0,"1f481-1f3fd-200d-2640":0,"1f481-1f3fe-200d-2640":0,"1f481-1f3ff-200d-2640":0,"1f481-1f3fb-200d-2642":0,"1f481-1f3fc-200d-2642":0,"1f481-1f3fd-200d-2642":0,"1f481-1f3fe-200d-2642":0,"1f481-1f3ff-200d-2642":0,"1f481-1f3fb":0,"1f481-1f3fc":0,"1f481-1f3fd":0,"1f481-1f3fe":0,"1f481-1f3ff":0,"1f482-1f3fb-200d-2640":0,"1f482-1f3fc-200d-2640":0,"1f482-1f3fd-200d-2640":0,"1f482-1f3fe-200d-2640":0,"1f482-1f3ff-200d-2640":0,"1f482-1f3fb-200d-2642":0,"1f482-1f3fc-200d-2642":0,"1f482-1f3fd-200d-2642":0,"1f482-1f3fe-200d-2642":0,"1f482-1f3ff-200d-2642":0,"1f482-1f3fb":0,"1f482-1f3fc":0,"1f482-1f3fd":0,"1f482-1f3fe":0,"1f482-1f3ff":0,"1f483-1f3fb":0,"1f483-1f3fc":0,"1f483-1f3fd":0,"1f483-1f3fe":0,"1f483-1f3ff":0,"1f485-1f3fb":0,"1f485-1f3fc":0,"1f485-1f3fd":0,"1f485-1f3fe":0,"1f485-1f3ff":0,"1f486-1f3fb-200d-2640":0,"1f486-1f3fc-200d-2640":0,"1f486-1f3fd-200d-2640":0,"1f486-1f3fe-200d-2640":0,"1f486-1f3ff-200d-2640":0,"1f486-1f3fb-200d-2642":0,"1f486-1f3fc-200d-2642":0,"1f486-1f3fd-200d-2642":0,"1f486-1f3fe-200d-2642":0,"1f486-1f3ff-200d-2642":0,"1f486-1f3fb":0,"1f486-1f3fc":0,"1f486-1f3fd":0,"1f486-1f3fe":0,"1f486-1f3ff":0,"1f487-1f3fb-200d-2640":0,"1f487-1f3fc-200d-2640":0,"1f487-1f3fd-200d-2640":0,"1f487-1f3fe-200d-2640":0,"1f487-1f3ff-200d-2640":0,"1f487-1f3fb-200d-2642":0,"1f487-1f3fc-200d-2642":0,"1f487-1f3fd-200d-2642":0,"1f487-1f3fe-200d-2642":0,"1f487-1f3ff-200d-2642":0,"1f487-1f3fb":0,"1f487-1f3fc":0,"1f487-1f3fd":0,"1f487-1f3fe":0,"1f487-1f3ff":0,"1f48f-1f3fb":0,"1f48f-1f3fc":0,"1f48f-1f3fd":0,"1f48f-1f3fe":0,"1f48f-1f3ff":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f491-1f3fb":0,"1f491-1f3fc":0,"1f491-1f3fd":0,"1f491-1f3fe":0,"1f491-1f3ff":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fe":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fe":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fe":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fe":0,"1f4aa-1f3fb":0,"1f4aa-1f3fc":0,"1f4aa-1f3fd":0,"1f4aa-1f3fe":0,"1f4aa-1f3ff":0,"1f574-1f3fb":0,"1f574-1f3fc":0,"1f574-1f3fd":0,"1f574-1f3fe":0,"1f574-1f3ff":0,"1f575-1f3fb-200d-2640":0,"1f575-1f3fc-200d-2640":0,"1f575-1f3fd-200d-2640":0,"1f575-1f3fe-200d-2640":0,"1f575-1f3ff-200d-2640":0,"1f575-1f3fb-200d-2642":0,"1f575-1f3fc-200d-2642":0,"1f575-1f3fd-200d-2642":0,"1f575-1f3fe-200d-2642":0,"1f575-1f3ff-200d-2642":0,"1f575-1f3fb":0,"1f575-1f3fc":0,"1f575-1f3fd":0,"1f575-1f3fe":0,"1f575-1f3ff":0,"1f57a-1f3fb":0,"1f57a-1f3fc":0,"1f57a-1f3fd":0,"1f57a-1f3fe":0,"1f57a-1f3ff":0,"1f590-1f3fb":0,"1f590-1f3fc":0,"1f590-1f3fd":0,"1f590-1f3fe":0,"1f590-1f3ff":0,"1f595-1f3fb":0,"1f595-1f3fc":0,"1f595-1f3fd":0,"1f595-1f3fe":0,"1f595-1f3ff":0,"1f596-1f3fb":0,"1f596-1f3fc":0,"1f596-1f3fd":0,"1f596-1f3fe":0,"1f596-1f3ff":0,"1f645-1f3fb-200d-2640":0,"1f645-1f3fc-200d-2640":0,"1f645-1f3fd-200d-2640":0,"1f645-1f3fe-200d-2640":0,"1f645-1f3ff-200d-2640":0,"1f645-1f3fb-200d-2642":0,"1f645-1f3fc-200d-2642":0,"1f645-1f3fd-200d-2642":0,"1f645-1f3fe-200d-2642":0,"1f645-1f3ff-200d-2642":0,"1f645-1f3fb":0,"1f645-1f3fc":0,"1f645-1f3fd":0,"1f645-1f3fe":0,"1f645-1f3ff":0,"1f646-1f3fb-200d-2640":0,"1f646-1f3fc-200d-2640":0,"1f646-1f3fd-200d-2640":0,"1f646-1f3fe-200d-2640":0,"1f646-1f3ff-200d-2640":0,"1f646-1f3fb-200d-2642":0,"1f646-1f3fc-200d-2642":0,"1f646-1f3fd-200d-2642":0,"1f646-1f3fe-200d-2642":0,"1f646-1f3ff-200d-2642":0,"1f646-1f3fb":0,"1f646-1f3fc":0,"1f646-1f3fd":0,"1f646-1f3fe":0,"1f646-1f3ff":0,"1f647-1f3fb-200d-2640":0,"1f647-1f3fc-200d-2640":0,"1f647-1f3fd-200d-2640":0,"1f647-1f3fe-200d-2640":0,"1f647-1f3ff-200d-2640":0,"1f647-1f3fb-200d-2642":0,"1f647-1f3fc-200d-2642":0,"1f647-1f3fd-200d-2642":0,"1f647-1f3fe-200d-2642":0,"1f647-1f3ff-200d-2642":0,"1f647-1f3fb":0,"1f647-1f3fc":0,"1f647-1f3fd":0,"1f647-1f3fe":0,"1f647-1f3ff":0,"1f64b-1f3fb-200d-2640":0,"1f64b-1f3fc-200d-2640":0,"1f64b-1f3fd-200d-2640":0,"1f64b-1f3fe-200d-2640":0,"1f64b-1f3ff-200d-2640":0,"1f64b-1f3fb-200d-2642":0,"1f64b-1f3fc-200d-2642":0,"1f64b-1f3fd-200d-2642":0,"1f64b-1f3fe-200d-2642":0,"1f64b-1f3ff-200d-2642":0,"1f64b-1f3fb":0,"1f64b-1f3fc":0,"1f64b-1f3fd":0,"1f64b-1f3fe":0,"1f64b-1f3ff":0,"1f64c-1f3fb":0,"1f64c-1f3fc":0,"1f64c-1f3fd":0,"1f64c-1f3fe":0,"1f64c-1f3ff":0,"1f64d-1f3fb-200d-2640":0,"1f64d-1f3fc-200d-2640":0,"1f64d-1f3fd-200d-2640":0,"1f64d-1f3fe-200d-2640":0,"1f64d-1f3ff-200d-2640":0,"1f64d-1f3fb-200d-2642":0,"1f64d-1f3fc-200d-2642":0,"1f64d-1f3fd-200d-2642":0,"1f64d-1f3fe-200d-2642":0,"1f64d-1f3ff-200d-2642":0,"1f64d-1f3fb":0,"1f64d-1f3fc":0,"1f64d-1f3fd":0,"1f64d-1f3fe":0,"1f64d-1f3ff":0,"1f64e-1f3fb-200d-2640":0,"1f64e-1f3fc-200d-2640":0,"1f64e-1f3fd-200d-2640":0,"1f64e-1f3fe-200d-2640":0,"1f64e-1f3ff-200d-2640":0,"1f64e-1f3fb-200d-2642":0,"1f64e-1f3fc-200d-2642":0,"1f64e-1f3fd-200d-2642":0,"1f64e-1f3fe-200d-2642":0,"1f64e-1f3ff-200d-2642":0,"1f64e-1f3fb":0,"1f64e-1f3fc":0,"1f64e-1f3fd":0,"1f64e-1f3fe":0,"1f64e-1f3ff":0,"1f64f-1f3fb":0,"1f64f-1f3fc":0,"1f64f-1f3fd":0,"1f64f-1f3fe":0,"1f64f-1f3ff":0,"1f6a3-1f3fb-200d-2640":0,"1f6a3-1f3fc-200d-2640":0,"1f6a3-1f3fd-200d-2640":0,"1f6a3-1f3fe-200d-2640":0,"1f6a3-1f3ff-200d-2640":0,"1f6a3-1f3fb-200d-2642":0,"1f6a3-1f3fc-200d-2642":0,"1f6a3-1f3fd-200d-2642":0,"1f6a3-1f3fe-200d-2642":0,"1f6a3-1f3ff-200d-2642":0,"1f6a3-1f3fb":0,"1f6a3-1f3fc":0,"1f6a3-1f3fd":0,"1f6a3-1f3fe":0,"1f6a3-1f3ff":0,"1f6b4-1f3fb-200d-2640":0,"1f6b4-1f3fc-200d-2640":0,"1f6b4-1f3fd-200d-2640":0,"1f6b4-1f3fe-200d-2640":0,"1f6b4-1f3ff-200d-2640":0,"1f6b4-1f3fb-200d-2642":0,"1f6b4-1f3fc-200d-2642":0,"1f6b4-1f3fd-200d-2642":0,"1f6b4-1f3fe-200d-2642":0,"1f6b4-1f3ff-200d-2642":0,"1f6b4-1f3fb":0,"1f6b4-1f3fc":0,"1f6b4-1f3fd":0,"1f6b4-1f3fe":0,"1f6b4-1f3ff":0,"1f6b5-1f3fb-200d-2640":0,"1f6b5-1f3fc-200d-2640":0,"1f6b5-1f3fd-200d-2640":0,"1f6b5-1f3fe-200d-2640":0,"1f6b5-1f3ff-200d-2640":0,"1f6b5-1f3fb-200d-2642":0,"1f6b5-1f3fc-200d-2642":0,"1f6b5-1f3fd-200d-2642":0,"1f6b5-1f3fe-200d-2642":0,"1f6b5-1f3ff-200d-2642":0,"1f6b5-1f3fb":0,"1f6b5-1f3fc":0,"1f6b5-1f3fd":0,"1f6b5-1f3fe":0,"1f6b5-1f3ff":0,"1f6b6-1f3fb-200d-2640":0,"1f6b6-1f3fc-200d-2640":0,"1f6b6-1f3fd-200d-2640":0,"1f6b6-1f3fe-200d-2640":0,"1f6b6-1f3ff-200d-2640":0,"1f6b6-1f3fb-200d-2642":0,"1f6b6-1f3fc-200d-2642":0,"1f6b6-1f3fd-200d-2642":0,"1f6b6-1f3fe-200d-2642":0,"1f6b6-1f3ff-200d-2642":0,"1f6b6-1f3fb":0,"1f6b6-1f3fc":0,"1f6b6-1f3fd":0,"1f6b6-1f3fe":0,"1f6b6-1f3ff":0,"1f6c0-1f3fb":0,"1f6c0-1f3fc":0,"1f6c0-1f3fd":0,"1f6c0-1f3fe":0,"1f6c0-1f3ff":0,"1f6cc-1f3fb":0,"1f6cc-1f3fc":0,"1f6cc-1f3fd":0,"1f6cc-1f3fe":0,"1f6cc-1f3ff":0,"1f90c-1f3fb":0,"1f90c-1f3fc":0,"1f90c-1f3fd":0,"1f90c-1f3fe":0,"1f90c-1f3ff":0,"1f90f-1f3fb":0,"1f90f-1f3fc":0,"1f90f-1f3fd":0,"1f90f-1f3fe":0,"1f90f-1f3ff":0,"1f918-1f3fb":0,"1f918-1f3fc":0,"1f918-1f3fd":0,"1f918-1f3fe":0,"1f918-1f3ff":0,"1f919-1f3fb":0,"1f919-1f3fc":0,"1f919-1f3fd":0,"1f919-1f3fe":0,"1f919-1f3ff":0,"1f91a-1f3fb":0,"1f91a-1f3fc":0,"1f91a-1f3fd":0,"1f91a-1f3fe":0,"1f91a-1f3ff":0,"1f91b-1f3fb":0,"1f91b-1f3fc":0,"1f91b-1f3fd":0,"1f91b-1f3fe":0,"1f91b-1f3ff":0,"1f91c-1f3fb":0,"1f91c-1f3fc":0,"1f91c-1f3fd":0,"1f91c-1f3fe":0,"1f91c-1f3ff":0,"1f91d-1f3fb":0,"1f91d-1f3fc":0,"1f91d-1f3fd":0,"1f91d-1f3fe":0,"1f91d-1f3ff":0,"1f91e-1f3fb":0,"1f91e-1f3fc":0,"1f91e-1f3fd":0,"1f91e-1f3fe":0,"1f91e-1f3ff":0,"1f91f-1f3fb":0,"1f91f-1f3fc":0,"1f91f-1f3fd":0,"1f91f-1f3fe":0,"1f91f-1f3ff":0,"1f926-1f3fb-200d-2640":0,"1f926-1f3fc-200d-2640":0,"1f926-1f3fd-200d-2640":0,"1f926-1f3fe-200d-2640":0,"1f926-1f3ff-200d-2640":0,"1f926-1f3fb-200d-2642":0,"1f926-1f3fc-200d-2642":0,"1f926-1f3fd-200d-2642":0,"1f926-1f3fe-200d-2642":0,"1f926-1f3ff-200d-2642":0,"1f926-1f3fb":0,"1f926-1f3fc":0,"1f926-1f3fd":0,"1f926-1f3fe":0,"1f926-1f3ff":0,"1f930-1f3fb":0,"1f930-1f3fc":0,"1f930-1f3fd":0,"1f930-1f3fe":0,"1f930-1f3ff":0,"1f931-1f3fb":0,"1f931-1f3fc":0,"1f931-1f3fd":0,"1f931-1f3fe":0,"1f931-1f3ff":0,"1f932-1f3fb":0,"1f932-1f3fc":0,"1f932-1f3fd":0,"1f932-1f3fe":0,"1f932-1f3ff":0,"1f933-1f3fb":0,"1f933-1f3fc":0,"1f933-1f3fd":0,"1f933-1f3fe":0,"1f933-1f3ff":0,"1f934-1f3fb":0,"1f934-1f3fc":0,"1f934-1f3fd":0,"1f934-1f3fe":0,"1f934-1f3ff":0,"1f935-1f3fb-200d-2640":0,"1f935-1f3fc-200d-2640":0,"1f935-1f3fd-200d-2640":0,"1f935-1f3fe-200d-2640":0,"1f935-1f3ff-200d-2640":0,"1f935-1f3fb-200d-2642":0,"1f935-1f3fc-200d-2642":0,"1f935-1f3fd-200d-2642":0,"1f935-1f3fe-200d-2642":0,"1f935-1f3ff-200d-2642":0,"1f935-1f3fb":0,"1f935-1f3fc":0,"1f935-1f3fd":0,"1f935-1f3fe":0,"1f935-1f3ff":0,"1f936-1f3fb":0,"1f936-1f3fc":0,"1f936-1f3fd":0,"1f936-1f3fe":0,"1f936-1f3ff":0,"1f937-1f3fb-200d-2640":0,"1f937-1f3fc-200d-2640":0,"1f937-1f3fd-200d-2640":0,"1f937-1f3fe-200d-2640":0,"1f937-1f3ff-200d-2640":0,"1f937-1f3fb-200d-2642":0,"1f937-1f3fc-200d-2642":0,"1f937-1f3fd-200d-2642":0,"1f937-1f3fe-200d-2642":0,"1f937-1f3ff-200d-2642":0,"1f937-1f3fb":0,"1f937-1f3fc":0,"1f937-1f3fd":0,"1f937-1f3fe":0,"1f937-1f3ff":0,"1f938-1f3fb-200d-2640":0,"1f938-1f3fc-200d-2640":0,"1f938-1f3fd-200d-2640":0,"1f938-1f3fe-200d-2640":0,"1f938-1f3ff-200d-2640":0,"1f938-1f3fb-200d-2642":0,"1f938-1f3fc-200d-2642":0,"1f938-1f3fd-200d-2642":0,"1f938-1f3fe-200d-2642":0,"1f938-1f3ff-200d-2642":0,"1f938-1f3fb":0,"1f938-1f3fc":0,"1f938-1f3fd":0,"1f938-1f3fe":0,"1f938-1f3ff":0,"1f939-1f3fb-200d-2640":0,"1f939-1f3fc-200d-2640":0,"1f939-1f3fd-200d-2640":0,"1f939-1f3fe-200d-2640":0,"1f939-1f3ff-200d-2640":0,"1f939-1f3fb-200d-2642":0,"1f939-1f3fc-200d-2642":0,"1f939-1f3fd-200d-2642":0,"1f939-1f3fe-200d-2642":0,"1f939-1f3ff-200d-2642":0,"1f939-1f3fb":0,"1f939-1f3fc":0,"1f939-1f3fd":0,"1f939-1f3fe":0,"1f939-1f3ff":0,"1f93d-1f3fb-200d-2640":0,"1f93d-1f3fc-200d-2640":0,"1f93d-1f3fd-200d-2640":0,"1f93d-1f3fe-200d-2640":0,"1f93d-1f3ff-200d-2640":0,"1f93d-1f3fb-200d-2642":0,"1f93d-1f3fc-200d-2642":0,"1f93d-1f3fd-200d-2642":0,"1f93d-1f3fe-200d-2642":0,"1f93d-1f3ff-200d-2642":0,"1f93d-1f3fb":0,"1f93d-1f3fc":0,"1f93d-1f3fd":0,"1f93d-1f3fe":0,"1f93d-1f3ff":0,"1f93e-1f3fb-200d-2640":0,"1f93e-1f3fc-200d-2640":0,"1f93e-1f3fd-200d-2640":0,"1f93e-1f3fe-200d-2640":0,"1f93e-1f3ff-200d-2640":0,"1f93e-1f3fb-200d-2642":0,"1f93e-1f3fc-200d-2642":0,"1f93e-1f3fd-200d-2642":0,"1f93e-1f3fe-200d-2642":0,"1f93e-1f3ff-200d-2642":0,"1f93e-1f3fb":0,"1f93e-1f3fc":0,"1f93e-1f3fd":0,"1f93e-1f3fe":0,"1f93e-1f3ff":0,"1f977-1f3fb":0,"1f977-1f3fc":0,"1f977-1f3fd":0,"1f977-1f3fe":0,"1f977-1f3ff":0,"1f9b5-1f3fb":0,"1f9b5-1f3fc":0,"1f9b5-1f3fd":0,"1f9b5-1f3fe":0,"1f9b5-1f3ff":0,"1f9b6-1f3fb":0,"1f9b6-1f3fc":0,"1f9b6-1f3fd":0,"1f9b6-1f3fe":0,"1f9b6-1f3ff":0,"1f9b8-1f3fb-200d-2640":0,"1f9b8-1f3fc-200d-2640":0,"1f9b8-1f3fd-200d-2640":0,"1f9b8-1f3fe-200d-2640":0,"1f9b8-1f3ff-200d-2640":0,"1f9b8-1f3fb-200d-2642":0,"1f9b8-1f3fc-200d-2642":0,"1f9b8-1f3fd-200d-2642":0,"1f9b8-1f3fe-200d-2642":0,"1f9b8-1f3ff-200d-2642":0,"1f9b8-1f3fb":0,"1f9b8-1f3fc":0,"1f9b8-1f3fd":0,"1f9b8-1f3fe":0,"1f9b8-1f3ff":0,"1f9b9-1f3fb-200d-2640":0,"1f9b9-1f3fc-200d-2640":0,"1f9b9-1f3fd-200d-2640":0,"1f9b9-1f3fe-200d-2640":0,"1f9b9-1f3ff-200d-2640":0,"1f9b9-1f3fb-200d-2642":0,"1f9b9-1f3fc-200d-2642":0,"1f9b9-1f3fd-200d-2642":0,"1f9b9-1f3fe-200d-2642":0,"1f9b9-1f3ff-200d-2642":0,"1f9b9-1f3fb":0,"1f9b9-1f3fc":0,"1f9b9-1f3fd":0,"1f9b9-1f3fe":0,"1f9b9-1f3ff":0,"1f9bb-1f3fb":0,"1f9bb-1f3fc":0,"1f9bb-1f3fd":0,"1f9bb-1f3fe":0,"1f9bb-1f3ff":0,"1f9cd-1f3fb-200d-2640":0,"1f9cd-1f3fc-200d-2640":0,"1f9cd-1f3fd-200d-2640":0,"1f9cd-1f3fe-200d-2640":0,"1f9cd-1f3ff-200d-2640":0,"1f9cd-1f3fb-200d-2642":0,"1f9cd-1f3fc-200d-2642":0,"1f9cd-1f3fd-200d-2642":0,"1f9cd-1f3fe-200d-2642":0,"1f9cd-1f3ff-200d-2642":0,"1f9cd-1f3fb":0,"1f9cd-1f3fc":0,"1f9cd-1f3fd":0,"1f9cd-1f3fe":0,"1f9cd-1f3ff":0,"1f9ce-1f3fb-200d-2640":0,"1f9ce-1f3fc-200d-2640":0,"1f9ce-1f3fd-200d-2640":0,"1f9ce-1f3fe-200d-2640":0,"1f9ce-1f3ff-200d-2640":0,"1f9ce-1f3fb-200d-2642":0,"1f9ce-1f3fc-200d-2642":0,"1f9ce-1f3fd-200d-2642":0,"1f9ce-1f3fe-200d-2642":0,"1f9ce-1f3ff-200d-2642":0,"1f9ce-1f3fb":0,"1f9ce-1f3fc":0,"1f9ce-1f3fd":0,"1f9ce-1f3fe":0,"1f9ce-1f3ff":0,"1f9cf-1f3fb-200d-2640":0,"1f9cf-1f3fc-200d-2640":0,"1f9cf-1f3fd-200d-2640":0,"1f9cf-1f3fe-200d-2640":0,"1f9cf-1f3ff-200d-2640":0,"1f9cf-1f3fb-200d-2642":0,"1f9cf-1f3fc-200d-2642":0,"1f9cf-1f3fd-200d-2642":0,"1f9cf-1f3fe-200d-2642":0,"1f9cf-1f3ff-200d-2642":0,"1f9cf-1f3fb":0,"1f9cf-1f3fc":0,"1f9cf-1f3fd":0,"1f9cf-1f3fe":0,"1f9cf-1f3ff":0,"1f9d1-1f3fb-200d-1f33e":0,"1f9d1-1f3fc-200d-1f33e":0,"1f9d1-1f3fd-200d-1f33e":0,"1f9d1-1f3fe-200d-1f33e":0,"1f9d1-1f3ff-200d-1f33e":0,"1f9d1-1f3fb-200d-1f373":0,"1f9d1-1f3fc-200d-1f373":0,"1f9d1-1f3fd-200d-1f373":0,"1f9d1-1f3fe-200d-1f373":0,"1f9d1-1f3ff-200d-1f373":0,"1f9d1-1f3fb-200d-1f37c":0,"1f9d1-1f3fc-200d-1f37c":0,"1f9d1-1f3fd-200d-1f37c":0,"1f9d1-1f3fe-200d-1f37c":0,"1f9d1-1f3ff-200d-1f37c":0,"1f9d1-1f3fb-200d-1f384":0,"1f9d1-1f3fc-200d-1f384":0,"1f9d1-1f3fd-200d-1f384":0,"1f9d1-1f3fe-200d-1f384":0,"1f9d1-1f3ff-200d-1f384":0,"1f9d1-1f3fb-200d-1f393":0,"1f9d1-1f3fc-200d-1f393":0,"1f9d1-1f3fd-200d-1f393":0,"1f9d1-1f3fe-200d-1f393":0,"1f9d1-1f3ff-200d-1f393":0,"1f9d1-1f3fb-200d-1f3a4":0,"1f9d1-1f3fc-200d-1f3a4":0,"1f9d1-1f3fd-200d-1f3a4":0,"1f9d1-1f3fe-200d-1f3a4":0,"1f9d1-1f3ff-200d-1f3a4":0,"1f9d1-1f3fb-200d-1f3a8":0,"1f9d1-1f3fc-200d-1f3a8":0,"1f9d1-1f3fd-200d-1f3a8":0,"1f9d1-1f3fe-200d-1f3a8":0,"1f9d1-1f3ff-200d-1f3a8":0,"1f9d1-1f3fb-200d-1f3eb":0,"1f9d1-1f3fc-200d-1f3eb":0,"1f9d1-1f3fd-200d-1f3eb":0,"1f9d1-1f3fe-200d-1f3eb":0,"1f9d1-1f3ff-200d-1f3eb":0,"1f9d1-1f3fb-200d-1f3ed":0,"1f9d1-1f3fc-200d-1f3ed":0,"1f9d1-1f3fd-200d-1f3ed":0,"1f9d1-1f3fe-200d-1f3ed":0,"1f9d1-1f3ff-200d-1f3ed":0,"1f9d1-1f3fb-200d-1f4bb":0,"1f9d1-1f3fc-200d-1f4bb":0,"1f9d1-1f3fd-200d-1f4bb":0,"1f9d1-1f3fe-200d-1f4bb":0,"1f9d1-1f3ff-200d-1f4bb":0,"1f9d1-1f3fb-200d-1f4bc":0,"1f9d1-1f3fc-200d-1f4bc":0,"1f9d1-1f3fd-200d-1f4bc":0,"1f9d1-1f3fe-200d-1f4bc":0,"1f9d1-1f3ff-200d-1f4bc":0,"1f9d1-1f3fb-200d-1f527":0,"1f9d1-1f3fc-200d-1f527":0,"1f9d1-1f3fd-200d-1f527":0,"1f9d1-1f3fe-200d-1f527":0,"1f9d1-1f3ff-200d-1f527":0,"1f9d1-1f3fb-200d-1f52c":0,"1f9d1-1f3fc-200d-1f52c":0,"1f9d1-1f3fd-200d-1f52c":0,"1f9d1-1f3fe-200d-1f52c":0,"1f9d1-1f3ff-200d-1f52c":0,"1f9d1-1f3fb-200d-1f680":0,"1f9d1-1f3fc-200d-1f680":0,"1f9d1-1f3fd-200d-1f680":0,"1f9d1-1f3fe-200d-1f680":0,"1f9d1-1f3ff-200d-1f680":0,"1f9d1-1f3fb-200d-1f692":0,"1f9d1-1f3fc-200d-1f692":0,"1f9d1-1f3fd-200d-1f692":0,"1f9d1-1f3fe-200d-1f692":0,"1f9d1-1f3ff-200d-1f692":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fb-200d-1f9af":0,"1f9d1-1f3fc-200d-1f9af":0,"1f9d1-1f3fd-200d-1f9af":0,"1f9d1-1f3fe-200d-1f9af":0,"1f9d1-1f3ff-200d-1f9af":0,"1f9d1-1f3fb-200d-1f9b0":0,"1f9d1-1f3fc-200d-1f9b0":0,"1f9d1-1f3fd-200d-1f9b0":0,"1f9d1-1f3fe-200d-1f9b0":0,"1f9d1-1f3ff-200d-1f9b0":0,"1f9d1-1f3fb-200d-1f9b1":0,"1f9d1-1f3fc-200d-1f9b1":0,"1f9d1-1f3fd-200d-1f9b1":0,"1f9d1-1f3fe-200d-1f9b1":0,"1f9d1-1f3ff-200d-1f9b1":0,"1f9d1-1f3fb-200d-1f9b2":0,"1f9d1-1f3fc-200d-1f9b2":0,"1f9d1-1f3fd-200d-1f9b2":0,"1f9d1-1f3fe-200d-1f9b2":0,"1f9d1-1f3ff-200d-1f9b2":0,"1f9d1-1f3fb-200d-1f9b3":0,"1f9d1-1f3fc-200d-1f9b3":0,"1f9d1-1f3fd-200d-1f9b3":0,"1f9d1-1f3fe-200d-1f9b3":0,"1f9d1-1f3ff-200d-1f9b3":0,"1f9d1-1f3fb-200d-1f9bc":0,"1f9d1-1f3fc-200d-1f9bc":0,"1f9d1-1f3fd-200d-1f9bc":0,"1f9d1-1f3fe-200d-1f9bc":0,"1f9d1-1f3ff-200d-1f9bc":0,"1f9d1-1f3fb-200d-1f9bd":0,"1f9d1-1f3fc-200d-1f9bd":0,"1f9d1-1f3fd-200d-1f9bd":0,"1f9d1-1f3fe-200d-1f9bd":0,"1f9d1-1f3ff-200d-1f9bd":0,"1f9d1-1f3fb-200d-2695":0,"1f9d1-1f3fc-200d-2695":0,"1f9d1-1f3fd-200d-2695":0,"1f9d1-1f3fe-200d-2695":0,"1f9d1-1f3ff-200d-2695":0,"1f9d1-1f3fb-200d-2696":0,"1f9d1-1f3fc-200d-2696":0,"1f9d1-1f3fd-200d-2696":0,"1f9d1-1f3fe-200d-2696":0,"1f9d1-1f3ff-200d-2696":0,"1f9d1-1f3fb-200d-2708":0,"1f9d1-1f3fc-200d-2708":0,"1f9d1-1f3fd-200d-2708":0,"1f9d1-1f3fe-200d-2708":0,"1f9d1-1f3ff-200d-2708":0,"1f9d1-1f3fb":0,"1f9d1-1f3fc":0,"1f9d1-1f3fd":0,"1f9d1-1f3fe":0,"1f9d1-1f3ff":0,"1f9d2-1f3fb":0,"1f9d2-1f3fc":0,"1f9d2-1f3fd":0,"1f9d2-1f3fe":0,"1f9d2-1f3ff":0,"1f9d3-1f3fb":0,"1f9d3-1f3fc":0,"1f9d3-1f3fd":0,"1f9d3-1f3fe":0,"1f9d3-1f3ff":0,"1f9d4-1f3fb-200d-2640":0,"1f9d4-1f3fc-200d-2640":0,"1f9d4-1f3fd-200d-2640":0,"1f9d4-1f3fe-200d-2640":0,"1f9d4-1f3ff-200d-2640":0,"1f9d4-1f3fb-200d-2642":0,"1f9d4-1f3fc-200d-2642":0,"1f9d4-1f3fd-200d-2642":0,"1f9d4-1f3fe-200d-2642":0,"1f9d4-1f3ff-200d-2642":0,"1f9d4-1f3fb":0,"1f9d4-1f3fc":0,"1f9d4-1f3fd":0,"1f9d4-1f3fe":0,"1f9d4-1f3ff":0,"1f9d5-1f3fb":0,"1f9d5-1f3fc":0,"1f9d5-1f3fd":0,"1f9d5-1f3fe":0,"1f9d5-1f3ff":0,"1f9d6-1f3fb-200d-2640":0,"1f9d6-1f3fc-200d-2640":0,"1f9d6-1f3fd-200d-2640":0,"1f9d6-1f3fe-200d-2640":0,"1f9d6-1f3ff-200d-2640":0,"1f9d6-1f3fb-200d-2642":0,"1f9d6-1f3fc-200d-2642":0,"1f9d6-1f3fd-200d-2642":0,"1f9d6-1f3fe-200d-2642":0,"1f9d6-1f3ff-200d-2642":0,"1f9d6-1f3fb":0,"1f9d6-1f3fc":0,"1f9d6-1f3fd":0,"1f9d6-1f3fe":0,"1f9d6-1f3ff":0,"1f9d7-1f3fb-200d-2640":0,"1f9d7-1f3fc-200d-2640":0,"1f9d7-1f3fd-200d-2640":0,"1f9d7-1f3fe-200d-2640":0,"1f9d7-1f3ff-200d-2640":0,"1f9d7-1f3fb-200d-2642":0,"1f9d7-1f3fc-200d-2642":0,"1f9d7-1f3fd-200d-2642":0,"1f9d7-1f3fe-200d-2642":0,"1f9d7-1f3ff-200d-2642":0,"1f9d7-1f3fb":0,"1f9d7-1f3fc":0,"1f9d7-1f3fd":0,"1f9d7-1f3fe":0,"1f9d7-1f3ff":0,"1f9d8-1f3fb-200d-2640":0,"1f9d8-1f3fc-200d-2640":0,"1f9d8-1f3fd-200d-2640":0,"1f9d8-1f3fe-200d-2640":0,"1f9d8-1f3ff-200d-2640":0,"1f9d8-1f3fb-200d-2642":0,"1f9d8-1f3fc-200d-2642":0,"1f9d8-1f3fd-200d-2642":0,"1f9d8-1f3fe-200d-2642":0,"1f9d8-1f3ff-200d-2642":0,"1f9d8-1f3fb":0,"1f9d8-1f3fc":0,"1f9d8-1f3fd":0,"1f9d8-1f3fe":0,"1f9d8-1f3ff":0,"1f9d9-1f3fb-200d-2640":0,"1f9d9-1f3fc-200d-2640":0,"1f9d9-1f3fd-200d-2640":0,"1f9d9-1f3fe-200d-2640":0,"1f9d9-1f3ff-200d-2640":0,"1f9d9-1f3fb-200d-2642":0,"1f9d9-1f3fc-200d-2642":0,"1f9d9-1f3fd-200d-2642":0,"1f9d9-1f3fe-200d-2642":0,"1f9d9-1f3ff-200d-2642":0,"1f9d9-1f3fb":0,"1f9d9-1f3fc":0,"1f9d9-1f3fd":0,"1f9d9-1f3fe":0,"1f9d9-1f3ff":0,"1f9da-1f3fb-200d-2640":0,"1f9da-1f3fc-200d-2640":0,"1f9da-1f3fd-200d-2640":0,"1f9da-1f3fe-200d-2640":0,"1f9da-1f3ff-200d-2640":0,"1f9da-1f3fb-200d-2642":0,"1f9da-1f3fc-200d-2642":0,"1f9da-1f3fd-200d-2642":0,"1f9da-1f3fe-200d-2642":0,"1f9da-1f3ff-200d-2642":0,"1f9da-1f3fb":0,"1f9da-1f3fc":0,"1f9da-1f3fd":0,"1f9da-1f3fe":0,"1f9da-1f3ff":0,"1f9db-1f3fb-200d-2640":0,"1f9db-1f3fc-200d-2640":0,"1f9db-1f3fd-200d-2640":0,"1f9db-1f3fe-200d-2640":0,"1f9db-1f3ff-200d-2640":0,"1f9db-1f3fb-200d-2642":0,"1f9db-1f3fc-200d-2642":0,"1f9db-1f3fd-200d-2642":0,"1f9db-1f3fe-200d-2642":0,"1f9db-1f3ff-200d-2642":0,"1f9db-1f3fb":0,"1f9db-1f3fc":0,"1f9db-1f3fd":0,"1f9db-1f3fe":0,"1f9db-1f3ff":0,"1f9dc-1f3fb-200d-2640":0,"1f9dc-1f3fc-200d-2640":0,"1f9dc-1f3fd-200d-2640":0,"1f9dc-1f3fe-200d-2640":0,"1f9dc-1f3ff-200d-2640":0,"1f9dc-1f3fb-200d-2642":0,"1f9dc-1f3fc-200d-2642":0,"1f9dc-1f3fd-200d-2642":0,"1f9dc-1f3fe-200d-2642":0,"1f9dc-1f3ff-200d-2642":0,"1f9dc-1f3fb":0,"1f9dc-1f3fc":0,"1f9dc-1f3fd":0,"1f9dc-1f3fe":0,"1f9dc-1f3ff":0,"1f9dd-1f3fb-200d-2640":0,"1f9dd-1f3fc-200d-2640":0,"1f9dd-1f3fd-200d-2640":0,"1f9dd-1f3fe-200d-2640":0,"1f9dd-1f3ff-200d-2640":0,"1f9dd-1f3fb-200d-2642":0,"1f9dd-1f3fc-200d-2642":0,"1f9dd-1f3fd-200d-2642":0,"1f9dd-1f3fe-200d-2642":0,"1f9dd-1f3ff-200d-2642":0,"1f9dd-1f3fb":0,"1f9dd-1f3fc":0,"1f9dd-1f3fd":0,"1f9dd-1f3fe":0,"1f9dd-1f3ff":0,"261d-1f3fb":0,"261d-1f3fc":0,"261d-1f3fd":0,"261d-1f3fe":0,"261d-1f3ff":0,"26f9-1f3fb-200d-2640":0,"26f9-1f3fc-200d-2640":0,"26f9-1f3fd-200d-2640":0,"26f9-1f3fe-200d-2640":0,"26f9-1f3ff-200d-2640":0,"26f9-1f3fb-200d-2642":0,"26f9-1f3fc-200d-2642":0,"26f9-1f3fd-200d-2642":0,"26f9-1f3fe-200d-2642":0,"26f9-1f3ff-200d-2642":0,"26f9-1f3fb":0,"26f9-1f3fc":0,"26f9-1f3fd":0,"26f9-1f3fe":0,"26f9-1f3ff":0,"270a-1f3fb":0,"270a-1f3fc":0,"270a-1f3fd":0,"270a-1f3fe":0,"270a-1f3ff":0,"270b-1f3fb":0,"270b-1f3fc":0,"270b-1f3fd":0,"270b-1f3fe":0,"270b-1f3ff":0,"270c-1f3fb":0,"270c-1f3fc":0,"270c-1f3fd":0,"270c-1f3fe":0,"270c-1f3ff":0,"270d-1f3fb":0,"270d-1f3fc":0,"270d-1f3fd":0,"270d-1f3fe":0,"270d-1f3ff":0}},n=s[""];for(const e in s)e&&Object.assign(n,s[e]);const a=n},3189:(e,t,i)=>{"use strict";i.d(t,{Bf:()=>n,U9:()=>a,bt:()=>s});const s='Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif',n="16px",a="400"},356:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});const s="undefined"!=typeof ImageBitmap},5296:(e,t,i)=>{"use strict";i.d(t,{Kx:()=>r,cK:()=>d,jt:()=>l});var s=i(3035),n=i(3725);const a=new Map;function o(e){return a.get(e)}function r(e){const t=o(e);t&&(t.isCancelled=!0,t.deferred.resolve())}function d(e,t,i){return i||(i=function(e){r(e);const t={isCancelled:!1,deferred:(0,n.Z)()};return a.set(e,t),t.deferred.then((()=>{o(e)===t&&a.delete(e)})),t}(t)),(0,s.T2)((()=>{i.isCancelled||(e()?d(e,t,i):i.deferred.resolve())})),i.deferred}function l(e){(0,s.T2)((()=>{e()&&l(e)}))}},1470:(e,t,i)=>{"use strict";function s(e,t){return e.reduce(((e,t)=>e+t),t)}i.d(t,{Z:()=>s})},2353:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function n(e,t){return s(this,void 0,void 0,(function*(){const i=e.map(((e,i,n)=>s(this,void 0,void 0,(function*(){if(yield t(e,i,n))return e}))));return(yield Promise.all(i)).filter(Boolean)}))}},8847:(e,t,i)=>{"use strict";function s(e,t){const i=[];let s=-1;for(;-1!==(s=e.findIndex(t));)i.push(e.splice(s,1)[0]);return i}i.d(t,{Z:()=>s})},54:(e,t,i)=>{"use strict";function s(e,t){const i=[],s=[];for(let n=0,a=e.length;ns})},5916:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});class s{constructor(e){this.assets=e,this.tempId=0}playSound(e,t=!1){++this.tempId,this.assetName=e;try{const i=this.createAudio();i.autoplay=!0,i.src="assets/audio/"+e,i.loop=t,i.play()}catch(t){console.error("playSound",e,t)}}playSoundIfDifferent(e,t){this.assetName!==e&&this.playSound(e,t)}createAudio(){let{audio:e}=this;return e||(e=this.audio=new Audio,e.play(),e)}stopSound(){this.audio&&this.audio.pause()}cancelDelayedPlay(){++this.tempId}playSoundWithTimeout(e,t,i){const s=++this.tempId;setTimeout((()=>{this.tempId===s&&this.playSound(e,t)}),i)}}},8678:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(3019);function n(e){return(0,s.Z)(e,"readAsDataURL")}},6705:(e,t,i)=>{"use strict";i.d(t,{Z:()=>m});var s=i(3725),n=i(8594),a=i(3035);const o=[];let r=!1;function d(e,t="push"){if(!e.items.length)return Promise.resolve([]);const i=e.promise=(0,s.Z)();return o[t](e),l(),i}function l(){r||function(e){if(!e.items.length)return e.promise.resolve([]),Promise.resolve([]);const t=e.items.slice(),i=[];return new Promise(((s,o)=>{const r=()=>{return d=this,l=void 0,h=function*(){const d=performance.now();do{yield(0,n.e9)();const s=e.process.apply(e.context,t.shift());let a;if(s instanceof Promise)try{a=yield s}catch(e){return void o(e)}else a=s;i.push(a)}while(t.length>0&&performance.now()-d<6);t.length>0?(0,a.T2)(r):s(i)},new((c=void 0)||(c=Promise))((function(e,t){function i(e){try{n(h.next(e))}catch(e){t(e)}}function s(e){try{n(h.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof c?n:new c((function(e){e(n)}))).then(i,s)}n((h=h.apply(d,l||[])).next())}));var d,l,c,h};(0,a.T2)(r)})).then(e.promise.resolve,e.promise.reject)}(o.shift()).finally((()=>{r=!1,o.length&&l()}))}var c=i(6663);let h,u;function p(e,t,i,s=document.createElement("canvas")){s.width=e.width,s.height=e.height;const n=s.getContext("2d",{alpha:!1});return c.Z?(n.filter=`blur(${t}px)`,n.drawImage(e,2*-t,2*-t,s.width+4*t,s.height+4*t)):(n.drawImage(e,0,0),u(n,0,0,s.width,s.height,t,i)),s}h=c.Z?Promise.resolve():i.e(77).then(i.bind(i,7077)).then((e=>{u=e.default}));const f=new Map;function m(e,t=2,i=2){if(!e)throw"no dataUri for blur: "+e;f.size>150&&f.clear();const s=document.createElement("canvas");s.className="canvas-thumbnail";let n=f.get(e);if(n)s.width=n.canvas.width,s.height=n.canvas.height,n.promise.then((()=>{s.getContext("2d").drawImage(n.canvas,0,0,s.width,s.height)}));else{const a=new Promise((n=>{h.then((()=>{const a=new Image;a.onload=()=>{d({items:[[a,t,i,s]],context:null,process:p},"unshift").then((()=>{n()}))},a.src=e}))}));f.set(e,n={canvas:s,promise:a})}return Object.assign(Object.assign({},n),{canvas:s})}},4059:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l,o:()=>d});var s=i(4762),n=i(3306),a=i(9818);const o=(0,n.Z)("ffd8ffe000104a46494600010100000100010000ffdb004300281c1e231e19282321232d2b28303c64413c37373c7b585d4964918099968f808c8aa0b4e6c3a0aadaad8a8cc8ffcbdaeef5ffffff9bc1fffffffaffe6fdfff8ffdb0043012b2d2d3c353c76414176f8a58ca5f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8ffc00011080000000003012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00"),r=(0,n.Z)("ffd9");function d(e){const t="base64,",i=e.slice(e.indexOf(t)+t.length),s=[...atob(i)].map((e=>e.charCodeAt(0)));return new Uint8Array(s)}function l(e,t=!1){let i,n;t||1!==e[0]?i=(0,a.Z)(e):(i=new Uint8Array(o.concat(Array.from(e.slice(3)),r)),i[164]=e[1],i[166]=e[2]),n=t?s.IS_SAFARI?"image/png":"image/webp":"image/jpeg";const d=function(e,t="image/jpeg"){return`data:${t};base64,${btoa(String.fromCharCode(...e))}`}(i,n);return d}},9897:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(410),n=i(9405);function a(e,t,i,s,a=!0){if(ei/s?r=t*i/e|0:(o=e*s/t|0,o>i&&(r=r*i/o|0,o=i)),a&&o>=e&&r>=t&&(o=e,r=t),(0,n.C)(o,r)}s.GO.calcImageInBox=a},2890:(e,t,i)=>{"use strict";function s(e,t,i,s,n,a){const o=e.canvas.dpr;o&&(t*=o,i*=o,s*=o),e.beginPath(),e.arc(t,i,s,0,2*Math.PI,!1),e.closePath(),n&&e.fill(),a&&e.stroke()}function n(e,t,i,n,a,o){return s(e,t+n,i+n,n,a,o)}i.d(t,{Z:()=>s,o:()=>n})},8097:(e,t,i)=>{"use strict";let s;function n(e,t){if(!s){const e=document.createElement("canvas");s=e.getContext("2d",{alpha:!1})}return s.font!==t&&(s.font=t),s.measureText(e).width}i.d(t,{Z:()=>n})},7814:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(356);function n(e){return new Promise((t=>{return i=this,n=void 0,o=function*(){var i,n,a;const o=document.createElement("canvas"),r=null!==(i=e.size)&&void 0!==i?i:e.mediaSize.aspectFitted(e.boxSize),d=window.devicePixelRatio&&1;o.width=r.width*d,o.height=r.height*d;const l=o.getContext("2d");let c;c=s.Z?yield createImageBitmap(e.media,{resizeWidth:r.width,resizeHeight:r.height}):e.media,l.drawImage(c,0,0,o.width,o.height),s.Z&&(null==c||c.close());const h=null!==(n=e.mimeType)&&void 0!==n?n:"image/jpeg",u=null!==(a=e.quality)&&void 0!==a?a:1;if(e.toDataURL){const e=o.toDataURL(h,u);t({url:e,size:r})}else o.toBlob((e=>{t({blob:e,size:r})}),h,u)},new((a=void 0)||(a=Promise))((function(e,t){function s(e){try{d(o.next(e))}catch(e){t(e)}}function r(e){try{d(o.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(s,r)}d((o=o.apply(i,n||[])).next())}));var i,n,a,o}))}},467:(e,t,i)=>{"use strict";i.d(t,{ST:()=>r,ZP:()=>d,gV:()=>l});var s=i(5813);const n=/[`~!@#$%^&*()\-_=+\[\]\\|{}'";:\/?.>,<]+/g,a=/^\s+|\s$/g,o={й:"q",ц:"w",у:"e",к:"r",е:"t",н:"y",г:"u",ш:"i",щ:"o",з:"p",х:"[",ъ:"]",ф:"a",ы:"s",в:"d",а:"f",п:"g",р:"h",о:"j",л:"k",д:"l",ж:";",э:"'",я:"z",ч:"x",с:"c",м:"v",и:"b",т:"n",ь:"m",б:",",ю:".",".":"/"};function r(e){return e.replace(n,"").replace(a,"")}function d(e,t=!0){return l(e,{clearBadChars:!0,latinize:t,ignoreCase:!0})}function l(e,t={}){const i=t.includeTag&&"%"===e.charAt(0),n=e;return t.clearBadChars&&(e=r(e)),t.latinize&&(e=function(e){return e.replace(/[^A-Za-z0-9]/g,(e=>{const t=s.Z[e];return null!=t?t:e}))}(e)),t.ignoreCase&&(e=e.toLowerCase()),i&&(e="%"+e),t.latinize&&(e+=""+function(e){return e.toLowerCase().replace(/[\wа-я]/g,(e=>{const t=o[e];return null!=t?t:e}))}(n)),e}},2166:(e,t,i)=>{"use strict";function s(e){var t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}catch(e){}document.body.removeChild(t)}function n(e){navigator.clipboard?navigator.clipboard.writeText(e).catch((t=>{console.error("clipboard error",t),s(e)})):s(e)}i.d(t,{T:()=>n})},3416:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(5432),n=i(4755),a=i(2296);class o extends a.Z{constructor(){super("menu",!0),this.onMouseMove=e=>{const t=this.element.getBoundingClientRect(),{clientX:i,clientY:s}=e,n=i>=t.right?i-t.right:t.left-i,a=s>=t.bottom?s-t.bottom:t.top-s;(n>=100||a>=100)&&this.close()},n.Z.addEventListener("resize",(()=>{this.element&&this.close()}))}isOpened(){return!!this.element}close(){this.element&&(this.element.classList.remove("active"),this.element.parentElement.classList.remove("menu-open")),super.close(),s.Z||window.removeEventListener("mousemove",this.onMouseMove)}openBtnMenu(e,t){super.open(e),this.element.classList.add("active","was-open"),this.element.parentElement.classList.add("menu-open"),t&&this.addEventListener("toggle",t,{once:!0}),s.Z||window.addEventListener("mousemove",this.onMouseMove)}}const r=new o},632:(e,t,i)=>{"use strict";i.d(t,{OD:()=>h,fl:()=>S,mr:()=>u,rz:()=>c,s2:()=>r,xE:()=>p,zM:()=>l});var s=i(410),n=i(2325);const a=["January","February","March","April","May","June","July","August","September","October","November","December"],o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r=86400,d=e=>{const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),i=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-i);const s=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-s.getTime())/r+1)/7)};function l(e){const t=new Date,i=t.getTime()/1e3|0,s=e.getTime()/1e3|0,a={};return i-s{const i=t.monthAsNumber?".":" ",s=("0"+e.getHours()).slice(-2)+":"+("0"+e.getMinutes()).slice(-2)+(t.noSeconds?"":":"+("0"+e.getSeconds()).slice(-2));return(t.leadingZero?("0"+e.getDate()).slice(-2):e.getDate())+i+(t.monthAsNumber?("0"+(e.getMonth()+1)).slice(-2):a[e.getMonth()])+i+e.getFullYear()+(t.noTime?"":", "+s)},f=2013,m=new RegExp("20[0-9]{1,2}"),g=new RegExp("(\\w{3,}) ([0-9]{0,4})","i"),v=new RegExp("([0-9]{0,4}) (\\w{2,})","i"),b=new RegExp("^([0-9]{1,4})(\\.| |/|\\-)([0-9]{1,4})$","i"),y=new RegExp("^([0-9]{1,2})(\\.| |/|\\-)([0-9]{1,2})(\\.| |/|\\-)([0-9]{1,4})$","i"),w=[31,29,31,30,31,30,31,31,30,31,30,31];function S(e,t){const i=e.trim().toLowerCase();if(i.length<3)return;if(0==="today".indexOf(i)){const e=new Date,i=e.getFullYear(),s=e.getMonth(),n=e.getDate();e.setFullYear(i,s,n),e.setHours(0,0,0);const a=e.getTime();e.setFullYear(i,s,n+1),e.setHours(0,0,0);const o=e.getTime()-1;return void t.push({title:"Today",minDate:a,maxDate:o})}if(0==="yesterday".indexOf(i)){const e=new Date,i=e.getFullYear(),s=e.getMonth(),n=e.getDate();e.setFullYear(i,s,n),e.setHours(0,0,0);const a=e.getTime()-864e5;e.setFullYear(i,s,n+1),e.setHours(0,0,0);const o=e.getTime()-86400001;return void t.push({title:"Yesterday",minDate:a,maxDate:o})}const s=function(e){const t=new Date;if(e.length<=3)return-1;for(let i=0;i<7;i++)if(t.setDate(t.getDate()+1),0===Z(t.getTime()).toLowerCase().indexOf(e))return t.getDay();return-1}(i);if(s>=0){const e=new Date,i=e.getTime(),n=s-e.getDay();e.setDate(e.getDate()+n),e.getTime()>i&&e.setTime(e.getTime()-6048e5);const a=e.getFullYear(),o=e.getMonth(),r=e.getDate();e.setFullYear(a,o,r),e.setHours(0,0,0);const d=e.getTime();e.setFullYear(a,o,r+1),e.setHours(0,0,0);const l=e.getTime()-1;return void t.push({title:Z(d),minDate:d,maxDate:l})}let n;if(null===(n=b.exec(i)))if(null===(n=y.exec(i)))if(null===(n=m.exec(i))){if(null!==(n=g.exec(i))){const e=n[1],i=n[2],s=T(e);if(s>=0){const e=+i;if(e>0&&e<=31)return void L(t,e-1,s);if(e>=f)return void C(t,s,e)}}if(null!==(n=v.exec(i))){const e=n[1],i=T(n[2]);if(i>=0){const s=+e;if(s>0&&s<=31)return void L(t,s-1,i);s>=f&&C(t,i,s)}}}else{let e=+i;const s=(new Date).getFullYear();if(e=e;i--){const e=new Date;e.setFullYear(i,0,1),e.setHours(0,0,0);const s=e.getTime();e.setFullYear(i+1,0,1),e.setHours(0,0,0);const n=e.getTime()-1;t.push({title:""+i,minDate:s,maxDate:n})}}else if(e<=s){const i=new Date;i.setFullYear(e,0,1),i.setHours(0,0,0);const s=i.getTime();i.setFullYear(e+1,0,1),i.setHours(0,0,0);const n=i.getTime()-1;t.push({title:""+e,minDate:s,maxDate:n})}}else{const e=n[1],i=n[3],s=n[5];if(!n[2]===n[4])return;const a=parseInt(e),o=parseInt(i)-1;let r=parseInt(s);r>=10&&r<=99&&(r+=2e3);const d=(new Date).getFullYear();if(M(a-1,o)&&r>=f&&r<=d){const e=new Date;e.setFullYear(r,o,a),e.setHours(0,0,0);const i=e.getTime();e.setFullYear(r,o,a+1),e.setHours(0,0,0);const s=e.getTime()-1;return void t.push({title:P(i),minDate:i,maxDate:s})}}else{const e=n[1],i=n[3],s=parseInt(e),a=parseInt(i);if(s>0&&s<=31){if(a>=f&&s<=12)return void C(t,s-1,a);a<=12&&L(t,s-1,a-1)}else s>=f&&a<=12&&C(t,a-1,s)}}function C(e,t,i){const s=(new Date).getFullYear(),n=Date.now();if(i>=f&&i<=s){const s=new Date;s.setFullYear(i,t,1),s.setHours(0,0,0);const a=s.getTime();if(a>n)return;s.setMonth(s.getMonth()+1);const o=s.getTime()-1;e.push({title:I(a),minDate:a,maxDate:o})}}function L(e,t,i){if(M(t,i)){const n=(new Date).getFullYear(),a=Date.now();for(let o=n;o>=f;o--){if(1===i&&28===t&&((s=o)%4!=0||s%100==0)&&s%400!=0)continue;const r=new Date;r.setFullYear(o,i,t+1),r.setHours(0,0,0);const d=r.getTime();if(d>a)continue;r.setFullYear(o,i,t+2),r.setHours(0,0,0);const l=r.getTime()-1;o===n?e.push({title:E(d),minDate:d,maxDate:l}):e.push({title:P(d),minDate:d,maxDate:l})}}var s}function I(e){const t=new Date(e);return a[t.getMonth()].slice(0,3)+" "+t.getFullYear()}function E(e){const t=new Date(e);return a[t.getMonth()].slice(0,3)+" "+t.getDate()}function P(e){const t=new Date(e);return("0"+t.getDate()).slice(-2)+"."+("0"+(t.getMonth()+1)).slice(-2)+"."+t.getFullYear()}function Z(e){const t=new Date(e);return o[t.getDay()]}function M(e,t){return t>=0&&t<12&&e>=0&&e{"use strict";i.d(t,{Z:()=>d});var s=i(2796),n=i(2166),a=i(3910),o=i(2738);const r="https://t.me/";function d(e={}){const t=document.createElement("a");t.classList.add("anchor-copy");let i,d="LinkCopied";if(e.mePath){const s=r+e.mePath;i=t.href=t.innerText=s}if(e.username){const s=r+e.username;t.href=s,i=t.innerText="@"+e.username,d="UsernameCopied"}return(0,o.fc)(t,(e=>{(0,a.Z)(e),(0,n.T)(null!=i?i:t.href),(0,s.bC)({langPackKey:d})})),t}},6976:(e,t,i)=>{"use strict";i.d(t,{E:()=>c,s:()=>l});var s=i(5432),n=i(4762),a=i(3416),o=i(3910);let r=!1,d=0;function l(){d&&clearTimeout(d),d=window.setTimeout((()=>{d=0,r=!1}),400),r=!0}function c({element:e,callback:t,listenerSetter:i,listenerOptions:d}){const l=i?i.add(e):e.addEventListener.bind(e),c=i?i.removeManual.bind(i,e):e.removeEventListener.bind(e);if(n.IS_APPLE&&s.Z||d){let e;const i=Object.assign(Object.assign({},d||{}),{capture:!0}),s=()=>{clearTimeout(e),c("touchmove",s,i),c("touchend",s,i),c("touchcancel",s,i)};l("touchstart",(n=>{n.touches.length>1?s():(l("touchmove",s,i),l("touchend",s,i),l("touchcancel",s,i),e=window.setTimeout((()=>{r?s():(t(n),s(),a.Z.isOpened()&&l("touchend",o.Z,{once:!0}))}),400))}),d)}else l("contextmenu",s.Z?e=>{t(e),a.Z.isOpened()&&l("touchend",o.Z,{once:!0})}:t,d)}},5077:(e,t,i)=>{"use strict";function s(e,t,i,s){const n=e=>{i({x:e.pageX,y:e.pageY,event:e})},a=t=>{document.removeEventListener("mousemove",n),e.addEventListener("mousedown",o,{once:!0}),null==s||s({x:t.pageX,y:t.pageY,event:t})},o=i=>{0===i.button?(t({x:i.pageX,y:i.pageY,event:i}),n(i),document.addEventListener("mousemove",n),document.addEventListener("mouseup",a,{once:!0})):e.addEventListener("mousedown",o,{once:!0})};e.addEventListener("mousedown",o,{once:!0});const r=e=>{e.preventDefault(),i({x:e.touches[0].clientX,y:e.touches[0].clientY,isTouch:!0,event:e})},d=t=>{document.removeEventListener("touchmove",r),e.addEventListener("touchstart",l,{passive:!1,once:!0});const i=t.touches[0]||t.changedTouches[0];null==s||s({x:i.clientX,y:i.clientY,isTouch:!0,event:t})},l=e=>{t({x:e.touches[0].clientX,y:e.touches[0].clientY,isTouch:!0,event:e}),r(e),document.addEventListener("touchmove",r,{passive:!1}),document.addEventListener("touchend",d,{passive:!1,once:!0})};return e.addEventListener("touchstart",l,{passive:!1,once:!0}),()=>{e.removeEventListener("mousedown",o),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",a),e.removeEventListener("touchstart",l),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",d)}}i.d(t,{Z:()=>s})},6760:(e,t,i)=>{"use strict";function s(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()}i.d(t,{Z:()=>s})},2738:(e,t,i)=>{"use strict";i.d(t,{Cf:()=>o,fc:()=>d,pf:()=>r,tH:()=>l});var s=i(5432),n=i(6669);let a;function o(e){if(e.isTrusted&&"click"===e.type&&e.target!==a)return!0}document.addEventListener("mousedown",(e=>{a=e.target}));const r=s.Z?"mousedown":"click";function d(e,t,i={}){const s=i.listenerSetter?i.listenerSetter.add(e):e.addEventListener.bind(e),n=i.listenerSetter?i.listenerSetter.removeManual.bind(i.listenerSetter,e):e.removeEventListener.bind(e);if(i.touchMouseDown=!0,"click"===r){const e=t;t=t=>{o(t)||e(t)}}return s(r,t,i),()=>n(r,t,i)}function l(e){(0,n.Z)(e,r)}},7529:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(5432),n=i(3241),a=i(5953),o=i(8497);class r extends n.Z{constructor(){super(!1),this.hideControls=(e=!1)=>{if(e)return void(this.hideControlsTimeout||(this.hideControlsTimeout=window.setTimeout(this.hideControls,3e3)));clearTimeout(this.hideControlsTimeout),this.hideControlsTimeout=0;const t=this.element.classList.contains("show-controls");if(!1!==this.controlsLocked){if(this.canHideControls&&!this.canHideControls()||!t||this.controlsLocked)return}else if(!t)return;this.dispatchEvent("toggleControls",!1),this.element.classList.remove("show-controls")},this.showControls=(e=!0)=>{this.hideControlsTimeout?(clearTimeout(this.hideControlsTimeout),this.hideControlsTimeout=0):this.element.classList.contains("show-controls")||!1===this.controlsLocked||(this.dispatchEvent("toggleControls",!0),this.element.classList.add("show-controls")),e&&!this.controlsLocked&&(this.hideControlsTimeout=window.setTimeout(this.hideControls,3e3))},this.toggleControls=e=>{const t=this.element.classList.contains("show-controls");if(void 0===e)t?this.hideControls():this.showControls();else{if(e===t)return;!1===e?this.hideControls():this.showControls()}},this.hideControlsTimeout=0}setup(e){(0,a.Z)(this,e);const{listenerSetter:t,element:i}=this;s.Z?t.add(i)("click",(e=>{this.ignoreClickClassName&&(0,o.Z)(e.target,this.ignoreClickClassName)||this.toggleControls()})):(t.add(i)("mousemove",(()=>{this.showControls()})),t.add(i)("mouseenter",(()=>{this.showControls(!1)})),t.add(i)("mouseleave",(e=>{e.relatedTarget&&this.showOnLeaveToClassName&&(0,o.Z)(e.relatedTarget,this.showOnLeaveToClassName)?this.showControls(!1):this.hideControls()})))}lockControls(e){this.controlsLocked=e,this.element.classList.toggle("disable-hover",!1===e),this.toggleControls(e)}}},4531:(e,t,i)=>{"use strict";i.d(t,{Z:()=>p});var s=i(3003),n=i(2353),a=i(6654),o=i(3416),r=i(3699),d=i(3624),l=i(1483),c=i(6976),h=i(2738),u=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function p({buttons:e,findElement:t,listenTo:i,appendTo:p,filterButtons:f,onOpen:m,onClose:g,onBeforeOpen:v,listenerSetter:b,middleware:y,listenForClick:w}){null!=p||(p=document.body),null!=b||(b=new r.Z);const S=new r.Z,C=y?y.create():(0,d.k)();let L;const I=e=>{const s=t?t(e):i;if(!s)return;let n=L;if((e instanceof MouseEvent||e.hasOwnProperty("preventDefault"))&&e.preventDefault(),n&&n.classList.contains("active"))return!1;(e instanceof MouseEvent||e.hasOwnProperty("cancelBubble"))&&(e.cancelBubble=!0),(()=>{u(this,void 0,void 0,(function*(){yield null==m?void 0:m(s);const t=yield Z();if(!t)return;n=t.element;const{cleanup:i,destroy:a}=t;(0,l.Z)(e,n),o.Z.openBtnMenu(n,(()=>{null==g||g(),i(),setTimeout((()=>{a()}),300)}))}))})()};(0,c.E)({element:i,callback:I,listenerSetter:b});const E=()=>{S.removeAll(),C.clean()},P=()=>{E(),b.removeAll()},Z=()=>u(this,void 0,void 0,(function*(){E(),e.forEach((e=>e.element=void 0));const t=f||(e=>(0,n.Z)(e,(e=>!(null==e?void 0:e.verify)||(0,a.Z)(e.verify(),(e=>null!=e&&e))))),i=yield t(e);if(!i.length)return;const o=L=yield(0,s.Z)({buttons:i,listenerSetter:S});return o.classList.add("contextmenu"),yield null==v?void 0:v(),p.append(o),{element:o,cleanup:E,destroy:()=>{o.remove()}}}));return y&&y.onDestroy((()=>{P()})),w&&(0,h.fc)(i,I,{listenerSetter:b}),{element:L,destroy:P,open:I}}},3163:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(9298),n=i(7030),a=i(3512),o=i(4531),r=i(8497),d=i(3173),l=i(1168),c=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function h(e){const{listenTo:t,isStickerPack:i,verifyRecent:h,appendTo:u,onOpen:p,onClose:f,onSend:m}=e;let g,v;const b=e=>c(this,void 0,void 0,(function*(){const t=yield a.Z.managers.acknowledged.appStickersManager.getFavedStickersStickers();if(!t.cached)return!1;const i=(yield t.result).some((e=>e.id===v.id));return e?!i:i}));return(0,o.Z)({listenTo:t,appendTo:u,findElement:e=>g=(0,r.Z)(e.target,"media-sticker-wrapper"),onOpen:()=>c(this,void 0,void 0,(function*(){return v=yield a.Z.managers.appDocsManager.getDoc(g.dataset.docId),null==p?void 0:p()})),onClose:f,buttons:[{icon:"stickers",text:"Context.ViewStickerSet",onClick:()=>l.Z.createPopup(s.Z,v.stickerSetInput).show(),verify:()=>!i},{icon:"favourites",text:"AddToFavorites",onClick:()=>a.Z.managers.appStickersManager.faveSticker(v.id,!1),verify:()=>b(!0)},{icon:"favourites",text:"DeleteFromFavorites",onClick:()=>a.Z.managers.appStickersManager.faveSticker(v.id,!0),verify:()=>b(!1)},{icon:"delete",text:"DeleteFromRecent",onClick:()=>a.Z.managers.appStickersManager.saveRecentSticker(v.id,!0),verify:()=>{var e;return null!==(e=null==h?void 0:h(g))&&void 0!==e&&e}},{icon:"mute",text:"Chat.Send.WithoutSound",onClick:()=>(null==m||m(),d.Jo.sendDocId(v.id,!1,!0)),verify:()=>!(!n.ZP.chat.peerId||n.ZP.chat.peerId===a.Z.myId)},{icon:"schedule",text:"Chat.Send.ScheduledMessage",onClick:()=>n.ZP.chat.input.scheduleSending((()=>n.ZP.chat.input.sendMessageWithDocument(v))),verify:()=>!!n.ZP.chat.peerId}]})}},7660:(e,t,i)=>{"use strict";function s(e={}){const t=document.createElement("video");return e.pip||(t.disablePictureInPicture=!0),t.setAttribute("playsinline","true"),t}i.d(t,{Z:()=>s})},8222:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(410),n=i(3512),a=i(4755);const o=new class{constructor(){this.resetCache=()=>{this.computedStyle=void 0;const e=this.cache;this.cache={};for(const t in e)this.getProperty(t)},this.cache={},n.Z.addEventListener("theme_change",this.resetCache),a.Z.addEventListener("resize",this.resetCache)}getProperty(e){let t=this.cache[e];return t||(this.computedStyle||(this.computedStyle=window.getComputedStyle(document.documentElement)),t=this.computedStyle.getPropertyValue("--"+e).trim(),this.cache[e]=t)}getPropertyAsSize(e){const t=this.getProperty(e);let i;return"%"===t[t.length-1]||(i=t.indexOf("rem")?16*+t.replace("rem",""):+t.replace("px","")),i}};s.GO&&(s.GO.customProperties=o);const r=o},6669:(e,t,i)=>{"use strict";function s(e,t){const i=new Event(t,{bubbles:!0,cancelable:!0});e.dispatchEvent(i)}i.d(t,{Z:()=>s})},1544:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(4056);function n(e){return Array.from(e.childNodes).map((e=>e.nodeType===e.TEXT_NODE?(0,s.Z)(e.textContent):e.outerHTML)).join("")}},5975:(e,t,i)=>{"use strict";function s(e,t){if(!e)return null;if(e.parentElement===t)return e;for(;e.parentElement;)if((e=e.parentElement).parentElement===t)return e;return null}i.d(t,{Z:()=>s})},8763:(e,t,i)=>{"use strict";function s(e,t){return e.closest(`[${t}]`)}i.d(t,{Z:()=>s})},4668:(e,t,i)=>{"use strict";function s(e,t){return e.closest(t)}i.d(t,{Z:()=>s})},6733:(e,t,i)=>{"use strict";function s(e){e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen()}function n(){document.cancelFullScreen?document.cancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}function a(e,t,i){const s=i?i.add(e):e.addEventListener.bind(e);"webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange".split(" ").forEach((e=>{s(e,t,!1)}))}function o(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement}function r(){return!!o()}i.d(t,{C8:()=>n,Dj:()=>s,Ms:()=>a,W7:()=>o,rB:()=>r})},3299:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n,q:()=>a});var s=i(5975);function n(e,t){const i=document.getSelection(),n=i[t?"anchorNode":"focusNode"],o=i[t?"anchorOffset":"focusOffset"];return(0,s.Z)(n,e)||n===e?Object.assign(Object.assign({},a(e,n,o)),{selection:i}):{selection:i}}function a(e,t,i){if(t===e){const s=e.childNodes,n=s.length;n&&i>=n?i=((t=s[n-1]).textContent||t.alt||"").length:(t=s[i],i=0)}return{node:t,offset:i}}},9041:(e,t,i)=>{"use strict";i.d(t,{CS:()=>r,ZP:()=>c,o8:()=>n});var s=i(6854);const n={bold:{match:'[style*="bold"], [style*="font-weight: 700"], [style*="font-weight: 600"], [style*="font-weight:700"], [style*="font-weight:600"], b, strong',entityName:"messageEntityBold"},underline:{match:'[style*="underline"], u, ins',entityName:"messageEntityUnderline"},italic:{match:'[style*="italic"], i, em',entityName:"messageEntityItalic"},monospace:{match:'[style*="monospace"], [face*="monospace"], pre',entityName:"messageEntityCode"},strikethrough:{match:'[style*="line-through"], [style*="strikethrough"], strike, del, s',entityName:"messageEntityStrike"},link:{match:"A:not(.follow)",entityName:"messageEntityTextUrl"},mentionName:{match:"A.follow",entityName:"messageEntityMentionName"},spoiler:{match:'[style*="spoiler"]',entityName:"messageEntitySpoiler"}},a=new Set(["DIV","P","BR","LI","SECTION","H6","H5","H4","H3","H2","H1","TR","OL","UL"]),o=new RegExp(s.Z,"g"),r="";function d(e,t,i,s){const a=e.parentElement;for(const e in n){const o=n[e],r=a.closest(o.match+', [contenteditable="true"]');null===(null==r?void 0:r.getAttribute("contenteditable"))&&("messageEntityTextUrl"===o.entityName?i.push({_:o.entityName,url:r.href,offset:s.offset,length:t.length}):"messageEntityMentionName"===o.entityName?i.push({_:o.entityName,offset:s.offset,length:t.length,user_id:r.dataset.follow.toUserId()}):i.push({_:o.entityName,offset:s.offset,length:t.length}))}}function l(e){const{length:t}=e;return!t||e[t-1]===r&&t===r.length}function c(e,t,i,s,n,h,u={offset:0}){var p;if(e.nodeType===e.TEXT_NODE){let t=e.nodeValue;return t=t.replace(o,""),t?s===e?i.push(t.substr(0,n)+r+t.substr(n)):i.push(t):s===e&&i.push(r),h&&t.length&&e.parentNode&&d(e,t,h,u),void(u.offset+=t.length)}if(e.nodeType!==e.ELEMENT_NODE)return;const f=()=>{t.push(i.join("")),i.length=0,++u.offset},m=s===e,g=a.has(e.tagName);if(g&&(i.length||"BR"===e.tagName))f();else{const t=e.dataset.stickerEmoji||e.alt,s=e.dataset.stickerEmoji;t&&h&&d(e,t,h,u),s&&h&&h.push({_:"messageEntityCustomEmoji",document_id:e.dataset.docId,offset:u.offset,length:t.length}),t&&(i.push(t),u.offset+=t.length)}m&&!n&&i.push(r);const v=e.matches('[style*="table-cell"], th, td'),b=null==h?void 0:h.length;t.length;let y=!0,w=e.firstChild;for(;w;)c(w,t,i,s,n,h,u),w=w.nextSibling,l(i)||(y=!1);if(y&&(null===(p=e.textContent)||void 0===p?void 0:p.replace(/[\r\n]/g,""))&&(y=!1),m&&n&&i.push(r),v&&e.nextSibling&&!l(i)&&(i.push(" "),++u.offset,void 0!==b))for(let e=b,t=h.length;e{"use strict";i.d(t,{Z:()=>r});var s=i(410),n=i(6875),a=i(1346),o=i(9041);function r(e,t=!0,i=!0){const s=[],r=[],{node:d,offset:l}=!(e instanceof DocumentFragment)&&i&&function(e){const t=window.getSelection();let i,s;if(null==t?void 0:t.rangeCount){const n=t.getRangeAt(0),a=n.startOffset;if(n.startContainer&&n.startContainer==n.endContainer&&a==n.endOffset){const t=a-1,o=e.childNodes;if(n.startContainer===e&&o[t]){i=o[t],s=0;for(let e=0;e{"use strict";i.d(t,{Z:()=>n});var s=i(8204);function n({overflowElement:e,overflowRect:t,selector:i,extraSize:n,elements:a}){null!=t||(t=e.getBoundingClientRect()),null!=a||(a=Array.from(e.querySelectorAll(i))),n&&(t={top:t.top-n,right:t.right+n,bottom:t.bottom+n,left:t.left-n});const o=[],r=[],d=[];let l=!1;for(const i of a){const n=i.getBoundingClientRect(),a=(0,s.Z)(i,e,!1,n,t);let c;a?(l=!0,c=r):c=l?d:o,c.push({element:i,rect:n,visibleRect:a})}return{invisibleTop:o,visible:r,invisibleBottom:d}}},8204:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(241);function n(e,t,i,n=e.getBoundingClientRect(),a=t.getBoundingClientRect()){let{top:o,right:r,bottom:d,left:l}=a;if(i){const e=t.querySelector(".sticky");e&&(o=e.getBoundingClientRect().bottom)}if(n.top>=d||n.bottom<=o||n.right<=l||n.left>=r)return null;const c={top:!1,right:!1,bottom:!1,left:!1,vertical:0,horizontal:0},h=s.Z.width,u=s.Z.height;return{rect:{top:n.topr&&r!==h?(c.right=!0,++c.horizontal,r):n.right,bottom:n.bottom>d&&d!==u?(c.bottom=!0,++c.vertical,d):n.bottom,left:n.left{"use strict";i.d(t,{Z:()=>r});var s=i(3757),n=i(3910),a=i(8497),o=i(3444);function r(e){let t=!1;return new s.Z(Object.assign(Object.assign({},e),{verifyTouchTarget:t=>!(0,a.Z)(t.target,"progress-line")&&!(0,o.Z)(t)&&(!e.verifyTouchTarget||e.verifyTouchTarget(t)),onSwipe:(i,s,a)=>{if(i*=-1,s*=-1,!t&&Math.abs(s)>20)return!0;if(Math.abs(i)>Math.abs(s))(0,n.Z)(a),t=!0;else if(!t&&Math.abs(s)>Math.abs(i))return!0;return e.onSwipe(i,s,a)},onReset:()=>{t=!1,e.onReset&&e.onReset()},cancelEvent:!1}))}},1154:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(6976),n=i(2416);function a(e){return(0,n.Z)(Object.assign(Object.assign({},e),{onSwipe:(t,i,n)=>{if(t*=-1,i*=-1,Math.abs(t)>50)return e.onSwipe(t,i,n),(0,s.s)(),!0}}))}},7545:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(9041);function n(e,t){const i={};e.forEach((e=>i[e]=0));const n=window.getSelection();let a=-1;if(!n.isCollapsed){const t=n.getRangeAt(0),o=t.commonAncestorContainer,r=o.nodeType===o.ELEMENT_NODE?o:o.parentElement,d=document.createTreeWalker(r.closest('[contenteditable="true"]'),NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode:e=>t.intersectsNode(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let l;for(a=0;l=d.nextNode();){++a;for(const t of e){const e=s.o8[t];(l.nodeType===l.ELEMENT_NODE?l:l.parentElement).closest(e.match)&&++i[t]}}}const o={};for(const s of e)o[s]=i[s]>=(t?a:1);return o}},5705:(e,t,i)=>{"use strict";function s(e){if(e instanceof DocumentFragment)return e;const t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content}i.d(t,{Z:()=>s})},2614:(e,t,i)=>{"use strict";function s(e){const t=document.createElement("span");return"string"==typeof e?t.innerHTML=e:t.append(e),t}i.d(t,{Z:()=>s})},8487:(e,t,i)=>{"use strict";function s(e){return null==e?void 0:e.isConnected}i.d(t,{Z:()=>s})},1293:(e,t,i)=>{"use strict";function s(e){return e.isContentEditable||"INPUT"!==e.tagName?!e.textContent.trim()&&!e.querySelector(".emoji, .custom-emoji, .custom-emoji-placeholder"):!e.value.trim()}i.d(t,{Z:()=>s})},1452:(e,t,i)=>{"use strict";function s(e=window.getSelection()){if(!(null==e?void 0:e.rangeCount))return!0;const t=e.getRangeAt(0);return!(!t.collapsed&&t.START_TO_END)}i.d(t,{Z:()=>s})},6299:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(3512),n=i(4762);function a(e){if("Enter"===e.key&&!n.IS_MOBILE&&!e.isComposing){if("enter"===s.Z.settings.sendShortcut){if(e.shiftKey||e.ctrlKey||e.metaKey)return;return!0}{const t=n.IS_APPLE?e.metaKey:e.ctrlKey;if(e.shiftKey||(n.IS_APPLE?e.ctrlKey:e.metaKey))return;if(t)return!0}}return!1}},3444:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(4762);function n(e){return s.IS_MOBILE_SAFARI&&e instanceof TouchEvent&&e.touches[0].clientX<30}},2398:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(5432);function n(e,t=!1,i=!0){if(!s.Z||t&&("INPUT"===document.activeElement.tagName||document.activeElement.isContentEditable))if(i&&e.focus(),e instanceof HTMLInputElement){const t=e.value.length;e.selectionStart=t,e.selectionEnd=t}else{const t=document.createRange();t.selectNodeContents(e),t.collapse(!1);const i=window.getSelection();i.removeAllRanges(),i.addRange(t)}}window.placeCaretAtEnd=n},4484:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(2648);function n(e,t,i,n){return void 0===n&&(n=e.parentElement===t?(0,s.Z)(e):-1),n!==i&&(-1!==n&&ni?t.insertBefore(e,t.children[i]):t.append(e):t.prepend(e),!0)}},2359:(e,t,i)=>{"use strict";function s(e){e.style.display="none",e.offsetLeft,e.style.display=""}i.d(t,{Z:()=>s})},6740:(e,t,i)=>{"use strict";i.d(t,{ZP:()=>o,cj:()=>r});var s=i(925);const n={},a=(e,t)=>{e instanceof HTMLImageElement||e instanceof HTMLVideoElement?e.src=t:e instanceof SVGImageElement?e.setAttributeNS(null,"href",t):e.style.backgroundImage="url("+t+")"};function o(e,t,i,o=!0){if(!t)return console.error("renderImageFromUrl: no url?",e,t),void(null==i||i());const r=e instanceof HTMLVideoElement;if(n[t]&&o||r)e&&a(e,t),i&&(r?(0,s.Z)(e).then(i):null==i||i());else{const s=e instanceof HTMLImageElement,o=s?e:new Image;o.src=t;const r=()=>{!s&&e&&a(e,t),n[t]=!0,null==i||i(),o.removeEventListener("error",d)},d=e=>{console.error("Render image from url failed:",e,t,o),o.removeEventListener("load",r),null==i||i()};o.addEventListener("load",r,{once:!0}),o.addEventListener("error",d,{once:!0})}}function r(e,t,i){return new Promise((s=>{o(e,t,s,i)}))}},2830:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(9674),n=i(6740);function a(e,t,i,a,o=e,r){return a&&t.classList.add("fade-in"),(0,n.cj)(t,i).then((()=>s.Z.mutateElement(e,(()=>{o.append(t),a?t.addEventListener("animationend",(()=>{s.Z.mutate((()=>{t.classList.remove("fade-in"),null==r||r.remove()}))}),{once:!0}):null==r||r.remove()}))))}},5565:(e,t,i)=>{"use strict";function s(e,t){if("string"==typeof t)return void(e.innerHTML=t);const i=e.firstChild;i?e.lastChild===i?i.replaceWith(t):(e.textContent="",e.append(t)):e.append(t)}i.d(t,{Z:()=>s})},669:(e,t,i)=>{"use strict";i.d(t,{Y:()=>m,Z:()=>g});var s=i(4762),n=i(5003),a=i(5400),o=i(3699),r=i(6854),d=i(3228),l=i(5975),c=i(2648);function h(e,t,i,s){let n;if(e===i)n=t-s;else if(e.parentElement===i.parentElement)n=(0,c.Z)(e,!0)-(0,c.Z)(i,!0);else{const t=[];let s=e.parentElement;do{t.push(s)}while(s=s.parentElement);s=i.parentElement;do{if(t.includes(s))break}while(s=s.parentElement);const a=s;e=(0,l.Z)(e,a),i=(0,l.Z)(i,a),n=(0,c.Z)(e,!0)-(0,c.Z)(i,!0)}return(0,d.Z)(n,-1,1)}window.compareNodes=h;var u=i(3299),p=i(2398);const f=new RegExp(`[^${r.Z}]`),m=!1;class g{constructor(){this.saveSelectionOnChange=e=>{const t=document.activeElement;this.saveRangeForElement(t)},this.onFocusOut=e=>{this.lastNode=this.lastOffset=void 0},this.onSelectionChange=e=>{var t;const{input:i}=this;if(!i)return void this.setSelectionClassName(document.getSelection());let s=this.getCaretPosN();for(;;){const{node:e,offset:n,selection:a,move:o}=s;if((null==e?void 0:e.nodeValue)!==r.Z||!this.lastNode)break;const d=h(e,n,this.lastNode,this.lastOffset)<0;void 0!==d&&(a.isCollapsed?this.superMove(i,s,d,!0):a.modify(a.isCollapsed?"move":"extend",d?"backward":"forward","character")),this.log("selectionchange",e,n,this.lastNode,this.lastOffset,e===this.lastNode,(0,c.Z)(this.getFiller(e)),(0,c.Z)(this.getFiller(this.lastNode)),d,a,document.getSelection(),document.getSelection().getRangeAt(0),null==e?void 0:e.parentNode,null===(t=this.lastNode)||void 0===t?void 0:t.parentNode),s=this.getCaretPosN(),this.lastNode=e,this.lastOffset=n;break}this.lastNode=this.lastOffset=void 0,this.setSelectionClassName(s.selection,i)},this.onBeforeInput=e=>{var t;const{input:i,log:s}=this;if(!i)return;const n=this.addInputCallback.bind(this,i),a=this.getCaretPosN();let{node:o,offset:d,selection:l,move:c}=a;if(s("beforeinput",e,o,d,l,a),this.lastNode=this.lastOffset=void 0,e.inputType.startsWith("delete")){if(n((()=>{this.processEmptiedFillers(i),this.removeExtraBOMs(i),this.fixInsertedLineBreaks(i)})),(null==o?void 0:o.nodeValue)===r.Z&&l.isCollapsed&&e.inputType.includes("deleteContent")){const t=e.inputType.includes("Backward"),s=d===r.Z.length&&t||!d&&!t;this.superMove(i,a,t,s)}}else{if(e.inputType.startsWith("insert")){if(null===(t=null==o?void 0:o.classList)||void 0===t?void 0:t.contains("input-something")){o=o.previousSibling.firstChild;const e=l.getRangeAt(0);e.setStart(o,0),e.setEnd(o,0),e.collapse(!0);const t=this.getCaretPosN();o=t.node,l=t.selection,d=t.offset}if(o&&o.textContent===r.Z&&d===r.Z.length){l.modify("move","backward","character");const e=this.getCaretPosN();o=e.node,l=e.selection,d=e.offset}e.inputType;{o&&o.nodeType===o.ELEMENT_NODE&&(o=o.firstChild,s.warn("fixing focus on span"));const t=(null==o?void 0:o.nodeValue)===r.Z;if(s("inserting line break",t,o,`"${null==o?void 0:o.nodeValue}"`,(null==o?void 0:o.parentElement)?Array.from(o.parentElement.childNodes).slice():[]),t){const e=o.parentElement;e.classList.replace("input-filler","input-filler-text"),e.childNodes.length,n((()=>{e.childNodes.length>1?(s("inserting line break, remove"),o=Array.from(e.childNodes).find((e=>e.nodeValue===r.Z)),e.t=o):o.nodeValue!==r.Z&&(s("inserting line break, deleteData"),o.deleteData(o.nodeValue.indexOf(r.Z),r.Z.length)),this.fixInsertedLineBreaks(i)}))}else"insertLineBreak"===e.inputType&&n((()=>{this.fixInsertedLineBreaks(i)}))}return}"historyUndo"===e.inputType?n((()=>{this.processFilledFillers(i),this.processEmptiedFillers(i),this.removeExtraBOMs(i),this.removeEmptyTextNodes(i),this.fixBuggedCaret()})):"historyRedo"===e.inputType&&n((()=>{this.processFilledFillers(i),this.processEmptiedFillers(i),i.querySelectorAll(".input-something:not([contenteditable])").forEach((e=>{e.contentEditable="false"})),this.removeExtraBOMs(i),this.fixBuggedCaret()}))}},this.onKeyDown=e=>{var t;const i=e.key;if("ArrowDown"===i||"ArrowUp"===i)this.lastNode=this.lastOffset=void 0;else{const{node:e,offset:t}=this.getCaretPosN();this.lastNode=e,this.lastOffset=t,this.lastNode===this.input&&(this.lastNode=this.lastOffset=void 0)}this.log("keydown",this.lastNode,null===(t=this.lastNode)||void 0===t?void 0:t.parentNode,this.lastOffset,this.getCaretPosN(),e)},this.log=(0,n.kg)("RICH-INPUT"),this.listenerSetter=new o.Z,this.savedRanges=new WeakMap,this.listenerSetter.add(document)("selectionchange",this.saveSelectionOnChange),m&&(this.listenerSetter.add(document)("focusout",this.onFocusOut),this.listenerSetter.add(document)("selectionchange",this.onSelectionChange),this.listenerSetter.add(document)("beforeinput",this.onBeforeInput),this.listenerSetter.add(document)("keydown",this.onKeyDown,{capture:!0}),s.IS_FIREFOX&&(this.inputCaptureCallbacks=[],this.listenerSetter.add(document)("input",(()=>{this.inputCaptureCallbacks.forEach((e=>e())),this.inputCaptureCallbacks.length=0}),{capture:!0})))}get input(){const e=document.getSelection(),{anchorNode:t}=e;if(t)return(t.closest?t:t.parentElement).closest('[contenteditable="true"]')}saveRangeForElement(e){e&&(e.isContentEditable||"INPUT"===e.tagName)&&document.getSelection().rangeCount&&this.savedRanges.set(e,document.getSelection().getRangeAt(0))}findPreviousSmthIndex(e,t,i){const s=Array.from(null!=i?i:e.querySelectorAll(".input-something")),n=s.findIndex((e=>h(e,0,t,0)>=0));return-1===n?s.length-1:Math.max(0,n-1)}superMove(e,t,i,s){var n,a;const{node:o,offset:d,move:l}=t,c=e.querySelectorAll(".input-something"),h=this.findPreviousSmthIndex(e,o,c),u=document.createRange();u[i?"setEnd":"setStart"](o,d),s&&l(i);const p=this.getCaretPosN();if((null===(n=p.node)||void 0===n?void 0:n.nodeValue)===r.Z&&(!s||o===this.lastNode)){const t=this.findPreviousSmthIndex(e,p.node,c);let n=!s;for(;;){const s=this.getCaretPosN(),d=this.findPreviousSmthIndex(e,s.node,c);u[i?"setStart":"setEnd"](s.node,s.offset);const p=u.toString(),m=!f.test(p);if(this.log("test cursor",p,m,t,d),!m||(null===(a=s.node)||void 0===a?void 0:a.nodeValue)!==r.Z||d!==t||!d&&!s.offset||!(d{e.classList.add("br-not-br")}))}fixBuggedCaret(){const e=document.getSelection(),t=e.getRangeAt(0);e.removeAllRanges(),e.addRange(t)}addInputCallback(e,t,i=!0){const n=()=>{this.log("input modify callback"),t()};i&&s.IS_FIREFOX?this.inputCaptureCallbacks.push(n):this.listenerSetter.add(e)("input",n,{once:!0,capture:i})}removeExtraBOMs(e){const t=e=>{var t;return null===(t=null==e?void 0:e.classList)||void 0===t?void 0:t.contains("input-something")};e.querySelectorAll(".input-filler").forEach((e=>{var i;const{previousSibling:s,nextSibling:n}=e;let o=!1;!(null===(i=null==n?void 0:n.classList)||void 0===i?void 0:i.contains("input-filler"))&&(0,a.Hc)(n)&&(o=t(s)||t(n)),o||(this.log.warn("removing empty bom node",e),e.remove())}))}getFiller(e){return e&&e.nodeType===e.TEXT_NODE&&e.parentElement!==this.input?e.parentElement:e}getCaretPosN(){const e=(0,u.Z)(this.input);return Object.assign(Object.assign({},e),{move:this.move.bind(this,e.selection)})}removeEmptyTextNodes(e){const{log:t}=this,i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:t=>t.parentElement!==e||t.nodeValue?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let s;for(;s=i.nextNode();)t.warn("removing empty text node",s),s.remove()}removePossibleBOMSiblings(e,t){[e,t].forEach((e=>{var t;(null===(t=null==e?void 0:e.classList)||void 0===t?void 0:t.contains("input-filler"))&&e.remove()}))}removePossibleBOMSiblingsByNode(e){const{previousSibling:t,nextSibling:i}=e;this.removePossibleBOMSiblings(t,i)}processEmptiedFillers(e){e.querySelectorAll(".input-filler-text").forEach((e=>{var t;this.removeExtraBOMs(e);let i=!0;if(e.textContent)f.test(e.textContent)||e.querySelector(".input-something")?i=!1:e.classList.replace("input-filler-text","input-filler");else{e.classList.replace("input-filler-text","input-filler");const i=Array.from(e.childNodes).find((e=>e.nodeType===e.TEXT_NODE));i?i.insertData(0,r.Z):(null===(t=e.t)||void 0===t?void 0:t.nodeValue)?e.append(e.t):e.append(document.createTextNode(r.Z))}i&&this.removePossibleBOMSiblingsByNode(e)}))}processFilledFillers(e){e.querySelectorAll(".input-filler").forEach((e=>{if(e.textContent!==r.Z){e.classList.replace("input-filler","input-filler-text");const t=e.t,i=Array.from(e.childNodes).find((e=>e.nodeType===e.TEXT_NODE&&e.nodeValue.includes(r.Z)));if(i&&!(null==t?void 0:t.nodeValue)){const e=i.nodeValue.indexOf(r.Z);-1!==e&&i.deleteData(e,r.Z.length)}}}))}setSelectionClassName(e,t){if(e.rangeCount){const i=e.getRangeAt(0);t?Array.from(t.querySelectorAll(".input-selectable")).forEach((e=>{e.classList.toggle("selection",!i.collapsed&&i.intersectsNode(e))})):Array.from(document.querySelectorAll(".input-selectable.selection")).forEach((e=>e.classList.remove("selection")))}}move(e,t){const{focusNode:i,focusOffset:s}=e;e.modify("extend",t?"backward":"forward","character"),t?e.collapseToStart():e.collapseToEnd();const{focusNode:n,focusOffset:a}=e;this.log("moving cursor",t,i,i.nodeType===i.ELEMENT_NODE?i:i.parentElement,s,n,n.nodeType===n.ELEMENT_NODE?n:n.parentElement,a)}prepareApplyingMarkdown(){const{input:e}=this,t=e.querySelectorAll(".input-filler"),i=e.querySelectorAll(".input-something");return i.forEach((e=>{e.contentEditable="inherit"})),()=>{t.forEach((e=>{e.contentEditable="inherit"})),i.forEach((e=>{e.contentEditable="false"})),this.removeExtraBOMs(e)}}static getInstance(){var e;return null!==(e=this.INSTANCE)&&void 0!==e?e:this.INSTANCE=new g}}},8928:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(5994);function n(e){if(!s.Z.isAvailable("animations"))return;const t=[{transform:"translateX(0)"},{transform:"translateX(.25rem)"},{transform:"translateX(-.25rem)"},{transform:"translateX(0)"}];e.animate([...t,...t,...t],{duration:300,iterations:1,easing:"ease-in-out"})}},2914:(e,t,i)=>{"use strict";i.d(t,{Z:()=>f});var s=i(3757),n=i(5432),a=i(5994),o=i(3228),r=i(5953),d=i(5418),l=i(3910),c=i(2738),h=i(5975),u=i(4484),p=i(2648);class f{constructor(e){this.onSwipe=(e,t)=>{t=(0,o.Z)(t,this.minY,this.maxY),this.element.style.transform=`translateY(${t}px)`;const i=Math.round(Math.abs(t)/this.elementRect.height),s=this.siblings;this.siblings=[];const n=t<0?"previousElementSibling":"nextElementSibling";let a=this.element[n];for(let e=0;e{this.siblings.includes(e)||(e.style.transform="")})),this.siblings.forEach((e=>{const i=this.elementRect.height*(t<0?1:-1);e.style.transform=`translateY(${i}px)`})),this.scrollableRect){const e=t,i=e>0,s=(i?this.elementRect.bottom:this.elementRect.top)+e-this.addScrollPos;let n=2;s+(i?0:this.elementRect.height)>=this.scrollableRect.bottom||(s-(i?this.elementRect.height:0)<=this.scrollableRect.top?n*=-1:n=void 0),void 0!==n&&(this.scrollable.container[this.scrollable.scrollProperty]+=n)}},this.verifyTouchTarget=e=>!this.list.classList.contains("is-reordering")&&(this.element=this.getSortableTarget(e.target),!!this.element),this.onScroll=()=>{const e=this.scrollable.container[this.scrollable.scrollProperty],t=this.addScrollPos=e-this.startScrollPos,i="scrollTop"===this.scrollable.scrollProperty;this.swipeHandler.add(i?0:t,i?t:0)},this.onStart=()=>{this.list.classList.add("is-reordering"),this.element.classList.add("is-dragging","no-transition"),this.swipeHandler.setCursor("grabbing"),this.elementRect=this.element.getBoundingClientRect(),this.containerRect=this.list.getBoundingClientRect(),this.minY=this.containerRect.top-this.elementRect.top,this.maxY=this.containerRect.bottom-this.elementRect.bottom,this.addScrollPos=0,this.scrollable&&(this.startScrollPos=this.scrollable.container[this.scrollable.scrollProperty],this.scrollableRect=this.scrollable.container.getBoundingClientRect(),this.scrollable.container.addEventListener("scroll",this.onScroll))},this.onReset=()=>{return e=this,t=void 0,s=function*(){const e=this.siblings.length,t=e&&e*(this.siblings[0].previousElementSibling===this.element?1:-1),i=(0,p.Z)(this.element),s=i+t;this.element.classList.remove("no-transition"),this.element.style.transform=t?`translateY(${t*this.elementRect.height}px)`:"",this.swipeHandler.setCursor(""),this.scrollable&&this.scrollable.container.removeEventListener("scroll",this.onScroll),n.Z||(0,c.fc)(document.body,l.Z,{capture:!0,once:!0}),a.Z.isAvailable("animations")&&(yield(0,d.Z)(250)),this.list.classList.remove("is-reordering"),this.element.classList.remove("is-dragging"),(0,u.Z)(this.element,this.list,s,i),[this.element,...this.siblings].forEach((e=>{e.style.transform=""})),this.element=this.siblings=this.elementRect=this.containerRect=this.minY=this.maxY=this.startScrollPos=this.addScrollPos=void 0,t&&this.onSort(i,s)},new((i=void 0)||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}));var e,t,i,s},(0,r.Z)(this,e),this.swipeHandler=new s.Z({element:this.list,onSwipe:this.onSwipe,verifyTouchTarget:this.verifyTouchTarget,onStart:this.onStart,onReset:this.onReset,setCursorTo:document.body,middleware:this.middleware,withDelay:!0})}getSortableTarget(e){if(!e)return;let t=(0,h.Z)(e,this.list);return t&&t.classList.contains("cant-sort")&&(t=void 0),t}}},1656:(e,t,i)=>{"use strict";function s(e,t){return t?e.forEach((e=>e.setAttribute("disabled","true"))):e.forEach((e=>e.removeAttribute("disabled"))),()=>s(e,!t)}i.d(t,{Z:()=>s})},2648:(e,t,i)=>{"use strict";function s(e,t){if(!e.parentNode)return-1;if(t)return Array.from(e.parentNode.childNodes).indexOf(e);let i=0;for(;null!==(e=e.previousElementSibling);)++i;return i}i.d(t,{Z:()=>s})},6339:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(2738),n=i(5975),a=i(3241),o=i(5432),r=i(5953),d=i(5824),l=i(8497),c=i(5994);class h extends a.Z{constructor(e){super(!1),this.onClickOut=e=>{const t=e.target;(0,n.Z)(t,this.element)||Array.from(this.ignoreButtons).some((e=>(0,n.Z)(t,e)||t===e))||!(this.ignoreMouseOut.size<=1)||this.ignoreOutClickClassName&&(0,l.Z)(t,this.ignoreOutClickClassName)||this.toggle(!1)},this.onMouseOut=e=>{if(!this.isActive())return;if(this.clearTimeout("toggle"),this.ignoreMouseOut.size)return;const t=e.toElement;t&&(0,n.Z)(t,this.element)||this.setTimeout("toggle",(()=>{this.toggle(!1)}),200)},this.toggle=e=>{return t=this,i=void 0,n=function*(){var t;const i=!!this.element.style.display&&void 0===e||e;if(this.init){if(!i)return;this.init(),this.init=null}if(i===this.isActive())return;const s=o.Z||!c.Z.isAvailable("animations")?0:200;if(this.element.style.display&&void 0===e||e){const e=this.dispatchResultableEvent("open");yield Promise.all(e),this.element.style.display="",this.element.offsetLeft,this.element.classList.add("active"),this.dispatchEvent("openAfterLayout"),d.Z.pushItem(this.navigationItem={type:"dropdown",onPop:()=>{this.toggle(!1)}}),this.clearTimeout("toggle"),this.setTimeout("done",(()=>{this.forceClose=!1,this.dispatchEvent("opened")}),s)}else this.dispatchEvent("close"),this.ignoreMouseOut.clear(),this.ignoreButtons.clear(),this.element.classList.remove("active"),d.Z.removeItem(this.navigationItem),null===(t=this.detachClickEvent)||void 0===t||t.call(this),this.detachClickEvent=void 0,this.clearTimeout("toggle"),this.setTimeout("done",(()=>{this.element.style.display="none",this.forceClose=!1,this.dispatchEvent("closed")}),s)},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n},(0,r.Z)(this,e),this.forceClose=!1,this.inited=!1,this.ignoreMouseOut=new Set,this.ignoreButtons=new Set,this.timeouts={}}attachButtonListener(e,t){let i=!0;o.Z?(0,s.fc)(e,(()=>{i?(i=!1,this.toggle(!0)):this.toggle()}),{listenerSetter:t}):(t.add(e)("mouseover",(s=>{i&&(t.add(e)("mouseout",(e=>{this.clearTimeout("toggle"),this.onMouseOut(e)})),i=!1),this.setTimeout("toggle",(()=>{this.toggle(!0)}),200)})),(0,s.fc)(e,(()=>{const t="click",i=!this.ignoreMouseOut.has(t);i&&!this.ignoreMouseOut.size&&(this.ignoreButtons.add(e),setTimeout((()=>{this.detachClickEvent=(0,s.fc)(window,this.onClickOut,{capture:!0})}),0)),this.setIgnoreMouseOut(t,i),this.toggle(i)}),{listenerSetter:t}))}clearTimeout(e){void 0!==this.timeouts[e]&&(clearTimeout(this.timeouts[e]),delete this.timeouts[e])}setTimeout(e,t,i){this.clearTimeout(e),this.timeouts[e]=window.setTimeout((()=>{this.clearTimeout(e),t()}),i)}init(){o.Z||(this.element.onmouseout=this.onMouseOut,this.element.onmouseover=e=>{this.forceClose||this.clearTimeout("toggle")})}isActive(){return this.element.classList.contains("active")}setIgnoreMouseOut(e,t){t?this.ignoreMouseOut.add(e):this.ignoreMouseOut.delete(e)}}},4789:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l,f:()=>s});var s,n=i(8594),a=i(3035),o=i(5296),r=i(8487),d=i(5994);function l(e){var t,i,o;if(null!==(t=e.margin)&&void 0!==t||(e.margin=0),null!==(i=e.maxDistance)&&void 0!==i||(e.maxDistance=1500),null!==(o=e.axis)&&void 0!==o||(e.axis="y"),d.Z.isAvailable("animations")&&0!==e.forceDuration||(e.forceDirection=s.Static),e.forceDirection===s.Static)return e.forceDuration=0,c(e);const r=(0,a.AD)().then((()=>c(e)));return"y"===e.axis?(0,n.YW)(r):r}function c(e){const{element:t,container:i,getNormalSize:s,getElementPosition:n,transitionFunction:a,axis:d,margin:l,position:p,forceDirection:f,maxDistance:m,forceDuration:g}=e;if(!(0,r.Z)(t))return(0,o.Kx)(i),Promise.resolve();const v="y"===d?"top":"left",b="y"===d?"bottom":"right",y="y"===d?"height":"width",w="y"===d?"scrollHeight":"scrollWidth",S="y"===d?"scrollHeight":"offsetWidth",C="y"===d?"scrollTop":"scrollLeft",L=t.getBoundingClientRect(),I=i.getBoundingClientRect?i.getBoundingClientRect():document.body.getBoundingClientRect(),E=L[v]-I[v],P=n?n({elementRect:L,containerRect:I,elementPosition:E}):E,Z=t[S],M=s?s({rect:I}):I[y];let T=i[C];const k=i[w];let x;switch(p){case"start":x=P-l;break;case"end":x=L[b]-I[b]+l;break;case"nearest":case"center":if(Zm?(T=i.scrollTop+=x-m,x=m):x<-m&&(T=i.scrollTop+=x+m,x=-m)),x<0){const e=-T;x=Math.max(x,e)}else if(x>0){const e=k-(T+M);x=Math.min(x,e)}const A=i[C]+x,_=Math.abs(x),F=null!=g?g:250+_/1500*350,D=Date.now(),R=null!=a?a:_<500?u:h,B=()=>F?Math.min((Date.now()-D)/F,1):1,N=()=>{const e=B(),t=R(e),s=x*(1-t);return i[C]=Math.round(A-s),e<1};if(!F||!x)return(0,o.Kx)(i),N(),Promise.resolve();if(e.startCallback){const t=k-Math.round(A+i["y"===d?"offsetHeight":"offsetWidth"]);e.startCallback({scrollSize:k,scrollPosition:T,distanceToEnd:t,path:x,duration:F,containerRect:I,elementRect:L,getProgress:B})}return(0,o.cK)(N,i)}function h(e){return 1-Math.pow(1-e,5)}function u(e){return 1-Math.pow(1-e,3.5)}!function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Static=2]="Static"}(s||(s={}))},8801:(e,t,i)=>{"use strict";i.d(t,{P:()=>n});const s="_";function n(e,t){const i=""["".length-1]||"";let n;switch(e._){case"inputPhotoFileLocation":n=["photo",""[0],e.id,e.thumb_size].filter(Boolean).join(s);break;case"inputDocumentFileLocation":n=["document",""[0],e.id,e.thumb_size].filter(Boolean).join(s);break;case"inputPeerPhotoFileLocation":n=["peerPhoto",e.photo_id,e.pFlags.big?"big":"small"].join(s);break;case"inputStickerSetThumb":n=["stickerSetThumb",e.stickerset.id||e.stickerset.short_name||e.stickerset.emoticon||e.stickerset._,e.thumb_version].join(s);break;case"inputFileLocation":n=[e.volume_id,e.local_id].join(s);break;case"inputWebFileLocation":n=["webFile",e.url].join(s);break;default:console.error("Unrecognized location:",e),n=""}return n+((null==t?void 0:t.downloadId)?"_download":"")+(i?"."+i:i)}},1708:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(7625);function n(e){(0,s.Z)(e.history,((t,i,s)=>{t.action.photo||(s.splice(i,1),void 0!==e.count&&--e.count)}))}},4081:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(2325);function n(e,t="auto"){if(0===e)return(0,s.ag)("FileSize.B",[0]);const i="auto"===t,n=Math.floor(Math.log(e)/Math.log(1024)),a="auto"===t?Math.max(0,n-1):t,o=Math.max(0,a),r=(e/Math.pow(1024,n)).toFixed(o);return(0,s.ag)(["FileSize.B","FileSize.KB","FileSize.MB","FileSize.GB"][n],[i?r:parseFloat(r)])}},8939:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(2325);const n={s:"Seconds",m:"Minutes",h:"Hours",d:"Days",w:"Weeks",mm:"Months",y:"Years"};function a(e,t){const i=function(e,t=2){e||(e=1);const i=[],s=[{m:1,t:"s"},{m:60,t:"m"},{m:60,t:"h"},{m:24,t:"d"},{m:7,t:"w"}];let n=1;s.forEach(((t,a)=>{if(n=Math.round(n*t.m),e=0;--e)0===a[e].duration&&a.splice(e,1);return a}(e,2);if(t){const e=i.map((e=>s.ZP.format(n[e.type],!0,[e.duration])));return(0,s.v_)(e,!1,t)}const a=i.map((e=>(0,s.ag)(n[e.type],[e.duration]))),o=document.createElement("span");return o.append(...(0,s.v_)(a,!1)),o}},6272:(e,t,i)=>{"use strict";i.d(t,{u:()=>r});var s=i(2325);const n=new Map;let a=0;const o=(e,t,i="")=>{i=t.country_code+i,a=Math.max(a,i.length),n.set(i,{country:e,code:t})};function r(e){e=e||"",n.size||s.ZP.countriesList.forEach((e=>{e.country_codes.forEach((t=>{t.prefixes?t.prefixes.forEach((i=>{o(e,t,i)})):o(e,t)}))}));let t=e.replace(/\D/g,"");const i=t.slice(0,a);let r;for(let e=i.length-1;e>=0&&(r=n.get(i.slice(0,e+1)),!r);--e);if(!r)return{formatted:t,country:void 0,code:void 0,leftPattern:""};const d=r.country,l=r.code.patterns||[],c=t.slice(r.code.country_code.length);let h="",u=0,p="";for(let e=l.length-1;e>=0;--e){h=l[e];const t=h.replace(/ /g,"");let i=0;for(let e=0,s=Math.min(c.length,t.length);eu&&(u=i,p=h)}h=p||h,h=h.replace(/\d/g,"X"),h=r.code.country_code+" "+h,h.split("").forEach(((e,i)=>{" "===e&&" "!==t[i]&&t.length>i&&(t=t.slice(0,i)+" "+t.slice(i))}));let f=h&&h.length>t.length?h.slice(t.length):"";return f&&(f=f.replace(/X/g,"‒")),{formatted:t,country:d,code:r.code,leftPattern:f}}},645:(e,t,i)=>{"use strict";i.d(t,{M:()=>s,Z:()=>n});class s{constructor(){this.cache=new Map}static createCache(){const e={frames:new Map,framesNew:new Map,framesURLs:new Map,clearCache:()=>{e.framesNew.forEach((e=>{var t,i;null===(i=(t=e).close)||void 0===i||i.call(t)})),e.frames.clear(),e.framesNew.clear(),e.framesURLs.clear()},counter:0};return e}getCache(e){let t=this.cache.get(e);return t||this.cache.set(e,t=s.createCache()),++t.counter,t}releaseCache(e){const t=this.cache.get(e);t&&!--t.counter&&this.cache.delete(e)}getCacheCounter(e){const t=this.cache.get(e);return null==t?void 0:t.counter}generateName(e,t,i,s,n){return[e,t,i,s?"colored":"",n||""].filter(Boolean).join("-")}}const n=new s},9171:(e,t,i)=>{"use strict";function s(e,t,i,s,n,a,o){return[e,",",t," ",i," ",s,",",n," ",a,",",o].join("")}function n(e,t,i,n,a,o,r,d){const l=[];return l.push("M"+(e+i/2)+","+t),l.push("H"+(e+i-o)),o>0&&l.push("A"+s(o,o,0,0,1,e+i,t+o)),l.push("V"+(t+n-r)),r>0&&l.push("A"+s(r,r,0,0,1,e+i-r,t+n)),l.push("H"+(e+d)),d>0&&l.push("A"+s(d,d,0,0,1,e+0,t+n-d)),l.push("V"+(t+a)),a>0&&l.push("A"+s(a,a,0,0,1,e+a,t+0)),l.push("Z"),l.join(" ")}i.d(t,{Z:()=>n}),i(410).GO.generatePathData=n},1046:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(6740),n=i(1185),a=i(6705);function o(e,t,i){const o=(0,n.Z)(e,t,!1);let r,d;if(i){const e=(0,a.Z)(o);r=e.canvas,d=e.promise}else r=new Image,d=(0,s.cj)(r,o);return r.classList.add("thumbnail"),{image:r,loadPromise:d}}},1185:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(4059);function n(e,t,i=!1){return(0,s.Z)(t.bytes,i)}},8580:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(1507),n=i(1046);function a(e,t,i,a=!1){const o=["video","gif"].includes(e.type);if(!t.downloaded||o||a){if("document"===e._&&t.downloaded&&!a&&(!o||t.type!==s.Pt))return null;const r=e.sizes||e.thumbs,d=(null==r?void 0:r.length)?r.find((e=>"photoStrippedSize"===e._)):null;if(d&&"bytes"in d)return(0,n.Z)(e,d,i)}return null}},6074:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(7625),n=i(5953);class a{constructor(e){this.previous=[],this.next=[],this.reverse=!1,this.loadCount=50,this.loadWhenLeft=20,this.loadedAllUp=!1,this.loadedAllDown=!1,(0,n.Z)(this,e)}setTargets(e,t,i){this.previous=e,this.next=t,this.reverse=i}get index(){return void 0!==this.count?this.previous.length:-1}reset(e=!1){this.current=void 0,this.previous=[],this.next=[],this.setLoaded(!0,e),this.setLoaded(!1,e)}go(e,t=!0){let i,s;if(e>0){if(i=this.next.splice(0,e),s=i.pop(),!s)return;void 0!==this.current&&i.unshift(this.current),this.previous.push(...i)}else{if(i=this.previous.splice(Math.max(0,this.previous.length+e),-e),s=i.shift(),!s)return;void 0!==this.current&&i.push(this.current),this.next.unshift(...i)}return this.next.length0),this.current}unsetCurrent(e){e?this.previous.push(this.current):this.next.unshift(this.current),this.current=void 0}goUnsafe(e,t){const i=e>0?Math.max(0,e-this.next.length):Math.min(0,e+this.previous.length),s=this.go(e,!i&&t);return{item:i?void 0:s,leftLength:i}}setLoaded(e,t){return(e?this.loadedAllDown:this.loadedAllUp)!==t&&(e?this.loadedAllDown=t:this.loadedAllUp=t,t||(e?this.loadPromiseDown=null:this.loadPromiseUp=null),!0)}load(e){if(e?this.loadedAllDown:this.loadedAllUp)return Promise.resolve();let t,i=e?this.loadPromiseDown:this.loadPromiseUp;return i||(t=e?this.reverse?this.previous[0]:this.next[this.next.length-1]:this.reverse?this.next[this.next.length-1]:this.previous[0],null!=t||(t=this.current),i=this.loadMore(t,e,this.loadCount).then((t=>{return n=this,a=void 0,r=function*(){if((e?this.loadPromiseDown:this.loadPromiseUp)!==i)return;t.items.length{const t=this.processItem?this.processItem(e):e;t&&n.push(t)}));const a=yield Promise.all(n);e?this.reverse?this.previous.unshift(...a):this.next.push(...a):this.reverse?this.next.push(...a):this.previous.unshift(...a),this.onLoadedMore&&this.onLoadedMore()},new((o=void 0)||(o=Promise))((function(e,t){function i(e){try{d(r.next(e))}catch(e){t(e)}}function s(e){try{d(r.throw(e))}catch(e){t(e)}}function d(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(i,s)}d((r=r.apply(n,a||[])).next())}));var n,a,o,r}),(()=>{})).then((()=>{e?this.loadPromiseDown=null:this.loadPromiseUp=null})),e?this.loadPromiseDown=i:this.loadPromiseUp=i,i)}}},3699:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});class s{constructor(){this.listeners=new Set}add(e){return(t,i,s)=>{const n={element:e,event:t,callback:i,options:s};return this.addManual(n),n}}addManual(e){var t;e.element.addEventListener(e.event,e.callback,e.options),(null===(t=e.options)||void 0===t?void 0:t.once)&&(e.onceCallback=()=>{this.remove(e),e.onceFired=!0},e.element.addEventListener(e.event,e.onceCallback,e.options)),this.listeners.add(e)}remove(e){e.onceFired||(e.element.removeEventListener(e.event,e.callback,e.options),e.onceCallback&&e.element.removeEventListener(e.event,e.onceCallback,e.options)),this.listeners.delete(e)}removeManual(e,t,i,s){let n;for(const a of this.listeners)if(a.element===e&&a.event===t&&a.callback===i&&a.options===s){n=a;break}n&&this.remove(n)}removeAll(){this.listeners.forEach((e=>{this.remove(e)}))}}},5994:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(410),n=i(3512);const a=new class{isEnabled(){return n.Z.settings.liteMode.all}isAvailable(e){return!n.Z.settings.liteMode.all&&!n.Z.settings.liteMode[e]}};s.GO&&(s.GO.liteMode=a);const o=a},9405:(e,t,i)=>{"use strict";i.d(t,{C:()=>a,c:()=>n});var s=i(9897);class n{constructor(e=0,t=e){this.width=e,this.height=t}aspect(e,t){return(0,s.Z)(this.width,this.height,e.width,e.height,t)}aspectFitted(e){return this.aspect(e,!0)}aspectCovered(e){return this.aspect(e,!1)}}function a(e,t){return new n(e,t)}},4755:(e,t,i)=>{"use strict";i.d(t,{Z:()=>u,_:()=>s});var s,n=i(410),a=i(3241),o=i(9405);!function(e){e[e.mobile=0]="mobile",e[e.medium=1]="medium",e[e.large=2]="large"}(s||(s={}));const r=(0,o.C)(20,20),d=(0,o.C)(36,36),l=(0,o.C)(18,18);class c extends a.Z{constructor(){super(),this.screenSizes=[{key:s.mobile,value:600},{key:s.medium,value:1275},{key:s.large,value:1680}],this.sizes={handhelds:{regular:(0,o.C)(270,270),webpage:(0,o.C)(270,200),album:(0,o.C)(270,0),esgSticker:(0,o.C)(68,68),animatedSticker:(0,o.C)(180,180),staticSticker:(0,o.C)(180,180),emojiSticker:(0,o.C)(112,112),poll:(0,o.C)(240,0),round:(0,o.C)(200,200),documentName:(0,o.C)(200,0),invoice:(0,o.C)(270,270),extendedInvoice:(0,o.C)(270,270),customEmoji:r,esgCustomEmoji:d,emojiStatus:l,popupSticker:(0,o.C)(68,68)},desktop:{regular:(0,o.C)(420,340),webpage:(0,o.C)(420,340),album:(0,o.C)(420,0),esgSticker:(0,o.C)(72,72),animatedSticker:(0,o.C)(200,200),staticSticker:(0,o.C)(200,200),emojiSticker:(0,o.C)(112,112),poll:(0,o.C)(330,0),round:(0,o.C)(280,280),documentName:(0,o.C)(240,0),invoice:(0,o.C)(320,320),extendedInvoice:(0,o.C)(420,340),customEmoji:r,esgCustomEmoji:d,emojiStatus:l,popupSticker:(0,o.C)(80,80)}},this.isMobile=!1,this.handleResize=()=>{const e=window.innerWidth;let t=this.screenSizes[0].key;for(let i=this.screenSizes.length-1;i>=0;--i)if(this.screenSizes[i].value{this.rAF&&window.cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame((()=>{this.handleResize(),this.rAF=0}))})),this.handleResize()}}const h=new c;n.GO.mediaSizes=h;const u=h},8631:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});const s=(0,i(5471).Z)("MIDDLEWARE");function n(e,t=s){return i=>{if(!(i instanceof Promise)){if(i instanceof Error)throw i;return i}return i.then((i=>{if(!e())throw t;return i}))}}},2559:(e,t,i)=>{"use strict";function s(e,t=2){if(0===e)return"0";const i=t<0?0:t,s=Math.floor(Math.log(e)/Math.log(1e3));return parseFloat((e/Math.pow(1e3,s)).toFixed(i))+["","K","M","B","T"][s]}i.d(t,{Z:()=>s})},2575:(e,t,i)=>{"use strict";function s(e,t=" "){const i=e.toString().split(".");return i[0]=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,t),i.join(".")}i.d(t,{Z:()=>s})},925:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(4762);function n(e,t=e.HAVE_METADATA,i){return new Promise(((n,a)=>{if(e.readyState>=t)return void n();const o=s.IS_APPLE_MOBILE&&!i?"loadeddata":"canplay",r="error",d=()=>{e.removeEventListener(r,l),n()},l=t=>{e.removeEventListener(o,d),a(e.error)};e.addEventListener(o,d,{once:!0}),e.addEventListener(r,l,{once:!0})}))}},2296:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var s=i(5824),n=i(5432),a=i(4762),o=i(3910),r=i(2738),d=i(5975),l=i(3241);class c extends l.Z{constructor(e,t){super(!1),this.navigationType=e,this.withOverlay=t,this.onClick=e=>{var t;(0,r.Cf)(e)||this.element&&(0,d.Z)(e.target,this.element)||((null===(t=this.listenerOptions)||void 0===t?void 0:t.capture)&&(0,o.Z)(e),this.close())},this.listenerOptions=t?{}:{capture:!0}}close(){var e;this.element&&(null===(e=this.overlay)||void 0===e||e.remove(),this.element=void 0,this.dispatchEvent("toggle",!1)),n.Z||window.removeEventListener("contextmenu",this.onClick,this.listenerOptions),document.removeEventListener(r.pf,this.onClick,this.listenerOptions),a.IS_MOBILE_SAFARI||s.Z.removeByType(this.navigationType)}open(e){this.close(),a.IS_MOBILE_SAFARI||s.Z.pushItem({type:this.navigationType,onPop:e=>{this.close()}}),this.element=e,!this.overlay&&this.withOverlay&&(this.overlay=document.createElement("div"),this.overlay.classList.add("btn-menu-overlay"),this.overlay.addEventListener(r.pf,(e=>{(0,o.Z)(e),this.onClick(e)}))),this.overlay&&this.element.parentElement.insertBefore(this.overlay,this.element),n.Z||window.addEventListener("contextmenu",this.onClick,Object.assign(Object.assign({},this.listenerOptions),{once:!0})),document.addEventListener(r.pf,this.onClick,this.listenerOptions),this.dispatchEvent("toggle",!0)}}},5180:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(7445);function n(e,t,i,n){const a=(e=+e)<0,o=s.Z[t];if(!o)throw new Error("CURRENCY_WRAP_INVALID");const r=e/Math.pow(10,o.exp);let d=o.exp;"IRR"==t&&Math.floor(r)==r&&(d=0);let l=function(e,t,i,s){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var n=isFinite(+e)?+e:0,a=isFinite(+t)?Math.abs(t):0,o=void 0===s?",":s,r=void 0===i?".":i,d="";return(d=(a?function(e,t){var i=Math.pow(10,t);return""+Math.round(e*i)/i}(n,a):""+Math.round(n)).split("."))[0].length>3&&(d[0]=d[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(d[1]||"").length{"use strict";i.d(t,{Z:()=>n});var s=i(4755);function n(e,t,i,n){e.touches&&(e=e.touches[0]);const{pageX:a,pageY:o}=e,r=Array.from(t.children).find((e=>e.classList.contains("btn-menu-item")&&!e.classList.contains("hide")))||t;let{scrollWidth:d}=r;const{scrollHeight:l}=t,c=document.body.getBoundingClientRect(),h=c.width,u=c.height;d+=2*r.offsetLeft;let p=8,f=8,m=8,g=8;n&&(n.top&&n.top,n.right&&(f+=n.right),n.bottom&&(m+=n.bottom),n.left&&(g+=n.left)),i=s.Z.isMobile?"right":"left";let v="top";const b=u-l-m,y=h-d-f,w=g,S={x:{left:a,right:Math.min(y,a-d)},intermediateX:"right"===i?w:y,y:{top:o,bottom:o-l},intermediateY:b},C={left:S.x.left+d+f<=h,right:S.x.right>=g},L={top:S.y.top+l+m<=u,bottom:S.y.bottom-m>=m};{const e=C[i]?S.x[i]:(i="center",S.intermediateX);t.style.left=e+"px"}{const e=L[v]?S.y[v]:(v="center",S.intermediateY);t.style.top=e+"px"}return t.className=t.className.replace(/(top|center|bottom)-(left|center|right)/g,""),t.classList.add(("center"===v?v:"bottom")+"-"+("center"===i?i:"left"===i?"right":"left")),{width:d,height:l}}},6787:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var s=i(2312),n=i(1447),a=i(3512),o=i(671),r=i(4755),d=i(3174);function l(e,t,i){return a.Z.managers.appStickersManager.preloadAnimatedEmojiSticker(e).then((({doc:a})=>{if(a)return s.Z.downloadMedia({media:a}).then((s=>{return l=this,c=void 0,u=function*(){const l=r.Z.active.emojiSticker,c=(0,o.tB)(e),h=yield n.Z.loadAnimationWorker({container:void 0,animationData:s,width:null!=t?t:l.width,height:null!=i?i:l.height,name:"doc"+a.id,autoplay:!1,loop:!1,toneIndex:c,group:"none"});h.addEventListener("firstFrame",(()=>{(0,d.O)(a,h.canvas[0],c),h.remove()}),{once:!0})},new((h=void 0)||(h=Promise))((function(e,t){function i(e){try{n(u.next(e))}catch(e){t(e)}}function s(e){try{n(u.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof h?n:new h((function(e){e(n)}))).then(i,s)}n((u=u.apply(l,c||[])).next())}));var l,c,h,u}))}))}},677:(e,t,i)=>{"use strict";i.d(t,{RP:()=>a,X:()=>o});const s=new Set(["all","web","webk"]),n=new Set;function a(e){return e.find((e=>s.has(e.platform)&&!n.has(e.reason)))}function o(e){return!!a(e)}},3174:(e,t,i)=>{"use strict";i.d(t,{O:()=>o,k:()=>a});var s=i(3512);const n={};function a(e,t,i,s){const a=e.id+"-"+t,o=n[a];return o&&o.width>=i&&o.height>=s}function o(e,t,i){return o=this,r=void 0,l=function*(){const o=e.id+"-"+i,{width:r,height:d}=t;if(a(e,i,r,d))return;const l=n[o]={width:r,height:d},c=yield s.Z.managers.appDocsManager.getLottieCachedThumb(e.id,i);if(n[o]!==l)return;if(c&&c.w>=r&&c.h>=d)return;const h=new Promise((e=>{t.toBlob((t=>e(t)))})),u=yield h;n[o]===l&&s.Z.managers.appDocsManager.saveLottiePreview(e.id,u,r,d,i)},new((d=void 0)||(d=Promise))((function(e,t){function i(e){try{n(l.next(e))}catch(e){t(e)}}function s(e){try{n(l.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof d?n:new d((function(e){e(n)}))).then(i,s)}n((l=l.apply(o,r||[])).next())}));var o,r,d,l}},9966:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(3035);function n(e){return function(e,t){let i,s=!1;return(...n)=>{i=n,s||(s=!0,e((()=>{s=!1,t(...i)})))}}(s.T2,e)}},286:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(410),n=i(4762),a=i(8204),o=i(2359);class r{constructor(e,t,i){this.scrollable=e,this.query=t,this.reverse=i}get container(){return this.scrollable.container}getSaved(){return{scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,clientHeight:this.clientHeight}}findElements(){if(!this.query)return[];const{container:e}=this,t=e.getBoundingClientRect(),i=Array.from(e.querySelectorAll(this.query)),s=[];for(const n of i){const i=n.getBoundingClientRect();if((0,a.Z)(n,e,void 0,i,t))s.push({element:n,rect:i});else if(s.length)break}if(!s.length){const e=i[0];e&&s.push({element:e,rect:e.getBoundingClientRect()})}return s}replaceSaved(e,t){if(!this.elements)return;const i=this.elements.findIndex((({element:t})=>e===t));-1!==i&&(this.elements[i].element=t)}findAndSetElements(){this.elements=this.findElements()}save(){this.findAndSetElements(),this._save()}_save(){const{scrollTop:e,scrollHeight:t,clientHeight:i}=this.container;this.scrollHeight=t,this.scrollTop=e,this.clientHeight=i,this.scrollHeightMinusTop=this.reverse?t-e:e}onRestore(e){n.IS_SAFARI&&e&&(0,o.Z)(this.container)}setScrollTop(e,t){this.scrollable.setScrollTopSilently(this.scrollTop=e),this.onRestore(t)}restore(e){var t;const{scrollTop:i,scrollHeight:s}=this.scrollable;if(this.scrollHeight=s,!this.elements.length)return void this._restore(e);let n;if(n=this.elements[this.elements.length-1],!(null===(t=null==n?void 0:n.element)||void 0===t?void 0:t.parentElement)&&(this.findAndSetElements(),n=this.elements[this.elements.length-1],!n))return void this._restore(e);const{element:a,rect:o}=n,r=a.getBoundingClientRect().bottom-o.bottom;this.setScrollTop(i+r,e)}_restore(e){const{scrollHeightMinusTop:t,scrollable:i}=this,s=this.scrollHeight,n=this.reverse?s-t:t;this.setScrollTop(n,e)}}s.GO&&(s.GO.ScrollSaver=r)},8936:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(5953);class n{constructor(e){this.loading=!1,this.loaded=!1,(0,s.Z)(this,e),e.scrollable.onScrolledBottom=()=>{this.load()}}load(){return this.loaded?Promise.resolve():this.loading?this.promise:(this.loading=!0,void(this.promise=this.getPromise().then((e=>{this.loading=!1,this.promise=void 0,e?(this.loaded=!0,this.scrollable.onScrolledBottom=null):this.scrollable.checkForTriggers()}),(()=>{this.promise=void 0,this.loading=!1}))))}}},3719:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var s=i(3781),n=i(2790),a=i(3512),o=i(7625),r=i(1708),d=i(6074),l=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class c extends d.Z{constructor(e={}){var t;super(Object.assign(Object.assign({},e),{loadMore:(e,t,i)=>{const a=t?0:i;let o=null==e?void 0:e.mid;var d;return void 0===o&&(o=this.searchContext.maxId),t||(d=o,1,o=(0,s.Z)((0,n.Z)(d)+1)),this.managers.appMessagesManager.getSearch(Object.assign(Object.assign({},this.searchContext),{peerId:this.searchContext.peerId||(null==e?void 0:e.peerId),maxId:o,limit:a?0:i,backLimit:a})).then((e=>("inputMessagesFilterChatPhotos"===this.searchContext.inputFilter._&&(0,r.Z)(e),e.next_rate&&(this.searchContext.nextRate=e.next_rate),{count:e.count,items:e.history})))},processItem:t=>l(this,void 0,void 0,(function*(){if((yield this.filterMids([t.mid])).length)return e.processItem(t)}))})),this.onHistoryDelete=({peerId:e,msgs:t})=>{const i=i=>i.peerId===e&&t.has(i.mid),s=(e,t,s)=>{i(e)&&s.splice(t,1)};(0,o.Z)(this.previous,s),(0,o.Z)(this.next,s),this.current&&i(this.current)&&(this.current=void 0,this.onEmptied&&this.onEmptied())},this.onHistoryMultiappend=e=>l(this,void 0,void 0,(function*(){if(void 0!==this.searchContext.folderId)return;if(!this.loadedAllUp||this.loadPromiseUp)return;if(e.peerId!==this.searchContext.peerId)return;const t=yield this.filterMids([e.mid]),i=(yield Promise.all(t.map((e=>this.processItem(e))))).filter(Boolean);i.length&&(this.current?this.next.push(...i):this.previous.push(...i))})),this.onMessageSent=({message:e})=>{this.onHistoryMultiappend(e)},null!==(t=this.managers)&&void 0!==t||(this.managers=a.Z.managers),a.Z.addEventListener("history_delete",this.onHistoryDelete),a.Z.addEventListener("history_multiappend",this.onHistoryMultiappend),a.Z.addEventListener("message_sent",this.onMessageSent),e.isInner||(this.otherSideLoader=new c(Object.assign(Object.assign({},e),{isInner:!0})))}filterMids(e){return l(this,void 0,void 0,(function*(){const t=`${this.searchContext.peerId}_${this.searchContext.isScheduled?"scheduled":"history"}`;return yield this.managers.appMessagesManager.filterMessagesByInputFilterFromStorage(this.searchContext.inputFilter._,e,t,e.length)}))}setSearchContext(e){this.searchContext=e,void 0!==this.searchContext.folderId&&(this.loadedAllUp=!0,void 0===this.searchContext.nextRate&&(this.loadedAllDown=!0)),"inputMessagesFilterChatPhotos"===this.searchContext.inputFilter._&&(this.loadedAllUp=!0),!1===this.searchContext.useSearch&&(this.loadedAllDown=this.loadedAllUp=!0),this.otherSideLoader&&this.otherSideLoader.setSearchContext(e)}reset(){super.reset(),this.searchContext=void 0,this.otherSideLoader&&this.otherSideLoader.reset()}getPrevious(e){let t=this.previous;return this.otherSideLoader&&e&&(t=t.concat(this.otherSideLoader.previous)),t}getNext(e){let t=this.next;return this.otherSideLoader&&e&&(t=t.concat(this.otherSideLoader.next)),t}getCurrent(){var e;return this.current||(null===(e=this.otherSideLoader)||void 0===e?void 0:e.current)}goToOtherEnd(e){return e>0?this.go(-this.previous.length):this.go(this.next.length)}goRound(e,t){var i;let s;if(null===(i=this.otherSideLoader)||void 0===i?void 0:i.current){if(s=this.otherSideLoader.goUnsafe(e,t),s.item)return s.item;if(!((e=s.leftLength)>0?this.otherSideLoader.next:this.otherSideLoader.previous).length){if(!(e>0?this.otherSideLoader.loadedAllUp:this.otherSideLoader.loadedAllDown))return;if(e>0&&(1===this.otherSideLoader.searchContext.maxId||this.otherSideLoader.loadedAllDown)||e<0&&(0===this.otherSideLoader.searchContext.maxId||this.otherSideLoader.loadedAllUp))return this.otherSideLoader.goToOtherEnd(e);this.otherSideLoader.unsetCurrent(e>0)}}if(s=this.goUnsafe(e,t),!s.item){if(this.loadedAllUp&&this.loadedAllDown)return this.goToOtherEnd(e);this.otherSideLoader&&(e=s.leftLength,s=this.otherSideLoader.goUnsafe(e,t),s.item&&this.unsetCurrent(e>0))}return null==s?void 0:s.item}setLoaded(e,t){var i;const s=super.setLoaded(e,t);if(s&&this.otherSideLoader&&t&&!1!==(null===(i=this.searchContext)||void 0===i?void 0:i.useSearch)){const e=this.loadedAllUp;this.otherSideLoader.setSearchContext(Object.assign(Object.assign({},this.searchContext),{maxId:e?1:0})),this.otherSideLoader.reverse=this.reverse,this.otherSideLoader.setLoaded(e,!0),this.otherSideLoader.load(!e)}return s}cleanup(){this.reset(),a.Z.removeEventListener("history_delete",this.onHistoryDelete),a.Z.removeEventListener("history_multiappend",this.onHistoryMultiappend),a.Z.removeEventListener("message_sent",this.onMessageSent),this.onEmptied=void 0,this.otherSideLoader&&(this.otherSideLoader.cleanup(),this.otherSideLoader=void 0)}}},9674:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(3035),n=i(3725),a=i(410),o=i(8487);const r=new class{constructor(){this.promises={},this.raf=s.T2.bind(null),this.scheduled=!1}do(e,t){let i=this.promises[e];return i||(this.scheduleFlush(),i=this.promises[e]=(0,n.Z)()),void 0!==t&&i.then((()=>t())),i}measure(e){return this.do("read",e)}mutate(e){return this.do("write",e)}mutateElement(e,t){const i=(0,o.Z)(e),s=i?this.mutate():Promise.resolve();return void 0!==t&&(i?s.then((()=>t())):t()),s}scheduleFlush(){this.scheduled||(this.scheduled=!0,this.raf((()=>{this.promises.read&&this.promises.read.resolve(),this.promises.write&&this.promises.write.resolve(),this.scheduled=!1,this.promises={}})))}};a.GO&&(a.GO.sequentialDom=r);const d=r},1713:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(1507),n=i(9687),a=i(9405),o=i(3114);function r(e,t,i,r,d=!0,l,c,h){const u=(0,o.Z)(e);let p;h||(h=(0,n.Z)(e,i,r,void 0,c));const f="document"===e._;p=f||u?(0,a.C)(e.w||h.w||512,e.h||h.h||512):(0,a.C)(h.w||100,h.h||100);let m=(0,a.C)(i,r);m=p=p.aspect(m,d);let g=!0;return(!f||["video","gif"].includes(e.type)||u)&&(m.width<200&&m.height<200&&(m=p=p.aspectCovered((0,a.C)(200,200))),l&&(l.message||l.reply_to_mid||l.media.webpage||l.replies&&l.replies.pFlags.comments&&l.replies.channel_id.toChatId()!==s.IA)&&m.width<320&&(m=(0,a.C)(320,m.height),g=!1),g&&m.width<120&&l&&(m=(0,a.C)(120,m.height),g=!1)),t.style.width=m.width+"px",t.style.height=m.height+"px",{photoSize:h,size:p,isFit:g}}},5345:(e,t,i)=>{"use strict";i.d(t,{Z:()=>u,s:()=>h});var s=i(5003),n=i(6519),a=i(3624),o=i(8631),r=i(5953),d=i(5418),l=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};let c=0;class h{constructor(e){var t;(0,r.Z)(this,e),this.queue=[],null!==(t=this.middlewareHelper)&&void 0!==t||(this.middlewareHelper=(0,a.k)());const i="BATCH-PROCESSOR-"+ ++c;this.log?this.log=this.log.bindPrefix(i):this.log=(0,s.kg)(i)}get queuePromise(){return this.promise}clear(){this.log("clear"),this.queue.length=0,this.promise=void 0,this.middlewareHelper.clean()}addToQueue(e){return this.queue.push(e),this.setQueue()}setQueue(){if(!this.queue.length)return Promise.resolve();if(this.promise)return this.promise;const e=this.middlewareHelper.get(),t=this.log.bindPrefix("queue"),i=(0,o.Z)(e,this.possibleError),s=()=>l(this,void 0,void 0,(function*(){t("start",this.queue.length);const e=this.queue.splice(0,this.queue.length),n=performance.now(),a=e.map((e=>(e.then((e=>{t("render item time",performance.now()-n,e)})),e))),o=yield i(Promise.all(a));if(yield i(this.process(o,i,t)),t("queue rendered"),this.queue.length)return t("have new items to render"),s();t("end")}));t("setting pause");const n=this.promise=i((0,d.Z)(0)).then((()=>s().catch((e=>{throw e!==this.possibleError&&t.error("process queue error",e),e}))),(e=>{throw t("pause has been cleared"),e})).finally((()=>{this.promise===n&&(this.promise=void 0)}));return n}}class u{constructor(e){this.updateElementWith=e=>e(),this.updateListWith=e=>e(!0),(0,r.Z)(this,e),this.elements=new Map,this.sorted=[],this.middleware=(0,a.k)(),this.batchProcessor=new h({log:this.log,process:(e,t,i)=>l(this,void 0,void 0,(function*(){const i=e.map((e=>this.update(e.id,e)));yield t(Promise.all(i))}))})}clear(){this.batchProcessor.clear(),this.middleware.clean(),this.elements.clear(),this.sorted.length=0}_updateList(){this.elements.forEach((e=>{this.update(e.id)})),this.onSort&&this.sorted.forEach(((e,t)=>{this.onSort(e,t)}))}updateList(e){const t=this.middleware.get();this.updateListWith((i=>{t()&&(void 0===i||i)?(this._updateList(),null==e||e(!0)):null==e||e(!1)}))}has(e){return this.elements.has(e)}get(e){return this.elements.get(e)}getAll(){return this.elements}add(e){return l(this,void 0,void 0,(function*(){if(this.get(e))return;const t={id:e,index:0};this.elements.set(e,t);const i=Promise.resolve(this.onElementCreate(t));return this.batchProcessor.addToQueue(i)}))}delete(e,t){const i=this.elements.get(e);if(!i)return!1;this.elements.delete(e);const s=this.sorted.indexOf(i);if(-1!==s&&this.sorted.splice(s,1),this.onDelete)if(t)this.onDelete(i);else{const e=this.middleware.get();this.updateElementWith((()=>{e()&&this.onDelete(i)}))}return!0}update(e,t=this.get(e)){var i;return l(this,void 0,void 0,(function*(){if(!t)return;if(t.index=yield this.getIndex(t),this.get(e)!==t)return;null===(i=this.onUpdate)||void 0===i||i.call(this,t);const s=(0,n.Z)(this.sorted,t,"index");this.onSort(t,s)}))}}},6854:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});const s="\ufeff"},4056:(e,t,i)=>{"use strict";function s(e){return e.replace(/&/g,"&").replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,(e=>"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";")).replace(/([^\#-~| |!])/g,(e=>"&#"+e.charCodeAt(0)+";")).replace(//g,">")}i.d(t,{Z:()=>s})},3738:(e,t,i)=>{"use strict";function s(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}i.d(t,{Z:()=>s})},8456:(e,t,i)=>{"use strict";function s(e,t,i=t+10){return(e=e.trim()).length>i&&(e=e.slice(0,t)+"..."),e}i.d(t,{Z:()=>s})},1564:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});const s="‎"},5157:(e,t,i)=>{"use strict";function s(e,t=!1){const i=parseInt(e+"",10),s=Math.floor(i/3600);let n=Math.floor((i-3600*s)/60),a=i-3600*s-60*n;return s&&(t=!0),n<10&&(n=t?"0"+n:n),a<10&&(a="0"+a),(s?s+":":"")+n+":"+a}i.d(t,{Z:()=>s})},8812:(e,t,i)=>{"use strict";function s(e){const t=new Blob([e],{type:"image/svg+xml;charset=utf-8"});return new Promise((e=>{const i=new FileReader;i.onload=t=>{e(t.target.result)},i.readAsDataURL(t)}))}i.d(t,{Z:()=>s})},241:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(410),n=i(1352);const a=new class{constructor(){if(n.kC)return;const e="visualViewport"in window?window.visualViewport:window,t=()=>{this.width=e.width||e.innerWidth,this.height=e.height||e.innerHeight};e.addEventListener("resize",t),t()}};s.GO&&(s.GO.windowSize=a);const o=a},8594:(e,t,i)=>{"use strict";i.d(t,{YW:()=>p,ZP:()=>v,e9:()=>g,gp:()=>m});var s=i(3725),n=i(410),a=i(5418);const o=new(i(3241).Z),r="start",d="end";let l=!1,c=(0,s.Z)(),h=0;c.resolve();const u=console.log.bind(console.log,"[HEAVY-ANIMATION]:");function p(e,t){l||(c=(0,s.Z)(),o.dispatchEvent(r),l=!0,n.ZP&&u("start")),++h,n.ZP&&u("attach promise, length:",h,t);const i=[void 0!==t?(0,a.Z)(t):void 0,e.finally((()=>{}))].filter(Boolean),d=performance.now(),p=c;return Promise.race(i).then((()=>{c!==p||c.isFulfilled||(--h,n.ZP&&u("promise end, length:",h,performance.now()-d),h<=0&&f())})),c}function f(){c.isFulfilled||(l=!1,h=0,o.dispatchEvent(d),c.resolve(),n.ZP&&u("end"))}function m(){f()}function g(){return c}function v(e,t,i){l&&e();const s=i?i.add(o):o.addEventListener.bind(o),n=i?i.removeManual.bind(i,o):o.removeEventListener.bind(o);return s(r,e),s(d,t),()=>{n(d,t),n(r,e)}}window.dispatchHeavyAnimationEvent=p},5005:(e,t,i)=>{"use strict";i.r(t),i.d(t,{AppDialogsManager:()=>ct,DIALOG_LIST_ELEMENT_TAG:()=>tt,DialogElement:()=>nt,default:()=>ut});var s=i(9331),n=i(3512),a=i(6194),o=i(2325),r=i(4668),d=i(2796),l=i(3897),c=i(1507),h=i(3186),u=i(4531),p=i(1168),f=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class m{constructor(e){this.managers=e,this.onArchiveClick=()=>f(this,void 0,void 0,(function*(){const e=yield this.managers.appMessagesManager.getDialogOnly(this.peerId);e&&this.managers.appMessagesManager.editPeerFolders([e.peerId],+!e.folder_id)})),this.onHideTopicClick=()=>{this.managers.appChatsManager.editForumTopic({chatId:this.peerId.toChatId(),topicId:this.threadId,hidden:!0})},this.onToggleTopicClick=()=>{this.managers.appChatsManager.editForumTopic({chatId:this.peerId.toChatId(),topicId:this.threadId,closed:!this.dialog.pFlags.closed})},this.onPinClick=()=>{const{peerId:e,filterId:t,threadId:i}=this;this.managers.appMessagesManager.toggleDialogPin({peerId:e,filterId:t,topicId:i}).catch((e=>f(this,void 0,void 0,(function*(){"PINNED_DIALOGS_TOO_MUCH"!==e.type&&"PINNED_TOO_MUCH"!==e.type||(i?this.managers.apiManager.getLimit("topicPin").then((e=>{(0,d.bC)({langPackKey:"LimitReachedPinnedTopics",langPackArguments:[e]})})):t>=1?(0,d.bC)({langPackKey:"PinFolderLimitReached"}):(0,h.Z)("pin"))}))))},this.onUnmuteClick=()=>{this.managers.appMessagesManager.togglePeerMute({peerId:this.peerId,mute:!1,threadId:this.threadId})},this.onMuteClick=()=>{p.Z.createPopup(l.Z,this.peerId,this.threadId)},this.onUnreadClick=()=>f(this,void 0,void 0,(function*(){const{peerId:e,dialog:t}=this;t.unread_count?(this.managers.appMessagesManager.readHistory(e,t.top_message,this.threadId),this.threadId||this.managers.appMessagesManager.markDialogUnread(e,!0)):this.threadId||this.managers.appMessagesManager.markDialogUnread(e)})),this.onDeleteClick=()=>{p.Z.createPopup(a.Z,this.peerId,void 0,void 0,this.threadId)}}attach(e){(0,u.Z)({listenTo:e,buttons:this.getButtons(),appendTo:document.getElementById("page-chats"),onOpen:e=>f(this,void 0,void 0,(function*(){this.li=e,e.classList.add("menu-open"),this.peerId=e.dataset.peerId.toPeerId(),this.threadId=+e.dataset.threadId||void 0,this.dialog=yield this.managers.dialogsStorage.getDialogOrTopic(this.peerId,this.threadId),this.filterId=this.threadId?void 0:ut.filterId,this.canManageTopics=this.threadId?yield this.managers.appChatsManager.hasRights(this.peerId.toChatId(),"manage_topics"):void 0})),onBeforeOpen:()=>f(this,void 0,void 0,(function*(){const e=this.threadId?"Delete":yield this.managers.appPeersManager.getDeleteButtonText(this.peerId),t=this.buttons[this.buttons.length-1];(null==t?void 0:t.element)&&t.element.lastChild.replaceWith((0,o.ag)(e))})),onClose:()=>{this.li.classList.remove("menu-open"),this.li=this.peerId=this.dialog=this.filterId=this.threadId=this.canManageTopics=void 0},findElement:e=>(0,r.Z)(e.target,tt)})}getButtons(){var e;return null!==(e=this.buttons)&&void 0!==e?e:this.buttons=[{icon:"unread",text:"MarkAsUnread",onClick:this.onUnreadClick,verify:()=>f(this,void 0,void 0,(function*(){return!this.threadId&&!(yield this.managers.appMessagesManager.isDialogUnread(this.dialog))}))},{icon:"readchats",text:"MarkAsRead",onClick:this.onUnreadClick,verify:()=>this.managers.appMessagesManager.isDialogUnread(this.dialog)},{icon:"pin",text:"ChatList.Context.Pin",onClick:this.onPinClick,verify:()=>f(this,void 0,void 0,(function*(){var e;return!(this.threadId&&!this.canManageTopics)&&!(void 0!==this.filterId&&this.filterId>1?(yield this.managers.appMessagesManager.getFilter(this.filterId)).pinnedPeerIds.includes(this.dialog.peerId):null===(e=this.dialog.pFlags)||void 0===e?void 0:e.pinned)}))},{icon:"unpin",text:"ChatList.Context.Unpin",onClick:this.onPinClick,verify:()=>f(this,void 0,void 0,(function*(){var e;return!(this.threadId&&!this.canManageTopics)&&(void 0!==this.filterId&&this.filterId>1?(yield this.managers.appMessagesManager.getFilter(this.filterId)).pinnedPeerIds.includes(this.dialog.peerId):!!(null===(e=this.dialog.pFlags)||void 0===e?void 0:e.pinned))}))},{icon:"mute",text:"ChatList.Context.Mute",onClick:this.onMuteClick,verify:()=>f(this,void 0,void 0,(function*(){return this.peerId!==n.Z.myId&&!(yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:this.dialog.peerId,threadId:this.threadId}))}))},{icon:"unmute",text:"ChatList.Context.Unmute",onClick:this.onUnmuteClick,verify:()=>f(this,void 0,void 0,(function*(){return this.peerId!==n.Z.myId&&(yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:this.dialog.peerId,threadId:this.threadId}))}))},{icon:"archive",text:"Archive",onClick:this.onArchiveClick,verify:()=>0===this.filterId&&this.peerId!==n.Z.myId},{icon:"unarchive",text:"Unarchive",onClick:this.onArchiveClick,verify:()=>1===this.filterId&&this.peerId!==n.Z.myId},{icon:"hide",text:"Hide",onClick:this.onHideTopicClick,verify:()=>this.canManageTopics&&this.dialog.id===c.Ox},{icon:"lock",text:"CloseTopic",onClick:this.onToggleTopicClick,verify:()=>this.canManageTopics&&!this.dialog.pFlags.closed},{icon:"lockoff",text:"RestartTopic",onClick:this.onToggleTopicClick,verify:()=>this.canManageTopics&&!!this.dialog.pFlags.closed},{icon:"delete danger",text:"Delete",onClick:this.onDeleteClick,verify:()=>!this.threadId||!!this.canManageTopics&&this.dialog.id!==c.Ox}]}}var g=i(6008),v=i(1405),b=i(8805),y=i(632),w=i(4762),S=i(5003),C=i(7030),L=i(4494),I=i(9099),E=i(410),P=i(8842),Z=i(1447),M=i(9492),T=i(534),k=i(7856),x=i(2738),A=i(4484),_=i(5565),F=i(4159),D=i(3442),R=i(7487),B=i(9174),N=i(3910),O=i(490);class U{constructor(e,t){this.managers=e,this.hadConnect=!1,this.connecting=!1,this.timedOut=!1,this.updating=!1,this.setConnectionStatus=e=>{Promise.all([R.Z.get("dc"),n.Z.managers.rootScope.getConnectionStatus()]).then((([t,i])=>{t||(t=F.Z.baseDcId),this.setFirstConnectionTimeout&&(clearTimeout(this.setFirstConnectionTimeout),this.setFirstConnectionTimeout=0);const s=i["NET-"+t],n=s&&(e||s.status)===B.Q.Connected;this.connecting&&n&&this.managers.apiUpdatesManager.forceGetDifference(),n&&!this.hadConnect&&(this.hadConnect=!0),this.timedOut=s&&(e||s.status)===B.Q.TimedOut,this.connecting=!n,this.retryAt=s&&s.retryAt,E.ZP&&this.log("connecting",this.connecting),this.setState()}))},this.setStatusText=(e,t)=>{this.currentLangPackKey!==e&&(this.currentLangPackKey=e,(0,_.Z)(this.statusEl,(0,o.ag)(e,t)),this.statusPreloader.attach(this.statusEl))},this.setState=()=>{if(O.Z.deactivatedReason)return;const e=U.CHANGE_STATE_DELAY;if(this.connecting)if(this.timedOut){const e=this.getA("ConnectionStatus.ForceReconnect",(()=>this.managers.networkerFactory.forceReconnect()));this.setStatusText("ConnectionStatus.TimedOut",[e])}else if(this.hadConnect)if(void 0!==this.retryAt){const e=document.createElement("span"),t=this.retryAt,i=()=>{const i=Date.now();e.innerText=""+Math.max(0,Math.round((t-i)/1e3)),i>t&&clearInterval(s)},s=setInterval(i,1e3);i();const n=this.getA("ConnectionStatus.Reconnect",(()=>this.managers.networkerFactory.forceReconnectTimeout()));this.setStatusText("ConnectionStatus.ReconnectIn",[e,n])}else this.setStatusText("ConnectionStatus.Reconnecting");else this.setStatusText("ConnectionStatus.Waiting");else this.updating&&this.setStatusText("Updating");E.ZP&&this.log("setState",this.connecting||this.updating),window.requestAnimationFrame((()=>{this.setStateTimeout&&clearTimeout(this.setStateTimeout),this.setStateTimeout=window.setTimeout((()=>{(0,I.Z)({element:this.statusContainer,className:"is-shown",forwards:this.connecting||this.updating,duration:200}),this.setStateTimeout=0,E.ZP&&this.log("setState: isShown:",this.connecting||this.updating)}),e)}))},this.log=(0,S.kg)("CS",void 0,void 0),this.statusContainer=document.createElement("div"),this.statusContainer.classList.add("connection-status"),this.statusEl=(0,L.Z)("btn-primary bg-warning connection-status-button",{noRipple:!0}),this.statusPreloader=new D.Z({cancelable:!1}),this.statusPreloader.constructContainer({color:"transparent",bold:!0}),this.statusContainer.append(this.statusEl),t.prepend(this.statusContainer),n.Z.addEventListener("connection_status_change",(e=>{this.setConnectionStatus()})),n.Z.addEventListener("state_synchronizing",(e=>{e||(this.updating=!0,E.ZP&&this.log("updating",this.updating),this.setState())})),n.Z.addEventListener("state_synchronized",(e=>{E.ZP&&this.log("state_synchronized",e),e||(this.updating=!1,E.ZP&&this.log("updating",this.updating),this.setState())})),this.setFirstConnectionTimeout=window.setTimeout(this.setConnectionStatus,U.CHANGE_STATE_DELAY+1e3)}getA(e,t){const i=document.createElement("a");return i.classList.add("force-reconnect"),i.append((0,o.ag)(e)),(0,x.fc)(i,(e=>{(0,N.Z)(e),t()})),i}}U.CHANGE_STATE_DELAY=1e3;var H,z=i(6740),j=i(3035),G=i(2894),V=i(5432),K=i(1154),W=i(241),$=i(8487);!function(e){e[e.Error=-1]="Error",e[e.Pending=0]="Pending",e[e.Sent=1]="Sent",e[e.Read=2]="Read"}(H||(H={}));var q=i(5345),Y=i(5701),Q=i(5296),X=i(8222);function J(e,t,i,s){return e>=s?t+i:function(e,t){return-t/2*(Math.cos(Math.PI*e)-1)}(e/s,i)+t}var ee=i(4755);function te(e,t,i,s,n,a,o,r){const d=e.canvas.dpr;if(d&&(t*=d,i*=d,s*=d,n*=d),"number"==typeof a)d&&(a*=d),a={tl:a,tr:a,br:a,bl:a};else{const e={tl:0,tr:0,br:0,bl:0};for(const t in e)a[t]=a[t]?d?a[t]*d:a[t]:e[t]}e.beginPath(),e.moveTo(t+a.tl,i),e.lineTo(t+s-a.tr,i),e.quadraticCurveTo(t+s,i,t+s,i+a.tr),e.lineTo(t+s,i+n-a.br),e.quadraticCurveTo(t+s,i+n,t+s-a.br,i+n),e.lineTo(t+a.bl,i+n),e.quadraticCurveTo(t,i+n,t,i+n-a.bl),e.lineTo(t,i+a.tl),e.quadraticCurveTo(t,i,t+a.tl,i),e.closePath(),o&&e.fill(),r&&e.stroke()}const ie=window.devicePixelRatio,se=20*ie,ne=2.5*ie,ae=2*ie,oe=1*ie;var re=i(6818),de=i(5824),le=i(3013),ce=i(130),he=i(4332),ue=i(9687),pe=i(8115),fe=i(496),me=i(5381),ge=i(7530),ve=i(2291),be=i(5772),ye=i(3385),we=i(2554),Se=i(8050),Ce=i(3725),Le=i(7362),Ie=i(8631),Ee=i(2312),Pe=i(2059),Ze=i(2493),Me=i(319),Te=i(2890),ke=i(3228);class xe{constructor(){this.font="30pt Helvetica",this.currTime=Date.now(),this.diffTime=0,this.spread=0,this.paused=!1,this.pausedTime=0,this.pauseInterval=850,this.lightSource=0,this.inc=.032,this.lightSpread=.55,this.animations=["slide","slide","slide","slide"],this.currentAnimationIndex=0}keepTime(){this.diffTime=Date.now()-this.currTime,this.currTime=Date.now()}cycleAnimation(){++this.currentAnimationIndex,this.currentAnimationIndex>=this.animations.length&&(this.currentAnimationIndex=0)}animate(){const e=this.animations[this.currentAnimationIndex];return"glow"===e?this.animateGlow():"slide"===e?this.animateSlide():void console.log("unknown animation type: "+String(e))}animateGlow(){var e=68;return()=>{var t=this.diffTime/(1e3/60)*10;return this.paused?Date.now()-this.pausedTime>800&&(e=68,this.cycleAnimation(),this.paused=!1):(e=parseInt(""+(e+t)))>=255&&(this.paused=!0,this.pausedTime=Date.now()),"rgb("+e+","+e+","+e+")"}}animateSlide(){var e,t,i,s=this.ctx.createLinearGradient(0,0,this.canvas.width,0),n=this.inc*(this.diffTime/(1e3/60));if(this.paused){if(Date.now()-this.pausedTime>this.pauseInterval)return this.lightSource=-.6,this.cycleAnimation(),this.paused=!1,this.animateSlide()}else this.lightSource+=n,this.lightSource>1+this.lightSpread&&(this.paused=!0,this.pausedTime=Date.now());i=(0,ke.Z)(this.lightSource,0,1),e=(0,ke.Z)(this.lightSource-this.lightSpread,0,1),t=(0,ke.Z)(this.lightSource+this.lightSpread,0,1);const a=X.Z.getProperty("background-color-true"),o=X.Z.getProperty("surface-color");return s.addColorStop(e,a),s.addColorStop(i,o),s.addColorStop(t,a),s}settings(e={}){var t,i,s,n,a,o;this.canvas=null!==(t=e.canvas)&&void 0!==t?t:document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.font=null!==(i=e.font)&&void 0!==i?i:this.font,this.lightSpread=null!==(s=e.lightSpread)&&void 0!==s?s:this.lightSpread,this.inc=null!==(n=e.inc)&&void 0!==n?n:this.inc,this.animations=null!==(a=e.animations)&&void 0!==a?a:this.animations,this.text=null!==(o=e.text)&&void 0!==o?o:this.text,this.fillStyle=e.fillStyle,this.canvas.classList.add("shimmer-canvas")}on(){const{width:e,height:t}=this.canvas;this.keepTime(),this.ctx.clearRect(0,0,e,t),this.font&&(this.ctx.font=this.font),this.ctx.fillStyle=this.animate(),this.ctx.fillRect(0,0,e,t),this.fillStyle&&(this.ctx.fillStyle=this.fillStyle,this.ctx.fillRect(0,0,e,t)),this.text&&this.ctx.fillText(this.text,50,50)}}var Ae=i(5994);class _e{constructor(e={}){var t,i,s;this.onThemeChange=()=>{this.stopAnimation(),this.startAnimation()},this.onResize=()=>{const{canvas:e}=this,{width:t,height:i,dpr:s}=e;this.updateCanvasSize(),e.width===t&&e.height===i&&e.dpr===s||(this.stopAnimation(),this.startAnimation())},this.shimmer=new xe,this.tempId=0,this.canvas=document.createElement("canvas"),this.canvas.classList.add("dialogs-placeholder-canvas"),this.ctx=this.canvas.getContext("2d"),this.generatedValues=[],this.avatarSize=null!==(t=e.avatarSize)&&void 0!==t?t:54,this.marginVertical=null!==(i=e.marginVertical)&&void 0!==i?i:9,this.totalHeight=null!==(s=e.totalHeight)&&void 0!==s?s:this.avatarSize+2*this.marginVertical,this.lineHeight=10,this.lineBorderRadius=6,this.lineMarginVertical=8,this.statusWidth=24}attach({container:e,rect:t,getRectFrom:i,onRemove:s,blockScrollable:n}){const{canvas:a}=this;this.onRemove=s,this.getRectFrom="function"==typeof i?i:(i||e).getBoundingClientRect.bind(i||e),(this.blockScrollable=n)&&(n.container.style.overflowY="hidden"),this.updateCanvasSize(t),this.startAnimation(),e.append(a)}detach(e){this.detachTime||(this.availableLength=e,this.detachTime=Date.now(),Ae.Z.isAvailable("animations")||this.remove())}remove(){var e;this.stopAnimation(),this.canvas.parentElement&&(this.canvas.remove(),this.blockScrollable&&(this.blockScrollable.container.style.overflowY="",this.blockScrollable=void 0)),null===(e=this.onRemove)||void 0===e||e.call(this),this.onRemove=void 0}updateCanvasSize(e=this.getRectFrom()){const{canvas:t}=this,i=t.dpr=window.devicePixelRatio;t.width=e.width*i,t.height=e.height*i,t.style.width=e.width+"px",t.style.height=e.height+"px"}renderDetachAnimationFrame(){const{canvas:e,ctx:t,detachTime:i,length:s,availableLength:n}=this;if(!i)return;if(!Ae.Z.isAvailable("animations"))return void this.remove();const{width:a}=e;t.globalCompositeOperation="destination-out";const o=Date.now()-i;let r=!0;for(let e=0;e=n?15*(n-1):15*e);if(i<=0){r=!1;continue}const d=J(i,0,1,150);t.beginPath(),t.rect(0,this.dialogHeight*e,a,this.dialogHeight),t.fillStyle=`rgba(0, 0, 0, ${d})`,t.fill(),d<1&&(r=!1)}t.globalCompositeOperation="source-over",r&&this.remove()}renderFrame(){this.shimmer.on(),this.renderDetachAnimationFrame()}startAnimation(){const{canvas:e,shimmer:t}=this,i=++this.tempId,s=this.createPattern();t.settings({canvas:e,fillStyle:s});const a=()=>this.tempId===i;this.renderFrame(),(0,Q.jt)((()=>!!a()&&(Ae.Z.isAvailable("animations")&&this.renderFrame(),a()))),n.Z.addEventListener("theme_change",this.onThemeChange),ee.Z.addEventListener("resize",this.onResize)}stopAnimation(){++this.tempId,n.Z.removeEventListener("theme_change",this.onThemeChange),ee.Z.removeEventListener("resize",this.onResize)}createPattern(){const{canvas:e,ctx:t}=this,i=document.createElement("canvas"),s=i.getContext("2d"),n=e.dpr;i.dpr=n,i.width=e.width,i.height=e.height,s.fillStyle=X.Z.getProperty("surface-color"),s.fillRect(0,0,i.width,i.height),s.fillStyle="#000",s.globalCompositeOperation="destination-out";const a=this.dialogHeight=this.totalHeight*n,o=this.length=Math.ceil(e.height/a);for(let e=0;e{})).finally((()=>{e[t]===s&&delete e[t]}));const n=(0,Ie.Z)((()=>e[t]===s));return{deferred:s,middleware:n}}class st extends q.Z{constructor(e){super({getIndex:e=>{var t;return this.managers.dialogsStorage.getDialogIndex(null!==(t=this.forumPeerId)&&void 0!==t?t:e.id,this.indexKey,this.forumPeerId?e.id:void 0)},onDelete:e=>{var t;e.dom.listEl.remove(),null===(t=this.onListLengthChange)||void 0===t||t.call(this)},onSort:(e,t)=>{var i;const s=e.dom.listEl.parentElement!==this.list;(0,A.Z)(e.dom.listEl,this.list,t),s&&(null===(i=this.onListLengthChange)||void 0===i||i.call(this))},onElementCreate:e=>et(this,void 0,void 0,(function*(){var t;const i=[],s=ht.addListDialog({peerId:null!==(t=this.forumPeerId)&&void 0!==t?t:e.id,loadPromises:i,isBatch:!0,threadId:this.forumPeerId?e.id:void 0,isMainList:"index_0"===this.indexKey});return e.dom=s.dom,e.dialogElement=s,yield Promise.all(i),e})),updateElementWith:j.TR,log:e.log}),(0,Ge.Z)(this,e)}clear(){this.list.replaceChildren(),super.clear()}}class nt extends He.ZP{constructor({peerId:e,rippleEnabled:t=!0,onlyFirstName:i=!1,meAsSaved:n=!0,avatarSize:a="bigger",autonomous:o,loadPromises:r,fromName:d,noIcons:l,threadId:c,wrapOptions:h={},isMainList:u}){var p;super({clickable:!0,noRipple:!t,havePadding:!c,title:!0,titleRightSecondary:!0,subtitle:!0,subtitleRight:!0,noWrap:!0,asLink:!0}),this.subtitleRight.remove();const f=c?void 0:new s.Z;if(f){const t={bigger:54,abitbigger:42,small:32}[a];f.classList.add("dialog-avatar","avatar-"+t),f.updateWithOptions({loadPromises:r,lazyLoadQueue:h.lazyLoadQueue,isDialog:!!n,peerId:e,peerTitle:d}),this.applyMediaElement(f,a)}const m=this.container,g=this.title;g.classList.add("user-title"),this.titleRow.classList.add("dialog-title");const v=new P.Z,b=v.update({peerId:e,fromName:d,dialog:n,onlyFirstName:i,withIcons:!l,threadId:c});null==r||r.push(b),g.append(v.element),g.classList.add("tgico");const y=this.subtitle,w=this.container;w.classList.add("chatlist-chat","chatlist-chat-"+a),o||(w.href="#"+e),"bigger"===a?this.container.classList.add("row-big"):"small"===a&&this.container.classList.add("row-small"),w.dataset.peerId=""+e,c&&(w.dataset.threadId=""+c);const S=document.createElement("span");S.classList.add("message-status","sending-status");const L=document.createElement("span");L.classList.add("message-time");const I=this.titleRight;I.classList.add("dialog-title-details"),I.append(S,L),this.subtitleRow.classList.add("dialog-subtitle");const E=this.dom={avatarEl:f,captionDiv:m,titleSpan:v.element,titleSpanContainer:g,statusSpan:S,lastTimeSpan:L,lastMessageSpan:y,containerEl:w,listEl:w,subtitleEl:this.subtitleRow};if(!o){w.dialogDom=E;const t=C.ZP.chat;t&&C.ZP.isSamePeer(t,{peerId:e,threadId:c,type:"chat"})&&ht.setDialogActive(w,!0),u&&(null===(p=ht.forumTab)||void 0===p?void 0:p.peerId)===e&&!c&&w.classList.add("is-forum-open")}}createUnreadBadge(){if(this.dom.unreadBadge)return;const e=this.dom.unreadBadge=document.createElement("div");e.className="dialog-subtitle-badge badge badge-22",this.dom.subtitleEl.append(e)}createUnreadAvatarBadge(){if(this.dom.unreadAvatarBadge)return;const e=this.dom.unreadAvatarBadge=document.createElement("div");e.className="dialog-subtitle-badge badge badge-22 avatar-badge",this.dom.listEl.append(e)}createMentionsBadge(){if(this.dom.mentionsBadge)return;const e=this.dom.mentionsBadge=document.createElement("div");e.className="dialog-subtitle-badge badge badge-22 mention mention-badge",e.innerText="@",this.dom.lastMessageSpan.after(e)}toggleBadgeByKey(e,t,i,s){(0,I.Z)({element:this.dom[e],className:"is-visible",forwards:t,duration:s?0:250,onTransitionEnd:t?void 0:()=>{this.dom[e].remove(),delete this.dom[e]},useRafs:i&&(0,$.Z)(this.dom[e])?0:2})}}class at extends je.h{toggle(e){return et(this,void 0,void 0,(function*(){this.init2&&(yield this.init2()),(0,I.Z)({element:this.container,className:"is-visible",forwards:e,duration:300,onTransitionEnd:e?void 0:()=>{this.onCloseAfterTimeout()},useRafs:this.firstTime?(this.firstTime=void 0,2):void 0})}))}init(e){(0,Ge.Z)(this,e),this.log=(0,S.kg)("FORUM"),this.firstTime=!0,this.container.classList.add("topics-container");const t=!this.slider;t&&(this.closeBtn.classList.replace("tgico-left","tgico-close"),this.container.classList.add("active","is-floating"),(0,x.fc)(this.closeBtn,(()=>{ht.toggleForumTab(void 0,this)}),{listenerSetter:this.listenerSetter})),this.rows=document.createElement("div"),this.rows.classList.add("sidebar-header__rows"),this.subtitle=document.createElement("div"),this.subtitle.classList.add("sidebar-header__subtitle"),this.title.replaceWith(this.rows),this.rows.append(this.title,this.subtitle);const i=ht.createChatList();ht.setListClickListener(i,null,!0),this.scrollable.append(i),this.xd=new dt(this.peerId,t?80:0),this.xd.scrollable=this.scrollable,this.xd.sortedList=new st({managers:this.managers,log:this.log,list:i,indexKey:"index_0",forumPeerId:this.peerId}),this.xd.bindScrollable();const s=()=>({peerId:this.peerId,type:"chat"}),a=(0,Ke.Z)({listenerSetter:this.listenerSetter,direction:"bottom-left",buttons:[{icon:"info",text:"ForumTopic.Context.Info",onClick:()=>et(this,void 0,void 0,(function*(){const e=k.ZP.createTab(qe.Z,!0);e.isFirst=!0,e.setPeer(this.peerId),(yield e.fillProfileElements())(),e.loadSidebarMedia(!0),e.open()}))},{icon:"message",text:"ForumTopic.Context.ShowAsMessages",onClick:()=>{const e=C.ZP.chat;C.ZP[(null==e?void 0:e.peerId)===this.peerId?"setPeer":"setInnerPeer"](s())},verify:()=>{const e=C.ZP.chat;return!e||!C.ZP.isSamePeer(e,s())}},{icon:"adduser",text:"ForumTopic.Context.AddMember",onClick:()=>{},verify:()=>!1},{icon:"add",text:"ForumTopic.Context.New",onClick:()=>{k.ZP.createTab(Xe.Z).open(this.peerId)},separator:!0,verify:()=>this.managers.appChatsManager.hasRights(this.peerId.toChatId(),"manage_topics")}]});if(this.listenerSetter.add(n.Z)("history_reload",(e=>{this.peerId===e&&this.xd.fullReset()})),this.listenerSetter.add(n.Z)("chat_update",(e=>et(this,void 0,void 0,(function*(){this.peerId===e.toPeerId(!0)&&((yield this.managers.appChatsManager.getChat(e)).pFlags.forum||ht.toggleForumTab(void 0,this))})))),V.Z&&(0,K.Z)({element:this.container,onSwipe:()=>{ht.toggleForumTab(void 0,this)},middleware:this.middlewareHelper.get()}),this.header.append(a),!t)return this.init2()}init2(){return et(this,void 0,void 0,(function*(){this.init2=void 0;const e=this.middlewareHelper.get(),t=this.peerId;this.managers.apiUpdatesManager.subscribeToChannelUpdates(this.peerId.toChatId()),e.onDestroy((()=>{this.managers.apiUpdatesManager.unsubscribeFromChannelUpdates(this.peerId.toChatId())}));const i=(0,Le.Z)({peerId:t,dialog:!0,wrapOptions:{middleware:e}}),s=C.ZP.setPeerStatus({peerId:t,element:this.subtitle,needClear:!0,useWhitespace:!1,middleware:e,noTyping:!0});return Promise.all([i,s,this.xd.onChatsScroll().then((e=>e.cached?e.renderPromise:void 0))]).then((([t,i,s])=>{e()&&(this.title.append(t),null==i||i())}))}))}onCloseAfterTimeout(){super.onCloseAfterTimeout(),this.xd.destroy()}}const ot=new Error("not implemented");class rt{constructor(){this.onChatsRegularScroll=()=>{this.sliceTimeout&&clearTimeout(this.sliceTimeout),this.sliceTimeout=window.setTimeout((()=>{this.sliceTimeout=void 0,this.sortedList.list.childElementCount&&!ht.processContact&&(0,j.TR)((()=>{const e=performance.now(),t=this.scrollable.scrollTop,i=this.sortedList.list.firstElementChild,s=this.scrollable.container.getBoundingClientRect(),n=i.getBoundingClientRect(),a=Array.from(this.scrollable.splitUp.children);let o=this.scrollable.splitUp.offsetTop;o&&t{this.deleteDialogByKey(this.getDialogKeyFromElement(e))})),this.setOffsets();const b=c.offsetTop-u;this.scrollable.scrollTop=this.scrollable.lastScrollPosition=b,this.log("slice time",performance.now()-e,this.indexKey,b)}))}),200)},this.log=(0,S.kg)("CL"),this.offsets={top:0,bottom:0},this.managers=n.Z.managers,this.listenerSetter=new Ve.Z}getOffsetIndex(e){return{index:this.scrollable.loadedAll[e]?0:this.offsets[e]}}isDialogMustBeInViewport(e){const t=this.getOffsetIndex("top"),i=this.getOffsetIndex("bottom");if(!t.index&&!i.index)return!0;const s=(0,Se.Z)(e,this.indexKey);return(!t.index||s<=t.index)&&(!i.index||s>=i.index)}setIndexKey(e){this.indexKey=e,this.sortedList.indexKey=e}deleteDialogByKey(e){this.sortedList.delete(e)}deleteDialog(e){return this.deleteDialogByKey(this.getDialogKey(e))}updateDialog(e){const t=this.getDialogKey(e);if(!this.isDialogMustBeInViewport(e))return void this.deleteDialog(e);if(!this.sortedList.has(t)&&this.loadedDialogsAtLeastOnce)return void this.sortedList.add(t);const i=this.getDialogElement(t);i&&(ht.setLastMessageN({dialog:e,dialogElement:i,setUnread:!0}),this.sortedList.update(t))}onChatsScrollTop(){return this.onChatsScroll("top")}onChatsScroll(e="bottom"){return this.loadDialogs(e)}createPlaceholder(){const e=this.placeholder=new _e(this.placeholderOptions),t=this.getRectFromForPlaceholder();return e.attach({container:this.sortedList.list.parentElement,getRectFrom:t,onRemove:()=>{this.placeholder===e&&(this.placeholder=void 0)},blockScrollable:this.scrollable}),e}loadDialogs(e){const t=this.log.bindPrefix("load-"+(i=1e3,s=9999,i=Math.ceil(i),s=Math.floor(s),Math.floor(Math.random()*(s-i+1))+i));var i,s;if(t("try",e),this.loadDialogsPromise||this.loadDialogsRenderPromise)return this.loadDialogsPromise;if(this.scrollable.loadedAll[e])return Promise.resolve({cached:!0,renderPromise:Promise.resolve()});t.warn("start",e);const n=(0,Ue.Z)("MIDDLEWARE"),a=(0,Ce.Z)(),o=new Promise(((i,s)=>et(this,void 0,void 0,(function*(){const r=this.sortedList.list;let d=this.placeholder;try{const i=this.loadDialogsInner(e),s=yield i;if(!r.childElementCount&&!d&&(!this.loadedDialogsAtLeastOnce&&this.needPlaceholderAtFirstTime||!s.cached)){if(this.loadDialogsRenderPromise!==o)throw n;d=this.createPlaceholder(),a.resolve(!1)}const l=yield s.result;if(this.loadDialogsRenderPromise!==o)throw n;a.resolve(s.cached),"bottom"===e?l.isEnd&&(this.scrollable.loadedAll[e]=!0):l.isTopEnd&&(this.scrollable.loadedAll[e]=!0);const c=l.dialogs.length;if(t(`will render ${c} dialogs`),c){const t=("top"===e?l.dialogs.slice().reverse():l.dialogs).map((e=>this.sortedList.add(this.getDialogKey(e))));if(yield Promise.all(t).catch(),this.loadDialogsRenderPromise!==o)throw n}const h=l.dialogs["top"===e?0:c-1];h&&(this.offsets[e]=(0,Se.Z)(h,this.indexKey)),this.loadedDialogsAtLeastOnce=!0,ht.onListLengthChange(),t("getDialogs",l,r.childElementCount),setTimeout((()=>{this.scrollable.onScroll()}),0),d&&d.detach(r.childElementCount)}catch(e){return"MIDDLEWARE"!==(null==e?void 0:e.type)&&t.error(e),s(e),void a.reject(e)}i()})))).finally((()=>{this.loadDialogsRenderPromise===o?(t("end"),this.loadDialogsRenderPromise=void 0):t("has been cleared")}));this.loadDialogsRenderPromise=o;const r=this.loadDialogsPromise=a.then((e=>({cached:e,renderPromise:o}))).finally((()=>{this.loadDialogsPromise===r&&(this.loadDialogsPromise=void 0)}));return r}setOffsets(){return et(this,void 0,void 0,(function*(){const e=this.sortedList.list,[t,i]=yield Promise.all([this.getDialogFromElement(e.firstElementChild),this.getDialogFromElement(e.lastElementChild)]),{indexKey:s}=this;this.offsets.top=(0,Se.Z)(t,s),this.offsets.bottom=(0,Se.Z)(i,s)}))}getDialogKey(e){throw ot}getDialogKeyFromElement(e){throw ot}getRectFromForPlaceholder(){throw ot}getDialogFromElement(e){throw ot}loadDialogsInner(e){throw ot}setTyping(e){return et(this,void 0,void 0,(function*(){const t=this.getDialogKey(e),i=this.getDialogDom(t);if(!i)return;const s=i.lastMessageSpan.querySelector(".peer-typing-container"),n=yield C.ZP.getPeerTyping(e.peerId,s,"forumTopic"===e._?e.id:void 0);!s&&n&&((0,_.Z)(i.lastMessageSpan,n),i.lastMessageSpan.classList.add("user-typing"))}))}unsetTyping(e){const t=this.getDialogKey(e),i=this.getDialogElement(t);i&&(i.dom.lastMessageSpan.classList.remove("user-typing"),ht.setLastMessageN({dialog:e,lastMessage:null,dialogElement:i,setUnread:null}))}getDialogDom(e){const t=this.sortedList.get(e);return null==t?void 0:t.dom}getDialogElement(e){const t=this.sortedList.get(e);return null==t?void 0:t.dialogElement}bindScrollable(){this.scrollable.container.addEventListener("scroll",this.onChatsRegularScroll),this.scrollable.onScrolledTop=this.onChatsScrollTop.bind(this),this.scrollable.onScrolledBottom=this.onChatsScroll.bind(this),this.scrollable.setVirtualContainer(this.sortedList.list)}clear(){var e;this.sortedList.clear(),null===(e=this.placeholder)||void 0===e||e.remove()}reset(){this.scrollable.loadedAll.top=!0,this.scrollable.loadedAll.bottom=!1,this.offsets.top=this.offsets.bottom=0,this.loadDialogsRenderPromise=void 0,this.loadDialogsPromise=void 0}fullReset(){return this.reset(),this.clear(),this.onChatsScroll()}destroy(){this.clear(),this.scrollable.destroy(),this.listenerSetter.removeAll()}}class dt extends rt{constructor(e,t){super(),this.peerId=e,this.paddingX=t,this.placeholderOptions={avatarSize:0,marginVertical:5,totalHeight:64},this.listenerSetter.add(n.Z)("peer_typings",(({peerId:e,threadId:t,typings:i})=>et(this,void 0,void 0,(function*(){if(!t||this.peerId!==e)return;const s=yield this.managers.dialogsStorage.getForumTopic(e,t);s&&(i.length?this.setTyping(s):this.unsetTyping(s))})))),this.listenerSetter.add(n.Z)("dialogs_multiupdate",(e=>{for(const[t,{dialog:i,topics:s}]of e)t===this.peerId&&(null==s?void 0:s.size)&&s.forEach((e=>{this.updateDialog(e)}))})),this.listenerSetter.add(n.Z)("dialog_unread",(({dialog:e})=>{"forumTopic"===(null==e?void 0:e._)&&e.peerId===this.peerId&&ht.setUnreadMessagesN({dialog:e,dialogElement:this.getDialogElement(this.getDialogKey(e))})})),this.listenerSetter.add(n.Z)("dialog_notify_settings",(e=>et(this,void 0,void 0,(function*(){if(e.peerId===this.peerId)if("dialog"!==e._)ht.setUnreadMessagesN({dialog:e,dialogElement:this.getDialogElement(this.getDialogKey(e))});else{const e=[...this.sortedList.getAll().entries()],t=e.map((([e])=>this.managers.dialogsStorage.getForumTopic(this.peerId,e))),i=yield Promise.all(t);e.forEach((([e,t],s)=>{ht.setUnreadMessagesN({dialog:i[s],dialogElement:t.dialogElement})}))}})))),this.listenerSetter.add(n.Z)("dialog_drop",(e=>{"forumTopic"===e._&&e.peerId===this.peerId&&this.deleteDialogByKey(this.getDialogKey(e))})),this.listenerSetter.add(n.Z)("dialog_draft",(({dialog:e,drop:t,peerId:i})=>{"forumTopic"===e._&&e.peerId===this.peerId&&(t?this.deleteDialog(e):this.updateDialog(e))}))}isDialogMustBeInViewport(e){return!e.pFlags.hidden&&super.isDialogMustBeInViewport(e)}getDialogKey(e){return e.id}getDialogKeyFromElement(e){return+e.dataset.threadId}getRectFromForPlaceholder(){return()=>{const e=k.ZP.rect;return{top:56,right:e.right,bottom:0,left:this.paddingX,width:e.width-this.paddingX,height:e.height-56}}}getDialogFromElement(e){return this.managers.dialogsStorage.getForumTopic(+e.dataset.peerId,+e.dataset.threadId)}loadDialogsInner(e){return et(this,void 0,void 0,(function*(){const{indexKey:t}=this;let i=W.Z.height/64*1.25|0,s=0;const n=this.peerId,{index:a}=this.getOffsetIndex(e);if(s=a,a)if("top"===e){const e=yield this.managers.dialogsStorage.getFolderDialogs(n,!0),o=e.findIndex((e=>(0,Se.Z)(e,t)<=a)),r=Math.max(0,o-i);i=o-r,s=(0,Se.Z)(e[r],t)+1}else s=a;return this.managers.acknowledged.dialogsStorage.getDialogs({offsetIndex:s,limit:i,filterId:n,skipMigrated:!0})}))}}class lt extends rt{constructor(e){super(),this.filterId=e,this.needPlaceholderAtFirstTime=!0,this.listenerSetter.add(n.Z)("peer_typings",(({peerId:e,typings:t})=>et(this,void 0,void 0,(function*(){const[i,s]=yield Promise.all([this.managers.appMessagesManager.getDialogOnly(e),this.managers.appPeersManager.isForum(e)]);i&&!s&&(t.length?this.setTyping(i):this.unsetTyping(i))})))),this.listenerSetter.add(n.Z)("user_update",(e=>et(this,void 0,void 0,(function*(){if(!this.isActive)return;const t=e.toPeerId(),i=this.getDialogDom(t);if(!i)return;const s=yield this.managers.appUsersManager.getUserStatus(e),n="userStatusOnline"===(null==s?void 0:s._);this.setOnlineStatus(i.avatarEl,n)})))),this.listenerSetter.add(n.Z)("chat_update",(e=>et(this,void 0,void 0,(function*(){const t=e.toPeerId(!0);this.processDialogForCallStatus(t)})))),this.listenerSetter.add(n.Z)("dialog_flush",(({dialog:e})=>{this.isActive&&e&&(ht.setLastMessageN({dialog:e,setUnread:!0}),this.validateDialogForFilter(e))})),this.listenerSetter.add(n.Z)("dialogs_multiupdate",(e=>{var t;if(this.isActive)for(const[i,{dialog:s,topics:n}]of e)"dialog"===(null==s?void 0:s._)&&(this.updateDialog(s),null===(t=ht.processContact)||void 0===t||t.call(ht,i.toPeerId()),this.validateDialogForFilter(s))})),this.listenerSetter.add(n.Z)("dialog_drop",(e=>{var t;this.isActive&&"dialog"===e._&&(this.deleteDialogByKey(e.peerId),null===(t=ht.processContact)||void 0===t||t.call(ht,e.peerId))})),this.listenerSetter.add(n.Z)("dialog_unread",(({dialog:e})=>{this.isActive&&"dialog"===(null==e?void 0:e._)&&(ht.setUnreadMessagesN({dialog:e,dialogElement:this.getDialogElement(this.getDialogKey(e))}),this.validateDialogForFilter(e))})),this.listenerSetter.add(n.Z)("dialog_notify_settings",(e=>{this.isActive&&"forumTopic"!==e._&&(this.validateDialogForFilter(e),ht.setUnreadMessagesN({dialog:e,dialogElement:this.getDialogElement(this.getDialogKey(e))}))})),this.listenerSetter.add(n.Z)("dialog_draft",(({dialog:e,drop:t,peerId:i})=>{var s;this.isActive&&"forumTopic"!==e._&&(t?this.deleteDialog(e):this.updateDialog(e),null===(s=ht.processContact)||void 0===s||s.call(ht,i))})),this.listenerSetter.add(n.Z)("filter_update",(e=>et(this,void 0,void 0,(function*(){if(this.isActive&&e.id===this.filterId&&!c.DZ.has(e.id)){const e=yield this.managers.dialogsStorage.getCachedDialogs(!0);yield this.validateListForFilter();for(let t=0,i=e.length;t(0,Se.Z)(e,i)<=o)),r=Math.max(0,a-s);s=a-r,n=(0,Se.Z)(e[r],i)+1}else n=o;const r=this.managers.acknowledged.dialogsStorage.getDialogs({offsetIndex:n,limit:s,filterId:t,skipMigrated:!0}),d=yield r;return a&&(d.result=Promise.reject((0,Ue.Z)("MIDDLEWARE"))),d}))}setOnlineStatus(e,t){const i="is-online",s=e.classList.contains(i);!s&&t&&e.classList.add(i),(0,I.Z)({element:e,className:"is-visible",forwards:t,duration:250,onTransitionEnd:t?void 0:()=>{e.classList.remove(i)},useRafs:t&&!s?2:0})}generateScrollable(e,t){const i=t.id,s=new b.ZP(null,"CL",500);s.container.dataset.filterId=""+i;const a=(0,ye.Z)(t.localId),o=new st({managers:n.Z.managers,log:this.log,list:e,indexKey:a,onListLengthChange:ht.onListLengthChange});return this.scrollable=s,this.sortedList=o,this.setIndexKey(a),this.bindScrollable(),s}testDialogForFilter(e){return c.DZ.has(this.filterId)?this.filterId===e.folder_id:void 0!==(0,Se.Z)(e,this.indexKey)}isDialogMustBeInViewport(e){return!(void 0!==e.migratedTo||!this.testDialogForFilter(e))&&super.isDialogMustBeInViewport(e)}validateListForFilter(){return et(this,void 0,void 0,(function*(){this.sortedList.getAll().forEach((e=>et(this,void 0,void 0,(function*(){const t=yield n.Z.managers.appMessagesManager.getDialogOnly(e.id);this.testDialogForFilter(t)||this.deleteDialog(t)}))))}))}validateDialogForFilter(e){this.getDialogElement(e.peerId)&&(this.testDialogForFilter(e)||this.deleteDialog(e))}setCallStatus(e,t){let{callIcon:i,listEl:s}=e;if(!i&&t){const{canvas:t,startAnimation:n}=e.callIcon=i=function(e=!1){const t=document.createElement("canvas");t.width=t.height=se;const i=t.getContext("2d"),s=(se-(3*ae+2*ne))/2,n=Date.now();let a=!1;const o=()=>{if(t.isConnected)a||(a=t.isConnected);else if(a)return!1;const o=J((Date.now()-n)%1e3,0,1,1e3);i.clearRect(0,0,se,se),i.fillStyle=e&&!ee.Z.isMobile?X.Z.getProperty("primary-color"):"#fff";for(let e=0;e<3;++e){let t;t=o>=.5?e%2?2-2*o:2*(o-.5):e%2?2*o:1-2*o;let n=4+8*t;n*=ie,te(i,s+e*ae+e*ne,(se-n)/2,ae,n,oe,!0)}return!0};return{canvas:t,startAnimation:()=>{(0,Q.jt)(o),o()},setActive:t=>{e=t,o()}}}(s.classList.contains("active"));t.classList.add("dialog-group-call-icon"),s.append(t),n()}i&&(0,I.Z)({element:e.callIcon.canvas,className:"is-visible",forwards:t,duration:250,onTransitionEnd:t?void 0:()=>{e.callIcon.canvas.remove(),e.callIcon=void 0},useRafs:t?2:0})}processDialogForCallStatus(e,t){return et(this,void 0,void 0,(function*(){if(!re.Z)return;if(t||(t=this.getDialogDom(e)),!t)return;const i=yield n.Z.managers.appChatsManager.getChat(e.toChatId());this.setCallStatus(t,!(!i.pFlags.call_active||!i.pFlags.call_not_empty))}))}onChatsScroll(e="bottom"){var t;return this.scrollable.loadedAll[e]&&(null===(t=ht.loadContacts)||void 0===t||t.call(ht)),this.log("onChatsScroll",e),super.onChatsScroll(e)}toggleAvatarUnreadBadges(e,t){if(!e)return void this.sortedList.getAll().forEach((e=>{const{dom:t,dialogElement:i}=e;t.unreadAvatarBadge&&i.toggleBadgeByKey("unreadAvatarBadge",!1,!1,!1)}));const i=["unread","mention"];this.sortedList.getAll().forEach((e=>{var t;const{dom:s,dialogElement:n}=e,a=null===(t=s.unreadBadge)||void 0===t?void 0:t.textContent;if(!a||s.unreadBadge.classList.contains("backwards"))return;const o=!!s.unreadAvatarBadge;n.createUnreadAvatarBadge(),n.toggleBadgeByKey("unreadAvatarBadge",!0,o),s.unreadAvatarBadge.textContent=a;const r=s.unreadAvatarBadge.classList,d=s.unreadBadge.classList;i.forEach((e=>{r.toggle(e,d.contains(e))}))}))}getDialogKey(e){return e.peerId}getDialogKeyFromElement(e){return+e.dataset.peerId}getDialogFromElement(e){return n.Z.managers.appMessagesManager.getDialogOnly(e.dataset.peerId.toPeerId())}}class ct{constructor(){this.chatsContainer=document.getElementById("chatlist-container"),this.log=(0,S.kg)("DIALOGS",S.v9.Log|S.v9.Error|S.v9.Warn|S.v9.Debug),this.folders={menu:document.getElementById("folders-tabs"),menuScrollContainer:null,container:document.getElementById("folders-container")},this.filtersRendered={},this.lastActiveElements=new Set,this.initedListeners=!1,this.xds={},this.onTabChange=()=>(this.xd=this.xds[this.filterId],this.xd.reset(),this.xd.onChatsScroll()),this._onListLengthChange=()=>{if(!this.xd.loadedDialogsAtLeastOnce)return;if(this.checkIfPlaceholderNeeded(),this.filterId!==c.J$)return;const e=this.chatList,t=e.childElementCount,i=e.parentElement.parentElement,s=e.parentElement.nextElementSibling,n=!!s.childElementCount;if(t>=10)return void(n&&this.removeContactsPlaceholder());if(n)return;i.classList.add("with-contacts");const a=new ze.Z({name:"Contacts",noDelimiter:!0,fakeGradientDelimiter:!0});a.container.classList.add("hide"),this.managers.appUsersManager.getContactsPeerIds(void 0,void 0,"online").then((e=>{let t=!1;const i=()=>{t&&a.container.classList.toggle("hide",!s.list.childElementCount),this.updateContactsLength(!0)},s=new G.Z({avatarSize:"abitbigger",createChatListOptions:{dialogSize:48,new:!0},autonomous:!1,onListLengthChange:i,managers:this.managers});this.loadContacts=()=>{const t=W.Z.height/60|0;(0,Re.Z)(e.splice(0,t),this.verifyPeerIdForContacts).then((e=>{e.forEach((e=>{s.add(e)}))})),e.length||(this.loadContacts=void 0)},this.loadContacts(),this.processContact=e=>et(this,void 0,void 0,(function*(){if(e.isAnyChat())return;const t=yield this.verifyPeerIdForContacts(e),i=s.has(e);!i&&t?s.add(e):i&&!t&&s.delete(e)}));const n=s.list;n.classList.add("chatlist-new"),this.setListClickListener(n),a.content.append(n),t=!0,i()})),s.append(a.container)},this.verifyPeerIdForContacts=e=>et(this,void 0,void 0,(function*(){const[t,i]=yield Promise.all([this.managers.appPeersManager.isContact(e),this.managers.appMessagesManager.getDialogOnly(e)]);return t&&!i}))}start(){const e=this.managers=(0,we.Z)();this.contextMenu=new m(e),this.stateMiddlewareHelper=(0,Oe.k)(),this.folders.menuScrollContainer=this.folders.menu.parentElement,this.onListLengthChange=(0,Y.Z)(this._onListLengthChange,100,!1,!0);const t=document.createElement("div");t.classList.add("connection-status-bottom"),t.append(this.folders.container),this.forumsTabs=new Map,this.forumsSlider=document.createElement("div"),this.forumsSlider.classList.add("topics-slider"),this.chatsContainer.parentElement.parentElement.append(this.forumsSlider),V.Z&&(0,K.Z)({element:this.folders.container,onSwipe:e=>{const t=s.prevId();s(e<0?t+1:t-1)},verifyTouchTarget:()=>!this.forumTab}),this.allChatsIntlElement=new o.ZP.IntlElement({key:"FilterAllChatsShort"}),n.Z.addEventListener("premium_toggle",(e=>et(this,void 0,void 0,(function*(){e||(yield this.managers.filtersStorage.isFilterIdAvailable(this.filterId))||s((0,Ne.Z)(this.filtersRendered[c.J$].menu),!1)})))),n.Z.addEventListener("state_cleared",(()=>{const e=c.DZ.has(this.filterId);De.Z.getState().then((t=>et(this,void 0,void 0,(function*(){this.xd.loadedDialogsAtLeastOnce=!1,this.showFiltersPromise=void 0,e&&(this.xd.clear(),this.onTabChange()),this.onStateLoaded(t)}))))})),this.setFilterId(c.J$,c.J$),this.addFilter({id:c.J$,title:"",localId:c.J$});const i=new b.v7(this.folders.menuScrollContainer);t.prepend(this.folders.menuScrollContainer);const s=this.selectTab=(0,g.X)(this.folders.menu,this.folders.container,((e,t)=>et(this,void 0,void 0,(function*(){const i=e;if(e=+t.dataset.filterId||c.J$,-1!==this.filterId&&!c.DZ.has(e)&&!(yield this.managers.filtersStorage.isFilterIdAvailable(e)))return!1;const n=this.filterId;if(w.IS_MOBILE_SAFARI||(i?this.filtersNavigationItem||(this.filtersNavigationItem={type:"filters",onPop:()=>{s(0),this.filtersNavigationItem=void 0}},de.Z.spliceItems(1,0,this.filtersNavigationItem)):this.filtersNavigationItem&&(de.Z.removeItem(this.filtersNavigationItem),this.filtersNavigationItem=void 0)),n===e)return;this.xds[e].clear();const a=this.setFilterIdAndChangeTab(e).then((({cached:e,renderPromise:t})=>{if(e)return t}));return-1!==n?a:void 0}))),(()=>{for(const e in this.xds)+e!==this.filterId&&this.xds[e].clear()}),void 0,i);De.Z.getState().then((e=>(le.Z.setPlaybackParams(e.playbackParams),le.Z.addEventListener("playbackParams",(e=>{this.managers.appStateManager.pushToState("playbackParams",e)})),this.onStateLoaded(e)))),ee.Z.addEventListener("resize",(()=>{this.changeFiltersAllChatsKey()})),new U(this.managers,this.chatsContainer),this.chatsContainer.append(t),setTimeout((()=>{Z.Z.loadLottieWorkers()}),200),p.Z.MANAGERS=n.Z.managers=e,Ee.Z.construct(e),k.ZP.construct(e),he.ZP.construct(e),Pe.ZP.construct(e),Ze.Z.construct(e),C.ZP.construct(e),this.xd=this.xds[this.filterId]}get chatList(){return this.xd.sortedList.list}setFilterId(e,t){this.filterId=e}setFilterIdAndChangeTab(e){return et(this,void 0,void 0,(function*(){return this.filterId=e,this.onTabChange()}))}initListeners(){n.Z.addEventListener("dialog_flush",(({dialog:e})=>{e&&this.setFiltersUnreadCount()})),n.Z.addEventListener("folder_unread",(e=>et(this,void 0,void 0,(function*(){if(e.id<0){const t=this.xd.getDialogElement(e.id);if(!t)return;this.setUnreadMessagesN({dialog:yield this.managers.dialogsStorage.getDialogOnly(e.id),dialogElement:t})}else this.setFilterUnreadCount(e.id)})))),n.Z.addEventListener("contacts_update",(e=>{var t;null===(t=this.processContact)||void 0===t||t.call(this,e.toPeerId())})),C.ZP.addEventListener("peer_changed",(({peerId:e,threadId:t,isForum:i})=>{const s={peerId:e,threadId:i?t:void 0};for(const e of this.lastActiveElements){const t=+e.dataset.threadId||void 0,i=e.dataset.peerId.toPeerId();C.ZP.isSamePeer({peerId:i,threadId:t},s)||this.setDialogActive(e,!1)}Array.from(document.querySelectorAll(`[data-autonomous="0"] .chatlist-chat[data-peer-id="${e}"]`)).forEach((t=>{const i=+t.dataset.threadId||void 0;C.ZP.isSamePeer({peerId:e,threadId:i},s)&&this.setDialogActive(t,!0)}))})),n.Z.addEventListener("filter_update",(e=>et(this,void 0,void 0,(function*(){if(c.DZ.has(e.id))return;if(!this.filtersRendered[e.id])return void this.addFilter(e);const t=this.filtersRendered[e.id];(0,ce.Z)(t.title,(0,pe.Z)(e.title))})))),n.Z.addEventListener("filter_delete",(e=>{const t=this.filtersRendered[e.id];t&&(t.container.remove(),t.menu.remove(),this.xds[e.id].destroy(),delete this.xds[e.id],delete this.filtersRendered[e.id],this.onFiltersLengthChange(),this.filterId===e.id&&this.selectTab(0,!1))})),n.Z.addEventListener("filter_order",(e=>et(this,void 0,void 0,(function*(){e=e.slice(),(0,Be.Z)(e,c.Zi);const t=this.folders.menu,i=yield Promise.all(e.map((e=>et(this,void 0,void 0,(function*(){const[t,i]=yield Promise.all([this.managers.dialogsStorage.getDialogIndexKeyByFilterId(e),this.managers.filtersStorage.getFilter(e)]);return{indexKey:t,filter:i}})))));e.forEach(((e,s)=>{const{indexKey:n,filter:a}=i[s],o=this.filtersRendered[e];this.xds[e].setIndexKey(n),(0,A.Z)(o.menu,t,a.localId),(0,A.Z)(o.container,this.folders.container,a.localId)}))}))))}setDialogActive(e,t){var i;const s=e.dialogDom;e.classList.toggle("active",t),e.classList.toggle("is-forum-open",(null===(i=this.forumTab)||void 0===i?void 0:i.peerId)===e.dataset.peerId.toPeerId()&&!e.dataset.threadId),t?this.lastActiveElements.add(e):this.lastActiveElements.delete(e),(null==s?void 0:s.callIcon)&&s.callIcon.setActive(t)}onStateLoaded(e){return et(this,void 0,void 0,(function*(){this.stateMiddlewareHelper.clean();const t=this.stateMiddlewareHelper.get(),i=e.filtersArr,s=i.length>c.DZ.size,n=e=>{for(const t of e)this.addFilter(t)};let a;s?n(i):a=this.managers.filtersStorage.getDialogFilters().then(n),this.doNotRenderChatList=!0;const o=this.xd.onChatsScroll(),r=(0,Ie.Z)(t);try{yield r(o)}catch(e){}s||this.selectTab(0,!1),a&&(yield r(a)),this.doNotRenderChatList=void 0,this.filterId=-1,this.selectTab(0,!1),this.initedListeners||(this.initListeners(),this.initedListeners=!0),s&&this.showFiltersPromise&&(yield r(this.showFiltersPromise)),this.managers.appNotificationsManager.getNotifyPeerTypeSettings(),yield(yield r(o)).renderPromise.catch(Me.Z),this.managers.appMessagesManager.fillConversations()}))}setFilterUnreadCount(e){var t;return et(this,void 0,void 0,(function*(){const i=null===(t=this.filtersRendered[e])||void 0===t?void 0:t.unread;if(!i)return;const{unreadUnmutedCount:s,unreadCount:n}=yield this.managers.dialogsStorage.getFolderUnreadCount(e);i.classList.toggle("badge-gray",!s);const a=e===c.J$?s:n;i.innerText=a?""+a:""}))}setFiltersUnreadCount(){for(const e in this.filtersRendered)this.setFilterUnreadCount(+e)}l(e){const t=this.createChatList(),i=this.xds[e.id]=new lt(e.id),s=i.generateScrollable(t,e);return this.setListClickListener(t,null,!0),{ul:t,xd:i,scrollable:s}}addFilter(e){if(e.id===c.Zi)return;const t=this.folders.menu,i=this.filtersRendered[e.id];if(i)return(0,A.Z)(i.menu,t,e.localId),void(0,A.Z)(i.container,this.folders.container,e.localId);const s=document.createElement("div");s.classList.add("menu-horizontal-div-item");const n=document.createElement("span"),a=document.createElement("span");a.classList.add("text-super"),e.id===c.J$?a.append(this.allChatsIntlElement.element):(0,ce.Z)(a,(0,pe.Z)(e.title));const o=document.createElement("div");o.classList.add("badge","badge-20","badge-primary");const r=document.createElement("i");n.append(a,o,r),(0,v.Z)(s),s.append(n),s.dataset.filterId=""+e.id,(0,A.Z)(s,t,e.localId);const{ul:d,scrollable:l}=this.l(e);l.container.classList.add("tabs-tab","chatlist-parts");const h=document.createElement("div");h.classList.add("chatlist-top");const u=document.createElement("div");u.classList.add("chatlist-bottom"),h.append(d),l.container.append(h,u);const p=l.container;(0,A.Z)(l.container,this.folders.container,e.localId),this.filtersRendered[e.id]={menu:s,container:p,unread:o,title:a},this.onFiltersLengthChange()}changeFiltersAllChatsKey(){const e=this.folders.menuScrollContainer.firstElementChild,t=e.scrollWidth>e.clientWidth?"FilterAllChatsShort":"FilterAllChats";this.allChatsIntlElement.compareAndUpdate({key:t})}onFiltersLengthChange(){let e=this.showFiltersPromise;return null!=e?e:e=this.showFiltersPromise=(0,Fe.Z)(0).then((()=>{if(this.showFiltersPromise!==e)return;const t=Object.keys(this.filtersRendered).length>1,i=!this.folders.menuScrollContainer.classList.contains("hide");t!==i&&(this.folders.menuScrollContainer.classList.toggle("hide",!t),t&&!i&&this.setFiltersUnreadCount(),this.chatsContainer.classList.toggle("has-filters",t)),this.changeFiltersAllChatsKey(),this.showFiltersPromise=void 0}))}generateEmptyPlaceholder(e){const t="empty-placeholder",i=document.createElement("div");i.classList.add(t,t+"-"+e.classNameType);const s=document.createElement("div");s.classList.add(t+"-header"),(0,o.$d)(s,e.title);const n=document.createElement("div");return n.classList.add(t+"-subtitle"),e.subtitle&&(0,o.$d)(n,e.subtitle,e.subtitleArgs),i.append(s,n),{container:i,header:s,subtitle:n}}checkIfPlaceholderNeeded(){if(this.filterId===c.Zi)return;const e=this.chatList,t=e.parentElement;let i=Array.from(t.children).find((e=>e.matches(".empty-placeholder")));const s=this.xd.scrollable.loadedAll.bottom&&!e.childElementCount;if(s&&i)return;if(!s)return void(i&&(t.classList.remove("with-placeholder"),i.remove()));let n,a;if(this.filterId){n=this.generateEmptyPlaceholder({title:"FilterNoChatsToDisplay",subtitle:"FilterNoChatsToDisplayInfo",classNameType:a="folder"}),i=n.container;const e=document.createElement("div"),t="📂",s=128;(0,be.Z)({div:e,emoji:t,width:s,height:s}),i.prepend(e);const o=(0,L.Z)("btn-primary btn-color-primary btn-control tgico",{text:"FilterHeaderEdit",icon:"settings"});(0,x.fc)(o,(()=>et(this,void 0,void 0,(function*(){const e=k.ZP.createTab(T.Z);e.setInitFilter(yield this.managers.filtersStorage.getFilter(this.filterId)),e.open()})))),i.append(o)}else{n=this.generateEmptyPlaceholder({title:"ChatList.Main.EmptyPlaceholder.Title",classNameType:a="dialogs"}),i=n.container;const e=document.createElement("img");e.classList.add("empty-placeholder-dialogs-icon"),this.emptyDialogsPlaceholderSubtitle=new o.ZP.IntlElement({element:n.subtitle}),Promise.all([this.updateContactsLength(!1),(0,z.cj)(e,"assets/img/EmptyChats.svg"),(0,j.AD)()]).then((([e])=>{i.classList.add("visible"),t.classList.toggle("has-contacts",!!e)})),i.prepend(e)}t.append(i),t.classList.add("with-placeholder"),t.dataset.placeholderType=a}updateContactsLength(e){var t;return null!==(t=this.updateContactsLengthPromise)&&void 0!==t?t:this.updateContactsLengthPromise=this.managers.appUsersManager.getContacts().then((t=>{const i=this.emptyDialogsPlaceholderSubtitle;if(i){let e,s;t.length?(e="ChatList.Main.EmptyPlaceholder.Subtitle",s=[(0,o.ag)("Contacts.Count",[t.length])]):(e="ChatList.Main.EmptyPlaceholder.SubtitleNoContacts",s=[]),i.compareAndUpdate({key:e,args:s})}return e&&this.chatList.parentElement.classList.toggle("has-contacts",!!t.length),this.updateContactsLengthPromise=void 0,t.length}))}removeContactsPlaceholder(){const e=this.chatList,t=e.parentElement.parentElement,i=e.parentElement.nextElementSibling;t.classList.remove("with-contacts"),i.replaceChildren(),this.loadContacts=void 0,this.processContact=void 0}toggleForumTab(e,t=this.forumTab){return et(this,void 0,void 0,(function*(){if(!t&&!e)return;if(t){const e=this.xd.getDialogElement(t.peerId);e&&e.dom.listEl.classList.remove("is-forum-open")}t===e&&(e=void 0),null==t||t.toggle(!1);const i=null==e?void 0:e.toggle(!0);if(t===this.forumTab&&(this.forumTab=e),e){const t=this.xd.getDialogElement(e.peerId);t&&t.dom.listEl.classList.add("is-forum-open"),C.ZP.selectTab(C.oo.CHATLIST)}i&&(yield i),e&&!this.forumNavigationItem?(this.forumNavigationItem={type:"forum",onPop:()=>{this.forumNavigationItem=void 0,this.toggleForumTab()}},de.Z.pushItem(this.forumNavigationItem)):!e&&this.forumNavigationItem&&(de.Z.removeItem(this.forumNavigationItem),this.forumNavigationItem=void 0);const s=!!e,n=i?2:void 0;this.xd.toggleAvatarUnreadBadges(s,n);const a=(0,Ce.Z)();(0,I.Z)({element:this.forumsSlider.parentElement,className:"is-forum-visible",duration:300,forwards:s,useRafs:n,onTransitionEnd:()=>{a.resolve()}}),(0,Ye.YW)(a,300).then((()=>a.resolve()))}))}toggleForumTabByPeerId(e,t){const{managers:i}=this,s=k.ZP.getHistory(),n=s[s.length-1];let a;if(n)return n instanceof at&&n.peerId===e&&t?void(0,Qe.Z)(n.container):(a=k.ZP.createTab(at),void a.open({peerId:e,managers:i}));a=this.forumsTabs.get(e);const o=this.forumTab&&this.forumTab===a;if(null!=t||(t=!o),t!==o)return t&&!a&&(a=new at(void 0),a.init({peerId:e,managers:i}),this.forumsTabs.set(e,a),this.forumsSlider.append(a.container),a.managers=this.managers,a.eventListener.addEventListener("destroy",(()=>{this.forumsTabs.delete(e)}))),this.toggleForumTab(a);t&&(0,Qe.Z)(a.container)}setListClickListener(e,t,i=!1,s=!1,n=!1){let a;const o=(n?C.ZP.setInnerPeer:C.ZP.setPeer).bind(C.ZP);e.dataset.autonomous=""+ +s,e.addEventListener("mousedown",(i=>{if(0!==i.button)return;this.log("dialogs click list");const n=i.target,d=(0,r.Z)(n,tt);if(!d)return;const l=d.dataset.peerId.toPeerId(),h=+d.dataset.mid||void 0,u=+d.dataset.threadId||void 0;if(null==t||t(),!d.querySelector(".is-forum")||i.shiftKey||h){if(i.ctrlKey||i.metaKey)return window.open(d.href||"#"+l,"_blank"),void(0,N.Z)(i);s&&(a&&!(a===d)&&a.classList.remove("active"),d&&(d.classList.add("active"),a=d,this.lastActiveElements.add(d))),u&&!h||this.xd.sortedList.list!==e||this.xd===this.xds[c.Zi]||this.toggleForumTab(),o({peerId:l,lastMsgId:h,threadId:u})}else this.toggleForumTabByPeerId(l)}),{capture:!0}),e.addEventListener("click",(e=>{0===e.button&&(0,N.Z)(e)}),{capture:!0}),i&&this.contextMenu.attach(e)}createChatList(e={}){const t=document.createElement("ul");return t.classList.add("chatlist"),e.new&&t.classList.add("chatlist-new"),e.dialogSize&&t.classList.add("chatlist-"+e.dialogSize),t}setLastMessageN(e){return this.setLastMessage(e).catch((e=>{"MIDDLEWARE"!==(null==e?void 0:e.type)&&this.log.error("set last message error",e)}))}setLastMessage({dialog:e,lastMessage:t,dialogElement:i,highlightWord:s,isBatch:a=!1,setUnread:r=!1}){var d,l;return et(this,void 0,void 0,(function*(){if(!i&&!(i=this.xd.getDialogElement(e.peerId)))return;const{dom:c}=i,{peerId:h}=e,{deferred:u,middleware:p}=it(c,"setLastMessagePromise");let f;if(!t&&("draftMessage"!==(null===(d=e.draft)||void 0===d?void 0:d._)||h.isAnyChat()&&"forumTopic"!==e._&&(yield this.managers.appPeersManager.isForum(h))||(f=e.draft),(null==(t=e.topMessage)?void 0:t.mid)!==e.top_message)){const i=this.managers.appMessagesManager.getMessageByPeer(h,e.top_message);t=yield p(i)}const m=null!==r&&!r;if(m||this.setUnreadMessagesN({dialog:e,dialogElement:i,isBatch:a,setLastMessagePromise:u}),!t)return c.lastMessageSpan.replaceChildren(),c.lastTimeSpan.replaceChildren(),delete c.listEl.dataset.mid,void u.resolve();const g=t&&(0,me.Z)(t);{let e;const i=[];if(t&&!f&&!g){const s=(0,ge.Z)(t,!0),n=new Set(["video","gif","round"]);if(s&&("photo"===s._||n.has(s.type))){const a=(0,ue.Z)(s,20,20);if("photoSizeEmpty"!==a._&&(e=document.createElement("div"),e.classList.add("dialog-subtitle-media"),"round"===s.type&&e.classList.add("is-round"),i.push((0,M.Z)({photo:s,message:t,container:e,withoutPreloader:!0,size:a}).then((()=>e))),n.has(s.type))){const t=document.createElement("span");t.classList.add("tgico-play"),e.append(t)}}}if(f){const e=document.createElement("span");e.classList.add("danger"),e.append((0,o.ag)("Draft"),": "),i.unshift(e)}else if(h.isAnyChat()&&h!==t.fromId&&!t.action){const e=document.createElement("span");if(e.classList.add("primary-text"),t.fromId===n.Z.myId)e.append((0,o.ag)("FromYou")),i.unshift(e);else{const s=p((0,Le.Z)({peerId:t.fromId,onlyFirstName:!0})).then((t=>(e.prepend(t),e)),Me.Z);i.unshift(s)}e.append(": ")}const a=!!e&&!!(null==t?void 0:t.message);let r;if(r=s&&t.message?yield p((0,fe.Z)({message:t,highlightWord:s,withoutMediaType:a})):f?yield p((0,fe.Z)({message:f})):t?yield p((0,fe.Z)({message:t,withoutMediaType:a})):document.createDocumentFragment(),i.length){const e=yield p(Promise.all(i));r.prepend(...e)}(0,_.Z)(c.lastMessageSpan,r)}if(t||f){const e=f?Math.max(f.date,t.date||0):t.date;(0,_.Z)(c.lastTimeSpan,(0,y.zM)(new Date(1e3*e)))}else c.lastTimeSpan.textContent="";if(m){c.listEl.dataset.mid=""+t.mid;const e=t.reply_to;(null===(l=null==e?void 0:e.pFlags)||void 0===l?void 0:l.forum_topic)&&(c.listEl.dataset.threadId=""+(0,We.Z)(t))}u.resolve()}))}setUnreadMessagesN(e){return this.setUnreadMessages(e).catch((()=>{}))}setUnreadMessages({dialog:e,dialogElement:t,isBatch:i=!1,setLastMessagePromise:s}){var a;return et(this,void 0,void 0,(function*(){const{dom:o}=t;if(!o)return;const r="forumTopic"===e._,{deferred:d,middleware:l}=it(o,"setUnreadMessagePromise"),{peerId:h}=e,u=Promise.all([this.managers.appNotificationsManager.isPeerLocalMuted({peerId:h,respectType:!0,threadId:r?e.id:void 0}),"draftMessage"!==(null===(a=e.draft)||void 0===a?void 0:a._)?this.managers.appMessagesManager.getMessageByPeer(h,e.top_message):void 0,r?!!e.pFlags.pinned:this.managers.dialogsStorage.isDialogPinned(h,this.filterId),this.managers.appMessagesManager.isDialogUnread(e),h.isAnyChat()&&!r?this.managers.acknowledged.dialogsStorage.getForumUnreadCount(h).then((i=>i.cached?i.result:(i.result.then((()=>{this.setUnreadMessagesN({dialog:e,dialogElement:t})})),{count:0,hasUnmuted:!1}))).catch((()=>{})):void 0]);let[p,f,m,g,v]=yield l(u);const b=o.listEl.classList.contains("is-muted"),{count:y,hasUnmuted:w}=v||{};let S;f&&f.pFlags.out&&f.peerId!==n.Z.myId&&(S=f);const C=null!=y?y:e.unread_count;void 0!==y&&(g=!!C),r&&!g&&(g=!(0,Je.Z)(e.read_inbox_max_id));const L=m||g,E=this.xd!==this.xds[c.Zi]&&!r&&!!this.forumTab&&this.xd.getDialogElement(h)===t&&g;if(s)try{yield l(s)}catch(e){return}const P=i?0:250;o.listEl.classList.toggle("no-unmuted-topic",!p&&void 0!==w&&!w),p!==b&&(0,I.Z)({element:o.listEl,className:"is-muted",forwards:p,duration:P}),function(e,t,i){let s;if("string"==typeof t?s=t:(null==t?void 0:t.pFlags.out)&&(s=t.error?"sendingerror":t.pFlags.is_outgoing?"sending":t.pFlags.unread?"check":"checks"),!s)return void(e.textContent="");const n="tgico-"+s,a=e.lastElementChild;if(a&&a.classList.contains(n))return;const o=document.createElement("i");o.classList.add("sending-status-icon",n),e.append(o),a&&a.remove()}(o.statusSpan,r&&e.pFlags.closed?"premium_lock":S);const Z=!!o.unreadBadge;L&&t.createUnreadBadge();const M=!!o.unreadAvatarBadge;E&&t.createUnreadAvatarBadge();const T=e.unread_mentions_count&&(e.unread_mentions_count>1||e.unread_count>1),k=!!o.mentionsBadge;if(T&&t.createMentionsBadge(),[["unreadBadge",L,Z],["unreadAvatarBadge",E,M],["mentionsBadge",T,k]].forEach((([e,s,n])=>{o[e]&&t.toggleBadgeByKey(e,s,n,i)})),!L)return void d.resolve();m?o.unreadBadge.classList.add("tgico-chatspinned","tgico"):o.unreadBadge&&o.unreadBadge.classList.remove("tgico-chatspinned","tgico");let x,A=!0,_=!1;if(e.unread_mentions_count&&1===C?(x="@",_=!0):g?x=""+(C?(0,$e.Z)(C,1):" "):(x="",A=!1),r){const e=g&&" "===x;o.unreadBadge.classList.toggle("not-visited",e)}[[o.unreadBadge,x],[o.unreadAvatarBadge,x||void 0]].filter(Boolean).forEach((([e,t])=>{void 0!==t&&(e.innerText=x),e.classList.toggle("unread",A),e.classList.toggle("mention",_)})),d.resolve()}))}getDialog(e,t){return et(this,void 0,void 0,(function*(){if("object"!=typeof e){let i;if(t){if(i=yield this.managers.dialogsStorage.getForumTopic(e,t),!i)return{peerId:e||c.NM,pFlags:{}}}else if(i=yield this.managers.appMessagesManager.getDialogOnly(e),!i){const t=e||c.NM;return{peerId:t,peer:yield this.managers.appPeersManager.getOutputPeer(t),pFlags:{}}}return i}return e}))}addListDialog(e){var t;e.autonomous=!1;const i=this.addDialogNew(e);if(i){const{peerId:s}=e,a=this.getDialog(s,e.threadId).then((t=>{const a=[],o=s.isUser();return o||"dialog"!==t._||a.push(this.xd.processDialogForCallStatus(s,i.dom)),s!==n.Z.myId&&o&&a.push(this.managers.appUsersManager.getUserStatus(s.toUserId()).then((e=>{"userStatusOnline"===(null==e?void 0:e._)&&this.xd.setOnlineStatus(i.dom.avatarEl,!0)}))),a.push(this.setLastMessageN({dialog:t,dialogElement:i,isBatch:e.isBatch,setUnread:!0})),Promise.all(a)}));null===(t=e.loadPromises)||void 0===t||t.push(a)}return i}addDialogAndSetLastMessage(e){const{peerId:t,message:i,query:s}=e,n=this.addDialogNew(Object.assign(Object.assign(Object.assign({},e),(0,ve.Z)(i)),{peerId:t}));return this.setLastMessageN({dialog:{_:"dialog",peerId:t},lastMessage:i,dialogElement:n,highlightWord:s}),i.peerId!==t&&(n.dom.listEl.dataset.peerId=""+i.peerId),n}addDialogNew(e){const t=new nt(Object.assign({autonomous:!!e.container,avatarSize:"bigger"},e));if(e.container){const i=e.append?"prepend":"append";e.container[i](t.container)}return t}}const ht=new ct;E.GO.appDialogsManager=ht;const ut=ht},2312:(e,t,i)=>{"use strict";i.d(t,{Z:()=>v});var s=i(3725),n=i(2202),a=i(3512),o=i(410),r=i(319),d=i(1243),l=i(7086),c=i(1655),h=i(5471),u=i(8801),p=i(6658),f=i(7667),m=i(3855);const g=new class{constructor(){this.downloads={},this.progress={}}construct(e){this.managers=e,a.Z.addEventListener("download_progress",(e=>{var t;const i=this.downloads[e.fileName];(null===(t=null==i?void 0:i.main)||void 0===t?void 0:t.notifyAll)&&(this.progress[e.fileName]=e,i.main.notifyAll(e))}))}getNewDeferred(e,t){const i=(0,s.Z)();let n=this.downloads[e];if(n){const e=n.main;["cancel","addNotifyListener","notify","notifyAll"].forEach((t=>{e[t]&&(i[t]=e[t].bind(e))}))}else n=this.downloads[e]={main:i},i.cancel=()=>{const t=(0,h.Z)("DOWNLOAD_CANCELED");this.managers.apiFileManager.cancelDownload(e),i.reject(t),i.cancel=r.Z},i.catch((()=>{this.clearDownload(e,t)})).finally((()=>{delete this.progress[e]}));return"disc"===t&&i.catch(r.Z).finally((()=>{this.clearDownload(e,t)})),n[t]=i}getNewDeferredForUpload(e,t){const i=this.getNewDeferred(e);return t.then(i.resolve,i.reject),i.finally((()=>{this.clearDownload(e)})),i}clearDownload(e,t){const i=this.downloads[e];if(!i)return;delete i[t];const s=Object.keys(i).length;(!s||i.main&&1===s)&&delete this.downloads[e]}getUpload(e){let t=this.getDownload(e);return t||(t=this.getNewDeferred(e),this.managers.appMessagesManager.getUploadPromise(e).then(t.resolve,t.reject),t)}d(e,t,i){let s=this.getDownload(e,i);return s||(s=this.getNewDeferred(e,i),t().then(s.resolve,s.reject),s)}download(e){const t=(0,l.Z)(e);return this.d(t,(()=>this.managers.apiFileManager.download(e)),"blob")}downloadMedia(e,t="blob",i){const{downloadOptions:s,fileName:n}=(0,d.Z)(e);return this.d(n,(()=>{let s;return s="url"===t?this.managers.apiFileManager.downloadMediaURL:"void"===t?this.managers.apiFileManager.downloadMediaVoid:this.managers.apiFileManager.downloadMedia,i?i.then((()=>s(e))):s(e)}),t)}downloadMediaURL(e){return this.downloadMedia(e,"url")}downloadMediaVoid(e){return this.downloadMedia(e,"void")}upload(e,t,i){return t||(t=(0,n.Z)(e)),i||(i=this.managers.apiFileManager.upload({file:e,fileName:t})),this.getNewDeferredForUpload(t,i)}getDownload(e,t){const i=this.downloads[e];return i&&i[t]}downloadToDisc(e,t){const i=e.media,s="document"===i._;s||e.thumb||(e.thumb=i.sizes.slice().pop());const n=""+(2147483647*Math.random()|0),a=`download/${n}`;e.downloadId=n;const o=m.Z.pingServiceWorkerWithIframe(),d=this.downloadMedia(e,"disc",o);if(t)return d;const l=document.createElement("iframe");l.hidden=!0,o.then((()=>{l.src=a,document.body.append(l)}));let h,g=!1;const v=()=>{g||(g=!0,h=l,(0,c.Z)(d.listeners,v))};return d.addNotifyListener(v),d.then((t=>{if(!t)return;const n=URL.createObjectURL(t),a=s?(0,p.Z)(i):(0,f.Z)(i,e.thumb),o=e.media.file_name||(0,u.P)(a.location);!function(e,t,i){const s=document.createElement("a");s.href=e,s.download=t,s.target="_blank",s.style.position="absolute",s.style.top="1px",s.style.left="1px",document.body.append(s);try{const e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),s.dispatchEvent(e)}catch(t){console.error("Download click error",t);try{s.click()}catch(t){window.open(e,"_blank")}}setTimeout((()=>{s.remove(),i&&i()}),100)}(n,a.fileName||o,(()=>{URL.revokeObjectURL(n)}))})).catch(r.Z).finally((()=>{g||v(),setTimeout((()=>{null==h||h.remove()}),1e3)})),d}};o.GO&&(o.GO.appDownloadManager=g);const v=g},7030:(e,t,i)=>{"use strict";i.d(t,{oo:()=>ys,ZP:()=>Ls});var s=i(5814),n=i(7856),a=i(4332),o=i(4755),r=i(5003),d=i(3512),l=i(3241),c=i(5729),h=i(4499),u=i(8843),p=i(6054),f=i(4762),m=i(9331),g=i(4494),v=i(2230),b=i(5322),y=i(3013),w=i(4561),S=i(1405),C=i(3910),L=i(2738),I=i(5953);const E="pinned-container";class P{constructor(e){this.floating=!1,(0,I.Z)(this,e);const{divAndCaption:t,className:i}=this;t.container.classList.add(E,"hide"),t.title.classList.add(E+"-title"),t.subtitle.classList.add(E+"-subtitle"),t.content.classList.add(E+"-content"),this.btnClose=document.createElement("button"),this.btnClose.classList.add(E+"-close",`pinned-${i}-close`,"btn-icon","tgico-close"),this.wrapper=document.createElement("div"),this.wrapper.classList.add(E+"-wrapper"),(0,S.Z)(this.wrapper),this.wrapperUtils=document.createElement("div"),this.wrapperUtils.classList.add(E+"-wrapper-utils"),this.wrapperUtils.append(this.btnClose),this.wrapper.append(...Array.from(t.container.children),this.wrapperUtils),t.container.append(this.wrapper),this.attachOnCloseEvent(this.btnClose)}attachOnCloseEvent(e){(0,L.fc)(e,(e=>{(0,C.Z)(e),((this.onClose?this.onClose():null)||Promise.resolve(!0)).then((e=>{e&&this.toggle(!0)}))}),{listenerSetter:this.listenerSetter})}toggle(e){const t=this.divAndCaption.container.classList.contains("hide");if(void 0===e)e=!t;else if(e===t)return;const i=(this.floating||o.Z.isMobile)&&!e;this.divAndCaption.container.classList.toggle("is-floating",i),this.divAndCaption.container.classList.toggle("hide",e),this.topbar.container.classList.toggle("is-pinned-floating",i),this.topbar.container.classList.toggle(`is-pinned-${this.className}-shown`,!e),this.topbar.setFloating(),this.topbar.setUtilsWidth()}isVisible(){return!this.divAndCaption.container.classList.contains("hide")}isFloating(){return this.divAndCaption.container.classList.contains("is-floating")}fill(e,t,i){this.divAndCaption.container.dataset.peerId=""+i.peerId,this.divAndCaption.container.dataset.mid=""+i.mid,this.divAndCaption.fill(e,t,i),this.topbar.setUtilsWidth()}}var Z=i(5565),M=i(8842),T=i(2325),k=i(632),x=i(7207),A=i(8427),_=i(8115);class F extends P{constructor(e,t,i){super({topbar:e,chat:t,listenerSetter:e.listenerSetter,className:"audio",divAndCaption:new w.Z("pinned-audio",((e,t)=>{(0,Z.Z)(this.divAndCaption.title,e),(0,Z.Z)(this.divAndCaption.subtitle,t)})),onClose:()=>{y.Z.stop(void 0,!0)},floating:!0}),this.topbar=e,this.chat=t,this.managers=i,this.onPlaybackParams=e=>{this.fasterEl.classList.toggle("active",e.playbackRate>1),this.repeatEl.classList.remove("tgico-audio_repeat","tgico-audio_repeat_single"),this.repeatEl.classList.add(e.loop?"tgico-audio_repeat_single":"tgico-audio_repeat"),this.repeatEl.classList.toggle("active",e.loop||e.round)},this.onPause=()=>{this.toggleEl.classList.remove("flip-icon")},this.onStop=()=>{this.toggle(!0)},this.onMediaPlay=({doc:e,message:t,media:i,playbackParams:s})=>{var n,a;let o,r;const d="voice"!==e.type&&"round"!==e.type;if(d){const t=e.attributes.find((e=>"documentAttributeAudio"===e._));o=(0,_.Z)(null!==(a=null==t?void 0:t.title)&&void 0!==a?a:e.file_name),r=(null==t?void 0:t.performer)?(0,_.Z)(t.performer):(0,T.ag)("AudioUnknownArtist")}else o=new M.Z({peerId:t.fromId,fromName:null===(n=t.fwd_from)||void 0===n?void 0:n.from_name}).element,r=(0,k.OD)(t.date);this.fasterEl.classList.toggle("hide",d),this.repeatEl.classList.toggle("hide",!d),this.onPlaybackParams(s),this.volumeSelector.setVolume(),this.progressLine.setMedia({media:i,duration:e.duration}),this.fill(o,r,t),this.toggleEl.classList.toggle("flip-icon",!i.paused),this.toggle(!1)},this.divAndCaption.border.remove();const s=(0,v.Z)("fast_rewind active",{noRipple:!0}),n=(0,v.Z)("fast_forward active",{noRipple:!0}),a=(e,t)=>{(0,L.fc)(e,(e=>{(0,C.Z)(e),t()}),{listenerSetter:this.topbar.listenerSetter})};a(s,(()=>{y.Z.previous()})),a(n,(()=>{y.Z.next()})),this.toggleEl=(0,v.Z)("",{noRipple:!0}),this.toggleEl.classList.add("active","pinned-audio-ico","tgico"),a(this.toggleEl,(()=>{y.Z.toggle()})),this.wrapper.prepend(this.wrapper.firstElementChild,s,this.toggleEl,n),this.volumeSelector=new A.Z(this.listenerSetter,!0);const o=document.createElement("div");o.classList.add("progress-line-container"),o.append(this.volumeSelector.container);const r=document.createElement("div");r.classList.add("pinned-audio-volume-tunnel"),this.volumeSelector.btn.classList.add("pinned-audio-volume","active"),this.volumeSelector.btn.prepend(r),this.volumeSelector.btn.append(o),this.repeatEl=(0,v.Z)("audio_repeat",{noRipple:!0}),a(this.repeatEl,(()=>{const e=y.Z.getPlaybackParams();e.round?e.loop?(y.Z.round=!1,y.Z.loop=!1):y.Z.loop=!y.Z.loop:y.Z.round=!0}));const d=this.fasterEl=(0,v.Z)("playback_2x",{noRipple:!0});a(d,(()=>{y.Z.playbackRate=d.classList.contains("active")?1:1.75})),this.wrapperUtils.prepend(this.volumeSelector.btn,d,this.repeatEl);const l=document.createElement("div");l.classList.add("pinned-audio-progress-wrapper"),this.progressLine=new x.Z({withTransition:!0,useTransform:!0}),this.progressLine.container.classList.add("pinned-audio-progress"),l.append(this.progressLine.container),this.wrapper.insertBefore(l,this.wrapperUtils),this.topbar.listenerSetter.add(y.Z)("play",this.onMediaPlay),this.topbar.listenerSetter.add(y.Z)("pause",this.onPause),this.topbar.listenerSetter.add(y.Z)("stop",this.onStop),this.topbar.listenerSetter.add(y.Z)("playbackParams",this.onPlaybackParams);const c=y.Z.getPlayingDetails();c&&(this.onMediaPlay(c),this.onPlaybackParams(c.playbackParams))}destroy(){this.progressLine&&this.progressLine.removeListeners()}}var D,R=i(684);!function(e){e[e.ONE=32]="ONE",e[e.TWO=15]="TWO",e[e.THREE=10]="THREE",e[e.FOUR=8]="FOUR",e[e.MORE=8]="MORE"}(D||(D={}));const B="pinned-message-border";class N{constructor(){this.drawRect=(e,t,i,s,n)=>`M${e},${t+n}a${n},${n},0,0,1,${i},0v${s-2*n}a${n},${n},0,0,1,${-i},0Z`,this.getClipPath=(e,t,i)=>{let s="";if(2===i)s=this.drawRect(0,0,2,t,1)+this.drawRect(0,t+2,2,t,1);else for(let e=0;e{let i;return e<=1?i=D.ONE:2===e?i=D.TWO:3===e?i=D.THREE:4===e?i=D.FOUR:e>3&&(i=D.MORE),i},this.getMarkHeight=(e,t)=>{let i;return e<=1?i=D.ONE:2===e?i=D.TWO:3===e?i=D.THREE:4===e?i=D.FOUR:e>3&&(i=D.MORE),i},this.getMarkTranslateY=(e,t,i)=>1===i?0:2===i?e?t+1:0:3===i?e?1===e?t+1:2*t+2+1:0:(t+1)*e,this.getTrackTranslateY=(e,t,i,s)=>t<=4||e<=1?0:e>=t-2?s-D.ONE-i:(e-2)*i+1*e,this.getTrackHeight=(e,t)=>e<=3?D.ONE:t*e+1*(e-1)}render(e,t){if(this.border||(this.border=document.createElement("div"),this.border.classList.add(B),this.wrapper=document.createElement("div"),this.border.append(this.wrapper)),1===e)return this.count!==e&&(this.wrapper.className=B+"-wrapper-1",this.border.classList.remove(B+"-mask"),this.wrapper.innerHTML=this.wrapper.style.cssText=""),this.border;const i=this.getBarHeight(e,t),s=this.getMarkHeight(e,t),n=this.getTrackHeight(e,i),a=`clipPath_${e}`,o=this.getClipPath(a,i,e),r=this.getMarkTranslateY(t,i,e),d=this.getTrackTranslateY(t,e,i,n);return this.border.classList.toggle(B+"-mask",e>4),t<=1?(this.border.classList.add("mask-bottom"),this.border.classList.remove("mask-top")):t>=e-2?(this.border.classList.add("mask-top"),this.border.classList.remove("mask-bottom")):this.border.classList.add("mask-top","mask-bottom"),this.wrapper.className=B+"-wrapper",this.wrapper.style.cssText=`clip-path: url(#${a}); width: 2px; height: ${n}px; transform: translateY(-${d}px);`,this.svg||(this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.setAttributeNS(null,"height","0"),this.svg.setAttributeNS(null,"width","0"),this.defs=document.createElementNS("http://www.w3.org/2000/svg","defs"),this.defs.append(o),this.svg.append(this.defs),this.mark=document.createElement("div"),this.mark.classList.add(B+"-mark")),this.svg.parentElement||this.wrapper.append(this.svg,this.mark),this.mark.style.cssText=`height: ${s}px; transform: translateY(${r}px);`,this.count=e,this.index=t,this.border}}var O=i(3484),U=i(3699),H=i(8594),z=i(5432),j=i(5701),G=i(6724),V=i(1168),K=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class W{constructor(){this.rows={},this.container=document.createElement("div"),this.container.className=W.BASE_CLASS}getRow(e,t=!1){if(this.rows[e])return this.rows[e].element;const i=document.createElement("div"),s=!Object.keys(this.rows).length&&!t;return i.className=W.BASE_CLASS+"-row"+(s?"":" is-hiding hide"),this.rows[e]={element:i,new:!0},this.container.append(i),i}clearRow(e){this.rows[e]&&(this.rows[e].element.remove(),delete this.rows[e])}clearRows(e){this.clearTimeout&&clearTimeout(this.clearTimeout),this.clearTimeout=window.setTimeout((()=>{for(const t in this.rows)+t!==e&&this.clearRow(+t)}),W.DURATION)}setNewRow(e,t=!1){const i=this.rows[e];i.new&&(t?(i.element.classList.remove("hide"),i.element.offsetLeft):i.element.classList.remove("is-hiding","hide"),delete i.new),this.clearRows(e)}animate(e,t,i=e>t,s=!1){if(e===t)return this.setNewRow(e);const n=this.rows[e],a=this.rows[t];if(!a&&!s)return this.setNewRow(e);const o=["from-top","from-bottom"];i||o.reverse(),n.element.classList.add(o[0]),n.element.classList.remove(o[1]),a&&(a.element.classList.add(o[1]),a.element.classList.remove(o[0])),n.new&&this.setNewRow(e,!0),n.element.classList.toggle("is-hiding",!1),a&&a.element.classList.toggle("is-hiding",!0),this.clearRows(e)}}W.DURATION=200,W.BASE_CLASS="animated-super";class ${constructor(e=!1){this.reverse=e,this.decimals=[],this.previousNumber=0,this.container=document.createElement("div"),this.container.className=$.BASE_CLASS}getDecimal(e){if(this.decimals[e])return this.decimals[e];const t=document.createElement("div");t.className=$.BASE_CLASS+"-decimal";const i=document.createElement("div");i.className=$.BASE_CLASS+"-decimal-placeholder";const s=new W;return s.container.className=$.BASE_CLASS+"-decimal-wrapper",t.append(i,s.container),this.container.append(t),this.decimals[e]={container:t,placeholder:i,animatedSuper:s}}clear(e){this.clearTimeout&&clearTimeout(this.clearTimeout);const t=(""+e).length;t>=this.decimals.length||(this.clearTimeout=window.setTimeout((()=>{this.decimals.splice(t,this.decimals.length-t).forEach((e=>{e.container.remove()}))}),W.DURATION))}hideLeft(e){const t=(""+e).length;this.decimals.slice(t).forEach((t=>{const i=+t.placeholder.innerText||0;t.animatedSuper.getRow($.EMPTY_INDEX,!0),t.animatedSuper.animate($.EMPTY_INDEX,i,this.reverse?ethis.previousNumber,!0)})),this.clear(e)}setCount(e){const t=Array.from(""+this.previousNumber).map((e=>+e));Array.from(""+e).map((e=>+e)).forEach(((i,s)=>{var n;const a=this.getDecimal(s),o=a.animatedSuper.getRow(i,!0),r=null!==(n=t[s])&&void 0!==n?n:$.EMPTY_INDEX;o.innerText=a.placeholder.innerText=""+i,a.animatedSuper.animate(i,r,this.reverse?ethis.previousNumber,!0)})),this.hideLeft(e),this.previousNumber=e}}$.EMPTY_INDEX=-1,$.BASE_CLASS="animated-counter";class q{constructor(e,t,i){this.topbar=e,this.chat=t,this.managers=i,this.pinnedMaxMid=0,this.pinnedMid=0,this.pinnedIndex=-1,this.wasPinnedIndex=0,this.wasPinnedMediaIndex=0,this.locked=!1,this.waitForScrollBottom=!1,this.count=0,this.mids=[],this.offsetIndex=0,this.loading=!1,this.loadedBottom=!1,this.loadedTop=!1,this.scrollDownListenerSetter=null,this.hidden=!1,this.getCurrentIndexPromise=null,this.listenerSetter=new U.Z,this.log=(0,r.kg)("PM"),this.debug=!0,this.isStatic=!1;const s=new O.Z("pinned-message",t.animationGroup);this.pinnedMessageContainer=new P({topbar:e,chat:t,listenerSetter:this.listenerSetter,className:"message",divAndCaption:s,onClose:()=>K(this,void 0,void 0,(function*(){return(yield i.appPeersManager.canPinMessage(this.chat.peerId))?V.Z.createPopup(R.Z,this.chat.peerId,this.pinnedMid,!0):V.Z.createPopup(R.Z,this.chat.peerId,0,!0),!1}))}),this.pinnedMessageBorder=new N,s.border.replaceWith(this.pinnedMessageBorder.render(1,0)),this.animatedSubtitle=new W,s.subtitle.append(this.animatedSubtitle.container),this.animatedMedia=new W,this.animatedMedia.container.classList.add("pinned-message-media-container"),s.content.prepend(this.animatedMedia.container),this.animatedCounter=new $(!0),s.title.append((0,T.ag)("PinnedMessage")," ",this.animatedCounter.container);const n=this.pinnedMessageContainer.btnClose.cloneNode(!0);this.pinnedMessageContainer.attachOnCloseEvent(n),s.container.prepend(n),this.btnOpen=(0,v.Z)("pinlist pinned-container-close pinned-message-pinlist",{noRipple:!0}),this.pinnedMessageContainer.wrapperUtils.prepend(this.btnOpen),(0,L.fc)(this.btnOpen,(e=>{(0,C.Z)(e),this.topbar.openPinned(!0)}),{listenerSetter:this.listenerSetter}),this.listenerSetter.add(d.Z)("peer_pinned_messages",(({peerId:e})=>{e===this.chat.peerId&&(this.hidden&&this.pinnedMessageContainer.toggle(this.hidden=!1),this.loadedTop=this.loadedBottom=!1,this.pinnedIndex=-1,this.pinnedMid=0,this.count=0,this.mids=[],this.offsetIndex=0,this.pinnedMaxMid=0,this.setCorrectIndex(0))})),this.listenerSetter.add(d.Z)("peer_pinned_hidden",(({peerId:e})=>{e===this.chat.peerId&&this.pinnedMessageContainer.toggle(this.hidden=!0)})),this.setPinnedMessage=(0,j.Z)((()=>this._setPinnedMessage()),100,!0,!0),this.setCorrectIndexThrottled=(0,G.Z)(this.setCorrectIndex.bind(this),100,!1),this.isStatic=!this.chat.isPinnedMessagesNeeded()}destroy(){this.pinnedMessageContainer.divAndCaption.container.remove(),this.pinnedMessageContainer.toggle(!0),this.listenerSetter.removeAll(),this.unsetScrollDownListener(!1)}setCorrectIndex(e){if(this.isStatic)return;if(this.locked||this.hidden)return;if((this.loadedBottom||this.loadedTop)&&!this.count)return;const t=this.chat.bubbles.getBubbleByPoint("bottom");if(!t)return;const i=t.dataset.mid;t&&void 0!==i&&this.testMid(+i,e)}testMid(e,t){if(this.isStatic)return;if(this.hidden)return;let i=this.mids.findIndex((t=>t<=e));if(-1===i||this.isNeededMore(i)){if(!(this.loadedTop&&ei))return;this.pinnedIndex=i,this.pinnedMid=this.mids.find((t=>t<=e))||this.mids[this.mids.length-1],this.setPinnedMessage()}}isNeededMore(e){return this.count>q.LOAD_COUNT&&(!this.loadedBottom&&e<=q.LOAD_OFFSET||!this.loadedTop&&this.count-1-e<=q.LOAD_OFFSET)}getCurrentIndex(e,t=!0){return K(this,void 0,void 0,(function*(){if(!this.loading){this.loading=!0;try{const i=this.debug?this.log.bindPrefix("getCurrentIndex"):void 0;i&&i("start",e,t);let s=!1;const n=[this.managers.appMessagesManager.getSearch({peerId:this.chat.peerId,inputFilter:{_:"inputMessagesFilterPinned"},maxId:e,limit:q.LOAD_COUNT,backLimit:q.LOAD_COUNT,threadId:this.chat.threadId}).then((e=>(s=!0,e)))];if(!this.pinnedMaxMid){const e=this.managers.appMessagesManager.getPinnedMessage(this.chat.peerId,this.chat.threadId).then((e=>{e.maxId&&(this.pinnedMaxMid=e.maxId,!s&&t&&(this.mids=[this.pinnedMaxMid],this.count=e.count,this.pinnedIndex=0,this.pinnedMid=this.mids[0],this.setPinnedMessage()))}));n.push(e)}const a=(yield Promise.all(n))[0];let o=a.history.findIndex((t=>t.mid<=e));-1===o&&(o=a.history.length),this.offsetIndex=a.offset_id_offset?a.offset_id_offset-o:0,this.mids=a.history.map((e=>e.mid)).slice(),this.count=a.count,this.count||this.pinnedMessageContainer.toggle(!0),this.loadedTop=this.offsetIndex+this.mids.length===this.count,this.loadedBottom=!this.offsetIndex,i&&i("result",e,a,o,this.offsetIndex,this.loadedTop,this.loadedBottom)}catch(e){this.log.error("getCurrentIndex error",e)}this.loading=!1,this.locked?this.testMid(e):t&&this.setCorrectIndex(0),this.getCurrentIndexPromise=null}}))}setScrollDownListener(){this.waitForScrollBottom=!0,this.scrollDownListenerSetter||(this.scrollDownListenerSetter=new U.Z,function(e,t,i,s){if(z.Z){let t;const n={passive:!0};s.add(e)("touchstart",(i=>{i.touches.length>1?o():(t=i.touches[0].clientY,s.add(e)("touchmove",a,n),s.add(e)("touchend",o,n))}),n);const a=e=>{const s=e.touches[0].clientY,n=s{s.removeManual(e,"touchmove",a,n),s.removeManual(e,"touchend",o,n)}}else s.add(e)("wheel",(e=>{const t=e.deltaY>0;!t||i()}),{passive:!0})}(this.chat.bubbles.scrollable.container,0,(()=>{this.unsetScrollDownListener()}),this.scrollDownListenerSetter))}unsetScrollDownListener(e=!0){this.waitForScrollBottom=!1,this.scrollDownListenerSetter&&(this.scrollDownListenerSetter.removeAll(),this.scrollDownListenerSetter=null),e&&this.setCorrectIndex(0)}handleFollowingPinnedMessage(){return K(this,void 0,void 0,(function*(){this.locked=!0,this.debug&&this.log("handleFollowingPinnedMessage");try{this.setScrollDownListener();const e=this.chat.setPeerPromise;e instanceof Promise&&(yield e),yield(0,H.e9)(),this.getCurrentIndexPromise&&(yield this.getCurrentIndexPromise),this.debug&&this.log("handleFollowingPinnedMessage: unlock"),this.locked=!1}catch(e){this.log.error("handleFollowingPinnedMessage error:",e),this.locked=!1,this.waitForScrollBottom=!1,this.setCorrectIndex(0)}}))}followPinnedMessage(e){return K(this,void 0,void 0,(function*(){(yield this.chat.getMessage(e))&&(this.chat.setMessageId(e),(this.chat.setPeerPromise||Promise.resolve()).then((()=>{this.handleFollowingPinnedMessage(),this.testMid(this.pinnedIndex>=this.count-1?this.pinnedMaxMid:e-1)})))}))}_setPinnedMessage(){return K(this,void 0,void 0,(function*(){const e=this.count;if(e){const t=this.pinnedIndex,i=yield this.chat.getMessage(this.pinnedMid),s=0===t;this.animatedCounter.container.classList.toggle("is-last",s),s||this.animatedCounter.setCount(e-t),this.pinnedMessageContainer.toggle(!1);const n=t>this.wasPinnedIndex;this.debug&&this.log("setPinnedMessage: fromTop",n,t,this.wasPinnedIndex);const a=this.animatedSubtitle.getRow(t),o=this.animatedMedia.getRow(t);o.classList.add("pinned-message-media");const r=[],d=yield(0,O.o)({title:void 0,titleEl:null,subtitle:i.message,subtitleEl:a,message:i,mediaEl:o,loadPromises:r,animationGroup:this.chat.animationGroup});yield Promise.all(r),this.pinnedMessageContainer.divAndCaption.container.classList.toggle("is-media",d),this.animatedSubtitle.animate(t,this.wasPinnedIndex),d?(this.animatedMedia.animate(t,this.wasPinnedMediaIndex),this.wasPinnedMediaIndex=t):this.animatedMedia.clearRows(),this.pinnedMessageBorder.render(e,e-t-1),this.wasPinnedIndex=t,this.pinnedMessageContainer.divAndCaption.container.dataset.mid=""+i.mid}else this.pinnedMessageContainer.toggle(!0),this.wasPinnedIndex=0;this.pinnedMessageContainer.divAndCaption.container.classList.toggle("is-many",this.count>1)}))}}q.LOAD_COUNT=50,q.LOAD_OFFSET=5;var Y=i(6194),Q=i(5824),X=i(8497),J=i(8799),ee=i(4668),te=i(2796),ie=i(2995),se=i(8127),ne=i(4240),ae=i(6818),oe=i(993),re=i(3897),de=i(7120),le=i(7362),ce=i(2059),he=i(3855),ue=i(9405),pe=i(1507),fe=i(2559),me=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class ge{constructor(e,t,i){this.chat=e,this.appSidebarRight=t,this.managers=i,this.verifyButtons=e=>{const t=!!e||!(!this.btnMore||!this.btnMore.classList.contains("menu-open"));e&&(0,C.Z)(e),(()=>{me(this,void 0,void 0,(function*(){const e=this.buttonsToVerify.concat(t?this.menuButtons:[]);(yield Promise.all(e.map((e=>me(this,void 0,void 0,(function*(){return{result:yield e.verify(),button:e}})))))).forEach((({button:e,result:t})=>{e.element.classList.toggle("hide",!t)}))}))})()},this.verifyVideoChatButton=e=>me(this,void 0,void 0,(function*(){var t;if(!ae.Z||this.peerId.isUser()||"chat"!==this.chat.type||this.chat.threadId)return!1;const i=ce.ZP.groupCall,s=this.peerId.toChatId();if((null==i?void 0:i.chatId)===s)return!1;if(e&&((yield this.managers.appPeersManager.isBroadcast(this.peerId))&&"group"===e||(yield this.managers.appPeersManager.isAnyGroup(this.peerId))&&"broadcast"===e))return!1;const n=yield this.managers.appChatsManager.getChat(s);return(null===(t=n.pFlags)||void 0===t?void 0:t.call_active)||(0,de.Z)(n,"manage_call")})),this.verifyCallButton=e=>me(this,void 0,void 0,(function*(){if(!oe.Z||!this.peerId.isUser())return!1;const t=this.peerId.toUserId(),i=yield this.managers.appProfileManager.getCachedFullUser(t);return!!i&&!!("voice"===e?i.pFlags.phone_calls_available:i.pFlags.video_calls_available)})),this.onJoinGroupCallClick=()=>{this.chat.appImManager.joinGroupCall(this.peerId)},this.onMuteClick=()=>{V.Z.createPopup(re.Z,this.peerId)},this.onResize=()=>{this.setUtilsWidth(!0),this.setFloating()},this.onChangeScreen=(e,t)=>{this.container.classList.toggle("is-pinned-floating",o.Z.isMobile),this.pinnedMessage&&this.pinnedMessage.pinnedMessageContainer.divAndCaption.container.classList.toggle("is-floating",t===o._.mobile),this.onResize()},this.setUtilsWidth=(e=!1)=>{this.setUtilsRAF&&window.cancelAnimationFrame(this.setUtilsRAF),f.IS_SAFARI&&e&&this.chatUtils.classList.add("hide"),this.setUtilsRAF=window.requestAnimationFrame((()=>{f.IS_SAFARI&&e&&this.chatUtils.classList.remove("hide");const t=this.chatUtils.getBoundingClientRect().width;this.chat.log("utils width:",t),this.container.style.setProperty("--utils-width",t+"px"),this.setUtilsRAF=0}))},this.setFloating=()=>{var e;const t=[this.chatAudio,null===(e=this.pinnedMessage)||void 0===e?void 0:e.pinnedMessageContainer].filter(Boolean).reduce(((e,t)=>{const i=t.isFloating();return this.container.classList.toggle(`is-pinned-${t.className}-floating`,i),t.isVisible()?e+ +i:e}),0);this.container.dataset.floating=""+t},this.setPeerStatusManual=(e=!1)=>me(this,void 0,void 0,(function*(){if(!this.subtitle||"chat"!==this.chat.type)return;if(this.chat.threadId){const e=yield(0,le.Z)({peerId:this.peerId,dialog:!0}),t=(0,T.ag)("TopicProfileStatus",[e]);return()=>(0,Z.Z)(this.subtitle,t)}const t=this.peerId;return this.chat.appImManager.setPeerStatus({peerId:t,element:this.subtitle,needClear:e,useWhitespace:!1,middleware:()=>t===this.peerId})})),this.setPeerStatus=e=>this.setPeerStatusManual(e).then((e=>{null==e||e()})),this.listenerSetter=new U.Z,this.menuButtons=[],this.buttonsToVerify=[]}construct(){this.container=document.createElement("div"),this.container.classList.add("sidebar-header","topbar","hide"),this.container.dataset.floating="0",this.btnBack=(0,v.Z)("left sidebar-close-button",{noRipple:!0}),this.btnBackBadge=document.createElement("span"),this.btnBackBadge.classList.add("badge","badge-20","badge-primary","back-unread-badge"),this.btnBack.append(this.btnBackBadge),this.chatInfoContainer=document.createElement("div"),this.chatInfoContainer.classList.add("chat-info-container"),this.chatInfo=document.createElement("div"),this.chatInfo.classList.add("chat-info");const e=this.person=document.createElement("div");e.classList.add("person");const t=document.createElement("div");t.classList.add("content");const i=document.createElement("div");i.classList.add("top"),this.title=document.createElement("div"),this.title.classList.add("user-title"),i.append(this.title);const s=document.createElement("div");s.classList.add("bottom"),this.subtitle&&s.append(this.subtitle),t.append(i,s),this.avatarElement&&e.append(this.avatarElement),e.append(t),this.chatInfo.append(e),this.chatUtils=document.createElement("div"),this.chatUtils.classList.add("chat-utils"),this.chatAudio=new F(this,this.chat,this.managers),this.menuButtons.length&&(this.btnMore=(0,b.Z)({listenerSetter:this.listenerSetter,direction:"bottom-left",buttons:this.menuButtons,onOpen:(e,t)=>me(this,void 0,void 0,(function*(){const e=this.menuButtons[this.menuButtons.length-1];if(null==e?void 0:e.element){const t=yield this.managers.appPeersManager.getDeleteButtonText(this.peerId);e.element.lastChild.replaceWith((0,T.ag)(t))}}))})),this.chatUtils.append(...[this.pinnedMessage?this.pinnedMessage.pinnedMessageContainer.divAndCaption.container:null,this.btnJoin,this.btnPinned,this.btnCall,this.btnGroupCall,this.btnMute,this.btnSearch,this.btnMore].filter(Boolean)),this.pushButtonToVerify(this.btnCall,this.verifyCallButton.bind(this,"voice")),this.pushButtonToVerify(this.btnGroupCall,this.verifyVideoChatButton),this.chatInfoContainer.append(this.btnBack,this.chatInfo,this.chatUtils),this.container.append(this.chatInfoContainer),this.chatAudio&&this.container.append(this.chatAudio.divAndCaption.container),this.listenerSetter.add(window)("resize",this.onResize),this.listenerSetter.add(o.Z)("changeScreen",this.onChangeScreen),(0,L.fc)(this.container,(e=>{const t=(0,X.Z)(e.target,"pinned-container");if((0,J.Z)(),t){if((0,C.Z)(e),(0,X.Z)(e.target,"progress-line")||(0,X.Z)(e.target,"pinned-container-wrapper-utils"))return;const i=+t.dataset.mid;if(t.classList.contains("pinned-message"))this.pinnedMessage.followPinnedMessage(i);else{const e=t.dataset.peerId.toPeerId(),s=y.Z.getSearchContext();this.chat.appImManager.setInnerPeer({peerId:e,lastMsgId:i,type:s.isScheduled?"scheduled":s.threadId?"discussion":void 0,threadId:s.threadId})}}else o.Z.activeScreen===o._.medium&&document.body.classList.contains(n.ir)?r():(0,ee.Z)(e.target,"AVATAR-ELEMENT")?this.appSidebarRight.toggleSidebar(!document.body.classList.contains(a.HQ)):this.appSidebarRight.toggleSidebar(!0)}),{listenerSetter:this.listenerSetter});const r=e=>{if(e&&(0,C.Z)(e),o.Z.activeScreen===o._.medium&&document.body.classList.contains(n.ir))this.chat.appImManager.setPeer({peerId:this.peerId});else{const e=0===this.chat.appImManager.chats.indexOf(this.chat);Q.Z.back(e?"im":"chat")}};(0,L.fc)(this.btnBack,r,{listenerSetter:this.listenerSetter})}pushButtonToVerify(e,t){e&&this.buttonsToVerify.push({element:e,verify:t})}constructUtils(){this.menuButtons=[{icon:"search",text:"Search",onClick:()=>{this.chat.initSearch()},verify:()=>o.Z.isMobile},{icon:"mute",text:"ChatList.Context.Mute",onClick:this.onMuteClick,verify:()=>me(this,void 0,void 0,(function*(){return"chat"===this.chat.type&&d.Z.myId!==this.peerId&&!(yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:this.peerId,respectType:!1,threadId:this.chat.threadId}))}))},{icon:"unmute",text:"ChatList.Context.Unmute",onClick:()=>{this.managers.appMessagesManager.togglePeerMute({peerId:this.peerId,threadId:this.chat.threadId})},verify:()=>me(this,void 0,void 0,(function*(){return"chat"===this.chat.type&&d.Z.myId!==this.peerId&&(yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:this.peerId,respectType:!1,threadId:this.chat.threadId}))}))},{icon:"comments",text:"ViewDiscussion",onClick:()=>{const e=this.chat.bubbles.getMiddleware();Promise.resolve(this.managers.appProfileManager.getChannelFull(this.peerId.toChatId())).then((t=>{e()&&t.linked_chat_id&&this.chat.appImManager.setInnerPeer({peerId:t.linked_chat_id.toPeerId(!0)})}))},verify:()=>me(this,void 0,void 0,(function*(){const e=yield this.managers.appProfileManager.getCachedFullChat(this.peerId.toChatId());return"chat"===this.chat.type&&!!(null==e?void 0:e.linked_chat_id)}))},{icon:"phone",text:"Call",onClick:this.onCallClick.bind(this,"voice"),verify:this.verifyCallButton.bind(this,"voice")},{icon:"videocamera",text:"VideoCall",onClick:this.onCallClick.bind(this,"video"),verify:this.verifyCallButton.bind(this,"video")},{icon:"videochat",text:"PeerInfo.Action.LiveStream",onClick:this.onJoinGroupCallClick,verify:this.verifyVideoChatButton.bind(this,"broadcast")},{icon:"videochat",text:"PeerInfo.Action.VoiceChat",onClick:this.onJoinGroupCallClick,verify:this.verifyVideoChatButton.bind(this,"group")},{icon:"select",text:"Chat.Menu.SelectMessages",onClick:()=>{const e=this.chat.selection;e.toggleSelection(!0,!0),he.Z.getState().then((t=>{if(t.chatContextMenuHintWasShown)return;const i=e.toggleByElement.bind(e);e.toggleByElement=t=>me(this,void 0,void 0,(function*(){this.managers.appStateManager.pushToState("chatContextMenuHintWasShown",!0),(0,te.Am)((0,T.ag)("Chat.Menu.Hint")),e.toggleByElement=i,e.toggleByElement(t)}))}))},verify:()=>!this.chat.selection.isSelecting&&!!this.chat.bubbles.getRenderedLength()},{icon:"select",text:"Chat.Menu.ClearSelection",onClick:()=>{this.chat.selection.cancelSelection()},verify:()=>this.chat.selection.isSelecting},{icon:"adduser",text:"AddContact",onClick:()=>{if(!this.appSidebarRight.isTabExists(ne.Z)){const e=this.appSidebarRight.createTab(ne.Z);e.peerId=this.peerId,e.open(),this.appSidebarRight.toggleSidebar(!0)}},verify:()=>me(this,void 0,void 0,(function*(){return this.peerId.isUser()&&!(yield this.managers.appPeersManager.isContact(this.peerId))}))},{icon:"forward",text:"ShareContact",onClick:()=>{const e=this.peerId;V.Z.createPopup(ie.Z,{peerTypes:["dialogs","contacts"],onSelect:t=>new Promise(((i,s)=>{V.Z.createPopup(se.Z,"",{titleLangKey:"SendMessageTitle",descriptionLangKey:"SendContactToGroupText",descriptionLangArgs:[new M.Z({peerId:t,dialog:!0}).element],buttons:[{langKey:"Send",callback:()=>{i(),this.managers.appMessagesManager.sendContact(t,e),this.chat.appImManager.setInnerPeer({peerId:t})}},{langKey:"Cancel",callback:()=>{s()},isCancel:!0}],peerId:t,overlayClosable:!0}).show()})),placeholder:"ShareModal.Search.Placeholder",chatRightsActions:["send_plain"],selfPresence:"ChatYourSelf"})},verify:()=>me(this,void 0,void 0,(function*(){return d.Z.myId!==this.peerId&&this.peerId.isUser()&&(yield this.managers.appPeersManager.isContact(this.peerId))&&!!(yield this.managers.appUsersManager.getUser(this.peerId.toUserId())).phone}))},{icon:"gift",text:"GiftPremium",onClick:()=>this.chat.appImManager.giftPremium(this.peerId),verify:()=>this.chat.canGiftPremium()},{icon:"bots",text:"Settings",onClick:()=>{this.managers.appMessagesManager.sendText(this.peerId,"/settings")},verify:()=>me(this,void 0,void 0,(function*(){var e;try{const t=yield this.managers.appAttachMenuBotsManager.getAttachMenuBot(this.peerId.toUserId());return!!(null===(e=null==t?void 0:t.pFlags)||void 0===e?void 0:e.has_settings)}catch(e){return!1}}))},{icon:"lock",text:"BlockUser",onClick:()=>{V.Z.createPopup(se.Z,"",{peerId:this.peerId,titleLangKey:"BlockUser",descriptionLangKey:"AreYouSureBlockContact2",descriptionLangArgs:[new M.Z({peerId:this.peerId}).element],buttons:[{langKey:"BlockUser",isDanger:!0,callback:()=>{this.managers.appUsersManager.toggleBlock(this.peerId,!0).then((e=>{e&&(0,te.bC)({langPackKey:"UserBlocked"})}))}}]}).show()},verify:()=>me(this,void 0,void 0,(function*(){var e;if(!this.peerId.isUser())return!1;const t=yield this.managers.appProfileManager.getCachedFullUser(this.peerId.toUserId());return this.peerId!==d.Z.myId&&t&&!(null===(e=t.pFlags)||void 0===e?void 0:e.blocked)}))},{icon:"lockoff",text:"Unblock",onClick:()=>{this.managers.appUsersManager.toggleBlock(this.peerId,!1).then((e=>{e&&(0,te.bC)({langPackKey:"UserUnblocked"})}))},verify:()=>me(this,void 0,void 0,(function*(){var e;const t=yield this.managers.appProfileManager.getCachedFullUser(this.peerId.toUserId());return!!(null===(e=null==t?void 0:t.pFlags)||void 0===e?void 0:e.blocked)}))},{icon:"delete danger",text:"Delete",onClick:()=>{V.Z.createPopup(Y.Z,this.peerId)},verify:()=>me(this,void 0,void 0,(function*(){return"chat"===this.chat.type&&!!(yield this.managers.appMessagesManager.getDialogOnly(this.peerId))}))}],this.btnSearch=(0,v.Z)("search"),this.attachClickEvent(this.btnSearch,(e=>{this.chat.initSearch()}),!0)}attachClickEvent(e,t,i){(0,L.fc)(e,(e=>{(0,C.Z)(e),!i&&(0,J.Z)(),t(e)}),{listenerSetter:this.listenerSetter})}onCallClick(e){this.chat.appImManager.callUser(this.peerId.toUserId(),e)}constructAvatar(){const e=new m.Z;return e.isDialog=!0,e.classList.add("avatar-42","person-avatar"),e}get peerId(){return this.chat.peerId}constructPeerHelpers(){return this.avatarElement=this.constructAvatar(),this.subtitle=document.createElement("div"),this.subtitle.classList.add("info"),this.pinnedMessage=new q(this,this.chat,this.managers),this.btnJoin=(0,g.Z)("btn-primary btn-color-primary chat-join hide"),this.btnCall=(0,v.Z)("phone"),this.btnGroupCall=(0,v.Z)("videochat"),this.btnPinned=(0,v.Z)("pinlist"),this.btnMute=(0,v.Z)("mute"),this.attachClickEvent(this.btnCall,this.onCallClick.bind(this,"voice")),this.attachClickEvent(this.btnGroupCall,this.onJoinGroupCallClick),this.attachClickEvent(this.btnPinned,(()=>{this.openPinned(!0)})),this.attachClickEvent(this.btnMute,this.onMuteClick),this.attachClickEvent(this.btnJoin,(()=>me(this,void 0,void 0,(function*(){const e=this.chat.bubbles.getMiddleware();this.btnJoin.setAttribute("disabled","true");const t=this.peerId.toChatId();let i;i=(yield this.managers.appChatsManager.isChannel(t))?this.managers.appChatsManager.joinChannel(t):this.managers.appChatsManager.addChatUser(t,d.Z.myId),i.finally((()=>{e()&&this.btnJoin.removeAttribute("disabled")}))})))),this.listenerSetter.add(d.Z)("folder_unread",(e=>{if(e.id!==pe.J$)return;const t=e.unreadUnmutedPeerIds.size;this.btnBackBadge.textContent=t?""+(0,fe.Z)(t,1):""})),this.listenerSetter.add(d.Z)("chat_update",(e=>me(this,void 0,void 0,(function*(){var t;if(this.peerId===e.toPeerId(!0)){const i=yield this.managers.appChatsManager.getChat(e);this.btnJoin.classList.toggle("hide",!(null===(t=null==i?void 0:i.pFlags)||void 0===t?void 0:t.left)),this.setUtilsWidth(),this.verifyButtons()}})))),this.listenerSetter.add(d.Z)("dialog_notify_settings",(e=>{e.peerId===this.peerId&&this.setMutedState()})),this.listenerSetter.add(d.Z)("peer_typings",(({peerId:e})=>{this.peerId===e&&this.setPeerStatus()})),this.listenerSetter.add(d.Z)("user_update",(e=>{this.peerId===e.toPeerId()&&this.setPeerStatus()})),this.listenerSetter.add(d.Z)("peer_full_update",(e=>{this.peerId===e&&this.verifyButtons()})),this.chat.addEventListener("setPeer",((e,t)=>{const i=this.chat.bubbles.getMiddleware();he.Z.getState().then((s=>{i()&&this.pinnedMessage&&(this.pinnedMessage.hidden=!!s.hiddenPinnedMessages[this.chat.peerId],t?(this.pinnedMessage.unsetScrollDownListener(),this.pinnedMessage.testMid(e,0)):this.pinnedMessage.locked||(this.pinnedMessage.handleFollowingPinnedMessage(),this.pinnedMessage.testMid(e)))}))})),this.listenerSetter.add(d.Z)("peer_pinned_messages",(({peerId:e,mids:t})=>{"pinned"===this.chat.type&&e===this.peerId&&t&&this.setTitle()})),this.setPeerStatusInterval=window.setInterval(this.setPeerStatus,6e4),this}openPinned(e){this.chat.appImManager.setInnerPeer({peerId:this.peerId,lastMsgId:e?+this.pinnedMessage.pinnedMessageContainer.divAndCaption.container.dataset.mid:0,type:"pinned"})}destroy(){var e,t;this.listenerSetter.removeAll(),window.clearInterval(this.setPeerStatusInterval),null===(e=this.pinnedMessage)||void 0===e||e.destroy(),null===(t=this.chatAudio)||void 0===t||t.destroy(),delete this.chatAudio,delete this.pinnedMessage}cleanup(){this.chat.peerId||this.container.classList.add("hide")}finishPeerChange(e){var t;return me(this,void 0,void 0,(function*(){const{peerId:e,threadId:i}=this.chat;let s;"chat"===this.chat.type&&(s=(null===(t=this.avatarElement)||void 0===t?void 0:t.peerId)!==this.peerId||this.avatarElement.threadId!==this.chat.threadId?this.constructAvatar():this.avatarElement);const[n,a,o,r,d,l,c]=yield Promise.all([this.managers.appPeersManager.isBroadcast(e),this.managers.appPeersManager.isAnyChat(e),e.isAnyChat()?this.managers.appChatsManager.getChat(e.toChatId()):void 0,s?s.updateWithOptions({peerId:e,threadId:i,wrapOptions:{customEmojiSize:(0,ue.C)(32,32)}}):void 0,this.setTitleManual(),this.setPeerStatusManual(!0),he.Z.getState()]);return()=>{var t,i;const r=!("pinned"===this.chat.type||"scheduled"===this.chat.type);this.btnMute&&this.btnMute.classList.toggle("hide",!n||!r),this.btnJoin&&(a&&!this.chat.isRestricted&&r?((0,Z.Z)(this.btnJoin,(0,T.ag)(n?"Chat.Subscribe":"ChannelJoin")),this.btnJoin.classList.toggle("hide",!(null===(t=null==o?void 0:o.pFlags)||void 0===t?void 0:t.left))):this.btnJoin.classList.add("hide")),this.btnSearch&&this.btnSearch.classList.toggle("hide",!r),this.btnPinned&&this.btnPinned.classList.toggle("hide",!r),this.avatarElement!==s&&(s&&(this.avatarElement?this.avatarElement.replaceWith(s):this.person.prepend(s)),null===(i=this.avatarElement)||void 0===i||i.remove(),this.avatarElement=s),this.setUtilsWidth(),this.verifyButtons(),this.btnMore&&this.btnMore.classList.toggle("hide",!r);const h=this.chat.isPinnedMessagesNeeded();if(h||"discussion"===this.chat.type){if(this.chat.wasAlreadyUsed||!this.pinnedMessage){const e=new q(this,this.chat,this.managers);this.pinnedMessage?(this.pinnedMessage.pinnedMessageContainer.divAndCaption.container.replaceWith(e.pinnedMessageContainer.divAndCaption.container),this.pinnedMessage.destroy()):this.chatUtils.prepend(this.pinnedMessage.pinnedMessageContainer.divAndCaption.container),this.pinnedMessage=e}h?this.pinnedMessage.hidden=!!c.hiddenPinnedMessages[e]:"discussion"===this.chat.type&&(this.pinnedMessage.pinnedMid=this.chat.threadId,this.pinnedMessage.count=1,this.pinnedMessage.pinnedIndex=0,this.pinnedMessage._setPinnedMessage())}else this.pinnedMessage&&(this.pinnedMessage.destroy(),this.pinnedMessage=void 0);d(),null==l||l(),this.subtitle.classList.toggle("hide",!l),this.setMutedState(),this.container.classList.remove("hide")}}))}setTitleManual(e){return me(this,void 0,void 0,(function*(){const{peerId:t,threadId:i}=this.chat,s=()=>this.chat.bubbles.getMiddleware();let n;if("pinned"===this.chat.type)n=void 0===e?(0,T.ag)("Loading"):(0,T.ag)("PinnedMessagesCount",[e]),void 0===e&&this.managers.appMessagesManager.getSearchCounters(t,[{_:"inputMessagesFilterPinned"}],!1).then((e=>{if(!s())return;const t=e[0].count;if(this.setTitle(t),!t){this.chat.appImManager.setPeer();const e=this.chat.appImManager.chat;e.topbar.pinnedMessage&&e.topbar.pinnedMessage.pinnedMessageContainer.toggle(!0)}}));else if("scheduled"===this.chat.type)n=(0,T.ag)(t===d.Z.myId?"Reminders":"ScheduledMessages");else if("discussion"===this.chat.type){if(void 0===e){const n=yield this.managers.acknowledged.appMessagesManager.getHistory(t,0,1,0,i);if(!s())return;if(n.cached){const t=yield n.result;if(!s())return;e=t.count}else n.result.then((e=>{s()&&this.setTitle(e.count)}))}n=void 0===e?(0,T.ag)("Loading"):(0,T.ag)("Chat.Title.Comments",[e])}else if("chat"===this.chat.type&&([n]=yield Promise.all([(0,le.Z)({peerId:t,dialog:!0,withIcons:!i,threadId:i})]),!s()))return;return()=>{(0,Z.Z)(this.title,n)}}))}setTitle(e){this.setTitleManual(e).then((e=>e()))}setMutedState(){return me(this,void 0,void 0,(function*(){if(!this.btnMute)return;const e=this.peerId,t=yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:e,respectType:!1,threadId:this.chat.threadId});(yield this.managers.appPeersManager.isBroadcast(e))?(this.btnMute.classList.remove("tgico-mute","tgico-unmute"),this.btnMute.classList.add(t?"tgico-unmute":"tgico-mute"),this.btnMute.style.display=""):this.btnMute.style.display="none"}))}}var ve=i(9099),be=i(5884),ye=i(3607),we=i(2986),Se=i(3552);class Ce extends Se._{constructor(){super(...arguments),this.threadId=0,this.query=""}onOpenAfterTimeout(){this.appSearch.beginSearch(this.peerId,this.threadId,this.query)}init(e,t,i,s){this.container.id="search-private-container",this.container.classList.add("chatlist-container"),this.inputSearch=new ye.Z("Search"),this.title.replaceWith(this.inputSearch.container),this.btnPickDate=(0,v.Z)("calendar sidebar-header-right"),this.header.append(this.btnPickDate);const n=document.createElement("div");n.classList.add("chatlist-container"),this.scrollable.container.replaceWith(n),this.appSearch=new be.Z(n,this.inputSearch,{messages:new be.z("Chat.Search.PrivateSearch","messages")}),this.peerId?this.appSearch.beginSearch(this.peerId,this.threadId,s):(this.query=s,this.peerId=e,this.threadId=t,this.onDatePick=i,this.btnPickDate.classList.toggle("hide",!this.onDatePick),this.onDatePick&&(0,L.fc)(this.btnPickDate,(()=>{V.Z.createPopup(we.Z,new Date,this.onDatePick).show()})),s&&this.appSearch.searchInput.inputField.setValueSilently(s),a.ZP.toggleSidebar(!0))}}var Le=i(6740),Ie=i(2648),Ee=i(5005);class Pe{constructor(e,t,i){this.topbar=e,this.chat=t,this.foundCount=0,this.selectedIndex=0,this.onDateClick=e=>{(0,C.Z)(e),V.Z.createPopup(we.Z,new Date,this.chat.bubbles.onDatePick).show()},this.onResultsClick=e=>{const t=(0,ee.Z)(e.target,Ee.DIALOG_LIST_ELEMENT_TAG);t&&this.selectResult(t)},this.onFooterClick=e=>{this.foundCount&&(this.chat.bubbles.container.classList.toggle("search-results-active"),this.results.classList.toggle("active"))},this.onUpClick=e=>{(0,C.Z)(e),this.selectResult(this.searchGroup.list.children[this.selectedIndex+1])},this.onDownClick=e=>{(0,C.Z)(e),this.selectResult(this.searchGroup.list.children[this.selectedIndex-1])},this.element=document.createElement("div"),this.element.classList.add("sidebar-header","chat-search","chatlist-container"),this.backBtn=document.createElement("button"),this.backBtn.classList.add("btn-icon","tgico-left","sidebar-close-button"),(0,S.Z)(this.backBtn);const s=this.listenerSetter=new U.Z,n=(e,t)=>{(0,L.fc)(e,t,{listenerSetter:s})};n(this.backBtn,(()=>{this.destroy()})),this.inputSearch=new ye.Z("Search"),this.results=document.createElement("div"),this.results.classList.add("chat-search-results","chatlist-container"),this.searchGroup=new be.z(!1,"messages",void 0,"",!1),n(this.searchGroup.list,this.onResultsClick),this.appSearch=new be.Z(this.results,this.inputSearch,{messages:this.searchGroup},(e=>{this.foundCount=e,this.foundCount?this.selectResult(this.searchGroup.list.children[0]):((0,Z.Z)(this.foundCountEl,this.inputSearch.value?(0,T.ag)("NoResult"):""),this.results.classList.remove("active"),this.chat.bubbles.container.classList.remove("search-results-active"),this.upBtn.setAttribute("disabled","true"),this.downBtn.setAttribute("disabled","true"))})),this.appSearch.beginSearch(this.chat.peerId,this.chat.threadId),this.chat.bubbles.container.append(this.results),this.footer=document.createElement("div"),this.footer.classList.add("chat-search-footer"),n(this.footer,this.onFooterClick),(0,S.Z)(this.footer),this.foundCountEl=document.createElement("span"),this.foundCountEl.classList.add("chat-search-count"),this.dateBtn=document.createElement("button"),this.dateBtn.classList.add("btn-icon","tgico-calendar"),this.controls=document.createElement("div"),this.controls.classList.add("chat-search-controls"),this.upBtn=document.createElement("button"),this.upBtn.classList.add("btn-icon","tgico-up"),this.downBtn=document.createElement("button"),this.downBtn.classList.add("btn-icon","tgico-down"),this.upBtn.setAttribute("disabled","true"),this.downBtn.setAttribute("disabled","true"),n(this.dateBtn,this.onDateClick),n(this.upBtn,this.onUpClick),n(this.downBtn,this.onDownClick),this.controls.append(this.upBtn,this.downBtn),this.footer.append(this.foundCountEl,this.dateBtn,this.controls),this.topbar.container.parentElement.insertBefore(this.footer,t.input.chatInput),this.element.append(this.backBtn,this.inputSearch.container),this.topbar.container.classList.add("hide-pinned"),this.topbar.container.parentElement.append(this.element),this.inputSearch.input.focus(),i&&this.setQuery(i),f.IS_MOBILE_SAFARI||(this.navigationItem={type:"mobile-search",onPop:()=>{this.destroy()}},Q.Z.pushItem(this.navigationItem))}destroy(){this.topbar.container.classList.remove("hide-pinned"),this.element.remove(),this.inputSearch.remove(),this.results.remove(),this.footer.remove(),this.listenerSetter.removeAll(),this.chat.bubbles.container.classList.remove("search-results-active"),this.chat.search=void 0,Q.Z.removeItem(this.navigationItem)}setQuery(e){this.inputSearch.inputField.value=e}selectResult(e){if(this.setPeerPromise)return this.setPeerPromise;const t=e.dataset.peerId.toPeerId(),i=+e.dataset.mid||void 0,s=(0,Ie.Z)(e);s===this.foundCount-1?this.upBtn.setAttribute("disabled","true"):this.upBtn.removeAttribute("disabled"),s?this.downBtn.removeAttribute("disabled"):this.downBtn.setAttribute("disabled","true"),this.results.classList.remove("active"),this.chat.bubbles.container.classList.remove("search-results-active");const n=this.chat.setPeer({peerId:t,lastMsgId:i});this.setPeerPromise=(n instanceof Promise?n:Promise.resolve(n)).then((()=>{this.selectedIndex=s,(0,Z.Z)(this.foundCountEl,(0,T.ag)("Of",[s+1,this.foundCount]));const e=this.searchGroup.list.childElementCount;this.selectedIndex>=e-6&&this.appSearch.searchMore()})).finally((()=>{this.setPeerPromise=null}))}}var Ze=i(1571),Me=i(1655),Te=i(6848),ke=i(241),xe=i(356);class Ae{constructor(){this.canvases=new Set}static getInstance(e){let t=this.INSTANCES.find((t=>(0,Te.Z)(t.options,e)));return t||(t=new Ae,t.init(e),this.INSTANCES.push(t)),t}init(e){this.options=e}renderToCanvas(e){return this.renderImageFromUrl(this.options.url).then((()=>this.fillCanvas(e)))}renderImageFromUrl(e){if(this.renderImageFromUrlPromise)return this.renderImageFromUrlPromise;const t=this.image=document.createElement("img");return t.crossOrigin="anonymous",this.renderImageFromUrlPromise=(0,Le.cj)(t,e,!1).then((()=>xe.Z?createImageBitmap(t,{resizeWidth:1440,resizeHeight:2960}).then((e=>(this.imageBitmap=e,t))):t))}cleanup(e){var t;this.canvases.delete(e),this.canvases.size||((0,Me.Z)(Ae.INSTANCES,this),this.objectUrl&&(null===(t=this.imageBitmap)||void 0===t||t.close(),URL.revokeObjectURL(this.objectUrl)))}fillCanvas(e){const t=e.getContext("2d"),{width:i,height:s}=e,n=this.imageBitmap||this.image;let a=n.width,o=n.height;const r=(500+ke.Z.height/2.5)*e.dpr;a*=r/o,o=r,this.options.mask?(t.fillStyle="#000",t.fillRect(0,0,i,s),t.globalCompositeOperation="destination-out"):t.globalCompositeOperation="source-over";const d=e=>{for(let s=0;s0){let e=l;do{d(e-=o)}while(e>=0)}const c=s-1;for(let e=l+o;ei.resize(e,t))))}}Ae.INSTANCES=[];var _e=i(5418),Fe=i(252),De=i(6714),Re=i(319),Be=i(2064),Ne=i(5994),Oe=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class Ue extends l.Z{constructor(e,t){super(),this.appImManager=e,this.managers=t,this.type="chat",this.animationGroup=`chat-${Math.round(65535*Math.random())}`,this.container=document.createElement("div"),this.container.classList.add("chat","tabs-tab"),this.backgroundEl=document.createElement("div"),this.backgroundEl.classList.add("chat-background"),this.log=(0,r.kg)("CHAT",r.v9.Log|r.v9.Warn|r.v9.Debug|r.v9.Error),this.log.warn("constructor"),this.peerId=pe.NM,this.container.append(this.backgroundEl),this.appImManager.chatsContainer.append(this.container),this.backgroundTempId=0,this.sharedMediaTabs=[]}setBackground(e,t){var i;const s=De.Z.getTheme().settings.wallpaper,n=(0,Be.EM)(s);let a;if(n&&!s.slug&&!s.settings.intensity&&"grabbing"===document.documentElement.style.cursor&&this.gradientRenderer&&!this.patternRenderer)return this.gradientCanvas.dataset.colors=n,this.gradientRenderer.init(this.gradientCanvas),Promise.resolve();const o=++this.backgroundTempId,r=this.gradientRenderer,d=this.patternRenderer,l=(this.gradientCanvas,this.patternCanvas);this.gradientRenderer=this.patternRenderer=this.gradientCanvas=this.patternCanvas=void 0;const c=(null===(i=s.settings)||void 0===i?void 0:i.intensity)&&s.settings.intensity/100,h=!!c&&c<0;let u,p,f,m=null==a?void 0:a.firstElementChild;if(!a)if(a=document.createElement("div"),a.classList.add("chat-background-item"),e)if(c){a.classList.add("is-pattern");const t=this.appImManager.chatsContainer.getBoundingClientRect();u=this.patternRenderer=Ae.getInstance({url:e,width:t.width,height:t.height,mask:h}),m=this.patternCanvas=u.createCanvas(),m.classList.add("chat-background-item-canvas","chat-background-item-pattern-canvas"),h&&a.classList.add("is-dark")}else a.classList.add("is-image");else a.classList.add("is-color");if(n){const{canvas:e,gradientRenderer:t}=Ze.Z.create(n);f=this.gradientRenderer=t,p=this.gradientCanvas=e,p.classList.add("chat-background-item-canvas","chat-background-item-color-canvas"),Ne.Z.isAvailable("animations")&&f.scrollAnimate(!0)}if(u){const e=h?p:m;let t=Math.abs(c)*(h?.5:1);h&&(t=Math.max(.3,t)),e.style.setProperty("--opacity-max",""+t)}const g=new Promise((i=>{const s=()=>{if(this.backgroundTempId!==o)return u&&u.cleanup(m),void(f&&f.cleanup());const e=this.backgroundEl.lastElementChild;if(e===a)return void i();const s=[p,m].filter(Boolean);s.length&&a.append(...s),this.backgroundEl.append(a),(0,ve.Z)({element:a,className:"is-visible",forwards:!0,duration:t?0:200,onTransitionEnd:e?()=>{null==d||d.cleanup(l),null==r||r.cleanup(),e.remove()}:null,useRafs:2}),i()};u?u.renderToCanvas(m).then((()=>{this.backgroundTempId===o&&s()})):e?(0,Le.ZP)(a,e,s):s()}));return this.setBackgroundPromise=Promise.race([(0,_e.Z)(500),g])}setType(e){this.type=e}init(){this.topbar=new ge(this,a.ZP,this.managers),this.bubbles=new c.ZP(this,this.managers),this.input=new u.Z(this,this.appImManager,this.managers),this.contextMenu=new h.Z(this,this.managers),this.selection=new p.Z(this,this.bubbles,this.input,this.managers),this.topbar.constructUtils(),this.topbar.constructPeerHelpers(),this.topbar.construct(),this.input.construct(),this.bubbles.constructPeerHelpers(),this.input.constructPeerHelpers(),z.Z||this.bubbles.setReactionsHoverListeners(),this.bubbles.attachContainerListeners(),this.container.append(this.topbar.container,this.bubbles.container,this.input.chatInput),this.bubbles.listenerSetter.add(d.Z)("dialog_migrate",(({migrateFrom:e,migrateTo:t})=>{this.peerId===e&&this.setPeer({peerId:t})})),this.bubbles.listenerSetter.add(d.Z)("dialog_drop",(e=>{e.peerId!==this.peerId||"dialog"!==e._&&this.threadId!==e.id||this.appImManager.setPeer()})),this.bubbles.listenerSetter.add(d.Z)("chat_update",(e=>Oe(this,void 0,void 0,(function*(){const{peerId:t}=this;if(t.isAnyChat()&&t.toChatId()===e){const e=yield this.managers.appMessagesManager.isAnonymousSending(t);t===this.peerId&&(this.isAnonymousSending=e)}}))));const e=e=>{const t=()=>{var t;null===(t=this.bubbles.observer)||void 0===t||t.toggleObservingNew(e),s.Z.toggleIntersectionGroup(this.animationGroup,e),e&&s.Z.checkAnimations(e,this.animationGroup)};e?t():setTimeout((()=>{t()}),400)};this.bubbles.listenerSetter.add(this.appImManager)("chat_changing",(({to:t})=>{e(t!==this)})),this.bubbles.listenerSetter.add(this.appImManager)("tab_changing",(t=>{e(this.appImManager.chat!==this||t!==ys.CHAT&&o.Z.activeScreen===o._.mobile)}))}beforeDestroy(){this.bubbles.cleanup()}cleanupBackground(){++this.backgroundTempId,this.patternRenderer&&(this.patternRenderer.cleanup(this.patternCanvas),this.patternRenderer=void 0),this.gradientRenderer&&(this.gradientRenderer.cleanup(),this.gradientRenderer=void 0)}destroy(){this.destroySharedMediaTab(),this.topbar.destroy(),this.bubbles.destroy(),this.input.destroy(),this.contextMenu&&this.contextMenu.destroy(),this.selection&&this.selection.attachListeners(void 0,void 0),this.cleanupBackground(),delete this.topbar,delete this.bubbles,delete this.input,delete this.selection,delete this.contextMenu,this.container.remove()}cleanup(e=!0){this.input.cleanup(e),this.topbar.cleanup(),this.selection.cleanup()}get isForumTopic(){return!(!this.isForum||!this.threadId)}onChangePeer(e,t){var i;return Oe(this,void 0,void 0,(function*(){const{peerId:s,threadId:n}=this,o=a.ZP.getTab(Ce);null==o||o.close();const[r,d,l,c,h,u,p,f,m,g]=yield t(Promise.all([this.managers.appPeersManager.noForwards(s),this.managers.appPeersManager.isPeerRestricted(s),this._isAnyGroup(s),this.setAutoDownloadMedia(),this.managers.appPeersManager.isMegagroup(s),this.managers.appPeersManager.isBroadcast(s),this.managers.appPeersManager.isChannel(s),this.managers.appPeersManager.isBot(s),this.managers.appPeersManager.isForum(s),this.managers.appMessagesManager.isAnonymousSending(s)]));m&&n&&(yield t(this.managers.dialogsStorage.getForumTopicOrReload(s,n))),this.noForwards=r,this.isRestricted=d,this.isAnyGroup=l,this.isMegagroup=h,this.isBroadcast=u,this.isChannel=p,this.isBot=f,this.isForum=m,this.isAllMessagesForum=m&&!n,this.isAnonymousSending=g,n&&!this.isForum&&(e.type="discussion");const v=null!==(i=e.type)&&void 0!==i?i:"chat";this.setType(v),this.messagesStorageKey=`${this.peerId}_${"scheduled"===this.type?"scheduled":"history"}`,this.container.classList.toggle("no-forwards",this.noForwards),this.sharedMediaTab=a.ZP.createSharedMediaTab(),this.sharedMediaTabs.push(this.sharedMediaTab),this.sharedMediaTab.setPeer(s,n),this.input.clearHelper(),this.selection.cleanup()}))}setPeer(e){const{peerId:t,threadId:i}=e;t?this.inited||(this.init&&(this.init(),this.init=null),this.inited=!0):this.inited=void 0;const s=this.appImManager.isSamePeer(this,e);if(s){if(this.setPeerPromise)return}else this.appImManager.dispatchEvent("peer_changing",this),this.peerId=t||pe.NM,this.threadId=i;if(!t)return a.ZP.toggleSidebar(!1),this.cleanup(!0),this.bubbles.setPeer({samePeer:!1,peerId:t}),this.peerId=0,this.appImManager.dispatchEvent("peer_changed",this),a.ZP.replaceSharedMediaTab(),this.destroySharedMediaTab(),void(this.sharedMediaTab=void 0);this.peerChanged=s;const n=this.bubbles.setPeer(Object.assign(Object.assign({},e),{samePeer:s})),o=this.setPeerPromise=n.then((e=>e.promise)).catch(Re.Z).finally((()=>{this.setPeerPromise===o&&(this.setPeerPromise=null)}));return n}destroySharedMediaTab(e=this.sharedMediaTab){e&&((0,Me.Z)(this.sharedMediaTabs,e),e.destroy())}setAutoDownloadMedia(){return Oe(this,void 0,void 0,(function*(){this.autoDownload=yield function(e){return t=this,i=void 0,n=function*(){let t,i=0,s=0,n=0;const a=d.Z.settings,o=d.Z.managers.appPeersManager;return!a.autoDownloadNew.pFlags.disabled&&e&&(t=e.isUser()?(yield o.isContact(e))?"contacts":"private":(yield o.isBroadcast(e))?"channels":"groups",a.autoDownload.photo[t]&&(i=a.autoDownloadNew.photo_size_max),a.autoDownload.video[t]&&(s=a.autoDownloadNew.video_size_max),a.autoDownload.file[t]&&(n=a.autoDownloadNew.file_size_max)),{photo:i,video:s,file:n}},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n}(this.peerId)}))}setMessageId(e,t){return this.setPeer({peerId:this.peerId,threadId:this.threadId,lastMsgId:e,mediaTimestamp:t})}finishPeerChange(e,t,i,s){return Oe(this,void 0,void 0,(function*(){if(this.peerChanged)return;const t=this.peerId;this.peerChanged=!0,this.wasAlreadyUsed=!0;const i=this.bubbles.getMiddleware();this.cleanup(!1);const n=this.sharedMediaTab,o=Promise.all([this.topbar.finishPeerChange(e),this.bubbles.finishPeerChange(),this.input.finishPeerChange(s),n.fillProfileElements()]),r=yield o;n.loadSidebarMedia(!0),i()&&(r.forEach((e=>{null==e||e()})),a.ZP.replaceSharedMediaTab(n),this.sharedMediaTabs.filter((e=>e!==n)).forEach((e=>this.destroySharedMediaTab(e))),this.container.dataset.type=this.type,this.log.setPrefix("CHAT-"+t+"-"+this.type),this.appImManager.dispatchEvent("peer_changed",this))}))}getMessage(e){return this.managers.appMessagesManager.getMessageFromStorage(this.messagesStorageKey,e)}getMidsByMid(e){return Oe(this,void 0,void 0,(function*(){return this.managers.appMessagesManager.getMidsByMessage(yield this.getMessage(e))}))}getHistoryStorage(e){return this.managers.appMessagesManager.getHistoryStorageTransferable(this.peerId,e?void 0:this.threadId).then((e=>Object.assign(Object.assign({},e),{history:Fe.Z.fromJSON(e.historySerialized)})))}getDialogOrTopic(){return this.isForum&&this.threadId?this.managers.dialogsStorage.getForumTopic(this.peerId,this.threadId):this.managers.dialogsStorage.getDialogOnly(this.peerId)}getHistoryMaxId(){return this.getHistoryStorage().then((e=>e.maxId))}_isAnyGroup(e){return Oe(this,void 0,void 0,(function*(){return e===d.Z.myId||e===pe.hj||(yield this.managers.appPeersManager.isAnyGroup(e))}))}initSearch(e){if(this.peerId)if(o.Z.isMobile)this.search?this.search.setQuery(e):this.search=new Pe(this.topbar,this,e);else{let t=a.ZP.getTab(Ce);t||(t=a.ZP.createTab(Ce)),t.open(this.peerId,this.threadId,this.bubbles.onDatePick,e)}}canSend(e){return this.managers.appMessagesManager.canSendToPeer(this.peerId,this.threadId,e)}isStartButtonNeeded(){return Promise.all([this.managers.appPeersManager.isBot(this.peerId),this.managers.appMessagesManager.getDialogOnly(this.peerId),this.getHistoryStorage(!0)]).then((([e,t,i])=>e&&!t&&!i.history.length))}getMessageSendingParams(){return{threadId:this.threadId,replyToMsgId:this.input.replyToMsgId,scheduleDate:this.input.scheduleDate,silent:this.input.sendSilent,sendAsPeerId:this.input.sendAsPeerId,updateStickersetOrder:d.Z.settings.stickers.dynamicPackOrder}}isOurMessage(e){return e.fromId===d.Z.myId||!!e.pFlags.out&&this.isMegagroup}isOutMessage(e){const t=e.fwd_from;return!(!this.isOurMessage(e)||t&&this.peerId===d.Z.myId)}isAvatarNeeded(e){return this.isAnyGroup&&!this.isOutMessage(e)}isPinnedMessagesNeeded(){return"chat"===this.type||this.isForum}canGiftPremium(){return this.peerId.isUser()&&this.managers.appProfileManager.canGiftPremium(this.peerId.toUserId())}}var He=i(805),ze=i(1452),je=i(8204),Ge=i(3228),Ve=i(2342),Ke=i(6637),We=i(7545);class $e{constructor(e){this.appImManager=e,this.buttons={},this.addedListener=!1,this.waitingForMouseUp=!1,this.mouseUpCounter=0,this.onMouseUpSingle=e=>{if(this.waitingForMouseUp=!1,z.Z){if(e&&(0,C.Z)(e),0!=this.mouseUpCounter++)return void this.hide();this.resetSelection(this.savedRange)}this.show()}}init(){this.container=document.createElement("div"),this.container.classList.add("markup-tooltip","z-depth-1","hide"),this.wrapper=document.createElement("div"),this.wrapper.classList.add("markup-tooltip-wrapper");const e=document.createElement("div"),t=document.createElement("div");e.classList.add("markup-tooltip-tools"),t.classList.add("markup-tooltip-tools"),["bold","italic","underline","strikethrough","monospace","spoiler","link"].forEach((t=>{const i=(0,v.Z)(t,{noRipple:!0});e.append(this.buttons[t]=i),"link"!==t?i.addEventListener("mousedown",(e=>{(0,C.Z)(e),this.appImManager.chat.input.applyMarkdown(t),this.cancelClosening()})):(0,L.fc)(i,(e=>{(0,C.Z)(e),this.showLinkEditor(),this.cancelClosening()}))})),this.linkBackButton=(0,v.Z)("left",{noRipple:!0}),this.linkInput=document.createElement("input"),(0,T.$d)(this.linkInput,"MarkupTooltip.LinkPlaceholder",void 0,"placeholder"),this.linkInput.classList.add("input-clear"),this.linkInput.addEventListener("keydown",(e=>{const t=!this.linkInput.value.length||!!(0,Ve.Z)(this.linkInput.value);"Enter"===e.key&&(t?this.applyLink(e):(this.linkInput.classList.contains("error")&&(this.linkInput.classList.remove("error"),this.linkInput.offsetLeft),this.linkInput.classList.add("error")))})),this.linkInput.addEventListener("input",(e=>{const t=this.isLinkValid();this.linkInput.classList.toggle("is-valid",t),this.linkInput.classList.remove("error")})),this.linkBackButton.addEventListener("mousedown",(e=>{(0,C.Z)(e),this.container.classList.remove("is-link"),this.resetSelection(),this.setTooltipPosition(),this.cancelClosening()})),this.linkApplyButton=(0,v.Z)("check markup-tooltip-link-apply",{noRipple:!0}),this.linkApplyButton.addEventListener("mousedown",(e=>{this.applyLink(e)}));const i=document.createElement("div");i.classList.add("markup-tooltip-link-apply-container");const s=document.createElement("span"),n=document.createElement("span"),a=document.createElement("span");s.classList.add("markup-tooltip-delimiter"),n.classList.add("markup-tooltip-delimiter"),a.classList.add("markup-tooltip-delimiter"),e.insertBefore(s,this.buttons.link),i.append(a,this.linkApplyButton),t.append(this.linkBackButton,n,this.linkInput,i),this.wrapper.append(e,t),this.container.append(this.wrapper),document.body.append(this.container),window.addEventListener("resize",(()=>{this.hide()}))}showLinkEditor(){this.container&&this.container.classList.contains("is-visible")||this.show();const e=this.buttons.link;this.container.classList.add("is-link");const t=document.getSelection();if(this.savedRange=t.getRangeAt(0),e.classList.contains("active")){const e=this.savedRange.startContainer.parentElement;this.linkInput.value=e.href}else this.linkInput.value="";this.setTooltipPosition(!0),setTimeout((()=>{this.linkInput.focus()}),200),this.linkInput.classList.toggle("is-valid",this.isLinkValid())}applyLink(e){(0,C.Z)(e),this.resetSelection();let t=this.linkInput.value;t&&!(0,Ke.Z)(t)&&(t="https://"+t),this.appImManager.chat.input.applyMarkdown("link",t),setTimeout((()=>{this.hide()}),0)}isLinkValid(){return!this.linkInput.value.length||!!(0,Ve.Z)(this.linkInput.value)}resetSelection(e=this.savedRange){const t=window.getSelection();t.removeAllRanges(),t.addRange(e),this.appImManager.chat.input.messageInput.focus()}hide(){this.init||(this.container.classList.remove("is-visible"),document.removeEventListener("mouseup",this.onMouseUpSingle),this.waitingForMouseUp=!1,Q.Z.removeByType("markup"),this.hideTimeout&&clearTimeout(this.hideTimeout),this.hideTimeout=window.setTimeout((()=>{this.hideTimeout=void 0,this.container.classList.add("hide"),this.container.classList.remove("is-link")}),200))}getActiveMarkupButton(){const e=new Set,t=Object.keys(this.buttons),i=(0,We.Z)(t);return t.forEach((t=>{i[t]&&e.add(this.buttons[t])})),[...e]}setActiveMarkupButton(){const e=this.getActiveMarkupButton();for(const t in this.buttons){const i=this.buttons[t];i.classList.toggle("active",e.includes(i))}}setTooltipPosition(e=!1){const t=document.getSelection().getRangeAt(0),i=document.body.getBoundingClientRect(),s=t.getBoundingClientRect(),n=this.appImManager.chat.input.rowsWrapper.getBoundingClientRect();this.container.style.maxWidth=n.width+"px";const a=(0,je.Z)(void 0,this.appImManager.chat.input.messageInput,!1,s).rect.top+-1*i.top,o=(this.container.classList.contains("is-link")?this.wrapper.lastElementChild:this.wrapper.firstElementChild).getBoundingClientRect(),r=a-o.height-8,d=n.left,l=n.left+n.width-Math.min(n.width,o.width);let c;if(e){const e=this.container.getBoundingClientRect();c=(0,Ge.Z)(e.left,d,l)}else{const e=s.left+(s.width-o.width)/2;c=(0,Ge.Z)(e,d,l)}this.container.style.transform=`translate3d(${c}px, ${r}px, 0)`}show(){if(this.init&&(this.init(),this.init=null),(0,ze.Z)())return void this.hide();if(void 0!==this.hideTimeout&&clearTimeout(this.hideTimeout),this.container.classList.contains("is-visible"))return;this.setActiveMarkupButton(),this.container.classList.remove("is-link");const e=this.container.classList.contains("hide");e&&(this.container.classList.remove("hide"),this.container.classList.add("no-transition")),this.setTooltipPosition(),e&&(this.container.offsetLeft,this.container.classList.remove("no-transition")),this.container.classList.add("is-visible"),f.IS_MOBILE||Q.Z.pushItem({type:"markup",onPop:()=>{this.hide()}})}setMouseUpEvent(){this.waitingForMouseUp||(this.waitingForMouseUp=!0,document.addEventListener("mouseup",this.onMouseUpSingle,{once:!0}))}cancelClosening(){z.Z&&!f.IS_APPLE&&(document.removeEventListener("mouseup",this.onMouseUpSingle),document.addEventListener("mouseup",(e=>{(0,C.Z)(e),this.mouseUpCounter=1,this.waitingForMouseUp=!1,this.setMouseUpEvent()}),{once:!0}))}handleSelection(){this.addedListener||(this.addedListener=!0,document.addEventListener("selectionchange",(e=>{if(document.activeElement===this.linkInput)return;const t=this.appImManager.chat.input.messageInput;if(document.activeElement!==t)return void this.hide();const i=document.getSelection();if((0,ze.Z)(i))this.hide();else if(z.Z)if(f.IS_APPLE)this.show(),this.setTooltipPosition();else{if(2===this.mouseUpCounter)return void(this.mouseUpCounter=0);this.savedRange=i.getRangeAt(0),this.setMouseUpEvent()}else this.container&&this.container.classList.contains("is-visible")?(this.setActiveMarkupButton(),this.setTooltipPosition()):t.matches(":active")?this.setMouseUpEvent():this.show()})),document.addEventListener("beforeinput",(e=>{"historyRedo"!==e.inputType&&"historyUndo"!==e.inputType||e.target.addEventListener("input",(()=>this.setActiveMarkupButton()),{once:!0})})))}}var qe=i(9171);class Ye{constructor(e,t){let i;this.options=t,this.onDragOver=e=>{this.container.classList.add("is-dragover")},this.onDragLeave=e=>{this.container.classList.remove("is-dragover")},this.onDrop=e=>{this.options.onDrop(e)},this.container=document.createElement("div"),this.container.classList.add("drop","z-depth-1"),this.outlineWrapper=document.createElement("div"),this.outlineWrapper.classList.add("drop-outline-wrapper"),this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.classList.add("drop-outline"),this.path=document.createElementNS("http://www.w3.org/2000/svg","path"),this.path.classList.add("drop-outline-path"),t.icon&&(i=document.createElement("div"),i.classList.add("drop-icon","tgico-"+t.icon));const s=document.createElement("div");let n;s.classList.add("drop-header"),s.append((0,T.ag)(t.header,t.headerArgs)),t.subtitle&&(n=document.createElement("div"),n.classList.add("drop-subtitle"),n.append((0,T.ag)(t.subtitle))),this.svg.append(this.path),this.outlineWrapper.append(this.svg),this.container.append(...[this.outlineWrapper,i,s,n].filter(Boolean)),e.append(this.container),this.container.addEventListener("dragover",this.onDragOver),this.container.addEventListener("dragleave",this.onDragLeave),this.container.addEventListener("drop",this.onDrop)}destroy(){delete this.options,this.container.remove(),this.container.removeEventListener("dragover",this.onDragOver),this.container.removeEventListener("dragleave",this.onDragLeave),this.container.removeEventListener("drop",this.onDrop)}setPath(){const e=this.outlineWrapper.getBoundingClientRect();this.svg.setAttributeNS(null,"preserveAspectRatio","none"),this.svg.setAttributeNS(null,"viewBox",`0 0 ${e.width} ${e.height}`),this.svg.setAttributeNS(null,"width",`${e.width}`),this.svg.setAttributeNS(null,"height",`${e.height}`);const t=10,i=e.width-t,s=e.height-t,n=(0,qe.Z)(5,5,i,s,t,t,t,t);this.path.setAttributeNS(null,"d",n)}}var Qe=i(3035),Xe=i(7922),Je=i(410);function et(e){e.forEach((e=>e.classList.add("no-transition"))),(0,Qe.d1)().then((()=>{e.forEach((e=>e.classList.remove("no-transition")))}))}var tt=i(2398),it=i(490),st=i(9298),nt=i(1842),at=i(8737),ot=i(2341),rt=i(1174),dt=i(2831),lt=i(2207);class ct{constructor(e){this.maxRadius=10,this.minRadius=0,this.N=e,this.radius=new Array(e+1),this.radiusNext=new Array(e+1),this.progress=new Array(e+1),this.speed=new Array(e+1);for(let t=0;t<=e;t++)this.generateBlob(this.radius,t),this.generateBlob(this.radiusNext,t),this.progress[t]=0}generateBlob(e,t){const{maxRadius:i,minRadius:s,speed:n}=this,a=i-s;e[t]=s+Math.random()*a,n[t]=.017+.003*Math.random()}generateNextBlob(){const{radius:e,radiusNext:t,progress:i,N:s}=this;for(let n=0;n=1&&(s[r]=0,a[r]=o[r],this.generateBlob(o,r))}draw(e,t,i,s,n,a,o,r){if(n.getContext){const d=n.getContext("2d");d.beginPath(),d.moveTo(i,s),d.lineTo(e,s);const{radius:l,radiusNext:c,N:h}=this;for(let n=0;n<=h;n++)if(0===n){const i=this.progress[n],s=(t-(l[n]*(1-i)+c[n]*i))*r+o*(1-r);d.lineTo(e,s)}else{const a=this.progress[n-1],u=l[n-1]*(1-a)+c[n-1]*a,p=this.progress[n],f=(i-e)/h*(n-1),m=(i-e)/h*n,g=f+(m-f)/2,v=(t-u)*r+o*(1-r),b=(t-(l[n]*(1-p)+c[n]*p))*r+o*(1-r);d.bezierCurveTo(g,v,g,b,m,b),n===h&&d.lineTo(i,s)}a(d),d.fill(),d.closePath()}}}class ht{constructor(e){this.stateId=e,this.createGradient(e)}createGradient(e){this.shader=(t,i,s,n,a)=>{t.fillStyle=ht.getGradientFromType(t,e,i,s,n,a)}}static getGradientFromType(e,t,i,s,n,a){const o=e.createLinearGradient(i,s,n,a);return t===lt.Z.MUTED_BY_ADMIN?(o.addColorStop(0,"#F05459"),o.addColorStop(.4,"#766EE9"),o.addColorStop(1,"#57A4FE")):t===lt.Z.UNMUTED?(o.addColorStop(0,"#52CE5D"),o.addColorStop(1,"#00B1C0")):t===lt.Z.MUTED?(o.addColorStop(0,"#0976E3"),o.addColorStop(1,"#2BCEFF")):t===lt.Z.CONNECTING&&(o.addColorStop(0,"#8599aa"),o.addColorStop(1,"#8599aa")),o}update(e,t,i,s){}}class ut{constructor(){this.handleDevicePixelRatioChanged=e=>{this.setSize(),this.forceUpdate()},this.handleResize=()=>{this.resizeHandler&&(clearTimeout(this.resizeHandler),this.resizeHandler=null),this.resizing=!0,this.resizeCanvas(),this.resizeHandler=window.setTimeout((()=>{this.resizing=!1,this.invokeDraw()}),250)},this.handleFocus=()=>{this.focused=!0,this.invokeDraw()},this.handleBlur=()=>{this.focused=!1},this.invokeDraw=()=>{this.raf||this.draw()},this.draw=(e=!1)=>{if(this.raf=null,!this.mounted)return;const{lbd:t,lbd1:i,lbd2:s,scale:n,left:a,top:o,right:r,bottom:d,currentState:l,previousState:c,focused:h,resizing:u,canvas:p}=this;if(!h&&!u&&this.progressToState>=1)return;let f=Date.now()-this.lastUpdateTime;f>20&&(f=17),this.animateToAmplitude!==this.amplitude&&(this.amplitude+=this.animateAmplitudeDiff*f,this.animateAmplitudeDiff>0?this.amplitude>this.animateToAmplitude&&(this.amplitude=this.animateToAmplitude):this.amplitude0?this.amplitude2>this.animateToAmplitude&&(this.amplitude2=this.animateToAmplitude):this.amplitude21&&(this.progressToState=1,this.previousState=null));const{amplitude:m,amplitude2:g,progressToState:v}=this,b=6*g*n,y=6*g*n;p.getContext("2d").clearRect(0,0,p.width,p.height),t.minRadius=0,t.maxRadius=(2+2*m)*n,i.minRadius=0,i.maxRadius=(3+9*m)*n,s.minRadius=0,s.maxRadius=(3+9*m)*n,t.update(m,.3),i.update(m,.7),s.update(m,.7);for(let e=0;e<2;e++){if(0===e&&!c)continue;let n=1,h=null;0===e?(n=1-v,h=c):(n=c?v:1,l.update(d-o,r-a,f,m),h=l);const u=e=>{e.globalAlpha=.3*n,h.shader(e,a,o,r,d)},g=t=>{t.globalAlpha=0===e?1:n,h.shader(t,a,o,r,d)};i.draw(a,o-b,r,d,p,u,o,1),s.draw(a,o-y,r,d,p,u,o,1),t.draw(a,o,r,d,p,g,o,1)}e||(this.raf=requestAnimationFrame((()=>this.draw())))},this.setCurrentState=(e,t)=>{const{currentState:i,states:s}=this;(null==i?void 0:i.stateId)!==e&&(this.previousState=t?i:null,this.currentState=s.get(e),this.progressToState=this.previousState?0:1)},this.focused=!0,this.resizing=!1,this.lastUpdateTime=Date.now(),this.amplitude=0,this.amplitude2=0,this.states=new Map([[lt.Z.UNMUTED,new ht(lt.Z.UNMUTED)],[lt.Z.MUTED,new ht(lt.Z.MUTED)],[lt.Z.MUTED_BY_ADMIN,new ht(lt.Z.MUTED_BY_ADMIN)],[lt.Z.CONNECTING,new ht(lt.Z.CONNECTING)]]),this.previousState=null,this.currentState=this.states.get(lt.Z.CONNECTING),this.progressToState=1}componentDidMount(){this.mounted||(this.mounted=!0,window.addEventListener("resize",this.handleResize),this.media=window.matchMedia("screen and (min-resolution: 2dppx)"),this.media.addEventListener("change",this.handleDevicePixelRatioChanged),this.setSize(),this.forceUpdate(),this.lbd=new ct(3),this.lbd1=new ct(7),this.lbd2=new ct(8),this.setAmplitude(this.amplitude),this.draw())}componentWillUnmount(){this.mounted=!1,window.removeEventListener("resize",this.handleResize),this.media.addEventListener("change",this.handleDevicePixelRatioChanged);const{canvas:e}=this;e.getContext("2d").clearRect(0,0,e.width,e.height)}setSize(){this.scale=window.devicePixelRatio,this.top=20*this.scale,this.right=(this.mounted?this.container.offsetWidth:1261)*this.scale,this.bottom=(this.mounted?this.container.offsetHeight:68)*this.scale,this.left=0*this.scale,this.setCanvasSize()}setCanvasSize(){this.canvas.width=this.right,this.canvas.height=this.bottom}resizeCanvas(){this.scale=window.devicePixelRatio,this.right=this.container.offsetWidth*this.scale,this.forceUpdate(),this.invokeDraw()}setAmplitude(e){const{amplitude:t}=this;this.animateToAmplitude=e,this.animateAmplitudeDiff=(e-t)/250,this.animateAmplitudeDiff2=(e-t)/120}forceUpdate(){this.setCanvasSize()}render(e){const t=this.container=document.createElement("div");t.classList.add(e);const i=this.canvas=document.createElement("canvas");return i.classList.add(e+"-canvas"),t.append(i),t}}var pt=i(8222),ft=i(1447);class mt{constructor(e,t){this.item=e,(0,I.Z)(this,t)}play(e){return this.item.playPart(this,e)}}class gt{constructor(e,t){this.icon=e,this.autoplay=!1,(0,I.Z)(this,t),this.parts=this.parts.map((e=>this.createPart(e)))}load(){var e;let t=this.loadPromise;if(t)return t;const{container:i,canvas:s,width:n,height:a}=this.icon;return t=ft.Z.loadAnimationAsAsset({container:i,canvas:s,width:n,height:a,group:"none",loop:!1,autoplay:null!==(e=this.autoplay)&&void 0!==e&&e,initFrame:this.initFrame,skipFirstFrameRendering:void 0===this.initFrame,color:this.color,inverseColor:this.inverseColor},this.name).then((e=>ft.Z.waitForFirstFrame(e))).then((e=>{this.player=e,this.onLoadForColor&&(this.onLoadForColor(),this.onLoadForColor=void 0),this.onLoadForPart&&(this.onLoadForPart(),this.onLoadForPart=void 0)})),this.loadPromise=t,this.icon.loadPromises.set(this.name,t),t}createPart(e){return new mt(this,e)}getPart(e){return e instanceof mt?e:"string"==typeof e?this.parts.find((t=>t.name===e)):this.parts[e]}playPart(e,t){return this.icon.playPart(this,e,t)}}class vt{constructor(e){(0,I.Z)(this,e),this.container||(this.container=document.createElement("div")),this.container.classList.add("rlottie-icon");const{width:t,height:i}=this;this.container.style.width=t+"px",this.container.style.height=i+"px";const s=this.canvas=document.createElement("canvas");s.classList.add("rlottie"),s.width=t,s.height=i,this.items=new Map,this.loadPromises=new Map}get loadPromise(){return Promise.all([...this.loadPromises.values()]).then(Re.Z)}getItem(e){return e||1!==this.items.size?this.items.get(e):this.items.values().next().value}add(e){const t=new gt(this,e);return this.items.set(e.name,t),t}playPart(e,t,i){if(!e.player)return void(e.onLoadForPart=()=>{this.playPart(e,t,i)});const s=e.getPart(t);e.player.playPart({from:Ne.Z.isAvailable("animations")&&!this.skipAnimation?s.startFrame:s.endFrame,to:s.endFrame,callback:i})}static generateEqualParts(e,t){return new Array(e).fill(0).map(((e,i)=>{const s=i*t;return{startFrame:s,endFrame:s+t-1}}))}}class bt extends vt{constructor(e){super({width:e.width,height:e.height}),(0,I.Z)(this,e)}load(e,t){if(this.loaded)return this.loadPromise;this.loaded=!0,this.partState=e,this.colorState=t;const i=this.getPart(e),s=void 0!==t&&this.getColor&&this.getColor(t),n=i.item;n.initFrame=i.endFrame,n.color=s;const a=[...this.items.values()].map((e=>e.load()));return Promise.all(a).then(Re.Z)}setState(e,t,i){this.loaded||this.load(e,t);let s=!1,n=!1;return void 0!==e?s=this.setPartState(e,t,i):void 0!==t&&(n=this.setColorState(t)),s||n}setPartState(e,t,i){const{partState:s}=this;return s===e?void 0!==t&&this.setColorState(t):(void 0!==t&&this.setColorState(t,!1),this.partState=e,this.getPart(e,s).play(i),!0)}setColorState(e,t=!0){const{colorState:i}=this;if(i===e||!this.getColor)return!1;this.colorState=e;const s=this.getItem(),n=this.getColor(e,i),a=()=>{s.player.setColor(n,t)};return s.player?a():s.onLoadForColor=a,!0}destroy(){this.items.forEach((e=>{e.loadPromise.then((()=>{e.player.remove()}))}))}}class yt extends bt{constructor(){super({width:36,height:36,getPart:(e,t)=>{const i=oi;let s;switch(e){case i.HAND:s=t===i.MUTED?"muted-to-hand":"unmuted-to-hand";break;case i.MUTED:s=t===i.HAND?"hand-to-muted":"mute";break;case i.UNMUTED:s="unmute"}return this.getItem().getPart(s)}}),this.container.classList.add("group-call-microphone-icon-container"),this.add({name:"voip_filled",parts:[{startFrame:0,endFrame:35,name:"hand-to-muted"},{startFrame:36,endFrame:68,name:"unmute"},{startFrame:69,endFrame:98,name:"mute"},{startFrame:99,endFrame:135,name:"muted-to-hand"},{startFrame:136,endFrame:172,name:"unmuted-to-hand"},{startFrame:173,endFrame:201,name:"scheduled-crossing"},{startFrame:202,endFrame:236,name:"scheduled-to-muted"},{startFrame:237,endFrame:273,name:"scheduled-to-hand"},{startFrame:274,endFrame:310,name:"scheduled-crossed-to-hand"},{startFrame:311,endFrame:343,name:"scheduled-uncrossing"},{startFrame:344,endFrame:375,name:"scheduled-to-muted"},{startFrame:376,endFrame:403,name:"play-to-muted"}]})}}var wt=i(2353),St=i(3416),Ct=i(6976),Lt=i(6733),It=i(1483),Et=i(8936),Pt=i(2946),Zt=i(3003),Mt=i(5592),Tt=i(8805),kt=i(4484),xt=i(5345);class At extends bt{constructor(e){super({width:32,height:32,getPart:(e,t)=>{const i=ai;let s;switch(e){case i.HAND:s=3;break;case i.MUTED:s=t===i.HAND?0:2;break;case i.UNMUTED:s=1}return this.getItem().getPart(s)},getColor:e?(e,t)=>function(e){const t=ai;let i;switch(e){case t.HAND:i="blue";break;case t.MUTED:case t.MUTED_FOR_ME:case t.MUTED_BY_ADMIN:i=e===t.MUTED?"secondary":"red";break;case t.UNMUTED:i="green"}const s=pt.Z.getProperty("gc-"+i+"-text-color");return(0,Be.oo)(s)}(e):void 0}),this.colored=e,this.container.classList.add("group-call-participant-muted-icon-container");const t=vt.generateEqualParts(4,21);this.add({name:"voice_outlined2",parts:t})}setState(e){return super.setState(function(e){const t=ai;switch(e){case t.MUTED_BY_ADMIN:case t.MUTED_FOR_ME:return t.MUTED;default:return e}}(e),e)}}var _t=i(130);const Ft="group-call-participant-status";class Dt{constructor(e){this.withIcons=e,this.container=document.createElement("div"),this.container.classList.add(Ft+"-container")}setState(e,t){const i=ai,s=this.withIcons.filter((e=>!!t[e])).map((e=>{const t="tgico-"+("presentation"===e?"listscreenshare":"videocamera_filled"),i=document.createElement("i");return i.classList.add(Ft+"-icon",Ft+"-icon-"+e,t),i}));let n,a;if(e===i.MUTED_FOR_ME)n=(0,T.ag)("VoiceChat.Status.MutedForYou"),a="is-muted";else if(e===i.UNMUTED)n=(0,T.ag)("VoiceChat.Status.Speaking"),a="is-speaking";else if(e===i.HAND)n=(0,T.ag)("VoiceChat.Status.WantsSpeak"),a="is-waiting";else{if(t.about&&!s.length)return void(0,_t.Z)(this.container,(0,_.Z)(t.about));n=(0,T.ag)("VoiceChat.Status.Listening"),a="is-listening"}const o=document.createElement("span");o.classList.add(Ft,a),o.append(...s,n),(0,Z.Z)(this.container,o)}}var Rt=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class Bt extends xt.Z{constructor(e){super({getIndex:e=>Rt(this,void 0,void 0,(function*(){return(yield this.instance.getParticipantByPeerId(e.id)).date})),onDelete:e=>{e.dom.listEl.remove(),this.onElementDestroy(e)},onUpdate:e=>Rt(this,void 0,void 0,(function*(){const t=yield this.instance.getParticipantByPeerId(e.id),i=ri(t);e.mutedIcon.setState(i),e.status.setState(i,t)})),onSort:(e,t)=>{(0,kt.Z)(e.dom.listEl,this.list,t)},onElementCreate:e=>{const{dom:t}=Ee.default.addDialogNew({peerId:e.id,container:!1,avatarSize:this.avatarSize,autonomous:this.autonomous,meAsSaved:!1,rippleEnabled:this.rippleEnabled,wrapOptions:{lazyLoadQueue:this.lazyLoadQueue}});t.listEl.classList.add("group-call-participant");const i=new At(!0),s=new Dt(["presentation","video"]);return(0,Z.Z)(t.lastMessageSpan,s.container),t.listEl.append(i.container),e.mutedIcon=i,e.status=s,e.dom=t,e},updateElementWith:Qe.T2}),this.instance=e,this.avatarSize="abitbigger",this.rippleEnabled=!0,this.autonomous=!0,this.createChatListOptions={dialogSize:72},this.list=Ee.default.createChatList(this.createChatListOptions)}destroy(){this.elements.forEach((e=>{this.onElementDestroy(e)}))}onElementDestroy(e){e.mutedIcon.destroy()}}var Nt=i(7529),Ot=i(5296);function Ut(e){const t=document.createElement("canvas");t.classList.add("call-video-blur"),t.width=16,t.height=16;const i=t.getContext("2d",{alpha:!1});i.filter="blur(2px)";const s=()=>{i.drawImage(e,0,0,e.videoWidth,e.videoHeight,0,0,t.width,t.height)};return(0,Ot.jt)((()=>(s(),t.isConnected))),s(),t}const Ht="group-call-participant-video";class zt{constructor(e,t,i){this.managers=e,this.instance=t,this.source=i,this.container=document.createElement("div"),this.container.classList.add(Ht+"-container"),this.info=document.createElement("div"),this.info.classList.add(Ht+"-info"),this.left=document.createElement("div"),this.left.classList.add(Ht+"-info-left"),this.right=document.createElement("div"),this.right.classList.add(Ht+"-info-right"),this.info.append(this.left,this.right),this.container.append(this.info)}setPinned(e){if(!e)return void(this.header&&(this.header.remove(),this.header=void 0));if(this.header)return;this.header=document.createElement("div"),this.header.classList.add(Ht+"-header");const t=document.createElement("i");t.classList.add("group-call-pin-icon","tgico-pin"),this.header.append(t),this.container.append(this.header)}setParticipant(e,t,i){let s;e.pFlags.self?(s=(0,T.ag)("VoiceChat.Status.You"),s.classList.add("peer-title")):(this.peerTitle=new M.Z({peerId:(0,Pt.Z)(e.peer)}),s=this.peerTitle.element),this.groupCallParticipantMutedIcon=new At(!1),this.groupCallParticipantStatus=new Dt([t]),this.left.append(s,this.groupCallParticipantStatus.container),this.right.append(this.groupCallParticipantMutedIcon.container),i.classList.add(Ht,"call-video"),i.paused&&i.play();const n=Ut(i);n.classList.add(Ht+"-blur"),this.container.prepend(n,i),this.updateParticipant(e)}updateParticipant(e){const t=ri(e);this.groupCallParticipantMutedIcon.setState(t),this.groupCallParticipantStatus.setState(t,e)}destroy(){this.groupCallParticipantMutedIcon.destroy()}}class jt extends Nt.Z{constructor(e){super(),(0,I.Z)(this,e);const t=this.container=document.createElement("div");this.container.classList.add("group-call-participants-video-container"),e.appendTo.append(t),this.participantsElements=new Map,this.containers=new Map;const{listenerSetter:i}=this;i.add(d.Z)("group_call_participant",(({groupCallId:e,participant:t})=>{this.instance.id===e&&this.updateParticipant(t)})),i.add(this.instance)("pinned",(e=>{this.participantsElements.forEach((t=>{t.forEach((t=>{this.setElementDisplay(t,e)}))}))})),(0,L.fc)(this.container,(e=>{const t=(0,X.Z)(e.target,"group-call-participant-video-container");if(!t)return;const i=this.containers.get(t);this.instance.pinnedSource!==i.source?this.instance.pinSource(i.source):this.instance.unpinAll()}),{listenerSetter:i}),this.setInstance(this.instance),this.setup({element:t,listenerSetter:i,showOnLeaveToClassName:"group-call-buttons"})}shouldDisplayElement(e,t){return this.displayPinned?!t||e.source===t:t&&e.source!==t}setElementDisplay(e,t){const i=this.shouldDisplayElement(e,t);e.container.classList.toggle("video-hidden",!i);const s=e.source===t;e.setPinned(s)}updateParticipant(e){const t=(0,Pt.Z)(e.peer),i=["video","presentation"],s=i.some((t=>!!e[t]));let n=this.participantsElements.get(t);(s||n)&&(n||this.participantsElements.set(t,n=new Map),i.forEach((i=>{let s=n.get(i);const a=e[i];if(!!a!=!!s){if(a){const t=this.instance.getVideoElementFromParticipantByType(e,i);if(!t)return;const{video:a,source:o}=t;s=new zt(this.managers,this.instance,o),this.containers.set(s.container,s),this.setElementDisplay(s,this.instance.pinnedSource),n.set(i,s),s.setParticipant(e,i,a),this.container.prepend(s.container)}else n.delete(i),s.container.remove(),n.size||(this.participantsElements.delete(t),this.containers.delete(s.container),s.destroy());this._onLengthChange()}else s&&s.updateParticipant(e)})))}_onLengthChange(){const e=this.container.childElementCount;this.container.dataset.length=""+e,this.container.dataset.layout=e<=2?"1":3===e?"3":"4",this.onLengthChange&&this.onLengthChange(e)}setInstance(e){return t=this,i=void 0,n=function*(){(yield e.participants).forEach((e=>{this.updateParticipant(e)}))},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n}destroy(){this.containers.forEach((e=>{e.destroy()}))}}var Gt=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class Vt{constructor(e){this.onOpenProfileClick=()=>{const e=V.Z.getPopups(ci)[0];e&&e.hide(),Ls.setInnerPeer({peerId:this.targetPeerId})},this.toggleParticipantMuted=e=>{this.instance.editParticipant(this.participant,{muted:e})},this.buttons=[{icon:"gc_microphoneoff",text:"VoiceChat.MutePeer",verify:()=>this.canManageCall&&this.participant.pFlags.can_self_unmute,onClick:()=>this.toggleParticipantMuted(!0)},{icon:"gc_microphone",text:"VoiceChat.UnmutePeer",verify:()=>this.canManageCall&&!this.participant.pFlags.can_self_unmute,onClick:()=>this.toggleParticipantMuted(!1)},{icon:"gc_microphoneoff",text:"VoiceChat.MuteForMe",verify:()=>!this.canManageCall&&!this.participant.pFlags.muted_by_you,onClick:()=>this.toggleParticipantMuted(!0)},{icon:"gc_microphone",text:"VoiceChat.UnmuteForMe",verify:()=>!this.canManageCall&&this.participant.pFlags.muted_by_you,onClick:()=>this.toggleParticipantMuted(!1)},{icon:"newprivate",text:"VoiceChat.OpenProfile",verify:()=>!0,onClick:this.onOpenProfileClick},{icon:"deleteuser danger",text:"VoiceChat.RemovePeer",verify:()=>this.managers.appChatsManager.hasRights(this.chatId,"ban_users"),onClick:()=>Gt(this,void 0,void 0,(function*(){(0,Mt.Z)({peerId:this.targetPeerId,title:new M.Z({peerId:this.targetPeerId}).element,descriptionLangKey:(yield this.managers.appChatsManager.isBroadcast(this.chatId))?"VoiceChat.RemovePeer.Confirm.Channel":"VoiceChat.RemovePeer.Confirm",descriptionLangArgs:[new M.Z({peerId:this.targetPeerId}).element],button:{langKey:"VoiceChat.RemovePeer.Confirm.OK",isDanger:!0}}).then((()=>{this.managers.appChatsManager.kickFromChat(this.chatId,this.targetPeerId)}),Re.Z)}))}];const{listenerSetter:t}=e;this.managers=e.managers,this.instance=e.instance,this.chatId=this.instance.chatId,this.element=(0,Zt.b)({buttons:this.buttons,listenerSetter:t}),this.element.classList.add("group-call-participant-menu","night"),(0,Ct.E)({element:e.onContextElement,callback:e=>Gt(this,void 0,void 0,(function*(){const t=(0,X.Z)(e.target,"group-call-participant");if(!t)return;this.element.parentElement!==i&&i.append(this.element),(0,C.Z)(e);const s=this.targetPeerId=t.dataset.peerId.toPeerId();this.participant=yield this.instance.getParticipantByPeerId(s),this.participant.pFlags.self||(this.canManageCall=yield this.managers.appChatsManager.hasRights(this.chatId,"manage_call"),yield(0,wt.Z)(this.buttons,(e=>Gt(this,void 0,void 0,(function*(){const t=yield e.verify(s);return e.element.classList.toggle("hide",!t),t})))),(0,It.Z)(e.touches?e.touches[0]:e,this.element,"right"),St.Z.openBtnMenu(this.element))})),listenerSetter:t}),t.add(d.Z)("group_call_participant",(({groupCallId:e,participant:t})=>{if(this.instance.id===e){const e=(0,Pt.Z)(t.peer);this.targetPeerId===e&&St.Z.close()}}));let i=document.body;(0,Lt.Ms)(document.body,(()=>{const e=(0,Lt.rB)();i=e?V.Z.getPopups(ci)[0].getContainer():document.body,e||St.Z.close()}),t)}}class Kt{constructor(e){(0,I.Z)(this,e);const t="group-call-participants",i=new Tt.ZP(void 0);i.container.classList.add(t+"-scrollable");const s=this.container=document.createElement("div");s.classList.add(t);const n=this.sortedList=new Bt(this.instance),{instance:a,listenerSetter:o}=this;this.contextMenu=new Vt(Object.assign(Object.assign({},e),{onContextElement:n.list,listenerSetter:o,instance:a})),this.groupCallParticipantsVideo=new jt(Object.assign(Object.assign({},e),{appendTo:i.container,displayPinned:!1})),i.append(n.list),s.append(i.container),e.appendTo.append(s),o.add(d.Z)("group_call_participant",(({groupCallId:e,participant:t})=>{this.instance.id===e&&this.updateParticipant(t)})),new Et.Z({scrollable:i,getPromise:()=>this.managers.appGroupCallsManager.getGroupCallParticipants(this.instance.id).then((({participants:e,isEnd:t})=>(e.forEach((e=>{this.updateParticipant(e)})),t)))}),this.setInstance(a)}updateParticipant(e){const t=(0,Pt.Z)(e.peer),i=this.sortedList.has(t);e.pFlags.left?i&&this.sortedList.delete(t):i?this.sortedList.update(t):this.sortedList.add(t)}setInstance(e){return Gt(this,void 0,void 0,(function*(){(yield e.participants).forEach((e=>{this.updateParticipant(e)}))}))}destroy(){this.sortedList.destroy(),this.groupCallParticipantsVideo.destroy()}}class Wt{constructor(e){this.appendTo=e,this.descriptionIntl=new T.ZP.IntlElement({key:"VoiceChat.Status.Connecting"}),this.descriptionIntl.element.classList.add("group-call-description")}detach(){this.descriptionIntl.element.remove()}update(e){const{state:t}=e;let i,s;t===lt.Z.CONNECTING?i="VoiceChat.Status.Connecting":(i="VoiceChat.Status.Members",s=[e.groupCall.participants_count]);const{descriptionIntl:n}=this;n.compareAndUpdate({key:i,args:s}),this.descriptionIntl.element.parentElement||this.appendTo.append(this.descriptionIntl.element)}}class $t{constructor(e){this.appendTo=e,this.peerTitle=new M.Z({peerId:0})}update(e){const{peerTitle:t,appendTo:i}=this,s=e.groupCall,n=e.chatId.toPeerId(!0);s.title?(0,_t.Z)(i,(0,_.Z)(s.title)):(t.options.peerId!==n&&(t.options.peerId=n,t.update()),t.element.parentElement!==i&&i.append(t.element))}}var qt=i(2820);function Yt(e,t,i){const s=e+"-button",n=document.createElement("div");n.classList.add(s,"call-button","rp-overflow"),i.icon&&n.classList.add("tgico-"+i.icon),i.noRipple||(0,S.Z)(n),i.isDanger&&n.classList.add(s+"-red"),i.isConfirm&&n.classList.add(s+"-green"),i.callback&&(0,L.fc)(n,i.callback,{listenerSetter:t});let a=n;if(i.text){const e=document.createElement("div");e.classList.add(s+"-container","call-button-container");const t="string"==typeof i.text?(0,T.ag)(i.text):i.text;t.classList.add(s+"-text","call-button-text"),e.append(n,t),a=e}return a}var Qt=i(3757);const Xt="movable-element",Jt=Xt+"-resize-handler";class ei extends l.Z{constructor(e){super(!0),this.onResize=()=>{this.fixDimensions(),this.fixPosition(),this.setPosition()},(0,I.Z)(this,e),this.top=this.left=this.width=this.height=0,this.element.classList.add(Xt),this.addResizeHandlers(),this.setSwipeHandler(),o.Z.addEventListener("resize",this.onResize)}destroyElements(){this.element.classList.remove(Xt),this.handlers&&this.handlers.forEach((e=>{e.remove()}))}destroy(){o.Z.removeEventListener("resize",this.onResize),this.swipeHandler.removeListeners()}addResizeHandlers(){this.handlers=["n","e","s","w","ne","se","sw","nw"].map((e=>{const t=document.createElement("div");return t.dataset.side=e,t.classList.add(Jt,Jt+"-side-"+e),this.element.append(t),t}))}setSwipeHandler(){let e,t,i,s,n;const a=this.swipeHandler=new Qt.Z({element:this.element,onSwipe:(a,o,r)=>{if(n){if(n.includes("e")||n.includes("w")){const e=n.includes("e")&&a>0||n.includes("w")&&a<0,s=Math.abs(a)*(e?1:-1),o=n.includes("e")?ke.Z.width-t:i+t;this.width=Math.min(o,i+s)}if(n.includes("n")||n.includes("s")){const t=n.includes("s")&&o>0||n.includes("n")&&o<0,i=Math.abs(o)*(t?1:-1),a=n.includes("s")?ke.Z.height-e:s+e;this.height=Math.min(a,s+i)}this.fixDimensions(),n.includes("w")&&(this.left=Math.min(t+i-this.minWidth,t+a)),n.includes("n")&&(this.top=Math.min(e+s-this.minHeight,e+o))}else this.top=e+o,this.left=t+a;this.fixPosition(),this.setPosition()},verifyTouchTarget:e=>{const t=e.target;if(this.verifyTouchTarget&&!this.verifyTouchTarget(e))return!1;const i=(0,X.Z)(t,Jt);return i?(n=i.dataset.side,a.setCursor("")):(n=void 0,a.setCursor("grabbing")),!0},onFirstSwipe:()=>{e=this.top,t=this.left,i=this.width,s=this.height}})}setPositionToCenter(){this.top=ke.Z.height/2-this.height/2,this.left=ke.Z.width/2-this.width/2,this.setPosition()}fixDimensions(){this.width=(0,Ge.Z)(this.width,this.minWidth,ke.Z.width),this.height=(0,Ge.Z)(this.height,this.minHeight,ke.Z.height)}fixPosition(){this.top=(0,Ge.Z)(this.top,0,ke.Z.height-this.height),this.left=(0,Ge.Z)(this.left,0,ke.Z.width-this.width)}setPosition(){this.element.style.top=this.top+"px",this.element.style.left=this.left+"px",this.element.style.right="auto",this.element.style.bottom="auto",this.element.style.width=this.width+"px",this.element.style.height=this.height+"px",this.dispatchEvent("resize")}get width(){return this._width}get height(){return this._height}set width(e){this._width=e}set height(e){this._height=e}get state(){const{top:e,left:t,width:i,height:s}=this;return{top:e,left:t,width:i,height:s}}set state(e){const{top:t,left:i,width:s,height:n}=e;this.top=t,this.left=i,this.width=s,this.height=n,this.onResize()}}var ti,ii=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i};class si{constructor(e){ti.set(this,void 0),(0,I.Z)(this,e),this.toggleMovable(!z.Z),this.listenerSetter.add(o.Z)("changeScreen",((e,t)=>{t!==o._.mobile&&e!==o._.mobile||this.toggleMovable(!z.Z)}))}destroy(){const e=this.movable;e&&e.destroy()}get movable(){return function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)}(this,ti,"f")}get state(){return this.movable?this.movable.state:this.previousState}set state(e){this.previousState=e}toggleMovable(e){let{movable:t}=this;if(e){if(t)return;t=ii(this,ti,new ei(this.movableOptions),"f"),t.state=this.previousState,void 0===this.previousState.top&&t.setPositionToCenter(),this.onResize&&this.listenerSetter.add(t)("resize",this.onResize)}else{if(!t)return;this.previousState=t.state,t.destroyElements(),t.destroy(),ii(this,ti,void 0,"f")}}}function ni(e,t,i){return t.forEach((t=>{t.classList.toggle(e,i)})),()=>ni(e,t,!i)}ti=new WeakMap;var ai,oi;function ri(e){const t=ai;return e.pFlags.muted_by_you?t.MUTED_FOR_ME:void 0!==e.raise_hand_rating?t.HAND:e.pFlags.muted?e.pFlags.can_self_unmute?t.MUTED:t.MUTED_BY_ADMIN:t.UNMUTED}!function(e){e[e.UNMUTED=0]="UNMUTED",e[e.MUTED=1]="MUTED",e[e.MUTED_FOR_ME=2]="MUTED_FOR_ME",e[e.MUTED_BY_ADMIN=3]="MUTED_BY_ADMIN",e[e.HAND=4]="HAND"}(ai||(ai={})),function(e){e[e.HAND=0]="HAND",e[e.MUTED=1]="MUTED",e[e.UNMUTED=2]="UNMUTED"}(oi||(oi={}));let di={width:420,height:640};const li="group-call";class ci extends V.Z{constructor(){super("popup-group-call",{body:!0,withoutOverlay:!0,closable:!0,title:!0}),this.onFullScreenClick=()=>{(0,Lt.Dj)(this.container)},this.onToggleControls=e=>{this.container.classList.toggle("show-controls",e),this.buttonsContainer.classList.toggle("show-controls",e)},this.toggleDisability=ni.bind(null,"btn-disabled"),this.onVideoClick=()=>{const e=this.toggleDisability([this.btnVideo],!0);this.instance.toggleVideoSharing().finally((()=>{e()}))},this.onScreenClick=()=>{const e=this.toggleDisability([this.btnScreen],!0);this.instance.toggleScreenSharing().finally((()=>{e()}))},this.onMuteClick=()=>{const e=this.instance.participant;e.pFlags.can_self_unmute?this.instance.toggleMuted():void 0===e.raise_hand_rating&&this.instance.changeRaiseHand(!0)},this.onLeaveClick=()=>{return e=this,t=void 0,s=function*(){const e=e=>{this.instance.hangUp(e)};(yield this.managers.appChatsManager.hasRights(this.instance.chatId,"manage_call"))?V.Z.createPopup(se.Z,"popup-end-video-chat",{titleLangKey:"VoiceChat.End.Title",descriptionLangKey:"VoiceChat.End.Text",checkboxes:[{text:"VoiceChat.End.Third"}],buttons:[{langKey:"VoiceChat.End.OK",callback:t=>{e(!!t.size)},isDanger:!0}]}).show():e(!1)},new((i=void 0)||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}));var e,t,i,s},this.onFullScreenChange=()=>{this.toggleBigLayout();const e=(0,Lt.rB)(),{btnFullScreen:t,btnExitFullScreen:i}=this,n=this.container.classList.contains("is-full-screen");this.container.classList.toggle("is-full-screen",e),t&&t.classList.toggle("hide",e),i&&i.classList.toggle("hide",!e),this.btnClose.classList.toggle("hide",e),e!==n&&(s.Z.checkAnimations2(e),De.Z.setThemeColor(e?"#000000":void 0))},this.toggleBigLayout=()=>{var e;const t=(0,Lt.rB)(),i=null===(e=this.movablePanel)||void 0===e?void 0:e.movable,s=(t||!!(i&&i.width>=680))&&!!this.videosCount,n=this.container.classList.contains("is-big-layout");let a;s&&!n&&(a=Array.from(this.buttonsContainer.children),a.forEach((e=>{e.style.opacity="0"})),this.buttonsContainer.offsetLeft),this.container.classList.toggle("is-big-layout",s),this.btnInvite.classList.toggle("hide",s),this.btnShowColumn.classList.toggle("hide",!s),a&&a.forEach((e=>{e.style.opacity=""}))},this.toggleRightColumn=()=>{this.container.classList.toggle("is-right-column-shown")},this.videosCount=0,this.container.classList.add(li,"night");const e=this.instance=ce.ZP.groupCall,{listenerSetter:t}=this;if(!f.IS_APPLE_MOBILE){const e=this.btnFullScreen=(0,v.Z)("fullscreen"),i=this.btnFullScreen2=(0,v.Z)("fullscreen "+li+"-cfs"),s=this.btnExitFullScreen=(0,v.Z)("smallscreen");(0,L.fc)(e,this.onFullScreenClick,{listenerSetter:t}),(0,L.fc)(i,this.onFullScreenClick,{listenerSetter:t}),(0,L.fc)(s,(()=>{(0,Lt.C8)()}),{listenerSetter:t}),(0,Lt.Ms)(this.container,this.onFullScreenChange,t)}this.btnInvite=(0,v.Z)("adduser");const i=this.btnShowColumn=(0,v.Z)("rightpanel "+li+"-only-big");(0,L.fc)(i,this.toggleRightColumn,{listenerSetter:t});const n=document.createElement("div");n.classList.add(li+"-header-info"),this.title.classList.add(li+"-header-title");const a=document.createElement("div");a.classList.add(li+"-header-subtitle"),n.append(this.title,a),this.header.classList.add(li+"-header"),this.header.append(...[this.btnExitFullScreen,n,this.btnFullScreen,i].filter(Boolean));const o=this.header.cloneNode(!1),r=n.cloneNode(!1),l=this.title.cloneNode(!1);r.append(l);const c=(0,v.Z)("rightpanel");o.append(...[c,r,this.btnFullScreen2].filter(Boolean)),(0,L.fc)(c,this.toggleRightColumn,{listenerSetter:t}),this.body.prepend(o);const h=new Tt.ZP(void 0);h.container.classList.add("group-call-big-video-container"),this.container.append(h.container),this.groupCallTitle=new $t(this.title),this.groupCallDescription=new Wt(a),this.groupCallBodyHeaderDescription=new Wt(l),this.constructButtons(),this.groupCallParticipantsVideo=new jt({appendTo:h.container,instance:e,listenerSetter:t,displayPinned:!0,onLengthChange:e=>{this.videosCount=e,this.toggleBigLayout()},managers:this.managers}),this.groupCallParticipants=new Kt({appendTo:this.body,instance:e,listenerSetter:t,managers:this.managers}),this.movablePanel=new si({listenerSetter:t,movableOptions:{minWidth:400,minHeight:480,element:this.element,verifyTouchTarget:e=>{const t=e.target;return!((0,X.Z)(t,"chatlist")||(0,X.Z)(t,"group-call-button")||(0,X.Z)(t,"btn-icon")||(0,X.Z)(t,"group-call-participants-video-container")||(0,Lt.rB)())}},onResize:()=>this.toggleBigLayout(),previousState:di}),t.add(e)("state",(()=>{this.updateInstance()})),t.add(d.Z)("group_call_update",(e=>{var t;(null===(t=this.instance)||void 0===t?void 0:t.id)===e.id&&this.updateInstance()})),t.add(e)("pinned",(()=>{this.setHasPinned()})),t.add(this.groupCallParticipantsVideo)("toggleControls",this.onToggleControls),this.addEventListener("close",(()=>{const{movablePanel:e}=this;di=e.state,this.groupCallParticipantsVideo.destroy(),this.groupCallParticipants.destroy(),this.groupCallMicrophoneIcon.destroy(),e.destroy()})),this.toggleRightColumn(),this.onFullScreenChange(),this.updateInstance()}constructButtons(){const e=this.buttonsContainer=document.createElement("div");e.classList.add(li+"-buttons");const t=Yt.bind(null,li,this.listenerSetter),i=this.btnVideo=t({callback:this.onVideoClick,icon:"videocamera_filled"}),s=this.btnScreen=t({callback:this.onScreenClick,icon:"sharescreen_filled"});s.classList.toggle("hide",!qt.Z);const n=t({noRipple:!0,callback:(0,G.Z)(this.onMuteClick,600,!0)});n.classList.add(li+"-microphone-button");const a=this.groupCallMicrophoneIcon=new yt;n.append(a.container);const o=t({icon:"settings_filled"});o.classList.add("btn-disabled"),o.classList.toggle("hide",!qt.Z);const r=t({isDanger:!0,callback:this.onLeaveClick,icon:"close"});e.append(i,s,n,o,r),this.container.append(e)}getContainer(){return this.container}setHasPinned(){this.container.classList.toggle("has-pinned",!!this.instance.pinnedSource)}updateInstance(){if(this.instance.state===lt.Z.CLOSED)return this.container.classList.contains("is-full-screen")&&(0,Lt.C8)(),void this.hide();const{participant:e,groupCall:t}=this.instance;if(!e)return;this.setTitle(),this.setDescription(),this.setHasPinned();const i=function(e,t){const i=oi;return t.pFlags.can_self_unmute?t.pFlags.muted?i.MUTED:i.UNMUTED:i.HAND}(0,e);this.container.dataset.micState=i===oi.HAND?"hand":i===oi.MUTED?"muted":"unmuted",this.groupCallMicrophoneIcon.setState(i)}setTitle(){this.groupCallTitle.update(this.instance)}setDescription(){this.groupCallDescription.update(this.instance),this.groupCallBodyHeaderDescription.update(this.instance)}}var hi=i(9078),ui=i(3335),pi=i(5157);class fi{constructor(e){this.appendTo=e,this.container=document.createElement("div"),this.container.classList.add("call-description")}detach(){void 0!==this.interval&&(clearInterval(this.interval),this.interval=void 0),this.container.remove(),this.state=void 0}update(e){const{connectionState:t}=e;if(this.state===t)return;let i;if(this.state=t,t===ui.Z.CONNECTED){i=document.createElement("span"),i.classList.add("call-description-duration");const t=()=>{i.innerText=(0,pi.Z)(e.duration,!0)};this.interval=window.setInterval(t,1e3),t()}else{let s;switch(t){case ui.Z.PENDING:s=e.isOutgoing?"Call.StatusRinging":"Call.StatusCalling";break;case ui.Z.REQUESTING:s="Call.StatusRequesting";break;case ui.Z.EXCHANGING_KEYS:s="VoipExchangingKeys";break;case ui.Z.CLOSED:s=void 0!==e.connectedAt?"Call.StatusEnded":"Call.StatusFailed";break;default:s="Call.StatusConnecting"}i=(0,T.ag)(s),void 0!==this.interval&&(clearInterval(this.interval),this.interval=void 0)}this.container.classList.toggle("has-duration",t===ui.Z.CONNECTED),(0,Z.Z)(this.container,i),this.container.parentElement||this.appendTo.append(this.container)}}var mi=i(925);class gi extends bt{constructor(e,t){super({width:36,height:36,getPart:e=>this.getItem().getPart(e?"unmute":"mute"),getColor:e?e=>e?[255,255,255]:[158,158,158]:void 0,skipAnimation:t}),this.add({name:"voice_mini",parts:[{startFrame:0,endFrame:35,name:"hand-to-muted"},{startFrame:36,endFrame:68,name:"unmute"},{startFrame:69,endFrame:98,name:"mute"},{startFrame:99,endFrame:135,name:"muted-to-hand"},{startFrame:136,endFrame:171,name:"unmuted-to-hand"}]})}}const vi="call",bi={width:400,height:580};let yi=Object.assign({},bi);class wi extends V.Z{constructor(e){super("popup-call",{withoutOverlay:!0,closable:!0}),this.instance=e,this.onFullScreenClick=()=>{(0,Lt.Dj)(this.container)},this.onFullScreenChange=()=>{const e=(0,Lt.rB)(),{btnFullScreen:t,btnExitFullScreen:i}=this,n=this.container.classList.contains("is-full-screen");this.container.classList.toggle("is-full-screen",e),t&&t.classList.toggle("hide",e),i&&i.classList.toggle("hide",!e),this.btnClose.classList.toggle("hide",e),e!==n&&(s.Z.checkAnimations(e),De.Z.setThemeColor(e?"#000000":void 0),this.resizeVideoContainers())},this.videoContainers={};const{container:t,listenerSetter:i}=this;t.classList.add(vi,"night");const n=document.createElement("div");n.classList.add(vi+"-avatar");const a=this.peerId=this.instance.interlocutorUserId.toPeerId(),o=new m.Z;o.classList.add("avatar-full"),o.updateWithOptions({isBig:!0,peerId:a}),n.append(o);const r=new M.Z({peerId:a}).element;r.classList.add(vi+"-title");const d=document.createElement("div");d.classList.add(vi+"-subtitle"),this.description=new fi(d);const l=this.emojisSubtitle=document.createElement("div");l.classList.add(vi+"-emojis"),t.append(n,r,d),f.IS_MOBILE?this.header.append(l):(this.btnFullScreen=(0,v.Z)("fullscreen"),this.btnExitFullScreen=(0,v.Z)("smallscreen hide"),(0,L.fc)(this.btnFullScreen,this.onFullScreenClick,{listenerSetter:i}),(0,L.fc)(this.btnExitFullScreen,(()=>(0,Lt.C8)()),{listenerSetter:i}),(0,Lt.Ms)(this.container,this.onFullScreenChange,i),this.header.prepend(this.btnExitFullScreen),this.header.append(this.btnFullScreen),t.append(l)),this.partyStates=document.createElement("div"),this.partyStates.classList.add(vi+"-party-states"),this.partyMutedState=document.createElement("div"),this.partyMutedState.classList.add(vi+"-party-state");const c=(0,T.ag)("VoipUserMicrophoneIsOff",[new M.Z({peerId:a,onlyFirstName:!0,limitSymbols:18}).element]);c.classList.add(vi+"-party-state-text");const h=new gi(!1,!0);h.setState(!1,!1),this.partyMutedState.append(h.container,c),this.partyStates.append(this.partyMutedState),this.container.append(this.partyStates),this.makeButton=Yt.bind(null,vi,this.listenerSetter),this.constructFirstButtons(),this.constructSecondButtons(),i.add(e)("state",(()=>{this.updateInstance()})),i.add(e)("mediaState",(()=>{this.updateInstance()})),this.movablePanel=new si({listenerSetter:i,movableOptions:{minWidth:400,minHeight:580,element:this.element,verifyTouchTarget:e=>{const t=e.target;return!((0,X.Z)(t,"call-button")||(0,X.Z)(t,"btn-icon")||(0,Lt.rB)())}},previousState:this.instance.wasTryingToJoin||this.instance.isOutgoing?yi:Object.assign({},bi)});const u=this.movablePanel.movable;u&&this.listenerSetter.add(u)("resize",(()=>{this.resizeVideoContainers()}));const p=this.controlsHover=new Nt.Z;p.setup({element:this.container,listenerSetter:this.listenerSetter,showOnLeaveToClassName:"call-buttons"}),p.showControls(!1),this.addEventListener("close",(()=>{const{movablePanel:e}=this;yi=e.state,this.microphoneIcon.destroy(),e.destroy()})),this.updateInstance()}getCallInstance(){return this.instance}constructFirstButtons(){const e=this.firstButtonsRow=document.createElement("div");e.classList.add(vi+"-buttons","is-first");const t=ni.bind(null,"btn-disabled"),i=this.btnVideo=this.makeButton({text:"Call.Camera",icon:"videocamera_filled",callback:()=>{const e=t([i,s],!0);this.instance.toggleVideoSharing().finally(e)}}),s=this.btnScreen=this.makeButton({text:"Call.Screen",icon:"sharescreen_filled",callback:()=>{const e=t([i,s],!0);this.instance.toggleScreenSharing().finally(e)}});qt.Z||(s.classList.add("hide"),this.container.classList.add("no-screen")),this.muteI18nElement=new T.ZP.IntlElement({key:"Call.Mute"});const n=this.btnMute=this.makeButton({text:this.muteI18nElement.element,callback:()=>{this.instance.toggleMuted()}}),a=this.microphoneIcon=new gi(!0,!0);n.firstElementChild.append(a.container),e.append(i,s,n),this.container.append(e)}constructSecondButtons(){const e=this.secondButtonsRow=document.createElement("div");e.classList.add(vi+"-buttons","is-second"),this.declineI18nElement=new T.ZP.IntlElement({key:"Call.Decline"});const t=this.btnDecline=this.makeButton({text:this.declineI18nElement.element,icon:"endcall_filled",callback:()=>{this.instance.hangUp("phoneCallDiscardReasonHangup")},isDanger:!0}),i=this.btnAccept=this.makeButton({text:"Call.Accept",icon:"phone_filled",callback:()=>{this.instance.acceptCall()},isConfirm:!0});e.append(t,i),this.container.append(e)}createVideoContainer(e){const t=vi+"-video",i=document.createElement("div");i.classList.add(t+"-container"),e.classList.add(t),e.paused&&e.play(),(0,L.fc)(i,(()=>{if(!i.classList.contains("small"))return;const e=Object.values(this.videoContainers).find((e=>!e.classList.contains("small")));e.classList.add("small"),e.style.cssText=i.style.cssText,i.classList.remove("small"),i.style.cssText="",this.resizeVideoContainers()}));const s=Ut(e);return s.classList.add(t+"-blur"),i.append(s,e),i}updateInstance(){const{instance:e}=this,{connectionState:t}=e;if(t===ui.Z.CLOSED)return this.container.classList.contains("is-full-screen")&&(0,Lt.C8)(),this.btnVideo.classList.add("disabled"),void this.hide();const i=!e.isOutgoing&&t===ui.Z.PENDING;this.declineI18nElement.compareAndUpdate({key:t===ui.Z.PENDING?"Call.Decline":"Call.End"}),this.btnAccept.classList.toggle("disable",!i),this.btnAccept.classList.toggle("hide-me",!i),this.container.classList.toggle("two-button-rows",i);const s=e.isMuted,n=()=>{this.btnMute.firstElementChild.classList.toggle("active",s)},a=this.microphoneIcon.getItem().player;this.microphoneIcon.setState(!s,!s,n),a||n(),this.muteI18nElement.compareAndUpdate({key:s?"VoipUnmute":"Call.Mute"});const o=e.isSharingVideo;this.btnVideo.firstElementChild.classList.toggle("active",o);const r=e.isSharingScreen;this.btnScreen.firstElementChild.classList.toggle("active",r);const d=e.getMediaState("output");(0,ve.Z)({element:this.partyMutedState,className:"is-visible",forwards:!!(null==d?void 0:d.muted),duration:300});const l=this.videoContainers,c=Object.assign({},l);["input","output"].forEach((t=>{const i=e.getMediaState(t),s=e.getVideoElement(t),n=!!(s&&s.videoWidth&&s.videoHeight);!s||n||s.dataset.hasPromise||(s.dataset.hasPromise="1",(0,mi.Z)(s).then((()=>{delete s.dataset.hasPromise,this.updateInstance()})));const a=!!s&&n&&!(!i||"active"!==i.videoState&&"active"!==i.screencastState);let o=l[t];a&&s&&!o&&(o=l[t]=this.createVideoContainer(s),this.container.append(o)),!a&&o&&(o.remove(),delete l[t])}));{const e=l.input,t=l.output;Object.keys(c).length!==Object.keys(l).length&&e&&e.classList.toggle("small",!!t),t&&!e&&t.classList.remove("small")}this.resizeVideoContainers(),this.container.classList.toggle("no-video",!Object.keys(l).length),!this.emojisSubtitle.textContent&&t{(0,Z.Z)(this.emojisSubtitle,(0,_.Z)(e.join("")))})),this.setDescription()}resizeVideoContainers(){Object.values(this.videoContainers).forEach((e=>{if(e.classList.contains("small")){const t=e.querySelector("video"),i=this.movablePanel.state,s=240,n=240,a=t.videoHeight>t.videoWidth,o=a?n:s,r=1/3*((0,Lt.rB)()?65535:a?i.height:i.width),d=a?t.videoWidth/t.videoHeight:1,l=a?1:t.videoHeight/t.videoWidth;e.style.width=r*d+"px",e.style.height=r*l+"px",e.style.maxWidth=o*d+"px",e.style.maxHeight=o*l+"px"}else e.style.cssText=""}))}setDescription(){this.description.update(this.instance)}}var Si=i(2069),Ci=i(9585),Li=i(2493);const Ii="topbar-call";class Ei{constructor(e){this.managers=e,this.onState=()=>{this.updateInstance(this.instance)};const t=this.listenerSetter=new U.Z;t.add(Li.Z)("instance",(({instance:e})=>{this.instance||this.updateInstance(e)})),t.add(Li.Z)("accepting",(e=>{this.instance!==e&&this.updateInstance(e)})),t.add(ce.ZP)("instance",(e=>{this.updateInstance(e)})),t.add(d.Z)("group_call_update",(e=>{const t=ce.ZP.groupCall;(null==t?void 0:t.id)===e.id&&this.updateInstance(t)})),t.add(Ci.Z.ANALYSER_LISTENER)("amplitude",(({amplitudes:e,type:t})=>{const{weave:i}=this;if(!e.length||!i)return;let s=0;for(let t=0;ts?n:s}i.setAmplitude(s)}))}clearCurrentInstance(){this.instance&&(this.center.textContent="",this.currentDescription&&(this.currentDescription.detach(),this.currentDescription=void 0),this.instance=void 0,this.instanceListenerSetter.removeAll())}updateInstance(e){this.construct&&(this.construct(),this.construct=void 0);const t=this.instance!==e;t&&(this.clearCurrentInstance(),this.instance=e,this.instanceListenerSetter=new U.Z,this.instanceListenerSetter.add(e)("state",this.onState),e instanceof hi.Z?this.currentDescription=this.groupCallDescription:(this.currentDescription=this.callDescription,this.instanceListenerSetter.add(e)("muted",this.onState)),this.container.classList.toggle("is-call",!(e instanceof hi.Z)));const i=this.instance.isMuted,s=e instanceof hi.Z?e.state:function(e,t){switch(e){case ui.Z.CLOSING:case ui.Z.CLOSED:return lt.Z.CLOSED;case ui.Z.CONNECTED:return t?lt.Z.MUTED:lt.Z.UNMUTED;default:return lt.Z.CONNECTING}}(e.connectionState,i),{weave:n}=this;n.componentDidMount();const a=s===lt.Z.CLOSED;(!document.body.classList.contains("is-calling")||t||a)&&(a&&n.setAmplitude(0),(0,ve.Z)({element:document.body,className:"is-calling",forwards:!a,duration:250,onTransitionEnd:a?()=>{n.componentWillUnmount(),this.clearCurrentInstance()}:void 0})),a||(n.setCurrentState(s,!0),this.setTitle(e),this.setDescription(e),this.groupCallMicrophoneIconMini.setState(!i))}setDescription(e){return this.currentDescription.update(e)}setTitle(e){if(e instanceof hi.Z)return this.groupCallTitle.update(e);(0,Z.Z)(this.center,new M.Z({peerId:e.interlocutorUserId.toPeerId()}).element)}construct(){const{listenerSetter:e}=this,t=this.container=document.createElement("div");t.classList.add("sidebar-header",Ii+"-container");const i=document.createElement("div");i.classList.add(Ii+"-left");const s=this.groupCallMicrophoneIconMini=new gi,n=(0,v.Z)();n.append(s.container),i.append(n);const a=(0,G.Z)((()=>{this.instance.toggleMuted()}),600,!0);(0,L.fc)(n,(e=>{(0,C.Z)(e),a()}),{listenerSetter:e});const o=this.center=document.createElement("div");o.classList.add(Ii+"-center"),this.groupCallTitle=new $t(o),this.groupCallDescription=new Wt(i),this.callDescription=new fi(i);const r=document.createElement("div");r.classList.add(Ii+"-right");const d=(0,v.Z)("endcall_filled");r.append(d),(0,L.fc)(d,(e=>{(0,C.Z)(e);const{instance:t}=this;t&&(t instanceof hi.Z?t.hangUp():t.hangUp("phoneCallDiscardReasonHangup"))}),{listenerSetter:e}),(0,L.fc)(t,(()=>{if(this.instance instanceof hi.Z){if(V.Z.getPopups(ci).length)return;V.Z.createPopup(ci).show()}else if(this.instance instanceof Si.Z){if(V.Z.getPopups(wi).find((e=>e.getCallInstance()===this.instance)))return;V.Z.createPopup(wi,this.instance).show()}}),{listenerSetter:e}),t.append(i,o,r);const l=this.weave=new ut,c=l.render(Ii+"-weave");t.prepend(c),document.getElementById("column-center").prepend(t),l.componentDidMount()}}var Pi=i(2614),Zi=i(8479),Mi=i(7401),Ti=i(2575),ki=i(6009),xi=i(493),Ai=i(496),_i=i(3189),Fi=i(2131),Di=i(3725),Ri=i(2890),Bi=i(2586),Ni=i(7298),Oi=i(6702),Ui=i(7746),Hi=i(3785),zi=i(2491),ji=i(1722),Gi=i(3781),Vi=i(4993),Ki=i(5990),Wi=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const $i=new class{constructor(){this.notificationsShown={},this.notificationIndex=0,this.notificationsCount=0,this.soundsPlayed={},this.vibrateSupport=Fi.Z,this.faviconElements=Array.from(document.head.querySelectorAll('link[rel="icon"], link[rel="alternate icon"]')),this.titleBackup=document.title,this.titleChanged=!1,this.stopped=!1,this.settings={},this.pushInited=!1,this.updateLocalSettings=()=>{const e=["notify_nodesktop","notify_volume","notify_novibrate","notify_nopreview","notify_nopush"].map((()=>{}));Promise.all(e).then((e=>{if(this.settings.nodesktop=e[0],this.settings.volume=void 0===e[1]?.5:e[1],this.settings.novibrate=e[2],this.settings.nopreview=e[3],this.settings.nopush=e[4],this.pushInited){const e=!this.settings.nopush&&!this.settings.nodesktop&&Oi.default.isAvailable||!1;e!==(!1!==this.registeredDevice)&&(e?Oi.default.subscribe():Oi.default.unsubscribe())}Oi.default.setSettings(this.settings)})),he.Z.getState().then((e=>{this.settings.nosound=!e.settings.notifications.sound}))},this.requestPermission=()=>{Notification.requestPermission(),window.removeEventListener("click",this.requestPermission)}}construct(e){this.managers=e,this.log=(0,r.kg)("NOTIFICATIONS"),navigator.vibrate=navigator.vibrate||navigator.mozVibrate||navigator.webkitVibrate,this.setAppBadge=navigator.setAppBadge&&navigator.setAppBadge.bind(navigator),this.setAppBadge&&this.setAppBadge(0),this.notificationsUiSupport="Notification"in window||"mozNotification"in navigator,this.notifySoundEl=document.createElement("div"),this.notifySoundEl.id="notify-sound",document.body.append(this.notifySoundEl),this.topMessagesDeferred=(0,Di.Z)(),it.Z.addEventListener("deactivated",(()=>{this.stop()})),it.Z.addEventListener("activated",(()=>{this.stopped&&this.start()})),Bi.Z.addEventListener("change",(e=>{this.stopped||(e||this.clear(),this.toggleToggler())})),d.Z.addEventListener("notification_reset",(e=>{this.soundReset(e)})),d.Z.addEventListener("notification_cancel",(e=>{this.cancel(e)})),this.setAppBadge&&d.Z.addEventListener("folder_unread",(e=>{0===e.id&&this.setAppBadge(e.unreadUnmutedPeerIds.size)})),Oi.default.addEventListener("push_init",(e=>{this.pushInited=!0,this.settings.nodesktop||this.settings.nopush?this.unregisterDevice(e):e?this.registerDevice(e):Oi.default.subscribe()})),Oi.default.addEventListener("push_subscribe",(e=>{this.registerDevice(e)})),Oi.default.addEventListener("push_unsubscribe",(e=>{this.unregisterDevice(e)})),d.Z.addEventListener("dialogs_multiupdate",(()=>{this.topMessagesDeferred.resolve()}),{once:!0}),Oi.default.addEventListener("push_notification_click",(e=>{if("push_settings"===e.action)return;if("mute1d"===e.action)return void this.managers.apiManager.invokeApi("account.updateDeviceLocked",{period:86400}).then((()=>{}));const t=e.custom&&e.custom.peerId.toPeerId();console.log("click",e,t),t&&this.topMessagesDeferred.then((()=>Wi(this,void 0,void 0,(function*(){const i=t.isAnyChat()?t.toChatId():void 0;i&&!(yield this.managers.appChatsManager.hasChat(i))||t.isUser()&&!(yield this.managers.appUsersManager.hasUser(t.toUserId()))||Ls.setInnerPeer({peerId:t,lastMsgId:(0,Gi.Z)(+e.custom.msg_id)})}))))}))}buildNotification({message:e,fwdCount:t,peerReaction:i,peerTypeNotifySettings:s}){return Wi(this,void 0,void 0,(function*(){const n=e.peerId,a=n.isAnyChat(),o={},[r,d=!1]=yield Promise.all([this.managers.appPeersManager.getPeerString(n),a&&this.managers.appPeersManager.isForum(n)]);let l,c=!1;if(s.show_previews)if("message"===e._&&e.fwd_from&&t>1)l=T.ZP.format("Notifications.Forwarded",!0,[t]);else{l=yield(0,Ai.Z)({message:e,plain:!0});const t=null==i?void 0:i.reaction;if("reactionEmoji"===(null==t?void 0:t._)){const e="Notification.Contact.Reacted",i=[(0,Ui.Z)(t.emoticon),l];l=T.ZP.format(e,!0,i)}else c=!0}else l=T.ZP.format("Notifications.New",!0);i&&(o.noIncrement=!0,o.silent=!0);const h={plainText:!0,managers:this.managers},u=d?(0,Vi.Z)(e,d):void 0,p=i?(0,Pt.Z)(i.peer_id):e.fromId,f=o.title=yield(0,xi.Z)(Object.assign(Object.assign({},h),{peerId:n,threadId:u}));if(d){const t=yield(0,xi.Z)(Object.assign(Object.assign({},h),{peerId:n}));o.title+=` (${t})`,c&&p!==e.peerId&&(l=(yield(0,xi.Z)(Object.assign(Object.assign({},h),{peerId:p})))+": "+l)}else a&&p!==e.peerId&&(o.title=(yield(0,xi.Z)(Object.assign(Object.assign({},h),{peerId:p})))+" @ "+o.title);o.title=(0,zi.Z)(o.title),o.onclick=()=>{Ls.setInnerPeer({peerId:n,lastMsgId:e.mid,threadId:u})},o.message=l,o.key="msg"+e.mid,o.tag=r,o.silent=!0;const m=yield this.managers.appPeersManager.getPeerPhoto(n);if(m){const t=yield this.managers.appAvatarsManager.loadAvatar(n,m,"photo_small");if(!(i||(e=yield this.managers.appMessagesManager.getMessageByPeer(e.peerId,e.mid))&&e.pFlags.unread))return;o.image=t}else{let{avatarCanvas:e,avatarContext:t}=this;if(this.avatarCanvas)t.clearRect(0,0,e.width,e.height);else{e=this.avatarCanvas=document.createElement("canvas"),t=this.avatarContext=e.getContext("2d");const i=54,s=1;e.dpr=s,e.width=e.height=i*s,this.avatarGradients={}}const i=(0,Ki.Z)(n,!0);let s=this.avatarGradients[i];if(!s){s=this.avatarGradients[i]=t.createLinearGradient(e.width/2,0,e.width/2,e.height);const n=pt.Z.getProperty(`peer-avatar-${i}-top`),a=pt.Z.getProperty(`peer-avatar-${i}-bottom`);s.addColorStop(0,n),s.addColorStop(1,a)}t.fillStyle=s,(0,Ri.Z)(t,e.width/2,e.height/2,e.width/2),t.fill();const a=20*e.dpr,r=(0,Hi.Z)(f);t.font=`700 ${a}px ${_i.bt}`,t.textBaseline="middle",t.textAlign="center",t.fillStyle="white",t.fillText(r.text,e.width/2,e.height*(window.devicePixelRatio,.5625)),o.image=e.toDataURL()}const g={custom:{msg_id:""+e.mid,peerId:""+n},description:"",loc_key:"",loc_args:[],mute:"",random_id:0,title:""};(yield this.notify(o,g))&&this.registeredDevice&&Oi.default.ignorePushByMid(n,e.mid)}))}toggleToggler(e=Bi.Z.isIdle){if(f.IS_MOBILE)return;const t=e=>{this.titleChanged=!1,document.title=this.titleBackup,this.setFavicon()};window.clearInterval(this.titleInterval),this.titleInterval=0,e?this.titleInterval=window.setInterval((()=>{const e=this.notificationsCount;if(e)if(this.titleChanged)t();else{this.titleChanged=!0,document.title=T.ZP.format("Notifications.Count",!0,[e]);const t=document.createElement("canvas");t.width=32*window.devicePixelRatio,t.height=t.width;const i=t.getContext("2d");i.beginPath(),i.arc(t.width/2,t.height/2,t.width/2,0,2*Math.PI,!1),i.fillStyle="#3390ec",i.fill();let s=24,n=""+e;e<10?s=22:e<100?s=20:(n="99+",s=16),s*=window.devicePixelRatio,i.font=`700 ${s}px ${_i.bt}`,i.textBaseline="middle",i.textAlign="center",i.fillStyle="white",i.fillText(n,t.width/2,.5625*t.height),this.setFavicon(t.toDataURL())}else this.toggleToggler(!1)}),1e3):t()}setFavicon(e){this.prevFavicon!==e&&(this.prevFavicon=e,this.faviconElements.forEach(((t,i,s)=>{var n;const a=t.cloneNode();(n=a.dataset).href||(n.href=a.href),null!=e||(e=a.dataset.href),a.href=e,t.replaceWith(s[i]=a)})))}notify(e,t){var i;return Wi(this,void 0,void 0,(function*(){if(this.log("notify",e,Bi.Z.isIdle,this.notificationsUiSupport,this.stopped),this.stopped)return;e.image||(e.image="assets/img/logo_filled_rounded.png"),e.noIncrement||++this.notificationsCount,this.titleInterval||this.toggleToggler();const s=++this.notificationIndex,n=e.key||"k"+s;this.notificationsShown[n]=!0;const a=(0,Ni.Z)();if(this.settings.volume>0&&!this.settings.nosound&&(this.testSound(this.settings.volume),this.soundsPlayed[e.tag]=a),!this.notificationsUiSupport||"Notification"in window&&"granted"!==Notification.permission)return;if(this.settings.nodesktop)return this.vibrateSupport&&!this.settings.novibrate?void navigator.vibrate([200,100,200]):void 0;if(!("Notification"in window))return;let o;const r={badge:"assets/img/logo_plain.svg",icon:e.image||"",body:e.message||"",tag:e.tag||"",silent:e.silent||!1,data:t};try{if(e.tag)for(const t in this.notificationsShown){const i=this.notificationsShown[t];"boolean"!=typeof i&&i.tag===e.tag&&(i.hidden=!0)}o=new Notification(e.title,r)}catch(t){try{const t=yield navigator.serviceWorker.ready;yield t.showNotification(e.title,r);const i=yield t.getNotifications({tag:r.tag});o=i[i.length-1]}catch(t){this.log.error("creating push error",t,e,r)}if(!o)return this.notificationsUiSupport=!1,void Oi.default.setLocalNotificationsDisabled()}return o.onclick=()=>{var t;this.log("notification onclick"),o.close(),ji.Z.focus(),this.clear(),null===(t=e.onclick)||void 0===t||t.call(e)},o.onclose=()=>{this.log("notification onclose"),o.hidden||(delete this.notificationsShown[n],this.clear())},null===(i=o.show)||void 0===i||i.call(o),this.notificationsShown[n]=o,f.IS_MOBILE||setTimeout((()=>{this.hide(n)}),8e3),!0}))}getLocalSettings(){return this.settings}hide(e){const t=this.notificationsShown[e];t&&this.closeNotification(t)}soundReset(e){delete this.soundsPlayed[e]}testSound(e){const t=(0,Ni.Z)();if(this.nextSoundAt&&t\n \n `,this.notifySoundEl.append(s),s.addEventListener("ended",(()=>{s.remove()}),{once:!0})}cancel(e){const t=this.notificationsShown[e];this.log("cancel",e,t),t&&(this.notificationsCount>0&&--this.notificationsCount,this.closeNotification(t),delete this.notificationsShown[e])}closeNotification(e){try{"boolean"!=typeof e&&e.close&&(this.log("close notification",e),e.hidden=!0,e.close())}catch(e){}}clear(){this.log.warn("clear");for(const e in this.notificationsShown){const t=this.notificationsShown[e];this.closeNotification(t)}this.notificationsShown={},this.notificationsCount=0,Oi.default.hidePushNotifications()}start(){if(this.log("start"),this.updateLocalSettings(),d.Z.addEventListener("settings_updated",this.updateLocalSettings),Oi.default.start(),!this.notificationsUiSupport)return!1;"Notification"in window&&"granted"!==Notification.permission&&"denied"!==Notification.permission&&window.addEventListener("click",this.requestPermission);try{"onbeforeunload"in window&&window.addEventListener("beforeunload",this.clear)}catch(e){}}stop(){this.log("stop"),this.clear(),window.clearInterval(this.titleInterval),this.titleInterval=0,this.setFavicon(),this.stopped=!0}registerDevice(e){if(this.registeredDevice&&(0,Te.Z)(this.registeredDevice,e))return!1;this.managers.apiManager.invokeApi("account.registerDevice",{token_type:e.tokenType,token:e.tokenValue,other_uids:[],app_sandbox:!1,secret:new Uint8Array}).then((()=>{this.log("registered device"),this.registeredDevice=e}),(e=>{e.handled=!0}))}unregisterDevice(e){if(!this.registeredDevice)return!1;this.managers.apiManager.invokeApi("account.unregisterDevice",{token_type:e.tokenType,token:e.tokenValue,other_uids:[]}).then((()=>{this.registeredDevice=!1}),(e=>{e.handled=!0}))}};Je.GO&&(Je.GO.uiNotificationsManager=$i);const qi=$i;var Yi=i(2423),Qi=i(5400),Xi=i(3591),Ji=i(3061),es=i(177),ts=i(236),is=i(5936),ss=i(3815),ns=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function as(e,t=!1){return ns(this,void 0,void 0,(function*(){const i=[],s=(e,n)=>ns(this,void 0,void 0,(function*(){if(e.isDirectory){const t=e.createReader();yield new Promise(((e,i)=>{t.readEntries((t=>ns(this,void 0,void 0,(function*(){for(const e of t)yield s(e,n);e()}))))}))}else if(e)if(t)i.push(e.type);else{const t=n.getAsFile(),s=e instanceof File?e:e instanceof DataTransferItem?e.getAsFile():yield new Promise(((i,s)=>e.file(i,(e=>i(t)))));if(!s)return;i.push(s)}}));if(e instanceof DragEvent&&e.dataTransfer.files&&!e.dataTransfer.items)for(let s=0;s{!e.noCancelEvent&&(0,C.Z)(null);let i,s,n=t.href;if(!n)return;const a=new URL(n),o=a.host.match(/(.+?)\.t(?:elegram)?\.me/);o&&!pe.BX.has(o[1])&&(a.pathname=o[1]+("/"===a.pathname?"":a.pathname),n=a.toString()),e.noPathnameParams||(i=new URL(n).pathname.split("/").slice(1)),e.noUriParams||(s=(0,ls.Z)(n));const r=e.callback({pathnameParams:i,uriParams:s},t);return void 0===r&&r}}var hs=i(4524),us=i(9439),ps=i(54),fs=i(3772),ms=i(9807),gs=i(7479);const vs="popup-gift-premium";class bs extends V.Z{constructor(e,t){super(vs,{closable:!0,overlayClosable:!0,body:!0,scrollable:!0}),this.peerId=e,this.giftOptions=t,this.construct()}construct(){return e=this,t=void 0,s=function*(){const{peerId:e,giftOptions:t}=this,i=new m.Z;i.classList.add("avatar-100",vs+"-avatar"),yield i.updateWithOptions({peerId:e});const s=document.createElement("span");(0,T.$d)(s,"GiftTelegramPremiumTitle"),s.classList.add(vs+"-title");const n=(0,T.ag)("GiftTelegramPremiumDescription",[yield(0,le.Z)({peerId:e})]);n.classList.add(vs+"-subtitle");const a=this.giftOptions.slice().sort(((e,t)=>e.months-t.months))[0],o=e=>(0,os.Z)(e,a.currency,!1,!0),r=this.giftOptions.map(((e,t)=>{let i=(0,T.ag)("PricePerMonth",[o(+e.amount/e.months)]);if(e!==a){const t=document.createElement("span"),s=document.createElement("span");s.classList.add(vs+"-discount");const n=+a.amount*e.months/a.months,o=Math.round(100*(1-+e.amount/n));s.textContent="-"+o+"%",t.append(s,i),i=t}const s=!(e.months%12),n=new ms.Z({checked:0===t,round:!0,name:"gift-months",asRadio:!0}),r=new gs.ZP({title:(0,T.ag)(s?"Years":"Months",[s?e.months/12:e.months]),checkboxField:n,clickable:!0,subtitle:i,titleRightSecondary:o(e.amount)});return r.container.classList.add(vs+"-option"),r})),d=document.createElement("form");d.classList.add(vs+"-options"),d.append(...r.map((e=>e.container)));const l=new T.ZP.IntlElement({key:"GiftSubscriptionFor",args:[o(t[0].amount)]}),c=()=>t[r.findIndex((e=>e.checkboxField.checked))];this.listenerSetter.add(d)("change",(()=>{l.compareAndUpdate({args:[o(c().amount)]})}));const h=(0,g.Z)(`btn-primary ${vs}-confirm shimmer`);h.append(l.element),(0,L.fc)(h,(()=>{const e=c();Ls.openUrl(e.bot_url),this.hide()}),{listenerSetter:this.listenerSetter}),this.scrollable.append(i,s,n,d,h),this.show()},new((i=void 0)||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}));var e,t,i,s}}var ys,ws=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};!function(e){e[e.CHATLIST=0]="CHATLIST",e[e.CHAT=1]="CHAT",e[e.PROFILE=2]="PROFILE"}(ys||(ys={}));class Ss extends l.Z{constructor(){super(...arguments),this.columnEl=document.getElementById("column-center"),this.offline=!1,this.updateStatusInterval=0,this.setPeerPromise=null,this.chats=[],this.cacheStorage=new is.Z("cachedFiles"),this.onHashChange=e=>{try{this.onHashChangeUnsafe(e)}catch(e){this.log.error("hash change error",e)}},this.onHashChangeUnsafe=e=>{const t=location.hash;e||Q.Z.replaceState();const i=t.split("?"),s=(0,ls.Z)(t,i);if(this.log("hashchange",t,i[0],s),t)if(s.tgaddr)this.openUrl(s.tgaddr);else switch(i[0]){default:s.p=i[0].slice(1);case"#/im":{if(!Object.keys(s).length)break;const e=s.p,t=void 0!==s.post?(0,Gi.Z)(+s.post):void 0;"@"===e[0]?this.openUsername({userName:e,lastMsgId:t}):this.setInnerPeer({peerId:t?e.toPeerId(!0):e.toPeerId(),lastMsgId:t})}}},this.setSettings=()=>{const{messagesTextSize:e}=d.Z.settings;this.customEmojiSize=(0,ue.C)(e+4,e+4),document.documentElement.style.setProperty("--messages-text-size",e+"px"),this.customEmojiSize&&(document.querySelectorAll("middle-ellipsis-element").forEach((t=>{t.disconnectedCallback(),t.dataset.fontSize=""+e,t.title&&(t.textContent=t.title),t.connectedCallback()})),document.querySelectorAll(".chat custom-emoji-renderer-element").forEach((e=>{e.forceRenderAfterSize=!0}))),document.body.classList.toggle("animation-level-0",!Ne.Z.isAvailable("animations")),document.body.classList.toggle("animation-level-1",!1),document.body.classList.toggle("animation-level-2",Ne.Z.isAvailable("animations")),this.chatsSelectTabDebounced=(0,j.Z)((()=>{var e;null===(e=this.chat.topbar.pinnedMessage)||void 0===e||e.setCorrectIndex(0),this.managers.apiFileManager.setQueueId(this.chat.bubbles.lazyLoadQueue.queueId)}),Ne.Z.isAvailable("animations")?250:0,!1,!0);const t=s.Z.setLoop(d.Z.settings.stickers.loop),i=!!["stickers_chat","stickers_panel"].filter((e=>s.Z.setAutoplay(Ne.Z.isAvailable(e),e))).length;(t||i)&&s.Z.checkAnimations2(!1);for(const e of this.chats)e.setAutoDownloadMedia();T.ZP.setTimeFormat(d.Z.settings.timeFormat),this.toggleChatGradientAnimation(this.chat)},this.onDocumentPaste=(e,t)=>ws(this,void 0,void 0,(function*(){const i=(0,He.Y)();if(e instanceof DragEvent){const t=e.dataTransfer.types;(t.contains?t.contains("Files"):t.indexOf("Files")>=0)&&(0,C.Z)(e)}const s=yield as(e);if(((yield this.canDrag())||i)&&s.length){if(i)return void i.addFiles(s);const e=this.chat.input;e.willAttachType=t||(ot.Z.has(s[0].type)?"media":"document"),V.Z.createPopup(He.Z,this.chat,s,e.willAttachType)}}))}get myId(){return d.Z.myId}get chat(){return this.chats[this.chats.length-1]}construct(e){this.managers=e;const{apiUpdatesManager:t}=e;t.attach(T.ZP.lastRequestedLangCode),y.Z.construct(e),qi.construct(e),qi.start(),this.log=(0,r.kg)("IM",r.v9.Log|r.v9.Warn|r.v9.Debug|r.v9.Error),this.backgroundPromises={},ts.h.settings.themes.forEach((e=>{const t=e.settings;if(!t)return;const{wallpaper:i}=t,s=i.slug;if(!s)return;const n="assets/img/"+s+".svg"+(f.IS_FIREFOX?"?1":"");this.backgroundPromises[s]=Promise.resolve(n)})),this.selectTab(ys.CHATLIST),Bi.Z.addEventListener("change",(e=>{this.offline=e,this.updateStatus(),e?clearInterval(this.updateStatusInterval):this.updateStatusInterval=window.setInterval((()=>this.updateStatus()),5e4)})),this.chatsContainer=document.createElement("div"),this.chatsContainer.classList.add("chats-container","tabs-container"),this.chatsContainer.dataset.animation="navigation",this.emojiAnimationContainer=document.createElement("div"),this.emojiAnimationContainer.classList.add("emoji-animation-container"),this.appendEmojiAnimationContainer(o.Z.activeScreen),this.columnEl.append(this.chatsContainer),this.createNewChat(),this.chatsSelectTab(this.chat.container),Q.Z.onHashChange=this.onHashChange,this.setSettings(),d.Z.addEventListener("settings_updated",this.setSettings);const i=e=>{document.body.classList.toggle("is-premium",e)};d.Z.addEventListener("premium_toggle",i),i(d.Z.premium),this.managers.rootScope.getPremium().then(i),(0,H.ZP)((()=>{s.Z.setOnlyOnePlayableGroup("lock"),s.Z.checkAnimations2(!0)}),(()=>{s.Z.setOnlyOnePlayableGroup(),s.Z.checkAnimations2(!1)})),De.Z.AppBackgroundTab=us.Z,f.IS_FIREFOX&&he.Z.oldVersion&&-1===(0,ki.Z)(he.Z.oldVersion,"1.4.3")?this.deleteFilesIterative((e=>"image/svg+xml"===e.headers.get("Content-Type"))).then((()=>{this.applyCurrentTheme()})):this.applyCurrentTheme(),o.Z.addEventListener("changeScreen",((e,t)=>{document.body.classList.contains(n.ir)&&document.body.classList.contains(a.HQ)&&a.ZP.toggleSidebar(!1),this.appendEmojiAnimationContainer(t)})),o.Z.addEventListener("resize",(()=>{const e=this.chatsContainer.getBoundingClientRect();Ae.resizeInstances(e.width,e.height).then((()=>{}))})),this.addEventListener("peer_changing",(e=>{this.saveChatPosition(e)})),d.Z.addEventListener("theme_change",(()=>{this.applyCurrentTheme()})),d.Z.addEventListener("choosing_sticker",(e=>{this.setChoosingStickerTyping(!e)})),d.Z.addEventListener("peer_title_edit",(({peerId:e,threadId:t})=>{var i;(null===(i=this.chat)||void 0===i?void 0:i.peerId)!==e||t||void 0===this.tabId||this.overrideHash(e)})),d.Z.addEventListener("peer_typings",(({peerId:e,typings:t})=>{var i;const s=this.chat;if(!s||s.peerId!==e||ss.Z.isOverlayActive||o.Z.activeScreen===o._.mobile&&this.tabId!==ys.CHAT)return;const n=t.find((e=>"sendMessageEmojiInteraction"===e.action._));if("sendMessageEmojiInteraction"===(null===(i=null==n?void 0:n.action)||void 0===i?void 0:i._)){const t=n.action,i=s.bubbles.bubbles[(0,Gi.Z)(n.action.msg_id)];if(i&&i.classList.contains("emoji-big")&&(0,je.Z)(i,s.bubbles.scrollable.container)){const s=i.querySelector(".media-sticker-wrapper:not(.bubble-hover-reaction-sticker):not(.reaction-sticker)");JSON.parse(t.interaction.data).a.forEach((e=>{setTimeout((()=>{(0,L.tH)(s)}),1e3*e.t)})),this.managers.appMessagesManager.setTyping(e,{_:"sendMessageEmojiInteractionSeen",emoticon:t.emoticon})}}}));const l=e=>{const t="version"===e,i=V.Z.createPopup(V.Z,"popup-instance-deactivated",{overlayClosable:!0}),s=document.createElement("div");s.classList.add("instance-deactivated-container"),i.container.replaceWith(s);const n=document.createElement("div");n.classList.add("header"),n.append((0,T.ag)(t?"Deactivated.Version.Title":"Deactivated.Title"));const a=document.createElement("div");a.classList.add("subtitle"),a.append((0,T.ag)(t?"Deactivated.Version.Subtitle":"Deactivated.Subtitle")),s.append(n,a),document.body.classList.add("deactivated");const o=t?()=>{ji.Z.reload()}:()=>{document.body.classList.add("deactivated-backwards"),it.Z.activateInstance(),setTimeout((()=>{document.body.classList.remove("deactivated","deactivated-backwards")}),333)};i.addEventListener("close",o),i.show()};it.Z.addEventListener("deactivated",l),it.Z.deactivatedReason&&l(it.Z.deactivatedReason),this.addEventListener("chat_changing",(({to:e})=>{this.toggleChatGradientAnimation(e)})),d.Z.addEventListener("service_notification",(e=>{(0,Mt.Z)({button:{langKey:"OK",isCancel:!0},description:(0,Qi.ZP)(e.message)})})),d.Z.addEventListener("payment_sent",(({peerId:e,mid:t,receiptMessage:i})=>ws(this,void 0,void 0,(function*(){const s=yield this.managers.appMessagesManager.getMessageByPeer(e,t);if(!s)return;const n=i.action;(0,te.bC)({langPackKey:"PaymentInfoHint",langPackArguments:[(0,os.Z)(n.total_amount,n.currency),(0,_.Z)(s.media.title)]})})))),window.onSpoilerClick=e=>{const t=(0,X.Z)(e.target,"spoiler"),i=(0,X.Z)(t,"spoilers-container")||t.parentElement,s="is-spoiler-visible",n=i.classList.contains(s);n||((0,C.Z)(e),"click"!==L.pf&&window.addEventListener("click",C.Z,{capture:!0,once:!0}));const a=n?0:2;a&&i.classList.add("will-change");const o=i.dataset.spoilerTimeout;null!==o&&(clearTimeout(+o),delete i.dataset.spoilerTimeout),(0,ve.Z)({element:i,className:s,forwards:!0,duration:200,onTransitionEnd:()=>{i.dataset.spoilerTimeout=""+window.setTimeout((()=>{(0,ve.Z)({element:i,className:s,forwards:!1,duration:200,onTransitionEnd:()=>{i.classList.remove("will-change"),delete i.dataset.spoilerTimeout}})}),5e3)},useRafs:a})},document.addEventListener("mousemove",(e=>{const t=(0,X.Z)(e.target,"media-sticker-wrapper");if(!t||t.classList.contains("custom-emoji")||(0,X.Z)(e.target,"emoji-big"))return;const i=s.Z.getAnimations(t);null==i||i.forEach((e=>{const{liteModeKey:t,animation:i}=e;t&&(null==i?void 0:i.paused)&&!Ne.Z.isAvailable(t)&&(i instanceof fs.Z?i.playOrRestart():i.play())}))})),d.Z.addEventListener("sticker_updated",(({type:e,faved:t})=>{"faved"===e?(0,te.bC)({langPackKey:t?"AddedToFavorites":"RemovedFromFavorites"}):t||(0,te.bC)({langPackKey:"RemovedFromRecent"})})),he.Z.addEventListener("notificationBuild",(e=>ws(this,void 0,void 0,(function*(){const t=yield this.managers.appPeersManager.isForum(e.message.peerId),i=(0,Vi.Z)(e.message,t);(this.chat.peerId!==e.message.peerId||this.chat.threadId!==i||Bi.Z.isIdle)&&qi.buildNotification(e)})))),this.addEventListener("peer_changed",(({peerId:e})=>ws(this,void 0,void 0,(function*(){document.body.classList.toggle("has-chat",!!e),this.emojiAnimationContainer.textContent="",this.overrideHash(e),he.Z.updateTabState("chatPeerIds",this.chats.map((e=>e.peerId)).filter(Boolean))})))),Xe.Z.setToCache("chatPositions",{}),(oe.Z||ae.Z)&&(this.topbarCall=new Ei(e)),oe.Z&&(Li.Z.addEventListener("instance",(({instance:e})=>{const t=V.Z.createPopup(wi,e);e.addEventListener("acceptCallOverride",(()=>this.discardCurrentCall(e.interlocutorUserId.toPeerId(),void 0,e).then((()=>(Li.Z.dispatchEvent("accepting",e),!0))).catch((()=>!1)))),t.addEventListener("close",(()=>{const t=Li.Z.currentCall;t&&t!==e&&!e.wasTryingToJoin&&e.hangUp("phoneCallDiscardReasonBusy")}),{once:!0}),t.show()})),Li.Z.addEventListener("incompatible",(e=>ws(this,void 0,void 0,(function*(){(0,te.bC)({langPackKey:"VoipPeerIncompatible",langPackArguments:[yield(0,le.Z)({peerId:e.toPeerId()})]})}))))),it.Z.activateInstance();const c=()=>{dt.default.setAuthorized(!0)};setInterval(c,k.s2),c(),cs({name:"showMaskedAlert",callback:(e,t)=>{const i=t.href,s=t.cloneNode(!0);s.className="anchor-url",s.innerText=i,s.removeAttribute("onclick"),V.Z.createPopup(se.Z,"popup-masked-url",{titleLangKey:"OpenUrlTitle",descriptionLangKey:"OpenUrlAlert2",descriptionLangArgs:[s],buttons:[{langKey:"Open",callback:()=>{s.click()}}]}).show()}}),cs({name:"execBotCommand",callback:({uriParams:e})=>{const{command:t,bot:i}=e;this.managers.appMessagesManager.sendText(this.chat.peerId,"/"+t+(i?"@"+i:""))}}),cs({name:"searchByHashtag",callback:({uriParams:e})=>{const{hashtag:t}=e;t&&this.chat.initSearch("#"+t+" ")}}),cs({name:"setMediaTimestamp",callback:(e,t)=>{const i=+t.dataset.timestamp;(0,X.Z)(t,"bubble")?this.chat.bubbles.playMediaWithTimestamp(t,i):(0,X.Z)(t,"media-viewer-caption")&&window.appMediaViewer.setMediaTimestamp(i)}}),[["addstickers",at.z.STICKER_SET],["addemoji",at.z.EMOJI_SET]].forEach((([e,t])=>{cs({name:e,callback:({pathnameParams:e})=>{if(!e[1])return;const i={_:t,set:e[1]};this.processInternalLink(i)}}),cs({name:e,protocol:"tg",callback:({uriParams:e})=>{const i=this.makeLink(t,e);this.processInternalLink(i)}})})),cs({name:"invoice",callback:({pathnameParams:e})=>{const t={_:at.z.INVOICE,slug:e.length>1?e[1]:e[0].slice(1)};this.processInternalLink(t)}}),cs({name:"joinchat",callback:({pathnameParams:e})=>{const t={_:at.z.JOIN_CHAT,invite:e[1]||decodeURIComponent(e[0]).slice(1)};this.processInternalLink(t)}}),ae.Z&&cs({name:"voicechat",protocol:"tg",callback:({uriParams:e})=>{const t=this.makeLink(at.z.VOICE_CHAT,e);this.processInternalLink(t)}}),cs({name:"im",callback:({pathnameParams:e,uriParams:t},i)=>ws(this,void 0,void 0,(function*(){let s;if(Yi.kO.test(e[0]))s={_:at.z.USER_PHONE_NUMBER,phone:e[0].slice(1)};else if("c"===e[0]){e.shift();const n="thread"in t?t.thread:e[2]&&e[1];s={_:at.z.PRIVATE_POST,channel:e[0],post:e[2]||e[1],thread:n,comment:t.comment,stack:this.getStackFromElement(i),t:t.t}}else{const n="thread"in t?t.thread:e[2]&&e[1];s={_:at.z.MESSAGE,domain:e[0],post:e[2]||e[1],thread:n,comment:t.comment,start:"start"in t?t.start:void 0,stack:this.getStackFromElement(i),t:t.t}}this.processInternalLink(s)}))}),cs({name:"resolve",protocol:"tg",callback:({uriParams:e},t)=>{let i;e.phone?i=this.makeLink(at.z.USER_PHONE_NUMBER,e):"telegrampassport"===e.domain||(i=this.makeLink(at.z.MESSAGE,Object.assign(Object.assign({},e),{stack:this.getStackFromElement(t)}))),this.processInternalLink(i)}}),cs({name:"privatepost",protocol:"tg",callback:({uriParams:e})=>{const t=this.makeLink(at.z.PRIVATE_POST,e);this.processInternalLink(t)}}),cs({name:"invoice",protocol:"tg",callback:({uriParams:e})=>{const t=this.makeLink(at.z.INVOICE,e);this.processInternalLink(t)}}),["joinchat","join"].forEach((e=>{cs({name:e,protocol:"tg",callback:({uriParams:e})=>{const t=this.makeLink(at.z.JOIN_CHAT,e);this.processInternalLink(t)}})})),this.onHashChange(!0),this.attachKeydownListener(),this.handleAutologinDomains(),this.checkForShare()}checkForShare(){const e=he.Z.share;e&&(he.Z.share=void 0,V.Z.createPopup(hs.Z,void 0,(t=>ws(this,void 0,void 0,(function*(){var i;if(yield this.setPeer({peerId:t}),null===(i=e.files)||void 0===i?void 0:i.length){const t=e.files.some((e=>ot.Z.has(e.type)));V.Z.createPopup(He.Z,this.chat,e.files,t?"media":"document")}else this.managers.appMessagesManager.sendText(t,e.text)})))))}handleUrlAuth(e){const{peerId:t,mid:i,buttonId:s,url:n}=e,a=e=>{window.open(e,"_blank")},o=e=>ws(this,void 0,void 0,(function*(){if("urlAuthResultRequest"===e._){const r=document.createElement("b");r.append(e.domain);const l=yield(0,le.Z)({peerId:d.Z.myId}),c=yield(0,le.Z)({peerId:e.bot.id.toPeerId()}),h={text:"OpenUrlOption1",textArgs:[r.cloneNode(!0),l],checked:!0},u=e.pFlags.request_write_access?{text:"OpenUrlOption2",textArgs:[c],checked:!0}:void 0,p=[h,u],f=(0,Mt.Z)({titleLangKey:"OpenUrlTitle",button:{langKey:"Open"},descriptionLangKey:"OpenUrlAlert2",descriptionLangArgs:[r],checkboxes:p.filter(Boolean)});u&&h.checkboxField.input.addEventListener("change",(()=>{const e=!h.checkboxField.checked;u.checkboxField.toggleDisability(e),e&&(u.checkboxField.checked=!1)}));const[m,g]=yield f;if(!m)return void a(n);const v=yield this.managers.appSeamlessLoginManager.acceptUrlAuth(n,t,i,s,g);return o(v)}"urlAuthResultAccepted"===e._?(e=>{a(e.url)})(e):a(n)}));return this.managers.appSeamlessLoginManager.requestUrlAuth(n,t,i,s).then((e=>{o(e)}))}handleAutologinDomains(){let e;d.Z.addEventListener("app_config",(t=>{e=t}));const t=t=>{var i,s;const n=new URL(t.href);if(e.url_auth_domains.includes(n.hostname))return this.handleUrlAuth({url:t.href}),void(0,C.Z)();if(!e.autologin_token||!e.autologin_domains)return;const a=null!==(i=(s=t.dataset).originalUrl)&&void 0!==i?i:s.originalUrl=t.href;e.autologin_domains.includes(n.hostname)&&(n.searchParams.set("autologin_token",e.autologin_token),t.href=n.toString(),setTimeout((()=>{t.href=a,delete t.dataset.originalUrl}),0))};document.addEventListener("click",(e=>{const i=(0,ee.Z)(e.target,"A");(null==i?void 0:i.href)&&t(i)}))}getStackFromElement(e){const t=(0,X.Z)(e,"bubble");return t?+t.dataset.mid:void 0}deleteFilesIterative(e){return this.cacheStorage.timeoutOperation((t=>{const i=performance.now();return t.keys().then((i=>{const s=i.map((i=>t.match(i).then((t=>e(t)))));return Promise.all(s).then((e=>(e.map(((e,s)=>{if(!e)return;const n=i[s];return t.delete(n)})),Promise.all(e.filter(Boolean)))))})).then((()=>{this.log("deleted files",performance.now()-i)}))}))}toggleChatGradientAnimation(e){this.chats.forEach((t=>{t.gradientRenderer&&t.gradientRenderer.scrollAnimate(Ne.Z.isAvailable("animations")&&t===e)}))}appendEmojiAnimationContainer(e){const t=e===o._.mobile?this.columnEl:document.body;this.emojiAnimationContainer.parentElement!==t&&t.append(this.emojiAnimationContainer)}attachKeydownListener(){const e=new Set(["PageUp","PageDown","Meta","Control"]);document.body.addEventListener("keydown",(t=>{var i;const s=t.key,n=document.getSelection().isCollapsed;if(ss.Z.isOverlayActive||e.has(s))return;const a=t.target,r="INPUT"===a.tagName&&!["checkbox","radio"].includes(a.type)||a.isContentEditable,d=this.chat;if((!(s.startsWith("Arrow")||t.shiftKey&&"Shift"===s)||n)&&("KeyC"!==t.code||!t.ctrlKey&&!t.metaKey||r)){if(!t.altKey||"ArrowUp"!==s&&"ArrowDown"!==s){if("ArrowUp"===s&&"scheduled"!==this.chat.type){if(d.input.editMsgId||!d.input.isInputEmpty())return;this.managers.appMessagesManager.getFirstMessageToEdit(d.peerId,d.threadId).then((e=>{e&&(d.input.initMessageEditing(e.mid),(0,C.Z)(t))}))}else if("ArrowDown"===s)return}else(0,C.Z)(t),this.managers.dialogsStorage.getNextDialog(this.chat.peerId,"ArrowDown"===s,Ee.default.filterId).then((e=>{e&&this.setPeer({peerId:e.peerId})}));if((null===(i=null==d?void 0:d.input)||void 0===i?void 0:i.messageInput)&&a!==d.input.messageInput&&!r&&!z.Z&&(!o.Z.isMobile||this.tabId===ys.CHAT)&&!d.selection.isSelecting&&!d.input.recording&&d.input.messageInput.isContentEditable){d.input.messageInput.focus(),(0,tt.Z)(d.input.messageInput);const e=new KeyboardEvent(t.type,t);d.input.messageInput.dispatchEvent(e)}}}))}makeLink(e,t){return Object.assign({_:e},t)}processInternalLink(e){return ws(this,void 0,void 0,(function*(){switch(null==e?void 0:e._){case at.z.MESSAGE:{const t=e.post?(0,Gi.Z)(+e.post):void 0,i=e.comment?(0,Gi.Z)(+e.comment):void 0,s=e.thread?(0,Gi.Z)(+e.thread):void 0;this.openUsername({userName:e.domain,lastMsgId:t,commentId:i,startParam:e.start,stack:e.stack,threadId:s,mediaTimestamp:e.t&&+e.t});break}case at.z.PRIVATE_POST:{const t=e.channel.toChatId(),i=(t.toPeerId(!0),yield this.managers.appChatsManager.getChat(t));if(!i)try{yield this.managers.appChatsManager.resolveChannel(t)}catch(e){throw(0,te.bC)({langPackKey:"LinkNotFound"}),e}const s=(0,Gi.Z)(+e.post),n=e.thread?(0,Gi.Z)(+e.thread):void 0;this.op({peer:i,lastMsgId:s,threadId:n,stack:e.stack,mediaTimestamp:e.t&&+e.t});break}case at.z.EMOJI_SET:case at.z.STICKER_SET:V.Z.createPopup(st.Z,{id:e.set},e._===at.z.EMOJI_SET).show();break;case at.z.JOIN_CHAT:this.managers.appChatsManager.checkChatInvite(e.invite).then((t=>{t.chat&&this.managers.appChatsManager.saveApiChat(t.chat,!0),"chatInviteAlready"!==t._&&"chatInvitePeek"!==t._?V.Z.createPopup(nt.Z,e.invite,t):this.setInnerPeer({peerId:t.chat.id.toPeerId(!0)})}),(e=>{"INVITE_HASH_EXPIRED"===e.type&&(0,te.Am)((0,T.ag)("InviteExpired"))}));break;case at.z.VOICE_CHAT:ae.Z&&this.joinGroupCall(e.chat_id.toPeerId(!0),e.id);break;case at.z.USER_PHONE_NUMBER:this.managers.appUsersManager.resolvePhone(e.phone).then((e=>{this.setInnerPeer({peerId:e.id.toPeerId(!1)})})).catch((e=>{"PHONE_NOT_OCCUPIED"===e.type&&(0,te.bC)({langPackKey:"Alert.UserDoesntExists"})}));break;case at.z.INVOICE:this.managers.appPaymentsManager.getInputInvoiceBySlug(e.slug).then((e=>{this.managers.appPaymentsManager.getPaymentForm(e).then((t=>{V.Z.createPopup(rs.ZP,void 0,e,t)}))}));break;default:this.log.warn("Not supported internal link:",e)}}))}openUrl(e){const{url:t,onclick:i}=(0,Xi.Z)(e);if(!i)return;const s=document.createElement("a");s.href=t,window[i](s)}op(e){return ws(this,void 0,void 0,(function*(){let{peer:t,commentId:i,threadId:s,lastMsgId:n}=e;const a="user"===t._,o=t.id.toPeerId(!a),r="channel"===t._&&t.pFlags.forum;if(i||s||n||!r){if(r&&n&&!s){const t=yield this.managers.appMessagesManager.reloadMessages(o,n);t?s=e.threadId=(0,Vi.Z)(t,r):(s=e.threadId=n,n=e.lastMsgId=void 0)}return s?this.openThread(Object.assign(Object.assign({},e),{peerId:o})):i?this.openComment({peerId:o,msgId:n,commentId:i}):this.setInnerPeer(Object.assign(Object.assign({},e),{peerId:o}))}Ee.default.toggleForumTabByPeerId(o,!0)}))}openPremiumBot(){return this.managers.apiManager.getAppConfig().then((e=>this.openUsername({userName:e.premium_bot_username})))}openUsername(e){const{userName:t}=e;return this.managers.appUsersManager.resolveUsername(t).then((t=>this.op(Object.assign({peer:t},e))),(e=>{"USERNAME_NOT_OCCUPIED"===e.type?(0,te.bC)({langPackKey:"NoUsernameFound"}):"USERNAME_INVALID"===e.type&&(0,te.bC)({langPackKey:"Alert.UserDoesntExists"})}))}openThread(e){return ws(this,void 0,void 0,(function*(){return(yield this.managers.appChatsManager.isForum(e.peerId.toChatId()))?(yield this.managers.dialogsStorage.getForumTopicOrReload(e.peerId,e.threadId),this.setInnerPeer(e)):this.managers.appMessagesManager.reloadMessages(e.peerId,e.threadId).then((t=>(t?this.managers.appMessagesManager.generateThreadServiceStartMessage(t):e.lastMsgId=void 0,this.setInnerPeer(Object.assign(Object.assign({},e),{type:"discussion"})))))}))}openComment(e){return this.managers.appMessagesManager.getDiscussionMessage(e.peerId,e.msgId).then((t=>this.openThread({peerId:t.peerId,lastMsgId:e.commentId,threadId:t.mid})))}callUser(e,t){return ws(this,void 0,void 0,(function*(){Li.Z.getCallByUserId(e)||((yield this.managers.appProfileManager.getProfile(e)).pFlags.phone_calls_private?(0,le.Z)({peerId:e.toPeerId()}).then((e=>(0,Mt.Z)({descriptionLangKey:"Call.PrivacyErrorMessage",descriptionLangArgs:[e],button:{langKey:"OK",isCancel:!0}}))):(yield this.discardCurrentCall(e.toPeerId()),Li.Z.startCallInternal(e,"video"===t)))}))}discardCurrentCall(e,t,i){return ce.ZP.groupCall&&ce.ZP.groupCall!==t?this.discardGroupCallConfirmation(e):Li.Z.currentCall&&Li.Z.currentCall!==i?this.discardCallConfirmation(e):Promise.resolve()}discardCallConfirmation(e){return ws(this,void 0,void 0,(function*(){const t=Li.Z.currentCall;t&&(yield Promise.all([(0,le.Z)({peerId:t.interlocutorUserId.toPeerId(!1)}),(0,le.Z)({peerId:e})]).then((([t,i])=>(0,Mt.Z)({titleLangKey:"Call.Confirm.Discard.Call.Header",descriptionLangKey:e.isUser()?"Call.Confirm.Discard.Call.ToCall.Text":"Call.Confirm.Discard.Call.ToVoice.Text",descriptionLangArgs:[t,i],button:{langKey:"OK"}}))),t.isClosing||(yield t.hangUp("phoneCallDiscardReasonDisconnect")))}))}discardGroupCallConfirmation(e){return ws(this,void 0,void 0,(function*(){const t=ce.ZP.groupCall;t&&(yield Promise.all([(0,le.Z)({peerId:t.chatId.toPeerId(!0)}),(0,le.Z)({peerId:e})]).then((([t,i])=>(0,Mt.Z)({titleLangKey:"Call.Confirm.Discard.Voice.Header",descriptionLangKey:e.isUser()?"Call.Confirm.Discard.Voice.ToCall.Text":"Call.Confirm.Discard.Voice.ToVoice.Text",descriptionLangArgs:[t,i],button:{langKey:"OK"}}))),ce.ZP.groupCall===t&&(yield t.hangUp()))}))}joinGroupCall(e,t){return ws(this,void 0,void 0,(function*(){const i=e.toChatId(),s=this.managers.appChatsManager.hasRights(i,"manage_call");if(t&&"groupCallDiscarded"===(yield this.managers.appGroupCallsManager.getGroupCallFull(t))._){if(!s)return void(0,te.bC)({langPackKey:"VoiceChat.Chat.Ended"});yield(0,Mt.Z)({descriptionLangKey:"VoiceChat.Chat.StartNew",button:{langKey:"VoiceChat.Chat.StartNew.OK"}})}(()=>{ws(this,void 0,void 0,(function*(){const e=yield this.managers.appProfileManager.getChatFull(i);let t;if(e.call)t=e.call;else{if(!s)return;t=yield this.managers.appGroupCallsManager.createGroupCall(i)}ce.ZP.joinGroupCall(i,t.id,!0,!1)}))})()}))}setCurrentBackground(e=!1){var t,i;const s=De.Z.getTheme(),n=null===(i=null===(t=s.settings)||void 0===t?void 0:t.wallpaper)||void 0===i?void 0:i.slug;if(n){const t=ts.h.settings.themes.find((e=>e.name===s.name));return this.getBackground(n).then((t=>this.setBackground(t,e)),(()=>(s.settings=(0,Zi.Z)(t.settings),this.setCurrentBackground(!0))))}return this.setBackground("",e)}getBackground(e){return this.backgroundPromises[e]?this.backgroundPromises[e]:this.backgroundPromises[e]=this.cacheStorage.getFile("backgrounds/"+e).then((e=>URL.createObjectURL(e)))}setBackground(e,t=!0){this.lastBackgroundUrl=e;const i=this.chats.map((t=>t.setBackground(e)));return i[i.length-1].then((()=>{t&&d.Z.dispatchEvent("background_change")}))}saveChatPosition(e){if(!["chat","discussion"].includes(e.type)||!e.peerId)return;const t=e.bubbles,i=e.peerId+(e.threadId?"_"+e.threadId:""),s=Xe.Z.getFromCache("chatPositions");if(t.scrollable.getDistanceToEnd()<=16&&t.scrollable.loadedAll.bottom||!t.getRenderedLength())delete s[i],this.log("deleted chat position");else{t.sliceViewport(!0);const e=t.scrollable.scrollTop,n={mids:(0,Mi.Z)(t.bubbles,"desc").filter((e=>e>0&&!t.skippedMids.has(e))),top:e};s[i]=n,this.log("saved chat position:",n)}Xe.Z.set({chatPositions:s},!0)}getChatSavedPosition(e){if(!["chat","discussion"].includes(e.type)||!e.peerId)return;const t=e.peerId+(e.threadId?"_"+e.threadId:""),i=Xe.Z.getFromCache("chatPositions");return i&&i[t]}applyCurrentTheme(e,t,i){return t&&(this.backgroundPromises[e]=Promise.resolve(t)),De.Z.setTheme(),this.setCurrentBackground(void 0===i?!!e:i)}chatsSelectTab(e,t){if(this.prevTab!==e){if(!1===t&&this.prevTab&&et([e,this.prevTab].filter(Boolean)),this.prevTab){this.prevTab.classList.remove("active"),this.chatsSelectTabDebounced(),Ne.Z.isAvailable("animations")&&!1!==t&&(0,H.YW)((0,_e.Z)(400),400);const i=(0,Ie.Z)(this.prevTab);(0,Ie.Z)(e)>i&&Q.Z.pushItem({type:"chat",onPop:e=>{this.setPeer({},e),(0,J.Z)()}})}e.classList.add("active"),this.prevTab=e}}init(){document.addEventListener("paste",this.onDocumentPaste,!0),z.Z||this.attachDragAndDropListeners(),this.markupTooltip=new $e(this),this.markupTooltip.handleSelection()}attachDragAndDropListeners(){const e=[],t=[];let i=!1;const s=(r,d)=>ws(this,void 0,void 0,(function*(){if(d===i)return;const l=r.dataTransfer.types,c=l.contains?l.contains("Files"):l.indexOf("Files")>=0,h=(0,He.Y)(),u=yield as(r,!0);if(!c||!(yield this.canDrag())&&!h)return void(n=0);const p=yield He.Z.canSend(this.chat.peerId,!0),f=h?o:a,m=h?t:e;if(d&&!m.length){const e=c&&!u.length,[t,i]=(0,ps.Z)(u,(e=>ot.Z.has(e))),[n,a]=(0,ps.Z)(t,(e=>rt.Z.has(e)));if(p.send_docs?i.push(...t):i.length=0,p.send_photos||(n.forEach((e=>(0,Me.Z)(t,e))),n.length=0),p.send_videos||(a.forEach((e=>(0,Me.Z)(t,e))),a.length=0),this.log("drag files",u,t,i,n,a),h){h.appendDrops(f);const t=(p.send_docs?[i]:[n,a]).reduce(((e,t)=>e+t.length),0);(t||e)&&m.push(new Ye(f,{header:"Preview.Dragging.AddItems",headerArgs:[t],onDrop:e=>{s(e,!1),this.log("drop",e),this.onDocumentPaste(e,"document")}}))}else(i.length||e)&&m.push(new Ye(f,{icon:"dragfiles",header:"Chat.DropTitle",subtitle:"Chat.DropAsFilesDesc",onDrop:e=>{s(e,!1),this.log("drop",e),this.onDocumentPaste(e,"document")}})),(t.length||e)&&m.push(new Ye(f,{icon:"dragmedia",header:"Chat.DropTitle",subtitle:"Chat.DropQuickDesc",onDrop:e=>{s(e,!1),this.log("drop",e),this.onDocumentPaste(e,"media")}})),this.chat.container.append(f)}(0,ve.Z)({element:f,className:"is-visible",forwards:d,duration:200,onTransitionEnd:()=>{d||(m.forEach((e=>{e.destroy()})),m.length=0)}}),d?m.forEach((e=>{e.setPath()})):n=0,document.body.classList.toggle("is-dragging",d),i=d}));let n=0;document.body.addEventListener("dragenter",(e=>{n++})),document.body.addEventListener("dragover",(e=>{s(e,!0),(0,C.Z)(e)})),document.body.addEventListener("dragleave",(e=>{n--,0===n&&s(e,!1)}));const a=document.createElement("div");a.classList.add("drops-container");const o=a.cloneNode(!0)}canDrag(){return ws(this,void 0,void 0,(function*(){const e=this.chat;return!(!(null==e?void 0:e.peerId)||ss.Z.isOverlayActive||!(yield e.canSend("send_media")))}))}overrideHash(e){return ws(this,void 0,void 0,(function*(){let t;if(e){const i=yield this.managers.appPeersManager.getPeerUsername(e);t=i?"@"+i:""+e}Q.Z.overrideHash(t)}))}selectTab(e,t){var i;!1===t&&et([n.ZP.sidebarEl,this.columnEl,a.ZP.sidebarEl]),document.body.classList.toggle(n.ir,e===ys.CHATLIST);const s=this.tabId;void 0!==s&&(this.overrideHash(e>ys.CHATLIST?null===(i=this.chat)||void 0===i?void 0:i.peerId:void 0),this.dispatchEvent("tab_changing",e)),this.log("selectTab",e,s);let r=Ne.Z.isAvailable("animations")?(0,Qe.d1)():Promise.resolve();if(void 0!==s&&s!==e&&Ne.Z.isAvailable("animations")&&!1!==t){const e=100+(o.Z.isMobile?250:200);r=(0,_e.Z)(e),(0,H.YW)(r,e)}this.tabId=e,(0,J.Z)(),o.Z.isMobile&&s===ys.PROFILE&&es&&(e{this.setPeer({},e)}});const d=window.onImTabChange;return d&&d(e),r}updateStatus(){return this.managers.appUsersManager.updateMyOnlineStatus(this.offline)}createNewChat(){const e=new Ue(this,this.managers);return this.chats.length&&e.setBackground(this.lastBackgroundUrl,!0),this.chats.push(e),e}spliceChats(e,t=!0,i,s){if(e>=this.chats.length)return;const n=this.chat;this.chats.length>1&&t&&this.dispatchEvent("peer_changing",this.chat),s||(s=this.chats.splice(e,this.chats.length-e));const o=this.chat;this.dispatchEvent("chat_changing",{from:n,to:o});for(let e=0;e1&&s.slice(0,-1).forEach((e=>{e.container.remove()})),this.chatsSelectTab(o.container,i),t){this.dispatchEvent("peer_changed",o);const e=a.ZP.getTab(Ce);null==e||e.close(),a.ZP.replaceSharedMediaTab(o.sharedMediaTab)}s.forEach((e=>{e.beforeDestroy()})),setTimeout((()=>{s.forEach((e=>{e.destroy()}))}),350)}setPeer(e={},t){var i;return ws(this,void 0,void 0,(function*(){this.init&&(this.init(),this.init=null),null!==(i=e.peerId)&&void 0!==i||(e.peerId=pe.NM);const{peerId:s,lastMsgId:a,threadId:r}=e,d=this.chat,l=this.chats.indexOf(d),c=this.isSamePeer(d,e);if(s){if(l>0&&d.peerId&&!c){const t=this.chats.splice(1,this.chats.length-1);if(this.chat.peerId===s)return void this.spliceChats(0,!0,!0,t);{const i=this.setPeer(e);return this.spliceChats(0,!1,!1,t),i}}}else{if(l>0)return void this.spliceChats(l,void 0,t);if(o.Z.activeScreen===o._.medium)return void this.selectTab(+!this.tabId,t)}if(c&&o.Z.activeScreen<=o._.medium&&document.body.classList.contains(n.ir))return this.selectTab(ys.CHAT,t),!1;if(s||o.Z.activeScreen!==o._.mobile){const i=yield d.setPeer(e),n=(null==i?void 0:i.cached)?i.promise:Promise.resolve();s&&Promise.all([n,d.setBackgroundPromise]).then((()=>{setTimeout((()=>{setTimeout((()=>{this.chatsSelectTab(this.chat.container)}),0),this.selectTab(ys.CHAT,t)}),0)}))}return s?void 0:(this.selectTab(ys.CHATLIST,t),!1)}))}setInnerPeer(e){var t;return ws(this,void 0,void 0,(function*(){const{peerId:i}=e;if(i===pe.NM||!i)return;e.type||(e.threadId&&!(yield this.managers.appPeersManager.isForum(e.peerId))&&(e.type="discussion"),null!==(t=e.type)&&void 0!==t||(e.type="chat"));const s=this.chats.findIndex((t=>this.isSamePeer(t,e)||o.Z.activeScreen===o._.mobile&&0===this.tabId));if(-1!==s)return this.spliceChats(s+1),this.setPeer(e);const n=this.chat;let a=n;return n.inited&&(a=this.createNewChat()),this.dispatchEvent("chat_changing",{from:n,to:a}),this.setPeer(e)}))}openScheduled(e){this.setInnerPeer({peerId:e,type:"scheduled"})}getTypingElement(e){const t=document.createElement("span");let i="peer-typing";switch(t.classList.add(i),t.dataset.action=e._,e._){case"sendMessageTypingAction":i+="-text";for(let e=0;e<3;++e){const e=document.createElement("span");e.className=i+"-dot",t.append(e)}break;case"sendMessageUploadAudioAction":case"sendMessageUploadDocumentAction":case"sendMessageUploadRoundAction":case"sendMessageUploadVideoAction":case"sendMessageUploadPhotoAction":i+="-upload";break;case"sendMessageRecordAudioAction":case"sendMessageRecordRoundAction":case"sendMessageRecordVideoAction":i+="-record";break;case"sendMessageEmojiInteractionSeen":case"sendMessageChooseStickerAction":i+="-choosing-sticker";for(let e=0;e<2;++e){const e=document.createElement("div");e.className=i+"-eye",t.append(e)}}return t.classList.add(i),t}getPeerTyping(e,t,i){return ws(this,void 0,void 0,(function*(){const s=e.isUser();if(s&&(yield this.managers.appUsersManager.isBot(e)))return;const n=yield this.managers.appProfileManager.getPeerTypings(e,i);if(!(null==n?void 0:n.length))return;const a=n[0],o={private:{sendMessageTypingAction:"Peer.Activity.User.TypingText",sendMessageUploadAudioAction:"Peer.Activity.User.SendingFile",sendMessageUploadDocumentAction:"Peer.Activity.User.SendingFile",sendMessageUploadPhotoAction:"Peer.Activity.User.SendingPhoto",sendMessageUploadVideoAction:"Peer.Activity.User.SendingVideo",sendMessageUploadRoundAction:"Peer.Activity.User.SendingVideo",sendMessageRecordVideoAction:"Peer.Activity.User.RecordingVideo",sendMessageRecordAudioAction:"Peer.Activity.User.RecordingAudio",sendMessageRecordRoundAction:"Peer.Activity.User.RecordingVideo",sendMessageGamePlayAction:"Peer.Activity.User.PlayingGame",sendMessageChooseStickerAction:"Peer.Activity.User.ChoosingSticker",sendMessageEmojiInteractionSeen:"Peer.Activity.User.EnjoyingAnimations"},chat:{sendMessageTypingAction:"Peer.Activity.Chat.TypingText",sendMessageUploadAudioAction:"Peer.Activity.Chat.SendingFile",sendMessageUploadDocumentAction:"Peer.Activity.Chat.SendingFile",sendMessageUploadPhotoAction:"Peer.Activity.Chat.SendingPhoto",sendMessageUploadVideoAction:"Peer.Activity.Chat.SendingVideo",sendMessageUploadRoundAction:"Peer.Activity.Chat.SendingVideo",sendMessageRecordVideoAction:"Peer.Activity.Chat.RecordingVideo",sendMessageRecordAudioAction:"Peer.Activity.Chat.RecordingAudio",sendMessageRecordRoundAction:"Peer.Activity.Chat.RecordingVideo",sendMessageGamePlayAction:"Peer.Activity.Chat.PlayingGame",sendMessageChooseStickerAction:"Peer.Activity.Chat.ChoosingSticker",sendMessageEmojiInteractionSeen:"Peer.Activity.Chat.EnjoyingAnimations"},multi:{sendMessageTypingAction:"Peer.Activity.Chat.Multi.TypingText1",sendMessageUploadAudioAction:"Peer.Activity.Chat.Multi.SendingFile1",sendMessageUploadDocumentAction:"Peer.Activity.Chat.Multi.SendingFile1",sendMessageUploadPhotoAction:"Peer.Activity.Chat.Multi.SendingPhoto1",sendMessageUploadVideoAction:"Peer.Activity.Chat.Multi.SendingVideo1",sendMessageUploadRoundAction:"Peer.Activity.Chat.Multi.SendingVideo1",sendMessageRecordVideoAction:"Peer.Activity.Chat.Multi.RecordingVideo1",sendMessageRecordAudioAction:"Peer.Activity.Chat.Multi.RecordingAudio1",sendMessageRecordRoundAction:"Peer.Activity.Chat.Multi.RecordingVideo1",sendMessageGamePlayAction:"Peer.Activity.Chat.Multi.PlayingGame1",sendMessageChooseStickerAction:"Peer.Activity.Chat.Multi.ChoosingSticker1"}},r=s?o.private:n.length>1?o.multi:o.chat;let d=a.action;if(n.length>1){const e={};n.forEach((t=>{const i=t.action._;void 0===e[i]&&(e[i]=0),++e[i]})),Object.keys(e).length>1&&(d={_:"sendMessageTypingAction"})}const l=r[d._];if(!l)return;let c,h;if(e.isAnyChat()){const e=new M.Z;c=e.update({peerId:a.userId.toPeerId(!1),onlyFirstName:!0}),h=[e.element,n.length-1],yield c}t||(t=document.createElement("span")).classList.add("online","peer-typing-container"),t.classList.toggle("peer-typing-flex","sendMessageChooseStickerAction"===d._||"sendMessageEmojiInteractionSeen"===d._);let u=t.firstElementChild;if(u?u.dataset.action!==d._&&u.replaceWith(this.getTypingElement(d)):(u=this.getTypingElement(d),t.prepend(u)),"sendMessageEmojiInteractionSeen"===d._){h?h.pop():h=[];const e=(0,Pi.Z)((0,_.Z)(d.emoticon));h.push(e)}const p=(0,T.ag)(l,h);return p.classList.add("peer-typing-description"),t.childElementCount>1?t.lastElementChild.replaceWith(p):t.append(p),t}))}getChatStatus(e,t){return ws(this,void 0,void 0,(function*(){const i=t?void 0:yield this.getPeerTyping(e.toPeerId(!0));if(i)return{cached:!0,result:Promise.resolve(i)};const s=yield this.managers.acknowledged.appProfileManager.getChatFull(e),n=Promise.resolve(s.result).then((t=>ws(this,void 0,void 0,(function*(){var i,s;const n=t.participants_count||(null===(s=null===(i=t.participants)||void 0===i?void 0:i.participants)||void 0===s?void 0:s.length)||1;let a=yield(0,es.Z)(e);if(n<2)return a;const o=yield this.managers.appProfileManager.getOnlines(e);if(o>1){const e=document.createElement("span");e.append(...(0,T.v_)([a,(0,T.ag)("OnlineCount",[(0,Ti.Z)(o)])],!1)),a=e}return a}))));return{cached:s.cached,result:n}}))}getUserStatus(e,t){var i;return ws(this,void 0,void 0,(function*(){const s={cached:!0,result:Promise.resolve(void 0)},n=yield this.managers.appUsersManager.getUser(e);if(!n||n.pFlags.self&&!t)return s;const a=(0,Ji.Z)(n);if(!n.pFlags.bot&&!n.pFlags.support){let t=yield this.getPeerTyping(e.toPeerId());if(t||"userStatusOnline"!==(null===(i=n.status)||void 0===i?void 0:i._)||(t=document.createElement("span"),t.classList.add("online"),t.append(a)),t)return s.result=Promise.resolve(t),s}return s.result=Promise.resolve(a),s}))}getPeerStatus(e,t,i){return ws(this,void 0,void 0,(function*(){if(!e)return;let s;return s=e.isAnyChat()?this.getChatStatus(e.toChatId(),i):this.getUserStatus(e.toUserId(),t),s}))}setPeerStatus(e){return ws(this,void 0,void 0,(function*(){const{peerId:t,element:i,needClear:s,useWhitespace:n,middleware:a,ignoreSelf:o,noTyping:r}=e;if(!s){const e=i.querySelector(".peer-typing-container");if(e&&(yield this.getPeerTyping(t,e)))return}const d=yield this.getPeerStatus(t,o,r);if(!a())return;const l=()=>ws(this,void 0,void 0,(function*(){const e=d&&(yield d.result);if(a())return()=>(0,Z.Z)(i,e||c)})),c=n?ds.Z:"";return!d||d.cached||void 0===s?yield l():s?()=>(i.textContent=c,l().then((e=>null==e?void 0:e()))):void 0}))}setChoosingStickerTyping(e){this.managers.appMessagesManager.setTyping(this.chat.peerId,{_:e?"sendMessageCancelAction":"sendMessageChooseStickerAction"},void 0,this.chat.threadId)}isSamePeer(e,t){return e.peerId===t.peerId&&e.threadId===t.threadId&&(typeof e.type!=typeof t.type||e.type===t.type)}giftPremium(e){this.managers.appProfileManager.getProfile(e.toUserId()).then((t=>{V.Z.createPopup(bs,e,t.premium_gifts)}))}}const Cs=new Ss;Je.GO&&(Je.GO.appImManager=Cs);const Ls=Cs},8737:(e,t,i)=>{"use strict";var s;i.d(t,{z:()=>s}),function(e){e[e.MESSAGE=0]="MESSAGE",e[e.PRIVATE_POST=1]="PRIVATE_POST",e[e.STICKER_SET=2]="STICKER_SET",e[e.JOIN_CHAT=3]="JOIN_CHAT",e[e.VOICE_CHAT=4]="VOICE_CHAT",e[e.USER_PHONE_NUMBER=5]="USER_PHONE_NUMBER",e[e.INVOICE=6]="INVOICE",e[e.EMOJI_SET=7]="EMOJI_SET"}(s||(s={}))},3709:(e,t,i)=>{"use strict";function s(e){var t;return e&&!e.pFlags.is_outgoing&&!e.pFlags.noforwards&&!(null===(t=e.media)||void 0===t?void 0:t.extended_media)}i.d(t,{Z:()=>s})},7530:(e,t,i)=>{"use strict";function s(e,t=!1){var i;if(!e)return;let s;if(e.action)s=e.action.photo;else if(e.media){let n=e.media;n.webpage?n=n.webpage:"messageExtendedMedia"===(null===(i=n.extended_media)||void 0===i?void 0:i._)&&(n=n.extended_media.media),s=n.document||n.photo||(t?void 0:n.game||n)}return s}i.d(t,{Z:()=>s})},2291:(e,t,i)=>{"use strict";function s(e){var t;return e.fromId?{peerId:e.fromId}:{fromName:null===(t=e.fwd_from)||void 0===t?void 0:t.from_name}}i.d(t,{Z:()=>s})},5381:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(677);function n(e){return!(!e.restriction_reason||!(0,s.X)(e.restriction_reason))}},5990:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});const s=["#fc5c51","#0fb297","#d09306","#3d72ed","#895dd5","#cd4073","#00c1a6","#fa790f"],n=["red","green","yellow","blue","violet","pink","cyan","orange"],a=[0,7,4,1,6,3,5];function o(e,t=!0){if(!e)return"";const i=a[Math.abs(+e)%7];return(t?n:s)[i]}},6082:(e,t,i)=>{"use strict";function s(e){if(e.username)return e.username;const t=e.usernames,i=null==t?void 0:t.find((e=>e.pFlags.editable));return null==i?void 0:i.username}i.d(t,{Z:()=>s})},2946:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(5880),n=i(1507);function a(e){if(void 0!==e&&e.isPeerId&&e.isPeerId())return e;if((0,s.Z)(e)){const t=e.user_id;if(void 0!==t)return t.toPeerId(!1);const i=e.channel_id||e.chat_id;return void 0!==i?i.toPeerId(!0):n.NM}if(!e)return n.NM;const t="u"===e.charAt(0),i=e.substr(1).split("_");return t?i[0].toPeerId():(i[0]||"").toPeerId(!0)}},9687:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(9897),n=i(1507);function a(e,t=0,i=0,a=!1,o=!1){window.devicePixelRatio>1&&(t*=2,i*=2);let r=e.sizes||e.thumbs,d={_:"photoSizeEmpty",type:n.Pt};if(o&&r&&"photo"!==e._&&(r=r.concat({_:"photoSize",w:e.w,h:e.h,size:e.size,type:n.Pt})),null==r?void 0:r.length){for(let e=0,n=r.length;e=t||a.height>=i)break}a&&"photoSizeEmpty"===d._&&"photoStrippedSize"===r[0]._&&(d=r[0])}return d}},3075:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(5953),n=i(5003),a=i(6752);class o{constructor(e){var t;(0,s.Z)(this,e),this.log||(this.log=(null===(t=this.connection)||void 0===t?void 0:t.log)||(0,n.kg)("CALL-CONNECTION-BASE")),this.sources={}}createPeerConnection(e){return this.connection||(this.connection=function(e,t){t||(t=(0,n.kg)("RTCPeerConnection")),t("constructor");const i=new RTCPeerConnection(e);return i.addEventListener("track",(e=>{t("ontrack",e)})),i.addEventListener("signalingstatechange",(()=>{t("onsignalingstatechange",i.signalingState)})),i.addEventListener("connectionstatechange",(()=>{t("onconnectionstatechange",i.connectionState)})),i.addEventListener("negotiationneeded",(()=>{t("onnegotiationneeded",i.signalingState)})),i.addEventListener("icecandidate",(e=>{t("onicecandidate",e)})),i.addEventListener("iceconnectionstatechange",(()=>{t("oniceconnectionstatechange",i.iceConnectionState)})),i.addEventListener("datachannel",(()=>{t("ondatachannel")})),i.log=t,{connection:i}}(e,this.log.bindPrefix("connection")).connection)}createDataChannel(e){return this.dataChannel||(this.dataChannel=function(e,t,i){i||(i=(0,n.kg)("RTCDataChannel"));const s=e.createDataChannel("data",t);return s.addEventListener("message",(e=>{i("onmessage",e)})),s.addEventListener("open",(()=>{i("onopen")})),s.addEventListener("close",(()=>{i("onclose")})),s.log=i,s}(this.connection,e,this.log.bindPrefix("data")))}createDescription(){return this.description||(this.description=new a.ZP(this.connection))}appendStreamToConference(){return this.streamManager.appendToConference(this.description)}closeConnection(){const{connection:e}=this;if(e)try{e.log("close"),e.close()}catch(e){this.log.error(e)}}closeConnectionAndStream(e){this.closeConnection(),e&&this.streamManager.stop()}negotiate(){return this.negotiating||(this.negotiating=this.negotiateInternal().finally((()=>{this.negotiating=void 0})))}sendDataChannelData(e){"open"===this.dataChannel.readyState&&this.dataChannel.send(JSON.stringify(e))}}},2069:(e,t,i)=>{"use strict";i.d(t,{Z:()=>N});var s=i(6761),n=i(4762),a=i(5953),o=i(5701),r=i(671),d=i(5003),l=i(3855),c=i(3075),h=i(3773);function u(e){const t=(0,h.Z)(e,e.media[0]),i={"@type":"InitialSetup",fingerprints:[t.fingerprint],ufrag:t.ufrag,pwd:t.pwd,audio:void 0,video:void 0,screencast:void 0},s=e=>""+e;for(const t of e.media){const n=t.mediaType;if("application"===n||!t.isSending)continue;const a=i["video"===n&&i.video?"screencast":n]={},o=(0,h.Z)(e,t);a.ssrc=s(o.source),o.sourceGroups&&(a.ssrcGroups=o.sourceGroups.map((e=>({semantics:e.semantics,ssrcs:e.sources.map(s)}))));const r=a.rtpExtensions=[];t.attributes.get("extmap").forEach((e=>{r.push({id:+e.key,uri:e.value})}));const d=new Map,l=e=>{let t=d.get(e);return t||d.set(e,t={id:e}),t};t.attributes.get("rtpmap").forEach((e=>{const t=+e.key,i=l(t),s=e.value.split("/"),[n,a,o]=s;i.name=n,i.clockrate=+a,i.channels=o?+o:0})),t.attributes.get("rtcp-fb").forEach((e=>{const t=+e.key;l(t).feedbackTypes=e.lines.map((e=>{const t=e.split(" "),[i,s]=t;return{type:i,subtype:s||""}}))})),t.attributes.get("fmtp").forEach((e=>{const t=+e.key,i=l(t).parameters={},s=e.value.split(";");for(const e of s){const[t,s]=e.split("=");i[t]=s}})),a.payloadTypes=Array.from(d.values())}return i}var p=i(9124);class f extends c.Z{constructor(e){super(e)}negotiateInternal(){return e=this,t=void 0,s=function*(){const{connection:e,call:t}=this;if(!e.localDescription&&!e.remoteDescription&&!t.isOutgoing)return;let i;if(t.offerReceived){t.offerReceived=!1;const s=i=yield e.createAnswer();this.log("[sdp] local",s.type,s.sdp),yield e.setLocalDescription(s),this.log("[InitialSetup] send 2")}else{const s=i=yield e.createOffer();this.log("[sdp] local",s.sdp),yield e.setLocalDescription(s),t.offerSent=!0,this.log("[InitialSetup] send 0")}const s=u((0,p.DV)(i.sdp));t.sendCallSignalingData(s)},new((i=void 0)||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}));var e,t,i,s}}var m=i(8500),g=i(2493),v=i(3335),b=i(1677),y=i(49),w=i(6752),S=i(4903);const C="undefined"!=typeof window&&"crypto"in window?window.crypto.subtle:self.crypto.subtle;var L=i(9818),I=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class E{constructor(e,t){this.isOutgoing=e,this.p2pKey=t,this.type="Signaling",this.counter=0,this.seqMap=new Map}concatSHA256(e){return t=(0,S.Z)(...e),C.digest("SHA-256",(0,L.Z)(t)).then((e=>new Uint8Array(e)));var t}encryptPrepared(e){return I(this,void 0,void 0,(function*(){const t={counter:0,bytes:new Uint8Array(16+e.length)},i=(this.isOutgoing?0:8)+("Signaling"===this.type?128:0),s=this.p2pKey,n=yield this.concatSHA256([s.subarray(i+88,i+88+32),e]),a=t.bytes;for(let e=0;e<16;++e)a[e]=n[e+8];const o=yield this.prepareAesKeyIv(s,a,i),r=yield this.aesProcessCtr(e,e.length,o,!0);return t.bytes=new Uint8Array([...t.bytes.subarray(0,16),...r]),t}))}encryptRawPacket(e){const t=++this.counter,i=new ArrayBuffer(4);new DataView(i).setUint32(0,t>>>0,!1);const s=new Uint8Array([...new Uint8Array(i),...e]);return this.encryptPrepared(s)}prepareAesKeyIv(e,t,i){return I(this,void 0,void 0,(function*(){const[s,n]=yield Promise.all([this.concatSHA256([t.subarray(0,16),e.subarray(i,i+36)]),this.concatSHA256([e.subarray(40+i,40+i+36),t.subarray(0,16)])]);return{key:new Uint8Array([...s.subarray(0,8),...n.subarray(8,24),...s.subarray(24,32)]),iv:new Uint8Array([...n.subarray(0,4),...s.subarray(8,16),...n.subarray(24,28)])}}))}aesProcessCtr(e,t,i,s=!0){return I(this,void 0,void 0,(function*(){const t=yield C.importKey("raw",i.key,{name:"AES-CTR"},!1,[s?"encrypt":"decrypt"]),n=yield C[s?"encrypt":"decrypt"]({name:"AES-CTR",counter:i.iv,length:8*i.iv.length},t,e);return new Uint8Array(n)}))}constTimeIsDifferent(e,t,i){let s=!0;for(let n=0;n134217728)return;const{isOutgoing:t,type:i}=this,s=(t?8:0)+("Signaling"===i?128:0),n=this.p2pKey,a=e.subarray(0,16),o=e.subarray(16),r=e.length-16,d=yield this.prepareAesKeyIv(n,a,s),l=yield this.aesProcessCtr(o,r,d,!1),c=yield this.concatSHA256([n.subarray(88+s,88+s+32),l]);if(this.constTimeIsDifferent(c.subarray(8),a,16))return;const h=new DataView(l.buffer).getUint32(0);return this.seqMap.has(h)?void 0:(this.seqMap.set(h,h),l.slice(4))}))}}var P=i(630);class Z{static generateOffer(e){const{fingerprints:t,ufrag:i,pwd:s,audio:n,video:a}=e;n.type="audio",a.type="video";const o=[n,a],r=new P.Z;r.add("v=0","o=- 1 2 IN IP4 127.0.0.1","s=-","t=0 0"),t&&t.forEach((e=>{const{hash:t,fingerprint:i,setup:s}=e;r.add(`a=fingerprint:${t} ${i}`,`a=setup:${s}`)})),i&&s&&r.add(`a=ice-ufrag:${i}`,`a=ice-pwd:${s}`),r.add("a=group:BUNDLE 0 1 2","a=extmap-allow-mixed","a=msid-semantic: WMS *");const d="stream"+o.map((e=>e.ssrc)).join("_");for(let e=0;ee.id)).join(" ")}`,"c=IN IP4 0.0.0.0","a=rtcp:9 IN IP4 0.0.0.0","a=ice-options:trickle",`a=mid:${e}`,"a=sendrecv",A(l)),s&&r.add(`a=msid:${d} audio${s}`),r.add("a=rtcp-mux",_(a),F(i,s,n,d));break;case"video":r.add(`m=video 61986 UDP/TLS/RTP/SAVPF ${a.map((e=>e.id)).join(" ")}`,"c=IN IP4 0.0.0.0","a=rtcp:9 IN IP4 0.0.0.0","a=ice-options:trickle",`a=mid:${e}`,"a=sendrecv",A(l)),s&&r.add(`a=msid:${d} video${s}`),r.add("a=rtcp-mux","a=rtcp-rsize",_(a),F(i,s,n,d))}}return r.add("m=application 9 UDP/DTLS/SCTP webrtc-datachannel\nc=IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:2\na=sctp-port:5000\na=max-message-size:262144"),r.finalize()}static generateAnswer(e){const{fingerprints:t,ufrag:i,pwd:s,audio:n,video:a}=e;n.type="audio",a.type="video";const o=[n,a],r=new P.Z;r.add("v=0","o=- 1 2 IN IP4 127.0.0.1","s=-","t=0 0"),t&&t.forEach((e=>{const{hash:t,fingerprint:i,setup:s}=e;r.add(`a=fingerprint:${t} ${i}`,`a=setup:${s}`)})),i&&s&&r.add(`a=ice-ufrag:${i}`,`a=ice-pwd:${s}`),r.add("a=group:BUNDLE 0 1 2","a=extmap-allow-mixed","a=msid-semantic: WMS *");const d="stream"+o.map((e=>e.ssrc)).join("_");for(let e=0;ee.id)).join(" ")}`,"c=IN IP4 0.0.0.0","a=rtcp:9 IN IP4 0.0.0.0","a=ice-options:trickle",`a=mid:${e}`,"a=sendrecv",A(l)),s&&r.add(`a=msid:${d} audio${s}`),r.add("a=rtcp-mux",_(a),F(i,s,n,d));break;case"video":r.add(`m=video 61986 UDP/TLS/RTP/SAVPF ${a.map((e=>e.id)).join(" ")}`,"c=IN IP4 0.0.0.0","a=rtcp:9 IN IP4 0.0.0.0","a=ice-options:trickle",`a=mid:${e}`,"a=sendrecv",A(l)),s&&r.add(`a=msid:${d} video${s}`),r.add("a=rtcp-mux","a=rtcp-rsize",_(a),F(i,s,n,d))}}return r.add("m=application 9 UDP/DTLS/SCTP webrtc-datachannel\nc=IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:2\na=sctp-port:5000\na=max-message-size:262144"),r.finalize()}}class M{static generateOffer(e){const{fingerprints:t,ufrag:i,pwd:s,audio:n,video:a}=e;n.type="audio",a.type="video";const o=[n,a];let r="v=0\no=- 1 0 IN IP4 0.0.0.0\ns=-\nt=0 0";t&&t.forEach((e=>{const{hash:t,fingerprint:i,setup:s}=e;r+=`\na=fingerprint:${t} ${i}\na=setup:${s}`})),i&&s&&(r+=`\na=ice-ufrag:${i}\na=ice-pwd:${s}`),r+="\na=group:BUNDLE 0 1 2\na=ice-options:trickle\na=msid-semantic:WMS *";const d="stream"+o.map((e=>e.ssrc)).join("_");for(let e=0;ee.id)).join(" ")}\nc=IN IP4 0.0.0.0\na=mid:${e}\na=sendrecv`,r+=A(l),r+="\na=rtcp-mux",r+=_(a),r+=F(i,s,n,d);break;case"video":r+=`\nm=video 9 UDP/TLS/RTP/SAVPF ${a.map((e=>e.id)).join(" ")}\nc=IN IP4 0.0.0.0\na=mid:${e}\na=sendrecv`,r+=A(l),r+="\na=rtcp-mux\na=rtcp-rsize",r+=_(a),r+=F(i,s,n,d)}}return r+="m=application 9 UDP/DTLS/SCTP webrtc-datachannel\nc=IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:2\na=sctp-port:5000\na=max-message-size:262144",r+="\n",r}static generateAnswer(e){const{fingerprints:t,ufrag:i,pwd:s,audio:n,video:a}=e;n.type="audio",a.type="video";const o=[n,a];let r="v=0\no=- 1 0 IN IP4 0.0.0.0\ns=-\nt=0 0";t&&t.forEach((e=>{const{hash:t,fingerprint:i,setup:s}=e;r+=`\na=fingerprint:${t} ${i}\na=setup:${s}`})),i&&s&&(r+=`\na=ice-ufrag:${i}\na=ice-pwd:${s}`),r+="\na=group:BUNDLE 0 1 2\na=ice-options:trickle\na=msid-semantic:WMS *";const d="stream"+o.map((e=>e.ssrc)).join("_");for(let e=0;ee.id)).join(" ")}\nc=IN IP4 0.0.0.0\na=mid:${e}\na=sendrecv`,r+=A(h),r+="\na=rtcp-mux",r+=_(l),r+=F(i,n,a,d);break;case"video":r+=`\nm=video 9 UDP/TLS/RTP/SAVPF ${l.map((e=>e.id)).join(" ")}\nc=IN IP4 0.0.0.0\na=mid:${e}\na=sendrecv`,r+=A(h),r+="\na=rtcp-mux\na=rtcp-rsize",r+=_(l),r+=F(i,n,a,d)}}return r+="m=application 9 UDP/DTLS/SCTP webrtc-datachannel\nc=IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:2\na=sctp-port:5000\na=max-message-size:262144",r+="\n",r}}class T{static generateOffer(e){const{fingerprints:t,ufrag:i,pwd:s,audio:n,video:a}=e;n.type="audio",a.type="video";const o=[n,a];if(!o.length)return"v=0\no=- 1 2 IN IP4 127.0.0.1\ns=-\nt=0 0\na=msid-semantic: WMS\n";let r="v=0\no=- 1 2 IN IP4 127.0.0.1\ns=-\nt=0 0";t&&t.forEach((e=>{const{hash:t,fingerprint:i,setup:s}=e;r+=`\na=fingerprint:${t} ${i}\na=setup:${s}`})),i&&s&&(r+=`\na=ice-ufrag:${i}\na=ice-pwd:${s}`),r+="\na=group:BUNDLE 0 1 2\na=extmap-allow-mixed\na=msid-semantic: WMS *";const d="stream"+o.map((e=>e.ssrc)).join("_");for(let e=0;ee.id)).join(" ")}\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:${e}\na=sendrecv`,r+=A(l),s&&(r+=`\na=msid:${d} audio${s}`),r+="\na=rtcp-mux",r+=_(a),r+=F(i,s,n,d);break;case"video":r+=`\nm=video 9 UDP/TLS/RTP/SAVPF ${a.map((e=>e.id)).join(" ")}\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:${e}\na=sendrecv`,r+=A(l),s&&(r+=`\na=msid:${d} video${s}`),r+="\na=rtcp-mux\na=rtcp-rsize",r+=_(a),r+=F(i,s,n,d)}}return r+="m=application 9 UDP/DTLS/SCTP webrtc-datachannel\nc=IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:2\na=sctp-port:5000\na=max-message-size:262144",r+="\n",r}static generateAnswer(e){const{fingerprints:t,ufrag:i,pwd:s,audio:n,video:a}=e;n.type="audio",a.type="video";const o=[n,a];if(!o.length)return"v=0\no=- 1 2 IN IP4 127.0.0.1\ns=-\nt=0 0\na=msid-semantic: WMS\n";let r="v=0\no=- 1 2 IN IP4 127.0.0.1\ns=-\nt=0 0";t&&t.forEach((e=>{const{hash:t,fingerprint:i,setup:s}=e;r+=`\na=fingerprint:${t} ${i}\na=setup:${s}`})),i&&s&&(r+=`\na=ice-ufrag:${i}\na=ice-pwd:${s}`),r+="\na=group:BUNDLE 0 1 2\na=extmap-allow-mixed\na=msid-semantic: WMS *";const d="stream"+o.map((e=>e.ssrc)).join("_");for(let e=0;ee.id)).join(" ")}\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:${e}\na=sendrecv`,r+=A(l),s&&(r+=`\na=msid:${d} audio${s}`),r+="\na=rtcp-mux",r+=_(a),r+=F(i,s,n,d);break;case"video":r+=`\nm=video 9 UDP/TLS/RTP/SAVPF ${a.map((e=>e.id)).join(" ")}\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:${e}\na=sendrecv`,r+=A(l),s&&(r+=`\na=msid:${d} video${s}`),r+="\na=rtcp-mux\na=rtcp-rsize",r+=_(a),r+=F(i,s,n,d)}}return r+="m=application 9 UDP/DTLS/SCTP webrtc-datachannel\nc=IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:2\na=sctp-port:5000\na=max-message-size:262144",r+="\n",r}}function k(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1}function x(){return navigator.userAgent.toLowerCase().indexOf("safari")>-1&&-1===navigator.userAgent.toLowerCase().indexOf("chrome")}function A(e){let t=[];for(let i=0;i{const{type:i,subtype:s}=e;t.push(`a=rtcp-fb:${n} ${[i,s].join(" ")}`)})),l){const e=[];Object.getOwnPropertyNames(l).forEach((t=>{e.push(`${t}=${l[t]}`)})),t.push(`a=fmtp:${n} ${e.join(";")}`)}}return t.join("\n")}function F(e,t,i,s){let n=[];return i&&i.length>0?i.forEach((t=>{t&&t.ssrcs.length>0&&(n.push(`a=ssrc-group:${t.semantics} ${t.ssrcs.join(" ")}`),t.ssrcs.forEach((t=>{n.push(`a=ssrc:${t} cname:stream${t}`,`a=ssrc:${t} msid:${s} ${e}${t}`,`a=ssrc:${t} mslabel:${e}${t}`,`a=ssrc:${t} label:${e}${t}`)})))})):t&&n.push(`a=ssrc:${t} cname:stream${t}`,`a=ssrc:${t} msid:${s} ${e}${t}`,`a=ssrc:${t} mslabel:${e}${t}`,`a=ssrc:${t} label:${e}${t}`),n.join("\n")}class D{static generateCandidate(e){if(!e)return null;const{sdpString:t,sdpMLineIndex:i,sdpMid:s,foundation:n,component:a,protocol:o,priority:r,address:d,type:l,relAddress:c,generation:h,tcpType:u,networkId:p,networkCost:f,username:m}=e;if(t)return{candidate:t,sdpMLineIndex:i,sdpMid:s};throw"no sdpString"}static generateOffer(e){return k()?M.generateOffer(e):x()?T.generateOffer(e):Z.generateOffer(e)}static generateAnswer(e){return k()?M.generateAnswer(e):x()?T.generateAnswer(e):Z.generateAnswer(e)}}var R=i(9585),B=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class N extends m.Z{constructor(e){super(),this.log=(0,d.kg)("CALL"),this.protocol||(this.protocol={_:"phoneCallProtocol",pFlags:{udp_p2p:!0,udp_reflector:!0},min_layer:92,max_layer:92,library_versions:["4.0.0"]}),(0,a.Z)(this,e),this.createdAt=Date.now(),this.offerReceived=!1,this.offerSent=!1,this.decryptQueue=[],this.candidates=[],this.addEventListener("state",(e=>{this.log("state",v.Z[e]),e===v.Z.CLOSED&&this.cleanup()}));const t=this.streamManager=new R.Z(b.iK);t.direction="sendrecv",t.types.push("screencast"),this.isOutgoing||(t.locked=!0,t.canCreateConferenceEntry=!1);let i={"@type":"MediaState",type:"input",lowBattery:!1,muted:!0,screencastState:"inactive",videoRotation:0,videoState:"inactive"};const s=this;i=new Proxy(i,{set:function(e,t,n){return e[t]=n,s.setMediaState(i),s.sendMediaState(),!0}}),this.mediaStates={input:i},this.sendMediaState=(0,o.Z)(this._sendMediaState.bind(this),0,!1,!0)}get connectionState(){const{_connectionState:e,connectionInstance:t}=this;if(void 0!==e)return e;if(t){const{iceConnectionState:e}=t.connection;return"closed"===e?v.Z.CLOSED:"connected"===e||n.IS_SAFARI&&"completed"===e?v.Z.CONNECTED:v.Z.CONNECTING}return v.Z.CONNECTING}get sortIndex(){const e=this.connectionState;let t=1e13*(v.Z.CLOSED-e+1);return t+=2147483647e3-(e===v.Z.PENDING&&this.isOutgoing?0:this.createdAt),t}getVideoElement(e){if("input"===e)return this.elements.get("main");{const e=this.getMediaState("output");if(!e)return;const t="active"===e.videoState?"video":"active"===e.screencastState?"screencast":void 0;if(!t)return;const i=this.description.findEntry((e=>e.type===t));if(!i)return;return this.elements.get(""+i.recvEntry.source)}}startScreenSharingInternal(){return B(this,void 0,void 0,(function*(){try{this.wasStartingScreen=!0,this.wasStartingVideo=!1,this.streamManager.types=["audio","screencast"],yield this.requestScreen()}catch(e){this.log.error("startScreenSharing error",e)}}))}toggleScreenSharing(){return B(this,void 0,void 0,(function*(){return this.isSharingVideo&&(yield this.stopVideoSharing()),this.isSharingScreen?this.stopVideoSharing():this.startScreenSharingInternal()}))}startVideoSharingInternal(){return B(this,void 0,void 0,(function*(){try{this.wasStartingScreen=!1,this.wasStartingVideo=!0,this.streamManager.types=["audio","video"],yield this.requestInputSource(!1,!0,!1)}catch(e){this.log.error("startVideoSharing error",e)}}))}stopVideoSharing(){return B(this,void 0,void 0,(function*(){const e=this.getMediaState("input");e.videoState=e.screencastState="inactive";const{streamManager:t,description:i}=this,s=t.inputStream.getVideoTracks()[0];s&&((0,y.Z)(s),t.appendToConference(i))}))}toggleVideoSharing(){return B(this,void 0,void 0,(function*(){return this.isSharingScreen&&(yield this.stopVideoSharing()),this.isSharingVideo?this.stopVideoSharing():this.startVideoSharingInternal()}))}getMediaState(e){return this.mediaStates[e]}setMediaState(e){this.mediaStates[e.type]=e,this.dispatchEvent("mediaState",e)}isSharingVideoType(e){try{return super.isSharingVideo&&!!(this.wasStartingScreen&&"screencast"===e||this.wasStartingVideo&&"video"===e)}catch(e){return!1}}get isSharingVideo(){return this.isSharingVideoType("video")}get isSharingScreen(){return this.isSharingVideoType("screencast")}get isMuted(){const e=this.streamManager.inputStream.getAudioTracks()[0];return!(null==e?void 0:e.enabled)}get isClosing(){const{connectionState:e}=this;return e===v.Z.CLOSING||e===v.Z.CLOSED}get description(){var e;return null===(e=this.connectionInstance)||void 0===e?void 0:e.description}setHangUpTimeout(e,t){this.clearHangUpTimeout(),this.hangUpTimeout=s.Z.setTimeout((()=>{this.hangUpTimeout=void 0,this.hangUp(t)}),e)}clearHangUpTimeout(){void 0!==this.hangUpTimeout&&(clearTimeout(this.hangUpTimeout),this.hangUpTimeout=void 0)}setPhoneCall(e){this.call=e;const{id:t}=e;if(this.id!==t){const e=this.id;this.id=t,this.dispatchEvent("id",t,e)}}acceptCall(){var e;return B(this,void 0,void 0,(function*(){const t=null===(e=(yield Promise.all(this.dispatchResultableEvent("acceptCallOverride")))[0])||void 0===e||e;if(this.isClosing||!t)return;this.overrideConnectionState(v.Z.EXCHANGING_KEYS);const i=this.call;this.requestInputSource(!0,!!i.pFlags.video,!1);const s=i.g_a_hash;this.managers.appCallsManager.generateDh().then((e=>B(this,void 0,void 0,(function*(){return this.dh={g_a_hash:s,b:e.a,g_b:e.g_a,g_b_hash:e.g_a_hash,p:e.p},this.managers.apiManager.invokeApi("phone.acceptCall",{peer:yield this.managers.appCallsManager.getCallInput(this.id),protocol:this.protocol,g_b:this.dh.g_b})})))).then((e=>B(this,void 0,void 0,(function*(){yield this.managers.appCallsManager.savePhonePhoneCall(e)})))).catch((e=>{this.log.error("accept call error",e),this.hangUp("phoneCallDiscardReasonHangup")}))}))}joinCall(){this.log("joinCall"),this.getEmojisFingerprint(),this.overrideConnectionState();const{isOutgoing:e,encryptionKey:t,streamManager:i}=this,s=function(e){const t=[];return e.connections.forEach((e=>{switch(e._){case"phoneConnectionWebrtc":{const{ip:i,ipv6:s,port:n,username:a,password:o}=e,r=[];e.pFlags.turn?(i&&r.push(`turn:${i}:${n}`),s&&r.push(`turn:[${s}]:${n}`)):e.pFlags.stun&&(i&&r.push(`stun:${i}:${n}`),s&&r.push(`stun:[${s}]:${n}`)),r.length>0&&t.push({urls:r,username:a,credential:o});break}}})),{iceServers:t,iceTransportPolicy:e.pFlags.p2p_allowed?"all":"relay"}}(this.call);if(this.log("joinCall configuration",s),!s)return;const n=this.connectionInstance=new f({call:this,streamManager:i,log:this.log.bindPrefix("connection")}),a=n.createPeerConnection(s);a.addEventListener("iceconnectionstatechange",(()=>{const e=this.connectionState;void 0===this.connectedAt&&e===v.Z.CONNECTED&&(this.connectedAt=Date.now()),this.dispatchEvent("state",e)})),a.addEventListener("negotiationneeded",(()=>{n.negotiate()})),a.addEventListener("icecandidate",(e=>{const{candidate:t}=e;a.log("onicecandidate",t),(null==t?void 0:t.candidate)&&this.sendIceCandidate(t)})),a.addEventListener("track",(e=>{const{track:t}=e;a.log("ontrack",t),this.onTrack(e)})),n.createDescription(),this.encryptor=new E(e,t),this.decryptor=new E(!e,t),this.log("currentCall",this),e&&n.appendStreamToConference(),this.createDataChannel(),this.processDecryptQueue()}createDataChannelEntry(){const e=this.description.createEntry("application");e.setDirection("sendrecv"),e.sendEntry=e.recvEntry=e}createDataChannel(){if(this.connectionInstance.dataChannel)return;const e=this.connectionInstance.createDataChannel({id:0,negotiated:!0});e.addEventListener("message",(e=>{this.applyDataChannelData(JSON.parse(e.data))})),e.addEventListener("open",(()=>{this.sendMediaState()}))}applyDataChannelData(e){"MediaState"===e["@type"]?(e.type="output",this.log("got output media state",e),this.setMediaState(e)):this.log.error("unknown data channel data:",e)}_sendMediaState(){const{connectionInstance:e}=this;if(!e)return;const t=Object.assign({},this.getMediaState("input"));delete t.type,this.log("sendMediaState",t),e.sendDataChannelData(t)}sendCallSignalingData(e){return B(this,void 0,void 0,(function*(){const t=JSON.stringify(e),i=(new TextEncoder).encode(t),{bytes:s}=yield this.encryptor.encryptRawPacket(i);this.log("sendCallSignalingData",this.id,t),yield this.managers.apiManager.invokeApi("phone.sendSignalingData",{peer:yield this.managers.appCallsManager.getCallInput(this.id),data:s})}))}sendIceCandidate(e){this.log("sendIceCandidate",e);const{candidate:t,sdpMLineIndex:i}=e;if(0!==i)return;const s=function(e){if(!e||!e.startsWith("candidate:"))return;const t=e;e=e.substr("candidate:".length);const[i,s,n,a,o,r,...d]=e.split(" "),l={sdpString:t,foundation:i,component:s,protocol:n,priority:a,address:{ip:o,port:r}};for(let e=0;e(this.getEmojisFingerprintPromise=void 0,this.emojisFingerprint=e.map((e=>(0,r.zu)(e))))))}unlockStreamManager(){this.connectionInstance.streamManager.locked=!1,this.connectionInstance.appendStreamToConference()}doTheMagic(){return B(this,void 0,void 0,(function*(){this.connectionInstance.appendStreamToConference();const e=this.connectionInstance.connection;let t=yield e.createAnswer();this.log("[sdp] local",t.type,t.sdp),yield e.setLocalDescription(t),e.getTransceivers().filter((e=>"recvonly"===e.direction)).forEach((e=>{const t=this.connectionInstance.description.getEntryByMid(e.mid);t.transceiver=t.recvEntry.transceiver=e,e.direction="sendrecv"}));const i=this.description,s=i.entries.map((e=>e.mid)),n={type:"offer",sdp:i.generateSdp({bundle:s,entries:i.entries.filter((e=>s.includes(e.mid))),isAnswer:!0})};yield e.setRemoteDescription(n),t=yield e.createAnswer(),yield e.setLocalDescription(t);const a=u((0,p.DV)(t.sdp));this.log("[InitialSetup] send 1"),this.sendCallSignalingData(a),this.unlockStreamManager()}))}overrideConnectionState(e){this._connectionState=e,this.dispatchEvent("state",this.connectionState)}get duration(){return void 0!==this.connectedAt?(Date.now()-this.connectedAt)/1e3|0:0}onInputStream(e){super.onInputStream(e);const t=e.getVideoTracks()[0];if(t){const e=this.getMediaState("input");this.wasStartingScreen||this.wasStartingVideo||(this.wasStartingVideo=!0),this.isSharingVideo?e.videoState="active":this.isSharingScreen&&(e.screencastState="active"),t.addEventListener("ended",(()=>{this.stopVideoSharing()}),{once:!0})}e.getAudioTracks().length&&this.onMutedChange()}onMutedChange(){const e=this.isMuted;this.dispatchEvent("muted",e),this.getMediaState("input").muted=e}toggleMuted(){return this.requestAudioSource(!0).then((()=>{this.setMuted(),this.onMutedChange()}))}hangUp(e,t){return B(this,void 0,void 0,(function*(){if(!this.isClosing&&(this.discardReason=e,this.log("hangUp",e),this.overrideConnectionState(v.Z.CLOSED),this.connectionInstance&&this.connectionInstance.closeConnectionAndStream(!0),e&&!t)){let t=!1;for(const e in this.mediaStates){const i=this.mediaStates[e];t="active"===i.videoState||"active"===i.screencastState||t}yield this.managers.appCallsManager.discardCall(this.id,this.duration,e,t)}}))}performCodec(e){const t=e.payloadTypes.map((e=>Object.assign(Object.assign({},e),{"rtcp-fbs":e.feedbackTypes})));return{"rtp-hdrexts":e.rtpExtensions,"payload-types":t}}setDataToDescription(e){this.description.setData({transport:{pwd:e.pwd,ufrag:e.ufrag,fingerprints:e.fingerprints,"rtcp-mux":!0},audio:this.performCodec(e.audio),video:e.video?this.performCodec(e.video):void 0,screencast:e.screencast?this.performCodec(e.screencast):void 0})}filterNotVP8(e){this.isOutgoing||[e.video,e.screencast].filter(Boolean).forEach((e=>{const t=e.payloadTypes,i=t.findIndex((e=>"VP8"===e.name)),s=t[i],n=t.findIndex((e=>{var t;return+(null===(t=e.parameters)||void 0===t?void 0:t.apt)===s.id}));e.payloadTypes=[t[i],t[n]]}))}applyCallSignalingData(e){return B(this,void 0,void 0,(function*(){this.log("applyCallSignalingData",this,e);const{connection:t,description:i}=this.connectionInstance;switch(e["@type"]){case"InitialSetup":{this.log("[sdp] InitialSetup",e),this.filterNotVP8(e),this.setDataToDescription(e);const s=e=>e.map((e=>({_:"groupCallParticipantVideoSourceGroup",semantics:e.semantics,sources:e.ssrcs.map((e=>+e))})));[(0,w.z_)("audio",+e.audio.ssrc),e.video?(0,w.z_)("video",s(e.video.ssrcGroups)):void 0,e.screencast?(0,w.z_)("screencast",s(e.screencast.ssrcGroups)):void 0].filter(Boolean).forEach((e=>{let t=i.getEntryBySource(e.source);if(t)return;const s=i.findFreeSendRecvEntry(e.type,!1);t=new w.Lp(s.mid,e.type),t.setDirection("sendrecv"),s.recvEntry=t,i.setEntrySource(t,e.sourceGroups||e.source)})),this.createDataChannelEntry();const n=this.offerSent;this.offerSent=!1;const a=i.entries.map((e=>e.mid)),o={type:n?"answer":"offer",sdp:i.generateSdp({bundle:a,entries:i.entries.filter((e=>a.includes(e.mid))),isAnswer:!n})};this.log("[sdp] remote",o.sdp),yield t.setRemoteDescription(o),yield this.tryToReleaseCandidates(),n||(yield this.doTheMagic());break}case"Candidates":for(const t of e.candidates){const e=D.generateCandidate(t);e.sdpMLineIndex=0;const i=new RTCIceCandidate(e);this.candidates.push(i)}yield this.tryToReleaseCandidates();break;default:this.log.error("unrecognized signaling data",e)}}))}tryToReleaseCandidates(){return B(this,void 0,void 0,(function*(){const{connectionInstance:e}=this;if(!e)return;const{connection:t}=e;if(t.remoteDescription){const e=this.candidates.map((e=>this.addIceCandidate(t,e)));this.candidates.length=0,yield Promise.all(e)}else this.log("[candidates] postpone")}))}addIceCandidate(e,t){return B(this,void 0,void 0,(function*(){this.log("[candidate] start",t);try{yield e.addIceCandidate(t),this.log("[candidate] add",t)}catch(e){this.log.error("[candidate] error",t,e)}}))}processDecryptQueue(){return B(this,void 0,void 0,(function*(){const{encryptor:e}=this;if(!e)return void this.log.warn("got encrypted signaling data before the encryption key");if(!this.decryptQueue.length)return;const t=this.decryptQueue.slice();this.decryptQueue.length=0;for(const i of t){const t=yield e.decryptRawPacket(i);if(!t)continue;const s=(new TextDecoder).decode(t);try{const e=JSON.parse(s);this.log("[update] updateNewCallSignalingData",e),this.applyCallSignalingData(e)}catch(e){this.log.error("wrong signaling data",s),this.hangUp("phoneCallDiscardReasonDisconnect"),g.Z.dispatchEvent("incompatible",this.interlocutorUserId)}}}))}onUpdatePhoneCallSignalingData(e){this.decryptQueue.push(e),this.processDecryptQueue()}}},8500:(e,t,i)=>{"use strict";i.d(t,{Z:()=>p});var s=i(3241),n=i(319),a=i(9125),o=i(9337),r=i(382),d=i(5424);function l(){const e={main:{},screen:{}};return t=>{return i=this,s=void 0,a=function*(){const{isScreen:i,constraints:s}=t,n=e[i?"screen":"main"];let a=n[s.audio?"audio":"video"];a||(a=(i?r.Z:d.Z)(s,t.muted),s.audio&&!n.audio&&(n.audio=a.finally((()=>n.audio=void 0))),s.video&&!n.video&&(n.video=a.finally((()=>n.video=void 0))));try{return yield a}catch(e){throw e}},new((n=void 0)||(n=Promise))((function(e,t){function o(e){try{d(a.next(e))}catch(e){t(e)}}function r(e){try{d(a.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(i,s||[])).next())}));var i,s,n,a}}window.getStreamCached=l;var c=i(312),h=i(49),u=i(9585);class p extends s.Z{constructor(){super(!1);const e=this.player=document.createElement("div");e.classList.add("call-player"),e.style.display="none",document.body.append(e),this.elements=new Map;const t=this.audio=new Audio;t.autoplay=!0,t.volume=1,this.player.append(t),this.elements.set("audio",t),this.fixSafariAudio(),this.getStream=l()}get isSharingAudio(){return!!this.streamManager.hasInputTrackKind("audio")}get isSharingVideo(){return!!this.streamManager.hasInputTrackKind("video")}fixSafariAudio(){this.audio.play().catch(n.Z)}requestAudioSource(e){return this.requestInputSource(!0,!1,e)}requestInputSource(e,t,i){const{streamManager:s}=this;if(s){const i=!e||this.isSharingAudio,s=!t||this.isSharingVideo;if(i&&s)return Promise.resolve()}const n={audio:e&&(0,a.Z)(),video:t&&(0,c.Z)()};return this.getStream({constraints:n,muted:i}).then((e=>{this.onInputStream(e)}))}requestScreen(){return this.getStream({isScreen:!0,constraints:(0,o.Z)(!0)}).then((e=>{this.onInputStream(e)}))}getElement(e){return this.elements.get(""+e)}cleanup(){this.player.textContent="",this.player.remove(),this.elements.clear(),this.streamManager.stop(),super.cleanup()}onTrack(e){this.tryAddTrack({stream:e.streams[0],track:e.track,type:"output"})}saveInputVideoStream(e,t){const i=e.getVideoTracks()[0];this.tryAddTrack({stream:e,track:i,type:"input",source:t||"main"})}tryAddTrack({stream:e,track:t,type:i,source:s}){s||(s=u.Z.getSource(e,i)),this.log("tryAddTrack",e,t,i,s);const a="output"===i,{player:o,elements:r,streamManager:d}=this,l=t.kind,c="video"===l,h=c?s:l;let p=r.get(h);c&&t.addEventListener("ended",(()=>{this.log("[track] onended"),r.delete(h)}),{once:!0}),a&&d.addTrack(e,t,i);const f=c?e:d.outputStream;if(p)p.paused&&p.play().catch(n.Z),p.srcObject=f;else{if(p=document.createElement(l),p.autoplay=!0,p.srcObject=f,p.volume=1,"undefined"!==p.sinkId){const{outputDeviceId:e}=this;e&&p.setSinkId(e)}c?(p.setAttribute("playsinline","true"),p.muted=!0):o.appendChild(p),r.set(h,p)}return s}setMuted(e){this.streamManager.inputStream.getAudioTracks().forEach((t=>{"audio"===(null==t?void 0:t.kind)&&(t.enabled=void 0===e?!t.enabled:!e)}))}onInputStream(e){if(this.isClosing)e.getTracks().forEach((e=>{(0,h.Z)(e)}));else{e.getVideoTracks().length&&this.saveInputVideoStream(e,"main");const{streamManager:t,description:i}=this;t.addStream(e,"input"),i&&t.appendToConference(i)}}}},3335:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>n}),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.EXCHANGING_KEYS=2]="EXCHANGING_KEYS",e[e.PENDING=3]="PENDING",e[e.REQUESTING=4]="REQUESTING",e[e.CLOSING=5]="CLOSING",e[e.CLOSED=6]="CLOSED"}(s||(s={}));const n=s},2493:(e,t,i)=>{"use strict";i.d(t,{Z:()=>C});var s=i(5916);let n;var a=i(410),o=i(993),r=i(1655),d=i(6519),l=i(9895),c=i(3241),h=i(7298),u=i(5003),p=i(3855),f=i(1507),m=i(3512),g=i(2069),v=i(3335),b=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const y=45e3;class w extends c.Z{construct(e){this.managers=e,this.log=(0,u.kg)("CC"),o.Z&&(this.audioAsset=null!=n?n:n=new s.Z(["call_busy.mp3","call_connect.mp3","call_end.mp3","call_incoming.mp3","call_outgoing.mp3","voip_failed.mp3"]),this.tempId=0,this.instances=new Map,this.sortedInstances=[],m.Z.addEventListener("call_update",(e=>b(this,void 0,void 0,(function*(){var t;let i=this.instances.get(e.id);switch(i&&i.setPhoneCall(e),e._){case"phoneCallDiscarded":i&&i.hangUp(null===(t=e.reason)||void 0===t?void 0:t._,!0);break;case"phoneCallAccepted":i&&i.confirmCall();break;case"phoneCallRequested":i||(i=this.createCallInstance({isOutgoing:!1,interlocutorUserId:e.admin_id}),i.overrideConnectionState(v.Z.PENDING),i.setPhoneCall(e),i.setHangUpTimeout(y,"phoneCallDiscardReasonMissed"));break;case"phoneCall":{if(!i||i.encryptionKey)break;const t=i.dh.g_a=e.g_a_or_b,s=i.dh,n=yield p.Z.invokeCrypto("sha256",t);if(!(0,l.Z)(s.g_a_hash,n)){this.log.error("Incorrect g_a_hash",s.g_a_hash,n);break}const{key:a,key_fingerprint:o}=yield this.managers.appCallsManager.computeKey(t,s.b,s.p);if(e.key_fingerprint!==o){this.log.error("Incorrect key fingerprint",e.key_fingerprint,o,t,s),i.hangUp("phoneCallDiscardReasonDisconnect");break}i.encryptionKey=a,i.joinCall();break}}})))),m.Z.addEventListener("call_signaling",(({callId:e,data:t})=>{const i=this.instances.get(e);(null==i?void 0:i.id)===e&&i.onUpdatePhoneCallSignalingData(t)})))}get currentCall(){return this.sortedInstances[0]}getCallByUserId(e){for(const[t,i]of this.instances)if(i.interlocutorUserId===e)return i}createCallInstance(e){const t=new g.Z(Object.assign({managers:this.managers},e));return t.addEventListener("state",(e=>{const i=this.currentCall;e===v.Z.CLOSED?(this.instances.delete(t.id),(0,r.Z)(this.sortedInstances,t)):(0,d.Z)(this.sortedInstances,t,"sortIndex"),e===v.Z.EXCHANGING_KEYS&&(t.wasTryingToJoin=!0);const s=void 0!==t.connectedAt;e===v.Z.EXCHANGING_KEYS||e===v.Z.CONNECTING&&s?t.setHangUpTimeout(y,"phoneCallDiscardReasonDisconnect"):t.clearHangUpTimeout(),i!==t&&i||(e===v.Z.CLOSED?t.isOutgoing||t.wasTryingToJoin?t.wasTryingToJoin&&!s?this.audioAsset.playSound("voip_failed.mp3"):this.audioAsset.playSound("phoneCallDiscardReasonBusy"===t.discardReason?"call_busy.mp3":"call_end.mp3"):this.audioAsset.stopSound():e===v.Z.PENDING?this.audioAsset.playSound(t.isOutgoing?"call_outgoing.mp3":"call_incoming.mp3",!0):e===v.Z.EXCHANGING_KEYS?this.audioAsset.playSoundIfDifferent("call_connect.mp3"):e===v.Z.CONNECTING?t.duration&&this.audioAsset.playSound("voip_connecting.mp3",!0):this.audioAsset.stopSound())})),t.addEventListener("id",((e,i)=>{void 0!==i&&this.instances.delete(i);const s=!!this.currentCall;this.instances.set(e,t),void 0===i&&this.dispatchEvent("instance",{instance:t,hasCurrent:s})})),t}startCallInternal(e,t){return b(this,void 0,void 0,(function*(){this.log("p2pStartCallInternal",e,t);const i=yield this.managers.appProfileManager.getProfile(e);if(!i)return;const{video_calls_available:s}=i.pFlags,n=this.createCallInstance({isOutgoing:!0,interlocutorUserId:e});n.requestInputSource(!0,!(!t||!s),!1),n.overrideConnectionState(v.Z.REQUESTING),n.setPhoneCall({_:"phoneCallWaiting",access_hash:"",admin_id:f.NM,date:(0,h.Z)(!0),id:--this.tempId,participant_id:e,protocol:n.protocol,pFlags:{video:t||void 0}}),this.managers.appCallsManager.generateDh().then((i=>b(this,void 0,void 0,(function*(){return n.dh=i,this.managers.appCallsManager.requestCall(e,n.protocol,n.dh.g_a_hash,t&&s)})))).then((e=>{n.overrideConnectionState(v.Z.PENDING),n.setPhoneCall(e),n.setHangUpTimeout(y,"phoneCallDiscardReasonHangup")}))}))}}const S=new w;a.GO&&(a.GO.callsController=S);const C=S},1677:(e,t,i)=>{"use strict";i.d(t,{KM:()=>s,iK:()=>n});const s=50,n=100},9078:(e,t,i)=>{"use strict";i.d(t,{Z:()=>k});var s=i(4762),n=i(1655),a=i(5953),o=i(6724),r=i(5003),d=i(1507),l=i(3512),c=i(8500),h=i(7625),u=i(3075),p=i(8479),f=i(6752),m=i(9124),g=i(4373),v=i(3773),b=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class y extends u.Z{constructor(e){super(e),this.negotiateThrottled=(0,o.Z)(this.negotiate.bind(this),0,!1)}createPeerConnection(){return this.connection||super.createPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",iceCandidatePoolSize:0})}createDataChannel(){if(this.dataChannel)return this.dataChannel;const e=super.createDataChannel();return e.addEventListener("open",(()=>{this.maybeUpdateRemoteVideoConstraints()})),e.addEventListener("close",(()=>{this.updateConstraintsInterval&&(clearInterval(this.updateConstraintsInterval),this.updateConstraintsInterval=void 0)})),e}createDescription(){return this.description?this.description:super.createDescription()}appendStreamToConference(){super.appendStreamToConference()}invokeJoinGroupCall(e,t,i){return b(this,void 0,void 0,(function*(){const{groupCall:s,description:n}=this,a=s.id,o=t.map((t=>{const i=function(e,t){const i=(0,v.Z)(e,t),s=t.mediaType,n={source:i.source,sourceGroups:i.sourceGroups,type:s};i.fingerprint.setup="active";const a={fingerprints:[i.fingerprint],pwd:i.pwd,ssrc:i.source,"ssrc-groups":i.sourceGroups||[],ufrag:i.ufrag};return{params:{_:"dataJSON",data:JSON.stringify(a)},source:i.source,media:t,sourceGroups:i.sourceGroups,entry:n}}(e,t);return this.sources[i.entry.type]=i.entry,i})),r=o.find((e=>"audio"===e.media.mediaType)),d=o.find((e=>"video"===e.media.mediaType));let{source:c,params:u}=r||{};const p=d||r,f={audio:r,video:d};if(n.entries.forEach((e=>{if("sendonly"===e.direction){const t=f[e.type];if(!t)return;n.setEntrySource(e,t.sourceGroups||t.source),n.setEntryPeerId(e,l.Z.myId)}})),u!==p.params){const e=JSON.parse(p.params.data);c?e.ssrc=c:delete e.ssrc,u={_:"dataJSON",data:JSON.stringify(e)}}const m=yield this.managers.appGroupCallsManager.joinGroupCall(a,u,i),g=JSON.parse(m.params.data);return g.audio=g.audio||s.connections.main.description.audio,n.setData(g),function(e,t){["audio","video"].filter((e=>t[e])).map((e=>[t[e],e])).forEach((([t,i])=>{const s=e.find((e=>e.mediaType===i));if(!s)return;const n=(e=>{const t={};return e.attributes.get("extmap").forEach((e=>{const i=e.key.split("/",1)[0];t[i]=e.value})),t})(s);(0,h.Z)(t["rtp-hdrexts"],((e,t,s)=>{n[e.id]!==e.uri&&(s.splice(t,1),console.log("[sdp] filtered extmap:",e,t,i))}))}))}(t,g),g}))}negotiateInternal(){return b(this,void 0,void 0,(function*(){const{connection:e,description:t}=this,i="new"===e.iceConnectionState&&!t.getEntryByMid("0").source,s=this.log.bindPrefix("startNegotiation");s("start");const n=yield e.createOffer({iceRestart:!1});i&&this.dataChannel&&t.createEntry("application").setDirection("sendrecv");const{sdp:a,offer:o}=function(e){const{offer:t,data:i}=e,s=(0,m.DV)(t.sdp);let n=!1;if(e.skipAddingMulticast||(n=(0,m.e6)(s)||n),(0,h.Z)(s.media,((e,t,a)=>{if(e.isSending)return;if("application"===e.mediaType)return;const o=e.mediaLine,r=o.mediaLineParts,d=(r.ids,o.toString()),l=i[e.mediaType]["payload-types"].map((e=>""+e.id));if(d!==(0,g.Px)(e.mediaType,void 0,l)){const o=(0,v.Z)(s,e),d=Object.assign({},i);d.transport=(0,p.Z)(d.transport),d.transport.ufrag=o.ufrag,d.transport.pwd=o.pwd,d.transport.fingerprints=[o.fingerprint],d.transport.candidates=[];const l=new f.Lp(o.mid,r.type);l.setPort(r.port),o.source&&l.setSource(o.sourceGroups||o.source),l.setDirection(e.direction);const c=(new g.DY).addSsrcEntry(l,d).finalize(),h=(0,m.DV)(c).media[0];a[t]=h,n=!0}})),n){const e=s.toString();t.sdp=e}return{offer:t,sdp:s}}({offer:n,data:t});s("[sdp] setLocalDescription",o.sdp),yield e.setLocalDescription(o);const r=a.media.filter((e=>"application"!==e.mediaType&&e.isSending));if(i)try{yield this.invokeJoinGroupCall(a,r,this.options)}catch(e){this.log.error("[tdweb] joinGroupCall error",e)}const d=[],l=a.bundle;(0,h.Z)(l,((e,i,s)=>{const n=t.getEntryByMid(e);n.shouldBeSkipped(!0)&&(s.splice(i,1),d.push(n))}));const c=a.media.map((e=>{const i=e.mid;let s=t.getEntryByMid(i);return s||(s=new f.Lp(i,e.mediaType),s.setDirection("inactive")),s})),u={type:"answer",sdp:t.generateSdp({bundle:l,entries:c,isAnswer:!0})};d.forEach((e=>{t.deleteEntry(e)})),s(`[sdp] setRemoteDescription signaling=${e.signalingState} ice=${e.iceConnectionState} gathering=${e.iceGatheringState} connection=${e.connectionState}`,u.sdp),yield e.setRemoteDescription(u),s("end")}))}negotiate(){let e=this.negotiating;return e||(e=super.negotiate(),this.updateConstraints&&e.then((()=>{this.maybeUpdateRemoteVideoConstraints(),this.updateConstraints=!1})),"presentation"===this.options.type&&e.then((()=>{this.connection.getTransceivers().find((e=>{var t,i;"video"===(null===(i=null===(t=e.sender)||void 0===t?void 0:t.track)||void 0===i?void 0:i.kind)&&e.sender.setParameters(Object.assign(Object.assign({},e.sender.getParameters()),{degradationPreference:"maintain-resolution"}))}))})),e)}maybeUpdateRemoteVideoConstraints(){if("open"!==this.dataChannel.readyState)return;this.log("maybeUpdateRemoteVideoConstraints");const e={colibriClass:"ReceiverVideoConstraints",constraints:{},defaultConstraints:{maxHeight:0},onStageEndpoints:[]};for(const t of this.description.entries){if("recvonly"!==t.direction||"video"!==t.type)continue;const{endpoint:i}=t;e.onStageEndpoints.push(i),e.constraints[i]={minHeight:180,maxHeight:720}}this.sendDataChannelData(e),e.onStageEndpoints.length?this.updateConstraintsInterval||(this.updateConstraintsInterval=window.setInterval(this.maybeUpdateRemoteVideoConstraints.bind(this),5e3)):this.updateConstraintsInterval&&(clearInterval(this.updateConstraintsInterval),this.updateConstraintsInterval=void 0)}addInputVideoStream(e){this.groupCall.saveInputVideoStream(e,this.type),this.streamManager.addStream(e,"input"),this.appendStreamToConference()}}var w=i(2207),S=i(9337),C=i(382),L=i(5424),I=i(312),E=i(49),P=i(9585),Z=i(2946),M=i(2059),T=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class k extends c.Z{constructor(e){super(),(0,a.Z)(this,e),this.log||(this.log=(0,r.kg)("GROUP-CALL")),this.connections||(this.connections={}),this.isSpeakingMap||(this.isSpeakingMap=new Map),this.pinnedSources=[],this.participantsSsrcs=new Map,this.hadAutoPinnedSources=new Set,this.dispatchPinnedThrottled=(0,o.Z)((()=>{this.dispatchEvent("pinned",this.pinnedSource)}),0,!1),this.addEventListener("state",(e=>{e===w.Z.CLOSED&&this.cleanup()}))}get connectionState(){return this.connections.main.connection.iceConnectionState}get state(){const{connectionState:e}=this;if("closed"===e)return w.Z.CLOSED;if("connected"===e||s.IS_SAFARI&&"completed"===e){const{participant:e}=this;return e.pFlags.can_self_unmute?e.pFlags.muted?w.Z.MUTED:w.Z.UNMUTED:w.Z.MUTED_BY_ADMIN}return w.Z.CONNECTING}get participants(){return this.managers.appGroupCallsManager.getCachedParticipants(this.id)}get isSharingScreen(){return!!this.connections.presentation}get pinnedSource(){return this.pinnedSources[this.pinnedSources.length-1]}get isMuted(){return this.state!==w.Z.UNMUTED}get isClosing(){const{state:e}=this;return e===w.Z.CLOSED}get streamManager(){return this.connections.main.streamManager}get description(){return this.connections.main.description}pinSource(e){(0,n.Z)(this.pinnedSources,e),this.pinnedSources.push(e),this.dispatchPinnedThrottled()}unpinSource(e){this.hadAutoPinnedSources.delete(e),(0,n.Z)(this.pinnedSources,e),this.dispatchPinnedThrottled()}unpinAll(){this.pinnedSources.length=0,this.dispatchPinnedThrottled()}getParticipantByPeerId(e){return T(this,void 0,void 0,(function*(){return d.NM===e?this.participant:(yield this.participants).get(e)}))}toggleMuted(){return this.requestAudioSource(!0).then((()=>this.changeUserMuted(d.NM)))}changeUserMuted(e,t){return T(this,void 0,void 0,(function*(){const i=yield this.getParticipantByPeerId(e);return d.NM===e&&i.pFlags.can_self_unmute&&(t=void 0===t?!i.pFlags.muted:t),this.editParticipant(i,{muted:t})}))}getElement(e){return super.getElement(e)}getVideoElementFromParticipantByType(e,t){let i;i=e.pFlags.self?"video"===t?"main":"presentation":e[t].source_groups[0].sources[0];const s=this.getElement(i);if(!s)return;const n=s.cloneNode();return n.srcObject=s.srcObject,{video:n,source:i}}createConnectionInstance(e){return this.connections[e.type]=new y(Object.assign({groupCall:this,log:this.log.bindPrefix(e.type),managers:this.managers},e))}changeRaiseHand(e){return this.editParticipant(this.participant,{raiseHand:e})}startScreenSharingInternal(){return T(this,void 0,void 0,(function*(){try{const e="presentation",t=yield(0,C.Z)((0,S.Z)()),i=new P.Z,s=this.createConnectionInstance({streamManager:i,type:e,options:{type:e}});s.createPeerConnection().addEventListener("negotiationneeded",(()=>{s.negotiate()})),t.getVideoTracks()[0].addEventListener("ended",(()=>{this.connections.presentation&&this.stopScreenSharing()}),{once:!0}),s.createDescription(),s.addInputVideoStream(t)}catch(e){this.log.error("start screen sharing error",e)}}))}startScreenSharing(){var e;return null!==(e=this.startScreenSharingPromise)&&void 0!==e?e:this.startScreenSharingPromise=this.startScreenSharingInternal().finally((()=>{this.startScreenSharingPromise=void 0}))}stopScreenSharing(){const e=this.connections.presentation;return e?(delete this.connections.presentation,this.unpinSource("presentation"),e.closeConnectionAndStream(!0),delete this.participant.presentation,this.managers.appGroupCallsManager.saveApiParticipant(this.id,this.participant),this.managers.appGroupCallsManager.leaveGroupCallPresentation(this.id)):Promise.resolve()}toggleScreenSharing(){return this.isSharingScreen?this.stopScreenSharing():this.startScreenSharing()}startVideoSharingInternal(){return T(this,void 0,void 0,(function*(){const e={video:(0,I.Z)()};try{const t=yield(0,L.Z)(e,!1);this.connections.main.addInputVideoStream(t),yield this.editParticipant(this.participant,{videoPaused:!1,videoStopped:!1})}catch(t){this.log.error("startVideoSharing error",t,e)}}))}startVideoSharing(){var e;return null!==(e=this.startVideoSharingPromise)&&void 0!==e?e:this.startVideoSharingPromise=this.startVideoSharingInternal().finally((()=>{this.startVideoSharingPromise=void 0}))}stopVideoSharing(){return T(this,void 0,void 0,(function*(){const e=this.connections.main,t=e.streamManager.inputStream.getVideoTracks()[0];t&&((0,E.Z)(t),e.streamManager.appendToConference(e.description),yield this.editParticipant(this.participant,{videoStopped:!0}))}))}toggleVideoSharing(){return this.isSharingVideo?this.stopVideoSharing():this.startVideoSharing()}hangUp(e=!1,t=!1,i=!1){return T(this,void 0,void 0,(function*(){for(const e in this.connections)this.connections[e].closeConnectionAndStream(!t);if(this.dispatchEvent("state",this.state),!i&&!t){const t=e||(this.joined?this.connections.main.sources.audio.source:void 0);this.managers.appGroupCallsManager.hangUp(this.id,t)}}))}tryAddTrack(e){const{description:t}=this,i=super.tryAddTrack(e);if("output"===e.type){const e=t.getEntryBySource(+i);this.getParticipantByPeerId(e.peerId).then((e=>{e&&l.Z.dispatchEvent("group_call_participant",{groupCallId:this.id,participant:e})}))}return i}editParticipant(e,t){return T(this,void 0,void 0,(function*(){if(Object.keys(t).length){if(e){const i=e.pFlags.self;if(i&&void 0!==t.muted&&!this.isSharingAudio&&(delete t.muted,!Object.keys(t).length))return;const s=t.muted;void 0!==s&&e.pFlags.self&&(s?e.pFlags.muted=!0:e.pFlags.can_self_unmute&&delete e.pFlags.muted),void 0!==t.raiseHand&&(t.raiseHand?e.raise_hand_rating="1":delete e.raise_hand_rating),i&&(void 0!==t.videoStopped&&(t.videoStopped?delete e.video:e.video=(0,M.KR)(this.connections.main.sources.video)),!e.pFlags.muted&&e.pFlags.can_self_unmute&&this.setMuted(!1),this.dispatchEvent("state",this.state))}return this.managers.appGroupCallsManager.editParticipant(this.id,e,t)}}))}onParticipantUpdate(e,t){const i=this.connections.main,{connection:s,description:n}=i,a=(0,Z.Z)(e.peer),o=!!e.pFlags.left,r=this.participantsSsrcs.get(a)||[];if(e.presentation&&!o){const{source:t}=(0,M._f)(e,"video",e.presentation.source_groups,e.presentation.endpoint);this.hadAutoPinnedSources.has(t)||(this.hadAutoPinnedSources.add(t),this.pinSource(e.pFlags.self?"presentation":t))}if(e.pFlags.self){this.participant=e,i.sources.audio.source!==e.source&&this.hangUp();let s=!1;return e.pFlags.can_self_unmute?e.pFlags.muted&&(s=!0):(this.stopScreenSharing(),this.stopVideoSharing(),s=!0),s&&this.setMuted(!0),void(t!==a&&this.dispatchEvent("state",this.state))}const d=o?[]:(0,M.s$)(e);o?this.participantsSsrcs.delete(a):this.participantsSsrcs.set(a,d);const l=new Set;r.forEach((e=>{const t=e.source;if(!d.find((e=>e.source===t))){this.unpinSource(t);const e=n.getEntryBySource(t);e&&"inactive"!==e.direction&&(e.setDirection("inactive"),l.add(e.type))}})),d.forEach((e=>{let t=n.getEntryBySource(e.source);t?"inactive"===t.direction&&(t.setDirection(t.originalDirection),l.add(t.type)):(t=n.createEntry(e.type),n.setEntrySource(t,e.sourceGroups||e.source),n.setEntryPeerId(t,a),"video"===e.type&&t.setEndpoint(e.endpoint),t.createTransceiver(s,{direction:"recvonly"}),l.add(t.type))})),l.size&&(l.has("video")&&(i.updateConstraints=!0),i.negotiateThrottled())}}},2207:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>n}),function(e){e[e.UNMUTED=0]="UNMUTED",e[e.MUTED=1]="MUTED",e[e.MUTED_BY_ADMIN=2]="MUTED_BY_ADMIN",e[e.CONNECTING=3]="CONNECTING",e[e.CLOSED=4]="CLOSED"}(s||(s={}));const n=s},2059:(e,t,i)=>{"use strict";i.d(t,{ZP:()=>L,KR:()=>w,_f:()=>y,s$:()=>b});var s=i(5916);let n;var a=i(410),o=i(3241),r=i(5003),d=i(3512),l=i(9078),c=i(2207),h=i(1677),u=i(9585),p=i(9125),f=i(5424),m=i(312),g=i(6752),v=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function b(e){var t,i;return[y(0,"audio",e.source),(null===(t=e.video)||void 0===t?void 0:t.audio_source)&&y(0,"audio",e.video.audio_source),e.video&&y(0,"video",e.video.source_groups,e.video.endpoint),(null===(i=e.presentation)||void 0===i?void 0:i.audio_source)&&y(0,"audio",e.presentation.audio_source),e.presentation&&y(0,"video",e.presentation.source_groups,e.presentation.endpoint)].filter(Boolean)}function y(e,t,i,s){return(0,g.z_)(t,i,s)}function w(e,t){return e&&{_:"groupCallParticipantVideo",pFlags:{},endpoint:"",source_groups:e.sourceGroups,audio_source:t}}class S extends o.Z{construct(e){this.managers=e,this.audioAsset=null!=n?n:n=new s.Z(["group_call_connect.mp3","group_call_end.mp3","group_call_start.mp3","voip_onallowtalk.mp3"]),this.log=(0,r.kg)("GCC"),d.Z.addEventListener("group_call_update",(e=>{const{currentGroupCall:t}=this;(null==t?void 0:t.id)===e.id&&(t.groupCall=e,"groupCallDiscarded"===e._&&t.hangUp(!1,!1,!0))})),d.Z.addEventListener("group_call_participant",(({groupCallId:e,participant:t})=>{const{currentGroupCall:i}=this;(null==i?void 0:i.id)===e&&i.onParticipantUpdate(t)}))}get groupCall(){return this.currentGroupCall}setCurrentGroupCall(e){this.currentGroupCall=e,e&&this.dispatchEvent("instance",e)}startConnectingSound(){this.stopConnectingSound(),this.audioAsset.playSoundWithTimeout("group_call_connect.mp3",!0,2500)}stopConnectingSound(){this.audioAsset.stopSound(),this.audioAsset.cancelDelayedPlay()}joinGroupCall(e,t,i=!0,s,n){return v(this,void 0,void 0,(function*(){let a;return this.audioAsset.createAudio(),this.log(`joinGroupCall chatId=${e} id=${t} muted=${i} rejoin=${s}`),a=s?this.currentGroupCall.connections.main.streamManager:yield function(e,t){return i=this,s=void 0,a=function*(){const i={audio:(0,p.Z)(),video:t&&(0,m.Z)()},s=new u.Z(h.iK);try{const t=yield(0,f.Z)(i,e);s.addStream(t,"input")}catch(e){console.error("joinGroupCall getStream error",e,i),s.inputStream=new MediaStream}return s},new((n=void 0)||(n=Promise))((function(e,t){function o(e){try{d(a.next(e))}catch(e){t(e)}}function r(e){try{d(a.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(i,s||[])).next())}));var i,s,n,a}(i,n),this.joinGroupCallInternal(e,t,a,i,s,n).then((()=>{const{currentGroupCall:e}=this;e.participants.then((t=>{this.currentGroupCall===e&&e.state!==c.Z.CLOSED&&t.forEach((t=>{t.pFlags.self||e.onParticipantUpdate(t)}))}))}))}))}joinGroupCallInternal(e,t,i,s,n=!1,a){return v(this,void 0,void 0,(function*(){const o=this.log.bindPrefix("joinGroupCallInternal");o("start",t);const r="main";let{currentGroupCall:h}=this;if(!h||!n){h=new l.Z({chatId:e,id:t,managers:this.managers}),h.fixSafariAudio(),h.addEventListener("state",(e=>{this.currentGroupCall===h&&e===c.Z.CLOSED&&(this.setCurrentGroupCall(null),this.stopConnectingSound(),this.audioAsset.playSound("group_call_end.mp3"),d.Z.dispatchEvent("chat_update",h.chatId))})),h.groupCall=yield this.managers.appGroupCallsManager.getGroupCallFull(t);const u=h.createConnectionInstance({streamManager:i,type:r,options:{type:r,isMuted:s,joinVideo:a,rejoin:n}}),p=u.createPeerConnection();return p.addEventListener("negotiationneeded",(()=>{u.negotiate()})),p.addEventListener("track",(e=>{o("ontrack",e),h.onTrack(e)})),p.addEventListener("iceconnectionstatechange",(()=>{h.dispatchEvent("state",h.state);const{iceConnectionState:e}=p;switch("disconnected"===e||"checking"===e||"new"===e?this.startConnectingSound():this.stopConnectingSound(),e){case"checking":case"completed":case"disconnected":case"new":break;case"closed":case"failed":h.hangUp();break;case"connected":h.joined||(h.joined=!0,this.audioAsset.playSound("group_call_start.mp3"),this.managers.appGroupCallsManager.getGroupCallParticipants(t))}})),u.createDescription(),u.createDataChannel(),u.appendStreamToConference(),this.setCurrentGroupCall(h),o("set currentGroupCall",t,h),this.startConnectingSound(),u.negotiate()}h.handleUpdateGroupCallParticipants=!1,h.updatingSdp=!1,o("update currentGroupCall",t,h)}))}}const C=new S;a.GO&&(a.GO.groupCallController=C);const L=C},9125:(e,t,i)=>{"use strict";function s(){const e={channelCount:2};return["noiseSuppression","echoCancellation","autoGainControl"].forEach((t=>{(function(e){var t;return(!!(null===(t=null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||void 0===t?void 0:t.getSupportedConstraints()))[e]})(t)&&(e[t]=!0)})),e}i.d(t,{Z:()=>s})},9337:(e,t,i)=>{"use strict";function s(e){const t={video:{width:{max:1920},height:{max:1080},frameRate:{max:30}}};return e||(t.audio=!0),t}i.d(t,{Z:()=>s})},382:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});function s(e){return t=this,i=void 0,n=function*(){const t=yield navigator.mediaDevices.getDisplayMedia(e);return t.getVideoTracks()[0].contentHint="text",t},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n}},5424:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});function s(e,t){return i=this,s=void 0,a=function*(){const i=yield navigator.mediaDevices.getUserMedia(e);return i.getTracks().forEach((e=>{e.enabled=!t})),i},new((n=void 0)||(n=Promise))((function(e,t){function o(e){try{d(a.next(e))}catch(e){t(e)}}function r(e){try{d(a.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(i,s||[])).next())}));var i,s,n,a}window.getStream=s},312:(e,t,i)=>{"use strict";function s(){return{width:{min:1280,max:1920},height:{min:720,max:1080},frameRate:{min:24,max:30}}}i.d(t,{Z:()=>s})},3773:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(8957);function n(e,t){const i=t.lookupAttributeKeys({"ice-ufrag":!0,"ice-pwd":!0,fingerprint:!0,setup:!0,ssrc:!0,mid:!0,"ssrc-group":!1});if(!i.fingerprint){const t=e.session.lines.find((e=>{var t;return"fingerprint"===(null===(t=e.parsed)||void 0===t?void 0:t.key)}));i.fingerprint=t.parsed.value}const n=function(e){const t=e.map((e=>{const[t,...i]=e.split(" ");return{_:"groupCallParticipantVideoSourceGroup",semantics:t,sources:i.map((e=>(0,s.Fk)(+e)))}}));return t.length?t:void 0}(i["ssrc-group"]),[a,o]=i.fingerprint.split(" ",2),r=i.ssrc&&(0,s.Fk)(+i.ssrc.split(" ",1)[0]);return{raw:i,ufrag:i["ice-ufrag"],pwd:i["ice-pwd"],fingerprint:{fingerprint:o,setup:i.setup,hash:a},source:r,sourceGroups:n,mid:i.mid}}},49:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(6669);function n(e){e.stop(),(0,s.Z)(e,"ended")}},6752:(e,t,i)=>{"use strict";i.d(t,{Lp:()=>o,ZP:()=>d,z_:()=>r});var s=i(1655),n=i(5953),a=i(4373);class o{constructor(e,t){this.mid=e,this.type=t,this.port=a._D}setDirection(e){return this.originalDirection||(this.originalDirection=e),this.direction=e}setPort(e){return this.port=e}setEndpoint(e){return this.endpoint=e}setPeerId(e){return this.peerId=e}createTransceiver(e,t){return(null==t?void 0:t.direction)&&this.setDirection(t.direction),this.transceiver=e.addTransceiver((0,a.pl)(this.type),t)}setSource(e){let t;if(Array.isArray(e)){if(!e[0])return;t=e,e=t[0].sources[0]}return this.sourceGroups=t,this.source=e}shouldBeSkipped(e){return e&&"inactive"===this.direction}}function r(e,t,i){let s;if(Array.isArray(t)){if(!t[0])return;s=t,t=s[0].sources[0]}return{endpoint:i,type:e,source:t,sourceGroups:s}}class d{constructor(e){this.connection=e,this.sessionId=""+Date.now(),this.maxSeenId=-1,this.entries=[],this.entriesByMid=new Map,this.entriesBySource=new Map,this.entriesByPeerId=new Map}setData(e){return(0,n.Z)(this,e)}createEntry(e){const t=""+ ++this.maxSeenId,i=new o(t,e);return this.entries.push(i),this.entriesByMid.set(t,i),i}deleteEntry(e){(0,s.Z)(this.entries,e),this.entriesByMid.delete(e.mid),this.entriesBySource.delete(e.source);const t=this.entriesByPeerId.get(e.peerId);t&&(t.delete(e),t.size||this.entriesByPeerId.delete(e.peerId))}setEntrySource(e,t){e.setSource(t),this.entriesBySource.set(e.source,e)}setEntryPeerId(e,t){e.setPeerId(t);let i=this.entriesByPeerId.get(t);i||this.entriesByPeerId.set(t,i=new Set),i.add(e)}findEntry(e){return this.entries.find(e)}findFreeSendRecvEntry(e,t){let i=this.entries.find((i=>"sendrecv"===i.direction&&i.type===e&&!(t?i.sendEntry:i.recvEntry)));return i||(i=this.createEntry(e),i.setDirection("sendrecv")),i}getEntryByMid(e){return this.entriesByMid.get(e)}getEntryBySource(e){return this.entriesBySource.get(e)}getEntriesByPeerId(e){return this.entriesByPeerId.get(e)}generateSdp(e){return a.DY.fromConference(Object.assign({conference:this},e))}}},9124:(e,t,i)=>{"use strict";i.d(t,{e6:()=>de,DV:()=>oe});var s,n,a=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},o=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class r{constructor(e,t){s.set(this,void 0),n.set(this,void 0),a(this,s,e,"f"),a(this,n,t,"f")}get session(){return o(this,s,"f")}get media(){return o(this,n,"f")}get bundle(){return this.session.lines.find((e=>{var t;return"group"===(null===(t=e.parsed)||void 0===t?void 0:t.key)})).value.split(" ").slice(1)}toString(){return this.session.lines.concat(...this.media.map((e=>e.lines))).map((e=>e.toString())).join("\r\n")+"\r\n"}}function d(e,t,i){const s=e.split(t),n=[];for(;i>0&&s.length;)n.push(s.shift()),--i;return s.length&&n.push(s.join(t)),n}s=new WeakMap,n=new WeakMap;var l,c,h,u=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},p=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class f{constructor(e,t){l.set(this,void 0),c.set(this,void 0),h.set(this,void 0),u(this,l,new Set,"f"),u(this,c,e,"f"),u(this,h,t,"f")}generate(){const e=p(this,c,"f"),t=p(this,h,"f"),i=p(this,l,"f"),s=t-e+1;let n=Math.floor(e+s*Math.random()),a=0;for(;i.has(n);)if(n=s)return null;return i.add(n),n}add(e){p(this,l,"f").add(e)}}l=new WeakMap,c=new WeakMap,h=new WeakMap;var m,g,v=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},b=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class y{constructor(e,t){m.set(this,void 0),g.set(this,void 0),v(this,m,e,"f"),v(this,g,t,"f")}get key(){return b(this,m,"f")}get value(){return b(this,g,"f")}}m=new WeakMap,g=new WeakMap;var w,S,C,L,I=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},E=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class P{constructor(e,t,i,s){w.set(this,void 0),S.set(this,void 0),C.set(this,void 0),L.set(this,void 0),I(this,w,e,"f"),I(this,S,t,"f"),I(this,C,i,"f"),I(this,L,s,"f")}get type(){return E(this,w,"f")}get port(){return E(this,S,"f")}get protocol(){return E(this,C,"f")}get ids(){return E(this,L,"f")}toString(){return this.type+" "+this.port+" "+this.protocol+" "+this.ids.join(" ")}}w=new WeakMap,S=new WeakMap,C=new WeakMap,L=new WeakMap;var Z,M,T,k,x=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},A=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class _{constructor(e,t){if(Z.set(this,void 0),M.set(this,void 0),T.set(this,void 0),k.set(this,void 0),x(this,Z,e,"f"),"string"==typeof t){if(x(this,M,t,"f"),"m"===e){const e=t.split(" ");x(this,T,new P(e[0],e[1],e[2],e.slice(3)),"f")}else if("a"===e){const e=d(t,":",1);t=e[0],x(this,k,1===e.length?new y(t,null):new y(t,e[1]),"f")}}else t instanceof P?(x(this,T,t,"f"),x(this,M,t.toString(),"f")):t instanceof y&&(x(this,k,t,"f"),x(this,M,t.value?`${t.key}:${t.value}`:t.key,"f"))}get key(){return A(this,Z,"f")}get value(){return A(this,M,"f")}get parsed(){return A(this,k,"f")}get mediaLineParts(){return A(this,T,"f")}toString(){return`${this.key}=${this.value}`}}Z=new WeakMap,M=new WeakMap,T=new WeakMap,k=new WeakMap;var F,D,R,B,N,O,U=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},H=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class z{constructor(e,t,i=":",s=!1){F.set(this,void 0),D.set(this,void 0),R.set(this,void 0),B.set(this,void 0),N.set(this,void 0),O.set(this,void 0),U(this,F,e,"f"),U(this,D,t,"f"),U(this,R,i,"f"),U(this,N,s,"f"),U(this,B,s?new Map:null,"f"),U(this,O,s?[]:null,"f")}get lines(){return H(this,D,"f")}get value(){return H(this,N,"f")||!this.lines.length?null:this.lines[0]}get exists(){return!H(this,N,"f")}get key(){return H(this,F,"f")}get keys(){return z.fill(this),H(this,O,"f")}forEach(e){z.fill(this),H(this,B,"f").forEach(e)}get(e){return z.fill(this),H(this,B,"f").get(e)||new z(e,[],":",!0)}static fill(e){if(null!==H(e,B,"f"))return;const t=new Map;e.lines.forEach((i=>{const[s,n]=d(i,H(e,R,"f"),1),a=t.get(s)||[];t.set(s,[...a,n||""])}));const i=U(e,B,z.makeAttributes(t),"f");U(e,O,Array.from(i.keys()),"f")}static makeAttributes(e){const t=new Map;return e.forEach(((e,i)=>{t.set(i,new z(i,e))})),t}}F=new WeakMap,D=new WeakMap,R=new WeakMap,B=new WeakMap,N=new WeakMap,O=new WeakMap;var j,G,V=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},K=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class W{constructor(e){j.set(this,void 0),G.set(this,void 0),V(this,j,e,"f"),V(this,G,new Map,"f"),W.fillAttributes(this)}get(e){return K(this,G,"f").get(e)||new z(e,[]," ",!0)}static fillAttributes(e){const t=new Map;K(e,j,"f").forEach((e=>{if("a"===e.key){const{key:i,value:s}=e.parsed;let n=t.get(i);n||(n=[],t.set(i,n)),n.push(s||"")}})),t.forEach(((t,i)=>{K(e,G,"f").set(i,new z(i,t," ",!1))}))}}j=new WeakMap,G=new WeakMap;var $,q,Y,Q,X=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},J=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class ee{constructor(e){$.set(this,void 0),q.set(this,void 0),Y.set(this,void 0),Q.set(this,void 0),X(this,$,e,"f"),X(this,q,e[0],"f"),X(this,Y,X(this,Q,null,"f"),"f")}get lines(){return J(this,$,"f")}get mediaLine(){return J(this,q,"f")}get mediaLineParts(){return J(this,q,"f").mediaLineParts}get mediaType(){return this.mediaLineParts.type}get direction(){if(!J(this,Q,"f")){const e=this.attributes;let t;t=e.get("sendonly").exists?"sendonly":e.get("recvonly").exists?"recvonly":e.get("inactive").exists?"inactive":"sendrecv",X(this,Q,t,"f")}return J(this,Q,"f")}get isSending(){return"sendrecv"===this.direction||"sendonly"===this.direction}get isReceiving(){return"sendrecv"===this.direction||"recvonly"===this.direction}get attributes(){return J(this,Y,"f")||X(this,Y,new W(this.lines),"f"),J(this,Y,"f")}get mid(){return this.attributes.get("mid").value}lookupAttributeKeys(e){const t={};for(const i in e){const s=this.attributes.get(i),n=!e[i];t[i]=s?n?s.lines:s.value:n?[]:void 0}return t}}$=new WeakMap,q=new WeakMap,Y=new WeakMap,Q=new WeakMap;var te,ie,se=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},ne=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class ae{constructor(e){te.set(this,void 0),ie.set(this,void 0),se(this,te,e,"f"),se(this,ie,e.filter((e=>"o"===e.key)).map((e=>e.value.split(" ")[1]))[0],"f")}get lines(){return ne(this,te,"f")}get sessionId(){return ne(this,ie,"f")}}function oe(e){function t(){i?n.push(new ee(s)):i=new ae(s)}let i=null,s=[];const n=[];return e.split(/\r?\n/).forEach((e=>{if(!function(e){return/^[\s\xa0]*$/.test(e)}(e)){const i=re(e);"m"===i.key&&(t(),s=[]),s.push(i)}})),t(),new r(i,n)}function re(e){const t=d(e,"=",1);return new _(t[0],t[1])}function de(e){let t;return e.media.forEach(((i,s)=>{if("video"===i.mediaType&&i.isSending&&!i.attributes.get("ssrc-group").get("SIM").exists){t||(t=new f(2,4294967295));const n=i.attributes.get("ssrc-group").get("FID").value.split(" "),a=i.lines;n.forEach((e=>t.add(+e)));const o=[n[0],t.generate(),t.generate()],r=[n[1],t.generate(),t.generate()];a.push(re("a=ssrc-group:SIM "+o.join(" ")));const d=i.attributes.get("ssrc").get(n[0]).lines;o.forEach(((e,t)=>{const i=r[t];t>0&&(a.push(re("a=ssrc-group:FID "+e+" "+i)),d.forEach((t=>{a.push(re("a=ssrc:"+e+" "+t))})),d.forEach((e=>{a.push(re("a=ssrc:"+i+" "+e))})))})),e.media[s]=new ee(a)}})),!!t}te=new WeakMap,ie=new WeakMap},4373:(e,t,i)=>{"use strict";i.d(t,{DY:()=>c,Px:()=>l,_D:()=>o,pl:()=>r});var s=i(4762),n=i(630),a=i(8957);const o="9";function r(e){return"screencast"===e?"video":e}function d(e){return"application"===e?"DTLS/SCTP":"UDP/TLS/RTP/SAVPF"}function l(e,t=o,i){const s=d(e);return`m=${r(e)} ${t} ${s} ${i.join(" ")}`}class c extends n.Z{addCandidate(e){return this.add(function(e){const t=[];return t.push("a=candidate:"),t.push(`${e.foundation} ${e.component} ${e.protocol.toUpperCase()} ${e.priority} ${e.ip} ${e.port} typ ${e.type}`),void 0!==e["rel-addr"]&&t.push(` raddr ${e["rel-addr"]} rport ${e["rel-port"]}`),t.push(` generation ${e.generation}`),t.join("")}(e))}addHeader(e,t){const i=t.join(" ");return this.add("v=0",`o=- ${e} 2 IN IP4 0.0.0.0`,"s=-","t=0 0","a=extmap-allow-mixed",`a=group:BUNDLE ${i}`,"a=ice-options:trickle","a=msid-semantic:WMS *")}addTransport(e,t){this.add(`a=ice-ufrag:${e.ufrag}`,`a=ice-pwd:${e.pwd}`,"a=ice-options:trickle");for(const t of e.fingerprints)this.add(`a=fingerprint:${t.hash} ${t.fingerprint}`,`a=setup:${t.setup}`);if(!t&&e.candidates)for(const t of e.candidates)this.addCandidate(t);return this}addSsrc(e){let t="stream",{type:i,sourceGroups:s}=e;const n=(0,a.h)(e.source);t+=n,i+=n;const o=e=>{this.add(`a=ssrc:${e} cname:${t}`,`a=ssrc:${e} msid:${t} ${i}`,`a=ssrc:${e} mslabel:${t}`,`a=ssrc:${e} label:${i}`)};return(()=>{this.add(`a=msid:${t} ${i}`)})(),(null==s?void 0:s.length)?s.forEach((e=>{if(e.sources.length){const t=e.sources.map(a.h);this.add(`a=ssrc-group:${e.semantics} ${t.join(" ")}`),t.forEach(o)}})):o(n),this}addSsrcEntry(e,t,i){const s=(...e)=>this.add(...e),{type:n,mid:a,direction:o,port:c}=e,h=t.transport,u="application"===n,p=u?void 0:t[n],f="inactive"===o;if(e.shouldBeSkipped(i))return s(`m=${r(n)} 0 ${d(n)} 0`,"c=IN IP4 0.0.0.0","a=inactive",`a=mid:${a}`);const m=u?[{id:5e3}]:p["payload-types"],g=m.map((e=>e.id));s(l(n,c,g),"c=IN IP4 0.0.0.0",`a=rtcp:${c} IN IP4 0.0.0.0`),h["rtcp-mux"]&&s("a=rtcp-mux"),s(`a=mid:${a}`);let v=o;if("sendrecv"===o||!i||f||u||(v="sendonly"===o?"recvonly":"sendonly"),s(`a=${v}`),this.addTransport(h),u)s(`a=sctpmap:${m[0].id} webrtc-datachannel 256`);else{const e=p["rtp-hdrexts"];(null==e?void 0:e.length)&&e.forEach((e=>{s(`a=extmap:${e.id} ${e.uri}`)})),m.forEach((e=>{s(`a=rtpmap:${e.id} ${e.name}/${e.clockrate}${e.channels&&e.channels>1?`/${e.channels}`:""}`);const t=e.parameters;if(Array.isArray(t))t.length&&console.error("parameters is array???",t);else if(t&&Object.keys(t).length){const i=[];for(const e in t)i.push(`${e}=${t[e]}`);s(`a=fmtp:${e.id} ${i.join(";")}`)}const i=e["rtcp-fbs"];(null==i?void 0:i.length)&&i.forEach((t=>{s(`a=rtcp-fb:${e.id} ${t.type}${t.subtype?" "+t.subtype:""}`)}))}))}return!e.source||"sendonly"!==v&&"sendrecv"!==v||this.addSsrc(e),this}addConference(e){const{conference:t,entries:i,bundle:n,isAnswer:a}=e;this.addHeader(t.sessionId,n),s.IS_FIREFOX&&this.addTransport(t.transport);for(const e of i)this.addSsrcEntry((a?e.recvEntry||e.sendEntry:e.sendEntry||e.recvEntry)||e,t,a);return this}static fromConference(e){return(new c).addConference(e).finalize()}}},9585:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var s=i(3241),n=i(5003),a=i(1677),o=i(49),r=i(4373),d=i(8957);class l{constructor(e,t){const i=this.streamSource=e.createMediaStreamSource(t),s=this.analyser=e.createAnalyser();this.gain=e.createGain(),s.minDecibels=-100,s.maxDecibels=-30,s.smoothingTimeConstant=.05,s.fftSize=1024,i.connect(s)}}class c{constructor(e){this.interval=e,this.getAmplitude=e=>{const{streamAnalyser:t,stream:i,track:s,source:n,type:a}=e,o=t.analyser;if(!o)return;const r=new Uint8Array(o.frequencyBinCount);return o.getByteFrequencyData(r),{type:a,source:n,stream:i,track:s,value:(0,d.UN)(r)}},this.analyse=()=>{const e=this.counter%3==0,t=(e?this.items:this.items.filter((e=>"input"===e.type))).filter((e=>"audio"===e.kind)).slice(0,a.KM).map(this.getAmplitude);++this.counter>=1e3&&(this.counter=0),c.ANALYSER_LISTENER.dispatchEvent("amplitude",{amplitudes:t,type:e?"all":"input"})},this.context=new(window.AudioContext||window.webkitAudioContext),this.items=[],this.outputStream=new MediaStream,this.inputStream=new MediaStream,this.counter=0,this.log=(0,n.kg)("SM"),this.direction="sendonly",this.canCreateConferenceEntry=!0,this.types=["audio","video"]}addStream(e,t){e.getTracks().forEach((i=>{this.addTrack(e,i,t)}))}addTrack(e,t,i){this.log("addTrack",i,t,e);const{context:s,items:n,inputStream:a,outputStream:o}=this,r=t.kind,d=c.getSource(e,i);switch(i){case"input":a?a.addTrack(t):this.inputStream=e;break;case"output":for(let e=0;e{this.removeTrack(t)}),{once:!0}),this.items.push(e)}hasInputTrackKind(e){return this.items.find((t=>"input"===t.type&&t.kind===e))}static getSource(e,t){return"input"===t?e.source||e.id:""+(0,d.Fk)(+e.id.substring(6))}removeTrack(e){this.log("removeTrack",e);const{items:t}=this;let i=!1;for(let s=0,n=t.length;!i&&s[e,n])),o=t.getTracks();for(const[t,n]of a){let a=e.findEntry((e=>e.direction===i&&e.type===t));if(!a){if(!s)continue;a=e.createEntry(t)}let{transceiver:d}=a;d||(d=a.createTransceiver(e.connection,n)),a.direction!==d.direction&&(d.direction=a.direction);const l=(0,r.pl)(t),c=o.findIndex((e=>e.kind===l)),h=-1!==c?o.splice(c,1)[0]:void 0,u=d.sender;u.track!==h&&u.replaceTrack(h).catch((e=>{this.log.error(e)}))}}stop(){try{this.inputStream.getTracks().concat(this.outputStream.getTracks()).forEach((e=>{(0,o.Z)(e)}))}catch(e){this.log.error(e)}}}c.ANALYSER_LISTENER=new s.Z},630:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});class s{constructor(e="\r\n"){this.joiner=e,this.lines=[],this.newLine=[]}add(...e){return this.lines.push(...e),this}push(e){return this.newLine.push(e),this}addJoined(e=""){return this.add(this.newLine.join(e)),this.newLine=[],this}join(){return this.lines.join(this.joiner)}finalize(){return this.join()+this.joiner}}},8957:(e,t,i)=>{"use strict";function s(e){return e<<0}function n(e){return e>>>0}function a(e,t=3){if(!e)return 0;const{length:i}=e;let s=0;for(let t=0;ts,UN:()=>a,h:()=>n})},586:(e,t,i)=>{"use strict";i.d(t,{_:()=>s});const s=2147483646},3785:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(7197),n=i(1229);const a=new RegExp(`(^${n.Z})`);function o(e,t=!1){const i=(e||"").trim().split(" ");if(!i[0])return{text:"",entities:[]};const n=[],o=i[0].match(a),r=(null==o?void 0:o[0])||i[0][0];o&&n.push((0,s.Z)(r));const d=i.length;if(t||1===d)return{text:r,entities:n};const l=i[d-1].match(a),c=(null==l?void 0:l[0])||i[d-1][0];return l&&n.push(Object.assign(Object.assign({},(0,s.Z)(c)),{offset:r.length})),{text:r+c,entities:n}}},7197:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(671);function n(e){return{_:"messageEntityEmoji",offset:0,length:e.length,unicode:(0,s.w1)(e).join("-").replace(/-?fe0f/g,"")}}},1171:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(2423);function n(e){return e?e.match(s.E):null}},2521:(e,t,i)=>{"use strict";function s(e){return e.target="_blank",e.rel="noopener noreferrer",e}i.d(t,{Z:()=>s})},5798:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(8115),n=i(3785);function a(e,t){const{text:i,entities:a}=(0,n.Z)(e,t);return(0,s.Z)(i,void 0,a)}},3066:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(3512),n=i(5400);function a(e,t={}){if(!e)return(0,n.ZP)("");let i=t.entities;return i&&!s.Z.premium&&t.wrappingForPeerId!==s.Z.myId&&(i=i.filter((e=>"messageEntityCustomEmoji"!==e._))),(0,n.ZP)(e,Object.assign(Object.assign({},t),{entities:i,noLinks:!0,wrappingDraft:!0,passEntities:{messageEntityTextUrl:!0,messageEntityMentionName:!0}}))}},8115:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(6535),n=i(5400);function a(e,t=!1,i){return e?(null!=i||(i=(0,s.Z)(e).filter((e=>"messageEntityEmoji"===e._))),(0,n.ZP)(e,{entities:i,wrappingDraft:t})):(0,n.ZP)("")}},5400:(e,t,i)=>{"use strict";i.d(t,{LD:()=>_,KZ:()=>F,SZ:()=>G,ZP:()=>j,Cx:()=>K,Hc:()=>V});var s=i(2423),n=i(3447),a=i(9976),o=i(8479),r=i(4056),d=i(1379),l=i(6535),c=i(2521),h=i(3591);const u={};a.Z&&(u[""]=!0,[["14","🫱🏻"]].forEach((([e,t])=>{u[e]=function(e){const t=document.createElement("span");t.classList.add("emoji"),document.body.appendChild(t),t.innerText=e;const i=t.offsetWidth;t.innerText="❤️";const s=t.offsetWidth;return document.body.removeChild(t),Math.abs(i-s)<5}(t)})));const p=u;var f=i(2738),m=i(3512),g=i(4755),v=i(3541),b=i(3772),y=i(5814),w=i(2153),S=i(393),C=i(8938),L=i(319),I=i(8497),E=i(4881),P=i(3624),Z=i(5565),M=i(6854),T=i(645),k=i(4497);const x=new ResizeObserver((e=>{for(const t of e)t.target.parentElement.setDimensionsFromRect(t.contentRect)})),A=new w.Z;class _ extends HTMLElement{constructor(){super(),this.paused=!0,this.classList.add("custom-emoji")}get docId(){return this.dataset.docId}static create(e){const t=new _;return t.dataset.docId=""+e,t}get isConnected(){var e,t;return null!==(t=null===(e=this.placeholder)||void 0===e?void 0:e.isConnected)&&void 0!==t?t:super.isConnected}connectedCallback(){this.player&&y.Z.addAnimation({animation:this,group:this.renderer.animationGroup,controlled:!0})}disconnectedCallback(){var e;!this.isConnected&&(null===(e=this.renderer)||void 0===e?void 0:e.isSelectable)&&this.clear()}destroy(){this.clear()}clear(e=!0){var t;if(this.clean)return;this.clean=!0,this.pause();const{syncedPlayer:i}=this;if(i&&i.pausedElements.delete(this),null===(t=this.middlewareHelper)||void 0===t||t.clean(),this.renderer){const t=this.renderer.customEmojis.get(this.docId);(null==t?void 0:t.delete(this))&&!t.size&&(this.renderer.customEmojis.delete(this.docId),this.renderer.playersSynced.delete(t)),e&&(this.renderer.isSelectable?this.replaceChildren(G(!0)):this.replaceChildren())}this.player&&y.Z.removeAnimationByPlayer(this),A&&A.delete({div:this}),this.elements=this.renderer=this.player=this.syncedPlayer=void 0}pause(){this.paused||(this.paused=!0,this.player instanceof HTMLVideoElement&&!this.syncedPlayer&&(this.renderer.lastPausedVideo=this.player,this.player.pause()),this.syncedPlayer&&!this.syncedPlayer.pausedElements.has(this)&&(this.syncedPlayer.pausedElements.add(this),this.syncedPlayer.player&&this.syncedPlayer.pausedElements.size===this.syncedPlayer.middlewares.size&&this.syncedPlayer.player.pause()))}play(){var e,t;this.paused&&(this.paused=!1,this.player instanceof HTMLVideoElement&&(this.player.currentTime=null!==(t=null===(e=this.renderer.lastPausedVideo)||void 0===e?void 0:e.currentTime)&&void 0!==t?t:this.player.currentTime,this.player.play().catch(L.Z)),this.syncedPlayer&&this.syncedPlayer.pausedElements.has(this)&&(this.syncedPlayer.pausedElements.delete(this),this.syncedPlayer.pausedElements.size!==this.syncedPlayer.middlewares.size&&this.player.play()))}remove(){this.clear()}get autoplay(){return!0}get loop(){return!0}}class F extends HTMLElement{constructor(){super(),this.classList.add("custom-emoji-renderer"),this.canvas=document.createElement("canvas"),this.canvas.classList.add("custom-emoji-canvas"),this.context=this.canvas.getContext("2d"),this.append(this.canvas),this.playersSynced=new Map,this.clearedElements=new WeakSet,this.customEmojis=new Map,this.animationGroup="EMOJI",this.isCanvasClean=!1}connectedCallback(){B.has(this)||(x.observe(this.canvas),B.add(this),this.connectedCallback=void 0)}disconnectedCallback(){var e;!this.isConnected&&this.auto&&(null===(e=this.destroy)||void 0===e||e.call(this),this.disconnectedCallback=void 0)}destroy(){var e;x.unobserve(this.canvas),this.customEmojis.forEach((e=>{e.forEach((e=>{e.clear()}))})),B.delete(this),this.playersSynced.clear(),null===(e=this.middlewareHelper)||void 0===e||e.clean(),this.customEmojis.clear(),this.destroy=this.lastPausedVideo=void 0}getOffsets(e=new Map){if(!this.playersSynced.size)return e;const t=(0,I.Z)(this,"scrollable")||this.offsetParent;if(!t)return e;const i=t.getBoundingClientRect(),s=this.getBoundingClientRect();for(const n of this.playersSynced.keys()){const a=Array.from(n),o=this.isSelectable?a.map((e=>e.placeholder)):a,{visible:r}=(0,E.Z)({overflowElement:t,overflowRect:i,elements:o,extraSize:2.5*this.size.height}),d=r.map((({rect:e})=>({top:e.top-s.top,left:e.left-s.left,width:e.width})));d.length&&e.set(n,d)}return e}clearCanvas(){if(this.isCanvasClean)return;const{context:e,canvas:t}=this;e.clearRect(0,0,t.width,t.height),this.isCanvasClean=!0}render(e){const{context:t,canvas:i,isDimensionsSet:s}=this;s||this.setDimensionsFromRect(void 0,!1),this.isCanvasClean=!1;const{width:n,height:a,dpr:o}=i;for(const[i,s]of e){const e=this.playersSynced.get(i),a=O.get(e)||(e instanceof HTMLVideoElement?e:void 0);if(!a)continue;const r=a instanceof ImageData;let d,l;e instanceof HTMLVideoElement?(d=this.size.width*o,l=this.size.height*o):(d=a.width,l=a.height);const c=Math.round(s[0].width*o);c!==d&&(d=c,l=c);const h=n-d;this.clearedElements.has(i)||this.isSelectable||(this.isSelectable?i.forEach((e=>{var t;null!==(t=e.lastChildWas)&&void 0!==t||(e.lastChildWas=e.lastChild),(0,Z.Z)(e,e.firstChild)})):i.forEach((e=>{e.replaceChildren()})),this.clearedElements.add(i)),s.forEach((({top:e,left:i})=>{e=Math.round(e*o),(i=Math.round(i*o))<0||i>h||(r?t.putImageData(a,i,e):t.drawImage(a,i,e,d,l))}))}}checkForAnyFrame(){for(const e of this.playersSynced.values())if(O.has(e)||e instanceof HTMLVideoElement)return!0;return!1}remove(){super.remove()}setDimensionsFromRect(e=this.lastRect,t=!0){const{canvas:i}=this,{dpr:s}=i;if(this.lastRect!==e&&(this.lastRect=e),!e||!s||this.ignoreSettingDimensions)return;const{width:n,height:a}=e,o=Math.floor(Math.round(n*s)),r=Math.floor(Math.round(a*s));i.width===o&&i.height===r||(i.width=o,i.height=r,this.isDimensionsSet=!0,this.isCanvasClean=!0,(this.forceRenderAfterSize||this.isSelectable&&t)&&(this.forceRenderAfterSize=void 0,this.forceRender()))}forceRender(){this.isDimensionsSet&&(U(new Set([this]))||this.clearCanvas())}add(e,t,i,s){const n=this;if(e.forEach(((t,i)=>{let s=this.customEmojis.get(i);s?this.clearedElements.delete(s):this.customEmojis.set(i,s=new Set);for(const e of t)s.has(e)?t.delete(e):(e.clean=!1,e.renderer=n,e.elements=s,e.middlewareHelper=this.middlewareHelper.get().create(),s.add(e),e.lastChildWas&&!e.lastChildWas.parentNode&&e.append(e.lastChildWas));t.size||e.delete(i)})),!e.size)return;const a=!(t||!1===t||!A),o=Array.from(e.keys()),r=m.Z.managers,d=this.middlewareHelper.get(),l=this.size;return r.appEmojiManager.getCachedCustomEmojiDocuments(o).then((c=>{if(d&&!d())return;const h=[],u=(o,c)=>{const h=o.id,u=e.get(h),p=n.customEmojis.get(h),f=2===o.sticker,m="video/webm"===o.mime_type&&!S.Z,g=(f||3===o.sticker&&this.isSelectable)&&!i&&!m,w=[],I=Array.from(u),E=(0,v.ZP)({div:I,doc:o,width:l.width,height:l.height,loop:!0,play:D,managers:r,isCustomEmoji:!0,group:"none",loadPromises:w,middleware:d,exportLoad:a||!1===t?2:1,needFadeIn:!1,loadStickerMiddleware:g&&d?d.create().get((()=>!!Z.middlewares.size)):void 0,static:m,onlyThumb:i,withThumb:null!=s?s:!n.clearedElements.has(p)&&void 0,syncedVideo:this.isSelectable});c&&E.then((()=>c.push(...w)));const P={elements:u};if(1===o.sticker||i||m)return this.isSelectable&&(P.onRender=()=>Promise.all(w).then((()=>{d&&!d()||I.forEach((e=>{const{placeholder:t}=e;t.src=e.firstElementChild.src}))}))),E.then((e=>Object.assign(Object.assign({},e),P)));let Z;P.onRender=e=>Promise.all(w).then((()=>{var t;if(d&&!d()||!o.animated)return;const i=Array.isArray(e)?e:[e],s=Array.isArray(i)?i[0]:i;if((0,C.Z)(s),I.forEach(((e,t)=>{const s=i[t]||i[0];e.player=s,Z&&(e.syncedPlayer=Z,e.paused?e.syncedPlayer.pausedElements.add(e):s.paused&&s.play()),e.isConnected&&y.Z.addAnimation({animation:e,group:e.renderer.animationGroup,controlled:!0})})),(s instanceof b.Z||s instanceof HTMLVideoElement&&this.isSelectable)&&(Z.player=s,n.playersSynced.set(p,s)),s instanceof b.Z?(s.group=n.animationGroup,null!==(t=s.overrideRender)&&void 0!==t||(s.overrideRender=e=>{O.set(s,e)})):HTMLVideoElement,g){const e=(0,b.a)(this.size.width,this.size.height);n.canvas.dpr=e,H()}}));const M=[h,l.width,l.height].join("-");if(g){Z=N.get(M),Z||(Z={player:void 0,middlewares:new Set,pausedElements:new Set,key:M},N.set(M,Z));for(const e of u){const t=e.middlewareHelper.get();Z.middlewares.add(t),t.onClean((()=>{var i,s;if(Z.middlewares.delete(t),!Z.middlewares.size){if(Z.player){const t=O.get(Z.player);if(t&&(null===(s=(i=t).close)||void 0===s||s.call(i),O.delete(Z.player)),O.delete(Z.player),Z.player instanceof b.Z)Z.player.overrideRender=L.Z,Z.player.remove();else if(Z.player instanceof HTMLVideoElement){const t=T.Z.generateName(""+e.docId,0,0,void 0,void 0);delete v._i[t]}Z.player=void 0}N.get(Z.key)===Z&&N.delete(Z.key)&&!N.size&&z()}}))}}return E.then((e=>Object.assign(Object.assign({},e),P)))},p=[],f=c.map(((e,t)=>{if(e)return u(e,h);p.push(o[t])})).filter(Boolean),m=p.length?r.appEmojiManager.getCustomEmojiDocuments(p).then((e=>d&&!d()?[]:e.filter(Boolean).map((e=>u(e))))):Promise.resolve([]),g=e=>Promise.all(e).then((e=>{const t=e.map((({load:e,onRender:t,elements:i})=>{if(!e)return;const s=()=>e().then(t);if(!a)return s();i.forEach((e=>{A.push({div:e,load:()=>(i.forEach((e=>{A.delete({div:e})})),s())})}))}));return Promise.all(t)})),w=()=>{if(d&&!d())return;const e=g(f),t=m.then((e=>g(e)));return Promise.all([e,t])};return t?t.push({div:n.canvas,load:w}):w(),Promise.all(f).then((()=>Promise.all(h))).then((()=>{}))}))}static create(e){const t=new F;t.animationGroup=e.animationGroup,t.size=e.customEmojiSize||g.Z.active.customEmoji,t.isSelectable=e.isSelectable,e.wrappingDraft&&(t.contentEditable="false",t.style.height="inherit");let i=e.middleware;return i?(t.middlewareHelper=i.create(),i=t.middlewareHelper.get(),i.onDestroy((()=>{var e;null===(e=t.destroy)||void 0===e||e.call(t)}))):(t.auto=!0,t.middlewareHelper=(0,P.k)()),t}}const D=!0;let R;const B=new Set,N=new Map,O=new Map,U=(e=B)=>{const t=Array.from(e).filter((e=>e.isConnected&&e.checkForAnyFrame()&&!e.ignoreSettingDimensions));if(!t.length)return!1;const i=t.map((e=>{const t=[...e.playersSynced.values()].reduce(((e,t)=>e+ +!!t.paused),0);if(e.playersSynced.size===t)return;const i=e.getOffsets();return i.size?[e,i]:void 0})).filter(Boolean);for(const[e]of i)e.clearCanvas();for(const[e,t]of i)e.render(t);return!0},H=()=>{R||(R=window.setInterval(U,16.666666666666668),U())},z=()=>{R&&(clearInterval(R),R=void 0)};function j(e,t={}){var i,u,m,g,v,b,y,w;const S=document.createDocumentFragment();if(!e)return S;const C=null!==(i=t.nasty)&&void 0!==i?i:t.nasty={i:0,usedLength:0,text:e},L=(e,i)=>{const s=document.createElement("span");return t.wrappingDraft&&(s.contentEditable="false"),s.classList.add("input-something"),s.append(e),(D||S).append(s),e.classList.add("input-selectable"),!i&&e.append(G(!0)),E.add(s),s};t.isSelectable||(t.isSelectable=t.wrappingDraft);const I=null!==(u=t.customEmojis)&&void 0!==u?u:t.customEmojis=new Map,E=null!==(m=t.customWraps)&&void 0!==m?m:t.customWraps=new Set,P=null!==(g=t.entities)&&void 0!==g?g:t.entities=(0,l.Z)(C.text),Z=null!==(v=t.passEntities)&&void 0!==v?v:t.passEntities={},M=null!==(b=t.contextSite)&&void 0!==b?b:t.contextSite="Telegram",T="Telegram"!==M,x=C.text.length,A=P.length;let D;for(;C.i=x){if("messageEntityCaret"!==e._)continue}else e.offset+e.length>x&&(e=(0,o.Z)(e),e.length=x-e.offset);e.length&&(C.lastEntity=e);let i=P[C.i+1];const l=e.offset,u=l+e.length,m=Math.min(u,null!==(y=null==i?void 0:i.offset)&&void 0!==y?y:65535),g=C.text.slice(l,u);let v=C.text.slice(l,m);C.usedLengtht.maxMediaTimestamp)break;b=document.createElement("a"),b.classList.add("timestamp"),b.dataset.timestamp=""+e.time,b.href="#",b.setAttribute("onclick","setMediaTimestamp(this)"),t.maxMediaTimestamp===1/0&&b.classList.add("is-disabled")}for(!E&&v&&(b?b[w]=v:(b||S).append(v)),b&&!b.parentNode&&(D||S).append(b);i&&i.offsetv.length&&b?b:S,t.voodoo)return S}var R;if(C.lastEntity&&(C.usedLength=C.lastEntity.offset+C.lastEntity.length),C.usedLength{const t=document.createElement("span");return t.classList.add(e?"input-filler2":"input-filler"),t.textContent=M.Z,t};function V(e){var t;if((null==e?void 0:e.textContent)!==M.Z||"false"===(null===(t=null==e?void 0:e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable"))){if(!e||e.textContent!==M.Z||e.firstElementChild)return 2;if(e.nodeType===e.ELEMENT_NODE)return 1}return 0}function K(e){const t=(e,t,i)=>{const s=V(t);2===s?e[i](G()):1===s&&t.appendChild(document.createTextNode(M.Z))};for(const i of e){const{previousSibling:e,nextSibling:s}=i;t(i,e,"before"),t(i,s,"after")}}window.wrapRichText=j},4497:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(3591);function n(e){const{url:t,onclick:i}=(0,s.Z)(e),n=document.createElement("a");return n.href=t,i&&n.setAttribute("onclick",`${i}(this)`),n}},1447:(e,t,i)=>{"use strict";i.d(t,{Z:()=>v});var s=i(5814),n=i(410),a=i(5418),o=i(5003),r=i(3772),d=i(7328),l=i(3241);class c extends l.Z{constructor(e){super(),this.worker=e,this.worker.onerror=e=>{try{this.dispatchEvent("workerError",e),this.cleanup(),this.terminate()}catch(e){}},this.worker.onmessage=e=>{this.dispatchEvent(e.data.queryMethodListener,...e.data.queryMethodArguments)}}postMessage(e){this.worker.postMessage(e)}terminate(){this.worker.terminate()}sendQuery(e,t){this.worker.postMessage({queryMethod:e.shift(),queryMethodArguments:e},d.Z?t:void 0)}}var h=i(8975),u=i(3855);const p="undefined"!=typeof WebAssembly;var f=i(5471),m=i(4159);const g=new class{constructor(){this.loadPromise=p?void 0:Promise.reject(),this.loaded=!1,this.workersLimit=m.Z.threads,this.players={},this.playersByCacheName={},this.workers=[],this.curWorkerNum=0,this.log=(0,o.kg)("LOTTIE",o.v9.Error),this.onPlayerLoaded=(e,t,i)=>{const s=this.players[e];s?(this.log.debug("onPlayerLoaded"),s.onLoad(t,i)):this.log.warn("onPlayerLoaded on destroyed player:",e,t)},this.onFrame=(e,t,i)=>{const s=this.players[e];s?(void 0!==s.clamped&&i instanceof Uint8ClampedArray&&(s.clamped=i),s.renderFrame(i,t)):this.log.warn("onFrame on destroyed player:",e,t)},this.onPlayerError=(e,t)=>{const i=this.players[e];i&&s.Z.getAnimations(i.el[0]).forEach((e=>{s.Z.removeAnimation(e)}))}}getAnimation(e){for(const t in this.players)if(this.players[t].el.includes(e))return this.players[t];return null}loadLottieWorkers(){return this.loadPromise?this.loadPromise:this.loadPromise=new Promise(((e,t)=>{let s=this.workersLimit;for(let n=0;n{this.log("worker #"+n+" ready"),o.addEventListener("frame",this.onFrame),o.addEventListener("loaded",this.onPlayerLoaded),o.addEventListener("error",this.onPlayerError),--s,s||(this.log("workers ready"),e(),this.loaded=!0)}),{once:!0}),o.addEventListener("workerError",(e=>{t("rlottie load error: "+e.message),this.loaded=!1}),{once:!0})}}))}makeAssetUrl(e){return"assets/tgs/"+e+".json"}loadAnimationAsAsset(e,t){return this.loadAnimationFromURL(e,this.makeAssetUrl(t))}loadAnimationDataFromURL(e){return p?(this.loadLottieWorkers(),fetch(e).then((e=>e.headers&&"application/octet-stream"!==e.headers.get("content-type")?e.blob():e.arrayBuffer().then((e=>u.Z.invokeCrypto("gzipUncompress",e))).then((e=>(0,h.Z)(e,"")))))):this.loadPromise}loadAnimationFromURLManually(e){const t=this.makeAssetUrl(e);return this.loadAnimationDataFromURL(t).then((e=>i=>this.loadAnimationFromURLNext(e,i,t)))}loadAnimationFromURL(e,t){return this.loadAnimationDataFromURL(t).then((i=>this.loadAnimationFromURLNext(i,e,t)))}loadAnimationFromURLNext(e,t,i){const s=Object.assign(t,{animationData:e,needUpscale:!0});return s.name||(s.name=i),this.loadAnimationWorker(s)}waitForFirstFrame(e){return Promise.race([new Promise((t=>{e.addEventListener("firstFrame",t,{once:!0})})),(0,a.Z)(2500)]).then((()=>e))}loadAnimationWorker(e){return t=this,i=void 0,a=function*(){if(!p)return this.loadPromise;this.loaded||(yield this.loadLottieWorkers());const{middleware:t,group:i=""}=e;if(t&&!t())throw(0,f.Z)("MIDDLEWARE");if(e.sync){const t=r.Z.CACHE.generateName(e.name,e.width,e.height,e.color,e.toneIndex),i=this.playersByCacheName[t];if(null==i?void 0:i.size)return Promise.resolve(i.entries().next().value[0])}const n=Array.isArray(e.container)?e.container:[e.container];if(e.width&&e.height||(e.width=parseInt(n[0].style.width),e.height=parseInt(n[0].style.height)),!e.width||!e.height)throw new Error("No size for sticker!");e.group=i;const a=this.initPlayer(n,e);return s.Z.addAnimation({animation:a,group:i,controlled:t,liteModeKey:e.liteModeKey}),a},new((n=void 0)||(n=Promise))((function(e,s){function o(e){try{d(a.next(e))}catch(e){s(e)}}function r(e){try{d(a.throw(e))}catch(e){s(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(t,i||[])).next())}));var t,i,n,a}onDestroy(e){delete this.players[e]}destroyWorkers(){p&&(this.workers.forEach(((e,t)=>{e.terminate(),this.log("worker #"+t+" terminated")})),this.log("workers destroyed"),this.workers.length=0,this.curWorkerNum=0,this.loaded=!1,this.loadPromise=void 0)}initPlayer(e,t){var i,s;const n=new r.Z({el:e,worker:this.workers[this.curWorkerNum++],options:t}),{reqId:a,cacheName:o}=n;this.players[a]=n;const d=o?null!==(i=(s=this.playersByCacheName)[o])&&void 0!==i?i:s[o]=new Set:void 0;return o&&d.add(n),this.curWorkerNum>=this.workers.length&&(this.curWorkerNum=0),n.addEventListener("destroy",(()=>{this.onDestroy(a),d.delete(n)&&!d.size&&delete this.playersByCacheName[o]})),n.loadFromData(t.animationData),n}};n.GO.lottieLoader=g;const v=g},3772:(e,t,i)=>{"use strict";i.d(t,{Z:()=>u,a:()=>h});var s=i(7328),n=i(8189),a=i(4762),o=i(3241),r=i(4755),d=i(3228),l=i(356),c=i(645);function h(e,t,i){let s=(0,d.Z)(window.devicePixelRatio,1,2);return s>1&&!i&&(e>90&&t>90?!a.IS_APPLE&&r.Z.isMobile&&(s=1):(e>60&&t>60||a.IS_ANDROID)&&(s=Math.max(1.5,s-1.5))),s}class u extends o.Z{constructor({el:e,worker:t,options:i}){super(!0),this.reqId=0,this.width=0,this.height=0,this.paused=!0,this.direction=1,this.speed=1,this.autoplay=!0,this.loop=!0,this.group="",this.cachingDelta=0,this.playedTimes=0,this.reqId=++u.reqId,this.el=e,this.worker=t;for(const e in i)this.hasOwnProperty(e)&&(this[e]=i[e]);let o;this._loop=this.loop,this._autoplay=this.autoplay,this.initFrame=i.initFrame,this.color=i.color,this.inverseColor=i.inverseColor,this.name=i.name,this.skipFirstFrameRendering=i.skipFirstFrameRendering,this.toneIndex=i.toneIndex,this.raw=void 0!==this.color,this.liteModeKey=i.liteModeKey,this.name&&(this.cacheName=u.CACHE.generateName(this.name,this.width,this.height,this.color,this.toneIndex)),void 0!==i.skipRatio?o=i.skipRatio:(a.IS_ANDROID||a.IS_APPLE_MOBILE||a.IS_APPLE&&!a.IS_SAFARI&&!n.Z)&&this.width<100&&this.height<100&&!i.needUpscale&&(o=.5),this.skipDelta=void 0!==o?1/o|0:1;const r=h(this.width,this.height,i.needUpscale);this.width=Math.round(this.width*r),this.height=Math.round(this.height*r),i.noCache||(a.IS_APPLE&&this.width>100&&this.height>100?this.cachingDelta=2:this.width<100&&this.height<100?this.cachingDelta=1/0:this.cachingDelta=4),this.canvas||(this.canvas=this.el.map((()=>{const e=document.createElement("canvas");return e.classList.add("rlottie"),e.width=this.width,e.height=this.height,e.dpr=r,e}))),this.contexts=this.canvas.map((e=>e.getContext("2d"))),l.Z&&!this.raw||(this.imageData=new ImageData(this.width,this.height),s.Z&&(this.clamped=new Uint8ClampedArray(this.width*this.height*4))),this.name?this.cache=u.CACHE.getCache(this.cacheName):this.cache=c.M.createCache()}clearCache(){this.cachingDelta!==1/0&&(this.cacheName&&this.cache.counter>1||this.cache.clearCache())}sendQuery(e,t){this.worker.sendQuery([e.shift(),this.reqId,...e],t)}loadFromData(e){this.sendQuery(["loadFromData",e,this.width,this.height,this.toneIndex,void 0!==this.color])}play(){this.paused&&(this.paused=!1,this.setMainLoop())}pause(e=!0){this.paused||(this.paused=!0,e&&(clearTimeout(this.rafId),this.rafId=void 0))}resetCurrentFrame(){var e;return this.curFrame=null!==(e=this.initFrame)&&void 0!==e?e:1===this.direction?this.minFrame:this.maxFrame}stop(e=!0){this.pause();const t=this.resetCurrentFrame();e&&this.requestFrame(t)}restart(){this.stop(!1),this.play()}playOrRestart(){this.paused&&(this.curFrame===this.maxFrame?this.restart():this.play())}setSpeed(e){this.speed!==e&&(this.speed=e,this.paused||this.setMainLoop())}setDirection(e){this.direction!==e&&(this.direction=e,this.paused||this.setMainLoop())}remove(){this.pause(),this.sendQuery(["destroy"]),this.cacheName&&u.CACHE.releaseCache(this.cacheName),this.dispatchEvent("destroy"),this.cleanup()}applyColor(e){const[t,i,s]=this.color;for(let n=0,a=e.length;n{let n=this.cache.framesNew.get(t);if(e instanceof Uint8ClampedArray?s>0&&(n=this.canvas[0]):n=e,!n){const e=document.createElement("canvas");e.width=i.canvas.width,e.height=i.canvas.height,e.getContext("2d").putImageData(this.imageData,0,0),this.cache.framesNew.set(t,e),n=e}this.overrideRender&&this.renderedFirstFrame?this.overrideRender(n||this.imageData):n?(i.clearRect(0,0,n.width,n.height),i.drawImage(n,0,0)):i.putImageData(this.imageData,0,0),this.renderedFirstFrame||(this.renderedFirstFrame=!0)})),this.dispatchEvent("enterFrame",t)}catch(e){console.error("RLottiePlayer renderFrame error:",e,this.width,this.height),this.autoplay=!1,this.pause()}}renderFrame(e,t){if(this.cachingDelta&&(t%this.cachingDelta||!t)&&(e instanceof Uint8ClampedArray&&!this.cache.frames.has(t)?this.cache.frames.set(t,new Uint8ClampedArray(e)):l.Z&&e instanceof ImageBitmap&&!this.cache.framesNew.has(t)&&this.cache.framesNew.set(t,e)),this.frInterval){const i=Date.now()-this.frThen;if(i<0){const s=this.frInterval>-i?-i%this.frInterval:this.frInterval;return this.rafId&&clearTimeout(this.rafId),void(this.rafId=window.setTimeout((()=>{this.renderFrame2(e,t)}),s))}}this.renderFrame2(e,t)}requestFrame(e){const t=this.cache.frames.get(e),i=this.cache.framesNew.get(e);i?this.renderFrame(i,e):t?this.renderFrame(t,e):(this.clamped&&!this.clamped.length&&(this.clamped=new Uint8ClampedArray(this.width*this.height*4)),this.sendQuery(["renderFrame",e],this.clamped?[this.clamped.buffer]:void 0))}onLap(){return++this.playedTimes===this.loop&&(this.loop=!1),!!this.loop||(this.pause(!1),!1)}mainLoopForwards(){const{skipDelta:e,maxFrame:t}=this,i=this.curFrame+e>t?this.curFrame=this.loop?this.minFrame:this.maxFrame:this.curFrame+=e;return this.requestFrame(i),!(i+e>t)||this.onLap()}mainLoopBackwards(){const{skipDelta:e,minFrame:t}=this,i=this.curFrame-et?1:-1,callback:s})}playToFrame(e){this.pause();const{frame:t,speed:i,callback:s,direction:n}=e;this.setDirection(void 0===n?this.curFrame>t?-1:1:n),void 0!==i&&this.setSpeed(i);const a=[this.curFrame,t];-1===this.direction&&a.reverse(),this.loop=!1,this.setMinMax(a[0],a[1]),this.playToFrameOnFrameCallback&&this.removeEventListener("enterFrame",this.playToFrameOnFrameCallback),s&&(this.playToFrameOnFrameCallback=e=>{e===t&&(this.removeEventListener("enterFrame",this.playToFrameOnFrameCallback),s())},this.addEventListener("enterFrame",this.playToFrameOnFrameCallback)),this.play()}setColor(e,t){this.color=e,t&&this.paused&&this.renderFrame2(this.imageData.data,this.curFrame)}setInverseColor(e){this.inverseColor=e}setMinMax(e=0,t=this.frameCount-1){this.minFrame=e,this.maxFrame=t}onLoad(e,t){return i=this,s=void 0,a=function*(){this.frameCount=e,this.fps=t,this.setMinMax(),void 0!==this.initFrame&&(this.initFrame=(0,d.Z)(this.initFrame,this.minFrame,this.maxFrame));const i=this.resetCurrentFrame();if(this.fps<60&&1!==this.skipDelta){const e=60/t;this.skipDelta=this.skipDelta/e|0}this.frInterval=1e3/this.fps/this.speed*this.skipDelta,this.frThen=Date.now()-this.frInterval,!this.skipFirstFrameRendering&&this.requestFrame(i),this.dispatchEvent("ready"),this.addEventListener("enterFrame",(()=>{this.dispatchEvent("firstFrame"),this.canvas[0].parentNode||!this.el||this.overrideRender||this.el.forEach(((e,t)=>e.append(this.canvas[t]))),this.frameListener=()=>{if(this.paused||!this.currentMethod)return;const e=Date.now();this.frThen=e+this.frInterval,this.currentMethod()||this.loop||!this.autoplay||(this.autoplay=!1)},this.addEventListener("enterFrame",this.frameListener),"none"===this.group&&this.autoplay&&this.play()}),{once:!0})},new((n=void 0)||(n=Promise))((function(e,t){function o(e){try{d(a.next(e))}catch(e){t(e)}}function r(e){try{d(a.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(i,s||[])).next())}));var i,s,n,a}}u.CACHE=c.Z,u.reqId=0},4874:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var s=i(1447),n=i(6008),a=i(410),o=i(4789),r=i(2648);const d=new class{constructor(){this.pageId=-1,this.pagesDiv=document.getElementById("auth-pages"),this.scrollableDiv=this.pagesDiv.querySelector(".scrollable"),this.selectTab=(0,n.X)(null,this.scrollableDiv.querySelector(".tabs-container"),null,(()=>{var e;(null===(e=this.page)||void 0===e?void 0:e.onShown)&&this.page.onShown()}))}setPage(e){if(e.isAuthPage){this.pagesDiv.style.display="";const t=(0,r.Z)(e.pageEl);if(this.pageId===t)return;this.selectTab(t),-1!==this.pageId&&t>1&&s.Z.loadLottieWorkers(),this.pageId=t,this.scrollableDiv&&(0,o.Z)({container:this.scrollableDiv,element:this.scrollableDiv.firstElementChild,position:"start"})}else this.pagesDiv.style.display="none",e.pageEl.style.display="",this.pageId=-1;this.page=e}};a.GO.pagesManager=d;const l=d;class c{constructor(e,t,i,s,n){this.isAuthPage=t,this.onFirstMount=i,this.onMount=s,this.onShown=n,this.installed=!1,this.pageEl=document.body.querySelector("."+e)}mount(...e){return t=this,i=void 0,n=function*(){if(this.onMount){const t=this.onMount(...e);t instanceof Promise&&(yield t)}if(!this.installed){if(this.onFirstMount)try{const t=this.onFirstMount(...e);t instanceof Promise&&(yield t)}catch(e){console.error("PAGE MOUNT ERROR:",e)}this.installed=!0}l.setPage(this)},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n}}},671:(e,t,i)=>{"use strict";function s(e){return r(o(e)).join("-")}i.d(t,{Ml:()=>c,N0:()=>s,tB:()=>d,w1:()=>r,zu:()=>h});const n=/\uFE0F/g,a=String.fromCharCode(8205),o=e=>e.indexOf(a)<0?e.replace(n,""):e;function r(e){const t=[];let i=0,s=0,n=0;for(;n55296&&i<=56319?s=i:t.push(i.toString(16));return t.length&&2===t[0].length&&(t[0]="00"+t[0]),t}function d(e){const t=e.match(/[\uDFFB-\uDFFF]/);return t?5-(57343-t[0].charCodeAt(0)):0}const l=new Map([["FT","🏴‍☠"]]);function c(e){var t;return null!==(t=l.get(e))&&void 0!==t?t:String.fromCharCode(55356,56741+e.charCodeAt(0),55356,56741+e.charCodeAt(1))}function h(e){return e.split("-").reduce(((e,t)=>e+String.fromCodePoint(parseInt(t,16))),"")}},4329:function(e){"undefined"!=typeof self&&self,e.exports=function(e){var t={};function i(s){if(t[s])return t[s].exports;var n=t[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,s){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(s,n,function(t){return e[t]}.bind(null,n));return s},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){"use strict";(function(t){var i=t.AudioContext||t.webkitAudioContext,s=function(e){if(!s.isRecordingSupported())throw new Error("Recording is not supported in this browser");e||(e={}),this.state="inactive",this.config=Object.assign({bufferLength:4096,encoderApplication:2049,encoderFrameSize:20,encoderPath:"encoderWorker.min.js",encoderSampleRate:48e3,maxFramesPerPage:40,mediaTrackConstraints:!0,monitorGain:0,numberOfChannels:1,recordingGain:1,resampleQuality:3,streamPages:!1,reuseWorker:!1,wavBitDepth:16},e),this.encodedSamplePosition=0};s.isRecordingSupported=function(){return i&&t.navigator&&t.navigator.mediaDevices&&t.navigator.mediaDevices.getUserMedia&&t.WebAssembly},s.prototype.clearStream=function(){this.stream&&(this.stream.getTracks?this.stream.getTracks().forEach((function(e){e.stop()})):this.stream.stop(),delete this.stream),this.audioContext&&this.closeAudioContext&&(this.audioContext.close(),delete this.audioContext)},s.prototype.encodeBuffers=function(e){if("recording"===this.state){for(var t=[],i=0;i{this.encodeBuffers(e.inputBuffer)},this.monitorGainNode=this.audioContext.createGain(),this.setMonitorGain(this.config.monitorGain),this.monitorGainNode.connect(this.audioContext.destination),this.recordingGainNode=this.audioContext.createGain(),this.setRecordingGain(this.config.recordingGain),this.recordingGainNode.connect(this.scriptProcessorNode)},s.prototype.initSourceNode=function(e){return e&&e.context?t.Promise.resolve(e):t.navigator.mediaDevices.getUserMedia({audio:this.config.mediaTrackConstraints}).then((e=>(this.stream=e,this.audioContext.createMediaStreamSource(e))))},s.prototype.loadWorker=function(){this.encoder||(this.encoder=new t.Worker(this.config.encoderPath))},s.prototype.initWorker=function(){var e=(this.config.streamPages?this.streamPage:this.storePage).bind(this);return this.recordedPages=[],this.totalLength=0,this.loadWorker(),new Promise(((t,i)=>{var s=i=>{switch(i.data.message){case"ready":t();break;case"page":this.encodedSamplePosition=i.data.samplePosition,e(i.data.page);break;case"done":this.encoder.removeEventListener("message",s),this.finish()}};this.encoder.addEventListener("message",s),this.encoder.postMessage(Object.assign({command:"init",originalSampleRate:this.audioContext.sampleRate,wavSampleRate:this.audioContext.sampleRate},this.config))}))},s.prototype.pause=function(e){if("recording"===this.state){if(this.state="paused",e&&this.config.streamPages){var t=this.encoder;return new Promise(((e,i)=>{var s=i=>{"flushed"===i.data.message&&(t.removeEventListener("message",s),this.onpause(),e())};t.addEventListener("message",s),t.postMessage({command:"flush"})}))}return this.onpause(),Promise.resolve()}},s.prototype.resume=function(){"paused"===this.state&&(this.state="recording",this.onresume())},s.prototype.setRecordingGain=function(e){this.config.recordingGain=e,this.recordingGainNode&&this.audioContext&&this.recordingGainNode.gain.setTargetAtTime(e,this.audioContext.currentTime,.01)},s.prototype.setMonitorGain=function(e){this.config.monitorGain=e,this.monitorGainNode&&this.audioContext&&this.monitorGainNode.gain.setTargetAtTime(e,this.audioContext.currentTime,.01)},s.prototype.start=function(e){if("inactive"===this.state)return this.initAudioContext(e),this.initAudioGraph(),this.encodedSamplePosition=0,this.initWorker().then((()=>this.initSourceNode(e))).then((e=>{this.sourceNode=e,this.state="recording",this.onstart(),this.encoder.postMessage({command:"getHeaderPages"}),this.sourceNode.connect(this.monitorGainNode),this.sourceNode.connect(this.recordingGainNode)}))},s.prototype.stop=function(){if("inactive"!==this.state){this.state="inactive",this.monitorGainNode.disconnect(),this.scriptProcessorNode.disconnect(),this.recordingGainNode.disconnect(),this.sourceNode.disconnect(),this.clearStream();var e=this.encoder;return new Promise((t=>{var i=s=>{"done"===s.data.message&&(e.removeEventListener("message",i),t())};e.addEventListener("message",i),e.postMessage({command:"done"}),this.config.reuseWorker||e.postMessage({command:"close"})}))}return Promise.resolve()},s.prototype.destroyWorker=function(){"inactive"===this.state&&this.encoder&&(this.encoder.postMessage({command:"close"}),delete this.encoder)},s.prototype.storePage=function(e){this.recordedPages.push(e),this.totalLength+=e.length},s.prototype.streamPage=function(e){this.ondataavailable(e)},s.prototype.finish=function(){if(!this.config.streamPages){var e=new Uint8Array(this.totalLength);this.recordedPages.reduce((function(t,i){return e.set(i,t),t+i.length}),0),this.ondataavailable(e)}this.onstop(),this.config.reuseWorker||delete this.encoder},s.prototype.ondataavailable=function(){},s.prototype.onpause=function(){},s.prototype.onresume=function(){},s.prototype.onstart=function(){},s.prototype.onstop=function(){},e.exports=s}).call(this,i(1))},function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i}])},6802:e=>{var t=.1,i="function"==typeof Float32Array;function s(e,t){return 1-3*t+3*e}function n(e,t){return 3*t-6*e}function a(e){return 3*e}function o(e,t,i){return((s(t,i)*e+n(t,i))*e+a(t))*e}function r(e,t,i){return 3*s(t,i)*e*e+2*n(t,i)*e+a(t)}function d(e){return e}e.exports=function(e,s,n,a){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===s&&n===a)return d;for(var l=i?new Float32Array(11):new Array(11),c=0;c<11;++c)l[c]=o(c*t,e,n);return function(i){return 0===i||1===i?i:o(function(i){for(var s=0,a=1;10!==a&&l[a]<=i;++a)s+=t;--a;var d=s+(i-l[a])/(l[a+1]-l[a])*t,c=r(d,e,n);return c>=.001?function(e,t,i,s){for(var n=0;n<4;++n){var a=r(t,i,s);if(0===a)return t;t-=(o(t,i,s)-e)/a}return t}(i,d,e,n):0===c?d:function(e,t,i,s,n){var a,r,d=0;do{(a=o(r=t+(i-t)/2,s,n)-e)>0?i=r:t=r}while(Math.abs(a)>1e-7&&++d<10);return r}(i,s,s+t,e,n)}(i),s,a)}}}}]); +//# sourceMappingURL=297.30de9795e39435a29676.chunk.js.map \ No newline at end of file diff --git a/public/297.30de9795e39435a29676.chunk.js.map b/public/297.30de9795e39435a29676.chunk.js.map new file mode 100644 index 00000000..b8ab66c2 --- /dev/null +++ b/public/297.30de9795e39435a29676.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"file":"297.30de9795e39435a29676.chunk.js","mappings":"6NAoXA,MAAMA,EAAuB,IA1UtB,MAaLC,cACEC,KAAKC,SAAW,IAAIC,sBAAsBC,IAGxC,IAAI,MAAMC,KAASD,EAAS,CAC1B,MAAME,EAASD,EAAMC,OAErB,IAAI,MAAMC,KAASN,KAAKO,SAAU,CAChC,GAAGP,KAAKQ,yBAAyBF,GAC/B,SAGF,MAAMG,EAAYT,KAAKO,SAASD,GAA6BI,MAAMC,GAAMA,EAAEC,KAAOP,IAClF,GAAII,EAAJ,CAIA,GAAGL,EAAMS,eACPb,KAAKc,QAAQC,IAAIN,GACjBT,KAAKgB,eAAeP,GAAW,OAM1B,CACLT,KAAKc,QAAQG,OAAOR,GACpBT,KAAKgB,eAAeP,GAAW,GAE/B,MAAMS,EAAaT,EAAUA,UAC1BS,aAAsB,KAEvBA,EAAWC,Y,CAQf,K,OAKNnB,KAAKc,QAAU,IAAIM,IAEnBpB,KAAKqB,mBAAqB,IAAID,IAC9BpB,KAAKO,SAAW,CAAC,EACjBP,KAAKsB,SAAW,IAAIC,IACpBvB,KAAKwB,aAAe,CAAC,EACrBxB,KAAKyB,qBAAuB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U,IAANA,GAAiB,IAANA,EACNA,EAEFg4P,EA7BT,SAAmBS,GAKjB,IAJA,IAAIC,EAAgB,EAChBC,EAAgB,EACHC,KAEVD,GAAgCH,EAAaG,IAAkBF,IAAME,EAC1ED,GAAiBlB,IAEjBmB,EAGF,IACIE,EAAYH,GADJD,EAAKD,EAAaG,KAAmBH,EAAaG,EAAgB,GAAKH,EAAaG,IACzDnB,EAEnCsB,EAAeZ,EAASW,EAAWT,EAAKE,GAC5C,OAAIQ,GA/Ee,KAiCvB,SAA+BL,EAAIM,EAASX,EAAKE,GAChD,IAAK,IAAI3sP,EAAI,EAAGA,EAnCO,IAmCkBA,EAAG,CAC1C,IAAIqtP,EAAed,EAASa,EAASX,EAAKE,GAC1C,GAAqB,IAAjBU,EACF,OAAOD,EAGTA,IADef,EAAWe,EAASX,EAAKE,GAAOG,GACzBO,CACxB,CACA,OAAOD,CACR,CAqCaE,CAAqBR,EAAII,EAAWT,EAAKE,GACtB,IAAjBQ,EACFD,EA/Db,SAA0BJ,EAAIS,EAAIC,EAAIf,EAAKE,GACzC,IAAIc,EAAUC,EAAU1tP,EAAI,EAC5B,IAEEytP,EAAWpB,EADXqB,EAAWH,GAAMC,EAAKD,GAAM,EACId,EAAKE,GAAOG,GAC7B,EACbU,EAAKE,EAELH,EAAKG,QAEA5vQ,KAAKsY,IAAIq3P,GA5BQ,QA4B+BztP,EA3B1B,IA4B/B,OAAO0tP,CACT,CAqDaC,CAAgBb,EAAIC,EAAeA,EAAgBlB,EAAiBY,EAAKE,EAEpF,CAOoBiB,CAASv5P,GAAIq4P,EAAKE,EACtC,CACF,C","sources":["webpack://tweb/./src/components/animationIntersector.ts","webpack://tweb/./src/components/appMediaPlaybackController.ts","webpack://tweb/./src/components/appMediaViewer.ts","webpack://tweb/./src/lib/mediaPlayer.ts","webpack://tweb/./src/helpers/number/isBetween.ts","webpack://tweb/./src/components/appMediaViewerBase.ts","webpack://tweb/./src/helpers/fillPropertyValue.ts","webpack://tweb/./src/components/appNavigationController.ts","webpack://tweb/./src/components/appSearch.ts","webpack://tweb/./src/components/appSearchSuper..ts","webpack://tweb/./src/helpers/dom/lockTouchScroll.ts","webpack://tweb/./src/components/appSelectPeers.ts","webpack://tweb/./src/components/audio.ts","webpack://tweb/./src/helpers/avatarListLoader.ts","webpack://tweb/./src/components/appMediaViewerAvatar.ts","webpack://tweb/./src/components/avatar.ts","webpack://tweb/./src/components/avatarEdit.ts","webpack://tweb/./src/components/button.ts","webpack://tweb/./src/components/buttonCorner.ts","webpack://tweb/./src/components/buttonIcon.ts","webpack://tweb/./src/components/buttonMenu.ts","webpack://tweb/./src/components/buttonMenuToggle.ts","webpack://tweb/./src/components/chat/bubbleGroups.ts","webpack://tweb/./src/components/chat/replies.ts","webpack://tweb/./src/components/chat/messageRender.ts","webpack://tweb/./src/helpers/dom/superIntersectionObserver.ts","webpack://tweb/./src/lib/appManagers/utils/messages/isMentionUnread.ts","webpack://tweb/./src/components/wrappers/album.ts","webpack://tweb/./src/lib/appManagers/utils/messages/getMediaDurationFromMessage.ts","webpack://tweb/./src/components/sidebarRight/tabs/pollResults.ts","webpack://tweb/./src/components/poll.ts","webpack://tweb/./src/helpers/string/isRTL.ts","webpack://tweb/./src/components/chat/bubbles.ts","webpack://tweb/./src/helpers/dom/copyFromElement.ts","webpack://tweb/./src/components/wrappers/groupedDocuments.ts","webpack://tweb/./src/components/wrappers/poll.ts","webpack://tweb/./src/components/popups/reportMessagesConfirm.ts","webpack://tweb/./src/components/popups/reportMessages.ts","webpack://tweb/./src/components/popups/sponsored.ts","webpack://tweb/./src/components/popups/reactedList.ts","webpack://tweb/./src/components/chat/reactionsMenu.ts","webpack://tweb/./src/components/chat/contextMenu.ts","webpack://tweb/./src/components/chat/gradientRenderer.ts","webpack://tweb/./src/helpers/easing/easeOutQuad.ts","webpack://tweb/./src/components/popups/createPoll.ts","webpack://tweb/./src/helpers/dom/attachListNavigation.ts","webpack://tweb/./src/components/chat/autocompleteHelper.ts","webpack://tweb/./src/components/chat/stickersHelper.ts","webpack://tweb/./src/components/popups/schedule.ts","webpack://tweb/./src/components/chat/emojiHelper.ts","webpack://tweb/./src/components/chat/autocompletePeerHelper.ts","webpack://tweb/./src/components/chat/commandsHelper.ts","webpack://tweb/./src/components/chat/autocompleteHelperController.ts","webpack://tweb/./src/components/chat/mentionsHelper.ts","webpack://tweb/./src/components/chat/replyKeyboard.ts","webpack://tweb/./src/components/chat/inlineHelper.ts","webpack://tweb/./src/components/chat/botCommands.ts","webpack://tweb/./src/helpers/modifyAckedResult.ts","webpack://tweb/./src/components/chat/sendAs.ts","webpack://tweb/./src/components/chat/input.ts","webpack://tweb/./src/components/wrappers/draft.ts","webpack://tweb/./src/components/chat/reaction.ts","webpack://tweb/./src/components/chat/reactions.ts","webpack://tweb/./src/components/chat/replyContainer.ts","webpack://tweb/./src/components/chat/selection.ts","webpack://tweb/./src/helpers/dom/getSelectedText.ts","webpack://tweb/./src/components/chat/sendContextMenu.ts","webpack://tweb/./src/components/checkboxField.ts","webpack://tweb/./src/components/checkboxFields.ts","webpack://tweb/./src/components/codeInputField.ts","webpack://tweb/./src/components/confirmationPopup.ts","webpack://tweb/./src/components/countryInputField.ts","webpack://tweb/./src/components/divAndCaption.ts","webpack://tweb/./src/components/dotRenderer.ts","webpack://tweb/./src/components/editPeer.ts","webpack://tweb/./src/components/emoticonsDropdown/tabs/gifs.ts","webpack://tweb/./src/components/sidebarRight/tabs/gifs.ts","webpack://tweb/./src/components/sidebarRight/tabs/stickers.ts","webpack://tweb/./src/components/emoticonsDropdown/index.ts","webpack://tweb/./src/components/emoticonsDropdown/tabs/emoji.ts","webpack://tweb/./src/lib/richTextProcessor/wrapSingleEmoji.ts","webpack://tweb/./src/components/lazyLoadQueueRepeat.ts","webpack://tweb/./src/components/emoticonsDropdown/tabs/stickers.ts","webpack://tweb/./src/components/generateDelimiter.ts","webpack://tweb/./src/components/generateFakeIcon.ts","webpack://tweb/./src/components/lazyLoadQueueRepeat2.ts","webpack://tweb/./src/components/gifsMasonry.ts","webpack://tweb/./src/components/horizontalMenu.ts","webpack://tweb/./src/components/inputField.ts","webpack://tweb/./src/helpers/dom/selectElementContents.ts","webpack://tweb/./src/components/inputFieldAnimated.ts","webpack://tweb/./src/components/inputSearch.ts","webpack://tweb/./src/components/lazyLoadQueue.ts","webpack://tweb/./src/components/lazyLoadQueueIntersector.ts","webpack://tweb/./src/components/mediaProgressLine.ts","webpack://tweb/./src/components/middleEllipsis.ts","webpack://tweb/./src/components/monkeys/password.ts","webpack://tweb/./src/components/monkeys/tracking.ts","webpack://tweb/./src/components/passwordInputField.ts","webpack://tweb/./src/components/peerProfileAvatars.ts","webpack://tweb/./src/components/peerProfile.ts","webpack://tweb/./src/components/generateTitleIcons.ts","webpack://tweb/./src/components/generateVerifiedIcon.ts","webpack://tweb/./src/components/generatePremiumIcon.ts","webpack://tweb/./src/components/peerTitle.ts","webpack://tweb/./src/components/popups/avatar.ts","webpack://tweb/./src/lib/cropper.ts","webpack://tweb/./src/components/popups/datePicker.ts","webpack://tweb/./src/components/popups/deleteDialog.ts","webpack://tweb/./src/components/popups/deleteMessages.ts","webpack://tweb/./src/components/popups/forward.ts","webpack://tweb/./src/components/popups/index.ts","webpack://tweb/./src/components/popups/joinChatInvite.ts","webpack://tweb/./src/components/popups/limit.ts","webpack://tweb/./src/components/popups/mute.ts","webpack://tweb/./src/helpers/createPoster.ts","webpack://tweb/./src/helpers/getGifDuration.ts","webpack://tweb/./src/environment/audioMimeTypeSupport.ts","webpack://tweb/./src/components/popups/newMedia.ts","webpack://tweb/./src/helpers/cacheCallback.ts","webpack://tweb/./src/helpers/string/replaceNonNumber.ts","webpack://tweb/./src/helpers/cards/cardBrands.ts","webpack://tweb/./src/helpers/array/createArray.ts","webpack://tweb/./src/helpers/string/buggedNumbers.ts","webpack://tweb/./src/helpers/cards/patternCharacters.ts","webpack://tweb/./src/helpers/cards/cardFormattingPatterns.ts","webpack://tweb/./src/helpers/cards/formatValueByPattern.ts","webpack://tweb/./src/helpers/cards/validateCard.ts","webpack://tweb/./src/components/popups/paymentVerification.ts","webpack://tweb/./src/components/popups/paymentCard.ts","webpack://tweb/./src/helpers/cards/formatInputValueByPattern.ts","webpack://tweb/./src/components/popups/paymentCardConfirmation.ts","webpack://tweb/./src/components/popups/paymentShipping.ts","webpack://tweb/./src/components/popups/paymentShippingMethods.ts","webpack://tweb/./src/components/popups/payment.ts","webpack://tweb/./src/components/popups/peer.ts","webpack://tweb/./src/components/popups/pickUser.ts","webpack://tweb/./src/components/popups/sendNow.ts","webpack://tweb/./src/components/popups/stickers.ts","webpack://tweb/./src/components/popups/unpinMessage.ts","webpack://tweb/./src/components/preloader.ts","webpack://tweb/./src/components/groupedLayout.ts","webpack://tweb/./src/components/prepareAlbum.ts","webpack://tweb/./src/components/putPhoto.ts","webpack://tweb/./src/components/wrappers/getPeerInitials.ts","webpack://tweb/./src/components/putPreloader.ts","webpack://tweb/./src/components/radioField.ts","webpack://tweb/./src/components/radioForm.ts","webpack://tweb/./src/components/rangeSelector.ts","webpack://tweb/./src/components/ripple.ts","webpack://tweb/./src/components/row.ts","webpack://tweb/./src/components/scrollable.ts","webpack://tweb/./src/components/settingSection.ts","webpack://tweb/./src/components/sidebarLeft/tabs/newGroup.ts","webpack://tweb/./src/lib/appManagers/utils/privacy/privacyType.ts","webpack://tweb/./src/lib/appManagers/utils/privacy/getPrivacyRulesDetails.ts","webpack://tweb/./src/components/privacySection.ts","webpack://tweb/./src/components/sidebarLeft/tabs/privacy/phoneNumber.ts","webpack://tweb/./src/components/sidebarLeft/tabs/2fa/passwordSet.ts","webpack://tweb/./src/helpers/dom/canFocus.ts","webpack://tweb/./src/components/sidebarLeft/tabs/2fa/emailConfirmation.ts","webpack://tweb/./src/components/sidebarLeft/tabs/2fa/email.ts","webpack://tweb/./src/components/sidebarLeft/tabs/2fa/hint.ts","webpack://tweb/./src/components/sidebarLeft/tabs/2fa/reEnterPassword.ts","webpack://tweb/./src/components/sidebarLeft/tabs/2fa/enterPassword.ts","webpack://tweb/./src/components/sidebarLeft/tabs/2fa/index.ts","webpack://tweb/./src/components/sidebarLeft/tabs/privacy/lastSeen.ts","webpack://tweb/./src/components/sidebarLeft/tabs/privacy/profilePhoto.ts","webpack://tweb/./src/components/sidebarLeft/tabs/privacy/forwardMessages.ts","webpack://tweb/./src/components/sidebarLeft/tabs/privacy/addToGroups.ts","webpack://tweb/./src/components/sidebarLeft/tabs/privacy/calls.ts","webpack://tweb/./src/components/sidebarLeft/tabs/activeSessions.ts","webpack://tweb/./src/components/sidebarLeft/tabs/blockedUsers.ts","webpack://tweb/./src/helpers/string/convertKeyToInputKey.ts","webpack://tweb/./src/components/sidebarLeft/tabs/privacy/voices.ts","webpack://tweb/./src/components/sidebarLeft/tabs/activeWebSessions.ts","webpack://tweb/./src/components/sidebarLeft/tabs/privacyAndSecurity.ts","webpack://tweb/./src/components/sidebarLeft/tabs/powerSaving.ts","webpack://tweb/./src/components/sidebarLeft/tabs/generalSettings.ts","webpack://tweb/./src/helpers/eachMinute.ts","webpack://tweb/./src/helpers/eachTimeout.ts","webpack://tweb/./src/components/sidebarLeft/tabs/chatFolders.ts","webpack://tweb/./src/components/sidebarLeft/tabs/notifications.ts","webpack://tweb/./src/components/sidebarLeft/tabs/language.ts","webpack://tweb/./src/components/sidebarLeft/tabs/autoDownload/photo.ts","webpack://tweb/./src/components/sidebarLeft/tabs/autoDownload/file.ts","webpack://tweb/./src/components/sidebarLeft/tabs/autoDownload/video.ts","webpack://tweb/./src/components/sidebarLeft/tabs/dataAndStorage.ts","webpack://tweb/./src/components/sidebarLeft/tabs/quickReaction.ts","webpack://tweb/./src/components/sidebarLeft/tabs/stickersAndEmoji.ts","webpack://tweb/./src/components/sidebarLeft/tabs/settings.ts","webpack://tweb/./src/components/sidebarLeft/tabs/newChannel.ts","webpack://tweb/./src/components/popups/createContact.ts","webpack://tweb/./src/components/sidebarLeft/tabs/contacts.ts","webpack://tweb/./src/components/sidebarLeft/tabs/archivedTab.ts","webpack://tweb/./src/components/sidebarLeft/tabs/peopleNearby.ts","webpack://tweb/./src/components/sidebarLeft/index.ts","webpack://tweb/./src/components/sidebarLeft/tabs/addMembers.ts","webpack://tweb/./src/helpers/averageColor.ts","webpack://tweb/./src/helpers/highlightningColor.ts","webpack://tweb/./src/components/colorPicker.ts","webpack://tweb/./src/components/sidebarLeft/tabs/backgroundColor.ts","webpack://tweb/./src/components/sidebarLeft/tabs/background.ts","webpack://tweb/./src/helpers/files/requestFile.ts","webpack://tweb/./src/components/sidebarLeft/tabs/includedChats.ts","webpack://tweb/./src/components/sidebarLeft/tabs/editFolder.ts","webpack://tweb/./src/components/sidebarLeft/tabs/editProfile.ts","webpack://tweb/./src/components/sidebarRight/index.ts","webpack://tweb/./src/components/sidebarRight/tabs/editContact.ts","webpack://tweb/./src/components/sidebarRight/tabs/editTopic.ts","webpack://tweb/./src/components/sidebarRight/tabs/chatType.ts","webpack://tweb/./src/components/sidebarRight/tabs/userPermissions.ts","webpack://tweb/./src/components/sidebarRight/tabs/groupPermissions.ts","webpack://tweb/./src/lib/appManagers/utils/chats/combineParticipantBannedRights.ts","webpack://tweb/./src/components/sidebarRight/tabs/chatReactions.ts","webpack://tweb/./src/components/sidebarRight/tabs/editChat.ts","webpack://tweb/./src/components/sidebarRight/tabs/sharedMedia.ts","webpack://tweb/./src/components/singleTransition.ts","webpack://tweb/./src/components/slider.ts","webpack://tweb/./src/components/sliderTab.ts","webpack://tweb/./src/components/sortedUserList.ts","webpack://tweb/./src/components/stackedAvatars.ts","webpack://tweb/./src/components/stickerViewer.ts","webpack://tweb/./src/components/stickyIntersector.ts","webpack://tweb/./src/components/swipeHandler.ts","webpack://tweb/./src/components/telInputField.ts","webpack://tweb/./src/components/telegramWebView.ts","webpack://tweb/./src/components/toast.ts","webpack://tweb/./src/components/transition.ts","webpack://tweb/./src/lib/richTextProcessor/isUsernameValid.ts","webpack://tweb/./src/components/usernameInputField.ts","webpack://tweb/./src/components/usernamesSection.ts","webpack://tweb/./src/components/visibilityIntersector.ts","webpack://tweb/./src/components/volumeSelector.ts","webpack://tweb/./src/components/wrappers/customEmoji.ts","webpack://tweb/./src/components/wrappers/document.ts","webpack://tweb/./src/components/wrappers/formatUserPhone.ts","webpack://tweb/./src/components/wrappers/getChatMembersString.ts","webpack://tweb/./src/components/wrappers/getPeerTitle.ts","webpack://tweb/./src/components/wrappers/getUserStatusString.ts","webpack://tweb/./src/components/wrappers/mediaSpoiler.ts","webpack://tweb/./src/components/wrappers/messageActionTextNew.ts","webpack://tweb/./src/components/topicAvatar.ts","webpack://tweb/./src/components/wrappers/joinVoiceChatAnchor.ts","webpack://tweb/./src/components/wrappers/messageActionTextNewUnsafe.ts","webpack://tweb/./src/components/wrappers/messageForReply.ts","webpack://tweb/./src/components/wrappers/peerTitle.ts","webpack://tweb/./src/components/wrappers/photo.ts","webpack://tweb/./src/components/wrappers/reply.ts","webpack://tweb/./src/components/wrappers/senderToPeer.ts","webpack://tweb/./src/components/wrappers/sentTime.ts","webpack://tweb/./src/components/wrappers/sticker.ts","webpack://tweb/./src/helpers/bytes/getPathFromBytes.ts","webpack://tweb/./src/helpers/computeLockColor.ts","webpack://tweb/./src/components/wrappers/stickerAnimation.ts","webpack://tweb/./src/components/wrappers/stickerEmoji.ts","webpack://tweb/./src/components/wrappers/stickerSetThumb.ts","webpack://tweb/./src/components/wrappers/stickerToRow.ts","webpack://tweb/./src/components/wrappers/topicNameButton.ts","webpack://tweb/./src/components/wrappers/video.ts","webpack://tweb/./src/components/wrappers/webPageDescription.ts","webpack://tweb/./src/components/wrappers/webPageTitle.ts","webpack://tweb/./src/config/currencies.ts","webpack://tweb/./src/config/emoji.ts","webpack://tweb/./src/config/font.ts","webpack://tweb/./src/environment/imageBitmapSupport.ts","webpack://tweb/./src/helpers/animation.ts","webpack://tweb/./src/helpers/array/accumulate.ts","webpack://tweb/./src/helpers/array/filterAsync.ts","webpack://tweb/./src/helpers/array/findAndSpliceAll.ts","webpack://tweb/./src/helpers/array/partition.ts","webpack://tweb/./src/helpers/audioAssetPlayer.ts","webpack://tweb/./src/helpers/blob/readBlobAsDataURL.ts","webpack://tweb/./src/helpers/heavyQueue.ts","webpack://tweb/./src/helpers/blur.ts","webpack://tweb/./src/helpers/bytes/getPreviewURLFromBytes.ts","webpack://tweb/./src/helpers/bytes/bytesToDataURL.ts","webpack://tweb/./src/helpers/calcImageInBox.ts","webpack://tweb/./src/helpers/canvas/drawCircle.ts","webpack://tweb/./src/helpers/canvas/getTextWidth.ts","webpack://tweb/./src/helpers/canvas/scaleMediaElement.ts","webpack://tweb/./src/helpers/cleanSearchText.ts","webpack://tweb/./src/helpers/clipboard.ts","webpack://tweb/./src/helpers/contextMenuController.ts","webpack://tweb/./src/helpers/date.ts","webpack://tweb/./src/helpers/dom/anchorCopy.ts","webpack://tweb/./src/helpers/dom/attachContextMenuListener.ts","webpack://tweb/./src/helpers/dom/attachGrabListeners.ts","webpack://tweb/./src/helpers/dom/cancelSelection.ts","webpack://tweb/./src/helpers/dom/clickEvent.ts","webpack://tweb/./src/helpers/dom/controlsHover.ts","webpack://tweb/./src/helpers/dom/createContextMenu.ts","webpack://tweb/./src/helpers/dom/createStickersContextMenu.ts","webpack://tweb/./src/helpers/dom/createVideo.ts","webpack://tweb/./src/helpers/dom/customProperties.ts","webpack://tweb/./src/helpers/dom/dispatchEvent.ts","webpack://tweb/./src/helpers/dom/documentFragmentToHTML.ts","webpack://tweb/./src/helpers/dom/findUpAsChild.ts","webpack://tweb/./src/helpers/dom/findUpAttribute.ts","webpack://tweb/./src/helpers/dom/findUpTag.ts","webpack://tweb/./src/helpers/dom/fullScreen.ts","webpack://tweb/./src/helpers/dom/getCaretPosNew.ts","webpack://tweb/./src/helpers/dom/getRichElementValue.ts","webpack://tweb/./src/helpers/dom/getRichValueWithCaret.ts","webpack://tweb/./src/helpers/dom/getViewportSlice.ts","webpack://tweb/./src/helpers/dom/getVisibleRect.ts","webpack://tweb/./src/helpers/dom/handleHorizontalSwipe.ts","webpack://tweb/./src/helpers/dom/handleTabSwipe.ts","webpack://tweb/./src/helpers/dom/hasMarkupInSelection.ts","webpack://tweb/./src/helpers/dom/htmlToDocumentFragment.ts","webpack://tweb/./src/helpers/dom/htmlToSpan.ts","webpack://tweb/./src/helpers/dom/isInDOM.ts","webpack://tweb/./src/helpers/dom/isInputEmpty.ts","webpack://tweb/./src/helpers/dom/isSelectionEmpty.ts","webpack://tweb/./src/helpers/dom/isSendShortcutPressed.ts","webpack://tweb/./src/helpers/dom/isSwipingBackSafari.ts","webpack://tweb/./src/helpers/dom/placeCaretAtEnd.ts","webpack://tweb/./src/helpers/dom/positionElementByIndex.ts","webpack://tweb/./src/helpers/dom/reflowScrollableElement.ts","webpack://tweb/./src/helpers/dom/renderImageFromUrl.ts","webpack://tweb/./src/helpers/dom/renderMediaWithFadeIn.ts","webpack://tweb/./src/helpers/dom/replaceContent.ts","webpack://tweb/./src/helpers/dom/compareNodes.ts","webpack://tweb/./src/helpers/dom/richInputHandler.ts","webpack://tweb/./src/helpers/dom/shake.ts","webpack://tweb/./src/helpers/dom/sortable.ts","webpack://tweb/./src/helpers/dom/toggleDisability.ts","webpack://tweb/./src/helpers/dom/whichChild.ts","webpack://tweb/./src/helpers/dropdownHover.ts","webpack://tweb/./src/helpers/fastSmoothScroll.ts","webpack://tweb/./src/helpers/fileName.ts","webpack://tweb/./src/helpers/filterChatPhotosMessages.ts","webpack://tweb/./src/helpers/formatBytes.ts","webpack://tweb/./src/helpers/formatCallDuration.ts","webpack://tweb/./src/helpers/formatDuration.ts","webpack://tweb/./src/helpers/formatPhoneNumber.ts","webpack://tweb/./src/helpers/framesCache.ts","webpack://tweb/./src/helpers/generatePathData.ts","webpack://tweb/./src/helpers/getImageFromStrippedThumb.ts","webpack://tweb/./src/helpers/getPreviewURLFromThumb.ts","webpack://tweb/./src/helpers/getStrippedThumbIfNeeded.ts","webpack://tweb/./src/helpers/listLoader.ts","webpack://tweb/./src/helpers/listenerSetter.ts","webpack://tweb/./src/helpers/liteMode.ts","webpack://tweb/./src/helpers/mediaSize.ts","webpack://tweb/./src/helpers/mediaSizes.ts","webpack://tweb/./src/helpers/middlewarePromise.ts","webpack://tweb/./src/helpers/number/formatNumber.ts","webpack://tweb/./src/helpers/number/numberThousandSplitter.ts","webpack://tweb/./src/helpers/onMediaLoad.ts","webpack://tweb/./src/helpers/overlayClickHandler.ts","webpack://tweb/./src/helpers/paymentsWrapCurrencyAmount.ts","webpack://tweb/./src/helpers/positionMenu.ts","webpack://tweb/./src/helpers/preloadAnimatedEmojiSticker.ts","webpack://tweb/./src/helpers/restrictions.ts","webpack://tweb/./src/helpers/saveLottiePreview.ts","webpack://tweb/./src/helpers/schedulers/throttleWithRaf.ts","webpack://tweb/./src/helpers/schedulers/throttleWith.ts","webpack://tweb/./src/helpers/scrollSaver.ts","webpack://tweb/./src/helpers/scrollableLoader.ts","webpack://tweb/./src/helpers/searchListLoader.ts","webpack://tweb/./src/lib/appManagers/utils/messageId/incrementMessageId.ts","webpack://tweb/./src/helpers/sequentialDom.ts","webpack://tweb/./src/helpers/setAttachmentSize.ts","webpack://tweb/./src/helpers/sortedList.ts","webpack://tweb/./src/helpers/string/bom.ts","webpack://tweb/./src/helpers/string/encodeEntities.ts","webpack://tweb/./src/helpers/string/escapeRegExp.ts","webpack://tweb/./src/helpers/string/limitSymbols.ts","webpack://tweb/./src/helpers/string/nbsp.ts","webpack://tweb/./src/helpers/string/toHHMMSS.ts","webpack://tweb/./src/helpers/textToSvgURL.ts","webpack://tweb/./src/helpers/windowSize.ts","webpack://tweb/./src/hooks/useHeavyAnimationCheck.ts","webpack://tweb/./src/components/dialogsContextMenu.ts","webpack://tweb/./src/components/connectionStatus.ts","webpack://tweb/./src/components/sendingStatus.ts","webpack://tweb/./src/helpers/easing/easeInOutSine.ts","webpack://tweb/./src/helpers/canvas/roundRect.ts","webpack://tweb/./src/components/groupCallActiveIcon.ts","webpack://tweb/./src/helpers/canvas/shimmer.ts","webpack://tweb/./src/helpers/dialogsPlaceholder.ts","webpack://tweb/./src/lib/appManagers/appDialogsManager.ts","webpack://tweb/./src/helpers/number/getUnsafeRandomInt.ts","webpack://tweb/./src/lib/appManagers/appDownloadManager.ts","webpack://tweb/./src/helpers/dom/createDownloadAnchor.ts","webpack://tweb/./src/components/chat/pinnedContainer.ts","webpack://tweb/./src/components/chat/audio.ts","webpack://tweb/./src/components/chat/pinnedMessageBorder.ts","webpack://tweb/./src/components/chat/pinnedMessage.ts","webpack://tweb/./src/helpers/dom/handleScrollSideEvent.ts","webpack://tweb/./src/components/chat/topbar.ts","webpack://tweb/./src/components/sidebarRight/tabs/search.ts","webpack://tweb/./src/components/chat/search.ts","webpack://tweb/./src/components/chat/patternRenderer.ts","webpack://tweb/./src/components/chat/chat.ts","webpack://tweb/./src/helpers/autoDownload.ts","webpack://tweb/./src/components/chat/markupTooltip.ts","webpack://tweb/./src/components/chat/dragAndDrop.ts","webpack://tweb/./src/helpers/dom/disableTransition.ts","webpack://tweb/./src/components/lineBlobDrawable.ts","webpack://tweb/./src/components/topbarWeave.ts","webpack://tweb/./src/lib/rlottie/rlottieIcon.ts","webpack://tweb/./src/components/superIcon.ts","webpack://tweb/./src/components/groupCall/microphoneIcon.ts","webpack://tweb/./src/components/groupCall/participantMutedIcon.ts","webpack://tweb/./src/components/groupCall/index.ts","webpack://tweb/./src/components/groupCall/participantStatus.ts","webpack://tweb/./src/components/groupCall/participantsList.ts","webpack://tweb/./src/components/call/videoCanvasBlur.ts","webpack://tweb/./src/components/groupCall/participantVideo.ts","webpack://tweb/./src/components/groupCall/participantVideos.ts","webpack://tweb/./src/components/groupCall/participants.ts","webpack://tweb/./src/components/groupCall/description.ts","webpack://tweb/./src/components/groupCall/title.ts","webpack://tweb/./src/components/call/button.ts","webpack://tweb/./src/components/movableElement.ts","webpack://tweb/./src/helpers/movablePanel.ts","webpack://tweb/./src/helpers/toggleClassName.ts","webpack://tweb/./src/components/call/description.ts","webpack://tweb/./src/components/groupCall/microphoneIconMini.ts","webpack://tweb/./src/components/call/index.ts","webpack://tweb/./src/components/topbarCall.ts","webpack://tweb/./src/lib/appManagers/uiNotificationsManager.ts","webpack://tweb/./src/config/notifications.ts","webpack://tweb/./src/helpers/files/getFilesFromEvent.ts","webpack://tweb/./src/helpers/addAnchorListener.ts","webpack://tweb/./src/components/popups/giftPremium.ts","webpack://tweb/./src/lib/appManagers/appImManager.ts","webpack://tweb/./src/lib/appManagers/internalLink.ts","webpack://tweb/./src/lib/appManagers/utils/messages/canSaveMessageMedia.ts","webpack://tweb/./src/lib/appManagers/utils/messages/getMediaFromMessage.ts","webpack://tweb/./src/lib/appManagers/utils/messages/getMessageSenderPeerIdOrName.ts","webpack://tweb/./src/lib/appManagers/utils/messages/isMessageRestricted.ts","webpack://tweb/./src/lib/appManagers/utils/peers/getPeerColorById.ts","webpack://tweb/./src/lib/appManagers/utils/peers/getPeerEditableUsername.ts","webpack://tweb/./src/lib/appManagers/utils/peers/getPeerId.ts","webpack://tweb/./src/lib/appManagers/utils/photos/choosePhotoSize.ts","webpack://tweb/./src/lib/calls/callConnectionInstanceBase.ts","webpack://tweb/./src/lib/calls/helpers/createPeerConnection.ts","webpack://tweb/./src/lib/calls/helpers/createDataChannel.ts","webpack://tweb/./src/lib/calls/helpers/parseSignalingData.ts","webpack://tweb/./src/lib/calls/callConnectionInstance.ts","webpack://tweb/./src/lib/crypto/subtle.ts","webpack://tweb/./src/lib/calls/p2P/p2PEncryptor.ts","webpack://tweb/./src/lib/crypto/utils/sha256.ts","webpack://tweb/./src/lib/calls/p2P/chromeP2PSdpBuilder.ts","webpack://tweb/./src/lib/calls/p2P/p2PSdpBuilder.js","webpack://tweb/./src/lib/calls/p2P/firefoxP2PSdpBuilder.js","webpack://tweb/./src/lib/calls/p2P/safariP2PSdpBuilder.js","webpack://tweb/./src/lib/calls/callInstance.ts","webpack://tweb/./src/lib/calls/p2P/getCallProtocol.ts","webpack://tweb/./src/lib/calls/p2P/getRtcConfiguration.ts","webpack://tweb/./src/lib/calls/helpers/getStreamCached.ts","webpack://tweb/./src/lib/calls/callInstanceBase.ts","webpack://tweb/./src/lib/calls/callState.ts","webpack://tweb/./src/components/call/getAudioAsset.ts","webpack://tweb/./src/lib/calls/callsController.ts","webpack://tweb/./src/lib/calls/constants.ts","webpack://tweb/./src/lib/calls/groupCallConnectionInstance.ts","webpack://tweb/./src/lib/calls/helpers/processMediaSection.ts","webpack://tweb/./src/lib/calls/helpers/filterServerCodecs.ts","webpack://tweb/./src/lib/calls/helpers/fixLocalOffer.ts","webpack://tweb/./src/lib/calls/groupCallInstance.ts","webpack://tweb/./src/lib/calls/groupCallState.ts","webpack://tweb/./src/components/groupCall/getAudioAsset.ts","webpack://tweb/./src/lib/calls/groupCallsController.ts","webpack://tweb/./src/lib/calls/helpers/createMainStreamManager.ts","webpack://tweb/./src/lib/calls/helpers/getAudioConstraints.ts","webpack://tweb/./src/environment/constraintSupport.ts","webpack://tweb/./src/lib/calls/helpers/getScreenConstraints.ts","webpack://tweb/./src/lib/calls/helpers/getScreenStream.ts","webpack://tweb/./src/lib/calls/helpers/getStream.ts","webpack://tweb/./src/lib/calls/helpers/getVideoConstraints.ts","webpack://tweb/./src/lib/calls/helpers/parseMediaSectionInfo.ts","webpack://tweb/./src/lib/calls/helpers/parseSourceGroups.ts","webpack://tweb/./src/lib/calls/helpers/stopTrack.ts","webpack://tweb/./src/lib/calls/localConferenceDescription.ts","webpack://tweb/./src/lib/calls/sdp/index.ts","webpack://tweb/./src/helpers/string/splitStringByLimitWithRest.ts","webpack://tweb/./src/helpers/uniqueNumberGenerator.ts","webpack://tweb/./src/lib/calls/sdp/attributeSplitted.ts","webpack://tweb/./src/lib/calls/sdp/mediaLineParts.ts","webpack://tweb/./src/lib/calls/sdp/line.ts","webpack://tweb/./src/lib/calls/sdp/attributeInner.ts","webpack://tweb/./src/lib/calls/sdp/attributes.ts","webpack://tweb/./src/lib/calls/sdp/mediaSection.ts","webpack://tweb/./src/lib/calls/sdp/sessionSection.ts","webpack://tweb/./src/lib/calls/sdp/utils.ts","webpack://tweb/./src/lib/calls/sdpBuilder.ts","webpack://tweb/./src/lib/calls/streamManager.ts","webpack://tweb/./src/lib/calls/stringFromLineBuilder.ts","webpack://tweb/./src/lib/calls/utils.ts","webpack://tweb/./src/lib/mtproto/constants.ts","webpack://tweb/./src/lib/richTextProcessor/getAbbreviation.ts","webpack://tweb/./src/lib/richTextProcessor/getEmojiEntityFromEmoji.ts","webpack://tweb/./src/lib/richTextProcessor/matchEmail.ts","webpack://tweb/./src/lib/richTextProcessor/setBlankToAnchor.ts","webpack://tweb/./src/lib/richTextProcessor/wrapAbbreviation.ts","webpack://tweb/./src/lib/richTextProcessor/wrapDraftText.ts","webpack://tweb/./src/lib/richTextProcessor/wrapEmojiText.ts","webpack://tweb/./src/environment/emojiVersionsSupport.ts","webpack://tweb/./src/lib/richTextProcessor/wrapRichText.ts","webpack://tweb/./src/helpers/buildURLHash.ts","webpack://tweb/./src/lib/richTextProcessor/wrapTelegramUrlToAnchor.ts","webpack://tweb/./src/lib/rlottie/queryableWorker.ts","webpack://tweb/./src/environment/webAssemblySupport.ts","webpack://tweb/./src/lib/rlottie/lottieLoader.ts","webpack://tweb/./src/lib/rlottie/rlottiePlayer.ts","webpack://tweb/./src/pages/pagesManager.ts","webpack://tweb/./src/pages/page.ts","webpack://tweb/./src/vendor/emoji/index.ts","webpack://tweb/./public/recorder.min.js","webpack://tweb/./src/vendor/bezier-easing/index.js"],"sourcesContent":["/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {LiteModeKey} from '../helpers/liteMode';\nimport {CustomEmojiElement, CustomEmojiRendererElement} from '../lib/richTextProcessor/wrapRichText';\nimport rootScope from '../lib/rootScope';\nimport {IS_SAFARI} from '../environment/userAgent';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport isInDOM from '../helpers/dom/isInDOM';\nimport RLottiePlayer from '../lib/rlottie/rlottiePlayer';\nimport indexOfAndSplice from '../helpers/array/indexOfAndSplice';\nimport forEachReverse from '../helpers/array/forEachReverse';\nimport idleController from '../helpers/idleController';\nimport appMediaPlaybackController from './appMediaPlaybackController';\nimport {fastRaf} from '../helpers/schedulers';\nimport {Middleware} from '../helpers/middleware';\n\nexport type AnimationItemGroup = '' | 'none' | 'chat' | 'lock' |\n 'STICKERS-POPUP' | 'emoticons-dropdown' | 'STICKERS-SEARCH' | 'GIFS-SEARCH' |\n `CHAT-MENU-REACTIONS-${number}` | 'INLINE-HELPER' | 'GENERAL-SETTINGS' | 'STICKER-VIEWER' | 'EMOJI' |\n 'EMOJI-STATUS' | `chat-${number}`;\nexport interface AnimationItem {\n el: HTMLElement,\n group: AnimationItemGroup,\n animation: AnimationItemWrapper,\n liteModeKey?: LiteModeKey,\n controlled?: boolean | Middleware\n};\n\nexport interface AnimationItemWrapper {\n remove: () => void;\n paused: boolean;\n pause: () => any;\n play: () => any;\n autoplay: boolean;\n loop: boolean | number;\n // onVisibilityChange?: (visible: boolean) => boolean;\n};\n\nexport class AnimationIntersector {\n private observer: IntersectionObserver;\n private visible: Set;\n\n private overrideIdleGroups: Set;\n private byGroups: {[group in AnimationItemGroup]?: AnimationItem[]};\n private byPlayer: Map;\n private lockedGroups: {[group in AnimationItemGroup]?: true};\n private onlyOnePlayableGroup: AnimationItemGroup;\n\n private intersectionLockedGroups: {[group in AnimationItemGroup]?: true};\n private videosLocked: boolean;\n\n constructor() {\n this.observer = new IntersectionObserver((entries) => {\n // if(rootScope.idle.isIDLE) return;\n\n for(const entry of entries) {\n const target = entry.target;\n\n for(const group in this.byGroups) {\n if(this.intersectionLockedGroups[group as AnimationItemGroup]) {\n continue;\n }\n\n const animation = this.byGroups[group as AnimationItemGroup].find((p) => p.el === target);\n if(!animation) {\n continue;\n }\n\n if(entry.isIntersecting) {\n this.visible.add(animation);\n this.checkAnimation(animation, false);\n\n /* if(animation instanceof HTMLVideoElement && animation.dataset.src) {\n animation.src = animation.dataset.src;\n animation.load();\n } */\n } else {\n this.visible.delete(animation);\n this.checkAnimation(animation, true);\n\n const _animation = animation.animation;\n if(_animation instanceof RLottiePlayer/* && animation.cachingDelta === 2 */) {\n // console.warn('will clear cache', player);\n _animation.clearCache();\n }/* else if(animation instanceof HTMLVideoElement && animation.src) {\n animation.dataset.src = animation.src;\n animation.src = '';\n animation.load();\n } */\n }\n\n break;\n }\n }\n });\n\n this.visible = new Set();\n\n this.overrideIdleGroups = new Set();\n this.byGroups = {};\n this.byPlayer = new Map();\n this.lockedGroups = {};\n this.onlyOnePlayableGroup = '';\n\n this.intersectionLockedGroups = {};\n this.videosLocked = false;\n\n appMediaPlaybackController.addEventListener('play', ({doc}) => {\n if(doc.type === 'round') {\n this.videosLocked = true;\n this.checkAnimations2();\n }\n });\n\n appMediaPlaybackController.addEventListener('pause', () => {\n if(this.videosLocked) {\n this.videosLocked = false;\n this.checkAnimations2();\n }\n });\n\n idleController.addEventListener('change', (idle) => {\n this.checkAnimations2(idle);\n });\n }\n\n public setOverrideIdleGroup(group: string, override: boolean) {\n if(override) this.overrideIdleGroups.add(group);\n else this.overrideIdleGroups.delete(group);\n }\n\n public getAnimations(element: HTMLElement) {\n const found: AnimationItem[] = [];\n for(const group in this.byGroups) {\n for(const player of this.byGroups[group as AnimationItemGroup]) {\n if(player.el === element) {\n found.push(player);\n }\n }\n }\n\n return found;\n }\n\n public removeAnimation(player: AnimationItem) {\n const {el, animation} = player;\n if(!(animation instanceof HTMLVideoElement)) {\n animation.remove();\n }\n\n if(animation instanceof HTMLVideoElement && IS_SAFARI) {\n setTimeout(() => { // TODO: очистка по очереди, а не все вместе с этим таймаутом\n animation.src = '';\n animation.load();\n }, 1e3);\n }\n\n const group = this.byGroups[player.group];\n if(group) {\n indexOfAndSplice(group, player);\n if(!group.length) {\n delete this.byGroups[player.group];\n }\n }\n\n this.observer.unobserve(el);\n this.visible.delete(player);\n this.byPlayer.delete(animation);\n }\n\n public removeAnimationByPlayer(player: AnimationItemWrapper) {\n const item = this.byPlayer.get(player);\n if(item) {\n this.removeAnimation(item);\n }\n }\n\n public addAnimation(options: {\n animation: AnimationItem['animation'],\n group?: AnimationItemGroup,\n observeElement?: HTMLElement,\n controlled?: AnimationItem['controlled'],\n liteModeKey?: LiteModeKey\n }) {\n let {animation, group = '', observeElement, controlled, liteModeKey} = options;\n if(group === 'none' || this.byPlayer.has(animation)) {\n return;\n }\n\n if(!observeElement) {\n if(animation instanceof RLottiePlayer) {\n observeElement = animation.el[0];\n } else if(animation instanceof CustomEmojiRendererElement) {\n observeElement = animation.canvas;\n } else if(animation instanceof CustomEmojiElement) {\n observeElement = animation.placeholder ?? animation;\n } else if(animation instanceof HTMLElement) {\n observeElement = animation;\n }\n }\n\n const item: AnimationItem = {\n el: observeElement,\n animation: animation,\n group,\n controlled,\n liteModeKey\n };\n\n if(controlled && typeof(controlled) !== 'boolean') {\n controlled.onClean(() => {\n this.removeAnimationByPlayer(animation);\n });\n }\n\n if(animation instanceof RLottiePlayer) {\n if(!rootScope.settings.stickers.loop && animation.loop) {\n animation.loop = rootScope.settings.stickers.loop;\n }\n }\n\n (this.byGroups[group as AnimationItemGroup] ??= []).push(item);\n this.observer.observe(item.el);\n this.byPlayer.set(animation, item);\n }\n\n public checkAnimations(\n blurred?: boolean,\n group?: AnimationItemGroup,\n destroy?: boolean,\n imitateIntersection?: boolean\n ) {\n // if(rootScope.idle.isIDLE) return;\n\n if(group !== undefined && !this.byGroups[group]) {\n // console.warn('no animation group:', group);\n return;\n }\n\n const groups = group !== undefined /* && false */ ? [group] : Object.keys(this.byGroups) as AnimationItemGroup[];\n\n for(const group of groups) {\n if(imitateIntersection && this.intersectionLockedGroups[group]) {\n continue;\n }\n\n const animations = this.byGroups[group];\n\n forEachReverse(animations, (animation) => {\n this.checkAnimation(animation, blurred, destroy);\n });\n }\n }\n\n public checkAnimations2(blurred?: boolean) {\n this.checkAnimations(blurred, undefined, undefined, true);\n }\n\n public checkAnimation(player: AnimationItem, blurred?: boolean, destroy?: boolean) {\n const {el, animation, group} = player;\n // return;\n if(destroy || (!this.lockedGroups[group] && !isInDOM(el))) {\n if(!player.controlled || destroy) {\n this.removeAnimation(player);\n }\n\n return;\n }\n\n if(blurred ||\n (this.onlyOnePlayableGroup && this.onlyOnePlayableGroup !== group) ||\n (animation instanceof HTMLVideoElement && this.videosLocked)\n ) {\n if(!animation.paused) {\n // console.warn('pause animation:', animation);\n animation.pause();\n }\n } else if(animation.paused &&\n this.visible.has(player) &&\n animation.autoplay &&\n (!this.onlyOnePlayableGroup || this.onlyOnePlayableGroup === group) &&\n (!idleController.isIdle || this.overrideIdleGroups.has(player.group))\n ) {\n // console.warn('play animation:', animation);\n animation.play();\n }\n }\n\n public getOnlyOnePlayableGroup() {\n return this.onlyOnePlayableGroup;\n }\n\n public setOnlyOnePlayableGroup(group: AnimationItemGroup = '') {\n this.onlyOnePlayableGroup = group;\n }\n\n public lockGroup(group: AnimationItemGroup) {\n this.lockedGroups[group] = true;\n }\n\n public unlockGroup(group: AnimationItemGroup) {\n delete this.lockedGroups[group];\n this.checkAnimations(undefined, group);\n }\n\n public refreshGroup(group: AnimationItemGroup) {\n const animations = this.byGroups[group];\n if(!animations?.length) {\n return;\n }\n\n animations.forEach((animation) => {\n this.observer.unobserve(animation.el);\n });\n\n fastRaf(() => {\n animations.forEach((animation) => {\n this.observer.observe(animation.el);\n });\n });\n }\n\n public lockIntersectionGroup(group: AnimationItemGroup) {\n this.intersectionLockedGroups[group] = true;\n }\n\n public unlockIntersectionGroup(group: AnimationItemGroup) {\n delete this.intersectionLockedGroups[group];\n this.refreshGroup(group);\n }\n\n public toggleIntersectionGroup(group: AnimationItemGroup, lock: boolean) {\n if(lock) this.lockIntersectionGroup(group);\n else this.unlockIntersectionGroup(group);\n }\n\n public setAutoplay(play: boolean, liteModeKey: LiteModeKey) {\n let changed = false;\n this.byPlayer.forEach((animationItem, animation) => {\n if(animationItem.liteModeKey === liteModeKey) {\n changed = true;\n animation.autoplay = play ? !!+animationItem.el.dataset.stickerPlay : false;\n animation.loop = play ? !!+animationItem.el.dataset.stickerLoop && rootScope.settings.stickers.loop : false;\n }\n });\n\n return changed;\n }\n\n public setLoop(loop: boolean) {\n let changed = false;\n this.byPlayer.forEach((animationItem, animation) => {\n if(!!+animationItem.el.dataset.stickerLoop &&\n animation.loop !== loop &&\n (animation instanceof RLottiePlayer || animation instanceof HTMLVideoElement)) {\n changed = true;\n animation.loop = loop;\n\n // if(animation._autoplay && animation.autoplay !== animation._autoplay) {\n animation.autoplay = !!+animationItem.el.dataset.stickerPlay;\n // }\n }\n });\n\n return changed;\n }\n}\n\nconst animationIntersector = new AnimationIntersector();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.animationIntersector = animationIntersector);\nexport default animationIntersector;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../lib/rootScope';\nimport {MyDocument} from '../lib/appManagers/appDocsManager';\nimport deferredPromise, {CancellablePromise} from '../helpers/cancellablePromise';\nimport {IS_APPLE, IS_SAFARI} from '../environment/userAgent';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport simulateEvent from '../helpers/dom/dispatchEvent';\nimport type {SearchSuperContext} from './appSearchSuper.';\nimport {Document, DocumentAttribute, Message, PhotoSize} from '../layer';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport I18n from '../lib/langPack';\nimport SearchListLoader from '../helpers/searchListLoader';\nimport copy from '../helpers/object/copy';\nimport deepEqual from '../helpers/object/deepEqual';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport getMediaFromMessage from '../lib/appManagers/utils/messages/getMediaFromMessage';\nimport getPeerTitle from './wrappers/getPeerTitle';\nimport appDownloadManager from '../lib/appManagers/appDownloadManager';\nimport onMediaLoad from '../helpers/onMediaLoad';\nimport EventListenerBase from '../helpers/eventListenerBase';\n\n// TODO: Safari: проверить стрим, включить его и сразу попробовать включить видео или другую песню\n// TODO: Safari: попробовать замаскировать подгрузку последнего чанка\n// TODO: Safari: пофиксить момент, когда заканчивается песня и пытаешься включить её заново - прогресс сразу в конце\n\nexport type MediaItem = {mid: number, peerId: PeerId};\n\ntype HTMLMediaElement = HTMLAudioElement | HTMLVideoElement;\n\nconst SHOULD_USE_SAFARI_FIX = (() => {\n try {\n return IS_SAFARI && +navigator.userAgent.match(/ Version\\/(\\d+)/)[1] < 14;\n } catch(err) {\n return false;\n }\n})();\n\nconst SEEK_OFFSET = 10;\n\nexport type MediaSearchContext = SearchSuperContext & Partial<{\n isScheduled: boolean,\n useSearch: boolean\n}>;\n\ntype MediaDetails = {\n peerId: PeerId,\n mid: number,\n docId: DocId,\n doc: MyDocument,\n message: Message.message,\n clean?: boolean,\n isScheduled?: boolean,\n isSingle?: boolean\n};\n\nexport type PlaybackMediaType = 'voice' | 'video' | 'audio';\n\nexport class AppMediaPlaybackController extends EventListenerBase<{\n play: (details: ReturnType) => void,\n pause: () => void,\n playbackParams: (params: ReturnType) => void,\n stop: () => void,\n}> {\n private container: HTMLElement;\n private media: Map> = new Map();\n private scheduled: AppMediaPlaybackController['media'] = new Map();\n private mediaDetails: Map = new Map();\n private playingMedia: HTMLMediaElement;\n private playingMediaType: PlaybackMediaType;\n\n private waitingMediaForLoad: Map>> = new Map();\n private waitingScheduledMediaForLoad: AppMediaPlaybackController['waitingMediaForLoad'] = new Map();\n private waitingDocumentsForLoad: {[docId: string]: Set} = {};\n\n public willBePlayedMedia: HTMLMediaElement;\n private searchContext: MediaSearchContext;\n\n private listLoader: SearchListLoader;\n\n public volume: number;\n public muted: boolean;\n public playbackRate: number;\n public loop: boolean;\n public round: boolean;\n private _volume: number;\n private _muted: boolean;\n private _playbackRate: number;\n private _loop: boolean;\n private _round: boolean;\n private lockedSwitchers: boolean;\n private playbackRates: Record = {\n voice: 1,\n video: 1,\n audio: 1\n };\n\n private pip: HTMLVideoElement;\n private managers: AppManagers;\n private skipMediaPlayEvent: boolean;\n\n construct(managers: AppManagers) {\n this.managers = managers;\n this.container = document.createElement('div');\n // this.container.style.cssText = 'position: absolute; top: -10000px; left: -10000px;';\n this.container.style.cssText = 'display: none;';\n document.body.append(this.container);\n\n if(navigator.mediaSession) {\n const actions: {[action in MediaSessionAction]?: MediaSessionActionHandler} = {\n play: this.browserPlay,\n pause: this.browserPause,\n stop: this.browserStop,\n seekbackward: this.browserSeekBackward,\n seekforward: this.browserSeekForward,\n seekto: this.browserSeekTo,\n previoustrack: this.browserPrevious,\n nexttrack: this.browserNext\n };\n\n for(const action in actions) {\n try {\n navigator.mediaSession.setActionHandler(action as MediaSessionAction, actions[action as MediaSessionAction]);\n } catch(err) {\n console.warn('MediaSession action is not supported:', action);\n }\n }\n }\n\n rootScope.addEventListener('document_downloaded', (docId) => {\n const set = this.waitingDocumentsForLoad[docId];\n if(set) {\n for(const media of set) {\n this.onMediaDocumentLoad(media);\n }\n }\n });\n\n rootScope.addEventListener('media_play', () => {\n if(this.skipMediaPlayEvent) {\n this.skipMediaPlayEvent = false;\n return;\n }\n\n if(!this.pause() && this.pip) {\n this.pip.pause();\n }\n });\n\n const properties: {[key: PropertyKey]: PropertyDescriptor} = {};\n const keys = [\n 'volume' as const,\n 'muted' as const,\n 'playbackRate' as const,\n 'loop' as const,\n 'round' as const\n ];\n keys.forEach((key) => {\n const _key = ('_' + key) as `_${typeof key}`;\n properties[key] = {\n get: () => this[_key],\n set: (value: number | boolean) => {\n if(this[_key] === value) {\n return;\n }\n\n // @ts-ignore\n this[_key] = value;\n if(this.playingMedia && (key !== 'loop' || this.playingMediaType === 'audio') && key !== 'round') {\n // @ts-ignore\n this.playingMedia[key] = value;\n }\n\n if(key === 'playbackRate' && this.playingMediaType !== undefined) {\n this.playbackRates[this.playingMediaType] = value as number;\n }\n\n this.dispatchPlaybackParams();\n }\n };\n });\n Object.defineProperties(this, properties);\n }\n\n private dispatchPlaybackParams() {\n this.dispatchEvent('playbackParams', this.getPlaybackParams());\n }\n\n public getPlaybackParams() {\n const {volume, muted, playbackRate, playbackRates, loop, round} = this;\n return {\n volume,\n muted,\n playbackRate,\n playbackRates,\n loop,\n round\n };\n }\n\n public setPlaybackParams(params: ReturnType) {\n this.playbackRates = params.playbackRates;\n this._volume = params.volume;\n this._muted = params.muted;\n this._playbackRate = params.playbackRate;\n this._loop = params.loop;\n this._round = params.round;\n }\n\n public seekBackward = (details: MediaSessionActionDetails, media = this.playingMedia) => {\n if(media) {\n media.currentTime = Math.max(0, media.currentTime - (details.seekOffset || SEEK_OFFSET));\n }\n };\n\n public seekForward = (details: MediaSessionActionDetails, media = this.playingMedia) => {\n if(media) {\n media.currentTime = Math.min(media.duration, media.currentTime + (details.seekOffset || SEEK_OFFSET));\n }\n };\n\n public seekTo = (details: MediaSessionActionDetails, media = this.playingMedia) => {\n if(media) {\n media.currentTime = details.seekTime;\n }\n };\n\n public addMedia(message: Message.message, autoload: boolean, clean?: boolean): HTMLMediaElement {\n const {peerId, mid} = message;\n\n const isScheduled = !!message.pFlags.is_scheduled;\n const s = isScheduled ? this.scheduled : this.media;\n let storage = s.get(message.peerId);\n if(!storage) {\n s.set(message.peerId, storage = new Map());\n }\n\n let media = storage.get(mid);\n if(media) {\n return media;\n }\n\n const doc = getMediaFromMessage(message, true) as Document.document;\n storage.set(mid, media = document.createElement(doc.type === 'round' || doc.type === 'video' ? 'video' : 'audio'));\n // const source = document.createElement('source');\n // source.type = doc.type === 'voice' && !opusDecodeController.isPlaySupported() ? 'audio/wav' : doc.mime_type;\n\n if(doc.type === 'round') {\n media.setAttribute('playsinline', 'true');\n // media.muted = true;\n }\n\n const details: MediaDetails = {\n peerId,\n mid,\n docId: doc.id,\n doc,\n message,\n clean,\n isScheduled: message.pFlags.is_scheduled\n };\n\n this.mediaDetails.set(media, details);\n\n // media.autoplay = true;\n media.volume = 1;\n // media.append(source);\n\n this.container.append(media);\n\n media.addEventListener('play', this.onPlay);\n media.addEventListener('pause', this.onPause);\n media.addEventListener('ended', this.onEnded);\n\n if(doc.type !== 'audio' && message?.pFlags.media_unread && message.fromId !== rootScope.myId) {\n media.addEventListener('timeupdate', () => {\n this.managers.appMessagesManager.readMessages(peerId, [mid]);\n }, {once: true});\n }\n\n /* const onError = (e: Event) => {\n //console.log('appMediaPlaybackController: video onError', e);\n\n if(this.nextMid === mid) {\n this.loadSiblingsMedia(peerId, doc.type as MediaType, mid).then(() => {\n if(this.nextMid && storage[this.nextMid]) {\n storage[this.nextMid].play();\n }\n });\n }\n };\n\n media.addEventListener('error', onError); */\n\n const deferred = deferredPromise();\n if(autoload) {\n deferred.resolve();\n } else {\n const w = message.pFlags.is_scheduled ? this.waitingScheduledMediaForLoad : this.waitingMediaForLoad;\n let waitingStorage = w.get(peerId);\n if(!waitingStorage) {\n w.set(peerId, waitingStorage = new Map());\n }\n\n waitingStorage.set(mid, deferred);\n }\n\n deferred.then(async() => {\n // media.autoplay = true;\n // console.log('will set media url:', media, doc, doc.type, doc.url);\n\n if(doc.supportsStreaming || (await this.managers.thumbsStorage.getCacheContext(doc)).url) {\n this.onMediaDocumentLoad(media);\n } else {\n let set = this.waitingDocumentsForLoad[doc.id];\n if(!set) {\n set = this.waitingDocumentsForLoad[doc.id] = new Set();\n }\n\n set.add(media);\n appDownloadManager.downloadMediaURL({media: doc});\n }\n }/* , onError */);\n\n return media;\n }\n\n public getMedia(peerId: PeerId, mid: number, isScheduled?: boolean) {\n const s = (isScheduled ? this.scheduled : this.media).get(peerId);\n return s?.get(mid);\n }\n\n private onMediaDocumentLoad = async(media: HTMLMediaElement) => {\n const details = this.mediaDetails.get(media);\n const doc = await this.managers.appDocsManager.getDoc(details.docId);\n if(doc.type === 'audio' && doc.supportsStreaming && SHOULD_USE_SAFARI_FIX) {\n this.handleSafariStreamable(media);\n }\n\n // setTimeout(() => {\n const cacheContext = await this.managers.thumbsStorage.getCacheContext(doc);\n media.src = cacheContext.url;\n\n if(this.playingMedia === media) {\n media.playbackRate = this.playbackRate;\n\n if(doc.type === 'audio') {\n media.loop = this.loop;\n }\n }\n // }, doc.supportsStreaming ? 500e3 : 0);\n\n const set = this.waitingDocumentsForLoad[doc.id];\n if(set) {\n set.delete(media);\n\n if(!set.size) {\n delete this.waitingDocumentsForLoad[doc.id];\n }\n }\n };\n\n // safari подгрузит последний чанк и песня включится,\n // при этом этот чанк нельзя руками отдать из SW, потому что браузер тогда теряется\n private handleSafariStreamable(media: HTMLMediaElement) {\n media.addEventListener('play', () => {\n /* if(media.readyState === 4) { // https://developer.mozilla.org/ru/docs/Web/API/XMLHttpRequest/readyState\n return;\n } */\n\n // media.volume = 0;\n const currentTime = media.currentTime;\n // this.setSafariBuffering(media, true);\n\n media.addEventListener('progress', () => {\n media.currentTime = media.duration - 1;\n\n media.addEventListener('progress', () => {\n media.currentTime = currentTime;\n // media.volume = 1;\n // this.setSafariBuffering(media, false);\n\n if(!media.paused) {\n media.play()/* .catch(() => {}) */;\n }\n }, {once: true});\n }, {once: true});\n }/* , {once: true} */);\n }\n\n public resolveWaitingForLoadMedia(peerId: PeerId, mid: number, isScheduled?: boolean) {\n const w = isScheduled ? this.waitingScheduledMediaForLoad : this.waitingMediaForLoad;\n const storage = w.get(peerId);\n if(!storage) {\n return;\n }\n\n const promise = storage.get(mid);\n if(promise) {\n promise.resolve();\n storage.delete(mid);\n\n if(!storage.size) {\n w.delete(peerId);\n }\n }\n }\n\n /**\n * Only for audio\n */\n public isSafariBuffering(media: HTMLMediaElement) {\n // @ts-ignore\n return !!media.safariBuffering;\n }\n\n private setSafariBuffering(media: HTMLMediaElement, value: boolean) {\n // @ts-ignore\n media.safariBuffering = value;\n }\n\n private async setNewMediadata(message: Message.message, playingMedia = this.playingMedia) {\n if(document.pictureInPictureElement) {\n return;\n }\n\n await onMediaLoad(playingMedia, undefined, false); // have to wait for load, otherwise on macOS won't set\n\n const doc = getMediaFromMessage(message, true) as MyDocument;\n\n const artwork: MediaImage[] = [];\n\n const isVoice = doc.type === 'voice' || doc.type === 'round';\n let title = '', artist = '';\n\n if(doc.thumbs?.length) {\n const size = doc.thumbs[doc.thumbs.length - 1];\n if(!(size as PhotoSize.photoStrippedSize).bytes) {\n const cacheContext = await this.managers.thumbsStorage.getCacheContext(doc, size.type);\n\n if(cacheContext.url) {\n artwork.push({\n src: cacheContext.url,\n sizes: `${(size as PhotoSize.photoSize).w}x${(size as PhotoSize.photoSize).h}`,\n type: 'image/jpeg'\n });\n } else {\n const download = appDownloadManager.downloadMediaURL({media: doc, thumb: size});\n download.then(() => {\n if(this.playingMedia !== playingMedia || !cacheContext.url) {\n return;\n }\n\n this.setNewMediadata(message);\n });\n }\n }\n } else if(isVoice) {\n const peerId = message.fromId || message.peerId;\n const peerPhoto = await this.managers.appPeersManager.getPeerPhoto(peerId);\n if(peerPhoto) {\n // const result = this.managers.appAvatarsManager.loadAvatar(peerId, peerPhoto, 'photo_small');\n // if(result.cached) {\n // const url = await result.loadPromise;\n // artwork.push({\n // src: url,\n // sizes: '160x160',\n // type: 'image/jpeg'\n // });\n // } else {\n // result.loadPromise.then((url) => {\n // if(this.playingMedia !== playingMedia || !url) {\n // return;\n // }\n\n // this.setNewMediadata(message);\n // });\n // }\n }\n\n title = await getPeerTitle({peerId, plainText: true, onlyFirstName: false});\n artist = I18n.format(doc.type === 'voice' ? 'AttachAudio' : 'AttachRound', true);\n }\n\n if(!isVoice) {\n const attribute = doc.attributes.find((attribute) => attribute._ === 'documentAttributeAudio') as DocumentAttribute.documentAttributeAudio;\n title = attribute?.title ?? doc.file_name;\n artist = attribute?.performer;\n }\n\n if(!artwork.length) {\n if(IS_APPLE) {\n if(IS_TOUCH_SUPPORTED) {\n artwork.push({\n src: `assets/img/apple-touch-icon-precomposed.png`,\n sizes: '180x180',\n type: 'image/png'\n });\n } else {\n artwork.push({\n src: `assets/img/apple-touch-icon.png`,\n sizes: '180x180',\n type: 'image/png'\n });\n }\n } else {\n [72, 96, 144, 192, 256, 384, 512].forEach((size) => {\n const sizes = `${size}x${size}`;\n artwork.push({\n src: `assets/img/android-chrome-${sizes}.png`,\n sizes,\n type: 'image/png'\n });\n });\n }\n }\n\n const metadata = new MediaMetadata({\n title,\n artist,\n artwork\n });\n\n navigator.mediaSession.metadata = metadata;\n }\n\n public setCurrentMediadata() {\n const {playingMedia} = this;\n if(!playingMedia) return;\n const message = this.getMessageByMedia(playingMedia);\n this.setNewMediadata(message, playingMedia);\n }\n\n private getMessageByMedia(media: HTMLMediaElement): Message.message {\n const details = this.mediaDetails.get(media);\n return details.message;\n // const {peerId, mid} = details;\n // const message = details.isScheduled ?\n // this.managers.appMessagesManager.getScheduledMessageByPeer(peerId, mid) :\n // this.managers.appMessagesManager.getMessageByPeer(peerId, mid);\n // return message;\n }\n\n public getPlayingDetails() {\n const {playingMedia} = this;\n if(!playingMedia) {\n return;\n }\n\n const message = this.getMessageByMedia(playingMedia);\n return {\n doc: getMediaFromMessage(message, true) as MyDocument,\n message,\n media: playingMedia,\n playbackParams: this.getPlaybackParams()\n };\n }\n\n private onPlay = (e?: Event) => {\n const media = e.target as HTMLMediaElement;\n const details = this.mediaDetails.get(media);\n const {peerId, mid} = details;\n\n // console.log('appMediaPlaybackController: video playing', this.currentPeerId, this.playingMedia, media);\n\n const pip = this.pip;\n if(pip) {\n pip.pause();\n }\n\n const message = this.getMessageByMedia(media);\n\n const previousMedia = this.playingMedia;\n if(previousMedia !== media) {\n this.stop();\n this.setMedia(media, message);\n\n const verify = (element: MediaItem) => element.mid === mid && element.peerId === peerId;\n const listLoader = this.listLoader;\n const current = listLoader.getCurrent();\n if(!current || !verify(current)) {\n let jumpLength: number;\n\n for(const withOtherSide of [false, true]) {\n const previous = listLoader.getPrevious(withOtherSide);\n\n let idx = previous.findIndex(verify);\n if(idx !== -1) {\n jumpLength = -(previous.length - idx);\n } else {\n const next = listLoader.getNext(withOtherSide);\n idx = next.findIndex(verify);\n if(idx !== -1) {\n jumpLength = idx + 1;\n }\n }\n\n if(jumpLength !== undefined) {\n break;\n }\n }\n\n if(jumpLength) {\n this.go(jumpLength, false);\n } else {\n this.setTargets({peerId, mid});\n }\n }\n }\n\n // audio_pause не успеет сработать без таймаута\n setTimeout(() => {\n if(this.playingMedia !== media) {\n return;\n }\n\n this.dispatchEvent('play', this.getPlayingDetails());\n this.pauseMediaInOtherTabs();\n }, 0);\n };\n\n private onPause = (e?: Event) => {\n /* const target = e.target as HTMLMediaElement;\n if(!isInDOM(target)) {\n this.container.append(target);\n target.play();\n return;\n } */\n\n // if(this.pip) {\n // this.pip.play();\n // }\n\n this.dispatchEvent('pause');\n };\n\n private onEnded = (e?: Event) => {\n if(e && !e.isTrusted) {\n return;\n }\n\n this.onPause(e);\n\n // console.log('on media end');\n\n const listLoader = this.listLoader;\n if(this.lockedSwitchers ||\n (!this.round && listLoader.current && !listLoader.next.length) ||\n !listLoader.getNext(true).length ||\n !this.next()) {\n this.stop();\n this.dispatchEvent('stop');\n }\n };\n\n public pauseMediaInOtherTabs() {\n this.skipMediaPlayEvent = true;\n rootScope.dispatchEvent('media_play');\n }\n\n // public get pip() {\n // return document.pictureInPictureElement as HTMLVideoElement;\n // }\n\n public toggle(play?: boolean, media = this.playingMedia) {\n if(!media) {\n return false;\n }\n\n if(play === undefined) {\n play = media.paused;\n }\n\n if(media.paused !== play) {\n return false;\n }\n\n if(play) {\n media.play();\n } else {\n media.pause();\n }\n\n return true;\n }\n\n public play = () => {\n return this.toggle(true);\n };\n\n public pause = () => {\n return this.toggle(false);\n };\n\n public stop = (media = this.playingMedia, force?: boolean) => {\n if(!media) {\n return false;\n }\n\n if(!media.paused) {\n media.pause();\n }\n\n media.currentTime = 0;\n simulateEvent(media, 'ended'); // ! important, will be used to hide controls for audio element\n\n if(media === this.playingMedia) {\n const details = this.mediaDetails.get(media);\n if(details?.clean) {\n media.src = '';\n const peerId = details.peerId;\n const s = details.isScheduled ? this.scheduled : this.media;\n const storage = s.get(peerId);\n if(storage) {\n storage.delete(details.mid);\n\n if(!storage.size) {\n s.delete(peerId);\n }\n }\n\n media.remove();\n\n this.mediaDetails.delete(media);\n }\n\n this.playingMedia = undefined;\n this.playingMediaType = undefined;\n }\n\n if(force) {\n this.dispatchEvent('stop');\n }\n\n return true;\n };\n\n public playItem = (item: MediaItem) => {\n const {peerId, mid} = item;\n const isScheduled = this.searchContext.isScheduled;\n const media = this.getMedia(peerId, mid, isScheduled);\n\n /* if(isSafari) {\n media.autoplay = true;\n } */\n\n media.play();\n\n setTimeout(() => {\n this.resolveWaitingForLoadMedia(peerId, mid, isScheduled);\n }, 0);\n };\n\n public go = (length: number, dispatchJump?: boolean) => {\n const listLoader = this.listLoader;\n if(this.lockedSwitchers || !listLoader) {\n return;\n }\n\n if(this.playingMediaType === 'audio') {\n return listLoader.goRound(length, dispatchJump);\n } else {\n return listLoader.go(length, dispatchJump);\n }\n };\n\n private bindBrowserCallback(cb: (video: HTMLVideoElement, details: MediaSessionActionDetails) => void) {\n const handler: MediaSessionActionHandler = (details) => {\n cb(this.pip, details);\n };\n\n return handler;\n }\n\n public browserPlay = this.bindBrowserCallback((video) => this.toggle(true, video));\n public browserPause = this.bindBrowserCallback((video) => this.toggle(false, video));\n public browserStop = this.bindBrowserCallback((video) => this.stop(video));\n public browserSeekBackward = this.bindBrowserCallback((video, details) => this.seekBackward(details, video));\n public browserSeekForward = this.bindBrowserCallback((video, details) => this.seekForward(details, video));\n public browserSeekTo = this.bindBrowserCallback((video, details) => this.seekTo(details, video));\n public browserNext = this.bindBrowserCallback((video) => video || this.next());\n public browserPrevious = this.bindBrowserCallback((video) => video ? this.seekToStart(video) : this.previous());\n\n public next = () => {\n return this.go(1);\n };\n\n public previous = () => {\n if(this.seekToStart(this.playingMedia)) {\n return;\n }\n\n return this.go(-1);\n };\n\n public seekToStart(media: HTMLMediaElement) {\n if(media?.currentTime > 5) {\n media.currentTime = 0;\n this.toggle(true, media);\n return true;\n }\n\n return false;\n }\n\n public willBePlayed(media: HTMLMediaElement) {\n this.willBePlayedMedia = media;\n }\n\n public setSearchContext(context: MediaSearchContext) {\n if(deepEqual(this.searchContext, context)) {\n return false;\n }\n\n this.searchContext = copy(context); // {_: type === 'audio' ? 'inputMessagesFilterMusic' : 'inputMessagesFilterRoundVoice'}\n return true;\n }\n\n public getSearchContext() {\n return this.searchContext;\n }\n\n public setTargets(current: MediaItem, prev?: MediaItem[], next?: MediaItem[]) {\n let listLoader = this.listLoader;\n if(!listLoader) {\n listLoader = this.listLoader = new SearchListLoader({\n loadCount: 10,\n loadWhenLeft: 5,\n processItem: (message: Message.message) => {\n this.addMedia(message, false);\n return {peerId: message.peerId, mid: message.mid};\n },\n onJump: (item, older) => {\n this.playItem(item);\n },\n onEmptied: () => {\n this.dispatchEvent('stop');\n this.stop();\n }\n });\n } else {\n listLoader.reset();\n }\n\n const reverse = this.searchContext.folderId !== undefined ? false : true;\n if(prev) {\n listLoader.setTargets(prev, next, reverse);\n } else {\n listLoader.reverse = reverse;\n }\n\n listLoader.setSearchContext(this.searchContext);\n listLoader.current = current;\n\n listLoader.load(true);\n listLoader.load(false);\n }\n\n private getPlaybackMediaTypeFromMessage(message: Message.message) {\n const doc = getMediaFromMessage(message, true) as MyDocument;\n let mediaType: PlaybackMediaType = 'audio';\n if(doc?.type) {\n if(doc.type === 'voice' || doc.type === 'round') {\n mediaType = 'voice';\n } else if(doc.type === 'video') {\n mediaType = 'video';\n }\n }\n\n return mediaType;\n }\n\n public setMedia(media: HTMLMediaElement, message: Message.message) {\n const mediaType = this.getPlaybackMediaTypeFromMessage(message);\n\n this._playbackRate = this.playbackRates[mediaType];\n\n this.playingMedia = media;\n this.playingMediaType = mediaType;\n this.playingMedia.volume = this.volume;\n this.playingMedia.muted = this.muted;\n this.playingMedia.playbackRate = this.playbackRate;\n\n if(mediaType === 'audio') {\n this.playingMedia.loop = this.loop;\n }\n\n if('mediaSession' in navigator) {\n this.setNewMediadata(message);\n }\n }\n\n public setSingleMedia(media?: HTMLMediaElement, message?: Message.message) {\n const playingMedia = this.playingMedia;\n\n const wasPlaying = this.pause();\n\n let onPlay: () => void;\n if(media) {\n onPlay = () => {\n const pip = this.pip;\n if(pip) {\n pip.pause();\n }\n\n this.pauseMediaInOtherTabs();\n };\n\n if(!media.paused) {\n onPlay();\n }\n\n media.addEventListener('play', onPlay);\n } else { // maybe it's voice recording\n this.pauseMediaInOtherTabs();\n }\n\n this.willBePlayed(undefined);\n if(media) this.setMedia(media, message);\n else this.playingMedia = undefined;\n this.toggleSwitchers(false);\n\n return (playPaused = wasPlaying) => {\n this.toggleSwitchers(true);\n\n if(playingMedia) {\n if(this.mediaDetails.get(playingMedia)) {\n this.setMedia(playingMedia, this.getMessageByMedia(playingMedia));\n } else {\n this.next() || this.previous();\n }\n }\n\n // If it's still not cleaned\n if(this.playingMedia === media) {\n this.playingMedia = undefined;\n this.playingMediaType = undefined;\n }\n\n if(media) {\n media.removeEventListener('play', onPlay);\n }\n\n // I don't remember what it was for\n // if(media && this.playingMedia === media) {\n // this.stop();\n // }\n\n if(playPaused) {\n this.play();\n }\n };\n }\n\n public toggleSwitchers(enabled: boolean) {\n this.lockedSwitchers = !enabled;\n }\n\n public setPictureInPicture(video: HTMLVideoElement) {\n this.pip = video;\n\n // let wasPlaying = this.pause();\n\n const listenerSetter = new ListenerSetter();\n listenerSetter.add(video)('leavepictureinpicture', () => {\n if(this.pip !== video) {\n return;\n }\n\n this.pip = undefined;\n // if(wasPlaying) {\n // this.play();\n // }\n\n listenerSetter.removeAll();\n }, {once: true});\n\n listenerSetter.add(video)('play', (e) => {\n if(this.playingMedia !== video) {\n this.pause();\n }\n\n this.pauseMediaInOtherTabs();\n // if(this.pause()) {\n // listenerSetter.add(video)('pause', () => {\n // this.play();\n // }, {once: true});\n // }\n });\n }\n}\n\nconst appMediaPlaybackController = new AppMediaPlaybackController();\nMOUNT_CLASS_TO.appMediaPlaybackController = appMediaPlaybackController;\nexport default appMediaPlaybackController;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../lib/appManagers/appDocsManager';\nimport MEDIA_MIME_TYPES_SUPPORTED from '../environment/mediaMimeTypesSupport';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport findUpTag from '../helpers/dom/findUpTag';\nimport setInnerHTML from '../helpers/dom/setInnerHTML';\nimport mediaSizes from '../helpers/mediaSizes';\nimport SearchListLoader from '../helpers/searchListLoader';\nimport {Message} from '../layer';\nimport appDownloadManager from '../lib/appManagers/appDownloadManager';\nimport appImManager from '../lib/appManagers/appImManager';\nimport {MyMessage} from '../lib/appManagers/appMessagesManager';\nimport {MyPhoto} from '../lib/appManagers/appPhotosManager';\nimport canSaveMessageMedia from '../lib/appManagers/utils/messages/canSaveMessageMedia';\nimport getMediaFromMessage from '../lib/appManagers/utils/messages/getMediaFromMessage';\nimport wrapRichText from '../lib/richTextProcessor/wrapRichText';\nimport {MediaSearchContext} from './appMediaPlaybackController';\nimport AppMediaViewerBase, {MEDIA_VIEWER_CLASSNAME} from './appMediaViewerBase';\nimport {ButtonMenuItemOptionsVerifiable} from './buttonMenu';\nimport PopupDeleteMessages from './popups/deleteMessages';\nimport PopupForward from './popups/forward';\nimport Scrollable from './scrollable';\nimport appSidebarRight from './sidebarRight';\nimport AppSharedMediaTab from './sidebarRight/tabs/sharedMedia';\nimport PopupElement from './popups';\n\ntype AppMediaViewerTargetType = {\n element: HTMLElement,\n mid: number,\n peerId: PeerId,\n message?: MyMessage\n};\nexport default class AppMediaViewer extends AppMediaViewerBase<'caption', 'delete' | 'forward', AppMediaViewerTargetType> {\n protected listLoader: SearchListLoader;\n protected btnMenuForward: ButtonMenuItemOptionsVerifiable;\n protected btnMenuDownload: ButtonMenuItemOptionsVerifiable;\n protected btnMenuDelete: ButtonMenuItemOptionsVerifiable;\n\n get searchContext() {\n return this.listLoader.searchContext;\n }\n\n constructor() {\n super(new SearchListLoader({\n processItem: (item) => {\n const isForDocument = this.searchContext.inputFilter._ === 'inputMessagesFilterDocument';\n const {mid, peerId} = item;\n const media = getMediaFromMessage(item, true);\n\n if(!media) return;\n\n if(isForDocument && !AppMediaViewer.isMediaCompatibleForDocumentViewer(media)) {\n return;\n }\n\n return {element: null as HTMLElement, mid, peerId};\n }\n }), ['delete', 'forward']);\n\n this.listLoader.onEmptied = () => {\n this.close();\n };\n\n /* const stub = document.createElement('div');\n stub.classList.add(MEDIA_VIEWER_CLASSNAME + '-stub');\n this.content.main.prepend(stub); */\n\n this.content.caption = document.createElement('div');\n this.content.caption.classList.add(MEDIA_VIEWER_CLASSNAME + '-caption', 'spoilers-container'/* , 'media-viewer-stub' */);\n\n let captionTimeout: number;\n const setCaptionTimeout = () => {\n if(captionTimeout) {\n clearTimeout(captionTimeout);\n }\n\n captionTimeout = window.setTimeout(() => {\n captionTimeout = undefined;\n this.content.caption.classList.remove('is-focused');\n }, 800);\n };\n this.content.caption.addEventListener('touchstart', () => {\n if(!mediaSizes.isMobile) return;\n\n this.content.caption.classList.add('is-focused');\n\n if(captionTimeout) {\n clearTimeout(captionTimeout);\n captionTimeout = undefined;\n }\n\n document.addEventListener('touchend', setCaptionTimeout, {once: true});\n });\n\n const captionScrollable = new Scrollable(this.content.caption);\n captionScrollable.onAdditionalScroll = setCaptionTimeout;\n\n // this.content.main.append(this.content.caption);\n this.wholeDiv.append(this.content.caption);\n\n attachClickEvent(this.buttons.delete, this.onDeleteClick);\n\n const buttons: ButtonMenuItemOptionsVerifiable[] = [this.btnMenuForward = {\n icon: 'forward',\n text: 'Forward',\n onClick: this.onForwardClick\n }, this.btnMenuDownload = {\n icon: 'download',\n text: 'MediaViewer.Context.Download',\n onClick: this.onDownloadClick\n }, this.btnMenuDelete = {\n icon: 'delete danger',\n text: 'Delete',\n onClick: this.onDeleteClick\n }];\n\n this.setBtnMenuToggle(buttons);\n\n // * constructing html end\n\n this.setListeners();\n }\n\n protected setListeners() {\n super.setListeners();\n attachClickEvent(this.buttons.forward, this.onForwardClick);\n attachClickEvent(this.author.container, this.onAuthorClick);\n\n const onCaptionClick = (e: MouseEvent) => {\n const a = findUpTag(e.target, 'A');\n if(a.classList.contains('timestamp')) {\n return;\n }\n\n const spoiler = findUpClassName(e.target, 'spoiler');\n if(a instanceof HTMLAnchorElement && (!spoiler || this.content.caption.classList.contains('is-spoiler-visible'))) { // close viewer if it's t.me/ redirect\n const onclick = a.getAttribute('onclick');\n if(!onclick || onclick.includes('showMaskedAlert')) {\n return;\n }\n\n cancelEvent(e);\n\n this.close().then(() => {\n this.content.caption.removeEventListener('click', onCaptionClick, {capture: true});\n a.click();\n });\n\n return false;\n }\n };\n\n this.content.caption.addEventListener('click', onCaptionClick, {capture: true});\n }\n\n /* public close(e?: MouseEvent) {\n const good = !this.setMoverAnimationPromise;\n const promise = super.close(e);\n\n if(good) { // clear\n this.currentMessageId = 0;\n this.peerId = 0;\n }\n\n return promise;\n } */\n\n protected getMessageByPeer(peerId: PeerId, mid: number) {\n return this.searchContext.isScheduled ? this.managers.appMessagesManager.getScheduledMessageByPeer(peerId, mid) : this.managers.appMessagesManager.getMessageByPeer(peerId, mid);\n }\n\n onPrevClick = async(target: AppMediaViewerTargetType) => {\n this.openMedia({\n message: await this.getMessageByPeer(target.peerId, target.mid),\n target: target.element,\n fromRight: -1\n });\n };\n\n onNextClick = async(target: AppMediaViewerTargetType) => {\n this.openMedia({\n message: await this.getMessageByPeer(target.peerId, target.mid),\n target: target.element,\n fromRight: 1\n });\n };\n\n onDeleteClick = () => {\n const target = this.target;\n PopupElement.createPopup(PopupDeleteMessages, target.peerId, [target.mid], 'chat', () => {\n this.target = {element: this.content.media} as any;\n this.close();\n });\n };\n\n onForwardClick = () => {\n const target = this.target;\n if(target.mid) {\n // appSidebarRight.forwardTab.open([target.mid]);\n PopupElement.createPopup(PopupForward, {\n [target.peerId]: [target.mid]\n }, () => {\n return this.close();\n });\n }\n };\n\n onAuthorClick = async(e: MouseEvent) => {\n const {mid, peerId} = this.target;\n if(mid && mid !== Number.MAX_SAFE_INTEGER) {\n const threadId = this.searchContext.threadId;\n const message = await this.getMessageByPeer(peerId, mid);\n this.close(e)\n // .then(() => mediaSizes.isMobile ? appSidebarRight.sharedMediaTab.closeBtn.click() : Promise.resolve())\n .then(async() => {\n if(mediaSizes.isMobile) {\n const tab = appSidebarRight.getTab(AppSharedMediaTab);\n if(tab) {\n tab.close();\n }\n }\n\n appImManager.setInnerPeer({\n peerId: message.peerId,\n lastMsgId: mid,\n type: threadId ? 'discussion' : undefined,\n threadId\n });\n });\n }\n };\n\n onDownloadClick = () => {\n const {message} = this.target;\n const media = getMediaFromMessage(message, true);\n if(!media) return;\n appDownloadManager.downloadToDisc({media, queueId: appImManager.chat.bubbles.lazyLoadQueue.queueId});\n };\n\n private setCaption(message: MyMessage) {\n const caption = (message as Message.message).message;\n let html: Parameters[1] = '';\n if(caption) {\n const media = getMediaFromMessage(message, true);\n\n html = wrapRichText(caption, {\n entities: (message as Message.message).totalEntities,\n maxMediaTimestamp: ((media as MyDocument)?.type === 'video' && (media as MyDocument).duration) || undefined\n });\n }\n\n // html = 'Dandelion are a family of flowering plants that grow in many parts of the world.';\n setInnerHTML(this.content.caption.firstElementChild, html);\n this.content.caption.classList.toggle('hide', !caption);\n // this.content.container.classList.toggle('with-caption', !!caption);\n }\n\n public setSearchContext(context: MediaSearchContext) {\n this.listLoader.setSearchContext(context);\n\n return this;\n }\n\n public async openMedia({\n message,\n target,\n fromRight = 0,\n reverse = false,\n prevTargets = [],\n nextTargets = [],\n mediaTimestamp\n }: {\n message: MyMessage,\n target?: HTMLElement,\n fromRight?: number,\n reverse?: boolean,\n prevTargets?: AppMediaViewerTargetType[],\n nextTargets?: AppMediaViewerTargetType[],\n mediaTimestamp?: number\n /* , needLoadMore = true */\n }) {\n if(this.setMoverPromise) return this.setMoverPromise;\n\n const mid = message.mid;\n const fromId = (message as Message.message).fwd_from && !message.fromId ? (message as Message.message).fwd_from.from_name : message.fromId;\n const media = getMediaFromMessage(message, true);\n\n const noForwards = await this.managers.appPeersManager.noForwards(message.peerId);\n const isServiceMessage = message._ === 'messageService';\n const cantForwardMessage = isServiceMessage || !(await this.managers.appMessagesManager.canForward(message));\n const cantDownloadMessage = (isServiceMessage ? noForwards : cantForwardMessage) || !canSaveMessageMedia(message);\n const a: [(HTMLElement | ButtonMenuItemOptionsVerifiable)[], boolean][] = [\n [[this.buttons.forward, this.btnMenuForward], cantForwardMessage],\n [[this.buttons.download, this.btnMenuDownload], cantDownloadMessage],\n [[this.buttons.delete, this.btnMenuDelete], !(await this.managers.appMessagesManager.canDeleteMessage(message))]\n ];\n\n a.forEach(([buttons, hide]) => {\n buttons.forEach((button) => {\n if(button instanceof HTMLElement) {\n button.classList.toggle('hide', hide);\n } else {\n button.verify = () => !hide;\n }\n });\n });\n\n this.wholeDiv.classList.toggle('no-forwards', cantDownloadMessage);\n\n this.setCaption(message);\n const promise = super._openMedia({\n media: media as MyPhoto | MyDocument,\n timestamp: message.date,\n fromId,\n fromRight,\n target,\n reverse,\n prevTargets,\n nextTargets,\n message,\n mediaTimestamp\n /* , needLoadMore */\n });\n this.target.mid = mid;\n this.target.peerId = message.peerId;\n this.target.message = message;\n\n return promise;\n }\n\n public static isMediaCompatibleForDocumentViewer(media: MyPhoto | MyDocument) {\n return media._ === 'photo' || MEDIA_MIME_TYPES_SUPPORTED.has(media.mime_type);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appMediaPlaybackController from '../components/appMediaPlaybackController';\nimport {IS_APPLE_MOBILE, IS_MOBILE} from '../environment/userAgent';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport ListenerSetter, {Listener} from '../helpers/listenerSetter';\nimport {ButtonMenuSync} from '../components/buttonMenu';\nimport {ButtonMenuToggleHandler} from '../components/buttonMenuToggle';\nimport ControlsHover from '../helpers/dom/controlsHover';\nimport {addFullScreenListener, cancelFullScreen, isFullScreen, requestFullScreen} from '../helpers/dom/fullScreen';\nimport toHHMMSS from '../helpers/string/toHHMMSS';\nimport MediaProgressLine from '../components/mediaProgressLine';\nimport VolumeSelector from '../components/volumeSelector';\nimport debounce from '../helpers/schedulers/debounce';\nimport overlayCounter from '../helpers/overlayCounter';\nimport onMediaLoad from '../helpers/onMediaLoad';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\n\nexport default class VideoPlayer extends ControlsHover {\n private static PLAYBACK_RATES = [0.5, 1, 1.5, 2];\n private static PLAYBACK_RATES_ICONS = ['playback_05', 'playback_1x', 'playback_15', 'playback_2x'];\n\n protected video: HTMLVideoElement;\n protected wrapper: HTMLDivElement;\n protected progress: MediaProgressLine;\n protected skin: 'default';\n\n protected listenerSetter: ListenerSetter;\n protected playbackRateButton: HTMLElement;\n protected pipButton: HTMLElement;\n\n /* protected videoParent: HTMLElement;\n protected videoWhichChild: number; */\n\n protected onPlaybackRackMenuToggle?: (open: boolean) => void;\n protected onPip?: (pip: boolean) => void;\n protected onPipClose?: () => void;\n\n constructor({\n video,\n play = false,\n streamable = false,\n duration,\n onPlaybackRackMenuToggle,\n onPip,\n onPipClose\n }: {\n video: HTMLVideoElement,\n play?: boolean,\n streamable?: boolean,\n duration?: number,\n onPlaybackRackMenuToggle?: VideoPlayer['onPlaybackRackMenuToggle'],\n onPip?: VideoPlayer['onPip'],\n onPipClose?: VideoPlayer['onPipClose']\n }) {\n super();\n\n this.video = video;\n this.wrapper = document.createElement('div');\n this.wrapper.classList.add('ckin__player');\n\n this.onPlaybackRackMenuToggle = onPlaybackRackMenuToggle;\n this.onPip = onPip;\n this.onPipClose = onPipClose;\n\n this.listenerSetter = new ListenerSetter();\n\n this.setup({\n element: this.wrapper,\n listenerSetter: this.listenerSetter,\n canHideControls: () => {\n return !this.video.paused && (!this.playbackRateButton || !this.playbackRateButton.classList.contains('menu-open'));\n },\n showOnLeaveToClassName: 'media-viewer-caption',\n ignoreClickClassName: 'ckin__controls'\n });\n\n video.parentNode.insertBefore(this.wrapper, video);\n this.wrapper.appendChild(video);\n\n this.skin = 'default';\n\n this.stylePlayer(duration);\n this.setBtnMenuToggle();\n\n if(this.skin === 'default') {\n const controls = this.wrapper.querySelector('.default__controls.ckin__controls') as HTMLDivElement;\n this.progress = new MediaProgressLine({\n onSeekStart: () => {\n this.wrapper.classList.add('is-seeking');\n },\n onSeekEnd: () => {\n this.wrapper.classList.remove('is-seeking');\n }\n });\n this.progress.setMedia({\n media: video,\n streamable,\n duration\n });\n controls.prepend(this.progress.container);\n }\n\n if(play/* && video.paused */) {\n const promise = video.play();\n promise.catch((err: Error) => {\n if(err.name === 'NotAllowedError') {\n video.muted = true;\n video.autoplay = true;\n video.play();\n }\n }).finally(() => { // due to autoplay, play will not call\n this.wrapper.classList.toggle('is-playing', !this.video.paused);\n });\n }\n }\n\n private stylePlayer(initDuration: number) {\n const {wrapper, video, skin, listenerSetter} = this;\n\n wrapper.classList.add(skin);\n\n const html = this.buildControls();\n wrapper.insertAdjacentHTML('beforeend', html);\n let timeDuration: HTMLElement;\n\n if(skin === 'default') {\n this.playbackRateButton = this.wrapper.querySelector('.playback-rate') as HTMLElement;\n this.pipButton = this.wrapper.querySelector('.pip') as HTMLElement;\n\n const toggle = wrapper.querySelectorAll('.toggle') as NodeListOf;\n const fullScreenButton = wrapper.querySelector('.fullscreen') as HTMLElement;\n const timeElapsed = wrapper.querySelector('#time-elapsed');\n timeDuration = wrapper.querySelector('#time-duration') as HTMLElement;\n timeDuration.textContent = toHHMMSS(video.duration | 0);\n\n const volumeSelector = new VolumeSelector(listenerSetter);\n\n const leftControls = wrapper.querySelector('.left-controls');\n volumeSelector.btn.classList.remove('btn-icon');\n leftControls.insertBefore(volumeSelector.btn, timeElapsed.parentElement);\n\n Array.from(toggle).forEach((button) => {\n attachClickEvent(button, () => {\n this.togglePlay();\n }, {listenerSetter: this.listenerSetter});\n });\n\n if(this.pipButton) {\n attachClickEvent(this.pipButton, () => {\n this.video.requestPictureInPicture();\n }, {listenerSetter: this.listenerSetter});\n\n const onPip = (pip: boolean) => {\n this.wrapper.style.visibility = pip ? 'hidden': '';\n if(this.onPip) {\n this.onPip(pip);\n }\n };\n\n const debounceTime = 20;\n const debouncedPip = debounce(onPip, debounceTime, false, true);\n\n listenerSetter.add(video)('enterpictureinpicture', () => {\n debouncedPip(true);\n\n listenerSetter.add(video)('leavepictureinpicture', () => {\n const onPause = () => {\n clearTimeout(timeout);\n if(this.onPipClose) {\n this.onPipClose();\n }\n };\n const listener = listenerSetter.add(video)('pause', onPause, {once: true}) as any as Listener;\n const timeout = setTimeout(() => {\n listenerSetter.remove(listener);\n }, debounceTime);\n }, {once: true});\n });\n\n listenerSetter.add(video)('leavepictureinpicture', () => {\n debouncedPip(false);\n });\n }\n\n if(!IS_TOUCH_SUPPORTED) {\n attachClickEvent(video, () => {\n this.togglePlay();\n }, {listenerSetter: this.listenerSetter});\n\n listenerSetter.add(document)('keydown', (e: KeyboardEvent) => {\n if(overlayCounter.overlaysActive > 1 || document.pictureInPictureElement === video) { // forward popup is active, etc\n return;\n }\n\n const {key, code} = e;\n\n let good = true;\n if(code === 'KeyF') {\n this.toggleFullScreen();\n } else if(code === 'KeyM') {\n appMediaPlaybackController.muted = !appMediaPlaybackController.muted;\n } else if(code === 'Space') {\n this.togglePlay();\n } else if(e.altKey && (code === 'Equal' || code === 'Minus')) {\n const add = code === 'Equal' ? 1 : -1;\n const playbackRate = appMediaPlaybackController.playbackRate;\n const idx = VideoPlayer.PLAYBACK_RATES.indexOf(playbackRate);\n const nextIdx = idx + add;\n if(nextIdx >= 0 && nextIdx < VideoPlayer.PLAYBACK_RATES.length) {\n appMediaPlaybackController.playbackRate = VideoPlayer.PLAYBACK_RATES[nextIdx];\n }\n } else if(wrapper.classList.contains('ckin__fullscreen') && (key === 'ArrowLeft' || key === 'ArrowRight')) {\n if(key === 'ArrowLeft') appMediaPlaybackController.seekBackward({action: 'seekbackward'});\n else appMediaPlaybackController.seekForward({action: 'seekforward'});\n } else {\n good = false;\n }\n\n if(good) {\n cancelEvent(e);\n return false;\n }\n });\n }\n\n listenerSetter.add(video)('dblclick', () => {\n if(!IS_TOUCH_SUPPORTED) {\n this.toggleFullScreen();\n }\n });\n\n attachClickEvent(fullScreenButton, () => {\n this.toggleFullScreen();\n }, {listenerSetter: this.listenerSetter});\n\n addFullScreenListener(wrapper, this.onFullScreen.bind(this, fullScreenButton), listenerSetter);\n\n listenerSetter.add(video)('timeupdate', () => {\n timeElapsed.textContent = toHHMMSS(video.currentTime | 0);\n });\n\n listenerSetter.add(video)('play', () => {\n wrapper.classList.add('played');\n\n if(!IS_TOUCH_SUPPORTED) {\n listenerSetter.add(video)('play', () => {\n this.hideControls(true);\n });\n }\n }, {once: true});\n\n listenerSetter.add(video)('pause', () => {\n this.showControls(false);\n });\n\n listenerSetter.add(appMediaPlaybackController)('playbackParams', () => {\n this.setPlaybackRateIcon();\n });\n }\n\n listenerSetter.add(video)('play', () => {\n wrapper.classList.add('is-playing');\n });\n\n listenerSetter.add(video)('pause', () => {\n wrapper.classList.remove('is-playing');\n });\n\n if(video.duration || initDuration) {\n timeDuration.textContent = toHHMMSS(Math.round(video.duration || initDuration));\n } else {\n onMediaLoad(video).then(() => {\n timeDuration.textContent = toHHMMSS(Math.round(video.duration));\n });\n }\n }\n\n protected togglePlay(isPaused = this.video.paused) {\n this.video[isPaused ? 'play' : 'pause']();\n }\n\n private buildControls() {\n const skin = this.skin;\n if(skin === 'default') {\n return `\n \n
\n
\n
\n
\n \n
\n \n / \n \n
\n
\n
\n \n ${!IS_MOBILE && document.pictureInPictureEnabled ? `` : ''}\n \n
\n
\n
`;\n }\n }\n\n protected setBtnMenuToggle() {\n const buttons: Parameters[0]['buttons'] = VideoPlayer.PLAYBACK_RATES.map((rate, idx) => {\n return {\n // icon: VideoPlayer.PLAYBACK_RATES_ICONS[idx],\n regularText: rate + 'x',\n onClick: () => {\n appMediaPlaybackController.playbackRate = rate;\n }\n };\n });\n const btnMenu = ButtonMenuSync({buttons});\n btnMenu.classList.add('top-left');\n ButtonMenuToggleHandler({\n el: this.playbackRateButton,\n onOpen: this.onPlaybackRackMenuToggle ? () => {\n this.onPlaybackRackMenuToggle(true);\n } : undefined,\n onClose: this.onPlaybackRackMenuToggle ? () => {\n this.onPlaybackRackMenuToggle(false);\n } : undefined\n });\n this.playbackRateButton.append(btnMenu);\n\n this.setPlaybackRateIcon();\n }\n\n protected setPlaybackRateIcon() {\n const playbackRateButton = this.playbackRateButton;\n VideoPlayer.PLAYBACK_RATES_ICONS.forEach((className) => {\n className = 'tgico-' + className;\n playbackRateButton.classList.remove(className);\n });\n\n let idx = VideoPlayer.PLAYBACK_RATES.indexOf(appMediaPlaybackController.playbackRate);\n if(idx === -1) idx = VideoPlayer.PLAYBACK_RATES.indexOf(1);\n\n playbackRateButton.classList.add('tgico-' + VideoPlayer.PLAYBACK_RATES_ICONS[idx]);\n }\n\n protected toggleFullScreen() {\n const player = this.wrapper;\n\n // * https://caniuse.com/#feat=fullscreen\n if(IS_APPLE_MOBILE) {\n const video = this.video as any;\n video.webkitEnterFullscreen();\n video.enterFullscreen();\n return;\n }\n\n if(!isFullScreen()) {\n /* const videoParent = this.video.parentElement;\n const videoWhichChild = whichChild(this.video);\n const needVideoRemount = videoParent !== player;\n\n if(needVideoRemount) {\n this.videoParent = videoParent;\n this.videoWhichChild = videoWhichChild;\n player.prepend(this.video);\n } */\n\n requestFullScreen(player);\n } else {\n /* if(this.videoParent) {\n const {videoWhichChild, videoParent} = this;\n if(!videoWhichChild) {\n videoParent.prepend(this.video);\n } else {\n videoParent.insertBefore(this.video, videoParent.children[videoWhichChild]);\n }\n\n this.videoParent = null;\n this.videoWhichChild = -1;\n } */\n\n cancelFullScreen();\n }\n }\n\n protected onFullScreen(fullScreenButton: HTMLElement) {\n const isFull = isFullScreen();\n this.wrapper.classList.toggle('ckin__fullscreen', isFull);\n if(!isFull) {\n fullScreenButton.classList.remove('tgico-smallscreen');\n fullScreenButton.classList.add('tgico-fullscreen');\n fullScreenButton.setAttribute('title', 'Full Screen');\n } else {\n fullScreenButton.classList.remove('tgico-fullscreen');\n fullScreenButton.classList.add('tgico-smallscreen');\n fullScreenButton.setAttribute('title', 'Exit Full Screen');\n }\n }\n\n public setTimestamp(timestamp: number) {\n this.video.currentTime = timestamp;\n this.togglePlay(true);\n }\n\n public cleanup() {\n super.cleanup();\n this.listenerSetter.removeAll();\n this.progress.removeListeners();\n this.onPlaybackRackMenuToggle = this.onPip = undefined;\n }\n}\n","export default function isBetween(num: number, min: number, max: number) {\n return num >= min && num <= max;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// * zoom part from WebZ\n// * https://github.com/Ajaxy/telegram-tt/blob/069f4f5b2f2c7c22529ccced876842e7f9cb81f4/src/components/mediaViewer/MediaViewerSlides.tsx\n\nimport type {MyDocument} from '../lib/appManagers/appDocsManager';\nimport type {MyPhoto} from '../lib/appManagers/appPhotosManager';\nimport deferredPromise from '../helpers/cancellablePromise';\nimport mediaSizes from '../helpers/mediaSizes';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport {IS_MOBILE, IS_MOBILE_SAFARI, IS_SAFARI} from '../environment/userAgent';\nimport {logger} from '../lib/logger';\nimport VideoPlayer from '../lib/mediaPlayer';\nimport rootScope from '../lib/rootScope';\nimport animationIntersector from './animationIntersector';\nimport appMediaPlaybackController, {AppMediaPlaybackController} from './appMediaPlaybackController';\nimport AvatarElement from './avatar';\nimport ButtonIcon from './buttonIcon';\nimport {ButtonMenuItemOptions} from './buttonMenu';\nimport ButtonMenuToggle from './buttonMenuToggle';\nimport ProgressivePreloader from './preloader';\nimport SwipeHandler, {ZoomDetails} from './swipeHandler';\nimport {formatFullSentTime} from '../helpers/date';\nimport appNavigationController, {NavigationItem} from './appNavigationController';\nimport {Message, PhotoSize} from '../layer';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport renderImageFromUrl, {renderImageFromUrlPromise} from '../helpers/dom/renderImageFromUrl';\nimport getVisibleRect from '../helpers/dom/getVisibleRect';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport fillPropertyValue from '../helpers/fillPropertyValue';\nimport generatePathData from '../helpers/generatePathData';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport {doubleRaf, fastRaf} from '../helpers/schedulers';\nimport RangeSelector from './rangeSelector';\nimport windowSize from '../helpers/windowSize';\nimport ListLoader from '../helpers/listLoader';\nimport EventListenerBase from '../helpers/eventListenerBase';\nimport {MyMessage} from '../lib/appManagers/appMessagesManager';\nimport {NULL_PEER_ID} from '../lib/mtproto/mtproto_config';\nimport {isFullScreen} from '../helpers/dom/fullScreen';\nimport {attachClickEvent, hasMouseMovedSinceDown} from '../helpers/dom/clickEvent';\nimport SearchListLoader from '../helpers/searchListLoader';\nimport createVideo from '../helpers/dom/createVideo';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport getStrippedThumbIfNeeded from '../helpers/getStrippedThumbIfNeeded';\nimport setAttachmentSize from '../helpers/setAttachmentSize';\nimport wrapEmojiText from '../lib/richTextProcessor/wrapEmojiText';\nimport LazyLoadQueueBase from './lazyLoadQueueBase';\nimport overlayCounter from '../helpers/overlayCounter';\nimport appDownloadManager from '../lib/appManagers/appDownloadManager';\nimport wrapPeerTitle from './wrappers/peerTitle';\nimport {toastNew} from './toast';\nimport clamp from '../helpers/number/clamp';\nimport debounce from '../helpers/schedulers/debounce';\nimport isBetween from '../helpers/number/isBetween';\nimport findUpAsChild from '../helpers/dom/findUpAsChild';\nimport liteMode from '../helpers/liteMode';\n\nconst ZOOM_STEP = 0.5;\nconst ZOOM_INITIAL_VALUE = 1;\nconst ZOOM_MIN_VALUE = 0.5;\nconst ZOOM_MAX_VALUE = 4;\n\nexport const MEDIA_VIEWER_CLASSNAME = 'media-viewer';\n\ntype Transform = {\n x: number;\n y: number;\n scale: number;\n};\n\nexport default class AppMediaViewerBase<\n ContentAdditionType extends string,\n ButtonsAdditionType extends string,\n TargetType extends {element: HTMLElement\n}> extends EventListenerBase<{\n setMoverBefore: () => void,\n setMoverAfter: () => void\n}> {\n protected wholeDiv: HTMLElement;\n protected overlaysDiv: HTMLElement;\n protected author: {[k in 'container' | 'avatarEl' | 'nameEl' | 'date']: HTMLElement} = {} as any;\n protected content: {[k in 'main' | 'container' | 'media' | 'mover' | ContentAdditionType]: HTMLElement} = {} as any;\n protected buttons: {[k in 'download' | 'close' | 'prev' | 'next' | 'mobile-close' | 'zoom' | ButtonsAdditionType]: HTMLElement} = {} as any;\n protected topbar: HTMLElement;\n protected moversContainer: HTMLElement;\n\n protected tempId = 0;\n protected preloader: ProgressivePreloader = null;\n protected preloaderStreamable: ProgressivePreloader = null;\n\n protected log: ReturnType;\n\n protected isFirstOpen = true;\n\n protected pageEl = document.getElementById('page-chats') as HTMLDivElement;\n\n protected setMoverPromise: Promise;\n protected setMoverAnimationPromise: Promise;\n\n protected lazyLoadQueue: LazyLoadQueueBase;\n\n protected highlightSwitchersTimeout: number;\n\n protected onDownloadClick: (e: MouseEvent) => void;\n protected onPrevClick: (target: TargetType) => void;\n protected onNextClick: (target: TargetType) => void;\n\n protected videoPlayer: VideoPlayer;\n\n protected zoomElements: {\n container: HTMLElement,\n btnOut: HTMLElement,\n btnIn: HTMLElement,\n rangeSelector: RangeSelector\n } = {} as any;\n protected transform: Transform = {x: 0, y: 0, scale: ZOOM_INITIAL_VALUE};\n protected isZooming: boolean;\n protected isGesturingNow: boolean;\n protected isZoomingNow: boolean;\n protected draggingType: 'wheel' | 'touchmove' | 'mousemove';\n protected initialContentRect: DOMRect;\n\n protected ctrlKeyDown: boolean;\n protected releaseSingleMedia: ReturnType;\n protected navigationItem: NavigationItem;\n\n protected managers: AppManagers;\n protected swipeHandler: SwipeHandler;\n protected closing: boolean;\n\n protected lastTransform: Transform = this.transform;\n protected lastZoomCenter: {x: number, y: number} = this.transform;\n protected lastDragOffset: {x: number, y: number} = this.transform;\n protected lastDragDelta: {x: number, y: number} = this.transform;\n protected lastGestureTime: number;\n protected clampZoomDebounced: ReturnType void>>;\n protected ignoreNextClick: boolean;\n\n get target() {\n return this.listLoader.current;\n }\n\n set target(value) {\n this.listLoader.current = value;\n }\n\n constructor(\n protected listLoader: ListLoader,\n topButtons: Array['buttons']>\n ) {\n super(false);\n\n this.managers = rootScope.managers;\n\n this.log = logger('AMV');\n this.preloader = new ProgressivePreloader();\n this.preloaderStreamable = new ProgressivePreloader({\n cancelable: false,\n streamable: true\n });\n this.preloader.construct();\n this.preloaderStreamable.construct();\n this.lazyLoadQueue = new LazyLoadQueueBase();\n\n this.wholeDiv = document.createElement('div');\n this.wholeDiv.classList.add(MEDIA_VIEWER_CLASSNAME + '-whole');\n\n this.overlaysDiv = document.createElement('div');\n this.overlaysDiv.classList.add('overlays');\n\n const mainDiv = document.createElement('div');\n mainDiv.classList.add(MEDIA_VIEWER_CLASSNAME);\n\n const topbar = this.topbar = document.createElement('div');\n topbar.classList.add(MEDIA_VIEWER_CLASSNAME + '-topbar', MEDIA_VIEWER_CLASSNAME + '-appear');\n\n const topbarLeft = document.createElement('div');\n topbarLeft.classList.add(MEDIA_VIEWER_CLASSNAME + '-topbar-left');\n\n this.buttons['mobile-close'] = ButtonIcon('close', {onlyMobile: true});\n\n // * author\n this.author.container = document.createElement('div');\n this.author.container.classList.add(MEDIA_VIEWER_CLASSNAME + '-author', 'no-select');\n const authorRight = document.createElement('div');\n\n this.author.avatarEl = new AvatarElement();\n this.author.avatarEl.classList.add(MEDIA_VIEWER_CLASSNAME + '-userpic', 'avatar-44');\n\n this.author.nameEl = document.createElement('div');\n this.author.nameEl.classList.add(MEDIA_VIEWER_CLASSNAME + '-name');\n\n this.author.date = document.createElement('div');\n this.author.date.classList.add(MEDIA_VIEWER_CLASSNAME + '-date');\n\n authorRight.append(this.author.nameEl, this.author.date);\n\n this.author.container.append(this.author.avatarEl, authorRight);\n\n // * buttons\n const buttonsDiv = document.createElement('div');\n buttonsDiv.classList.add(MEDIA_VIEWER_CLASSNAME + '-buttons');\n\n topButtons.concat(['download', 'zoom', 'close']).forEach((name) => {\n const button = ButtonIcon(name, {noRipple: true});\n this.buttons[name] = button;\n buttonsDiv.append(button);\n });\n\n this.buttons.zoom.classList.add('zoom-in');\n\n // * zoom\n this.zoomElements.container = document.createElement('div');\n this.zoomElements.container.classList.add('zoom-container');\n\n this.zoomElements.btnOut = ButtonIcon('zoomout', {noRipple: true});\n attachClickEvent(this.zoomElements.btnOut, () => this.addZoomStep(false));\n this.zoomElements.btnIn = ButtonIcon('zoomin', {noRipple: true});\n attachClickEvent(this.zoomElements.btnIn, () => this.addZoomStep(true));\n\n this.zoomElements.rangeSelector = new RangeSelector({\n step: 0.01,\n min: ZOOM_MIN_VALUE,\n max: ZOOM_MAX_VALUE,\n withTransition: true\n }, ZOOM_INITIAL_VALUE);\n this.zoomElements.rangeSelector.setListeners();\n this.zoomElements.rangeSelector.setHandlers({\n onScrub: (value) => {\n const add = value - this.transform.scale;\n this.addZoom(add);\n this.clampZoomDebounced?.clearTimeout();\n },\n onMouseDown: () => {\n this.onSwipeFirst();\n },\n onMouseUp: () => {\n this.onSwipeReset();\n }\n });\n\n this.zoomElements.container.append(this.zoomElements.btnOut, this.zoomElements.rangeSelector.container, this.zoomElements.btnIn);\n\n if(!IS_TOUCH_SUPPORTED) {\n this.wholeDiv.append(this.zoomElements.container);\n }\n\n // * content\n this.content.main = document.createElement('div');\n this.content.main.classList.add(MEDIA_VIEWER_CLASSNAME + '-content');\n\n this.content.container = document.createElement('div');\n this.content.container.classList.add(MEDIA_VIEWER_CLASSNAME + '-container');\n\n this.content.media = document.createElement('div');\n this.content.media.classList.add(MEDIA_VIEWER_CLASSNAME + '-media');\n\n this.content.container.append(this.content.media);\n\n this.content.main.append(this.content.container);\n mainDiv.append(this.content.main);\n this.overlaysDiv.append(mainDiv);\n // * overlays end\n\n topbarLeft.append(this.buttons['mobile-close'], this.author.container);\n topbar.append(topbarLeft, buttonsDiv);\n\n this.buttons.prev = document.createElement('div');\n this.buttons.prev.className = `${MEDIA_VIEWER_CLASSNAME}-switcher ${MEDIA_VIEWER_CLASSNAME}-switcher-left`;\n this.buttons.prev.innerHTML = ``;\n\n this.buttons.next = document.createElement('div');\n this.buttons.next.className = `${MEDIA_VIEWER_CLASSNAME}-switcher ${MEDIA_VIEWER_CLASSNAME}-switcher-right`;\n this.buttons.next.innerHTML = ``;\n\n this.moversContainer = document.createElement('div');\n this.moversContainer.classList.add(MEDIA_VIEWER_CLASSNAME + '-movers');\n\n this.moversContainer.append(this.buttons.prev, this.buttons.next);\n\n this.wholeDiv.append(this.overlaysDiv, /* this.buttons.prev, this.buttons.next, */ this.topbar, this.moversContainer);\n\n // * constructing html end\n\n this.listLoader.onLoadedMore = () => {\n this.buttons.prev.classList.toggle('hide', !this.listLoader.previous.length);\n this.buttons.next.classList.toggle('hide', !this.listLoader.next.length);\n };\n\n this.setNewMover();\n }\n\n protected setListeners() {\n attachClickEvent(this.buttons.download, this.onDownloadClick);\n [this.buttons.close, this.buttons['mobile-close'], this.preloaderStreamable.preloader].forEach((el) => {\n attachClickEvent(el, this.close.bind(this));\n });\n\n ([[-1, this.buttons.prev], [1, this.buttons.next]] as [number, HTMLElement][]).forEach(([moveLength, button]) => {\n // attachClickEvent(button, (e) => {\n button.addEventListener('click', (e) => {\n cancelEvent(e);\n if(this.setMoverPromise) return;\n\n this.listLoader.go(moveLength);\n });\n });\n\n attachClickEvent(this.buttons.zoom, () => {\n if(this.isZooming) this.resetZoom();\n else {\n this.addZoomStep(true);\n }\n });\n\n // ! cannot use the function because it'll cancel slide event on touch devices\n // attachClickEvent(this.wholeDiv, this.onClick);\n this.wholeDiv.addEventListener('click', this.onClick);\n\n this.listLoader.onJump = (item, older) => {\n if(older) this.onNextClick(item);\n else this.onPrevClick(item);\n };\n\n const adjustPosition = (xDiff: number, yDiff: number) => {\n const [x, y] = [xDiff - this.lastDragOffset.x, yDiff - this.lastDragOffset.y];\n const [transform, inBoundsX, inBoundsY] = this.calculateOffsetBoundaries({\n x: this.transform.x + x,\n y: this.transform.y + y,\n scale: this.transform.scale\n });\n\n this.lastDragDelta = {\n x,\n y\n };\n\n this.lastDragOffset = {\n x: xDiff,\n y: yDiff\n };\n\n this.setTransform(transform);\n\n return {inBoundsX, inBoundsY};\n };\n\n const setLastGestureTime = debounce(() => {\n this.lastGestureTime = Date.now();\n }, 500, false, true);\n\n this.clampZoomDebounced = debounce(() => {\n this.onSwipeReset();\n }, 300, false, true);\n\n this.swipeHandler = new SwipeHandler({\n element: this.wholeDiv,\n onReset: this.onSwipeReset,\n onFirstSwipe: this.onSwipeFirst as any,\n onSwipe: (xDiff, yDiff, e, cancelDrag) => {\n if(isFullScreen()) {\n return;\n }\n\n if(this.isZooming && !this.isZoomingNow) {\n setLastGestureTime();\n\n this.draggingType = e.type as any;\n const {inBoundsX, inBoundsY} = adjustPosition(xDiff, yDiff);\n cancelDrag?.(!inBoundsX, !inBoundsY);\n\n return;\n }\n\n if(this.isZoomingNow || !IS_TOUCH_SUPPORTED) {\n return;\n }\n\n const percents = Math.abs(xDiff) / windowSize.width;\n if(percents > .2 || Math.abs(xDiff) > 125) {\n if(xDiff > 0) {\n this.buttons.prev.click();\n } else {\n this.buttons.next.click();\n }\n\n return true;\n }\n\n const percentsY = Math.abs(yDiff) / windowSize.height;\n if(percentsY > .2 || Math.abs(yDiff) > 125) {\n this.close();\n return true;\n }\n\n return false;\n },\n onZoom: this.onZoom,\n onDoubleClick: ({centerX, centerY}) => {\n if(this.isZooming) {\n this.resetZoom();\n } else {\n const scale = ZOOM_INITIAL_VALUE + 2;\n this.changeZoomByPosition(centerX, centerY, scale);\n }\n },\n verifyTouchTarget: (e) => {\n // * Fix for seek input\n if(isFullScreen() ||\n findUpAsChild(e.target as HTMLElement, this.zoomElements.container) ||\n findUpClassName(e.target, 'ckin__controls') ||\n findUpClassName(e.target, 'media-viewer-caption') ||\n (findUpClassName(e.target, 'media-viewer-topbar') && e.type !== 'wheel')) {\n return false;\n }\n\n return true;\n },\n cursor: ''\n // cursor: 'move'\n });\n }\n\n protected onSwipeFirst = (e?: MouseEvent | TouchEvent | WheelEvent) => {\n this.lastDragOffset = this.lastDragDelta = {x: 0, y: 0};\n this.lastTransform = {...this.transform};\n if(e?.type !== 'wheel' || !this.ctrlKeyDown) { // keep transition for real mouse wheel\n this.moversContainer.classList.add('no-transition');\n this.zoomElements.rangeSelector.container.classList.remove('with-transition');\n }\n this.isGesturingNow = true;\n this.lastGestureTime = Date.now();\n this.clampZoomDebounced.clearTimeout();\n\n if(!this.lastTransform.x && !this.lastTransform.y && !this.isZooming) {\n this.initialContentRect = this.content.media.getBoundingClientRect();\n }\n };\n\n protected onSwipeReset = (e?: Event) => {\n // move\n this.moversContainer.classList.remove('no-transition');\n this.zoomElements.rangeSelector.container.classList.add('with-transition');\n this.clampZoomDebounced.clearTimeout();\n\n if(e?.type === 'mouseup' && this.draggingType === 'mousemove') {\n this.ignoreNextClick = true;\n }\n\n const {draggingType} = this;\n this.isZoomingNow = false;\n this.isGesturingNow = false;\n this.draggingType = undefined;\n\n if(this.closing) {\n return;\n }\n\n if(this.transform.scale > ZOOM_INITIAL_VALUE) {\n // Get current content boundaries\n const s1 = Math.min(this.transform.scale, ZOOM_MAX_VALUE);\n const scaleFactor = s1 / this.transform.scale;\n\n // Calculate new position based on the last zoom center to keep the zoom center\n // at the same position when bouncing back from max zoom\n let x1 = this.transform.x * scaleFactor + (this.lastZoomCenter.x - scaleFactor * this.lastZoomCenter.x);\n let y1 = this.transform.y * scaleFactor + (this.lastZoomCenter.y - scaleFactor * this.lastZoomCenter.y);\n\n // If scale didn't change, we need to add inertia to pan gesture\n if(draggingType && draggingType !== 'wheel' && this.lastTransform.scale === this.transform.scale) {\n // Arbitrary pan velocity coefficient\n const k = 0.1;\n\n // Calculate user gesture velocity\n const elapsedTime = Math.max(1, Date.now() - this.lastGestureTime);\n const Vx = Math.abs(this.lastDragOffset.x) / elapsedTime;\n const Vy = Math.abs(this.lastDragOffset.y) / elapsedTime;\n\n // Add extra distance based on gesture velocity and last pan delta\n x1 -= Math.abs(this.lastDragOffset.x) * Vx * k * -this.lastDragDelta.x;\n y1 -= Math.abs(this.lastDragOffset.y) * Vy * k * -this.lastDragDelta.y;\n }\n\n const [transform] = this.calculateOffsetBoundaries({x: x1, y: y1, scale: s1});\n this.lastTransform = transform;\n this.setTransform(transform);\n } else if(this.transform.scale < ZOOM_INITIAL_VALUE) {\n this.resetZoom();\n }\n };\n\n protected onZoom = ({\n initialCenterX,\n initialCenterY,\n zoom,\n zoomAdd,\n currentCenterX,\n currentCenterY,\n dragOffsetX,\n dragOffsetY,\n zoomFactor\n }: ZoomDetails) => {\n initialCenterX ||= windowSize.width / 2;\n initialCenterY ||= windowSize.height / 2;\n currentCenterX ||= windowSize.width / 2;\n currentCenterY ||= windowSize.height / 2;\n\n this.isZoomingNow = true;\n\n const zoomMaxBounceValue = ZOOM_MAX_VALUE * 3;\n const scale = zoomAdd !== undefined ? clamp(this.lastTransform.scale + zoomAdd, ZOOM_MIN_VALUE, zoomMaxBounceValue) : (zoom ?? clamp(this.lastTransform.scale * zoomFactor, ZOOM_MIN_VALUE, zoomMaxBounceValue));\n const scaleFactor = scale / this.lastTransform.scale;\n const offsetX = Math.abs(Math.min(this.lastTransform.x, 0));\n const offsetY = Math.abs(Math.min(this.lastTransform.y, 0));\n\n // Save last zoom center for bounce back effect\n this.lastZoomCenter = {\n x: currentCenterX,\n y: currentCenterY\n };\n\n // Calculate new center relative to the shifted image\n const scaledCenterX = offsetX + initialCenterX;\n const scaledCenterY = offsetY + initialCenterY;\n\n const {scaleOffsetX, scaleOffsetY} = this.calculateScaleOffset({x: scaledCenterX, y: scaledCenterY, scale: scaleFactor});\n\n const [transform] = this.calculateOffsetBoundaries({\n x: this.lastTransform.x + scaleOffsetX + dragOffsetX,\n y: this.lastTransform.y + scaleOffsetY + dragOffsetY,\n scale\n });\n\n this.setTransform(transform);\n };\n\n protected changeZoomByPosition(x: number, y: number, scale: number) {\n const {scaleOffsetX, scaleOffsetY} = this.calculateScaleOffset({x, y, scale});\n const transform = this.calculateOffsetBoundaries({\n x: scaleOffsetX,\n y: scaleOffsetY,\n scale\n })[0];\n\n this.setTransform(transform);\n }\n\n protected setTransform(transform: Transform) {\n this.transform = transform;\n this.changeZoom(transform.scale);\n }\n\n // Calculate how much we need to shift the image to keep the zoom center at the same position\n protected calculateScaleOffset({x, y, scale}: {\n x: number,\n y: number,\n scale: number\n }) {\n return {\n scaleOffsetX: x - scale * x,\n scaleOffsetY: y - scale * y\n };\n }\n\n protected toggleZoom(enable?: boolean) {\n const isVisible = this.isZooming;\n const auto = enable === undefined;\n if(this.zoomElements.rangeSelector.mousedown || this.ctrlKeyDown) {\n enable = true;\n }\n\n enable ??= !isVisible;\n\n if(isVisible === enable) {\n return;\n }\n\n this.buttons.zoom.classList.toggle('zoom-in', !enable);\n this.zoomElements.container.classList.toggle('is-visible', this.isZooming = enable);\n this.wholeDiv.classList.toggle('is-zooming', enable);\n\n if(auto || !enable) {\n const zoomValue = enable ? this.transform.scale : ZOOM_INITIAL_VALUE;\n this.setZoomValue(zoomValue);\n this.zoomElements.rangeSelector.setProgress(zoomValue);\n }\n\n if(this.videoPlayer) {\n this.videoPlayer.lockControls(enable ? false : undefined);\n }\n }\n\n protected addZoomStep(add: boolean) {\n this.addZoom(ZOOM_STEP * (add ? 1 : -1));\n }\n\n protected resetZoom() {\n this.setTransform({\n x: 0,\n y: 0,\n scale: ZOOM_INITIAL_VALUE\n });\n }\n\n protected changeZoom(value = this.transform.scale) {\n this.transform.scale = value;\n this.zoomElements.rangeSelector.setProgress(value);\n this.setZoomValue(value);\n }\n\n protected addZoom(value: number) {\n this.lastTransform = this.transform;\n this.onZoom({\n zoomAdd: value,\n currentCenterX: 0,\n currentCenterY: 0,\n initialCenterX: 0,\n initialCenterY: 0,\n dragOffsetX: 0,\n dragOffsetY: 0\n });\n this.lastTransform = this.transform;\n this.clampZoomDebounced();\n }\n\n protected getZoomBounce() {\n return this.isGesturingNow && IS_TOUCH_SUPPORTED ? 50 : 0;\n }\n\n protected calculateOffsetBoundaries = (\n {x, y, scale}: Transform,\n offsetTop = 0\n ): [Transform, boolean, boolean] => {\n if(!this.initialContentRect) return [{x, y, scale}, true, true];\n // Get current content boundaries\n let inBoundsX = true;\n let inBoundsY = true;\n\n const {minX, maxX, minY, maxY} = this.getZoomBoundaries(scale, offsetTop);\n\n inBoundsX = isBetween(x, maxX, minX);\n x = clamp(x, maxX, minX);\n\n inBoundsY = isBetween(y, maxY, minY);\n y = clamp(y, maxY, minY);\n\n return [{x, y, scale}, inBoundsX, inBoundsY];\n };\n\n protected getZoomBoundaries(scale = this.transform.scale, offsetTop = 0) {\n if(!this.initialContentRect) {\n return {minX: 0, maxX: 0, minY: 0, maxY: 0};\n }\n\n const centerX = (windowSize.width - windowSize.width * scale) / 2;\n const centerY = (windowSize.height - windowSize.height * scale) / 2;\n\n // If content is outside window we calculate offset boundaries\n // based on initial content rect and current scale\n const minX = Math.max(-this.initialContentRect.left * scale, centerX);\n const maxX = windowSize.width - this.initialContentRect.right * scale;\n\n const minY = Math.max(-this.initialContentRect.top * scale + offsetTop, centerY);\n const maxY = windowSize.height - this.initialContentRect.bottom * scale;\n\n return {minX, maxX, minY, maxY};\n }\n\n protected setZoomValue = (value = this.transform.scale) => {\n this.initialContentRect ??= this.content.media.getBoundingClientRect();\n\n // this.zoomValue = value;\n if(value === ZOOM_INITIAL_VALUE) {\n this.transform.x = 0;\n this.transform.y = 0;\n }\n\n this.moversContainer.style.transform = `translate3d(${this.transform.x.toFixed(3)}px, ${this.transform.y.toFixed(3)}px, 0px) scale(${value.toFixed(3)})`;\n\n this.zoomElements.btnOut.classList.toggle('inactive', value <= ZOOM_MIN_VALUE);\n this.zoomElements.btnIn.classList.toggle('inactive', value >= ZOOM_MAX_VALUE);\n\n this.toggleZoom(value !== ZOOM_INITIAL_VALUE);\n };\n\n protected setBtnMenuToggle(buttons: ButtonMenuItemOptions[]) {\n const btnMenuToggle = ButtonMenuToggle({buttonOptions: {onlyMobile: true}, direction: 'bottom-left', buttons});\n this.topbar.append(btnMenuToggle);\n }\n\n public close(e?: MouseEvent) {\n if(e) {\n cancelEvent(e);\n }\n\n if(this.setMoverAnimationPromise) return Promise.reject();\n\n this.closing = true;\n this.swipeHandler?.removeListeners();\n\n if(this.navigationItem) {\n appNavigationController.removeItem(this.navigationItem);\n }\n\n this.lazyLoadQueue.clear();\n\n const promise = this.setMoverToTarget(this.target?.element, true).then(({onAnimationEnd}) => onAnimationEnd);\n\n this.listLoader.reset();\n (this.listLoader as SearchListLoader).cleanup && (this.listLoader as SearchListLoader).cleanup();\n this.setMoverPromise = null;\n this.tempId = -1;\n if((window as any).appMediaViewer === this) {\n (window as any).appMediaViewer = undefined;\n }\n\n /* if(appSidebarRight.historyTabIDs.slice(-1)[0] === AppSidebarRight.SLIDERITEMSIDS.forward) {\n promise.then(() => {\n appSidebarRight.forwardTab.closeBtn.click();\n });\n } */\n\n this.removeGlobalListeners();\n\n promise.finally(() => {\n this.wholeDiv.remove();\n this.toggleOverlay(false);\n });\n\n return promise;\n }\n\n protected toggleOverlay(active: boolean) {\n overlayCounter.isOverlayActive = active;\n animationIntersector.checkAnimations2(active);\n }\n\n protected toggleGlobalListeners(active: boolean) {\n if(active) this.setGlobalListeners();\n else this.removeGlobalListeners();\n }\n\n protected removeGlobalListeners() {\n window.removeEventListener('keydown', this.onKeyDown);\n window.removeEventListener('keyup', this.onKeyUp);\n }\n\n protected setGlobalListeners() {\n window.addEventListener('keydown', this.onKeyDown);\n window.addEventListener('keyup', this.onKeyUp);\n }\n\n public setMediaTimestamp(timestamp: number) {\n this.videoPlayer?.setTimestamp(timestamp);\n }\n\n onClick = (e: MouseEvent) => {\n if(this.ignoreNextClick) {\n this.ignoreNextClick = undefined;\n return;\n }\n\n if(this.setMoverAnimationPromise) return;\n\n const target = e.target as HTMLElement;\n if(target.tagName === 'A') return;\n cancelEvent(e);\n\n if(IS_TOUCH_SUPPORTED) {\n if(this.highlightSwitchersTimeout) {\n clearTimeout(this.highlightSwitchersTimeout);\n } else {\n this.wholeDiv.classList.add('highlight-switchers');\n }\n\n this.highlightSwitchersTimeout = window.setTimeout(() => {\n this.wholeDiv.classList.remove('highlight-switchers');\n this.highlightSwitchersTimeout = 0;\n }, 3e3);\n\n return;\n }\n\n if(hasMouseMovedSinceDown(e)) {\n return;\n }\n\n const isZooming = this.isZooming && false;\n let mover: HTMLElement = null;\n const classNames = ['ckin__player', 'media-viewer-buttons', 'media-viewer-author', 'media-viewer-caption', 'zoom-container'];\n if(isZooming) {\n classNames.push('media-viewer-movers');\n }\n\n classNames.find((s) => {\n try {\n mover = findUpClassName(target, s);\n if(mover) return true;\n } catch(err) {return false;}\n });\n\n if(/* target === this.mediaViewerDiv */!mover || (!isZooming && (target.tagName === 'IMG' || target.tagName === 'image'))) {\n this.close();\n }\n };\n\n private onKeyDown = (e: KeyboardEvent) => {\n // this.log('onKeyDown', e);\n if(overlayCounter.overlaysActive > 1) {\n return;\n }\n\n const key = e.key;\n\n let good = true;\n if(key === 'ArrowRight') {\n !this.isZooming && this.buttons.next.click();\n } else if(key === 'ArrowLeft') {\n !this.isZooming && this.buttons.prev.click();\n } else if(key === '-' || key === '=') {\n if(this.ctrlKeyDown) {\n this.addZoomStep(key === '=');\n }\n } else {\n good = false;\n }\n\n if(e.ctrlKey || e.metaKey) {\n this.ctrlKeyDown = true;\n }\n\n if(good) {\n cancelEvent(e);\n }\n };\n\n private onKeyUp = (e: KeyboardEvent) => {\n if(overlayCounter.overlaysActive > 1) {\n return;\n }\n\n if(!(e.ctrlKey || e.metaKey)) {\n this.ctrlKeyDown = false;\n\n if(this.isZooming) {\n this.setZoomValue();\n }\n }\n };\n\n protected async setMoverToTarget(target: HTMLElement, closing = false, fromRight = 0) {\n this.dispatchEvent('setMoverBefore');\n\n const mover = this.content.mover;\n\n if(!closing) {\n mover.innerHTML = '';\n // mover.append(this.buttons.prev, this.buttons.next);\n }\n\n const zoomValue = this.isZooming && closing /* && false */ ? this.transform.scale : ZOOM_INITIAL_VALUE;\n /* if(!(zoomValue > 1 && closing)) */ this.removeCenterFromMover(mover);\n\n const wasActive = fromRight !== 0;\n\n const delay = liteMode.isAvailable('animations') ? (wasActive ? 350 : 200) : 0;\n // let delay = wasActive ? 350 : 10000;\n\n /* if(wasActive) {\n this.moveTheMover(mover);\n mover = this.setNewMover();\n } */\n\n /* if(DEBUG) {\n this.log('setMoverToTarget', target, closing, wasActive, fromRight);\n } */\n\n let realParent: HTMLElement;\n\n let rect: DOMRect;\n if(target) {\n if(target instanceof AvatarElement || target.classList.contains('grid-item')/* || target.classList.contains('document-ico') */) {\n realParent = target;\n rect = target.getBoundingClientRect();\n } else if(target instanceof SVGImageElement || target.parentElement instanceof SVGForeignObjectElement) {\n realParent = findUpClassName(target, 'attachment');\n rect = realParent.getBoundingClientRect();\n } else if(target.classList.contains('profile-avatars-avatar')) {\n realParent = findUpClassName(target, 'profile-avatars-container');\n rect = realParent.getBoundingClientRect();\n\n // * if not active avatar\n if(closing && target.getBoundingClientRect().left !== rect.left) {\n target = realParent = rect = undefined;\n }\n }\n }\n\n if(!target) {\n target = this.content.media;\n }\n\n if(!rect) {\n realParent = target.parentElement as HTMLElement;\n rect = target.getBoundingClientRect();\n }\n\n let needOpacity = false;\n if(target !== this.content.media && !target.classList.contains('profile-avatars-avatar')) {\n const overflowElement = findUpClassName(realParent, 'scrollable');\n const visibleRect = getVisibleRect(realParent, overflowElement, true);\n\n if(closing && (!visibleRect || visibleRect.overflow.vertical === 2 || visibleRect.overflow.horizontal === 2)) {\n target = this.content.media;\n realParent = target.parentElement as HTMLElement;\n rect = target.getBoundingClientRect();\n } else if(visibleRect && (visibleRect.overflow.vertical === 1 || visibleRect.overflow.horizontal === 1)) {\n needOpacity = true;\n }\n }\n\n const containerRect = this.content.media.getBoundingClientRect();\n\n let transform = '';\n let left: number;\n let top: number;\n\n if(wasActive) {\n left = fromRight === 1 ? windowSize.width : -containerRect.width;\n top = containerRect.top;\n } else {\n left = rect.left;\n top = rect.top;\n }\n\n /* if(zoomValue > 1) { // 33\n // const diffX = (rect.width * zoomValue - rect.width) / 4;\n const diffX = (rect.width * zoomValue - rect.width) / 2;\n const diffY = (rect.height * zoomValue - rect.height) / 4;\n // left -= diffX;\n // top += diffY;\n } */\n\n transform += `translate3d(${left}px,${top}px,0) `;\n\n /* if(wasActive) {\n left = fromRight === 1 ? appPhotosManager.windowW / 2 : -(containerRect.width + appPhotosManager.windowW / 2);\n transform += `translate(${left}px,-50%) `;\n } else {\n left = rect.left - (appPhotosManager.windowW / 2);\n top = rect.top - (appPhotosManager.windowH / 2);\n transform += `translate(${left}px,${top}px) `;\n } */\n\n let aspecter: HTMLDivElement;\n if(target instanceof HTMLImageElement || target instanceof HTMLVideoElement || target.tagName === 'DIV') {\n if(mover.firstElementChild && mover.firstElementChild.classList.contains('media-viewer-aspecter')) {\n aspecter = mover.firstElementChild as HTMLDivElement;\n\n const player = aspecter.querySelector('.ckin__player');\n if(player) {\n const video = player.firstElementChild as HTMLVideoElement;\n aspecter.append(video);\n player.remove();\n }\n\n if(!aspecter.style.cssText) { // всё из-за видео, элементы управления скейлятся, так бы можно было этого не делать\n mover.classList.remove('active');\n this.setFullAspect(aspecter, containerRect, rect);\n void mover.offsetLeft; // reflow\n mover.classList.add('active');\n }\n } else {\n aspecter = document.createElement('div');\n aspecter.classList.add('media-viewer-aspecter'/* , 'disable-hover' */);\n mover.prepend(aspecter);\n }\n\n aspecter.style.cssText = `width: ${rect.width}px; height: ${rect.height}px; transform: scale3d(${containerRect.width / rect.width}, ${containerRect.height / rect.height}, 1);`;\n }\n\n mover.style.width = containerRect.width + 'px';\n mover.style.height = containerRect.height + 'px';\n\n // const scaleX = rect.width / (containerRect.width * zoomValue);\n // const scaleY = rect.height / (containerRect.height * zoomValue);\n const scaleX = rect.width / containerRect.width;\n const scaleY = rect.height / containerRect.height;\n if(!wasActive) {\n transform += `scale3d(${scaleX},${scaleY},1) `;\n }\n\n let borderRadius = window.getComputedStyle(realParent).getPropertyValue('border-radius');\n const brSplitted = fillPropertyValue(borderRadius) as string[];\n borderRadius = brSplitted.map((r) => (parseInt(r) / scaleX) + 'px').join(' ');\n if(!wasActive) {\n mover.style.borderRadius = borderRadius;\n }\n // let borderRadius = '0px 0px 0px 0px';\n\n if(closing && zoomValue !== 1) {\n const left = rect.left - (windowSize.width * scaleX - rect.width) / 2;\n const top = rect.top - (windowSize.height * scaleY - rect.height) / 2;\n this.moversContainer.style.transform = `matrix(${scaleX}, 0, 0, ${scaleY}, ${left}, ${top})`;\n } else {\n mover.style.transform = transform;\n }\n\n needOpacity && (mover.style.opacity = '0'/* !closing ? '0' : '' */);\n\n /* if(wasActive) {\n this.log('setMoverToTarget', mover.style.transform);\n } */\n\n let path: SVGPathElement;\n const isOut = target.classList.contains('is-out');\n\n const deferred = this.setMoverAnimationPromise = deferredPromise();\n const ret = {onAnimationEnd: deferred};\n\n const timeout = setTimeout(() => {\n if(!deferred.isFulfilled && !deferred.isRejected) {\n deferred.resolve();\n }\n }, 1000);\n\n deferred.finally(() => {\n this.dispatchEvent('setMoverAfter');\n\n if(this.setMoverAnimationPromise === deferred) {\n this.setMoverAnimationPromise = null;\n }\n\n clearTimeout(timeout);\n });\n\n if(!closing) {\n let mediaElement: HTMLImageElement | HTMLVideoElement | HTMLCanvasElement;\n let src: string;\n\n // if(target instanceof HTMLVideoElement) {\n const selector = 'video, img, .canvas-thumbnail';\n const queryFrom = target.matches(selector) ? target.parentElement : target;\n const elements = Array.from(queryFrom.querySelectorAll(selector)) as HTMLImageElement[];\n if(elements.length) {\n target = elements.pop();\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n if(target instanceof HTMLImageElement) {\n canvas.width = target.naturalWidth;\n canvas.height = target.naturalHeight;\n } else if(target instanceof HTMLVideoElement) {\n canvas.width = target.videoWidth;\n canvas.height = target.videoHeight;\n } else if(target instanceof HTMLCanvasElement) {\n canvas.width = target.width;\n canvas.height = target.height;\n }\n\n canvas.className = 'canvas-thumbnail thumbnail media-photo';\n context.drawImage(target as HTMLImageElement | HTMLCanvasElement, 0, 0);\n target = canvas;\n }\n // }\n\n if(target.tagName === 'DIV' || target.tagName === 'AVATAR-ELEMENT') { // useContainerAsTarget\n const images = Array.from(target.querySelectorAll('img')) as HTMLImageElement[];\n const image = images.pop();\n if(image) {\n mediaElement = new Image();\n src = image.src;\n mover.append(mediaElement);\n }\n /* mediaElement = new Image();\n src = target.style.backgroundImage.slice(5, -2); */\n } else if(target instanceof HTMLImageElement) {\n mediaElement = new Image();\n src = target.src;\n } else if(target instanceof HTMLVideoElement) {\n mediaElement = createVideo();\n mediaElement.src = target.src;\n } else if(target instanceof SVGSVGElement) {\n const clipId = target.dataset.clipId;\n const newClipId = clipId + '-mv';\n\n const {width, height} = containerRect;\n\n const newSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n newSvg.setAttributeNS(null, 'width', '' + width);\n newSvg.setAttributeNS(null, 'height', '' + height);\n\n // нижние два свойства для масштабирования\n newSvg.setAttributeNS(null, 'viewBox', `0 0 ${width} ${height}`);\n newSvg.setAttributeNS(null, 'preserveAspectRatio', 'xMidYMid meet');\n\n newSvg.insertAdjacentHTML('beforeend', target.firstElementChild.outerHTML.replace(clipId, newClipId));\n newSvg.insertAdjacentHTML('beforeend', target.lastElementChild.outerHTML.replace(clipId, newClipId));\n\n // теперь надо выставить новую позицию для хвостика\n const defs = newSvg.firstElementChild;\n const use = defs.firstElementChild.firstElementChild as SVGUseElement;\n if(use instanceof SVGUseElement) {\n let transform = use.getAttributeNS(null, 'transform');\n transform = transform.replace(/translate\\((.+?), (.+?)\\) scale\\((.+?), (.+?)\\)/, (match, x, y, sX, sY) => {\n x = +x;\n if(x !== 2) {\n x = width - (2 / scaleX);\n } else {\n x = 2 / scaleX;\n }\n\n y = height;\n\n return `translate(${x}, ${y}) scale(${+sX / scaleX}, ${+sY / scaleY})`;\n });\n use.setAttributeNS(null, 'transform', transform);\n\n // и новый RECT\n path = defs.firstElementChild.lastElementChild as SVGPathElement;\n\n // код ниже нужен только чтобы скрыть моргание до момента как сработает таймаут\n let d: string;\n const br: [number, number, number, number] = borderRadius.split(' ').map((v) => parseInt(v)) as any;\n if(isOut) d = generatePathData(0, 0, width - 9 / scaleX, height, ...br);\n else d = generatePathData(9 / scaleX, 0, width - 9 / scaleX, height, ...br);\n path.setAttributeNS(null, 'd', d);\n }\n\n const foreignObject = newSvg.lastElementChild;\n foreignObject.setAttributeNS(null, 'width', '' + containerRect.width);\n foreignObject.setAttributeNS(null, 'height', '' + containerRect.height);\n\n mover.prepend(newSvg);\n } else if(target instanceof HTMLCanvasElement) {\n mediaElement = target;\n }\n\n if(aspecter) {\n aspecter.style.borderRadius = borderRadius;\n\n if(mediaElement) {\n aspecter.append(mediaElement);\n }\n }\n\n mediaElement = mover.querySelector('video, img');\n if(mediaElement instanceof HTMLImageElement) {\n mediaElement.classList.add('thumbnail');\n if(!aspecter) {\n mediaElement.style.width = containerRect.width + 'px';\n mediaElement.style.height = containerRect.height + 'px';\n }\n\n if(src) {\n await renderImageFromUrlPromise(mediaElement, src);\n }\n }/* else if(mediaElement instanceof HTMLVideoElement && mediaElement.firstElementChild && ((mediaElement.firstElementChild as HTMLSourceElement).src || src)) {\n await new Promise((resolve, reject) => {\n mediaElement.addEventListener('loadeddata', resolve);\n\n if(src) {\n (mediaElement.firstElementChild as HTMLSourceElement).src = src;\n }\n });\n } */\n\n mover.style.display = '';\n\n fastRaf(() => {\n mover.classList.add(wasActive ? 'moving' : 'active');\n });\n } else {\n /* if(mover.classList.contains('center')) {\n mover.classList.remove('center');\n void mover.offsetLeft; // reflow\n } */\n\n if(target instanceof SVGSVGElement) {\n path = mover.querySelector('path');\n\n if(path) {\n this.sizeTailPath(path, containerRect, scaleX, delay, false, isOut, borderRadius);\n }\n }\n\n if(target.classList.contains('media-viewer-media')) {\n mover.classList.add('hiding');\n }\n\n this.toggleWholeActive(false);\n\n // return ret;\n\n setTimeout(() => {\n mover.style.borderRadius = borderRadius;\n\n if(mover.firstElementChild) {\n (mover.firstElementChild as HTMLElement).style.borderRadius = borderRadius;\n }\n }, delay / 2);\n\n setTimeout(() => {\n mover.innerHTML = '';\n mover.classList.remove('moving', 'active', 'hiding');\n mover.style.cssText = 'display: none;';\n\n deferred.resolve();\n }, delay);\n\n mover.classList.remove('opening');\n\n return ret;\n }\n\n mover.classList.add('opening');\n\n // await new Promise((resolve) => setTimeout(resolve, 0));\n // await new Promise((resolve) => window.requestAnimationFrame(resolve));\n // * одного RAF'а недостаточно, иногда анимация с одним не срабатывает (преимущественно на мобильных)\n await doubleRaf();\n\n // чтобы проверить установленную позицию - раскомментировать\n // throw '';\n\n // await new Promise((resolve) => setTimeout(resolve, 5e3));\n\n mover.style.transform = `translate3d(${containerRect.left}px,${containerRect.top}px,0) scale3d(1,1,1)`;\n // mover.style.transform = `translate(-50%,-50%) scale(1,1)`;\n needOpacity && (mover.style.opacity = ''/* closing ? '0' : '' */);\n\n if(aspecter) {\n this.setFullAspect(aspecter, containerRect, rect);\n }\n\n // throw '';\n\n setTimeout(() => {\n mover.style.borderRadius = '';\n\n if(mover.firstElementChild) {\n (mover.firstElementChild as HTMLElement).style.borderRadius = '';\n }\n }, 0/* delay / 2 */);\n\n mover.dataset.timeout = '' + setTimeout(() => {\n mover.classList.remove('moving', 'opening');\n\n if(aspecter) { // всё из-за видео, элементы управления скейлятся, так бы можно было этого не делать\n if(mover.querySelector('video') || true) {\n mover.classList.remove('active');\n aspecter.style.cssText = '';\n void mover.offsetLeft; // reflow\n }\n\n // aspecter.classList.remove('disable-hover');\n }\n\n // эти строки нужны для установки центральной позиции, в случае ресайза это будет нужно\n mover.classList.add('center', 'no-transition');\n /* mover.style.left = mover.style.top = '50%';\n mover.style.transform = 'translate(-50%, -50%)';\n void mover.offsetLeft; // reflow */\n\n // это уже нужно для будущих анимаций\n mover.classList.add('active');\n delete mover.dataset.timeout;\n\n deferred.resolve();\n }, delay);\n\n if(path) {\n this.sizeTailPath(path, containerRect, scaleX, delay, true, isOut, borderRadius);\n }\n\n return ret;\n }\n\n protected toggleWholeActive(active: boolean) {\n if(active) {\n this.wholeDiv.classList.add('active');\n } else {\n this.wholeDiv.classList.add('backwards');\n setTimeout(() => {\n this.wholeDiv.classList.remove('active');\n }, 0);\n }\n }\n\n protected setFullAspect(aspecter: HTMLDivElement, containerRect: DOMRect, rect: DOMRect) {\n /* let media = aspecter.firstElementChild;\n let proportion: number;\n if(media instanceof HTMLImageElement) {\n proportion = media.naturalWidth / media.naturalHeight;\n } else if(media instanceof HTMLVideoElement) {\n proportion = media.videoWidth / media.videoHeight;\n } */\n const proportion = containerRect.width / containerRect.height;\n\n let {width, height} = rect;\n /* if(proportion === 1) {\n aspecter.style.cssText = '';\n } else { */\n if(proportion > 0) {\n width = height * proportion;\n } else {\n height = width * proportion;\n }\n\n // this.log('will set style aspecter:', `width: ${width}px; height: ${height}px; transform: scale(${containerRect.width / width}, ${containerRect.height / height});`);\n\n aspecter.style.cssText = `width: ${width}px; height: ${height}px; transform: scale3d(${containerRect.width / width}, ${containerRect.height / height}, 1);`;\n // }\n }\n\n protected sizeTailPath(path: SVGPathElement, rect: DOMRect, scaleX: number, delay: number, upscale: boolean, isOut: boolean, borderRadius: string) {\n const start = Date.now();\n const {width, height} = rect;\n delay = delay / 2;\n\n const br = borderRadius.split(' ').map((v) => parseInt(v));\n\n const step = () => {\n const diff = Date.now() - start;\n\n let progress = delay ? diff / delay : 1;\n if(progress > 1) progress = 1;\n if(upscale) progress = 1 - progress;\n\n const _br: [number, number, number, number] = br.map((v) => v * progress) as any;\n\n let d: string;\n if(isOut) d = generatePathData(0, 0, width - (9 / scaleX * progress), height, ..._br);\n else d = generatePathData(9 / scaleX * progress, 0, width/* width - (9 / scaleX * progress) */, height, ..._br);\n path.setAttributeNS(null, 'd', d);\n\n if(diff < delay) fastRaf(step);\n };\n\n // window.requestAnimationFrame(step);\n step();\n }\n\n protected removeCenterFromMover(mover: HTMLElement) {\n if(mover.classList.contains('center')) {\n // const rect = mover.getBoundingClientRect();\n const rect = this.content.media.getBoundingClientRect();\n mover.style.transform = `translate3d(${rect.left}px,${rect.top}px,0)`;\n mover.classList.remove('center');\n void mover.offsetLeft; // reflow\n mover.classList.remove('no-transition');\n }\n }\n\n protected moveTheMover(mover: HTMLElement, toLeft = true) {\n const windowW = windowSize.width;\n\n this.removeCenterFromMover(mover);\n\n // mover.classList.remove('active');\n mover.classList.add('moving');\n\n if(mover.dataset.timeout) { // и это тоже всё из-за скейла видео, так бы это не нужно было\n clearTimeout(+mover.dataset.timeout);\n }\n\n const rect = mover.getBoundingClientRect();\n\n const newTransform = mover.style.transform.replace(/translate3d\\((.+?),/, (match, p1) => {\n const x = toLeft ? -rect.width : windowW;\n // const x = toLeft ? -(rect.right + (rect.width / 2)) : windowW / 2;\n\n return match.replace(p1, x + 'px');\n });\n\n // //////this.log('set newTransform:', newTransform, mover.style.transform, toLeft);\n mover.style.transform = newTransform;\n\n setTimeout(() => {\n mover.remove();\n }, 350);\n }\n\n protected setNewMover() {\n const newMover = document.createElement('div');\n newMover.classList.add('media-viewer-mover');\n newMover.style.display = 'none';\n\n if(this.content.mover) {\n const oldMover = this.content.mover;\n oldMover.parentElement.append(newMover);\n } else {\n this.moversContainer.append(newMover);\n }\n\n return this.content.mover = newMover;\n }\n\n protected updateMediaSource(target: HTMLElement, url: string, tagName: 'video' | 'img') {\n // if(target instanceof SVGSVGElement) {\n const el = target.tagName.toLowerCase() === tagName ? target : target.querySelector(tagName) as HTMLElement;\n if(el && !findUpClassName(target, 'document')) {\n if(findUpClassName(target, 'attachment')) {\n // two parentElements because element can be contained in aspecter\n const preloader = target.parentElement.parentElement.querySelector('.preloader-container') as HTMLElement;\n if(preloader) {\n if(tagName === 'video') {\n if(preloader.classList.contains('manual')) {\n preloader.click();\n // return;\n }\n\n return;\n }\n\n preloader.remove();\n }\n }\n\n if((el as HTMLImageElement).src !== url) {\n renderImageFromUrl(el, url);\n }\n\n // ! костыль, но он тут даже и не нужен\n if(el.classList.contains('thumbnail') && el.parentElement.classList.contains('media-container-aspecter')) {\n el.classList.remove('thumbnail');\n }\n }\n /* } else {\n\n } */\n }\n\n protected setAuthorInfo(fromId: PeerId | string, timestamp: number) {\n const isPeerId = fromId.isPeerId();\n let wrapTitlePromise: Promise | HTMLElement;\n if(isPeerId) {\n wrapTitlePromise = wrapPeerTitle({\n peerId: fromId as PeerId,\n dialog: false,\n onlyFirstName: false,\n plainText: false\n })\n } else {\n const title = wrapTitlePromise = document.createElement('span');\n title.append(wrapEmojiText(fromId));\n title.classList.add('peer-title');\n }\n\n const oldAvatar = this.author.avatarEl;\n const newAvatar = this.author.avatarEl = (oldAvatar.cloneNode() as AvatarElement);\n\n return Promise.all([\n (this.author.avatarEl as AvatarElement).updateWithOptions({\n peerId: fromId as PeerId || NULL_PEER_ID,\n peerTitle: isPeerId ? undefined : '' + fromId\n }),\n\n wrapTitlePromise\n ]).then(([_, title]) => {\n if(this.author.avatarEl !== newAvatar) {\n return;\n }\n\n replaceContent(this.author.date, formatFullSentTime(timestamp));\n replaceContent(this.author.nameEl, title);\n oldAvatar.replaceWith(this.author.avatarEl);\n });\n }\n\n protected async _openMedia({\n media,\n timestamp,\n fromId,\n fromRight,\n target,\n reverse = false,\n prevTargets = [],\n nextTargets = [],\n message,\n mediaTimestamp\n }: {\n media: MyDocument | MyPhoto,\n timestamp: number,\n fromId: PeerId | string,\n fromRight: number,\n target?: HTMLElement,\n reverse?: boolean,\n prevTargets?: TargetType[],\n nextTargets?: TargetType[],\n message?: MyMessage,\n mediaTimestamp?: number\n /* , needLoadMore = true */\n }) {\n if(this.setMoverPromise) return this.setMoverPromise;\n\n /* if(DEBUG) {\n this.log('openMedia:', media, fromId, prevTargets, nextTargets);\n } */\n\n const setAuthorPromise = this.setAuthorInfo(fromId, timestamp);\n\n const isDocument = media._ === 'document';\n const isVideo = isDocument && media.mime_type && ((['video', 'gif'] as MyDocument['type'][]).includes(media.type) || media.mime_type.indexOf('video/') === 0);\n\n if(this.isFirstOpen) {\n // this.targetContainer = targetContainer;\n // this.needLoadMore = needLoadMore;\n this.isFirstOpen = false;\n this.listLoader.setTargets(prevTargets, nextTargets, reverse);\n (window as any).appMediaViewer = this;\n // this.loadMore = loadMore;\n\n /* if(appSidebarRight.historyTabIDs.slice(-1)[0] === AppSidebarRight.SLIDERITEMSIDS.forward) {\n appSidebarRight.forwardTab.closeBtn.click();\n await new Promise((resolve) => setTimeout(resolve, 200));\n } */\n }\n\n if(this.listLoader.next.length < 10) {\n setTimeout(() => {\n this.listLoader.load(true);\n }, 0);\n }\n\n // if(prevTarget && (!prevTarget.parentElement || !this.isElementVisible(this.targetContainer, prevTarget))) prevTarget = null;\n // if(nextTarget && (!nextTarget.parentElement || !this.isElementVisible(this.targetContainer, nextTarget))) nextTarget = null;\n\n this.buttons.prev.classList.toggle('hide', !this.listLoader.previous.length);\n this.buttons.next.classList.toggle('hide', !this.listLoader.next.length);\n\n const container = this.content.media;\n const useContainerAsTarget = !target || target === container;\n if(useContainerAsTarget) target = container;\n\n this.target = {element: target} as any;\n const tempId = ++this.tempId;\n\n if(container.firstElementChild) {\n container.replaceChildren();\n }\n\n // ok set\n\n const wasActive = fromRight !== 0;\n if(wasActive) {\n this.moveTheMover(this.content.mover, fromRight === 1);\n this.setNewMover();\n } else {\n this.navigationItem = {\n type: 'media',\n onPop: (canAnimate) => {\n if(this.setMoverAnimationPromise) {\n return false;\n }\n\n if(!canAnimate && IS_MOBILE_SAFARI) {\n this.wholeDiv.remove();\n }\n\n this.close();\n }\n };\n\n appNavigationController.pushItem(this.navigationItem);\n\n this.toggleOverlay(true);\n this.setGlobalListeners();\n await setAuthorPromise;\n\n if(!this.wholeDiv.parentElement) {\n this.pageEl.insertBefore(this.wholeDiv, document.getElementById('main-columns'));\n void this.wholeDiv.offsetLeft; // reflow\n }\n\n this.toggleWholeActive(true);\n }\n\n // //////this.log('wasActive:', wasActive);\n\n const mover = this.content.mover;\n\n const maxWidth = windowSize.width;\n // const maxWidth = this.pageEl.scrollWidth;\n // TODO: const maxHeight = mediaSizes.isMobile ? appPhotosManager.windowH : appPhotosManager.windowH - 100;\n let padding = 0;\n const windowH = windowSize.height;\n if(windowH < 1000000 && !mediaSizes.isMobile) {\n padding = 120;\n }\n const maxHeight = windowH - 120 - padding;\n let thumbPromise: Promise = Promise.resolve();\n const size = setAttachmentSize(media, container, maxWidth, maxHeight, mediaSizes.isMobile ? false : true, undefined, !!(isDocument && media.w && media.h)).photoSize;\n if(useContainerAsTarget) {\n const cacheContext = await this.managers.thumbsStorage.getCacheContext(media, size.type);\n let img: HTMLImageElement | HTMLCanvasElement;\n if(cacheContext.downloaded) {\n img = new Image();\n img.src = cacheContext.url;\n } else {\n const gotThumb = getStrippedThumbIfNeeded(media, cacheContext, true);\n if(gotThumb) {\n thumbPromise = gotThumb.loadPromise;\n img = gotThumb.image;\n }\n }\n\n if(img) {\n img.classList.add('thumbnail');\n container.append(img);\n }\n }\n\n // need after setAttachmentSize\n /* if(useContainerAsTarget) {\n target = target.querySelector('img, video') || target;\n } */\n\n const supportsStreaming: boolean = !!(isDocument && media.supportsStreaming);\n const preloader = supportsStreaming ? this.preloaderStreamable : this.preloader;\n\n const getCacheContext = (type = size?.type) => {\n return this.managers.thumbsStorage.getCacheContext(media, type);\n };\n\n let setMoverPromise: Promise;\n if(isVideo) {\n // //////this.log('will wrap video', media, size);\n\n // потому что для safari нужно создать элемент из event'а\n // const video = document.createElement('video');\n const useController = message && media.type !== 'gif';\n const video = /* useController ?\n appMediaPlaybackController.addMedia(message, false, true) as HTMLVideoElement :\n */createVideo({pip: useController});\n\n if(this.wholeDiv.classList.contains('no-forwards')) {\n video.addEventListener('contextmenu', cancelEvent);\n }\n\n const set = () => this.setMoverToTarget(target, false, fromRight).then(({onAnimationEnd}) => {\n // return; // set and don't move\n // if(wasActive) return;\n // return;\n\n const div = mover.firstElementChild && mover.firstElementChild.classList.contains('media-viewer-aspecter') ? mover.firstElementChild : mover;\n // const video = mover.querySelector('video') || document.createElement('video');\n\n const moverVideo = mover.querySelector('video');\n if(moverVideo) {\n moverVideo.remove();\n }\n\n // video.src = '';\n\n video.setAttribute('playsinline', 'true');\n\n // * fix for playing video if viewer is closed (https://contest.com/javascript-web-bonus/entry1425#issue11629)\n video.addEventListener('timeupdate', () => {\n if(this.tempId !== tempId) {\n video.pause();\n }\n });\n\n this.addEventListener('setMoverAfter', () => {\n video.src = '';\n video.load();\n }, {once: true});\n\n if(IS_SAFARI) {\n // test stream\n // video.controls = true;\n video.autoplay = true;\n }\n\n if(media.type === 'gif') {\n video.muted = true;\n video.autoplay = true;\n video.loop = true;\n } else if(media.duration < 60) {\n video.loop = true;\n }\n\n if(mediaTimestamp !== undefined) {\n video.currentTime = mediaTimestamp;\n }\n\n // if(!video.parentElement) {\n div.append(video);\n // }\n\n const canPlayThrough = new Promise((resolve) => {\n video.addEventListener('canplay', resolve, {once: true});\n });\n\n const createPlayer = () => {\n if(media.type !== 'gif') {\n video.dataset.ckin = 'default';\n video.dataset.overlay = '1';\n\n Promise.all([canPlayThrough, onAnimationEnd]).then(() => {\n if(this.tempId !== tempId) {\n return;\n }\n\n // const play = useController ? appMediaPlaybackController.willBePlayedMedia === video : true;\n const play = true;\n const player = this.videoPlayer = new VideoPlayer({\n video,\n play,\n streamable: supportsStreaming,\n onPlaybackRackMenuToggle: (open) => {\n this.wholeDiv.classList.toggle('hide-caption', !!open);\n },\n onPip: (pip) => {\n const otherMediaViewer = (window as any).appMediaViewer;\n if(!pip && otherMediaViewer && otherMediaViewer !== this) {\n this.releaseSingleMedia = undefined;\n this.close();\n return;\n }\n\n const mover = this.moversContainer.lastElementChild as HTMLElement;\n mover.classList.toggle('hiding', pip);\n this.toggleWholeActive(!pip);\n this.toggleOverlay(!pip);\n this.toggleGlobalListeners(!pip);\n\n if(this.navigationItem) {\n if(pip) appNavigationController.removeItem(this.navigationItem);\n else appNavigationController.pushItem(this.navigationItem);\n }\n\n if(useController) {\n if(pip) {\n // appMediaPlaybackController.toggleSwitchers(true);\n\n this.releaseSingleMedia(false);\n this.releaseSingleMedia = undefined;\n\n appMediaPlaybackController.setPictureInPicture(video);\n } else {\n this.releaseSingleMedia = appMediaPlaybackController.setSingleMedia(video, message as Message.message);\n }\n }\n },\n onPipClose: () => {\n // this.target = undefined;\n // this.toggleWholeActive(false);\n // this.toggleOverlay(false);\n this.close();\n }\n });\n player.addEventListener('toggleControls', (show) => {\n this.wholeDiv.classList.toggle('has-video-controls', show);\n });\n\n this.addEventListener('setMoverBefore', () => {\n this.wholeDiv.classList.remove('has-video-controls');\n this.videoPlayer.cleanup();\n this.videoPlayer = undefined;\n }, {once: true});\n\n if(this.isZooming) {\n this.videoPlayer.lockControls(false);\n }\n /* div.append(video);\n mover.append(player.wrapper); */\n });\n }\n };\n\n if(supportsStreaming) {\n onAnimationEnd.then(() => {\n if(video.readyState < video.HAVE_FUTURE_DATA) {\n // console.log('ppp 1');\n preloader.attach(mover, true);\n }\n\n /* canPlayThrough.then(() => {\n preloader.detach();\n }); */\n });\n\n const attachCanPlay = () => {\n video.addEventListener('canplay', () => {\n // console.log('ppp 2');\n preloader.detach();\n video.parentElement.classList.remove('is-buffering');\n }, {once: true});\n };\n\n video.addEventListener('waiting', () => {\n const loading = video.networkState === video.NETWORK_LOADING;\n const isntEnoughData = video.readyState < video.HAVE_FUTURE_DATA;\n\n // this.log('video waiting for progress', loading, isntEnoughData);\n if(loading && isntEnoughData) {\n attachCanPlay();\n\n // console.log('ppp 3');\n preloader.attach(mover, true);\n\n // поставлю класс для плеера, чтобы убрать большую иконку пока прелоадер на месте\n video.parentElement.classList.add('is-buffering');\n }\n });\n\n if(this.wholeDiv.classList.contains('no-forwards')) {\n video.addEventListener('contextmenu', (e) => {\n cancelEvent(e);\n });\n }\n\n attachCanPlay();\n }\n\n // if(!video.src || media.url !== video.src) {\n const load = async() => {\n /* if(useController) {\n appMediaPlaybackController.resolveWaitingForLoadMedia(message.peerId, message.mid, message.pFlags.is_scheduled);\n } */\n\n const promise: Promise = supportsStreaming ? Promise.resolve() : appDownloadManager.downloadMediaURL({media});\n\n if(!supportsStreaming) {\n onAnimationEnd.then(async() => {\n if(!(await getCacheContext()).url) {\n // console.log('ppp 4');\n preloader.attach(mover, true, promise);\n }\n });\n }\n\n Promise.all([promise, onAnimationEnd]).then(async() => {\n if(this.tempId !== tempId) {\n this.log.warn('media viewer changed video');\n return;\n }\n\n const url = (await getCacheContext()).url;\n\n video.addEventListener('error', () => {\n toastNew({\n langPackKey: IS_MOBILE ? 'Video.Unsupported.Mobile' : 'Video.Unsupported.Desktop'\n });\n\n if(video.error.code !== 4) {\n this.log.error('Error ' + video.error.code + '; details: ' + video.error.message);\n }\n\n preloader?.detach();\n }, {once: true});\n\n if(target instanceof SVGSVGElement/* && (video.parentElement || !isSafari) */) { // if video exists\n // if(!video.parentElement) {\n div.firstElementChild.lastElementChild.append(video);\n // }\n } else {\n renderImageFromUrl(video, url);\n }\n\n // * have to set options (especially playbackRate) after src\n // * https://github.com/videojs/video.js/issues/2516\n if(useController) {\n this.releaseSingleMedia = appMediaPlaybackController.setSingleMedia(video, message as Message.message);\n\n this.addEventListener('setMoverBefore', () => {\n if(this.releaseSingleMedia) {\n this.releaseSingleMedia();\n this.releaseSingleMedia = undefined;\n }\n }, {once: true});\n }\n\n this.updateMediaSource(target, url, 'video');\n\n createPlayer();\n });\n\n return promise;\n };\n\n this.lazyLoadQueue.unshift({load});\n // } else createPlayer();\n });\n\n setMoverPromise = thumbPromise.then(set);\n } else {\n const set = () => this.setMoverToTarget(target, false, fromRight).then(({onAnimationEnd}) => {\n // return; // set and don't move\n // if(wasActive) return;\n // return;\n\n const load = async() => {\n const cancellablePromise = isDocument ? appDownloadManager.downloadMediaURL({media}) : appDownloadManager.downloadMediaURL({media, thumb: size});\n\n const photoSizes = !isDocument && media.sizes.slice().filter((size) => (size as PhotoSize.photoSize).w) as PhotoSize.photoSize[];\n photoSizes && photoSizes.sort((a, b) => b.size - a.size);\n const fullPhotoSize = photoSizes?.[0];\n const cancellableFullPromise = !isDocument && fullPhotoSize !== size && appDownloadManager.downloadMediaURL({media, thumb: fullPhotoSize});\n\n onAnimationEnd.then(async() => {\n if(!(await getCacheContext()).url) {\n this.preloader.attachPromise(cancellablePromise);\n // this.preloader.attach(mover, true, cancellablePromise);\n }\n });\n\n Promise.all([onAnimationEnd, cancellablePromise]).then(async() => {\n if(this.tempId !== tempId) {\n this.log.warn('media viewer changed photo');\n return;\n }\n\n const url = (await getCacheContext()).url;\n if(target instanceof SVGSVGElement) {\n this.updateMediaSource(target, url, 'img');\n this.updateMediaSource(mover, url, 'img');\n\n if(mediaSizes.isMobile) {\n const imgs = mover.querySelectorAll('img');\n imgs.forEach((img) => {\n img.classList.remove('thumbnail'); // может здесь это вообще не нужно\n });\n }\n } else {\n const div = mover.firstElementChild && mover.firstElementChild.classList.contains('media-viewer-aspecter') ? mover.firstElementChild : mover;\n const haveImage = ['CANVAS', 'IMG'].includes(div.firstElementChild?.tagName) ? div.firstElementChild as HTMLElement : null;\n if((haveImage as HTMLImageElement)?.src !== url) {\n const image = new Image();\n image.classList.add('thumbnail');\n\n renderImageFromUrl(image, url, () => {\n fastRaf(() => {\n this.updateMediaSource(target, url, 'img');\n\n if(haveImage) {\n fastRaf(() => {\n haveImage.remove();\n });\n }\n\n div.append(image);\n });\n }, false);\n\n cancellableFullPromise && cancellableFullPromise.then((url) => {\n const fullImage = new Image();\n fullImage.classList.add('thumbnail');\n renderImageFromUrl(fullImage, url, () => {\n fastRaf(() => {\n image.replaceWith(fullImage);\n });\n }, false);\n });\n }\n }\n\n // this.preloader.detach();\n }).catch((err) => {\n this.log.error(err);\n this.preloader.attach(mover);\n this.preloader.setManual();\n });\n\n return cancellablePromise;\n };\n\n this.lazyLoadQueue.unshift({load});\n });\n\n setMoverPromise = thumbPromise.then(set);\n }\n\n return this.setMoverPromise = setMoverPromise.catch(() => {\n this.setMoverAnimationPromise = null;\n }).finally(() => {\n this.setMoverPromise = null;\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function fillPropertyValue(str: string) {\n const splitted = str.split(' ');\n if(splitted.length !== 4) {\n if(!splitted[0]) splitted[0] = '0px';\n for(let i = splitted.length; i < 4; ++i) {\n splitted[i] = splitted[i % 2] || splitted[0] || '0px';\n }\n }\n\n return splitted;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport {IS_MOBILE_SAFARI} from '../environment/userAgent';\nimport {logger} from '../lib/logger';\nimport blurActiveElement from '../helpers/dom/blurActiveElement';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport isSwipingBackSafari from '../helpers/dom/isSwipingBackSafari';\nimport indexOfAndSplice from '../helpers/array/indexOfAndSplice';\n\nexport type NavigationItem = {\n type: 'left' | 'right' | 'im' | 'chat' | 'popup' | 'media' | 'menu' |\n 'esg' | 'multiselect' | 'input-helper' | 'autocomplete-helper' | 'markup' |\n 'global-search' | 'voice' | 'mobile-search' | 'filters' | 'global-search-focus' |\n 'toast' | 'dropdown' | 'forum',\n onPop: (canAnimate: boolean) => boolean | void,\n onEscape?: () => boolean,\n noHistory?: boolean,\n noBlurOnPop?: boolean,\n};\n\nexport class AppNavigationController {\n private navigations: Array;\n private id: number;\n private manual: boolean;\n private log: ReturnType;\n private debug: boolean;\n private currentHash: string; // have to start with # if not empty\n private overriddenHash: string; // have to start with # if not empty\n private isPossibleSwipe: boolean;\n public onHashChange: () => void;\n\n constructor() {\n this.navigations = [];\n this.id = Date.now();\n this.manual = false;\n this.log = logger('NC');\n this.debug = true;\n this.currentHash = window.location.hash;\n this.overriddenHash = '';\n this.isPossibleSwipe = false;\n\n window.addEventListener('popstate', this.onPopState);\n window.addEventListener('keydown', this.onKeyDown, {capture: true, passive: false});\n\n if(IS_MOBILE_SAFARI) {\n const options = {passive: true};\n window.addEventListener('touchstart', this.onTouchStart, options);\n }\n\n history.scrollRestoration = 'manual';\n\n this.pushState(); // * push init state\n }\n\n private onPopState = (e: PopStateEvent) => {\n const hash = window.location.hash;\n const id: number = e.state;\n this.debug && this.log('popstate', e, this.isPossibleSwipe, hash);\n if(hash !== this.currentHash) {\n this.debug && this.log.warn(`hash changed, new=${hash}, current=${this.currentHash}, overridden=${this.overriddenHash}`);\n // fix for returning to wrong hash (e.g. chat -> archive -> chat -> 3x back)\n if(id === this.id && this.overriddenHash && this.overriddenHash !== hash) {\n this.overrideHash(this.overriddenHash);\n } else if(id/* === this.id */ && !this.overriddenHash && hash) {\n this.overrideHash();\n } else {\n this.currentHash = hash;\n this.onHashChange && this.onHashChange();\n // this.replaceState();\n return;\n }\n }\n\n if(id !== this.id/* && !this.navigations.length */) {\n this.pushState();\n\n if(!this.navigations.length) {\n return;\n }\n }\n\n const item = this.navigations.pop();\n if(!item) {\n this.pushState();\n return;\n }\n\n this.manual = !this.isPossibleSwipe;\n this.handleItem(item);\n // this.pushState(); // * prevent adding forward arrow\n };\n\n private onKeyDown = (e: KeyboardEvent) => {\n const item = this.navigations[this.navigations.length - 1];\n if(!item) return;\n if(e.key === 'Escape' && (item.onEscape ? item.onEscape() : true)) {\n cancelEvent(e);\n this.back(item.type);\n }\n };\n\n private onTouchStart = (e: TouchEvent) => {\n if(e.touches.length > 1) return;\n this.debug && this.log('touchstart');\n\n if(isSwipingBackSafari(e)) {\n this.isPossibleSwipe = true;\n\n window.addEventListener('touchend', () => {\n setTimeout(() => {\n this.isPossibleSwipe = false;\n }, 100);\n }, {passive: true, once: true});\n }\n\n /* const detach = () => {\n window.removeEventListener('touchend', onTouchEnd);\n window.removeEventListener('touchmove', onTouchMove);\n };\n\n let moved = false;\n const onTouchMove = (e: TouchEvent) => {\n this.debug && this.log('touchmove');\n if(e.touches.length > 1) {\n detach();\n return;\n }\n\n moved = true;\n };\n\n const onTouchEnd = (e: TouchEvent) => {\n this.debug && this.log('touchend');\n if(e.touches.length > 1 || !moved) {\n detach();\n return;\n }\n\n isPossibleSwipe = true;\n doubleRaf().then(() => {\n isPossibleSwipe = false;\n });\n\n detach();\n };\n\n window.addEventListener('touchend', onTouchEnd, options);\n window.addEventListener('touchmove', onTouchMove, options); */\n };\n\n public overrideHash(hash: string = '') {\n if(hash && hash[0] !== '#') hash = '#' + hash;\n else if(hash === '#') hash = '';\n\n if(this.currentHash === hash) {\n return;\n }\n\n this.overriddenHash = this.currentHash = hash;\n this.replaceState();\n this.pushState();\n }\n\n private handleItem(item: NavigationItem) {\n const good = item.onPop(!this.manual ? false : undefined);\n this.debug && this.log('popstate, navigation:', item, this.navigations);\n if(good === false) {\n this.pushItem(item);\n } else if(!item.noBlurOnPop) {\n blurActiveElement(); // no better place for it\n }\n\n this.manual = false;\n }\n\n public findItemByType(type: NavigationItem['type']) {\n for(let i = this.navigations.length - 1; i >= 0; --i) {\n const item = this.navigations[i];\n if(item.type === type) {\n return {item, index: i};\n }\n }\n }\n\n public back(type?: NavigationItem['type']) {\n if(type) {\n const ret = this.findItemByType(type);\n if(ret) {\n this.backByItem(ret.item, ret.index);\n return;\n }\n }\n\n history.back();\n }\n\n public backByItem(item: NavigationItem, index = this.navigations.indexOf(item)) {\n this.manual = true;\n // ! commented because 'popstate' event will be fired with delay\n // if(index !== (this.navigations.length - 1)) {\n this.navigations.splice(index, 1);\n this.handleItem(item);\n // }\n }\n\n private onItemAdded(item: NavigationItem) {\n this.debug && this.log('onItemAdded', item, this.navigations);\n\n if(!item.noHistory) {\n this.pushState();\n }\n }\n\n public pushItem(item: NavigationItem) {\n this.navigations.push(item);\n this.onItemAdded(item);\n }\n\n public unshiftItem(item: NavigationItem) {\n this.navigations.unshift(item);\n this.onItemAdded(item);\n }\n\n public spliceItems(index: number, length: number, ...items: NavigationItem[]) {\n this.navigations.splice(index, length, ...items);\n items.forEach((item) => {\n this.onItemAdded(item);\n });\n }\n\n private pushState() {\n this.debug && this.log('push');\n this.manual = false;\n history.pushState(this.id, '');\n }\n\n public replaceState() {\n this.debug && this.log.warn('replace');\n\n const url = location.origin + location.pathname + location.search + this.overriddenHash;\n history.replaceState(this.id, '', url);\n }\n\n public removeItem(item: NavigationItem) {\n if(!item) {\n return;\n }\n\n indexOfAndSplice(this.navigations, item);\n }\n\n public removeByType(type: NavigationItem['type'], single = false) {\n for(let i = this.navigations.length - 1; i >= 0; --i) {\n const item = this.navigations[i];\n if(item.type === type) {\n this.navigations.splice(i, 1);\n\n if(single) {\n break;\n }\n }\n }\n }\n}\n\nconst appNavigationController = new AppNavigationController();\nMOUNT_CLASS_TO.appNavigationController = appNavigationController;\nexport default appNavigationController;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appDialogsManager from '../lib/appManagers/appDialogsManager';\nimport Scrollable from './scrollable';\nimport InputSearch from './inputSearch';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport {i18n, LangPackKey} from '../lib/langPack';\nimport rootScope from '../lib/rootScope';\n\nexport class SearchGroup {\n container: HTMLDivElement;\n nameEl: HTMLDivElement;\n list: HTMLUListElement;\n\n constructor(\n public name: LangPackKey | boolean,\n public type: string,\n private clearable = true,\n className?: string,\n clickable = true,\n public autonomous = true,\n public onFound?: () => void,\n public noIcons?: boolean\n ) {\n this.list = appDialogsManager.createChatList();\n this.container = document.createElement('div');\n if(className) this.container.className = className;\n\n if(name) {\n this.nameEl = document.createElement('div');\n this.nameEl.classList.add('search-group__name');\n if(typeof(name) === 'string') {\n this.nameEl.append(i18n(name));\n }\n this.container.append(this.nameEl);\n }\n\n this.container.classList.add('search-group', 'search-group-' + type);\n this.container.append(this.list);\n this.container.style.display = 'none';\n\n if(clickable) {\n appDialogsManager.setListClickListener(this.list, onFound, undefined, autonomous);\n }\n }\n\n clear() {\n this.container.style.display = 'none';\n\n if(this.clearable) {\n this.list.innerHTML = '';\n }\n }\n\n setActive() {\n this.container.style.display = '';\n }\n\n toggle() {\n if(this.list.childElementCount) {\n this.setActive();\n } else {\n this.clear();\n }\n }\n}\n\nexport type SearchGroupType = 'contacts' | 'globalContacts' | 'messages' | string;\n\nexport default class AppSearch {\n private minMsgId = 0;\n private loadedCount = -1;\n private foundCount = -1;\n\n private searchPromise: Promise = null;\n private searchTimeout: number = 0;\n\n private query = '';\n\n private listsContainer: HTMLDivElement = null;\n\n private peerId: PeerId; // 0 - means global\n private threadId = 0;\n\n private scrollable: Scrollable;\n\n constructor(\n public container: HTMLElement,\n public searchInput: InputSearch,\n public searchGroups: {[group in SearchGroupType]: SearchGroup},\n public onSearch?: (count: number) => void,\n public noIcons?: boolean\n ) {\n this.scrollable = new Scrollable(this.container);\n this.listsContainer = this.scrollable.container as HTMLDivElement;\n for(const i in this.searchGroups) {\n this.listsContainer.append(this.searchGroups[i as SearchGroupType].container);\n }\n\n if(this.searchGroups.messages) {\n this.scrollable.setVirtualContainer(this.searchGroups.messages.list);\n }\n\n this.searchInput.onChange = (value) => {\n /* if(!value.trim()) {\n //this.peerId = 0;\n return;\n } */\n\n this.query = value;\n this.reset(false);\n this.searchMore();\n };\n\n this.scrollable.onScrolledBottom = () => {\n if(!this.query.trim()) return;\n\n if(!this.searchTimeout) {\n this.searchTimeout = window.setTimeout(() => {\n this.searchMore();\n this.searchTimeout = 0;\n }, 0);\n }\n };\n }\n\n public reset(all = true) {\n if(all) {\n this.searchInput.value = '';\n this.query = '';\n this.peerId = undefined;\n this.threadId = 0;\n }\n\n this.minMsgId = 0;\n this.loadedCount = -1;\n this.foundCount = -1;\n\n for(const i in this.searchGroups) {\n this.searchGroups[i as SearchGroupType].clear();\n }\n\n this.searchPromise = null;\n }\n\n public beginSearch(peerId?: PeerId, threadId = 0, query = '') {\n this.peerId = peerId;\n this.threadId = threadId;\n\n if(this.query !== query) {\n this.searchInput.inputField.value = query;\n }\n\n this.searchInput.input.focus();\n }\n\n public searchMore() {\n if(this.searchPromise) return this.searchPromise;\n\n const query = this.query;\n\n if(!query.trim()) {\n this.onSearch && this.onSearch(0);\n return;\n }\n\n if(this.foundCount !== -1 && this.loadedCount >= this.foundCount) {\n return Promise.resolve();\n }\n\n const maxId = this.minMsgId || 0;\n\n return this.searchPromise = rootScope.managers.appMessagesManager.getSearch({\n peerId: this.peerId,\n query,\n inputFilter: {_: 'inputMessagesFilterEmpty'},\n maxId,\n limit: 20,\n threadId: this.threadId\n }).then((res) => {\n this.searchPromise = null;\n\n if(this.searchInput.value !== query) {\n return;\n }\n\n // console.log('input search result:', this.peerId, query, null, maxId, 20, res);\n\n const {count, history} = res;\n\n if(history.length && history[0].mid === this.minMsgId) {\n history.shift();\n }\n\n const searchGroup = this.searchGroups.messages;\n\n history.forEach((message) => {\n try {\n const peerId = this.peerId ? message.fromId : message.peerId;\n appDialogsManager.addDialogAndSetLastMessage({\n peerId,\n container: this.scrollable/* searchGroup.list */,\n avatarSize: 'bigger',\n meAsSaved: false,\n message,\n query,\n noIcons: this.noIcons\n });\n } catch(err) {\n console.error('[appSearch] render search result', err);\n }\n });\n\n searchGroup.toggle();\n\n this.minMsgId = history.length && history[history.length - 1].mid;\n\n if(this.loadedCount === -1) {\n this.loadedCount = 0;\n }\n this.loadedCount += history.length;\n\n if(this.foundCount === -1) {\n this.foundCount = count;\n\n if(searchGroup.nameEl) {\n replaceContent(searchGroup.nameEl, i18n(count ? 'Chat.Search.MessagesFound' : 'Chat.Search.NoMessagesFound', [count]));\n }\n\n this.onSearch && this.onSearch(this.foundCount);\n }\n }).catch((err) => {\n console.error('search error', err);\n this.searchPromise = null;\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyInputMessagesFilter, MyMessage} from '../lib/appManagers/appMessagesManager';\nimport appDialogsManager, {DIALOG_LIST_ELEMENT_TAG} from '../lib/appManagers/appDialogsManager';\nimport {logger} from '../lib/logger';\nimport rootScope from '../lib/rootScope';\nimport {SearchGroup, SearchGroupType} from './appSearch';\nimport {horizontalMenu} from './horizontalMenu';\nimport LazyLoadQueue from './lazyLoadQueue';\nimport {putPreloader} from './putPreloader';\nimport ripple from './ripple';\nimport Scrollable, {ScrollableX} from './scrollable';\nimport useHeavyAnimationCheck, {getHeavyAnimationPromise} from '../hooks/useHeavyAnimationCheck';\nimport I18n, {LangPackKey, i18n} from '../lib/langPack';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport {getMiddleware, Middleware} from '../helpers/middleware';\nimport {ChannelParticipant, Chat, ChatFull, ChatParticipant, ChatParticipants, Document, Message, MessageMedia, Photo, User, WebPage} from '../layer';\nimport SortedUserList from './sortedUserList';\nimport findUpTag from '../helpers/dom/findUpTag';\nimport appSidebarRight from './sidebarRight';\nimport mediaSizes from '../helpers/mediaSizes';\nimport appImManager from '../lib/appManagers/appImManager';\nimport positionElementByIndex from '../helpers/dom/positionElementByIndex';\nimport cleanSearchText from '../helpers/cleanSearchText';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport handleTabSwipe from '../helpers/dom/handleTabSwipe';\nimport windowSize from '../helpers/windowSize';\nimport {formatPhoneNumber} from '../helpers/formatPhoneNumber';\nimport {ButtonMenuItemOptions, ButtonMenuSync} from './buttonMenu';\nimport PopupForward from './popups/forward';\nimport PopupDeleteMessages from './popups/deleteMessages';\nimport Row from './row';\nimport htmlToDocumentFragment from '../helpers/dom/htmlToDocumentFragment';\nimport {SearchSelection} from './chat/selection';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent, simulateClickEvent} from '../helpers/dom/clickEvent';\nimport {MyDocument} from '../lib/appManagers/appDocsManager';\nimport AppMediaViewer from './appMediaViewer';\nimport lockTouchScroll from '../helpers/dom/lockTouchScroll';\nimport copy from '../helpers/object/copy';\nimport getObjectKeysAndSort from '../helpers/object/getObjectKeysAndSort';\nimport safeAssign from '../helpers/object/safeAssign';\nimport escapeRegExp from '../helpers/string/escapeRegExp';\nimport findAndSplice from '../helpers/array/findAndSplice';\nimport {ScrollStartCallbackDimensions} from '../helpers/fastSmoothScroll';\nimport setInnerHTML from '../helpers/dom/setInnerHTML';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport choosePhotoSize from '../lib/appManagers/utils/photos/choosePhotoSize';\nimport wrapWebPageDescription from './wrappers/webPageDescription';\nimport wrapWebPageTitle from './wrappers/webPageTitle';\nimport wrapAbbreviation from '../lib/richTextProcessor/wrapAbbreviation';\nimport matchUrl from '../lib/richTextProcessor/matchUrl';\nimport wrapPlainText from '../lib/richTextProcessor/wrapPlainText';\nimport wrapRichText from '../lib/richTextProcessor/wrapRichText';\nimport wrapSenderToPeer from './wrappers/senderToPeer';\nimport wrapSentTime from './wrappers/sentTime';\nimport getMediaFromMessage from '../lib/appManagers/utils/messages/getMediaFromMessage';\nimport filterMessagesByInputFilter from '../lib/appManagers/utils/messages/filterMessagesByInputFilter';\nimport getChatMembersString from './wrappers/getChatMembersString';\nimport getUserStatusString from './wrappers/getUserStatusString';\nimport getParticipantPeerId from '../lib/appManagers/utils/chats/getParticipantPeerId';\nimport {Awaited} from '../types';\nimport {attachContextMenuListener} from '../helpers/dom/attachContextMenuListener';\nimport contextMenuController from '../helpers/contextMenuController';\nimport positionMenu from '../helpers/positionMenu';\nimport apiManagerProxy from '../lib/mtproto/mtprotoworker';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport SwipeHandler from './swipeHandler';\nimport wrapDocument from './wrappers/document';\nimport wrapPhoto from './wrappers/photo';\nimport wrapVideo from './wrappers/video';\nimport noop from '../helpers/noop';\nimport wrapMediaSpoiler, {onMediaSpoilerClick} from './wrappers/mediaSpoiler';\nimport filterAsync from '../helpers/array/filterAsync';\nimport ChatContextMenu from './chat/contextMenu';\nimport PopupElement from './popups';\n\n// const testScroll = false;\n\nexport type SearchSuperType = MyInputMessagesFilter/* | 'members' */;\nexport type SearchSuperContext = {\n peerId: PeerId,\n inputFilter: {_: MyInputMessagesFilter},\n query?: string,\n maxId?: number,\n folderId?: number,\n threadId?: number,\n date?: number,\n nextRate?: number,\n minDate?: number,\n maxDate?: number\n};\n\nexport type SearchSuperMediaType = 'members' | 'media' | 'files' | 'links' | 'music' | 'chats' | 'voice' | 'groups';\nexport type SearchSuperMediaTab = {\n inputFilter: SearchSuperType,\n name: LangPackKey,\n type: SearchSuperMediaType,\n contentTab?: HTMLElement,\n menuTab?: HTMLElement,\n scroll?: {scrollTop: number, scrollHeight: number}\n};\n\nclass SearchContextMenu {\n private buttons: (ButtonMenuItemOptions & {verify?: () => boolean | Promise, withSelection?: true})[];\n private element: HTMLElement;\n private target: HTMLElement;\n private peerId: PeerId;\n private mid: number;\n private isSelected: boolean;\n private managers: AppManagers;\n private noForwards: boolean;\n private message: MyMessage;\n private selectedMessages: MyMessage[];\n\n constructor(\n private attachTo: HTMLElement,\n private searchSuper: AppSearchSuper,\n private listenerSetter: ListenerSetter\n ) {\n this.managers = searchSuper.managers;\n\n const onContextMenu: Parameters[0]['callback'] = (e) => {\n if(this.init) {\n this.init();\n this.init = null;\n }\n\n let item: HTMLElement;\n try {\n item = findUpClassName(e.target, 'search-super-item');\n } catch(e) {}\n\n if(!item) return;\n\n if(e instanceof MouseEvent) e.preventDefault();\n if(this.element.classList.contains('active')) {\n return false;\n }\n if(e instanceof MouseEvent) e.cancelBubble = true;\n\n const r = async() => {\n this.target = item;\n this.peerId = item.dataset.peerId.toPeerId();\n this.mid = +item.dataset.mid;\n this.isSelected = searchSuper.selection.isMidSelected(this.peerId, this.mid);\n this.message = await this.managers.appMessagesManager.getMessageByPeer(this.peerId, this.mid);\n this.noForwards = searchSuper.selection.isSelecting ?\n this.searchSuper.selection.selectionForwardBtn.classList.contains('hide') :\n !(await this.managers.appMessagesManager.canForward(this.message));\n this.selectedMessages = searchSuper.selection.isSelecting ? await searchSuper.selection.getSelectedMessages() : undefined;\n\n await Promise.all(this.buttons.map(async(button) => {\n let good: boolean;\n\n if(this.searchSuper.selection.isSelecting && !button.withSelection) {\n good = false;\n } else {\n good = button.verify ? !!(await button.verify()) : true;\n }\n\n button.element.classList.toggle('hide', !good);\n }));\n\n item.classList.add('menu-open');\n\n positionMenu(e, this.element);\n contextMenuController.openBtnMenu(this.element, () => {\n item.classList.remove('menu-open');\n });\n };\n\n r();\n };\n\n if(IS_TOUCH_SUPPORTED) {\n\n } else {\n attachContextMenuListener({\n element: attachTo,\n callback: onContextMenu as any,\n listenerSetter\n });\n }\n }\n\n private init() {\n this.buttons = [{\n icon: 'forward',\n text: 'Forward',\n onClick: this.onForwardClick,\n verify: () => !this.noForwards\n }, {\n icon: 'forward',\n text: 'Message.Context.Selection.Forward',\n onClick: this.onForwardClick,\n verify: () => this.searchSuper.selection.isSelecting && !this.noForwards,\n withSelection: true\n }, {\n icon: 'download',\n text: 'MediaViewer.Context.Download',\n onClick: () => ChatContextMenu.onDownloadClick(this.message, this.noForwards),\n verify: () => !this.searchSuper.selection.isSelecting && ChatContextMenu.canDownload(this.message, undefined, this.noForwards)\n }, {\n icon: 'download',\n text: 'Message.Context.Selection.Download',\n onClick: () => ChatContextMenu.onDownloadClick(this.selectedMessages, this.noForwards),\n verify: () => this.searchSuper.selection.isSelecting && ChatContextMenu.canDownload(this.selectedMessages, undefined, this.noForwards),\n withSelection: true\n }, {\n icon: 'message',\n text: 'Message.Context.Goto',\n onClick: this.onGotoClick,\n withSelection: true\n }, {\n icon: 'select',\n text: 'Message.Context.Select',\n onClick: this.onSelectClick,\n verify: () => !this.isSelected,\n withSelection: true\n }, {\n icon: 'select',\n text: 'Message.Context.Selection.Clear',\n onClick: this.onClearSelectionClick,\n verify: () => this.isSelected,\n withSelection: true\n }, {\n icon: 'delete danger',\n text: 'Delete',\n onClick: this.onDeleteClick,\n verify: () => !this.searchSuper.selection.isSelecting && this.managers.appMessagesManager.canDeleteMessage(this.message)\n }, {\n icon: 'delete danger',\n text: 'Message.Context.Selection.Delete',\n onClick: this.onDeleteClick,\n verify: () => this.searchSuper.selection.isSelecting && !this.searchSuper.selection.selectionDeleteBtn.classList.contains('hide'),\n withSelection: true\n }];\n\n this.element = ButtonMenuSync({buttons: this.buttons, listenerSetter: this.listenerSetter});\n this.element.classList.add('search-contextmenu', 'contextmenu');\n document.getElementById('page-chats').append(this.element);\n }\n\n private onGotoClick = () => {\n appImManager.setInnerPeer({\n peerId: this.peerId,\n lastMsgId: this.mid,\n threadId: this.searchSuper.searchContext.threadId\n });\n };\n\n private onForwardClick = () => {\n if(this.searchSuper.selection.isSelecting) {\n simulateClickEvent(this.searchSuper.selection.selectionForwardBtn);\n } else {\n PopupElement.createPopup(PopupForward, {\n [this.peerId]: [this.mid]\n });\n }\n };\n\n private onSelectClick = () => {\n this.searchSuper.selection.toggleByElement(this.target);\n };\n\n private onClearSelectionClick = () => {\n this.searchSuper.selection.cancelSelection();\n };\n\n private onDeleteClick = () => {\n if(this.searchSuper.selection.isSelecting) {\n simulateClickEvent(this.searchSuper.selection.selectionDeleteBtn);\n } else {\n PopupElement.createPopup(PopupDeleteMessages, this.peerId, [this.mid], 'chat');\n }\n };\n}\n\nexport type ProcessSearchSuperResult = {\n message: Message.message,\n middleware: Middleware,\n promises: Promise[],\n elemsToAppend: {element: HTMLElement, message: any}[],\n inputFilter: MyInputMessagesFilter,\n searchGroup?: SearchGroup\n};\n\nexport default class AppSearchSuper {\n public tabs: {[t in SearchSuperType]: HTMLDivElement} = {} as any;\n\n public mediaTab: SearchSuperMediaTab;\n\n public container: HTMLElement;\n public nav: HTMLElement;\n public navScrollableContainer: HTMLDivElement;\n public tabsContainer: HTMLElement;\n public navScrollable: ScrollableX;\n private tabsMenu: HTMLElement;\n private prevTabId = -1;\n\n private lazyLoadQueue = new LazyLoadQueue();\n public middleware = getMiddleware();\n\n public historyStorage: Partial<{[type in SearchSuperType]: {mid: number, peerId: PeerId}[]}> = {};\n public usedFromHistory: Partial<{[type in SearchSuperType]: number}> = {};\n\n public searchContext: SearchSuperContext;\n public loadMutex: Promise = Promise.resolve();\n\n private nextRates: Partial<{[type in SearchSuperType]: number}> = {};\n private loadPromises: Partial<{[type in SearchSuperType]: Promise}> = {};\n private loaded: Partial<{[type in SearchSuperType]: boolean}> = {};\n private loadedChats = false;\n private firstLoad = true;\n\n private log = logger('SEARCH-SUPER');\n public selectTab: ReturnType;\n\n private monthContainers: Partial<{\n [type in SearchSuperType]: {\n [timestamp: number]: {\n container: HTMLElement,\n items: HTMLElement\n }\n }\n }> = {};\n\n private searchGroupMedia: SearchGroup;\n\n public mediaTabsMap: Map = new Map();\n\n private membersList: SortedUserList;\n\n private skipScroll: boolean;\n\n // * arguments\n public mediaTabs: SearchSuperMediaTab[];\n public scrollable: Scrollable;\n public searchGroups?: {[group in SearchGroupType]: SearchGroup};\n public asChatList? = false;\n public groupByMonth? = true;\n public hideEmptyTabs? = true;\n public onChangeTab?: (mediaTab: SearchSuperMediaTab) => void;\n public showSender? = false;\n\n private searchContextMenu: SearchContextMenu;\n public selection: SearchSelection;\n\n public scrollStartCallback: (dimensions: ScrollStartCallbackDimensions) => void;\n\n public managers: AppManagers;\n private loadFirstTimePromise: Promise;\n\n private listenerSetter: ListenerSetter;\n private swipeHandler: SwipeHandler;\n\n constructor(options: Pick) {\n safeAssign(this, options);\n\n this.container = document.createElement('div');\n this.container.classList.add('search-super');\n\n this.listenerSetter = new ListenerSetter();\n this.searchContextMenu = new SearchContextMenu(this.container, this, this.listenerSetter);\n this.selection = new SearchSelection(this, this.managers, this.listenerSetter);\n\n const navScrollableContainer = this.navScrollableContainer = document.createElement('div');\n navScrollableContainer.classList.add('search-super-tabs-scrollable', 'menu-horizontal-scrollable', 'sticky');\n\n const navScrollable = this.navScrollable = new ScrollableX(navScrollableContainer);\n navScrollable.container.classList.add('search-super-nav-scrollable');\n\n const nav = this.nav = document.createElement('nav');\n nav.classList.add('search-super-tabs', 'menu-horizontal-div');\n this.tabsMenu = nav;\n\n navScrollable.container.append(nav);\n\n for(const mediaTab of this.mediaTabs) {\n const menuTab = document.createElement('div');\n menuTab.classList.add('menu-horizontal-div-item');\n const span = document.createElement('span');\n const i = document.createElement('i');\n\n span.append(i18n(mediaTab.name));\n span.append(i);\n\n menuTab.append(span);\n\n ripple(menuTab);\n\n this.tabsMenu.append(menuTab);\n\n this.mediaTabsMap.set(mediaTab.type, mediaTab);\n\n mediaTab.menuTab = menuTab;\n }\n\n this.tabsContainer = document.createElement('div');\n this.tabsContainer.classList.add('search-super-tabs-container', 'tabs-container');\n\n let unlockScroll: ReturnType;\n if(IS_TOUCH_SUPPORTED) {\n this.swipeHandler = handleTabSwipe({\n element: this.tabsContainer,\n onSwipe: (xDiff, yDiff, e) => {\n xDiff *= -1;\n yDiff *= -1;\n const prevId = this.selectTab.prevId();\n const children = Array.from(this.tabsMenu.children) as HTMLElement[];\n let idx: number;\n if(xDiff > 0) {\n for(let i = prevId + 1; i < children.length; ++i) {\n if(!children[i].classList.contains('hide')) {\n idx = i;\n break;\n }\n }\n } else {\n for(let i = prevId - 1; i >= 0; --i) {\n if(!children[i].classList.contains('hide')) {\n idx = i;\n break;\n }\n }\n }\n\n if(idx !== undefined) {\n unlockScroll = lockTouchScroll(this.tabsContainer);\n this.selectTab(idx);\n }\n },\n verifyTouchTarget: (e) => {\n return !findUpClassName(e.target, 'scrollable-x');\n }\n });\n }\n\n for(const mediaTab of this.mediaTabs) {\n const container = document.createElement('div');\n container.classList.add('search-super-container-' + mediaTab.type, 'tabs-tab');\n\n const content = document.createElement('div');\n content.classList.add('search-super-content-' + mediaTab.type);\n\n container.append(content);\n\n this.tabsContainer.append(container);\n\n this.tabs[mediaTab.inputFilter] = content;\n\n mediaTab.contentTab = content;\n }\n\n this.container.append(navScrollableContainer, this.tabsContainer);\n\n // * construct end\n\n this.searchGroupMedia = new SearchGroup(false, 'messages', true);\n\n this.scrollable.onScrolledBottom = () => {\n if(this.mediaTab.contentTab && this.canLoadMediaTab(this.mediaTab)/* && false */) {\n // this.log('onScrolledBottom will load media');\n this.load(true);\n }\n };\n // this.scroll.attachSentinels(undefined, 400);\n\n this.selectTab = horizontalMenu(this.tabsMenu, this.tabsContainer, (id, tabContent, animate) => {\n if(this.prevTabId === id && !this.skipScroll) {\n this.scrollable.scrollIntoViewNew({\n element: this.container,\n position: 'start',\n startCallback: this.scrollStartCallback\n });\n return;\n }\n\n const newMediaTab = this.mediaTabs[id];\n if(this.onChangeTab) {\n this.onChangeTab(newMediaTab);\n }\n\n const fromMediaTab = this.mediaTab;\n this.mediaTab = newMediaTab;\n\n if(this.prevTabId !== -1 && animate) {\n this.onTransitionStart();\n }\n\n if(this.skipScroll) {\n this.skipScroll = false;\n } else {\n const offsetTop = this.container.offsetTop;\n let scrollTop = this.scrollable.scrollTop;\n if(scrollTop < offsetTop) {\n this.scrollable.scrollIntoViewNew({\n element: this.container,\n position: 'start',\n startCallback: this.scrollStartCallback\n });\n scrollTop = offsetTop;\n }\n\n fromMediaTab.scroll = {scrollTop: scrollTop, scrollHeight: this.scrollable.scrollHeight};\n\n if(newMediaTab.scroll === undefined) {\n const rect = this.container.getBoundingClientRect();\n const rect2 = this.container.parentElement.getBoundingClientRect();\n const diff = rect.y - rect2.y;\n\n if(scrollTop > diff) {\n newMediaTab.scroll = {scrollTop: diff, scrollHeight: 0};\n }\n }\n\n if(newMediaTab.scroll) {\n const diff = fromMediaTab.scroll.scrollTop - newMediaTab.scroll.scrollTop;\n // console.log('what you gonna do', this.goingHard, diff);\n\n // this.scrollable.scrollTop = scrollTop;\n if(diff/* && diff < 0 */) {\n /* if(diff > -(fromMediaTab.contentTab.scrollHeight + this.nav.scrollHeight)) {\n fromMediaTab.contentTab.style.transform = `translateY(${diff}px)`;\n this.scrollable.scrollTop = scrollTop - diff;\n } else { */\n newMediaTab.contentTab.style.transform = `translateY(${diff}px)`;\n // }\n }\n }\n }\n\n /* if(this.prevTabId !== -1 && nav.offsetTop) {\n this.scrollable.scrollTop -= nav.offsetTop;\n } */\n\n /* this.log('setVirtualContainer', id, this.sharedMediaSelected, this.sharedMediaSelected.childElementCount);\n this.scroll.setVirtualContainer(this.sharedMediaSelected); */\n\n if(this.prevTabId !== -1 && !newMediaTab.contentTab.childElementCount) { // quick brown fix\n // this.contentContainer.classList.remove('loaded');\n this.load(true);\n }\n\n this.prevTabId = id;\n }, () => {\n this.scrollable.onScroll();\n\n // console.log('what y', this.tabSelected.style.transform);\n if(this.mediaTab.scroll !== undefined) {\n this.mediaTab.contentTab.style.transform = '';\n this.scrollable.scrollTop = this.mediaTab.scroll.scrollTop;\n }\n\n if(unlockScroll) {\n unlockScroll();\n unlockScroll = undefined;\n }\n\n this.onTransitionEnd();\n }, undefined, navScrollable, this.listenerSetter);\n\n attachClickEvent(this.tabsContainer, (e) => {\n if(this.selection.isSelecting) {\n cancelEvent(e);\n this.selection.toggleByElement(findUpClassName(e.target, 'search-super-item'));\n }\n }, {capture: true, passive: false, listenerSetter: this.listenerSetter});\n\n const onMediaClick = async(className: string, targetClassName: string, inputFilter: MyInputMessagesFilter, e: MouseEvent) => {\n const target = findUpClassName(e.target as HTMLDivElement, className);\n if(!target) return;\n\n const mid = +target.dataset.mid;\n if(!mid) {\n this.log.warn('no messageId by click on target:', target);\n return;\n }\n\n const mediaSpoiler: HTMLElement = target.querySelector('.media-spoiler-container');\n if(mediaSpoiler) {\n onMediaSpoilerClick({\n event: e,\n mediaSpoiler\n })\n return;\n }\n\n const peerId = target.dataset.peerId.toPeerId();\n\n const targets = (Array.from(this.tabs[inputFilter].querySelectorAll('.' + targetClassName)) as HTMLElement[]).map((el) => {\n const containerEl = findUpClassName(el, className);\n return {\n element: el,\n mid: +containerEl.dataset.mid,\n peerId: containerEl.dataset.peerId.toPeerId()\n };\n });\n\n // const ids = Object.keys(this.mediaDivsByIds).map((k) => +k).sort((a, b) => a - b);\n const idx = targets.findIndex((item) => item.mid === mid && item.peerId === peerId);\n\n const message = await this.managers.appMessagesManager.getMessageByPeer(peerId, mid);\n new AppMediaViewer()\n .setSearchContext(this.copySearchContext(inputFilter))\n .openMedia({\n message,\n target: targets[idx].element,\n fromRight: 0,\n reverse: false,\n prevTargets: targets.slice(0, idx),\n nextTargets: targets.slice(idx + 1)\n });\n };\n\n attachClickEvent(this.tabs.inputMessagesFilterPhotoVideo, onMediaClick.bind(null, 'grid-item', 'grid-item', 'inputMessagesFilterPhotoVideo'), {listenerSetter: this.listenerSetter});\n attachClickEvent(this.tabs.inputMessagesFilterDocument, onMediaClick.bind(null, 'document-with-thumb', 'media-container', 'inputMessagesFilterDocument'), {listenerSetter: this.listenerSetter});\n\n /* attachClickEvent(this.tabs.inputMessagesFilterUrl, (e) => {\n const target = e.target as HTMLElement;\n if(target.tagName === 'A') {\n return;\n }\n\n try {\n const a = findUpClassName(target, 'row').querySelector('.anchor-url:last-child') as HTMLAnchorElement;\n a.click();\n } catch(err) {}\n }); */\n\n this.mediaTab = this.mediaTabs[0];\n\n useHeavyAnimationCheck(() => {\n this.lazyLoadQueue.lock();\n }, () => {\n this.lazyLoadQueue.unlockAndRefresh(); // ! maybe not so efficient\n }, this.listenerSetter);\n }\n\n private onTransitionStart = () => {\n this.container.classList.add('sliding');\n };\n\n private onTransitionEnd = () => {\n this.container.classList.remove('sliding');\n };\n\n public filterMessagesByType(messages: any[], type: SearchSuperType): MyMessage[] {\n return filterMessagesByInputFilter(type, messages, messages.length);\n }\n\n private processEmptyFilter({message, searchGroup}: ProcessSearchSuperResult) {\n const loadPromises: Promise[] = [];\n const dialogElement = appDialogsManager.addDialogNew({\n peerId: message.peerId,\n container: searchGroup.list,\n avatarSize: 'bigger',\n loadPromises\n });\n\n const setLastMessagePromise = appDialogsManager.setLastMessageN({\n dialog: {\n _: 'dialog',\n peerId: message.peerId\n } as any,\n lastMessage: message,\n dialogElement,\n highlightWord: this.searchContext.query\n });\n\n loadPromises.push(setLastMessagePromise);\n return Promise.all(loadPromises).then(noop);\n }\n\n private async processPhotoVideoFilter({message, promises, middleware}: ProcessSearchSuperResult) {\n const media = getMediaFromMessage(message, true);\n\n const div = document.createElement('div');\n div.classList.add('grid-item');\n // this.log(message, photo);\n\n let wrapped: Awaited>;\n const size = choosePhotoSize(media, 200, 200);\n if(media._ !== 'photo') {\n wrapped = await (await wrapVideo({\n doc: media,\n message,\n container: div,\n boxWidth: 0,\n boxHeight: 0,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware,\n onlyPreview: true,\n withoutPreloader: true,\n noPlayButton: true,\n photoSize: size\n })).thumb;\n } else {\n wrapped = await wrapPhoto({\n photo: media,\n message,\n container: div,\n boxWidth: 0,\n boxHeight: 0,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware,\n withoutPreloader: true,\n noBlur: true,\n size\n });\n }\n\n if((message.media as MessageMedia.messageMediaPhoto).pFlags.spoiler) {\n const mediaSpoiler = await wrapMediaSpoiler({\n animationGroup: 'chat',\n media,\n middleware,\n width: 140,\n height: 140,\n multiply: 0.3\n });\n\n div.append(mediaSpoiler);\n }\n\n [\n wrapped.images.thumb,\n wrapped.images.full\n ].filter(Boolean).forEach((image) => {\n image.classList.add('grid-item-media');\n });\n\n promises.push(wrapped.loadPromises.thumb);\n\n return {element: div, message};\n }\n\n private async processDocumentFilter({message, inputFilter}: ProcessSearchSuperResult) {\n const document = getMediaFromMessage(message, true) as Document.document;\n const showSender = this.showSender || (['voice', 'round'] as MyDocument['type'][]).includes(document.type);\n\n const div = await wrapDocument({\n message,\n withTime: !showSender,\n fontWeight: 400,\n voiceAsMusic: true,\n showSender,\n searchContext: this.copySearchContext(inputFilter),\n lazyLoadQueue: this.lazyLoadQueue,\n autoDownloadSize: 0,\n getSize: () => 320\n });\n\n if((['audio', 'voice', 'round'] as MyDocument['type'][]).includes(document.type)) {\n div.classList.add('audio-48');\n }\n\n return {message, element: div};\n }\n\n private async processUrlFilter({message, promises, middleware}: ProcessSearchSuperResult) {\n let webPage = (message.media as MessageMedia.messageMediaWebPage)?.webpage as WebPage.webPage | WebPage.webPageEmpty;\n\n if(!webPage) {\n const entity = message.totalEntities ? message.totalEntities.find((e: any) => e._ === 'messageEntityUrl' || e._ === 'messageEntityTextUrl') : null;\n let url: string, display_url: string, sliced: string;\n\n if(!entity) {\n const match = matchUrl(message.message);\n if(!match) {\n return;\n }\n\n url = match[0];\n } else {\n sliced = message.message.slice(entity.offset, entity.offset + entity.length);\n }\n\n if(entity?._ === 'messageEntityTextUrl') {\n url = entity.url;\n // display_url = sliced;\n } else {\n url = url || sliced;\n }\n\n display_url = url;\n\n const same = message.message === url;\n if(!url.match(/^(ftp|http|https):\\/\\//)) {\n display_url = 'https://' + url;\n url = url.includes('@') ? url : 'https://' + url;\n }\n\n display_url = new URL(display_url).hostname;\n\n webPage = {\n _: 'webPage',\n url,\n display_url,\n id: '',\n hash: 0\n };\n\n if(!same) {\n webPage.description = message.message;\n }\n }\n\n if(webPage._ === 'webPageEmpty') {\n return;\n }\n\n const previewDiv = document.createElement('div');\n previewDiv.classList.add('preview');\n\n // this.log('wrapping webpage', webpage);\n\n if(webPage.photo) {\n const res = wrapPhoto({\n container: previewDiv,\n message: null,\n photo: webPage.photo as Photo.photo,\n boxWidth: 0,\n boxHeight: 0,\n withoutPreloader: true,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware,\n size: choosePhotoSize(webPage.photo as Photo.photo, 60, 60, false),\n loadPromises: promises,\n noBlur: true\n });\n } else {\n previewDiv.classList.add('empty');\n setInnerHTML(previewDiv, wrapAbbreviation(webPage.title || webPage.display_url || webPage.description || webPage.url, true));\n }\n\n const title = wrapWebPageTitle(webPage);\n\n const subtitleFragment = wrapWebPageDescription(webPage);\n const aFragment = htmlToDocumentFragment(wrapRichText(webPage.url || ''));\n const a = aFragment.firstElementChild;\n if(a instanceof HTMLAnchorElement) {\n try { // can have 'URIError: URI malformed'\n a.innerText = decodeURIComponent(a.href);\n } catch(err) {\n\n }\n }\n\n if(subtitleFragment.firstChild) {\n subtitleFragment.append('\\n');\n }\n\n subtitleFragment.append(a);\n\n if(this.showSender) {\n subtitleFragment.append('\\n', await wrapSenderToPeer(message));\n }\n\n if(!title.textContent) {\n // title = new URL(webpage.url).hostname;\n title.append(wrapPlainText(webPage.display_url.split('/', 1)[0]));\n }\n\n const row = new Row({\n title,\n titleRight: wrapSentTime(message),\n subtitle: subtitleFragment,\n havePadding: true,\n clickable: true,\n noRipple: true\n });\n\n row.applyMediaElement(previewDiv, 'big');\n\n if(row.container.innerText.trim().length) {\n return {message, element: row.container};\n }\n }\n\n public async performSearchResult(messages: any[], mediaTab: SearchSuperMediaTab, append = true) {\n const elemsToAppend: {element: HTMLElement, message: any}[] = [];\n const sharedMediaDiv: HTMLElement = mediaTab.contentTab;\n const promises: Promise[] = [];\n const middleware = this.middleware.get();\n let inputFilter = mediaTab.inputFilter;\n\n await getHeavyAnimationPromise();\n\n let searchGroup: SearchGroup;\n if(inputFilter === 'inputMessagesFilterPhotoVideo' && !!this.searchContext.query.trim()) {\n inputFilter = 'inputMessagesFilterEmpty';\n searchGroup = this.searchGroupMedia;\n sharedMediaDiv.append(searchGroup.container);\n } else if(inputFilter === 'inputMessagesFilterEmpty') {\n searchGroup = this.searchGroups.messages;\n }\n\n const options: ProcessSearchSuperResult = {\n elemsToAppend,\n inputFilter,\n message: undefined,\n middleware,\n promises,\n searchGroup\n };\n\n let processCallback: (options: ProcessSearchSuperResult) => any;\n\n // https://core.telegram.org/type/MessagesFilter\n switch(inputFilter) {\n case 'inputMessagesFilterEmpty': {\n processCallback = this.processEmptyFilter;\n break;\n }\n\n case 'inputMessagesFilterPhotoVideo': {\n processCallback = this.processPhotoVideoFilter;\n break;\n }\n\n case 'inputMessagesFilterVoice':\n case 'inputMessagesFilterRoundVoice':\n case 'inputMessagesFilterMusic':\n case 'inputMessagesFilterDocument': {\n processCallback = this.processDocumentFilter;\n break;\n }\n\n case 'inputMessagesFilterUrl': {\n processCallback = this.processUrlFilter;\n break;\n }\n\n default:\n // this.log.warn('death is my friend', messages);\n break;\n }\n\n if(processCallback) {\n processCallback = processCallback.bind(this);\n\n type K = {element: HTMLElement, message: Message.message | Message.messageService};\n const results: (Promise | K)[] = messages.map(async(message) => {\n try {\n options.message = message;\n return await processCallback(options);\n } catch(err) {\n this.log.error('error rendering filter', inputFilter, options, message, err);\n }\n });\n\n const awaited = (await Promise.all(results)).filter(Boolean);\n elemsToAppend.push(...awaited);\n }\n\n if(searchGroup && searchGroup.list.childElementCount) {\n searchGroup.setActive();\n }\n\n if(this.loadMutex) {\n promises.push(this.loadMutex);\n }\n\n if(promises.length) {\n await Promise.all(promises);\n if(!middleware()) {\n // this.log.warn('peer changed');\n return;\n }\n }\n\n if(elemsToAppend.length) {\n const method = append ? 'append' : 'prepend';\n elemsToAppend.forEach((details) => {\n const {element, message} = details;\n if(!message) {\n debugger;\n }\n\n const monthContainer = this.getMonthContainerByTimestamp(this.groupByMonth ? message.date : 0, inputFilter);\n element.classList.add('search-super-item');\n element.dataset.mid = '' + message.mid;\n element.dataset.peerId = '' + message.peerId;\n monthContainer.items[method](element);\n\n if(this.selection?.isSelecting) {\n this.selection.toggleElementCheckbox(element, true);\n }\n });\n }\n\n // if(type !== 'inputMessagesFilterEmpty') {\n this.afterPerforming(inputFilter === 'inputMessagesFilterEmpty' ? 1 : elemsToAppend.length, sharedMediaDiv);\n // }\n }\n\n private afterPerforming(length: number, contentTab: HTMLElement) {\n if(contentTab) {\n const parent = contentTab.parentElement;\n Array.from(parent.children).slice(1).forEach((child) => {\n child.remove();\n });\n\n // this.contentContainer.classList.add('loaded');\n\n if(!length && !contentTab.childElementCount) {\n const div = document.createElement('div');\n div.innerText = 'Nothing interesting here yet...';\n div.classList.add('position-center', 'text-center', 'content-empty', 'no-select');\n\n parent.append(div);\n }\n }\n }\n\n private loadChats() {\n const renderedPeerIds: Set = new Set();\n const middleware = this.middleware.get();\n\n for(const i in this.searchGroups) {\n const group = this.searchGroups[i as SearchGroupType];\n this.tabs.inputMessagesFilterEmpty.append(group.container);\n group.clear();\n }\n\n const query = this.searchContext.query;\n if(query) {\n const setResults = (results: PeerId[], group: SearchGroup, showMembersCount = false) => {\n results.map((peerId) => {\n if(renderedPeerIds.has(peerId)) {\n return;\n }\n\n renderedPeerIds.add(peerId);\n\n const {dom} = appDialogsManager.addDialogNew({\n peerId: peerId,\n container: group.list,\n avatarSize: 'abitbigger',\n autonomous: group.autonomous\n });\n\n return {dom, peerId};\n }).filter(Boolean).forEach(async({dom, peerId}) => {\n const peer = await this.managers.appPeersManager.getPeer(peerId);\n if(showMembersCount && ((peer as Chat.channel).participants_count || (peer as any).participants)) {\n const regExp = new RegExp(`(${escapeRegExp(query)}|${escapeRegExp(cleanSearchText(query))})`, 'gi');\n dom.titleSpan.innerHTML = dom.titleSpan.innerHTML.replace(regExp, '$1');\n dom.lastMessageSpan.append(await getChatMembersString(peerId.toChatId()));\n } else if(peerId === rootScope.myId) {\n dom.lastMessageSpan.append(i18n('Presence.YourChat'));\n } else {\n let username = await this.managers.appPeersManager.getPeerUsername(peerId);\n if(!username) {\n const user = await this.managers.appUsersManager.getUser(peerId);\n if(user && user.phone) {\n username = '+' + formatPhoneNumber(user.phone).formatted;\n }\n } else {\n username = '@' + username;\n }\n\n dom.lastMessageSpan.textContent = username;\n }\n });\n\n group.toggle();\n };\n\n const onLoad = (arg: T) => {\n if(!middleware()) {\n return;\n }\n\n // this.loadedContacts = true;\n\n return arg;\n };\n\n return Promise.all([\n this.managers.appUsersManager.getContactsPeerIds(query, true, undefined, 10)\n .then(onLoad)\n .then((contacts) => {\n if(contacts) {\n setResults(contacts, this.searchGroups.contacts, true);\n }\n }),\n\n this.managers.appUsersManager.searchContacts(query, 20)\n .then(onLoad)\n .then((contacts) => {\n if(contacts) {\n setResults(contacts.my_results, this.searchGroups.contacts, true);\n setResults(contacts.results/* .concat(contacts.results, contacts.results, contacts.results) */, this.searchGroups.globalContacts);\n\n this.searchGroups.globalContacts.container.classList.add('is-short');\n\n if(this.searchGroups.globalContacts.nameEl.lastElementChild !== this.searchGroups.globalContacts.nameEl.firstElementChild) {\n this.searchGroups.globalContacts.nameEl.lastElementChild.remove();\n }\n\n if(this.searchGroups.globalContacts.list.childElementCount > 3) {\n const showMore = document.createElement('div');\n showMore.classList.add('search-group__show-more');\n const intlElement = new I18n.IntlElement({\n key: 'Separator.ShowMore'\n });\n showMore.append(intlElement.element);\n this.searchGroups.globalContacts.nameEl.append(showMore);\n attachClickEvent(showMore, () => {\n const isShort = this.searchGroups.globalContacts.container.classList.toggle('is-short');\n intlElement.key = isShort ? 'Separator.ShowMore' : 'Separator.ShowLess';\n intlElement.update();\n });\n }\n }\n }),\n\n this.managers.dialogsStorage.getDialogs({query, offsetIndex: 0, limit: 20, filterId: 0})\n .then(onLoad)\n .then((value) => {\n if(value) {\n setResults(value.dialogs.map((d) => d.peerId), this.searchGroups.contacts, true);\n }\n })\n ]);\n } else if(!this.searchContext.peerId && !this.searchContext.minDate) {\n const renderRecentSearch = (setActive = true) => {\n return apiManagerProxy.getState().then((state) => {\n if(!middleware()) {\n return;\n }\n\n this.searchGroups.recent.list.replaceChildren();\n\n state.recentSearch.slice(0, 20).forEach(async(peerId) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: peerId,\n container: this.searchGroups.recent.list,\n meAsSaved: true,\n avatarSize: 'abitbigger',\n autonomous: true\n });\n\n dom.lastMessageSpan.append(await (peerId.isUser() ?\n getUserStatusString(await this.managers.appUsersManager.getUser(peerId.toUserId())) :\n getChatMembersString(peerId.toChatId())));\n });\n\n if(!state.recentSearch.length) {\n this.searchGroups.recent.clear();\n } else if(setActive) {\n this.searchGroups.recent.setActive();\n }\n });\n };\n\n return Promise.all([\n this.managers.appUsersManager.getTopPeers('correspondents').then((peers) => {\n if(!middleware()) return;\n\n const idx = peers.findIndex((peer) => peer.id === rootScope.myId);\n if(idx !== -1) {\n peers = peers.slice();\n peers.splice(idx, 1);\n }\n\n peers.forEach((peer) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: peer.id,\n container: this.searchGroups.people.list,\n onlyFirstName: true,\n avatarSize: 'bigger',\n autonomous: false,\n noIcons: this.searchGroups.people.noIcons\n });\n\n dom.subtitleEl.remove();\n });\n\n this.searchGroups.people.toggle();\n }),\n\n renderRecentSearch()\n ]);\n } else return Promise.resolve();\n }\n\n private async loadMembers(mediaTab: SearchSuperMediaTab) {\n const chatId = mediaTab.type === 'members' ? this.searchContext.peerId.toChatId() : undefined;\n const userId = mediaTab.type === 'groups' ? this.searchContext.peerId.toUserId() : undefined;\n const middleware = this.middleware.get();\n let promise: Promise;\n\n const renderParticipants = async(participants: (ChatParticipant | ChannelParticipant | Chat)[]) => {\n if(this.loadMutex) {\n await this.loadMutex;\n\n if(!middleware()) {\n return;\n }\n }\n\n let membersList = this.membersList;\n if(!membersList) {\n membersList = this.membersList = new SortedUserList({\n lazyLoadQueue: this.lazyLoadQueue,\n rippleEnabled: false,\n managers: this.managers\n });\n attachClickEvent(membersList.list, (e) => {\n const li = findUpTag(e.target, DIALOG_LIST_ELEMENT_TAG);\n if(!li) {\n return;\n }\n\n const peerId = li.dataset.peerId.toPeerId();\n let promise: Promise = Promise.resolve();\n if(mediaSizes.isMobile) {\n promise = appSidebarRight.toggleSidebar(false);\n }\n\n promise.then(() => {\n appImManager.setInnerPeer({peerId});\n });\n });\n mediaTab.contentTab.append(membersList.list);\n this.afterPerforming(1, mediaTab.contentTab);\n }\n\n const peerIds = participants.map((participant) => {\n const peerId = userId ? (participant as Chat.chat).id.toPeerId(true) : getParticipantPeerId(participant as ChannelParticipant);\n if(chatId ? peerId.isAnyChat() : peerId.isUser()) {\n return;\n }\n\n return peerId;\n }).filter(Boolean);\n\n const filtered = await filterAsync(peerIds, async(peerId) => {\n const peer: User | Chat = await this.managers.appPeersManager.getPeer(peerId);\n if(!middleware()) {\n return false;\n }\n\n if(!peer || (peer as User.user).pFlags.deleted) {\n return false;\n }\n\n return true;\n });\n\n for(const peerId of filtered) {\n membersList.add(peerId);\n }\n };\n\n if(userId) {\n const LOAD_COUNT = !this.membersList ? 50 : 200;\n promise = this.managers.appUsersManager.getCommonChats(userId, LOAD_COUNT, this.nextRates[mediaTab.inputFilter]).then((messagesChats) => {\n if(!middleware()) {\n return;\n }\n\n // const list = mediaTab.contentTab.firstElementChild as HTMLUListElement;\n const lastChat = messagesChats.chats[messagesChats.chats.length - 1];\n this.nextRates[mediaTab.inputFilter] = lastChat?.id as number;\n\n if(messagesChats.chats.length < LOAD_COUNT) {\n this.loaded[mediaTab.inputFilter] = true;\n }\n\n return renderParticipants(messagesChats.chats);\n });\n } else if(await this.managers.appChatsManager.isChannel(chatId)) {\n const LOAD_COUNT = !this.membersList ? 50 : 200;\n promise = this.managers.appProfileManager.getChannelParticipants(chatId, undefined, LOAD_COUNT, this.nextRates[mediaTab.inputFilter]).then((participants) => {\n if(!middleware()) {\n return;\n }\n\n const list = mediaTab.contentTab.firstElementChild as HTMLUListElement;\n this.nextRates[mediaTab.inputFilter] = (list ? list.childElementCount : 0) + participants.participants.length;\n\n if(participants.participants.length < LOAD_COUNT) {\n this.loaded[mediaTab.inputFilter] = true;\n }\n\n return renderParticipants(participants.participants);\n });\n } else {\n promise = this.managers.appProfileManager.getChatFull(chatId).then((chatFull) => {\n if(!middleware()) {\n return;\n }\n\n // console.log('anymore', chatFull);\n this.loaded[mediaTab.inputFilter] = true;\n const participants = (chatFull as ChatFull.chatFull).participants;\n if(participants._ === 'chatParticipantsForbidden') {\n return;\n }\n\n return renderParticipants(participants.participants);\n });\n }\n\n return this.loadPromises[mediaTab.inputFilter] = promise.finally(() => {\n if(!middleware()) {\n return;\n }\n\n this.loadPromises[mediaTab.inputFilter] = null;\n });\n }\n\n private loadType(mediaTab: SearchSuperMediaTab, justLoad: boolean, loadCount: number, middleware: () => boolean) {\n const type = mediaTab.inputFilter;\n\n if(this.loadPromises[type]) {\n return this.loadPromises[type];\n }\n\n if(mediaTab.type === 'members' || mediaTab.type === 'groups') {\n return this.loadMembers(mediaTab);\n }\n\n const history = this.historyStorage[type] ??= [];\n\n if(type === 'inputMessagesFilterEmpty' && !history.length) {\n if(!this.loadedChats) {\n this.loadChats();\n this.loadedChats = true;\n }\n\n if(!this.searchContext.query.trim() && !this.searchContext.peerId && !this.searchContext.minDate) {\n this.loaded[type] = true;\n return Promise.resolve();\n }\n }\n\n const promise = this.loadPromises[type] = Promise.resolve().then(async() => {\n // render from cache\n if(history.length && this.usedFromHistory[type] < history.length && !justLoad) {\n const messages: any[] = [];\n let used = Math.max(0, this.usedFromHistory[type]);\n let slicedLength = 0;\n\n do {\n const ids = history.slice(used, used + loadCount);\n used += ids.length;\n slicedLength += ids.length;\n\n const notFilteredMessages = await Promise.all(ids.map((m) => this.managers.appMessagesManager.getMessageByPeer(m.peerId, m.mid)));\n\n messages.push(...this.filterMessagesByType(notFilteredMessages, type));\n } while(slicedLength < loadCount && used < history.length);\n\n // если перебор\n /* if(slicedLength > loadCount) {\n let diff = messages.length - loadCount;\n messages = messages.slice(0, messages.length - diff);\n used -= diff;\n } */\n\n this.usedFromHistory[type] = used;\n // if(messages.length) {\n return this.performSearchResult(messages, mediaTab).finally(() => {\n setTimeout(() => {\n this.scrollable.checkForTriggers();\n }, 0);\n });\n // }\n }\n\n const maxId = history.length ? history[history.length - 1].mid : 0;\n\n const value = await this.managers.appMessagesManager.getSearch({\n ...this.searchContext,\n inputFilter: {_: type},\n maxId,\n limit: loadCount,\n nextRate: this.nextRates[type] ??= 0\n });\n\n history.push(...value.history.map((m) => ({mid: m.mid, peerId: m.peerId})));\n\n if(!middleware()) {\n // this.log.warn('peer changed');\n return;\n }\n\n // ! Фикс случая, когда не загружаются документы при открытой панели разработчиков (происходит из-за того, что не совпадают критерии отбора документов в getSearch)\n if(value.history.length < loadCount || (this.searchContext.folderId !== undefined && !value.next_rate) || value.history.length === value.count) {\n // if((value.count || history.length === value.count) && history.length >= value.count) {\n // this.log(logStr + 'loaded all media', value, loadCount);\n this.loaded[type] = true;\n }\n\n this.nextRates[type] = value.next_rate;\n\n if(justLoad) {\n return;\n }\n\n this.usedFromHistory[type] = history.length;\n\n if(!this.loaded[type]) {\n promise.then(() => {\n setTimeout(() => {\n if(!middleware()) return;\n // this.log('will preload more');\n if(this.mediaTab === mediaTab) {\n const promise = this.load(true, true);\n if(promise) {\n promise.then(() => {\n if(!middleware()) return;\n // this.log('preloaded more');\n setTimeout(() => {\n this.scrollable.checkForTriggers();\n }, 0);\n });\n }\n }\n }, 0);\n });\n }\n\n // if(value.history.length) {\n return this.performSearchResult(this.filterMessagesByType(value.history, type), mediaTab);\n // }\n }).catch((err) => {\n this.log.error('load error:', err);\n }).finally(() => {\n this.loadPromises[type] = null;\n });\n\n return promise;\n }\n\n private canLoadMediaTab(mediaTab: SearchSuperMediaTab) {\n const inputFilter = mediaTab.inputFilter;\n return !this.loaded[inputFilter] || (this.historyStorage[inputFilter] && this.usedFromHistory[inputFilter] < this.historyStorage[inputFilter].length);\n }\n\n private async loadFirstTime() {\n const middleware = this.middleware.get();\n const {peerId, threadId} = this.searchContext;\n if(!this.hideEmptyTabs) {\n return;\n }\n\n const mediaTabs = this.mediaTabs.filter((mediaTab) => mediaTab.inputFilter !== 'inputMessagesFilterEmpty');\n const filters = mediaTabs.map((mediaTab) => ({_: mediaTab.inputFilter}));\n\n const [counters, canViewMembers, canViewGroups] = await Promise.all([\n this.managers.appMessagesManager.getSearchCounters(peerId, filters, undefined, threadId),\n this.canViewMembers(),\n this.canViewGroups()\n ]);\n\n if(!middleware()) {\n return;\n }\n\n if(this.loadMutex) {\n await this.loadMutex;\n\n if(!middleware()) {\n return;\n }\n }\n\n let firstMediaTab: SearchSuperMediaTab;\n let count = 0;\n mediaTabs.forEach((mediaTab) => {\n const counter = counters.find((c) => c.filter._ === mediaTab.inputFilter);\n\n mediaTab.menuTab.classList.toggle('hide', !counter.count);\n mediaTab.menuTab.classList.remove('active');\n // mediaTab.contentTab.classList.toggle('hide', !counter.count);\n\n if(counter.count) {\n if(firstMediaTab === undefined) {\n firstMediaTab = mediaTab;\n }\n\n ++count;\n }\n });\n\n const membersTab = this.mediaTabsMap.get('members');\n\n const a: [SearchSuperMediaTab, boolean][] = [\n [membersTab, canViewMembers],\n [this.mediaTabsMap.get('groups'), canViewGroups]\n ];\n\n a.forEach(([tab, value]) => {\n if(!tab) {\n return;\n }\n\n tab.menuTab.classList.toggle('hide', !value);\n\n if(value) {\n ++count;\n }\n });\n\n if(canViewMembers) {\n firstMediaTab = membersTab;\n }\n\n this.container.classList.toggle('hide', !firstMediaTab);\n this.container.parentElement.classList.toggle('search-empty', !firstMediaTab);\n if(firstMediaTab) {\n this.skipScroll = true;\n this.selectTab(this.mediaTabs.indexOf(firstMediaTab), false);\n // firstMediaTab.menuTab.classList.add('active');\n\n this.navScrollableContainer.classList.toggle('hide', count <= 1);\n }\n }\n\n public async load(single = false, justLoad = false) {\n const peerId = this.searchContext.peerId;\n this.log('load', single, peerId, this.loadPromises);\n const middleware = this.middleware.get();\n\n if(this.firstLoad) {\n await (this.loadFirstTimePromise ??= this.loadFirstTime());\n if(!middleware()) {\n return;\n }\n\n this.loadFirstTimePromise = undefined;\n this.firstLoad = false;\n }\n\n let toLoad = single ? [this.mediaTab] : this.mediaTabs.filter((t) => t !== this.mediaTab);\n toLoad = toLoad.filter((mediaTab) => {\n return this.canLoadMediaTab(mediaTab);\n });\n\n if(peerId.isUser()) {\n findAndSplice(toLoad, (mediaTab) => mediaTab.type === 'members');\n } else {\n findAndSplice(toLoad, (mediaTab) => mediaTab.type === 'groups');\n }\n\n if(!toLoad.length) {\n return;\n }\n\n const loadCount = justLoad ? 50 : Math.round((windowSize.height / 130 | 0) * 3 * 1.25); // that's good for all types\n\n const promises: Promise[] = toLoad.map((mediaTab) => {\n return this.loadType(mediaTab, justLoad, loadCount, middleware);\n });\n\n return Promise.all(promises).catch((err) => {\n this.log.error('Load error all promises:', err);\n });\n }\n\n private getMonthContainerByTimestamp(timestamp: number, type: SearchSuperType) {\n const date = new Date(timestamp * 1000);\n date.setHours(0, 0, 0);\n date.setDate(1);\n const dateTimestamp = date.getTime();\n const containers = this.monthContainers[type] ?? (this.monthContainers[type] = {});\n if(!(dateTimestamp in containers)) {\n const container = document.createElement('div');\n container.className = 'search-super-month';\n\n const name = document.createElement('div');\n name.classList.add('search-super-month-name');\n\n const options: Intl.DateTimeFormatOptions = {\n month: 'long'\n };\n\n if(date.getFullYear() !== new Date().getFullYear()) {\n options.year = 'numeric';\n }\n\n const dateElement = new I18n.IntlDateElement({\n date,\n options\n }).element;\n name.append(dateElement);\n\n container.append(name);\n\n const items = document.createElement('div');\n items.classList.add('search-super-month-items');\n\n container.append(name, items);\n\n const haveTimestamps = getObjectKeysAndSort(containers, 'desc');\n let i = 0;\n for(; i < haveTimestamps.length; ++i) {\n const t = haveTimestamps[i];\n if(dateTimestamp > t) {\n break;\n }\n }\n\n containers[dateTimestamp] = {container, items};\n positionElementByIndex(container, this.tabs[type], i);\n }\n\n return containers[dateTimestamp];\n }\n\n public canViewMembers() {\n const {peerId} = this.searchContext;\n const isAnyChat = peerId.isAnyChat();\n if(!isAnyChat || !this.mediaTabsMap.has('members')) return Promise.resolve(false);\n const chatId = peerId.toChatId();\n return Promise.all([\n this.managers.appChatsManager.isBroadcast(chatId),\n this.managers.appChatsManager.hasRights(chatId, 'view_participants'),\n this.managers.appChatsManager.isForum(chatId)\n ]).then(([isBroadcast, hasRights, isForum]) => {\n return !isBroadcast && hasRights && (!this.searchContext.threadId || !isForum);\n });\n }\n\n public async canViewGroups() {\n const {peerId} = this.searchContext;\n if(!peerId.isUser() || !this.mediaTabsMap.has('groups')) return false;\n const userFull = await this.managers.appProfileManager.getProfile(peerId.toUserId());\n return !!userFull.common_chats_count;\n }\n\n public cleanup() {\n this.loadPromises = {};\n this.loaded = {};\n this.loadedChats = false;\n this.nextRates = {};\n this.firstLoad = true;\n this.prevTabId = -1;\n\n this.lazyLoadQueue.clear();\n\n this.mediaTabs.forEach((mediaTab) => {\n this.usedFromHistory[mediaTab.inputFilter] = -1;\n });\n\n if(this.selection?.isSelecting) {\n this.selection.cancelSelection();\n }\n\n // * must go to first tab (это костыль)\n /* const membersTab = this.mediaTabsMap.get('members');\n if(membersTab) {\n const tab = this.canViewMembers() ? membersTab : this.mediaTabs[this.mediaTabs.indexOf(membersTab) + 1];\n this.mediaTab = tab;\n } */\n\n this.middleware.clean();\n this.loadFirstTimePromise = undefined;\n this.cleanScrollPositions();\n this.membersList = undefined;\n }\n\n public cleanScrollPositions() {\n this.mediaTabs.forEach((mediaTab) => {\n mediaTab.scroll = undefined;\n });\n }\n\n public cleanupHTML(goFirst = false) {\n this.mediaTabs.forEach((tab) => {\n tab.contentTab.replaceChildren();\n\n if(this.hideEmptyTabs) {\n // tab.menuTab.classList.add('hide');\n this.container.classList.add('hide');\n this.container.parentElement.classList.add('search-empty');\n }\n\n if(tab.type === 'chats') {\n return;\n }\n\n if(!this.historyStorage[tab.inputFilter]) {\n const parent = tab.contentTab.parentElement;\n // if(!testScroll) {\n if(!parent.querySelector('.preloader')) {\n putPreloader(parent, true);\n }\n // }\n\n const empty = parent.querySelector('.content-empty');\n if(empty) {\n empty.remove();\n }\n }\n });\n\n /* if(goFirst) {\n const membersTab = this.mediaTabsMap.get('members');\n if(membersTab) {\n let idx = this.canViewMembers() ? 0 : 1;\n membersTab.menuTab.classList.toggle('hide', idx !== 0);\n\n this.selectTab(idx, false);\n } else {\n this.selectTab(0, false);\n }\n } */\n\n this.monthContainers = {};\n this.searchGroupMedia.clear();\n this.scrollable.scrollTop = 0;\n\n /* if(testScroll) {\n for(let i = 0; i < 1500; ++i) {\n let div = document.createElement('div');\n div.insertAdjacentHTML('beforeend', ``);\n div.classList.add('grid-item');\n div.dataset.id = '' + (i / 3 | 0);\n //div.innerText = '' + (i / 3 | 0);\n this.tabs.inputMessagesFilterPhotoVideo.append(div);\n }\n } */\n }\n\n private copySearchContext(newInputFilter: MyInputMessagesFilter) {\n const context = copy(this.searchContext);\n context.inputFilter = {_: newInputFilter};\n context.nextRate = this.nextRates[newInputFilter];\n return context;\n }\n\n public setQuery({peerId, query, threadId, historyStorage, folderId, minDate, maxDate}: {\n peerId: PeerId,\n query?: string,\n threadId?: number,\n historyStorage?: AppSearchSuper['historyStorage'],\n folderId?: number,\n minDate?: number,\n maxDate?: number\n }) {\n this.searchContext = {\n peerId,\n query: query || '',\n inputFilter: {_: this.mediaTab.inputFilter},\n threadId,\n folderId,\n minDate,\n maxDate\n };\n\n this.historyStorage = historyStorage ?? {};\n\n this.cleanup();\n }\n\n public destroy() {\n this.cleanup();\n this.listenerSetter.removeAll();\n this.scrollable.destroy();\n this.swipeHandler?.removeListeners();\n this.selection?.cleanup();\n\n this.scrollStartCallback = undefined;\n this.onChangeTab = undefined;\n this.selectTab = undefined;\n this.searchContextMenu = undefined;\n this.swipeHandler = undefined;\n this.selection = undefined;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cancelEvent from './cancelEvent';\n\nexport default function lockTouchScroll(container: HTMLElement) {\n const onTouchMove = (e: TouchEvent) => {\n cancelEvent(e);\n };\n\n let lockers = 2;\n const cb = () => {\n if(!--lockers) {\n container.removeEventListener('touchmove', onTouchMove, {capture: true});\n }\n };\n\n container.addEventListener('touchmove', onTouchMove, {capture: true, passive: false});\n container.addEventListener('touchend', cb, {once: true});\n\n return cb;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {ChatRights} from '../lib/appManagers/appChatsManager';\nimport type {Dialog} from '../lib/appManagers/appMessagesManager';\nimport appDialogsManager, {DialogElementSize as DialogElementSize} from '../lib/appManagers/appDialogsManager';\nimport rootScope from '../lib/rootScope';\nimport Scrollable from './scrollable';\nimport {FocusDirection} from '../helpers/fastSmoothScroll';\nimport CheckboxField from './checkboxField';\nimport {i18n, LangPackKey, _i18n} from '../lib/langPack';\nimport findUpAttribute from '../helpers/dom/findUpAttribute';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport PeerTitle from './peerTitle';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport debounce from '../helpers/schedulers/debounce';\nimport windowSize from '../helpers/windowSize';\nimport type {IsPeerType} from '../lib/appManagers/appPeersManager';\nimport {attachClickEvent, simulateClickEvent} from '../helpers/dom/clickEvent';\nimport filterUnique from '../helpers/array/filterUnique';\nimport indexOfAndSplice from '../helpers/array/indexOfAndSplice';\nimport safeAssign from '../helpers/object/safeAssign';\nimport findAndSplice from '../helpers/array/findAndSplice';\nimport AvatarElement from './avatar';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport filterAsync from '../helpers/array/filterAsync';\nimport getParticipantPeerId from '../lib/appManagers/utils/chats/getParticipantPeerId';\nimport getChatMembersString from './wrappers/getChatMembersString';\nimport getUserStatusString from './wrappers/getUserStatusString';\nimport {ChannelsChannelParticipants, Chat, User} from '../layer';\nimport canSendToUser from '../lib/appManagers/utils/users/canSendToUser';\nimport hasRights from '../lib/appManagers/utils/chats/hasRights';\nimport getDialogIndex from '../lib/appManagers/utils/dialogs/getDialogIndex';\nimport {generateDelimiter} from './generateDelimiter';\nimport SettingSection from './settingSection';\nimport liteMode from '../helpers/liteMode';\n\ntype SelectSearchPeerType = 'contacts' | 'dialogs' | 'channelParticipants';\n\n// TODO: правильная сортировка для addMembers, т.е. для peerType: 'contacts', потому что там идут сначала контакты - потом неконтакты, а должно всё сортироваться по имени\n\nexport default class AppSelectPeers {\n public container = document.createElement('div');\n public list = appDialogsManager.createChatList(/* {\n handheldsSize: 66,\n avatarSize: 48\n } */);\n private chatsContainer = document.createElement('div');\n public scrollable: Scrollable;\n private selectedScrollable: Scrollable;\n\n private selectedContainer: HTMLElement;\n public input: HTMLInputElement;\n\n // public selected: {[peerId: PeerId]: HTMLElement} = {};\n public selected = new Set();\n\n public freezed = false;\n\n private folderId = 0;\n private offsetIndex = 0;\n private promise: Promise;\n\n private query = '';\n private cachedContacts: PeerId[];\n\n private loadedWhat: Partial<{[k in 'dialogs' | 'archived' | 'contacts' | 'channelParticipants']: true}> = {};\n\n private renderedPeerIds: Set = new Set();\n\n private appendTo: HTMLElement;\n private onChange: (length: number) => void;\n private peerType: SelectSearchPeerType[] = ['dialogs'];\n private renderResultsFunc: (peerIds: PeerId[]) => void | Promise;\n private chatRightsActions: ChatRights[];\n private multiSelect = true;\n private rippleEnabled = true;\n private avatarSize: DialogElementSize = 'abitbigger';\n private exceptSelf = false;\n private filterPeerTypeBy: IsPeerType[];\n\n private tempIds: {[k in keyof AppSelectPeers['loadedWhat']]: number} = {};\n private peerId: PeerId;\n\n private placeholder: LangPackKey;\n\n private selfPresence: LangPackKey = 'Presence.YourChat';\n\n private needSwitchList = false;\n\n private sectionNameLangPackKey: LangPackKey;\n\n private managers: AppManagers;\n\n private design: 'round' | 'square' = 'round';\n\n constructor(options: {\n appendTo: AppSelectPeers['appendTo'],\n onChange?: AppSelectPeers['onChange'],\n peerType?: AppSelectPeers['peerType'],\n peerId?: AppSelectPeers['peerId'],\n onFirstRender?: () => void,\n renderResultsFunc?: AppSelectPeers['renderResultsFunc'],\n chatRightsActions?: AppSelectPeers['chatRightsActions'],\n multiSelect?: AppSelectPeers['multiSelect'],\n rippleEnabled?: AppSelectPeers['rippleEnabled'],\n avatarSize?: AppSelectPeers['avatarSize'],\n placeholder?: AppSelectPeers['placeholder'],\n selfPresence?: AppSelectPeers['selfPresence'],\n exceptSelf?: AppSelectPeers['exceptSelf'],\n filterPeerTypeBy?: AppSelectPeers['filterPeerTypeBy'],\n sectionNameLangPackKey?: AppSelectPeers['sectionNameLangPackKey'],\n managers: AppSelectPeers['managers'],\n design?: AppSelectPeers['design']\n }) {\n safeAssign(this, options);\n\n this.container.classList.add('selector', 'selector-' + this.design);\n\n const f = (this.renderResultsFunc || this.renderResults).bind(this);\n this.renderResultsFunc = async(peerIds) => {\n if(this.needSwitchList) {\n this.scrollable.splitUp.replaceWith(this.list);\n this.scrollable.setVirtualContainer(this.list);\n this.needSwitchList = false;\n }\n\n peerIds = peerIds.filter((peerId) => {\n const notRendered = !this.renderedPeerIds.has(peerId);\n if(notRendered) this.renderedPeerIds.add(peerId);\n return notRendered;\n });\n\n if(this.filterPeerTypeBy) {\n peerIds = await filterAsync(peerIds, async(peerId) => {\n if(peerId.isPeerId()) {\n const peer = await this.managers.appPeersManager.getPeer(peerId);\n if(peer) {\n for(const method of this.filterPeerTypeBy) {\n if(await this.managers.appPeersManager[method](peerId)) {\n return true;\n }\n }\n }\n }\n\n return true;\n });\n }\n\n return f(peerIds);\n };\n\n this.input = document.createElement('input');\n this.input.classList.add('selector-search-input');\n if(this.placeholder) {\n _i18n(this.input, this.placeholder, undefined, 'placeholder');\n } else {\n _i18n(this.input, 'SendMessageTo', undefined, 'placeholder');\n }\n\n this.input.type = 'text';\n\n if(this.multiSelect) {\n const section = new SettingSection({});\n section.innerContainer.classList.add('selector-search-section');\n const topContainer = document.createElement('div');\n topContainer.classList.add('selector-search-container');\n\n this.selectedContainer = document.createElement('div');\n this.selectedContainer.classList.add('selector-search');\n\n this.selectedContainer.append(this.input);\n topContainer.append(this.selectedContainer);\n this.selectedScrollable = new Scrollable(topContainer);\n\n // let delimiter = document.createElement('hr');\n\n attachClickEvent(this.selectedContainer, (e) => {\n if(this.freezed) return;\n let target = e.target as HTMLElement;\n target = findUpClassName(target, 'selector-user');\n\n if(!target) return;\n\n const peerId = target.dataset.key;\n const li = this.chatsContainer.querySelector('[data-peer-id=\"' + peerId + '\"]') as HTMLElement;\n if(!li) {\n this.remove(peerId.toPeerId());\n } else {\n simulateClickEvent(li);\n }\n });\n\n section.content.append(topContainer);\n this.container.append(section.container/* , delimiter */);\n }\n\n this.chatsContainer.classList.add('chatlist-container');\n // this.chatsContainer.append(this.list);\n const section = new SettingSection({\n name: this.sectionNameLangPackKey,\n noShadow: true\n });\n section.content.append(this.list);\n this.chatsContainer.append(section.container);\n this.scrollable = new Scrollable(this.chatsContainer);\n this.scrollable.setVirtualContainer(this.list);\n\n attachClickEvent(this.chatsContainer, (e) => {\n const target = findUpAttribute(e.target, 'data-peer-id') as HTMLElement;\n cancelEvent(e);\n\n if(!target) return;\n if(this.freezed) return;\n\n let key: PeerId | string = target.dataset.peerId;\n key = key.isPeerId() ? key.toPeerId() : key;\n\n if(!this.multiSelect) {\n this.add(key);\n return;\n }\n\n // target.classList.toggle('active');\n if(this.selected.has(key)) {\n this.remove(key);\n } else {\n this.add(key);\n }\n\n const checkbox = target.querySelector('input') as HTMLInputElement;\n checkbox.checked = !checkbox.checked;\n });\n\n const debouncedInput = debounce(this.onInput, 200, false, true);\n this.input.addEventListener('input', debouncedInput);\n\n this.scrollable.onScrolledBottom = () => {\n this.getMoreResults();\n };\n\n this.scrollable.container.prepend(generateDelimiter());\n\n this.container.append(this.chatsContainer);\n this.appendTo.append(this.container);\n\n // WARNING TIMEOUT\n setTimeout(() => {\n const getResultsPromise = this.getMoreResults() as Promise;\n if(options.onFirstRender) {\n getResultsPromise.then(() => {\n options.onFirstRender();\n });\n }\n }, 0);\n }\n\n private onInput = () => {\n const value = this.input.value;\n if(this.query !== value) {\n if(this.peerType.includes('contacts') || this.peerType.includes('dialogs')) {\n this.cachedContacts = undefined;\n }\n\n if(this.peerType.includes('dialogs')) {\n this.folderId = 0;\n this.offsetIndex = 0;\n }\n\n for(const i in this.tempIds) {\n // @ts-ignore\n ++this.tempIds[i];\n }\n\n this.list = appDialogsManager.createChatList();\n\n this.promise = undefined;\n this.loadedWhat = {};\n this.query = value;\n this.renderedPeerIds.clear();\n this.needSwitchList = true;\n\n // console.log('selectPeers input:', this.query);\n this.getMoreResults();\n }\n };\n\n private async renderSaved() {\n if(\n !this.exceptSelf &&\n !this.offsetIndex &&\n this.folderId === 0 &&\n this.peerType.includes('dialogs') &&\n (!this.query || await this.managers.appUsersManager.testSelfSearch(this.query))\n ) {\n await this.renderResultsFunc([rootScope.myId]);\n }\n }\n\n private getTempId(type: keyof AppSelectPeers['tempIds']) {\n this.tempIds[type] ??= 0;\n const tempId = ++this.tempIds[type];\n return {\n tempId,\n middleware: () => this.tempIds[type] === tempId\n };\n }\n\n private async getMoreDialogs(): Promise {\n if(this.loadedWhat.dialogs && this.loadedWhat.archived) {\n return;\n }\n\n // в десктопе - сначала без группы, потом архивные, потом контакты без сообщений\n const pageCount = windowSize.height / 56 * 1.25 | 0;\n\n const {middleware} = this.getTempId('dialogs');\n const promise = this.managers.dialogsStorage.getDialogs({\n query: this.query,\n offsetIndex: this.offsetIndex,\n limit: pageCount,\n filterId: this.folderId,\n skipMigrated: true\n });\n\n promise.catch(() => {\n if(!middleware()) {\n return;\n }\n\n this.loadedWhat[this.loadedWhat.dialogs ? 'archived' : 'dialogs'] = true;\n });\n\n const value = await promise;\n if(!middleware()) {\n return;\n }\n\n let dialogs = value.dialogs as Dialog[];\n if(dialogs.length) {\n const newOffsetIndex = getDialogIndex(dialogs[dialogs.length - 1]) || 0;\n\n dialogs = dialogs.slice();\n findAndSplice(dialogs, d => d.peerId === rootScope.myId); // no my account\n\n if(this.chatRightsActions) {\n dialogs = await filterAsync(dialogs, (d) => this.filterByRights(d.peerId));\n if(!middleware()) {\n return;\n }\n }\n\n await this.renderSaved();\n if(!middleware()) {\n return;\n }\n\n this.offsetIndex = newOffsetIndex;\n }\n\n this.renderResultsFunc(dialogs.map((dialog) => dialog.peerId));\n\n if(value.isEnd) {\n if(!this.loadedWhat.dialogs) {\n await this.renderSaved();\n if(!middleware()) {\n return;\n }\n\n this.loadedWhat.dialogs = true;\n this.offsetIndex = 0;\n this.folderId = 1;\n\n return this.getMoreDialogs();\n } else {\n this.loadedWhat.archived = true;\n\n if(!this.loadedWhat.contacts/* && this.peerType.includes('contacts') */) {\n return this.getMoreContacts();\n }\n }\n }\n }\n\n private async filterByRights(peerId: PeerId) {\n const peer: User | Chat = await this.managers.appPeersManager.getPeer(peerId);\n if(peerId.isUser()) {\n return this.chatRightsActions[0] !== 'send_plain' || canSendToUser(peer as User.user);\n } else if(this.chatRightsActions.every((action) => hasRights(peer as Chat.chat, action))) {\n return true;\n }\n }\n\n private async getMoreContacts() {\n if(this.loadedWhat.contacts) {\n return;\n }\n\n const isGlobalSearch = this.peerType.includes('contacts');\n\n if(!this.cachedContacts) {\n /* const promises: Promise[] = [appUsersManager.getContacts(this.query)];\n if(!this.peerType.includes('dialogs')) {\n promises.push(appMessagesManager.getConversationsAll());\n }\n\n this.promise = Promise.all(promises);\n this.cachedContacts = (await this.promise)[0].slice(); */\n const {middleware} = this.getTempId('contacts');\n const promise = Promise.all([\n isGlobalSearch ? this.managers.appUsersManager.getContactsPeerIds(this.query) : [],\n this.query ? this.managers.appUsersManager.searchContacts(this.query) : undefined\n ]);\n\n promise.catch(() => {\n if(!middleware()) {\n return;\n }\n\n this.loadedWhat.contacts = true;\n });\n\n const [cachedContacts, searchResult] = await promise;\n if(!middleware()) {\n return;\n }\n\n if(searchResult) {\n // do not add global result if only dialogs needed\n let resultPeerIds = isGlobalSearch ? searchResult.my_results.concat(searchResult.results) : searchResult.my_results;\n\n if(this.chatRightsActions) {\n resultPeerIds = await filterAsync(resultPeerIds, (peerId) => this.filterByRights(peerId));\n if(!middleware()) {\n return;\n }\n }\n\n if(!this.peerType.includes('dialogs')) {\n resultPeerIds = resultPeerIds.filter((peerId) => peerId.isUser());\n }\n\n this.cachedContacts = filterUnique(cachedContacts.concat(resultPeerIds));\n } else this.cachedContacts = cachedContacts.slice();\n\n indexOfAndSplice(this.cachedContacts, rootScope.myId); // no my account\n }\n\n // if(this.cachedContacts.length) {\n const pageCount = windowSize.height / 56 * 1.25 | 0;\n const arr = this.cachedContacts.splice(0, pageCount);\n this.renderResultsFunc(arr);\n // }\n\n if(!this.cachedContacts.length) {\n this.loadedWhat.contacts = true;\n\n // need to load non-contacts\n /* if(!this.peerType.includes('dialogs')) {\n return this.getMoreDialogs();\n } */\n }\n }\n\n private async getMoreChannelParticipants() {\n if(this.loadedWhat.channelParticipants) {\n return;\n }\n\n const pageCount = 50; // same as in group permissions to use cache\n\n const {middleware} = this.getTempId('channelParticipants');\n const promise = this.managers.appProfileManager.getParticipants(\n this.peerId.toChatId(),\n {\n _: 'channelParticipantsSearch',\n q: this.query\n },\n pageCount,\n this.list.childElementCount\n );\n\n promise.catch(() => {\n if(!middleware()) {\n return;\n }\n\n this.loadedWhat.channelParticipants = true;\n });\n\n const chatParticipants = await promise;\n if(!middleware()) {\n return;\n }\n\n const {participants} = chatParticipants;\n\n const peerIds = participants.map((participant) => getParticipantPeerId(participant));\n indexOfAndSplice(peerIds, rootScope.myId);\n this.renderResultsFunc(peerIds);\n\n const count = (chatParticipants as ChannelsChannelParticipants.channelsChannelParticipants).count ?? participants.length;\n\n if(this.list.childElementCount >= count || participants.length < pageCount) {\n this.loadedWhat.channelParticipants = true;\n }\n }\n\n checkForTriggers = () => {\n this.scrollable.checkForTriggers();\n };\n\n private getMoreResults() {\n if(this.promise) {\n return this.promise;\n }\n\n const get = () => {\n if((this.peerType.includes('dialogs')/* || this.loadedWhat.contacts */) && !this.loadedWhat.archived) { // to load non-contacts\n return this.getMoreSomething('dialogs');\n }\n\n if((this.peerType.includes('contacts') || this.peerType.includes('dialogs')) && !this.loadedWhat.contacts) {\n return this.getMoreSomething('contacts');\n }\n\n if(this.peerType.includes('channelParticipants') && !this.loadedWhat.channelParticipants) {\n return this.getMoreSomething('channelParticipants');\n }\n };\n\n const loadPromise = get();\n if(!loadPromise) {\n return Promise.resolve();\n }\n\n const promise = this.promise = loadPromise.catch((err) => {\n console.error('get more result error', err);\n }).finally(() => {\n if(this.promise === promise) {\n this.promise = undefined;\n }\n\n this.checkForTriggers();\n });\n\n return promise;\n }\n\n private getMoreSomething(peerType: SelectSearchPeerType) {\n const map: {[type in SelectSearchPeerType]: () => Promise} = {\n dialogs: this.getMoreDialogs,\n contacts: this.getMoreContacts,\n channelParticipants: this.getMoreChannelParticipants\n };\n\n const promise = map[peerType].call(this);\n return promise;\n }\n\n private async renderResults(peerIds: PeerId[]) {\n // console.log('will renderResults:', peerIds);\n\n // оставим только неконтакты с диалогов\n if(!this.peerType.includes('dialogs') && this.loadedWhat.contacts) {\n peerIds = await filterAsync(peerIds, (peerId) => {\n return this.managers.appUsersManager.isNonContactUser(peerId);\n });\n }\n\n peerIds.forEach(async(peerId) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: peerId,\n container: this.scrollable,\n rippleEnabled: this.rippleEnabled,\n avatarSize: this.avatarSize\n });\n\n if(this.multiSelect) {\n const selected = this.selected.has(peerId);\n const checkboxField = new CheckboxField();\n\n if(selected) {\n // dom.listEl.classList.add('active');\n checkboxField.input.checked = true;\n }\n\n dom.containerEl.prepend(checkboxField.label);\n }\n\n let subtitleEl: HTMLElement;\n if(peerId.isAnyChat()) {\n subtitleEl = await getChatMembersString(peerId.toChatId());\n } else if(peerId === rootScope.myId) {\n subtitleEl = i18n(this.selfPresence);\n } else {\n subtitleEl = getUserStatusString(await this.managers.appUsersManager.getUser(peerId.toUserId()));\n }\n\n dom.lastMessageSpan.append(subtitleEl);\n });\n }\n\n public add(key: PeerId | string, title?: string | HTMLElement, scroll = true) {\n // console.trace('add');\n this.selected.add(key);\n\n if(!this.multiSelect) {\n this.onChange(this.selected.size);\n return;\n }\n\n if(this.query.trim()) {\n this.input.value = '';\n this.onInput();\n }\n\n const div = document.createElement('div');\n div.classList.add('selector-user', 'scale-in');\n\n const avatarEl = new AvatarElement();\n avatarEl.classList.add('selector-user-avatar', 'tgico', 'avatar-32');\n avatarEl.isDialog = true;\n\n div.dataset.key = '' + key;\n if(key.isPeerId()) {\n if(title === undefined) {\n const peerTitle = new PeerTitle();\n peerTitle.update({peerId: key.toPeerId(), dialog: true});\n title = peerTitle.element;\n }\n\n avatarEl.updateWithOptions({\n peerId: key as PeerId\n });\n }\n\n if(title) {\n if(typeof(title) === 'string') {\n div.innerHTML = title;\n } else {\n replaceContent(div, title);\n div.append(title);\n }\n }\n\n div.insertAdjacentElement('afterbegin', avatarEl);\n\n this.selectedContainer.insertBefore(div, this.input);\n // this.selectedScrollable.scrollTop = this.selectedScrollable.scrollHeight;\n this.onChange?.(this.selected.size);\n\n if(scroll) {\n this.selectedScrollable.scrollIntoViewNew({\n element: this.input,\n position: 'center'\n });\n }\n\n return div;\n }\n\n public remove(key: PeerId | string) {\n if(!this.multiSelect) return;\n // const div = this.selected[peerId];\n const div = this.selectedContainer.querySelector(`[data-key=\"${key}\"]`) as HTMLElement;\n div.classList.remove('scale-in');\n void div.offsetWidth;\n div.classList.add('scale-out');\n\n const onAnimationEnd = () => {\n this.selected.delete(key);\n div.remove();\n this.onChange && this.onChange(this.selected.size);\n };\n\n if(liteMode.isAvailable('animations')) {\n div.addEventListener('animationend', onAnimationEnd, {once: true});\n } else {\n onAnimationEnd();\n }\n }\n\n public getSelected() {\n return [...this.selected];\n }\n\n public addInitial(values: any[]) {\n values.forEach((value) => {\n this.add(value, undefined, false);\n });\n\n window.requestAnimationFrame(() => { // ! not the best place for this raf though it works\n this.selectedScrollable.scrollIntoViewNew({\n element: this.input,\n position: 'center',\n forceDirection: FocusDirection.Static\n });\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../lib/appManagers/appDocsManager';\nimport ProgressivePreloader from './preloader';\nimport appMediaPlaybackController, {MediaItem, MediaSearchContext} from './appMediaPlaybackController';\nimport {DocumentAttribute, Message} from '../layer';\nimport mediaSizes from '../helpers/mediaSizes';\nimport {IS_SAFARI} from '../environment/userAgent';\nimport rootScope from '../lib/rootScope';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport LazyLoadQueue from './lazyLoadQueue';\nimport deferredPromise, {CancellablePromise} from '../helpers/cancellablePromise';\nimport ListenerSetter, {Listener} from '../helpers/listenerSetter';\nimport noop from '../helpers/noop';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport {joinElementsWith} from '../lib/langPack';\nimport {MiddleEllipsisElement} from './middleEllipsis';\nimport {formatFullSentTime} from '../helpers/date';\nimport throttleWithRaf from '../helpers/schedulers/throttleWithRaf';\nimport {NULL_PEER_ID} from '../lib/mtproto/mtproto_config';\nimport formatBytes from '../helpers/formatBytes';\nimport {animateSingle} from '../helpers/animation';\nimport clamp from '../helpers/number/clamp';\nimport toHHMMSS from '../helpers/string/toHHMMSS';\nimport MediaProgressLine from './mediaProgressLine';\nimport setInnerHTML from '../helpers/dom/setInnerHTML';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport wrapEmojiText from '../lib/richTextProcessor/wrapEmojiText';\nimport wrapSenderToPeer from './wrappers/senderToPeer';\nimport wrapSentTime from './wrappers/sentTime';\nimport getMediaFromMessage from '../lib/appManagers/utils/messages/getMediaFromMessage';\nimport appDownloadManager from '../lib/appManagers/appDownloadManager';\nimport wrapPhoto from './wrappers/photo';\nimport {doubleRaf} from '../helpers/schedulers';\n\nrootScope.addEventListener('messages_media_read', ({mids, peerId}) => {\n mids.forEach((mid) => {\n const attr = `[data-mid=\"${mid}\"][data-peer-id=\"${peerId}\"]`;\n (Array.from(document.querySelectorAll(`audio-element.is-unread${attr}, .media-round.is-unread${attr}`)) as AudioElement[]).forEach((elem) => {\n elem.classList.remove('is-unread');\n });\n });\n});\n\n// https://github.com/LonamiWebs/Telethon/blob/4393ec0b83d511b6a20d8a20334138730f084375/telethon/utils.py#L1285\nexport function decodeWaveform(waveform: Uint8Array | number[]) {\n if(!(waveform instanceof Uint8Array)) {\n waveform = new Uint8Array(waveform);\n }\n\n const bitCount = waveform.length * 8;\n const valueCount = bitCount / 5 | 0;\n if(!valueCount) {\n return new Uint8Array([]);\n }\n\n let result: Uint8Array;\n try {\n const dataView = new DataView(waveform.buffer);\n result = new Uint8Array(valueCount);\n for(let i = 0; i < valueCount; i++) {\n const byteIndex = i * 5 / 8 | 0;\n const bitShift = i * 5 % 8;\n const value = dataView.getUint16(byteIndex, true);\n result[i] = (value >> bitShift) & 0b00011111;\n }\n } catch(err) {\n result = new Uint8Array([]);\n }\n\n return result;\n}\n\nfunction createWaveformBars(waveform: Uint8Array, duration: number) {\n const barWidth = 2;\n const barMargin = 2;\n const barHeightMin = 4;\n const barHeightMax = mediaSizes.isMobile ? 16 : 23;\n\n const minW = mediaSizes.isMobile ? 152 : 190;\n const maxW = mediaSizes.isMobile ? 190 : 256;\n const availW = clamp(duration / 60 * maxW, minW, maxW);\n\n const normValue = Math.max(...waveform);\n const wfSize = waveform.length;\n const barCount = Math.min((availW / (barWidth + barMargin)) | 0, wfSize);\n\n let maxValue = 0;\n const maxDelta = barHeightMax - barHeightMin;\n\n let html = '';\n for(let i = 0, barX = 0, sumI = 0; i < wfSize; ++i) {\n const value = waveform[i] || 0;\n if((sumI + barCount) >= wfSize) { // draw bar\n sumI = sumI + barCount - wfSize;\n if(sumI < (barCount + 1) / 2) {\n if(maxValue < value) maxValue = value;\n }\n\n const bar_value = Math.max(((maxValue * maxDelta) + ((normValue + 1) / 2)) / (normValue + 1), barHeightMin);\n\n const h = ``;\n html += h;\n\n barX += barWidth + barMargin;\n\n if(sumI < (barCount + 1) / 2) {\n maxValue = 0;\n } else {\n maxValue = value;\n }\n } else {\n if(maxValue < value) maxValue = value;\n\n sumI += barCount;\n }\n }\n\n let container: HTMLElement, svg: SVGSVGElement;\n\n if(!html) {\n\n } else {\n container = document.createElement('div');\n container.classList.add('audio-waveform');\n\n svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.classList.add('audio-waveform-bars');\n svg.setAttributeNS(null, 'width', '' + availW);\n svg.setAttributeNS(null, 'height', '' + barHeightMax);\n svg.setAttributeNS(null, 'viewBox', `0 0 ${availW} ${barHeightMax}`);\n svg.insertAdjacentHTML('beforeend', html);\n\n container.append(svg);\n }\n\n return {svg, container, availW};\n}\n\nasync function wrapVoiceMessage(audioEl: AudioElement) {\n audioEl.classList.add('is-voice');\n\n const message = audioEl.message;\n const doc = getMediaFromMessage(message) as MyDocument;\n\n if(message.pFlags.out) {\n audioEl.classList.add('is-out');\n }\n\n let waveform = (doc.attributes.find((attribute) => attribute._ === 'documentAttributeAudio') as DocumentAttribute.documentAttributeAudio).waveform || new Uint8Array([]);\n waveform = decodeWaveform(waveform.slice(0, 63));\n\n const {svg, container: svgContainer, availW} = createWaveformBars(waveform, doc.duration);\n\n let fakeSvgContainer: HTMLElement;\n if(svgContainer) {\n fakeSvgContainer = svgContainer.cloneNode(true) as HTMLElement;\n fakeSvgContainer.classList.add('audio-waveform-fake');\n svgContainer.classList.add('audio-waveform-background');\n }\n\n const waveformContainer = document.createElement('div');\n waveformContainer.classList.add('audio-waveform-container');\n\n if(svgContainer) {\n waveformContainer.append(svgContainer, fakeSvgContainer);\n }\n\n const timeDiv = document.createElement('div');\n timeDiv.classList.add('audio-time');\n audioEl.append(waveformContainer, timeDiv);\n\n if(audioEl.transcriptionState !== undefined) {\n audioEl.classList.add('can-transcribe');\n const speechRecognitionDiv = document.createElement('div');\n speechRecognitionDiv.classList.add('audio-to-text-button');\n const speechRecognitionIcon = document.createElement('span');\n speechRecognitionIcon.classList.add('tgico-transcribe');\n const speechRecognitionLoader = document.createElement('div');\n speechRecognitionLoader.classList.add('loader');\n speechRecognitionLoader.innerHTML = ''\n speechRecognitionDiv.append(speechRecognitionIcon);\n\n speechRecognitionDiv.onclick = () => {\n const speechTextDiv = (findUpClassName(audioEl, 'document-wrapper') || findUpClassName(audioEl, 'quote-text')).querySelector('.audio-transcribed-text');\n if(audioEl.transcriptionState === 0) {\n if(speechTextDiv) {\n speechTextDiv.classList.remove('hide');\n speechRecognitionIcon.classList.remove('tgico-transcribe');\n speechRecognitionIcon.classList.add('tgico-up');\n // TODO: State to enum\n audioEl.transcriptionState = 2;\n } else {\n const message = audioEl.message;\n if(message.pFlags.is_outgoing) {\n return;\n }\n\n audioEl.transcriptionState = 1;\n !speechRecognitionLoader.parentElement && speechRecognitionDiv.append(speechRecognitionLoader);\n doubleRaf().then(() => {\n if(audioEl.transcriptionState === 1) {\n speechRecognitionLoader.classList.add('active');\n }\n });\n\n audioEl.managers.appMessagesManager.transcribeAudio(message).catch(noop);\n }\n } else if(audioEl.transcriptionState === 2) {\n // Hide transcription\n speechTextDiv.classList.add('hide');\n speechRecognitionIcon.classList.remove('tgico-up');\n speechRecognitionIcon.classList.add('tgico-transcribe');\n audioEl.transcriptionState = 0;\n }\n };\n\n audioEl.append(speechRecognitionDiv);\n }\n\n let progress = svg as any as HTMLElement, progressLine: MediaProgressLine;\n if(!progress) {\n progressLine = new MediaProgressLine();\n\n waveformContainer.append(progressLine.container);\n }\n\n const onLoad = () => {\n let audio = audioEl.audio;\n\n const setAnimation = () => {\n animateSingle(() => {\n if(!audio) return false;\n onTimeUpdate();\n return !audio.paused;\n }, audioEl);\n };\n\n const onTimeUpdate = () => {\n if(fakeSvgContainer) {\n fakeSvgContainer.style.width = (audio.currentTime / audio.duration * 100) + '%';\n }\n };\n\n if(!audio.paused || (audio.currentTime > 0 && audio.currentTime !== audio.duration)) {\n onTimeUpdate();\n }\n\n const throttledTimeUpdate = throttleWithRaf(onTimeUpdate);\n audioEl.addAudioListener('timeupdate', throttledTimeUpdate);\n audioEl.addAudioListener('ended', throttledTimeUpdate);\n audioEl.addAudioListener('play', setAnimation);\n\n progress && audioEl.readyPromise.then(() => {\n let mousedown = false, mousemove = false;\n progress.addEventListener('mouseleave', (e) => {\n if(mousedown) {\n audioEl.togglePlay(undefined, true);\n mousedown = false;\n }\n mousemove = false;\n });\n progress.addEventListener('mousemove', (e) => {\n mousemove = true;\n if(mousedown) scrub(e);\n });\n progress.addEventListener('mousedown', (e) => {\n e.preventDefault();\n if(e.button !== 0) return;\n if(!audio.paused) {\n audioEl.togglePlay(undefined, false);\n }\n\n scrub(e);\n mousedown = true;\n });\n progress.addEventListener('mouseup', (e) => {\n if(mousemove && mousedown) {\n audioEl.togglePlay(undefined, true);\n mousedown = false;\n }\n });\n attachClickEvent(progress, (e) => {\n cancelEvent(e);\n if(!audio.paused) scrub(e);\n });\n\n function scrub(e: MouseEvent | TouchEvent) {\n let offsetX: number;\n if(e instanceof MouseEvent) {\n offsetX = e.offsetX;\n } else { // touch\n const rect = (e.target as HTMLElement).getBoundingClientRect();\n offsetX = e.targetTouches[0].pageX - rect.left;\n }\n\n const scrubTime = offsetX / availW /* width */ * audio.duration;\n audio.currentTime = scrubTime;\n }\n }, noop);\n\n !progress && progressLine.setMedia({\n media: audio,\n streamable: doc.supportsStreaming,\n duration: doc.duration\n });\n\n return () => {\n progress?.remove();\n progress = null;\n audio = null;\n };\n };\n\n return onLoad;\n}\n\nasync function wrapAudio(audioEl: AudioElement) {\n const withTime = audioEl.withTime;\n\n const message = audioEl.message;\n const doc = getMediaFromMessage(message) as MyDocument;\n\n const isVoice = doc.type === 'voice' || doc.type === 'round';\n const descriptionEl = document.createElement('div');\n descriptionEl.classList.add('audio-description');\n\n const audioAttribute = doc.attributes.find((attr) => attr._ === 'documentAttributeAudio') as DocumentAttribute.documentAttributeAudio;\n\n if(!isVoice) {\n const parts: (Node | string)[] = [];\n if(audioAttribute?.performer) {\n parts.push(wrapEmojiText(audioAttribute.performer));\n }\n\n if(withTime) {\n parts.push(formatFullSentTime(message.date));\n } else if(!parts.length) {\n parts.push(formatBytes(doc.size));\n }\n\n if(audioEl.showSender) {\n parts.push(await wrapSenderToPeer(message));\n }\n\n descriptionEl.append(...joinElementsWith(parts, ' • '));\n }\n\n const html = `\n
\n
\n
\n
`;\n audioEl.insertAdjacentHTML('beforeend', html);\n\n const titleEl = audioEl.querySelector('.audio-title') as HTMLElement;\n\n const middleEllipsisEl = new MiddleEllipsisElement();\n middleEllipsisEl.dataset.fontWeight = audioEl.dataset.fontWeight;\n middleEllipsisEl.dataset.fontSize = audioEl.dataset.fontSize;\n middleEllipsisEl.dataset.sizeType = audioEl.dataset.sizeType;\n (middleEllipsisEl as any).getSize = (audioEl as any).getSize;\n if(isVoice) {\n middleEllipsisEl.append(await wrapSenderToPeer(message));\n } else {\n setInnerHTML(middleEllipsisEl, wrapEmojiText(audioAttribute?.title ?? doc.file_name));\n }\n\n titleEl.append(middleEllipsisEl);\n\n if(audioEl.showSender) {\n titleEl.append(wrapSentTime(message));\n }\n\n const subtitleDiv = audioEl.querySelector('.audio-subtitle') as HTMLDivElement;\n subtitleDiv.append(descriptionEl);\n\n const onLoad = () => {\n let launched = false;\n\n let progressLine = new MediaProgressLine();\n progressLine.setMedia({\n media: audioEl.audio,\n streamable: doc.supportsStreaming,\n duration: doc.duration\n });\n\n audioEl.addAudioListener('ended', () => {\n audioEl.classList.remove('audio-show-progress');\n // Reset subtitle\n subtitleDiv.lastChild.replaceWith(descriptionEl);\n launched = false;\n });\n\n const onPlay = () => {\n if(!launched) {\n audioEl.classList.add('audio-show-progress');\n launched = true;\n\n if(progressLine) {\n subtitleDiv.lastChild.replaceWith(progressLine.container);\n }\n }\n };\n\n audioEl.addAudioListener('play', onPlay);\n\n if(!audioEl.audio.paused || audioEl.audio.currentTime > 0) {\n onPlay();\n }\n\n return () => {\n progressLine.removeListeners();\n progressLine.container.remove();\n progressLine = null;\n };\n };\n\n return onLoad;\n}\n\nfunction constructDownloadPreloader(tryAgainOnFail = true) {\n const preloader = new ProgressivePreloader({cancelable: true, tryAgainOnFail});\n preloader.construct();\n\n if(!tryAgainOnFail) {\n preloader.circle.setAttributeNS(null, 'r', '23');\n preloader.totalLength = 143.58203125;\n }\n\n return preloader;\n}\n\nexport const findMediaTargets = (anchor: HTMLElement, anchorMid: number/* , useSearch: boolean */) => {\n let prev: MediaItem[], next: MediaItem[];\n // if(anchor.classList.contains('search-super-item') || !useSearch) {\n const isBubbles = !anchor.classList.contains('search-super-item');\n const container = findUpClassName(anchor, !isBubbles ? 'tabs-tab' : 'bubbles-inner');\n if(container) {\n const attr = `:not([data-is-outgoing=\"1\"])`;\n const justAudioSelector = `.audio:not(.is-voice)${attr}`;\n let selectors: string[];\n if(!anchor.matches(justAudioSelector)) {\n selectors = [`.audio.is-voice${attr}`, `.media-round${attr}`];\n } else {\n selectors = [justAudioSelector];\n }\n\n if(isBubbles) {\n const prefix = '.bubble:not(.webpage) ';\n selectors = selectors.map((s) => prefix + s);\n }\n\n const selector = selectors.join(', ');\n\n const elements = Array.from(container.querySelectorAll(selector)) as HTMLElement[];\n const idx = elements.indexOf(anchor);\n\n const mediaItems: MediaItem[] = elements.map((element) => ({peerId: element.dataset.peerId.toPeerId(), mid: +element.dataset.mid}));\n\n prev = mediaItems.slice(0, idx);\n next = mediaItems.slice(idx + 1);\n }\n // }\n\n if((next.length && next[0].mid < anchorMid) || (prev.length && prev[prev.length - 1].mid > anchorMid)) {\n [prev, next] = [next.reverse(), prev.reverse()];\n }\n\n // prev = next = undefined;\n\n return [prev, next];\n};\n\nexport default class AudioElement extends HTMLElement {\n public audio: HTMLAudioElement;\n public preloader: ProgressivePreloader;\n public message: Message.message;\n public withTime = false;\n public voiceAsMusic = false;\n public searchContext: MediaSearchContext;\n public showSender = false;\n public noAutoDownload: boolean;\n public lazyLoadQueue: LazyLoadQueue;\n public loadPromises: Promise[];\n public managers: AppManagers;\n public transcriptionState: number;\n\n private listenerSetter = new ListenerSetter();\n private onTypeDisconnect: () => void;\n public onLoad: (autoload?: boolean) => void;\n public readyPromise: CancellablePromise;\n public load: (shouldPlay: boolean, controlledAutoplay?: boolean) => void;\n\n public async render() {\n this.classList.add('audio');\n this.managers = rootScope.managers;\n\n this.dataset.mid = '' + this.message.mid;\n this.dataset.peerId = '' + this.message.peerId;\n\n const doc = getMediaFromMessage(this.message) as MyDocument;\n const isRealVoice = doc.type === 'voice';\n const isVoice = !this.voiceAsMusic && isRealVoice;\n const isOutgoing = this.message.pFlags.is_outgoing;\n const uploadingFileName = this.message?.uploadingFileName;\n\n const getDurationStr = () => {\n const duration = this.audio && this.audio.readyState >= this.audio.HAVE_CURRENT_DATA ? this.audio.duration : doc.duration;\n return toHHMMSS(duration | 0);\n };\n\n this.innerHTML = `\n
\n
\n
\n
\n
\n
`;\n\n const toggle = this.firstElementChild as HTMLElement;\n\n const downloadDiv = document.createElement('div');\n downloadDiv.classList.add('audio-download');\n\n const isUnread = doc.type !== 'audio' && this.message && this.message.pFlags.media_unread;\n if(isUnread) {\n this.classList.add('is-unread');\n }\n\n if(uploadingFileName) {\n this.classList.add('is-outgoing');\n this.append(downloadDiv);\n }\n\n const onTypeLoad = await (isVoice ? wrapVoiceMessage(this) : wrapAudio(this));\n\n const audioTimeDiv = this.querySelector('.audio-time') as HTMLDivElement;\n audioTimeDiv.textContent = getDurationStr();\n\n const onLoad = this.onLoad = (autoload: boolean) => {\n this.onLoad = undefined;\n\n const audio = this.audio = appMediaPlaybackController.addMedia(this.message, autoload);\n\n const readyPromise = this.readyPromise = deferredPromise();\n if(this.audio.readyState >= this.audio.HAVE_CURRENT_DATA) readyPromise.resolve();\n else {\n this.addAudioListener('canplay', () => readyPromise.resolve(), {once: true});\n }\n\n this.onTypeDisconnect = onTypeLoad();\n\n const getTimeStr = () => toHHMMSS(audio.currentTime | 0) + (isVoice ? (' / ' + getDurationStr()) : '');\n\n const onPlay = () => {\n audioTimeDiv.innerText = getTimeStr();\n toggle.classList.toggle('playing', !audio.paused);\n };\n\n if(!audio.paused || (audio.currentTime > 0 && audio.currentTime !== audio.duration)) {\n onPlay();\n }\n\n attachClickEvent(toggle, (e) => this.togglePlay(e), {listenerSetter: this.listenerSetter});\n\n this.addAudioListener('ended', () => {\n toggle.classList.remove('playing');\n audioTimeDiv.innerText = getDurationStr();\n });\n\n this.addAudioListener('timeupdate', () => {\n if((!audio.currentTime && audio.paused) || appMediaPlaybackController.isSafariBuffering(audio)) return;\n audioTimeDiv.innerText = getTimeStr();\n });\n\n this.addAudioListener('pause', () => {\n toggle.classList.remove('playing');\n });\n\n this.addAudioListener('play', onPlay);\n };\n\n if(doc.thumbs?.length) {\n const imgs: HTMLElement[] = [];\n const wrapped = await wrapPhoto({\n photo: doc,\n message: null,\n container: toggle,\n boxWidth: 48,\n boxHeight: 48,\n loadPromises: this.loadPromises,\n withoutPreloader: true,\n lazyLoadQueue: this.lazyLoadQueue\n });\n toggle.style.width = toggle.style.height = '';\n if(wrapped.images.thumb) imgs.push(wrapped.images.thumb);\n if(wrapped.images.full) imgs.push(wrapped.images.full);\n\n this.classList.add('audio-with-thumb');\n imgs.forEach((img) => img.classList.add('audio-thumb'));\n }\n\n if(!isOutgoing) {\n let preloader: ProgressivePreloader = this.preloader;\n\n const autoDownload = doc.type !== 'audio'/* || !this.noAutoDownload */;\n onLoad(autoDownload);\n\n const r = this.load = (shouldPlay: boolean, controlledAutoplay?: boolean) => {\n this.load = undefined;\n\n if(this.audio.src) {\n return;\n }\n\n appMediaPlaybackController.resolveWaitingForLoadMedia(this.message.peerId, this.message.mid, this.message.pFlags.is_scheduled);\n\n this.onDownloadInit(shouldPlay);\n\n if(!preloader) {\n if(doc.supportsStreaming) {\n this.classList.add('corner-download');\n\n let pauseListener: Listener;\n const onPlay = () => {\n const preloader = constructDownloadPreloader(false);\n const deferred = deferredPromise();\n deferred.notifyAll({done: 75, total: 100});\n deferred.catch(() => {\n this.audio.pause();\n appMediaPlaybackController.willBePlayed(undefined);\n });\n deferred.cancel = () => {\n deferred.cancel = noop;\n const err = new Error();\n (err as any).type = 'CANCELED';\n deferred.reject(err);\n };\n preloader.attach(downloadDiv, false, deferred);\n\n pauseListener = this.addAudioListener('pause', () => {\n deferred.cancel();\n }, {once: true}) as any;\n\n this.onDownloadInit(shouldPlay);\n };\n\n /* if(!this.audio.paused) {\n onPlay();\n } */\n\n const playListener: any = this.addAudioListener('play', onPlay);\n this.readyPromise.then(() => {\n this.listenerSetter.remove(playListener);\n pauseListener && this.listenerSetter.remove(pauseListener);\n });\n } else {\n preloader = constructDownloadPreloader();\n\n if(!shouldPlay) {\n this.readyPromise = deferredPromise();\n }\n\n const load = () => {\n this.onDownloadInit(shouldPlay);\n\n const download = appDownloadManager.downloadMediaURL({media: doc});\n\n if(!shouldPlay) {\n download.then(() => {\n this.readyPromise.resolve();\n });\n }\n\n preloader.attach(downloadDiv, false, download);\n return {download};\n };\n\n preloader.setDownloadFunction(load);\n load();\n }\n }\n\n if(this.classList.contains('corner-download')) {\n toggle.append(downloadDiv);\n } else {\n this.append(downloadDiv);\n }\n\n this.classList.add('downloading');\n\n this.readyPromise.then(() => {\n this.classList.remove('downloading');\n downloadDiv.classList.add('downloaded');\n setTimeout(() => {\n downloadDiv.remove();\n }, 200);\n\n // setTimeout(() => {\n // release loaded audio\n if(!controlledAutoplay && appMediaPlaybackController.willBePlayedMedia === this.audio) {\n this.audio.play();\n appMediaPlaybackController.willBePlayed(undefined);\n }\n // }, 10e3);\n });\n };\n\n if(!this.audio?.src) {\n if(autoDownload) {\n r(false);\n } else {\n attachClickEvent(toggle, () => {\n r(true);\n }, {once: true, capture: true, passive: false, listenerSetter: this.listenerSetter});\n }\n }\n } else if(uploadingFileName) {\n this.preloader = constructDownloadPreloader(false);\n this.preloader.attachPromise(appDownloadManager.getUpload(uploadingFileName));\n this.dataset.isOutgoing = '1';\n this.preloader.attach(downloadDiv, false);\n // onLoad();\n }\n }\n\n private onDownloadInit(shouldPlay: boolean) {\n if(shouldPlay) {\n appMediaPlaybackController.willBePlayed(this.audio); // prepare for loading audio\n\n if(IS_SAFARI && !this.audio.autoplay) {\n this.audio.autoplay = true;\n }\n }\n }\n\n public togglePlay(e?: Event, paused = this.audio.paused) {\n e && cancelEvent(e);\n\n if(paused) {\n this.setTargetsIfNeeded();\n this.audio.play().catch(() => {});\n } else {\n this.audio.pause();\n }\n }\n\n public setTargetsIfNeeded() {\n const hadSearchContext = !!this.searchContext;\n if(appMediaPlaybackController.setSearchContext(this.searchContext || {\n peerId: NULL_PEER_ID,\n inputFilter: {_: 'inputMessagesFilterEmpty'},\n useSearch: false\n })) {\n const [prev, next] = !hadSearchContext ? [] : findMediaTargets(this, this.message.mid/* , this.searchContext.useSearch */);\n appMediaPlaybackController.setTargets({peerId: this.message.peerId, mid: this.message.mid}, prev, next);\n }\n }\n\n public playWithTimestamp(timestamp: number) {\n this.load?.(true);\n this.audio.currentTime = timestamp;\n this.togglePlay(undefined, true);\n // appMediaPlaybackController.willBePlayed(this.audio); // prepare for loading audio\n // this.readyPromise.then(() => {\n // if(appMediaPlaybackController.willBePlayedMedia !== this.audio && this.audio.paused) {\n // return;\n // }\n\n // appMediaPlaybackController.willBePlayed(undefined);\n\n // this.audio.currentTime = timestamp;\n // this.togglePlay(undefined, true);\n // });\n }\n\n get addAudioListener() {\n return this.listenerSetter.add(this.audio);\n }\n\n disconnectedCallback() {\n setTimeout(() => {\n if(this.isConnected) {\n return;\n }\n\n if(this.onTypeDisconnect) {\n this.onTypeDisconnect();\n this.onTypeDisconnect = null;\n }\n\n if(this.readyPromise) {\n this.readyPromise.reject();\n }\n\n if(this.listenerSetter) {\n this.listenerSetter.removeAll();\n this.listenerSetter = null;\n }\n\n if(this.preloader) {\n this.preloader = null;\n }\n }, 100);\n }\n}\n\ncustomElements.define('audio-element', AudioElement);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Photo} from '../layer';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport ListLoader, {ListLoaderOptions} from './listLoader';\n\nexport default class AvatarListLoader extends ListLoader {\n private peerId: PeerId;\n private managers: AppManagers;\n\n constructor(options: Omit, 'loadMore'> & {peerId: PeerId, managers: AppManagers}) {\n super({\n ...options,\n loadMore: (anchor, older, loadCount) => {\n if(this.peerId.isAnyChat() || !older) return Promise.resolve({count: 0, items: []}); // ! это значит, что открыло аватар чата, но следующих фотографий нет.\n\n const maxId = anchor?.photoId;\n return this.managers.appPhotosManager.getUserPhotos(this.peerId, maxId, loadCount).then((value) => {\n const items = value.photos.map((photoId) => {\n return {element: null as HTMLElement, photoId} as any;\n });\n\n return {count: value.count, items};\n });\n }\n });\n\n this.loadedAllUp = true;\n this.peerId = options.peerId;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport AvatarListLoader from '../helpers/avatarListLoader';\nimport {Photo} from '../layer';\nimport appDownloadManager from '../lib/appManagers/appDownloadManager';\nimport appImManager from '../lib/appManagers/appImManager';\nimport rootScope from '../lib/rootScope';\nimport AppMediaViewerBase from './appMediaViewerBase';\n\ntype AppMediaViewerAvatarTargetType = {element: HTMLElement, photoId: Photo.photo['id'], photo?: Photo.photo};\nexport default class AppMediaViewerAvatar extends AppMediaViewerBase<'', 'delete', AppMediaViewerAvatarTargetType> {\n public peerId: PeerId;\n\n constructor(peerId: PeerId) {\n super(new AvatarListLoader({peerId, managers: rootScope.managers}), [/* 'delete' */]);\n\n this.peerId = peerId;\n\n this.setBtnMenuToggle([{\n icon: 'download',\n text: 'MediaViewer.Context.Download',\n onClick: this.onDownloadClick\n }/* , {\n icon: 'delete danger btn-disabled',\n text: 'Delete',\n onClick: () => {}\n } */]);\n\n // * constructing html end\n\n this.setListeners();\n }\n\n onPrevClick = (target: AppMediaViewerAvatarTargetType) => {\n this.openMedia({\n photoId: target.photoId,\n target: target.element,\n fromRight: -1\n });\n };\n\n onNextClick = (target: AppMediaViewerAvatarTargetType) => {\n this.openMedia({\n photoId: target.photoId,\n target: target.element,\n fromRight: 1\n });\n };\n\n onDownloadClick = () => {\n appDownloadManager.downloadToDisc({\n media: this.target.photo,\n queueId: appImManager.chat.bubbles.lazyLoadQueue.queueId\n });\n };\n\n public async openMedia({\n photoId,\n target,\n fromRight = 0,\n prevTargets,\n nextTargets\n }: {\n photoId: Photo.photo['id'],\n target?: HTMLElement,\n fromRight?: number,\n prevTargets?: AppMediaViewerAvatarTargetType[],\n nextTargets?: AppMediaViewerAvatarTargetType[]\n }) {\n if(this.setMoverPromise) return this.setMoverPromise;\n\n const photo = await this.managers.appPhotosManager.getPhoto(photoId);\n const ret = super._openMedia({\n media: photo,\n timestamp: photo.date,\n fromId: this.peerId,\n fromRight,\n target,\n reverse: false,\n prevTargets,\n nextTargets\n });\n this.target.photoId = photo.id;\n this.target.photo = photo;\n\n return ret;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../lib/rootScope';\nimport {Message, Photo} from '../layer';\nimport type LazyLoadQueue from './lazyLoadQueue';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport AppMediaViewer from './appMediaViewer';\nimport AppMediaViewerAvatar from './appMediaViewerAvatar';\nimport isObject from '../helpers/object/isObject';\nimport {ArgumentTypes} from '../types';\nimport putPhoto from './putPhoto';\nimport {recordPromise} from '../helpers/recordPromise';\nimport {getMiddleware, MiddlewareHelper} from '../helpers/middleware';\n\nconst onAvatarUpdate = ({peerId, threadId}: {peerId: PeerId, threadId?: number}) => {\n let query = 'avatar-element[data-peer-id=\"' + peerId + '\"]';\n if(threadId) {\n query += '[data-thread-id=\"' + threadId + '\"]';\n }\n\n (Array.from(document.querySelectorAll(query)) as AvatarElement[]).forEach((elem) => {\n // console.log('updating avatar:', elem);\n elem.update();\n });\n};\n\nrootScope.addEventListener('avatar_update', onAvatarUpdate);\nrootScope.addEventListener('peer_title_edit', async(data) => {\n if(!(await rootScope.managers.appAvatarsManager.isAvatarCached(data.peerId))) {\n onAvatarUpdate(data);\n }\n});\n\nexport async function openAvatarViewer(\n target: HTMLElement,\n peerId: PeerId,\n middleware: () => boolean,\n message?: any,\n prevTargets?: {element: HTMLElement, item: Photo.photo['id'] | Message.messageService}[],\n nextTargets?: typeof prevTargets\n) {\n let photo = await rootScope.managers.appProfileManager.getFullPhoto(peerId);\n if(!middleware() || !photo) {\n return;\n }\n\n const getTarget = () => {\n const good = Array.from(target.querySelectorAll('img')).find((img) => !img.classList.contains('emoji'));\n return good ? target : null;\n };\n\n if(peerId.isAnyChat()) {\n const hadMessage = !!message;\n const inputFilter = 'inputMessagesFilterChatPhotos';\n if(!message) {\n message = await rootScope.managers.appMessagesManager.getSearch({\n peerId,\n inputFilter: {_: inputFilter},\n maxId: 0,\n limit: 1\n }).then((value) => {\n // console.log(lol);\n // ! by descend\n return value.history[0];\n });\n\n if(!middleware()) {\n return;\n }\n }\n\n if(message) {\n // ! гений в деле, костылируем (но это гениально)\n const messagePhoto = message.action.photo;\n if(messagePhoto.id !== photo.id) {\n if(!hadMessage) {\n message = rootScope.managers.appMessagesManager.generateFakeAvatarMessage(peerId, photo);\n } else {\n\n }\n }\n\n const f = (arr: typeof prevTargets) => arr.map((el) => ({\n element: el.element,\n mid: (el.item as Message.messageService).mid,\n peerId: (el.item as Message.messageService).peerId\n }));\n\n new AppMediaViewer()\n .setSearchContext({\n peerId,\n inputFilter: {_: inputFilter}\n })\n .openMedia({\n message,\n target: getTarget(),\n prevTargets: prevTargets ? f(prevTargets) : undefined,\n nextTargets: nextTargets ? f(nextTargets) : undefined\n });\n\n return;\n }\n }\n\n if(photo) {\n if(!isObject(message) && message) {\n photo = await rootScope.managers.appPhotosManager.getPhoto(message);\n }\n\n const f = (arr: typeof prevTargets) => arr.map((el) => ({\n element: el.element,\n photoId: el.item as string\n }));\n\n new AppMediaViewerAvatar(peerId).openMedia({\n photoId: photo.id,\n target: getTarget(),\n prevTargets: prevTargets ? f(prevTargets) : undefined,\n nextTargets: nextTargets ? f(nextTargets) : undefined\n });\n }\n}\n\nconst believeMe: Map> = new Map();\nconst seen: Set = new Set();\n\nfunction getAvatarQueueKey(peerId: PeerId, threadId?: number) {\n return peerId + (threadId ? '_' + threadId : '');\n}\n\nexport default class AvatarElement extends HTMLElement {\n public peerId: PeerId;\n public isDialog: boolean;\n public peerTitle: string;\n public loadPromises: Promise[];\n public lazyLoadQueue: LazyLoadQueue;\n public isBig: boolean;\n public threadId: number;\n private addedToQueue = false;\n public wrapOptions: WrapSomethingOptions;\n\n public middlewareHelper: MiddlewareHelper;\n\n constructor() {\n super();\n this.classList.add('avatar-like');\n this.middlewareHelper = getMiddleware();\n }\n\n disconnectedCallback() {\n // браузер вызывает этот метод при удалении элемента из документа\n // (может вызываться много раз, если элемент многократно добавляется/удаляется)\n const key = getAvatarQueueKey(this.peerId, this.threadId);\n const set = believeMe.get(key);\n if(set?.has(this)) {\n set.delete(this);\n if(!set.size) {\n believeMe.delete(key);\n }\n }\n\n this.lazyLoadQueue?.delete({div: this});\n }\n\n public attachClickEvent() {\n let loading = false;\n attachClickEvent(this, async(e) => {\n cancelEvent(e);\n if(loading) return;\n const peerId = this.peerId;\n loading = true;\n await openAvatarViewer(this, this.peerId, () => this.peerId === peerId);\n loading = false;\n });\n }\n\n public updateOptions(options: Partial[0]>) {\n for(const i in options) {\n // @ts-ignore\n this[i] = options[i];\n }\n }\n\n public updateWithOptions(options: {\n peerId: PeerId,\n threadId?: number,\n isDialog?: boolean,\n isBig?: boolean,\n peerTitle?: string,\n lazyLoadQueue?: LazyLoadQueue | false,\n loadPromises?: Promise[],\n wrapOptions?: WrapSomethingOptions\n }) {\n const wasPeerId = this.peerId;\n const wasThreadId = this.threadId;\n this.updateOptions(options);\n const newPeerId = this.peerId;\n const threadId = this.threadId;\n\n if(wasPeerId === newPeerId && wasThreadId === threadId) {\n return;\n }\n\n this.dataset.peerId = '' + newPeerId;\n\n if(threadId) {\n this.dataset.threadId = '' + threadId;\n } else if(wasThreadId) {\n delete this.dataset.threadId;\n }\n\n if(wasPeerId) {\n const key = getAvatarQueueKey(wasPeerId, wasThreadId);\n const set = believeMe.get(key);\n if(set) {\n set.delete(this);\n if(!set.size) {\n believeMe.delete(key);\n }\n }\n }\n\n const middleware = options.wrapOptions?.middleware;\n this.middlewareHelper.destroy();\n if(middleware) {\n this.middlewareHelper = middleware.create();\n } else {\n this.middlewareHelper.destroy();\n }\n\n return this.update();\n }\n\n public remove() {\n this.middlewareHelper.destroy();\n super.remove();\n }\n\n private r(onlyThumb = false) {\n const promise = putPhoto({\n div: this,\n peerId: this.peerId,\n isDialog: this.isDialog,\n title: this.peerTitle,\n onlyThumb,\n isBig: this.isBig,\n threadId: this.threadId,\n wrapOptions: {\n middleware: this.middlewareHelper.get(),\n ...(this.wrapOptions || {})\n }\n });\n // recordPromise(promise, 'avatar putPhoto-' + this.peerId);\n\n if(this.loadPromises) {\n this.loadPromises.push(promise);\n\n promise.finally(() => {\n this.loadPromises = undefined;\n });\n }\n\n return promise;\n }\n\n public update() {\n if(this.lazyLoadQueue) {\n if(!seen.has(this.peerId)) {\n if(this.addedToQueue) return;\n this.addedToQueue = true;\n\n const key = getAvatarQueueKey(this.peerId, this.threadId);\n let set = believeMe.get(key);\n if(!set) {\n believeMe.set(key, set = new Set());\n }\n\n set.add(this);\n\n this.lazyLoadQueue.push({\n div: this,\n load: () => {\n seen.add(this.peerId);\n return this.update();\n }\n });\n\n return this.r(true);\n } else if(this.addedToQueue) {\n this.lazyLoadQueue.delete({div: this});\n }\n }\n\n seen.add(this.peerId);\n\n const promise = this.r();\n\n if(this.addedToQueue) {\n promise.finally(() => {\n this.addedToQueue = false;\n });\n }\n\n const key = getAvatarQueueKey(this.peerId, this.threadId);\n const set = believeMe.get(key);\n if(set) {\n set.delete(this);\n const arr = Array.from(set);\n believeMe.delete(key);\n\n for(let i = 0, length = arr.length; i < length; ++i) {\n arr[i].update();\n }\n }\n\n return promise;\n }\n}\n\ncustomElements.define('avatar-element', AvatarElement);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {CancellablePromise} from '../helpers/cancellablePromise';\nimport type {InputFile} from '../layer';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport PopupElement from './popups';\nimport PopupAvatar from './popups/avatar';\n\nexport default class AvatarEdit {\n public container: HTMLElement;\n private canvas: HTMLCanvasElement;\n private icon: HTMLSpanElement;\n\n constructor(onChange: (uploadAvatar: () => CancellablePromise) => void, options?: ConstructorParameters[0]) {\n this.container = document.createElement('div');\n this.container.classList.add('avatar-edit');\n\n this.canvas = document.createElement('canvas');\n this.canvas.classList.add('avatar-edit-canvas');\n\n this.icon = document.createElement('span');\n this.icon.classList.add('tgico', 'tgico-cameraadd');\n\n this.container.append(this.canvas, this.icon);\n\n attachClickEvent(this.container, () => {\n PopupElement.createPopup(PopupAvatar, options).open(this.canvas, onChange);\n });\n }\n\n public clear() {\n const ctx = this.canvas.getContext('2d');\n ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {FormatterArguments, i18n, LangPackKey} from '../lib/langPack';\nimport ripple from './ripple';\n\nexport type ButtonOptions = Partial<{\n noRipple: true,\n onlyMobile: true,\n icon: string,\n rippleSquare: true,\n text: LangPackKey,\n textArgs?: FormatterArguments,\n disabled: boolean,\n asDiv: boolean,\n asLink: boolean\n}>;\n\nexport default function Button(className: string, options: T = {} as T): T['asLink'] extends true ? HTMLAnchorElement : HTMLButtonElement {\n const button = document.createElement(options.asLink ? 'a' : (options.asDiv ? 'div' : 'button'));\n button.className = className + (options.icon ? ' tgico-' + options.icon : '');\n\n if(!options.noRipple) {\n if(options.rippleSquare) {\n button.classList.add('rp-square');\n }\n\n ripple(button);\n }\n\n if(options.onlyMobile) {\n button.classList.add('only-handhelds');\n }\n\n if(options.disabled) {\n button.setAttribute('disabled', 'true');\n }\n\n if(options.text) {\n button.append(i18n(options.text, options.textArgs));\n }\n\n return button as any;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Button from './button';\n\nconst ButtonCorner = (options: Partial<{className: string, icon: string, noRipple: true, onlyMobile: true, asDiv: boolean}> = {}) => {\n const button = Button('btn-circle btn-corner z-depth-1' + (options.className ? ' ' + options.className : ''), options);\n button.tabIndex = -1;\n return button;\n};\n\nexport default ButtonCorner;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Button from './button';\n\nconst ButtonIcon = (className?: string, options: Partial<{noRipple: true, onlyMobile: true, asDiv: boolean}> = {}) => {\n const button = Button('btn-icon', {\n icon: className || undefined,\n ...options\n });\n\n return button;\n};\n\nexport default ButtonIcon;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport flatten from '../helpers/array/flatten';\nimport contextMenuController from '../helpers/contextMenuController';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {AttachClickOptions, attachClickEvent} from '../helpers/dom/clickEvent';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport setInnerHTML from '../helpers/dom/setInnerHTML';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport {FormatterArguments, i18n, LangPackKey} from '../lib/langPack';\nimport CheckboxField from './checkboxField';\nimport {Document} from '../layer';\nimport wrapPhoto from './wrappers/photo';\nimport textToSvgURL from '../helpers/textToSvgURL';\nimport customProperties from '../helpers/dom/customProperties';\nimport {IS_MOBILE} from '../environment/userAgent';\nimport ripple from './ripple';\n\nexport type ButtonMenuItemOptions = {\n icon?: string,\n iconDoc?: Document.document,\n text?: LangPackKey,\n textArgs?: FormatterArguments,\n regularText?: Parameters[1],\n onClick: (e: MouseEvent | TouchEvent) => any,\n checkForClose?: () => boolean,\n element?: HTMLElement,\n textElement?: HTMLElement,\n options?: AttachClickOptions,\n checkboxField?: CheckboxField,\n noCheckboxClickListener?: boolean,\n keepOpen?: boolean,\n separator?: boolean | HTMLElement,\n multiline?: boolean,\n loadPromise?: Promise,\n waitForAnimation?: boolean\n /* , cancelEvent?: true */\n};\n\nexport type ButtonMenuItemOptionsVerifiable = ButtonMenuItemOptions & {\n verify?: () => boolean | Promise\n};\n\nfunction ButtonMenuItem(options: ButtonMenuItemOptions) {\n if(options.element) return [options.separator as HTMLElement, options.element].filter(Boolean);\n\n const {icon, iconDoc, text, onClick, checkboxField, noCheckboxClickListener} = options;\n const el = document.createElement('div');\n el.className = 'btn-menu-item rp-overflow' + (icon ? ' tgico-' + icon : '');\n\n if(IS_MOBILE) {\n ripple(el);\n }\n\n let textElement = options.textElement;\n if(!textElement) {\n textElement = options.textElement = text ? i18n(text, options.textArgs) : document.createElement('span');\n if(options.regularText) {\n setInnerHTML(textElement, options.regularText);\n }\n }\n\n if(iconDoc) {\n const iconElement = document.createElement('span');\n iconElement.classList.add('btn-menu-item-icon');\n el.append(iconElement);\n\n options.loadPromise = wrapPhoto({\n container: iconElement,\n photo: iconDoc,\n boxWidth: 24,\n boxHeight: 24,\n withoutPreloader: true,\n noFadeIn: true,\n noBlur: true,\n processUrl: (url) => {\n return fetch(url)\n .then((response) => response.text())\n .then((text) => {\n const color = customProperties.getProperty('primary-text-color');\n const doc = new DOMParser().parseFromString(text, 'image/svg+xml');\n const svg = doc.firstElementChild as HTMLElement;\n svg.querySelectorAll('path').forEach((path) => {\n path.setAttributeNS(null, 'fill', color);\n path.style.stroke = color;\n path.style.strokeWidth = '.25px';\n });\n return textToSvgURL(svg.outerHTML);\n });\n }\n }).then((ret) => ret.loadPromises.thumb);\n }\n\n textElement.classList.add('btn-menu-item-text');\n el.append(textElement);\n\n const keepOpen = !!checkboxField || !!options.keepOpen;\n\n // * cancel mobile keyboard close\n onClick && attachClickEvent(el, /* CLICK_EVENT_NAME !== 'click' || keepOpen ? */ /* async */(e) => {\n cancelEvent(e);\n\n const menu = findUpClassName(e.target, 'btn-menu');\n if(menu && !menu.classList.contains('active')) {\n return;\n }\n\n // let closed = false;\n // if(!keepOpen && !options.checkForClose) {\n // closed = true;\n // contextMenuController.close();\n // }\n\n // wait for closing animation\n // if(options.waitForAnimation && rootScope.settings.animationsEnabled && !options.checkForClose) {\n // await pause(125);\n // }\n\n onClick(e);\n if(options.checkForClose?.() === false) {\n return;\n }\n\n if(!keepOpen/* && !closed */) {\n contextMenuController.close();\n }\n\n if(checkboxField && !noCheckboxClickListener/* && result !== false */) {\n checkboxField.checked = checkboxField.input.type === 'radio' ? true : !checkboxField.checked;\n }\n }/* : onClick */, options.options);\n\n if(checkboxField) {\n el.append(checkboxField.label);\n }\n\n if(options.separator === true) {\n options.separator = document.createElement('hr');\n }\n\n if(options.multiline) {\n el.classList.add('is-multiline');\n }\n\n return [options.separator as HTMLElement, options.element = el].filter(Boolean);\n}\n\nexport function ButtonMenuSync({listenerSetter, buttons}: {\n buttons: ButtonMenuItemOptions[],\n listenerSetter?: ListenerSetter\n}) {\n const el: HTMLElement = document.createElement('div');\n el.classList.add('btn-menu');\n\n if(listenerSetter) {\n buttons.forEach((b) => {\n if(b.options) {\n b.options.listenerSetter = listenerSetter;\n } else {\n b.options = {listenerSetter};\n }\n });\n }\n\n const items = buttons.map(ButtonMenuItem);\n el.append(...flatten(items));\n\n return el;\n}\n\nexport default async function ButtonMenu(options: Parameters[0]) {\n const el = ButtonMenuSync(options);\n await Promise.all(options.buttons.map(({loadPromise}) => loadPromise));\n return el;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport contextMenuController from '../helpers/contextMenuController';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {AttachClickOptions, CLICK_EVENT_NAME, hasMouseMovedSinceDown} from '../helpers/dom/clickEvent';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport ButtonIcon from './buttonIcon';\nimport ButtonMenu, {ButtonMenuItemOptionsVerifiable} from './buttonMenu';\nimport filterAsync from '../helpers/array/filterAsync';\nimport {doubleRaf} from '../helpers/schedulers';\n\n// TODO: refactor for attachClickEvent, because if move finger after touchstart, it will start anyway\nexport function ButtonMenuToggleHandler({\n el,\n onOpen,\n options,\n onClose\n}: {\n el: HTMLElement,\n onOpen?: (e: Event) => any,\n options?: AttachClickOptions,\n onClose?: () => void\n}) {\n const add = options?.listenerSetter ? options.listenerSetter.add(el) : el.addEventListener.bind(el);\n\n add(CLICK_EVENT_NAME, (e: Event) => {\n if(!el.classList.contains('btn-menu-toggle') || hasMouseMovedSinceDown(e)) return false;\n\n cancelEvent(e);\n\n if(el.classList.contains('menu-open')) {\n contextMenuController.close();\n } else {\n const result = onOpen?.(e);\n const open = () => {\n const openedMenu = el.querySelector('.btn-menu') as HTMLDivElement;\n contextMenuController.openBtnMenu(openedMenu, onClose);\n };\n\n if(result instanceof Promise) {\n result.then(open);\n } else {\n open();\n }\n }\n });\n}\n\nexport default function ButtonMenuToggle({\n buttonOptions,\n listenerSetter: attachListenerSetter,\n container,\n direction,\n buttons,\n onOpenBefore,\n onOpen,\n onClose,\n onCloseAfter\n}: {\n buttonOptions?: Parameters[1],\n listenerSetter?: ListenerSetter,\n container?: HTMLElement\n direction: 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right',\n buttons: ButtonMenuItemOptionsVerifiable[],\n onOpenBefore?: (e: Event) => any,\n onOpen?: (e: Event, element: HTMLElement) => any,\n onClose?: () => void,\n onCloseAfter?: () => void\n}) {\n if(buttonOptions) {\n buttonOptions.asDiv = true;\n }\n\n const button = container ?? ButtonIcon('more', buttonOptions);\n button.classList.add('btn-menu-toggle');\n\n const listenerSetter = new ListenerSetter();\n\n let element: HTMLElement, closeTimeout: number;\n ButtonMenuToggleHandler({\n el: button,\n onOpen: async(e) => {\n await onOpenBefore?.(e);\n if(closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n return;\n }\n\n const f = (b: (typeof buttons[0])[]) => filterAsync(b, (button) => button?.verify?.() ?? true);\n\n const filteredButtons = await f(buttons);\n if(!filteredButtons.length) {\n return;\n }\n\n const _element = element = await ButtonMenu({\n buttons: filteredButtons,\n listenerSetter\n });\n _element.classList.add(direction);\n\n await onOpen?.(e, _element);\n\n button.append(_element);\n await doubleRaf();\n },\n options: {\n listenerSetter: attachListenerSetter\n },\n onClose: () => {\n onClose?.();\n\n closeTimeout = window.setTimeout(() => {\n onCloseAfter?.();\n closeTimeout = undefined;\n listenerSetter.removeAll();\n buttons.forEach((button) => button.element = undefined);\n element.remove();\n }, 300);\n }\n });\n\n return button;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../../lib/rootScope';\n// import { generatePathData } from \"../../helpers/dom\";\nimport {MyMessage} from '../../lib/appManagers/appMessagesManager';\nimport type Chat from './chat';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport insertInDescendSortedArray from '../../helpers/array/insertInDescendSortedArray';\nimport positionElementByIndex from '../../helpers/dom/positionElementByIndex';\nimport AvatarElement from '../avatar';\nimport {Message} from '../../layer';\nimport {NULL_PEER_ID, REPLIES_PEER_ID} from '../../lib/mtproto/mtproto_config';\nimport {SERVICE_AS_REGULAR, STICKY_OFFSET} from './bubbles';\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport partition from '../../helpers/array/partition';\nimport noop from '../../helpers/noop';\nimport getMessageThreadId from '../../lib/appManagers/utils/messages/getMessageThreadId';\n\ntype GroupItem = {\n bubble: HTMLElement,\n fromId: PeerId,\n mid: number,\n groupMid?: number,\n timestamp: number,\n dateTimestamp: number,\n mounted: boolean,\n single: boolean,\n group?: BubbleGroup,\n message: Message.message | Message.messageService // use it only to set avatar\n};\n\nclass BubbleGroup {\n container: HTMLElement;\n chat: Chat;\n groups: BubbleGroups;\n items: GroupItem[]; // descend sorted\n avatarContainer: HTMLElement;\n avatarLoadPromise: ReturnType;\n avatar: AvatarElement;\n mounted: boolean;\n dateTimestamp: number;\n offset: number;\n\n constructor(chat: Chat, groups: BubbleGroups, dateTimestamp: number) {\n this.container = document.createElement('div');\n this.container.classList.add('bubbles-group');\n this.chat = chat;\n this.groups = groups;\n this.items = [];\n this.dateTimestamp = dateTimestamp;\n this.offset = 0;\n }\n\n createAvatar(message: Message.message | Message.messageService) {\n if(this.avatarLoadPromise) {\n return this.avatarLoadPromise;\n } else if(message._ === 'messageService') {\n return;\n }\n\n this.avatarContainer = document.createElement('div');\n this.avatarContainer.classList.add('bubbles-group-avatar-container');\n ++this.offset;\n\n const fwdFrom = message.fwd_from;\n const fwdFromId = message.fwdFromId;\n const isForwardFromChannel = message.from_id && message.from_id._ === 'peerChannel' && message.fromId === fwdFromId;\n const currentPeerId = this.chat.peerId;\n const avatar = this.avatar = new AvatarElement();\n this.avatar.classList.add('bubbles-group-avatar', 'user-avatar', 'avatar-40'/* , 'can-zoom-fade' */);\n const peerId = ((fwdFrom && (currentPeerId === rootScope.myId || currentPeerId === REPLIES_PEER_ID)) || isForwardFromChannel ? fwdFromId : message.fromId) || NULL_PEER_ID;\n const avatarLoadPromise = this.avatar.updateWithOptions({\n lazyLoadQueue: this.chat.bubbles.lazyLoadQueue,\n peerId,\n peerTitle: !fwdFromId && fwdFrom && fwdFrom.from_name ? /* '🔥 FF 🔥' */fwdFrom.from_name : undefined\n });\n\n // this.avatarLoadPromise = Promise.all([\n // avatarLoadPromise,\n // peerId && peerId.isUser() ? this.chat.managers.appUsersManager.getUser(peerId.toUserId()) : undefined\n // ]).then(([result, user]) => {\n // if(user?.pFlags?.premium) {\n // avatar.classList.add('is-premium', 'tgico-star');\n // }\n\n // return result;\n // });\n this.avatarLoadPromise = avatarLoadPromise;\n\n this.avatarContainer.append(this.avatar);\n this.container.append(this.avatarContainer);\n\n return this.avatarLoadPromise;\n }\n\n get firstTimestamp() {\n return this.firstItem.timestamp;\n }\n\n get firstMid() {\n return this.firstItem.mid;\n }\n\n get firstItem() {\n return this.items[this.items.length - 1];\n }\n\n get lastTimestamp() {\n return this.lastItem.timestamp;\n }\n\n get lastMid() {\n return this.lastItem.mid;\n }\n\n get lastItem() {\n return this.items[0];\n }\n\n updateClassNames() {\n const items = this.items;\n const length = items.length;\n if(!length) {\n return;\n }\n\n // const elements = Array.from(this.container.children);\n // if(this.offset) elements.splice(0, this.offset);\n\n // const length = elements.length;\n // if(!length) {\n // return;\n // }\n\n const first = items[length - 1].bubble;\n\n if(items.length === 1) {\n first.classList.add('is-group-first', 'is-group-last');\n // this.setClipIfNeeded(first);\n return;\n } else {\n first.classList.remove('is-group-last');\n first.classList.add('is-group-first');\n // this.setClipIfNeeded(first, true);\n }\n\n for(let i = 1, _length = length - 1; i < _length; ++i) {\n const bubble = items[i].bubble;\n bubble.classList.remove('is-group-last', 'is-group-first');\n // this.setClipIfNeeded(bubble, true);\n }\n\n const last = items[0].bubble;\n last.classList.remove('is-group-first');\n last.classList.add('is-group-last');\n // this.setClipIfNeeded(last);\n }\n\n insertItem(item: GroupItem) {\n const {items} = this;\n insertInDescendSortedArray(items, item, this.groups.sortGroupItemsKey);\n\n item.group = this;\n if(items.length === 1) {\n this.groups.insertGroup(this);\n }\n }\n\n removeItem(item: GroupItem) {\n indexOfAndSplice(this.items, item);\n\n if(!this.items.length) {\n indexOfAndSplice(this.groups.groups, this);\n }\n\n item.group = undefined;\n }\n\n mount(updateClassNames?: boolean) {\n if(!this.groups.groups.includes(this) || !this.items.length) { // group can be already removed\n debugger;\n\n if(this.mounted) {\n this.onItemUnmount();\n }\n\n return;\n }\n\n const {offset, items} = this;\n const {length} = items;\n forEachReverse(items, (item, idx) => {\n this.mountItem(item, length - 1 - idx, offset);\n });\n\n if(updateClassNames) {\n this.updateClassNames();\n }\n\n this.onItemMount();\n }\n\n mountItem(item: GroupItem, idx = this.items.indexOf(item), offset = this.offset) {\n if(item.mounted) {\n return;\n }\n\n positionElementByIndex(item.bubble, this.container, offset + idx);\n item.mounted = true;\n }\n\n unmountItem(item: GroupItem) {\n if(!item.mounted) {\n return;\n }\n\n item.bubble.remove();\n item.mounted = false;\n this.onItemUnmount();\n }\n\n onItemMount() {\n if(this.mounted) {\n return;\n }\n\n const dateContainer = this.chat.bubbles.getDateContainerByTimestamp(this.dateTimestamp / 1000);\n // const idx = this.groups.indexOf(group);\n const dateGroups = this.groups.groups.filter((_group) => _group.dateTimestamp === this.dateTimestamp);\n const dateGroupsLength = dateGroups.length;\n const idx = dateGroups.indexOf(this);\n const unmountedLength = dateGroups.slice(idx + 1).reduce((acc, v) => acc + (v.mounted ? 0 : 1), 0);\n positionElementByIndex(this.container, dateContainer.container, STICKY_OFFSET + dateGroupsLength - 1 - idx - unmountedLength);\n this.mounted = true;\n }\n\n onItemUnmount() {\n if(!this.mounted) {\n return;\n }\n\n if(!this.items.length) {\n this.container.remove();\n this.chat.bubbles.deleteEmptyDateGroups();\n this.mounted = false;\n } else {\n this.updateClassNames();\n }\n }\n}\n\n// class BubbleGroupItem implements GroupItem {\n// bubble: HTMLElement;\n// fromId: PeerId;\n// mid: number;\n// timestamp: number;\n// dateTimestamp: number;\n// mounted: boolean;\n// single: boolean;\n// group: BubbleGroup;\n\n// constructor(details: GroupItem) {\n// Object.assign(this, details);\n// }\n// }\n\nexport default class BubbleGroups {\n public itemsArr: Array = []; // descend sorted\n private itemsMap: Map = new Map();\n public groups: Array = []; // descend sorted\n private newGroupDiff = 121; // * 121 in scheduled messages\n private sortItemsKey: Extract;\n private sortGroupsKey: Extract;\n public sortGroupItemsKey: Extract;\n\n constructor(private chat: Chat) {\n this.sortItemsKey = chat.type === 'scheduled' ? 'timestamp' : 'mid';\n this.sortGroupsKey = chat.type === 'scheduled' ? 'lastTimestamp' : 'lastMid';\n this.sortGroupItemsKey = /* chat.type === 'scheduled' ? 'timestamp' : */'groupMid';\n }\n\n removeItem(item: GroupItem) {\n item.group?.removeItem(item);\n this.removeItemFromCache(item);\n }\n\n removeAndUnmountBubble(bubble: HTMLElement) {\n const item = this.getItemByBubble(bubble);\n if(!item) {\n if(bubble.parentElement) {\n bubble.remove(); // * can be a placeholder\n }\n\n return false;\n }\n\n const items = this.itemsArr;\n const index = items.indexOf(item);\n const siblings = this.getSiblingsAtIndex(index, items);\n\n const group = item.group;\n this.removeItem(item);\n\n const modifiedGroups: Set = new Set();\n if(group) {\n group.unmountItem(item);\n modifiedGroups.add(group);\n }\n\n const [previousSibling, nextSibling] = siblings;\n if(\n previousSibling &&\n nextSibling &&\n this.canItemsBeGrouped(previousSibling, nextSibling) &&\n previousSibling.group !== nextSibling.group\n ) {\n const group = nextSibling.group;\n this.f(nextSibling.group.items);\n group.onItemUnmount();\n modifiedGroups.add(previousSibling.group);\n this.groupUngrouped();\n }\n\n this.mountUnmountGroups(Array.from(modifiedGroups));\n\n return true;\n }\n\n mountUnmountGroups(groups: BubbleGroup[]) {\n // groups.sort((a, b) => (b.lastItem?.mid ?? 0) - (a.lastItem?.mid ?? 0));\n\n const [toMount, toUnmount] = partition(groups, (group) => !!group.items.length);\n toUnmount.forEach((group) => {\n group.onItemUnmount();\n })\n\n toMount.forEach((group) => {\n group.mount(true);\n });\n\n // toMount.forEach((group) => {\n // group.updateClassNames();\n // });\n }\n\n f(items: GroupItem[], index: number = 0, length = items.length) {\n for(; index < length; ++index) {\n const item = items[index];\n item.mounted = false;\n item.group.removeItem(item);\n --length;\n --index;\n }\n }\n\n getItemByBubble(bubble: HTMLElement) {\n return this.itemsMap.get(bubble);\n }\n\n getLastGroup() {\n return this.groups[0];\n }\n\n changeBubbleMid(bubble: HTMLElement, mid: number) {\n const item = this.getItemByBubble(bubble);\n if(!item) {\n return;\n }\n\n item.mid = mid;\n\n // indexOfAndSplice(item.group.items, item);\n // // const canChangeGroupMid = !item.group.items.length || item.group.items.every((item) => item.groupMid === item.mid);\n // // if(canChangeGroupMid) item.groupMid = mid;\n // item.group.insertItem(item);\n\n indexOfAndSplice(this.itemsArr, item);\n this.insertItemToArray(item, this.itemsArr);\n }\n\n changeItemBubble(item: GroupItem, bubble: HTMLElement) {\n this.itemsMap.delete(item.bubble);\n item.bubble = bubble;\n this.itemsMap.set(bubble, item);\n }\n\n changeBubbleByBubble(from: HTMLElement, to: HTMLElement) {\n const item = this.getItemByBubble(from);\n if(!item) {\n return;\n }\n\n this.changeItemBubble(item, to);\n }\n\n canItemsBeGrouped(item1: GroupItem, item2: GroupItem) {\n return item2.fromId === item1.fromId &&\n Math.abs(item2.timestamp - item1.timestamp) <= this.newGroupDiff &&\n item1.dateTimestamp === item2.dateTimestamp &&\n !item1.single &&\n !item2.single &&\n item1.message.pFlags.out === item2.message.pFlags.out &&\n (!this.chat.isAllMessagesForum || getMessageThreadId(item1.message, true) === getMessageThreadId(item2.message, true)) &&\n (!item1.message.pFlags.out || item1.message.fromId === rootScope.myId);\n }\n\n getSiblingsAtIndex(itemIndex: number, items: GroupItem[]) {\n return [items[itemIndex - 1], items[itemIndex + 1]] as const;\n }\n\n // findGroupSiblingInSiblings(item: GroupItem, siblings: ReturnType) {\n // return siblings.find((sibling) => sibling && this.canItemsBeGrouped(item, sibling));\n // }\n\n findGroupSiblingByItem(item: GroupItem, items: GroupItem[]) {\n items = items.slice();\n const idx = this.insertItemToArray(item, items);\n // return this.findGroupSiblingInSiblings(item, this.getSiblingsAtIndex(idx, items));\n return this.findGroupSiblingInItems(item, items, idx);\n }\n\n findGroupSiblingInItems(item: GroupItem, items: GroupItem[], index = items.indexOf(item), length = items.length) {\n const previousItem = items[index - 1];\n let siblingGroupedItem: GroupItem;\n if(previousItem?.group && this.canItemsBeGrouped(item, previousItem)) {\n siblingGroupedItem = previousItem;\n } else {\n for(let k = index + 1; k < length; ++k) {\n const nextItem = items[k];\n if(this.canItemsBeGrouped(item, nextItem)) {\n if(nextItem.group) {\n siblingGroupedItem = nextItem;\n }\n } else {\n break;\n }\n }\n }\n\n return siblingGroupedItem;\n }\n\n addItemToGroup(item: GroupItem, group: BubbleGroup) {\n group.insertItem(item);\n this.addItemToCache(item);\n }\n\n insertItemToArray(item: GroupItem, array: GroupItem[]) {\n return insertInDescendSortedArray(array, item, this.sortItemsKey);\n }\n\n insertGroup(group: BubbleGroup) {\n return insertInDescendSortedArray(this.groups, group, this.sortGroupsKey);\n }\n\n addItemToCache(item: GroupItem) {\n this.insertItemToArray(item, this.itemsArr);\n this.itemsMap.set(item.bubble, item);\n }\n\n removeItemFromCache(item: GroupItem) {\n indexOfAndSplice(this.itemsArr, item);\n this.itemsMap.delete(item.bubble);\n }\n\n getMessageFromId(message: MyMessage) {\n let fromId = /* (this.chat.peerId.isAnyChat() && message.viaBotId) || */message.fromId;\n\n // fix for saved messages forward to self\n if(fromId === rootScope.myId && message.peerId === rootScope.myId && (message as Message.message).fwdFromId === fromId) {\n fromId = fromId.toPeerId(true);\n }\n\n return fromId;\n }\n\n createItem(bubble: HTMLElement, message: MyMessage) {\n const single = !(message._ === 'message' || (message.action && SERVICE_AS_REGULAR.has(message.action._)));\n const {mid, date: timestamp} = message;\n const {dateTimestamp} = this.chat.bubbles.getDateForDateContainer(timestamp);\n const item: GroupItem = {\n mid,\n groupMid: this.chat.type === 'scheduled' ? +`${(timestamp * 1000 - dateTimestamp) / 1000}.${mid}` : mid,\n fromId: this.getMessageFromId(message),\n bubble,\n // timestamp: this.chat.type === 'scheduled' ? +`${(timestamp * 1000 - dateTimestamp) / 1000}.${mid}` : timestamp,\n timestamp,\n dateTimestamp,\n mounted: false,\n single,\n message\n };\n\n return item;\n }\n\n splitSiblingsOnGrouping(siblings: ReturnType) {\n const [previousSibling, nextSibling] = siblings;\n const previousGroup = previousSibling?.group;\n const nextGroup = nextSibling?.group;\n\n if(!previousGroup) {\n return;\n }\n\n // will refresh group\n // if(previousGroup === nextGroup) {\n const items = previousGroup.items;\n const index = items.indexOf(previousSibling) + 1;\n const length = items.length;\n if(index === length) {\n return;\n }\n\n const modifiedGroups: BubbleGroup[] = [previousGroup];\n // if(previousGroup !== nextGroup && nextGroup) {\n // modifiedGroups.push(nextGroup);\n // }\n\n this.f(items, index, length);\n return modifiedGroups;\n // }\n }\n\n prepareForGrouping(bubble: HTMLElement, message: MyMessage) {\n const foundItem = this.getItemByBubble(bubble);\n if(foundItem) { // should happen only on edit\n // debugger;\n return;\n }\n\n const item = this.createItem(bubble, message);\n this.addItemToCache(item);\n }\n\n groupUngrouped() {\n const items = this.itemsArr;\n const length = items.length;\n const modifiedGroups: Set = new Set();\n // for(let i = length - 1; i >= 0; --i) {\n for(let i = 0; i < length; ++i) {\n const item = items[i];\n if(item.group) {\n continue;\n }\n\n let hadGroup = true;\n const siblings = this.getSiblingsAtIndex(i, items);\n const siblingGroupedItem = this.findGroupSiblingInItems(item, items, i, length);\n\n // const foundItem = this.findGroupSiblingInSiblings(item, siblings);\n const foundItem = siblingGroupedItem;\n const group = foundItem?.group ?? (hadGroup = false, new BubbleGroup(this.chat, this, item.dateTimestamp));\n\n modifiedGroups.add(group);\n group.insertItem(item);\n\n if(!hadGroup) {\n const splittedGroups = this.splitSiblingsOnGrouping(siblings);\n if(splittedGroups) {\n splittedGroups.forEach((group) => modifiedGroups.add(group));\n }\n }\n }\n\n return modifiedGroups;\n }\n\n // addBubble(bubble: HTMLElement, message: MyMessage, unmountIfFound?: boolean) {\n // const oldItem = this.getItemByBubble(bubble);\n // if(unmountIfFound) { // updating position\n // this.removeAndUnmountBubble(bubble);\n // } else if(oldItem) { // editing\n // const group = oldItem.group;\n // this.changeItemBubble(oldItem, bubble);\n // oldItem.mounted = false;\n\n // return {item: oldItem, group};\n // }\n\n // const item = this.createItem(bubble, message);\n\n // const foundItem = this.findSameGroupItem(item, this.itemsArr);\n\n // const group = foundItem?.group ?? new BubbleGroup(this.chat, this, item.dateTimestamp);\n // this.addItemToGroup(item, group);\n\n // return {item, group};\n // }\n\n /* setClipIfNeeded(bubble: HTMLDivElement, remove = false) {\n //console.log('setClipIfNeeded', bubble, remove);\n const className = bubble.className;\n if(className.includes('is-message-empty') && (className.includes('photo') || className.includes('video'))) {\n let container = bubble.querySelector('.bubble__media-container') as SVGSVGElement;\n //console.log('setClipIfNeeded', bubble, remove, container);\n if(!container) return;\n\n try {\n Array.from(container.children).forEach((object) => {\n if(object instanceof SVGDefsElement) return;\n\n if(remove) {\n object.removeAttributeNS(null, 'clip-path');\n } else {\n let clipId = container.dataset.clipId;\n let path = container.firstElementChild.firstElementChild.lastElementChild as SVGPathElement;\n let width = +object.getAttributeNS(null, 'width');\n let height = +object.getAttributeNS(null, 'height');\n let isOut = className.includes('is-out');\n let isReply = className.includes('is-reply');\n let d = '';\n\n //console.log('setClipIfNeeded', object, width, height, isOut);\n\n let tr: number, tl: number;\n if(className.includes('forwarded') || isReply) {\n tr = tl = 0;\n } else if(isOut) {\n tr = className.includes('is-group-first') ? 12 : 6;\n tl = 12;\n } else {\n tr = 12;\n tl = className.includes('is-group-first') ? 12 : 6;\n }\n\n if(isOut) {\n d = generatePathData(0, 0, width - 9, height, tl, tr, 0, 12);\n } else {\n d = generatePathData(9, 0, width - 9, height, tl, tr, 12, 0);\n }\n\n path.setAttributeNS(null, 'd', d);\n object.setAttributeNS(null, 'clip-path', 'url(#' + clipId + ')');\n }\n });\n } catch(err) {}\n }\n } */\n\n // updateGroupByMessageId(mid: number) {\n // const item = this.itemsArr.find((g) => g.mid === mid);\n // if(item) {\n // item.group.updateGroup();\n // }\n // }\n\n cleanup() {\n this.itemsArr = [];\n this.groups = [];\n this.itemsMap.clear();\n }\n\n // findIncorrentPositions() {\n // var bubbles = Array.from(this.chat.bubbles.chatInner.querySelectorAll('.bubbles-group .bubble')).reverse();\n // var items = this.itemsArr;\n // for(var i = 0, length = items.length; i < length; ++i) {\n // const item = items[i];\n // const foundBubble = bubbles[i];\n // if(item.bubble !== foundBubble) {\n // console.log('incorrect position', i, item, foundBubble);\n // // debugger;\n // // break;\n // }\n // }\n // }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Message} from '../../layer';\nimport rootScope from '../../lib/rootScope';\nimport ripple from '../ripple';\nimport I18n from '../../lib/langPack';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport StackedAvatars from '../stackedAvatars';\nimport formatNumber from '../../helpers/number/formatNumber';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport type LazyLoadQueue from '../lazyLoadQueue';\n\nconst TAG_NAME = 'replies-element';\n\nrootScope.addEventListener('replies_updated', (message) => {\n (Array.from(document.querySelectorAll(TAG_NAME + `[data-post-key=\"${message.peerId}_${message.mid}\"]`)) as RepliesElement[]).forEach((element) => {\n element.message = message;\n element.render();\n });\n});\n\nexport default class RepliesElement extends HTMLElement {\n public message: Message.message;\n public type: 'footer' | 'beside';\n public loadPromises: Promise[];\n public lazyLoadQueue: LazyLoadQueue;\n public stackedAvatars: StackedAvatars;\n public text: I18n.IntlElement;\n public managers: AppManagers;\n\n private updated = false;\n\n constructor() {\n super();\n this.managers = rootScope.managers;\n }\n\n public init() {\n this.render();\n this.dataset.postKey = this.message.peerId + '_' + this.message.mid;\n this.classList.add('replies', 'replies-' + this.type);\n }\n\n public render() {\n const replies = this.message.replies;\n\n /* if(this.firstChild) {\n this.innerHTML = '';\n } */\n\n if(this.type === 'footer') {\n let leftPart: HTMLElement;\n if(this.firstElementChild) {\n leftPart = this.firstElementChild as HTMLElement;\n }\n\n if(replies?.recent_repliers) {\n if(leftPart && !leftPart.classList.contains('replies-footer-avatars')) {\n this.innerHTML = '';\n leftPart = null;\n }\n\n if(!this.stackedAvatars) {\n this.stackedAvatars = new StackedAvatars({\n lazyLoadQueue: this.lazyLoadQueue,\n avatarSize: 30\n });\n\n this.stackedAvatars.container.classList.add('replies-footer-avatars');\n }\n\n leftPart = this.stackedAvatars.container;\n\n this.stackedAvatars.render(replies.recent_repliers.map((peer) => getPeerId(peer)), this.loadPromises);\n } else {\n if(leftPart && !leftPart.classList.contains('tgico-comments')) {\n leftPart.remove();\n leftPart = null;\n }\n\n if(!leftPart) {\n leftPart = document.createElement('span');\n leftPart.classList.add('tgico-comments');\n }\n }\n\n if(!leftPart.parentElement) {\n this.prepend(leftPart);\n }\n\n if(!this.text) {\n this.text = new I18n.IntlElement();\n }\n\n const text = this.text;\n if(replies) {\n if(replies.replies) {\n text.compareAndUpdate({key: 'Comments', args: [replies.replies]});\n } else {\n text.compareAndUpdate({key: 'LeaveAComment'});\n }\n } else {\n text.compareAndUpdate({key: 'ViewInChat'});\n }\n\n if(replies) {\n // const historyStorage = appMessagesManager.getHistoryStorage(replies.channel_id.toPeerId(true));\n let isUnread = false;\n if(replies.replies) {\n if(replies.read_max_id !== undefined && replies.max_id !== undefined) {\n isUnread = replies.read_max_id < replies.max_id;\n }/* else {\n isUnread = !historyStorage.readMaxId || historyStorage.readMaxId < (replies.max_id || 0);\n } */\n }\n this.classList.toggle('is-unread', isUnread);\n }\n\n let textSpan = this.children[1] as HTMLElement;\n if(!textSpan) {\n textSpan = document.createElement('span');\n textSpan.classList.add('replies-footer-text');\n\n const iconSpan = document.createElement('span');\n iconSpan.classList.add('tgico-next');\n\n const rippleContainer = document.createElement('div');\n ripple(rippleContainer);\n\n this.append(textSpan, iconSpan, rippleContainer);\n }\n\n replaceContent(textSpan, text.element);\n } else {\n this.classList.add('bubble-beside-button');\n this.innerHTML = `${replies?.replies ? formatNumber(replies.replies, 0) : ''}`;\n }\n\n if(replies && !this.updated && !this.message.pFlags.is_outgoing) {\n this.managers.appMessagesManager.subscribeRepliesThread(this.message.peerId, this.message.mid);\n this.managers.appMessagesManager.updateMessage(this.message.peerId, this.message.mid, 'replies_updated');\n this.updated = true;\n }\n\n if(this.loadPromises) {\n this.loadPromises = undefined;\n }\n }\n}\n\ncustomElements.define(TAG_NAME, RepliesElement);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {formatTime, getFullDate} from '../../helpers/date';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport formatNumber from '../../helpers/number/formatNumber';\nimport {Message} from '../../layer';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport {i18n, _i18n} from '../../lib/langPack';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport rootScope from '../../lib/rootScope';\nimport type LazyLoadQueue from '../lazyLoadQueue';\nimport PeerTitle from '../peerTitle';\nimport wrapReply from '../wrappers/reply';\nimport Chat, {ChatType} from './chat';\nimport RepliesElement from './replies';\n\nconst NBSP = ' ';\n\nconst makeEdited = () => {\n const edited = document.createElement('i');\n edited.classList.add('edited');\n _i18n(edited, 'EditedMessage');\n return edited;\n};\n\nconst makeSponsored = () => i18n('SponsoredMessage');\n\nexport namespace MessageRender {\n /* export const setText = () => {\n\n }; */\n\n export const setTime = (options: {\n chatType: ChatType,\n message: Message.message | Message.messageService,\n reactionsMessage?: Message.message\n }) => {\n const {chatType, message} = options;\n const date = new Date(message.date * 1000);\n const args: (HTMLElement | string)[] = [];\n\n let editedSpan: HTMLElement,\n sponsoredSpan: HTMLElement;\n // reactionsElement: ReactionsElement,\n // reactionsMessage: Message.message;\n\n const isSponsored = !!(message as Message.message).pFlags.sponsored;\n const isMessage = !('action' in message) && !isSponsored;\n // let hasReactions: boolean;\n\n const time: HTMLElement = isSponsored ? undefined : formatTime(date);\n if(isMessage) {\n if(message.views) {\n const postAuthor = message.post_author || message.fwd_from?.post_author;\n\n const postViewsSpan = document.createElement('span');\n postViewsSpan.classList.add('post-views');\n postViewsSpan.innerHTML = formatNumber(message.views, 1);\n\n const channelViews = document.createElement('i');\n channelViews.classList.add('tgico-channelviews', 'time-icon');\n\n args.push(postViewsSpan, channelViews);\n if(postAuthor) {\n const span = document.createElement('span');\n setInnerHTML(span, wrapEmojiText(postAuthor));\n span.insertAdjacentHTML('beforeend', ',' + NBSP)\n args.push(span);\n }\n }\n\n if(message.edit_date && chatType !== 'scheduled' && !message.pFlags.edit_hide) {\n args.unshift(editedSpan = makeEdited());\n }\n\n if(chatType !== 'pinned' && message.pFlags.pinned) {\n const i = document.createElement('i');\n i.classList.add('tgico-pinnedchat', 'time-icon');\n args.unshift(i);\n }\n\n // if(USER_REACTIONS_INLINE && message.peer_id._ === 'peerUser'/* && message.reactions?.results?.length */) {\n // hasReactions = true;\n\n // reactionsMessage = options.reactionsMessage;\n // reactionsElement = new ReactionsElement();\n // reactionsElement.init(reactionsMessage, 'inline', true);\n // reactionsElement.render();\n // args.unshift(reactionsElement);\n // }\n } else if(isSponsored) {\n args.push(sponsoredSpan = makeSponsored());\n }\n\n if(time) {\n args.push(time);\n }\n\n let title = isSponsored ? undefined : getFullDate(date);\n if(isMessage) {\n title += (message.edit_date && !message.pFlags.edit_hide ? `\\nEdited: ${getFullDate(new Date(message.edit_date * 1000))}` : '') +\n (message.fwd_from ? `\\nOriginal: ${getFullDate(new Date(message.fwd_from.date * 1000))}` : '');\n }\n\n const timeSpan = document.createElement('span');\n timeSpan.classList.add('time', 'tgico');\n // if(title) timeSpan.title = title;\n timeSpan.append(...args);\n\n const inner = document.createElement('div');\n inner.classList.add('inner', 'tgico');\n if(title) inner.title = title;\n\n let clonedArgs = args;\n if(editedSpan) {\n clonedArgs[clonedArgs.indexOf(editedSpan)] = makeEdited();\n }\n if(sponsoredSpan) {\n clonedArgs[clonedArgs.indexOf(sponsoredSpan)] = makeSponsored();\n }\n // if(reactionsElement) {\n // const _reactionsElement = clonedArgs[clonedArgs.indexOf(reactionsElement)] = new ReactionsElement();\n // _reactionsElement.init(reactionsMessage, 'inline');\n // _reactionsElement.render();\n // }\n clonedArgs = clonedArgs.map((a) => a instanceof HTMLElement && !a.classList.contains('i18n') && !a.classList.contains('reactions') ? a.cloneNode(true) as HTMLElement : a);\n if(time) {\n clonedArgs[clonedArgs.length - 1] = formatTime(date); // clone time\n }\n inner.append(...clonedArgs);\n\n timeSpan.append(inner);\n\n return timeSpan;\n };\n\n export const renderReplies = ({bubble, bubbleContainer, message, messageDiv, loadPromises, lazyLoadQueue}: {\n bubble: HTMLElement,\n bubbleContainer: HTMLElement,\n message: Message.message,\n messageDiv: HTMLElement,\n loadPromises?: Promise[],\n lazyLoadQueue?: LazyLoadQueue\n }) => {\n const isFooter = !bubble.classList.contains('sticker') && !bubble.classList.contains('emoji-big') && !bubble.classList.contains('round');\n const repliesFooter = new RepliesElement();\n repliesFooter.message = message;\n repliesFooter.type = isFooter ? 'footer' : 'beside';\n repliesFooter.loadPromises = loadPromises;\n repliesFooter.lazyLoadQueue = lazyLoadQueue;\n repliesFooter.init();\n bubbleContainer.prepend(repliesFooter);\n return isFooter;\n };\n\n export const setReply = async({chat, bubble, bubbleContainer, message}: {\n chat: Chat,\n bubble: HTMLElement,\n bubbleContainer?: HTMLElement,\n message: Message.message\n }) => {\n const isReplacing = !bubbleContainer;\n if(isReplacing) {\n bubbleContainer = bubble.querySelector('.bubble-content');\n }\n\n const currentReplyDiv = isReplacing ? bubbleContainer.querySelector('.reply') : null;\n if(!message.reply_to_mid) {\n currentReplyDiv?.remove();\n\n bubble.classList.remove('is-reply');\n return;\n }\n\n\n const replyToPeerId = message.reply_to.reply_to_peer_id ? getPeerId(message.reply_to.reply_to_peer_id) : chat.peerId;\n\n const originalMessage = await rootScope.managers.appMessagesManager.getMessageByPeer(replyToPeerId, message.reply_to_mid);\n let originalPeerTitle: string | HTMLElement;\n\n // ///////this.log('message to render reply', originalMessage, originalPeerTitle, bubble, message);\n\n let titlePeerId: PeerId;\n // need to download separately\n if(!originalMessage) {\n // ////////this.log('message to render reply empty, need download', message, message.reply_to_mid);\n rootScope.managers.appMessagesManager.fetchMessageReplyTo(message);\n chat.bubbles.needUpdate.push({replyToPeerId, replyMid: message.reply_to_mid, mid: message.mid});\n\n originalPeerTitle = i18n('Loading');\n } else {\n const originalMessageFwdFromId = (originalMessage as Message.message).fwdFromId;\n titlePeerId = message.fwdFromId && message.fwdFromId === originalMessageFwdFromId ? message.fwdFromId : originalMessage.fromId || originalMessageFwdFromId;\n originalPeerTitle = new PeerTitle({\n peerId: titlePeerId,\n dialog: false,\n onlyFirstName: false,\n plainText: false\n }).element;\n }\n\n const {container, fillPromise} = wrapReply(originalPeerTitle, undefined, chat.animationGroup, originalMessage, chat.isAnyGroup ? titlePeerId : undefined);\n await fillPromise;\n if(currentReplyDiv) {\n if(currentReplyDiv.classList.contains('floating-part')) {\n container.classList.add('floating-part');\n }\n currentReplyDiv.replaceWith(container);\n } else {\n bubbleContainer.append(container);\n }\n // bubbleContainer.insertBefore(, nameContainer);\n bubble.classList.add('is-reply');\n\n return container;\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport type IntersectionTarget = Element;\nexport type IntersectionCallback = (entry: IntersectionObserverEntry) => void;\n\nexport default class SuperIntersectionObserver {\n private observing: Map>;\n private observingQueue: SuperIntersectionObserver['observing'];\n private observer: IntersectionObserver;\n private freezedObservingNew: boolean;\n\n constructor(init?: IntersectionObserverInit) {\n this.observing = new Map();\n this.observingQueue = new Map();\n this.freezedObservingNew = false;\n\n this.observer = new IntersectionObserver((entries) => {\n const observing = this.observing;\n for(let i = 0, length = entries.length; i < length; ++i) {\n const entry = entries[i];\n const callbacks = observing.get(entry.target);\n if(!callbacks) {\n console.error('intersection process no callbacks:', entry);\n debugger;\n continue;\n }\n\n for(const callback of callbacks) {\n try {\n callback(entry);\n } catch(err) {\n console.error('intersection process callback error:', err);\n }\n }\n }\n }, init);\n }\n\n public disconnect() {\n this.observing.clear();\n this.observingQueue.clear();\n this.observer.disconnect();\n }\n\n public toggleObservingNew(value: boolean) {\n if(this.freezedObservingNew === value) {\n return;\n }\n\n this.freezedObservingNew = value;\n\n const queue = this.observingQueue;\n if(!value && queue.size) {\n for(const [target, callbacks] of queue) {\n for(const callback of callbacks) {\n this.observe(target, callback);\n }\n }\n\n queue.clear();\n }\n }\n\n public has(target: IntersectionTarget, callback: IntersectionCallback, observing = this.observing) {\n const callbacks = observing.get(target);\n return !!(callbacks && callbacks.has(callback));\n }\n\n public observe(target: IntersectionTarget, callback: IntersectionCallback) {\n if(this.freezedObservingNew && this.has(target, callback)) {\n return;\n }\n\n const observing = this.freezedObservingNew ? this.observingQueue : this.observing;\n let callbacks = observing.get(target);\n if(callbacks && callbacks.has(callback)) {\n return;\n }\n\n if(!callbacks) {\n callbacks = new Set();\n observing.set(target, callbacks);\n\n if(observing === this.observing) {\n this.observer.observe(target);\n }\n }\n\n callbacks.add(callback);\n }\n\n public unobserve(target: IntersectionTarget, callback: IntersectionCallback) {\n const observing = this.freezedObservingNew && !this.has(target, callback) ? this.observingQueue : this.observing;\n const callbacks = observing.get(target);\n if(!callbacks) {\n return;\n }\n\n callbacks.delete(callback);\n if(!callbacks.size) {\n observing.delete(target);\n this.observer.unobserve(target);\n }\n }\n}\n","import type {MyDocument} from '../../appDocsManager';\nimport type {MyMessage} from '../../appMessagesManager';\nimport {Message, MessageMedia} from '../../../../layer';\n\nexport default function isMentionUnread(message: MyMessage) {\n if(!message) {\n return false;\n }\n\n const doc = ((message as Message.message).media as MessageMedia.messageMediaDocument)?.document as MyDocument;\n return !!(\n message.pFlags.media_unread &&\n message.pFlags.mentioned &&\n (\n !doc ||\n !(['voice', 'round'] as MyDocument['type'][]).includes(doc.type)\n )\n );\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {ChatAutoDownloadSettings} from '../../helpers/autoDownload';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport {Middleware} from '../../helpers/middleware';\nimport {Document, Message, MessageMedia, Photo, PhotoSize} from '../../layer';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getMediaFromMessage from '../../lib/appManagers/utils/messages/getMediaFromMessage';\nimport choosePhotoSize from '../../lib/appManagers/utils/photos/choosePhotoSize';\nimport rootScope from '../../lib/rootScope';\nimport {AnimationItemGroup} from '../animationIntersector';\nimport Chat from '../chat/chat';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport prepareAlbum from '../prepareAlbum';\nimport wrapMediaSpoiler from './mediaSpoiler';\nimport wrapPhoto from './photo';\nimport wrapVideo from './video';\n\nexport default function wrapAlbum({messages, attachmentDiv, middleware, uploading, lazyLoadQueue, isOut, chat, loadPromises, autoDownload, managers = rootScope.managers, animationGroup}: {\n messages: Message.message[],\n attachmentDiv: HTMLElement,\n middleware?: Middleware,\n lazyLoadQueue?: LazyLoadQueue,\n uploading?: boolean,\n isOut: boolean,\n chat: Chat,\n loadPromises?: Promise[],\n autoDownload?: ChatAutoDownloadSettings,\n managers?: AppManagers,\n animationGroup?: AnimationItemGroup\n}) {\n const items: {size: PhotoSize.photoSize, media: Photo.photo | Document.document, message: Message.message}[] = [];\n\n // !lowest msgID will be the FIRST in album\n for(const message of messages) {\n const media = getMediaFromMessage(message, true);\n\n const size: any = media._ === 'photo' ? choosePhotoSize(media, 480, 480) : {w: media.w, h: media.h};\n items.push({size, media, message});\n }\n\n /* // * pending\n if(storage[0] < 0) {\n items.reverse();\n } */\n\n prepareAlbum({\n container: attachmentDiv,\n items: items.map((i) => ({w: i.size.w, h: i.size.h})),\n maxWidth: mediaSizes.active.album.width,\n minWidth: 100,\n spacing: 2,\n forMedia: true\n });\n\n const {width, height} = attachmentDiv.style;\n const containerWidth = parseInt(width);\n const containerHeight = parseInt(height);\n\n items.forEach((item, idx) => {\n const {size, media, message} = item;\n\n const messageMedia = message.media;\n const hasSpoiler = !!(messageMedia as MessageMedia.messageMediaPhoto | MessageMedia.messageMediaDocument).pFlags?.spoiler;\n\n const div = attachmentDiv.children[idx] as HTMLElement;\n div.dataset.mid = '' + message.mid;\n div.dataset.peerId = '' + message.peerId;\n const mediaDiv = div.firstElementChild as HTMLElement;\n const isPhoto = media._ === 'photo';\n let thumbPromise: Promise;\n if(isPhoto) {\n thumbPromise = wrapPhoto({\n photo: media,\n message,\n container: mediaDiv,\n boxWidth: 0,\n boxHeight: 0,\n isOut,\n lazyLoadQueue,\n middleware,\n size,\n loadPromises,\n autoDownloadSize: autoDownload.photo,\n managers\n });\n } else {\n thumbPromise = wrapVideo({\n doc: media,\n container: mediaDiv,\n message,\n boxWidth: 0,\n boxHeight: 0,\n withTail: false,\n isOut,\n lazyLoadQueue,\n middleware,\n loadPromises,\n autoDownload,\n managers,\n noAutoplayAttribute: hasSpoiler\n });\n }\n\n if(thumbPromise) {\n loadPromises?.push(thumbPromise);\n }\n\n if(hasSpoiler) {\n const promise = (thumbPromise || Promise.resolve()).then(async() => {\n if(!middleware()) {\n return;\n }\n\n const {width, height} = div.style;\n const itemWidth = +width.slice(0, -1) / 100 * containerWidth;\n const itemHeight = +height.slice(0, -1) / 100 * containerHeight;\n const container = await wrapMediaSpoiler({\n media,\n animationGroup,\n middleware,\n width: itemWidth,\n height: itemHeight\n });\n\n if(!middleware()) {\n return;\n }\n\n mediaDiv.append(container);\n });\n\n loadPromises?.push(promise);\n }\n });\n}\n","import {Document, Message, MessageMedia} from '../../../../layer';\n\nexport default function getMediaDurationFromMessage(message: Message.message) {\n if(!message) return undefined;\n const doc = (message.media as MessageMedia.messageMediaDocument)?.document as Document.document;\n const duration = ((['voice', 'audio', 'video'] as Document.document['type'][]).includes(doc?.type) && doc.duration) || undefined;\n return duration;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider';\nimport appSidebarRight from '..';\nimport {roundPercents} from '../../poll';\nimport appDialogsManager from '../../../lib/appManagers/appDialogsManager';\nimport {i18n} from '../../../lib/langPack';\nimport setInnerHTML from '../../../helpers/dom/setInnerHTML';\nimport wrapEmojiText from '../../../lib/richTextProcessor/wrapEmojiText';\nimport Button from '../../button';\nimport {Message, MessageMedia} from '../../../layer';\n\nexport default class AppPollResultsTab extends SliderSuperTab {\n private resultsDiv: HTMLElement;\n\n public async init(message: Message.message) {\n this.container.id = 'poll-results-container';\n this.container.classList.add('chatlist-container');\n\n this.resultsDiv = document.createElement('div');\n this.resultsDiv.classList.add('poll-results');\n this.scrollable.append(this.resultsDiv);\n\n const poll = await this.managers.appPollsManager.getPoll((message.media as MessageMedia.messageMediaPoll).poll.id);\n\n this.setTitle(poll.poll.pFlags.quiz ? 'PollResults.Title.Quiz' : 'PollResults.Title.Poll');\n\n const title = document.createElement('h3');\n setInnerHTML(title, wrapEmojiText(poll.poll.question));\n\n const percents = poll.results.results.map((v) => v.voters / poll.results.total_voters * 100);\n roundPercents(percents);\n\n const fragment = document.createDocumentFragment();\n poll.results.results.forEach((result, idx) => {\n if(!result.voters) return;\n\n const hr = document.createElement('hr');\n\n const answer = poll.poll.answers[idx];\n\n // Head\n const answerEl = document.createElement('div');\n answerEl.classList.add('poll-results-answer');\n\n const answerTitle = document.createElement('div');\n setInnerHTML(answerTitle, wrapEmojiText(answer.text));\n\n const answerPercents = document.createElement('div');\n answerPercents.innerText = Math.round(percents[idx]) + '%';\n\n answerEl.append(answerTitle, answerPercents);\n\n // Humans\n const list = appDialogsManager.createChatList();\n list.classList.add('poll-results-voters');\n\n appDialogsManager.setListClickListener(list, () => {\n appSidebarRight.onCloseBtnClick();\n }, undefined, true);\n\n list.style.minHeight = Math.min(result.voters, 4) * 48 + 'px';\n\n fragment.append(hr, answerEl, list);\n\n let offset: string, limit = 4, loading = false, left = Math.max(0, result.voters - 4);\n const load = () => {\n if(loading) return;\n loading = true;\n\n this.managers.appPollsManager.getVotes(message, answer.option, offset, limit).then((votesList) => {\n votesList.votes.forEach((vote) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: vote.user_id.toPeerId(false),\n container: list,\n rippleEnabled: false,\n meAsSaved: false,\n avatarSize: 'small'\n });\n dom.lastMessageSpan.parentElement.remove();\n });\n\n if(offset) {\n left = Math.max(0, left - votesList.votes.length);\n\n if(left) {\n (showMore.lastElementChild as HTMLElement).replaceWith(i18n('PollResults.LoadMore', [Math.min(20, left)]));\n }\n }\n\n offset = votesList.next_offset;\n limit = 20;\n\n if(!left || !votesList.votes.length) {\n showMore.remove();\n }\n }).finally(() => {\n loading = false;\n });\n };\n\n const showMore = Button('poll-results-more btn btn-primary btn-transparent', {icon: 'down'});\n showMore.addEventListener('click', load);\n showMore.append(i18n('PollResults.LoadMore', [Math.min(20, left)]));\n\n fragment.append(showMore);\n\n load();\n });\n\n this.resultsDiv.append(title, fragment);\n\n appSidebarRight.toggleSidebar(true).then(() => {\n /* appPollsManager.getVotes(mid).then((votes) => {\n console.log('gOt VotEs', votes);\n }); */\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport mediaSizes from '../helpers/mediaSizes';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport appImManager from '../lib/appManagers/appImManager';\nimport rootScope from '../lib/rootScope';\nimport ripple from './ripple';\nimport appSidebarRight from './sidebarRight';\nimport AppPollResultsTab from './sidebarRight/tabs/pollResults';\nimport {FormatterArguments, i18n, LangPackKey} from '../lib/langPack';\nimport {fastRaf} from '../helpers/schedulers';\nimport SetTransition from './singleTransition';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent, simulateClickEvent} from '../helpers/dom/clickEvent';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport windowSize from '../helpers/windowSize';\nimport {Message, MessageMedia, Poll, PollResults} from '../layer';\nimport toHHMMSS from '../helpers/string/toHHMMSS';\nimport StackedAvatars from './stackedAvatars';\nimport setInnerHTML from '../helpers/dom/setInnerHTML';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport wrapEmojiText from '../lib/richTextProcessor/wrapEmojiText';\nimport wrapRichText from '../lib/richTextProcessor/wrapRichText';\nimport liteMode from '../helpers/liteMode';\n\nlet lineTotalLength = 0;\nconst tailLength = 9;\nconst times = 10;\nconst fullTime = 340;\nconst oneTime = fullTime / times;\n\nexport const roundPercents = (percents: number[]) => {\n // console.log('roundPercents before percents:', percents);\n\n const sum = percents.reduce((acc, p) => acc + Math.round(p), 0);\n if(sum > 100) {\n const diff = sum - 100;\n const length = percents.length;\n for(let i = 0; i < diff; ++i) {\n let minIndex = -1, minRemainder = 1;\n for(let k = 0; k < length; ++k) {\n const remainder = percents[k] % 1;\n if(remainder >= 0.5 && remainder < minRemainder) {\n minRemainder = remainder;\n minIndex = k;\n }\n }\n\n if(minIndex === -1) {\n // throw new Error('lol chto');\n return;\n }\n\n percents[minIndex] -= minRemainder;\n }\n } else if(sum < 100) {\n const diff = 100 - sum;\n const length = percents.length;\n for(let i = 0; i < diff; ++i) {\n let minIndex = -1, maxRemainder = 0;\n for(let k = 0; k < length; ++k) {\n const remainder = percents[k] % 1;\n if(remainder < 0.5 && remainder > maxRemainder) {\n maxRemainder = remainder;\n minIndex = k;\n }\n }\n\n if(minIndex === -1) {\n // throw new Error('lol chto');\n return;\n }\n\n percents[minIndex] += 1 - maxRemainder;\n }\n }\n\n // console.log('roundPercents after percents:', percents);\n};\n\n/* const connectedPolls: {id: string, element: PollElement}[] = [];\nrootScope.on('poll_update', (e) => {\n const {poll, results} = e as {poll: Poll, results: PollResults};\n\n //console.log('poll_update', poll, results);\n for(const connected of connectedPolls) {\n if(connected.id === poll.id) {\n const pollElement = connected.element;\n pollElement.isClosed = !!poll.pFlags.closed;\n pollElement.performResults(results, poll.chosenIndexes);\n }\n }\n}); */\n\nrootScope.addEventListener('poll_update', ({poll, results}) => {\n const pollElements = Array.from(document.querySelectorAll(`poll-element[poll-id=\"${poll.id}\"]`)) as PollElement[];\n pollElements.forEach((pollElement) => {\n // console.log('poll_update', poll, results);\n pollElement.isClosed = !!poll.pFlags.closed;\n pollElement.performResults(results, poll.chosenIndexes);\n });\n});\n\nmediaSizes.addEventListener('resize', () => {\n PollElement.setMaxLength();\n PollElement.resizePolls();\n});\n\nmediaSizes.addEventListener('changeScreen', () => {\n PollElement.setMaxLength();\n});\n\nconst hideQuizHint = (element: HTMLElement, onHide: () => void, timeout: number) => {\n element.classList.remove('active');\n\n clearTimeout(timeout);\n setTimeout(() => {\n onHide();\n element.remove();\n\n if(prevQuizHint === element && prevQuizHintOnHide === onHide && prevQuizHintTimeout === timeout) {\n prevQuizHint = prevQuizHintOnHide = null;\n prevQuizHintTimeout = 0;\n }\n }, 200);\n};\n\nlet prevQuizHint: HTMLElement, prevQuizHintOnHide: () => void, prevQuizHintTimeout: number;\nlet isListenerSet = false;\nconst setQuizHint = (solution: string, solution_entities: any[], onHide: () => void) => {\n if(prevQuizHint) {\n hideQuizHint(prevQuizHint, prevQuizHintOnHide, prevQuizHintTimeout);\n }\n\n const element = document.createElement('div');\n element.classList.add('quiz-hint');\n\n const container = document.createElement('div');\n container.classList.add('container', 'tgico');\n\n const textEl = document.createElement('div');\n textEl.classList.add('text');\n\n container.append(textEl);\n element.append(container);\n\n setInnerHTML(textEl, wrapRichText(solution, {entities: solution_entities}));\n appImManager.chat.bubbles.container.append(element);\n\n void element.offsetLeft; // reflow\n element.classList.add('active');\n\n prevQuizHint = element;\n prevQuizHintOnHide = onHide;\n prevQuizHintTimeout = window.setTimeout(() => {\n hideQuizHint(element, onHide, prevQuizHintTimeout);\n }, IS_TOUCH_SUPPORTED ? 5000 : 7000);\n\n if(!isListenerSet) {\n isListenerSet = true;\n appImManager.addEventListener('peer_changed', () => {\n if(prevQuizHint) {\n hideQuizHint(prevQuizHint, prevQuizHintOnHide, prevQuizHintTimeout);\n }\n });\n }\n};\n\nexport default class PollElement extends HTMLElement {\n public static MAX_OFFSET = -46.5;\n public static MAX_LENGTH = 0;\n public svgLines: SVGSVGElement[];\n private numberDivs: HTMLDivElement[];\n private answerDivs: HTMLDivElement[];\n private descDiv: HTMLElement;\n private typeDiv: HTMLElement;\n private avatarsDiv: HTMLElement;\n private viewResults: HTMLElement;\n private votersCountDiv: HTMLDivElement;\n\n // private maxLength: number;\n // private maxLengths: number[];\n private maxPercents: number[];\n\n public isClosed = false;\n private isQuiz = false;\n private isRetracted = false;\n private isPublic = false;\n private isMultiple = false;\n private chosenIndexes: number[] = [];\n private percents: number[];\n\n public message: Message.message;\n public managers: AppManagers;\n\n private quizInterval: number;\n private quizTimer: SVGSVGElement;\n\n private sendVoteBtn: HTMLElement;\n private chosingIndexes: number[] = [];\n\n private sendVotePromise: Promise;\n private sentVote = false;\n\n private detachClickEvent: () => void;\n\n public static setMaxLength() {\n const width = windowSize.width <= 360 ? windowSize.width - 120 : mediaSizes.active.poll.width;\n this.MAX_LENGTH = width + tailLength + this.MAX_OFFSET + -13.7; // 13 - position left\n }\n\n public static resizePolls() {\n if(!this.MAX_LENGTH) return;\n const pollElements = Array.from(document.querySelectorAll('poll-element.is-voted')) as PollElement[];\n pollElements.forEach((pollElement) => {\n pollElement.svgLines.forEach((svg, idx) => {\n // void svg.getBoundingClientRect(); // reflow\n pollElement.setLineProgress(idx, 1);\n });\n });\n }\n\n public async render() {\n // браузер вызывает этот метод при добавлении элемента в документ\n // (может вызываться много раз, если элемент многократно добавляется/удаляется)\n\n if(!lineTotalLength) {\n lineTotalLength = (document.getElementById('poll-line') as any as SVGPathElement).getTotalLength();\n // console.log('line total length:', lineTotalLength);\n PollElement.setMaxLength();\n }\n\n // const {poll, results} = this.managers.appPollsManager.getPoll(pollId);\n const {poll, results} = this.message.media as MessageMedia.messageMediaPoll;\n\n /* const timestamp = Date.now() / 1000 | 0;\n if(timestamp < this.message.date) { */\n if(this.message.pFlags.is_scheduled) {\n this.classList.add('disable-hover');\n }\n\n // console.log('pollElement poll:', poll, results);\n\n let descKey: LangPackKey;\n if(poll.pFlags) {\n this.isPublic = !!poll.pFlags.public_voters;\n this.isQuiz = !!poll.pFlags.quiz;\n this.isClosed = !!poll.pFlags.closed;\n this.isMultiple = !!poll.pFlags.multiple_choice;\n\n if(this.isClosed) {\n descKey = 'Chat.Poll.Type.Closed';\n this.classList.add('is-closed');\n } else if(this.isQuiz) {\n descKey = this.isPublic ? 'Chat.Poll.Type.Quiz' : 'Chat.Poll.Type.AnonymousQuiz';\n } else {\n descKey = this.isPublic ? 'Chat.Poll.Type.Public' : 'Chat.Poll.Type.Anonymous';\n }\n }\n\n this.classList.toggle('is-multiple', this.isMultiple);\n\n const multipleSelect = this.isMultiple ? '' : '';\n const votes = poll.answers.map((answer, idx) => {\n return `\n
\n
\n
\n \n \n \n ${multipleSelect}\n
\n
\n
\n \n \n \n \n
\n `;\n }).join('');\n\n this.innerHTML = `\n
\n
\n
\n
\n
\n ${votes}`;\n\n setInnerHTML(this.firstElementChild, wrapEmojiText(poll.question));\n\n Array.from(this.querySelectorAll('.poll-answer-text')).forEach((el, idx) => {\n setInnerHTML(el, wrapEmojiText(poll.answers[idx].text));\n });\n\n this.descDiv = this.firstElementChild.nextElementSibling as HTMLElement;\n this.typeDiv = this.descDiv.firstElementChild as HTMLElement;\n this.avatarsDiv = this.descDiv.lastElementChild as HTMLElement;\n\n if(descKey) {\n this.typeDiv.append(i18n(descKey));\n }\n\n if(this.isQuiz) {\n this.classList.add('is-quiz');\n\n if(poll.close_period && poll.close_date) {\n const timeLeftDiv = document.createElement('div');\n timeLeftDiv.classList.add('poll-time');\n this.descDiv.append(timeLeftDiv);\n\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n // svg.setAttributeNS(null, 'viewBox', '0 0 15 15');\n svg.classList.add('poll-quiz-timer');\n\n this.quizTimer = svg;\n\n const strokeWidth = 2;\n const radius = 7;\n const circumference = 2 * Math.PI * radius;\n\n const circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');\n circle.classList.add('poll-quiz-timer-circle');\n circle.setAttributeNS(null, 'cx', '16');\n circle.setAttributeNS(null, 'cy', '16');\n circle.setAttributeNS(null, 'r', '' + radius);\n circle.setAttributeNS(null, 'stroke-width', '' + strokeWidth);\n\n svg.append(circle);\n this.descDiv.append(svg);\n\n const period = poll.close_period * 1000;\n const closeTime = (poll.close_date - await rootScope.managers.timeManager.getServerTimeOffset()) * 1000;\n\n // console.log('closeTime:', poll.close_date, serverTimeManager.serverTimeOffset, Date.now() / 1000 | 0);\n\n // let time = Date.now();\n // let percents = (closeTime - time) / period;\n\n // timeLeftDiv.innerHTML = String((closeTime - time) / 1000 + 1 | 0).toHHMMSS();\n\n // // @ts-ignore\n // circle.style.strokeDashoffset = circumference + percents * circumference;\n // circle.style.strokeDasharray = ${circumference} ${circumference};\n\n this.quizInterval = window.setInterval(() => {\n const time = Date.now();\n const percents = (closeTime - time) / period;\n const timeLeft = (closeTime - time) / 1000 + 1 | 0;\n timeLeftDiv.innerHTML = toHHMMSS(timeLeft);\n\n if(timeLeft <= 5) {\n timeLeftDiv.style.color = '#ee545c';\n circle.style.stroke = '#ee545c';\n }\n // timeLeftDiv.style.visibility = 'visible';\n\n // @ts-ignore\n circle.style.strokeDashoffset = circumference + percents * circumference;\n circle.style.strokeDasharray = `${circumference} ${circumference}`;\n\n if(time >= closeTime) {\n clearInterval(this.quizInterval);\n timeLeftDiv.innerHTML = '';\n // @ts-ignore\n circle.style.strokeDashoffset = circumference;\n this.quizInterval = 0;\n\n setTimeout(() => {\n // нужно запросить апдейт чтобы опрос обновился\n this.managers.appPollsManager.getResults(this.message);\n }, 3e3);\n }\n }, 1e3);\n }\n }\n\n this.answerDivs = Array.from(this.querySelectorAll('.poll-answer')) as HTMLDivElement[];\n this.svgLines = Array.from(this.querySelectorAll('.poll-line')) as SVGSVGElement[];\n this.numberDivs = Array.from(this.querySelectorAll('.poll-answer-percents')) as HTMLDivElement[];\n\n const footerDiv = document.createElement('div');\n footerDiv.classList.add('poll-footer');\n\n this.viewResults = document.createElement('div');\n this.viewResults.className = 'poll-footer-button poll-view-results hide';\n this.viewResults.append(i18n('Chat.Poll.ViewResults'));\n\n this.votersCountDiv = document.createElement('div');\n this.votersCountDiv.className = 'poll-votes-count';\n\n footerDiv.append(this.viewResults, this.votersCountDiv);\n this.append(footerDiv);\n\n this.viewResults.addEventListener('click', (e) => {\n cancelEvent(e);\n\n if(!appSidebarRight.isTabExists(AppPollResultsTab)) {\n appSidebarRight.createTab(AppPollResultsTab).open(this.message);\n }\n });\n ripple(this.viewResults);\n\n if(this.isMultiple) {\n this.sendVoteBtn = document.createElement('div');\n this.sendVoteBtn.classList.add('poll-footer-button', 'poll-send-vote');\n this.sendVoteBtn.append(i18n('Chat.Poll.SubmitVote'));\n ripple(this.sendVoteBtn);\n\n if(!poll.chosenIndexes.length) {\n this.votersCountDiv.classList.add('hide');\n }\n\n attachClickEvent(this.sendVoteBtn, (e) => {\n cancelEvent(e);\n /* const indexes = this.answerDivs.filter((el) => el.classList.contains('is-chosing')).map((el) => +el.dataset.index);\n if(indexes.length) {\n\n } */\n if(this.chosingIndexes.length) {\n this.sendVotes(this.chosingIndexes).then(() => {\n this.chosingIndexes.length = 0;\n this.answerDivs.forEach((el) => {\n el.classList.remove('is-chosing');\n });\n });\n }\n });\n\n footerDiv.append(this.sendVoteBtn);\n }\n\n // const width = this.getBoundingClientRect().width;\n // const width = mediaSizes.active.poll.width;\n // this.maxLength = width + tailLength + this.maxOffset + -13.7; // 13 - position left\n\n const canVote = !(poll.chosenIndexes.length || this.isClosed);\n if(!canVote || this.isPublic) {\n this.performResults(results, poll.chosenIndexes, false);\n }\n\n if(canVote) {\n this.setVotersCount(results);\n this.detachClickEvent = attachClickEvent(this, this.clickHandler);\n }\n }\n\n initQuizHint(results: PollResults) {\n if(results.solution && results.solution_entities) {\n const toggleHint = document.createElement('div');\n toggleHint.classList.add('tgico-tip', 'poll-hint');\n this.descDiv.append(toggleHint);\n\n // let active = false;\n attachClickEvent(toggleHint, (e) => {\n cancelEvent(e);\n\n // active = true;\n toggleHint.classList.add('active');\n setQuizHint(results.solution, results.solution_entities, () => {\n // active = false;\n toggleHint.classList.remove('active');\n });\n });\n\n if(this.sentVote) {\n const correctResult = results.results.find((r) => r.pFlags.correct);\n if(correctResult && !correctResult.pFlags.chosen) {\n simulateClickEvent(toggleHint);\n }\n }\n }\n }\n\n clickHandler = (e: Event) => {\n const target = findUpClassName(e.target, 'poll-answer') as HTMLElement;\n if(!target) {\n return;\n }\n\n cancelEvent(e);\n const answerIndex = +target.dataset.index;\n if(this.isMultiple) {\n target.classList.toggle('is-chosing');\n\n const foundIndex = this.chosingIndexes.indexOf(answerIndex);\n if(foundIndex !== -1) {\n this.chosingIndexes.splice(foundIndex, 1);\n } else {\n this.chosingIndexes.push(answerIndex);\n }\n } else {\n this.sendVotes([answerIndex]);\n }\n\n /* target.classList.add('is-voting');\n setTimeout(() => { // simulate\n this.setResults([100, 0], answerIndex);\n target.classList.remove('is-voting');\n }, 1000); */\n };\n\n sendVotes(indexes: number[]) {\n if(this.sendVotePromise) return this.sendVotePromise;\n\n const targets = this.answerDivs.filter((_, idx) => indexes.includes(idx));\n targets.forEach((target) => {\n target.classList.add('is-voting');\n });\n\n this.classList.add('disable-hover');\n this.sentVote = true;\n return this.sendVotePromise = this.managers.appPollsManager.sendVote(this.message, indexes).then(() => {\n targets.forEach((target) => {\n target.classList.remove('is-voting');\n });\n\n this.classList.remove('disable-hover');\n }).catch(() => {\n this.sentVote = false;\n }).finally(() => {\n this.sendVotePromise = null;\n });\n }\n\n performResults(results: PollResults, chosenIndexes: number[], animate = true) {\n if(!liteMode.isAvailable('animations')) {\n animate = false;\n }\n\n if(this.isQuiz && (results.results?.length || this.isClosed)) {\n this.answerDivs.forEach((el, idx) => {\n el.classList.toggle('is-correct', !!results.results[idx].pFlags.correct);\n });\n\n if(this.initQuizHint) {\n this.initQuizHint(results);\n this.initQuizHint = null;\n }\n\n if(this.quizInterval) {\n clearInterval(this.quizInterval);\n this.quizInterval = 0;\n }\n\n if(this.quizTimer?.parentElement) {\n this.quizTimer.remove();\n }\n\n const timeEl = this.descDiv.querySelector('.poll-time');\n if(timeEl) {\n timeEl.remove();\n }\n }\n\n if(this.isClosed) {\n this.classList.add('is-closed');\n replaceContent(this.typeDiv, i18n('Chat.Poll.Type.Closed'));\n }\n\n // set chosen\n if(this.chosenIndexes.length !== chosenIndexes.length || this.isClosed) { // if we voted\n this.isRetracted = this.chosenIndexes.length && !chosenIndexes.length;\n this.chosenIndexes = chosenIndexes.slice();\n\n if(this.isRetracted) {\n this.detachClickEvent = attachClickEvent(this, this.clickHandler);\n } else {\n this.detachClickEvent?.();\n this.detachClickEvent = undefined;\n }\n }\n\n // is need update\n if(this.chosenIndexes.length || this.isRetracted || this.isClosed) {\n const percents = results.results.map((v) => results.total_voters ? v.voters / results.total_voters * 100 : 0);\n\n this.classList.toggle('no-transition', !animate);\n if(animate) {\n SetTransition({\n element: this,\n className: '',\n forwards: !this.isRetracted,\n duration: 340\n });\n }\n\n fastRaf(() => {\n this.setResults(this.isRetracted ? this.percents : percents, this.chosenIndexes, animate);\n this.percents = percents;\n this.isRetracted = false;\n });\n }\n\n this.setVotersCount(results);\n\n if(this.isPublic) {\n if(!this.isMultiple) {\n this.viewResults.classList.toggle('hide', !results.total_voters || !this.chosenIndexes.length);\n this.votersCountDiv.classList.toggle('hide', !!this.chosenIndexes.length);\n }\n\n const peerIds = (results.recent_voters || []).map((userId) => userId.toPeerId());\n const stackedAvatars = new StackedAvatars({avatarSize: 16});\n stackedAvatars.render(peerIds);\n replaceContent(this.avatarsDiv, stackedAvatars.container);\n }\n\n if(this.isMultiple) {\n const isVoted = !!this.chosenIndexes.length;\n\n const hideSendVoteBtn = this.isClosed || isVoted;\n const hideViewResultsBtn = !this.isPublic || !results.total_voters || (!isVoted && !this.isClosed);\n this.sendVoteBtn.classList.toggle('hide', hideSendVoteBtn);\n this.viewResults.classList.toggle('hide', hideViewResultsBtn);\n this.votersCountDiv.classList.toggle('hide', !hideSendVoteBtn || !hideViewResultsBtn);\n }\n }\n\n setResults(percents: number[], chosenIndexes: number[], animate: boolean) {\n this.svgLines.forEach((svg) => svg.style.display = '');\n\n this.answerDivs.forEach((el, idx) => {\n el.classList.toggle('is-chosen', chosenIndexes.includes(idx));\n });\n\n const maxValue = Math.max(...percents);\n // this.maxLengths = percents.map((p) => p / maxValue * this.maxLength);\n this.maxPercents = percents.map((p) => p / maxValue);\n\n // line\n if(this.isRetracted) {\n this.svgLines.forEach((svg, idx) => {\n this.setLineProgress(idx, -1);\n });\n } else {\n const cb = () => {\n this.svgLines.forEach((svg, idx) => {\n // void svg.getBoundingClientRect(); // reflow\n this.setLineProgress(idx, 1);\n });\n };\n\n animate ? fastRaf(cb) : cb();\n }\n\n percents = percents.slice();\n roundPercents(percents);\n let getPercentValue: (percents: number, index: number) => number;\n const iterate = (i: number) => {\n percents.forEach((percents, idx) => {\n const value = getPercentValue(percents, i);\n this.numberDivs[idx].innerText = value + '%';\n });\n };\n // numbers\n if(this.isRetracted) {\n getPercentValue = (percents, index) => Math.round(percents / times * index);\n\n if(animate) {\n for(let i = (times - 1), k = 0; i >= 0; --i, ++k) {\n setTimeout(() => {\n iterate(i);\n }, oneTime * k);\n }\n } else {\n iterate(0);\n }\n } else {\n getPercentValue = (percents, index) => Math.round(percents / times * (index + 1));\n\n if(animate) {\n for(let i = 0; i < times; ++i) {\n setTimeout(() => {\n iterate(i);\n }, oneTime * i);\n }\n } else {\n iterate(times - 1);\n }\n }\n\n if(this.isRetracted) {\n if(animate) {\n this.classList.add('is-retracting');\n }\n\n this.classList.remove('is-voted');\n const cb = () => {\n this.svgLines.forEach((svg) => svg.style.display = 'none');\n };\n\n if(animate) {\n setTimeout(() => {\n this.classList.remove('is-retracting');\n cb();\n }, fullTime);\n } else {\n cb();\n }\n } else {\n this.classList.add('is-voted');\n }\n }\n\n setVotersCount(results: PollResults) {\n const votersCount = results.total_voters || 0;\n let key: LangPackKey;\n const args: FormatterArguments = [votersCount];\n if(this.isClosed) {\n if(this.isQuiz) key = votersCount ? 'Chat.Quiz.TotalVotes' : 'Chat.Quiz.TotalVotesResultEmpty';\n else key = votersCount ? 'Chat.Poll.TotalVotes1' : 'Chat.Poll.TotalVotesResultEmpty';\n } else {\n if(this.isQuiz) key = votersCount ? 'Chat.Quiz.TotalVotes' : 'Chat.Quiz.TotalVotesEmpty';\n else key = votersCount ? 'Chat.Poll.TotalVotes1' : 'Chat.Poll.TotalVotesEmpty';\n }\n\n replaceContent(this.votersCountDiv, i18n(key, args));\n }\n\n setLineProgress(index: number, multiplier: number) {\n const svg = this.svgLines[index];\n\n if(multiplier === -1) {\n svg.style.strokeDasharray = '';\n svg.style.strokeDashoffset = '';\n } else {\n // svg.style.strokeDasharray = (multiplier * this.maxLengths[index]) + ', 485.9';\n svg.style.strokeDasharray = (multiplier * this.maxPercents[index] * PollElement.MAX_LENGTH) + ', 485.9';\n // svg.style.strokeDasharray = (multiplier * this.maxPercents[index] * 100) + '%, 485.9';\n svg.style.strokeDashoffset = '' + multiplier * PollElement.MAX_OFFSET;\n }\n }\n\n // у элемента могут быть ещё другие методы и свойства\n}\n\ncustomElements.define('poll-element', PollElement);\n","// https://stackoverflow.com/a/14824756/6758968\nconst ltrChars = 'A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02B8\\u0300-\\u0590\\u0800-\\u1FFF'+'\\u2C00-\\uFB1C\\uFDFE-\\uFE6F\\uFEFD-\\uFFFF',\n rtlChars = '\\u0591-\\u07FF\\uFB1D-\\uFDFD\\uFE70-\\uFEFC',\n fullRtlDirCheck = new RegExp('^[^'+ltrChars+']*['+rtlChars+']'),\n justRtlDirCheck = new RegExp('['+rtlChars+']');\n\nexport default function isRTL(s: string, anyChar?: boolean) {\n return anyChar ? justRtlDirCheck.test(s) : fullRtlDirCheck.test(s);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AppImManager, ChatSavedPosition, ChatSetPeerOptions} from '../../lib/appManagers/appImManager';\nimport type {HistoryResult, MyMessage} from '../../lib/appManagers/appMessagesManager';\nimport type {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport type Chat from './chat';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport {logger} from '../../lib/logger';\nimport rootScope from '../../lib/rootScope';\nimport BubbleGroups from './bubbleGroups';\nimport PopupDatePicker from '../popups/datePicker';\nimport PopupForward from '../popups/forward';\nimport PopupStickers from '../popups/stickers';\nimport ProgressivePreloader from '../preloader';\nimport Scrollable, {SliceSides} from '../scrollable';\nimport StickyIntersector from '../stickyIntersector';\nimport animationIntersector from '../animationIntersector';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport {IS_ANDROID, IS_APPLE, IS_MOBILE, IS_SAFARI} from '../../environment/userAgent';\nimport I18n, {FormatterArguments, i18n, langPack, LangPackKey, UNSUPPORTED_LANG_PACK_KEY, _i18n} from '../../lib/langPack';\nimport AvatarElement from '../avatar';\nimport ripple from '../ripple';\nimport {MessageRender} from './messageRender';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport PollElement from '../poll';\nimport AudioElement from '../audio';\nimport {Chat as MTChat, ChatInvite, Document, Message, MessageEntity, MessageMedia, MessageReplyHeader, Photo, PhotoSize, ReactionCount, ReplyMarkup, SponsoredMessage, Update, UrlAuthResult, User, WebPage} from '../../layer';\nimport {BOT_START_PARAM, NULL_PEER_ID, REPLIES_PEER_ID} from '../../lib/mtproto/mtproto_config';\nimport {FocusDirection, ScrollStartCallbackDimensions} from '../../helpers/fastSmoothScroll';\nimport useHeavyAnimationCheck, {getHeavyAnimationPromise, dispatchHeavyAnimationEvent, interruptHeavyAnimation} from '../../hooks/useHeavyAnimationCheck';\nimport {fastRaf, fastRafPromise} from '../../helpers/schedulers';\nimport deferredPromise from '../../helpers/cancellablePromise';\nimport RepliesElement from './replies';\nimport DEBUG from '../../config/debug';\nimport {SliceEnd} from '../../helpers/slicedArray';\nimport PeerTitle from '../peerTitle';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport {toast, toastNew} from '../toast';\nimport {getMiddleware, Middleware} from '../../helpers/middleware';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent, simulateClickEvent} from '../../helpers/dom/clickEvent';\nimport htmlToDocumentFragment from '../../helpers/dom/htmlToDocumentFragment';\nimport reflowScrollableElement from '../../helpers/dom/reflowScrollableElement';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport whichChild from '../../helpers/dom/whichChild';\nimport {cancelAnimationByKey} from '../../helpers/animation';\nimport assumeType from '../../helpers/assumeType';\nimport debounce, {DebounceReturnType} from '../../helpers/schedulers/debounce';\nimport {SEND_WHEN_ONLINE_TIMESTAMP} from '../../lib/mtproto/constants';\nimport windowSize from '../../helpers/windowSize';\nimport {formatPhoneNumber} from '../../helpers/formatPhoneNumber';\nimport AppMediaViewer from '../appMediaViewer';\nimport SetTransition from '../singleTransition';\nimport handleHorizontalSwipe from '../../helpers/dom/handleHorizontalSwipe';\nimport findUpAttribute from '../../helpers/dom/findUpAttribute';\nimport findUpAsChild from '../../helpers/dom/findUpAsChild';\nimport formatCallDuration from '../../helpers/formatCallDuration';\nimport IS_CALL_SUPPORTED from '../../environment/callSupport';\nimport Button from '../button';\nimport {CallType} from '../../lib/calls/types';\nimport getVisibleRect from '../../helpers/dom/getVisibleRect';\nimport PopupJoinChatInvite from '../popups/joinChatInvite';\nimport {InternalLink, INTERNAL_LINK_TYPE} from '../../lib/appManagers/internalLink';\nimport ReactionsElement, {REACTIONS_ELEMENTS} from './reactions';\nimport type ReactionElement from './reaction';\nimport RLottiePlayer from '../../lib/rlottie/rlottiePlayer';\nimport pause from '../../helpers/schedulers/pause';\nimport ScrollSaver from '../../helpers/scrollSaver';\nimport getObjectKeysAndSort from '../../helpers/object/getObjectKeysAndSort';\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport formatNumber from '../../helpers/number/formatNumber';\nimport getViewportSlice from '../../helpers/dom/getViewportSlice';\nimport SuperIntersectionObserver from '../../helpers/dom/superIntersectionObserver';\nimport generateFakeIcon from '../generateFakeIcon';\nimport copyFromElement from '../../helpers/dom/copyFromElement';\nimport PopupElement from '../popups';\nimport setAttachmentSize from '../../helpers/setAttachmentSize';\nimport wrapWebPageDescription from '../wrappers/webPageDescription';\nimport wrapWebPageTitle from '../wrappers/webPageTitle';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\nimport wrapMessageActionTextNew from '../wrappers/messageActionTextNew';\nimport isMentionUnread from '../../lib/appManagers/utils/messages/isMentionUnread';\nimport getMediaFromMessage from '../../lib/appManagers/utils/messages/getMediaFromMessage';\nimport getPeerColorById from '../../lib/appManagers/utils/peers/getPeerColorById';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport getServerMessageId from '../../lib/appManagers/utils/messageId/getServerMessageId';\nimport generateMessageId from '../../lib/appManagers/utils/messageId/generateMessageId';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport {Awaited, SendMessageEmojiInteractionData} from '../../types';\nimport idleController from '../../helpers/idleController';\nimport overlayCounter from '../../helpers/overlayCounter';\nimport {cancelContextMenuOpening} from '../../helpers/dom/attachContextMenuListener';\nimport contextMenuController from '../../helpers/contextMenuController';\nimport {AckedResult} from '../../lib/mtproto/superMessagePort';\nimport middlewarePromise from '../../helpers/middlewarePromise';\nimport {EmoticonsDropdown} from '../emoticonsDropdown';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport noop from '../../helpers/noop';\nimport getAlbumText from '../../lib/appManagers/utils/messages/getAlbumText';\nimport paymentsWrapCurrencyAmount from '../../helpers/paymentsWrapCurrencyAmount';\nimport PopupPayment from '../popups/payment';\nimport isInDOM from '../../helpers/dom/isInDOM';\nimport getStickerEffectThumb from '../../lib/appManagers/utils/stickers/getStickerEffectThumb';\nimport attachStickerViewerListeners from '../stickerViewer';\nimport {makeMediaSize, MediaSize} from '../../helpers/mediaSize';\nimport wrapSticker, {onEmojiStickerClick} from '../wrappers/sticker';\nimport wrapAlbum from '../wrappers/album';\nimport wrapDocument from '../wrappers/document';\nimport wrapGroupedDocuments from '../wrappers/groupedDocuments';\nimport wrapPhoto from '../wrappers/photo';\nimport wrapPoll from '../wrappers/poll';\nimport wrapVideo from '../wrappers/video';\nimport isRTL from '../../helpers/string/isRTL';\nimport NBSP from '../../helpers/string/nbsp';\nimport DotRenderer from '../dotRenderer';\nimport toHHMMSS from '../../helpers/string/toHHMMSS';\nimport {BatchProcessor} from '../../helpers/sortedList';\nimport wrapUrl from '../../lib/richTextProcessor/wrapUrl';\nimport getMessageThreadId from '../../lib/appManagers/utils/messages/getMessageThreadId';\nimport wrapTopicNameButton from '../wrappers/topicNameButton';\nimport wrapMediaSpoiler, {onMediaSpoilerClick, toggleMediaSpoiler} from '../wrappers/mediaSpoiler';\nimport confirmationPopup from '../confirmationPopup';\nimport wrapPeerTitle from '../wrappers/peerTitle';\nimport {PopupPeerCheckboxOptions} from '../popups/peer';\nimport toggleDisability from '../../helpers/dom/toggleDisability';\nimport {copyTextToClipboard} from '../../helpers/clipboard';\nimport liteMode from '../../helpers/liteMode';\nimport getMediaDurationFromMessage from '../../lib/appManagers/utils/messages/getMediaDurationFromMessage';\n\nexport const USER_REACTIONS_INLINE = false;\nconst USE_MEDIA_TAILS = false;\ntype MESSAGE_ACTION_TYPE = Message.messageService['action']['_'];\ntype IGNORE_ACTION_KEY = MESSAGE_ACTION_TYPE;\ntype IGNORE_ACTION_VALUE = true | ((message: Message.messageService) => boolean);\nconst IGNORE_ACTIONS: Map = new Map([\n ['messageActionHistoryClear', true],\n ['messageActionChatCreate', (message) => message.pFlags.out]\n // 'messageActionChannelMigrateFrom'\n] as [IGNORE_ACTION_KEY, IGNORE_ACTION_VALUE][]);\n\nexport const SERVICE_AS_REGULAR: Set = new Set();\n\nif(IS_CALL_SUPPORTED) {\n SERVICE_AS_REGULAR.add('messageActionPhoneCall');\n}\n\nconst TEST_SCROLL_TIMES: number = undefined;\nlet TEST_SCROLL = TEST_SCROLL_TIMES;\n\nlet queueId = 0;\n\ntype GenerateLocalMessageType = IsService extends true ? Message.messageService : Message.message;\n\nconst SPONSORED_MESSAGE_ID_OFFSET = 1;\nexport const STICKY_OFFSET = 3;\nconst SCROLLED_DOWN_THRESHOLD = 300;\nconst PEER_CHANGED_ERROR = new Error('peer changed');\n\nconst DO_NOT_SLICE_VIEWPORT = false;\nconst DO_NOT_SLICE_VIEWPORT_ON_RENDER = false;\nconst DO_NOT_UPDATE_MESSAGE_VIEWS = false;\nconst DO_NOT_UPDATE_MESSAGE_REACTIONS = false;\nconst DO_NOT_UPDATE_MESSAGE_REPLY = false;\n\nconst BIG_EMOJI_SIZES: {[size: number]: number} = {\n 1: 96,\n 2: 90,\n 3: 84,\n 4: 72,\n 5: 60,\n 6: 48,\n 7: 36\n};\nconst BIG_EMOJI_SIZES_LENGTH = Object.keys(BIG_EMOJI_SIZES).length;\n\ntype Bubble = {\n bubble: HTMLElement,\n mids: Set,\n groupedId?: string\n};\n\ntype MyHistoryResult = HistoryResult | {history: number[]};\n\nfunction getMainMidForGrouped(mids: number[]) {\n return Math.max(...mids);\n}\n\nexport default class ChatBubbles {\n public container: HTMLDivElement;\n public chatInner: HTMLDivElement;\n public scrollable: Scrollable;\n\n private getHistoryTopPromise: Promise;\n private getHistoryBottomPromise: Promise;\n\n // public messagesCount: number = -1;\n\n private unreadOut = new Set();\n public needUpdate: {replyToPeerId: PeerId, replyMid: number, mid: number}[] = []; // if need wrapSingleMessage\n\n public bubbles: {[mid: string]: HTMLElement} = {};\n public skippedMids: Set = new Set();\n public bubblesNewByGroupedId: {[groupId: string]: Bubble} = {};\n public bubblesNew: {[mid: string]: Bubble} = {};\n private dateMessages: {[timestamp: number]: {\n div: HTMLElement,\n firstTimestamp: number,\n container: HTMLElement,\n timeout?: number\n }} = {};\n\n private scrolledDown = true;\n private isScrollingTimeout = 0;\n\n private stickyIntersector: StickyIntersector;\n\n private unreaded: Map = new Map();\n private unreadedSeen: Set = new Set();\n private readPromise: Promise;\n\n private bubbleGroups: BubbleGroups;\n\n private preloader: ProgressivePreloader = null;\n\n // private messagesQueueOnRender: () => void = null;\n private messagesQueueOnRenderAdditional: () => void = null;\n\n private firstUnreadBubble: HTMLElement = null;\n private attachedUnreadBubble: boolean;\n\n public lazyLoadQueue: LazyLoadQueue;\n\n private middlewareHelper = getMiddleware();\n\n private log: ReturnType;\n\n public listenerSetter: ListenerSetter;\n\n private followStack: number[] = [];\n\n private isHeavyAnimationInProgress = false;\n private scrollingToBubble: HTMLElement;\n\n private isFirstLoad = true;\n private needReflowScroll: boolean;\n\n private fetchNewPromise: Promise;\n\n private passEntities: Partial<{\n [_ in MessageEntity['_']]: boolean\n }> = {};\n\n private onAnimateLadder: () => Promise | void;\n // private ladderDeferred: CancellablePromise;\n private resolveLadderAnimation: () => Promise;\n private emptyPlaceholderBubble: HTMLElement;\n\n private viewsMids: Set = new Set();\n private sendViewCountersDebounced: () => Promise;\n\n private isTopPaddingSet = false;\n\n private getSponsoredMessagePromise: Promise;\n\n private previousStickyDate: HTMLElement;\n private sponsoredMessage: SponsoredMessage.sponsoredMessage;\n\n private hoverBubble: HTMLElement;\n private hoverReaction: HTMLElement;\n private sliceViewportDebounced: DebounceReturnType;\n private resizeObserver: ResizeObserver;\n private willScrollOnLoad: boolean;\n public observer: SuperIntersectionObserver;\n\n private renderingMessages: Set = new Set();\n private setPeerCached: boolean;\n private attachPlaceholderOnRender: () => void;\n\n private bubblesToEject: Set = new Set();\n private bubblesToReplace: Map = new Map(); // TO -> FROM\n private updatePlaceholderPosition: () => void;\n private setPeerOptions: {lastMsgId: number; topMessage: number; savedPosition: ChatSavedPosition};\n\n private setPeerTempId: number = 0;\n\n private renderNewPromises: Set> = new Set();\n private updateGradient: boolean;\n\n private extendedMediaMessages: Set = new Set();\n private pollExtendedMediaMessagesPromise: Promise;\n\n private batchProcessor: BatchProcessor>>;\n\n // private reactions: Map;\n\n constructor(\n private chat: Chat,\n private managers: AppManagers\n ) {\n this.log = this.chat.log;\n // this.chat.log.error('Bubbles construction');\n\n this.listenerSetter = new ListenerSetter();\n\n this.constructBubbles();\n\n // * constructor end\n\n this.batchProcessor = new BatchProcessor({\n log: this.log,\n process: this.processBatch,\n possibleError: PEER_CHANGED_ERROR\n });\n this.bubbleGroups = new BubbleGroups(this.chat);\n this.preloader = new ProgressivePreloader({\n cancelable: false\n });\n this.lazyLoadQueue = new LazyLoadQueue(undefined, true);\n this.lazyLoadQueue.queueId = ++queueId;\n\n // this.reactions = new Map();\n\n // * events\n\n // will call when sent for update pos\n this.listenerSetter.add(rootScope)('history_update', async({storageKey, sequential, message}) => {\n if(this.chat.messagesStorageKey !== storageKey || this.chat.type === 'scheduled') {\n return;\n }\n\n const {mid} = message;\n const log = false ? this.log.bindPrefix('history_update-' + mid) : undefined;\n log && log('start');\n\n const bubble = this.bubbles[mid];\n if(!bubble) return;\n\n if(this.renderNewPromises.size) {\n log && log.error('will await new messages render');\n await Promise.all(Array.from(this.renderNewPromises));\n }\n\n if(this.messagesQueuePromise) {\n log && log.error('messages render in process');\n await this.messagesQueuePromise;\n }\n\n if(this.bubbles[mid] !== bubble) return;\n\n // await getHeavyAnimationPromise();\n\n const item = this.bubbleGroups.getItemByBubble(bubble);\n if(!item) { // probably a group item\n log && log.error('no item by bubble', bubble);\n return;\n } else if(item.mid === mid) {\n log && log.warn('wow what', item, mid);\n return;\n }\n\n if(sequential) {\n const group = item.group;\n const newItem = this.bubbleGroups.createItem(bubble, message);\n // newItem.mid = item.mid;\n const _items = this.bubbleGroups.itemsArr.slice();\n indexOfAndSplice(_items, item);\n const foundItem = this.bubbleGroups.findGroupSiblingByItem(newItem, _items);\n if(\n group === foundItem?.group ||\n (group === this.bubbleGroups.getLastGroup() && group.items.length === 1 && newItem.dateTimestamp === item.dateTimestamp) ||\n (this.peerId === rootScope.myId && sequential && newItem.dateTimestamp === item.dateTimestamp)\n ) {\n log && log('item has correct position', item);\n this.bubbleGroups.changeBubbleMid(bubble, mid);\n return;\n }\n }\n\n // return;\n\n // await fastRafPromise();\n // if(this.bubbles[mid] !== bubble) return;\n\n // const groupIndex = this.bubbleGroups.groups.indexOf(group);\n this.bubbleGroups.removeAndUnmountBubble(bubble);\n // if(!group.items.length) { // group has collapsed, next message can have higher mid so have to reposition them too\n // log && log('group has collapsed', item);\n\n // const siblingGroups = this.bubbleGroups.groups.slice(0, groupIndex + 1);\n // for(let length = siblingGroups.length, i = length - 2; i >= 0; --i) {\n // const siblingGroup = siblingGroups[i];\n // const siblingItems = siblingGroup.items;\n // const nextGroup = siblingGroups[i + 1];\n // const nextItems = nextGroup.items;\n\n // let _break = false, moved = false;\n // for(let j = siblingItems.length - 1; j >= 0; --j) {\n // const siblingItem = siblingItems[j];\n // const foundItem = this.bubbleGroups.findGroupSiblingByItem(siblingItem, nextItems);\n // if(!foundItem) {\n // _break = true;\n // break;\n // }\n\n // log('will move item', siblingItem, nextGroup);\n // this.bubbleGroups.removeAndUnmountBubble(siblingItem.bubble);\n // this.bubbleGroups.addItemToGroup(siblingItem, nextGroup);\n // moved = true;\n // }\n\n // if(moved) {\n // nextGroup.mount();\n // }\n\n // if(_break) {\n // break;\n // }\n // }\n // }\n\n const {groups} = this.groupBubbles([{bubble, message}]);\n this.bubbleGroups.mountUnmountGroups(groups);\n\n if(this.scrollingToBubble) {\n this.scrollToEnd();\n }\n\n log && log('end');\n\n // this.bubbleGroups.findIncorrentPositions();\n });\n\n this.listenerSetter.add(rootScope)('dialog_flush', ({peerId}) => {\n if(this.peerId === peerId) {\n this.deleteMessagesByIds(Object.keys(this.bubbles).map((m) => +m));\n }\n });\n\n // Calls when message successfully sent and we have an id\n this.listenerSetter.add(rootScope)('message_sent', async(e) => {\n const {storageKey, tempId, tempMessage, mid, message} = e;\n\n // ! can't use peerId to validate here, because id can be the same in 'scheduled' and 'chat' types\n if(this.chat.messagesStorageKey !== storageKey) {\n return;\n }\n\n const bubbles = this.bubbles;\n const _bubble = bubbles[tempId];\n if(_bubble) {\n const bubble = bubbles[tempId];\n bubbles[mid] = bubble;\n bubble.dataset.mid = '' + mid;\n delete bubbles[tempId];\n\n fastRaf(() => {\n const mid = +bubble.dataset.mid;\n if(bubbles[mid] === bubble && bubble.classList.contains('is-outgoing')) {\n bubble.classList.remove('is-sending', 'is-outgoing');\n bubble.classList.add((this.peerId === rootScope.myId && this.chat.type !== 'scheduled') || !this.unreadOut.has(mid) ? 'is-read' : 'is-sent');\n }\n });\n }\n\n if(this.unreadOut.has(tempId)) {\n this.unreadOut.delete(tempId);\n this.unreadOut.add(mid);\n }\n\n // * check timing of scheduled message\n if(this.chat.type === 'scheduled') {\n const timestamp = Date.now() / 1000 | 0;\n const maxTimestamp = tempMessage.date - 10;\n if(timestamp >= maxTimestamp) {\n this.deleteMessagesByIds([mid]);\n }\n }\n\n if(!_bubble) {\n return;\n }\n\n let messages: (Message.message | Message.messageService)[], tempIds: number[];\n const groupedId = (message as Message.message).grouped_id;\n if(groupedId) {\n messages = await this.managers.appMessagesManager.getMessagesByAlbum(groupedId);\n const mids = messages.map(({mid}) => mid);\n if(!mids.length || getMainMidForGrouped(mids) !== mid || bubbles[mid] !== _bubble) {\n return;\n }\n\n if(bubbles[mid] !== _bubble) {\n return;\n }\n\n tempIds = (Array.from(_bubble.querySelectorAll('.grouped-item')) as HTMLElement[]).map((el) => +el.dataset.mid);\n } else {\n messages = [message];\n tempIds = [tempId];\n }\n\n const reactionsElements = Array.from(_bubble.querySelectorAll('reactions-element')) as ReactionsElement[];\n if(reactionsElements.length) {\n reactionsElements.forEach((reactionsElement) => {\n reactionsElement.changeMessage(message as Message.message);\n });\n }\n\n (messages as Message.message[]).forEach((message, idx) => {\n if(!message) {\n return;\n }\n\n const tempId = tempIds[idx];\n const mid = message.mid;\n const bubble: HTMLElement = _bubble.querySelector(`.document-container[data-mid=\"${mid}\"]`) || _bubble;\n\n if(message._ !== 'message') {\n return;\n }\n\n if(message.replies) {\n const repliesElement = _bubble.querySelector('replies-element') as RepliesElement;\n if(repliesElement) {\n repliesElement.message = message;\n repliesElement.init();\n }\n }\n\n const media = message.media ?? {} as MessageMedia.messageMediaEmpty;\n const doc = (media as MessageMedia.messageMediaDocument).document as Document.document;\n const poll = (media as MessageMedia.messageMediaPoll).poll;\n const webPage = (media as MessageMedia.messageMediaWebPage).webpage as WebPage.webPage;\n if(doc) {\n const div = bubble.querySelector(`.document-container[data-mid=\"${tempId}\"] .document`);\n if(div) {\n const container = findUpClassName(div, 'document-container');\n\n if(!tempMessage.media?.document?.thumbs?.length && doc.thumbs?.length) {\n getHeavyAnimationPromise().then(async() => {\n const timeSpan = div.querySelector('.time');\n const newDiv = await wrapDocument({message, fontSize: rootScope.settings.messagesTextSize});\n div.replaceWith(newDiv);\n\n if(timeSpan) {\n (newDiv.querySelector('.document') || newDiv).append(timeSpan);\n }\n });\n }\n\n if(container) {\n container.dataset.mid = '' + mid;\n }\n }\n\n const element = bubble.querySelector(`audio-element[data-mid=\"${tempId}\"], .document[data-doc-id=\"${tempId}\"], .media-round[data-mid=\"${tempId}\"]`) as HTMLElement;\n if(element) {\n if(element instanceof AudioElement || element.classList.contains('media-round')) {\n element.dataset.mid = '' + message.mid;\n delete element.dataset.isOutgoing;\n (element as AudioElement).message = message;\n (element as AudioElement).onLoad(true);\n } else {\n element.dataset.docId = '' + doc.id;\n (element as any).doc = doc;\n }\n }\n } else if(poll) {\n const pollElement = bubble.querySelector('poll-element') as PollElement;\n if(pollElement) {\n pollElement.message = message;\n pollElement.setAttribute('poll-id', '' + poll.id);\n pollElement.setAttribute('message-id', '' + mid);\n }\n } else if(webPage && !bubble.querySelector('.web')) {\n getHeavyAnimationPromise().then(() => {\n this.safeRenderMessage(message, true, bubble);\n this.scrollToBubbleIfLast(bubble);\n });\n }\n\n // set new mids to album items for mediaViewer\n if(groupedId) {\n const item = (bubble.querySelector(`.grouped-item[data-mid=\"${tempId}\"]`) as HTMLElement) || bubble; // * it can be .document-container\n if(item) {\n item.dataset.mid = '' + mid;\n }\n }\n });\n });\n\n this.listenerSetter.add(rootScope)('message_edit', async({storageKey, message}) => {\n if(storageKey !== this.chat.messagesStorageKey) return;\n\n const bubble = this.bubbles[message.mid];\n if(!bubble) return;\n\n await getHeavyAnimationPromise();\n if(this.bubbles[message.mid] !== bubble) return;\n\n this.safeRenderMessage(message, true, bubble);\n });\n\n this.listenerSetter.add(rootScope)('message_error', async({storageKey, tempId}) => {\n if(storageKey !== this.chat.messagesStorageKey) return;\n\n const bubble = this.bubbles[tempId];\n if(!bubble) return;\n\n await getHeavyAnimationPromise();\n if(this.bubbles[tempId] !== bubble) return;\n\n bubble.classList.remove('is-outgoing');\n bubble.classList.add('is-error');\n });\n\n this.listenerSetter.add(rootScope)('message_transcribed', ({peerId, mid, text, pending}) => {\n if(peerId !== this.peerId) return;\n\n const bubble = this.bubbles[mid];\n if(!bubble) return;\n\n // TODO: Move it to AudioElement method `finishVoiceTranscription`\n const audioElement = bubble.querySelector('audio-element') as AudioElement;\n if(!audioElement) {\n return;\n }\n\n // const scrollSaver = this.createScrollSaver(false);\n // scrollSaver.save();\n\n const speechTextDiv = bubble.querySelector('.document-wrapper, .quote-text.has-document') as HTMLElement;\n const speechRecognitionIcon = audioElement.querySelector('.audio-to-text-button span');\n const speechRecognitionLoader = audioElement.querySelector('.loader');\n if(speechTextDiv && speechRecognitionIcon) {\n let transcribedText = speechTextDiv.querySelector('.audio-transcribed-text');\n if(!transcribedText) {\n transcribedText = document.createElement('div');\n transcribedText.classList.add('audio-transcribed-text');\n transcribedText.append(document.createTextNode(''));\n\n if(speechTextDiv.classList.contains('document-wrapper')) {\n audioElement.before(transcribedText);\n } else {\n speechTextDiv.append(transcribedText);\n }\n\n if(pending) {\n const dots = document.createElement('span');\n dots.classList.add('audio-transcribing-dots');\n transcribedText.append(dots);\n }\n } else if(!pending) {\n const dots = transcribedText.querySelector('.audio-transcribing-dots');\n dots?.remove();\n }\n\n if(!text && !pending/* && !transcribedText.classList.contains('has-some-text') */) {\n transcribedText.replaceChildren(i18n('Chat.Voice.Transribe.Error'));\n transcribedText.classList.add('is-error');\n } else if(text) {\n // transcribedText.classList.add('has-some-text');\n transcribedText.firstChild.textContent = text;\n }\n\n speechRecognitionIcon.classList.remove('tgico-transcribe');\n speechRecognitionIcon.classList.add('tgico-up');\n\n if(!pending && speechRecognitionLoader) {\n speechRecognitionLoader.classList.remove('active');\n setTimeout(() => {\n speechRecognitionLoader.remove();\n }, 300);\n }\n\n audioElement.transcriptionState = 2;\n }\n\n // scrollSaver.restore();\n });\n\n this.listenerSetter.add(rootScope)('album_edit', ({peerId, messages, deletedMids}) => {\n if(peerId !== this.peerId) return;\n\n const mids = messages.map(({mid}) => mid);\n const oldMids = mids.concat(Array.from(deletedMids));\n const wasMainMid = getMainMidForGrouped(oldMids);\n const bubble = this.bubbles[wasMainMid];\n if(!bubble) {\n return;\n }\n\n const mainMid = getMainMidForGrouped(mids);\n const message = messages.find((message) => message.mid === mainMid);\n this.safeRenderMessage(message, true, bubble);\n });\n\n // this.listenerSetter.add(rootScope)('peer_title_edit', async(peerId) => {\n // if(peerId.isUser()) {\n // const middleware = this.getMiddleware();\n // const user = await this.managers.appUsersManager.getUser(peerId.toUserId());\n // if(!middleware()) return;\n\n // const isPremium = user?.pFlags?.premium;\n // const groups = this.bubbleGroups.groups.filter((group) => group.avatar?.peerId === peerId);\n // groups.forEach((group) => {\n // group.avatar.classList.toggle('is-premium', isPremium);\n // group.avatar.classList.toggle('tgico-star', isPremium);\n // });\n // }\n // });\n\n if(!DO_NOT_UPDATE_MESSAGE_REACTIONS/* && false */) {\n this.listenerSetter.add(rootScope)('messages_reactions', async(arr) => {\n if(this.chat.type === 'scheduled') {\n return;\n }\n\n let scrollSaver: ScrollSaver;\n\n const a = arr.map(async({message, changedResults}) => {\n if(this.peerId !== message.peerId) {\n return;\n }\n\n const result = await this.getMountedBubble(message.mid, message);\n if(!result) {\n return;\n }\n\n // can be .document-container\n return {bubble: findUpClassName(result.bubble, 'bubble'), message, changedResults};\n });\n\n let top: number;\n (await Promise.all(a)).filter(Boolean).forEach(({bubble, message, changedResults}) => {\n if(!scrollSaver) {\n scrollSaver = this.createScrollSaver(false);\n scrollSaver.save();\n }\n\n const key = message.peerId + '_' + message.mid;\n const set = REACTIONS_ELEMENTS.get(key);\n if(set) {\n for(const element of set) {\n element.update(message, changedResults);\n }\n } else if(!message.reactions || !message.reactions.results.length) {\n return;\n } else {\n this.appendReactionsElementToBubble(bubble, message, message, changedResults);\n }\n });\n\n if(scrollSaver) {\n scrollSaver.restore();\n }\n });\n }\n\n !DO_NOT_UPDATE_MESSAGE_REPLY && this.listenerSetter.add(rootScope)('messages_downloaded', async({peerId, mids}) => {\n const middleware = this.getMiddleware();\n await getHeavyAnimationPromise();\n if(!middleware()) return;\n\n (mids as number[]).forEach((mid) => {\n const needUpdate = this.needUpdate;\n const filtered: typeof needUpdate[0][] = [];\n forEachReverse(this.needUpdate, (obj, idx) => {\n if(obj.replyMid === mid && obj.replyToPeerId === peerId) {\n this.needUpdate.splice(idx, 1)[0];\n filtered.push(obj);\n }\n });\n\n filtered.forEach(async({mid, replyMid, replyToPeerId}) => {\n const bubble = this.bubbles[mid];\n if(!bubble) return;\n\n const [message, originalMessage] = await Promise.all([\n (await this.chat.getMessage(mid)) as Message.message,\n (await this.managers.appMessagesManager.getMessageByPeer(replyToPeerId, replyMid)) as Message.message\n ]);\n if(!middleware()) return;\n\n MessageRender.setReply({\n chat: this.chat,\n bubble,\n message\n });\n\n let maxMediaTimestamp: number;\n const timestamps = bubble.querySelectorAll('.timestamp');\n if(originalMessage && (maxMediaTimestamp = getMediaDurationFromMessage(originalMessage))) {\n timestamps.forEach((timestamp) => {\n const value = +timestamp.dataset.timestamp;\n if(value < maxMediaTimestamp) {\n timestamp.classList.remove('is-disabled');\n } else {\n timestamp.removeAttribute('href');\n }\n });\n }\n });\n });\n });\n\n attachStickerViewerListeners({\n listenTo: this.scrollable.container,\n listenerSetter: this.listenerSetter,\n findTarget: (e) => {\n const target = e.target as HTMLElement;\n const found = target.closest('.attachment.media-sticker-wrapper') || (findUpClassName(target, 'attachment') && target.closest('.custom-emoji'));\n return found as HTMLElement;\n }\n });\n attachClickEvent(this.scrollable.container, this.onBubblesClick, {listenerSetter: this.listenerSetter});\n // this.listenerSetter.add(this.bubblesContainer)('click', this.onBubblesClick/* , {capture: true, passive: false} */);\n\n this.listenerSetter.add(this.scrollable.container)('mousedown', (e) => {\n if(e.button !== 0) return;\n\n const code: HTMLElement = findUpTag(e.target, 'CODE');\n if(code) {\n cancelEvent(e);\n copyFromElement(code);\n\n const onClick = (e: MouseEvent) => {\n cancelEvent(e);\n toastNew({\n langPackKey: 'TextCopied',\n onClose: () => {\n detach();\n }\n });\n };\n\n const detach = attachClickEvent(window, onClick, {listenerSetter: this.listenerSetter, once: true, capture: true});\n return;\n }\n });\n\n /* if(false) */this.stickyIntersector = new StickyIntersector(this.scrollable.container, (stuck, target) => {\n for(const timestamp in this.dateMessages) {\n const dateMessage = this.dateMessages[timestamp];\n if(dateMessage.container === target) {\n const dateBubble = dateMessage.div;\n\n // dateMessage.container.classList.add('has-sticky-dates');\n\n // SetTransition(dateBubble, 'kek', stuck, this.previousStickyDate ? 300 : 0);\n // if(this.previousStickyDate) {\n // dateBubble.classList.add('kek');\n // }\n\n dateBubble.classList.toggle('is-sticky', stuck);\n if(stuck) {\n this.previousStickyDate = dateBubble;\n }\n\n break;\n }\n }\n\n if(this.previousStickyDate) {\n // fastRaf(() => {\n // this.bubblesContainer.classList.add('has-sticky-dates');\n // });\n }\n });\n\n if(!IS_SAFARI) {\n this.sliceViewportDebounced = debounce(this.sliceViewport.bind(this), 3000, false, true);\n }\n\n let middleware: ReturnType;\n useHeavyAnimationCheck(() => {\n this.isHeavyAnimationInProgress = true;\n this.lazyLoadQueue.lock();\n middleware = this.getMiddleware();\n\n // if(this.sliceViewportDebounced) {\n // this.sliceViewportDebounced.clearTimeout();\n // }\n }, () => {\n this.isHeavyAnimationInProgress = false;\n\n if(middleware?.()) {\n this.lazyLoadQueue.unlockAndRefresh();\n\n // if(this.sliceViewportDebounced) {\n // this.sliceViewportDebounced();\n // }\n }\n\n middleware = null;\n }, this.listenerSetter);\n }\n\n private constructBubbles() {\n const container = this.container = document.createElement('div');\n container.classList.add('bubbles', 'scrolled-down');\n\n const chatInner = this.chatInner = document.createElement('div');\n chatInner.classList.add('bubbles-inner');\n\n this.setScroll();\n\n container.append(this.scrollable.container);\n }\n\n public attachContainerListeners() {\n const container = this.container;\n\n this.chat.contextMenu.attachTo(container);\n this.chat.selection.attachListeners(container, new ListenerSetter());\n\n if(DEBUG) {\n this.listenerSetter.add(container)('dblclick', async(e) => {\n const bubble = findUpClassName(e.target, 'grouped-item') || findUpClassName(e.target, 'bubble');\n if(bubble) {\n const mid = +bubble.dataset.mid\n this.log('debug message:', await this.chat.getMessage(mid));\n this.highlightBubble(bubble);\n }\n });\n }\n\n if(!IS_MOBILE) {\n this.listenerSetter.add(container)('dblclick', async(e) => {\n if(this.chat.type === 'pinned' ||\n this.chat.selection.isSelecting ||\n !(await this.chat.canSend())) {\n return;\n }\n\n const target = e.target as HTMLElement;\n const bubble = target.classList.contains('bubble') ?\n target :\n (target.classList.contains('document-selection') ? target.parentElement : null);\n if(bubble && !bubble.classList.contains('bubble-first')) {\n const mid = +bubble.dataset.mid;\n const message = await this.chat.getMessage(mid);\n if(message.pFlags.is_outgoing) {\n return;\n }\n\n this.chat.input.initMessageReply(mid);\n }\n });\n } else if(IS_TOUCH_SUPPORTED) {\n const className = 'is-gesturing-reply';\n const MAX = 64;\n const replyAfter = MAX * .75;\n let shouldReply = false;\n let target: HTMLElement;\n let icon: HTMLElement;\n let swipeAvatar: HTMLElement;\n handleHorizontalSwipe({\n element: container,\n verifyTouchTarget: async(e) => {\n if(this.chat.type === 'pinned' || this.chat.selection.isSelecting || !(await this.chat.canSend())) {\n return false;\n }\n\n // cancelEvent(e);\n target = findUpClassName(e.target, 'bubble');\n if(target) {\n try {\n const avatar = target.parentElement.querySelector('.bubbles-group-avatar') as HTMLElement\n if(avatar) {\n const visibleRect = getVisibleRect(avatar, target);\n if(visibleRect) {\n swipeAvatar = avatar;\n }\n }\n } catch(err) {}\n\n [target, swipeAvatar].filter(Boolean).forEach((element) => {\n SetTransition({\n element,\n className,\n forwards: true,\n duration: 250\n });\n void element.offsetLeft; // reflow\n });\n\n if(!icon) {\n icon = document.createElement('span');\n icon.classList.add('tgico-reply_filled', 'bubble-gesture-reply-icon');\n } else {\n icon.classList.remove('is-visible');\n icon.style.opacity = '';\n }\n\n target/* .querySelector('.bubble-content') */.append(icon);\n }\n\n return !!target;\n },\n onSwipe: (xDiff) => {\n shouldReply = xDiff >= replyAfter;\n\n if(shouldReply && !icon.classList.contains('is-visible')) {\n icon.classList.add('is-visible');\n }\n icon.style.opacity = '' + Math.min(1, xDiff / replyAfter);\n\n const x = -Math.max(0, Math.min(MAX, xDiff));\n const transform = `translateX(${x}px)`;\n target.style.transform = transform;\n if(swipeAvatar) {\n swipeAvatar.style.transform = transform;\n }\n cancelContextMenuOpening();\n },\n onReset: () => {\n const _target = target;\n const _swipeAvatar = swipeAvatar;\n target = swipeAvatar = undefined;\n\n const onTransitionEnd = () => {\n if(icon.parentElement === _target) {\n icon.classList.remove('is-visible');\n icon.remove();\n }\n };\n\n [_target, _swipeAvatar].filter(Boolean).forEach((element, idx) => {\n SetTransition({\n element,\n className,\n forwards: false,\n duration: 250,\n onTransitionEnd: idx === 0 ? onTransitionEnd : undefined\n });\n });\n\n fastRaf(() => {\n _target.style.transform = '';\n if(_swipeAvatar) {\n _swipeAvatar.style.transform = '';\n }\n\n if(shouldReply) {\n const {mid} = _target.dataset;\n this.chat.input.initMessageReply(+mid);\n shouldReply = false;\n }\n });\n },\n listenerOptions: {capture: true}\n });\n }\n }\n\n public constructPeerHelpers() {\n // will call when message is sent (only 1)\n this.listenerSetter.add(rootScope)('history_append', async({storageKey, message}) => {\n if(storageKey !== this.chat.messagesStorageKey || this.chat.type === 'scheduled') return;\n\n if(liteMode.isAvailable('chat_background')) {\n this.updateGradient = true;\n }\n\n if(!this.scrollable.loadedAll.bottom) {\n this.chat.setMessageId();\n } else {\n this.renderNewMessage(message, true);\n }\n });\n\n this.listenerSetter.add(rootScope)('history_multiappend', (message) => {\n if(this.peerId !== message.peerId || this.chat.type === 'scheduled') return;\n this.renderNewMessage(message);\n });\n\n this.listenerSetter.add(rootScope)('history_delete', ({peerId, msgs}) => {\n if(peerId !== this.peerId || this.chat.type === 'scheduled') {\n return;\n }\n\n this.deleteMessagesByIds(Array.from(msgs));\n });\n\n this.listenerSetter.add(rootScope)('dialog_unread', ({peerId}) => {\n if(peerId === this.peerId) {\n this.chat.input.setUnreadCount();\n\n getHeavyAnimationPromise().then(() => {\n this.updateUnreadByDialog();\n });\n }\n });\n\n this.listenerSetter.add(rootScope)('dialogs_multiupdate', (dialogs) => {\n if(!dialogs.has(this.peerId) || this.chat.type === 'scheduled') {\n return;\n }\n\n this.chat.input.setUnreadCount();\n });\n\n this.listenerSetter.add(rootScope)('dialog_notify_settings', (dialog) => {\n if(this.peerId !== dialog.peerId || this.chat.type === 'scheduled') {\n return;\n }\n\n this.chat.input.setUnreadCount();\n });\n\n this.listenerSetter.add(rootScope)('chat_update', async(chatId) => {\n const {peerId} = this;\n if(peerId !== chatId.toPeerId(true)) {\n return;\n }\n\n const chat = await this.managers.appChatsManager.getChat(chatId);\n const hadRights = this.chatInner.classList.contains('has-rights');\n const hadPlainRights = this.chat.input.canSendPlain();\n const [hasRights, hasPlainRights, canEmbedLinks] = await Promise.all([\n this.chat.canSend('send_messages'),\n this.chat.canSend('send_plain'),\n this.chat.canSend('embed_links')\n ]);\n\n if(hadRights !== hasRights || hadPlainRights !== hasPlainRights) {\n const callbacks = await Promise.all([\n this.finishPeerChange(),\n this.chat.input.finishPeerChange()\n ]);\n\n callbacks.forEach((callback) => callback());\n }\n\n // reset webpage\n if((canEmbedLinks && !this.chat.input.willSendWebPage) || (!canEmbedLinks && this.chat.input.willSendWebPage)) {\n this.chat.input.lastUrl = '';\n this.chat.input.onMessageInput();\n }\n\n if(!!(chat as MTChat.channel).pFlags.forum !== this.chat.isForum && this.chat.type === 'chat') {\n this.chat.peerId = 0;\n this.chat.appImManager.setPeer({peerId});\n }\n });\n\n this.listenerSetter.add(rootScope)('history_reload', (peerId) => {\n if(peerId !== this.peerId) {\n return;\n }\n\n const mids = getObjectKeysAndSort(this.bubbles, 'desc').filter((mid) => mid > 0);\n const middleware = this.getMiddleware();\n this.managers.appMessagesManager.reloadMessages(this.peerId, mids).then((messages) => {\n if(!middleware()) return;\n\n const toDelete: number[] = [];\n messages.forEach((message, idx) => {\n const mid = mids[idx];\n if(message) {\n const bubble = this.bubbles[message.mid];\n if(!bubble) return;\n\n this.safeRenderMessage(message, true, bubble);\n } else {\n toDelete.push(mid);\n }\n });\n\n this.deleteMessagesByIds(toDelete);\n\n this.setLoaded('top', false);\n this.setLoaded('bottom', false);\n this.scrollable.checkForTriggers();\n });\n });\n\n this.listenerSetter.add(rootScope)('settings_updated', async({key}) => {\n if(key === 'settings.emoji.big') {\n const middleware = this.getMiddleware();\n const mids = getObjectKeysAndSort(this.bubbles, 'desc');\n const m = mids.map(async(mid) => {\n const bubble = this.bubbles[mid];\n if(bubble.classList.contains('can-have-big-emoji')) {\n return {bubble, message: await this.chat.getMessage(mid)};\n }\n });\n\n const awaited = await Promise.all(m);\n if(!middleware()) {\n return;\n }\n\n awaited.filter(Boolean).forEach(({bubble, message}) => {\n if(this.bubbles[message.mid] !== bubble) {\n return;\n }\n\n this.safeRenderMessage(message, true, bubble);\n });\n }\n });\n\n !DO_NOT_UPDATE_MESSAGE_VIEWS && this.listenerSetter.add(rootScope)('messages_views', (arr) => {\n if(this.chat.type === 'scheduled') return;\n\n fastRaf(() => {\n let scrollSaver: ScrollSaver;\n for(const {peerId, views, mid} of arr) {\n if(this.peerId !== peerId) continue;\n\n const bubble = this.bubbles[mid];\n if(!bubble) continue;\n\n const postViewsElements = Array.from(bubble.querySelectorAll('.post-views')) as HTMLElement[];\n if(!postViewsElements.length) continue;\n\n const str = formatNumber(views, 1);\n let different = false;\n postViewsElements.forEach((postViews) => {\n if(different || postViews.textContent !== str) {\n if(!scrollSaver) {\n scrollSaver = this.createScrollSaver(true);\n scrollSaver.save();\n }\n\n different = true;\n postViews.textContent = str;\n }\n });\n }\n\n scrollSaver?.restore();\n });\n });\n\n this.observer = new SuperIntersectionObserver({root: this.scrollable.container});\n\n this.sendViewCountersDebounced = debounce(() => {\n const mids = [...this.viewsMids];\n this.viewsMids.clear();\n\n this.managers.appMessagesManager.incrementMessageViews(this.peerId, mids);\n }, 1000, false, true);\n\n // * pinned part start\n this.listenerSetter.add(rootScope)('peer_pinned_messages', ({peerId, mids, pinned}) => {\n if(this.chat.type !== 'pinned' || peerId !== this.peerId) {\n return;\n }\n\n if(mids) {\n if(!pinned) {\n this.deleteMessagesByIds(mids);\n }\n }\n });\n // * pinned part end\n\n // * scheduled part start\n const onUpdate = async() => {\n this.chat.topbar.setTitle((await this.managers.appMessagesManager.getScheduledMessagesStorage(this.peerId)).size);\n };\n\n this.listenerSetter.add(rootScope)('scheduled_new', (message) => {\n if(this.chat.type !== 'scheduled' || message.peerId !== this.peerId) return;\n\n this.renderNewMessage(message);\n onUpdate();\n });\n\n this.listenerSetter.add(rootScope)('scheduled_delete', ({peerId, mids}) => {\n if(this.chat.type !== 'scheduled' || peerId !== this.peerId) return;\n\n this.deleteMessagesByIds(mids);\n onUpdate();\n });\n // * scheduled part end\n }\n\n private get peerId() {\n return this.chat.peerId;\n }\n\n public get messagesQueuePromise() {\n return this.batchProcessor.queuePromise;\n }\n\n private createScrollSaver(reverse = true) {\n const scrollSaver = new ScrollSaver(this.scrollable, '.bubble:not(.is-date)', reverse);\n return scrollSaver;\n }\n\n private unreadedObserverCallback = (entry: IntersectionObserverEntry) => {\n if(entry.isIntersecting) {\n const target = entry.target as HTMLElement;\n const mid = this.unreaded.get(target as HTMLElement);\n this.onUnreadedInViewport(target, mid);\n }\n };\n\n private viewsObserverCallback = (entry: IntersectionObserverEntry) => {\n if(entry.isIntersecting) {\n const mid = +(entry.target as HTMLElement).dataset.mid;\n this.observer.unobserve(entry.target, this.viewsObserverCallback);\n\n if(mid) {\n this.viewsMids.add(mid);\n this.sendViewCountersDebounced();\n } else {\n const {sponsoredMessage} = this;\n const randomId = sponsoredMessage?.random_id;\n if(randomId) {\n this.managers.appChatsManager.viewSponsoredMessage(this.peerId.toChatId(), randomId);\n delete sponsoredMessage.random_id;\n }\n }\n }\n };\n\n private stickerEffectObserverCallback = (entry: IntersectionObserverEntry) => {\n if(entry.isIntersecting) {\n this.observer.unobserve(entry.target, this.stickerEffectObserverCallback);\n\n const attachmentDiv: HTMLElement = entry.target.querySelector('.attachment');\n getHeavyAnimationPromise().then(() => {\n if(isInDOM(attachmentDiv)) {\n simulateClickEvent(attachmentDiv);\n }\n });\n }\n };\n\n private createResizeObserver() {\n if(!('ResizeObserver' in window) || this.resizeObserver) {\n return;\n }\n\n const container = this.scrollable.container;\n let wasHeight = 0/* container.offsetHeight */;\n let resizing = false;\n let skip = false;\n let scrolled = 0;\n let part = 0;\n let rAF = 0;\n // let skipNext = true;\n\n const onResizeEnd = () => {\n const height = container.offsetHeight;\n const isScrolledDown = this.scrollable.isScrolledDown;\n if(height !== wasHeight && (!skip || !isScrolledDown)) { // * fix opening keyboard while ESG is active, offsetHeight will change right between 'start' and this first frame\n part += wasHeight - height;\n }\n\n /* if(DEBUG) {\n this.log('resize end', scrolled, part, this.scrollable.scrollTop, height, wasHeight, this.scrollable.isScrolledDown);\n } */\n\n if(part) {\n this.scrollable.setScrollTopSilently(this.scrollable.scrollTop + Math.round(part));\n }\n\n wasHeight = height;\n scrolled = 0;\n rAF = 0;\n part = 0;\n resizing = false;\n skip = false;\n };\n\n const setEndRAF = (single: boolean) => {\n if(rAF) window.cancelAnimationFrame(rAF);\n rAF = window.requestAnimationFrame(single ? onResizeEnd : () => {\n rAF = window.requestAnimationFrame(onResizeEnd);\n // this.log('resize after RAF', part);\n });\n };\n\n const processEntries: ResizeObserverCallback = (entries) => {\n /* if(skipNext) {\n skipNext = false;\n return;\n } */\n\n if(skip) {\n setEndRAF(false);\n return;\n }\n\n const entry = entries[0];\n const height = entry.contentRect.height;/* Math.ceil(entry.contentRect.height); */\n\n if(!wasHeight) {\n wasHeight = height;\n return;\n }\n\n const realDiff = wasHeight - height;\n let diff = realDiff + part;\n const _part = diff % 1;\n diff -= _part;\n\n if(!resizing) {\n resizing = true;\n\n /* if(DEBUG) {\n this.log('resize start', realDiff, this.scrollable.scrollTop, this.scrollable.container.offsetHeight, this.scrollable.isScrolledDown);\n } */\n\n if(realDiff < 0 && this.scrollable.isScrolledDown) {\n // if(isSafari) { // * fix opening keyboard while ESG is active\n part = -realDiff;\n // }\n\n skip = true;\n setEndRAF(false);\n return;\n }\n }\n\n scrolled += diff;\n\n /* if(DEBUG) {\n this.log('resize', wasHeight - height, diff, this.scrollable.container.offsetHeight, this.scrollable.isScrolledDown, height, wasHeight);\n } */\n\n if(diff) {\n const needScrollTop = this.scrollable.scrollTop + diff;\n this.scrollable.setScrollTopSilently(needScrollTop);\n }\n\n setEndRAF(false);\n\n part = _part;\n wasHeight = height;\n };\n\n const resizeObserver = this.resizeObserver = new ResizeObserver(processEntries);\n resizeObserver.observe(container);\n }\n\n private destroyResizeObserver() {\n const resizeObserver = this.resizeObserver;\n if(!resizeObserver) {\n return;\n }\n\n resizeObserver.disconnect();\n this.resizeObserver = undefined;\n }\n\n private onBubblesMouseMove = async(e: MouseEvent) => {\n const content = findUpClassName(e.target, 'bubble-content');\n if(\n this.chat.type !== 'scheduled' &&\n content &&\n !this.chat.selection.isSelecting &&\n !findUpClassName(e.target, 'service') &&\n !findUpClassName(e.target, 'bubble-beside-button')\n ) {\n const bubble = findUpClassName(content, 'bubble');\n if(!this.chat.selection.canSelectBubble(bubble)) {\n this.unhoverPrevious();\n return;\n }\n\n let {hoverBubble, hoverReaction} = this;\n if(bubble === hoverBubble) {\n return;\n }\n\n this.unhoverPrevious();\n\n hoverBubble = this.hoverBubble = bubble;\n hoverReaction = this.hoverReaction;\n // hoverReaction = contentWrapper.querySelector('.bubble-hover-reaction');\n if(!hoverReaction) {\n hoverReaction = this.hoverReaction = document.createElement('div');\n hoverReaction.classList.add('bubble-hover-reaction');\n\n const stickerWrapper = document.createElement('div');\n stickerWrapper.classList.add('bubble-hover-reaction-sticker');\n hoverReaction.append(stickerWrapper);\n\n content.append(hoverReaction);\n\n let message = await this.chat.getMessage(+bubble.dataset.mid);\n if(message?._ !== 'message') {\n this.unhoverPrevious();\n return;\n }\n\n message = await this.managers.appMessagesManager.getGroupsFirstMessage(message);\n\n const middleware = this.getMiddleware(() => this.hoverReaction === hoverReaction);\n Promise.all([\n this.managers.appReactionsManager.getAvailableReactionsByMessage(message),\n pause(400)\n ]).then(([availableReactions]) => {\n const availableReaction = availableReactions[0];\n if(!availableReaction) {\n hoverReaction.remove();\n return;\n }\n\n wrapSticker({\n div: stickerWrapper,\n doc: availableReaction.select_animation,\n width: 18,\n height: 18,\n needUpscale: true,\n middleware,\n group: this.chat.animationGroup,\n withThumb: false,\n needFadeIn: false\n }).then(({render}) => render).then((player) => {\n assumeType(player);\n\n player.addEventListener('firstFrame', () => {\n if(!middleware()) {\n // debugger;\n return;\n }\n\n hoverReaction.dataset.loaded = '1';\n this.setHoverVisible(hoverReaction, true);\n }, {once: true});\n\n attachClickEvent(hoverReaction, (e) => {\n cancelEvent(e); // cancel triggering selection\n\n this.managers.appReactionsManager.sendReaction(message as Message.message, availableReaction);\n this.unhoverPrevious();\n }, {listenerSetter: this.listenerSetter});\n }, noop);\n });\n } else if(hoverReaction.dataset.loaded) {\n this.setHoverVisible(hoverReaction, true);\n }\n } else {\n this.unhoverPrevious();\n }\n };\n\n public setReactionsHoverListeners() {\n this.listenerSetter.add(contextMenuController)('toggle', this.unhoverPrevious);\n this.listenerSetter.add(overlayCounter)('change', this.unhoverPrevious);\n this.listenerSetter.add(this.chat.selection)('toggle', this.unhoverPrevious);\n this.listenerSetter.add(this.container)('mousemove', this.onBubblesMouseMove);\n }\n\n private setHoverVisible(hoverReaction: HTMLElement, visible: boolean) {\n if(hoverReaction.parentElement) {\n hoverReaction.parentElement.classList.toggle('hover-reaction-visible', visible);\n }\n\n SetTransition({\n element: hoverReaction,\n className: 'is-visible',\n forwards: visible,\n duration: 200,\n onTransitionEnd: visible ? undefined : () => {\n hoverReaction.remove();\n },\n useRafs: 2\n });\n }\n\n private unhoverPrevious = () => {\n const {hoverBubble, hoverReaction} = this;\n if(hoverBubble) {\n this.setHoverVisible(hoverReaction, false);\n this.hoverBubble = undefined;\n this.hoverReaction = undefined;\n }\n };\n\n public setStickyDateManually() {\n return;\n\n const timestamps = Object.keys(this.dateMessages).map((k) => +k).sort((a, b) => b - a);\n let lastVisible: HTMLElement;\n\n // if(this.chatInner.classList.contains('is-scrolling')) {\n const {scrollTop} = this.scrollable.container;\n const isOverflown = scrollTop > 0;\n if(isOverflown) {\n for(const timestamp of timestamps) {\n const dateMessage = this.dateMessages[timestamp];\n const visibleRect = getVisibleRect(dateMessage.container, this.scrollable.container);\n if(visibleRect && visibleRect.overflow.top) {\n lastVisible = dateMessage.div;\n } else if(lastVisible) {\n break;\n }\n }\n }\n // }\n\n if(lastVisible === this.previousStickyDate) {\n return;\n }\n\n if(lastVisible) {\n const needReflow = /* !!this.chat.setPeerPromise || */!this.previousStickyDate;\n if(needReflow) {\n lastVisible.classList.add('no-transition');\n }\n\n lastVisible.classList.add('is-sticky');\n\n if(needReflow) {\n void lastVisible.offsetLeft; // reflow\n lastVisible.classList.remove('no-transition');\n }\n }\n\n if(this.previousStickyDate && this.previousStickyDate !== lastVisible) {\n this.previousStickyDate.classList.remove('is-sticky');\n }\n\n this.previousStickyDate = lastVisible;\n }\n\n public getRenderedLength() {\n return Object.keys(this.bubbles).length - this.skippedMids.size;\n }\n\n private onUnreadedInViewport(target: HTMLElement, mid: number) {\n this.unreadedSeen.add(mid);\n this.observer.unobserve(target, this.unreadedObserverCallback);\n this.unreaded.delete(target);\n this.readUnreaded();\n }\n\n private readUnreaded() {\n if(this.readPromise) return;\n\n const middleware = this.getMiddleware();\n this.readPromise = idleController.getFocusPromise().then(async() => {\n if(!middleware()) return;\n let maxId = Math.max(...Array.from(this.unreadedSeen));\n\n // ? if message with maxId is not rendered ?\n if(this.scrollable.loadedAll.bottom) {\n const bubblesMaxId = Math.max(...Object.keys(this.bubbles).map((i) => +i));\n if(maxId >= bubblesMaxId) {\n maxId = Math.max((await this.chat.getHistoryMaxId()) || 0, maxId);\n }\n }\n\n this.unreaded.forEach((mid, target) => {\n if(mid <= maxId) {\n this.onUnreadedInViewport(target, mid);\n }\n });\n\n const readContents: number[] = [];\n for(const mid of this.unreadedSeen) {\n const message: MyMessage = await this.chat.getMessage(mid);\n if(isMentionUnread(message)) {\n readContents.push(mid);\n }\n }\n\n this.managers.appMessagesManager.readMessages(this.peerId, readContents);\n\n this.unreadedSeen.clear();\n\n if(DEBUG) {\n this.log('will readHistory by maxId:', maxId);\n }\n\n // return;\n\n return this.managers.appMessagesManager.readHistory(this.peerId, maxId, this.chat.threadId).catch((err: any) => {\n this.log.error('readHistory err:', err);\n this.managers.appMessagesManager.readHistory(this.peerId, maxId, this.chat.threadId);\n }).finally(() => {\n if(!middleware()) return;\n this.readPromise = undefined;\n\n if(this.unreadedSeen.size) {\n this.readUnreaded();\n }\n });\n });\n }\n\n public onBubblesClick = async(e: Event) => {\n let target = e.target as HTMLElement;\n let bubble: HTMLElement = null;\n try {\n bubble = findUpClassName(target, 'bubble');\n } catch(err) {}\n\n if(!bubble && !this.chat.selection.isSelecting) {\n const avatar = findUpClassName(target, 'user-avatar');\n if(!avatar) {\n return;\n }\n\n const peerId = avatar.dataset.peerId.toPeerId();\n if(peerId !== NULL_PEER_ID) {\n this.chat.appImManager.setInnerPeer({peerId});\n } else {\n toast(I18n.format('HidAccount', true));\n }\n return;\n }\n\n if(bubble.classList.contains('is-date') && findUpClassName(target, 'bubble-content')) {\n if(bubble.classList.contains('is-fake')) {\n bubble = bubble.previousElementSibling as HTMLElement;\n }\n\n if(bubble.classList.contains('is-sticky') && !this.chatInner.classList.contains('is-scrolling')) {\n return;\n }\n\n for(const timestamp in this.dateMessages) {\n const d = this.dateMessages[timestamp];\n if(d.div === bubble) {\n PopupElement.createPopup(PopupDatePicker, new Date(+timestamp), this.onDatePick).show();\n break;\n }\n }\n\n return;\n }\n\n if(!IS_TOUCH_SUPPORTED && findUpClassName(target, 'time')) {\n this.chat.selection.toggleByElement(bubble);\n return;\n }\n\n // ! Trusted - due to audio autoclick\n if(this.chat.selection.isSelecting && e.isTrusted) {\n if(bubble.classList.contains('service') && bubble.dataset.mid === undefined) {\n return;\n }\n\n cancelEvent(e);\n // console.log('bubble click', e);\n\n if(IS_TOUCH_SUPPORTED && this.chat.selection.selectedText) {\n this.chat.selection.selectedText = undefined;\n return;\n }\n\n // this.chatSelection.toggleByBubble(bubble);\n this.chat.selection.toggleByElement(findUpClassName(target, 'grouped-item') || bubble);\n return;\n }\n\n const mediaSpoiler: HTMLElement = findUpClassName(target, 'media-spoiler-container');\n if(mediaSpoiler) {\n onMediaSpoilerClick({\n event: e,\n mediaSpoiler\n });\n return;\n }\n\n const contactDiv: HTMLElement = findUpClassName(target, 'contact');\n if(contactDiv) {\n const peerId = contactDiv.dataset.peerId.toPeerId();\n if(peerId) {\n this.chat.appImManager.setInnerPeer({\n peerId\n });\n } else {\n const phone = contactDiv.querySelector('.contact-number');\n copyTextToClipboard(phone.innerText.replace(/\\s/g, ''));\n toastNew({langPackKey: 'PhoneCopied'});\n cancelEvent(e);\n }\n\n return;\n }\n\n const callDiv: HTMLElement = findUpClassName(target, 'bubble-call');\n if(callDiv) {\n this.chat.appImManager.callUser(this.peerId.toUserId(), callDiv.dataset.type as any);\n return;\n }\n\n const buyButton: HTMLElement = findUpClassName(target, 'is-buy');\n if(buyButton) {\n cancelEvent(e);\n\n const message = await this.chat.getMessage(+bubble.dataset.mid);\n if(!message) {\n return;\n }\n\n PopupElement.createPopup(\n PopupPayment,\n message as Message.message,\n await this.managers.appPaymentsManager.getInputInvoiceByPeerId(message.peerId, message.mid)\n );\n return;\n }\n\n const reactionElement = findUpTag(target, 'REACTION-ELEMENT') as ReactionElement;\n if(reactionElement) {\n cancelEvent(e);\n if(reactionElement.classList.contains('is-inactive')) {\n return;\n }\n\n const reactionsElement = reactionElement.parentElement as ReactionsElement;\n const reactionCount = reactionsElement.getReactionCount(reactionElement);\n\n const message = reactionsElement.getMessage();\n this.managers.appReactionsManager.sendReaction(message, reactionCount.reaction);\n\n return;\n }\n\n const stickerEmojiEl = findUpAttribute(target, 'data-sticker-emoji');\n if(stickerEmojiEl && stickerEmojiEl.parentElement.querySelectorAll('[data-sticker-emoji]').length === 1 && bubble.classList.contains('emoji-big')) {\n onEmojiStickerClick({\n event: e,\n container: stickerEmojiEl,\n managers: this.managers,\n middleware: this.getMiddleware(),\n peerId: this.peerId\n });\n\n return;\n }\n\n const commentsDiv: HTMLElement = findUpClassName(target, 'replies');\n if(commentsDiv) {\n const bubbleMid = +bubble.dataset.mid;\n if(this.peerId === REPLIES_PEER_ID) {\n const message = await this.chat.getMessage(bubbleMid) as Message.message;\n const peerId = getPeerId(message.reply_to.reply_to_peer_id);\n const threadId = message.reply_to.reply_to_top_id;\n const lastMsgId = message.fwd_from.saved_from_msg_id;\n this.chat.appImManager.openThread({\n peerId,\n lastMsgId,\n threadId\n });\n } else {\n const message1 = await this.chat.getMessage(bubbleMid);\n const message = await this.managers.appMessagesManager.getMessageWithReplies(message1 as Message.message);\n const replies = message.replies;\n if(replies) {\n this.managers.appMessagesManager.getDiscussionMessage(this.peerId, message.mid).then((message) => {\n this.chat.appImManager.setInnerPeer({\n peerId: replies.channel_id.toPeerId(true),\n type: 'discussion',\n threadId: (message as MyMessage).mid\n });\n });\n }\n }\n\n return;\n }\n\n const via = findUpClassName(target, 'is-via');\n if(via) {\n const el = via.querySelector('.peer-title') as HTMLElement;\n if(target === el || findUpAsChild(target, el)) {\n const message = el.innerText + ' ';\n this.managers.appDraftsManager.setDraft(this.peerId, this.chat.threadId, message);\n cancelEvent(e);\n\n return;\n }\n }\n\n const nameDiv = findUpClassName(target, 'peer-title') || findUpTag(target, 'AVATAR-ELEMENT') || findUpAttribute(target, 'data-saved-from');\n if(nameDiv && nameDiv !== bubble) {\n target = nameDiv || target;\n const peerIdStr = target.dataset.peerId || target.getAttribute('peer') || (target as AvatarElement).peerId;\n const savedFrom = target.dataset.savedFrom;\n if(typeof(peerIdStr) === 'string' || savedFrom) {\n if(savedFrom) {\n const [peerId, mid] = savedFrom.split('_');\n if(target.classList.contains('is-receipt-link')) {\n const message = await this.managers.appMessagesManager.getMessageByPeer(peerId.toPeerId(), +mid);\n if(message) {\n const inputInvoice = await this.managers.appPaymentsManager.getInputInvoiceByPeerId(this.peerId, +bubble.dataset.mid);\n PopupElement.createPopup(PopupPayment, message as Message.message, inputInvoice, undefined, true);\n }\n } else {\n this.chat.appImManager.setInnerPeer({\n peerId: peerId.toPeerId(),\n lastMsgId: +mid\n });\n }\n } else {\n const peerId = peerIdStr.toPeerId();\n if(peerId !== NULL_PEER_ID) {\n this.chat.appImManager.setInnerPeer({peerId});\n } else {\n toast(I18n.format('HidAccount', true));\n }\n }\n }\n\n return;\n }\n\n // this.log('chatInner click:', target);\n // const isVideoComponentElement = target.tagName === 'SPAN' && findUpClassName(target, 'media-container');\n /* if(isVideoComponentElement) {\n const video = target.parentElement.querySelector('video') as HTMLElement;\n if(video) {\n video.click(); // hot-fix for time and play button\n return;\n }\n } */\n\n if(bubble.classList.contains('sticker') && target.parentElement.classList.contains('attachment')) {\n const messageId = +bubble.dataset.mid;\n const message = await this.chat.getMessage(messageId);\n\n const doc = ((message as Message.message).media as MessageMedia.messageMediaDocument)?.document as Document.document;\n\n if(doc?.stickerSetInput) {\n PopupElement.createPopup(PopupStickers, doc.stickerSetInput).show();\n }\n\n return;\n }\n\n if(await this.checkTargetForMediaViewer(target, e)) {\n return;\n }\n\n if(['IMG', 'DIV', 'SPAN'/* , 'A' */].indexOf(target.tagName) === -1) target = findUpTag(target, 'DIV');\n\n if(['DIV', 'SPAN'].indexOf(target.tagName) !== -1/* || target.tagName === 'A' */) {\n if(target.classList.contains('goto-original')) {\n const savedFrom = bubble.dataset.savedFrom;\n const [peerId, mid] = savedFrom.split('_');\n // //this.log('savedFrom', peerId, msgID);\n this.chat.appImManager.setInnerPeer({\n peerId: peerId.toPeerId(),\n lastMsgId: +mid\n });\n return;\n } else if(target.classList.contains('forward')) {\n const mid = +bubble.dataset.mid;\n const message = await this.managers.appMessagesManager.getMessageByPeer(this.peerId, mid);\n PopupElement.createPopup(PopupForward, {\n [this.peerId]: await this.managers.appMessagesManager.getMidsByMessage(message)\n });\n // appSidebarRight.forwardTab.open([mid]);\n return;\n }\n\n let isReplyClick = false;\n\n try {\n isReplyClick = !!findUpClassName(e.target, 'reply');\n } catch(err) {}\n\n if(isReplyClick && bubble.classList.contains('is-reply')/* || bubble.classList.contains('forwarded') */) {\n const bubbleMid = +bubble.dataset.mid;\n this.followStack.push(bubbleMid);\n\n const message = (await this.chat.getMessage(bubbleMid)) as Message.message;\n\n const replyToPeerId = message.reply_to.reply_to_peer_id ? getPeerId(message.reply_to.reply_to_peer_id) : this.peerId;\n const replyToMid = message.reply_to.reply_to_msg_id;\n\n this.chat.appImManager.setInnerPeer({\n peerId: replyToPeerId,\n lastMsgId: replyToMid,\n type: this.chat.type,\n threadId: this.chat.threadId\n });\n\n /* if(this.chat.type === 'discussion') {\n this.chat.appImManager.setMessageId(, originalMessageId);\n } else {\n this.chat.appImManager.setInnerPeer(this.peerId, originalMessageId);\n } */\n // this.chat.setMessageId(, originalMessageId);\n }\n }\n\n // console.log('chatInner click', e);\n };\n\n public async checkTargetForMediaViewer(target: HTMLElement, e?: Event, mediaTimestamp?: number) {\n const bubble = findUpClassName(target, 'bubble');\n const documentDiv = findUpClassName(target, 'document-with-thumb');\n if((target.tagName === 'IMG' && !target.classList.contains('emoji') && !target.classList.contains('document-thumb')) ||\n target.classList.contains('album-item') ||\n // || isVideoComponentElement\n (target.tagName === 'VIDEO' && !bubble.classList.contains('round')) ||\n (documentDiv && !documentDiv.querySelector('.preloader-container')) ||\n target.classList.contains('canvas-thumbnail')) {\n const groupedItem = findUpClassName(target, 'album-item') || findUpClassName(target, 'document-container');\n const preloader = (groupedItem || bubble).querySelector('.preloader-container');\n if(preloader && e) {\n simulateClickEvent(preloader);\n cancelEvent(e);\n return;\n }\n\n cancelEvent(e);\n const messageId = +(groupedItem || bubble).dataset.mid;\n const message = await this.chat.getMessage(messageId);\n if(!message) {\n this.log.warn('no message by messageId:', messageId);\n return;\n }\n\n const SINGLE_MEDIA_CLASSNAME = 'webpage';\n const isSingleMedia = bubble.classList.contains(SINGLE_MEDIA_CLASSNAME);\n\n const f = documentDiv ? (media: any) => {\n return AppMediaViewer.isMediaCompatibleForDocumentViewer(media);\n } : (media: any) => {\n return media._ === 'photo' || ['video', 'gif'].includes(media.type);\n };\n\n const targets: {element: HTMLElement, mid: number, peerId: PeerId}[] = [];\n const ids = isSingleMedia ? [messageId] : (await Promise.all(Object.keys(this.bubbles).map((k) => +k).map(async(mid) => {\n /* if(isSingleMedia && !this.bubbles[id].classList.contains(SINGLE_MEDIA_CLASSNAME)) {\n return false;\n } */\n // if(!this.scrollable.visibleElements.find((e) => e.element === this.bubbles[id])) return false;\n\n const message = await this.chat.getMessage(mid);\n const media = getMediaFromMessage(message);\n\n return media && f(media) && mid;\n }))).filter(Boolean).sort((a, b) => a - b);\n\n ids.forEach((id) => {\n let selector: string;\n if(documentDiv) {\n selector = '.document-container';\n } else {\n const withTail = this.bubbles[id].classList.contains('with-media-tail');\n selector = '.album-item video, .album-item img, .preview video, .preview img, ';\n if(withTail) {\n selector += '.bubble__media-container';\n } else {\n selector += '.attachment video, .attachment img';\n }\n }\n\n const elements = Array.from(this.bubbles[id].querySelectorAll(selector)) as HTMLElement[];\n const parents: Set = new Set();\n if(documentDiv) {\n elements.forEach((element) => {\n targets.push({\n element: element.querySelector('.document-ico'),\n mid: +element.dataset.mid,\n peerId: this.peerId\n });\n });\n } else {\n const hasAspecter = !!this.bubbles[id].querySelector('.media-container-aspecter');\n elements.forEach((element) => {\n if(hasAspecter && !findUpClassName(element, 'media-container-aspecter')) return;\n const albumItem = findUpClassName(element, 'album-item');\n const parent = albumItem || element.parentElement;\n if(parents.has(parent)) return;\n parents.add(parent);\n targets.push({\n element,\n mid: albumItem ? +albumItem.dataset.mid : id,\n peerId: this.peerId\n });\n });\n }\n });\n\n targets.sort((a, b) => a.mid - b.mid);\n\n const idx = targets.findIndex((t) => t.mid === messageId);\n\n if(DEBUG) {\n this.log('open mediaViewer single with ids:', ids, idx, targets);\n }\n\n if(!targets[idx]) {\n this.log('no target for media viewer!', target);\n return;\n }\n\n new AppMediaViewer()\n .setSearchContext({\n threadId: this.chat.threadId,\n peerId: this.peerId,\n inputFilter: {_: documentDiv ? 'inputMessagesFilterDocument' : 'inputMessagesFilterPhotoVideo'},\n useSearch: this.chat.type !== 'scheduled' && !isSingleMedia,\n isScheduled: this.chat.type === 'scheduled'\n })\n .openMedia({\n message: message,\n target: targets[idx].element,\n fromRight: 0,\n reverse: true,\n prevTargets: targets.slice(0, idx),\n nextTargets: targets.slice(idx + 1),\n mediaTimestamp\n });\n return true;\n }\n }\n\n public async onGoDownClick() {\n if(!this.followStack.length) {\n // this.onScroll(true, undefined, true);\n this.chat.setMessageId(/* , dialog.top_message */);\n // const dialog = this.appMessagesManager.getDialogByPeerId(this.peerId)[0];\n\n // if(dialog) {\n // this.chat.setPeer(this.peerId/* , dialog.top_message */);\n // } else {\n // this.log('will scroll down 3');\n // this.scroll.scrollTop = this.scroll.scrollHeight;\n // }\n\n return;\n }\n\n const middleware = this.getMiddleware();\n const slice = this.followStack.slice();\n const messages = await Promise.all(slice.map((mid) => this.chat.getMessage(mid)));\n if(!middleware()) return;\n\n slice.forEach((mid, idx) => {\n const message = messages[idx];\n\n const bubble = this.bubbles[mid];\n let bad = true;\n if(bubble) {\n const rect = bubble.getBoundingClientRect();\n bad = (windowSize.height / 2) > rect.top;\n } else if(message) {\n bad = false;\n }\n\n if(bad) {\n this.followStack.splice(this.followStack.indexOf(mid), 1);\n }\n });\n\n this.followStack.sort((a, b) => b - a);\n\n const mid = this.followStack.pop();\n this.chat.setMessageId(mid);\n }\n\n public getBubbleByPoint(verticalSide: 'top' | 'bottom') {\n const slice = this.getViewportSlice();\n const item = slice.visible[verticalSide === 'top' ? 0 : slice.visible.length - 1];\n return item?.element;\n }\n\n public async getGroupedBubble(groupId: string) {\n const mids = await this.managers.appMessagesManager.getMidsByAlbum(groupId);\n for(const mid of mids) {\n if(this.bubbles[mid] && !this.skippedMids.has(mid)) {\n // const maxId = Math.max(...mids); // * because in scheduled album can be rendered by lowest mid during sending\n return {\n bubble: this.bubbles[mid],\n mid: mid\n // message: await this.chat.getMessage(maxId) as Message.message\n };\n }\n }\n }\n\n public getBubbleGroupedItems(bubble: HTMLElement) {\n return Array.from(bubble.querySelectorAll('.grouped-item')) as HTMLElement[];\n }\n\n public async getMountedBubble(mid: number, message?: Message.message | Message.messageService) {\n if(message === undefined) {\n message = await this.chat.getMessage(mid);\n }\n\n if(!message) {\n return;\n }\n\n const groupedId = (message as Message.message).grouped_id;\n if(groupedId) {\n const a = await this.getGroupedBubble(groupedId);\n if(a) {\n a.bubble = a.bubble.querySelector(`.document-container[data-mid=\"${mid}\"]`) || a.bubble;\n return a;\n }\n }\n\n const bubble = this.bubbles[mid];\n if(!bubble || this.skippedMids.has(mid)) return;\n\n return {bubble, mid};\n }\n\n private findNextMountedBubbleByMsgId(mid: number, prev?: boolean) {\n const mids = getObjectKeysAndSort(this.bubbles, prev ? 'desc' : 'asc');\n\n let filterCallback: (_mid: number) => boolean;\n if(prev) filterCallback = (_mid) => _mid < mid;\n else filterCallback = (_mid) => mid < _mid;\n\n const foundMid = mids.find((_mid) => {\n if(!filterCallback(_mid)) return false;\n return !!this.bubbles[_mid]?.parentElement;\n });\n\n return this.bubbles[foundMid];\n }\n\n public loadMoreHistory(top: boolean, justLoad = false) {\n // this.log('loadMoreHistory', top);\n if(\n !this.peerId ||\n /* TEST_SCROLL || */\n this.chat.setPeerPromise ||\n this.isHeavyAnimationInProgress ||\n (top && (this.getHistoryTopPromise || this.scrollable.loadedAll.top)) ||\n (!top && (this.getHistoryBottomPromise || this.scrollable.loadedAll.bottom))\n ) {\n return;\n }\n\n // warning, если иды только отрицательные то вниз не попадёт (хотя мб и так не попадёт)\n // some messages can have negative id (such as sponsored message)\n const history = Object.keys(this.bubbles)\n .map((id) => +id)\n .filter((id) => id > 0 && !this.skippedMids.has(id))\n .sort((a, b) => a - b);\n\n if(!history.length) {\n history.push(0);\n }\n\n if(top) {\n if(DEBUG) {\n this.log('Will load more (up) history by id:', history[0], 'maxId:', history[history.length - 1], justLoad/* , history */);\n }\n\n this.getHistory1(history[0], true, undefined, undefined, justLoad);\n } else {\n // let dialog = this.appMessagesManager.getDialogByPeerId(this.peerId)[0];\n // const historyMaxId = await this.chat.getHistoryMaxId();\n\n // // if scroll down after search\n // if(history.indexOf(historyMaxId) !== -1) {\n // this.setLoaded('bottom', true);\n // return;\n // }\n\n if(DEBUG) {\n this.log('Will load more (down) history by id:', history[history.length - 1], justLoad/* , history */);\n }\n\n this.getHistory1(history[history.length - 1], false, true, undefined, justLoad);\n }\n }\n\n public onScroll = (ignoreHeavyAnimation?: boolean, scrollDimensions?: ScrollStartCallbackDimensions, forceDown?: boolean) => {\n // return;\n\n if(this.isHeavyAnimationInProgress) {\n this.sliceViewportDebounced?.clearTimeout();\n\n // * В таком случае, кнопка не будет моргать если чат в самом низу, и правильно отработает случай написания нового сообщения и проскролла вниз\n if(this.scrolledDown && !ignoreHeavyAnimation) {\n return;\n }\n } else {\n this.chat.topbar.pinnedMessage?.setCorrectIndexThrottled(this.scrollable.lastScrollDirection);\n this.sliceViewportDebounced?.();\n this.setStickyDateManually();\n }\n\n // lottieLoader.checkAnimations(false, 'chat');\n\n if(scrollDimensions && scrollDimensions.distanceToEnd < SCROLLED_DOWN_THRESHOLD && this.scrolledDown) {\n return;\n }\n\n const distanceToEnd = forceDown ? 0 : scrollDimensions?.distanceToEnd ?? this.scrollable.getDistanceToEnd();\n if(/* !IS_TOUCH_SUPPORTED && */(this.scrollable.lastScrollDirection !== 0 && distanceToEnd > 0) || scrollDimensions || forceDown) {\n // if(/* !IS_TOUCH_SUPPORTED && */(this.scrollable.lastScrollDirection !== 0 || scrollDimensions) && distanceToEnd > 0) {\n if(this.isScrollingTimeout) {\n clearTimeout(this.isScrollingTimeout);\n } else if(!this.chatInner.classList.contains('is-scrolling')) {\n this.chatInner.classList.add('is-scrolling');\n }\n\n this.isScrollingTimeout = window.setTimeout(() => {\n this.chatInner.classList.remove('is-scrolling');\n this.isScrollingTimeout = 0;\n }, 1350 + (scrollDimensions?.duration ?? 0));\n }\n\n if(distanceToEnd < SCROLLED_DOWN_THRESHOLD && (forceDown || this.scrollable.loadedAll.bottom || this.chat.setPeerPromise || !this.peerId)) {\n this.container.classList.add('scrolled-down');\n this.scrolledDown = true;\n } else if(this.container.classList.contains('scrolled-down')) {\n this.container.classList.remove('scrolled-down');\n this.scrolledDown = false;\n }\n };\n\n public setScroll() {\n if(this.scrollable) {\n this.destroyScrollable();\n }\n\n this.scrollable = new Scrollable(null, 'IM', /* 10300 */300);\n this.setLoaded('top', false, false);\n this.setLoaded('bottom', false, false);\n\n this.scrollable.container.append(this.chatInner);\n\n /* const getScrollOffset = () => {\n //return Math.round(Math.max(300, appPhotosManager.windowH / 1.5));\n return 300;\n };\n\n window.addEventListener('resize', () => {\n this.scrollable.onScrollOffset = getScrollOffset();\n });\n\n this.scrollable = new Scrollable(this.bubblesContainer, 'y', 'IM', this.chatInner, getScrollOffset()); */\n\n this.scrollable.onAdditionalScroll = this.onScroll;\n this.scrollable.onScrolledTop = () => this.loadMoreHistory(true);\n this.scrollable.onScrolledBottom = () => this.loadMoreHistory(false);\n // this.scrollable.attachSentinels(undefined, 300);\n\n if(IS_TOUCH_SUPPORTED && false) {\n this.scrollable.container.addEventListener('touchmove', () => {\n if(this.isScrollingTimeout) {\n clearTimeout(this.isScrollingTimeout);\n } else if(!this.chatInner.classList.contains('is-scrolling')) {\n this.chatInner.classList.add('is-scrolling');\n }\n }, {passive: true});\n\n this.scrollable.container.addEventListener('touchend', () => {\n if(!this.chatInner.classList.contains('is-scrolling')) {\n return;\n }\n\n if(this.isScrollingTimeout) {\n clearTimeout(this.isScrollingTimeout);\n }\n\n this.isScrollingTimeout = window.setTimeout(() => {\n this.chatInner.classList.remove('is-scrolling');\n this.isScrollingTimeout = 0;\n }, 1350);\n }, {passive: true});\n }\n }\n\n public async updateUnreadByDialog() {\n const historyStorage = await this.chat.getHistoryStorage();\n const maxId = this.peerId === rootScope.myId ? historyStorage.readMaxId : historyStorage.readOutboxMaxId;\n\n // /////this.log('updateUnreadByDialog', maxId, dialog, this.unreadOut);\n\n for(const msgId of this.unreadOut) {\n if(msgId > 0 && msgId <= maxId) {\n const bubble = this.bubbles[msgId];\n if(bubble) {\n this.unreadOut.delete(msgId);\n\n if(bubble.classList.contains('is-outgoing') || bubble.classList.contains('is-error')) {\n continue;\n }\n\n bubble.classList.remove('is-sent', 'is-sending', 'is-outgoing'); // is-sending can be when there are bulk of updates (e.g. sending command to Stickers bot)\n bubble.classList.add('is-read');\n }\n }\n }\n }\n\n public destroyBubble(bubble: HTMLElement, mid = +bubble.dataset.mid) {\n // this.log.warn('destroy bubble', bubble, mid);\n bubble.middlewareHelper.destroy();\n\n /* const mounted = this.getMountedBubble(mid);\n if(!mounted) return; */\n\n if(this.bubbles[mid] === bubble) { // have to check because can clear bubble with same id later\n delete this.bubbles[mid];\n }\n\n this.skippedMids.delete(mid);\n\n if(this.firstUnreadBubble === bubble) {\n this.firstUnreadBubble = null;\n }\n\n this.bubbleGroups.removeAndUnmountBubble(bubble);\n if(this.observer) {\n this.observer.unobserve(bubble, this.unreadedObserverCallback);\n this.unreaded.delete(bubble);\n\n this.observer.unobserve(bubble, this.viewsObserverCallback);\n this.viewsMids.delete(mid);\n\n this.observer.unobserve(bubble, this.stickerEffectObserverCallback);\n }\n\n // this.reactions.delete(mid);\n }\n\n public deleteMessagesByIds(mids: number[], permanent = true, ignoreOnScroll?: boolean) {\n let deleted = false;\n mids.forEach((mid) => {\n const bubble = this.bubbles[mid];\n if(!bubble) return;\n\n this.destroyBubble(bubble, mid);\n\n deleted = true;\n });\n\n if(!deleted) {\n return;\n }\n\n this.scrollable.ignoreNextScrollEvent();\n if(permanent && this.chat.selection.isSelecting) {\n this.chat.selection.deleteSelectedMids(this.peerId, mids);\n }\n\n animationIntersector.checkAnimations(false, this.chat.animationGroup);\n this.deleteEmptyDateGroups();\n\n if(!ignoreOnScroll) {\n this.scrollable.onScroll();\n // this.onScroll();\n }\n }\n\n private pollExtendedMediaMessages() {\n const mids = Array.from(this.extendedMediaMessages);\n return this.managers.appMessagesManager.getExtendedMedia(this.peerId, mids);\n }\n\n private setExtendedMediaMessagesPollInterval() {\n if(this.pollExtendedMediaMessagesPromise || !this.extendedMediaMessages.size) {\n return;\n }\n\n this.pollExtendedMediaMessagesPromise = pause(30000)\n .then(() => this.pollExtendedMediaMessages())\n .then(() => this.setExtendedMediaMessagesPollInterval());\n }\n\n private setTopPadding(middleware = this.getMiddleware()) {\n let isPaddingNeeded = false;\n let setPaddingTo: HTMLElement;\n if(!this.isTopPaddingSet && this.chat.type !== 'scheduled') {\n const {clientHeight, scrollHeight} = this.scrollable.container;\n isPaddingNeeded = clientHeight === scrollHeight;\n /* const firstEl = this.chatInner.firstElementChild as HTMLElement;\n if(this.chatInner.firstElementChild) {\n const visibleRect = getVisibleRect(firstEl, this.scrollable.container);\n isPaddingNeeded = !visibleRect.overflow.top && (visibleRect.rect.top - firstEl.offsetTop) !== this.scrollable.container.getBoundingClientRect().top;\n } else {\n isPaddingNeeded = true;\n } */\n\n if(isPaddingNeeded) {\n /* const add = clientHeight - scrollHeight;\n this.chatInner.style.paddingTop = add + 'px';\n this.scrollable.scrollTop += add; */\n setPaddingTo = this.chatInner;\n setPaddingTo.style.paddingTop = clientHeight + 'px';\n this.scrollable.setScrollTopSilently(scrollHeight);\n this.isTopPaddingSet = true;\n }\n }\n\n return {\n isPaddingNeeded,\n unsetPadding: isPaddingNeeded ? () => {\n if(middleware() && isPaddingNeeded) {\n setPaddingTo.style.paddingTop = '';\n this.isTopPaddingSet = false;\n }\n } : undefined\n };\n }\n\n private renderNewMessage(message: MyMessage, scrolledDown?: boolean) {\n const promise = this._renderNewMessage(message, scrolledDown);\n this.renderNewPromises.add(promise);\n promise.catch(noop).finally(() => {\n this.renderNewPromises.delete(promise);\n });\n return promise;\n }\n\n private async _renderNewMessage(message: MyMessage, scrolledDown?: boolean) {\n if(!this.scrollable.loadedAll.bottom) { // seems search active or sliced\n // this.log('renderNewMessagesByIds: seems search is active, skipping render:', mids);\n const setPeerPromise = this.chat.setPeerPromise;\n if(setPeerPromise) {\n const middleware = this.getMiddleware();\n setPeerPromise.then(async() => {\n if(!middleware()) return;\n const newMessage = await this.chat.getMessage(message.mid);\n if(!middleware()) return;\n this.renderNewMessage(newMessage);\n });\n }\n\n return;\n }\n\n if(this.chat.threadId && getMessageThreadId(message, this.chat.isForum) !== this.chat.threadId) {\n return;\n }\n\n if(this.bubbles[message.mid]) {\n return;\n }\n // ! should scroll even without new messages\n /* if(!mids.length) {\n return;\n } */\n\n if(!scrolledDown) {\n scrolledDown = this.scrolledDown && (\n !this.scrollingToBubble ||\n this.scrollingToBubble === this.getLastBubble() ||\n this.scrollingToBubble === this.chatInner\n );\n }\n\n const middleware = this.getMiddleware();\n const {isPaddingNeeded, unsetPadding} = this.setTopPadding(middleware);\n\n const promise = this.performHistoryResult({history: [message]}, false);\n if(scrolledDown) {\n promise.then(() => {\n if(!middleware()) return;\n // this.log('renderNewMessagesByIDs: messagesQueuePromise after', this.scrollable.isScrolledDown);\n // this.scrollable.scrollTo(this.scrollable.scrollHeight, 'top', true, true, 5000);\n // const bubble = this.bubbles[Math.max(...mids)];\n\n let bubble: HTMLElement;\n if(this.chat.type === 'scheduled') {\n bubble = this.bubbles[message.mid];\n }\n\n const promise = bubble ? this.scrollToBubbleEnd(bubble) : this.scrollToEnd();\n if(isPaddingNeeded) {\n // it will be called only once even if was set multiple times (that won't happen)\n promise.then(unsetPadding);\n }\n\n // this.scrollable.scrollIntoViewNew(this.chatInner, 'end');\n\n /* setTimeout(() => {\n this.log('messagesQueuePromise afterafter:', this.chatInner.childElementCount, this.scrollable.scrollHeight);\n }, 10); */\n });\n }\n\n return promise;\n }\n\n public getLastBubble() {\n const group = this.bubbleGroups.getLastGroup();\n return group?.lastItem?.bubble;\n }\n\n public scrollToBubble(\n element: HTMLElement,\n position: ScrollLogicalPosition,\n forceDirection?: FocusDirection,\n forceDuration?: number\n ) {\n const bubble = findUpClassName(element, 'bubble');\n\n if(!element.parentElement) {\n this.log.error('element is not connected', bubble);\n }\n\n let fallbackToElementStartWhenCentering: HTMLElement;\n // * if it's a start, then scroll to start of the group\n if(bubble && position !== 'end') {\n const item = this.bubbleGroups.getItemByBubble(bubble);\n if(item && item.group.firstItem === item && whichChild(item.group.container) === (this.stickyIntersector ? STICKY_OFFSET : 1)) {\n const dateGroup = item.group.container.parentElement;\n // if(whichChild(dateGroup) === 0) {\n fallbackToElementStartWhenCentering = dateGroup;\n // position = 'start';\n // element = dateGroup;\n // }\n }\n }\n\n // const isLastBubble = this.getLastBubble() === bubble;\n /* if(isLastBubble) {\n element = this.getLastDateGroup();\n } */\n\n const margin = 4; // * 4 = .25rem\n /* if(isLastBubble && this.chat.type === 'chat' && this.bubblesContainer.classList.contains('is-chat-input-hidden')) {\n margin = 20;\n } */\n\n const isChangingHeight = (this.chat.input.messageInput && this.chat.input.messageInput.classList.contains('is-changing-height')) || this.chat.container.classList.contains('is-toggling-helper');\n const promise = this.scrollable.scrollIntoViewNew({\n element,\n position,\n margin,\n forceDirection,\n forceDuration,\n axis: 'y',\n getNormalSize: isChangingHeight ? ({rect}) => {\n // return rect.height;\n\n let height = windowSize.height;\n // height -= this.chat.topbar.container.getBoundingClientRect().height;\n height -= this.container.offsetTop;\n height -= mediaSizes.isMobile || windowSize.height < 570 ? 58 : 78;\n return height;\n\n /* const rowsWrapperHeight = this.chat.input.rowsWrapper.getBoundingClientRect().height;\n const diff = rowsWrapperHeight - 54;\n return rect.height + diff; */\n } : undefined,\n fallbackToElementStartWhenCentering,\n startCallback: (dimensions) => {\n // this.onScroll(true, this.scrolledDown && dimensions.distanceToEnd <= SCROLLED_DOWN_THRESHOLD ? undefined : dimensions);\n this.onScroll(true, dimensions);\n\n if(this.updateGradient) {\n const {gradientRenderer} = this.chat;\n gradientRenderer?.toNextPosition(dimensions.getProgress);\n this.updateGradient = undefined;\n }\n }\n });\n\n // fix flickering date when opening unread chat and focusing message\n if(forceDirection === FocusDirection.Static) {\n this.scrollable.lastScrollPosition = this.scrollable.scrollTop;\n }\n\n return promise;\n }\n\n public scrollToEnd() {\n return this.scrollToBubbleEnd(this.chatInner);\n }\n\n public async scrollToBubbleEnd(bubble: HTMLElement) {\n /* if(DEBUG) {\n this.log('scrollToNewLastBubble: will scroll into view:', bubble);\n } */\n\n if(bubble) {\n this.scrollingToBubble = bubble;\n const middleware = this.getMiddleware();\n await this.scrollToBubble(bubble, 'end', undefined, undefined);\n if(!middleware()) return;\n this.scrollingToBubble = undefined;\n }\n }\n\n // ! can't get it by chatInner.lastElementChild because placeholder can be the last...\n // private getLastDateGroup() {\n // let lastTime = 0, lastElem: HTMLElement;\n // for(const i in this.dateMessages) {\n // const dateMessage = this.dateMessages[i];\n // if(dateMessage.firstTimestamp > lastTime) {\n // lastElem = dateMessage.container;\n // lastTime = dateMessage.firstTimestamp;\n // }\n // }\n\n // return lastElem;\n // }\n\n public async scrollToBubbleIfLast(bubble: HTMLElement) {\n if(this.getLastBubble() === bubble) {\n // return this.scrollToBubbleEnd(bubble);\n return this.scrollToEnd();\n }\n }\n\n public highlightBubble(element: HTMLElement) {\n const datasetKey = 'highlightTimeout';\n if(element.dataset[datasetKey]) {\n clearTimeout(+element.dataset[datasetKey]);\n element.classList.remove('is-highlighted');\n void element.offsetWidth; // reflow\n }\n\n element.classList.add('is-highlighted');\n element.dataset[datasetKey] = '' + setTimeout(() => {\n element.classList.remove('is-highlighted');\n delete element.dataset[datasetKey];\n }, 2000);\n }\n\n private createDateBubble(timestamp: number, date: Date = new Date(timestamp * 1000)) {\n let dateElement: HTMLElement;\n\n const today = new Date();\n today.setHours(0, 0, 0, 0);\n\n const isScheduled = this.chat.type === 'scheduled';\n\n if(today.getTime() === date.getTime()) {\n dateElement = i18n(isScheduled ? 'Chat.Date.ScheduledForToday' : 'Date.Today');\n } else if(isScheduled && timestamp === SEND_WHEN_ONLINE_TIMESTAMP) {\n dateElement = i18n('MessageScheduledUntilOnline');\n } else {\n const options: Intl.DateTimeFormatOptions = {\n day: 'numeric',\n month: 'long'\n };\n\n if(date.getFullYear() !== today.getFullYear()) {\n options.year = 'numeric';\n }\n\n dateElement = new I18n.IntlDateElement({\n date,\n options\n }).element;\n\n if(isScheduled) {\n dateElement = i18n('Chat.Date.ScheduledFor', [dateElement]);\n }\n }\n\n const bubble = document.createElement('div');\n bubble.className = 'bubble service is-date';\n const bubbleContent = document.createElement('div');\n bubbleContent.classList.add('bubble-content');\n const serviceMsg = document.createElement('div');\n serviceMsg.classList.add('service-msg');\n\n serviceMsg.append(dateElement);\n\n bubbleContent.append(serviceMsg);\n bubble.append(bubbleContent);\n\n return bubble;\n }\n\n public getDateForDateContainer(timestamp: number) {\n const date = new Date(timestamp * 1000);\n date.setHours(0, 0, 0);\n return {date, dateTimestamp: date.getTime()};\n }\n\n public getDateContainerByTimestamp(timestamp: number) {\n const {date, dateTimestamp} = this.getDateForDateContainer(timestamp);\n let ret = this.dateMessages[dateTimestamp];\n if(ret) {\n return ret;\n }\n\n const bubble = this.createDateBubble(timestamp, date);\n // bubble.classList.add('is-sticky');\n const fakeBubble = this.createDateBubble(timestamp, date);\n fakeBubble.classList.add('is-fake');\n\n const container = document.createElement('section');\n container.className = 'bubbles-date-group';\n container.append(bubble, fakeBubble);\n\n ret = this.dateMessages[dateTimestamp] = {\n div: bubble,\n container,\n firstTimestamp: date.getTime()\n };\n\n const haveTimestamps = getObjectKeysAndSort(this.dateMessages, 'asc');\n const length = haveTimestamps.length;\n let i = 0, insertBefore: HTMLElement; // there can be 'first bubble' (e.g. bot description) so can't insert by index\n for(; i < haveTimestamps.length; ++i) {\n const t = haveTimestamps[i];\n insertBefore = this.dateMessages[t].container;\n if(dateTimestamp < t) {\n break;\n }\n }\n\n if(i === length && insertBefore) {\n insertBefore = insertBefore.nextElementSibling as HTMLElement;\n }\n\n if(!insertBefore) {\n this.chatInner.append(container);\n } else {\n this.chatInner.insertBefore(container, insertBefore);\n }\n\n this.stickyIntersector?.observeStickyHeaderChanges(container);\n\n if(this.chatInner.parentElement) {\n this.container.classList.add('has-groups');\n }\n\n return ret;\n }\n\n private destroyScrollable() {\n this.scrollable.destroy();\n }\n\n public destroy() {\n // this.chat.log.error('Bubbles destroying');\n\n this.destroyScrollable();\n\n this.listenerSetter.removeAll();\n\n this.lazyLoadQueue.clear();\n this.observer && this.observer.disconnect();\n this.stickyIntersector && this.stickyIntersector.disconnect();\n\n delete this.lazyLoadQueue;\n this.observer && delete this.observer;\n this.stickyIntersector && delete this.stickyIntersector;\n }\n\n public cleanup(bubblesToo = false) {\n this.log('cleanup');\n\n this.bubbles = {}; // clean it before so sponsored message won't be deleted faster on peer changing\n // //console.time('appImManager cleanup');\n this.setLoaded('top', false, false);\n this.setLoaded('bottom', false, false);\n\n // cancel scroll\n cancelAnimationByKey(this.scrollable.container);\n\n // do not wait ending of previous scale animation\n interruptHeavyAnimation();\n\n if(TEST_SCROLL !== undefined) {\n TEST_SCROLL = TEST_SCROLL_TIMES;\n }\n\n this.skippedMids.clear();\n this.dateMessages = {};\n this.bubbleGroups.cleanup();\n this.unreadOut.clear();\n this.needUpdate.length = 0;\n this.lazyLoadQueue.clear();\n this.renderNewPromises.clear();\n\n // clear messages\n if(bubblesToo) {\n this.scrollable.container.textContent = '';\n this.chatInner.textContent = '';\n this.cleanupPlaceholders();\n }\n\n this.firstUnreadBubble = null;\n this.attachedUnreadBubble = false;\n\n this.batchProcessor.clear();\n\n this.getHistoryTopPromise = this.getHistoryBottomPromise = undefined;\n this.fetchNewPromise = undefined;\n this.getSponsoredMessagePromise = undefined;\n this.updateGradient = undefined;\n\n if(this.stickyIntersector) {\n this.stickyIntersector.disconnect();\n }\n\n if(this.observer) {\n this.observer.disconnect();\n\n this.unreaded.clear();\n this.unreadedSeen.clear();\n this.readPromise = undefined;\n\n this.viewsMids.clear();\n }\n\n this.middlewareHelper.clean();\n\n this.onAnimateLadder = undefined;\n this.resolveLadderAnimation = undefined;\n this.attachPlaceholderOnRender = undefined;\n this.emptyPlaceholderBubble = undefined;\n this.sponsoredMessage = undefined;\n this.previousStickyDate = undefined;\n\n this.scrollingToBubble = undefined;\n // //console.timeEnd('appImManager cleanup');\n\n this.isTopPaddingSet = false;\n\n this.renderingMessages.clear();\n this.bubblesToEject.clear();\n this.bubblesToReplace.clear();\n\n // this.reactions.clear();\n\n if(this.isScrollingTimeout) {\n clearTimeout(this.isScrollingTimeout);\n this.isScrollingTimeout = 0;\n }\n\n this.container.classList.remove('has-sticky-dates');\n this.scrollable.cancelMeasure();\n }\n\n private cleanupPlaceholders(bubble = this.emptyPlaceholderBubble) {\n if(bubble) {\n this.destroyBubble(bubble);\n }\n }\n\n public async setPeer(options: ChatSetPeerOptions & {samePeer: boolean}): Promise<{cached?: boolean, promise: Chat['setPeerPromise']}> {\n const {samePeer, peerId, stack} = options;\n let {lastMsgId, startParam} = options;\n const tempId = ++this.setPeerTempId;\n\n if(!peerId) {\n this.cleanup(true);\n this.preloader.detach();\n return null;\n }\n\n const perf = performance.now();\n const log = this.log.bindPrefix('setPeer');\n log.warn('start');\n\n const middleware = () => {\n return this.setPeerTempId === tempId;\n };\n\n const m = middlewarePromise(middleware, PEER_CHANGED_ERROR);\n\n if(!samePeer) {\n await m(this.chat.onChangePeer(options, m));\n }\n\n /* if(samePeer && this.chat.setPeerPromise) {\n return {cached: true, promise: this.chat.setPeerPromise};\n } */\n\n const chatType = this.chat.type;\n\n if(chatType === 'scheduled' || this.chat.isRestricted) {\n lastMsgId = 0;\n }\n\n const historyStorage = await m(this.chat.getHistoryStorage());\n const topMessage = chatType === 'pinned' ? await m(this.managers.appMessagesManager.getPinnedMessagesMaxId(peerId, this.chat.threadId)) : historyStorage.maxId ?? 0;\n const isTarget = lastMsgId !== undefined;\n\n // * this one will fix topMessage for null message in history (e.g. channel comments with only 1 comment and it is a topMessage)\n /* if(chatType !== 'pinned' && topMessage && !historyStorage.history.slice.includes(topMessage)) {\n topMessage = 0;\n } */\n\n let followingUnread: boolean;\n let readMaxId = 0, savedPosition: ReturnType, overrideAdditionMsgId: number;\n if(!isTarget) {\n if(!samePeer) {\n savedPosition = this.chat.appImManager.getChatSavedPosition(this.chat);\n }\n\n if(savedPosition) {\n\n } else if(topMessage) {\n readMaxId = await m(this.managers.appMessagesManager.getReadMaxIdIfUnread(peerId, this.chat.threadId));\n const dialog = await m(this.chat.getDialogOrTopic());\n if(/* dialog.unread_count */readMaxId && !samePeer && (!dialog || dialog.unread_count !== 1)) {\n const foundSlice = historyStorage.history.findSliceOffset(readMaxId);\n if(foundSlice && foundSlice.slice.isEnd(SliceEnd.Bottom)) {\n overrideAdditionMsgId = foundSlice.slice[foundSlice.offset - 25] || foundSlice.slice[0] || readMaxId;\n }\n\n followingUnread = !isTarget;\n lastMsgId = readMaxId;\n } else {\n lastMsgId = topMessage;\n // lastMsgID = topMessage;\n }\n }\n }\n\n const isJump = lastMsgId !== topMessage/* && overrideAdditionMsgId === undefined */;\n\n if(startParam === undefined && await m(this.chat.isStartButtonNeeded())) {\n startParam = BOT_START_PARAM;\n }\n\n if(samePeer) {\n if(stack && lastMsgId) {\n this.followStack.push(stack);\n }\n\n const mounted = await m(this.getMountedBubble(lastMsgId));\n if(mounted) {\n if(isTarget) {\n this.scrollToBubble(mounted.bubble, 'center');\n this.highlightBubble(mounted.bubble);\n this.chat.dispatchEvent('setPeer', lastMsgId, false);\n } else if(topMessage && !isJump) {\n // log('will scroll down', this.scroll.scrollTop, this.scroll.scrollHeight);\n // scrollable.setScrollTopSilently(scrollable.scrollHeight);\n this.scrollToEnd();\n this.chat.dispatchEvent('setPeer', lastMsgId, true);\n }\n\n if(startParam !== undefined) {\n this.chat.input.setStartParam(startParam);\n }\n\n if(options.mediaTimestamp) {\n getHeavyAnimationPromise().then(() => {\n this.playMediaWithTimestampAndMid({\n lastMsgId,\n middleware,\n mediaTimestamp: options.mediaTimestamp\n });\n });\n }\n\n return null;\n }\n } else {\n if(this.peerId) { // * set new queue id if new peer (setting not from 0)\n this.lazyLoadQueue.queueId = ++queueId;\n this.managers.apiFileManager.setQueueId(this.chat.bubbles.lazyLoadQueue.queueId);\n }\n\n this.followStack.length = 0;\n\n this.passEntities = {\n messageEntityBotCommand: await m(this.managers.appPeersManager.isAnyGroup(peerId)) || this.chat.isBot\n };\n }\n\n if(DEBUG) {\n log('setPeer peerId:', peerId, historyStorage, lastMsgId, topMessage);\n }\n\n // add last message, bc in getHistory will load < max_id\n const additionMsgId = overrideAdditionMsgId ?? (isJump || chatType === 'scheduled' || this.chat.isRestricted ? 0 : topMessage);\n\n let maxBubbleId = 0;\n if(samePeer) {\n const el = this.getBubbleByPoint('bottom'); // ! this may not work if being called when chat is hidden\n // this.chat.log('[PM]: setCorrectIndex: get last element perf:', performance.now() - perf, el);\n if(el) {\n maxBubbleId = +el.dataset.mid;\n }\n\n if(maxBubbleId <= 0) {\n maxBubbleId = Math.max(...Object.keys(this.bubbles).map((mid) => +mid));\n }\n } else {\n this.isFirstLoad = true;\n this.destroyResizeObserver();\n }\n\n const oldChatInner = this.chatInner;\n const oldPlaceholderBubble = this.emptyPlaceholderBubble;\n this.cleanup();\n const chatInner = this.chatInner = document.createElement('div');\n if(samePeer) {\n chatInner.className = oldChatInner.className;\n chatInner.classList.remove('disable-hover', 'is-scrolling');\n } else {\n chatInner.classList.add('bubbles-inner');\n }\n\n this.lazyLoadQueue.lock();\n\n // const haveToScrollToBubble = (topMessage && (isJump || samePeer)) || isTarget;\n const haveToScrollToBubble = samePeer || (topMessage && isJump) || isTarget;\n const fromUp = maxBubbleId > 0 && (!lastMsgId || maxBubbleId < lastMsgId || lastMsgId < 0);\n const scrollFromDown = !fromUp && samePeer;\n const scrollFromUp = !scrollFromDown && fromUp/* && (samePeer || forwardingUnread) */;\n this.willScrollOnLoad = scrollFromDown || scrollFromUp;\n\n this.setPeerOptions = {\n lastMsgId,\n topMessage,\n savedPosition\n };\n\n let result: Awaited>;\n if(!savedPosition) {\n result = await m(this.getHistory1(lastMsgId, true, isJump, additionMsgId));\n } else {\n result = {\n promise: getHeavyAnimationPromise().then(() => {\n return this.performHistoryResult({history: savedPosition.mids}, true);\n }) as any,\n cached: true,\n waitPromise: Promise.resolve()\n };\n }\n\n this.setPeerCached = result.cached;\n\n log.warn('got history');// warning\n\n const {promise, cached} = result;\n\n if(!cached && !samePeer) {\n await m(this.chat.finishPeerChange(isTarget, isJump, lastMsgId, startParam));\n this.scrollable.container.textContent = '';\n // oldContainer.textContent = '';\n // oldChatInner.remove();\n this.preloader.attach(this.container);\n }\n\n /* this.ladderDeferred && this.ladderDeferred.resolve();\n this.ladderDeferred = deferredPromise(); */\n\n animationIntersector.lockGroup(this.chat.animationGroup);\n const setPeerPromise = m(promise).then(async() => {\n log.warn('promise fulfilled');\n\n const mountedByLastMsgId = haveToScrollToBubble ? await m(lastMsgId ? this.getMountedBubble(lastMsgId) : {bubble: this.getLastBubble()}) : undefined;\n if(cached && !samePeer) {\n log.warn('finishing peer change');\n await m(this.chat.finishPeerChange(isTarget, isJump, lastMsgId, startParam)); // * костыль\n log.warn('finished peer change');\n }\n\n this.preloader.detach();\n\n if(this.resolveLadderAnimation) {\n this.resolveLadderAnimation();\n this.resolveLadderAnimation = undefined;\n }\n\n this.setPeerCached = undefined;\n\n // this.ladderDeferred.resolve();\n\n const scrollable = this.scrollable;\n scrollable.lastScrollDirection = 0;\n scrollable.lastScrollPosition = 0;\n replaceContent(scrollable.container, chatInner);\n // this.chat.topbar.container.nextElementSibling.replaceWith(container);\n\n if(oldPlaceholderBubble) {\n this.cleanupPlaceholders(oldPlaceholderBubble);\n }\n\n if(this.attachPlaceholderOnRender) {\n this.attachPlaceholderOnRender();\n }\n\n if(!isTarget && this.chat.isPinnedMessagesNeeded()) {\n this.chat.topbar.pinnedMessage?.setCorrectIndex(0);\n }\n\n this.container.classList.toggle('has-groups', !!Object.keys(this.dateMessages).length);\n\n log.warn('mounted chat', this.chatInner === chatInner, this.chatInner.parentElement, performance.now() - perf);\n\n animationIntersector.unlockGroup(this.chat.animationGroup);\n animationIntersector.checkAnimations(false, this.chat.animationGroup/* , true */);\n\n // fastRaf(() => {\n this.lazyLoadQueue.unlock();\n // });\n\n // if(dialog && lastMsgID && lastMsgID !== topMessage && (this.bubbles[lastMsgID] || this.firstUnreadBubble)) {\n if(savedPosition) {\n scrollable.setScrollTopSilently(savedPosition.top);\n /* const mountedByLastMsgId = this.getMountedBubble(lastMsgId);\n let bubble: HTMLElement = mountedByLastMsgId?.bubble;\n if(!bubble?.parentElement) {\n bubble = this.findNextMountedBubbleByMsgId(lastMsgId);\n }\n\n if(bubble) {\n const top = bubble.getBoundingClientRect().top;\n const distance = savedPosition.top - top;\n scrollable.scrollTop += distance;\n } */\n } else if(haveToScrollToBubble) {\n let unsetPadding: () => void;\n if(scrollFromDown) {\n scrollable.setScrollTopSilently(99999);\n } else if(scrollFromUp) {\n const set = this.setTopPadding();\n if(set.isPaddingNeeded) {\n unsetPadding = set.unsetPadding;\n }\n\n scrollable.setScrollTopSilently(0);\n }\n\n // const mountedByLastMsgId = lastMsgId ? this.getMountedBubble(lastMsgId) : {bubble: this.getLastBubble()};\n let bubble: HTMLElement = (followingUnread && this.firstUnreadBubble) || mountedByLastMsgId?.bubble;\n if(!bubble?.parentElement) {\n bubble = this.findNextMountedBubbleByMsgId(lastMsgId, false) || this.findNextMountedBubbleByMsgId(lastMsgId, true);\n }\n\n let promise: Promise;\n // ! sometimes there can be no bubble\n if(bubble) {\n const lastBubble = this.getLastBubble();\n const position: ScrollLogicalPosition = followingUnread ? 'start' : (!isJump && !isTarget && lastBubble === bubble ? 'end' : 'center');\n\n if(position === 'end' && lastBubble === bubble && samePeer) {\n promise = this.scrollToEnd();\n } else {\n promise = this.scrollToBubble(bubble, position, !samePeer ? FocusDirection.Static : undefined);\n }\n\n if(!followingUnread && isTarget) {\n this.highlightBubble(bubble);\n }\n }\n\n if(unsetPadding) {\n (promise || Promise.resolve()).then(() => {\n unsetPadding();\n });\n }\n } else {\n scrollable.setScrollTopSilently(99999);\n }\n\n // if(!cached) {\n this.onRenderScrollSet();\n // }\n\n this.onScroll();\n\n const afterSetPromise = Promise.all([\n setPeerPromise,\n getHeavyAnimationPromise()\n ]);\n afterSetPromise.then(() => { // check whether list isn't full\n if(!middleware()) {\n return;\n }\n\n scrollable.checkForTriggers();\n\n if(options.mediaTimestamp !== undefined) {\n // ! :(\n const p = cached && !samePeer && liteMode.isAvailable('animations') && this.chat.appImManager.chats.length > 1 ?\n pause(400) :\n Promise.resolve();\n p.then(() => {\n return this.playMediaWithTimestampAndMid({\n lastMsgId,\n middleware,\n mediaTimestamp: options.mediaTimestamp\n });\n });\n }\n\n // if(cached) {\n // this.onRenderScrollSet();\n // }\n });\n\n this.chat.dispatchEvent('setPeer', lastMsgId, !isJump);\n\n Promise.all([\n this.setFetchReactionsInterval(afterSetPromise),\n this.setFetchHistoryInterval({\n afterSetPromise,\n lastMsgId,\n samePeer,\n savedPosition,\n topMessage\n })\n ]).then(() => {\n log('scrolledAllDown:', scrollable.loadedAll.bottom);\n // if(!this.unreaded.length && dialog) { // lol\n if(scrollable.loadedAll.bottom && topMessage && !this.unreaded.size) { // lol\n this.onScrolledAllDown();\n }\n });\n\n if(chatType === 'chat' && !this.chat.isForumTopic) {\n const dialog = await m(this.managers.appMessagesManager.getDialogOnly(peerId));\n if(dialog?.pFlags.unread_mark) {\n this.managers.appMessagesManager.markDialogUnread(peerId, true);\n }\n }\n\n // this.chatInner.classList.remove('disable-hover', 'is-scrolling'); // warning, performance!\n }).catch((err) => {\n log.error('setPeer promise error:', err);\n if(!middleware()) {\n this.preloader.detach();\n }\n\n throw err;\n });\n\n return {cached, promise: setPeerPromise};\n }\n\n public playMediaWithTimestampAndMid({\n middleware,\n lastMsgId,\n mediaTimestamp\n }: {\n middleware: () => boolean,\n lastMsgId: number,\n mediaTimestamp: number\n }) {\n this.getMountedBubble(lastMsgId).then((mounted) => {\n if(!middleware() || !mounted) {\n return;\n }\n\n this.playMediaWithTimestamp(mounted.bubble, mediaTimestamp);\n });\n }\n\n public playMediaWithTimestamp(element: HTMLElement, timestamp: number) {\n const bubble = findUpClassName(element, 'bubble');\n const groupedItem = findUpClassName(element, 'grouped-item');\n const albumItemMid = groupedItem ? +groupedItem.dataset.mid : +bubble.dataset.textMid;\n let attachment = bubble.querySelector('.attachment');\n if(attachment) {\n if(albumItemMid) {\n attachment = attachment.querySelector(`[data-mid=\"${albumItemMid}\"]`);\n }\n\n const media = attachment.querySelector('img, video, canvas');\n this.checkTargetForMediaViewer(media, undefined, timestamp);\n return;\n }\n\n const audio = (groupedItem || bubble).querySelector('.audio');\n if(audio) {\n audio.playWithTimestamp(timestamp);\n return;\n }\n\n const replyToPeerId = bubble.dataset.replyToPeerId.toPeerId();\n const replyToMid = +bubble.dataset.replyToMid;\n if(replyToPeerId && replyToMid) {\n if(replyToPeerId === this.peerId) {\n this.chat.setMessageId(replyToMid, timestamp);\n } else {\n this.chat.appImManager.setInnerPeer({\n peerId: replyToPeerId,\n mediaTimestamp: timestamp\n });\n }\n }\n }\n\n private async setFetchReactionsInterval(afterSetPromise: Promise) {\n const middleware = this.getMiddleware();\n const needReactionsInterval = this.chat.isChannel;\n if(needReactionsInterval) {\n const fetchReactions = async() => {\n if(!middleware()) return;\n\n const mids: number[] = [];\n for(const mid in this.bubbles) {\n let message = await this.chat.getMessage(+mid);\n if(message?._ !== 'message') {\n continue;\n }\n\n message = await this.managers.appMessagesManager.getGroupsFirstMessage(message);\n mids.push(message.mid);\n }\n\n const promise = mids.length ? this.managers.appReactionsManager.getMessagesReactions(this.peerId, mids) : Promise.resolve();\n promise.then(() => {\n setTimeout(fetchReactions, 10e3);\n });\n };\n\n Promise.all([afterSetPromise, getHeavyAnimationPromise(), pause(500)]).then(() => {\n fetchReactions();\n });\n }\n }\n\n private async setFetchHistoryInterval({\n lastMsgId,\n topMessage,\n afterSetPromise,\n savedPosition,\n samePeer\n }: {\n lastMsgId: number,\n topMessage: number,\n afterSetPromise: Promise,\n savedPosition: ChatSavedPosition,\n samePeer: boolean\n }) {\n const peerId = this.peerId;\n if(peerId.isUser()) {\n return;\n }\n\n const middleware = this.getMiddleware();\n const needFetchInterval = await this.managers.appMessagesManager.isFetchIntervalNeeded(peerId);\n const needFetchNew = savedPosition || needFetchInterval;\n if(!needFetchNew) {\n return;\n }\n\n await afterSetPromise;\n if(!middleware()) {\n return;\n }\n\n const chatId = peerId.toChatId();\n middleware.onClean(() => {\n this.managers.apiUpdatesManager.unsubscribeFromChannelUpdates(chatId);\n });\n\n this.managers.apiUpdatesManager.subscribeToChannelUpdates(chatId);\n return;\n\n this.setLoaded('bottom', false);\n this.scrollable.checkForTriggers();\n\n if(!needFetchInterval) {\n return;\n }\n\n const f = () => {\n this.fetchNewPromise = new Promise(async(resolve) => {\n if(!middleware() || !(await this.managers.appMessagesManager.isFetchIntervalNeeded(peerId))) {\n resolve();\n return;\n }\n\n this.managers.appMessagesManager.getNewHistory(peerId, this.chat.threadId).then((result) => {\n if(!middleware() || !result) {\n resolve();\n return;\n }\n\n const {isBottomEnd} = result;\n if(this.scrollable.loadedAll.bottom && this.scrollable.loadedAll.bottom !== isBottomEnd) {\n this.setLoaded('bottom', isBottomEnd);\n this.onScroll();\n }\n\n setTimeout(f, 30e3);\n resolve();\n });\n }).finally(() => {\n this.fetchNewPromise = undefined;\n });\n };\n\n if(samePeer) {\n setTimeout(f, 30e3);\n } else {\n f();\n }\n }\n\n public async onScrolledAllDown() {\n if(this.chat.type === 'chat' || this.chat.type === 'discussion') {\n const historyMaxId = await this.chat.getHistoryMaxId();\n this.managers.appMessagesManager.readHistory(this.peerId, historyMaxId, this.chat.threadId, true);\n }\n }\n\n public async finishPeerChange() {\n const [isChannel, canWrite, isAnyGroup] = await Promise.all([\n this.chat.isChannel,\n this.chat.canSend(),\n this.chat.isAnyGroup\n ]);\n\n return () => {\n this.chatInner.classList.toggle('has-rights', canWrite);\n this.container.classList.toggle('is-chat-input-hidden', !canWrite);\n\n this.chatInner.classList.toggle('is-chat', isAnyGroup);\n this.chatInner.classList.toggle('is-channel', isChannel);\n\n this.createResizeObserver();\n };\n }\n\n private processBatch = async(...args: Parameters) => {\n let [loadQueue, m, log] = args;\n\n const filterQueue = (queue: typeof loadQueue) => {\n return queue.filter((details) => {\n // message can be deleted during rendering\n return details && this.bubbles[details.bubble.dataset.mid] === details.bubble;\n });\n };\n\n loadQueue = filterQueue(loadQueue);\n\n log('messages rendered');\n\n const reverse = loadQueue[0]?.reverse;\n\n const {groups, avatarPromises} = this.groupBubbles(loadQueue.filter((details) => details.updatePosition));\n\n // if(groups.length > 2 && loadQueue.length === 1) {\n // debugger;\n // }\n\n const promises = loadQueue.reduce((acc, details) => {\n const perf = performance.now();\n\n const promises = details.promises.slice();\n const timePromises = promises.map(async(promise) => (await promise, performance.now() - perf));\n Promise.all(timePromises).then((times) => {\n log.groupCollapsed('media message time', performance.now() - perf, details, times);\n times.forEach((time, idx) => {\n log('media message time', time, idx, promises[idx]);\n });\n log.groupEnd();\n });\n\n // if(details.updatePosition) {\n // if(res) {\n // groups.add(res.group);\n // if(details.needAvatar) {\n // details.promises.push(res.group.createAvatar(details.message));\n // }\n // }\n // }\n\n acc.push(...details.promises);\n return acc;\n }, [] as Promise[]);\n\n promises.push(...avatarPromises);\n // promises.push(pause(200));\n\n // * это нужно для того, чтобы если захочет подгрузить reply или какое-либо сообщение, то скролл не прервался\n // * если добавить этот промис - в таком случае нужно сделать, чтобы скроллило к последнему сообщению после рендера\n // promises.push(getHeavyAnimationPromise());\n\n log('media promises to call', promises, loadQueue, this.isHeavyAnimationInProgress);\n await m(Promise.all([...promises, this.setUnreadDelimiter()]).catch(noop)); // не нашёл места лучше\n await m(fastRafPromise()); // have to be the last\n log('media promises end');\n\n loadQueue = filterQueue(loadQueue);\n\n const {restoreScroll, scrollSaver} = this.prepareToSaveScroll(reverse);\n // if(this.messagesQueueOnRender) {\n // this.messagesQueueOnRender();\n // }\n\n this.messagesQueueOnRenderAdditional?.();\n\n this.ejectBubbles();\n for(const [bubble, oldBubble] of this.bubblesToReplace) {\n if(scrollSaver) {\n scrollSaver.replaceSaved(oldBubble, bubble);\n }\n\n if(!loadQueue.find((details) => details.bubble === bubble)) {\n continue;\n }\n\n const item = this.bubbleGroups.getItemByBubble(bubble);\n if(!item) {\n this.log.error('NO ITEM BY BUBBLE', bubble);\n } else {\n item.mounted = false;\n if(!groups.includes(item.group)) {\n groups.push(item.group);\n }\n }\n\n this.bubblesToReplace.delete(bubble);\n }\n\n if(this.chat.selection.isSelecting) {\n loadQueue.forEach(({bubble}) => {\n this.chat.selection.toggleElementCheckbox(bubble, true);\n });\n }\n\n loadQueue.forEach(({message, bubble, updatePosition}) => {\n if(message.pFlags.local && updatePosition) {\n this.chatInner[(message as Message.message).pFlags.sponsored ? 'append' : 'prepend'](bubble);\n return;\n }\n });\n\n this.bubbleGroups.mountUnmountGroups(groups);\n // this.bubbleGroups.findIncorrentPositions();\n\n this.updatePlaceholderPosition?.();\n\n restoreScroll?.();\n\n pause(!this.chat.setPeerPromise ? 0 : 1000)\n .then(() => getHeavyAnimationPromise())\n .then(() => {\n this.lazyLoadQueue.setAllSeen();\n });\n\n // this.setStickyDateManually();\n };\n\n public renderMessagesQueue(options: ReturnType) {\n return this.batchProcessor.addToQueue(options);\n }\n\n private ejectBubbles() {\n for(const bubble of this.bubblesToEject) {\n bubble.remove();\n // this.bubbleGroups.removeAndUnmountBubble(bubble);\n }\n\n this.bubblesToEject.clear();\n }\n\n public groupBubbles(items: Array<{\n // Awaited> &\n bubble: HTMLElement,\n message: Message.message | Message.messageService\n }/* & {\n unmountIfFound?: boolean\n } */>) {\n let modifiedGroups: typeof groups;\n\n if(this.chat.type === 'scheduled') {\n modifiedGroups = new Set();\n items.forEach(({bubble, message}) => {\n const item = this.bubbleGroups.getItemByBubble(bubble);\n const group = item?.group;\n if(group && item.message.date !== message.date) {\n this.bubbleGroups.removeItem(item);\n modifiedGroups.add(group);\n }\n });\n }\n\n items.forEach(({bubble, message}) => {\n this.bubbleGroups.prepareForGrouping(bubble, message);\n });\n\n const groups = this.bubbleGroups.groupUngrouped();\n\n const avatarPromises = Array.from(groups).map((group) => {\n if(group.avatar) return;\n const firstItem = group.firstItem;\n if(firstItem && this.chat.isAvatarNeeded(firstItem.message)) {\n return group.createAvatar(firstItem.message);\n }\n }).filter(Boolean);\n\n if(modifiedGroups) {\n for(const group of modifiedGroups) {\n groups.add(group);\n }\n }\n\n return {\n groups: [...groups],\n avatarPromises\n };\n }\n\n public getMiddleware(additionalCallback?: () => boolean) {\n return this.middlewareHelper.get(additionalCallback);\n }\n\n private async wrapMediaSpoiler({\n media,\n promise,\n middleware,\n attachmentDiv\n }: {\n media: Photo.photo | MyDocument,\n promise: Promise,\n middleware: Middleware,\n attachmentDiv: HTMLElement\n }) {\n await promise;\n if(!middleware()) {\n return;\n }\n\n const {width, height} = attachmentDiv.style;\n const container = await wrapMediaSpoiler({\n media,\n width: parseInt(width),\n height: parseInt(height),\n middleware,\n animationGroup: this.chat.animationGroup\n });\n\n if(!middleware()) {\n return;\n }\n\n attachmentDiv.append(container);\n }\n\n private async safeRenderMessage(\n message: Message.message | Message.messageService,\n reverse?: boolean,\n bubble?: HTMLElement,\n updatePosition = true,\n processResult?: (result: ReturnType, bubble: HTMLElement) => typeof result\n ) {\n if(!message || this.renderingMessages.has(message.mid) || (this.bubbles[message.mid] && !bubble)) {\n return;\n }\n\n const middlewareHelper = this.getMiddleware().create();\n const middleware = middlewareHelper.get();\n\n let result: Awaited> & {updatePosition: typeof updatePosition};\n try {\n this.renderingMessages.add(message.mid);\n\n // const groupedId = (message as Message.message).grouped_id;\n const newBubble = document.createElement('div');\n newBubble.middlewareHelper = middlewareHelper;\n newBubble.dataset.mid = '' + message.mid;\n newBubble.dataset.peerId = '' + message.peerId;\n newBubble.dataset.timestamp = '' + message.date;\n\n // const bubbleNew: Bubble = this.bubblesNew[message.mid] ??= {\n // bubble: newBubble,\n // mids: new Set(),\n // groupedId\n // };\n\n // bubbleNew.mids.add(message.mid);\n\n if(bubble) {\n bubble.middlewareHelper.destroy();\n this.skippedMids.delete(message.mid);\n\n this.bubblesToEject.add(bubble);\n this.bubblesToReplace.delete(bubble);\n this.bubblesToReplace.set(newBubble, bubble);\n this.bubbleGroups.changeBubbleByBubble(bubble, newBubble);\n }\n\n bubble = this.bubbles[message.mid] = newBubble;\n let originalPromise = this.renderMessage(message, reverse, bubble, middleware);\n if(processResult) {\n originalPromise = processResult(originalPromise, bubble);\n }\n\n const promise = originalPromise.then((r) => ((r && middleware() ? {...r, updatePosition} : undefined) as typeof result));\n\n this.renderMessagesQueue(promise.catch(() => undefined));\n\n result = await promise;\n if(!middleware()) {\n return;\n }\n\n if(!result) {\n this.skippedMids.add(+message.mid);\n }\n } catch(err) {\n this.log.error('renderMessage error:', err);\n }\n\n if(!middleware()) {\n return;\n }\n\n this.renderingMessages.delete(message.mid);\n return result;\n }\n\n // reverse means top\n private async renderMessage(\n message: Message.message | Message.messageService,\n reverse = false,\n bubble: HTMLElement,\n middleware: Middleware\n ) {\n // if(DEBUG) {\n // this.log('message to render:', message);\n // }\n\n // if(!bubble && this.bubbles[message.mid]) {\n // return;\n // }\n\n // await pause(1000);\n\n const isMessage = message._ === 'message';\n const groupedId = isMessage && message.grouped_id;\n let albumMids: number[], reactionsMessage: Message.message;\n const albumMessages = groupedId ? await this.managers.appMessagesManager.getMessagesByAlbum(groupedId) : undefined;\n\n const albumMustBeRenderedFull = this.chat.type !== 'pinned';\n\n if(groupedId && albumMustBeRenderedFull) { // will render only last album's message\n albumMids = albumMessages.map((message) => message.mid);\n const mainMid = getMainMidForGrouped(albumMids);\n if(message.mid !== mainMid) {\n return;\n }\n }\n\n if(isMessage) {\n reactionsMessage = groupedId ? albumMessages[0] : message;\n }\n\n // * can't use 'message.pFlags.out' here because this check will be used to define side of message (left-right)\n const our = this.chat.isOurMessage(message);\n\n const messageDiv = document.createElement('div');\n messageDiv.classList.add('message', 'spoilers-container');\n\n const contentWrapper = document.createElement('div');\n contentWrapper.classList.add('bubble-content-wrapper');\n\n const bubbleContainer = document.createElement('div');\n bubbleContainer.classList.add('bubble-content');\n\n bubble.classList.add('bubble');\n contentWrapper.append(bubbleContainer);\n bubble.append(contentWrapper);\n\n let isInUnread = !our &&\n !message.pFlags.out &&\n (\n message.pFlags.unread ||\n isMentionUnread(message)\n );\n\n if(!isInUnread && this.chat.peerId.isAnyChat()) {\n const readMaxId = await this.managers.appMessagesManager.getReadMaxIdIfUnread(this.chat.peerId, this.chat.threadId);\n if(readMaxId !== undefined && readMaxId < message.mid) {\n isInUnread = true;\n }\n }\n\n if(isInUnread && this.observer) {\n // this.log('not our message', message, message.pFlags.unread);\n this.observer.observe(bubble, this.unreadedObserverCallback);\n this.unreaded.set(bubble, message.mid);\n }\n\n const loadPromises: Promise[] = [];\n const ret = {\n bubble,\n promises: loadPromises,\n message,\n reverse\n };\n\n const wrapOptions: WrapSomethingOptions = {\n lazyLoadQueue: this.lazyLoadQueue,\n middleware,\n customEmojiSize: this.chat.appImManager.customEmojiSize,\n animationGroup: this.chat.animationGroup\n };\n\n if(message._ === 'messageService' && (!message.action || !SERVICE_AS_REGULAR.has(message.action._))) {\n const action = message.action;\n if(action) {\n const _ = action._;\n\n const ignoreAction = IGNORE_ACTIONS.get(_);\n if(ignoreAction && (ignoreAction === true || ignoreAction(message))) {\n return;\n }\n\n if(langPack.hasOwnProperty(_) && !langPack[_]) {\n return;\n }\n }\n\n bubble.className = 'bubble service';\n\n bubbleContainer.innerHTML = '';\n const s = document.createElement('div');\n s.classList.add('service-msg');\n if(action) {\n let promise: Promise;\n if(action._ === 'messageActionChannelMigrateFrom') {\n const peerTitle = new PeerTitle();\n promise = peerTitle.update({peerId: action.chat_id.toPeerId(true), wrapOptions});\n s.append(i18n('ChatMigration.From', [peerTitle.element]));\n } else if(action._ === 'messageActionChatMigrateTo') {\n const peerTitle = new PeerTitle();\n promise = peerTitle.update({peerId: action.channel_id.toPeerId(true), wrapOptions});\n s.append(i18n('ChatMigration.To', [peerTitle.element]));\n } else {\n s.append(await wrapMessageActionTextNew({\n message,\n ...wrapOptions\n }));\n }\n }\n bubbleContainer.append(s);\n\n if(message.pFlags.is_single) { // * Ignore 'Discussion started'\n bubble.classList.add('is-group-last');\n }\n\n return ret;\n }\n\n let messageMedia: MessageMedia = isMessage && message.media;\n let needToSetHTML = true;\n let messageMessage: string, totalEntities: MessageEntity[], albumTextMessage: Message.message;\n if(isMessage) {\n if(groupedId && albumMustBeRenderedFull) {\n const t = albumTextMessage = getAlbumText(albumMessages);\n messageMessage = t?.message || '';\n // totalEntities = t.entities;\n totalEntities = t?.totalEntities || [];\n } else {\n messageMessage = message.message;\n // totalEntities = message.entities;\n totalEntities = message.totalEntities;\n }\n\n const document = (messageMedia as MessageMedia.messageMediaDocument)?.document as MyDocument;\n if(document) {\n if(document?.type === 'sticker') {\n messageMessage = totalEntities = undefined;\n } else if(!['video', 'gif'].includes(document.type)) {\n needToSetHTML = false;\n }\n }\n } else {\n if(message.action._ === 'messageActionPhoneCall') {\n messageMedia = {\n _: 'messageMediaCall',\n action: message.action\n };\n }\n }\n\n let bigEmojis = 0, customEmojiSize: MediaSize;\n if(totalEntities && !messageMedia) {\n const emojiEntities = totalEntities.filter((e) => e._ === 'messageEntityEmoji'/* || e._ === 'messageEntityCustomEmoji' */);\n const strLength = messageMessage.replace(/\\s/g, '').length;\n const emojiStrLength = emojiEntities.reduce((acc, curr) => acc + curr.length, 0);\n\n if(emojiStrLength === strLength /* && emojiEntities.length <= 3 *//* && totalEntities.length === emojiEntities.length */) {\n bigEmojis = Math.min(BIG_EMOJI_SIZES_LENGTH, emojiEntities.length);\n\n customEmojiSize = mediaSizes.active.customEmoji;\n\n const size = BIG_EMOJI_SIZES[bigEmojis];\n if(size) {\n customEmojiSize = makeMediaSize(size, size);\n bubble.style.setProperty('--emoji-size', size + 'px');\n }\n }\n }\n\n customEmojiSize ??= this.chat.appImManager.customEmojiSize;\n\n let maxMediaTimestamp = getMediaDurationFromMessage(albumTextMessage || message as Message.message);\n if(albumTextMessage && needToSetHTML) {\n bubble.dataset.textMid = '' + albumTextMessage.mid;\n }\n\n if(message.reply_to) {\n const replyToPeerId = message.reply_to.reply_to_peer_id ? getPeerId(message.reply_to.reply_to_peer_id) : this.peerId;\n bubble.dataset.replyToPeerId = '' + replyToPeerId;\n bubble.dataset.replyToMid = '' + message.reply_to_mid;\n\n if(maxMediaTimestamp === undefined) {\n const originalMessage = await rootScope.managers.appMessagesManager.getMessageByPeer(replyToPeerId, message.reply_to_mid);\n if(originalMessage) {\n maxMediaTimestamp = getMediaDurationFromMessage(originalMessage as Message.message);\n } else {\n // this.managers.appMessagesManager.fetchMessageReplyTo(message);\n // this.needUpdate.push({replyToPeerId, replyMid: message.reply_to_mid, mid: message.mid});\n maxMediaTimestamp = Infinity;\n }\n }\n }\n\n const richTextOptions: Parameters[1] = {\n entities: totalEntities,\n passEntities: this.passEntities,\n loadPromises,\n lazyLoadQueue: this.lazyLoadQueue,\n customEmojiSize,\n middleware,\n animationGroup: this.chat.animationGroup,\n maxMediaTimestamp\n };\n\n const richText = messageMessage ? wrapRichText(messageMessage, richTextOptions) : '';\n\n let canHaveTail = true;\n let isStandaloneMedia = false;\n let attachmentDiv: HTMLElement;\n if(bigEmojis) {\n if(rootScope.settings.emoji.big) {\n const sticker = bigEmojis === 1 &&\n !totalEntities.find((entity) => entity._ === 'messageEntityCustomEmoji') &&\n await this.managers.appStickersManager.getAnimatedEmojiSticker(messageMessage);\n if(bigEmojis === 1 && !messageMedia && sticker) {\n messageMedia = {\n _: 'messageMediaDocument',\n document: sticker,\n pFlags: {}\n };\n } else {\n attachmentDiv = document.createElement('div');\n attachmentDiv.classList.add('attachment', 'spoilers-container');\n\n setInnerHTML(attachmentDiv, richText);\n\n bubbleContainer.append(attachmentDiv);\n }\n\n bubble.classList.add('is-message-empty', 'emoji-big');\n isStandaloneMedia = true;\n canHaveTail = false;\n needToSetHTML = false;\n }\n\n bubble.classList.add('can-have-big-emoji');\n }\n\n if(needToSetHTML) {\n setInnerHTML(messageDiv, richText);\n }\n\n const haveRTLChar = isRTL(messageMessage, true);\n\n const timeSpan = MessageRender.setTime({\n chatType: this.chat.type,\n message,\n reactionsMessage\n });\n messageDiv.append(timeSpan);\n bubbleContainer.prepend(messageDiv);\n // bubble.prepend(timeSpan, messageDiv); // that's bad\n\n if(haveRTLChar) {\n timeSpan.classList.add('is-block');\n }\n\n let topicNameButtonContainer: HTMLElement;\n if(isMessage && this.chat.isAllMessagesForum) {\n const result = await wrapTopicNameButton({\n peerId: this.peerId,\n threadId: getMessageThreadId(message, this.chat.isForum),\n lastMsgId: message.mid,\n wrapOptions: {\n middleware\n },\n withIcons: true\n });\n\n const {element} = result;\n // if(isStandaloneMedia) {\n // element.classList.add('floating-part');\n // }\n\n topicNameButtonContainer = document.createElement('div');\n topicNameButtonContainer.classList.add(/* 'name', */'topic-name-button-container');\n topicNameButtonContainer.append(element);\n }\n\n if(isMessage && message.views) {\n bubble.classList.add('channel-post');\n\n if(!message.fwd_from?.saved_from_msg_id && this.chat.type !== 'pinned') {\n const forward = document.createElement('div');\n forward.classList.add('bubble-beside-button', 'forward', 'tgico-forward_filled');\n bubbleContainer.prepend(forward);\n bubble.classList.add('with-beside-button');\n }\n\n if(!message.pFlags.is_outgoing && this.observer) {\n this.observer.observe(bubble, this.viewsObserverCallback);\n }\n }\n\n const replyMarkup = isMessage && message.reply_markup;\n let replyMarkupRows = replyMarkup?._ === 'replyInlineMarkup' && replyMarkup.rows;\n if(replyMarkupRows) {\n replyMarkupRows = replyMarkupRows.filter((row) => row.buttons.length);\n }\n\n if(replyMarkupRows) {\n const containerDiv = document.createElement('div');\n containerDiv.classList.add('reply-markup');\n replyMarkupRows.forEach((row) => {\n const buttons = row.buttons;\n\n const rowDiv = document.createElement('div');\n rowDiv.classList.add('reply-markup-row');\n\n buttons.forEach((button) => {\n let text: DocumentFragment | HTMLElement | string = wrapRichText(button.text, {noLinks: true, noLinebreaks: true});\n\n let buttonEl: HTMLButtonElement | HTMLAnchorElement;\n\n switch(button._) {\n case 'keyboardButtonUrl': {\n const r = wrapRichText(' ', {\n entities: [{\n _: 'messageEntityTextUrl',\n length: 1,\n offset: 0,\n url: button.url\n }]\n });\n\n buttonEl = htmlToDocumentFragment(r).firstElementChild as HTMLAnchorElement;\n buttonEl.classList.add('is-link');\n\n break;\n }\n\n case 'keyboardButtonSwitchInline': {\n buttonEl = document.createElement('button');\n buttonEl.classList.add('is-switch-inline');\n attachClickEvent(buttonEl, (e) => {\n cancelEvent(e);\n\n const botId = message.viaBotId || message.fromId;\n let promise: Promise;\n if(button.pFlags.same_peer) promise = Promise.resolve(this.peerId);\n else promise = this.managers.appInlineBotsManager.checkSwitchReturn(botId).then((peerId) => {\n if(peerId) {\n return peerId;\n }\n\n return new Promise((resolve, reject) => {\n const popup = PopupElement.createPopup(PopupForward, undefined, (peerId) => {\n resolve(peerId);\n });\n\n popup.addEventListener('close', () => {\n reject();\n });\n });\n });\n\n promise.then((peerId) => {\n const threadId = this.peerId === peerId ? this.chat.threadId : undefined;\n this.chat.appImManager.setInnerPeer({peerId});\n this.managers.appInlineBotsManager.switchInlineQuery(peerId, threadId, botId, button.query);\n });\n });\n break;\n }\n\n case 'keyboardButtonBuy': {\n const mediaInvoice = messageMedia._ === 'messageMediaInvoice' ? messageMedia : undefined;\n if(mediaInvoice?.extended_media) {\n break;\n }\n\n buttonEl = document.createElement('button');\n buttonEl.classList.add('is-buy');\n\n if(mediaInvoice?.receipt_msg_id) {\n text = i18n('Message.ReplyActionButtonShowReceipt');\n }\n\n break;\n }\n\n case 'keyboardButtonUrlAuth': {\n buttonEl = document.createElement('button');\n buttonEl.classList.add('is-url-auth');\n\n const {peerId} = this;\n const {mid} = message;\n const {url, button_id} = button;\n\n attachClickEvent(buttonEl, () => {\n const toggle = toggleDisability([buttonEl], true);\n this.chat.appImManager.handleUrlAuth({\n peerId,\n mid,\n url,\n buttonId: button_id\n }).then(() => {\n toggle();\n });\n });\n break;\n }\n\n default: {\n buttonEl = document.createElement('button');\n break;\n }\n }\n\n if(!buttonEl) {\n return;\n }\n\n buttonEl.classList.add('reply-markup-button', 'rp', 'tgico');\n const t = document.createElement('span');\n t.classList.add('reply-markup-button-text');\n if(typeof(text) === 'string') {\n t.insertAdjacentHTML('beforeend', text);\n } else {\n t.append(text);\n }\n\n ripple(buttonEl);\n buttonEl.append(t);\n\n rowDiv.append(buttonEl);\n });\n\n if(!rowDiv.childElementCount) {\n return;\n }\n\n containerDiv.append(rowDiv);\n });\n\n const haveButtons = !!containerDiv.childElementCount;\n\n haveButtons && attachClickEvent(containerDiv, (e) => {\n let target = e.target as HTMLElement;\n\n if(!target.classList.contains('reply-markup-button')) target = findUpClassName(target, 'reply-markup-button');\n if(\n !target ||\n target.classList.contains('is-link') ||\n target.classList.contains('is-switch-inline') ||\n target.classList.contains('is-buy') ||\n target.classList.contains('is-url-auth')\n ) return;\n\n cancelEvent(e);\n\n const column = whichChild(target);\n const row = replyMarkupRows[whichChild(target.parentElement)];\n\n if(!row.buttons || !row.buttons[column]) {\n this.log.warn('no such button', row, column, message);\n return;\n }\n\n const button = row.buttons[column];\n this.managers.appInlineBotsManager.callbackButtonClick(this.peerId, message.mid, button).then((callbackAnswer) => {\n if(typeof callbackAnswer.message === 'string' && callbackAnswer.message.length) {\n toast(wrapRichText(callbackAnswer.message, {noLinks: true, noLinebreaks: true}));\n }\n\n // console.log('callbackButtonClick callbackAnswer:', callbackAnswer);\n });\n });\n\n if(haveButtons) {\n // canHaveTail = false;\n bubble.classList.add('with-reply-markup');\n contentWrapper.append(containerDiv);\n }\n }\n\n const isOutgoing = message.pFlags.is_outgoing/* && this.peerId !== rootScope.myId */;\n if(our) {\n if(message.pFlags.unread || isOutgoing) this.unreadOut.add(message.mid);\n let status = '';\n if(message.error) status = 'is-error';\n else if(isOutgoing) status = 'is-sending';\n else status = message.pFlags.unread || (message as Message.message).pFlags.is_scheduled ? 'is-sent' : 'is-read';\n bubble.classList.add(status);\n }\n\n if(isOutgoing && !message.error) {\n bubble.classList.add('is-outgoing');\n }\n\n const messageWithReplies = isMessage && await this.managers.appMessagesManager.getMessageWithCommentReplies(message);\n const withReplies = !!messageWithReplies && message.mid > 0;\n\n if(withReplies) {\n bubble.classList.add('with-replies');\n }\n\n const fwdFrom = isMessage && message.fwd_from;\n const fwdFromId = isMessage && message.fwdFromId;\n\n const isOut = this.chat.isOutMessage(message);\n let nameContainer: HTMLElement = bubbleContainer;\n\n const canHideNameIfMedia = !message.viaBotId && (message.fromId === rootScope.myId || !message.pFlags.out);\n\n const isMessageEmpty = !messageMessage/* && (!topicNameButtonContainer || isStandaloneMedia) */;\n\n let viewButton: HTMLAnchorElement;\n // media\n if(messageMedia/* && messageMedia._ === 'messageMediaPhoto' */) {\n attachmentDiv = document.createElement('div');\n attachmentDiv.classList.add('attachment');\n\n if(isMessageEmpty) {\n bubble.classList.add('is-message-empty');\n }\n\n let processingWebPage = false;\n\n /* if(isMessage) */switch(messageMedia._) {\n case 'messageMediaPhoto': {\n const photo = messageMedia.photo;\n // //////this.log('messageMediaPhoto', photo);\n\n if(isMessageEmpty) {\n canHaveTail = false;\n }\n\n if(canHideNameIfMedia) {\n bubble.classList.add('hide-name');\n }\n\n bubble.classList.add('photo');\n\n if(albumMustBeRenderedFull && groupedId && albumMids.length !== 1) {\n bubble.classList.add('is-album', 'is-grouped');\n wrapAlbum({\n messages: albumMessages,\n attachmentDiv,\n middleware: this.getMiddleware(),\n isOut: our,\n lazyLoadQueue: this.lazyLoadQueue,\n chat: this.chat,\n loadPromises,\n autoDownload: this.chat.autoDownload\n });\n\n break;\n }\n\n const withTail = !IS_ANDROID && canHaveTail && !withReplies && USE_MEDIA_TAILS;\n if(withTail) bubble.classList.add('with-media-tail');\n const p = wrapPhoto({\n photo: photo as Photo.photo,\n message,\n container: attachmentDiv,\n withTail,\n isOut,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware: this.getMiddleware(),\n loadPromises,\n autoDownloadSize: this.chat.autoDownload.photo\n });\n\n if(messageMedia.pFlags.spoiler) {\n loadPromises.push(this.wrapMediaSpoiler({\n media: photo as Photo.photo,\n promise: p,\n middleware,\n attachmentDiv\n }));\n }\n\n break;\n }\n\n case 'messageMediaWebPage': {\n processingWebPage = true;\n\n const webPage: WebPage = messageMedia.webpage;\n // //////this.log('messageMediaWebPage', webpage);\n if(webPage._ !== 'webPage') {\n break;\n }\n\n const wrapped = wrapUrl(webPage.url);\n if(wrapped?.onclick === 'im') {\n const map: {[type: string]: LangPackKey} = {\n telegram_channel: 'Chat.Message.ViewChannel',\n telegram_megagroup: 'OpenGroup',\n telegram_bot: 'Chat.Message.ViewBot'\n };\n\n const langPackKey = map[webPage.type] || 'OpenMessage';\n viewButton = this.makeViewButton({text: langPackKey, asLink: true});\n viewButton.href = wrapped.url;\n viewButton.setAttribute('onclick', `${wrapped.onclick}(this)`);\n }\n\n bubble.classList.add('webpage');\n\n const box = document.createElement('div');\n box.classList.add('web');\n\n const quote = document.createElement('div');\n quote.classList.add('quote');\n\n let previewResizer: HTMLDivElement, preview: HTMLDivElement;\n const photo: Photo.photo = webPage.photo as any;\n if(photo || webPage.document) {\n previewResizer = document.createElement('div');\n previewResizer.classList.add('preview-resizer');\n preview = document.createElement('div');\n preview.classList.add('preview');\n previewResizer.append(preview);\n }\n\n const quoteTextDiv = document.createElement('div');\n quoteTextDiv.classList.add('quote-text');\n\n const doc = webPage.document as MyDocument;\n if(doc) {\n if(doc.type === 'gif' || doc.type === 'video' || doc.type === 'round') {\n // if(doc.size <= 20e6) {\n const mediaSize = doc.type === 'round' ? mediaSizes.active.round : mediaSizes.active.webpage;\n if(doc.type === 'round') {\n bubble.classList.add('round');\n preview.classList.add('is-round');\n } else {\n bubble.classList.add('video');\n }\n wrapVideo({\n doc,\n container: preview,\n message: message as Message.message,\n boxWidth: mediaSize.width,\n boxHeight: mediaSize.height,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware: this.getMiddleware(),\n isOut,\n group: this.chat.animationGroup,\n loadPromises,\n autoDownload: this.chat.autoDownload,\n noInfo: message.mid < 0\n });\n // }\n } else {\n const docDiv = await wrapDocument({\n message: message as Message.message,\n autoDownloadSize: this.chat.autoDownload.file,\n lazyLoadQueue: this.lazyLoadQueue,\n loadPromises,\n sizeType: 'documentName',\n searchContext: {\n useSearch: false,\n peerId: this.peerId,\n inputFilter: {\n _: 'inputMessagesFilterEmpty'\n }\n },\n fontSize: rootScope.settings.messagesTextSize,\n canTranscribeVoice: true\n });\n preview.append(docDiv);\n preview.classList.add('preview-with-document');\n quoteTextDiv.classList.add('has-document');\n // messageDiv.classList.add((webpage.type || 'document') + '-message');\n // doc = null;\n }\n }\n\n if(previewResizer) {\n quoteTextDiv.append(previewResizer);\n }\n\n let t: HTMLElement;\n if(webPage.site_name) {\n const html = wrapRichText(webPage.url);\n const a: HTMLAnchorElement = htmlToDocumentFragment(html).firstElementChild as any;\n a.classList.add('webpage-name');\n const strong = document.createElement('strong');\n setInnerHTML(strong, wrapEmojiText(webPage.site_name));\n a.textContent = '';\n a.append(strong);\n quoteTextDiv.append(a);\n t = a;\n }\n\n const title = wrapWebPageTitle(webPage);\n if(title.textContent) {\n const titleDiv = document.createElement('div');\n titleDiv.classList.add('title');\n const strong = document.createElement('strong');\n setInnerHTML(strong, title);\n titleDiv.append(strong);\n quoteTextDiv.append(titleDiv);\n t = titleDiv;\n }\n\n const description = wrapWebPageDescription(webPage);\n if(description.textContent) {\n const textDiv = document.createElement('div');\n textDiv.classList.add('text');\n setInnerHTML(textDiv, description);\n quoteTextDiv.append(textDiv);\n t = textDiv;\n }\n\n /* if(t) {\n t.append(timeSpan);\n } else {\n box.classList.add('no-text');\n } */\n\n quote.append(quoteTextDiv);\n\n if(photo && !doc) {\n bubble.classList.add('photo');\n\n const size: PhotoSize.photoSize = photo.sizes[photo.sizes.length - 1] as any;\n let isSquare = false;\n if(size.w === size.h && t) {\n bubble.classList.add('is-square-photo');\n isSquare = true;\n setAttachmentSize(photo, preview, 48, 48, false);\n\n /* if(t) {\n t.append(timeSpan);\n } */\n } else if(size.h > size.w) {\n bubble.classList.add('is-vertical-photo');\n }\n\n wrapPhoto({\n photo,\n message,\n container: preview,\n boxWidth: isSquare ? 0 : mediaSizes.active.webpage.width,\n boxHeight: isSquare ? 0 : mediaSizes.active.webpage.height,\n isOut,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware: this.getMiddleware(),\n loadPromises,\n withoutPreloader: isSquare,\n autoDownloadSize: this.chat.autoDownload.photo\n });\n }\n\n box.append(quote);\n\n // bubble.prepend(box);\n // if(timeSpan.parentElement === messageDiv) {\n messageDiv.insertBefore(box, timeSpan);\n // } else {\n // messageDiv.append(box);\n // }\n\n // this.log('night running', bubble.scrollHeight);\n\n break;\n }\n\n case 'messageMediaDocument': {\n const doc = messageMedia.document as MyDocument;\n\n // this.log('messageMediaDocument', doc, bubble);\n\n if(doc.sticker/* && doc.size <= 1e6 */) {\n bubble.classList.add('sticker');\n canHaveTail = false;\n isStandaloneMedia = true;\n\n if(doc.animated) {\n bubble.classList.add('sticker-animated');\n }\n\n const sizes = mediaSizes.active;\n const isEmoji = bubble.classList.contains('emoji-big');\n const boxSize = isEmoji ? sizes.emojiSticker : (doc.animated ? sizes.animatedSticker : sizes.staticSticker);\n setAttachmentSize(doc, attachmentDiv, boxSize.width, boxSize.height);\n // let preloader = new ProgressivePreloader(attachmentDiv, false);\n bubbleContainer.style.minWidth = attachmentDiv.style.width;\n bubbleContainer.style.minHeight = attachmentDiv.style.height;\n // appPhotosManager.setAttachmentSize(doc, bubble);\n wrapSticker({\n doc,\n div: attachmentDiv,\n middleware,\n lazyLoadQueue: this.lazyLoadQueue,\n group: this.chat.animationGroup,\n // play: !!message.pending || !multipleRender,\n play: true,\n liteModeKey: 'stickers_chat',\n loop: true,\n emoji: isEmoji ? messageMessage : undefined,\n withThumb: true,\n loadPromises,\n isOut,\n noPremium: messageMedia?.pFlags?.nopremium\n });\n\n if((getStickerEffectThumb(doc) || isEmoji) && (isInUnread || isOutgoing)/* || true */) {\n this.observer.observe(bubble, this.stickerEffectObserverCallback);\n }\n } else if(doc.type === 'video' || doc.type === 'gif' || doc.type === 'round'/* && doc.size <= 20e6 */) {\n // this.log('never get free 2', doc);\n\n const isRound = doc.type === 'round';\n if(isRound) {\n isStandaloneMedia = true;\n }\n\n if(isRound || isMessageEmpty) {\n canHaveTail = false;\n }\n\n if(canHideNameIfMedia) {\n bubble.classList.add('hide-name');\n }\n\n bubble.classList.add(isRound ? 'round' : 'video');\n if(albumMustBeRenderedFull && groupedId && albumMids.length !== 1) {\n bubble.classList.add('is-album', 'is-grouped');\n\n wrapAlbum({\n messages: albumMessages,\n attachmentDiv,\n middleware,\n isOut: our,\n lazyLoadQueue: this.lazyLoadQueue,\n chat: this.chat,\n loadPromises,\n autoDownload: this.chat.autoDownload\n });\n } else {\n const withTail = !IS_ANDROID && !IS_APPLE && !isRound && canHaveTail && !withReplies && USE_MEDIA_TAILS;\n if(withTail) bubble.classList.add('with-media-tail');\n const p = wrapVideo({\n doc,\n container: attachmentDiv,\n message: message as Message.message,\n boxWidth: mediaSizes.active.regular.width,\n boxHeight: mediaSizes.active.regular.height,\n withTail,\n isOut,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware,\n group: this.chat.animationGroup,\n loadPromises,\n autoDownload: this.chat.autoDownload,\n searchContext: isRound ? {\n peerId: this.peerId,\n inputFilter: {_: 'inputMessagesFilterRoundVoice'},\n threadId: this.chat.threadId,\n useSearch: !(message as Message.message).pFlags.is_scheduled,\n isScheduled: (message as Message.message).pFlags.is_scheduled\n } : undefined,\n noInfo: message.mid < 0,\n noAutoplayAttribute: !!messageMedia.pFlags.spoiler\n });\n\n if(messageMedia.pFlags.spoiler) {\n loadPromises.push(this.wrapMediaSpoiler({\n media: doc,\n promise: p,\n middleware,\n attachmentDiv\n }));\n }\n }\n } else {\n const newNameContainer = await wrapGroupedDocuments({\n albumMustBeRenderedFull,\n message,\n bubble,\n messageDiv,\n chat: this.chat,\n loadPromises,\n autoDownloadSize: this.chat.autoDownload.file,\n lazyLoadQueue: this.lazyLoadQueue,\n searchContext: doc.type === 'voice' || doc.type === 'audio' ? {\n peerId: this.peerId,\n inputFilter: {_: doc.type === 'voice' ? 'inputMessagesFilterRoundVoice' : 'inputMessagesFilterMusic'},\n threadId: this.chat.threadId,\n useSearch: !(message as Message.message).pFlags.is_scheduled,\n isScheduled: (message as Message.message).pFlags.is_scheduled\n } : undefined,\n sizeType: 'documentName',\n fontSize: rootScope.settings.messagesTextSize,\n richTextFragment: typeof(richText) === 'string' ? undefined : richText,\n richTextOptions,\n canTranscribeVoice: true\n });\n\n if(newNameContainer) {\n nameContainer = newNameContainer;\n }\n\n const lastContainer = messageDiv.lastElementChild.querySelector('.document-message, .document, .audio');\n // lastContainer && lastContainer.append(timeSpan.cloneNode(true));\n lastContainer && lastContainer.append(timeSpan);\n\n bubble.classList.remove('is-message-empty');\n const addClassName = (!(['photo', 'pdf'] as MyDocument['type'][]).includes(doc.type) ? doc.type || 'document' : 'document') + '-message';\n messageDiv.classList.add(addClassName);\n\n if(doc.type === 'audio' || doc.type === 'voice') {\n bubble.classList.add('min-content');\n }\n\n processingWebPage = true;\n }\n\n break;\n }\n\n case 'messageMediaCall': {\n const action = messageMedia.action;\n const div = document.createElement('div');\n div.classList.add('bubble-call', action.pFlags.video ? 'tgico-videocamera' : 'tgico-phone');\n\n const type: CallType = action.pFlags.video ? 'video' : 'voice';\n div.dataset.type = type;\n\n const title = document.createElement('div');\n title.classList.add('bubble-call-title');\n\n _i18n(title, isOut ?\n (action.pFlags.video ? 'CallMessageVideoOutgoing' : 'CallMessageOutgoing') :\n (action.pFlags.video ? 'CallMessageVideoIncoming' : 'CallMessageIncoming'));\n\n const subtitle = document.createElement('div');\n subtitle.classList.add('bubble-call-subtitle');\n\n if(action.duration !== undefined) {\n subtitle.append(formatCallDuration(action.duration));\n } else {\n let langPackKey: LangPackKey;\n switch(action.reason._) {\n case 'phoneCallDiscardReasonBusy':\n langPackKey = 'Call.StatusBusy';\n break;\n case 'phoneCallDiscardReasonMissed':\n langPackKey = 'Chat.Service.Call.Missed';\n break;\n // case 'phoneCallDiscardReasonHangup':\n default:\n langPackKey = 'Chat.Service.Call.Cancelled';\n break;\n }\n\n subtitle.classList.add('is-reason');\n _i18n(subtitle, langPackKey);\n }\n\n subtitle.classList.add('tgico', 'arrow-' + (action.duration !== undefined ? 'green' : 'red'));\n\n div.append(title, subtitle);\n\n processingWebPage = true;\n\n bubble.classList.remove('is-message-empty');\n messageDiv.classList.add('call-message');\n messageDiv.append(div);\n\n break;\n }\n\n case 'messageMediaContact': {\n // this.log('wrapping contact', message);\n\n const contact = messageMedia;\n const contactDiv = document.createElement('div');\n contactDiv.classList.add('contact');\n contactDiv.dataset.peerId = '' + contact.user_id;\n\n processingWebPage = true;\n\n const contactDetails = document.createElement('div');\n contactDetails.className = 'contact-details';\n const contactNameDiv = document.createElement('div');\n contactNameDiv.className = 'contact-name';\n const fullName = [\n contact.first_name,\n contact.last_name\n ].filter(Boolean).join(' ');\n contactNameDiv.append(\n fullName.trim() ? wrapEmojiText(fullName) : i18n('AttachContact')\n );\n\n const contactNumberDiv = document.createElement('div');\n contactNumberDiv.className = 'contact-number';\n contactNumberDiv.textContent = contact.phone_number ? '+' + formatPhoneNumber(contact.phone_number).formatted : 'Unknown phone number';\n\n contactDiv.append(contactDetails);\n contactDetails.append(contactNameDiv, contactNumberDiv);\n\n const avatarElem = new AvatarElement();\n avatarElem.updateWithOptions({\n lazyLoadQueue: this.lazyLoadQueue,\n peerId: contact.user_id.toPeerId(),\n peerTitle: contact.user_id ? undefined : (fullName.trim() ? fullName : I18n.format('AttachContact', true)[0])\n });\n avatarElem.classList.add('contact-avatar', 'avatar-54');\n\n contactDiv.prepend(avatarElem);\n\n bubble.classList.remove('is-message-empty');\n messageDiv.classList.add('contact-message');\n messageDiv.append(contactDiv);\n\n break;\n }\n\n case 'messageMediaPoll': {\n bubble.classList.remove('is-message-empty');\n\n const pollElement = wrapPoll(message);\n messageDiv.prepend(pollElement);\n messageDiv.classList.add('poll-message');\n\n break;\n }\n\n case 'messageMediaInvoice': {\n const isTest = messageMedia.pFlags.test;\n const extendedMedia = messageMedia.extended_media;\n const isAlreadyPaid = extendedMedia?._ === 'messageExtendedMedia';\n const isNotPaid = extendedMedia?._ === 'messageExtendedMediaPreview';\n let innerMedia = isAlreadyPaid ?\n (extendedMedia.media as MessageMedia.messageMediaPhoto).photo as Photo.photo ||\n (extendedMedia.media as MessageMedia.messageMediaDocument).document as Document.document :\n messageMedia.photo;\n\n const wrappedPrice = paymentsWrapCurrencyAmount(messageMedia.total_amount, messageMedia.currency);\n let priceEl: HTMLElement;\n if(!extendedMedia) {\n priceEl = document.createElement(innerMedia ? 'span' : 'div');\n const f = document.createDocumentFragment();\n const l = i18n(messageMedia.receipt_msg_id ? 'PaymentReceipt' : (isTest ? 'PaymentTestInvoice' : 'PaymentInvoice'));\n l.classList.add('text-uppercase');\n const joiner = ' ' + NBSP;\n const p = document.createElement('span');\n p.classList.add('text-bold');\n p.textContent = wrappedPrice + joiner;\n f.append(p, l);\n if(isTest && messageMedia.receipt_msg_id) {\n const a = document.createElement('span');\n a.classList.add('text-uppercase', 'pre-wrap');\n a.append(joiner + '(Test)');\n f.append(a);\n }\n setInnerHTML(priceEl, f);\n } else if(isNotPaid) {\n priceEl = document.createElement('span');\n priceEl.classList.add('extended-media-buy', 'tgico-premium_lock');\n attachmentDiv.classList.add('is-buy');\n _i18n(priceEl, 'Checkout.PayPrice', [wrappedPrice]);\n\n if(extendedMedia.video_duration !== undefined) {\n const videoTime = document.createElement('span');\n videoTime.classList.add('video-time');\n videoTime.textContent = toHHMMSS(extendedMedia.video_duration, false);\n attachmentDiv.append(videoTime);\n }\n }\n\n if(isNotPaid) {\n (extendedMedia.thumb as PhotoSize.photoStrippedSize).w = extendedMedia.w;\n (extendedMedia.thumb as PhotoSize.photoStrippedSize).h = extendedMedia.h;\n innerMedia = {\n _: 'photo',\n access_hash: '',\n pFlags: {},\n date: 0,\n dc_id: 0,\n file_reference: [],\n id: 0,\n sizes: [extendedMedia.thumb]\n };\n }\n\n if(innerMedia) {\n const mediaSize = extendedMedia ? mediaSizes.active.extendedInvoice : mediaSizes.active.invoice;\n if(innerMedia._ === 'document') {\n wrapVideo({\n doc: innerMedia,\n container: attachmentDiv,\n withTail: false,\n isOut,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware,\n loadPromises,\n boxWidth: mediaSize.width,\n boxHeight: mediaSize.height,\n group: this.chat.animationGroup,\n message: message as Message.message\n });\n bubble.classList.add('video');\n } else {\n wrapPhoto({\n photo: innerMedia,\n container: attachmentDiv,\n withTail: false,\n isOut,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware,\n loadPromises,\n boxWidth: mediaSize.width,\n boxHeight: mediaSize.height,\n message: isAlreadyPaid ? message : undefined\n });\n bubble.classList.add('photo');\n }\n\n if(priceEl) {\n if(!extendedMedia) {\n priceEl.classList.add('video-time');\n }\n\n attachmentDiv.append(priceEl);\n }\n } else {\n attachmentDiv = undefined;\n }\n\n if(isNotPaid) {\n const {mid} = message;\n this.extendedMediaMessages.add(mid);\n middleware.onClean(() => {\n this.extendedMediaMessages.delete(mid);\n });\n this.setExtendedMediaMessagesPollInterval();\n\n const {width, height} = attachmentDiv.style;\n const dotRenderer = DotRenderer.create({\n width: parseInt(width),\n height: parseInt(height),\n middleware,\n animationGroup: this.chat.animationGroup\n });\n attachmentDiv.append(dotRenderer.canvas);\n }\n\n let titleDiv: HTMLElement;\n if(!extendedMedia) {\n titleDiv = document.createElement('div');\n titleDiv.classList.add('bubble-primary-color');\n setInnerHTML(titleDiv, wrapEmojiText(messageMedia.title));\n }\n\n const richText = isAlreadyPaid ? undefined : wrapEmojiText(messageMedia.description);\n messageDiv.prepend(...[titleDiv, !innerMedia && priceEl, richText].filter(Boolean));\n\n if(!richText) canHaveTail = false;\n else bubble.classList.remove('is-message-empty');\n bubble.classList.add('is-invoice');\n\n break;\n }\n\n default:\n attachmentDiv = undefined;\n bubble.classList.remove('is-message-empty');\n messageDiv.append(i18n(UNSUPPORTED_LANG_PACK_KEY), timeSpan);\n this.log.warn('unrecognized media type:', messageMedia._, message);\n break;\n }\n\n if(!processingWebPage && attachmentDiv) {\n bubbleContainer.append(attachmentDiv);\n }\n\n /* if(bubble.classList.contains('is-message-empty') && (bubble.classList.contains('photo') || bubble.classList.contains('video'))) {\n bubble.classList.add('no-tail');\n\n if(!bubble.classList.contains('with-media-tail')) {\n bubble.classList.add('use-border-radius');\n }\n } */\n }\n\n if(isStandaloneMedia) {\n bubble.classList.add('just-media');\n }\n\n if(viewButton) {\n timeSpan.before(viewButton);\n // messageDiv.append(viewButton);\n }\n\n let savedFrom = '';\n\n // const needName = ((peerId.isAnyChat() && (peerId !== message.fromId || our)) && message.fromId !== rootScope.myId) || message.viaBotId;\n const needName = (message.fromId !== rootScope.myId && this.chat.isAnyGroup) || message.viaBotId || (message as Message.message).pFlags.sponsored;\n if(needName || fwdFrom || message.reply_to_mid || topicNameButtonContainer) { // chat\n let title: HTMLElement | DocumentFragment;\n let titleVia: typeof title;\n\n const isForwardFromChannel = message.from_id?._ === 'peerChannel' && message.fromId === fwdFromId;\n\n const mustHaveName = !!(message.viaBotId/* || topicNameButtonContainer */);\n const isHidden = fwdFrom && !fwdFrom.from_id;\n if(message.viaBotId) {\n titleVia = document.createElement('span');\n titleVia.innerText = '@' + (await this.managers.appPeersManager.getPeerUsername(message.viaBotId));\n titleVia.classList.add('peer-title');\n }\n\n if(mustHaveName) {\n bubble.classList.add('must-have-name');\n }\n\n const isForward = fwdFromId || fwdFrom;\n if(isHidden) {\n // /////this.log('message to render hidden', message);\n title = document.createElement('span');\n setInnerHTML(title, wrapEmojiText(fwdFrom.from_name));\n title.classList.add('peer-title');\n // title = fwdFrom.from_name;\n bubble.classList.add('hidden-profile');\n } else {\n title = new PeerTitle({peerId: fwdFromId || message.fromId, withPremiumIcon: !isForward, wrapOptions}).element;\n }\n\n let replyContainer: HTMLElement;\n if(\n isMessage &&\n message.reply_to_mid &&\n message.reply_to_mid !== this.chat.threadId &&\n (!this.chat.isAllMessagesForum || message.reply_to.reply_to_top_id)\n ) {\n replyContainer = await MessageRender.setReply({\n chat: this.chat,\n bubble,\n bubbleContainer,\n message\n });\n }\n\n // this.log(title);\n\n let nameDiv: HTMLElement;\n if(isForward) {\n if(this.peerId !== rootScope.myId && !isForwardFromChannel) {\n bubble.classList.add('forwarded');\n }\n\n if(message.savedFrom) {\n savedFrom = message.savedFrom;\n title.dataset.savedFrom = savedFrom;\n }\n\n nameDiv = document.createElement('div');\n title.dataset.peerId = '' + fwdFromId;\n\n if((this.peerId === rootScope.myId || this.peerId === REPLIES_PEER_ID || isForwardFromChannel) && !isStandaloneMedia) {\n nameDiv.style.color = getPeerColorById(fwdFromId, false);\n nameDiv.classList.add('colored-name');\n nameDiv.append(title);\n } else {\n /* const fromTitle = message.fromId === this.myID || appPeersManager.isBroadcast(fwdFromId || message.fromId) ? '' : `
${appPeersManager.getPeerTitle(message.fromId)}
`;\n nameDiv.innerHTML = fromTitle + 'Forwarded from ' + title; */\n const args: FormatterArguments = [title];\n if(isStandaloneMedia) {\n const br = document.createElement('br');\n br.classList.add('hide-ol');\n args.unshift(br);\n }\n nameDiv.append(i18n('ForwardedFrom', [args]));\n }\n } else if(!message.viaBotId) {\n if(!isStandaloneMedia && needName) {\n nameDiv = document.createElement('div');\n nameDiv.append(title);\n\n const peer = await this.managers.appPeersManager.getPeer(message.fromId);\n const pFlags = (peer as User.user)?.pFlags;\n if(pFlags && (pFlags.scam || pFlags.fake)) {\n nameDiv.append(generateFakeIcon(pFlags.scam));\n }\n\n if(!our) {\n nameDiv.style.color = getPeerColorById(message.fromId, false);\n nameDiv.classList.add('colored-name');\n }\n\n nameDiv.dataset.peerId = '' + message.fromId;\n } else /* if(!message.reply_to_mid) */ {\n bubble.classList.add('hide-name');\n }\n }\n\n if(message.viaBotId) {\n if(!nameDiv) {\n nameDiv = document.createElement('div');\n } else {\n nameDiv.append(' ');\n }\n\n const span = document.createElement('span');\n span.append(i18n('ViaBot'), ' ', titleVia);\n span.classList.add('is-via');\n\n nameDiv.append(span);\n }\n\n if(topicNameButtonContainer) {\n if(isStandaloneMedia) {\n topicNameButtonContainer.classList.add('floating-part');\n } else {\n if(!nameDiv) {\n nameDiv = document.createElement('div');\n }\n\n nameDiv.append(topicNameButtonContainer);\n\n bubble.classList.remove('hide-name');\n }\n }\n\n if(nameDiv) {\n nameDiv.classList.add('name');\n\n if(isStandaloneMedia) {\n nameContainer.append(nameContainer = document.createElement('div'));\n nameContainer.classList.add('name-with-reply', 'floating-part');\n } else {\n nameDiv.classList.add('floating-part');\n }\n\n nameContainer.append(nameDiv);\n\n if(isStandaloneMedia && replyContainer) {\n nameContainer.append(replyContainer);\n }\n } else if(isStandaloneMedia && replyContainer) {\n replyContainer.classList.add('floating-part');\n }\n\n if(topicNameButtonContainer && isStandaloneMedia) {\n if(!attachmentDiv) {\n this.log.error('no attachment div?', bubble, message);\n debugger;\n } else {\n attachmentDiv.after(topicNameButtonContainer);\n }\n }\n } else {\n bubble.classList.add('hide-name');\n }\n\n if(this.chat.type === 'pinned') {\n savedFrom = `${this.chat.peerId}_${message.mid}`;\n }\n\n const isThreadStarter = messageWithReplies && messageWithReplies.mid === this.chat.threadId;\n if(isThreadStarter) {\n bubble.classList.add('is-thread-starter', 'is-group-last');\n }\n\n if(savedFrom && (this.chat.type === 'pinned' || fwdFrom.saved_from_msg_id) && this.peerId !== REPLIES_PEER_ID) {\n const goto = document.createElement('div');\n goto.classList.add('bubble-beside-button', 'goto-original', 'tgico-arrow_next');\n bubbleContainer.append(goto);\n bubble.dataset.savedFrom = savedFrom;\n bubble.classList.add('with-beside-button');\n }\n\n bubble.classList.add(isOut ? 'is-out' : 'is-in');\n\n if(withReplies) {\n const isFooter = MessageRender.renderReplies({\n bubble,\n bubbleContainer,\n message: messageWithReplies,\n messageDiv,\n loadPromises,\n lazyLoadQueue: this.lazyLoadQueue\n });\n\n if(isFooter) {\n canHaveTail = true;\n } else {\n bubble.classList.add('with-beside-replies');\n }\n }\n\n if(isMessage) {\n this.appendReactionsElementToBubble(bubble, message, reactionsMessage);\n }\n\n /* if(isMessage) {\n const reactionHover = document.createElement('div');\n reactionHover.classList.add('bubble-reaction-hover');\n contentWrapper.append(reactionHover);\n } */\n\n if(canHaveTail) {\n bubble.classList.add('can-have-tail');\n\n bubbleContainer.append(generateTail());\n }\n\n return ret;\n }\n\n private appendReactionsElementToBubble(\n bubble: HTMLElement,\n message: Message.message,\n reactionsMessage: Message.message,\n changedResults?: ReactionCount[]\n ) {\n if(this.peerId.isUser() && USER_REACTIONS_INLINE/* || true */) {\n return;\n }\n\n if(!reactionsMessage?.reactions || !reactionsMessage.reactions.results.length) {\n return;\n }\n\n // message = this.appMessagesManager.getMessageWithReactions(message);\n\n const reactionsElement = new ReactionsElement();\n reactionsElement.init(reactionsMessage, 'block', bubble.middlewareHelper.get());\n reactionsElement.render(changedResults);\n\n if(bubble.classList.contains('is-message-empty')) {\n bubble.querySelector('.bubble-content-wrapper').append(reactionsElement);\n } else {\n const messageDiv = bubble.querySelector('.message');\n if(bubble.classList.contains('is-multiple-documents')) {\n const documentContainer = messageDiv.lastElementChild as HTMLElement;\n let documentMessageDiv = documentContainer.querySelector('.document-message');\n\n let timeSpan: HTMLElement = documentMessageDiv && documentMessageDiv.querySelector('.time');\n if(!timeSpan) {\n timeSpan = MessageRender.setTime({\n chatType: this.chat.type,\n message,\n reactionsMessage\n });\n }\n\n reactionsElement.append(timeSpan);\n\n if(!documentMessageDiv) {\n documentMessageDiv = document.createElement('div');\n documentMessageDiv.classList.add('document-message');\n documentContainer.querySelector('.document-wrapper').prepend(documentMessageDiv);\n }\n\n documentMessageDiv.append(reactionsElement);\n } else {\n const timeSpan = Array.from(bubble.querySelectorAll('.time')).pop();\n reactionsElement.append(timeSpan);\n\n messageDiv.append(reactionsElement);\n }\n }\n }\n\n private prepareToSaveScroll(reverse?: boolean) {\n const isMounted = !!this.chatInner.parentElement;\n if(!isMounted) {\n return {};\n }\n\n const log = this.log.bindPrefix('prepareToSaveScroll');\n log('save');\n const scrollSaver = this.createScrollSaver(reverse);\n scrollSaver.save(); // * let's save scroll position by point before the slicing, not after\n\n if(this.getRenderedLength() && !this.chat.setPeerPromise) {\n const viewportSlice = this.getViewportSlice();\n this.deleteViewportSlice(viewportSlice, true);\n }\n\n // scrollSaver.save(); // ! slicing will corrupt scroll position\n // const saved = scrollSaver.getSaved();\n // const hadScroll = saved.scrollHeight !== saved.clientHeight;\n\n return {\n restoreScroll: () => {\n log('restore');\n // scrollSaver.restore(_history.length === 1 && !reverse ? false : true);\n scrollSaver.restore(reverse);\n this.onRenderScrollSet(scrollSaver.getSaved());\n },\n scrollSaver\n };\n }\n\n public async performHistoryResult(\n historyResult: HistoryResult | {history: (Message.message | Message.messageService | number)[]},\n reverse: boolean\n ) {\n const log = false ? this.log.bindPrefix('perform-' + (Math.random() * 1000 | 0)) : undefined;\n log?.('start', this.chatInner.parentElement);\n\n let history = historyResult.history;\n history = history.slice(); // need\n\n if(this.needReflowScroll) {\n reflowScrollableElement(this.scrollable.container);\n this.needReflowScroll = false;\n }\n\n const cb = (message: Message.message | Message.messageService) => {\n if(!message) {\n return;\n } else if(message.pFlags.local) {\n return this.processLocalMessageRender(message);\n } else {\n return this.safeRenderMessage(message, reverse);\n }\n };\n\n const messages = await Promise.all(history.map((mid) => {\n return typeof(mid) === 'number' ? this.chat.getMessage(mid) : mid;\n }));\n\n const setLoadedPromises: Promise[] = [];\n if(!this.scrollable.loadedAll['bottom'] || !this.scrollable.loadedAll['top']) {\n let isEnd = (historyResult as HistoryResult).isEnd;\n if(!isEnd) {\n const historyStorage = await this.chat.getHistoryStorage();\n const firstSlice = historyStorage.history.first;\n const lastSlice = historyStorage.history.last;\n isEnd = {top: false, bottom: false, both: false};\n if(firstSlice.isEnd(SliceEnd.Bottom) && (!firstSlice.length || history.includes(firstSlice[0]))) {\n isEnd.bottom = true;\n }\n\n if(lastSlice.isEnd(SliceEnd.Top) && (!lastSlice.length || history.includes(lastSlice[lastSlice.length - 1]))) {\n isEnd.top = true;\n }\n }\n\n if(!isEnd.bottom && this.setPeerOptions) {\n const {lastMsgId, topMessage, savedPosition} = this.setPeerOptions;\n this.setPeerOptions = undefined;\n if((!lastMsgId && !savedPosition) || this.bubbles[topMessage] || lastMsgId === topMessage) {\n isEnd.bottom = true;\n }\n }\n\n if(isEnd.top) setLoadedPromises.push(this.setLoaded('top', true));\n if(isEnd.bottom) setLoadedPromises.push(this.setLoaded('bottom', true));\n }\n\n await Promise.all(setLoadedPromises);\n\n // ! it is important to insert bubbles to group reversed way\n // const length = history.length, promises: Promise[] = [];\n // if(reverse) for(let i = 0; i < length; ++i) promises.push(cb(messages[i]));\n // else for(let i = length - 1; i >= 0; --i) promises.push(cb(messages[i]));\n const promises = messages.map(cb);\n\n // cannot combine them into one promise\n await Promise.all(promises);\n await this.messagesQueuePromise;\n\n if(this.scrollable.loadedAll.top && this.messagesQueueOnRenderAdditional) {\n this.messagesQueueOnRenderAdditional();\n this.messagesQueueOnRenderAdditional?.(); // * can set it second time\n }\n\n log?.('performHistoryResult end');\n }\n\n private onRenderScrollSet(state?: {scrollHeight: number, clientHeight: number}) {\n const className = 'has-sticky-dates';\n if(!this.container.classList.contains(className)) {\n const isLoading = !this.preloader.detached;\n\n if(isLoading ||\n (\n state ??= {\n scrollHeight: this.scrollable.scrollHeight,\n clientHeight: this.scrollable.container.clientHeight\n },\n state.scrollHeight !== state.clientHeight\n )\n ) {\n /* for(const timestamp in this.dateMessages) {\n const dateMessage = this.dateMessages[timestamp];\n dateMessage.div.classList.add('is-sticky');\n } */\n\n const middleware = this.getMiddleware();\n const callback = () => {\n if(!middleware()) return;\n this.container.classList.add(className);\n };\n\n if(this.willScrollOnLoad) {\n callback();\n } else {\n setTimeout(callback, 600);\n }\n\n return;\n }\n }\n\n this.willScrollOnLoad = undefined;\n }\n\n public onDatePick = (timestamp: number) => {\n const peerId = this.peerId;\n this.managers.appMessagesManager.requestHistory(peerId, 0, 2, -1, timestamp, this.chat.threadId).then((history) => {\n if(!history?.messages?.length) {\n this.log.error('no history!');\n return;\n } else if(this.peerId !== peerId) {\n return;\n }\n\n this.chat.setMessageId((history.messages[0] as MyMessage).mid);\n // console.log('got history date:', history);\n });\n };\n\n public requestHistory(maxId: number, loadCount: number, backLimit: number) {\n // const middleware = this.getMiddleware();\n if(this.chat.type === 'chat' || this.chat.type === 'discussion') {\n return this.managers.acknowledged.appMessagesManager.getHistory(this.peerId, maxId, loadCount, backLimit, this.chat.threadId);\n } else if(this.chat.type === 'pinned') {\n return this.managers.acknowledged.appMessagesManager.getSearch({\n peerId: this.peerId,\n inputFilter: {_: 'inputMessagesFilterPinned'},\n maxId,\n limit: loadCount,\n backLimit\n }).then((ackedResult) => {\n return {\n cached: ackedResult.cached,\n result: Promise.resolve(ackedResult.result).then((value) => {\n return {history: value.history.map((m) => m.mid)};\n })\n };\n });\n } else if(this.chat.type === 'scheduled') {\n return this.managers.acknowledged.appMessagesManager.getScheduledMessages(this.peerId).then((ackedResult) => {\n // this.setLoaded('top', true);\n // this.setLoaded('bottom', true);\n return {\n cached: ackedResult.cached,\n result: Promise.resolve(ackedResult.result).then((mids) => ({history: mids.slice().reverse()}))\n };\n });\n }\n }\n\n private async animateAsLadder(additionMsgId: number, additionMsgIds: number[], isAdditionRender: boolean, backLimit: number, maxId: number) {\n /* const middleware = this.getMiddleware();\n await this.ladderDeferred; */\n\n const log = this.log.bindPrefix('ladder');\n if(this.chat.setPeerPromise && !this.resolveLadderAnimation) {\n log.warn('will be delayed');\n // @ts-ignore\n this.resolveLadderAnimation = this.animateAsLadder.bind(this, additionMsgId, additionMsgIds, isAdditionRender, backLimit, maxId);\n return;\n }\n\n /* if(!middleware()) {\n return;\n } */\n\n if(!Object.keys(this.bubbles).length) {\n log.warn('no bubbles');\n return;\n }\n\n let sortedMids = getObjectKeysAndSort(this.bubbles, 'desc');\n\n if(isAdditionRender && additionMsgIds.length) {\n sortedMids = sortedMids.filter((mid) => !additionMsgIds.includes(mid));\n }\n\n let targetMid: number;\n if(backLimit) {\n targetMid = maxId || Math.max(...sortedMids); // * on discussion enter\n } else {\n if(additionMsgId) {\n targetMid = additionMsgId;\n } else { // * if maxId === 0\n targetMid = Math.max(...sortedMids);\n }\n }\n\n const topIds = sortedMids.slice(sortedMids.findIndex((mid) => targetMid > mid));\n const middleIds = isAdditionRender ? [] : [targetMid];\n const bottomIds = isAdditionRender ? [] : sortedMids.slice(0, sortedMids.findIndex((mid) => targetMid >= mid)).reverse();\n\n if(DEBUG) {\n log('targeting mid:', targetMid, maxId, additionMsgId,\n topIds.map((m) => getServerMessageId(m)),\n bottomIds.map((m) => getServerMessageId(m)));\n }\n\n const setBubbles: HTMLElement[] = [];\n\n this.chatInner.classList.add('zoom-fading');\n const delay = isAdditionRender ? 10 : 40;\n const offsetIndex = isAdditionRender ? 0 : 1;\n const animateAsLadder = (mids: number[], offsetIndex = 0) => {\n const animationPromise = deferredPromise();\n let lastMsDelay = 0;\n mids.forEach((mid, idx) => {\n const bubble = this.bubbles[mid];\n if(!bubble || this.skippedMids.has(mid)) {\n log.warn('no bubble by mid:', mid);\n return;\n }\n\n lastMsDelay = ((idx + offsetIndex) || 0.1) * delay;\n // lastMsDelay = (idx + offsetIndex) * delay;\n // lastMsDelay = (idx || 0.1) * 1000;\n\n const contentWrapper = bubble.lastElementChild as HTMLElement;\n const elementsToAnimate: HTMLElement[] = [contentWrapper];\n const item = this.bubbleGroups.getItemByBubble(bubble);\n if(item && item.group.avatar && item.group.lastItem === item) {\n elementsToAnimate.push(item.group.avatar);\n }\n\n elementsToAnimate.forEach((element) => {\n element.classList.add('zoom-fade', 'can-zoom-fade');\n element.style.transitionDelay = lastMsDelay + 'ms';\n });\n\n if(idx === (mids.length - 1)) {\n const onTransitionEnd = (e: TransitionEvent) => {\n if(e.target !== contentWrapper) {\n return;\n }\n\n animationPromise.resolve();\n contentWrapper.removeEventListener('transitionend', onTransitionEnd);\n };\n\n contentWrapper.addEventListener('transitionend', onTransitionEnd);\n }\n\n setBubbles.push(...elementsToAnimate);\n });\n\n if(!mids.length) {\n animationPromise.resolve();\n }\n\n return {lastMsDelay, animationPromise};\n };\n\n const topRes = animateAsLadder(topIds, offsetIndex);\n const middleRes = animateAsLadder(middleIds);\n const bottomRes = animateAsLadder(bottomIds, offsetIndex);\n const promises = [topRes.animationPromise, middleRes.animationPromise, bottomRes.animationPromise];\n const delays: number[] = [topRes.lastMsDelay, middleRes.lastMsDelay, bottomRes.lastMsDelay];\n\n if(this.onAnimateLadder) {\n await this.onAnimateLadder();\n }\n\n fastRaf(() => {\n this.setStickyDateManually(); // ! maybe it's not efficient\n\n setBubbles.forEach((element) => {\n element.classList.remove('zoom-fade');\n });\n });\n\n let promise: Promise;\n if(topIds.length || middleIds.length || bottomIds.length) {\n promise = Promise.all(promises);\n\n dispatchHeavyAnimationEvent(promise, Math.max(...delays) + 200) // * 200 - transition time\n .then(() => {\n fastRaf(() => {\n setBubbles.forEach((element) => {\n element.style.transitionDelay = '';\n element.classList.remove('can-zoom-fade');\n });\n\n this.chatInner.classList.remove('zoom-fading');\n });\n\n // ! в хроме, каким-то образом из-за zoom-fade класса начинает прыгать скролл при подгрузке сообщений вверх,\n // ! т.е. скролл не ставится, так же, как в сафари при translateZ на блок выше scrollable\n // if(!IS_SAFARI) {\n // this.needReflowScroll = true;\n // }\n });\n }\n\n return promise;\n }\n\n private async renderEmptyPlaceholder(\n type: 'group' | 'saved' | 'noMessages' | 'noScheduledMessages' | 'greeting' | 'restricted',\n bubble: HTMLElement,\n message: any,\n elements: (Node | string)[]\n ) {\n const BASE_CLASS = 'empty-bubble-placeholder';\n bubble.classList.add(BASE_CLASS, BASE_CLASS + '-' + type);\n\n let title: HTMLElement;\n if(type === 'group') title = i18n('GroupEmptyTitle1');\n else if(type === 'saved') title = i18n('ChatYourSelfTitle');\n else if(type === 'noMessages' || type === 'greeting') title = i18n('NoMessages');\n else if(type === 'noScheduledMessages') title = i18n('NoScheduledMessages');\n else if(type === 'restricted') {\n title = document.createElement('span');\n title.innerText = await this.managers.appPeersManager.getRestrictionReasonText(this.peerId);\n }\n title.classList.add('center', BASE_CLASS + '-title');\n\n elements.push(title);\n\n let listElements: HTMLElement[];\n if(type === 'group') {\n elements.push(i18n('GroupEmptyTitle2'));\n listElements = [\n i18n('GroupDescription1'),\n i18n('GroupDescription2'),\n i18n('GroupDescription3'),\n i18n('GroupDescription4')\n ];\n } else if(type === 'saved') {\n listElements = [\n i18n('ChatYourSelfDescription1'),\n i18n('ChatYourSelfDescription2'),\n i18n('ChatYourSelfDescription3'),\n i18n('ChatYourSelfDescription4')\n ];\n } else if(type === 'greeting') {\n const subtitle = i18n('NoMessagesGreetingsDescription');\n subtitle.classList.add('center', BASE_CLASS + '-subtitle');\n\n // findAndSplice(this.messagesQueue, q => q.bubble === bubble);\n\n const stickerDiv = document.createElement('div');\n stickerDiv.classList.add(BASE_CLASS + '-sticker');\n\n const middleware = this.getMiddleware();\n\n await this.managers.appStickersManager.getGreetingSticker().then(async(doc) => {\n if(!middleware()) return;\n\n const loadPromises: Promise[] = [];\n await wrapSticker({\n doc,\n // doc: appDocsManager.getDoc(\"5431607541660389336\"), // cubigator mockup\n div: stickerDiv,\n middleware,\n lazyLoadQueue: this.lazyLoadQueue,\n group: this.chat.animationGroup,\n // play: !!message.pending || !multipleRender,\n play: true,\n loop: true,\n withThumb: true,\n loadPromises,\n liteModeKey: 'stickers_chat'\n });\n\n attachClickEvent(stickerDiv, (e) => {\n cancelEvent(e);\n EmoticonsDropdown.onMediaClick({target: e.target});\n });\n\n return Promise.all(loadPromises);\n });\n\n // this.renderMessagesQueue({\n // message,\n // bubble,\n // reverse: false,\n // promises: [loadPromise]\n // });\n\n elements.push(subtitle, stickerDiv);\n }\n\n if(listElements) {\n elements.push(\n ...listElements.map((elem) => {\n const span = document.createElement('span');\n span.classList.add(BASE_CLASS + '-list-item');\n span.append(elem);\n return span;\n })\n );\n\n if(type === 'group') {\n listElements.forEach((elem) => {\n const i = document.createElement('span');\n i.classList.add('tgico-check');\n elem.prepend(i);\n });\n } else if(type === 'saved') {\n listElements.forEach((elem) => {\n const i = document.createElement('span');\n i.classList.add(BASE_CLASS + '-list-bullet');\n i.innerText = '•';\n elem.prepend(i);\n });\n }\n }\n\n if(elements.length > 1) {\n bubble.classList.add('has-description');\n }\n\n elements.forEach((element: any) => element.classList.add(BASE_CLASS + '-line'));\n }\n\n private async processLocalMessageRender(\n message: Message.message | Message.messageService,\n animate?: boolean,\n middleware = this.getMiddleware()\n ) {\n const isSponsored = !!(message as Message.message).pFlags.sponsored;\n const m = middlewarePromise(middleware);\n\n const p: Parameters[4] = async(result) => {\n const {bubble} = await m(result);\n if(!bubble) {\n return result;\n }\n\n (bubble as any).message = message;\n\n bubble.classList.add('is-group-last', 'is-group-first');\n\n const updatePosition = () => {\n if(this.updatePlaceholderPosition === updatePosition) {\n this.updatePlaceholderPosition = undefined;\n }\n\n appendTo[method](bubble);\n };\n\n if(!isSponsored) {\n bubble.classList.add('bubble-first');\n bubble.classList.remove('can-have-tail', 'is-in');\n }\n\n const elements: (Node | string)[] = [];\n const isBot = this.chat.isBot;\n let renderPromise: Promise, appendTo = this.container, method: 'append' | 'prepend' = 'append';\n if(this.chat.isRestricted) {\n renderPromise = this.renderEmptyPlaceholder('restricted', bubble, message, elements);\n } else if(isSponsored) {\n let text: LangPackKey, mid: number, startParam: string, callback: () => void;\n\n bubble.classList.add('avoid-selection');\n bubble.style.order = '999999';\n\n const sponsoredMessage = this.sponsoredMessage = (message as Message.message).sponsoredMessage;\n const peerId = getPeerId(sponsoredMessage.from_id);\n // const peer = this.appPeersManager.getPeer(peerId);\n if(sponsoredMessage.channel_post) {\n text = 'OpenChannelPost';\n mid = generateMessageId(sponsoredMessage.channel_post);\n } else if(sponsoredMessage.start_param || isBot) {\n text = 'Chat.Message.ViewBot';\n startParam = sponsoredMessage.start_param;\n } else {\n text = await this.managers.appPeersManager.isAnyGroup(peerId) ? 'Chat.Message.ViewGroup' : 'Chat.Message.ViewChannel';\n }\n\n if(sponsoredMessage.chat_invite) {\n callback = () => {\n PopupElement.createPopup(PopupJoinChatInvite, sponsoredMessage.chat_invite_hash, sponsoredMessage.chat_invite as ChatInvite.chatInvite);\n };\n } else if(sponsoredMessage.chat_invite_hash) {\n callback = () => {\n const link: InternalLink = {\n _: INTERNAL_LINK_TYPE.JOIN_CHAT,\n invite: sponsoredMessage.chat_invite_hash\n };\n\n this.chat.appImManager.processInternalLink(link);\n };\n } else {\n callback = () => {\n this.chat.appImManager.setInnerPeer({\n peerId,\n lastMsgId: mid,\n startParam\n });\n };\n }\n\n const button = this.makeViewButton({text});\n\n this.observer.observe(button, this.viewsObserverCallback);\n\n if(callback) {\n attachClickEvent(button, callback);\n }\n\n bubble.querySelector('.bubble-content').prepend(button);\n\n appendTo = this.chatInner;\n method = 'append';\n animate = false;\n\n // return result;\n } else if(isBot && message._ === 'message') {\n const b = document.createElement('b');\n b.append(i18n('BotInfoTitle'));\n elements.push(b, '\\n\\n');\n appendTo = this.chatInner;\n method = 'prepend';\n } else if(this.chat.isAnyGroup && ((await m(this.managers.appPeersManager.getPeer(this.peerId))) as MTChat.chat).pFlags.creator) {\n renderPromise = this.renderEmptyPlaceholder('group', bubble, message, elements);\n } else if(this.chat.type === 'scheduled') {\n renderPromise = this.renderEmptyPlaceholder('noScheduledMessages', bubble, message, elements);\n } else if(rootScope.myId === this.peerId) {\n renderPromise = this.renderEmptyPlaceholder('saved', bubble, message, elements);\n } else if(this.peerId.isUser() && !isBot && await m(this.chat.canSend()) && this.chat.type === 'chat') {\n renderPromise = this.renderEmptyPlaceholder('greeting', bubble, message, elements);\n } else {\n renderPromise = this.renderEmptyPlaceholder('noMessages', bubble, message, elements);\n }\n\n if(renderPromise) {\n await renderPromise;\n }\n\n if(elements.length) {\n const messageDiv = bubble.querySelector('.message, .service-msg');\n messageDiv.prepend(...elements);\n }\n\n const isWaitingForAnimation = !!this.messagesQueueOnRenderAdditional;\n const noTransition = this.setPeerCached && !isWaitingForAnimation;\n if(noTransition) {\n const setOn = bubble.firstElementChild;\n setOn.classList.add('no-transition');\n\n if(this.chat.setPeerPromise) {\n this.chat.setPeerPromise.catch(noop).finally(() => {\n setOn.classList.remove('no-transition');\n });\n }\n }\n\n if(animate === undefined && !noTransition) {\n animate = true;\n }\n\n if(isWaitingForAnimation || animate) {\n this.updatePlaceholderPosition = updatePosition;\n\n this.onAnimateLadder = () => {\n // appendTo[method](bubble);\n this.onAnimateLadder = undefined;\n\n // need raf here because animation won't fire if this message is single\n if(!this.messagesQueuePromise) {\n return fastRafPromise();\n }\n };\n } else if(this.chat.setPeerPromise) {\n this.attachPlaceholderOnRender = () => {\n this.attachPlaceholderOnRender = undefined;\n updatePosition();\n // appendTo[method](bubble);\n };\n } else {\n this.updatePlaceholderPosition = updatePosition;\n // appendTo[method](bubble);\n }\n\n if(!isWaitingForAnimation && animate) {\n await m(getHeavyAnimationPromise());\n const additionMsgIds = getObjectKeysAndSort(this.bubbles);\n indexOfAndSplice(additionMsgIds, message.mid);\n this.animateAsLadder(message.mid, additionMsgIds, false, 0, 0);\n }\n\n bubble.middlewareHelper.onDestroy(() => {\n if(this.emptyPlaceholderBubble === bubble) {\n this.emptyPlaceholderBubble = undefined;\n }\n });\n\n this.emptyPlaceholderBubble = bubble;\n\n return result;\n };\n\n return this.safeRenderMessage(\n message,\n !isSponsored,\n undefined,\n false,\n p\n );\n }\n\n private makeViewButton[1]>(options: T) {\n return Button('btn-primary btn-primary-transparent bubble-view-button', options);\n }\n\n private generateLocalMessageId(addOffset = 0) {\n // const INCREMENT = 0x10;\n const offset = (this.chat.type === 'scheduled' ? -1 : 0) + addOffset;\n // offset = generateMessageId(offset);\n // id: -Math.abs(+this.peerId * INCREMENT + offset),\n const id = -Math.abs(offset);\n const mid = -Math.abs(generateMessageId(id));\n return {id, mid};\n }\n\n private async generateLocalFirstMessage(service?: T, fill?: (message: GenerateLocalMessageType) => void, addOffset = 0): Promise> {\n const {id, mid} = this.generateLocalMessageId(addOffset);\n let message: Omit & {message?: string} = {\n _: service ? 'messageService' : 'message',\n date: 0,\n id,\n mid,\n peer_id: await this.managers.appPeersManager.getOutputPeer(this.peerId),\n pFlags: {\n local: true\n }\n };\n\n if(!service) {\n message.message = '';\n }/* else {\n (message as Message.messageService).action = {} as any;\n } */\n\n assumeType>(message);\n\n fill && fill(message);\n\n const savedMessages = await this.managers.appMessagesManager.saveMessages([message], {storage: new Map() as any});\n message = savedMessages[0];\n message.mid = mid;\n return message as any;\n }\n\n public getViewportSlice() {\n // this.log.trace('viewport slice');\n return getViewportSlice({\n overflowElement: this.scrollable.container,\n selector: '.bubbles-date-group .bubble:not(.is-date)',\n extraSize: Math.max(700, windowSize.height) * 2\n });\n }\n\n public deleteViewportSlice(slice: ReturnType, ignoreScrollSaving?: boolean) {\n if(DO_NOT_SLICE_VIEWPORT_ON_RENDER) {\n return;\n }\n\n const {invisibleTop, invisibleBottom} = slice;\n const invisible = invisibleTop.concat(invisibleBottom);\n if(!invisible.length) {\n return;\n }\n\n if(invisibleTop.length) {\n this.setLoaded('top', false);\n this.getHistoryTopPromise = undefined;\n }\n\n if(invisibleBottom.length) {\n this.setLoaded('bottom', false);\n this.getHistoryBottomPromise = undefined;\n }\n\n const mids = invisible.map(({element}) => +element.dataset.mid);\n\n let scrollSaver: ScrollSaver;\n if(/* !!invisibleTop.length !== !!invisibleBottom.length && */!ignoreScrollSaving) {\n scrollSaver = this.createScrollSaver(!!invisibleTop.length);\n scrollSaver.save();\n }\n\n this.deleteMessagesByIds(mids, false, true);\n\n if(scrollSaver) {\n scrollSaver.restore();\n } else if(invisibleTop.length) {\n this.scrollable.lastScrollPosition = this.scrollable.scrollTop;\n }\n }\n\n public sliceViewport(ignoreHeavyAnimation?: boolean) {\n // Safari cannot reset the scroll.\n if(IS_SAFARI || (this.isHeavyAnimationInProgress && !ignoreHeavyAnimation) || DO_NOT_SLICE_VIEWPORT) {\n return;\n }\n\n // const scrollSaver = new ScrollSaver(this.scrollable, true);\n // scrollSaver.save();\n const slice = this.getViewportSlice();\n // if(IS_SAFARI) slice.invisibleTop = [];\n this.deleteViewportSlice(slice);\n // scrollSaver.restore();\n }\n\n private async setLoaded(side: SliceSides, value: boolean, checkPlaceholders = true) {\n const willChange = this.scrollable.loadedAll[side] !== value;\n if(!willChange) {\n return;\n }\n\n const log = this.log.bindPrefix('setLoaded');\n log('change', side, value);\n\n this.scrollable.loadedAll[side] = value;\n this.scrollable.onScroll(); // ! WARNING\n // return;\n\n if(!checkPlaceholders) {\n return;\n }\n\n if(!this.chat.isRestricted) {\n if(side === 'bottom' && this.chat.isBroadcast/* && false */) {\n this.toggleSponsoredMessage(value);\n }\n\n if(side === 'top' && value && this.chat.isBot) {\n return this.renderBotPlaceholder();\n }\n }\n\n return this.checkIfEmptyPlaceholderNeeded();\n }\n\n private async toggleSponsoredMessage(value: boolean) {\n const log = this.log.bindPrefix('sponsored');\n log('checking');\n const {mid} = this.generateLocalMessageId(SPONSORED_MESSAGE_ID_OFFSET);\n if(value) {\n const middleware = this.getMiddleware(() => {\n return this.scrollable.loadedAll.bottom && this.getSponsoredMessagePromise === promise;\n });\n\n const promise = this.getSponsoredMessagePromise = this.managers.appChatsManager.getSponsoredMessage(this.peerId.toChatId())\n .then(async(sponsoredMessages) => {\n if(!middleware() || sponsoredMessages._ === 'messages.sponsoredMessagesEmpty') {\n return;\n }\n\n const sponsoredMessage = sponsoredMessages.messages[0];\n if(!sponsoredMessage) {\n log('no message');\n return;\n }\n\n const messagePromise = this.generateLocalFirstMessage(false, (message) => {\n message.message = sponsoredMessage.message;\n message.from_id = sponsoredMessage.from_id;\n message.entities = sponsoredMessage.entities;\n message.pFlags.sponsored = true;\n message.sponsoredMessage = sponsoredMessage;\n }, SPONSORED_MESSAGE_ID_OFFSET);\n\n return Promise.all([\n messagePromise,\n this.getHistoryTopPromise, // wait for top load and execute rendering after or with it\n this.messagesQueuePromise\n ]).then(([message]) => {\n if(!middleware()) return;\n // this.processLocalMessageRender(message);\n log('rendering', message);\n return this.performHistoryResult({history: [message]}, false);\n });\n }).finally(() => {\n if(this.getSponsoredMessagePromise === promise) {\n this.getSponsoredMessagePromise = undefined;\n }\n });\n } else {\n log('clearing rendered', mid);\n this.getSponsoredMessagePromise = undefined;\n this.deleteMessagesByIds([mid]);\n }\n }\n\n private async renderBotPlaceholder() {\n const _log = this.log.bindPrefix('bot placeholder');\n\n const middleware = this.getMiddleware();\n const result = await this.managers.acknowledged.appProfileManager.getProfile(this.peerId.toUserId());\n _log('getting profile, cached:', result.cached);\n const processPromise = result.result.then(async(userFull) => {\n if(!middleware()) {\n return;\n }\n\n if(!userFull.bot_info?.description) {\n _log.warn('no description');\n return this.checkIfEmptyPlaceholderNeeded();\n }\n\n const message = await this.generateLocalFirstMessage(false, (message) => {\n const botInfo = userFull.bot_info;\n message.message = botInfo.description;\n if(botInfo.description_document) message.media = {_: 'messageMediaDocument', document: botInfo.description_document, pFlags: {}};\n if(botInfo.description_photo) message.media = {_: 'messageMediaPhoto', photo: botInfo.description_photo, pFlags: {}};\n });\n\n if(!middleware()) {\n return;\n }\n\n _log('rendering');\n const renderPromise = this.processLocalMessageRender(message, !result.cached).then(() => {\n _log('done');\n });\n\n return {renderPromise};\n });\n\n if(!result.cached) {\n return;\n }\n\n return processPromise;\n }\n\n public async checkIfEmptyPlaceholderNeeded() {\n if(this.scrollable.loadedAll.top &&\n this.scrollable.loadedAll.bottom &&\n this.emptyPlaceholderBubble === undefined &&\n (\n this.chat.isRestricted ||\n !(await this.chat.getHistoryStorage()).count ||\n (\n // !Object.keys(this.bubbles).length ||\n // ! WARNING ! ! ! ! ! ! REPLACE LINE ABOVE WITH THESE\n Object.keys(this.bubbles).length &&\n !this.getRenderedLength()\n ) ||\n (this.chat.type === 'scheduled' && !Object.keys(this.bubbles).length)\n )\n ) {\n this.log('inject empty peer placeholder');\n\n const message = await this.generateLocalFirstMessage(true);\n return {renderPromise: this.processLocalMessageRender(message)};\n }\n }\n\n public getHistory1(maxId?: number, reverse?: boolean, isBackLimit?: boolean, additionMsgId?: number, justLoad?: boolean) {\n const middleware = this.getMiddleware(justLoad ? undefined : () => {\n return (reverse ? this.getHistoryTopPromise : this.getHistoryBottomPromise) === waitPromise;\n });\n\n const result = this.getHistory(maxId, reverse, isBackLimit, additionMsgId, justLoad, middleware);\n const waitPromise = result.then((res) => res && (res.waitPromise || res.promise));\n\n (reverse ? this.getHistoryTopPromise = waitPromise : this.getHistoryBottomPromise = waitPromise);\n waitPromise.then(() => {\n if(!middleware()) {\n return;\n }\n\n (reverse ? this.getHistoryTopPromise = undefined : this.getHistoryBottomPromise = undefined);\n\n if(!justLoad) {\n // preload more\n // if(!isFirstMessageRender) {\n if(this.chat.type === 'chat'/* || this.chat.type === 'discussion' */) {\n /* const storage = this.appMessagesManager.getHistoryStorage(peerId, this.chat.threadId);\n const isMaxIdInHistory = storage.history.indexOf(maxId) !== -1;\n if(isMaxIdInHistory || true) { // * otherwise it is a search or jump */\n setTimeout(() => {\n if(reverse) {\n this.loadMoreHistory(true, true);\n } else {\n this.loadMoreHistory(false, true);\n }\n }, 0);\n // }\n }\n // }\n\n // this.scrollable.onScroll();\n }\n });\n\n return result;\n }\n\n // private async getDiscussionMessages() {\n // const mids = await this.chat.getMidsByMid(this.chat.threadId);\n // return Promise.all(mids.map((mid) => this.chat.getMessage(mid)));\n // }\n\n /**\n * Load and render history\n * @param maxId max message id\n * @param reverse 'true' means up\n * @param isBackLimit is search\n * @param additionMsgId for the last message\n * @param justLoad do not render\n */\n public async getHistory(\n maxId = 0,\n reverse = false,\n isBackLimit = false,\n additionMsgId = 0,\n justLoad = false,\n middleware?: () => boolean\n ): Promise<{cached: boolean, promise: Promise, waitPromise: Promise}> {\n const peerId = this.peerId;\n\n const isBroadcast = this.chat.isBroadcast;\n // console.time('appImManager call getHistory');\n const pageCount = Math.min(30, windowSize.height / 40/* * 1.25 */ | 0);\n // const loadCount = Object.keys(this.bubbles).length > 0 ? 50 : pageCount;\n const realLoadCount = isBroadcast ? 20 : (Object.keys(this.bubbles).length > 0 ? Math.max(35, pageCount) : pageCount);\n // const realLoadCount = pageCount;//const realLoadCount = 50;\n let loadCount = realLoadCount;\n\n /* if(TEST_SCROLL) {\n //loadCount = 1;\n if(Object.keys(this.bubbles).length > 0)\n return {cached: false, promise: Promise.resolve(true)};\n } */\n if(TEST_SCROLL !== undefined) {\n if(TEST_SCROLL) {\n if(Object.keys(this.bubbles).length > 0) {\n --TEST_SCROLL;\n }\n } else {\n return {cached: false, promise: Promise.resolve(), waitPromise: Promise.resolve()};\n }\n }\n\n // //console.time('render history total');\n\n let backLimit = 0;\n if(isBackLimit) {\n backLimit = loadCount;\n\n if(!reverse) { // if not jump\n loadCount = 0;\n // maxId = this.appMessagesManager.incrementMessageId(maxId, 1);\n }\n }\n\n let additionMsgIds: number[];\n if(additionMsgId && !isBackLimit) {\n if(this.chat.type === 'pinned') {\n additionMsgIds = [additionMsgId];\n } else {\n const historyStorage = await this.chat.getHistoryStorage();\n const slice = historyStorage.history.slice;\n if(slice.length < loadCount && !slice.isEnd(SliceEnd.Both)) {\n additionMsgIds = slice.slice();\n\n // * filter last album, because we don't know is it the last item\n for(let i = additionMsgIds.length - 1; i >= 0; --i) {\n const message = await this.chat.getMessage(additionMsgIds[i]);\n if((message as Message.message)?.grouped_id) additionMsgIds.splice(i, 1);\n else break;\n }\n\n maxId = additionMsgIds[additionMsgIds.length - 1] || maxId;\n }\n }\n }\n\n /* const result = additionMsgID ?\n {history: [additionMsgID]} :\n appMessagesManager.getHistory(this.peerId, maxId, loadCount, backLimit); */\n let result: AckedResult = await this.requestHistory(maxId, loadCount, backLimit) as any;\n let resultPromise: typeof result['result'];\n\n this.log('i vin brehnya', result, maxId, loadCount, backLimit);\n\n // const isFirstMessageRender = !!additionMsgID && result.cached && !appMessagesManager.getMessage(additionMsgID).grouped_id;\n const isAdditionRender = additionMsgIds?.length && !result.cached;\n const isFirstMessageRender = (this.isFirstLoad && backLimit && !result.cached) || isAdditionRender;\n if(isAdditionRender) {\n resultPromise = result.result;\n\n result = {\n cached: true,\n result: Promise.resolve({history: additionMsgIds})\n };\n\n // additionMsgID = 0;\n }\n\n this.isFirstLoad = false;\n\n const processResult = async(historyResult: Awaited) => {\n if((historyResult as HistoryResult).isEnd?.top) {\n if(this.chat.type === 'discussion') { // * inject discussion start\n const serviceStartMessageId = await this.managers.appMessagesManager.getThreadServiceMessageId(this.peerId, this.chat.threadId);\n if(serviceStartMessageId) historyResult.history.push(serviceStartMessageId);\n const mids = await this.chat.getMidsByMid(this.chat.threadId);\n historyResult.history.push(...mids.reverse());\n }\n\n // synchronize bot placeholder appearance\n await this.managers.appProfileManager.getProfileByPeerId(peerId);\n\n // await this.setLoaded('top', true);\n }\n };\n\n const sup = (historyResult: Awaited) => {\n return getHeavyAnimationPromise().then(() => {\n return processResult(historyResult);\n }).then(() => {\n if(!isAdditionRender && additionMsgId) {\n historyResult.history.unshift(additionMsgId);\n }\n\n return this.performHistoryResult(historyResult, reverse);\n });\n };\n\n const processPromise = (_promise: typeof result['result']) => {\n const promise = Promise.resolve(_promise).then((result) => {\n if(middleware && !middleware()) {\n throw PEER_CHANGED_ERROR;\n }\n\n if(justLoad) {\n // нужно делать из-за ранней прогрузки\n this.scrollable.onScroll();\n // fastRaf(() => {\n // this.scrollable.checkForTriggers();\n // });\n return;\n }\n\n return sup(result);\n }, (err) => {\n this.log.error('getHistory error:', err);\n throw err;\n });\n\n return promise;\n };\n\n let promise: Promise, cached: boolean;\n if(!result.cached) {\n cached = false;\n promise = processPromise(result.result);\n } else if(justLoad) {\n // нужно делать из-за ранней прогрузки\n this.scrollable.onScroll();\n return null;\n } else {\n cached = true;\n promise = sup(await result.result);\n }\n\n const waitPromise = isAdditionRender ? processPromise(resultPromise) : promise;\n\n if(isFirstMessageRender && liteMode.isAvailable('animations')/* && false */) {\n let times = isAdditionRender ? 2 : 1;\n this.messagesQueueOnRenderAdditional = () => {\n this.log('messagesQueueOnRenderAdditional');\n\n if(--times) return;\n\n this.messagesQueueOnRenderAdditional = undefined;\n\n const promise = this.animateAsLadder(additionMsgId, additionMsgIds, isAdditionRender, backLimit, maxId);\n promise.then(() => {\n setTimeout(() => { // preload messages\n this.loadMoreHistory(reverse, true);\n }, 0);\n });\n };\n } else {\n this.messagesQueueOnRenderAdditional = undefined;\n }\n\n if(justLoad) {\n return null;\n }\n\n return {cached, promise, waitPromise};\n }\n\n public async setUnreadDelimiter() {\n if(!(this.chat.type === 'chat' || this.chat.type === 'discussion')) {\n return;\n }\n\n if(this.attachedUnreadBubble) {\n return;\n }\n\n const historyMaxId = await this.chat.getHistoryMaxId();\n let readMaxId = await this.managers.appMessagesManager.getReadMaxIdIfUnread(this.peerId, this.chat.threadId);\n if(!readMaxId) return;\n\n readMaxId = Object.keys(this.bubbles)\n .filter((mid) => !this.bubbles[mid].classList.contains('is-out'))\n .map((i) => +i)\n .sort((a, b) => a - b)\n .find((i) => i > readMaxId);\n\n if(readMaxId && this.bubbles[readMaxId]) {\n const bubble = this.bubbles[readMaxId];\n if(this.firstUnreadBubble && this.firstUnreadBubble !== bubble) {\n this.firstUnreadBubble.classList.remove('is-first-unread');\n this.firstUnreadBubble = null;\n }\n\n if(readMaxId !== historyMaxId) {\n bubble.classList.add('is-first-unread');\n }\n\n this.firstUnreadBubble = bubble;\n this.attachedUnreadBubble = true;\n }\n }\n\n public deleteEmptyDateGroups() {\n const mustBeCount = this.stickyIntersector ? STICKY_OFFSET : 1;\n let deleted = false;\n for(const i in this.dateMessages) {\n const dateMessage = this.dateMessages[i];\n\n if(dateMessage.container.childElementCount === mustBeCount) { // only date div + sentinel div\n dateMessage.container.remove();\n if(this.stickyIntersector) {\n this.stickyIntersector.unobserve(dateMessage.container, dateMessage.div);\n }\n delete this.dateMessages[i];\n deleted = true;\n\n // * no sense in it\n /* if(dateMessage.div === this.previousStickyDate) {\n this.previousStickyDate = undefined;\n } */\n }\n }\n\n if(!deleted) {\n return;\n }\n\n if(!Object.keys(this.dateMessages).length) {\n this.container.classList.remove('has-groups');\n }\n\n this.checkIfEmptyPlaceholderNeeded();\n this.setStickyDateManually();\n }\n}\n\nexport function generateTail() {\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttributeNS(null, 'viewBox', '0 0 11 20');\n svg.setAttributeNS(null, 'width', '11');\n svg.setAttributeNS(null, 'height', '20');\n svg.classList.add('bubble-tail');\n\n const use = document.createElementNS('http://www.w3.org/2000/svg', 'use');\n use.setAttributeNS(null, 'href', '#message-tail-filled');\n\n svg.append(use);\n\n return svg;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {copyTextToClipboard} from '../clipboard';\n// import SelectionSaver from \"../selectionSaver\";\n// import selectElementContents from \"./selectElementContents\";\n\nexport default function copyFromElement(element: HTMLElement) {\n copyTextToClipboard(element.textContent);\n // const saver = new SelectionSaver();\n // saver.save();\n // selectElementContents(element);\n // document.execCommand('copy');\n // saver.restore();\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport {MediaSizeType} from '../../helpers/mediaSizes';\nimport {Message} from '../../layer';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getMediaDurationFromMessage from '../../lib/appManagers/utils/messages/getMediaDurationFromMessage';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\nimport {MediaSearchContext} from '../appMediaPlaybackController';\nimport Chat from '../chat/chat';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport wrapDocument from './document';\n\nexport default async function wrapGroupedDocuments({\n albumMustBeRenderedFull,\n message,\n bubble,\n messageDiv,\n chat,\n loadPromises,\n autoDownloadSize,\n lazyLoadQueue,\n searchContext,\n useSearch,\n sizeType,\n managers,\n fontWeight,\n fontSize,\n richTextFragment,\n richTextOptions,\n canTranscribeVoice\n}: {\n albumMustBeRenderedFull: boolean,\n message: any,\n messageDiv: HTMLElement,\n bubble: HTMLElement,\n uploading?: boolean,\n chat: Chat,\n loadPromises?: Promise[],\n autoDownloadSize?: number,\n lazyLoadQueue?: LazyLoadQueue,\n searchContext?: MediaSearchContext,\n useSearch?: boolean,\n sizeType?: MediaSizeType,\n managers?: AppManagers,\n fontWeight?: number,\n fontSize?: number,\n richTextFragment?: DocumentFragment,\n richTextOptions?: Parameters[1]\n canTranscribeVoice?: boolean\n}) {\n let nameContainer: HTMLElement;\n const mids = albumMustBeRenderedFull ? await chat.getMidsByMid(message.mid) : [message.mid];\n /* if(isPending) {\n mids.reverse();\n } */\n\n const promises = mids.map(async(mid, idx) => {\n const message = (await chat.getMessage(mid)) as Message.message;\n const div = await wrapDocument({\n message,\n loadPromises,\n autoDownloadSize,\n lazyLoadQueue,\n searchContext,\n sizeType,\n managers,\n fontWeight,\n fontSize,\n canTranscribeVoice\n });\n\n const container = document.createElement('div');\n container.classList.add('document-container');\n container.dataset.mid = '' + mid;\n container.dataset.peerId = '' + message.peerId;\n\n const wrapper = document.createElement('div');\n wrapper.classList.add('document-wrapper');\n\n if(message.message) {\n const messageDiv = document.createElement('div');\n messageDiv.classList.add('document-message');\n\n let fragment = richTextFragment;\n if(!fragment) {\n fragment = wrapRichText(message.message, {\n ...richTextOptions,\n entities: message.totalEntities,\n maxMediaTimestamp: getMediaDurationFromMessage(message)\n });\n }\n\n setInnerHTML(messageDiv, fragment);\n\n wrapper.append(messageDiv);\n }\n\n if(mids.length > 1) {\n const selection = document.createElement('div');\n selection.classList.add('document-selection');\n container.append(selection);\n\n container.classList.add('grouped-item');\n\n if(idx === 0) {\n nameContainer = wrapper;\n }\n }\n\n wrapper.append(div);\n container.append(wrapper);\n return container;\n });\n\n const containers = await Promise.all(promises);\n messageDiv.append(...containers);\n\n if(mids.length > 1) {\n bubble.classList.add('is-multiple-documents', 'is-grouped');\n }\n\n return nameContainer;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport rootScope from '../../lib/rootScope';\nimport PollElement from '../poll';\n\nexport default function wrapPoll(message: any, managers: AppManagers = rootScope.managers) {\n const elem = new PollElement();\n elem.message = message;\n elem.managers = managers;\n elem.setAttribute('peer-id', '' + message.peerId);\n elem.setAttribute('poll-id', message.media.poll.id);\n elem.setAttribute('message-id', '' + message.mid);\n elem.render();\n return elem;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {ReportReason} from '../../layer';\nimport InputField from '../inputField';\nimport {toastNew} from '../toast';\nimport wrapStickerEmoji from '../wrappers/stickerEmoji';\nimport PopupPeer from './peer';\n\nexport default class PopupReportMessagesConfirm extends PopupPeer {\n public static STICKER_EMOJI = '👮‍♀️';\n constructor(peerId: PeerId, mids: number[], reason: ReportReason['_'], onConfirm?: () => void) {\n super('popup-report-messages-confirm', {\n noTitle: true,\n descriptionLangKey: 'ReportInfo',\n buttons: [{\n langKey: 'ReportChat',\n callback: () => {\n if(!inputField.isValid()) {\n return;\n }\n\n onConfirm && onConfirm();\n this.managers.appMessagesManager.reportMessages(peerId, mids, reason, inputField.value).then((bool) => {\n if(!bool) return;\n\n toastNew({\n langPackKey: 'ReportSentInfo'\n });\n });\n }\n }],\n body: true\n });\n\n const div = document.createElement('div');\n const size = 100;\n wrapStickerEmoji({\n div,\n emoji: PopupReportMessagesConfirm.STICKER_EMOJI,\n width: size,\n height: size\n }).then(({render}) => render).finally(() => {\n this.show();\n });\n\n this.header.replaceWith(div);\n\n const inputField = new InputField({\n label: 'ReportHint',\n maxLength: 512,\n placeholder: 'ReportChatDescription'\n });\n\n inputField.input.addEventListener('input', () => {\n this.buttons[0].element.toggleAttribute('disabled', !inputField.isValid());\n });\n\n this.body.append(inputField.container);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport whichChild from '../../helpers/dom/whichChild';\nimport preloadAnimatedEmojiSticker from '../../helpers/preloadAnimatedEmojiSticker';\nimport {ReportReason} from '../../layer';\nimport {LangPackKey} from '../../lib/langPack';\nimport Button from '../button';\nimport PopupPeer from './peer';\nimport PopupReportMessagesConfirm from './reportMessagesConfirm';\n\nexport default class PopupReportMessages extends PopupPeer {\n constructor(peerId: PeerId, mids: number[], onConfirm?: () => void) {\n super('popup-report-messages', {titleLangKey: 'ChatTitle.ReportMessages', buttons: [], body: true});\n\n mids = mids.slice();\n\n const buttons: [LangPackKey, ReportReason['_']][] = [\n ['ReportChatSpam', 'inputReportReasonSpam'],\n ['ReportChatViolence', 'inputReportReasonViolence'],\n ['ReportChatChild', 'inputReportReasonChildAbuse'],\n ['ReportChatPornography', 'inputReportReasonPornography'],\n ['ReportChatOther', 'inputReportReasonOther'],\n ['ReportChatPersonalDetails', 'inputReportReasonPersonalDetails'],\n ['ReportChatIllegalDrugs', 'inputReportReasonIllegalDrugs']\n ];\n\n const className = 'btn-primary btn-transparent';\n buttons.forEach((b) => {\n const button = Button(className, {/* icon: 'edit', */text: b[0]});\n this.body.append(button);\n });\n\n const preloadStickerPromise = preloadAnimatedEmojiSticker(PopupReportMessagesConfirm.STICKER_EMOJI);\n\n attachClickEvent(this.body, (e) => {\n const target = findUpClassName(e.target, 'btn-primary');\n const reason = buttons[whichChild(target)][1];\n\n preloadStickerPromise.then(() => {\n this.hide();\n\n PopupElement.createPopup(PopupReportMessagesConfirm, peerId, mids, reason, onConfirm);\n });\n }, {listenerSetter: this.listenerSetter});\n\n // this.body.style.margin = '0 -1rem';\n this.buttonsEl.style.marginTop = '.5rem';\n\n this.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport I18n, {i18n} from '../../lib/langPack';\nimport PopupPeer from './peer';\n\nexport default class PopupSponsored extends PopupPeer {\n constructor() {\n super('popup-sponsored', {\n titleLangKey: 'Chat.Message.Sponsored.What',\n descriptionLangKey: 'Chat.Message.Ad.Text',\n descriptionLangArgs: [i18n('Chat.Message.Sponsored.Link')],\n buttons: [{\n langKey: 'OK',\n isCancel: true\n }, {\n langKey: 'Chat.Message.Ad.ReadMore',\n callback: () => {\n window.open(I18n.format('Chat.Message.Sponsored.Link', true));\n },\n isCancel: true\n }],\n scrollable: true\n });\n\n this.scrollable.append(this.description);\n\n this.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport {Message, Reaction} from '../../layer';\nimport ReactionsElement from '../chat/reactions';\nimport {horizontalMenu} from '../horizontalMenu';\nimport Scrollable from '../scrollable';\nimport ScrollableLoader from '../../helpers/scrollableLoader';\nimport appDialogsManager from '../../lib/appManagers/appDialogsManager';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport wrapSticker from '../wrappers/sticker';\nimport ReactionElement from '../chat/reaction';\nimport getUserStatusString from '../wrappers/getUserStatusString';\nimport {makeMediaSize} from '../../helpers/mediaSize';\nimport wrapCustomEmoji from '../wrappers/customEmoji';\nimport SettingSection from '../settingSection';\n\nexport default class PopupReactedList extends PopupElement {\n constructor(\n private message: Message.message\n ) {\n super('popup-reacted-list', {closable: true, overlayClosable: true, body: true});\n\n this.init();\n }\n\n private async init() {\n const middleware = this.middlewareHelper.get();\n const message = await this.managers.appMessagesManager.getGroupsFirstMessage(this.message);\n if(!middleware()) return;\n const canViewReadParticipants = await this.managers.appMessagesManager.canViewMessageReadParticipants(message);\n if(!middleware()) return;\n // this.body.append(generateDelimiter());\n\n const reactionsElement = new ReactionsElement();\n const newMessage: Message.message = {\n ...message,\n mid: 0,\n id: 0,\n reactions: {\n _: 'messageReactions',\n results: [],\n\n ...message.reactions,\n\n pFlags: {},\n recent_reactions: []\n }\n };\n\n newMessage.reactions.results = newMessage.reactions.results.map((reactionCount) => {\n return {\n ...reactionCount,\n chosen_order: undefined,\n pFlags: {}\n };\n });\n\n reactionsElement.init(newMessage, 'block', this.middlewareHelper.get());\n reactionsElement.render();\n reactionsElement.classList.add('no-stripe');\n reactionsElement.classList.remove('has-no-reactions');\n\n reactionsElement.append(this.btnClose);\n\n this.header.append(reactionsElement);\n\n const tabsContainer = document.createElement('div');\n tabsContainer.classList.add('tabs-container');\n tabsContainer.dataset.animation = 'tabs';\n\n const loaders: Map = new Map();\n\n let hasAllReactions = false;\n if(newMessage.reactions.results.length) {\n const reaction = this.createFakeReaction('reactions', newMessage.reactions.results.reduce((acc, r) => acc + r.count, 0));\n\n reactionsElement.prepend(reaction);\n newMessage.reactions.results.unshift(reaction.reactionCount);\n hasAllReactions = true;\n }\n\n let hasReadParticipants = false;\n if(canViewReadParticipants) {\n try {\n const readUserIds = await this.managers.appMessagesManager.getMessageReadParticipants(message.peerId, message.mid);\n if(!middleware()) return;\n if(!readUserIds.length) {\n throw '';\n }\n\n const reaction = this.createFakeReaction('checks', readUserIds.length);\n\n reactionsElement.prepend(reaction);\n newMessage.reactions.results.unshift(reaction.reactionCount);\n hasReadParticipants = true;\n } catch(err) {\n\n }\n }\n\n newMessage.reactions.results.forEach((reactionCount) => {\n const scrollable = new Scrollable(undefined);\n scrollable.container.classList.add('tabs-tab');\n\n const section = new SettingSection({\n noShadow: true,\n noDelimiter: true\n });\n\n const chatlist = appDialogsManager.createChatList({\n dialogSize: 72\n });\n\n appDialogsManager.setListClickListener(chatlist, () => {\n this.hide();\n }, undefined, false, true);\n\n section.content.append(chatlist);\n scrollable.container.append(section.container);\n\n const skipReadParticipants = (reactionCount.reaction as any) !== 'checks';\n const skipReactionsList = (reactionCount.reaction as any) === 'checks';\n if(['checks', 'reactions'].includes(reactionCount.reaction as any)) {\n reactionCount.reaction = undefined;\n }\n\n const size = 24;\n const mediaSize = makeMediaSize(size, size);\n\n let nextOffset: string;\n const loader = new ScrollableLoader({\n scrollable,\n getPromise: async() => {\n const result = await this.managers.appMessagesManager.getMessageReactionsListAndReadParticipants(message, undefined, reactionCount.reaction, nextOffset, skipReadParticipants, skipReactionsList);\n nextOffset = result.nextOffset;\n\n await Promise.all(result.combined.map(async({peerId, reaction}) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: peerId,\n autonomous: true,\n container: chatlist,\n avatarSize: 'abitbigger',\n rippleEnabled: false,\n meAsSaved: false\n });\n\n if(reaction) {\n const stickerContainer = document.createElement('div');\n stickerContainer.classList.add('reacted-list-reaction-icon');\n\n if(reaction._ === 'reactionEmoji') {\n const availableReaction = await this.managers.appReactionsManager.getReactionCached(reaction.emoticon);\n\n wrapSticker({\n doc: availableReaction.static_icon,\n div: stickerContainer,\n width: 24,\n height: 24,\n middleware\n });\n } else if(reaction._ === 'reactionCustomEmoji') {\n stickerContainer.append(wrapCustomEmoji({\n docIds: [reaction.document_id],\n customEmojiSize: mediaSize,\n middleware\n }));\n }\n\n dom.listEl.append(stickerContainer);\n }\n\n replaceContent(dom.lastMessageSpan, getUserStatusString(await this.managers.appUsersManager.getUser(peerId.toUserId())));\n }));\n\n return !nextOffset;\n }\n });\n\n loaders.set(scrollable.container, loader);\n\n tabsContainer.append(scrollable.container);\n });\n\n this.body.append(tabsContainer);\n\n const selectTab = horizontalMenu(reactionsElement, tabsContainer, (id, tabContent) => {\n if(id === (reactionsElement.childElementCount - 1)) {\n return false;\n }\n\n const reaction = reactionsElement.children[id] as ReactionElement;\n const prevId = selectTab.prevId();\n if(prevId !== -1) {\n (reactionsElement.children[prevId] as ReactionElement).setIsChosen(false);\n }\n\n reaction.setIsChosen(true);\n\n const loader = loaders.get(tabContent);\n loader.load();\n }, undefined, undefined, undefined, this.listenerSetter);\n\n // selectTab(hasAllReactions && hasReadParticipants ? 1 : 0, false);\n selectTab(0, false);\n\n this.show();\n }\n\n private createFakeReaction(icon: string, count: number) {\n const reaction = new ReactionElement();\n reaction.init('block', this.middlewareHelper.get());\n reaction.reactionCount = {\n _: 'reactionCount',\n count: count,\n reaction: icon as any\n };\n reaction.setCanRenderAvatars(false);\n reaction.renderCounter();\n\n const allReactionsSticker = document.createElement('div');\n allReactionsSticker.classList.add('reaction-counter', 'reaction-sticker-icon', 'tgico-' + icon);\n reaction.prepend(allReactionsSticker);\n\n return reaction;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport {IS_MOBILE, IS_SAFARI} from '../../environment/userAgent';\nimport assumeType from '../../helpers/assumeType';\nimport callbackify from '../../helpers/callbackify';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport getVisibleRect from '../../helpers/dom/getVisibleRect';\nimport liteMode from '../../helpers/liteMode';\nimport {getMiddleware} from '../../helpers/middleware';\nimport noop from '../../helpers/noop';\nimport {fastRaf} from '../../helpers/schedulers';\nimport {Message, AvailableReaction, Reaction} from '../../layer';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport lottieLoader from '../../lib/rlottie/lottieLoader';\nimport RLottiePlayer from '../../lib/rlottie/rlottiePlayer';\nimport rootScope from '../../lib/rootScope';\nimport animationIntersector, {AnimationItemGroup} from '../animationIntersector';\nimport Scrollable, {ScrollableBase, ScrollableX} from '../scrollable';\nimport wrapSticker from '../wrappers/sticker';\n\nconst REACTIONS_CLASS_NAME = 'btn-menu-reactions';\nconst REACTION_CLASS_NAME = REACTIONS_CLASS_NAME + '-reaction';\n\nconst REACTION_SIZE = 26;\nconst PADDING = 4;\nexport const REACTION_CONTAINER_SIZE = REACTION_SIZE + PADDING * 2;\n\nconst CAN_USE_TRANSFORM = !IS_SAFARI;\n\ntype ChatReactionsMenuPlayers = {\n select?: RLottiePlayer,\n appear?: RLottiePlayer,\n selectWrapper: HTMLElement,\n appearWrapper: HTMLElement,\n reaction: Reaction\n};\nexport class ChatReactionsMenu {\n public widthContainer: HTMLElement;\n public container: HTMLElement;\n private reactionsMap: Map;\n public scrollable: ScrollableBase;\n private animationGroup: AnimationItemGroup;\n private middleware: ReturnType;\n private message: Message.message;\n\n constructor(\n private managers: AppManagers,\n private type: 'horizontal' | 'vertical',\n middleware: ChatReactionsMenu['middleware']\n ) {\n const widthContainer = this.widthContainer = document.createElement('div');\n widthContainer.classList.add(REACTIONS_CLASS_NAME + '-container');\n widthContainer.classList.add(REACTIONS_CLASS_NAME + '-container-' + type);\n\n const reactionsContainer = this.container = document.createElement('div');\n reactionsContainer.classList.add(REACTIONS_CLASS_NAME);\n\n const reactionsScrollable = this.scrollable = type === 'vertical' ? new Scrollable(undefined) : new ScrollableX(undefined);\n reactionsContainer.append(reactionsScrollable.container);\n reactionsScrollable.onAdditionalScroll = this.onScroll;\n reactionsScrollable.setListeners();\n\n reactionsScrollable.container.classList.add('no-scrollbar');\n\n // ['big'].forEach((type) => {\n // const bubble = document.createElement('div');\n // bubble.classList.add(REACTIONS_CLASS_NAME + '-bubble', REACTIONS_CLASS_NAME + '-bubble-' + type);\n // reactionsContainer.append(bubble);\n // });\n\n this.reactionsMap = new Map();\n this.animationGroup = `CHAT-MENU-REACTIONS-${Date.now()}`;\n animationIntersector.setOverrideIdleGroup(this.animationGroup, true);\n\n if(!IS_TOUCH_SUPPORTED) {\n reactionsContainer.addEventListener('mousemove', this.onMouseMove);\n }\n\n attachClickEvent(reactionsContainer, (e) => {\n const reactionDiv = findUpClassName(e.target, REACTION_CLASS_NAME);\n if(!reactionDiv) return;\n\n const players = this.reactionsMap.get(reactionDiv);\n if(!players) return;\n\n this.managers.appReactionsManager.sendReaction(this.message, players.reaction);\n });\n\n widthContainer.append(reactionsContainer);\n\n this.middleware = middleware ?? getMiddleware();\n }\n\n public init(message: Message.message) {\n this.message = message;\n\n const middleware = this.middleware.get();\n // const result = Promise.resolve(this.appReactionsManager.getAvailableReactionsForPeer(message.peerId)).then((res) => pause(1000).then(() => res));\n const result = this.managers.appReactionsManager.getAvailableReactionsByMessage(message);\n callbackify(result, (reactions) => {\n if(!middleware() || !reactions.length) return;\n reactions.forEach((reaction) => {\n if(reaction.pFlags.premium && !rootScope.premium) return;\n this.renderReaction(reaction);\n });\n\n const setVisible = () => {\n this.container.classList.add('is-visible');\n };\n\n if(result instanceof Promise) {\n fastRaf(setVisible);\n } else {\n setVisible();\n }\n });\n }\n\n public cleanup() {\n this.middleware.clean();\n this.scrollable.removeListeners();\n this.reactionsMap.clear();\n animationIntersector.setOverrideIdleGroup(this.animationGroup, false);\n animationIntersector.checkAnimations(true, this.animationGroup, true);\n }\n\n private onScroll = () => {\n this.reactionsMap.forEach((players, div) => {\n this.onScrollProcessItem(div, players);\n });\n };\n\n private canUseAnimations() {\n return liteMode.isAvailable('animations') && liteMode.isAvailable('stickers_chat') && !IS_MOBILE;\n }\n\n private renderReaction(reaction: AvailableReaction) {\n const reactionDiv = document.createElement('div');\n reactionDiv.classList.add(REACTION_CLASS_NAME);\n\n const scaleContainer = document.createElement('div');\n scaleContainer.classList.add(REACTION_CLASS_NAME + '-scale');\n\n const appearWrapper = document.createElement('div');\n let selectWrapper: HTMLElement;;\n appearWrapper.classList.add(REACTION_CLASS_NAME + '-appear');\n\n if(this.canUseAnimations()) {\n selectWrapper = document.createElement('div');\n selectWrapper.classList.add(REACTION_CLASS_NAME + '-select', 'hide');\n }\n\n const players: ChatReactionsMenuPlayers = {\n selectWrapper,\n appearWrapper,\n reaction: {_: 'reactionEmoji', emoticon: reaction.reaction}\n };\n this.reactionsMap.set(reactionDiv, players);\n\n const middleware = this.middleware.get();\n\n const hoverScale = IS_TOUCH_SUPPORTED ? 1 : 1.25;\n const size = REACTION_SIZE * hoverScale;\n\n const options = {\n width: size,\n height: size,\n skipRatio: 1,\n needFadeIn: false,\n withThumb: false,\n group: this.animationGroup,\n middleware\n };\n\n if(!this.canUseAnimations()) {\n delete options.needFadeIn;\n delete options.withThumb;\n\n wrapSticker({\n doc: reaction.static_icon,\n div: appearWrapper,\n liteModeKey: false,\n ...options\n });\n } else {\n let isFirst = true;\n wrapSticker({\n doc: reaction.appear_animation,\n div: appearWrapper,\n play: true,\n liteModeKey: false,\n ...options\n }).then(({render}) => render).then((player) => {\n assumeType(player);\n\n players.appear = player;\n\n player.addEventListener('enterFrame', (frameNo) => {\n if(player.maxFrame === frameNo) {\n selectLoadPromise.then((selectPlayer) => {\n assumeType(selectPlayer);\n appearWrapper.classList.add('hide');\n selectWrapper.classList.remove('hide');\n\n if(isFirst) {\n players.select = selectPlayer;\n isFirst = false;\n }\n }, noop);\n }\n });\n }, noop);\n\n const selectLoadPromise = wrapSticker({\n doc: reaction.select_animation,\n div: selectWrapper,\n liteModeKey: false,\n ...options\n }).then(({render}) => render).then((player) => {\n assumeType(player);\n\n return lottieLoader.waitForFirstFrame(player);\n }).catch(noop);\n }\n\n scaleContainer.append(appearWrapper);\n selectWrapper && scaleContainer.append(selectWrapper);\n reactionDiv.append(scaleContainer);\n this.scrollable.append(reactionDiv);\n }\n\n private onScrollProcessItem(div: HTMLElement, players: ChatReactionsMenuPlayers) {\n // return;\n\n const scaleContainer = div.firstElementChild as HTMLElement;\n const visibleRect = getVisibleRect(div, this.scrollable.container);\n let transform: string;\n if(!visibleRect) {\n if(!players.appearWrapper.classList.contains('hide') || !players.appear) {\n return;\n }\n\n if(players.select) {\n players.select.stop();\n }\n\n players.appear.stop();\n players.appear.autoplay = true;\n players.appearWrapper.classList.remove('hide');\n players.selectWrapper.classList.add('hide');\n\n transform = '';\n } else if(visibleRect.overflow.left || visibleRect.overflow.right) {\n const diff = Math.abs(visibleRect.rect.left - visibleRect.rect.right);\n const scale = Math.min(diff ** 2 / REACTION_CONTAINER_SIZE ** 2, 1);\n\n transform = 'scale(' + scale + ')';\n } else {\n transform = '';\n }\n\n if(CAN_USE_TRANSFORM) {\n scaleContainer.style.transform = transform;\n }\n }\n\n private onMouseMove = (e: MouseEvent) => {\n const reactionDiv = findUpClassName(e.target, REACTION_CLASS_NAME);\n if(!reactionDiv) {\n return;\n }\n\n const players = this.reactionsMap.get(reactionDiv);\n if(!players) {\n return;\n }\n\n // do not play select animation when appearing\n if(!players.appear?.paused) {\n return;\n }\n\n const player = players.select;\n if(!player) {\n return;\n }\n\n if(player.paused) {\n player.autoplay = true;\n player.restart();\n }\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport type Chat from './chat';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport ButtonMenu, {ButtonMenuItemOptions} from '../buttonMenu';\nimport PopupDeleteMessages from '../popups/deleteMessages';\nimport PopupForward from '../popups/forward';\nimport PopupPinMessage from '../popups/unpinMessage';\nimport {copyTextToClipboard} from '../../helpers/clipboard';\nimport PopupSendNow from '../popups/sendNow';\nimport {toast} from '../toast';\nimport I18n, {i18n, LangPackKey} from '../../lib/langPack';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent, simulateClickEvent} from '../../helpers/dom/clickEvent';\nimport isSelectionEmpty from '../../helpers/dom/isSelectionEmpty';\nimport {Message, Poll, Chat as MTChat, MessageMedia, AvailableReaction, MessageEntity, InputStickerSet, StickerSet, Document, Reaction, Photo} from '../../layer';\nimport PopupReportMessages from '../popups/reportMessages';\nimport assumeType from '../../helpers/assumeType';\nimport PopupSponsored from '../popups/sponsored';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport {getMiddleware} from '../../helpers/middleware';\nimport PeerTitle from '../peerTitle';\nimport StackedAvatars from '../stackedAvatars';\nimport {IS_APPLE} from '../../environment/userAgent';\nimport PopupReactedList from '../popups/reactedList';\nimport {ChatReactionsMenu, REACTION_CONTAINER_SIZE} from './reactionsMenu';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport getServerMessageId from '../../lib/appManagers/utils/messageId/getServerMessageId';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport positionMenu, {MenuPositionPadding} from '../../helpers/positionMenu';\nimport contextMenuController from '../../helpers/contextMenuController';\nimport {attachContextMenuListener} from '../../helpers/dom/attachContextMenuListener';\nimport filterAsync from '../../helpers/array/filterAsync';\nimport appDownloadManager, {DownloadBlob} from '../../lib/appManagers/appDownloadManager';\nimport {SERVICE_PEER_ID} from '../../lib/mtproto/mtproto_config';\nimport {MessagesStorageKey, MyMessage} from '../../lib/appManagers/appMessagesManager';\nimport filterUnique from '../../helpers/array/filterUnique';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport PopupStickers from '../popups/stickers';\nimport getMediaFromMessage from '../../lib/appManagers/utils/messages/getMediaFromMessage';\nimport canSaveMessageMedia from '../../lib/appManagers/utils/messages/canSaveMessageMedia';\nimport getAlbumText from '../../lib/appManagers/utils/messages/getAlbumText';\nimport PopupElement from '../popups';\n\nexport default class ChatContextMenu {\n private buttons: (ButtonMenuItemOptions & {verify: () => boolean | Promise, notDirect?: () => boolean, withSelection?: true, isSponsored?: true, localName?: 'views' | 'emojis'})[];\n private element: HTMLElement;\n\n private isSelectable: boolean;\n private isSelected: boolean;\n private target: HTMLElement;\n private isTargetAGroupedItem: boolean;\n private isTextSelected: boolean;\n private isAnchorTarget: boolean;\n private isUsernameTarget: boolean;\n private isSponsored: boolean;\n private isOverBubble: boolean;\n private peerId: PeerId;\n private mid: number;\n private message: Message.message | Message.messageService;\n private noForwards: boolean;\n\n private reactionsMenu: ChatReactionsMenu;\n private listenerSetter: ListenerSetter;\n private attachListenerSetter: ListenerSetter;\n\n private viewerPeerId: PeerId;\n private middleware: ReturnType;\n private canOpenReactedList: boolean;\n\n private emojiInputsPromise: CancellablePromise;\n private albumMessages: Message.message[];\n private linkToMessage: Awaited>;\n private selectedMessagesText: string;\n private selectedMessages: MyMessage[];\n\n constructor(\n private chat: Chat,\n private managers: AppManagers\n ) {\n this.listenerSetter = new ListenerSetter();\n this.attachListenerSetter = new ListenerSetter();\n this.middleware = getMiddleware();\n }\n\n public attachTo(element: HTMLElement) {\n this.attachListenerSetter.removeAll();\n\n if(IS_TOUCH_SUPPORTED/* && false */) {\n attachClickEvent(element, (e) => {\n if(this.chat.selection.isSelecting) {\n return;\n }\n\n this.chat.log('touchend', e);\n\n const badSelectors = [\n '.name',\n '.peer-title',\n '.reply',\n '.document',\n 'audio-element',\n 'avatar-element',\n 'a',\n '.bubble-beside-button',\n 'replies-element',\n '[data-saved-from]:not(.bubble)',\n 'poll-element',\n '.attachment',\n '.reply-markup-button'\n ];\n const good = !(e.target as HTMLElement).closest(badSelectors.join(', '));\n if(good) {\n cancelEvent(e);\n // onContextMenu((e as TouchEvent).changedTouches[0]);\n // onContextMenu((e as TouchEvent).changedTouches ? (e as TouchEvent).changedTouches[0] : e as MouseEvent);\n this.onContextMenu(e);\n }\n }, {listenerSetter: this.attachListenerSetter});\n } else attachContextMenuListener({\n element,\n callback: this.onContextMenu,\n listenerSetter: this.attachListenerSetter\n });\n }\n\n private onContextMenu = (e: MouseEvent | Touch | TouchEvent) => {\n let bubble: HTMLElement, contentWrapper: HTMLElement;\n\n try {\n contentWrapper = findUpClassName(e.target, 'bubble-content-wrapper');\n bubble = contentWrapper ? contentWrapper.parentElement : findUpClassName(e.target, 'bubble');\n } catch(e) {}\n\n // ! context menu click by date bubble (there is no pointer-events)\n if(!bubble || bubble.classList.contains('bubble-first')) return;\n\n let element = this.element;\n if(e instanceof MouseEvent || e.hasOwnProperty('preventDefault')) (e as any).preventDefault();\n if(element && element.classList.contains('active')) {\n return false;\n }\n if(e instanceof MouseEvent || e.hasOwnProperty('cancelBubble')) (e as any).cancelBubble = true;\n\n let mid = +bubble.dataset.mid;\n if(!mid) return;\n\n const r = async() => {\n const isSponsored = this.isSponsored = mid < 0;\n this.isSelectable = this.chat.selection.canSelectBubble(bubble);\n this.peerId = this.chat.peerId;\n // this.msgID = msgID;\n this.target = e.target as HTMLElement;\n this.isTextSelected = !isSelectionEmpty();\n this.isAnchorTarget = this.target.tagName === 'A' && (\n (this.target as HTMLAnchorElement).target === '_blank' ||\n this.target.classList.contains('anchor-url')\n );\n this.isUsernameTarget = this.target.tagName === 'A' && this.target.classList.contains('mention');\n\n const mids = await this.chat.getMidsByMid(mid);\n // * если открыть контекстное меню для альбома не по бабблу, и последний элемент не выбран, чтобы показать остальные пункты\n if(this.chat.selection.isSelecting && !contentWrapper) {\n if(isSponsored) {\n return;\n }\n\n if(mids.length > 1) {\n const selectedMid = this.chat.selection.isMidSelected(this.peerId, mid) ?\n mid :\n mids.find((mid) => this.chat.selection.isMidSelected(this.peerId, mid));\n if(selectedMid) {\n mid = selectedMid;\n }\n }\n }\n\n this.isOverBubble = !!contentWrapper;\n\n const groupedItem = findUpClassName(this.target, 'grouped-item');\n this.isTargetAGroupedItem = !!groupedItem;\n if(groupedItem) {\n this.mid = +groupedItem.dataset.mid;\n } else {\n this.mid = mid;\n }\n\n this.isSelected = this.chat.selection.isMidSelected(this.peerId, this.mid);\n this.message = (bubble as any).message || await this.chat.getMessage(this.mid);\n this.albumMessages = (this.message as Message.message).grouped_id ? await this.managers.appMessagesManager.getMessagesByAlbum((this.message as Message.message).grouped_id) : undefined;\n this.noForwards = !isSponsored && !(await this.managers.appMessagesManager.canForward(this.message));\n this.viewerPeerId = undefined;\n this.canOpenReactedList = undefined;\n this.linkToMessage = await this.getUrlToMessage();\n this.selectedMessagesText = await this.getSelectedMessagesText();\n this.selectedMessages = this.chat.selection.isSelecting ? await this.chat.selection.getSelectedMessages() : undefined;\n\n const initResult = await this.init();\n if(!initResult) {\n return;\n }\n\n element = initResult.element;\n const {cleanup, destroy, menuPadding, reactionsMenu, reactionsMenuPosition} = initResult;\n let isReactionsMenuVisible = false;\n if(reactionsMenu) {\n const className = 'is-visible';\n isReactionsMenuVisible = reactionsMenu.container.classList.contains(className);\n if(isReactionsMenuVisible) reactionsMenu.container.classList.remove(className);\n\n if(reactionsMenuPosition === 'horizontal') {\n const offsetSize = element[/* reactionsMenuPosition === 'vertical' ? 'offsetHeight' : */'offsetWidth'];\n // if(reactionsMenu.scrollable.container.scrollWidth > offsetWidth) {\n const INNER_CONTAINER_PADDING = 8;\n const visibleLength = (offsetSize - INNER_CONTAINER_PADDING) / REACTION_CONTAINER_SIZE;\n const nextVisiblePart = visibleLength % 1;\n const MIN_NEXT_VISIBLE_PART = 0.65;\n if(nextVisiblePart < MIN_NEXT_VISIBLE_PART) {\n const minSize = (offsetSize + (MIN_NEXT_VISIBLE_PART - nextVisiblePart) * REACTION_CONTAINER_SIZE) | 0;\n element.style[/* reactionsMenuPosition === 'vertical' ? 'minHeight' : */'minWidth'] = minSize + 'px';\n }\n // }\n }\n }\n\n const side: 'left' | 'right' = bubble.classList.contains('is-in') ? 'left' : 'right';\n // bubble.parentElement.append(element);\n // appImManager.log('contextmenu', e, bubble, side);\n positionMenu((e as TouchEvent).touches ? (e as TouchEvent).touches[0] : e as MouseEvent, element, side, menuPadding);\n\n if(reactionsMenu) {\n reactionsMenu.widthContainer.style.top = element.style.top;\n reactionsMenu.widthContainer.style.left = element.style.left;\n reactionsMenu.widthContainer.style.setProperty('--menu-width', element[reactionsMenuPosition === 'vertical' ? 'offsetHeight' : 'offsetWidth'] + 'px');\n element.parentElement.append(reactionsMenu.widthContainer);\n if(isReactionsMenuVisible) void reactionsMenu.container.offsetLeft; // reflow\n }\n\n contextMenuController.openBtnMenu(element, () => {\n if(reactionsMenu) {\n reactionsMenu.container.classList.remove('is-visible');\n }\n\n this.mid = 0;\n this.peerId = undefined;\n this.target = null;\n this.viewerPeerId = undefined;\n this.canOpenReactedList = undefined;\n cleanup();\n\n setTimeout(() => {\n destroy();\n }, 300);\n });\n\n if(isReactionsMenuVisible) {\n reactionsMenu.container.classList.add('is-visible');\n }\n };\n\n r();\n };\n\n public cleanup() {\n this.listenerSetter.removeAll();\n this.reactionsMenu && this.reactionsMenu.cleanup();\n this.middleware.clean();\n }\n\n public destroy() {\n this.cleanup();\n this.attachListenerSetter.removeAll();\n }\n\n private async filterButtons(buttons: ChatContextMenu['buttons']) {\n if(this.isSponsored) {\n return buttons.filter((button) => {\n return button.isSponsored;\n });\n } else {\n return filterAsync(buttons, async(button) => {\n let good: boolean;\n\n // if((appImManager.chatSelection.isSelecting && !button.withSelection) || (button.withSelection && !appImManager.chatSelection.isSelecting)) {\n if(this.chat.selection.isSelecting && !button.withSelection) {\n good = false;\n } else {\n good = this.isOverBubble || IS_TOUCH_SUPPORTED || true ?\n await button.verify() :\n button.notDirect && await button.verify() && button.notDirect();\n }\n\n return !!good;\n });\n }\n }\n\n private setButtons() {\n const verifyFavoriteSticker = async(toAdd: boolean) => {\n const doc = ((this.message as Message.message).media as MessageMedia.messageMediaDocument)?.document;\n if(!(doc as MyDocument)?.sticker) {\n return false;\n }\n\n const favedStickers = await this.managers.acknowledged.appStickersManager.getFavedStickersStickers();\n if(!favedStickers.cached) {\n return false;\n }\n\n const found = (await favedStickers.result).some((_doc) => _doc.id === doc.id);\n return toAdd ? !found : found;\n };\n\n this.buttons = [{\n icon: 'send2',\n text: 'MessageScheduleSend',\n onClick: this.onSendScheduledClick,\n verify: () => this.chat.type === 'scheduled' && !this.message.pFlags.is_outgoing\n }, {\n icon: 'send2',\n text: 'Message.Context.Selection.SendNow',\n onClick: this.onSendScheduledClick,\n verify: () => this.chat.type === 'scheduled' && this.isSelected && !this.chat.selection.selectionSendNowBtn.hasAttribute('disabled'),\n notDirect: () => true,\n withSelection: true\n }, {\n icon: 'schedule',\n text: 'MessageScheduleEditTime',\n onClick: () => {\n this.chat.input.scheduleSending(() => {\n assumeType(this.message);\n this.managers.appMessagesManager.editMessage(this.message, this.message.message, {\n scheduleDate: this.chat.input.scheduleDate,\n entities: this.message.entities\n });\n\n this.chat.input.onMessageSent(false, false);\n }, new Date(this.message.date * 1000));\n },\n verify: () => this.chat.type === 'scheduled'\n }, {\n icon: 'reply',\n text: 'Reply',\n onClick: this.onReplyClick,\n verify: async() => await this.chat.canSend() &&\n !this.message.pFlags.is_outgoing &&\n !!this.chat.input.messageInput &&\n this.chat.type !== 'scheduled'/* ,\n cancelEvent: true */\n }, {\n icon: 'favourites',\n text: 'AddToFavorites',\n onClick: this.onFaveStickerClick.bind(this, false),\n verify: () => verifyFavoriteSticker(true)\n }, {\n icon: 'favourites',\n text: 'DeleteFromFavorites',\n onClick: this.onFaveStickerClick.bind(this, true),\n verify: () => verifyFavoriteSticker(false)\n }, {\n icon: 'edit',\n text: 'Edit',\n onClick: this.onEditClick,\n verify: async() => (await this.managers.appMessagesManager.canEditMessage(this.message, 'text')) && !!this.chat.input.messageInput\n }, {\n icon: 'copy',\n text: 'Copy',\n onClick: this.onCopyClick,\n verify: () => !this.noForwards && !!(this.message as Message.message).message && !this.isTextSelected && (!this.isAnchorTarget || (this.message as Message.message).message !== this.target.innerText)\n }, {\n icon: 'copy',\n text: 'Chat.CopySelectedText',\n onClick: this.onCopyClick,\n verify: () => !this.noForwards && !!(this.message as Message.message).message && this.isTextSelected\n }, {\n icon: 'copy',\n text: 'Message.Context.Selection.Copy',\n onClick: this.onCopyClick,\n verify: async() => {\n if(!this.isSelected || this.noForwards) {\n return false;\n }\n\n for(const [peerId, mids] of this.chat.selection.selectedMids) {\n const storageKey: MessagesStorageKey = `${peerId}_${this.chat.type === 'scheduled' ? 'scheduled' : 'history'}`;\n for(const mid of mids) {\n const message = (await this.managers.appMessagesManager.getMessageFromStorage(storageKey, mid)) as Message.message;\n if(!!message.message) {\n return true;\n }\n }\n }\n\n return false;\n },\n notDirect: () => true,\n withSelection: true\n }, {\n icon: 'copy',\n text: 'CopyLink',\n onClick: this.onCopyAnchorLinkClick,\n verify: () => this.isAnchorTarget,\n withSelection: true\n }, {\n icon: 'copy',\n text: 'Text.Context.Copy.Username',\n onClick: () => {\n copyTextToClipboard(this.target.innerHTML);\n },\n verify: () => this.isUsernameTarget,\n withSelection: true\n }, {\n icon: 'copy',\n text: 'Text.Context.Copy.Hashtag',\n onClick: () => {\n copyTextToClipboard(this.target.innerHTML);\n },\n verify: () => this.target.classList.contains('anchor-hashtag'),\n withSelection: true\n }, {\n icon: 'link',\n text: 'MessageContext.CopyMessageLink1',\n onClick: this.onCopyLinkClick,\n verify: async() => await this.managers.appPeersManager.isChannel(this.peerId) && !this.message.pFlags.is_outgoing\n }, {\n icon: 'pin',\n text: 'Message.Context.Pin',\n onClick: this.onPinClick,\n verify: async() => !this.message.pFlags.is_outgoing &&\n this.message._ !== 'messageService' &&\n !this.message.pFlags.pinned &&\n await this.managers.appPeersManager.canPinMessage(this.peerId) &&\n this.chat.type !== 'scheduled'\n }, {\n icon: 'unpin',\n text: 'Message.Context.Unpin',\n onClick: this.onUnpinClick,\n verify: async() => (this.message as Message.message).pFlags.pinned && await this.managers.appPeersManager.canPinMessage(this.peerId)\n }, {\n icon: 'download',\n text: 'MediaViewer.Context.Download',\n onClick: () => ChatContextMenu.onDownloadClick(this.message, this.noForwards),\n verify: () => ChatContextMenu.canDownload(this.message, this.target, this.noForwards)\n }, {\n icon: 'checkretract',\n text: 'Chat.Poll.Unvote',\n onClick: this.onRetractVote,\n verify: () => {\n const poll = (this.message as any).media?.poll as Poll;\n return poll && poll.chosenIndexes.length && !poll.pFlags.closed && !poll.pFlags.quiz;\n }/* ,\n cancelEvent: true */\n }, {\n icon: 'stop',\n text: 'Chat.Poll.Stop',\n onClick: this.onStopPoll,\n verify: async() => {\n const poll = (this.message as any).media?.poll;\n return await this.managers.appMessagesManager.canEditMessage(this.message, 'poll') && poll && !poll.pFlags.closed && !this.message.pFlags.is_outgoing;\n }/* ,\n cancelEvent: true */\n }, {\n icon: 'forward',\n text: 'Forward',\n onClick: this.onForwardClick, // let forward the message if it's outgoing but not ours (like a changelog)\n verify: () => !this.noForwards && this.chat.type !== 'scheduled' && (!this.message.pFlags.is_outgoing || this.message.fromId === SERVICE_PEER_ID) && this.message._ !== 'messageService'\n }, {\n icon: 'forward',\n text: 'Message.Context.Selection.Forward',\n onClick: this.onForwardClick,\n verify: () => this.chat.selection.selectionForwardBtn &&\n this.isSelected &&\n !this.chat.selection.selectionForwardBtn.hasAttribute('disabled'),\n notDirect: () => true,\n withSelection: true\n }, {\n icon: 'download',\n text: 'Message.Context.Selection.Download',\n onClick: () => ChatContextMenu.onDownloadClick(this.selectedMessages, this.noForwards),\n verify: () => this.selectedMessages && ChatContextMenu.canDownload(this.selectedMessages, undefined, this.noForwards),\n withSelection: true\n }, {\n icon: 'flag',\n text: 'ReportChat',\n onClick: () => {\n PopupElement.createPopup(PopupReportMessages, this.peerId, [this.mid]);\n },\n verify: async() => !this.message.pFlags.out && this.message._ === 'message' && !this.message.pFlags.is_outgoing && await this.managers.appPeersManager.isChannel(this.peerId),\n notDirect: () => true,\n withSelection: true\n }, {\n icon: 'select',\n text: 'Message.Context.Select',\n onClick: this.onSelectClick,\n verify: () => !(this.message as Message.messageService).action && !this.isSelected && this.isSelectable,\n notDirect: () => true,\n withSelection: true\n }, {\n icon: 'select',\n text: 'Message.Context.Selection.Clear',\n onClick: this.onClearSelectionClick,\n verify: () => this.isSelected,\n notDirect: () => true,\n withSelection: true\n }, {\n onClick: () => {\n if(this.viewerPeerId) {\n this.chat.appImManager.setInnerPeer({\n peerId: this.viewerPeerId\n });\n } else if(this.canOpenReactedList) {\n PopupElement.createPopup(PopupReactedList, this.message as Message.message);\n } else {\n return false;\n }\n },\n verify: async() => !this.peerId.isUser() && (!!(this.message as Message.message).reactions?.recent_reactions?.length || await this.managers.appMessagesManager.canViewMessageReadParticipants(this.message)),\n notDirect: () => true,\n localName: 'views'\n }, {\n icon: 'delete danger',\n text: 'Delete',\n onClick: this.onDeleteClick,\n verify: async() => this.managers.appMessagesManager.canDeleteMessage(this.message)\n }, {\n icon: 'delete danger',\n text: 'Message.Context.Selection.Delete',\n onClick: this.onDeleteClick,\n verify: () => this.isSelected && !this.chat.selection.selectionDeleteBtn.hasAttribute('disabled'),\n notDirect: () => true,\n withSelection: true\n }, {\n icon: 'info',\n text: 'Chat.Message.Sponsored.What',\n onClick: () => {\n PopupElement.createPopup(PopupSponsored);\n },\n verify: () => false,\n isSponsored: true\n }, {\n // icon: 'smile',\n text: 'Loading',\n onClick: () => {\n this.emojiInputsPromise.then((inputs) => {\n PopupElement.createPopup(PopupStickers, inputs, true).show();\n });\n },\n verify: () => !!this.getUniqueCustomEmojisFromMessage().length,\n notDirect: () => true,\n localName: 'emojis'\n }];\n }\n\n public static canDownload(message: MyMessage | MyMessage[], withTarget?: HTMLElement, noForwards?: boolean): boolean {\n if(Array.isArray(message)) {\n return message.some((message) => ChatContextMenu.canDownload(message, withTarget, noForwards));\n }\n\n if(!canSaveMessageMedia(message) || noForwards) {\n return false;\n }\n\n const isPhoto: boolean = !!((message as Message.message).media as MessageMedia.messageMediaPhoto)?.photo;\n let isGoodType = false\n\n if(isPhoto) {\n isGoodType = true;\n } else {\n const doc: MyDocument = ((message as Message.message).media as MessageMedia.messageMediaDocument)?.document as any;\n if(!doc) return false;\n // isGoodType = doc.type && (['gif', 'video', 'audio', 'voice', 'sticker'] as MyDocument['type'][]).includes(doc.type)\n isGoodType = true;\n }\n\n let hasTarget = !withTarget || !!IS_TOUCH_SUPPORTED;\n\n if(isGoodType && withTarget) {\n hasTarget ||= !!(findUpClassName(withTarget, 'document') ||\n findUpClassName(withTarget, 'audio') ||\n findUpClassName(withTarget, 'media-sticker-wrapper') ||\n findUpClassName(withTarget, 'media-photo') ||\n findUpClassName(withTarget, 'media-video'));\n }\n\n return isGoodType && hasTarget;\n }\n\n private getMessageWithText() {\n return (this.albumMessages && getAlbumText(this.albumMessages)) || this.message;\n }\n\n private getUniqueCustomEmojisFromMessage() {\n const docIds: DocId[] = [];\n\n const message = this.getMessageWithText();\n\n const entities = (message as Message.message).entities;\n if(entities) {\n const filtered = entities.filter((entity) => entity._ === 'messageEntityCustomEmoji') as MessageEntity.messageEntityCustomEmoji[];\n docIds.push(...filtered.map((entity) => entity.document_id));\n }\n\n const reactions = (message as Message.message).reactions;\n if(reactions) {\n const results = reactions.results.filter((reactionCount) => reactionCount.reaction._ === 'reactionCustomEmoji');\n docIds.push(...results.map((reactionCount) => (reactionCount.reaction as Reaction.reactionCustomEmoji).document_id));\n }\n\n return filterUnique(docIds);\n }\n\n private async init() {\n this.cleanup();\n this.setButtons();\n\n const filteredButtons = await this.filterButtons(this.buttons);\n if(!filteredButtons.length) {\n return;\n }\n\n const element = this.element = await ButtonMenu({\n buttons: filteredButtons,\n listenerSetter: this.listenerSetter\n });\n element.id = 'bubble-contextmenu';\n element.classList.add('contextmenu');\n\n const viewsButton = filteredButtons.find((button) => button.localName === 'views');\n if(viewsButton) {\n const reactions = (this.message as Message.message).reactions;\n const recentReactions = reactions?.recent_reactions;\n const isViewingReactions = !!recentReactions?.length;\n const participantsCount = await this.managers.appMessagesManager.canViewMessageReadParticipants(this.message) ?\n ((await this.managers.appPeersManager.getPeer(this.peerId)) as MTChat.chat).participants_count :\n undefined;\n const reactedLength = reactions ? reactions.results.reduce((acc, r) => acc + r.count, 0) : undefined;\n\n viewsButton.element.classList.add('tgico-' + (isViewingReactions ? 'reactions' : 'checks'));\n const i18nElem = new I18n.IntlElement({\n key: isViewingReactions ? (\n participantsCount === undefined ? 'Chat.Context.ReactedFast' : 'Chat.Context.Reacted'\n ) : 'NobodyViewed',\n args: isViewingReactions ? (\n participantsCount === undefined ? [reactedLength] : [participantsCount, participantsCount]\n ) : undefined,\n element: viewsButton.textElement\n });\n\n let fakeText: HTMLElement;\n if(isViewingReactions) {\n if(participantsCount === undefined) {\n fakeText = i18n('Chat.Context.ReactedFast', [reactedLength]);\n } else {\n fakeText = i18n(\n recentReactions.length === participantsCount ? 'Chat.Context.ReactedFast' : 'Chat.Context.Reacted',\n [recentReactions.length, participantsCount]\n );\n }\n } else {\n fakeText = i18n('Loading');\n }\n\n fakeText.classList.add('btn-menu-item-text-fake');\n viewsButton.element.append(fakeText);\n\n const AVATAR_SIZE = 22;\n const MAX_AVATARS = 3;\n const PADDING_PER_AVATAR = 1.125;\n i18nElem.element.style.visibility = 'hidden';\n i18nElem.element.style.paddingRight = isViewingReactions ? PADDING_PER_AVATAR * Math.min(MAX_AVATARS, recentReactions.length) + 'rem' : '1rem';\n const middleware = this.middleware.get();\n this.managers.appMessagesManager.getMessageReactionsListAndReadParticipants(this.message as Message.message).then((result) => {\n if(!middleware()) {\n return;\n }\n\n if(fakeText) {\n fakeText.remove();\n }\n\n const reactions = result.combined;\n const reactedLength = participantsCount === undefined ?\n result.reactionsCount :\n (\n isViewingReactions ?\n reactions.filter((reaction) => reaction.reaction).length :\n reactions.length\n );\n\n let fakeElem: HTMLElement;\n if(reactions.length === 1) {\n fakeElem = new PeerTitle({\n peerId: reactions[0].peerId,\n onlyFirstName: true,\n dialog: false\n }).element;\n\n if(!isViewingReactions || result.readParticipants.length <= 1) {\n this.viewerPeerId = reactions[0].peerId;\n }\n } else if(isViewingReactions) {\n const isFull = reactedLength === reactions.length || participantsCount === undefined;\n fakeElem = i18n(\n isFull ? 'Chat.Context.ReactedFast' : 'Chat.Context.Reacted',\n isFull ? [reactedLength] : [reactedLength, reactions.length]\n );\n } else {\n if(!reactions.length) {\n i18nElem.element.style.visibility = '';\n } else {\n fakeElem = i18n('MessageSeen', [reactions.length]);\n }\n }\n\n if(fakeElem) {\n fakeElem.style.paddingRight = PADDING_PER_AVATAR * Math.min(MAX_AVATARS, reactedLength) + 'rem';\n fakeElem.classList.add('btn-menu-item-text-fake');\n viewsButton.element.append(fakeElem);\n }\n\n if(reactions.length) {\n const avatars = new StackedAvatars({avatarSize: AVATAR_SIZE});\n avatars.render(recentReactions ? recentReactions.map((r) => getPeerId(r.peer_id)) : reactions.map((reaction) => reaction.peerId));\n viewsButton.element.append(avatars.container);\n\n // if(reactions.length > 1) {\n // if(isViewingReactions) {\n this.canOpenReactedList = true;\n // }\n }\n });\n }\n\n let menuPadding: MenuPositionPadding;\n let reactionsMenu: ChatReactionsMenu;\n let reactionsMenuPosition: 'horizontal' | 'vertical';\n if(\n this.message._ === 'message' &&\n !this.chat.selection.isSelecting &&\n !this.message.pFlags.is_outgoing &&\n !this.message.pFlags.is_scheduled &&\n !this.message.pFlags.local\n ) {\n reactionsMenuPosition = (IS_APPLE || IS_TOUCH_SUPPORTED)/* && false */ ? 'horizontal' : 'vertical';\n reactionsMenu = this.reactionsMenu = new ChatReactionsMenu(this.managers, reactionsMenuPosition, this.middleware);\n reactionsMenu.init(await this.managers.appMessagesManager.getGroupsFirstMessage(this.message));\n // element.prepend(reactionsMenu.widthContainer);\n\n const size = 36;\n const margin = 8;\n const totalSize = size + margin;\n const paddingLeft = 0, paddingRight = 0;\n if(reactionsMenuPosition === 'vertical') {\n menuPadding = {\n top: paddingLeft,\n // bottom: 36, // positionMenu will detect it itself somehow\n left: totalSize\n };\n } else {\n menuPadding = {\n top: totalSize,\n right: paddingRight,\n left: paddingLeft\n };\n }\n }\n\n const emojisButton = filteredButtons.find((button) => button.localName === 'emojis');\n if(emojisButton) {\n emojisButton.element.classList.add('is-multiline');\n emojisButton.element.parentElement.insertBefore(document.createElement('hr'), emojisButton.element);\n\n const setPadding = () => {\n menuPadding ??= {};\n menuPadding.bottom = 24;\n };\n\n const docIds = this.getUniqueCustomEmojisFromMessage();\n const inputsPromise = this.emojiInputsPromise = deferredPromise();\n\n await this.managers.appEmojiManager.getCachedCustomEmojiDocuments(docIds).then(async(docs) => {\n const p = async(docs: Document.document[]) => {\n const s: Map = new Map();\n docs.forEach((doc) => {\n if(!doc || s.has(doc.stickerSetInput.id)) {\n return;\n }\n\n s.set(doc.stickerSetInput.id, doc.stickerSetInput);\n });\n\n const inputs = [...s.values()];\n inputsPromise.resolve(inputs);\n if(s.size === 1) {\n const result = await this.managers.acknowledged.appStickersManager.getStickerSet(inputs[0]);\n const promise = result.result.then((set) => {\n const el = i18n('MessageContainsEmojiPack', [wrapEmojiText(set.set.title)]);\n replaceContent(emojisButton.textElement, el);\n });\n\n return result.cached ? promise : (setPadding(), undefined);\n }\n\n replaceContent(emojisButton.textElement, i18n('MessageContainsEmojiPacks', [s.size]));\n };\n\n if(docs.some((doc) => !doc)) {\n setPadding();\n this.managers.appEmojiManager.getCustomEmojiDocuments(docIds).then(p);\n } else {\n return p(docs);\n }\n });\n // emojisButton.element.append(i18n('Loading'));\n }\n\n this.chat.container.append(element);\n\n return {\n element,\n cleanup: () => {\n this.cleanup();\n reactionsMenu && reactionsMenu.cleanup();\n },\n destroy: () => {\n element.remove();\n reactionsMenu && reactionsMenu.widthContainer.remove();\n },\n menuPadding,\n reactionsMenu,\n reactionsMenuPosition\n };\n }\n\n private async getUrlToMessage() {\n if(this.peerId.isUser()) {\n return;\n }\n\n let threadMessage: Message.message;\n const {peerId, mid} = this;\n const threadId = this.chat.threadId;\n if(this.chat.type === 'discussion') {\n threadMessage = (await this.managers.appMessagesManager.getMessageByPeer(peerId, threadId)) as Message.message;\n }\n\n const username = await this.managers.appPeersManager.getPeerUsername(threadMessage ? threadMessage.fromId : peerId);\n const msgId = getServerMessageId(mid);\n let url = 'https://t.me/';\n if(username) {\n url += username;\n if(threadMessage) url += `/${getServerMessageId(threadMessage.fwd_from.channel_post)}?comment=${msgId}`;\n else if(threadId) url += `/${getServerMessageId(threadId)}/${msgId}`;\n else url += '/' + msgId;\n } else {\n url += 'c/' + peerId.toChatId();\n if(threadMessage) url += `/${msgId}?thread=${getServerMessageId(threadMessage.mid)}`;\n else if(threadId) url += `/${getServerMessageId(threadId)}/${msgId}`;\n else url += '/' + msgId;\n }\n\n return {url, isPrivate: !username};\n }\n\n private async getSelectedMessagesText() {\n if(!isSelectionEmpty()) {\n return '';\n }\n\n const mids = this.chat.selection.isSelecting ?\n [...this.chat.selection.selectedMids.get(this.peerId)].sort((a, b) => a - b) :\n [this.mid];\n\n const parts: string[] = await Promise.all(mids.map(async(mid) => {\n const message = (await this.chat.getMessage(mid)) as Message.message;\n return message?.message ? message.message + '\\n' : '';\n }));\n\n return parts.join('');\n }\n\n private onSendScheduledClick = async() => {\n if(this.chat.selection.isSelecting) {\n simulateClickEvent(this.chat.selection.selectionSendNowBtn);\n } else {\n PopupElement.createPopup(PopupSendNow, this.peerId, await this.chat.getMidsByMid(this.mid));\n }\n };\n\n private onReplyClick = () => {\n this.chat.input.initMessageReply(this.mid);\n };\n\n private onFaveStickerClick = (unfave?: boolean) => {\n const docId = ((this.message as Message.message).media as MessageMedia.messageMediaDocument).document.id;\n this.managers.appStickersManager.faveSticker(docId, unfave);\n };\n\n private onEditClick = () => {\n const message = this.getMessageWithText();\n this.chat.input.initMessageEditing(this.isTargetAGroupedItem ? this.mid : message.mid);\n };\n\n private onCopyClick = async() => {\n if(isSelectionEmpty()) {\n copyTextToClipboard(this.selectedMessagesText);\n } else {\n document.execCommand('copy');\n // cancelSelection();\n }\n };\n\n private onCopyAnchorLinkClick = () => {\n copyTextToClipboard((this.target as HTMLAnchorElement).href);\n };\n\n private onCopyLinkClick = () => {\n const {url, isPrivate} = this.linkToMessage;\n const key: LangPackKey = isPrivate ? 'LinkCopiedPrivateInfo' : 'LinkCopied';\n toast(I18n.format(key, true));\n copyTextToClipboard(url);\n };\n\n private onPinClick = () => {\n PopupElement.createPopup(PopupPinMessage, this.peerId, this.mid);\n };\n\n private onUnpinClick = () => {\n PopupElement.createPopup(PopupPinMessage, this.peerId, this.mid, true);\n };\n\n private onRetractVote = () => {\n this.managers.appPollsManager.sendVote(this.message as Message.message, []);\n };\n\n private onStopPoll = () => {\n this.managers.appPollsManager.stopPoll(this.message as Message.message);\n };\n\n private onForwardClick = async() => {\n if(this.chat.selection.isSelecting) {\n simulateClickEvent(this.chat.selection.selectionForwardBtn);\n } else {\n const peerId = this.peerId;\n const mids = this.isTargetAGroupedItem ? [this.mid] : await this.chat.getMidsByMid(this.mid);\n PopupForward.create({\n [peerId]: mids\n });\n }\n };\n\n private onSelectClick = () => {\n this.chat.selection.toggleByElement(findUpClassName(this.target, 'grouped-item') || findUpClassName(this.target, 'bubble'));\n };\n\n private onClearSelectionClick = () => {\n this.chat.selection.cancelSelection();\n };\n\n private onDeleteClick = async() => {\n if(this.chat.selection.isSelecting) {\n simulateClickEvent(this.chat.selection.selectionDeleteBtn);\n } else {\n PopupElement.createPopup(PopupDeleteMessages, this.peerId, this.isTargetAGroupedItem ? [this.mid] : await this.chat.getMidsByMid(this.mid), this.chat.type);\n }\n };\n\n public static onDownloadClick(messages: MyMessage | MyMessage[], noForwards?: boolean): DownloadBlob | DownloadBlob[] {\n if(Array.isArray(messages)) {\n return messages.map((message) => {\n return this.onDownloadClick(message) as any;\n });\n }\n\n if(!this.canDownload(messages, undefined, noForwards)) {\n return;\n }\n\n return appDownloadManager.downloadToDisc({media: getMediaFromMessage(messages, true)});\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko, Artem Kolnogorov and unknown creator of the script taken from http://useless.altervista.org/gradient.html\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {animateSingle} from '../../helpers/animation';\nimport {hexToRgb} from '../../helpers/color';\nimport {easeOutQuadApply} from '../../helpers/easing/easeOutQuad';\n\nconst WIDTH = 50;\nconst HEIGHT = WIDTH;\n\nexport default class ChatBackgroundGradientRenderer {\n private readonly _width = WIDTH;\n private readonly _height = HEIGHT;\n private _phase: number;\n private _tail: number;\n private readonly _tails = 90;\n private readonly _scrollTails = 50;\n private _frames: ImageData[];\n private _colors: {r: number, g: number, b: number}[];\n private readonly _curve = [\n 0, 0.25, 0.50, 0.75, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5, 6, 7, 8, 9, 10, 11, 12,\n 13, 14, 15, 16, 17, 18, 18.3, 18.6, 18.9, 19.2, 19.5, 19.8, 20.1, 20.4, 20.7,\n 21.0, 21.3, 21.6, 21.9, 22.2, 22.5, 22.8, 23.1, 23.4, 23.7, 24.0, 24.3, 24.6,\n 24.9, 25.2, 25.5, 25.8, 26.1, 26.3, 26.4, 26.5, 26.6, 26.7, 26.8, 26.9, 27\n ];\n private readonly _incrementalCurve: number[];\n private readonly _positions = [\n {x: 0.80, y: 0.10},\n {x: 0.60, y: 0.20},\n {x: 0.35, y: 0.25},\n {x: 0.25, y: 0.60},\n {x: 0.20, y: 0.90},\n {x: 0.40, y: 0.80},\n {x: 0.65, y: 0.75},\n {x: 0.75, y: 0.40}\n ];\n private readonly _phases = this._positions.length;\n private _onWheelRAF: number;\n private _scrollDelta: number;\n\n // private _ts = 0;\n // private _fps = 15;\n // private _frametime = 1000 / this._fps;\n // private _raf: number;\n\n private _canvas: HTMLCanvasElement;\n private _ctx: CanvasRenderingContext2D;\n private _hc: HTMLCanvasElement;\n private _hctx: CanvasRenderingContext2D;\n\n private _addedScrollListener: boolean;\n private _animatingToNextPosition: boolean;\n private _nextPositionTail: number;\n private _nextPositionTails: number;\n private _nextPositionLeft: number;\n\n constructor() {\n const diff = this._tails / this._curve[this._curve.length - 1];\n\n for(let i = 0, length = this._curve.length; i < length; ++i) {\n this._curve[i] = this._curve[i] * diff;\n }\n\n this._incrementalCurve = this._curve.map((v, i, arr) => {\n return v - (arr[i - 1] ?? 0);\n });\n }\n\n private hexToRgb(hex: string) {\n const result = hexToRgb(hex);\n return {r: result[0], g: result[1], b: result[2]};\n }\n\n private getPositions(shift: number) {\n const positions = this._positions.slice();\n positions.push(...positions.splice(0, shift));\n\n const result: typeof positions = [];\n for(let i = 0; i < positions.length; i += 2) {\n result.push(positions[i]);\n }\n return result;\n }\n\n private getNextPositions(phase: number, curveMax: number, curve: number[]) {\n const pos = this.getPositions(phase);\n if(!curve[0] && curve.length === 1) {\n return [pos];\n }\n\n const nextPos = this.getPositions(++phase % this._phases);\n const distances = nextPos.map((nextPos, idx) => {\n return {\n x: (nextPos.x - pos[idx].x) / curveMax,\n y: (nextPos.y - pos[idx].y) / curveMax\n };\n });\n\n const positions = curve.map((value) => {\n return distances.map((distance, idx) => {\n return {\n x: pos[idx].x + distance.x * value,\n y: pos[idx].y + distance.y * value\n };\n });\n });\n\n return positions;\n }\n\n private curPosition(phase: number, tail: number) {\n const positions = this.getNextPositions(phase, this._tails, [tail]);\n return positions[0];\n }\n\n private changeTail(diff: number) {\n this._tail += diff;\n\n while(this._tail >= this._tails) {\n this._tail -= this._tails;\n if(++this._phase >= this._phases) {\n this._phase -= this._phases;\n }\n }\n\n while(this._tail < 0) {\n this._tail += this._tails;\n if(--this._phase < 0) {\n this._phase += this._phases;\n }\n }\n }\n\n private onWheel = (e: {deltaY: number}) => {\n if(this._animatingToNextPosition) {\n return;\n }\n\n this._scrollDelta += e.deltaY;\n if(this._onWheelRAF === undefined) {\n this._onWheelRAF = requestAnimationFrame(this.drawOnWheel);\n }\n };\n\n private changeTailAndDraw(diff: number) {\n this.changeTail(diff);\n const curPos = this.curPosition(this._phase, this._tail);\n this.drawGradient(curPos);\n }\n\n private drawOnWheel = () => {\n const value = this._scrollDelta / this._scrollTails;\n this._scrollDelta %= this._scrollTails;\n const diff = value > 0 ? Math.floor(value) : Math.ceil(value);\n if(diff) {\n this.changeTailAndDraw(diff);\n }\n this._onWheelRAF = undefined;\n };\n\n private drawNextPositionAnimated = (getProgress?: () => number) => {\n let done: boolean, id: ImageData;\n if(getProgress) {\n const value = getProgress();\n done = value >= 1;\n const transitionValue = easeOutQuadApply(value, 1);\n const nextPositionTail = this._nextPositionTail ?? 0;\n const tail = this._nextPositionTail = this._nextPositionTails * transitionValue;\n const diff = tail - nextPositionTail;\n if(diff) {\n this._nextPositionLeft -= diff;\n this.changeTailAndDraw(diff);\n }\n } else {\n const frames = this._frames;\n id = frames.shift();\n done = !frames.length;\n }\n\n if(id) {\n this.drawImageData(id);\n }\n\n if(done) {\n this._nextPositionLeft = undefined;\n this._nextPositionTails = undefined;\n this._nextPositionTail = undefined;\n this._animatingToNextPosition = undefined;\n }\n\n return !done;\n };\n\n private getGradientImageData(positions: {x: number, y: number}[]) {\n const id = this._hctx.createImageData(this._width, this._height);\n const pixels = id.data;\n\n let offset = 0;\n for(let y = 0; y < this._height; ++y) {\n const directPixelY = y / this._height;\n const centerDistanceY = directPixelY - 0.5;\n const centerDistanceY2 = centerDistanceY * centerDistanceY;\n\n for(let x = 0; x < this._width; ++x) {\n const directPixelX = x / this._width;\n\n const centerDistanceX = directPixelX - 0.5;\n const centerDistance = Math.sqrt(centerDistanceX * centerDistanceX + centerDistanceY2);\n\n const swirlFactor = 0.35 * centerDistance;\n const theta = swirlFactor * swirlFactor * 0.8 * 8.0;\n const sinTheta = Math.sin(theta);\n const cosTheta = Math.cos(theta);\n\n const pixelX = Math.max(0.0, Math.min(1.0, 0.5 + centerDistanceX * cosTheta - centerDistanceY * sinTheta));\n const pixelY = Math.max(0.0, Math.min(1.0, 0.5 + centerDistanceX * sinTheta + centerDistanceY * cosTheta));\n\n let distanceSum = 0.0;\n\n let r = 0.0;\n let g = 0.0;\n let b = 0.0;\n\n for(let i = 0; i < this._colors.length; i++) {\n const colorX = positions[i].x;\n const colorY = positions[i].y;\n\n const distanceX = pixelX - colorX;\n const distanceY = pixelY - colorY;\n\n let distance = Math.max(0.0, 0.9 - Math.sqrt(distanceX * distanceX + distanceY * distanceY));\n distance = distance * distance * distance * distance;\n distanceSum += distance;\n\n r += distance * this._colors[i].r / 255;\n g += distance * this._colors[i].g / 255;\n b += distance * this._colors[i].b / 255;\n }\n\n pixels[offset++] = r / distanceSum * 255.0;\n pixels[offset++] = g / distanceSum * 255.0;\n pixels[offset++] = b / distanceSum * 255.0;\n pixels[offset++] = 0xFF;\n }\n }\n return id;\n }\n\n private drawImageData(id: ImageData) {\n this._hctx.putImageData(id, 0, 0);\n this._ctx.drawImage(this._hc, 0, 0, this._width, this._height);\n }\n\n private drawGradient(positions: {x: number, y: number}[]) {\n this.drawImageData(this.getGradientImageData(positions));\n }\n\n // private doAnimate = () => {\n // const now = +Date.now();\n // if(!document.hasFocus() || (now - this._ts) < this._frametime) {\n // this._raf = requestAnimationFrame(this.doAnimate);\n // return;\n // }\n\n // this._ts = now;\n // this.changeTail(1);\n // const cur_pos = this.curPosition(this._phase, this._tail);\n // this.drawGradient(cur_pos);\n // this._raf = requestAnimationFrame(this.doAnimate);\n // };\n\n // public animate(start?: boolean) {\n // if(!start) {\n // cancelAnimationFrame(this._raf);\n // return;\n // }\n // this.doAnimate();\n // }\n\n public init(el: HTMLCanvasElement) {\n this._frames = [];\n this._phase = 0;\n this._tail = 0;\n this._scrollDelta = 0;\n if(this._onWheelRAF !== undefined) {\n cancelAnimationFrame(this._onWheelRAF);\n this._onWheelRAF = undefined;\n }\n\n const colors = el.getAttribute('data-colors').split(',').reverse();\n this._colors = colors.map((color) => {\n return this.hexToRgb(color);\n });\n\n if(!this._hc) {\n this._hc = document.createElement('canvas');\n this._hc.width = this._width;\n this._hc.height = this._height;\n this._hctx = this._hc.getContext('2d', {alpha: false});\n }\n\n this._canvas = el;\n this._ctx = this._canvas.getContext('2d', {alpha: false});\n this.update();\n }\n\n private update() {\n if(this._colors.length < 2) {\n const color = this._colors[0];\n this._ctx.fillStyle = `rgb(${color.r}, ${color.g}, ${color.b})`;\n this._ctx.fillRect(0, 0, this._width, this._height);\n return;\n }\n\n const pos = this.curPosition(this._phase, this._tail);\n this.drawGradient(pos);\n }\n\n public toNextPosition(getProgress?: () => number) {\n if(this._colors.length < 2) {\n return;\n }\n\n if(getProgress) {\n this._nextPositionLeft = this._tails + (this._nextPositionLeft ?? 0);\n this._nextPositionTails = this._nextPositionLeft;\n this._nextPositionTail = undefined;\n this._animatingToNextPosition = true;\n animateSingle(this.drawNextPositionAnimated.bind(this, getProgress), this);\n return;\n }\n\n const tail = this._tail;\n const tails = this._tails;\n\n let nextPhaseOnIdx: number;\n\n const curve: number[] = [];\n for(let i = 0, length = this._incrementalCurve.length; i < length; ++i) {\n const inc = this._incrementalCurve[i];\n let value = (curve[i - 1] ?? tail) + inc;\n\n if(+value.toFixed(2) > tails && nextPhaseOnIdx === undefined) {\n nextPhaseOnIdx = i;\n value %= tails;\n }\n\n curve.push(value);\n }\n\n const currentPhaseCurve = curve.slice(0, nextPhaseOnIdx);\n const nextPhaseCurve = nextPhaseOnIdx !== undefined ? curve.slice(nextPhaseOnIdx) : [];\n\n [currentPhaseCurve, nextPhaseCurve].forEach((curve, idx, curves) => {\n const last = curve[curve.length - 1];\n if(last !== undefined && last > tails) {\n curve[curve.length - 1] = +last.toFixed(2);\n }\n\n this._tail = last ?? 0;\n\n if(!curve.length) {\n return;\n }\n\n const positions = this.getNextPositions(this._phase, tails, curve);\n if(idx !== (curves.length - 1)) {\n if(++this._phase >= this._phases) {\n this._phase -= this._phases;\n }\n }\n\n const ids = positions.map((pos) => {\n return this.getGradientImageData(pos);\n });\n\n this._frames.push(...ids);\n });\n\n this._animatingToNextPosition = true;\n animateSingle(this.drawNextPositionAnimated, this);\n }\n\n // public toNextPositionThrottled = throttle(this.toNextPosition.bind(this), 100, true);\n\n public scrollAnimate(start?: boolean) {\n return;\n\n if(this._colors.length < 2 && start) {\n return;\n }\n\n if(start && !this._addedScrollListener) {\n document.addEventListener('wheel', this.onWheel);\n this._addedScrollListener = true;\n } else if(!start && this._addedScrollListener) {\n document.removeEventListener('wheel', this.onWheel);\n this._addedScrollListener = false;\n }\n }\n\n public cleanup() {\n this.scrollAnimate(false);\n // this.animate(false);\n }\n\n public static createCanvas(colors?: string) {\n const canvas = document.createElement('canvas');\n canvas.width = WIDTH;\n canvas.height = HEIGHT;\n if(colors !== undefined) {\n canvas.dataset.colors = colors;\n }\n\n return canvas;\n }\n\n public static create(colors?: string) {\n const canvas = this.createCanvas(colors);\n const gradientRenderer = new ChatBackgroundGradientRenderer();\n gradientRenderer.init(canvas);\n\n return {gradientRenderer, canvas};\n }\n}\n","export default function easeOutQuad(t: number, b: number, c: number, d: number) {\n return t >= d ? b + c : easeOutQuadApply(t / d, c) + b;\n}\n\nexport function easeOutQuadApply(v: number, c: number) {\n return -c * v * (v - 2);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type Chat from '../chat/chat';\nimport PopupElement from '.';\nimport CheckboxField from '../checkboxField';\nimport InputField from '../inputField';\nimport RadioField from '../radioField';\nimport Scrollable from '../scrollable';\nimport SendContextMenu from '../chat/sendContextMenu';\nimport I18n, {_i18n} from '../../lib/langPack';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport isInputEmpty from '../../helpers/dom/isInputEmpty';\nimport whichChild from '../../helpers/dom/whichChild';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport {Poll} from '../../layer';\nimport getRichValueWithCaret from '../../helpers/dom/getRichValueWithCaret';\n\nconst MAX_LENGTH_QUESTION = 255;\nconst MAX_LENGTH_OPTION = 100;\nconst MAX_LENGTH_SOLUTION = 200;\n\nexport default class PopupCreatePoll extends PopupElement {\n private questionInputField: InputField;\n private questions: HTMLElement;\n protected scrollable: Scrollable;\n private tempId = 0;\n\n private anonymousCheckboxField: CheckboxField;\n private multipleCheckboxField: PopupCreatePoll['anonymousCheckboxField'];\n private quizCheckboxField: PopupCreatePoll['anonymousCheckboxField'];\n\n private correctAnswers: Uint8Array[];\n private quizSolutionField: InputField;\n private optionInputFields: InputField[];\n\n constructor(private chat: Chat) {\n super('popup-create-poll popup-new-media', {closable: true, withConfirm: 'Create', body: true, title: 'NewPoll'});\n this.construct();\n }\n\n private async construct() {\n this.questionInputField = new InputField({\n placeholder: 'AskAQuestion',\n label: 'AskAQuestion',\n name: 'question',\n maxLength: MAX_LENGTH_QUESTION\n });\n\n this.listenerSetter.add(this.questionInputField.input)('input', () => {\n this.handleChange();\n });\n\n this.optionInputFields = [];\n\n if(this.chat.type !== 'scheduled') {\n const sendMenu = new SendContextMenu({\n onSilentClick: () => {\n this.chat.input.sendSilent = true;\n this.send();\n },\n onScheduleClick: () => {\n this.chat.input.scheduleSending(() => {\n this.send();\n });\n },\n openSide: 'bottom-left',\n onContextElement: this.btnConfirm\n });\n\n sendMenu.setPeerId(this.chat.peerId);\n\n this.header.append(sendMenu.sendMenu);\n }\n\n this.header.append(this.questionInputField.container);\n\n const hr = document.createElement('hr');\n const d = document.createElement('div');\n d.classList.add('caption');\n _i18n(d, 'PollOptions');\n\n this.questions = document.createElement('form');\n this.questions.classList.add('poll-create-questions');\n\n const dd = document.createElement('div');\n dd.classList.add('poll-create-settings');\n\n const settingsCaption = document.createElement('div');\n settingsCaption.classList.add('caption');\n _i18n(settingsCaption, 'Settings');\n\n if(!(await this.chat.managers.appPeersManager.isBroadcast(this.chat.peerId))) {\n this.anonymousCheckboxField = new CheckboxField({\n text: 'NewPoll.Anonymous',\n name: 'anonymous'\n });\n this.anonymousCheckboxField.input.checked = true;\n dd.append(this.anonymousCheckboxField.label);\n }\n\n this.multipleCheckboxField = new CheckboxField({\n text: 'NewPoll.MultipleChoice',\n name: 'multiple'\n });\n this.quizCheckboxField = new CheckboxField({\n text: 'NewPoll.Quiz',\n name: 'quiz'\n });\n\n this.listenerSetter.add(this.multipleCheckboxField.input)('change', () => {\n const checked = this.multipleCheckboxField.input.checked;\n this.quizCheckboxField.input.toggleAttribute('disabled', checked);\n });\n\n this.listenerSetter.add(this.quizCheckboxField.input)('change', () => {\n const checked = this.quizCheckboxField.input.checked;\n\n (Array.from(this.questions.children) as HTMLElement[]).map((el) => {\n el.classList.toggle('radio-field', checked);\n });\n\n if(!checked) {\n this.correctAnswers = undefined;\n this.quizSolutionField.setValueSilently('');\n }\n\n quizElements.forEach((el) => el.classList.toggle('hide', !checked));\n\n this.multipleCheckboxField.input.toggleAttribute('disabled', checked);\n this.handleChange();\n });\n\n dd.append(this.multipleCheckboxField.label, this.quizCheckboxField.label);\n\n const quizElements: HTMLElement[] = [];\n\n const quizSolutionCaption = document.createElement('div');\n quizSolutionCaption.classList.add('caption');\n _i18n(quizSolutionCaption, 'AccDescrQuizExplanation');\n\n const quizHr = document.createElement('hr');\n\n const quizSolutionContainer = document.createElement('div');\n quizSolutionContainer.classList.add('poll-create-questions');\n\n this.quizSolutionField = new InputField({\n placeholder: 'NewPoll.Explanation.Placeholder',\n label: 'NewPoll.Explanation.Placeholder',\n name: 'solution',\n maxLength: MAX_LENGTH_SOLUTION\n });\n\n this.listenerSetter.add(this.questionInputField.input)('input', () => {\n this.handleChange();\n });\n\n const quizSolutionSubtitle = document.createElement('div');\n quizSolutionSubtitle.classList.add('subtitle');\n _i18n(quizSolutionSubtitle, 'AddAnExplanationInfo');\n\n quizSolutionContainer.append(this.quizSolutionField.container, quizSolutionSubtitle);\n\n quizElements.push(quizHr, quizSolutionCaption, quizSolutionContainer);\n quizElements.forEach((el) => el.classList.add('hide'));\n\n this.body.parentElement.insertBefore(hr, this.body);\n this.body.append(d, this.questions, document.createElement('hr'), settingsCaption, dd, ...quizElements);\n\n attachClickEvent(this.btnConfirm, this.onSubmitClick, {listenerSetter: this.listenerSetter});\n\n this.scrollable = new Scrollable(this.body);\n this.appendMoreField();\n\n this.onEscape = () => {\n return !this.getFilledAnswers().length;\n };\n\n this.handleChange();\n }\n\n private getFilledAnswers() {\n const answers = Array.from(this.questions.children).map((el, idx) => {\n const input = el.querySelector('.input-field-input') as HTMLElement;\n return input instanceof HTMLInputElement ? input.value : getRichValueWithCaret(input, false, false).value;\n }).filter((v) => !!v.trim());\n\n return answers;\n }\n\n private onSubmitClick = () => {\n this.send();\n };\n\n private validate() {\n const question = this.questionInputField.value;\n if(!question) {\n return false;\n }\n\n if(question.length > MAX_LENGTH_QUESTION) {\n return false;\n }\n\n if(this.quizCheckboxField.input.checked && !this.correctAnswers?.length) {\n return false;\n }\n\n const answers = this.getFilledAnswers();\n if(answers.length < 2) {\n return false;\n }\n\n const tooLongOption = answers.find((a) => a.length > MAX_LENGTH_OPTION);\n if(tooLongOption) {\n return false;\n }\n\n const {value: quizSolution} = getRichValueWithCaret(this.quizSolutionField.input, false, false);\n if(quizSolution.length > MAX_LENGTH_SOLUTION) {\n return false;\n }\n\n return true;\n }\n\n private handleChange() {\n const valid = this.validate();\n this.btnConfirm.toggleAttribute('disabled', !valid);\n }\n\n public async send(force = false) {\n const question = this.questionInputField.value;\n\n const answers = this.getFilledAnswers();\n\n const {value: quizSolution, entities: quizSolutionEntities} = getRichValueWithCaret(this.quizSolutionField.input, true, false);\n\n if(this.chat.type === 'scheduled' && !force) {\n this.chat.input.scheduleSending(() => {\n this.send(true);\n });\n\n return;\n }\n\n this.hide();\n\n // const randomID = [nextRandomInt(0xFFFFFFFF), nextRandomInt(0xFFFFFFFF)];\n // const randomIDS = bigint(randomID[0]).shiftLeft(32).add(bigint(randomID[1])).toString();\n\n const pFlags: Poll['pFlags'] = {};\n\n if(this.anonymousCheckboxField && !this.anonymousCheckboxField.input.checked) {\n pFlags.public_voters = true;\n }\n\n if(this.multipleCheckboxField.input.checked) {\n pFlags.multiple_choice = true;\n }\n\n if(this.quizCheckboxField.input.checked) {\n pFlags.quiz = true;\n }\n\n const poll: Poll = {\n _: 'poll',\n pFlags,\n question,\n answers: answers.map((value, idx) => {\n return {\n _: 'pollAnswer',\n text: value,\n option: new Uint8Array([idx])\n };\n }),\n id: undefined\n };\n // poll.id = randomIDS;\n\n const inputMediaPoll = await this.chat.managers.appPollsManager.getInputMediaPoll(poll, this.correctAnswers, quizSolution, quizSolutionEntities);\n\n // console.log('Will try to create poll:', inputMediaPoll);\n\n this.chat.managers.appMessagesManager.sendOther(this.chat.peerId, inputMediaPoll, {\n ...this.chat.getMessageSendingParams()\n });\n\n if(this.chat.input.helperType === 'reply') {\n this.chat.input.clearHelper();\n }\n\n this.chat.input.onMessageSent(false, false);\n }\n\n onInput = (e: Event) => {\n const target = e.target as HTMLInputElement;\n\n const radioLabel = findUpTag(target, 'LABEL');\n const isEmpty = isInputEmpty(target);\n if(!isEmpty) {\n target.parentElement.classList.add('is-filled');\n radioLabel.classList.remove('hidden-widget');\n radioLabel.firstElementChild.removeAttribute('disabled');\n }\n\n const isLast = !radioLabel.nextElementSibling;\n if(isLast && !isEmpty && this.questions.childElementCount < 10) {\n this.appendMoreField();\n }\n\n this.handleChange();\n };\n\n onDeleteClick = (e: MouseEvent) => {\n const target = e.target as HTMLSpanElement;\n const label = findUpTag(target, 'LABEL');\n const idx = whichChild(label);\n\n if(this.correctAnswers && this.correctAnswers[0][0] === idx) {\n this.correctAnswers = undefined;\n }\n\n label.remove();\n this.optionInputFields.splice(idx, 1);\n\n this.optionInputFields.forEach((inputField, idx) => {\n inputField.options.labelOptions.length = 0;\n inputField.options.labelOptions.push(idx + 1);\n const i18nElement = I18n.weakMap.get(inputField.label.firstElementChild as HTMLElement);\n i18nElement.update();\n });\n\n this.handleChange();\n };\n\n private appendMoreField() {\n const tempId = this.tempId++;\n const idx = this.questions.childElementCount + 1;\n const questionField = new InputField({\n placeholder: 'NewPoll.OptionsAddOption',\n label: 'NewPoll.OptionLabel',\n labelOptions: [idx],\n name: 'question-' + tempId,\n maxLength: MAX_LENGTH_OPTION\n });\n this.listenerSetter.add(questionField.input)('input', this.onInput);\n\n const radioField = new RadioField({\n text: '',\n name: 'question'\n });\n radioField.main.append(questionField.container);\n attachClickEvent(questionField.input, cancelEvent, {listenerSetter: this.listenerSetter});\n radioField.label.classList.add('hidden-widget');\n radioField.input.disabled = true;\n if(!this.quizCheckboxField.input.checked) {\n radioField.label.classList.remove('radio-field');\n }\n this.listenerSetter.add(radioField.input)('change', () => {\n const checked = radioField.input.checked;\n if(checked) {\n const idx = whichChild(radioField.label);\n this.correctAnswers = [new Uint8Array([idx])];\n this.handleChange();\n }\n });\n\n const deleteBtn = document.createElement('span');\n deleteBtn.classList.add('btn-icon', 'tgico-close');\n questionField.container.append(deleteBtn);\n\n attachClickEvent(deleteBtn, this.onDeleteClick, {listenerSetter: this.listenerSetter, once: true});\n\n this.questions.append(radioField.label);\n\n this.scrollable.scrollIntoViewNew({\n element: this.questions.lastElementChild as HTMLElement,\n position: 'center'\n });\n // this.scrollable.scrollTo(this.scrollable.scrollHeight, 'top', true, true);\n\n this.optionInputFields.push(questionField);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport fastSmoothScroll from '../fastSmoothScroll';\nimport cancelEvent from './cancelEvent';\nimport {attachClickEvent} from './clickEvent';\nimport findUpAsChild from './findUpAsChild';\nimport findUpClassName from './findUpClassName';\n\ntype ArrowKey = 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight';\nconst HANDLE_EVENT = 'keydown';\nconst ACTIVE_CLASS_NAME = 'active';\n\nconst AXIS_Y_KEYS: ArrowKey[] = ['ArrowUp', 'ArrowDown'];\nconst AXIS_X_KEYS: ArrowKey[] = ['ArrowLeft', 'ArrowRight'];\n\nexport type ListNavigationOptions = {\n list: HTMLElement,\n type: 'xy' | 'x' | 'y',\n onSelect: (target: Element) => void | boolean | Promise,\n once: boolean,\n waitForKey?: string[]\n};\n\nexport default function attachListNavigation({list, type, onSelect, once, waitForKey}: ListNavigationOptions) {\n let waitForKeySet = waitForKey?.length ? new Set(waitForKey) : undefined;\n const keyNames = new Set(type === 'xy' ? AXIS_Y_KEYS.concat(AXIS_X_KEYS) : (type === 'x' ? AXIS_X_KEYS : AXIS_Y_KEYS));\n\n let target: Element;\n const getCurrentTarget = () => {\n return target || list.querySelector('.' + ACTIVE_CLASS_NAME) || list.firstElementChild;\n };\n\n const setCurrentTarget = (_target: Element, scrollTo: boolean) => {\n if(target === _target) {\n return;\n }\n\n let hadTarget = false;\n if(target) {\n hadTarget = true;\n target.classList.remove(ACTIVE_CLASS_NAME);\n }\n\n target = _target;\n if(!target) return;\n target.classList.add(ACTIVE_CLASS_NAME);\n\n if(hadTarget && scrollable && scrollTo) {\n fastSmoothScroll({\n container: scrollable,\n element: target as HTMLElement,\n position: 'center',\n forceDuration: 100,\n axis: type === 'x' ? 'x' : 'y'\n });\n }\n };\n\n const getNextTargetX = (currentTarget: Element, isNext: boolean) => {\n let nextTarget: Element;\n if(isNext) nextTarget = currentTarget.nextElementSibling || list.firstElementChild;\n else nextTarget = currentTarget.previousElementSibling || list.lastElementChild;\n\n return nextTarget;\n };\n\n const getNextTargetY = (currentTarget: Element, isNext: boolean) => {\n const property = isNext ? 'nextElementSibling' : 'previousElementSibling';\n const endProperty = isNext ? 'firstElementChild' : 'lastElementChild';\n const currentRect = currentTarget.getBoundingClientRect();\n\n let nextTarget = currentTarget[property] || list[endProperty];\n while(nextTarget !== currentTarget) {\n const targetRect = nextTarget.getBoundingClientRect();\n if(targetRect.x === currentRect.x && targetRect.y !== currentRect.y) {\n break;\n }\n\n nextTarget = nextTarget[property] || list[endProperty];\n }\n\n return nextTarget;\n };\n\n let handleArrowKey: (currentTarget: Element, key: ArrowKey) => Element;\n if(type === 'xy') { // flex-direction: row; flex-wrap: wrap;\n handleArrowKey = (currentTarget, key) => {\n if(key === 'ArrowUp' || key === 'ArrowDown') return getNextTargetY(currentTarget, key === 'ArrowDown');\n else return getNextTargetX(currentTarget, key === 'ArrowRight');\n };\n } else { // flex-direction: row | column;\n handleArrowKey = (currentTarget, key) => getNextTargetX(currentTarget, key === 'ArrowRight' || key === 'ArrowDown');\n }\n\n let onKeyDown = (e: KeyboardEvent) => {\n const key = e.key;\n if(!keyNames.has(key as any)) {\n if(key === 'Enter' || (type !== 'xy' && key === 'Tab')) {\n cancelEvent(e);\n fireSelect(getCurrentTarget());\n }\n\n return;\n }\n\n cancelEvent(e);\n\n if(list.childElementCount > 1) {\n let currentTarget = getCurrentTarget();\n currentTarget = handleArrowKey(currentTarget, key as any);\n setCurrentTarget(currentTarget, true);\n }\n };\n\n const scrollable = findUpClassName(list, 'scrollable');\n list.classList.add('navigable-list');\n\n const onMouseMove = (e: MouseEvent) => {\n const target = findUpAsChild(e.target as HTMLElement, list) as HTMLElement;\n if(!target) {\n return;\n }\n\n setCurrentTarget(target, false);\n };\n\n const onClick = (e: Event) => {\n cancelEvent(e); // cancel keyboard closening\n\n const target = findUpAsChild(e.target as HTMLElement, list) as HTMLElement;\n if(!target) {\n return;\n }\n\n setCurrentTarget(target, false);\n fireSelect(getCurrentTarget());\n };\n\n const fireSelect = async(target: Element) => {\n const canContinue = await onSelect(target);\n if(canContinue !== undefined ? !canContinue : once) {\n detach();\n }\n };\n\n let attached = false, detachClickEvent: () => void;\n const attach = () => {\n if(attached) return;\n attached = true;\n // const input = document.activeElement as HTMLElement;\n // input.addEventListener(HANDLE_EVENT, onKeyDown, {capture: true, passive: false});\n document.addEventListener(HANDLE_EVENT, onKeyDown, {capture: true, passive: false});\n list.addEventListener('mousemove', onMouseMove, {passive: true});\n detachClickEvent = attachClickEvent(list, onClick);\n };\n\n const detach = () => {\n if(!attached) return;\n attached = false;\n // input.removeEventListener(HANDLE_EVENT, onKeyDown, {capture: true});\n document.removeEventListener(HANDLE_EVENT, onKeyDown, {capture: true});\n list.removeEventListener('mousemove', onMouseMove);\n detachClickEvent();\n detachClickEvent = undefined;\n };\n\n const resetTarget = () => {\n if(waitForKeySet) return;\n setCurrentTarget(list.firstElementChild, false);\n };\n\n if(waitForKeySet) {\n const _onKeyDown = onKeyDown;\n onKeyDown = (e) => {\n if(waitForKeySet.has(e.key)) {\n cancelEvent(e);\n\n document.removeEventListener(HANDLE_EVENT, onKeyDown, {capture: true});\n onKeyDown = _onKeyDown;\n document.addEventListener(HANDLE_EVENT, onKeyDown, {capture: true, passive: false});\n\n waitForKeySet = undefined;\n resetTarget();\n }\n };\n } else {\n resetTarget();\n }\n\n attach();\n\n return {\n attach,\n detach,\n resetTarget\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport attachListNavigation, {ListNavigationOptions} from '../../helpers/dom/attachListNavigation';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport {IS_MOBILE} from '../../environment/userAgent';\nimport rootScope from '../../lib/rootScope';\nimport appNavigationController, {NavigationItem} from '../appNavigationController';\nimport SetTransition from '../singleTransition';\nimport AutocompleteHelperController from './autocompleteHelperController';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport liteMode from '../../helpers/liteMode';\n\nexport default class AutocompleteHelper extends EventListenerBase<{\n hidden: () => void,\n visible: () => void,\n hiding: () => void\n}> {\n protected hidden = true;\n protected container: HTMLElement;\n protected list: HTMLElement;\n protected resetTarget: () => void;\n protected attach: () => void;\n protected detach: () => void;\n protected init?(): void;\n\n protected controller: AutocompleteHelperController;\n protected listType: 'xy' | 'x' | 'y';\n protected onSelect: ListNavigationOptions['onSelect'];\n protected waitForKey?: string[];\n\n protected navigationItem: NavigationItem;\n\n constructor(options: {\n appendTo: HTMLElement,\n controller?: AutocompleteHelper['controller'],\n listType: AutocompleteHelper['listType'],\n onSelect: AutocompleteHelper['onSelect'],\n waitForKey?: AutocompleteHelper['waitForKey']\n }) {\n super(false);\n\n safeAssign(this, options);\n\n this.container = document.createElement('div');\n this.container.classList.add('autocomplete-helper', 'z-depth-1');\n\n options.appendTo.append(this.container);\n\n this.attachNavigation();\n\n this.controller?.addHelper(this);\n }\n\n public toggleListNavigation(enabled: boolean) {\n if(enabled) {\n this.attach?.();\n } else {\n this.detach?.();\n }\n }\n\n protected onVisible = () => {\n this.detach?.(); // it can be so because 'visible' calls before animation's end\n\n const list = this.list;\n const {attach, detach, resetTarget} = attachListNavigation({\n list,\n type: this.listType,\n onSelect: this.onSelect,\n once: true,\n waitForKey: this.waitForKey\n });\n\n this.attach = attach;\n this.detach = detach;\n this.resetTarget = resetTarget;\n if(!IS_MOBILE && !this.navigationItem) {\n this.navigationItem = {\n type: 'autocomplete-helper',\n onPop: () => {\n this.navigationItem = undefined;\n this.toggle(true);\n },\n noBlurOnPop: true\n };\n\n appNavigationController.pushItem(this.navigationItem);\n }\n\n this.addEventListener('hidden', () => {\n this.resetTarget = undefined;\n this.attach = undefined;\n this.detach = undefined;\n\n list.innerHTML = '';\n detach();\n\n if(this.navigationItem) {\n appNavigationController.removeItem(this.navigationItem);\n this.navigationItem = undefined;\n }\n }, {once: true});\n };\n\n protected attachNavigation() {\n this.addEventListener('visible', this.onVisible);\n }\n\n public toggle(hide?: boolean, fromController = false, skipAnimation?: boolean) {\n if(this.init) {\n return;\n }\n\n if(hide === undefined) {\n hide = this.container.classList.contains('is-visible') && !this.container.classList.contains('backwards');\n }\n\n if(this.hidden === hide) {\n if(!hide) {\n this.dispatchEvent('visible'); // reset target and listener\n }\n\n return;\n }\n\n this.hidden = hide;\n\n if(!hide) {\n this.controller && this.controller.hideOtherHelpers(this);\n this.dispatchEvent('visible'); // fire it before so target will be set\n } else {\n if(this.navigationItem) {\n appNavigationController.removeItem(this.navigationItem);\n this.navigationItem = undefined;\n }\n\n if(!fromController && this.controller) {\n this.controller.hideOtherHelpers();\n }\n\n this.detach?.(); // force detach here\n }\n\n const useRafs = this.controller || hide ? 0 : 2;\n\n if(hide) {\n this.dispatchEvent('hiding');\n }\n\n SetTransition({\n element: this.container,\n className: 'is-visible',\n forwards: !hide,\n duration: liteMode.isAvailable('animations') && !skipAnimation ? 300 : 0,\n onTransitionEnd: () => {\n this.hidden && this.dispatchEvent('hidden');\n },\n useRafs\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type Chat from './chat';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport preloadAnimatedEmojiSticker from '../../helpers/preloadAnimatedEmojiSticker';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport rootScope from '../../lib/rootScope';\nimport {EmoticonsDropdown} from '../emoticonsDropdown';\nimport {SuperStickerRenderer} from '../emoticonsDropdown/tabs/stickers';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport Scrollable from '../scrollable';\nimport attachStickerViewerListeners from '../stickerViewer';\nimport AutocompleteHelper from './autocompleteHelper';\nimport AutocompleteHelperController from './autocompleteHelperController';\n\nexport default class StickersHelper extends AutocompleteHelper {\n private scrollable: Scrollable;\n private superStickerRenderer: SuperStickerRenderer;\n private lazyLoadQueue: LazyLoadQueue;\n private onChangeScreen: () => void;\n private listenerSetter: ListenerSetter;\n\n constructor(\n appendTo: HTMLElement,\n controller: AutocompleteHelperController,\n private chat: Chat,\n private managers: AppManagers\n ) {\n super({\n appendTo,\n controller,\n listType: 'xy',\n onSelect: async(target) => {\n return !(await EmoticonsDropdown.onMediaClick({target}, true));\n },\n waitForKey: ['ArrowUp', 'ArrowDown']\n });\n\n this.container.classList.add('stickers-helper');\n\n this.addEventListener('visible', () => {\n setTimeout(() => { // it is not rendered yet\n this.scrollable.container.scrollTop = 0;\n }, 0);\n\n rootScope.dispatchEvent('choosing_sticker', true);\n });\n\n this.addEventListener('hidden', () => {\n if(this.onChangeScreen) {\n mediaSizes.removeEventListener('changeScreen', this.onChangeScreen);\n this.onChangeScreen = undefined;\n\n this.listenerSetter.removeAll();\n this.listenerSetter = undefined;\n }\n\n rootScope.dispatchEvent('choosing_sticker', false);\n });\n }\n\n public checkEmoticon(emoticon: string) {\n const middleware = this.controller.getMiddleware();\n\n this.lazyLoadQueue?.clear();\n\n preloadAnimatedEmojiSticker(emoticon);\n this.managers.appStickersManager.getStickersByEmoticon(emoticon, true, rootScope.settings.stickers.suggest === 'all')\n .then((stickers) => {\n if(!middleware()) {\n return;\n }\n\n if(this.init) {\n this.init();\n this.init = null;\n }\n\n const container = this.list.cloneNode() as HTMLElement;\n\n let ready: Promise;\n\n this.lazyLoadQueue.clear();\n if(stickers.length) {\n ready = new Promise((resolve) => {\n const promises: Promise[] = [];\n stickers.forEach((sticker) => {\n container.append(this.superStickerRenderer.renderSticker(sticker as MyDocument, undefined, promises));\n });\n\n (Promise.all(promises) as Promise).finally(resolve);\n });\n } else {\n ready = Promise.resolve();\n }\n\n ready.then(() => {\n this.list.replaceWith(container);\n this.list = container;\n\n if(!this.onChangeScreen) {\n this.onChangeScreen = () => {\n const width = (this.list.childElementCount * mediaSizes.active.esgSticker.width) + (this.list.childElementCount - 1 * 1);\n this.list.style.width = width + 'px';\n };\n mediaSizes.addEventListener('changeScreen', this.onChangeScreen);\n\n this.listenerSetter = new ListenerSetter();\n attachStickerViewerListeners({listenTo: this.container, listenerSetter: this.listenerSetter});\n }\n\n this.onChangeScreen();\n\n this.toggle(!stickers.length);\n this.scrollable.scrollTop = 0;\n });\n });\n }\n\n public init() {\n this.list = document.createElement('div');\n this.list.classList.add('stickers-helper-stickers', 'super-stickers');\n\n this.container.append(this.list);\n\n this.scrollable = new Scrollable(this.container);\n this.lazyLoadQueue = new LazyLoadQueue();\n this.superStickerRenderer = new SuperStickerRenderer(this.lazyLoadQueue, this.chat.animationGroup, this.managers);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport {SEND_WHEN_ONLINE_TIMESTAMP} from '../../lib/mtproto/constants';\nimport Button from '../button';\nimport PopupDatePicker from './datePicker';\n\nconst getMinDate = () => {\n const date = new Date();\n // date.setDate(date.getDate() - 1);\n date.setHours(0, 0, 0, 0);\n return date;\n};\n\nconst getMaxDate = () => {\n const date = new Date();\n date.setFullYear(date.getFullYear() + 1);\n date.setDate(date.getDate() - 1);\n return date;\n};\n\nconst checkDate = (date: Date) => {\n return date.getTime() > getMaxDate().getTime() ? new Date() : date;\n};\n\nexport default class PopupSchedule extends PopupDatePicker {\n constructor(initDate: Date, onPick: (timestamp: number) => void, canSendWhenOnline: boolean) {\n super(checkDate(initDate), onPick, {\n noButtons: true,\n noTitle: true,\n closable: true,\n withConfirm: true,\n minDate: getMinDate(),\n maxDate: getMaxDate(),\n withTime: true,\n showOverflowMonths: true,\n confirmShortcutIsSendShortcut: true,\n title: true\n });\n\n this.element.classList.add('popup-schedule');\n this.header.append(this.controlsDiv);\n this.title.replaceWith(this.monthTitle);\n this.body.append(this.btnConfirm);\n\n if(canSendWhenOnline) {\n const btnSendWhenOnline = Button('btn-primary btn-secondary btn-primary-transparent primary', {text: 'Schedule.SendWhenOnline'});\n this.body.append(btnSendWhenOnline);\n\n attachClickEvent(btnSendWhenOnline, () => {\n onPick(SEND_WHEN_ONLINE_TIMESTAMP);\n this.hide();\n });\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ChatInput from './input';\nimport {appendEmoji, getEmojiFromElement} from '../emoticonsDropdown/tabs/emoji';\nimport {ScrollableX} from '../scrollable';\nimport AutocompleteHelper from './autocompleteHelper';\nimport AutocompleteHelperController from './autocompleteHelperController';\nimport {AppManagers} from '../../lib/appManagers/managers';\n\nexport default class EmojiHelper extends AutocompleteHelper {\n private scrollable: ScrollableX;\n\n constructor(\n appendTo: HTMLElement,\n controller: AutocompleteHelperController,\n chatInput: ChatInput,\n private managers: AppManagers\n ) {\n super({\n appendTo,\n controller,\n listType: 'x',\n onSelect: (target) => {\n chatInput.onEmojiSelected(getEmojiFromElement(target as any), true);\n }\n });\n\n this.container.classList.add('emoji-helper');\n }\n\n public init() {\n this.list = document.createElement('div');\n this.list.classList.add('emoji-helper-emojis', 'super-emojis');\n\n this.container.append(this.list);\n\n this.scrollable = new ScrollableX(this.container);\n\n this.addEventListener('visible', () => {\n setTimeout(() => { // it is not rendered yet\n this.scrollable.container.scrollLeft = 0;\n }, 0);\n });\n }\n\n public render(emojis: string[], waitForKey: boolean) {\n if(this.init) {\n if(!emojis.length) {\n return;\n }\n\n this.init();\n this.init = null;\n }\n\n emojis = emojis.slice(0, 80);\n\n if(emojis.length) {\n this.list.innerHTML = '';\n emojis.forEach((emoji) => {\n appendEmoji(emoji, this.list, false, true);\n });\n }\n\n this.waitForKey = waitForKey ? ['ArrowUp', 'ArrowDown'] : undefined;\n this.toggle(!emojis.length);\n\n /* window.requestAnimationFrame(() => {\n this.container.style.width = (3 * 2) + (emojis.length * 44) + 'px';\n }); */\n }\n\n public checkQuery(query: string, firstChar: string) {\n const middleware = this.controller.getMiddleware();\n this.managers.appEmojiManager.getBothEmojiKeywords().then(async() => {\n if(!middleware()) {\n return;\n }\n\n const q = query.replace(/^:/, '');\n const emojis = await this.managers.appEmojiManager.searchEmojis(q);\n if(!middleware()) {\n return;\n }\n\n this.render(emojis, firstChar !== ':');\n // console.log(emojis);\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport AvatarElement from '../avatar';\nimport PeerTitle from '../peerTitle';\nimport Scrollable from '../scrollable';\nimport AutocompleteHelper from './autocompleteHelper';\nimport AutocompleteHelperController from './autocompleteHelperController';\n\nexport default class AutocompletePeerHelper extends AutocompleteHelper {\n protected static BASE_CLASS = 'autocomplete-peer-helper';\n protected static BASE_CLASS_LIST_ELEMENT = AutocompletePeerHelper.BASE_CLASS + '-list-element';\n private scrollable: Scrollable;\n\n constructor(\n appendTo: HTMLElement,\n controller: AutocompleteHelperController,\n protected className: string,\n onSelect: (target: Element) => boolean | void\n ) {\n super({\n appendTo,\n controller,\n listType: 'y',\n onSelect\n });\n\n this.container.classList.add(AutocompletePeerHelper.BASE_CLASS, className);\n }\n\n public init() {\n this.list = document.createElement('div');\n this.list.classList.add(AutocompletePeerHelper.BASE_CLASS + '-list', this.className + '-list');\n\n this.container.append(this.list);\n\n this.scrollable = new Scrollable(this.container);\n\n this.addEventListener('visible', () => {\n setTimeout(() => { // it is not rendered yet\n this.scrollable.container.scrollTop = 0;\n }, 0);\n });\n }\n\n public render(data: {peerId: PeerId, name?: string, description?: string}[], doNotShow?: boolean) {\n if(this.init) {\n if(!data.length) {\n return;\n }\n\n this.init();\n this.init = null;\n }\n\n if(data.length) {\n this.list.innerHTML = '';\n data.forEach((d) => {\n const div = AutocompletePeerHelper.listElement({\n className: this.className,\n peerId: d.peerId,\n name: d.name,\n description: d.description\n });\n\n this.list.append(div);\n });\n }\n\n if(!doNotShow) {\n this.toggle(!data.length);\n }\n }\n\n public static listElement(options: {\n className: string,\n peerId: PeerId,\n name?: string,\n description?: string\n }) {\n const BASE = AutocompletePeerHelper.BASE_CLASS_LIST_ELEMENT;\n options.className += '-list-element';\n\n const div = document.createElement('div');\n div.classList.add(BASE, options.className);\n div.dataset.peerId = '' + options.peerId;\n\n const avatar = new AvatarElement();\n avatar.classList.add('avatar-30', BASE + '-avatar', options.className + '-avatar');\n avatar.updateWithOptions({\n isDialog: false,\n peerId: options.peerId\n });\n\n const name = document.createElement('div');\n name.classList.add(BASE + '-name', options.className + '-name');\n if(!options.name) {\n name.append(new PeerTitle({\n peerId: options.peerId,\n dialog: false,\n onlyFirstName: false,\n plainText: false\n }).element);\n } else {\n setInnerHTML(name, wrapEmojiText(options.name));\n }\n\n div.append(avatar, name);\n\n if(options.description) {\n const description = document.createElement('div');\n description.classList.add(BASE + '-description', options.className + '-description');\n setInnerHTML(description, wrapEmojiText(options.description));\n div.append(description);\n }\n\n return div;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ChatInput from './input';\nimport type {BotInfo, ChatFull, UserFull} from '../../layer';\nimport AutocompleteHelperController from './autocompleteHelperController';\nimport AutocompletePeerHelper from './autocompletePeerHelper';\nimport SearchIndex from '../../lib/searchIndex';\nimport {AppManagers} from '../../lib/appManagers/managers';\n\nexport function processPeerFullForCommands(peerId: PeerId, full: ChatFull.chatFull | ChatFull.channelFull | UserFull.userFull, query?: string) {\n const botInfos: BotInfo.botInfo[] = [].concat(full.bot_info);\n let index: SearchIndex;\n\n if(query !== undefined) {\n index = new SearchIndex({\n ignoreCase: true\n });\n }\n\n type T = {peerId: PeerId, name: string, description: string, index: number, command: string};\n const commands: Map = new Map();\n botInfos.forEach((botInfo) => {\n if(!botInfo.commands) {\n return;\n }\n\n botInfo.commands.forEach(({command, description}, idx) => {\n const c = '/' + command;\n commands.set(command, {\n peerId: botInfo.user_id ? botInfo.user_id.toPeerId(false) : peerId,\n command: command,\n name: c,\n description: description,\n index: idx\n });\n\n if(index) {\n index.indexObject(command, c);\n }\n });\n });\n\n let out: T[];\n if(!index) {\n out = [...commands.values()];\n } else {\n const found = index.search(query);\n out = Array.from(found).map((command) => commands.get(command));\n }\n\n out = out.sort((a, b) => commands.get(a.command).index - commands.get(b.command).index);\n\n return out;\n}\n\nexport default class CommandsHelper extends AutocompletePeerHelper {\n constructor(\n appendTo: HTMLElement,\n controller: AutocompleteHelperController,\n chatInput: ChatInput,\n private managers: AppManagers\n ) {\n super(appendTo,\n controller,\n 'commands-helper',\n (target) => {\n const innerHTML = target.querySelector(`.${AutocompletePeerHelper.BASE_CLASS_LIST_ELEMENT}-name`).innerHTML;\n return chatInput.getReadyToSend(() => {\n chatInput.messageInput.innerHTML = innerHTML;\n chatInput.sendMessage(true);\n });\n }\n );\n }\n\n public async checkQuery(query: string, peerId: PeerId) {\n if(!(await this.managers.appUsersManager.isBot(peerId))) {\n return false;\n }\n\n const middleware = this.controller.getMiddleware();\n this.managers.appProfileManager.getProfileByPeerId(peerId).then((full) => {\n if(!middleware()) {\n return;\n }\n\n const filtered = processPeerFullForCommands(peerId, full, query);\n this.render(filtered);\n // console.log('found commands', found, filtered);\n });\n\n return true;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {getMiddleware} from '../../helpers/middleware';\nimport AutocompleteHelper from './autocompleteHelper';\n\nexport default class AutocompleteHelperController {\n private helpers: Set = new Set();\n private middleware = getMiddleware();\n /* private tempId = 0;\n\n public incrementToggleCount() {\n return ++this.tempId;\n }\n\n public getToggleCount() {\n return this.tempId;\n } */\n\n public toggleListNavigation(enabled: boolean) {\n for(const helper of this.helpers) {\n helper.toggleListNavigation(enabled);\n }\n }\n\n public getMiddleware() {\n this.middleware.clean();\n return this.middleware.get();\n }\n\n public addHelper(helper: AutocompleteHelper) {\n this.helpers.add(helper);\n }\n\n public hideOtherHelpers(preserveHelper?: AutocompleteHelper) {\n this.helpers.forEach((helper) => {\n if(helper !== preserveHelper) {\n helper.toggle(true, true);\n }\n });\n\n if(!preserveHelper) {\n this.middleware.clean();\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ChatInput from './input';\nimport type {MessageEntity} from '../../layer';\nimport AutocompleteHelperController from './autocompleteHelperController';\nimport AutocompletePeerHelper from './autocompletePeerHelper';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getPeerActiveUsernames from '../../lib/appManagers/utils/peers/getPeerActiveUsernames';\nimport rootScope from '../../lib/rootScope';\n\nexport default class MentionsHelper extends AutocompletePeerHelper {\n constructor(\n appendTo: HTMLElement,\n controller: AutocompleteHelperController,\n chatInput: ChatInput,\n private managers: AppManagers\n ) {\n super(\n appendTo,\n controller,\n 'mentions-helper',\n (target) => {\n const userId = (target as HTMLElement).dataset.peerId.toUserId();\n const user = Promise.resolve(managers.appUsersManager.getUser(userId)).then((user) => {\n let str = '', entity: MessageEntity;\n const usernames = getPeerActiveUsernames(user);\n if(usernames[0]) {\n str = '@' + usernames[0];\n } else {\n str = user.first_name || user.last_name;\n entity = {\n _: 'messageEntityMentionName',\n length: str.length,\n offset: 0,\n user_id: user.id\n };\n }\n\n str += ' ';\n chatInput.insertAtCaret(str, entity);\n });\n }\n );\n }\n\n public checkQuery(query: string, peerId: PeerId, topMsgId: number) {\n const trimmed = query.trim(); // check that there is no whitespace\n if(query.length !== trimmed.length) return false;\n\n const middleware = this.controller.getMiddleware();\n this.managers.appProfileManager.getMentions(peerId && peerId.toChatId(), trimmed, topMsgId).then(async(peerIds) => {\n if(!middleware()) return;\n\n peerIds = peerIds.filter((peerId) => peerId !== rootScope.myId);\n\n // const username = trimmed.slice(1).toLowerCase();\n\n const p = peerIds.map(async(peerId) => {\n const user = await this.managers.appUsersManager.getUser(peerId);\n const usernames = getPeerActiveUsernames(user);\n // if(usernames.length && usernames.some((_username) => _username.toLowerCase() === username)) { // hide full matched suggestion\n // return;\n // }\n\n return {\n peerId,\n description: usernames[0] ? '@' + usernames[0] : undefined\n };\n });\n\n this.render((await Promise.all(p)).filter(Boolean));\n });\n\n return true;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ChatInput from './input';\nimport DropdownHover from '../../helpers/dropdownHover';\nimport {KeyboardButton, ReplyMarkup} from '../../layer';\nimport rootScope from '../../lib/rootScope';\nimport ListenerSetter, {Listener} from '../../helpers/listenerSetter';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport findUpAsChild from '../../helpers/dom/findUpAsChild';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {getHeavyAnimationPromise} from '../../hooks/useHeavyAnimationCheck';\nimport confirmationPopup from '../confirmationPopup';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport Scrollable from '../scrollable';\n\nexport default class ReplyKeyboard extends DropdownHover {\n private static BASE_CLASS = 'reply-keyboard';\n private appendTo: HTMLElement;\n private listenerSetter: ListenerSetter;\n private managers: AppManagers;\n private btnHover: HTMLElement;\n private peerId: PeerId;\n private touchListener: Listener;\n private chatInput: ChatInput;\n private scrollable: Scrollable;\n\n constructor(options: {\n listenerSetter: ListenerSetter,\n managers: AppManagers,\n appendTo: HTMLElement,\n btnHover: HTMLElement,\n chatInput: ChatInput\n }) {\n super({\n element: document.createElement('div')\n });\n\n safeAssign(this, options);\n\n this.element.classList.add(ReplyKeyboard.BASE_CLASS);\n this.element.style.display = 'none';\n\n this.scrollable = new Scrollable();\n this.element.append(this.scrollable.container);\n\n this.attachButtonListener(this.btnHover, this.listenerSetter);\n this.listenerSetter.add(rootScope)('history_reply_markup', async({peerId}) => {\n if(this.peerId === peerId) {\n if(this.checkAvailability() && this.isActive()) {\n await this.render();\n }\n\n getHeavyAnimationPromise().then(() => {\n this.checkForceReply();\n });\n }\n });\n }\n\n public init() {\n this.appendTo.append(this.element);\n\n this.listenerSetter.add(this)('open', async() => {\n await this.render();\n\n if(IS_TOUCH_SUPPORTED) {\n this.touchListener = this.listenerSetter.add(document.body)('touchstart', this.onBodyTouchStart, {passive: false, capture: true}) as any as Listener;\n this.listenerSetter.add(this)('close', () => {\n this.listenerSetter.remove(this.touchListener);\n }, {once: true});\n }\n });\n\n attachClickEvent(this.element, (e) => {\n const target = findUpClassName(e.target, 'btn');\n if(!target) {\n return;\n }\n\n const type = target.dataset.type as KeyboardButton['_'];\n const {peerId} = this;\n switch(type) {\n case 'keyboardButtonRequestPhone': {\n confirmationPopup({\n titleLangKey: 'ShareYouPhoneNumberTitle',\n button: {\n langKey: 'OK'\n },\n descriptionLangKey: 'AreYouSureShareMyContactInfoBot'\n }).then(() => {\n this.managers.appMessagesManager.sendContact(peerId, rootScope.myId);\n });\n break;\n }\n\n default: {\n this.managers.appMessagesManager.sendText(peerId, target.dataset.text);\n break;\n }\n }\n\n this.toggle(false);\n }, {listenerSetter: this.listenerSetter});\n\n return super.init();\n }\n\n private onBodyTouchStart = (e: TouchEvent) => {\n const target = e.touches[0].target as HTMLElement;\n if(!findUpAsChild(target, this.element) && target !== this.btnHover) {\n cancelEvent(e);\n this.toggle(false);\n }\n };\n\n public async checkForceReply() {\n const replyMarkup = await this.getReplyMarkup();\n if(replyMarkup._ === 'replyKeyboardForceReply' &&\n !replyMarkup.pFlags.hidden &&\n !replyMarkup.pFlags.used) {\n replyMarkup.pFlags.used = true;\n this.chatInput.initMessageReply(replyMarkup.mid);\n }\n }\n\n private async getReplyMarkup(): Promise {\n return (await this.managers.appMessagesManager.getHistoryStorageTransferable(this.peerId)).replyMarkup ?? {\n _: 'replyKeyboardHide',\n pFlags: {}\n };\n }\n\n public async render(replyMarkup?: ReplyMarkup.replyKeyboardMarkup) {\n if(replyMarkup === undefined) {\n replyMarkup = await this.getReplyMarkup() as any;\n }\n\n this.scrollable.container.replaceChildren();\n\n for(const row of replyMarkup.rows) {\n const div = document.createElement('div');\n div.classList.add(ReplyKeyboard.BASE_CLASS + '-row');\n\n for(const button of row.buttons) {\n const btn = document.createElement('button');\n btn.classList.add(ReplyKeyboard.BASE_CLASS + '-button', 'btn');\n setInnerHTML(btn, wrapEmojiText(button.text));\n btn.dataset.text = button.text;\n btn.dataset.type = button._;\n div.append(btn);\n }\n\n this.scrollable.container.append(div);\n }\n }\n\n public async checkAvailability(replyMarkup?: ReplyMarkup) {\n if(replyMarkup === undefined) {\n replyMarkup = await this.getReplyMarkup();\n }\n\n const hide = replyMarkup._ === 'replyKeyboardHide' || !(replyMarkup as ReplyMarkup.replyInlineMarkup).rows?.length;\n this.btnHover.classList.toggle('hide', hide);\n\n if(hide) {\n this.toggle(false);\n }\n\n return !hide;\n }\n\n public setPeer(peerId: PeerId) {\n this.peerId = peerId;\n\n this.checkAvailability();\n this.checkForceReply();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type Chat from './chat';\nimport debounce from '../../helpers/schedulers/debounce';\nimport {WebDocument} from '../../layer';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport Scrollable from '../scrollable';\nimport AutocompleteHelper from './autocompleteHelper';\nimport AutocompleteHelperController from './autocompleteHelperController';\nimport Button from '../button';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport {MyPhoto} from '../../lib/appManagers/appPhotosManager';\nimport assumeType from '../../helpers/assumeType';\nimport GifsMasonry from '../gifsMasonry';\nimport {SuperStickerRenderer} from '../emoticonsDropdown/tabs/stickers';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport readBlobAsDataURL from '../../helpers/blob/readBlobAsDataURL';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport renderMediaWithFadeIn from '../../helpers/dom/renderMediaWithFadeIn';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\nimport generateQId from '../../lib/appManagers/utils/inlineBots/generateQId';\nimport appDownloadManager from '../../lib/appManagers/appDownloadManager';\nimport {AnimationItemGroup} from '../animationIntersector';\nimport wrapPhoto from '../wrappers/photo';\nimport {i18n} from '../../lib/langPack';\nimport {POSTING_NOT_ALLOWED_MAP} from './input';\n\nconst ANIMATION_GROUP: AnimationItemGroup = 'INLINE-HELPER';\n// const GRID_ITEMS = 5;\n\nexport default class InlineHelper extends AutocompleteHelper {\n private scrollable: Scrollable;\n private lazyLoadQueue: LazyLoadQueue;\n private gifsMasonry: GifsMasonry;\n private superStickerRenderer: SuperStickerRenderer;\n private onChangeScreen: () => void;\n public checkQuery: ReturnType>;\n\n constructor(\n appendTo: HTMLElement,\n controller: AutocompleteHelperController,\n private chat: Chat,\n private managers: AppManagers\n ) {\n super({\n appendTo,\n controller,\n listType: 'xy',\n waitForKey: ['ArrowUp', 'ArrowDown'],\n onSelect: (target) => {\n if(!target) return false; // can happen when there is only button\n const {peerId, botId, queryId} = this.list.dataset;\n return this.chat.input.getReadyToSend(() => {\n const queryAndResultIds = generateQId(queryId, (target as HTMLElement).dataset.resultId);\n this.managers.appInlineBotsManager.sendInlineResult(peerId.toPeerId(), botId, queryAndResultIds, {\n ...this.chat.getMessageSendingParams(),\n clearDraft: true\n });\n\n this.chat.input.onMessageSent(true, true);\n });\n }\n });\n\n this.container.classList.add('inline-helper');\n\n this.addEventListener('visible', () => {\n setTimeout(() => { // it is not rendered yet\n this.scrollable.container.scrollTop = 0;\n }, 0);\n });\n\n this.checkQuery = debounce(this._checkQuery, 200, true, true);\n\n this.addEventListener('hidden', () => {\n if(this.onChangeScreen) {\n mediaSizes.removeEventListener('changeScreen', this.onChangeScreen);\n this.onChangeScreen = undefined;\n }\n });\n }\n\n public _checkQuery = async(peerId: PeerId, username: string, query: string, canSendInline: boolean) => {\n const middleware = this.controller.getMiddleware();\n\n const peer = await this.managers.appUsersManager.resolveUsername(username);\n if(!middleware()) {\n throw 'PEER_CHANGED';\n }\n\n if(peer._ !== 'user' || !peer.pFlags.bot) {\n throw 'NOT_A_BOT';\n }\n\n if(!canSendInline) {\n if(!middleware()) {\n throw 'PEER_CHANGED';\n }\n\n if(this.init) {\n this.init();\n this.init = null;\n }\n\n this.container.classList.add('cant-send');\n this.toggle(false);\n throw 'NO_INLINES';\n }\n\n const renderPromise = this.managers.appInlineBotsManager.getInlineResults(peerId, peer.id, query).then((botResults) => {\n if(!middleware()) {\n throw 'PEER_CHANGED';\n }\n\n if(this.init) {\n this.init();\n this.init = null;\n }\n\n const list = this.list.cloneNode() as HTMLElement;\n list.dataset.peerId = '' + peerId;\n list.dataset.botId = '' + peer.id;\n list.dataset.queryId = '' + botResults.query_id;\n\n const gifsMasonry = new GifsMasonry(null, ANIMATION_GROUP, this.scrollable, false);\n\n this.lazyLoadQueue.clear();\n this.superStickerRenderer.clear();\n\n const loadPromises: Promise[] = [];\n const isGallery = !!botResults.pFlags.gallery;\n // botResults.results.length = 3;\n for(const item of botResults.results) {\n const container = document.createElement('div');\n container.classList.add('inline-helper-result');\n container.dataset.resultId = item.id;\n\n const preview = isGallery ? undefined : document.createElement('div');\n if(preview) {\n preview.classList.add('inline-helper-result-preview');\n\n container.append(preview);\n }\n\n list.append(container);\n\n if(!isGallery) {\n preview.classList.add('empty');\n setInnerHTML(preview, wrapEmojiText([...item.title.trim()][0]));\n\n const title = document.createElement('div');\n title.classList.add('inline-helper-result-title');\n setInnerHTML(title, wrapEmojiText(item.title));\n\n const description = document.createElement('div');\n description.classList.add('inline-helper-result-description');\n setInnerHTML(description, wrapRichText(item.description, {\n noCommands: true,\n noLinks: true\n }));\n\n container.append(title, description);\n\n const separator = document.createElement('div');\n separator.classList.add('inline-helper-separator');\n\n list.append(separator);\n } else {\n container.classList.add('grid-item');\n }\n\n if(item._ === 'botInlineResult') {\n if(item.thumb && item.thumb.mime_type.indexOf('image/') === 0) {\n let mediaContainer: HTMLElement;\n if(preview) {\n mediaContainer = document.createElement('div');\n preview.append(mediaContainer);\n } else {\n mediaContainer = container;\n }\n\n mediaContainer.classList.add('media-container');\n isGallery && mediaContainer.classList.add('no-border-radius');\n\n this.lazyLoadQueue.push({\n div: container,\n load: () => {\n return appDownloadManager.download({\n dcId: 4,\n location: {\n _: 'inputWebFileLocation',\n access_hash: (item.thumb as WebDocument.webDocument).access_hash,\n url: item.thumb.url\n },\n size: item.thumb.size,\n mimeType: item.thumb.mime_type\n }).then((blob) => {\n const image = new Image();\n image.classList.add('media-photo');\n readBlobAsDataURL(blob).then((dataURL) => {\n renderMediaWithFadeIn(mediaContainer, image, dataURL, true);\n });\n });\n }\n });\n }\n } else {\n const media = item.document as MyDocument || item.photo as MyPhoto;\n if((['sticker', 'gif'] as MyDocument['type'][]).includes((media as MyDocument)?.type) && isGallery) {\n assumeType(media);\n\n if(media.type === 'gif') {\n gifsMasonry.add(media, container);\n } else if(media.type === 'sticker') {\n container.classList.add('super-sticker');\n this.superStickerRenderer.renderSticker(media, container, loadPromises);\n if(media.animated) {\n this.superStickerRenderer.observeAnimated(container);\n }\n }\n } else if(media) {\n const size = isGallery ? 48 : undefined;\n isGallery && container.classList.add('no-border-radius');\n wrapPhoto({\n photo: media,\n container: isGallery ? container : preview,\n boxWidth: size,\n boxHeight: size,\n middleware,\n lazyLoadQueue: this.lazyLoadQueue,\n loadPromises\n });\n }\n }\n }\n\n return Promise.all(loadPromises).then(() => {\n if(!middleware()) {\n gifsMasonry.clear();\n return;\n }\n\n list.classList.toggle('is-gallery', isGallery);\n list.classList.toggle('super-stickers', isGallery);\n this.container.classList.toggle('is-gallery', isGallery);\n\n /* if(isGallery) {\n list.style.gridTemplateColumns = `repeat(${Math.min(botResults.results.length, 4)}, 1fr)`;\n }\n\n this.container.style.setProperty('width', isGallery ? `${Math.min(botResults.results.length, 4) * 25}%` : '', 'important'); */\n\n const parent = this.list.parentElement;\n parent.textContent = '';\n if(botResults.switch_pm) {\n const btnSwitchToPM = Button('btn-primary btn-secondary btn-primary-transparent primary');\n setInnerHTML(btnSwitchToPM, wrapEmojiText(botResults.switch_pm.text));\n attachClickEvent(btnSwitchToPM, (e) => {\n this.chat.appImManager.setInnerPeer({peerId});\n this.managers.appInlineBotsManager.switchToPM(peerId, peer.id, botResults.switch_pm.start_param);\n });\n parent.append(btnSwitchToPM);\n }\n parent.append(this.list = list);\n this.container.classList.remove('cant-send');\n\n this.gifsMasonry?.detach();\n this.gifsMasonry = gifsMasonry;\n gifsMasonry.attach();\n\n if(!this.onChangeScreen) {\n this.onChangeScreen = () => {\n if(this.list.classList.contains('is-gallery')) {\n const width = (this.list.childElementCount * mediaSizes.active.popupSticker.width) + (this.list.childElementCount - 1 * 1);\n this.list.style.width = width + 'px';\n } else {\n this.list.style.width = '';\n }\n };\n mediaSizes.addEventListener('changeScreen', this.onChangeScreen);\n }\n\n this.onChangeScreen();\n\n this.toggle(!botResults.results.length && !botResults.switch_pm);\n this.scrollable.scrollTop = 0;\n });\n });\n\n return {user: peer, renderPromise};\n };\n\n public init() {\n this.list = document.createElement('div');\n this.list.classList.add('inline-helper-results');\n\n this.container.append(this.list);\n\n this.scrollable = new Scrollable(this.container);\n this.lazyLoadQueue = new LazyLoadQueue();\n this.superStickerRenderer = new SuperStickerRenderer(this.lazyLoadQueue, ANIMATION_GROUP, this.managers);\n\n const span = i18n(POSTING_NOT_ALLOWED_MAP['send_inline']);\n span.classList.add('inline-helper-cant-send');\n this.container.append(span);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ChatInput from './input';\nimport callbackify from '../../helpers/callbackify';\nimport AutocompletePeerHelper from './autocompletePeerHelper';\nimport {processPeerFullForCommands} from './commandsHelper';\nimport {AppManagers} from '../../lib/appManagers/managers';\n\nconst CLASS_NAME = 'bot-commands';\nexport default class ChatBotCommands extends AutocompletePeerHelper {\n private userId: UserId;\n\n constructor(\n appendTo: HTMLElement,\n chatInput: ChatInput,\n private managers: AppManagers\n ) {\n super(appendTo, undefined, CLASS_NAME, (target) => {\n const innerHTML = target.querySelector(`.${AutocompletePeerHelper.BASE_CLASS_LIST_ELEMENT}-name`).innerHTML;\n return chatInput.getReadyToSend(() => {\n chatInput.messageInput.innerHTML = innerHTML;\n chatInput.sendMessage(true);\n this.toggle(true);\n });\n });\n }\n\n public setUserId(userId: UserId, middleware: () => boolean) {\n if(this.userId === userId && this.list?.childElementCount) {\n this.toggle(false);\n return;\n }\n\n this.userId = userId;\n return callbackify(this.managers.appProfileManager.getProfile(userId), (full) => {\n if(!middleware()) return;\n const filtered = processPeerFullForCommands(userId.toPeerId(false), full);\n\n const PADDING_TOP = 8;\n // const PADDING_BOTTOM = 8;\n const PADDING_BOTTOM = 24;\n const height = filtered.length * 50 + PADDING_TOP + PADDING_BOTTOM;\n this.container.style.setProperty('--height', height + 'px');\n\n this.render(filtered);\n\n // this.container.style.top =\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AckedResult} from '../lib/mtproto/superMessagePort';\nimport {Modify} from '../types';\n\nexport default async function modifyAckedResult(acked: AckedResult): Promise, {result: T | Promise}>> {\n return {\n cached: acked.cached,\n result: acked.cached ? await acked.result : acked.result\n };\n}\n\nexport function modifyAckedPromise(promise: Promise>) {\n return promise.then(modifyAckedResult);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport callbackify from '../../helpers/callbackify';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport liteMode from '../../helpers/liteMode';\nimport {getMiddleware} from '../../helpers/middleware';\nimport {modifyAckedPromise} from '../../helpers/modifyAckedResult';\nimport {ChatFull} from '../../layer';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport {i18n} from '../../lib/langPack';\nimport {AckedResult} from '../../lib/mtproto/superMessagePort';\nimport rootScope from '../../lib/rootScope';\nimport AvatarElement from '../avatar';\nimport {ButtonMenuItemOptions, ButtonMenuSync} from '../buttonMenu';\nimport ButtonMenuToggle from '../buttonMenuToggle';\nimport PeerTitle from '../peerTitle';\nimport SetTransition from '../singleTransition';\nimport getChatMembersString from '../wrappers/getChatMembersString';\n\nconst SEND_AS_ANIMATION_DURATION = 300;\n\nexport default class ChatSendAs {\n private avatar: AvatarElement;\n private container: HTMLElement;\n private closeBtn: HTMLElement;\n private btnMenu: HTMLElement;\n private sendAsPeerIds: PeerId[];\n private sendAsPeerId: PeerId;\n private updatingPromise: ReturnType;\n private middleware: ReturnType;\n private listenerSetter: ListenerSetter;\n private peerId: PeerId;\n private addedListener: boolean;\n private buttons: ButtonMenuItemOptions[];\n\n constructor(\n private managers: AppManagers,\n private onReady: (container: HTMLElement, skipAnimation?: boolean) => void,\n private onChange: (sendAsPeerId: PeerId) => void\n ) {\n this.middleware = getMiddleware();\n this.listenerSetter = new ListenerSetter();\n this.construct();\n }\n\n private construct() {\n this.container = document.createElement('div');\n this.container.classList.add('new-message-send-as-container');\n\n this.closeBtn = document.createElement('div');\n this.closeBtn.classList.add('new-message-send-as-close', 'new-message-send-as-avatar', 'tgico-close');\n\n const sendAsButtons: ButtonMenuItemOptions[] = [{\n text: 'SendMessageAsTitle',\n onClick: undefined\n }];\n\n this.buttons = [];\n\n let previousAvatar: HTMLElement;\n const onSendAsMenuToggle = (visible: boolean) => {\n if(visible) {\n previousAvatar = this.avatar;\n }\n\n const isChanged = this.avatar !== previousAvatar;\n const useRafs = !visible && isChanged ? 2 : 0;\n\n SetTransition({\n element: this.closeBtn,\n className: 'is-visible',\n forwards: visible,\n duration: SEND_AS_ANIMATION_DURATION,\n useRafs\n });\n if(!isChanged) {\n SetTransition({\n element: previousAvatar,\n className: 'is-visible',\n forwards: !visible,\n duration: SEND_AS_ANIMATION_DURATION,\n useRafs\n });\n }\n };\n\n ButtonMenuToggle({\n buttonOptions: {noRipple: true},\n listenerSetter: this.listenerSetter,\n container: this.container,\n direction: 'top-right',\n buttons: sendAsButtons,\n onOpenBefore: () => {\n onSendAsMenuToggle(true);\n },\n onOpen: (e, btnMenu) => {\n sendAsButtons[0].element.classList.add('btn-menu-item-header');\n this.btnMenu = btnMenu as any;\n this.btnMenu.classList.add('scrollable', 'scrollable-y');\n this.btnMenu.append(...this.buttons.map((button) => button.element));\n },\n onClose: () => {\n onSendAsMenuToggle(false);\n },\n onCloseAfter: () => {\n this.btnMenu = undefined;\n }\n });\n\n this.container.append(this.closeBtn);\n }\n\n private async updateButtons(peerIds: PeerId[]) {\n const promises: Promise[] = peerIds.map(async(sendAsPeerId, idx) => {\n const textElement = document.createElement('div');\n\n const subtitle = document.createElement('div');\n subtitle.classList.add('btn-menu-item-subtitle');\n if(sendAsPeerId.isUser()) {\n subtitle.append(i18n('Chat.SendAs.PersonalAccount'));\n } else if(sendAsPeerId === this.peerId) {\n subtitle.append(i18n('VoiceChat.DiscussionGroup'));\n } else {\n subtitle.append(await getChatMembersString(sendAsPeerId.toChatId()));\n }\n\n textElement.append(\n new PeerTitle({peerId: sendAsPeerId}).element,\n subtitle\n );\n\n return {\n onClick: idx ? async() => {\n const currentPeerId = this.peerId;\n this.changeSendAsPeerId(sendAsPeerId);\n\n const middleware = this.middleware.get();\n const executeButtonsUpdate = () => {\n if(this.sendAsPeerId !== sendAsPeerId || !middleware()) return;\n const peerIds = this.sendAsPeerIds.slice();\n indexOfAndSplice(peerIds, sendAsPeerId);\n peerIds.unshift(sendAsPeerId);\n this.updateButtons(peerIds);\n };\n\n if(liteMode.isAvailable('animations')) {\n setTimeout(executeButtonsUpdate, 250);\n } else {\n executeButtonsUpdate();\n }\n\n // return;\n this.managers.appMessagesManager.saveDefaultSendAs(currentPeerId, sendAsPeerId);\n } : undefined,\n textElement\n };\n });\n\n const buttons = await Promise.all(promises);\n const btnMenu = ButtonMenuSync({buttons}/* , this.listenerSetter */);\n buttons.forEach((button, idx) => {\n const peerId = peerIds[idx];\n const avatar = new AvatarElement();\n avatar.classList.add('avatar-26', 'btn-menu-item-icon');\n avatar.updateWithOptions({peerId});\n\n if(!idx) {\n avatar.classList.add('active');\n }\n\n button.element.prepend(avatar);\n });\n\n this.buttons = buttons;\n\n // if already opened\n this.btnMenu?.append(...this.buttons.map((button) => button.element));\n }\n\n private async updateAvatar(sendAsPeerId: PeerId, skipAnimation?: boolean) {\n const previousAvatar = this.avatar;\n if(previousAvatar) {\n if(previousAvatar.peerId === sendAsPeerId) {\n return;\n }\n }\n\n if(!previousAvatar) {\n skipAnimation = true;\n }\n\n const useRafs = skipAnimation ? 0 : 2;\n const duration = skipAnimation ? 0 : SEND_AS_ANIMATION_DURATION;\n const avatar = this.avatar = new AvatarElement();\n avatar.classList.add('new-message-send-as-avatar', 'avatar-30');\n await avatar.updateWithOptions({\n isDialog: false,\n peerId: sendAsPeerId\n });\n\n SetTransition({\n element: avatar,\n className: 'is-visible',\n forwards: true,\n duration,\n useRafs\n });\n if(previousAvatar) {\n SetTransition({\n element: previousAvatar,\n className: 'is-visible',\n forwards: false,\n duration,\n onTransitionEnd: () => {\n previousAvatar.remove();\n },\n useRafs\n });\n }\n\n this.container.append(avatar);\n }\n\n private changeSendAsPeerId(sendAsPeerId: PeerId, skipAnimation?: boolean) {\n this.sendAsPeerId = sendAsPeerId;\n this.onChange(sendAsPeerId);\n return this.updateAvatar(sendAsPeerId, skipAnimation);\n }\n\n private getDefaultSendAs(): Promise> {\n // return rootScope.myId;\n return this.managers.acknowledged.appProfileManager.getChannelFull(this.peerId.toChatId()).then((acked) => {\n return {\n cached: acked.cached,\n result: acked.result.then((channelFull) => {\n return channelFull.default_send_as ? getPeerId(channelFull.default_send_as) : undefined\n })\n };\n });\n }\n\n public async updateManual(skipAnimation?: boolean): Promise<() => void> {\n const peerId = this.peerId;\n if(this.updatingPromise || !(await this.managers.appPeersManager.isChannel(peerId))) {\n return;\n }\n\n const middleware = this.middleware.get(() => {\n return !this.updatingPromise || this.updatingPromise === updatingPromise;\n });\n\n const {container} = this;\n const chatId = peerId.toChatId();\n const result = (await modifyAckedPromise(this.getDefaultSendAs())).result;\n // const result = Promise.resolve(this.getDefaultSendAs());\n\n const wasSkippingAnimation = skipAnimation;\n if(result instanceof Promise) {\n skipAnimation = undefined;\n }\n\n const auto = wasSkippingAnimation && !skipAnimation;\n\n const updatingPromise = this.updatingPromise = callbackify(result, async(sendAsPeerId) => {\n if(!middleware() || sendAsPeerId === undefined) return;\n\n await this.changeSendAsPeerId(sendAsPeerId, skipAnimation);\n if(!middleware()) return;\n\n this.managers.appChatsManager.getSendAs(chatId).then((sendAsPeers) => {\n if(!middleware()) return;\n\n const peers = sendAsPeers.filter((sendAsPeer) => !sendAsPeer.pFlags.premium_required).map((sendAsPeer) => sendAsPeer.peer);\n const peerIds = peers.map((peer) => getPeerId(peer));\n this.sendAsPeerIds = peerIds.slice();\n\n indexOfAndSplice(peerIds, sendAsPeerId);\n peerIds.unshift(sendAsPeerId);\n this.updateButtons(peerIds);\n });\n\n const callback = () => {\n this.onReady(container, skipAnimation);\n\n if(!this.addedListener) {\n this.listenerSetter.add(rootScope)('peer_full_update', (peerId) => {\n if(this.peerId === peerId) {\n this.update();\n }\n });\n\n this.addedListener = true;\n }\n };\n\n if(auto) {\n callback();\n return;\n }\n\n return callback;\n });\n\n updatingPromise.finally(() => {\n if(this.updatingPromise === updatingPromise) {\n this.updatingPromise = undefined;\n }\n });\n\n if(!auto) {\n return updatingPromise;\n }\n }\n\n public update(skipAnimation?: boolean) {\n return this.updateManual(skipAnimation).then((callback) => callback?.());\n }\n\n public setPeerId(peerId?: PeerId) {\n /* if(this.avatar) {\n this.avatar.remove();\n this.avatar = undefined;\n } */\n\n this.middleware.clean();\n this.updatingPromise = undefined;\n this.peerId = peerId;\n }\n\n public destroy() {\n this.container.remove();\n this.setPeerId();\n this.listenerSetter.removeAll();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport {AppImManager, APP_TABS} from '../../lib/appManagers/appImManager';\nimport type {MyDraftMessage} from '../../lib/appManagers/appDraftsManager';\nimport type Chat from './chat';\nimport Recorder from '../../../public/recorder.min';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\n// import Recorder from '../opus-recorder/dist/recorder.min';\nimport opusDecodeController from '../../lib/opusDecodeController';\nimport {ButtonMenuItemOptions, ButtonMenuItemOptionsVerifiable, ButtonMenuSync} from '../buttonMenu';\nimport emoticonsDropdown from '../emoticonsDropdown';\nimport PopupCreatePoll from '../popups/createPoll';\nimport PopupForward from '../popups/forward';\nimport PopupNewMedia from '../popups/newMedia';\nimport {toast, toastNew} from '../toast';\nimport {MessageEntity, DraftMessage, WebPage, Message, UserFull, AttachMenuPeerType} from '../../layer';\nimport StickersHelper from './stickersHelper';\nimport ButtonIcon from '../buttonIcon';\nimport ButtonMenuToggle from '../buttonMenuToggle';\nimport ListenerSetter, {Listener} from '../../helpers/listenerSetter';\nimport Button from '../button';\nimport PopupSchedule from '../popups/schedule';\nimport SendMenu from './sendContextMenu';\nimport rootScope from '../../lib/rootScope';\nimport PopupPinMessage from '../popups/unpinMessage';\nimport tsNow from '../../helpers/tsNow';\nimport appNavigationController, {NavigationItem} from '../appNavigationController';\nimport {IS_MOBILE, IS_MOBILE_SAFARI} from '../../environment/userAgent';\nimport I18n, {i18n, join, LangPackKey} from '../../lib/langPack';\nimport {generateTail} from './bubbles';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport ButtonCorner from '../buttonCorner';\nimport blurActiveElement from '../../helpers/dom/blurActiveElement';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport cancelSelection from '../../helpers/dom/cancelSelection';\nimport {attachClickEvent, simulateClickEvent} from '../../helpers/dom/clickEvent';\nimport isInputEmpty from '../../helpers/dom/isInputEmpty';\nimport isSendShortcutPressed from '../../helpers/dom/isSendShortcutPressed';\nimport placeCaretAtEnd from '../../helpers/dom/placeCaretAtEnd';\nimport {MarkdownType} from '../../helpers/dom/getRichElementValue';\nimport getRichValueWithCaret from '../../helpers/dom/getRichValueWithCaret';\nimport EmojiHelper from './emojiHelper';\nimport CommandsHelper from './commandsHelper';\nimport AutocompleteHelperController from './autocompleteHelperController';\nimport AutocompleteHelper from './autocompleteHelper';\nimport MentionsHelper from './mentionsHelper';\nimport fixSafariStickyInput from '../../helpers/dom/fixSafariStickyInput';\nimport ReplyKeyboard from './replyKeyboard';\nimport InlineHelper from './inlineHelper';\nimport debounce from '../../helpers/schedulers/debounce';\nimport noop from '../../helpers/noop';\nimport {putPreloader} from '../putPreloader';\nimport SetTransition from '../singleTransition';\nimport PeerTitle from '../peerTitle';\nimport {fastRaf} from '../../helpers/schedulers';\nimport PopupDeleteMessages from '../popups/deleteMessages';\nimport fixSafariStickyInputFocusing, {IS_STICKY_INPUT_BUGGED} from '../../helpers/dom/fixSafariStickyInputFocusing';\nimport PopupPeer from '../popups/peer';\nimport MEDIA_MIME_TYPES_SUPPORTED from '../../environment/mediaMimeTypesSupport';\nimport appMediaPlaybackController from '../appMediaPlaybackController';\nimport {BOT_START_PARAM, NULL_PEER_ID} from '../../lib/mtproto/mtproto_config';\nimport setCaretAt from '../../helpers/dom/setCaretAt';\nimport CheckboxField from '../checkboxField';\nimport DropdownHover from '../../helpers/dropdownHover';\nimport RadioForm from '../radioForm';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport toggleDisability from '../../helpers/dom/toggleDisability';\nimport callbackify from '../../helpers/callbackify';\nimport ChatBotCommands from './botCommands';\nimport copy from '../../helpers/object/copy';\nimport toHHMMSS from '../../helpers/string/toHHMMSS';\nimport documentFragmentToHTML from '../../helpers/dom/documentFragmentToHTML';\nimport PopupElement from '../popups';\nimport getEmojiEntityFromEmoji from '../../lib/richTextProcessor/getEmojiEntityFromEmoji';\nimport mergeEntities from '../../lib/richTextProcessor/mergeEntities';\nimport parseEntities from '../../lib/richTextProcessor/parseEntities';\nimport parseMarkdown from '../../lib/richTextProcessor/parseMarkdown';\nimport wrapDraftText from '../../lib/richTextProcessor/wrapDraftText';\nimport wrapDraft from '../wrappers/draft';\nimport wrapMessageForReply from '../wrappers/messageForReply';\nimport getServerMessageId from '../../lib/appManagers/utils/messageId/getServerMessageId';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport contextMenuController from '../../helpers/contextMenuController';\nimport {emojiFromCodePoints} from '../../vendor/emoji';\nimport {modifyAckedPromise} from '../../helpers/modifyAckedResult';\nimport ChatSendAs from './sendAs';\nimport filterAsync from '../../helpers/array/filterAsync';\nimport InputFieldAnimated from '../inputFieldAnimated';\nimport getStickerEffectThumb from '../../lib/appManagers/utils/stickers/getStickerEffectThumb';\nimport PopupStickers from '../popups/stickers';\nimport wrapPeerTitle from '../wrappers/peerTitle';\nimport wrapReply from '../wrappers/reply';\nimport {getEmojiFromElement} from '../emoticonsDropdown/tabs/emoji';\nimport hasMarkupInSelection from '../../helpers/dom/hasMarkupInSelection';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport RichInputHandler from '../../helpers/dom/richInputHandler';\nimport {insertRichTextAsHTML} from '../inputField';\nimport getCaretPosNew from '../../helpers/dom/getCaretPosNew';\nimport draftsAreEqual from '../../lib/appManagers/utils/drafts/draftsAreEqual';\nimport isSelectionEmpty from '../../helpers/dom/isSelectionEmpty';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport getAttachMenuBotIcon from '../../lib/appManagers/utils/attachMenuBots/getAttachMenuBotIcon';\nimport TelegramWebView from '../telegramWebView';\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport {MARKDOWN_ENTITIES} from '../../lib/richTextProcessor';\nimport IMAGE_MIME_TYPES_SUPPORTED from '../../environment/imageMimeTypesSupport';\nimport VIDEO_MIME_TYPES_SUPPORTED from '../../environment/videoMimeTypesSupport';\nimport {ChatRights} from '../../lib/appManagers/appChatsManager';\nimport PopupGiftPremium from '../popups/giftPremium';\n\nconst RECORD_MIN_TIME = 500;\n\nexport const POSTING_NOT_ALLOWED_MAP: {[action in ChatRights]?: LangPackKey} = {\n send_voices: 'GlobalAttachVoiceRestricted',\n send_stickers: 'GlobalAttachStickersRestricted',\n send_gifs: 'GlobalAttachGifRestricted',\n send_media: 'GlobalAttachMediaRestricted',\n send_plain: 'GlobalSendMessageRestricted',\n send_polls: 'ErrorSendRestrictedPollsAll',\n send_inline: 'GlobalAttachInlineRestricted'\n};\n\ntype ChatInputHelperType = 'edit' | 'webpage' | 'forward' | 'reply';\n\nexport default class ChatInput {\n // private static AUTO_COMPLETE_REG_EXP = /(\\s|^)((?::|.)(?!.*[:@]).*|(?:[@\\/]\\S*))$/;\n private static AUTO_COMPLETE_REG_EXP = /(\\s|^)((?:(?:@|^\\/)\\S*)|(?::|^[^:@\\/])(?!.*[:@\\/]).*)$/;\n public messageInput: HTMLElement;\n public messageInputField: InputFieldAnimated;\n private fileInput: HTMLInputElement;\n private inputMessageContainer: HTMLDivElement;\n private btnSend: HTMLButtonElement;\n private btnCancelRecord: HTMLButtonElement;\n public lastUrl = '';\n private lastTimeType = 0;\n\n public chatInput: HTMLElement;\n public inputContainer: HTMLElement;\n public rowsWrapper: HTMLDivElement;\n private newMessageWrapper: HTMLDivElement;\n private btnToggleEmoticons: HTMLButtonElement;\n private btnToggleReplyMarkup: HTMLButtonElement;\n private btnSendContainer: HTMLDivElement;\n\n private replyKeyboard: ReplyKeyboard;\n\n private attachMenu: HTMLElement;\n private attachMenuButtons: ButtonMenuItemOptionsVerifiable[];\n\n private sendMenu: SendMenu;\n\n private replyElements: {\n container: HTMLElement,\n cancelBtn: HTMLButtonElement,\n iconBtn: HTMLButtonElement\n } = {} as any;\n\n private forwardElements: {\n changePeer: ButtonMenuItemOptions,\n showSender: ButtonMenuItemOptions,\n hideSender: ButtonMenuItemOptions,\n showCaption: ButtonMenuItemOptions,\n hideCaption: ButtonMenuItemOptions,\n container: HTMLElement,\n modifyArgs?: ButtonMenuItemOptions[]\n };\n private forwardHover: DropdownHover;\n private forwardWasDroppingAuthor: boolean;\n\n private getWebPagePromise: Promise;\n public willSendWebPage: WebPage = null;\n private forwarding: {[fromPeerId: PeerId]: number[]};\n public replyToMsgId: number;\n public editMsgId: number;\n public editMessage: Message.message;\n private noWebPage: true;\n public scheduleDate: number;\n public sendSilent: true;\n public startParam: string;\n\n private recorder: any;\n public recording = false;\n private recordCanceled = false;\n private recordTimeEl: HTMLElement;\n private recordRippleEl: HTMLElement;\n private recordStartTime = 0;\n private recordingOverlayListener: Listener;\n private recordingNavigationItem: NavigationItem;\n\n // private scrollTop = 0;\n // private scrollOffsetTop = 0;\n // private scrollDiff = 0;\n\n public helperType: Exclude;\n private helperFunc: () => void | Promise;\n private helperWaitingForward: boolean;\n\n public willAttachType: 'document' | 'media';\n\n private lockRedo = false;\n private canRedoFromHTML = '';\n private readonly undoHistory: string[] = [];\n private readonly executedHistory: string[] = [];\n private canUndoFromHTML = '';\n\n private autocompleteHelperController: AutocompleteHelperController;\n private stickersHelper: StickersHelper;\n private emojiHelper: EmojiHelper;\n private commandsHelper: CommandsHelper;\n private mentionsHelper: MentionsHelper;\n private inlineHelper: InlineHelper;\n private listenerSetter: ListenerSetter;\n\n private pinnedControlBtn: HTMLButtonElement;\n\n private goDownBtn: HTMLButtonElement;\n private goDownUnreadBadge: HTMLElement;\n private goMentionBtn: HTMLButtonElement;\n private goMentionUnreadBadge: HTMLSpanElement;\n private btnScheduled: HTMLButtonElement;\n\n private btnPreloader: HTMLButtonElement;\n\n private saveDraftDebounced: () => void;\n\n private fakeRowsWrapper: HTMLDivElement;\n\n private previousQuery: string;\n\n private releaseMediaPlayback: () => void;\n\n private botStartBtn: HTMLButtonElement;\n private rowsWrapperWrapper: HTMLDivElement;\n private controlContainer: HTMLElement;\n private fakeSelectionWrapper: HTMLDivElement;\n\n private fakeWrapperTo: HTMLElement;\n private toggleBotStartBtnDisability: () => void;\n\n private botCommandsToggle: HTMLElement;\n private botCommands: ChatBotCommands;\n private botCommandsIcon: HTMLDivElement;\n private hasBotCommands: boolean;\n\n // private activeContainer: HTMLElement;\n\n private sendAs: ChatSendAs;\n public sendAsPeerId: PeerId;\n\n private replyInTopicOverlay: HTMLDivElement;\n private restoreInputLock: () => void;\n\n constructor(\n private chat: Chat,\n private appImManager: AppImManager,\n private managers: AppManagers\n ) {\n this.listenerSetter = new ListenerSetter();\n }\n\n public construct() {\n this.chatInput = document.createElement('div');\n this.chatInput.classList.add('chat-input', 'hide');\n\n this.inputContainer = document.createElement('div');\n this.inputContainer.classList.add('chat-input-container');\n\n this.rowsWrapperWrapper = document.createElement('div');\n this.rowsWrapperWrapper.classList.add('rows-wrapper-wrapper');\n\n this.rowsWrapper = document.createElement('div');\n this.rowsWrapper.classList.add('rows-wrapper', 'chat-input-wrapper');\n\n this.rowsWrapperWrapper.append(this.rowsWrapper);\n\n const tail = generateTail();\n this.rowsWrapper.append(tail);\n\n const fakeRowsWrapper = this.fakeRowsWrapper = document.createElement('div');\n fakeRowsWrapper.classList.add('fake-wrapper', 'fake-rows-wrapper');\n\n const fakeSelectionWrapper = this.fakeSelectionWrapper = document.createElement('div');\n fakeSelectionWrapper.classList.add('fake-wrapper', 'fake-selection-wrapper');\n\n this.inputContainer.append(this.rowsWrapperWrapper, fakeRowsWrapper, fakeSelectionWrapper);\n this.chatInput.append(this.inputContainer);\n\n this.goDownBtn = ButtonCorner({icon: 'arrow_down', className: 'bubbles-corner-button chat-secondary-button bubbles-go-down hide'});\n this.inputContainer.append(this.goDownBtn);\n\n attachClickEvent(this.goDownBtn, (e) => {\n cancelEvent(e);\n this.chat.bubbles.onGoDownClick();\n }, {listenerSetter: this.listenerSetter});\n\n // * constructor end\n\n /* let setScrollTopTimeout: number;\n // @ts-ignore\n let height = window.visualViewport.height; */\n // @ts-ignore\n // this.listenerSetter.add(window.visualViewport)('resize', () => {\n // const scrollable = this.chat.bubbles.scrollable;\n // const wasScrolledDown = scrollable.isScrolledDown;\n\n // /* if(wasScrolledDown) {\n // this.saveScroll();\n // } */\n\n // // @ts-ignore\n // let newHeight = window.visualViewport.height;\n // const diff = height - newHeight;\n // const scrollTop = scrollable.scrollTop;\n // const needScrollTop = wasScrolledDown ? scrollable.scrollHeight : scrollTop + diff; // * wasScrolledDown это проверка для десктоп хрома, когда пропадает панель загрузок снизу\n\n // console.log('resize before', scrollable.scrollTop, scrollable.container.clientHeight, scrollable.scrollHeight, wasScrolledDown, scrollable.lastScrollTop, diff, needScrollTop);\n\n // scrollable.scrollTop = needScrollTop;\n\n // if(setScrollTopTimeout) clearTimeout(setScrollTopTimeout);\n // setScrollTopTimeout = window.setTimeout(() => {\n // const diff = height - newHeight;\n // const isScrolledDown = scrollable.scrollHeight - Math.round(scrollable.scrollTop + scrollable.container.offsetHeight + diff) <= 1;\n // height = newHeight;\n\n // scrollable.scrollTop = needScrollTop;\n\n // console.log('resize after', scrollable.scrollTop, scrollable.container.clientHeight, scrollable.scrollHeight, scrollable.isScrolledDown, scrollable.lastScrollTop, isScrolledDown);\n\n // /* if(isScrolledDown) {\n // scrollable.scrollTop = scrollable.scrollHeight;\n // } */\n\n // //scrollable.scrollTop += diff;\n // setScrollTopTimeout = 0;\n // }, 0);\n // });\n\n // ! Can't use it with resizeObserver\n /* this.listenerSetter.add(window.visualViewport)('resize', () => {\n const scrollable = this.chat.bubbles.scrollable;\n const wasScrolledDown = scrollable.isScrolledDown;\n\n // @ts-ignore\n let newHeight = window.visualViewport.height;\n const diff = height - newHeight;\n const needScrollTop = wasScrolledDown ? scrollable.scrollHeight : scrollable.scrollTop + diff; // * wasScrolledDown это проверка для десктоп хрома, когда пропадает панель загрузок снизу\n\n //console.log('resize before', scrollable.scrollTop, scrollable.container.clientHeight, scrollable.scrollHeight, wasScrolledDown, scrollable.lastScrollTop, diff, needScrollTop);\n\n scrollable.scrollTop = needScrollTop;\n height = newHeight;\n\n if(setScrollTopTimeout) clearTimeout(setScrollTopTimeout);\n setScrollTopTimeout = window.setTimeout(() => { // * try again for scrolled down Android Chrome\n scrollable.scrollTop = needScrollTop;\n\n //console.log('resize after', scrollable.scrollTop, scrollable.container.clientHeight, scrollable.scrollHeight, scrollable.isScrolledDown, scrollable.lastScrollTop, isScrolledDown);\n setScrollTopTimeout = 0;\n }, 0);\n }); */\n\n const c = this.controlContainer = document.createElement('div');\n c.classList.add('chat-input-control', 'chat-input-wrapper');\n this.inputContainer.append(c);\n }\n\n private createButtonIcon(...args: Parameters) {\n const button = ButtonIcon(...args);\n button.tabIndex = -1;\n return button;\n }\n\n public constructPeerHelpers() {\n this.replyElements.container = document.createElement('div');\n this.replyElements.container.classList.add('reply-wrapper');\n\n this.replyElements.iconBtn = this.createButtonIcon('');\n this.replyElements.cancelBtn = this.createButtonIcon('close reply-cancel', {noRipple: true});\n\n this.replyElements.container.append(this.replyElements.iconBtn, this.replyElements.cancelBtn);\n\n //\n\n const onHideAuthorClick = () => {\n isChangingAuthor = true;\n };\n\n const onHideCaptionClick = () => {\n isChangingAuthor = false;\n };\n\n const forwardElements: ChatInput['forwardElements'] = this.forwardElements = {} as any;\n let isChangingAuthor = false;\n const forwardButtons: ButtonMenuItemOptions[] = [\n forwardElements.showSender = {\n text: 'Chat.Alert.Forward.Action.Show1',\n onClick: onHideAuthorClick,\n checkForClose: () => this.canToggleHideAuthor(),\n checkboxField: new CheckboxField({checked: true})\n },\n forwardElements.hideSender = {\n text: 'Chat.Alert.Forward.Action.Hide1',\n onClick: onHideAuthorClick,\n checkForClose: () => this.canToggleHideAuthor(),\n checkboxField: new CheckboxField({checked: false})\n },\n forwardElements.showCaption = {\n text: 'Chat.Alert.Forward.Action.ShowCaption',\n onClick: onHideCaptionClick,\n checkboxField: new CheckboxField({checked: true})\n },\n forwardElements.hideCaption = {\n text: 'Chat.Alert.Forward.Action.HideCaption',\n onClick: onHideCaptionClick,\n checkboxField: new CheckboxField({checked: false})\n },\n forwardElements.changePeer = {\n text: 'Chat.Alert.Forward.Action.Another',\n onClick: () => {\n this.changeForwardRecipient();\n },\n icon: 'replace'\n }\n ];\n const forwardBtnMenu = forwardElements.container = ButtonMenuSync({\n buttons: forwardButtons,\n listenerSetter: this.listenerSetter\n });\n // forwardBtnMenu.classList.add('top-center');\n\n const children = Array.from(forwardBtnMenu.children) as HTMLElement[];\n const groups: {\n elements: HTMLElement[],\n onChange: (value: string, event: Event) => void\n }[] = [{\n elements: children.slice(0, 2),\n onChange: (value, e) => {\n const checked = !!+value;\n if(isChangingAuthor) {\n this.forwardWasDroppingAuthor = !checked;\n }\n\n const replyTitle = this.replyElements.container.querySelector('.reply-title');\n if(replyTitle) {\n const el = replyTitle.firstElementChild as HTMLElement;\n const i = I18n.weakMap.get(el) as I18n.IntlElement;\n const langPackKey: LangPackKey = forwardElements.showSender.checkboxField.checked ? 'Chat.Accessory.Forward' : 'Chat.Accessory.Hidden';\n i.key = langPackKey;\n i.update();\n }\n }\n }, {\n elements: children.slice(2, 4),\n onChange: (value) => {\n const checked = !!+value;\n let b: ButtonMenuItemOptions;\n if(checked && this.forwardWasDroppingAuthor !== undefined) {\n b = this.forwardWasDroppingAuthor ? forwardElements.hideSender : forwardElements.showSender;\n } else {\n b = checked ? forwardElements.showSender : forwardElements.hideSender;\n }\n\n b.checkboxField.checked = true;\n }\n }];\n groups.forEach((group) => {\n const container = RadioForm(group.elements.map((e) => {\n return {\n container: e,\n input: e.querySelector('input')\n };\n }), group.onChange);\n\n const hr = document.createElement('hr');\n container.append(hr);\n forwardBtnMenu.append(container);\n });\n\n forwardBtnMenu.append(forwardElements.changePeer.element);\n\n if(!IS_TOUCH_SUPPORTED) {\n const forwardHover = this.forwardHover = new DropdownHover({\n element: forwardBtnMenu\n });\n }\n\n forwardElements.modifyArgs = forwardButtons.slice(0, -1);\n this.replyElements.container.append(forwardBtnMenu);\n\n forwardElements.modifyArgs.forEach((b, idx) => {\n const {input} = b.checkboxField;\n input.type = 'radio';\n input.name = idx < 2 ? 'author' : 'caption';\n input.value = '' + +!(idx % 2);\n });\n\n //\n\n this.newMessageWrapper = document.createElement('div');\n this.newMessageWrapper.classList.add('new-message-wrapper');\n\n this.replyInTopicOverlay = document.createElement('div');\n this.replyInTopicOverlay.classList.add('reply-in-topic-overlay', 'hide');\n this.replyInTopicOverlay.append(i18n('Chat.Input.ReplyToAnswer'));\n\n this.btnToggleEmoticons = this.createButtonIcon('none toggle-emoticons', {noRipple: true});\n\n this.inputMessageContainer = document.createElement('div');\n this.inputMessageContainer.classList.add('input-message-container');\n\n this.goDownUnreadBadge = document.createElement('span');\n this.goDownUnreadBadge.classList.add('badge', 'badge-24', 'badge-primary');\n this.goDownBtn.append(this.goDownUnreadBadge);\n\n this.goMentionBtn = ButtonCorner({icon: 'mention', className: 'bubbles-corner-button chat-secondary-button bubbles-go-mention'});\n this.goMentionUnreadBadge = document.createElement('span');\n this.goMentionUnreadBadge.classList.add('badge', 'badge-24', 'badge-primary');\n this.goMentionBtn.append(this.goMentionUnreadBadge);\n this.inputContainer.append(this.goMentionBtn);\n\n attachClickEvent(this.goMentionBtn, (e) => {\n cancelEvent(e);\n const middleware = this.chat.bubbles.getMiddleware();\n this.managers.appMessagesManager.goToNextMention(this.chat.peerId, this.chat.threadId).then((mid) => {\n if(!middleware()) {\n return;\n }\n\n if(mid) {\n this.chat.setMessageId(mid);\n }\n });\n }, {listenerSetter: this.listenerSetter});\n\n this.btnScheduled = this.createButtonIcon('scheduled btn-scheduled float hide', {noRipple: true});\n\n attachClickEvent(this.btnScheduled, (e) => {\n this.appImManager.openScheduled(this.chat.peerId);\n }, {listenerSetter: this.listenerSetter});\n\n this.listenerSetter.add(rootScope)('scheduled_new', ({peerId}) => {\n if(this.chat.peerId !== peerId) {\n return;\n }\n\n this.btnScheduled.classList.remove('hide');\n });\n\n this.listenerSetter.add(rootScope)('scheduled_delete', ({peerId}) => {\n if(this.chat.peerId !== peerId) {\n return;\n }\n\n this.managers.appMessagesManager.getScheduledMessages(this.chat.peerId).then((value) => {\n this.btnScheduled.classList.toggle('hide', !value.length);\n });\n });\n\n this.btnToggleReplyMarkup = this.createButtonIcon('botcom toggle-reply-markup float hide', {noRipple: true});\n this.replyKeyboard = new ReplyKeyboard({\n appendTo: this.rowsWrapper,\n listenerSetter: this.listenerSetter,\n managers: this.managers,\n btnHover: this.btnToggleReplyMarkup,\n chatInput: this\n });\n this.listenerSetter.add(this.replyKeyboard)('open', () => this.btnToggleReplyMarkup.classList.add('active'));\n this.listenerSetter.add(this.replyKeyboard)('close', () => this.btnToggleReplyMarkup.classList.remove('active'));\n\n this.botCommands = new ChatBotCommands(this.rowsWrapper, this, this.managers);\n this.botCommandsToggle = document.createElement('div');\n this.botCommandsToggle.classList.add('new-message-bot-commands');\n\n const scaler = document.createElement('div');\n scaler.classList.add('new-message-bot-commands-icon-scale');\n\n const icon = this.botCommandsIcon = document.createElement('div');\n icon.classList.add('animated-menu-icon', 'animated-menu-close-icon');\n scaler.append(icon);\n this.botCommandsToggle.append(scaler);\n\n attachClickEvent(this.botCommandsToggle, (e) => {\n cancelEvent(e);\n const isShown = icon.classList.contains('state-back');\n if(isShown) {\n this.botCommands.toggle(true);\n icon.classList.remove('state-back');\n } else {\n this.botCommands.setUserId(this.chat.peerId.toUserId(), this.chat.bubbles.getMiddleware());\n icon.classList.add('state-back');\n }\n }, {listenerSetter: this.listenerSetter});\n\n this.botCommands.addEventListener('visible', () => {\n icon.classList.add('state-back');\n });\n\n this.botCommands.addEventListener('hiding', () => {\n icon.classList.remove('state-back');\n });\n\n // const getSendMediaRights = () => Promise.all([this.chat.canSend('send_photos'), this.chat.canSend('send_videos')]).then(([photos, videos]) => ({photos, videos}));\n\n const onAttachMediaClick = (photos: boolean, videos: boolean) => {\n this.fileInput.value = '';\n\n const accept = [\n ...(photos ? IMAGE_MIME_TYPES_SUPPORTED : []),\n ...(videos ? VIDEO_MIME_TYPES_SUPPORTED : [])\n ].join(', ');\n\n this.fileInput.setAttribute('accept', accept);\n this.willAttachType = 'media';\n this.fileInput.click();\n };\n\n this.attachMenuButtons = [{\n icon: 'image',\n text: 'Chat.Input.Attach.PhotoOrVideo',\n onClick: () => onAttachMediaClick(true, true)\n // verify: () => getSendMediaRights().then(({photos, videos}) => photos && videos)\n }, /* {\n icon: 'image',\n text: 'AttachPhoto',\n onClick: () => onAttachMediaClick(true, false),\n verify: () => getSendMediaRights().then(({photos, videos}) => photos && !videos)\n }, {\n icon: 'image',\n text: 'AttachVideo',\n onClick: () => onAttachMediaClick(false, true),\n verify: () => getSendMediaRights().then(({photos, videos}) => !photos && videos)\n }, */ {\n icon: 'document',\n text: 'Chat.Input.Attach.Document',\n onClick: () => {\n this.fileInput.value = '';\n this.fileInput.removeAttribute('accept');\n this.willAttachType = 'document';\n this.fileInput.click();\n }\n // verify: () => this.chat.canSend('send_docs')\n }, {\n icon: 'gift',\n text: 'GiftPremium',\n onClick: () => this.chat.appImManager.giftPremium(this.chat.peerId),\n verify: () => this.chat.canGiftPremium()\n }, {\n icon: 'poll',\n text: 'Poll',\n onClick: async() => {\n const action: ChatRights = 'send_polls';\n if(!(await this.chat.canSend(action))) {\n toastNew({langPackKey: POSTING_NOT_ALLOWED_MAP[action]});\n return;\n }\n\n PopupElement.createPopup(PopupCreatePoll, this.chat).show();\n },\n verify: () => this.chat.peerId.isAnyChat() || this.chat.isBot\n }];\n\n // preload the bots\n this.managers.appAttachMenuBotsManager.getAttachMenuBots();\n\n const attachMenuButtons = this.attachMenuButtons.slice();\n this.attachMenu = ButtonMenuToggle({\n buttonOptions: {noRipple: true},\n listenerSetter: this.listenerSetter,\n direction: 'top-left',\n buttons: this.attachMenuButtons,\n onOpenBefore: async() => {\n const attachMenuBots = await this.managers.appAttachMenuBotsManager.getAttachMenuBots();\n const buttons = attachMenuButtons.slice();\n const attachMenuBotsButtons = attachMenuBots.filter((attachMenuBot) => {\n return !attachMenuBot.pFlags.inactive;\n }).map((attachMenuBot) => {\n const icon = getAttachMenuBotIcon(attachMenuBot);\n const button: typeof buttons[0] = {\n regularText: wrapEmojiText(attachMenuBot.short_name),\n onClick: () => {\n this.managers.appAttachMenuBotsManager.requestWebView({\n botId: attachMenuBot.bot_id,\n peerId: this.chat.peerId,\n ...this.chat.getMessageSendingParams()\n }).then((webViewResultUrl) => {\n const SANDBOX_ATTRIBUTES = [\n 'allow-scripts',\n 'allow-same-origin',\n 'allow-popups',\n 'allow-forms',\n 'allow-modals',\n 'allow-storage-access-by-user-activation'\n ].join(' ');\n\n class P extends PopupElement<{\n finish: () => void\n }> {\n private telegramWebView: TelegramWebView;\n\n constructor(private url: string) {\n super('popup-payment popup-payment-verification', {\n closable: true,\n overlayClosable: true,\n body: true,\n titleRaw: attachMenuBot.short_name\n });\n\n this.d();\n }\n\n protected destroy() {\n this.telegramWebView.destroy();\n return super.destroy();\n }\n\n private d() {\n const telegramWebView = this.telegramWebView = new TelegramWebView({\n url: this.url,\n sandbox: SANDBOX_ATTRIBUTES\n });\n\n telegramWebView.iframe.classList.add('payment-verification');\n\n this.body.append(telegramWebView.iframe);\n this.show();\n telegramWebView.onMount();\n }\n }\n\n new P(webViewResultUrl.url);\n });\n },\n iconDoc: icon?.icon as MyDocument,\n verify: async() => {\n let found = false;\n\n const verifyMap: {\n [type in AttachMenuPeerType['_']]: () => boolean | Promise\n } = {\n attachMenuPeerTypeSameBotPM: () => this.chat.peerId.toUserId() === attachMenuBot.bot_id,\n attachMenuPeerTypeBotPM: () => this.chat.isBot,\n attachMenuPeerTypePM: () => this.chat.peerId.isUser(),\n attachMenuPeerTypeChat: () => this.chat.isAnyGroup,\n attachMenuPeerTypeBroadcast: () => this.chat.isBroadcast\n };\n\n for(const peerType of attachMenuBot.peer_types) {\n const verify = verifyMap[peerType._];\n found = await verify();\n if(found) {\n break;\n }\n }\n\n return found;\n }\n };\n\n return button;\n });\n\n buttons.splice(buttons.length, 0, ...attachMenuBotsButtons);\n this.attachMenuButtons.splice(0, this.attachMenuButtons.length, ...buttons);\n }\n });\n this.attachMenu.classList.add('attach-file', 'tgico-attach');\n this.attachMenu.classList.remove('tgico-more');\n\n // this.inputContainer.append(this.sendMenu);\n\n this.recordTimeEl = document.createElement('div');\n this.recordTimeEl.classList.add('record-time');\n\n this.fileInput = document.createElement('input');\n this.fileInput.type = 'file';\n this.fileInput.multiple = true;\n this.fileInput.style.display = 'none';\n\n this.newMessageWrapper.append(...[this.botCommandsToggle, this.btnToggleEmoticons, this.inputMessageContainer, this.btnScheduled, this.btnToggleReplyMarkup, this.attachMenu, this.recordTimeEl, this.fileInput].filter(Boolean));\n\n this.rowsWrapper.append(this.replyElements.container);\n this.autocompleteHelperController = new AutocompleteHelperController();\n this.stickersHelper = new StickersHelper(this.rowsWrapper, this.autocompleteHelperController, this.chat, this.managers);\n this.emojiHelper = new EmojiHelper(this.rowsWrapper, this.autocompleteHelperController, this, this.managers);\n this.commandsHelper = new CommandsHelper(this.rowsWrapper, this.autocompleteHelperController, this, this.managers);\n this.mentionsHelper = new MentionsHelper(this.rowsWrapper, this.autocompleteHelperController, this, this.managers);\n this.inlineHelper = new InlineHelper(this.rowsWrapper, this.autocompleteHelperController, this.chat, this.managers);\n this.rowsWrapper.append(this.newMessageWrapper);\n\n this.btnCancelRecord = this.createButtonIcon('binfilled btn-circle btn-record-cancel chat-secondary-button');\n\n this.btnSendContainer = document.createElement('div');\n this.btnSendContainer.classList.add('btn-send-container');\n\n this.recordRippleEl = document.createElement('div');\n this.recordRippleEl.classList.add('record-ripple');\n\n this.btnSend = this.createButtonIcon('none btn-circle btn-send animated-button-icon');\n this.btnSend.insertAdjacentHTML('afterbegin', `\n \n \n \n \n `);\n\n this.btnSendContainer.append(this.recordRippleEl, this.btnSend);\n\n this.sendMenu = new SendMenu({\n onSilentClick: () => {\n this.sendSilent = true;\n this.sendMessage();\n },\n onScheduleClick: () => {\n this.scheduleSending(undefined);\n },\n listenerSetter: this.listenerSetter,\n openSide: 'top-left',\n onContextElement: this.btnSend,\n onOpen: () => {\n return this.chat.type !== 'scheduled' && (!this.isInputEmpty() || !!Object.keys(this.forwarding).length);\n }\n });\n\n this.btnSendContainer.append(this.sendMenu.sendMenu);\n\n this.inputContainer.append(this.btnCancelRecord, this.btnSendContainer);\n\n emoticonsDropdown.attachButtonListener(this.btnToggleEmoticons, this.listenerSetter);\n this.listenerSetter.add(emoticonsDropdown)('open', this.onEmoticonsOpen);\n this.listenerSetter.add(emoticonsDropdown)('close', this.onEmoticonsClose);\n\n this.attachMessageInputField();\n\n /* this.attachMenu.addEventListener('mousedown', (e) => {\n const hidden = this.attachMenu.querySelectorAll('.hide');\n if(hidden.length === this.attachMenuButtons.length) {\n toast(POSTING_MEDIA_NOT_ALLOWED);\n cancelEvent(e);\n return false;\n }\n }, {passive: false, capture: true}); */\n\n this.listenerSetter.add(rootScope)('settings_updated', () => {\n if(this.stickersHelper || this.emojiHelper) {\n // this.previousQuery = undefined;\n this.previousQuery = '';\n this.checkAutocomplete();\n /* if(!rootScope.settings.stickers.suggest) {\n this.stickersHelper.checkEmoticon('');\n } else {\n this.onMessageInput();\n } */\n }\n\n this.messageInputField?.onFakeInput();\n });\n\n this.listenerSetter.add(rootScope)('draft_updated', ({peerId, threadId, draft, force}) => {\n if(this.chat.threadId !== threadId || this.chat.peerId !== peerId || this.chat.type === 'scheduled') return;\n this.setDraft(draft, true, force);\n });\n\n this.listenerSetter.add(this.appImManager)('peer_changing', (chat) => {\n if(this.chat === chat && (this.chat.type === 'chat' || this.chat.type === 'discussion')) {\n this.saveDraft();\n }\n });\n\n this.listenerSetter.add(this.appImManager)('chat_changing', ({from, to}) => {\n if(this.chat === from) {\n this.autocompleteHelperController.toggleListNavigation(false);\n } else if(this.chat === to) {\n this.autocompleteHelperController.toggleListNavigation(true);\n }\n });\n\n this.listenerSetter.add(rootScope)('scheduled_delete', ({peerId, mids}) => {\n if(this.chat.type === 'scheduled' && this.chat.peerId === peerId && mids.includes(this.editMsgId)) {\n this.onMessageSent();\n }\n });\n\n this.listenerSetter.add(rootScope)('history_delete', ({peerId, msgs}) => {\n if(this.chat.peerId === peerId && this.chat.type !== 'scheduled') {\n if(msgs.has(this.editMsgId)) {\n this.onMessageSent();\n }\n\n if(this.replyToMsgId && msgs.has(this.replyToMsgId)) {\n this.clearHelper('reply');\n }\n\n /* if(this.chat.isStartButtonNeeded()) {\n this.setStartParam(BOT_START_PARAM);\n } */\n }\n });\n\n this.listenerSetter.add(rootScope)('dialogs_multiupdate', (dialogs) => {\n if(dialogs.has(this.chat.peerId) && (this.chat.type === 'chat' || this.chat.type === 'discussion')) {\n if(this.startParam === BOT_START_PARAM) {\n this.setStartParam();\n } else { // updateNewMessage comes earlier than dialog appers\n this.center(true);\n }\n }\n });\n\n try {\n this.recorder = new Recorder({\n // encoderBitRate: 32,\n // encoderPath: \"../dist/encoderWorker.min.js\",\n encoderSampleRate: 48000,\n monitorGain: 0,\n numberOfChannels: 1,\n recordingGain: 1,\n reuseWorker: true\n });\n } catch(err) {\n console.error('Recorder constructor error:', err);\n }\n\n this.updateSendBtn();\n\n this.listenerSetter.add(this.fileInput)('change', (e) => {\n const files = (e.target as HTMLInputElement & EventTarget).files;\n if(!files.length) {\n return;\n }\n\n PopupElement.createPopup(PopupNewMedia, this.chat, Array.from(files).slice(), this.willAttachType);\n this.fileInput.value = '';\n }, false);\n\n /* let time = Date.now();\n this.btnSend.addEventListener('touchstart', (e) => {\n time = Date.now();\n });\n\n let eventName1 = 'touchend';\n this.btnSend.addEventListener(eventName1, (e: Event) => {\n //cancelEvent(e);\n console.log(eventName1 + ', time: ' + (Date.now() - time));\n });\n\n let eventName = 'mousedown';\n this.btnSend.addEventListener(eventName, (e: Event) => {\n cancelEvent(e);\n console.log(eventName + ', time: ' + (Date.now() - time));\n }); */\n attachClickEvent(this.btnSend, this.onBtnSendClick, {listenerSetter: this.listenerSetter, touchMouseDown: true});\n\n if(this.recorder) {\n attachClickEvent(this.btnCancelRecord, this.onCancelRecordClick, {listenerSetter: this.listenerSetter});\n\n this.recorder.onstop = () => {\n this.setRecording(false);\n this.chatInput.classList.remove('is-locked');\n this.recordRippleEl.style.transform = '';\n };\n\n this.recorder.ondataavailable = (typedArray: Uint8Array) => {\n if(this.releaseMediaPlayback) {\n this.releaseMediaPlayback();\n this.releaseMediaPlayback = undefined;\n }\n\n if(this.recordingOverlayListener) {\n this.listenerSetter.remove(this.recordingOverlayListener);\n this.recordingOverlayListener = undefined;\n }\n\n if(this.recordingNavigationItem) {\n appNavigationController.removeItem(this.recordingNavigationItem);\n this.recordingNavigationItem = undefined;\n }\n\n if(this.recordCanceled) {\n return;\n }\n\n const {peerId, threadId} = this.chat;\n const replyToMsgId = this.replyToMsgId;\n\n const duration = (Date.now() - this.recordStartTime) / 1000 | 0;\n const dataBlob = new Blob([typedArray], {type: 'audio/ogg'});\n /* const fileName = new Date().toISOString() + \".opus\";\n console.log('Recorder data received', typedArray, dataBlob); */\n\n // let perf = performance.now();\n opusDecodeController.decode(typedArray, true).then((result) => {\n // console.log('WAVEFORM!:', /* waveform, */performance.now() - perf);\n\n opusDecodeController.setKeepAlive(false);\n\n // тут objectURL ставится уже с audio/wav\n this.managers.appMessagesManager.sendFile(peerId, {\n file: dataBlob,\n isVoiceMessage: true,\n isMedia: true,\n duration,\n waveform: result.waveform,\n objectURL: result.url,\n replyToMsgId,\n threadId,\n clearDraft: true\n });\n\n this.onMessageSent(false, true);\n });\n };\n }\n\n attachClickEvent(this.replyElements.cancelBtn, this.onHelperCancel, {listenerSetter: this.listenerSetter});\n attachClickEvent(this.replyElements.container, this.onHelperClick, {listenerSetter: this.listenerSetter});\n\n this.saveDraftDebounced = debounce(() => this.saveDraft(), 2500, false, true);\n\n this.botStartBtn = Button('btn-primary btn-transparent text-bold chat-input-control-button');\n this.botStartBtn.append(i18n('BotStart'));\n\n attachClickEvent(this.botStartBtn, () => {\n const {startParam} = this;\n if(startParam === undefined) {\n return;\n }\n\n const toggle = this.toggleBotStartBtnDisability = toggleDisability([this.botStartBtn], true);\n const peerId = this.chat.peerId;\n const middleware = this.chat.bubbles.getMiddleware(() => {\n return this.chat.peerId === peerId && this.startParam === startParam && this.toggleBotStartBtnDisability === toggle;\n });\n\n this.managers.appMessagesManager.startBot(peerId.toUserId(), undefined, startParam).then(() => {\n if(middleware()) {\n toggle();\n this.toggleBotStartBtnDisability = undefined;\n this.setStartParam();\n }\n });\n }, {listenerSetter: this.listenerSetter});\n\n this.controlContainer.append(this.botStartBtn, this.replyInTopicOverlay);\n\n // * pinned part start\n this.pinnedControlBtn = Button('btn-primary btn-transparent text-bold chat-input-control-button', {icon: 'unpin'});\n this.controlContainer.append(this.pinnedControlBtn);\n\n this.listenerSetter.add(this.pinnedControlBtn)('click', () => {\n const peerId = this.chat.peerId;\n\n PopupElement.createPopup(PopupPinMessage, peerId, 0, true, () => {\n this.chat.appImManager.setPeer(); // * close tab\n\n // ! костыль, это скроет закреплённые сообщения сразу, вместо того, чтобы ждать пока анимация перехода закончится\n const originalChat = this.chat.appImManager.chat;\n if(originalChat.topbar.pinnedMessage) {\n originalChat.topbar.pinnedMessage.pinnedMessageContainer.toggle(true);\n }\n });\n });\n // * pinned part end\n }\n\n public _center(neededFakeContainer: HTMLElement, animate?: boolean) {\n if(!neededFakeContainer && !this.inputContainer.classList.contains('is-centering')) {\n return;\n }\n\n if(neededFakeContainer === this.fakeWrapperTo) {\n return;\n }\n\n /* if(neededFakeContainer === this.botStartContainer && this.fakeWrapperTo === this.fakeSelectionWrapper) {\n this.inputContainer.classList.remove('is-centering');\n void this.rowsWrapper.offsetLeft; // reflow\n // this.inputContainer.classList.add('is-centering');\n // void this.rowsWrapper.offsetLeft; // reflow\n } */\n\n const fakeSelectionWrapper = neededFakeContainer || this.fakeWrapperTo;\n const forwards = !!neededFakeContainer;\n const oldFakeWrapperTo = this.fakeWrapperTo;\n let transform = '', borderRadius = '', needTranslateX: number;\n // if(forwards) {]\n const fakeSelectionRect = fakeSelectionWrapper.getBoundingClientRect();\n const fakeRowsRect = this.fakeRowsWrapper.getBoundingClientRect();\n const widthFrom = fakeRowsRect.width;\n const widthTo = fakeSelectionRect.width;\n\n if(widthFrom !== widthTo) {\n const scale = (widthTo/* - 8 */) / widthFrom;\n const initTranslateX = (widthFrom - widthTo) / 2;\n needTranslateX = fakeSelectionRect.left - fakeRowsRect.left - initTranslateX;\n\n if(forwards) {\n transform = `translateX(${needTranslateX}px) scaleX(${scale})`;\n // transform = `translateX(0px) scaleX(${scale})`;\n\n if(scale < 1) {\n const br = 16;\n borderRadius = '' + (br + br * (1 - scale)) + 'px';\n }\n }\n // scale = widthTo / widthFrom;\n }\n // }\n\n this.fakeWrapperTo = neededFakeContainer;\n\n const duration = animate ? 200 : 0;\n SetTransition({\n element: this.inputContainer,\n className: 'is-centering',\n forwards,\n duration\n });\n SetTransition({\n element: this.rowsWrapperWrapper,\n className: 'is-centering-to-control',\n forwards: !!(forwards && neededFakeContainer && neededFakeContainer.classList.contains('chat-input-control')),\n duration\n });\n this.rowsWrapper.style.transform = transform;\n this.rowsWrapper.style.borderRadius = borderRadius;\n\n return {\n transform,\n borderRadius,\n needTranslateX: oldFakeWrapperTo && (\n (\n neededFakeContainer &&\n neededFakeContainer.classList.contains('chat-input-control') &&\n oldFakeWrapperTo === this.fakeSelectionWrapper\n ) || oldFakeWrapperTo.classList.contains('chat-input-control')\n ) ? needTranslateX * -.5 : needTranslateX,\n widthFrom,\n widthTo\n };\n }\n\n public async center(animate = false) {\n return this._center(await this.getNeededFakeContainer(), animate);\n }\n\n public setStartParam(startParam?: string) {\n if(this.startParam === startParam) {\n return;\n }\n\n this.startParam = startParam;\n this.center(true);\n }\n\n public isReplyInTopicOverlayNeeded() {\n return this.chat.isForum &&\n !this.chat.isForumTopic &&\n !this.replyToMsgId &&\n this.chat.type === 'chat';\n }\n\n public async getNeededFakeContainer(startParam = this.startParam) {\n if(this.chat.selection.isSelecting) {\n return this.fakeSelectionWrapper;\n } else if(\n startParam !== undefined ||\n // !(await this.chat.canSend()) || // ! WARNING, TEMPORARILY COMMENTED\n this.chat.type === 'pinned' ||\n await this.chat.isStartButtonNeeded() ||\n this.isReplyInTopicOverlayNeeded()\n ) {\n return this.controlContainer;\n }\n }\n\n // public getActiveContainer() {\n // if(this.chat.selection.isSelecting) {\n // return this.chat\n // }\n // return this.startParam !== undefined ? this.botStartContainer : this.rowsWrapper;\n // }\n\n // public setActiveContainer() {\n // const container = this.activeContainer;\n // const newContainer = this.getActiveContainer();\n // if(newContainer === container) {\n // return;\n // }\n\n\n // }\n\n private onCancelRecordClick = (e?: Event) => {\n if(e) {\n cancelEvent(e);\n }\n\n this.recordCanceled = true;\n this.recorder.stop();\n opusDecodeController.setKeepAlive(false);\n };\n\n private onEmoticonsOpen = () => {\n const toggleClass = IS_TOUCH_SUPPORTED ? 'flip-icon' : 'active';\n this.btnToggleEmoticons.classList.toggle(toggleClass, true);\n };\n\n private onEmoticonsClose = () => {\n const toggleClass = IS_TOUCH_SUPPORTED ? 'flip-icon' : 'active';\n this.btnToggleEmoticons.classList.toggle(toggleClass, false);\n };\n\n public getReadyToSend(callback: () => void) {\n return this.chat.type === 'scheduled' ? (this.scheduleSending(callback), true) : (callback(), false);\n }\n\n public scheduleSending = async(callback: () => void = this.sendMessage.bind(this, true), initDate = new Date()) => {\n const {peerId} = this.chat;\n const middleware = this.chat.bubbles.getMiddleware();\n const canSendWhenOnline = rootScope.myId !== peerId && peerId.isUser() && await this.managers.appUsersManager.isUserOnlineVisible(peerId);\n\n PopupElement.createPopup(PopupSchedule, initDate, (timestamp) => {\n if(!middleware()) {\n return;\n }\n\n const minTimestamp = (Date.now() / 1000 | 0) + 10;\n if(timestamp <= minTimestamp) {\n timestamp = undefined;\n }\n\n this.scheduleDate = timestamp;\n callback();\n\n if(this.chat.type !== 'scheduled' && timestamp) {\n setTimeout(() => { // ! need timeout here because .forwardMessages will be called after timeout\n if(!middleware()) {\n return;\n }\n\n const popups = PopupElement.getPopups(PopupStickers);\n popups.forEach((popup) => popup.hide());\n\n this.appImManager.openScheduled(peerId);\n }, 0);\n }\n }, canSendWhenOnline).show();\n };\n\n public async setUnreadCount() {\n if(!this.goDownUnreadBadge) {\n return;\n }\n\n const dialog = await this.managers.dialogsStorage.getDialogOrTopic(this.chat.peerId, this.chat.type === 'discussion' ? undefined : this.chat.threadId);\n const count = dialog?.unread_count;\n this.goDownUnreadBadge.innerText = '' + (count || '');\n this.goDownUnreadBadge.classList.toggle('badge-gray', await this.managers.appNotificationsManager.isPeerLocalMuted({peerId: this.chat.peerId, respectType: true, threadId: this.chat.threadId}));\n\n if(this.goMentionUnreadBadge && this.chat.type === 'chat') {\n const hasMentions = !!(dialog?.unread_mentions_count && dialog.unread_count);\n this.goMentionUnreadBadge.innerText = hasMentions ? '' + (dialog.unread_mentions_count) : '';\n this.goMentionBtn.classList.toggle('is-visible', hasMentions);\n }\n }\n\n public getCurrentInputAsDraft(ignoreEmptyValue?: boolean) {\n const {value, entities} = getRichValueWithCaret(this.messageInputField.input, true, false);\n\n let draft: DraftMessage.draftMessage;\n if((value.length || ignoreEmptyValue) || this.replyToMsgId) {\n draft = {\n _: 'draftMessage',\n date: tsNow(true),\n message: value,\n entities: entities.length ? entities : undefined,\n pFlags: {\n no_webpage: this.noWebPage\n },\n reply_to_msg_id: this.replyToMsgId\n };\n }\n\n return draft;\n }\n\n public saveDraft() {\n if(!this.chat.peerId || this.editMsgId || this.chat.type === 'scheduled') return;\n const draft = this.getCurrentInputAsDraft();\n this.managers.appDraftsManager.syncDraft(this.chat.peerId, this.chat.threadId, draft);\n }\n\n public destroy() {\n // this.chat.log.error('Input destroying');\n\n this.listenerSetter.removeAll();\n }\n\n public cleanup(helperToo = true) {\n if(!this.chat.peerId) {\n this.chatInput.classList.add('hide');\n this.goDownBtn.classList.add('hide');\n }\n\n cancelSelection();\n\n this.lastTimeType = 0;\n this.startParam = undefined;\n\n if(this.toggleBotStartBtnDisability) {\n this.toggleBotStartBtnDisability();\n this.toggleBotStartBtnDisability = undefined;\n }\n\n if(this.messageInput) {\n this.clearInput();\n helperToo && this.clearHelper();\n }\n }\n\n public async setDraft(draft?: MyDraftMessage, fromUpdate = true, force = false) {\n if((!force && !isInputEmpty(this.messageInput)) || this.chat.type === 'scheduled') return false;\n\n if(!draft) {\n draft = await this.managers.appDraftsManager.getDraft(this.chat.peerId, this.chat.threadId);\n\n if(!draft) {\n if(force) { // this situation can only happen when sending message with clearDraft\n /* const height = this.chatInput.getBoundingClientRect().height;\n const willChangeHeight = 78 - height;\n this.willChangeHeight = willChangeHeight; */\n if(this.chat.container.classList.contains('is-helper-active')) {\n this.t();\n }\n\n this.messageInputField.inputFake.textContent = '';\n this.messageInputField.onFakeInput(false);\n\n ((this.chat.bubbles.messagesQueuePromise || Promise.resolve()) as Promise).then(() => {\n fastRaf(() => {\n this.onMessageSent();\n });\n });\n }\n\n return false;\n }\n }\n\n const wrappedDraft = wrapDraft(draft, this.chat.peerId);\n const currentDraft = this.getCurrentInputAsDraft();\n\n if(draftsAreEqual(draft, currentDraft) &&/* this.messageInputField.value === wrappedDraft && */this.replyToMsgId === draft.reply_to_msg_id) return false;\n\n if(fromUpdate) {\n this.clearHelper();\n }\n\n this.noWebPage = draft.pFlags.no_webpage;\n if(draft.reply_to_msg_id) {\n this.initMessageReply(draft.reply_to_msg_id);\n }\n\n this.setInputValue(wrappedDraft, fromUpdate, fromUpdate);\n return true;\n }\n\n private createSendAs() {\n this.sendAsPeerId = undefined;\n\n if(this.chat.type === 'chat' || this.chat.type === 'discussion') {\n let firstChange = true;\n this.sendAs = new ChatSendAs(\n this.managers,\n (container, skipAnimation) => {\n let useRafs = 0;\n if(!container.parentElement) {\n this.newMessageWrapper.prepend(container);\n useRafs = 2;\n }\n\n this.updateOffset('as', true, skipAnimation, useRafs);\n },\n (sendAsPeerId) => {\n this.sendAsPeerId = sendAsPeerId;\n\n // do not change placeholder earlier than finishPeerChange does\n if(firstChange) {\n firstChange = false;\n return;\n }\n\n this.getPlaceholderKey().then((key) => {\n this.updateMessageInputPlaceholder(key);\n });\n }\n );\n } else {\n this.sendAs = undefined;\n }\n\n return this.sendAs;\n }\n\n public async finishPeerChange(startParam?: string) {\n const peerId = this.chat.peerId;\n\n const {forwardElements, btnScheduled, replyKeyboard, sendMenu, goDownBtn, chatInput, botCommandsToggle} = this;\n\n const previousSendAs = this.sendAs;\n const sendAs = this.createSendAs();\n\n const [\n isBroadcast,\n canPinMessage,\n isBot,\n canSend,\n canSendPlain,\n neededFakeContainer,\n ackedPeerFull,\n ackedScheduledMids,\n setSendAsCallback,\n filteredAttachMenuButtons\n ] = await Promise.all([\n this.managers.appPeersManager.isBroadcast(peerId),\n this.managers.appPeersManager.canPinMessage(peerId),\n this.managers.appPeersManager.isBot(peerId),\n this.chat.canSend('send_messages'),\n this.chat.canSend('send_plain'),\n this.getNeededFakeContainer(startParam),\n modifyAckedPromise(this.managers.acknowledged.appProfileManager.getProfileByPeerId(peerId)),\n btnScheduled ? modifyAckedPromise(this.managers.acknowledged.appMessagesManager.getScheduledMessages(peerId)) : undefined,\n sendAs ? (sendAs.setPeerId(this.chat.peerId), sendAs.updateManual(true)) : undefined,\n this.filterAttachMenuButtons()\n ]);\n\n const placeholderKey = this.messageInput ? await this.getPlaceholderKey(canSendPlain) : undefined;\n\n return () => {\n // console.warn('[input] finishpeerchange start');\n\n chatInput.classList.remove('hide');\n goDownBtn.classList.toggle('is-broadcast', isBroadcast);\n goDownBtn.classList.remove('hide');\n\n\n if(this.goDownUnreadBadge) {\n this.setUnreadCount();\n }\n\n if(this.chat.type === 'pinned') {\n chatInput.classList.toggle('can-pin', canPinMessage);\n }/* else if(this.chat.type === 'chat') {\n } */\n\n if(forwardElements) {\n this.forwardWasDroppingAuthor = false;\n forwardElements.showCaption.checkboxField.setValueSilently(true);\n forwardElements.showSender.checkboxField.setValueSilently(true);\n }\n\n if(btnScheduled && ackedScheduledMids) {\n btnScheduled.classList.add('hide');\n const middleware = this.chat.bubbles.getMiddleware();\n callbackify(ackedScheduledMids.result, (mids) => {\n if(!middleware() || !mids) return;\n btnScheduled.classList.toggle('hide', !mids.length);\n });\n }\n\n if(this.newMessageWrapper) {\n this.updateOffset(null, false, true);\n }\n\n if(botCommandsToggle) {\n this.hasBotCommands = undefined;\n this.botCommands.toggle(true, undefined, true);\n this.updateBotCommandsToggle(true);\n botCommandsToggle.remove();\n if(isBot) {\n const middleware = this.chat.bubbles.getMiddleware();\n const result = ackedPeerFull.result;\n callbackify(result, (userFull) => {\n if(!middleware()) return;\n this.updateBotCommands(userFull as UserFull.userFull, !(result instanceof Promise));\n });\n }\n }\n\n previousSendAs?.destroy();\n setSendAsCallback?.();\n replyKeyboard?.setPeer(peerId);\n sendMenu?.setPeerId(peerId);\n\n if(this.messageInput) {\n this.updateMessageInput(canSend, canSendPlain, placeholderKey, filteredAttachMenuButtons);\n this.messageInput.dataset.peerId = '' + peerId;\n }\n\n this.messageInputField?.onFakeInput(undefined, true);\n\n let haveSomethingInControl = false;\n if(this.pinnedControlBtn) {\n const good = this.chat.type === 'pinned';\n haveSomethingInControl ||= good;\n this.pinnedControlBtn.classList.toggle('hide', !good);\n this.pinnedControlBtn.replaceChildren(i18n(canPinMessage ? 'Chat.Input.UnpinAll' : 'Chat.Pinned.DontShow'));\n }\n\n {\n const good = this.chat.isForum && !this.chat.isForumTopic && this.chat.type === 'chat';\n haveSomethingInControl ||= good;\n this.replyInTopicOverlay.classList.toggle('hide', !good);\n }\n\n this.botStartBtn.classList.toggle('hide', haveSomethingInControl);\n\n // * testing\n // this.startParam = this.appPeersManager.isBot(peerId) ? '123' : undefined;\n\n this.startParam = startParam;\n\n this._center(neededFakeContainer, false);\n\n // console.warn('[input] finishpeerchange ends');\n };\n }\n\n private updateOffset(type: 'commands' | 'as', forwards: boolean, skipAnimation?: boolean, useRafs?: number) {\n if(type) {\n this.newMessageWrapper.dataset.offset = type;\n } else {\n delete this.newMessageWrapper.dataset.offset;\n }\n\n SetTransition({\n element: this.newMessageWrapper,\n className: 'has-offset',\n forwards,\n duration: skipAnimation ? 0 : 300,\n useRafs\n });\n }\n\n private updateBotCommands(userFull: UserFull.userFull, skipAnimation?: boolean) {\n this.hasBotCommands = !!userFull.bot_info?.commands?.length;\n this.updateBotCommandsToggle(skipAnimation);\n }\n\n private updateBotCommandsToggle(skipAnimation?: boolean) {\n const {botCommandsToggle, hasBotCommands} = this;\n\n const show = !!hasBotCommands && this.isInputEmpty();\n if(!hasBotCommands) {\n if(!botCommandsToggle.parentElement) {\n return;\n }\n\n botCommandsToggle.remove();\n }\n\n const forwards = show;\n const useRafs = botCommandsToggle.parentElement ? 0 : 2;\n\n if(!botCommandsToggle.parentElement) {\n this.newMessageWrapper.prepend(botCommandsToggle);\n }\n\n this.updateOffset('commands', forwards, skipAnimation, useRafs);\n }\n\n private async getPlaceholderKey(canSend?: boolean) {\n canSend ??= await this.chat.canSend('send_plain');\n const {peerId, threadId, isForum} = this.chat;\n let key: LangPackKey;\n if(!canSend) {\n key = 'Channel.Persmission.MessageBlock';\n } else if(threadId && !isForum) {\n key = 'Comment';\n } else if(await this.managers.appPeersManager.isBroadcast(peerId)) {\n key = 'ChannelBroadcast';\n } else if(\n (this.sendAsPeerId !== undefined && this.sendAsPeerId !== rootScope.myId) ||\n await this.managers.appMessagesManager.isAnonymousSending(peerId)\n ) {\n key = 'SendAnonymously';\n } else {\n key = 'Message';\n }\n\n return key;\n }\n\n private updateMessageInputPlaceholder(key: LangPackKey) {\n // console.warn('[input] update placeholder');\n const i = I18n.weakMap.get(this.messageInput) as I18n.IntlElement;\n if(!i) {\n return;\n }\n\n const oldKey = i.key;\n i.compareAndUpdate({key});\n\n return {oldKey, newKey: key};\n }\n\n private filterAttachMenuButtons() {\n if(!this.attachMenuButtons) return;\n return filterAsync(this.attachMenuButtons, (button) => {\n return button.verify ? button.verify() : true;\n });\n }\n\n public updateMessageInput(\n canSend: boolean,\n canSendPlain: boolean,\n placeholderKey: LangPackKey,\n visible: ChatInput['attachMenuButtons']\n ) {\n const {chatInput, attachMenu, messageInput} = this;\n const isHidden = chatInput.classList.contains('is-hidden');\n const willBeHidden = !canSend;\n if(isHidden !== willBeHidden) {\n chatInput.classList.add('no-transition');\n chatInput.classList.toggle('is-hidden', !canSend);\n void chatInput.offsetLeft; // reflow\n chatInput.classList.remove('no-transition');\n }\n\n const isEditingAndLocked = canSend && !canSendPlain && this.restoreInputLock;\n\n !isEditingAndLocked && this.updateMessageInputPlaceholder(placeholderKey);\n\n if(isEditingAndLocked) {\n this.restoreInputLock = () => {\n this.updateMessageInputPlaceholder(placeholderKey);\n this.messageInput.contentEditable = 'false';\n };\n } else if(!canSend || !canSendPlain) {\n messageInput.contentEditable = 'false';\n\n if(!canSendPlain) {\n this.messageInputField.onFakeInput(undefined, true);\n }\n } else {\n this.restoreInputLock = undefined;\n messageInput.contentEditable = 'true';\n this.setDraft(undefined, false);\n\n if(!messageInput.innerHTML) {\n this.messageInputField.onFakeInput(undefined, true);\n }\n }\n\n if(attachMenu) {\n attachMenu.toggleAttribute('disabled', !visible.length);\n attachMenu.classList.toggle('btn-disabled', !visible.length);\n }\n\n this.updateSendBtn();\n }\n\n private attachMessageInputField() {\n const oldInputField = this.messageInputField;\n this.messageInputField = new InputFieldAnimated({\n placeholder: 'Message',\n name: 'message',\n withLinebreaks: true\n });\n\n this.messageInputField.input.tabIndex = -1;\n this.messageInputField.input.classList.replace('input-field-input', 'input-message-input');\n this.messageInputField.inputFake.classList.replace('input-field-input', 'input-message-input');\n this.messageInput = this.messageInputField.input;\n this.attachMessageInputListeners();\n\n if(IS_STICKY_INPUT_BUGGED) {\n fixSafariStickyInputFocusing(this.messageInput);\n }\n\n if(oldInputField) {\n oldInputField.input.replaceWith(this.messageInputField.input);\n oldInputField.inputFake.replaceWith(this.messageInputField.inputFake);\n } else {\n this.inputMessageContainer.append(this.messageInputField.input, this.messageInputField.inputFake);\n }\n }\n\n private attachMessageInputListeners() {\n this.listenerSetter.add(this.messageInput)('keydown', (e) => {\n const key = e.key;\n\n if(isSendShortcutPressed(e)) {\n cancelEvent(e);\n this.sendMessage();\n } else if(e.ctrlKey || e.metaKey) {\n this.handleMarkdownShortcut(e);\n } else if((key === 'PageUp' || key === 'PageDown') && !e.shiftKey) { // * fix pushing page to left (Chrome Windows)\n e.preventDefault();\n\n if(key === 'PageUp') {\n const range = document.createRange();\n const sel = window.getSelection();\n\n range.setStart(this.messageInput.childNodes[0] || this.messageInput, 0);\n range.collapse(true);\n\n sel.removeAllRanges();\n sel.addRange(range);\n } else {\n placeCaretAtEnd(this.messageInput);\n }\n }\n });\n\n attachClickEvent(this.messageInput, (e) => {\n if(!this.canSendPlain()) {\n toastNew({\n langPackKey: POSTING_NOT_ALLOWED_MAP['send_plain']\n });\n }\n }, {listenerSetter: this.listenerSetter});\n\n if(IS_TOUCH_SUPPORTED) {\n attachClickEvent(this.messageInput, (e) => {\n if(emoticonsDropdown.isActive()) {\n emoticonsDropdown.toggle(false);\n blurActiveElement();\n cancelEvent(e);\n // this.messageInput.focus();\n return;\n }\n\n this.appImManager.selectTab(APP_TABS.CHAT); // * set chat tab for album orientation\n // this.saveScroll();\n }, {listenerSetter: this.listenerSetter});\n\n /* this.listenerSetter.add(window)('resize', () => {\n this.restoreScroll();\n }); */\n\n /* if(isSafari) {\n this.listenerSetter.add(this.messageInput)('mousedown', () => {\n window.requestAnimationFrame(() => {\n window.requestAnimationFrame(() => {\n emoticonsDropdown.toggle(false);\n });\n });\n });\n } */\n }\n\n /* this.listenerSetter.add(this.messageInput)('beforeinput', (e: Event) => {\n // * validate due to manual formatting through browser's context menu\n const inputType = (e as InputEvent).inputType;\n //console.log('message beforeinput event', e);\n\n if(inputType.indexOf('format') === 0) {\n //console.log('message beforeinput format', e, inputType, this.messageInput.innerHTML);\n const markdownType = inputType.split('format')[1].toLowerCase() as MarkdownType;\n if(this.applyMarkdown(markdownType)) {\n cancelEvent(e); // * cancel legacy markdown event\n }\n }\n }); */\n this.listenerSetter.add(this.messageInput)('input', this.onMessageInput);\n this.listenerSetter.add(this.messageInput)('keyup', () => {\n this.checkAutocomplete();\n });\n\n this.listenerSetter.add(this.messageInput)('focusin', () => {\n if((this.chat.type === 'chat' || this.chat.type === 'discussion') &&\n this.chat.bubbles.scrollable.loadedAll.bottom) {\n this.managers.appMessagesManager.readAllHistory(this.chat.peerId, this.chat.threadId);\n }\n });\n }\n\n public canSendPlain() {\n return !(!this.messageInput.isContentEditable && !this.chatInput.classList.contains('is-hidden'));\n }\n\n private prepareDocumentExecute = () => {\n this.executedHistory.push(this.messageInput.innerHTML);\n return () => this.canUndoFromHTML = this.messageInput.innerHTML;\n };\n\n private undoRedo = (e: Event, type: 'undo' | 'redo', needHTML: string) => {\n cancelEvent(e); // cancel legacy event\n\n let html = this.messageInput.innerHTML;\n if(html && html !== needHTML) {\n this.lockRedo = true;\n\n let sameHTMLTimes = 0;\n do {\n document.execCommand(type, false, null);\n const currentHTML = this.messageInput.innerHTML;\n if(html === currentHTML) {\n if(++sameHTMLTimes > 2) { // * unlink, removeFormat (а может и нет, случай: заболдить подчёркнутый текст (выделить ровно его), попробовать отменить)\n break;\n }\n } else {\n sameHTMLTimes = 0;\n }\n\n html = currentHTML;\n } while(html !== needHTML);\n\n this.lockRedo = false;\n }\n };\n\n public applyMarkdown(type: MarkdownType, href?: string) {\n // const MONOSPACE_FONT = 'var(--font-monospace)';\n // const SPOILER_FONT = 'spoiler';\n const commandsMap: Partial<{[key in typeof type]: string | (() => void)}> = {\n // bold: 'Bold',\n // italic: 'Italic',\n // underline: 'Underline',\n // strikethrough: 'Strikethrough',\n // monospace: () => document.execCommand('fontName', false, MONOSPACE_FONT),\n link: href ? () => document.execCommand('createLink', false, href) : () => document.execCommand('unlink', false, null)\n // spoiler: () => document.execCommand('fontName', false, SPOILER_FONT)\n };\n\n const c = (type: MarkdownType) => {\n commandsMap[type] = () => {\n const k = (canCombine.includes(type) ? canCombine : [type]).filter((type) => hasMarkup[type]);\n if(!indexOfAndSplice(k, type)) {\n k.push(type);\n }\n\n if(!k.length) {\n return this.resetCurrentFontFormatting();\n } else {\n return document.execCommand('fontName', false, 'markup-' + k.join('-'));\n }\n };\n };\n\n const canCombine = ['bold', 'italic', 'underline', 'strikethrough', 'spoiler'] as (typeof type)[];\n canCombine.forEach((type) => {\n c(type);\n });\n\n c('monospace');\n\n if(!commandsMap[type]) {\n return false;\n }\n\n const command = commandsMap[type];\n\n // type = 'monospace';\n\n // const saveExecuted = this.prepareDocumentExecute();\n const executed: any[] = [];\n /**\n * * clear previous formatting, due to Telegram's inability to handle several entities\n */\n /* const checkForSingle = () => {\n const nodes = getSelectedNodes();\n //console.log('Using formatting:', commandsMap[type], nodes, this.executedHistory);\n\n const parents = [...new Set(nodes.map((node) => node.parentNode))];\n //const differentParents = !!nodes.find((node) => node.parentNode !== firstParent);\n const differentParents = parents.length > 1;\n\n let notSingle = false;\n if(differentParents) {\n notSingle = true;\n } else {\n const node = nodes[0];\n if(node && (node.parentNode as HTMLElement) !== this.messageInput && (node.parentNode.parentNode as HTMLElement) !== this.messageInput) {\n notSingle = true;\n }\n }\n\n if(notSingle) {\n //if(type === 'monospace') {\n executed.push(document.execCommand('styleWithCSS', false, 'true'));\n //}\n\n executed.push(document.execCommand('unlink', false, null));\n executed.push(document.execCommand('removeFormat', false, null));\n executed.push(typeof(command) === 'function' ? command() : document.execCommand(command, false, null));\n\n //if(type === 'monospace') {\n executed.push(document.execCommand('styleWithCSS', false, 'false'));\n //}\n }\n }; */\n\n // fix applying markdown when range starts from contenteditable=\"false\"\n let textNode: Text;\n // do {\n // // const {node, offset, selection} = getCaretPosNew(this.messageInput, true);\n // const selection = document.getSelection();\n // const range = selection.getRangeAt(0);\n // const {node, offset} = getCaretPosF(this.messageInput, range.startContainer, range.startOffset);\n // // const node = range.startContainer as ChildNode;\n // if(node?.textContent === BOM || (node as HTMLElement)?.isContentEditable === false) {\n // // selection.modify('extend', 'backward', 'character');\n // textNode = document.createTextNode(BOM);\n // (node.nodeType === node.ELEMENT_NODE ? node : node.parentElement).before(textNode);\n // range.setStart(textNode, 0);\n // }/* else {\n // break;\n // } */\n\n // break;\n // } while(true);\n\n const richInputHandler = RichInputHandler.getInstance();\n const restore = richInputHandler.prepareApplyingMarkdown();\n\n const listener = this.listenerSetter.add(this.messageInput)('input', cancelEvent, {capture: true, passive: false}) as any as Listener;\n\n executed.push(document.execCommand('styleWithCSS', false, 'true'));\n\n const hasMarkup = hasMarkupInSelection(Object.keys(commandsMap) as (typeof type)[]);\n\n // * monospace can't be combined with different types\n /* if(type === 'monospace' || type === 'spoiler') {\n // executed.push(document.execCommand('styleWithCSS', false, 'true'));\n\n const haveThisType = hasMarkup[type];\n // executed.push(document.execCommand('removeFormat', false, null));\n\n if(haveThisType) {\n executed.push(this.resetCurrentFontFormatting());\n } else {\n // if(type === 'monospace' || hasMarkup['monospace']) {\n // executed.push(this.resetCurrentFormatting());\n // }\n\n executed.push(typeof(command) === 'function' ? command() : document.execCommand(command, false, null));\n }\n } else */{\n if(hasMarkup['monospace'] && type === 'link') {\n executed.push(this.resetCurrentFormatting());\n }\n\n executed.push(typeof(command) === 'function' ? command() : document.execCommand(command, false, null));\n }\n\n executed.push(document.execCommand('styleWithCSS', false, 'false'));\n\n restore();\n\n // checkForSingle();\n // saveExecuted();\n this.appImManager.markupTooltip?.setActiveMarkupButton();\n\n if(textNode) {\n (textNode.parentElement === this.messageInput ? textNode : textNode.parentElement).remove();\n textNode.nodeValue = '';\n }\n\n this.listenerSetter.remove(listener);\n this.messageInputField.simulateInputEvent();\n\n return true;\n }\n\n private resetCurrentFormatting() {\n return document.execCommand('removeFormat', false, null);\n }\n\n private resetCurrentFontFormatting() {\n return document.execCommand('fontName', false, 'Roboto');\n }\n\n private handleMarkdownShortcut = (e: KeyboardEvent) => {\n // console.log('handleMarkdownShortcut', e);\n const formatKeys: {[key: string]: MarkdownType} = {\n 'KeyB': 'bold',\n 'KeyI': 'italic',\n 'KeyU': 'underline',\n 'KeyS': 'strikethrough',\n 'KeyM': 'monospace',\n 'KeyP': 'spoiler'\n };\n\n if(this.appImManager.markupTooltip) {\n formatKeys['KeyK'] = 'link';\n }\n\n const code = e.code;\n const applyMarkdown = formatKeys[code];\n\n const selection = document.getSelection();\n if(!isSelectionEmpty(selection) && applyMarkdown) {\n // * костыльчик\n if(code === 'KeyK') {\n this.appImManager.markupTooltip.showLinkEditor();\n } else {\n this.applyMarkdown(applyMarkdown);\n }\n\n cancelEvent(e); // cancel legacy event\n }\n\n // return;\n if(code === 'KeyZ') {\n let html = this.messageInput.innerHTML;\n\n if(e.shiftKey) {\n if(this.undoHistory.length) {\n this.executedHistory.push(html);\n html = this.undoHistory.pop();\n this.undoRedo(e, 'redo', html);\n html = this.messageInput.innerHTML;\n this.canRedoFromHTML = this.undoHistory.length ? html : '';\n this.canUndoFromHTML = html;\n }\n } else {\n // * подождём, когда пользователь сам восстановит поле до нужного состояния, которое стало сразу после saveExecuted\n if(this.executedHistory.length && (!this.canUndoFromHTML || html === this.canUndoFromHTML)) {\n this.undoHistory.push(html);\n html = this.executedHistory.pop();\n this.undoRedo(e, 'undo', html);\n\n // * поставим новое состояние чтобы снова подождать, если пользователь изменит что-то, и потом попробует откатить до предыдущего состояния\n this.canUndoFromHTML = this.canRedoFromHTML = this.messageInput.innerHTML;\n }\n }\n }\n };\n\n public onMessageInput = (e?: Event) => {\n // * validate due to manual formatting through browser's context menu\n /* const inputType = (e as InputEvent).inputType;\n console.log('message input event', e);\n if(inputType === 'formatBold') {\n console.log('message input format', this.messageInput.innerHTML);\n cancelEvent(e);\n }\n\n if(!isSelectionSingle()) {\n alert('not single');\n } */\n\n // console.log('messageInput input', this.messageInput.innerText);\n // const value = this.messageInput.innerText;\n const {value: richValue, entities: markdownEntities, caretPos} = getRichValueWithCaret(this.messageInputField.input);\n\n // const entities = parseEntities(value);\n const value = parseMarkdown(richValue, markdownEntities, true);\n const entities = mergeEntities(markdownEntities, parseEntities(value));\n\n // this.chat.log('messageInput entities', richValue, value, markdownEntities, caretPos);\n\n if(this.canRedoFromHTML && !this.lockRedo && this.messageInput.innerHTML !== this.canRedoFromHTML) {\n this.canRedoFromHTML = '';\n this.undoHistory.length = 0;\n }\n\n const urlEntities: Array = (!this.editMessage?.media || this.editMessage.media._ === 'messageMediaWebPage') && entities.filter((e) => e._ === 'messageEntityUrl' || e._ === 'messageEntityTextUrl') as any;\n if(urlEntities.length) {\n for(const entity of urlEntities) {\n let url: string;\n if(entity._ === 'messageEntityTextUrl') {\n url = entity.url;\n } else {\n url = richValue.slice(entity.offset, entity.offset + entity.length);\n\n if(!(url.includes('http://') || url.includes('https://'))) {\n continue;\n }\n }\n\n if(this.lastUrl !== url) {\n this.lastUrl = url;\n const promise = this.getWebPagePromise = Promise.all([\n this.managers.appWebPagesManager.getWebPage(url),\n this.chat.canSend('embed_links')\n ]).then(([webpage, canEmbedLinks]) => {\n if(this.getWebPagePromise === promise) this.getWebPagePromise = undefined;\n if(this.lastUrl !== url) return;\n if(webpage?._ === 'webPage' && canEmbedLinks) {\n this.setTopInfo('webpage', () => {}, webpage.site_name || webpage.title || 'Webpage', webpage.description || webpage.url || '');\n delete this.noWebPage;\n this.willSendWebPage = webpage;\n } else if(this.willSendWebPage) {\n this.onHelperCancel();\n }\n });\n }\n\n break;\n }\n } else if(this.lastUrl) {\n this.lastUrl = '';\n delete this.noWebPage;\n this.willSendWebPage = null;\n\n if(this.helperType) {\n this.helperFunc();\n } else {\n this.clearHelper();\n }\n }\n\n const isEmpty = !richValue.trim();\n if(isEmpty) {\n if(this.lastTimeType) {\n this.managers.appMessagesManager.setTyping(this.chat.peerId, {_: 'sendMessageCancelAction'}, undefined, this.chat.threadId);\n }\n\n this.appImManager.markupTooltip?.hide();\n\n // * Chrome has a bug - it will preserve the formatting if the input with monospace text is cleared\n // * so have to reset formatting\n if(document.activeElement === this.messageInput && !IS_MOBILE) {\n setTimeout(() => {\n if(document.activeElement === this.messageInput) {\n this.messageInput.textContent = '1';\n placeCaretAtEnd(this.messageInput);\n this.messageInput.textContent = '';\n }\n }, 0);\n }\n } else {\n const time = Date.now();\n if((time - this.lastTimeType) >= 6000 && e?.isTrusted) {\n this.lastTimeType = time;\n this.managers.appMessagesManager.setTyping(this.chat.peerId, {_: 'sendMessageTypingAction'}, undefined, this.chat.threadId);\n }\n\n this.botCommands?.toggle(true);\n }\n\n if(this.botCommands) {\n this.updateBotCommandsToggle();\n }\n\n if(!this.editMsgId) {\n this.saveDraftDebounced();\n }\n\n this.checkAutocomplete(richValue, caretPos, entities);\n\n this.updateSendBtn();\n };\n\n public insertAtCaret(insertText: string, insertEntity?: MessageEntity, isHelper = true) {\n if(!this.canSendPlain()) {\n toastNew({\n langPackKey: POSTING_NOT_ALLOWED_MAP['send_plain']\n });\n return;\n }\n\n RichInputHandler.getInstance().makeFocused(this.messageInput);\n\n const {value: fullValue, caretPos, entities} = getRichValueWithCaret(this.messageInput);\n const pos = caretPos >= 0 ? caretPos : fullValue.length;\n const prefix = fullValue.substr(0, pos);\n const suffix = fullValue.substr(pos);\n\n const matches = isHelper ? prefix.match(ChatInput.AUTO_COMPLETE_REG_EXP) : null;\n\n const matchIndex = matches ? matches.index + (matches[0].length - matches[2].length) : prefix.length;\n const newPrefix = prefix.slice(0, matchIndex);\n const newValue = newPrefix + insertText + suffix;\n\n if(isHelper && caretPos !== -1) {\n const match = matches[2];\n // const {node, selection} = getCaretPosNew(this.messageInput);\n\n const selection = document.getSelection();\n // const range = document.createRange();\n let counter = 0;\n while(selection.toString() !== match) {\n if(++counter >= 10000) {\n throw new Error('lolwhat');\n }\n\n // for(let i = 0; i < match.length; ++i) {\n selection.modify('extend', 'backward', 'character');\n }\n }\n\n {\n // const fragment = wrapDraftText(insertText, {entities: insertEntity ? [insertEntity] : undefined, wrappingForPeerId: this.chat.peerId});\n insertRichTextAsHTML(this.messageInput, insertText, insertEntity ? [insertEntity] : undefined, this.chat.peerId);\n // const {node, offset} = getCaretPos(this.messageInput);\n // const fragmentLastChild = fragment.lastChild;\n // if(node?.nodeType === node.TEXT_NODE) {\n // const prefix = node.nodeValue.slice(0, offset);\n // const suffix = node.nodeValue.slice(offset);\n\n // const suffixNode = document.createTextNode(suffix);\n\n // node.nodeValue = prefix;\n // node.parentNode.insertBefore(suffixNode, node.nextSibling);\n // node.parentNode.insertBefore(fragment, suffixNode);\n\n // setCaretAt(fragmentLastChild.nextSibling);\n\n // this.messageInputField.simulateInputEvent();\n // }\n }\n return;\n\n // merge emojis\n const hadEntities = parseEntities(fullValue);\n mergeEntities(entities, hadEntities);\n\n // max for additional whitespace\n const insertLength = insertEntity ? Math.max(insertEntity.length, insertText.length) : insertText.length;\n const addEntities: MessageEntity[] = [];\n if(insertEntity) {\n addEntities.push(insertEntity);\n insertEntity.offset = matchIndex;\n }\n\n // add offset to entities next to emoji\n const diff = matches ? insertLength - matches[2].length : insertLength;\n entities.forEach((entity) => {\n if(entity.offset >= matchIndex) {\n entity.offset += diff;\n }\n });\n\n mergeEntities(entities, addEntities);\n\n if(/* caretPos !== -1 && caretPos !== fullValue.length */true) {\n const caretEntity: MessageEntity.messageEntityCaret = {\n _: 'messageEntityCaret',\n offset: matchIndex + insertLength,\n length: 0\n };\n\n let insertCaretAtIndex = 0;\n for(let length = entities.length; insertCaretAtIndex < length; ++insertCaretAtIndex) {\n const entity = entities[insertCaretAtIndex];\n if(entity.offset > caretEntity.offset) {\n break;\n }\n }\n\n entities.splice(insertCaretAtIndex, 0, caretEntity);\n }\n\n // const saveExecuted = this.prepareDocumentExecute();\n // can't exec .value here because it will instantly check for autocomplete\n const value = documentFragmentToHTML(wrapDraftText(newValue, {entities}));\n this.messageInputField.setValueSilently(value);\n\n const caret = this.messageInput.querySelector('.composer-sel');\n if(caret) {\n setCaretAt(caret);\n caret.remove();\n }\n\n // but it's needed to be checked only here\n this.onMessageInput();\n\n // saveExecuted();\n\n // document.execCommand('insertHTML', true, wrapEmojiText(emoji));\n }\n\n public onEmojiSelected = (emoji: ReturnType, autocomplete: boolean) => {\n const entity: MessageEntity = emoji.docId ? {\n _: 'messageEntityCustomEmoji',\n document_id: emoji.docId,\n length: emoji.emoji.length,\n offset: 0\n } : getEmojiEntityFromEmoji(emoji.emoji);\n this.insertAtCaret(emoji.emoji, entity, autocomplete);\n };\n\n private async checkAutocomplete(value?: string, caretPos?: number, entities?: MessageEntity[]) {\n // return;\n\n const hadValue = value !== undefined;\n if(!hadValue) {\n const r = getRichValueWithCaret(this.messageInputField.input, true, true);\n value = r.value;\n caretPos = r.caretPos;\n entities = r.entities;\n }\n\n if(caretPos === -1) {\n caretPos = value.length;\n }\n\n if(entities === undefined || !hadValue) {\n const _value = parseMarkdown(value, entities, true);\n entities = mergeEntities(entities, parseEntities(_value));\n }\n\n value = value.slice(0, caretPos);\n\n if(this.previousQuery === value) {\n return;\n }\n\n this.previousQuery = value;\n\n const matches = value.match(ChatInput.AUTO_COMPLETE_REG_EXP);\n let foundHelper: AutocompleteHelper;\n if(matches) {\n const entity = entities[0];\n\n let query = matches[2];\n const firstChar = query[0];\n\n if(this.stickersHelper &&\n rootScope.settings.stickers.suggest !== 'none' &&\n await this.chat.canSend('send_stickers') &&\n entity?._ === 'messageEntityEmoji' && entity.length === value.length && !entity.offset) {\n foundHelper = this.stickersHelper;\n this.stickersHelper.checkEmoticon(value);\n } else if(firstChar === '@') { // mentions\n const topMsgId = this.chat.threadId ? getServerMessageId(this.chat.threadId) : undefined;\n if(await this.mentionsHelper.checkQuery(query, this.chat.peerId.isUser() ? NULL_PEER_ID : this.chat.peerId, topMsgId)) {\n foundHelper = this.mentionsHelper;\n }\n } else if(!matches[1] && firstChar === '/') { // commands\n if(await this.commandsHelper.checkQuery(query, this.chat.peerId)) {\n foundHelper = this.commandsHelper;\n }\n } else if(rootScope.settings.emoji.suggest) { // emoji\n query = query.replace(/^\\s*/, '');\n if(!value.match(/^\\s*:(.+):\\s*$/) && !value.match(/:[;!@#$%^&*()-=|]/) && query) {\n foundHelper = this.emojiHelper;\n this.emojiHelper.checkQuery(query, firstChar);\n }\n }\n }\n\n let canSendInline: boolean;\n if(!foundHelper) {\n canSendInline = await this.chat.canSend('send_inline');\n }\n\n foundHelper = this.checkInlineAutocomplete(value, canSendInline, foundHelper);\n\n this.autocompleteHelperController.hideOtherHelpers(foundHelper);\n }\n\n private checkInlineAutocomplete(value: string, canSendInline: boolean, foundHelper?: AutocompleteHelper): AutocompleteHelper {\n let needPlaceholder = false;\n\n const setPreloaderShow = (show: boolean) => {\n if(!this.btnPreloader) {\n return;\n }\n\n if(show && !canSendInline) {\n show = false;\n }\n\n SetTransition({\n element: this.btnPreloader,\n className: 'show',\n forwards: show,\n duration: 400\n });\n };\n\n if(!foundHelper) {\n const inlineMatch = value.match(/^@([a-zA-Z\\\\d_]{3,32})\\s/);\n if(inlineMatch) {\n const username = inlineMatch[1];\n const query = value.slice(inlineMatch[0].length);\n needPlaceholder = inlineMatch[0].length === value.length;\n\n foundHelper = this.inlineHelper;\n\n if(!this.btnPreloader) {\n this.btnPreloader = this.createButtonIcon('none btn-preloader float show disable-hover', {noRipple: true});\n putPreloader(this.btnPreloader, true);\n this.inputMessageContainer.parentElement.insertBefore(this.btnPreloader, this.inputMessageContainer.nextSibling);\n } else {\n setPreloaderShow(true);\n }\n\n this.inlineHelper.checkQuery(this.chat.peerId, username, query, canSendInline).then(({user, renderPromise}) => {\n if(needPlaceholder && user.bot_inline_placeholder) {\n this.messageInput.dataset.inlinePlaceholder = user.bot_inline_placeholder;\n }\n\n renderPromise.then(() => {\n setPreloaderShow(false);\n });\n }).catch((err: ApiError) => {\n setPreloaderShow(false);\n });\n }\n }\n\n if(!needPlaceholder) {\n delete this.messageInput.dataset.inlinePlaceholder;\n }\n\n if(foundHelper !== this.inlineHelper) {\n setPreloaderShow(false);\n }\n\n return foundHelper;\n }\n\n private setRecording(value: boolean) {\n if(this.recording === value) {\n return;\n }\n\n SetTransition({\n element: this.chatInput,\n className: 'is-recording',\n forwards: value,\n duration: 200\n });\n this.recording = value;\n this.updateSendBtn();\n }\n\n private onBtnSendClick = async(e: Event) => {\n cancelEvent(e);\n\n if(!this.recorder || this.recording || !this.isInputEmpty() || this.forwarding || this.editMsgId) {\n if(this.recording) {\n if((Date.now() - this.recordStartTime) < RECORD_MIN_TIME) {\n this.onCancelRecordClick();\n } else {\n this.recorder.stop();\n }\n } else {\n this.sendMessage();\n }\n } else {\n const isAnyChat = this.chat.peerId.isAnyChat();\n const flag: ChatRights = 'send_voices';\n if(isAnyChat && !(await this.chat.canSend(flag))) {\n toastNew({langPackKey: POSTING_NOT_ALLOWED_MAP[flag]});\n return;\n }\n\n this.chatInput.classList.add('is-locked');\n blurActiveElement();\n\n let restricted = false;\n if(!isAnyChat) {\n const userFull = await this.managers.appProfileManager.getProfile(this.chat.peerId.toUserId());\n if(userFull?.pFlags.voice_messages_forbidden) {\n toastNew({\n langPackKey: 'Chat.SendVoice.PrivacyError',\n langPackArguments: [await wrapPeerTitle({peerId: this.chat.peerId})]\n });\n restricted = true;\n }\n }\n\n if(restricted) {\n this.chatInput.classList.remove('is-locked');\n return;\n }\n\n this.recorder.start().then(() => {\n this.releaseMediaPlayback = appMediaPlaybackController.setSingleMedia();\n this.recordCanceled = false;\n\n this.setRecording(true);\n opusDecodeController.setKeepAlive(true);\n\n const showDiscardPopup = () => {\n PopupElement.createPopup(PopupPeer, 'popup-cancel-record', {\n titleLangKey: 'DiscardVoiceMessageTitle',\n descriptionLangKey: 'DiscardVoiceMessageDescription',\n buttons: [{\n langKey: 'DiscardVoiceMessageAction',\n callback: () => {\n simulateClickEvent(this.btnCancelRecord);\n }\n }, {\n langKey: 'Continue',\n isCancel: true\n }]\n }).show();\n };\n\n this.recordingOverlayListener = this.listenerSetter.add(document.body)('mousedown', (e) => {\n if(!findUpClassName(e.target, 'chat-input') && !findUpClassName(e.target, 'popup-cancel-record')) {\n cancelEvent(e);\n showDiscardPopup();\n }\n }, {capture: true, passive: false}) as any;\n\n appNavigationController.pushItem(this.recordingNavigationItem = {\n type: 'voice',\n onPop: () => {\n setTimeout(() => {\n showDiscardPopup();\n }, 0);\n\n return false;\n }\n });\n\n this.recordStartTime = Date.now();\n\n const sourceNode: MediaStreamAudioSourceNode = this.recorder.sourceNode;\n const context = sourceNode.context;\n\n const analyser = context.createAnalyser();\n sourceNode.connect(analyser);\n // analyser.connect(context.destination);\n analyser.fftSize = 32;\n\n const frequencyData = new Uint8Array(analyser.frequencyBinCount);\n const max = frequencyData.length * 255;\n const min = 54 / 150;\n const r = () => {\n if(!this.recording) return;\n\n analyser.getByteFrequencyData(frequencyData);\n\n let sum = 0;\n frequencyData.forEach((value) => {\n sum += value;\n });\n\n const percents = Math.min(1, (sum / max) + min);\n // console.log('frequencyData', frequencyData, percents);\n\n this.recordRippleEl.style.transform = `scale(${percents})`;\n\n const diff = Date.now() - this.recordStartTime;\n const ms = diff % 1000;\n\n const formatted = toHHMMSS(diff / 1000) + ',' + ('00' + Math.round(ms / 10)).slice(-2);\n\n this.recordTimeEl.innerText = formatted;\n\n fastRaf(r);\n };\n\n r();\n }).catch((e: Error) => {\n switch(e.name as string) {\n case 'NotAllowedError': {\n toast('Please allow access to your microphone');\n break;\n }\n\n case 'NotReadableError': {\n toast(e.message);\n break;\n }\n\n default:\n console.error('Recorder start error:', e, e.name, e.message);\n toast(e.message);\n break;\n }\n\n this.setRecording(false);\n this.chatInput.classList.remove('is-locked');\n });\n }\n };\n\n public onHelperCancel = async(e?: Event, force?: boolean) => {\n if(e) {\n cancelEvent(e);\n }\n\n if(this.willSendWebPage) {\n const lastUrl = this.lastUrl;\n let needReturn = false;\n if(this.helperType) {\n // if(this.helperFunc) {\n await this.helperFunc();\n // }\n\n needReturn = true;\n }\n\n // * restore values\n this.lastUrl = lastUrl;\n this.noWebPage = true;\n this.willSendWebPage = null;\n\n if(needReturn) return;\n }\n\n if(this.helperType === 'edit' && !force) {\n const message = this.editMessage;\n const draft = this.getCurrentInputAsDraft(true);\n if(draft) {\n delete draft.pFlags.no_webpage;\n }\n // const value = parseMarkdown(this.messageInputField.value, []);\n // if(message.message !== value) {\n const originalDraft = {...message, _: 'draftMessage'} as DraftMessage.draftMessage;\n if(originalDraft.entities?.length) {\n const canPassEntitiesTypes = new Set(Object.values(MARKDOWN_ENTITIES));\n originalDraft.entities = originalDraft.entities.slice();\n forEachReverse(originalDraft.entities, (entity, idx, arr) => {\n if(!canPassEntitiesTypes.has(entity._)) {\n arr.splice(idx, 1);\n }\n });\n\n if(!originalDraft.entities.length) {\n delete originalDraft.entities;\n }\n }\n\n if(!draftsAreEqual(draft, originalDraft)) {\n PopupElement.createPopup(PopupPeer, 'discard-editing', {\n buttons: [{\n langKey: 'Alert.Confirm.Discard',\n callback: () => {\n this.onHelperCancel(undefined, true);\n }\n }],\n descriptionLangKey: 'Chat.Edit.Cancel.Text'\n }).show();\n\n return;\n }\n }\n\n this.clearHelper();\n this.updateSendBtn();\n };\n\n private onHelperClick = (e: Event) => {\n cancelEvent(e);\n\n if(!findUpClassName(e.target, 'reply')) return;\n if(this.helperType === 'forward') {\n const {forwardElements} = this;\n if(forwardElements && IS_TOUCH_SUPPORTED && !forwardElements.container.classList.contains('active')) {\n contextMenuController.openBtnMenu(forwardElements.container);\n }\n } else if(this.helperType === 'reply') {\n this.chat.setMessageId(this.replyToMsgId);\n } else if(this.helperType === 'edit') {\n this.chat.setMessageId(this.editMsgId);\n }\n };\n\n private changeForwardRecipient() {\n if(this.helperWaitingForward) return;\n this.helperWaitingForward = true;\n\n const forwarding = copy(this.forwarding);\n const helperFunc = this.helperFunc;\n this.clearHelper();\n this.updateSendBtn();\n let selected = false;\n const popup = PopupElement.createPopup(PopupForward, forwarding, () => {\n selected = true;\n });\n\n popup.addEventListener('close', () => {\n this.helperWaitingForward = false;\n\n if(!selected) {\n helperFunc();\n }\n });\n }\n\n public async clearInput(canSetDraft = true, fireEvent = true, clearValue = '') {\n if(document.activeElement === this.messageInput && IS_MOBILE_SAFARI) { // fix first char uppercase\n const i = document.createElement('input');\n document.body.append(i);\n fixSafariStickyInput(i);\n this.messageInputField.setValueSilently(clearValue);\n fixSafariStickyInput(this.messageInput);\n i.remove();\n } else {\n this.messageInputField.setValueSilently(clearValue);\n }\n\n if(IS_TOUCH_SUPPORTED) {\n // this.messageInput.innerText = '';\n } else {\n // this.attachMessageInputField();\n // this.messageInput.innerText = '';\n\n // clear executions\n this.canRedoFromHTML = '';\n this.undoHistory.length = 0;\n this.executedHistory.length = 0;\n this.canUndoFromHTML = '';\n }\n\n let set = false;\n if(canSetDraft) {\n set = await this.setDraft(undefined, false);\n }\n\n if(!set && fireEvent) {\n this.onMessageInput();\n }\n }\n\n public isInputEmpty() {\n return isInputEmpty(this.messageInput);\n }\n\n public updateSendBtn() {\n let icon: 'send' | 'record' | 'edit' | 'schedule';\n\n const isInputEmpty = this.isInputEmpty();\n\n if(this.editMsgId) icon = 'edit';\n else if(!this.recorder || this.recording || !isInputEmpty || this.forwarding) icon = this.chat.type === 'scheduled' ? 'schedule' : 'send';\n else icon = 'record';\n\n ['send', 'record', 'edit', 'schedule'].forEach((i) => {\n this.btnSend.classList.toggle(i, icon === i);\n });\n\n if(this.btnScheduled) {\n this.btnScheduled.classList.toggle('show', isInputEmpty && this.chat.type !== 'scheduled');\n }\n\n if(this.btnToggleReplyMarkup) {\n this.btnToggleReplyMarkup.classList.toggle('show', isInputEmpty && this.chat.type !== 'scheduled');\n }\n }\n\n private getValueAndEntities(input: HTMLElement) {\n const {entities: apiEntities, value} = getRichValueWithCaret(input, true, false);\n const myEntities = parseEntities(value);\n const totalEntities = mergeEntities(apiEntities, myEntities);\n\n return {value, totalEntities};\n }\n\n public onMessageSent(clearInput = true, clearReply?: boolean) {\n if(this.chat.type !== 'scheduled') {\n this.managers.appMessagesManager.readAllHistory(this.chat.peerId, this.chat.threadId, true);\n }\n\n this.scheduleDate = undefined;\n this.sendSilent = undefined;\n\n const {totalEntities} = this.getValueAndEntities(this.messageInput);\n let nextOffset = 0;\n const emojiEntities: (MessageEntity.messageEntityEmoji | MessageEntity.messageEntityCustomEmoji)[] = totalEntities.filter((entity) => {\n if(entity._ === 'messageEntityEmoji' || entity._ === 'messageEntityCustomEmoji') {\n const endOffset = entity.offset + entity.length;\n return endOffset <= nextOffset ? false : (nextOffset = endOffset, true);\n }\n\n return false;\n }) as any;\n emojiEntities.forEach((entity) => {\n const emoji: AppEmoji = entity._ === 'messageEntityEmoji' ? {emoji: emojiFromCodePoints(entity.unicode)} : {docId: entity.document_id, emoji: ''};\n this.managers.appEmojiManager.pushRecentEmoji(emoji);\n });\n\n if(clearInput) {\n this.lastUrl = '';\n delete this.noWebPage;\n this.willSendWebPage = null;\n this.clearInput();\n }\n\n if(clearReply || clearInput) {\n this.clearHelper();\n }\n\n this.updateSendBtn();\n }\n\n public sendMessage(force = false) {\n const {editMsgId, chat} = this;\n if(chat.type === 'scheduled' && !force && !editMsgId) {\n this.scheduleSending();\n return;\n }\n\n const {peerId} = chat;\n const {noWebPage} = this;\n const sendingParams = this.chat.getMessageSendingParams();\n\n const {value, entities} = getRichValueWithCaret(this.messageInputField.input, true, false);\n\n // return;\n if(editMsgId) {\n const message = this.editMessage;\n if(value.trim() || message.media) {\n this.managers.appMessagesManager.editMessage(message, value, {\n entities,\n noWebPage: noWebPage\n });\n\n this.onMessageSent();\n } else {\n PopupElement.createPopup(PopupDeleteMessages, peerId, [editMsgId], chat.type);\n\n return;\n }\n } else if(value.trim()) {\n this.managers.appMessagesManager.sendText(peerId, value, {\n entities,\n ...sendingParams,\n noWebPage: noWebPage,\n webPage: this.getWebPagePromise ? undefined : this.willSendWebPage,\n clearDraft: true\n });\n\n if(this.chat.type === 'scheduled') {\n this.onMessageSent(true);\n } else {\n this.onMessageSent(false, false);\n }\n // this.onMessageSent();\n }\n\n // * wait for sendText set messageId for invokeAfterMsg\n if(this.forwarding) {\n const forwarding = copy(this.forwarding);\n // setTimeout(() => {\n for(const fromPeerId in forwarding) {\n this.managers.appMessagesManager.forwardMessages(peerId, fromPeerId.toPeerId(), forwarding[fromPeerId], {\n ...sendingParams,\n dropAuthor: this.forwardElements && this.forwardElements.hideSender.checkboxField.checked,\n dropCaptions: this.isDroppingCaptions()\n }).catch(async(err: ApiError) => {\n if(err.type === 'VOICE_MESSAGES_FORBIDDEN') {\n toastNew({\n langPackKey: 'Chat.SendVoice.PrivacyError',\n langPackArguments: [await wrapPeerTitle({peerId})]\n });\n }\n });\n }\n\n if(!value) {\n this.onMessageSent();\n }\n // }, 0);\n }\n\n // this.onMessageSent();\n }\n\n public async sendMessageWithDocument(\n document: MyDocument | DocId,\n force = false,\n clearDraft = false,\n silent = false\n ) {\n document = await this.managers.appDocsManager.getDoc(document);\n\n const flag = document.type === 'sticker' ? 'send_stickers' : (document.type === 'gif' ? 'send_gifs' : 'send_media');\n if(this.chat.peerId.isAnyChat() && !(await this.chat.canSend(flag))) {\n toastNew({langPackKey: POSTING_NOT_ALLOWED_MAP[flag]});\n return false;\n }\n\n if(this.chat.type === 'scheduled' && !force) {\n this.scheduleSending(() => this.sendMessageWithDocument(document, true, clearDraft, silent));\n return false;\n }\n\n if(!document) {\n return false;\n }\n\n if(document.sticker && getStickerEffectThumb(document) && !rootScope.premium) {\n return false;\n }\n\n this.managers.appMessagesManager.sendFile(this.chat.peerId, {\n ...this.chat.getMessageSendingParams(),\n file: document,\n isMedia: true,\n clearDraft,\n silent\n });\n this.onMessageSent(clearDraft, true);\n\n if(document.type === 'sticker') {\n this.managers.appStickersManager.saveRecentSticker(document.id);\n }\n\n return true;\n }\n\n private canToggleHideAuthor() {\n const {forwardElements} = this;\n if(!forwardElements) return false;\n const hideCaptionCheckboxField = forwardElements.hideCaption.checkboxField;\n return !hideCaptionCheckboxField.checked ||\n findUpTag(hideCaptionCheckboxField.label, 'FORM').classList.contains('hide');\n }\n\n private isDroppingCaptions() {\n return !this.canToggleHideAuthor();\n }\n\n /* public sendSomething(callback: () => void, force = false) {\n if(this.chat.type === 'scheduled' && !force) {\n this.scheduleSending(() => this.sendSomething(callback, true));\n return false;\n }\n\n callback();\n this.onMessageSent(false, true);\n\n return true;\n } */\n\n public async initMessageEditing(mid: number) {\n const message = (await this.chat.getMessage(mid)) as Message.message;\n\n let input = wrapDraftText(message.message, {entities: message.totalEntities, wrappingForPeerId: this.chat.peerId});\n const f = async() => {\n let restoreInputLock: () => void;\n if(!this.messageInput.isContentEditable) {\n const placeholderKey = await this.getPlaceholderKey(true);\n const {contentEditable} = this.messageInput;\n this.messageInput.contentEditable = 'true';\n const {oldKey} = this.updateMessageInputPlaceholder(placeholderKey);\n\n restoreInputLock = () => {\n this.messageInput.contentEditable = contentEditable;\n this.updateMessageInputPlaceholder(oldKey);\n };\n }\n\n const replyFragment = await wrapMessageForReply({message, usingMids: [message.mid]});\n this.setTopInfo('edit', f, i18n('AccDescrEditing'), replyFragment, input, message);\n\n this.editMsgId = mid;\n this.editMessage = message;\n input = undefined;\n\n this.restoreInputLock = restoreInputLock;\n };\n f();\n }\n\n public initMessagesForward(fromPeerIdsMids: {[fromPeerId: PeerId]: number[]}) {\n const f = async() => {\n // const peerTitles: string[]\n const fromPeerIds = Object.keys(fromPeerIdsMids).map((fromPeerId) => fromPeerId.toPeerId());\n const smth: Set = new Set();\n let length = 0, messagesWithCaptionsLength = 0;\n\n const p = fromPeerIds.map(async(fromPeerId) => {\n const mids = fromPeerIdsMids[fromPeerId];\n const promises = mids.map(async(mid) => {\n const message = (await this.managers.appMessagesManager.getMessageByPeer(fromPeerId, mid)) as Message.message;\n if(message.fwd_from?.from_name && !message.fromId && !message.fwdFromId) {\n smth.add('N' + message.fwd_from.from_name);\n } else {\n smth.add('P' + message.fromId);\n }\n\n if(message.media && message.message) {\n ++messagesWithCaptionsLength;\n }\n });\n\n await Promise.all(promises);\n\n length += mids.length;\n });\n\n await Promise.all(p);\n\n const onlyFirstName = smth.size > 2;\n const peerTitles = [...smth].map((smth) => {\n const type = smth[0];\n smth = smth.slice(1);\n if(type === 'P') {\n const peerId = smth.toPeerId();\n return peerId === rootScope.myId ? i18n('Chat.Accessory.Forward.You') : new PeerTitle({peerId, dialog: false, onlyFirstName}).element;\n } else {\n return onlyFirstName ? smth.split(' ')[0] : smth;\n }\n });\n\n const {forwardElements} = this;\n const form = findUpTag(forwardElements.showCaption.checkboxField.label, 'FORM');\n form.classList.toggle('hide', !messagesWithCaptionsLength);\n const hideCaption = forwardElements.hideCaption.checkboxField.checked;\n if(messagesWithCaptionsLength && hideCaption) {\n forwardElements.hideSender.checkboxField.setValueSilently(true);\n } else if(this.forwardWasDroppingAuthor !== undefined) {\n (this.forwardWasDroppingAuthor ? forwardElements.hideSender : forwardElements.showSender).checkboxField.setValueSilently(true);\n }\n\n const titleKey: LangPackKey = forwardElements.showSender.checkboxField.checked ? 'Chat.Accessory.Forward' : 'Chat.Accessory.Hidden';\n const title = i18n(titleKey, [length]);\n\n const senderTitles = document.createDocumentFragment();\n if(peerTitles.length < 3) {\n senderTitles.append(...join(peerTitles, false));\n } else {\n senderTitles.append(peerTitles[0], i18n('AndOther', [peerTitles.length - 1]));\n }\n\n let firstMessage: Message.message, usingFullAlbum: boolean;\n if(fromPeerIds.length === 1) {\n const fromPeerId = fromPeerIds[0];\n const mids = fromPeerIdsMids[fromPeerId];\n firstMessage = (await this.managers.appMessagesManager.getMessageByPeer(fromPeerId, mids[0])) as Message.message;\n\n usingFullAlbum = !!firstMessage.grouped_id;\n if(usingFullAlbum) {\n const albumMids = await this.managers.appMessagesManager.getMidsByMessage(firstMessage);\n if(albumMids.length !== length || albumMids.find((mid) => !mids.includes(mid))) {\n usingFullAlbum = false;\n }\n }\n }\n\n const subtitleFragment = document.createDocumentFragment();\n const delimiter = ': ';\n if(usingFullAlbum || length === 1) {\n const mids = fromPeerIdsMids[fromPeerIds[0]];\n const replyFragment = await wrapMessageForReply({message: firstMessage, usingMids: mids});\n subtitleFragment.append(\n senderTitles,\n delimiter,\n replyFragment\n );\n } else {\n subtitleFragment.append(\n i18n('Chat.Accessory.Forward.From'),\n delimiter,\n senderTitles\n );\n }\n\n const newReply = this.setTopInfo('forward', f, title, subtitleFragment);\n\n forwardElements.modifyArgs.forEach((b, idx) => {\n const text = b.textElement;\n const intl: I18n.IntlElement = I18n.weakMap.get(text) as any;\n intl.args = [idx < 2 ? fromPeerIds.length : messagesWithCaptionsLength];\n intl.update();\n });\n\n if(this.forwardHover) {\n this.forwardHover.attachButtonListener(newReply, this.listenerSetter);\n }\n\n this.forwarding = fromPeerIdsMids;\n };\n\n f();\n }\n\n public async initMessageReply(mid: number) {\n if(this.replyToMsgId === mid) {\n return;\n }\n\n let message = await this.chat.getMessage(mid);\n const f = () => {\n let peerTitleEl: HTMLElement;\n if(!message) { // load missing replying message\n peerTitleEl = i18n('Loading');\n\n this.managers.appMessagesManager.reloadMessages(this.chat.peerId, mid).then((_message) => {\n if(this.replyToMsgId !== mid) {\n return;\n }\n\n message = _message;\n if(!message) {\n this.clearHelper('reply');\n } else {\n f();\n }\n });\n } else {\n peerTitleEl = new PeerTitle({\n peerId: message.fromId,\n dialog: false\n }).element;\n }\n\n this.setTopInfo('reply', f, peerTitleEl, message && (message as Message.message).message, undefined, message);\n this.setReplyToMsgId(mid)\n };\n f();\n }\n\n public setReplyToMsgId(mid: number) {\n this.replyToMsgId = mid;\n this.center(true);\n }\n\n public clearHelper(type?: ChatInputHelperType) {\n if(this.helperType === 'edit' && type !== 'edit') {\n this.clearInput();\n }\n\n if(type) {\n this.lastUrl = '';\n delete this.noWebPage;\n this.willSendWebPage = null;\n }\n\n if(type !== 'reply') {\n this.setReplyToMsgId(undefined);\n this.forwarding = undefined;\n }\n\n this.editMsgId = this.editMessage = undefined;\n this.helperType = this.helperFunc = undefined;\n\n if(this.restoreInputLock) {\n this.restoreInputLock?.();\n this.restoreInputLock = undefined;\n }\n\n if(this.chat.container.classList.contains('is-helper-active')) {\n appNavigationController.removeByType('input-helper');\n this.chat.container.classList.remove('is-helper-active');\n this.t();\n }\n }\n\n private t() {\n const className = 'is-toggling-helper';\n SetTransition({\n element: this.chat.container,\n className,\n forwards: true,\n duration: 150,\n onTransitionEnd: () => {\n this.chat.container.classList.remove(className);\n }\n });\n }\n\n public setInputValue(value: Parameters[0], clear = true, focus = true) {\n if(!value) value = '';\n\n if(clear) this.clearInput(false, false, value as string);\n else this.messageInputField.setValueSilently(value);\n\n fastRaf(() => {\n focus && placeCaretAtEnd(this.messageInput);\n this.onMessageInput();\n this.messageInput.scrollTop = this.messageInput.scrollHeight;\n });\n }\n\n public setTopInfo(\n type: ChatInputHelperType,\n callerFunc: () => void,\n title: Parameters[0] = '',\n subtitle: Parameters[1] = '',\n input?: Parameters[0],\n message?: any\n ) {\n if(this.willSendWebPage && type === 'reply') {\n return;\n }\n\n if(type !== 'webpage') {\n this.clearHelper(type);\n this.helperType = type;\n this.helperFunc = callerFunc;\n }\n\n const replyParent = this.replyElements.container;\n const oldReply = replyParent.lastElementChild.previousElementSibling;\n const haveReply = oldReply.classList.contains('reply');\n\n this.replyElements.iconBtn.replaceWith(this.replyElements.iconBtn = this.createButtonIcon((type === 'webpage' ? 'link' : type) + ' active reply-icon', {noRipple: true}));\n const {container} = wrapReply(title, subtitle, this.chat.animationGroup, message);\n if(haveReply) {\n oldReply.replaceWith(container);\n } else {\n replyParent.insertBefore(container, replyParent.lastElementChild);\n }\n\n if(type === 'webpage') {\n container.style.cursor = 'default';\n }\n\n if(!this.chat.container.classList.contains('is-helper-active')) {\n this.chat.container.classList.add('is-helper-active');\n this.t();\n }\n\n /* const scroll = appImManager.scrollable;\n if(scroll.isScrolledDown && !scroll.scrollLocked && !appImManager.messagesQueuePromise && !appImManager.setPeerPromise) {\n scroll.scrollTo(scroll.scrollHeight, 'top', true, true, 200);\n } */\n\n if(!IS_MOBILE) {\n appNavigationController.pushItem({\n type: 'input-helper',\n onPop: () => {\n this.onHelperCancel();\n }\n });\n }\n\n if(input !== undefined) {\n this.setInputValue(input);\n }\n\n setTimeout(() => {\n this.updateSendBtn();\n }, 0);\n\n return container;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {DraftMessage} from '../../layer';\nimport mergeEntities from '../../lib/richTextProcessor/mergeEntities';\nimport parseEntities from '../../lib/richTextProcessor/parseEntities';\nimport wrapDraftText from '../../lib/richTextProcessor/wrapDraftText';\n\nexport default function wrapDraft(draft: DraftMessage.draftMessage, wrappingForPeerId: PeerId, loadPromises?: Promise[]) {\n const myEntities = parseEntities(draft.message);\n const apiEntities = draft.entities || [];\n const totalEntities = mergeEntities(apiEntities.slice(), myEntities); // ! only in this order, otherwise bold and emoji formatting won't work\n\n return wrapDraftText(draft.message, {entities: totalEntities, wrappingForPeerId, loadPromises});\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport callbackify from '../../helpers/callbackify';\nimport formatNumber from '../../helpers/number/formatNumber';\nimport {Document, MessagePeerReaction, ReactionCount} from '../../layer';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport rootScope from '../../lib/rootScope';\nimport SetTransition from '../singleTransition';\nimport StackedAvatars from '../stackedAvatars';\nimport {Awaited} from '../../types';\nimport wrapSticker from '../wrappers/sticker';\nimport wrapCustomEmoji from '../wrappers/customEmoji';\nimport wrapStickerAnimation from '../wrappers/stickerAnimation';\nimport {makeMediaSize} from '../../helpers/mediaSize';\nimport RLottiePlayer from '../../lib/rlottie/rlottiePlayer';\nimport {fastRaf} from '../../helpers/schedulers';\nimport noop from '../../helpers/noop';\nimport {Middleware} from '../../helpers/middleware';\nimport liteMode from '../../helpers/liteMode';\n\nconst CLASS_NAME = 'reaction';\nconst TAG_NAME = CLASS_NAME + '-element';\nconst REACTION_INLINE_SIZE = 14;\nconst REACTION_BLOCK_SIZE = 22;\n\nexport const REACTION_DISPLAY_INLINE_COUNTER_AT = 2;\nexport const REACTION_DISPLAY_BLOCK_COUNTER_AT = 4;\n\nexport type ReactionLayoutType = 'block' | 'inline';\n\nexport default class ReactionElement extends HTMLElement {\n private type: ReactionLayoutType;\n private counter: HTMLElement;\n private stickerContainer: HTMLElement;\n private stackedAvatars: StackedAvatars;\n private canRenderAvatars: boolean;\n private _reactionCount: ReactionCount;\n private wrapStickerPromise: Awaited>['render'];\n private managers: AppManagers;\n private middleware: Middleware;\n\n constructor() {\n super();\n this.classList.add(CLASS_NAME);\n this.managers = rootScope.managers;\n }\n\n public get reactionCount() {\n return this._reactionCount;\n }\n\n public set reactionCount(reactionCount: ReactionCount) {\n this._reactionCount = reactionCount;\n }\n\n public get count() {\n return this.reactionCount.count;\n }\n\n public init(type: ReactionLayoutType, middleware: Middleware) {\n this.type = type;\n this.classList.add(CLASS_NAME + '-' + type);\n this.middleware = middleware;\n }\n\n public setCanRenderAvatars(canRenderAvatars: boolean) {\n this.canRenderAvatars = canRenderAvatars;\n }\n\n public render(doNotRenderSticker?: boolean) {\n const hadStickerContainer = !!this.stickerContainer;\n if(!hadStickerContainer) {\n this.stickerContainer = document.createElement('div');\n this.stickerContainer.classList.add(CLASS_NAME + '-sticker');\n this.append(this.stickerContainer);\n }\n\n const reactionCount = this.reactionCount;\n if(!doNotRenderSticker && !hadStickerContainer) {\n const reaction = reactionCount.reaction;\n if(reaction._ === 'reactionEmoji') {\n const availableReaction = this.managers.appReactionsManager.getReaction(reaction.emoticon);\n callbackify(availableReaction, (availableReaction) => {\n if(!availableReaction.center_icon) {\n this.stickerContainer.classList.add('is-static');\n }\n\n if(availableReaction.pFlags.inactive) {\n this.classList.add('is-inactive');\n }\n\n this.renderDoc(availableReaction.center_icon ?? availableReaction.static_icon);\n });\n } else if(reaction._ === 'reactionCustomEmoji') {\n this.stickerContainer.classList.add('is-custom');\n const wrapped = wrapCustomEmoji({\n docIds: [reaction.document_id],\n customEmojiSize: makeMediaSize(REACTION_BLOCK_SIZE, REACTION_BLOCK_SIZE)\n });\n\n this.stickerContainer.append(wrapped);\n }\n }\n }\n\n private renderDoc(doc: Document.document) {\n const size = this.type === 'inline' ? REACTION_INLINE_SIZE : REACTION_BLOCK_SIZE;\n const wrapPromise = this.wrapStickerPromise = wrapSticker({\n div: this.stickerContainer,\n doc,\n width: size,\n height: size,\n static: true,\n managers: this.managers,\n middleware: this.middleware\n }).then(({render}) => render).finally(() => {\n if(this.wrapStickerPromise === wrapPromise) {\n this.wrapStickerPromise = undefined;\n }\n });\n }\n\n public renderCounter() {\n const reactionCount = this.reactionCount;\n const displayOn = this.type === 'inline' ? REACTION_DISPLAY_INLINE_COUNTER_AT : REACTION_DISPLAY_BLOCK_COUNTER_AT;\n if(reactionCount.count >= displayOn || (this.type === 'block' && !this.canRenderAvatars)) {\n if(!this.counter) {\n this.counter = document.createElement(this.type === 'inline' ? 'i' : 'span');\n this.counter.classList.add(CLASS_NAME + '-counter');\n }\n\n const formatted = formatNumber(reactionCount.count);\n if(this.counter.textContent !== formatted) {\n this.counter.textContent = formatted;\n }\n\n if(!this.counter.parentElement) {\n this.append(this.counter);\n }\n } else if(this.counter?.parentElement) {\n this.counter.remove();\n this.counter = undefined;\n }\n }\n\n public renderAvatars(recentReactions: MessagePeerReaction[]) {\n if(this.type === 'inline') {\n return;\n }\n\n if(this.reactionCount.count >= REACTION_DISPLAY_BLOCK_COUNTER_AT || !this.canRenderAvatars) {\n if(this.stackedAvatars) {\n this.stackedAvatars.container.remove();\n this.stackedAvatars = undefined;\n }\n\n return;\n }\n\n if(!this.stackedAvatars) {\n this.stackedAvatars = new StackedAvatars({\n avatarSize: 24\n });\n\n this.append(this.stackedAvatars.container);\n }\n\n this.stackedAvatars.render(recentReactions.map((reaction) => getPeerId(reaction.peer_id)));\n }\n\n public setIsChosen(isChosen = this.reactionCount.chosen_order !== undefined) {\n if(this.type === 'inline') return;\n const wasChosen = this.classList.contains('is-chosen') && !this.classList.contains('backwards');\n if(wasChosen !== isChosen) {\n SetTransition({\n element: this,\n className: 'is-chosen',\n forwards: isChosen,\n duration: this.isConnected ? 300 : 0\n });\n }\n }\n\n public fireAroundAnimation() {\n if(!liteMode.isAvailable('effects_reactions')) {\n return;\n }\n\n const reaction = this.reactionCount.reaction;\n if(reaction._ !== 'reactionEmoji') return;\n callbackify(this.managers.appReactionsManager.getReaction(reaction.emoticon), (availableReaction) => {\n const size = this.type === 'inline' ? REACTION_INLINE_SIZE + 14 : REACTION_BLOCK_SIZE + 18;\n const div = document.createElement('div');\n div.classList.add(CLASS_NAME + '-sticker-activate');\n\n Promise.all([\n wrapSticker({\n div: div,\n doc: availableReaction.center_icon,\n width: size,\n height: size,\n withThumb: false,\n needUpscale: true,\n play: false,\n skipRatio: 1,\n group: 'none',\n needFadeIn: false,\n managers: this.managers,\n middleware: this.middleware\n }).then(({render}) => render as Promise),\n\n wrapStickerAnimation({\n doc: availableReaction.around_animation,\n size: 80,\n target: this.stickerContainer,\n side: 'center',\n skipRatio: 1,\n play: false,\n managers: this.managers,\n middleware: this.middleware\n }).stickerPromise.catch(noop)\n ]).then(([iconPlayer, aroundPlayer]) => {\n const remove = () => {\n // if(!isInDOM(div)) return;\n iconPlayer.remove();\n div.remove();\n this.stickerContainer.classList.remove('has-animation');\n };\n\n if(!aroundPlayer) {\n remove();\n return;\n }\n\n const removeOnFrame = () => {\n // if(!isInDOM(div)) return;\n fastRaf(remove);\n };\n\n iconPlayer.addEventListener('enterFrame', (frameNo) => {\n if(frameNo === iconPlayer.maxFrame) {\n if(this.wrapStickerPromise) { // wait for fade in animation\n this.wrapStickerPromise.then(() => {\n setTimeout(removeOnFrame, 1e3);\n });\n } else {\n removeOnFrame();\n }\n }\n });\n\n iconPlayer.addEventListener('firstFrame', () => {\n this.stickerContainer.append(div);\n this.stickerContainer.classList.add('has-animation');\n iconPlayer.play();\n aroundPlayer.play();\n }, {once: true});\n });\n });\n }\n}\n\ncustomElements.define(TAG_NAME, ReactionElement);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport positionElementByIndex from '../../helpers/dom/positionElementByIndex';\nimport {Middleware, MiddlewareHelper} from '../../helpers/middleware';\nimport {Message, ReactionCount} from '../../layer';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport reactionsEqual from '../../lib/appManagers/utils/reactions/reactionsEqual';\nimport rootScope from '../../lib/rootScope';\nimport ReactionElement, {ReactionLayoutType, REACTION_DISPLAY_BLOCK_COUNTER_AT} from './reaction';\n\nconst CLASS_NAME = 'reactions';\nconst TAG_NAME = CLASS_NAME + '-element';\n\nconst REACTIONS_ELEMENTS: Map> = new Map();\nexport {REACTIONS_ELEMENTS};\n\nexport default class ReactionsElement extends HTMLElement {\n private message: Message.message;\n private key: string;\n private isPlaceholder: boolean;\n private type: ReactionLayoutType;\n private sorted: ReactionElement[];\n private onConnectCallback: () => void;\n private managers: AppManagers;\n private middleware: Middleware;\n private middlewareHelpers: Map;\n\n constructor() {\n super();\n this.classList.add(CLASS_NAME);\n this.sorted = [];\n this.middlewareHelpers = new Map();\n this.managers = rootScope.managers;\n }\n\n connectedCallback() {\n let set = REACTIONS_ELEMENTS.get(this.key);\n if(!set) {\n REACTIONS_ELEMENTS.set(this.key, set = new Set());\n }\n\n set.add(this);\n\n if(this.onConnectCallback && this.isConnected) {\n this.onConnectCallback();\n this.onConnectCallback = undefined;\n }\n }\n\n disconnectedCallback() {\n const set = REACTIONS_ELEMENTS.get(this.key);\n set.delete(this);\n if(!set.size) {\n REACTIONS_ELEMENTS.delete(this.key);\n }\n }\n\n public getReactionCount(reactionElement: ReactionElement) {\n return this.sorted[this.sorted.indexOf(reactionElement)].reactionCount;\n }\n\n public getMessage() {\n return this.message;\n }\n\n public init(\n message: Message.message,\n type: ReactionLayoutType,\n middleware: Middleware,\n isPlaceholder = this.isPlaceholder\n ) {\n if(this.key !== undefined) {\n this.disconnectedCallback();\n }\n\n if(this.middleware !== middleware) {\n middleware.onDestroy(() => {\n this.middlewareHelpers.clear();\n });\n }\n\n this.message = message;\n this.key = this.message.peerId + '_' + this.message.mid;\n this.middleware = middleware;\n this.isPlaceholder = isPlaceholder;\n\n if(this.type !== type) {\n this.type = type;\n this.classList.add(CLASS_NAME + '-' + type);\n }\n\n this.connectedCallback();\n }\n\n public changeMessage(message: Message.message) {\n return this.init(message, this.type, this.middleware);\n }\n\n public update(message: Message.message, changedResults?: ReactionCount[]) {\n this.message = message;\n this.render(changedResults);\n }\n\n public render(changedResults?: ReactionCount[]) {\n const reactions = this.message.reactions;\n const hasReactions = !!(reactions && reactions.results.length);\n this.classList.toggle('has-no-reactions', !hasReactions);\n if(!hasReactions && !this.sorted.length) return;\n\n const availableReactionsResult = this.managers.appReactionsManager.getAvailableReactions();\n // callbackify(availableReactionsResult, () => {\n const counts = hasReactions ? (\n reactions.results\n // availableReactionsResult instanceof Promise ?\n // reactions.results :\n // reactions.results.filter((reactionCount) => {\n // return this.managers.appReactionsManager.isReactionActive(reactionCount.reaction);\n // })\n ) : [];\n\n // if(this.message.peerId.isUser()) {\n // counts.sort((a, b) => (b.count - a.count) || ((b.chosen_order ?? 0) - (a.chosen_order ?? 0)));\n // } else {\n counts.sort((a, b) => (b.count - a.count) || ((a.chosen_order ?? 0) - (b.chosen_order ?? 0)));\n // }\n\n forEachReverse(this.sorted, (reactionElement, idx, arr) => {\n const reaction = reactionElement.reactionCount.reaction;\n const found = counts.some((reactionCount) => reactionsEqual(reactionCount.reaction, reaction));\n if(!found) {\n const middlewareHelper = this.middlewareHelpers.get(reactionElement);\n middlewareHelper.destroy();\n this.middlewareHelpers.delete(reactionElement);\n arr.splice(idx, 1);\n reactionElement.remove();\n }\n });\n\n const totalReactions = counts.reduce((acc, c) => acc + c.count, 0);\n const canRenderAvatars = reactions && (!!reactions.pFlags.can_see_list || this.message.peerId.isUser()) && totalReactions < REACTION_DISPLAY_BLOCK_COUNTER_AT;\n this.sorted = counts.map((reactionCount, idx) => {\n let reactionElement: ReactionElement = this.sorted.find((reactionElement) => reactionsEqual(reactionElement.reactionCount.reaction, reactionCount.reaction));\n if(!reactionElement) {\n const middlewareHelper = this.middleware.create();\n reactionElement = new ReactionElement();\n reactionElement.init(this.type, middlewareHelper.get());\n this.middlewareHelpers.set(reactionElement, middlewareHelper);\n }\n\n positionElementByIndex(reactionElement, this, idx);\n\n const recentReactions = reactions.recent_reactions ? reactions.recent_reactions.filter((reaction) => reactionsEqual(reaction.reaction, reactionCount.reaction)) : [];\n reactionElement.reactionCount = {...reactionCount};\n reactionElement.setCanRenderAvatars(canRenderAvatars);\n reactionElement.render(this.isPlaceholder);\n reactionElement.renderCounter();\n reactionElement.renderAvatars(recentReactions);\n reactionElement.setIsChosen();\n\n return reactionElement;\n });\n\n // this.sorted.forEach((reactionElement, idx) => {\n // /* if(this.type === 'block' && this.childElementCount !== this.sorted.length) { // because of appended time\n // idx += 1;\n // } */\n\n // positionElementByIndex(reactionElement, this, idx);\n // });\n\n if(!this.isPlaceholder && changedResults?.length) {\n if(this.isConnected) {\n this.handleChangedResults(changedResults);\n } else {\n this.onConnectCallback = () => {\n this.handleChangedResults(changedResults);\n };\n }\n }\n // });\n\n // ! тут вообще не должно быть этого кода, но пока он побудет тут\n if(!this.sorted.length && this.type === 'block') {\n const parentElement = this.parentElement;\n this.remove();\n\n if(parentElement.classList.contains('document-message') && !parentElement.childNodes.length) {\n parentElement.remove();\n return;\n }\n\n const timeSpan = this.querySelector('.time');\n if(timeSpan) {\n parentElement.append(timeSpan);\n }\n }\n }\n\n private handleChangedResults(changedResults: ReactionCount[]) {\n // ! temp\n if(this.message.peerId !== appImManager.chat.peerId) return;\n\n changedResults.forEach((reactionCount) => {\n const reactionElement = this.sorted.find((reactionElement) => reactionsEqual(reactionElement.reactionCount.reaction, reactionCount.reaction));\n reactionElement?.fireAroundAnimation();\n });\n }\n}\n\ncustomElements.define(TAG_NAME, ReactionsElement);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport {Middleware} from '../../helpers/middleware';\nimport limitSymbols from '../../helpers/string/limitSymbols';\nimport {Document, Message, MessageMedia, Photo, WebPage, VideoSize} from '../../layer';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport choosePhotoSize from '../../lib/appManagers/utils/photos/choosePhotoSize';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport DivAndCaption from '../divAndCaption';\nimport wrapMessageForReply from '../wrappers/messageForReply';\nimport wrapPhoto from '../wrappers/photo';\nimport wrapSticker from '../wrappers/sticker';\nimport wrapVideo from '../wrappers/video';\nimport {AnimationItemGroup} from '../animationIntersector';\n\nconst MEDIA_SIZE = 32;\n\nexport async function wrapReplyDivAndCaption(options: {\n title: string | HTMLElement | DocumentFragment,\n titleEl: HTMLElement,\n subtitle: string | HTMLElement | DocumentFragment,\n subtitleEl: HTMLElement,\n message: Message.message | Message.messageService,\n mediaEl: HTMLElement,\n loadPromises?: Promise[],\n animationGroup: AnimationItemGroup\n}) {\n let {title, titleEl, subtitle, subtitleEl, mediaEl, message, loadPromises, animationGroup} = options;\n if(title !== undefined) {\n if(typeof(title) === 'string') {\n title = limitSymbols(title, 140);\n title = wrapEmojiText(title);\n }\n\n replaceContent(titleEl, title);\n }\n\n if(!loadPromises) {\n loadPromises = [];\n }\n\n let messageMedia: MessageMedia | WebPage.webPage = (message as Message.message)?.media;\n let setMedia = false, isRound = false;\n const mediaChildren = mediaEl ? Array.from(mediaEl.children).slice() : [];\n let middleware: Middleware;\n if(messageMedia && mediaEl) {\n subtitleEl.textContent = '';\n subtitleEl.append(await wrapMessageForReply({message, animationGroup, withoutMediaType: true}));\n\n messageMedia = (messageMedia as MessageMedia.messageMediaWebPage).webpage as WebPage.webPage || messageMedia;\n const photo = (messageMedia as MessageMedia.messageMediaPhoto).photo as Photo.photo;\n const document = (messageMedia as MessageMedia.messageMediaDocument).document as Document.document;\n if(photo || (document && document.thumbs?.length)/* ['video', 'sticker', 'gif', 'round', 'photo', 'audio'].indexOf(document.type) !== -1) */) {\n middleware = appImManager.chat.bubbles.getMiddleware();\n const lazyLoadQueue = appImManager.chat.bubbles.lazyLoadQueue;\n\n if(document?.type === 'sticker') {\n await wrapSticker({\n doc: document,\n div: mediaEl,\n lazyLoadQueue,\n group: animationGroup,\n // onlyThumb: document.sticker === 2,\n width: MEDIA_SIZE,\n height: MEDIA_SIZE,\n middleware,\n loadPromises\n });\n setMedia = true;\n } else if(document?.type === 'gif' && document.video_thumbs) {\n setMedia = true;\n await wrapVideo({\n doc: document,\n container: mediaEl,\n boxWidth: MEDIA_SIZE,\n boxHeight: MEDIA_SIZE,\n lazyLoadQueue,\n noPlayButton: true,\n noInfo: true,\n middleware,\n loadPromises,\n withoutPreloader: true,\n videoSize: document.video_thumbs[0] as Extract,\n group: animationGroup\n });\n } else {\n const m = photo || document;\n isRound = document?.type === 'round';\n\n try {\n await wrapPhoto({\n photo: m,\n container: mediaEl,\n boxWidth: MEDIA_SIZE,\n boxHeight: MEDIA_SIZE,\n size: choosePhotoSize(m, MEDIA_SIZE, MEDIA_SIZE),\n middleware,\n lazyLoadQueue,\n noBlur: true,\n withoutPreloader: true,\n loadPromises\n });\n setMedia = true;\n } catch(err) {\n\n }\n }\n }\n } else {\n if(message) {\n subtitleEl.textContent = '';\n subtitleEl.append(await wrapMessageForReply({message}));\n } else {\n if(typeof(subtitle) === 'string') {\n subtitle = limitSymbols(subtitle, 140);\n subtitle = wrapEmojiText(subtitle);\n }\n\n replaceContent(subtitleEl, subtitle || '');\n }\n }\n\n Promise.all(loadPromises).then(() => {\n if(middleware && !middleware()) return;\n mediaChildren.forEach((child) => child.remove());\n\n if(mediaEl) {\n mediaEl.classList.toggle('is-round', isRound);\n }\n });\n\n return setMedia;\n}\n\nexport default class ReplyContainer extends DivAndCaption<(title: string | HTMLElement | DocumentFragment, subtitle: string | HTMLElement | DocumentFragment, message?: any) => Promise> {\n private mediaEl: HTMLElement;\n\n constructor(protected className: string, protected animationGroup: AnimationItemGroup) {\n super(className, async(title, subtitle = '', message?) => {\n if(!this.mediaEl) {\n this.mediaEl = document.createElement('div');\n this.mediaEl.classList.add(this.className + '-media');\n }\n\n const isMediaSet = await wrapReplyDivAndCaption({\n title,\n titleEl: this.title,\n subtitle,\n subtitleEl: this.subtitle,\n mediaEl: this.mediaEl,\n message,\n animationGroup\n });\n\n this.container.classList.toggle('is-media', isMediaSet);\n if(isMediaSet) {\n this.content.prepend(this.mediaEl);\n } else {\n this.mediaEl.remove();\n }\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AppMessagesManager, MessagesStorageKey} from '../../lib/appManagers/appMessagesManager';\nimport type ChatBubbles from './bubbles';\nimport type ChatInput from './input';\nimport type Chat from './chat';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport Button from '../button';\nimport ButtonIcon from '../buttonIcon';\nimport CheckboxField from '../checkboxField';\nimport PopupDeleteMessages from '../popups/deleteMessages';\nimport PopupForward from '../popups/forward';\nimport SetTransition from '../singleTransition';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport PopupSendNow from '../popups/sendNow';\nimport appNavigationController, {NavigationItem} from '../appNavigationController';\nimport {IS_MOBILE_SAFARI} from '../../environment/userAgent';\nimport I18n, {i18n, _i18n} from '../../lib/langPack';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport blurActiveElement from '../../helpers/dom/blurActiveElement';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport cancelSelection from '../../helpers/dom/cancelSelection';\nimport getSelectedText from '../../helpers/dom/getSelectedText';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport AppSearchSuper from '../appSearchSuper.';\nimport isInDOM from '../../helpers/dom/isInDOM';\nimport {randomLong} from '../../helpers/random';\nimport {attachClickEvent, AttachClickOptions} from '../../helpers/dom/clickEvent';\nimport findUpAsChild from '../../helpers/dom/findUpAsChild';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport {attachContextMenuListener} from '../../helpers/dom/attachContextMenuListener';\nimport filterUnique from '../../helpers/array/filterUnique';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {Message} from '../../layer';\nimport PopupElement from '../popups';\n\nconst accumulateMapSet = (map: Map>) => {\n return [...map.values()].reduce((acc, v) => acc + v.size, 0);\n};\n\n// const MIN_CLICK_MOVE = 32; // minimum bubble height\n\nclass AppSelection extends EventListenerBase<{\n toggle: (isSelecting: boolean) => void\n}> {\n public selectedMids: Map> = new Map();\n public isSelecting = false;\n\n public selectedText: string;\n\n protected listenerSetter: ListenerSetter;\n protected isScheduled: boolean;\n protected listenElement: HTMLElement;\n\n protected onToggleSelection: (forwards: boolean, animate: boolean) => void | Promise;\n protected onUpdateContainer: (cantForward: boolean, cantDelete: boolean, cantSend: boolean) => void;\n protected onCancelSelection: () => void;\n protected toggleByMid: (peerId: PeerId, mid: number) => void;\n protected toggleByElement: (bubble: HTMLElement) => void;\n\n protected navigationType: NavigationItem['type'];\n\n protected getElementFromTarget: (target: HTMLElement) => HTMLElement;\n protected verifyTarget: (e: MouseEvent, target: HTMLElement) => boolean;\n protected verifyMouseMoveTarget: (e: MouseEvent, element: HTMLElement, selecting: boolean) => boolean;\n protected verifyTouchLongPress: () => boolean;\n protected targetLookupClassName: string;\n protected lookupBetweenParentClassName: string;\n protected lookupBetweenElementsQuery: string;\n\n protected doNotAnimate: boolean;\n protected managers: AppManagers;\n\n constructor(options: {\n managers: AppManagers,\n getElementFromTarget: AppSelection['getElementFromTarget'],\n verifyTarget?: AppSelection['verifyTarget'],\n verifyMouseMoveTarget?: AppSelection['verifyMouseMoveTarget'],\n verifyTouchLongPress?: AppSelection['verifyTouchLongPress'],\n targetLookupClassName: string,\n lookupBetweenParentClassName: string,\n lookupBetweenElementsQuery: string,\n isScheduled?: AppSelection['isScheduled']\n }) {\n super(false);\n\n safeAssign(this, options);\n\n this.navigationType = 'multiselect-' + randomLong() as any;\n }\n\n public attachListeners(listenElement: HTMLElement, listenerSetter: ListenerSetter) {\n if(this.listenElement) {\n this.listenerSetter.removeAll();\n }\n\n this.listenElement = listenElement;\n this.listenerSetter = listenerSetter;\n\n if(!listenElement) {\n return;\n }\n\n if(IS_TOUCH_SUPPORTED) {\n listenerSetter.add(listenElement)('touchend', () => {\n if(!this.isSelecting) return;\n this.selectedText = getSelectedText();\n });\n\n attachContextMenuListener({\n element: listenElement,\n callback: (e) => {\n if(this.isSelecting || (this.verifyTouchLongPress && !this.verifyTouchLongPress())) return;\n\n // * these two lines will fix instant text selection on iOS Safari\n document.body.classList.add('no-select'); // * need no-select on body because chat-input transforms in channels\n listenElement.addEventListener('touchend', (e) => {\n cancelEvent(e); // ! this one will fix propagation to document loader button, etc\n document.body.classList.remove('no-select');\n\n // this.chat.bubbles.onBubblesClick(e);\n }, {once: true, capture: true});\n\n cancelSelection();\n // cancelEvent(e as any);\n const element = this.getElementFromTarget(e.target as HTMLElement);\n if(element) {\n this.toggleByElement(element);\n }\n },\n listenerSetter\n });\n\n return;\n }\n\n listenerSetter.add(listenElement)('mousedown', this.onMouseDown);\n }\n\n private onMouseDown = (e: MouseEvent) => {\n // console.log('selection mousedown', e);\n const element = findUpClassName(e.target, this.targetLookupClassName);\n if(e.button !== 0) {\n return;\n }\n\n if(this.verifyTarget && !this.verifyTarget(e, element)) {\n return;\n }\n\n const seen: AppSelection['selectedMids'] = new Map();\n let selecting: boolean;\n\n /* let good = false;\n const {x, y} = e; */\n\n /* const bubbles = appImManager.bubbles;\n for(const mid in bubbles) {\n const bubble = bubbles[mid];\n bubble.addEventListener('mouseover', () => {\n console.log('mouseover');\n }, {once: true});\n } */\n\n let firstTarget = element;\n\n const processElement = (element: HTMLElement, checkBetween = true) => {\n const mid = +element.dataset.mid;\n if(!mid || !element.dataset.peerId) return;\n const peerId = element.dataset.peerId.toPeerId();\n\n if(!isInDOM(firstTarget)) {\n firstTarget = element;\n }\n\n let seenSet = seen.get(peerId);\n if(!seenSet) {\n seen.set(peerId, seenSet = new Set());\n }\n\n if(seenSet.has(mid)) {\n return;\n }\n\n const isSelected = this.isMidSelected(peerId, mid);\n if(selecting === undefined) {\n // bubblesContainer.classList.add('no-select');\n selecting = !isSelected;\n }\n\n seenSet.add(mid);\n\n if((selecting && !isSelected) || (!selecting && isSelected)) {\n const seenLength = accumulateMapSet(seen);\n if(this.toggleByElement && checkBetween) {\n if(seenLength < 2) {\n if(findUpAsChild(element, firstTarget)) {\n firstTarget = element;\n }\n }\n\n const elementsBetween = this.getElementsBetween(firstTarget, element);\n // console.log(elementsBetween);\n if(elementsBetween.length) {\n elementsBetween.forEach((element) => {\n processElement(element, false);\n });\n }\n }\n\n if(!this.selectedMids.size) {\n if(seenLength === 2 && this.toggleByMid) {\n for(const [peerId, mids] of seen) {\n for(const mid of mids) {\n this.toggleByMid(peerId, mid);\n }\n }\n }\n } else if(this.toggleByElement) {\n this.toggleByElement(element);\n }\n }\n };\n\n // const foundTargets: Map = new Map();\n let canceledSelection = false;\n const onMouseMove = (e: MouseEvent) => {\n if(!canceledSelection) {\n cancelSelection();\n canceledSelection = true;\n }\n /* if(!good) {\n if(Math.abs(e.x - x) > MIN_CLICK_MOVE || Math.abs(e.y - y) > MIN_CLICK_MOVE) {\n good = true;\n } else {\n return;\n }\n } */\n\n /* if(foundTargets.has(e.target as HTMLElement)) return;\n foundTargets.set(e.target as HTMLElement, true); */\n const element = this.getElementFromTarget(e.target as HTMLElement);\n if(!element) {\n // console.error('found no bubble', e);\n return;\n }\n\n if(this.verifyMouseMoveTarget && !this.verifyMouseMoveTarget(e, element, selecting)) {\n this.listenerSetter.removeManual(this.listenElement, 'mousemove', onMouseMove);\n this.listenerSetter.removeManual(document, 'mouseup', onMouseUp, documentListenerOptions);\n return;\n }\n\n processElement(element);\n };\n\n const onMouseUp = (e: MouseEvent) => {\n if(seen.size) {\n attachClickEvent(window, cancelEvent, {capture: true, once: true, passive: false});\n }\n\n this.listenerSetter.removeManual(this.listenElement, 'mousemove', onMouseMove);\n // bubblesContainer.classList.remove('no-select');\n\n // ! CANCEL USER SELECTION !\n cancelSelection();\n };\n\n const documentListenerOptions = {once: true};\n this.listenerSetter.add(this.listenElement)('mousemove', onMouseMove);\n this.listenerSetter.add(document)('mouseup', onMouseUp, documentListenerOptions);\n };\n\n private getElementsBetween = (first: HTMLElement, last: HTMLElement) => {\n if(first === last) {\n return [];\n }\n\n const firstRect = first.getBoundingClientRect();\n const lastRect = last.getBoundingClientRect();\n const difference = (firstRect.top - lastRect.top) || (firstRect.left - lastRect.left);\n const isHigher = difference < 0;\n\n const parent = findUpClassName(first, this.lookupBetweenParentClassName);\n if(!parent) {\n return [];\n }\n\n const elements = Array.from(parent.querySelectorAll(this.lookupBetweenElementsQuery)) as HTMLElement[];\n let firstIndex = elements.indexOf(first);\n let lastIndex = elements.indexOf(last);\n\n if(!isHigher) {\n [lastIndex, firstIndex] = [firstIndex, lastIndex];\n }\n\n const slice = elements.slice(firstIndex + 1, lastIndex);\n\n // console.log('getElementsBetween', first, last, slice, firstIndex, lastIndex, isHigher);\n\n return slice;\n };\n\n protected isElementShouldBeSelected(element: HTMLElement) {\n return this.isMidSelected(element.dataset.peerId.toPeerId(), +element.dataset.mid);\n }\n\n protected appendCheckbox(element: HTMLElement, checkboxField: CheckboxField) {\n element.prepend(checkboxField.label);\n }\n\n public toggleElementCheckbox(element: HTMLElement, show: boolean) {\n const hasCheckbox = !!this.getCheckboxInputFromElement(element);\n if(show) {\n if(hasCheckbox) {\n return false;\n }\n\n const checkboxField = new CheckboxField({\n name: element.dataset.mid,\n round: true\n });\n\n // * if it is a render of new message\n if(this.isSelecting) { // ! avoid breaking animation on start\n if(this.isElementShouldBeSelected(element)) {\n checkboxField.input.checked = true;\n element.classList.add('is-selected');\n }\n }\n\n this.appendCheckbox(element, checkboxField);\n } else if(hasCheckbox) {\n this.getCheckboxInputFromElement(element).parentElement.remove();\n SetTransition({\n element,\n className: 'is-selected',\n forwards: false,\n duration: 200\n });\n }\n\n return true;\n }\n\n protected getCheckboxInputFromElement(element: HTMLElement): HTMLInputElement {\n return element.firstElementChild?.tagName === 'LABEL' &&\n element.firstElementChild.firstElementChild as HTMLInputElement;\n }\n\n protected async updateContainer(forceSelection = false) {\n const size = this.selectedMids.size;\n if(!size && !forceSelection) return;\n\n let cantForward = !size,\n cantDelete = !size;\n const cantSend = !size;\n for(const [peerId, mids] of this.selectedMids) {\n const storageKey = this.getStorageKey(peerId);\n const r = await this.managers.appMessagesManager.cantForwardDeleteMids(storageKey, Array.from(mids));\n cantForward = r.cantForward;\n cantDelete = r.cantDelete;\n\n if(cantForward && cantDelete) break;\n }\n\n this.onUpdateContainer?.(cantForward, cantDelete, cantSend);\n }\n\n private getStorageKey(peerId: PeerId): MessagesStorageKey {\n return `${peerId}_${this.isScheduled ? 'scheduled' : 'history'}`;\n }\n\n public getSelectedMessages() {\n const selectedMessagesPromises: Promise[] = [];\n this.selectedMids.forEach((mids, peerId) => {\n const storageKey = this.getStorageKey(peerId);\n const p = Array.from(mids).map((mid) => this.managers.appMessagesManager.getMessageFromStorage(storageKey, mid));\n selectedMessagesPromises.push(...p);\n });\n return Promise.all(selectedMessagesPromises);\n }\n\n public toggleSelection(toggleCheckboxes = true, forceSelection = false) {\n const wasSelecting = this.isSelecting;\n const size = this.selectedMids.size;\n this.isSelecting = !!size || forceSelection;\n\n if(wasSelecting === this.isSelecting) return false;\n\n this.dispatchEvent('toggle', this.isSelecting);\n\n // const bubblesContainer = this.bubbles.bubblesContainer;\n // bubblesContainer.classList.toggle('is-selecting', !!size);\n\n /* if(bubblesContainer.classList.contains('is-chat-input-hidden')) {\n const scrollable = this.appImManager.scrollable;\n if(scrollable.isScrolledDown) {\n scrollable.scrollTo(scrollable.scrollHeight, 'top', true, true, 200);\n }\n } */\n\n if(!IS_TOUCH_SUPPORTED) {\n this.listenElement.classList.toggle('no-select', this.isSelecting);\n\n if(wasSelecting) {\n // ! CANCEL USER SELECTION !\n cancelSelection();\n }\n }/* else {\n if(!wasSelecting) {\n bubblesContainer.classList.add('no-select');\n setTimeout(() => {\n cancelSelection();\n bubblesContainer.classList.remove('no-select');\n cancelSelection();\n }, 100);\n }\n } */\n\n blurActiveElement();\n\n const forwards = !!size || forceSelection;\n const toggleResult = this.onToggleSelection?.(forwards, !this.doNotAnimate);\n\n if(!IS_MOBILE_SAFARI) {\n if(forwards) {\n appNavigationController.pushItem({\n type: this.navigationType,\n onPop: () => {\n this.cancelSelection();\n }\n });\n } else {\n appNavigationController.removeByType(this.navigationType);\n }\n }\n\n if(forceSelection) {\n (toggleResult || Promise.resolve()).then(() => this.updateContainer(forceSelection));\n }\n\n return true;\n }\n\n public cancelSelection = async(doNotAnimate?: boolean) => {\n if(doNotAnimate) this.doNotAnimate = true;\n this.onCancelSelection && await this.onCancelSelection();\n this.selectedMids.clear();\n this.toggleSelection();\n cancelSelection();\n if(doNotAnimate) this.doNotAnimate = undefined;\n };\n\n public cleanup() {\n this.doNotAnimate = true;\n this.selectedMids.clear();\n this.toggleSelection(false);\n this.doNotAnimate = undefined;\n }\n\n protected updateElementSelection(element: HTMLElement, isSelected: boolean) {\n this.toggleElementCheckbox(element, true);\n const input = this.getCheckboxInputFromElement(element);\n input.checked = isSelected;\n\n this.toggleSelection();\n this.updateContainer();\n SetTransition({\n element,\n className: 'is-selected',\n forwards: isSelected,\n duration: 200\n });\n }\n\n public isMidSelected(peerId: PeerId, mid: number) {\n const set = this.selectedMids.get(peerId);\n return !!set?.has(mid);\n }\n\n public length() {\n return accumulateMapSet(this.selectedMids);\n }\n\n protected toggleMid(peerId: PeerId, mid: number, unselect?: boolean) {\n let set = this.selectedMids.get(peerId);\n if(unselect || (unselect === undefined && set?.has(mid))) {\n if(set) {\n set.delete(mid);\n\n if(!set.size) {\n this.selectedMids.delete(peerId);\n }\n }\n } else {\n // const diff = rootScope.config.forwarded_count_max - this.length() - 1;\n // if(diff < 0) {\n // toast(I18n.format('Chat.Selection.LimitToast', true));\n // return false;\n // /* const it = this.selectedMids.values();\n // do {\n // const mid = it.next().value;\n // const mounted = this.appImManager.getMountedBubble(mid);\n // if(mounted) {\n // this.toggleByBubble(mounted.bubble);\n // } else {\n // const mids = this.appMessagesManager.getMidsByMid(mid);\n // for(const mid of mids) {\n // this.selectedMids.delete(mid);\n // }\n // }\n // } while(this.selectedMids.size > MAX_SELECTION_LENGTH); */\n // }\n\n if(!set) {\n set = new Set();\n this.selectedMids.set(peerId, set);\n }\n\n set.add(mid);\n }\n\n return true;\n }\n\n /**\n * ! Call this method only to handle deleted messages\n */\n public deleteSelectedMids(peerId: PeerId, mids: number[]) {\n const set = this.selectedMids.get(peerId);\n if(!set) {\n return;\n }\n\n mids.forEach((mid) => {\n set.delete(mid);\n });\n\n if(!set.size) {\n this.selectedMids.delete(peerId);\n }\n\n this.updateContainer();\n this.toggleSelection();\n }\n}\n\nexport class SearchSelection extends AppSelection {\n protected selectionContainer: HTMLElement;\n protected selectionCountEl: HTMLElement;\n public selectionForwardBtn: HTMLElement;\n public selectionDeleteBtn: HTMLElement;\n public selectionGotoBtn: HTMLElement;\n\n private isPrivate: boolean;\n\n constructor(private searchSuper: AppSearchSuper, managers: AppManagers, listenerSetter: ListenerSetter) {\n super({\n managers,\n verifyTarget: (e, target) => !!target && this.isSelecting,\n getElementFromTarget: (target) => findUpClassName(target, 'search-super-item'),\n targetLookupClassName: 'search-super-item',\n lookupBetweenParentClassName: 'tabs-tab',\n lookupBetweenElementsQuery: '.search-super-item'\n });\n\n this.isPrivate = !searchSuper.showSender;\n this.attachListeners(searchSuper.container, listenerSetter);\n }\n\n /* public appendCheckbox(element: HTMLElement, checkboxField: CheckboxField) {\n checkboxField.label.classList.add('bubble-select-checkbox');\n\n if(element.classList.contains('document') || element.tagName === 'AUDIO-ELEMENT') {\n element.querySelector('.document, audio-element').append(checkboxField.label);\n } else {\n super.appendCheckbox(bubble, checkboxField);\n }\n } */\n\n public toggleSelection(toggleCheckboxes = true, forceSelection = false) {\n const ret = super.toggleSelection(toggleCheckboxes, forceSelection);\n\n if(ret && toggleCheckboxes) {\n const elements = Array.from(this.searchSuper.tabsContainer.querySelectorAll('.search-super-item')) as HTMLElement[];\n elements.forEach((element) => {\n this.toggleElementCheckbox(element, this.isSelecting);\n });\n }\n\n return ret;\n }\n\n public toggleByElement = (element: HTMLElement) => {\n const mid = +element.dataset.mid;\n const peerId = element.dataset.peerId.toPeerId();\n\n if(!this.toggleMid(peerId, mid)) {\n return;\n }\n\n this.updateElementSelection(element, this.isMidSelected(peerId, mid));\n };\n\n public toggleByMid = (peerId: PeerId, mid: number) => {\n const element = this.searchSuper.mediaTab.contentTab.querySelector(`.search-super-item[data-peer-id=\"${peerId}\"][data-mid=\"${mid}\"]`) as HTMLElement;\n this.toggleByElement(element);\n };\n\n protected onUpdateContainer = (cantForward: boolean, cantDelete: boolean, cantSend: boolean) => {\n const length = this.length();\n replaceContent(this.selectionCountEl, i18n('messages', [length]));\n this.selectionGotoBtn.classList.toggle('hide', length !== 1);\n this.selectionForwardBtn.classList.toggle('hide', cantForward);\n this.selectionDeleteBtn && this.selectionDeleteBtn.classList.toggle('hide', cantDelete);\n };\n\n protected onToggleSelection = (forwards: boolean, animate: boolean) => {\n SetTransition({\n element: this.searchSuper.navScrollableContainer,\n className: 'is-selecting',\n forwards,\n duration: animate ? 200 : 0,\n onTransitionEnd: () => {\n if(!this.isSelecting) {\n this.selectionContainer.remove();\n this.selectionContainer =\n this.selectionForwardBtn =\n this.selectionDeleteBtn =\n null;\n this.selectedText = undefined;\n }\n }\n });\n\n SetTransition({\n element: this.searchSuper.container,\n className: 'is-selecting',\n forwards,\n duration: 200\n });\n\n if(this.isSelecting) {\n if(!this.selectionContainer) {\n const BASE_CLASS = 'search-super-selection';\n this.selectionContainer = document.createElement('div');\n this.selectionContainer.classList.add(BASE_CLASS + '-container');\n\n const btnCancel = ButtonIcon(`close ${BASE_CLASS}-cancel`, {noRipple: true});\n attachClickEvent(btnCancel, () => this.cancelSelection(), {listenerSetter: this.listenerSetter, once: true});\n\n this.selectionCountEl = document.createElement('div');\n this.selectionCountEl.classList.add(BASE_CLASS + '-count');\n\n this.selectionGotoBtn = ButtonIcon(`message ${BASE_CLASS}-goto`);\n\n const attachClickOptions: AttachClickOptions = {listenerSetter: this.listenerSetter};\n attachClickEvent(this.selectionGotoBtn, () => {\n const peerId = [...this.selectedMids.keys()][0];\n const mid = [...this.selectedMids.get(peerId)][0];\n this.cancelSelection();\n\n appImManager.setInnerPeer({peerId, lastMsgId: mid});\n }, attachClickOptions);\n\n this.selectionForwardBtn = ButtonIcon(`forward ${BASE_CLASS}-forward`);\n attachClickEvent(this.selectionForwardBtn, () => {\n const obj: {[fromPeerId: PeerId]: number[]} = {};\n for(const [fromPeerId, mids] of this.selectedMids) {\n obj[fromPeerId] = Array.from(mids).sort((a, b) => a - b);\n }\n\n PopupElement.createPopup(PopupForward, obj, () => {\n this.cancelSelection();\n });\n }, attachClickOptions);\n\n if(this.isPrivate) {\n this.selectionDeleteBtn = ButtonIcon(`delete danger ${BASE_CLASS}-delete`);\n attachClickEvent(this.selectionDeleteBtn, () => {\n const peerId = [...this.selectedMids.keys()][0];\n PopupElement.createPopup(PopupDeleteMessages, peerId, [...this.selectedMids.get(peerId)], 'chat', () => {\n this.cancelSelection();\n });\n }, attachClickOptions);\n }\n\n this.selectionContainer.append(...[\n btnCancel,\n this.selectionCountEl,\n this.selectionGotoBtn,\n this.selectionForwardBtn,\n this.selectionDeleteBtn\n ].filter(Boolean));\n\n const transitionElement = this.selectionContainer;\n transitionElement.style.opacity = '0';\n this.searchSuper.navScrollableContainer.append(transitionElement);\n\n void transitionElement.offsetLeft; // reflow\n transitionElement.style.opacity = '';\n }\n }\n };\n}\n\nexport default class ChatSelection extends AppSelection {\n protected selectionInputWrapper: HTMLElement;\n protected selectionContainer: HTMLElement;\n protected selectionCountEl: HTMLElement;\n public selectionSendNowBtn: HTMLElement;\n public selectionForwardBtn: HTMLElement;\n public selectionDeleteBtn: HTMLElement;\n private selectionLeft: HTMLDivElement;\n private selectionRight: HTMLDivElement;\n\n constructor(\n private chat: Chat,\n private bubbles: ChatBubbles,\n private input: ChatInput,\n managers: AppManagers\n ) {\n super({\n managers,\n getElementFromTarget: (target) => findUpClassName(target, 'grouped-item') || findUpClassName(target, 'bubble'),\n verifyTarget: (e, target) => {\n // LEFT BUTTON\n // проверка внизу нужна для того, чтобы не активировать селект если target потомок .bubble\n const bad = !this.selectedMids.size &&\n !(e.target as HTMLElement).classList.contains('bubble') &&\n !(e.target as HTMLElement).classList.contains('document-selection') &&\n target;\n\n return !bad;\n },\n verifyMouseMoveTarget: (e, element, selecting) => {\n const bad = e.target !== element &&\n !(e.target as HTMLElement).classList.contains('document-selection') &&\n selecting === undefined &&\n !this.selectedMids.size;\n return !bad;\n },\n verifyTouchLongPress: () => !this.chat.input.recording,\n targetLookupClassName: 'bubble',\n lookupBetweenParentClassName: 'bubbles-inner',\n lookupBetweenElementsQuery: '.bubble:not(.is-multiple-documents), .grouped-item',\n isScheduled: chat.type === 'scheduled'\n });\n }\n\n public appendCheckbox(bubble: HTMLElement, checkboxField: CheckboxField) {\n checkboxField.label.classList.add('bubble-select-checkbox');\n\n if(bubble.classList.contains('document-container')) {\n bubble.querySelector('.document, audio-element').append(checkboxField.label);\n } else {\n super.appendCheckbox(bubble, checkboxField);\n }\n }\n\n public toggleSelection(toggleCheckboxes = true, forceSelection = false) {\n const ret = super.toggleSelection(toggleCheckboxes, forceSelection);\n\n if(ret && toggleCheckboxes) {\n for(const mid in this.bubbles.bubbles) {\n if(this.bubbles.skippedMids.has(+mid)) {\n continue;\n }\n\n const bubble = this.bubbles.bubbles[mid];\n this.toggleElementCheckbox(bubble, this.isSelecting);\n }\n }\n\n return ret;\n }\n\n public toggleElementCheckbox(bubble: HTMLElement, show: boolean) {\n if(!this.canSelectBubble(bubble)) return;\n\n const ret = super.toggleElementCheckbox(bubble, show);\n if(ret) {\n const isGrouped = bubble.classList.contains('is-grouped');\n if(isGrouped) {\n this.bubbles.getBubbleGroupedItems(bubble).forEach((item) => this.toggleElementCheckbox(item, show));\n }\n }\n\n return ret;\n }\n\n public toggleByElement = (bubble: HTMLElement): Promise => {\n if(!this.canSelectBubble(bubble)) return;\n\n const mid = +bubble.dataset.mid;\n\n const isGrouped = bubble.classList.contains('is-grouped');\n if(isGrouped) {\n if(!this.isGroupedBubbleSelected(bubble)) {\n const set = this.selectedMids.get(this.chat.peerId);\n if(set) {\n // const mids = await this.chat.getMidsByMid(mid);\n const mids = this.getMidsFromGroupContainer(bubble);\n mids.forEach((mid) => set.delete(mid));\n }\n }\n\n /* const promises = */this.bubbles.getBubbleGroupedItems(bubble).map(this.toggleByElement);\n // await Promise.all(promises);\n return;\n }\n\n if(!this.toggleMid(this.chat.peerId, mid)) {\n return;\n }\n\n const isGroupedItem = bubble.classList.contains('grouped-item');\n if(isGroupedItem) {\n const groupContainer = findUpClassName(bubble, 'bubble');\n const isGroupedSelected = this.isGroupedBubbleSelected(groupContainer);\n const isGroupedMidsSelected = this.isGroupedMidsSelected(groupContainer);\n\n const willChange = isGroupedMidsSelected || isGroupedSelected;\n if(willChange) {\n this.updateElementSelection(groupContainer, isGroupedMidsSelected);\n }\n }\n\n this.updateElementSelection(bubble, this.isMidSelected(this.chat.peerId, mid));\n };\n\n protected toggleByMid = async(peerId: PeerId, mid: number) => {\n const mounted = await this.bubbles.getMountedBubble(mid);\n if(mounted) {\n this.toggleByElement(mounted.bubble);\n }\n };\n\n public isElementShouldBeSelected(element: HTMLElement) {\n const isGrouped = element.classList.contains('is-grouped');\n return super.isElementShouldBeSelected(element) && (!isGrouped || this.isGroupedMidsSelected(element));\n }\n\n protected isGroupedBubbleSelected(bubble: HTMLElement) {\n const groupedCheckboxInput = this.getCheckboxInputFromElement(bubble);\n return groupedCheckboxInput?.checked;\n }\n\n protected getMidsFromGroupContainer(groupContainer: HTMLElement) {\n const elements = this.chat.bubbles.getBubbleGroupedItems(groupContainer);\n if(!elements.length) {\n elements.push(groupContainer);\n }\n\n return elements.map((element) => +element.dataset.mid);\n }\n\n protected isGroupedMidsSelected(groupContainer: HTMLElement) {\n const mids = this.getMidsFromGroupContainer(groupContainer);\n const selectedMids = mids.filter((mid) => this.isMidSelected(this.chat.peerId, mid));\n return mids.length === selectedMids.length;\n }\n\n protected getCheckboxInputFromElement(bubble: HTMLElement) {\n /* let perf = performance.now();\n let checkbox = bubble.firstElementChild.tagName === 'LABEL' && bubble.firstElementChild.firstElementChild as HTMLInputElement;\n console.log('getCheckboxInputFromBubble firstElementChild time:', performance.now() - perf);\n\n perf = performance.now();\n checkbox = bubble.querySelector('label input');\n console.log('getCheckboxInputFromBubble querySelector time:', performance.now() - perf); */\n /* let perf = performance.now();\n let contains = bubble.classList.contains('document-container');\n console.log('getCheckboxInputFromBubble classList time:', performance.now() - perf);\n\n perf = performance.now();\n contains = bubble.className.includes('document-container');\n console.log('getCheckboxInputFromBubble className time:', performance.now() - perf); */\n\n return bubble.classList.contains('document-container') ?\n bubble.querySelector('label input') as HTMLInputElement :\n super.getCheckboxInputFromElement(bubble);\n }\n\n public canSelectBubble(bubble: HTMLElement) {\n return !bubble.classList.contains('service') &&\n !bubble.classList.contains('is-outgoing') &&\n !bubble.classList.contains('is-error') &&\n !bubble.classList.contains('bubble-first') &&\n !bubble.classList.contains('avoid-selection');\n }\n\n protected onToggleSelection = async(forwards: boolean, animate: boolean) => {\n const {needTranslateX, widthFrom, widthTo} = await this.chat.input.center(animate);\n\n SetTransition({\n element: this.listenElement,\n className: 'is-selecting',\n forwards,\n duration: animate ? 200 : 0,\n onTransitionEnd: () => {\n if(!this.isSelecting) {\n this.selectionInputWrapper.remove();\n this.selectionInputWrapper =\n this.selectionContainer =\n this.selectionSendNowBtn =\n this.selectionForwardBtn =\n this.selectionDeleteBtn =\n this.selectionLeft =\n this.selectionRight =\n null;\n this.selectedText = undefined;\n }\n\n /* fastRaf(() => {\n this.bubbles.onScroll();\n }); */\n }\n });\n\n // const chatInput = this.appImManager.chatInput;\n\n const translateButtonsX = widthFrom < widthTo ? undefined : needTranslateX * 2;\n if(this.isSelecting) {\n if(!this.selectionContainer) {\n this.selectionInputWrapper = document.createElement('div');\n this.selectionInputWrapper.classList.add('chat-input-wrapper', 'selection-wrapper');\n\n // const background = document.createElement('div');\n // background.classList.add('chat-input-wrapper-background');\n\n this.selectionContainer = document.createElement('div');\n this.selectionContainer.classList.add('selection-container');\n\n const attachClickOptions: AttachClickOptions = {listenerSetter: this.listenerSetter};\n const btnCancel = ButtonIcon('close', {noRipple: true});\n attachClickEvent(btnCancel, () => this.cancelSelection(), {once: true, listenerSetter: this.listenerSetter});\n\n this.selectionCountEl = document.createElement('div');\n this.selectionCountEl.classList.add('selection-container-count');\n\n if(this.chat.type === 'scheduled') {\n this.selectionSendNowBtn = Button('btn-primary btn-transparent btn-short text-bold selection-container-send', {icon: 'send2'});\n this.selectionSendNowBtn.append(i18n('MessageScheduleSend'));\n attachClickEvent(this.selectionSendNowBtn, () => {\n PopupElement.createPopup(PopupSendNow, this.chat.peerId, [...this.selectedMids.get(this.chat.peerId)], () => {\n this.cancelSelection();\n });\n }, attachClickOptions);\n } else {\n this.selectionForwardBtn = Button('btn-primary btn-transparent text-bold selection-container-forward', {icon: 'forward'});\n this.selectionForwardBtn.append(i18n('Forward'));\n attachClickEvent(this.selectionForwardBtn, () => {\n const obj: {[fromPeerId: PeerId]: number[]} = {};\n for(const [fromPeerId, mids] of this.selectedMids) {\n obj[fromPeerId] = Array.from(mids).sort((a, b) => a - b);\n }\n\n PopupElement.createPopup(PopupForward, obj, () => {\n this.cancelSelection();\n });\n }, attachClickOptions);\n }\n\n this.selectionDeleteBtn = Button('btn-primary btn-transparent danger text-bold selection-container-delete', {icon: 'delete'});\n this.selectionDeleteBtn.append(i18n('Delete'));\n attachClickEvent(this.selectionDeleteBtn, () => {\n PopupElement.createPopup(PopupDeleteMessages, this.chat.peerId, [...this.selectedMids.get(this.chat.peerId)], this.chat.type, () => {\n this.cancelSelection();\n });\n }, attachClickOptions);\n\n const left = this.selectionLeft = document.createElement('div');\n left.classList.add('selection-container-left');\n left.append(btnCancel, this.selectionCountEl);\n\n const right = this.selectionRight = document.createElement('div');\n right.classList.add('selection-container-right');\n right.append(...[\n this.selectionSendNowBtn,\n this.selectionForwardBtn,\n this.selectionDeleteBtn\n ].filter(Boolean))\n\n if(translateButtonsX !== undefined) {\n left.style.transform = `translateX(${-translateButtonsX}px)`;\n right.style.transform = `translateX(${translateButtonsX}px)`;\n }\n\n this.selectionContainer.append(left, right);\n\n // background.style.opacity = '0';\n this.selectionInputWrapper.style.opacity = '0';\n this.selectionInputWrapper.append(/* background, */this.selectionContainer);\n this.input.inputContainer.append(this.selectionInputWrapper);\n\n void this.selectionInputWrapper.offsetLeft; // reflow\n // background.style.opacity = '';\n this.selectionInputWrapper.style.opacity = '';\n }\n\n this.selectionLeft.style.transform = '';\n this.selectionRight.style.transform = '';\n } else if(this.selectionLeft && translateButtonsX !== undefined) {\n this.selectionLeft.style.transform = `translateX(-${translateButtonsX}px)`;\n this.selectionRight.style.transform = `translateX(${translateButtonsX}px)`;\n }\n };\n\n protected onUpdateContainer = (cantForward: boolean, cantDelete: boolean, cantSend: boolean) => {\n replaceContent(this.selectionCountEl, i18n('messages', [this.length()]));\n this.selectionSendNowBtn && this.selectionSendNowBtn.toggleAttribute('disabled', cantSend);\n this.selectionForwardBtn && this.selectionForwardBtn.toggleAttribute('disabled', cantForward);\n this.selectionDeleteBtn && this.selectionDeleteBtn.toggleAttribute('disabled', cantDelete);\n };\n\n protected onCancelSelection = async() => {\n return;\n const promises: Promise[] = [];\n for(const [peerId, mids] of this.selectedMids) {\n for(const mid of mids) {\n promises.push(this.bubbles.getMountedBubble(mid).then((m) => m?.bubble));\n }\n }\n\n const bubbles = filterUnique((await Promise.all(promises)).filter(Boolean));\n bubbles.forEach((bubble) => {\n this.toggleByElement(bubble);\n });\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function getSelectedText(): string {\n if(window.getSelection) {\n return window.getSelection().toString();\n // @ts-ignore\n } else if(document.selection) {\n // @ts-ignore\n return document.selection.createRange().text;\n }\n\n return '';\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport contextMenuController from '../../helpers/contextMenuController';\nimport {attachContextMenuListener} from '../../helpers/dom/attachContextMenuListener';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport rootScope from '../../lib/rootScope';\nimport {ButtonMenuItemOptions, ButtonMenuSync} from '../buttonMenu';\n\nexport default class SendMenu {\n public sendMenu: HTMLElement;\n private sendMenuButtons: (ButtonMenuItemOptions & {verify: () => boolean})[];\n private type: 'schedule' | 'reminder';\n\n constructor(options: {\n onSilentClick: () => void,\n onScheduleClick: () => void,\n listenerSetter?: ListenerSetter,\n openSide: string,\n onContextElement: HTMLElement,\n onOpen?: () => boolean\n }) {\n this.sendMenuButtons = [{\n icon: 'mute',\n text: 'Chat.Send.WithoutSound',\n onClick: options.onSilentClick,\n verify: () => this.type === 'schedule'\n }, {\n icon: 'schedule',\n text: 'Chat.Send.ScheduledMessage',\n onClick: options.onScheduleClick,\n verify: () => this.type === 'schedule'\n }, {\n icon: 'schedule',\n text: 'Chat.Send.SetReminder',\n onClick: options.onScheduleClick,\n verify: () => this.type === 'reminder'\n }];\n\n this.sendMenu = ButtonMenuSync({buttons: this.sendMenuButtons, listenerSetter: options.listenerSetter});\n this.sendMenu.classList.add('menu-send', options.openSide);\n\n attachContextMenuListener({\n element: options.onContextElement,\n callback: (e) => {\n if(options.onOpen && !options.onOpen()) {\n return;\n }\n\n this.sendMenuButtons.forEach((button) => {\n button.element.classList.toggle('hide', !button.verify());\n });\n\n cancelEvent(e);\n contextMenuController.openBtnMenu(this.sendMenu);\n },\n listenerSetter: options.listenerSetter\n });\n }\n\n public setPeerId(peerId: PeerId) {\n this.type = peerId === rootScope.myId ? 'reminder' : 'schedule';\n }\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ListenerSetter from '../helpers/listenerSetter';\nimport ripple from './ripple';\nimport {LangPackKey, _i18n} from '../lib/langPack';\nimport getDeepProperty from '../helpers/object/getDeepProperty';\nimport rootScope from '../lib/rootScope';\nimport apiManagerProxy from '../lib/mtproto/mtprotoworker';\nimport simulateEvent from '../helpers/dom/dispatchEvent';\n\nexport type CheckboxFieldOptions = {\n text?: LangPackKey,\n textArgs?: any[],\n name?: string,\n round?: boolean,\n toggle?: boolean,\n stateKey?: string,\n stateValues?: any[],\n stateValueReverse?: boolean,\n disabled?: boolean,\n checked?: boolean,\n restriction?: boolean,\n withRipple?: boolean,\n withHover?: boolean,\n listenerSetter?: ListenerSetter,\n asRadio?: boolean\n};\nexport default class CheckboxField {\n public input: HTMLInputElement;\n public label: HTMLLabelElement;\n public span: HTMLSpanElement;\n public listenerSetter: ListenerSetter;\n\n constructor(options: CheckboxFieldOptions = {}) {\n const label = this.label = document.createElement('label');\n label.classList.add('checkbox-field');\n\n if(options.restriction && !options.toggle) {\n label.classList.add('checkbox-field-restriction');\n }\n\n if(options.round) {\n label.classList.add('checkbox-field-round');\n }\n\n if(options.disabled) {\n this.toggleDisability(true);\n }\n\n this.listenerSetter = options.listenerSetter;\n\n const input = this.input = document.createElement('input');\n input.classList.add('checkbox-field-input');\n input.type = options.asRadio ? 'radio' : 'checkbox';\n if(options.name) {\n input[options.asRadio ? 'name' : 'id'] = 'input-' + options.name;\n }\n\n if(options.checked) {\n input.checked = true;\n }\n\n if(options.stateKey) {\n let loaded = false;\n const onChange = () => {\n if(!loaded) {\n return;\n }\n\n let value: any;\n if(options.stateValues) {\n value = options.stateValues[input.checked ? 1 : 0];\n } else {\n value = input.checked;\n\n if(options.stateValueReverse) {\n value = !value;\n }\n }\n\n rootScope.managers.appStateManager.setByKey(options.stateKey, value);\n };\n\n options.checked === undefined && apiManagerProxy.getState().then((state) => {\n loaded = true;\n const stateValue = getDeepProperty(state, options.stateKey);\n let checked: boolean;\n if(options.stateValues) {\n checked = options.stateValues.indexOf(stateValue) === 1;\n } else {\n checked = stateValue;\n\n if(options.stateValueReverse) {\n checked = !checked;\n }\n }\n\n this.setValueSilently(checked);\n });\n\n if(options.listenerSetter) options.listenerSetter.add(input)('change', onChange);\n else input.addEventListener('change', onChange);\n }\n\n let span: HTMLSpanElement;\n if(options.text) {\n span = this.span = document.createElement('span');\n span.classList.add('checkbox-caption');\n _i18n(span, options.text, options.textArgs);\n } else {\n label.classList.add('checkbox-without-caption');\n }\n\n label.append(input);\n\n if(options.toggle) {\n label.classList.add('checkbox-field-toggle');\n\n if(options.restriction) {\n label.classList.add('checkbox-field-toggle-restriction');\n }\n\n const toggle = document.createElement('div');\n toggle.classList.add('checkbox-toggle');\n label.append(toggle);\n } else {\n const box = document.createElement('div');\n box.classList.add('checkbox-box');\n\n const checkSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n checkSvg.classList.add('checkbox-box-check');\n checkSvg.setAttributeNS(null, 'viewBox', '0 0 24 24');\n const use = document.createElementNS('http://www.w3.org/2000/svg', 'use');\n use.setAttributeNS(null, 'href', '#check');\n use.setAttributeNS(null, 'x', '-1');\n checkSvg.append(use);\n\n const bg = document.createElement('div');\n bg.classList.add('checkbox-box-background');\n\n const border = document.createElement('div');\n border.classList.add('checkbox-box-border');\n\n box.append(border, bg, checkSvg);\n\n label.append(box);\n }\n\n if(span) {\n label.append(span);\n }\n\n if(options.withRipple) {\n label.classList.add('checkbox-ripple', 'hover-effect');\n ripple(label, undefined, undefined, true);\n // label.prepend(input);\n } else if(options.withHover) {\n label.classList.add('hover-effect');\n }\n }\n\n get checked() {\n return this.input.checked;\n }\n\n set checked(checked: boolean) {\n /* if(this.checked === checked) {\n return;\n } */\n\n this.setValueSilently(checked);\n simulateEvent(this.input, 'change');\n }\n\n public setValueSilently(checked: boolean) {\n this.input.checked = checked;\n }\n\n public isDisabled() {\n return this.label.classList.contains('checkbox-disabled');\n }\n\n public toggleDisability(disable: boolean) {\n this.label.classList.toggle('checkbox-disabled', disable);\n this.input.disabled = disable;\n return () => this.toggleDisability(!disable);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport findUpAsChild from '../helpers/dom/findUpAsChild';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport safeAssign from '../helpers/object/safeAssign';\nimport I18n, {LangPackKey} from '../lib/langPack';\nimport CheckboxField from './checkboxField';\nimport Row from './row';\nimport {toast} from './toast';\n\nexport type CheckboxFieldsField = {\n text: LangPackKey,\n description?: LangPackKey,\n restrictionText?: LangPackKey,\n checkboxField?: CheckboxField,\n checked?: boolean,\n nested?: CheckboxFieldsField[],\n nestedTo?: CheckboxFieldsField,\n nestedCounter?: HTMLElement,\n setNestedCounter?: (count: number) => void,\n toggleWith?: {checked?: CheckboxFieldsField[], unchecked?: CheckboxFieldsField[]},\n name?: string,\n row?: Row\n};\n\nexport default class CheckboxFields {\n public fields: Array;\n protected listenerSetter: ListenerSetter;\n protected asRestrictions: boolean;\n\n constructor(options: {\n fields: Array,\n listenerSetter: ListenerSetter,\n asRestrictions?: boolean\n }) {\n safeAssign(this, options);\n }\n\n public createField(info: CheckboxFieldsField, isNested?: boolean) {\n if(info.nestedTo && !isNested) {\n return;\n }\n\n const row = info.row = new Row({\n titleLangKey: isNested ? undefined : info.text,\n checkboxField: info.checkboxField = new CheckboxField({\n text: isNested ? info.text : undefined,\n checked: info.nested ? false : info.checked,\n toggle: !isNested,\n listenerSetter: this.listenerSetter,\n restriction: this.asRestrictions && !isNested,\n name: info.name\n }),\n listenerSetter: this.listenerSetter,\n subtitleLangKey: info.description,\n clickable: info.nested ? (e) => {\n if(findUpAsChild(e.target as HTMLElement, row.checkboxField.label)) {\n return;\n }\n\n cancelEvent(e);\n row.container.classList.toggle('accordion-toggler-expanded');\n accordion.classList.toggle('is-expanded');\n } : undefined\n });\n\n if(info.restrictionText) {\n info.checkboxField.input.disabled = true;\n\n attachClickEvent(info.checkboxField.label, (e) => {\n toast(I18n.format(info.restrictionText, true));\n }, {listenerSetter: this.listenerSetter});\n }\n\n const nodes: HTMLElement[] = [row.container];\n let accordion: HTMLElement, nestedCounter: HTMLElement;\n if(info.nested) {\n const container = accordion = document.createElement('div');\n container.classList.add('accordion');\n container.style.setProperty('--max-height', info.nested.length * 48 + 'px');\n const _info = info;\n info.nested.forEach((info) => {\n info.nestedTo ??= _info;\n container.append(...this.createField(info, true).nodes);\n });\n nodes.push(container);\n\n const span = document.createElement('span');\n span.classList.add('tgico-down', 'accordion-icon');\n\n nestedCounter = info.nestedCounter = document.createElement('b');\n this.setNestedCounter(info);\n row.title.append(' ', nestedCounter, ' ', span);\n\n row.container.classList.add('accordion-toggler');\n row.titleRow.classList.add('with-delimiter');\n\n row.checkboxField.setValueSilently(this.getNestedCheckedLength(info) === info.nested.length);\n\n info.toggleWith ??= {checked: info.nested, unchecked: info.nested};\n }\n\n if(info.toggleWith || info.nestedTo) {\n const processToggleWith = info.toggleWith ? (info: CheckboxFieldsField) => {\n const {toggleWith, nested} = info;\n const value = info.checkboxField.checked;\n const arr = value ? toggleWith.checked : toggleWith.unchecked;\n if(!arr) {\n return;\n }\n\n const other = this.fields.filter((i) => arr.includes(i));\n other.forEach((info) => {\n info.checkboxField.setValueSilently(value);\n if(info.nestedTo && !nested) {\n this.setNestedCounter(info.nestedTo);\n }\n\n if(info.toggleWith) {\n processToggleWith(info);\n }\n });\n\n if(info.nested) {\n this.setNestedCounter(info);\n }\n } : undefined;\n\n const processNestedTo = info.nestedTo ? () => {\n const length = this.getNestedCheckedLength(info.nestedTo);\n info.nestedTo.checkboxField.setValueSilently(length === info.nestedTo.nested.length);\n this.setNestedCounter(info.nestedTo, length);\n } : undefined;\n\n this.listenerSetter.add(info.checkboxField.input)('change', () => {\n processToggleWith?.(info);\n processNestedTo?.();\n });\n }\n\n return {row, nodes};\n }\n\n protected getNestedCheckedLength(info: CheckboxFieldsField) {\n return info.nested.reduce((acc, v) => acc + +v.checkboxField.checked, 0);\n }\n\n public setNestedCounter(info: CheckboxFieldsField, count = this.getNestedCheckedLength(info)) {\n info.nestedCounter.textContent = `${count}/${info.nested.length}`;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport InputField, {InputFieldOptions} from './inputField';\n\nexport default class CodeInputField extends InputField {\n constructor(public options: InputFieldOptions & {\n length: number,\n onFill: (code: string) => void\n }) {\n super(Object.assign(options, {\n plainText: true\n }));\n\n const input = this.input as HTMLInputElement;\n input.type = 'tel';\n input.setAttribute('required', '');\n input.autocomplete = 'off';\n\n let lastLength = 0;\n this.input.addEventListener('input', (e) => {\n this.input.classList.remove('error');\n this.setLabel();\n\n const value = this.value.replace(/\\D/g, '').slice(0, options.length);\n this.setValueSilently(value);\n\n const length = this.value.length;\n if(length === options.length) { // submit code\n options.onFill(this.value);\n } else if(length === lastLength) {\n return;\n }\n\n lastLength = length;\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement, {addCancelButton} from './popups';\nimport PopupPeer, {PopupPeerCheckboxOptions, PopupPeerOptions} from './popups/peer';\n\n// type PopupConfirmationOptions = Pick;\nexport type PopupConfirmationOptions = PopupPeerOptions & {\n button: PopupPeerOptions['buttons'][0],\n checkbox?: PopupPeerOptions['checkboxes'][0]\n};\n\nexport default function confirmationPopup(\n options: T\n): Promise : (T['checkbox'] extends PopupPeerCheckboxOptions ? boolean : void)> {\n return new Promise((resolve, reject) => {\n const {button, checkbox} = options;\n button.callback = (set) => {\n if(checkbox || !set) {\n resolve(set ? !!set.size : undefined);\n } else {\n resolve(options.checkboxes.map((checkbox) => set.has(checkbox.text)));\n }\n };\n\n const buttons = addCancelButton(options.buttons || [button]);\n const cancelButton = buttons.find((button) => button.isCancel);\n cancelButton.callback = () => {\n reject();\n };\n\n options.buttons = buttons;\n options.checkboxes ??= checkbox && [checkbox];\n\n PopupElement.createPopup(PopupPeer, 'popup-confirmation', options).show();\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_EMOJI_SUPPORTED from '../environment/emojiSupport';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport findUpTag from '../helpers/dom/findUpTag';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport setInnerHTML from '../helpers/dom/setInnerHTML';\nimport fastSmoothScroll from '../helpers/fastSmoothScroll';\nimport {randomLong} from '../helpers/random';\nimport {HelpCountry, HelpCountryCode} from '../layer';\nimport I18n, {i18n} from '../lib/langPack';\nimport wrapEmojiText from '../lib/richTextProcessor/wrapEmojiText';\nimport rootScope from '../lib/rootScope';\nimport {getCountryEmoji} from '../vendor/emoji';\nimport InputField, {InputFieldOptions} from './inputField';\nimport Scrollable from './scrollable';\n\nlet countries: HelpCountry.helpCountry[];\nconst setCountries = () => {\n countries = I18n.countriesList\n .filter((country) => !country.pFlags?.hidden)\n .sort((a, b) => (a.name || a.default_name).localeCompare(b.name || b.default_name));\n};\n\nlet init = () => {\n setCountries();\n rootScope.addEventListener('language_change', () => {\n setCountries();\n });\n};\n\nconst VIRTUAL_COUNTRIES = new Set(['FT']);\n\nexport default class CountryInputField extends InputField {\n private lastCountrySelected: HelpCountry;\n private lastCountryCodeSelected: HelpCountryCode;\n\n private hideTimeout: number;\n private selectWrapper: HTMLElement;\n\n private liMap: Map;\n\n constructor(public options: InputFieldOptions & {\n onCountryChange?: (country: HelpCountry.helpCountry, code: HelpCountryCode.helpCountryCode) => void,\n noPhoneCodes?: boolean\n } = {}) {\n super({\n label: 'Country',\n name: randomLong(),\n ...options\n });\n\n if(init) {\n init();\n init = undefined;\n }\n\n this.liMap = new Map();\n\n this.container.classList.add('input-select');\n\n const selectWrapper = this.selectWrapper = document.createElement('div');\n selectWrapper.classList.add('select-wrapper', 'z-depth-3', 'hide');\n\n const arrowDown = document.createElement('span');\n arrowDown.classList.add('arrow', 'arrow-down');\n this.container.append(arrowDown);\n\n const selectList = document.createElement('ul');\n selectWrapper.appendChild(selectList);\n\n const scroll = new Scrollable(selectWrapper);\n\n let initSelect = () => {\n initSelect = null;\n\n countries.forEach((c) => {\n if(options.noPhoneCodes && VIRTUAL_COUNTRIES.has(c.iso2)) {\n return;\n }\n\n const emoji = getCountryEmoji(c.iso2);\n\n const liArr: Array = [];\n for(let i = 0, length = Math.min(c.country_codes.length, options.noPhoneCodes ? 1 : Infinity); i < length; ++i) {\n const countryCode = c.country_codes[i];\n const li = document.createElement('li');\n\n const wrapped = wrapEmojiText(emoji);\n if(IS_EMOJI_SUPPORTED) {\n const spanEmoji = document.createElement('span');\n setInnerHTML(spanEmoji, wrapped);\n li.append(spanEmoji);\n } else {\n setInnerHTML(li, wrapped);\n }\n\n const el = i18n(c.default_name as any);\n el.dataset.defaultName = c.default_name;\n li.append(el);\n\n if(!options.noPhoneCodes) {\n const span = document.createElement('span');\n span.classList.add('phone-code');\n span.innerText = '+' + countryCode.country_code;\n li.appendChild(span);\n }\n\n liArr.push(li);\n selectList.append(li);\n }\n\n this.liMap.set(c.iso2, liArr);\n });\n\n selectList.addEventListener('mousedown', (e) => {\n if(e.button !== 0) { // other buttons but left shall not pass\n return;\n }\n\n const target = findUpTag(e.target, 'LI')\n this.selectCountryByTarget(target);\n // console.log('clicked', e, countryName, phoneCode);\n });\n\n this.container.appendChild(selectWrapper);\n };\n\n initSelect();\n\n this.input.addEventListener('focus', (e) => {\n if(initSelect) {\n initSelect();\n } else {\n countries.forEach((c) => {\n const arr = this.liMap.get(c.iso2);\n if(!arr) return;\n arr.forEach((li) => li.style.display = '');\n });\n }\n\n clearTimeout(this.hideTimeout);\n this.hideTimeout = undefined;\n\n selectWrapper.classList.remove('hide');\n void selectWrapper.offsetWidth; // reflow\n selectWrapper.classList.add('active');\n\n this.select();\n\n fastSmoothScroll({\n // container: page.pageEl.parentElement.parentElement,\n container: findUpClassName(this.container, 'scrollable-y'),\n element: this.input,\n position: 'start',\n margin: 4\n });\n\n setTimeout(() => {\n if(!mouseDownHandlerAttached) {\n document.addEventListener('mousedown', onMouseDown, {capture: true});\n mouseDownHandlerAttached = true;\n }\n }, 0);\n });\n\n let mouseDownHandlerAttached = false;\n const onMouseDown = (e: MouseEvent) => {\n if(findUpClassName(e.target, 'input-select')) {\n return;\n }\n if(e.target === this.input) {\n return;\n }\n\n this.hidePicker();\n document.removeEventListener('mousedown', onMouseDown, {capture: true});\n mouseDownHandlerAttached = false;\n };\n\n /* false && this.input.addEventListener('blur', function(this: typeof this.input, e) {\n hidePicker();\n\n e.cancelBubble = true;\n }, {capture: true}); */\n\n const onKeyPress = (e: KeyboardEvent) => {\n const key = e.key;\n if(e.ctrlKey || key === 'Control') return false;\n\n // let i = new RegExp('^' + this.value, 'i');\n const _value = this.value.toLowerCase();\n const matches: HelpCountry[] = [];\n countries.forEach((c) => {\n const arr = this.liMap.get(c.iso2);\n if(!arr) {\n return;\n }\n\n const names = [\n c.name,\n c.default_name,\n c.iso2\n ];\n\n names.filter(Boolean).forEach((name) => {\n const abbr = name.split(' ').filter((word) => /\\w/.test(word)).map((word) => word[0]).join('');\n if(abbr.length > 1) {\n names.push(abbr);\n }\n });\n\n const good = !!names.filter(Boolean).find((str) => str.toLowerCase().indexOf(_value) !== -1)/* === 0 */;// i.test(c.name);\n\n arr.forEach((li) => li.style.display = good ? '' : 'none');\n if(good) matches.push(c);\n });\n\n // Код ниже автоматически выберет страну если она осталась одна при поиске\n /* if(matches.length === 1 && matches[0].li.length === 1) {\n if(matches[0].name === lastCountrySelected) return false;\n //console.log('clicking', matches[0]);\n\n var clickEvent = document.createEvent('MouseEvents');\n clickEvent.initEvent('mousedown', true, true);\n matches[0].li[0].dispatchEvent(clickEvent);\n return false;\n } else */if(matches.length === 0) {\n countries.forEach((c) => {\n const arr = this.liMap.get(c.iso2);\n if(!arr) {\n return;\n }\n\n arr.forEach((li) => li.style.display = '');\n });\n } else if(matches.length === 1 && key === 'Enter') {\n cancelEvent(e);\n this.selectCountryByTarget(this.liMap.get(matches[0].iso2)[0]);\n }\n };\n\n this.input.addEventListener('keyup', onKeyPress);\n this.input.addEventListener('keydown', (e) => {\n if(e.key === 'Enter') {\n onKeyPress(e);\n }\n });\n\n arrowDown.addEventListener('mousedown', (e) => {\n if(this.input.matches(':focus')) {\n this.hidePicker();\n this.input.blur();\n } else {\n e.cancelBubble = true;\n e.preventDefault();\n this.input.focus();\n }\n });\n }\n\n public getSelected() {\n return {country: this.lastCountrySelected, code: this.lastCountryCodeSelected};\n }\n\n public hidePicker = () => {\n if(this.hideTimeout !== undefined) return;\n this.selectWrapper.classList.remove('active');\n this.hideTimeout = window.setTimeout(() => {\n this.selectWrapper.classList.add('hide');\n this.hideTimeout = undefined;\n }, 200);\n }\n\n public selectCountryByTarget = (target: HTMLElement) => {\n const defaultName = target.querySelector('[data-default-name]').dataset.defaultName;\n const phoneCodeEl = target.querySelector('.phone-code');\n const phoneCode = phoneCodeEl?.innerText;\n const countryCode = phoneCode && phoneCode.replace(/\\D/g, '');\n\n replaceContent(this.input, i18n(defaultName as any));\n this.simulateInputEvent();\n this.lastCountrySelected = countries.find((c) => c.default_name === defaultName);\n this.lastCountryCodeSelected = countryCode && this.lastCountrySelected.country_codes.find((_countryCode) => _countryCode.country_code === countryCode);\n\n this.options.onCountryChange?.(this.lastCountrySelected, this.lastCountryCodeSelected);\n this.hidePicker();\n }\n\n public selectCountryByIso2(iso2: string) {\n this.selectCountryByTarget(this.liMap.get(iso2)[0]);\n }\n\n public override(country: HelpCountry, code: HelpCountryCode, countryName?: string) {\n replaceContent(this.input, country ? i18n(country.default_name as any) : countryName);\n this.lastCountrySelected = country;\n this.lastCountryCodeSelected = code;\n this.options.onCountryChange?.(this.lastCountrySelected, this.lastCountryCodeSelected);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {setDirection} from '../helpers/dom/setInnerHTML';\n\nexport default class DivAndCaption {\n public container: HTMLElement;\n public border: HTMLElement;\n public content: HTMLElement;\n public title: HTMLElement;\n public subtitle: HTMLElement;\n\n constructor(protected className: string, public fill?: T) {\n this.container = document.createElement('div');\n this.container.className = className;\n\n this.border = document.createElement('div');\n this.border.classList.add(className + '-border');\n\n this.content = document.createElement('div');\n this.content.classList.add(className + '-content');\n\n this.title = document.createElement('div');\n this.title.classList.add(className + '-title');\n setDirection(this.title);\n\n this.subtitle = document.createElement('div');\n this.subtitle.classList.add(className + '-subtitle');\n setDirection(this.subtitle);\n\n this.content.append(this.title, this.subtitle);\n this.container.append(this.border, this.content);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {IS_MOBILE} from '../environment/userAgent';\nimport {animate} from '../helpers/animation';\nimport liteMode from '../helpers/liteMode';\nimport {Middleware} from '../helpers/middleware';\nimport clamp from '../helpers/number/clamp';\nimport animationIntersector, {AnimationItemGroup, AnimationItemWrapper} from './animationIntersector';\n\ntype DotRendererDot = {\n x: number,\n y: number,\n opacity: number,\n radius: number\n mOpacity: number,\n adding: boolean,\n counter: number,\n path: Path2D\n};\nexport default class DotRenderer implements AnimationItemWrapper {\n public canvas: HTMLCanvasElement;\n private context: CanvasRenderingContext2D;\n private dots: DotRendererDot[];\n\n public paused: boolean;\n public autoplay: boolean;\n public tempId: number;\n\n private dpr: number;\n\n public loop: boolean = true;\n\n constructor(\n private width: number,\n private height: number,\n private multiply?: number\n ) {\n const canvas = this.canvas = document.createElement('canvas');\n const dpr = this.dpr = window.devicePixelRatio;\n canvas.width = width * dpr;\n canvas.height = height * dpr;\n canvas.classList.add('canvas-thumbnail', 'canvas-dots');\n\n this.paused = true;\n this.autoplay = true;\n this.tempId = 0;\n this.context = canvas.getContext('2d');\n }\n\n private prepare() {\n let count = Math.round(this.width * this.height / (35 * (IS_MOBILE ? 2 : 1)));\n count *= this.multiply || 1;\n count = Math.min(!liteMode.isAvailable('chat_spoilers') ? 400 : IS_MOBILE ? 1000 : 2200, count);\n count = Math.round(count);\n const dots: DotRendererDot[] = this.dots = new Array(count);\n\n for(let i = 0; i < count; ++i) {\n dots[i] = this.generateDot();\n }\n }\n\n private generateDot(adding?: boolean): DotRendererDot {\n const x = Math.floor(Math.random() * this.canvas.width);\n const y = Math.floor(Math.random() * this.canvas.height);\n const opacity = adding ? 0 : Math.random();\n const radius = (Math.random() >= .8 ? 1 : 0.5) * this.dpr;\n const path = new Path2D();\n path.arc(x, y, radius, 0, 2 * Math.PI, false);\n return {\n x,\n y,\n opacity,\n radius,\n mOpacity: opacity,\n adding: adding ?? Math.random() >= .5,\n counter: 0,\n path\n };\n }\n\n private draw() {\n const {context, canvas, dots} = this;\n context.clearRect(0, 0, canvas.width, canvas.height);\n context.fillStyle = '#fff';\n\n const add = 0.02;\n for(let i = 0, length = dots.length; i < length; ++i) {\n const dot = dots[i];\n const addOpacity = dot.adding ? add : -add;\n\n dot.mOpacity += addOpacity;\n // if(dot.mOpacity <= 0) dot.mOpacity = dot.opacity;\n\n // const easedOpacity = easing(dot.mOpacity);\n const easedOpacity = clamp(dot.mOpacity, 0, 1);\n context.globalAlpha = easedOpacity;\n context.fill(dot.path);\n\n if(dot.mOpacity <= 0) {\n dot.adding = true;\n\n if(++dot.counter >= 1) {\n dots[i] = this.generateDot(dot.adding);\n }\n } else if(dot.mOpacity >= 1) {\n dot.adding = false;\n }\n }\n }\n\n public remove() {\n this.pause();\n }\n\n public pause() {\n if(this.paused) {\n return;\n }\n\n this.paused = true;\n ++this.tempId;\n }\n\n public renderFirstFrame() {\n if(!this.dots) {\n this.prepare();\n }\n\n this.draw();\n }\n\n public play() {\n if(!this.paused) {\n return;\n }\n\n this.paused = false;\n const tempId = ++this.tempId;\n\n if(!this.dots) {\n this.prepare();\n }\n\n animate(() => {\n if(this.tempId !== tempId || this.paused) {\n return false;\n }\n\n this.draw();\n return true;\n });\n }\n\n public static create({\n width,\n height,\n middleware,\n animationGroup,\n multiply\n }: {\n width: number,\n height: number,\n middleware: Middleware,\n animationGroup: AnimationItemGroup,\n multiply?: number\n }) {\n const dotRenderer = new DotRenderer(width, height, multiply);\n dotRenderer.renderFirstFrame();\n\n animationIntersector.addAnimation({\n animation: dotRenderer,\n group: animationGroup,\n observeElement: dotRenderer.canvas,\n controlled: middleware\n });\n\n return dotRenderer;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {InputFile} from '../layer';\nimport AvatarEdit from './avatarEdit';\nimport AvatarElement from './avatar';\nimport InputField from './inputField';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport ButtonCorner from './buttonCorner';\nimport safeAssign from '../helpers/object/safeAssign';\nimport {NULL_PEER_ID} from '../lib/mtproto/mtproto_config';\n\nexport default class EditPeer {\n public nextBtn: HTMLButtonElement;\n\n public uploadAvatar: () => Promise;\n public avatarEdit: AvatarEdit;\n public avatarElem: AvatarElement;\n\n private inputFields: InputField[];\n private listenerSetter: ListenerSetter;\n\n private peerId: PeerId;\n\n private _disabled = false;\n private avatarSize = 120;\n\n constructor(options: {\n peerId?: EditPeer['peerId'],\n inputFields: EditPeer['inputFields'],\n listenerSetter: ListenerSetter,\n doNotEditAvatar?: boolean,\n withoutAvatar?: boolean,\n nextBtn?: HTMLButtonElement,\n avatarSize?: number,\n popupOptions?: ConstructorParameters[1]\n }) {\n safeAssign(this, options);\n\n this.peerId ||= NULL_PEER_ID;\n\n if(!this.nextBtn) {\n this.nextBtn = ButtonCorner({icon: 'check'});\n } else if(!this.nextBtn.classList.contains('btn-corner')) {\n this.handleChange = () => {\n this.nextBtn.toggleAttribute('disabled', !this.isChanged() || this.disabled);\n };\n }\n\n if(!options.withoutAvatar) {\n this.avatarElem = new AvatarElement();\n this.avatarElem.classList.add('avatar-placeholder', 'avatar-' + this.avatarSize);\n this.avatarElem.updateWithOptions({peerId: this.peerId});\n\n if(!options.doNotEditAvatar) {\n this.avatarEdit = new AvatarEdit((_upload) => {\n this.uploadAvatar = _upload;\n this.handleChange();\n this.avatarElem.remove();\n }, options.popupOptions);\n\n this.avatarEdit.container.append(this.avatarElem);\n }\n }\n\n this.inputFields.forEach((inputField) => {\n this.listenerSetter.add(inputField.input)('input', this.handleChange);\n });\n\n this.handleChange();\n }\n\n public get disabled() {\n return this._disabled;\n }\n\n public set disabled(value) {\n this._disabled = value;\n this.inputFields.forEach((inputField) => inputField.input.toggleAttribute('disabled', value));\n this.handleChange();\n }\n\n public lockWithPromise(promise: Promise, unlockOnSuccess = false) {\n this.disabled = true;\n promise.then(() => {\n if(unlockOnSuccess) {\n this.disabled = false;\n }\n }, () => {\n this.disabled = false;\n });\n }\n\n public isChanged = () => {\n if(this.uploadAvatar) {\n return true;\n }\n\n let changedLength = 0, requiredLength = 0, requiredValidLength = 0;\n this.inputFields.forEach((inputField) => {\n if(inputField.isValid()) {\n if(inputField.isChanged()) {\n ++changedLength;\n }\n\n if(inputField.required) {\n ++requiredValidLength;\n }\n }\n\n if(inputField.required) {\n ++requiredLength;\n }\n });\n\n return requiredLength === requiredValidLength && changedLength > 0;\n };\n\n public handleChange = () => {\n this.nextBtn.classList.toggle('is-visible', this.isChanged());\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport emoticonsDropdown, {EmoticonsDropdown, EmoticonsTab, EMOTICONSSTICKERGROUP} from '..';\nimport GifsMasonry from '../../gifsMasonry';\nimport Scrollable from '../../scrollable';\nimport {putPreloader} from '../../putPreloader';\nimport {AppManagers} from '../../../lib/appManagers/managers';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\n\nexport default class GifsTab implements EmoticonsTab {\n public content: HTMLElement;\n public scrollable: Scrollable;\n public tabId: number;\n\n constructor(private managers: AppManagers) {\n\n }\n\n init() {\n this.content = document.getElementById('content-gifs');\n const gifsContainer = this.content.firstElementChild as HTMLDivElement;\n attachClickEvent(gifsContainer, EmoticonsDropdown.onMediaClick);\n\n const scroll = this.scrollable = new Scrollable(this.content, 'GIFS');\n const masonry = new GifsMasonry(gifsContainer, EMOTICONSSTICKERGROUP, scroll);\n const preloader = putPreloader(this.content, true);\n\n this.managers.appDocsManager.getGifs().then((docs) => {\n docs.forEach((doc) => {\n masonry.add(doc);\n });\n\n preloader.remove();\n });\n\n emoticonsDropdown.addLazyLoadQueueRepeat(masonry.lazyLoadQueue, masonry.processInvisibleDiv);\n\n this.init = null;\n }\n\n onClose() {\n\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../../../lib/appManagers/appDocsManager';\nimport {SliderSuperTab} from '../../slider';\nimport InputSearch from '../../inputSearch';\nimport animationIntersector, {AnimationItemGroup} from '../../animationIntersector';\nimport appSidebarRight from '..';\nimport {AppInlineBotsManager} from '../../../lib/appManagers/appInlineBotsManager';\nimport GifsMasonry from '../../gifsMasonry';\nimport appImManager from '../../../lib/appManagers/appImManager';\nimport mediaSizes from '../../../helpers/mediaSizes';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport {NULL_PEER_ID} from '../../../lib/mtproto/mtproto_config';\n\nconst ANIMATIONGROUP: AnimationItemGroup = 'GIFS-SEARCH';\n\nexport default class AppGifsTab extends SliderSuperTab {\n private inputSearch: InputSearch;\n private gifsDiv: HTMLDivElement;\n\n private nextOffset = '';\n private loadedAll = false;\n\n private gifBotPeerId: PeerId;\n private masonry: GifsMasonry;\n\n private searchPromise: ReturnType;\n\n public init() {\n this.container.id = 'search-gifs-container';\n\n this.inputSearch = new InputSearch('SearchGifsTitle', (value) => {\n this.reset();\n this.search(value);\n });\n\n this.title.replaceWith(this.inputSearch.container);\n\n this.gifsDiv = document.createElement('div');\n this.gifsDiv.classList.add('gifs-masonry');\n attachClickEvent(this.gifsDiv, this.onGifsClick, {listenerSetter: this.listenerSetter});\n\n this.scrollable.append(this.gifsDiv);\n\n this.masonry = new GifsMasonry(this.gifsDiv, ANIMATIONGROUP, this.scrollable);\n // this.backBtn.parentElement.append(this.inputSearch.container);\n\n appSidebarRight.toggleSidebar(true).then(() => {\n this.search('', true);\n\n this.scrollable.onScrolledBottom = () => {\n this.search(this.inputSearch.value, false);\n };\n });\n }\n\n private onGifsClick = async(e: MouseEvent | TouchEvent) => {\n const target = findUpClassName(e.target, 'gif');\n if(!target) return;\n\n const fileId = target.dataset.docId;\n if(await appImManager.chat.input.sendMessageWithDocument(fileId)) {\n if(mediaSizes.isMobile) {\n appSidebarRight.onCloseBtnClick();\n }\n } else {\n console.warn('got no doc by id:', fileId);\n }\n };\n\n public onClose() {\n this.scrollable.onScrolledBottom = () => {};\n }\n\n public onCloseAfterTimeout() {\n this.reset();\n this.gifsDiv.innerHTML = '';\n animationIntersector.checkAnimations(undefined, ANIMATIONGROUP);\n this.inputSearch.remove();\n return super.onCloseAfterTimeout();\n }\n\n private reset() {\n this.searchPromise = null;\n this.nextOffset = '';\n this.loadedAll = false;\n this.masonry.clear();\n }\n\n public async search(query: string, newSearch = true) {\n if(this.searchPromise || this.loadedAll) return;\n\n if(!this.gifBotPeerId) {\n this.gifBotPeerId = (await this.managers.appUsersManager.resolveUsername('gif')).id.toPeerId(false);\n }\n\n try {\n this.searchPromise = this.managers.appInlineBotsManager.getInlineResults(NULL_PEER_ID, this.gifBotPeerId, query, this.nextOffset);\n const {results, next_offset} = await this.searchPromise;\n\n if(this.inputSearch.value !== query) {\n return;\n }\n\n this.searchPromise = null;\n this.nextOffset = next_offset;\n if(newSearch) {\n this.gifsDiv.innerHTML = '';\n }\n\n if(results.length) {\n results.forEach((result) => {\n if(result._ === 'botInlineMediaResult' && result.document) {\n this.masonry.add(result.document as MyDocument);\n }\n });\n } else {\n this.loadedAll = true;\n }\n\n this.scrollable.onScroll();\n } catch(err) {\n this.searchPromise = null;\n console.error('gifs loading error:', err);\n throw err;\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider';\nimport InputSearch from '../../inputSearch';\nimport LazyLoadQueue from '../../lazyLoadQueue';\nimport appImManager from '../../../lib/appManagers/appImManager';\nimport PopupStickers from '../../popups/stickers';\nimport animationIntersector from '../../animationIntersector';\nimport appSidebarRight from '..';\nimport {StickerSet, StickerSetCovered} from '../../../layer';\nimport {i18n} from '../../../lib/langPack';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport forEachReverse from '../../../helpers/array/forEachReverse';\nimport setInnerHTML from '../../../helpers/dom/setInnerHTML';\nimport wrapEmojiText from '../../../lib/richTextProcessor/wrapEmojiText';\nimport attachStickerViewerListeners from '../../stickerViewer';\nimport wrapSticker from '../../wrappers/sticker';\nimport PopupElement from '../../popups';\n\nexport default class AppStickersTab extends SliderSuperTab {\n private inputSearch: InputSearch;\n private setsDiv: HTMLDivElement;\n private lazyLoadQueue: LazyLoadQueue;\n\n public init() {\n this.container.id = 'stickers-container';\n this.container.classList.add('chatlist-container');\n\n this.lazyLoadQueue = new LazyLoadQueue();\n\n this.inputSearch = new InputSearch('StickersTab.SearchPlaceholder', (value) => {\n this.search(value);\n });\n\n this.title.replaceWith(this.inputSearch.container);\n\n this.setsDiv = document.createElement('div');\n this.setsDiv.classList.add('sticker-sets');\n this.scrollable.append(this.setsDiv);\n\n attachStickerViewerListeners({listenTo: this.setsDiv, listenerSetter: this.listenerSetter});\n\n attachClickEvent(this.setsDiv, (e) => {\n const sticker = findUpClassName(e.target, 'sticker-set-sticker');\n if(sticker) {\n const docId = sticker.dataset.docId;\n appImManager.chat.input.sendMessageWithDocument(docId);\n return;\n }\n\n const target = findUpClassName(e.target, 'sticker-set');\n if(!target) return;\n\n const id = target.dataset.stickerSet as string;\n const access_hash = target.dataset.access_hash as string;\n\n const button = findUpClassName(e.target, 'sticker-set-button') as HTMLElement;\n if(button) {\n e.preventDefault();\n e.cancelBubble = true;\n\n button.setAttribute('disabled', 'true');\n\n this.managers.appStickersManager.getStickerSet({id, access_hash}).then((full) => {\n this.managers.appStickersManager.toggleStickerSet(full.set).then((changed) => {\n if(changed) {\n button.textContent = '';\n button.append(i18n(full.set.installed_date ? 'Stickers.SearchAdded' : 'Stickers.SearchAdd'));\n button.classList.toggle('gray', !!full.set.installed_date);\n }\n }).finally(() => {\n // button.style.width = set.installed_date ? '68px' : '52px';\n button.removeAttribute('disabled');\n });\n });\n } else {\n this.managers.appStickersManager.getStickerSet({id, access_hash}).then((full) => {\n PopupElement.createPopup(PopupStickers, full.set).show();\n });\n }\n }, {listenerSetter: this.listenerSetter});\n\n appSidebarRight.toggleSidebar(true).then(() => {\n this.renderFeatured();\n });\n }\n\n public onCloseAfterTimeout() {\n this.setsDiv.innerHTML = '';\n animationIntersector.checkAnimations(undefined, 'STICKERS-SEARCH');\n return super.onCloseAfterTimeout();\n }\n\n public renderSet(set: StickerSet.stickerSet) {\n // console.log('renderSet:', set);\n const div = document.createElement('div');\n div.classList.add('sticker-set');\n\n const header = document.createElement('div');\n header.classList.add('sticker-set-header');\n\n const details = document.createElement('div');\n details.classList.add('sticker-set-details');\n details.innerHTML = `
`;\n\n setInnerHTML(details.firstElementChild, wrapEmojiText(set.title));\n\n const countDiv = document.createElement('div');\n countDiv.classList.add('sticker-set-count');\n countDiv.append(i18n('Stickers', [set.count]));\n details.append(countDiv);\n\n const button = document.createElement('button');\n button.classList.add('btn-primary', 'btn-color-primary', 'sticker-set-button');\n button.append(i18n(set.installed_date ? 'Stickers.SearchAdded' : 'Stickers.SearchAdd'));\n // button.style.width = set.installed_date ? '68px' : '52px';\n\n if(set.installed_date) {\n button.classList.add('gray');\n }\n\n // ripple(button);\n\n header.append(details, button);\n\n const stickersDiv = document.createElement('div');\n stickersDiv.classList.add('sticker-set-stickers');\n\n const count = Math.min(5, set.count);\n for(let i = 0; i < count; ++i) {\n const stickerDiv = document.createElement('div');\n stickerDiv.classList.add('sticker-set-sticker');\n\n stickersDiv.append(stickerDiv);\n }\n\n this.managers.appStickersManager.getStickerSet(set).then((set) => {\n // console.log('renderSet got set:', set);\n\n for(let i = 0; i < count; ++i) {\n const div = stickersDiv.children[i] as HTMLDivElement;\n const doc = set.documents[i];\n if(doc._ === 'documentEmpty') {\n continue;\n }\n\n wrapSticker({\n doc,\n div,\n lazyLoadQueue: this.lazyLoadQueue,\n group: 'STICKERS-SEARCH',\n /* play: false,\n loop: false, */\n play: true,\n loop: true,\n width: 68,\n height: 68,\n withLock: true\n });\n }\n });\n\n /* const onMouseOver = () => {\n const animations: AnimationItem['animation'][] = [];\n for(let i = 0; i < count; ++i) {\n const stickerDiv = stickersDiv.children[i] as HTMLElement;\n const animationItem = animationIntersector.getAnimation(stickerDiv);\n if(!animationItem) continue;\n\n const animation = animationItem.animation;\n\n animations.push(animation);\n animation.loop = true;\n animation.play();\n }\n\n div.addEventListener('mouseout', () => {\n animations.forEach((animation) => {\n animation.loop = false;\n });\n\n div.addEventListener('mouseover', onMouseOver, {once: true});\n }, {once: true});\n };\n\n div.addEventListener('mouseover', onMouseOver, {once: true}); */\n\n div.dataset.stickerSet = '' + set.id;\n div.dataset.access_hash = '' + set.access_hash;\n div.dataset.title = set.title;\n\n div.append(header, stickersDiv);\n\n this.setsDiv.append(div);\n }\n\n public renderFeatured() {\n return this.managers.appStickersManager.getFeaturedStickers().then((coveredSets) => {\n if(this.inputSearch.value) {\n return;\n }\n\n coveredSets = this.filterRendered('', coveredSets);\n coveredSets.forEach((set) => {\n this.renderSet(set.set);\n });\n });\n }\n\n private filterRendered(query: string, coveredSets: StickerSetCovered[]) {\n coveredSets = coveredSets.slice();\n\n const children = Array.from(this.setsDiv.children) as HTMLElement[];\n forEachReverse(children, el => {\n const id = el.dataset.stickerSet;\n const index = coveredSets.findIndex((covered) => covered.set.id === id);\n\n if(index !== -1) {\n coveredSets.splice(index, 1);\n } else if(!query || !el.dataset.title.toLowerCase().includes(query.toLowerCase())) {\n el.remove();\n }\n });\n\n animationIntersector.checkAnimations(undefined, 'STICKERS-SEARCH');\n\n return coveredSets;\n }\n\n public search(query: string) {\n if(!query) {\n return this.renderFeatured();\n }\n\n return this.managers.appStickersManager.searchStickerSets(query, false).then((coveredSets) => {\n if(this.inputSearch.value !== query) {\n return;\n }\n\n // console.log('search result:', coveredSets);\n\n coveredSets = this.filterRendered(query, coveredSets);\n coveredSets.forEach((set) => {\n this.renderSet(set.set);\n });\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport rootScope from '../../lib/rootScope';\nimport animationIntersector, {AnimationItemGroup} from '../animationIntersector';\nimport {horizontalMenu} from '../horizontalMenu';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport Scrollable, {ScrollableX} from '../scrollable';\nimport appSidebarRight from '../sidebarRight';\nimport StickyIntersector from '../stickyIntersector';\nimport EmojiTab from './tabs/emoji';\nimport GifsTab from './tabs/gifs';\nimport StickersTab, {EmoticonsTabC, StickersTabCategory} from './tabs/stickers';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport AppGifsTab from '../sidebarRight/tabs/gifs';\nimport AppStickersTab from '../sidebarRight/tabs/stickers';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport blurActiveElement from '../../helpers/dom/blurActiveElement';\nimport whichChild from '../../helpers/dom/whichChild';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport DropdownHover from '../../helpers/dropdownHover';\nimport pause from '../../helpers/schedulers/pause';\nimport {IS_APPLE_MOBILE} from '../../environment/userAgent';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport type LazyLoadQueueIntersector from '../lazyLoadQueueIntersector';\nimport {attachClickEvent, simulateClickEvent} from '../../helpers/dom/clickEvent';\nimport overlayCounter from '../../helpers/overlayCounter';\nimport noop from '../../helpers/noop';\nimport {FocusDirection, ScrollOptions} from '../../helpers/fastSmoothScroll';\nimport BezierEasing from '../../vendor/bezier-easing';\nimport RichInputHandler from '../../helpers/dom/richInputHandler';\nimport {getCaretPosF} from '../../helpers/dom/getCaretPosNew';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport {ChatRights} from '../../lib/appManagers/appChatsManager';\nimport {toastNew} from '../toast';\nimport {POSTING_NOT_ALLOWED_MAP} from '../chat/input';\n\nexport const EMOTICONSSTICKERGROUP: AnimationItemGroup = 'emoticons-dropdown';\n\nexport interface EmoticonsTab {\n content: HTMLElement;\n scrollable: Scrollable;\n menuScroll?: ScrollableX;\n tabId: number;\n init: () => void;\n onOpen?: () => void;\n onOpened?: () => void;\n onClose?: () => void;\n onClosed?: () => void;\n}\n\nconst easing = BezierEasing(0.42, 0.0, 0.58, 1.0);\nconst scrollOptions: Partial = {\n forceDuration: 200,\n transitionFunction: easing\n};\n\nexport class EmoticonsDropdown extends DropdownHover {\n public static lazyLoadQueue = new LazyLoadQueue(1);\n\n private emojiTab: EmojiTab;\n private stickersTab: StickersTab;\n private gifsTab: GifsTab;\n\n private container: HTMLElement;\n private tabsEl: HTMLElement;\n private tabId = -1;\n\n private tabs: {[id: number]: EmoticonsTab};\n\n private searchButton: HTMLElement;\n private deleteBtn: HTMLElement;\n\n private selectTab: ReturnType;\n\n private savedRange: Range;\n private managers: AppManagers;\n\n private rights: {[action in ChatRights]?: boolean};\n\n constructor() {\n super({\n element: document.getElementById('emoji-dropdown') as HTMLDivElement,\n ignoreOutClickClassName: 'input-message-input'\n });\n\n this.rights = {\n send_gifs: undefined,\n send_stickers: undefined\n };\n\n this.addEventListener('open', async() => {\n if(IS_TOUCH_SUPPORTED) {\n // appImManager.chat.input.saveScroll();\n if(blurActiveElement()) {\n await pause(100);\n }\n }\n\n if(this.element.parentElement !== appImManager.chat.input.chatInput) {\n appImManager.chat.input.chatInput.append(this.element);\n }\n\n this.savedRange = this.getGoodRange();\n\n EmoticonsDropdown.lazyLoadQueue.lock();\n // EmoticonsDropdown.lazyLoadQueue.unlock();\n animationIntersector.lockIntersectionGroup(EMOTICONSSTICKERGROUP);\n\n const tab = this.tab;\n tab.onOpen?.();\n });\n\n this.addEventListener('opened', () => {\n animationIntersector.unlockIntersectionGroup(EMOTICONSSTICKERGROUP);\n EmoticonsDropdown.lazyLoadQueue.unlockAndRefresh();\n\n // this.container.classList.remove('disable-hover');\n\n const tab = this.tab;\n tab.onOpened?.();\n });\n\n this.addEventListener('close', () => {\n EmoticonsDropdown.lazyLoadQueue.lock();\n // EmoticonsDropdown.lazyLoadQueue.lock();\n\n // нужно залочить группу и выключить стикеры\n animationIntersector.lockIntersectionGroup(EMOTICONSSTICKERGROUP);\n animationIntersector.checkAnimations(true, EMOTICONSSTICKERGROUP);\n\n const tab = this.tab;\n tab.onClose?.();\n });\n\n this.addEventListener('closed', () => {\n // теперь можно убрать visible, чтобы они не включились после фокуса\n animationIntersector.unlockIntersectionGroup(EMOTICONSSTICKERGROUP);\n EmoticonsDropdown.lazyLoadQueue.unlock();\n EmoticonsDropdown.lazyLoadQueue.refresh();\n\n // this.container.classList.remove('disable-hover');\n\n this.savedRange = undefined;\n\n const tab = this.tab;\n tab.onClosed?.();\n });\n }\n\n public get tab() {\n return this.tabs[this.tabId];\n }\n\n public init() {\n this.managers = rootScope.managers;\n this.emojiTab = new EmojiTab({managers: this.managers});\n this.stickersTab = new StickersTab(this.managers);\n this.gifsTab = new GifsTab(this.managers);\n\n this.tabs = {};\n [this.emojiTab, this.stickersTab, this.gifsTab].forEach((tab, idx) => {\n tab.tabId = idx;\n this.tabs[idx] = tab;\n });\n\n this.container = this.element.querySelector('.emoji-container .tabs-container') as HTMLDivElement;\n this.container.prepend(this.emojiTab.container, this.stickersTab.container);\n this.tabsEl = this.element.querySelector('.emoji-tabs') as HTMLUListElement;\n this.selectTab = horizontalMenu(this.tabsEl, this.container, this.onSelectTabClick, () => {\n const {tab} = this;\n tab.init?.();\n animationIntersector.checkAnimations(false, EMOTICONSSTICKERGROUP);\n });\n\n this.searchButton = this.element.querySelector('.emoji-tabs-search');\n this.searchButton.addEventListener('click', () => {\n if(this.tabId === this.stickersTab.tabId) {\n if(!appSidebarRight.isTabExists(AppStickersTab)) {\n appSidebarRight.createTab(AppStickersTab).open();\n }\n } else {\n if(!appSidebarRight.isTabExists(AppGifsTab)) {\n appSidebarRight.createTab(AppGifsTab).open();\n }\n }\n });\n\n this.deleteBtn = this.element.querySelector('.emoji-tabs-delete');\n attachClickEvent(this.deleteBtn, (e) => {\n cancelEvent(e);\n const input = appImManager.chat.input.messageInput;\n // RichInputHandler.getInstance().makeFocused(appImManager.chat.input.messageInput);\n let range = RichInputHandler.getInstance().getSavedRange(input);\n if(!range) {\n range = document.createRange();\n range.setStartAfter(input.lastChild);\n }\n\n const newRange = range.cloneRange();\n // if(range.endOffset === range.startOffset && range.endContainer === range.startContainer) {\n if(range.collapsed) {\n const {node, offset} = getCaretPosF(input, range.endContainer, range.endOffset);\n let newStartNode: Node;\n if(offset) {\n newStartNode = node;\n } else {\n newStartNode = node.previousSibling;\n if(!newStartNode) {\n return;\n }\n\n while(newStartNode.nodeType === newStartNode.TEXT_NODE && !newStartNode.nodeValue && (newStartNode = newStartNode.previousSibling)) {\n\n }\n\n if(newStartNode.nodeType === newStartNode.ELEMENT_NODE && !(newStartNode as HTMLElement).isContentEditable) {\n return;\n }\n }\n\n if(newStartNode.nodeType === newStartNode.ELEMENT_NODE && (newStartNode as any).tagName === 'IMG') {\n newRange.selectNode(newStartNode);\n } else {\n const text = [...newStartNode.textContent];\n let t: string;\n if(offset) {\n let length = 0;\n t = text.find((text) => (length += text.length, length >= offset));\n } else {\n t = text.pop() || '';\n }\n\n const newOffset = offset ? offset - t.length : newStartNode.textContent.length - t.length;\n newRange.setStart(newStartNode, newOffset);\n }\n }\n\n newRange.deleteContents();\n\n appImManager.chat.input.messageInputField.simulateInputEvent();\n // const selection = document.getSelection();\n // if(selection.isCollapsed) {\n // selection.modify('extend', 'backward', 'character');\n // }\n\n // selection.deleteFromDocument();\n // (document.activeElement as HTMLElement).blur();\n\n // document.execCommand('undo', false, null);\n // const input = appImManager.chat.input.messageInput;\n // if((input.lastChild as any)?.tagName) {\n // input.lastElementChild.remove();\n // } else if(input.lastChild) {\n // if(!input.lastChild.textContent.length) {\n // input.lastChild.remove();\n // } else {\n // input.lastChild.textContent = input.lastChild.textContent.slice(0, -1);\n // }\n // }\n\n // const event = new Event('input', {bubbles: true, cancelable: true});\n // appImManager.chat.input.messageInput.dispatchEvent(event);\n // // appSidebarRight.stickersTab.init();\n });\n\n const HIDE_EMOJI_TAB = IS_APPLE_MOBILE && false;\n\n const INIT_TAB_ID = HIDE_EMOJI_TAB ? this.stickersTab.tabId : this.emojiTab.tabId;\n\n if(HIDE_EMOJI_TAB) {\n (this.tabsEl.children[1] as HTMLElement).classList.add('hide');\n }\n\n simulateClickEvent(this.tabsEl.children[INIT_TAB_ID + 1] as HTMLElement);\n if(this.tabs[INIT_TAB_ID].init) {\n this.tabs[INIT_TAB_ID].init(); // onTransitionEnd не вызовется, т.к. это первая открытая вкладка\n }\n\n if(!IS_TOUCH_SUPPORTED) {\n let lastMouseMoveEvent: MouseEvent, mouseMoveEventAttached = false;\n const onMouseMove = (e: MouseEvent) => {\n lastMouseMoveEvent = e;\n };\n overlayCounter.addEventListener('change', (isActive) => {\n if(isActive) {\n if(!mouseMoveEventAttached) {\n document.body.addEventListener('mousemove', onMouseMove);\n mouseMoveEventAttached = true;\n }\n } else if(mouseMoveEventAttached) {\n document.body.removeEventListener('mousemove', onMouseMove);\n if(lastMouseMoveEvent) {\n this.onMouseOut(lastMouseMoveEvent);\n }\n }\n });\n }\n\n appImManager.addEventListener('peer_changing', () => {\n this.toggle(false);\n });\n appImManager.addEventListener('peer_changed', this.checkRights);\n this.checkRights();\n\n return super.init();\n }\n\n public getElement() {\n return this.element;\n }\n\n public scrollTo(tab: EmoticonsTab, element: HTMLElement) {\n tab.scrollable.scrollIntoViewNew({\n element: element as HTMLElement,\n axis: 'y',\n position: 'start',\n ...scrollOptions\n });\n }\n\n private onSelectTabClick = (id: number) => {\n if(this.tabId === id) {\n const {tab} = this;\n this.scrollTo(tab, tab.scrollable.container.firstElementChild as HTMLElement);\n return;\n }\n\n const rights: {[tabId: number]: ChatRights} = {\n [this.stickersTab.tabId]: 'send_stickers',\n [this.gifsTab.tabId]: 'send_gifs'\n };\n\n const action = rights[id];\n if(action && !this.rights[action]) {\n toastNew({langPackKey: POSTING_NOT_ALLOWED_MAP[action]});\n return false;\n }\n\n animationIntersector.checkAnimations(true, EMOTICONSSTICKERGROUP);\n\n this.tabId = id;\n this.searchButton.classList.toggle('hide', this.tabId === this.emojiTab.tabId);\n this.deleteBtn.classList.toggle('hide', this.tabId !== this.emojiTab.tabId);\n };\n\n private checkRights = async() => {\n const {peerId, threadId} = appImManager.chat;\n\n const actions = Object.keys(this.rights) as ChatRights[];\n\n const rights = await Promise.all(actions.map((action) => {\n return this.managers.appMessagesManager.canSendToPeer(peerId, threadId, action);\n }));\n\n actions.forEach((action, idx) => {\n this.rights[action] = rights[idx];\n });\n\n const active = this.tabsEl.querySelector('.active');\n if(active && whichChild(active) !== (this.emojiTab.tabId + 1) && (!this.rights['send_stickers'] || !this.rights['send_gifs'])) {\n this.selectTab(this.emojiTab.tabId, false);\n }\n };\n\n public static menuOnClick = (\n emoticons: EmoticonsTabC,\n menu: HTMLElement,\n scrollable: Scrollable,\n menuScroll?: ScrollableX,\n prevTab?: StickersTabCategory,\n listenerSetter?: ListenerSetter\n ) => {\n let jumpedTo = -1;\n\n const scrollToTab = (tab: typeof prevTab, f?: boolean) => {\n const m = tab.menuScroll || menuScroll;\n if(m) {\n m.scrollIntoViewNew({\n element: tab.elements.menuTab,\n position: 'center',\n axis: 'x',\n getElementPosition: f ? ({elementPosition}) => {\n return elementPosition - 106;\n } : undefined,\n ...scrollOptions\n });\n }\n };\n\n const setActive = (tab: typeof prevTab, scroll = true) => {\n if(tab === prevTab) {\n return false;\n }\n\n let f = false;\n if(prevTab) {\n prevTab.elements.menuTab.classList.remove('active');\n if(prevTab.menuScroll && prevTab.menuScroll !== tab.menuScroll) {\n f = true;\n // scroll to first\n prevTab.menuScroll.container.parentElement.classList.remove('active');\n prevTab.menuScroll.scrollIntoViewNew({\n element: prevTab.menuScroll.container.firstElementChild as HTMLElement,\n forceDirection: scroll ? undefined : FocusDirection.Static,\n position: 'center',\n axis: 'x',\n ...scrollOptions\n });\n }\n }\n\n tab.elements.menuTab.classList.add('active');\n\n if(tab.menuScroll) {\n tab.menuScroll.container.parentElement.classList.add('active');\n scroll && menuScroll.scrollIntoViewNew({\n element: tab.menuScroll.container.parentElement,\n position: 'center',\n axis: 'x',\n ...scrollOptions\n });\n }\n\n if(prevTab) {\n scrollToTab(tab, f);\n }\n\n prevTab = tab;\n\n return true;\n };\n\n const setActiveStatic = (tab: typeof prevTab) => {\n if(prevTab?.local) {\n return;\n }\n\n emoticons.scrollable.scrollTop = tab.elements.container.offsetTop + 1;\n const s = emoticons.menuScroll.container;\n const e = tab.elements.menuTab;\n s.scrollLeft = e.offsetLeft - s.clientWidth / 2 + e.offsetWidth / 2;\n setActive(tab, false);\n };\n\n let scrollingToContent = false;\n const stickyIntersector = new StickyIntersector(scrollable.container, (stuck, target) => {\n if(scrollingToContent) {\n return;\n }\n\n // console.log('sticky scrollTop', stuck, target, scrollable.container.scrollTop, jumpedTo);\n\n if(Math.abs(jumpedTo - scrollable.container.scrollTop) <= 1) {\n return;\n } else {\n jumpedTo = -1;\n }\n\n const tab = emoticons.getCategoryByContainer(target);\n const which = whichChild(target);\n if(!stuck && (which || tab.menuScroll)) {\n return;\n }\n\n setActive(tab);\n });\n\n attachClickEvent(menu, (e) => {\n let target = findUpClassName(e.target as HTMLElement, 'menu-horizontal-div-item');\n if(!target) {\n target = findUpClassName(e.target as HTMLElement, 'menu-horizontal-inner');\n if(!target || target.classList.contains('active')) {\n return;\n }\n\n target = target.firstElementChild.firstElementChild as HTMLElement;\n }\n\n const which = whichChild(target);\n\n const tab = emoticons.getCategoryByMenuTab(target);\n\n /* if(menuScroll) {\n menuScroll.scrollIntoView(target, false, 0);\n } */\n\n if(setActive(tab)) {\n // scrollToTab(tab);\n // return;\n }\n\n let offsetTop = 0, additionalOffset = 0;\n if(which > 0 || tab.menuScroll) {\n const element = tab.elements.container;\n additionalOffset = 1;\n offsetTop = element.offsetTop + additionalOffset; // * due to stickyIntersector\n }\n\n jumpedTo = offsetTop;\n\n scrollingToContent = true;\n scrollable.scrollIntoViewNew({\n element: offsetTop ? tab.elements.container : scrollable.container.firstElementChild,\n position: 'start',\n axis: 'y',\n getElementPosition: offsetTop ? ({elementPosition}) => elementPosition + additionalOffset : undefined,\n ...scrollOptions\n }).finally(() => {\n setActive(tab);\n scrollingToContent = false;\n });\n }, {listenerSetter});\n\n const a = scrollable.onAdditionalScroll ? scrollable.onAdditionalScroll.bind(scrollable) : noop;\n scrollable.onAdditionalScroll = () => {\n emoticons.content.parentElement.classList.toggle('scrolled-top', !scrollable.scrollTop);\n a();\n };\n\n return {stickyIntersector, setActive, setActiveStatic};\n };\n\n public static onMediaClick = async(e: {target: EventTarget | Element}, clearDraft = false, silent?: boolean) => {\n const target = findUpTag(e.target as HTMLElement, 'DIV');\n if(!target) return false;\n\n const docId = target.dataset.docId;\n if(!docId) return false;\n\n return this.sendDocId(docId, clearDraft, silent);\n };\n\n public static async sendDocId(docId: DocId, clearDraft?: boolean, silent?: boolean) {\n if(await appImManager.chat.input.sendMessageWithDocument(docId, undefined, clearDraft, silent)) {\n /* dropdown.classList.remove('active');\n toggleEl.classList.remove('active'); */\n if(emoticonsDropdown.container) {\n emoticonsDropdown.forceClose = true;\n // emoticonsDropdown.container.classList.add('disable-hover');\n emoticonsDropdown.toggle(false);\n }\n\n return true;\n } else {\n console.warn('got no doc by id:', docId);\n return false;\n }\n }\n\n public addLazyLoadQueueRepeat(lazyLoadQueue: LazyLoadQueueIntersector, processInvisibleDiv: (div: HTMLElement) => void) {\n this.addEventListener('close', () => {\n lazyLoadQueue.lock();\n });\n\n this.addEventListener('closed', () => {\n const divs = lazyLoadQueue.intersector.getVisible();\n\n for(const div of divs) {\n processInvisibleDiv(div);\n }\n\n lazyLoadQueue.intersector.clearVisible();\n });\n\n this.addEventListener('opened', () => {\n lazyLoadQueue.unlockAndRefresh();\n });\n }\n\n public getSavedRange() {\n return this.getGoodRange() || this.savedRange;\n }\n\n private getGoodRange() {\n const sel = document.getSelection();\n if(sel.rangeCount && document.activeElement === appImManager.chat.input.messageInput) {\n return sel.getRangeAt(0);\n }\n }\n}\n\nconst emoticonsDropdown = new EmoticonsDropdown();\nMOUNT_CLASS_TO.emoticonsDropdown = emoticonsDropdown;\nexport default emoticonsDropdown;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport emoticonsDropdown, {EmoticonsDropdown, EMOTICONSSTICKERGROUP} from '..';\nimport cancelEvent from '../../../helpers/dom/cancelEvent';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport {fastRaf} from '../../../helpers/schedulers';\nimport pause from '../../../helpers/schedulers/pause';\nimport appImManager from '../../../lib/appManagers/appImManager';\nimport {LangPackKey} from '../../../lib/langPack';\nimport rootScope from '../../../lib/rootScope';\nimport {emojiFromCodePoints} from '../../../vendor/emoji';\nimport {putPreloader} from '../../putPreloader';\nimport Scrollable, {ScrollableX} from '../../scrollable';\nimport IS_EMOJI_SUPPORTED from '../../../environment/emojiSupport';\nimport IS_TOUCH_SUPPORTED from '../../../environment/touchSupport';\nimport blurActiveElement from '../../../helpers/dom/blurActiveElement';\nimport Emoji from '../../../config/emoji';\nimport fixEmoji from '../../../lib/richTextProcessor/fixEmoji';\nimport wrapEmojiText from '../../../lib/richTextProcessor/wrapEmojiText';\nimport wrapSingleEmoji from '../../../lib/richTextProcessor/wrapSingleEmoji';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport {EmoticonsTabC, StickersTabCategory} from './stickers';\nimport {makeMediaSize} from '../../../helpers/mediaSize';\nimport {AppManagers} from '../../../lib/appManagers/managers';\nimport VisibilityIntersector, {OnVisibilityChangeItem} from '../../visibilityIntersector';\nimport mediaSizes from '../../../helpers/mediaSizes';\nimport wrapStickerSetThumb from '../../wrappers/stickerSetThumb';\nimport attachStickerViewerListeners from '../../stickerViewer';\nimport ListenerSetter from '../../../helpers/listenerSetter';\nimport {Document, StickerSet} from '../../../layer';\nimport {CustomEmojiElement, CustomEmojiRendererElement} from '../../../lib/richTextProcessor/wrapRichText';\nimport findAndSplice from '../../../helpers/array/findAndSplice';\nimport positionElementByIndex from '../../../helpers/dom/positionElementByIndex';\nimport PopupStickers from '../../popups/stickers';\nimport {hideToast, toastNew} from '../../toast';\nimport safeAssign from '../../../helpers/object/safeAssign';\nimport type {AppStickersManager} from '../../../lib/appManagers/appStickersManager';\nimport liteMode from '../../../helpers/liteMode';\nimport PopupElement from '../../popups';\n\nconst loadedURLs: Set = new Set();\nexport function appendEmoji(emoji: string, container?: HTMLElement, prepend = false, unify = false) {\n // const emoji = details.unified;\n // const emoji = (details.unified as string).split('-')\n // .reduce((prev, curr) => prev + String.fromCodePoint(parseInt(curr, 16)), '');\n\n const spanEmoji = document.createElement('span');\n spanEmoji.classList.add('super-emoji');\n\n let kek: DocumentFragment;\n if(unify && !IS_EMOJI_SUPPORTED) {\n kek = wrapSingleEmoji(emoji);\n } else {\n emoji = fixEmoji(emoji);\n kek = wrapEmojiText(emoji);\n }\n\n /* if(!kek.includes('emoji')) {\n console.log(emoji, kek, spanEmoji, emoji.length, new TextEncoder().encode(emoji), emojiUnicode(emoji));\n return;\n } */\n\n // console.log(kek);\n\n spanEmoji.append(kek);\n\n if(spanEmoji.children.length > 1) {\n const first = spanEmoji.firstElementChild;\n spanEmoji.innerHTML = '';\n spanEmoji.append(first);\n }\n\n if(spanEmoji.firstElementChild?.tagName === 'IMG') {\n const image = spanEmoji.firstElementChild as HTMLImageElement;\n\n const url = image.src;\n if(!loadedURLs.has(url)) {\n image.setAttribute('loading', 'lazy');\n const placeholder = document.createElement('span');\n placeholder.classList.add('emoji-placeholder');\n\n if(liteMode.isAvailable('animations')) {\n image.style.opacity = '0';\n placeholder.style.opacity = '1';\n }\n\n image.addEventListener('load', () => {\n fastRaf(() => {\n if(liteMode.isAvailable('animations')) {\n image.style.opacity = '';\n placeholder.style.opacity = '';\n }\n\n spanEmoji.classList.remove('empty');\n\n loadedURLs.add(url);\n });\n }, {once: true});\n\n spanEmoji.append(placeholder);\n }\n }\n\n // spanEmoji = spanEmoji.firstElementChild as HTMLSpanElement;\n // spanEmoji.setAttribute('emoji', emoji);\n if(container) {\n if(prepend) container.prepend(spanEmoji);\n else container.appendChild(spanEmoji);\n }\n\n return spanEmoji;\n}\n\nexport function getEmojiFromElement(element: HTMLElement): {docId?: DocId, emoji: string} {\n const superEmoji = findUpClassName(element, 'super-emoji');\n if(!superEmoji) return;\n\n const firstElementChild = superEmoji.firstElementChild as HTMLElement;\n if(firstElementChild && firstElementChild.classList.contains('custom-emoji')) {\n return {emoji: firstElementChild.dataset.stickerEmoji, docId: firstElementChild.dataset.docId} as const;\n } else {\n if(element.nodeType === element.TEXT_NODE) return {emoji: element.nodeValue};\n if(element.tagName === 'SPAN' && !element.classList.contains('emoji') && element.firstElementChild) {\n element = element.firstElementChild as HTMLElement;\n }\n\n return {emoji: element.getAttribute('alt') || element.innerText} as const;\n }\n}\n\nconst EMOJI_RECENT_ID: (typeof EMOJI_CATEGORIES)[0][0] = 'Emoji.Recent';\nconst EMOJI_RECENT_CATEGORY: (typeof EMOJI_CATEGORIES)[0] = [EMOJI_RECENT_ID, 'recent'];\nconst CUSTOM_EMOJI_RECENT_ID: (typeof EMOJI_CATEGORIES)[0][0] = '';\nconst CUSTOM_EMOJI_RECENT_CATEGORY: (typeof EMOJI_CATEGORIES)[0] = [CUSTOM_EMOJI_RECENT_ID, ''];\nconst EMOJI_CATEGORIES: [LangPackKey | '', string][] = [\n ['Emoji.SmilesAndPeople', 'smile'],\n ['Emoji.AnimalsAndNature', 'animals'],\n ['Emoji.FoodAndDrink', 'eats'],\n ['Emoji.TravelAndPlaces', 'car'],\n ['Emoji.ActivityAndSport', 'sport'],\n ['Emoji.Objects', 'lamp'],\n // ['Emoji.Symbols', 'info'],\n ['Emoji.Flags', 'flag'],\n ['Skin Tones' as any, '']\n];\n\nlet sorted: Map<(typeof EMOJI_CATEGORIES)[0], string[]>;\nfunction prepare() {\n if(sorted) {\n return sorted;\n }\n\n const a: Array<[(typeof EMOJI_CATEGORIES)[0], string[]]> = [\n [CUSTOM_EMOJI_RECENT_CATEGORY, []],\n [EMOJI_RECENT_CATEGORY, []]\n ];\n\n sorted = new Map(a);\n for(const emoji in Emoji) {\n const details = Emoji[emoji];\n const i = '' + details;\n const category = EMOJI_CATEGORIES[+i[0] - 1];\n if(!category) continue; // maybe it's skin tones\n\n let s = sorted.get(category);\n if(!s) {\n s = [];\n sorted.set(category, s);\n }\n\n s[+i.slice(1) || 0] = emoji;\n }\n\n sorted.delete(EMOJI_CATEGORIES.pop());\n EMOJI_CATEGORIES.unshift(CUSTOM_EMOJI_RECENT_CATEGORY, EMOJI_RECENT_CATEGORY);\n const order = EMOJI_CATEGORIES.map(([id]) => id);\n const entries = [...sorted.entries()].sort((a, b) => order.indexOf(a[0][0]) - order.indexOf(b[0][0]));\n sorted = new Map(entries);\n\n return sorted;\n}\n\nconst EMOJI_ELEMENT_SIZE = makeMediaSize(42, 42);\nconst RECENT_MAX_LENGTH = 32;\n\ntype EmojiTabItem = {element: HTMLElement} & ReturnType;\ntype EmojiTabCategory = StickersTabCategory;\nexport default class EmojiTab extends EmoticonsTabC {\n private closeScrollTop: number;\n private menuInnerScroll: ScrollableX;\n private isStandalone?: boolean;\n private noRegularEmoji?: boolean;\n private stickerSetId?: Parameters[0];\n private onClick: (emoji: EmojiTabItem) => void;\n private activeEmoji: ReturnType;\n private activeElements: EmojiTabItem[];\n\n constructor(options: {\n managers: AppManagers,\n isStandalone?: boolean,\n noRegularEmoji?: boolean,\n stickerSetId?: EmojiTab['stickerSetId'],\n onClick?: EmojiTab['onClick']\n }) {\n super(\n options.managers,\n 'super-emojis',\n () => EMOJI_ELEMENT_SIZE,\n 16,\n 4,\n 0\n );\n\n safeAssign(this, options);\n this.container.classList.add('emoji-padding');\n this.content.id = 'content-emoji';\n this.activeElements = [];\n }\n\n private onCategoryVisibility = ({target, visible}: Pick) => {\n const category = this.categoriesMap.get(target);\n // console.log(target, visible, category);\n // if(category.local) return;\n\n const renderer = category.elements.renderer;\n const newChildren: HTMLElement[] = [];\n if(renderer) {\n newChildren.push(renderer);\n const customEmojis: Parameters[0] = new Map();\n if(visible) {\n newChildren.push(...category.items.map(({docId, element}) => {\n if(!docId) {\n return element;\n }\n\n // return element;\n\n // if(element.firstElementChild) {\n // return element;\n // }\n\n const customEmojiElement = element.firstElementChild as CustomEmojiElement;\n customEmojiElement.clear(false);\n // const customEmojiElement = CustomEmojiElement.create(document.id);\n customEmojis.set(customEmojiElement.docId, new Set([customEmojiElement]));\n // element.append(customEmojiElement);\n return element;\n }));\n\n renderer.add(customEmojis/* , EmoticonsDropdown.lazyLoadQueue */, undefined, undefined, false);\n } else {\n renderer.clearCanvas();\n renderer.middlewareHelper.clean();\n }\n } else if(visible) {\n newChildren.push(...category.items.map(({element}) => element));\n }\n\n // if(visible)\n category.elements.items.replaceChildren(...newChildren);\n\n if(renderer && !visible) {\n const customEmojis: Parameters[0] = new Map();\n category.items.forEach(({docId, element}) => {\n if(!docId) {\n return;\n }\n\n const customEmojiElement = element.firstElementChild as CustomEmojiElement;\n customEmojiElement.clear();\n customEmojis.set(customEmojiElement.docId, new Set([customEmojiElement]));\n });\n\n /* const promise = */renderer.add(customEmojis/* , EmoticonsDropdown.lazyLoadQueue */, undefined, true);\n // promise.then(() => {\n // customEmojis.forEach((elements) => {\n // elements.forEach((element) => {\n // if(!element.innerHTML) {\n // console.log('no thumb', element);\n // // debugger;\n // }\n // });\n // });\n\n // const set = customEmojis.get('5766933926429854499');\n // console.log(`wrapped ${customEmojis.size} thumbs`, set && set.values().next().value.innerHTML);\n // });\n }\n\n // if(!visible) {\n // const customEmojis: Parameters[0] = {};\n // category.items.forEach((item) => {\n // const {element, document} = item;\n // if(!element.firstElementChild) {\n // return;\n // }\n\n // const customEmojiElement = CustomEmojiElement.create(document.id);\n // customEmojis[customEmojiElement.docId] = new Set([customEmojiElement]);\n // element.firstElementChild.replaceWith(customEmojiElement);\n // });\n\n // renderer.add(customEmojis, EmoticonsDropdown.lazyLoadQueue);\n // }\n };\n\n public destroy() {\n super.destroy();\n this.menuInnerScroll?.destroy();\n }\n\n public init() {\n super.init();\n this.init = undefined;\n\n const intersectionOptions: IntersectionObserverInit = {\n root: this.isStandalone ? this.content : emoticonsDropdown.getElement()\n };\n\n this.categoriesIntersector = new VisibilityIntersector(this.onCategoryVisibility, intersectionOptions);\n\n this.menuOnClickResult = EmoticonsDropdown.menuOnClick(this, this.menu, this.scrollable, this.menuScroll, undefined, this.listenerSetter);\n\n const preloader = putPreloader(this.content, true);\n\n let innerScrollWrapper: HTMLElement;\n\n if(!this.isStandalone) {\n const x = this.menuInnerScroll = new ScrollableX(undefined);\n x.container.classList.add('menu-horizontal-inner-scroll');\n\n innerScrollWrapper = document.createElement('div');\n innerScrollWrapper.classList.add('menu-horizontal-inner');\n innerScrollWrapper.append(x.container);\n }\n\n let preparedMap: ReturnType;\n prepare();\n if(!this.noRegularEmoji) {\n preparedMap = prepare();\n } else {\n preparedMap = new Map([\n [[CUSTOM_EMOJI_RECENT_CATEGORY[0], 'recent'], []]\n // [EMOJI_RECENT_CATEGORY, []]\n ]);\n }\n\n preparedMap.forEach((emojis, [titleLangPackKey, icon]) => {\n const category = this.createLocalCategory(titleLangPackKey, titleLangPackKey, icon, !icon);\n category.elements.container.classList.remove('hide');\n category.elements.items.classList.add(icon && !this.isStandalone ? 'is-local' : 'not-local');\n\n emojis.forEach((unified) => {\n /* if(emojiUnicode(emoji) === '1f481-200d-2642') {\n console.log('append emoji', emoji, emojiUnicode(emoji));\n } */\n\n const emoji = emojiFromCodePoints(unified);\n // if(emoji.includes('🕵')) {\n // console.log('toCodePoints', toCodePoints(emoji));\n // emoji = emoji.replace(/(\\u200d[\\u2640\\u2642\\u2695])(?!\\ufe0f)/, '\\ufe0f$1');\n // const zwjIndex = emoji.indexOf('\\u200d');\n // if(zwjIndex !== -1 && !emoji.includes('\\ufe0f')) {\n // /* if(zwjIndex !== (emoji.length - 1)) {\n // emoji = emoji.replace(/(\\u200d)/g, '\\ufe0f$1');\n // } */\n\n // emoji += '\\ufe0f';\n // //emoji += '\\ufe0f';\n // }\n\n // debugger;\n // }\n\n this.addEmojiToCategory({\n category,\n emoji: {emoji},\n batch: true\n });\n\n /* if(category === 'Smileys & Emotion') {\n console.log('appended emoji', emoji, itemsDiv.children[itemsDiv.childElementCount - 1].innerHTML, emojiUnicode(emoji));\n } */\n });\n });\n\n const promise = Promise.all([\n this.isStandalone ? undefined : pause(200),\n !this.noRegularEmoji && this.managers.appEmojiManager.getRecentEmojis('native'),\n !this.isStandalone && this.managers.appEmojiManager.getRecentEmojis('custom'),\n this.stickerSetId && this.managers.appStickersManager.getLocalStickerSet(this.stickerSetId),\n this.managers.appEmojiManager.getCustomEmojis()\n ]).then(([_, recent, recentCustom, mainSet, sets]) => {\n preloader.remove();\n\n if(mainSet) {\n recentCustom = mainSet.documents.map((doc) => doc.id);\n }\n\n const recentCategory = this.categories[EMOJI_RECENT_ID];\n const recentCustomCategory = this.categories[CUSTOM_EMOJI_RECENT_ID];\n\n if(!this.isStandalone) {\n const a = [\n recentCategory && [recentCategory, recent] as const,\n recentCustomCategory && [recentCustomCategory, recentCustom] as const\n ];\n\n a.filter(Boolean).forEach(([category, recent]) => {\n category.limit = RECENT_MAX_LENGTH;\n recent.splice(RECENT_MAX_LENGTH, recent.length - RECENT_MAX_LENGTH);\n });\n }\n\n if(recentCategory && recent) for(const emoji of recent) {\n this.addEmojiToCategory({\n category: recentCategory,\n emoji: {emoji},\n batch: true\n });\n }\n\n if(recentCustomCategory) {\n this.createRendererForCategory(recentCustomCategory);\n if(recentCustom) for(const docId of recentCustom) {\n this.addEmojiToCategory({\n category: recentCustomCategory,\n emoji: {emoji: '', docId},\n batch: true\n });\n }\n recentCustomCategory.elements.container.style.paddingTop = '.5rem';\n }\n\n EMOJI_CATEGORIES.forEach(([id]) => {\n const category = this.categories[id];\n if(!category) {\n return;\n }\n\n this.toggleLocalCategory(category, true);\n\n if(id !== EMOJI_RECENT_ID && id !== CUSTOM_EMOJI_RECENT_ID) {\n category.menuScroll = this.menuInnerScroll;\n this.menuInnerScroll.container.append(category.elements.menuTab);\n }\n });\n\n this.resizeCategories();\n\n recentCategory && innerScrollWrapper && recentCategory.elements.menuTab.after(innerScrollWrapper);\n\n sets.sets.forEach((set) => {\n this.renderStickerSet(set);\n });\n\n this.listenerSetter.add(rootScope)('premium_toggle', () => {\n this.toggleCustomCategory();\n });\n\n this.listenerSetter.add(rootScope)('stickers_top', this.postponedEvent((id) => {\n const category = this.categories[id];\n if(!category) {\n return;\n }\n\n this.positionCategory(category, true);\n\n this.listenerSetter.add(emoticonsDropdown)('openAfterLayout', () => {\n this.menuOnClickResult.setActiveStatic(category);\n }, {once: true});\n }));\n\n const toggleRenderers = (ignore: boolean) => {\n for(const id in this.categories) {\n const category = this.categories[id];\n const renderer = category.elements.renderer;\n if(renderer) {\n renderer.ignoreSettingDimensions = ignore;\n if(!ignore) {\n renderer.setDimensionsFromRect(undefined, true);\n }\n }\n }\n };\n\n !this.isStandalone && this.listenerSetter.add(emoticonsDropdown)('opened', () => {\n toggleRenderers(false);\n });\n\n !this.isStandalone && this.listenerSetter.add(emoticonsDropdown)('close', () => {\n toggleRenderers(true);\n });\n\n this.listenerSetter.add(rootScope)('stickers_installed', (set) => {\n if(!this.categories[set.id] && set.pFlags.emojis) {\n this.renderStickerSet(set, true);\n }\n });\n\n this.listenerSetter.add(rootScope)('stickers_deleted', (set) => {\n const category = this.categories[set.id];\n if(this.deleteCategory(category)) {\n const {renderer} = category.elements;\n if(renderer) {\n renderer.middlewareHelper.clean();\n }\n }\n });\n\n !this.isStandalone && this.listenerSetter.add(rootScope)('emoji_recent', this.postponedEvent((emoji) => {\n const category = this.categories[emoji.docId ? CUSTOM_EMOJI_RECENT_ID : EMOJI_RECENT_ID];\n if(!category) {\n return;\n }\n\n const verify: (item: EmojiTabItem) => boolean = emoji.docId ?\n (item) => item.docId === emoji.docId :\n (item) => item.emoji === emoji.emoji;\n const found = findAndSplice(category.items, verify);\n if(found) {\n category.items.unshift(found);\n if(this.isCategoryVisible(category)) {\n const {renderer} = category.elements;\n positionElementByIndex(found.element, category.elements.items, renderer ? 1 : 0, -1);\n renderer?.forceRender();\n }\n } else {\n this.addEmojiToCategory({\n category,\n emoji,\n batch: false,\n prepend: true\n });\n }\n\n if(this.closeScrollTop === 0) {\n this.menuOnClickResult.setActive(emoji.docId ? this.categories[EMOJI_RECENT_ID] : category);\n }\n }));\n\n !this.isStandalone && this.listenerSetter.add(appImManager)('peer_changed', () => {\n this.toggleCustomCategory();\n });\n\n this.toggleCustomCategory();\n\n this.menuOnClickResult.setActive(recentCategory ?? recentCustomCategory);\n });\n\n attachClickEvent(this.content, this.onContentClick, {listenerSetter: this.listenerSetter});\n attachStickerViewerListeners({listenTo: this.content, listenerSetter: this.listenerSetter});\n\n return promise;\n }\n\n private renderStickerSet(set: StickerSet.stickerSet, prepend?: boolean) {\n const category = this.createCategory(set, wrapEmojiText(set.title));\n this.positionCategory(category, prepend);\n const {container, menuTabPadding} = category.elements;\n category.elements.items.classList.add('not-local');\n category.elements.container.classList.add('is-premium-set');\n category.elements.title.classList.add('tgico');\n\n this.createRendererForCategory(category);\n\n const promise = this.managers.appStickersManager.getStickerSet(set);\n promise.then(({documents}) => {\n documents.forEach((document) => {\n this.addEmojiToCategory({\n category,\n emoji: {docId: document.id, emoji: (document as Document.document).stickerEmojiRaw},\n batch: true\n });\n });\n\n // if(this.isCategoryVisible(category)) {\n // category.elements.items.append(...category.items.map(({element}) => element));\n // }\n\n this.onCategoryVisibility({target: category.elements.container, visible: this.isCategoryVisible(category)});\n\n category.setCategoryItemsHeight();\n container.classList.remove('hide');\n });\n\n wrapStickerSetThumb({\n set,\n container: menuTabPadding,\n group: EMOTICONSSTICKERGROUP,\n lazyLoadQueue: EmoticonsDropdown.lazyLoadQueue,\n width: 32,\n height: 32,\n autoplay: false\n });\n }\n\n private get peerId() {\n return appImManager.chat.peerId;\n }\n\n public getCustomCategory() {\n return this.categories[CUSTOM_EMOJI_RECENT_ID];\n }\n\n private toggleCustomCategory() {\n const category = this.categories[CUSTOM_EMOJI_RECENT_ID];\n const hasPremium = rootScope.premium || this.peerId === rootScope.myId;\n const canSeeCustomCategory = hasPremium || this.isStandalone;\n super.toggleLocalCategory(category, !!category.items.length && canSeeCustomCategory);\n this.content.classList.toggle('has-premium', hasPremium);\n }\n\n protected toggleLocalCategory(category: EmojiTabCategory, visible: boolean) {\n if(category.id === CUSTOM_EMOJI_RECENT_ID) {\n this.toggleCustomCategory();\n return;\n }\n\n super.toggleLocalCategory(category, visible);\n }\n\n private createRendererForCategory(category: EmojiTabCategory) {\n const renderer = CustomEmojiRendererElement.create({\n animationGroup: EMOTICONSSTICKERGROUP,\n customEmojiSize: mediaSizes.active.esgCustomEmoji\n });\n\n category.elements.renderer = renderer;\n category.elements.items.append(renderer);\n }\n\n public addEmojiToCategory(options: {\n category: EmojiTabCategory,\n emoji?: ReturnType,\n element?: HTMLElement,\n batch?: boolean,\n prepend?: boolean,\n active?: boolean\n }) {\n const {category, emoji, batch, prepend} = options;\n let element = options.element;\n if(element) {\n const spanEmoji = document.createElement('span');\n spanEmoji.classList.add('super-emoji');\n spanEmoji.append(element);\n element = spanEmoji;\n } else if(emoji.docId) {\n const customEmojiElement = CustomEmojiElement.create(emoji.docId);\n const span = document.createElement('span');\n span.classList.add(/* 'emoji', */'super-emoji');\n span.append(customEmojiElement);\n element = span;\n } else {\n element = appendEmoji(emoji.emoji/* .replace(/[\\ufe0f\\u2640\\u2642\\u2695]/g, '') */, undefined, false/* , false */);\n }\n\n const item: typeof category['items'][0] = {\n ...(emoji || {emoji: undefined}),\n element\n };\n\n if(\n options.active || (\n this.activeEmoji && (\n item.docId ?\n this.activeEmoji.docId === item.docId :\n this.activeEmoji.emoji === item.emoji\n )\n )\n ) {\n this.activeEmoji === emoji;\n this.activeElements.push(item);\n element.classList.add('active');\n }\n\n category.items[prepend ? 'unshift' : 'push'](item);\n if(!batch && !this.spliceExceed(category)) {\n this.onLocalCategoryUpdate(category);\n }\n }\n\n // private addEmojisToCategory(category: EmojiTabCategory, emojis: string[], prepend?: boolean) {\n // emojis.forEach((emoji) => {\n // this.addEmojiToCategory(category, emoji, true, prepend);\n // });\n\n // this.onLocalCategoryUpdate(category);\n // }\n\n private onContentClick = (e: MouseEvent) => {\n cancelEvent(e);\n\n const {target} = e;\n\n const container = findUpClassName(target, 'emoji-category');\n const category = this.categoriesMap.get(container);\n if(findUpClassName(target, 'category-title')) {\n if(category.local) {\n return;\n }\n\n PopupElement.createPopup(PopupStickers, {id: category.set.id, access_hash: category.set.access_hash}, true).show();\n return;\n }\n\n const emoji = getEmojiFromElement(target as HTMLElement);\n if(!emoji) {\n return;\n }\n\n if(\n emoji.docId &&\n !rootScope.premium && (\n this.isStandalone ? category.id !== CUSTOM_EMOJI_RECENT_ID : this.peerId !== rootScope.myId\n )\n ) {\n const a = document.createElement('a');\n a.onclick = () => {\n appImManager.openPremiumBot();\n hideToast();\n };\n toastNew({\n langPackKey: 'CustomEmoji.PremiumAlert',\n langPackArguments: [a]\n });\n return;\n }\n\n if(this.onClick) {\n this.onClick({\n ...emoji,\n element: findUpClassName(target, 'super-emoji').firstElementChild as HTMLElement\n });\n } else {\n appImManager.chat.input.onEmojiSelected(emoji, false);\n }\n\n if(IS_TOUCH_SUPPORTED) {\n blurActiveElement();\n }\n };\n\n public setActive(emoji: ReturnType) {\n if(\n emoji === this.activeEmoji ||\n emoji?.docId ? emoji.docId === this.activeEmoji?.docId : emoji?.emoji === this.activeEmoji?.emoji\n ) {\n return;\n }\n\n this.activeEmoji = emoji;\n\n this.activeElements.forEach((item) => {\n item.element.classList.remove('active');\n });\n\n this.activeElements.length = 0;\n\n this.categoriesMap.forEach((category) => {\n category.items.forEach((item) => {\n if(emoji.docId ? item.docId === emoji.docId : item.emoji === emoji.emoji) {\n item.element.classList.add('active');\n this.activeElements.push(item);\n }\n });\n });\n }\n\n public onClose() {\n this.closeScrollTop = this.scrollable.scrollTop;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport getEmojiEntityFromEmoji from './getEmojiEntityFromEmoji';\nimport wrapRichText from './wrapRichText';\n\nexport default function wrapSingleEmoji(emoji: string) {\n return wrapRichText(emoji, {\n entities: [getEmojiEntityFromEmoji(emoji)]\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport indexOfAndSplice from '../helpers/array/indexOfAndSplice';\nimport LazyLoadQueueIntersector, {LazyLoadElement} from './lazyLoadQueueIntersector';\nimport VisibilityIntersector, {OnVisibilityChange} from './visibilityIntersector';\n\nexport default class LazyLoadQueueRepeat extends LazyLoadQueueIntersector {\n private elementsMap: Map = new Map();\n\n constructor(\n parallelLimit?: number,\n protected onVisibilityChange?: OnVisibilityChange,\n options?: IntersectionObserverInit\n ) {\n super(parallelLimit);\n\n this.intersector = new VisibilityIntersector((item) => {\n const {target, visible} = item;\n\n const queueItem = this.elementsMap.get(target);\n queueItem.visible = visible;\n\n if(visible) {\n queueItem.wasSeen = true;\n if(!this.queue.includes(queueItem)) {\n this.queue.push(queueItem);\n }\n } else {\n indexOfAndSplice(this.queue, queueItem);\n }\n\n this.onVisibilityChange?.(item);\n this.setProcessQueueTimeout();\n }, options);\n }\n\n public clear() {\n super.clear();\n this.elementsMap.clear();\n }\n\n /* public async processItem(item: LazyLoadElement) {\n //await super.processItem(item);\n await LazyLoadQueueBase.prototype.processItem.call(this, item);\n\n if(this.lazyLoadMedia.length) {\n this.processQueue();\n }\n } */\n\n public observe(el: LazyLoadElement) {\n this.elementsMap.set(el.div, el);\n super.observe(el);\n }\n\n public unobserve(el: LazyLoadElement) {\n this.elementsMap.delete(el.div);\n super.unobserve(el);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport emoticonsDropdown, {EmoticonsDropdown, EMOTICONSSTICKERGROUP, EmoticonsTab} from '..';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport mediaSizes from '../../../helpers/mediaSizes';\nimport {Document, MessagesAllStickers, StickerSet} from '../../../layer';\nimport {MyDocument} from '../../../lib/appManagers/appDocsManager';\nimport {AppManagers} from '../../../lib/appManagers/managers';\nimport {i18n, LangPackKey} from '../../../lib/langPack';\nimport wrapEmojiText from '../../../lib/richTextProcessor/wrapEmojiText';\nimport rootScope from '../../../lib/rootScope';\nimport animationIntersector, {AnimationItemGroup} from '../../animationIntersector';\nimport LazyLoadQueue from '../../lazyLoadQueue';\nimport LazyLoadQueueRepeat from '../../lazyLoadQueueRepeat';\nimport {putPreloader} from '../../putPreloader';\nimport PopupStickers from '../../popups/stickers';\nimport Scrollable, {ScrollableX} from '../../scrollable';\nimport findAndSplice from '../../../helpers/array/findAndSplice';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport positionElementByIndex from '../../../helpers/dom/positionElementByIndex';\nimport noop from '../../../helpers/noop';\nimport ButtonIcon from '../../buttonIcon';\nimport confirmationPopup from '../../confirmationPopup';\nimport VisibilityIntersector, {OnVisibilityChangeItem} from '../../visibilityIntersector';\nimport createStickersContextMenu from '../../../helpers/dom/createStickersContextMenu';\nimport findUpAsChild from '../../../helpers/dom/findUpAsChild';\nimport forEachReverse from '../../../helpers/array/forEachReverse';\nimport attachStickerViewerListeners from '../../stickerViewer';\nimport ListenerSetter from '../../../helpers/listenerSetter';\nimport wrapSticker from '../../wrappers/sticker';\nimport wrapStickerSetThumb from '../../wrappers/stickerSetThumb';\nimport {MediaSize} from '../../../helpers/mediaSize';\nimport {AnyFunction} from '../../../types';\nimport {IgnoreMouseOutType} from '../../../helpers/dropdownHover';\nimport customProperties from '../../../helpers/dom/customProperties';\nimport windowSize from '../../../helpers/windowSize';\nimport PopupElement from '../../popups';\n\nexport class SuperStickerRenderer {\n public lazyLoadQueue: LazyLoadQueueRepeat;\n private animated: Set = new Set();\n\n constructor(\n private regularLazyLoadQueue: LazyLoadQueue,\n private group: AnimationItemGroup,\n private managers: AppManagers,\n private options?: IntersectionObserverInit\n ) {\n this.lazyLoadQueue = new LazyLoadQueueRepeat(undefined, ({target, visible}) => {\n if(!visible) {\n this.processInvisible(target);\n }\n }, options);\n }\n\n public clear() {\n this.lazyLoadQueue.clear();\n }\n\n public renderSticker(doc: MyDocument, element?: HTMLElement, loadPromises?: Promise[]) {\n if(!element) {\n element = document.createElement('div');\n element.classList.add('grid-item', 'super-sticker');\n element.dataset.docId = '' + doc.id;\n\n if(doc.animated) {\n this.observeAnimated(element);\n }\n }\n\n // * This will wrap only a thumb\n /* !doc.animated && */wrapSticker({\n doc,\n div: element,\n lazyLoadQueue: this.regularLazyLoadQueue,\n group: this.group,\n onlyThumb: doc.animated,\n loadPromises\n });\n\n return element;\n }\n\n public observeAnimated(element: HTMLElement) {\n this.animated.add(element);\n this.lazyLoadQueue.observe({\n div: element,\n load: this.processVisible\n });\n }\n\n public unobserveAnimated(element: HTMLElement) {\n this.animated.delete(element);\n this.lazyLoadQueue.delete({div: element});\n }\n\n private checkAnimationContainer = (element: HTMLElement, visible: boolean) => {\n // console.error('checkAnimationContainer', div, visible);\n const players = animationIntersector.getAnimations(element);\n players.forEach((player) => {\n if(!visible) {\n animationIntersector.removeAnimation(player);\n } else {\n animationIntersector.checkAnimation(player, false);\n }\n });\n };\n\n private processVisible = async(element: HTMLElement) => {\n const docId = element.dataset.docId;\n const doc = await this.managers.appDocsManager.getDoc(docId);\n\n const size = mediaSizes.active.esgSticker.width;\n\n // console.log('processVisibleDiv:', element);\n\n const promise = wrapSticker({\n doc,\n div: element,\n width: size,\n height: size,\n lazyLoadQueue: null,\n group: this.group,\n onlyThumb: false,\n play: true,\n loop: true,\n withLock: true\n }).then(({render}) => render);\n\n promise.then(() => {\n // clearTimeout(timeout);\n this.checkAnimationContainer(element, this.lazyLoadQueue.intersector.isVisible(element));\n });\n\n /* let timeout = window.setTimeout(() => {\n console.error('processVisibleDiv timeout', div, doc);\n }, 1e3); */\n\n return promise;\n };\n\n public processInvisible = async(element: HTMLElement) => {\n const docId = element.dataset.docId;\n const doc = await this.managers.appDocsManager.getDoc(docId);\n\n // console.log('STICKER INvisible:', /* div, */docId);\n\n this.checkAnimationContainer(element, false);\n\n element.textContent = '';\n this.renderSticker(doc, element as HTMLDivElement);\n };\n}\n\nexport type StickersTabCategoryItem = {element: HTMLElement};\n\nexport class StickersTabCategory = {}> {\n public elements: {\n container: HTMLElement,\n title: HTMLElement,\n items: HTMLElement,\n menuTab: HTMLElement,\n menuTabPadding: HTMLElement\n } & AdditionalElements;\n public items: Item[];\n public mounted: boolean;\n public id: string;\n public limit: number;\n\n public getContainerSize: () => {width: number, height: number};\n private getElementMediaSize: () => MediaSize;\n\n private gapX: number;\n private gapY: number;\n\n public set?: StickerSet;\n public local?: boolean;\n public menuScroll?: ScrollableX;\n\n constructor(options: {\n id: string,\n title: HTMLElement | DocumentFragment,\n overflowElement: HTMLElement,\n getContainerSize: StickersTabCategory['getContainerSize'],\n getElementMediaSize: StickersTabCategory['getElementMediaSize'],\n gapX: number,\n gapY: number,\n noMenuTab?: boolean\n }) {\n const container = document.createElement('div');\n container.classList.add('emoji-category');\n\n const items = document.createElement('div');\n items.classList.add('category-items');\n\n let title: HTMLElement;\n if(options.title) {\n title = document.createElement('div');\n title.classList.add('category-title');\n title.append(options.title);\n }\n\n let menuTab: HTMLElement, menuTabPadding: HTMLElement;\n if(!options.noMenuTab) {\n menuTab = ButtonIcon(undefined, {noRipple: true});\n menuTab.classList.add('menu-horizontal-div-item');\n\n menuTabPadding = document.createElement('div');\n menuTabPadding.classList.add('menu-horizontal-div-item-padding');\n\n menuTab.append(menuTabPadding);\n }\n\n if(title) container.append(title);\n container.append(items);\n\n this.elements = {\n container,\n title,\n items,\n menuTab,\n menuTabPadding\n } as any;\n this.id = options.id;\n this.items = [];\n\n this.getContainerSize = options.getContainerSize;\n this.getElementMediaSize = options.getElementMediaSize;\n this.gapX = options.gapX ?? 0;\n this.gapY = options.gapY ?? 0;\n }\n\n public setCategoryItemsHeight() {\n const {width: containerWidth} = this.getContainerSize();\n const elementSize = this.getElementMediaSize().width;\n\n let itemsPerRow = containerWidth / elementSize;\n if(this.gapX) itemsPerRow -= Math.floor(itemsPerRow - 1) * this.gapX / elementSize;\n itemsPerRow = Math.floor(itemsPerRow);\n\n const rows = Math.ceil(this.items.length / itemsPerRow);\n let height = rows * elementSize;\n if(this.gapY) height += (rows - 1) * this.gapY;\n\n this.elements.items.style.minHeight = height + 'px';\n }\n}\n\nexport class EmoticonsTabC> implements EmoticonsTab {\n public content: HTMLElement;\n public menuScroll: ScrollableX;\n public container: HTMLElement;\n public menuWrapper: HTMLElement;\n public menu: HTMLElement;\n\n protected categories: {[id: string]: Category};\n protected categoriesMap: Map;\n protected categoriesByMenuTabMap: Map;\n protected categoriesIntersector: VisibilityIntersector;\n protected localCategories: Category[];\n\n protected listenerSetter: ListenerSetter;\n\n public scrollable: Scrollable;\n protected mounted = false;\n protected menuOnClickResult: ReturnType;\n\n public tabId: number;\n\n protected postponedEvents: {cb: AnyFunction, args: any[]}[];\n\n public getContainerSize: Category['getContainerSize'];\n\n constructor(\n protected managers: AppManagers,\n protected categoryItemsClassName: string,\n protected getElementMediaSize: () => MediaSize,\n protected padding: number,\n protected gapX: number,\n protected gapY: number\n ) {\n this.categories = {};\n this.categoriesMap = new Map();\n this.categoriesByMenuTabMap = new Map();\n this.localCategories = [];\n this.postponedEvents = [];\n\n this.listenerSetter = new ListenerSetter();\n\n this.container = document.createElement('div');\n this.container.classList.add('tabs-tab', 'emoticons-container');\n\n this.menuWrapper = document.createElement('div');\n this.menuWrapper.classList.add('menu-wrapper', 'emoticons-menu-wrapper');\n\n this.menu = document.createElement('nav');\n this.menu.className = 'menu-horizontal-div no-stripe justify-start emoticons-menu';\n\n this.menuWrapper.append(this.menu);\n this.menuScroll = new ScrollableX(this.menuWrapper);\n\n this.content = document.createElement('div');\n this.content.classList.add('emoticons-content');\n\n this.container.append(this.menuWrapper, this.content);\n\n this.scrollable = new Scrollable(this.content, 'STICKERS');\n }\n\n public getCategoryByContainer(container: HTMLElement) {\n return this.categoriesMap.get(container);\n }\n\n public getCategoryByMenuTab(menuTab: HTMLElement) {\n return this.categoriesByMenuTabMap.get(menuTab);\n }\n\n protected createCategory(stickerSet: StickerSet, title: HTMLElement | DocumentFragment, isLocal?: boolean, noMenuTab?: boolean) {\n const category: Category = new StickersTabCategory({\n id: '' + stickerSet.id,\n title,\n overflowElement: this.content,\n getContainerSize: () => {\n let width: number, height: number;\n if(this.getContainerSize) {\n const size = this.getContainerSize();\n width = size.width;\n height = size.height;\n } else {\n const esgWidth = customProperties.getPropertyAsSize('esg-width');\n width = esgWidth === undefined ? windowSize.width : esgWidth;\n }\n\n return {width: width - this.padding, height};\n },\n getElementMediaSize: this.getElementMediaSize,\n gapX: this.gapX,\n gapY: this.gapY,\n noMenuTab\n }) as any;\n\n if(this.categoryItemsClassName) {\n category.elements.items.classList.add(this.categoryItemsClassName);\n }\n\n const container = category.elements.container;\n container.classList.add('hide');\n\n category.set = stickerSet;\n this.categories[stickerSet.id] = category;\n this.categoriesMap.set(container, category);\n !noMenuTab && this.categoriesByMenuTabMap.set(category.elements.menuTab, category);\n\n this.categoriesIntersector.observe(container);\n !noMenuTab && this.menuOnClickResult.stickyIntersector.observeStickyHeaderChanges(container);\n\n if(!isLocal) {\n !noMenuTab && category.elements.menuTab.classList.add('not-local');\n }\n\n return category;\n }\n\n protected positionCategory(category: Category, prepend?: boolean) {\n const {menuTab, container} = category.elements;\n const posItems = prepend ? this.localCategories.filter((category) => category.mounted).length : 0xFFFF;\n let foundMenuScroll = false;\n const posMenu = prepend ? this.localCategories.filter((category) => {\n if(category.menuScroll && !foundMenuScroll) {\n foundMenuScroll = true;\n return true;\n }\n\n return category.mounted && !category.menuScroll && category.elements.menuTab;\n }).length : 0xFFFF;\n positionElementByIndex(container, this.scrollable.container, posItems);\n positionElementByIndex(menuTab, this.menu, posMenu);\n }\n\n protected isCategoryVisible(category: Category) {\n return this.categoriesIntersector.getVisible().includes(category.elements.container);\n }\n\n protected toggleLocalCategory(category: Category, visible: boolean) {\n if(!visible) {\n category.elements.menuTab?.remove();\n category.elements.container.remove();\n } else {\n const idx = this.localCategories.indexOf(category);\n const sliced = this.localCategories.slice(0, idx);\n let notMountedItems = 0, notMountedMenus = 0;\n sliced.forEach((category) => {\n if(!category.mounted) {\n ++notMountedItems;\n ++notMountedMenus;\n } else if(!category.elements.menuTab || category.menuScroll) {\n ++notMountedMenus;\n }\n });\n const itemsIdx = idx - notMountedItems, menuIdx = idx - notMountedMenus;\n category.elements.menuTab && positionElementByIndex(category.elements.menuTab, this.menu, menuIdx);\n positionElementByIndex(category.elements.container, this.scrollable.container, itemsIdx);\n }\n\n category.mounted = visible;\n // category.elements.container.classList.toggle('hide', !visible);\n }\n\n protected createLocalCategory(id: string, title: LangPackKey | '', icon?: string, noMenuTab?: boolean) {\n const category = this.createCategory({id} as any, title && i18n(title), true, noMenuTab);\n category.local = true;\n this.localCategories.push(category);\n if(category.elements.title) {\n category.elements.title.classList.add('disable-hover');\n }\n\n if(!noMenuTab) {\n if(icon) {\n category.elements.menuTab.classList.add('tgico', 'tgico-' + icon);\n }\n\n category.elements.menuTabPadding.remove();\n }\n\n this.toggleLocalCategory(category, false);\n return category;\n }\n\n protected onLocalCategoryUpdate(category: Category) {\n category.setCategoryItemsHeight();\n this.toggleLocalCategory(category, !!category.items.length);\n }\n\n protected resizeCategories = () => {\n for(const [container, category] of this.categoriesMap) {\n category.setCategoryItemsHeight();\n }\n };\n\n protected deleteCategory(category: Category) {\n if(category) {\n category.elements.container.remove();\n category.elements.menuTab.remove();\n this.categoriesIntersector.unobserve(category.elements.container);\n delete this.categories[category.id];\n this.categoriesMap.delete(category.elements.container);\n this.categoriesByMenuTabMap.delete(category.elements.menuTab);\n\n return true;\n }\n\n return false;\n }\n\n protected spliceExceed(category: Category) {\n if(category.limit === undefined) {\n return false;\n }\n\n const {items, limit} = category;\n items.splice(limit, items.length - limit).forEach(({element}) => {\n element.remove();\n });\n\n this.onLocalCategoryUpdate(category);\n\n return true;\n }\n\n public init() {\n this.listenerSetter.add(emoticonsDropdown)('closed', () => {\n this.postponedEvents.forEach(({cb, args}) => {\n cb(...args);\n });\n\n this.postponedEvents.length = 0;\n });\n }\n\n public destroy() {\n this.getContainerSize = undefined;\n this.postponedEvents.length = 0;\n this.categoriesIntersector?.disconnect();\n this.listenerSetter.removeAll();\n this.scrollable.destroy();\n this.menuScroll?.destroy();\n this.menuOnClickResult?.stickyIntersector?.disconnect();\n }\n\n protected postponedEvent = (cb: (...args: K[]) => void) => {\n return (...args: K[]) => {\n if(emoticonsDropdown.isActive()) {\n this.postponedEvents.push({cb, args});\n } else {\n cb(...args);\n }\n };\n };\n}\n\ntype StickersTabItem = {element: HTMLElement, document: Document.document};\nexport default class StickersTab extends EmoticonsTabC> {\n private superStickerRenderer: SuperStickerRenderer;\n\n constructor(managers: AppManagers) {\n super(\n managers,\n 'super-stickers',\n () => mediaSizes.active.esgSticker,\n 3 * 2,\n 4,\n 4\n );\n\n this.container.classList.add('stickers-padding');\n this.content.id = 'content-stickers';\n }\n\n private setFavedLimit(limit: number) {\n const category = this.categories['faved'];\n category.limit = limit;\n }\n\n private categoryAppendStickers(\n category: StickersTabCategory,\n promise: Promise\n ) {\n const {container} = category.elements;\n\n promise.then((documents) => {\n const isVisible = this.isCategoryVisible(category);\n\n documents.forEach((document) => {\n const element = this.superStickerRenderer.renderSticker(document);\n category.items.push({document, element});\n\n if(isVisible) {\n category.elements.items.append(element);\n }\n });\n\n category.setCategoryItemsHeight();\n container.classList.remove('hide');\n });\n }\n\n private async renderStickerSet(set: StickerSet.stickerSet, prepend = false) {\n const category = this.createCategory(set, wrapEmojiText(set.title));\n const {menuTabPadding} = category.elements;\n\n const promise = this.managers.appStickersManager.getStickerSet(set);\n this.categoryAppendStickers(\n category,\n promise.then((stickerSet) => stickerSet.documents as MyDocument[])\n );\n\n this.positionCategory(category, prepend);\n\n wrapStickerSetThumb({\n set,\n container: menuTabPadding,\n group: EMOTICONSSTICKERGROUP,\n lazyLoadQueue: EmoticonsDropdown.lazyLoadQueue,\n width: 32,\n height: 32,\n autoplay: false\n });\n }\n\n private onCategoryVisibility = ({target, visible, entry}: OnVisibilityChangeItem) => {\n const category = this.categoriesMap.get(target);\n category.elements.items.replaceChildren(...(!visible ? [] : category.items.map(({element}) => element)));\n };\n\n public init() {\n super.init();\n\n this.scrollable.onAdditionalScroll = () => {\n this.setTyping();\n };\n\n /* stickersDiv.addEventListener('mouseover', (e) => {\n let target = e.target as HTMLElement;\n\n if(target.tagName === 'CANVAS') { // turn on sticker\n let animation = lottieLoader.getAnimation(target.parentElement, EMOTICONSSTICKERGROUP);\n\n if(animation) {\n // @ts-ignore\n if(animation.currentFrame === animation.totalFrames - 1) {\n animation.goToAndPlay(0, true);\n } else {\n animation.play();\n }\n }\n }\n }); */\n\n const intersectionOptions: IntersectionObserverInit = {root: emoticonsDropdown.getElement()};\n this.categoriesIntersector = new VisibilityIntersector(this.onCategoryVisibility, intersectionOptions);\n\n const clearCategoryItems = (category: StickersTabCategory) => {\n category.elements.items.replaceChildren();\n category.items.forEach(({element}) => this.superStickerRenderer.unobserveAnimated(element));\n category.items.length = 0;\n };\n\n this.scrollable.container.addEventListener('click', (e) => {\n const target = e.target as HTMLElement;\n if(findUpClassName(target, 'category-title')) {\n const container = findUpClassName(target, 'emoji-category');\n const category = this.categoriesMap.get(container);\n if(category.local) {\n return;\n }\n\n PopupElement.createPopup(PopupStickers, {id: category.set.id, access_hash: category.set.access_hash}).show();\n return;\n }\n\n EmoticonsDropdown.onMediaClick(e);\n });\n\n this.menuOnClickResult = EmoticonsDropdown.menuOnClick(this, this.menu, this.scrollable, this.menuScroll);\n\n const preloader = putPreloader(this.content, true);\n\n const onCategoryStickers = (category: StickersTabCategory, stickers: MyDocument[]) => {\n // if(category.id === 'faved' && category.limit && category.limit < stickers.length) {\n // category.limit = stickers.length;\n // }\n\n if(category.limit) {\n stickers = stickers.slice(0, category.limit);\n }\n\n const ids = new Set(stickers.map((doc) => doc.id));\n forEachReverse(category.items, (item) => {\n if(!ids.has(item.document.id)) {\n this.deleteSticker(category, item.document, true);\n }\n });\n\n this.toggleLocalCategory(category, !!stickers.length);\n forEachReverse(stickers, (doc, idx) => {\n this.unshiftSticker(category, doc, true, idx);\n });\n this.spliceExceed(category);\n category.elements.container.classList.remove('hide');\n };\n\n const favedCategory = this.createLocalCategory('faved', 'FavoriteStickers', 'savedmessages');\n // favedCategory.elements.menuTab.classList.add('active');\n\n const recentCategory = this.createLocalCategory('recent', 'Stickers.Recent', 'recent');\n recentCategory.limit = 20;\n\n const clearButton = ButtonIcon('close', {noRipple: true});\n recentCategory.elements.title.append(clearButton);\n attachClickEvent(clearButton, () => {\n confirmationPopup({\n titleLangKey: 'ClearRecentStickersAlertTitle',\n descriptionLangKey: 'ClearRecentStickersAlertMessage',\n button: {\n langKey: 'Clear'\n }\n }).then(() => {\n this.managers.appStickersManager.clearRecentStickers();\n }, noop);\n });\n\n const premiumCategory = this.createLocalCategory('premium', 'PremiumStickersShort');\n const s = document.createElement('span');\n s.classList.add('tgico-star', 'color-premium');\n premiumCategory.elements.menuTab.append(s);\n\n const promises = [\n Promise.all([\n this.managers.apiManager.getLimit('favedStickers'),\n this.managers.appStickersManager.getFavedStickersStickers()\n ]).then(([limit, stickers]) => {\n this.setFavedLimit(limit);\n onCategoryStickers(favedCategory, stickers);\n }),\n\n this.managers.appStickersManager.getRecentStickersStickers().then((stickers) => {\n onCategoryStickers(recentCategory, stickers);\n }),\n\n this.managers.appStickersManager.getAllStickers().then((res) => {\n for(const set of (res as MessagesAllStickers.messagesAllStickers).sets) {\n this.renderStickerSet(set);\n }\n }),\n\n this.managers.appStickersManager.getPremiumStickers().then((stickers) => {\n const length = stickers.length;\n this.toggleLocalCategory(premiumCategory, rootScope.premium && !!length);\n this.categoryAppendStickers(premiumCategory, Promise.resolve(stickers));\n\n rootScope.addEventListener('premium_toggle', (isPremium) => {\n this.toggleLocalCategory(this.categories['premium'], isPremium && !!length);\n });\n })\n ];\n\n Promise.race(promises).finally(() => {\n preloader.remove();\n });\n\n Promise.all(promises).finally(() => {\n this.mounted = true;\n this.setTyping();\n\n const favedCategory = this.categories['faved'];\n const recentCategory = this.categories['recent'];\n this.menuOnClickResult.setActive(favedCategory.items.length ? favedCategory : recentCategory);\n\n rootScope.addEventListener('stickers_installed', (set) => {\n if(!this.categories[set.id]) {\n this.renderStickerSet(set, true);\n }\n });\n });\n\n this.superStickerRenderer = new SuperStickerRenderer(EmoticonsDropdown.lazyLoadQueue, EMOTICONSSTICKERGROUP, this.managers, intersectionOptions);\n\n const rendererLazyLoadQueue = this.superStickerRenderer.lazyLoadQueue;\n emoticonsDropdown.addLazyLoadQueueRepeat(rendererLazyLoadQueue, this.superStickerRenderer.processInvisible);\n\n // emoticonsDropdown.addEventListener('close', () => {\n // this.categoriesIntersector.lock();\n // });\n\n // emoticonsDropdown.addEventListener('closed', () => {\n // for(const [container] of this.categoriesMap) {\n // onCategoryVisibility(container, false);\n // }\n // });\n\n // emoticonsDropdown.addEventListener('opened', () => {\n // this.categoriesIntersector.unlockAndRefresh();\n // });\n\n // setInterval(() => {\n // // @ts-ignore\n // const players = Object.values(lottieLoader.players).filter((p) => p.width >= 80);\n\n // console.log(\n // 'STICKERS RENDERED IN PANEL:',\n // players.length,\n // players.filter((p) => !p.paused).length,\n // rendererLazyLoadQueue.intersector.getVisible().length\n // );\n // }, .25e3);\n\n rootScope.addEventListener('sticker_updated', ({type, document, faved}) => {\n // if(type === 'faved') {\n // return;\n // }\n\n const category = this.categories[type === 'faved' ? 'faved' : 'recent'];\n if(category) {\n if(faved) {\n this.unshiftSticker(category, document);\n } else {\n this.deleteSticker(category, document);\n }\n }\n });\n\n rootScope.addEventListener('stickers_deleted', ({id}) => {\n const category = this.categories[id];\n if(this.deleteCategory(category)) {\n clearCategoryItems(category);\n }\n });\n\n rootScope.addEventListener('stickers_top', this.postponedEvent((id) => {\n const category = this.categories[id];\n if(category) {\n this.positionCategory(category, true);\n emoticonsDropdown.addEventListener('openAfterLayout', () => {\n this.menuOnClickResult.setActiveStatic(category);\n }, {once: true});\n }\n }));\n\n rootScope.addEventListener('stickers_order', ({type, order}) => {\n if(type !== 'stickers') {\n return;\n }\n\n order.forEach((id) => {\n const category = this.categories[id];\n if(category) {\n this.positionCategory(category, false);\n }\n });\n });\n\n rootScope.addEventListener('stickers_updated', ({type, stickers}) => {\n const category = this.categories[type === 'faved' ? 'faved' : 'recent'];\n if(category) {\n onCategoryStickers(category, stickers);\n }\n });\n\n rootScope.addEventListener('app_config', () => {\n this.managers.apiManager.getLimit('favedStickers').then((limit) => {\n this.setFavedLimit(limit);\n });\n });\n\n mediaSizes.addEventListener('resize', this.resizeCategories);\n\n attachStickerViewerListeners({listenTo: this.content, listenerSetter: new ListenerSetter()});\n\n const type: IgnoreMouseOutType = 'menu';\n createStickersContextMenu({\n listenTo: this.content,\n verifyRecent: (target) => !!findUpAsChild(target, this.categories['recent'].elements.items),\n onOpen: () => {\n emoticonsDropdown.setIgnoreMouseOut(type, true);\n },\n onClose: () => {\n emoticonsDropdown.setIgnoreMouseOut(type, false);\n }\n });\n\n this.init = null;\n }\n\n public deleteSticker(category: StickersTabCategory, doc: MyDocument, batch?: boolean) {\n const item = findAndSplice(category.items, (item) => item.document.id === doc.id);\n if(item) {\n item.element.remove();\n\n if(!batch) {\n this.onLocalCategoryUpdate(category);\n }\n }\n }\n\n public unshiftSticker(category: StickersTabCategory, doc: MyDocument, batch?: boolean, idx?: number) {\n if(idx !== undefined) {\n const i = category.items[idx];\n if(i && i.document.id === doc.id) {\n return;\n }\n }\n\n let item = findAndSplice(category.items, (item) => item.document.id === doc.id);\n if(!item) {\n item = {\n element: this.superStickerRenderer.renderSticker(doc),\n document: doc\n };\n }\n\n category.items.unshift(item);\n category.elements.items.prepend(item.element);\n\n if(!batch) {\n this.spliceExceed(category);\n }\n }\n\n public unshiftRecentSticker(doc: MyDocument) {\n this.managers.appStickersManager.saveRecentSticker(doc.id);\n }\n\n public deleteRecentSticker(doc: MyDocument) {\n this.managers.appStickersManager.saveRecentSticker(doc.id, true);\n }\n\n public setTyping = (cancel = false) => {\n if(!cancel && (!emoticonsDropdown.isActive() || emoticonsDropdown.tab !== this)) {\n return;\n }\n\n rootScope.dispatchEvent('choosing_sticker', !cancel);\n };\n\n public onClosed() {\n this.setTyping(true);\n }\n\n public onOpened() {\n this.setTyping();\n this.resizeCategories();\n }\n}\n","export const generateDelimiter = () => {\n const delimiter = document.createElement('div');\n delimiter.classList.add('gradient-delimiter');\n return delimiter;\n};\n","import {_i18n} from '../lib/langPack';\n\nexport default function generateFakeIcon(isScam?: boolean) {\n const span = document.createElement('span');\n span.classList.add('badge-fake');\n _i18n(span, isScam ? 'ScamMessage' : 'FakeMessage');\n return span;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport findAndSpliceAll from '../helpers/array/findAndSpliceAll';\nimport LazyLoadQueueIntersector, {LazyLoadElement} from './lazyLoadQueueIntersector';\nimport VisibilityIntersector, {OnVisibilityChange} from './visibilityIntersector';\n\nexport default class LazyLoadQueueRepeat2 extends LazyLoadQueueIntersector {\n constructor(parallelLimit?: number, protected onVisibilityChange?: OnVisibilityChange) {\n super(parallelLimit);\n\n this.intersector = new VisibilityIntersector((item) => {\n const {target, visible} = item;\n const spliced = findAndSpliceAll(this.queue, (i) => i.div === target);\n if(visible && spliced.length) {\n spliced.forEach((item) => {\n this.queue.unshift(item);\n });\n }\n\n this.onVisibilityChange && this.onVisibilityChange(item);\n this.setProcessQueueTimeout();\n });\n }\n\n public observe(el: LazyLoadElement) {\n super.observe(el);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../lib/appManagers/appDocsManager';\nimport animationIntersector, {AnimationItemGroup} from './animationIntersector';\nimport Scrollable from './scrollable';\nimport deferredPromise, {CancellablePromise} from '../helpers/cancellablePromise';\nimport calcImageInBox from '../helpers/calcImageInBox';\nimport {doubleRaf} from '../helpers/schedulers';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport rootScope from '../lib/rootScope';\nimport LazyLoadQueueRepeat2 from './lazyLoadQueueRepeat2';\nimport wrapVideo from './wrappers/video';\nimport noop from '../helpers/noop';\n\nconst width = 400;\nconst maxSingleWidth = width - 100;\nconst height = 100;\n\nexport default class GifsMasonry {\n public lazyLoadQueue: LazyLoadQueueRepeat2;\n private scrollPromise: CancellablePromise = Promise.resolve();\n private timeout: number = 0;\n private managers: AppManagers;\n\n constructor(\n private element: HTMLElement,\n private group: AnimationItemGroup,\n private scrollable: Scrollable,\n attach = true\n ) {\n this.managers = rootScope.managers;\n\n this.lazyLoadQueue = new LazyLoadQueueRepeat2(undefined, ({target, visible}) => {\n if(visible) {\n this.processVisibleDiv(target);\n } else {\n this.processInvisibleDiv(target);\n }\n });\n\n /* setInterval(() => {\n // @ts-ignore\n const players = animationIntersector.byGroups[group];\n\n if(players) {\n console.log(`GIFS RENDERED IN ${group}:`, players.length, players.filter((p) => !p.animation.paused).length, this.lazyLoadQueue.intersector.getVisible().length);\n }\n }, .25e3); */\n\n if(attach) {\n this.attach();\n }\n }\n\n private onScroll = () => {\n if(this.timeout) {\n clearTimeout(this.timeout);\n } else {\n this.scrollPromise = deferredPromise();\n // animationIntersector.checkAnimations(true, group);\n }\n\n this.timeout = window.setTimeout(() => {\n this.timeout = 0;\n this.scrollPromise.resolve();\n // animationIntersector.checkAnimations(false, group);\n }, 150);\n };\n\n public attach() {\n this.scrollable.container.addEventListener('scroll', this.onScroll);\n }\n\n public detach() {\n this.clear();\n this.scrollable.container.removeEventListener('scroll', this.onScroll);\n }\n\n public clear() {\n this.lazyLoadQueue.clear();\n }\n\n private processVisibleDiv(div: HTMLElement) {\n const video = div.querySelector('video');\n if(video) {\n return;\n }\n\n const load = () => {\n const docId = div.dataset.docId;\n const promise = Promise.all([this.managers.appDocsManager.getDoc(docId), this.scrollPromise]).then(async([doc]) => {\n const res = await wrapVideo({\n doc,\n container: div as HTMLDivElement,\n lazyLoadQueue: null,\n // lazyLoadQueue: EmoticonsDropdown.lazyLoadQueue,\n group: this.group,\n noInfo: true,\n noPreview: true\n });\n\n const promise = res.loadPromise;\n promise.finally(() => {\n const video = div.querySelector('video');\n const thumb = div.querySelector('img, canvas');\n\n // div.style.opacity = '';\n thumb && thumb.classList.add('hide');\n\n if(video && !video.parentElement) {\n setTimeout(() => {\n video.src = '';\n video.load();\n const animations = animationIntersector.getAnimations(video);\n animations.forEach((item) => {\n animationIntersector.removeAnimation(item);\n });\n }, 0);\n }\n\n // clearTimeout(timeout);\n if(!this.lazyLoadQueue.intersector.isVisible(div)) {\n this.processInvisibleDiv(div);\n }\n });\n\n return promise;\n });\n\n /* let timeout = window.setTimeout(() => {\n console.error('processVisibleDiv timeout', div, doc);\n }, 1e3); */\n\n return promise;\n };\n\n // return load();\n\n this.lazyLoadQueue.push({div, load});\n }\n\n public processInvisibleDiv = (div: HTMLElement) => {\n return this.scrollPromise.then(async() => {\n // return;\n\n if(this.lazyLoadQueue.intersector.isVisible(div)) {\n return;\n }\n\n const video = div.querySelector('video');\n const thumb = div.querySelector('img, canvas');\n\n if(thumb) {\n thumb.classList.remove('hide');\n\n await doubleRaf();\n }\n\n if(this.lazyLoadQueue.intersector.isVisible(div)) {\n return;\n }\n\n if(video) {\n video.remove();\n video.src = '';\n video.load();\n const animations = animationIntersector.getAnimations(video);\n animations.forEach((item) => {\n animationIntersector.removeAnimation(item);\n });\n }\n });\n };\n\n public add(doc: MyDocument, appendTo = this.element) {\n // let gifWidth = doc.w;\n // let gifHeight = doc.h;\n // if(gifHeight < height) {\n // gifWidth = height / gifHeight * gifWidth;\n // gifHeight = height;\n // }\n\n // const willUseWidth = Math.min(maxSingleWidth, width, gifWidth);\n // const size = calcImageInBox(gifWidth, gifHeight, willUseWidth, height);\n\n const div = document.createElement('div');\n div.classList.add('gif', 'grid-item'/* , 'fade-in-transition' */);\n // div.style.width = size.width + 'px';\n // div.style.opacity = '0';\n // div.style.height = h + 'px';\n div.dataset.docId = '' + doc.id;\n\n appendTo.append(div);\n\n this.lazyLoadQueue.observe({div, load: noop as any});\n\n // let preloader = new ProgressivePreloader(div);\n\n wrapVideo({\n doc,\n container: div as HTMLDivElement,\n lazyLoadQueue: null,\n noInfo: true,\n onlyPreview: true\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport TransitionSlider from './transition';\nimport {ScrollableX} from './scrollable';\nimport rootScope from '../lib/rootScope';\nimport {fastRaf} from '../helpers/schedulers';\nimport {FocusDirection} from '../helpers/fastSmoothScroll';\nimport findUpAsChild from '../helpers/dom/findUpAsChild';\nimport whichChild from '../helpers/dom/whichChild';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport liteMode from '../helpers/liteMode';\n\nexport function horizontalMenu(\n tabs: HTMLElement,\n content: HTMLElement,\n onClick?: (id: number, tabContent: HTMLDivElement, animate: boolean) => void | boolean | Promise,\n onTransitionEnd?: () => void,\n transitionTime = 200,\n scrollableX?: ScrollableX,\n listenerSetter?: ListenerSetter\n) {\n const selectTab = TransitionSlider({\n content,\n type: tabs || content.dataset.animation === 'tabs' ? 'tabs' : 'navigation',\n transitionTime,\n onTransitionEnd,\n listenerSetter\n });\n\n if(!tabs) {\n return selectTab;\n }\n\n const proxy = new Proxy(selectTab, {\n apply: (target, that, args) => {\n const id = +args[0];\n const animate = args[1] !== undefined ? args[1] : true;\n\n const el = (tabs.querySelector(`[data-tab=\"${id}\"]`) || tabs.children[id]) as HTMLElement;\n selectTarget(el, id, animate);\n }\n });\n\n const selectTarget = async(target: HTMLElement, id: number, animate = true) => {\n const tabContent = content.children[id] as HTMLDivElement;\n\n if(onClick) {\n const result1 = onClick(id, tabContent, animate);\n const canChange = result1 instanceof Promise ? await result1 : result1;\n if(canChange !== undefined && !canChange) {\n return;\n }\n }\n\n if(scrollableX) {\n scrollableX.scrollIntoViewNew({\n element: target.parentElement.children[id] as HTMLElement,\n position: 'center',\n forceDirection: animate ? undefined : FocusDirection.Static,\n forceDuration: transitionTime,\n axis: 'x'\n });\n }\n\n if(!liteMode.isAvailable('animations')) {\n animate = false;\n }\n\n const prevId = selectTab.prevId();\n if(target.classList.contains('active') || id === prevId) {\n return false;\n }\n\n const mutateCallback = animate ? fastRaf : (cb: () => void) => cb();\n\n const prev = tabs.querySelector(tagName.toLowerCase() + '.active') as HTMLElement;\n if(prev) {\n mutateCallback(() => {\n prev.classList.remove('active');\n });\n }\n\n // a great stripe from Jolly Cobra\n if(useStripe && prevId !== -1 && animate) {\n mutateCallback(() => {\n const indicator = target.querySelector('i')!;\n const currentIndicator = target.parentElement.children[prevId].querySelector('i')!;\n\n currentIndicator.classList.remove('animate');\n indicator.classList.remove('animate');\n\n // We move and resize our indicator so it repeats the position and size of the previous one.\n const shiftLeft = currentIndicator.parentElement.parentElement.offsetLeft - indicator.parentElement.parentElement.offsetLeft;\n const scaleFactor = currentIndicator.clientWidth / indicator.clientWidth;\n indicator.style.transform = `translate3d(${shiftLeft}px, 0, 0) scale3d(${scaleFactor}, 1, 1)`;\n\n // console.log(`translate3d(${shiftLeft}px, 0, 0) scale3d(${scaleFactor}, 1, 1)`);\n\n fastRaf(() => {\n // Now we remove the transform to let it animate to its own position and size.\n indicator.classList.add('animate');\n indicator.style.transform = 'none';\n });\n });\n }\n\n mutateCallback(() => {\n target.classList.add('active');\n });\n\n selectTab(id, animate);\n };\n\n const useStripe = !tabs.classList.contains('no-stripe');\n\n // const tagName = tabs.classList.contains('menu-horizontal-div') ? 'BUTTON' : 'LI';\n const tagName = tabs.firstElementChild.tagName;\n attachClickEvent(tabs, (e) => {\n let target = e.target as HTMLElement;\n\n target = findUpAsChild(target, tabs);\n\n // console.log('tabs click:', target);\n\n if(!target) return false;\n\n let id: number;\n if(target.dataset.tab) {\n id = +target.dataset.tab;\n if(id === -1) {\n return false;\n }\n } else {\n id = whichChild(target);\n }\n\n selectTarget(target, id);\n }, {listenerSetter});\n\n return proxy;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport simulateEvent from '../helpers/dom/dispatchEvent';\nimport documentFragmentToHTML from '../helpers/dom/documentFragmentToHTML';\nimport findUpAttribute from '../helpers/dom/findUpAttribute';\nimport findUpTag from '../helpers/dom/findUpTag';\nimport getCaretPosNew from '../helpers/dom/getCaretPosNew';\nimport getRichValueWithCaret from '../helpers/dom/getRichValueWithCaret';\nimport isInputEmpty from '../helpers/dom/isInputEmpty';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport RichInputHandler, {USING_BOMS} from '../helpers/dom/richInputHandler';\nimport selectElementContents from '../helpers/dom/selectElementContents';\nimport setInnerHTML, {setDirection} from '../helpers/dom/setInnerHTML';\nimport {MessageEntity} from '../layer';\nimport {i18n, LangPackKey, _i18n} from '../lib/langPack';\nimport {NULL_PEER_ID} from '../lib/mtproto/mtproto_config';\nimport mergeEntities from '../lib/richTextProcessor/mergeEntities';\nimport parseEntities from '../lib/richTextProcessor/parseEntities';\nimport wrapDraftText from '../lib/richTextProcessor/wrapDraftText';\nimport {createCustomFiller, CustomEmojiElement, CustomEmojiRendererElement, insertCustomFillers, renderEmojis} from '../lib/richTextProcessor/wrapRichText';\n\nexport async function insertRichTextAsHTML(input: HTMLElement, text: string, entities: MessageEntity[], wrappingForPeerId: PeerId) {\n const loadPromises: Promise[] = [];\n const wrappingCustomEmoji = entities?.some((entity) => entity._ === 'messageEntityCustomEmoji');\n const renderer = wrappingCustomEmoji ? createCustomEmojiRendererForInput() : undefined;\n const fragment = wrapDraftText(text, {entities, wrappingForPeerId, loadPromises, customEmojiRenderer: renderer});\n const something = fragment.querySelectorAll('[contenteditable=\"false\"]');\n something.forEach((el) => {\n el.contentEditable = 'inherit';\n el.classList.add('pc');\n });\n\n loadPromises.length && await Promise.all(loadPromises);\n\n fragment.querySelectorAll('.input-selectable').forEach((el) => {\n el.prepend(createCustomFiller(true));\n });\n\n const richInputHandler = USING_BOMS ? RichInputHandler.getInstance() : undefined;\n // const restore = richInputHandler.prepareApplyingMarkdown();\n\n // fragment.querySelectorAll('.input-filler').forEach((el) => el.remove());\n\n // const fillers = Array.from(input.querySelectorAll('.input-filler')).map((el) => {\n // el.contentEditable = 'false';\n // return el;\n // });\n\n const customEmojiElements = Array.from(fragment.querySelectorAll('.custom-emoji-placeholder')).map((el) => {\n el.dataset.ces = '1';\n return (el as any).customEmojiElement as CustomEmojiElement;\n });\n\n const html = documentFragmentToHTML(fragment);\n renderer?.destroy();\n\n // console.log(html);\n\n const pre = getCaretPosNew(input);\n // console.log('pre', pre);\n let textNode: ChildNode, textNodeValue: string;\n if(pre.node) {\n // if(pre.node?.nodeValue === BOM && false) {\n // textNode = document.createTextNode(textNodeValue = BOM);\n // (pre.node.parentNode as any as ChildNode).after(textNode);\n // pre.selection.modify('extend', 'forward', 'character');\n // pre.selection.collapseToEnd();\n // }\n } else {\n const range = document.createRange();\n let node = input.lastChild;\n if(!node) {\n input.append(node /* = textNode */ = document.createTextNode(''));\n }\n\n range.setStartAfter(node);\n range.collapse(true);\n pre.selection.removeAllRanges();\n pre.selection.addRange(range);\n }\n\n // const fragmentLastChild = fragment.lastChild;\n\n // const s = document.createElement('span');\n // (node as ChildNode).replaceWith(s);\n // s.append(node);\n input.addEventListener('input', cancelEvent, {capture: true, once: true, passive: false});\n richInputHandler?.onBeforeInput({inputType: 'insertContent'});\n window.document.execCommand('insertHTML', false, html);\n Array.from(input.querySelectorAll('[data-ces]')).forEach((el, idx) => {\n delete el.dataset.ces;\n const customEmojiElement = customEmojiElements[idx];\n (el as any).customEmojiElement = customEmojiElement;\n customEmojiElement.placeholder = el;\n });\n // fillers.forEach((el) => {\n // el.contentEditable = 'inherit';\n // });\n input.querySelectorAll('.pc').forEach((el) => {\n el.contentEditable = 'false';\n });\n if(textNode) {\n const {nodeValue} = textNode;\n if(nodeValue === textNodeValue) {\n textNode.remove();\n } else {\n (textNode as CharacterData).replaceData(nodeValue.indexOf(textNodeValue), textNodeValue.length, '');\n }\n }\n // restore();\n richInputHandler?.removeExtraBOMs(input);\n simulateEvent(input, 'input');\n\n // if(textNode) {\n // const selection = document.getSelection();\n // const node = fragmentLastChild.nextSibling || fragmentLastChild;\n // const range = document.createRange();\n // range.setStartAfter(node);\n // range.collapse(true);\n // selection.removeAllRanges();\n // selection.addRange(range);\n // }\n\n // const after = getCaretPosNew(input);\n // console.log('after', after);\n // if(after.node?.nodeValue === BOM) {\n // const smth = findUpClassName(after.node.parentElement, 'input-something');\n // if(smth) {\n // const selection = document.getSelection();\n // const node = smth.nextSibling;\n // const range = document.createRange();\n // range.setStartAfter(node);\n // range.collapse(true);\n // selection.removeAllRanges();\n // selection.addRange(range);\n\n // // if(after.offset === 0) after.selection.modify('extend', 'forward', 'character');\n // // after.selection.modify('extend', 'forward', 'character');\n // // after.selection.collapseToEnd();\n // }\n // }\n\n // setCaretAt(fragmentLastChild.nextSibling);\n\n // console.log('ASD');\n}\n\nlet init = () => {\n document.addEventListener('paste', (e) => {\n const input = findUpAttribute(e.target, 'contenteditable=\"true\"');\n if(!input) {\n return;\n }\n\n const noLinebreaks = !!input.dataset.noLinebreaks;\n e.preventDefault();\n let text: string, entities: MessageEntity[];\n\n // @ts-ignore\n let plainText: string = (e.originalEvent || e).clipboardData.getData('text/plain');\n let usePlainText = true;\n\n // @ts-ignore\n let html: string = (e.originalEvent || e).clipboardData.getData('text/html');\n\n const filterEntity = (e: MessageEntity) => e._ === 'messageEntityEmoji' || (e._ === 'messageEntityLinebreak' && !noLinebreaks);\n if(noLinebreaks) {\n const regExp = /[\\r\\n]/g;\n plainText = plainText.replace(regExp, '');\n html = html.replace(regExp, '');\n }\n\n const peerId = (input.dataset.peerId || NULL_PEER_ID).toPeerId();\n if(html.trim()) {\n // console.log(html.replace(/ (style|class|id)=\".+?\"/g, ''));\n\n html = html.replace(//, '');\n html = html.replace(//, '');\n html = html.replace('
', '');\n\n const match = html.match(/([\\s\\S]*)<\\/body>/);\n if(match) {\n html = match[1].trim();\n }\n\n // const s = cleanHTML(html, true) as NodeList;\n // console.log(s);\n\n const parser = new DOMParser();\n const doc = parser.parseFromString(html, 'text/html');\n const span = doc.body || document.createElement('body');\n\n // const span: HTMLElement = document.createElement('span');\n // span.innerHTML = html;\n // span.append(...Array.from(s));\n\n let curChild = span.firstChild;\n while(curChild) { // * fix whitespace between elements like

asd

\\n

zxc

\n const nextSibling = curChild.nextSibling;\n if(curChild.nodeType === curChild.TEXT_NODE) {\n if(!curChild.nodeValue.trim()) {\n curChild.remove();\n }\n }\n\n curChild = nextSibling;\n }\n\n const richValue = getRichValueWithCaret(span, true, false);\n\n const canWrapCustomEmojis = !!peerId;\n if(!canWrapCustomEmojis) {\n richValue.entities = richValue.entities.filter((entity) => entity._ !== 'messageEntityCustomEmoji');\n }\n\n /* if(false) */ { // * fix extra new lines appearing from

(can have them from some sources, like macOS Terminal)\n const lines = richValue.value.split('\\n');\n let textLength = 0;\n for(let lineIndex = 0; lineIndex < lines.length; ++lineIndex) {\n const line = lines[lineIndex];\n textLength += line.length;\n\n const index = textLength;\n if(plainText[index] !== '\\n' && lineIndex !== (lines.length - 1)) {\n const nextLine = lines.splice(lineIndex + 1, 1)[0];\n lines[lineIndex] = line + nextLine;\n\n // fix entities\n richValue.entities.forEach((entity) => {\n if(entity.offset >= index) {\n entity.offset -= 1;\n }\n });\n\n textLength += nextLine.length;\n }\n\n textLength += 1;\n }\n\n const correctedText = lines.join('\\n');\n richValue.value = correctedText;\n }\n\n const richTextLength = richValue.value.replace(/\\s/g, '').length;\n const plainTextLength = plainText.replace(/\\s/g, '').length;\n if(richTextLength === plainTextLength ||\n richValue.entities.find((entity) => entity._ === 'messageEntityCustomEmoji')) {\n text = richValue.value;\n entities = richValue.entities;\n usePlainText = false;\n\n let entities2 = parseEntities(text);\n entities2 = entities2.filter(filterEntity);\n mergeEntities(entities, entities2);\n }\n\n // console.log('usePlainText', usePlainText);\n }\n\n if(usePlainText) {\n text = plainText;\n entities = parseEntities(text);\n entities = entities.filter(filterEntity);\n }\n\n insertRichTextAsHTML(input, text, entities, peerId);\n });\n\n init = null;\n};\n\n// ! it doesn't respect symbols other than strongs\n/* const checkAndSetRTL = (input: HTMLElement) => {\n //const isEmpty = isInputEmpty(input);\n //console.log('input', isEmpty);\n\n //const char = [...getRichValue(input)][0];\n const char = (input instanceof HTMLInputElement ? input.value : input.innerText)[0];\n let direction = 'ltr';\n if(char && checkRTL(char)) {\n direction = 'rtl';\n }\n\n //console.log('RTL', direction, char);\n\n input.style.direction = direction;\n}; */\n\nexport enum InputState {\n Neutral = 0,\n Valid = 1,\n Error = 2\n};\n\nexport type InputFieldOptions = {\n placeholder?: LangPackKey,\n label?: LangPackKey,\n labelOptions?: any[],\n labelText?: string | DocumentFragment,\n name?: string,\n maxLength?: number,\n showLengthOn?: number,\n plainText?: true,\n required?: boolean,\n canBeEdited?: boolean,\n validate?: () => boolean,\n inputMode?: 'tel' | 'numeric',\n withLinebreaks?: boolean,\n autocomplete?: string\n};\n\nfunction createCustomEmojiRendererForInput() {\n const renderer = CustomEmojiRendererElement.create({\n wrappingDraft: true,\n isSelectable: true\n });\n return renderer;\n}\n\nfunction processCustomEmojisInInput(input: HTMLElement) {\n const customEmojiElements = Array.from(input.querySelectorAll('.custom-emoji, .custom-emoji-placeholder'));\n let renderer = input.querySelector('.custom-emoji-renderer');\n if(!renderer && customEmojiElements.length) {\n renderer = createCustomEmojiRendererForInput();\n input.prepend(renderer);\n } else if(renderer && !customEmojiElements.length) {\n renderer.remove();\n return;\n }\n\n if(!renderer) {\n return;\n }\n\n const customEmojis: Parameters[0] = new Map();\n customEmojiElements.forEach((element) => {\n const customEmojiElement = element instanceof CustomEmojiElement ? element : (element as any).customEmojiElement as CustomEmojiElement;\n const {docId} = customEmojiElement;\n let set = customEmojis.get(docId);\n if(!set) {\n customEmojis.set(docId, set = new Set());\n }\n\n set.add(customEmojiElement);\n });\n\n for(const [docId, customEmojiElements] of customEmojis) {\n let hasSet = renderer.customEmojis.get(docId);\n if(hasSet) {\n for(const customEmojiElement of hasSet) {\n if(!customEmojiElements.has(customEmojiElement)) {\n customEmojiElement.destroy();\n }\n }\n } else {\n hasSet = new Set();\n }\n\n for(const customEmojiElement of customEmojiElements) {\n if(!hasSet.has(customEmojiElement)) {\n customEmojiElement.connectedCallback();\n }\n }\n }\n\n renderer.add(customEmojis, false);\n renderer.forceRender();\n}\n\nexport default class InputField {\n public container: HTMLElement;\n public input: HTMLElement;\n public label: HTMLLabelElement;\n\n public originalValue: string;\n\n public required: boolean;\n public validate: () => boolean;\n\n constructor(public options: InputFieldOptions = {}) {\n this.container = document.createElement('div');\n this.container.classList.add('input-field');\n\n this.required = options.required;\n this.validate = options.validate;\n\n if(options.maxLength !== undefined && options.showLengthOn === undefined) {\n options.showLengthOn = Math.min(40, Math.round(options.maxLength / 3));\n }\n\n const {placeholder, maxLength, showLengthOn, name, plainText, canBeEdited = true, autocomplete} = options;\n const label = options.label || options.labelText;\n\n const onInputCallbacks: Array<() => void> = [];\n let input: HTMLElement;\n if(!plainText) {\n if(init) {\n init();\n }\n\n this.container.innerHTML = `

`;\n\n input = this.container.firstElementChild as HTMLElement;\n input.contentEditable = '' + !!canBeEdited;\n // const observer = new MutationObserver(() => {\n // //checkAndSetRTL(input);\n\n // if(processInput) {\n // processInput();\n // }\n // });\n\n RichInputHandler.getInstance();\n\n input.addEventListener('mousedown', (e) => {\n const selection = document.getSelection();\n if(!selection.isCollapsed) {\n return;\n }\n\n const placeholder = findUpTag(e.target, 'IMG');\n if(!placeholder) {\n return;\n }\n\n const rect = placeholder.getBoundingClientRect();\n const centerX = rect.left + rect.width / 2;\n const focusOnNext = e.clientX >= centerX;\n\n const range = document.createRange();\n range.setStartAfter(focusOnNext ? placeholder : placeholder.previousSibling ?? placeholder);\n selection.removeAllRanges();\n selection.addRange(range);\n });\n\n onInputCallbacks.push(() => {\n // console.log('input');\n // return;\n // * because if delete all characters there will br left\n if(isInputEmpty(input)) {\n // const textNode = Array.from(input.childNodes).find((node) => node.nodeType === node.TEXT_NODE) || document.createTextNode('');\n input.replaceChildren();\n // input.append(document.createTextNode('')); // need first text node to support history stack\n }\n\n // const fillers = Array.from(input.querySelectorAll('.emoji-filler')) as HTMLElement[];\n // fillers.forEach((filler) => {\n // const textContent = filler.textContent;\n // if(textContent === BOM) {\n // return;\n // }\n\n // if(textContent) {\n\n // } else {\n // let curChild = filler.firstChild;\n // while(curChild) {\n // curChild = curChild.nextSibling;\n // }\n // }\n\n // filler.classList.remove('emoji-filler');\n // });\n\n // Array.from(input.querySelectorAll('br, span:empty')).forEach((el) => {\n // const parentElement = el.parentElement;\n // (parentElement === input ? el : parentElement).remove();\n // });\n USING_BOMS && Array.from(input.querySelectorAll('br:not(.br-not-br)')).forEach((el) => {\n // const parentElement = el.parentElement;\n el.remove();\n // if(!parentElement.children.length && !parentElement.textContent) {\n // parentElement.textContent = '';\n // }\n });\n\n insertCustomFillers(Array.from(input.querySelectorAll('.input-something')));\n\n processCustomEmojisInInput(input);\n\n // .forEach((el) => el.remove());\n });\n\n // ! childList for paste first symbol\n // observer.observe(input, {characterData: true, childList: true, subtree: true});\n } else {\n this.container.innerHTML = `\n \n `;\n\n input = this.container.firstElementChild as HTMLElement;\n // input.addEventListener('input', () => checkAndSetRTL(input));\n }\n\n setDirection(input);\n\n if(options.inputMode) {\n input.inputMode = options.inputMode;\n }\n\n if(placeholder) {\n _i18n(input, placeholder, undefined, 'placeholder');\n }\n\n if(label || placeholder) {\n const border = document.createElement('div');\n border.classList.add('input-field-border');\n this.container.append(border);\n }\n\n if(label) {\n this.label = document.createElement('label');\n this.setLabel();\n this.container.append(this.label);\n }\n\n if(maxLength) {\n const labelEl = this.container.lastElementChild as HTMLLabelElement;\n let showingLength = false;\n\n const onInput = () => {\n const wasError = input.classList.contains('error');\n // * https://stackoverflow.com/a/54369605 #2 to count emoji as 1 symbol\n const inputLength = plainText ? (input as HTMLInputElement).value.length : [...getRichValueWithCaret(input, false, false).value].length;\n const diff = maxLength - inputLength;\n const isError = diff < 0;\n input.classList.toggle('error', isError);\n\n // this.onLengthChange && this.onLengthChange(inputLength, isError);\n\n if(isError || diff <= showLengthOn) {\n this.setLabel();\n labelEl.append(` (${maxLength - inputLength})`);\n if(!showingLength) showingLength = true;\n } else if((wasError && !isError) || showingLength) {\n this.setLabel();\n showingLength = false;\n }\n };\n\n onInputCallbacks.push(onInput);\n }\n\n const noLinebreaks = !options.withLinebreaks;\n if(noLinebreaks && !plainText) {\n input.dataset.noLinebreaks = '1';\n input.addEventListener('keypress', (e) => {\n if(e.key === 'Enter') {\n e.preventDefault();\n return false;\n }\n });\n }\n\n if(onInputCallbacks.length) {\n input.addEventListener('input', () => {\n onInputCallbacks.forEach((callback) => callback());\n });\n }\n\n this.input = input;\n }\n\n public select() {\n if(!this.value) { // * avoid selecting whole empty field on iOS devices\n return;\n }\n\n if(this.options.plainText) {\n (this.input as HTMLInputElement).select(); // * select text\n } else {\n selectElementContents(this.input);\n }\n }\n\n public setLabel() {\n this.label.textContent = '';\n if(this.options.labelText) {\n setInnerHTML(this.label, this.options.labelText);\n } else {\n this.label.append(i18n(this.options.label, this.options.labelOptions));\n }\n }\n\n get value(): string {\n return this.options.plainText ? (this.input as HTMLInputElement).value : getRichValueWithCaret(this.input, false, false).value;\n // return getRichValue(this.input);\n }\n\n set value(value: Parameters[1]) {\n this.setValueSilently(value, true);\n this.simulateInputEvent();\n }\n\n public simulateInputEvent() {\n simulateEvent(this.input, 'input');\n }\n\n public setValueSilently(value: Parameters[1], fromSet?: boolean) {\n if(this.options.plainText) {\n (this.input as HTMLInputElement).value = value as string;\n } else {\n replaceContent(this.input, value);\n processCustomEmojisInInput(this.input);\n }\n }\n\n public isChanged() {\n return this.value !== this.originalValue;\n }\n\n public isValid() {\n return !this.input.classList.contains('error') &&\n (!this.validate || this.validate()) &&\n (!this.required || !isInputEmpty(this.input));\n }\n\n public isValidToChange() {\n return this.isValid() && this.isChanged();\n }\n\n public setDraftValue(value = '', silent?: boolean) {\n if(!this.options.plainText) {\n value = documentFragmentToHTML(wrapDraftText(value));\n }\n\n if(silent) {\n this.setValueSilently(value, false);\n } else {\n this.value = value;\n }\n }\n\n public setOriginalValue(value: InputField['originalValue'] = '', silent?: boolean) {\n this.originalValue = value;\n this.setDraftValue(value, silent);\n }\n\n public setState(state: InputState, label?: LangPackKey) {\n if(label) {\n this.label.textContent = '';\n this.label.append(i18n(label, this.options.labelOptions));\n } else {\n this.setLabel();\n }\n\n this.input.classList.toggle('error', !!(state & InputState.Error));\n this.input.classList.toggle('valid', !!(state & InputState.Valid));\n }\n\n public setError(label?: LangPackKey) {\n this.setState(InputState.Error, label);\n }\n}\n","// https://stackoverflow.com/a/6150060\nexport default function selectElementContents(el: HTMLElement) {\n const range = document.createRange();\n range.selectNodeContents(el);\n const sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {USING_BOMS} from '../helpers/dom/richInputHandler';\nimport BOM from '../helpers/string/bom';\nimport {_i18n} from '../lib/langPack';\nimport InputField, {InputFieldOptions} from './inputField';\nimport SetTransition from './singleTransition';\n\nconst USELESS_REG_EXP = new RegExp(`(${BOM})|()`, 'g');\n\nexport default class InputFieldAnimated extends InputField {\n public inputFake: HTMLElement;\n public onChangeHeight: (height: number) => void;\n\n // public onLengthChange: (length: number, isOverflow: boolean) => void;\n // protected wasInputFakeClientHeight: number;\n // protected showScrollDebounced: () => void;\n\n constructor(options?: InputFieldOptions) {\n super(options);\n\n this.input.addEventListener('input', () => {\n this.updateInnerHTML();\n this.onFakeInput();\n });\n\n if(options.placeholder) {\n _i18n(this.inputFake, options.placeholder, undefined, 'placeholder');\n }\n\n this.input.classList.add('scrollable', 'scrollable-y', 'no-scrollbar');\n // this.wasInputFakeClientHeight = 0;\n // this.showScrollDebounced = debounce(() => this.input.classList.remove('no-scrollbar'), 150, false, true);\n this.inputFake = document.createElement('div');\n // this.inputFake.contentEditable = 'true';\n this.inputFake.contentEditable = 'true';\n this.inputFake.tabIndex = -1;\n this.inputFake.className = this.input.className + ' input-field-input-fake';\n }\n\n public onFakeInput(setHeight = true, noAnimation?: boolean) {\n const {scrollHeight: newHeight/* , clientHeight */} = this.inputFake;\n /* if(this.wasInputFakeClientHeight && this.wasInputFakeClientHeight !== clientHeight) {\n this.input.classList.add('no-scrollbar'); // ! в сафари может вообще не появиться скролл после анимации, так как ему нужен полный reflow блока с overflow.\n this.showScrollDebounced();\n } */\n\n noAnimation ??= !this.input.isContentEditable;\n\n const currentHeight = +this.input.style.height.replace('px', '');\n if(currentHeight === newHeight) {\n return;\n }\n\n const TRANSITION_DURATION_FACTOR = 50;\n const transitionDuration = noAnimation ? 0 : Math.round(\n TRANSITION_DURATION_FACTOR * Math.log(Math.abs(newHeight - currentHeight))\n );\n\n // this.wasInputFakeClientHeight = clientHeight;\n this.input.style.transitionDuration = `${transitionDuration}ms`;\n\n if(setHeight) {\n this.onChangeHeight?.(newHeight);\n this.input.style.height = newHeight ? newHeight + 'px' : '';\n }\n\n const className = 'is-changing-height';\n SetTransition({\n element: this.input,\n className,\n forwards: true,\n duration: transitionDuration,\n onTransitionEnd: () => {\n this.input.classList.remove(className);\n }\n });\n }\n\n protected updateInnerHTML(innerHTML = this.input.innerHTML) {\n innerHTML = innerHTML.replace(//, '')\n .replace(/().+?\\/custom-emoji-element>/g, '$1')\n\n if(USING_BOMS) {\n innerHTML = innerHTML.replace(USELESS_REG_EXP, '');\n }\n\n this.inputFake.innerHTML = innerHTML;\n }\n\n public setValueSilently(value: Parameters[0], fromSet?: boolean) {\n super.setValueSilently(value, fromSet);\n\n this.updateInnerHTML();\n if(!fromSet) {\n this.onFakeInput();\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import { getRichValue } from \"../helpers/dom\";\nimport {LangPackKey} from '../lib/langPack';\nimport InputField from './inputField';\n\nexport default class InputSearch {\n public container: HTMLElement;\n public input: HTMLElement;\n public inputField: InputField;\n public clearBtn: HTMLElement;\n\n public prevValue = '';\n public timeout = 0;\n public onChange: (value: string) => void;\n public onClear: () => void;\n\n constructor(placeholder: LangPackKey, onChange?: (value: string) => void) {\n this.inputField = new InputField({\n placeholder,\n plainText: true\n });\n\n this.container = this.inputField.container;\n this.container.classList.remove('input-field');\n this.container.classList.add('input-search');\n\n this.onChange = onChange;\n\n this.input = this.inputField.input;\n this.input.classList.add('input-search-input');\n\n const searchIcon = document.createElement('i');\n searchIcon.classList.add('tgico', 'tgico-search');\n\n this.clearBtn = document.createElement('i');\n this.clearBtn.classList.add('tgico', 'btn-icon', 'tgico-close');\n\n this.input.addEventListener('input', this.onInput);\n this.clearBtn.addEventListener('click', this.onClearClick);\n\n this.container.append(searchIcon, this.clearBtn);\n }\n\n onInput = () => {\n if(!this.onChange) return;\n\n const value = this.value;\n\n // this.input.classList.toggle('is-empty', !value.trim());\n\n if(value !== this.prevValue) {\n this.prevValue = value;\n clearTimeout(this.timeout);\n this.timeout = window.setTimeout(() => {\n this.onChange(value);\n }, 200);\n }\n };\n\n onClearClick = () => {\n this.value = '';\n this.onChange && this.onChange('');\n this.onClear && this.onClear();\n };\n\n get value() {\n return this.inputField.value;\n }\n\n set value(value: string) {\n this.prevValue = value;\n clearTimeout(this.timeout);\n this.inputField.value = value;\n }\n\n public remove() {\n clearTimeout(this.timeout);\n this.input.removeEventListener('input', this.onInput);\n this.clearBtn.removeEventListener('click', this.onClearClick);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport VisibilityIntersector, {OnVisibilityChangeItem} from './visibilityIntersector';\nimport findAndSpliceAll from '../helpers/array/findAndSpliceAll';\nimport findAndSplice from '../helpers/array/findAndSplice';\nimport LazyLoadQueueIntersector, {LazyLoadElement} from './lazyLoadQueueIntersector';\nimport useHeavyAnimationCheck from '../hooks/useHeavyAnimationCheck';\n\nexport default class LazyLoadQueue extends LazyLoadQueueIntersector {\n constructor(parallelLimit?: number, ignoreHeavyAnimation?: boolean) {\n super(parallelLimit);\n\n this.intersector = new VisibilityIntersector(this.onVisibilityChange);\n\n !ignoreHeavyAnimation && useHeavyAnimationCheck(() => {\n this.lock();\n }, () => {\n this.unlockAndRefresh();\n });\n }\n\n private onVisibilityChange = ({target, visible}: OnVisibilityChangeItem) => {\n // if(DEBUG) {\n // this.log('isIntersecting', target, visible);\n // }\n\n // if visible - will move to the end of visible arary\n findAndSpliceAll(this.queue, (i) => i.div === target).forEach((item) => {\n if(visible) {\n item.wasSeen = true;\n }\n\n item.visible = visible;\n const index = this.queue.findIndex((item) => !item.visible);\n this.queue.splice(Math.max(0, index), 0, item);\n });\n\n this.setProcessQueueTimeout();\n };\n\n protected getItem() {\n return findAndSplice(this.queue, (item) => item.wasSeen);\n }\n\n public async processItem(item: LazyLoadElement) {\n await super.processItem(item);\n this.intersector.unobserve(item.div);\n }\n\n protected addElement(method: 'push' | 'unshift', el: LazyLoadElement) {\n const inserted = super.addElement(method, el);\n\n if(!inserted) return false;\n\n this.observe(el);\n /* if(el.wasSeen) {\n this.processQueue(el);\n } else */\n el.wasSeen ??= false;\n\n return true;\n }\n\n public setAllSeen() {\n this.queue.forEach((item) => {\n item.wasSeen = true;\n });\n\n this.setProcessQueueTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport findAndSpliceAll from '../helpers/array/findAndSpliceAll';\nimport LazyLoadQueueBase, {LazyLoadElementBase} from './lazyLoadQueueBase';\nimport VisibilityIntersector from './visibilityIntersector';\n\nexport type LazyLoadElement = Omit & {\n load: (target?: HTMLElement) => Promise,\n div: HTMLElement\n wasSeen?: boolean,\n visible?: boolean\n};\n\nexport default class LazyLoadQueueIntersector extends LazyLoadQueueBase {\n protected queue: Array = [];\n protected inProcess: Set = new Set();\n\n public intersector: VisibilityIntersector;\n protected intersectorTimeout: number;\n\n constructor(parallelLimit?: number) {\n super(parallelLimit);\n }\n\n public lock() {\n super.lock();\n this.intersector.lock();\n }\n\n public unlock() {\n super.unlock();\n this.intersector.unlock();\n }\n\n public unlockAndRefresh() {\n super.unlock();\n this.intersector.unlockAndRefresh();\n }\n\n public clear() {\n super.clear();\n this.intersector.disconnect();\n }\n\n public refresh() {\n this.intersector.refresh();\n }\n\n protected loadItem(item: LazyLoadElement) {\n return item.load(item.div);\n }\n\n protected addElement(method: 'push' | 'unshift', el: LazyLoadElement) {\n const item = this.queue.find((i) => i.div === el.div && i.load === el.load);\n if(item) {\n return false;\n } else {\n for(const item of this.inProcess) {\n if(item.div === el.div && item.load === el.load) {\n return false;\n }\n }\n }\n\n this.queue[method](el);\n return true;\n }\n\n protected setProcessQueueTimeout() {\n this.intersectorTimeout ??= window.setTimeout(() => {\n this.intersectorTimeout = undefined;\n this.processQueue();\n }, 0);\n }\n\n public push(el: LazyLoadElement) {\n super.push(el);\n }\n\n public unshift(el: LazyLoadElement) {\n super.unshift(el);\n }\n\n public delete(el: Omit) {\n findAndSpliceAll(this.queue, (i) => i.div === el.div);\n this.unobserve(el);\n }\n\n public observe(el: LazyLoadElement) {\n this.intersector.observe(el.div);\n }\n\n public unobserve(el: Omit) {\n this.intersector.unobserve(el.div);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {GrabEvent} from '../helpers/dom/attachGrabListeners';\nimport appMediaPlaybackController from './appMediaPlaybackController';\nimport RangeSelector from './rangeSelector';\n\nexport default class MediaProgressLine extends RangeSelector {\n protected filledLoad: HTMLDivElement;\n\n protected progressRAF: number;\n\n protected media: HTMLMediaElement;\n protected streamable: boolean;\n\n // protected lastOnPlayTime: number;\n // protected lastOnPlayCurrentTime: number;\n\n constructor(protected options: {\n withTransition?: boolean,\n useTransform?: boolean,\n onSeekStart?: () => void,\n onSeekEnd?: () => void\n } = {}) {\n super({\n step: 1000 / 60 / 1000,\n min: 0,\n max: 1,\n withTransition: options.withTransition,\n useTransform: options.useTransform\n }, 0);\n }\n\n public setMedia({\n media,\n streamable,\n duration\n }: {\n media: HTMLMediaElement,\n streamable?: boolean,\n duration?: number\n }) {\n if(this.media) {\n this.removeListeners();\n }\n\n if(streamable && !this.filledLoad) {\n this.filledLoad = document.createElement('div');\n this.filledLoad.classList.add('progress-line__filled', 'progress-line__loaded');\n this.container.prepend(this.filledLoad);\n // this.setLoadProgress();\n } else if(this.filledLoad) {\n this.filledLoad.classList.toggle('hide', !streamable);\n }\n\n this.media = media;\n this.streamable = streamable;\n if(!media.paused || media.currentTime > 0) {\n this.onPlay();\n }\n\n let wasPlaying = false;\n this.setSeekMax(duration);\n this.setListeners();\n this.setHandlers({\n onMouseDown: () => {\n wasPlaying = !this.media.paused;\n wasPlaying && this.media.pause();\n this.options?.onSeekStart?.();\n },\n\n onMouseUp: (e) => {\n // cancelEvent(e.event);\n wasPlaying && this.media.play();\n this.options?.onSeekEnd?.();\n }\n });\n }\n\n protected onLoadedData = () => {\n this.setSeekMax();\n };\n\n protected onEnded = () => {\n this.setProgress();\n };\n\n protected onPlay = () => {\n const r = () => {\n this.setProgress();\n\n this.progressRAF = this.media.paused ? undefined : window.requestAnimationFrame(r);\n };\n\n if(this.progressRAF) {\n window.cancelAnimationFrame(this.progressRAF);\n this.progressRAF = undefined;\n }\n\n if(this.streamable) {\n this.setLoadProgress();\n }\n\n // this.lastOnPlayTime = Date.now();\n // this.lastOnPlayCurrentTime = this.media.currentTime;\n r();\n // this.progressRAF = window.requestAnimationFrame(r);\n };\n\n protected onTimeUpdate = () => {\n if(this.media.paused) {\n this.setProgress();\n\n if(this.streamable) {\n this.setLoadProgress();\n }\n }\n };\n\n protected onProgress = (e: Event) => {\n this.setLoadProgress();\n };\n\n protected scrub(e: GrabEvent) {\n const scrubTime = super.scrub(e);\n this.media.currentTime = scrubTime;\n return scrubTime;\n }\n\n protected setLoadProgress() {\n if(appMediaPlaybackController.isSafariBuffering(this.media)) return;\n const buf = this.media.buffered;\n const numRanges = buf.length;\n\n const currentTime = this.media.currentTime;\n let nearestStart = 0, end = 0;\n for(let i = 0; i < numRanges; ++i) {\n const start = buf.start(i);\n if(currentTime >= start && start >= nearestStart) {\n nearestStart = start;\n end = buf.end(i);\n }\n\n // console.log('onProgress range:', i, buf.start(i), buf.end(i), this.media);\n }\n\n // console.log('onProgress correct range:', nearestStart, end, this.media);\n\n const percents = this.max ? end / this.max : 0;\n this.filledLoad.style.width = (percents * 100) + '%';\n // this.filledLoad.style.transform = 'scaleX(' + percents + ')';\n }\n\n protected setSeekMax(duration?: number) {\n const realDuration = this.media.duration || 0;\n if(duration === undefined || realDuration) duration = realDuration;\n if(this.max = duration) {\n this.seek.setAttribute('max', '' + this.max);\n } else {\n this.media.addEventListener('loadeddata', this.onLoadedData);\n }\n }\n\n public setProgress() {\n if(appMediaPlaybackController.isSafariBuffering(this.media)) return;\n\n // fix jumping progress on play\n // let currentTime: number;\n // const diff = (Date.now() - this.lastOnPlayTime) / 1000;\n // if(!this.media.paused && this.lastOnPlayTime && diff <= 1) {\n // currentTime = this.lastOnPlayCurrentTime + diff;\n // } else {\n // currentTime = this.media.currentTime;\n // }\n\n const currentTime = this.media.currentTime;\n super.setProgress(currentTime);\n }\n\n public setListeners() {\n super.setListeners();\n this.media.addEventListener('ended', this.onEnded);\n this.media.addEventListener('play', this.onPlay);\n this.media.addEventListener('pause', this.onTimeUpdate);\n this.media.addEventListener('timeupdate', this.onTimeUpdate);\n this.streamable && this.media.addEventListener('progress', this.onProgress);\n }\n\n public removeListeners() {\n super.removeListeners();\n\n if(this.media) {\n this.media.removeEventListener('loadeddata', this.onLoadedData);\n this.media.removeEventListener('ended', this.onEnded);\n this.media.removeEventListener('play', this.onPlay);\n this.media.removeEventListener('pause', this.onTimeUpdate);\n this.media.removeEventListener('timeupdate', this.onTimeUpdate);\n this.streamable && this.media.removeEventListener('progress', this.onProgress);\n }\n\n if(this.progressRAF) {\n window.cancelAnimationFrame(this.progressRAF);\n this.progressRAF = undefined;\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {FontFamily, FontSize, FontWeight} from '../config/font';\nimport getTextWidth from '../helpers/canvas/getTextWidth';\nimport mediaSizes from '../helpers/mediaSizes';\nimport clamp from '../helpers/number/clamp';\nimport {fastRaf} from '../helpers/schedulers';\n\n// Thanks to https://stackoverflow.com/a/49349813\n\n/**\n * Attibute modifier to create middle ellipsis\n * When the attribute value is left blank the ellipsis will be in the middle\n * When positive the attribute value will be used as a percentage\n * When negative the attribute value will be used as character index counted from the end\n * @example\n *
A Javascript solution to middle ellipsis
\n *
A Javascript solution to middle ellipsis
\n *
A Javascript solution to middle ellipsis
\n */\nconst ellipsis = '…';\nconst map: Map = new Map();\n\nconst testQueue: Set = new Set();\nconst fontSize = '16px';\nlet pendingTest = false;\n\nfunction setTestQueue() {\n if(pendingTest) {\n return;\n }\n\n pendingTest = true;\n fastRaf(() => {\n pendingTest = false;\n testQueueElements();\n });\n}\n\nfunction testQueueElements() {\n testQueue.forEach(testElement);\n testQueue.clear();\n}\n\nwindow.addEventListener('resize', () => {\n for(const [key] of map) {\n testQueue.add(key);\n }\n\n setTestQueue();\n}, {capture: true, passive: true});\n\nfunction getElementWidth(element: HTMLElement) {\n const getSize = (element as any).getSize;\n if(getSize) {\n return getSize();\n }\n\n const type = element.dataset.sizeType;\n if(type) {\n const mediaSize = mediaSizes.active;\n // @ts-ignore\n const size: MediaSize = mediaSize[type];\n return size.width;\n }\n\n return element.getBoundingClientRect().width;\n}\n\nfunction testElement(element: HTMLElement) {\n // const perf = performance.now();\n // do not recalculate variables a second time\n let mapped = map.get(element);\n const firstTime = !mapped;\n\n let {text, textLength, from, multiplier, font, textWidth, elementWidth} = mapped || {};\n // console.log('[MEE] testElement got mapped', mapped);\n\n if(firstTime) {\n text = element.textContent;\n textLength = text.length;\n from = /* parseFloat(element.getAttribute(attributeName)) || */50;\n multiplier = from > 0 && from / 100;\n\n let fontSize = element.dataset.fontSize;\n if(fontSize && +fontSize) fontSize += 'px';\n // const perf = performance.now();\n font = `${element.dataset.fontWeight || FontWeight} ${fontSize || FontSize} ${FontFamily}`;\n /* const computedStyle = window.getComputedStyle(elm, null);\n font = `${computedStyle.getPropertyValue('font-weight')} ${computedStyle.getPropertyValue('font-size')} ${computedStyle.getPropertyValue('font-family')}`; */\n // console.log('testMiddleEllipsis get computed style:', performance.now() - perf, font);\n\n textWidth = getTextWidth(text, font);\n // const perf = performance.now();\n elementWidth = getElementWidth(element);\n // console.log('testMiddleEllipsis get offsetWidth:', performance.now() - perf, font);\n mapped = {text, textLength, from, multiplier, font, textWidth, elementWidth};\n map.set(element, mapped);\n\n // console.log('[MEE] testElement map set', element);\n }\n\n const newElementWidth = getElementWidth(element);\n const widthChanged = firstTime || elementWidth !== newElementWidth;\n !firstTime && widthChanged && (mapped.elementWidth = elementWidth = newElementWidth);\n\n if(widthChanged) {\n if(textWidth > elementWidth) {\n element.setAttribute('title', text);\n let smallerText = text;\n let smallerWidth = elementWidth;\n while(smallerText.length > 3) {\n const smallerTextLength = smallerText.length;\n const half = multiplier &&\n clamp(multiplier * smallerTextLength << 0, 1, smallerTextLength - 2) ||\n Math.max(smallerTextLength + from - 1, 1);\n const half1 = smallerText.substr(0, half).replace(/\\s*$/, '');\n const half2 = smallerText.substr(half + 1).replace(/^\\s*/, '');\n smallerText = half1 + half2;\n smallerWidth = getTextWidth(smallerText + ellipsis, font);\n if(smallerWidth < elementWidth) {\n element.textContent = half1 + ellipsis + half2;\n break;\n }\n }\n\n // * set new width after cutting text\n mapped.elementWidth = getElementWidth(element);\n // mapped.textWidth = smallerWidth;\n } else {\n element.removeAttribute('title');\n }\n }\n\n // console.log('testMiddleEllipsis for element:', elm, performance.now() - perf);\n}\n\nexport class MiddleEllipsisElement extends HTMLElement {\n connectedCallback() {\n // console.log('[MEE]: connectedCallback before', map.has(this), testQueue.has(this), map.size, this.textContent, map);\n\n map.set(this, null);\n if(this.dataset.sizeType || (this as any).getSize) {\n testElement(this);\n } else {\n testQueue.add(this);\n setTestQueue();\n }\n // testElement(this);\n\n // console.log('[MEE]: connectedCallback after', map.has(this), map.size, testQueue.has(this), testQueue.size);\n }\n\n disconnectedCallback() {\n const deleted = map.delete(this);\n testQueue.delete(this);\n // console.log('[MEE]: disconnectedCallback', deleted, map.has(this), map.size, this.textContent, map);\n }\n}\n\ncustomElements.define('middle-ellipsis-element', MiddleEllipsisElement);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport lottieLoader, {LottieLoader} from '../../lib/rlottie/lottieLoader';\nimport RLottiePlayer from '../../lib/rlottie/rlottiePlayer';\nimport PasswordInputField from '../passwordInputField';\n\nexport default class PasswordMonkey {\n public container: HTMLElement;\n public animation: RLottiePlayer;\n public needFrame = 0;\n protected loadPromise: ReturnType;\n\n constructor(protected passwordInputField: PasswordInputField, protected size: number) {\n this.container = document.createElement('div');\n this.container.classList.add('media-sticker-wrapper');\n }\n\n public load() {\n if(this.loadPromise) return this.loadPromise;\n return this.loadPromise = lottieLoader.loadAnimationAsAsset({\n container: this.container,\n loop: false,\n autoplay: false,\n width: this.size,\n height: this.size,\n noCache: true\n // }, 'assets/img/TwoFactorSetupMonkeyClose.tgs').then((_animation) => {\n }, 'TwoFactorSetupMonkeyPeek').then((_animation) => {\n // return;\n this.animation = _animation;\n this.animation.addEventListener('enterFrame', currentFrame => {\n // console.log('enterFrame', currentFrame, this.needFrame);\n\n if((this.animation.direction === 1 && currentFrame >= this.needFrame) ||\n (this.animation.direction === -1 && currentFrame <= this.needFrame)) {\n this.animation.setSpeed(1);\n this.animation.pause();\n }\n });\n\n this.passwordInputField.helpers.onVisibilityClickAdditional = () => {\n if(this.passwordInputField.helpers.passwordVisible) {\n this.animation.setDirection(1);\n this.animation.curFrame = 0;\n this.needFrame = 16;\n this.animation.play();\n } else {\n this.animation.setDirection(-1);\n this.animation.curFrame = 16;\n this.needFrame = 0;\n this.animation.play();\n }\n };\n\n return lottieLoader.waitForFirstFrame(_animation);\n });\n }\n\n public remove() {\n if(this.animation) {\n this.animation.remove();\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport InputField from '../inputField';\nimport lottieLoader from '../../lib/rlottie/lottieLoader';\nimport RLottiePlayer from '../../lib/rlottie/rlottiePlayer';\n\nexport default class TrackingMonkey {\n public container: HTMLElement;\n\n protected max = 45;\n protected needFrame = 0;\n\n protected animation: RLottiePlayer;\n protected idleAnimation: RLottiePlayer;\n\n protected loadPromise: Promise;\n\n constructor(protected inputField: InputField, protected size: number) {\n this.container = document.createElement('div');\n this.container.classList.add('media-sticker-wrapper');\n\n const input = inputField.input;\n\n input.addEventListener('blur', () => {\n this.playAnimation(0);\n });\n\n input.addEventListener('input', (e) => {\n this.playAnimation(inputField.value.length);\n });\n\n /* codeInput.addEventListener('focus', () => {\n playAnimation(Math.max(codeInput.value.length, 1));\n }); */\n }\n\n // 1st symbol = frame 15\n // end symbol = frame 165\n public playAnimation(length: number) {\n if(!this.animation) return;\n\n length = Math.min(length, 30);\n let frame: number;\n if(length) {\n frame = Math.round(Math.min(this.max, length) * (165 / this.max) + 11.33);\n\n if(this.idleAnimation) {\n this.idleAnimation.stop(true);\n this.idleAnimation.canvas[0].style.display = 'none';\n }\n\n this.animation.canvas[0].style.display = '';\n } else {\n /* const cb = (frameNo: number) => {\n if(frameNo <= 1) { */\n /* idleAnimation.play();\n idleAnimation.canvas.style.display = '';\n animation.canvas.style.display = 'none'; */\n /* animation.removeListener('enterFrame', cb);\n }\n };\n animation.addListener('enterFrame', cb); */\n\n frame = 0;\n }\n // animation.playSegments([1, 2]);\n\n const direction = this.needFrame > frame ? -1 : 1;\n // console.log('keydown', length, frame, direction);\n\n this.animation.setDirection(direction);\n if(this.needFrame !== 0 && frame === 0) {\n this.animation.setSpeed(7);\n }\n /* let diff = Math.abs(needFrame - frame * direction);\n if((diff / 20) > 1) animation.setSpeed(diff / 20 | 0); */\n this.needFrame = frame;\n\n this.animation.play();\n\n /* animation.goToAndStop(15, true); */\n // animation.goToAndStop(length / max * );\n }\n\n public load() {\n if(this.loadPromise) return this.loadPromise;\n return this.loadPromise = Promise.all([\n lottieLoader.loadAnimationAsAsset({\n container: this.container,\n loop: true,\n autoplay: true,\n width: this.size,\n height: this.size\n }, 'TwoFactorSetupMonkeyIdle').then((animation) => {\n this.idleAnimation = animation;\n\n // ! animationIntersector will stop animation instantly\n if(!this.inputField.value.length) {\n animation.play();\n }\n\n return lottieLoader.waitForFirstFrame(animation);\n }),\n\n lottieLoader.loadAnimationAsAsset({\n container: this.container,\n loop: false,\n autoplay: false,\n width: this.size,\n height: this.size\n }, 'TwoFactorSetupMonkeyTracking').then((_animation) => {\n this.animation = _animation;\n\n if(!this.inputField.value.length) {\n this.animation.canvas[0].style.display = 'none';\n }\n\n this.animation.addEventListener('enterFrame', currentFrame => {\n // console.log('enterFrame', currentFrame, needFrame);\n // let currentFrame = Math.round(e.currentTime);\n\n if((this.animation.direction === 1 && currentFrame >= this.needFrame) ||\n (this.animation.direction === -1 && currentFrame <= this.needFrame)) {\n this.animation.setSpeed(1);\n this.animation.pause();\n }\n\n if(currentFrame === 0 && this.needFrame === 0) {\n // animation.curFrame = 0;\n\n if(this.idleAnimation) {\n this.idleAnimation.canvas[0].style.display = '';\n this.idleAnimation.play();\n this.animation.canvas[0].style.display = 'none';\n }\n }\n });\n // console.log(animation.getDuration(), animation.getDuration(true));\n\n return lottieLoader.waitForFirstFrame(_animation);\n })\n ]);\n }\n\n public remove() {\n if(this.animation) this.animation.remove();\n if(this.idleAnimation) this.idleAnimation.remove();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport InputField, {InputFieldOptions} from './inputField';\n\nexport class PasswordInputHelpers {\n public passwordVisible = false;\n public toggleVisible: HTMLElement;\n public onVisibilityClickAdditional: () => void;\n\n constructor(public container: HTMLElement, public input: HTMLInputElement) {\n input.type = 'password';\n input.setAttribute('required', '');\n input.name = 'notsearch_password';\n input.autocomplete = 'off';\n\n // * https://stackoverflow.com/a/35949954/6758968\n const stealthy = document.createElement('input');\n stealthy.classList.add('stealthy');\n stealthy.tabIndex = -1;\n stealthy.type = 'password';\n input.parentElement.prepend(stealthy);\n input.parentElement.insertBefore(stealthy.cloneNode(), input.nextSibling);\n\n /* if(IS_SAFARI && !IS_MOBILE_SAFARI) {\n input.setAttribute('readonly', '');\n input.addEventListener('focus', () => {\n input.removeAttribute('readonly');\n }, {once: true});\n } */\n\n const toggleVisible = this.toggleVisible = document.createElement('span');\n toggleVisible.classList.add('toggle-visible', 'tgico');\n\n container.classList.add('input-field-password');\n container.append(toggleVisible);\n\n toggleVisible.addEventListener('click', this.onVisibilityClick);\n toggleVisible.addEventListener('touchend', this.onVisibilityClick);\n }\n\n public onVisibilityClick = (e: Event) => {\n cancelEvent(e);\n this.passwordVisible = !this.passwordVisible;\n\n this.toggleVisible.classList.toggle('eye-hidden', this.passwordVisible);\n (this.input as HTMLInputElement).type = this.passwordVisible ? 'text' : 'password';\n this.onVisibilityClickAdditional && this.onVisibilityClickAdditional();\n };\n}\n\nexport default class PasswordInputField extends InputField {\n public helpers: PasswordInputHelpers;\n\n constructor(options: InputFieldOptions = {}) {\n super({\n plainText: true,\n ...options\n });\n\n this.helpers = new PasswordInputHelpers(this.container, this.input as HTMLInputElement);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_PARALLAX_SUPPORTED from '../environment/parallaxSupport';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport findAndSplice from '../helpers/array/findAndSplice';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport filterChatPhotosMessages from '../helpers/filterChatPhotosMessages';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport ListLoader from '../helpers/listLoader';\nimport {fastRaf} from '../helpers/schedulers';\nimport {Message, ChatFull, MessageAction, Photo} from '../layer';\nimport type {AppMessagesManager} from '../lib/appManagers/appMessagesManager';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport choosePhotoSize from '../lib/appManagers/utils/photos/choosePhotoSize';\nimport {openAvatarViewer} from './avatar';\nimport {putAvatar} from './putPhoto';\nimport Scrollable from './scrollable';\nimport SwipeHandler from './swipeHandler';\nimport wrapPhoto from './wrappers/photo';\n\nconst LOAD_NEAREST = 3;\n\nexport default class PeerProfileAvatars {\n private static BASE_CLASS = 'profile-avatars';\n private static SCALE = IS_PARALLAX_SUPPORTED ? 2 : 1;\n private static TRANSLATE_TEMPLATE = IS_PARALLAX_SUPPORTED ? `translate3d({x}, 0, -1px) scale(${PeerProfileAvatars.SCALE})` : 'translate({x}, 0)';\n public container: HTMLElement;\n public avatars: HTMLElement;\n public gradient: HTMLElement;\n public info: HTMLElement;\n public arrowPrevious: HTMLElement;\n public arrowNext: HTMLElement;\n private tabs: HTMLDivElement;\n private listLoader: ListLoader;\n private peerId: PeerId;\n private intersectionObserver: IntersectionObserver;\n private loadCallbacks: Map void>;\n private listenerSetter: ListenerSetter;\n private swipeHandler: SwipeHandler;\n\n constructor(\n public scrollable: Scrollable,\n private managers: AppManagers\n ) {\n this.container = document.createElement('div');\n this.container.classList.add(PeerProfileAvatars.BASE_CLASS + '-container');\n\n this.avatars = document.createElement('div');\n this.avatars.classList.add(PeerProfileAvatars.BASE_CLASS + '-avatars');\n\n this.gradient = document.createElement('div');\n this.gradient.classList.add(PeerProfileAvatars.BASE_CLASS + '-gradient');\n\n this.info = document.createElement('div');\n this.info.classList.add(PeerProfileAvatars.BASE_CLASS + '-info');\n\n this.tabs = document.createElement('div');\n this.tabs.classList.add(PeerProfileAvatars.BASE_CLASS + '-tabs');\n\n this.arrowPrevious = document.createElement('div');\n this.arrowPrevious.classList.add(PeerProfileAvatars.BASE_CLASS + '-arrow', 'tgico-avatarprevious');\n\n /* const previousIcon = document.createElement('i');\n previousIcon.classList.add(PeerProfileAvatars.BASE_CLASS + '-arrow-icon', 'tgico-previous');\n this.arrowBack.append(previousIcon); */\n\n this.arrowNext = document.createElement('div');\n this.arrowNext.classList.add(PeerProfileAvatars.BASE_CLASS + '-arrow', PeerProfileAvatars.BASE_CLASS + '-arrow-next', 'tgico-avatarnext');\n\n /* const nextIcon = document.createElement('i');\n nextIcon.classList.add(PeerProfileAvatars.BASE_CLASS + '-arrow-icon', 'tgico-next');\n this.arrowNext.append(nextIcon); */\n\n this.container.append(this.avatars, this.gradient, this.info, this.tabs, this.arrowPrevious, this.arrowNext);\n\n this.loadCallbacks = new Map();\n this.listenerSetter = new ListenerSetter();\n\n const checkScrollTop = () => {\n if(this.scrollable.scrollTop !== 0) {\n this.scrollable.scrollIntoViewNew({\n element: this.scrollable.container.firstElementChild as HTMLElement,\n position: 'start'\n });\n return false;\n }\n\n return true;\n };\n\n const SWITCH_ZONE = 1 / 3;\n let cancel = false;\n let freeze = false;\n attachClickEvent(this.container, async(_e) => {\n if(freeze) {\n cancelEvent(_e);\n return;\n }\n\n if(cancel) {\n cancel = false;\n return;\n }\n\n if(!checkScrollTop()) {\n return;\n }\n\n const rect = this.container.getBoundingClientRect();\n\n // const e = (_e as TouchEvent).touches ? (_e as TouchEvent).touches[0] : _e as MouseEvent;\n const e = _e;\n const x = e.pageX;\n\n const clickX = x - rect.left;\n if((!this.listLoader.previous.length && !this.listLoader.next.length) ||\n (clickX > (rect.width * SWITCH_ZONE) && clickX < (rect.width - rect.width * SWITCH_ZONE))) {\n const peerId = this.peerId;\n\n const targets: {element: HTMLElement, item: Photo.photo['id'] | Message.messageService}[] = [];\n this.listLoader.previous.concat(this.listLoader.current, this.listLoader.next).forEach((item, idx) => {\n targets.push({\n element: /* null */this.avatars.children[idx] as HTMLElement,\n item\n });\n });\n\n const prevTargets = targets.slice(0, this.listLoader.previous.length);\n const nextTargets = targets.slice(this.listLoader.previous.length + 1);\n\n const target = this.avatars.children[this.listLoader.previous.length] as HTMLElement;\n freeze = true;\n openAvatarViewer(target, peerId, () => peerId === this.peerId, this.listLoader.current, prevTargets, nextTargets);\n freeze = false;\n } else {\n const centerX = rect.right - (rect.width / 2);\n const toRight = x > centerX;\n\n // this.avatars.classList.remove('no-transition');\n // fastRaf(() => {\n this.avatars.classList.add('no-transition');\n void this.avatars.offsetLeft; // reflow\n\n let distance: number;\n if(this.listLoader.index === 0 && !toRight) distance = this.listLoader.count - 1;\n else if(this.listLoader.index === (this.listLoader.count - 1) && toRight) distance = -(this.listLoader.count - 1);\n else distance = toRight ? 1 : -1;\n this.listLoader.go(distance);\n\n fastRaf(() => {\n this.avatars.classList.remove('no-transition');\n });\n // });\n }\n }, {listenerSetter: this.listenerSetter});\n\n const cancelNextClick = () => {\n cancel = true;\n document.body.addEventListener(IS_TOUCH_SUPPORTED ? 'touchend' : 'click', (e) => {\n cancel = false;\n }, {once: true});\n };\n\n let width = 0, x = 0, lastDiffX = 0, /* lastIndex = 0, */ minX = 0;\n const swipeHandler = this.swipeHandler = new SwipeHandler({\n element: this.avatars,\n onSwipe: (xDiff, yDiff) => {\n xDiff *= -1;\n yDiff *= -1;\n\n lastDiffX = xDiff;\n let lastX = x + xDiff * -PeerProfileAvatars.SCALE;\n if(lastX > 0) lastX = 0;\n else if(lastX < minX) lastX = minX;\n\n this.avatars.style.transform = PeerProfileAvatars.TRANSLATE_TEMPLATE.replace('{x}', lastX + 'px');\n // console.log(xDiff, yDiff);\n return false;\n },\n verifyTouchTarget: (e) => {\n if(!checkScrollTop()) {\n cancelNextClick();\n cancelEvent(e as any as Event);\n return false;\n } else if(this.container.classList.contains('is-single') || freeze) {\n return false;\n }\n\n return true;\n },\n onFirstSwipe: () => {\n const rect = this.avatars.getBoundingClientRect();\n width = rect.width;\n minX = -width * (this.tabs.childElementCount - 1);\n\n /* lastIndex = whichChild(this.tabs.querySelector('.active'));\n x = -width * lastIndex; */\n x = rect.left - this.container.getBoundingClientRect().left;\n\n this.avatars.style.transform = PeerProfileAvatars.TRANSLATE_TEMPLATE.replace('{x}', x + 'px');\n\n this.container.classList.add('is-swiping');\n this.avatars.classList.add('no-transition');\n void this.avatars.offsetLeft; // reflow\n },\n onReset: () => {\n const addIndex = Math.ceil(Math.abs(lastDiffX) / (width / PeerProfileAvatars.SCALE)) * (lastDiffX >= 0 ? 1 : -1);\n cancelNextClick();\n\n // console.log(addIndex);\n\n this.avatars.classList.remove('no-transition');\n fastRaf(() => {\n this.listLoader.go(addIndex);\n this.container.classList.remove('is-swiping');\n });\n }\n });\n\n this.intersectionObserver = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n if(!entry.isIntersecting) {\n return;\n }\n\n this.loadNearestToTarget(entry.target);\n });\n });\n\n /* this.listenerSetter.add(rootScope)('avatar_update', (peerId) => {\n if(this.peerId === peerId) {\n const photo = appPeersManager.getPeerPhoto(peerId);\n if(photo) {\n const id = photo.photo_id;\n const previous = this.listLoader.previous;\n for(let i = 0; i < previous.length; ++i) {\n if(previous[i] === id)\n }\n this.listLoader.previous.forEach((_id, idx, arr) => {});\n }\n }\n }); */\n }\n\n public async setPeer(peerId: PeerId) {\n this.peerId = peerId;\n\n const photo = await this.managers.appPeersManager.getPeerPhoto(peerId);\n if(!photo) {\n return;\n }\n\n const listLoader: PeerProfileAvatars['listLoader'] = this.listLoader = new ListLoader({\n loadCount: 50,\n loadMore: (anchor, older, loadCount) => {\n if(!older) return Promise.resolve({count: undefined, items: []});\n\n if(peerId.isUser()) {\n const maxId: Photo.photo['id'] = anchor as any;\n return this.managers.appPhotosManager.getUserPhotos(peerId, maxId, loadCount).then((value) => {\n return {\n count: value.count,\n items: value.photos\n };\n });\n } else {\n const promises: [Promise | ChatFull, ReturnType] = [] as any;\n if(!listLoader.current) {\n promises.push(this.managers.appProfileManager.getChatFull(peerId.toChatId()));\n }\n\n promises.push(this.managers.appMessagesManager.getSearch({\n peerId,\n maxId: Number.MAX_SAFE_INTEGER,\n inputFilter: {\n _: 'inputMessagesFilterChatPhotos'\n },\n limit: loadCount,\n backLimit: 0\n }));\n\n return Promise.all(promises).then(async(result) => {\n const value = result.pop() as typeof result[1];\n\n filterChatPhotosMessages(value);\n\n if(!listLoader.current) {\n const chatFull = result[0];\n const message = findAndSplice(value.history, (message) => {\n return ((message as Message.messageService).action as MessageAction.messageActionChannelEditPhoto).photo.id === chatFull.chat_photo.id;\n }) as Message.messageService;\n\n listLoader.current = message || await this.managers.appMessagesManager.generateFakeAvatarMessage(this.peerId, chatFull.chat_photo);\n }\n\n // console.log('avatars loaded:', value);\n return {\n count: value.count,\n items: value.history\n };\n });\n }\n },\n processItem: this.processItem,\n onJump: (item, older) => {\n const id = this.listLoader.index;\n // const nextId = Math.max(0, id);\n const x = 100 * PeerProfileAvatars.SCALE * id;\n this.avatars.style.transform = PeerProfileAvatars.TRANSLATE_TEMPLATE.replace('{x}', `-${x}%`);\n\n const activeTab = this.tabs.querySelector('.active');\n if(activeTab) activeTab.classList.remove('active');\n\n const tab = this.tabs.children[id] as HTMLElement;\n tab.classList.add('active');\n\n this.loadNearestToTarget(this.avatars.children[id]);\n }\n });\n\n if(photo._ === 'userProfilePhoto') {\n listLoader.current = photo.photo_id;\n }\n\n await this.processItem(listLoader.current);\n\n // listLoader.loaded\n listLoader.load(true);\n }\n\n public addTab() {\n const tab = document.createElement('div');\n tab.classList.add(PeerProfileAvatars.BASE_CLASS + '-tab');\n this.tabs.append(tab);\n\n if(this.tabs.childElementCount === 1) {\n tab.classList.add('active');\n }\n\n this.container.classList.toggle('is-single', this.tabs.childElementCount <= 1);\n }\n\n public processItem = async(photoId: Photo.photo['id'] | Message.messageService) => {\n const avatar = document.createElement('div');\n avatar.classList.add(PeerProfileAvatars.BASE_CLASS + '-avatar', 'media-container', 'hide');\n\n this.avatars.append(avatar);\n\n let photo: Photo.photo;\n if(photoId) {\n photo = typeof(photoId) !== 'object' ?\n await this.managers.appPhotosManager.getPhoto(photoId) :\n (photoId.action as MessageAction.messageActionChannelEditPhoto).photo as Photo.photo;\n }\n\n const img = new Image();\n img.classList.add('avatar-photo');\n img.draggable = false;\n\n const loadCallback = async() => {\n if(photo) {\n const res = await wrapPhoto({\n container: avatar,\n photo,\n size: choosePhotoSize(photo, 420, 420, false),\n withoutPreloader: true\n });\n\n [res.images.thumb, res.images.full].filter(Boolean).forEach((img) => {\n img.classList.add('avatar-photo');\n });\n } else {\n const photo = await this.managers.appPeersManager.getPeerPhoto(this.peerId);\n await putAvatar(avatar, this.peerId, photo, 'photo_big', img);\n }\n\n avatar.classList.remove('hide');\n };\n\n if(this.avatars.childElementCount <= LOAD_NEAREST) {\n await loadCallback();\n } else {\n this.intersectionObserver.observe(avatar);\n this.loadCallbacks.set(avatar, loadCallback);\n }\n\n this.addTab();\n\n return photoId;\n };\n\n private loadNearestToTarget(target: Element) {\n const children = Array.from(target.parentElement.children);\n const idx = children.indexOf(target);\n const slice = children.slice(Math.max(0, idx - LOAD_NEAREST), Math.min(children.length, idx + LOAD_NEAREST));\n\n slice.forEach((target) => {\n const callback = this.loadCallbacks.get(target);\n if(callback) {\n callback();\n this.loadCallbacks.delete(target);\n this.intersectionObserver.unobserve(target);\n }\n });\n }\n\n public cleanup() {\n this.listenerSetter.removeAll();\n this.swipeHandler.removeListeners();\n this.intersectionObserver?.disconnect();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_PARALLAX_SUPPORTED from '../environment/parallaxSupport';\nimport deferredPromise from '../helpers/cancellablePromise';\nimport {copyTextToClipboard} from '../helpers/clipboard';\nimport anchorCopy from '../helpers/dom/anchorCopy';\nimport {simulateClickEvent} from '../helpers/dom/clickEvent';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport setInnerHTML from '../helpers/dom/setInnerHTML';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport makeError from '../helpers/makeError';\nimport {makeMediaSize} from '../helpers/mediaSize';\nimport {getMiddleware, MiddlewareHelper} from '../helpers/middleware';\nimport middlewarePromise from '../helpers/middlewarePromise';\nimport {Chat, ChatFull, User, UserFull} from '../layer';\nimport appImManager from '../lib/appManagers/appImManager';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport getServerMessageId from '../lib/appManagers/utils/messageId/getServerMessageId';\nimport getPeerActiveUsernames from '../lib/appManagers/utils/peers/getPeerActiveUsernames';\nimport I18n, {i18n, join} from '../lib/langPack';\nimport wrapRichText from '../lib/richTextProcessor/wrapRichText';\nimport rootScope from '../lib/rootScope';\nimport AvatarElement from './avatar';\nimport CheckboxField from './checkboxField';\nimport {generateDelimiter} from './generateDelimiter';\nimport PeerProfileAvatars from './peerProfileAvatars';\nimport Row from './row';\nimport Scrollable from './scrollable';\nimport SettingSection from './settingSection';\nimport {toast} from './toast';\nimport formatUserPhone from './wrappers/formatUserPhone';\nimport wrapPeerTitle from './wrappers/peerTitle';\nimport wrapTopicNameButton from './wrappers/topicNameButton';\n\nconst setText = (text: Parameters[1], row: Row) => {\n // fastRaf(() => {\n setInnerHTML(row.title, text || '');\n row.container.style.display = text ? '' : 'none';\n // });\n};\n\nexport default class PeerProfile {\n public element: HTMLElement;\n private avatars: PeerProfileAvatars;\n private avatar: AvatarElement;\n private section: SettingSection;\n private name: HTMLDivElement;\n private subtitle: HTMLDivElement;\n private bio: Row;\n private username: Row;\n private phone: Row;\n private notifications: Row;\n private location: Row;\n private link: Row;\n\n private cleaned: boolean;\n private setMoreDetailsTimeout: number;\n private setPeerStatusInterval: number;\n\n private peerId: PeerId;\n private threadId: number;\n\n private middlewareHelper: MiddlewareHelper;\n\n constructor(\n private managers: AppManagers,\n public scrollable: Scrollable,\n private listenerSetter?: ListenerSetter,\n private isDialog = true\n ) {\n if(!IS_PARALLAX_SUPPORTED) {\n this.scrollable.container.classList.add('no-parallax');\n }\n\n if(!listenerSetter) {\n this.listenerSetter = new ListenerSetter();\n }\n\n this.middlewareHelper = getMiddleware();\n }\n\n public init() {\n this.init = null;\n\n\n this.element = document.createElement('div');\n this.element.classList.add('profile-content');\n\n this.section = new SettingSection({\n noDelimiter: true\n });\n\n this.name = document.createElement('div');\n this.name.classList.add('profile-name');\n\n this.subtitle = document.createElement('div');\n this.subtitle.classList.add('profile-subtitle');\n\n this.bio = new Row({\n title: ' ',\n subtitle: true,\n icon: 'info',\n clickable: (e) => {\n if((e.target as HTMLElement).tagName === 'A') {\n return;\n }\n\n copyTextToClipboard(this.bio.title.textContent);\n toast(I18n.format('BioCopied', true));\n },\n listenerSetter: this.listenerSetter,\n contextMenu: {\n buttons: [{\n icon: 'copy',\n text: 'Text.CopyLabel_About',\n onClick: () => {\n simulateClickEvent(this.bio.container);\n },\n verify: () => !this.peerId.isUser()\n }, {\n icon: 'copy',\n text: 'Text.CopyLabel_Bio',\n onClick: () => {\n simulateClickEvent(this.bio.container);\n },\n verify: () => this.peerId.isUser()\n }]\n }\n });\n\n this.bio.title.classList.add('pre-wrap');\n\n this.username = new Row({\n title: ' ',\n subtitleLangKey: 'Username',\n icon: 'username',\n clickable: () => {\n // const username = await this.managers.appPeersManager.getPeerUsername(this.peerId);\n copyTextToClipboard('@' + this.username.title.textContent);\n toast(I18n.format('UsernameCopied', true));\n },\n listenerSetter: this.listenerSetter,\n contextMenu: {\n buttons: [{\n icon: 'copy',\n text: 'Text.CopyLabel_Username',\n onClick: () => {\n simulateClickEvent(this.username.container);\n }\n }]\n }\n });\n\n this.phone = new Row({\n title: ' ',\n subtitle: true,\n icon: 'phone',\n clickable: () => {\n copyTextToClipboard(this.phone.title.textContent.replace(/\\s/g, ''));\n toast(I18n.format('PhoneCopied', true));\n },\n listenerSetter: this.listenerSetter,\n contextMenu: {\n buttons: [{\n icon: 'copy',\n text: 'Text.CopyLabel_PhoneNumber',\n onClick: () => {\n simulateClickEvent(this.phone.container);\n }\n }, {\n icon: 'info',\n text: 'PeerInfo.Phone.AnonymousInfo',\n textArgs: [(() => {\n const a = document.createElement('a');\n return a;\n })()],\n onClick: () => {\n window.open('https://fragment.com/numbers', '_blank');\n },\n separator: true,\n multiline: true,\n verify: async() => {\n const {isAnonymous} = await this.managers.appUsersManager.getUserPhone(this.peerId.toUserId()) || {};\n return isAnonymous;\n }\n }]\n }\n });\n\n this.link = new Row({\n title: ' ',\n subtitleLangKey: 'SetUrlPlaceholder',\n icon: 'link',\n clickable: () => {\n const url = this.link.title.textContent;\n copyTextToClipboard(url);\n // Promise.resolve(appProfileManager.getChatFull(this.peerId.toChatId())).then((chatFull) => {\n // copyTextToClipboard(chatFull.exported_invite.link);\n const isPrivate = url.includes('/c/');\n toast(I18n.format(isPrivate ? 'LinkCopiedPrivateInfo' : 'LinkCopied', true));\n // });\n },\n listenerSetter: this.listenerSetter,\n contextMenu: {\n buttons: [{\n icon: 'copy',\n text: 'Text.CopyLabel_ShareLink',\n onClick: () => {\n simulateClickEvent(this.link.container);\n }\n }]\n }\n });\n\n this.location = new Row({\n title: ' ',\n subtitleLangKey: 'ChatLocation',\n icon: 'location'\n });\n\n this.section.content.append(\n this.phone.container,\n this.username.container,\n this.location.container,\n this.bio.container,\n this.link.container\n );\n\n const {listenerSetter} = this;\n if(this.isDialog) {\n this.notifications = new Row({\n checkboxField: new CheckboxField({toggle: true}),\n titleLangKey: 'Notifications',\n icon: 'unmute',\n listenerSetter: this.listenerSetter\n });\n\n listenerSetter.add(this.notifications.checkboxField.input)('change', (e) => {\n if(!e.isTrusted) {\n return;\n }\n\n // let checked = this.notificationsCheckbox.checked;\n this.managers.appMessagesManager.togglePeerMute({peerId: this.peerId, threadId: this.threadId});\n });\n\n listenerSetter.add(rootScope)('dialog_notify_settings', async(dialog) => {\n if(this.peerId === dialog.peerId) {\n const muted = await this.managers.appNotificationsManager.isPeerLocalMuted({peerId: this.peerId, respectType: false, threadId: this.threadId});\n this.notifications.checkboxField.checked = !muted;\n }\n });\n\n this.section.content.append(this.notifications.container);\n }\n\n this.element.append(this.section.container);\n\n if(IS_PARALLAX_SUPPORTED) {\n this.element.append(generateDelimiter());\n }\n\n listenerSetter.add(rootScope)('peer_typings', ({peerId}) => {\n if(this.peerId === peerId) {\n this.setPeerStatus();\n }\n });\n\n listenerSetter.add(rootScope)('peer_bio_edit', (peerId) => {\n if(peerId === this.peerId) {\n this.setMoreDetails(true);\n }\n });\n\n const n = async({peerId, threadId}: {peerId: PeerId, threadId?: number}) => {\n if(this.peerId !== peerId) {\n return false;\n }\n\n const isForum = await this.managers.appPeersManager.isForum(this.peerId);\n if(isForum && this.threadId ? this.threadId === threadId : true) {\n return true;\n }\n\n return false;\n };\n\n listenerSetter.add(rootScope)('peer_title_edit', async(data) => {\n if(await n(data)) {\n this.fillUsername();\n this.setMoreDetails(true);\n }\n });\n\n listenerSetter.add(rootScope)('user_update', (userId) => {\n if(this.peerId === userId.toPeerId()) {\n this.setPeerStatus();\n }\n });\n\n listenerSetter.add(rootScope)('contacts_update', async(userId) => {\n if(this.peerId === userId.toPeerId()) {\n const user = await this.managers.appUsersManager.getUser(userId);\n if(!user.pFlags.self || !this.isDialog) {\n this.fillUserPhone();\n }\n }\n });\n\n listenerSetter.add(rootScope)('avatar_update', async(data) => {\n if(await n(data)) {\n this.setAvatar();\n }\n });\n\n this.setPeerStatusInterval = window.setInterval(() => this.setPeerStatus(), 60e3);\n }\n\n private async setPeerStatus(\n needClear = false,\n manual?: T\n ): Promise void : void> {\n const peerId = this.peerId;\n\n const callbacks: Array<() => void> = [];\n callbacks.push(() => {\n this.element.classList.toggle('is-me', peerId === rootScope.myId);\n });\n\n let promise: Promise<(() => void) | void> = Promise.resolve();\n if(!(!peerId || (rootScope.myId === peerId && this.isDialog))) {\n const isForum = await this.managers.appPeersManager.isForum(this.peerId);\n const middleware = this.middlewareHelper.get();\n if(isForum && this.threadId) {\n promise = wrapTopicNameButton({\n peerId,\n wrapOptions: {\n middleware\n }\n }).then(({element}) => {\n this.subtitle.replaceChildren(element);\n });\n } else {\n promise = appImManager.setPeerStatus({\n peerId,\n element: this.subtitle,\n needClear,\n useWhitespace: true,\n middleware,\n ignoreSelf: !this.isDialog\n });\n }\n\n promise.then((callback) => callback && callbacks.push(callback));\n }\n\n const callback = () => callbacks.forEach((callback) => callback());\n\n return promise.then(() => {\n if(manual) {\n return callback;\n }\n\n callback();\n }) as any;\n }\n\n public cleanupHTML() {\n [\n this.bio,\n this.phone,\n this.username,\n this.location,\n this.link\n ].forEach((row) => {\n row.container.style.display = 'none';\n });\n\n if(this.notifications) {\n this.notifications.container.style.display = '';\n this.notifications.checkboxField.checked = true;\n }\n\n this.clearSetMoreDetailsTimeout();\n }\n\n private canBeDetailed() {\n return this.peerId !== rootScope.myId || !this.isDialog;\n }\n\n private createAvatar() {\n const avatar = new AvatarElement();\n avatar.classList.add('profile-avatar', 'avatar-120');\n avatar.isDialog = this.isDialog;\n avatar.attachClickEvent();\n return avatar;\n }\n\n private async _setAvatar() {\n const {peerId} = this;\n const isTopic = !!(this.threadId && await this.managers.appPeersManager.isForum(peerId));\n if(this.canBeDetailed() && !isTopic) {\n const photo = await this.managers.appPeersManager.getPeerPhoto(peerId);\n\n if(photo) {\n const oldAvatars = this.avatars;\n this.avatars = new PeerProfileAvatars(this.scrollable, this.managers);\n await this.avatars.setPeer(peerId);\n\n return () => {\n this.avatars.info.append(this.name, this.subtitle);\n\n this.avatar?.remove();\n this.avatar = undefined;\n\n if(oldAvatars) oldAvatars.container.replaceWith(this.avatars.container);\n else this.element.prepend(this.avatars.container);\n\n if(IS_PARALLAX_SUPPORTED) {\n this.scrollable.container.classList.add('parallax');\n }\n };\n }\n }\n\n const avatar = this.createAvatar();\n await avatar.updateWithOptions({\n peerId,\n threadId: isTopic ? this.threadId : undefined,\n wrapOptions: {\n customEmojiSize: makeMediaSize(120, 120),\n middleware: this.middlewareHelper.get()\n }\n });\n\n return () => {\n if(IS_PARALLAX_SUPPORTED) {\n this.scrollable.container.classList.remove('parallax');\n }\n\n if(this.avatars) {\n this.avatars.container.remove();\n this.avatars.cleanup();\n this.avatars = undefined;\n }\n\n this.avatar?.remove();\n this.avatar = avatar;\n\n this.section.content.prepend(this.avatar, this.name, this.subtitle);\n };\n }\n\n private setAvatar(manual?: T): T extends true ? Promise<() => void> : Promise {\n const promise = this._setAvatar();\n return manual ? promise : promise.then((callback) => callback()) as any;\n }\n\n private getUsernamesAlso(usernames: string[]) {\n const also = usernames.slice(1);\n if(also.length) {\n const a = also.map((username) => anchorCopy({username}));\n const i = i18n('UsernameAlso', [join(a, false)]);\n return i;\n }\n }\n\n private async fillUsername() {\n const {peerId} = this;\n if(peerId.isUser() && this.canBeDetailed()) {\n const usernames = await this.managers.appPeersManager.getPeerActiveUsernames(peerId);\n const also = this.getUsernamesAlso(usernames);\n\n return () => {\n this.username.subtitle.replaceChildren(also || i18n('Username'));\n setText(usernames[0], this.username);\n };\n }\n }\n\n private async fillUserPhone() {\n const {peerId} = this;\n if(peerId.isUser() && this.canBeDetailed()) {\n const {phone, isAnonymous} = await this.managers.appUsersManager.getUserPhone(peerId.toUserId()) || {};\n\n return () => {\n this.phone.subtitle.replaceChildren(i18n(isAnonymous ? 'AnonymousNumber' : 'Phone'));\n setText(phone ? formatUserPhone(phone) : undefined, this.phone);\n };\n }\n }\n\n private async fillNotifications() {\n const notificationsRow = this.notifications;\n if(!notificationsRow) {\n return;\n }\n\n if(this.canBeDetailed()) {\n const muted = await this.managers.appNotificationsManager.isPeerLocalMuted({peerId: this.peerId, respectType: false, threadId: this.threadId});\n return () => {\n notificationsRow.checkboxField.checked = !muted;\n };\n } else {\n return () => {\n // fastRaf(() => {\n notificationsRow.container.style.display = 'none';\n // });\n };\n }\n }\n\n private async fillName() {\n const {peerId} = this;\n const [element/* , icons */] = await Promise.all([\n wrapPeerTitle({\n peerId,\n dialog: this.isDialog,\n withIcons: !this.threadId,\n threadId: this.threadId\n })\n\n // generateTitleIcons(peerId)\n ]);\n\n return () => {\n replaceContent(this.name, element);\n // this.name.append(...icons);\n };\n }\n\n private async fillRows(manual: Promise) {\n return Promise.all([\n this.fillName(),\n this.fillUsername(),\n this.fillUserPhone(),\n this.fillNotifications(),\n this.setMoreDetails(undefined, manual),\n this.setPeerStatus(true, true)\n ]).then((callbacks) => {\n return () => {\n callbacks.forEach((callback) => callback?.());\n };\n });\n }\n\n public async fillProfileElements() {\n if(!this.cleaned) return;\n this.cleaned = false;\n\n this.cleanupHTML();\n const deferred = deferredPromise();\n const middleware = this.middlewareHelper.get();\n middleware.onClean(() => {\n deferred.reject();\n });\n\n const callbacks = await Promise.all([\n this.setAvatar(true),\n this.fillRows(deferred)\n ]);\n\n return () => {\n deferred.resolve();\n callbacks.forEach((callback) => callback?.());\n };\n }\n\n private async _setMoreDetails(peerId: PeerId, peerFull?: ChatFull | UserFull) {\n const m = this.getMiddlewarePromise();\n const isTopic = !!(this.threadId && await m(this.managers.appPeersManager.isForum(peerId)));\n if(isTopic) {\n let url = 'https://t.me/';\n const threadId = getServerMessageId(this.threadId);\n const username = await m(this.managers.appPeersManager.getPeerUsername(peerId));\n if(username) {\n url += `${username}/${threadId}`;\n } else {\n url += `c/${peerId.toChatId()}/${threadId}`;\n }\n\n return () => {\n setText(url, this.link);\n };\n }\n\n const callbacks: (() => void)[] = [];\n // if(peerFull.about) {\n callbacks.push(() => {\n this.bio.subtitle.replaceChildren(i18n(peerId.isUser() ? 'UserBio' : 'Info'));\n setText(peerFull.about ? wrapRichText(peerFull.about) : undefined, this.bio);\n });\n // }\n\n if(!peerId.isUser()) {\n const chat = await m(this.managers.appChatsManager.getChat(peerId.toChatId())) as Chat.channel;\n const usernames = getPeerActiveUsernames(chat);\n let also: HTMLElement;\n if(usernames.length) {\n also = this.getUsernamesAlso(usernames);\n callbacks.push(() => setText('https://t.me/' + usernames[0], this.link));\n } else {\n const exportedInvite = (peerFull as ChatFull.channelFull).exported_invite;\n if(exportedInvite?._ === 'chatInviteExported') {\n callbacks.push(() => setText(exportedInvite.link, this.link));\n }\n }\n\n callbacks.push(() => this.link.subtitle.replaceChildren(also || i18n('SetUrlPlaceholder')));\n }\n\n const location = (peerFull as ChatFull.channelFull).location;\n if(location?._ == 'channelLocation') {\n callbacks.push(() => setText(location.address, this.location));\n }\n\n this.setMoreDetailsTimeout = window.setTimeout(() => this.setMoreDetails(true), 60e3);\n\n return () => {\n callbacks.forEach((callback) => callback());\n };\n }\n\n private async setMoreDetails(override?: true, manual?: Promise) {\n this.clearSetMoreDetailsTimeout();\n\n const {peerId} = this;\n const m = this.getMiddlewarePromise();\n\n if(!peerId || !this.canBeDetailed() || await m(this.managers.appPeersManager.isPeerRestricted(peerId))) {\n return;\n }\n\n const result = await m(this.managers.acknowledged.appProfileManager.getProfileByPeerId(peerId, override));\n const setPromise = m(result.result).then(async(peerFull) => {\n if(await m(this.managers.appPeersManager.isPeerRestricted(peerId))) {\n // this.log.warn('peer changed');\n return;\n }\n\n return await m(this._setMoreDetails(peerId, peerFull));\n });\n\n if(result.cached && manual) {\n return setPromise;\n } else {\n (manual || Promise.resolve())\n .then(() => setPromise)\n .then((callback) => {\n callback?.();\n });\n }\n }\n\n private getMiddlewarePromise() {\n return middlewarePromise(this.middlewareHelper.get(), makeError('MIDDLEWARE'));\n }\n\n public setPeer(peerId: PeerId, threadId?: number) {\n if(this.peerId === peerId && this.threadId === threadId) return;\n\n this.init?.();\n\n this.peerId = peerId;\n this.threadId = threadId;\n\n this.middlewareHelper.clean();\n this.cleaned = true;\n }\n\n public clearSetMoreDetailsTimeout() {\n if(this.setMoreDetailsTimeout !== undefined) {\n clearTimeout(this.setMoreDetailsTimeout);\n this.setMoreDetailsTimeout = undefined;\n }\n }\n\n public destroy() {\n this.peerId = this.threadId = undefined;\n this.clearSetMoreDetailsTimeout();\n clearInterval(this.setPeerStatusInterval);\n this.avatars?.cleanup();\n this.middlewareHelper.destroy();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport mediaSizes from '../helpers/mediaSizes';\nimport {Middleware} from '../helpers/middleware';\nimport {Chat, Document, EmojiStatus, User} from '../layer';\nimport rootScope from '../lib/rootScope';\nimport generateFakeIcon from './generateFakeIcon';\nimport generatePremiumIcon from './generatePremiumIcon';\nimport generateVerifiedIcon from './generateVerifiedIcon';\nimport wrapSticker from './wrappers/sticker';\n\nexport default async function generateTitleIcons(\n peerId: PeerId,\n middleware?: Middleware,\n noVerifiedIcon?: boolean,\n noFakeIcon?: boolean,\n noPremiumIcon?: boolean\n) {\n const elements: HTMLElement[] = [];\n const peer: Chat | User = await rootScope.managers.appPeersManager.getPeer(peerId);\n if((peer as Chat.channel).pFlags.verified && !noVerifiedIcon) {\n elements.push(generateVerifiedIcon());\n }\n\n if(((peer as Chat.channel).pFlags.fake || (peer as User.user).pFlags.scam) && !noFakeIcon) {\n elements.push(generateFakeIcon((peer as User.user).pFlags.scam));\n }\n\n if((peer as User.user).pFlags.premium && !noPremiumIcon) {\n const emojiStatus = (peer as User.user).emoji_status;\n if(emojiStatus && emojiStatus._ !== 'emojiStatusEmpty' && false) {\n const container = document.createElement('span');\n container.classList.add('emoji-status');\n const result = await rootScope.managers.acknowledged.appEmojiManager.getCustomEmojiDocument((emojiStatus as EmojiStatus.emojiStatus).document_id);\n const wrap = async(doc: Document.document) => {\n const size = mediaSizes.active.emojiStatus\n const loadPromises: Promise[] = [];\n await wrapSticker({\n doc,\n div: container,\n width: size.width,\n height: size.height,\n loop: 2,\n play: true,\n group: 'EMOJI-STATUS',\n loadPromises,\n middleware\n // group: 'none'\n });\n\n await Promise.all(loadPromises);\n };\n\n const p = result.result.then(wrap);\n if(result.cached) {\n await p;\n }\n\n elements.push(container);\n } else {\n elements.push(generatePremiumIcon());\n }\n }\n\n return elements;\n}\n","export default function generateVerifiedIcon() {\n const span = document.createElement('span');\n span.classList.add('verified-icon', 'tgico');\n\n const size = 26; // 24\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttributeNS(null, 'viewBox', `0 0 ${size} ${size}`);\n svg.setAttributeNS(null, 'width', `${size}`);\n svg.setAttributeNS(null, 'height', `${size}`);\n svg.classList.add('verified-icon-svg');\n\n const use = document.createElementNS('http://www.w3.org/2000/svg', 'use');\n use.setAttributeNS(null, 'href', '#verified-icon-background');\n use.classList.add('verified-icon-background');\n\n const use2 = document.createElementNS('http://www.w3.org/2000/svg', 'use');\n use2.setAttributeNS(null, 'href', '#verified-icon-check');\n use2.classList.add('verified-icon-check');\n\n // svg.append(use, use2);\n svg.append(use2, use);\n\n span.append(svg);\n\n return span;\n // const span = document.createElement('span');\n // span.classList.add('verified-icon', 'tgico-verified_filled');\n // return span;\n}\n","export default function generatePremiumIcon() {\n const span = document.createElement('span');\n span.classList.add('premium-icon', 'tgico-star');\n return span;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../lib/rootScope';\nimport {i18n} from '../lib/langPack';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport {NULL_PEER_ID} from '../lib/mtproto/mtproto_config';\nimport limitSymbols from '../helpers/string/limitSymbols';\nimport setInnerHTML, {setDirection} from '../helpers/dom/setInnerHTML';\nimport safeAssign from '../helpers/object/safeAssign';\nimport wrapEmojiText from '../lib/richTextProcessor/wrapEmojiText';\nimport getPeerTitle from './wrappers/getPeerTitle';\nimport generateTitleIcons from './generateTitleIcons';\nimport {wrapTopicIcon} from './wrappers/messageActionTextNewUnsafe';\n\nexport type PeerTitleOptions = {\n peerId?: PeerId,\n fromName?: string,\n plainText?: boolean,\n onlyFirstName?: boolean,\n dialog?: boolean,\n limitSymbols?: number,\n withIcons?: boolean,\n withPremiumIcon?: boolean,\n threadId?: number,\n wrapOptions?: WrapSomethingOptions\n};\n\nconst weakMap: WeakMap = new WeakMap();\n\nrootScope.addEventListener('peer_title_edit', ({peerId, threadId}) => {\n let query = `.peer-title[data-peer-id=\"${peerId}\"]`;\n if(threadId) {\n query += `[data-thread-id=\"${threadId}\"]`;\n }\n\n const elements = Array.from(document.querySelectorAll(query)) as HTMLElement[];\n elements.forEach((element) => {\n const peerTitle = weakMap.get(element);\n peerTitle?.update();\n });\n});\n\nexport default class PeerTitle {\n public element: HTMLElement;\n public options: PeerTitleOptions;\n private hasInner: boolean;\n\n constructor(options?: PeerTitleOptions) {\n this.element = document.createElement('span');\n this.element.classList.add('peer-title');\n setDirection(this.element);\n\n this.options = {};\n\n if(options) {\n this.update(options);\n }\n\n weakMap.set(this.element, this);\n }\n\n public setOptions(options?: PeerTitleOptions) {\n if(!options) {\n return;\n }\n\n safeAssign(this.options, options);\n for(const i in options) {\n // @ts-ignore\n const value = options[i];\n\n if(typeof(value) !== 'object' && typeof(value) !== 'function') {\n // @ts-ignore\n this.element.dataset[i] = value ? '' + (typeof(value) === 'boolean' ? +value : value) : '0';\n }\n }\n }\n\n private setHasInner(hasInner: boolean) {\n if(this.hasInner !== hasInner) {\n this.hasInner = hasInner;\n this.element.classList.toggle('with-icons', hasInner);\n }\n }\n\n public async update(options?: PeerTitleOptions) {\n this.setOptions(options);\n\n let fromName = this.options.fromName;\n if(fromName !== undefined) {\n if(this.options.limitSymbols !== undefined) {\n fromName = limitSymbols(fromName, this.options.limitSymbols, this.options.limitSymbols);\n }\n\n setInnerHTML(this.element, wrapEmojiText(fromName));\n return;\n }\n\n this.options.peerId ??= NULL_PEER_ID;\n\n let hasInner: boolean;\n const {peerId, threadId} = this.options;\n if(peerId !== rootScope.myId || !this.options.dialog) {\n if(threadId) {\n const [topic, isForum] = await Promise.all([\n rootScope.managers.dialogsStorage.getForumTopic(peerId, threadId),\n rootScope.managers.appPeersManager.isForum(peerId)\n ]);\n\n if(!topic && isForum) {\n rootScope.managers.dialogsStorage.getForumTopicById(peerId, threadId).then((forumTopic) => {\n if(!forumTopic && this.options.threadId === threadId) {\n this.options.threadId = undefined;\n this.update({threadId: undefined});\n return;\n }\n\n this.update();\n }, () => {\n if(this.options.threadId === threadId) {\n this.options.threadId = undefined;\n this.update({threadId: undefined});\n }\n });\n\n setInnerHTML(this.element, i18n('Loading'));\n this.setHasInner(false);\n return;\n }\n }\n\n const getTopicIconPromise = threadId && this.options.withIcons ?\n rootScope.managers.dialogsStorage.getForumTopic(peerId, threadId).then((topic) => wrapTopicIcon({...(this.options.wrapOptions ?? {}), topic})) :\n undefined;\n\n const [title, icons, topicIcon] = await Promise.all([\n getPeerTitle(this.options as Required),\n (this.options.withIcons && generateTitleIcons(peerId, this.options.wrapOptions?.middleware)) || (this.options.withPremiumIcon && generateTitleIcons(peerId, this.options.wrapOptions?.middleware, true, true)),\n getTopicIconPromise\n ]);\n\n if(icons?.length || topicIcon) {\n const inner = document.createElement('span');\n inner.classList.add('peer-title-inner');\n hasInner = true;\n setInnerHTML(inner, title);\n\n const fragment = document.createDocumentFragment();\n fragment.append(...[topicIcon, inner, ...(icons ?? [])].filter(Boolean));\n setInnerHTML(this.element, fragment);\n } else {\n setInnerHTML(this.element, title);\n }\n } else {\n replaceContent(this.element, i18n(this.options.onlyFirstName ? 'Saved' : 'SavedMessages'));\n }\n\n this.setHasInner(hasInner);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AppDownloadManager} from '../../lib/appManagers/appDownloadManager';\nimport resizeableImage from '../../lib/cropper';\nimport PopupElement from '.';\nimport {_i18n} from '../../lib/langPack';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport readBlobAsDataURL from '../../helpers/blob/readBlobAsDataURL';\nimport rootScope from '../../lib/rootScope';\nimport appDownloadManager from '../../lib/appManagers/appDownloadManager';\n\nexport default class PopupAvatar extends PopupElement {\n private cropContainer: HTMLElement;\n private input: HTMLInputElement;\n private h6: HTMLElement;\n\n private image = new Image();\n\n private canvas: HTMLCanvasElement;\n private blob: Blob;\n private cropper = {\n crop: () => {},\n removeHandlers: () => {}\n };\n\n private onCrop: (upload: () => ReturnType) => void;\n\n constructor(options: Partial<{\n isForum: boolean\n }> = {}) {\n super('popup-avatar', {closable: true, withConfirm: true});\n\n this.h6 = document.createElement('h6');\n _i18n(this.h6, 'Popup.Avatar.Title');\n\n this.btnClose.classList.remove('btn-icon');\n\n this.header.append(this.h6);\n\n this.cropContainer = document.createElement('div');\n this.cropContainer.classList.add('crop');\n this.cropContainer.append(this.image);\n\n if(options.isForum) {\n this.cropContainer.classList.add('is-forum');\n }\n\n this.input = document.createElement('input');\n this.input.type = 'file';\n this.input.style.display = 'none';\n this.listenerSetter.add(this.input)('change', (e: any) => {\n const file = e.target.files[0];\n if(!file) {\n return;\n }\n\n readBlobAsDataURL(file).then((contents) => {\n this.image = new Image();\n this.cropContainer.append(this.image);\n this.image.src = contents;\n\n this.image.onload = () => {\n /* let {w, h} = calcImageInBox(this.image.naturalWidth, this.image.naturalHeight, 460, 554);\n cropContainer.style.width = w + 'px';\n cropContainer.style.height = h + 'px'; */\n this.show();\n\n this.cropper = resizeableImage(this.image, this.canvas);\n this.input.value = '';\n };\n });\n }, false);\n\n this.btnConfirm.className = 'btn-primary btn-color-primary btn-circle btn-crop btn-icon tgico-check z-depth-1';\n attachClickEvent(this.btnConfirm, () => {\n this.cropper.crop();\n this.hide();\n\n this.canvas.toBlob((blob) => {\n this.blob = blob; // save blob to send after reg\n this.darkenCanvas();\n this.resolve();\n }, 'image/jpeg', 1);\n }, {listenerSetter: this.listenerSetter});\n\n this.container.append(this.cropContainer, this.btnConfirm, this.input);\n\n this.addEventListener('closeAfterTimeout', () => {\n this.cropper.removeHandlers();\n if(this.image) {\n this.image.remove();\n }\n });\n }\n\n private resolve() {\n this.onCrop(() => {\n return appDownloadManager.upload(this.blob);\n });\n }\n\n public open(postCanvas: HTMLCanvasElement, onCrop: PopupAvatar['onCrop']) {\n this.canvas = postCanvas;\n this.onCrop = onCrop;\n\n this.input.click();\n }\n\n public darkenCanvas() {\n const ctx = this.canvas.getContext('2d');\n ctx.fillStyle = 'rgba(0, 0, 0, 0.3)';\n ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nfunction resizeableImage(originalImage: HTMLImageElement, canvas?: HTMLCanvasElement) {\n let cropComponent: HTMLDivElement,\n container: HTMLDivElement,\n cropImage: HTMLImageElement,\n event_state: Partial<{\n mouse_x: number,\n mouse_y: number,\n container_width: number,\n container_height: number,\n container_left: number,\n container_top: number\n }> = {},\n keyZoomValue = 4.0,\n MINWIDTH = 50,\n MINHEIGHT = 50,\n CROPWIDTH = 200,\n CROPHEIGHT = 200,\n cropLeft = 0,\n cropTop = 0,\n cropWidth = 0,\n cropHeight = 0,\n scaledRatio = 0;\n\n if(originalImage.complete) init();\n else originalImage.onload = init;\n\n function removeHandlers() {\n container.removeEventListener('mousedown', startMoving);\n container.removeEventListener('touchstart', startMoving);\n container.removeEventListener('wheel', resizing);\n\n document.removeEventListener('mouseup', endMoving);\n document.removeEventListener('touchend', endMoving);\n document.removeEventListener('mousemove', moving);\n document.removeEventListener('touchmove', moving);\n document.removeEventListener('keypress', keyHandler);\n\n cropComponent.remove();\n container.remove();\n cropImage.remove();\n }\n\n function addHandlers() {\n container.addEventListener('mousedown', startMoving, false);\n container.addEventListener('touchstart', startMoving, false);\n container.addEventListener('wheel', resizing, false);\n\n document.addEventListener('keypress', keyHandler, false);\n // document.querySelector('.btn-crop').addEventListener('click', openCropCanvasImg);\n }\n\n function init() {\n originalImage.classList.add('crop-blur');\n originalImage.draggable = false;\n\n cropImage = new Image();\n cropImage.src = originalImage.src;\n cropImage.draggable = false;\n cropImage.classList.add('crop-overlay-image');\n\n if(!canvas) {\n canvas = document.createElement('canvas');\n }\n\n cropComponent = document.createElement('div');\n cropComponent.classList.add('crop-component');\n\n container = document.createElement('div');\n container.classList.add('crop-overlay');\n\n const overlayColor = document.createElement('div');\n overlayColor.classList.add('crop-overlay-color');\n\n cropComponent.appendChild(container);\n const wrapper = originalImage.parentNode as HTMLElement;\n wrapper.appendChild(cropComponent);\n cropComponent.appendChild(cropImage);\n cropComponent.appendChild(originalImage);\n cropComponent.appendChild(overlayColor);\n container.appendChild(cropImage);\n\n cropImage.style.maxWidth = originalImage.width + 'px';\n\n scaledRatio = originalImage.naturalWidth / originalImage.offsetWidth;\n\n const left = originalImage.offsetWidth / 2 - CROPWIDTH / 2;\n const top = originalImage.offsetHeight / 2 - CROPHEIGHT / 2;\n\n updateCropSize(CROPWIDTH, CROPHEIGHT);\n updateCropImage(left, top);\n updateContainer(left, top);\n addHandlers();\n // crop();\n }\n\n function updateCropSize(width: number, height: number) {\n cropWidth = width * scaledRatio;\n cropHeight = height * scaledRatio;\n\n container.style.width = width + 'px';\n container.style.height = height + 'px';\n }\n\n function updateCropImage(left: number, top: number) {\n cropTop = top * scaledRatio;\n cropLeft = left * scaledRatio;\n\n cropImage.style.top = -top + 'px';\n cropImage.style.left = -left + 'px';\n }\n\n function updateContainer(left: number, top: number) {\n container.style.top = top + 'px';\n container.style.left = left + 'px';\n }\n\n // Save the initial event details and container state\n function saveEventState(e: any) {\n event_state.container_width = container.offsetWidth;\n event_state.container_height = container.offsetHeight;\n\n event_state.container_left = container.offsetLeft;\n event_state.container_top = container.offsetTop;\n\n event_state.mouse_x = (e.clientX || e.pageX || e.touches && e.touches[0].clientX) + window.scrollX;\n event_state.mouse_y = (e.clientY || e.pageY || e.touches && e.touches[0].clientY) + window.scrollY;\n }\n\n function imgZoom(zoom: number) {\n zoom = zoom * Math.PI * 2\n let newWidth = Math.floor(container.clientWidth + zoom),\n newHeight = Math.floor(container.clientHeight + zoom),\n w = cropImage.clientWidth,\n h = cropImage.clientHeight,\n left: number,\n top: number,\n right: number,\n bottom: number;\n\n if(newWidth < MINWIDTH) {\n return;\n } else if(newWidth > w) {\n return;\n }\n\n left = container.offsetLeft - (zoom / 2);\n top = container.offsetTop - (zoom / 2);\n right = left + newWidth;\n bottom = top + newHeight;\n\n if(left < 0) left = 0;\n if(top < 0) top = 0;\n\n if(right > w) return;\n if(bottom > h) return;\n\n updateCropSize(newWidth, newWidth);\n updateCropImage(left, top);\n updateContainer(left, top);\n // crop();\n }\n\n function keyHandler(e: KeyboardEvent) {\n e.preventDefault();\n\n switch(String.fromCharCode(e.charCode)) {\n case '+':\n imgZoom(keyZoomValue);\n break;\n case '-':\n imgZoom(-keyZoomValue);\n break;\n }\n }\n\n function resizing(e: any) {\n e.preventDefault();\n imgZoom(e.deltaY > 0 ? 1 : -1);\n }\n\n function startMoving(e: MouseEvent | TouchEvent) {\n e.preventDefault();\n e.stopPropagation();\n\n saveEventState(e);\n\n document.addEventListener('mousemove', moving);\n document.addEventListener('touchmove', moving);\n document.addEventListener('mouseup', endMoving);\n document.addEventListener('touchend', endMoving);\n }\n\n function endMoving(e: MouseEvent | TouchEvent) {\n e.preventDefault();\n\n document.removeEventListener('mouseup', endMoving);\n document.removeEventListener('touchend', endMoving);\n document.removeEventListener('mousemove', moving);\n document.removeEventListener('touchmove', moving);\n }\n\n function moving(e: any) {\n let currentTouch = {x: 0, y: 0},\n left: number,\n top: number,\n w: number,\n h: number;\n\n e.preventDefault();\n e.stopPropagation();\n\n currentTouch.x = e.pageX || e.touches && e.touches[0].pageX;\n currentTouch.y = e.pageY || e.touches && e.touches[0].pageY;\n\n left = currentTouch.x - (event_state.mouse_x - event_state.container_left);\n top = currentTouch.y - (event_state.mouse_y - event_state.container_top);\n w = container.offsetWidth;\n h = container.offsetHeight;\n\n if(left < 0) left = 0;\n else if(left > cropImage.offsetWidth - w) left = cropImage.offsetWidth - w;\n\n if(top < 0) top = 0;\n else if(top > cropImage.offsetHeight - h) top = cropImage.offsetHeight - h;\n\n updateCropImage(left, top);\n updateContainer(left, top);\n // crop();\n }\n\n function crop() {\n canvas.width = cropWidth;\n canvas.height = cropHeight;\n\n const ctx = canvas.getContext('2d');\n ctx.drawImage(originalImage,\n cropLeft, cropTop,\n cropWidth, cropHeight,\n 0, 0,\n cropWidth, cropHeight\n );\n }\n\n return {crop, removeHandlers};\n}\n\nexport default resizeableImage;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement, {PopupOptions} from '.';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport I18n, {FormatterArguments, i18n, LangPackKey} from '../../lib/langPack';\nimport InputField from '../inputField';\n\nexport default class PopupDatePicker extends PopupElement {\n protected controlsDiv: HTMLElement;\n protected monthTitle: HTMLElement;\n protected prevBtn: HTMLElement;\n protected nextBtn: HTMLElement;\n\n protected monthsContainer: HTMLElement;\n protected month: HTMLElement;\n\n protected minMonth: Date;\n protected maxMonth: Date;\n protected minDate: Date;\n protected maxDate: Date;\n protected selectedDate: Date;\n protected selectedMonth: Date;\n protected selectedEl: HTMLElement;\n\n protected timeDiv: HTMLDivElement;\n protected hoursInputField: InputField;\n protected minutesInputField: InputField;\n\n constructor(initDate: Date, public onPick: (timestamp: number) => void, protected options: Partial<{\n noButtons: true,\n noTitle: true,\n minDate: Date,\n maxDate: Date\n withTime: true,\n showOverflowMonths: true\n }> & PopupOptions = {}) {\n super('popup-date-picker', {\n body: true,\n overlayClosable: true,\n buttons: options.noButtons ? [] : [{\n langKey: 'JumpToDate',\n callback: () => {\n if(this.onPick) {\n this.onPick(this.selectedDate.getTime() / 1000 | 0);\n }\n }\n }, {\n langKey: 'Cancel',\n isCancel: true\n }],\n title: true,\n ...options\n });\n\n this.minDate = options.minDate || new Date('2013-08-01T00:00:00');\n\n if(initDate < this.minDate) {\n initDate.setFullYear(this.minDate.getFullYear(), this.minDate.getMonth(), this.minDate.getDate());\n }\n\n // Controls\n this.controlsDiv = document.createElement('div');\n this.controlsDiv.classList.add('date-picker-controls');\n\n this.prevBtn = document.createElement('button');\n this.prevBtn.classList.add('btn-icon', 'tgico-down', 'date-picker-prev');\n attachClickEvent(this.prevBtn, this.onPrevClick, {listenerSetter: this.listenerSetter});\n\n this.nextBtn = document.createElement('button');\n this.nextBtn.classList.add('btn-icon', 'tgico-down', 'date-picker-next');\n attachClickEvent(this.nextBtn, this.onNextClick, {listenerSetter: this.listenerSetter});\n\n this.monthTitle = document.createElement('div');\n this.monthTitle.classList.add('date-picker-month-title');\n\n this.controlsDiv.append(this.prevBtn, this.monthTitle, this.nextBtn);\n\n // Month\n this.monthsContainer = document.createElement('div');\n this.monthsContainer.classList.add('date-picker-months');\n attachClickEvent(this.monthsContainer, this.onDateClick, {listenerSetter: this.listenerSetter});\n\n this.body.append(this.controlsDiv, this.monthsContainer);\n\n // Time inputs\n if(options.withTime) {\n this.timeDiv = document.createElement('div');\n this.timeDiv.classList.add('date-picker-time');\n\n const delimiter = document.createElement('div');\n delimiter.classList.add('date-picker-time-delimiter');\n delimiter.append(':');\n\n const handleTimeInput = (max: number, inputField: InputField, onInput: (length: number) => void, onOverflow?: (number: number) => void) => {\n const maxString = '' + max;\n this.listenerSetter.add(inputField.input)('input', (e) => {\n let value = inputField.value.replace(/\\D/g, '');\n if(value.length > 2) {\n value = value.slice(0, 2);\n } else {\n if((value.length === 1 && +value[0] > +maxString[0]) || (value.length === 2 && +value > max)) {\n if(value.length === 2 && onOverflow) {\n onOverflow(+value[1]);\n }\n\n value = '0' + value[0];\n }\n }\n\n inputField.setValueSilently(value);\n onInput(value.length);\n });\n };\n\n this.hoursInputField = new InputField({plainText: true});\n this.minutesInputField = new InputField({plainText: true});\n\n handleTimeInput(23, this.hoursInputField, (length) => {\n if(length === 2) {\n this.minutesInputField.input.focus();\n }\n\n this.setTimeTitle();\n }, (number) => {\n this.minutesInputField.value = (number + this.minutesInputField.value).slice(0, 2);\n });\n handleTimeInput(59, this.minutesInputField, (length) => {\n if(!length) {\n this.hoursInputField.input.focus();\n }\n\n this.setTimeTitle();\n });\n\n this.selectedDate = initDate;\n\n initDate.setMinutes(initDate.getMinutes() + 10);\n\n this.hoursInputField.setValueSilently(('0' + initDate.getHours()).slice(-2));\n this.minutesInputField.setValueSilently(('0' + initDate.getMinutes()).slice(-2));\n\n initDate.setHours(0, 0, 0, 0);\n\n this.timeDiv.append(this.hoursInputField.container, delimiter, this.minutesInputField.container);\n\n attachClickEvent(this.btnConfirm, () => {\n if(this.onPick) {\n this.selectedDate.setHours(+this.hoursInputField.value || 0, +this.minutesInputField.value || 0, 0, 0);\n this.onPick(this.selectedDate.getTime() / 1000 | 0);\n }\n\n this.hide();\n }, {listenerSetter: this.listenerSetter});\n\n this.body.append(this.timeDiv);\n\n this.prevBtn.classList.add('primary');\n this.nextBtn.classList.add('primary');\n }\n\n const popupCenterer = document.createElement('div');\n popupCenterer.classList.add('popup-centerer');\n popupCenterer.append(this.container);\n this.element.append(popupCenterer);\n\n // const passed = (initDate.getTime() - (initDate.getTimezoneOffset() * 60000)) % 86400000;\n // this.selectedDate = this.maxDate = new Date(initDate.getTime() - passed);\n initDate.setHours(0, 0, 0, 0);\n this.selectedDate = initDate;\n\n this.maxDate = options.maxDate || new Date();\n this.maxDate.setHours(0, 0, 0, 0);\n\n this.selectedMonth = new Date(this.selectedDate);\n this.selectedMonth.setDate(1);\n\n this.maxMonth = new Date(this.maxDate);\n this.maxMonth.setDate(1);\n\n this.minMonth = new Date(this.minDate);\n this.minMonth.setHours(0, 0, 0, 0);\n this.minMonth.setDate(1);\n\n if(this.selectedMonth.getTime() === this.minMonth.getTime()) {\n this.prevBtn.setAttribute('disabled', 'true');\n }\n\n if(this.selectedMonth.getTime() === this.maxMonth.getTime()) {\n this.nextBtn.setAttribute('disabled', 'true');\n }\n\n if(options.noTitle) {\n this.setTitle = () => {};\n }\n\n this.setTimeTitle();\n this.setTitle();\n this.setMonth();\n }\n\n onPrevClick = (e: MouseEvent) => {\n this.selectedMonth.setMonth(this.selectedMonth.getMonth() - 1);\n this.setMonth();\n\n if(this.selectedMonth.getTime() === this.minMonth.getTime()) {\n this.prevBtn.setAttribute('disabled', 'true');\n }\n\n this.nextBtn.removeAttribute('disabled');\n };\n\n onNextClick = (e: MouseEvent) => {\n this.selectedMonth.setMonth(this.selectedMonth.getMonth() + 1);\n this.setMonth();\n\n if(this.selectedMonth.getTime() === this.maxMonth.getTime()) {\n this.nextBtn.setAttribute('disabled', 'true');\n }\n\n this.prevBtn.removeAttribute('disabled');\n };\n\n onDateClick = (e: MouseEvent) => {\n // cancelEvent(e);\n const target = e.target as HTMLElement;\n\n if(!target.dataset.timestamp) return;\n\n if(this.selectedEl) {\n if(this.selectedEl === target) return;\n this.selectedEl.classList.remove('active');\n }\n\n this.selectedEl = target;\n\n target.classList.add('active');\n const timestamp = +target.dataset.timestamp;\n\n this.selectedDate = new Date(timestamp);\n\n this.setTitle();\n this.setTimeTitle();\n };\n\n public setTimeTitle() {\n if(this.btnConfirm && this.selectedDate) {\n let key: LangPackKey;\n const args: FormatterArguments = [];\n const date = new Date();\n date.setHours(0, 0, 0, 0);\n\n const timeOptions: Intl.DateTimeFormatOptions = {\n minute: '2-digit',\n hour: '2-digit'\n };\n\n const sendDate = new Date(this.selectedDate.getTime());\n sendDate.setHours(+this.hoursInputField.value, +this.minutesInputField.value);\n\n if(this.selectedDate.getTime() === date.getTime()) {\n key = 'Schedule.SendToday';\n }/* else if(this.selectedDate.getTime() === (date.getTime() + 86400e3)) {\n dayStr = 'Tomorrow';\n } */ else {\n key = 'Schedule.SendDate';\n\n const dateOptions: Intl.DateTimeFormatOptions = {\n month: 'short',\n day: 'numeric'\n };\n\n if(sendDate.getFullYear() !== date.getFullYear()) {\n dateOptions.year = 'numeric';\n }\n\n args.push(new I18n.IntlDateElement({\n date: sendDate,\n options: dateOptions\n }).element);\n }\n\n args.push(new I18n.IntlDateElement({\n date: sendDate,\n options: timeOptions\n }).element);\n\n this.btnConfirm.firstChild.replaceWith(i18n(key, args));\n }\n }\n\n public setTitle() {\n // const splitted = this.selectedDate.toString().split(' ', 3);\n // this.title.innerText = splitted[0] + ', ' + splitted[1] + ' ' + splitted[2];\n this.title.textContent = '';\n this.title.append(new I18n.IntlDateElement({\n date: this.selectedDate,\n options: {\n day: 'numeric',\n month: 'long',\n weekday: 'short'\n }\n }).element);\n }\n\n private renderElement(disabled: boolean, innerText: string | HTMLElement = '') {\n const el = document.createElement('button');\n el.classList.add('btn-icon', 'date-picker-month-date');\n\n if(disabled) {\n el.setAttribute('disabled', 'true');\n }\n\n if(innerText) {\n el.append(innerText);\n }\n\n return el;\n }\n\n public setMonth() {\n const firstDate = new Date(this.selectedMonth);\n\n const options: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: this.timeDiv && mediaSizes.isMobile ? 'short' : 'long'\n };\n\n this.monthTitle.textContent = '';\n this.monthTitle.append(new I18n.IntlDateElement({date: firstDate, options}).element);\n // this.monthTitle.innerText = (this.timeDiv && mediaSizes.isMobile ? monthName.slice(0, 3) : monthName) + ' ' + this.selectedMonth.getFullYear();\n\n if(this.month) {\n this.month.remove();\n }\n\n this.month = document.createElement('div');\n this.month.classList.add('date-picker-month');\n\n const weekStartDate = new Date();\n const day = weekStartDate.getDay();\n if(day !== 1) {\n weekStartDate.setHours(-24 * (day - 1));\n }\n\n for(let i = 0; i < 7; ++i) {\n const el = this.renderElement(true, new I18n.IntlDateElement({date: weekStartDate, options: {weekday: 'narrow'}}).element);\n el.classList.remove('date-picker-month-date');\n el.classList.add('date-picker-month-day');\n this.month.append(el);\n weekStartDate.setDate(weekStartDate.getDate() + 1);\n }\n\n // 0 - sunday\n let dayIndex = firstDate.getDay() - 1;\n if(dayIndex === -1) dayIndex = 7 - 1;\n\n const clonedDate = new Date(firstDate.getTime());\n clonedDate.setDate(clonedDate.getDate() - dayIndex - 1);\n\n // Padding first week\n for(let i = 0; i < dayIndex; ++i) {\n if(this.options.showOverflowMonths) {\n clonedDate.setDate(clonedDate.getDate() + 1);\n this.month.append(this.renderElement(true, '' + clonedDate.getDate()));\n } else {\n this.month.append(this.renderElement(true));\n }\n }\n\n do {\n const date = firstDate.getDate();\n const el = this.renderElement(firstDate > this.maxDate || firstDate < this.minDate, '' + date);\n el.dataset.timestamp = '' + firstDate.getTime();\n\n if(firstDate.getTime() === this.selectedDate.getTime()) {\n this.selectedEl = el;\n el.classList.add('active');\n }\n\n this.month.append(el);\n\n firstDate.setDate(date + 1);\n } while(firstDate.getDate() !== 1);\n\n const remainder = this.month.childElementCount % 7;\n if(this.options.showOverflowMonths && remainder) {\n for(let i = remainder; i < 7; ++i) {\n this.month.append(this.renderElement(true, '' + firstDate.getDate()));\n firstDate.setDate(firstDate.getDate() + 1);\n }\n }\n\n const lines = Math.ceil(this.month.childElementCount / 7);\n this.container.dataset.lines = '' + lines;\n\n this.monthsContainer.append(this.month);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport type {PeerType} from '../../lib/appManagers/appPeersManager';\nimport {FormatterArguments, LangPackKey} from '../../lib/langPack';\nimport wrapPeerTitle from '../wrappers/peerTitle';\nimport PopupPeer, {PopupPeerButtonCallbackCheckboxes, PopupPeerOptions} from './peer';\n\nexport default class PopupDeleteDialog {\n constructor(\n private peerId: PeerId,\n // actionType: 'leave' | 'delete',\n private peerType?: PeerType,\n private onSelect?: (promise: Promise) => void,\n private threadId?: number\n ) {\n this.construct();\n }\n\n private async construct() {\n let {peerId, peerType, onSelect, threadId} = this;\n const peerTitleElement = await wrapPeerTitle({peerId, threadId: threadId});\n\n const managers = PopupElement.MANAGERS;\n if(peerType === undefined) {\n peerType = await managers.appPeersManager.getDialogType(peerId);\n }\n\n /* const callbackFlush = (checked: PopupPeerButtonCallbackCheckboxes) => {\n const promise = appMessagesManager.flushHistory(peerId, checkboxes ? !checked[checkboxes[0].text] : undefined);\n onSelect && onSelect(promise);\n }; */\n\n const callbackLeave = (checked: PopupPeerButtonCallbackCheckboxes, flush = checkboxes && !!checked.size) => {\n let promise = managers.appChatsManager.leave(peerId.toChatId());\n\n if(flush) {\n promise = promise.then(() => {\n return managers.appMessagesManager.flushHistory(peerId);\n }) as any;\n }\n\n onSelect?.(promise);\n };\n\n const callbackDelete = (checked: PopupPeerButtonCallbackCheckboxes) => {\n let promise: Promise;\n\n if(threadId) {\n promise = managers.appMessagesManager.flushHistory(peerId, false, true, threadId);\n } else if(peerId.isUser()) {\n promise = managers.appMessagesManager.flushHistory(peerId, false, checkboxes ? !!checked.size : undefined);\n } else {\n if(checked.size) {\n promise = managers.appChatsManager.delete(peerId.toChatId());\n } else {\n return callbackLeave(checked);\n }\n }\n\n onSelect?.(promise);\n };\n\n let title: LangPackKey,\n titleArgs: FormatterArguments,\n description: LangPackKey,\n descriptionArgs: FormatterArguments,\n buttons: PopupPeerOptions['buttons'],\n checkboxes: PopupPeerOptions['checkboxes'];\n switch(peerType) {\n case 'channel': {\n if(/* actionType === 'delete' && */await managers.appChatsManager.hasRights(peerId.toChatId(), 'delete_chat')) {\n title = 'ChannelDeleteMenu';\n description = 'AreYouSureDeleteAndExitChannel';\n buttons = [{\n langKey: 'ChannelDeleteMenu',\n isDanger: true,\n callback: callbackDelete\n }];\n\n checkboxes = [{\n text: 'DeleteChannelForAll'\n }];\n } else {\n title = 'LeaveChannelMenu';\n description = 'ChannelLeaveAlertWithName';\n descriptionArgs = [peerTitleElement];\n buttons = [{\n langKey: 'LeaveChannel',\n isDanger: true,\n callback: callbackLeave\n }];\n }\n\n break;\n }\n\n /* case 'megagroup': {\n title = 'Leave Group?';\n description = `Are you sure you want to leave this group?`;\n buttons = [{\n text: 'LEAVE ' + peerTitleElement,\n isDanger: true,\n callback: callbackLeave\n }];\n\n break;\n } */\n\n case 'chat': {\n title = 'DeleteChatUser';\n description = 'AreYouSureDeleteThisChatWithUser';\n descriptionArgs = [peerTitleElement];\n\n buttons = [{\n langKey: 'DeleteChatUser',\n isDanger: true,\n callback: callbackDelete\n }];\n\n checkboxes = [{\n text: 'DeleteMessagesOptionAlso',\n textArgs: [\n await wrapPeerTitle({peerId})\n ]\n }];\n\n break;\n }\n\n case 'saved': {\n title = 'DeleteChatUser';\n description = 'AreYouSureDeleteThisChatSavedMessages';\n buttons = [{\n langKey: 'DeleteChatUser',\n isDanger: true,\n callback: callbackDelete\n }];\n\n break;\n }\n\n case 'megagroup':\n case 'group': {\n if(threadId) {\n title = 'DeleteTopics';\n titleArgs = [1];\n description = 'DeleteSelectedTopic';\n descriptionArgs = [peerTitleElement];\n buttons = [{\n langKey: 'Delete',\n isDanger: true,\n callback: callbackDelete\n }];\n } else if(/* actionType === 'delete' && */await managers.appChatsManager.hasRights(peerId.toChatId(), 'delete_chat')) {\n title = 'DeleteMegaMenu';\n description = 'AreYouSureDeleteAndExit';\n buttons = [{\n langKey: 'DeleteMegaMenu',\n isDanger: true,\n callback: callbackDelete\n }];\n\n checkboxes = [{\n text: 'DeleteChat.DeleteGroupForAll'\n }];\n } else {\n title = 'LeaveMegaMenu';\n description = 'AreYouSureDeleteAndExitName';\n descriptionArgs = [peerTitleElement];\n buttons = [{\n langKey: 'DeleteChatUser',\n isDanger: true,\n callback: (checkboxes) => callbackLeave(checkboxes, true)\n }];\n }\n\n break;\n }\n }\n\n PopupElement.createPopup(PopupPeer, 'popup-delete-chat', {\n peerId,\n threadId,\n titleLangKey: title,\n titleLangArgs: titleArgs,\n descriptionLangKey: description,\n descriptionLangArgs: descriptionArgs,\n buttons,\n checkboxes\n }).show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../../lib/rootScope';\nimport PopupElement, {addCancelButton} from '.';\nimport PopupPeer, {PopupPeerButtonCallbackCheckboxes, PopupPeerOptions} from './peer';\nimport {ChatType} from '../chat/chat';\nimport {i18n, LangPackKey} from '../../lib/langPack';\nimport hasRights from '../../lib/appManagers/utils/chats/hasRights';\nimport filterAsync from '../../helpers/array/filterAsync';\nimport wrapPeerTitle from '../wrappers/peerTitle';\n\nexport default class PopupDeleteMessages {\n constructor(\n private peerId: PeerId,\n private mids: number[],\n private type: ChatType,\n private onConfirm?: () => void,\n private threadId?: number\n ) {\n this.construct();\n }\n\n private async construct() {\n let {peerId, mids, type, onConfirm, threadId} = this;\n\n const peerTitleElement = await wrapPeerTitle({peerId, threadId});\n\n const managers = PopupElement.MANAGERS;\n\n mids = mids.slice();\n const callback = (checked: PopupPeerButtonCallbackCheckboxes, revoke?: boolean) => {\n onConfirm && onConfirm();\n if(type === 'scheduled') {\n managers.appMessagesManager.deleteScheduledMessages(peerId, mids);\n } else {\n managers.appMessagesManager.deleteMessages(peerId, mids, !!checked.size || revoke);\n }\n };\n\n const buttons: PopupPeerOptions['buttons'] = [{\n langKey: 'Delete',\n isDanger: true,\n callback\n }];\n const checkboxes: PopupPeerOptions['checkboxes'] = [];\n let title: LangPackKey, titleArgs: any[], description: LangPackKey, descriptionArgs: any[];\n if(mids.length === 1) {\n title = 'DeleteSingleMessagesTitle';\n } else {\n title = 'DeleteMessagesTitle';\n titleArgs = [i18n('messages', [mids.length])];\n }\n\n if(await managers.appPeersManager.isMegagroup(peerId)) {\n description = mids.length === 1 ? 'AreYouSureDeleteSingleMessageMega' : 'AreYouSureDeleteFewMessagesMega';\n } else {\n description = mids.length === 1 ? 'AreYouSureDeleteSingleMessage' : 'AreYouSureDeleteFewMessages';\n }\n\n if(peerId === rootScope.myId || type === 'scheduled') {\n\n } else {\n if(peerId.isUser()) {\n checkboxes.push({\n text: 'DeleteMessagesOptionAlso',\n textArgs: [peerTitleElement]\n });\n } else {\n const chat = await managers.appChatsManager.getChat(peerId.toChatId());\n\n const _hasRights = hasRights(chat, 'delete_messages');\n if(chat._ === 'chat') {\n const canRevoke = _hasRights ? mids.slice() : await filterAsync(mids, async(mid) => {\n const message = await managers.appMessagesManager.getMessageByPeer(peerId, mid);\n return message.fromId === rootScope.myId;\n });\n\n if(canRevoke.length) {\n if(canRevoke.length === mids.length) {\n checkboxes.push({\n text: 'DeleteForAll'\n });\n } else {\n checkboxes.push({\n text: 'DeleteMessagesOption'\n });\n\n description = 'DeleteMessagesTextGroup';\n descriptionArgs = [i18n('messages', [canRevoke.length])];\n // description = `You can also delete the ${canRevoke.length} message${canRevoke.length > 1 ? 's' : ''} you sent from the inboxes of other group members by pressing \"${buttonText}\".`;\n }\n }\n } else {\n buttons[0].callback = (checked) => callback(checked, true);\n }\n }\n }\n\n addCancelButton(buttons);\n\n const popup = PopupElement.createPopup(PopupPeer, 'popup-delete-chat', {\n peerId,\n threadId,\n titleLangKey: title,\n titleLangArgs: titleArgs,\n descriptionLangKey: description,\n descriptionLangArgs: descriptionArgs,\n buttons,\n checkboxes\n });\n\n popup.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {ChatRights} from '../../lib/appManagers/appChatsManager';\nimport flatten from '../../helpers/array/flatten';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport rootScope from '../../lib/rootScope';\nimport {toastNew} from '../toast';\nimport PopupPickUser from './pickUser';\nimport getMediaFromMessage from '../../lib/appManagers/utils/messages/getMediaFromMessage';\nimport PopupElement from '.';\n\nexport default class PopupForward extends PopupPickUser {\n constructor(\n peerIdMids?: {[fromPeerId: PeerId]: number[]},\n onSelect?: (peerId: PeerId) => Promise | void,\n chatRightsAction: ChatRights[] = ['send_plain']\n ) {\n super({\n peerTypes: ['dialogs', 'contacts'],\n onSelect: !peerIdMids && onSelect ? onSelect : async(peerId) => {\n if(onSelect) {\n const res = onSelect(peerId);\n if(res instanceof Promise) {\n await res;\n }\n }\n\n if(peerId === rootScope.myId) {\n let count = 0;\n for(const fromPeerId in peerIdMids) {\n const mids = peerIdMids[fromPeerId];\n count += mids.length;\n this.managers.appMessagesManager.forwardMessages(peerId, fromPeerId.toPeerId(), mids);\n }\n\n toastNew({\n langPackKey: count > 0 ? 'FwdMessagesToSavedMessages' : 'FwdMessageToSavedMessages'\n });\n\n return;\n }\n\n appImManager.setInnerPeer({peerId});\n appImManager.chat.input.initMessagesForward(peerIdMids);\n },\n placeholder: 'ShareModal.Search.ForwardPlaceholder',\n chatRightsActions: chatRightsAction,\n selfPresence: 'ChatYourSelf'\n });\n }\n\n public static async create(...args: ConstructorParameters) {\n const [peerIdMids] = args;\n const messagesPromises = Object.keys(peerIdMids).map((peerId) => {\n const mids = peerIdMids[peerId as any as number];\n return mids.map((mid) => {\n return rootScope.managers.appMessagesManager.getMessageByPeer(peerId.toPeerId(), mid);\n });\n });\n\n const messages = await Promise.all(flatten(messagesPromises));\n const actions: Set = new Set();\n messages.forEach((message) => {\n if(!message) {\n return;\n }\n\n const media = getMediaFromMessage(message);\n let action: ChatRights;\n if(!media) {\n if(message.viaBotId) {\n action = 'send_inline';\n } else {\n action = 'send_plain';\n }\n } else {\n if(media._ === 'webPage') {\n action = 'embed_links';\n } else if(media._ === 'photo') {\n action = 'send_photos';\n } else if(media._ === 'game') {\n action = 'send_games';\n } else {\n switch(media.type) {\n case 'audio':\n action = 'send_audios';\n break;\n case 'gif':\n action = 'send_gifs';\n break;\n case 'round':\n action = 'send_roundvideos';\n break;\n case 'sticker':\n action = 'send_stickers';\n break;\n case 'voice':\n action = 'send_voices';\n break;\n case 'video':\n action = 'send_videos';\n break;\n default:\n action = 'send_docs';\n break;\n }\n }\n }\n\n if(action) {\n actions.add(action);\n }\n });\n\n PopupElement.createPopup(PopupForward, args[0], args[1], Array.from(actions));\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ripple from '../ripple';\nimport animationIntersector from '../animationIntersector';\nimport appNavigationController, {NavigationItem} from '../appNavigationController';\nimport {i18n, LangPackKey, _i18n} from '../../lib/langPack';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport blurActiveElement from '../../helpers/dom/blurActiveElement';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport {attachClickEvent, simulateClickEvent} from '../../helpers/dom/clickEvent';\nimport isSendShortcutPressed from '../../helpers/dom/isSendShortcutPressed';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport EventListenerBase, {EventListenerListeners} from '../../helpers/eventListenerBase';\nimport {addFullScreenListener, getFullScreenElement} from '../../helpers/dom/fullScreen';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport overlayCounter from '../../helpers/overlayCounter';\nimport Scrollable from '../scrollable';\nimport {getMiddleware, MiddlewareHelper} from '../../helpers/middleware';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\n\nexport type PopupButton = {\n text?: string,\n callback?: () => void,\n langKey?: LangPackKey,\n langArgs?: any[],\n isDanger?: boolean,\n isCancel?: boolean,\n element?: HTMLButtonElement,\n noRipple?: boolean\n};\n\nexport type PopupOptions = Partial<{\n closable: boolean,\n overlayClosable: boolean,\n withConfirm: LangPackKey | boolean,\n body: boolean,\n confirmShortcutIsSendShortcut: boolean,\n withoutOverlay: boolean,\n scrollable: boolean,\n buttons: Array,\n title: boolean | LangPackKey,\n titleRaw: string\n}>;\n\nexport interface PopupElementConstructable {\n new(...args: any[]): T;\n}\n\nconst DEFAULT_APPEND_TO = document.body;\nlet appendPopupTo = DEFAULT_APPEND_TO;\n\nconst onFullScreenChange = () => {\n appendPopupTo = getFullScreenElement() || DEFAULT_APPEND_TO;\n PopupElement.reAppend();\n};\n\naddFullScreenListener(DEFAULT_APPEND_TO, onFullScreenChange);\n\ntype PopupListeners = {\n close: () => void,\n closeAfterTimeout: () => void\n};\n\nexport default class PopupElement extends EventListenerBase {\n private static POPUPS: PopupElement[] = [];\n public static MANAGERS: AppManagers;\n\n protected element = document.createElement('div');\n protected container = document.createElement('div');\n protected header = document.createElement('div');\n protected title = document.createElement('div');\n protected btnClose: HTMLElement;\n protected btnConfirm: HTMLButtonElement;\n protected body: HTMLElement;\n protected buttonsEl: HTMLElement;\n\n protected onEscape: () => boolean = () => true;\n\n protected navigationItem: NavigationItem;\n\n protected listenerSetter: ListenerSetter;\n\n protected confirmShortcutIsSendShortcut: boolean;\n protected btnConfirmOnEnter: HTMLElement;\n\n protected withoutOverlay: boolean;\n\n protected managers: AppManagers;\n\n protected scrollable: Scrollable;\n\n protected buttons: Array;\n\n protected middlewareHelper: MiddlewareHelper;\n\n constructor(className: string, options: PopupOptions = {}) {\n super(false);\n this.element.classList.add('popup');\n this.element.className = 'popup' + (className ? ' ' + className : '');\n this.container.classList.add('popup-container', 'z-depth-1');\n\n this.header.classList.add('popup-header');\n\n if(options.title || options.titleRaw) {\n this.title.classList.add('popup-title');\n if(typeof(options.title) === 'string') {\n _i18n(this.title, options.title);\n } else if(options.titleRaw) {\n this.title.append(wrapEmojiText(options.titleRaw));\n }\n\n this.header.append(this.title);\n }\n\n this.middlewareHelper = getMiddleware();\n this.listenerSetter = new ListenerSetter();\n this.managers = PopupElement.MANAGERS;\n\n this.confirmShortcutIsSendShortcut = options.confirmShortcutIsSendShortcut;\n\n if(options.closable) {\n this.btnClose = document.createElement('span');\n this.btnClose.classList.add('btn-icon', 'popup-close', 'tgico-close');\n // ripple(this.closeBtn);\n this.header.prepend(this.btnClose);\n\n attachClickEvent(this.btnClose, this.hide, {listenerSetter: this.listenerSetter, once: true});\n }\n\n this.withoutOverlay = options.withoutOverlay;\n if(this.withoutOverlay) {\n this.element.classList.add('no-overlay');\n }\n\n if(options.overlayClosable) {\n attachClickEvent(this.element, (e: MouseEvent) => {\n if(!findUpClassName(e.target, 'popup-container')) {\n this.hide();\n }\n }, {listenerSetter: this.listenerSetter});\n }\n\n if(options.withConfirm) {\n this.btnConfirm = document.createElement('button');\n this.btnConfirm.classList.add('btn-primary', 'btn-color-primary');\n if(options.withConfirm !== true) {\n this.btnConfirm.append(i18n(options.withConfirm));\n }\n this.header.append(this.btnConfirm);\n ripple(this.btnConfirm);\n }\n\n this.container.append(this.header);\n if(options.body) {\n this.body = document.createElement('div');\n this.body.classList.add('popup-body');\n this.container.append(this.body);\n }\n\n if(options.scrollable) {\n const scrollable = this.scrollable = new Scrollable(this.body);\n this.attachScrollableListeners();\n\n if(!this.body) {\n this.container.insertBefore(scrollable.container, this.header.nextSibling);\n }\n }\n\n let btnConfirmOnEnter = this.btnConfirm;\n const buttons = this.buttons = options.buttons;\n if(buttons?.length) {\n const buttonsDiv = this.buttonsEl = document.createElement('div');\n buttonsDiv.classList.add('popup-buttons');\n\n const buttonsElements = buttons.map((b) => {\n const button = document.createElement('button');\n button.className = 'btn' + (b.isDanger ? ' danger' : ' primary');\n\n if(!b.noRipple) {\n ripple(button);\n }\n\n if(b.text) {\n button.textContent = b.text;\n } else {\n button.append(i18n(b.langKey, b.langArgs));\n }\n\n attachClickEvent(button, () => {\n b.callback?.();\n this.destroy();\n }, {listenerSetter: this.listenerSetter, once: true});\n\n return b.element = button;\n });\n\n if(!btnConfirmOnEnter && buttons.length === 2) {\n const button = buttons.find((button) => !button.isCancel);\n if(button) {\n btnConfirmOnEnter = button.element;\n }\n }\n\n buttonsDiv.append(...buttonsElements);\n this.container.append(buttonsDiv);\n }\n\n this.btnConfirmOnEnter = btnConfirmOnEnter;\n\n this.element.append(this.container);\n\n PopupElement.POPUPS.push(this);\n }\n\n protected attachScrollableListeners(setClassOn?: HTMLElement) {\n return this.scrollable.attachBorderListeners(setClassOn);\n }\n\n protected onContentUpdate() {\n if(this.scrollable) {\n this.scrollable.onAdditionalScroll();\n }\n }\n\n public show() {\n this.navigationItem = {\n type: 'popup',\n onPop: () => this.destroy(),\n onEscape: this.onEscape\n };\n\n appNavigationController.pushItem(this.navigationItem);\n\n blurActiveElement(); // * hide mobile keyboard\n appendPopupTo.append(this.element);\n void this.element.offsetWidth; // reflow\n this.element.classList.add('active');\n\n this.onContentUpdate();\n\n if(!this.withoutOverlay) {\n overlayCounter.isOverlayActive = true;\n animationIntersector.checkAnimations2(true);\n }\n\n // cannot add event instantly because keydown propagation will fire it\n // if(this.btnConfirmOnEnter) {\n setTimeout(() => {\n if(!this.element.classList.contains('active')) {\n return;\n }\n\n this.listenerSetter.add(document.body)('keydown', (e) => {\n if(PopupElement.POPUPS[PopupElement.POPUPS.length - 1] !== this) {\n return;\n }\n\n if(this.confirmShortcutIsSendShortcut ? isSendShortcutPressed(e) : e.key === 'Enter') {\n simulateClickEvent(this.btnConfirmOnEnter);\n cancelEvent(e);\n }\n });\n }, 0);\n // }\n }\n\n public hide = () => {\n appNavigationController.backByItem(this.navigationItem);\n };\n\n protected destroy() {\n this.dispatchEvent('close');\n this.element.classList.add('hiding');\n this.element.classList.remove('active');\n this.listenerSetter.removeAll();\n this.middlewareHelper.destroy();\n\n if(!this.withoutOverlay) {\n overlayCounter.isOverlayActive = false;\n }\n\n appNavigationController.removeItem(this.navigationItem);\n this.navigationItem = undefined;\n\n indexOfAndSplice(PopupElement.POPUPS, this);\n\n // ! calm\n onFullScreenChange();\n\n setTimeout(() => {\n this.element.remove();\n this.dispatchEvent('closeAfterTimeout');\n this.cleanup();\n this.scrollable?.destroy();\n\n if(!this.withoutOverlay) {\n animationIntersector.checkAnimations2(false);\n }\n }, 150);\n }\n\n public static reAppend() {\n this.POPUPS.forEach((popup) => {\n const {element, container} = popup;\n const parentElement = element.parentElement;\n if(parentElement && parentElement !== appendPopupTo && appendPopupTo !== container) {\n appendPopupTo.append(element);\n }\n });\n }\n\n public static getPopups(popupConstructor: PopupElementConstructable) {\n return this.POPUPS.filter((element) => element instanceof popupConstructor) as T[];\n }\n\n public static createPopup>(ctor: {new(...args: A): T}, ...args: A) {\n const popup = new ctor(...args);\n return popup;\n }\n}\n\nexport const addCancelButton = (buttons: PopupButton[]) => {\n const button = buttons.find((b) => b.isCancel);\n if(!button) {\n buttons.push({\n langKey: 'Cancel',\n isCancel: true\n });\n }\n\n return buttons;\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement, {addCancelButton} from '.';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport numberThousandSplitter from '../../helpers/number/numberThousandSplitter';\nimport {ChatInvite} from '../../layer';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {i18n, _i18n} from '../../lib/langPack';\nimport {NULL_PEER_ID} from '../../lib/mtproto/mtproto_config';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport AvatarElement from '../avatar';\nimport putPhoto from '../putPhoto';\nimport {toastNew} from '../toast';\nimport wrapPhoto from '../wrappers/photo';\n\n// const FAKE_CHAT_ID = Number.MAX_SAFE_INTEGER - 0x1000;\n\nexport default class PopupJoinChatInvite extends PopupElement {\n constructor(\n private hash: string,\n private chatInvite: ChatInvite.chatInvite\n ) {\n super('popup-join-chat-invite', {\n closable: true,\n overlayClosable: true,\n body: true,\n buttons: addCancelButton([{\n langKey: chatInvite.pFlags.request_needed ? 'RequestJoin.Button' : (chatInvite.pFlags.broadcast ? 'JoinByPeekChannelTitle' : 'JoinByPeekGroupTitle'),\n callback: () => {\n this.managers.appChatsManager.importChatInvite(hash)\n .then((chatId) => {\n const peerId = chatId.toPeerId(true);\n appImManager.setInnerPeer({peerId});\n }, (error) => {\n if(error.type === 'INVITE_REQUEST_SENT') {\n toastNew({langPackKey: 'RequestToJoinSent'});\n }\n });\n }\n }])\n });\n\n this.construct();\n }\n\n private async construct() {\n this.header.remove();\n /* const fakeChat: Chat.channel | Chat.chat = {\n _: chatInvite.pFlags.channel ? 'channel' : 'chat',\n id: FAKE_CHAT_ID,\n title: chatInvite.title,\n photo: chatInvite.photo as any,\n date: Date.now() / 1000 | 0,\n version: 0,\n participants_count: chatInvite.participants_count,\n pFlags: chatInvite.pFlags as any\n };\n\n appChatsManager.saveApiChat(fakeChat); */\n\n const {chatInvite, managers, hash} = this;\n\n const avatarElem = new AvatarElement();\n avatarElem.classList.add('avatar-100');\n avatarElem.isDialog = false;\n if(chatInvite.photo._ === 'photo') {\n chatInvite.photo = await managers.appPhotosManager.savePhoto(chatInvite.photo);\n wrapPhoto({\n container: avatarElem,\n message: null,\n photo: chatInvite.photo,\n boxHeight: 100,\n boxWidth: 100,\n withoutPreloader: true\n });\n avatarElem.style.width = avatarElem.style.height = '';\n } else {\n putPhoto({\n div: avatarElem,\n peerId: NULL_PEER_ID,\n isDialog: false,\n title: chatInvite.title\n });\n }\n\n const title = document.createElement('div');\n title.classList.add('chat-title');\n setInnerHTML(title, wrapEmojiText(chatInvite.title));\n // avatarElem.setAttribute('peer', '' + -fakeChat.id);\n\n const isBroadcast = chatInvite.pFlags.broadcast;\n const peopleCount = i18n(isBroadcast ? 'Subscribers' : 'Members', [numberThousandSplitter(chatInvite.participants_count)]);\n peopleCount.classList.add('chat-participants-count');\n\n this.body.append(avatarElem, title, peopleCount);\n\n if(chatInvite.pFlags.request_needed) {\n const caption = document.createElement('div');\n _i18n(caption, isBroadcast ? 'RequestToJoinChannelDescription' : 'RequestToJoinGroupDescription');\n caption.classList.add('chat-participants-count', 'request-caption');\n\n this.body.append(caption);\n }\n\n this.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport liteMode from '../../helpers/liteMode';\nimport {doubleRaf} from '../../helpers/schedulers';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {LangPackKey, _i18n, i18n} from '../../lib/langPack';\nimport {ApiLimitType} from '../../lib/mtproto/api_methods';\nimport rootScope from '../../lib/rootScope';\nimport PopupPeer from './peer';\n\nconst a: {[type in ApiLimitType]?: {\n title: LangPackKey,\n description: LangPackKey,\n descriptionPremium: LangPackKey,\n descriptionLocked: LangPackKey,\n icon: string\n}} = {\n pin: {\n title: 'LimitReached',\n description: 'LimitReachedPinDialogs',\n descriptionPremium: 'LimitReachedPinDialogsPremium',\n descriptionLocked: 'LimitReachedPinDialogsLocked',\n icon: 'limit_pin'\n },\n folders: {\n title: 'LimitReached',\n description: 'LimitReachedFolders',\n descriptionPremium: 'LimitReachedFoldersPremium',\n descriptionLocked: 'LimitReachedFoldersLocked',\n icon: 'limit_folders'\n }\n};\n\nclass P extends PopupPeer {\n constructor(options: {\n isPremium: boolean,\n limit: number,\n limitPremium: number\n }, _a: typeof a[keyof typeof a]) {\n super('popup-limit', {\n buttons: options.isPremium === undefined ? [{\n langKey: 'LimitReached.Ok',\n isCancel: true\n }] : (options.isPremium ? [{\n langKey: 'OK',\n isCancel: true\n }] : [{\n langKey: 'IncreaseLimit',\n callback: () => {\n appImManager.openPremiumBot();\n },\n noRipple: true\n }, {\n langKey: 'Cancel',\n isCancel: true\n }]),\n descriptionLangKey: options.isPremium === undefined ? _a.descriptionLocked : (options.isPremium ? _a.descriptionPremium : _a.description),\n descriptionLangArgs: options.isPremium ? [options.limitPremium] : [options.limit, options.limitPremium],\n titleLangKey: _a.title\n });\n\n const isLocked = options.isPremium === undefined;\n if(isLocked) {\n this.element.classList.add('is-locked');\n } else if(options.isPremium) {\n this.element.classList.add('is-premium');\n } else {\n const button = this.buttons.find((b) => !b.isCancel);\n button.element.classList.add('popup-limit-button');\n const i = document.createElement('i');\n i.classList.add('popup-limit-button-icon', 'tgico-premium_double');\n button.element.append(i);\n }\n\n const limitContainer = document.createElement('div');\n limitContainer.classList.add('popup-limit-line');\n\n const hint = document.createElement('div');\n hint.classList.add('popup-limit-hint');\n const i = document.createElement('span');\n i.classList.add('popup-limit-hint-icon', 'tgico-' + _a.icon);\n hint.append(i, '' + (options.isPremium ? options.limitPremium : options.limit));\n\n limitContainer.append(hint);\n\n if(!isLocked) {\n const limit = document.createElement('div');\n limit.classList.add('limit-line');\n\n const free = document.createElement('div');\n free.classList.add('limit-line-free');\n\n const premium = document.createElement('div');\n premium.classList.add('limit-line-premium');\n\n limit.append(free, premium);\n\n _i18n(free, 'LimitFree');\n premium.append(i18n('LimitPremium'), '' + options.limitPremium);\n\n limitContainer.append(limit);\n }\n\n this.container.insertBefore(limitContainer, this.description);\n\n // if(options.isPremium === false) {\n // this.buttons.pop().element.remove();\n // }\n\n const setHintActive = () => {\n hint.classList.add('active');\n };\n\n if(liteMode.isAvailable('animations')) {\n doubleRaf().then(setHintActive);\n } else {\n setHintActive();\n }\n }\n}\n\nexport default async function showLimitPopup(type: keyof typeof a) {\n const _a = a[type];\n const [appConfig, limit, limitPremium] = await Promise.all([\n rootScope.managers.apiManager.getAppConfig(),\n ...[false, true].map((v) => rootScope.managers.apiManager.getLimit(type, v))\n ]);\n const isLocked = appConfig.premium_purchase_blocked;\n new P({\n isPremium: isLocked ? undefined : rootScope.premium,\n limit,\n limitPremium\n }, _a).show();\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport tsNow from '../../helpers/tsNow';\nimport {LangPackKey} from '../../lib/langPack';\nimport {MUTE_UNTIL} from '../../lib/mtproto/mtproto_config';\nimport {RadioFormFromValues} from '../row';\nimport PopupPeer from './peer';\n\nconst ONE_HOUR = 3600;\nconst times: {value: number | string, langPackKey: LangPackKey, checked?: boolean}[] = [{\n value: ONE_HOUR,\n langPackKey: 'ChatList.Mute.1Hour'\n}, {\n value: ONE_HOUR * 4,\n langPackKey: 'ChatList.Mute.4Hours'\n}, {\n value: ONE_HOUR * 8,\n langPackKey: 'ChatList.Mute.8Hours'\n}, {\n value: ONE_HOUR * 24,\n langPackKey: 'ChatList.Mute.1Day'\n}, {\n value: ONE_HOUR * 24 * 3,\n langPackKey: 'ChatList.Mute.3Days'\n}, {\n value: -1,\n langPackKey: 'ChatList.Mute.Forever',\n checked: true\n}];\n\nexport default class PopupMute extends PopupPeer {\n constructor(peerId: PeerId, threadId?: number) {\n super('popup-mute', {\n peerId,\n titleLangKey: 'Notifications',\n buttons: [{\n langKey: 'ChatList.Context.Mute',\n callback: () => {\n this.managers.appMessagesManager.mutePeer({peerId, muteUntil: time === -1 ? MUTE_UNTIL : tsNow(true) + time, threadId});\n }\n }],\n body: true\n });\n\n let time: number;\n const radioForm = RadioFormFromValues(times, (value) => {\n time = +value;\n });\n\n this.body.append(radioForm);\n\n this.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport pause from './schedulers/pause';\nimport {makeMediaSize} from './mediaSize';\nimport scaleMediaElement from './canvas/scaleMediaElement';\nimport preloadVideo from './preloadVideo';\n\nexport function createPosterFromMedia(media: HTMLVideoElement | HTMLImageElement) {\n let width: number, height: number;\n if(media instanceof HTMLVideoElement) {\n width = media.videoWidth;\n height = media.videoHeight;\n } else {\n width = media.naturalWidth;\n height = media.naturalHeight;\n }\n\n return scaleMediaElement({\n media,\n mediaSize: makeMediaSize(width, height),\n boxSize: makeMediaSize(320, 240),\n quality: .9\n });\n}\n\nexport function createPosterFromVideo(video: HTMLVideoElement): ReturnType {\n return new Promise((resolve, reject) => {\n video.onseeked = () => {\n video.onseeked = () => {\n createPosterFromMedia(video).then(resolve);\n\n video.onseeked = undefined;\n };\n\n video.currentTime = 0;\n };\n\n video.onerror = reject;\n video.currentTime = Math.min(video.duration, 1);\n });\n}\n\nexport async function createPosterForVideo(url: string) {\n const video = await preloadVideo(url);\n\n return Promise.race([\n pause(2000) as Promise,\n createPosterFromVideo(video)\n ]);\n}\n\n\n","/**\n * @returns duration in ms\n */\nexport default function getGifDuration(image: HTMLImageElement) {\n const src = image.src;\n\n return fetch(src)\n .then((response) => response.arrayBuffer())\n .then((arrayBuffer) => {\n const d = new Uint8Array(arrayBuffer);\n // Thanks to http://justinsomnia.org/2006/10/gif-animation-duration-calculation/\n // And http://www.w3.org/Graphics/GIF/spec-gif89a.txt\n let duration = 0;\n for(let i = 0, length = d.length; i < length; ++i) {\n // Find a Graphic Control Extension hex(21F904__ ____ __00)\n if(d[i] == 0x21 &&\n d[i + 1] == 0xF9 &&\n d[i + 2] == 0x04 &&\n d[i + 7] == 0x00) {\n // Swap 5th and 6th bytes to get the delay per frame\n const delay = (d[i + 5] << 8) | (d[i + 4] & 0xFF);\n\n // Should be aware browsers have a minimum frame delay\n // e.g. 6ms for IE, 2ms modern browsers (50fps)\n duration += delay < 2 ? 10 : delay;\n }\n }\n\n return duration / 1000;\n });\n}\n","export type AUDIO_MIME_TYPE = 'audio/mpeg' | 'audio/aac' | 'audio/wav';\nconst AUDIO_MIME_TYPES_SUPPORTED: Set = new Set([\n 'audio/mpeg',\n 'audio/aac',\n 'audio/wav'\n]);\n\nexport default AUDIO_MIME_TYPES_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type Chat from '../chat/chat';\nimport type {SendFileDetails} from '../../lib/appManagers/appMessagesManager';\nimport type {ChatRights} from '../../lib/appManagers/appChatsManager';\nimport PopupElement from '.';\nimport Scrollable from '../scrollable';\nimport {toast, toastNew} from '../toast';\nimport SendContextMenu from '../chat/sendContextMenu';\nimport {createPosterFromMedia, createPosterFromVideo} from '../../helpers/createPoster';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport I18n, {FormatterArguments, i18n, LangPackKey} from '../../lib/langPack';\nimport calcImageInBox from '../../helpers/calcImageInBox';\nimport placeCaretAtEnd from '../../helpers/dom/placeCaretAtEnd';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport MEDIA_MIME_TYPES_SUPPORTED from '../../environment/mediaMimeTypesSupport';\nimport getGifDuration from '../../helpers/getGifDuration';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport createVideo from '../../helpers/dom/createVideo';\nimport prepareAlbum from '../prepareAlbum';\nimport {makeMediaSize, MediaSize} from '../../helpers/mediaSize';\nimport {ThumbCache} from '../../lib/storages/thumbs';\nimport onMediaLoad from '../../helpers/onMediaLoad';\nimport apiManagerProxy from '../../lib/mtproto/mtprotoworker';\nimport {THUMB_TYPE_FULL} from '../../lib/mtproto/mtproto_config';\nimport wrapDocument from '../wrappers/document';\nimport createContextMenu from '../../helpers/dom/createContextMenu';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport wrapMediaSpoiler, {toggleMediaSpoiler} from '../wrappers/mediaSpoiler';\nimport {MiddlewareHelper} from '../../helpers/middleware';\nimport {AnimationItemGroup} from '../animationIntersector';\nimport scaleMediaElement from '../../helpers/canvas/scaleMediaElement';\nimport {doubleRaf} from '../../helpers/schedulers';\nimport defineNotNumerableProperties from '../../helpers/object/defineNotNumerableProperties';\nimport {DocumentAttribute, Photo, PhotoSize} from '../../layer';\nimport {getPreviewBytesFromURL} from '../../helpers/bytes/getPreviewURLFromBytes';\nimport {renderImageFromUrlPromise} from '../../helpers/dom/renderImageFromUrl';\nimport ButtonMenuToggle from '../buttonMenuToggle';\nimport partition from '../../helpers/array/partition';\nimport InputFieldAnimated from '../inputFieldAnimated';\nimport IMAGE_MIME_TYPES_SUPPORTED from '../../environment/imageMimeTypesSupport';\nimport VIDEO_MIME_TYPES_SUPPORTED from '../../environment/videoMimeTypesSupport';\nimport rootScope from '../../lib/rootScope';\nimport shake from '../../helpers/dom/shake';\nimport AUDIO_MIME_TYPES_SUPPORTED from '../../environment/audioMimeTypeSupport';\nimport liteMode from '../../helpers/liteMode';\n\ntype SendFileParams = SendFileDetails & {\n file?: File,\n scaledBlob?: Blob,\n noSound?: boolean,\n itemDiv: HTMLElement,\n mediaSpoiler?: HTMLElement,\n middlewareHelper: MiddlewareHelper\n // strippedBytes?: PhotoSize.photoStrippedSize['bytes']\n};\n\nlet currentPopup: PopupNewMedia;\n\nconst MAX_WIDTH = 400 - 16;\n\nexport function getCurrentNewMediaPopup() {\n return currentPopup;\n}\n\nexport default class PopupNewMedia extends PopupElement {\n private mediaContainer: HTMLElement;\n private wasInputValue: string;\n\n private willAttach: Partial<{\n type: 'media' | 'document',\n isMedia: true,\n group: boolean,\n sendFileDetails: SendFileParams[]\n }>;\n private messageInputField: InputFieldAnimated;\n private captionLengthMax: number;\n\n private animationGroup: AnimationItemGroup;\n private _scrollable: Scrollable;\n private inputContainer: HTMLDivElement;\n\n constructor(\n private chat: Chat,\n private files: File[],\n willAttachType: PopupNewMedia['willAttach']['type'],\n private ignoreInputValue?: boolean\n ) {\n super('popup-send-photo popup-new-media', {\n closable: true,\n withConfirm: 'Modal.Send',\n confirmShortcutIsSendShortcut: true,\n body: true,\n title: true,\n scrollable: true\n });\n\n this.animationGroup = '';\n this.construct(willAttachType);\n }\n\n public static async canSend(peerId: PeerId, onlyVisible?: boolean) {\n const actions: ChatRights[] = [\n 'send_photos',\n 'send_videos',\n 'send_docs',\n 'send_audios',\n 'send_gifs'\n ];\n\n const actionsPromises = actions.map((action) => {\n return peerId.isAnyChat() && !onlyVisible ? rootScope.managers.appChatsManager.hasRights(peerId.toChatId(), action) : true;\n });\n\n const out: {[action in ChatRights]?: boolean} = {};\n\n const results = await Promise.all(actionsPromises);\n actions.forEach((action, idx) => {\n out[action] = results[idx];\n })\n\n return out;\n }\n\n private async construct(willAttachType: PopupNewMedia['willAttach']['type']) {\n this.willAttach = {\n type: willAttachType,\n sendFileDetails: [],\n group: true\n };\n\n const captionMaxLength = await this.managers.apiManager.getLimit('caption');\n this.captionLengthMax = captionMaxLength;\n\n const canSend = await PopupNewMedia.canSend(this.chat.peerId, true);\n\n const canSendPhotos = canSend.send_photos;\n const canSendVideos = canSend.send_videos;\n const canSendDocs = canSend.send_docs;\n\n attachClickEvent(this.btnConfirm, () => this.send(), {listenerSetter: this.listenerSetter});\n\n const btnMenu = await ButtonMenuToggle({\n listenerSetter: this.listenerSetter,\n direction: 'bottom-left',\n buttons: [{\n icon: 'image',\n text: 'Popup.Attach.AsMedia',\n onClick: () => this.changeType('media'),\n verify: () => {\n if(!this.hasAnyMedia() || this.willAttach.type !== 'document') {\n return false;\n }\n\n if(!canSendPhotos && !canSendVideos) {\n return false;\n }\n\n if(!canSendPhotos || !canSendVideos) {\n const mimeTypes = canSendPhotos ? IMAGE_MIME_TYPES_SUPPORTED : VIDEO_MIME_TYPES_SUPPORTED;\n const {media, files} = this.partition(mimeTypes);\n if(files.length) {\n return false;\n }\n }\n\n return true;\n }\n }, {\n icon: 'document',\n text: 'SendAsFile',\n onClick: () => this.changeType('document'),\n verify: () => this.files.length === 1 && this.willAttach.type !== 'document' && canSendDocs\n }, {\n icon: 'document',\n text: 'SendAsFiles',\n onClick: () => this.changeType('document'),\n verify: () => this.files.length > 1 && this.willAttach.type !== 'document' && canSendDocs\n }, {\n icon: 'groupmedia',\n text: 'Popup.Attach.GroupMedia',\n onClick: () => this.changeGroup(true),\n verify: () => !this.willAttach.group && this.canGroupSomething()\n }, {\n icon: 'groupmediaoff',\n text: 'Popup.Attach.UngroupMedia',\n onClick: () => this.changeGroup(false),\n verify: () => this.willAttach.group && this.canGroupSomething()\n }, {\n icon: 'mediaspoiler',\n text: 'EnablePhotoSpoiler',\n onClick: () => this.changeSpoilers(true),\n verify: () => this.canToggleSpoilers(true, true)\n }, {\n icon: 'mediaspoiler',\n text: 'Popup.Attach.EnableSpoilers',\n onClick: () => this.changeSpoilers(true),\n verify: () => this.canToggleSpoilers(true, false)\n }, {\n icon: 'mediaspoileroff',\n text: 'DisablePhotoSpoiler',\n onClick: () => this.changeSpoilers(false),\n verify: () => this.canToggleSpoilers(false, true)\n }, {\n icon: 'mediaspoileroff',\n text: 'Popup.Attach.RemoveSpoilers',\n onClick: () => this.changeSpoilers(false),\n verify: () => this.canToggleSpoilers(false, false)\n }]\n });\n\n this.header.append(btnMenu);\n\n this.btnConfirm.remove();\n\n this.mediaContainer = document.createElement('div');\n this.mediaContainer.classList.add('popup-photo');\n this.scrollable.container.append(this.mediaContainer);\n\n const inputContainer = this.inputContainer = document.createElement('div');\n inputContainer.classList.add('popup-input-container');\n\n const c = document.createElement('div');\n c.classList.add('popup-input-inputs', 'input-message-container');\n\n this.messageInputField = new InputFieldAnimated({\n placeholder: 'PreviewSender.CaptionPlaceholder',\n name: 'message',\n withLinebreaks: true,\n maxLength: this.captionLengthMax\n });\n\n this.listenerSetter.add(this.scrollable.container)('scroll', this.onScroll);\n this.listenerSetter.add(this.messageInputField.input)('scroll', this.onScroll);\n\n this.messageInputField.input.classList.replace('input-field-input', 'input-message-input');\n this.messageInputField.inputFake.classList.replace('input-field-input', 'input-message-input');\n\n c.append(this.messageInputField.input, this.messageInputField.inputFake);\n inputContainer.append(c, this.btnConfirm);\n\n if(!this.ignoreInputValue) {\n this.messageInputField.value = this.wasInputValue = this.chat.input.messageInputField.input.innerHTML;\n this.chat.input.messageInputField.value = '';\n }\n\n this.container.append(inputContainer);\n\n this.attachFiles();\n\n this.addEventListener('close', () => {\n this.files.length = 0;\n this.willAttach.sendFileDetails.length = 0;\n\n if(currentPopup === this) {\n currentPopup = undefined;\n }\n });\n\n let target: HTMLElement, isMedia: boolean, item: SendFileParams;\n createContextMenu({\n buttons: [{\n icon: 'mediaspoiler',\n text: 'EnablePhotoSpoiler',\n onClick: () => {\n this.applyMediaSpoiler(item);\n },\n verify: () => isMedia && !item.mediaSpoiler\n }, {\n icon: 'mediaspoileroff',\n text: 'DisablePhotoSpoiler',\n onClick: () => {\n this.removeMediaSpoiler(item);\n },\n verify: () => !!(isMedia && item.mediaSpoiler)\n }],\n listenTo: this.mediaContainer,\n listenerSetter: this.listenerSetter,\n findElement: (e) => {\n target = findUpClassName(e.target, 'popup-item');\n isMedia = target.classList.contains('popup-item-media');\n item = this.willAttach.sendFileDetails.find((i) => i.itemDiv === target);\n return target;\n }\n });\n\n if(this.chat.type !== 'scheduled') {\n const sendMenu = new SendContextMenu({\n onSilentClick: () => {\n this.chat.input.sendSilent = true;\n this.send();\n },\n onScheduleClick: () => {\n this.chat.input.scheduleSending(() => {\n this.send();\n });\n },\n openSide: 'top-left',\n onContextElement: this.btnConfirm,\n listenerSetter: this.listenerSetter\n });\n\n sendMenu.setPeerId(this.chat.peerId);\n\n this.container.append(sendMenu.sendMenu);\n }\n\n currentPopup = this;\n }\n\n private onScroll = () => {\n const {input} = this.messageInputField;\n this.scrollable.onAdditionalScroll();\n if(input.scrollTop > 0 && input.scrollHeight > 130) {\n this.scrollable.container.classList.remove('scrolled-bottom');\n }\n };\n\n private async applyMediaSpoiler(item: SendFileParams, noAnimation?: boolean) {\n const middleware = item.middlewareHelper.get();\n const {width: widthStr, height: heightStr} = item.itemDiv.style;\n\n let width: number, height: number;\n if(item.itemDiv.classList.contains('album-item')) {\n const {width: containerWidthStr, height: containerHeightStr} = item.itemDiv.parentElement.style;\n const containerWidth = parseInt(containerWidthStr);\n const containerHeight = parseInt(containerHeightStr);\n\n width = +widthStr.slice(0, -1) / 100 * containerWidth;\n height = +heightStr.slice(0, -1) / 100 * containerHeight;\n } else {\n width = parseInt(widthStr);\n height = parseInt(heightStr);\n }\n\n const {url} = await scaleMediaElement({\n media: item.itemDiv.firstElementChild as HTMLImageElement,\n boxSize: makeMediaSize(40, 40),\n mediaSize: makeMediaSize(width, height),\n toDataURL: true,\n quality: 0.2\n });\n\n const strippedBytes = getPreviewBytesFromURL(url);\n const photoSize: PhotoSize.photoStrippedSize = {\n _: 'photoStrippedSize',\n bytes: strippedBytes,\n type: 'i'\n };\n\n item.strippedBytes = strippedBytes;\n\n const photo: Photo.photo = {\n _: 'photo',\n sizes: [\n photoSize\n ],\n id: 0,\n access_hash: 0,\n date: 0,\n dc_id: 0,\n file_reference: [],\n pFlags: {}\n };\n\n const mediaSpoiler = await wrapMediaSpoiler({\n middleware,\n width,\n height,\n animationGroup: this.animationGroup,\n media: photo\n });\n\n if(!middleware()) {\n return;\n }\n\n if(!noAnimation) {\n mediaSpoiler.classList.add('is-revealing');\n }\n\n item.mediaSpoiler = mediaSpoiler;\n item.itemDiv.append(mediaSpoiler);\n\n await doubleRaf();\n if(!middleware()) {\n return;\n }\n\n toggleMediaSpoiler({\n mediaSpoiler,\n reveal: false\n });\n }\n\n private removeMediaSpoiler(item: SendFileParams) {\n toggleMediaSpoiler({\n mediaSpoiler: item.mediaSpoiler,\n reveal: true,\n destroyAfter: true\n });\n\n item.mediaSpoiler = undefined;\n }\n\n public appendDrops(element: HTMLElement) {\n this.body.append(element);\n }\n\n get type() {\n return this.willAttach.type;\n }\n\n set type(type: PopupNewMedia['willAttach']['type']) {\n this.willAttach.type = type;\n }\n\n private partition(mimeTypes = MEDIA_MIME_TYPES_SUPPORTED) {\n const [media, files] = partition(this.willAttach.sendFileDetails, (d) => mimeTypes.has(d.file.type));\n return {\n media,\n files\n };\n }\n\n private mediaCount() {\n return this.partition().media.length;\n }\n\n private hasAnyMedia() {\n return this.mediaCount() > 0;\n }\n\n private canGroupSomething() {\n const {media, files} = this.partition();\n return media.length > 1 || files.length > 1;\n }\n\n private canToggleSpoilers(toggle: boolean, single: boolean) {\n let good = this.willAttach.type === 'media' && this.hasAnyMedia();\n if(single && good) {\n good = this.files.length === 1;\n }\n\n if(good) {\n const media = this.willAttach.sendFileDetails\n .filter((d) => MEDIA_MIME_TYPES_SUPPORTED.has(d.file.type))\n const mediaWithSpoilers = media.filter((d) => d.mediaSpoiler);\n\n good = single ? true : media.length > 1;\n\n if(good) {\n good = toggle ? media.length !== mediaWithSpoilers.length : media.length === mediaWithSpoilers.length;\n }\n }\n\n return good;\n }\n\n private changeType(type: PopupNewMedia['willAttach']['type']) {\n this.willAttach.type = type;\n this.attachFiles();\n }\n\n public changeGroup(group: boolean) {\n this.willAttach.group = group;\n this.attachFiles();\n }\n\n public changeSpoilers(toggle: boolean) {\n this.partition().media.forEach((item) => {\n if(toggle && !item.mediaSpoiler) {\n this.applyMediaSpoiler(item);\n } else if(!toggle && item.mediaSpoiler) {\n this.removeMediaSpoiler(item);\n }\n });\n }\n\n public addFiles(files: File[]) {\n const toPush = files.filter((file) => {\n const found = this.files.find((_file) => {\n return _file.lastModified === file.lastModified && _file.name === file.name && _file.size === file.size;\n });\n\n return !found;\n });\n\n if(toPush.length) {\n this.files.push(...toPush);\n this.attachFiles();\n }\n }\n\n private onKeyDown = (e: KeyboardEvent) => {\n const target = e.target as HTMLElement;\n const {input} = this.messageInputField;\n if(target !== input) {\n if(target.tagName === 'INPUT' || target.isContentEditable) {\n return;\n }\n\n input.focus();\n placeCaretAtEnd(input);\n }\n };\n\n private async send(force = false) {\n let caption = this.messageInputField.value;\n if(caption.length > this.captionLengthMax) {\n toast(I18n.format('Error.PreviewSender.CaptionTooLong', true));\n return;\n }\n\n const {peerId, input} = this.chat;\n\n const canSend = await PopupNewMedia.canSend(peerId);\n const willAttach = this.willAttach;\n willAttach.isMedia = willAttach.type === 'media' || undefined;\n const {sendFileDetails, isMedia} = willAttach;\n\n let foundBad = false;\n this.iterate((sendFileParams) => {\n if(foundBad) {\n return;\n }\n\n const isBad: (LangPackKey | boolean)[] = sendFileParams.map((params) => {\n const a: [Set | (() => boolean), LangPackKey, ChatRights][] = [\n [AUDIO_MIME_TYPES_SUPPORTED, 'GlobalAttachAudioRestricted', 'send_audios'],\n [() => !MEDIA_MIME_TYPES_SUPPORTED.has(params.file.type), 'GlobalAttachDocumentsRestricted', 'send_docs']\n ];\n\n if(isMedia) {\n a.unshift(\n [IMAGE_MIME_TYPES_SUPPORTED, 'GlobalAttachPhotoRestricted', 'send_photos'],\n [() => VIDEO_MIME_TYPES_SUPPORTED.has(params.file.type as any) && params.noSound, 'GlobalAttachGifRestricted', 'send_gifs'],\n [VIDEO_MIME_TYPES_SUPPORTED, 'GlobalAttachVideoRestricted', 'send_videos']\n );\n }\n\n const found = a.find(([verify]) => {\n return typeof(verify) === 'function' ? verify() : verify.has(params.file.type);\n });\n\n if(found) {\n return canSend[found[2]] ? undefined : found[1];\n }\n\n return (!isMedia && !canSend.send_docs && 'GlobalAttachDocumentsRestricted') || undefined;\n });\n\n const key = isBad.find((i) => typeof(i) === 'string') as LangPackKey;\n if(key) {\n toastNew({\n langPackKey: key\n });\n\n if(liteMode.isAvailable('animations')) {\n shake(this.body);\n }\n }\n\n foundBad ||= !!key;\n });\n\n if(foundBad) {\n return;\n }\n\n if(this.chat.type === 'scheduled' && !force) {\n this.chat.input.scheduleSending(() => {\n this.send(true);\n });\n\n return;\n }\n\n const {length} = sendFileDetails;\n const sendingParams = this.chat.getMessageSendingParams();\n this.iterate((sendFileParams) => {\n if(caption && sendFileParams.length !== length) {\n this.managers.appMessagesManager.sendText(peerId, caption, {\n ...sendingParams,\n clearDraft: true\n });\n\n caption = undefined;\n }\n\n const d: SendFileDetails[] = sendFileParams.map((params) => {\n return {\n ...params,\n file: params.scaledBlob || params.file,\n spoiler: !!params.mediaSpoiler\n };\n });\n\n const w = {\n ...willAttach,\n sendFileDetails: d\n };\n\n this.managers.appMessagesManager.sendAlbum(peerId, Object.assign({\n ...sendingParams,\n caption,\n isMedia,\n clearDraft: true\n }, w));\n\n caption = undefined;\n });\n\n input.replyToMsgId = this.chat.threadId;\n input.onMessageSent();\n this.wasInputValue = undefined;\n\n this.hide();\n }\n\n private modifyMimeTypeForTelegram(mimeType: string) {\n return mimeType === 'image/webp' ? 'image/jpeg' : mimeType;\n }\n\n private async scaleImageForTelegram(image: HTMLImageElement, mimeType: string, convertWebp?: boolean) {\n const PHOTO_SIDE_LIMIT = 2560;\n let url = image.src, scaledBlob: Blob;\n if(\n mimeType !== 'image/gif' &&\n (Math.max(image.naturalWidth, image.naturalHeight) > PHOTO_SIDE_LIMIT || (convertWebp && mimeType === 'image/webp'))\n ) {\n const {blob} = await scaleMediaElement({\n media: image,\n boxSize: makeMediaSize(PHOTO_SIDE_LIMIT, PHOTO_SIDE_LIMIT),\n mediaSize: makeMediaSize(image.naturalWidth, image.naturalHeight),\n mimeType: this.modifyMimeTypeForTelegram(mimeType) as any\n });\n\n scaledBlob = blob;\n URL.revokeObjectURL(url);\n url = await apiManagerProxy.invoke('createObjectURL', blob);\n await renderImageFromUrlPromise(image, url);\n }\n\n return scaledBlob && {url, blob: scaledBlob};\n }\n\n private async attachMedia(params: SendFileParams) {\n const {itemDiv} = params;\n itemDiv.classList.add('popup-item-media');\n\n const file = params.file;\n const isVideo = file.type.startsWith('video/');\n\n if(isVideo) {\n const video = createVideo();\n video.src = params.objectURL = await apiManagerProxy.invoke('createObjectURL', file);\n video.autoplay = true;\n video.controls = false;\n video.muted = true;\n\n video.addEventListener('timeupdate', () => {\n video.pause();\n }, {once: true});\n\n itemDiv.append(video);\n\n let error: Error;\n try {\n await onMediaLoad(video);\n } catch(err) {\n error = err as any;\n }\n\n params.width = video.videoWidth;\n params.height = video.videoHeight;\n params.duration = Math.floor(video.duration);\n\n if(error) {\n throw error;\n }\n\n const audioDecodedByteCount = (video as any).webkitAudioDecodedByteCount;\n if(audioDecodedByteCount !== undefined) {\n params.noSound = !audioDecodedByteCount;\n }\n\n const thumb = await createPosterFromVideo(video);\n params.thumb = {\n url: await apiManagerProxy.invoke('createObjectURL', thumb.blob),\n ...thumb\n };\n } else {\n const img = new Image();\n itemDiv.append(img);\n const url = params.objectURL = await apiManagerProxy.invoke('createObjectURL', file);\n\n await renderImageFromUrlPromise(img, url);\n const mimeType = params.file.type;\n const scaled = await this.scaleImageForTelegram(img, mimeType, true);\n if(scaled) {\n params.objectURL = scaled.url;\n params.scaledBlob = scaled.blob;\n }\n\n params.width = img.naturalWidth;\n params.height = img.naturalHeight;\n\n if(file.type === 'image/gif') {\n params.noSound = true;\n\n return Promise.all([\n getGifDuration(img).then((duration) => {\n params.duration = Math.ceil(duration);\n }),\n\n createPosterFromMedia(img).then(async(thumb) => {\n params.thumb = {\n url: await apiManagerProxy.invoke('createObjectURL', thumb.blob),\n ...thumb\n };\n })\n ]).then(() => {});\n }\n }\n }\n\n private async attachDocument(params: SendFileParams): ReturnType {\n const {itemDiv} = params;\n itemDiv.classList.add('popup-item-document');\n const file = params.file;\n\n const isPhoto = file.type.startsWith('image/');\n const isAudio = AUDIO_MIME_TYPES_SUPPORTED.has(file.type as any);\n if(isPhoto || isAudio || file.size < 20e6) {\n params.objectURL ||= await apiManagerProxy.invoke('createObjectURL', file);\n }\n\n const attributes: DocumentAttribute[] = [];\n\n let img: HTMLImageElement;\n if(isPhoto && params.objectURL) {\n img = new Image();\n await renderImageFromUrlPromise(img, params.objectURL);\n const scaled = await this.scaleImageForTelegram(img, params.file.type);\n if(scaled) {\n params.objectURL = scaled.url;\n }\n }\n\n if(isAudio && params.objectURL) {\n try {\n // * get audio duration\n const audio = new Audio();\n audio.src = params.objectURL;\n audio.muted = true;\n audio.autoplay = true;\n await onMediaLoad(audio);\n params.duration = audio.duration;\n attributes.push({\n _: 'documentAttributeAudio',\n duration: params.duration,\n pFlags: {}\n });\n } catch(err) {\n console.error('audio loading error', err);\n }\n }\n\n const doc: MyDocument = {\n _: 'document',\n file,\n file_name: file.name || '',\n size: file.size,\n type: isAudio ? 'audio' : (isPhoto ? 'photo' : undefined),\n access_hash: 0,\n attributes,\n date: 0,\n dc_id: 0,\n file_reference: [],\n id: 0,\n pFlags: {},\n duration: params.duration\n };\n\n let cacheContext: ThumbCache;\n if(params.objectURL) {\n cacheContext = {\n url: params.objectURL,\n downloaded: file.size,\n type: THUMB_TYPE_FULL\n };\n }\n\n const docDiv = await wrapDocument({\n message: {\n _: 'message',\n pFlags: {\n is_outgoing: true\n },\n mid: 0,\n peerId: 0,\n media: {\n _: 'messageMediaDocument',\n document: doc\n }\n } as any,\n cacheContext\n });\n\n if(isPhoto) {\n params.width = img.naturalWidth;\n params.height = img.naturalHeight;\n }\n\n itemDiv.append(docDiv);\n }\n\n private attachFile = (file: File) => {\n const willAttach = this.willAttach;\n const shouldCompress = this.shouldCompress(file.type);\n\n const itemDiv = document.createElement('div');\n itemDiv.classList.add('popup-item');\n\n const params: SendFileParams = {\n file\n } as any;\n\n // do not pass these properties to worker\n defineNotNumerableProperties(params, ['scaledBlob', 'middlewareHelper', 'itemDiv', 'mediaSpoiler']);\n\n params.middlewareHelper = this.middlewareHelper.get().create();\n params.itemDiv = itemDiv;\n\n const promise = shouldCompress ? this.attachMedia(params) : this.attachDocument(params);\n willAttach.sendFileDetails.push(params);\n return promise.catch((err) => {\n itemDiv.style.backgroundColor = '#000';\n console.error('error rendering file', err);\n });\n };\n\n private shouldCompress(mimeType: string) {\n return this.willAttach.type === 'media' && MEDIA_MIME_TYPES_SUPPORTED.has(mimeType);\n }\n\n private onRender() {\n // show now\n if(!this.element.classList.contains('active')) {\n this.listenerSetter.add(document.body)('keydown', this.onKeyDown);\n !this.ignoreInputValue && this.addEventListener('close', () => {\n if(this.wasInputValue) {\n this.chat.input.messageInputField.value = this.wasInputValue;\n }\n });\n this.show();\n }\n }\n\n private setTitle() {\n const {willAttach, title, files} = this;\n let key: LangPackKey;\n const args: FormatterArguments = [];\n if(willAttach.type === 'document') {\n key = 'PreviewSender.SendFile';\n args.push(files.length);\n } else {\n let foundPhotos = 0, foundVideos = 0, foundFiles = 0;\n files.forEach((file) => {\n if(file.type.startsWith('image/')) ++foundPhotos;\n else if(file.type.startsWith('video/')) ++foundVideos;\n else ++foundFiles;\n });\n\n if([foundPhotos, foundVideos, foundFiles].filter((n) => n > 0).length > 1) {\n key = 'PreviewSender.SendFile';\n args.push(files.length);\n } else\n\n /* const sum = foundPhotos + foundVideos;\n if(sum > 1 && willAttach.group) {\n key = 'PreviewSender.SendAlbum';\n const albumsLength = Math.ceil(sum / 10);\n args.push(albumsLength);\n } else */if(foundPhotos) {\n key = 'PreviewSender.SendPhoto';\n args.push(foundPhotos);\n } else if(foundVideos) {\n key = 'PreviewSender.SendVideo';\n args.push(foundVideos);\n }\n }\n\n replaceContent(title, i18n(key, args));\n }\n\n private appendMediaToContainer(params: SendFileParams) {\n if(this.shouldCompress(params.file.type)) {\n const size = calcImageInBox(params.width, params.height, MAX_WIDTH, 320);\n params.itemDiv.style.width = size.width + 'px';\n params.itemDiv.style.height = size.height + 'px';\n }\n\n this.mediaContainer.append(params.itemDiv);\n }\n\n private iterate(cb: (sendFileDetails: SendFileParams[]) => void) {\n const {sendFileDetails} = this.willAttach;\n if(!this.willAttach.group) {\n sendFileDetails.forEach((p) => cb([p]));\n return;\n }\n\n const length = sendFileDetails.length;\n for(let i = 0; i < length;) {\n const firstType = sendFileDetails[i].file.type;\n let k = 0;\n for(; k < 10 && i < length; ++i, ++k) {\n const type = sendFileDetails[i].file.type;\n if(this.shouldCompress(firstType) !== this.shouldCompress(type)) {\n break;\n }\n }\n\n cb(sendFileDetails.slice(i - k, i));\n }\n }\n\n private attachFiles() {\n const {files, willAttach, mediaContainer} = this;\n\n const oldSendFileDetails = willAttach.sendFileDetails.splice(0, willAttach.sendFileDetails.length);\n oldSendFileDetails.forEach((params) => {\n params.middlewareHelper.destroy();\n });\n\n const promises = files.map((file) => this.attachFile(file));\n\n Promise.all(promises).then(() => {\n mediaContainer.replaceChildren();\n\n if(!files.length) {\n return;\n }\n\n this.setTitle();\n\n this.iterate((sendFileDetails) => {\n const shouldCompress = this.shouldCompress(sendFileDetails[0].file.type);\n if(shouldCompress && sendFileDetails.length > 1) {\n const albumContainer = document.createElement('div');\n albumContainer.classList.add('popup-item-album', 'popup-item');\n albumContainer.append(...sendFileDetails.map((s) => s.itemDiv));\n\n prepareAlbum({\n container: albumContainer,\n items: sendFileDetails.map((o) => ({w: o.width, h: o.height})),\n maxWidth: MAX_WIDTH,\n minWidth: 100,\n spacing: 4\n });\n\n mediaContainer.append(albumContainer);\n } else {\n sendFileDetails.forEach((params) => {\n this.appendMediaToContainer(params);\n });\n }\n\n if(!shouldCompress) {\n return;\n }\n\n sendFileDetails.forEach((params) => {\n const oldParams = oldSendFileDetails.find((o) => o.file === params.file);\n if(!oldParams) {\n return;\n }\n\n if(oldParams.mediaSpoiler) {\n this.applyMediaSpoiler(params, true);\n }\n });\n });\n }).then(() => {\n this.onRender();\n this.onScroll();\n });\n }\n}\n\n(window as any).PopupNewMedia = PopupNewMedia;\n","function cacheCallback(callback: (str: A) => T) {\n const stringResults: any = {}, numberResults: any = {};\n return (value: A): T => {\n const key = '_' + value;\n return (typeof(value) === 'string' ? stringResults : numberResults)[key] ??= callback(value);\n };\n}\n\nexport default cacheCallback;\n","export default function replaceNonNumber(str: string) {\n return str.replace(/\\D/g, '');\n}\n","import cacheCallback from '../cacheCallback';\nimport replaceNonNumber from '../string/replaceNonNumber';\n\nconst CARD_BRAND_REGEXP: {[brand: string]: RegExp} = {\n visa: /^4/,\n mastercard: /^(51|52|53|54|55|222|23|24|25|26|27)/,\n amex: /^(34|37)/,\n discover: /^(60|64|65)/,\n diners: /^(30|38|39)/,\n diners14: /^(36)/,\n jcb: /^(35)/,\n unionpay: /^(62[0-6,8-9]|627[0-6,8-9]|6277[0-7,9]|62778[1-9]|81)/,\n elo: /^(5067|509|636368|627780)/,\n mir: /^(220[0-4])/\n};\n\n// * taken from Stripe\nexport const CARD_BRANDS: {[b: string]: {\n minLength: number,\n maxLength: number,\n cvcMaxLength: number,\n cvcMinLength: number | null\n}} = {\n visa: {\n minLength: 16,\n maxLength: 16,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n mastercard: {\n minLength: 16,\n maxLength: 16,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n amex: {\n minLength: 15,\n maxLength: 15,\n cvcMaxLength: 4,\n cvcMinLength: 3\n },\n unionpay: {\n minLength: 13,\n maxLength: 19,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n diners: {\n minLength: 16,\n maxLength: 16,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n diners14: {\n minLength: 14,\n maxLength: 14,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n discover: {\n minLength: 16,\n maxLength: 16,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n jcb: {\n minLength: 16,\n maxLength: 16,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n elo: {\n minLength: 16,\n maxLength: 16,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n mir: {\n minLength: 16,\n maxLength: 16,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n unknown: {\n minLength: 16,\n maxLength: 16,\n cvcMaxLength: 4,\n cvcMinLength: 3\n }\n};\n\nexport const detectCardBrand = cacheCallback((card: string = '') => {\n const keys = Object.keys(CARD_BRAND_REGEXP);\n const sanitizedCard = replaceNonNumber(card);\n let brand: string;\n let last = 0;\n keys.forEach((key) => {\n const regExp = CARD_BRAND_REGEXP[key];\n const match = sanitizedCard.match(regExp);\n if(match) {\n const result = match[0];\n if(result && result.length > last) {\n brand = key;\n last = result.length;\n }\n }\n });\n\n return brand || 'unknown';\n});\n\nexport function cardBrandToUnifiedBrand(brand: string) {\n return brand === 'diners14' ? 'diners' : brand;\n}\n\nexport function detectUnifiedCardBrand(card = '') {\n const brand = detectCardBrand(card);\n return cardBrandToUnifiedBrand(brand);\n}\n","export default function createArray(length: number, fill?: T1, map?: any): T1[] {\n const arr = new Array(length);\n arr.fill(fill);\n return map ? arr.map(map) : arr;\n}\n","const delta = '0'.charCodeAt(0) - '0'.charCodeAt(0);\nconst buggedRegExp = /[0-9]/g;\n\n// function hasBuggedNumbers(str: string) {\n// return !!str.match(a);\n// }\n\nfunction getDistanceFromBuggedToNormal(char: string) {\n return String.fromCharCode(char.charCodeAt(0) - delta);\n}\n\nexport function fixBuggedNumbers(str: string) {\n return str.replace(buggedRegExp, getDistanceFromBuggedToNormal);\n}\n","import {fixBuggedNumbers} from '../string/buggedNumbers';\nimport replaceNonNumber from '../string/replaceNonNumber';\n\nexport type PatternCharacter = {\n type: 'optional',\n result: string,\n consumed: number\n} | {\n type: 'required',\n result: string,\n consumed: number,\n partial?: boolean\n} | {\n type: 'formatting',\n result: string,\n consumed: number\n};\n\nexport type PatternFunction = (str: string) => ((str: string) => PatternCharacter)[];\n\nfunction makeOptionalCharacter(result: string, consumed: number): PatternCharacter {\n return {type: 'optional', result, consumed};\n}\n\nfunction makeRequiredCharacter(result: string, consumed: number, partial?: boolean): PatternCharacter {\n return {type: 'required', result, consumed, partial};\n}\n\nfunction makeFormattingCharacter(result: string, consumed: number): PatternCharacter {\n return {type: 'formatting', result, consumed};\n}\n\nfunction wrapCharacterRegExpFactory(regExp: RegExp, optional?: boolean) {\n return (str: string) => {\n const _regExp = new RegExp('^'.concat(regExp.source.replace(/^\\^/, '')));\n const match = str.match(_regExp);\n const makeCharacter = optional ? makeOptionalCharacter : makeRequiredCharacter;\n if(match) {\n const result = match[0];\n return makeCharacter(result, match.index + result.length);\n }\n\n return makeCharacter('', str.length);\n };\n}\n\nfunction makeCapitalPatternCharacter(str: string) {\n const char = wrapCharacterRegExpFactory(/\\w/)(str);\n return char.result ? makeRequiredCharacter(char.result.toUpperCase(), char.consumed) : char;\n}\n\nconst makeMonthDigitPatternCharacter = wrapCharacterRegExpFactory(/1[0-2]|0?[1-9]|0/);\n\nfunction digit(str: string) {\n return wrapCharacterRegExpFactory(/[0-9]/)(fixBuggedNumbers(str));\n}\n\nconst patternCharacters = {\n digit,\n capitalCharacter: makeCapitalPatternCharacter,\n month: (str: string) => {\n const char = makeMonthDigitPatternCharacter(fixBuggedNumbers(str));\n const cleanedResult = replaceNonNumber(char.result);\n const isPartial = ['0', '1'].includes(char.result) && str.length === 1;\n if(isPartial || (char.result === '0' && str.length >= 2)) {\n return makeRequiredCharacter(char.result, str.length, true);\n }\n\n return makeRequiredCharacter(cleanedResult.length === 1 ? '0' + cleanedResult : cleanedResult, char.consumed);\n },\n formattingCharacter: (str: string) => {\n return (str1: string) => {\n const consumed = str === str1[0] ? 1 : 0;\n return makeFormattingCharacter(str, consumed);\n }\n },\n optionalPattern: (regExp: RegExp) => {\n return (str: string) => {\n const char = wrapCharacterRegExpFactory(regExp, true)(str);\n return char.result ? char : makeOptionalCharacter('', 0);\n };\n }\n};\n\nexport default patternCharacters;\n","import {IS_ANDROID} from '../../environment/userAgent';\nimport createArray from '../array/createArray';\nimport cacheCallback from '../cacheCallback';\nimport replaceNonNumber from '../string/replaceNonNumber';\nimport {CARD_BRANDS, detectCardBrand} from './cardBrands';\nimport patternCharacters from './patternCharacters';\n\nconst digit = patternCharacters.digit;\nconst capitalCharacter = patternCharacters.capitalCharacter;\nconst spaceCharacter = patternCharacters.formattingCharacter(' ');\nconst yearOptionalPattern = patternCharacters.optionalPattern(/\\d\\d/);\nconst sixteenPattern = [digit, digit, digit, digit, spaceCharacter, digit, digit, digit, digit, digit, digit, spaceCharacter, digit, digit, digit, digit, digit];\nconst fifteenPattern = [digit, digit, digit, digit, spaceCharacter, digit, digit, digit, digit, digit, digit, spaceCharacter, digit, digit, digit, digit];\n\nconst requiredPostcodes = new Set(['DZ', 'AR', 'AM', 'AU', 'AT', 'AZ', 'PT', 'BD', 'BY', 'BE', 'BA', 'BR', 'BN', 'BG', 'CA', 'IC', 'CN', 'CO', 'HR', 'CY', 'CZ', 'DK', 'EC', 'GB', 'EE', 'FO', 'FI', 'FR', 'GE', 'DE', 'GR', 'GL', 'GU', 'GG', 'NL', 'HU', 'IN', 'ID', 'IL', 'IT', 'JP', 'JE', 'KZ', 'KR', 'FM', 'KG', 'LV', 'LI', 'LT', 'LU', 'MK', 'MG', 'PT', 'MY', 'MH', 'MQ', 'YT', 'MX', 'MN', 'ME', 'NL', 'NZ', 'GB', 'NO', 'PK', 'PH', 'PL', 'FM', 'PT', 'PR', 'RE', 'RU', 'SA', 'SF', 'RS', 'SG', 'SK', 'SI', 'ZA', 'ES', 'LK', 'SX', 'VI', 'VI', 'SE', 'CH', 'TW', 'TJ', 'TH', 'TU', 'TN', 'TR', 'TM', 'VI', 'UA', 'GB', 'US', 'UY', 'UZ', 'VA', 'VN', 'GB', 'FM']);\n\nconst generateFourPattern = cacheCallback((length: number) => {\n const out: Array = [];\n\n for(let i = 0, k = 0; i < length;) {\n if(k === 4) {\n out.push(spaceCharacter);\n k = 0;\n } else {\n out.push(digit);\n ++i;\n ++k;\n }\n }\n\n return out;\n});\n\nfunction generateCardNumberPattern(card: string) {\n const brand = detectCardBrand(card);\n if(brand === 'amex') return sixteenPattern;\n if(brand === 'diners14') return fifteenPattern;\n const {minLength, maxLength} = CARD_BRANDS[brand];\n const s = replaceNonNumber(card).length;\n const d = Math.min(Math.max(minLength, s), maxLength);\n return generateFourPattern(d);\n}\n\nconst cardFormattingPatterns = {\n cardNumber: generateCardNumberPattern,\n cardExpiry: () => [patternCharacters.month, patternCharacters.formattingCharacter('/'), digit, digit, yearOptionalPattern],\n cardCvc: (card?: string) => cardFormattingPatterns.cardCvcFromBrand(detectCardBrand(card)),\n cardCvcFromBrand: cacheCallback((brand: string) => {\n const info = CARD_BRANDS[brand];\n const {cvcMinLength, cvcMaxLength} = info;\n const pattern = createArray(cvcMinLength || cvcMaxLength, digit);\n if(cvcMinLength && cvcMinLength < cvcMaxLength) {\n const i = cvcMaxLength - cvcMinLength;\n const h = patternCharacters.optionalPattern(/\\d/);\n if(i) {\n pattern.push(...createArray(i, h));\n }\n }\n\n return pattern;\n }),\n postalCodeFromCountry: cacheCallback((iso2: string) => {\n switch(iso2) {\n case 'US':\n return createArray(5, digit);\n case 'CA':\n return IS_ANDROID ? null : [capitalCharacter, capitalCharacter, capitalCharacter, spaceCharacter, capitalCharacter, capitalCharacter, capitalCharacter];\n default:\n const optionalDigits = createArray(10, patternCharacters.optionalPattern(/\\d/));\n if(requiredPostcodes.has(iso2)) {\n optionalDigits[0] = digit;\n }\n return optionalDigits;\n }\n })\n};\n\nexport default cardFormattingPatterns;\n","import accumulate from '../array/accumulate';\nimport {PatternFunction} from './patternCharacters';\n\nfunction accumulateLengths(strs: string[]) {\n return accumulate(strs.map((str) => str.length), 0);\n}\n\nfunction formatValueByPattern(\n getPattern: PatternFunction,\n value: string,\n options: Partial<{\n selectionStart: number,\n selectionEnd: number\n }> = {},\n pushRest?: boolean\n) {\n const pattern = getPattern(value);\n\n if(!pattern) {\n return {\n value: value,\n selection: null as typeof options,\n autocorrectComplete: !!value\n };\n }\n\n const length = pattern.length;\n const c: string[] = [];\n const s: string[] = [];\n\n let l = 0;\n let i = 0;\n let f = options.selectionStart === 0 ? 0 : null;\n let d = options.selectionEnd === 0 ? 0 : null;\n const p = () => {\n if(f === null && (i + 1) >= options.selectionStart) f = accumulateLengths(c) + (pushRest ? s.length : 0);\n if(d === null && (i + 1) >= options.selectionEnd) d = accumulateLengths(c) + (pushRest ? s.length : 0);\n };\n const m = (e: number) => {\n if(e > 0) {\n p();\n i += e;\n }\n };\n\n for(; l < length;) {\n const getCharacter = pattern[l];\n const character = getCharacter(value.slice(i));\n const {type, result, consumed} = character;\n if(type === 'required') {\n if(result) {\n c.push(...s, result);\n s.length = 0;\n ++l;\n\n if(character.partial) {\n m(value.length - i);\n break;\n }\n\n m(consumed);\n } else {\n if(!consumed) {\n break;\n }\n\n m(1);\n }\n } else if(type === 'optional') {\n if(result) {\n c.push(...s, result);\n s.length = 0;\n m(consumed);\n }\n\n ++l;\n } else if(type === 'formatting') {\n if(!pushRest && i >= value.length) {\n break;\n }\n\n s.push(result);\n ++l;\n m(consumed);\n }\n }\n\n if(pushRest) {\n c.push(...s);\n }\n\n return {\n value: c.join(''),\n selection: {\n selectionStart: f === null || value.length && options.selectionStart === value.length ? accumulateLengths(c) : f,\n selectionEnd: d === null || value.length && options.selectionEnd === value.length ? accumulateLengths(c) : d\n },\n autocorrectComplete: l === length\n };\n}\n\nexport default formatValueByPattern;\n","import {CARD_BRANDS, detectCardBrand} from './cardBrands';\nimport formatInputValueByPattern from './formatInputValueByPattern';\nimport NBSP from '../string/nbsp';\nimport replaceNonNumber from '../string/replaceNonNumber';\n\nexport type PatternValidationOptions = Partial<{\n ignoreIncomplete: boolean\n}>;\n\nconst nbspRegExp = new RegExp(NBSP, 'g');\n\nfunction makeValidationError(code?: string) {\n return code ? {\n type: 'invalid',\n code\n } : null;\n}\n\n// Luhn algorithm\nfunction validateCompleteCardNumber(card: string) {\n const t = '0'.charCodeAt(0);\n const n = card.length % 2;\n let a = 0;\n for(let i = card.length - 1; i >= 0; --i) {\n const c = n === (i % 2);\n let o = card.charCodeAt(i) - t;\n if(c) o *= 2;\n if(o > 9) o -= 9;\n a += o;\n }\n return !(a % 10);\n}\n\nfunction validateExpiry(year: number, month: number, options?: PatternValidationOptions) {\n const date = new Date(Date.now());\n const _year = year < 100 ? date.getFullYear() % 100 : date.getFullYear();\n const nextMonth = date.getMonth() + 1;\n\n if(isNaN(year) || isNaN(month)) {\n return options?.ignoreIncomplete ? null : 'incomplete';\n }\n\n if((year - _year) < 0) {\n return 'invalid_expiry_year_past';\n }\n\n if((year - _year) > 50) {\n return 'invalid_expiry_year';\n }\n\n return !(year - _year) && month < nextMonth ? 'invalid_expiry_month_past' : null;\n}\n\nfunction getCardInfoByNumber(card: string) {\n const sanitized = replaceNonNumber(card);\n const brand = detectCardBrand(card);\n return {\n sanitized,\n brand,\n minLength: CARD_BRANDS[brand].minLength\n };\n}\n\nfunction makeCardNumberError(str: string, length: number, ignoreIncomplete: boolean) {\n if(str.length >= length) {\n return validateCompleteCardNumber(str) || detectCardBrand(str) === 'mir' ? null : makeValidationError('invalid');\n }\n\n return ignoreIncomplete ? null : makeValidationError('incomplete');\n}\n\nexport function validateCardNumber(str: string, options: PatternValidationOptions = {}) {\n const {sanitized, minLength} = getCardInfoByNumber(str);\n return makeCardNumberError(sanitized, minLength, options.ignoreIncomplete);\n}\n\nexport function validateCardExpiry(str: string, options: PatternValidationOptions = {}) {\n const sanitized = str.replace(nbspRegExp, '').split(/ ?\\/ ?/);\n const [monthStr, yearStr = ''] = sanitized;\n const [month, year] = [monthStr, yearStr].map((str) => +str);\n const s = yearStr.length === 2 ? year % 100 : year;\n return yearStr.length < 2 || yearStr.length === 3 ? (options.ignoreIncomplete ? null : makeValidationError('incomplete')) : makeValidationError(validateExpiry(s, month, options));\n}\n\nexport function validateAnyIncomplete(formatted: ReturnType, str: string, options: PatternValidationOptions = {}) {\n return formatted.meta.autocorrectComplete || options.ignoreIncomplete ? null : makeValidationError('incomplete');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport TelegramWebView from '../telegramWebView';\n\nexport function createVerificationIframe(options: ConstructorParameters[0]) {\n const result = new TelegramWebView({\n ...options,\n sandbox: 'allow-forms allow-scripts allow-same-origin allow-modals'\n });\n const {iframe} = result;\n iframe.allow = 'payment';\n iframe.classList.add('payment-verification');\n return result;\n}\n\nexport default class PopupPaymentVerification extends PopupElement<{\n finish: () => void\n}> {\n private telegramWebView: TelegramWebView;\n\n constructor(private url: string, private openPathAfter?: boolean) {\n super('popup-payment popup-payment-verification', {\n closable: true,\n overlayClosable: true,\n body: true,\n title: 'Checkout.WebConfirmation.Title'\n });\n\n this.d();\n }\n\n private d() {\n const telegramWebView = this.telegramWebView = createVerificationIframe({\n url: this.url\n });\n\n telegramWebView.addEventListener('web_app_open_tg_link', (e) => {\n this.dispatchEvent('finish');\n this.hide();\n if(this.openPathAfter) {\n appImManager.openUrl('https://t.me' + e.path_full);\n }\n });\n\n this.body.append(telegramWebView.iframe);\n this.show();\n telegramWebView.onMount();\n }\n\n protected destroy() {\n this.telegramWebView.destroy();\n return super.destroy();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport cardFormattingPatterns from '../../helpers/cards/cardFormattingPatterns';\nimport {detectUnifiedCardBrand} from '../../helpers/cards/cardBrands';\nimport formatInputValueByPattern from '../../helpers/cards/formatInputValueByPattern';\nimport {validateAnyIncomplete, validateCardExpiry, validateCardNumber} from '../../helpers/cards/validateCard';\nimport placeCaretAtEnd from '../../helpers/dom/placeCaretAtEnd';\nimport {renderImageFromUrlPromise} from '../../helpers/dom/renderImageFromUrl';\nimport noop from '../../helpers/noop';\nimport {PaymentsPaymentForm} from '../../layer';\nimport {LangPackKey, _i18n} from '../../lib/langPack';\nimport CheckboxField from '../checkboxField';\nimport confirmationPopup from '../confirmationPopup';\nimport CountryInputField from '../countryInputField';\nimport InputField, {InputFieldOptions, InputState} from '../inputField';\nimport Row from '../row';\nimport {getPaymentBrandIconPath, PaymentButton, PaymentsCredentialsToken} from './payment';\nimport {createVerificationIframe} from './paymentVerification';\nimport {PasswordInputHelpers} from '../passwordInputField';\nimport SettingSection from '../settingSection';\nimport TelegramWebView from '../telegramWebView';\n\nexport type PaymentCardDetails = {\n cardNumber: string;\n cardholderName: string;\n expiryFull: string;\n expiryMonth: string;\n expiryYear: string;\n cvc: string;\n country: string;\n zip: string;\n save?: boolean;\n};\n\nexport type PaymentCardDetailsShort = {\n title: string,\n save?: boolean;\n icon?: string;\n};\n\nexport type PaymentCardDetailsResult = PaymentCardDetails | PaymentCardDetailsShort;\n\nexport class InputFieldCorrected extends InputField {\n private lastKeyDown: string;\n private lastTransformed: ReturnType;\n\n constructor(public options: InputFieldOptions & {\n formatMethod: typeof cardFormattingPatterns['cardNumber'],\n validateMethod?: typeof validateCardNumber,\n errorKeys?: {[code: string]: LangPackKey},\n optional?: boolean,\n onChange?: (transformed: InputFieldCorrected['lastTransformed']) => void,\n onKeyDown?: (e: KeyboardEvent) => void\n }) {\n super(options);\n\n // const handleIncomplete = (t?: any) => {\n // if(\n // (!lastTransformed.value && t) ||\n // lastTransformed.meta.autocorrectComplete ||\n // lastTransformed.meta.error ||\n // optional\n // ) {\n // return;\n // }\n\n\n // };\n\n this.input.addEventListener('keydown', this.onKeyDown);\n this.input.addEventListener('input', this.onInput);\n this.input.addEventListener('blur', this.onBlur);\n }\n\n private onKeyDown = (e: KeyboardEvent) => {\n this.lastKeyDown = e.key;\n this.options.onKeyDown?.(e);\n };\n\n private onInput = () => {\n const value = this.value;\n const deleting = this.lastKeyDown === 'Backspace' && (((this.lastTransformed && this.lastTransformed.value.length) || 0) - value.length) === 1;\n const result = this.lastTransformed = formatInputValueByPattern({\n value: value,\n getPattern: this.options.formatMethod,\n deleting,\n input: this.input\n });\n\n const transformedValue = result.value;\n if(transformedValue !== value) {\n this.setValueSilently(transformedValue);\n\n if(result.selection) {\n (this.input as HTMLInputElement).selectionStart = result.selection.selectionStart;\n (this.input as HTMLInputElement).selectionEnd = result.selection.selectionEnd;\n }\n }\n\n this.validateNew(transformedValue, {ignoreIncomplete: true/* !result.meta.autocorrectComplete */});\n\n this.options.onChange?.(result);\n };\n\n private onBlur = () => {\n const value = this.lastTransformed?.value;\n if(value) {\n this.validateNew(value);\n }\n };\n\n public update() {\n this.onInput();\n }\n\n public validate = () => {\n return this.validateNew();\n };\n\n public validateNew(\n value = this.lastTransformed?.value ?? '',\n t: any = {},\n justReturn?: boolean\n ) {\n let result: ReturnType;\n if(this.options.validateMethod) {\n result = this.options.validateMethod?.(value, t);\n } else {\n result = validateAnyIncomplete(this.lastTransformed, value, t);\n }\n\n if(result?.code) {\n const langPackKey: LangPackKey = this.options.errorKeys?.[result.code];\n !justReturn && this.setState(InputState.Error, langPackKey);\n return false;\n }\n\n !justReturn && this.setState(InputState.Neutral);\n return true;\n }\n}\n\nexport function handleInputFieldsOnChange(inputFields: (CountryInputField | InputField | InputFieldCorrected)[], _onChange: (valid: boolean) => void) {\n const onChange = () => {\n const valid = inputFields.every((inputField) => {\n return 'validateNew' in inputField ? inputField.validateNew(undefined, undefined, true) : inputField.isValid();\n });\n\n _onChange(valid);\n };\n\n inputFields.forEach((inputField) => {\n if(inputField instanceof InputFieldCorrected) {\n const original = inputField.options.onChange;\n inputField.options.onChange = (...args: any[]) => {\n // @ts-ignore\n original?.(...args);\n onChange();\n };\n\n if('update' in inputField) {\n inputField.update();\n }\n } else {\n inputField.input.addEventListener('input', onChange);\n }\n });\n\n return {validate: onChange};\n}\n\nexport function createCountryZipFields(country?: boolean, zip?: boolean) {\n let countryInputField: CountryInputField, postcodeInputField: InputFieldCorrected;\n if(country || zip) {\n if(country) countryInputField = new CountryInputField({\n noPhoneCodes: true,\n onCountryChange: () => {\n postcodeInputField?.update();\n },\n required: true,\n autocomplete: 'country'\n });\n if(zip) postcodeInputField = new InputFieldCorrected({\n label: 'PaymentShippingZipPlaceholder',\n plainText: true,\n inputMode: 'numeric',\n autocomplete: 'postal-code',\n formatMethod: (/* ...args */) => {\n const {country} = countryInputField.getSelected();\n const iso2 = country?.iso2;\n return cardFormattingPatterns.postalCodeFromCountry(iso2 && iso2.toUpperCase());\n }\n });\n }\n\n return {countryInputField, postcodeInputField};\n}\n\nexport type PaymentsNativeProvider = 'stripe' | 'smartglocal';\nexport type PaymentsNativeParams = {\n need_country?: boolean,\n need_zip?: boolean,\n need_cardholder_name?: boolean,\n publishable_key?: string, // stripe\n public_token?: string, // smartglocal\n gpay_params: string,\n};\nconst SUPPORTED_NATIVE_PROVIDERS: Set = new Set(['stripe', 'smartglocal']);\n\nexport default class PopupPaymentCard extends PopupElement<{\n finish: (obj: {token: any, card: PaymentCardDetailsResult}) => void\n}> {\n protected telegramWebView: TelegramWebView;\n\n constructor(private paymentForm: PaymentsPaymentForm, private savedCard?: PaymentCardDetails) {\n super('popup-payment popup-payment-card', {\n closable: true,\n overlayClosable: true,\n body: true,\n scrollable: SUPPORTED_NATIVE_PROVIDERS.has(paymentForm.native_provider as PaymentsNativeProvider),\n title: 'PaymentCardInfo'\n });\n\n if(SUPPORTED_NATIVE_PROVIDERS.has(paymentForm.native_provider as PaymentsNativeProvider)) {\n this.d();\n } else {\n const telegramWebView = this.telegramWebView = createVerificationIframe({\n url: paymentForm.url\n });\n\n telegramWebView.addEventListener('payment_form_submit', (data) => {\n const cardOut = {title: data.title, save: false} as any as PaymentCardDetails;\n this.dispatchEvent('finish', {\n token: data.credentials,\n card: cardOut\n });\n\n this.hide();\n\n if(paymentForm.pFlags.can_save_credentials) {\n confirmationPopup({\n titleLangKey: 'PaymentCardSavePaymentInformation',\n descriptionLangKey: 'PaymentCardSavePaymentInformationInfoLine1',\n button: {\n langKey: 'Save'\n }\n }).then(() => {\n cardOut.save = true;\n }, noop);\n }\n });\n\n // putPreloader(this.body, true);\n this.body.append(telegramWebView.iframe);\n this.show();\n telegramWebView.onMount();\n }\n }\n\n protected destroy() {\n this.telegramWebView?.destroy();\n return super.destroy();\n }\n\n private d() {\n const savedCard = this.savedCard;\n const cardSection = new SettingSection({name: 'PaymentInfo.Card.Title', noDelimiter: true, noShadow: true});\n\n const nativeParams: PaymentsNativeParams = JSON.parse(this.paymentForm.native_params.data);\n\n let lastBrand: string, brandIconTempId = 0, lastBrandImg: HTMLImageElement;\n const setBrandIcon = (brand: string) => {\n if(lastBrand === brand) {\n return;\n }\n\n const tempId = ++brandIconTempId;\n lastBrand = brand;\n\n const path = getPaymentBrandIconPath(brand);\n if(!path) {\n if(lastBrandImg) {\n lastBrandImg.remove();\n lastBrandImg = undefined;\n }\n\n return;\n }\n\n const img = new Image();\n img.classList.add('input-field-icon');\n renderImageFromUrlPromise(img, path, false).then(() => {\n if(brandIconTempId !== tempId) {\n return;\n }\n\n if(lastBrandImg) {\n lastBrandImg.replaceWith(img);\n } else {\n cardInputField.container.append(img);\n }\n\n lastBrandImg = img;\n });\n };\n const cardInputField = new InputFieldCorrected({\n label: 'PaymentCardNumber',\n plainText: true,\n inputMode: 'numeric',\n autocomplete: 'cc-number',\n formatMethod: cardFormattingPatterns.cardNumber,\n validateMethod: validateCardNumber,\n errorKeys: {\n invalid: 'PaymentCard.Error.Invalid',\n incomplete: 'PaymentCard.Error.Incomplete'\n },\n onChange: (transformed) => {\n setBrandIcon(detectUnifiedCardBrand(transformed.value));\n cvcInputField.update(); // format cvc\n }\n });\n\n let nameInputField: InputField;\n if(nativeParams.need_cardholder_name) nameInputField = new InputField({\n label: 'Checkout.NewCard.CardholderNamePlaceholder',\n maxLength: 255,\n required: true,\n autocomplete: 'cc-name'\n });\n\n const expireInputField = new InputFieldCorrected({\n label: 'SecureId.Identity.Placeholder.ExpiryDate',\n plainText: true,\n inputMode: 'numeric',\n autocomplete: 'cc-exp',\n formatMethod: cardFormattingPatterns.cardExpiry,\n validateMethod: validateCardExpiry\n });\n\n // handle autocomplete: 01/2345 -> 01/45\n expireInputField.input.addEventListener('input', () => {\n let value = expireInputField.value;\n if(value.length < 5) {\n return;\n }\n\n const splitted = value.split('/');\n if(splitted[1].length !== 4) {\n return;\n }\n\n value = [splitted[0], splitted[1].slice(2)].join('/');\n expireInputField.setValueSilently(value);\n }, {capture: true});\n\n const cvcInputField = new InputFieldCorrected({\n labelText: 'CVC',\n plainText: true,\n inputMode: 'numeric',\n autocomplete: 'cc-csc',\n name: 'cvc',\n formatMethod: () => cardFormattingPatterns.cardCvc(cardInputField.value)\n // validateMethod: (...args) => _5AH3.a.cardCvc(cardInputField.value)(...args)\n });\n\n const passwordHelpers = new PasswordInputHelpers(cvcInputField.container, cvcInputField.input as HTMLInputElement);\n\n const switchFocusOrder: (InputFieldCorrected | InputField)[] = [\n cardInputField,\n expireInputField,\n cvcInputField,\n nameInputField\n ].filter(Boolean);\n switchFocusOrder.forEach((inputField) => {\n const onKeyDown = (e: KeyboardEvent) => {\n if(!inputField.value && e.key === 'Backspace') {\n const previousInputField = switchFocusOrder[switchFocusOrder.indexOf(inputField) - 1];\n if(previousInputField) {\n // previousInputField.value = previousInputField.value.slice(0, -1);\n placeCaretAtEnd(previousInputField.input, true);\n }\n }\n };\n\n if(inputField instanceof InputFieldCorrected) {\n inputField.options.onKeyDown = onKeyDown;\n\n const original = inputField.options.onChange;\n inputField.options.onChange = (transformed) => {\n original?.(transformed);\n\n if(document.activeElement === inputField.input && transformed.meta.autocorrectComplete) {\n for(let i = switchFocusOrder.indexOf(inputField), length = switchFocusOrder.length; i < length; ++i) {\n const nextInputField = switchFocusOrder[i];\n if(\n nextInputField instanceof InputFieldCorrected ?\n !nextInputField.validateNew(undefined, undefined, true) :\n !nextInputField.value\n ) {\n placeCaretAtEnd(nextInputField.input, true);\n break;\n }\n }\n }\n };\n } else {\n inputField.input.addEventListener('keydown', onKeyDown);\n }\n });\n\n const inputFieldsRow = document.createElement('div');\n inputFieldsRow.classList.add('input-fields-row');\n inputFieldsRow.append(expireInputField.container, cvcInputField.container);\n\n const form = document.createElement('form');\n form.append(...[\n cardInputField.container,\n inputFieldsRow,\n nameInputField?.container\n ].filter(Boolean))\n\n cardSection.content.append(form);\n\n let billingSection: SettingSection;\n // let saveCheckboxField: CheckboxField;\n const {countryInputField, postcodeInputField} = createCountryZipFields(nativeParams.need_country, nativeParams.need_zip);\n if(nativeParams.need_country || nativeParams.need_zip) {\n billingSection = new SettingSection({name: 'PaymentInfo.Billing.Title', noDelimiter: true, noShadow: true});\n\n // const inputFieldsRow2 = inputFieldsRow.cloneNode() as HTMLElement;\n // inputFieldsRow2.append(countryInputField.container, postcodeInputField.container);\n // billingSection.content.append(inputFieldsRow2);\n billingSection.content.append(...[countryInputField, postcodeInputField].filter(Boolean).map((i) => i.container));\n }\n\n const canSave = !!this.paymentForm.pFlags.can_save_credentials;\n const saveCheckboxField = new CheckboxField({\n text: 'PaymentCardSavePaymentInformation',\n checked: !!canSave\n });\n const saveRow = new Row({\n checkboxField: saveCheckboxField,\n subtitleLangKey: canSave ? 'PaymentCardSavePaymentInformationInfoLine1' : 'Checkout.2FA.Text'\n });\n\n if(!canSave) {\n saveRow.container.classList.add('is-disabled');\n }\n\n (billingSection || cardSection).content.append(saveRow.container);\n\n this.scrollable.append(...[cardSection, billingSection].filter(Boolean).map((s) => s.container));\n\n const payButton = PaymentButton({\n key: 'PaymentInfo.Done',\n onClick: async() => {\n const data: PaymentCardDetails = {\n cardNumber: cardInputField.value,\n expiryFull: expireInputField.value,\n expiryMonth: expireInputField.value.split('/')[0],\n expiryYear: expireInputField.value.split('/')[1],\n cvc: cvcInputField.value,\n\n cardholderName: nameInputField?.value,\n country: countryInputField?.value,\n zip: postcodeInputField?.value,\n\n save: saveCheckboxField?.checked\n };\n\n const nativeProvider: PaymentsNativeProvider = this.paymentForm.native_provider as any;\n let out: PaymentsCredentialsToken;\n if(nativeProvider === 'stripe') {\n const url = new URL('https://api.stripe.com/v1/tokens');\n url.search = new URLSearchParams({\n 'card[number]': data.cardNumber,\n 'card[exp_month]': data.expiryMonth,\n 'card[exp_year]': data.expiryYear,\n 'card[cvc]': data.cvc,\n 'card[address_zip]': data.zip,\n 'card[address_country]': data.country,\n 'card[name]': data.cardholderName\n }).toString();\n\n const response = await fetch(url.toString(), {\n method: 'POST',\n credentials: 'same-origin',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Authorization': `Bearer ${nativeParams.publishable_key}`\n }\n });\n\n out = await response.json();\n } else if(nativeProvider === 'smartglocal') {\n const params = {\n card: {\n number: data.cardNumber.replace(/[^\\d]+/g, ''),\n expiration_month: data.expiryMonth,\n expiration_year: data.expiryYear,\n security_code: data.cvc.replace(/[^\\d]+/g, '')\n }\n };\n\n const url = /* DEBUG_PAYMENT_SMART_GLOCAL */false ?\n 'https://tgb-playground.smart-glocal.com/cds/v1/tokenize/card' :\n 'https://tgb.smart-glocal.com/cds/v1/tokenize/card';\n\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'X-PUBLIC-TOKEN': nativeParams.public_token\n },\n body: JSON.stringify(params)\n });\n\n const json: { // smartglocal\n data: {\n info: {\n card_network: string,\n card_type: string,\n masked_card_number: string\n },\n token: string\n },\n status: 'ok'\n } = await response.json();\n\n out = {type: 'card', token: json.data.token}\n }\n\n this.dispatchEvent('finish', {token: out, card: data});\n this.hide();\n }\n });\n\n const inputFields = ([\n cardInputField,\n nameInputField,\n expireInputField,\n cvcInputField,\n countryInputField,\n postcodeInputField\n ] as const).filter(Boolean);\n handleInputFieldsOnChange(inputFields, (valid) => {\n payButton.disabled = !valid;\n // payButton.classList.toggle('btn-disabled', !valid);\n });\n\n if(savedCard) {\n cardInputField.value = savedCard.cardNumber;\n expireInputField.value = savedCard.expiryFull;\n cvcInputField.value = savedCard.cvc;\n nameInputField && (nameInputField.value = savedCard.cardholderName);\n countryInputField && (countryInputField.value = savedCard.country);\n postcodeInputField && (postcodeInputField.value = savedCard.zip);\n }\n\n this.body.append(this.btnConfirmOnEnter = payButton);\n\n this.show();\n\n if(!cardInputField.validateNew(undefined, undefined, true)) {\n placeCaretAtEnd(cardInputField.input);\n }\n }\n}\n","import formatValueByPattern from './formatValueByPattern';\n\nexport default function formatInputValueByPattern(options: {\n value: string,\n getPattern: Parameters[0],\n deleting?: boolean,\n input?: HTMLElement\n}) {\n const {value: originalValue, getPattern, deleting, input} = options;\n const pushRest = !deleting && !!originalValue.length;\n const result = formatValueByPattern(getPattern, originalValue, {\n selectionStart: input ? (input as HTMLInputElement).selectionStart : 0,\n selectionEnd: input ? (input as HTMLInputElement).selectionEnd : 0\n }, pushRest)\n const {value, selection} = result;\n\n return {\n value,\n meta: {\n autocorrectComplete: result.autocorrectComplete,\n empty: !value\n },\n selection\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport placeCaretAtEnd from '../../helpers/dom/placeCaretAtEnd';\nimport {AccountPassword, AccountTmpPassword} from '../../layer';\nimport {InputState} from '../inputField';\nimport PasswordInputField from '../passwordInputField';\nimport SettingSection from '../settingSection';\nimport {PaymentButton} from './payment';\n\nexport default class PopupPaymentCardConfirmation extends PopupElement<{\n finish: (tmpPassword: AccountTmpPassword) => void\n}> {\n constructor(card: string, passwordState: AccountPassword) {\n super('popup-payment popup-payment-card-confirmation', {\n closable: true,\n overlayClosable: true,\n body: true,\n scrollable: true,\n title: 'Checkout.PasswordEntry.Title'\n });\n\n const section = new SettingSection({noDelimiter: true, noShadow: true, caption: 'Checkout.PasswordEntry.Text', captionArgs: [card]});\n const passwordInputField = new PasswordInputField({labelText: passwordState.hint});\n section.content.append(passwordInputField.container);\n this.scrollable.append(section.container);\n\n const onInput = () => {\n payButton.disabled = !passwordInputField.value;\n passwordInputField.setState(InputState.Neutral);\n };\n\n passwordInputField.input.addEventListener('input', onInput);\n\n const payButton = PaymentButton({\n key: 'Checkout.PasswordEntry.Pay',\n onClick: async() => {\n try {\n const inputCheckPassword = await this.managers.passwordManager.getInputCheckPassword(passwordInputField.value, passwordState);\n const tmpPassword = await this.managers.apiManager.invokeApi('account.getTmpPassword', {\n password: inputCheckPassword,\n period: 60\n });\n\n this.dispatchEvent('finish', tmpPassword);\n this.hide();\n } catch(err) {\n if((err as ApiError).type === 'PASSWORD_HASH_INVALID') {\n (err as ApiError).handled = true;\n passwordInputField.setError('PASSWORD_HASH_INVALID');\n }\n\n throw err;\n }\n }\n });\n this.body.append(this.btnConfirmOnEnter = payButton);\n\n onInput();\n\n this.show();\n\n placeCaretAtEnd(passwordInputField.input);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport placeCaretAtEnd from '../../helpers/dom/placeCaretAtEnd';\nimport {InputInvoice, PaymentRequestedInfo, PaymentsPaymentForm, PaymentsValidatedRequestedInfo} from '../../layer';\nimport matchEmail from '../../lib/richTextProcessor/matchEmail';\nimport CheckboxField from '../checkboxField';\nimport CountryInputField from '../countryInputField';\nimport InputField from '../inputField';\nimport Row from '../row';\nimport SettingSection from '../settingSection';\nimport TelInputField from '../telInputField';\nimport {PaymentButton} from './payment';\nimport {createCountryZipFields, handleInputFieldsOnChange, InputFieldCorrected} from './paymentCard';\n\nexport type PaymentShippingAddress = PaymentRequestedInfo;\n\ntype ShippingFocusField = 'name' | 'email' | 'phone';\n\nexport default class PopupPaymentShipping extends PopupElement<{\n finish: (o: {shippingAddress: PaymentShippingAddress, requestedInfo: PaymentsValidatedRequestedInfo}) => void\n}> {\n constructor(\n private paymentForm: PaymentsPaymentForm,\n private inputInvoice: InputInvoice,\n private focus?: ShippingFocusField\n ) {\n super('popup-payment popup-payment-shipping', {\n closable: true,\n overlayClosable: true,\n body: true,\n scrollable: true,\n title: 'PaymentShippingInfo'\n });\n\n this.d();\n }\n\n private d() {\n const paymentForm = this.paymentForm;\n const invoice = paymentForm.invoice;\n const savedInfo = this.paymentForm.saved_info;\n\n let addressSection: SettingSection,\n address1InputField: InputField,\n address2InputField: InputField,\n cityInputField: InputField,\n stateInputField: InputField,\n countryInputField: CountryInputField,\n postcodeInputField: InputFieldCorrected;\n if(invoice.pFlags.shipping_address_requested) {\n addressSection = new SettingSection({name: 'PaymentShippingAddress', noDelimiter: true, noShadow: true});\n address1InputField = new InputField({label: 'PaymentShippingAddress1Placeholder', maxLength: 64, required: true});\n address2InputField = new InputField({label: 'PaymentShippingAddress2Placeholder', maxLength: 64});\n cityInputField = new InputField({label: 'PaymentShippingCityPlaceholder', maxLength: 64, required: true});\n stateInputField = new InputField({label: 'PaymentShippingStatePlaceholder', maxLength: 64});\n const res = createCountryZipFields(true, true);\n countryInputField = res.countryInputField;\n postcodeInputField = res.postcodeInputField;\n\n addressSection.content.append(...[\n address1InputField,\n address2InputField,\n cityInputField,\n stateInputField,\n countryInputField,\n postcodeInputField\n ].filter(Boolean).map((inputField) => inputField.container));\n }\n\n let receiverSection: SettingSection;\n let nameInputField: InputField, emailInputField: InputField, telInputField: TelInputField;\n if([invoice.pFlags.name_requested, invoice.pFlags.email_requested, invoice.pFlags.phone_requested].includes(true)) {\n receiverSection = new SettingSection({name: 'PaymentShippingReceiver', noDelimiter: true, noShadow: true});\n\n const validateEmail = () => {\n const value = emailInputField.value;\n const match = matchEmail(value);\n if(!match || match[0].length !== value.length) {\n return false;\n }\n\n return true;\n };\n\n const validatePhone = () => {\n return !!telInputField.value.match(/\\d/);\n };\n\n if(invoice.pFlags.name_requested) nameInputField = new InputField({label: 'PaymentShippingName', maxLength: 256, required: true});\n if(invoice.pFlags.email_requested) emailInputField = new InputField({label: 'PaymentShippingEmailPlaceholder', maxLength: 64, required: true, validate: validateEmail});\n if(invoice.pFlags.phone_requested) telInputField = new TelInputField({required: true, validate: validatePhone});\n\n receiverSection.content.append(...[\n nameInputField,\n emailInputField,\n telInputField\n ].filter(Boolean).map((inputField) => inputField.container));\n }\n\n const saveCheckboxField = new CheckboxField({\n text: 'PaymentShippingSave',\n checked: true\n });\n const saveRow = new Row({\n checkboxField: saveCheckboxField,\n subtitleLangKey: 'PaymentShippingSaveInfo'\n });\n\n (receiverSection || addressSection).content.append(saveRow.container);\n\n this.scrollable.append(...[addressSection, receiverSection].filter(Boolean).map((section) => section.container));\n\n const payButton = PaymentButton({\n key: 'PaymentInfo.Done',\n onClick: async() => {\n const selectedCountry = countryInputField && countryInputField.getSelected().country;\n const data: PaymentShippingAddress = {\n _: 'paymentRequestedInfo',\n shipping_address: selectedCountry && {\n _: 'postAddress',\n street_line1: address1InputField.value,\n street_line2: address2InputField.value,\n city: cityInputField.value,\n state: stateInputField.value,\n // country: countryInputField.value,\n country_iso2: selectedCountry?.iso2,\n post_code: postcodeInputField.value\n },\n name: nameInputField?.value,\n email: emailInputField?.value,\n phone: telInputField?.value\n };\n\n try {\n const requestedInfo = await this.managers.appPaymentsManager.validateRequestedInfo(this.inputInvoice, data, saveCheckboxField?.checked);\n\n this.dispatchEvent('finish', {\n shippingAddress: data,\n requestedInfo\n });\n\n this.hide();\n } catch(err: any) {\n const errorMap: {[err: string]: InputField} = {\n ADDRESS_STREET_LINE1_INVALID: address1InputField,\n ADDRESS_STREET_LINE2_INVALID: address2InputField,\n ADDRESS_COUNTRY_INVALID: countryInputField,\n ADDRESS_CITY_INVALID: cityInputField,\n ADDRESS_STATE_INVALID: stateInputField,\n ADDRESS_POSTCODE_INVALID: postcodeInputField,\n\n REQ_INFO_NAME_INVALID: nameInputField,\n REQ_INFO_EMAIL_INVALID: emailInputField,\n REQ_INFO_PHONE_INVALID: telInputField\n };\n\n const inputField = errorMap[(err as ApiError).type];\n if(inputField) {\n inputField.setError();\n (err as any).handled = true;\n }\n\n throw err;\n }\n }\n });\n this.body.append(this.btnConfirmOnEnter = payButton);\n\n if(savedInfo) {\n const shippingAddress = savedInfo.shipping_address;\n if(shippingAddress) {\n address1InputField.value = shippingAddress.street_line1;\n address2InputField.value = shippingAddress.street_line2;\n cityInputField.value = shippingAddress.city;\n stateInputField.value = shippingAddress.state;\n countryInputField.selectCountryByIso2(shippingAddress.country_iso2);\n postcodeInputField.value = shippingAddress.post_code;\n }\n\n savedInfo.name && nameInputField && (nameInputField.value = savedInfo.name);\n savedInfo.email && emailInputField && (emailInputField.value = savedInfo.email);\n savedInfo.phone && telInputField && (telInputField.value = savedInfo.phone);\n }\n\n const {validate} = handleInputFieldsOnChange([\n address1InputField,\n address2InputField,\n cityInputField,\n stateInputField,\n countryInputField,\n postcodeInputField,\n nameInputField,\n emailInputField,\n telInputField\n ].filter(Boolean), (valid) => {\n payButton.disabled = !valid;\n });\n\n validate();\n\n this.show();\n\n let focusField: InputField;\n if(this.focus) {\n const focusMap: {[field in ShippingFocusField]?: InputField} = {\n name: nameInputField,\n email: emailInputField,\n phone: telInputField\n };\n\n focusField = focusMap[this.focus];\n } else {\n focusField = address1InputField;\n }\n\n if(focusField) {\n placeCaretAtEnd(focusField.input);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport accumulate from '../../helpers/array/accumulate';\nimport paymentsWrapCurrencyAmount from '../../helpers/paymentsWrapCurrencyAmount';\nimport {PaymentsPaymentForm, PaymentsValidatedRequestedInfo, ShippingOption} from '../../layer';\nimport RadioField from '../radioField';\nimport Row, {RadioFormFromRows} from '../row';\nimport SettingSection from '../settingSection';\nimport {PaymentButton} from './payment';\n\nexport default class PopupPaymentShippingMethods extends PopupElement<{\n finish: (shippingOption: ShippingOption) => void\n}> {\n constructor(\n private paymentForm: PaymentsPaymentForm,\n private requestedInfo: PaymentsValidatedRequestedInfo,\n private shippingOption: ShippingOption\n ) {\n super('popup-payment popup-payment-shipping-methods', {\n closable: true,\n overlayClosable: true,\n body: true,\n scrollable: true,\n title: 'PaymentShippingMethod'\n });\n\n this.d();\n }\n\n private d() {\n const section = new SettingSection({name: 'PaymentCheckoutShippingMethod', noDelimiter: true, noShadow: true});\n\n const rows = this.requestedInfo.shipping_options.map((shippingOption) => {\n return new Row({\n radioField: new RadioField({\n text: shippingOption.title,\n name: 'shipping-method',\n value: shippingOption.id\n }),\n subtitle: paymentsWrapCurrencyAmount(\n accumulate(shippingOption.prices.map(({amount}) => +amount), 0),\n this.paymentForm.invoice.currency\n )\n });\n });\n\n let lastShippingId: string;\n const form = RadioFormFromRows(rows, (value) => {\n lastShippingId = value;\n });\n\n if(this.shippingOption) {\n rows.find((row) => row.radioField.input.value === this.shippingOption.id).radioField.checked = true;\n } else {\n rows[0].radioField.checked = true;\n }\n\n section.content.append(form);\n\n this.scrollable.append(section.container);\n\n const payButton = PaymentButton({\n key: 'PaymentInfo.Done',\n onClick: () => {\n this.dispatchEvent('finish', this.requestedInfo.shipping_options.find((option) => option.id === lastShippingId));\n this.hide();\n }\n });\n this.body.append(this.btnConfirmOnEnter = payButton);\n\n this.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport Currencies from '../../config/currencies';\nimport {FontFamily, FontSize} from '../../config/font';\nimport accumulate from '../../helpers/array/accumulate';\nimport getTextWidth from '../../helpers/canvas/getTextWidth';\nimport {detectUnifiedCardBrand} from '../../helpers/cards/cardBrands';\nimport {attachClickEvent, simulateClickEvent} from '../../helpers/dom/clickEvent';\nimport findUpAsChild from '../../helpers/dom/findUpAsChild';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport placeCaretAtEnd from '../../helpers/dom/placeCaretAtEnd';\nimport {renderImageFromUrlPromise} from '../../helpers/dom/renderImageFromUrl';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport toggleDisability from '../../helpers/dom/toggleDisability';\nimport {formatPhoneNumber} from '../../helpers/formatPhoneNumber';\nimport paymentsWrapCurrencyAmount from '../../helpers/paymentsWrapCurrencyAmount';\nimport ScrollSaver from '../../helpers/scrollSaver';\nimport tsNow from '../../helpers/tsNow';\nimport {AccountTmpPassword, InputInvoice, InputPaymentCredentials, LabeledPrice, Message, MessageMedia, PaymentRequestedInfo, PaymentSavedCredentials, PaymentsPaymentForm, PaymentsPaymentReceipt, PaymentsValidatedRequestedInfo, PostAddress, ShippingOption} from '../../layer';\nimport I18n, {i18n, LangPackKey, _i18n} from '../../lib/langPack';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\nimport rootScope from '../../lib/rootScope';\nimport AvatarElement from '../avatar';\nimport Button from '../button';\nimport CheckboxField from '../checkboxField';\nimport PeerTitle from '../peerTitle';\nimport {putPreloader} from '../putPreloader';\nimport Row from '../row';\nimport {toastNew} from '../toast';\nimport wrapPeerTitle from '../wrappers/peerTitle';\nimport wrapPhoto from '../wrappers/photo';\nimport PopupPaymentCard, {PaymentCardDetails, PaymentCardDetailsResult} from './paymentCard';\nimport PopupPaymentCardConfirmation from './paymentCardConfirmation';\nimport PopupPaymentShipping, {PaymentShippingAddress} from './paymentShipping';\nimport PopupPaymentShippingMethods from './paymentShippingMethods';\nimport PopupPaymentVerification from './paymentVerification';\n\nconst iconPath = 'assets/img/';\nconst icons = [\n 'amex',\n 'card',\n 'diners',\n 'discover',\n 'jcb',\n 'mastercard',\n 'visa',\n 'unionpay',\n 'mir',\n 'logo'\n];\n\nexport function getPaymentBrandIconPath(brand: string) {\n if(!icons.includes(brand)) {\n return;\n }\n\n return `${iconPath}${brand}.svg`;\n}\n\nexport function PaymentButton(options: {\n onClick: () => Promise | void,\n key?: LangPackKey,\n textEl?: I18n.IntlElement\n}) {\n const textEl = options.textEl ?? new I18n.IntlElement({key: options.key ?? 'PaymentInfo.Done'});\n const key = textEl.key;\n const payButton = Button('btn-primary btn-color-primary payment-item-pay');\n payButton.append(textEl.element);\n attachClickEvent(payButton, async() => {\n const result = options.onClick();\n if(!(result instanceof Promise)) {\n return;\n }\n\n const d = putPreloader(payButton);\n const toggle = toggleDisability([payButton], true);\n textEl.compareAndUpdate({key: 'PleaseWait'});\n try {\n await result;\n } catch(err) {\n if(!(err as any).handled) {\n console.error('payment button error', err);\n }\n\n toggle();\n textEl.compareAndUpdate({key});\n d.remove();\n }\n });\n return payButton;\n}\n\nexport type PaymentsCredentialsToken = {type: 'card', token?: string, id?: string};\n\nexport default class PopupPayment extends PopupElement {\n private tipButtonsMap: Map;\n\n constructor(\n private message: Message.message,\n private inputInvoice: InputInvoice,\n private paymentForm?: PaymentsPaymentForm | PaymentsPaymentReceipt,\n private isReceipt?: boolean\n ) {\n super('popup-payment', {\n closable: true,\n overlayClosable: true,\n body: true,\n scrollable: true,\n title: true\n });\n\n this.tipButtonsMap = new Map();\n this.d().catch((err) => {\n console.error('payment popup error', err);\n this.hide();\n });\n }\n\n private async d() {\n this.element.classList.add('is-loading');\n this.show();\n\n let confirmed = false;\n const onConfirmed = () => {\n if(confirmed) {\n return;\n }\n\n confirmed = true;\n if(popupPaymentVerification) {\n popupPaymentVerification.hide();\n }\n\n this.hide();\n };\n\n let {paymentForm, message} = this;\n\n if(message) {\n this.listenerSetter.add(rootScope)('payment_sent', ({peerId, mid}) => {\n if(message.peerId === peerId && message.mid === mid) {\n onConfirmed();\n }\n });\n }\n\n const mediaInvoice = message?.media as MessageMedia.messageMediaInvoice;\n const isReceipt = this.isReceipt ??\n (\n mediaInvoice ?\n !!mediaInvoice.receipt_msg_id || mediaInvoice.extended_media?._ === 'messageExtendedMedia' :\n paymentForm._ === 'payments.paymentReceipt'\n );\n const isTest = mediaInvoice ? mediaInvoice.pFlags.test : paymentForm.invoice.pFlags.test;\n\n const photo = mediaInvoice ? mediaInvoice.photo : paymentForm.photo;\n const title = mediaInvoice ? mediaInvoice.title : paymentForm.title;\n const description = mediaInvoice ? mediaInvoice.description : paymentForm.description;\n\n _i18n(this.title, isReceipt ? 'PaymentReceipt' : 'PaymentCheckout');\n if(isTest) {\n this.title.append(' (Test)');\n }\n\n const className = 'payment-item';\n\n const itemEl = document.createElement('div');\n itemEl.classList.add(className);\n\n const detailsClassName = className + '-details';\n const details = document.createElement('div');\n details.classList.add(detailsClassName);\n\n let photoEl: HTMLElement;\n if(photo) {\n photoEl = document.createElement('div');\n photoEl.classList.add(detailsClassName + '-photo', 'media-container-contain');\n wrapPhoto({\n photo: photo,\n container: photoEl,\n boxWidth: 100,\n boxHeight: 100,\n size: {_: 'photoSizeEmpty', type: ''}\n });\n details.append(photoEl);\n }\n\n const linesClassName = detailsClassName + '-lines';\n const linesEl = document.createElement('div');\n linesEl.classList.add(linesClassName);\n\n const titleEl = document.createElement('div');\n titleEl.classList.add(linesClassName + '-title');\n\n const descriptionEl = document.createElement('div');\n descriptionEl.classList.add(linesClassName + '-description');\n\n const botName = document.createElement('div');\n botName.classList.add(linesClassName + '-bot-name');\n\n linesEl.append(titleEl, descriptionEl, botName);\n\n setInnerHTML(titleEl, wrapEmojiText(title));\n setInnerHTML(descriptionEl, wrapEmojiText(description));\n\n const peerTitle = new PeerTitle();\n botName.append(peerTitle.element);\n\n details.append(linesEl);\n itemEl.append(details);\n this.scrollable.append(itemEl);\n\n const preloaderContainer = document.createElement('div');\n preloaderContainer.classList.add(className + '-preloader-container');\n const preloader = putPreloader(preloaderContainer, true);\n this.scrollable.container.append(preloaderContainer);\n\n const inputInvoice = this.inputInvoice;\n if(!paymentForm) {\n if(isReceipt) paymentForm = await this.managers.appPaymentsManager.getPaymentReceipt(message.peerId, mediaInvoice.receipt_msg_id || (inputInvoice as InputInvoice.inputInvoiceMessage).msg_id);\n else paymentForm = await this.managers.appPaymentsManager.getPaymentForm(inputInvoice);\n this.paymentForm = paymentForm;\n }\n\n let savedInfo = (paymentForm as PaymentsPaymentForm).saved_info || (paymentForm as PaymentsPaymentReceipt).info;\n const savedCredentials = (paymentForm as PaymentsPaymentForm).saved_credentials?.[0];\n let [lastRequestedInfo, passwordState, providerPeerTitle] = await Promise.all([\n !isReceipt && savedInfo && this.managers.appPaymentsManager.validateRequestedInfo(inputInvoice, savedInfo),\n savedCredentials && this.managers.passwordManager.getState(),\n wrapPeerTitle({peerId: paymentForm.provider_id.toPeerId()})\n ]);\n\n // console.log(paymentForm, lastRequestedInfo);\n\n await peerTitle.update({peerId: paymentForm.bot_id.toPeerId()});\n preloaderContainer.remove();\n this.element.classList.remove('is-loading');\n\n const wrapAmount = (amount: string | number, skipSymbol?: boolean) => {\n return paymentsWrapCurrencyAmount(amount, currency, skipSymbol);\n };\n\n const {invoice} = paymentForm;\n const currency = invoice.currency;\n\n const isRecurring = invoice.pFlags.recurring && !isReceipt;\n\n await peerTitle.update({peerId: paymentForm.bot_id.toPeerId()});\n const peerTitle2 = isRecurring ? await wrapPeerTitle({peerId: paymentForm.bot_id.toPeerId()}) : undefined;\n preloaderContainer.remove();\n this.element.classList.remove('is-loading');\n\n const makeLabel = () => {\n const labelEl = document.createElement('div');\n labelEl.classList.add(pricesClassName + '-price');\n\n const left = document.createElement('span');\n const right = document.createElement('span');\n labelEl.append(left, right);\n return {label: labelEl, left, right};\n };\n\n const pricesClassName = className + '-prices';\n const prices = document.createElement('div');\n prices.classList.add(pricesClassName);\n const makePricesElements = (prices: LabeledPrice[]) => {\n return prices.map((price) => {\n const {amount, label} = price;\n\n const _label = makeLabel();\n _label.left.textContent = label;\n\n const wrappedAmount = wrapAmount(amount);\n _label.right.textContent = wrappedAmount;\n\n return _label.label;\n });\n };\n\n const pricesElements = makePricesElements(invoice.prices);\n\n let getTipsAmount = (): number => 0;\n let shippingAmount = 0;\n\n const getTotalTotal = () => totalAmount + getTipsAmount() + shippingAmount;\n const setTotal = () => {\n const wrapped = wrapAmount(getTotalTotal());\n totalLabel.right.textContent = wrapped;\n payI18n.compareAndUpdate({\n key: 'PaymentCheckoutPay',\n args: [wrapped]\n });\n };\n\n const payI18n = new I18n.IntlElement();\n\n const totalLabel = makeLabel();\n totalLabel.label.classList.add('is-total');\n _i18n(totalLabel.left, 'PaymentTransactionTotal');\n const totalAmount = accumulate(invoice.prices.map(({amount}) => +amount), 0);\n\n const canTip = (invoice.max_tip_amount !== undefined && !isReceipt) || !!(paymentForm as PaymentsPaymentReceipt).tip_amount;\n if(canTip) {\n const tipsClassName = className + '-tips';\n\n const currencyData = Currencies[currency];\n\n getTipsAmount = () => +getInputValue().replace(/\\D/g, '');\n\n const getInputValue = () => {\n // return input.textContent;\n return input.value;\n };\n\n const setInputWidth = () => {\n const width = getTextWidth(getInputValue(), `500 ${FontSize} ${FontFamily}`);\n input.style.width = width + 'px';\n };\n\n const setInputValue = (amount: string | number) => {\n amount = Math.min(+amount, +invoice.max_tip_amount);\n const wrapped = wrapAmount(amount, true);\n\n input.value = wrapped;\n // input.textContent = wrapped;\n if(document.activeElement === input) {\n placeCaretAtEnd(input);\n }\n\n unsetActiveTip && unsetActiveTip();\n const tipEl = this.tipButtonsMap.get(amount);\n if(tipEl) {\n tipEl.classList.add('active');\n }\n\n setInputWidth();\n setTotal();\n };\n\n const tipsLabel = makeLabel();\n _i18n(tipsLabel.left, isReceipt ? 'PaymentTip' : 'PaymentTipOptional');\n const input = document.createElement('input');\n input.type = 'tel';\n // const input: HTMLElement = document.createElement('div');\n // input.contentEditable = 'true';\n input.classList.add('input-clear', tipsClassName + '-input');\n tipsLabel.right.append(input);\n\n if(!isReceipt) {\n tipsLabel.label.style.cursor = 'text';\n } else {\n tipsLabel.label.classList.add('disable-hover');\n }\n\n tipsLabel.label.addEventListener('mousedown', (e) => {\n if(!findUpAsChild(e.target as HTMLElement, input)) {\n placeCaretAtEnd(input);\n }\n });\n\n const haveToIgnoreEvents = input instanceof HTMLInputElement ? 1 : 2;\n const onSelectionChange = () => {\n if(ignoreNextSelectionChange) {\n --ignoreNextSelectionChange;\n return;\n }\n\n // setTimeout(() => {\n ignoreNextSelectionChange = haveToIgnoreEvents;\n placeCaretAtEnd(input);\n // }, 0);\n };\n\n const onFocus = () => {\n // cancelEvent(e);\n setTimeout(() => {\n ignoreNextSelectionChange = haveToIgnoreEvents;\n placeCaretAtEnd(input);\n document.addEventListener('selectionchange', onSelectionChange);\n }, 0);\n };\n\n const onFocusOut = () => {\n input.addEventListener('focus', onFocus, {once: true});\n document.removeEventListener('selectionchange', onSelectionChange);\n };\n\n let ignoreNextSelectionChange: number;\n input.addEventListener('focusout', onFocusOut);\n onFocusOut();\n\n input.addEventListener('input', () => {\n setInputValue(getTipsAmount());\n });\n\n const s = [currencyData.symbol, currencyData.space_between ? ' ' : ''];\n if(!currencyData.symbol_left) s.reverse();\n tipsLabel.right[currencyData.symbol_left ? 'prepend' : 'append'](s.join(''));\n\n pricesElements.push(tipsLabel.label);\n\n //\n let unsetActiveTip: () => void;\n if(!isReceipt) {\n const tipsEl = document.createElement('div');\n tipsEl.classList.add(tipsClassName);\n\n const tipClassName = tipsClassName + '-tip';\n const tipButtons = invoice.suggested_tip_amounts.map((tipAmount) => {\n const button = Button(tipClassName, {noRipple: true});\n button.textContent = wrapAmount(tipAmount);\n\n this.tipButtonsMap.set(+tipAmount, button);\n return button;\n });\n\n unsetActiveTip = () => {\n const prevTipEl = tipsEl.querySelector('.active');\n if(prevTipEl) {\n prevTipEl.classList.remove('active');\n }\n };\n\n attachClickEvent(tipsEl, (e) => {\n const tipEl = findUpClassName(e.target, tipClassName);\n if(!tipEl) {\n return;\n }\n\n let tipAmount = 0;\n if(tipEl.classList.contains('active')) {\n tipEl.classList.remove('active');\n } else {\n unsetActiveTip();\n tipEl.classList.add('active');\n\n for(const [amount, el] of this.tipButtonsMap) {\n if(el === tipEl) {\n tipAmount = amount;\n break;\n }\n }\n }\n\n setInputValue(tipAmount);\n });\n\n setInputValue(0);\n\n tipsEl.append(...tipButtons);\n pricesElements.push(tipsEl);\n } else {\n setInputValue((paymentForm as PaymentsPaymentReceipt).tip_amount);\n }\n } else {\n setTotal();\n }\n\n pricesElements.push(totalLabel.label);\n\n prices.append(...pricesElements);\n itemEl.append(prices);\n\n // /\n\n const setRowIcon = async(row: Row, icon?: string) => {\n const img = document.createElement('img');\n img.classList.add('media-photo');\n await renderImageFromUrlPromise(img, getPaymentBrandIconPath(icon));\n let container = row.media;\n if(!container) {\n container = row.createMedia('small');\n container.classList.add('media-container-cover');\n container.append(img);\n } else {\n replaceContent(container, img);\n }\n\n row.container.classList.remove('row-with-icon');\n };\n\n const createRow = (options: ConstructorParameters[0]) => {\n if(options.titleLangKey) {\n options.subtitleLangKey = options.titleLangKey;\n }\n\n options.noWrap = true;\n const row = new Row(options);\n row.container.classList.add(className + '-row');\n\n if(options.titleLangKey) {\n row.subtitle.classList.add('hide');\n }\n\n return row;\n };\n\n const setRowTitle = (row: Row, textContent: string) => {\n row.title.textContent = textContent;\n if(!textContent) {\n const e = I18n.weakMap.get(row.subtitle.firstElementChild as HTMLElement) as I18n.IntlElement;\n row.title.append(i18n(e.key));\n }\n\n row.subtitle.classList.toggle('hide', !textContent);\n };\n\n const setCardSubtitle = (card: PaymentCardDetailsResult) => {\n let brand: string;\n let str: string;\n let icon: string;\n if('title' in card) {\n brand = card.title.split(' ').shift();\n str = card.title;\n icon = card.icon;\n } else {\n brand = detectUnifiedCardBrand(card.cardNumber);\n str = brand + ' *' + card.cardNumber.split(' ').pop();\n }\n\n methodRow.title.classList.remove('tgico', 'tgico-card_outline');\n setRowIcon(methodRow, icon || brand.toLowerCase());\n setRowTitle(methodRow, str);\n };\n\n const onMethodClick = () => {\n PopupElement.createPopup(PopupPaymentCard, paymentForm as PaymentsPaymentForm, previousCardDetails as PaymentCardDetails).addEventListener('finish', ({token, card}) => {\n previousToken = token, previousCardDetails = card;\n\n setCardSubtitle(card);\n });\n };\n\n let previousCardDetails: PaymentCardDetailsResult, previousToken: PaymentsCredentialsToken;\n const methodRow = createRow({\n titleLangKey: 'PaymentCheckoutMethod',\n clickable: isReceipt ? undefined : onMethodClick,\n icon: 'card_outline'\n });\n\n methodRow.container.classList.add(className + '-method-row');\n\n if(savedCredentials) {\n setCardSubtitle(savedCredentials);\n } else if((paymentForm as PaymentsPaymentReceipt).credentials_title) {\n setCardSubtitle({title: (paymentForm as PaymentsPaymentReceipt).credentials_title});\n }\n\n const providerRow = createRow({\n title: providerPeerTitle,\n subtitleLangKey: 'PaymentCheckoutProvider'\n });\n\n const providerAvatar = new AvatarElement();\n providerAvatar.classList.add('avatar-32');\n providerRow.createMedia('small').append(providerAvatar);\n /* await */ providerAvatar.updateWithOptions({peerId: paymentForm.provider_id.toPeerId()});\n\n let shippingAddressRow: Row, shippingNameRow: Row, shippingEmailRow: Row, shippingPhoneRow: Row, shippingMethodRow: Row;\n let lastShippingOption: ShippingOption, onShippingAddressClick: (focus?: ConstructorParameters[2]) => void, onShippingMethodClick: () => void;\n const setShippingTitle = invoice.pFlags.shipping_address_requested ? (shippingAddress?: PaymentShippingAddress) => {\n if(!shippingAddress) {\n shippingMethodRow.subtitle.classList.add('hide');\n replaceContent(shippingMethodRow.title, i18n('PaymentShippingAddress'));\n return;\n }\n\n const postAddress = shippingAddress.shipping_address;\n setRowTitle(shippingAddressRow, [postAddress.city, postAddress.street_line1, postAddress.street_line2].filter(Boolean).join(', '));\n\n shippingMethodRow.container.classList.toggle('hide', !lastRequestedInfo && !isReceipt);\n } : undefined;\n\n const setShippingInfo = (info: PaymentRequestedInfo) => {\n setShippingTitle && setShippingTitle(info);\n shippingNameRow && setRowTitle(shippingNameRow, info.name);\n shippingEmailRow && setRowTitle(shippingEmailRow, info.email);\n shippingPhoneRow && setRowTitle(shippingPhoneRow, info.phone && ('+' + formatPhoneNumber(info.phone).formatted));\n };\n\n if(!isReceipt) {\n onShippingAddressClick = (focus) => {\n PopupElement.createPopup(PopupPaymentShipping, paymentForm as PaymentsPaymentForm, inputInvoice, focus).addEventListener('finish', ({shippingAddress, requestedInfo}) => {\n lastRequestedInfo = requestedInfo;\n savedInfo = (paymentForm as PaymentsPaymentForm).saved_info = shippingAddress;\n setShippingInfo(shippingAddress);\n });\n };\n }\n\n if(invoice.pFlags.shipping_address_requested) {\n const setShippingOption = (shippingOption?: ShippingOption) => {\n const scrollSaver = new ScrollSaver(this.scrollable, undefined, true);\n scrollSaver.save();\n if(lastShippingPricesElements) {\n lastShippingPricesElements.forEach((node) => node.remove());\n }\n\n if(!shippingOption) {\n shippingAmount = 0;\n\n setTotal();\n scrollSaver.restore();\n this.onContentUpdate();\n return;\n }\n\n lastShippingOption = shippingOption;\n setRowTitle(shippingMethodRow, shippingOption.title);\n\n shippingAmount = accumulate(shippingOption.prices.map(({amount}) => +amount), 0);\n lastShippingPricesElements = makePricesElements(shippingOption.prices);\n let l = totalLabel.label;\n if(canTip) {\n l = l.previousElementSibling as any;\n if(!isReceipt) {\n l = l.previousElementSibling as any;\n }\n }\n\n lastShippingPricesElements.forEach((element) => l.parentElement.insertBefore(element, l));\n\n setTotal();\n scrollSaver.restore();\n this.onContentUpdate();\n };\n\n shippingAddressRow = createRow({\n icon: 'location',\n titleLangKey: 'PaymentShippingAddress',\n clickable: !isReceipt && onShippingAddressClick.bind(null, undefined)\n });\n\n let lastShippingPricesElements: HTMLElement[];\n shippingMethodRow = createRow({\n icon: 'shipping',\n titleLangKey: 'PaymentCheckoutShippingMethod',\n clickable: !isReceipt && (onShippingMethodClick = () => {\n PopupElement.createPopup(PopupPaymentShippingMethods, paymentForm as PaymentsPaymentForm, lastRequestedInfo, lastShippingOption).addEventListener('finish', (shippingOption) => {\n setShippingOption(shippingOption);\n });\n })\n });\n\n shippingMethodRow.container.classList.add('hide');\n\n const shippingOption = (paymentForm as PaymentsPaymentReceipt).shipping;\n if(shippingOption) {\n setShippingOption(shippingOption);\n }\n }\n\n if(invoice.pFlags.name_requested) {\n shippingNameRow = createRow({\n icon: 'newprivate',\n titleLangKey: 'PaymentCheckoutName',\n clickable: !isReceipt && onShippingAddressClick.bind(null, 'name')\n });\n }\n\n if(invoice.pFlags.email_requested) {\n shippingEmailRow = createRow({\n icon: 'mention',\n titleLangKey: 'PaymentShippingEmailPlaceholder',\n clickable: !isReceipt && onShippingAddressClick.bind(null, 'email')\n });\n }\n\n if(invoice.pFlags.phone_requested) {\n shippingPhoneRow = createRow({\n icon: 'phone',\n titleLangKey: 'PaymentCheckoutPhoneNumber',\n clickable: !isReceipt && onShippingAddressClick.bind(null, 'phone')\n });\n }\n\n if(savedInfo) {\n setShippingInfo(savedInfo);\n }\n\n const rows = [\n methodRow,\n providerRow,\n shippingAddressRow,\n shippingMethodRow,\n shippingNameRow,\n shippingEmailRow,\n shippingPhoneRow\n ].filter(Boolean);\n\n const acceptTermsCheckboxField = isRecurring && new CheckboxField({\n text: 'Payments.Recurrent.Accept',\n textArgs: [wrapRichText(invoice.recurring_terms_url), peerTitle2]\n });\n\n const acceptTermsRow = isRecurring && createRow({\n checkboxField: acceptTermsCheckboxField\n });\n\n const recurringElements = isRecurring ? [document.createElement('hr'), acceptTermsRow.container] : [];\n\n this.scrollable.append(...[\n document.createElement('hr'),\n ...rows.map((row) => row.container),\n ...recurringElements\n ].filter(Boolean));\n\n // /\n let popupPaymentVerification: PopupPaymentVerification, lastTmpPasword: AccountTmpPassword;\n const onClick = () => {\n const missingInfo = invoice.pFlags.name_requested && !savedInfo?.name ? 'name' : (invoice.pFlags.email_requested && !savedInfo?.email ? 'email' : (invoice.pFlags.phone_requested && !savedInfo?.phone ? 'phone' : undefined));\n if(invoice.pFlags.shipping_address_requested) {\n if(!lastRequestedInfo) {\n onShippingAddressClick();\n return;\n } else if(!lastShippingOption) {\n onShippingMethodClick();\n return;\n }\n } else if(missingInfo) {\n onShippingAddressClick(missingInfo);\n return;\n }\n\n if(!previousCardDetails && !lastTmpPasword) {\n if(!savedCredentials) {\n onMethodClick();\n return;\n }\n\n Promise.resolve(passwordState ?? this.managers.passwordManager.getState()).then((_passwordState) => {\n PopupElement.createPopup(PopupPaymentCardConfirmation, savedCredentials.title, _passwordState).addEventListener('finish', (tmpPassword) => {\n passwordState = undefined;\n lastTmpPasword = tmpPassword;\n simulateClickEvent(payButton);\n\n // * reserve 5 seconds\n const diff = tmpPassword.valid_until - tsNow(true) - 5;\n setTimeout(() => {\n if(lastTmpPasword === tmpPassword) {\n lastTmpPasword = undefined;\n }\n }, diff * 1000);\n });\n });\n\n return;\n }\n\n return Promise.resolve().then(async() => {\n const credentials: InputPaymentCredentials = lastTmpPasword ? {\n _: 'inputPaymentCredentialsSaved',\n id: savedCredentials.id,\n tmp_password: lastTmpPasword.tmp_password\n } : {\n _: 'inputPaymentCredentials',\n data: {\n _: 'dataJSON',\n data: JSON.stringify(previousToken.token ? previousToken : {type: previousToken.type, id: previousToken.id})\n },\n pFlags: {\n save: previousCardDetails.save || undefined\n }\n };\n\n try {\n const paymentResult = await this.managers.appPaymentsManager.sendPaymentForm(\n inputInvoice,\n (paymentForm as PaymentsPaymentForm).form_id,\n lastRequestedInfo?.id,\n lastShippingOption?.id,\n credentials,\n getTipsAmount()\n );\n\n if(paymentResult._ === 'payments.paymentResult') {\n onConfirmed();\n } else {\n popupPaymentVerification = PopupElement.createPopup(PopupPaymentVerification, paymentResult.url, !mediaInvoice.extended_media);\n popupPaymentVerification.addEventListener('finish', () => {\n popupPaymentVerification = undefined;\n\n onConfirmed();\n });\n await new Promise((resolve, reject) => {\n popupPaymentVerification.addEventListener('close', () => {\n popupPaymentVerification = undefined;\n if(confirmed) {\n resolve();\n } else {\n const err = new Error('payment not finished');\n (err as ApiError).handled = true;\n reject(err);\n }\n });\n });\n }\n } catch(err) {\n if((err as ApiError).type === 'BOT_PRECHECKOUT_TIMEOUT') {\n toastNew({langPackKey: 'Error.AnError'});\n (err as ApiError).handled = true;\n } else if((err as ApiError).type === 'TMP_PASSWORD_INVALID') {\n passwordState = lastTmpPasword = undefined;\n simulateClickEvent(payButton);\n (err as ApiError).handled = true;\n }\n\n throw err;\n }\n });\n };\n\n const onChange = () => {\n payButton.disabled = !!(acceptTermsCheckboxField && !acceptTermsCheckboxField.checked);\n };\n\n let payButton: HTMLButtonElement;\n if(isReceipt) {\n payButton = PaymentButton({\n onClick: () => this.hide(),\n key: 'Done'\n });\n } else {\n payButton = PaymentButton({\n onClick: onClick,\n textEl: payI18n\n });\n }\n\n onChange();\n if(acceptTermsCheckboxField) {\n acceptTermsCheckboxField.input.addEventListener('change', onChange);\n }\n\n this.body.append(this.btnConfirmOnEnter = payButton);\n\n this.onContentUpdate();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport AvatarElement from '../avatar';\nimport PopupElement, {addCancelButton, PopupButton, PopupOptions} from '.';\nimport {i18n, LangPackKey} from '../../lib/langPack';\nimport CheckboxField, {CheckboxFieldOptions} from '../checkboxField';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\n\nexport type PopupPeerButton = Omit & Partial<{callback: PopupPeerButtonCallback}>;\nexport type PopupPeerButtonCallbackCheckboxes = Set;\nexport type PopupPeerButtonCallback = (checkboxes?: PopupPeerButtonCallbackCheckboxes) => void;\nexport type PopupPeerCheckboxOptions = CheckboxFieldOptions & {checkboxField?: CheckboxField};\n\nexport type PopupPeerOptions = Omit & Partial<{\n peerId: PeerId,\n threadId: number,\n title: string | HTMLElement,\n titleLangKey: LangPackKey,\n titleLangArgs: any[],\n noTitle: boolean,\n description: string | DocumentFragment,\n descriptionLangKey: LangPackKey,\n descriptionLangArgs: any[],\n buttons: Array,\n checkboxes: Array\n}>;\nexport default class PopupPeer extends PopupElement {\n protected description: HTMLParagraphElement;\n\n constructor(private className: string, options: PopupPeerOptions = {}) {\n super('popup-peer' + (className ? ' ' + className : ''), {\n overlayClosable: true,\n ...options,\n title: true,\n buttons: options.buttons && addCancelButton(options.buttons)\n });\n\n if(options.peerId) {\n const avatarEl = new AvatarElement();\n avatarEl.classList.add('avatar-32');\n avatarEl.updateWithOptions({\n isDialog: true,\n peerId: options.peerId,\n threadId: options.threadId,\n wrapOptions: {\n middleware: this.middlewareHelper.get()\n }\n });\n this.header.prepend(avatarEl);\n }\n\n if(!options.noTitle) {\n if(options.titleLangKey || !options.title) this.title.append(i18n(options.titleLangKey || 'AppName', options.titleLangArgs));\n else if(options.title instanceof HTMLElement) {\n this.title.append(options.title);\n } else this.title.innerText = options.title || '';\n }\n\n const fragment = document.createDocumentFragment();\n\n if(options.descriptionLangKey || options.description) {\n const p = this.description = document.createElement('p');\n p.classList.add('popup-description');\n if(options.descriptionLangKey) p.append(i18n(options.descriptionLangKey, options.descriptionLangArgs));\n else if(options.description) setInnerHTML(p, options.description);\n\n fragment.append(p);\n }\n\n if(options.checkboxes) {\n this.container.classList.add('have-checkbox');\n\n options.checkboxes.forEach((o) => {\n o.withRipple = true;\n const checkboxField = new CheckboxField(o);\n o.checkboxField = checkboxField;\n fragment.append(checkboxField.label);\n });\n\n options.buttons.forEach((button) => {\n if(button.callback) {\n const original = button.callback;\n button.callback = () => {\n const c: Set = new Set();\n options.checkboxes.forEach((o) => {\n if(o.checkboxField.checked) {\n c.add(o.text);\n }\n });\n original(c);\n };\n }\n });\n }\n\n this.container.insertBefore(fragment, this.header.nextElementSibling);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport AppSelectPeers from '../appSelectPeers';\nimport PopupElement from '.';\nimport {LangPackKey, _i18n} from '../../lib/langPack';\n\nexport default class PopupPickUser extends PopupElement {\n protected selector: AppSelectPeers;\n\n constructor(options: {\n peerTypes: AppSelectPeers['peerType'],\n onSelect?: (peerId: PeerId) => Promise | void,\n placeholder: LangPackKey,\n chatRightsActions?: AppSelectPeers['chatRightsActions'],\n peerId?: number,\n selfPresence?: LangPackKey\n }) {\n super('popup-forward', {closable: true, overlayClosable: true, body: true, title: true});\n\n this.selector = new AppSelectPeers({\n appendTo: this.body,\n onChange: async() => {\n const selected = this.selector.getSelected();\n const peerId = selected[selected.length - 1].toPeerId();\n\n if(options.onSelect) {\n const res = options.onSelect(peerId);\n if(res instanceof Promise) {\n try {\n await res;\n } catch(err) {\n return;\n }\n }\n }\n\n this.selector = null;\n this.hide();\n },\n peerType: options.peerTypes,\n onFirstRender: () => {\n this.show();\n this.selector.checkForTriggers(); // ! due to zero height before mounting\n\n if(!IS_TOUCH_SUPPORTED) {\n this.selector.input.focus();\n }\n },\n chatRightsActions: options.chatRightsActions,\n multiSelect: false,\n rippleEnabled: false,\n avatarSize: 'abitbigger',\n peerId: options.peerId,\n placeholder: options.placeholder,\n selfPresence: options.selfPresence,\n managers: this.managers\n });\n\n this.scrollable = this.selector.scrollable;\n this.attachScrollableListeners();\n\n // this.scrollable = new Scrollable(this.body);\n\n this.title.append(this.selector.input);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupPeer from './peer';\n\nexport default class PopupSendNow extends PopupPeer {\n constructor(peerId: PeerId, mids: number[], onConfirm?: () => void) {\n super('popup-delete-chat', {\n title: `Send Message${mids.length > 1 ? 's' : ''} Now`,\n description: mids.length > 1 ? 'Send ' + mids.length + ' messages now?' : 'Send message now?',\n buttons: [{\n langKey: 'Send',\n callback: () => {\n onConfirm && onConfirm();\n this.managers.appMessagesManager.sendScheduledMessages(peerId, mids);\n }\n }]\n });\n\n this.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AppStickersManager} from '../../lib/appManagers/appStickersManager';\nimport PopupElement from '.';\nimport wrapSticker from '../wrappers/sticker';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport {putPreloader} from '../putPreloader';\nimport animationIntersector, {AnimationItemGroup} from '../animationIntersector';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport {i18n} from '../../lib/langPack';\nimport Button from '../button';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport toggleDisability from '../../helpers/dom/toggleDisability';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport {toastNew} from '../toast';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport createStickersContextMenu from '../../helpers/dom/createStickersContextMenu';\nimport attachStickerViewerListeners from '../stickerViewer';\nimport {Document, StickerSet} from '../../layer';\nimport Row from '../row';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport rootScope from '../../lib/rootScope';\nimport wrapCustomEmoji from '../wrappers/customEmoji';\nimport emoticonsDropdown from '../emoticonsDropdown';\n\nconst ANIMATION_GROUP: AnimationItemGroup = 'STICKERS-POPUP';\n\nexport default class PopupStickers extends PopupElement {\n private stickersFooter: HTMLElement;\n private appendTo: HTMLElement;\n private updateAdded: {[setId: Long]: (added: boolean) => void};\n private sets: StickerSet.stickerSet[];\n private button: HTMLElement;\n\n constructor(\n private stickerSetInput: Parameters[0] | Parameters[0][],\n private isEmojis?: boolean\n ) {\n super('popup-stickers', {closable: true, overlayClosable: true, body: true, scrollable: true, title: true});\n\n this.title.append(i18n('Loading'));\n this.updateAdded = {};\n\n emoticonsDropdown.setIgnoreMouseOut('popup', true);\n this.addEventListener('close', () => {\n emoticonsDropdown.setIgnoreMouseOut('popup', false);\n animationIntersector.setOnlyOnePlayableGroup();\n });\n\n this.appendTo = this.scrollable.container;\n\n this.appendTo.classList.add('is-loading');\n putPreloader(this.appendTo, true);\n\n this.stickersFooter = document.createElement('div');\n this.stickersFooter.classList.add('sticker-set-footer');\n\n const btn = Button('btn-primary btn-primary-transparent disable-hover', {noRipple: true, text: 'Loading'});\n this.stickersFooter.append(btn);\n\n this.body.append(this.stickersFooter);\n\n attachStickerViewerListeners({listenTo: this.appendTo, listenerSetter: this.listenerSetter});\n\n const onStickerSetUpdate = (set: StickerSet.stickerSet) => {\n const idx = this.sets.findIndex((_set) => _set.id === set.id);\n if(idx === -1) {\n return;\n }\n\n this.sets[idx] = set;\n const updateAdded = this.updateAdded[set.id];\n updateAdded?.(!!set.installed_date);\n this.updateButton();\n };\n\n this.listenerSetter.add(rootScope)('stickers_installed', onStickerSetUpdate);\n this.listenerSetter.add(rootScope)('stickers_deleted', onStickerSetUpdate);\n\n this.loadStickerSet();\n }\n\n private createStickerSetElements(set?: StickerSet.stickerSet) {\n const container = document.createElement('div');\n container.classList.add('sticker-set');\n\n let headerRow: Row, updateAdded: (added: boolean) => void;\n if(set) {\n headerRow = new Row({\n title: wrapEmojiText(set.title),\n subtitle: i18n(set.pFlags.emojis ? 'EmojiCount' : 'Stickers', [set.count]),\n buttonRight: true\n });\n\n updateAdded = (added) => {\n replaceContent(headerRow.buttonRight, i18n(added ? 'Stickers.SearchAdded' : 'Stickers.SearchAdd'));\n headerRow.buttonRight.classList.toggle('active', added);\n };\n\n updateAdded(!!set.installed_date);\n\n container.append(headerRow.container);\n }\n\n const itemsContainer = document.createElement('div');\n itemsContainer.classList.add('sticker-set-stickers');\n\n container.append(itemsContainer);\n\n return {container, headerRow, updateAdded, itemsContainer};\n }\n\n private onStickersClick = async(e: MouseEvent) => {\n const target = findUpClassName(e.target, 'sticker-set-sticker');\n if(!target) return;\n\n const docId = target.dataset.docId;\n if(await appImManager.chat.input.sendMessageWithDocument(docId)) {\n this.hide();\n }\n };\n\n private async loadStickerSet() {\n const middleware = this.middlewareHelper.get();\n const inputs = Array.isArray(this.stickerSetInput) ? this.stickerSetInput : [this.stickerSetInput];\n const setsPromises = inputs.map((input) => this.managers.appStickersManager.getStickerSet(input));\n let sets = await Promise.all(setsPromises);\n if(!middleware()) return;\n let firstSet = sets[0];\n if(sets.length === 1 && !firstSet) {\n toastNew({langPackKey: this.isEmojis ? 'AddEmojiNotFound' : 'StickerSet.DontExist'});\n this.hide();\n return;\n }\n\n sets = sets.filter(Boolean);\n firstSet = sets[0];\n\n this.sets = sets.map((set) => set.set);\n\n const isEmojis = this.isEmojis ??= !!firstSet.set.pFlags.emojis;\n\n if(!isEmojis) {\n attachClickEvent(this.appendTo, this.onStickersClick, {listenerSetter: this.listenerSetter});\n\n const {destroy} = createStickersContextMenu({\n listenTo: this.appendTo,\n isStickerPack: true,\n onSend: () => this.hide()\n });\n\n this.addEventListener('close', destroy);\n }\n\n animationIntersector.setOnlyOnePlayableGroup(ANIMATION_GROUP);\n\n const lazyLoadQueue = new LazyLoadQueue();\n const loadPromises: Promise[] = [];\n\n const containersPromises = sets.map(async(set) => {\n const {container, itemsContainer, headerRow, updateAdded} = this.createStickerSetElements(sets.length > 1 ? set.set : undefined);\n\n if(headerRow) {\n attachClickEvent(headerRow.buttonRight, () => {\n this.managers.appStickersManager.toggleStickerSet(set.set);\n }, {listenerSetter: this.listenerSetter});\n }\n\n this.updateAdded[set.set.id] = updateAdded;\n\n let divs: (HTMLElement | DocumentFragment)[];\n\n const docs = set.documents.filter((doc) => doc?._ === 'document') as Document.document[];\n if(isEmojis) {\n const fragment = wrapCustomEmoji({\n docIds: docs.map((doc) => doc.id),\n loadPromises,\n animationGroup: ANIMATION_GROUP,\n customEmojiSize: mediaSizes.active.esgCustomEmoji,\n middleware\n // lazyLoadQueue\n });\n\n (Array.from(fragment.children) as HTMLElement[]).slice(1).forEach((element) => {\n const span = document.createElement('span');\n span.classList.add('super-emoji');\n element.replaceWith(span);\n span.append(element);\n });\n\n divs = [fragment];\n\n itemsContainer.classList.replace('sticker-set-stickers', 'super-emojis');\n itemsContainer.classList.add('is-emojis', 'not-local');\n } else {\n divs = await Promise.all(docs.map(async(doc) => {\n const div = document.createElement('div');\n div.classList.add('sticker-set-sticker');\n\n const size = mediaSizes.active.popupSticker.width;\n\n await wrapSticker({\n doc,\n div,\n lazyLoadQueue,\n group: ANIMATION_GROUP,\n play: true,\n loop: true,\n width: size,\n height: size,\n withLock: true,\n loadPromises,\n middleware\n });\n\n return div;\n }));\n }\n\n itemsContainer.append(...divs.filter(Boolean));\n\n return container;\n });\n\n const containers = await Promise.all(containersPromises);\n await Promise.all(loadPromises);\n\n const button = this.button = Button('', {noRipple: true});\n\n this.updateButton();\n\n attachClickEvent(button, () => {\n const toggle = toggleDisability([button], true);\n\n this.managers.appStickersManager.toggleStickerSets(sets.map((set) => set.set)).then(() => {\n this.hide();\n }).catch(() => {\n toggle();\n });\n }, {listenerSetter: this.listenerSetter});\n\n if(sets.length === 1) {\n setInnerHTML(this.title, wrapEmojiText(firstSet.set.title));\n } else {\n setInnerHTML(this.title, i18n('Emoji'));\n }\n\n this.stickersFooter.textContent = '';\n this.stickersFooter.append(button);\n\n this.appendTo.classList.remove('is-loading');\n this.appendTo.textContent = '';\n this.appendTo.append(...containers);\n\n this.scrollable.onAdditionalScroll();\n }\n\n private updateButton() {\n const {sets, isEmojis} = this;\n let isAdd: boolean, buttonAppend: HTMLElement;\n if(sets.length === 1) {\n const firstSet = sets[0];\n buttonAppend = i18n(isEmojis ? 'EmojiCount' : 'Stickers', [firstSet.count]);\n isAdd = !firstSet.installed_date;\n } else {\n const installed = sets.filter((set) => set.installed_date);\n let count: number;\n if(sets.length === installed.length) {\n isAdd = false;\n count = sets.length;\n } else {\n isAdd = true;\n count = sets.length - installed.length;\n }\n\n buttonAppend = i18n('EmojiPackCount', [count]);\n }\n\n this.button.className = isAdd ? 'btn-primary btn-color-primary' : 'btn-primary btn-primary-transparent danger';\n replaceContent(this.button, i18n(isAdd ? 'AddStickersCount' : 'RemoveStickersCount', [buttonAppend]));\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement, {addCancelButton} from '.';\nimport PopupPeer, {PopupPeerButtonCallbackCheckboxes, PopupPeerOptions} from './peer';\nimport rootScope from '../../lib/rootScope';\nimport {FormatterArguments, LangPackKey} from '../../lib/langPack';\nimport wrapPeerTitle from '../wrappers/peerTitle';\n\nexport default class PopupPinMessage {\n constructor(private peerId: PeerId, private mid: number, private unpin?: true, private onConfirm?: () => void) {\n this.construct();\n }\n\n private async construct() {\n const {peerId, mid, unpin, onConfirm} = this;\n let title: LangPackKey, description: LangPackKey, descriptionArgs: FormatterArguments;\n const buttons: PopupPeerOptions['buttons'] = [], checkboxes: PopupPeerOptions['checkboxes'] = [];\n\n const managers = PopupElement.MANAGERS;\n\n const canUnpin = await managers.appPeersManager.canPinMessage(peerId);\n\n const callback = (checked: PopupPeerButtonCallbackCheckboxes, oneSide?: boolean, silent?: boolean) => {\n setTimeout(() => { // * костыль, потому что document.elementFromPoint вернёт popup-peer пока он будет закрываться\n let promise: Promise;\n if(unpin && !mid) {\n if(canUnpin) {\n promise = managers.appMessagesManager.unpinAllMessages(peerId);\n } else {\n promise = managers.appMessagesManager.hidePinnedMessages(peerId);\n }\n } else {\n promise = managers.appMessagesManager.updatePinnedMessage(peerId, mid, unpin, silent, oneSide);\n }\n\n if(onConfirm) {\n promise.then(onConfirm);\n }\n }, 300);\n };\n\n if(unpin) {\n let buttonText: LangPackKey = 'UnpinMessage';\n if(!mid) {\n if(canUnpin) {\n title = 'Popup.Unpin.AllTitle';\n description = 'Chat.UnpinAllMessagesConfirmation';\n descriptionArgs = ['' + ((await managers.appMessagesManager.getPinnedMessagesCount(peerId)) || 1)];\n } else {\n title = 'Popup.Unpin.HideTitle';\n description = 'Popup.Unpin.HideDescription';\n buttonText = 'Popup.Unpin.Hide';\n }\n } else {\n title = 'UnpinMessageAlertTitle';\n description = 'Chat.Confirm.Unpin';\n }\n\n buttons.push({\n langKey: buttonText,\n isDanger: true,\n callback\n });\n } else {\n title = 'PinMessageAlertTitle';\n const pinButtonText: LangPackKey = 'PinMessage';\n\n if(peerId.isAnyChat()) {\n buttons.push({\n langKey: pinButtonText,\n callback: (checked) => callback(checked, false, !checked.size)\n });\n\n if(await managers.appChatsManager.isBroadcast(peerId.toChatId())) {\n description = 'PinMessageAlertChannel';\n } else {\n description = 'PinMessageAlert';\n\n checkboxes.push({\n text: 'PinNotify',\n checked: true\n });\n }\n } else {\n description = 'PinMessageAlertChat';\n\n if(peerId === rootScope.myId) {\n buttons.push({\n langKey: pinButtonText,\n callback\n });\n } else {\n buttons.push({\n langKey: pinButtonText,\n callback: (checked) => callback(checked, !checked.size)\n });\n\n checkboxes.push({\n text: 'PinAlsoFor',\n textArgs: [await wrapPeerTitle({peerId})],\n checked: true\n });\n }\n }\n }\n\n addCancelButton(buttons);\n\n const popup = PopupElement.createPopup(PopupPeer, 'popup-delete-chat', {\n peerId,\n titleLangKey: title,\n descriptionLangKey: description,\n descriptionLangArgs: descriptionArgs,\n buttons,\n checkboxes\n });\n\n popup.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {CancellablePromise} from '../helpers/cancellablePromise';\nimport SetTransition from './singleTransition';\nimport {fastRaf} from '../helpers/schedulers';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport isInDOM from '../helpers/dom/isInDOM';\nimport safeAssign from '../helpers/object/safeAssign';\n\nconst TRANSITION_TIME = 200;\n\nexport default class ProgressivePreloader {\n public preloader: HTMLDivElement;\n public circle: SVGCircleElement;\n private cancelSvg: SVGSVGElement;\n private downloadSvg: HTMLElement;\n\n private tempId = 0;\n public detached = true;\n\n public promise: CancellablePromise = null;\n\n public isUpload = false;\n private cancelable = true;\n private streamable = false;\n private tryAgainOnFail = true;\n private attachMethod: 'append' | 'prepend' = 'append';\n\n public loadFunc: (e?: Event) => any;\n\n public totalLength: number;\n\n constructor(options?: Partial<{\n isUpload: ProgressivePreloader['isUpload'],\n cancelable: ProgressivePreloader['cancelable'],\n streamable: ProgressivePreloader['streamable'],\n tryAgainOnFail: ProgressivePreloader['tryAgainOnFail'],\n attachMethod: ProgressivePreloader['attachMethod']\n }>) {\n if(options) {\n safeAssign(this, options);\n }\n\n if(this.isUpload) {\n this.tryAgainOnFail = false;\n }\n }\n\n public constructContainer(options: Partial<{\n color: 'transparent',\n bold: boolean\n }> = {}) {\n if(!this.preloader) {\n this.preloader = document.createElement('div');\n this.preloader.classList.add('preloader-container');\n\n if(options.color) {\n this.preloader.classList.add('preloader-' + options.color);\n }\n\n if(options.bold) {\n this.preloader.classList.add('preloader-bold');\n }\n\n if(this.streamable) {\n this.preloader.classList.add('preloader-streamable');\n }\n }\n }\n\n public constructDownloadIcon() {\n this.constructContainer();\n }\n\n public construct() {\n this.construct = null;\n\n this.constructContainer();\n\n this.preloader.innerHTML = `\n
\n \n \n \n
`;\n\n if(this.streamable) {\n this.totalLength = 118.61124420166016;\n } else {\n this.totalLength = 149.82473754882812;\n }\n\n if(this.cancelable) {\n this.preloader.innerHTML += `\n \n \n \n \n \n \n \n \n \n \n \n `;\n\n this.downloadSvg = this.preloader.lastElementChild as HTMLElement;\n this.cancelSvg = this.downloadSvg.previousElementSibling as any;\n } else {\n this.preloader.classList.add('preloader-swing');\n }\n\n this.circle = this.preloader.firstElementChild.firstElementChild.firstElementChild as SVGCircleElement;\n\n if(this.cancelable) {\n attachClickEvent(this.preloader, this.onClick);\n }\n }\n\n public onClick = (e?: Event) => {\n if(e) {\n cancelEvent(e);\n }\n\n if(this.preloader.classList.contains('manual')) {\n this.loadFunc?.(e);\n } else {\n this.promise?.cancel?.();\n }\n };\n\n public setDownloadFunction(func: ProgressivePreloader['loadFunc']) {\n this.loadFunc = func;\n }\n\n public setManual() {\n this.preloader.classList.add('manual');\n this.setProgress(0);\n }\n\n public attachPromise(promise: CancellablePromise) {\n if(this.isUpload && this.promise) return;\n\n this.promise = promise;\n\n const tempId = --this.tempId;\n const startTime = Date.now();\n\n const onEnd = (err: Error) => {\n promise.notify = promise.notifyAll = null;\n\n if(tempId !== this.tempId) {\n return;\n }\n\n const elapsedTime = Date.now() - startTime;\n\n // console.log('[PP]: end', this.detached, performance.now());\n\n if(!err && this.cancelable) {\n this.setProgress(100);\n\n const delay = TRANSITION_TIME * 0.75;\n\n if(elapsedTime < delay) {\n this.detach();\n } else {\n setTimeout(() => { // * wait for transition complete\n if(tempId === this.tempId) {\n this.detach();\n }\n }, delay);\n }\n } else {\n if(this.tryAgainOnFail) {\n this.attach(this.preloader.parentElement);\n fastRaf(() => {\n this.setManual();\n });\n } else {\n this.detach();\n }\n }\n\n this.promise = promise = null;\n };\n\n promise\n .then(() => onEnd(null))\n .catch((err) => onEnd(err));\n\n if(promise.addNotifyListener) {\n promise.addNotifyListener((details: {done: number, total: number}) => {\n /* if(details.done >= details.total) {\n onEnd();\n } */\n\n if(tempId !== this.tempId) return;\n\n // console.log('preloader download', promise, details);\n const percents = details.done / details.total * 100;\n this.setProgress(percents);\n });\n }\n }\n\n public attach(elem: Element, reset = false, promise?: CancellablePromise) {\n this.construct?.();\n\n if(this.preloader.parentElement) {\n this.preloader.classList.remove('manual');\n }\n\n this.detached = false;\n\n if(promise/* && false */) {\n this.attachPromise(promise);\n }\n\n let useRafs = 0;\n if(this.detached || this.preloader.parentElement !== elem) {\n useRafs = isInDOM(this.preloader) ? 1 : 2;\n if(this.preloader.parentElement !== elem) {\n elem[this.attachMethod](this.preloader);\n }\n }\n\n SetTransition({\n element: this.preloader,\n className: 'is-visible',\n forwards: true,\n duration: TRANSITION_TIME,\n useRafs\n });\n\n if(this.cancelable && reset) {\n this.setProgress(0);\n }\n }\n\n public detach() {\n if(this.detached) {\n return;\n }\n // return;\n\n this.detached = true;\n\n // return;\n\n if(this.preloader?.parentElement) {\n /* setTimeout(() => */// fastRaf(() => {\n /* if(!this.detached) return;\n this.detached = true; */\n\n // fastRaf(() => {\n // console.log('[PP]: detach after rAF', this.detached, performance.now());\n\n // if(!this.detached || !this.preloader.parentElement) {\n // return;\n // }\n\n SetTransition({\n element: this.preloader,\n className: 'is-visible',\n forwards: false,\n duration: TRANSITION_TIME,\n onTransitionEnd: () => {\n this.preloader.remove();\n },\n useRafs: 1\n });\n // });\n // })/* , 5e3) */;\n }\n }\n\n public setProgress(percents: number) {\n if(!this.totalLength && !isInDOM(this.circle)) {\n return;\n }\n\n if(percents === 0) {\n this.circle.style.strokeDasharray = '';\n return;\n }\n\n try {\n this.totalLength ||= this.circle.getTotalLength();\n\n // console.log('setProgress', (percents / 100 * totalLength));\n this.circle.style.strokeDasharray = '' + Math.max(5, percents / 100 * this.totalLength) + ', ' + this.totalLength;\n } catch(err) {}\n }\n}\n","/*\nThis file is part of Telegram Desktop,\nthe official desktop application for the Telegram messaging service.\nFor license and copyright information please follow this link:\nhttps://github.com/telegramdesktop/tdesktop/blob/master/LEGAL\n*/\n\nimport accumulate from '../helpers/array/accumulate';\nimport clamp from '../helpers/number/clamp';\n\ntype Size = {w: number, h: number};\nexport type GroupMediaLayout = {\n geometry: {\n x: number,\n y: number,\n width: number,\n height: number\n },\n sides: number\n};\ntype Attempt = {\n lineCounts: number[],\n heights: number[]\n};\nexport const RectPart = {\n None: 0,\n Top: 1,\n Right: 2,\n Bottom: 4,\n Left: 8\n};\n\n// https://github.com/telegramdesktop/tdesktop/blob/4669c07dc5335cbf4795bbbe5b0ab7c007b9aee2/Telegram/SourceFiles/ui/grouped_layout.cpp\nexport class Layouter {\n private count: number;\n private ratios: number[];\n private proportions: string;\n private averageRatio: number;\n private maxSizeRatio: number;\n\n constructor(private sizes: Size[], private maxWidth: number, private minWidth: number, private spacing: number, private maxHeight = maxWidth) {\n this.count = sizes.length;\n this.ratios = Layouter.countRatios(sizes);\n this.proportions = Layouter.countProportions(this.ratios);\n this.averageRatio = accumulate(this.ratios, 1) / this.count; // warn\n this.maxSizeRatio = maxWidth / this.maxHeight;\n }\n\n public layout(): GroupMediaLayout[] {\n if(!this.count) return [];\n // else if(this.count === 1) return this.layoutOne();\n\n if(this.count >= 5 || this.ratios.find((r) => r > 2)) {\n return new ComplexLayouter(this.ratios, this.averageRatio, this.maxWidth, this.minWidth, this.spacing).layout();\n }\n\n if(this.count === 2) return this.layoutTwo();\n else if(this.count === 3) return this.layoutThree();\n return this.layoutFour();\n }\n\n private layoutTwo(): ReturnType {\n if((this.proportions === 'ww') &&\n (this.averageRatio > 1.4 * this.maxSizeRatio) &&\n (this.ratios[1] - this.ratios[0] < 0.2)) {\n return this.layoutTwoTopBottom();\n } else if(this.proportions === 'ww' || this.proportions === 'qq') {\n return this.layoutTwoLeftRightEqual();\n }\n return this.layoutTwoLeftRight();\n }\n\n private layoutThree(): ReturnType {\n // console.log('layoutThree:', this);\n if(this.proportions[0] === 'n') {\n return this.layoutThreeLeftAndOther();\n }\n return this.layoutThreeTopAndOther();\n }\n\n private layoutFour(): ReturnType {\n if(this.proportions[0] === 'w') {\n return this.layoutFourTopAndOther();\n }\n return this.layoutFourLeftAndOther();\n }\n\n private layoutTwoTopBottom(): ReturnType {\n const width = this.maxWidth;\n const height = Math.round(Math.min(\n width / this.ratios[0],\n Math.min(\n width / this.ratios[1],\n (this.maxHeight - this.spacing) / 2)));\n\n return [\n {\n geometry: {x: 0, y: 0, width, height},\n sides: RectPart.Left | RectPart.Top | RectPart.Right\n },\n {\n geometry: {x: 0, y: height + this.spacing, width, height},\n sides: RectPart.Left | RectPart.Bottom | RectPart.Right\n }\n ];\n }\n\n private layoutTwoLeftRightEqual(): ReturnType {\n const width = (this.maxWidth - this.spacing) / 2;\n const height = Math.round(Math.min(\n width / this.ratios[0],\n Math.min(width / this.ratios[1], this.maxHeight * 1)));\n\n return [\n {\n geometry: {x: 0, y: 0, width, height},\n sides: RectPart.Top | RectPart.Left | RectPart.Bottom\n },\n {\n geometry: {x: width + this.spacing, y: 0, width, height},\n sides: RectPart.Top | RectPart.Right | RectPart.Bottom\n }\n ];\n }\n\n private layoutTwoLeftRight(): ReturnType {\n const minimalWidth = Math.round(this.minWidth * 1.5);\n const secondWidth = Math.min(\n Math.round(Math.max(\n 0.4 * (this.maxWidth - this.spacing),\n (this.maxWidth - this.spacing) / this.ratios[0] /\n (1 / this.ratios[0] + 1 / this.ratios[1]))),\n this.maxWidth - this.spacing - minimalWidth);\n const firstWidth = this.maxWidth -\n secondWidth -\n this.spacing;\n const height = Math.min(\n this.maxHeight,\n Math.round(Math.min(\n firstWidth / this.ratios[0],\n secondWidth / this.ratios[1])));\n\n return [\n {\n geometry: {x: 0, y: 0, width: firstWidth, height},\n sides: RectPart.Top | RectPart.Left | RectPart.Bottom\n },\n {\n geometry: {x: firstWidth + this.spacing, y: 0, width: secondWidth, height},\n sides: RectPart.Top | RectPart.Right | RectPart.Bottom\n }\n ];\n }\n\n private layoutThreeLeftAndOther(): ReturnType {\n const firstHeight = this.maxHeight;\n const thirdHeight = Math.round(Math.min(\n (this.maxHeight - this.spacing) / 2.,\n (this.ratios[1] * (this.maxWidth - this.spacing) /\n (this.ratios[2] + this.ratios[1]))));\n const secondHeight = firstHeight -\n thirdHeight -\n this.spacing;\n const rightWidth = Math.max(\n this.minWidth,\n Math.round(Math.min(\n (this.maxWidth - this.spacing) / 2.,\n Math.min(\n thirdHeight * this.ratios[2],\n secondHeight * this.ratios[1]))));\n const leftWidth = Math.min(\n Math.round(firstHeight * this.ratios[0]),\n this.maxWidth - this.spacing - rightWidth);\n\n return [\n {\n geometry: {x: 0, y: 0, width: leftWidth, height: firstHeight},\n sides: RectPart.Top | RectPart.Left | RectPart.Bottom\n },\n {\n geometry: {x: leftWidth + this.spacing, y: 0, width: rightWidth, height: secondHeight},\n sides: RectPart.Top | RectPart.Right\n },\n {\n geometry: {x: leftWidth + this.spacing, y: secondHeight + this.spacing, width: rightWidth, height: thirdHeight},\n sides: RectPart.Bottom | RectPart.Right\n }\n ];\n }\n\n private layoutThreeTopAndOther(): ReturnType {\n const firstWidth = this.maxWidth;\n const firstHeight = Math.round(Math.min(\n firstWidth / this.ratios[0],\n (this.maxHeight - this.spacing) * 0.66));\n const secondWidth = (this.maxWidth - this.spacing) / 2;\n const secondHeight = Math.min(\n this.maxHeight - firstHeight - this.spacing,\n Math.round(Math.min(\n secondWidth / this.ratios[1],\n secondWidth / this.ratios[2])));\n const thirdWidth = firstWidth - secondWidth - this.spacing;\n\n return [\n {\n geometry: {x: 0, y: 0, width: firstWidth, height: firstHeight},\n sides: RectPart.Left | RectPart.Top | RectPart.Right\n },\n {\n geometry: {x: 0, y: firstHeight + this.spacing, width: secondWidth, height: secondHeight},\n sides: RectPart.Bottom | RectPart.Left\n },\n {\n geometry: {x: secondWidth + this.spacing, y: firstHeight + this.spacing, width: thirdWidth, height: secondHeight},\n sides: RectPart.Bottom | RectPart.Right\n }\n ];\n }\n\n private layoutFourTopAndOther(): ReturnType {\n const w = this.maxWidth;\n const h0 = Math.round(Math.min(\n w / this.ratios[0],\n (this.maxHeight - this.spacing) * 0.66));\n const h = Math.round(\n (this.maxWidth - 2 * this.spacing) /\n (this.ratios[1] + this.ratios[2] + this.ratios[3]));\n const w0 = Math.max(\n this.minWidth,\n Math.round(Math.min(\n (this.maxWidth - 2 * this.spacing) * 0.4,\n h * this.ratios[1])));\n const w2 = Math.round(Math.max(\n Math.max(\n this.minWidth * 1.,\n (this.maxWidth - 2 * this.spacing) * 0.33),\n h * this.ratios[3]));\n const w1 = w - w0 - w2 - 2 * this.spacing;\n const h1 = Math.min(\n this.maxHeight - h0 - this.spacing,\n h);\n\n return [\n {\n geometry: {x: 0, y: 0, width: w, height: h0},\n sides: RectPart.Left | RectPart.Top | RectPart.Right\n },\n {\n geometry: {x: 0, y: h0 + this.spacing, width: w0, height: h1},\n sides: RectPart.Bottom | RectPart.Left\n },\n {\n geometry: {x: w0 + this.spacing, y: h0 + this.spacing, width: w1, height: h1},\n sides: RectPart.Bottom\n },\n {\n geometry: {x: w0 + this.spacing + w1 + this.spacing, y: h0 + this.spacing, width: w2, height: h1},\n sides: RectPart.Right | RectPart.Bottom\n }\n ];\n }\n\n private layoutFourLeftAndOther(): ReturnType {\n const h = this.maxHeight;\n const w0 = Math.round(Math.min(\n h * this.ratios[0],\n (this.maxWidth - this.spacing) * 0.6));\n\n const w = Math.round(\n (this.maxHeight - 2 * this.spacing) /\n (1. / this.ratios[1] + 1. / this.ratios[2] + 1. / this.ratios[3])\n );\n const h0 = Math.round(w / this.ratios[1]);\n const h1 = Math.round(w / this.ratios[2]);\n const h2 = h - h0 - h1 - 2 * this.spacing;\n const w1 = Math.max(\n this.minWidth,\n Math.min(this.maxWidth - w0 - this.spacing, w));\n\n return [\n {\n geometry: {x: 0, y: 0, width: w0, height: h},\n sides: RectPart.Top | RectPart.Left | RectPart.Bottom\n },\n {\n geometry: {x: w0 + this.spacing, y: 0, width: w1, height: h0},\n sides: RectPart.Top | RectPart.Right\n },\n {\n geometry: {x: w0 + this.spacing, y: h0 + this.spacing, width: w1, height: h1},\n sides: RectPart.Right\n },\n {\n geometry: {x: w0 + this.spacing, y: h0 + h1 + 2 * this.spacing, width: w1, height: h2},\n sides: RectPart.Bottom | RectPart.Right\n }\n ];\n }\n\n private static countRatios(sizes: Size[]) {\n return sizes.map((size) => size.w / size.h);\n }\n\n private static countProportions(ratios: number[]) {\n return ratios.map((ratio) => (ratio > 1.2) ? 'w' : (ratio < 0.8) ? 'n' : 'q').join('');\n }\n}\n\nclass ComplexLayouter {\n private ratios: number[];\n private count: number;\n\n constructor(ratios: number[], private averageRatio: number, private maxWidth: number, private minWidth: number, private spacing: number, private maxHeight = maxWidth * 4 / 3) {\n this.ratios = ComplexLayouter.cropRatios(ratios, averageRatio);\n this.count = ratios.length;\n }\n\n private static cropRatios(ratios: number[], averageRatio: number) {\n const kMaxRatio = 2.75;\n const kMinRatio = 0.6667;\n return ratios.map((ratio) => {\n return averageRatio > 1.1 ?\n clamp(ratio, 1., kMaxRatio) :\n clamp(ratio, kMinRatio, 1.);\n });\n }\n\n public layout(): GroupMediaLayout[] {\n const result = new Array(this.count);\n\n const attempts: Attempt[] = [];\n const multiHeight = (offset: number, count: number) => {\n const ratios = this.ratios.slice(offset, offset + count); // warn\n const sum = accumulate(ratios, 0);\n return (this.maxWidth - (count - 1) * this.spacing) / sum;\n };\n const pushAttempt = (lineCounts: number[]) => {\n const heights: number[] = [];\n let offset = 0;\n for(const count of lineCounts) {\n heights.push(multiHeight(offset, count));\n offset += count;\n }\n attempts.push({lineCounts, heights}); // warn\n };\n\n for(let first = 1; first !== this.count; ++first) {\n const second = this.count - first;\n if(first > 3 || second > 3) {\n continue;\n }\n pushAttempt([first, second]);\n }\n for(let first = 1; first !== this.count - 1; ++first) {\n for(let second = 1; second !== this.count - first; ++second) {\n const third = this.count - first - second;\n if((first > 3) ||\n (second > ((this.averageRatio < 0.85) ? 4 : 3)) ||\n (third > 3)) {\n continue;\n }\n pushAttempt([first, second, third]);\n }\n }\n for(let first = 1; first !== this.count - 1; ++first) {\n for(let second = 1; second !== this.count - first; ++second) {\n for(let third = 1; third !== this.count - first - second; ++third) {\n const fourth = this.count - first - second - third;\n if(first > 3 || second > 3 || third > 3 || fourth > 3) {\n continue;\n }\n pushAttempt([first, second, third, fourth]);\n }\n }\n }\n\n let optimalAttempt: Attempt = null;\n let optimalDiff = 0;\n for(const attempt of attempts) {\n const {heights, lineCounts: counts} = attempt;\n const lineCount = counts.length;\n const totalHeight = accumulate(heights, 0) +\n this.spacing * (lineCount - 1);\n const minLineHeight = Math.min(...heights);\n const maxLineHeight = Math.max(...heights);\n const bad1 = (minLineHeight < this.minWidth) ? 1.5 : 1;\n const bad2 = (() => {\n for(let line = 1; line !== lineCount; ++line) {\n if(counts[line - 1] > counts[line]) {\n return 1.5;\n }\n }\n return 1.;\n })();\n const diff = Math.abs(totalHeight - this.maxHeight) * bad1 * bad2;\n if(!optimalAttempt || diff < optimalDiff) {\n optimalAttempt = attempt;\n optimalDiff = diff;\n }\n }\n\n const optimalCounts = optimalAttempt.lineCounts;\n const optimalHeights = optimalAttempt.heights;\n const rowCount = optimalCounts.length;\n\n let index = 0;\n let y = 0;\n for(let row = 0; row !== rowCount; ++row) {\n const colCount = optimalCounts[row];\n const lineHeight = optimalHeights[row];\n const height = Math.round(lineHeight);\n\n let x = 0;\n for(let col = 0; col !== colCount; ++col) {\n const sides = RectPart.None |\n (row === 0 ? RectPart.Top : RectPart.None) |\n (row === rowCount - 1 ? RectPart.Bottom : RectPart.None) |\n (col === 0 ? RectPart.Left : RectPart.None) |\n (col === colCount - 1 ? RectPart.Right : RectPart.None);\n\n const ratio = this.ratios[index];\n const width = (col === colCount - 1) ?\n (this.maxWidth - x) :\n Math.round(ratio * lineHeight);\n result[index] = {\n geometry: {x, y, width, height},\n sides\n };\n\n x += width + this.spacing;\n ++index;\n }\n y += height + this.spacing;\n }\n\n return result;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Layouter, RectPart} from './groupedLayout';\n\nexport default function prepareAlbum(options: {\n container: HTMLElement,\n items: {w: number, h: number}[],\n maxWidth: number,\n minWidth: number,\n spacing: number,\n maxHeight?: number,\n forMedia?: true\n}) {\n const layouter = new Layouter(options.items, options.maxWidth, options.minWidth, options.spacing, options.maxHeight);\n const layout = layouter.layout();\n\n const widthItem = layout.find((item) => item.sides & RectPart.Right);\n const width = widthItem.geometry.width + widthItem.geometry.x;\n\n const heightItem = layout.find((item) => item.sides & RectPart.Bottom);\n const height = heightItem.geometry.height + heightItem.geometry.y;\n\n const container = options.container;\n container.style.width = width + 'px';\n container.style.height = height + 'px';\n const children = container.children;\n\n layout.forEach(({geometry, sides}, idx) => {\n let div: HTMLElement;\n div = children[idx] as HTMLElement;\n if(!div) {\n div = document.createElement('div');\n container.append(div);\n }\n\n div.classList.add('album-item', 'grouped-item');\n\n div.style.width = (geometry.width / width * 100) + '%';\n div.style.height = (geometry.height / height * 100) + '%';\n div.style.top = (geometry.y / height * 100) + '%';\n div.style.left = (geometry.x / width * 100) + '%';\n\n if(sides & RectPart.Left && sides & RectPart.Top) {\n div.style.borderTopLeftRadius = 'inherit';\n }\n\n if(sides & RectPart.Left && sides & RectPart.Bottom) {\n div.style.borderBottomLeftRadius = 'inherit';\n }\n\n if(sides & RectPart.Right && sides & RectPart.Top) {\n div.style.borderTopRightRadius = 'inherit';\n }\n\n if(sides & RectPart.Right && sides & RectPart.Bottom) {\n div.style.borderBottomRightRadius = 'inherit';\n }\n\n if(options.forMedia) {\n const mediaDiv = document.createElement('div');\n mediaDiv.classList.add('album-item-media');\n\n div.append(mediaDiv);\n }\n\n // @ts-ignore\n // div.style.backgroundColor = '#' + Math.floor(Math.random() * (2 ** 24 - 1)).toString(16).padStart(6, '0');\n });\n\n /* if(options.forMedia) {\n layout.forEach((_, i) => {\n const mediaDiv = document.createElement('div');\n mediaDiv.classList.add('album-item-media');\n\n options.container.children[i].append(mediaDiv);\n });\n } */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {PeerPhotoSize} from '../lib/appManagers/appAvatarsManager';\nimport getPreviewURLFromBytes from '../helpers/bytes/getPreviewURLFromBytes';\nimport {renderImageFromUrlPromise} from '../helpers/dom/renderImageFromUrl';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport setInnerHTML from '../helpers/dom/setInnerHTML';\nimport {recordPromise} from '../helpers/recordPromise';\nimport sequentialDom from '../helpers/sequentialDom';\nimport {UserProfilePhoto, ChatPhoto, User, Chat} from '../layer';\nimport getPeerColorById from '../lib/appManagers/utils/peers/getPeerColorById';\nimport getPeerPhoto from '../lib/appManagers/utils/peers/getPeerPhoto';\nimport {NULL_PEER_ID, REPLIES_PEER_ID} from '../lib/mtproto/mtproto_config';\nimport wrapAbbreviation from '../lib/richTextProcessor/wrapAbbreviation';\nimport rootScope from '../lib/rootScope';\nimport getPeerInitials from './wrappers/getPeerInitials';\nimport {wrapTopicIcon} from './wrappers/messageActionTextNewUnsafe';\nimport makeError from '../helpers/makeError';\nimport noop from '../helpers/noop';\nimport liteMode from '../helpers/liteMode';\n\nexport async function putAvatar(\n div: HTMLElement,\n peerId: PeerId,\n photo: UserProfilePhoto.userProfilePhoto | ChatPhoto.chatPhoto,\n size: PeerPhotoSize,\n img = new Image(),\n onlyThumb = false\n) {\n const r = await rootScope.managers.acknowledged.appAvatarsManager.loadAvatar(peerId, photo, size);\n const loadPromise = r.result;\n const cached = r.cached;\n\n img.classList.add('avatar-photo');\n\n let renderThumbPromise: Promise;\n let callback: () => void;\n let thumbImage: HTMLImageElement;\n if(cached) {\n // смотри в misc.ts: renderImageFromUrl\n callback = () => {\n replaceContent(div, img);\n div.dataset.color = '';\n };\n } else {\n const animate = liteMode.isAvailable('animations');\n if(animate) {\n img.classList.add('fade-in');\n }\n\n let isFullLoaded = false;\n if(size === 'photo_big') { // let's load small photo first\n const res = await putAvatar(div, peerId, photo, 'photo_small');\n renderThumbPromise = res.loadThumbPromise || res.loadPromise;\n thumbImage = res.thumbImage;\n } else if(photo.stripped_thumb) {\n thumbImage = new Image();\n div.classList.add('avatar-relative');\n thumbImage.classList.add('avatar-photo', 'avatar-photo-thumbnail');\n const url = getPreviewURLFromBytes(photo.stripped_thumb);\n renderThumbPromise = renderImageFromUrlPromise(thumbImage, url).then(() => {\n if(isFullLoaded) {\n return;\n }\n\n replaceContent(div, thumbImage);\n });\n }\n\n callback = () => {\n isFullLoaded = true;\n\n if(thumbImage) {\n div.append(img);\n } else {\n replaceContent(div, img);\n }\n\n setTimeout(() => {\n if(div.childElementCount) {\n sequentialDom.mutateElement(img, () => {\n div.dataset.color = '';\n\n if(animate) {\n img.classList.remove('fade-in');\n }\n\n thumbImage?.remove();\n });\n }\n }, animate ? 200 : 0);\n };\n }\n\n const renderPromise = loadPromise\n .then((url) => renderImageFromUrlPromise(img, url/* , !cached */))\n .then(callback);\n\n renderThumbPromise && await renderThumbPromise.catch(noop);\n\n return {\n cached,\n loadPromise: renderPromise,\n loadThumbPromise: cached ? renderPromise : renderThumbPromise || Promise.resolve(),\n thumbImage\n };\n}\n\nfunction set(\n div: HTMLElement,\n innerHTML: Parameters[1],\n color: string,\n icon?: string,\n isForum?: boolean,\n isTopic?: boolean\n) {\n setInnerHTML(div, innerHTML);\n div.dataset.color = color;\n div.classList.remove('tgico-saved', 'tgico-deletedaccount', 'tgico-reply_filled', 'is-forum', 'is-topic');\n icon && div.classList.add(icon);\n isForum && div.classList.add('is-forum');\n isTopic && div.classList.add('is-topic');\n}\n\n// peerId === peerId || title\nexport default async function putPhoto({\n div,\n peerId,\n isDialog = false,\n title = '',\n onlyThumb = false,\n isBig,\n threadId,\n wrapOptions = {}\n}: {\n div: HTMLElement,\n peerId: PeerId,\n isDialog?: boolean,\n title?: string,\n onlyThumb?: boolean,\n isBig?: boolean,\n threadId?: number,\n wrapOptions?: WrapSomethingOptions\n}) {\n const myId = rootScope.myId;\n\n if(peerId === myId && isDialog) {\n set(div, '', '', 'tgico-saved');\n return;\n }\n\n const managers = rootScope.managers;\n\n if(threadId) {\n const topic = await managers.dialogsStorage.getForumTopic(peerId, threadId);\n set(div, '', '', undefined, undefined, true);\n\n if(wrapOptions.customEmojiSize) {\n div.style.setProperty('--size', wrapOptions.customEmojiSize.width + 'px');\n }\n\n return wrapTopicIcon({\n ...wrapOptions,\n topic,\n lazyLoadQueue: false\n }).then((icon) => {\n div.replaceChildren(icon);\n });\n }\n\n const peer = await managers.appPeersManager.getPeer(peerId);\n if(peerId !== NULL_PEER_ID && peerId.isUser() && (peer as User.user)?.pFlags?.deleted) {\n set(div, '', getPeerColorById(peerId), 'tgico-deletedaccount');\n return;\n }\n\n const isForum = !!(peer as Chat.channel)?.pFlags?.forum;\n const size: PeerPhotoSize = isBig ? 'photo_big' : 'photo_small';\n const photo = getPeerPhoto(peer);\n const avatarAvailable = !!photo;\n const avatarRendered = !!div.firstElementChild && !(div.firstElementChild as HTMLElement).classList.contains('emoji');\n if(!avatarAvailable || !avatarRendered || !(await managers.appAvatarsManager.isAvatarCached(peerId, size))) {\n let color = '';\n if(peerId && (peerId !== myId || !isDialog)) {\n color = getPeerColorById(peerId);\n }\n\n if(peerId === REPLIES_PEER_ID) {\n set(div, '', color, 'tgico-reply_filled');\n return;\n }\n\n const abbr = title ? wrapAbbreviation(title) : getPeerInitials(peer);\n set(div, abbr, color, '', isForum);\n // return Promise.resolve(true);\n }\n\n if(avatarAvailable/* && false */) {\n const promise = putAvatar(div, peerId, photo, size, undefined, onlyThumb);\n // recordPromise(promise, 'putAvatar-' + peerId);\n return promise;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Chat, User} from '../../layer';\nimport wrapAbbreviation from '../../lib/richTextProcessor/wrapAbbreviation';\n\nexport default function getPeerInitials(peer: Chat | User) {\n let str = '';\n if(peer) {\n str = (peer as Chat.chat).title ?? [\n (peer as User.user).first_name,\n (peer as User.user).last_name\n ].filter(Boolean).join(' ');\n }\n\n return wrapAbbreviation(str);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\n\nexport function putPreloader(elem: Element, returnDiv = false): HTMLElement {\n const html = `\n \n \n `;\n\n if(returnDiv) {\n const div = document.createElement('div');\n div.classList.add('preloader');\n div.innerHTML = html;\n\n if(elem) {\n elem.appendChild(div);\n }\n\n return div;\n }\n\n elem.insertAdjacentHTML('beforeend', html);\n return elem.lastElementChild as HTMLElement;\n}\n\nMOUNT_CLASS_TO.putPreloader = putPreloader;\n\nexport function setButtonLoader(elem: HTMLButtonElement, icon = 'check') {\n elem.classList.remove('tgico-' + icon);\n elem.disabled = true;\n putPreloader(elem);\n\n return () => {\n elem.innerHTML = '';\n elem.classList.add('tgico-' + icon);\n elem.removeAttribute('disabled');\n };\n}\n\n/* export function parseMenuButtonsTo(to: {[name: string]: HTMLElement}, elements: HTMLCollection | NodeListOf) {\n Array.from(elements).forEach((el) => {\n const match = el.className.match(/(?:^|\\s)menu-(.+?)(?:$|\\s)/);\n if(!match) return;\n to[match[1]] = el as HTMLElement;\n });\n} */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport simulateEvent from '../helpers/dom/dispatchEvent';\nimport getDeepProperty from '../helpers/object/getDeepProperty';\nimport {LangPackKey, _i18n} from '../lib/langPack';\nimport apiManagerProxy from '../lib/mtproto/mtprotoworker';\nimport rootScope from '../lib/rootScope';\n\nexport default class RadioField {\n public input: HTMLInputElement;\n public label: HTMLLabelElement;\n public main: HTMLElement;\n\n constructor(options: {\n text?: string,\n langKey?: LangPackKey,\n name: string,\n value?: string,\n stateKey?: string,\n alignRight?: boolean\n }) {\n const label = this.label = document.createElement('label');\n label.classList.add('radio-field');\n\n if(options.alignRight) {\n label.classList.add('radio-field-right');\n }\n\n const input = this.input = document.createElement('input');\n input.type = 'radio';\n /* input.id = */input.name = 'input-radio-' + options.name;\n\n if(options.value) {\n input.value = options.value;\n\n if(options.stateKey) {\n apiManagerProxy.getState().then((state) => {\n input.checked = getDeepProperty(state, options.stateKey) === options.value;\n });\n\n input.addEventListener('change', () => {\n rootScope.managers.appStateManager.setByKey(options.stateKey, options.value);\n });\n }\n }\n\n const main = this.main = document.createElement('div');\n main.classList.add('radio-field-main');\n\n if(options.text) {\n main.innerHTML = options.text;\n /* const caption = document.createElement('div');\n caption.classList.add('radio-field-main-caption');\n caption.innerHTML = text;\n\n if(subtitle) {\n label.classList.add('radio-field-with-subtitle');\n caption.insertAdjacentHTML('beforeend', `
${subtitle}
`);\n }\n\n main.append(caption); */\n } else if(options.langKey) {\n _i18n(main, options.langKey);\n }\n\n label.append(input, main);\n }\n\n get checked() {\n return this.input.checked;\n }\n\n set checked(checked: boolean) {\n this.setValueSilently(checked);\n simulateEvent(this.input, 'change');\n }\n\n public setValueSilently(checked: boolean) {\n this.input.checked = checked;\n }\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function RadioForm(radios: {container: HTMLElement, input: HTMLInputElement}[], onChange: (value: string, event: Event) => void) {\n const form = document.createElement('form');\n\n radios.forEach((r) => {\n const {container, input} = r;\n form.append(container);\n input.addEventListener('change', (e) => {\n if(input.checked) {\n onChange(input.value, e);\n }\n });\n });\n\n return form;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport attachGrabListeners, {GrabEvent} from '../helpers/dom/attachGrabListeners';\nimport clamp from '../helpers/number/clamp';\nimport safeAssign from '../helpers/object/safeAssign';\n\nexport default class RangeSelector {\n public container: HTMLDivElement;\n protected filled: HTMLDivElement;\n protected seek: HTMLInputElement;\n\n public mousedown = false;\n protected rect: DOMRect;\n protected _removeListeners: () => void;\n\n private events: Partial<{\n // onMouseMove: ProgressLine['onMouseMove'],\n onMouseDown: RangeSelector['onMouseDown'],\n onMouseUp: RangeSelector['onMouseUp'],\n onScrub: (value: number) => void\n }> = {};\n\n protected decimals: number;\n\n protected step: number;\n protected min: number;\n protected max: number;\n protected withTransition = false;\n protected useTransform = false;\n protected vertical = false;\n\n constructor(\n options: {\n step: RangeSelector['step'],\n min: RangeSelector['min'],\n max: RangeSelector['max'],\n withTransition?: RangeSelector['withTransition'],\n useTransform?: RangeSelector['useTransform'],\n vertical?: RangeSelector['vertical']\n },\n value = 0\n ) {\n safeAssign(this, options);\n\n this.container = document.createElement('div');\n this.container.classList.add('progress-line');\n\n // there is no sense in using transition with transform, because it is updating every frame\n if(this.useTransform) {\n this.container.classList.add('use-transform');\n } else if(this.withTransition) {\n this.container.classList.add('with-transition');\n }\n\n this.filled = document.createElement('div');\n this.filled.classList.add('progress-line__filled');\n\n const seek = this.seek = document.createElement('input');\n seek.classList.add('progress-line__seek');\n // seek.setAttribute('max', '0');\n seek.type = 'range';\n seek.step = '' + this.step;\n seek.min = '' + this.min;\n seek.max = '' + this.max;\n seek.value = '' + value;\n\n if(value) {\n this.setProgress(value);\n }\n\n const stepStr = '' + this.step;\n const index = stepStr.indexOf('.');\n this.decimals = index === -1 ? 0 : stepStr.length - index - 1;\n\n // this.setListeners();\n\n this.container.append(this.filled, seek);\n }\n\n get value() {\n return +this.seek.value;\n }\n\n public setHandlers(events: RangeSelector['events']) {\n this.events = events;\n }\n\n protected onMouseMove = (event: GrabEvent) => {\n this.scrub(event);\n };\n\n protected onMouseDown = (event: GrabEvent) => {\n this.rect = this.container.getBoundingClientRect();\n this.mousedown = true;\n this.scrub(event);\n this.container.classList.add('is-focused');\n this.events?.onMouseDown && this.events.onMouseDown(event);\n };\n\n protected onMouseUp = (event: GrabEvent) => {\n this.mousedown = false;\n this.container.classList.remove('is-focused');\n this.events?.onMouseUp && this.events.onMouseUp(event);\n };\n\n public setListeners() {\n this.seek.addEventListener('input', this.onInput);\n this._removeListeners = attachGrabListeners(this.container, this.onMouseDown, this.onMouseMove, this.onMouseUp);\n }\n\n public onInput = () => {\n const value = +this.seek.value;\n this.setFilled(value);\n this.events?.onScrub && this.events.onScrub(value);\n };\n\n public setProgress(value: number) {\n this.seek.value = '' + value;\n this.setFilled(+this.seek.value); // clamp\n }\n\n public addProgress(value: number) {\n this.seek.value = '' + (+this.seek.value + value);\n this.setFilled(+this.seek.value); // clamp\n }\n\n public setFilled(value: number) {\n let percents = (value - this.min) / (this.max - this.min);\n percents = clamp(percents, 0, 1);\n\n // using scaleX and width even with vertical because it will be rotated\n if(this.useTransform) {\n this.filled.style.transform = `scaleX(${percents})`;\n } else {\n this.filled.style.width = (percents * 100) + '%';\n }\n }\n\n protected scrub(event: GrabEvent) {\n const rectMax = this.vertical ? this.rect.height : this.rect.width;\n const offsetAxisValue = clamp(this.vertical ? -(event.y - this.rect.bottom) : event.x - this.rect.left, 0, rectMax);\n\n let value = this.min + (offsetAxisValue / rectMax * (this.max - this.min));\n\n if((value - this.min) < ((this.max - this.min) / 2)) {\n value -= this.step / 10;\n }\n\n value = +value.toFixed(this.decimals);\n value = clamp(value, this.min, this.max);\n\n // this.seek.value = '' + value;\n // this.onInput();\n\n this.setProgress(value);\n this.events?.onScrub && this.events.onScrub(value);\n\n return value;\n }\n\n public removeListeners() {\n if(this._removeListeners) {\n this._removeListeners();\n this._removeListeners = null;\n }\n\n this.seek.removeEventListener('input', this.onInput);\n\n this.events = {};\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport sequentialDom from '../helpers/sequentialDom';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport rootScope from '../lib/rootScope';\nimport findUpAsChild from '../helpers/dom/findUpAsChild';\nimport {fastRaf} from '../helpers/schedulers';\nimport liteMode from '../helpers/liteMode';\n\nlet rippleClickId = 0;\nexport default function ripple(\n elem: HTMLElement,\n callback: (id: number) => Promise = () => Promise.resolve(),\n onEnd: (id: number) => void = null,\n prepend = false,\n attachListenerTo = elem\n) {\n // return;\n if(elem.querySelector('.c-ripple')) return;\n elem.classList.add('rp');\n\n const r = document.createElement('div');\n r.classList.add('c-ripple');\n\n const isSquare = elem.classList.contains('rp-square');\n if(isSquare) {\n r.classList.add('is-square');\n }\n\n elem[prepend ? 'prepend' : 'append'](r);\n\n let handler: () => void;\n // let animationEndPromise: Promise;\n const drawRipple = (clientX: number, clientY: number) => {\n const startTime = Date.now();\n const circle = document.createElement('div');\n\n const clickId = rippleClickId++;\n\n // console.log('ripple drawRipple');\n\n // const auto = elem.classList.contains('row-sortable') && !elem.classList.contains('cant-sort');\n const auto = false;\n const duration = (auto ? .3 : +window.getComputedStyle(r).getPropertyValue('--ripple-duration').replace('s', '')) * 1000;\n // console.log('ripple duration', duration);\n\n const _handler = handler = () => {\n // handler = () => animationEndPromise.then((duration) => {\n // console.log('ripple animation was:', duration);\n\n // const duration = isSquare || mediaSizes.isMobile ? 200 : 700;\n // return;\n const elapsedTime = Date.now() - startTime;\n const cb = () => {\n // console.log('ripple elapsedTime total pre-remove:', Date.now() - startTime);\n sequentialDom.mutate(() => {\n circle.remove();\n });\n\n onEnd?.(clickId);\n };\n if(elapsedTime < duration) {\n const delay = Math.max(duration - elapsedTime, duration / 2);\n setTimeout(() => circle.classList.add('hiding'), Math.max(delay - duration / 2, 0));\n\n setTimeout(cb, delay);\n } else {\n circle.classList.add('hiding');\n setTimeout(cb, duration / 2);\n }\n\n if(!IS_TOUCH_SUPPORTED) {\n window.removeEventListener('contextmenu', handler);\n window.removeEventListener('mousemove', handler);\n }\n\n handler = null;\n touchStartFired = false;\n };\n // });\n\n callback?.(clickId);\n\n /* callback().then((bad) => {\n if(bad) {\n span.remove();\n return;\n } */\n\n // console.log('ripple after promise', Date.now() - startTime);\n // console.log('ripple tooSlow:', tooSlow);\n /* if(tooSlow) {\n span.remove();\n return;\n } */\n\n fastRaf(() => {\n if(_handler !== handler) {\n return;\n }\n\n const rect = r.getBoundingClientRect();\n circle.classList.add('c-ripple__circle');\n\n const clickX = clientX - rect.left;\n const clickY = clientY - rect.top;\n\n const radius = Math.sqrt((Math.abs(clickY - rect.height / 2) + rect.height / 2) ** 2 + (Math.abs(clickX - rect.width / 2) + rect.width / 2) ** 2);\n const size = radius;\n\n // center of circle\n const x = clickX - size / 2;\n const y = clickY - size / 2;\n\n // console.log('ripple click', offsetFromCenter, size, clickX, clickY);\n\n circle.style.width = circle.style.height = size + 'px';\n circle.style.left = x + 'px';\n circle.style.top = y + 'px';\n\n // нижний код выполняется с задержкой\n /* animationEndPromise = new Promise((resolve) => {\n span.addEventListener('animationend', () => {\n // 713 -> 700\n resolve(((Date.now() - startTime) / 100 | 0) * 100);\n }, {once: true});\n }); */\n\n // нижний код не всегда включает анимацию ПРИ КЛИКЕ НА ТАЧПАД БЕЗ ТАПТИК ЭНЖИНА\n /* span.style.display = 'none';\n r.append(span);\n duration = +window.getComputedStyle(span).getPropertyValue('animation-duration').replace('s', '') * 1000;\n span.style.display = ''; */\n\n r.append(circle);\n\n if(auto) {\n // window.addEventListener('mousemove', handler, {once: true, passive: true});\n handler();\n }\n\n // r.classList.add('active');\n // handler();\n });\n // });\n };\n\n const isRippleUnneeded = (e: Event) => {\n return e.target !== elem && (\n ['BUTTON', 'A'].includes((e.target as HTMLElement).tagName) ||\n findUpClassName(e.target as HTMLElement, 'c-ripple') !== r\n ) && (\n attachListenerTo === elem ||\n !findUpAsChild(e.target as HTMLElement, attachListenerTo)\n ) && !findUpClassName(e.target, 'checkbox-field');\n };\n\n // TODO: rename this variable\n let touchStartFired = false;\n if(IS_TOUCH_SUPPORTED) {\n const touchEnd = () => {\n handler?.();\n };\n\n attachListenerTo.addEventListener('touchstart', (e) => {\n if(!liteMode.isAvailable('animations')) {\n return;\n }\n\n // console.log('ripple touchstart', e);\n if(e.touches.length > 1 || touchStartFired || isRippleUnneeded(e)) {\n return;\n }\n\n // console.log('touchstart', e);\n touchStartFired = true;\n\n const {clientX, clientY} = e.touches[0];\n drawRipple(clientX, clientY);\n attachListenerTo.addEventListener('touchend', touchEnd, {once: true});\n\n window.addEventListener('touchmove', (e) => {\n e.cancelBubble = true;\n e.stopPropagation();\n touchEnd();\n attachListenerTo.removeEventListener('touchend', touchEnd);\n }, {once: true});\n }, {passive: true});\n } else {\n attachListenerTo.addEventListener('mousedown', (e) => {\n if(![0, 2].includes(e.button)) { // only left and right buttons\n return;\n }\n\n if(!liteMode.isAvailable('animations')) {\n return;\n }\n // console.log('ripple mousedown', e, e.target, findUpClassName(e.target as HTMLElement, 'c-ripple') === r);\n\n if(attachListenerTo.dataset.ripple === '0' || isRippleUnneeded(e)) {\n return;\n } else if(touchStartFired) {\n touchStartFired = false;\n return;\n }\n\n const {clientX, clientY} = e;\n drawRipple(clientX, clientY);\n window.addEventListener('mouseup', handler, {once: true, passive: true});\n window.addEventListener('contextmenu', handler, {once: true, passive: true});\n }, {passive: true});\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport CheckboxField, {CheckboxFieldOptions} from './checkboxField';\nimport RadioField from './radioField';\nimport ripple from './ripple';\nimport {SliderSuperTab} from './slider';\nimport RadioForm from './radioForm';\nimport {i18n, LangPackKey} from '../lib/langPack';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport setInnerHTML, {setDirection} from '../helpers/dom/setInnerHTML';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport Button from './button';\nimport createContextMenu from '../helpers/dom/createContextMenu';\n\ntype K = string | HTMLElement | DocumentFragment | true;\n\nconst setContent = (element: HTMLElement, content: K) => {\n if(content === true) {\n\n } else if(typeof(content) === 'string') {\n setInnerHTML(element, content);\n } else {\n element.append(content);\n }\n};\n\nexport type RowMediaSizeType = 'small' | 'medium' | 'big' | 'abitbigger' | 'bigger';\n\nexport default class Row {\n public container: HTMLElement;\n public titleRow: HTMLElement;\n public titleRight: HTMLElement;\n public media: HTMLElement;\n\n public subtitleRow: HTMLElement;\n public subtitleRight: HTMLElement;\n\n public checkboxField: CheckboxField;\n public radioField: RadioField;\n\n public freezed = false;\n\n public buttonRight: HTMLElement;\n\n private _title: HTMLElement;\n private _subtitle: HTMLElement;\n private _midtitle: HTMLElement;\n\n constructor(options: Partial<{\n icon: string,\n subtitle: K,\n subtitleLangKey: LangPackKey,\n subtitleLangArgs: any[],\n subtitleRight: K,\n radioField: Row['radioField'],\n checkboxField: Row['checkboxField'],\n checkboxFieldOptions: CheckboxFieldOptions,\n withCheckboxSubtitle: boolean,\n title: K,\n titleLangKey: LangPackKey,\n titleRight: K,\n titleRightSecondary: K,\n clickable: boolean | ((e: Event) => void),\n navigationTab: SliderSuperTab,\n havePadding: boolean,\n noRipple: boolean,\n noWrap: boolean,\n listenerSetter: ListenerSetter,\n buttonRight?: HTMLElement | boolean,\n buttonRightLangKey: LangPackKey,\n asLink: boolean,\n contextMenu: Omit[0], 'findElement' | 'listenTo' | 'listenerSetter'>\n }> = {}) {\n if(options.checkboxFieldOptions) {\n options.checkboxField = new CheckboxField({\n listenerSetter: options.listenerSetter,\n ...options.checkboxFieldOptions\n });\n }\n\n const tagName = options.asLink ? 'a' : (options.radioField || options.checkboxField ? 'label' : 'div');\n this.container = document.createElement(tagName);\n this.container.classList.add('row', 'no-subtitle');\n\n if(options.noWrap) {\n this.container.classList.add('no-wrap');\n }\n\n if(options.subtitle) {\n const subtitle = this.subtitle;\n setContent(subtitle, options.subtitle);\n\n if(options.noWrap) subtitle.classList.add('no-wrap');\n\n if(options.subtitleRight) {\n this.container.append(this.subtitleRow = this.createRow());\n this.subtitleRow.classList.add('row-subtitle-row');\n const subtitleRight = this.subtitleRight = document.createElement('div');\n subtitleRight.classList.add('row-subtitle', 'row-subtitle-right');\n\n setContent(subtitleRight, options.subtitleRight);\n this.subtitleRow.append(subtitle, subtitleRight);\n }\n } else if(options.subtitleLangKey) {\n this.subtitle.append(i18n(options.subtitleLangKey, options.subtitleLangArgs));\n }\n\n let havePadding = !!options.havePadding;\n if(options.radioField || options.checkboxField) {\n if(options.radioField) {\n this.radioField = options.radioField;\n this.container.append(this.radioField.label);\n havePadding = true;\n }\n\n if(options.checkboxField) {\n this.checkboxField = options.checkboxField;\n\n const isToggle = options.checkboxField.label.classList.contains('checkbox-field-toggle');\n if(isToggle) {\n this.container.classList.add('row-with-toggle');\n options.titleRight = this.checkboxField.label;\n } else {\n havePadding = true;\n if(!this.checkboxField.span) {\n this.checkboxField.label.classList.add('checkbox-field-absolute');\n }\n this.container.append(this.checkboxField.label);\n }\n\n if(options.withCheckboxSubtitle && !isToggle) {\n const onChange = () => {\n replaceContent(this.subtitle, i18n(this.checkboxField.input.checked ? 'Checkbox.Enabled' : 'Checkbox.Disabled'));\n };\n\n if(options.listenerSetter) options.listenerSetter.add(this.checkboxField.input)('change', onChange);\n else this.checkboxField.input.addEventListener('change', onChange);\n }\n }\n\n const i = options.radioField || options.checkboxField;\n i.label.classList.add('disable-hover');\n }\n\n if(options.title || options.titleLangKey || options.titleRight || options.titleRightSecondary) {\n let c: HTMLElement;\n const titleRightContent = options.titleRight || options.titleRightSecondary;\n if(titleRightContent) {\n this.container.append(c = this.titleRow = this.createRow());\n this.titleRow.classList.add('row-title-row');\n } else {\n c = this.container;\n }\n\n this._title = this.createTitle();\n if(options.noWrap) this.title.classList.add('no-wrap');\n if(options.title) {\n setContent(this.title, options.title);\n } else if(options.titleLangKey) {\n this.title.append(i18n(options.titleLangKey));\n }\n\n c.append(this.title);\n\n if(titleRightContent) {\n const titleRight = this.titleRight = document.createElement('div');\n titleRight.classList.add('row-title', 'row-title-right');\n\n if(options.titleRightSecondary) {\n titleRight.classList.add('row-title-right-secondary');\n }\n\n setContent(titleRight, titleRightContent);\n c.append(titleRight);\n }\n }\n\n if(options.icon) {\n havePadding = true;\n // this.title.classList.add('tgico', 'tgico-' + options.icon);\n this.container.classList.add('tgico', 'tgico-' + options.icon);\n this.container.classList.add('row-with-icon');\n }\n\n if(havePadding) {\n this.container.classList.add('row-with-padding');\n }\n\n if(options.navigationTab) {\n options.clickable = () => options.navigationTab.open();\n }\n\n if(options.clickable || options.radioField || options.checkboxField) {\n if(typeof(options.clickable) === 'function') {\n attachClickEvent(this.container, (e) => {\n if(this.freezed) return;\n (options.clickable as any)(e);\n }, {listenerSetter: options.listenerSetter});\n }\n\n this.container.classList.add('row-clickable', 'hover-effect');\n\n if(!options.noRipple) {\n ripple(this.container, undefined, undefined, true);\n }\n\n /* if(options.radioField || options.checkboxField) {\n this.container.prepend(this.container.lastElementChild);\n } */\n }\n\n if(options.buttonRight || options.buttonRightLangKey) {\n this.buttonRight = options.buttonRight instanceof HTMLElement ?\n options.buttonRight :\n Button('btn-primary btn-color-primary', {text: options.buttonRightLangKey});\n this.container.append(this.buttonRight);\n }\n\n if(options.contextMenu) {\n createContextMenu({\n ...options.contextMenu,\n listenTo: this.container,\n listenerSetter: options.listenerSetter\n });\n }\n }\n\n public get title() {\n return this._title;\n }\n\n public get subtitle() {\n return this._subtitle ??= this.createSubtitle();\n }\n\n public get midtitle() {\n return this._midtitle ??= this.createMidtitle();\n }\n\n private createRow() {\n const c = document.createElement('div');\n c.classList.add('row-row');\n return c;\n }\n\n private createTitle() {\n const title = document.createElement('div');\n title.classList.add('row-title');\n setDirection(title);\n return title;\n }\n\n private createSubtitle() {\n const subtitle = document.createElement('div');\n subtitle.classList.add('row-subtitle');\n setDirection(subtitle);\n if(this.title) this.title.after(subtitle);\n else this.container.prepend(subtitle);\n this.container.classList.remove('no-subtitle');\n return subtitle;\n }\n\n private createMidtitle() {\n const midtitle = document.createElement('div');\n midtitle.classList.add('row-midtitle');\n this.subtitle.parentElement.insertBefore(midtitle, this.subtitle);\n return midtitle;\n }\n\n public createMedia(size?: RowMediaSizeType) {\n const media = document.createElement('div');\n return this.applyMediaElement(media, size);\n }\n\n public applyMediaElement(media: HTMLElement, size?: RowMediaSizeType) {\n this.container.classList.add('row-with-padding');\n\n this.media = media;\n media.classList.add('row-media');\n\n if(size) {\n media.classList.add('row-media-' + size);\n }\n\n this.container.append(media);\n\n return media;\n }\n\n public isDisabled() {\n return this.container.classList.contains('is-disabled');\n }\n\n public toggleDisability(disable = !this.container.classList.contains('is-disabled')) {\n this.container.classList.toggle('is-disabled', disable);\n return () => this.toggleDisability(!disable);\n }\n\n public disableWithPromise(promise: Promise) {\n const toggle = this.toggleDisability(true);\n promise.finally(() => {\n toggle();\n });\n }\n\n public makeSortable() {\n const sortIcon = document.createElement('span');\n this.container.classList.add('row-sortable', 'tgico');\n sortIcon.classList.add('row-sortable-icon', 'tgico-menu');\n this.container.append(sortIcon);\n }\n\n public toggleSorting(enabled?: boolean) {\n this.container.classList.toggle('cant-sort', !enabled);\n }\n}\n\nexport const CreateRowFromCheckboxField = (checkboxField: CheckboxField) => {\n return new Row({checkboxField, listenerSetter: checkboxField.listenerSetter});\n};\n\nexport const RadioFormFromRows = (rows: Row[], onChange: (value: string) => void) => {\n return RadioForm(rows.map((r) => ({container: r.container, input: r.radioField.input})), onChange);\n};\n\nexport const RadioFormFromValues = (values: {langPackKey: LangPackKey, value: number | string, checked?: boolean}[], onChange: Parameters[1]) => {\n const name = 'name-' + (Math.random() * 0x7FFFFF | 0);\n let checkedRadioField: RadioField;\n const rows = values.map(({langPackKey, value, checked}) => {\n const row = new Row({\n radioField: new RadioField({\n langKey: langPackKey,\n name,\n value: '' + value\n })\n });\n\n if(checked) {\n checkedRadioField = row.radioField;\n }\n\n return row;\n });\n\n const form = RadioFormFromRows(rows, onChange);\n if(checkedRadioField) {\n checkedRadioField.checked = true;\n }\n return form;\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport {logger, LogTypes} from '../lib/logger';\nimport fastSmoothScroll, {ScrollOptions} from '../helpers/fastSmoothScroll';\nimport useHeavyAnimationCheck from '../hooks/useHeavyAnimationCheck';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {IS_ANDROID} from '../environment/userAgent';\n/*\nvar el = $0;\nvar height = 0;\nvar checkUp = false;\n\ndo {\n height += el.scrollHeight;\n} while(el = (checkUp ? el.previousElementSibling : el.nextElementSibling));\nconsole.log(height);\n*/\n\n/*\nArray.from($0.querySelectorAll('.bubble-content')).forEach((_el) => {\n //_el.style.display = '';\n //return;\n\n let el = _el.parentElement;\n let height = el.scrollHeight;\n let width = el.scrollWidth;\n el.style.width = width + 'px';\n el.style.height = height + 'px';\n _el.style.display = 'none';\n});\n*/\n\n/* const scrollables: Map = new Map();\nconst scrollsIntersector = new IntersectionObserver((entries) => {\n for(let entry of entries) {\n const scrollable = scrollables.get(entry.target as HTMLElement);\n\n if(entry.isIntersecting) {\n scrollable.isVisible = true;\n } else {\n scrollable.isVisible = false;\n\n if(!isInDOM(entry.target)) {\n scrollsIntersector.unobserve(scrollable.container);\n scrollables.delete(scrollable.container);\n }\n }\n }\n}); */\n\nconst SCROLL_THROTTLE = /* IS_ANDROID ? 200 : */24;\n\nexport class ScrollableBase {\n protected log: ReturnType;\n\n public splitUp: HTMLElement;\n public onScrollMeasure: number = 0;\n\n public lastScrollPosition: number = 0;\n public lastScrollDirection: number = 0;\n\n public onAdditionalScroll: () => void;\n public onScrolledTop: () => void;\n public onScrolledBottom: () => void;\n\n public isHeavyAnimationInProgress = false;\n protected needCheckAfterAnimation = false;\n\n public checkForTriggers?: () => void;\n\n public scrollProperty: 'scrollTop' | 'scrollLeft';\n\n protected removeHeavyAnimationListener: () => void;\n protected addedScrollListener: boolean;\n\n constructor(public el?: HTMLElement, logPrefix = '', public container: HTMLElement = document.createElement('div')) {\n this.container.classList.add('scrollable');\n\n this.log = logger('SCROLL' + (logPrefix ? '-' + logPrefix : ''), LogTypes.Error);\n\n if(el) {\n Array.from(el.children).forEach((c) => this.container.append(c));\n\n el.append(this.container);\n }\n // this.onScroll();\n }\n\n public addScrollListener() {\n if(this.addedScrollListener) {\n return;\n }\n\n this.addedScrollListener = true;\n this.container.addEventListener('scroll', this.onScroll, {passive: true, capture: true});\n }\n\n public removeScrollListener() {\n if(!this.addedScrollListener) {\n return;\n }\n\n this.addedScrollListener = false;\n this.container.removeEventListener('scroll', this.onScroll, {capture: true});\n }\n\n public setListeners() {\n if(this.removeHeavyAnimationListener) {\n return;\n }\n\n window.addEventListener('resize', this.onScroll, {passive: true});\n this.addScrollListener();\n\n this.removeHeavyAnimationListener = useHeavyAnimationCheck(() => {\n this.isHeavyAnimationInProgress = true;\n\n if(this.onScrollMeasure) {\n this.cancelMeasure();\n this.needCheckAfterAnimation = true;\n }\n }, () => {\n this.isHeavyAnimationInProgress = false;\n\n if(this.needCheckAfterAnimation) {\n this.onScroll();\n this.needCheckAfterAnimation = false;\n }\n });\n }\n\n public removeListeners() {\n if(!this.removeHeavyAnimationListener) {\n return;\n }\n\n window.removeEventListener('resize', this.onScroll);\n this.removeScrollListener();\n\n this.removeHeavyAnimationListener();\n this.removeHeavyAnimationListener = undefined;\n }\n\n public destroy() {\n this.removeListeners();\n this.onAdditionalScroll = undefined;\n this.onScrolledTop = undefined;\n this.onScrolledBottom = undefined;\n }\n\n public append(...args: Parameters) {\n this.container.append(...args);\n }\n\n public scrollIntoViewNew(options: Omit) {\n // return Promise.resolve();\n // this.removeListeners();\n return fastSmoothScroll({\n ...options,\n container: this.container\n });/* .finally(() => {\n this.setListeners();\n }); */\n }\n\n public onScroll = () => {\n // if(this.debug) {\n // this.log('onScroll call', this.onScrollMeasure);\n // }\n\n // return;\n\n if(this.isHeavyAnimationInProgress) {\n this.cancelMeasure();\n this.needCheckAfterAnimation = true;\n return;\n }\n\n // if(this.onScrollMeasure || ((this.scrollLocked || (!this.onScrolledTop && !this.onScrolledBottom)) && !this.splitUp && !this.onAdditionalScroll)) return;\n if((!this.onScrolledTop && !this.onScrolledBottom) && !this.splitUp && !this.onAdditionalScroll) return;\n if(this.onScrollMeasure) return;\n // if(this.onScrollMeasure) window.cancelAnimationFrame(this.onScrollMeasure);\n // this.onScrollMeasure = window.requestAnimationFrame(() => {\n this.onScrollMeasure = window.setTimeout(() => {\n this.onScrollMeasure = 0;\n\n const scrollPosition = this.container[this.scrollProperty];\n this.lastScrollDirection = this.lastScrollPosition === scrollPosition ? 0 : (this.lastScrollPosition < scrollPosition ? 1 : -1); // * 1 - bottom, -1 - top\n this.lastScrollPosition = scrollPosition;\n\n // lastScrollDirection check is useless here, every callback should decide on its own\n if(this.onAdditionalScroll/* && this.lastScrollDirection !== 0 */) {\n this.onAdditionalScroll();\n }\n\n if(this.checkForTriggers) {\n this.checkForTriggers();\n }\n // });\n }, SCROLL_THROTTLE);\n };\n\n public cancelMeasure() {\n if(this.onScrollMeasure) {\n // window.cancelAnimationFrame(this.onScrollMeasure);\n clearTimeout(this.onScrollMeasure);\n this.onScrollMeasure = 0;\n }\n }\n}\n\nexport type SliceSides = 'top' | 'bottom';\nexport type SliceSidesContainer = {[k in SliceSides]: boolean};\n\nexport default class Scrollable extends ScrollableBase {\n public padding: HTMLElement;\n\n public loadedAll: SliceSidesContainer = {top: true, bottom: false};\n\n constructor(el?: HTMLElement, logPrefix = '', public onScrollOffset = 300, withPaddingContainer?: boolean) {\n super(el, logPrefix);\n\n /* if(withPaddingContainer) {\n this.padding = document.createElement('div');\n this.padding.classList.add('scrollable-padding');\n Array.from(this.container.children).forEach((c) => this.padding.append(c));\n this.container.append(this.padding);\n } */\n\n this.container.classList.add('scrollable-y');\n this.setListeners();\n this.scrollProperty = 'scrollTop';\n }\n\n public attachBorderListeners(setClassOn = this.container) {\n const cb = this.onAdditionalScroll;\n this.onAdditionalScroll = () => {\n cb?.();\n setClassOn.classList.toggle('scrolled-top', !this.scrollTop);\n setClassOn.classList.toggle('scrolled-bottom', this.isScrolledDown);\n };\n\n setClassOn.classList.add('scrolled-top', 'scrolled-bottom', 'scrollable-y-bordered');\n }\n\n public setVirtualContainer(el?: HTMLElement) {\n this.splitUp = el;\n this.log('setVirtualContainer:', el, this);\n }\n\n public checkForTriggers = () => {\n if((!this.onScrolledTop && !this.onScrolledBottom)) return;\n\n if(this.isHeavyAnimationInProgress) {\n this.onScroll();\n return;\n }\n\n const scrollHeight = this.container.scrollHeight;\n if(!scrollHeight) { // незачем вызывать триггеры если блок пустой или не виден\n return;\n }\n\n const clientHeight = this.container.clientHeight;\n const maxScrollTop = scrollHeight - clientHeight;\n const scrollTop = this.lastScrollPosition;\n\n // this.log('checkForTriggers:', scrollTop, maxScrollTop);\n\n if(this.onScrolledTop && scrollTop <= this.onScrollOffset && this.lastScrollDirection <= 0/* && direction === -1 */) {\n this.onScrolledTop();\n }\n\n if(this.onScrolledBottom && (maxScrollTop - scrollTop) <= this.onScrollOffset && this.lastScrollDirection >= 0/* && direction === 1 */) {\n this.onScrolledBottom();\n }\n };\n\n public prepend(...elements: (HTMLElement | DocumentFragment)[]) {\n (this.splitUp || this.padding || this.container).prepend(...elements);\n }\n\n public append(...elements: (HTMLElement | DocumentFragment)[]) {\n (this.splitUp || this.padding || this.container).append(...elements);\n }\n\n public getDistanceToEnd() {\n return this.scrollHeight - Math.round(this.scrollTop + this.container.offsetHeight);\n }\n\n get isScrolledDown() {\n return this.getDistanceToEnd() <= 1;\n }\n\n set scrollTop(y: number) {\n this.container.scrollTop = y;\n }\n\n get scrollTop() {\n // this.log.trace('get scrollTop');\n return this.container.scrollTop;\n }\n\n public setScrollTopSilently(value: number) {\n this.lastScrollPosition = value;\n this.ignoreNextScrollEvent();\n\n this.scrollTop = value;\n }\n\n public ignoreNextScrollEvent() {\n if(this.removeHeavyAnimationListener) {\n this.removeScrollListener();\n this.container.addEventListener('scroll', (e) => {\n cancelEvent(e);\n this.addScrollListener();\n }, {capture: true, passive: false, once: true});\n }\n }\n\n get scrollHeight() {\n return this.container.scrollHeight;\n }\n}\n\nexport class ScrollableX extends ScrollableBase {\n constructor(el: HTMLElement, logPrefix = '', public onScrollOffset = 300, public splitCount = 15, public container: HTMLElement = document.createElement('div')) {\n super(el, logPrefix, container);\n\n this.container.classList.add('scrollable-x');\n\n if(!IS_TOUCH_SUPPORTED) {\n const scrollHorizontally = (e: any) => {\n if(!e.deltaX && this.container.scrollWidth > this.container.clientWidth) {\n this.container.scrollLeft += e.deltaY / 4;\n cancelEvent(e);\n }\n };\n\n this.container.addEventListener('wheel', scrollHorizontally, {passive: false});\n }\n\n this.scrollProperty = 'scrollLeft';\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {LangPackKey, FormatterArguments, i18n_} from '../lib/langPack';\nimport {generateDelimiter} from './generateDelimiter';\nimport Scrollable from './scrollable';\n\nexport type SettingSectionOptions = {\n name?: LangPackKey,\n nameArgs?: FormatterArguments,\n caption?: LangPackKey | true,\n captionArgs?: FormatterArguments,\n captionOld?: SettingSectionOptions['caption'],\n noDelimiter?: boolean,\n fakeGradientDelimiter?: boolean,\n noShadow?: boolean,\n // fullWidth?: boolean,\n // noPaddingTop?: boolean\n};\n\nconst className = 'sidebar-left-section';\nexport default class SettingSection {\n public container: HTMLElement;\n public innerContainer: HTMLElement;\n public content: HTMLElement;\n public title: HTMLElement;\n public caption: HTMLElement;\n\n private fullWidth: boolean;\n\n constructor(options: SettingSectionOptions = {}) {\n const container = this.container = document.createElement('div');\n container.classList.add(className + '-container');\n\n const innerContainer = this.innerContainer = document.createElement('div');\n innerContainer.classList.add(className);\n\n if(options.noShadow) {\n innerContainer.classList.add('no-shadow');\n }\n\n if(options.fakeGradientDelimiter) {\n innerContainer.append(generateDelimiter());\n innerContainer.classList.add('with-fake-delimiter');\n } else if(!options.noDelimiter) {\n const hr = document.createElement('hr');\n innerContainer.append(hr);\n } else {\n innerContainer.classList.add('no-delimiter');\n }\n\n // if(options.fullWidth) {\n // this.fullWidth = true;\n // }\n\n // if(options.noPaddingTop) {\n // innerContainer.classList.add('no-padding-top');\n // }\n\n const content = this.content = this.generateContentElement();\n\n if(options.name) {\n const title = this.title = document.createElement('div');\n title.classList.add('sidebar-left-h2', className + '-name');\n i18n_({element: title, key: options.name, args: options.nameArgs});\n content.append(title);\n }\n\n container.append(innerContainer);\n\n const caption = options.caption ?? options.captionOld;\n if(caption) {\n const el = this.caption = this.generateContentElement();\n el.classList.add(className + '-caption');\n\n if(!options.captionOld) {\n container.append(el);\n }\n\n if(caption !== true) {\n i18n_({element: el, key: caption, args: options.captionArgs});\n }\n }\n }\n\n public generateContentElement() {\n const content = document.createElement('div');\n content.classList.add(className + '-content');\n\n // if(this.fullWidth) {\n // content.classList.add('full-width');\n // }\n\n this.innerContainer.append(content);\n return content;\n }\n}\n\nexport const generateSection = (appendTo: Scrollable, name?: LangPackKey, caption?: LangPackKey) => {\n const section = new SettingSection({name, caption});\n appendTo.append(section.container);\n return section.content;\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {InputFile} from '../../../layer';\nimport appDialogsManager from '../../../lib/appManagers/appDialogsManager';\nimport InputField from '../../inputField';\nimport {SliderSuperTab} from '../../slider';\nimport AvatarEdit from '../../avatarEdit';\nimport I18n, {joinElementsWith} from '../../../lib/langPack';\nimport ButtonCorner from '../../buttonCorner';\nimport getUserStatusString from '../../wrappers/getUserStatusString';\nimport appImManager from '../../../lib/appManagers/appImManager';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport SettingSection from '../../settingSection';\n\ninterface OpenStreetMapInterface {\n place_id?: number;\n license?: string;\n osm_type?: string;\n osm_id?: number;\n lat?: string;\n lon?: string;\n display_name: string;\n address?: object;\n boundingbox?: object;\n}\n\nexport default class AppNewGroupTab extends SliderSuperTab {\n private avatarEdit: AvatarEdit;\n private uploadAvatar: () => Promise = null;\n private peerIds: PeerId[];\n private isGeoChat: boolean = false;\n private nextBtn: HTMLButtonElement;\n private groupNameInputField: InputField;\n private list: HTMLUListElement;\n private groupLocationInputField: InputField;\n private userLocationCoords: {lat: number, long: number};\n private userLocationAddress: string;\n\n public init(\n peerIds: PeerId[],\n isGeoChat: boolean = false\n ) {\n this.isGeoChat = isGeoChat;\n this.peerIds = peerIds;\n\n this.container.classList.add('new-group-container');\n this.setTitle('NewGroup');\n\n this.avatarEdit = new AvatarEdit((_upload) => {\n this.uploadAvatar = _upload;\n });\n\n const section = new SettingSection({});\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n this.groupNameInputField = new InputField({\n label: 'CreateGroup.NameHolder',\n maxLength: 128\n });\n\n this.groupLocationInputField = new InputField({\n label: 'ChatLocation',\n name: 'location',\n canBeEdited: false\n });\n\n inputWrapper.append(\n this.groupNameInputField.container,\n this.groupLocationInputField.container\n );\n\n this.listenerSetter.add(this.groupNameInputField.input)('input', () => {\n const value = this.groupNameInputField.value;\n let valueCheck = !!value.length && !this.groupNameInputField.input.classList.contains('error');\n if(this.isGeoChat) valueCheck = valueCheck && !!this.userLocationCoords && !!this.userLocationAddress;\n this.nextBtn.classList.toggle('is-visible', !!valueCheck);\n });\n\n this.nextBtn = ButtonCorner({icon: 'arrow_next'});\n\n attachClickEvent(this.nextBtn, () => {\n const title = this.groupNameInputField.value;\n\n let promise: Promise;\n if(this.isGeoChat) {\n if(!this.userLocationAddress || !this.userLocationCoords) return;\n promise = this.managers.appChatsManager.createChannel({\n title,\n about: '',\n geo_point: {\n _: 'inputGeoPoint',\n ...this.userLocationCoords\n },\n address: this.userLocationAddress,\n megagroup: true\n }).then((chatId) => {\n if(this.uploadAvatar) {\n this.uploadAvatar().then((inputFile) => {\n this.managers.appChatsManager.editPhoto(chatId, inputFile);\n });\n }\n\n if(this.peerIds.length) {\n this.managers.appChatsManager.inviteToChannel(chatId, this.peerIds);\n }\n\n return chatId;\n });\n } else {\n this.nextBtn.disabled = true;\n promise = this.managers.appChatsManager.createChat(title, this.peerIds.map((peerId) => peerId.toUserId())).then((chatId) => {\n if(this.uploadAvatar) {\n this.uploadAvatar().then((inputFile) => {\n this.managers.appChatsManager.editPhoto(chatId, inputFile);\n });\n }\n\n return chatId;\n });\n }\n\n if(!promise) {\n return;\n }\n\n promise.then((chatId) => {\n this.close();\n\n appImManager.setInnerPeer({peerId: chatId.toPeerId(true)});\n });\n }, {listenerSetter: this.listenerSetter});\n\n const chatsSection = new SettingSection({\n name: 'Members',\n nameArgs: [this.peerIds.length]\n });\n\n if(!this.peerIds.length) {\n chatsSection.container.classList.add('hide');\n }\n\n const list = this.list = appDialogsManager.createChatList({\n new: true\n });\n\n chatsSection.content.append(list);\n\n section.content.append(this.avatarEdit.container, inputWrapper);\n\n this.content.append(this.nextBtn);\n this.scrollable.append(section.container, chatsSection.container);\n\n if(isGeoChat) {\n this.setTitle('NearbyCreateGroup');\n this.groupLocationInputField.container.classList.remove('hide');\n this.groupLocationInputField.setValueSilently(I18n.format('Loading', true));\n this.startLocating();\n } else {\n this.groupLocationInputField.container.classList.add('hide');\n }\n\n const usersPromise = Promise.all(this.peerIds.map((peerId) => this.managers.appUsersManager.getUser(peerId.toUserId())));\n const myUserPromise = this.managers.appUsersManager.getSelf();\n\n const a = usersPromise.then((users) => {\n return users.map((user) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: user.id.toPeerId(false),\n container: this.list,\n rippleEnabled: false,\n avatarSize: 'abitbigger'\n });\n\n dom.lastMessageSpan.append(getUserStatusString(user));\n })\n });\n\n const setTitlePromise = this.peerIds.length > 0 && this.peerIds.length < 5 ? Promise.all([usersPromise, myUserPromise]).then(([users, myUser]) => {\n const names = users.map((user) => [user.first_name, user.last_name].filter(Boolean).join(' '));\n names.unshift(myUser.first_name);\n\n const joined = joinElementsWith(names, (isLast) => isLast ? ', ' : ' & ').join('');\n this.groupNameInputField.setDraftValue(joined);\n }) : Promise.resolve();\n\n return Promise.all([\n a,\n setTitlePromise\n ]);\n }\n\n public onCloseAfterTimeout() {\n this.avatarEdit.clear();\n this.uploadAvatar = null;\n this.groupNameInputField.value = '';\n this.groupLocationInputField.container.classList.add('hide');\n this.nextBtn.disabled = false;\n }\n\n private startLocating() {\n navigator.geolocation.getCurrentPosition((location) => {\n this.userLocationCoords = {\n lat: location.coords.latitude,\n long: location.coords.longitude\n };\n\n let uri = 'https://nominatim.openstreetmap.org/reverse';\n uri += '?lat='+location.coords.latitude;\n uri += '&lon='+location.coords.longitude;\n uri += '&format=json';\n uri += '&addressdetails=1';\n uri += '&accept-language=en';\n fetch(uri)\n .then((response) => response.json())\n .then((response: OpenStreetMapInterface) => {\n this.userLocationAddress = response.display_name;\n this.groupLocationInputField.setValueSilently(response.display_name);\n });\n }, (error) => {\n if(error instanceof GeolocationPositionError) {\n this.groupLocationInputField.setValueSilently('Location permission denied. Please retry later.');\n } else {\n this.groupLocationInputField.setValueSilently('An error has occurred. Please retry later.');\n }\n });\n }\n}\n","enum PrivacyType {\n Everybody = 2,\n Contacts = 1,\n Nobody = 0\n}\n\nexport default PrivacyType;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {PrivacyRule} from '../../../../layer';\nimport PrivacyType from './privacyType';\n\nexport default function getPrivacyRulesDetails(rules: PrivacyRule[]) {\n const types: PrivacyType[] = [];\n\n type peers = {users: UserId[], chats: ChatId[]};\n const allowPeers: peers = {users: [], chats: []}, disallowPeers: peers = {users: [], chats: []};\n rules.forEach((rule) => {\n switch(rule._) {\n case 'privacyValueAllowAll':\n types.push(2);\n break;\n case 'privacyValueDisallowAll':\n types.push(0);\n break;\n case 'privacyValueAllowContacts':\n types.push(1);\n break;\n /* case 'privacyValueDisallowContacts':\n types.push('Except My Contacts');\n break; */\n case 'privacyValueAllowChatParticipants':\n allowPeers.chats.push(...rule.chats);\n break;\n case 'privacyValueAllowUsers':\n allowPeers.users.push(...rule.users);\n break;\n case 'privacyValueDisallowChatParticipants':\n disallowPeers.chats.push(...rule.chats);\n break;\n case 'privacyValueDisallowUsers':\n disallowPeers.users.push(...rule.users);\n break;\n }\n });\n\n return {type: types[0], disallowPeers, allowPeers};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport replaceContent from '../helpers/dom/replaceContent';\nimport {randomLong} from '../helpers/random';\nimport {InputPrivacyKey, InputPrivacyRule} from '../layer';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport getPrivacyRulesDetails from '../lib/appManagers/utils/privacy/getPrivacyRulesDetails';\nimport PrivacyType from '../lib/appManagers/utils/privacy/privacyType';\nimport {i18n, join, LangPackKey, _i18n} from '../lib/langPack';\nimport RadioField from './radioField';\nimport Row, {RadioFormFromRows} from './row';\nimport Scrollable from './scrollable';\nimport SettingSection, {generateSection} from './settingSection';\nimport AppAddMembersTab from './sidebarLeft/tabs/addMembers';\nimport {SliderSuperTabEventable} from './sliderTab';\n\nexport type PrivacySectionStr = LangPackKey | '' | HTMLElement;\nexport default class PrivacySection {\n public radioRows: Map;\n public radioSection: SettingSection;\n public exceptions: Map;\n public peerIds: {\n disallow?: PeerId[],\n allow?: PeerId[]\n };\n public type: PrivacyType;\n\n constructor(public options: {\n tab: SliderSuperTabEventable,\n title: LangPackKey,\n inputKey: InputPrivacyKey['_'],\n captions?: [PrivacySectionStr, PrivacySectionStr, PrivacySectionStr],\n appendTo?: Scrollable,\n noExceptions?: boolean,\n onRadioChange?: (value: number) => any,\n skipTypes?: PrivacyType[],\n exceptionTexts?: [LangPackKey, LangPackKey],\n managers: AppManagers\n }) {\n if(options.captions) {\n options.captions.reverse();\n }\n\n const managers = options.managers;\n\n this.radioSection = new SettingSection({name: options.title, caption: true});\n\n this.radioRows = new Map();\n\n let r: Array<{type: PrivacyType, langKey: LangPackKey}> = [{\n type: PrivacyType.Everybody,\n langKey: 'PrivacySettingsController.Everbody'\n }, {\n type: PrivacyType.Contacts,\n langKey: 'PrivacySettingsController.MyContacts'\n }, {\n type: PrivacyType.Nobody,\n langKey: 'PrivacySettingsController.Nobody'\n }];\n\n if(options.skipTypes) {\n r = r.filter((r) => !options.skipTypes.includes(r.type));\n }\n\n const random = randomLong();\n r.forEach(({type, langKey}) => {\n const row = new Row({\n radioField: new RadioField({\n langKey,\n name: random,\n value: '' + type\n })\n });\n\n this.radioRows.set(type, row);\n });\n\n const form = RadioFormFromRows([...this.radioRows.values()], this.onRadioChange);\n\n this.radioSection.content.append(form);\n if(options.appendTo) {\n options.appendTo.append(this.radioSection.container);\n }\n\n if(!options.noExceptions) {\n const container = generateSection(options.appendTo, 'PrivacyExceptions', 'PrivacySettingsController.PeerInfo');\n\n this.exceptions = new Map([[\n 'disallow',\n {\n titleLangKey: options.exceptionTexts[0],\n key: 'disallow',\n row: null,\n icon: 'deleteuser',\n subtitleLangKey: 'PrivacySettingsController.AddUsers',\n clickable: true\n }\n ], [\n 'allow',\n {\n titleLangKey: options.exceptionTexts[1],\n key: 'allow',\n row: null,\n icon: 'adduser',\n subtitleLangKey: 'PrivacySettingsController.AddUsers',\n clickable: true\n }\n ]]);\n\n this.exceptions.forEach((exception) => {\n exception.row = new Row(exception);\n\n exception.row.container.addEventListener('click', () => {\n promise.then(() => {\n const _peerIds = this.peerIds[exception.key];\n options.tab.slider.createTab(AppAddMembersTab).open({\n type: 'privacy',\n skippable: true,\n title: exception.titleLangKey,\n placeholder: 'PrivacyModal.Search.Placeholder',\n takeOut: (newPeerIds) => {\n _peerIds.length = 0;\n _peerIds.push(...newPeerIds);\n exception.row.subtitle.innerHTML = '';\n exception.row.subtitle.append(...this.generateStr(this.splitPeersByType(newPeerIds)));\n },\n selectedPeerIds: _peerIds\n });\n });\n });\n\n container.append(exception.row.container);\n });\n }\n\n /* setTimeout(() => {\n this.setRadio(PrivacyType.Contacts);\n }, 0); */\n\n const promise = managers.appPrivacyManager.getPrivacy(options.inputKey).then((rules) => {\n const details = getPrivacyRulesDetails(rules);\n this.setRadio(details.type);\n\n if(this.exceptions) {\n this.peerIds = {};\n ['allow' as const, 'disallow' as const].forEach((k) => {\n const arr = [];\n const from = k === 'allow' ? details.allowPeers : details.disallowPeers;\n arr.push(...from.users.map((id) => id.toPeerId()));\n arr.push(...from.chats.map((id) => id.toPeerId(true)));\n this.peerIds[k] = arr;\n const s = this.exceptions.get(k).row.subtitle;\n s.innerHTML = '';\n s.append(...this.generateStr(from));\n });\n }\n\n options.tab.eventListener.addEventListener('destroy', async() => {\n const rules: InputPrivacyRule[] = [];\n\n switch(this.type) {\n case PrivacyType.Everybody:\n rules.push({_: 'inputPrivacyValueAllowAll'});\n break;\n case PrivacyType.Contacts:\n rules.push({_: 'inputPrivacyValueAllowContacts'});\n break;\n case PrivacyType.Nobody:\n rules.push({_: 'inputPrivacyValueDisallowAll'});\n break;\n }\n\n if(this.exceptions) {\n const a = ([\n ['allow', 'inputPrivacyValueAllowChatParticipants', 'inputPrivacyValueAllowUsers'],\n ['disallow', 'inputPrivacyValueDisallowChatParticipants', 'inputPrivacyValueDisallowUsers']\n ] as Array<[\n 'allow' | 'disallow',\n 'inputPrivacyValueAllowChatParticipants' | 'inputPrivacyValueDisallowChatParticipants',\n 'inputPrivacyValueAllowUsers' | 'inputPrivacyValueDisallowUsers'\n ]>);\n for(const [k, chatKey, usersKey] of a) {\n if(this.exceptions.get(k).row.container.classList.contains('hide')) {\n continue;\n }\n\n const _peerIds = this.peerIds[k];\n if(_peerIds) {\n const splitted = this.splitPeersByType(_peerIds);\n if(splitted.chats.length) {\n rules.push({_: chatKey, chats: splitted.chats});\n }\n\n if(splitted.users.length) {\n rules.push({\n _: usersKey,\n users: await Promise.all(splitted.users.map((id) => managers.appUsersManager.getUserInput(id)))\n });\n }\n }\n }\n }\n\n managers.appPrivacyManager.setPrivacy(options.inputKey, rules);\n }, {once: true});\n });\n }\n\n private onRadioChange = (value: string | PrivacySection['type']) => {\n value = +value as PrivacySection['type'];\n this.type = value;\n\n const caption = this.options.captions[this.type];\n const captionElement = this.radioSection.caption;\n if(!caption) {\n captionElement.innerHTML = '';\n } else if(caption instanceof HTMLElement) {\n replaceContent(captionElement, caption);\n } else {\n _i18n(captionElement, caption);\n }\n captionElement.classList.toggle('hide', !caption);\n\n if(this.exceptions) {\n this.exceptions.get('allow').row.container.classList.toggle('hide', this.type === PrivacyType.Everybody);\n this.exceptions.get('disallow').row.container.classList.toggle('hide', this.type === PrivacyType.Nobody);\n }\n\n this.options.onRadioChange && this.options.onRadioChange(value);\n };\n\n public setRadio(type: PrivacySection['type']) {\n const row = this.radioRows.get(type);\n this.onRadioChange(type);\n row.radioField.input.checked = true;\n }\n\n private splitPeersByType(peerIds: PeerId[]) {\n const peers = {users: [] as UserId[], chats: [] as ChatId[]};\n peerIds.forEach((peerId) => {\n peers[peerId.isAnyChat() ? 'chats' : 'users'].push(peerId.isAnyChat() ? peerId.toChatId() : peerId);\n });\n\n return peers;\n }\n\n private generateStr(peers: {users: UserId[], chats: ChatId[]}) {\n if(!peers.users.length && !peers.chats.length) {\n return [i18n('PrivacySettingsController.AddUsers')];\n }\n\n return join([\n peers.users.length ? i18n('Users', [peers.users.length]) : null,\n peers.chats.length ? i18n('Chats', [peers.chats.length]) : null\n ].filter(Boolean), false);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport PrivacySection from '../../../privacySection';\nimport {i18n, LangPackKey} from '../../../../lib/langPack';\nimport anchorCopy from '../../../../helpers/dom/anchorCopy';\nimport PrivacyType from '../../../../lib/appManagers/utils/privacy/privacyType';\n\nexport default class AppPrivacyPhoneNumberTab extends SliderSuperTabEventable {\n public async init() {\n this.container.classList.add('privacy-tab', 'privacy-phone-number');\n this.setTitle('PrivacyPhone');\n\n const formatted = '+' + (await this.managers.appUsersManager.getSelf()).phone;\n const captionEl = document.createElement('div');\n captionEl.append(\n i18n('PrivacyPhoneInfo'),\n document.createElement('br'),\n document.createElement('br'),\n i18n('PrivacyPhoneInfo4'),\n document.createElement('br'),\n anchorCopy({\n mePath: formatted\n })\n );\n\n const phoneSection = new PrivacySection({\n tab: this,\n title: 'PrivacyPhoneTitle',\n inputKey: 'inputPrivacyKeyPhoneNumber',\n captions: [captionEl, captionEl, ''],\n exceptionTexts: ['PrivacySettingsController.NeverShare', 'PrivacySettingsController.AlwaysShare'],\n appendTo: this.scrollable,\n onRadioChange: (type) => {\n s.setRadio(PrivacyType.Everybody);\n s.radioSection.container.classList.toggle('hide', type !== PrivacyType.Nobody);\n },\n managers: this.managers\n });\n\n const sCaption: LangPackKey = 'PrivacyPhoneInfo3';\n const s = new PrivacySection({\n tab: this,\n title: 'PrivacyPhoneTitle2',\n inputKey: 'inputPrivacyKeyAddedByPhone',\n captions: [sCaption, sCaption, ''],\n noExceptions: true,\n skipTypes: [PrivacyType.Nobody],\n managers: this.managers\n });\n\n this.scrollable.container.insertBefore(s.radioSection.container, phoneSection.radioSection.container.nextSibling);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from '../../../../helpers/dom/clickEvent';\nimport Button from '../../../button';\nimport SettingSection from '../../../settingSection';\nimport {SliderSuperTab} from '../../../slider';\nimport wrapStickerEmoji from '../../../wrappers/stickerEmoji';\nimport AppSettingsTab from '../settings';\n\nexport default class AppTwoStepVerificationSetTab extends SliderSuperTab {\n public init() {\n this.container.classList.add('two-step-verification', 'two-step-verification-set');\n this.setTitle('TwoStepVerificationPasswordSet');\n\n const section = new SettingSection({\n captionOld: 'TwoStepVerificationPasswordSetInfo',\n noDelimiter: true\n });\n\n const emoji = '🥳';\n const stickerContainer = document.createElement('div');\n\n wrapStickerEmoji({\n emoji,\n div: stickerContainer,\n width: 160,\n height: 160\n });\n\n section.content.append(stickerContainer);\n\n const inputContent = section.generateContentElement();\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const btnReturn = Button('btn-primary btn-color-primary', {text: 'TwoStepVerificationPasswordReturnSettings'});\n\n attachClickEvent(btnReturn, (e) => {\n this.close();\n });\n\n this.slider.sliceTabsUntilTab(AppSettingsTab, this);\n\n inputWrapper.append(btnReturn);\n\n inputContent.append(inputWrapper);\n\n this.scrollable.container.append(section.container);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {IS_MOBILE_SAFARI} from '../../environment/userAgent';\n\nexport function canFocus(isFirstInput: boolean) {\n return !IS_MOBILE_SAFARI || !isFirstInput;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AccountPassword} from '../../../../layer';\nimport Button from '../../../button';\nimport {SliderSuperTab} from '../../../slider';\nimport AppTwoStepVerificationSetTab from './passwordSet';\nimport CodeInputField from '../../../codeInputField';\nimport AppTwoStepVerificationEmailTab from './email';\nimport {putPreloader} from '../../../putPreloader';\nimport {i18n, _i18n} from '../../../../lib/langPack';\nimport {canFocus} from '../../../../helpers/dom/canFocus';\nimport {attachClickEvent} from '../../../../helpers/dom/clickEvent';\nimport replaceContent from '../../../../helpers/dom/replaceContent';\nimport toggleDisability from '../../../../helpers/dom/toggleDisability';\nimport wrapStickerEmoji from '../../../wrappers/stickerEmoji';\nimport SettingSection from '../../../settingSection';\n\nexport default class AppTwoStepVerificationEmailConfirmationTab extends SliderSuperTab {\n public codeInputField: CodeInputField;\n public state: AccountPassword;\n public email: string;\n public length: number;\n public isFirst = false;\n\n public init() {\n this.container.classList.add('two-step-verification', 'two-step-verification-email-confirmation');\n this.setTitle('TwoStepAuth.RecoveryTitle');\n\n const section = new SettingSection({\n captionOld: true,\n noDelimiter: true\n });\n\n _i18n(section.caption, 'TwoStepAuth.ConfirmEmailCodeDesc', [this.email]);\n\n const emoji = '📬';\n const stickerContainer = document.createElement('div');\n\n wrapStickerEmoji({\n div: stickerContainer,\n width: 160,\n height: 160,\n emoji\n });\n\n section.content.append(stickerContainer);\n\n const inputContent = section.generateContentElement();\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const inputField = this.codeInputField = new CodeInputField({\n name: 'recovery-email-code',\n label: 'TwoStepAuth.RecoveryCode',\n length: this.length,\n onFill: (code) => {\n freeze(true);\n\n this.managers.passwordManager.confirmPasswordEmail('' + code)\n .then((value) => {\n if(!value) {\n\n }\n\n goNext();\n })\n .catch((err) => {\n switch(err.type) {\n case 'CODE_INVALID':\n inputField.input.classList.add('error');\n replaceContent(inputField.label, i18n('TwoStepAuth.RecoveryCodeInvalid'));\n break;\n\n case 'EMAIL_HASH_EXPIRED':\n inputField.input.classList.add('error');\n replaceContent(inputField.label, i18n('TwoStepAuth.RecoveryCodeExpired'));\n break;\n\n default:\n console.error('confirm error', err);\n break;\n }\n\n freeze(false);\n });\n }\n });\n\n const btnChange = Button('btn-primary btn-primary-transparent primary', {text: 'TwoStepAuth.EmailCodeChangeEmail'});\n const btnResend = Button('btn-primary btn-secondary btn-primary-transparent primary', {text: 'ResendCode'});\n\n const goNext = () => {\n this.slider.createTab(AppTwoStepVerificationSetTab).open();\n };\n\n const freeze = (disable: boolean) => {\n toggleDisability([inputField.input, btnChange, btnResend], disable);\n };\n\n attachClickEvent(btnChange, (e) => {\n freeze(true);\n this.managers.passwordManager.cancelPasswordEmail().then((value) => {\n this.slider.sliceTabsUntilTab(AppTwoStepVerificationEmailTab, this);\n this.close();\n }, () => {\n freeze(false);\n });\n });\n\n attachClickEvent(btnResend, (e) => {\n freeze(true);\n const d = putPreloader(btnResend);\n this.managers.passwordManager.resendPasswordEmail().then((value) => {\n d.remove();\n freeze(false);\n });\n });\n\n inputWrapper.append(inputField.container, btnChange, btnResend);\n\n inputContent.append(inputWrapper);\n\n this.scrollable.container.append(section.container);\n }\n\n onOpenAfterTimeout() {\n if(!canFocus(this.isFirst)) return;\n this.codeInputField.input.focus();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AccountPassword} from '../../../../layer';\nimport Button from '../../../button';\nimport {SliderSuperTab} from '../../../slider';\nimport InputField from '../../../inputField';\nimport {putPreloader} from '../../../putPreloader';\nimport AppTwoStepVerificationSetTab from './passwordSet';\nimport AppTwoStepVerificationEmailConfirmationTab from './emailConfirmation';\nimport PopupPeer from '../../../popups/peer';\nimport cancelEvent from '../../../../helpers/dom/cancelEvent';\nimport {canFocus} from '../../../../helpers/dom/canFocus';\nimport {attachClickEvent} from '../../../../helpers/dom/clickEvent';\nimport matchEmail from '../../../../lib/richTextProcessor/matchEmail';\nimport wrapStickerEmoji from '../../../wrappers/stickerEmoji';\nimport SettingSection from '../../../settingSection';\nimport PopupElement from '../../../popups';\n\nexport default class AppTwoStepVerificationEmailTab extends SliderSuperTab {\n public inputField: InputField;\n public state: AccountPassword;\n public plainPassword: string;\n public newPassword: string;\n public hint: string;\n public isFirst = false;\n\n public init() {\n this.container.classList.add('two-step-verification', 'two-step-verification-email');\n this.setTitle('RecoveryEmailTitle');\n\n const section = new SettingSection({\n captionOld: true,\n noDelimiter: true\n });\n\n const emoji = '💌';\n const stickerContainer = document.createElement('div');\n\n wrapStickerEmoji({\n div: stickerContainer,\n width: 160,\n height: 160,\n emoji\n });\n\n section.content.append(stickerContainer);\n\n const inputContent = section.generateContentElement();\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const inputField = this.inputField = new InputField({\n name: 'recovery-email',\n label: 'RecoveryEmail',\n plainText: true\n });\n\n inputField.input.addEventListener('keypress', (e) => {\n if(e.key === 'Enter') {\n cancelEvent(e);\n return onContinueClick();\n }\n });\n\n inputField.input.addEventListener('input', (e) => {\n inputField.input.classList.remove('error');\n });\n\n const btnContinue = Button('btn-primary btn-color-primary', {text: 'Continue'});\n const btnSkip = Button('btn-primary btn-secondary btn-primary-transparent primary', {text: 'YourEmailSkip'});\n\n const goNext = () => {\n this.slider.createTab(AppTwoStepVerificationSetTab).open();\n };\n\n const onContinueClick = () => {\n const email = inputField.value.trim();\n const match = matchEmail(email);\n if(!match || match[0].length !== email.length) {\n inputField.input.classList.add('error');\n return;\n }\n\n toggleButtons(true);\n const d = putPreloader(btnContinue);\n\n this.managers.passwordManager.updateSettings({\n hint: this.hint,\n currentPassword: this.plainPassword,\n newPassword: this.newPassword,\n email\n }).then((value) => {\n goNext();\n }, (err) => {\n if(err.type.includes('EMAIL_UNCONFIRMED')) {\n const symbols = +err.type.match(/^EMAIL_UNCONFIRMED_(\\d+)/)[1];\n\n const tab = this.slider.createTab(AppTwoStepVerificationEmailConfirmationTab);\n tab.state = this.state;\n tab.email = email;\n tab.length = symbols;\n tab.open();\n } else {\n console.log('password set error', err);\n }\n\n toggleButtons(false);\n d.remove();\n });\n };\n attachClickEvent(btnContinue, onContinueClick);\n\n const toggleButtons = (freeze: boolean) => {\n if(freeze) {\n btnContinue.setAttribute('disabled', 'true');\n btnSkip.setAttribute('disabled', 'true');\n } else {\n btnContinue.removeAttribute('disabled');\n btnSkip.removeAttribute('disabled');\n }\n };\n\n attachClickEvent(btnSkip, (e) => {\n const popup = PopupElement.createPopup(PopupPeer, 'popup-skip-email', {\n buttons: [{\n langKey: 'Cancel',\n isCancel: true\n }, {\n langKey: 'YourEmailSkip',\n callback: () => {\n // inputContent.classList.add('sidebar-left-section-disabled');\n toggleButtons(true);\n putPreloader(btnSkip);\n this.managers.passwordManager.updateSettings({\n hint: this.hint,\n currentPassword: this.plainPassword,\n newPassword: this.newPassword,\n email: ''\n }).then(() => {\n goNext();\n }, (err) => {\n toggleButtons(false);\n });\n },\n isDanger: true\n }],\n titleLangKey: 'YourEmailSkipWarning',\n descriptionLangKey: 'YourEmailSkipWarningText'\n });\n\n popup.show();\n });\n\n inputWrapper.append(inputField.container, btnContinue, btnSkip);\n\n inputContent.append(inputWrapper);\n\n this.scrollable.container.append(section.container);\n }\n\n onOpenAfterTimeout() {\n if(!canFocus(this.isFirst)) return;\n this.inputField.input.focus();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AccountPassword} from '../../../../layer';\nimport Button from '../../../button';\nimport {SliderSuperTab} from '../../../slider';\nimport InputField from '../../../inputField';\nimport AppTwoStepVerificationEmailTab from './email';\nimport {toast} from '../../../toast';\nimport I18n from '../../../../lib/langPack';\nimport cancelEvent from '../../../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../../../helpers/dom/clickEvent';\nimport wrapStickerEmoji from '../../../wrappers/stickerEmoji';\nimport SettingSection from '../../../settingSection';\n\nexport default class AppTwoStepVerificationHintTab extends SliderSuperTab {\n public inputField: InputField;\n public state: AccountPassword;\n public plainPassword: string;\n public newPassword: string;\n\n public init() {\n this.container.classList.add('two-step-verification', 'two-step-verification-hint');\n this.setTitle('TwoStepAuth.SetupHintTitle');\n\n const section = new SettingSection({\n noDelimiter: true\n });\n\n const emoji = '💡';\n const stickerContainer = document.createElement('div');\n wrapStickerEmoji({\n div: stickerContainer,\n width: 160,\n height: 160,\n emoji\n });\n\n section.content.append(stickerContainer);\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const inputField = this.inputField = new InputField({\n name: 'hint',\n label: 'TwoStepAuth.SetupHintPlaceholder'\n });\n\n inputField.input.addEventListener('keypress', (e) => {\n if(e.key === 'Enter') {\n cancelEvent(e);\n return inputField.value ? onContinueClick() : onSkipClick();\n }\n });\n\n const goNext = (e?: Event, saveHint?: boolean) => {\n if(e) {\n cancelEvent(e);\n }\n\n const hint = saveHint ? inputField.value : undefined;\n if(hint && this.newPassword === hint) {\n toast(I18n.format('PasswordAsHintError', true));\n return;\n }\n\n const tab = this.slider.createTab(AppTwoStepVerificationEmailTab);\n tab.state = this.state;\n tab.plainPassword = this.plainPassword;\n tab.newPassword = this.newPassword;\n tab.hint = hint;\n\n tab.open();\n };\n\n const btnContinue = Button('btn-primary btn-color-primary', {text: 'Continue'});\n const btnSkip = Button('btn-primary btn-secondary btn-primary-transparent primary', {text: 'YourEmailSkip'});\n\n const onContinueClick = (e?: Event) => goNext(e, true);\n const onSkipClick = (e?: Event) => goNext(e, false);\n attachClickEvent(btnContinue, onContinueClick);\n attachClickEvent(btnSkip, onSkipClick);\n\n inputWrapper.append(inputField.container, btnContinue, btnSkip);\n\n section.content.append(inputWrapper);\n\n this.scrollable.container.append(section.container);\n }\n\n onOpenAfterTimeout() {\n this.inputField.input.focus();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AccountPassword} from '../../../../layer';\nimport Button from '../../../button';\nimport PasswordInputField from '../../../passwordInputField';\nimport {SliderSuperTab} from '../../../slider';\nimport TrackingMonkey from '../../../monkeys/tracking';\nimport AppTwoStepVerificationHintTab from './hint';\nimport {InputState} from '../../../inputField';\nimport cancelEvent from '../../../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../../../helpers/dom/clickEvent';\nimport SettingSection from '../../../settingSection';\n\nexport default class AppTwoStepVerificationReEnterPasswordTab extends SliderSuperTab {\n public state: AccountPassword;\n public passwordInputField: PasswordInputField;\n public plainPassword: string;\n public newPassword: string;\n\n public init() {\n this.container.classList.add('two-step-verification', 'two-step-verification-enter-password', 'two-step-verification-re-enter-password');\n this.setTitle('PleaseReEnterPassword');\n\n const section = new SettingSection({\n noDelimiter: true\n });\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const passwordInputField = this.passwordInputField = new PasswordInputField({\n name: 're-enter-password',\n label: 'PleaseReEnterPassword'\n });\n\n const monkey = new TrackingMonkey(passwordInputField, 157);\n\n const btnContinue = Button('btn-primary btn-color-primary', {text: 'Continue'});\n\n inputWrapper.append(passwordInputField.container, btnContinue);\n section.content.append(monkey.container, inputWrapper);\n\n this.scrollable.container.append(section.container);\n\n passwordInputField.input.addEventListener('keypress', (e) => {\n if(passwordInputField.input.classList.contains('error')) {\n passwordInputField.setState(InputState.Neutral);\n }\n\n if(e.key === 'Enter') {\n return onContinueClick();\n }\n });\n\n const verifyInput = () => {\n if(this.newPassword !== passwordInputField.value) {\n passwordInputField.setError();\n return false;\n }\n\n return true;\n };\n\n const onContinueClick = (e?: Event) => {\n if(e) {\n cancelEvent(e);\n }\n\n if(!verifyInput()) return;\n\n const tab = this.slider.createTab(AppTwoStepVerificationHintTab);\n tab.state = this.state;\n tab.plainPassword = this.plainPassword;\n tab.newPassword = this.newPassword;\n tab.open();\n };\n attachClickEvent(btnContinue, onContinueClick);\n\n return monkey.load();\n }\n\n onOpenAfterTimeout() {\n this.passwordInputField.input.focus();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport AppTwoStepVerificationTab from '.';\nimport cancelEvent from '../../../../helpers/dom/cancelEvent';\nimport {canFocus} from '../../../../helpers/dom/canFocus';\nimport {attachClickEvent} from '../../../../helpers/dom/clickEvent';\nimport replaceContent from '../../../../helpers/dom/replaceContent';\nimport setInnerHTML from '../../../../helpers/dom/setInnerHTML';\nimport {AccountPassword} from '../../../../layer';\nimport I18n, {i18n} from '../../../../lib/langPack';\nimport wrapEmojiText from '../../../../lib/richTextProcessor/wrapEmojiText';\nimport Button from '../../../button';\nimport {putPreloader} from '../../../putPreloader';\nimport PasswordMonkey from '../../../monkeys/password';\nimport PasswordInputField from '../../../passwordInputField';\nimport {SliderSuperTab} from '../../../slider';\nimport AppTwoStepVerificationReEnterPasswordTab from './reEnterPassword';\nimport SettingSection from '../../../settingSection';\n\nexport default class AppTwoStepVerificationEnterPasswordTab extends SliderSuperTab {\n public state: AccountPassword;\n public passwordInputField: PasswordInputField;\n public plainPassword: string;\n public isFirst = true;\n\n public init() {\n const isNew = !this.state.pFlags.has_password || this.plainPassword;\n this.container.classList.add('two-step-verification', 'two-step-verification-enter-password');\n this.setTitle(isNew ? 'PleaseEnterFirstPassword' : 'PleaseEnterCurrentPassword');\n\n const section = new SettingSection({\n noDelimiter: true\n });\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const passwordInputField = this.passwordInputField = new PasswordInputField({\n name: 'enter-password',\n label: isNew ? 'PleaseEnterFirstPassword' : (this.state.hint ? undefined : 'LoginPassword'),\n labelText: !isNew && this.state.hint ? wrapEmojiText(this.state.hint) : undefined\n });\n\n const monkey = new PasswordMonkey(passwordInputField, 157);\n\n const btnContinue = Button('btn-primary btn-color-primary');\n const textEl = new I18n.IntlElement({key: 'Continue'});\n\n btnContinue.append(textEl.element);\n\n inputWrapper.append(passwordInputField.container, btnContinue);\n section.content.append(monkey.container, inputWrapper);\n\n this.scrollable.container.append(section.container);\n\n passwordInputField.input.addEventListener('keypress', (e) => {\n if(passwordInputField.input.classList.contains('error')) {\n passwordInputField.input.classList.remove('error');\n textEl.key = 'Continue';\n textEl.update();\n }\n\n if(e.key === 'Enter') {\n return onContinueClick();\n }\n });\n\n const verifyInput = () => {\n if(!passwordInputField.value.length) {\n passwordInputField.input.classList.add('error');\n return false;\n }\n\n return true;\n };\n\n let onContinueClick: (e?: Event) => void;\n if(!isNew) {\n let getStateInterval: number;\n\n const getState = () => {\n // * just to check session relevance\n if(!getStateInterval) {\n getStateInterval = window.setInterval(getState, 10e3);\n }\n\n return this.managers.passwordManager.getState().then((_state) => {\n this.state = _state;\n\n if(this.state.hint) {\n setInnerHTML(passwordInputField.label, wrapEmojiText(this.state.hint));\n } else {\n replaceContent(passwordInputField.label, i18n('LoginPassword'));\n }\n });\n };\n\n const submit = (e?: Event) => {\n if(!verifyInput()) {\n cancelEvent(e);\n return;\n }\n\n btnContinue.setAttribute('disabled', 'true');\n textEl.key = 'PleaseWait';\n textEl.update();\n const preloader = putPreloader(btnContinue);\n\n const plainPassword = passwordInputField.value;\n this.managers.passwordManager.check(passwordInputField.value, this.state).then((auth) => {\n console.log(auth);\n\n if(auth._ === 'auth.authorization') {\n clearInterval(getStateInterval);\n if(monkey) monkey.remove();\n const tab = this.slider.createTab(AppTwoStepVerificationTab);\n tab.state = this.state;\n tab.plainPassword = plainPassword;\n tab.open();\n this.slider.removeTabFromHistory(this);\n }\n }, (err) => {\n btnContinue.removeAttribute('disabled');\n passwordInputField.input.classList.add('error');\n\n switch(err.type) {\n default:\n // btnContinue.innerText = err.type;\n textEl.key = 'PASSWORD_HASH_INVALID';\n textEl.update();\n preloader.remove();\n passwordInputField.select();\n break;\n }\n\n getState();\n });\n };\n\n onContinueClick = submit;\n\n getState();\n } else {\n onContinueClick = (e) => {\n if(e) {\n cancelEvent(e);\n }\n\n if(!verifyInput()) return;\n\n const tab = this.slider.createTab(AppTwoStepVerificationReEnterPasswordTab);\n tab.state = this.state;\n tab.newPassword = passwordInputField.value;\n tab.plainPassword = this.plainPassword;\n tab.open();\n };\n }\n\n attachClickEvent(btnContinue, onContinueClick);\n\n return monkey.load();\n }\n\n onOpenAfterTimeout() {\n if(!canFocus(this.isFirst)) return;\n this.passwordInputField.input.focus();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from '../../../../helpers/dom/clickEvent';\nimport {AccountPassword} from '../../../../layer';\nimport {_i18n} from '../../../../lib/langPack';\nimport Button from '../../../button';\nimport PopupElement from '../../../popups';\nimport PopupPeer from '../../../popups/peer';\nimport SettingSection from '../../../settingSection';\nimport {SliderSuperTab} from '../../../slider';\nimport wrapStickerEmoji from '../../../wrappers/stickerEmoji';\nimport AppSettingsTab from '../settings';\nimport AppTwoStepVerificationEmailTab from './email';\nimport AppTwoStepVerificationEnterPasswordTab from './enterPassword';\n\nexport default class AppTwoStepVerificationTab extends SliderSuperTab {\n public state: AccountPassword;\n public plainPassword: string;\n\n public init() {\n this.container.classList.add('two-step-verification', 'two-step-verification-main');\n this.setTitle('TwoStepVerificationTitle');\n\n const section = new SettingSection({\n captionOld: true,\n noDelimiter: true\n });\n\n const emoji = '🔐';\n const stickerContainer = document.createElement('div');\n\n wrapStickerEmoji({\n div: stickerContainer,\n width: 168,\n height: 168,\n emoji\n });\n\n section.content.append(stickerContainer);\n\n const c = section.generateContentElement();\n if(this.state.pFlags.has_password) {\n _i18n(section.caption, 'TwoStepAuth.GenericHelp');\n\n const btnChangePassword = Button('btn-primary btn-transparent', {icon: 'edit', text: 'TwoStepAuth.ChangePassword'});\n const btnDisablePassword = Button('btn-primary btn-transparent', {icon: 'passwordoff', text: 'TwoStepAuth.RemovePassword'});\n const btnSetRecoveryEmail = Button('btn-primary btn-transparent', {icon: 'email', text: this.state.pFlags.has_recovery ? 'TwoStepAuth.ChangeEmail' : 'TwoStepAuth.SetupEmail'});\n\n attachClickEvent(btnChangePassword, () => {\n const tab = this.slider.createTab(AppTwoStepVerificationEnterPasswordTab);\n tab.state = this.state;\n tab.plainPassword = this.plainPassword;\n tab.open();\n });\n\n attachClickEvent(btnDisablePassword, () => {\n const popup = PopupElement.createPopup(PopupPeer, 'popup-disable-password', {\n buttons: [{\n langKey: 'Disable',\n callback: () => {\n this.managers.passwordManager.updateSettings({currentPassword: this.plainPassword}).then(() => {\n this.slider.sliceTabsUntilTab(AppSettingsTab, this);\n this.close();\n });\n },\n isDanger: true\n }],\n titleLangKey: 'TurnPasswordOffQuestionTitle',\n descriptionLangKey: 'TurnPasswordOffQuestion'\n });\n\n popup.show();\n });\n\n attachClickEvent(btnSetRecoveryEmail, () => {\n const tab = this.slider.createTab(AppTwoStepVerificationEmailTab);\n tab.state = this.state;\n tab.hint = this.state.hint;\n tab.plainPassword = this.plainPassword;\n tab.newPassword = this.plainPassword;\n tab.isFirst = true;\n tab.open();\n });\n\n c.append(btnChangePassword, btnDisablePassword, btnSetRecoveryEmail);\n } else {\n _i18n(section.caption, 'TwoStepAuth.SetPasswordHelp');\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const btnSetPassword = Button('btn-primary btn-color-primary', {text: 'TwoStepVerificationSetPassword'});\n\n inputWrapper.append(btnSetPassword);\n c.append(inputWrapper);\n\n attachClickEvent(btnSetPassword, (e) => {\n const tab = this.slider.createTab(AppTwoStepVerificationEnterPasswordTab);\n tab.state = this.state;\n tab.open();\n });\n }\n\n this.scrollable.container.append(section.container);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport PrivacySection from '../../../privacySection';\nimport {LangPackKey} from '../../../../lib/langPack';\n\nexport default class AppPrivacyLastSeenTab extends SliderSuperTabEventable {\n public init() {\n this.container.classList.add('privacy-tab', 'privacy-last-seen');\n this.setTitle('PrivacyLastSeen');\n\n const caption: LangPackKey = 'PrivacySettingsController.LastSeenDescription';\n new PrivacySection({\n tab: this,\n title: 'LastSeenTitle',\n inputKey: 'inputPrivacyKeyStatusTimestamp',\n captions: [caption, caption, caption],\n exceptionTexts: ['PrivacySettingsController.NeverShare', 'PrivacySettingsController.AlwaysShare'],\n appendTo: this.scrollable,\n managers: this.managers\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport PrivacySection from '../../../privacySection';\nimport {LangPackKey} from '../../../../lib/langPack';\nimport PrivacyType from '../../../../lib/appManagers/utils/privacy/privacyType';\n\nexport default class AppPrivacyProfilePhotoTab extends SliderSuperTabEventable {\n public init() {\n this.container.classList.add('privacy-tab', 'privacy-profile-photo');\n this.setTitle('PrivacyProfilePhoto');\n\n const caption: LangPackKey = 'PrivacySettingsController.ProfilePhoto.CustomHelp';\n new PrivacySection({\n tab: this,\n title: 'PrivacyProfilePhotoTitle',\n inputKey: 'inputPrivacyKeyProfilePhoto',\n captions: [caption, caption, caption],\n exceptionTexts: ['PrivacySettingsController.NeverShare', 'PrivacySettingsController.AlwaysShare'],\n appendTo: this.scrollable,\n skipTypes: [PrivacyType.Nobody],\n managers: this.managers\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport PrivacySection from '../../../privacySection';\nimport {LangPackKey} from '../../../../lib/langPack';\n\nexport default class AppPrivacyForwardMessagesTab extends SliderSuperTabEventable {\n public init() {\n this.container.classList.add('privacy-tab', 'privacy-forward-messages');\n this.setTitle('PrivacySettings.Forwards');\n\n const caption: LangPackKey = 'PrivacySettingsController.Forwards.CustomHelp';\n new PrivacySection({\n tab: this,\n title: 'PrivacyForwardsTitle',\n inputKey: 'inputPrivacyKeyForwards',\n captions: [caption, caption, caption],\n exceptionTexts: ['PrivacySettingsController.NeverAllow', 'PrivacySettingsController.AlwaysAllow'],\n appendTo: this.scrollable,\n managers: this.managers\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport PrivacySection from '../../../privacySection';\nimport {LangPackKey} from '../../../../lib/langPack';\nimport PrivacyType from '../../../../lib/appManagers/utils/privacy/privacyType';\n\nexport default class AppPrivacyAddToGroupsTab extends SliderSuperTabEventable {\n public init() {\n this.container.classList.add('privacy-tab', 'privacy-add-to-groups');\n this.setTitle('PrivacySettings.Groups');\n\n const caption: LangPackKey = 'PrivacySettingsController.GroupDescription';\n new PrivacySection({\n tab: this,\n title: 'WhoCanAddMe',\n inputKey: 'inputPrivacyKeyChatInvite',\n captions: [caption, caption, caption],\n exceptionTexts: ['PrivacySettingsController.NeverAllow', 'PrivacySettingsController.AlwaysAllow'],\n appendTo: this.scrollable,\n skipTypes: [PrivacyType.Nobody],\n managers: this.managers\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport PrivacySection from '../../../privacySection';\nimport {LangPackKey} from '../../../../lib/langPack';\n\nexport default class AppPrivacyCallsTab extends SliderSuperTabEventable {\n public init() {\n this.container.classList.add('privacy-tab', 'privacy-calls');\n this.setTitle('PrivacySettings.VoiceCalls');\n\n const caption: LangPackKey = 'PrivacySettingsController.PhoneCallDescription';\n new PrivacySection({\n tab: this,\n title: 'WhoCanCallMe',\n inputKey: 'inputPrivacyKeyPhoneCall',\n captions: [caption, caption, caption],\n exceptionTexts: ['PrivacySettingsController.NeverAllow', 'PrivacySettingsController.AlwaysAllow'],\n appendTo: this.scrollable,\n managers: this.managers\n });\n\n {\n const caption: LangPackKey = 'PrivacySettingsController.P2p.Desc';\n new PrivacySection({\n tab: this,\n title: 'PrivacyP2PHeader',\n inputKey: 'inputPrivacyKeyPhoneP2P',\n captions: [caption, caption, caption],\n exceptionTexts: ['PrivacySettingsController.NeverAllow', 'PrivacySettingsController.AlwaysAllow'],\n appendTo: this.scrollable,\n managers: this.managers\n });\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Button from '../../button';\nimport Row from '../../row';\nimport {Authorization} from '../../../layer';\nimport {formatDateAccordingToTodayNew} from '../../../helpers/date';\nimport {ButtonMenuSync} from '../../buttonMenu';\nimport {toast} from '../../toast';\nimport I18n from '../../../lib/langPack';\nimport PopupPeer from '../../popups/peer';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport {SliderSuperTabEventable} from '../../sliderTab';\nimport findAndSplice from '../../../helpers/array/findAndSplice';\nimport {attachContextMenuListener} from '../../../helpers/dom/attachContextMenuListener';\nimport positionMenu from '../../../helpers/positionMenu';\nimport contextMenuController from '../../../helpers/contextMenuController';\nimport SettingSection from '../../settingSection';\nimport PopupElement from '../../popups';\n\nexport default class AppActiveSessionsTab extends SliderSuperTabEventable {\n public authorizations: Authorization.authorization[];\n private menuElement: HTMLElement;\n\n public init() {\n this.container.classList.add('active-sessions-container');\n this.setTitle('SessionsTitle');\n\n const Session = (auth: Authorization.authorization) => {\n const row = new Row({\n title: [auth.app_name, auth.app_version].join(' '),\n subtitle: [auth.ip, auth.country].join(' - '),\n clickable: true,\n titleRight: auth.pFlags.current ? undefined : formatDateAccordingToTodayNew(new Date(Math.max(auth.date_active, auth.date_created) * 1000))\n });\n\n row.container.dataset.hash = '' + auth.hash;\n\n row.midtitle.textContent = [auth.device_model, auth.system_version || auth.platform].filter(Boolean).join(', ');\n\n return row;\n };\n\n const authorizations = this.authorizations.slice();\n\n {\n const section = new SettingSection({\n name: 'CurrentSession',\n caption: 'ClearOtherSessionsHelp'\n });\n\n const auth = findAndSplice(authorizations, auth => auth.pFlags.current);\n const session = Session(auth);\n\n section.content.append(session.container);\n\n if(authorizations.length) {\n const btnTerminate = Button('btn-primary btn-transparent danger', {icon: 'stop', text: 'TerminateAllSessions'});\n attachClickEvent(btnTerminate, (e) => {\n PopupElement.createPopup(PopupPeer, 'revoke-session', {\n buttons: [{\n langKey: 'Terminate',\n isDanger: true,\n callback: () => {\n const toggle = toggleDisability([btnTerminate], true);\n this.managers.apiManager.invokeApi('auth.resetAuthorizations').then((value) => {\n // toggleDisability([btnTerminate], false);\n btnTerminate.remove();\n otherSection.container.remove();\n }, onError).finally(() => {\n toggle();\n });\n }\n }],\n titleLangKey: 'AreYouSureSessionsTitle',\n descriptionLangKey: 'AreYouSureSessions'\n }).show();\n }, {listenerSetter: this.listenerSetter});\n\n section.content.append(btnTerminate);\n }\n\n this.scrollable.append(section.container);\n }\n\n if(!authorizations.length) {\n return;\n }\n\n const otherSection = new SettingSection({\n name: 'OtherSessions',\n caption: 'SessionsListInfo'\n });\n\n authorizations.forEach((auth) => {\n otherSection.content.append(Session(auth).container);\n });\n\n this.scrollable.append(otherSection.container);\n\n const onError = (err: any) => {\n if(err.type === 'FRESH_RESET_AUTHORISATION_FORBIDDEN') {\n toast(I18n.format('RecentSessions.Error.FreshReset', true));\n }\n };\n\n let target: HTMLElement;\n const onTerminateClick = () => {\n const hash = target.dataset.hash;\n\n PopupElement.createPopup(PopupPeer, 'revoke-session', {\n buttons: [{\n langKey: 'Terminate',\n isDanger: true,\n callback: () => {\n this.managers.apiManager.invokeApi('account.resetAuthorization', {hash})\n .then((value) => {\n if(value) {\n target.remove();\n }\n }, onError);\n }\n }],\n titleLangKey: 'AreYouSureSessionTitle',\n descriptionLangKey: 'TerminateSessionText'\n }).show();\n };\n\n const element = this.menuElement = ButtonMenuSync({\n buttons: [{\n icon: 'stop',\n text: 'Terminate',\n onClick: onTerminateClick\n }]\n });\n element.id = 'active-sessions-contextmenu';\n element.classList.add('contextmenu');\n\n document.getElementById('page-chats').append(element);\n\n attachContextMenuListener({\n element: this.scrollable.container,\n callback: (e) => {\n target = findUpClassName(e.target, 'row');\n if(!target || target.dataset.hash === '0') {\n return;\n }\n\n if(e instanceof MouseEvent) e.preventDefault();\n // smth\n if(e instanceof MouseEvent) e.cancelBubble = true;\n\n positionMenu(e, element);\n contextMenuController.openBtnMenu(element);\n },\n listenerSetter: this.listenerSetter\n });\n\n attachClickEvent(this.scrollable.container, (e) => {\n target = findUpClassName(e.target, 'row');\n if(!target || target.dataset.hash === '0') {\n return;\n }\n\n onTerminateClick();\n }, {listenerSetter: this.listenerSetter});\n }\n\n onCloseAfterTimeout() {\n this.menuElement?.remove();\n return super.onCloseAfterTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider';\nimport {ButtonMenuSync} from '../../buttonMenu';\nimport appDialogsManager, {DIALOG_LIST_ELEMENT_TAG} from '../../../lib/appManagers/appDialogsManager';\nimport PopupPickUser from '../../popups/pickUser';\nimport rootScope from '../../../lib/rootScope';\nimport findUpTag from '../../../helpers/dom/findUpTag';\nimport ButtonCorner from '../../buttonCorner';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport formatUserPhone from '../../wrappers/formatUserPhone';\nimport getUserStatusString from '../../wrappers/getUserStatusString';\nimport {attachContextMenuListener} from '../../../helpers/dom/attachContextMenuListener';\nimport positionMenu from '../../../helpers/positionMenu';\nimport contextMenuController from '../../../helpers/contextMenuController';\nimport getPeerActiveUsernames from '../../../lib/appManagers/utils/peers/getPeerActiveUsernames';\nimport SettingSection from '../../settingSection';\nimport PopupElement from '../../popups';\n\nexport default class AppBlockedUsersTab extends SliderSuperTab {\n public peerIds: PeerId[];\n private menuElement: HTMLElement;\n\n public init() {\n this.container.classList.add('blocked-users-container');\n this.setTitle('BlockedUsers');\n\n const section = new SettingSection({\n caption: 'BlockedUsersInfo'\n });\n\n section.caption.parentElement.prepend(section.caption);\n\n this.scrollable.append(section.container);\n\n const btnAdd = ButtonCorner({icon: 'add', className: 'is-visible'});\n this.content.append(btnAdd);\n\n attachClickEvent(btnAdd, (e) => {\n PopupElement.createPopup(PopupPickUser, {\n peerTypes: ['contacts'],\n placeholder: 'BlockModal.Search.Placeholder',\n onSelect: (peerId) => {\n // console.log('block', peerId);\n this.managers.appUsersManager.toggleBlock(peerId, true);\n }\n });\n }, {listenerSetter: this.listenerSetter});\n\n const list = appDialogsManager.createChatList();\n this.scrollable.container.classList.add('chatlist-container');\n section.content.append(list);\n\n const add = async(peerId: PeerId, append: boolean) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: peerId,\n container: list,\n rippleEnabled: true,\n avatarSize: 'abitbigger',\n append\n });\n\n const user = await this.managers.appUsersManager.getUser(peerId.toUserId());\n if(!user) {\n return;\n }\n\n const usernames = getPeerActiveUsernames(user);\n const username = usernames[0];\n if(user.pFlags.bot) {\n dom.lastMessageSpan.append('@' + username);\n } else {\n if(user.phone) dom.lastMessageSpan.innerHTML = formatUserPhone(user.phone);\n else dom.lastMessageSpan.append(username ? '@' + username : getUserStatusString(user));\n }\n\n // dom.titleSpan.innerHTML = 'Raaid El Syed';\n // dom.lastMessageSpan.innerHTML = '+1 234 567891';\n };\n\n for(const peerId of this.peerIds) {\n add(peerId, true);\n }\n\n let target: HTMLElement;\n const onUnblock = () => {\n const peerId = target.dataset.peerId.toPeerId();\n this.managers.appUsersManager.toggleBlock(peerId, false);\n };\n\n const element = this.menuElement = ButtonMenuSync({\n buttons: [{\n icon: 'lockoff',\n text: 'Unblock',\n onClick: onUnblock,\n options: {listenerSetter: this.listenerSetter}\n }]\n });\n element.id = 'blocked-users-contextmenu';\n element.classList.add('contextmenu');\n\n document.getElementById('page-chats').append(element);\n\n attachContextMenuListener({\n element: this.scrollable.container,\n callback: (e) => {\n target = findUpTag(e.target, DIALOG_LIST_ELEMENT_TAG);\n if(!target) {\n return;\n }\n\n if(e instanceof MouseEvent) e.preventDefault();\n // smth\n if(e instanceof MouseEvent) e.cancelBubble = true;\n\n positionMenu(e, element);\n contextMenuController.openBtnMenu(element);\n },\n listenerSetter: this.listenerSetter\n });\n\n this.listenerSetter.add(rootScope)('peer_block', (update) => {\n const {peerId, blocked} = update;\n const li = list.querySelector(`[data-peer-id=\"${peerId}\"]`);\n if(blocked) {\n if(!li) {\n add(peerId, false);\n }\n } else {\n if(li) {\n li.remove();\n }\n }\n });\n\n const LOAD_COUNT = 50;\n let loading = false;\n this.scrollable.onScrolledBottom = () => {\n if(loading) {\n return;\n }\n\n loading = true;\n this.managers.appUsersManager.getBlocked(list.childElementCount, LOAD_COUNT).then((res) => {\n for(const peerId of res.peerIds) {\n add(peerId, true);\n }\n\n if(res.peerIds.length < LOAD_COUNT || list.childElementCount === res.count) {\n this.scrollable.onScrolledBottom = null;\n }\n\n this.scrollable.checkForTriggers();\n }).finally(() => {\n loading = false;\n });\n };\n }\n\n onOpenAfterTimeout() {\n this.scrollable.onScroll();\n }\n\n onCloseAfterTimeout() {\n if(this.menuElement) {\n this.menuElement.remove();\n }\n\n return super.onCloseAfterTimeout();\n }\n}\n","export default function convertKeyToInputKey(key: string) {\n key = key[0].toUpperCase() + key.slice(1);\n key = 'input' + key;\n return key;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport PrivacySection from '../../../privacySection';\nimport {LangPackKey} from '../../../../lib/langPack';\n\nexport default class AppPrivacyVoicesTab extends SliderSuperTabEventable {\n public init() {\n this.container.classList.add('privacy-tab', 'privacy-voices');\n this.setTitle('PrivacyVoiceMessages');\n\n const caption: LangPackKey = 'PrivacyVoiceMessagesInfo';\n new PrivacySection({\n tab: this,\n title: 'PrivacyVoiceMessagesTitle',\n inputKey: 'inputPrivacyKeyVoiceMessages',\n captions: [caption, caption, caption],\n exceptionTexts: ['PrivacySettingsController.NeverAllow', 'PrivacySettingsController.AlwaysAllow'],\n appendTo: this.scrollable,\n managers: this.managers\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {formatDateAccordingToTodayNew} from '../../../helpers/date';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport {WebAuthorization} from '../../../layer';\nimport AvatarElement from '../../avatar';\nimport Button from '../../button';\nimport confirmationPopup from '../../confirmationPopup';\nimport Row from '../../row';\nimport SettingSection from '../../settingSection';\nimport {SliderSuperTabEventable} from '../../sliderTab';\nimport wrapPeerTitle from '../../wrappers/peerTitle';\n\nexport default class AppActiveWebSessionsTab extends SliderSuperTabEventable {\n public async init(sessions: WebAuthorization[]) {\n this.container.classList.add('active-sessions-container');\n this.setTitle('WebSessionsTitle');\n\n const Session = async(auth: WebAuthorization) => {\n const peerId = auth.bot_id.toPeerId();\n const row = new Row({\n title: await wrapPeerTitle({peerId}),\n subtitle: [auth.ip, auth.region].join(' - '),\n clickable: true,\n titleRight: formatDateAccordingToTodayNew(new Date(Math.max(auth.date_active, auth.date_created) * 1000))\n });\n\n const media = row.createMedia('big');\n const avatar = new AvatarElement();\n avatar.classList.add('avatar-48');\n await avatar.updateWithOptions({peerId});\n media.append(avatar);\n\n row.container.dataset.hash = '' + auth.hash;\n row.container.dataset.peerId = '' + peerId;\n\n row.midtitle.textContent = [auth.domain, auth.browser, auth.platform].filter(Boolean).join(', ');\n\n return row;\n };\n\n {\n const section = new SettingSection({\n caption: 'ClearOtherWebSessionsHelp'\n });\n\n const btnTerminate = Button('btn-primary btn-transparent danger', {icon: 'stop', text: 'TerminateAllWebSessions'});\n\n attachClickEvent(btnTerminate, async() => {\n await confirmationPopup({\n descriptionLangKey: 'AreYouSureWebSessions',\n button: {\n langKey: 'Disconnect',\n isDanger: true\n }\n });\n\n const toggle = toggleDisability([btnTerminate], true);\n this.managers.appSeamlessLoginManager.resetWebAuthorizations().then(() => {\n this.close();\n });\n }, {listenerSetter: this.listenerSetter});\n\n section.content.append(btnTerminate);\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({\n name: 'OtherWebSessions',\n caption: 'TerminateWebSessionInfo'\n });\n\n const rows = await Promise.all(sessions.map(Session));\n section.content.append(...rows.map((row) => row.container));\n\n let leftLength = rows.length;\n attachClickEvent(section.content, async(e) => {\n const row = findUpClassName(e.target, 'row');\n if(!row) {\n return;\n }\n\n await confirmationPopup({\n descriptionLangKey: 'TerminateWebSessionText',\n descriptionLangArgs: [await wrapPeerTitle({peerId: row.dataset.peerId.toPeerId()})],\n button: {\n langKey: 'Disconnect',\n isDanger: true\n }\n });\n\n const hash = row.dataset.hash;\n row.classList.add('is-disabled');\n this.managers.appSeamlessLoginManager.resetWebAuthorization(hash).then(() => {\n if(!--leftLength) {\n this.close();\n } else {\n row.remove();\n }\n });\n }, {listenerSetter: this.listenerSetter});\n\n this.scrollable.append(section.container);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport SliderSuperTab, {SliderSuperTabEventable} from '../../sliderTab';\nimport Row from '../../row';\nimport {AccountPassword, Authorization, InputPrivacyKey, Updates, WebAuthorization} from '../../../layer';\nimport AppPrivacyPhoneNumberTab from './privacy/phoneNumber';\nimport AppTwoStepVerificationTab from './2fa';\nimport AppTwoStepVerificationEnterPasswordTab from './2fa/enterPassword';\nimport AppTwoStepVerificationEmailConfirmationTab from './2fa/emailConfirmation';\nimport AppPrivacyLastSeenTab from './privacy/lastSeen';\nimport AppPrivacyProfilePhotoTab from './privacy/profilePhoto';\nimport AppPrivacyForwardMessagesTab from './privacy/forwardMessages';\nimport AppPrivacyAddToGroupsTab from './privacy/addToGroups';\nimport AppPrivacyCallsTab from './privacy/calls';\nimport AppActiveSessionsTab from './activeSessions';\nimport AppBlockedUsersTab from './blockedUsers';\nimport rootScope from '../../../lib/rootScope';\nimport {i18n, LangPackKey, _i18n} from '../../../lib/langPack';\nimport replaceContent from '../../../helpers/dom/replaceContent';\nimport CheckboxField from '../../checkboxField';\nimport PopupPeer from '../../popups/peer';\nimport Button from '../../button';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport convertKeyToInputKey from '../../../helpers/string/convertKeyToInputKey';\nimport getPrivacyRulesDetails from '../../../lib/appManagers/utils/privacy/getPrivacyRulesDetails';\nimport PrivacyType from '../../../lib/appManagers/utils/privacy/privacyType';\nimport confirmationPopup, {PopupConfirmationOptions} from '../../confirmationPopup';\nimport noop from '../../../helpers/noop';\nimport {toastNew} from '../../toast';\nimport AppPrivacyVoicesTab from './privacy/voices';\nimport SettingSection from '../../settingSection';\nimport AppActiveWebSessionsTab from './activeWebSessions';\nimport PopupElement from '../../popups';\n\nexport default class AppPrivacyAndSecurityTab extends SliderSuperTabEventable {\n private activeSessionsRow: Row;\n private authorizations: Authorization.authorization[];\n\n private websitesRow: Row;\n private websites: WebAuthorization[];\n\n public static getInitArgs(fromTab: SliderSuperTab) {\n return {\n appConfig: fromTab.managers.apiManager.getAppConfig(),\n globalPrivacy: fromTab.managers.appPrivacyManager.getGlobalPrivacySettings(),\n contentSettings: fromTab.managers.apiManager.invokeApi('account.getContentSettings'),\n webAuthorizations: fromTab.managers.appSeamlessLoginManager.getWebAuthorizations()\n };\n }\n\n public init(p: ReturnType) {\n this.container.classList.add('dont-u-dare-block-me');\n this.setTitle('PrivacySettings');\n\n const SUBTITLE: LangPackKey = 'Loading';\n const promises: Promise[] = [];\n\n {\n const section = new SettingSection({noDelimiter: true, caption: 'SessionsInfo'});\n\n let blockedPeerIds: PeerId[];\n const blockedUsersRow = new Row({\n icon: 'deleteuser',\n titleLangKey: 'BlockedUsers',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n const tab = this.slider.createTab(AppBlockedUsersTab);\n tab.peerIds = blockedPeerIds;\n tab.open();\n },\n listenerSetter: this.listenerSetter\n });\n blockedUsersRow.freezed = true;\n\n let passwordState: AccountPassword;\n const twoFactorRowOptions = {\n icon: 'lock',\n titleLangKey: 'TwoStepVerification' as LangPackKey,\n subtitleLangKey: SUBTITLE,\n clickable: (e: Event) => {\n let tab: AppTwoStepVerificationTab | AppTwoStepVerificationEnterPasswordTab | AppTwoStepVerificationEmailConfirmationTab;\n if(passwordState.pFlags.has_password) {\n tab = this.slider.createTab(AppTwoStepVerificationEnterPasswordTab);\n } else if(passwordState.email_unconfirmed_pattern) {\n tab = this.slider.createTab(AppTwoStepVerificationEmailConfirmationTab);\n tab.email = passwordState.email_unconfirmed_pattern;\n tab.length = 6;\n tab.isFirst = true;\n this.managers.passwordManager.resendPasswordEmail();\n } else {\n tab = this.slider.createTab(AppTwoStepVerificationTab);\n }\n\n tab.state = passwordState;\n tab.open();\n },\n listenerSetter: this.listenerSetter\n };\n\n const twoFactorRow = new Row(twoFactorRowOptions);\n twoFactorRow.freezed = true;\n\n const activeSessionsRow = this.activeSessionsRow = new Row({\n icon: 'activesessions',\n titleLangKey: 'SessionsTitle',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n const tab = this.slider.createTab(AppActiveSessionsTab);\n tab.authorizations = this.authorizations;\n tab.eventListener.addEventListener('destroy', () => {\n this.updateActiveSessions();\n }, {once: true});\n tab.open();\n },\n listenerSetter: this.listenerSetter\n });\n activeSessionsRow.freezed = true;\n\n const websitesRow = this.websitesRow = new Row({\n icon: 'mention',\n titleLangKey: 'OtherWebSessions',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n const tab = this.slider.createTab(AppActiveWebSessionsTab);\n tab.eventListener.addEventListener('destroy', () => {\n this.updateActiveWebsites();\n });\n tab.open(this.websites);\n },\n listenerSetter: this.listenerSetter\n });\n websitesRow.freezed = true;\n\n section.content.append(blockedUsersRow.container, twoFactorRow.container, activeSessionsRow.container, websitesRow.container);\n this.scrollable.append(section.container);\n\n const setBlockedCount = (count: number) => {\n if(count) {\n replaceContent(blockedUsersRow.subtitle, i18n('PrivacySettingsController.UserCount', [count]));\n } else {\n replaceContent(blockedUsersRow.subtitle, i18n('BlockedEmpty', [count]));\n }\n };\n\n this.listenerSetter.add(rootScope)('peer_block', () => {\n /* const {blocked, peerId} = update;\n if(!blocked) blockedPeerIds.findAndSplice((p) => p === peerId);\n else blockedPeerIds.unshift(peerId);\n blockedCount += blocked ? 1 : -1;\n setBlockedCount(blockedCount); */\n updateBlocked();\n });\n\n const updateBlocked = () => {\n this.managers.appUsersManager.getBlocked().then((res) => {\n blockedUsersRow.freezed = false;\n setBlockedCount(res.count);\n blockedPeerIds = res.peerIds;\n });\n };\n\n updateBlocked();\n\n this.managers.passwordManager.getState().then((state) => {\n passwordState = state;\n replaceContent(twoFactorRow.subtitle, i18n(state.pFlags.has_password ? 'PrivacyAndSecurity.Item.On' : 'PrivacyAndSecurity.Item.Off'));\n twoFactorRow.freezed = false;\n\n // console.log('password state', state);\n });\n\n this.updateActiveSessions();\n promises.push(this.updateActiveWebsites(p.webAuthorizations));\n }\n\n {\n const section = new SettingSection({name: 'PrivacyTitle', caption: 'GroupsAndChannelsHelp'});\n\n section.content.classList.add('privacy-navigation-container');\n\n const rowsByKeys: Partial<{\n [key in InputPrivacyKey['_']]: Row\n }> = {};\n\n const numberVisibilityRow = rowsByKeys['inputPrivacyKeyPhoneNumber'] = new Row({\n titleLangKey: 'PrivacyPhoneTitle',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n this.slider.createTab(AppPrivacyPhoneNumberTab).open();\n },\n listenerSetter: this.listenerSetter\n });\n\n const lastSeenTimeRow = rowsByKeys['inputPrivacyKeyStatusTimestamp'] = new Row({\n titleLangKey: 'LastSeenTitle',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n this.slider.createTab(AppPrivacyLastSeenTab).open();\n },\n listenerSetter: this.listenerSetter\n });\n\n const photoVisibilityRow = rowsByKeys['inputPrivacyKeyProfilePhoto'] = new Row({\n titleLangKey: 'PrivacyProfilePhotoTitle',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n this.slider.createTab(AppPrivacyProfilePhotoTab).open();\n },\n listenerSetter: this.listenerSetter\n });\n\n const callRow = rowsByKeys['inputPrivacyKeyPhoneCall'] = new Row({\n titleLangKey: 'WhoCanCallMe',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n this.slider.createTab(AppPrivacyCallsTab).open();\n },\n listenerSetter: this.listenerSetter\n });\n\n const linkAccountRow = rowsByKeys['inputPrivacyKeyForwards'] = new Row({\n titleLangKey: 'PrivacyForwardsTitle',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n this.slider.createTab(AppPrivacyForwardMessagesTab).open();\n },\n listenerSetter: this.listenerSetter\n });\n\n const groupChatsAddRow = rowsByKeys['inputPrivacyKeyChatInvite'] = new Row({\n titleLangKey: 'WhoCanAddMe',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n this.slider.createTab(AppPrivacyAddToGroupsTab).open();\n },\n listenerSetter: this.listenerSetter\n });\n\n const voicesRow = rowsByKeys['inputPrivacyKeyVoiceMessages'] = new Row({\n titleLangKey: 'PrivacyVoiceMessagesTitle',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n if(!rootScope.premium) {\n toastNew({langPackKey: 'PrivacyVoiceMessagesPremiumOnly'});\n } else {\n this.slider.createTab(AppPrivacyVoicesTab).open();\n }\n },\n listenerSetter: this.listenerSetter\n });\n\n const updatePrivacyRow = (key: InputPrivacyKey['_']) => {\n const row = rowsByKeys[key];\n if(!row) {\n return;\n }\n\n this.managers.appPrivacyManager.getPrivacy(key).then((rules) => {\n const details = getPrivacyRulesDetails(rules);\n const langKey = details.type === PrivacyType.Everybody ? 'PrivacySettingsController.Everbody' : (details.type === PrivacyType.Contacts ? 'PrivacySettingsController.MyContacts' : 'PrivacySettingsController.Nobody');\n const disallowLength = details.disallowPeers.users.length + details.disallowPeers.chats.length;\n const allowLength = details.allowPeers.users.length + details.allowPeers.chats.length;\n\n row.subtitle.innerHTML = '';\n const s = i18n(langKey);\n row.subtitle.append(s);\n if(disallowLength || allowLength) {\n row.subtitle.append(` (${[-disallowLength, allowLength ? '+' + allowLength : 0].filter(Boolean).join(', ')})`);\n }\n });\n };\n\n section.content.append(\n numberVisibilityRow.container,\n lastSeenTimeRow.container,\n photoVisibilityRow.container,\n callRow.container,\n linkAccountRow.container,\n groupChatsAddRow.container,\n voicesRow.container\n );\n this.scrollable.append(section.container);\n\n for(const key in rowsByKeys) {\n updatePrivacyRow(key as keyof typeof rowsByKeys);\n }\n\n rootScope.addEventListener('privacy_update', (update) => {\n updatePrivacyRow(convertKeyToInputKey(update.key._) as any);\n });\n }\n\n {\n const section = new SettingSection({name: 'NewChatsFromNonContacts', caption: 'ArchiveAndMuteInfo'});\n\n const checkboxField = new CheckboxField({text: 'ArchiveAndMute'});\n const row = new Row({\n checkboxField\n });\n\n section.content.append(row.container);\n\n let enabled: boolean, destroyed: boolean;\n this.eventListener.addEventListener('destroy', () => {\n destroyed = true;\n if(enabled === undefined || enabled === checkboxField.checked) return;\n return this.managers.appPrivacyManager.setGlobalPrivacySettings({\n _: 'globalPrivacySettings',\n archive_and_mute_new_noncontact_peers: checkboxField.checked\n });\n }, {once: true});\n\n const promise = Promise.all([\n p.appConfig,\n p.globalPrivacy\n ]).then(([appConfig, settings]) => {\n if(destroyed) {\n return;\n }\n\n const onPremiumToggle = (isPremium: boolean) => {\n section.container.classList.toggle('hide', !isPremium && !appConfig.autoarchive_setting_available);\n };\n\n this.listenerSetter.add(rootScope)('premium_toggle', onPremiumToggle);\n onPremiumToggle(rootScope.premium);\n\n enabled = !!settings.archive_and_mute_new_noncontact_peers;\n\n checkboxField.setValueSilently(enabled);\n });\n\n promises.push(promise);\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({name: 'Privacy.SensitiveContent', caption: 'PrivacyAndSecurity.SensitiveDesc'});\n section.container.classList.add('hide');\n\n const checkboxField = new CheckboxField({text: 'PrivacyAndSecurity.SensitiveText'});\n const row = new Row({\n checkboxField\n });\n\n section.content.append(row.container);\n\n let enabled: boolean;\n this.eventListener.addEventListener('destroy', () => {\n if(enabled === undefined) return;\n const _enabled = row.checkboxField.checked;\n const isChanged = _enabled !== enabled;\n if(!isChanged) {\n return;\n }\n\n return this.managers.apiManager.invokeApi('account.setContentSettings', {\n sensitive_enabled: _enabled\n });\n }, {once: true});\n\n const promise = p.contentSettings.then((settings) => {\n if(!settings.pFlags.sensitive_can_change) {\n return;\n }\n\n enabled = !!settings.pFlags.sensitive_enabled;\n checkboxField.setValueSilently(enabled);\n section.container.classList.remove('hide');\n });\n\n promises.push(promise);\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({name: 'PrivacyPayments', caption: 'PrivacyPaymentsClearInfo'});\n\n const onClearClick = () => {\n const options: PopupConfirmationOptions = {\n titleLangKey: 'PrivacyPaymentsClearAlertTitle',\n descriptionLangKey: 'PrivacyPaymentsClearAlertText',\n button: {\n langKey: 'Clear'\n },\n checkboxes: [{\n text: 'PrivacyClearShipping',\n checked: true\n }, {\n text: 'PrivacyClearPayment',\n checked: true\n }]\n };\n\n confirmationPopup(options).then(() => {\n const [info, payment] = options.checkboxes.map((c) => c.checkboxField.checked);\n const toggle = toggleDisability([clearButton], true);\n this.managers.appPaymentsManager.clearSavedInfo(info, payment).then(() => {\n if(!info && !payment) {\n return;\n }\n\n toggle();\n toastNew({\n langPackKey: info && payment ? 'PrivacyPaymentsPaymentShippingCleared' : (info ? 'PrivacyPaymentsShippingInfoCleared' : 'PrivacyPaymentsPaymentInfoCleared')\n });\n });\n }, noop);\n };\n\n const clearButton = Button('btn-primary btn-transparent', {icon: 'delete', text: 'PrivacyPaymentsClear'});\n this.listenerSetter.add(clearButton)('click', onClearClick);\n section.content.append(clearButton);\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({name: 'FilterChats'});\n\n const onDeleteClick = () => {\n const popup = PopupElement.createPopup(PopupPeer, 'popup-delete-drafts', {\n buttons: [{\n langKey: 'Delete',\n callback: () => {\n const toggle = toggleDisability([deleteButton], true);\n this.managers.appDraftsManager.clearAllDrafts().then(() => {\n toggle();\n });\n },\n isDanger: true\n }],\n titleLangKey: 'AreYouSureClearDraftsTitle',\n descriptionLangKey: 'AreYouSureClearDrafts'\n });\n\n popup.show();\n };\n\n const deleteButton = Button('btn-primary btn-transparent', {icon: 'delete', text: 'PrivacyDeleteCloudDrafts'});\n this.listenerSetter.add(deleteButton)('click', onDeleteClick);\n section.content.append(deleteButton);\n\n /* promises.push(apiManager.invokeApi('messages.getAllDrafts').then((drafts) => {\n const draftsRow = new Row({\n titleLangKey: 'PrivacyDeleteCloudDrafts',\n subtitleLangKey: 'Drafts',\n subtitleLangArgs: [(drafts as Updates.updates).updates.length],\n icon: 'delete',\n clickable: onDeleteClick\n });\n\n section.content.append(draftsRow.container);\n })); */\n\n this.scrollable.append(section.container);\n }\n\n // {\n // const section = new SettingSection({\n // name: 'OtherWebSessions'\n // });\n\n // const row = new Row({\n\n // });\n\n // this.scrollable.append(section.container);\n // }\n\n return Promise.all(promises);\n }\n\n public updateActiveSessions() {\n return this.managers.apiManager.invokeApi('account.getAuthorizations').then((auths) => {\n this.activeSessionsRow.freezed = false;\n this.authorizations = auths.authorizations;\n _i18n(this.activeSessionsRow.subtitle, 'Privacy.Devices', [this.authorizations.length]);\n });\n }\n\n public updateActiveWebsites(promise = this.managers.appSeamlessLoginManager.getWebAuthorizations()) {\n return promise.then((authorizations) => {\n this.websitesRow.freezed = false;\n this.websites = authorizations;\n _i18n(this.websitesRow.subtitle, 'Privacy.Websites', [this.websites.length]);\n this.websitesRow.container.classList.toggle('hide', !this.websites.length);\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {State} from '../../../config/state';\nimport flatten from '../../../helpers/array/flatten';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport {LiteModeKey} from '../../../helpers/liteMode';\nimport pause from '../../../helpers/schedulers/pause';\nimport rootScope from '../../../lib/rootScope';\nimport CheckboxFields, {CheckboxFieldsField} from '../../checkboxFields';\nimport SettingSection from '../../settingSection';\nimport SliderSuperTab from '../../sliderTab';\nimport {toastNew} from '../../toast';\n\ntype PowerSavingCheckboxFieldsField = CheckboxFieldsField & {\n key: LiteModeKey\n};\n\nexport default class AppPowerSavingTab extends SliderSuperTab {\n public init() {\n this.container.classList.add('power-saving-container');\n this.setTitle('LiteMode.Title');\n\n const form = document.createElement('form');\n\n let infoSection: SettingSection;\n {\n const section = infoSection = new SettingSection({\n caption: 'LiteMode.Info'\n });\n\n form.append(section.container);\n }\n\n const keys: Array = [\n 'all',\n 'video',\n 'gif',\n ['stickers', ['stickers_panel', 'stickers_chat']],\n // ['emoji', ['emoji_panel', 'emoji_messages']],\n ['effects', ['effects_reactions', 'effects_premiumstickers', 'effects_emoji']],\n ['chat', ['chat_background', 'chat_spoilers']],\n 'animations'\n ];\n\n let fields: PowerSavingCheckboxFieldsField[], checkboxFields: CheckboxFields;\n {\n const section = new SettingSection({});\n\n const wrap = (key: typeof keys[0]): PowerSavingCheckboxFieldsField[] => {\n const isArray = Array.isArray(key);\n const mainKey = isArray ? key[0] : key;\n const nested = isArray ? flatten(key[1].map(wrap)) : undefined;\n const value = rootScope.settings.liteMode[mainKey];\n return [{\n key: mainKey,\n text: mainKey === 'all' ? 'LiteMode.EnableText' : `LiteMode.Key.${mainKey}.Title`,\n checked: mainKey === 'all' ? value : !value,\n nested: nested,\n name: 'power-saving-' + mainKey\n }, ...(nested || [])];\n };\n\n fields = flatten(keys.map(wrap));\n\n checkboxFields = new CheckboxFields({\n fields: fields,\n listenerSetter: this.listenerSetter\n });\n\n fields.forEach((field, idx) => {\n const created = checkboxFields.createField(field);\n if(!created) {\n return;\n }\n\n const {row, nodes} = created;\n (idx === 0 ? infoSection : section).content.append(...nodes);\n });\n\n attachClickEvent(section.content, () => {\n if(rootScope.settings.liteMode.all) {\n toastNew({langPackKey: 'LiteMode.DisableAlert'});\n }\n }, {listenerSetter: this.listenerSetter});\n\n form.append(section.container);\n }\n\n const onAllChange = (disable: boolean) => {\n fields.forEach((field) => {\n if(field.key === 'all') {\n return;\n }\n\n if(field.nested) {\n checkboxFields.setNestedCounter(field, disable ? 0 : undefined);\n }\n\n field.checkboxField.input.classList.toggle('is-fake-disabled', disable);\n field.row.toggleDisability(disable);\n });\n };\n\n this.listenerSetter.add(form)('change', async() => {\n const liteMode: State['settings']['liteMode'] = {} as any;\n fields.forEach((field) => {\n const checked = field.checkboxField.checked;\n liteMode[field.key] = field.key === 'all' ? checked : !checked;\n });\n\n const wasAll = rootScope.settings.liteMode.all;\n if(wasAll !== liteMode.all) {\n onAllChange(!wasAll);\n\n if(liteMode.all) {\n await pause(200);\n }\n }\n\n await this.managers.appStateManager.setByKey('settings.liteMode', rootScope.settings.liteMode = liteMode);\n });\n\n onAllChange(rootScope.settings.liteMode.all);\n\n this.scrollable.append(form);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport RangeSelector from '../../rangeSelector';\nimport Button from '../../button';\nimport CheckboxField from '../../checkboxField';\nimport RadioField from '../../radioField';\nimport rootScope from '../../../lib/rootScope';\nimport {IS_APPLE, IS_SAFARI} from '../../../environment/userAgent';\nimport Row, {CreateRowFromCheckboxField} from '../../row';\nimport AppBackgroundTab from './background';\nimport I18n, {i18n, LangPackKey, _i18n} from '../../../lib/langPack';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport assumeType from '../../../helpers/assumeType';\nimport {BaseTheme, MessagesAllStickers, StickerSet} from '../../../layer';\nimport LazyLoadQueue from '../../lazyLoadQueue';\nimport PopupStickers from '../../popups/stickers';\nimport eachMinute from '../../../helpers/eachMinute';\nimport {SliderSuperTabEventable} from '../../sliderTab';\nimport IS_GEOLOCATION_SUPPORTED from '../../../environment/geolocationSupport';\nimport AppQuickReactionTab from './quickReaction';\nimport wrapEmojiText from '../../../lib/richTextProcessor/wrapEmojiText';\nimport {DEFAULT_THEME, State} from '../../../config/state';\nimport wrapStickerSetThumb from '../../wrappers/stickerSetThumb';\nimport wrapStickerToRow from '../../wrappers/stickerToRow';\nimport SettingSection, {generateSection} from '../../settingSection';\nimport {ScrollableX} from '../../scrollable';\nimport wrapStickerEmoji from '../../wrappers/stickerEmoji';\nimport {Theme} from '../../../layer';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport RLottiePlayer from '../../../lib/rlottie/rlottiePlayer';\nimport themeController from '../../../helpers/themeController';\nimport liteMode from '../../../helpers/liteMode';\nimport AppPowerSavingTab from './powerSaving';\nimport {toastNew} from '../../toast';\n\nexport class RangeSettingSelector {\n public container: HTMLDivElement;\n public valueContainer: HTMLElement;\n private range: RangeSelector;\n\n public onChange: (value: number) => void;\n\n constructor(\n name: LangPackKey,\n step: number,\n initialValue: number,\n minValue: number,\n maxValue: number,\n writeValue = true\n ) {\n const BASE_CLASS = 'range-setting-selector';\n this.container = document.createElement('div');\n this.container.classList.add(BASE_CLASS);\n\n const details = document.createElement('div');\n details.classList.add(BASE_CLASS + '-details');\n\n const nameDiv = document.createElement('div');\n nameDiv.classList.add(BASE_CLASS + '-name');\n _i18n(nameDiv, name);\n\n const valueDiv = this.valueContainer = document.createElement('div');\n valueDiv.classList.add(BASE_CLASS + '-value');\n\n if(writeValue) {\n valueDiv.innerHTML = '' + initialValue;\n }\n\n details.append(nameDiv, valueDiv);\n\n this.range = new RangeSelector({\n step,\n min: minValue,\n max: maxValue\n }, initialValue);\n this.range.setListeners();\n this.range.setHandlers({\n onScrub: value => {\n if(this.onChange) {\n this.onChange(value);\n }\n\n if(writeValue) {\n // console.log('font size scrub:', value);\n valueDiv.innerText = '' + value;\n }\n }\n });\n\n this.container.append(details, this.range.container);\n }\n}\n\nexport default class AppGeneralSettingsTab extends SliderSuperTabEventable {\n public static getInitArgs() {\n return {\n themes: rootScope.managers.appThemesManager.getThemes()\n };\n }\n\n public init(p: ReturnType) {\n this.container.classList.add('general-settings-container');\n this.setTitle('General');\n\n const section = generateSection.bind(null, this.scrollable);\n const promises: Promise[] = [];\n\n {\n const container = section('Settings');\n\n const range = new RangeSettingSelector('TextSize', 1, rootScope.settings.messagesTextSize, 12, 20);\n range.onChange = (value) => {\n rootScope.managers.appStateManager.setByKey('settings.messagesTextSize', value);\n };\n\n const chatBackgroundButton = Button('btn-primary btn-transparent', {icon: 'image', text: 'ChatBackground'});\n\n const initArgs = AppBackgroundTab.getInitArgs();\n attachClickEvent(chatBackgroundButton, () => {\n this.slider.createTab(AppBackgroundTab).open(initArgs);\n });\n\n const getLiteModeStatus = (): LangPackKey => rootScope.settings.liteMode.all ? 'Checkbox.Enabled' : 'Checkbox.Disabled';\n const i = new I18n.IntlElement();\n\n const onUpdate = () => {\n i.compareAndUpdate({key: getLiteModeStatus()});\n animationsCheckboxField.setValueSilently(liteMode.isAvailable('animations'));\n animationsCheckboxField.toggleDisability(liteMode.isEnabled());\n };\n\n const animationsCheckboxField = new CheckboxField({\n text: 'EnableAnimations',\n name: 'animations',\n stateKey: 'settings.liteMode.animations',\n stateValueReverse: true,\n checked: false,\n listenerSetter: this.listenerSetter\n });\n\n const animationsRow = new Row({\n checkboxField: animationsCheckboxField,\n clickable: () => {\n if(animationsCheckboxField.isDisabled()) {\n toastNew({langPackKey: 'LiteMode.DisableAlert'});\n }\n },\n listenerSetter: this.listenerSetter\n });\n\n const liteModeRow = new Row({\n icon: 'animations',\n titleLangKey: 'LiteMode.EnableText',\n titleRightSecondary: i.element,\n clickable: () => {\n this.slider.createTab(AppPowerSavingTab).open();\n },\n listenerSetter: this.listenerSetter\n });\n\n onUpdate();\n\n this.listenerSetter.add(rootScope)('settings_updated', onUpdate);\n\n container.append(\n range.container,\n chatBackgroundButton,\n animationsRow.container,\n liteModeRow.container\n );\n }\n\n {\n const container = section('ColorTheme');\n\n const scrollable = new ScrollableX(null);\n const themesContainer = scrollable.container;\n themesContainer.classList.add('themes-container');\n\n type K = {\n container: HTMLElement,\n theme: Theme,\n player?: RLottiePlayer,\n wallPaperContainers?: {[key in BaseTheme['_']]?: HTMLElement}\n };\n const themesMap = new Map();\n let currentTheme = themeController.getTheme();\n let isNight = themeController.isNight();\n\n const applyThemeOnItem = (item: K) => {\n themeController.applyTheme(item.theme, item.container);\n\n const previous = item.container.querySelector('.background-item');\n previous?.remove();\n\n const wallPaperContainer = item.wallPaperContainers[isNight ? 'baseThemeNight' : 'baseThemeClassic']\n if(wallPaperContainer) {\n item.container.prepend(wallPaperContainer);\n }\n };\n\n let lastOnFrameNo: (frameNo: number) => void;\n\n attachClickEvent(themesContainer, async(e) => {\n const container = findUpClassName(e.target, 'theme-container');\n if(!container) {\n return;\n }\n\n const lastActive = themesContainer.querySelector('.active');\n if(lastActive) {\n lastActive.classList.remove('active');\n }\n\n const item = themesMap.get(container);\n container.classList.add('active');\n\n await themeController.applyNewTheme(item.theme);\n\n lastOnFrameNo?.(-1);\n\n if(item.player && liteMode.isAvailable('animations')) {\n if(IS_SAFARI) {\n if(item.player.paused) {\n item.player.restart();\n }\n } else {\n if(item.player.paused) {\n item.player.stop(true);\n }\n\n item.player.el[0].style.transform = 'scale(2)';\n\n const onFrameNo = lastOnFrameNo = (frameNo) => {\n if(item.player.maxFrame === frameNo || frameNo === -1) {\n item.player.el[0].style.transform = '';\n item.player.removeEventListener('enterFrame', onFrameNo);\n\n if(lastOnFrameNo === onFrameNo) {\n lastOnFrameNo = undefined;\n }\n }\n };\n\n setTimeout(() => {\n if(lastOnFrameNo !== onFrameNo) {\n return;\n }\n\n item.player.play();\n item.player.addEventListener('enterFrame', onFrameNo);\n }, 250);\n }\n }\n }, {listenerSetter: this.listenerSetter});\n\n const availableBaseThemes: Set = new Set(['baseThemeClassic', 'baseThemeNight']);\n\n const promise = p.themes.then(async(themes) => {\n const defaultThemes = themes.filter((theme) => theme.pFlags.default/* && theme.settings[0].message_colors.length === 1 */);\n defaultThemes.unshift(DEFAULT_THEME);\n\n const promises = defaultThemes.map(async(theme) => {\n const container = document.createElement('div');\n const k: K = {\n container,\n theme,\n wallPaperContainers: {}\n };\n\n const results = theme.settings\n .filter((themeSettings) => availableBaseThemes.has(themeSettings.base_theme._))\n .map((themeSettings) => {\n const wallPaper = themeSettings.wallpaper;\n const result = AppBackgroundTab.addWallPaper(wallPaper);\n k.wallPaperContainers[themeSettings.base_theme._] = result.container;\n return result;\n });\n\n themesMap.set(container, k);\n\n applyThemeOnItem(k);\n\n if(theme.id === currentTheme.id) {\n container.classList.add('active');\n }\n\n const emoticon = theme.emoticon;\n const loadPromises: Promise[] = [];\n let emoticonContainer: HTMLElement;\n if(emoticon) {\n emoticonContainer = document.createElement('div');\n emoticonContainer.classList.add('theme-emoticon');\n const size = 28 * 1.75;\n wrapStickerEmoji({\n div: emoticonContainer,\n width: size,\n height: size,\n emoji: theme.emoticon,\n managers: this.managers,\n loadPromises,\n middleware: this.middlewareHelper.get(),\n play: false\n }).then(({render}) => render).then((player) => {\n k.player = player as RLottiePlayer;\n });\n }\n\n const bubble = document.createElement('div');\n bubble.classList.add('theme-bubble');\n\n const bubbleIn = bubble.cloneNode() as HTMLElement;\n\n bubbleIn.classList.add('is-in');\n bubble.classList.add('is-out');\n\n loadPromises.push(...results.map((result) => result.loadPromise));\n\n container.classList.add('theme-container');\n\n await Promise.all(loadPromises);\n\n if(emoticonContainer) {\n container.append(emoticonContainer);\n }\n\n container.append(bubbleIn, bubble);\n\n return container;\n });\n\n const containers = await Promise.all(promises);\n\n scrollable.append(...containers);\n });\n\n promises.push(promise);\n\n const form = document.createElement('form');\n form.style.marginTop = '.5rem';\n\n const name = 'theme';\n const stateKey = 'settings.theme';\n\n const dayRow = new Row({\n radioField: new RadioField({\n langKey: 'ThemeDay',\n name,\n value: 'day',\n stateKey\n })\n });\n\n const nightRow = new Row({\n radioField: new RadioField({\n langKey: 'ThemeNight',\n name,\n value: 'night',\n stateKey\n })\n });\n\n const systemRow = new Row({\n radioField: new RadioField({\n langKey: 'AutoNightSystemDefault',\n name,\n value: 'system',\n stateKey\n })\n });\n\n this.listenerSetter.add(rootScope)('settings_updated', ({key, value, settings}) => {\n if(key === stateKey) {\n rootScope.dispatchEvent('theme_change');\n }\n });\n\n this.listenerSetter.add(rootScope)('theme_change', () => {\n currentTheme = themeController.getTheme();\n const newIsNight = themeController.isNight();\n if(isNight === newIsNight) {\n return;\n }\n\n isNight = newIsNight;\n\n const lastActive = themesContainer.querySelector('.active');\n if(lastActive) {\n lastActive.classList.remove('active');\n }\n\n let active: HTMLElement;\n themesMap.forEach((item) => {\n applyThemeOnItem(item);\n\n if(item.theme.id === currentTheme.id) {\n item.container.classList.add('active');\n active = item.container;\n }\n });\n\n if(active) {\n scrollable.scrollIntoViewNew({\n element: active,\n position: 'center',\n axis: 'x'\n });\n }\n });\n\n form.append(dayRow.container, nightRow.container, systemRow.container);\n\n container.append(\n themesContainer,\n form\n );\n }\n\n {\n const container = section('General.Keyboard');\n\n const form = document.createElement('form');\n\n const name = 'send-shortcut';\n const stateKey = 'settings.sendShortcut';\n\n const enterRow = new Row({\n radioField: new RadioField({\n langKey: 'General.SendShortcut.Enter',\n name,\n value: 'enter',\n stateKey\n }),\n subtitleLangKey: 'General.SendShortcut.NewLine.ShiftEnter'\n });\n\n const ctrlEnterRow = new Row({\n radioField: new RadioField({\n name,\n value: 'ctrlEnter',\n stateKey\n }),\n subtitleLangKey: 'General.SendShortcut.NewLine.Enter'\n });\n _i18n(ctrlEnterRow.radioField.main, 'General.SendShortcut.CtrlEnter', [IS_APPLE ? '⌘' : 'Ctrl']);\n\n form.append(enterRow.container, ctrlEnterRow.container);\n container.append(form);\n }\n\n if(IS_GEOLOCATION_SUPPORTED) {\n const container = section('DistanceUnitsTitle');\n\n const form = document.createElement('form');\n\n const name = 'distance-unit';\n const stateKey = 'settings.distanceUnit';\n\n const kilometersRow = new Row({\n radioField: new RadioField({\n langKey: 'DistanceUnitsKilometers',\n name,\n value: 'kilometers',\n stateKey\n })\n });\n\n const milesRow = new Row({\n radioField: new RadioField({\n langKey: 'DistanceUnitsMiles',\n name,\n value: 'miles',\n stateKey\n })\n });\n\n form.append(kilometersRow.container, milesRow.container);\n container.append(form);\n }\n\n {\n const container = section('General.TimeFormat');\n\n const form = document.createElement('form');\n\n const name = 'time-format';\n const stateKey = 'settings.timeFormat';\n\n const formats: [State['settings']['timeFormat'], LangPackKey][] = [\n ['h12', 'General.TimeFormat.h12'],\n ['h23', 'General.TimeFormat.h23']\n ];\n\n const rows = formats.map(([format, langPackKey]) => {\n const row = new Row({\n radioField: new RadioField({\n langKey: langPackKey,\n name,\n value: format,\n stateKey\n })\n });\n\n return row;\n });\n\n const cancel = eachMinute(() => {\n const date = new Date();\n\n formats.forEach(([format], idx) => {\n const str = date.toLocaleTimeString('en-us-u-hc-' + format, {\n hour: '2-digit',\n minute: '2-digit'\n });\n\n rows[idx].subtitle.textContent = str;\n });\n });\n\n this.eventListener.addEventListener('destroy', cancel);\n\n form.append(...rows.map((row) => row.container));\n container.append(form);\n }\n\n return Promise.all(promises);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport eachTimeout from './eachTimeout';\n\n// It's better to use timeout instead of interval, because interval can be corrupted\nexport default function eachMinute(callback: () => any, runFirst = true) {\n return eachTimeout(callback, () => (60 - new Date().getSeconds()) * 1000, runFirst);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ctx from '../environment/ctx';\nimport noop from './noop';\n\n// It's better to use timeout instead of interval, because interval can be corrupted\nexport default function eachTimeout(callback: () => any, getNextTimeout: () => number, runFirst = true) {\n const cancel = () => {\n clearTimeout(timeout);\n };\n\n // replace callback to run noop and restore after\n const _callback = callback;\n if(!runFirst) {\n callback = noop;\n }\n\n let timeout: number;\n (function run() {\n callback();\n timeout = ctx.setTimeout(run, getNextTimeout());\n })();\n\n callback = _callback;\n\n return cancel;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDialogFilter} from '../../../lib/storages/filters';\nimport type {DialogFilterSuggested} from '../../../layer';\nimport type _rootScope from '../../../lib/rootScope';\nimport {SliderSuperTab} from '../../slider';\nimport lottieLoader, {LottieLoader} from '../../../lib/rlottie/lottieLoader';\nimport Button from '../../button';\nimport rootScope from '../../../lib/rootScope';\nimport AppEditFolderTab from './editFolder';\nimport Row from '../../row';\nimport {i18n, i18n_, LangPackKey, join} from '../../../lib/langPack';\nimport cancelEvent from '../../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport positionElementByIndex from '../../../helpers/dom/positionElementByIndex';\nimport RLottiePlayer from '../../../lib/rlottie/rlottiePlayer';\nimport wrapEmojiText from '../../../lib/richTextProcessor/wrapEmojiText';\nimport {FOLDER_ID_ALL, FOLDER_ID_ARCHIVE, REAL_FOLDERS} from '../../../lib/mtproto/mtproto_config';\nimport replaceContent from '../../../helpers/dom/replaceContent';\nimport SettingSection from '../../settingSection';\nimport Sortable from '../../../helpers/dom/sortable';\nimport whichChild from '../../../helpers/dom/whichChild';\nimport indexOfAndSplice from '../../../helpers/array/indexOfAndSplice';\nimport showLimitPopup from '../../popups/limit';\n\nexport default class AppChatFoldersTab extends SliderSuperTab {\n private createFolderBtn: HTMLElement;\n private foldersSection: SettingSection;\n private suggestedSection: SettingSection;\n private stickerContainer: HTMLElement;\n private animation: RLottiePlayer;\n private list: HTMLElement;\n\n private filtersRendered: {[filterId: number]: Row} = {};\n private loadAnimationPromise: ReturnType;\n\n public static getInitArgs() {\n return {\n animationData: lottieLoader.loadAnimationFromURLManually('Folders_1'),\n filters: rootScope.managers.filtersStorage.getDialogFilters()\n };\n }\n\n private async renderFolder(\n dialogFilter: DialogFilterSuggested | MyDialogFilter,\n container?: HTMLElement,\n row?: Row,\n append?: boolean\n ) {\n let filter: MyDialogFilter;\n let description = '';\n const d: HTMLElement[] = [];\n if(dialogFilter._ === 'dialogFilterSuggested') {\n filter = dialogFilter.filter as MyDialogFilter;\n description = dialogFilter.description;\n } else {\n filter = dialogFilter;\n\n const enabledFilters = Object.keys(filter.pFlags).length;\n /* (['include_peers', 'exclude_peers'] as ['include_peers', 'exclude_peers']).forEach((key) => {\n enabledFilters += +!!filter[key].length;\n }); */\n\n if(enabledFilters === 1) {\n const pFlags = filter.pFlags;\n let k: LangPackKey;\n if(pFlags.contacts) k = 'FilterAllContacts';\n else if(pFlags.non_contacts) k = 'FilterAllNonContacts';\n else if(pFlags.groups) k = 'FilterAllGroups';\n else if(pFlags.broadcasts) k = 'FilterAllChannels';\n else if(pFlags.bots) k = 'FilterAllBots';\n\n if(k) {\n d.push(i18n(k));\n }\n }\n\n if(!d.length) {\n const folder = await this.managers.dialogsStorage.getFolderDialogs(filter.id);\n let chats = 0, channels = 0, groups = 0;\n await Promise.all(folder.map(async(dialog) => {\n if(await this.managers.appPeersManager.isAnyGroup(dialog.peerId)) groups++;\n else if(await this.managers.appPeersManager.isBroadcast(dialog.peerId)) channels++;\n else chats++;\n }));\n\n if(chats) d.push(i18n('Chats', [chats]));\n if(channels) d.push(i18n('Channels', [channels]));\n if(groups) d.push(i18n('Groups', [groups]));\n }\n }\n\n if(!row) {\n row = new Row({\n title: filter.id === FOLDER_ID_ALL ? i18n('FilterAllChats') : wrapEmojiText(filter.title),\n subtitle: description,\n clickable: true,\n buttonRightLangKey: dialogFilter._ === 'dialogFilterSuggested' ? 'Add' : undefined\n });\n\n if(d.length) {\n row.subtitle.append(...join(d));\n }\n\n if(dialogFilter._ === 'dialogFilter') {\n const filterId = filter.id;\n if(!this.filtersRendered[filter.id] && filter.id !== FOLDER_ID_ALL) {\n const initArgs = AppEditFolderTab.getInitArgs();\n attachClickEvent(row.container, async() => {\n const filter = await this.managers.filtersStorage.getFilter(filterId);\n const tab = this.slider.createTab(AppEditFolderTab);\n tab.setInitFilter(filter);\n tab.open(initArgs);\n }, {listenerSetter: this.listenerSetter});\n }\n\n this.filtersRendered[filter.id] = row;\n\n row.makeSortable();\n }\n } else {\n if(filter.id !== FOLDER_ID_ALL) {\n replaceContent(row.title, wrapEmojiText(filter.title));\n }\n\n row.subtitle.textContent = '';\n row.subtitle.append(...join(d));\n }\n\n const div = row.container;\n\n if(append) {\n const localId = (filter as MyDialogFilter).localId;\n if(localId !== undefined) {\n // ! header will be at 0 index\n positionElementByIndex(div, div.parentElement || container, localId);\n } else if(container) {\n container.append(div);\n }\n }\n\n return row;\n }\n\n public init(p: ReturnType = AppChatFoldersTab.getInitArgs()) {\n this.container.classList.add('chat-folders-container');\n this.setTitle('ChatList.Filter.List.Title');\n\n this.scrollable.container.classList.add('chat-folders');\n\n this.stickerContainer = document.createElement('div');\n this.stickerContainer.classList.add('sticker-container');\n\n const caption = document.createElement('div');\n caption.classList.add('caption');\n i18n_({element: caption, key: 'ChatList.Filter.Header'});\n\n this.createFolderBtn = Button('btn-primary btn-color-primary btn-control tgico', {\n text: 'ChatList.Filter.NewTitle',\n icon: 'add'\n });\n\n this.foldersSection = new SettingSection({\n name: 'Filters'\n });\n this.foldersSection.container.classList.add('hide');\n\n this.list = document.createElement('div');\n this.foldersSection.content.append(this.list);\n\n this.suggestedSection = new SettingSection({\n name: 'FilterRecommended'\n });\n this.suggestedSection.container.classList.add('hide');\n\n this.scrollable.append(\n this.stickerContainer,\n caption,\n this.createFolderBtn,\n this.foldersSection.container,\n this.suggestedSection.container\n );\n\n attachClickEvent(this.createFolderBtn, async() => {\n if(!(await this.canCreateFolder())) {\n showLimitPopup('folders');\n } else {\n this.slider.createTab(AppEditFolderTab).open();\n }\n }, {listenerSetter: this.listenerSetter});\n\n const onFiltersContainerUpdate = () => {\n this.foldersSection.container.classList.toggle('hide', !Object.keys(this.filtersRendered).length);\n };\n\n const loadPromises: Promise[] = [];\n const renderFiltersPromise = p.filters.then(async(filters) => {\n for(const filter of filters) {\n if(filter.id === FOLDER_ID_ARCHIVE) {\n continue;\n }\n\n await this.renderFolder(filter, this.list, undefined, true);\n }\n\n this.toggleAllChats();\n\n onFiltersContainerUpdate();\n });\n\n loadPromises.push(renderFiltersPromise);\n\n this.listenerSetter.add(rootScope)('filter_update', async(filter) => {\n const filterRendered = this.filtersRendered[filter.id];\n if(filterRendered) {\n await this.renderFolder(filter, null, filterRendered);\n } else if(filter.id !== FOLDER_ID_ARCHIVE) {\n await this.renderFolder(filter, this.list, undefined, true);\n }\n\n onFiltersContainerUpdate();\n\n this.getSuggestedFilters();\n });\n\n this.listenerSetter.add(rootScope)('filter_delete', (filter) => {\n const filterRendered = this.filtersRendered[filter.id];\n if(filterRendered) {\n /* for(const suggested of this.suggestedFilters) {\n if(deepEqual(suggested.filter, filter)) {\n\n }\n } */\n this.getSuggestedFilters();\n\n filterRendered.container.remove();\n delete this.filtersRendered[filter.id];\n }\n\n onFiltersContainerUpdate();\n });\n\n this.listenerSetter.add(rootScope)('filter_order', (order) => {\n order.filter((filterId) => !!this.filtersRendered[filterId]).forEach((filterId, idx) => {\n const filterRendered = this.filtersRendered[filterId];\n const container = filterRendered.container;\n positionElementByIndex(container, container.parentElement, idx + 1); // ! + 1 due to header\n });\n });\n\n this.listenerSetter.add(rootScope)('premium_toggle', () => {\n this.toggleAllChats();\n });\n\n this.loadAnimationPromise = p.animationData.then(async(cb) => {\n const player = await cb({\n container: this.stickerContainer,\n loop: false,\n autoplay: false,\n width: 86,\n height: 86\n });\n\n this.animation = player;\n\n return lottieLoader.waitForFirstFrame(player);\n });\n\n loadPromises.push(this.loadAnimationPromise);\n\n new Sortable({\n list: this.list,\n middleware: this.middlewareHelper.get(),\n onSort: (prevIdx, newIdx) => {\n let order: number[] = [];\n for(const filterId in this.filtersRendered) {\n const row = this.filtersRendered[filterId];\n const idx = whichChild(row.container);\n order[idx] = +filterId;\n }\n\n order = order.filter((filterId) => filterId !== undefined);\n if(!rootScope.premium) {\n indexOfAndSplice(order, FOLDER_ID_ALL);\n // order.unshift(FOLDER_ID_ALL);\n }\n\n this.managers.filtersStorage.updateDialogFiltersOrder(order);\n },\n scrollable: this.scrollable\n });\n\n this.getSuggestedFilters();\n\n /* return Promise.all([\n this.loadAnimationPromise\n ]); */\n return Promise.all(loadPromises);\n }\n\n onOpenAfterTimeout() {\n this.loadAnimationPromise.then(() => {\n this.animation.autoplay = true;\n this.animation.play();\n });\n\n return super.onOpenAfterTimeout();\n }\n\n private toggleAllChats() {\n const filterRendered = this.filtersRendered[FOLDER_ID_ALL];\n filterRendered.container.classList.toggle('hide', !rootScope.premium);\n }\n\n private async canCreateFolder() {\n const [limit, filters] = await Promise.all([\n this.managers.apiManager.getLimit('folders'),\n this.managers.filtersStorage.getDialogFilters()\n ]);\n\n const filtersLength = filters.filter((filter) => !REAL_FOLDERS.has(filter.id)).length;\n return filtersLength < limit;\n }\n\n private getSuggestedFilters() {\n return this.managers.filtersStorage.getSuggestedDialogsFilters().then(async(suggestedFilters) => {\n this.suggestedSection.container.classList.toggle('hide', !suggestedFilters.length);\n Array.from(this.suggestedSection.content.children).slice(1).forEach((el) => el.remove());\n\n for(const filter of suggestedFilters) {\n const row = await this.renderFolder(filter);\n this.suggestedSection.content.append(row.container);\n\n const button = row.buttonRight;\n attachClickEvent(button, async(e) => {\n cancelEvent(e);\n\n if(!(await this.canCreateFolder())) {\n showLimitPopup('folders');\n return;\n }\n\n button.setAttribute('disabled', 'true');\n\n const f = filter.filter as MyDialogFilter;\n f.includePeerIds = [];\n f.excludePeerIds = [];\n f.pinnedPeerIds = [];\n\n this.managers.filtersStorage.createDialogFilter(f, true).then(() => {\n row.container.remove();\n this.suggestedSection.container.classList.toggle('hide', this.suggestedSection.content.childElementCount === 1);\n }).finally(() => {\n button.removeAttribute('disabled');\n });\n }, {listenerSetter: this.listenerSetter});\n }\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Row from '../../row';\nimport CheckboxField from '../../checkboxField';\nimport {InputNotifyPeer, InputPeerNotifySettings, Update} from '../../../layer';\nimport {SliderSuperTabEventable} from '../../sliderTab';\nimport rootScope from '../../../lib/rootScope';\nimport {LangPackKey} from '../../../lib/langPack';\nimport copy from '../../../helpers/object/copy';\nimport convertKeyToInputKey from '../../../helpers/string/convertKeyToInputKey';\nimport {MUTE_UNTIL} from '../../../lib/mtproto/mtproto_config';\nimport apiManagerProxy from '../../../lib/mtproto/mtprotoworker';\nimport SettingSection from '../../settingSection';\n\ntype InputNotifyKey = Exclude;\n\nexport default class AppNotificationsTab extends SliderSuperTabEventable {\n public init() {\n this.container.classList.add('notifications-container');\n this.setTitle('Telegram.NotificationSettingsViewController');\n\n const NotifySection = (options: {\n name: LangPackKey,\n typeText: LangPackKey,\n inputKey: InputNotifyKey,\n }) => {\n const section = new SettingSection({\n name: options.name\n });\n\n const enabledRow = new Row({\n checkboxField: new CheckboxField({text: options.typeText, checked: true}),\n subtitleLangKey: 'Loading',\n listenerSetter: this.listenerSetter,\n withCheckboxSubtitle: true\n });\n\n const previewEnabledRow = new Row({\n checkboxField: new CheckboxField({text: 'MessagePreview', checked: true}),\n subtitleLangKey: 'Loading',\n listenerSetter: this.listenerSetter,\n withCheckboxSubtitle: true\n });\n\n section.content.append(enabledRow.container, previewEnabledRow.container);\n\n this.scrollable.append(section.container);\n\n const inputNotifyPeer = {_: options.inputKey};\n const ret = this.managers.appNotificationsManager.getNotifySettings(inputNotifyPeer);\n (ret instanceof Promise ? ret : Promise.resolve(ret)).then((notifySettings) => {\n const applySettings = async() => {\n const muted = await this.managers.appNotificationsManager.isMuted(notifySettings);\n enabledRow.checkboxField.checked = !muted;\n previewEnabledRow.checkboxField.checked = notifySettings.show_previews;\n\n return muted;\n };\n\n applySettings();\n\n this.eventListener.addEventListener('destroy', async() => {\n const mute = !enabledRow.checkboxField.checked;\n const showPreviews = previewEnabledRow.checkboxField.checked;\n\n if(mute === (await this.managers.appNotificationsManager.isMuted(notifySettings)) && showPreviews === notifySettings.show_previews) {\n return;\n }\n\n const inputSettings: InputPeerNotifySettings = copy(notifySettings) as any;\n inputSettings._ = 'inputPeerNotifySettings';\n inputSettings.mute_until = mute ? MUTE_UNTIL : 0;\n inputSettings.show_previews = showPreviews;\n delete inputSettings.flags;\n\n this.managers.appNotificationsManager.updateNotifySettings(inputNotifyPeer, inputSettings);\n }, {once: true});\n\n this.listenerSetter.add(rootScope)('notify_settings', (update: Update.updateNotifySettings) => {\n const inputKey = convertKeyToInputKey(update.peer._) as any;\n if(options.inputKey === inputKey) {\n notifySettings = update.notify_settings;\n applySettings();\n }\n });\n });\n };\n\n NotifySection({\n name: 'NotificationsPrivateChats',\n typeText: 'NotificationsForPrivateChats',\n inputKey: 'inputNotifyUsers'\n });\n\n NotifySection({\n name: 'NotificationsGroups',\n typeText: 'NotificationsForGroups',\n inputKey: 'inputNotifyChats'\n });\n\n NotifySection({\n name: 'NotificationsChannels',\n typeText: 'NotificationsForChannels',\n inputKey: 'inputNotifyBroadcasts'\n });\n\n {\n const section = new SettingSection({\n name: 'NotificationsOther'\n });\n\n const contactsSignUpRow = new Row({\n checkboxField: new CheckboxField({text: 'ContactJoined', checked: true}),\n subtitleLangKey: 'Loading',\n listenerSetter: this.listenerSetter,\n withCheckboxSubtitle: true\n });\n\n const soundRow = new Row({\n checkboxField: new CheckboxField({text: 'Notifications.Sound', checked: true, stateKey: 'settings.notifications.sound', listenerSetter: this.listenerSetter}),\n subtitleLangKey: 'Loading',\n listenerSetter: this.listenerSetter,\n withCheckboxSubtitle: true\n });\n\n apiManagerProxy.getState().then((state) => {\n soundRow.checkboxField.checked = state.settings.notifications.sound;\n });\n\n section.content.append(contactsSignUpRow.container, soundRow.container);\n\n this.scrollable.append(section.container);\n\n this.managers.appNotificationsManager.getContactSignUpNotification().then((enabled) => {\n contactsSignUpRow.checkboxField.checked = enabled;\n\n this.eventListener.addEventListener('destroy', () => {\n const _enabled = contactsSignUpRow.checkboxField.checked;\n if(enabled !== _enabled) {\n this.managers.appNotificationsManager.setContactSignUpNotification(!_enabled);\n }\n }, {once: true});\n });\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {randomLong} from '../../../helpers/random';\nimport {LangPackLanguage} from '../../../layer';\nimport I18n from '../../../lib/langPack';\nimport rootScope from '../../../lib/rootScope';\nimport RadioField from '../../radioField';\nimport Row, {RadioFormFromRows} from '../../row';\nimport SettingSection from '../../settingSection';\nimport {SliderSuperTab} from '../../slider'\n\nexport default class AppLanguageTab extends SliderSuperTab {\n public static getInitArgs() {\n return {\n languages1: rootScope.managers.apiManager.invokeApiCacheable('langpack.getLanguages', {\n lang_pack: 'web'\n }),\n // languages2: rootScope.managers.apiManager.invokeApiCacheable('langpack.getLanguages', {\n // lang_pack: 'macos'\n // })\n languages2: Promise.resolve([] as LangPackLanguage[])\n };\n }\n\n public init(p: ReturnType) {\n this.header.classList.add('with-border');\n this.container.classList.add('language-container');\n this.setTitle('Telegram.LanguageViewController');\n\n const section = new SettingSection({});\n\n const radioRows: Map = new Map();\n\n const promise = Promise.all([\n p.languages1,\n p.languages2\n ]).then(([languages1, languages2]) => {\n const rendered: Set = new Set();\n const webLangCodes = languages1.map((language) => language.lang_code);\n\n const random = randomLong();\n languages1.concat(languages2).forEach((language) => {\n if(rendered.has(language.lang_code)) return;\n rendered.add(language.lang_code);\n\n const row = new Row({\n radioField: new RadioField({\n text: language.name,\n name: random,\n value: language.lang_code\n }),\n subtitle: language.native_name\n });\n\n radioRows.set(language.lang_code, row);\n });\n\n const form = RadioFormFromRows([...radioRows.values()], (value) => {\n I18n.getLangPack(value, webLangCodes.includes(value));\n });\n\n I18n.getCacheLangPack().then((langPack) => {\n const row = radioRows.get(langPack.lang_code);\n if(!row) {\n console.error('no row', row, langPack);\n return;\n }\n\n row.radioField.setValueSilently(true);\n });\n\n section.content.append(form);\n });\n\n this.scrollable.append(section.container);\n\n return promise;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ListenerSetter from '../../../../helpers/listenerSetter';\nimport {LangPackKey} from '../../../../lib/langPack';\nimport CheckboxField from '../../../checkboxField';\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport Row, {CreateRowFromCheckboxField} from '../../../row';\nimport SettingSection from '../../../settingSection';\n\nexport function autoDownloadPeerTypeSection(type: 'photo' | 'video' | 'file', title: LangPackKey, listenerSetter: ListenerSetter) {\n const section = new SettingSection({name: title});\n\n const key = 'settings.autoDownload.' + type + '.';\n const contactsCheckboxField = new CheckboxField({\n text: 'AutodownloadContacts',\n name: 'contacts',\n stateKey: key + 'contacts',\n listenerSetter\n });\n const privateCheckboxField = new CheckboxField({\n text: 'AutodownloadPrivateChats',\n name: 'private',\n stateKey: key + 'private',\n listenerSetter\n });\n const groupsCheckboxField = new CheckboxField({\n text: 'AutodownloadGroupChats',\n name: 'groups',\n stateKey: key + 'groups',\n listenerSetter\n });\n const channelsCheckboxField = new CheckboxField({\n text: 'AutodownloadChannels',\n name: 'channels',\n stateKey: key + 'channels',\n listenerSetter\n });\n\n section.content.append(\n CreateRowFromCheckboxField(contactsCheckboxField).container,\n CreateRowFromCheckboxField(privateCheckboxField).container,\n CreateRowFromCheckboxField(groupsCheckboxField).container,\n CreateRowFromCheckboxField(channelsCheckboxField).container\n );\n\n return section;\n}\n\nexport default class AppAutoDownloadPhotoTab extends SliderSuperTabEventable {\n public init() {\n this.setTitle('AutoDownloadPhotos');\n\n const section = autoDownloadPeerTypeSection('photo', 'AutoDownloadPhotosTitle', this.listenerSetter);\n this.scrollable.append(section.container);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport formatBytes from '../../../../helpers/formatBytes';\nimport debounce from '../../../../helpers/schedulers/debounce';\nimport I18n from '../../../../lib/langPack';\nimport rootScope from '../../../../lib/rootScope';\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport {RangeSettingSelector} from '../generalSettings';\nimport {autoDownloadPeerTypeSection} from './photo';\n\nexport default class AppAutoDownloadFileTab extends SliderSuperTabEventable {\n public init() {\n this.setTitle('AutoDownloadFiles');\n\n const debouncedSave = debounce((sizeMax: number) => {\n this.managers.appStateManager.setByKey('settings.autoDownloadNew.file_size_max', sizeMax);\n }, 200, false, true);\n\n const section = autoDownloadPeerTypeSection('file', 'AutoDownloadFilesTitle', this.listenerSetter);\n\n const MIN = 512 * 1024;\n // const MAX = 2 * 1024 * 1024 * 1024;\n const MAX = 20 * 1024 * 1024;\n const MAX_RANGE = MAX - MIN;\n\n const sizeMax = rootScope.settings.autoDownloadNew.file_size_max;\n const value = Math.sqrt(Math.sqrt((sizeMax - MIN) / MAX_RANGE));\n const upTo = new I18n.IntlElement({\n key: 'AutodownloadSizeLimitUpTo',\n args: [formatBytes(sizeMax)]\n });\n const range = new RangeSettingSelector('AutoDownloadMaxFileSize', 0.01, value, 0, 1, false);\n range.onChange = (value) => {\n const sizeMax = (value ** 4 * MAX_RANGE + MIN) | 0;\n\n upTo.compareAndUpdate({args: [formatBytes(sizeMax)]});\n\n debouncedSave(sizeMax);\n };\n\n range.valueContainer.append(upTo.element);\n\n section.content.append(range.container);\n\n this.scrollable.append(section.container);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport {autoDownloadPeerTypeSection} from './photo';\n\nexport default class AppAutoDownloadVideoTab extends SliderSuperTabEventable {\n public init() {\n this.setTitle('AutoDownloadVideos');\n\n const section = autoDownloadPeerTypeSection('video', 'AutoDownloadVideosTitle', this.listenerSetter);\n this.scrollable.append(section.container);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AutoDownloadPeerTypeSettings, STATE_INIT} from '../../../config/state';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport replaceContent from '../../../helpers/dom/replaceContent';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport formatBytes from '../../../helpers/formatBytes';\nimport copy from '../../../helpers/object/copy';\nimport deepEqual from '../../../helpers/object/deepEqual';\nimport {FormatterArguments, i18n, join, LangPackKey} from '../../../lib/langPack';\nimport rootScope from '../../../lib/rootScope';\nimport Button from '../../button';\nimport CheckboxField from '../../checkboxField';\nimport confirmationPopup from '../../confirmationPopup';\nimport Row from '../../row';\nimport {SliderSuperTabEventable, SliderSuperTabEventableConstructable} from '../../sliderTab';\nimport AppAutoDownloadFileTab from './autoDownload/file';\nimport AppAutoDownloadPhotoTab from './autoDownload/photo';\nimport AppAutoDownloadVideoTab from './autoDownload/video';\nimport SettingSection from '../../settingSection';\n\nconst AUTO_DOWNLOAD_FOR_KEYS: {[k in keyof AutoDownloadPeerTypeSettings]: LangPackKey} = {\n contacts: 'AutoDownloadContacts',\n private: 'AutoDownloadPm',\n groups: 'AutoDownloadGroups',\n channels: 'AutoDownloadChannels'\n};\n\nexport default class AppDataAndStorageTab extends SliderSuperTabEventable {\n public init() {\n this.setTitle('DataSettings');\n\n {\n const section = new SettingSection({name: 'AutomaticMediaDownload', caption: 'AutoDownloadAudioInfo'});\n\n const autoCheckboxField = new CheckboxField({\n text: 'AutoDownloadMedia',\n name: 'auto',\n checked: !rootScope.settings.autoDownloadNew.pFlags.disabled,\n listenerSetter: this.listenerSetter\n });\n\n const autoRow = new Row({\n checkboxField: autoCheckboxField,\n listenerSetter: this.listenerSetter\n });\n\n const onChange = () => {\n toggleDisability([resetButton],\n deepEqual(rootScope.settings.autoDownload, STATE_INIT.settings.autoDownload) &&\n deepEqual(rootScope.settings.autoDownloadNew, STATE_INIT.settings.autoDownloadNew));\n };\n\n const setSubtitles = () => {\n this.setAutoDownloadSubtitle(photoRow, rootScope.settings.autoDownload.photo /* state.settings.autoDownloadNew.photo_size_max */);\n this.setAutoDownloadSubtitle(videoRow, rootScope.settings.autoDownload.video/* , state.settings.autoDownloadNew.video_size_max */);\n this.setAutoDownloadSubtitle(fileRow, rootScope.settings.autoDownload.file, rootScope.settings.autoDownloadNew.file_size_max);\n };\n\n const openTab = (tabConstructor: SliderSuperTabEventableConstructable) => {\n const tab = this.slider.createTab(tabConstructor);\n tab.open();\n\n this.listenerSetter.add(tab.eventListener)('destroy', () => {\n setSubtitles();\n onChange();\n }, {once: true});\n };\n\n const photoRow = new Row({\n titleLangKey: 'AutoDownloadPhotos',\n subtitle: '',\n clickable: () => {\n openTab(AppAutoDownloadPhotoTab);\n },\n listenerSetter: this.listenerSetter\n });\n\n const videoRow = new Row({\n titleLangKey: 'AutoDownloadVideos',\n subtitle: '',\n clickable: () => {\n openTab(AppAutoDownloadVideoTab);\n },\n listenerSetter: this.listenerSetter\n });\n\n const fileRow = new Row({\n titleLangKey: 'AutoDownloadFiles',\n subtitle: '',\n clickable: () => {\n openTab(AppAutoDownloadFileTab);\n },\n listenerSetter: this.listenerSetter\n });\n\n const resetButton = Button('btn-primary btn-transparent primary', {icon: 'delete', text: 'ResetAutomaticMediaDownload'});\n attachClickEvent(resetButton, () => {\n confirmationPopup({\n titleLangKey: 'ResetAutomaticMediaDownloadAlertTitle',\n descriptionLangKey: 'ResetAutomaticMediaDownloadAlert',\n button: {\n langKey: 'Reset'\n }\n }).then(() => {\n const settings = rootScope.settings;\n settings.autoDownloadNew = copy(STATE_INIT.settings.autoDownloadNew);\n settings.autoDownload = copy(STATE_INIT.settings.autoDownload);\n rootScope.settings = settings;\n this.managers.appStateManager.setByKey('settings', settings);\n\n setSubtitles();\n autoCheckboxField.checked = !rootScope.settings.autoDownloadNew.pFlags.disabled;\n });\n });\n\n const onDisabledChange = () => {\n const disabled = !autoCheckboxField.checked;\n\n const autoDownloadNew = rootScope.settings.autoDownloadNew;\n if(disabled) {\n autoDownloadNew.pFlags.disabled = true;\n } else {\n delete autoDownloadNew.pFlags.disabled;\n }\n\n [photoRow, videoRow, fileRow].forEach((row) => {\n row.container.classList.toggle('is-disabled', disabled);\n });\n\n this.managers.appStateManager.setByKey('settings.autoDownloadNew', autoDownloadNew);\n\n onChange();\n };\n\n autoCheckboxField.input.addEventListener('change', onDisabledChange);\n onDisabledChange();\n setSubtitles();\n\n section.content.append(\n autoRow.container,\n photoRow.container,\n videoRow.container,\n fileRow.container,\n resetButton\n );\n\n this.scrollable.append(section.container);\n }\n }\n\n private setAutoDownloadSubtitle(row: Row, settings: AutoDownloadPeerTypeSettings, sizeMax?: number) {\n let key: LangPackKey;\n const args: FormatterArguments = [];\n\n const peerKeys = Object.keys(settings) as (keyof typeof AUTO_DOWNLOAD_FOR_KEYS)[];\n const enabledKeys = peerKeys.map((key) => settings[key] ? AUTO_DOWNLOAD_FOR_KEYS[key] : undefined).filter(Boolean);\n if(!enabledKeys.length || sizeMax === 0) {\n key = 'AutoDownloadOff';\n } else {\n const isAll = enabledKeys.length === peerKeys.length;\n if(sizeMax !== undefined) {\n key = isAll ? 'AutoDownloadUpToOnAllChats' : 'AutoDownloadOnUpToFor';\n args.push(formatBytes(sizeMax));\n } else {\n key = isAll ? 'AutoDownloadOnAllChats' : 'AutoDownloadOnFor';\n }\n\n if(!isAll) {\n const fragment = document.createElement('span');\n fragment.append(...join(enabledKeys.map((key) => i18n(key)), true, false));\n args.push(fragment);\n }\n }\n\n replaceContent(row.subtitle, i18n(key, args));\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AvailableReaction} from '../../../layer';\nimport RadioField from '../../radioField';\nimport Row, {RadioFormFromRows} from '../../row';\nimport SettingSection from '../../settingSection';\nimport SliderSuperTab from '../../sliderTab';\nimport wrapStickerToRow from '../../wrappers/stickerToRow';\n\nexport default class AppQuickReactionTab extends SliderSuperTab {\n public init() {\n this.setTitle('DoubleTapSetting');\n this.container.classList.add('quick-reaction-container');\n\n return Promise.all([\n this.managers.appReactionsManager.getQuickReaction(),\n this.managers.appReactionsManager.getAvailableReactions()\n ]).then(([quickReaction, availableReactions]) => {\n availableReactions = availableReactions.filter((reaction) => !reaction.pFlags.inactive);\n\n const section = new SettingSection();\n\n const name = 'quick-reaction';\n const rows = availableReactions.map((availableReaction) => {\n const radioField = new RadioField({\n name,\n text: availableReaction.title,\n value: availableReaction.reaction,\n alignRight: true\n });\n\n const row = new Row({\n radioField,\n havePadding: true\n });\n\n radioField.main.classList.add('quick-reaction-title');\n\n wrapStickerToRow({\n row,\n doc: availableReaction.static_icon,\n size: 'small'\n });\n\n if(availableReaction.reaction === (quickReaction as AvailableReaction).reaction) {\n radioField.setValueSilently(true);\n }\n\n return row;\n });\n\n const form = RadioFormFromRows(rows, (value) => {\n this.managers.appReactionsManager.setDefaultReaction({_: 'reactionEmoji', emoticon: value});\n });\n\n section.content.append(form);\n this.scrollable.append(section.container);\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport forEachReverse from '../../../helpers/array/forEachReverse';\nimport assumeType from '../../../helpers/assumeType';\nimport createContextMenu from '../../../helpers/dom/createContextMenu';\nimport positionElementByIndex from '../../../helpers/dom/positionElementByIndex';\nimport Sortable from '../../../helpers/dom/sortable';\nimport {StickerSet, MessagesAllStickers} from '../../../layer';\nimport {i18n, LangPackKey} from '../../../lib/langPack';\nimport wrapEmojiText from '../../../lib/richTextProcessor/wrapEmojiText';\nimport rootScope from '../../../lib/rootScope';\nimport CheckboxField from '../../checkboxField';\nimport LazyLoadQueue from '../../lazyLoadQueue';\nimport PopupElement from '../../popups';\nimport PopupStickers from '../../popups/stickers';\nimport Row, {CreateRowFromCheckboxField} from '../../row';\nimport SettingSection from '../../settingSection';\nimport SliderSuperTab from '../../sliderTab';\nimport wrapStickerSetThumb from '../../wrappers/stickerSetThumb';\nimport wrapStickerToRow from '../../wrappers/stickerToRow';\nimport AppQuickReactionTab from './quickReaction';\n\nexport default class AppStickersAndEmojiTab extends SliderSuperTab {\n public static getInitArgs() {\n return {\n allStickers: rootScope.managers.appStickersManager.getAllStickers(),\n quickReaction: rootScope.managers.appReactionsManager.getQuickReaction()\n };\n }\n\n public init(p: ReturnType) {\n this.container.classList.add('stickers-emoji-container');\n this.setTitle('StickersName');\n\n const promises: Promise[] = [];\n\n {\n const section = new SettingSection({caption: 'LoopAnimatedStickersInfo'});\n\n const suggestStickersRow = new Row({\n icon: 'lamp',\n titleLangKey: 'Stickers.SuggestStickers',\n clickable: true,\n listenerSetter: this.listenerSetter,\n titleRightSecondary: true\n });\n\n const map: {[k in typeof rootScope.settings.stickers.suggest]: LangPackKey} = {\n all: 'SuggestStickersAll',\n installed: 'SuggestStickersInstalled',\n none: 'SuggestStickersNone'\n };\n\n const setStickersSuggestDescription = () => {\n suggestStickersRow.titleRight.replaceChildren(i18n(map[rootScope.settings.stickers.suggest]));\n };\n\n setStickersSuggestDescription();\n\n const setStickersSuggest = (value: typeof rootScope.settings.stickers.suggest) => {\n if(rootScope.settings.stickers.suggest === value) return;\n rootScope.settings.stickers.suggest = value;\n setStickersSuggestDescription();\n return this.managers.appStateManager.setByKey('settings.stickers.suggest', value);\n };\n\n createContextMenu({\n buttons: [{\n icon: 'stickers_face',\n text: 'SuggestStickersAll',\n onClick: setStickersSuggest.bind(this, 'all')\n }, {\n icon: 'newprivate',\n text: 'SuggestStickersInstalled',\n onClick: setStickersSuggest.bind(this, 'installed')\n }, {\n icon: 'stop',\n text: 'SuggestStickersNone',\n onClick: setStickersSuggest.bind(this, 'none')\n }],\n listenTo: suggestStickersRow.container,\n middleware: this.middlewareHelper.get(),\n listenForClick: true\n });\n\n const reactionsRow = new Row({\n titleLangKey: 'DoubleTapSetting',\n havePadding: true,\n clickable: () => {\n this.slider.createTab(AppQuickReactionTab).open();\n },\n listenerSetter: this.listenerSetter\n });\n\n const renderQuickReaction = () => {\n p.quickReaction.then((reaction) => {\n if(reaction._ === 'availableReaction') {\n return reaction.static_icon;\n } else {\n return this.managers.appEmojiManager.getCustomEmojiDocument(reaction.document_id);\n }\n }).then((doc) => {\n wrapStickerToRow({\n row: reactionsRow,\n doc,\n size: 'small'\n });\n });\n };\n\n renderQuickReaction();\n\n this.listenerSetter.add(rootScope)('quick_reaction', () => {\n p = AppStickersAndEmojiTab.getInitArgs();\n renderQuickReaction();\n });\n\n const loopStickersRow = new Row({\n icon: 'flip',\n titleLangKey: 'InstalledStickers.LoopAnimated',\n checkboxField: new CheckboxField({\n name: 'loop',\n stateKey: 'settings.stickers.loop',\n listenerSetter: this.listenerSetter,\n toggle: true\n }),\n listenerSetter: this.listenerSetter\n });\n\n section.content.append(\n reactionsRow.container,\n suggestStickersRow.container,\n loopStickersRow.container\n );\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({name: 'Emoji'});\n\n const suggestEmojiRow = new Row({\n icon: 'lamp',\n titleLangKey: 'GeneralSettings.EmojiPrediction',\n checkboxField: new CheckboxField({\n name: 'suggest-emoji',\n stateKey: 'settings.emoji.suggest',\n listenerSetter: this.listenerSetter,\n toggle: true\n }),\n listenerSetter: this.listenerSetter\n });\n const bigEmojiRow = new Row({\n icon: 'smile',\n titleLangKey: 'GeneralSettings.BigEmoji',\n checkboxField: new CheckboxField({\n name: 'emoji-big',\n stateKey: 'settings.emoji.big',\n listenerSetter: this.listenerSetter,\n toggle: true\n }),\n listenerSetter: this.listenerSetter\n });\n\n section.content.append(\n suggestEmojiRow.container,\n bigEmojiRow.container\n );\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({name: 'DynamicPackOrder', caption: 'DynamicPackOrderInfo'});\n\n const dynamicPackOrderRow = new Row({\n titleLangKey: 'DynamicPackOrder',\n checkboxField: new CheckboxField({\n name: 'dynamic-pack-order',\n stateKey: 'settings.stickers.dynamicPackOrder',\n listenerSetter: this.listenerSetter,\n toggle: true\n }),\n listenerSetter: this.listenerSetter\n });\n\n section.content.append(\n dynamicPackOrderRow.container\n );\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({name: 'Telegram.InstalledStickerPacksController', caption: 'StickersBotInfo'});\n\n const stickerSets: {[id: string]: Row} = {};\n\n const stickersContent = section.generateContentElement();\n\n const lazyLoadQueue = new LazyLoadQueue();\n const renderStickerSet = (stickerSet: StickerSet.stickerSet, method: 'append' | 'prepend' = 'append') => {\n const row = new Row({\n title: wrapEmojiText(stickerSet.title),\n subtitleLangKey: 'Stickers',\n subtitleLangArgs: [stickerSet.count],\n havePadding: true,\n clickable: () => {\n PopupElement.createPopup(PopupStickers, {id: stickerSet.id, access_hash: stickerSet.access_hash}).show();\n },\n listenerSetter: this.listenerSetter\n });\n\n row.container.dataset.id = '' + stickerSet.id;\n\n row.makeSortable();\n\n stickerSets[stickerSet.id] = row;\n\n const div = document.createElement('div');\n div.classList.add('row-media');\n\n wrapStickerSetThumb({\n set: stickerSet,\n container: div,\n group: 'GENERAL-SETTINGS',\n lazyLoadQueue,\n width: 36,\n height: 36,\n autoplay: true,\n middleware: this.middlewareHelper.get()\n });\n\n row.container.append(div);\n\n stickersContent[method](row.container);\n };\n\n const promise = p.allStickers.then((allStickers) => {\n assumeType(allStickers);\n const promises = allStickers.sets.map((stickerSet) => renderStickerSet(stickerSet));\n return Promise.all(promises);\n });\n\n promises.push(promise);\n\n this.listenerSetter.add(rootScope)('stickers_installed', (set) => {\n if(!stickerSets[set.id]) {\n renderStickerSet(set, 'prepend');\n }\n });\n\n this.listenerSetter.add(rootScope)('stickers_deleted', (set) => {\n if(stickerSets[set.id]) {\n stickerSets[set.id].container.remove();\n delete stickerSets[set.id];\n }\n });\n\n this.listenerSetter.add(rootScope)('stickers_order', ({type, order}) => {\n if(type !== 'stickers') {\n return;\n }\n\n order.forEach((id, idx) => {\n const row = stickerSets[id];\n if(!row) {\n return;\n }\n\n positionElementByIndex(row.container, stickersContent, idx)\n });\n });\n\n this.listenerSetter.add(rootScope)('stickers_top', (id) => {\n const row = stickerSets[id];\n if(!row) {\n return;\n }\n\n positionElementByIndex(row.container, stickersContent, 0);\n });\n\n new Sortable({\n list: stickersContent,\n middleware: this.middlewareHelper.get(),\n onSort: (idx, newIdx) => {\n const order = Array.from(stickersContent.children).map((el) => (el as HTMLElement).dataset.id);\n this.managers.appStickersManager.reorderStickerSets(order);\n }\n });\n\n this.scrollable.append(section.container);\n }\n\n return Promise.all(promises);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider';\nimport ButtonMenuToggle from '../../buttonMenuToggle';\nimport Button from '../../button';\nimport AppPrivacyAndSecurityTab from './privacyAndSecurity';\nimport AppGeneralSettingsTab from './generalSettings';\nimport AppEditProfileTab from './editProfile';\nimport AppChatFoldersTab from './chatFolders';\nimport AppNotificationsTab from './notifications';\nimport AppLanguageTab from './language';\nimport lottieLoader from '../../../lib/rlottie/lottieLoader';\nimport PopupPeer from '../../popups/peer';\nimport AppDataAndStorageTab from './dataAndStorage';\nimport ButtonIcon from '../../buttonIcon';\nimport PeerProfile from '../../peerProfile';\nimport rootScope from '../../../lib/rootScope';\nimport Row from '../../row';\nimport AppActiveSessionsTab from './activeSessions';\nimport {i18n, LangPackKey} from '../../../lib/langPack';\nimport {SliderSuperTabConstructable, SliderSuperTabEventable} from '../../sliderTab';\nimport PopupAvatar from '../../popups/avatar';\nimport {AccountAuthorizations, Authorization} from '../../../layer';\nimport PopupElement from '../../popups';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport SettingSection from '../../settingSection';\nimport AppStickersAndEmojiTab from './stickersAndEmoji';\nimport ButtonCorner from '../../buttonCorner';\n\nexport default class AppSettingsTab extends SliderSuperTab {\n private buttons: {\n edit: HTMLButtonElement,\n folders: HTMLButtonElement,\n general: HTMLButtonElement,\n notifications: HTMLButtonElement,\n storage: HTMLButtonElement,\n privacy: HTMLButtonElement,\n } = {} as any;\n private profile: PeerProfile;\n\n private languageRow: Row;\n private devicesRow: Row;\n\n private authorizations: Authorization.authorization[];\n private getAuthorizationsPromise: Promise;\n\n public async init() {\n this.container.classList.add('settings-container');\n this.setTitle('Settings');\n\n const btnMenu = ButtonMenuToggle({\n listenerSetter: this.listenerSetter,\n direction: 'bottom-left',\n buttons: [{\n icon: 'logout',\n text: 'EditAccount.Logout',\n onClick: () => {\n PopupElement.createPopup(PopupPeer, 'logout', {\n titleLangKey: 'LogOut',\n descriptionLangKey: 'LogOut.Description',\n buttons: [{\n langKey: 'LogOut',\n callback: () => {\n this.managers.apiManager.logOut();\n },\n isDanger: true\n }]\n }).show();\n }\n }]\n });\n\n this.buttons.edit = ButtonIcon('edit');\n\n this.header.append(this.buttons.edit, btnMenu);\n\n this.profile = new PeerProfile(this.managers, this.scrollable, this.listenerSetter, false);\n this.profile.init();\n this.profile.setPeer(rootScope.myId);\n const fillPromise = this.profile.fillProfileElements();\n\n const changeAvatarBtn = ButtonCorner({icon: 'cameraadd', className: 'profile-change-avatar'});\n attachClickEvent(changeAvatarBtn, () => {\n const canvas = document.createElement('canvas');\n PopupElement.createPopup(PopupAvatar).open(canvas, (upload) => {\n upload().then((inputFile) => {\n return this.managers.appProfileManager.uploadProfilePhoto(inputFile);\n });\n });\n }, {listenerSetter: this.listenerSetter});\n this.profile.element.lastElementChild.firstElementChild.append(changeAvatarBtn);\n\n const updateChangeAvatarBtn = async() => {\n const user = await this.managers.appUsersManager.getSelf();\n changeAvatarBtn.classList.toggle('hide', user.photo?._ !== 'userProfilePhoto');\n };\n\n updateChangeAvatarBtn();\n this.listenerSetter.add(rootScope)('avatar_update', ({peerId}) => {\n if(rootScope.myId === peerId) {\n updateChangeAvatarBtn();\n }\n });\n\n /* const div = document.createElement('div');\n //div.style.cssText = 'border-radius: 8px; overflow: hidden; width: 396px; height: 264px; flex: 0 0 auto; position: relative; margin: 10rem 0 10rem auto;';\n //div.style.width = '135px';\n //div.style.height = '100px';\n div.style.cssText = 'border-radius: 8px; overflow: hidden; width: 396px; height: 264px; flex: 0 0 auto; position: relative; margin: 10rem auto 10rem 0;';\n div.style.width = '135px';\n div.style.height = '100px';\n\n const img = document.createElement('img');\n img.src = 'assets/img/pepe.jpg';\n img.classList.add('media-photo');\n img.style.cssText = 'max-width: 100%;max-height: 100%;';\n\n div.append(img);\n\n div.addEventListener('click', () => {\n new AppMediaViewer().setSearchContext({peerId: 61004386, inputFilter: 'inputMessagesFilterPhotos'}).openMedia({\n _: 'message',\n mid: 1,\n peerId: 61004386,\n fromId: 61004386,\n message: '',\n media: {\n _: 'messageMediaPhoto',\n photo: {\n _: 'photo',\n url: img.src,\n downloaded: 111,\n sizes: [{\n _: 'photoSize',\n type: 'x',\n w: 618,\n h: 412\n }]\n }\n },\n date: Date.now() / 1000 | 0\n }, img);\n });\n\n this.scrollable.append(div); */\n\n const buttonsDiv = document.createElement('div');\n buttonsDiv.classList.add('profile-buttons');\n\n type ConstructorP = T extends {\n new (...args: any[]): infer U;\n } ? U : never;\n\n const m = (\n icon: string,\n text: LangPackKey,\n c: T,\n getInitArgs?: () => Promise['init']>>\n ): {\n icon: string,\n text: LangPackKey,\n tabConstructor: T,\n getInitArgs?: typeof getInitArgs,\n // args?: ReturnType\n args?: any\n } => {\n if(!getInitArgs) {\n const g = (c as any as typeof SliderSuperTab).getInitArgs;\n if(g) {\n // @ts-ignore\n getInitArgs = () => [g(this)];\n }\n }\n\n return {\n icon,\n text,\n tabConstructor: c,\n getInitArgs,\n args: getInitArgs?.()\n };\n };\n\n // const k = (c: T): () => [ReturnType['getInitArgs']>] => {\n // return () => (c as any).getInitArgs(this);\n // };\n\n const b = [\n m('unmute', 'AccountSettings.Notifications', AppNotificationsTab),\n m('data', 'DataSettings', AppDataAndStorageTab),\n m('lock', 'AccountSettings.PrivacyAndSecurity', AppPrivacyAndSecurityTab),\n m('settings', 'Telegram.GeneralSettingsViewController', AppGeneralSettingsTab),\n m('folder', 'AccountSettings.Filters', AppChatFoldersTab),\n m('stickers_face', 'StickersName', AppStickersAndEmojiTab)\n ];\n\n const rows = b.map((item) => {\n const {icon, text: langPackKey, tabConstructor, getInitArgs} = item;\n return new Row({\n titleLangKey: langPackKey,\n icon,\n clickable: async() => {\n const args = item.args ? await item.args : [];\n const tab = this.slider.createTab(tabConstructor as any);\n tab.open(...args);\n\n if(tab instanceof SliderSuperTabEventable && getInitArgs) {\n tab.eventListener.addEventListener('destroyAfter', (promise) => {\n item.args = promise.then(() => getInitArgs() as any);\n });\n }\n },\n listenerSetter: this.listenerSetter\n });\n });\n\n const languageArgs = AppLanguageTab.getInitArgs();\n rows.push(\n this.devicesRow = new Row({\n titleLangKey: 'Devices',\n titleRightSecondary: ' ',\n icon: 'activesessions',\n clickable: async() => {\n if(!this.authorizations) {\n await this.updateActiveSessions();\n }\n\n const tab = this.slider.createTab(AppActiveSessionsTab);\n tab.authorizations = this.authorizations;\n tab.eventListener.addEventListener('destroy', () => {\n this.authorizations = undefined;\n this.updateActiveSessions(true);\n }, {once: true});\n tab.open();\n },\n listenerSetter: this.listenerSetter\n }),\n\n this.languageRow = new Row({\n titleLangKey: 'AccountSettings.Language',\n titleRightSecondary: i18n('LanguageName'),\n icon: 'language',\n clickable: () => {\n this.slider.createTab(AppLanguageTab).open(languageArgs);\n },\n listenerSetter: this.listenerSetter\n })\n );\n\n buttonsDiv.append(...rows.map((row) => row.container));\n\n // const profileSection = new SettingSection({fullWidth: true, noPaddingTop: true});\n // profileSection.content.append(this.profile.element);\n\n const buttonsSection = new SettingSection();\n buttonsSection.content.append(buttonsDiv);\n\n this.scrollable.append(this.profile.element/* profileSection.container */, buttonsSection.container);\n\n const getEditProfileArgs = () => {\n editProfileArgs = AppEditProfileTab.getInitArgs();\n };\n let editProfileArgs: ReturnType;\n attachClickEvent(this.buttons.edit, () => {\n const tab = this.slider.createTab(AppEditProfileTab);\n tab.open(editProfileArgs);\n }, {listenerSetter: this.listenerSetter});\n getEditProfileArgs();\n // this.listenerSetter.add(rootScope)('user_full_update', (userId) => {\n // if(rootScope.myId.toUserId() === userId) {\n // getEditProfileArgs();\n // }\n // });\n this.listenerSetter.add(rootScope)('user_update', (userId) => {\n if(rootScope.myId.toUserId() === userId) {\n getEditProfileArgs();\n }\n });\n\n lottieLoader.loadLottieWorkers();\n\n this.updateActiveSessions();\n\n (await fillPromise)();\n }\n\n private getAuthorizations(overwrite?: boolean) {\n if(this.getAuthorizationsPromise && !overwrite) return this.getAuthorizationsPromise;\n\n const promise = this.getAuthorizationsPromise = this.managers.apiManager.invokeApi('account.getAuthorizations')\n .finally(() => {\n if(this.getAuthorizationsPromise === promise) {\n this.getAuthorizationsPromise = undefined;\n }\n });\n\n return promise;\n }\n\n public updateActiveSessions(overwrite?: boolean) {\n return this.getAuthorizations(overwrite).then((auths) => {\n this.authorizations = auths.authorizations;\n this.devicesRow.titleRight.textContent = '' + this.authorizations.length;\n });\n }\n\n public onCloseAfterTimeout() {\n this.profile.destroy();\n return super.onCloseAfterTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appSidebarLeft from '..';\nimport {InputFile} from '../../../layer';\nimport InputField from '../../inputField';\nimport {SliderSuperTab} from '../../slider';\nimport AvatarEdit from '../../avatarEdit';\nimport AppAddMembersTab from './addMembers';\nimport {_i18n} from '../../../lib/langPack';\nimport ButtonCorner from '../../buttonCorner';\nimport appImManager from '../../../lib/appManagers/appImManager';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport SettingSection from '../../settingSection';\n\nexport default class AppNewChannelTab extends SliderSuperTab {\n private uploadAvatar: () => Promise = null;\n\n private channelNameInputField: InputField;\n private channelDescriptionInputField: InputField;\n private nextBtn: HTMLButtonElement;\n private avatarEdit: AvatarEdit;\n\n public init() {\n this.container.classList.add('new-channel-container');\n this.setTitle('NewChannel');\n\n this.avatarEdit = new AvatarEdit((_upload) => {\n this.uploadAvatar = _upload;\n });\n\n const section = new SettingSection({\n caption: 'Channel.DescriptionHolderDescrpiton'\n });\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n this.channelNameInputField = new InputField({\n label: 'EnterChannelName',\n maxLength: 128\n });\n\n this.channelDescriptionInputField = new InputField({\n label: 'DescriptionOptionalPlaceholder',\n maxLength: 255\n });\n\n inputWrapper.append(this.channelNameInputField.container, this.channelDescriptionInputField.container);\n\n const onLengthChange = () => {\n this.nextBtn.classList.toggle('is-visible', !!this.channelNameInputField.value.length &&\n !this.channelNameInputField.input.classList.contains('error') &&\n !this.channelDescriptionInputField.input.classList.contains('error'));\n };\n\n this.channelNameInputField.input.addEventListener('input', onLengthChange);\n this.channelDescriptionInputField.input.addEventListener('input', onLengthChange);\n\n this.nextBtn = ButtonCorner({icon: 'arrow_next'});\n\n attachClickEvent(this.nextBtn, () => {\n const title = this.channelNameInputField.value;\n const about = this.channelDescriptionInputField.value;\n\n this.nextBtn.disabled = true;\n this.managers.appChatsManager.createChannel({\n title,\n about,\n broadcast: true\n }).then((channelId) => {\n if(this.uploadAvatar) {\n this.uploadAvatar().then((inputFile) => {\n this.managers.appChatsManager.editPhoto(channelId, inputFile);\n });\n }\n\n appImManager.setInnerPeer({peerId: channelId.toPeerId(true)});\n\n appSidebarLeft.removeTabFromHistory(this);\n this.slider.createTab(AppAddMembersTab).open({\n type: 'channel',\n skippable: true,\n title: 'GroupAddMembers',\n placeholder: 'SendMessageTo',\n takeOut: (peerIds) => {\n return this.managers.appChatsManager.inviteToChannel(channelId, peerIds);\n }\n });\n });\n }, {listenerSetter: this.listenerSetter});\n\n this.content.append(this.nextBtn);\n section.content.append(this.avatarEdit.container, inputWrapper);\n this.scrollable.append(section.container);\n }\n\n public onCloseAfterTimeout() {\n this.avatarEdit.clear();\n this.uploadAvatar = null;\n this.channelNameInputField.value = '';\n this.channelDescriptionInputField.value = '';\n this.nextBtn.disabled = false;\n return super.onCloseAfterTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport InputField from '../inputField';\nimport PopupElement from '.';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport EditPeer from '../editPeer';\nimport {_i18n} from '../../lib/langPack';\nimport TelInputField from '../telInputField';\nimport {formatPhoneNumber} from '../../helpers/formatPhoneNumber';\nimport {toastNew} from '../toast';\n\nexport default class PopupCreateContact extends PopupElement {\n constructor() {\n super('popup-create-contact popup-send-photo popup-new-media', {closable: true, withConfirm: 'Add', title: 'AddContactTitle'});\n this.construct();\n }\n\n private async construct() {\n attachClickEvent(this.btnConfirm, () => {\n const promise = this.managers.appUsersManager.importContact(nameInputField.value, lastNameInputField.value, telInputField.value);\n\n promise.then(() => {\n this.hide();\n }, (err) => {\n if(err.type === 'NO_USER') {\n toastNew({langPackKey: 'Contacts.PhoneNumber.NotRegistred'});\n editPeer.disabled = false;\n }\n });\n\n editPeer.lockWithPromise(promise);\n }, {listenerSetter: this.listenerSetter});\n\n const inputFields: InputField[] = [];\n const div = document.createElement('div');\n div.classList.add('name-fields');\n const nameInputField = new InputField({\n label: 'FirstName',\n name: 'create-contact-name',\n maxLength: 70,\n required: true\n });\n const lastNameInputField = new InputField({\n label: 'LastName',\n name: 'create-contact-lastname',\n maxLength: 70\n });\n const telInputField = new TelInputField({required: true});\n inputFields.push(nameInputField, lastNameInputField, telInputField);\n\n const onInput = () => {\n const name = nameInputField.value + ' ' + lastNameInputField.value;\n // const abbr = getAbbreviation(name);\n editPeer.avatarElem.peerTitle = name;\n editPeer.avatarElem.update();\n };\n\n this.listenerSetter.add(nameInputField.input)('input', onInput);\n this.listenerSetter.add(lastNameInputField.input)('input', onInput);\n\n telInputField.validate = () => {\n return !!telInputField.value.match(/\\d/);\n };\n\n const user = await this.managers.appUsersManager.getSelf();\n const formatted = formatPhoneNumber(user.phone);\n if(formatted.code) {\n telInputField.value = '+' + formatted.code.country_code;\n }\n\n const editPeer = new EditPeer({\n inputFields,\n listenerSetter: this.listenerSetter,\n doNotEditAvatar: true,\n nextBtn: this.btnConfirm,\n avatarSize: 100\n });\n\n div.append(nameInputField.container, lastNameInputField.container, editPeer.avatarElem);\n this.container.append(div, telInputField.container);\n\n this.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider';\nimport appDialogsManager from '../../../lib/appManagers/appDialogsManager';\nimport InputSearch from '../../inputSearch';\nimport {IS_MOBILE} from '../../../environment/userAgent';\nimport {canFocus} from '../../../helpers/dom/canFocus';\nimport windowSize from '../../../helpers/windowSize';\nimport ButtonCorner from '../../buttonCorner';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport PopupCreateContact from '../../popups/createContact';\nimport SortedUserList from '../../sortedUserList';\nimport {getMiddleware} from '../../../helpers/middleware';\nimport replaceContent from '../../../helpers/dom/replaceContent';\nimport rootScope from '../../../lib/rootScope';\nimport PopupElement from '../../popups';\n\n// TODO: поиск по людям глобальный, если не нашло в контактах никого\n\nexport default class AppContactsTab extends SliderSuperTab {\n private inputSearch: InputSearch;\n private middleware: ReturnType;\n private sortedUserList: SortedUserList;\n\n public init() {\n this.container.id = 'contacts-container';\n\n // this.list = appDialogsManager.createChatList(/* {avatarSize: 48, handheldsSize: 66} */);\n\n const btnAdd = ButtonCorner({icon: 'add', className: 'is-visible'});\n this.content.append(btnAdd);\n\n attachClickEvent(btnAdd, () => {\n PopupElement.createPopup(PopupCreateContact);\n }, {listenerSetter: this.listenerSetter});\n\n this.inputSearch = new InputSearch('Search', (value) => {\n this.openContacts(value);\n });\n\n this.listenerSetter.add(rootScope)('contacts_update', async(userId) => {\n const isContact = await this.managers.appUsersManager.isContact(userId);\n const peerId = userId.toPeerId();\n if(isContact) this.sortedUserList.add(peerId);\n else this.sortedUserList.delete(peerId);\n });\n\n this.title.replaceWith(this.inputSearch.container);\n\n this.middleware = getMiddleware();\n\n this.openContacts();\n\n // preload contacts\n // appUsersManager.getContacts();\n }\n\n protected createList() {\n const sortedUserList = new SortedUserList({\n managers: this.managers\n });\n const list = sortedUserList.list;\n list.id = 'contacts';\n list.classList.add('contacts-container');\n appDialogsManager.setListClickListener(list, () => {\n this.close();\n }, undefined, true);\n return sortedUserList;\n }\n\n protected onClose() {\n this.middleware.clean();\n /* // need to clear, and left 1 page for smooth slide\n let pageCount = appPhotosManager.windowH / 56 * 1.25 | 0;\n (Array.from(this.list.children) as HTMLElement[]).slice(pageCount).forEach((el) => el.remove()); */\n }\n\n protected onOpenAfterTimeout() {\n if(IS_MOBILE || !canFocus(true)) return;\n this.inputSearch.input.focus();\n }\n\n public openContacts(query?: string) {\n this.middleware.clean();\n const middleware = this.middleware.get();\n this.scrollable.onScrolledBottom = null;\n this.scrollable.container.textContent = '';\n\n this.managers.appUsersManager.getContactsPeerIds(query, undefined, 'online').then((contacts) => {\n if(!middleware()) {\n return;\n }\n\n const sortedUserList = this.sortedUserList = this.createList();\n\n let renderPage = () => {\n const pageCount = windowSize.height / 56 * 1.25 | 0;\n const arr = contacts.splice(0, pageCount); // надо splice!\n\n arr.forEach((peerId) => {\n sortedUserList.add(peerId);\n });\n\n if(!contacts.length) {\n renderPage = undefined;\n this.scrollable.onScrolledBottom = null;\n }\n };\n\n renderPage();\n this.scrollable.onScrolledBottom = () => {\n if(renderPage) {\n renderPage();\n } else {\n this.scrollable.onScrolledBottom = null;\n }\n };\n\n replaceContent(this.scrollable.container, sortedUserList.list);\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appDialogsManager from '../../../lib/appManagers/appDialogsManager';\nimport {SliderSuperTab} from '../../slider';\nimport {FOLDER_ID_ARCHIVE, REAL_FOLDER_ID} from '../../../lib/mtproto/mtproto_config';\n\nexport default class AppArchivedTab extends SliderSuperTab {\n private static filterId: REAL_FOLDER_ID = FOLDER_ID_ARCHIVE;\n private wasFilterId: number;\n\n public init() {\n this.wasFilterId = appDialogsManager.filterId;\n\n this.container.id = 'chats-archived-container';\n this.setTitle('ArchivedChats');\n\n this.header.classList.add('can-have-forum');\n this.content.classList.add('can-have-forum');\n\n if(!appDialogsManager.xds[AppArchivedTab.filterId]) {\n const {ul, scrollable} = appDialogsManager.l({\n title: undefined,\n id: AppArchivedTab.filterId,\n localId: FOLDER_ID_ARCHIVE\n });\n scrollable.container.append(ul);\n }\n\n const scrollable = appDialogsManager.xds[AppArchivedTab.filterId].scrollable;\n this.scrollable.container.replaceWith(scrollable.container);\n scrollable.attachBorderListeners(this.container);\n // ! DO NOT UNCOMMENT NEXT LINE - chats will stop loading on scroll after closing the tab\n // this.scrollable = scrollable;\n return appDialogsManager.setFilterIdAndChangeTab(AppArchivedTab.filterId).then(({cached, renderPromise}) => {\n if(cached) {\n return renderPromise;\n }\n });\n }\n\n // вообще, так делать нельзя, но нет времени чтобы переделать главный чатлист на слайд...\n onOpenAfterTimeout() {\n appDialogsManager.xds[this.wasFilterId].clear();\n }\n\n onClose() {\n this.scrollable.onAdditionalScroll = undefined;\n appDialogsManager.setFilterIdAndChangeTab(this.wasFilterId);\n }\n\n onCloseAfterTimeout() {\n appDialogsManager.xds[AppArchivedTab.filterId].clear();\n return super.onCloseAfterTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider';\nimport ButtonCorner from '../../buttonCorner';\nimport AppNewGroupTab from './newGroup';\nimport {toast} from '../../toast';\nimport {ButtonMenuItemOptions} from '../../buttonMenu';\nimport {i18n, join, _i18n} from '../../../lib/langPack';\nimport rootScope from '../../../lib/rootScope';\nimport wrapSticker from '../../wrappers/sticker';\nimport SortedUserList from '../../sortedUserList';\nimport {PeerLocated, Update, Updates} from '../../../layer';\nimport {SettingChatListSection} from '..';\nimport appDialogsManager from '../../../lib/appManagers/appDialogsManager';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport confirmationPopup from '../../confirmationPopup';\nimport getPeerId from '../../../lib/appManagers/utils/peers/getPeerId';\nimport type LazyLoadQueue from '../../lazyLoadQueue';\n\nexport default class AppPeopleNearbyTab extends SliderSuperTab {\n private latestLocationSaved: {latitude: number, longitude: number, accuracy: number};\n private isLocationWatched: boolean = false;\n private errorCategory: HTMLElement;\n private retryBtn: HTMLButtonElement;\n private btnOptions: HTMLButtonElement;\n private menuButtons: (ButtonMenuItemOptions & {verify?: () => boolean})[];\n\n protected lazyLoadQueue: LazyLoadQueue;\n protected peopleSection: SettingChatListSection;\n protected chatsSection: SettingChatListSection;\n\n protected locatedPeers: Map;\n\n // public async init() {\n // this.container.classList.add('people-nearby-container');\n // this.setTitle('PeopleNearby');\n\n // this.errorCategory = document.createElement('div');\n // this.errorCategory.classList.add('text', 'hide', 'nearby-error');\n\n // this.retryBtn = ButtonCorner({icon: 'check'});\n\n // const emoji = '🧭';\n // const doc = await this.managers.appStickersManager.getAnimatedEmojiSticker(emoji);\n // const stickerContainer = document.createElement('div');\n // stickerContainer.classList.add('sticker-container');\n\n // if(doc) {\n // wrapSticker({\n // doc,\n // div: stickerContainer,\n // loop: false,\n // play: true,\n // width: 86,\n // height: 86,\n // emoji,\n // needUpscale: true\n // }).then(() => {\n // // this.animation = player;\n // });\n // } else {\n // stickerContainer.classList.add('media-sticker-wrapper');\n // }\n\n // const caption = document.createElement('div');\n // caption.classList.add('caption');\n // _i18n(caption, 'PeopleNearbyInfo2');\n\n // this.locatedPeers = new Map();\n\n // const m = () => {\n // const sortedUserList = new SortedUserList({\n // avatarSize: 42,\n // createChatListOptions: {\n // dialogSize: 48,\n // new: true\n // },\n // autonomous: false,\n // onUpdate: (element) => {\n // const peer = this.locatedPeers.get(element.id);\n // const elements: HTMLElement[] = [\n // this.parseDistance(peer.distance)\n // ];\n\n // if(!element.id.isUser()) {\n // elements.push(this.managers.appProfileManager.getChatMembersString(element.id.toChatId()));\n // }\n\n // element.dom.lastMessageSpan.textContent = '';\n // element.dom.lastMessageSpan.append(...join(elements, false));\n // },\n // getIndex: (element) => {\n // const peer = this.locatedPeers.get(element.id);\n // return 0x7FFFFFFF - peer.distance;\n // },\n // appUsersManager: this.managers.appUsersManager\n // });\n\n // appDialogsManager.setListClickListener(sortedUserList.list, undefined, undefined, false);\n\n // return sortedUserList;\n // };\n\n // const peopleSection = this.peopleSection = new SettingChatListSection({\n // name: 'PeopleNearbyHeader',\n // sortedList: m()\n // });\n\n // const chatsSection = this.chatsSection = new SettingChatListSection({\n // name: 'ChatsNearbyHeader',\n // sortedList: m()\n // });\n\n // const btnMakeVisible = peopleSection.makeButton({\n // text: 'MakeMyselfVisible',\n // icon: 'location'\n // });\n\n // const btnMakeInvisible = peopleSection.makeButton({\n // text: 'StopShowingMe',\n // icon: 'location'\n // });\n\n // const btnCreateGroup = chatsSection.makeButton({\n // text: 'NearbyCreateGroup',\n // icon: 'newgroup'\n // });\n\n // attachClickEvent(btnMakeVisible, () => {\n // confirmationPopup({\n // titleLangKey: 'MakeMyselfVisibleTitle',\n // descriptionLangKey: 'MakeMyselfVisibleInfo',\n // button: {\n // langKey: 'OK'\n // }\n // }).then(() => {\n // this.startWatching();\n // });\n // }, {listenerSetter: this.listenerSetter});\n\n // attachClickEvent(btnMakeInvisible, () => {\n // this.stopWatching();\n // }, {listenerSetter: this.listenerSetter});\n\n // attachClickEvent(btnCreateGroup, () => {\n // this.slider.createTab(AppNewGroupTab).open([], true);\n // }, {listenerSetter: this.listenerSetter});\n\n // btnMakeVisible.classList.add('primary');\n // btnMakeInvisible.classList.add('danger');\n // btnCreateGroup.classList.add('primary');\n\n // this.content.append(this.retryBtn);\n // this.scrollable.append(\n // stickerContainer,\n // caption,\n // peopleSection.container,\n // chatsSection.container,\n // this.errorCategory\n // );\n // }\n\n private parseDistance(distance: number) {\n if(rootScope.settings.distanceUnit === 'miles') {\n if(distance > 1609.34) {\n return i18n('MilesAway', [Math.round(distance / 1609)]);\n } else {\n return i18n('FootsAway', [Math.round(distance * 3.281)]);\n }\n } else {\n if(distance >= 1000) {\n return i18n('KMetersAway2', [distance / 1000]);\n } else {\n return i18n('MetersAway2', [distance]);\n }\n }\n }\n\n // public open() {\n // const result = super.open();\n // result.then(() => {\n // this.retryBtn.classList.remove('is-visible');\n // navigator.geolocation.getCurrentPosition((location) => {\n // this.latestLocationSaved = {\n // latitude: location.coords.latitude,\n // longitude: location.coords.longitude,\n // accuracy: location.coords.accuracy\n // };\n\n // console.log(this.latestLocationSaved);\n\n // this.managers.appUsersManager.getLocated(\n // location.coords.latitude,\n // location.coords.longitude,\n // location.coords.accuracy\n // ).then((response) => {\n // const update = (response as Updates.updates).updates[0] as Update.updatePeerLocated;\n // const peers = update.peers as PeerLocated.peerLocated[];\n // const orderedPeers = peers.sort((a, b) => a.distance - b.distance);\n // const groupsCounter = peers.filter((e) => e.peer._ == 'peerChannel').length;\n // const usersCounter = peers.filter((e) => e.peer._ != 'peerChannel').length;\n // orderedPeers?.forEach((peer) => {\n // const peerId = getPeerId(peer.peer);\n // const section = peerId.isUser() ? this.peopleSection : this.chatsSection;\n // this.locatedPeers.set(peerId, peer);\n // section.sortedList.add(peerId);\n // });\n\n // this.errorCategory.classList.toggle('hide', !!(usersCounter || groupsCounter));\n // this.errorCategory.innerHTML = 'No groups or channels found around you.';\n // });\n // }, (error) => {\n // this.errorCategory.classList.remove('hide');\n // this.retryBtn.classList.add('is-visible');\n // this.retryBtn.addEventListener('click', this.open);\n // if(error instanceof GeolocationPositionError) {\n // this.errorCategory.innerHTML = 'Location permission denied. Click below to retry.';\n // } else {\n // this.errorCategory.innerHTML = 'An error has occurred. Please retry later clicking the button below.';\n // }\n // });\n // });\n\n // return result;\n // }\n\n private startWatching() {\n if(!this.latestLocationSaved || this.isLocationWatched) return;\n this.isLocationWatched = true;\n\n toast('Your position is now being shared. Do not close the page or it will be suspended.');\n\n this.managers.appUsersManager.getLocated(\n this.latestLocationSaved.latitude,\n this.latestLocationSaved.longitude,\n this.latestLocationSaved.accuracy,\n true, // background parameter\n 0x7fffffff // self_expires parameter\n );\n\n navigator.geolocation.watchPosition((result) => {\n const isLongitudeDifferent = result.coords.longitude !== this.latestLocationSaved.longitude;\n const isLatitudeDifferent = result.coords.latitude !== this.latestLocationSaved.latitude;\n const distanceCheck = this.calculateDistance(\n result.coords.latitude, result.coords.longitude,\n this.latestLocationSaved.latitude, this.latestLocationSaved.longitude\n ) > 100;\n\n if((isLatitudeDifferent || isLongitudeDifferent) && distanceCheck) {\n this.managers.appUsersManager.getLocated(\n result.coords.latitude,\n result.coords.longitude,\n result.coords.accuracy,\n true, // background parameter\n 0x7fffffff // self_expires parameter\n );\n this.latestLocationSaved = {\n latitude: result.coords.latitude,\n longitude: result.coords.longitude,\n accuracy: result.coords.accuracy\n }\n }\n });\n }\n\n private stopWatching() {\n if(!this.isLocationWatched) return;\n this.isLocationWatched = false;\n toast('The sharing of your position has been stopped. You will no longer be visible to other users.');\n this.managers.appUsersManager.getLocated(\n 0, // latitude parameter\n 0, // longitude parameter\n 0, // accuracy parameter\n false, // background parameter\n 0 // self_expires parameter\n );\n }\n\n private calculateDistance(lat1: number, long1: number, lat2: number, long2: number) {\n const p = 0.017453292519943295; // Math.PI/180\n return (\n 12742 * Math.asin(\n Math.sqrt(\n (0.5 - Math.cos((lat2 - lat1) * p)) +\n (\n Math.cos(lat1 * p) * Math.cos(lat2 * p) *\n (1 - Math.cos((long2 - long1) * p)/2)\n )\n )\n )\n );\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appImManager from '../../lib/appManagers/appImManager';\nimport rootScope from '../../lib/rootScope';\nimport {SearchGroup} from '../appSearch';\nimport '../avatar';\nimport Scrollable, {ScrollableX} from '../scrollable';\nimport InputSearch from '../inputSearch';\nimport SidebarSlider from '../slider';\nimport TransitionSlider from '../transition';\nimport AppNewGroupTab from './tabs/newGroup';\nimport AppSearchSuper from '../appSearchSuper.';\nimport {DateData, fillTipDates} from '../../helpers/date';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport AppSettingsTab from './tabs/settings';\nimport AppNewChannelTab from './tabs/newChannel';\nimport AppContactsTab from './tabs/contacts';\nimport AppArchivedTab from './tabs/archivedTab';\nimport AppAddMembersTab from './tabs/addMembers';\nimport I18n, {FormatterArguments, i18n, i18n_, LangPackKey} from '../../lib/langPack';\nimport AppPeopleNearbyTab from './tabs/peopleNearby';\nimport {ButtonMenuItemOptions} from '../buttonMenu';\nimport CheckboxField from '../checkboxField';\nimport {IS_MOBILE_SAFARI} from '../../environment/userAgent';\nimport appNavigationController, {NavigationItem} from '../appNavigationController';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport PeerTitle from '../peerTitle';\nimport App from '../../config/app';\nimport ButtonMenuToggle from '../buttonMenuToggle';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport sessionStorage from '../../lib/sessionStorage';\nimport {attachClickEvent, CLICK_EVENT_NAME, simulateClickEvent} from '../../helpers/dom/clickEvent';\nimport ButtonIcon from '../buttonIcon';\nimport confirmationPopup from '../confirmationPopup';\nimport IS_GEOLOCATION_SUPPORTED from '../../environment/geolocationSupport';\nimport type SortedUserList from '../sortedUserList';\nimport Button, {ButtonOptions} from '../button';\nimport noop from '../../helpers/noop';\nimport ripple from '../ripple';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport formatNumber from '../../helpers/number/formatNumber';\nimport AvatarElement from '../avatar';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport themeController from '../../helpers/themeController';\nimport contextMenuController from '../../helpers/contextMenuController';\nimport {DIALOG_LIST_ELEMENT_TAG} from '../../lib/appManagers/appDialogsManager';\nimport apiManagerProxy from '../../lib/mtproto/mtprotoworker';\nimport SettingSection, {SettingSectionOptions} from '../settingSection';\nimport {FOLDER_ID_ARCHIVE} from '../../lib/mtproto/mtproto_config';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport {fastRaf} from '../../helpers/schedulers';\nimport {getInstallPrompt} from '../../helpers/dom/installPrompt';\nimport liteMode from '../../helpers/liteMode';\nimport AppPowerSavingTab from './tabs/powerSaving';\n\nexport const LEFT_COLUMN_ACTIVE_CLASSNAME = 'is-left-column-shown';\n\nexport class AppSidebarLeft extends SidebarSlider {\n private toolsBtn: HTMLElement;\n private backBtn: HTMLButtonElement;\n // private searchInput = document.getElementById('global-search') as HTMLInputElement;\n private inputSearch: InputSearch;\n\n public archivedCount: HTMLSpanElement;\n public rect: DOMRect;\n\n private newBtnMenu: HTMLElement;\n\n // private log = logger('SL');\n\n private searchGroups: {[k in 'contacts' | 'globalContacts' | 'messages' | 'people' | 'recent']: SearchGroup} = {} as any;\n private searchSuper: AppSearchSuper;\n\n private updateBtn: HTMLElement;\n private hasUpdate: boolean;\n\n constructor() {\n super({\n sidebarEl: document.getElementById('column-left') as HTMLDivElement,\n navigationType: 'left'\n });\n }\n\n construct(managers: AppManagers) {\n this.managers = managers;\n // this._selectTab(0); // make first tab as default\n\n this.inputSearch = new InputSearch('Search');\n const sidebarHeader = this.sidebarEl.querySelector('.item-main .sidebar-header');\n sidebarHeader.append(this.inputSearch.container);\n\n const onNewGroupClick = () => {\n this.createTab(AppAddMembersTab).open({\n type: 'chat',\n skippable: true,\n takeOut: (peerIds) => this.createTab(AppNewGroupTab).open(peerIds),\n title: 'GroupAddMembers',\n placeholder: 'SendMessageTo'\n });\n };\n\n const onContactsClick = () => {\n this.createTab(AppContactsTab).open();\n };\n\n // this.toolsBtn = this.sidebarEl.querySelector('.sidebar-tools-button') as HTMLButtonElement;\n this.backBtn = this.sidebarEl.querySelector('.sidebar-back-button') as HTMLButtonElement;\n\n const btnArchive: typeof menuButtons[0] = {\n icon: 'archive',\n text: 'ArchivedChats',\n onClick: () => {\n this.createTab(AppArchivedTab).open();\n },\n verify: async() => {\n const folder = await this.managers.dialogsStorage.getFolderDialogs(FOLDER_ID_ARCHIVE, false);\n return !!folder.length || !(await this.managers.dialogsStorage.isDialogsLoaded(FOLDER_ID_ARCHIVE));\n }\n };\n\n const themeCheckboxField = new CheckboxField({\n toggle: true,\n checked: themeController.getTheme().name === 'night'\n });\n themeCheckboxField.input.addEventListener('change', async() => {\n themeController.switchTheme(themeCheckboxField.input.checked ? 'night' : 'day');\n });\n\n rootScope.addEventListener('theme_change', () => {\n themeCheckboxField.setValueSilently(themeController.getTheme().name === 'night');\n });\n\n const menuButtons: (ButtonMenuItemOptions & {verify?: () => boolean | Promise})[] = [{\n icon: 'savedmessages',\n text: 'SavedMessages',\n onClick: () => {\n setTimeout(() => { // menu doesn't close if no timeout (lol)\n appImManager.setPeer({\n peerId: appImManager.myId\n });\n }, 0);\n }\n }, btnArchive, {\n icon: 'user',\n text: 'Contacts',\n onClick: onContactsClick\n }, IS_GEOLOCATION_SUPPORTED ? {\n icon: 'group',\n text: 'PeopleNearby',\n onClick: () => {\n this.createTab(AppPeopleNearbyTab).open();\n }\n } : undefined, {\n icon: 'settings',\n text: 'Settings',\n onClick: () => {\n this.createTab(AppSettingsTab).open();\n }\n }, {\n icon: 'darkmode',\n text: 'DarkMode',\n onClick: () => {\n\n },\n checkboxField: themeCheckboxField\n }, {\n icon: 'animations',\n text: 'Animations',\n onClick: () => {\n\n },\n checkboxField: new CheckboxField({\n toggle: true,\n checked: true,\n stateKey: 'settings.liteMode.animations',\n stateValueReverse: true\n }),\n verify: () => !liteMode.isEnabled()\n }, {\n icon: 'animations',\n text: 'LiteMode.Title',\n onClick: () => {\n this.createTab(AppPowerSavingTab).open();\n },\n verify: () => liteMode.isEnabled()\n }, {\n icon: 'help',\n text: 'TelegramFeatures',\n onClick: () => {\n const url = I18n.format('TelegramFeaturesUrl', true);\n appImManager.openUrl(url);\n }\n }, {\n icon: 'bug',\n text: 'ReportBug',\n onClick: () => {\n const a = document.createElement('a');\n a.target = '_blank';\n a.href = 'https://bugs.telegram.org/?tag_ids=40&sort=time';\n document.body.append(a);\n a.click();\n setTimeout(() => {\n a.remove();\n }, 0);\n }\n }, {\n icon: 'char z',\n text: 'ChatList.Menu.SwitchTo.Z',\n onClick: () => {\n Promise.all([\n sessionStorage.set({kz_version: 'Z'}),\n sessionStorage.delete('tgme_sync')\n ]).then(() => {\n location.href = 'https://web.telegram.org/z/';\n });\n },\n verify: () => App.isMainDomain\n }, /* {\n icon: 'char w',\n text: 'ChatList.Menu.SwitchTo.Webogram',\n onClick: () => {\n sessionStorage.delete('tgme_sync').then(() => {\n location.href = 'https://web.telegram.org/?legacy=1';\n });\n },\n verify: () => App.isMainDomain\n }, */ {\n icon: 'download',\n text: 'PWA.Install',\n onClick: () => {\n const installPrompt = getInstallPrompt();\n installPrompt?.();\n },\n verify: () => !!getInstallPrompt()\n }];\n\n const filteredButtons = menuButtons.filter(Boolean);\n\n this.toolsBtn = ButtonMenuToggle({\n direction: 'bottom-right',\n buttons: filteredButtons,\n onOpen: (e, btnMenu) => {\n const btnMenuFooter = document.createElement('a');\n btnMenuFooter.href = 'https://github.com/morethanwords/tweb/blob/master/CHANGELOG.md';\n btnMenuFooter.target = '_blank';\n btnMenuFooter.rel = 'noopener noreferrer';\n btnMenuFooter.classList.add('btn-menu-footer');\n btnMenuFooter.addEventListener(CLICK_EVENT_NAME, (e) => {\n e.stopPropagation();\n contextMenuController.close();\n });\n const t = document.createElement('span');\n t.classList.add('btn-menu-footer-text');\n t.innerHTML = 'Telegram Web' + App.suffix + ' '/* ' alpha ' */ + App.versionFull;\n btnMenuFooter.append(t);\n btnMenu.classList.add('has-footer');\n btnMenu.append(btnMenuFooter);\n\n btnArchive.element?.append(this.archivedCount);\n }\n });\n this.toolsBtn.classList.remove('tgico-more');\n this.toolsBtn.classList.add('sidebar-tools-button', 'is-visible');\n\n this.backBtn.parentElement.insertBefore(this.toolsBtn, this.backBtn);\n\n this.newBtnMenu = ButtonMenuToggle({\n direction: 'top-left',\n buttons: [{\n icon: 'newchannel',\n text: 'NewChannel',\n onClick: () => {\n this.createTab(AppNewChannelTab).open();\n }\n }, {\n icon: 'newgroup',\n text: 'NewGroup',\n onClick: onNewGroupClick\n }, {\n icon: 'newprivate',\n text: 'NewPrivateChat',\n onClick: onContactsClick\n }]\n });\n this.newBtnMenu.className = 'btn-circle rp btn-corner z-depth-1 btn-menu-toggle animated-button-icon';\n this.newBtnMenu.tabIndex = -1;\n this.newBtnMenu.insertAdjacentHTML('afterbegin', `\n \n \n `);\n this.newBtnMenu.id = 'new-menu';\n sidebarHeader.nextElementSibling.append(this.newBtnMenu);\n\n this.updateBtn = document.createElement('div');\n this.updateBtn.className = 'btn-circle rp btn-corner z-depth-1 btn-update is-hidden';\n this.updateBtn.tabIndex = -1;\n ripple(this.updateBtn);\n this.updateBtn.append(i18n('Update'));\n\n attachClickEvent(this.updateBtn, () => {\n if(this.updateBtn.classList.contains('is-hidden')) {\n return;\n }\n\n location.reload();\n });\n\n sidebarHeader.nextElementSibling.append(this.updateBtn);\n\n this.inputSearch.input.addEventListener('focus', () => this.initSearch(), {once: true});\n\n this.archivedCount = document.createElement('span');\n this.archivedCount.className = 'archived-count badge badge-24 badge-gray';\n\n rootScope.addEventListener('folder_unread', (folder) => {\n if(folder.id === FOLDER_ID_ARCHIVE) {\n // const count = folder.unreadMessagesCount;\n const count = folder.unreadPeerIds.size;\n this.archivedCount.textContent = '' + formatNumber(count, 1);\n this.archivedCount.classList.toggle('hide', !count);\n }\n });\n\n this.managers.appUsersManager.getTopPeers('correspondents');\n\n // Focus search input by pressing Escape\n const navigationItem: NavigationItem = {\n type: 'global-search-focus',\n onPop: () => {\n setTimeout(() => {\n this.inputSearch.input.focus();\n }, 0);\n\n return false;\n },\n noHistory: true\n };\n appNavigationController.pushItem(navigationItem);\n\n apiManagerProxy.getState().then(() => {\n const CHECK_UPDATE_INTERVAL = 1800e3;\n const checkUpdateInterval = setInterval(() => {\n fetch('version', {cache: 'no-cache'})\n .then((res) => (res.status === 200 && res.ok && res.text()) || Promise.reject())\n .then((text) => {\n if(text !== App.versionFull) {\n this.hasUpdate = true;\n clearInterval(checkUpdateInterval);\n\n if(!this.newBtnMenu.classList.contains('is-hidden')) {\n this.updateBtn.classList.remove('is-hidden');\n }\n }\n })\n .catch(noop);\n }, CHECK_UPDATE_INTERVAL);\n });\n\n const onResize = () => {\n const rect = this.rect = this.tabsContainer.getBoundingClientRect();\n document.documentElement.style.setProperty('--left-column-width', rect.width + 'px');\n };\n\n fastRaf(onResize);\n mediaSizes.addEventListener('resize', onResize);\n }\n\n private initSearch() {\n const searchContainer = this.sidebarEl.querySelector('#search-container') as HTMLDivElement;\n\n const scrollable = new Scrollable(searchContainer);\n\n const close = () => {\n // setTimeout(() => {\n simulateClickEvent(this.backBtn);\n // }, 0);\n };\n\n this.searchGroups = {\n contacts: new SearchGroup('SearchAllChatsShort', 'contacts', undefined, undefined, undefined, undefined, close),\n globalContacts: new SearchGroup('GlobalSearch', 'contacts', undefined, undefined, undefined, undefined, close),\n messages: new SearchGroup('SearchMessages', 'messages'),\n people: new SearchGroup(false, 'contacts', true, 'search-group-people', true, false, close, true),\n recent: new SearchGroup('Recent', 'contacts', true, 'search-group-recent', true, true, close)\n };\n\n const searchSuper = this.searchSuper = new AppSearchSuper({\n mediaTabs: [{\n inputFilter: 'inputMessagesFilterEmpty',\n name: 'FilterChats',\n type: 'chats'\n }, {\n inputFilter: 'inputMessagesFilterPhotoVideo',\n name: 'SharedMediaTab2',\n type: 'media'\n }, {\n inputFilter: 'inputMessagesFilterUrl',\n name: 'SharedLinksTab2',\n type: 'links'\n }, {\n inputFilter: 'inputMessagesFilterDocument',\n name: 'SharedFilesTab2',\n type: 'files'\n }, {\n inputFilter: 'inputMessagesFilterMusic',\n name: 'SharedMusicTab2',\n type: 'music'\n }, {\n inputFilter: 'inputMessagesFilterRoundVoice',\n name: 'SharedVoiceTab2',\n type: 'voice'\n }],\n scrollable,\n searchGroups: this.searchGroups,\n asChatList: true,\n hideEmptyTabs: false,\n showSender: true,\n managers: this.managers\n });\n\n searchContainer.prepend(searchSuper.nav.parentElement.parentElement);\n scrollable.container.append(searchSuper.container);\n\n const resetSearch = () => {\n searchSuper.setQuery({\n peerId: ''.toPeerId(),\n folderId: 0\n });\n searchSuper.selectTab(0);\n searchSuper.load(true);\n };\n\n resetSearch();\n\n const pickedElements: HTMLElement[] = [];\n let selectedPeerId: PeerId = ''.toPeerId();\n let selectedMinDate = 0;\n let selectedMaxDate = 0;\n const updatePicked = () => {\n // (this.inputSearch.input as HTMLInputElement).placeholder = pickedElements.length ? 'Search' : 'Telegram Search';\n this.inputSearch.container.classList.toggle('is-picked-twice', pickedElements.length === 2);\n this.inputSearch.container.classList.toggle('is-picked', !!pickedElements.length);\n\n if(pickedElements.length) {\n this.inputSearch.input.style.setProperty('--paddingLeft', (pickedElements[pickedElements.length - 1].getBoundingClientRect().right - this.inputSearch.input.getBoundingClientRect().left) + 'px');\n } else {\n this.inputSearch.input.style.removeProperty('--paddingLeft');\n }\n };\n\n const helper = document.createElement('div');\n helper.classList.add('search-helper');\n helper.addEventListener('click', (e) => {\n const target = findUpClassName(e.target, 'selector-user');\n if(!target) {\n return;\n }\n\n const key = target.dataset.key;\n if(key.indexOf('date_') === 0) {\n const [_, minDate, maxDate] = key.split('_');\n selectedMinDate = +minDate;\n selectedMaxDate = +maxDate;\n } else {\n selectedPeerId = key.toPeerId();\n }\n\n target.addEventListener('click', () => {\n unselectEntity(target);\n });\n\n this.inputSearch.container.append(target);\n this.inputSearch.onChange(this.inputSearch.value = '');\n pickedElements.push(target);\n updatePicked();\n });\n\n searchSuper.nav.parentElement.append(helper);\n\n const renderEntity = (key: PeerId | string, title?: string | HTMLElement) => {\n const div = document.createElement('div');\n div.classList.add('selector-user'/* , 'scale-in' */);\n\n const avatarEl = new AvatarElement();\n avatarEl.classList.add('selector-user-avatar', 'tgico', 'avatar-32');\n avatarEl.isDialog = true;\n\n div.dataset.key = '' + key;\n if(key.isPeerId()) {\n if(title === undefined) {\n title = new PeerTitle({peerId: key.toPeerId()}).element;\n }\n\n avatarEl.updateWithOptions({peerId: key as PeerId});\n } else {\n avatarEl.classList.add('tgico-calendarfilter');\n }\n\n if(title) {\n if(typeof(title) === 'string') {\n div.innerHTML = title;\n } else {\n replaceContent(div, title);\n div.append(title);\n }\n }\n\n div.insertAdjacentElement('afterbegin', avatarEl);\n\n return div;\n };\n\n const unselectEntity = (target: HTMLElement) => {\n const key = target.dataset.key;\n if(key.indexOf('date_') === 0) {\n selectedMinDate = selectedMaxDate = 0;\n } else {\n selectedPeerId = ''.toPeerId();\n }\n\n target.remove();\n indexOfAndSplice(pickedElements, target);\n\n setTimeout(() => {\n updatePicked();\n this.inputSearch.onChange(this.inputSearch.value);\n }, 0);\n };\n\n this.inputSearch.onClear = () => {\n pickedElements.forEach((el) => {\n unselectEntity(el);\n });\n };\n\n this.inputSearch.onChange = (value) => {\n searchSuper.cleanupHTML();\n searchSuper.setQuery({\n peerId: selectedPeerId,\n folderId: selectedPeerId ? undefined : 0,\n query: value,\n minDate: selectedMinDate,\n maxDate: selectedMaxDate\n });\n searchSuper.load(true);\n\n helper.innerHTML = '';\n searchSuper.nav.classList.remove('hide');\n if(!value) {\n }\n\n if(!selectedPeerId && value.trim()) {\n const middleware = searchSuper.middleware.get();\n Promise.all([\n // appMessagesManager.getConversationsAll(value).then((dialogs) => dialogs.map((d) => d.peerId)),\n this.managers.dialogsStorage.getDialogs({query: value}).then(({dialogs}) => dialogs.map((d) => d.peerId)),\n this.managers.appUsersManager.getContactsPeerIds(value, true)\n ]).then((results) => {\n if(!middleware()) return;\n const peerIds = new Set(results[0].concat(results[1]));\n\n peerIds.forEach((peerId) => {\n helper.append(renderEntity(peerId));\n });\n\n searchSuper.nav.classList.toggle('hide', !!helper.innerHTML);\n // console.log('got peerIds by value:', value, [...peerIds]);\n });\n }\n\n if(!selectedMinDate && value.trim()) {\n const dates: DateData[] = [];\n fillTipDates(value, dates);\n dates.forEach((dateData) => {\n helper.append(renderEntity('date_' + dateData.minDate + '_' + dateData.maxDate, dateData.title));\n });\n\n searchSuper.nav.classList.toggle('hide', !!helper.innerHTML);\n }\n };\n\n searchSuper.tabs.inputMessagesFilterEmpty.addEventListener('mousedown', (e) => {\n const target = findUpTag(e.target, DIALOG_LIST_ELEMENT_TAG) as HTMLElement;\n if(!target) {\n return;\n }\n\n const searchGroup = findUpClassName(target, 'search-group');\n if(!searchGroup || searchGroup.classList.contains('search-group-recent') || searchGroup.classList.contains('search-group-people')) {\n return;\n }\n\n const peerId = target.getAttribute('data-peer-id').toPeerId();\n this.managers.appUsersManager.pushRecentSearch(peerId);\n }, {capture: true});\n\n const peopleContainer = document.createElement('div');\n peopleContainer.classList.add('search-group-scrollable');\n peopleContainer.append(this.searchGroups.people.list);\n this.searchGroups.people.container.append(peopleContainer);\n const peopleScrollable = new ScrollableX(peopleContainer);\n\n let first = true;\n let hideNewBtnMenuTimeout: number;\n // const transition = Transition.bind(null, searchContainer.parentElement, 150);\n const transition = TransitionSlider({\n content: searchContainer.parentElement,\n type: 'zoom-fade',\n transitionTime: 150,\n onTransitionEnd: (id) => {\n if(hideNewBtnMenuTimeout) clearTimeout(hideNewBtnMenuTimeout);\n\n if(id === 0 && !first) {\n searchSuper.selectTab(0, false);\n this.inputSearch.onClearClick();\n hideNewBtnMenuTimeout = window.setTimeout(() => {\n hideNewBtnMenuTimeout = 0;\n this.newBtnMenu.classList.remove('is-hidden');\n this.hasUpdate && this.updateBtn.classList.remove('is-hidden');\n }, 150);\n }\n\n first = false;\n }\n });\n\n transition(0);\n\n const activeClassName = 'is-visible';\n const onFocus = () => {\n this.toolsBtn.classList.remove(activeClassName);\n this.backBtn.classList.add(activeClassName);\n this.newBtnMenu.classList.add('is-hidden');\n this.updateBtn.classList.add('is-hidden');\n this.toolsBtn.parentElement.firstElementChild.classList.toggle('state-back', true);\n\n const navigationType: NavigationItem['type'] = 'global-search';\n if(!IS_MOBILE_SAFARI && !appNavigationController.findItemByType(navigationType)) {\n appNavigationController.pushItem({\n onPop: () => {\n close();\n },\n type: navigationType\n });\n }\n\n transition(1);\n };\n\n this.inputSearch.input.addEventListener('focus', onFocus);\n onFocus();\n\n attachClickEvent(this.backBtn, (e) => {\n this.toolsBtn.classList.add(activeClassName);\n this.backBtn.classList.remove(activeClassName);\n this.toolsBtn.parentElement.firstElementChild.classList.toggle('state-back', false);\n\n appNavigationController.removeByType('global-search');\n\n transition(0);\n });\n\n const clearRecentSearchBtn = ButtonIcon('close');\n this.searchGroups.recent.nameEl.append(clearRecentSearchBtn);\n clearRecentSearchBtn.addEventListener('click', () => {\n confirmationPopup({\n descriptionLangKey: 'Search.Confirm.ClearHistory',\n button: {\n langKey: 'ClearButton',\n isDanger: true\n }\n }).then(() => {\n return this.managers.appUsersManager.clearRecentSearch().then(() => {\n this.searchGroups.recent.clear();\n });\n });\n });\n }\n}\n\nexport class SettingChatListSection extends SettingSection {\n public sortedList: SortedUserList;\n\n constructor(options: SettingSectionOptions & {sortedList: SortedUserList}) {\n super(options);\n\n this.sortedList = options.sortedList;\n\n this.content.append(this.sortedList.list);\n }\n\n public makeButton(options: ButtonOptions) {\n const button = Button('folder-category-button btn btn-primary btn-transparent', options);\n if(this.title) this.content.insertBefore(button, this.title.nextSibling);\n else this.content.prepend(button);\n return button;\n }\n}\n\nconst appSidebarLeft = new AppSidebarLeft();\nMOUNT_CLASS_TO.appSidebarLeft = appSidebarLeft;\nexport default appSidebarLeft;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider';\nimport AppSelectPeers from '../../appSelectPeers';\nimport {setButtonLoader} from '../../putPreloader';\nimport {LangPackKey, _i18n} from '../../../lib/langPack';\nimport ButtonCorner from '../../buttonCorner';\n\nexport default class AppAddMembersTab extends SliderSuperTab {\n private nextBtn: HTMLButtonElement;\n private selector: AppSelectPeers;\n private peerType: 'channel' | 'chat' | 'privacy';\n private takeOut: (peerIds: PeerId[]) => Promise | false | void;\n private skippable: boolean;\n\n public init(options: {\n title: LangPackKey,\n placeholder: LangPackKey,\n type: AppAddMembersTab['peerType'],\n takeOut?: AppAddMembersTab['takeOut'],\n skippable: boolean,\n selectedPeerIds?: PeerId[]\n }) {\n this.container.classList.add('add-members-container');\n this.nextBtn = ButtonCorner({icon: 'arrow_next'});\n this.content.append(this.nextBtn);\n this.scrollable.container.remove();\n\n this.nextBtn.addEventListener('click', () => {\n const peerIds = this.selector.getSelected().map((sel) => sel.toPeerId());\n const result = this.takeOut(peerIds);\n\n if(this.skippable && !(result instanceof Promise)) {\n this.close();\n } else if(result instanceof Promise) {\n this.attachToPromise(result);\n } else if(result === undefined) {\n this.close();\n }\n });\n\n //\n this.setTitle(options.title);\n this.peerType = options.type;\n this.takeOut = options.takeOut;\n this.skippable = options.skippable;\n\n const isPrivacy = this.peerType === 'privacy';\n this.selector = new AppSelectPeers({\n appendTo: this.content,\n onChange: this.skippable ? null : (length) => {\n this.nextBtn.classList.toggle('is-visible', !!length);\n },\n peerType: [isPrivacy ? 'dialogs' : 'contacts'],\n placeholder: options.placeholder,\n exceptSelf: isPrivacy,\n filterPeerTypeBy: isPrivacy ? ['isAnyGroup', 'isUser'] : undefined,\n managers: this.managers,\n design: 'square'\n });\n\n if(options.selectedPeerIds) {\n this.selector.addInitial(options.selectedPeerIds);\n }\n\n this.nextBtn.classList.add('tgico-arrow_next');\n this.nextBtn.innerHTML = '';\n this.nextBtn.disabled = false;\n this.nextBtn.classList.toggle('is-visible', this.skippable);\n }\n\n public attachToPromise(promise: Promise) {\n const removeLoader = setButtonLoader(this.nextBtn, 'arrow_next');\n\n promise.then(() => {\n this.close();\n }, () => {\n removeLoader();\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {renderImageFromUrlPromise} from './dom/renderImageFromUrl';\n\nexport function averageColorFromCanvas(canvas: HTMLCanvasElement) {\n const context = canvas.getContext('2d');\n\n const pixel = new Array(4).fill(0);\n const pixels = context.getImageData(0, 0, canvas.width, canvas.height).data;\n const pixelsLength = pixels.length / 4;\n for(let i = 0; i < pixels.length; i += 4) {\n // const alphaPixel = pixels[i + 3];\n pixel[0] += pixels[i]/* * (alphaPixel / 255) */;\n pixel[1] += pixels[i + 1]/* * (alphaPixel / 255) */;\n pixel[2] += pixels[i + 2]/* * (alphaPixel / 255) */;\n pixel[3] += pixels[i + 3];\n }\n\n const outPixel = new Uint8ClampedArray(4);\n outPixel[0] = pixel[0] / pixelsLength;\n outPixel[1] = pixel[1] / pixelsLength;\n outPixel[2] = pixel[2] / pixelsLength;\n outPixel[3] = pixel[3] / pixelsLength;\n // outPixel[3] = 255;\n return outPixel;\n}\n\nexport function averageColorFromImageSource(imageSource: CanvasImageSource, width: number, height: number) {\n const canvas = document.createElement('canvas');\n const ratio = width / height;\n const DIMENSIONS = 50;\n if(ratio === 1) {\n canvas.width = DIMENSIONS;\n canvas.height = canvas.width / ratio;\n } else if(ratio > 1) {\n canvas.height = DIMENSIONS;\n canvas.width = canvas.height / ratio;\n } else {\n canvas.width = canvas.height = DIMENSIONS;\n }\n\n const context = canvas.getContext('2d');\n context.drawImage(imageSource, 0, 0, width, height, 0, 0, canvas.width, canvas.height);\n return averageColorFromCanvas(canvas);\n}\n\nexport function averageColor(imageUrl: string) {\n const img = document.createElement('img');\n return renderImageFromUrlPromise(img, imageUrl, false).then(() => {\n return averageColorFromImageSource(img, img.naturalWidth, img.naturalHeight);\n });\n};\n","import {rgbaToHsla} from './color';\n\n// * https://github.com/TelegramMessenger/Telegram-iOS/blob/3d062fff78cc6b287c74e6171f855a3500c0156d/submodules/TelegramPresentationData/Sources/PresentationData.swift#L453\nexport default function highlightningColor(rgba: [number, number, number, number?]) {\n let {h, s, l} = rgbaToHsla(rgba[0], rgba[1], rgba[2]);\n if(s > 0) {\n s = Math.min(100, s + 5 + 0.1 * (100 - s));\n }\n l = Math.max(0, l * .65);\n\n const hsla = `hsla(${h}, ${s}%, ${l}%, .4)`;\n return hsla;\n}\n","import {ColorHsla, ColorRgba, hexaToHsla, hslaToRgba, rgbaToHexa as rgbaToHexa, rgbaToHsla} from '../helpers/color';\nimport attachGrabListeners from '../helpers/dom/attachGrabListeners';\nimport clamp from '../helpers/number/clamp';\nimport InputField, {InputState} from './inputField';\n\nexport type ColorPickerColor = {\n hsl: string;\n rgb: string;\n hex: string;\n hsla: string;\n rgba: string;\n hexa: string;\n rgbaArray: ColorRgba;\n};\n\nexport default class ColorPicker {\n private static BASE_CLASS = 'color-picker';\n public container: HTMLElement;\n\n private boxRect: DOMRect;\n // private boxDraggerRect: DOMRect;\n private hueRect: DOMRect;\n // private hueDraggerRect: DOMRect;\n\n private hue = 0;\n private saturation = 100;\n private lightness = 50;\n private alpha = 1;\n private elements: {\n box: SVGSVGElement,\n boxDragger: SVGSVGElement,\n sliders: HTMLElement,\n hue: SVGSVGElement,\n hueDragger: SVGSVGElement,\n saturation: SVGLinearGradientElement,\n } = {} as any;\n private hexInputField: InputField;\n private rgbInputField: InputField;\n public onChange: (color: ReturnType) => void;\n\n constructor() {\n this.container = document.createElement('div');\n this.container.classList.add(ColorPicker.BASE_CLASS);\n\n const html = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n `;\n\n this.container.innerHTML = html;\n\n this.elements.box = this.container.firstElementChild as any;\n this.elements.boxDragger = this.elements.box.lastElementChild as any;\n this.elements.saturation = this.elements.box.firstElementChild.firstElementChild as any;\n\n this.elements.sliders = this.elements.box.nextElementSibling as any;\n\n this.elements.hue = this.elements.sliders.firstElementChild as any;\n this.elements.hueDragger = this.elements.hue.lastElementChild as any;\n\n this.hexInputField = new InputField({plainText: true, label: 'Appearance.Color.Hex'});\n this.rgbInputField = new InputField({plainText: true, label: 'Appearance.Color.RGB'});\n\n const inputs = document.createElement('div');\n inputs.className = ColorPicker.BASE_CLASS + '-inputs';\n inputs.append(this.hexInputField.container, this.rgbInputField.container);\n this.container.append(inputs);\n\n this.hexInputField.input.addEventListener('input', () => {\n let value = this.hexInputField.value.replace(/#/g, '').slice(0, 6);\n\n const match = value.match(/([a-fA-F\\d]+)/);\n const valid = match && match[0].length === value.length && [/* 3, 4, */6].includes(value.length);\n this.hexInputField.setState(valid ? InputState.Neutral : InputState.Error);\n\n value = '#' + value;\n this.hexInputField.setValueSilently(value);\n\n if(valid) {\n this.setColor(value, false, true);\n }\n });\n\n // patched https://stackoverflow.com/a/34029238/6758968\n const rgbRegExp = /^(?:rgb)?\\(?([01]?\\d\\d?|2[0-4]\\d|25[0-5])(?:\\W+)([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\W+(?:([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\)?)$/;\n this.rgbInputField.input.addEventListener('input', () => {\n const match = this.rgbInputField.value.match(rgbRegExp);\n this.rgbInputField.setState(match ? InputState.Neutral : InputState.Error);\n\n if(match) {\n this.setColor(rgbaToHsla(+match[1], +match[2], +match[3]), true, false);\n }\n });\n\n this.attachBoxListeners();\n this.attachHueListeners();\n }\n\n private onGrabStart = () => {\n document.documentElement.style.cursor = this.elements.boxDragger.style.cursor = 'grabbing';\n };\n\n private onGrabEnd = () => {\n document.documentElement.style.cursor = this.elements.boxDragger.style.cursor = '';\n };\n\n private attachBoxListeners() {\n attachGrabListeners(this.elements.box as any, () => {\n this.onGrabStart();\n this.boxRect = this.elements.box.getBoundingClientRect();\n // this.boxDraggerRect = this.elements.boxDragger.getBoundingClientRect();\n }, (pos) => {\n this.saturationHandler(pos.x, pos.y);\n }, () => {\n this.onGrabEnd();\n });\n }\n\n private attachHueListeners() {\n attachGrabListeners(this.elements.hue as any, () => {\n this.onGrabStart();\n this.hueRect = this.elements.hue.getBoundingClientRect();\n // this.hueDraggerRect = this.elements.hueDragger.getBoundingClientRect();\n }, (pos) => {\n this.hueHandler(pos.x);\n }, () => {\n this.onGrabEnd();\n });\n }\n\n public setColor(color: ColorHsla | string, updateHexInput = true, updateRgbInput = true) {\n if(color === undefined) { // * set to red\n color = {\n h: 0,\n s: 100,\n l: 50,\n a: 1\n };\n } else if(typeof(color) === 'string') {\n if(color[0] === '#') {\n color = hexaToHsla(color);\n } else {\n const rgb = color.match(/[.?\\d]+/g);\n color = rgbaToHsla(+rgb[0], +rgb[1], +rgb[2], rgb[3] === undefined ? 1 : +rgb[3]);\n }\n }\n\n // Set box\n this.boxRect = this.elements.box.getBoundingClientRect();\n\n const boxX = this.boxRect.width / 100 * color.s;\n const percentY = 100 - (color.l / (100 - color.s / 2)) * 100;\n const boxY = this.boxRect.height / 100 * percentY;\n\n this.saturationHandler(this.boxRect.left + boxX, this.boxRect.top + boxY, false);\n\n // Set hue\n this.hueRect = this.elements.hue.getBoundingClientRect();\n\n const percentHue = color.h / 360;\n const hueX = this.hueRect.left + this.hueRect.width * percentHue;\n\n this.hueHandler(hueX, false);\n\n // Set values\n this.hue = color.h;\n this.saturation = color.s;\n this.lightness = color.l;\n this.alpha = color.a;\n\n this.updatePicker(updateHexInput, updateRgbInput);\n };\n\n public getCurrentColor(): ColorPickerColor {\n const rgbaArray = hslaToRgba(this.hue, this.saturation, this.lightness, this.alpha);\n const hexa = rgbaToHexa(rgbaArray);\n const hex = hexa.slice(0, -2);\n\n return {\n hsl: `hsl(${this.hue}, ${this.saturation}%, ${this.lightness}%)`,\n rgb: `rgb(${rgbaArray[0]}, ${rgbaArray[1]}, ${rgbaArray[2]})`,\n hex: hex,\n hsla: `hsla(${this.hue}, ${this.saturation}%, ${this.lightness}%, ${this.alpha})`,\n rgba: `rgba(${rgbaArray[0]}, ${rgbaArray[1]}, ${rgbaArray[2]}, ${rgbaArray[3]})`,\n hexa: hexa,\n rgbaArray: rgbaArray\n };\n }\n\n public updatePicker(updateHexInput = true, updateRgbInput = true) {\n const color = this.getCurrentColor();\n this.elements.boxDragger.setAttributeNS(null, 'fill', color.hex);\n\n if(updateHexInput) {\n this.hexInputField.setValueSilently(color.hex);\n this.hexInputField.setState(InputState.Neutral);\n }\n\n if(updateRgbInput) {\n this.rgbInputField.setValueSilently(color.rgbaArray.slice(0, -1).join(', '));\n this.rgbInputField.setState(InputState.Neutral);\n }\n\n if(this.onChange) {\n this.onChange(color);\n }\n }\n\n private hueHandler(pageX: number, update = true) {\n const eventX = clamp(pageX - this.hueRect.left, 0, this.hueRect.width);\n\n const percents = eventX / this.hueRect.width;\n this.hue = Math.round(360 * percents);\n\n const hsla = `hsla(${this.hue}, 100%, 50%, ${this.alpha})`;\n\n this.elements.hueDragger.setAttributeNS(null, 'x', (percents * 100) + '%');\n this.elements.hueDragger.setAttributeNS(null, 'fill', hsla);\n\n this.elements.saturation.lastElementChild.setAttributeNS(null, 'stop-color', hsla);\n\n if(update) {\n this.updatePicker();\n }\n }\n\n private saturationHandler(pageX: number, pageY: number, update = true) {\n const maxX = this.boxRect.width;\n const maxY = this.boxRect.height;\n\n const eventX = clamp(pageX - this.boxRect.left, 0, maxX);\n const eventY = clamp(pageY - this.boxRect.top, 0, maxY);\n\n const posX = eventX / maxX * 100;\n const posY = eventY / maxY * 100;\n\n const boxDragger = this.elements.boxDragger;\n boxDragger.setAttributeNS(null, 'x', posX + '%');\n boxDragger.setAttributeNS(null, 'y', posY + '%');\n\n const saturation = clamp(posX, 0, 100);\n\n const lightnessX = 100 - saturation / 2;\n const lightnessY = 100 - clamp(posY, 0, 100);\n\n const lightness = clamp(lightnessY / 100 * lightnessX, 0, 100);\n\n this.saturation = saturation;\n this.lightness = lightness;\n\n if(update) {\n this.updatePicker();\n }\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AppTheme} from '../../../config/state';\nimport {hexaToRgba} from '../../../helpers/color';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport highlightningColor from '../../../helpers/highlightningColor';\nimport throttle from '../../../helpers/schedulers/throttle';\nimport themeController from '../../../helpers/themeController';\nimport appImManager from '../../../lib/appManagers/appImManager';\nimport rootScope from '../../../lib/rootScope';\nimport ColorPicker, {ColorPickerColor} from '../../colorPicker';\nimport SettingSection from '../../settingSection';\nimport {SliderSuperTab} from '../../slider';\nimport {WallPaper} from '../../../layer';\n\nexport default class AppBackgroundColorTab extends SliderSuperTab {\n private colorPicker: ColorPicker;\n private grid: HTMLElement;\n private applyColor: (hex: string, updateColorPicker?: boolean) => void;\n private theme: AppTheme;\n\n init() {\n this.container.classList.add('background-container', 'background-color-container');\n this.setTitle('SetColor');\n\n this.theme = themeController.getTheme();\n\n const section = new SettingSection({});\n this.colorPicker = new ColorPicker();\n\n section.content.append(this.colorPicker.container);\n\n this.scrollable.append(section.container);\n\n const gridSection = new SettingSection({});\n\n const grid = this.grid = document.createElement('div');\n grid.classList.add('grid');\n\n const colors = [\n '#E6EBEE',\n '#B2CEE1',\n '#008DD0',\n '#C6E7CB',\n '#C4E1A6',\n '#60B16E',\n '#CCD0AF',\n '#A6A997',\n '#7A7072',\n '#FDD7AF',\n '#FDB76E',\n '#DD8851'\n ];\n\n colors.forEach((color) => {\n const item = document.createElement('div');\n item.classList.add('grid-item');\n item.dataset.color = color.toLowerCase();\n\n // * need for transform scale\n const media = document.createElement('div');\n media.classList.add('grid-item-media');\n media.style.backgroundColor = color;\n\n item.append(media);\n grid.append(item);\n });\n\n attachClickEvent(grid, (e) => {\n const target = findUpClassName(e.target, 'grid-item');\n if(!target || target.classList.contains('active')) {\n return;\n }\n\n const color = target.dataset.color;\n if(!color) {\n return;\n }\n\n this.applyColor(color);\n }, {listenerSetter: this.listenerSetter});\n\n gridSection.content.append(grid);\n this.scrollable.append(gridSection.container);\n\n this.applyColor = throttle(this._applyColor, 16, true);\n }\n\n private setActive() {\n const active = this.grid.querySelector('.active');\n const background = this.theme.settings;\n const wallPaper = background.wallpaper;\n const color = wallPaper.settings.background_color;\n const target = color ? this.grid.querySelector(`.grid-item[data-color=\"${color}\"]`) : null;\n if(active === target) {\n return;\n }\n\n if(active) {\n active.classList.remove('active');\n }\n\n if(target) {\n target.classList.add('active');\n }\n }\n\n private _applyColor = (hex: string, updateColorPicker = true) => {\n if(updateColorPicker) {\n this.colorPicker.setColor(hex);\n } else {\n const rgba = hexaToRgba(hex);\n const settings = this.theme.settings;\n const hsla = highlightningColor(rgba);\n\n const wallPaper: WallPaper.wallPaperNoFile = {\n _: 'wallPaperNoFile',\n id: 0,\n pFlags: {},\n settings: {\n _: 'wallPaperSettings',\n background_color: parseInt(hex.slice(1), 16),\n pFlags: {}\n }\n };\n\n settings.wallpaper = wallPaper;\n settings.highlightningColor = hsla;\n\n this.managers.appStateManager.pushToState('settings', rootScope.settings);\n\n appImManager.applyCurrentTheme(undefined, undefined, true);\n this.setActive();\n }\n };\n\n private onColorChange = (color: ColorPickerColor) => {\n this.applyColor(color.hex, false);\n };\n\n onOpen() {\n setTimeout(() => {\n const settings = this.theme.settings;\n const color = settings?.wallpaper?.settings?.background_color;\n\n const isColored = !!color && settings.wallpaper._ === 'wallPaperNoFile';\n\n // * set active if type is color\n if(isColored) {\n this.colorPicker.onChange = this.onColorChange;\n }\n\n this.colorPicker.setColor((color && '#' + color.toString(16)) || '#cccccc');\n\n if(!isColored) {\n this.colorPicker.onChange = this.onColorChange;\n }\n }, 0);\n }\n\n onCloseAfterTimeout() {\n this.colorPicker.onChange = undefined;\n this.colorPicker = undefined;\n\n return super.onCloseAfterTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {averageColor, averageColorFromCanvas} from '../../../helpers/averageColor';\nimport blur from '../../../helpers/blur';\nimport deferredPromise, {CancellablePromise} from '../../../helpers/cancellablePromise';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport highlightningColor from '../../../helpers/highlightningColor';\nimport copy from '../../../helpers/object/copy';\nimport sequentialDom from '../../../helpers/sequentialDom';\nimport ChatBackgroundGradientRenderer from '../../chat/gradientRenderer';\nimport {Document, PhotoSize, WallPaper, WebDocument} from '../../../layer';\nimport {MyDocument} from '../../../lib/appManagers/appDocsManager';\nimport appDownloadManager, {AppDownloadManager, DownloadBlob} from '../../../lib/appManagers/appDownloadManager';\nimport appImManager from '../../../lib/appManagers/appImManager';\nimport rootScope from '../../../lib/rootScope';\nimport Button from '../../button';\nimport CheckboxField from '../../checkboxField';\nimport ProgressivePreloader from '../../preloader';\nimport {SliderSuperTab} from '../../slider';\nimport AppBackgroundColorTab from './backgroundColor';\nimport choosePhotoSize from '../../../lib/appManagers/utils/photos/choosePhotoSize';\nimport {STATE_INIT, AppTheme} from '../../../config/state';\nimport themeController from '../../../helpers/themeController';\nimport requestFile from '../../../helpers/files/requestFile';\nimport {renderImageFromUrlPromise} from '../../../helpers/dom/renderImageFromUrl';\nimport scaleMediaElement from '../../../helpers/canvas/scaleMediaElement';\nimport {MediaSize} from '../../../helpers/mediaSize';\nimport wrapPhoto from '../../wrappers/photo';\nimport {CreateRowFromCheckboxField} from '../../row';\nimport {generateSection} from '../../settingSection';\nimport {getColorsFromWallPaper} from '../../../helpers/color';\n\nexport default class AppBackgroundTab extends SliderSuperTab {\n public static tempId = 0;\n private grid: HTMLElement;\n private clicked: Set = new Set();\n private blurCheckboxField: CheckboxField;\n\n private wallPapersByElement: Map = new Map();\n private elementsByKey: Map = new Map();\n\n public static getInitArgs() {\n return {\n backgrounds: rootScope.managers.appThemesManager.getWallPapers()\n };\n }\n\n private get theme() {\n return themeController.getTheme();\n }\n\n public init(p: ReturnType = AppBackgroundTab.getInitArgs()) {\n this.container.classList.add('background-container', 'background-image-container');\n this.setTitle('ChatBackground');\n\n {\n const container = generateSection(this.scrollable);\n\n const uploadButton = Button('btn-primary btn-transparent', {icon: 'cameraadd', text: 'ChatBackground.UploadWallpaper'});\n const colorButton = Button('btn-primary btn-transparent', {icon: 'colorize', text: 'SetColor'});\n const resetButton = Button('btn-primary btn-transparent', {icon: 'favourites', text: 'Appearance.Reset'});\n\n attachClickEvent(uploadButton, this.onUploadClick, {listenerSetter: this.listenerSetter});\n\n attachClickEvent(colorButton, () => {\n this.slider.createTab(AppBackgroundColorTab).open();\n }, {listenerSetter: this.listenerSetter});\n\n attachClickEvent(resetButton, this.onResetClick, {listenerSetter: this.listenerSetter});\n\n const wallPaper = this.theme.settings?.wallpaper;\n const blurCheckboxField = this.blurCheckboxField = new CheckboxField({\n text: 'ChatBackground.Blur',\n name: 'blur',\n checked: (wallPaper as WallPaper.wallPaper)?.settings?.pFlags?.blur\n });\n\n this.listenerSetter.add(blurCheckboxField.input)('change', async() => {\n this.theme.settings.wallpaper.settings.pFlags.blur = blurCheckboxField.input.checked || undefined;\n await this.managers.appStateManager.pushToState('settings', rootScope.settings);\n\n // * wait for animation end\n setTimeout(() => {\n const active = grid.querySelector('.active') as HTMLElement;\n if(!active) return;\n\n const wallpaper = this.wallPapersByElement.get(active);\n if((wallpaper as WallPaper.wallPaper).pFlags.pattern || wallpaper._ === 'wallPaperNoFile') {\n return;\n }\n\n AppBackgroundTab.setBackgroundDocument(wallpaper);\n }, 100);\n });\n\n container.append(\n uploadButton,\n colorButton,\n resetButton,\n CreateRowFromCheckboxField(blurCheckboxField).container\n );\n }\n\n rootScope.addEventListener('background_change', this.setActive);\n\n const promise = p.backgrounds.then((wallPapers) => {\n const promises = wallPapers.map((wallPaper) => {\n return this.addWallPaper(wallPaper);\n });\n\n return Promise.all(promises);\n });\n\n const gridContainer = generateSection(this.scrollable);\n const grid = this.grid = document.createElement('div');\n grid.classList.add('grid');\n attachClickEvent(grid, this.onGridClick, {listenerSetter: this.listenerSetter});\n gridContainer.append(grid);\n\n return promise;\n }\n\n private onUploadClick = () => {\n requestFile('image/x-png,image/png,image/jpeg').then(async(file) => {\n if(file.name.endsWith('.png')) {\n const img = document.createElement('img');\n const url = URL.createObjectURL(file);\n await renderImageFromUrlPromise(img, url, false);\n const mimeType = 'image/jpeg';\n const {blob} = await scaleMediaElement({media: img, size: new MediaSize(img.naturalWidth, img.naturalHeight), mimeType});\n file = new File([blob], file.name.replace(/\\.png$/, '.jpg'), {type: mimeType});\n }\n\n const wallPaper = await this.managers.appDocsManager.prepareWallPaperUpload(file);\n const uploadPromise = this.managers.appDocsManager.uploadWallPaper(wallPaper.id);\n const uploadDeferred: CancellablePromise = appDownloadManager.getNewDeferredForUpload(file.name, uploadPromise);\n\n const deferred = deferredPromise();\n deferred.addNotifyListener = uploadDeferred.addNotifyListener;\n deferred.cancel = uploadDeferred.cancel;\n\n uploadDeferred.then((wallPaper) => {\n this.clicked.delete(key);\n this.elementsByKey.delete(key);\n this.wallPapersByElement.set(container, wallPaper);\n const newKey = this.getWallPaperKey(wallPaper);\n this.elementsByKey.set(newKey, container);\n\n AppBackgroundTab.setBackgroundDocument(wallPaper).then(deferred.resolve, deferred.reject);\n }, deferred.reject);\n\n const key = this.getWallPaperKey(wallPaper);\n deferred.catch(() => {\n container.remove();\n });\n\n const preloader = new ProgressivePreloader({\n isUpload: true,\n cancelable: true,\n tryAgainOnFail: false\n });\n\n const {container} = await this.addWallPaper(wallPaper, false);\n this.clicked.add(key);\n\n preloader.attach(container, false, deferred);\n });\n };\n\n private onResetClick = () => {\n const defaultTheme = STATE_INIT.settings.themes.find((t) => t.name === this.theme.name);\n if(defaultTheme) {\n ++AppBackgroundTab.tempId;\n this.theme.settings = copy(defaultTheme.settings);\n this.managers.appStateManager.pushToState('settings', rootScope.settings);\n appImManager.applyCurrentTheme(undefined, undefined, true);\n this.blurCheckboxField.setValueSilently(this.theme.settings?.wallpaper?.settings?.pFlags?.blur);\n }\n };\n\n private getWallPaperKey(wallPaper: WallPaper) {\n return '' + wallPaper.id;\n }\n\n private getWallPaperKeyFromTheme(theme: AppTheme) {\n return '' + (this.getWallPaperKey(theme.settings?.wallpaper) || '');\n }\n\n public static addWallPaper(\n wallPaper: WallPaper,\n container = document.createElement('div')\n ) {\n const colors = getColorsFromWallPaper(wallPaper);\n const hasFile = wallPaper._ === 'wallPaper';\n if((hasFile && wallPaper.pFlags.pattern && !colors)/* ||\n (wallpaper.document as MyDocument).mime_type.indexOf('application/') === 0 */) {\n return;\n }\n\n const isDark = !!wallPaper.pFlags.dark;\n\n let doc: WebDocument.webDocumentNoProxy | Document.document = hasFile ? wallPaper.document as Document.document : undefined;\n if(hasFile && !doc) {\n doc = {\n _: 'webDocumentNoProxy',\n attributes: [],\n size: 100000,\n url: 'assets/img/pattern.svg',\n w: 1440,\n h: 2960,\n mime_type: 'image/svg+xml'\n };\n }\n\n container.classList.add('background-item');\n container.dataset.id = '' + wallPaper.id;\n\n const media = document.createElement('div');\n media.classList.add('background-item-media');\n\n const loadPromises: Promise[] = [];\n let wrapped: ReturnType, size: ReturnType;\n if(hasFile) {\n size = choosePhotoSize(doc, 200, 200);\n wrapped = wrapPhoto({\n photo: doc,\n message: null,\n container: media,\n withoutPreloader: true,\n size,\n noFadeIn: wallPaper.pFlags.pattern\n });\n\n if(wallPaper.pFlags.pattern) {\n media.classList.add('is-pattern');\n }\n\n const promise = wrapped.then(async({loadPromises, images}) => {\n await loadPromises.thumb || loadPromises.full;\n return images;\n }).then((images) => {\n if(wallPaper.pFlags.pattern) {\n if(isDark) {\n images.full.style.display = 'none';\n if(images.thumb) {\n images.thumb.style.display = 'none';\n }\n } else if(wallPaper.settings?.intensity) {\n images.full.style.opacity = '' + Math.abs(wallPaper.settings.intensity) / 100;\n }\n }\n\n return sequentialDom.mutate(() => {\n container.append(media);\n });\n });\n\n loadPromises.push(promise);\n } else {\n container.append(media);\n }\n\n if(wallPaper.settings?.background_color) {\n const {canvas} = ChatBackgroundGradientRenderer.create(colors);\n canvas.classList.add('background-colors-canvas');\n\n if(isDark && hasFile) {\n const promise = wrapped.then(({loadPromises}) => {\n return loadPromises.full.then(async() => {\n const cacheContext = await rootScope.managers.thumbsStorage.getCacheContext(doc, size.type);\n canvas.style.webkitMaskImage = `url(${cacheContext.url})`;\n canvas.style.opacity = '' + (wallPaper.pFlags.dark ? 100 + wallPaper.settings.intensity : wallPaper.settings.intensity) / 100;\n media.append(canvas);\n });\n });\n\n loadPromises.push(promise);\n } else {\n media.append(canvas);\n }\n }\n\n return {\n container,\n media,\n loadPromise: Promise.all(loadPromises)\n };\n }\n\n private addWallPaper(wallPaper: WallPaper, append = true) {\n const result = AppBackgroundTab.addWallPaper(wallPaper);\n if(result) {\n const {container, media} = result;\n container.classList.add('grid-item');\n media.classList.add('grid-item-media');\n\n const key = this.getWallPaperKey(wallPaper);\n this.wallPapersByElement.set(container, wallPaper);\n this.elementsByKey.set(key, container);\n\n if(this.getWallPaperKeyFromTheme(this.theme) === key) {\n container.classList.add('active');\n }\n\n this.grid[append ? 'append' : 'prepend'](container);\n }\n\n return result && result.loadPromise.then(() => result);\n }\n\n private onGridClick = (e: MouseEvent | TouchEvent) => {\n const target = findUpClassName(e.target, 'grid-item') as HTMLElement;\n if(!target) return;\n\n const wallpaper = this.wallPapersByElement.get(target);\n if(wallpaper._ === 'wallPaperNoFile') {\n AppBackgroundTab.setBackgroundDocument(wallpaper);\n return;\n }\n\n const key = this.getWallPaperKey(wallpaper);\n if(this.clicked.has(key)) return;\n this.clicked.add(key);\n\n const doc = wallpaper.document as MyDocument;\n const preloader = new ProgressivePreloader({\n cancelable: true,\n tryAgainOnFail: false\n });\n\n const load = async() => {\n const promise = AppBackgroundTab.setBackgroundDocument(wallpaper);\n const cacheContext = await this.managers.thumbsStorage.getCacheContext(doc);\n if(!cacheContext.url || this.theme.settings?.wallpaper?.settings?.pFlags?.blur) {\n preloader.attach(target, true, promise);\n }\n };\n\n preloader.construct();\n\n attachClickEvent(target, (e) => {\n if(preloader.preloader.parentElement) {\n preloader.onClick(e);\n preloader.detach();\n } else {\n load();\n }\n }, {listenerSetter: this.listenerSetter});\n\n load();\n\n // console.log(doc);\n };\n\n public static setBackgroundDocument = (wallPaper: WallPaper, themeSettings?: AppTheme['settings']) => {\n const _tempId = ++this.tempId;\n const middleware = () => _tempId === this.tempId;\n\n const doc = (wallPaper as WallPaper.wallPaper).document as MyDocument;\n const deferred = deferredPromise();\n let download: Promise | ReturnType;\n if(doc) {\n download = appDownloadManager.downloadMediaURL({\n media: doc,\n queueId: appImManager.chat.bubbles ? appImManager.chat.bubbles.lazyLoadQueue.queueId : 0\n });\n deferred.addNotifyListener = download.addNotifyListener;\n deferred.cancel = download.cancel;\n } else {\n download = Promise.resolve();\n }\n\n const saveToCache = (slug: string, url: string) => {\n fetch(url).then((response) => {\n appImManager.cacheStorage.save('backgrounds/' + slug, response);\n });\n };\n\n download.then(async() => {\n if(!middleware()) {\n deferred.resolve();\n return;\n }\n\n const hadSettings = !!themeSettings;\n themeSettings ??= themeController.getTheme().settings;\n const onReady = (url?: string) => {\n let getPixelPromise: Promise;\n const backgroundColor = getColorsFromWallPaper(wallPaper);\n if(url && !backgroundColor) {\n getPixelPromise = averageColor(url);\n } else {\n const {canvas} = ChatBackgroundGradientRenderer.create(backgroundColor);\n getPixelPromise = Promise.resolve(averageColorFromCanvas(canvas));\n }\n\n const slug = (wallPaper as WallPaper.wallPaper).slug ?? '';\n Promise.all([\n getPixelPromise,\n slug && saveToCache(slug, url)\n ]).then(([pixel]) => {\n if(!middleware()) {\n deferred.resolve();\n return;\n }\n\n const hsla = highlightningColor(Array.from(pixel) as any);\n\n themeSettings.wallpaper = wallPaper;\n themeSettings.highlightningColor = hsla;\n\n if(!hadSettings) {\n rootScope.managers.appStateManager.pushToState('settings', rootScope.settings);\n }\n\n appImManager.applyCurrentTheme(slug, url, true).then(deferred.resolve);\n });\n };\n\n if(!doc) {\n onReady();\n return;\n }\n\n const cacheContext = await rootScope.managers.thumbsStorage.getCacheContext(doc);\n if(themeSettings.wallpaper?.settings?.pFlags?.blur) {\n setTimeout(() => {\n const {canvas, promise} = blur(cacheContext.url, 12, 4);\n promise.then(() => {\n if(!middleware()) {\n deferred.resolve();\n return;\n }\n\n onReady(canvas.toDataURL());\n });\n }, 200);\n } else if(middleware()) {\n onReady(cacheContext.url);\n }\n });\n\n return deferred;\n };\n\n private setActive = () => {\n const active = this.grid.querySelector('.active');\n const target = this.elementsByKey.get(this.getWallPaperKeyFromTheme(this.theme));\n if(active === target) {\n return;\n }\n\n if(active) {\n active.classList.remove('active');\n }\n\n if(target) {\n target.classList.add('active');\n }\n };\n}\n","export default function requestFile(accept?: string) {\n const input = document.createElement('input');\n input.type = 'file';\n input.style.display = 'none';\n\n if(accept) {\n input.accept = accept;\n }\n\n document.body.append(input);\n\n const promise = new Promise((resolve, reject) => {\n input.addEventListener('change', (e: any) => {\n const file: File = e.target.files[0];\n if(!file) {\n reject('NO_FILE_SELECTED');\n return;\n }\n\n resolve(file);\n }, {once: true});\n }).finally(() => {\n input.remove();\n });\n\n input.click();\n\n return promise;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider';\nimport AppSelectPeers from '../../appSelectPeers';\nimport appDialogsManager from '../../../lib/appManagers/appDialogsManager';\nimport {MyDialogFilter as DialogFilter} from '../../../lib/storages/filters';\nimport ButtonIcon from '../../buttonIcon';\nimport CheckboxField from '../../checkboxField';\nimport Button from '../../button';\nimport AppEditFolderTab from './editFolder';\nimport I18n, {i18n, LangPackKey, _i18n, join} from '../../../lib/langPack';\nimport {toast} from '../../toast';\nimport copy from '../../../helpers/object/copy';\nimport forEachReverse from '../../../helpers/array/forEachReverse';\nimport setInnerHTML from '../../../helpers/dom/setInnerHTML';\nimport wrapEmojiText from '../../../lib/richTextProcessor/wrapEmojiText';\nimport {REAL_FOLDERS} from '../../../lib/mtproto/mtproto_config';\nimport rootScope from '../../../lib/rootScope';\nimport {MTAppConfig} from '../../../lib/mtproto/appConfig';\nimport {attachClickEvent, simulateClickEvent} from '../../../helpers/dom/clickEvent';\nimport SettingSection from '../../settingSection';\n\nexport default class AppIncludedChatsTab extends SliderSuperTab {\n private editFolderTab: AppEditFolderTab;\n private confirmBtn: HTMLElement;\n\n private selector: AppSelectPeers;\n private type: 'included' | 'excluded';\n private filter: DialogFilter;\n private originalFilter: DialogFilter;\n\n private dialogsByFilters: Map>;\n private limit: number;\n\n public init(\n filter: DialogFilter,\n type: 'included' | 'excluded',\n editFolderTab: AppIncludedChatsTab['editFolderTab']\n ) {\n this.originalFilter = filter;\n this.filter = copy(this.originalFilter);\n this.type = type;\n this.editFolderTab = editFolderTab;\n\n this.content.remove();\n this.container.classList.add('included-chatlist-container');\n this.confirmBtn = ButtonIcon('check btn-confirm blue', {noRipple: true});\n this.confirmBtn.style.display = 'none';\n\n this.header.append(this.confirmBtn);\n\n attachClickEvent(this.confirmBtn, async() => {\n const selected = this.selector.getSelected();\n\n // this.filter.pFlags = {};\n\n if(this.type === 'included') {\n for(const key in this.filter.pFlags) {\n if(key.indexOf('exclude_') === 0) {\n continue;\n }\n\n // @ts-ignore\n delete this.filter.pFlags[key];\n }\n } else {\n for(const key in this.filter.pFlags) {\n if(key.indexOf('exclude_') !== 0) {\n continue;\n }\n\n // @ts-ignore\n delete this.filter.pFlags[key];\n }\n }\n\n const peerIds: PeerId[] = [];\n for(const key of selected) {\n if(key.isPeerId()) {\n peerIds.push(key.toPeerId());\n } else {\n // @ts-ignore\n this.filter.pFlags[key] = true;\n }\n }\n\n let cmp: (peerId: PeerId) => boolean;\n if(this.type === 'included') {\n cmp = (peerId) => peerIds.includes(peerId);\n } else {\n cmp = (peerId) => !peerIds.includes(peerId);\n }\n\n forEachReverse(this.filter.pinnedPeerIds, (peerId, idx) => {\n if(!cmp(peerId)) {\n this.filter.pinnedPeerIds.splice(idx, 1);\n this.filter.pinned_peers.splice(idx, 1);\n }\n });\n\n const other = this.type === 'included' ? 'excludePeerIds' : 'includePeerIds';\n const otherLegacy = this.type === 'included' ? 'exclude_peers' : 'include_peers';\n forEachReverse(this.filter[other], (peerId, idx) => {\n if(peerIds.includes(peerId)) {\n this.filter[other].splice(idx, 1);\n this.filter[otherLegacy].splice(idx, 1);\n }\n });\n\n this.filter[this.type === 'included' ? 'includePeerIds' : 'excludePeerIds'] = peerIds;\n this.filter[this.type === 'included' ? 'include_peers' : 'exclude_peers'] = await Promise.all(peerIds.map((peerId) => this.managers.appPeersManager.getInputPeerById(peerId)));\n // this.filter.pinned_peers = this.filter.pinned_peers.filter((peerId) => this.filter.include_peers.includes(peerId));\n\n this.editFolderTab.setFilter(this.filter, false);\n this.close();\n }, {listenerSetter: this.listenerSetter});\n\n const onAppConfig = (appConfig: MTAppConfig) => {\n this.limit = rootScope.premium ? appConfig.dialog_filters_chats_limit_premium : appConfig.dialog_filters_chats_limit_default;\n };\n\n this.listenerSetter.add(rootScope)('app_config', onAppConfig);\n\n this.dialogsByFilters = new Map();\n return Promise.all([\n this.managers.filtersStorage.getDialogFilters().then(async(filters) => {\n await Promise.all(filters.filter((filter) => !REAL_FOLDERS.has(filter.id)).map(async(filter) => {\n const dialogs = await this.managers.dialogsStorage.getFolderDialogs(filter.id);\n const peerIds = dialogs.map((d) => d.peerId);\n this.dialogsByFilters.set(filter, new Set(peerIds));\n }));\n }),\n\n this.managers.apiManager.getAppConfig().then((appConfig) => {\n onAppConfig(appConfig);\n })\n ]);\n }\n\n checkbox(selected?: boolean) {\n const checkboxField = new CheckboxField({\n round: true\n });\n if(selected) {\n checkboxField.input.checked = selected;\n }\n\n return checkboxField.label;\n }\n\n renderResults = async(peerIds: PeerId[]) => {\n // const other = this.type === 'included' ? this.filter.exclude_peers : this.filter.include_peers;\n\n await this.managers.appUsersManager.getContacts();\n peerIds.forEach((peerId) => {\n // if(other.includes(peerId)) return;\n\n const {dom} = appDialogsManager.addDialogNew({\n peerId: peerId,\n container: this.selector.scrollable,\n rippleEnabled: true,\n avatarSize: 'abitbigger'\n });\n\n const selected = this.selector.selected.has(peerId);\n dom.containerEl.append(this.checkbox(selected));\n // if(selected) dom.listEl.classList.add('active');\n\n const foundInFilters: HTMLElement[] = [];\n this.dialogsByFilters.forEach((dialogs, filter) => {\n if(dialogs.has(peerId)) {\n const span = document.createElement('span');\n setInnerHTML(span, wrapEmojiText(filter.title));\n foundInFilters.push(span);\n }\n });\n\n const joined = join(foundInFilters, false);\n joined.forEach((el) => {\n dom.lastMessageSpan.append(el);\n });\n });\n };\n\n onOpen() {\n this.confirmBtn.style.display = this.type === 'excluded' ? '' : 'none';\n this.setTitle(this.type === 'included' ? 'FilterAlwaysShow' : 'FilterNeverShow');\n\n const filter = this.filter;\n\n const categoriesSection = new SettingSection({\n noDelimiter: true,\n name: 'FilterChatTypes'\n });\n\n categoriesSection.container.classList.add('folder-categories');\n\n let details: {[flag: string]: {ico: string, text: LangPackKey}};\n if(this.type === 'excluded') {\n details = {\n exclude_muted: {ico: 'mute', text: 'ChatList.Filter.MutedChats'},\n exclude_archived: {ico: 'archive', text: 'ChatList.Filter.Archive'},\n exclude_read: {ico: 'readchats', text: 'ChatList.Filter.ReadChats'}\n };\n } else {\n details = {\n contacts: {ico: 'newprivate', text: 'ChatList.Filter.Contacts'},\n non_contacts: {ico: 'noncontacts', text: 'ChatList.Filter.NonContacts'},\n groups: {ico: 'group', text: 'ChatList.Filter.Groups'},\n broadcasts: {ico: 'newchannel', text: 'ChatList.Filter.Channels'},\n bots: {ico: 'bots', text: 'ChatList.Filter.Bots'}\n };\n }\n\n const f = document.createDocumentFragment();\n for(const key in details) {\n const button = Button('btn-primary btn-transparent folder-category-button', {icon: details[key].ico, text: details[key].text});\n button.dataset.peerId = key;\n button.append(this.checkbox());\n f.append(button);\n }\n categoriesSection.content.append(f);\n\n // ///////////////\n\n const selectedPeers = (this.type === 'included' ? filter.includePeerIds : filter.excludePeerIds).slice();\n\n this.selector = new AppSelectPeers({\n appendTo: this.container,\n onChange: this.onSelectChange,\n peerType: ['dialogs'],\n renderResultsFunc: this.renderResults,\n placeholder: 'Search',\n sectionNameLangPackKey: 'FilterChats',\n managers: this.managers\n });\n this.selector.selected = new Set(selectedPeers);\n\n let addedInitial = false;\n const _add = this.selector.add.bind(this.selector);\n this.selector.add = (peerId, title, scroll) => {\n if(this.selector.selected.size >= this.limit && addedInitial && !details[peerId]) {\n const el: HTMLInputElement = this.selector.list.querySelector(`[data-peer-id=\"${peerId}\"] [type=\"checkbox\"]`);\n if(el) {\n setTimeout(() => {\n el.checked = false;\n }, 0);\n }\n\n const str = I18n.format(this.type === 'excluded' ? 'ChatList.Filter.Exclude.LimitReached': 'ChatList.Filter.Include.LimitReached', true);\n toast(str);\n return;\n }\n\n const div = _add(peerId, details[peerId] ? i18n(details[peerId].text) : undefined, scroll);\n if(details[peerId]) {\n div.querySelector('avatar-element').classList.add('tgico-' + details[peerId].ico);\n }\n return div;\n };\n\n this.selector.scrollable.container.append(categoriesSection.container, this.selector.scrollable.container.lastElementChild);\n\n this.selector.addInitial(selectedPeers);\n addedInitial = true;\n\n for(const flag in filter.pFlags) {\n // @ts-ignore\n if(details.hasOwnProperty(flag) && !!filter.pFlags[flag]) {\n simulateClickEvent(categoriesSection.content.querySelector(`[data-peer-id=\"${flag}\"]`) as HTMLElement);\n }\n }\n }\n\n onSelectChange = (length: number) => {\n // const changed = !deepEqual(this.filter, this.originalFilter);\n if(this.type === 'included') {\n this.confirmBtn.style.display = length ? '' : 'none';\n }\n };\n\n onCloseAfterTimeout() {\n if(this.selector) {\n this.selector.container.remove();\n this.selector = null;\n }\n\n return super.onCloseAfterTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appDialogsManager from '../../../lib/appManagers/appDialogsManager';\nimport {MyDialogFilter as DialogFilter} from '../../../lib/storages/filters';\nimport lottieLoader, {LottieLoader} from '../../../lib/rlottie/lottieLoader';\nimport {SliderSuperTab} from '../../slider';\nimport {toast} from '../../toast';\nimport InputField from '../../inputField';\nimport ButtonIcon from '../../buttonIcon';\nimport ButtonMenuToggle from '../../buttonMenuToggle';\nimport {ButtonMenuItemOptions} from '../../buttonMenu';\nimport Button from '../../button';\nimport AppIncludedChatsTab from './includedChats';\nimport {i18n, LangPackKey} from '../../../lib/langPack';\nimport PopupPeer from '../../popups/peer';\nimport RLottiePlayer from '../../../lib/rlottie/rlottiePlayer';\nimport copy from '../../../helpers/object/copy';\nimport deepEqual from '../../../helpers/object/deepEqual';\nimport wrapDraftText from '../../../lib/richTextProcessor/wrapDraftText';\nimport filterAsync from '../../../helpers/array/filterAsync';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport SettingSection from '../../settingSection';\nimport PopupElement from '../../popups';\n\nconst MAX_FOLDER_NAME_LENGTH = 12;\n\nexport default class AppEditFolderTab extends SliderSuperTab {\n private caption: HTMLElement;\n private stickerContainer: HTMLElement;\n\n private confirmBtn: HTMLElement;\n private menuBtn: HTMLElement;\n private nameInputField: InputField;\n\n private includePeerIds: SettingSection;\n private excludePeerIds: SettingSection;\n private flags: {[k in 'contacts' | 'non_contacts' | 'groups' | 'broadcasts' | 'bots' | 'exclude_muted' | 'exclude_archived' | 'exclude_read']: HTMLElement} = {} as any;\n\n private animation: RLottiePlayer;\n private filter: DialogFilter;\n private originalFilter: DialogFilter;\n\n private type: 'edit' | 'create';\n private loadAnimationPromise: ReturnType;\n\n public static getInitArgs() {\n return {\n animationData: lottieLoader.loadAnimationFromURLManually('Folders_2')\n };\n }\n\n public init(p: ReturnType = AppEditFolderTab.getInitArgs()) {\n this.container.classList.add('edit-folder-container');\n this.caption = document.createElement('div');\n this.caption.classList.add('caption');\n this.caption.append(i18n('FilterIncludeExcludeInfo'));\n this.stickerContainer = document.createElement('div');\n this.stickerContainer.classList.add('sticker-container');\n\n this.confirmBtn = ButtonIcon('check btn-confirm hide blue');\n let deleting = false;\n const deleteFolderButton: ButtonMenuItemOptions = {\n icon: 'delete danger',\n text: 'FilterMenuDelete',\n onClick: () => {\n PopupElement.createPopup(PopupPeer, 'filter-delete', {\n titleLangKey: 'ChatList.Filter.Confirm.Remove.Header',\n descriptionLangKey: 'ChatList.Filter.Confirm.Remove.Text',\n buttons: [{\n langKey: 'Delete',\n callback: () => {\n if(deleting) {\n return;\n }\n\n deleting = true;\n\n this.managers.filtersStorage.updateDialogFilter(this.filter, true).then((bool) => {\n this.close();\n }).finally(() => {\n deleting = false;\n });\n },\n isDanger: true\n }]\n }).show();\n }\n };\n this.menuBtn = ButtonMenuToggle({\n listenerSetter: this.listenerSetter,\n direction: 'bottom-left',\n buttons: [deleteFolderButton]\n });\n this.menuBtn.classList.add('hide');\n\n this.header.append(this.confirmBtn, this.menuBtn);\n\n const inputSection = new SettingSection({});\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n this.nameInputField = new InputField({\n label: 'FilterNameHint',\n maxLength: MAX_FOLDER_NAME_LENGTH\n });\n\n inputWrapper.append(this.nameInputField.container);\n inputSection.content.append(inputWrapper);\n\n const generateList = (className: string, h2Text: LangPackKey, buttons: {icon: string, name?: string, withRipple?: true, text: LangPackKey}[], to: any) => {\n const section = new SettingSection({\n name: h2Text,\n noDelimiter: true\n });\n\n section.container.classList.add('folder-list', className);\n\n const categories = section.generateContentElement();\n categories.classList.add('folder-categories');\n\n buttons.forEach((o) => {\n const button = Button('folder-category-button btn btn-primary btn-transparent', {\n icon: o.icon,\n text: o.text,\n noRipple: o.withRipple ? undefined : true\n });\n\n if(o.name) {\n to[o.name] = button;\n }\n\n categories.append(button);\n });\n\n return section;\n };\n\n this.includePeerIds = generateList('folder-list-included', 'FilterInclude', [{\n icon: 'add primary',\n text: 'ChatList.Filter.Include.AddChat',\n withRipple: true\n }, {\n text: 'ChatList.Filter.Contacts',\n icon: 'newprivate',\n name: 'contacts'\n }, {\n text: 'ChatList.Filter.NonContacts',\n icon: 'noncontacts',\n name: 'non_contacts'\n }, {\n text: 'ChatList.Filter.Groups',\n icon: 'group',\n name: 'groups'\n }, {\n text: 'ChatList.Filter.Channels',\n icon: 'channel',\n name: 'broadcasts'\n }, {\n text: 'ChatList.Filter.Bots',\n icon: 'bots',\n name: 'bots'\n }], this.flags);\n\n this.excludePeerIds = generateList('folder-list-excluded', 'FilterExclude', [{\n icon: 'minus primary',\n text: 'ChatList.Filter.Exclude.AddChat',\n withRipple: true\n }, {\n text: 'ChatList.Filter.MutedChats',\n icon: 'mute',\n name: 'exclude_muted'\n }, {\n text: 'ChatList.Filter.Archive',\n icon: 'archive',\n name: 'exclude_archived'\n }, {\n text: 'ChatList.Filter.ReadChats',\n icon: 'readchats',\n name: 'exclude_read'\n }], this.flags);\n\n this.scrollable.append(this.stickerContainer, this.caption, inputSection.container, this.includePeerIds.container, this.excludePeerIds.container);\n\n const includedFlagsContainer = this.includePeerIds.container.querySelector('.folder-categories');\n const excludedFlagsContainer = this.excludePeerIds.container.querySelector('.folder-categories');\n\n attachClickEvent(includedFlagsContainer.querySelector('.btn') as HTMLElement, () => {\n this.slider.createTab(AppIncludedChatsTab).open(this.filter, 'included', this);\n }, {listenerSetter: this.listenerSetter});\n\n attachClickEvent(excludedFlagsContainer.querySelector('.btn') as HTMLElement, () => {\n this.slider.createTab(AppIncludedChatsTab).open(this.filter, 'excluded', this);\n }, {listenerSetter: this.listenerSetter});\n\n attachClickEvent(this.confirmBtn, () => {\n if(this.nameInputField.input.classList.contains('error')) {\n return;\n }\n\n if(!this.nameInputField.value.trim()) {\n this.nameInputField.input.classList.add('error');\n return;\n }\n\n let include = (Array.from(includedFlagsContainer.children) as HTMLElement[]).slice(1).reduce((acc, el) => acc + +!el.style.display, 0);\n include += this.filter.include_peers.length;\n\n if(!include) {\n toast('Please choose at least one chat for this folder.');\n return;\n }\n\n this.confirmBtn.setAttribute('disabled', 'true');\n\n let promise: Promise;\n if(!this.filter.id) {\n promise = this.managers.filtersStorage.createDialogFilter(this.filter);\n } else {\n promise = this.managers.filtersStorage.updateDialogFilter(this.filter);\n }\n\n promise.then((bool) => {\n this.close();\n }).catch((err) => {\n if(err.type === 'DIALOG_FILTERS_TOO_MUCH') {\n toast('Sorry, you can\\'t create more folders.');\n } else {\n console.error('updateDialogFilter error:', err);\n }\n }).finally(() => {\n this.confirmBtn.removeAttribute('disabled');\n });\n }, {listenerSetter: this.listenerSetter});\n\n this.listenerSetter.add(this.nameInputField.input)('input', () => {\n this.filter.title = this.nameInputField.value;\n this.editCheckForChange();\n });\n\n const reloadMissingPromises: Promise[] = this.type === 'edit' ? [\n this.managers.filtersStorage.reloadMissingPeerIds(this.filter.id, 'pinned_peers'),\n this.managers.filtersStorage.reloadMissingPeerIds(this.filter.id, 'include_peers'),\n this.managers.filtersStorage.reloadMissingPeerIds(this.filter.id, 'exclude_peers')\n ] : [];\n\n return Promise.all([\n this.loadAnimationPromise = p.animationData.then(async(cb) => {\n const player = await cb({\n container: this.stickerContainer,\n loop: false,\n autoplay: false,\n width: 86,\n height: 86\n });\n\n this.animation = player;\n\n return lottieLoader.waitForFirstFrame(player);\n }),\n\n ...reloadMissingPromises\n ]).then(() => {\n if(this.type === 'edit') {\n this.setFilter(this.originalFilter, true);\n this.onEditOpen();\n } else {\n this.setInitFilter();\n this.onCreateOpen();\n }\n });\n }\n\n onOpenAfterTimeout() {\n this.loadAnimationPromise.then(() => {\n this.animation.autoplay = true;\n this.animation.play();\n });\n }\n\n private onCreateOpen() {\n // this.caption.style.display = '';\n this.setTitle('FilterNew');\n this.menuBtn.classList.add('hide');\n this.confirmBtn.classList.remove('hide');\n\n for(const flag in this.flags) {\n // @ts-ignore\n this.flags[flag].style.display = 'none';\n }\n }\n\n private onEditOpen() {\n // this.caption.style.display = 'none';\n this.setTitle(this.type === 'create' ? 'FilterNew' : 'FilterHeaderEdit');\n\n if(this.type === 'edit') {\n this.menuBtn.classList.remove('hide');\n this.confirmBtn.classList.add('hide');\n }\n\n const filter = this.filter;\n this.nameInputField.value = wrapDraftText(filter.title);\n\n for(const flag in this.flags) {\n this.flags[flag as keyof AppEditFolderTab['flags']].style.display = !!filter.pFlags[flag as keyof AppEditFolderTab['flags']] ? '' : 'none';\n }\n\n (['includePeerIds' as const, 'excludePeerIds' as const]).forEach(async(key) => {\n const section = this[key];\n const ul = appDialogsManager.createChatList({ignoreClick: true});\n\n let peers = filter[key];\n\n // filter peers where we're kicked\n const hasPeer = async(peerId: PeerId) => {\n return !!(await this.managers.appMessagesManager.getDialogOnly(peerId)) || (peerId.isUser() ? (await this.managers.appUsersManager.getUser(peerId.toUserId()))._ === 'user' : false);\n };\n\n const filtered = await filterAsync(peers, (peerId) => hasPeer(peerId));\n peers.length = 0;\n peers.push(...filtered);\n\n peers = peers.slice();\n\n const renderMore = async(_length: number) => {\n for(let i = 0, length = Math.min(peers.length, _length); i < length; ++i) {\n const peerId = peers.shift();\n if(peerId.isUser() ? false : !(await this.managers.appMessagesManager.getDialogOnly(peerId))) {\n continue;\n }\n\n const {dom} = appDialogsManager.addDialogNew({\n peerId: peerId,\n container: ul,\n rippleEnabled: false,\n meAsSaved: true,\n avatarSize: 'small'\n });\n dom.lastMessageSpan.parentElement.remove();\n }\n\n if(peers.length) {\n showMore.lastElementChild.replaceWith(i18n('FilterShowMoreChats', [peers.length]));\n } else if(showMore) {\n showMore.remove();\n }\n };\n\n section.generateContentElement().append(ul);\n\n let showMore: HTMLElement;\n if(peers.length) {\n const content = section.generateContentElement();\n showMore = Button('folder-category-button btn btn-primary btn-transparent', {icon: 'down'});\n showMore.classList.add('load-more', 'rp-overflow');\n attachClickEvent(showMore, () => renderMore(20), {listenerSetter: this.listenerSetter});\n showMore.append(i18n('FilterShowMoreChats', [peers.length]));\n\n content.append(showMore);\n }\n\n renderMore(4);\n });\n }\n\n editCheckForChange() {\n if(this.type === 'edit') {\n const changed = !deepEqual(this.originalFilter, this.filter);\n this.confirmBtn.classList.toggle('hide', !changed);\n this.menuBtn.classList.toggle('hide', changed);\n }\n };\n\n setFilter(filter: DialogFilter, firstTime: boolean) {\n if(this.container) {\n // cleanup\n Array.from(this.container.querySelectorAll('ul, .load-more')).forEach((el) => el.remove());\n }\n\n if(firstTime) {\n this.originalFilter = filter;\n this.filter = copy(filter);\n } else {\n this.filter = filter;\n this.onEditOpen();\n this.editCheckForChange();\n }\n }\n\n public setInitFilter(filter?: DialogFilter) {\n if(filter === undefined) {\n this.setFilter({\n _: 'dialogFilter',\n id: 0,\n title: '',\n pFlags: {},\n pinned_peers: [],\n include_peers: [],\n exclude_peers: [],\n pinnedPeerIds: [],\n includePeerIds: [],\n excludePeerIds: []\n }, true);\n this.type = 'create';\n } else {\n this.setFilter(filter, true);\n this.type = 'edit';\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport InputField from '../../inputField';\nimport {SliderSuperTab} from '../../slider';\nimport EditPeer from '../../editPeer';\nimport {UsernameInputField} from '../../usernameInputField';\nimport {i18n, i18n_, LangPackKey} from '../../../lib/langPack';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport rootScope from '../../../lib/rootScope';\nimport setBlankToAnchor from '../../../lib/richTextProcessor/setBlankToAnchor';\nimport getPeerEditableUsername from '../../../lib/appManagers/utils/peers/getPeerEditableUsername';\nimport SettingSection, {generateSection} from '../../settingSection';\nimport UsernamesSection from '../../usernamesSection';\n\n// TODO: аватарка не поменяется в этой вкладке после изменения почему-то (если поставить в другом клиенте, и потом тут проверить, для этого ещё вышел в чатлист)\n\nexport function purchaseUsernameCaption() {\n const p = document.createElement('div');\n const FRAGMENT_USERNAME_URL = 'https://fragment.com/username/';\n const a = setBlankToAnchor(document.createElement('a'));\n const purchaseText = i18n('Username.Purchase', [a]);\n purchaseText.classList.add('username-purchase-help');\n p.append(\n purchaseText,\n document.createElement('br'),\n document.createElement('br')\n );\n p.classList.add('hide');\n\n return {\n element: p,\n setUsername: (username: string) => {\n if(username) {\n a.href = FRAGMENT_USERNAME_URL + username;\n }\n\n p.classList.toggle('hide', !username);\n }\n };\n}\n\nexport default class AppEditProfileTab extends SliderSuperTab {\n private firstNameInputField: InputField;\n private lastNameInputField: InputField;\n private bioInputField: InputField;\n private usernameInputField: UsernameInputField;\n\n private profileUrlContainer: HTMLDivElement;\n private profileUrlAnchor: HTMLAnchorElement;\n\n private editPeer: EditPeer;\n\n public static getInitArgs() {\n return {\n bioMaxLength: rootScope.managers.apiManager.getLimit('bio'),\n user: rootScope.managers.appUsersManager.getSelf(),\n userFull: rootScope.managers.appProfileManager.getProfile(rootScope.myId.toUserId())\n };\n }\n\n public async init(p: ReturnType) {\n this.container.classList.add('edit-profile-container');\n this.setTitle('EditAccount.Title');\n\n const inputFields: InputField[] = [];\n\n const [bioMaxLength, user, userFull] = await Promise.all([p.bioMaxLength, p.user, p.userFull]);\n\n {\n const section = generateSection(this.scrollable, undefined, 'Bio.Description');\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n this.firstNameInputField = new InputField({\n label: 'EditProfile.FirstNameLabel',\n name: 'first-name',\n maxLength: 70\n });\n this.lastNameInputField = new InputField({\n label: 'Login.Register.LastName.Placeholder',\n name: 'last-name',\n maxLength: 64\n });\n this.bioInputField = new InputField({\n label: 'EditProfile.BioLabel',\n name: 'bio',\n maxLength: bioMaxLength\n });\n\n inputWrapper.append(this.firstNameInputField.container, this.lastNameInputField.container, this.bioInputField.container);\n\n const caption = document.createElement('div');\n caption.classList.add('caption');\n i18n_({element: caption, key: 'Bio.Description'});\n\n inputFields.push(this.firstNameInputField, this.lastNameInputField, this.bioInputField);\n\n this.editPeer = new EditPeer({\n peerId: rootScope.myId,\n inputFields,\n listenerSetter: this.listenerSetter\n });\n\n this.content.append(this.editPeer.nextBtn);\n\n section.append(this.editPeer.avatarEdit.container, inputWrapper);\n }\n\n {\n const section = new SettingSection({\n name: 'EditAccount.Username',\n caption: true\n });\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n this.usernameInputField = new UsernameInputField({\n label: 'EditProfile.Username.Label',\n name: 'username',\n plainText: true,\n listenerSetter: this.listenerSetter,\n onChange: () => {\n this.editPeer.handleChange();\n // this.setProfileUrl();\n\n const {error} = this.usernameInputField;\n const isPurchase = error?.type === 'USERNAME_PURCHASE_AVAILABLE';\n setUsername(isPurchase ? this.usernameInputField.value : undefined);\n },\n availableText: 'EditProfile.Username.Available',\n takenText: 'EditProfile.Username.Taken',\n invalidText: 'EditProfile.Username.Invalid'\n }, this.managers);\n\n inputWrapper.append(this.usernameInputField.container);\n\n const caption = section.caption;\n\n const {setUsername, element: p} = purchaseUsernameCaption();\n\n caption.append(\n p,\n i18n('UsernameHelp')\n // document.createElement('br'),\n // document.createElement('br')\n );\n\n // const profileUrlContainer = this.profileUrlContainer = document.createElement('div');\n // profileUrlContainer.classList.add('profile-url-container');\n // const profileUrlAnchor = this.profileUrlAnchor = anchorCopy();\n // profileUrlContainer.append(i18n('UsernameHelpLink', [profileUrlAnchor]));\n // caption.append(profileUrlContainer);\n\n inputFields.push(this.usernameInputField);\n section.content.append(inputWrapper);\n this.scrollable.append(section.container);\n }\n\n {\n const section = new UsernamesSection({\n peerId: rootScope.myId,\n peer: user,\n listenerSetter: this.listenerSetter,\n usernameInputField: this.usernameInputField,\n middleware: this.middlewareHelper.get()\n });\n\n this.scrollable.append(section.container);\n }\n\n attachClickEvent(this.editPeer.nextBtn, () => {\n this.editPeer.nextBtn.disabled = true;\n\n const promises: Promise[] = [];\n\n const profilePromise = this.managers.appProfileManager.updateProfile(\n this.firstNameInputField.value,\n this.lastNameInputField.value,\n this.bioInputField.value\n );\n promises.push(profilePromise.then(() => {\n this.close();\n }, (err) => {\n console.error('updateProfile error:', err);\n }));\n\n if(this.editPeer.uploadAvatar) {\n promises.push(this.editPeer.uploadAvatar().then((inputFile) => {\n return this.managers.appProfileManager.uploadProfilePhoto(inputFile);\n }));\n }\n\n if(this.usernameInputField.isValidToChange()) {\n promises.push(this.managers.appUsersManager.updateUsername(this.usernameInputField.value));\n }\n\n Promise.race(promises).finally(() => {\n this.editPeer.nextBtn.removeAttribute('disabled');\n });\n }, {listenerSetter: this.listenerSetter});\n\n this.firstNameInputField.setOriginalValue(user.first_name, true);\n this.lastNameInputField.setOriginalValue(user.last_name, true);\n this.bioInputField.setOriginalValue(userFull.about, true);\n this.usernameInputField.setOriginalValue(getPeerEditableUsername(user), true);\n\n // this.setProfileUrl();\n this.editPeer.handleChange();\n }\n\n // private setProfileUrl() {\n // if(this.usernameInputField.input.classList.contains('error') || !this.usernameInputField.value.length) {\n // this.profileUrlContainer.style.display = 'none';\n // } else {\n // this.profileUrlContainer.style.display = '';\n // this.profileUrlAnchor.replaceWith(this.profileUrlAnchor = anchorCopy({mePath: this.usernameInputField.value}));\n // }\n // }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appImManager, {APP_TABS} from '../../lib/appManagers/appImManager';\nimport SidebarSlider from '../slider';\nimport mediaSizes, {ScreenSize} from '../../helpers/mediaSizes';\nimport AppSharedMediaTab from './tabs/sharedMedia';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport {AppManagers} from '../../lib/appManagers/managers';\n\nexport const RIGHT_COLUMN_ACTIVE_CLASSNAME = 'is-right-column-shown';\n\nexport class AppSidebarRight extends SidebarSlider {\n private isColumnProportionSet = false;\n private sharedMediaTab: AppSharedMediaTab;\n // public rect: DOMRect;\n\n constructor() {\n super({\n sidebarEl: document.getElementById('column-right') as HTMLElement,\n canHideFirst: true,\n navigationType: 'right'\n });\n }\n\n construct(managers: AppManagers) {\n this.managers = managers;\n\n mediaSizes.addEventListener('changeScreen', (from, to) => {\n if(to === ScreenSize.medium && from !== ScreenSize.mobile) {\n this.toggleSidebar(false);\n }\n });\n\n mediaSizes.addEventListener('resize', () => {\n this.setColumnProportion();\n });\n }\n\n public createSharedMediaTab() {\n const tab = this.createTab(AppSharedMediaTab, false, true);\n tab.slider = this;\n // this.tabsContainer.prepend(tab.container);\n return tab;\n }\n\n public replaceSharedMediaTab(tab?: AppSharedMediaTab) {\n const previousTab = this.sharedMediaTab;\n if(previousTab) {\n const idx = this.historyTabIds.indexOf(previousTab);\n\n if(this._selectTab.getFrom() === previousTab.container) {\n this._selectTab.setFrom(tab?.container);\n }\n\n if(tab) {\n if(idx !== -1) {\n this.historyTabIds[idx] = tab;\n }\n\n const wasActive = previousTab.container.classList.contains('active');\n if(wasActive) {\n tab.container.classList.add('active');\n }\n\n previousTab.container.replaceWith(tab.container);\n } else {\n if(idx !== -1) {\n this.historyTabIds.splice(idx, 1);\n }\n\n previousTab.container.remove();\n }\n } else {\n this.tabsContainer.prepend(tab.container);\n }\n\n this.sharedMediaTab = tab;\n }\n\n public onCloseTab(id: number, animate: boolean, isNavigation?: boolean) {\n if(!this.historyTabIds.length) {\n this.toggleSidebar(false, animate);\n }\n\n super.onCloseTab(id, animate, isNavigation);\n }\n\n private setColumnProportion() {\n const proportion = this.sidebarEl.scrollWidth / this.sidebarEl.previousElementSibling.scrollWidth;\n document.documentElement.style.setProperty('--right-column-proportion', '' + proportion);\n // this.rect = this.sidebarEl.getBoundingClientRect();\n }\n\n public toggleSidebar(enable?: boolean, animate?: boolean) {\n const active = document.body.classList.contains(RIGHT_COLUMN_ACTIVE_CLASSNAME);\n let willChange: boolean;\n if(enable !== undefined) {\n if(enable) {\n if(!active) {\n willChange = true;\n }\n } else if(active) {\n willChange = true;\n }\n } else {\n willChange = true;\n }\n\n if(!willChange) return Promise.resolve();\n\n if(!active && !this.historyTabIds.length) {\n this.sharedMediaTab.open();\n }\n\n if(!this.isColumnProportionSet) {\n this.setColumnProportion();\n this.isColumnProportionSet = true;\n }\n\n const animationPromise = appImManager.selectTab(active ? APP_TABS.CHAT : APP_TABS.PROFILE, animate);\n document.body.classList.toggle(RIGHT_COLUMN_ACTIVE_CLASSNAME, enable);\n return animationPromise;\n\n /* return new Promise((resolve, reject) => {\n const hidden: {element: HTMLDivElement, height: number}[] = [];\n const observer = new IntersectionObserver((entries) => {\n for(const entry of entries) {\n const bubble = entry.target as HTMLDivElement;\n if(!entry.isIntersecting) {\n hidden.push({element: bubble, height: bubble.scrollHeight});\n }\n }\n\n for(const item of hidden) {\n item.element.style.minHeight = item.height + 'px';\n (item.element.firstElementChild as HTMLElement).style.display = 'none';\n item.element.style.width = '1px';\n }\n\n //console.log('hidden', hidden);\n observer.disconnect();\n\n set();\n\n setTimeout(() => {\n for(const item of hidden) {\n item.element.style.minHeight = '';\n item.element.style.width = '';\n (item.element.firstElementChild as HTMLElement).style.display = '';\n }\n\n resolve();\n }, 200);\n });\n\n const length = Object.keys(appImManager.bubbles).length;\n if(length) {\n for(const i in appImManager.bubbles) {\n observer.observe(appImManager.bubbles[i]);\n }\n } else {\n set();\n setTimeout(resolve, 200);\n }\n }); */\n }\n}\n\nconst appSidebarRight = new AppSidebarRight();\nMOUNT_CLASS_TO.appSidebarRight = appSidebarRight;\nexport default appSidebarRight;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider'\nimport InputField from '../../inputField';\nimport EditPeer from '../../editPeer';\nimport Row, {CreateRowFromCheckboxField} from '../../row';\nimport CheckboxField from '../../checkboxField';\nimport Button from '../../button';\nimport PeerTitle from '../../peerTitle';\nimport rootScope from '../../../lib/rootScope';\nimport PopupPeer from '../../popups/peer';\nimport PopupElement, {addCancelButton} from '../../popups';\nimport {i18n} from '../../../lib/langPack';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport getPeerId from '../../../lib/appManagers/utils/peers/getPeerId';\nimport formatUserPhone from '../../wrappers/formatUserPhone';\nimport SettingSection from '../../settingSection';\nimport wrapPeerTitle from '../../wrappers/peerTitle';\n\nexport default class AppEditContactTab extends SliderSuperTab {\n private nameInputField: InputField;\n private lastNameInputField: InputField;\n private editPeer: EditPeer;\n private sharePhoneCheckboxField: CheckboxField;\n public peerId: PeerId;\n\n public async init() {\n const {peerId} = this;\n const userId = peerId.toUserId();\n this.container.classList.add('edit-peer-container', 'edit-contact-container');\n const [isContact, privacy] = await Promise.all([\n this.managers.appUsersManager.isContact(userId),\n this.managers.appPrivacyManager.getPrivacy('inputPrivacyKeyPhoneNumber')\n ]);\n const isNew = !isContact;\n this.setTitle(isNew ? 'AddContactTitle' : 'Edit');\n\n {\n const section = new SettingSection({noDelimiter: true});\n const inputFields: InputField[] = [];\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n this.nameInputField = new InputField({\n label: 'FirstName',\n name: 'contact-name',\n maxLength: 70,\n required: true\n });\n this.lastNameInputField = new InputField({\n label: 'LastName',\n name: 'contact-lastname',\n maxLength: 70\n });\n\n if(userId) {\n const user = await this.managers.appUsersManager.getUser(userId);\n\n if(isNew) {\n this.nameInputField.setDraftValue(user.first_name);\n this.lastNameInputField.setDraftValue(user.last_name);\n } else {\n this.nameInputField.setOriginalValue(user.first_name);\n this.lastNameInputField.setOriginalValue(user.last_name);\n }\n }\n\n inputWrapper.append(this.nameInputField.container, this.lastNameInputField.container);\n inputFields.push(this.nameInputField, this.lastNameInputField);\n\n this.editPeer = new EditPeer({\n peerId: peerId,\n inputFields,\n listenerSetter: this.listenerSetter,\n doNotEditAvatar: true\n });\n this.content.append(this.editPeer.nextBtn);\n\n if(peerId) {\n const div = document.createElement('div');\n div.classList.add('avatar-edit');\n div.append(this.editPeer.avatarElem);\n\n const notificationsCheckboxField = new CheckboxField({\n text: 'Notifications'\n });\n\n notificationsCheckboxField.input.addEventListener('change', (e) => {\n if(!e.isTrusted) {\n return;\n }\n\n this.managers.appMessagesManager.togglePeerMute({peerId});\n });\n\n this.listenerSetter.add(rootScope)('notify_settings', async(update) => {\n if(update.peer._ !== 'notifyPeer') return;\n const peerId = getPeerId(update.peer.peer);\n if(peerId === peerId) {\n const enabled = !(await this.managers.appNotificationsManager.isMuted(update.notify_settings));\n if(enabled !== notificationsCheckboxField.checked) {\n notificationsCheckboxField.checked = enabled;\n }\n }\n });\n\n const profileNameDiv = document.createElement('div');\n profileNameDiv.classList.add('profile-name');\n profileNameDiv.append(new PeerTitle({\n peerId: peerId\n }).element);\n // profileNameDiv.innerHTML = 'Karen Stanford';\n\n const profileSubtitleDiv = document.createElement('div');\n profileSubtitleDiv.classList.add('profile-subtitle');\n profileSubtitleDiv.append(i18n('EditContact.OriginalName'));\n\n section.content.append(div, profileNameDiv, profileSubtitleDiv, inputWrapper);\n\n if(!isNew) {\n const notificationsRow = new Row({\n checkboxField: notificationsCheckboxField,\n withCheckboxSubtitle: true,\n listenerSetter: this.listenerSetter\n });\n\n const enabled = !(await this.managers.appNotificationsManager.isPeerLocalMuted({peerId, respectType: false}));\n notificationsCheckboxField.checked = enabled;\n\n section.content.append(notificationsRow.container);\n } else {\n const user = await this.managers.appUsersManager.getUser(userId);\n\n const phoneRow = new Row({\n icon: 'phone',\n titleLangKey: user.phone ? undefined : 'MobileHidden',\n title: user.phone ? formatUserPhone(user.phone) : undefined,\n subtitleLangKey: user.phone ? 'Phone' : 'MobileHiddenExceptionInfo',\n subtitleLangArgs: user.phone ? undefined : [new PeerTitle({peerId: peerId}).element]\n });\n\n section.content.append(phoneRow.container);\n }\n } else {\n section.content.append(inputWrapper);\n }\n\n this.scrollable.append(section.container);\n }\n\n if(!isNew) {\n const section = new SettingSection();\n\n const btnDelete = Button('btn-primary btn-transparent danger', {icon: 'delete', text: 'PeerInfo.DeleteContact'});\n\n attachClickEvent(btnDelete, () => {\n PopupElement.createPopup(PopupPeer, 'popup-delete-contact', {\n peerId: peerId,\n titleLangKey: 'DeleteContact',\n descriptionLangKey: 'AreYouSureDeleteContact',\n buttons: addCancelButton([{\n langKey: 'Delete',\n callback: () => {\n const toggle = toggleDisability([btnDelete], true);\n\n this.managers.appUsersManager.deleteContacts([userId]).then(() => {\n this.close();\n }, () => {\n toggle();\n });\n },\n isDanger: true\n }])\n }).show();\n }, {listenerSetter: this.listenerSetter});\n\n section.content.append(btnDelete);\n\n this.scrollable.append(section.container);\n } else if(\n privacy.some((privacyRule) => privacyRule._ === 'privacyValueDisallowAll') &&\n !privacy.some((privacyRule) => privacyRule._ === 'privacyValueAllowUsers' && privacyRule.users.includes(userId))\n ) {\n const section = new SettingSection({\n caption: 'NewContact.Exception.ShareMyPhoneNumber.Desc',\n captionArgs: [await wrapPeerTitle({peerId: this.peerId})]\n });\n const checkboxField = this.sharePhoneCheckboxField = new CheckboxField({\n text: 'NewContact.Exception.ShareMyPhoneNumber',\n checked: true\n });\n const row = CreateRowFromCheckboxField(checkboxField);\n\n section.content.append(row.container);\n\n this.scrollable.append(section.container);\n }\n\n attachClickEvent(this.editPeer.nextBtn, async() => {\n this.editPeer.nextBtn.disabled = true;\n\n this.managers.appUsersManager.addContact(\n userId,\n this.nameInputField.value,\n this.lastNameInputField.value,\n (await this.managers.appUsersManager.getUser(userId)).phone,\n this.sharePhoneCheckboxField?.checked\n ).finally(() => {\n this.editPeer.nextBtn.removeAttribute('disabled');\n this.close();\n });\n }, {listenerSetter: this.listenerSetter});\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport {makeMediaSize} from '../../../helpers/mediaSize';\nimport copy from '../../../helpers/object/copy';\nimport deepEqual from '../../../helpers/object/deepEqual';\nimport {ForumTopic} from '../../../layer';\nimport appImManager from '../../../lib/appManagers/appImManager';\nimport {GENERAL_TOPIC_ID, TOPIC_COLORS} from '../../../lib/mtproto/mtproto_config';\nimport getAbbreviation from '../../../lib/richTextProcessor/getAbbreviation';\nimport ButtonIcon from '../../buttonIcon';\nimport CheckboxField from '../../checkboxField';\nimport EmojiTab from '../../emoticonsDropdown/tabs/emoji';\nimport InputField from '../../inputField';\nimport Row from '../../row';\nimport SettingSection from '../../settingSection';\nimport appSidebarLeft from '../../sidebarLeft';\nimport SliderSuperTab from '../../sliderTab';\nimport {wrapTopicIcon} from '../../wrappers/messageActionTextNewUnsafe';\n\nconst size = 64;\nconst mediaSize = makeMediaSize(size, size);\n\nexport default class AppEditTopicTab extends SliderSuperTab {\n private iconDiv: HTMLElement;\n private colorIndex: number;\n private nameInputField: InputField;\n private topic: Parameters[0]['topic'];\n private emojiElement: HTMLElement;\n private confirmBtn: HTMLButtonElement;\n private originalTopic: ForumTopic.forumTopic;\n\n public async init(peerId: PeerId, threadId?: number) {\n this.colorIndex = 0;\n const isNew = !threadId;\n const isGeneral = threadId === GENERAL_TOPIC_ID;\n this.container.classList.add('edit-topic-container');\n this.setTitle(isNew ? 'NewTopic' : 'ForumTopic.Title.Edit');\n const chatId = peerId.toChatId();\n\n if(threadId) {\n this.topic = this.originalTopic = copy(await this.managers.dialogsStorage.getForumTopic(peerId, threadId));\n }\n\n {\n const section = new SettingSection({\n name: isGeneral ? 'CreateGeneralTopicTitle' : 'CreateTopicTitle'\n });\n\n const iconDiv = this.iconDiv = document.createElement('div');\n iconDiv.classList.add('edit-topic-icon-container');\n\n !threadId && attachClickEvent(iconDiv, () => {\n if(this.topic.icon_emoji_id) {\n return;\n }\n\n this.colorIndex = (this.colorIndex + 1) % TOPIC_COLORS.length;\n this.setIcon();\n }, {listenerSetter: this.listenerSetter});\n\n if(threadId) {\n iconDiv.classList.add('disable-hover');\n }\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const nameInputField = this.nameInputField = new InputField({\n label: 'ForumTopic.Name.Placeholder',\n withLinebreaks: false,\n name: 'topic-name',\n maxLength: 70,\n required: true\n });\n\n if(this.topic) {\n nameInputField.setOriginalValue(this.topic.title, true);\n }\n\n const confirmBtn = this.confirmBtn = ButtonIcon('check btn-confirm blue hide', {noRipple: true});\n this.header.append(confirmBtn);\n\n attachClickEvent(confirmBtn, () => {\n const toggle = toggleDisability([confirmBtn], true);\n if(threadId) {\n this.managers.appChatsManager.editForumTopic({\n chatId,\n topicId: threadId,\n title: nameInputField.value,\n iconEmojiId: this.topic.icon_emoji_id || 0\n }).then(() => {\n this.close();\n }).catch((err) => {\n console.error('edit topic error', err);\n toggle();\n });\n } else {\n this.managers.appChatsManager.createForumTopic({\n chatId,\n iconColor: TOPIC_COLORS[this.colorIndex],\n iconEmojiId: this.topic.icon_emoji_id,\n title: nameInputField.value\n }).then((threadId) => {\n this.close();\n appImManager.setInnerPeer({\n peerId,\n threadId\n });\n }).catch((err) => {\n console.error('create topic error', err);\n toggle();\n });\n }\n }, {listenerSetter: this.listenerSetter});\n\n this.listenerSetter.add(nameInputField.input)('input', () => {\n this.validate();\n this.setIcon(this.topic?.icon_emoji_id);\n });\n\n inputWrapper.append(nameInputField.container);\n\n section.content.append(iconDiv, inputWrapper);\n\n this.scrollable.append(section.container);\n }\n\n const promises: Promise[] = [];\n\n if(!isGeneral) {\n const section = new SettingSection({});\n section.container.classList.add('edit-topic-emoticons-container');\n const emojiTab = new EmojiTab({\n managers: this.managers,\n isStandalone: true,\n noRegularEmoji: true,\n stickerSetId: 'inputStickerSetEmojiDefaultTopicIcons',\n onClick: (emoji) => {\n emojiTab.setActive(!emoji.docId ? {emoji: undefined, docId: undefined} : emoji);\n this.setIcon(emoji.docId);\n }\n });\n emojiTab.getContainerSize = () => ({\n width: appSidebarLeft.rect.width,\n height: 400\n });\n\n this.middlewareHelper.onDestroy(() => {\n emojiTab.destroy();\n });\n\n emojiTab.container.classList.remove('tabs-tab');\n\n this.emojiElement = document.createElement('span');\n this.emojiElement.classList.add('super-emoji-topic-icon');\n\n const promise = emojiTab.init().then(async() => {\n const category = emojiTab.getCustomCategory();\n\n const iconEmojiId = this.topic?.icon_emoji_id;\n emojiTab.addEmojiToCategory({\n category,\n element: this.emojiElement,\n batch: false,\n prepend: true,\n active: !iconEmojiId\n });\n\n if(iconEmojiId) {\n emojiTab.setActive({docId: iconEmojiId, emoji: ''});\n }\n });\n\n promises.push(promise);\n\n section.content.replaceWith(emojiTab.container);\n this.scrollable.append(section.container);\n } else {\n const section = new SettingSection({caption: 'EditTopicHideInfo'});\n\n const checkboxField = new CheckboxField({\n // toggle: true,\n checked: !(this.topic as ForumTopic.forumTopic).pFlags.hidden,\n text: 'EditTopicHide'\n });\n\n this.listenerSetter.add(checkboxField.input)('change', () => {\n const promise = this.managers.appChatsManager.editForumTopic({\n chatId,\n topicId: threadId,\n hidden: !checkboxField.checked\n });\n\n row.disableWithPromise(promise);\n });\n\n const row = new Row({\n checkboxField\n });\n\n section.content.append(row.container);\n\n this.scrollable.append(section.container);\n }\n\n return Promise.all(promises).then(() => {\n return this.s();\n });\n }\n\n private validate() {\n let isChanged = this.nameInputField.isValidToChange();\n if(!isChanged && this.originalTopic) {\n isChanged = this.topic.icon_emoji_id !== this.originalTopic.icon_emoji_id;\n }\n\n this.confirmBtn.classList.toggle('hide', !isChanged);\n }\n\n private s() {\n if(this.topic?.icon_color) {\n this.colorIndex = TOPIC_COLORS.indexOf(this.topic.icon_color);\n }\n\n return this.setIcon(this.topic?.icon_emoji_id, undefined, true);\n }\n\n private async setIcon(iconEmojiId?: Long, appendTo = this.iconDiv, force?: boolean) {\n const title = this.nameInputField.value;\n\n const isMainIcon = appendTo === this.iconDiv;\n\n if(isMainIcon) {\n const newTopic: AppEditTopicTab['topic'] = {\n id: this.topic?.id,\n icon_color: TOPIC_COLORS[this.colorIndex],\n title: getAbbreviation(title, true).text || 'A',\n icon_emoji_id: iconEmojiId\n };\n\n const oldTopic = this.topic;\n this.topic = newTopic;\n\n if(\n force ||\n !oldTopic ||\n oldTopic.icon_color !== newTopic.icon_color ||\n oldTopic.title !== newTopic.title\n ) {\n this.setIcon(undefined, this.emojiElement);\n }\n\n if(deepEqual(oldTopic, newTopic) && !force) {\n return;\n }\n\n this.validate();\n }\n\n const el = await wrapTopicIcon({\n topic: isMainIcon ? this.topic : {...this.topic, icon_emoji_id: undefined},\n customEmojiSize: mediaSize,\n middleware: this.middlewareHelper.get()\n });\n\n const span = document.createElement('div');\n span.classList.add('edit-topic-icon');\n span.append(el);\n\n const oldEl = appendTo.lastElementChild as HTMLElement;\n appendTo.append(span);\n\n const applyFadeAnimation = (el: HTMLElement, fadeIn: boolean) => {\n const frames: Keyframe[] = [\n {opacity: '0', transform: 'scale(0.8)'},\n {opacity: '1', transform: 'scale(1)'}\n ];\n\n const animation = el.animate(frames, {\n duration: 200,\n iterations: 1,\n easing: 'ease-in-out',\n fill: 'forwards',\n direction: fadeIn ? 'normal' : 'reverse'\n });\n\n return new Promise((resolve) => {\n animation.addEventListener('finish', () => {\n resolve();\n }, {once: true});\n });\n };\n\n if(oldEl) {\n applyFadeAnimation(oldEl, false).then(() => oldEl.remove());\n }\n\n applyFadeAnimation(span, true);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {copyTextToClipboard} from '../../../helpers/clipboard';\nimport {randomLong} from '../../../helpers/random';\nimport {Chat, ChatFull, ExportedChatInvite} from '../../../layer';\nimport Button from '../../button';\nimport {setButtonLoader} from '../../putPreloader';\nimport RadioField from '../../radioField';\nimport Row, {RadioFormFromRows} from '../../row';\nimport {toast} from '../../toast';\nimport {UsernameInputField} from '../../usernameInputField';\nimport {SliderSuperTabEventable} from '../../sliderTab';\nimport I18n, {i18n} from '../../../lib/langPack';\nimport PopupPeer from '../../popups/peer';\nimport ButtonCorner from '../../buttonCorner';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport CheckboxField from '../../checkboxField';\nimport rootScope from '../../../lib/rootScope';\nimport SettingSection from '../../settingSection';\nimport UsernamesSection from '../../usernamesSection';\nimport getPeerEditableUsername from '../../../lib/appManagers/utils/peers/getPeerEditableUsername';\nimport getPeerActiveUsernames from '../../../lib/appManagers/utils/peers/getPeerActiveUsernames';\nimport {purchaseUsernameCaption} from '../../sidebarLeft/tabs/editProfile';\nimport confirmationPopup from '../../confirmationPopup';\nimport PopupElement from '../../popups';\n\nexport default class AppChatTypeTab extends SliderSuperTabEventable {\n public chatId: ChatId;\n public chatFull: ChatFull;\n\n public async init() {\n this.container.classList.add('edit-peer-container', 'group-type-container');\n\n const isBroadcast = await this.managers.appChatsManager.isBroadcast(this.chatId);\n\n this.setTitle(isBroadcast ? 'ChannelType' : 'GroupType');\n\n const section = new SettingSection({\n name: isBroadcast ? 'ChannelType' : 'GroupType'\n });\n\n const random = randomLong();\n const privateRow = new Row({\n radioField: new RadioField({\n langKey: isBroadcast ? 'ChannelPrivate' : 'MegaPrivate',\n name: random,\n value: 'private'\n }),\n subtitleLangKey: isBroadcast ? 'ChannelPrivateInfo' : 'MegaPrivateInfo'\n });\n const publicRow = new Row({\n radioField: new RadioField({\n langKey: isBroadcast ? 'ChannelPublic' : 'MegaPublic',\n name: random,\n value: 'public'\n }),\n subtitleLangKey: isBroadcast ? 'ChannelPublicInfo' : 'MegaPublicInfo'\n });\n const form = RadioFormFromRows([privateRow, publicRow], (value) => {\n const a: HTMLElement[][] = [[privateSection.container], [publicContainer]];\n if(value === 'public') a.reverse();\n\n a[0].forEach((container) => container.classList.remove('hide'));\n a[1].forEach((container) => container.classList.add('hide'));\n\n onChange();\n });\n\n let chat: Chat = await this.managers.appChatsManager.getChat(this.chatId);\n\n const chatUpdateListeners: {[type in 'basic']: (() => void)[]} = {basic: []};\n const addChatUpdateListener = (callback: () => void, type: 'basic' = 'basic') => {\n chatUpdateListeners[type].push(callback);\n };\n\n this.listenerSetter.add(rootScope)('chat_update', async(chatId) => {\n if(this.chatId === chatId) {\n chat = await this.managers.appChatsManager.getChat(this.chatId) as typeof chat;\n chatUpdateListeners['basic'].forEach((callback) => callback());\n }\n });\n\n section.content.append(form);\n\n const privateSection = new SettingSection({});\n\n // let revoked = false;\n const linkRow = new Row({\n title: (this.chatFull.exported_invite as ExportedChatInvite.chatInviteExported).link,\n subtitleLangKey: isBroadcast ? 'ChannelPrivateLinkHelp' : 'MegaPrivateLinkHelp',\n clickable: () => {\n copyTextToClipboard((this.chatFull.exported_invite as ExportedChatInvite.chatInviteExported).link);\n toast(I18n.format('LinkCopied', true));\n },\n listenerSetter: this.listenerSetter\n });\n\n const btnRevoke = Button('btn-primary btn-transparent danger', {icon: 'delete', text: 'RevokeLink'});\n\n attachClickEvent(btnRevoke, () => {\n PopupElement.createPopup(PopupPeer, 'revoke-link', {\n buttons: [{\n langKey: 'RevokeButton',\n callback: () => {\n const toggle = toggleDisability([btnRevoke], true);\n\n this.managers.appProfileManager.getChatInviteLink(this.chatId, true).then((link) => {\n toggle();\n linkRow.title.innerHTML = link;\n // revoked = true;\n // onChange();\n });\n }\n }],\n titleLangKey: 'RevokeLink',\n descriptionLangKey: 'RevokeAlert'\n }).show();\n }, {listenerSetter: this.listenerSetter});\n\n privateSection.content.append(linkRow.container, btnRevoke);\n\n const publicSection = new SettingSection({\n caption: true,\n noDelimiter: true\n });\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const placeholder = 't.me/';\n\n const onChange = () => {\n const changed = (privateRow.radioField.checked && (originalValue !== placeholder/* || revoked */)) ||\n (linkInputField.isValidToChange() && linkInputField.input.classList.contains('valid'));\n applyBtn.classList.toggle('is-visible', changed);\n\n const {error} = linkInputField;\n const isPurchase = error?.type === 'USERNAME_PURCHASE_AVAILABLE';\n setUsername(isPurchase ? linkInputField.getValue() : undefined);\n };\n\n const linkInputField = new UsernameInputField({\n label: 'SetUrlPlaceholder',\n name: 'group-public-link',\n plainText: true,\n listenerSetter: this.listenerSetter,\n availableText: 'Link.Available',\n invalidText: 'Link.Invalid',\n takenText: 'Link.Taken',\n onChange: onChange,\n peerId: this.chatId.toPeerId(true),\n head: placeholder\n }, this.managers);\n\n const {setUsername, element: p} = purchaseUsernameCaption();\n\n publicSection.caption.append(\n p,\n i18n(isBroadcast ? 'Channel.UsernameAboutChannel' : 'Channel.UsernameAboutGroup')\n );\n\n const usernamesSection = new UsernamesSection({\n peerId: this.chatId.toPeerId(true),\n peer: chat as Chat.channel,\n listenerSetter: this.listenerSetter,\n usernameInputField: linkInputField,\n middleware: this.middlewareHelper.get()\n });\n\n const publicContainer = document.createElement('div');\n publicContainer.append(publicSection.container, usernamesSection.container);\n\n const originalValue = placeholder + (getPeerEditableUsername(chat as Chat.channel) || '');\n\n inputWrapper.append(linkInputField.container)\n publicSection.content.append(inputWrapper);\n\n const applyBtn = ButtonCorner({icon: 'check', className: 'is-visible'});\n this.content.append(applyBtn);\n\n attachClickEvent(applyBtn, async() => {\n const username = publicRow.radioField.checked ? linkInputField.getValue() : '';\n if(!username) {\n const chat = await this.managers.appChatsManager.getChat(this.chatId);\n const wasUsername = getPeerEditableUsername(chat as Chat.channel);\n if(wasUsername) {\n await confirmationPopup({\n descriptionLangKey: isBroadcast ? 'ChannelVisibility.Confirm.MakePrivate.Channel' : 'ChannelVisibility.Confirm.MakePrivate.Group',\n descriptionLangArgs: [wasUsername],\n button: {\n langKey: 'OK'\n }\n });\n }\n }\n\n /* const unsetLoader = */setButtonLoader(applyBtn);\n this.managers.appChatsManager.migrateChat(this.chatId).then((channelId) => {\n if(!username) {\n return this.managers.appChatsManager.makeChannelPrivate(channelId);\n } else {\n return this.managers.appChatsManager.updateUsername(channelId, username);\n }\n }).then(() => {\n // unsetLoader();\n this.close();\n });\n }, {listenerSetter: this.listenerSetter});\n\n (originalValue !== placeholder || getPeerActiveUsernames(chat as Chat.channel).length ? publicRow : privateRow).radioField.checked = true;\n linkInputField.setOriginalValue(originalValue, true);\n\n this.scrollable.append(section.container, privateSection.container, publicContainer);\n\n {\n const section = new SettingSection({\n name: 'SavingContentTitle',\n caption: isBroadcast ? 'RestrictSavingContentInfoChannel' : 'RestrictSavingContentInfoGroup'\n });\n\n const checkboxField = new CheckboxField({\n text: 'RestrictSavingContent',\n withRipple: true\n });\n\n this.listenerSetter.add(checkboxField.input)('change', () => {\n const toggle = checkboxField.toggleDisability(true);\n this.managers.appChatsManager.toggleNoForwards(this.chatId, checkboxField.checked).then(() => {\n toggle();\n });\n });\n\n const onChatUpdate = () => {\n checkboxField.setValueSilently(!!(chat as Chat.channel).pFlags.noforwards);\n };\n\n addChatUpdateListener(onChatUpdate);\n\n onChatUpdate();\n\n section.content.append(checkboxField.label);\n\n this.scrollable.append(section.container);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport deepEqual from '../../../helpers/object/deepEqual';\nimport {ChannelParticipant, ChatParticipant} from '../../../layer';\nimport appDialogsManager from '../../../lib/appManagers/appDialogsManager';\nimport Button from '../../button';\nimport confirmationPopup from '../../confirmationPopup';\nimport SettingSection from '../../settingSection';\nimport {SliderSuperTabEventable} from '../../sliderTab';\nimport getUserStatusString from '../../wrappers/getUserStatusString';\nimport wrapPeerTitle from '../../wrappers/peerTitle';\nimport {ChatPermissions} from './groupPermissions';\n\nexport default class AppUserPermissionsTab extends SliderSuperTabEventable {\n public participant: ChannelParticipant | ChatParticipant;\n public chatId: ChatId;\n public userId: UserId;\n\n public async init() {\n this.container.classList.add('edit-peer-container', 'user-permissions-container');\n this.setTitle('UserRestrictions');\n\n let destroyListener: () => void;\n\n const isChannel = await this.managers.appChatsManager.isChannel(this.chatId);\n\n {\n const section = new SettingSection({\n name: 'UserRestrictionsCanDo'\n });\n\n const div = document.createElement('div');\n div.classList.add('chatlist-container');\n section.content.insertBefore(div, section.title);\n\n const list = appDialogsManager.createChatList({new: true});\n div.append(list);\n\n const {dom} = appDialogsManager.addDialogNew({\n peerId: this.userId.toPeerId(false),\n container: list,\n rippleEnabled: true,\n avatarSize: 'abitbigger'\n });\n\n dom.lastMessageSpan.append(getUserStatusString(await this.managers.appUsersManager.getUser(this.userId)));\n\n const p = new ChatPermissions({\n chatId: this.chatId,\n listenerSetter: this.listenerSetter,\n appendTo: section.content,\n participant: this.participant._ === 'channelParticipantBanned' ? this.participant : undefined\n }, this.managers);\n\n destroyListener = () => {\n const rights = p.takeOut();\n if(this.participant._ === 'channelParticipantBanned' && deepEqual(this.participant.banned_rights.pFlags, rights.pFlags)) {\n return;\n }\n\n this.managers.appChatsManager.editBanned(this.chatId, this.participant, rights);\n };\n\n this.eventListener.addEventListener('destroy', destroyListener, {once: true});\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({});\n\n if(this.participant._ === 'channelParticipantBanned') {\n const btnDeleteException = Button('btn-primary btn-transparent danger', {icon: 'delete', text: 'GroupPermission.Delete'});\n\n attachClickEvent(btnDeleteException, () => {\n const toggle = toggleDisability([btnDeleteException], true);\n this.managers.appChatsManager.clearChannelParticipantBannedRights(\n this.chatId,\n this.participant as ChannelParticipant.channelParticipantBanned\n ).then(() => {\n this.eventListener.removeEventListener('destroy', destroyListener);\n this.close();\n }, () => {\n toggle();\n });\n }, {listenerSetter: this.listenerSetter});\n\n section.content.append(btnDeleteException);\n }\n\n const btnDelete = Button('btn-primary btn-transparent danger', {icon: 'deleteuser', text: 'UserRestrictionsBlock'});\n\n attachClickEvent(btnDelete, async() => {\n const toggle = toggleDisability([btnDelete], true);\n\n try {\n const peerId = this.userId.toPeerId();\n await confirmationPopup({\n peerId: this.chatId.toPeerId(true),\n descriptionLangKey: 'Permissions.RemoveFromGroup',\n descriptionLangArgs: [await wrapPeerTitle({peerId: peerId})],\n titleLangKey: 'ChannelBlockUser',\n button: {\n langKey: 'Remove',\n isDanger: true\n }\n });\n\n if(!isChannel) {\n await this.managers.appChatsManager.kickFromChat(this.chatId, this.participant);\n } else {\n await this.managers.appChatsManager.kickFromChannel(this.chatId, this.participant as ChannelParticipant);\n }\n } catch(err) {\n toggle();\n return;\n }\n\n this.eventListener.removeEventListener('destroy', destroyListener);\n this.close();\n }, {listenerSetter: this.listenerSetter});\n\n section.content.append(btnDelete);\n\n this.scrollable.append(section.container);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {ChatRights} from '../../../lib/appManagers/appChatsManager';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport findUpTag from '../../../helpers/dom/findUpTag';\nimport replaceContent from '../../../helpers/dom/replaceContent';\nimport ListenerSetter from '../../../helpers/listenerSetter';\nimport ScrollableLoader from '../../../helpers/scrollableLoader';\nimport {ChannelParticipant, Chat, ChatBannedRights} from '../../../layer';\nimport appDialogsManager, {DialogDom, DIALOG_LIST_ELEMENT_TAG} from '../../../lib/appManagers/appDialogsManager';\nimport {AppManagers} from '../../../lib/appManagers/managers';\nimport combineParticipantBannedRights from '../../../lib/appManagers/utils/chats/combineParticipantBannedRights';\nimport hasRights from '../../../lib/appManagers/utils/chats/hasRights';\nimport getPeerActiveUsernames from '../../../lib/appManagers/utils/peers/getPeerActiveUsernames';\nimport getPeerId from '../../../lib/appManagers/utils/peers/getPeerId';\nimport {i18n, join, LangPackKey} from '../../../lib/langPack';\nimport rootScope from '../../../lib/rootScope';\nimport PopupPickUser from '../../popups/pickUser';\nimport Row from '../../row';\nimport SettingSection from '../../settingSection';\nimport {SliderSuperTabEventable} from '../../sliderTab';\nimport {toast} from '../../toast';\nimport AppUserPermissionsTab from './userPermissions';\nimport CheckboxFields, {CheckboxFieldsField} from '../../checkboxFields';\nimport PopupElement from '../../popups';\n\ntype PermissionsCheckboxFieldsField = CheckboxFieldsField & {\n flags: ChatRights[],\n exceptionText: LangPackKey\n};\n\nexport class ChatPermissions extends CheckboxFields {\n protected chat: Chat.chat | Chat.channel;\n protected rights: ChatBannedRights.chatBannedRights;\n protected defaultBannedRights: ChatBannedRights.chatBannedRights;\n protected restrictionText: LangPackKey;\n\n constructor(private options: {\n chatId: ChatId,\n listenerSetter: ListenerSetter,\n appendTo: HTMLElement,\n participant?: ChannelParticipant.channelParticipantBanned\n }, private managers: AppManagers) {\n super({\n listenerSetter: options.listenerSetter,\n fields: [],\n asRestrictions: true\n });\n\n this.construct();\n }\n\n public async construct() {\n const options = this.options;\n const chat = this.chat = await this.managers.appChatsManager.getChat(options.chatId) as Chat.chat | Chat.channel;\n const defaultBannedRights = this.defaultBannedRights = chat.default_banned_rights;\n const rights = this.rights = options.participant ? combineParticipantBannedRights(chat as Chat.channel, options.participant.banned_rights) : defaultBannedRights;\n\n const mediaNested: PermissionsCheckboxFieldsField[] = [\n {flags: ['send_photos'], text: 'UserRestrictionsSendPhotos', exceptionText: 'UserRestrictionsNoSendPhotos'},\n {flags: ['send_videos'], text: 'UserRestrictionsSendVideos', exceptionText: 'UserRestrictionsNoSendVideos'},\n {flags: ['send_stickers', 'send_gifs'], text: 'UserRestrictionsSendStickers', exceptionText: 'UserRestrictionsNoSendStickers'},\n {flags: ['send_audios'], text: 'UserRestrictionsSendMusic', exceptionText: 'UserRestrictionsNoSendMusic'},\n {flags: ['send_docs'], text: 'UserRestrictionsSendFiles', exceptionText: 'UserRestrictionsNoSendDocs'},\n {flags: ['send_voices'], text: 'UserRestrictionsSendVoices', exceptionText: 'UserRestrictionsNoSendVoice'},\n {flags: ['send_roundvideos'], text: 'UserRestrictionsSendRound', exceptionText: 'UserRestrictionsNoSendRound'},\n {flags: ['embed_links'], text: 'UserRestrictionsEmbedLinks', exceptionText: 'UserRestrictionsNoEmbedLinks'},\n {flags: ['send_polls'], text: 'UserRestrictionsSendPolls', exceptionText: 'UserRestrictionsNoSendPolls'}\n ];\n\n const mediaToggleWith = mediaNested;\n const v: PermissionsCheckboxFieldsField[] = [\n {flags: ['send_plain'], text: 'UserRestrictionsSend', exceptionText: 'UserRestrictionsNoSend'},\n {flags: ['send_media'], text: 'UserRestrictionsSendMedia', exceptionText: 'UserRestrictionsNoSendMedia', nested: mediaNested},\n {flags: ['invite_users'], text: 'UserRestrictionsInviteUsers', exceptionText: 'UserRestrictionsNoInviteUsers'},\n {flags: ['pin_messages'], text: 'UserRestrictionsPinMessages', exceptionText: 'UserRestrictionsNoPinMessages'},\n {flags: ['change_info'], text: 'UserRestrictionsChangeInfo', exceptionText: 'UserRestrictionsNoChangeInfo'}\n ];\n\n\n const map: {[action in ChatRights]?: PermissionsCheckboxFieldsField} = {};\n v.push(...mediaNested);\n v.forEach((info) => {\n const mainFlag = info.flags[0];\n map[mainFlag] = info;\n info.checked = hasRights(chat, mainFlag, rights)\n });\n\n mediaNested.forEach((info) => info.nestedTo = map.send_media);\n map.send_media.toggleWith = {unchecked: mediaToggleWith, checked: mediaToggleWith};\n map.embed_links.toggleWith = {checked: [map.send_plain]};\n map.send_plain.toggleWith = {unchecked: [map.embed_links]};\n\n this.fields = v;\n\n for(const info of this.fields) {\n if((\n this.options.participant &&\n defaultBannedRights.pFlags[info.flags[0] as keyof typeof defaultBannedRights['pFlags']]\n ) || (\n getPeerActiveUsernames(chat as Chat.channel)[0] &&\n (\n info.flags.includes('pin_messages') ||\n info.flags.includes('change_info')\n )\n )\n ) {\n info.restrictionText = this.restrictionText;\n }\n\n if(info.nestedTo) {\n continue;\n }\n\n const {nodes} = this.createField(info);\n options.appendTo.append(...nodes);\n }\n }\n\n public takeOut() {\n const rights: ChatBannedRights = {\n _: 'chatBannedRights',\n until_date: 0x7FFFFFFF,\n pFlags: {}\n };\n\n const IGNORE_FLAGS: Set = new Set([\n 'send_media'\n ]);\n for(const info of this.fields) {\n const banned = !info.checkboxField.checked;\n if(!banned) {\n continue;\n }\n\n info.flags.forEach((flag) => {\n if(IGNORE_FLAGS.has(flag)) {\n return;\n }\n\n // @ts-ignore\n rights.pFlags[flag] = true;\n });\n }\n\n return rights;\n }\n}\n\nexport default class AppGroupPermissionsTab extends SliderSuperTabEventable {\n public chatId: ChatId;\n\n public async init() {\n this.container.classList.add('edit-peer-container', 'group-permissions-container');\n this.setTitle('ChannelPermissions');\n\n let chatPermissions: ChatPermissions;\n {\n const section = new SettingSection({\n name: 'ChannelPermissionsHeader'\n });\n\n chatPermissions = new ChatPermissions({\n chatId: this.chatId,\n listenerSetter: this.listenerSetter,\n appendTo: section.content\n }, this.managers);\n\n this.eventListener.addEventListener('destroy', () => {\n this.managers.appChatsManager.editChatDefaultBannedRights(this.chatId, chatPermissions.takeOut());\n }, {once: true});\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({\n name: 'PrivacyExceptions'\n });\n\n const addExceptionRow = new Row({\n titleLangKey: 'ChannelAddException',\n subtitleLangKey: 'Loading',\n icon: 'adduser',\n clickable: () => {\n PopupElement.createPopup(PopupPickUser, {\n peerTypes: ['channelParticipants'],\n onSelect: (peerId) => {\n setTimeout(() => {\n openPermissions(peerId);\n }, 0);\n },\n placeholder: 'ExceptionModal.Search.Placeholder',\n peerId: -this.chatId\n });\n },\n listenerSetter: this.listenerSetter\n });\n\n const openPermissions = async(peerId: PeerId) => {\n let participant: AppUserPermissionsTab['participant'];\n try {\n participant = await this.managers.appProfileManager.getParticipant(this.chatId, peerId);\n } catch(err) {\n toast('User is no longer participant');\n return;\n }\n\n const tab = this.slider.createTab(AppUserPermissionsTab);\n tab.participant = participant;\n tab.chatId = this.chatId;\n tab.userId = peerId;\n tab.open();\n };\n\n section.content.append(addExceptionRow.container);\n\n /* const removedUsersRow = new Row({\n titleLangKey: 'ChannelBlockedUsers',\n subtitleLangKey: 'NoBlockedUsers',\n icon: 'deleteuser',\n clickable: true\n });\n\n section.content.append(removedUsersRow.container); */\n\n const c = section.generateContentElement();\n c.classList.add('chatlist-container');\n\n const list = appDialogsManager.createChatList({new: true});\n c.append(list);\n\n attachClickEvent(list, (e) => {\n const target = findUpTag(e.target, DIALOG_LIST_ELEMENT_TAG);\n if(!target) return;\n\n const peerId = target.dataset.peerId.toPeerId();\n openPermissions(peerId);\n }, {listenerSetter: this.listenerSetter});\n\n const setSubtitle = async(dom: DialogDom, participant: ChannelParticipant.channelParticipantBanned) => {\n const bannedRights = participant.banned_rights;// appChatsManager.combineParticipantBannedRights(this.chatId, participant.banned_rights);\n const defaultBannedRights = ((await this.managers.appChatsManager.getChat(this.chatId)) as Chat.channel).default_banned_rights;\n // const combinedRights = appChatsManager.combineParticipantBannedRights(this.chatId, bannedRights);\n\n const cantWhat: LangPackKey[] = []/* , canWhat: LangPackKey[] = [] */;\n chatPermissions.fields.forEach((info) => {\n const mainFlag = info.flags[0];\n // @ts-ignore\n if(bannedRights.pFlags[mainFlag] && !defaultBannedRights.pFlags[mainFlag]) {\n cantWhat.push(info.exceptionText);\n // @ts-ignore\n }/* else if(!combinedRights.pFlags[mainFlag]) {\n canWhat.push(info.exceptionText);\n } */\n });\n\n const el = dom.lastMessageSpan as HTMLElement;\n\n if(cantWhat.length) {\n el.replaceChildren(...join(cantWhat.map((t) => i18n(t)), false));\n }/* else if(canWhat.length) {\n str = 'Can ' + canWhat.join(canWhat.length === 2 ? ' and ' : ', ');\n } */\n\n el.classList.toggle('hide', !cantWhat.length);\n };\n\n const add = (participant: ChannelParticipant.channelParticipantBanned, append: boolean) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: getPeerId(participant.peer),\n container: list,\n rippleEnabled: true,\n avatarSize: 'abitbigger',\n append\n });\n\n (dom.listEl as any).dialogDom = dom;\n\n setSubtitle(dom, participant);\n };\n\n this.listenerSetter.add(rootScope)('chat_participant', (update) => {\n const needAdd = update.new_participant?._ === 'channelParticipantBanned' &&\n !update.new_participant.banned_rights.pFlags.view_messages;\n const li = list.querySelector(`[data-peer-id=\"${update.user_id}\"]`);\n if(needAdd) {\n if(!li) {\n add(update.new_participant as ChannelParticipant.channelParticipantBanned, false);\n } else {\n setSubtitle((li as any).dialogDom, update.new_participant as ChannelParticipant.channelParticipantBanned);\n }\n\n if(update.prev_participant?._ !== 'channelParticipantBanned') {\n ++exceptionsCount;\n }\n } else {\n li?.remove();\n\n if(update.prev_participant?._ === 'channelParticipantBanned') {\n --exceptionsCount;\n }\n }\n\n setLength();\n });\n\n const setLength = () => {\n replaceContent(addExceptionRow.subtitle, i18n(exceptionsCount ? 'Permissions.ExceptionsCount' : 'Permissions.NoExceptions', [exceptionsCount]));\n };\n\n let exceptionsCount = 0;\n let loader: ScrollableLoader;\n const setLoader = () => {\n const LOAD_COUNT = 50;\n loader = new ScrollableLoader({\n scrollable: this.scrollable,\n getPromise: () => {\n return this.managers.appProfileManager.getChannelParticipants(this.chatId, {_: 'channelParticipantsBanned', q: ''}, LOAD_COUNT, list.childElementCount).then((res) => {\n for(const participant of res.participants) {\n add(participant as ChannelParticipant.channelParticipantBanned, true);\n }\n\n exceptionsCount = res.count;\n setLength();\n\n return res.participants.length < LOAD_COUNT || res.count === list.childElementCount;\n });\n }\n });\n\n return loader.load();\n };\n\n this.scrollable.append(section.container);\n\n if(await this.managers.appChatsManager.isChannel(this.chatId)) {\n await setLoader();\n } else {\n setLength();\n\n this.listenerSetter.add(rootScope)('dialog_migrate', ({migrateFrom, migrateTo}) => {\n if(this.chatId === migrateFrom) {\n this.chatId = migrateTo;\n setLoader();\n }\n });\n }\n }\n }\n\n onOpenAfterTimeout() {\n this.scrollable.onScroll();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport copy from '../../../../helpers/object/copy';\nimport {ChatBannedRights, Chat} from '../../../../layer';\n\nexport default function combineParticipantBannedRights(chat: Chat.channel, rights: ChatBannedRights) {\n if(chat.default_banned_rights) {\n rights = copy(rights);\n const defaultRights = chat.default_banned_rights.pFlags;\n for(const i in defaultRights) {\n // @ts-ignore\n rights.pFlags[i] = defaultRights[i];\n }\n }\n\n return rights;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport replaceContent from '../../../helpers/dom/replaceContent';\nimport debounce from '../../../helpers/schedulers/debounce';\nimport {ChatReactions, Reaction} from '../../../layer';\nimport {i18n, LangPackKey} from '../../../lib/langPack';\nimport CheckboxField from '../../checkboxField';\nimport Row, {RadioFormFromValues} from '../../row';\nimport SettingSection from '../../settingSection';\nimport {SliderSuperTabEventable} from '../../sliderTab';\nimport wrapStickerToRow from '../../wrappers/stickerToRow';\n\nexport default class AppChatReactionsTab extends SliderSuperTabEventable {\n public chatId: ChatId;\n\n public async init() {\n this.setTitle('Reactions');\n\n const availableReactions = await this.managers.appReactionsManager.getActiveAvailableReactions();\n const chatFull = await this.managers.appProfileManager.getChatFull(this.chatId);\n const isBroadcast = await this.managers.appChatsManager.isBroadcast(this.chatId);\n\n let _chatReactions = chatFull.available_reactions ?? {_: 'chatReactionsNone'};\n let chatReactions = _chatReactions;\n let emoticons = new Set(_chatReactions._ === 'chatReactionsSome' ? _chatReactions.reactions.map((reaction) => (reaction as Reaction.reactionEmoji).emoticon) : []);\n\n const makeReactionFromEmoticons = (emoticons: Array): Reaction[] => emoticons.map((emoticon) => ({_: 'reactionEmoji', emoticon}));\n\n const getCaptionLangPackKey = (): LangPackKey => {\n if(isBroadcast) {\n return 'EnableReactionsChannelInfo';\n }\n\n return chatReactions._ === 'chatReactionsAll' ? 'EnableAllReactionsInfo' : (chatReactions._ === 'chatReactionsNone' ? 'DisableReactionsInfo' : 'EnableSomeReactionsInfo');\n };\n\n const toggleSection = new SettingSection({\n name: isBroadcast ? undefined : 'AvailableReactions',\n caption: getCaptionLangPackKey()\n });\n\n const reactionsSection = new SettingSection({\n name: 'OnlyAllowThisReactions'\n });\n\n const toggleCheckboxFieldsByEmoticons = () => {\n const r: Reaction.reactionEmoji[] = (chatReactions as ChatReactions.chatReactionsSome).reactions as any ?? [];\n emoticons = new Set(r.map(({emoticon}) => emoticon));\n checkboxFieldsByEmoticon.forEach((checkboxField, emoticon) => {\n checkboxField.setValueSilently(emoticons.has(emoticon));\n });\n };\n\n let toggleCheckboxField: CheckboxField;\n if(isBroadcast) {\n toggleCheckboxField = new CheckboxField({toggle: true, checked: _chatReactions._ === 'chatReactionsSome'});\n const toggleRow = new Row({\n checkboxField: toggleCheckboxField,\n titleLangKey: 'EnableReactions',\n listenerSetter: this.listenerSetter\n });\n\n toggleSection.content.append(toggleRow.container);\n\n this.listenerSetter.add(toggleCheckboxField.input)('change', () => {\n let save = true;\n if(!toggleCheckboxField.checked) {\n chatReactions = {_: 'chatReactionsNone'};\n } else if(checkboxFields.every((checkboxField) => !checkboxField.checked)) {\n chatReactions = {_: 'chatReactionsSome', reactions: makeReactionFromEmoticons(availableReactions.map(({reaction}) => reaction))};\n } else if(chatReactions._ !== 'chatReactionsSome') {\n chatReactions = {_: 'chatReactionsSome', reactions: makeReactionFromEmoticons(Array.from(emoticons))};\n } else {\n save = false;\n }\n\n if(save) {\n toggleCheckboxFieldsByEmoticons();\n saveReactionsDebounced();\n }\n });\n } else {\n const a: [ChatReactions['_'], LangPackKey][] = [\n ['chatReactionsAll', 'AllReactions'],\n ['chatReactionsSome', 'SomeReactions'],\n ['chatReactionsNone', 'NoReactions']\n ];\n\n const onChange = () => {\n reactionsSection.container.classList.toggle('hide', chatReactions._ !== 'chatReactionsSome');\n };\n\n let value = _chatReactions._;\n const form = RadioFormFromValues(a.map(([value, langPackKey]) => {\n return {\n langPackKey,\n value,\n checked: _chatReactions._ === value\n };\n }), (_value) => {\n value = _value as any;\n\n if(value === 'chatReactionsAll') {\n chatReactions = {\n _: value,\n pFlags: {\n allow_custom: true\n }\n };\n } else if(value === 'chatReactionsNone') {\n chatReactions = {\n _: value\n };\n } else {\n chatReactions = {\n _: value,\n reactions: makeReactionFromEmoticons(['👍', '👎'])\n };\n }\n\n replaceContent(toggleSection.caption, i18n(getCaptionLangPackKey()));\n toggleCheckboxFieldsByEmoticons();\n saveReactionsDebounced();\n onChange();\n });\n\n toggleSection.content.append(form);\n onChange();\n }\n\n const checkboxFieldsByEmoticon: Map = new Map();\n const checkboxFields = availableReactions.map((availableReaction) => {\n const emoticon = availableReaction.reaction;\n const checkboxField = new CheckboxField({\n toggle: true,\n checked: emoticons.has(emoticon)\n });\n\n checkboxFieldsByEmoticon.set(emoticon, checkboxField);\n\n this.listenerSetter.add(checkboxField.input)('change', () => {\n if(checkboxField.checked) {\n emoticons.add(emoticon);\n\n if(toggleCheckboxField && !toggleCheckboxField.checked) {\n toggleCheckboxField.checked = true;\n }\n } else {\n emoticons.delete(emoticon);\n\n if(toggleCheckboxField?.checked && !emoticons.size) {\n toggleCheckboxField.checked = false;\n }\n }\n\n saveReactionsDebounced();\n });\n\n const row = new Row({\n checkboxField,\n title: availableReaction.title,\n havePadding: true,\n listenerSetter: this.listenerSetter\n });\n\n wrapStickerToRow({\n row,\n doc: availableReaction.static_icon,\n size: 'small'\n });\n\n reactionsSection.content.append(row.container);\n\n return checkboxField;\n });\n\n const saveReactions = async() => {\n saveReactionsDebounced.clearTimeout();\n // const newReactions = Array.from(enabledReactions);\n // if([...newReactions].sort().join() === [...originalReactions].sort().join()) {\n // return;\n // }\n\n if(chatReactions._ === 'chatReactionsSome') {\n chatReactions.reactions = makeReactionFromEmoticons(Array.from(emoticons));\n }\n\n // const r = (chatReactions as ChatReactions.chatReactionsSome).reactions;\n // if(r?.length === availableReactions.length) {\n // chatReactions = {_: 'chatReactionsAll'};\n // }\n\n this.managers.appChatsManager.setChatAvailableReactions(this.chatId, chatReactions);\n _chatReactions = chatReactions;\n };\n\n const saveReactionsDebounced = debounce(saveReactions, 3000, false, true);\n\n this.eventListener.addEventListener('destroy', () => {\n if(saveReactionsDebounced.isDebounced()) {\n saveReactions();\n }\n }, {once: true});\n\n this.scrollable.append(toggleSection.container, reactionsSection.container);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider'\nimport InputField from '../../inputField';\nimport EditPeer from '../../editPeer';\nimport Row, {CreateRowFromCheckboxField} from '../../row';\nimport Button from '../../button';\nimport {ChatRights} from '../../../lib/appManagers/appChatsManager';\nimport {Chat, ChatFull} from '../../../layer';\nimport AppChatTypeTab from './chatType';\nimport rootScope from '../../../lib/rootScope';\nimport AppGroupPermissionsTab from './groupPermissions';\nimport {i18n, LangPackKey} from '../../../lib/langPack';\nimport PopupDeleteDialog from '../../popups/deleteDialog';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport CheckboxField from '../../checkboxField';\nimport AppChatReactionsTab from './chatReactions';\nimport hasRights from '../../../lib/appManagers/utils/chats/hasRights';\nimport replaceContent from '../../../helpers/dom/replaceContent';\nimport SettingSection from '../../settingSection';\nimport getPeerActiveUsernames from '../../../lib/appManagers/utils/peers/getPeerActiveUsernames';\nimport PopupElement from '../../popups';\n\nexport default class AppEditChatTab extends SliderSuperTab {\n private chatNameInputField: InputField;\n private descriptionInputField: InputField;\n private editPeer: EditPeer;\n public chatId: ChatId;\n\n protected async _init() {\n // * cleanup prev\n this.listenerSetter.removeAll();\n this.scrollable.container.replaceChildren();\n\n this.container.classList.add('edit-peer-container', 'edit-group-container');\n this.setTitle('Edit');\n\n let [\n chatFull,\n chat,\n isBroadcast,\n isChannel,\n canChangeType,\n canChangePermissions,\n canManageTopics,\n appConfig\n ] = await Promise.all([\n this.managers.appProfileManager.getChatFull(this.chatId, true),\n this.managers.appChatsManager.getChat(this.chatId) as Promise,\n this.managers.appChatsManager.isBroadcast(this.chatId),\n this.managers.appChatsManager.isChannel(this.chatId),\n this.managers.appChatsManager.hasRights(this.chatId, 'change_type'),\n this.managers.appChatsManager.hasRights(this.chatId, 'change_permissions'),\n this.managers.appChatsManager.hasRights(this.chatId, 'manage_topics'),\n this.managers.apiManager.getAppConfig()\n ]);\n\n const chatUpdateListeners: {[type in 'full' | 'basic']: (() => void)[]} = {full: [], basic: []};\n const addChatUpdateListener = (callback: () => void, type: 'full' | 'basic' = 'basic') => {\n chatUpdateListeners[type].push(callback);\n };\n\n this.listenerSetter.add(rootScope)('chat_update', async(chatId) => {\n if(this.chatId === chatId) {\n chat = await this.managers.appChatsManager.getChat(this.chatId) as typeof chat;\n chatUpdateListeners['basic'].forEach((callback) => callback());\n }\n });\n\n this.listenerSetter.add(rootScope)('chat_full_update', async(chatId) => {\n if(this.chatId === chatId) {\n chatFull = await this.managers.appProfileManager.getCachedFullChat(chatId) || chatFull;\n chatUpdateListeners['full'].forEach((callback) => callback());\n }\n });\n\n const peerId = this.chatId.toPeerId(true);\n\n {\n const section = new SettingSection({noDelimiter: true, caption: true});\n const inputFields: InputField[] = [];\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n this.chatNameInputField = new InputField({\n label: isBroadcast ? 'EnterChannelName' : 'CreateGroup.NameHolder',\n name: 'chat-name',\n maxLength: 255,\n required: true\n });\n this.descriptionInputField = new InputField({\n label: 'DescriptionPlaceholder',\n name: 'chat-description',\n maxLength: 255\n });\n\n this.chatNameInputField.setOriginalValue(chat.title);\n this.descriptionInputField.setOriginalValue(chatFull.about);\n\n inputWrapper.append(this.chatNameInputField.container, this.descriptionInputField.container);\n\n inputFields.push(this.chatNameInputField, this.descriptionInputField);\n\n this.editPeer = new EditPeer({\n peerId,\n inputFields,\n listenerSetter: this.listenerSetter,\n popupOptions: {isForum: (chat as Chat.channel).pFlags.forum}\n });\n this.content.append(this.editPeer.nextBtn);\n\n section.content.append(this.editPeer.avatarEdit.container, inputWrapper);\n\n if(canChangeType) {\n const chatTypeRow = new Row({\n titleLangKey: isBroadcast ? 'ChannelType' : 'GroupType',\n clickable: () => {\n const tab = this.slider.createTab(AppChatTypeTab);\n tab.chatId = this.chatId;\n tab.chatFull = chatFull;\n tab.open();\n },\n icon: 'lock',\n listenerSetter: this.listenerSetter\n });\n\n const setChatTypeSubtitle = () => {\n let key: LangPackKey;\n const username = getPeerActiveUsernames(chat as Chat.channel)[0];\n if(isBroadcast) {\n key = username ? 'TypePublic' : 'TypePrivate';\n } else {\n key = username ? 'TypePublicGroup' : 'TypePrivateGroup';\n }\n\n chatTypeRow.subtitle.replaceChildren(i18n(key));\n };\n\n setChatTypeSubtitle();\n addChatUpdateListener(setChatTypeSubtitle);\n section.content.append(chatTypeRow.container);\n }\n\n if(canChangeType || canChangePermissions) {\n const reactionsRow = new Row({\n titleLangKey: 'Reactions',\n icon: 'reactions',\n clickable: () => {\n const tab = this.slider.createTab(AppChatReactionsTab);\n tab.chatId = this.chatId;\n tab.open();\n },\n listenerSetter: this.listenerSetter\n });\n\n const availableReactions = await this.managers.appReactionsManager.getAvailableReactions();\n const availableReactionsLength = availableReactions.filter((availableReaction) => !availableReaction.pFlags.inactive).length;\n const setReactionsLength = () => {\n const chatAvailableReactions = chatFull.available_reactions ?? {_: 'chatReactionsNone'};\n if(chatAvailableReactions._ === 'chatReactionsSome') {\n const length = chatAvailableReactions.reactions.length;\n if(length === availableReactionsLength) {\n replaceContent(reactionsRow.subtitle, i18n('ReactionsAll'));\n } else {\n reactionsRow.subtitle.textContent = length + '/' + availableReactionsLength;\n }\n } else {\n replaceContent(reactionsRow.subtitle, i18n(chatAvailableReactions._ === 'chatReactionsAll' ? 'ReactionsAll' : 'Checkbox.Disabled'));\n }\n };\n\n setReactionsLength();\n addChatUpdateListener(setReactionsLength, 'full');\n section.content.append(reactionsRow.container);\n }\n\n if(canChangePermissions && !isBroadcast) {\n const flags = [\n 'send_stickers',\n 'send_polls',\n 'send_photos',\n 'send_videos',\n 'send_roundvideos',\n 'send_audios',\n 'send_voices',\n 'send_docs',\n 'send_plain',\n 'embed_links',\n 'invite_users',\n 'pin_messages',\n 'change_info'\n ] as ChatRights[];\n\n const permissionsRow = new Row({\n titleLangKey: 'ChannelPermissions',\n clickable: () => {\n const tab = this.slider.createTab(AppGroupPermissionsTab);\n tab.chatId = this.chatId;\n tab.open();\n },\n icon: 'permissions',\n listenerSetter: this.listenerSetter\n });\n\n const setPermissionsLength = () => {\n permissionsRow.subtitle.textContent = flags.reduce((acc, f) => acc + +hasRights(chat, f, (chat as Chat.chat).default_banned_rights), 0) + '/' + flags.length;\n };\n\n setPermissionsLength();\n addChatUpdateListener(setPermissionsLength);\n section.content.append(permissionsRow.container);\n }\n\n if(canManageTopics && (chat.participants_count >= appConfig.forum_upgrade_participants_min || (chat as Chat.channel).pFlags.forum) && !isBroadcast) {\n const topicsRow = new Row({\n checkboxField: new CheckboxField({toggle: true}),\n titleLangKey: 'Topics',\n clickable: () => {},\n icon: 'topics',\n listenerSetter: this.listenerSetter\n });\n\n const setTopics = () => {\n const isForum = !!(chat as Chat.channel).pFlags.forum;\n this.editPeer.avatarElem.parentElement.classList.toggle('is-forum', isForum);\n topicsRow.checkboxField.setValueSilently(isForum);\n };\n\n this.listenerSetter.add(topicsRow.checkboxField.input)('change', (e) => {\n if(!e.isTrusted) {\n return;\n }\n\n const promise = this.managers.appChatsManager.toggleForum(this.chatId, topicsRow.checkboxField.checked);\n topicsRow.disableWithPromise(promise);\n });\n\n setTopics();\n addChatUpdateListener(setTopics);\n\n section.caption.replaceChildren(i18n('ForumToggleDescription'));\n section.content.append(topicsRow.container);\n }\n\n section.caption.classList.toggle('hide', !section.caption.childElementCount);\n\n /* const administratorsRow = new Row({\n titleLangKey: 'PeerInfo.Administrators',\n subtitle: '' + ((chatFull as ChatFull.channelFull).admins_count || 1),\n icon: 'admin',\n clickable: true\n });\n\n section.content.append(administratorsRow.container); */\n\n this.scrollable.append(section.container);\n\n attachClickEvent(this.editPeer.nextBtn, () => {\n this.editPeer.nextBtn.disabled = true;\n\n const promises: Promise[] = [];\n\n const id = this.chatId;\n if(this.chatNameInputField.isValidToChange()) {\n promises.push(this.managers.appChatsManager.editTitle(id, this.chatNameInputField.value));\n }\n\n if(this.descriptionInputField.isValidToChange()) {\n promises.push(this.managers.appChatsManager.editAbout(id, this.descriptionInputField.value));\n }\n\n if(this.editPeer.uploadAvatar) {\n promises.push(this.editPeer.uploadAvatar().then((inputFile) => {\n return this.managers.appChatsManager.editPhoto(id, inputFile);\n }));\n }\n\n Promise.race(promises).finally(() => {\n this.editPeer.nextBtn.removeAttribute('disabled');\n this.close();\n });\n }, {listenerSetter: this.listenerSetter});\n\n\n /* if(appChatsManager.hasRights(-this.peerId, 'change_info')) {\n const discussionRow = new Row({\n titleLangKey: 'PeerInfo.Discussion',\n subtitleLangKey: 'PeerInfo.Discussion.Add',\n clickable: true,\n icon: 'message'\n });\n\n section.content.append(discussionRow.container);\n }\n\n const administratorsRow = new Row({\n titleLangKey: 'PeerInfo.Administrators',\n subtitle: '' + chatFull.admins_count,\n icon: 'admin',\n clickable: true\n });\n\n section.content.append(administratorsRow.container); */\n\n if(isBroadcast && await this.managers.appChatsManager.hasRights(this.chatId, 'change_info')) {\n const signMessagesCheckboxField = new CheckboxField({\n text: 'ChannelSignMessages',\n checked: !!(chat as Chat.channel).pFlags.signatures\n });\n\n this.listenerSetter.add(signMessagesCheckboxField.input)('change', () => {\n const toggle = signMessagesCheckboxField.toggleDisability(true);\n this.managers.appChatsManager.toggleSignatures(this.chatId, signMessagesCheckboxField.checked).then(() => {\n toggle();\n });\n });\n\n addChatUpdateListener(() => {\n signMessagesCheckboxField.setValueSilently(!!(chat as Chat.channel).pFlags.signatures);\n });\n\n section.content.append(CreateRowFromCheckboxField(signMessagesCheckboxField).container);\n }\n }\n\n if(!isBroadcast) {\n const section = new SettingSection({\n\n });\n\n /* const membersRow = new Row({\n titleLangKey: isBroadcast ? 'PeerInfo.Subscribers' : 'GroupMembers',\n icon: 'newgroup',\n clickable: true\n });\n\n membersRow.subtitle.append(i18n('Subscribers', [numberThousandSplitter(335356)]));\n\n section.content.append(membersRow.container); */\n\n if(!isBroadcast && canChangeType) {\n const showChatHistoryCheckboxField = new CheckboxField({\n text: 'ChatHistory'\n });\n\n this.listenerSetter.add(showChatHistoryCheckboxField.input)('change', () => {\n const toggle = showChatHistoryCheckboxField.toggleDisability(true);\n this.managers.appChatsManager.togglePreHistoryHidden(this.chatId, !showChatHistoryCheckboxField.checked).then(() => {\n toggle();\n });\n });\n\n // ! it won't be updated because chatFull will be old\n const onChatUpdate = () => {\n showChatHistoryCheckboxField.setValueSilently(isChannel && !(chatFull as ChatFull.channelFull).pFlags.hidden_prehistory);\n };\n\n onChatUpdate();\n addChatUpdateListener(onChatUpdate);\n\n section.content.append(CreateRowFromCheckboxField(showChatHistoryCheckboxField).container);\n }\n\n if(section.content.childElementCount) {\n this.scrollable.append(section.container);\n }\n }\n\n if(await this.managers.appChatsManager.hasRights(this.chatId, 'delete_chat')) {\n const section = new SettingSection({});\n\n const btnDelete = Button('btn-primary btn-transparent danger', {icon: 'delete', text: isBroadcast ? 'PeerInfo.DeleteChannel' : 'DeleteAndExitButton'});\n\n attachClickEvent(btnDelete, () => {\n PopupElement.createPopup(PopupDeleteDialog, peerId/* , 'delete' */, undefined, (promise) => {\n const toggle = toggleDisability([btnDelete], true);\n promise.then(() => {\n this.close();\n }, () => {\n toggle();\n });\n });\n }, {listenerSetter: this.listenerSetter});\n\n section.content.append(btnDelete);\n\n this.scrollable.append(section.container);\n }\n\n if(!isChannel) {\n // ! this one will fire earlier than tab's closeAfterTimeout (destroy) event and listeners will be erased, so destroy won't fire\n this.listenerSetter.add(rootScope)('dialog_migrate', ({migrateFrom, migrateTo}) => {\n if(peerId === migrateFrom) {\n this.chatId = migrateTo.toChatId();\n this._init();\n }\n });\n }\n }\n\n public init() {\n return this._init();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../../../lib/rootScope';\nimport AppSearchSuper, {SearchSuperType} from '../../appSearchSuper.';\nimport SidebarSlider, {SliderSuperTab} from '../../slider';\nimport TransitionSlider from '../../transition';\nimport AppEditChatTab from './editChat';\nimport PeerTitle from '../../peerTitle';\nimport AppEditContactTab from './editContact';\nimport Button from '../../button';\nimport ButtonIcon from '../../buttonIcon';\nimport I18n, {i18n, LangPackKey} from '../../../lib/langPack';\nimport {toastNew} from '../../toast';\nimport AppAddMembersTab from '../../sidebarLeft/tabs/addMembers';\nimport PopupPickUser from '../../popups/pickUser';\nimport PopupPeer, {PopupPeerButtonCallbackCheckboxes, PopupPeerCheckboxOptions} from '../../popups/peer';\nimport ButtonCorner from '../../buttonCorner';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport PeerProfile from '../../peerProfile';\nimport {Message} from '../../../layer';\nimport getMessageThreadId from '../../../lib/appManagers/utils/messages/getMessageThreadId';\nimport AppEditTopicTab from './editTopic';\nimport liteMode from '../../../helpers/liteMode';\nimport PopupElement from '../../popups';\n\ntype SharedMediaHistoryStorage = Partial<{\n [type in SearchSuperType]: {mid: number, peerId: PeerId}[]\n}>;\n\nconst historiesStorage: {\n [peerId: PeerId]: {\n [threadId: number]: SharedMediaHistoryStorage\n }\n} = {};\n\n// TODO: отредактированное сообщение не изменится\nexport default class AppSharedMediaTab extends SliderSuperTab {\n private editBtn: HTMLElement;\n\n private peerId: PeerId;\n private threadId: number;\n\n private searchSuper: AppSearchSuper;\n\n private profile: PeerProfile;\n private peerChanged: boolean;\n\n private titleI18n: I18n.IntlElement;\n\n public isFirst: boolean;\n\n public init() {\n // const perf = performance.now();\n\n this.container.classList.add('shared-media-container', 'profile-container');\n\n // * header\n const newCloseBtn = Button('btn-icon sidebar-close-button', {noRipple: true});\n this.closeBtn.replaceWith(newCloseBtn);\n this.closeBtn = newCloseBtn;\n\n const animatedCloseIcon = document.createElement('div');\n animatedCloseIcon.classList.add('animated-close-icon');\n newCloseBtn.append(animatedCloseIcon);\n\n if(this.isFirst) {\n animatedCloseIcon.classList.add('state-back');\n }\n\n const transitionContainer = document.createElement('div');\n transitionContainer.className = 'transition slide-fade';\n\n const transitionFirstItem = document.createElement('div');\n transitionFirstItem.classList.add('transition-item');\n\n this.titleI18n = new I18n.IntlElement();\n this.title.append(this.titleI18n.element);\n this.editBtn = ButtonIcon('edit');\n // const moreBtn = ButtonIcon('more');\n\n transitionFirstItem.append(this.title, this.editBtn/* , moreBtn */);\n\n const transitionLastItem = document.createElement('div');\n transitionLastItem.classList.add('transition-item');\n\n const secondTitle: HTMLElement = this.title.cloneNode() as any;\n secondTitle.append(i18n('PeerInfo.SharedMedia'));\n\n transitionLastItem.append(secondTitle);\n\n transitionContainer.append(transitionFirstItem, transitionLastItem);\n\n this.header.append(transitionContainer);\n\n // * body\n\n this.profile = new PeerProfile(this.managers, this.scrollable, this.listenerSetter);\n this.profile.init();\n\n this.scrollable.append(this.profile.element);\n\n const HEADER_HEIGHT = 56;\n this.scrollable.onAdditionalScroll = () => {\n const rect = this.searchSuper.nav.getBoundingClientRect();\n if(!rect.width) return;\n\n const top = rect.top - 1;\n setIsSharedMedia(top <= HEADER_HEIGHT);\n };\n\n const setIsSharedMedia = (isSharedMedia: boolean) => {\n animatedCloseIcon.classList.toggle('state-back', this.isFirst || isSharedMedia);\n this.searchSuper.container.classList.toggle('is-full-viewport', isSharedMedia);\n transition(+isSharedMedia);\n\n if(!isSharedMedia) {\n this.searchSuper.cleanScrollPositions();\n }\n };\n\n const transition = TransitionSlider({\n content: transitionContainer,\n type: 'slide-fade',\n transitionTime: 400,\n isHeavy: false\n });\n\n transition(0);\n\n attachClickEvent(this.closeBtn, (e) => {\n if(transition.prevId()) {\n this.scrollable.scrollIntoViewNew({\n element: this.scrollable.container.firstElementChild as HTMLElement,\n position: 'start'\n });\n transition(0);\n\n if(!this.isFirst) {\n animatedCloseIcon.classList.remove('state-back');\n }\n } else if(!this.scrollable.isHeavyAnimationInProgress) {\n this.slider.onCloseBtnClick();\n }\n }, {listenerSetter: this.listenerSetter});\n\n attachClickEvent(this.editBtn, async() => {\n let tab: AppEditChatTab | AppEditContactTab | AppEditTopicTab;\n const {peerId, threadId} = this;\n if(threadId && await this.managers.appPeersManager.isForum(peerId)) {\n tab = this.slider.createTab(AppEditTopicTab)\n } else if(peerId.isAnyChat()) {\n tab = this.slider.createTab(AppEditChatTab);\n } else {\n tab = this.slider.createTab(AppEditContactTab);\n }\n\n if(tab) {\n if(tab instanceof AppEditTopicTab) {\n tab.open(peerId, this.threadId);\n } else {\n if(tab instanceof AppEditChatTab) {\n tab.chatId = peerId.toChatId();\n } else {\n tab.peerId = peerId;\n }\n\n tab.open();\n }\n }\n }, {listenerSetter: this.listenerSetter});\n\n this.listenerSetter.add(rootScope)('contacts_update', (userId) => {\n if(this.peerId === userId) {\n this.toggleEditBtn();\n }\n });\n\n this.listenerSetter.add(rootScope)('chat_update', (chatId) => {\n if(this.peerId === chatId.toPeerId(true)) {\n this.toggleEditBtn();\n }\n });\n\n this.listenerSetter.add(rootScope)('history_multiappend', (message) => {\n this.renderNewMessage(message);\n });\n\n this.listenerSetter.add(rootScope)('history_delete', ({peerId, msgs}) => {\n this.deleteDeletedMessages(peerId, Array.from(msgs));\n });\n\n // Calls when message successfully sent and we have an id\n this.listenerSetter.add(rootScope)('message_sent', ({message}) => {\n this.renderNewMessage(message);\n });\n\n // this.container.prepend(this.closeBtn.parentElement);\n\n this.searchSuper = new AppSearchSuper({\n mediaTabs: [{\n inputFilter: 'inputMessagesFilterEmpty',\n name: 'PeerMedia.Members',\n type: 'members'\n }, {\n inputFilter: 'inputMessagesFilterPhotoVideo',\n name: 'SharedMediaTab2',\n type: 'media'\n }, {\n inputFilter: 'inputMessagesFilterDocument',\n name: 'SharedFilesTab2',\n type: 'files'\n }, {\n inputFilter: 'inputMessagesFilterUrl',\n name: 'SharedLinksTab2',\n type: 'links'\n }, {\n inputFilter: 'inputMessagesFilterMusic',\n name: 'SharedMusicTab2',\n type: 'music'\n }, {\n inputFilter: 'inputMessagesFilterRoundVoice',\n name: 'SharedVoiceTab2',\n type: 'voice'\n }, {\n inputFilter: 'inputMessagesFilterEmpty',\n name: 'ChatList.Filter.Groups',\n type: 'groups'\n }],\n scrollable: this.scrollable,\n onChangeTab: (mediaTab) => {\n const timeout = mediaTab.type === 'members' && liteMode.isAvailable('animations') ? 250 : 0;\n setTimeout(() => {\n btnAddMembers.classList.toggle('is-hidden', mediaTab.type !== 'members');\n }, timeout);\n },\n managers: this.managers\n });\n\n this.searchSuper.scrollStartCallback = () => {\n setIsSharedMedia(true);\n };\n\n this.profile.element.append(this.searchSuper.container);\n\n const btnAddMembers = ButtonCorner({icon: 'addmember_filled'});\n this.content.append(btnAddMembers);\n\n attachClickEvent(btnAddMembers, async() => {\n const peerId = this.peerId;\n const id = this.peerId.toChatId();\n const isChannel = await this.managers.appChatsManager.isChannel(id);\n\n const showConfirmation = (peerIds: PeerId[], callback: (checked: PopupPeerButtonCallbackCheckboxes) => void) => {\n let titleLangKey: LangPackKey, titleLangArgs: any[],\n descriptionLangKey: LangPackKey, descriptionLangArgs: any[],\n checkboxes: PopupPeerCheckboxOptions[];\n\n if(peerIds.length > 1) {\n titleLangKey = 'AddMembersAlertTitle';\n titleLangArgs = [i18n('Members', [peerIds.length])];\n descriptionLangKey = 'AddMembersAlertCountText';\n descriptionLangArgs = peerIds.map((peerId) => {\n const b = document.createElement('b');\n b.append(new PeerTitle({peerId}).element);\n return b;\n });\n\n if(!isChannel) {\n checkboxes = [{\n text: 'AddMembersForwardMessages',\n checked: true\n }];\n }\n } else {\n titleLangKey = 'AddOneMemberAlertTitle';\n descriptionLangKey = 'AddMembersAlertNamesText';\n const b = document.createElement('b');\n b.append(new PeerTitle({\n peerId: peerIds[0]\n }).element);\n descriptionLangArgs = [b];\n\n if(!isChannel) {\n checkboxes = [{\n text: 'AddOneMemberForwardMessages',\n textArgs: [new PeerTitle({peerId: peerIds[0]}).element],\n checked: true\n }];\n }\n }\n\n descriptionLangArgs.push(new PeerTitle({\n peerId\n }).element);\n\n PopupElement.createPopup(PopupPeer, 'popup-add-members', {\n peerId,\n titleLangKey,\n descriptionLangKey,\n descriptionLangArgs,\n buttons: [{\n langKey: 'Add',\n callback\n }],\n checkboxes\n }).show();\n };\n\n const onError = (err: any) => {\n if(err.type === 'USER_PRIVACY_RESTRICTED') {\n toastNew({langPackKey: 'InviteToGroupError'});\n }\n };\n\n if(isChannel) {\n const tab = this.slider.createTab(AppAddMembersTab);\n tab.open({\n type: 'channel',\n skippable: false,\n takeOut: (peerIds) => {\n showConfirmation(peerIds, () => {\n const promise = this.managers.appChatsManager.inviteToChannel(id, peerIds);\n promise.catch(onError);\n tab.attachToPromise(promise);\n });\n\n return false;\n },\n title: 'GroupAddMembers',\n placeholder: 'SendMessageTo'\n });\n } else {\n PopupElement.createPopup(PopupPickUser, {\n peerTypes: ['contacts'],\n placeholder: 'Search',\n onSelect: (peerId) => {\n setTimeout(() => {\n showConfirmation([peerId], (checked) => {\n this.managers.appChatsManager.addChatUser(id, peerId, checked.size ? undefined : 0)\n .catch(onError);\n });\n }, 0);\n }\n });\n }\n }, {listenerSetter: this.listenerSetter});\n\n // console.log('construct shared media time:', performance.now() - perf);\n }\n\n private _renderNewMessage(message: Message.message | Message.messageService, threadId?: number) {\n const historyStorage = historiesStorage[message.peerId]?.[threadId];\n if(!historyStorage) return;\n\n for(const mediaTab of this.searchSuper.mediaTabs) {\n const inputFilter = mediaTab.inputFilter;\n const history = historyStorage[inputFilter];\n if(!history) {\n continue;\n }\n\n const filtered = this.searchSuper.filterMessagesByType([message], inputFilter)\n .filter((message) => !history.find((m) => m.mid === message.mid && m.peerId === message.peerId));\n if(filtered.length) {\n history.unshift(...filtered.map((message) => ({mid: message.mid, peerId: message.peerId})));\n\n if(this.peerId === message.peerId && this.searchSuper.usedFromHistory[inputFilter] !== -1) {\n this.searchSuper.usedFromHistory[inputFilter] += filtered.length;\n this.searchSuper.performSearchResult(filtered, mediaTab, false);\n }\n }\n }\n }\n\n private async renderNewMessage(message: Message.message | Message.messageService) {\n if(this.init) return; // * not inited yet\n\n const {peerId} = message;\n const isForum = await this.managers.appPeersManager.isForum(peerId);\n const threadId = getMessageThreadId(message, isForum);\n\n this._renderNewMessage(message);\n if(threadId) {\n this._renderNewMessage(message, threadId);\n }\n }\n\n public _deleteDeletedMessages(historyStorage: SharedMediaHistoryStorage, peerId: PeerId, mids: number[]) {\n for(const mid of mids) {\n for(const type of this.searchSuper.mediaTabs) {\n const inputFilter = type.inputFilter;\n\n const history = historyStorage[inputFilter];\n if(!history) continue;\n\n const idx = history.findIndex((m) => m.mid === mid);\n if(idx === -1) {\n continue;\n }\n\n history.splice(idx, 1);\n\n if(this.peerId === peerId) {\n const container = this.searchSuper.tabs[inputFilter];\n const div = container.querySelector(`[data-mid=\"${mid}\"][data-peer-id=\"${peerId}\"]`) as HTMLElement;\n if(div) {\n if(this.searchSuper.selection.isSelecting) {\n this.searchSuper.selection.toggleByElement(div);\n }\n\n div.remove();\n }\n\n if(this.searchSuper.usedFromHistory[inputFilter] >= (idx + 1)) {\n --this.searchSuper.usedFromHistory[inputFilter];\n }\n }\n\n // can have element in different tabs somehow\n // break;\n }\n }\n }\n\n public deleteDeletedMessages(peerId: PeerId, mids: number[]) {\n if(this.init) return; // * not inited yet\n\n const h = historiesStorage[peerId];\n if(!h) return;\n\n for(const threadId in h) {\n this._deleteDeletedMessages(h[threadId], peerId, mids);\n }\n\n this.scrollable.onScroll();\n }\n\n private async cleanupHTML() {\n // const perf = performance.now();\n const isAnyChat = this.peerId.isAnyChat();\n const [canViewMembers, hasRights] = await Promise.all([\n isAnyChat ? this.searchSuper.canViewMembers() : false,\n isAnyChat ? this.managers.appChatsManager.hasRights(this.peerId.toChatId(), 'invite_users') : false\n ]);\n\n return () => {\n this.profile.cleanupHTML();\n this.editBtn.classList.add('hide');\n this.searchSuper.cleanupHTML(true);\n this.container.classList.toggle('can-add-members', canViewMembers && hasRights);\n };\n // console.log('cleanupHTML shared media time:', performance.now() - perf);\n }\n\n public setLoadMutex(promise: Promise) {\n this.searchSuper.loadMutex = promise;\n }\n\n public setPeer(peerId: PeerId, threadId?: number) {\n if(this.peerId === peerId && this.threadId === threadId) return false;\n\n this.peerId = peerId;\n this.threadId = threadId;\n this.peerChanged = true;\n\n if(this.init) {\n this.init();\n this.init = null;\n }\n\n this.searchSuper.setQuery({\n peerId,\n threadId,\n historyStorage: (historiesStorage[peerId] ??= {})[threadId] ??= {}\n });\n\n this.profile.setPeer(peerId, threadId);\n\n return true;\n }\n\n private async changeTitleKey() {\n const isForum = this.managers.appPeersManager.isForum(this.peerId);\n\n return () => {\n this.titleI18n.compareAndUpdate({key: this.threadId && isForum ? 'AccDescrTopic' : 'Profile'});\n };\n }\n\n public async fillProfileElements() {\n if(!this.peerChanged) {\n return;\n }\n\n this.peerChanged = false;\n const callbacks = await Promise.all([\n this.cleanupHTML(),\n this.toggleEditBtn(true),\n this.profile.fillProfileElements(),\n this.changeTitleKey()\n ]);\n\n return () => {\n callbacks.forEach((callback) => {\n callback?.();\n });\n };\n }\n\n private async toggleEditBtn(manual?: T): Promise void : void> {\n let show: boolean;\n if(this.peerId.isUser()) {\n show = this.peerId !== rootScope.myId && await this.managers.appUsersManager.isContact(this.peerId.toUserId());\n } else {\n const chatId = this.peerId.toChatId();\n const isTopic = this.threadId && await this.managers.appChatsManager.isForum(chatId);\n show = await this.managers.appChatsManager.hasRights(chatId, isTopic ? 'manage_topics' : 'change_info');\n }\n\n const callback = () => {\n this.editBtn.classList.toggle('hide', !show);\n };\n\n return manual ? callback : callback() as any;\n }\n\n public loadSidebarMedia(single: boolean, justLoad?: boolean) {\n this.searchSuper.load(single, justLoad);\n }\n\n onOpenAfterTimeout() {\n super.onOpenAfterTimeout();\n\n this.scrollable.onScroll();\n }\n\n onCloseAfterTimeout() {\n super.onCloseAfterTimeout();\n\n if(this.destroyable) {\n this.profile.destroy();\n this.searchSuper.destroy();\n }\n }\n\n public destroy() {\n this.destroyable = true;\n this.onCloseAfterTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport liteMode from '../helpers/liteMode';\nimport rootScope from '../lib/rootScope';\n\ntype SetTransitionOptions = {\n element: HTMLElement,\n className: string,\n forwards: boolean,\n duration: number,\n onTransitionEnd?: () => void,\n useRafs?: number,\n onTransitionStart?: () => void\n};\nconst SetTransition = (options: SetTransitionOptions) => {\n const {element, className, forwards, duration, onTransitionEnd, onTransitionStart, useRafs} = options;\n const {timeout, raf} = element.dataset;\n if(timeout !== undefined) {\n clearTimeout(+timeout);\n }\n\n // useRafs = undefined;\n // duration = 0;\n\n if(raf !== undefined) {\n window.cancelAnimationFrame(+raf);\n if(!useRafs) {\n delete element.dataset.raf;\n }\n }\n\n // if(forwards && className && element.classList.contains(className) && !element.classList.contains('animating')) {\n // return;\n // }\n\n if(useRafs && liteMode.isAvailable('animations') && duration) {\n element.dataset.raf = '' + window.requestAnimationFrame(() => {\n delete element.dataset.raf;\n SetTransition({\n ...options,\n useRafs: useRafs - 1\n });\n });\n\n return;\n }\n\n if(forwards && className) {\n element.classList.add(className);\n }\n\n const afterTimeout = () => {\n delete element.dataset.timeout;\n if(!forwards && className) {\n element.classList.remove('backwards', className);\n }\n\n element.classList.remove('animating');\n\n onTransitionEnd?.();\n };\n\n onTransitionStart?.();\n if(!liteMode.isAvailable('animations') || !duration) {\n element.classList.remove('animating', 'backwards');\n afterTimeout();\n return;\n }\n\n element.classList.add('animating');\n\n element.classList.toggle('backwards', !forwards);\n element.dataset.timeout = '' + setTimeout(afterTimeout, duration);\n};\n\nexport default SetTransition;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {horizontalMenu} from './horizontalMenu';\nimport TransitionSlider from './transition';\nimport appNavigationController, {NavigationItem} from './appNavigationController';\nimport SliderSuperTab, {SliderSuperTabConstructable} from './sliderTab';\nimport indexOfAndSplice from '../helpers/array/indexOfAndSplice';\nimport safeAssign from '../helpers/object/safeAssign';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport {getMiddleware, MiddlewareHelper} from '../helpers/middleware';\nimport {MaybePromise} from '../types';\n\nconst TRANSITION_TIME = 250;\n\nexport {SliderSuperTab};\n\nexport default class SidebarSlider {\n protected _selectTab: ReturnType;\n protected historyTabIds: (number | SliderSuperTab)[] = []; // * key is any, since right sidebar is ugly nowz\n protected tabsContainer: HTMLElement;\n public sidebarEl: HTMLElement;\n protected tabs: Map; // * key is any, since right sidebar is ugly now\n private canHideFirst = false;\n private navigationType: NavigationItem['type'];\n protected managers: AppManagers;\n protected middlewareHelper: MiddlewareHelper;\n public onOpenTab: () => MaybePromise;\n\n constructor(options: {\n sidebarEl: SidebarSlider['sidebarEl'],\n tabs?: SidebarSlider['tabs'],\n canHideFirst?: SidebarSlider['canHideFirst'],\n navigationType: SidebarSlider['navigationType']\n }) {\n safeAssign(this, options);\n\n this.tabs ??= new Map();\n\n this.tabsContainer = this.sidebarEl.querySelector('.sidebar-slider');\n this._selectTab = TransitionSlider({\n content: this.tabsContainer,\n type: 'navigation',\n transitionTime: TRANSITION_TIME\n });\n if(!this.canHideFirst) {\n this._selectTab(0);\n }\n\n this.middlewareHelper = getMiddleware();\n\n // Array.from(this.sidebarEl.querySelectorAll('.sidebar-close-button') as any as HTMLElement[]).forEach((el) => {\n // attachClickEvent(el, this.onCloseBtnClick);\n // });\n }\n\n public getMiddleware() {\n return this.middlewareHelper.get();\n }\n\n public onCloseBtnClick = () => {\n const item = appNavigationController.findItemByType(this.navigationType);\n if(item) {\n appNavigationController.back(this.navigationType);\n } else if(this.historyTabIds.length) {\n this.closeTab(this.historyTabIds[this.historyTabIds.length - 1]);\n }\n // this.closeTab();\n };\n\n public closeTab = (id?: number | SliderSuperTab, animate?: boolean, isNavigation?: boolean) => {\n if(id !== undefined && this.historyTabIds[this.historyTabIds.length - 1] !== id) {\n this.removeTabFromHistory(id);\n return false;\n }\n\n // console.log('sidebar-close-button click:', this.historyTabIDs);\n const closingId = this.historyTabIds.pop(); // pop current\n this.onCloseTab(closingId, animate, isNavigation);\n\n const tab = this.historyTabIds[this.historyTabIds.length - 1];\n this._selectTab(tab !== undefined ? (tab instanceof SliderSuperTab ? tab.container : tab) : (this.canHideFirst ? -1 : 0), animate);\n return true;\n };\n\n public async selectTab(id: number | SliderSuperTab) {\n /* if(id instanceof SliderSuperTab) {\n id = id.id;\n } */\n\n if(this.historyTabIds[this.historyTabIds.length - 1] === id) {\n return false;\n }\n\n const tab: SliderSuperTab = id instanceof SliderSuperTab ? id : this.tabs.get(id);\n this.onOpenTab && await this.onOpenTab();\n\n if(tab) {\n // @ts-ignore\n tab.onOpen?.();\n\n // @ts-ignore\n if(tab.onOpenAfterTimeout) {\n setTimeout(() => {\n // @ts-ignore\n tab.onOpenAfterTimeout();\n }, TRANSITION_TIME);\n }\n }\n\n // if(!this.canHideFirst || this.historyTabIds.length) {\n appNavigationController.pushItem({\n type: this.navigationType,\n onPop: (canAnimate) => {\n this.closeTab(undefined, canAnimate, true);\n return true;\n }\n });\n // }\n\n this.historyTabIds.push(id);\n this._selectTab(id instanceof SliderSuperTab ? id.container : id);\n return true;\n }\n\n public removeTabFromHistory(id: number | SliderSuperTab) {\n indexOfAndSplice(this.historyTabIds, id);\n this.onCloseTab(id, undefined);\n }\n\n public sliceTabsUntilTab(tabConstructor: SliderSuperTabConstructable, preserveTab: SliderSuperTab) {\n for(let i = this.historyTabIds.length - 1; i >= 0; --i) {\n const tab = this.historyTabIds[i];\n if(tab === preserveTab) continue;\n else if(tab instanceof tabConstructor) {\n break;\n }\n\n this.removeTabFromHistory(tab);\n // appNavigationController.removeByType(this.navigationType, true);\n }\n }\n\n public getTab(tabConstructor: SliderSuperTabConstructable) {\n return this.historyTabIds.find((t) => t instanceof tabConstructor) as T;\n }\n\n public getHistory() {\n return this.historyTabIds;\n }\n\n public isTabExists(tabConstructor: SliderSuperTabConstructable) {\n return !!this.getTab(tabConstructor);\n }\n\n protected onCloseTab(id: number | SliderSuperTab, animate: boolean, isNavigation?: boolean) {\n if(!isNavigation) {\n appNavigationController.removeByType(this.navigationType, true);\n }\n\n const tab: SliderSuperTab = id instanceof SliderSuperTab ? id : this.tabs.get(id);\n if(tab) {\n try {\n // @ts-ignore\n tab.onClose?.();\n } catch(err) {\n console.error('tab onClose error', tab);\n }\n\n // @ts-ignore\n if(tab.onCloseAfterTimeout) {\n setTimeout(() => {\n // @ts-ignore\n tab.onCloseAfterTimeout();\n }, TRANSITION_TIME + 30);\n }\n }\n }\n\n public addTab(tab: SliderSuperTab) {\n if(!tab.container.parentElement) {\n this.tabsContainer.append(tab.container);\n\n if(tab.closeBtn) {\n tab.closeBtn.addEventListener('click', this.onCloseBtnClick);\n }\n }\n }\n\n public deleteTab(tab: SliderSuperTab) {\n this.tabs.delete(tab);\n }\n\n public createTab(\n ctor: SliderSuperTabConstructable,\n destroyable = true,\n doNotAppend?: boolean\n ) {\n const tab = new ctor(doNotAppend ? undefined : this, destroyable);\n tab.managers = this.managers;\n return tab;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport EventListenerBase from '../helpers/eventListenerBase';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport {getMiddleware, MiddlewareHelper} from '../helpers/middleware';\nimport noop from '../helpers/noop';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport {i18n, LangPackKey} from '../lib/langPack';\nimport ButtonIcon from './buttonIcon';\nimport Scrollable from './scrollable';\nimport SidebarSlider from './slider';\n\nexport interface SliderSuperTabConstructable {\n new(slider: SidebarSlider, destroyable: boolean): T;\n}\n\nexport interface SliderSuperTabEventableConstructable {\n new(slider: SidebarSlider, destroyable: boolean): SliderSuperTabEventable;\n}\n\nexport default class SliderSuperTab {\n public static getInitArgs?(fromTab: SliderSuperTab): any;\n\n public container: HTMLElement;\n\n public header: HTMLElement;\n public closeBtn: HTMLElement;\n public title: HTMLElement;\n\n public content: HTMLElement;\n public scrollable: Scrollable;\n\n public slider: SidebarSlider;\n public destroyable: boolean;\n public listenerSetter: ListenerSetter;\n\n public managers: AppManagers;\n public middlewareHelper: MiddlewareHelper;\n\n constructor(slider: SidebarSlider, destroyable?: boolean) {\n this._constructor(slider, destroyable);\n }\n\n public _constructor(slider: SidebarSlider, destroyable = true): any {\n this.slider = slider;\n this.middlewareHelper = slider ? slider.getMiddleware().create() : getMiddleware();\n this.destroyable = destroyable;\n\n this.container = document.createElement('div');\n this.container.classList.add('tabs-tab', 'sidebar-slider-item');\n\n // * Header\n this.header = document.createElement('div');\n this.header.classList.add('sidebar-header');\n\n this.closeBtn = ButtonIcon('left sidebar-close-button', {noRipple: true});\n this.title = document.createElement('div');\n this.title.classList.add('sidebar-header__title');\n this.header.append(this.closeBtn, this.title);\n\n // * Content\n this.content = document.createElement('div');\n this.content.classList.add('sidebar-content');\n\n this.scrollable = new Scrollable(this.content, undefined, undefined, true);\n this.scrollable.attachBorderListeners(this.container);\n\n this.container.append(this.header, this.content);\n\n this.slider?.addTab(this);\n\n this.listenerSetter = new ListenerSetter();\n }\n\n public close() {\n return this.slider.closeTab(this);\n }\n\n public async open(...args: Parameters) {\n if(this.init) {\n try {\n const result = this.init(...args);\n this.init = null;\n\n if(result instanceof Promise) {\n await result;\n }\n } catch(err) {\n console.error('open tab error', err);\n }\n }\n\n this.slider.selectTab(this);\n }\n\n public init(...args: any[]): Promise | any {\n\n }\n\n protected onOpen() {}\n protected onOpenAfterTimeout() {}\n protected onClose() {}\n\n protected onCloseAfterTimeout() {\n if(this.destroyable) { // ! WARNING, пока что это будет работать только с самой последней внутренней вкладкой !\n this.slider?.deleteTab(this);\n this.container.remove();\n this.scrollable.destroy();\n this.listenerSetter?.removeAll();\n this.middlewareHelper?.destroy();\n }\n }\n\n protected setTitle(key: LangPackKey) {\n this.title.replaceChildren(i18n(key));\n }\n}\n\nexport class SliderSuperTabEventable extends SliderSuperTab {\n public eventListener: EventListenerBase<{\n destroy: () => void | Promise,\n destroyAfter: (promise: Promise) => void,\n close: () => void\n }>;\n\n constructor(slider: SidebarSlider) {\n super(slider);\n this.eventListener = new EventListenerBase();\n }\n\n onClose() {\n this.eventListener.dispatchEvent('close');\n }\n\n onCloseAfterTimeout() {\n const results = this.eventListener.dispatchResultableEvent('destroy');\n this.eventListener.dispatchEvent('destroyAfter', Promise.all(results).then(noop, noop));\n this.eventListener.cleanup();\n return super.onCloseAfterTimeout();\n }\n}\n\n/* // @ts-ignore\ninterface SliderSuperEventsTab extends SliderSuperTab, EventListenerBase<{}> {\n superConstructor: (...args: any[]) => any;\n}\nclass SliderSuperEventsTab implements SliderSuperEventsTab {\n constructor(slider: SidebarSlider) {\n this.superConstructor([slider, true]);\n }\n}\napplyMixins(SliderSuperEventsTab, [SliderSuperTab, EventListenerBase]);\n\n(window as any).lol = SliderSuperEventsTab\n\nexport {SliderSuperEventsTab}; */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appDialogsManager, {AppDialogsManager, DialogDom, DialogElementSize} from '../lib/appManagers/appDialogsManager';\nimport {getHeavyAnimationPromise} from '../hooks/useHeavyAnimationCheck';\nimport isInDOM from '../helpers/dom/isInDOM';\nimport positionElementByIndex from '../helpers/dom/positionElementByIndex';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport {fastRaf} from '../helpers/schedulers';\nimport SortedList, {SortedElementBase} from '../helpers/sortedList';\nimport safeAssign from '../helpers/object/safeAssign';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport getUserStatusString from './wrappers/getUserStatusString';\nimport type LazyLoadQueue from './lazyLoadQueue';\nimport getChatMembersString from './wrappers/getChatMembersString';\n\ninterface SortedUser extends SortedElementBase {\n dom: DialogDom\n}\n\nexport default class SortedUserList extends SortedList {\n protected static SORT_INTERVAL = 30e3;\n public list: HTMLUListElement;\n\n protected lazyLoadQueue: LazyLoadQueue;\n protected avatarSize: DialogElementSize = 'abitbigger';\n protected rippleEnabled = true;\n protected autonomous = true;\n protected createChatListOptions: Parameters[0];\n protected onListLengthChange: () => void;\n protected getIndex: (element: SortedUser) => number;\n protected onUpdate: (element: SortedUser) => void;\n protected managers: AppManagers;\n\n constructor(options: Partial<{\n lazyLoadQueue: SortedUserList['lazyLoadQueue'],\n avatarSize: SortedUserList['avatarSize'],\n rippleEnabled: SortedUserList['rippleEnabled'],\n createChatListOptions: SortedUserList['createChatListOptions'],\n autonomous: SortedUserList['autonomous'],\n onListLengthChange: SortedUserList['onListLengthChange'],\n getIndex: SortedUserList['getIndex'],\n onUpdate: SortedUserList['onUpdate']\n }> & {\n managers: SortedUserList['managers']\n }) {\n super({\n getIndex: options.getIndex || ((element) => element.id.isAnyChat() ? 0 : this.managers.appUsersManager.getUserStatusForSort(element.id)),\n onDelete: (element) => {\n element.dom.listEl.remove();\n this.onListLengthChange && this.onListLengthChange();\n },\n onUpdate: options.onUpdate || (async(element) => {\n if(element.id.isAnyChat()) {\n const status = await getChatMembersString(element.id.toChatId(), this.managers);\n replaceContent(element.dom.lastMessageSpan, status);\n } else {\n const status = getUserStatusString(await this.managers.appUsersManager.getUser(element.id));\n replaceContent(element.dom.lastMessageSpan, status);\n }\n }),\n onSort: (element, idx) => {\n const willChangeLength = element.dom.listEl.parentElement !== this.list;\n positionElementByIndex(element.dom.listEl, this.list, idx);\n\n if(willChangeLength && this.onListLengthChange) {\n this.onListLengthChange();\n }\n },\n onElementCreate: (base) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: base.id,\n container: false,\n avatarSize: this.avatarSize,\n autonomous: this.autonomous,\n meAsSaved: false,\n rippleEnabled: this.rippleEnabled,\n wrapOptions: {\n lazyLoadQueue: this.lazyLoadQueue\n }\n });\n\n (base as SortedUser).dom = dom;\n return base as SortedUser;\n },\n updateElementWith: fastRaf,\n updateListWith: async(callback) => {\n if(!Array.from(this.elements.values()).some((element) => element.id.isUser())) {\n return callback(false);\n }\n\n if(!isInDOM(this.list)) {\n return callback(false);\n }\n\n await getHeavyAnimationPromise();\n\n if(!isInDOM(this.list)) {\n return callback(false);\n }\n\n callback(true);\n }\n });\n\n safeAssign(this, options);\n\n this.list = appDialogsManager.createChatList(this.createChatListOptions);\n\n let timeout: number;\n const doTimeout = () => {\n timeout = window.setTimeout(() => {\n this.updateList((good) => {\n if(good) {\n doTimeout();\n }\n });\n }, SortedUserList.SORT_INTERVAL);\n };\n\n doTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport AvatarElement from './avatar';\nimport type LazyLoadQueue from './lazyLoadQueue';\n\nconst CLASS_NAME = 'stacked-avatars';\nconst AVATAR_CLASS_NAME = CLASS_NAME + '-avatar';\nconst AVATAR_CONTAINER_CLASS_NAME = AVATAR_CLASS_NAME + '-container';\n\nexport default class StackedAvatars {\n public container: HTMLElement;\n private lazyLoadQueue: LazyLoadQueue;\n private avatarSize: number;\n\n constructor(options: {\n lazyLoadQueue?: StackedAvatars['lazyLoadQueue'],\n avatarSize: StackedAvatars['avatarSize']\n }) {\n this.lazyLoadQueue = options.lazyLoadQueue;\n this.avatarSize = options.avatarSize;\n\n this.container = document.createElement('div');\n this.container.classList.add(CLASS_NAME);\n\n this.container.style.setProperty('--avatar-size', options.avatarSize + 'px');\n }\n /**\n * MACOS, ANDROID - без реверса\n * WINDOWS DESKTOP - реверс\n * все приложения накладывают аватарку первую на вторую, а в макете зато вторая на первую, ЛОЛ!\n */\n public render(peerIds: PeerId[], loadPromises?: Promise[]) {\n const children = this.container.children;\n peerIds = peerIds.slice().reverse();\n if(peerIds.length > 3) {\n peerIds = peerIds.slice(-3);\n }\n\n peerIds.forEach((peerId, idx) => {\n let avatarContainer = children[idx] as HTMLElement;\n if(!avatarContainer) {\n avatarContainer = document.createElement('div');\n avatarContainer.classList.add(AVATAR_CONTAINER_CLASS_NAME);\n }\n\n let avatarElem = avatarContainer.firstElementChild as AvatarElement;\n if(!avatarElem) {\n avatarElem = new AvatarElement();\n avatarElem.classList.add('avatar-' + this.avatarSize, AVATAR_CLASS_NAME);\n avatarElem.updateOptions({\n isDialog: false,\n loadPromises\n });\n }\n\n avatarElem.updateWithOptions({\n lazyLoadQueue: this.lazyLoadQueue,\n peerId: peerId\n });\n\n if(!avatarElem.parentNode) {\n avatarContainer.append(avatarElem);\n }\n\n if(!avatarContainer.parentNode) {\n this.container.append(avatarContainer);\n }\n });\n\n // if were 3 and became 2\n (Array.from(children) as HTMLElement[]).slice(peerIds.length).forEach((el) => el.remove());\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {simulateClickEvent, attachClickEvent} from '../helpers/dom/clickEvent';\nimport findUpAsChild from '../helpers/dom/findUpAsChild';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport getVisibleRect from '../helpers/dom/getVisibleRect';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport {makeMediaSize} from '../helpers/mediaSize';\nimport {getMiddleware, Middleware} from '../helpers/middleware';\nimport {doubleRaf} from '../helpers/schedulers';\nimport pause from '../helpers/schedulers/pause';\nimport windowSize from '../helpers/windowSize';\nimport {MyDocument} from '../lib/appManagers/appDocsManager';\nimport getStickerEffectThumb from '../lib/appManagers/utils/stickers/getStickerEffectThumb';\nimport wrapEmojiText from '../lib/richTextProcessor/wrapEmojiText';\nimport {CustomEmojiElement} from '../lib/richTextProcessor/wrapRichText';\nimport lottieLoader from '../lib/rlottie/lottieLoader';\nimport RLottiePlayer from '../lib/rlottie/rlottiePlayer';\nimport rootScope from '../lib/rootScope';\nimport animationIntersector, {AnimationItemGroup} from './animationIntersector';\nimport SetTransition from './singleTransition';\nimport wrapSticker from './wrappers/sticker';\nimport {STICKER_EFFECT_MULTIPLIER} from './wrappers/sticker';\n\nlet hasViewer = false;\nexport default function attachStickerViewerListeners({listenTo, listenerSetter, selector, findTarget: originalFindTarget}: {\n listenerSetter: ListenerSetter,\n listenTo: HTMLElement,\n selector?: string,\n findTarget?: (e: MouseEvent) => HTMLElement\n}) {\n if(IS_TOUCH_SUPPORTED) {\n return;\n }\n\n const findTarget = (e: MouseEvent, checkForParent?: boolean) => {\n let el: HTMLElement;\n if(originalFindTarget) el = originalFindTarget(e);\n else {\n const s = selector || `.media-sticker-wrapper`;\n el = (e.target as HTMLElement).closest(s) as HTMLElement;\n }\n\n return el && (!checkForParent || findUpAsChild(el, listenTo)) ? el : undefined;\n };\n\n const managers = rootScope.managers;\n\n listenerSetter.add(listenTo)('mousedown', (e) => {\n if(hasViewer || e.buttons > 1 || e.button !== 0) return;\n let mediaContainer = findTarget(e);\n if(!mediaContainer) {\n return;\n }\n\n // const img: HTMLImageElement = mediaContainer.querySelector('img.media-sticker');\n\n const docId = mediaContainer.dataset.docId;\n if(!docId) {\n return;\n }\n\n const className = 'sticker-viewer';\n const group: AnimationItemGroup = 'STICKER-VIEWER';\n const openDuration = 200;\n const switchDuration = 200;\n const previousGroup = animationIntersector.getOnlyOnePlayableGroup();\n const _middleware = getMiddleware();\n let container: HTMLElement, previousTransformer: HTMLElement;\n\n const doThatSticker = async({mediaContainer, doc, middleware, lockGroups, isSwitching}: {\n mediaContainer: HTMLElement,\n doc: MyDocument,\n middleware: Middleware,\n lockGroups?: boolean,\n isSwitching?: boolean\n }) => {\n const effectThumb = getStickerEffectThumb(doc);\n const mediaRect: DOMRect = mediaContainer.getBoundingClientRect();\n const s = makeMediaSize(doc.w, doc.h);\n const size = effectThumb ? 280 : 360;\n const boxSize = makeMediaSize(size, size);\n const fitted = mediaRect.width === mediaRect.height ? boxSize : s.aspectFitted(boxSize);\n\n const bubble = findUpClassName(mediaContainer, 'bubble');\n const isOut = bubble ? bubble.classList.contains('is-out') : true;\n\n const transformer = document.createElement('div');\n transformer.classList.add(className + '-transformer');\n\n const stickerContainer = document.createElement('div');\n stickerContainer.classList.add(className + '-sticker');\n /* transformer.style.width = */stickerContainer.style.width = fitted.width + 'px';\n /* transformer.style.height = */stickerContainer.style.height = fitted.height + 'px';\n\n const stickerEmoji = document.createElement('div');\n stickerEmoji.classList.add(className + '-emoji');\n stickerEmoji.append(wrapEmojiText(doc.stickerEmojiRaw));\n\n if(effectThumb) {\n const margin = (size * STICKER_EFFECT_MULTIPLIER - size) / 3 * (isOut ? 1 : -1);\n transformer.classList.add('has-effect');\n // const property = `--margin-${isOut ? 'right' : 'left'}`;\n // stickerContainer.style.setProperty(property, `${margin * 2}px`);\n transformer.style.setProperty('--translateX', `${margin}px`);\n stickerEmoji.style.setProperty('--translateX', `${-margin}px`);\n }\n\n const overflowElement = findUpClassName(mediaContainer, 'scrollable');\n const visibleRect = getVisibleRect(mediaContainer, overflowElement, true, mediaRect);\n if(visibleRect.overflow.vertical || visibleRect.overflow.horizontal) {\n stickerContainer.classList.add('is-overflow');\n }\n\n // if(img) {\n // const ratio = img.naturalWidth / img.naturalHeight;\n // if((mediaRect.width / mediaRect.height).toFixed(1) !== ratio.toFixed(1)) {\n\n // mediaRect = mediaRect.toJSON();\n // }\n // }\n\n const rect = mediaContainer.getBoundingClientRect();\n const scaleX = rect.width / fitted.width;\n const scaleY = rect.height / fitted.height;\n const transformX = rect.left - (windowSize.width - rect.width) / 2;\n const transformY = rect.top - (windowSize.height - rect.height) / 2;\n transformer.style.transform = `translate(${transformX}px, ${transformY}px) scale(${scaleX}, ${scaleY})`;\n if(isSwitching) transformer.classList.add('is-switching');\n transformer.append(stickerContainer, stickerEmoji);\n container.append(transformer);\n\n const o = await wrapSticker({\n doc,\n div: stickerContainer,\n group,\n width: fitted.width,\n height: fitted.height,\n play: false,\n loop: true,\n middleware,\n managers,\n needFadeIn: false,\n isOut,\n withThumb: false,\n relativeEffect: true,\n loopEffect: true\n }).then(({render}) => render);\n if(!middleware()) return;\n\n if(!container.parentElement) {\n document.body.append(container);\n }\n\n const player = Array.isArray(o) ? o[0] : o;\n\n const firstFramePromise = player instanceof RLottiePlayer ?\n new Promise((resolve) => player.addEventListener('firstFrame', resolve, {once: true})) :\n Promise.resolve();\n await Promise.all([firstFramePromise, doubleRaf()]);\n await pause(0); // ! need it because firstFrame will be called just from the loop\n if(!middleware()) return;\n\n if(lockGroups) {\n animationIntersector.setOnlyOnePlayableGroup(group);\n animationIntersector.checkAnimations2(true);\n }\n\n if(player instanceof RLottiePlayer) {\n const prevPlayer = mediaContainer instanceof CustomEmojiElement ?\n mediaContainer.player as RLottiePlayer :\n lottieLoader.getAnimation(mediaContainer);\n if(prevPlayer) {\n player.curFrame = prevPlayer.curFrame;\n player.play();\n await new Promise((resolve) => {\n let i = 0;\n const c = () => {\n if(++i === 2) {\n resolve();\n player.removeEventListener('enterFrame', c);\n }\n };\n\n player.addEventListener('enterFrame', c);\n });\n if(!middleware()) return;\n player.pause();\n }\n } else if(player instanceof HTMLVideoElement) {\n const prevPlayer = mediaContainer.querySelector('video');\n if(prevPlayer) {\n player.currentTime = prevPlayer.currentTime;\n }\n }\n\n return {\n ready: () => {\n if(player instanceof RLottiePlayer || player instanceof HTMLVideoElement) {\n player.play();\n }\n\n if(effectThumb) {\n simulateClickEvent(stickerContainer);\n }\n },\n transformer\n };\n };\n\n const timeout = window.setTimeout(async() => {\n document.removeEventListener('mousemove', onMousePreMove);\n\n container = document.createElement('div');\n container.classList.add(className);\n hasViewer = true;\n\n const middleware = _middleware.get();\n const doc = await managers.appDocsManager.getDoc(docId);\n if(!middleware()) return;\n\n let result: Awaited>;\n try {\n result = await doThatSticker({\n doc,\n mediaContainer,\n middleware,\n lockGroups: true\n });\n if(!result) return;\n } catch(err) {\n return;\n }\n\n const {ready, transformer} = result;\n\n previousTransformer = transformer;\n\n SetTransition({\n element: container,\n className: 'is-visible',\n forwards: true,\n duration: openDuration,\n onTransitionEnd: () => {\n if(!middleware()) return;\n ready();\n }\n });\n\n document.addEventListener('mousemove', onMouseMove);\n }, 125);\n\n const onMouseMove = async(e: MouseEvent) => {\n const newMediaContainer = findTarget(e, true);\n if(!newMediaContainer || mediaContainer === newMediaContainer) {\n return;\n }\n\n const docId = newMediaContainer.dataset.docId;\n if(!docId) {\n return;\n }\n\n mediaContainer = newMediaContainer;\n _middleware.clean();\n const middleware = _middleware.get();\n\n const doc = await managers.appDocsManager.getDoc(docId);\n if(!middleware()) return;\n\n let r: Awaited>;\n try {\n r = await doThatSticker({\n doc,\n mediaContainer,\n middleware,\n isSwitching: true\n });\n if(!r) return;\n } catch(err) {\n console.error('sticker viewer error', err);\n return;\n }\n\n const {ready, transformer} = r;\n\n const _previousTransformer = previousTransformer;\n SetTransition({\n element: _previousTransformer,\n className: 'is-switching',\n forwards: true,\n duration: switchDuration,\n onTransitionEnd: () => {\n _previousTransformer.remove();\n }\n });\n\n previousTransformer = transformer;\n\n SetTransition({\n element: transformer,\n className: 'is-switching',\n forwards: false,\n duration: switchDuration,\n onTransitionEnd: () => {\n if(!middleware()) return;\n ready();\n }\n });\n };\n\n const onMousePreMove = (e: MouseEvent) => {\n if(!findUpAsChild(e.target as HTMLElement, mediaContainer)) {\n onMouseUp();\n }\n };\n\n const onMouseUp = () => {\n clearTimeout(timeout);\n _middleware.clean();\n\n if(container) {\n SetTransition({\n element: container,\n className: 'is-visible',\n forwards: false,\n duration: openDuration,\n onTransitionEnd: () => {\n container.remove();\n animationIntersector.setOnlyOnePlayableGroup(previousGroup);\n animationIntersector.checkAnimations2(false);\n hasViewer = false;\n }\n });\n\n attachClickEvent(document.body, cancelEvent, {capture: true, once: true});\n }\n\n document.removeEventListener('mousemove', onMousePreMove);\n document.removeEventListener('mousemove', onMouseMove);\n document.removeEventListener('mouseup', onMouseUp, {capture: true});\n };\n\n document.addEventListener('mousemove', onMousePreMove);\n document.addEventListener('mouseup', onMouseUp, {once: true, capture: true});\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default class StickyIntersector {\n private headersObserver: IntersectionObserver;\n private elementsObserver: IntersectionObserver;\n\n constructor(private container: HTMLElement, private handler: (stuck: boolean, target: HTMLElement) => void) {\n this.observeHeaders();\n this.observeElements();\n }\n\n /**\n * Sets up an intersection observer to notify when elements with the class\n * `.sticky_sentinel--top` become visible/invisible at the top of the container.\n * @param {!Element} container\n */\n private observeHeaders() {\n this.headersObserver = new IntersectionObserver((entries) => {\n for(const entry of entries) {\n const targetInfo = entry.boundingClientRect;\n const stickyTarget = entry.target.parentElement;\n const rootBoundsInfo = entry.rootBounds;\n\n // Started sticking.\n if(targetInfo.bottom < rootBoundsInfo.top) {\n this.handler(true, stickyTarget);\n }\n\n // Stopped sticking.\n if(targetInfo.bottom >= rootBoundsInfo.top &&\n targetInfo.bottom < rootBoundsInfo.bottom) {\n this.handler(false, stickyTarget);\n }\n }\n }, {threshold: 0, root: this.container});\n }\n\n private observeElements() {\n this.elementsObserver = new IntersectionObserver((entries) => {\n const entry = entries\n .filter((entry) => entry.boundingClientRect.top < entry.rootBounds.top)\n .sort((a, b) => a.boundingClientRect.top - b.boundingClientRect.top)[0];\n if(!entry) return;\n\n const container = entry.isIntersecting ? entry.target : entry.target.nextElementSibling;\n this.handler(true, container as HTMLElement);\n }, {root: this.container});\n }\n\n /**\n * @param {!Element} container\n * @param {string} className\n */\n private addSentinel(container: HTMLElement, className: string) {\n const sentinel = document.createElement('div');\n sentinel.classList.add('sticky_sentinel', className);\n return container.appendChild(sentinel);\n }\n\n /**\n * Notifies when elements w/ the `sticky` class begin to stick or stop sticking.\n * Note: the elements should be children of `container`.\n * @param {!Element} container\n */\n public observeStickyHeaderChanges(element: HTMLElement) {\n const headerSentinel = this.addSentinel(element, 'sticky_sentinel--top');\n this.headersObserver.observe(headerSentinel);\n\n this.elementsObserver.observe(element);\n }\n\n public disconnect() {\n this.headersObserver.disconnect();\n this.elementsObserver.disconnect();\n }\n\n public unobserve(element: HTMLElement, headerSentinel: HTMLElement) {\n this.elementsObserver.unobserve(element);\n this.headersObserver.unobserve(headerSentinel);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// * zoom part from WebZ\n// * https://github.com/Ajaxy/telegram-tt/blob/069f4f5b2f2c7c22529ccced876842e7f9cb81f4/src/util/captureEvents.ts\n\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport safeAssign from '../helpers/object/safeAssign';\nimport contextMenuController from '../helpers/contextMenuController';\nimport {Middleware} from '../helpers/middleware';\nimport ListenerSetter, {Listener, ListenerOptions} from '../helpers/listenerSetter';\nimport {attachContextMenuListener} from '../helpers/dom/attachContextMenuListener';\nimport pause from '../helpers/schedulers/pause';\nimport deferredPromise from '../helpers/cancellablePromise';\nimport clamp from '../helpers/number/clamp';\nimport debounce from '../helpers/schedulers/debounce';\nimport {logger} from '../lib/logger';\nimport isSwipingBackSafari from '../helpers/dom/isSwipingBackSafari';\nimport windowSize from '../helpers/windowSize';\n\ntype E = {\n clientX: number,\n clientY: number,\n target: EventTarget,\n button?: number,\n type?: string\n};\n\ntype EE = E | (Exclude & {\n touches: E[]\n});\n\nconst getEvent = (e: EE) => {\n return 'touches' in e ? e.touches[0] : e;\n};\n\nfunction getDistance(a: Touch, b?: Touch) {\n if(!b) return 0;\n return Math.hypot((b.pageX - a.pageX), (b.pageY - a.pageY));\n}\n\nfunction getTouchCenter(a: Touch, b: Touch) {\n return {\n x: (a.pageX + b.pageX) / 2,\n y: (a.pageY + b.pageY) / 2\n };\n}\n\nconst attachGlobalListenerTo = document;\n\nlet RESET_GLOBAL = false;\ncontextMenuController.addEventListener('toggle', (visible) => {\n RESET_GLOBAL = visible;\n});\n\nexport type SwipeHandlerOptions = {\n element: SwipeHandler['element'],\n onSwipe: SwipeHandler['onSwipe'],\n verifyTouchTarget?: SwipeHandler['verifyTouchTarget'],\n onFirstSwipe?: SwipeHandler['onFirstSwipe'],\n onReset?: SwipeHandler['onReset'],\n onStart?: SwipeHandler['onStart'],\n onZoom?: SwipeHandler['onZoom'],\n onDrag?: SwipeHandler['onDrag'],\n onDoubleClick?: SwipeHandler['onDoubleClick'],\n cursor?: SwipeHandler['cursor'],\n cancelEvent?: SwipeHandler['cancelEvent'],\n listenerOptions?: SwipeHandler['listenerOptions'],\n setCursorTo?: HTMLElement,\n middleware?: Middleware,\n withDelay?: boolean,\n minZoom?: number,\n maxZoom?: number\n};\n\nconst TOUCH_MOVE_OPTIONS: ListenerOptions = {passive: false};\nconst MOUSE_MOVE_OPTIONS: ListenerOptions = false as any;\nconst WHEEL_OPTIONS: ListenerOptions = {capture: true, passive: false};\n\nexport type ZoomDetails = {\n zoom?: number;\n zoomFactor?: number;\n zoomAdd?: number;\n initialCenterX: number;\n initialCenterY: number;\n dragOffsetX: number;\n dragOffsetY: number;\n currentCenterX: number;\n currentCenterY: number;\n};\n\nexport default class SwipeHandler {\n private element: HTMLElement;\n private onSwipe: (xDiff: number, yDiff: number, e: EE, cancelDrag?: (x: boolean, y: boolean) => void) => boolean | void;\n private verifyTouchTarget: (evt: EE) => boolean | Promise;\n private onFirstSwipe: (e: EE) => void;\n private onReset: (e?: Event) => void;\n private onStart: () => void;\n private onZoom: (details: ZoomDetails) => void;\n private onDrag: (e: EE, captureEvent: E, details: {dragOffsetX: number, dragOffsetY: number}, cancelDrag: (x: boolean, y: boolean) => void) => void;\n private onDoubleClick: (details: {centerX: number, centerY: number}) => void;\n private cursor: 'grabbing' | 'move' | 'row-resize' | 'col-resize' | 'nesw-resize' | 'nwse-resize' | 'ne-resize' | 'se-resize' | 'sw-resize' | 'nw-resize' | 'n-resize' | 'e-resize' | 's-resize' | 'w-resize' | '';\n private cancelEvent: boolean;\n private listenerOptions: ListenerOptions;\n private setCursorTo: HTMLElement;\n\n private isMouseDown: boolean;\n private tempId: number;\n\n private hadMove: boolean;\n private eventUp: E;\n private xDown: number;\n private yDown: number;\n private xAdded: number;\n private yAdded: number;\n\n private withDelay: boolean;\n private listenerSetter: ListenerSetter;\n\n private initialDistance: number;\n private initialTouchCenter: ReturnType;\n private initialDragOffset: {x: number, y: number};\n private isDragCanceled: {x: boolean, y: boolean};\n private wheelZoom: number;\n private releaseWheelDrag: ReturnType void>>;\n private releaseWheelZoom: ReturnType void>>;\n\n private log: ReturnType;\n\n constructor(options: SwipeHandlerOptions) {\n safeAssign(this, options);\n\n this.log = logger('SWIPE-HANDLER');\n this.cursor ??= 'grabbing';\n this.cancelEvent ??= true;\n // this.listenerOptions ??= false as any;\n this.listenerOptions ??= TOUCH_MOVE_OPTIONS;\n\n this.setCursorTo ??= this.element;\n this.listenerSetter = new ListenerSetter();\n this.setListeners();\n\n this.resetValues();\n this.tempId = 0;\n\n options.middleware?.onDestroy(() => {\n this.reset();\n this.removeListeners();\n });\n\n this.releaseWheelDrag = debounce(this.reset, 150, false);\n this.releaseWheelZoom = debounce(this.reset, 150, false);\n }\n\n public setListeners() {\n if(!IS_TOUCH_SUPPORTED) {\n // @ts-ignore\n this.listenerSetter.add(this.element)('mousedown', this.handleStart, this.listenerOptions);\n this.listenerSetter.add(attachGlobalListenerTo)('mouseup', this.reset);\n\n if(this.onZoom || this.onDoubleClick) {\n this.listenerSetter.add(this.element)('wheel', this.handleWheel, WHEEL_OPTIONS);\n }\n } else {\n if(this.withDelay) {\n attachContextMenuListener({\n element: this.element,\n callback: (e) => {\n cancelEvent(e);\n // @ts-ignore\n this.handleStart(e);\n },\n listenerSetter: this.listenerSetter,\n listenerOptions: this.listenerOptions\n });\n } else {\n // @ts-ignore\n this.listenerSetter.add(this.element)('touchstart', this.handleStart, this.listenerOptions);\n }\n\n if(this.onDoubleClick) {\n this.listenerSetter.add(this.element)('dblclick', (e) => {\n this.onDoubleClick({centerX: e.pageX, centerY: e.pageY});\n });\n }\n\n this.listenerSetter.add(attachGlobalListenerTo)('touchend', this.reset);\n }\n }\n\n public removeListeners() {\n this.log('remove listeners');\n this.reset();\n this.listenerSetter.removeAll();\n }\n\n public setCursor(cursor: SwipeHandler['cursor'] = '') {\n this.cursor = cursor;\n\n if(!IS_TOUCH_SUPPORTED && this.hadMove) {\n this.setCursorTo.style.setProperty('cursor', this.cursor, 'important');\n }\n }\n\n public add(x: number, y: number) {\n this.xAdded = x;\n this.yAdded = y;\n this.handleMove({\n clientX: this.eventUp.clientX,\n clientY: this.eventUp.clientY,\n target: this.eventUp.target\n });\n }\n\n protected resetValues() {\n ++this.tempId;\n this.hadMove = false;\n this.xAdded = this.yAdded = 0;\n this.xDown =\n this.yDown =\n this.eventUp =\n this.isMouseDown =\n undefined;\n\n if(this.onZoom) {\n this.initialDistance = 0;\n this.initialTouchCenter = {\n x: windowSize.width / 2,\n y: windowSize.height / 2\n };\n this.initialDragOffset = {x: 0, y: 0};\n this.isDragCanceled = {x: false, y: false};\n this.wheelZoom = 1;\n }\n }\n\n protected reset = (e?: Event) => {\n this.log('reset');\n /* if(e) {\n cancelEvent(e);\n } */\n\n if(IS_TOUCH_SUPPORTED) {\n this.listenerSetter.removeManual(attachGlobalListenerTo, 'touchmove', this.handleMove, TOUCH_MOVE_OPTIONS);\n } else {\n this.listenerSetter.removeManual(attachGlobalListenerTo, 'mousemove', this.handleMove, MOUSE_MOVE_OPTIONS);\n this.setCursorTo.style.cursor = '';\n }\n\n if(this.hadMove) {\n this.onReset?.(e);\n }\n\n this.releaseWheelDrag?.clearTimeout();\n this.releaseWheelZoom?.clearTimeout();\n\n this.resetValues();\n };\n\n protected setHadMove(_e: EE) {\n if(!this.hadMove) {\n this.log('had move');\n this.hadMove = true;\n this.setCursorTo.style.setProperty('cursor', this.cursor, 'important');\n this.onFirstSwipe?.(_e);\n }\n }\n\n protected dispatchOnSwipe(...args: Parameters) {\n const onSwipeResult = this.onSwipe(...args);\n if(onSwipeResult !== undefined && onSwipeResult) {\n this.reset();\n }\n }\n\n protected handleStart = async(_e: EE) => {\n this.log('start');\n\n if(this.isMouseDown) {\n const touches = (_e as any as TouchEvent).touches;\n if(touches?.length === 2) {\n this.initialDistance = getDistance(touches[0], touches[1]);\n this.initialTouchCenter = getTouchCenter(touches[0], touches[1]);\n }\n\n return;\n }\n\n const e = getEvent(_e);\n if(![0, 1].includes(Math.max(0, e.button ?? 0))) {\n return;\n }\n\n if(e.button === 1) {\n cancelEvent(_e as any);\n }\n\n if(isSwipingBackSafari(_e as any)) {\n return;\n }\n\n const tempId = ++this.tempId;\n\n const verifyResult = this.verifyTouchTarget?.(_e);\n if(verifyResult !== undefined) {\n let result: any;\n if(verifyResult instanceof Promise) {\n // const tempId = this.tempId;\n result = await verifyResult;\n\n if(this.tempId !== tempId) {\n return;\n }\n } else {\n result = verifyResult;\n }\n\n if(!result) {\n return this.reset();\n }\n }\n\n this.isMouseDown = true;\n\n if(this.withDelay && !IS_TOUCH_SUPPORTED) {\n const options = {...MOUSE_MOVE_OPTIONS, once: true};\n const deferred = deferredPromise();\n const cb = () => deferred.resolve();\n const listener = this.listenerSetter.add(attachGlobalListenerTo)('mousemove', cb, options) as any as Listener;\n\n await Promise.race([\n pause(300),\n deferred\n ]);\n\n deferred.resolve();\n this.listenerSetter.remove(listener);\n\n if(this.tempId !== tempId) {\n return;\n }\n }\n\n this.xDown = e.clientX;\n this.yDown = e.clientY;\n this.eventUp = e;\n\n if(IS_TOUCH_SUPPORTED) {\n // @ts-ignore\n this.listenerSetter.add(attachGlobalListenerTo)('touchmove', this.handleMove, TOUCH_MOVE_OPTIONS);\n } else {\n // @ts-ignore\n this.listenerSetter.add(attachGlobalListenerTo)('mousemove', this.handleMove, MOUSE_MOVE_OPTIONS);\n }\n\n if(this.onStart) {\n this.onStart();\n\n // have to initiate move instantly\n this.hadMove = true;\n this.handleMove(e);\n }\n };\n\n protected handleMove = (_e: EE) => {\n if(this.xDown === undefined || this.yDown === undefined || RESET_GLOBAL) {\n this.reset();\n return;\n }\n\n if(this.cancelEvent) {\n cancelEvent(_e as any);\n }\n\n if(this.releaseWheelDrag?.isDebounced() || this.releaseWheelZoom?.isDebounced()) {\n return;\n }\n\n this.log('move');\n\n const e = this.eventUp = getEvent(_e);\n const xUp = e.clientX;\n const yUp = e.clientY;\n\n const xDiff = xUp - this.xDown + this.xAdded;\n const yDiff = yUp - this.yDown + this.yAdded;\n\n if(!this.hadMove) {\n if(!xDiff && !yDiff) {\n return;\n }\n\n this.setHadMove(_e);\n }\n\n const touches = (_e as any as TouchEvent).touches;\n if(this.onZoom && this.initialDistance > 0 && touches.length === 2) {\n const endDistance = getDistance(touches[0], touches[1]);\n const touchCenter = getTouchCenter(touches[0], touches[1]);\n const dragOffsetX = touchCenter.x - this.initialTouchCenter.x;\n const dragOffsetY = touchCenter.y - this.initialTouchCenter.y;\n const zoomFactor = endDistance / this.initialDistance;\n const details: ZoomDetails = {\n zoomFactor,\n initialCenterX: this.initialTouchCenter.x,\n initialCenterY: this.initialTouchCenter.y,\n dragOffsetX,\n dragOffsetY,\n currentCenterX: touchCenter.x,\n currentCenterY: touchCenter.y\n };\n\n this.onZoom(details);\n }\n\n this.dispatchOnSwipe(xDiff, yDiff, _e);\n };\n\n protected handleWheel = (e: WheelEvent) => {\n if(!this.hadMove && this.verifyTouchTarget) {\n const result = this.verifyTouchTarget(e);\n if(result !== undefined && !result) {\n this.reset(e);\n return;\n }\n }\n\n cancelEvent(e);\n\n this.log('wheel');\n\n if(this.onDoubleClick && Object.is(e.deltaX, -0) && Object.is(e.deltaY, -0) && e.ctrlKey) {\n this.onWheelCapture(e);\n this.onDoubleClick({centerX: e.pageX, centerY: e.pageY});\n this.reset();\n return;\n }\n\n const metaKeyPressed = e.metaKey || e.ctrlKey || e.shiftKey;\n if(metaKeyPressed) {\n // * fix zooming while dragging is in inertia\n if(this.releaseWheelDrag?.isDebounced()) {\n this.reset();\n }\n\n this.onWheelZoom(e);\n } else {\n this.handleWheelDrag(e);\n }\n };\n\n protected handleWheelDrag = (e: WheelEvent) => {\n this.log('wheel drag');\n\n this.onWheelCapture(e);\n // Ignore wheel inertia if drag is canceled in this direction\n if(!this.isDragCanceled.x || Math.sign(this.initialDragOffset.x) === Math.sign(e.deltaX)) {\n this.initialDragOffset.x -= e.deltaX;\n }\n if(!this.isDragCanceled.y || Math.sign(this.initialDragOffset.y) === Math.sign(e.deltaY)) {\n this.initialDragOffset.y -= e.deltaY;\n }\n const {x, y} = this.initialDragOffset;\n this.releaseWheelDrag(e);\n this.dispatchOnSwipe(x, y, e, (dx, dy) => {\n this.isDragCanceled = {x: dx, y: dy};\n });\n };\n\n protected onWheelCapture = (e: WheelEvent) => {\n if(this.hadMove) return;\n this.log('wheel capture');\n this.handleStart(e);\n this.setHadMove(e);\n this.initialTouchCenter = {x: e.x, y: e.y};\n };\n\n protected onWheelZoom = (e: WheelEvent) => {\n if(!this.onZoom) return;\n this.log('wheel zoom');\n this.onWheelCapture(e);\n const dragOffsetX = e.x - this.initialTouchCenter.x;\n const dragOffsetY = e.y - this.initialTouchCenter.y;\n const delta = clamp(e.deltaY, -25, 25);\n this.wheelZoom -= delta * 0.01;\n const details: ZoomDetails = {\n zoomAdd: this.wheelZoom - 1,\n initialCenterX: this.initialTouchCenter.x,\n initialCenterY: this.initialTouchCenter.y,\n dragOffsetX,\n dragOffsetY,\n currentCenterX: e.x,\n currentCenterY: e.y\n };\n this.onZoom(details);\n this.releaseWheelZoom(e);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport placeCaretAtEnd from '../helpers/dom/placeCaretAtEnd';\nimport {formatPhoneNumber} from '../helpers/formatPhoneNumber';\nimport {IS_APPLE, IS_ANDROID, IS_APPLE_MOBILE} from '../environment/userAgent';\nimport {HelpCountry, HelpCountryCode} from '../layer';\nimport InputField, {InputFieldOptions} from './inputField';\n\nexport default class TelInputField extends InputField {\n private pasted = false;\n public lastValue = '';\n\n constructor(options: InputFieldOptions & {\n onInput?: (formatted: ReturnType) => void\n } = {}) {\n super({\n label: 'Contacts.PhoneNumber.Placeholder',\n // plainText: true,\n name: 'phone',\n ...options\n });\n\n this.container.classList.add('input-field-phone');\n\n const telEl = this.input;\n if(telEl instanceof HTMLInputElement) {\n telEl.type = 'tel';\n telEl.autocomplete = 'rr55RandomRR55';\n } else {\n telEl.inputMode = 'decimal';\n\n const pixelRatio = window.devicePixelRatio;\n if(pixelRatio > 1) {\n let letterSpacing: number;\n if(IS_APPLE) {\n letterSpacing = pixelRatio * -.16;\n } else if(IS_ANDROID) {\n letterSpacing = 0;\n }\n\n telEl.style.setProperty('--letter-spacing', letterSpacing + 'px');\n }\n\n const originalFunc = this.setValueSilently.bind(this);\n this.setValueSilently = (value) => {\n originalFunc(value);\n placeCaretAtEnd(this.input, true);\n };\n }\n\n telEl.addEventListener('input', () => {\n // console.log('input', this.value);\n telEl.classList.remove('error');\n\n const value = this.value;\n const diff = Math.abs(value.length - this.lastValue.length);\n if(diff > 1 && !this.pasted && IS_APPLE_MOBILE) {\n this.setValueSilently(this.lastValue + value);\n }\n\n this.pasted = false;\n\n this.setLabel();\n\n let formattedPhoneNumber: ReturnType;\n let formatted: string, country: HelpCountry, countryCode: HelpCountryCode, leftPattern = '';\n if(this.value.replace(/\\++/, '+') === '+') {\n this.setValueSilently('+');\n } else {\n formattedPhoneNumber = formatPhoneNumber(this.value);\n formatted = formattedPhoneNumber.formatted;\n country = formattedPhoneNumber.country;\n leftPattern = formattedPhoneNumber.leftPattern;\n countryCode = formattedPhoneNumber.code;\n this.setValueSilently(this.lastValue = formatted ? '+' + formatted : '');\n }\n\n telEl.dataset.leftPattern = leftPattern/* .replace(/X/g, '0') */;\n\n // console.log(formatted, country);\n\n options.onInput && options.onInput(formattedPhoneNumber);\n });\n\n telEl.addEventListener('paste', () => {\n this.pasted = true;\n // console.log('paste', telEl.value);\n });\n\n /* telEl.addEventListener('change', (e) => {\n console.log('change', telEl.value);\n }); */\n\n telEl.addEventListener('keypress', (e) => {\n // console.log('keypress', this.value);\n const key = e.key;\n if(/\\D/.test(key) && !(e.metaKey || e.ctrlKey) && key !== 'Backspace' && !(key === '+' && e.shiftKey/* && !this.value */)) {\n e.preventDefault();\n return false;\n }\n });\n\n /* telEl.addEventListener('focus', function(this: typeof telEl, e) {\n this.removeAttribute('readonly'); // fix autocomplete\n });*/\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport EventListenerBase from '../helpers/eventListenerBase';\nimport {TelegramWebViewEvent, TelegramWebViewEventCallback, TelegramWebViewEventMap} from '../types';\n\nconst weakMap: WeakMap = new WeakMap();\nwindow.addEventListener('message', (e) => {\n const callback = weakMap.get(e.source as Window);\n if(!callback) {\n return;\n }\n\n callback(JSON.parse(e.data));\n});\n\nexport default class TelegramWebView extends EventListenerBase<{\n [type in keyof TelegramWebViewEventMap]: (data: TelegramWebViewEventMap[type]) => void\n}> {\n public iframe: HTMLIFrameElement;\n\n constructor({url, sandbox}: {\n url: string,\n sandbox?: string\n }) {\n super(false);\n\n const iframe = this.iframe = document.createElement('iframe');\n iframe.src = url;\n if(sandbox) iframe.setAttribute('sandbox', sandbox);\n }\n\n public onMount() {\n weakMap.set(this.iframe.contentWindow, this.onTelegramWebViewEvent);\n }\n\n public destroy() {\n this.cleanup();\n weakMap.delete(this.iframe.contentWindow);\n }\n\n private onTelegramWebViewEvent = ({eventType, eventData}: TelegramWebViewEvent) => {\n if((eventData as any) === '') {\n eventData = undefined;\n }\n\n console.log('onTelegramWebViewEvent', eventType, eventData);\n this.dispatchEvent(eventType, eventData as any);\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport replaceContent from '../helpers/dom/replaceContent';\nimport OverlayClickHandler from '../helpers/overlayClickHandler';\nimport {FormatterArguments, i18n, LangPackKey} from '../lib/langPack';\n\nconst toastEl = document.createElement('div');\ntoastEl.classList.add('toast');\nlet timeout: number;\n\nconst x = new OverlayClickHandler('toast');\nx.addEventListener('toggle', (open) => {\n if(!open) {\n hideToast();\n }\n});\n\nexport function hideToast() {\n x.close();\n\n toastEl.classList.remove('is-visible');\n timeout && clearTimeout(+timeout);\n\n timeout = window.setTimeout(() => {\n toastEl.remove();\n timeout = undefined;\n }, 200);\n}\n\nexport function toast(content: string | Node, onClose?: () => void) {\n x.close();\n\n replaceContent(toastEl, content);\n\n if(!toastEl.parentElement) {\n document.body.append(toastEl);\n void toastEl.offsetLeft; // reflow\n }\n\n toastEl.classList.add('is-visible');\n\n timeout && clearTimeout(+timeout);\n x.open(toastEl);\n\n timeout = window.setTimeout(hideToast, 3000);\n\n if(onClose) {\n x.addEventListener('toggle', onClose, {once: true});\n }\n}\n\nexport function toastNew(options: Partial<{\n langPackKey: LangPackKey,\n langPackArguments: FormatterArguments,\n onClose: () => void\n}>) {\n toast(i18n(options.langPackKey, options.langPackArguments), options.onClose);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../lib/rootScope';\nimport deferredPromise, {CancellablePromise} from '../helpers/cancellablePromise';\nimport {dispatchHeavyAnimationEvent} from '../hooks/useHeavyAnimationCheck';\nimport whichChild from '../helpers/dom/whichChild';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport liteMode from '../helpers/liteMode';\n\nfunction makeTransitionFunction(options: TransitionFunction) {\n return options;\n}\n\nconst slideNavigation = makeTransitionFunction({\n callback: (tabContent, prevTabContent, toRight) => {\n const width = prevTabContent.getBoundingClientRect().width;\n const elements = [tabContent, prevTabContent];\n if(toRight) elements.reverse();\n elements[0].style.filter = `brightness(80%)`;\n elements[0].style.transform = `translate3d(${-width * .25}px, 0, 0)`;\n elements[1].style.transform = `translate3d(${width}px, 0, 0)`;\n\n tabContent.classList.add('active');\n void tabContent.offsetWidth; // reflow\n\n tabContent.style.transform = '';\n tabContent.style.filter = '';\n\n return () => {\n prevTabContent.style.transform = prevTabContent.style.filter = '';\n };\n },\n animateFirst: false\n});\n\nconst slideTabs = makeTransitionFunction({\n callback: (tabContent, prevTabContent, toRight) => {\n // Jolly Cobra's // Workaround for scrollable content flickering during animation.\n // const scrollableContainer = findUpClassName(tabContent, 'scrollable-y');\n // if(scrollableContainer && scrollableContainer.style.overflowY !== 'hidden') {\n // // const scrollBarWidth = scrollableContainer.offsetWidth - scrollableContainer.clientWidth;\n // scrollableContainer.style.overflowY = 'hidden';\n // // scrollableContainer.style.paddingRight = `${scrollBarWidth}px`;\n // // this.container.classList.add('sliding');\n // }\n\n // window.requestAnimationFrame(() => {\n const width = prevTabContent.getBoundingClientRect().width;\n /* tabContent.style.setProperty('--width', width + 'px');\n prevTabContent.style.setProperty('--width', width + 'px');\n\n tabContent.classList.add('active'); */\n // void tabContent.offsetWidth; // reflow\n const elements = [tabContent, prevTabContent];\n if(toRight) elements.reverse();\n elements[0].style.transform = `translate3d(${-width}px, 0, 0)`;\n elements[1].style.transform = `translate3d(${width}px, 0, 0)`;\n\n tabContent.classList.add('active');\n void tabContent.offsetWidth; // reflow\n\n tabContent.style.transform = '';\n // });\n\n return () => {\n prevTabContent.style.transform = '';\n\n // if(scrollableContainer) {\n // // Jolly Cobra's // Workaround for scrollable content flickering during animation.\n // if(isSafari) { // ! safari doesn't respect sticky header, so it flicks when overflow is changing\n // scrollableContainer.style.display = 'none';\n // }\n\n // scrollableContainer.style.overflowY = '';\n\n // if(isSafari) {\n // void scrollableContainer.offsetLeft; // reflow\n // scrollableContainer.style.display = '';\n // }\n\n // // scrollableContainer.style.paddingRight = '0';\n // // this.container.classList.remove('sliding');\n // }\n };\n },\n animateFirst: false\n});\n\nconst slideTopics = makeTransitionFunction({\n callback: (tabContent, prevTabContent) => {\n const rect = tabContent.getBoundingClientRect();\n const offsetX = rect.width - 80;\n\n tabContent.style.transform = `transformX(${offsetX}px)`;\n\n tabContent.classList.add('active');\n void tabContent.offsetWidth; // reflow\n\n tabContent.style.transform = '';\n\n return () => {};\n },\n animateFirst: true\n});\n\nconst transitions: {[type in TransitionSliderType]?: TransitionFunction} = {\n navigation: slideNavigation,\n tabs: slideTabs\n // topics: slideTopics\n};\n\ntype TransitionSliderType = 'tabs' | 'navigation' | 'zoom-fade' | 'slide-fade' | 'topics' | 'none'/* | 'counter' */;\n\ntype TransitionSliderOptions = {\n content: HTMLElement,\n type: TransitionSliderType,\n transitionTime: number,\n onTransitionEnd?: (id: number) => void,\n isHeavy?: boolean,\n once?: boolean,\n withAnimationListener?: boolean,\n listenerSetter?: ListenerSetter,\n animateFirst?: boolean\n};\n\ntype TransitionFunction = {\n callback: (tabContent: HTMLElement, prevTabContent: HTMLElement, toRight: boolean) => () => void,\n animateFirst: boolean\n};\n\nconst TransitionSlider = (options: TransitionSliderOptions) => {\n let {\n content,\n type,\n transitionTime,\n onTransitionEnd,\n isHeavy = true,\n once = false,\n withAnimationListener = true,\n listenerSetter,\n animateFirst = false\n } = options;\n\n const {callback: animationFunction, animateFirst: _animateFirst} = transitions[type] || {};\n content.dataset.animation = type;\n\n if(_animateFirst !== undefined) {\n animateFirst = _animateFirst;\n }\n\n const onTransitionEndCallbacks: Map = new Map();\n let animationDeferred: CancellablePromise;\n // let animationStarted = 0;\n let from: HTMLElement = null;\n\n if(withAnimationListener) {\n const listenerName = animationFunction ? 'transitionend' : 'animationend';\n\n const onEndEvent = (e: TransitionEvent | AnimationEvent) => {\n cancelEvent(e);\n\n if((e.target as HTMLElement).parentElement !== content) {\n return;\n }\n\n // console.log('Transition: transitionend', /* content, */ e, selectTab.prevId, performance.now() - animationStarted);\n\n const callback = onTransitionEndCallbacks.get(e.target as HTMLElement);\n callback?.();\n\n if(e.target !== from) {\n return;\n }\n\n if(!animationDeferred && isHeavy) return;\n\n if(animationDeferred) {\n animationDeferred.resolve();\n animationDeferred = undefined;\n }\n\n onTransitionEnd?.(selectTab.prevId());\n\n content.classList.remove('animating', 'backwards', 'disable-hover');\n\n if(once) {\n if(listenerSetter) listenerSetter.removeManual(content, listenerName, onEndEvent);\n else content.removeEventListener(listenerName, onEndEvent/* , {capture: false} */);\n from = animationDeferred = undefined;\n onTransitionEndCallbacks.clear();\n }\n };\n\n // TODO: check for transition type (transform, etc) using by animationFunction\n if(listenerSetter) listenerSetter.add(content)(listenerName, onEndEvent);\n else content.addEventListener(listenerName, onEndEvent/* , {passive: true, capture: false} */);\n }\n\n function selectTab(id: number | HTMLElement, animate = true, overrideFrom?: typeof from) {\n if(overrideFrom) {\n from = overrideFrom;\n }\n\n if(id instanceof HTMLElement) {\n id = whichChild(id);\n }\n\n const prevId = selectTab.prevId();\n if(id === prevId) return false;\n\n // console.log('selectTab id:', id);\n\n const to = content.children[id] as HTMLElement;\n\n if(!liteMode.isAvailable('animations') || (prevId === -1 && !animateFirst)) {\n animate = false;\n }\n\n if(!withAnimationListener) {\n const timeout = content.dataset.timeout;\n if(timeout !== undefined) {\n clearTimeout(+timeout);\n }\n\n delete content.dataset.timeout;\n }\n\n if(!animate) {\n if(from) from.classList.remove('active', 'to', 'from');\n else if(to) { // fix instant opening back from closed slider (e.g. instant closening and opening right sidebar)\n const callback = onTransitionEndCallbacks.get(to);\n callback?.();\n }\n\n if(to) {\n to.classList.remove('to', 'from');\n to.classList.add('active');\n }\n\n content.classList.remove('animating', 'backwards', 'disable-hover');\n\n from = to;\n\n onTransitionEnd?.(id);\n return;\n }\n\n if(!withAnimationListener) {\n content.dataset.timeout = '' + window.setTimeout(() => {\n to.classList.remove('to');\n from && from.classList.remove('from');\n content.classList.remove('animating', 'backwards', 'disable-hover');\n delete content.dataset.timeout;\n }, transitionTime);\n }\n\n if(from) {\n from.classList.remove('to');\n from.classList.add('from');\n }\n\n content.classList.add('animating'/* , 'disable-hover' */);\n const toRight = prevId < id;\n content.classList.toggle('backwards', !toRight);\n\n let onTransitionEndCallback: ReturnType;\n if(!to) {\n // prevTabContent.classList.remove('active');\n } else {\n if(animationFunction) {\n onTransitionEndCallback = animationFunction(to, from, toRight);\n } else {\n to.classList.add('active');\n }\n\n to.classList.remove('from');\n to.classList.add('to');\n }\n\n if(to) {\n const transitionTimeout = to.dataset.transitionTimeout;\n if(transitionTimeout) {\n clearTimeout(+transitionTimeout);\n }\n\n onTransitionEndCallbacks.set(to, () => {\n to.classList.remove('to');\n onTransitionEndCallbacks.delete(to);\n });\n }\n\n if(from/* && false */) {\n let timeout: number;\n const _from = from;\n const callback = () => {\n clearTimeout(timeout);\n _from.classList.remove('active', 'from');\n\n onTransitionEndCallback?.();\n\n onTransitionEndCallbacks.delete(_from);\n };\n\n if(to) {\n timeout = window.setTimeout(callback, transitionTime + 100); // something happened to container\n onTransitionEndCallbacks.set(_from, callback);\n } else {\n timeout = window.setTimeout(callback, transitionTime);\n onTransitionEndCallbacks.set(_from, () => {\n clearTimeout(timeout);\n onTransitionEndCallbacks.delete(_from);\n });\n }\n\n _from.dataset.transitionTimeout = '' + timeout;\n\n if(isHeavy) {\n if(!animationDeferred) {\n animationDeferred = deferredPromise();\n // animationStarted = performance.now();\n }\n\n dispatchHeavyAnimationEvent(animationDeferred, transitionTime * 2);\n }\n }\n\n from = to;\n }\n\n // selectTab.prevId = -1;\n selectTab.prevId = () => from ? whichChild(from) : -1;\n selectTab.getFrom = () => from;\n selectTab.setFrom = (_from: HTMLElement) => from = _from;\n\n return selectTab;\n};\n\nexport default TransitionSlider;\n","export default function isUsernameValid(username: string) {\n return ((username.length >= 3 && username.length <= 32) || !username.length) && /^[a-zA-Z0-9_]*$/.test(username);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ListenerSetter from '../helpers/listenerSetter';\nimport debounce from '../helpers/schedulers/debounce';\nimport {LangPackKey} from '../lib/langPack';\nimport InputField, {InputFieldOptions, InputState} from './inputField';\nimport isUsernameValid from '../lib/richTextProcessor/isUsernameValid';\nimport {AppManagers} from '../lib/appManagers/managers';\n\nexport class UsernameInputField extends InputField {\n private checkUsernamePromise: Promise;\n private checkUsernameDebounced: (username: string) => void;\n public options: InputFieldOptions & {\n peerId?: PeerId,\n listenerSetter: ListenerSetter,\n onChange?: () => void,\n invalidText: LangPackKey,\n takenText: LangPackKey,\n availableText: LangPackKey,\n head?: string\n };\n public error: ApiError;\n\n constructor(\n options: UsernameInputField['options'],\n private managers: AppManagers\n ) {\n super(options);\n\n this.checkUsernameDebounced = debounce(this.checkUsername.bind(this), 150, false, true);\n\n options.listenerSetter.add(this.input)('input', () => {\n const value = this.getValue();\n\n this.error = undefined;\n if(value === this.originalValue || !value.length) {\n this.setState(InputState.Neutral);\n this.options.onChange?.();\n return;\n } else if(!isUsernameValid(value)) { // does not check the last underscore\n this.setError(this.options.invalidText);\n } else {\n this.setState(InputState.Neutral);\n }\n\n if(this.input.classList.contains('error')) {\n this.options.onChange?.();\n return;\n }\n\n this.checkUsernameDebounced(value);\n });\n }\n\n public getValue() {\n let value = this.value;\n if(this.options.head) {\n value = value.slice(this.options.head.length);\n this.setValueSilently(this.options.head + value);\n }\n\n return value;\n }\n\n private checkUsername(username: string) {\n if(this.checkUsernamePromise) return;\n\n this.error = undefined;\n let checkPromise: Promise\n if(this.options.peerId) {\n checkPromise = this.managers.appChatsManager.checkUsername(this.options.peerId.toChatId(), username);\n } else {\n checkPromise = this.managers.appUsersManager.checkUsername(username);\n }\n\n const promise = this.checkUsernamePromise = checkPromise.then((available) => {\n if(this.getValue() !== username) return;\n\n if(available) {\n this.setState(InputState.Valid, this.options.availableText);\n } else {\n this.setError(this.options.takenText);\n }\n }, (err) => {\n if(this.getValue() !== username) return;\n\n this.error = err;\n switch((err as ApiError).type) {\n case 'USERNAME_PURCHASE_AVAILABLE': {\n this.setError(this.options.takenText);\n break;\n }\n\n case 'USERNAME_INVALID':\n default: {\n this.setError(this.options.invalidText);\n break;\n }\n }\n }).then(() => {\n if(this.checkUsernamePromise === promise) {\n this.checkUsernamePromise = undefined;\n }\n\n this.options.onChange?.();\n\n const value = this.getValue();\n if(value !== username && this.isValidToChange() && isUsernameValid(value)) {\n this.checkUsername(value);\n }\n });\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport findUpAsChild from '../helpers/dom/findUpAsChild';\nimport placeCaretAtEnd from '../helpers/dom/placeCaretAtEnd';\nimport positionElementByIndex from '../helpers/dom/positionElementByIndex';\nimport Sortable from '../helpers/dom/sortable';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport {Middleware} from '../helpers/middleware';\nimport noop from '../helpers/noop';\nimport SortedList, {SortedElementBase} from '../helpers/sortedList';\nimport {Chat, User, Username} from '../layer';\nimport {i18n, LangPackKey} from '../lib/langPack';\nimport rootScope from '../lib/rootScope';\nimport confirmationPopup from './confirmationPopup';\nimport Row from './row';\nimport SettingSection from './settingSection';\nimport {UsernameInputField} from './usernameInputField';\n\nexport default class UsernamesSection extends SettingSection {\n // public section: SettingSection;\n\n constructor(options: {\n peerId: PeerId,\n peer: Chat.channel | User.user,\n listenerSetter: ListenerSetter,\n usernameInputField: UsernameInputField,\n middleware: Middleware\n }) {\n /* const section = this.section = new SettingSection */super({\n name: 'UsernamesProfileHeader',\n caption: !options.peerId.isUser() ? 'UsernamesChannelHelp' : 'UsernamesProfileHelp'\n });\n\n const {peerId, peer, usernameInputField, listenerSetter, middleware} = options;\n const managers = rootScope.managers;\n const channelId = peerId.isUser() ? undefined : peerId.toChatId();\n\n const section = this;\n\n const CLASS_NAME = 'usernames';\n const list = document.createElement('div');\n list.classList.add(CLASS_NAME);\n\n let _usernames: Username[];\n\n interface SortedUsername extends SortedElementBase {\n row: Row\n }\n\n const sortedList = new SortedList({\n getIndex: (element) => _usernames.length - _usernames.findIndex((username) => username.username === element.id),\n onDelete: (element) => {\n element.row.container.remove();\n },\n onSort: (element, idx) => {\n positionElementByIndex(element.row.container, list, idx);\n },\n onElementCreate: (base) => {\n const username = _usernames.find((username) => username.username === base.id);\n const row = new Row({\n title: '@' + username.username,\n subtitle: true,\n clickable: true\n });\n\n const editable = !!username.pFlags.editable;\n const active = !!username.pFlags.active;\n\n if(editable) row.container.dataset.editable = '1';\n row.container.dataset.username = username.username;\n row.container.classList.add(CLASS_NAME + '-username');\n row.subtitle.classList.add(CLASS_NAME + '-username-status');\n const media = row.createMedia('medium');\n media.classList.add(CLASS_NAME + '-username-icon', 'tgico');\n\n row.makeSortable();\n\n changeActive(row, active);\n\n (base as SortedUsername).row = row;\n\n return base as SortedUsername;\n }\n });\n\n const changeActive = (row: Row, active: boolean) => {\n row.subtitle.replaceChildren(i18n(row.container.dataset.editable ? 'UsernameLinkEditable' : (active ? 'UsernameLinkActive' : 'UsernameLinkInactive')));\n row.container.classList.toggle('active', active);\n row.toggleSorting(active);\n };\n\n const applyUsernames = (usernames: Username[] = []) => {\n _usernames = usernames;\n\n sortedList.getAll().forEach((element) => {\n if(!usernames.some((username) => username.username === element.id)) {\n sortedList.delete(element.id);\n }\n });\n\n usernames.forEach((username) => {\n if(!sortedList.has(username.username)) {\n sortedList.add(username.username);\n } else {\n const element = sortedList.get(username.username);\n sortedList.update(username.username, element);\n changeActive(element.row, !!username.pFlags.active);\n }\n });\n\n section.container.classList.toggle('hide', !sortedList.getAll().size);\n };\n\n applyUsernames(peer.usernames);\n\n listenerSetter.add(rootScope)('peer_title_edit', async({peerId: _peerId}) => {\n if(_peerId !== peerId) {\n return;\n }\n\n const peer = await managers.appPeersManager.getPeer(peerId);\n applyUsernames((peer as User.user).usernames);\n });\n\n let cancelClick = false;\n attachClickEvent(list, async(e) => {\n if(cancelClick) {\n cancelClick = false;\n return;\n }\n\n const container = findUpAsChild(e.target as HTMLElement, list);\n if(!container) {\n return;\n }\n\n if(container.dataset.editable) {\n placeCaretAtEnd(usernameInputField.input, true, true);\n return;\n }\n\n const username = container.dataset.username;\n\n const active = container.classList.contains('active');\n let titleLangKey: LangPackKey, descriptionLangKey: LangPackKey;\n if(active) {\n titleLangKey = 'UsernameDeactivateLink';\n descriptionLangKey = channelId ? 'UsernameDeactivateLinkChannelMessage' : 'UsernameDeactivateLinkProfileMessage';\n } else {\n titleLangKey = 'UsernameActivateLink';\n descriptionLangKey = channelId ? 'UsernameActivateLinkChannelMessage' : 'UsernameActivateLinkProfileMessage';\n }\n\n try {\n await confirmationPopup({\n titleLangKey,\n descriptionLangKey,\n button: {\n langKey: active ? 'Hide' : 'Show'\n }\n });\n } catch(err) {\n return;\n }\n\n const newActive = !active;\n let promise: Promise;\n if(channelId) {\n promise = managers.appChatsManager.toggleUsername(channelId, username, newActive);\n } else {\n promise = managers.appUsersManager.toggleUsername(username, newActive);\n }\n\n promise.catch((err: ApiError) => {\n if(err.type === 'USERNAMES_ACTIVE_TOO_MUCH') {\n confirmationPopup({\n titleLangKey: 'UsernameActivateErrorTitle',\n descriptionLangKey: 'UsernameActivateErrorMessage',\n button: {langKey: 'OK', isCancel: true}\n }).catch(noop);\n } else {\n console.error('turn username error', err);\n }\n });\n });\n\n new Sortable({\n list,\n middleware,\n onSort: (idx, newIdx) => {\n const username = _usernames.splice(idx, 1)[0];\n _usernames.splice(newIdx, 0, username);\n sortedList.updateList();\n // can't just update particular element, have to change indexes\n // sortedList.update(username.username);\n\n const usernames = _usernames.filter((username) => username.pFlags.active).map((username) => username.username);\n if(channelId) {\n managers.appChatsManager.reorderUsernames(channelId, usernames);\n } else {\n managers.appUsersManager.reorderUsernames(usernames);\n }\n }\n });\n\n section.content.append(list);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\ntype TargetType = HTMLElement;\nexport type OnVisibilityChangeItem = {target: TargetType, visible: boolean, entry: IntersectionObserverEntry, index: number};\nexport type OnVisibilityChange = (item: OnVisibilityChangeItem) => void;\n\nexport default class VisibilityIntersector {\n private observer: IntersectionObserver;\n private items: Map = new Map();\n private locked = false;\n\n constructor(onVisibilityChange: OnVisibilityChange, options?: IntersectionObserverInit) {\n this.observer = new IntersectionObserver((entries) => {\n if(this.locked) {\n return;\n }\n\n const changed: OnVisibilityChangeItem[] = [];\n\n entries.forEach((entry, index) => {\n const target = entry.target as TargetType;\n\n if(this.items.get(target) === entry.isIntersecting) {\n return;\n } else {\n this.items.set(target, entry.isIntersecting);\n }\n\n /* if(entry.isIntersecting) {\n console.log('ooo', entry);\n } */\n\n /* if(this.locked) {\n return;\n } */\n\n const change: typeof changed[0] = {target, visible: entry.isIntersecting, entry, index};\n\n // ! order will be incorrect so can't use it\n // changed[entry.isIntersecting ? 'unshift' : 'push'](change);\n changed.push(change);\n\n // onVisibilityChange(target, entry.isIntersecting);\n });\n\n changed.forEach((item) => {\n onVisibilityChange(item);\n });\n }, options);\n }\n\n public getVisible() {\n const items: TargetType[] = [];\n this.items.forEach((value, key) => {\n if(value) {\n items.push(key);\n }\n });\n\n return items;\n }\n\n public clearVisible() {\n const visible = this.getVisible();\n for(const target of visible) {\n this.items.set(target, false);\n }\n }\n\n public isVisible(target: TargetType) {\n return this.items.get(target);\n }\n\n public disconnect() {\n this.observer.disconnect();\n this.items.clear();\n }\n\n public refresh() {\n this.observer.disconnect();\n\n // window.requestAnimationFrame(() => {\n const targets = [...this.items.keys()];\n for(const target of targets) {\n // this.items.set(target, false);\n this.observer.observe(target);\n }\n // });\n }\n\n public refreshVisible() {\n const visible = this.getVisible();\n for(const target of visible) {\n this.observer.unobserve(target);\n }\n\n for(const target of visible) {\n this.observer.observe(target);\n }\n }\n\n public observe(target: TargetType) {\n this.items.set(target, false);\n this.observer.observe(target);\n }\n\n public unobserve(target: TargetType) {\n this.observer.unobserve(target);\n this.items.delete(target);\n }\n\n public unlock() {\n this.locked = false;\n }\n\n public unlockAndRefresh() {\n this.unlock();\n this.refresh();\n }\n\n public lock() {\n this.locked = true;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport rootScope from '../lib/rootScope';\nimport appMediaPlaybackController from './appMediaPlaybackController';\nimport RangeSelector from './rangeSelector';\n\nexport default class VolumeSelector extends RangeSelector {\n private static ICONS = ['volume_off', 'volume_mute', 'volume_down', 'volume_up'];\n public btn: HTMLElement;\n protected icon: HTMLSpanElement;\n\n constructor(protected listenerSetter: ListenerSetter, protected vertical = false) {\n super({\n step: 0.01,\n min: 0,\n max: 1,\n vertical\n }, 1);\n\n this.setListeners();\n this.setHandlers({\n onScrub: currentTime => {\n const value = Math.max(Math.min(currentTime, 1), 0);\n\n // console.log('volume scrub:', currentTime, value);\n\n appMediaPlaybackController.muted = false;\n appMediaPlaybackController.volume = value;\n }\n\n /* onMouseUp: (e) => {\n cancelEvent(e.event);\n } */\n });\n\n const className = 'player-volume';\n const btn = this.btn = document.createElement('div');\n btn.classList.add('btn-icon', className);\n const icon = this.icon = document.createElement('span');\n icon.classList.add(className + '__icon');\n\n btn.append(icon, this.container);\n\n attachClickEvent(icon, this.onMuteClick, {listenerSetter: this.listenerSetter});\n this.listenerSetter.add(appMediaPlaybackController)('playbackParams', this.setVolume);\n\n this.setVolume();\n }\n\n private onMuteClick = (e?: Event) => {\n e && cancelEvent(e);\n appMediaPlaybackController.muted = !appMediaPlaybackController.muted;\n };\n\n public setVolume = () => {\n // const volume = video.volume;\n const {volume, muted} = appMediaPlaybackController;\n let d: string;\n let iconIndex: number;\n if(!volume || muted) {\n iconIndex = 0;\n } else if(volume > .5) {\n iconIndex = 3;\n } else if(volume > 0 && volume < .25) {\n iconIndex = 1;\n } else {\n iconIndex = 2;\n }\n\n VolumeSelector.ICONS.forEach((icon) => this.icon.classList.remove('tgico-' + icon));\n this.icon.classList.add('tgico-' + VolumeSelector.ICONS[iconIndex]);\n\n if(!this.mousedown) {\n this.setProgress(muted ? 0 : volume);\n }\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\n\nexport default function wrapCustomEmoji({\n docIds,\n loadPromises,\n middleware,\n lazyLoadQueue,\n customEmojiSize,\n animationGroup\n}: {\n docIds: DocId[],\n loadPromises?: Promise[]\n} & WrapSomethingOptions) {\n const text = ' '.repeat(docIds.length);\n const entities: MessageEntity[] = [];\n docIds.forEach((docId, idx) => {\n entities.push({\n _: 'messageEntityCustomEmoji',\n offset: idx,\n length: 1,\n document_id: docId\n });\n });\n\n const wrapped = wrapRichText(text, {\n entities,\n loadPromises,\n animationGroup,\n customEmojiSize,\n middleware,\n lazyLoadQueue\n });\n\n return wrapped;\n}\n\nexport function wrapCustomEmojiAwaited(options: Parameters[0]) {\n const loadPromises: Promise[] = options.loadPromises ??= [];\n const wrapped = wrapCustomEmoji(options);\n return Promise.all(loadPromises).then(() => wrapped);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport MEDIA_MIME_TYPES_SUPPORTED from '../../environment/mediaMimeTypesSupport';\nimport {CancellablePromise} from '../../helpers/cancellablePromise';\nimport {clearBadCharsAndTrim} from '../../helpers/cleanSearchText';\nimport {formatFullSentTime} from '../../helpers/date';\nimport {simulateClickEvent, attachClickEvent} from '../../helpers/dom/clickEvent';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport formatBytes from '../../helpers/formatBytes';\nimport liteMode from '../../helpers/liteMode';\nimport {MediaSizeType} from '../../helpers/mediaSizes';\nimport noop from '../../helpers/noop';\nimport {Message, MessageMedia, WebPage} from '../../layer';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport appDownloadManager, {Progress} from '../../lib/appManagers/appDownloadManager';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getDownloadMediaDetails from '../../lib/appManagers/utils/download/getDownloadMediaDetails';\nimport choosePhotoSize from '../../lib/appManagers/utils/photos/choosePhotoSize';\nimport {joinElementsWith} from '../../lib/langPack';\nimport {MAX_FILE_SAVE_SIZE} from '../../lib/mtproto/mtproto_config';\nimport wrapPlainText from '../../lib/richTextProcessor/wrapPlainText';\nimport rootScope from '../../lib/rootScope';\nimport type {ThumbCache} from '../../lib/storages/thumbs';\nimport {MediaSearchContext} from '../appMediaPlaybackController';\nimport AudioElement from '../audio';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport {MiddleEllipsisElement} from '../middleEllipsis';\nimport ProgressivePreloader from '../preloader';\nimport wrapPhoto from './photo';\nimport wrapSenderToPeer from './senderToPeer';\nimport wrapSentTime from './sentTime';\n\nrootScope.addEventListener('document_downloading', (docId) => {\n const elements = Array.from(document.querySelectorAll(`.document[data-doc-id=\"${docId}\"]`)) as HTMLElement[];\n elements.forEach((element) => {\n if(element.querySelector('.preloader-container.manual')) {\n simulateClickEvent(element);\n }\n });\n});\n\nexport default async function wrapDocument({message, withTime, fontWeight, voiceAsMusic, showSender, searchContext, loadPromises, autoDownloadSize, lazyLoadQueue, sizeType, managers = rootScope.managers, cacheContext, fontSize, getSize, canTranscribeVoice}: {\n message: Message.message,\n withTime?: boolean,\n fontWeight?: number,\n voiceAsMusic?: boolean,\n showSender?: boolean,\n searchContext?: MediaSearchContext,\n loadPromises?: Promise[],\n autoDownloadSize?: number,\n lazyLoadQueue?: LazyLoadQueue,\n sizeType?: MediaSizeType,\n managers?: AppManagers,\n cacheContext?: ThumbCache,\n fontSize?: number,\n getSize?: () => number,\n canTranscribeVoice?: boolean\n}): Promise {\n fontWeight ??= 500;\n sizeType ??= '' as any;\n fontSize ??= 16;\n const noAutoDownload = autoDownloadSize === 0;\n\n const doc = ((message.media as MessageMedia.messageMediaDocument).document || ((message.media as MessageMedia.messageMediaWebPage).webpage as WebPage.webPage).document) as MyDocument;\n const uploadFileName = message?.uploadingFileName;\n if(doc.type === 'audio' || doc.type === 'voice' || doc.type === 'round') {\n const audioElement = new AudioElement();\n audioElement.withTime = withTime;\n audioElement.message = message;\n audioElement.noAutoDownload = noAutoDownload;\n audioElement.lazyLoadQueue = lazyLoadQueue;\n audioElement.loadPromises = loadPromises;\n if(canTranscribeVoice && doc.type === 'voice') audioElement.transcriptionState = 0;\n (audioElement as any).getSize = getSize;\n\n if(voiceAsMusic) audioElement.voiceAsMusic = voiceAsMusic;\n if(searchContext) audioElement.searchContext = searchContext;\n if(showSender) audioElement.showSender = showSender;\n\n audioElement.dataset.fontWeight = '' + fontWeight;\n audioElement.dataset.fontSize = '' + fontSize;\n audioElement.dataset.sizeType = sizeType;\n await audioElement.render();\n return audioElement;\n }\n\n const extSplitted = doc.file_name ? doc.file_name.split('.') : '';\n let ext = '';\n ext = extSplitted.length > 1 && Array.isArray(extSplitted) ?\n clearBadCharsAndTrim(extSplitted.pop().split(' ', 1)[0].toLowerCase()) :\n 'file';\n\n const docDiv = document.createElement('div');\n docDiv.classList.add('document', `ext-${ext}`);\n docDiv.dataset.docId = '' + doc.id;\n (docDiv as any).doc = doc;\n\n // return docDiv;\n\n const icoDiv = document.createElement('div');\n icoDiv.classList.add('document-ico');\n let icoTextEl: HTMLElement;\n\n const hadContext = !!cacheContext;\n const getCacheContext = () => {\n return hadContext ? cacheContext : managers.thumbsStorage.getCacheContext(doc);\n };\n\n cacheContext = await getCacheContext();\n let hasThumb = false;\n if((doc.thumbs?.length || (message.pFlags.is_outgoing && cacheContext.url && doc.type === 'photo'))/* && doc.mime_type !== 'image/gif' */) {\n docDiv.classList.add('document-with-thumb');\n hasThumb = true;\n\n const imgs: (HTMLImageElement | HTMLCanvasElement | HTMLVideoElement)[] = [];\n // ! WARNING, use thumbs for check when thumb will be generated for media\n if(message.pFlags.is_outgoing && ['photo', 'video'].includes(doc.type) && cacheContext.url) {\n icoDiv.innerHTML = ``;\n imgs.push(icoDiv.firstElementChild as HTMLImageElement);\n } else {\n const perf = performance.now();\n const wrapped = await wrapPhoto({\n photo: doc,\n message: null,\n container: icoDiv,\n boxWidth: 54,\n boxHeight: 54,\n loadPromises,\n withoutPreloader: true,\n lazyLoadQueue,\n size: choosePhotoSize(doc, 54, 54, true),\n managers\n });\n // console.log('was wrapping photo', performance.now() - perf);\n icoDiv.style.width = icoDiv.style.height = '';\n if(wrapped.images.thumb) imgs.push(wrapped.images.thumb);\n if(wrapped.images.full) imgs.push(wrapped.images.full);\n }\n\n imgs.forEach((img) => img.classList.add('document-thumb'));\n } else {\n icoTextEl = document.createElement('span');\n icoTextEl.classList.add('document-ico-text');\n icoTextEl.innerText = ext;\n icoDiv.append(icoTextEl);\n }\n\n // let fileName = stringMiddleOverflow(doc.file_name || 'Unknown.file', 26);\n const fileName = doc.file_name ? wrapPlainText(doc.file_name) : 'Unknown.file';\n const descriptionEl = document.createElement('div');\n descriptionEl.classList.add('document-description');\n const bytesContainer = document.createElement('span');\n const bytesEl = formatBytes(doc.size);\n const bytesJoiner = ' / ';\n\n const descriptionParts: (HTMLElement | string | DocumentFragment)[] = [bytesEl];\n\n if(withTime) {\n descriptionParts.push(formatFullSentTime(message.date));\n }\n\n if(showSender) {\n descriptionParts.push(await wrapSenderToPeer(message));\n }\n\n if(!withTime && !showSender) {\n const b = document.createElement('span');\n const bytesMaxEl = formatBytes(doc.size);\n b.append(bytesJoiner, bytesMaxEl);\n b.style.visibility = 'hidden';\n descriptionParts.push(b);\n }\n\n docDiv.innerHTML = `\n ${(cacheContext.downloaded && !uploadFileName) || !message.mid || !hasThumb ? '' : `
`}\n
\n
\n `;\n\n const nameDiv = docDiv.querySelector('.document-name') as HTMLElement;\n const middleEllipsisEl = new MiddleEllipsisElement();\n middleEllipsisEl.dataset.fontWeight = '' + fontWeight;\n middleEllipsisEl.dataset.fontSize = '' + fontSize;\n middleEllipsisEl.dataset.sizeType = sizeType;\n (middleEllipsisEl as any).getSize = getSize;\n middleEllipsisEl.textContent = fileName;\n // setInnerHTML(middleEllipsisEl, fileName);\n\n // * new media popup\n if(!message.mid) {\n docDiv.classList.add('downloaded');\n }\n\n nameDiv.append(middleEllipsisEl);\n\n if(showSender) {\n nameDiv.append(wrapSentTime(message));\n }\n\n const sizeDiv = docDiv.querySelector('.document-size') as HTMLElement;\n bytesContainer.append(...joinElementsWith(descriptionParts, ' · '));\n sizeDiv.append(bytesContainer);\n\n docDiv.prepend(icoDiv);\n\n if(!uploadFileName && message.pFlags.is_outgoing && !message.mid) {\n return docDiv;\n }\n\n let downloadDiv: HTMLElement, preloader: ProgressivePreloader = null;\n const onLoad = () => {\n docDiv.classList.remove('downloading');\n\n if(/* !hasThumb || */(doc.size > MAX_FILE_SAVE_SIZE && !uploadFileName)) {\n preloader.setManual();\n preloader.attach(downloadDiv);\n preloader.preloader.classList.add('manual');\n preloader.setDownloadFunction(load);\n return;\n }\n\n if(doc.size <= MAX_FILE_SAVE_SIZE) {\n docDiv.classList.add('downloaded');\n }\n\n if(downloadDiv) {\n if(downloadDiv !== icoDiv) {\n const _downloadDiv = downloadDiv;\n setTimeout(() => {\n _downloadDiv.remove();\n }, 200);\n }\n\n downloadDiv = null;\n }\n\n if(preloader) {\n preloader = null;\n }\n };\n\n const addByteProgress = (promise: CancellablePromise) => {\n docDiv.classList.add('downloading');\n\n const sizeContainer = document.createElement('span');\n const _bytesContainer = formatBytes(doc.size);\n sizeContainer.style.position = 'absolute';\n sizeContainer.style.left = '0';\n promise.then(onLoad, noop).finally(() => {\n // sizeContainer.replaceWith(bytesContainer);\n bytesContainer.style.visibility = '';\n sizeContainer.remove();\n // b && b.classList.remove('hide');\n });\n\n // b && b.classList.add('hide');\n\n const format = (bytes: number) => formatBytes(bytes);\n let d = format(0);\n bytesContainer.style.visibility = 'hidden';\n // bytesContainer.replaceWith(sizeContainer);\n sizeContainer.append(d, bytesJoiner, _bytesContainer);\n bytesContainer.parentElement.append(sizeContainer);\n promise.addNotifyListener((progress: Progress) => {\n const _d = format(progress.done);\n d.replaceWith(_d);\n d = _d;\n });\n };\n\n // ! DO NOT USE ASYNC/AWAIT HERE ! SAFARI WON'T LET DOWNLOAD THE FILE BECAUSE OF ASYNC\n const load = (e?: Event) => {\n const save = !e || e.isTrusted;\n const doc = (docDiv as any).doc;\n // const doc = await managers.appDocsManager.getDoc(docDiv.dataset.docId);\n let download: CancellablePromise;\n const queueId = appImManager.chat.bubbles ? appImManager.chat.bubbles.lazyLoadQueue.queueId : undefined;\n if(!save) {\n download = appDownloadManager.downloadToDisc({media: doc, queueId}, true);\n } else if(doc.type === 'pdf') {\n const canOpenAfter = /* managers.appDocsManager.downloading.has(doc.id) || */!preloader || preloader.detached;\n download = appDownloadManager.downloadMediaURL({media: doc, queueId});\n if(canOpenAfter) {\n download.then(() => {\n setTimeout(async() => { // wait for preloader animation end\n const url = (await getCacheContext()).url;\n window.open(url);\n }, liteMode.isAvailable('animations') ? 250 : 0);\n });\n }\n } else if(MEDIA_MIME_TYPES_SUPPORTED.has(doc.mime_type) && doc.thumbs?.length) {\n download = appDownloadManager.downloadMediaURL({media: doc, queueId});\n } else {\n download = appDownloadManager.downloadToDisc({media: doc, queueId});\n }\n\n download.catch(() => {\n docDiv.classList.remove('downloading');\n });\n\n if(downloadDiv) {\n preloader.attach(downloadDiv, true, download);\n addByteProgress(download);\n }\n };\n\n const {fileName: downloadFileName} = getDownloadMediaDetails({media: doc, downloadId: '1'});\n if(await managers.apiFileManager.isDownloading(downloadFileName)) {\n downloadDiv = docDiv.querySelector('.document-download') || icoDiv;\n const promise = appDownloadManager.downloadToDisc({media: doc}, true);\n\n preloader = new ProgressivePreloader();\n preloader.attach(downloadDiv, false, promise);\n preloader.setDownloadFunction(load);\n addByteProgress(promise);\n } else if(!cacheContext.downloaded || uploadFileName) {\n downloadDiv = docDiv.querySelector('.document-download') || icoDiv;\n preloader = new ProgressivePreloader({\n isUpload: !!uploadFileName\n });\n\n if(!uploadFileName) {\n preloader.construct();\n preloader.setManual();\n preloader.attach(downloadDiv);\n preloader.setDownloadFunction(load);\n\n if(autoDownloadSize !== undefined && autoDownloadSize >= doc.size) {\n simulateClickEvent(preloader.preloader);\n }\n } else {\n const uploadPromise = appDownloadManager.getUpload(uploadFileName);\n preloader.attachPromise(uploadPromise);\n preloader.attach(downloadDiv);\n addByteProgress(uploadPromise);\n }\n }\n\n attachClickEvent(docDiv, (e) => {\n if(findUpClassName(e.target, 'time')) { // prevent downloading by clicking on time\n return;\n }\n\n if(preloader) {\n preloader.onClick(e);\n } else {\n load(e);\n }\n });\n\n return docDiv;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {formatPhoneNumber} from '../../helpers/formatPhoneNumber';\n\nexport default function formatUserPhone(phone: string) {\n return '+' + formatPhoneNumber(phone).formatted;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport numberThousandSplitter from '../../helpers/number/numberThousandSplitter';\nimport {Chat, ChatParticipants} from '../../layer';\nimport {i18n, LangPackKey} from '../../lib/langPack';\nimport rootScope from '../../lib/rootScope';\n\nexport default async function getChatMembersString(chatId: ChatId, managers = rootScope.managers) {\n const chat: Chat = await managers.appChatsManager.getChat(chatId);\n if(chat._ === 'chatForbidden') {\n return i18n('YouWereKicked');\n }\n\n const chatFull = await managers.appProfileManager.getCachedFullChat(chatId);\n let count: number;\n if(chatFull) {\n if(chatFull._ === 'channelFull') {\n count = chatFull.participants_count;\n } else {\n count = (chatFull.participants as ChatParticipants.chatParticipants).participants?.length;\n }\n } else {\n count = (chat as Chat.chat).participants_count || (chat as any).participants?.participants.length;\n }\n\n const isBroadcast = (chat as Chat.channel).pFlags.broadcast;\n count = count || 1;\n\n const key: LangPackKey = isBroadcast ? 'Peer.Status.Subscribers' : 'Peer.Status.Member';\n return i18n(key, [numberThousandSplitter(count)]);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport _limitSymbols from '../../helpers/string/limitSymbols';\nimport {Chat} from '../../layer';\nimport getPeerActiveUsernames from '../../lib/appManagers/utils/peers/getPeerActiveUsernames';\nimport I18n from '../../lib/langPack';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport rootScope from '../../lib/rootScope';\n\ntype GetPeerTitleOptions = {\n peerId: PeerId,\n plainText?: boolean,\n onlyFirstName?: boolean,\n limitSymbols?: number,\n threadId?: number\n} & Pick;\n\nexport default async function getPeerTitle(\n options: T\n): Promise {\n const {\n peerId = rootScope.myId,\n plainText,\n onlyFirstName,\n limitSymbols,\n managers = rootScope.managers,\n threadId\n } = options;\n\n let title = '';\n if(peerId.isUser()) {\n const user = await managers.appUsersManager.getUser(peerId.toUserId());\n if(user) {\n if(user.first_name) title += user.first_name;\n if(user.last_name && (!onlyFirstName || !title)) title += ' ' + user.last_name;\n }\n\n if(!title) title = !user || user.pFlags.deleted ? I18n.format(onlyFirstName ? 'Deleted' : 'HiddenName', true) : getPeerActiveUsernames(user)[0] || '';\n else title = title.trim();\n } else {\n if(threadId) {\n const topic = await managers.dialogsStorage.getForumTopic(peerId, threadId);\n title = topic?.title || '';\n }\n\n if(!title) {\n const chat = await managers.appChatsManager.getChat(peerId.toChatId()) as Chat.chat;\n title = chat?.title || '';\n }\n\n if(onlyFirstName) {\n title = title.split(' ')[0];\n }\n }\n\n if(limitSymbols !== undefined) {\n title = _limitSymbols(title, limitSymbols, limitSymbols);\n }\n\n return plainText ? title : wrapEmojiText(title) as any;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {formatFullSentTimeRaw} from '../../helpers/date';\nimport {User} from '../../layer';\nimport {LangPackKey, i18n} from '../../lib/langPack';\nimport {REPLIES_PEER_ID, SERVICE_PEER_ID} from '../../lib/mtproto/mtproto_config';\n\nexport default function getUserStatusString(user: User.user): HTMLElement {\n if(!user) {\n return document.createElement('span');\n }\n\n let key: LangPackKey;\n let args: any[];\n\n switch(user.id) {\n case REPLIES_PEER_ID.toUserId():\n key = 'Peer.RepliesNotifications';\n break;\n case SERVICE_PEER_ID.toUserId():\n key = 'Peer.ServiceNotifications';\n break;\n default: {\n if(user.pFlags.bot) {\n key = 'Bot';\n break;\n }\n\n if(user.pFlags.support) {\n key = 'SupportStatus';\n break;\n }\n\n switch(user.status?._) {\n case 'userStatusRecently': {\n key = 'Lately';\n break;\n }\n\n case 'userStatusLastWeek': {\n key = 'WithinAWeek';\n break;\n }\n\n case 'userStatusLastMonth': {\n key = 'WithinAMonth';\n break;\n }\n\n case 'userStatusOffline': {\n const date = user.status.was_online;\n const today = new Date();\n const now = today.getTime() / 1000 | 0;\n\n const diff = now - date;\n if(diff < 60) {\n key = 'Peer.Status.justNow';\n } else if(diff < 3600) {\n key = 'Peer.Status.minAgo';\n const c = diff / 60 | 0;\n args = [c];\n } else if(diff < 86400 && today.getDate() === new Date(date * 1000).getDate()) {\n key = 'LastSeen.HoursAgo';\n const c = diff / 3600 | 0;\n args = [c];\n } else {\n key = 'Peer.Status.LastSeenAt';\n const {dateEl, timeEl} = formatFullSentTimeRaw(date);\n args = [dateEl, timeEl];\n }\n\n break;\n }\n\n case 'userStatusOnline': {\n key = 'Online';\n break;\n }\n\n default: {\n key = 'ALongTimeAgo';\n break;\n }\n }\n\n break;\n }\n }\n\n return i18n(key, args);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport getImageFromStrippedThumb from '../../helpers/getImageFromStrippedThumb';\nimport noop from '../../helpers/noop';\nimport {Document, Photo, PhotoSize} from '../../layer';\nimport DotRenderer from '../dotRenderer';\nimport SetTransition from '../singleTransition';\n\nexport function toggleMediaSpoiler(options: {\n mediaSpoiler: HTMLElement,\n reveal: boolean,\n destroyAfter?: boolean\n}) {\n const {mediaSpoiler, reveal, destroyAfter} = options;\n SetTransition({\n element: mediaSpoiler,\n forwards: reveal,\n className: 'is-revealing',\n duration: 250,\n onTransitionEnd: () => {\n if(reveal && destroyAfter) {\n mediaSpoiler.remove();\n mediaSpoiler.middlewareHelper.destroy();\n }\n }\n });\n}\n\nexport function onMediaSpoilerClick(options: {\n mediaSpoiler: HTMLElement,\n event: Event\n}) {\n const {mediaSpoiler, event} = options;\n cancelEvent(event);\n\n if(mediaSpoiler.classList.contains('is-revealing')) {\n return;\n }\n\n const video = mediaSpoiler.parentElement.querySelector('video');\n if(video && !mediaSpoiler.parentElement.querySelector('.video-play')) {\n video.autoplay = true;\n video.play().catch(noop);\n }\n\n toggleMediaSpoiler({\n mediaSpoiler,\n reveal: true,\n destroyAfter: true\n });\n}\n\nexport function wrapMediaSpoilerWithImage(options: {\n image: Awaited>['image']\n} & Parameters[0]) {\n const {middleware, image} = options;\n if(!middleware()) {\n return;\n }\n\n image.classList.add('media-spoiler-thumbnail');\n\n const container = document.createElement('div');\n container.classList.add('media-spoiler-container');\n container.middlewareHelper = middleware.create();\n\n const dotRenderer = DotRenderer.create({\n ...options,\n middleware: container.middlewareHelper.get()\n });\n\n container.append(image, dotRenderer.canvas);\n\n return container;\n}\n\nexport default async function wrapMediaSpoiler(\n options: Omit[0], 'image'> & {\n media: Document.document | Photo.photo\n }\n) {\n const {media} = options;\n const sizes = (media as Photo.photo).sizes || (media as Document.document).thumbs;\n const thumb = sizes.find((size) => size._ === 'photoStrippedSize') as PhotoSize.photoStrippedSize;\n if(!thumb) {\n return;\n }\n\n const {image, loadPromise} = getImageFromStrippedThumb(media, thumb, true);\n await loadPromise;\n\n return wrapMediaSpoilerWithImage({\n ...options,\n image\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyMessage} from '../../lib/appManagers/appMessagesManager';\nimport wrapMessageActionTextNewUnsafe from './messageActionTextNewUnsafe';\n\nexport type WrapMessageActionTextOptions = {\n message: MyMessage,\n plain?: boolean,\n noLinks?: boolean\n} & WrapSomethingOptions;\n\nexport default async function wrapMessageActionTextNew(\n options: T\n): Promise {\n try {\n return await wrapMessageActionTextNewUnsafe(options) as any;\n } catch(err) {\n console.error('wrapMessageActionTextNewUnsafe error:', err);\n return options.plain ? '' : document.createElement('span') as any;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {hexaToHsla} from '../helpers/color';\nimport {TOPIC_COLORS} from '../lib/mtproto/mtproto_config';\nimport wrapAbbreviation from '../lib/richTextProcessor/wrapAbbreviation';\n\nlet svg: SVGSVGElement, span: HTMLElement, defs: HTMLElement;\nconst hadColors: Map = new Map();\nexport default function topicAvatar(color: number, content: string) {\n if(!svg) {\n defs = document.getElementById('svg-defs') as HTMLElement;\n\n const ns = 'http://www.w3.org/2000/svg';\n\n svg = document.createElementNS(ns, 'svg');\n svg.setAttributeNS(null, 'width', '26');\n svg.setAttributeNS(null, 'height', '26');\n svg.setAttributeNS(null, 'viewBox', '0 0 26 26');\n svg.classList.add('topic-icon-svg');\n\n const use = document.createElementNS(ns, 'use');\n use.setAttributeNS(null, 'href', '#topic-icon');\n svg.append(use);\n\n span = document.createElement('span');\n span.classList.add('topic-icon', 'avatar-like');\n\n const contentSpan = document.createElement('span');\n contentSpan.classList.add('topic-icon-content');\n span.append(svg, contentSpan);\n }\n\n if(!color) {\n console.error('NO TOPIC ICON COLOR!');\n color = TOPIC_COLORS[0];\n }\n\n if(!content) {\n console.error('NO TOPIC NAME!');\n content = '';\n }\n\n const hex = color.toString(16);\n\n const gradientId = `topic-icon-gradient-${color}`;\n let strokeColor = hadColors.get(color);\n if(!strokeColor) {\n const {h, s, l, a} = hexaToHsla('#' + hex);\n defs.insertAdjacentHTML('beforeend', `\n \n \n \n \n `);\n\n hadColors.set(color, strokeColor = `hsla(${h}, ${s}%, ${Math.max(0, l - 40)}%, ${a})`);\n }\n\n const clone = span.cloneNode(true) as typeof span;\n (clone.firstElementChild as HTMLElement).style.fill = `url(#${gradientId})`;\n // (clone.firstElementChild as HTMLElement).style.stroke = `var(--peer-avatar-${color}-filled)`;\n (clone.firstElementChild as HTMLElement).style.stroke = strokeColor;\n clone.lastElementChild.append(wrapAbbreviation(content, true));\n return clone;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Message, MessageAction} from '../../layer';\nimport wrapUrl from '../../lib/richTextProcessor/wrapUrl';\n\nexport default function wrapJoinVoiceChatAnchor(message: Message.messageService) {\n const action = message.action as MessageAction.messageActionInviteToGroupCall;\n const {onclick, url} = wrapUrl(`tg://voicechat?chat_id=${message.peerId.toChatId()}&id=${action.call.id}&access_hash=${action.call.access_hash}`);\n if(!onclick) {\n return document.createElement('span');\n }\n\n const a = document.createElement('a');\n a.href = url;\n a.setAttribute('onclick', onclick + '(this)');\n\n return a;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport {formatTime, ONE_DAY} from '../../helpers/date';\nimport htmlToSpan from '../../helpers/dom/htmlToSpan';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport formatCallDuration from '../../helpers/formatCallDuration';\nimport paymentsWrapCurrencyAmount from '../../helpers/paymentsWrapCurrencyAmount';\nimport {ForumTopic, Message, MessageAction} from '../../layer';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport I18n, {FormatterArgument, FormatterArguments, i18n, join, langPack, LangPackKey, _i18n} from '../../lib/langPack';\nimport {GENERAL_TOPIC_ID} from '../../lib/mtproto/mtproto_config';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport wrapPlainText from '../../lib/richTextProcessor/wrapPlainText';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\nimport rootScope from '../../lib/rootScope';\nimport topicAvatar from '../topicAvatar';\nimport {wrapCustomEmojiAwaited} from './customEmoji';\nimport getPeerTitle from './getPeerTitle';\nimport wrapJoinVoiceChatAnchor from './joinVoiceChatAnchor';\nimport {WrapMessageActionTextOptions} from './messageActionTextNew';\nimport wrapMessageForReply, {WrapMessageForReplyOptions} from './messageForReply';\nimport wrapPeerTitle from './peerTitle';\n\nasync function wrapLinkToMessage(options: WrapMessageForReplyOptions) {\n const wrapped = await wrapMessageForReply(options);\n\n if(options.plain) {\n return wrapped;\n }\n\n const a = document.createElement('i');\n a.dataset.savedFrom = (options.message as Message.message).peerId + '_' + (options.message as Message.message).mid;\n a.dir = 'auto';\n a.append(wrapped);\n return a;\n}\n\nfunction wrapSomeText(text: string, plain?: boolean) {\n return plain ? text : htmlToSpan(wrapEmojiText(text));\n}\n\ntype WrapTopicIconOptions = {\n topic: Pick,\n plain?: boolean\n} & WrapSomethingOptions;\nexport async function wrapTopicIcon(options: T): Promise {\n const topic = options.topic;\n\n let iconEmojiId = topic?.icon_emoji_id;\n if(topic?.id === GENERAL_TOPIC_ID) {\n iconEmojiId = '5390854796011906616';\n }\n\n if(!iconEmojiId) {\n if(options.plain) return '' as any;\n\n // if(topic?.id === GENERAL_TOPIC_ID) {\n // const span = document.createElement('span');\n // span.innerHTML = `\n // \n // \n // \n // `;\n\n // span.classList.add('topic-icon');\n\n // return span as any;\n // }\n\n return topicAvatar(topic?.icon_color, topic?.title) as any;\n }\n\n return options.plain ?\n rootScope.managers.appEmojiManager.getCustomEmojiDocument(iconEmojiId).then((doc) => doc.stickerEmojiRaw) :\n wrapCustomEmojiAwaited({\n ...options,\n docIds: [iconEmojiId]\n }).then((fragment) => {\n fragment.lastElementChild.classList.add('topic-icon');\n return fragment;\n }) as any;\n}\n\nfunction wrapMessageActionTopicIcon(options: WrapMessageActionTextOptions) {\n const action = ((options.message as Message.messageService).action as MessageAction.messageActionTopicCreate);\n return wrapTopicIcon({\n ...options,\n topic: action as any as ForumTopic.forumTopic\n });\n}\n\nasync function wrapMessageActionTopicIconAndName(options: WrapMessageActionTextOptions) {\n const action = ((options.message as Message.messageService).action as MessageAction.messageActionTopicCreate);\n const span = document.createElement('span');\n span.classList.add('topic-name');\n span.append(await wrapMessageActionTopicIcon(options), wrapSomeText(action.title, options.plain));\n return span;\n}\n\nexport default async function wrapMessageActionTextNewUnsafe(options: WrapMessageActionTextOptions) {\n const {plain, message, noLinks} = options;\n const element: HTMLElement = plain ? undefined : document.createElement('span');\n const action = 'action' in message && message.action;\n\n // this.log('message action:', action);\n\n if((action as MessageAction.messageActionCustomAction).message) {\n const unsafeMessage = (action as MessageAction.messageActionCustomAction).message;\n if(plain) {\n return wrapPlainText(unsafeMessage);\n } else {\n setInnerHTML(element, wrapRichText(unsafeMessage, {noLinebreaks: true}));\n return element;\n }\n } else {\n let _ = action._;\n // let suffix = '';\n let langPackKey: LangPackKey;\n let args: Array>;\n\n const managers = rootScope.managers;\n\n const getNameDivHTML = (peerId: PeerId, plain: boolean) => {\n return plain ? getPeerTitle({peerId, plainText: plain}) : wrapPeerTitle({peerId});\n };\n\n switch(action._) {\n case 'messageActionPhoneCall': {\n _ += '.' + (action as any).type;\n\n args = [formatCallDuration(action.duration, plain)];\n break;\n }\n\n case 'messageActionGroupCall': {\n _ += '.' + (action as any).type;\n\n args = [];\n if(!_.endsWith('You') && !message.pFlags.post) {\n args.push(getNameDivHTML(message.fromId, plain));\n }\n\n if(action.duration !== undefined) {\n args.push(formatCallDuration(action.duration, plain));\n } else if(noLinks) {\n args.push('');\n } else {\n args.push(wrapJoinVoiceChatAnchor(message as any));\n }\n\n break;\n }\n\n case 'messageActionInviteToGroupCall': {\n const peerIds = [message.fromId, action.users[0].toPeerId()];\n let a = 'Chat.Service.VoiceChatInvitation';\n const myId = rootScope.myId;\n if(peerIds[0] === myId) a += 'ByYou';\n else if(peerIds[1] === myId) a += 'ForYou';\n indexOfAndSplice(peerIds, myId);\n\n langPackKey = a as LangPackKey;\n args = peerIds.map((peerId) => getNameDivHTML(peerId, plain));\n args.push(noLinks ? '' : wrapJoinVoiceChatAnchor(message as any));\n break;\n }\n\n case 'messageActionGroupCallScheduled': {\n const today = new Date();\n const date = new Date(action.schedule_date * 1000);\n const daysToStart = (date.getTime() - today.getTime()) / 86400e3;\n const tomorrowDate = new Date(today);\n tomorrowDate.setDate(tomorrowDate.getDate() + 1);\n\n const isBroadcast = await managers.appPeersManager.isBroadcast(message.peerId);\n langPackKey = isBroadcast ? 'ChatList.Service.VoiceChatScheduled.Channel' : 'ChatList.Service.VoiceChatScheduled';\n args = [];\n const myId = rootScope.myId;\n if(message.fromId === myId) {\n langPackKey += 'You';\n } else if(!isBroadcast) {\n args.push(getNameDivHTML(message.fromId, plain));\n }\n\n let k: LangPackKey;\n const _args: FormatterArguments = [];\n if(daysToStart < 1 && date.getDate() === today.getDate()) {\n k = 'TodayAtFormattedWithToday';\n } else if(daysToStart < 2 && date.getDate() === tomorrowDate.getDate()) {\n k = 'Time.TomorrowAt';\n } else {\n k = 'formatDateAtTime';\n _args.push(new I18n.IntlDateElement({\n date,\n options: {\n day: '2-digit',\n month: '2-digit',\n year: '2-digit'\n }\n }).element);\n }\n\n _args.push(formatTime(date));\n const t = i18n(k, _args);\n args.push(t);\n\n break;\n }\n\n case 'messageActionChatCreate': {\n const myId = rootScope.myId;\n if(message.fromId === myId) {\n _ += 'You';\n } else {\n args = [getNameDivHTML(message.fromId, plain)];\n }\n\n break;\n }\n\n case 'messageActionPinMessage': {\n const peerId = message.peerId;\n const pinnedMessage = await managers.appMessagesManager.getMessageByPeer(peerId, message.reply_to_mid);\n\n args = [\n getNameDivHTML(message.fromId, plain)\n ];\n\n if(!pinnedMessage/* || true */) {\n langPackKey = 'ActionPinnedNoText';\n\n if(message.reply_to_mid) { // refresh original message\n managers.appMessagesManager.fetchMessageReplyTo(message);\n }\n } else {\n args.push(wrapLinkToMessage({\n ...options,\n message: pinnedMessage\n }));\n }\n\n break;\n }\n\n case 'messageActionChatJoinedByRequest': {\n const isBroadcast = await managers.appPeersManager.isBroadcast(message.peerId);\n if(message.pFlags.out) {\n langPackKey = isBroadcast ? 'RequestToJoinChannelApproved' : 'RequestToJoinGroupApproved';\n } else {\n langPackKey = isBroadcast ? 'ChatService.UserJoinedChannelByRequest' : 'ChatService.UserJoinedGroupByRequest';\n args = [getNameDivHTML(message.fromId, plain)];\n }\n break;\n }\n\n case 'messageActionContactSignUp':\n case 'messageActionChatReturn':\n case 'messageActionChatLeave':\n case 'messageActionChatJoined':\n case 'messageActionChatEditPhoto':\n case 'messageActionChatDeletePhoto':\n case 'messageActionChatEditVideo':\n case 'messageActionChatJoinedByLink':\n case 'messageActionChannelEditVideo':\n case 'messageActionChannelDeletePhoto': {\n args = [getNameDivHTML(message.fromId, plain)];\n break;\n }\n\n case 'messageActionChannelEditTitle':\n case 'messageActionChatEditTitle': {\n args = [];\n if(action._ === 'messageActionChatEditTitle') {\n args.push(getNameDivHTML(message.fromId, plain));\n }\n\n args.push(wrapSomeText(action.title));\n break;\n }\n\n case 'messageActionChatDeleteUser':\n case 'messageActionChatAddUsers':\n case 'messageActionChatAddUser': {\n const users = (action as MessageAction.messageActionChatAddUser).users ||\n [(action as MessageAction.messageActionChatDeleteUser).user_id];\n\n args = [getNameDivHTML(message.fromId, plain)];\n\n if(users.length > 1) {\n const joined = join(\n await Promise.all(users.map((userId: UserId) => getNameDivHTML(userId.toPeerId(), plain))),\n false,\n plain\n );\n\n if(plain) {\n args.push(...joined);\n } else {\n const fragment = document.createElement('span');\n fragment.append(...joined);\n args.push(fragment);\n }\n } else {\n args.push(getNameDivHTML(users[0].toPeerId(), plain));\n }\n\n break;\n }\n\n case 'messageActionBotAllowed': {\n const anchorHTML = wrapRichText(action.domain, {\n entities: [{\n _: 'messageEntityUrl',\n length: action.domain.length,\n offset: 0\n }],\n noLinks\n });\n\n const node = htmlToSpan(anchorHTML);\n\n args = [node];\n break;\n }\n\n case 'messageActionPaymentSent': {\n const isRecurringInit = action.pFlags.recurring_init;\n const isRecurringUsed = action.pFlags.recurring_used;\n langPackKey = isRecurringUsed ? 'Chat.Service.PaymentSentRecurringUsedNoTitle' : (isRecurringInit ? 'Chat.Service.PaymentSentRecurringInitNoTitle' : 'Chat.Service.PaymentSent1NoTitle');\n const price = paymentsWrapCurrencyAmount(action.total_amount, action.currency);\n args = [price, getNameDivHTML(message.peerId, plain)];\n\n if(message.reply_to_mid) {\n const invoiceMessage = await managers.appMessagesManager.getMessageByPeer(\n message.reply_to?.reply_to_peer_id ? getPeerId(message.reply_to.reply_to_peer_id) : message.peerId,\n message.reply_to_mid\n );\n\n if(!invoiceMessage) {\n managers.appMessagesManager.fetchMessageReplyTo(message);\n } else {\n langPackKey = isRecurringUsed ? 'Chat.Service.PaymentSentRecurringUsed' : (isRecurringInit ? 'Chat.Service.PaymentSentRecurringInit' : 'Chat.Service.PaymentSent1');\n args.push(wrapLinkToMessage({\n ...options,\n message: invoiceMessage\n }).then((el) => {\n if(el instanceof HTMLElement) {\n el.classList.add('is-receipt-link');\n }\n\n return el;\n }));\n }\n }\n\n break;\n }\n\n case 'messageActionSetMessagesTTL': {\n args = [];\n\n const isBroadcast = await managers.appPeersManager.isBroadcast(message.peerId);\n if(action.period) {\n if(isBroadcast) {\n langPackKey = 'ActionTTLChannelChanged';\n } else if(message.fromId === rootScope.myId) {\n langPackKey = 'ActionTTLYouChanged';\n } else {\n langPackKey = 'ActionTTLChanged';\n args.push(getNameDivHTML(message.fromId, plain));\n }\n\n let duration: ReturnType;\n if(action.period > 1814400) {\n let key: LangPackKey;\n const args: FormatterArguments = [];\n const year = 31536000;\n if(action.period >= year) {\n key = 'Years';\n args.push(action.period / year | 0);\n } else {\n key = 'Months';\n args.push(action.period / (ONE_DAY * 30) | 0);\n }\n\n duration = plain ? I18n.format(key, true, args) : i18n(key, args);\n } else {\n duration = formatCallDuration(action.period, plain);\n }\n\n args.push(duration);\n } else {\n if(isBroadcast) {\n langPackKey = 'ActionTTLChannelDisabled';\n } else if(message.fromId === rootScope.myId) {\n langPackKey = 'ActionTTLYouDisabled';\n } else {\n langPackKey = 'ActionTTLDisabled';\n args.push(getNameDivHTML(message.fromId, plain));\n }\n }\n break;\n }\n\n case 'messageActionTopicEdit': {\n let iconElement: (typeof args)[0];\n let titleElement: typeof iconElement;\n let authorElement: ReturnType;\n const isMe = !!message.pFlags.out;\n const isIconChanged = action.icon_emoji_id !== undefined;\n const isIconRemoved = isIconChanged && !+action.icon_emoji_id;\n const isTitleChanged = action.title !== undefined;\n const isHiddenChanged = action.hidden !== undefined;\n\n if(!isMe) {\n authorElement = getNameDivHTML(message.fromId, plain);\n }\n\n if(isTitleChanged) {\n titleElement = wrapSomeText(action.title);\n }\n\n if(isIconChanged && !isIconRemoved) {\n iconElement = wrapMessageActionTopicIcon(options);\n }\n\n args = authorElement ? [authorElement] : [];\n\n if(action.closed) {\n langPackKey = isMe ? 'Chat.Service.Group.TopicEdited.You.Paused' : 'Chat.Service.Group.TopicEdited.Paused';\n } else if(action.closed === false) {\n langPackKey = isMe ? 'Chat.Service.Group.TopicEdited.You.Resumed' : 'Chat.Service.Group.TopicEdited.Resumed';\n } else if(isIconRemoved && isTitleChanged) {\n langPackKey = isMe ? 'Chat.Service.TopicEdited.You.Mixed.IconRemoved' : 'Chat.Service.TopicEdited.Mixed.IconRemoved';\n args.push(titleElement);\n } else if(isIconChanged && isTitleChanged) {\n langPackKey = isMe ? 'Chat.Service.TopicEdited.You.Mixed' : 'Chat.Service.TopicEdited.Mixed';\n args.push(wrapMessageActionTopicIconAndName(options));\n } else if(isIconRemoved) {\n langPackKey = isMe ? 'Chat.Service.Group.TopicEdited.You.Icon.Removed' : 'Chat.Service.Group.TopicEdited.Icon.Removed';\n } else if(isTitleChanged) {\n langPackKey = isMe ? 'Chat.Service.Group.TopicEdited.You.Title' : 'Chat.Service.Group.TopicEdited.Title';\n args.push(titleElement);\n } else if(isIconChanged) {\n langPackKey = isMe ? 'Chat.Service.Group.TopicEdited.You.Icon' : 'Chat.Service.Group.TopicEdited.Icon';\n args.push(iconElement);\n } else if(isHiddenChanged) {\n langPackKey = isMe ?\n (action.hidden ? 'Chat.Service.Group.TopicEdited.You.Hided' : 'Chat.Service.Group.TopicEdited.You.Unhided') :\n (action.hidden ? 'Chat.Service.Group.TopicEdited.Hided' : 'Chat.Service.Group.TopicEdited.Unhided');\n }\n\n break;\n }\n\n case 'messageActionTopicCreate': {\n args = [wrapMessageActionTopicIconAndName(options)];\n langPackKey = 'TopicWasCreatedAction';\n break;\n }\n\n case 'messageActionSetChatTheme': {\n const isMe = !!message.pFlags.out;\n let authorElement: ReturnType;\n if(!isMe) {\n authorElement = getNameDivHTML(message.fromId, plain);\n }\n\n args = authorElement ? [authorElement] : [];\n\n if(action.emoticon) {\n args.push(wrapEmojiText(action.emoticon));\n langPackKey = isMe ? 'ChatThemeChangedYou' : 'ChatThemeChangedTo';\n } else {\n langPackKey = isMe ? 'ChatThemeDisabledYou' : 'ChatThemeDisabled';\n }\n break;\n }\n\n default:\n langPackKey = (langPack[_] || `[${action._}]`) as any;\n break;\n }\n\n if(!langPackKey) {\n langPackKey = langPack[_];\n if(langPackKey === undefined) {\n langPackKey = '[' + _ + ']' as any;\n }\n }\n\n const waited = args && await Promise.all(args);\n\n if(plain) {\n return I18n.format(langPackKey, true, waited);\n } else {\n // if(waited && noLinks) {\n // waited = waited.map((arg) => arg instanceof HTMLAnchorElement ? arg.textContent : arg);\n // }\n\n return _i18n(element, langPackKey, waited);\n }\n\n // str = !langPackKey || langPackKey[0].toUpperCase() === langPackKey[0] ? langPackKey : getNameDivHTML(message.fromId) + langPackKey + (suffix ? ' ' : '');\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport assumeType from '../../helpers/assumeType';\nimport htmlToDocumentFragment from '../../helpers/dom/htmlToDocumentFragment';\nimport {getRestrictionReason} from '../../helpers/restrictions';\nimport escapeRegExp from '../../helpers/string/escapeRegExp';\nimport limitSymbols from '../../helpers/string/limitSymbols';\nimport {Message, DocumentAttribute, DraftMessage} from '../../layer';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport {MyDraftMessage} from '../../lib/appManagers/appDraftsManager';\nimport {MyMessage} from '../../lib/appManagers/appMessagesManager';\nimport isMessageRestricted from '../../lib/appManagers/utils/messages/isMessageRestricted';\nimport I18n, {LangPackKey, i18n, UNSUPPORTED_LANG_PACK_KEY} from '../../lib/langPack';\nimport parseEntities from '../../lib/richTextProcessor/parseEntities';\nimport sortEntities from '../../lib/richTextProcessor/sortEntities';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport wrapPlainText from '../../lib/richTextProcessor/wrapPlainText';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\nimport rootScope from '../../lib/rootScope';\nimport {Modify} from '../../types';\nimport wrapMessageActionTextNew, {WrapMessageActionTextOptions} from './messageActionTextNew';\n\nexport type WrapMessageForReplyOptions = Modify & {\n text?: string,\n usingMids?: number[],\n highlightWord?: string,\n withoutMediaType?: boolean\n};\n\n// export default async function wrapMessageForReply(message: MyMessage | MyDraftMessage, text: string, usingMids: number[], plain: true, highlightWord?: string, withoutMediaType?: boolean): Promise;\n// export default async function wrapMessageForReply(message: MyMessage | MyDraftMessage, text?: string, usingMids?: number[], plain?: false, highlightWord?: string, withoutMediaType?: boolean): Promise;\n// export default async function wrapMessageForReply(message: MyMessage | MyDraftMessage, text: string = (message as Message.message).message, usingMids?: number[], plain?: boolean, highlightWord?: string, withoutMediaType?: boolean): Promise {\nexport default async function wrapMessageForReply(\n options: T\n): Promise {\n let {message, text, usingMids, plain, highlightWord, withoutMediaType} = options;\n text ??= (message as Message.message).message;\n\n const parts: (Node | string)[] = [];\n\n let hasAlbumKey = false;\n const addPart = (langKey: LangPackKey, part?: string | HTMLElement | DocumentFragment) => {\n if(langKey) {\n if(part === undefined && hasAlbumKey) {\n return;\n }\n\n part = plain ? I18n.format(langKey, true) : i18n(langKey);\n }\n\n if(plain) {\n parts.push(part);\n } else {\n const el = document.createElement('span');\n if(typeof(part) === 'string') el.innerHTML = part;\n else el.append(part);\n parts.push(el);\n }\n };\n\n const managers = rootScope.managers;\n const appMessagesManager = managers.appMessagesManager;\n\n const isRestricted = isMessageRestricted(message as any);\n\n let entities = (message as Message.message).totalEntities ?? (message as DraftMessage.draftMessage).entities;\n if((message as Message.message).media && !isRestricted) {\n assumeType(message);\n let usingFullAlbum = true;\n if(message.grouped_id) {\n if(usingMids) {\n const mids = await appMessagesManager.getMidsByMessage(message);\n if(usingMids.length === mids.length) {\n for(const mid of mids) {\n if(!usingMids.includes(mid)) {\n usingFullAlbum = false;\n break;\n }\n }\n } else {\n usingFullAlbum = false;\n }\n }\n\n if(usingFullAlbum) {\n const albumText = await appMessagesManager.getAlbumText(message.grouped_id);\n text = albumText?.message || '';\n entities = albumText?.totalEntities || [];\n\n if(!withoutMediaType) {\n addPart('AttachAlbum');\n hasAlbumKey = true;\n }\n }\n } else {\n usingFullAlbum = false;\n }\n\n if((!usingFullAlbum && !withoutMediaType) || !text) {\n const media = message.media;\n switch(media._) {\n case 'messageMediaPhoto':\n addPart('AttachPhoto');\n break;\n case 'messageMediaDice':\n addPart(undefined, plain ? media.emoticon : wrapEmojiText(media.emoticon));\n break;\n case 'messageMediaVenue': {\n text = media.title;\n addPart('AttachLocation');\n break;\n }\n case 'messageMediaGeo':\n addPart('AttachLocation');\n break;\n case 'messageMediaGeoLive':\n addPart('AttachLiveLocation');\n break;\n case 'messageMediaPoll':\n const f = '📊' + ' ' + (media.poll.question || 'poll');\n addPart(undefined, plain ? f : wrapEmojiText(f));\n break;\n case 'messageMediaContact':\n addPart('AttachContact');\n break;\n case 'messageMediaGame': {\n const f = '🎮' + ' ' + media.game.title;\n addPart(undefined, plain ? f : wrapEmojiText(f));\n break;\n }\n case 'messageMediaDocument': {\n const document = media.document as MyDocument;\n\n if(document.type === 'video') {\n addPart('AttachVideo');\n } else if(document.type === 'voice') {\n addPart('AttachAudio');\n } else if(document.type === 'gif') {\n addPart('AttachGif');\n } else if(document.type === 'round') {\n addPart('AttachRound');\n } else if(document.type === 'sticker') {\n const i = parts.length;\n if(document.stickerEmojiRaw) {\n const f = document.stickerEmojiRaw + ' ';\n addPart(undefined, plain ? f : wrapEmojiText(f));\n }\n\n addPart('AttachSticker');\n\n // will combine two parts into one\n const p = parts.splice(i, 2);\n if(plain) parts.push((p[0] as string) + (p[1] ? p[1] as string : ''));\n else {\n const span = window.document.createElement('span');\n span.append(...p);\n parts.push(span);\n }\n\n text = '';\n } else if(document.type === 'audio') {\n const attribute = document.attributes.find((attribute) => attribute._ === 'documentAttributeAudio' && (attribute.title || attribute.performer)) as DocumentAttribute.documentAttributeAudio;\n const f = '🎵' + ' ' + (attribute ? [attribute.title, attribute.performer].filter(Boolean).join(' - ') : document.file_name);\n addPart(undefined, plain ? f : wrapEmojiText(f));\n } else {\n addPart(undefined, plain ? document.file_name : wrapEmojiText(document.file_name));\n }\n\n break;\n }\n\n case 'messageMediaInvoice': {\n if(media.extended_media?._ === 'messageExtendedMediaPreview') {\n addPart(undefined, plain ? media.description : wrapEmojiText(media.description));\n } else {\n addPart(undefined, plain ? media.title : wrapEmojiText(media.title));\n }\n\n break;\n }\n\n case 'messageMediaUnsupported': {\n addPart(UNSUPPORTED_LANG_PACK_KEY);\n break;\n }\n\n default:\n // messageText += media._;\n // /////appMessagesManager.log.warn('Got unknown media type!', message);\n break;\n }\n }\n\n const length = parts.length;\n for(let i = 1; i < length; i += 2) {\n parts.splice(i, 0, ', ');\n }\n\n if(text && length) {\n parts.push(', ');\n }\n }\n\n if((message as Message.messageService).action) {\n const actionWrapped = await wrapMessageActionTextNew({\n message: (message as Message.messageService),\n plain,\n noLinks: true\n });\n\n if(actionWrapped) {\n addPart(undefined, actionWrapped);\n }\n }\n\n if(isRestricted) {\n text = getRestrictionReason((message as Message.message).restriction_reason).text;\n entities = [];\n }\n\n if(text) {\n text = limitSymbols(text, 100);\n\n entities ??= parseEntities(text);\n\n if(plain) {\n parts.push(wrapPlainText(text, entities));\n } else {\n // let entities = parseEntities(text.replace(/\\n/g, ' '));\n\n if(highlightWord) {\n highlightWord = highlightWord.trim();\n let found = false;\n let match: any;\n const regExp = new RegExp(escapeRegExp(highlightWord), 'gi');\n entities = entities.slice(); // fix leaving highlight entity\n while((match = regExp.exec(text)) !== null) {\n entities.push({_: 'messageEntityHighlight', length: highlightWord.length, offset: match.index});\n found = true;\n }\n\n if(found) {\n sortEntities(entities);\n }\n }\n\n const messageWrapped = wrapRichText(text, {\n noLinebreaks: true,\n entities,\n noLinks: true,\n noTextFormat: true\n });\n\n parts.push(htmlToDocumentFragment(messageWrapped));\n }\n }\n\n if(plain) {\n return parts.join('') as any;\n } else {\n const fragment = document.createDocumentFragment();\n fragment.append(...parts);\n return fragment as any;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PeerTitle, {PeerTitleOptions} from '../peerTitle';\n\nexport default async function wrapPeerTitle(options: PeerTitleOptions) {\n const peerTitle = new PeerTitle();\n await peerTitle.update(options);\n return peerTitle.element;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport renderMediaWithFadeIn from '../../helpers/dom/renderMediaWithFadeIn';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport {Message, PhotoSize, VideoSize, WebDocument} from '../../layer';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport {MyPhoto} from '../../lib/appManagers/appPhotosManager';\nimport rootScope from '../../lib/rootScope';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport ProgressivePreloader from '../preloader';\nimport blur from '../../helpers/blur';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getStrippedThumbIfNeeded from '../../helpers/getStrippedThumbIfNeeded';\nimport setAttachmentSize from '../../helpers/setAttachmentSize';\nimport choosePhotoSize from '../../lib/appManagers/utils/photos/choosePhotoSize';\nimport type {ThumbCache} from '../../lib/storages/thumbs';\nimport appDownloadManager from '../../lib/appManagers/appDownloadManager';\nimport isWebDocument from '../../lib/appManagers/utils/webDocs/isWebDocument';\nimport createVideo from '../../helpers/dom/createVideo';\nimport noop from '../../helpers/noop';\nimport {THUMB_TYPE_FULL} from '../../lib/mtproto/mtproto_config';\nimport {Middleware} from '../../helpers/middleware';\nimport liteMode from '../../helpers/liteMode';\n\nexport default async function wrapPhoto({photo, message, container, boxWidth, boxHeight, withTail, isOut, lazyLoadQueue, middleware, size, withoutPreloader, loadPromises, autoDownloadSize, noBlur, noThumb, noFadeIn, blurAfter, managers = rootScope.managers, processUrl}: {\n photo: MyPhoto | MyDocument | WebDocument,\n message?: Message.message | Message.messageService,\n container: HTMLElement,\n boxWidth?: number,\n boxHeight?: number,\n withTail?: boolean,\n isOut?: boolean,\n lazyLoadQueue?: LazyLoadQueue,\n middleware?: Middleware,\n size?: PhotoSize | Extract,\n withoutPreloader?: boolean,\n loadPromises?: Promise[],\n autoDownloadSize?: number,\n noBlur?: boolean,\n noThumb?: boolean,\n noFadeIn?: boolean,\n blurAfter?: boolean,\n managers?: AppManagers,\n processUrl?: (url: string) => Promise\n}) {\n const ret = {\n loadPromises: {\n thumb: Promise.resolve() as Promise,\n full: Promise.resolve() as Promise\n },\n images: {\n thumb: null as HTMLImageElement | HTMLCanvasElement,\n full: null as HTMLVideoElement | HTMLImageElement\n },\n preloader: null as ProgressivePreloader,\n aspecter: null as HTMLElement\n };\n\n const isDocument = photo._ === 'document';\n const isImageFromDocument = isDocument && photo.mime_type.startsWith('image/') && !size;\n const isWebDoc = isWebDocument(photo);\n if(!((photo as MyPhoto).sizes || (photo as MyDocument).thumbs) && !isWebDoc && !isImageFromDocument) {\n if(boxWidth && boxHeight && !size && isDocument) {\n setAttachmentSize(photo, container, boxWidth, boxHeight, undefined, message);\n }\n\n return ret;\n }\n\n let noAutoDownload = autoDownloadSize === 0;\n\n if(!size) {\n if(boxWidth === undefined) boxWidth = mediaSizes.active.regular.width;\n if(boxHeight === undefined) boxHeight = mediaSizes.active.regular.height;\n }\n\n container.classList.add('media-container');\n let aspecter = container;\n\n let isFit = true;\n let loadThumbPromise: Promise = Promise.resolve();\n let thumbImage: HTMLImageElement | HTMLCanvasElement;\n // let image: HTMLImageElement;\n let cacheContext: ThumbCache;\n // if(withTail) {\n // image = wrapMediaWithTail(photo, message, container, boxWidth, boxHeight, isOut);\n // } else {\n\n if(boxWidth && boxHeight && !size) { // !album\n const set = setAttachmentSize(\n photo,\n container,\n boxWidth,\n boxHeight,\n undefined,\n message,\n undefined,\n isImageFromDocument ? {\n _: 'photoSize',\n w: photo.w,\n h: photo.h,\n size: photo.size,\n type: THUMB_TYPE_FULL\n } : undefined\n );\n size = set.photoSize;\n isFit = set.isFit;\n cacheContext = await managers.thumbsStorage.getCacheContext(photo, size.type);\n\n if(!isFit && !isWebDoc) {\n aspecter = document.createElement('div');\n aspecter.classList.add('media-container-aspecter');\n aspecter.style.width = set.size.width + 'px';\n aspecter.style.height = set.size.height + 'px';\n\n const gotThumb = getStrippedThumbIfNeeded(photo, cacheContext, !noBlur, true);\n if(gotThumb) {\n loadThumbPromise = gotThumb.loadPromise;\n const thumbImage = gotThumb.image; // local scope\n thumbImage.classList.add('media-photo');\n container.append(thumbImage);\n } else {\n const res = await wrapPhoto({\n container,\n message,\n photo,\n boxWidth: 0,\n boxHeight: 0,\n size,\n lazyLoadQueue,\n isOut,\n loadPromises,\n middleware,\n withoutPreloader,\n withTail,\n autoDownloadSize,\n noBlur,\n noThumb: true,\n blurAfter: true,\n managers\n // noFadeIn: true\n });\n const thumbImage = res.images.full;\n thumbImage.classList.add('media-photo', 'thumbnail');\n // container.append(thumbImage);\n }\n\n container.classList.add('media-container-fitted');\n container.append(aspecter);\n }\n } else {\n if(!size) {\n size = choosePhotoSize(photo, boxWidth, boxHeight, true);\n }\n\n cacheContext = await managers.thumbsStorage.getCacheContext(photo, size?.type);\n }\n\n if(!noThumb && !isWebDoc) {\n const gotThumb = getStrippedThumbIfNeeded(photo, cacheContext, !noBlur);\n if(gotThumb) {\n loadThumbPromise = Promise.all([loadThumbPromise, gotThumb.loadPromise]);\n ret.loadPromises.thumb = ret.loadPromises.full = loadThumbPromise;\n thumbImage = ret.images.thumb = gotThumb.image;\n thumbImage.classList.add('media-photo');\n aspecter.append(thumbImage);\n }\n }\n // }\n\n ret.aspecter = aspecter;\n\n if((size?._ === 'photoSizeEmpty' && isDocument) || (size as PhotoSize.photoStrippedSize)?.bytes) {\n return ret;\n }\n\n let media: HTMLVideoElement | HTMLImageElement;\n if(size?._ === 'videoSize') {\n media = ret.images.full = createVideo();\n media.autoplay = true;\n media.loop = true;\n media.muted = true;\n media.classList.add('media-photo');\n } else {\n media = ret.images.full = new Image();\n media.classList.add('media-photo');\n }\n\n // console.log('wrapPhoto downloaded:', photo, photo.downloaded, container);\n\n const needFadeIn = (thumbImage || !cacheContext.downloaded) && liteMode.isAvailable('animations') && !noFadeIn;\n\n let preloader: ProgressivePreloader;\n const uploadingFileName = (message as Message.message)?.uploadingFileName;\n if(!withoutPreloader) {\n if(!cacheContext.downloaded || uploadingFileName) {\n preloader = new ProgressivePreloader({\n attachMethod: 'prepend',\n isUpload: !!uploadingFileName\n });\n }\n\n if(uploadingFileName) { // means upload\n preloader.attachPromise(appDownloadManager.getUpload(uploadingFileName));\n preloader.attach(container);\n noAutoDownload = undefined;\n }\n }\n\n\n const getDownloadPromise = () => {\n // const promise = isGif && !size ?\n // managers.appDocsManager.downloadDoc(photo, /* undefined, */lazyLoadQueue?.queueId) :\n // managers.appPhotosManager.preloadPhoto(photo, size, lazyLoadQueue?.queueId, noAutoDownload);\n const haveToDownload = isImageFromDocument && !size;\n const promise = appDownloadManager.downloadMediaURL({\n media: photo,\n thumb: size,\n queueId: lazyLoadQueue?.queueId,\n onlyCache: haveToDownload ? undefined : noAutoDownload\n });\n\n return promise;\n };\n\n const renderOnLoad = (url: string) => {\n return renderMediaWithFadeIn(container, media, url, needFadeIn, aspecter, thumbImage);\n };\n\n const onLoad = async(url: string) => {\n if(middleware && !middleware()) return;\n\n if(processUrl) {\n url = await processUrl(url);\n }\n\n if(blurAfter) {\n const result = blur(url, 12);\n return result.promise.then(() => {\n // image = result.canvas;\n return renderOnLoad(result.canvas.toDataURL());\n });\n }\n\n return renderOnLoad(url);\n };\n\n let loadPromise: Promise;\n const canAttachPreloader = (\n (size as PhotoSize.photoSize).w >= 150 &&\n (size as PhotoSize.photoSize).h >= 150\n ) || noAutoDownload;\n const load = async() => {\n if(noAutoDownload && !withoutPreloader && preloader) {\n preloader.construct();\n preloader.setManual();\n }\n\n const promise = getDownloadPromise();\n const cacheContext = await managers.thumbsStorage.getCacheContext(photo, size?.type);\n if(\n preloader &&\n !cacheContext.downloaded &&\n !withoutPreloader &&\n canAttachPreloader\n ) {\n preloader.attach(container, false, promise);\n }\n\n noAutoDownload = undefined;\n\n const renderPromise = promise.then(onLoad);\n renderPromise.catch(noop);\n return {download: promise, render: renderPromise};\n };\n\n if(preloader) {\n preloader.setDownloadFunction(load);\n }\n\n if(cacheContext.downloaded) {\n loadThumbPromise = loadPromise = (await load()).render;\n } else {\n if(!lazyLoadQueue) loadPromise = (await load()).render;\n /* else if(noAutoDownload) {\n preloader.construct();\n preloader.setManual();\n preloader.attach(container);\n } */ else lazyLoadQueue.push({div: container, load: () => load().then(({download}) => download)});\n }\n\n if(loadPromises && loadThumbPromise) {\n loadPromises.push(loadThumbPromise);\n }\n\n // const perf = performance.now();\n await loadThumbPromise;\n ret.loadPromises.thumb = loadThumbPromise;\n ret.loadPromises.full = loadPromise || Promise.resolve();\n ret.preloader = preloader;\n\n // const elapsedTime = performance.now() - perf;\n // if(elapsedTime > 4) {\n // console.log('wrapping photo thumb time', elapsedTime, photo, size);\n // }\n\n return ret;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {hexToRgb} from '../../helpers/color';\nimport {Message} from '../../layer';\nimport getPeerColorById from '../../lib/appManagers/utils/peers/getPeerColorById';\nimport {AnimationItemGroup} from '../animationIntersector';\nimport ReplyContainer from '../chat/replyContainer';\n\nexport default function wrapReply(\n title: Parameters[0],\n subtitle: Parameters[1],\n animationGroup: AnimationItemGroup,\n message?: Message.message | Message.messageService,\n setColorPeerId?: PeerId\n) {\n const replyContainer = new ReplyContainer('reply', animationGroup);\n const fillPromise = replyContainer.fill(title, subtitle, message);\n\n if(setColorPeerId) {\n const hex = getPeerColorById(setColorPeerId, false);\n const [r, g, b] = hexToRgb(hex);\n replyContainer.container.style.setProperty('--override-color', `${r}, ${g}, ${b}`);\n replyContainer.container.classList.add('is-overriding-color');\n // replyContainer.border.style.backgroundColor = hex;\n // replyContainer.title.style.color = hex;\n }\n\n return {container: replyContainer.container, fillPromise};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MyMessage} from '../../lib/appManagers/appMessagesManager';\nimport getMessageSenderPeerIdOrName from '../../lib/appManagers/utils/messages/getMessageSenderPeerIdOrName';\nimport {i18n} from '../../lib/langPack';\nimport rootScope from '../../lib/rootScope';\nimport wrapPeerTitle from './peerTitle';\n\nexport default async function wrapSenderToPeer(message: MyMessage) {\n const senderTitle: HTMLElement = document.createElement('span');\n senderTitle.classList.add('sender-title');\n\n const fromMe = message.fromId === rootScope.myId && message.peerId !== rootScope.myId;\n senderTitle.append(\n fromMe ?\n i18n('FromYou') :\n await wrapPeerTitle({\n ...getMessageSenderPeerIdOrName(message),\n dialog: message.peerId === rootScope.myId\n })\n );\n\n if(await rootScope.managers.appPeersManager.isAnyGroup(message.peerId) || fromMe) {\n const peerTitle = await wrapPeerTitle({peerId: message.peerId});\n senderTitle.append(' ➝ ', peerTitle);\n }\n\n return senderTitle;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {formatDateAccordingToTodayNew} from '../../helpers/date';\nimport {MyMessage} from '../../lib/appManagers/appMessagesManager';\n\nexport default function wrapSentTime(message: MyMessage) {\n const el: HTMLElement = document.createElement('span');\n el.classList.add('sent-time');\n el.append(formatDateAccordingToTodayNew(new Date(message.date * 1000)));\n\n return el;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_WEBP_SUPPORTED from '../../environment/webpSupport';\nimport assumeType from '../../helpers/assumeType';\nimport getPathFromBytes from '../../helpers/bytes/getPathFromBytes';\nimport deferredPromise from '../../helpers/cancellablePromise';\nimport computeLockColor from '../../helpers/computeLockColor';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport createVideo from '../../helpers/dom/createVideo';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport renderImageFromUrl, {renderImageFromUrlPromise} from '../../helpers/dom/renderImageFromUrl';\nimport getImageFromStrippedThumb from '../../helpers/getImageFromStrippedThumb';\nimport getPreviewURLFromThumb from '../../helpers/getPreviewURLFromThumb';\nimport makeError from '../../helpers/makeError';\nimport {makeMediaSize} from '../../helpers/mediaSize';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport {Middleware} from '../../helpers/middleware';\nimport onMediaLoad from '../../helpers/onMediaLoad';\nimport {isSavingLottiePreview, saveLottiePreview} from '../../helpers/saveLottiePreview';\nimport throttle from '../../helpers/schedulers/throttle';\nimport sequentialDom from '../../helpers/sequentialDom';\nimport {PhotoSize, VideoSize} from '../../layer';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport appDownloadManager from '../../lib/appManagers/appDownloadManager';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getServerMessageId from '../../lib/appManagers/utils/messageId/getServerMessageId';\nimport choosePhotoSize from '../../lib/appManagers/utils/photos/choosePhotoSize';\nimport getStickerEffectThumb from '../../lib/appManagers/utils/stickers/getStickerEffectThumb';\nimport lottieLoader from '../../lib/rlottie/lottieLoader';\nimport type RLottiePlayer from '../../lib/rlottie/rlottiePlayer';\nimport rootScope from '../../lib/rootScope';\nimport type {ThumbCache} from '../../lib/storages/thumbs';\nimport webpWorkerController from '../../lib/webp/webpWorkerController';\nimport {Awaited, SendMessageEmojiInteractionData} from '../../types';\nimport {getEmojiToneIndex} from '../../vendor/emoji';\nimport animationIntersector, {AnimationItemGroup} from '../animationIntersector';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport PopupStickers from '../popups/stickers';\nimport {hideToast, toastNew} from '../toast';\nimport wrapStickerAnimation from './stickerAnimation';\nimport framesCache from '../../helpers/framesCache';\nimport {IS_MOBILE} from '../../environment/userAgent';\nimport liteMode, {LiteModeKey} from '../../helpers/liteMode';\nimport PopupElement from '../popups';\n\n// https://github.com/telegramdesktop/tdesktop/blob/master/Telegram/SourceFiles/history/view/media/history_view_sticker.cpp#L40\nexport const STICKER_EFFECT_MULTIPLIER = 1 + 0.245 * 2;\nconst EMOJI_EFFECT_MULTIPLIER = 3;\n\nconst locksUrls: {[docId: string]: string} = {};\n\nexport const videosCache: {[key: string]: Promise} = {};\n\nconst onAnimationEnd = (element: HTMLElement, onAnimationEnd: () => void, timeout: number) => {\n const onEnd = () => {\n element.removeEventListener('animationend', onEnd);\n onAnimationEnd();\n clearTimeout(_timeout);\n };\n element.addEventListener('animationend', onEnd);\n const _timeout = setTimeout(onEnd, timeout);\n};\n\nexport default async function wrapSticker({doc, div, middleware, loadStickerMiddleware, lazyLoadQueue, exportLoad, group, play, onlyThumb, emoji, width, height, withThumb, loop, loadPromises, needFadeIn, needUpscale, skipRatio, static: asStatic, managers = rootScope.managers, fullThumb, isOut, noPremium, withLock, relativeEffect, loopEffect, isCustomEmoji, syncedVideo, liteModeKey, isEffect}: {\n doc: MyDocument,\n div: HTMLElement | HTMLElement[],\n middleware?: Middleware,\n loadStickerMiddleware?: Middleware,\n lazyLoadQueue?: LazyLoadQueue,\n exportLoad?: number,\n group?: AnimationItemGroup,\n play?: boolean,\n onlyThumb?: boolean,\n emoji?: string,\n width?: number,\n height?: number,\n withThumb?: boolean,\n loop?: RLottiePlayer['loop'],\n loadPromises?: Promise[],\n needFadeIn?: boolean,\n needUpscale?: boolean,\n skipRatio?: number,\n static?: boolean,\n managers?: AppManagers,\n fullThumb?: PhotoSize | Extract,\n isOut?: boolean,\n noPremium?: boolean,\n withLock?: boolean,\n relativeEffect?: boolean,\n loopEffect?: boolean,\n isCustomEmoji?: boolean,\n syncedVideo?: boolean,\n liteModeKey?: LiteModeKey | false,\n isEffect?: boolean\n}) {\n div = Array.isArray(div) ? div : [div];\n\n liteModeKey ??= 'stickers_panel';\n\n if(isCustomEmoji) {\n emoji = doc.stickerEmojiRaw;\n }\n\n const stickerType = doc.sticker;\n if(stickerType === 1) {\n asStatic = true;\n }\n\n if(!width && !height) {\n const sizes = mediaSizes.active;\n const boxSize = emoji ? sizes.emojiSticker : (doc.animated ? sizes.animatedSticker : sizes.staticSticker);\n const size = makeMediaSize(doc.w, doc.h).aspectFitted(boxSize);\n width = size.width;\n height = size.height;\n }\n\n if(stickerType === 2) {\n // LottieLoader.loadLottie();\n lottieLoader.loadLottieWorkers();\n }\n\n loop = !!(!emoji || isCustomEmoji) && loop;\n\n div.forEach((div) => {\n div.dataset.docId = '' + doc.id;\n if(emoji) {\n div.dataset.stickerEmoji = emoji;\n }\n\n div.dataset.stickerPlay = '' + +(play || false);\n div.dataset.stickerLoop = '' + +(loop || false);\n\n div.classList.add('media-sticker-wrapper');\n });\n\n if(play && !liteMode.isAvailable(liteModeKey) && !isCustomEmoji && !isEffect) {\n play = false;\n loop = false;\n }\n\n /* if(stickerType === 3) {\n const videoRes = wrapVideo({\n doc,\n boxWidth: width,\n boxHeight: height,\n container: div,\n group,\n lazyLoadQueue,\n middleware,\n withoutPreloader: true,\n loadPromises,\n noPlayButton: true,\n noInfo: true\n });\n\n if(videoRes.thumb) {\n if(videoRes.thumb.images.thumb) {\n videoRes.thumb.images.thumb.classList.add('media-sticker', 'thumbnail');\n }\n\n if(videoRes.thumb.images.full) {\n videoRes.thumb.images.full.classList.add('media-sticker');\n }\n }\n\n return videoRes.loadPromise;\n } */\n\n // console.log('wrap sticker', doc, div, onlyThumb);\n\n let cacheContext: ThumbCache;\n const getCacheContext = async(type: string = cacheContext?.type) => {\n return cacheContext = await managers.thumbsStorage.getCacheContext(doc, type);\n };\n\n const isAnimated = !asStatic && (stickerType === 2 || stickerType === 3);\n\n const effectThumb = getStickerEffectThumb(doc);\n if(isOut !== undefined && effectThumb && !isOut) {\n div.forEach((div) => div.classList.add('reflect-x'));\n }\n\n const willHaveLock = effectThumb && withLock;\n if(willHaveLock) {\n const lockUrl = locksUrls[doc.id];\n div.forEach((div) => {\n div.classList.add('is-premium-sticker', 'tgico-premium_lock');\n lockUrl && div.style.setProperty('--lock-url', `url(${lockUrl})`);\n });\n }\n\n if(asStatic && stickerType !== 1) {\n const thumb = choosePhotoSize(doc, width, height, false) as PhotoSize.photoSize;\n await getCacheContext(thumb.type);\n } else {\n await getCacheContext(fullThumb?.type);\n }\n\n const toneIndex = emoji && !isCustomEmoji ? getEmojiToneIndex(emoji) : -1;\n const downloaded = cacheContext.downloaded && !needFadeIn;\n\n const isThumbNeededForType = isAnimated;\n const lottieCachedThumb = stickerType === 2 || stickerType === 3 ? await managers.appDocsManager.getLottieCachedThumb(doc.id, toneIndex) : undefined;\n\n const ret = {render: undefined as typeof loadPromise, load: undefined as typeof load};\n let loadThumbPromise = deferredPromise();\n let haveThumbCached = false;\n if((\n doc.thumbs?.length ||\n lottieCachedThumb\n ) &&\n !div[0].firstElementChild && (\n !downloaded ||\n isThumbNeededForType ||\n onlyThumb\n ) && withThumb !== false/* && doc.thumbs[0]._ !== 'photoSizeEmpty' */\n ) {\n let thumb = lottieCachedThumb || doc.thumbs[0];\n\n // console.log('wrap sticker', thumb, div);\n\n const afterRender = (div: HTMLElement, thumbImage: HTMLElement) => {\n if(!div.childElementCount) {\n sequentialDom.mutateElement(div, () => {\n if(!div.childElementCount) {\n thumbImage.classList.add('media-sticker', 'thumbnail');\n div.append(thumbImage);\n }\n\n loadThumbPromise.resolve();\n });\n } else {\n loadThumbPromise.resolve();\n }\n };\n\n if('url' in thumb) {\n haveThumbCached = true;\n div.forEach((div) => {\n const thumbImage = new Image();\n renderImageFromUrl(thumbImage, (thumb as any).url, () => afterRender(div, thumbImage));\n });\n } else if('bytes' in thumb) {\n if(thumb._ === 'photoPathSize') {\n if(!thumb.bytes.length) {\n thumb = doc.thumbs.find((t) => (t as PhotoSize.photoStrippedSize).bytes?.length) || thumb;\n }\n\n const d = getPathFromBytes((thumb as PhotoSize.photoStrippedSize).bytes);\n const ns = 'http://www.w3.org/2000/svg';\n const svg = document.createElementNS(ns, 'svg');\n svg.classList.add('rlottie-vector', 'media-sticker', 'thumbnail');\n svg.setAttributeNS(null, 'viewBox', `0 0 ${doc.w || 512} ${doc.h || 512}`);\n\n // const defs = document.createElementNS(ns, 'defs');\n // const linearGradient = document.createElementNS(ns, 'linearGradient');\n // linearGradient.setAttributeNS(null, 'id', 'g');\n // linearGradient.setAttributeNS(null, 'x1', '-300%');\n // linearGradient.setAttributeNS(null, 'x2', '-200%');\n // linearGradient.setAttributeNS(null, 'y1', '0');\n // linearGradient.setAttributeNS(null, 'y2', '0');\n // const stops = [\n // ['-10%', '.1'],\n // ['30%', '.07'],\n // ['70%', '.07'],\n // ['110%', '.1']\n // ].map(([offset, stopOpacity]) => {\n // const stop = document.createElementNS(ns, 'stop');\n // stop.setAttributeNS(null, 'offset', offset);\n // stop.setAttributeNS(null, 'stop-opacity', stopOpacity);\n // return stop;\n // });\n // const animates = [\n // ['-300%', '1200%'],\n // ['-200%', '1300%']\n // ].map(([from, to], idx) => {\n // const animate = document.createElementNS(ns, 'animate');\n // animate.setAttributeNS(null, 'attributeName', 'x' + (idx + 1));\n // animate.setAttributeNS(null, 'from', from);\n // animate.setAttributeNS(null, 'to', to);\n // animate.setAttributeNS(null, 'dur', '3s');\n // animate.setAttributeNS(null, 'repeatCount', 'indefinite');\n // return animate;\n // });\n // linearGradient.append(...stops, ...animates);\n // defs.append(linearGradient);\n // svg.append(defs);\n\n const path = document.createElementNS(ns, 'path');\n path.setAttributeNS(null, 'd', d);\n if(liteMode.isAvailable('animations') && !isCustomEmoji) path.setAttributeNS(null, 'fill', 'url(#g)');\n svg.append(path);\n div.forEach((div, idx) => div.append(idx > 0 ? svg.cloneNode(true) : svg));\n haveThumbCached = true;\n loadThumbPromise.resolve();\n } else if(toneIndex <= 0) {\n const r = () => {\n (div as HTMLElement[]).forEach((div) => {\n const thumbImage = new Image();\n const url = getPreviewURLFromThumb(doc, thumb as PhotoSize.photoStrippedSize, true);\n renderImageFromUrl(thumbImage, url, () => afterRender(div, thumbImage));\n });\n };\n\n if((IS_WEBP_SUPPORTED || doc.pFlags.stickerThumbConverted || cacheContext.url)/* && false */) {\n haveThumbCached = true;\n r();\n } else {\n haveThumbCached = true;\n webpWorkerController.convert('main-' + doc.id, thumb.bytes).then((bytes) => {\n managers.appDocsManager.saveWebPConvertedStrippedThumb(doc.id, bytes);\n (thumb as PhotoSize.photoStrippedSize).bytes = bytes;\n doc.pFlags.stickerThumbConverted = true;\n\n if((middleware && !middleware()) || (div as HTMLElement[])[0].childElementCount) {\n loadThumbPromise.resolve();\n return;\n }\n\n r();\n }).catch(() => loadThumbPromise.resolve());\n }\n }\n } else if(((stickerType === 2 && toneIndex <= 0) || stickerType === 3) && (withThumb || onlyThumb)) {\n const load = async() => {\n if((div as HTMLElement[])[0].childElementCount || (middleware && !middleware())) {\n loadThumbPromise.resolve();\n return;\n }\n\n const r = (div: HTMLElement, thumbImage: HTMLElement, url: string) => {\n if(div.childElementCount || (middleware && !middleware())) {\n loadThumbPromise.resolve();\n return;\n }\n\n if(!url) afterRender(div, thumbImage);\n else renderImageFromUrl(thumbImage, url, () => afterRender(div, thumbImage));\n };\n\n await getCacheContext();\n (div as HTMLElement[]).forEach((div) => {\n if(cacheContext.url) {\n r(div, new Image(), cacheContext.url);\n } else if('bytes' in thumb) {\n const res = getImageFromStrippedThumb(doc, thumb as PhotoSize.photoStrippedSize, true);\n res.loadPromise.then(() => r(div, res.image, ''));\n\n // return managers.appDocsManager.getThumbURL(doc, thumb as PhotoSize.photoStrippedSize).promise.then(r);\n } else {\n appDownloadManager.downloadMediaURL({\n media: doc,\n thumb: thumb as PhotoSize\n }).then(async(url) => {\n return r(div, new Image(), url);\n });\n }\n });\n };\n\n if(lazyLoadQueue && onlyThumb) {\n lazyLoadQueue.push({div: div[0], load});\n loadThumbPromise.resolve();\n return ret;\n } else {\n load();\n\n if((thumb as any).url) {\n haveThumbCached = true;\n }\n }\n }\n }\n\n if(loadPromises && haveThumbCached) {\n loadPromises.push(loadThumbPromise);\n }\n\n if(onlyThumb/* || true */) { // for sticker panel\n return ret;\n }\n\n const middlewareError = makeError('MIDDLEWARE');\n const load = async() => {\n if(middleware && !middleware()) {\n throw middlewareError;\n }\n\n if(stickerType === 2 && !asStatic) {\n const blob = await appDownloadManager.downloadMedia({media: doc, queueId: lazyLoadQueue?.queueId, thumb: fullThumb});\n if(middleware && !middleware()) {\n throw middlewareError;\n }\n\n const animation = await lottieLoader.loadAnimationWorker({\n container: (div as HTMLElement[])[0],\n loop,\n autoplay: play,\n animationData: blob,\n width,\n height,\n name: 'doc' + doc.id,\n needUpscale,\n skipRatio,\n toneIndex,\n sync: isCustomEmoji,\n middleware: loadStickerMiddleware ?? middleware,\n group,\n liteModeKey: liteModeKey || undefined\n });\n\n // const deferred = deferredPromise();\n\n const setLockColor = willHaveLock ? () => {\n const lockUrl = locksUrls[doc.id] ??= computeLockColor(animation.canvas[0]);\n (div as HTMLElement[]).forEach((div) => div.style.setProperty('--lock-url', `url(${lockUrl})`));\n } : undefined;\n\n const onFirstFrame = (container: HTMLElement, canvas: HTMLCanvasElement) => {\n const element = container.firstElementChild !== canvas && container.firstElementChild as HTMLElement;\n if(needFadeIn !== false) {\n needFadeIn = (needFadeIn || !element || element.tagName === 'svg') && liteMode.isAvailable('animations');\n }\n\n const cb = () => {\n if(element && element !== canvas && element.tagName !== 'DIV') {\n element.remove();\n }\n };\n\n if(!needFadeIn) {\n if(element) {\n sequentialDom.mutate(cb);\n }\n } else {\n sequentialDom.mutate(() => {\n canvas && canvas.classList.add('fade-in');\n if(element) {\n element.classList.add('fade-out');\n }\n\n onAnimationEnd(canvas || element, () => {\n sequentialDom.mutate(() => {\n canvas && canvas.classList.remove('fade-in');\n cb();\n });\n }, 400);\n });\n }\n };\n\n animation.addEventListener('firstFrame', () => {\n const canvas = animation.canvas[0];\n if(withThumb !== false || isCustomEmoji) {\n saveLottiePreview(doc, canvas, toneIndex);\n }\n\n if(willHaveLock) {\n setLockColor();\n }\n\n if(!isCustomEmoji) {\n (div as HTMLElement[]).forEach((container, idx) => {\n onFirstFrame(container, animation.canvas[idx]);\n });\n }\n }, {once: true});\n\n if(emoji) {\n managers.appStickersManager.preloadAnimatedEmojiStickerAnimation(emoji);\n }\n\n return animation;\n\n // return deferred;\n // await new Promise((resolve) => setTimeout(resolve, 5e3));\n } else if(asStatic || stickerType === 3) {\n const isSingleVideo = isAnimated && syncedVideo;\n const cacheName = isSingleVideo ? framesCache.generateName('' + doc.id, 0, 0, undefined, undefined) : undefined;\n\n const cachePromise = videosCache[cacheName];\n if(cachePromise) {\n return cachePromise as typeof promise;\n }\n\n const d = isSingleVideo ? (div as HTMLElement[]).slice(0, 1) : div as HTMLElement[];\n const media: HTMLElement[] = d.map(() => {\n let media: HTMLElement;\n if(asStatic) {\n media = new Image();\n } else {\n const video = media = createVideo();\n video.muted = true;\n if(play) video.autoplay = true;\n if(loop) video.loop = true;\n\n if(loop && typeof(loop) === 'number') {\n let previousTime = 0, playedTimes = 0;\n function onTimeupdate(this: HTMLVideoElement) {\n if(previousTime > this.currentTime && ++playedTimes === loop as number) {\n this.autoplay = false;\n this.loop = false;\n this.pause();\n video.removeEventListener('timeupdate', onTimeupdate);\n }\n\n previousTime = this.currentTime;\n }\n\n video.addEventListener('timeupdate', onTimeupdate);\n }\n }\n\n media.classList.add('media-sticker');\n return media;\n });\n\n const thumbImage = (div as HTMLElement[]).map((div, idx) => (div.firstElementChild as HTMLElement) !== media[idx] && div.firstElementChild) as HTMLElement[];\n if(needFadeIn !== false) {\n needFadeIn = (needFadeIn || !downloaded || (asStatic ? thumbImage[0] : (!thumbImage[0] || thumbImage[0].tagName === 'svg'))) && liteMode.isAvailable('animations');\n }\n\n if(needFadeIn) {\n media.forEach((media) => media.classList.add('fade-in'));\n }\n\n const promise = new Promise(async(resolve, reject) => {\n const r = async() => {\n if(middleware && !middleware()) {\n reject(middlewareError);\n return;\n }\n\n const mediaLength = media.length;\n const loaded: HTMLElement[] = [];\n const onLoad = (div: HTMLElement, media: HTMLElement, thumbImage: HTMLElement) => {\n sequentialDom.mutateElement(div, () => {\n if(middleware && !middleware()) {\n reject(middlewareError);\n return;\n }\n\n if(!media) {\n if(!isSingleVideo || !isAnimated) {\n thumbImage?.remove();\n }\n\n return;\n }\n\n if(media as HTMLVideoElement) {\n const w = width * window.devicePixelRatio;\n const h = height * window.devicePixelRatio;\n if(!isSavingLottiePreview(doc, toneIndex, w, h)) {\n // const perf = performance.now();\n const canvas = document.createElement('canvas');\n canvas.width = w;\n canvas.height = h;\n const ctx = canvas.getContext('2d');\n ctx.drawImage(media as HTMLVideoElement, 0, 0, canvas.width, canvas.height);\n saveLottiePreview(doc, canvas, toneIndex);\n // console.log('perf', performance.now() - perf);\n }\n }\n\n if(isSingleVideo) {\n resolve(media as any);\n return;\n }\n\n div.append(media);\n\n if(needFadeIn) {\n thumbImage && thumbImage.classList.add('fade-out');\n onAnimationEnd(media, () => {\n media.classList.remove('fade-in');\n thumbImage?.remove();\n }, 400);\n } else {\n thumbImage?.remove();\n }\n\n if(isAnimated) {\n animationIntersector.addAnimation({\n animation: media as HTMLVideoElement,\n observeElement: div,\n group,\n controlled: middleware,\n liteModeKey: liteModeKey || undefined\n });\n }\n\n if(loaded.push(media) === mediaLength) {\n resolve(loaded as any);\n }\n });\n };\n\n await getCacheContext();\n let lastPromise: Promise;\n (div as HTMLElement[]).forEach((div, idx) => {\n const _media = media[idx];\n const cb = () => onLoad(div, _media, thumbImage[idx]);\n if(_media) lastPromise = renderImageFromUrlPromise(_media, cacheContext.url);\n lastPromise.then(cb);\n });\n };\n\n await getCacheContext();\n if(cacheContext.url) r();\n else {\n let promise: Promise;\n if(stickerType !== 1 && asStatic) {\n const thumb = choosePhotoSize(doc, width, height, false) as PhotoSize.photoSize;\n // promise = managers.appDocsManager.getThumbURL(doc, thumb).promise\n promise = appDownloadManager.downloadMediaURL({media: doc, thumb, queueId: lazyLoadQueue?.queueId});\n } else {\n promise = appDownloadManager.downloadMediaURL({media: doc, queueId: lazyLoadQueue?.queueId});\n }\n\n promise.then(r, reject);\n }\n });\n\n if(cacheName) {\n videosCache[cacheName] = promise as any;\n loadStickerMiddleware && promise.finally(() => {\n if(!loadStickerMiddleware()) {\n delete videosCache[cacheName];\n }\n });\n }\n\n return promise;\n }\n };\n\n if(exportLoad && ((exportLoad === 1 && (!downloaded || isAnimated)) || exportLoad === 2)) {\n ret.load = load;\n return ret;\n }\n\n const loadPromise: Promise> | void> = lazyLoadQueue && (!downloaded || isAnimated) ?\n (lazyLoadQueue.push({div: div[0], load}), Promise.resolve()) :\n load();\n\n if(downloaded && (asStatic/* || stickerType === 3 */)) {\n loadThumbPromise = loadPromise as any;\n if(loadPromises) {\n loadPromises.push(loadThumbPromise);\n }\n }\n\n if(stickerType === 2 && effectThumb && isOut !== undefined && !noPremium) {\n attachStickerEffectHandler({\n container: div[0],\n doc,\n managers,\n middleware,\n isOut,\n width,\n loadPromise,\n relativeEffect,\n loopEffect\n });\n }\n\n ret.render = loadPromise as any;\n return ret;\n}\n\nfunction attachStickerEffectHandler({container, doc, managers, middleware, isOut, width, loadPromise, relativeEffect, loopEffect}: {\n container: HTMLElement,\n doc: MyDocument,\n managers: AppManagers,\n middleware: Middleware,\n isOut: boolean,\n width: number,\n loadPromise: Promise,\n relativeEffect?: boolean,\n loopEffect?: boolean\n}) {\n managers.appStickersManager.preloadSticker(doc.id, true);\n\n let playing = false;\n attachClickEvent(container, async(e) => {\n const isAvailable = liteMode.isAvailable('effects_premiumstickers') || relativeEffect;\n cancelEvent(e);\n if(!e.isTrusted && !isAvailable) {\n return;\n }\n\n if(playing || !isAvailable) {\n const a = document.createElement('a');\n a.onclick = () => {\n hideToast();\n PopupElement.createPopup(PopupStickers, doc.stickerSetInput).show();\n };\n\n toastNew({\n langPackKey: 'Sticker.Premium.Click.Info',\n langPackArguments: [a]\n });\n\n return;\n }\n\n playing = true;\n\n await loadPromise;\n const {animationDiv, stickerPromise} = wrapStickerAnimation({\n doc,\n middleware,\n side: isOut ? 'right' : 'left',\n size: width * STICKER_EFFECT_MULTIPLIER,\n target: container,\n play: true,\n fullThumb: getStickerEffectThumb(doc),\n relativeEffect,\n loopEffect\n });\n\n if(isOut !== undefined && !isOut/* && !relativeEffect */) {\n animationDiv.classList.add('reflect-x');\n }\n\n stickerPromise.then((player) => {\n player.addEventListener('destroy', () => {\n playing = false;\n });\n });\n });\n}\n\nexport async function onEmojiStickerClick({event, container, managers, peerId, middleware}: {\n event: Event,\n container: HTMLElement,\n managers: AppManagers,\n peerId: PeerId,\n middleware: Middleware\n}) {\n cancelEvent(event);\n\n const bubble = findUpClassName(container, 'bubble');\n const emoji = container.dataset.stickerEmoji;\n\n const animation = !container.classList.contains('custom-emoji') ? lottieLoader.getAnimation(container) : undefined;\n if(animation?.paused) {\n const doc = await managers.appStickersManager.getAnimatedEmojiSoundDocument(emoji);\n if(doc) {\n const audio = document.createElement('audio');\n audio.style.display = 'none';\n container.parentElement.append(audio);\n\n try {\n const url = await appDownloadManager.downloadMediaURL({media: doc});\n\n audio.src = url;\n audio.play();\n await onMediaLoad(audio, undefined, true);\n\n audio.addEventListener('ended', () => {\n audio.src = '';\n audio.remove();\n }, {once: true});\n } catch(err) {\n\n }\n }\n\n animation.autoplay = true;\n animation.restart();\n }\n\n if(!peerId.isUser() || !liteMode.isAvailable('effects_emoji')) {\n return;\n }\n\n const activeAnimations: Set<{}> = (container as any).activeAnimations ??= new Set();\n if(activeAnimations.size >= 3) {\n return;\n }\n\n const doc = await managers.appStickersManager.getAnimatedEmojiSticker(emoji, true);\n if(!doc) {\n return;\n }\n\n const data: SendMessageEmojiInteractionData = (container as any).emojiData ??= {\n a: [],\n v: 1\n };\n\n const sendInteractionThrottled: () => void = (container as any).sendInteractionThrottled ??= throttle(() => {\n const length = data.a.length;\n if(!length) {\n return;\n }\n\n const firstTime = data.a[0].t;\n\n data.a.forEach((a) => {\n a.t = (a.t - firstTime) / 1000;\n });\n\n const bubble = findUpClassName(container, 'bubble');\n managers.appMessagesManager.setTyping(appImManager.chat.peerId, {\n _: 'sendMessageEmojiInteraction',\n msg_id: getServerMessageId(+bubble.dataset.mid),\n emoticon: emoji,\n interaction: {\n _: 'dataJSON',\n data: JSON.stringify(data)\n }\n }, true, appImManager.chat.threadId);\n\n data.a.length = 0;\n }, 1000, false);\n\n const o = {};\n activeAnimations.add(o);\n\n const isOut = bubble ? bubble.classList.contains('is-out') : undefined;\n const {animationDiv} = wrapStickerAnimation({\n doc,\n middleware,\n side: isOut ? 'right' : 'left',\n size: 360,\n target: container,\n play: true,\n withRandomOffset: true,\n onUnmount: () => {\n activeAnimations.delete(o);\n }\n });\n\n if(isOut !== undefined && !isOut) {\n animationDiv.classList.add('reflect-x');\n }\n\n // using a trick here: simulated event from interlocutor's interaction won't fire ours\n if(event.isTrusted) {\n data.a.push({\n i: 1,\n t: Date.now()\n });\n\n sendInteractionThrottled();\n }\n // });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n/**\n * https://core.telegram.org/api/files#vector-thumbnails\n */\nexport default function getPathFromBytes(bytes: Uint8Array) {\n const lookup = 'AACAAAAHAAALMAAAQASTAVAAAZaacaaaahaaalmaaaqastava.az0123456789-,';\n\n let path = 'M';\n for(let i = 0, length = bytes.length; i < length; ++i) {\n const num = bytes[i];\n\n if(num >= (128 + 64)) {\n path += lookup[num - 128 - 64];\n } else {\n if(num >= 128) {\n path += ',';\n } else if(num >= 64) {\n path += '-';\n }\n path += '' + (num & 63);\n }\n }\n path += 'z';\n\n return path;\n}\n","// https://github.com/telegramdesktop/tdesktop/blob/543bfab24a76402992421063f1e6444f347d31fe/Telegram/SourceFiles/boxes/sticker_set_box.cpp#L75\nexport default function computeLockColor(canvas: HTMLCanvasElement) {\n const context = canvas.getContext('2d');\n const size = 20 * (canvas.dpr ?? 1);\n const width = size;\n const height = size;\n const skipx = (canvas.width - width) / 2;\n const margin = 0/* * (canvas.dpr ?? 1) */;\n const skipy = canvas.height - height - margin;\n const imageData = context.getImageData(skipx, skipy, width, height).data;\n let sr = 0, sg = 0, sb = 0, sa = 0;\n for(let i = 0; i < imageData.length; i += 4) {\n sr += imageData[i];\n sg += imageData[i + 1];\n sb += imageData[i + 2];\n sa += imageData[i + 3];\n }\n\n const outCanvas = document.createElement('canvas');\n outCanvas.width = size;\n outCanvas.height = size;\n const outContext = outCanvas.getContext('2d');\n const color = new Uint8ClampedArray([sr * 255 / sa, sg * 255 / sa, sb * 255 / sa, 255]);\n const rgba = `rgba(${color[0]}, ${color[1]}, ${color[2]}, ${color[3]})`;\n outContext.fillStyle = rgba;\n outContext.fillRect(0, 0, outCanvas.width, outCanvas.height);\n outContext.fillStyle = `rgba(112, 117, 121, 0.3)`;\n outContext.fillRect(0, 0, outCanvas.width, outCanvas.height);\n // document.querySelector('.popup-title').append(c);\n return outCanvas.toDataURL('image/jpeg');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_VIBRATE_SUPPORTED from '../../environment/vibrateSupport';\nimport assumeType from '../../helpers/assumeType';\nimport isInDOM from '../../helpers/dom/isInDOM';\nimport makeError from '../../helpers/makeError';\nimport {getMiddleware, Middleware} from '../../helpers/middleware';\nimport throttleWithRaf from '../../helpers/schedulers/throttleWithRaf';\nimport windowSize from '../../helpers/windowSize';\nimport {PhotoSize, VideoSize} from '../../layer';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport RLottiePlayer from '../../lib/rlottie/rlottiePlayer';\nimport wrapSticker from './sticker';\n\nexport default function wrapStickerAnimation({\n size,\n doc,\n middleware,\n target,\n side,\n skipRatio,\n play,\n managers,\n fullThumb,\n withRandomOffset,\n relativeEffect,\n loopEffect,\n onUnmount\n}: {\n size: number,\n doc: MyDocument,\n middleware?: Middleware,\n target: HTMLElement,\n side: 'left' | 'center' | 'right',\n skipRatio?: number,\n play: boolean,\n managers?: AppManagers,\n fullThumb?: PhotoSize | Extract,\n withRandomOffset?: boolean,\n relativeEffect?: boolean,\n loopEffect?: boolean,\n onUnmount?: () => void\n}) {\n const animationDiv = document.createElement('div');\n animationDiv.classList.add('emoji-animation');\n\n // const size = 280;\n animationDiv.style.width = size + 'px';\n animationDiv.style.height = size + 'px';\n\n let animation: RLottiePlayer;\n const unmountAnimation = () => {\n middlewareHelper.clean();\n animation?.remove();\n animationDiv.remove();\n appImManager.chat.bubbles.scrollable.container.removeEventListener('scroll', onScroll);\n onUnmount?.();\n };\n\n const middlewareHelper = middleware?.create() ?? getMiddleware();\n middleware = middlewareHelper.get();\n\n const stickerPromise = wrapSticker({\n div: animationDiv,\n doc,\n middleware,\n withThumb: false,\n needFadeIn: false,\n loop: !!loopEffect,\n width: size,\n height: size,\n play,\n group: 'none',\n skipRatio,\n managers,\n fullThumb,\n isEffect: true\n }).then(({render}) => render).then((_animation) => {\n assumeType(_animation);\n if(!middleware()) {\n _animation.remove();\n throw makeError('MIDDLEWARE');\n }\n\n animation = _animation;\n animation.addEventListener('enterFrame', (frameNo) => {\n if((!loopEffect && frameNo === animation.maxFrame) || !isInDOM(target)) {\n unmountAnimation();\n }\n });\n\n if(IS_VIBRATE_SUPPORTED) {\n animation.addEventListener('firstFrame', () => {\n navigator.vibrate(100);\n }, {once: true});\n }\n\n return animation;\n });\n\n const generateRandomSigned = (max: number) => {\n const r = Math.random() * max * 2;\n return r > max ? -r % max : r;\n };\n\n const randomOffsetX = withRandomOffset ? generateRandomSigned(16) : 0;\n const randomOffsetY = withRandomOffset ? generateRandomSigned(4) : 0;\n const setPosition = () => {\n if(!isInDOM(target)) {\n unmountAnimation();\n return;\n }\n\n const rect = target.getBoundingClientRect();\n\n const factor = rect.width / 200;\n const stableOffsetX = side === 'center' ? 0 : 16 * (side === 'right' ? 1 : -1) * factor;\n // const stableOffsetY = side === 'center' ? 0 : -50 * factor;\n const stableOffsetY = side === 'center' ? 0 : 0 * factor;\n\n const rectX = side === 'right' ? rect.right : rect.left;\n const rectY = rect.top;\n\n const addOffsetX = (side === 'center' ? (rect.width - size) / 2 : (side === 'right' ? -size : 0)) + stableOffsetX + randomOffsetX;\n const addOffsetY = (side === 'center' || true ? (rect.height - size) / 2 : 0) + stableOffsetY + randomOffsetY;\n const x = rectX + addOffsetX;\n const y = rectY + addOffsetY;\n\n if(y <= -size || y >= windowSize.height) {\n unmountAnimation();\n return;\n }\n\n if(relativeEffect) {\n if(side !== 'center') animationDiv.style[side] = Math.abs(stableOffsetX) * -1 + 'px';\n else animationDiv.style.left = addOffsetX + 'px';\n animationDiv.style.top = addOffsetY + 'px';\n } else {\n animationDiv.style.top = y + 'px';\n animationDiv.style.left = x + 'px';\n }\n };\n\n const onScroll = throttleWithRaf(setPosition);\n appImManager.chat.bubbles.scrollable.container.addEventListener('scroll', onScroll);\n\n setPosition();\n\n if(relativeEffect) {\n animationDiv.classList.add('is-relative');\n target.parentElement.append(animationDiv);\n } else {\n appImManager.emojiAnimationContainer.append(animationDiv);\n }\n\n return {animationDiv, stickerPromise};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../../lib/rootScope';\nimport wrapSticker from './sticker'\nimport {Modify} from '../../types';\n\nexport default async function wrapStickerEmoji(options: Modify[0], {\n div: HTMLElement,\n doc?: never,\n loop?: never\n}>) {\n const {\n emoji,\n div,\n managers = rootScope.managers\n } = options;\n const doc = await managers.appStickersManager.getAnimatedEmojiSticker(emoji);\n if(!doc) {\n div.classList.add('media-sticker-wrapper');\n throw new Error('no sticker');\n }\n\n return wrapSticker({\n doc,\n play: true,\n loop: false,\n ...options\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport createVideo from '../../helpers/dom/createVideo';\nimport renderImageFromUrl from '../../helpers/dom/renderImageFromUrl';\nimport {Document, StickerSet} from '../../layer';\nimport appDownloadManager from '../../lib/appManagers/appDownloadManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport lottieLoader from '../../lib/rlottie/lottieLoader';\nimport rootScope from '../../lib/rootScope';\nimport animationIntersector, {AnimationItemGroup} from '../animationIntersector';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport wrapSticker from './sticker';\nimport {Middleware} from '../../helpers/middleware';\n\nexport default async function wrapStickerSetThumb({set, lazyLoadQueue, container, group, autoplay, width, height, managers = rootScope.managers, middleware}: {\n set: StickerSet.stickerSet,\n lazyLoadQueue: LazyLoadQueue,\n container: HTMLElement,\n group: AnimationItemGroup,\n autoplay: boolean,\n width: number,\n height: number,\n managers?: AppManagers\n middleware?: Middleware\n}) {\n if(set.thumbs?.length) {\n container.classList.add('media-sticker-wrapper');\n lazyLoadQueue.push({\n div: container,\n load: async() => {\n const downloadOptions = await managers.appStickersManager.getStickerSetThumbDownloadOptions(set);\n const promise = appDownloadManager.download(downloadOptions);\n\n if(set.pFlags.animated && !set.pFlags.videos) {\n return promise\n .then((blob) => {\n lottieLoader.loadAnimationWorker({\n container,\n loop: true,\n autoplay,\n animationData: blob,\n width,\n height,\n needUpscale: true,\n name: 'setThumb' + set.id,\n group,\n middleware\n });\n });\n } else {\n let media: HTMLElement;\n if(set.pFlags.videos) {\n media = createVideo();\n (media as HTMLVideoElement).autoplay = true;\n (media as HTMLVideoElement).muted = true;\n (media as HTMLVideoElement).loop = true;\n } else {\n media = new Image();\n }\n\n media.classList.add('media-sticker');\n\n return promise.then((blob) => {\n renderImageFromUrl(media, URL.createObjectURL(blob), () => {\n container.append(media);\n\n if(set.pFlags.videos) {\n animationIntersector.addAnimation({\n animation: media as HTMLVideoElement,\n group\n });\n }\n });\n });\n }\n }\n });\n\n return;\n }\n\n let getDocPromise: Promise;\n\n if(set.thumb_document_id) {\n getDocPromise = managers.appEmojiManager.getCustomEmojiDocument(set.thumb_document_id);\n } else {\n getDocPromise = managers.appStickersManager.getStickerSet(set).then((stickerSet) => stickerSet.documents[0]);\n }\n\n const doc = await getDocPromise;\n if(doc._ !== 'documentEmpty') { // as thumb will be used first sticker\n wrapSticker({\n doc,\n div: container,\n group: group,\n lazyLoadQueue,\n managers,\n width,\n height,\n middleware\n }); // kostil\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport Row from '../row';\nimport wrapSticker from './sticker';\n\nexport default function wrapStickerToRow({doc, row, size, managers}: {\n doc: MyDocument,\n row: Row,\n size?: 'small' | 'large',\n managers?: AppManagers\n}) {\n const previousMedia = row.media;\n const media = row.createMedia('small');\n\n if(previousMedia) {\n media.classList.add('hide');\n }\n\n const loadPromises: Promise[] = previousMedia ? [] : undefined;\n\n const _size = size === 'small' ? 32 : 48;\n const result = wrapSticker({\n div: media,\n doc: doc,\n width: _size,\n height: _size,\n loadPromises,\n managers\n }).then(({render}) => render);\n\n loadPromises && Promise.all(loadPromises).then(() => {\n media.classList.remove('hide');\n previousMedia.remove();\n });\n\n return result;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport getServerMessageId from '../../lib/appManagers/utils/messageId/getServerMessageId';\nimport {i18n} from '../../lib/langPack';\nimport wrapTelegramUrlToAnchor from '../../lib/richTextProcessor/wrapTelegramUrlToAnchor';\nimport rootScope from '../../lib/rootScope';\nimport wrapPeerTitle from './peerTitle';\n\nexport default async function wrapTopicNameButton(\n options: {\n lastMsgId?: number\n } & Pick[0], 'peerId' | 'threadId' | 'wrapOptions' | 'withIcons'>\n) {\n const {peerId, threadId, lastMsgId} = options;\n\n const loadPromise: Promise = Promise.resolve();\n const a = wrapTelegramUrlToAnchor('t.me/c/' + peerId.toChatId() + (threadId ? '/' + getServerMessageId(threadId) : '') + (lastMsgId ? '/' + getServerMessageId(lastMsgId) : ''));\n a.classList.add('topic-name', 'topic-name-button');\n // if(threadId) {\n // const topic = await rootScope.managers.dialogsStorage.getForumTopic(peerId, threadId);\n // if(!topic) {\n // a.append(i18n('Loading'));\n // loadPromise = rootScope.managers.dialogsStorage.getForumTopicById(peerId, threadId)\n // }\n // } else {\n a.append(await wrapPeerTitle(options));\n // }\n\n return {\n cached: true,\n element: a,\n loadPromise\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {IS_SAFARI} from '../../environment/userAgent';\nimport {animateSingle} from '../../helpers/animation';\nimport {ChatAutoDownloadSettings} from '../../helpers/autoDownload';\nimport deferredPromise from '../../helpers/cancellablePromise';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport createVideo from '../../helpers/dom/createVideo';\nimport isInDOM from '../../helpers/dom/isInDOM';\nimport renderImageFromUrl from '../../helpers/dom/renderImageFromUrl';\nimport getStrippedThumbIfNeeded from '../../helpers/getStrippedThumbIfNeeded';\nimport liteMode from '../../helpers/liteMode';\nimport makeError from '../../helpers/makeError';\nimport mediaSizes, {ScreenSize} from '../../helpers/mediaSizes';\nimport {Middleware} from '../../helpers/middleware';\nimport noop from '../../helpers/noop';\nimport onMediaLoad from '../../helpers/onMediaLoad';\nimport {fastRaf} from '../../helpers/schedulers';\nimport throttle from '../../helpers/schedulers/throttle';\nimport sequentialDom from '../../helpers/sequentialDom';\nimport toHHMMSS from '../../helpers/string/toHHMMSS';\nimport {Message, PhotoSize, VideoSize} from '../../layer';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport appDownloadManager from '../../lib/appManagers/appDownloadManager';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport {NULL_PEER_ID} from '../../lib/mtproto/mtproto_config';\nimport rootScope from '../../lib/rootScope';\nimport {ThumbCache} from '../../lib/storages/thumbs';\nimport animationIntersector, {AnimationItemGroup} from '../animationIntersector';\nimport appMediaPlaybackController, {MediaSearchContext} from '../appMediaPlaybackController';\nimport AudioElement, {findMediaTargets} from '../audio';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport ProgressivePreloader from '../preloader';\nimport wrapPhoto from './photo';\n\nconst MAX_VIDEO_AUTOPLAY_SIZE = 50 * 1024 * 1024; // 50 MB\n\nlet roundVideoCircumference = 0;\nmediaSizes.addEventListener('changeScreen', (from, to) => {\n if(to === ScreenSize.mobile || from === ScreenSize.mobile) {\n const elements = Array.from(document.querySelectorAll('.media-round .progress-ring')) as SVGSVGElement[];\n const width = mediaSizes.active.round.width;\n const halfSize = width / 2;\n const radius = halfSize - 7;\n roundVideoCircumference = 2 * Math.PI * radius;\n elements.forEach((element) => {\n element.setAttributeNS(null, 'width', '' + width);\n element.setAttributeNS(null, 'height', '' + width);\n\n const circle = element.firstElementChild as SVGCircleElement;\n circle.setAttributeNS(null, 'cx', '' + halfSize);\n circle.setAttributeNS(null, 'cy', '' + halfSize);\n circle.setAttributeNS(null, 'r', '' + radius);\n\n circle.style.strokeDasharray = roundVideoCircumference + ' ' + roundVideoCircumference;\n circle.style.strokeDashoffset = '' + roundVideoCircumference;\n });\n }\n});\n\nexport default async function wrapVideo({doc, container, message, boxWidth, boxHeight, withTail, isOut, middleware, lazyLoadQueue, noInfo, group, onlyPreview, noPreview, withoutPreloader, loadPromises, noPlayButton, photoSize, videoSize, searchContext, autoDownload, managers = rootScope.managers, noAutoplayAttribute}: {\n doc: MyDocument,\n container?: HTMLElement,\n message?: Message.message,\n boxWidth?: number,\n boxHeight?: number,\n withTail?: boolean,\n isOut?: boolean,\n middleware?: Middleware,\n lazyLoadQueue?: LazyLoadQueue,\n noInfo?: boolean,\n noPlayButton?: boolean,\n group?: AnimationItemGroup,\n onlyPreview?: boolean,\n noPreview?: boolean,\n withoutPreloader?: boolean,\n loadPromises?: Promise[],\n autoDownload?: ChatAutoDownloadSettings,\n photoSize?: PhotoSize,\n videoSize?: Extract,\n searchContext?: MediaSearchContext,\n managers?: AppManagers,\n noAutoplayAttribute?: boolean\n}) {\n const autoDownloadSize = autoDownload?.video;\n let noAutoDownload = autoDownloadSize === 0;\n const isAlbumItem = !(boxWidth && boxHeight);\n const canAutoplay = /* doc.sticker || */(\n (\n doc.type !== 'video' || (\n doc.size <= MAX_VIDEO_AUTOPLAY_SIZE &&\n !isAlbumItem\n )\n ) && (doc.type === 'gif' ? liteMode.isAvailable('gif') : liteMode.isAvailable('video'))\n );\n let spanTime: HTMLElement, spanPlay: HTMLElement;\n\n if(!noInfo) {\n spanTime = document.createElement('span');\n spanTime.classList.add('video-time');\n container.append(spanTime);\n\n let needPlayButton = false;\n if(doc.type !== 'gif') {\n spanTime.innerText = toHHMMSS(doc.duration, false);\n\n if(!noPlayButton && doc.type !== 'round') {\n if(canAutoplay && !noAutoDownload) {\n spanTime.classList.add('tgico', 'can-autoplay');\n } else {\n needPlayButton = true;\n }\n }\n } else {\n spanTime.innerText = 'GIF';\n\n if(!canAutoplay && !noPlayButton) {\n needPlayButton = true;\n noAutoDownload = undefined;\n }\n }\n\n if(needPlayButton) {\n spanPlay = document.createElement('span');\n spanPlay.classList.add('video-play', 'tgico-largeplay', 'btn-circle', 'position-center');\n container.append(spanPlay);\n }\n }\n\n const res: {\n thumb?: typeof photoRes,\n loadPromise: Promise\n } = {} as any;\n\n if(doc.mime_type === 'image/gif') {\n const photoRes = await wrapPhoto({\n photo: doc,\n message,\n container,\n boxWidth,\n boxHeight,\n withTail,\n isOut,\n lazyLoadQueue,\n middleware,\n withoutPreloader,\n loadPromises,\n autoDownloadSize,\n size: photoSize,\n managers\n });\n\n res.thumb = photoRes;\n res.loadPromise = photoRes.loadPromises.full;\n return res;\n }\n\n /* const video = doc.type === 'round' ? appMediaPlaybackController.addMedia(doc, message.mid) as HTMLVideoElement : document.createElement('video');\n if(video.parentElement) {\n video.remove();\n } */\n\n let preloader: ProgressivePreloader; // it must be here, otherwise will get error before initialization in round onPlay\n\n const video = createVideo();\n video.classList.add('media-video');\n video.muted = true;\n if(doc.type === 'round') {\n const divRound = document.createElement('div');\n divRound.classList.add('media-round', 'z-depth-1');\n divRound.dataset.mid = '' + message.mid;\n divRound.dataset.peerId = '' + message.peerId;\n (divRound as any).message = message;\n\n const size = mediaSizes.active.round;\n const halfSize = size.width / 2;\n const strokeWidth = 3.5;\n const radius = halfSize - (strokeWidth * 2);\n divRound.innerHTML = `\n \n `;\n\n const circle = divRound.firstElementChild.firstElementChild as SVGCircleElement;\n if(!roundVideoCircumference) {\n roundVideoCircumference = 2 * Math.PI * radius;\n }\n circle.style.strokeDasharray = roundVideoCircumference + ' ' + roundVideoCircumference;\n circle.style.strokeDashoffset = '' + roundVideoCircumference;\n\n spanTime.classList.add('tgico');\n\n const isUnread = message.pFlags.media_unread;\n if(isUnread) {\n divRound.classList.add('is-unread');\n }\n\n const canvas = document.createElement('canvas');\n canvas.width = canvas.height = doc.w/* * window.devicePixelRatio */;\n\n divRound.prepend(canvas, spanTime);\n divRound.append(video);\n container.append(divRound);\n\n const ctx = canvas.getContext('2d');\n /* ctx.beginPath();\n ctx.arc(canvas.width / 2, canvas.height / 2, canvas.width / 2, 0, Math.PI * 2);\n ctx.clip(); */\n\n const onLoad = () => {\n const message: Message.message = (divRound as any).message;\n const globalVideo = appMediaPlaybackController.addMedia(message, !noAutoDownload) as HTMLVideoElement;\n const clear = () => {\n (appImManager.chat.setPeerPromise || Promise.resolve()).finally(() => {\n if(isInDOM(globalVideo)) {\n return;\n }\n\n globalVideo.removeEventListener('play', onPlay);\n globalVideo.removeEventListener('timeupdate', throttledTimeUpdate);\n globalVideo.removeEventListener('pause', onPaused);\n globalVideo.removeEventListener('ended', onEnded);\n });\n };\n\n const onFrame = () => {\n ctx.drawImage(globalVideo, 0, 0);\n\n const offset = roundVideoCircumference - globalVideo.currentTime / globalVideo.duration * roundVideoCircumference;\n circle.style.strokeDashoffset = '' + offset;\n\n return !globalVideo.paused;\n };\n\n const onTimeUpdate = () => {\n if(!globalVideo.duration) {\n return;\n }\n\n if(!isInDOM(globalVideo)) {\n clear();\n return;\n }\n\n if(globalVideo.paused) {\n onFrame();\n }\n\n spanTime.innerText = toHHMMSS(globalVideo.duration - globalVideo.currentTime, false);\n };\n\n const throttledTimeUpdate = throttle(() => {\n fastRaf(onTimeUpdate);\n }, 1000, false);\n\n const onPlay = () => {\n video.classList.add('hide');\n divRound.classList.remove('is-paused');\n animateSingle(onFrame, canvas);\n\n if(preloader && preloader.preloader && preloader.preloader.classList.contains('manual')) {\n preloader.onClick();\n }\n };\n\n const onPaused = () => {\n if(!isInDOM(globalVideo)) {\n clear();\n return;\n }\n\n divRound.classList.add('is-paused');\n };\n\n const onEnded = () => {\n video.classList.remove('hide');\n divRound.classList.add('is-paused');\n\n video.currentTime = 0;\n spanTime.innerText = toHHMMSS(globalVideo.duration, false);\n\n if(globalVideo.currentTime) {\n globalVideo.currentTime = 0;\n }\n };\n\n globalVideo.addEventListener('play', onPlay);\n globalVideo.addEventListener('timeupdate', throttledTimeUpdate);\n globalVideo.addEventListener('pause', onPaused);\n globalVideo.addEventListener('ended', onEnded);\n\n attachClickEvent(canvas, (e) => {\n cancelEvent(e);\n\n // ! костыль\n if(preloader && !preloader.detached) {\n preloader.onClick();\n }\n\n // ! can't use it here. on Safari iOS video won't start.\n /* if(globalVideo.readyState < 2) {\n return;\n } */\n\n if(globalVideo.paused) {\n const hadSearchContext = !!searchContext;\n if(appMediaPlaybackController.setSearchContext(searchContext || {\n peerId: NULL_PEER_ID,\n inputFilter: {_: 'inputMessagesFilterEmpty'},\n useSearch: false\n })) {\n const [prev, next] = !hadSearchContext ? [] : findMediaTargets(divRound, message.mid/* , searchContext.useSearch */);\n appMediaPlaybackController.setTargets({peerId: message.peerId, mid: message.mid}, prev, next);\n }\n\n globalVideo.play();\n } else {\n globalVideo.pause();\n }\n });\n\n if(globalVideo.paused) {\n if(globalVideo.duration && globalVideo.currentTime !== globalVideo.duration && globalVideo.currentTime > 0) {\n onFrame();\n onTimeUpdate();\n video.classList.add('hide');\n } else {\n onPaused();\n }\n } else {\n onPlay();\n }\n };\n\n if(message.pFlags.is_outgoing) {\n // ! WARNING ! just to type-check\n (divRound as any as AudioElement).onLoad = onLoad;\n divRound.dataset.isOutgoing = '1';\n } else {\n onLoad();\n }\n } else if(!noAutoplayAttribute) {\n video.autoplay = true; // для safari\n }\n\n let photoRes: Awaited>;\n if(message) {\n photoRes = await wrapPhoto({\n photo: doc,\n message,\n container,\n boxWidth,\n boxHeight,\n withTail,\n isOut,\n lazyLoadQueue,\n middleware,\n withoutPreloader: true,\n loadPromises,\n autoDownloadSize: autoDownload?.photo,\n size: photoSize,\n managers\n });\n\n res.thumb = photoRes;\n\n if((!canAutoplay && doc.type !== 'gif') || onlyPreview) {\n res.loadPromise = photoRes.loadPromises.full;\n return res;\n }\n\n if(withTail) {\n const foreignObject = (photoRes.images.thumb || photoRes.images.full).parentElement;\n video.width = +foreignObject.getAttributeNS(null, 'width');\n video.height = +foreignObject.getAttributeNS(null, 'height');\n foreignObject.append(video);\n }\n } else if(!noPreview) { // * gifs masonry\n const gotThumb = getStrippedThumbIfNeeded(doc, {} as ThumbCache, true);\n if(gotThumb) {\n const thumbImage = gotThumb.image;\n thumbImage.classList.add('media-poster');\n container.append(thumbImage);\n res.thumb = {\n loadPromises: {\n thumb: gotThumb.loadPromise,\n full: Promise.resolve()\n },\n images: {\n thumb: thumbImage,\n full: null\n },\n preloader: null,\n aspecter: null\n };\n\n loadPromises?.push(gotThumb.loadPromise);\n res.loadPromise = gotThumb.loadPromise;\n }\n }\n\n if(onlyPreview) {\n return res;\n }\n\n if(!video.parentElement && container) {\n (photoRes?.aspecter || container).append(video);\n }\n\n let cacheContext: ThumbCache;\n const getCacheContext = async() => {\n return cacheContext = await managers.thumbsStorage.getCacheContext(doc, videoSize?.type);\n };\n\n await getCacheContext();\n\n const uploadFileName = message?.uploadingFileName;\n if(uploadFileName) { // means upload\n preloader = new ProgressivePreloader({\n attachMethod: 'prepend',\n isUpload: true\n });\n preloader.attachPromise(appDownloadManager.getUpload(uploadFileName));\n preloader.attach(container, false);\n noAutoDownload = undefined;\n } else if(!cacheContext.downloaded && !doc.supportsStreaming && !withoutPreloader) {\n preloader = new ProgressivePreloader({\n attachMethod: 'prepend'\n });\n } else if(doc.supportsStreaming) {\n preloader = new ProgressivePreloader({\n cancelable: false,\n attachMethod: 'prepend'\n });\n }\n\n const renderDeferred = deferredPromise();\n video.addEventListener('error', (e) => {\n if(video.error.code !== 4) {\n console.error('Error ' + video.error.code + '; details: ' + video.error.message);\n }\n\n if(preloader && !uploadFileName) {\n preloader.detach();\n }\n\n if(!renderDeferred.isFulfilled) {\n renderDeferred.resolve();\n }\n }, {once: true});\n\n if(doc.type === 'video') {\n const onTimeUpdate = () => {\n if(!video.duration) {\n return;\n }\n\n spanTime.innerText = toHHMMSS(video.duration - video.currentTime, false);\n };\n\n const throttledTimeUpdate = throttle(() => {\n fastRaf(onTimeUpdate);\n }, 1e3, false);\n\n video.addEventListener('timeupdate', throttledTimeUpdate);\n\n if(spanPlay) {\n video.addEventListener('timeupdate', () => {\n sequentialDom.mutateElement(spanPlay, () => {\n spanPlay.remove();\n });\n }, {once: true});\n }\n }\n\n video.muted = true;\n video.loop = true;\n // video.play();\n if(!noAutoplayAttribute) {\n video.autoplay = true;\n }\n\n let loadPhotoThumbFunc = noAutoDownload && photoRes?.preloader?.loadFunc;\n const load = async() => {\n if(preloader && noAutoDownload && !withoutPreloader) {\n preloader.construct();\n preloader.setManual();\n }\n\n await getCacheContext();\n let loadPromise: Promise = Promise.resolve();\n if((preloader && !uploadFileName) || withoutPreloader) {\n if(!cacheContext.downloaded && !doc.supportsStreaming) {\n const promise = loadPromise = appDownloadManager.downloadMediaURL({\n media: doc,\n queueId: lazyLoadQueue?.queueId,\n onlyCache: noAutoDownload,\n thumb: videoSize\n });\n\n if(preloader) {\n preloader.attach(container, false, promise);\n }\n } else if(doc.supportsStreaming) {\n if(noAutoDownload) {\n loadPromise = Promise.reject(makeError('NO_AUTO_DOWNLOAD'));\n } else if(!cacheContext.downloaded && preloader) { // * check for uploading video\n preloader.attach(container, false, null);\n video.addEventListener(IS_SAFARI ? 'timeupdate' : 'canplay', () => {\n preloader.detach();\n }, {once: true});\n }\n }\n }\n\n if(!noAutoDownload && loadPhotoThumbFunc) {\n loadPhotoThumbFunc();\n loadPhotoThumbFunc = null;\n }\n\n noAutoDownload = undefined;\n\n loadPromise.then(async() => {\n if(middleware && !middleware()) {\n renderDeferred.resolve();\n return;\n }\n\n if(doc.type === 'round') {\n appMediaPlaybackController.resolveWaitingForLoadMedia(message.peerId, message.mid, message.pFlags.is_scheduled);\n }\n\n await getCacheContext();\n\n onMediaLoad(video).then(() => {\n if(group) {\n animationIntersector.addAnimation({\n animation: video,\n group\n });\n }\n\n if(preloader && !uploadFileName) {\n preloader.detach();\n }\n\n renderDeferred.resolve();\n }, (err) => {\n console.error('video load error', err);\n if(spanTime) {\n spanTime.classList.add('is-error');\n }\n renderDeferred.reject(err);\n });\n\n renderImageFromUrl(video, cacheContext.url);\n }, noop);\n\n return {download: loadPromise, render: Promise.all([loadPromise, renderDeferred])};\n };\n\n if(preloader && !uploadFileName) {\n preloader.setDownloadFunction(load);\n }\n\n (container as any).preloader = preloader;\n\n /* if(doc.size >= 20e6 && !doc.downloaded) {\n let downloadDiv = document.createElement('div');\n downloadDiv.classList.add('download');\n\n let span = document.createElement('span');\n span.classList.add('btn-circle', 'tgico-download');\n downloadDiv.append(span);\n\n downloadDiv.addEventListener('click', () => {\n downloadDiv.remove();\n loadVideo();\n });\n\n container.prepend(downloadDiv);\n\n return;\n } */\n\n if(doc.type === 'gif' && !canAutoplay) {\n attachClickEvent(container, (e) => {\n cancelEvent(e);\n spanPlay.remove();\n load();\n }, {capture: true, once: true});\n } else {\n res.loadPromise = !lazyLoadQueue ?\n (await load()).render :\n (lazyLoadQueue.push({div: container, load: () => load().then(({render}) => render)}), Promise.resolve());\n }\n\n if(res.thumb) {\n await res.thumb.loadPromises.thumb;\n }\n\n return res;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport limitSymbols from '../../helpers/string/limitSymbols';\nimport {WebPage} from '../../layer';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\n\nexport default function wrapWebPageDescription(webPage: WebPage.webPage) {\n const shortDescriptionText = limitSymbols(webPage.description || '', 150, 180);\n // const siteName = webPage.site_name;\n // let contextHashtag = '';\n // if(siteName === 'GitHub') {\n // const matches = apiWebPage.url.match(/(https?:\\/\\/github\\.com\\/[^\\/]+\\/[^\\/]+)/);\n // if(matches) {\n // contextHashtag = matches[0] + '/issues/{1}';\n // }\n // }\n return wrapRichText(shortDescriptionText/* , {\n contextSite: siteName || 'external',\n contextHashtag: contextHashtag\n } */);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport limitSymbols from '../../helpers/string/limitSymbols';\nimport {WebPage} from '../../layer';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\n\nexport default function wrapWebPageTitle(webPage: WebPage.webPage) {\n let shortTitle = webPage.title || webPage.author || webPage.site_name || '';\n shortTitle = limitSymbols(shortTitle, 80, 100);\n return wrapRichText(shortTitle, {noLinks: true, noLinebreaks: true});\n}\n","// Taken from https://core.telegram.org/bots/payments/currencies.json\nexport type Currency = {\n code: string,\n title: string,\n symbol: string,\n native: string,\n thousands_sep: string,\n decimal_sep: string,\n symbol_left: boolean,\n space_between: boolean,\n exp: number,\n min_amount: string | number,\n max_amount: string | number\n};\n\n// eslint-disable-next-line quotes, comma-spacing\nconst Currencies: {[currency: string]: Currency} = {\"AED\":{\"code\":\"AED\",\"title\":\"United Arab Emirates Dirham\",\"symbol\":\"AED\",\"native\":\"د.إ.‏\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"367\",\"max_amount\":\"3673030\"},\"AFN\":{\"code\":\"AFN\",\"title\":\"Afghan Afghani\",\"symbol\":\"AFN\",\"native\":\"؋\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"8729\",\"max_amount\":\"87299487\"},\"ALL\":{\"code\":\"ALL\",\"title\":\"Albanian Lek\",\"symbol\":\"ALL\",\"native\":\"Lek\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":false,\"exp\":2,\"min_amount\":\"11842\",\"max_amount\":\"118421187\"},\"AMD\":{\"code\":\"AMD\",\"title\":\"Armenian Dram\",\"symbol\":\"AMD\",\"native\":\"դր.\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"40943\",\"max_amount\":\"409436718\"},\"ARS\":{\"code\":\"ARS\",\"title\":\"Argentine Peso\",\"symbol\":\"ARS\",\"native\":\"$\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"14705\",\"max_amount\":\"147059002\"},\"AUD\":{\"code\":\"AUD\",\"title\":\"Australian Dollar\",\"symbol\":\"AU$\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"153\",\"max_amount\":\"1536825\"},\"AZN\":{\"code\":\"AZN\",\"title\":\"Azerbaijani Manat\",\"symbol\":\"AZN\",\"native\":\"ман.\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"169\",\"max_amount\":\"1699858\"},\"BAM\":{\"code\":\"BAM\",\"title\":\"Bosnia & Herzegovina Convertible Mark\",\"symbol\":\"BAM\",\"native\":\"KM\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"199\",\"max_amount\":\"1990677\"},\"BDT\":{\"code\":\"BDT\",\"title\":\"Bangladeshi Taka\",\"symbol\":\"BDT\",\"native\":\"৳\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"10009\",\"max_amount\":\"100094046\"},\"BGN\":{\"code\":\"BGN\",\"title\":\"Bulgarian Lev\",\"symbol\":\"BGN\",\"native\":\"лв.\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"199\",\"max_amount\":\"1993315\"},\"BND\":{\"code\":\"BND\",\"title\":\"Brunei Dollar\",\"symbol\":\"BND\",\"native\":\"$\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"142\",\"max_amount\":\"1421883\"},\"BOB\":{\"code\":\"BOB\",\"title\":\"Bolivian Boliviano\",\"symbol\":\"BOB\",\"native\":\"Bs\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"683\",\"max_amount\":\"6832607\"},\"BRL\":{\"code\":\"BRL\",\"title\":\"Brazilian Real\",\"symbol\":\"R$\",\"native\":\"R$\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"539\",\"max_amount\":\"5397799\"},\"BYN\":{\"code\":\"BYN\",\"title\":\"Belarusian ruble\",\"symbol\":\"BYN\",\"native\":\"BYN\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"249\",\"max_amount\":\"2495801\"},\"CAD\":{\"code\":\"CAD\",\"title\":\"Canadian Dollar\",\"symbol\":\"CA$\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"136\",\"max_amount\":\"1366860\"},\"CHF\":{\"code\":\"CHF\",\"title\":\"Swiss Franc\",\"symbol\":\"CHF\",\"native\":\"CHF\",\"thousands_sep\":\"'\",\"decimal_sep\":\".\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"97\",\"max_amount\":\"976705\"},\"CLP\":{\"code\":\"CLP\",\"title\":\"Chilean Peso\",\"symbol\":\"CLP\",\"native\":\"$\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":true,\"exp\":0,\"min_amount\":\"963\",\"max_amount\":\"9637495\"},\"CNY\":{\"code\":\"CNY\",\"title\":\"Chinese Renminbi Yuan\",\"symbol\":\"CN¥\",\"native\":\"CN¥\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"709\",\"max_amount\":\"7094102\"},\"COP\":{\"code\":\"COP\",\"title\":\"Colombian Peso\",\"symbol\":\"COP\",\"native\":\"$\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"452870\",\"max_amount\":\"4528700000\"},\"CRC\":{\"code\":\"CRC\",\"title\":\"Costa Rican Colón\",\"symbol\":\"CRC\",\"native\":\"₡\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"62506\",\"max_amount\":\"625061070\"},\"CZK\":{\"code\":\"CZK\",\"title\":\"Czech Koruna\",\"symbol\":\"CZK\",\"native\":\"Kč\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"2497\",\"max_amount\":\"24975029\"},\"DKK\":{\"code\":\"DKK\",\"title\":\"Danish Krone\",\"symbol\":\"DKK\",\"native\":\"kr\",\"thousands_sep\":\"\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"755\",\"max_amount\":\"7555990\"},\"DOP\":{\"code\":\"DOP\",\"title\":\"Dominican Peso\",\"symbol\":\"DOP\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"5275\",\"max_amount\":\"52757308\"},\"DZD\":{\"code\":\"DZD\",\"title\":\"Algerian Dinar\",\"symbol\":\"DZD\",\"native\":\"د.ج.‏\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"14035\",\"max_amount\":\"140353307\"},\"EGP\":{\"code\":\"EGP\",\"title\":\"Egyptian Pound\",\"symbol\":\"EGP\",\"native\":\"ج.م.‏\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"1953\",\"max_amount\":\"19537405\"},\"ETB\":{\"code\":\"ETB\",\"title\":\"Ethiopian Birr\",\"symbol\":\"ETB\",\"native\":\"ብር\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"5224\",\"max_amount\":\"52247069\"},\"EUR\":{\"code\":\"EUR\",\"title\":\"Euro\",\"symbol\":\"€\",\"native\":\"€\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"101\",\"max_amount\":\"1016045\"},\"GBP\":{\"code\":\"GBP\",\"title\":\"British Pound\",\"symbol\":\"£\",\"native\":\"£\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"89\",\"max_amount\":\"894445\"},\"GEL\":{\"code\":\"GEL\",\"title\":\"Georgian Lari\",\"symbol\":\"GEL\",\"native\":\"GEL\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"283\",\"max_amount\":\"2830234\"},\"GTQ\":{\"code\":\"GTQ\",\"title\":\"Guatemalan Quetzal\",\"symbol\":\"GTQ\",\"native\":\"Q\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"778\",\"max_amount\":\"7781323\"},\"HKD\":{\"code\":\"HKD\",\"title\":\"Hong Kong Dollar\",\"symbol\":\"HK$\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"784\",\"max_amount\":\"7849750\"},\"HNL\":{\"code\":\"HNL\",\"title\":\"Honduran Lempira\",\"symbol\":\"HNL\",\"native\":\"L\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"2441\",\"max_amount\":\"24413729\"},\"HRK\":{\"code\":\"HRK\",\"title\":\"Croatian Kuna\",\"symbol\":\"HRK\",\"native\":\"kn\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"764\",\"max_amount\":\"7648805\"},\"HUF\":{\"code\":\"HUF\",\"title\":\"Hungarian Forint\",\"symbol\":\"HUF\",\"native\":\"Ft\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"42685\",\"max_amount\":\"426850229\"},\"IDR\":{\"code\":\"IDR\",\"title\":\"Indonesian Rupiah\",\"symbol\":\"IDR\",\"native\":\"Rp\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"1523370\",\"max_amount\":\"15233700000\"},\"ILS\":{\"code\":\"ILS\",\"title\":\"Israeli New Sheqel\",\"symbol\":\"₪\",\"native\":\"₪\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"354\",\"max_amount\":\"3543350\"},\"INR\":{\"code\":\"INR\",\"title\":\"Indian Rupee\",\"symbol\":\"₹\",\"native\":\"₹\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"8155\",\"max_amount\":\"81555550\"},\"ISK\":{\"code\":\"ISK\",\"title\":\"Icelandic Króna\",\"symbol\":\"ISK\",\"native\":\"kr\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":0,\"min_amount\":\"142\",\"max_amount\":\"1425603\"},\"JMD\":{\"code\":\"JMD\",\"title\":\"Jamaican Dollar\",\"symbol\":\"JMD\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"15013\",\"max_amount\":\"150131044\"},\"JPY\":{\"code\":\"JPY\",\"title\":\"Japanese Yen\",\"symbol\":\"¥\",\"native\":\"¥\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":0,\"min_amount\":\"144\",\"max_amount\":\"1443065\"},\"KES\":{\"code\":\"KES\",\"title\":\"Kenyan Shilling\",\"symbol\":\"KES\",\"native\":\"Ksh\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"12075\",\"max_amount\":\"120750271\"},\"KGS\":{\"code\":\"KGS\",\"title\":\"Kyrgyzstani Som\",\"symbol\":\"KGS\",\"native\":\"KGS\",\"thousands_sep\":\" \",\"decimal_sep\":\"-\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"8018\",\"max_amount\":\"80182898\"},\"KRW\":{\"code\":\"KRW\",\"title\":\"South Korean Won\",\"symbol\":\"₩\",\"native\":\"₩\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":0,\"min_amount\":\"1431\",\"max_amount\":\"14315201\"},\"KZT\":{\"code\":\"KZT\",\"title\":\"Kazakhstani Tenge\",\"symbol\":\"KZT\",\"native\":\"₸\",\"thousands_sep\":\" \",\"decimal_sep\":\"-\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"47186\",\"max_amount\":\"471867112\"},\"LBP\":{\"code\":\"LBP\",\"title\":\"Lebanese Pound\",\"symbol\":\"LBP\",\"native\":\"ل.ل.‏\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"150999\",\"max_amount\":\"1509998778\"},\"LKR\":{\"code\":\"LKR\",\"title\":\"Sri Lankan Rupee\",\"symbol\":\"LKR\",\"native\":\"රු.\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"35546\",\"max_amount\":\"355469651\"},\"MAD\":{\"code\":\"MAD\",\"title\":\"Moroccan Dirham\",\"symbol\":\"MAD\",\"native\":\"د.م.‏\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"1093\",\"max_amount\":\"10938136\"},\"MDL\":{\"code\":\"MDL\",\"title\":\"Moldovan Leu\",\"symbol\":\"MDL\",\"native\":\"MDL\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"1926\",\"max_amount\":\"19264439\"},\"MNT\":{\"code\":\"MNT\",\"title\":\"Mongolian Tögrög\",\"symbol\":\"MNT\",\"native\":\"MNT\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"322444\",\"max_amount\":\"3224442056\"},\"MUR\":{\"code\":\"MUR\",\"title\":\"Mauritian Rupee\",\"symbol\":\"MUR\",\"native\":\"MUR\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"4453\",\"max_amount\":\"44535174\"},\"MVR\":{\"code\":\"MVR\",\"title\":\"Maldivian Rufiyaa\",\"symbol\":\"MVR\",\"native\":\"MVR\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"1546\",\"max_amount\":\"15460397\"},\"MXN\":{\"code\":\"MXN\",\"title\":\"Mexican Peso\",\"symbol\":\"MX$\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"2012\",\"max_amount\":\"20122860\"},\"MYR\":{\"code\":\"MYR\",\"title\":\"Malaysian Ringgit\",\"symbol\":\"MYR\",\"native\":\"RM\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"463\",\"max_amount\":\"4632502\"},\"MZN\":{\"code\":\"MZN\",\"title\":\"Mozambican Metical\",\"symbol\":\"MZN\",\"native\":\"MTn\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"6382\",\"max_amount\":\"63829729\"},\"NGN\":{\"code\":\"NGN\",\"title\":\"Nigerian Naira\",\"symbol\":\"NGN\",\"native\":\"₦\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"43203\",\"max_amount\":\"432039828\"},\"NIO\":{\"code\":\"NIO\",\"title\":\"Nicaraguan Córdoba\",\"symbol\":\"NIO\",\"native\":\"C$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"3556\",\"max_amount\":\"35566412\"},\"NOK\":{\"code\":\"NOK\",\"title\":\"Norwegian Krone\",\"symbol\":\"NOK\",\"native\":\"kr\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"1069\",\"max_amount\":\"10690975\"},\"NPR\":{\"code\":\"NPR\",\"title\":\"Nepalese Rupee\",\"symbol\":\"NPR\",\"native\":\"नेरू\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"12954\",\"max_amount\":\"129546657\"},\"NZD\":{\"code\":\"NZD\",\"title\":\"New Zealand Dollar\",\"symbol\":\"NZ$\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"174\",\"max_amount\":\"1746220\"},\"PAB\":{\"code\":\"PAB\",\"title\":\"Panamanian Balboa\",\"symbol\":\"PAB\",\"native\":\"B\\/.\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"98\",\"max_amount\":\"988722\"},\"PEN\":{\"code\":\"PEN\",\"title\":\"Peruvian Nuevo Sol\",\"symbol\":\"PEN\",\"native\":\"S\\/.\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"390\",\"max_amount\":\"3902208\"},\"PHP\":{\"code\":\"PHP\",\"title\":\"Philippine Peso\",\"symbol\":\"PHP\",\"native\":\"₱\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"5862\",\"max_amount\":\"58627496\"},\"PKR\":{\"code\":\"PKR\",\"title\":\"Pakistani Rupee\",\"symbol\":\"PKR\",\"native\":\"₨\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"22642\",\"max_amount\":\"226426805\"},\"PLN\":{\"code\":\"PLN\",\"title\":\"Polish Złoty\",\"symbol\":\"PLN\",\"native\":\"zł\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"493\",\"max_amount\":\"4932350\"},\"PYG\":{\"code\":\"PYG\",\"title\":\"Paraguayan Guaraní\",\"symbol\":\"PYG\",\"native\":\"₲\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":true,\"exp\":0,\"min_amount\":\"6977\",\"max_amount\":\"69772317\"},\"QAR\":{\"code\":\"QAR\",\"title\":\"Qatari Riyal\",\"symbol\":\"QAR\",\"native\":\"ر.ق.‏\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"364\",\"max_amount\":\"3640989\"},\"RON\":{\"code\":\"RON\",\"title\":\"Romanian Leu\",\"symbol\":\"RON\",\"native\":\"RON\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"502\",\"max_amount\":\"5028645\"},\"RSD\":{\"code\":\"RSD\",\"title\":\"Serbian Dinar\",\"symbol\":\"RSD\",\"native\":\"дин.\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"11918\",\"max_amount\":\"119184990\"},\"RUB\":{\"code\":\"RUB\",\"title\":\"Russian Ruble\",\"symbol\":\"RUB\",\"native\":\"₽\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"7128\",\"max_amount\":\"71281218\"},\"SAR\":{\"code\":\"SAR\",\"title\":\"Saudi Riyal\",\"symbol\":\"SAR\",\"native\":\"ر.س.‏\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"375\",\"max_amount\":\"3756546\"},\"SEK\":{\"code\":\"SEK\",\"title\":\"Swedish Krona\",\"symbol\":\"SEK\",\"native\":\"kr\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"1109\",\"max_amount\":\"11094972\"},\"SGD\":{\"code\":\"SGD\",\"title\":\"Singapore Dollar\",\"symbol\":\"SGD\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"143\",\"max_amount\":\"1430495\"},\"THB\":{\"code\":\"THB\",\"title\":\"Thai Baht\",\"symbol\":\"฿\",\"native\":\"฿\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"3780\",\"max_amount\":\"37800497\"},\"TJS\":{\"code\":\"TJS\",\"title\":\"Tajikistani Somoni\",\"symbol\":\"TJS\",\"native\":\"TJS\",\"thousands_sep\":\" \",\"decimal_sep\":\";\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"975\",\"max_amount\":\"9753854\"},\"TRY\":{\"code\":\"TRY\",\"title\":\"Turkish Lira\",\"symbol\":\"TRY\",\"native\":\"TL\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"1854\",\"max_amount\":\"18543598\"},\"TTD\":{\"code\":\"TTD\",\"title\":\"Trinidad and Tobago Dollar\",\"symbol\":\"TTD\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"672\",\"max_amount\":\"6722681\"},\"TWD\":{\"code\":\"TWD\",\"title\":\"New Taiwan Dollar\",\"symbol\":\"NT$\",\"native\":\"NT$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"3173\",\"max_amount\":\"31738502\"},\"TZS\":{\"code\":\"TZS\",\"title\":\"Tanzanian Shilling\",\"symbol\":\"TZS\",\"native\":\"TSh\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"233199\",\"max_amount\":\"2331999890\"},\"UAH\":{\"code\":\"UAH\",\"title\":\"Ukrainian Hryvnia\",\"symbol\":\"UAH\",\"native\":\"₴\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":false,\"exp\":2,\"min_amount\":\"3633\",\"max_amount\":\"36338830\"},\"UGX\":{\"code\":\"UGX\",\"title\":\"Ugandan Shilling\",\"symbol\":\"UGX\",\"native\":\"USh\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":0,\"min_amount\":\"3816\",\"max_amount\":\"38166726\"},\"USD\":{\"code\":\"USD\",\"title\":\"United States Dollar\",\"symbol\":\"$\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"100\",\"max_amount\":1000000},\"UYU\":{\"code\":\"UYU\",\"title\":\"Uruguayan Peso\",\"symbol\":\"UYU\",\"native\":\"$\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"4080\",\"max_amount\":\"40801205\"},\"UZS\":{\"code\":\"UZS\",\"title\":\"Uzbekistani Som\",\"symbol\":\"UZS\",\"native\":\"UZS\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"1089058\",\"max_amount\":\"10890583014\"},\"VND\":{\"code\":\"VND\",\"title\":\"Vietnamese Đồng\",\"symbol\":\"₫\",\"native\":\"₫\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":0,\"min_amount\":\"23862\",\"max_amount\":\"238625000\"},\"YER\":{\"code\":\"YER\",\"title\":\"Yemeni Rial\",\"symbol\":\"YER\",\"native\":\"ر.ي.‏\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"25030\",\"max_amount\":\"250300677\"},\"ZAR\":{\"code\":\"ZAR\",\"title\":\"South African Rand\",\"symbol\":\"ZAR\",\"native\":\"R\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"1789\",\"max_amount\":\"17894299\"}};\n\nexport default Currencies;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {EMOJI_VERSION} from '../environment/emojiVersionsSupport';\n\nexport const EmojiVersions: {[version in EMOJI_VERSION]: {[emoji: string]: number}} = {'14':{'1f6dd':4867, '1f6de':4916, '1f6df':4923, '1f7f0':62832, '1f979':183, '1f9cc':1557, '1fa7b':61332, '1fa7c':61330, '1faa9':51093, '1faaa':61364, '1faab':61189, '1faac':51085, '1fab7':2651, '1fab8':2631, '1fab9':2672, '1faba':2673, '1fac3':1520, '1fac4':1521, '1fac5':1505, '1fad7':3793, '1fad8':3707, '1fad9':3804, '1fae0':111, '1fae1':136, '1fae2':132, '1fae3':133, '1fae4':174, '1fae5':142, '1fae6':1385, '1fae7':61353, '1faf0':1341, '1faf1':1332, '1faf2':1333, '1faf3':1334, '1faf4':1335, '1faf5':1351, '1faf6':1360, '1faf1-1f3fb-200d-1faf2-1f3fc':0, '1faf1-1f3fb-200d-1faf2-1f3fd':0, '1faf1-1f3fb-200d-1faf2-1f3fe':0, '1faf1-1f3fb-200d-1faf2-1f3ff':0, '1faf1-1f3fc-200d-1faf2-1f3fb':0, '1faf1-1f3fc-200d-1faf2-1f3fd':0, '1faf1-1f3fc-200d-1faf2-1f3fe':0, '1faf1-1f3fc-200d-1faf2-1f3ff':0, '1faf1-1f3fd-200d-1faf2-1f3fb':0, '1faf1-1f3fd-200d-1faf2-1f3fc':0, '1faf1-1f3fd-200d-1faf2-1f3fe':0, '1faf1-1f3fd-200d-1faf2-1f3ff':0, '1faf1-1f3fe-200d-1faf2-1f3fb':0, '1faf1-1f3fe-200d-1faf2-1f3fc':0, '1faf1-1f3fe-200d-1faf2-1f3fd':0, '1faf1-1f3fe-200d-1faf2-1f3ff':0, '1faf1-1f3ff-200d-1faf2-1f3fb':0, '1faf1-1f3ff-200d-1faf2-1f3fc':0, '1faf1-1f3ff-200d-1faf2-1f3fd':0, '1faf1-1f3ff-200d-1faf2-1f3fe':0, '1fac3-1f3fb':0, '1fac3-1f3fc':0, '1fac3-1f3fd':0, '1fac3-1f3fe':0, '1fac3-1f3ff':0, '1fac4-1f3fb':0, '1fac4-1f3fc':0, '1fac4-1f3fd':0, '1fac4-1f3fe':0, '1fac4-1f3ff':0, '1fac5-1f3fb':0, '1fac5-1f3fc':0, '1fac5-1f3fd':0, '1fac5-1f3fe':0, '1fac5-1f3ff':0, '1faf0-1f3fb':0, '1faf0-1f3fc':0, '1faf0-1f3fd':0, '1faf0-1f3fe':0, '1faf0-1f3ff':0, '1faf1-1f3fb':0, '1faf1-1f3fc':0, '1faf1-1f3fd':0, '1faf1-1f3fe':0, '1faf1-1f3ff':0, '1faf2-1f3fb':0, '1faf2-1f3fc':0, '1faf2-1f3fd':0, '1faf2-1f3fe':0, '1faf2-1f3ff':0, '1faf3-1f3fb':0, '1faf3-1f3fc':0, '1faf3-1f3fd':0, '1faf3-1f3fe':0, '1faf3-1f3ff':0, '1faf4-1f3fb':0, '1faf4-1f3fc':0, '1faf4-1f3fd':0, '1faf4-1f3fe':0, '1faf4-1f3ff':0, '1faf5-1f3fb':0, '1faf5-1f3fc':0, '1faf5-1f3fd':0, '1faf5-1f3fe':0, '1faf5-1f3ff':0, '1faf6-1f3fb':0, '1faf6-1f3fc':0, '1faf6-1f3fd':0, '1faf6-1f3fe':0, '1faf6-1f3ff':0}, '':{'2049':62835, '2122':62863, '2139':62888, '2194':62764, '2195':62763, '2196':62762, '2197':62756, '2198':62758, '2199':62760, '2328':61194, '2600':4990, '2601':4998, '2602':41013, '2603':41018, '2604':41020, '2611':62851, '2614':41014, '2615':3781, '2618':2667, '2620':1106, '2622':62753, '2623':62754, '2626':62783, '2638':62780, '2639':177, '2648':62788, '2649':62789, '2650':62796, '2651':62797, '2652':62798, '2653':62799, '2660':51095, '2663':51098, '2665':51096, '2666':51097, '2668':4865, '2692':61297, '2693':4922, '2694':61300, '2696':61311, '2697':61319, '2699':61309, '2702':61284, '2705':62850, '2708':4931, '2709':61245, '2712':61259, '2714':62852, '2716':62828, '2721':62779, '2728':51029, '2733':62858, '2734':62859, '2744':41017, '2747':62860, '2753':62836, '2754':62837, '2755':62838, '2757':62839, '2763':1137, '2764':1141, '2795':62829, '2796':62830, '2797':62831, '2934':62767, '2935':62768, '3030':62840, '3297':62912, '3299':62913, '0023-20e3':62864, '002a-20e3':62865, '0030-20e3':62866, '0031-20e3':62867, '0032-20e3':62868, '0033-20e3':62869, '0034-20e3':62870, '0035-20e3':62871, '0036-20e3':62872, '0037-20e3':62873, '0038-20e3':62874, '0039-20e3':62875, '00a9':62861, '00ae':62862, '1f004':51101, '1f0cf':51100, '1f170':62882, '1f171':62884, '1f17e':62893, '1f17f':62895, '1f18e':62883, '1f191':62885, '1f192':62886, '1f193':62887, '1f194':62889, '1f195':62891, '1f196':62892, '1f197':62894, '1f198':62896, '1f199':62897, '1f19a':62898, '1f1e6-1f1e8':71594, '1f1e6-1f1e9':71595, '1f1e6-1f1ea':71596, '1f1e6-1f1eb':71597, '1f1e6-1f1ec':71598, '1f1e6-1f1ee':71599, '1f1e6-1f1f1':71600, '1f1e6-1f1f2':71601, '1f1e6-1f1f4':71602, '1f1e6-1f1f6':71603, '1f1e6-1f1f7':71604, '1f1e6-1f1f8':71605, '1f1e6-1f1f9':71606, '1f1e6-1f1fa':71607, '1f1e6-1f1fc':71608, '1f1e6-1f1fd':71609, '1f1e6-1f1ff':71610, '1f1e7-1f1e6':71611, '1f1e7-1f1e7':71612, '1f1e7-1f1e9':71613, '1f1e7-1f1ea':71614, '1f1e7-1f1eb':71615, '1f1e7-1f1ec':71616, '1f1e7-1f1ed':71617, '1f1e7-1f1ee':71618, '1f1e7-1f1ef':71619, '1f1e7-1f1f1':71620, '1f1e7-1f1f2':71621, '1f1e7-1f1f3':71622, '1f1e7-1f1f4':71623, '1f1e7-1f1f6':71624, '1f1e7-1f1f7':71625, '1f1e7-1f1f8':71626, '1f1e7-1f1f9':71627, '1f1e7-1f1fb':71628, '1f1e7-1f1fc':71629, '1f1e7-1f1fe':71630, '1f1e7-1f1ff':71631, '1f1e8-1f1e6':71632, '1f1e8-1f1e8':71633, '1f1e8-1f1e9':71634, '1f1e8-1f1eb':71635, '1f1e8-1f1ec':71636, '1f1e8-1f1ed':71637, '1f1e8-1f1ee':71638, '1f1e8-1f1f0':71639, '1f1e8-1f1f1':71640, '1f1e8-1f1f2':71641, '1f1e8-1f1f3':71642, '1f1e8-1f1f4':71643, '1f1e8-1f1f5':71644, '1f1e8-1f1f7':71645, '1f1e8-1f1fa':71646, '1f1e8-1f1fb':71647, '1f1e8-1f1fc':71648, '1f1e8-1f1fd':71649, '1f1e8-1f1fe':71650, '1f1e8-1f1ff':71651, '1f1e9-1f1ea':71652, '1f1e9-1f1ec':71653, '1f1e9-1f1ef':71654, '1f1e9-1f1f0':71655, '1f1e9-1f1f2':71656, '1f1e9-1f1f4':71657, '1f1e9-1f1ff':71658, '1f1ea-1f1e6':71659, '1f1ea-1f1e8':71660, '1f1ea-1f1ea':71661, '1f1ea-1f1ec':71662, '1f1ea-1f1ed':71663, '1f1ea-1f1f7':71664, '1f1ea-1f1f8':71665, '1f1ea-1f1f9':71666, '1f1ea-1f1fa':71667, '1f1eb-1f1ee':71668, '1f1eb-1f1ef':71669, '1f1eb-1f1f0':71670, '1f1eb-1f1f2':71671, '1f1eb-1f1f4':71672, '1f1eb-1f1f7':71673, '1f1ec-1f1e6':71674, '1f1ec-1f1e7':71675, '1f1ec-1f1e9':71676, '1f1ec-1f1ea':71677, '1f1ec-1f1eb':71678, '1f1ec-1f1ec':71679, '1f1ec-1f1ed':71680, '1f1ec-1f1ee':71681, '1f1ec-1f1f1':71682, '1f1ec-1f1f2':71683, '1f1ec-1f1f3':71684, '1f1ec-1f1f5':71685, '1f1ec-1f1f6':71686, '1f1ec-1f1f7':71687, '1f1ec-1f1f8':71688, '1f1ec-1f1f9':71689, '1f1ec-1f1fa':71690, '1f1ec-1f1fc':71691, '1f1ec-1f1fe':71692, '1f1ed-1f1f0':71693, '1f1ed-1f1f2':71694, '1f1ed-1f1f3':71695, '1f1ed-1f1f7':71696, '1f1ed-1f1f9':71697, '1f1ed-1f1fa':71698, '1f1ee-1f1e8':71699, '1f1ee-1f1e9':71700, '1f1ee-1f1ea':71701, '1f1ee-1f1f1':71702, '1f1ee-1f1f2':71703, '1f1ee-1f1f3':71704, '1f1ee-1f1f4':71705, '1f1ee-1f1f6':71706, '1f1ee-1f1f7':71707, '1f1ee-1f1f8':71708, '1f1ee-1f1f9':71709, '1f1ef-1f1ea':71710, '1f1ef-1f1f2':71711, '1f1ef-1f1f4':71712, '1f1ef-1f1f5':71713, '1f1f0-1f1ea':71714, '1f1f0-1f1ec':71715, '1f1f0-1f1ed':71716, '1f1f0-1f1ee':71717, '1f1f0-1f1f2':71718, '1f1f0-1f1f3':71719, '1f1f0-1f1f5':71720, '1f1f0-1f1f7':71721, '1f1f0-1f1fc':71722, '1f1f0-1f1fe':71723, '1f1f0-1f1ff':71724, '1f1f1-1f1e6':71725, '1f1f1-1f1e7':71726, '1f1f1-1f1e8':71727, '1f1f1-1f1ee':71728, '1f1f1-1f1f0':71729, '1f1f1-1f1f7':71730, '1f1f1-1f1f8':71731, '1f1f1-1f1f9':71732, '1f1f1-1f1fa':71733, '1f1f1-1f1fb':71734, '1f1f1-1f1fe':71735, '1f1f2-1f1e6':71736, '1f1f2-1f1e8':71737, '1f1f2-1f1e9':71738, '1f1f2-1f1ea':71739, '1f1f2-1f1eb':71740, '1f1f2-1f1ec':71741, '1f1f2-1f1ed':71742, '1f1f2-1f1f0':71743, '1f1f2-1f1f1':71744, '1f1f2-1f1f2':71745, '1f1f2-1f1f3':71746, '1f1f2-1f1f4':71747, '1f1f2-1f1f5':71748, '1f1f2-1f1f6':71749, '1f1f2-1f1f7':71750, '1f1f2-1f1f8':71751, '1f1f2-1f1f9':71752, '1f1f2-1f1fa':71753, '1f1f2-1f1fb':71754, '1f1f2-1f1fc':71755, '1f1f2-1f1fd':71756, '1f1f2-1f1fe':71757, '1f1f2-1f1ff':71758, '1f1f3-1f1e6':71759, '1f1f3-1f1e8':71760, '1f1f3-1f1ea':71761, '1f1f3-1f1eb':71762, '1f1f3-1f1ec':71763, '1f1f3-1f1ee':71764, '1f1f3-1f1f1':71765, '1f1f3-1f1f4':71766, '1f1f3-1f1f5':71767, '1f1f3-1f1f7':71768, '1f1f3-1f1fa':71769, '1f1f3-1f1ff':71770, '1f1f4-1f1f2':71771, '1f1f5-1f1e6':71772, '1f1f5-1f1ea':71773, '1f1f5-1f1eb':71774, '1f1f5-1f1ec':71775, '1f1f5-1f1ed':71776, '1f1f5-1f1f0':71777, '1f1f5-1f1f1':71778, '1f1f5-1f1f2':71779, '1f1f5-1f1f3':71780, '1f1f5-1f1f7':71781, '1f1f5-1f1f8':71782, '1f1f5-1f1f9':71783, '1f1f5-1f1fc':71784, '1f1f5-1f1fe':71785, '1f1f6-1f1e6':71786, '1f1f7-1f1ea':71787, '1f1f7-1f1f4':71788, '1f1f7-1f1f8':71789, '1f1f7-1f1fa':71790, '1f1f7-1f1fc':71791, '1f1f8-1f1e6':71792, '1f1f8-1f1e7':71793, '1f1f8-1f1e8':71794, '1f1f8-1f1e9':71795, '1f1f8-1f1ea':71796, '1f1f8-1f1ec':71797, '1f1f8-1f1ed':71798, '1f1f8-1f1ee':71799, '1f1f8-1f1ef':71800, '1f1f8-1f1f0':71801, '1f1f8-1f1f1':71802, '1f1f8-1f1f2':71803, '1f1f8-1f1f3':71804, '1f1f8-1f1f4':71805, '1f1f8-1f1f7':71806, '1f1f8-1f1f8':71807, '1f1f8-1f1f9':71808, '1f1f8-1f1fb':71809, '1f1f8-1f1fd':71810, '1f1f8-1f1fe':71811, '1f1f8-1f1ff':71812, '1f1f9-1f1e6':71813, '1f1f9-1f1e8':71814, '1f1f9-1f1e9':71815, '1f1f9-1f1eb':71816, '1f1f9-1f1ec':71817, '1f1f9-1f1ed':71818, '1f1f9-1f1ef':71819, '1f1f9-1f1f0':71820, '1f1f9-1f1f1':71821, '1f1f9-1f1f2':71822, '1f1f9-1f1f3':71823, '1f1f9-1f1f4':71824, '1f1f9-1f1f7':71825, '1f1f9-1f1f9':71826, '1f1f9-1f1fb':71827, '1f1f9-1f1fc':71828, '1f1f9-1f1ff':71829, '1f1fa-1f1e6':71830, '1f1fa-1f1ec':71831, '1f1fa-1f1f2':71832, '1f1fa-1f1f3':71833, '1f1fa-1f1f8':71834, '1f1fa-1f1fe':71835, '1f1fa-1f1ff':71836, '1f1fb-1f1e6':71837, '1f1fb-1f1e8':71838, '1f1fb-1f1ea':71839, '1f1fb-1f1ec':71840, '1f1fb-1f1ee':71841, '1f1fb-1f1f3':71842, '1f1fb-1f1fa':71843, '1f1fc-1f1eb':71844, '1f1fc-1f1f8':71845, '1f1fd-1f1f0':71846, '1f1fe-1f1ea':71847, '1f1fe-1f1f9':71848, '1f1ff-1f1e6':71849, '1f1ff-1f1f2':71850, '1f1ff-1f1fc':71851, '1f201':62899, '1f202':62900, '1f21a':62906, '1f22f':62903, '1f232':62907, '1f233':62911, '1f234':62910, '1f235':62915, '1f236':62902, '1f237':62901, '1f238':62909, '1f239':62905, '1f23a':62914, '1f250':62904, '1f251':62908, '1f300':41010, '1f301':4857, '1f302':41012, '1f303':4858, '1f304':4860, '1f305':4861, '1f306':4862, '1f307':4863, '1f308':41011, '1f309':4864, '1f30a':41023, '1f30b':4815, '1f30c':4997, '1f30d':4806, '1f30e':4807, '1f30f':4808, '1f310':4809, '1f311':4977, '1f312':4978, '1f313':4979, '1f314':4980, '1f315':4981, '1f316':4982, '1f317':4983, '1f318':4984, '1f319':4985, '1f31a':4986, '1f31b':4987, '1f31c':4988, '1f31d':4991, '1f31e':4992, '1f31f':4995, '1f320':4996, '1f321':4989, '1f324':41001, '1f325':41002, '1f326':41003, '1f327':41004, '1f328':41005, '1f329':41006, '1f32a':41007, '1f32b':41008, '1f32c':41009, '1f32d':3725, '1f32e':3727, '1f32f':3728, '1f330':3708, '1f331':2659, '1f332':2661, '1f333':2662, '1f334':2663, '1f335':2664, '1f336':3698, '1f337':2658, '1f338':2649, '1f339':2653, '1f33a':2655, '1f33b':2656, '1f33c':2657, '1f33d':3697, '1f33e':2665, '1f33f':2666, '1f340':2668, '1f341':2669, '1f342':2670, '1f343':2671, '1f344':3705, '1f345':3690, '1f346':3694, '1f347':3674, '1f348':3675, '1f349':3676, '1f34a':3677, '1f34b':3678, '1f34c':3679, '1f34d':3680, '1f34e':3682, '1f34f':3683, '1f350':3684, '1f351':3685, '1f352':3686, '1f353':3687, '1f354':3722, '1f355':3724, '1f356':3718, '1f357':3719, '1f358':3744, '1f359':3745, '1f35a':3746, '1f35b':3747, '1f35c':3748, '1f35d':3749, '1f35e':3709, '1f35f':3723, '1f360':3750, '1f361':3756, '1f362':3751, '1f363':3752, '1f364':3753, '1f365':3754, '1f366':3765, '1f367':3766, '1f368':3767, '1f369':3768, '1f36a':3769, '1f36b':3774, '1f36c':3775, '1f36d':3776, '1f36e':3777, '1f36f':3778, '1f370':3771, '1f371':3743, '1f372':3735, '1f373':3733, '1f374':3801, '1f375':3783, '1f376':3784, '1f377':3786, '1f378':3787, '1f379':3788, '1f37a':3789, '1f37b':3790, '1f37c':3779, '1f37d':3800, '1f37e':3785, '1f37f':3739, '1f380':51040, '1f381':51041, '1f382':3770, '1f383':51024, '1f384':51025, '1f385':1527, '1f386':51026, '1f387':51027, '1f388':51030, '1f389':51031, '1f38a':51032, '1f38b':51033, '1f38c':71588, '1f38d':51034, '1f38e':51035, '1f38f':51036, '1f390':51037, '1f391':51038, '1f392':61134, '1f393':61147, '1f396':51045, '1f397':51042, '1f399':61167, '1f39a':61168, '1f39b':61169, '1f39e':61203, '1f39f':51043, '1f3a0':4866, '1f3a1':4868, '1f3a2':4869, '1f3a3':51072, '1f3a4':61170, '1f3a5':61202, '1f3a6':62819, '1f3a7':61171, '1f3a8':51105, '1f3a9':61146, '1f3aa':4871, '1f3ab':51044, '1f3ac':61205, '1f3ad':51103, '1f3ae':51086, '1f3af':51078, '1f3b0':51088, '1f3b1':51081, '1f3b2':51089, '1f3b3':51060, '1f3b4':51102, '1f3b5':61165, '1f3b6':61166, '1f3b7':61173, '1f3b8':61175, '1f3b9':61176, '1f3ba':61177, '1f3bb':61178, '1f3bc':61164, '1f3bd':51074, '1f3be':51058, '1f3bf':51075, '1f3c0':51054, '1f3c1':71586, '1f3c2':1600, '1f3c3-200d-2640':1584, '1f3c3-200d-2642':1583, '1f3c3':1582, '1f3c4-200d-2640':1606, '1f3c4-200d-2642':1605, '1f3c4':1604, '1f3c5':51047, '1f3c6':51046, '1f3c7':1598, '1f3c8':51056, '1f3c9':51057, '1f3ca-200d-2640':1612, '1f3ca-200d-2642':1611, '1f3ca':1610, '1f3cb-200d-2640':1618, '1f3cb-200d-2642':1617, '1f3cb':1616, '1f3cc-200d-2640':1603, '1f3cc-200d-2642':1602, '1f3cc':1601, '1f3cd':4902, '1f3ce':4901, '1f3cf':51061, '1f3d0':51055, '1f3d1':51062, '1f3d2':51063, '1f3d3':51065, '1f3d4':4813, '1f3d5':4817, '1f3d6':4818, '1f3d7':4824, '1f3d8':4829, '1f3d9':4859, '1f3da':4830, '1f3db':4823, '1f3dc':4819, '1f3dd':4820, '1f3de':4821, '1f3df':4822, '1f3e0':4831, '1f3e1':4832, '1f3e2':4833, '1f3e3':4834, '1f3e4':4835, '1f3e5':4836, '1f3e6':4837, '1f3e7':62729, '1f3e8':4838, '1f3e9':4839, '1f3ea':4840, '1f3eb':4841, '1f3ec':4842, '1f3ed':4843, '1f3ee':61216, '1f3ef':4844, '1f3f0':4845, '1f3f3-200d-1f308':71591, '1f3f3-200d-26a7':71592, '1f3f3':71590, '1f3f4-200d-2620':71593, '1f3f4-e0067-e0062-e0065-e006e-e0067-e007f':71852, '1f3f4-e0067-e0062-e0073-e0063-e0074-e007f':71853, '1f3f4-e0067-e0062-e0077-e006c-e0073-e007f':71854, '1f3f4':71589, '1f3f5':2652, '1f3f7':61234, '1f3f8':51066, '1f3f9':61303, '1f3fa':3805, '1f3fb':9525, '1f3fc':9526, '1f3fd':9527, '1f3fe':9528, '1f3ff':9529, '1f400':2576, '1f401':2575, '1f402':2556, '1f403':2557, '1f404':2558, '1f405':2547, '1f406':2548, '1f407':2579, '1f408-200d-2b1b':2544, '1f408':2543, '1f409':2618, '1f40a':2613, '1f40b':2622, '1f40c':2632, '1f40d':2616, '1f40e':2550, '1f40f':2563, '1f410':2565, '1f411':2564, '1f412':2531, '1f413':2596, '1f414':2595, '1f415-200d-1f9ba':2537, '1f415':2535, '1f416':2560, '1f417':2561, '1f418':2570, '1f419':2629, '1f41a':2630, '1f41b':2634, '1f41c':2635, '1f41d':2636, '1f41e':2638, '1f41f':2625, '1f420':2626, '1f421':2627, '1f422':2614, '1f423':2597, '1f424':2598, '1f425':2599, '1f426':2600, '1f427':2601, '1f428':2586, '1f429':2538, '1f42a':2566, '1f42b':2567, '1f42c':2623, '1f42d':2574, '1f42e':2555, '1f42f':2546, '1f430':2578, '1f431':2542, '1f432':2617, '1f433':2621, '1f434':2549, '1f435':2530, '1f436':2534, '1f437':2559, '1f438':2612, '1f439':2577, '1f43a':2539, '1f43b-200d-2744':2585, '1f43b':2584, '1f43c':2587, '1f43d':2562, '1f43e':2593, '1f43f':2580, '1f440':1381, '1f441-200d-1f5e8':1159, '1f441':1382, '1f442':1373, '1f443':1375, '1f444':1384, '1f445':1383, '1f446':1347, '1f447':1349, '1f448':1345, '1f449':1346, '1f44a':1355, '1f44b':1327, '1f44c':1336, '1f44d':1352, '1f44e':1353, '1f44f':1358, '1f450':1361, '1f451':61144, '1f452':61145, '1f453':61110, '1f454':61115, '1f455':61116, '1f456':61117, '1f457':61122, '1f458':61123, '1f459':61128, '1f45a':61129, '1f45b':61130, '1f45c':61131, '1f45d':61132, '1f45e':61136, '1f45f':61137, '1f460':61140, '1f461':61141, '1f462':61143, '1f463':1687, '1f464':1684, '1f465':1685, '1f466':1388, '1f467':1389, '1f468-200d-1f33e':1457, '1f468-200d-1f373':1460, '1f468-200d-1f37c':1524, '1f468-200d-1f393':1448, '1f468-200d-1f3a4':1478, '1f468-200d-1f3a8':1481, '1f468-200d-1f3eb':1451, '1f468-200d-1f3ed':1466, '1f468-200d-1f466-200d-1f466':1674, '1f468-200d-1f466':1673, '1f468-200d-1f467-200d-1f466':1676, '1f468-200d-1f467-200d-1f467':1677, '1f468-200d-1f467':1675, '1f468-200d-1f468-200d-1f466':1663, '1f468-200d-1f468-200d-1f466-200d-1f466':1666, '1f468-200d-1f468-200d-1f467':1664, '1f468-200d-1f468-200d-1f467-200d-1f466':1665, '1f468-200d-1f468-200d-1f467-200d-1f467':1667, '1f468-200d-1f469-200d-1f466':1658, '1f468-200d-1f469-200d-1f466-200d-1f466':1661, '1f468-200d-1f469-200d-1f467':1659, '1f468-200d-1f469-200d-1f467-200d-1f466':1660, '1f468-200d-1f469-200d-1f467-200d-1f467':1662, '1f468-200d-1f4bb':1475, '1f468-200d-1f4bc':1469, '1f468-200d-1f527':1463, '1f468-200d-1f52c':1472, '1f468-200d-1f680':1487, '1f468-200d-1f692':1490, '1f468-200d-1f9af':1574, '1f468-200d-1f9b0':1396, '1f468-200d-1f9b1':1397, '1f468-200d-1f9b2':1399, '1f468-200d-1f9b3':1398, '1f468-200d-1f9bc':1577, '1f468-200d-1f9bd':1580, '1f468-200d-2695':1445, '1f468-200d-2696':1454, '1f468-200d-2708':1484, '1f468-200d-2764-200d-1f468':1655, '1f468-200d-2764-200d-1f48b-200d-1f468':1651, '1f468':1392, '1f469-200d-1f33e':1458, '1f469-200d-1f373':1461, '1f469-200d-1f37c':1523, '1f469-200d-1f393':1449, '1f469-200d-1f3a4':1479, '1f469-200d-1f3a8':1482, '1f469-200d-1f3eb':1452, '1f469-200d-1f3ed':1467, '1f469-200d-1f466-200d-1f466':1679, '1f469-200d-1f466':1678, '1f469-200d-1f467-200d-1f466':1681, '1f469-200d-1f467-200d-1f467':1682, '1f469-200d-1f467':1680, '1f469-200d-1f469-200d-1f466':1668, '1f469-200d-1f469-200d-1f466-200d-1f466':1671, '1f469-200d-1f469-200d-1f467':1669, '1f469-200d-1f469-200d-1f467-200d-1f466':1670, '1f469-200d-1f469-200d-1f467-200d-1f467':1672, '1f469-200d-1f4bb':1476, '1f469-200d-1f4bc':1470, '1f469-200d-1f527':1464, '1f469-200d-1f52c':1473, '1f469-200d-1f680':1488, '1f469-200d-1f692':1491, '1f469-200d-1f9af':1575, '1f469-200d-1f9b0':1401, '1f469-200d-1f9b1':1403, '1f469-200d-1f9b2':1407, '1f469-200d-1f9b3':1405, '1f469-200d-1f9bc':1578, '1f469-200d-1f9bd':1581, '1f469-200d-2695':1446, '1f469-200d-2696':1455, '1f469-200d-2708':1485, '1f469-200d-2764-200d-1f468':1654, '1f469-200d-2764-200d-1f469':1656, '1f469-200d-2764-200d-1f48b-200d-1f468':1650, '1f469-200d-2764-200d-1f48b-200d-1f469':1652, '1f469':1400, '1f46a':1657, '1f46b':1647, '1f46c':1648, '1f46d':1646, '1f46e-200d-2640':1494, '1f46e-200d-2642':1493, '1f46e':1492, '1f46f-200d-2640':1590, '1f46f-200d-2642':1589, '1f46f':1588, '1f470-200d-2640':1518, '1f470-200d-2642':1517, '1f470':1516, '1f471-200d-2640':1409, '1f471-200d-2642':1410, '1f471':1391, '1f472':1511, '1f473-200d-2640':1510, '1f473-200d-2642':1509, '1f473':1508, '1f474':1412, '1f475':1413, '1f476':1386, '1f477-200d-2640':1504, '1f477-200d-2642':1503, '1f477':1502, '1f478':1507, '1f479':1109, '1f47a':1110, '1f47b':1111, '1f47c':1526, '1f47d':1112, '1f47e':1113, '1f47f':1104, '1f480':1105, '1f481-200d-2640':1428, '1f481-200d-2642':1427, '1f481':1426, '1f482-200d-2640':1500, '1f482-200d-2642':1499, '1f482':1498, '1f483':1585, '1f484':61152, '1f485':1366, '1f486-200d-2640':1560, '1f486-200d-2642':1559, '1f486':1558, '1f487-200d-2640':1563, '1f487-200d-2642':1562, '1f487':1561, '1f488':4870, '1f489':61326, '1f48a':61328, '1f48b':1127, '1f48c':1128, '1f48d':61153, '1f48e':61154, '1f48f':1649, '1f490':2648, '1f491':1653, '1f492':4846, '1f493':1133, '1f494':1138, '1f495':1135, '1f496':1131, '1f497':1132, '1f498':1129, '1f499':1145, '1f49a':1144, '1f49b':1143, '1f49c':1146, '1f49d':1130, '1f49e':1134, '1f49f':1136, '1f4a0':62946, '1f4a1':61214, '1f4a2':1151, '1f4a3':1157, '1f4a4':1163, '1f4a5':1152, '1f4a6':1154, '1f4a7':41022, '1f4a8':1155, '1f4a9':1107, '1f4aa':1368, '1f4ab':1153, '1f4ac':1158, '1f4ad':1162, '1f4ae':2650, '1f4af':1150, '1f4b0':61235, '1f4b1':62841, '1f4b2':62842, '1f4b3':61242, '1f4b4':61237, '1f4b5':61238, '1f4b6':61239, '1f4b7':61240, '1f4b8':61241, '1f4b9':61244, '1f4ba':4936, '1f4bb':61191, '1f4bc':61265, '1f4bd':61197, '1f4be':61198, '1f4bf':61199, '1f4c0':61200, '1f4c1':61266, '1f4c2':61267, '1f4c3':61227, '1f4c4':61229, '1f4c5':61269, '1f4c6':61270, '1f4c7':61273, '1f4c8':61274, '1f4c9':61275, '1f4ca':61276, '1f4cb':61277, '1f4cc':61278, '1f4cd':61279, '1f4ce':61280, '1f4cf':61282, '1f4d0':61283, '1f4d1':61232, '1f4d2':61226, '1f4d3':61225, '1f4d4':61218, '1f4d5':61219, '1f4d6':61220, '1f4d7':61221, '1f4d8':61222, '1f4d9':61223, '1f4da':61224, '1f4db':62847, '1f4dc':61228, '1f4dd':61264, '1f4de':61185, '1f4df':61186, '1f4e0':61187, '1f4e1':61325, '1f4e2':61159, '1f4e3':61160, '1f4e4':61249, '1f4e5':61250, '1f4e6':61251, '1f4e7':61246, '1f4e8':61247, '1f4e9':61248, '1f4ea':61253, '1f4eb':61252, '1f4ec':61254, '1f4ed':61255, '1f4ee':61256, '1f4ef':61161, '1f4f0':61230, '1f4f1':61182, '1f4f2':61183, '1f4f3':62823, '1f4f4':62824, '1f4f5':62751, '1f4f6':62822, '1f4f7':61207, '1f4f8':61208, '1f4f9':61209, '1f4fa':61206, '1f4fb':61172, '1f4fc':61210, '1f4fd':61204, '1f4ff':61151, '1f500':62801, '1f501':62802, '1f502':62803, '1f503':62769, '1f504':62770, '1f505':62820, '1f506':62821, '1f507':61155, '1f508':61156, '1f509':61157, '1f50a':61158, '1f50b':61188, '1f50c':61190, '1f50d':61211, '1f50e':61212, '1f50f':61290, '1f510':61291, '1f511':61292, '1f512':61288, '1f513':61289, '1f514':61162, '1f515':61163, '1f516':61233, '1f517':61313, '1f518':62947, '1f519':62771, '1f51a':62772, '1f51b':62773, '1f51c':62774, '1f51d':62775, '1f51e':62752, '1f51f':62876, '1f520':62877, '1f521':62878, '1f522':62879, '1f523':62880, '1f524':62881, '1f525':41021, '1f526':61215, '1f527':61306, '1f528':61294, '1f529':61308, '1f52a':3803, '1f52b':61301, '1f52c':61323, '1f52d':61324, '1f52e':51082, '1f52f':62787, '1f530':62848, '1f531':62846, '1f532':62949, '1f533':62948, '1f534':62916, '1f535':62920, '1f536':62940, '1f537':62941, '1f538':62942, '1f539':62943, '1f53a':62944, '1f53b':62945, '1f53c':62811, '1f53d':62813, '1f549':62778, '1f54a':2602, '1f54b':4854, '1f54c':4850, '1f54d':4852, '1f54e':62786, '1f550':4955, '1f551':4957, '1f552':4959, '1f553':4961, '1f554':4963, '1f555':4965, '1f556':4967, '1f557':4969, '1f558':4971, '1f559':4973, '1f55a':4975, '1f55b':4953, '1f55c':4956, '1f55d':4958, '1f55e':4960, '1f55f':4962, '1f560':4964, '1f561':4966, '1f562':4968, '1f563':4970, '1f564':4972, '1f565':4974, '1f566':4976, '1f567':4954, '1f56f':61213, '1f570':4952, '1f573':1156, '1f574':1587, '1f575-200d-2640':1497, '1f575-200d-2642':1496, '1f575':1495, '1f576':61111, '1f577':2641, '1f578':2642, '1f579':51087, '1f57a':1586, '1f587':61281, '1f58a':61261, '1f58b':61260, '1f58c':61262, '1f58d':61263, '1f590':1329, '1f595':1348, '1f596':1331, '1f5a4':1148, '1f5a5':61192, '1f5a8':61193, '1f5b1':61195, '1f5b2':61196, '1f5bc':51104, '1f5c2':61268, '1f5c3':61285, '1f5c4':61286, '1f5d1':61287, '1f5d2':61271, '1f5d3':61272, '1f5dc':61310, '1f5dd':61293, '1f5de':61231, '1f5e1':61299, '1f5e3':1683, '1f5e8':1160, '1f5ef':1161, '1f5f3':61257, '1f5fa':4810, '1f5fb':4816, '1f5fc':4847, '1f5fd':4848, '1f5fe':4811, '1f5ff':61362, '1f600':11, '1f601':14, '1f602':18, '1f603':12, '1f604':13, '1f605':16, '1f606':15, '1f607':114, '1f608':1103, '1f609':112, '1f60a':113, '1f60b':124, '1f60c':150, '1f60d':116, '1f60e':170, '1f60f':144, '1f610':139, '1f611':140, '1f612':145, '1f613':195, '1f614':151, '1f615':173, '1f616':192, '1f617':119, '1f618':118, '1f619':122, '1f61a':121, '1f61b':125, '1f61c':126, '1f61d':128, '1f61e':194, '1f61f':175, '1f620':1101, '1f621':1100, '1f622':189, '1f623':193, '1f624':199, '1f625':188, '1f626':184, '1f627':185, '1f628':186, '1f629':196, '1f62a':152, '1f62b':197, '1f62c':147, '1f62d':190, '1f62e-200d-1f4a8':148, '1f62e':178, '1f62f':179, '1f630':187, '1f631':191, '1f632':180, '1f633':181, '1f634':154, '1f635-200d-1f4ab':165, '1f635':164, '1f636-200d-1f32b':143, '1f636':141, '1f637':155, '1f638':1116, '1f639':1117, '1f63a':1115, '1f63b':1118, '1f63c':1119, '1f63d':1120, '1f63e':1123, '1f63f':1122, '1f640':1121, '1f641':176, '1f642':19, '1f643':110, '1f644':146, '1f645-200d-2640':1422, '1f645-200d-2642':1421, '1f645':1420, '1f646-200d-2640':1425, '1f646-200d-2642':1424, '1f646':1423, '1f647-200d-2640':1437, '1f647-200d-2642':1436, '1f647':1435, '1f648':1124, '1f649':1125, '1f64a':1126, '1f64b-200d-2640':1431, '1f64b-200d-2642':1430, '1f64b':1429, '1f64c':1359, '1f64d-200d-2640':1416, '1f64d-200d-2642':1415, '1f64d':1414, '1f64e-200d-2640':1419, '1f64e-200d-2642':1418, '1f64e':1417, '1f64f':1364, '1f680':4942, '1f681':4937, '1f682':4872, '1f683':4873, '1f684':4874, '1f685':4875, '1f686':4876, '1f687':4877, '1f688':4878, '1f689':4879, '1f68a':4880, '1f68b':4883, '1f68c':4884, '1f68d':4885, '1f68e':4886, '1f68f':4911, '1f690':4887, '1f691':4888, '1f692':4889, '1f693':4890, '1f694':4891, '1f695':4892, '1f696':4893, '1f697':4894, '1f698':4895, '1f699':4896, '1f69a':4898, '1f69b':4899, '1f69c':4900, '1f69d':4881, '1f69e':4882, '1f69f':4938, '1f6a0':4939, '1f6a1':4940, '1f6a2':4930, '1f6a3-200d-2640':1609, '1f6a3-200d-2642':1608, '1f6a3':1607, '1f6a4':4926, '1f6a5':4918, '1f6a6':4919, '1f6a7':4921, '1f6a8':4917, '1f6a9':71587, '1f6aa':61333, '1f6ab':62745, '1f6ac':61358, '1f6ad':62747, '1f6ae':62730, '1f6af':62748, '1f6b0':62731, '1f6b1':62749, '1f6b2':4907, '1f6b3':62746, '1f6b4-200d-2640':1621, '1f6b4-200d-2642':1620, '1f6b4':1619, '1f6b5-200d-2640':1624, '1f6b5-200d-2642':1623, '1f6b5':1622, '1f6b6-200d-2640':1566, '1f6b6-200d-2642':1565, '1f6b6':1564, '1f6b7':62750, '1f6b8':62743, '1f6b9':62733, '1f6ba':62734, '1f6bb':62735, '1f6bc':62736, '1f6bd':61340, '1f6be':62737, '1f6bf':61342, '1f6c0':1643, '1f6c1':61343, '1f6c2':62738, '1f6c3':62739, '1f6c4':62740, '1f6c5':62741, '1f6cb':61338, '1f6cc':1644, '1f6cd':61133, '1f6ce':4944, '1f6cf':61337, '1f6d0':62776, '1f6d1':4920, '1f6d2':61357, '1f6d5':4851, '1f6d6':4828, '1f6d7':61334, '1f6e0':61298, '1f6e1':61304, '1f6e2':4914, '1f6e3':4912, '1f6e4':4913, '1f6e5':4929, '1f6e9':4932, '1f6eb':4933, '1f6ec':4934, '1f6f0':4941, '1f6f3':4927, '1f6f4':4908, '1f6f5':4903, '1f6f6':4925, '1f6f7':51076, '1f6f8':4943, '1f6f9':4909, '1f6fa':4906, '1f6fb':4897, '1f6fc':4910, '1f7e0':62917, '1f7e1':62918, '1f7e2':62919, '1f7e3':62921, '1f7e4':62922, '1f7e5':62925, '1f7e6':62929, '1f7e7':62926, '1f7e8':62927, '1f7e9':62928, '1f7ea':62930, '1f7eb':62931, '1f90c':1337, '1f90d':1149, '1f90e':1147, '1f90f':1338, '1f910':137, '1f911':129, '1f912':156, '1f913':171, '1f914':135, '1f915':157, '1f916':1114, '1f917':130, '1f918':1343, '1f919':1344, '1f91a':1328, '1f91b':1356, '1f91c':1357, '1f91d':1363, '1f91e':1340, '1f91f':1342, '1f920':167, '1f921':1108, '1f922':158, '1f923':17, '1f924':153, '1f925':149, '1f926-200d-2640':1440, '1f926-200d-2642':1439, '1f926':1438, '1f927':160, '1f928':138, '1f929':117, '1f92a':127, '1f92b':134, '1f92c':1102, '1f92d':131, '1f92e':159, '1f92f':166, '1f930':1519, '1f931':1522, '1f932':1362, '1f933':1367, '1f934':1506, '1f935-200d-2640':1515, '1f935-200d-2642':1514, '1f935':1513, '1f936':1528, '1f937-200d-2640':1443, '1f937-200d-2642':1442, '1f937':1441, '1f938-200d-2640':1627, '1f938-200d-2642':1626, '1f938':1625, '1f939-200d-2640':1639, '1f939-200d-2642':1638, '1f939':1637, '1f93a':1597, '1f93c-200d-2640':1630, '1f93c-200d-2642':1629, '1f93c':1628, '1f93d-200d-2640':1633, '1f93d-200d-2642':1632, '1f93d':1631, '1f93e-200d-2640':1636, '1f93e-200d-2642':1635, '1f93e':1634, '1f93f':51073, '1f940':2654, '1f941':61180, '1f942':3791, '1f943':3792, '1f944':3802, '1f945':51069, '1f947':51048, '1f948':51049, '1f949':51050, '1f94a':51067, '1f94b':51068, '1f94c':51077, '1f94d':51064, '1f94e':51053, '1f94f':51059, '1f950':3710, '1f951':3693, '1f952':3700, '1f953':3721, '1f954':3695, '1f955':3696, '1f956':3711, '1f957':3738, '1f958':3734, '1f959':3730, '1f95a':3732, '1f95b':3780, '1f95c':3706, '1f95d':3689, '1f95e':3715, '1f95f':3757, '1f960':3758, '1f961':3759, '1f962':3799, '1f963':3737, '1f964':3794, '1f965':3692, '1f966':3702, '1f967':3773, '1f968':3713, '1f969':3720, '1f96a':3726, '1f96b':3742, '1f96c':3701, '1f96d':3681, '1f96e':3755, '1f96f':3714, '1f970':115, '1f971':198, '1f972':123, '1f973':168, '1f974':163, '1f975':161, '1f976':162, '1f977':1501, '1f978':169, '1f97a':182, '1f97b':61124, '1f97c':61113, '1f97d':61112, '1f97e':61138, '1f97f':61139, '1f980':3760, '1f981':2545, '1f982':2643, '1f983':2594, '1f984':2551, '1f985':2603, '1f986':2604, '1f987':2583, '1f988':2628, '1f989':2606, '1f98a':2540, '1f98b':2633, '1f98c':2553, '1f98d':2532, '1f98e':2615, '1f98f':2572, '1f990':3762, '1f991':3763, '1f992':2569, '1f993':2552, '1f994':2582, '1f995':2619, '1f996':2620, '1f997':2639, '1f998':2591, '1f999':2568, '1f99a':2610, '1f99b':2573, '1f99c':2611, '1f99d':2541, '1f99e':3761, '1f99f':2644, '1f9a0':2647, '1f9a1':2592, '1f9a2':2605, '1f9a3':2571, '1f9a4':2607, '1f9a5':2588, '1f9a6':2589, '1f9a7':2533, '1f9a8':2590, '1f9a9':2609, '1f9aa':3764, '1f9ab':2581, '1f9ac':2554, '1f9ad':2624, '1f9ae':2536, '1f9af':61312, '1f9b4':1380, '1f9b5':1371, '1f9b6':1372, '1f9b7':1379, '1f9b8-200d-2640':1532, '1f9b8-200d-2642':1531, '1f9b8':1530, '1f9b9-200d-2640':1535, '1f9b9-200d-2642':1534, '1f9b9':1533, '1f9ba':61114, '1f9bb':1374, '1f9bc':4905, '1f9bd':4904, '1f9be':1369, '1f9bf':1370, '1f9c0':3717, '1f9c1':3772, '1f9c2':3741, '1f9c3':3796, '1f9c4':3703, '1f9c5':3704, '1f9c6':3731, '1f9c7':3716, '1f9c8':3740, '1f9c9':3797, '1f9ca':3798, '1f9cb':3795, '1f9cd-200d-2640':1569, '1f9cd-200d-2642':1568, '1f9cd':1567, '1f9ce-200d-2640':1572, '1f9ce-200d-2642':1571, '1f9ce':1570, '1f9cf-200d-2640':1434, '1f9cf-200d-2642':1433, '1f9cf':1432, '1f9d0':172, '1f9d1-200d-1f33e':1456, '1f9d1-200d-1f373':1459, '1f9d1-200d-1f37c':1525, '1f9d1-200d-1f384':1529, '1f9d1-200d-1f393':1447, '1f9d1-200d-1f3a4':1477, '1f9d1-200d-1f3a8':1480, '1f9d1-200d-1f3eb':1450, '1f9d1-200d-1f3ed':1465, '1f9d1-200d-1f4bb':1474, '1f9d1-200d-1f4bc':1468, '1f9d1-200d-1f527':1462, '1f9d1-200d-1f52c':1471, '1f9d1-200d-1f680':1486, '1f9d1-200d-1f692':1489, '1f9d1-200d-1f91d-200d-1f9d1':1645, '1f9d1-200d-1f9af':1573, '1f9d1-200d-1f9b0':1402, '1f9d1-200d-1f9b1':1404, '1f9d1-200d-1f9b2':1408, '1f9d1-200d-1f9b3':1406, '1f9d1-200d-1f9bc':1576, '1f9d1-200d-1f9bd':1579, '1f9d1-200d-2695':1444, '1f9d1-200d-2696':1453, '1f9d1-200d-2708':1483, '1f9d1':1390, '1f9d2':1387, '1f9d3':1411, '1f9d4-200d-2640':1395, '1f9d4-200d-2642':1394, '1f9d4':1393, '1f9d5':1512, '1f9d6-200d-2640':1593, '1f9d6-200d-2642':1592, '1f9d6':1591, '1f9d7-200d-2640':1596, '1f9d7-200d-2642':1595, '1f9d7':1594, '1f9d8-200d-2640':1642, '1f9d8-200d-2642':1641, '1f9d8':1640, '1f9d9-200d-2640':1538, '1f9d9-200d-2642':1537, '1f9d9':1536, '1f9da-200d-2640':1541, '1f9da-200d-2642':1540, '1f9da':1539, '1f9db-200d-2640':1544, '1f9db-200d-2642':1543, '1f9db':1542, '1f9dc-200d-2640':1547, '1f9dc-200d-2642':1546, '1f9dc':1545, '1f9dd-200d-2640':1550, '1f9dd-200d-2642':1549, '1f9dd':1548, '1f9de-200d-2640':1553, '1f9de-200d-2642':1552, '1f9de':1551, '1f9df-200d-2640':1556, '1f9df-200d-2642':1555, '1f9df':1554, '1f9e0':1376, '1f9e1':1142, '1f9e2':61148, '1f9e3':61118, '1f9e4':61119, '1f9e5':61120, '1f9e6':61121, '1f9e7':51039, '1f9e8':51028, '1f9e9':51090, '1f9ea':61320, '1f9eb':61321, '1f9ec':61322, '1f9ed':4812, '1f9ee':61201, '1f9ef':61356, '1f9f0':61316, '1f9f1':4825, '1f9f2':61317, '1f9f3':4945, '1f9f4':61346, '1f9f5':51106, '1f9f6':51108, '1f9f7':61347, '1f9f8':51091, '1f9f9':61348, '1f9fa':61349, '1f9fb':61350, '1f9fc':61352, '1f9fd':61355, '1f9fe':61243, '1f9ff':51084, '1fa70':61142, '1fa71':61125, '1fa72':61126, '1fa73':61127, '1fa74':61135, '1fa78':61327, '1fa79':61329, '1fa7a':61331, '1fa80':51079, '1fa81':51080, '1fa82':4935, '1fa83':61302, '1fa84':51083, '1fa85':51092, '1fa86':51094, '1fa90':4993, '1fa91':61339, '1fa92':61345, '1fa93':61295, '1fa94':61217, '1fa95':61179, '1fa96':61149, '1fa97':61174, '1fa98':61181, '1fa99':61236, '1fa9a':61305, '1fa9b':61307, '1fa9c':61318, '1fa9d':61315, '1fa9e':61335, '1fa9f':61336, '1faa0':61341, '1faa1':51107, '1faa2':51109, '1faa3':61351, '1faa4':61344, '1faa5':61354, '1faa6':61360, '1faa7':61363, '1faa8':4826, '1fab0':2645, '1fab1':2646, '1fab2':2637, '1fab3':2640, '1fab4':2660, '1fab5':4827, '1fab6':2608, '1fac0':1377, '1fac1':1378, '1fac2':1686, '1fad0':3688, '1fad1':3699, '1fad2':3691, '1fad3':3712, '1fad4':3729, '1fad5':3736, '1fad6':3782, '203c':62834, '21a9':62765, '21aa':62766, '231a':4948, '231b':4946, '23cf':62818, '23e9':62805, '23ea':62809, '23eb':62812, '23ec':62814, '23ed':62806, '23ee':62810, '23ef':62807, '23f0':4949, '23f1':4950, '23f2':4951, '23f3':4947, '23f8':62815, '23f9':62816, '23fa':62817, '24c2':62890, '25aa':62938, '25ab':62939, '25b6':62804, '25c0':62808, '25fb':62935, '25fc':62934, '25fd':62937, '25fe':62936, '260e':61184, '261d':1350, '262a':62784, '262e':62785, '262f':62781, '263a':120, '264a':62790, '264b':62791, '264c':62792, '264d':62793, '264e':62794, '264f':62795, '265f':51099, '267b':62844, '267e':62833, '267f':62732, '269b':62777, '269c':62845, '26a0':62742, '26a1':41016, '26a7':62827, '26aa':62924, '26ab':62923, '26b0':61359, '26b1':61361, '26bd':51051, '26be':51052, '26c4':41019, '26c5':4999, '26c8':41000, '26ce':62800, '26cf':61296, '26d1':61150, '26d3':61314, '26d4':62744, '26e9':4853, '26ea':4849, '26f0':4814, '26f1':41015, '26f2':4855, '26f3':51070, '26f4':4928, '26f5':4924, '26f7':1599, '26f8':51071, '26f9-200d-2640':1615, '26f9-200d-2642':1614, '26f9':1613, '26fa':4856, '26fd':4915, '270a':1354, '270b':1330, '270c':1339, '270d':1365, '270f':61258, '271d':62782, '274c':62853, '274e':62854, '2764-200d-1f525':1139, '2764-200d-1fa79':1140, '27a1':62757, '27b0':62855, '27bf':62856, '2b05':62761, '2b06':62755, '2b07':62759, '2b1b':62932, '2b1c':62933, '2b50':4994, '2b55':62849, '303d':62857, '1f385-1f3fb':0, '1f385-1f3fc':0, '1f385-1f3fd':0, '1f385-1f3fe':0, '1f385-1f3ff':0, '1f3c2-1f3fb':0, '1f3c2-1f3fc':0, '1f3c2-1f3fd':0, '1f3c2-1f3fe':0, '1f3c2-1f3ff':0, '1f3c3-1f3fb-200d-2640':0, '1f3c3-1f3fc-200d-2640':0, '1f3c3-1f3fd-200d-2640':0, '1f3c3-1f3fe-200d-2640':0, '1f3c3-1f3ff-200d-2640':0, '1f3c3-1f3fb-200d-2642':0, '1f3c3-1f3fc-200d-2642':0, '1f3c3-1f3fd-200d-2642':0, '1f3c3-1f3fe-200d-2642':0, '1f3c3-1f3ff-200d-2642':0, '1f3c3-1f3fb':0, '1f3c3-1f3fc':0, '1f3c3-1f3fd':0, '1f3c3-1f3fe':0, '1f3c3-1f3ff':0, '1f3c4-1f3fb-200d-2640':0, '1f3c4-1f3fc-200d-2640':0, '1f3c4-1f3fd-200d-2640':0, '1f3c4-1f3fe-200d-2640':0, '1f3c4-1f3ff-200d-2640':0, '1f3c4-1f3fb-200d-2642':0, '1f3c4-1f3fc-200d-2642':0, '1f3c4-1f3fd-200d-2642':0, '1f3c4-1f3fe-200d-2642':0, '1f3c4-1f3ff-200d-2642':0, '1f3c4-1f3fb':0, '1f3c4-1f3fc':0, '1f3c4-1f3fd':0, '1f3c4-1f3fe':0, '1f3c4-1f3ff':0, '1f3c7-1f3fb':0, '1f3c7-1f3fc':0, '1f3c7-1f3fd':0, '1f3c7-1f3fe':0, '1f3c7-1f3ff':0, '1f3ca-1f3fb-200d-2640':0, '1f3ca-1f3fc-200d-2640':0, '1f3ca-1f3fd-200d-2640':0, '1f3ca-1f3fe-200d-2640':0, '1f3ca-1f3ff-200d-2640':0, '1f3ca-1f3fb-200d-2642':0, '1f3ca-1f3fc-200d-2642':0, '1f3ca-1f3fd-200d-2642':0, '1f3ca-1f3fe-200d-2642':0, '1f3ca-1f3ff-200d-2642':0, '1f3ca-1f3fb':0, '1f3ca-1f3fc':0, '1f3ca-1f3fd':0, '1f3ca-1f3fe':0, '1f3ca-1f3ff':0, '1f3cb-1f3fb-200d-2640':0, '1f3cb-1f3fc-200d-2640':0, '1f3cb-1f3fd-200d-2640':0, '1f3cb-1f3fe-200d-2640':0, '1f3cb-1f3ff-200d-2640':0, '1f3cb-1f3fb-200d-2642':0, '1f3cb-1f3fc-200d-2642':0, '1f3cb-1f3fd-200d-2642':0, '1f3cb-1f3fe-200d-2642':0, '1f3cb-1f3ff-200d-2642':0, '1f3cb-1f3fb':0, '1f3cb-1f3fc':0, '1f3cb-1f3fd':0, '1f3cb-1f3fe':0, '1f3cb-1f3ff':0, '1f3cc-1f3fb-200d-2640':0, '1f3cc-1f3fc-200d-2640':0, '1f3cc-1f3fd-200d-2640':0, '1f3cc-1f3fe-200d-2640':0, '1f3cc-1f3ff-200d-2640':0, '1f3cc-1f3fb-200d-2642':0, '1f3cc-1f3fc-200d-2642':0, '1f3cc-1f3fd-200d-2642':0, '1f3cc-1f3fe-200d-2642':0, '1f3cc-1f3ff-200d-2642':0, '1f3cc-1f3fb':0, '1f3cc-1f3fc':0, '1f3cc-1f3fd':0, '1f3cc-1f3fe':0, '1f3cc-1f3ff':0, '1f442-1f3fb':0, '1f442-1f3fc':0, '1f442-1f3fd':0, '1f442-1f3fe':0, '1f442-1f3ff':0, '1f443-1f3fb':0, '1f443-1f3fc':0, '1f443-1f3fd':0, '1f443-1f3fe':0, '1f443-1f3ff':0, '1f446-1f3fb':0, '1f446-1f3fc':0, '1f446-1f3fd':0, '1f446-1f3fe':0, '1f446-1f3ff':0, '1f447-1f3fb':0, '1f447-1f3fc':0, '1f447-1f3fd':0, '1f447-1f3fe':0, '1f447-1f3ff':0, '1f448-1f3fb':0, '1f448-1f3fc':0, '1f448-1f3fd':0, '1f448-1f3fe':0, '1f448-1f3ff':0, '1f449-1f3fb':0, '1f449-1f3fc':0, '1f449-1f3fd':0, '1f449-1f3fe':0, '1f449-1f3ff':0, '1f44a-1f3fb':0, '1f44a-1f3fc':0, '1f44a-1f3fd':0, '1f44a-1f3fe':0, '1f44a-1f3ff':0, '1f44b-1f3fb':0, '1f44b-1f3fc':0, '1f44b-1f3fd':0, '1f44b-1f3fe':0, '1f44b-1f3ff':0, '1f44c-1f3fb':0, '1f44c-1f3fc':0, '1f44c-1f3fd':0, '1f44c-1f3fe':0, '1f44c-1f3ff':0, '1f44d-1f3fb':0, '1f44d-1f3fc':0, '1f44d-1f3fd':0, '1f44d-1f3fe':0, '1f44d-1f3ff':0, '1f44e-1f3fb':0, '1f44e-1f3fc':0, '1f44e-1f3fd':0, '1f44e-1f3fe':0, '1f44e-1f3ff':0, '1f44f-1f3fb':0, '1f44f-1f3fc':0, '1f44f-1f3fd':0, '1f44f-1f3fe':0, '1f44f-1f3ff':0, '1f450-1f3fb':0, '1f450-1f3fc':0, '1f450-1f3fd':0, '1f450-1f3fe':0, '1f450-1f3ff':0, '1f466-1f3fb':0, '1f466-1f3fc':0, '1f466-1f3fd':0, '1f466-1f3fe':0, '1f466-1f3ff':0, '1f467-1f3fb':0, '1f467-1f3fc':0, '1f467-1f3fd':0, '1f467-1f3fe':0, '1f467-1f3ff':0, '1f468-1f3fb-200d-1f33e':0, '1f468-1f3fc-200d-1f33e':0, '1f468-1f3fd-200d-1f33e':0, '1f468-1f3fe-200d-1f33e':0, '1f468-1f3ff-200d-1f33e':0, '1f468-1f3fb-200d-1f373':0, '1f468-1f3fc-200d-1f373':0, '1f468-1f3fd-200d-1f373':0, '1f468-1f3fe-200d-1f373':0, '1f468-1f3ff-200d-1f373':0, '1f468-1f3fb-200d-1f37c':0, '1f468-1f3fc-200d-1f37c':0, '1f468-1f3fd-200d-1f37c':0, '1f468-1f3fe-200d-1f37c':0, '1f468-1f3ff-200d-1f37c':0, '1f468-1f3fb-200d-1f393':0, '1f468-1f3fc-200d-1f393':0, '1f468-1f3fd-200d-1f393':0, '1f468-1f3fe-200d-1f393':0, '1f468-1f3ff-200d-1f393':0, '1f468-1f3fb-200d-1f3a4':0, '1f468-1f3fc-200d-1f3a4':0, '1f468-1f3fd-200d-1f3a4':0, '1f468-1f3fe-200d-1f3a4':0, '1f468-1f3ff-200d-1f3a4':0, '1f468-1f3fb-200d-1f3a8':0, '1f468-1f3fc-200d-1f3a8':0, '1f468-1f3fd-200d-1f3a8':0, '1f468-1f3fe-200d-1f3a8':0, '1f468-1f3ff-200d-1f3a8':0, '1f468-1f3fb-200d-1f3eb':0, '1f468-1f3fc-200d-1f3eb':0, '1f468-1f3fd-200d-1f3eb':0, '1f468-1f3fe-200d-1f3eb':0, '1f468-1f3ff-200d-1f3eb':0, '1f468-1f3fb-200d-1f3ed':0, '1f468-1f3fc-200d-1f3ed':0, '1f468-1f3fd-200d-1f3ed':0, '1f468-1f3fe-200d-1f3ed':0, '1f468-1f3ff-200d-1f3ed':0, '1f468-1f3fb-200d-1f4bb':0, '1f468-1f3fc-200d-1f4bb':0, '1f468-1f3fd-200d-1f4bb':0, '1f468-1f3fe-200d-1f4bb':0, '1f468-1f3ff-200d-1f4bb':0, '1f468-1f3fb-200d-1f4bc':0, '1f468-1f3fc-200d-1f4bc':0, '1f468-1f3fd-200d-1f4bc':0, '1f468-1f3fe-200d-1f4bc':0, '1f468-1f3ff-200d-1f4bc':0, '1f468-1f3fb-200d-1f527':0, '1f468-1f3fc-200d-1f527':0, '1f468-1f3fd-200d-1f527':0, '1f468-1f3fe-200d-1f527':0, '1f468-1f3ff-200d-1f527':0, '1f468-1f3fb-200d-1f52c':0, '1f468-1f3fc-200d-1f52c':0, '1f468-1f3fd-200d-1f52c':0, '1f468-1f3fe-200d-1f52c':0, '1f468-1f3ff-200d-1f52c':0, '1f468-1f3fb-200d-1f680':0, '1f468-1f3fc-200d-1f680':0, '1f468-1f3fd-200d-1f680':0, '1f468-1f3fe-200d-1f680':0, '1f468-1f3ff-200d-1f680':0, '1f468-1f3fb-200d-1f692':0, '1f468-1f3fc-200d-1f692':0, '1f468-1f3fd-200d-1f692':0, '1f468-1f3fe-200d-1f692':0, '1f468-1f3ff-200d-1f692':0, '1f468-1f3fb-200d-1f9af':0, '1f468-1f3fc-200d-1f9af':0, '1f468-1f3fd-200d-1f9af':0, '1f468-1f3fe-200d-1f9af':0, '1f468-1f3ff-200d-1f9af':0, '1f468-1f3fb-200d-1f9b0':0, '1f468-1f3fc-200d-1f9b0':0, '1f468-1f3fd-200d-1f9b0':0, '1f468-1f3fe-200d-1f9b0':0, '1f468-1f3ff-200d-1f9b0':0, '1f468-1f3fb-200d-1f9b1':0, '1f468-1f3fc-200d-1f9b1':0, '1f468-1f3fd-200d-1f9b1':0, '1f468-1f3fe-200d-1f9b1':0, '1f468-1f3ff-200d-1f9b1':0, '1f468-1f3fb-200d-1f9b2':0, '1f468-1f3fc-200d-1f9b2':0, '1f468-1f3fd-200d-1f9b2':0, '1f468-1f3fe-200d-1f9b2':0, '1f468-1f3ff-200d-1f9b2':0, '1f468-1f3fb-200d-1f9b3':0, '1f468-1f3fc-200d-1f9b3':0, '1f468-1f3fd-200d-1f9b3':0, '1f468-1f3fe-200d-1f9b3':0, '1f468-1f3ff-200d-1f9b3':0, '1f468-1f3fb-200d-1f9bc':0, '1f468-1f3fc-200d-1f9bc':0, '1f468-1f3fd-200d-1f9bc':0, '1f468-1f3fe-200d-1f9bc':0, '1f468-1f3ff-200d-1f9bc':0, '1f468-1f3fb-200d-1f9bd':0, '1f468-1f3fc-200d-1f9bd':0, '1f468-1f3fd-200d-1f9bd':0, '1f468-1f3fe-200d-1f9bd':0, '1f468-1f3ff-200d-1f9bd':0, '1f468-1f3fb-200d-2695':0, '1f468-1f3fc-200d-2695':0, '1f468-1f3fd-200d-2695':0, '1f468-1f3fe-200d-2695':0, '1f468-1f3ff-200d-2695':0, '1f468-1f3fb-200d-2696':0, '1f468-1f3fc-200d-2696':0, '1f468-1f3fd-200d-2696':0, '1f468-1f3fe-200d-2696':0, '1f468-1f3ff-200d-2696':0, '1f468-1f3fb-200d-2708':0, '1f468-1f3fc-200d-2708':0, '1f468-1f3fd-200d-2708':0, '1f468-1f3fe-200d-2708':0, '1f468-1f3ff-200d-2708':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3fb':0, '1f468-1f3fc':0, '1f468-1f3fd':0, '1f468-1f3fe':0, '1f468-1f3ff':0, '1f469-1f3fb-200d-1f33e':0, '1f469-1f3fc-200d-1f33e':0, '1f469-1f3fd-200d-1f33e':0, '1f469-1f3fe-200d-1f33e':0, '1f469-1f3ff-200d-1f33e':0, '1f469-1f3fb-200d-1f373':0, '1f469-1f3fc-200d-1f373':0, '1f469-1f3fd-200d-1f373':0, '1f469-1f3fe-200d-1f373':0, '1f469-1f3ff-200d-1f373':0, '1f469-1f3fb-200d-1f37c':0, '1f469-1f3fc-200d-1f37c':0, '1f469-1f3fd-200d-1f37c':0, '1f469-1f3fe-200d-1f37c':0, '1f469-1f3ff-200d-1f37c':0, '1f469-1f3fb-200d-1f393':0, '1f469-1f3fc-200d-1f393':0, '1f469-1f3fd-200d-1f393':0, '1f469-1f3fe-200d-1f393':0, '1f469-1f3ff-200d-1f393':0, '1f469-1f3fb-200d-1f3a4':0, '1f469-1f3fc-200d-1f3a4':0, '1f469-1f3fd-200d-1f3a4':0, '1f469-1f3fe-200d-1f3a4':0, '1f469-1f3ff-200d-1f3a4':0, '1f469-1f3fb-200d-1f3a8':0, '1f469-1f3fc-200d-1f3a8':0, '1f469-1f3fd-200d-1f3a8':0, '1f469-1f3fe-200d-1f3a8':0, '1f469-1f3ff-200d-1f3a8':0, '1f469-1f3fb-200d-1f3eb':0, '1f469-1f3fc-200d-1f3eb':0, '1f469-1f3fd-200d-1f3eb':0, '1f469-1f3fe-200d-1f3eb':0, '1f469-1f3ff-200d-1f3eb':0, '1f469-1f3fb-200d-1f3ed':0, '1f469-1f3fc-200d-1f3ed':0, '1f469-1f3fd-200d-1f3ed':0, '1f469-1f3fe-200d-1f3ed':0, '1f469-1f3ff-200d-1f3ed':0, '1f469-1f3fb-200d-1f4bb':0, '1f469-1f3fc-200d-1f4bb':0, '1f469-1f3fd-200d-1f4bb':0, '1f469-1f3fe-200d-1f4bb':0, '1f469-1f3ff-200d-1f4bb':0, '1f469-1f3fb-200d-1f4bc':0, '1f469-1f3fc-200d-1f4bc':0, '1f469-1f3fd-200d-1f4bc':0, '1f469-1f3fe-200d-1f4bc':0, '1f469-1f3ff-200d-1f4bc':0, '1f469-1f3fb-200d-1f527':0, '1f469-1f3fc-200d-1f527':0, '1f469-1f3fd-200d-1f527':0, '1f469-1f3fe-200d-1f527':0, '1f469-1f3ff-200d-1f527':0, '1f469-1f3fb-200d-1f52c':0, '1f469-1f3fc-200d-1f52c':0, '1f469-1f3fd-200d-1f52c':0, '1f469-1f3fe-200d-1f52c':0, '1f469-1f3ff-200d-1f52c':0, '1f469-1f3fb-200d-1f680':0, '1f469-1f3fc-200d-1f680':0, '1f469-1f3fd-200d-1f680':0, '1f469-1f3fe-200d-1f680':0, '1f469-1f3ff-200d-1f680':0, '1f469-1f3fb-200d-1f692':0, '1f469-1f3fc-200d-1f692':0, '1f469-1f3fd-200d-1f692':0, '1f469-1f3fe-200d-1f692':0, '1f469-1f3ff-200d-1f692':0, '1f469-1f3fb-200d-1f9af':0, '1f469-1f3fc-200d-1f9af':0, '1f469-1f3fd-200d-1f9af':0, '1f469-1f3fe-200d-1f9af':0, '1f469-1f3ff-200d-1f9af':0, '1f469-1f3fb-200d-1f9b0':0, '1f469-1f3fc-200d-1f9b0':0, '1f469-1f3fd-200d-1f9b0':0, '1f469-1f3fe-200d-1f9b0':0, '1f469-1f3ff-200d-1f9b0':0, '1f469-1f3fb-200d-1f9b1':0, '1f469-1f3fc-200d-1f9b1':0, '1f469-1f3fd-200d-1f9b1':0, '1f469-1f3fe-200d-1f9b1':0, '1f469-1f3ff-200d-1f9b1':0, '1f469-1f3fb-200d-1f9b2':0, '1f469-1f3fc-200d-1f9b2':0, '1f469-1f3fd-200d-1f9b2':0, '1f469-1f3fe-200d-1f9b2':0, '1f469-1f3ff-200d-1f9b2':0, '1f469-1f3fb-200d-1f9b3':0, '1f469-1f3fc-200d-1f9b3':0, '1f469-1f3fd-200d-1f9b3':0, '1f469-1f3fe-200d-1f9b3':0, '1f469-1f3ff-200d-1f9b3':0, '1f469-1f3fb-200d-1f9bc':0, '1f469-1f3fc-200d-1f9bc':0, '1f469-1f3fd-200d-1f9bc':0, '1f469-1f3fe-200d-1f9bc':0, '1f469-1f3ff-200d-1f9bc':0, '1f469-1f3fb-200d-1f9bd':0, '1f469-1f3fc-200d-1f9bd':0, '1f469-1f3fd-200d-1f9bd':0, '1f469-1f3fe-200d-1f9bd':0, '1f469-1f3ff-200d-1f9bd':0, '1f469-1f3fb-200d-2695':0, '1f469-1f3fc-200d-2695':0, '1f469-1f3fd-200d-2695':0, '1f469-1f3fe-200d-2695':0, '1f469-1f3ff-200d-2695':0, '1f469-1f3fb-200d-2696':0, '1f469-1f3fc-200d-2696':0, '1f469-1f3fd-200d-2696':0, '1f469-1f3fe-200d-2696':0, '1f469-1f3ff-200d-2696':0, '1f469-1f3fb-200d-2708':0, '1f469-1f3fc-200d-2708':0, '1f469-1f3fd-200d-2708':0, '1f469-1f3fe-200d-2708':0, '1f469-1f3ff-200d-2708':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3fb':0, '1f469-1f3fc':0, '1f469-1f3fd':0, '1f469-1f3fe':0, '1f469-1f3ff':0, '1f46b-1f3fb':0, '1f46b-1f3fc':0, '1f46b-1f3fd':0, '1f46b-1f3fe':0, '1f46b-1f3ff':0, '1f469-1f3fb-200d-1f91d-200d-1f468-1f3fc':0, '1f469-1f3fb-200d-1f91d-200d-1f468-1f3fd':0, '1f469-1f3fb-200d-1f91d-200d-1f468-1f3fe':0, '1f469-1f3fb-200d-1f91d-200d-1f468-1f3ff':0, '1f469-1f3fc-200d-1f91d-200d-1f468-1f3fb':0, '1f469-1f3fc-200d-1f91d-200d-1f468-1f3fd':0, '1f469-1f3fc-200d-1f91d-200d-1f468-1f3fe':0, '1f469-1f3fc-200d-1f91d-200d-1f468-1f3ff':0, '1f469-1f3fd-200d-1f91d-200d-1f468-1f3fb':0, '1f469-1f3fd-200d-1f91d-200d-1f468-1f3fc':0, '1f469-1f3fd-200d-1f91d-200d-1f468-1f3fe':0, '1f469-1f3fd-200d-1f91d-200d-1f468-1f3ff':0, '1f469-1f3fe-200d-1f91d-200d-1f468-1f3fb':0, '1f469-1f3fe-200d-1f91d-200d-1f468-1f3fc':0, '1f469-1f3fe-200d-1f91d-200d-1f468-1f3fd':0, '1f469-1f3fe-200d-1f91d-200d-1f468-1f3ff':0, '1f469-1f3ff-200d-1f91d-200d-1f468-1f3fb':0, '1f469-1f3ff-200d-1f91d-200d-1f468-1f3fc':0, '1f469-1f3ff-200d-1f91d-200d-1f468-1f3fd':0, '1f469-1f3ff-200d-1f91d-200d-1f468-1f3fe':0, '1f46c-1f3fb':0, '1f46c-1f3fc':0, '1f46c-1f3fd':0, '1f46c-1f3fe':0, '1f46c-1f3ff':0, '1f468-1f3fb-200d-1f91d-200d-1f468-1f3fc':0, '1f468-1f3fb-200d-1f91d-200d-1f468-1f3fd':0, '1f468-1f3fb-200d-1f91d-200d-1f468-1f3fe':0, '1f468-1f3fb-200d-1f91d-200d-1f468-1f3ff':0, '1f468-1f3fc-200d-1f91d-200d-1f468-1f3fb':0, '1f468-1f3fc-200d-1f91d-200d-1f468-1f3fd':0, '1f468-1f3fc-200d-1f91d-200d-1f468-1f3fe':0, '1f468-1f3fc-200d-1f91d-200d-1f468-1f3ff':0, '1f468-1f3fd-200d-1f91d-200d-1f468-1f3fb':0, '1f468-1f3fd-200d-1f91d-200d-1f468-1f3fc':0, '1f468-1f3fd-200d-1f91d-200d-1f468-1f3fe':0, '1f468-1f3fd-200d-1f91d-200d-1f468-1f3ff':0, '1f468-1f3fe-200d-1f91d-200d-1f468-1f3fb':0, '1f468-1f3fe-200d-1f91d-200d-1f468-1f3fc':0, '1f468-1f3fe-200d-1f91d-200d-1f468-1f3fd':0, '1f468-1f3fe-200d-1f91d-200d-1f468-1f3ff':0, '1f468-1f3ff-200d-1f91d-200d-1f468-1f3fb':0, '1f468-1f3ff-200d-1f91d-200d-1f468-1f3fc':0, '1f468-1f3ff-200d-1f91d-200d-1f468-1f3fd':0, '1f468-1f3ff-200d-1f91d-200d-1f468-1f3fe':0, '1f46d-1f3fb':0, '1f46d-1f3fc':0, '1f46d-1f3fd':0, '1f46d-1f3fe':0, '1f46d-1f3ff':0, '1f469-1f3fb-200d-1f91d-200d-1f469-1f3fc':0, '1f469-1f3fb-200d-1f91d-200d-1f469-1f3fd':0, '1f469-1f3fb-200d-1f91d-200d-1f469-1f3fe':0, '1f469-1f3fb-200d-1f91d-200d-1f469-1f3ff':0, '1f469-1f3fc-200d-1f91d-200d-1f469-1f3fb':0, '1f469-1f3fc-200d-1f91d-200d-1f469-1f3fd':0, '1f469-1f3fc-200d-1f91d-200d-1f469-1f3fe':0, '1f469-1f3fc-200d-1f91d-200d-1f469-1f3ff':0, '1f469-1f3fd-200d-1f91d-200d-1f469-1f3fb':0, '1f469-1f3fd-200d-1f91d-200d-1f469-1f3fc':0, '1f469-1f3fd-200d-1f91d-200d-1f469-1f3fe':0, '1f469-1f3fd-200d-1f91d-200d-1f469-1f3ff':0, '1f469-1f3fe-200d-1f91d-200d-1f469-1f3fb':0, '1f469-1f3fe-200d-1f91d-200d-1f469-1f3fc':0, '1f469-1f3fe-200d-1f91d-200d-1f469-1f3fd':0, '1f469-1f3fe-200d-1f91d-200d-1f469-1f3ff':0, '1f469-1f3ff-200d-1f91d-200d-1f469-1f3fb':0, '1f469-1f3ff-200d-1f91d-200d-1f469-1f3fc':0, '1f469-1f3ff-200d-1f91d-200d-1f469-1f3fd':0, '1f469-1f3ff-200d-1f91d-200d-1f469-1f3fe':0, '1f46e-1f3fb-200d-2640':0, '1f46e-1f3fc-200d-2640':0, '1f46e-1f3fd-200d-2640':0, '1f46e-1f3fe-200d-2640':0, '1f46e-1f3ff-200d-2640':0, '1f46e-1f3fb-200d-2642':0, '1f46e-1f3fc-200d-2642':0, '1f46e-1f3fd-200d-2642':0, '1f46e-1f3fe-200d-2642':0, '1f46e-1f3ff-200d-2642':0, '1f46e-1f3fb':0, '1f46e-1f3fc':0, '1f46e-1f3fd':0, '1f46e-1f3fe':0, '1f46e-1f3ff':0, '1f470-1f3fb-200d-2640':0, '1f470-1f3fc-200d-2640':0, '1f470-1f3fd-200d-2640':0, '1f470-1f3fe-200d-2640':0, '1f470-1f3ff-200d-2640':0, '1f470-1f3fb-200d-2642':0, '1f470-1f3fc-200d-2642':0, '1f470-1f3fd-200d-2642':0, '1f470-1f3fe-200d-2642':0, '1f470-1f3ff-200d-2642':0, '1f470-1f3fb':0, '1f470-1f3fc':0, '1f470-1f3fd':0, '1f470-1f3fe':0, '1f470-1f3ff':0, '1f471-1f3fb-200d-2640':0, '1f471-1f3fc-200d-2640':0, '1f471-1f3fd-200d-2640':0, '1f471-1f3fe-200d-2640':0, '1f471-1f3ff-200d-2640':0, '1f471-1f3fb-200d-2642':0, '1f471-1f3fc-200d-2642':0, '1f471-1f3fd-200d-2642':0, '1f471-1f3fe-200d-2642':0, '1f471-1f3ff-200d-2642':0, '1f471-1f3fb':0, '1f471-1f3fc':0, '1f471-1f3fd':0, '1f471-1f3fe':0, '1f471-1f3ff':0, '1f472-1f3fb':0, '1f472-1f3fc':0, '1f472-1f3fd':0, '1f472-1f3fe':0, '1f472-1f3ff':0, '1f473-1f3fb-200d-2640':0, '1f473-1f3fc-200d-2640':0, '1f473-1f3fd-200d-2640':0, '1f473-1f3fe-200d-2640':0, '1f473-1f3ff-200d-2640':0, '1f473-1f3fb-200d-2642':0, '1f473-1f3fc-200d-2642':0, '1f473-1f3fd-200d-2642':0, '1f473-1f3fe-200d-2642':0, '1f473-1f3ff-200d-2642':0, '1f473-1f3fb':0, '1f473-1f3fc':0, '1f473-1f3fd':0, '1f473-1f3fe':0, '1f473-1f3ff':0, '1f474-1f3fb':0, '1f474-1f3fc':0, '1f474-1f3fd':0, '1f474-1f3fe':0, '1f474-1f3ff':0, '1f475-1f3fb':0, '1f475-1f3fc':0, '1f475-1f3fd':0, '1f475-1f3fe':0, '1f475-1f3ff':0, '1f476-1f3fb':0, '1f476-1f3fc':0, '1f476-1f3fd':0, '1f476-1f3fe':0, '1f476-1f3ff':0, '1f477-1f3fb-200d-2640':0, '1f477-1f3fc-200d-2640':0, '1f477-1f3fd-200d-2640':0, '1f477-1f3fe-200d-2640':0, '1f477-1f3ff-200d-2640':0, '1f477-1f3fb-200d-2642':0, '1f477-1f3fc-200d-2642':0, '1f477-1f3fd-200d-2642':0, '1f477-1f3fe-200d-2642':0, '1f477-1f3ff-200d-2642':0, '1f477-1f3fb':0, '1f477-1f3fc':0, '1f477-1f3fd':0, '1f477-1f3fe':0, '1f477-1f3ff':0, '1f478-1f3fb':0, '1f478-1f3fc':0, '1f478-1f3fd':0, '1f478-1f3fe':0, '1f478-1f3ff':0, '1f47c-1f3fb':0, '1f47c-1f3fc':0, '1f47c-1f3fd':0, '1f47c-1f3fe':0, '1f47c-1f3ff':0, '1f481-1f3fb-200d-2640':0, '1f481-1f3fc-200d-2640':0, '1f481-1f3fd-200d-2640':0, '1f481-1f3fe-200d-2640':0, '1f481-1f3ff-200d-2640':0, '1f481-1f3fb-200d-2642':0, '1f481-1f3fc-200d-2642':0, '1f481-1f3fd-200d-2642':0, '1f481-1f3fe-200d-2642':0, '1f481-1f3ff-200d-2642':0, '1f481-1f3fb':0, '1f481-1f3fc':0, '1f481-1f3fd':0, '1f481-1f3fe':0, '1f481-1f3ff':0, '1f482-1f3fb-200d-2640':0, '1f482-1f3fc-200d-2640':0, '1f482-1f3fd-200d-2640':0, '1f482-1f3fe-200d-2640':0, '1f482-1f3ff-200d-2640':0, '1f482-1f3fb-200d-2642':0, '1f482-1f3fc-200d-2642':0, '1f482-1f3fd-200d-2642':0, '1f482-1f3fe-200d-2642':0, '1f482-1f3ff-200d-2642':0, '1f482-1f3fb':0, '1f482-1f3fc':0, '1f482-1f3fd':0, '1f482-1f3fe':0, '1f482-1f3ff':0, '1f483-1f3fb':0, '1f483-1f3fc':0, '1f483-1f3fd':0, '1f483-1f3fe':0, '1f483-1f3ff':0, '1f485-1f3fb':0, '1f485-1f3fc':0, '1f485-1f3fd':0, '1f485-1f3fe':0, '1f485-1f3ff':0, '1f486-1f3fb-200d-2640':0, '1f486-1f3fc-200d-2640':0, '1f486-1f3fd-200d-2640':0, '1f486-1f3fe-200d-2640':0, '1f486-1f3ff-200d-2640':0, '1f486-1f3fb-200d-2642':0, '1f486-1f3fc-200d-2642':0, '1f486-1f3fd-200d-2642':0, '1f486-1f3fe-200d-2642':0, '1f486-1f3ff-200d-2642':0, '1f486-1f3fb':0, '1f486-1f3fc':0, '1f486-1f3fd':0, '1f486-1f3fe':0, '1f486-1f3ff':0, '1f487-1f3fb-200d-2640':0, '1f487-1f3fc-200d-2640':0, '1f487-1f3fd-200d-2640':0, '1f487-1f3fe-200d-2640':0, '1f487-1f3ff-200d-2640':0, '1f487-1f3fb-200d-2642':0, '1f487-1f3fc-200d-2642':0, '1f487-1f3fd-200d-2642':0, '1f487-1f3fe-200d-2642':0, '1f487-1f3ff-200d-2642':0, '1f487-1f3fb':0, '1f487-1f3fc':0, '1f487-1f3fd':0, '1f487-1f3fe':0, '1f487-1f3ff':0, '1f48f-1f3fb':0, '1f48f-1f3fc':0, '1f48f-1f3fd':0, '1f48f-1f3fe':0, '1f48f-1f3ff':0, '1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fc':0, '1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fd':0, '1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fe':0, '1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3ff':0, '1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fb':0, '1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fd':0, '1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fe':0, '1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3ff':0, '1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fb':0, '1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fc':0, '1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fe':0, '1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3ff':0, '1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fb':0, '1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fc':0, '1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fd':0, '1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3ff':0, '1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fb':0, '1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fc':0, '1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fd':0, '1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fe':0, '1f491-1f3fb':0, '1f491-1f3fc':0, '1f491-1f3fd':0, '1f491-1f3fe':0, '1f491-1f3ff':0, '1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fc':0, '1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fd':0, '1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fe':0, '1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3ff':0, '1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fb':0, '1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fd':0, '1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fe':0, '1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3ff':0, '1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fb':0, '1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fc':0, '1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fe':0, '1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3ff':0, '1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fb':0, '1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fc':0, '1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fd':0, '1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3ff':0, '1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fb':0, '1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fc':0, '1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fd':0, '1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fe':0, '1f4aa-1f3fb':0, '1f4aa-1f3fc':0, '1f4aa-1f3fd':0, '1f4aa-1f3fe':0, '1f4aa-1f3ff':0, '1f574-1f3fb':0, '1f574-1f3fc':0, '1f574-1f3fd':0, '1f574-1f3fe':0, '1f574-1f3ff':0, '1f575-1f3fb-200d-2640':0, '1f575-1f3fc-200d-2640':0, '1f575-1f3fd-200d-2640':0, '1f575-1f3fe-200d-2640':0, '1f575-1f3ff-200d-2640':0, '1f575-1f3fb-200d-2642':0, '1f575-1f3fc-200d-2642':0, '1f575-1f3fd-200d-2642':0, '1f575-1f3fe-200d-2642':0, '1f575-1f3ff-200d-2642':0, '1f575-1f3fb':0, '1f575-1f3fc':0, '1f575-1f3fd':0, '1f575-1f3fe':0, '1f575-1f3ff':0, '1f57a-1f3fb':0, '1f57a-1f3fc':0, '1f57a-1f3fd':0, '1f57a-1f3fe':0, '1f57a-1f3ff':0, '1f590-1f3fb':0, '1f590-1f3fc':0, '1f590-1f3fd':0, '1f590-1f3fe':0, '1f590-1f3ff':0, '1f595-1f3fb':0, '1f595-1f3fc':0, '1f595-1f3fd':0, '1f595-1f3fe':0, '1f595-1f3ff':0, '1f596-1f3fb':0, '1f596-1f3fc':0, '1f596-1f3fd':0, '1f596-1f3fe':0, '1f596-1f3ff':0, '1f645-1f3fb-200d-2640':0, '1f645-1f3fc-200d-2640':0, '1f645-1f3fd-200d-2640':0, '1f645-1f3fe-200d-2640':0, '1f645-1f3ff-200d-2640':0, '1f645-1f3fb-200d-2642':0, '1f645-1f3fc-200d-2642':0, '1f645-1f3fd-200d-2642':0, '1f645-1f3fe-200d-2642':0, '1f645-1f3ff-200d-2642':0, '1f645-1f3fb':0, '1f645-1f3fc':0, '1f645-1f3fd':0, '1f645-1f3fe':0, '1f645-1f3ff':0, '1f646-1f3fb-200d-2640':0, '1f646-1f3fc-200d-2640':0, '1f646-1f3fd-200d-2640':0, '1f646-1f3fe-200d-2640':0, '1f646-1f3ff-200d-2640':0, '1f646-1f3fb-200d-2642':0, '1f646-1f3fc-200d-2642':0, '1f646-1f3fd-200d-2642':0, '1f646-1f3fe-200d-2642':0, '1f646-1f3ff-200d-2642':0, '1f646-1f3fb':0, '1f646-1f3fc':0, '1f646-1f3fd':0, '1f646-1f3fe':0, '1f646-1f3ff':0, '1f647-1f3fb-200d-2640':0, '1f647-1f3fc-200d-2640':0, '1f647-1f3fd-200d-2640':0, '1f647-1f3fe-200d-2640':0, '1f647-1f3ff-200d-2640':0, '1f647-1f3fb-200d-2642':0, '1f647-1f3fc-200d-2642':0, '1f647-1f3fd-200d-2642':0, '1f647-1f3fe-200d-2642':0, '1f647-1f3ff-200d-2642':0, '1f647-1f3fb':0, '1f647-1f3fc':0, '1f647-1f3fd':0, '1f647-1f3fe':0, '1f647-1f3ff':0, '1f64b-1f3fb-200d-2640':0, '1f64b-1f3fc-200d-2640':0, '1f64b-1f3fd-200d-2640':0, '1f64b-1f3fe-200d-2640':0, '1f64b-1f3ff-200d-2640':0, '1f64b-1f3fb-200d-2642':0, '1f64b-1f3fc-200d-2642':0, '1f64b-1f3fd-200d-2642':0, '1f64b-1f3fe-200d-2642':0, '1f64b-1f3ff-200d-2642':0, '1f64b-1f3fb':0, '1f64b-1f3fc':0, '1f64b-1f3fd':0, '1f64b-1f3fe':0, '1f64b-1f3ff':0, '1f64c-1f3fb':0, '1f64c-1f3fc':0, '1f64c-1f3fd':0, '1f64c-1f3fe':0, '1f64c-1f3ff':0, '1f64d-1f3fb-200d-2640':0, '1f64d-1f3fc-200d-2640':0, '1f64d-1f3fd-200d-2640':0, '1f64d-1f3fe-200d-2640':0, '1f64d-1f3ff-200d-2640':0, '1f64d-1f3fb-200d-2642':0, '1f64d-1f3fc-200d-2642':0, '1f64d-1f3fd-200d-2642':0, '1f64d-1f3fe-200d-2642':0, '1f64d-1f3ff-200d-2642':0, '1f64d-1f3fb':0, '1f64d-1f3fc':0, '1f64d-1f3fd':0, '1f64d-1f3fe':0, '1f64d-1f3ff':0, '1f64e-1f3fb-200d-2640':0, '1f64e-1f3fc-200d-2640':0, '1f64e-1f3fd-200d-2640':0, '1f64e-1f3fe-200d-2640':0, '1f64e-1f3ff-200d-2640':0, '1f64e-1f3fb-200d-2642':0, '1f64e-1f3fc-200d-2642':0, '1f64e-1f3fd-200d-2642':0, '1f64e-1f3fe-200d-2642':0, '1f64e-1f3ff-200d-2642':0, '1f64e-1f3fb':0, '1f64e-1f3fc':0, '1f64e-1f3fd':0, '1f64e-1f3fe':0, '1f64e-1f3ff':0, '1f64f-1f3fb':0, '1f64f-1f3fc':0, '1f64f-1f3fd':0, '1f64f-1f3fe':0, '1f64f-1f3ff':0, '1f6a3-1f3fb-200d-2640':0, '1f6a3-1f3fc-200d-2640':0, '1f6a3-1f3fd-200d-2640':0, '1f6a3-1f3fe-200d-2640':0, '1f6a3-1f3ff-200d-2640':0, '1f6a3-1f3fb-200d-2642':0, '1f6a3-1f3fc-200d-2642':0, '1f6a3-1f3fd-200d-2642':0, '1f6a3-1f3fe-200d-2642':0, '1f6a3-1f3ff-200d-2642':0, '1f6a3-1f3fb':0, '1f6a3-1f3fc':0, '1f6a3-1f3fd':0, '1f6a3-1f3fe':0, '1f6a3-1f3ff':0, '1f6b4-1f3fb-200d-2640':0, '1f6b4-1f3fc-200d-2640':0, '1f6b4-1f3fd-200d-2640':0, '1f6b4-1f3fe-200d-2640':0, '1f6b4-1f3ff-200d-2640':0, '1f6b4-1f3fb-200d-2642':0, '1f6b4-1f3fc-200d-2642':0, '1f6b4-1f3fd-200d-2642':0, '1f6b4-1f3fe-200d-2642':0, '1f6b4-1f3ff-200d-2642':0, '1f6b4-1f3fb':0, '1f6b4-1f3fc':0, '1f6b4-1f3fd':0, '1f6b4-1f3fe':0, '1f6b4-1f3ff':0, '1f6b5-1f3fb-200d-2640':0, '1f6b5-1f3fc-200d-2640':0, '1f6b5-1f3fd-200d-2640':0, '1f6b5-1f3fe-200d-2640':0, '1f6b5-1f3ff-200d-2640':0, '1f6b5-1f3fb-200d-2642':0, '1f6b5-1f3fc-200d-2642':0, '1f6b5-1f3fd-200d-2642':0, '1f6b5-1f3fe-200d-2642':0, '1f6b5-1f3ff-200d-2642':0, '1f6b5-1f3fb':0, '1f6b5-1f3fc':0, '1f6b5-1f3fd':0, '1f6b5-1f3fe':0, '1f6b5-1f3ff':0, '1f6b6-1f3fb-200d-2640':0, '1f6b6-1f3fc-200d-2640':0, '1f6b6-1f3fd-200d-2640':0, '1f6b6-1f3fe-200d-2640':0, '1f6b6-1f3ff-200d-2640':0, '1f6b6-1f3fb-200d-2642':0, '1f6b6-1f3fc-200d-2642':0, '1f6b6-1f3fd-200d-2642':0, '1f6b6-1f3fe-200d-2642':0, '1f6b6-1f3ff-200d-2642':0, '1f6b6-1f3fb':0, '1f6b6-1f3fc':0, '1f6b6-1f3fd':0, '1f6b6-1f3fe':0, '1f6b6-1f3ff':0, '1f6c0-1f3fb':0, '1f6c0-1f3fc':0, '1f6c0-1f3fd':0, '1f6c0-1f3fe':0, '1f6c0-1f3ff':0, '1f6cc-1f3fb':0, '1f6cc-1f3fc':0, '1f6cc-1f3fd':0, '1f6cc-1f3fe':0, '1f6cc-1f3ff':0, '1f90c-1f3fb':0, '1f90c-1f3fc':0, '1f90c-1f3fd':0, '1f90c-1f3fe':0, '1f90c-1f3ff':0, '1f90f-1f3fb':0, '1f90f-1f3fc':0, '1f90f-1f3fd':0, '1f90f-1f3fe':0, '1f90f-1f3ff':0, '1f918-1f3fb':0, '1f918-1f3fc':0, '1f918-1f3fd':0, '1f918-1f3fe':0, '1f918-1f3ff':0, '1f919-1f3fb':0, '1f919-1f3fc':0, '1f919-1f3fd':0, '1f919-1f3fe':0, '1f919-1f3ff':0, '1f91a-1f3fb':0, '1f91a-1f3fc':0, '1f91a-1f3fd':0, '1f91a-1f3fe':0, '1f91a-1f3ff':0, '1f91b-1f3fb':0, '1f91b-1f3fc':0, '1f91b-1f3fd':0, '1f91b-1f3fe':0, '1f91b-1f3ff':0, '1f91c-1f3fb':0, '1f91c-1f3fc':0, '1f91c-1f3fd':0, '1f91c-1f3fe':0, '1f91c-1f3ff':0, '1f91d-1f3fb':0, '1f91d-1f3fc':0, '1f91d-1f3fd':0, '1f91d-1f3fe':0, '1f91d-1f3ff':0, '1f91e-1f3fb':0, '1f91e-1f3fc':0, '1f91e-1f3fd':0, '1f91e-1f3fe':0, '1f91e-1f3ff':0, '1f91f-1f3fb':0, '1f91f-1f3fc':0, '1f91f-1f3fd':0, '1f91f-1f3fe':0, '1f91f-1f3ff':0, '1f926-1f3fb-200d-2640':0, '1f926-1f3fc-200d-2640':0, '1f926-1f3fd-200d-2640':0, '1f926-1f3fe-200d-2640':0, '1f926-1f3ff-200d-2640':0, '1f926-1f3fb-200d-2642':0, '1f926-1f3fc-200d-2642':0, '1f926-1f3fd-200d-2642':0, '1f926-1f3fe-200d-2642':0, '1f926-1f3ff-200d-2642':0, '1f926-1f3fb':0, '1f926-1f3fc':0, '1f926-1f3fd':0, '1f926-1f3fe':0, '1f926-1f3ff':0, '1f930-1f3fb':0, '1f930-1f3fc':0, '1f930-1f3fd':0, '1f930-1f3fe':0, '1f930-1f3ff':0, '1f931-1f3fb':0, '1f931-1f3fc':0, '1f931-1f3fd':0, '1f931-1f3fe':0, '1f931-1f3ff':0, '1f932-1f3fb':0, '1f932-1f3fc':0, '1f932-1f3fd':0, '1f932-1f3fe':0, '1f932-1f3ff':0, '1f933-1f3fb':0, '1f933-1f3fc':0, '1f933-1f3fd':0, '1f933-1f3fe':0, '1f933-1f3ff':0, '1f934-1f3fb':0, '1f934-1f3fc':0, '1f934-1f3fd':0, '1f934-1f3fe':0, '1f934-1f3ff':0, '1f935-1f3fb-200d-2640':0, '1f935-1f3fc-200d-2640':0, '1f935-1f3fd-200d-2640':0, '1f935-1f3fe-200d-2640':0, '1f935-1f3ff-200d-2640':0, '1f935-1f3fb-200d-2642':0, '1f935-1f3fc-200d-2642':0, '1f935-1f3fd-200d-2642':0, '1f935-1f3fe-200d-2642':0, '1f935-1f3ff-200d-2642':0, '1f935-1f3fb':0, '1f935-1f3fc':0, '1f935-1f3fd':0, '1f935-1f3fe':0, '1f935-1f3ff':0, '1f936-1f3fb':0, '1f936-1f3fc':0, '1f936-1f3fd':0, '1f936-1f3fe':0, '1f936-1f3ff':0, '1f937-1f3fb-200d-2640':0, '1f937-1f3fc-200d-2640':0, '1f937-1f3fd-200d-2640':0, '1f937-1f3fe-200d-2640':0, '1f937-1f3ff-200d-2640':0, '1f937-1f3fb-200d-2642':0, '1f937-1f3fc-200d-2642':0, '1f937-1f3fd-200d-2642':0, '1f937-1f3fe-200d-2642':0, '1f937-1f3ff-200d-2642':0, '1f937-1f3fb':0, '1f937-1f3fc':0, '1f937-1f3fd':0, '1f937-1f3fe':0, '1f937-1f3ff':0, '1f938-1f3fb-200d-2640':0, '1f938-1f3fc-200d-2640':0, '1f938-1f3fd-200d-2640':0, '1f938-1f3fe-200d-2640':0, '1f938-1f3ff-200d-2640':0, '1f938-1f3fb-200d-2642':0, '1f938-1f3fc-200d-2642':0, '1f938-1f3fd-200d-2642':0, '1f938-1f3fe-200d-2642':0, '1f938-1f3ff-200d-2642':0, '1f938-1f3fb':0, '1f938-1f3fc':0, '1f938-1f3fd':0, '1f938-1f3fe':0, '1f938-1f3ff':0, '1f939-1f3fb-200d-2640':0, '1f939-1f3fc-200d-2640':0, '1f939-1f3fd-200d-2640':0, '1f939-1f3fe-200d-2640':0, '1f939-1f3ff-200d-2640':0, '1f939-1f3fb-200d-2642':0, '1f939-1f3fc-200d-2642':0, '1f939-1f3fd-200d-2642':0, '1f939-1f3fe-200d-2642':0, '1f939-1f3ff-200d-2642':0, '1f939-1f3fb':0, '1f939-1f3fc':0, '1f939-1f3fd':0, '1f939-1f3fe':0, '1f939-1f3ff':0, '1f93d-1f3fb-200d-2640':0, '1f93d-1f3fc-200d-2640':0, '1f93d-1f3fd-200d-2640':0, '1f93d-1f3fe-200d-2640':0, '1f93d-1f3ff-200d-2640':0, '1f93d-1f3fb-200d-2642':0, '1f93d-1f3fc-200d-2642':0, '1f93d-1f3fd-200d-2642':0, '1f93d-1f3fe-200d-2642':0, '1f93d-1f3ff-200d-2642':0, '1f93d-1f3fb':0, '1f93d-1f3fc':0, '1f93d-1f3fd':0, '1f93d-1f3fe':0, '1f93d-1f3ff':0, '1f93e-1f3fb-200d-2640':0, '1f93e-1f3fc-200d-2640':0, '1f93e-1f3fd-200d-2640':0, '1f93e-1f3fe-200d-2640':0, '1f93e-1f3ff-200d-2640':0, '1f93e-1f3fb-200d-2642':0, '1f93e-1f3fc-200d-2642':0, '1f93e-1f3fd-200d-2642':0, '1f93e-1f3fe-200d-2642':0, '1f93e-1f3ff-200d-2642':0, '1f93e-1f3fb':0, '1f93e-1f3fc':0, '1f93e-1f3fd':0, '1f93e-1f3fe':0, '1f93e-1f3ff':0, '1f977-1f3fb':0, '1f977-1f3fc':0, '1f977-1f3fd':0, '1f977-1f3fe':0, '1f977-1f3ff':0, '1f9b5-1f3fb':0, '1f9b5-1f3fc':0, '1f9b5-1f3fd':0, '1f9b5-1f3fe':0, '1f9b5-1f3ff':0, '1f9b6-1f3fb':0, '1f9b6-1f3fc':0, '1f9b6-1f3fd':0, '1f9b6-1f3fe':0, '1f9b6-1f3ff':0, '1f9b8-1f3fb-200d-2640':0, '1f9b8-1f3fc-200d-2640':0, '1f9b8-1f3fd-200d-2640':0, '1f9b8-1f3fe-200d-2640':0, '1f9b8-1f3ff-200d-2640':0, '1f9b8-1f3fb-200d-2642':0, '1f9b8-1f3fc-200d-2642':0, '1f9b8-1f3fd-200d-2642':0, '1f9b8-1f3fe-200d-2642':0, '1f9b8-1f3ff-200d-2642':0, '1f9b8-1f3fb':0, '1f9b8-1f3fc':0, '1f9b8-1f3fd':0, '1f9b8-1f3fe':0, '1f9b8-1f3ff':0, '1f9b9-1f3fb-200d-2640':0, '1f9b9-1f3fc-200d-2640':0, '1f9b9-1f3fd-200d-2640':0, '1f9b9-1f3fe-200d-2640':0, '1f9b9-1f3ff-200d-2640':0, '1f9b9-1f3fb-200d-2642':0, '1f9b9-1f3fc-200d-2642':0, '1f9b9-1f3fd-200d-2642':0, '1f9b9-1f3fe-200d-2642':0, '1f9b9-1f3ff-200d-2642':0, '1f9b9-1f3fb':0, '1f9b9-1f3fc':0, '1f9b9-1f3fd':0, '1f9b9-1f3fe':0, '1f9b9-1f3ff':0, '1f9bb-1f3fb':0, '1f9bb-1f3fc':0, '1f9bb-1f3fd':0, '1f9bb-1f3fe':0, '1f9bb-1f3ff':0, '1f9cd-1f3fb-200d-2640':0, '1f9cd-1f3fc-200d-2640':0, '1f9cd-1f3fd-200d-2640':0, '1f9cd-1f3fe-200d-2640':0, '1f9cd-1f3ff-200d-2640':0, '1f9cd-1f3fb-200d-2642':0, '1f9cd-1f3fc-200d-2642':0, '1f9cd-1f3fd-200d-2642':0, '1f9cd-1f3fe-200d-2642':0, '1f9cd-1f3ff-200d-2642':0, '1f9cd-1f3fb':0, '1f9cd-1f3fc':0, '1f9cd-1f3fd':0, '1f9cd-1f3fe':0, '1f9cd-1f3ff':0, '1f9ce-1f3fb-200d-2640':0, '1f9ce-1f3fc-200d-2640':0, '1f9ce-1f3fd-200d-2640':0, '1f9ce-1f3fe-200d-2640':0, '1f9ce-1f3ff-200d-2640':0, '1f9ce-1f3fb-200d-2642':0, '1f9ce-1f3fc-200d-2642':0, '1f9ce-1f3fd-200d-2642':0, '1f9ce-1f3fe-200d-2642':0, '1f9ce-1f3ff-200d-2642':0, '1f9ce-1f3fb':0, '1f9ce-1f3fc':0, '1f9ce-1f3fd':0, '1f9ce-1f3fe':0, '1f9ce-1f3ff':0, '1f9cf-1f3fb-200d-2640':0, '1f9cf-1f3fc-200d-2640':0, '1f9cf-1f3fd-200d-2640':0, '1f9cf-1f3fe-200d-2640':0, '1f9cf-1f3ff-200d-2640':0, '1f9cf-1f3fb-200d-2642':0, '1f9cf-1f3fc-200d-2642':0, '1f9cf-1f3fd-200d-2642':0, '1f9cf-1f3fe-200d-2642':0, '1f9cf-1f3ff-200d-2642':0, '1f9cf-1f3fb':0, '1f9cf-1f3fc':0, '1f9cf-1f3fd':0, '1f9cf-1f3fe':0, '1f9cf-1f3ff':0, '1f9d1-1f3fb-200d-1f33e':0, '1f9d1-1f3fc-200d-1f33e':0, '1f9d1-1f3fd-200d-1f33e':0, '1f9d1-1f3fe-200d-1f33e':0, '1f9d1-1f3ff-200d-1f33e':0, '1f9d1-1f3fb-200d-1f373':0, '1f9d1-1f3fc-200d-1f373':0, '1f9d1-1f3fd-200d-1f373':0, '1f9d1-1f3fe-200d-1f373':0, '1f9d1-1f3ff-200d-1f373':0, '1f9d1-1f3fb-200d-1f37c':0, '1f9d1-1f3fc-200d-1f37c':0, '1f9d1-1f3fd-200d-1f37c':0, '1f9d1-1f3fe-200d-1f37c':0, '1f9d1-1f3ff-200d-1f37c':0, '1f9d1-1f3fb-200d-1f384':0, '1f9d1-1f3fc-200d-1f384':0, '1f9d1-1f3fd-200d-1f384':0, '1f9d1-1f3fe-200d-1f384':0, '1f9d1-1f3ff-200d-1f384':0, '1f9d1-1f3fb-200d-1f393':0, '1f9d1-1f3fc-200d-1f393':0, '1f9d1-1f3fd-200d-1f393':0, '1f9d1-1f3fe-200d-1f393':0, '1f9d1-1f3ff-200d-1f393':0, '1f9d1-1f3fb-200d-1f3a4':0, '1f9d1-1f3fc-200d-1f3a4':0, '1f9d1-1f3fd-200d-1f3a4':0, '1f9d1-1f3fe-200d-1f3a4':0, '1f9d1-1f3ff-200d-1f3a4':0, '1f9d1-1f3fb-200d-1f3a8':0, '1f9d1-1f3fc-200d-1f3a8':0, '1f9d1-1f3fd-200d-1f3a8':0, '1f9d1-1f3fe-200d-1f3a8':0, '1f9d1-1f3ff-200d-1f3a8':0, '1f9d1-1f3fb-200d-1f3eb':0, '1f9d1-1f3fc-200d-1f3eb':0, '1f9d1-1f3fd-200d-1f3eb':0, '1f9d1-1f3fe-200d-1f3eb':0, '1f9d1-1f3ff-200d-1f3eb':0, '1f9d1-1f3fb-200d-1f3ed':0, '1f9d1-1f3fc-200d-1f3ed':0, '1f9d1-1f3fd-200d-1f3ed':0, '1f9d1-1f3fe-200d-1f3ed':0, '1f9d1-1f3ff-200d-1f3ed':0, '1f9d1-1f3fb-200d-1f4bb':0, '1f9d1-1f3fc-200d-1f4bb':0, '1f9d1-1f3fd-200d-1f4bb':0, '1f9d1-1f3fe-200d-1f4bb':0, '1f9d1-1f3ff-200d-1f4bb':0, '1f9d1-1f3fb-200d-1f4bc':0, '1f9d1-1f3fc-200d-1f4bc':0, '1f9d1-1f3fd-200d-1f4bc':0, '1f9d1-1f3fe-200d-1f4bc':0, '1f9d1-1f3ff-200d-1f4bc':0, '1f9d1-1f3fb-200d-1f527':0, '1f9d1-1f3fc-200d-1f527':0, '1f9d1-1f3fd-200d-1f527':0, '1f9d1-1f3fe-200d-1f527':0, '1f9d1-1f3ff-200d-1f527':0, '1f9d1-1f3fb-200d-1f52c':0, '1f9d1-1f3fc-200d-1f52c':0, '1f9d1-1f3fd-200d-1f52c':0, '1f9d1-1f3fe-200d-1f52c':0, '1f9d1-1f3ff-200d-1f52c':0, '1f9d1-1f3fb-200d-1f680':0, '1f9d1-1f3fc-200d-1f680':0, '1f9d1-1f3fd-200d-1f680':0, '1f9d1-1f3fe-200d-1f680':0, '1f9d1-1f3ff-200d-1f680':0, '1f9d1-1f3fb-200d-1f692':0, '1f9d1-1f3fc-200d-1f692':0, '1f9d1-1f3fd-200d-1f692':0, '1f9d1-1f3fe-200d-1f692':0, '1f9d1-1f3ff-200d-1f692':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3fb-200d-1f9af':0, '1f9d1-1f3fc-200d-1f9af':0, '1f9d1-1f3fd-200d-1f9af':0, '1f9d1-1f3fe-200d-1f9af':0, '1f9d1-1f3ff-200d-1f9af':0, '1f9d1-1f3fb-200d-1f9b0':0, '1f9d1-1f3fc-200d-1f9b0':0, '1f9d1-1f3fd-200d-1f9b0':0, '1f9d1-1f3fe-200d-1f9b0':0, '1f9d1-1f3ff-200d-1f9b0':0, '1f9d1-1f3fb-200d-1f9b1':0, '1f9d1-1f3fc-200d-1f9b1':0, '1f9d1-1f3fd-200d-1f9b1':0, '1f9d1-1f3fe-200d-1f9b1':0, '1f9d1-1f3ff-200d-1f9b1':0, '1f9d1-1f3fb-200d-1f9b2':0, '1f9d1-1f3fc-200d-1f9b2':0, '1f9d1-1f3fd-200d-1f9b2':0, '1f9d1-1f3fe-200d-1f9b2':0, '1f9d1-1f3ff-200d-1f9b2':0, '1f9d1-1f3fb-200d-1f9b3':0, '1f9d1-1f3fc-200d-1f9b3':0, '1f9d1-1f3fd-200d-1f9b3':0, '1f9d1-1f3fe-200d-1f9b3':0, '1f9d1-1f3ff-200d-1f9b3':0, '1f9d1-1f3fb-200d-1f9bc':0, '1f9d1-1f3fc-200d-1f9bc':0, '1f9d1-1f3fd-200d-1f9bc':0, '1f9d1-1f3fe-200d-1f9bc':0, '1f9d1-1f3ff-200d-1f9bc':0, '1f9d1-1f3fb-200d-1f9bd':0, '1f9d1-1f3fc-200d-1f9bd':0, '1f9d1-1f3fd-200d-1f9bd':0, '1f9d1-1f3fe-200d-1f9bd':0, '1f9d1-1f3ff-200d-1f9bd':0, '1f9d1-1f3fb-200d-2695':0, '1f9d1-1f3fc-200d-2695':0, '1f9d1-1f3fd-200d-2695':0, '1f9d1-1f3fe-200d-2695':0, '1f9d1-1f3ff-200d-2695':0, '1f9d1-1f3fb-200d-2696':0, '1f9d1-1f3fc-200d-2696':0, '1f9d1-1f3fd-200d-2696':0, '1f9d1-1f3fe-200d-2696':0, '1f9d1-1f3ff-200d-2696':0, '1f9d1-1f3fb-200d-2708':0, '1f9d1-1f3fc-200d-2708':0, '1f9d1-1f3fd-200d-2708':0, '1f9d1-1f3fe-200d-2708':0, '1f9d1-1f3ff-200d-2708':0, '1f9d1-1f3fb':0, '1f9d1-1f3fc':0, '1f9d1-1f3fd':0, '1f9d1-1f3fe':0, '1f9d1-1f3ff':0, '1f9d2-1f3fb':0, '1f9d2-1f3fc':0, '1f9d2-1f3fd':0, '1f9d2-1f3fe':0, '1f9d2-1f3ff':0, '1f9d3-1f3fb':0, '1f9d3-1f3fc':0, '1f9d3-1f3fd':0, '1f9d3-1f3fe':0, '1f9d3-1f3ff':0, '1f9d4-1f3fb-200d-2640':0, '1f9d4-1f3fc-200d-2640':0, '1f9d4-1f3fd-200d-2640':0, '1f9d4-1f3fe-200d-2640':0, '1f9d4-1f3ff-200d-2640':0, '1f9d4-1f3fb-200d-2642':0, '1f9d4-1f3fc-200d-2642':0, '1f9d4-1f3fd-200d-2642':0, '1f9d4-1f3fe-200d-2642':0, '1f9d4-1f3ff-200d-2642':0, '1f9d4-1f3fb':0, '1f9d4-1f3fc':0, '1f9d4-1f3fd':0, '1f9d4-1f3fe':0, '1f9d4-1f3ff':0, '1f9d5-1f3fb':0, '1f9d5-1f3fc':0, '1f9d5-1f3fd':0, '1f9d5-1f3fe':0, '1f9d5-1f3ff':0, '1f9d6-1f3fb-200d-2640':0, '1f9d6-1f3fc-200d-2640':0, '1f9d6-1f3fd-200d-2640':0, '1f9d6-1f3fe-200d-2640':0, '1f9d6-1f3ff-200d-2640':0, '1f9d6-1f3fb-200d-2642':0, '1f9d6-1f3fc-200d-2642':0, '1f9d6-1f3fd-200d-2642':0, '1f9d6-1f3fe-200d-2642':0, '1f9d6-1f3ff-200d-2642':0, '1f9d6-1f3fb':0, '1f9d6-1f3fc':0, '1f9d6-1f3fd':0, '1f9d6-1f3fe':0, '1f9d6-1f3ff':0, '1f9d7-1f3fb-200d-2640':0, '1f9d7-1f3fc-200d-2640':0, '1f9d7-1f3fd-200d-2640':0, '1f9d7-1f3fe-200d-2640':0, '1f9d7-1f3ff-200d-2640':0, '1f9d7-1f3fb-200d-2642':0, '1f9d7-1f3fc-200d-2642':0, '1f9d7-1f3fd-200d-2642':0, '1f9d7-1f3fe-200d-2642':0, '1f9d7-1f3ff-200d-2642':0, '1f9d7-1f3fb':0, '1f9d7-1f3fc':0, '1f9d7-1f3fd':0, '1f9d7-1f3fe':0, '1f9d7-1f3ff':0, '1f9d8-1f3fb-200d-2640':0, '1f9d8-1f3fc-200d-2640':0, '1f9d8-1f3fd-200d-2640':0, '1f9d8-1f3fe-200d-2640':0, '1f9d8-1f3ff-200d-2640':0, '1f9d8-1f3fb-200d-2642':0, '1f9d8-1f3fc-200d-2642':0, '1f9d8-1f3fd-200d-2642':0, '1f9d8-1f3fe-200d-2642':0, '1f9d8-1f3ff-200d-2642':0, '1f9d8-1f3fb':0, '1f9d8-1f3fc':0, '1f9d8-1f3fd':0, '1f9d8-1f3fe':0, '1f9d8-1f3ff':0, '1f9d9-1f3fb-200d-2640':0, '1f9d9-1f3fc-200d-2640':0, '1f9d9-1f3fd-200d-2640':0, '1f9d9-1f3fe-200d-2640':0, '1f9d9-1f3ff-200d-2640':0, '1f9d9-1f3fb-200d-2642':0, '1f9d9-1f3fc-200d-2642':0, '1f9d9-1f3fd-200d-2642':0, '1f9d9-1f3fe-200d-2642':0, '1f9d9-1f3ff-200d-2642':0, '1f9d9-1f3fb':0, '1f9d9-1f3fc':0, '1f9d9-1f3fd':0, '1f9d9-1f3fe':0, '1f9d9-1f3ff':0, '1f9da-1f3fb-200d-2640':0, '1f9da-1f3fc-200d-2640':0, '1f9da-1f3fd-200d-2640':0, '1f9da-1f3fe-200d-2640':0, '1f9da-1f3ff-200d-2640':0, '1f9da-1f3fb-200d-2642':0, '1f9da-1f3fc-200d-2642':0, '1f9da-1f3fd-200d-2642':0, '1f9da-1f3fe-200d-2642':0, '1f9da-1f3ff-200d-2642':0, '1f9da-1f3fb':0, '1f9da-1f3fc':0, '1f9da-1f3fd':0, '1f9da-1f3fe':0, '1f9da-1f3ff':0, '1f9db-1f3fb-200d-2640':0, '1f9db-1f3fc-200d-2640':0, '1f9db-1f3fd-200d-2640':0, '1f9db-1f3fe-200d-2640':0, '1f9db-1f3ff-200d-2640':0, '1f9db-1f3fb-200d-2642':0, '1f9db-1f3fc-200d-2642':0, '1f9db-1f3fd-200d-2642':0, '1f9db-1f3fe-200d-2642':0, '1f9db-1f3ff-200d-2642':0, '1f9db-1f3fb':0, '1f9db-1f3fc':0, '1f9db-1f3fd':0, '1f9db-1f3fe':0, '1f9db-1f3ff':0, '1f9dc-1f3fb-200d-2640':0, '1f9dc-1f3fc-200d-2640':0, '1f9dc-1f3fd-200d-2640':0, '1f9dc-1f3fe-200d-2640':0, '1f9dc-1f3ff-200d-2640':0, '1f9dc-1f3fb-200d-2642':0, '1f9dc-1f3fc-200d-2642':0, '1f9dc-1f3fd-200d-2642':0, '1f9dc-1f3fe-200d-2642':0, '1f9dc-1f3ff-200d-2642':0, '1f9dc-1f3fb':0, '1f9dc-1f3fc':0, '1f9dc-1f3fd':0, '1f9dc-1f3fe':0, '1f9dc-1f3ff':0, '1f9dd-1f3fb-200d-2640':0, '1f9dd-1f3fc-200d-2640':0, '1f9dd-1f3fd-200d-2640':0, '1f9dd-1f3fe-200d-2640':0, '1f9dd-1f3ff-200d-2640':0, '1f9dd-1f3fb-200d-2642':0, '1f9dd-1f3fc-200d-2642':0, '1f9dd-1f3fd-200d-2642':0, '1f9dd-1f3fe-200d-2642':0, '1f9dd-1f3ff-200d-2642':0, '1f9dd-1f3fb':0, '1f9dd-1f3fc':0, '1f9dd-1f3fd':0, '1f9dd-1f3fe':0, '1f9dd-1f3ff':0, '261d-1f3fb':0, '261d-1f3fc':0, '261d-1f3fd':0, '261d-1f3fe':0, '261d-1f3ff':0, '26f9-1f3fb-200d-2640':0, '26f9-1f3fc-200d-2640':0, '26f9-1f3fd-200d-2640':0, '26f9-1f3fe-200d-2640':0, '26f9-1f3ff-200d-2640':0, '26f9-1f3fb-200d-2642':0, '26f9-1f3fc-200d-2642':0, '26f9-1f3fd-200d-2642':0, '26f9-1f3fe-200d-2642':0, '26f9-1f3ff-200d-2642':0, '26f9-1f3fb':0, '26f9-1f3fc':0, '26f9-1f3fd':0, '26f9-1f3fe':0, '26f9-1f3ff':0, '270a-1f3fb':0, '270a-1f3fc':0, '270a-1f3fd':0, '270a-1f3fe':0, '270a-1f3ff':0, '270b-1f3fb':0, '270b-1f3fc':0, '270b-1f3fd':0, '270b-1f3fe':0, '270b-1f3ff':0, '270c-1f3fb':0, '270c-1f3fc':0, '270c-1f3fd':0, '270c-1f3fe':0, '270c-1f3ff':0, '270d-1f3fb':0, '270d-1f3fc':0, '270d-1f3fd':0, '270d-1f3fe':0, '270d-1f3ff':0}};\n\nconst Emoji: {[emoji: string]: number} = EmojiVersions[''];\nfor(const version in EmojiVersions) {\n if(version) {\n Object.assign(Emoji, EmojiVersions[version as EMOJI_VERSION]);\n }\n}\n\nexport default Emoji;\n\n/* Emoji[\"00a9-fe0f\"] = 6362;\nEmoji[\"00ae-fe0f\"] = 6363;\nEmoji[\"2122-fe0f\"] = 6364; */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport const FontFamily = 'Roboto, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif';\nexport const FontSize = '16px';\nexport const FontWeight = '400';\n","const IS_IMAGE_BITMAP_SUPPORTED = typeof(ImageBitmap) !== 'undefined';\n\nexport default IS_IMAGE_BITMAP_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// * Jolly Cobra's animation.ts\n\nimport {fastRaf} from './schedulers';\nimport deferredPromise, {CancellablePromise} from './cancellablePromise';\n\ninterface AnimationInstance {\n isCancelled: boolean;\n deferred: CancellablePromise\n}\n\ntype AnimationInstanceKey = any;\nconst instances: Map = new Map();\n\nexport function createAnimationInstance(key: AnimationInstanceKey) {\n cancelAnimationByKey(key);\n\n const instance: AnimationInstance = {\n isCancelled: false,\n deferred: deferredPromise()\n };\n\n instances.set(key, instance);\n instance.deferred.then(() => {\n if(getAnimationInstance(key) === instance) {\n instances.delete(key);\n }\n });\n\n return instance;\n}\n\nexport function getAnimationInstance(key: AnimationInstanceKey) {\n return instances.get(key);\n}\n\nexport function cancelAnimationByKey(key: AnimationInstanceKey) {\n const instance = getAnimationInstance(key);\n if(instance) {\n instance.isCancelled = true;\n instance.deferred.resolve();\n }\n}\n\nexport function animateSingle(tick: Function, key: AnimationInstanceKey, instance?: AnimationInstance) {\n if(!instance) {\n instance = createAnimationInstance(key);\n }\n\n fastRaf(() => {\n if(instance.isCancelled) {\n return;\n }\n\n if(tick()) {\n animateSingle(tick, key, instance);\n } else {\n instance.deferred.resolve();\n }\n });\n\n return instance.deferred;\n}\n\nexport function animate(tick: Function) {\n fastRaf(() => {\n if(tick()) {\n animate(tick);\n }\n });\n}\n","export default function accumulate(arr: number[], initialValue: number) {\n return arr.reduce((acc, value) => acc + value, initialValue);\n}\n","type K = boolean;\nexport default async function filterAsync(arr: T[], callback: (item: T, idx: number, arr: T[]) => Promise | K) {\n const promises = arr.map(async(item, idx, arr) => {\n if(await callback(item, idx, arr)) {\n return item;\n }\n });\n\n return (await Promise.all(promises)).filter(Boolean);\n}\n","export default function findAndSpliceAll(array: Array, verify: (value: T, index: number, arr: typeof array) => boolean) {\n const out: typeof array = [];\n let idx = -1;\n while((idx = array.findIndex(verify)) !== -1) {\n out.push(array.splice(idx, 1)[0]);\n }\n\n return out;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function partition(arr: T[], callback: (item: T, idx: number, arr: T[]) => boolean) {\n const good: T[] = [], bad: T[] = [];\n for(let i = 0, length = arr.length; i < length; ++i) {\n const item = arr[i];\n (callback(item, i, arr) ? good : bad).push(item);\n }\n\n return [good, bad];\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nconst ASSETS_PATH = 'assets/audio/';\n\nexport default class AudioAssetPlayer {\n private audio: HTMLAudioElement;\n private tempId: number;\n private assetName: AssetName;\n\n constructor(private assets: AssetName[]) {\n this.tempId = 0;\n }\n\n public playSound(name: AssetName, loop = false) {\n ++this.tempId;\n this.assetName = name;\n\n try {\n const audio = this.createAudio();\n audio.autoplay = true;\n audio.src = ASSETS_PATH + name;\n audio.loop = loop;\n audio.play();\n } catch(e) {\n console.error('playSound', name, e);\n }\n }\n\n public playSoundIfDifferent(name: AssetName, loop?: boolean) {\n if(this.assetName !== name) {\n this.playSound(name, loop);\n }\n }\n\n public createAudio() {\n let {audio} = this;\n if(audio) {\n return audio;\n }\n\n audio = this.audio = new Audio();\n audio.play();\n return audio;\n }\n\n public stopSound() {\n if(!this.audio) {\n return;\n }\n\n this.audio.pause();\n }\n\n public cancelDelayedPlay() {\n ++this.tempId;\n }\n\n public playSoundWithTimeout(name: AssetName, loop: boolean, timeout: number) {\n // timeout = 0;\n const tempId = ++this.tempId;\n setTimeout(() => {\n if(this.tempId !== tempId) {\n return;\n }\n\n this.playSound(name, loop);\n }, timeout);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport readBlobAs from './readBlobAs';\n\nexport default function readBlobAsDataURL(blob: Blob) {\n return readBlobAs(blob, 'readAsDataURL');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport deferredPromise, {CancellablePromise} from './cancellablePromise';\nimport {getHeavyAnimationPromise} from '../hooks/useHeavyAnimationCheck';\nimport {fastRaf} from './schedulers';\nimport {ArgumentTypes} from '../types';\n\ntype HeavyQueue> = {\n items: ArgumentTypes[],\n process: (...args: any[]) => ReturnType,\n context: any,\n promise?: CancellablePromise[]>\n};\nconst heavyQueue: HeavyQueue[] = [];\nlet processingQueue = false;\n\nexport default function addHeavyTask>(queue: T, method: 'push' | 'unshift' = 'push') {\n if(!queue.items.length) {\n return Promise.resolve([]) as typeof promise;\n }\n\n const promise = queue.promise = deferredPromise();\n heavyQueue[method](queue);\n processHeavyQueue();\n\n return promise;\n}\n\nfunction processHeavyQueue() {\n if(!processingQueue) {\n const queue = heavyQueue.shift();\n timedChunk(queue).finally(() => {\n processingQueue = false;\n if(heavyQueue.length) {\n processHeavyQueue();\n }\n });\n }\n}\n\nfunction timedChunk>(queue: HeavyQueue) {\n if(!queue.items.length) {\n queue.promise.resolve([] as any);\n return Promise.resolve([]);\n }\n\n const todo = queue.items.slice();\n const results: ReturnType[] = [];\n\n return new Promise((resolve, reject) => {\n const f = async() => {\n const start = performance.now();\n\n do {\n await getHeavyAnimationPromise();\n const possiblePromise = queue.process.apply(queue.context, todo.shift());\n let realResult: typeof results[0];\n // @ts-ignore\n if(possiblePromise instanceof Promise) {\n try {\n realResult = await possiblePromise;\n } catch(err) {\n reject(err);\n return;\n }\n } else {\n realResult = possiblePromise;\n }\n\n results.push(realResult);\n } while(todo.length > 0 && (performance.now() - start) < 6);\n\n if(todo.length > 0) {\n fastRaf(f);\n // setTimeout(f, 25);\n } else {\n resolve(results);\n }\n };\n\n fastRaf(f);\n // setTimeout(f, 25);\n }).then(queue.promise.resolve, queue.promise.reject);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type fastBlur from '../vendor/fastBlur';\nimport addHeavyTask from './heavyQueue';\nimport IS_CANVAS_FILTER_SUPPORTED from '../environment/canvasFilterSupport';\n\nconst RADIUS = 2;\nconst ITERATIONS = 2;\n\nlet requireBlurPromise: Promise;\nlet fastBlurFunc: typeof fastBlur;\nif(!IS_CANVAS_FILTER_SUPPORTED) {\n requireBlurPromise = import('../vendor/fastBlur').then((m) => {\n fastBlurFunc = m.default;\n });\n} else {\n requireBlurPromise = Promise.resolve();\n}\n\nfunction processBlurNext(\n img: HTMLImageElement,\n radius: number,\n iterations: number,\n canvas: HTMLCanvasElement = document.createElement('canvas')\n) {\n canvas.width = img.width;\n canvas.height = img.height;\n\n const ctx = canvas.getContext('2d', {alpha: false});\n if(IS_CANVAS_FILTER_SUPPORTED) {\n ctx.filter = `blur(${radius}px)`;\n ctx.drawImage(img, -radius * 2, -radius * 2, canvas.width + radius * 4, canvas.height + radius * 4);\n } else {\n ctx.drawImage(img, 0, 0);\n fastBlurFunc(ctx, 0, 0, canvas.width, canvas.height, radius, iterations);\n }\n\n return canvas;\n}\n\ntype CacheValue = {canvas: HTMLCanvasElement, promise: Promise};\nconst cache: Map = new Map();\nconst CACHE_SIZE = 150;\n\nexport default function blur(dataUri: string, radius: number = RADIUS, iterations: number = ITERATIONS) {\n if(!dataUri) {\n throw 'no dataUri for blur: ' + dataUri;\n }\n\n if(cache.size > CACHE_SIZE) {\n cache.clear();\n }\n\n const canvas = document.createElement('canvas');\n canvas.className = 'canvas-thumbnail';\n\n let cached = cache.get(dataUri);\n if(!cached) {\n const promise: CacheValue['promise'] = new Promise((resolve) => {\n // return resolve(dataUri);\n requireBlurPromise.then(() => {\n const img = new Image();\n img.onload = () => {\n // if(IS_CANVAS_FILTER_SUPPORTED) {\n // resolve(processBlurNext(img, radius, iterations));\n // } else {\n const promise = addHeavyTask({\n items: [[img, radius, iterations, canvas]],\n context: null,\n process: processBlurNext\n }, 'unshift');\n\n promise.then(() => {\n resolve();\n });\n // }\n };\n img.src = dataUri;\n });\n });\n\n cache.set(dataUri, cached = {\n canvas,\n promise\n });\n } else {\n canvas.width = cached.canvas.width;\n canvas.height = cached.canvas.height;\n cached.promise.then(() => {\n canvas.getContext('2d').drawImage(cached.canvas, 0, 0, canvas.width, canvas.height);\n });\n }\n\n return {\n ...cached,\n canvas\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {IS_SAFARI} from '../../environment/userAgent';\nimport bytesFromHex from './bytesFromHex';\nimport bytesToDataURL from './bytesToDataURL';\nimport convertToUint8Array from './convertToUint8Array';\n\nconst JPEG_HEADER_HEX = 'ffd8ffe000104a46494600010100000100010000ffdb004300281c1e231e19282321232d2b28303c64413c37373c7b585d4964918099968f808c8aa0b4e6c3a0aadaad8a8cc8ffcbdaeef5ffffff9bc1fffffffaffe6fdfff8ffdb0043012b2d2d3c353c76414176f8a58ca5f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8ffc00011080000000003012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00';\n\nconst JPEG_HEADER = bytesFromHex(JPEG_HEADER_HEX);\nconst JPEG_TAIL = bytesFromHex('ffd9');\n\nexport function getPreviewBytesFromURL(url: string) {\n const needle = 'base64,';\n const sliced = url.slice(url.indexOf(needle) + needle.length);\n const jpegBytes = [...atob(sliced)].map((char) => char.charCodeAt(0));\n\n return new Uint8Array(jpegBytes);\n // console.log('getPreviewBytesFromURL', bytesToHex(jpegBytes));\n\n // const n = JPEG_HEADER_HEX.slice(-10);\n // const one = jpegBytes[164];\n // const two = jpegBytes[166];\n\n // const body = jpegBytes.slice(bytesToHex(jpegBytes).indexOf(n) / 2 + n.length / 2/* JPEG_HEADER.length */, jpegBytes.length - JPEG_TAIL.length);\n // const original = new Uint8Array([\n // 0xFF,\n // one,\n // two,\n // ...body\n // ]);\n\n // console.log(bytesToHex(body));\n\n // return original;\n}\n\nexport default function getPreviewURLFromBytes(bytes: Uint8Array | number[], isSticker = false) {\n let arr: Uint8Array;\n if(!isSticker && bytes[0] === 0x1) {\n arr = new Uint8Array(JPEG_HEADER.concat(Array.from(bytes.slice(3)), JPEG_TAIL));\n arr[164] = bytes[1];\n arr[166] = bytes[2];\n } else {\n arr = convertToUint8Array(bytes);\n }\n\n let mimeType: string;\n if(isSticker) {\n mimeType = IS_SAFARI ? 'image/png' : 'image/webp';\n } else {\n mimeType = 'image/jpeg';\n }\n\n const dataURL = bytesToDataURL(arr, mimeType);\n return dataURL;\n}\n","export default function bytesToDataURL(bytes: Uint8Array, mimeType: string = 'image/jpeg') {\n return `data:${mimeType};base64,${btoa(String.fromCharCode(...bytes))}`;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport {makeMediaSize} from './mediaSize';\n\nexport default function calcImageInBox(imageW: number, imageH: number, boxW: number, boxH: number, noZoom = true) {\n if(imageW < boxW && imageH < boxH && noZoom) {\n return makeMediaSize(imageW, imageH);\n }\n\n let boxedImageW = boxW;\n let boxedImageH = boxH;\n\n if((imageW / imageH) > (boxW / boxH)) {\n boxedImageH = (imageH * boxW / imageW) | 0;\n } else {\n boxedImageW = (imageW * boxH / imageH) | 0;\n if(boxedImageW > boxW) {\n boxedImageH = (boxedImageH * boxW / boxedImageW) | 0;\n boxedImageW = boxW;\n }\n }\n\n // if (Config.Navigator.retina) {\n // imageW = Math.floor(imageW / 2)\n // imageH = Math.floor(imageH / 2)\n // }\n\n if(noZoom && boxedImageW >= imageW && boxedImageH >= imageH) {\n boxedImageW = imageW;\n boxedImageH = imageH;\n }\n\n return makeMediaSize(boxedImageW, boxedImageH);\n}\n\nMOUNT_CLASS_TO.calcImageInBox = calcImageInBox;\n","export default function drawCircle(ctx: CanvasRenderingContext2D, x: number, y: number, radius: number, fill?: boolean, stroke?: boolean) {\n const dpr = ctx.canvas.dpr;\n if(dpr) {\n x *= dpr;\n y *= dpr;\n radius *= dpr;\n }\n\n ctx.beginPath();\n ctx.arc(x, y, radius, 0, 2 * Math.PI, false);\n ctx.closePath();\n\n if(fill) {\n ctx.fill();\n }\n\n if(stroke) {\n ctx.stroke();\n }\n}\n\nexport function drawCircleFromStart(ctx: CanvasRenderingContext2D, x: number, y: number, radius: number, fill?: boolean, stroke?: boolean) {\n return drawCircle(ctx, x + radius, y + radius, radius, fill, stroke);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import { MOUNT_CLASS_TO } from \"../../config/debug\";\n\nlet context: CanvasRenderingContext2D;\n/**\n * Get the text width\n * @param {string} text\n * @param {string} font\n */\nexport default function getTextWidth(text: string, font: string) {\n // const perf = performance.now();\n if(!context) {\n const canvas = document.createElement('canvas');\n context = canvas.getContext('2d', {alpha: false});\n }\n\n if(context.font !== font) {\n context.font = font;\n }\n\n // context.font = font;\n const metrics = context.measureText(text);\n // console.log('getTextWidth perf:', performance.now() - perf);\n return metrics.width;\n // return Math.round(metrics.width);\n}\n\n// MOUNT_CLASS_TO && (MOUNT_CLASS_TO.getTextWidth = getTextWidth);\n","import type {MediaSize} from '../mediaSize';\nimport IS_IMAGE_BITMAP_SUPPORTED from '../../environment/imageBitmapSupport';\n\nexport default function scaleMediaElement(options: T): Promise {\n return new Promise(async(resolve) => {\n const canvas = document.createElement('canvas');\n const size = options.size ?? options.mediaSize.aspectFitted(options.boxSize);\n const dpr = window.devicePixelRatio && 1;\n canvas.width = size.width * dpr;\n canvas.height = size.height * dpr;\n const ctx = canvas.getContext('2d');\n\n let source: CanvasImageSource;\n if(IS_IMAGE_BITMAP_SUPPORTED) {\n source = await createImageBitmap(options.media, {resizeWidth: size.width, resizeHeight: size.height});\n } else {\n source = options.media;\n }\n\n ctx.drawImage(source, 0, 0, canvas.width, canvas.height);\n\n if(IS_IMAGE_BITMAP_SUPPORTED) {\n (source as ImageBitmap)?.close();\n }\n\n const mimeType = options.mimeType ?? 'image/jpeg';\n const quality = options.quality ?? 1;\n if(options.toDataURL) {\n const url = canvas.toDataURL(mimeType, quality);\n resolve({url, size} as any);\n } else {\n canvas.toBlob((blob) => {\n resolve({blob, size} as any);\n }, mimeType, quality);\n }\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport LatinizeMap from '../config/latinizeMap';\n\nexport const badCharsRe = /[`~!@#$%^&*()\\-_=+\\[\\]\\\\|{}'\";:\\/?.>,<]+/g;\nconst trimRe = /^\\s+|\\s$/g;\n\nconst C2L: {[k: string]: string} = {\n 'й': 'q',\n 'ц': 'w',\n 'у': 'e',\n 'к': 'r',\n 'е': 't',\n 'н': 'y',\n 'г': 'u',\n 'ш': 'i',\n 'щ': 'o',\n 'з': 'p',\n 'х': '[',\n 'ъ': ']',\n 'ф': 'a',\n 'ы': 's',\n 'в': 'd',\n 'а': 'f',\n 'п': 'g',\n 'р': 'h',\n 'о': 'j',\n 'л': 'k',\n 'д': 'l',\n 'ж': ';',\n 'э': '\\'',\n 'я': 'z',\n 'ч': 'x',\n 'с': 'c',\n 'м': 'v',\n 'и': 'b',\n 'т': 'n',\n 'ь': 'm',\n 'б': ',',\n 'ю': '.',\n '.': '/'\n};\n\nexport function clearBadCharsAndTrim(text: string) {\n return text.replace(badCharsRe, '').replace(trimRe, '');\n}\n\nexport function fixCyrillic(text: string) {\n return text.toLowerCase().replace(/[\\wа-я]/g, (ch) => {\n const latinizeCh = C2L[ch];\n return latinizeCh ?? ch;\n });\n}\n\nexport function latinizeString(text: string) {\n return text.replace(/[^A-Za-z0-9]/g, (ch) => {\n const latinizeCh = LatinizeMap[ch];\n return latinizeCh ?? ch;\n });\n}\n\nexport default function cleanSearchText(text: string, latinize = true) {\n return processSearchText(text, {\n clearBadChars: true,\n latinize,\n ignoreCase: true\n });\n}\n\nexport type ProcessSearchTextOptions = Partial<{\n clearBadChars: boolean,\n latinize: boolean,\n ignoreCase: boolean,\n includeTag: boolean\n}>;\n\nexport function processSearchText(text: string, options: ProcessSearchTextOptions = {}) {\n const hasTag = options.includeTag && text.charAt(0) === '%';\n const originalText = text;\n if(options.clearBadChars) text = clearBadCharsAndTrim(text);\n if(options.latinize) text = latinizeString(text);\n if(options.ignoreCase) text = text.toLowerCase();\n if(hasTag) text = '%' + text;\n if(options.latinize) text += '\\x01' + fixCyrillic(originalText);\n return text;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// https://stackoverflow.com/a/30810322\nfunction fallbackCopyTextToClipboard(text: string) {\n var textArea = document.createElement('textarea');\n textArea.value = text;\n\n // Avoid scrolling to bottom\n textArea.style.top = '0';\n textArea.style.left = '0';\n textArea.style.position = 'fixed';\n\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n\n try {\n document.execCommand('copy');\n // const successful = document.execCommand('copy');\n // const msg = successful ? 'successful' : 'unsuccessful';\n // console.log('Fallback: Copying text command was ' + msg);\n } catch(err) {\n // console.error('Fallback: Oops, unable to copy', err);\n }\n\n document.body.removeChild(textArea);\n}\n\nexport function copyTextToClipboard(text: string) {\n if(!navigator.clipboard) {\n fallbackCopyTextToClipboard(text);\n return;\n }\n\n navigator.clipboard.writeText(text).catch((err) => {\n console.error('clipboard error', err);\n fallbackCopyTextToClipboard(text);\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport mediaSizes from './mediaSizes';\nimport OverlayClickHandler from './overlayClickHandler';\n\nclass ContextMenuController extends OverlayClickHandler {\n constructor() {\n super('menu', true);\n\n mediaSizes.addEventListener('resize', () => {\n if(this.element) {\n this.close();\n }\n\n /* if(openedMenu && (openedMenu.style.top || openedMenu.style.left)) {\n const rect = openedMenu.getBoundingClientRect();\n const {innerWidth, innerHeight} = window;\n\n console.log(innerWidth, innerHeight, rect);\n } */\n });\n }\n\n public isOpened() {\n return !!this.element;\n }\n\n private onMouseMove = (e: MouseEvent) => {\n const rect = this.element.getBoundingClientRect();\n const {clientX, clientY} = e;\n\n const diffX = clientX >= rect.right ? clientX - rect.right : rect.left - clientX;\n const diffY = clientY >= rect.bottom ? clientY - rect.bottom : rect.top - clientY;\n\n if(diffX >= 100 || diffY >= 100) {\n this.close();\n // openedMenu.parentElement.click();\n }\n // console.log('mousemove', diffX, diffY);\n };\n\n public close() {\n if(this.element) {\n this.element.classList.remove('active');\n this.element.parentElement.classList.remove('menu-open');\n }\n\n super.close();\n\n if(!IS_TOUCH_SUPPORTED) {\n window.removeEventListener('mousemove', this.onMouseMove);\n }\n }\n\n public openBtnMenu(element: HTMLElement, onClose?: () => void) {\n super.open(element);\n\n this.element.classList.add('active', 'was-open');\n this.element.parentElement.classList.add('menu-open');\n\n if(onClose) {\n this.addEventListener('toggle', onClose, {once: true});\n }\n\n if(!IS_TOUCH_SUPPORTED) {\n window.addEventListener('mousemove', this.onMouseMove);\n }\n }\n}\n\nconst contextMenuController = new ContextMenuController();\nexport default contextMenuController;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport I18n, {i18n} from '../lib/langPack';\n\nexport const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\nexport const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n\nexport const ONE_DAY = 86400;\n\n// https://stackoverflow.com/a/6117889\nexport const getWeekNumber = (date: Date) => {\n const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));\n const dayNum = d.getUTCDay() || 7;\n d.setUTCDate(d.getUTCDate() + 4 - dayNum);\n const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));\n return Math.ceil((((d.getTime() - yearStart.getTime()) / ONE_DAY) + 1) / 7);\n};\n\nexport function formatDateAccordingToTodayNew(time: Date) {\n const today = new Date();\n const now = today.getTime() / 1000 | 0;\n const timestamp = time.getTime() / 1000 | 0;\n\n const options: Intl.DateTimeFormatOptions = {};\n if((now - timestamp) < ONE_DAY && today.getDate() === time.getDate()) { // if the same day\n options.hour = options.minute = '2-digit';\n } else if(today.getFullYear() !== time.getFullYear()) { // different year\n options.year = options.day = 'numeric';\n options.month = '2-digit';\n } else if((now - timestamp) < (ONE_DAY * 7) && getWeekNumber(today) === getWeekNumber(time)) { // current week\n options.weekday = 'short';\n } else { // same year\n options.month = 'short';\n options.day = 'numeric';\n }\n\n return new I18n.IntlDateElement({\n date: time,\n options\n }).element;\n}\n\nexport function formatFullSentTimeRaw(timestamp: number, options: {\n capitalize?: boolean\n} = {}) {\n const date = new Date();\n const time = new Date(timestamp * 1000);\n const now = date.getTime() / 1000;\n\n const timeEl = formatTime(time);\n\n let dateEl: Node | string;\n if((now - timestamp) < ONE_DAY && date.getDate() === time.getDate()) { // if the same day\n dateEl = i18n(options.capitalize ? 'Date.Today' : 'Peer.Status.Today');\n } else if((now - timestamp) < (ONE_DAY * 2) && (date.getDate() - 1) === time.getDate()) { // yesterday\n dateEl = i18n(options.capitalize ? 'Yesterday' : 'Peer.Status.Yesterday');\n\n if(options.capitalize) {\n (dateEl as HTMLElement).style.textTransform = 'capitalize';\n }\n } else if(date.getFullYear() !== time.getFullYear()) { // different year\n dateEl = new I18n.IntlDateElement({\n date: time,\n options: {\n month: 'short',\n day: 'numeric',\n year: 'numeric'\n }\n }).element;\n // dateStr = months[time.getMonth()].slice(0, 3) + ' ' + time.getDate() + ', ' + time.getFullYear();\n } else {\n dateEl = new I18n.IntlDateElement({\n date: time,\n options: {\n month: 'short',\n day: 'numeric'\n }\n }).element;\n // dateStr = months[time.getMonth()].slice(0, 3) + ' ' + time.getDate();\n }\n\n return {dateEl, timeEl};\n}\n\nexport function formatFullSentTime(timestamp: number) {\n const {dateEl, timeEl} = formatFullSentTimeRaw(timestamp, {\n capitalize: true\n });\n\n const fragment = document.createDocumentFragment();\n fragment.append(dateEl, ' ', i18n('ScheduleController.at'), ' ', timeEl);\n return fragment;\n}\n\nexport function formatTime(date: Date) {\n return new I18n.IntlDateElement({\n date,\n options: {\n hour: '2-digit',\n minute: '2-digit'\n }\n }).element;\n}\n\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.formatDateAccordingToTodayNew = formatDateAccordingToTodayNew);\n\nexport const getFullDate = (date: Date, options: Partial<{\n noTime: true,\n noSeconds: true,\n monthAsNumber: true,\n leadingZero: true\n}> = {}) => {\n const joiner = options.monthAsNumber ? '.' : ' ';\n const time = ('0' + date.getHours()).slice(-2) + ':' + ('0' + date.getMinutes()).slice(-2) + (options.noSeconds ? '' : ':' + ('0' + date.getSeconds()).slice(-2));\n\n return (options.leadingZero ? ('0' + date.getDate()).slice(-2) : date.getDate()) +\n joiner + (options.monthAsNumber ? ('0' + (date.getMonth() + 1)).slice(-2) : months[date.getMonth()]) +\n joiner + date.getFullYear() +\n (options.noTime ? '' : ', ' + time);\n};\n\n// https://github.com/DrKLO/Telegram/blob/d52b2c921abd3c1e8d6368858313ad0cb0468c07/TMessagesProj/src/main/java/org/telegram/ui/Adapters/FiltersView.java\nconst minYear = 2013;\nconst yearPattern = new RegExp('20[0-9]{1,2}');\nconst monthYearOrDayPattern = new RegExp('(\\\\w{3,}) ([0-9]{0,4})', 'i');\nconst yearOrDayAndMonthPattern = new RegExp('([0-9]{0,4}) (\\\\w{2,})', 'i');\nconst shortDate = new RegExp('^([0-9]{1,4})(\\\\.| |/|\\\\-)([0-9]{1,4})$', 'i');\nconst longDate = new RegExp('^([0-9]{1,2})(\\\\.| |/|\\\\-)([0-9]{1,2})(\\\\.| |/|\\\\-)([0-9]{1,4})$', 'i');\nconst numberOfDaysEachMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nexport type DateData = {\n title: string,\n minDate: number,\n maxDate: number,\n};\nexport function fillTipDates(query: string, dates: DateData[]) {\n const q = query.trim().toLowerCase();\n\n if(q.length < 3) {\n return;\n }\n\n if('today'.indexOf(q) === 0) {\n const date = new Date();\n const year = date.getFullYear();\n const month = date.getMonth();\n const day = date.getDate();\n date.setFullYear(year, month, day);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: 'Today',\n minDate,\n maxDate\n });\n return;\n }\n\n if('yesterday'.indexOf(q) === 0) {\n const date = new Date();\n const year = date.getFullYear();\n const month = date.getMonth();\n const day = date.getDate();\n date.setFullYear(year, month, day);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime() - 86400000;\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 86400001;\n dates.push({\n title: 'Yesterday',\n minDate,\n maxDate\n });\n return;\n }\n\n const dayOfWeek = getDayOfWeek(q);\n if(dayOfWeek >= 0) {\n const date = new Date();\n const now = date.getTime();\n const currentDay = date.getDay();\n const distance = dayOfWeek - currentDay;\n date.setDate(date.getDate() + distance);\n if(date.getTime() > now) {\n date.setTime(date.getTime() - 604800000);\n }\n const year = date.getFullYear()\n const month = date.getMonth();\n const day = date.getDate();\n date.setFullYear(year, month, day);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: formatWeekLong(minDate),\n minDate,\n maxDate\n });\n return;\n }\n\n let matches: any[];\n if((matches = shortDate.exec(q)) !== null) {\n const g1 = matches[1];\n const g2 = matches[3];\n const k = parseInt(g1);\n const k1 = parseInt(g2);\n if(k > 0 && k <= 31) {\n if(k1 >= minYear && k <= 12) {\n const selectedYear = k1;\n const month = k - 1;\n createForMonthYear(dates, month, selectedYear);\n return;\n } else if(k1 <= 12) {\n const day = k - 1;\n const month = k1 - 1;\n createForDayMonth(dates, day, month);\n }\n } else if(k >= minYear && k1 <= 12) {\n const selectedYear = k;\n const month = k1 - 1;\n createForMonthYear(dates, month, selectedYear);\n }\n\n return;\n }\n\n if((matches = longDate.exec(q)) !== null) {\n const g1 = matches[1];\n const g2 = matches[3];\n const g3 = matches[5];\n if(!matches[2] === matches[4]) {\n return;\n }\n\n const day = parseInt(g1);\n const month = parseInt(g2) - 1;\n let year = parseInt(g3);\n if(year >= 10 && year <= 99) {\n year += 2000;\n }\n\n const currentYear = new Date().getFullYear();\n if(validDateForMonth(day - 1, month) && year >= minYear && year <= currentYear) {\n const date = new Date();\n date.setFullYear(year, month, day);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: formatterYearMax(minDate),\n minDate,\n maxDate\n });\n return;\n }\n\n return;\n }\n\n if((matches = yearPattern.exec(q)) !== null) {\n let selectedYear = +q;\n const currentYear = new Date().getFullYear();\n if(selectedYear < minYear) {\n selectedYear = minYear;\n for(let i = currentYear; i >= selectedYear; i--) {\n const date = new Date();\n date.setFullYear(i, 0, 1);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(i + 1, 0, 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: '' + i,\n minDate,\n maxDate\n });\n }\n } else if(selectedYear <= currentYear) {\n const date = new Date();\n date.setFullYear(selectedYear, 0, 1);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(selectedYear + 1, 0, 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: '' + selectedYear,\n minDate,\n maxDate\n });\n }\n\n return;\n }\n\n if((matches = monthYearOrDayPattern.exec(q)) !== null) {\n const g1 = matches[1];\n const g2 = matches[2];\n const month = getMonth(g1);\n if(month >= 0) {\n const k = +g2;\n if(k > 0 && k <= 31) {\n const day = k - 1;\n createForDayMonth(dates, day, month);\n return;\n } else if(k >= minYear) {\n const selectedYear = k;\n createForMonthYear(dates, month, selectedYear);\n return;\n }\n }\n }\n\n if((matches = yearOrDayAndMonthPattern.exec(q)) !== null) {\n const g1 = matches[1];\n const g2 = matches[2];\n const month = getMonth(g2);\n if(month >= 0) {\n const k = +g1;\n if(k > 0 && k <= 31) {\n const day = k - 1;\n createForDayMonth(dates, day, month);\n return;\n } else if(k >= minYear) {\n const selectedYear = k;\n createForMonthYear(dates, month, selectedYear);\n }\n }\n }\n}\n\nfunction createForMonthYear(dates: DateData[], month: number, selectedYear: number) {\n const currentYear = new Date().getFullYear();\n const today = Date.now();\n if(selectedYear >= minYear && selectedYear <= currentYear) {\n const date = new Date();\n date.setFullYear(selectedYear, month, 1);\n date.setHours(0, 0, 0);\n const minDate = date.getTime();\n if(minDate > today) {\n return;\n }\n date.setMonth(date.getMonth() + 1);\n const maxDate = date.getTime() - 1;\n\n dates.push({\n title: formatterMonthYear(minDate),\n minDate,\n maxDate\n });\n }\n}\n\nfunction createForDayMonth(dates: DateData[], day: number, month: number) {\n if(validDateForMonth(day, month)) {\n const currentYear = new Date().getFullYear();\n const today = Date.now();\n\n for(let i = currentYear; i >= minYear; i--) {\n if(month === 1 && day === 28 && !isLeapYear(i)) {\n continue;\n }\n\n const date = new Date();\n date.setFullYear(i, month, day + 1);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n if(minDate > today) {\n continue;\n }\n\n date.setFullYear(i, month, day + 2);\n date.setHours(0, 0, 0);\n const maxDate = date.getTime() - 1;\n if(i === currentYear) {\n dates.push({\n title: formatterDayMonth(minDate),\n minDate,\n maxDate\n });\n } else {\n dates.push({\n title: formatterYearMax(minDate),\n minDate,\n maxDate\n });\n }\n }\n }\n}\n\nfunction formatterMonthYear(timestamp: number) {\n const date = new Date(timestamp);\n return months[date.getMonth()].slice(0, 3) + ' ' + date.getFullYear();\n}\n\nfunction formatterDayMonth(timestamp: number) {\n const date = new Date(timestamp);\n return months[date.getMonth()].slice(0, 3) + ' ' + date.getDate();\n}\n\nfunction formatterYearMax(timestamp: number) {\n const date = new Date(timestamp);\n return ('0' + date.getDate()).slice(-2) + '.' + ('0' + (date.getMonth() + 1)).slice(-2) + '.' + date.getFullYear();\n}\n\nfunction formatWeekLong(timestamp: number) {\n const date = new Date(timestamp);\n return days[date.getDay()];\n}\n\nfunction validDateForMonth(day: number, month: number) {\n if(month >= 0 && month < 12) {\n if(day >= 0 && day < numberOfDaysEachMonth[month]) {\n return true;\n }\n }\n return false;\n}\n\nfunction isLeapYear(year: number) {\n return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0);\n}\n\nfunction getMonth(q: string) {\n /* String[] months = new String[]{\n LocaleController.getString(\"January\", R.string.January).toLowerCase(),\n LocaleController.getString(\"February\", R.string.February).toLowerCase(),\n LocaleController.getString(\"March\", R.string.March).toLowerCase(),\n LocaleController.getString(\"April\", R.string.April).toLowerCase(),\n LocaleController.getString(\"May\", R.string.May).toLowerCase(),\n LocaleController.getString(\"June\", R.string.June).toLowerCase(),\n LocaleController.getString(\"July\", R.string.July).toLowerCase(),\n LocaleController.getString(\"August\", R.string.August).toLowerCase(),\n LocaleController.getString(\"September\", R.string.September).toLowerCase(),\n LocaleController.getString(\"October\", R.string.October).toLowerCase(),\n LocaleController.getString(\"November\", R.string.November).toLowerCase(),\n LocaleController.getString(\"December\", R.string.December).toLowerCase()\n }; */\n\n /* String[] monthsEng = new String[12];\n Calendar c = Calendar.getInstance();\n for (int i = 1; i <= 12; i++) {\n c.set(0, 0, 0, 0, 0, 0);\n c.set(Calendar.MONTH, i);\n monthsEng[i - 1] = c.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.ENGLISH).toLowerCase();\n } */\n\n q = q.toLowerCase();\n for(let i = 0; i < 12; i++) {\n const month = months[i].toLowerCase();\n if(month.indexOf(q) === 0) {\n return i;\n }\n }\n return -1;\n}\n\nfunction getDayOfWeek(q: string) {\n const c = new Date();\n if(q.length <= 3) {\n return -1;\n }\n\n for(let i = 0; i < 7; i++) {\n c.setDate(c.getDate() + 1);\n\n if(formatWeekLong(c.getTime()).toLowerCase().indexOf(q) === 0) {\n return c.getDay();\n }\n }\n return -1;\n}\n\nMOUNT_CLASS_TO.fillTipDates = fillTipDates;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {toastNew} from '../../components/toast';\nimport {LangPackKey} from '../../lib/langPack';\nimport {copyTextToClipboard} from '../clipboard';\nimport cancelEvent from './cancelEvent';\nimport {attachClickEvent} from './clickEvent';\n\nconst T_ME = 'https://t.me/';\nexport default function anchorCopy(options: Partial<{\n // href: string,\n mePath: string,\n username: string\n}> = {}) {\n const anchor = document.createElement('a');\n anchor.classList.add('anchor-copy');\n\n let copyWhat: string, copyText: LangPackKey = 'LinkCopied';\n if(options.mePath) {\n const href = T_ME + options.mePath;\n copyWhat = anchor.href = anchor.innerText = href;\n }\n\n if(options.username) {\n const href = T_ME + options.username;\n anchor.href = href;\n copyWhat = anchor.innerText = '@' + options.username;\n copyText = 'UsernameCopied';\n }\n\n attachClickEvent(anchor, (e) => {\n cancelEvent(e);\n copyTextToClipboard(copyWhat ?? anchor.href);\n toastNew({langPackKey: copyText});\n });\n\n return anchor;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport {IS_APPLE} from '../../environment/userAgent';\nimport contextMenuController from '../contextMenuController';\nimport ListenerSetter, {ListenerOptions} from '../listenerSetter';\nimport cancelEvent from './cancelEvent';\n\nlet _cancelContextMenuOpening = false, _cancelContextMenuOpeningTimeout = 0;\nexport function cancelContextMenuOpening() {\n if(_cancelContextMenuOpeningTimeout) {\n clearTimeout(_cancelContextMenuOpeningTimeout);\n }\n\n _cancelContextMenuOpeningTimeout = window.setTimeout(() => {\n _cancelContextMenuOpeningTimeout = 0;\n _cancelContextMenuOpening = false;\n }, .4e3);\n\n _cancelContextMenuOpening = true;\n}\n\nexport function attachContextMenuListener({\n element,\n callback,\n listenerSetter,\n listenerOptions\n}: {\n element: HTMLElement,\n callback: (e: TouchEvent | MouseEvent) => void,\n listenerSetter?: ListenerSetter,\n listenerOptions?: ListenerOptions\n}) {\n const add = listenerSetter ? listenerSetter.add(element) : element.addEventListener.bind(element);\n const remove = listenerSetter ? listenerSetter.removeManual.bind(listenerSetter, element) : element.removeEventListener.bind(element);\n\n // can't cancel further events coming after 'contextmenu' event\n if((IS_APPLE && IS_TOUCH_SUPPORTED) || listenerOptions) {\n let timeout: number;\n\n const options: EventListenerOptions = {\n ...(listenerOptions || {}),\n capture: true\n };\n\n const onCancel = () => {\n clearTimeout(timeout);\n // @ts-ignore\n remove('touchmove', onCancel, options);\n // @ts-ignore\n remove('touchend', onCancel, options);\n // @ts-ignore\n remove('touchcancel', onCancel, options);\n };\n\n add('touchstart', (e: TouchEvent) => {\n if(e.touches.length > 1) {\n onCancel();\n return;\n }\n\n add('touchmove', onCancel, options);\n add('touchend', onCancel, options);\n add('touchcancel', onCancel, options);\n\n timeout = window.setTimeout(() => {\n if(_cancelContextMenuOpening) {\n onCancel();\n return;\n }\n\n callback(e);\n onCancel();\n\n if(contextMenuController.isOpened()) {\n add('touchend', cancelEvent, {once: true}); // * fix instant closing\n }\n }, .4e3);\n }, listenerOptions);\n\n /* if(!isSafari) {\n add('contextmenu', (e: any) => {\n cancelEvent(e);\n }, {passive: false, capture: true});\n } */\n } else {\n add('contextmenu', IS_TOUCH_SUPPORTED ? (e: any) => {\n callback(e);\n\n if(contextMenuController.isOpened()) {\n add('touchend', cancelEvent, {once: true}); // * fix instant closing\n }\n } : callback, listenerOptions);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport type GrabEvent = {x: number, y: number, isTouch?: boolean, event: TouchEvent | MouseEvent};\n\nexport default function attachGrabListeners(element: HTMLElement,\n onStart: (position: GrabEvent) => void,\n onMove: (position: GrabEvent) => void,\n onEnd?: (position: GrabEvent) => void) {\n // * Mouse\n const onMouseMove = (event: MouseEvent) => {\n onMove({x: event.pageX, y: event.pageY, event});\n };\n\n const onMouseUp = (event: MouseEvent) => {\n document.removeEventListener('mousemove', onMouseMove);\n element.addEventListener('mousedown', onMouseDown, {once: true});\n onEnd?.({x: event.pageX, y: event.pageY, event});\n };\n\n const onMouseDown = (event: MouseEvent) => {\n if(event.button !== 0) {\n element.addEventListener('mousedown', onMouseDown, {once: true});\n return;\n }\n\n onStart({x: event.pageX, y: event.pageY, event});\n onMouseMove(event);\n\n document.addEventListener('mousemove', onMouseMove);\n document.addEventListener('mouseup', onMouseUp, {once: true});\n };\n\n element.addEventListener('mousedown', onMouseDown, {once: true});\n\n // * Touch\n const onTouchMove = (event: TouchEvent) => {\n event.preventDefault();\n onMove({x: event.touches[0].clientX, y: event.touches[0].clientY, isTouch: true, event});\n };\n\n const onTouchEnd = (event: TouchEvent) => {\n document.removeEventListener('touchmove', onTouchMove);\n element.addEventListener('touchstart', onTouchStart, {passive: false, once: true});\n const touch = event.touches[0] || event.changedTouches[0];\n onEnd?.({x: touch.clientX, y: touch.clientY, isTouch: true, event});\n };\n\n const onTouchStart = (event: TouchEvent) => {\n onStart({x: event.touches[0].clientX, y: event.touches[0].clientY, isTouch: true, event});\n onTouchMove(event);\n\n document.addEventListener('touchmove', onTouchMove, {passive: false});\n document.addEventListener('touchend', onTouchEnd, {passive: false, once: true});\n };\n\n element.addEventListener('touchstart', onTouchStart, {passive: false, once: true});\n\n return () => {\n element.removeEventListener('mousedown', onMouseDown);\n document.removeEventListener('mousemove', onMouseMove);\n document.removeEventListener('mouseup', onMouseUp);\n\n element.removeEventListener('touchstart', onTouchStart);\n document.removeEventListener('touchmove', onTouchMove);\n document.removeEventListener('touchend', onTouchEnd);\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function cancelSelection() {\n if(window.getSelection) {\n if(window.getSelection().empty) { // Chrome\n window.getSelection().empty();\n } else if(window.getSelection().removeAllRanges) { // Firefox\n window.getSelection().removeAllRanges();\n }\n // @ts-ignore\n } else if(document.selection) { // IE?\n // @ts-ignore\n document.selection.empty();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ListenerSetter from '../listenerSetter';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport simulateEvent from './dispatchEvent';\n\nlet lastMouseDownElement: HTMLElement;\ndocument.addEventListener('mousedown', (e) => {\n lastMouseDownElement = e.target as HTMLElement;\n});\n\nexport function hasMouseMovedSinceDown(e: Event) {\n if(e.isTrusted && e.type === 'click' && e.target !== lastMouseDownElement) {\n return true;\n }\n}\n\nexport const CLICK_EVENT_NAME: 'mousedown' /* | 'touchend' */ | 'click' = (IS_TOUCH_SUPPORTED ? 'mousedown' : 'click') as any;\nexport type AttachClickOptions = AddEventListenerOptions & Partial<{listenerSetter: ListenerSetter, touchMouseDown: true}>;\nexport function attachClickEvent(elem: HTMLElement | Window, callback: (e: /* TouchEvent | */MouseEvent) => void, options: AttachClickOptions = {}) {\n const add = options.listenerSetter ? options.listenerSetter.add(elem) : elem.addEventListener.bind(elem);\n const remove = options.listenerSetter ? options.listenerSetter.removeManual.bind(options.listenerSetter, elem) : elem.removeEventListener.bind(elem);\n\n options.touchMouseDown = true;\n /* if(options.touchMouseDown && CLICK_EVENT_NAME === 'touchend') {\n add('mousedown', callback, options);\n } else if(CLICK_EVENT_NAME === 'touchend') {\n const o = {...options, once: true};\n\n const onTouchStart = (e: TouchEvent) => {\n const onTouchMove = (e: TouchEvent) => {\n remove('touchmove', onTouchMove, o);\n remove('touchend', onTouchEnd, o);\n };\n\n const onTouchEnd = (e: TouchEvent) => {\n remove('touchmove', onTouchMove, o);\n callback(e);\n if(options.once) {\n remove('touchstart', onTouchStart);\n }\n };\n\n add('touchend', onTouchEnd, o);\n add('touchmove', onTouchMove, o);\n };\n\n add('touchstart', onTouchStart);\n } else {\n add(CLICK_EVENT_NAME, callback, options);\n } */\n\n if(CLICK_EVENT_NAME === 'click') {\n const cb = callback;\n callback = (e) => {\n if(hasMouseMovedSinceDown(e)) {\n return;\n }\n\n cb(e);\n };\n }\n\n add(CLICK_EVENT_NAME, callback, options);\n\n // @ts-ignore\n return () => remove(CLICK_EVENT_NAME, callback, options);\n}\n\n// export function detachClickEvent(elem: HTMLElement | Window, callback: (e: /* TouchEvent | */MouseEvent) => void, options?: AddEventListenerOptions) {\n// // if(CLICK_EVENT_NAME === 'touchend') {\n// // elem.removeEventListener('touchstart', callback, options);\n// // } else {\n// elem.removeEventListener(CLICK_EVENT_NAME, callback as any, options);\n// // }\n// }\n\nexport function simulateClickEvent(elem: HTMLElement) {\n simulateEvent(elem, CLICK_EVENT_NAME);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport EventListenerBase from '../eventListenerBase';\nimport ListenerSetter from '../listenerSetter';\nimport safeAssign from '../object/safeAssign';\nimport findUpClassName from './findUpClassName';\n\nexport default class ControlsHover extends EventListenerBase<{\n toggleControls: (show: boolean) => void\n}> {\n protected hideControlsTimeout: number;\n protected controlsLocked: boolean;\n\n protected canHideControls: () => boolean;\n protected element: HTMLElement;\n protected listenerSetter: ListenerSetter;\n protected showOnLeaveToClassName: string;\n protected ignoreClickClassName: string;\n\n constructor() {\n super(false);\n this.hideControlsTimeout = 0;\n }\n\n public setup(options: {\n element: HTMLElement,\n listenerSetter: ListenerSetter,\n canHideControls?: () => boolean,\n showOnLeaveToClassName?: string,\n ignoreClickClassName?: string\n }) {\n safeAssign(this, options);\n\n const {listenerSetter, element} = this;\n\n if(IS_TOUCH_SUPPORTED) {\n listenerSetter.add(element)('click', (e) => {\n if(this.ignoreClickClassName && findUpClassName(e.target, this.ignoreClickClassName)) {\n return;\n }\n\n this.toggleControls();\n });\n\n /* listenerSetter.add(player)('touchstart', () => {\n showControls(false);\n });\n\n listenerSetter.add(player)('touchend', () => {\n if(player.classList.contains('is-playing')) {\n showControls();\n }\n }); */\n } else {\n listenerSetter.add(element)('mousemove', () => {\n this.showControls();\n });\n\n listenerSetter.add(element)('mouseenter', () => {\n this.showControls(false);\n });\n\n listenerSetter.add(element)('mouseleave', (e) => {\n if(e.relatedTarget && this.showOnLeaveToClassName && findUpClassName(e.relatedTarget, this.showOnLeaveToClassName)) {\n this.showControls(false);\n return;\n }\n\n this.hideControls();\n });\n }\n }\n\n public hideControls = (setHideTimeout = false) => {\n if(setHideTimeout) {\n if(!this.hideControlsTimeout) {\n this.hideControlsTimeout = window.setTimeout(this.hideControls, 3e3);\n }\n\n return;\n }\n\n clearTimeout(this.hideControlsTimeout);\n this.hideControlsTimeout = 0;\n\n const isShown = this.element.classList.contains('show-controls');\n if(this.controlsLocked !== false) {\n if((this.canHideControls ? !this.canHideControls() : false) || !isShown || this.controlsLocked) {\n return;\n }\n } else if(!isShown) {\n return;\n }\n\n this.dispatchEvent('toggleControls', false);\n this.element.classList.remove('show-controls');\n };\n\n public showControls = (setHideTimeout = true) => {\n if(this.hideControlsTimeout) {\n clearTimeout(this.hideControlsTimeout);\n this.hideControlsTimeout = 0;\n } else if(!this.element.classList.contains('show-controls') && this.controlsLocked !== false) {\n this.dispatchEvent('toggleControls', true);\n this.element.classList.add('show-controls');\n }\n\n if(!setHideTimeout || this.controlsLocked) {\n return;\n }\n\n this.hideControlsTimeout = window.setTimeout(this.hideControls, 3e3);\n };\n\n public toggleControls = (show?: boolean) => {\n const isShown = this.element.classList.contains('show-controls');\n\n if(show === undefined) {\n if(isShown) this.hideControls();\n else this.showControls();\n } else if(show === isShown) return;\n else if(show === false) this.hideControls();\n else this.showControls();\n };\n\n public lockControls(visible: boolean) {\n this.controlsLocked = visible;\n\n this.element.classList.toggle('disable-hover', visible === false);\n this.toggleControls(visible);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ButtonMenu, {ButtonMenuItemOptionsVerifiable} from '../../components/buttonMenu';\nimport filterAsync from '../array/filterAsync';\nimport callbackify from '../callbackify';\nimport contextMenuController from '../contextMenuController';\nimport ListenerSetter from '../listenerSetter';\nimport {getMiddleware, Middleware} from '../middleware';\nimport positionMenu from '../positionMenu';\nimport {attachContextMenuListener} from './attachContextMenuListener';\nimport {attachClickEvent} from './clickEvent';\n\nexport default function createContextMenu({\n buttons,\n findElement,\n listenTo,\n appendTo,\n filterButtons,\n onOpen,\n onClose,\n onBeforeOpen,\n listenerSetter: attachListenerSetter,\n middleware,\n listenForClick\n}: {\n buttons: T[],\n findElement?: (e: MouseEvent | TouchEvent) => HTMLElement,\n listenTo: HTMLElement,\n appendTo?: HTMLElement,\n filterButtons?: (buttons: T[]) => Promise,\n onOpen?: (target: HTMLElement) => any,\n onClose?: () => any,\n onBeforeOpen?: () => any,\n listenerSetter?: ListenerSetter,\n middleware?: Middleware,\n listenForClick?: boolean\n}) {\n appendTo ??= document.body;\n\n attachListenerSetter ??= new ListenerSetter();\n const listenerSetter = new ListenerSetter();\n const middlewareHelper = middleware ? middleware.create() : getMiddleware();\n let element: HTMLElement;\n\n const open = (e: MouseEvent | TouchEvent) => {\n const target = findElement ? findElement(e as any) : listenTo;\n if(!target) {\n return;\n }\n\n let _element = element;\n if(e instanceof MouseEvent || e.hasOwnProperty('preventDefault')) (e as any).preventDefault();\n if(_element && _element.classList.contains('active')) {\n return false;\n }\n if(e instanceof MouseEvent || e.hasOwnProperty('cancelBubble')) (e as any).cancelBubble = true;\n\n const r = async() => {\n await onOpen?.(target);\n\n const initResult = await init();\n if(!initResult) {\n return;\n }\n\n _element = initResult.element;\n const {cleanup, destroy} = initResult;\n\n positionMenu(e, _element);\n contextMenuController.openBtnMenu(_element, () => {\n onClose?.();\n cleanup();\n\n setTimeout(() => {\n destroy();\n }, 300);\n });\n };\n\n r();\n };\n\n attachContextMenuListener({\n element: listenTo,\n callback: open,\n listenerSetter: attachListenerSetter\n });\n\n const cleanup = () => {\n listenerSetter.removeAll();\n middlewareHelper.clean();\n };\n\n const destroy = () => {\n cleanup();\n attachListenerSetter.removeAll();\n };\n\n const init = async() => {\n cleanup();\n\n buttons.forEach((button) => button.element = undefined);\n const f = filterButtons || ((buttons: T[]) => filterAsync(buttons, (button) => {\n return button?.verify ? callbackify(button.verify(), (result) => result ?? false) : true;\n }));\n\n const filteredButtons = await f(buttons);\n if(!filteredButtons.length) {\n return;\n }\n\n const _element = element = await ButtonMenu({\n buttons: filteredButtons,\n listenerSetter\n });\n _element.classList.add('contextmenu');\n\n await onBeforeOpen?.();\n\n appendTo.append(_element);\n\n return {\n element: _element,\n cleanup,\n destroy: () => {\n _element.remove();\n }\n };\n };\n\n if(middleware) {\n middleware.onDestroy(() => {\n destroy();\n });\n }\n\n if(listenForClick) {\n attachClickEvent(listenTo, open, {listenerSetter: attachListenerSetter});\n }\n\n return {element, destroy, open};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport PopupStickers from '../../components/popups/stickers';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport rootScope from '../../lib/rootScope';\nimport createContextMenu from './createContextMenu';\nimport findUpClassName from './findUpClassName';\nimport {EmoticonsDropdown} from '../../components/emoticonsDropdown';\nimport PopupElement from '../../components/popups';\n\nexport default function createStickersContextMenu(options: {\n listenTo: HTMLElement,\n isStickerPack?: boolean,\n verifyRecent?: (target: HTMLElement) => boolean,\n appendTo?: HTMLElement,\n onOpen?: () => any,\n onClose?: () => any,\n onSend?: () => any\n}) {\n const {listenTo, isStickerPack, verifyRecent, appendTo, onOpen, onClose, onSend} = options;\n let target: HTMLElement, doc: MyDocument;\n const verifyFavoriteSticker = async(toAdd: boolean) => {\n const favedStickers = await rootScope.managers.acknowledged.appStickersManager.getFavedStickersStickers();\n if(!favedStickers.cached) {\n return false;\n }\n\n const found = (await favedStickers.result).some((_doc) => _doc.id === doc.id);\n return toAdd ? !found : found;\n };\n\n return createContextMenu({\n listenTo: listenTo,\n appendTo,\n findElement: (e) => target = findUpClassName(e.target, 'media-sticker-wrapper'),\n onOpen: async() => {\n doc = await rootScope.managers.appDocsManager.getDoc(target.dataset.docId);\n return onOpen?.();\n },\n onClose,\n buttons: [{\n icon: 'stickers',\n text: 'Context.ViewStickerSet',\n onClick: () => PopupElement.createPopup(PopupStickers, doc.stickerSetInput).show(),\n verify: () => !isStickerPack\n }, {\n icon: 'favourites',\n text: 'AddToFavorites',\n onClick: () => rootScope.managers.appStickersManager.faveSticker(doc.id, false),\n verify: () => verifyFavoriteSticker(true)\n }, {\n icon: 'favourites',\n text: 'DeleteFromFavorites',\n onClick: () => rootScope.managers.appStickersManager.faveSticker(doc.id, true),\n verify: () => verifyFavoriteSticker(false)\n }, {\n icon: 'delete',\n text: 'DeleteFromRecent',\n onClick: () => rootScope.managers.appStickersManager.saveRecentSticker(doc.id, true),\n verify: () => verifyRecent?.(target) ?? false\n }, {\n icon: 'mute',\n text: 'Chat.Send.WithoutSound',\n onClick: () => {\n onSend?.();\n return EmoticonsDropdown.sendDocId(doc.id, false, true);\n },\n verify: () => !!(appImManager.chat.peerId && appImManager.chat.peerId !== rootScope.myId)\n }, {\n icon: 'schedule',\n text: 'Chat.Send.ScheduledMessage',\n onClick: () => appImManager.chat.input.scheduleSending(() => appImManager.chat.input.sendMessageWithDocument(doc)),\n verify: () => !!appImManager.chat.peerId\n }]\n });\n}\n","export default function createVideo(options: {\n pip?: boolean\n} = {}) {\n const video = document.createElement('video');\n if(!options.pip) video.disablePictureInPicture = true;\n video.setAttribute('playsinline', 'true');\n return video;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport rootScope from '../../lib/rootScope';\nimport mediaSizes from '../mediaSizes';\n\nexport type CustomProperty = string;\n\nexport class CustomProperties {\n private cache: {[k in CustomProperty]?: string};\n private computedStyle: CSSStyleDeclaration;\n\n constructor() {\n this.cache = {};\n\n rootScope.addEventListener('theme_change', this.resetCache);\n mediaSizes.addEventListener('resize', this.resetCache);\n }\n\n protected resetCache = () => {\n this.computedStyle = undefined;\n const cache = this.cache;\n this.cache = {};\n\n for(const i in cache) {\n this.getProperty(i);\n }\n };\n\n public getProperty(name: CustomProperty) {\n let value = this.cache[name];\n if(value) {\n return value;\n }\n\n if(!this.computedStyle) {\n this.computedStyle = window.getComputedStyle(document.documentElement);\n }\n\n value = this.computedStyle.getPropertyValue('--' + name).trim();\n return this.cache[name] = value;\n }\n\n public getPropertyAsSize(name: CustomProperty) {\n const value = this.getProperty(name);\n let size: number;\n\n if(value[value.length - 1] === '%') {\n\n } else if(value.indexOf('rem')) {\n size = +value.replace('rem', '') * 16;\n } else {\n size = +value.replace('px', '');\n }\n\n return size;\n }\n}\n\nconst customProperties = new CustomProperties();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.customProperties = customProperties);\nexport default customProperties;\n","export default function simulateEvent(elem: EventTarget, name: string) {\n const event = new Event(name, {bubbles: true, cancelable: true});\n elem.dispatchEvent(event);\n}\n","import encodeEntities from '../string/encodeEntities';\n\nexport default function documentFragmentToHTML(fragment: DocumentFragment) {\n return Array.from(fragment.childNodes).map((node) => {\n return node.nodeType === node.TEXT_NODE ? encodeEntities(node.textContent) : (node as Element).outerHTML;\n }).join('');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function findUpAsChild(el: T, parent: HTMLElement): T {\n if(!el) return null;\n if(el.parentElement === parent) return el;\n\n while(el.parentElement) {\n el = el.parentElement as any;\n if(el.parentElement === parent) {\n return el;\n }\n }\n\n return null;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function findUpAttribute(el: any, attribute: string): HTMLElement {\n return el.closest(`[${attribute}]`);\n /* if(el.getAttribute(attribute) !== null) return el; // 03.02.2020\n\n while(el.parentElement) {\n el = el.parentElement;\n if(el.getAttribute(attribute) !== null)\n return el;\n }\n return null; */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function findUpTag(el: any, tag: string): HTMLElement {\n return el.closest(tag);\n /* if(el.tagName === tag) return el; // 03.02.2020\n\n while(el.parentElement) {\n el = el.parentElement;\n if(el.tagName === tag)\n return el;\n }\n return null; */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ListenerSetter from '../listenerSetter';\n\nexport function requestFullScreen(element: HTMLElement) {\n if(element.requestFullscreen) {\n element.requestFullscreen();\n // @ts-ignore\n } else if(element.mozRequestFullScreen) {\n // @ts-ignore\n element.mozRequestFullScreen(); // Firefox\n // @ts-ignore\n } else if(element.webkitRequestFullscreen) {\n // @ts-ignore\n element.webkitRequestFullscreen(); // Chrome and Safari\n // @ts-ignore\n } else if(element.msRequestFullscreen) {\n // @ts-ignore\n element.msRequestFullscreen();\n }\n}\n\nexport function cancelFullScreen() {\n // @ts-ignore\n if(document.cancelFullScreen) {\n // @ts-ignore\n document.cancelFullScreen();\n // @ts-ignore\n } else if(document.mozCancelFullScreen) {\n // @ts-ignore\n document.mozCancelFullScreen();\n // @ts-ignore\n } else if(document.webkitCancelFullScreen) {\n // @ts-ignore\n document.webkitCancelFullScreen();\n // @ts-ignore\n } else if(document.msExitFullscreen) {\n // @ts-ignore\n document.msExitFullscreen();\n }\n}\n\nexport function addFullScreenListener(element: HTMLElement, callback: (e: Event) => any, listenerSetter?: ListenerSetter) {\n const addListener = listenerSetter ? listenerSetter.add(element) : element.addEventListener.bind(element);\n 'webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange'.split(' ').forEach((eventName) => {\n addListener(eventName, callback, false);\n });\n}\n\nexport function getFullScreenElement(): HTMLElement {\n // @ts-ignore\n return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement;\n}\n\nexport function isFullScreen() {\n return !!getFullScreenElement();\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport findUpAsChild from './findUpAsChild';\n\nexport default function getCaretPosNew(input: HTMLElement, anchor?: boolean): ReturnType & {selection: Selection} {\n const selection = document.getSelection();\n // let {focusNode: node, focusOffset: offset} = selection;\n const node = selection[anchor ? 'anchorNode' : 'focusNode'];\n const offset = selection[anchor ? 'anchorOffset' : 'focusOffset'];\n if(!findUpAsChild(node, input) && node !== input) {\n return {selection} as any;\n }\n\n return {...getCaretPosF(input, node, offset), selection};\n}\n\nexport function getCaretPosF(input: HTMLElement, node: Node, offset: number) {\n if(node === input) {\n const childNodes = input.childNodes;\n const childNodesLength = childNodes.length;\n if(childNodesLength && offset >= childNodesLength) {\n node = childNodes[childNodesLength - 1];\n offset = (node.textContent || (node as HTMLImageElement).alt || '').length;\n } else {\n node = childNodes[offset];\n offset = 0;\n }\n }\n\n return {node: node as ChildNode, offset};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\nimport BOM from '../string/bom';\n\nexport type MarkdownType = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'monospace' | 'link' | 'mentionName' | 'spoiler'/* | 'customEmoji' */;\nexport type MarkdownTag = {\n match: string,\n entityName: Extract;\n};\n\n// https://core.telegram.org/bots/api#html-style\nexport const markdownTags: {[type in MarkdownType]: MarkdownTag} = {\n bold: {\n match: '[style*=\"bold\"], [style*=\"font-weight: 700\"], [style*=\"font-weight: 600\"], [style*=\"font-weight:700\"], [style*=\"font-weight:600\"], b, strong',\n entityName: 'messageEntityBold'\n },\n underline: {\n match: '[style*=\"underline\"], u, ins',\n entityName: 'messageEntityUnderline'\n },\n italic: {\n match: '[style*=\"italic\"], i, em',\n entityName: 'messageEntityItalic'\n },\n monospace: {\n match: '[style*=\"monospace\"], [face*=\"monospace\"], pre',\n entityName: 'messageEntityCode'\n },\n strikethrough: {\n match: '[style*=\"line-through\"], [style*=\"strikethrough\"], strike, del, s',\n entityName: 'messageEntityStrike'\n },\n link: {\n match: 'A:not(.follow)',\n entityName: 'messageEntityTextUrl'\n },\n mentionName: {\n match: 'A.follow',\n entityName: 'messageEntityMentionName'\n },\n spoiler: {\n match: '[style*=\"spoiler\"]',\n entityName: 'messageEntitySpoiler'\n }\n // customEmoji: {\n // match: '.custom-emoji',\n // entityName: 'messageEntityCustomEmoji'\n // }\n};\n\nconst tabulationMatch = '[style*=\"table-cell\"], th, td';\n\n/* export function getDepth(child: Node, container?: Node) {\n let depth = 0;\n\n do {\n if(child === container) {\n return depth;\n }\n\n ++depth;\n } while((child = child.parentNode) !== null);\n\n return depth;\n} */\n\nconst BLOCK_TAGS = new Set([\n 'DIV',\n 'P',\n 'BR',\n 'LI',\n 'SECTION',\n 'H6',\n 'H5',\n 'H4',\n 'H3',\n 'H2',\n 'H1',\n 'TR',\n 'OL',\n 'UL'\n]);\n\n// const INSERT_NEW_LINE_TAGS = new Set([\n// 'OL',\n// 'UL'\n// ]);\n\nconst BOM_REG_EXP = new RegExp(BOM, 'g');\nexport const SELECTION_SEPARATOR = '\\x01';\n\nfunction checkNodeForEntity(node: Node, value: string, entities: MessageEntity[], offset: {offset: number}) {\n const parentElement = node.parentElement;\n\n // let closestTag: MarkdownTag, closestElementByTag: Element, closestDepth = Infinity;\n for(const type in markdownTags) {\n const tag = markdownTags[type as MarkdownType];\n const closest: HTMLElement = parentElement.closest(tag.match + ', [contenteditable=\"true\"]');\n if(closest?.getAttribute('contenteditable') !== null) {\n /* const depth = getDepth(closest, parentElement.closest('[contenteditable]'));\n if(closestDepth > depth) {\n closestDepth = depth;\n closestTag = tag;\n closestElementByTag = closest;\n } */\n continue;\n }\n\n if(tag.entityName === 'messageEntityTextUrl') {\n entities.push({\n _: tag.entityName,\n url: (closest as HTMLAnchorElement).href,\n offset: offset.offset,\n length: value.length\n });\n } else if(tag.entityName === 'messageEntityMentionName') {\n entities.push({\n _: tag.entityName,\n offset: offset.offset,\n length: value.length,\n user_id: (closest as HTMLElement).dataset.follow.toUserId()\n });\n }/* else if(tag.entityName === 'messageEntityCustomEmoji') {\n entities.push({\n _: tag.entityName,\n document_id: (closest as HTMLElement).dataset.docId,\n offset: offset.offset,\n length: emoji.length\n });\n } */ else {\n entities.push({\n _: tag.entityName,\n offset: offset.offset,\n length: value.length\n });\n }\n }\n}\n\nfunction isLineEmpty(line: string[]) {\n const {length} = line;\n if(!length) {\n return true;\n }\n\n if(line[length - 1] === SELECTION_SEPARATOR && length === SELECTION_SEPARATOR.length) {\n return true;\n }\n\n return false;\n}\n\nexport default function getRichElementValue(\n node: HTMLElement,\n lines: string[],\n line: string[],\n selNode?: Node,\n selOffset?: number,\n entities?: MessageEntity[],\n offset = {offset: 0}\n) {\n if(node.nodeType === node.TEXT_NODE) { // TEXT\n let nodeValue = node.nodeValue;\n // if(nodeValue[0] === BOM) {\n nodeValue = nodeValue.replace(BOM_REG_EXP, '');\n // }\n\n /* const tabulation = node.parentElement?.closest(tabulationMatch + ', [contenteditable]');\n if(tabulation?.getAttribute('contenteditable') === null) {\n nodeValue += ' ';\n // line.push('\\t');\n // ++offset.offset;\n } */\n\n if(nodeValue) {\n if(selNode === node) {\n line.push(nodeValue.substr(0, selOffset) + SELECTION_SEPARATOR + nodeValue.substr(selOffset));\n } else {\n line.push(nodeValue);\n }\n } else if(selNode === node) {\n line.push(SELECTION_SEPARATOR);\n }\n\n if(entities && nodeValue.length && node.parentNode) {\n checkNodeForEntity(node, nodeValue, entities, offset);\n }\n\n offset.offset += nodeValue.length;\n return;\n }\n\n if(node.nodeType !== node.ELEMENT_NODE) { // NON-ELEMENT\n return;\n }\n\n const pushLine = () => {\n lines.push(line.join(''));\n line.length = 0;\n ++offset.offset;\n };\n\n const isSelected = selNode === node;\n const isBlock = BLOCK_TAGS.has(node.tagName);\n if(isBlock && (line.length || node.tagName === 'BR'/* || (BLOCK_TAGS.has(node.tagName) && lines.length) */)) {\n pushLine();\n } else {\n const alt = node.dataset.stickerEmoji || (node as HTMLImageElement).alt;\n const stickerEmoji = node.dataset.stickerEmoji;\n\n if(alt && entities) {\n checkNodeForEntity(node, alt, entities, offset);\n }\n\n if(stickerEmoji && entities) {\n entities.push({\n _: 'messageEntityCustomEmoji',\n document_id: node.dataset.docId,\n offset: offset.offset,\n length: alt.length\n });\n }\n\n if(alt) {\n line.push(alt);\n offset.offset += alt.length;\n }\n }\n\n if(isSelected && !selOffset) {\n line.push(SELECTION_SEPARATOR);\n }\n\n const isTableCell = node.matches(tabulationMatch);\n const wasEntitiesLength = entities?.length;\n const wasLinesLength = lines.length;\n let wasNodeEmpty = true;\n\n let curChild = node.firstChild as HTMLElement;\n while(curChild) {\n getRichElementValue(curChild, lines, line, selNode, selOffset, entities, offset);\n curChild = curChild.nextSibling as any;\n\n if(!isLineEmpty(line)) {\n wasNodeEmpty = false;\n }\n }\n\n // can test on text with list (https://www.who.int/initiatives/sports-and-health)\n if(wasNodeEmpty && node.textContent?.replace(/[\\r\\n]/g, '')) {\n wasNodeEmpty = false;\n }\n\n if(isSelected && selOffset) {\n line.push(SELECTION_SEPARATOR);\n }\n\n if(isTableCell && node.nextSibling && !isLineEmpty(line)) {\n line.push(' ');\n ++offset.offset;\n\n // * combine entities such as url after adding space\n if(wasEntitiesLength !== undefined) {\n for(let i = wasEntitiesLength, length = entities.length; i < length; ++i) {\n ++entities[i].length;\n }\n }\n }\n\n if(isBlock && !wasNodeEmpty) {\n pushLine();\n }\n\n if(!wasNodeEmpty && node.tagName === 'P' && node.nextSibling) {\n lines.push('');\n ++offset.offset;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport {MessageEntity} from '../../layer';\nimport combineSameEntities from '../../lib/richTextProcessor/combineSameEntities';\nimport sortEntities from '../../lib/richTextProcessor/sortEntities';\nimport getRichElementValue, {SELECTION_SEPARATOR} from './getRichElementValue';\n\nexport function getCaretPos(field: HTMLElement) {\n const sel = window.getSelection();\n let selNode: Node;\n let selOffset: number;\n if(sel?.rangeCount) {\n const range = sel.getRangeAt(0);\n const startOffset = range.startOffset;\n if(\n range.startContainer &&\n range.startContainer == range.endContainer &&\n startOffset == range.endOffset\n ) {\n // * if focused on img, or caret has been set via placeCaretAtEnd\n const possibleChildrenFocusOffset = startOffset - 1;\n const childNodes = field.childNodes;\n if(range.startContainer === field && childNodes[possibleChildrenFocusOffset]) {\n selNode = childNodes[possibleChildrenFocusOffset];\n selOffset = 0;\n\n for(let i = 0; i < range.endOffset; ++i) {\n const node = childNodes[i];\n const value = node.nodeValue || (node as HTMLImageElement).alt;\n\n if(value) {\n selOffset += value.length;\n }\n }\n } else {\n selNode = range.startContainer;\n selOffset = startOffset;\n }\n }\n }\n\n return {node: selNode, offset: selOffset};\n}\n\nexport default function getRichValueWithCaret(\n field: HTMLElement | DocumentFragment,\n withEntities = true,\n withCaret = true\n) {\n const lines: string[] = [];\n const line: string[] = [];\n\n const {node: selNode, offset: selOffset} = !(field instanceof DocumentFragment) && withCaret && getCaretPos(field);\n\n const entities: MessageEntity[] = withEntities ? [] : undefined;\n const offset = {offset: 0};\n if(field instanceof DocumentFragment) {\n let curChild = field.firstChild as HTMLElement;\n while(curChild) {\n getRichElementValue(curChild, lines, line, selNode, selOffset, entities, offset);\n curChild = curChild.nextSibling as any;\n }\n } else {\n getRichElementValue(field, lines, line, selNode, selOffset, entities, offset);\n }\n\n if(line.length) {\n lines.push(line.join(''));\n }\n\n let value = lines.join('\\n');\n const caretPos = value.indexOf(SELECTION_SEPARATOR);\n if(caretPos !== -1) {\n value = value.substr(0, caretPos) + value.substr(caretPos + 1);\n }\n value = value.replace(/\\u00A0/g, ' ');\n\n if(entities?.length) {\n // ! cannot do that here because have the same check before the sending in RichTextProcessor.parseMarkdown\n /* const entity = entities[entities.length - 1];\n const length = value.length;\n const trimmedLength = value.trimRight().length;\n if(length !== trimmedLength) {\n entity.length -= length - trimmedLength;\n } */\n\n combineSameEntities(entities);\n sortEntities(entities);\n }\n\n return {value, entities, caretPos};\n}\n\nMOUNT_CLASS_TO.getRichValueWithCaret = getRichValueWithCaret;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport getVisibleRect from './getVisibleRect';\n\nexport type ViewportSlicePart = {element: HTMLElement, rect: DOMRect, visibleRect: ReturnType}[];\n\nexport default function getViewportSlice({overflowElement, overflowRect, selector, extraSize, elements}: {\n overflowElement: HTMLElement,\n overflowRect?: DOMRectMinified,\n extraSize?: number,\n selector?: string,\n elements?: HTMLElement[]\n}) {\n // const perf = performance.now();\n overflowRect ??= overflowElement.getBoundingClientRect();\n elements ??= Array.from(overflowElement.querySelectorAll(selector));\n\n if(extraSize) {\n overflowRect = {\n top: overflowRect.top - extraSize,\n right: overflowRect.right + extraSize,\n bottom: overflowRect.bottom + extraSize,\n left: overflowRect.left - extraSize\n };\n }\n\n const invisibleTop: ViewportSlicePart = [],\n visible: typeof invisibleTop = [],\n invisibleBottom: typeof invisibleTop = [];\n let foundVisible = false;\n for(const element of elements) {\n const rect = element.getBoundingClientRect();\n const visibleRect = getVisibleRect(element, overflowElement, false, rect, overflowRect);\n\n const isVisible = !!visibleRect;\n let array: typeof invisibleTop;\n if(isVisible) {\n foundVisible = true;\n array = visible;\n } else if(foundVisible) {\n array = invisibleBottom;\n } else {\n array = invisibleTop;\n }\n\n array.push({\n element,\n rect,\n visibleRect\n });\n }\n\n // if(extraSize && visible.length) {\n // const maxTop = visible[0].rect.top;\n // const minTop = maxTop - extraSize;\n // const minBottom = visible[visible.length - 1].rect.bottom;\n // const maxBottom = minBottom + extraSize;\n\n // for(let length = invisibleTop.length, i = length - 1; i >= 0; --i) {\n // const element = invisibleTop[i];\n // if(element.rect.top >= minTop) {\n // invisibleTop.splice(i, 1);\n // visible.unshift(element);\n // }\n // }\n\n // for(let i = 0, length = invisibleBottom.length; i < length; ++i) {\n // const element = invisibleBottom[i];\n // if(element.rect.bottom <= maxBottom) {\n // invisibleBottom.splice(i--, 1);\n // --length;\n // visible.push(element);\n // }\n // }\n // }\n\n // console.log('getViewportSlice time:', performance.now() - perf);\n\n return {invisibleTop, visible, invisibleBottom};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport windowSize from '../windowSize';\n\nexport default function getVisibleRect(\n element: HTMLElement,\n overflowElement: HTMLElement,\n lookForSticky?: boolean,\n rect: DOMRectMinified = element.getBoundingClientRect(),\n overflowRect: DOMRectMinified = overflowElement.getBoundingClientRect()\n) {\n let {top: overflowTop, right: overflowRight, bottom: overflowBottom, left: overflowLeft} = overflowRect;\n\n // * respect sticky headers\n if(lookForSticky) {\n const sticky = overflowElement.querySelector('.sticky');\n if(sticky) {\n const stickyRect = sticky.getBoundingClientRect();\n overflowTop = stickyRect.bottom;\n }\n }\n\n if(rect.top >= overflowBottom ||\n rect.bottom <= overflowTop ||\n rect.right <= overflowLeft ||\n rect.left >= overflowRight) {\n return null;\n }\n\n const overflow = {\n top: false,\n right: false,\n bottom: false,\n left: false,\n vertical: 0 as 0 | 1 | 2,\n horizontal: 0 as 0 | 1 | 2\n };\n\n const windowWidth = windowSize.width;\n const windowHeight = windowSize.height;\n\n return {\n rect: {\n top: rect.top < overflowTop && overflowTop !== 0 ? (overflow.top = true, ++overflow.vertical, overflowTop) : rect.top,\n right: rect.right > overflowRight && overflowRight !== windowWidth ? (overflow.right = true, ++overflow.horizontal, overflowRight) : rect.right,\n bottom: rect.bottom > overflowBottom && overflowBottom !== windowHeight ? (overflow.bottom = true, ++overflow.vertical, overflowBottom) : rect.bottom,\n left: rect.left < overflowLeft && overflowLeft !== 0 ? (overflow.left = true, ++overflow.horizontal, overflowLeft) : rect.left\n },\n overflow\n };\n}\n\n(window as any).getVisibleRect = getVisibleRect;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport SwipeHandler, {SwipeHandlerOptions} from '../../components/swipeHandler';\nimport cancelEvent from './cancelEvent';\nimport findUpClassName from './findUpClassName';\nimport isSwipingBackSafari from './isSwipingBackSafari';\n\nexport type SwipeHandlerHorizontalOptions = SwipeHandlerOptions & {\n // xThreshold?: number\n};\n\nexport default function handleHorizontalSwipe(options: SwipeHandlerHorizontalOptions) {\n let cancelY = false;\n return new SwipeHandler({\n ...options,\n verifyTouchTarget: (e) => {\n return !findUpClassName(e.target, 'progress-line') &&\n !isSwipingBackSafari(e as any as TouchEvent) &&\n (options.verifyTouchTarget ? options.verifyTouchTarget(e) : true);\n },\n onSwipe: (xDiff, yDiff, e) => {\n xDiff *= -1;\n yDiff *= -1;\n\n if(!cancelY && Math.abs(yDiff) > 20) {\n return true;\n }\n\n if(Math.abs(xDiff) > Math.abs(yDiff)) {\n cancelEvent(e as any as Event);\n cancelY = true;\n } else if(!cancelY && Math.abs(yDiff) > Math.abs(xDiff)/* || Math.abs(yDiff) > 20 */) {\n return true;\n }\n\n /* if(!cancelY && options.xThreshold !== undefined && xDiff >= options.xThreshold) {\n cancelY = true;\n } */\n\n return options.onSwipe(xDiff, yDiff, e);\n },\n onReset: () => {\n cancelY = false;\n options.onReset && options.onReset();\n },\n cancelEvent: false // cannot use cancelEvent on Safari iOS because scroll will be canceled too\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {cancelContextMenuOpening} from './attachContextMenuListener';\nimport handleHorizontalSwipe, {SwipeHandlerHorizontalOptions} from './handleHorizontalSwipe';\n\nexport default function handleTabSwipe(options: SwipeHandlerHorizontalOptions) {\n return handleHorizontalSwipe({\n ...options,\n onSwipe: (xDiff, yDiff, e) => {\n xDiff *= -1;\n yDiff *= -1;\n\n if(Math.abs(xDiff) > 50) {\n options.onSwipe(xDiff, yDiff, e);\n cancelContextMenuOpening();\n\n return true;\n }\n }\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {markdownTags, MarkdownType} from './getRichElementValue';\n\nexport default function hasMarkupInSelection(types: T[], onlyFull?: boolean) {\n const result: Record = {} as any;\n types.forEach((tag) => result[tag] = 0);\n const selection = window.getSelection();\n let nodes = -1;\n if(!selection.isCollapsed) {\n const range = selection.getRangeAt(0);\n const commonAncestor = range.commonAncestorContainer;\n const root = commonAncestor.nodeType === commonAncestor.ELEMENT_NODE ?\n commonAncestor as HTMLElement :\n (commonAncestor as ChildNode).parentElement;\n const treeWalker = document.createTreeWalker(\n root.closest('[contenteditable=\"true\"]'),\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT,\n {acceptNode: (node) => range.intersectsNode(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT}\n );\n\n nodes = 0;\n let node: Node;\n while(node = treeWalker.nextNode()) {\n ++nodes;\n for(const type of types) {\n const tag = markdownTags[type];\n const matches = (node.nodeType === node.ELEMENT_NODE ? node as HTMLElement : node.parentElement).closest(tag.match);\n if(matches) {\n ++result[type];\n }\n }\n }\n }\n\n const resultBoolean: Record = {} as any;\n for(const type of types) {\n resultBoolean[type] = result[type] >= (onlyFull ? nodes : 1);\n }\n\n return resultBoolean;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function htmlToDocumentFragment(html: string | DocumentFragment) {\n if(html instanceof DocumentFragment) return html;\n const template = document.createElement('template');\n html = html.trim(); // Never return a text node of whitespace as the result\n template.innerHTML = html;\n return template.content;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function htmlToSpan(html: string | DocumentFragment) {\n const span = document.createElement('span');\n if(typeof(html) === 'string') span.innerHTML = html;\n else span.append(html);\n return span;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\n/* export function isInDOM(element: Element, parentNode?: HTMLElement): boolean {\n if(!element) {\n return false;\n }\n\n parentNode = parentNode || document.body;\n if(element === parentNode) {\n return true;\n }\n return isInDOM(element.parentNode as HTMLElement, parentNode);\n} */\nexport default function isInDOM(element: Element): boolean {\n return element?.isConnected;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function isInputEmpty(element: HTMLElement) {\n if(element.isContentEditable || element.tagName !== 'INPUT') {\n /* const value = element.innerText;\n\n return !value.trim() && !serializeNodes(Array.from(element.childNodes)).trim(); */\n // return !getRichValueWithCaret(element, false, false).value.trim();\n return !element.textContent.trim() && !element.querySelector('.emoji, .custom-emoji, .custom-emoji-placeholder');\n } else {\n return !(element as HTMLInputElement).value.trim();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function isSelectionEmpty(selection = window.getSelection()) {\n if(!selection?.rangeCount) {\n return true;\n }\n\n const selectionRange = selection.getRangeAt(0);\n if(selectionRange.collapsed || !selectionRange.START_TO_END) {\n return true;\n }\n\n return false;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../../lib/rootScope';\nimport {IS_MOBILE, IS_APPLE} from '../../environment/userAgent';\n\nexport default function isSendShortcutPressed(e: KeyboardEvent) {\n if(e.key === 'Enter' && !IS_MOBILE && !e.isComposing) {\n /* if(e.ctrlKey || e.metaKey) {\n this.messageInput.innerHTML += '
';\n placeCaretAtEnd(this.message)\n return;\n } */\n\n if(rootScope.settings.sendShortcut === 'enter') {\n if(e.shiftKey || e.ctrlKey || e.metaKey) {\n return;\n }\n\n return true;\n } else {\n const secondaryKey = IS_APPLE ? e.metaKey : e.ctrlKey;\n if(e.shiftKey || (IS_APPLE ? e.ctrlKey : e.metaKey)) {\n return;\n }\n\n if(secondaryKey) {\n return true;\n }\n }\n }\n\n return false;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {IS_MOBILE_SAFARI} from '../../environment/userAgent';\n\nexport default function isSwipingBackSafari(e: TouchEvent | MouseEvent) {\n return IS_MOBILE_SAFARI && e instanceof TouchEvent && e.touches[0].clientX < 30;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\n\nexport default function placeCaretAtEnd(el: HTMLElement, ignoreTouchCheck = false, focus = true) {\n if(IS_TOUCH_SUPPORTED && (!ignoreTouchCheck || (document.activeElement.tagName !== 'INPUT' && !(document.activeElement as HTMLElement).isContentEditable))) {\n return;\n }\n\n focus && el.focus();\n if(el instanceof HTMLInputElement) {\n const length = el.value.length;\n el.selectionStart = length;\n el.selectionEnd = length;\n } else {\n const range = document.createRange();\n range.selectNodeContents(el);\n range.collapse(false);\n const sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n }\n}\n\n(window as any).placeCaretAtEnd = placeCaretAtEnd;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport whichChild from './whichChild';\n\nexport default function positionElementByIndex(element: HTMLElement, container: HTMLElement, pos: number, prevPos?: number) {\n if(prevPos === undefined) {\n prevPos = element.parentElement === container ? whichChild(element) : -1;\n }\n\n if(prevPos === pos) {\n return false;\n } else if(prevPos !== -1 && prevPos < pos) { // was higher\n pos += 1;\n }\n\n if(!pos) {\n container.prepend(element);\n } else if(container.childElementCount > pos) {\n container.insertBefore(element, container.children[pos]);\n } else {\n container.append(element);\n }\n\n return true;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function reflowScrollableElement(element: HTMLElement) {\n element.style.display = 'none';\n void element.offsetLeft; // reflow\n element.style.display = '';\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport onMediaLoad from '../onMediaLoad';\n\n// import { getHeavyAnimationPromise } from \"../../hooks/useHeavyAnimationCheck\";\n\nexport const loadedURLs: {[url: string]: boolean} = {};\nconst set = (elem: HTMLElement | HTMLImageElement | SVGImageElement | HTMLVideoElement, url: string) => {\n if(elem instanceof HTMLImageElement || elem instanceof HTMLVideoElement) elem.src = url;\n else if(elem instanceof SVGImageElement) elem.setAttributeNS(null, 'href', url);\n else elem.style.backgroundImage = 'url(' + url + ')';\n};\n\n// проблема функции в том, что она не подходит для ссылок, пригодна только для blob'ов, потому что обычным ссылкам нужен 'load' каждый раз.\nexport default function renderImageFromUrl(\n elem: HTMLElement | HTMLImageElement | SVGImageElement | HTMLVideoElement,\n url: string,\n callback?: () => void,\n useCache = true\n) {\n if(!url) {\n console.error('renderImageFromUrl: no url?', elem, url);\n callback?.();\n return;\n }\n\n const isVideo = elem instanceof HTMLVideoElement;\n if(((loadedURLs[url]/* && false */) && useCache) || isVideo) {\n if(elem) {\n set(elem, url);\n }\n\n if(callback) {\n if(isVideo) {\n onMediaLoad(elem).then(callback);\n } else {\n callback?.();\n }\n // callback && getHeavyAnimationPromise().then(() => callback());\n }\n } else {\n const isImage = elem instanceof HTMLImageElement;\n const loader = isImage ? elem as HTMLImageElement : new Image();\n // const loader = new Image();\n loader.src = url;\n // let perf = performance.now();\n\n const onLoad = () => {\n if(!isImage && elem) {\n set(elem, url);\n }\n\n loadedURLs[url] = true;\n // console.log('onload:', url, performance.now() - perf);\n // TODO: переделать прогрузки аватаров до начала анимации, иначе с этим ожиданием они неприятно появляются\n // callback && getHeavyAnimationPromise().then(() => callback());\n callback?.();\n\n loader.removeEventListener('error', onError);\n };\n\n const onError = (err: ErrorEvent) => {\n console.error('Render image from url failed:', err, url, loader);\n loader.removeEventListener('load', onLoad);\n callback?.();\n };\n\n loader.addEventListener('load', onLoad, {once: true});\n loader.addEventListener('error', onError, {once: true});\n }\n}\n\nexport function renderImageFromUrlPromise(elem: Parameters[0], url: string, useCache?: boolean) {\n return new Promise((resolve) => {\n renderImageFromUrl(elem, url, resolve, useCache);\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport sequentialDom from '../sequentialDom';\nimport {renderImageFromUrlPromise} from './renderImageFromUrl';\n\nexport default function renderMediaWithFadeIn(\n container: HTMLElement,\n media: Parameters[0],\n url: string,\n needFadeIn: boolean,\n aspecter = container,\n thumbImage?: HTMLElement\n) {\n if(needFadeIn) {\n media.classList.add('fade-in');\n }\n\n const promise = renderImageFromUrlPromise(media, url).then(() => {\n return sequentialDom.mutateElement(container, () => {\n aspecter.append(media);\n\n if(needFadeIn) {\n media.addEventListener('animationend', () => {\n sequentialDom.mutate(() => {\n media.classList.remove('fade-in');\n thumbImage?.remove();\n });\n }, {once: true});\n } else {\n thumbImage?.remove();\n }\n });\n });\n\n // recordPromise(promise, 'renderImageWithFadeIn');\n\n return promise;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function replaceContent(elem: HTMLElement, node: string | Node) {\n if(typeof(node) === 'string') {\n elem.innerHTML = node;\n return;\n }\n\n // * children.length doesn't count text nodes\n const firstChild = elem.firstChild;\n if(firstChild) {\n if(elem.lastChild === firstChild) {\n firstChild.replaceWith(node);\n } else {\n elem.textContent = '';\n elem.append(node);\n }\n } else {\n elem.append(node);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport clamp from '../number/clamp';\nimport findUpAsChild from './findUpAsChild';\nimport whichChild from './whichChild';\n\nexport default function compareNodes(node1: ChildNode, node1Offset: number, node2: ChildNode, node2Offset: number) {\n let diff: number;\n if(node1 === node2) {\n diff = node1Offset - node2Offset;\n } else if(node1.parentElement === node2.parentElement) {\n diff = whichChild(node1, true) - whichChild(node2, true);\n } else {\n const parents: HTMLElement[] = [];\n let parentElement = node1.parentElement;\n do {\n parents.push(parentElement);\n } while(parentElement = parentElement.parentElement);\n\n parentElement = node2.parentElement;\n do {\n if(parents.includes(parentElement)) {\n break;\n }\n } while(parentElement = parentElement.parentElement);\n\n const commonAncestorContainer = parentElement;\n // const range = document.createRange();\n // range.setStart(node1, 0);\n // range.setEnd(node2, node2.textContent.length);\n // const {commonAncestorContainer} = range;\n node1 = findUpAsChild(node1 as HTMLElement, commonAncestorContainer as HTMLElement);\n node2 = findUpAsChild(node2 as HTMLElement, commonAncestorContainer as HTMLElement);\n diff = whichChild(node1, true) - whichChild(node2, true);\n }\n\n return clamp(diff, -1, 1);\n}\n\n(window as any).compareNodes = compareNodes;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {IS_FIREFOX} from '../../environment/userAgent';\nimport {logger} from '../../lib/logger';\nimport {isCustomFillerNeededBySiblingNode} from '../../lib/richTextProcessor/wrapRichText';\nimport ListenerSetter from '../listenerSetter';\nimport BOM from '../string/bom';\nimport compareNodes from './compareNodes';\nimport getCaretPosNew from './getCaretPosNew';\nimport placeCaretAtEnd from './placeCaretAtEnd';\nimport whichChild from './whichChild';\n\nconst NOT_ONLY_BOMS_REG_EXP = new RegExp(`[^${BOM}]`);\n\nexport const USING_BOMS = false;\n\nexport default class RichInputHandler {\n private static INSTANCE: RichInputHandler;\n\n private listenerSetter: ListenerSetter;\n\n private lastNode: Node;\n private lastOffset: number;\n private savedRanges: WeakMap;\n\n private log: ReturnType;\n\n private inputCaptureCallbacks: Function[];\n\n constructor() {\n this.log = logger('RICH-INPUT');\n this.listenerSetter = new ListenerSetter();\n this.savedRanges = new WeakMap();\n\n this.listenerSetter.add(document)('selectionchange', this.saveSelectionOnChange);\n if(USING_BOMS) {\n this.listenerSetter.add(document)('focusout', this.onFocusOut);\n this.listenerSetter.add(document)('selectionchange', this.onSelectionChange);\n this.listenerSetter.add(document)('beforeinput', this.onBeforeInput);\n this.listenerSetter.add(document)('keydown', this.onKeyDown, {capture: true});\n\n if(IS_FIREFOX) {\n this.inputCaptureCallbacks = [];\n this.listenerSetter.add(document)('input', () => {\n this.inputCaptureCallbacks.forEach((callback) => callback());\n this.inputCaptureCallbacks.length = 0;\n }, {capture: true});\n }\n }\n }\n\n private get input() {\n const selection = document.getSelection();\n const {anchorNode: node} = selection;\n if(!node) return;\n return ((node as HTMLElement).closest ? node as HTMLElement : node.parentElement).closest('[contenteditable=\"true\"]');\n }\n\n private saveRangeForElement(element: HTMLElement) {\n if(element && (element.isContentEditable || element.tagName === 'INPUT')) {\n const selection = document.getSelection();\n if(selection.rangeCount) {\n this.savedRanges.set(element as HTMLElement, document.getSelection().getRangeAt(0));\n }\n }\n }\n\n private saveSelectionOnChange = (e: Event) => {\n const element = document.activeElement as HTMLElement; // e.target as HTMLElement;\n this.saveRangeForElement(element);\n };\n\n private onFocusOut = (e: FocusEvent) => {\n this.lastNode = this.lastOffset = undefined;\n };\n\n private findPreviousSmthIndex(input: HTMLElement, node: ChildNode, something?: NodeListOf) {\n // node = this.getFiller(node);\n // const childNodes = Array.from(node.parentElement.childNodes);\n // fillerIndex = childNodes.indexOf(node);\n // let smthIndex = -1;\n // for(let i = fillerIndex; i >= 0; --i) {\n // const node = childNodes[i];\n // if((node as HTMLElement)?.classList?.contains('input-something')) {\n // smthIndex = i;\n // break;\n // }\n // }\n // return smthIndex;\n\n const elements = Array.from(something ?? input.querySelectorAll('.input-something'));\n const index = elements.findIndex((element) => compareNodes(element, 0, node, 0) >= 0);\n return index === -1 ? elements.length - 1 : Math.max(0, index - 1);\n }\n\n private superMove(\n input: HTMLElement,\n caret: ReturnType,\n toLeft: boolean,\n fromSelectionChange: boolean\n ) {\n const {node, offset, move} = caret;\n const something = input.querySelectorAll('.input-something');\n const smthIndex = this.findPreviousSmthIndex(input, node, something);\n const r = document.createRange();\n r[toLeft ? 'setEnd' : 'setStart'](node, offset);\n\n if(fromSelectionChange) {\n move(toLeft);\n }\n\n const c = this.getCaretPosN();\n if(c.node?.nodeValue === BOM && (!fromSelectionChange || node === this.lastNode)) {\n const idx = this.findPreviousSmthIndex(input, c.node, something);\n\n let moved = !fromSelectionChange;\n\n do {\n const c = this.getCaretPosN();\n const idxidx = this.findPreviousSmthIndex(input, c.node, something);\n r[toLeft ? 'setStart' : 'setEnd'](c.node, c.offset);\n const rangeString = r.toString();\n const onlyBOMs = !NOT_ONLY_BOMS_REG_EXP.test(rangeString);\n this.log('test cursor', rangeString, onlyBOMs, idx, idxidx);\n if(\n onlyBOMs &&\n c.node?.nodeValue === BOM &&\n idxidx === idx &&\n // (idxidx > 1 || c.offset) &&\n // (idxidx < (getFiller(c.node).parentElement.childNodes.length - 2) || c.offset < BOM.length)\n (idxidx || c.offset) &&\n (idxidx < (something.length - 1) || c.offset < BOM.length)\n ) {\n move(toLeft);\n moved = true;\n } else if(!moved) {\n break;\n } else {\n if((!this.getFiller(node as HTMLElement).classList.contains('input-filler-text') && idx !== smthIndex) || c.offset === BOM.length) {\n move(!toLeft);\n }\n\n break;\n }\n } while(true);\n }\n }\n\n private onSelectionChange = (e: Event) => {\n const {input} = this;\n if(!input) {\n this.setSelectionClassName(document.getSelection());\n return;\n }\n\n // return;\n\n // this.log('selectionchange', document.getSelection(), document.getSelection().rangeCount && document.getSelection().getRangeAt(0), getCaretPosN());\n // let {node, offset} = getCaretPos(this.messageInput);\n\n let caret = this.getCaretPosN();\n do {\n const {node, offset, selection, move} = caret;\n\n const nodeValue = node?.nodeValue;\n // if(!nodeValue?.includes(BOM)) {\n if(nodeValue !== BOM || !this.lastNode) {\n break;\n }\n\n // node = getFiller(node);\n\n // const childIndex = whichChild(getFiller(node), true);\n // let toLeft: boolean;\n // // if(node === lastNode) toLeft = lastOffset >= offset;\n // if(node === lastNode) toLeft = lastOffset > offset;\n // else {\n // // toLeft = whichChild(getFiller(lastNode)) > childIndex;\n // toLeft = (lastNode.nodeValue === BOM ? whichChild(getFiller(lastNode), true) : whichChild(findUpAsChild(lastNode as any, getFiller(node).parentElement), true)) > childIndex;\n // }\n\n const toLeft = compareNodes(node, offset, this.lastNode as ChildNode, this.lastOffset) < 0;\n\n // const childNodes = Array.from(node.parentElement.childNodes);\n // if(toLeft) {\n // for(let i = childIndex; i >= 0; --i) {\n // const sibling = childNodes[i];\n // const {textContent} = sibling;\n // for()\n // }\n // }\n\n // {\n // if(toLeft === undefined) {\n // return;\n // }\n\n // const selection = window.getSelection();\n // selection.modify(selection.isCollapsed ? 'move' : 'extend', toLeft ? 'backward' : 'forward', 'character');\n // return;\n // }\n\n // const parent = getFiller(node);\n if(toLeft !== undefined) {\n // let newNode = toLeft ? parent.previousSibling : parent.nextSibling;\n if(selection.isCollapsed) {\n this.superMove(input, caret, toLeft, true);\n\n // if(offset === BOM.length) {\n // newNode = toLeft ? newNode.nextSibling.nextSibling : parent.previousSibling.previousSibling;\n // }\n\n // setCaretAt(newNode);\n } else {\n selection.modify(selection.isCollapsed ? 'move' : 'extend', toLeft ? 'backward' : 'forward', 'character');\n // const range = selection.getRangeAt(0);\n\n // if(toLeft) {\n // newNode = parent.previousSibling.previousSibling.firstChild;\n // const value = newNode.nodeValue;\n // range.setStart(newNode, value?.length);\n // } else {\n // newNode = parent.nextSibling.nextSibling.firstChild;\n // range.setEnd(newNode, 0);\n // }\n }\n }\n\n this.log('selectionchange',\n node,\n offset,\n this.lastNode,\n this.lastOffset,\n node === this.lastNode,\n whichChild(this.getFiller(node)),\n whichChild(this.getFiller(this.lastNode)),\n toLeft,\n selection,\n document.getSelection(),\n document.getSelection().getRangeAt(0),\n node?.parentNode,\n this.lastNode?.parentNode\n );\n\n caret = this.getCaretPosN();\n this.lastNode = node;\n this.lastOffset = offset;\n\n break;\n\n // if(findPreviousSmthIndex(caret.node) !== smthIndex) {\n // break;\n // }\n } while(true);\n\n this.lastNode = this.lastOffset = undefined;\n\n // if(offset === BOM.length) {\n // setCaretAt(parent);\n // } else {\n // setCaretAt(parent.nextSibling);\n // }\n\n this.setSelectionClassName(caret.selection, input);\n };\n\n public restoreSavedRange(input: HTMLElement) {\n const range = this.getSavedRange(input);\n if(!range) {\n return false;\n }\n\n const selection = window.getSelection();\n selection.removeAllRanges();\n selection.addRange(range);\n\n return true;\n }\n\n public getSavedRange(input: HTMLElement) {\n return this.savedRanges.get(input);\n }\n\n public makeFocused(input: HTMLElement) {\n if(document.activeElement !== input && !this.restoreSavedRange(input)) {\n placeCaretAtEnd(input, false, false);\n }\n }\n\n private fixInsertedLineBreaks(input: HTMLElement) {\n input.querySelectorAll('br').forEach((br) => {\n br.classList.add('br-not-br');\n });\n }\n\n private fixBuggedCaret() {\n const selection = document.getSelection();\n const range = selection.getRangeAt(0);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n\n public onBeforeInput = (e: Pick) => {\n const {input, log} = this;\n if(!input) {\n return;\n }\n\n const addInputCallback = this.addInputCallback.bind(this, input);\n\n const caretPos = this.getCaretPosN();\n let {node, offset, selection, move} = caretPos;\n log('beforeinput', e, node, offset, selection, caretPos);\n this.lastNode = this.lastOffset = undefined;\n\n if(e.inputType.startsWith('delete')) { // delete current BOM\n addInputCallback(() => {\n this.processEmptiedFillers(input);\n this.removeExtraBOMs(input);\n this.fixInsertedLineBreaks(input);\n });\n\n if(node?.nodeValue === BOM && selection.isCollapsed && e.inputType.includes('deleteContent')) {\n const toLeft = e.inputType.includes('Backward');\n const moveFirst = (offset === BOM.length && toLeft) || (!offset && !toLeft);\n this.superMove(input, caretPos, toLeft, moveFirst);\n // if((offset === BOM.length && toLeft) || (!offset && !toLeft)) {\n // move(toLeft);\n // }\n\n // addInputCallback(() => {\n // removePossibleBOMSiblingsByNode(getFiller(node));\n // });\n\n // if(node.parentNode.childNodes.length === 1) {\n // (node.parentNode as HTMLElement).remove();\n // move(e.inputType.includes('Backward') ? false : true);\n // } else {\n // move(e.inputType.includes('Backward') ? true : false);\n // addInputCallback(() => {\n // move(e.inputType.includes('Backward') ? false : true);\n // });\n // }\n\n // for(let i = 0, length = BOM.length + (direction === 'backward' ? offset : BOM.length - offset); i < length; ++i) {\n // selection.modify('extend', direction, 'character');\n // }\n\n // selection.modify('extend', direction, 'character');\n // selection.modify('extend', direction, 'character');\n\n // selection.deleteFromDocument();\n // e.preventDefault();\n } else {\n // const filler = getFiller(node);\n // if(filler?.classList?.contains('input-filler-text')) {\n // const {previousSibling, nextSibling} = filler;\n // addInputCallback(() => {\n // if(!filler.isConnected) {\n // removePossibleBOMSiblings(previousSibling, nextSibling);\n // }\n // // removeExtraBOMs();\n // // processEmptiedFillers();\n // });\n // }\n // addInputCallback(() => {\n // this.fixInsertedLineBreaks(input);\n // });\n }\n } else if(e.inputType.startsWith('insert')) { // clear current BOM\n if((node as HTMLElement)?.classList?.contains('input-something')/* || (node.textContent === BOM && offset === BOM.length) */) {\n node = node.previousSibling.firstChild;\n const range = selection.getRangeAt(0);\n range.setStart(node, 0);\n range.setEnd(node, 0);\n range.collapse(true);\n // selection.modify('move', 'backward', 'character');\n\n const c = this.getCaretPosN();\n node = c.node;\n selection = c.selection;\n offset = c.offset;\n }\n if(node && node.textContent === BOM && offset === BOM.length) {\n // const range = selection.getRangeAt(0);\n // range.setStart(node, 0);\n // range.setEnd(node, 0);\n // range.collapse(true);\n selection.modify('move', 'backward', 'character');\n\n const c = this.getCaretPosN();\n node = c.node;\n selection = c.selection;\n offset = c.offset;\n }\n // if(node && node.textContent === BOM && offset === 0) {\n // selection.modify('move', 'forward', 'character');\n // offset = BOM.length;\n // }\n\n if(e.inputType === 'insertLineBreak' || true) {\n // const appendix = 'X';\n // const textNode = document.createTextNode(appendix);\n // if(node.parentElement !== this.messageInput) node.parentElement.after(textNode);\n // else node.after(textNode);\n // selection.modify('move', 'forward', 'character');\n // selection.modify('move', 'forward', 'character');\n // addInputCallback(() => {\n // textNode.remove();\n // });\n\n /* if(node?.nodeValue === BOM) */ {\n // const parent = node.parentElement;\n // parent.contentEditable = 'false';\n // addInputCallback(() => {\n // parent.contentEditable = 'inherit';\n // });\n // node.parentElement.remove();\n\n // const textNode = document.createTextNode(appendix);\n // if(node.parentElement !== this.messageInput) node.parentElement.after(textNode);\n // else node.after(textNode);\n // // selection.modify('move', 'forward', 'character');\n // // selection.modify('move', 'forward', 'character');\n // addInputCallback(() => {\n // textNode.remove();\n // });\n\n // fix case when focused somehow on span instead of text node\n if(node && node.nodeType === node.ELEMENT_NODE) {\n node = node.firstChild;\n log.warn('fixing focus on span');\n }\n\n const isBOM = node?.nodeValue === BOM;\n log('inserting line break', isBOM, node, `\"${node?.nodeValue}\"`, node?.parentElement ? Array.from(node.parentElement.childNodes).slice() : []);\n if(isBOM) {\n // (node as ChildNode).replaceWith(this.messageInput.querySelector('.lol'));\n\n const parentElement = node.parentElement;\n parentElement.classList.replace('input-filler', 'input-filler-text');\n const childNodesLength = parentElement.childNodes.length;\n addInputCallback(() => {\n const newChildNodesLength = parentElement.childNodes.length;\n if(newChildNodesLength > 1/* && newChildNodesLength !== childNodesLength */) {\n log('inserting line break, remove');\n node = Array.from(parentElement.childNodes).find((node) => node.nodeValue === BOM);\n (parentElement as any).t = node;\n // node?.remove();\n\n // const n = parentElement.firstChild;\n // const range = selection.getRangeAt(0);\n // range.setStart(n, n.nodeValue.length);\n // range.setEnd(n, n.nodeValue.length);\n } else if(node.nodeValue !== BOM) {\n log('inserting line break, deleteData');\n (node as CharacterData).deleteData(node.nodeValue.indexOf(BOM), BOM.length);\n // node = document.createTextNode(BOM);\n }\n\n this.fixInsertedLineBreaks(input);\n // (parentElement as any).t = node;\n // node.remove();\n });\n // addInputCallback(() => {\n // node.parentElement.classList.replace('input-filler', 'input-filler3');\n // const s = document.createElement('span');\n // s.style.display = 'none';\n // node.replaceWith(s);\n // s.prepend(node);\n // });\n } else if(e.inputType === 'insertLineBreak') {\n addInputCallback(() => {\n this.fixInsertedLineBreaks(input);\n });\n // const range = selection.getRangeAt(0);\n // this.messageInput.querySelectorAll('.input-something').forEach((el) => {\n // el.contentEditable = 'inherit';\n // });\n\n // addInputCallback(() => {\n // this.messageInput.querySelectorAll('.input-something').forEach((el) => {\n // el.contentEditable = 'false';\n // });\n\n // selection.removeAllRanges();\n // selection.addRange(range);\n // }, false);\n }/* else if(node &&\n node.nodeType === node.TEXT_NODE &&\n node.nodeValue.length === offset) {\n\n } */\n\n // if(e.inputType === 'insertLineBreak') {\n // e.preventDefault();\n // document.execCommand('insertHTML', false, '\\n');\n\n // this.messageInputField.simulateInputEvent();\n // }\n\n // node.parentElement.replaceWith(node);\n // selection.removeAllRanges();\n // const range = new Range();\n // range.setStart(node, 0);\n // range.setEnd(node, node.nodeValue.length);\n // selection.addRange(range);\n // node.parentElement.classList.remove('input-filler');\n // node.parentElement\n }\n\n // document.execCommand('insertHTML', false, '\\n');\n // e.preventDefault();\n // (node as CharacterData).deleteData(node.nodeValue.indexOf(BOM), BOM.length);\n // if(node?.nodeValue === BOM) {\n // addInputCallback(() => {\n // node.remove();\n // });\n // }\n // this.messageInputField.simulateInputEvent();\n\n // this.messageInput.querySelectorAll('.input-something').forEach((el) => {\n // el.contentEditable = 'inherit';\n // });\n // addInputCallback(() => {\n // this.messageInput.querySelectorAll('.input-something').forEach((el) => {\n // el.contentEditable = 'false';\n // });\n // });\n return;\n }\n\n if(node?.nodeValue === BOM) {\n // node.nodeValue = ''; // ! will move cursor forward\n // addInputCallback(() => {\n // (node as CharacterData).deleteData(node.nodeValue.indexOf(BOM), BOM.length);\n // });\n\n if(e.inputType === 'insertLineBreak') {\n if(offset === BOM.length) {\n selection.modify('move', 'backward', 'character');\n }\n\n // if(offset !== BOM.length) {\n // selection.modify('move', 'forward', 'character');\n // }\n\n addInputCallback(() => {\n node.remove();\n // (node as CharacterData).deleteData(node.nodeValue.indexOf(BOM), BOM.length);\n // selection.modify('move', 'forward', 'character');\n\n setTimeout(() => {\n selection.modify('move', 'forward', 'character');\n }, 0);\n });\n }\n\n // node.parentElement.replaceWith(node);\n\n // node.parentElement.replaceWith(node);\n if(e.inputType === 'insertLineBreak') {\n // const previousParentSibling = node.parentNode.previousSibling;\n // addInputCallback(() => {\n // if(previousParentSibling.nextSibling.nodeValue === '\\n') {\n // previousParentSibling.nextSibling.remove();\n\n // setTimeout(() => {\n // // selection.modify('move', 'forward', 'character');\n // // selection.modify('move', 'forward', 'character');\n // }, 0);\n // } else {\n // previousParentSibling.nextSibling.nodeValue = previousParentSibling.nextSibling.nodeValue.replace('\\n\\n', '\\n');\n // }\n // });\n } else {\n // if(node.parentElement !== this.messageInput) {\n // node.parentElement.replaceWith(node);\n // }\n\n // setTimeout(() => {\n // this.log(JSON.stringify(node.parentElement.innerHTML));\n // node.nodeValue = node.nodeValue.replace(BOM, '');\n // // (node as CharacterData).deleteData(node.nodeValue.indexOf(BOM), BOM.length);\n // this.log(JSON.stringify(node.parentElement.innerHTML));\n // }, 1000);\n\n addInputCallback(() => {\n (node as CharacterData).deleteData(node.nodeValue.indexOf(BOM), BOM.length);\n if(!node.nodeValue) {\n node.remove();\n }\n\n // selection.modify('move', 'forward', 'character');\n });\n }\n\n if(selection.isCollapsed && false) {\n node.parentElement.replaceWith(node);\n // const textNode = document.createTextNode(BOM);\n // (node.parentNode as any as ChildNode).after(textNode);\n // setCaretAt(textNode.nextSibling);\n // selection.modify('move', 'forward', 'character');\n node.remove();\n // (node as CharacterData).deleteData(node.nodeValue.indexOf(BOM), BOM.length);\n // selection.modify('move', 'forward', 'character');\n // selection.collapseToEnd();\n\n // addInputCallback(() => {\n // (textNode as CharacterData).deleteData(textNode.nodeValue.indexOf(BOM), BOM.length);\n // node.parentElement.remove();\n // });\n }\n } else if(e.inputType === 'insertLineBreak' &&\n node &&\n node.nodeType === node.TEXT_NODE &&\n node.nodeValue.length === offset) {\n log('inserting line break');\n // const appendix = '\\x01';\n\n input.querySelectorAll('.input-something').forEach((el) => {\n el.contentEditable = 'inherit';\n });\n addInputCallback(() => {\n input.querySelectorAll('.input-something').forEach((el) => {\n el.contentEditable = 'false';\n });\n });\n\n // const textNode = document.createTextNode(appendix);\n // if(node.parentElement !== this.messageInput) node.parentElement.after(textNode);\n // else node.after(textNode);\n // // selection.modify('move', 'forward', 'character');\n // addInputCallback(() => {\n // textNode.remove();\n // });\n\n // const offset = node.nodeValue.length;\n // (node as CharacterData).insertData(offset, appendix);\n // addInputCallback(() => {\n // selection.modify('move', 'forward', 'character');\n // (node as CharacterData).deleteData(node.nodeValue.indexOf(appendix), appendix.length);\n // if(!node.nodeValue) {\n // node.remove();\n // }\n // });\n }\n } else if(e.inputType === 'historyUndo') { // have to remove extra BOMs\n addInputCallback(() => {\n this.processFilledFillers(input);\n this.processEmptiedFillers(input);\n this.removeExtraBOMs(input);\n this.removeEmptyTextNodes(input);\n\n // ! lol what, caret will be at the wrong position, have to set it to the same\n this.fixBuggedCaret();\n\n // lol\n // this.messageInput.querySelectorAll('.has-text').forEach((el) => {\n // if(el.textContent === BOM) {\n // el.firstElementChild.replaceWith(el.firstElementChild.firstChild);\n // el.classList.replace('input-filler3', 'input-filler');\n // }\n // });\n });\n } else if(e.inputType === 'historyRedo') {\n // if(node?.nodeValue === BOM && offset === BOM.length) {\n // selection.modify('move', 'backward', 'character');\n // }\n\n addInputCallback(() => {\n this.processFilledFillers(input);\n this.processEmptiedFillers(input);\n\n // fix contenteditable attribute\n input.querySelectorAll('.input-something:not([contenteditable])').forEach((el) => {\n el.contentEditable = 'false';\n });\n\n this.removeExtraBOMs(input);\n\n // ! lol what, caret will be at the wrong position, have to set it to the same\n this.fixBuggedCaret();\n });\n }\n };\n\n private onKeyDown = (e: KeyboardEvent) => {\n const key = e.key;\n\n // // have to ignore line up and down\n if(key === 'ArrowDown' || key === 'ArrowUp') {\n this.lastNode = this.lastOffset = undefined;\n } else {\n const {node, offset} = this.getCaretPosN();\n this.lastNode = node/* getFiller(node) */, this.lastOffset = offset;\n if(this.lastNode === this.input) {\n this.lastNode = this.lastOffset = undefined;\n }\n }\n\n this.log('keydown', this.lastNode, this.lastNode?.parentNode, this.lastOffset, this.getCaretPosN(), e);\n };\n\n private addInputCallback(input: HTMLElement, callback: () => void, capture = true) {\n const newCallback = () => {\n this.log('input modify callback');\n callback();\n };\n\n if(capture && IS_FIREFOX) this.inputCaptureCallbacks.push(newCallback);\n else this.listenerSetter.add(input)('input', newCallback, {once: true, capture});\n }\n\n public removeExtraBOMs(input: HTMLElement) {\n const c = (sibling: ChildNode) => {\n return (sibling as HTMLElement)?.classList?.contains('input-something');\n };\n\n input.querySelectorAll('.input-filler').forEach((el) => {\n const {previousSibling, nextSibling} = el;\n let needed = false;\n\n // if(!(previousSibling as HTMLElement)?.classList?.contains('input-filler') && isCustomFillerNeededBySiblingNode(previousSibling)) {\n if(!(nextSibling as HTMLElement)?.classList?.contains('input-filler') && isCustomFillerNeededBySiblingNode(nextSibling)) {\n needed = c(previousSibling) || c(nextSibling);\n }\n\n if(!needed) {\n this.log.warn('removing empty bom node', el);\n el.remove();\n }\n });\n }\n\n private getFiller(node: Node) {\n return node && node.nodeType === node.TEXT_NODE && node.parentElement !== this.input ? node.parentElement : node as HTMLElement;\n }\n\n private getCaretPosN() {\n const ret = getCaretPosNew(this.input);\n // const {node} = ret;\n // if((node as HTMLElement)?.classList?.contains('input-something')) {\n // ret.node = node.previousSibling;\n // ret.offset = ret.node.textContent.length;\n // }\n\n return {...ret, move: this.move.bind(this, ret.selection)};\n }\n\n private removeEmptyTextNodes(input: HTMLElement) {\n const {log} = this;\n // let i = -1;\n // remove empty text nodes\n const treeWalker = document.createTreeWalker(\n input,\n NodeFilter.SHOW_TEXT,\n {acceptNode: (node) => node.parentElement === input && !node.nodeValue/* && !++i */ ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT}\n );\n\n let textNode: Text;\n while(textNode = treeWalker.nextNode() as Text) {\n log.warn('removing empty text node', textNode);\n textNode.remove();\n }\n }\n\n private removePossibleBOMSiblings(previousSibling: ChildNode, nextSibling: ChildNode) {\n [previousSibling, nextSibling].forEach((sibling) => {\n if((sibling as HTMLElement)?.classList?.contains('input-filler')) {\n sibling.remove();\n }\n });\n }\n\n private removePossibleBOMSiblingsByNode(node: ChildNode) {\n const {previousSibling, nextSibling} = node;\n this.removePossibleBOMSiblings(previousSibling, nextSibling);\n };\n\n private processEmptiedFillers(input: HTMLElement) {\n input.querySelectorAll('.input-filler-text').forEach((el) => {\n this.removeExtraBOMs(el);\n\n let cleanSiblings = true;\n if(!el.textContent) {\n el.classList.replace('input-filler-text', 'input-filler');\n\n const textNode = Array.from(el.childNodes).find((node) => node.nodeType === node.TEXT_NODE);\n if(textNode) {\n (textNode as CharacterData).insertData(0, BOM);\n } else if(((el as any).t as ChildNode)?.nodeValue) {\n el.append((el as any).t);\n } else {\n el.append(document.createTextNode(BOM));\n }\n } else if(!NOT_ONLY_BOMS_REG_EXP.test(el.textContent) && !el.querySelector('.input-something')) {\n el.classList.replace('input-filler-text', 'input-filler');\n } else {\n cleanSiblings = false;\n }\n\n if(cleanSiblings) {\n this.removePossibleBOMSiblingsByNode(el);\n }\n });\n }\n\n private processFilledFillers(input: HTMLElement) {\n // remove the BOM when changing to text\n input.querySelectorAll('.input-filler').forEach((el) => {\n if(el.textContent !== BOM) {\n el.classList.replace('input-filler', 'input-filler-text');\n const t = (el as any).t as ChildNode;\n const bomNode = Array.from(el.childNodes).find((node) => node.nodeType === node.TEXT_NODE && node.nodeValue.includes(BOM));\n if(bomNode && !t?.nodeValue) {\n const idx = bomNode.nodeValue.indexOf(BOM);\n if(idx !== -1) {\n (bomNode as CharacterData).deleteData(idx, BOM.length);\n }\n }\n\n // t?.remove();\n }\n });\n }\n\n private setSelectionClassName(selection: Selection, input?: HTMLElement) {\n // Array.from(this.messageInput.querySelectorAll('.selection')).forEach((element) => {\n // element.classList.remove('selection');\n // });\n\n if(selection.rangeCount) {\n const range = selection.getRangeAt(0);\n\n if(input) {\n Array.from(input.querySelectorAll('.input-selectable')).forEach((element) => {\n element.classList.toggle('selection', !range.collapsed && range.intersectsNode(element));\n });\n } else {\n Array.from(document.querySelectorAll('.input-selectable.selection')).forEach((element) => element.classList.remove('selection'));\n }\n }\n }\n\n private move(selection: Selection, left: boolean) {\n const {focusNode: focusNodeBefore, focusOffset: focusOffsetBefore} = selection;\n selection.modify('extend', left ? 'backward' : 'forward', 'character');\n // if(offset === nodeValue.length) {\n // selection.modify('extend', !left ? 'backward' : 'forward', 'character');\n // }\n if(left) selection.collapseToStart();\n else selection.collapseToEnd();\n const {focusNode: focusNodeAfter, focusOffset: focusOffsetAfter} = selection;\n this.log(\n 'moving cursor',\n left,\n focusNodeBefore,\n focusNodeBefore.nodeType === focusNodeBefore.ELEMENT_NODE ? focusNodeBefore : focusNodeBefore.parentElement,\n focusOffsetBefore,\n focusNodeAfter,\n focusNodeAfter.nodeType === focusNodeAfter.ELEMENT_NODE ? focusNodeAfter : focusNodeAfter.parentElement,\n focusOffsetAfter\n );\n }\n\n public prepareApplyingMarkdown() {\n const {input} = this;\n\n // do not wrap fillers into spans\n const fillers = input.querySelectorAll('.input-filler');\n // fillers.forEach((el) => {\n // el.contentEditable = 'false';\n // });\n\n const smths = input.querySelectorAll('.input-something');\n smths.forEach((el) => {\n el.contentEditable = 'inherit';\n });\n\n return () => {\n fillers.forEach((el) => {\n el.contentEditable = 'inherit';\n });\n\n smths.forEach((el) => {\n el.contentEditable = 'false';\n });\n\n this.removeExtraBOMs(input);\n };\n }\n\n public static getInstance() {\n return this.INSTANCE ??= new RichInputHandler();\n }\n}\n","import rootScope from '../../lib/rootScope';\nimport liteMode from '../liteMode';\n\nexport default function shake(element: HTMLElement) {\n if(!liteMode.isAvailable('animations')) {\n return;\n }\n\n const keyframes: Keyframe[] = [\n {transform: 'translateX(0)'},\n {transform: 'translateX(.25rem)'},\n {transform: 'translateX(-.25rem)'},\n {transform: 'translateX(0)'}\n ];\n\n element.animate([...keyframes, ...keyframes, ...keyframes], {\n duration: 300,\n iterations: 1,\n easing: 'ease-in-out'\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {ScrollableBase} from '../../components/scrollable';\nimport SwipeHandler from '../../components/swipeHandler';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport rootScope from '../../lib/rootScope';\nimport liteMode from '../liteMode';\nimport {Middleware} from '../middleware';\nimport clamp from '../number/clamp';\nimport safeAssign from '../object/safeAssign';\nimport pause from '../schedulers/pause';\nimport cancelEvent from './cancelEvent';\nimport {attachClickEvent} from './clickEvent';\nimport findUpAsChild from './findUpAsChild';\nimport positionElementByIndex from './positionElementByIndex';\nimport whichChild from './whichChild';\n\nexport default class Sortable {\n private element: HTMLElement;\n private elementRect: DOMRect;\n private containerRect: DOMRect;\n private scrollableRect: DOMRect;\n private minY: number;\n private maxY: number;\n private siblings: HTMLElement[];\n private swipeHandler: SwipeHandler;\n private startScrollPos: number;\n private addScrollPos: number;\n\n private list: HTMLElement;\n private middleware: Middleware;\n private onSort: (prevIdx: number, newIdx: number) => void;\n private scrollable: ScrollableBase;\n\n constructor(options: {\n list: HTMLElement,\n middleware: Middleware,\n onSort: Sortable['onSort'],\n scrollable?: Sortable['scrollable']\n }) {\n safeAssign(this, options);\n\n this.swipeHandler = new SwipeHandler({\n element: this.list,\n onSwipe: this.onSwipe,\n verifyTouchTarget: this.verifyTouchTarget,\n onStart: this.onStart,\n onReset: this.onReset,\n setCursorTo: document.body,\n middleware: this.middleware,\n withDelay: true\n });\n }\n\n private onSwipe = (xDiff: number, yDiff: number) => {\n yDiff = clamp(yDiff, this.minY, this.maxY);\n this.element.style.transform = `translateY(${yDiff}px)`;\n const count = Math.round(Math.abs(yDiff) / this.elementRect.height);\n const lastSiblings = this.siblings;\n this.siblings = [];\n const property = yDiff < 0 ? 'previousElementSibling' : 'nextElementSibling';\n let sibling = this.element[property] as HTMLElement;\n for(let i = 0; i < count; ++i) {\n if(this.getSortableTarget(sibling)) {\n this.siblings.push(sibling);\n sibling = sibling[property] as HTMLElement;\n } else {\n break;\n }\n }\n\n (lastSiblings || []).forEach((sibling) => {\n if(!this.siblings.includes(sibling)) {\n sibling.style.transform = '';\n }\n });\n\n this.siblings.forEach((sibling) => {\n const y = this.elementRect.height * (yDiff < 0 ? 1 : -1);\n sibling.style.transform = `translateY(${y}px)`;\n });\n\n if(this.scrollableRect) {\n const diff = yDiff;\n const toEnd = diff > 0;\n const elementEndPos = toEnd ? this.elementRect.bottom : this.elementRect.top;\n const clientY = elementEndPos + diff - this.addScrollPos;\n // console.log(clientY, this.scrollableRect.top, elementEndPos, diff, this.addScrollPos, toEnd);\n let change = 2;\n if((clientY + (toEnd ? 0 : this.elementRect.height)) >= this.scrollableRect.bottom/* && diff < this.maxY */) {\n\n } else if((clientY - (toEnd ? this.elementRect.height : 0)) <= this.scrollableRect.top/* && diff > this.minY */) {\n change *= -1;\n } else {\n change = undefined;\n }\n\n if(change !== undefined) {\n this.scrollable.container[this.scrollable.scrollProperty] += change;\n }\n }\n };\n\n private verifyTouchTarget = (e: {target: EventTarget}) => {\n if(this.list.classList.contains('is-reordering')) {\n return false;\n }\n\n this.element = this.getSortableTarget(e.target as HTMLElement);\n return !!this.element/* && pause(150).then(() => true) */;\n };\n\n private onScroll = () => {\n const scrollPos = this.scrollable.container[this.scrollable.scrollProperty];\n const diff = this.addScrollPos = scrollPos - this.startScrollPos;\n const isVertical = this.scrollable.scrollProperty === 'scrollTop';\n this.swipeHandler.add(isVertical ? 0 : diff, isVertical ? diff : 0);\n };\n\n private onStart = () => {\n this.list.classList.add('is-reordering');\n this.element.classList.add('is-dragging', 'no-transition');\n this.swipeHandler.setCursor('grabbing');\n this.elementRect = this.element.getBoundingClientRect();\n this.containerRect = this.list.getBoundingClientRect();\n\n this.minY = this.containerRect.top - this.elementRect.top;\n this.maxY = this.containerRect.bottom - this.elementRect.bottom;\n this.addScrollPos = 0;\n\n if(this.scrollable) {\n this.startScrollPos = this.scrollable.container[this.scrollable.scrollProperty];\n this.scrollableRect = this.scrollable.container.getBoundingClientRect();\n this.scrollable.container.addEventListener('scroll', this.onScroll);\n }\n };\n\n private onReset = async() => {\n const length = this.siblings.length;\n const move = length && length * (this.siblings[0].previousElementSibling === this.element ? 1 : -1);\n const idx = whichChild(this.element);\n const newIdx = idx + move;\n\n this.element.classList.remove('no-transition');\n this.element.style.transform = move ? `translateY(${move * this.elementRect.height}px)` : '';\n this.swipeHandler.setCursor('');\n\n if(this.scrollable) {\n this.scrollable.container.removeEventListener('scroll', this.onScroll);\n }\n\n if(!IS_TOUCH_SUPPORTED) {\n attachClickEvent(document.body, cancelEvent, {capture: true, once: true});\n }\n\n if(liteMode.isAvailable('animations')) {\n await pause(250);\n }\n\n this.list.classList.remove('is-reordering');\n this.element.classList.remove('is-dragging');\n positionElementByIndex(this.element, this.list, newIdx, idx);\n [this.element, ...this.siblings].forEach((element) => {\n element.style.transform = '';\n });\n\n this.element =\n this.siblings =\n this.elementRect =\n this.containerRect =\n this.minY =\n this.maxY =\n this.startScrollPos =\n this.addScrollPos =\n undefined;\n\n // cancelClick = true;\n\n if(!move) {\n return;\n }\n\n this.onSort(idx, newIdx);\n };\n\n private getSortableTarget(target: HTMLElement) {\n if(!target) {\n return;\n }\n\n let child = findUpAsChild(target as HTMLElement, this.list);\n if(child && child.classList.contains('cant-sort')) {\n child = undefined;\n }\n\n return child;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function toggleDisability(elements: HTMLElement[], disable: boolean): () => void {\n if(disable) {\n elements.forEach((el) => el.setAttribute('disabled', 'true'));\n } else {\n elements.forEach((el) => el.removeAttribute('disabled'));\n }\n\n return () => toggleDisability(elements, !disable);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function whichChild(elem: Node, countNonElements?: boolean) {\n if(!elem.parentNode) {\n return -1;\n }\n\n if(countNonElements) {\n return Array.from(elem.parentNode.childNodes).indexOf(elem as ChildNode);\n }\n\n let i = 0;\n // @ts-ignore\n while((elem = elem.previousElementSibling) !== null) ++i;\n return i;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from './dom/clickEvent';\nimport findUpAsChild from './dom/findUpAsChild';\nimport EventListenerBase from './eventListenerBase';\nimport ListenerSetter from './listenerSetter';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport safeAssign from './object/safeAssign';\nimport appNavigationController, {NavigationItem} from '../components/appNavigationController';\nimport findUpClassName from './dom/findUpClassName';\nimport rootScope from '../lib/rootScope';\nimport liteMode from './liteMode';\n\nconst KEEP_OPEN = false;\nconst TOGGLE_TIMEOUT = 200;\nconst ANIMATION_DURATION = 200;\n\nexport type IgnoreMouseOutType = 'click' | 'menu' | 'popup';\ntype DropdownHoverTimeoutType = 'toggle' | 'done';\n\nexport default class DropdownHover extends EventListenerBase<{\n open: () => Promise | void,\n openAfterLayout: () => void,\n opened: () => any,\n close: () => any,\n closed: () => any\n}> {\n protected element: HTMLElement;\n protected forceClose: boolean;\n protected inited: boolean;\n protected ignoreMouseOut: Set;\n protected ignoreButtons: Set;\n protected navigationItem: NavigationItem;\n protected ignoreOutClickClassName: string;\n protected timeouts: {[type in DropdownHoverTimeoutType]?: number};\n protected detachClickEvent: () => void;\n\n constructor(options: {\n element: DropdownHover['element'],\n ignoreOutClickClassName?: string\n }) {\n super(false);\n safeAssign(this, options);\n this.forceClose = false;\n this.inited = false;\n this.ignoreMouseOut = new Set();\n this.ignoreButtons = new Set();\n this.timeouts = {};\n }\n\n public attachButtonListener(\n button: HTMLElement,\n listenerSetter: ListenerSetter\n ) {\n let firstTime = true;\n if(IS_TOUCH_SUPPORTED) {\n attachClickEvent(button, () => {\n if(firstTime) {\n firstTime = false;\n this.toggle(true);\n } else {\n this.toggle();\n }\n }, {listenerSetter});\n } else {\n listenerSetter.add(button)('mouseover', (e) => {\n if(firstTime) {\n listenerSetter.add(button)('mouseout', (e) => {\n this.clearTimeout('toggle');\n this.onMouseOut(e);\n });\n firstTime = false;\n }\n\n this.setTimeout('toggle', () => {\n this.toggle(true);\n }, TOGGLE_TIMEOUT);\n });\n\n attachClickEvent(button, () => {\n const type: IgnoreMouseOutType = 'click';\n const ignore = !this.ignoreMouseOut.has(type);\n\n if(ignore && !this.ignoreMouseOut.size) {\n this.ignoreButtons.add(button);\n setTimeout(() => {\n this.detachClickEvent = attachClickEvent(window, this.onClickOut, {capture: true});\n }, 0);\n }\n\n this.setIgnoreMouseOut(type, ignore);\n this.toggle(ignore);\n }, {listenerSetter});\n }\n }\n\n protected onClickOut = (e: MouseEvent) => {\n const target = e.target as HTMLElement;\n if(\n !findUpAsChild(target, this.element) &&\n !Array.from(this.ignoreButtons).some((button) => findUpAsChild(target, button) || target === button) &&\n this.ignoreMouseOut.size <= 1 &&\n (!this.ignoreOutClickClassName || !findUpClassName(target, this.ignoreOutClickClassName))\n ) {\n this.toggle(false);\n }\n };\n\n protected onMouseOut = (e: MouseEvent) => {\n if(KEEP_OPEN || !this.isActive()) return;\n this.clearTimeout('toggle');\n\n if(this.ignoreMouseOut.size) {\n return;\n }\n\n const toElement = (e as any).toElement as HTMLElement;\n if(toElement && findUpAsChild(toElement, this.element)) {\n return;\n }\n\n this.setTimeout('toggle', () => {\n this.toggle(false);\n }, TOGGLE_TIMEOUT);\n };\n\n protected clearTimeout(type: DropdownHoverTimeoutType) {\n if(this.timeouts[type] !== undefined) {\n clearTimeout(this.timeouts[type]);\n delete this.timeouts[type];\n }\n }\n\n protected setTimeout(type: DropdownHoverTimeoutType, cb: () => void, timeout: number) {\n this.clearTimeout(type);\n this.timeouts[type] = window.setTimeout(() => {\n this.clearTimeout(type);\n cb();\n }, timeout);\n }\n\n public init() {\n if(!IS_TOUCH_SUPPORTED) {\n this.element.onmouseout = this.onMouseOut;\n this.element.onmouseover = (e) => {\n if(this.forceClose) {\n return;\n }\n\n // console.log('onmouseover element');\n this.clearTimeout('toggle');\n };\n }\n }\n\n public toggle = async(enable?: boolean) => {\n // if(!this.element) return;\n const willBeActive = (!!this.element.style.display && enable === undefined) || enable;\n if(this.init) {\n if(willBeActive) {\n this.init();\n this.init = null;\n } else {\n return;\n }\n }\n\n if(willBeActive === this.isActive()) {\n return;\n }\n\n const delay = IS_TOUCH_SUPPORTED || !liteMode.isAvailable('animations') ? 0 : ANIMATION_DURATION;\n if((this.element.style.display && enable === undefined) || enable) {\n const res = this.dispatchResultableEvent('open');\n await Promise.all(res);\n\n this.element.style.display = '';\n void this.element.offsetLeft; // reflow\n this.element.classList.add('active');\n\n this.dispatchEvent('openAfterLayout');\n\n appNavigationController.pushItem(this.navigationItem = {\n type: 'dropdown',\n onPop: () => {\n this.toggle(false);\n }\n });\n\n this.clearTimeout('toggle');\n this.setTimeout('done', () => {\n this.forceClose = false;\n this.dispatchEvent('opened');\n }, delay);\n\n // ! can't use together with resizeObserver\n /* if(isTouchSupported) {\n const height = this.element.scrollHeight + appImManager.chat.input.inputContainer.scrollHeight - 10;\n console.log('[ESG]: toggle: enable height', height);\n appImManager.chat.bubbles.scrollable.scrollTop += height;\n } */\n\n /* if(touchSupport) {\n this.restoreScroll();\n } */\n } else {\n this.dispatchEvent('close');\n this.ignoreMouseOut.clear();\n this.ignoreButtons.clear();\n\n this.element.classList.remove('active');\n\n appNavigationController.removeItem(this.navigationItem);\n this.detachClickEvent?.();\n this.detachClickEvent = undefined;\n\n this.clearTimeout('toggle');\n this.setTimeout('done', () => {\n this.element.style.display = 'none';\n this.forceClose = false;\n this.dispatchEvent('closed');\n }, delay);\n\n /* if(isTouchSupported) {\n const scrollHeight = this.container.scrollHeight;\n if(scrollHeight) {\n const height = this.container.scrollHeight + appImManager.chat.input.inputContainer.scrollHeight - 10;\n appImManager.chat.bubbles.scrollable.scrollTop -= height;\n }\n } */\n\n /* if(touchSupport) {\n this.restoreScroll();\n } */\n }\n\n // animationIntersector.checkAnimations(false, EMOTICONSSTICKERGROUP);\n };\n\n public isActive() {\n return this.element.classList.contains('active');\n }\n\n public setIgnoreMouseOut(type: IgnoreMouseOutType, ignore: boolean) {\n ignore ? this.ignoreMouseOut.add(type) : this.ignoreMouseOut.delete(type);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// * Jolly Cobra's fastSmoothScroll slightly patched\n\nimport {dispatchHeavyAnimationEvent} from '../hooks/useHeavyAnimationCheck';\nimport {fastRafPromise} from './schedulers';\nimport {animateSingle, cancelAnimationByKey} from './animation';\nimport rootScope from '../lib/rootScope';\nimport isInDOM from './dom/isInDOM';\nimport liteMode from './liteMode';\n\nconst MIN_JS_DURATION = 250;\nconst MAX_JS_DURATION = 600;\nconst LONG_TRANSITION_MAX_DISTANCE = 1500;\nconst SHORT_TRANSITION_MAX_DISTANCE = 500;\n\nexport enum FocusDirection {\n Up,\n Down,\n Static,\n};\n\nexport type ScrollGetNormalSizeCallback = (options: {rect: DOMRect}) => number;\nexport type ScrollGetElementPositionCallback = (options: {elementRect: DOMRect, containerRect: DOMRect, elementPosition: number}) => number;\nexport type ScrollStartCallbackDimensions = {\n scrollSize: number,\n scrollPosition: number,\n distanceToEnd: number,\n path: number,\n duration: number,\n containerRect: DOMRect,\n elementRect: DOMRect,\n getProgress: () => number\n};\n\nexport type ScrollOptions = {\n container: HTMLElement,\n element: HTMLElement,\n position: ScrollLogicalPosition,\n margin?: number,\n maxDistance?: number,\n forceDirection?: FocusDirection,\n forceDuration?: number,\n axis?: 'x' | 'y',\n getNormalSize?: ScrollGetNormalSizeCallback,\n getElementPosition?: ScrollGetElementPositionCallback,\n fallbackToElementStartWhenCentering?: HTMLElement,\n startCallback?: (dimensions: ScrollStartCallbackDimensions) => void,\n transitionFunction?: (value: number) => number\n};\n\nexport default function fastSmoothScroll(options: ScrollOptions) {\n options.margin ??= 0;\n options.maxDistance ??= LONG_TRANSITION_MAX_DISTANCE;\n options.axis ??= 'y';\n // return;\n\n if(!liteMode.isAvailable('animations') || options.forceDuration === 0) {\n options.forceDirection = FocusDirection.Static;\n }\n\n if(options.forceDirection === FocusDirection.Static) {\n options.forceDuration = 0;\n return scrollWithJs(options);\n /* return Promise.resolve();\n\n element.scrollIntoView({ block: position });\n\n cancelAnimationByKey(container);\n return Promise.resolve(); */\n }\n\n const promise = fastRafPromise().then(() => scrollWithJs(options));\n\n return options.axis === 'y' ? dispatchHeavyAnimationEvent(promise) : promise;\n}\n\nfunction scrollWithJs(options: ScrollOptions): Promise {\n const {element, container, getNormalSize, getElementPosition, transitionFunction, axis, margin, position, forceDirection, maxDistance, forceDuration} = options;\n if(!isInDOM(element)) {\n cancelAnimationByKey(container);\n return Promise.resolve();\n }\n\n const rectStartKey = axis === 'y' ? 'top' : 'left';\n const rectEndKey = axis === 'y' ? 'bottom' : 'right';\n const sizeKey = axis === 'y' ? 'height' : 'width';\n const scrollSizeKey = axis === 'y' ? 'scrollHeight' : 'scrollWidth';\n const elementScrollSizeKey = axis === 'y' ? 'scrollHeight' : 'offsetWidth'; // can use offsetWidth for X, since it's almost same as scrollWidth\n const scrollPositionKey = axis === 'y' ? 'scrollTop' : 'scrollLeft';\n\n // const { offsetTop: elementTop, offsetHeight: elementHeight } = element;\n const elementRect = element.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect ? container.getBoundingClientRect() : document.body.getBoundingClientRect();\n\n // const transformable = container.firstElementChild as HTMLElement;\n\n const possibleElementPosition = elementRect[rectStartKey] - containerRect[rectStartKey];\n const elementPosition = getElementPosition ? getElementPosition({elementRect, containerRect, elementPosition: possibleElementPosition}) : possibleElementPosition;\n const elementSize = element[elementScrollSizeKey]; // margin is exclusive in DOMRect\n\n const containerSize = getNormalSize ? getNormalSize({rect: containerRect}) : containerRect[sizeKey];\n\n let scrollPosition = container[scrollPositionKey];\n const scrollSize = container[scrollSizeKey];\n /* const elementPosition = element.offsetTop;\n const elementSize = element.offsetHeight;\n\n const scrollPosition = container[scrollPositionKey];\n const scrollSize = container[scrollSizeKey];\n const containerSize = container.offsetHeight; */\n\n let path!: number;\n\n switch(position) {\n case 'start':\n path = elementPosition - margin;\n break;\n case 'end':\n path = elementRect[rectEndKey] /* + (elementSize - elementRect[sizeKey]) */ - containerRect[rectEndKey] + margin;\n break;\n // 'nearest' is not supported yet\n case 'nearest':\n case 'center':\n if(elementSize < containerSize) {\n path = (elementPosition + elementSize / 2) - (containerSize / 2);\n } else {\n if(options.fallbackToElementStartWhenCentering && options.fallbackToElementStartWhenCentering !== element) {\n options.element = options.fallbackToElementStartWhenCentering;\n options.position = 'start';\n return scrollWithJs(options);\n }\n\n path = elementPosition - margin;\n }\n\n break;\n }\n /* switch (position) {\n case 'start':\n path = (elementPosition - margin) - scrollPosition;\n break;\n case 'end':\n path = (elementPosition + elementSize + margin) - (scrollPosition + containerSize);\n break;\n // 'nearest' is not supported yet\n case 'nearest':\n case 'center':\n path = elementSize < containerSize\n ? (elementPosition + elementSize / 2) - (scrollPosition + containerSize / 2)\n : (elementPosition - margin) - scrollPosition;\n break;\n } */\n\n if(Math.abs(path - (margin || 0)) < 1) {\n cancelAnimationByKey(container);\n return Promise.resolve();\n }\n\n if(axis === 'y') {\n if(forceDirection === undefined) {\n if(path > maxDistance) {\n scrollPosition = container.scrollTop += path - maxDistance;\n path = maxDistance;\n } else if(path < -maxDistance) {\n scrollPosition = container.scrollTop += path + maxDistance;\n path = -maxDistance;\n }\n }/* else if(forceDirection === FocusDirection.Up) { // * not tested yet\n container.scrollTop = offsetTop + container.scrollTop + maxDistance;\n } else if(forceDirection === FocusDirection.Down) { // * not tested yet\n container.scrollTop = Math.max(0, offsetTop + container.scrollTop - maxDistance);\n } */\n }\n\n // console.log('scrollWithJs: will scroll path:', path, element);\n\n /* let existsTransform = 0;\n const currentTransform = transformable.style.transform;\n if(currentTransform) {\n existsTransform = parseInt(currentTransform.match(/\\((.+?), (.+?), .+\\)/)[2]);\n //path += existsTransform;\n } */\n\n if(path < 0) {\n const remainingPath = -scrollPosition;\n path = Math.max(path, remainingPath);\n } else if(path > 0) {\n const remainingPath = scrollSize - (scrollPosition + containerSize);\n path = Math.min(path, remainingPath);\n }\n\n const target = container[scrollPositionKey] + path;\n const absPath = Math.abs(path);\n const duration = forceDuration ?? (\n MIN_JS_DURATION + (absPath / LONG_TRANSITION_MAX_DISTANCE) * (MAX_JS_DURATION - MIN_JS_DURATION)\n );\n const startAt = Date.now();\n\n /* transformable.classList.add('no-transition');\n\n const tickTransform = () => {\n const t = duration ? Math.min((Date.now() - startAt) / duration, 1) : 1;\n const currentPath = path * transition(t);\n\n transformable.style.transform = `translate3d(0, ${-currentPath}px, 0)`;\n container.dataset.translate = '' + -currentPath;\n\n const willContinue = t < 1;\n if(!willContinue) {\n fastRaf(() => {\n delete container.dataset.transform;\n container.dataset.transform = '';\n transformable.style.transform = '';\n void transformable.offsetLeft; // reflow\n transformable.classList.remove('no-transition');\n void transformable.offsetLeft; // reflow\n container[scrollPositionKey] = Math.round(target);\n });\n }\n\n return willContinue;\n };\n\n return animateSingle(tickTransform, container); */\n\n /* return new Promise((resolve) => {\n fastRaf(() => {\n transformable.style.transform = '';\n transformable.style.transition = '';\n\n setTimeout(resolve, duration);\n });\n });\n\n const transformableHeight = transformable.scrollHeight;\n //transformable.style.minHeight = `${transformableHeight}px`;\n */\n\n const transition = transitionFunction ?? (absPath < SHORT_TRANSITION_MAX_DISTANCE ? shortTransition : longTransition);\n const getProgress = () => duration ? Math.min((Date.now() - startAt) / duration, 1) : 1;\n const tick = () => {\n const t = getProgress();\n const value = transition(t);\n const currentPath = path * (1 - value);\n container[scrollPositionKey] = Math.round(target - currentPath);\n\n return t < 1;\n };\n\n if(!duration || !path) {\n cancelAnimationByKey(container);\n tick();\n return Promise.resolve();\n }\n\n /* return new Promise((resolve) => {\n setTimeout(resolve, duration);\n }).then(() => {\n transformable.classList.add('no-transition');\n void transformable.offsetLeft; // reflow\n transformable.style.transform = '';\n transformable.style.transition = '';\n void transformable.offsetLeft; // reflow\n transformable.classList.remove('no-transition');\n void transformable.offsetLeft; // reflow\n fastRaf(() => {\n\n container[scrollPositionKey] = Math.round(target);\n //transformable.style.minHeight = ``;\n });\n\n }); */\n\n if(options.startCallback) {\n const distanceToEnd = scrollSize - Math.round(target + container[axis === 'y' ? 'offsetHeight' : 'offsetWidth']);\n options.startCallback({\n scrollSize,\n scrollPosition,\n distanceToEnd,\n path,\n duration,\n containerRect,\n elementRect,\n getProgress\n });\n }\n\n return animateSingle(tick, container);\n}\n\nfunction longTransition(t: number) {\n return 1 - ((1 - t) ** 5);\n}\n\nfunction shortTransition(t: number) {\n return 1 - ((1 - t) ** 3.5);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {InputFileLocation, InputStickerSet, InputWebFileLocation} from '../layer';\nimport type {DownloadOptions} from '../lib/mtproto/apiFileManager';\n\nconst FILENAME_JOINER = '_';\n\nexport function getFileNameByLocation(location: InputFileLocation | InputWebFileLocation, options?: Partial<{\n fileName: string,\n downloadId: string\n}>) {\n const fileName = '';// (options?.fileName || '').split('.');\n const ext = fileName[fileName.length - 1] || '';\n\n let str: string;\n switch(location._) {\n case 'inputPhotoFileLocation': {\n str = ['photo', fileName[0], location.id, location.thumb_size].filter(Boolean).join(FILENAME_JOINER);\n break;\n }\n\n case 'inputDocumentFileLocation': {\n str = ['document', fileName[0], location.id, location.thumb_size].filter(Boolean).join(FILENAME_JOINER);\n break;\n }\n\n case 'inputPeerPhotoFileLocation':\n str = ['peerPhoto', location.photo_id, location.pFlags.big ? 'big' : 'small'].join(FILENAME_JOINER);\n break;\n\n case 'inputStickerSetThumb': {\n const id = (location.stickerset as InputStickerSet.inputStickerSetID).id ||\n (location.stickerset as InputStickerSet.inputStickerSetShortName).short_name ||\n (location.stickerset as InputStickerSet.inputStickerSetDice).emoticon ||\n location.stickerset._;\n str = ['stickerSetThumb', id, location.thumb_version].join(FILENAME_JOINER);\n break;\n }\n\n case 'inputFileLocation': {\n str = [location.volume_id, location.local_id].join(FILENAME_JOINER);\n break;\n }\n\n case 'inputWebFileLocation': {\n str = ['webFile', location.url].join(FILENAME_JOINER);\n break;\n }\n\n default: {\n console.error('Unrecognized location:', location);\n str = '';\n break;\n }\n }\n\n return str + (options?.downloadId ? '_download' : '') + (ext ? '.' + ext : ext);\n}\n\nexport type FileURLType = 'photo' | 'thumb' | 'document' | 'stream' | 'download';\nexport function getFileURL(type: FileURLType, options: DownloadOptions) {\n // console.log('getFileURL', location);\n // const perf = performance.now();\n const encoded = encodeURIComponent(JSON.stringify(options));\n // console.log('getFileURL encode:', performance.now() - perf, encoded);\n\n return /* '/' + */type + '/' + encoded;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Message, MessageAction} from '../layer';\nimport type {MyMessage} from '../lib/appManagers/appMessagesManager';\nimport forEachReverse from './array/forEachReverse';\n\nexport default function filterChatPhotosMessages(value: {\n count: number;\n next_rate: number;\n offset_id_offset: number;\n history: MyMessage[];\n}) {\n forEachReverse(value.history, (message, idx, arr) => {\n if(!((message as Message.messageService).action as MessageAction.messageActionChatEditPhoto).photo) {\n arr.splice(idx, 1);\n if(value.count !== undefined) {\n --value.count;\n }\n }\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {i18n, LangPackKey} from '../lib/langPack';\n\nexport default function formatBytes(bytes: number, decimals: number | 'auto' = 'auto') {\n if(bytes === 0) return i18n('FileSize.B', [0]);\n\n const strictDecimals = decimals === 'auto';\n\n const k = 1024;\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n const _decimals = decimals === 'auto' ? Math.max(0, i - 1) : decimals;\n\n const dm = Math.max(0, _decimals);\n const sizes: LangPackKey[] = ['FileSize.B', 'FileSize.KB', 'FileSize.MB', 'FileSize.GB'];\n\n const fixed = (bytes / Math.pow(k, i)).toFixed(dm);\n return i18n(sizes[i], [strictDecimals ? fixed : parseFloat(fixed)]);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport I18n, {i18n, join, LangPackKey} from '../lib/langPack';\nimport formatDuration, {DurationType} from './formatDuration';\n\nconst CALL_DURATION_LANG_KEYS: {[type in DurationType]: LangPackKey} = {\n s: 'Seconds',\n m: 'Minutes',\n h: 'Hours',\n d: 'Days',\n w: 'Weeks',\n mm: 'Months',\n y: 'Years'\n};\nexport default function formatCallDuration(duration: number, plain?: boolean) {\n const a = formatDuration(duration, 2);\n if(plain) {\n const strings = a.map((d) => I18n.format(CALL_DURATION_LANG_KEYS[d.type], true, [d.duration]));\n return join(strings, false, plain);\n }\n\n const elements = a.map((d) => i18n(CALL_DURATION_LANG_KEYS[d.type], [d.duration]));\n\n const fragment = document.createElement('span');\n fragment.append(...join(elements, false));\n\n return fragment;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport type DurationType = 's' | 'm' | 'h' | 'd' | 'w' | 'mm' | 'y';\nexport default function formatDuration(duration: number, showLast = 2) {\n if(!duration) {\n duration = 1;\n }\n\n const d: {duration: number, type: DurationType}[] = [];\n const p = [\n {m: 1, t: 's'},\n {m: 60, t: 'm'},\n {m: 60, t: 'h'},\n {m: 24, t: 'd'},\n {m: 7, t: 'w'}\n ] as Array<{m?: number, t: DurationType}>\n const s = 1;\n let t = s;\n p.forEach((o, idx) => {\n t = Math.round(t * o.m);\n\n if(duration < t) {\n return;\n }\n\n let dd = duration / t;\n if(idx !== (p.length - 1)) {\n const modulus = p[idx === (p.length - 1) ? idx : idx + 1].m;\n dd %= modulus;\n }\n\n d.push({\n duration: dd | 0,\n type: o.t\n });\n });\n\n const out = d.slice(-showLast).reverse();\n for(let i = out.length - 1; i >= 0; --i) {\n if(out[i].duration === 0) {\n out.splice(i, 1);\n }\n }\n\n return out;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {HelpCountry, HelpCountryCode} from '../layer';\nimport I18n from '../lib/langPack';\n\nlet sortedCountries: HelpCountry[];\ntype PrefixCountry = {country: HelpCountry, code: HelpCountryCode};\nconst prefixes: Map = new Map();\nlet maxPrefixLength = 0;\nconst setPrefix = (country: HelpCountry, code: HelpCountryCode, prefix: string = '') => {\n prefix = code.country_code + prefix;\n /* if(prefixes.has(prefix)) {\n console.error('asdasdasd', prefixes.get(prefix), country, code);\n } */\n maxPrefixLength = Math.max(maxPrefixLength, prefix.length);\n prefixes.set(prefix, {country, code});\n};\n\nexport function formatPhoneNumber(originalStr: string): {\n formatted: string,\n country: HelpCountry,\n code: HelpCountryCode,\n leftPattern: string\n} {\n originalStr = originalStr || '';\n\n if(!prefixes.size) {\n I18n.countriesList.forEach((country) => {\n country.country_codes.forEach((code) => {\n if(code.prefixes) {\n code.prefixes.forEach((prefix) => {\n setPrefix(country, code, prefix);\n });\n } else {\n setPrefix(country, code);\n }\n });\n });\n }\n\n // return {formatted: originalStr, country: undefined as any, leftPattern: ''};\n let str = originalStr.replace(/\\D/g, '');\n const phoneCode = str.slice(0, maxPrefixLength);\n\n // //console.log('str', str, phoneCode);\n // if(!sortedCountries) {\n // sortedCountries = I18n.countriesList.slice().sort((a, b) => b.country_codes[0].country_code.length - a.country_codes[0].country_code.length);\n // }\n\n // let country = sortedCountries.find((c) => {\n // return c.country_codes.find((c) => phoneCode.indexOf(c.replace(/\\D/g, '')) === 0);\n // });\n\n let prefixCountry: PrefixCountry;\n for(let i = phoneCode.length - 1; i >= 0; --i) { // lookup for country by prefix\n prefixCountry = prefixes.get(phoneCode.slice(0, i + 1));\n if(prefixCountry) {\n break;\n }\n }\n\n if(!prefixCountry) {\n return {\n formatted: str,\n country: undefined,\n code: undefined,\n leftPattern: ''\n };\n }\n\n // country = /* PhoneCodesMain[country.phoneCode] || */country;\n const country = prefixCountry.country;\n\n const patterns = prefixCountry.code.patterns || [];\n const searchForPattern = str.slice(prefixCountry.code.country_code.length); // splice country code\n let pattern = '', mostMatchedPatternMatches = 0, mostMatchedPattern = '';\n for(let i = patterns.length - 1; i >= 0; --i) {\n pattern = patterns[i];\n\n const _pattern = pattern.replace(/ /g, '');\n let patternMatches = 0;\n for(let k = 0, length = Math.min(searchForPattern.length, _pattern.length); k < length; ++k) {\n if(searchForPattern[k] === _pattern[k]) {\n patternMatches += 1.01;\n } else if(_pattern[k] === 'X') {\n ++patternMatches;\n } else {\n patternMatches = 0;\n break;\n }\n }\n\n if(patternMatches > mostMatchedPatternMatches) {\n mostMatchedPatternMatches = patternMatches;\n mostMatchedPattern = pattern;\n }\n }\n\n pattern = mostMatchedPattern || pattern;\n pattern = pattern.replace(/\\d/g, 'X');\n\n pattern = prefixCountry.code.country_code + ' ' + pattern;\n // let pattern = country.pattern || country.phoneCode;\n pattern.split('').forEach((symbol, idx) => {\n if(symbol === ' ' && str[idx] !== ' ' && str.length > idx) {\n str = str.slice(0, idx) + ' ' + str.slice(idx);\n }\n });\n\n /* if(country.pattern) {\n str = str.slice(0, country.pattern.length);\n } */\n\n let leftPattern = pattern && pattern.length > str.length ? pattern.slice(str.length) : '';\n if(leftPattern) {\n /* const length = str.length;\n leftPattern = leftPattern.split('').map((_, idx) => (length + idx).toString().slice(-1)).join(''); */\n leftPattern = leftPattern.replace(/X/g, '‒');\n // leftPattern = leftPattern.replace(/X/g, '0');\n }\n\n return {formatted: str, country, code: prefixCountry.code, leftPattern};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {RLottieColor} from '../lib/rlottie/rlottiePlayer';\n\nexport type FramesCacheMap = Map;\nexport type FramesCacheMapNew = Map;\nexport type FramesCacheMapURLs = Map;\nexport type FramesCacheItem = {\n frames: FramesCacheMap,\n framesNew: FramesCacheMapNew,\n framesURLs: FramesCacheMapURLs,\n clearCache: () => void,\n counter: number\n};\n\nexport class FramesCache {\n private cache: Map;\n\n constructor() {\n this.cache = new Map();\n }\n\n public static createCache(): FramesCacheItem {\n const cache: FramesCacheItem = {\n frames: new Map(),\n framesNew: new Map(),\n framesURLs: new Map(),\n clearCache: () => {\n cache.framesNew.forEach((value) => {\n (value as ImageBitmap).close?.();\n });\n\n cache.frames.clear();\n cache.framesNew.clear();\n cache.framesURLs.clear();\n },\n counter: 0\n };\n\n return cache;\n }\n\n public getCache(name: string) {\n let cache = this.cache.get(name);\n if(!cache) {\n this.cache.set(name, cache = FramesCache.createCache());\n } else {\n // console.warn('[RLottieCache] cache will be reused', cache);\n }\n\n ++cache.counter;\n return cache;\n }\n\n public releaseCache(name: string) {\n const cache = this.cache.get(name);\n if(cache && !--cache.counter) {\n this.cache.delete(name);\n // console.warn('[RLottieCache] released cache', cache);\n }\n }\n\n public getCacheCounter(name: string) {\n const cache = this.cache.get(name);\n return cache?.counter;\n }\n\n public generateName(name: string, width: number, height: number, color: RLottieColor, toneIndex: number) {\n return [\n name,\n width,\n height,\n // color ? rgbaToHexa(color) : ''\n color ? 'colored' : '',\n toneIndex || ''\n ].filter(Boolean).join('-');\n }\n}\n\nconst framesCache = new FramesCache();\n\nexport default framesCache;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// generate a path's arc data parameter\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\n\n// http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands\nfunction arcParameter(rx: number, ry: number, xAxisRotation: number, largeArcFlag: number, sweepFlag: number, x: number, y: number) {\n return [rx, ',', ry, ' ',\n xAxisRotation, ' ',\n largeArcFlag, ',',\n sweepFlag, ' ',\n x, ',', y].join('');\n}\n\nexport default function generatePathData(x: number, y: number, width: number, height: number, tl: number, tr: number, br: number, bl: number) {\n const data: string[] = [];\n\n // start point in top-middle of the rectangle\n data.push('M' + (x + width / 2) + ',' + y);\n\n // next we go to the right\n data.push('H' + (x + width - tr));\n\n if(tr > 0) {\n // now we draw the arc in the top-right corner\n data.push('A' + arcParameter(tr, tr, 0, 0, 1, (x + width), (y + tr)));\n }\n\n // next we go down\n data.push('V' + (y + height - br));\n\n if(br > 0) {\n // now we draw the arc in the lower-right corner\n data.push('A' + arcParameter(br, br, 0, 0, 1, (x + width - br), (y + height)));\n }\n\n // now we go to the left\n data.push('H' + (x + bl));\n\n if(bl > 0) {\n // now we draw the arc in the lower-left corner\n data.push('A' + arcParameter(bl, bl, 0, 0, 1, (x + 0), (y + height - bl)));\n }\n\n // next we go up\n data.push('V' + (y + tl));\n\n if(tl > 0) {\n // now we draw the arc in the top-left corner\n data.push('A' + arcParameter(tl, tl, 0, 0, 1, (x + tl), (y + 0)));\n }\n\n // and we close the path\n data.push('Z');\n\n return data.join(' ');\n}\n\nMOUNT_CLASS_TO.generatePathData = generatePathData;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {PhotoSize} from '../layer';\nimport {MyDocument} from '../lib/appManagers/appDocsManager';\nimport {MyPhoto} from '../lib/appManagers/appPhotosManager';\nimport {renderImageFromUrlPromise} from './dom/renderImageFromUrl';\nimport getPreviewURLFromThumb from './getPreviewURLFromThumb';\nimport blur from './blur';\n\nexport default function getImageFromStrippedThumb(\n photo: MyPhoto | MyDocument,\n thumb: PhotoSize.photoCachedSize | PhotoSize.photoStrippedSize,\n useBlur: boolean\n) {\n const url = getPreviewURLFromThumb(photo, thumb, false);\n\n let element: HTMLImageElement | HTMLCanvasElement, loadPromise: Promise;\n if(!useBlur) {\n element = new Image();\n loadPromise = renderImageFromUrlPromise(element, url);\n } else {\n const result = blur(url);\n element = result.canvas;\n loadPromise = result.promise;\n }\n\n element.classList.add('thumbnail');\n\n return {image: element, loadPromise};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../lib/appManagers/appDocsManager';\nimport type {MyPhoto} from '../lib/appManagers/appPhotosManager';\nimport {PhotoSize} from '../layer';\n// import appDownloadManager from \"../lib/appManagers/appDownloadManager\";\nimport getPreviewURLFromBytes from './bytes/getPreviewURLFromBytes';\n\nexport default function getPreviewURLFromThumb(photo: MyPhoto | MyDocument, thumb: PhotoSize.photoCachedSize | PhotoSize.photoStrippedSize, isSticker = false) {\n // const cacheContext = appDownloadManager.getCacheContext(photo, thumb.type);\n // return cacheContext.url || (cacheContext.url = getPreviewURLFromBytes(thumb.bytes, isSticker));\n return getPreviewURLFromBytes(thumb.bytes, isSticker);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../lib/appManagers/appDocsManager';\nimport type {MyPhoto} from '../lib/appManagers/appPhotosManager';\nimport {THUMB_TYPE_FULL} from '../lib/mtproto/mtproto_config';\nimport type {ThumbCache} from '../lib/storages/thumbs';\nimport getImageFromStrippedThumb from './getImageFromStrippedThumb';\n\nexport default function getStrippedThumbIfNeeded(photo: MyPhoto | MyDocument, cacheContext: ThumbCache, useBlur: boolean, ignoreCache = false) {\n const isVideo = (['video', 'gif'] as MyDocument['type'][]).includes((photo as MyDocument).type);\n if(!cacheContext.downloaded || isVideo || ignoreCache) {\n if(\n photo._ === 'document' &&\n cacheContext.downloaded &&\n !ignoreCache &&\n (!isVideo || cacheContext.type !== THUMB_TYPE_FULL)\n ) {\n return null;\n }\n\n const sizes = (photo as MyPhoto).sizes || (photo as MyDocument).thumbs;\n const thumb = sizes?.length ? sizes.find((size) => size._ === 'photoStrippedSize') : null;\n if(thumb && ('bytes' in thumb)) {\n return getImageFromStrippedThumb(photo, thumb as any, useBlur);\n }\n }\n\n return null;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport forEachReverse from './array/forEachReverse';\nimport safeAssign from './object/safeAssign';\n\nexport type ListLoaderOptions = {\n loadMore: ListLoader['loadMore'],\n loadCount?: ListLoader['loadCount'],\n loadWhenLeft?: ListLoader['loadWhenLeft'],\n processItem?: ListLoader['processItem'],\n onJump?: ListLoader['onJump'],\n onLoadedMore?: ListLoader['onLoadedMore']\n};\n\nexport type ListLoaderResult = {count: number, items: any[]};\nexport default class ListLoader {\n public current: T;\n public previous: T[] = [];\n public next: T[] = [];\n public count: number;\n public reverse = false; // reverse means next = higher msgid\n\n protected loadMore: (anchor: T, older: boolean, loadCount: number) => Promise>;\n protected processItem: (item: P) => T | Promise;\n protected loadCount = 50;\n protected loadWhenLeft = 20;\n\n public onJump: (item: T, older: boolean) => void;\n public onLoadedMore: () => void;\n\n protected loadedAllUp = false;\n protected loadedAllDown = false;\n protected loadPromiseUp: Promise;\n protected loadPromiseDown: Promise;\n\n constructor(options: ListLoaderOptions) {\n safeAssign(this, options);\n }\n\n public setTargets(previous: T[], next: T[], reverse: boolean) {\n this.previous = previous;\n this.next = next;\n this.reverse = reverse;\n }\n\n public get index() {\n return this.count !== undefined ? this.previous.length : -1;\n }\n\n /* public filter(callback: (item: T, idx: number, arr: T[]) => boolean) {\n const filter = (item: T, idx: number, arr: T[]) => {\n if(!callback(item, idx, arr)) {\n arr.splice(idx, 1);\n }\n };\n\n forEachReverse(this.previous, filter);\n forEachReverse(this.next, filter);\n } */\n\n public reset(loadedAll = false) {\n this.current = undefined;\n this.previous = [];\n this.next = [];\n this.setLoaded(true, loadedAll);\n this.setLoaded(false, loadedAll);\n }\n\n public go(length: number, dispatchJump = true) {\n let items: T[], item: T;\n if(length > 0) {\n items = this.next.splice(0, length);\n item = items.pop();\n if(!item) {\n return;\n }\n\n if(this.current !== undefined) items.unshift(this.current);\n this.previous.push(...items);\n } else {\n items = this.previous.splice(Math.max(0, this.previous.length + length), -length);\n item = items.shift();\n if(!item) {\n return;\n }\n\n if(this.current !== undefined) items.push(this.current);\n this.next.unshift(...items);\n }\n\n if(this.next.length < this.loadWhenLeft) {\n this.load(!this.reverse);\n }\n\n if(this.previous.length < this.loadWhenLeft) {\n this.load(this.reverse);\n }\n\n this.current = item;\n dispatchJump && this.onJump && this.onJump(item, length > 0);\n return this.current;\n }\n\n protected unsetCurrent(toPrevious: boolean) {\n if(toPrevious) this.previous.push(this.current);\n else this.next.unshift(this.current);\n\n this.current = undefined;\n }\n\n public goUnsafe(length: number, dispatchJump?: boolean) {\n const leftLength = length > 0 ? Math.max(0, length - this.next.length) : Math.min(0, length + this.previous.length);\n const item = this.go(length, leftLength ? false : dispatchJump);\n\n /* if(length > 0 ? this.loadedAllUp : this.loadedAllDown) {\n this.unsetCurrent(length > 0);\n } */\n\n return {\n item: !leftLength ? item : undefined,\n leftLength\n };\n }\n\n protected setLoaded(down: boolean, value: boolean) {\n const isChanged = (down ? this.loadedAllDown : this.loadedAllUp) !== value;\n if(!isChanged) {\n return false;\n }\n\n if(down) this.loadedAllDown = value;\n else this.loadedAllUp = value;\n\n if(!value) {\n if(down) this.loadPromiseDown = null;\n else this.loadPromiseUp = null;\n }\n\n return true;\n }\n\n // нет смысла делать проверку для reverse и loadMediaPromise\n public load(older: boolean) {\n if(older ? this.loadedAllDown : this.loadedAllUp) return Promise.resolve();\n\n let promise = older ? this.loadPromiseDown : this.loadPromiseUp;\n if(promise) return promise;\n\n let anchor: T;\n if(older) {\n anchor = this.reverse ? this.previous[0] : this.next[this.next.length - 1];\n } else {\n anchor = this.reverse ? this.next[this.next.length - 1] : this.previous[0];\n }\n\n anchor ??= this.current;\n promise = this.loadMore(anchor, older, this.loadCount).then(async(result) => {\n if((older ? this.loadPromiseDown : this.loadPromiseUp) !== promise) {\n return;\n }\n\n if(result.items.length < this.loadCount) {\n this.setLoaded(older, true);\n }\n\n if(this.count === undefined) {\n this.count = result.count || result.items.length;\n }\n\n const processedArr: (Promise | any)[] = [];\n const method = older ? result.items.forEach.bind(result.items) : forEachReverse.bind(null, result.items);\n method((item: any) => {\n const processed = this.processItem ? this.processItem(item) : item;\n\n if(!processed) return;\n processedArr.push(processed);\n });\n\n const results = await Promise.all(processedArr);\n if(older) {\n if(this.reverse) this.previous.unshift(...results);\n else this.next.push(...results);\n } else {\n if(this.reverse) this.next.push(...results);\n else this.previous.unshift(...results);\n }\n\n this.onLoadedMore && this.onLoadedMore();\n }, () => {}).then(() => {\n if(older) this.loadPromiseDown = null;\n else this.loadPromiseUp = null;\n });\n\n if(older) this.loadPromiseDown = promise;\n else this.loadPromiseUp = promise;\n\n return promise;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type EventListenerBase from './eventListenerBase';\n\nexport type Listener = {\n element: ListenerElement,\n event: ListenerEvent,\n callback: ListenerCallback,\n options?: ListenerOptions,\n\n onceFired?: true, // will be set only when options.once is set\n onceCallback?: () => void,\n};\n\nexport type ListenerElement = Window | Document | HTMLElement | Element | EventListenerBase;\nexport type ListenerEvent = string;\nexport type ListenerCallback = Function;\nexport type ListenerOptions = AddEventListenerOptions;\n\n/* const originalAddEventListener = HTMLElement.prototype.addEventListener;\nHTMLElement.prototype.addEventListener = function(this, name: string, callback: EventListenerOrEventListenerObject, options: AddEventListenerOptions) {\n console.log('nu zdarova', name);\n originalAddEventListener.call(this, name, callback, options);\n\n if(options?.ls) {\n return options.ls.addFromElement(this, name, callback as any, options);\n }\n}; */\n\nexport default class ListenerSetter {\n private listeners: Set = new Set();\n\n public add(element: T): T['addEventListener'] {\n return ((event: string, callback: Function, options: ListenerOptions) => {\n const listener: Listener = {element, event, callback, options};\n this.addManual(listener);\n return listener;\n }) as any;\n }\n\n /* public addFromElement(element: T, event: ListenerEvent, callback: ListenerCallback, options: ListenerOptions) {\n const listener: Listener = {element, event, callback, options};\n this.addManual(listener);\n return listener;\n } */\n\n public addManual(listener: Listener) {\n // @ts-ignore\n listener.element.addEventListener(listener.event, listener.callback, listener.options);\n\n if(listener.options?.once) { // remove listener when its called\n listener.onceCallback = () => {\n this.remove(listener);\n listener.onceFired = true;\n };\n\n // @ts-ignore\n listener.element.addEventListener(listener.event, listener.onceCallback, listener.options);\n }\n\n this.listeners.add(listener);\n }\n\n public remove(listener: Listener) {\n if(!listener.onceFired) {\n // @ts-ignore\n listener.element.removeEventListener(listener.event, listener.callback, listener.options);\n\n if(listener.onceCallback) {\n // @ts-ignore\n listener.element.removeEventListener(listener.event, listener.onceCallback, listener.options);\n }\n }\n\n this.listeners.delete(listener);\n }\n\n public removeManual(\n element: T,\n event: ListenerEvent,\n callback: ListenerCallback,\n options?: ListenerOptions\n ) {\n let listener: Listener;\n for(const _listener of this.listeners) {\n if(_listener.element === element &&\n _listener.event === event &&\n _listener.callback === callback &&\n _listener.options === options) {\n listener = _listener;\n break;\n }\n }\n\n if(listener) {\n this.remove(listener);\n }\n }\n\n public removeAll() {\n this.listeners.forEach((listener) => {\n this.remove(listener);\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport rootScope from '../lib/rootScope';\n\nexport type LiteModeKey = 'all' | 'gif' | 'video' |\n 'emoji' | 'emoji_panel' | 'emoji_messages' |\n 'effects' | 'effects_reactions' | 'effects_premiumstickers' | 'effects_emoji' |\n 'stickers' | 'stickers_panel' | 'stickers_chat' |\n 'chat' | 'chat_background' | 'chat_spoilers' | 'animations';\n\nexport class LiteMode {\n public isEnabled() {\n return rootScope.settings.liteMode.all;\n }\n\n public isAvailable(key: LiteModeKey) {\n return !rootScope.settings.liteMode.all && !rootScope.settings.liteMode[key];\n }\n}\n\nconst liteMode = new LiteMode();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.liteMode = liteMode);\nexport default liteMode;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport calcImageInBox from './calcImageInBox';\n\nexport class MediaSize {\n constructor(public width = 0, public height = width) {\n\n }\n\n public aspect(boxSize: MediaSize, fitted: boolean) {\n return calcImageInBox(this.width, this.height, boxSize.width, boxSize.height, fitted);\n }\n\n public aspectFitted(boxSize: MediaSize) {\n return this.aspect(boxSize, true);\n }\n\n public aspectCovered(boxSize: MediaSize) {\n return this.aspect(boxSize, false);\n }\n}\n\nexport function makeMediaSize(width?: number, height?: number): MediaSize {\n return new MediaSize(width, height);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport EventListenerBase from './eventListenerBase';\nimport {makeMediaSize, MediaSize} from './mediaSize';\n\ntype MediaTypeSizes = {\n regular: MediaSize,\n webpage: MediaSize,\n album: MediaSize,\n esgSticker: MediaSize,\n animatedSticker: MediaSize,\n staticSticker: MediaSize,\n emojiSticker: MediaSize,\n poll: MediaSize,\n round: MediaSize,\n documentName: MediaSize,\n invoice: MediaSize,\n extendedInvoice: MediaSize,\n customEmoji: MediaSize,\n esgCustomEmoji: MediaSize,\n emojiStatus: MediaSize,\n popupSticker: MediaSize\n};\n\nexport type MediaSizeType = keyof MediaTypeSizes;\n\nexport enum ScreenSize {\n mobile,\n medium,\n large\n}\n\nconst MOBILE_SIZE = 600;\nconst MEDIUM_SIZE = 1275;\nconst LARGE_SIZE = 1680;\n\nconst CUSTOM_EMOJI_SIZE = makeMediaSize(20, 20);\nconst ESG_CUSTOM_EMOJI_SIZE = makeMediaSize(36, 36);\nconst EMOJI_STATUS_SIZE = makeMediaSize(18, 18);\n\nclass MediaSizes extends EventListenerBase<{\n changeScreen: (from: ScreenSize, to: ScreenSize) => void,\n resize: () => void\n}> {\n private screenSizes: {key: ScreenSize, value: number}[] = [\n {key: ScreenSize.mobile, value: MOBILE_SIZE},\n {key: ScreenSize.medium, value: MEDIUM_SIZE},\n {key: ScreenSize.large, value: LARGE_SIZE}\n ];\n\n private sizes: {[k in 'desktop' | 'handhelds']: MediaTypeSizes} = {\n handhelds: {\n regular: makeMediaSize(270, 270),\n webpage: makeMediaSize(270, 200),\n album: makeMediaSize(270, 0),\n esgSticker: makeMediaSize(68, 68),\n animatedSticker: makeMediaSize(180, 180),\n staticSticker: makeMediaSize(180, 180),\n emojiSticker: makeMediaSize(112, 112),\n poll: makeMediaSize(240, 0),\n round: makeMediaSize(200, 200),\n documentName: makeMediaSize(200, 0),\n invoice: makeMediaSize(270, 270),\n extendedInvoice: makeMediaSize(270, 270),\n customEmoji: CUSTOM_EMOJI_SIZE,\n esgCustomEmoji: ESG_CUSTOM_EMOJI_SIZE,\n emojiStatus: EMOJI_STATUS_SIZE,\n popupSticker: makeMediaSize(68, 68)\n },\n desktop: {\n regular: makeMediaSize(420, 340),\n webpage: makeMediaSize(420, 340),\n album: makeMediaSize(420, 0),\n esgSticker: makeMediaSize(72, 72),\n animatedSticker: makeMediaSize(200, 200),\n staticSticker: makeMediaSize(200, 200),\n emojiSticker: makeMediaSize(112, 112),\n poll: makeMediaSize(330, 0),\n round: makeMediaSize(280, 280),\n documentName: makeMediaSize(240, 0),\n invoice: makeMediaSize(320, 320),\n extendedInvoice: makeMediaSize(420, 340),\n customEmoji: CUSTOM_EMOJI_SIZE,\n esgCustomEmoji: ESG_CUSTOM_EMOJI_SIZE,\n emojiStatus: EMOJI_STATUS_SIZE,\n popupSticker: makeMediaSize(80, 80)\n }\n };\n\n public isMobile = false;\n public active: MediaTypeSizes;\n public activeScreen: ScreenSize;\n private rAF: number;\n\n constructor() {\n super();\n\n window.addEventListener('resize', () => {\n if(this.rAF) window.cancelAnimationFrame(this.rAF);\n this.rAF = window.requestAnimationFrame(() => {\n this.handleResize();\n this.rAF = 0;\n });\n });\n this.handleResize();\n }\n\n private handleResize = () => {\n const innerWidth = window.innerWidth;\n // this.isMobile = innerWidth <= 720;\n\n let activeScreen = this.screenSizes[0].key;\n for(let i = this.screenSizes.length - 1; i >= 0; --i) {\n if(this.screenSizes[i].value < innerWidth) {\n activeScreen = (this.screenSizes[i + 1] || this.screenSizes[i]).key;\n break;\n }\n }\n\n const wasScreen = this.activeScreen;\n this.activeScreen = activeScreen;\n this.isMobile = this.activeScreen === ScreenSize.mobile;\n this.active = this.isMobile ? this.sizes.handhelds : this.sizes.desktop;\n\n // console.time('esg');\n // const computedStyle = window.getComputedStyle(document.documentElement);\n // this.active.esgSticker.width = parseFloat(computedStyle.getPropertyValue('--esg-sticker-size'));\n // console.timeEnd('esg');\n\n if(wasScreen !== activeScreen) {\n // console.log('changeScreen', this.activeScreen, activeScreen);\n\n if(wasScreen !== undefined) {\n this.dispatchEvent('changeScreen', wasScreen, activeScreen);\n }\n }\n\n if(wasScreen !== undefined) {\n this.dispatchEvent('resize');\n }\n\n /* if(this.isMobile) {\n for(let i in this.active) {\n // @ts-ignore\n let size = this.active[i];\n size.width = innerWidth\n }\n } */\n };\n}\n\nconst mediaSizes = new MediaSizes();\nMOUNT_CLASS_TO.mediaSizes = mediaSizes;\nexport default mediaSizes;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport makeError from './makeError';\n\nconst error = makeError('MIDDLEWARE');\nexport default function middlewarePromise(middleware: () => boolean, throwWhat: any = error) {\n return (promise: T): T => {\n if(!(promise instanceof Promise)) {\n if(promise instanceof Error) {\n throw promise;\n } else {\n return promise;\n }\n }\n\n return (promise as any as Promise).then((result) => {\n if(!middleware()) {\n throw throwWhat;\n }\n\n return result;\n }) as any;\n };\n}\n","export default function formatNumber(bytes: number, decimals = 2) {\n if(bytes === 0) return '0';\n\n const k = 1000;\n const dm = decimals < 0 ? 0 : decimals;\n const sizes = ['', 'K', 'M', 'B', 'T'];\n\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + sizes[i];\n}\n","export default function numberThousandSplitter(x: number, joiner = ' ') {\n const parts = x.toString().split('.');\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, joiner);\n return parts.join('.');\n}\n","import {IS_APPLE_MOBILE} from '../environment/userAgent';\n\nexport default function onMediaLoad(media: HTMLMediaElement, readyState = media.HAVE_METADATA, useCanplayOnIos?: boolean) {\n return new Promise((resolve, reject) => {\n if(media.readyState >= readyState) {\n resolve();\n return;\n }\n\n const loadEventName = IS_APPLE_MOBILE && !useCanplayOnIos ? 'loadeddata' : 'canplay';\n const errorEventName = 'error';\n const onLoad = () => {\n media.removeEventListener(errorEventName, onError);\n resolve();\n };\n const onError = (e: ErrorEvent) => {\n media.removeEventListener(loadEventName, onLoad);\n reject(media.error);\n };\n media.addEventListener(loadEventName, onLoad, {once: true});\n media.addEventListener(errorEventName, onError, {once: true});\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appNavigationController, {NavigationItem} from '../components/appNavigationController';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport {IS_MOBILE_SAFARI} from '../environment/userAgent';\nimport cancelEvent from './dom/cancelEvent';\nimport {CLICK_EVENT_NAME, hasMouseMovedSinceDown} from './dom/clickEvent';\nimport findUpAsChild from './dom/findUpAsChild';\nimport EventListenerBase from './eventListenerBase';\n\nexport default class OverlayClickHandler extends EventListenerBase<{\n toggle: (open: boolean) => void\n}> {\n protected element: HTMLElement;\n protected overlay: HTMLElement;\n protected listenerOptions: AddEventListenerOptions;\n\n constructor(\n protected navigationType: NavigationItem['type'],\n protected withOverlay?: boolean\n ) {\n super(false);\n this.listenerOptions = withOverlay ? {} : {capture: true};\n }\n\n protected onClick = (e: MouseEvent | TouchEvent) => {\n if(hasMouseMovedSinceDown(e)) {\n return;\n }\n\n if(this.element && findUpAsChild(e.target as HTMLElement, this.element)) {\n return;\n }\n\n if(this.listenerOptions?.capture) {\n cancelEvent(e);\n }\n\n this.close();\n };\n\n public close() {\n if(this.element) {\n this.overlay?.remove();\n this.element = undefined;\n this.dispatchEvent('toggle', false);\n }\n\n if(!IS_TOUCH_SUPPORTED) {\n // window.removeEventListener('keydown', onKeyDown, {capture: true});\n window.removeEventListener('contextmenu', this.onClick, this.listenerOptions);\n }\n\n document.removeEventListener(CLICK_EVENT_NAME, this.onClick, this.listenerOptions);\n\n if(!IS_MOBILE_SAFARI) {\n appNavigationController.removeByType(this.navigationType);\n }\n }\n\n public open(element: HTMLElement) {\n this.close();\n\n if(!IS_MOBILE_SAFARI) {\n appNavigationController.pushItem({\n type: this.navigationType,\n onPop: (canAnimate) => {\n this.close();\n }\n });\n }\n\n this.element = element;\n\n if(!this.overlay && this.withOverlay) {\n this.overlay = document.createElement('div');\n this.overlay.classList.add('btn-menu-overlay');\n\n // ! because this event must be canceled, and can't cancel on menu click (below)\n this.overlay.addEventListener(CLICK_EVENT_NAME, (e) => {\n cancelEvent(e);\n this.onClick(e);\n });\n }\n\n this.overlay && this.element.parentElement.insertBefore(this.overlay, this.element);\n\n // document.body.classList.add('disable-hover');\n\n if(!IS_TOUCH_SUPPORTED) {\n // window.addEventListener('keydown', onKeyDown, {capture: true});\n window.addEventListener('contextmenu', this.onClick, {...this.listenerOptions, once: true});\n }\n\n /* // ! because this event must be canceled, and can't cancel on menu click (below)\n overlay.addEventListener(CLICK_EVENT_NAME, (e) => {\n cancelEvent(e);\n onClick(e);\n }); */\n\n // ! safari iOS doesn't handle window click event on overlay, idk why\n document.addEventListener(CLICK_EVENT_NAME, this.onClick, this.listenerOptions);\n\n this.dispatchEvent('toggle', true);\n }\n}\n","import Currencies from '../config/currencies';\n\n// https://stackoverflow.com/a/34141813\nfunction number_format(number: any, decimals: any, dec_point: any, thousands_sep: any): string {\n // Strip all characters but numerical ones.\n number = (number + '').replace(/[^0-9+\\-Ee.]/g, '');\n var n = !isFinite(+number) ? 0 : +number,\n prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),\n sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,\n dec = (typeof dec_point === 'undefined') ? '.' : dec_point,\n s: any = '',\n toFixedFix = function(n: number, prec: number) {\n var k = Math.pow(10, prec);\n return '' + Math.round(n * k) / k;\n };\n // Fix for IE parseFloat(0.55).toFixed(0) = 0;\n s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');\n if(s[0].length > 3) {\n s[0] = s[0].replace(/\\B(?=(?:\\d{3})+(?!\\d))/g, sep);\n }\n if((s[1] || '').length < prec) {\n s[1] = s[1] || '';\n s[1] += new Array(prec - s[1].length + 1).join('0');\n }\n return s.join(dec);\n}\n\nexport default function paymentsWrapCurrencyAmount(\n amount: number | string,\n currency: string,\n skipSymbol?: boolean,\n useNative?: boolean\n) {\n amount = +amount;\n\n const isNegative = amount < 0;\n\n const currencyData = Currencies[currency];\n if(!currencyData) {\n throw new Error('CURRENCY_WRAP_INVALID');\n }\n\n const amountExp = amount / Math.pow(10, currencyData.exp);\n\n let decimals = currencyData.exp;\n if(currency == 'IRR' && Math.floor(amountExp) == amountExp) {\n decimals = 0; // у иранцев копейки почти всегда = 0 и не показываются в UI\n }\n\n let formatted = number_format(amountExp, decimals, currencyData.decimal_sep, currencyData.thousands_sep);\n if(skipSymbol) {\n return formatted;\n }\n\n let symbol = useNative ? currencyData.native || currencyData.symbol : currencyData.symbol;\n if(isNegative && !currencyData.space_between && currencyData.symbol_left) {\n symbol = '-' + symbol;\n formatted = formatted.replace('-', '');\n }\n\n let out: string;\n const splitter = currencyData.space_between ? ' ' : '';\n if(currencyData.symbol_left) {\n out = symbol + splitter + formatted;\n } else {\n out = formatted + splitter + symbol;\n }\n return out;\n}\n\n(window as any).p = paymentsWrapCurrencyAmount;\n\n// function paymentsGetCurrencyExp($currency: string) {\n// if($currency == 'CLF') {\n// return 4;\n// }\n// if(['BHD','IQD','JOD','KWD','LYD','OMR','TND'].includes($currency)) {\n// return 3;\n// }\n// if(['BIF','BYR','CLP','CVE','DJF','GNF','ISK','JPY','KMF','KRW','MGA', 'PYG','RWF','UGX','UYI','VND','VUV','XAF','XOF','XPF'].includes($currency)) {\n// return 0;\n// }\n// if($currency == 'MRO') {\n// return 1;\n// }\n// return 2;\n// }\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport mediaSizes from './mediaSizes';\n\nexport type MenuPositionPadding = {\n top?: number,\n right?: number,\n bottom?: number,\n left?: number\n};\n\nconst PADDING_TOP = 8;\nconst PADDING_BOTTOM = PADDING_TOP;\nconst PADDING_LEFT = 8;\nconst PADDING_RIGHT = PADDING_LEFT;\nexport default function positionMenu(e: MouseEvent | Touch | TouchEvent, elem: HTMLElement, side?: 'left' | 'right' | 'center', additionalPadding?: MenuPositionPadding) {\n if((e as TouchEvent).touches) {\n e = (e as TouchEvent).touches[0];\n }\n\n const {pageX, pageY} = e as Touch;\n // let {clientX, clientY} = e;\n\n // * side mean the OPEN side\n\n const getScrollWidthFromElement = (Array.from(elem.children) as HTMLElement[]).find((element) => element.classList.contains('btn-menu-item') && !element.classList.contains('hide')) || elem;\n\n let {scrollWidth: menuWidth} = getScrollWidthFromElement;\n const {scrollHeight: menuHeight} = elem;\n // let {innerWidth: windowWidth, innerHeight: windowHeight} = window;\n const rect = document.body.getBoundingClientRect();\n const windowWidth = rect.width;\n const windowHeight = rect.height;\n\n menuWidth += getScrollWidthFromElement.offsetLeft * 2;\n\n let paddingTop = PADDING_TOP, paddingRight = PADDING_RIGHT, paddingBottom = PADDING_BOTTOM, paddingLeft = PADDING_LEFT;\n if(additionalPadding) {\n if(additionalPadding.top) paddingTop += additionalPadding.top;\n if(additionalPadding.right) paddingRight += additionalPadding.right;\n if(additionalPadding.bottom) paddingBottom += additionalPadding.bottom;\n if(additionalPadding.left) paddingLeft += additionalPadding.left;\n }\n\n side = mediaSizes.isMobile ? 'right' : 'left';\n let verticalSide: 'top' /* | 'bottom' */ | 'center' = 'top';\n\n const maxTop = windowHeight - menuHeight - paddingBottom;\n const maxLeft = windowWidth - menuWidth - paddingRight;\n const minTop = paddingTop;\n const minLeft = paddingLeft;\n\n const getSides = () => {\n return {\n x: {\n left: pageX,\n right: Math.min(maxLeft, pageX - menuWidth)\n },\n intermediateX: side === 'right' ? minLeft : maxLeft,\n // intermediateX: clientX < windowWidth / 2 ? PADDING_LEFT : windowWidth - menuWidth - PADDING_LEFT,\n y: {\n top: pageY,\n bottom: pageY - menuHeight\n },\n // intermediateY: verticalSide === 'top' ? paddingTop : windowHeight - menuHeight - paddingTop,\n // intermediateY: pageY < (windowHeight / 2) ? paddingTop : windowHeight - menuHeight - paddingBottom,\n intermediateY: maxTop\n };\n };\n\n const sides = getSides();\n\n const possibleSides = {\n x: {\n left: (sides.x.left + menuWidth + paddingRight) <= windowWidth,\n right: sides.x.right >= paddingLeft\n },\n y: {\n top: (sides.y.top + menuHeight + paddingBottom) <= windowHeight,\n bottom: (sides.y.bottom - paddingBottom) >= paddingBottom\n }\n };\n\n /* if(side === undefined) {\n if((clientX + menuWidth + PADDING_LEFT) > windowWidth) {\n side = 'right';\n }\n } */\n\n {\n /* const x = sides.x;\n\n const s = Object.keys(x) as (keyof typeof possibleSides.x)[];\n if(side) {\n s.findAndSplice((s) => s === side);\n s.unshift(side);\n }\n\n const possibleSide = s.find((s) => possibleSides.x[s]); */\n // let left: number;\n /* if(possibleSide) {\n left = x[possibleSide];\n side = possibleSide;\n } else {\n left = sides.intermediateX;\n side = undefined;\n } */\n const left = possibleSides.x[side] ? sides.x[side] : (side = 'center', sides.intermediateX);\n\n elem.style.left = left + 'px';\n }\n\n /* if((clientY + menuHeight + PADDING_TOP) > windowHeight) {\n elem.style.top = clamp(clientY - menuHeight, PADDING_TOP, windowHeight - menuHeight - PADDING_TOP) + 'px';\n // elem.style.top = (innerHeight - scrollHeight - PADDING_TOP) + 'px';\n verticalSide = 'bottom';\n } else {\n elem.style.top = Math.max(PADDING_TOP, clientY) + 'px';\n verticalSide = 'top';\n } */\n\n {\n const top = possibleSides.y[verticalSide] ? sides.y[verticalSide] : (verticalSide = 'center', sides.intermediateY);\n\n elem.style.top = top + 'px';\n }\n\n elem.className = elem.className.replace(/(top|center|bottom)-(left|center|right)/g, '');\n elem.classList.add(\n // (verticalSide === 'center' ? verticalSide : (verticalSide === 'bottom' ? 'top' : 'bottom')) +\n (verticalSide === 'center' ? verticalSide : 'bottom') +\n '-' +\n (side === 'center' ? side : (side === 'left' ? 'right' : 'left')));\n\n return {\n width: menuWidth,\n height: menuHeight\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appDownloadManager from '../lib/appManagers/appDownloadManager';\nimport lottieLoader from '../lib/rlottie/lottieLoader';\nimport rootScope from '../lib/rootScope';\nimport {getEmojiToneIndex} from '../vendor/emoji';\nimport mediaSizes from './mediaSizes';\nimport {saveLottiePreview} from './saveLottiePreview';\n\nexport default function preloadAnimatedEmojiSticker(emoji: string, width?: number, height?: number) {\n return rootScope.managers.appStickersManager.preloadAnimatedEmojiSticker(emoji).then(({doc}) => {\n if(!doc) {\n return;\n }\n\n return appDownloadManager.downloadMedia({media: doc})\n .then(async(blob) => {\n const mediaSize = mediaSizes.active.emojiSticker;\n const toneIndex = getEmojiToneIndex(emoji);\n const animation = await lottieLoader.loadAnimationWorker({\n container: undefined,\n animationData: blob,\n width: width ?? mediaSize.width,\n height: height ?? mediaSize.height,\n name: 'doc' + doc.id,\n autoplay: false,\n loop: false,\n toneIndex,\n group: 'none'\n });\n\n animation.addEventListener('firstFrame', () => {\n saveLottiePreview(doc, animation.canvas[0], toneIndex);\n animation.remove();\n }, {once: true});\n });\n });\n}\n","import {RestrictionReason} from '../layer';\n\nconst platforms = new Set([\n 'all',\n 'web',\n 'webk'\n]);\n\nconst ignore = new Set();\n\nexport function getRestrictionReason(reasons: RestrictionReason[]) {\n // return reasons[0];\n return reasons.find((reason) => platforms.has(reason.platform) && !ignore.has(reason.reason));\n}\n\nexport function isRestricted(reasons: RestrictionReason[]) {\n return !!getRestrictionReason(reasons);\n}\n\nexport function ignoreRestrictionReasons(reasons: string[]) {\n ignore.clear();\n reasons.forEach((reason) => {\n ignore.add(reason);\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../lib/appManagers/appDocsManager';\nimport rootScope from '../lib/rootScope';\n\nconst savingLottiePreview: {[docId: DocId]: {width: number, height: number}} = {};\n\nexport function isSavingLottiePreview(doc: MyDocument, toneIndex: number, width: number, height: number) {\n const key = doc.id + '-' + toneIndex;\n const saving = savingLottiePreview[key];\n return saving && saving.width >= width && saving.height >= height;\n}\n\nexport async function saveLottiePreview(doc: MyDocument, canvas: HTMLCanvasElement, toneIndex: number) {\n const key = doc.id + '-' + toneIndex;\n const {width, height} = canvas;\n if(isSavingLottiePreview(doc, toneIndex, width, height)) {\n return;\n }\n\n const saving = savingLottiePreview[key] = {\n width,\n height\n };\n\n const thumb = await rootScope.managers.appDocsManager.getLottieCachedThumb(doc.id, toneIndex);\n if(savingLottiePreview[key] !== saving) {\n return;\n }\n\n if(thumb && thumb.w >= width && thumb.h >= height) {\n return;\n }\n\n const promise = new Promise((resolve) => {\n canvas.toBlob((blob) => resolve(blob));\n });\n\n const blob = await promise;\n if(savingLottiePreview[key] !== saving) {\n return;\n }\n\n // console.log('got lottie preview', doc, blob, URL.createObjectURL(blob));\n\n rootScope.managers.appDocsManager.saveLottiePreview(doc.id, blob, width, height, toneIndex);\n\n // delete savingLottiePreview[key];\n\n /* const reader = new FileReader();\n reader.onloadend = (e) => {\n const uint8 = new Uint8Array(e.target.result as ArrayBuffer);\n const thumb: PhotoSize.photoStrippedSize = {\n _: 'photoStrippedSize',\n bytes: uint8,\n type: 'i'\n };\n\n doc.stickerSavedThumbWidth = canvas.width;\n doc.stickerSavedThumbHeight = canvas.width;\n\n defineNotNumerableProperties(thumb, ['url']);\n thumb.url = URL.createObjectURL(blob);\n doc.thumbs.findAndSplice((t) => t._ === thumb._);\n doc.thumbs.unshift(thumb);\n\n if(!webpWorkerController.isWebpSupported()) {\n doc.pFlags.stickerThumbConverted = true;\n }\n\n delete this.savingLottiePreview[doc.id];\n };\n reader.readAsArrayBuffer(blob); */\n}\n","// * Jolly Cobra's schedulers\n\nimport {AnyToVoidFunction} from '../../types';\nimport {fastRaf} from '../schedulers';\nimport throttleWith from './throttleWith';\n\nexport default function throttleWithRaf(fn: F) {\n return throttleWith(fastRaf, fn);\n}\n","// * Jolly Cobra's schedulers\n\nimport {AnyToVoidFunction} from '../../types';\n\nexport default function throttleWith(schedulerFn: AnyToVoidFunction, fn: F) {\n let waiting = false;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n args = _args;\n\n if(!waiting) {\n waiting = true;\n\n schedulerFn(() => {\n waiting = false;\n // @ts-ignore\n fn(...args);\n });\n }\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Scrollable from '../components/scrollable';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport {IS_SAFARI} from '../environment/userAgent';\nimport getVisibleRect from './dom/getVisibleRect';\nimport reflowScrollableElement from './dom/reflowScrollableElement';\n\nexport default class ScrollSaver {\n private scrollHeight: number;\n private scrollHeightMinusTop: number;\n private scrollTop: number;\n private clientHeight: number;\n private elements: {element: HTMLElement, rect: DOMRect}[];\n\n /**\n *\n * @param scrollable to reset scroll position and direction\n * @param reverse true means top\n */\n constructor(\n private scrollable: Scrollable,\n private query: string,\n private reverse: boolean\n ) {\n\n }\n\n private get container() {\n return this.scrollable.container;\n }\n\n public getSaved() {\n return {\n scrollHeight: this.scrollHeight,\n scrollTop: this.scrollTop,\n clientHeight: this.clientHeight\n };\n }\n\n public findElements() {\n if(!this.query) return [];\n\n const {container} = this;\n const containerRect = container.getBoundingClientRect();\n const bubbles = Array.from(container.querySelectorAll(this.query)) as HTMLElement[];\n const elements: ScrollSaver['elements'] = [];\n for(const bubble of bubbles) {\n const elementRect = bubble.getBoundingClientRect();\n const visibleRect = getVisibleRect(bubble, container, undefined, elementRect, containerRect);\n if(visibleRect) {\n elements.push({element: bubble, rect: elementRect});\n // break; // find first\n } else if(elements.length) { // find last\n break;\n }\n }\n\n if(!elements.length) {\n const bubble = bubbles[0];\n if(bubble) {\n elements.push({element: bubble, rect: bubble.getBoundingClientRect()});\n }\n }\n\n return elements;\n }\n\n public replaceSaved(from: HTMLElement, to: HTMLElement) {\n if(!this.elements) {\n return;\n }\n\n const idx = this.elements.findIndex(({element}) => from === element);\n if(idx !== -1) {\n this.elements[idx].element = to;\n }\n }\n\n public findAndSetElements() {\n this.elements = this.findElements();\n }\n\n public save() {\n this.findAndSetElements();\n // console.warn('scroll save', this.elements);\n this._save();\n }\n\n public _save() {\n const {scrollTop, scrollHeight, clientHeight} = this.container;\n\n // previousScrollHeight = scrollHeight;\n // previousScrollHeight = scrollHeight + padding;\n this.scrollHeight = scrollHeight;\n this.scrollTop = scrollTop;\n this.clientHeight = clientHeight;\n this.scrollHeightMinusTop = this.reverse ? scrollHeight - scrollTop : scrollTop;\n\n // this.chatInner.style.paddingTop = padding + 'px';\n /* if(reverse) {\n previousScrollHeightMinusTop = this.scrollable.scrollHeight - scrollTop;\n } else {\n previousScrollHeightMinusTop = scrollTop;\n } */\n }\n\n private onRestore(useReflow?: boolean) {\n if(IS_SAFARI && useReflow/* && !isAppleMobile */) { // * fix blinking and jumping\n reflowScrollableElement(this.container);\n }\n }\n\n private setScrollTop(newScrollTop: number, useReflow?: boolean) {\n // touchSupport for safari iOS\n // isTouchSupported && isApple && (container.container.style.overflow = 'hidden');\n this.scrollable.setScrollTopSilently(this.scrollTop = newScrollTop);\n // container.scrollTop = scrollHeight;\n // isTouchSupported && isApple && (container.container.style.overflow = '');\n\n this.onRestore(useReflow);\n }\n\n public restore(useReflow?: boolean) {\n const {scrollTop, scrollHeight} = this.scrollable;\n this.scrollHeight = scrollHeight;\n\n if(!this.elements.length) { // maybe all messages have been deleted\n this._restore(useReflow);\n return;\n }\n\n let anchor: ScrollSaver['elements'][0];\n // for(let i = this.elements.length - 1; i >= 0; --i) {\n // const _anchor = this.elements[i];\n // if(_anchor.element.parentElement) {\n // anchor = _anchor;\n // break;\n // }\n // }\n anchor = this.elements[this.elements.length - 1];\n\n if(!anchor?.element?.parentElement) { // try to find new anchor\n this.findAndSetElements();\n anchor = this.elements[this.elements.length - 1];\n\n if(!anchor) { // fallback to old method if smth is really strange\n this._restore(useReflow);\n return;\n }\n }\n\n const {element, rect} = anchor;\n const newRect = element.getBoundingClientRect();\n const diff = newRect.bottom - rect.bottom;\n this.setScrollTop(scrollTop + diff, useReflow);\n // if(diff) debugger;\n // console.warn('scroll restore', rect, diff, newRect);\n }\n\n public _restore(useReflow?: boolean) {\n const {scrollHeightMinusTop: previousScrollHeightMinusTop, scrollable} = this;\n // if(previousScrollHeightMinusTop === undefined) {\n // throw new Error('scroll was not saved');\n // }\n\n // const scrollHeight = container.scrollHeight;\n const scrollHeight = this.scrollHeight;\n // if(scrollHeight === this.scrollHeight) {\n // return;\n // }\n\n // this.scrollHeight = scrollHeight;\n\n /* const scrollHeight = container.scrollHeight;\n const addedHeight = scrollHeight - previousScrollHeight;\n\n this.chatInner.style.paddingTop = (10000 - addedHeight) + 'px'; */\n /* const scrollHeight = scrollHeight;\n const addedHeight = scrollHeight - previousScrollHeight;\n\n this.chatInner.style.paddingTop = (padding - addedHeight) + 'px';\n\n //const newScrollTop = reverse ? scrollHeight - previousScrollHeightMinusTop : previousScrollHeightMinusTop;\n const newScrollTop = reverse ? scrollHeight - addedHeight - previousScrollHeightMinusTop : previousScrollHeightMinusTop;\n this.log('performHistoryResult: will set scrollTop',\n previousScrollHeightMinusTop, scrollHeight,\n newScrollTop, container.container.clientHeight); */\n // const newScrollTop = reverse ? scrollHeight - previousScrollHeightMinusTop : previousScrollHeightMinusTop;\n const newScrollTop = this.reverse ? scrollHeight - previousScrollHeightMinusTop : previousScrollHeightMinusTop;\n\n /* if(DEBUG) {\n this.log('performHistoryResult: will set up scrollTop:', newScrollTop, this.isHeavyAnimationInProgress);\n } */\n\n this.setScrollTop(newScrollTop, useReflow);\n\n /* if(DEBUG) {\n this.log('performHistoryResult: have set up scrollTop:', newScrollTop, container.scrollTop, container.scrollHeight, this.isHeavyAnimationInProgress);\n } */\n }\n}\n\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.ScrollSaver = ScrollSaver);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Scrollable from '../components/scrollable';\nimport safeAssign from './object/safeAssign';\n\nexport default class ScrollableLoader {\n public loading = false;\n private scrollable: Scrollable;\n private getPromise: () => Promise;\n private promise: Promise;\n private loaded = false;\n\n constructor(options: {\n scrollable: ScrollableLoader['scrollable'],\n getPromise: ScrollableLoader['getPromise']\n }) {\n safeAssign(this, options);\n\n options.scrollable.onScrolledBottom = () => {\n this.load();\n };\n }\n\n public load() {\n if(this.loaded) {\n return Promise.resolve();\n }\n\n if(this.loading) {\n return this.promise;\n }\n\n this.loading = true;\n this.promise = this.getPromise().then((done) => {\n this.loading = false;\n this.promise = undefined;\n\n if(done) {\n this.loaded = true;\n this.scrollable.onScrolledBottom = null;\n } else {\n this.scrollable.checkForTriggers();\n }\n }, () => {\n this.promise = undefined;\n this.loading = false;\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MediaSearchContext} from '../components/appMediaPlaybackController';\nimport type {SearchSuperContext} from '../components/appSearchSuper.';\nimport type {Message} from '../layer';\nimport type {MessagesStorageKey, MyMessage} from '../lib/appManagers/appMessagesManager';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport incrementMessageId from '../lib/appManagers/utils/messageId/incrementMessageId';\nimport rootScope from '../lib/rootScope';\nimport forEachReverse from './array/forEachReverse';\nimport filterChatPhotosMessages from './filterChatPhotosMessages';\nimport ListLoader, {ListLoaderOptions} from './listLoader';\n\nexport default class SearchListLoader extends ListLoader {\n public searchContext: MediaSearchContext;\n public onEmptied: () => void;\n\n private otherSideLoader: SearchListLoader;\n private managers: AppManagers;\n\n constructor(options: Omit, 'loadMore'> & {\n onEmptied?: () => void,\n isInner?: boolean,\n managers?: AppManagers\n } = {}) {\n super({\n ...options,\n loadMore: (anchor, older, loadCount) => {\n const backLimit = older ? 0 : loadCount;\n let maxId = anchor?.mid;\n\n if(maxId === undefined) maxId = this.searchContext.maxId;\n if(!older) maxId = incrementMessageId(maxId, 1);\n\n return this.managers.appMessagesManager.getSearch({\n ...this.searchContext,\n peerId: this.searchContext.peerId || anchor?.peerId,\n maxId,\n limit: backLimit ? 0 : loadCount,\n backLimit\n }).then((value) => {\n /* if(DEBUG) {\n this.log('loaded more media by maxId:', maxId, value, older, this.reverse);\n } */\n\n if(this.searchContext.inputFilter._ === 'inputMessagesFilterChatPhotos') {\n filterChatPhotosMessages(value);\n }\n\n if(value.next_rate) {\n this.searchContext.nextRate = value.next_rate;\n }\n\n return {count: value.count, items: value.history};\n });\n },\n processItem: async(message) => {\n const filtered = await this.filterMids([message.mid]);\n if(!filtered.length) {\n return;\n }\n\n return options.processItem(message);\n }\n });\n\n this.managers ??= rootScope.managers;\n rootScope.addEventListener('history_delete', this.onHistoryDelete);\n rootScope.addEventListener('history_multiappend', this.onHistoryMultiappend);\n rootScope.addEventListener('message_sent', this.onMessageSent);\n\n if(!options.isInner) {\n this.otherSideLoader = new SearchListLoader({\n ...options,\n isInner: true\n });\n\n // this.otherSideLoader.onLoadedMore = () => {\n\n // };\n }\n }\n\n protected async filterMids(mids: number[]) {\n const storageKey: MessagesStorageKey = `${this.searchContext.peerId}_${this.searchContext.isScheduled ? 'scheduled' : 'history'}`;\n const filtered = (await this.managers.appMessagesManager.filterMessagesByInputFilterFromStorage(this.searchContext.inputFilter._, mids, storageKey, mids.length)) as Message.message[];\n return filtered;\n }\n\n protected onHistoryDelete = ({peerId, msgs}: {peerId: PeerId, msgs: Set}) => {\n const shouldBeDeleted = (item: Item) => item.peerId === peerId && msgs.has(item.mid);\n const filter = (item: Item, idx: number, arr: Item[]) => {\n if(shouldBeDeleted(item)) {\n arr.splice(idx, 1);\n }\n };\n\n forEachReverse(this.previous, filter);\n forEachReverse(this.next, filter);\n\n if(this.current && shouldBeDeleted(this.current)) {\n this.current = undefined;\n /* if(this.go(1)) {\n this.previous.splice(this.previous.length - 1, 1);\n } else if(this.go(-1)) {\n this.next.splice(0, 1);\n } else */if(this.onEmptied) {\n this.onEmptied();\n }\n }\n };\n\n protected onHistoryMultiappend = async(message: Message.message | Message.messageService) => {\n if(this.searchContext.folderId !== undefined) {\n return;\n }\n\n // because it's reversed\n if(!this.loadedAllUp || this.loadPromiseUp) {\n return;\n }\n\n if(message.peerId !== this.searchContext.peerId) {\n return;\n }\n\n const filtered = await this.filterMids([message.mid]);\n const targets = (await Promise.all(filtered.map((message) => this.processItem(message)))).filter(Boolean);\n if(targets.length) {\n /* const {previous, current, next} = this;\n const targets = previous.concat(current, next);\n const currentIdx = targets.length;\n const mid = targets[0].mid;\n let i = 0, length = targets.length;\n for(; i < length; ++i) {\n const target = targets[i];\n if(!target || mid < target.mid) {\n break;\n }\n }\n\n if(i < currentIdx) previous.push(...targets);\n else next. */\n\n if(!this.current) {\n this.previous.push(...targets);\n } else {\n this.next.push(...targets);\n }\n }\n };\n\n protected onMessageSent = ({message}: {message: MyMessage}) => {\n this.onHistoryMultiappend(message);\n };\n\n public setSearchContext(context: SearchSuperContext) {\n this.searchContext = context;\n\n if(this.searchContext.folderId !== undefined) {\n this.loadedAllUp = true;\n\n if(this.searchContext.nextRate === undefined) {\n this.loadedAllDown = true;\n }\n }\n\n if(this.searchContext.inputFilter._ === 'inputMessagesFilterChatPhotos') {\n this.loadedAllUp = true;\n }\n\n if(this.searchContext.useSearch === false) {\n this.loadedAllDown = this.loadedAllUp = true;\n }\n\n if(this.otherSideLoader) {\n this.otherSideLoader.setSearchContext(context);\n }\n }\n\n public reset() {\n super.reset();\n this.searchContext = undefined;\n\n if(this.otherSideLoader) {\n this.otherSideLoader.reset();\n }\n }\n\n public getPrevious(withOtherSide?: boolean) {\n let previous = this.previous;\n\n if(this.otherSideLoader && withOtherSide) {\n previous = previous.concat(this.otherSideLoader.previous);\n }\n\n return previous;\n }\n\n public getNext(withOtherSide?: boolean) {\n let next = this.next;\n\n if(this.otherSideLoader && withOtherSide) {\n next = next.concat(this.otherSideLoader.next);\n }\n\n return next;\n }\n\n public getCurrent() {\n return this.current || this.otherSideLoader?.current;\n }\n\n private goToOtherEnd(length: number) {\n if(length > 0) return this.go(-this.previous.length);\n else return this.go(this.next.length);\n }\n\n public goRound(length: number, dispatchJump?: boolean) {\n let ret: ReturnType['goUnsafe']>;\n\n if(this.otherSideLoader?.current) {\n ret = this.otherSideLoader.goUnsafe(length, dispatchJump);\n if(ret.item) {\n return ret.item;\n }\n\n length = ret.leftLength;\n if(!(length > 0 ? this.otherSideLoader.next : this.otherSideLoader.previous).length) {\n const loaded = length > 0 ? this.otherSideLoader.loadedAllUp : this.otherSideLoader.loadedAllDown;\n if(!loaded) { // do not reset anything until it's loaded\n return;\n }\n\n // if other side is loaded too will start from its begin\n if((length > 0 && (this.otherSideLoader.searchContext.maxId === 1 || this.otherSideLoader.loadedAllDown)) ||\n (length < 0 && (this.otherSideLoader.searchContext.maxId === 0 || this.otherSideLoader.loadedAllUp))) {\n return this.otherSideLoader.goToOtherEnd(length);\n }\n\n this.otherSideLoader.unsetCurrent(length > 0);\n }\n }\n\n ret = this.goUnsafe(length, dispatchJump);\n if(!ret.item) {\n if(this.loadedAllUp && this.loadedAllDown) { // just use the same loader if the list is too short\n return this.goToOtherEnd(length);\n } else if(this.otherSideLoader) {\n length = ret.leftLength;\n ret = this.otherSideLoader.goUnsafe(length, dispatchJump);\n\n if(ret.item) {\n this.unsetCurrent(length > 0);\n }\n }\n }\n\n return ret?.item;\n }\n\n // public setTargets(previous: Item[], next: Item[], reverse: boolean) {\n // super.setTargets(previous, next, reverse);\n // }\n\n protected setLoaded(down: boolean, value: boolean) {\n const changed = super.setLoaded(down, value);\n\n if(changed &&\n this.otherSideLoader &&\n value &&\n this.searchContext?.useSearch !== false/* &&\n (this.reverse ? this.loadedAllUp : this.loadedAllDown) */) {\n const reverse = this.loadedAllUp;\n this.otherSideLoader.setSearchContext({\n ...this.searchContext,\n maxId: reverse ? 1 : 0\n });\n\n // these 'reverse' are different, not a mistake here.\n this.otherSideLoader.reverse = this.reverse;\n this.otherSideLoader.setLoaded(reverse, true);\n this.otherSideLoader.load(!reverse);\n }\n\n return changed;\n }\n\n public cleanup() {\n this.reset();\n rootScope.removeEventListener('history_delete', this.onHistoryDelete);\n rootScope.removeEventListener('history_multiappend', this.onHistoryMultiappend);\n rootScope.removeEventListener('message_sent', this.onMessageSent);\n this.onEmptied = undefined;\n\n if(this.otherSideLoader) {\n this.otherSideLoader.cleanup();\n this.otherSideLoader = undefined;\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport generateMessageId from './generateMessageId';\nimport getServerMessageId from './getServerMessageId';\n\nexport default function incrementMessageId(messageId: number, increment: number) {\n return generateMessageId(getServerMessageId(messageId) + increment);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {fastRaf} from './schedulers';\nimport deferredPromise, {CancellablePromise} from './cancellablePromise';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport isInDOM from './dom/isInDOM';\n\nclass SequentialDom {\n private promises: Partial<{\n read: CancellablePromise,\n write: CancellablePromise\n }> = {};\n private raf = fastRaf.bind(null);\n private scheduled = false;\n\n private do(kind: keyof SequentialDom['promises'], callback?: VoidFunction) {\n let promise = this.promises[kind];\n if(!promise) {\n this.scheduleFlush();\n promise = this.promises[kind] = deferredPromise();\n }\n\n if(callback !== undefined) {\n promise.then(() => callback());\n }\n\n return promise;\n }\n\n public measure(callback?: VoidFunction) {\n return this.do('read', callback);\n }\n\n public mutate(callback?: VoidFunction) {\n return this.do('write', callback);\n }\n\n /**\n * Will fire instantly if element is not connected\n * @param element\n * @param callback\n */\n public mutateElement(element: HTMLElement, callback?: VoidFunction) {\n const isConnected = isInDOM(element);\n const promise = isConnected ? this.mutate() : Promise.resolve();\n\n if(callback !== undefined) {\n if(!isConnected) {\n callback();\n } else {\n promise.then(() => callback());\n }\n }\n\n return promise;\n }\n\n private scheduleFlush() {\n if(!this.scheduled) {\n this.scheduled = true;\n\n this.raf(() => {\n this.promises.read && this.promises.read.resolve();\n this.promises.write && this.promises.write.resolve();\n\n this.scheduled = false;\n this.promises = {};\n });\n }\n }\n}\n\nconst sequentialDom = new SequentialDom();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.sequentialDom = sequentialDom);\nexport default sequentialDom;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {PhotoSize, WebDocument} from '../layer';\nimport {REPLIES_HIDDEN_CHANNEL_ID} from '../lib/mtproto/mtproto_config';\nimport {MyDocument} from '../lib/appManagers/appDocsManager';\nimport {MyPhoto} from '../lib/appManagers/appPhotosManager';\nimport choosePhotoSize from '../lib/appManagers/utils/photos/choosePhotoSize';\nimport {MediaSize, makeMediaSize} from './mediaSize';\nimport isWebDocument from '../lib/appManagers/utils/webDocs/isWebDocument';\n\nexport default function setAttachmentSize(\n photo: MyPhoto | MyDocument | WebDocument,\n element: HTMLElement | SVGForeignObjectElement,\n boxWidth: number,\n boxHeight: number,\n noZoom = true,\n message?: any,\n pushDocumentSize?: boolean,\n photoSize?: ReturnType\n) {\n const _isWebDocument = isWebDocument(photo);\n // if(_isWebDocument && pushDocumentSize === undefined) {\n // pushDocumentSize = true;\n // }\n\n if(!photoSize) {\n photoSize = choosePhotoSize(photo, boxWidth, boxHeight, undefined, pushDocumentSize);\n }\n // console.log('setAttachmentSize', photo, photo.sizes[0].bytes, div);\n\n let size: MediaSize;\n const isDocument = photo._ === 'document';\n if(isDocument || _isWebDocument) {\n size = makeMediaSize(photo.w || (photoSize as PhotoSize.photoSize).w || 512, photo.h || (photoSize as PhotoSize.photoSize).h || 512);\n } else {\n size = makeMediaSize((photoSize as PhotoSize.photoSize).w || 100, (photoSize as PhotoSize.photoSize).h || 100);\n }\n\n let boxSize = makeMediaSize(boxWidth, boxHeight);\n\n boxSize = size = size.aspect(boxSize, noZoom);\n\n let isFit = true;\n\n if(!isDocument || ['video', 'gif'].includes(photo.type) || _isWebDocument) {\n if(boxSize.width < 200 && boxSize.height < 200) { // make at least one side this big\n boxSize = size = size.aspectCovered(makeMediaSize(200, 200));\n }\n\n if(message &&\n (message.message ||\n message.reply_to_mid ||\n message.media.webpage ||\n (message.replies && message.replies.pFlags.comments && message.replies.channel_id.toChatId() !== REPLIES_HIDDEN_CHANNEL_ID)\n )\n ) { // make sure that bubble block is human-readable\n if(boxSize.width < 320) {\n boxSize = makeMediaSize(320, boxSize.height);\n isFit = false;\n }\n }\n\n if(isFit && boxSize.width < 120 && message) { // if image is too narrow\n boxSize = makeMediaSize(120, boxSize.height);\n isFit = false;\n }\n }\n\n // if(element instanceof SVGForeignObjectElement) {\n // element.setAttributeNS(null, 'width', '' + w);\n // element.setAttributeNS(null, 'height', '' + h);\n\n // //console.log('set dimensions to svg element:', element, w, h);\n // } else {\n element.style.width = boxSize.width + 'px';\n element.style.height = boxSize.height + 'px';\n // }\n\n return {photoSize, size, isFit};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {logger} from '../lib/logger';\nimport insertInDescendSortedArray from './array/insertInDescendSortedArray';\nimport {getMiddleware, MiddlewareHelper} from './middleware';\nimport middlewarePromise from './middlewarePromise';\nimport safeAssign from './object/safeAssign';\nimport pause from './schedulers/pause';\n\nexport type SortedElementBase = {\n id: T,\n index: number\n};\n\nlet id = 0;\n\nexport class BatchProcessor {\n protected queue: Promise[];\n protected promise: Promise;\n\n protected middlewareHelper: MiddlewareHelper;\n protected log: ReturnType;\n\n protected process: (batch: Item[], m: ReturnType, log: BatchProcessor['log']) => Promise;\n protected possibleError: any;\n\n constructor(options: {\n log?: BatchProcessor['log'],\n // middleware: MiddlewareHelper,\n process: BatchProcessor['process'],\n possibleError?: BatchProcessor['possibleError']\n }) {\n safeAssign(this, options);\n\n this.queue = [];\n this.middlewareHelper ??= getMiddleware();\n\n const prefix = 'BATCH-PROCESSOR-' + ++id;\n if(this.log) {\n this.log = this.log.bindPrefix(prefix);\n } else {\n this.log = logger(prefix);\n }\n }\n\n public get queuePromise() {\n return this.promise;\n }\n\n public clear() {\n this.log('clear');\n this.queue.length = 0;\n this.promise = undefined;\n this.middlewareHelper.clean();\n }\n\n public addToQueue(item: BatchProcessor['queue'][0]) {\n this.queue.push(item);\n return this.setQueue();\n }\n\n protected setQueue() {\n if(!this.queue.length) {\n return Promise.resolve();\n }\n\n if(this.promise) {\n return this.promise;\n }\n\n const middleware = this.middlewareHelper.get();\n const log = this.log.bindPrefix('queue');\n const m = middlewarePromise(middleware, this.possibleError);\n\n const processQueue = async(): Promise => {\n log('start', this.queue.length);\n\n const queue = this.queue.splice(0, this.queue.length);\n\n const perf = performance.now();\n const promises = queue.map((promise) => {\n promise.then((details) => {\n log('render item time', performance.now() - perf, details);\n });\n\n return promise;\n });\n\n const renderedQueue = await m(Promise.all(promises));\n await m(this.process(renderedQueue, m, log));\n\n log('queue rendered');\n\n if(this.queue.length) {\n log('have new items to render');\n return processQueue();\n } else {\n log('end');\n }\n };\n\n log('setting pause');\n const promise = this.promise = m(pause(0))\n .then(\n () => processQueue().catch((err: ApiError) => {\n if(err !== this.possibleError) {\n log.error('process queue error', err);\n }\n\n throw err;\n }),\n (err) => {\n log('pause has been cleared');\n throw err;\n }\n )\n .finally(() => {\n if(this.promise === promise) {\n this.promise = undefined;\n }\n });\n\n return promise;\n }\n}\n\nexport default class SortedList {\n protected elements: Map;\n protected sorted: Array;\n\n protected getIndex: (element: SortedElement) => PromiseLike | number;\n protected onDelete: (element: SortedElement) => void;\n protected onUpdate: (element: SortedElement) => void;\n protected onSort: (element: SortedElement, idx: number) => void;\n protected onElementCreate: (base: SortedElementBase) => PromiseLike | SortedElement;\n\n protected updateElementWith = (callback: () => void) => callback();\n protected updateListWith = (callback: (canUpdate: boolean | undefined) => void) => callback(true);\n\n protected middleware: MiddlewareHelper;\n\n protected batchProcessor: BatchProcessor;\n\n protected log: ReturnType;\n\n constructor(options: {\n getIndex: SortedList['getIndex'],\n onDelete?: SortedList['onDelete'],\n onUpdate?: SortedList['onUpdate'],\n onSort?: SortedList['onSort'],\n onElementCreate: SortedList['onElementCreate'],\n\n updateElementWith?: SortedList['updateElementWith'],\n updateListWith?: SortedList['updateListWith'],\n\n log?: SortedList['log']\n }) {\n safeAssign(this, options);\n\n this.elements = new Map();\n this.sorted = [];\n this.middleware = getMiddleware();\n\n this.batchProcessor = new BatchProcessor({\n log: this.log,\n process: async(batch, m, log) => {\n // const elements = await Promise.all(batch.map((element) => this.onElementCreate(element)));\n const elements = batch;\n const promises = elements.map((element) => this.update(element.id, element));\n await m(Promise.all(promises));\n }\n });\n }\n\n public clear() {\n this.batchProcessor.clear();\n this.middleware.clean();\n this.elements.clear();\n this.sorted.length = 0;\n }\n\n protected _updateList() {\n this.elements.forEach((element) => {\n this.update(element.id);\n });\n\n if(this.onSort) {\n this.sorted.forEach((element, idx) => {\n this.onSort(element, idx);\n });\n }\n }\n\n public updateList(callback?: (updated: boolean) => void) {\n const middleware = this.middleware.get();\n this.updateListWith((canUpdate) => {\n if(!middleware() || (canUpdate !== undefined && !canUpdate)) {\n callback?.(false);\n return;\n }\n\n this._updateList();\n\n callback?.(true);\n });\n }\n\n public has(id: SortedElementId) {\n return this.elements.has(id);\n }\n\n public get(id: SortedElementId) {\n return this.elements.get(id);\n }\n\n public getAll() {\n return this.elements;\n }\n\n public async add(id: SortedElementId) {\n const element = this.get(id);\n if(element) {\n return;\n // return element;\n }\n\n const base: SortedElementBase = {\n id,\n index: 0\n };\n\n this.elements.set(id, base as SortedElement);\n const createPromise = Promise.resolve(this.onElementCreate(base));\n return this.batchProcessor.addToQueue(createPromise);\n\n // return element;\n }\n\n public delete(id: SortedElementId, noScheduler?: boolean) {\n const element = this.elements.get(id);\n if(!element) {\n return false;\n }\n\n this.elements.delete(id);\n\n const idx = this.sorted.indexOf(element);\n if(idx !== -1) {\n this.sorted.splice(idx, 1);\n }\n\n if(this.onDelete) {\n if(noScheduler) {\n this.onDelete(element);\n } else {\n const middleware = this.middleware.get();\n this.updateElementWith(() => {\n if(!middleware()) {\n return;\n }\n\n this.onDelete(element);\n });\n }\n }\n\n return true;\n }\n\n public async update(id: SortedElementId, element = this.get(id)) {\n if(!element) {\n return;\n }\n\n element.index = await this.getIndex(element);\n if(this.get(id) !== element) {\n return;\n }\n\n this.onUpdate?.(element);\n\n const idx = insertInDescendSortedArray(this.sorted, element, 'index');\n this.onSort(element, idx);\n }\n}\n","const BOM = '';\n// const BOM = 'K';\nexport default BOM;\n","export default function encodeEntities(value: string) {\n return value.replace(/&/g, '&').replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, (value) => {\n const hi = value.charCodeAt(0);\n const low = value.charCodeAt(1);\n return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';\n }).replace(/([^\\#-~| |!])/g, (value) => { // non-alphanumeric\n return '&#' + value.charCodeAt(0) + ';';\n }).replace(//g, '>');\n}\n","// credits to https://github.com/sindresorhus/escape-string-regexp/blob/master/index.js\nexport default function escapeRegExp(str: string) {\n return str\n .replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n .replace(/-/g, '\\\\x2d');\n}\n","export default function limitSymbols(str: string, length: number, limitFrom = length + 10) {\n str = str.trim();\n if(str.length > limitFrom) {\n str = str.slice(0, length)/* .replace(/\\s*$/, '') */ + '...';\n }\n\n return str;\n}\n","const NBSP = '‎';\nexport default NBSP;\n","export default function toHHMMSS(str: string | number, leadZero = false) {\n const sec_num = parseInt(str + '', 10);\n const hours = Math.floor(sec_num / 3600);\n let minutes: any = Math.floor((sec_num - (hours * 3600)) / 60);\n let seconds: any = sec_num - (hours * 3600) - (minutes * 60);\n\n if(hours) leadZero = true;\n if(minutes < 10) minutes = leadZero ? '0' + minutes : minutes;\n if(seconds < 10) seconds = '0' + seconds;\n return (hours ? /* ('0' + hours).slice(-2) */hours + ':' : '') + minutes + ':' + seconds;\n}\n","export default function textToSvgURL(text: string) {\n const blob = new Blob([text], {type: 'image/svg+xml;charset=utf-8'});\n\n // * because iOS Safari doesn't want to eat objectURL\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.onload = (e) => {\n resolve(e.target.result as string);\n };\n reader.readAsDataURL(blob);\n });\n // return URL.createObjectURL(blob);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport {IS_WORKER} from './context';\n\nexport class WindowSize {\n public width: number;\n public height: number;\n\n constructor() {\n if(IS_WORKER) {\n return;\n }\n\n const w = 'visualViewport' in window ? window.visualViewport : window;\n const set = () => {\n this.width = w.width || (w as any as Window).innerWidth;\n this.height = w.height || (w as any as Window).innerHeight;\n };\n w.addEventListener('resize', set);\n set();\n }\n}\n\nconst windowSize = new WindowSize();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.windowSize = windowSize);\nexport default windowSize;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// * Jolly Cobra's useHeavyAnimationCheck.ts, patched\n\nimport {AnyToVoidFunction} from '../types';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport deferredPromise, {CancellablePromise} from '../helpers/cancellablePromise';\nimport DEBUG from '../config/debug';\nimport pause from '../helpers/schedulers/pause';\nimport EventListenerBase from '../helpers/eventListenerBase';\n\nconst eventListener = new EventListenerBase<{\n start: () => void,\n end: () => void\n}>();\nconst ANIMATION_START_EVENT = 'start';\nconst ANIMATION_END_EVENT = 'end';\n\nlet isAnimating = false;\nlet heavyAnimationPromise: CancellablePromise = deferredPromise();\nlet promisesInQueue = 0;\n\nheavyAnimationPromise.resolve();\n\nconst log = console.log.bind(console.log, '[HEAVY-ANIMATION]:');\n\nexport function dispatchHeavyAnimationEvent(promise: Promise, timeout?: number) {\n if(!isAnimating) {\n heavyAnimationPromise = deferredPromise();\n eventListener.dispatchEvent(ANIMATION_START_EVENT);\n isAnimating = true;\n DEBUG && log('start');\n }\n\n ++promisesInQueue;\n DEBUG && log('attach promise, length:', promisesInQueue, timeout);\n\n const promises = [\n timeout !== undefined ? pause(timeout) : undefined,\n promise.finally(() => {})\n ].filter(Boolean);\n\n const perf = performance.now();\n const _heavyAnimationPromise = heavyAnimationPromise;\n Promise.race(promises).then(() => {\n if(heavyAnimationPromise !== _heavyAnimationPromise || heavyAnimationPromise.isFulfilled) { // interrupted\n return;\n }\n\n --promisesInQueue;\n DEBUG && log('promise end, length:', promisesInQueue, performance.now() - perf);\n if(promisesInQueue <= 0) {\n onHeavyAnimationEnd();\n }\n });\n\n return heavyAnimationPromise;\n}\n\n(window as any).dispatchHeavyAnimationEvent = dispatchHeavyAnimationEvent;\n\nfunction onHeavyAnimationEnd() {\n if(heavyAnimationPromise.isFulfilled) {\n return;\n }\n\n isAnimating = false;\n promisesInQueue = 0;\n eventListener.dispatchEvent(ANIMATION_END_EVENT);\n heavyAnimationPromise.resolve();\n\n DEBUG && log('end');\n}\n\nexport function interruptHeavyAnimation() {\n onHeavyAnimationEnd();\n}\n\nexport function getHeavyAnimationPromise() {\n return heavyAnimationPromise;\n}\n\nexport default function(\n handleAnimationStart: AnyToVoidFunction,\n handleAnimationEnd: AnyToVoidFunction,\n listenerSetter?: ListenerSetter\n) {\n // useEffect(() => {\n if(isAnimating) {\n handleAnimationStart();\n }\n\n const add = listenerSetter ? listenerSetter.add(eventListener) : eventListener.addEventListener.bind(eventListener);\n const remove = listenerSetter ? listenerSetter.removeManual.bind(listenerSetter, eventListener) : eventListener.removeEventListener.bind(eventListener);\n add(ANIMATION_START_EVENT, handleAnimationStart);\n add(ANIMATION_END_EVENT, handleAnimationEnd);\n\n return () => {\n remove(ANIMATION_END_EVENT, handleAnimationEnd);\n remove(ANIMATION_START_EVENT, handleAnimationStart);\n };\n // }, [handleAnimationEnd, handleAnimationStart]);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Dialog} from '../lib/appManagers/appMessagesManager';\nimport type {ForumTopic} from '../layer';\nimport appDialogsManager, {DIALOG_LIST_ELEMENT_TAG} from '../lib/appManagers/appDialogsManager';\nimport rootScope from '../lib/rootScope';\nimport {ButtonMenuItemOptionsVerifiable, ButtonMenuSync} from './buttonMenu';\nimport PopupDeleteDialog from './popups/deleteDialog';\nimport {i18n, LangPackKey, _i18n} from '../lib/langPack';\nimport findUpTag from '../helpers/dom/findUpTag';\nimport {toastNew} from './toast';\nimport PopupMute from './popups/mute';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport {GENERAL_TOPIC_ID} from '../lib/mtproto/mtproto_config';\nimport showLimitPopup from './popups/limit';\nimport createContextMenu from '../helpers/dom/createContextMenu';\nimport PopupElement from './popups';\n\nexport default class DialogsContextMenu {\n private buttons: ButtonMenuItemOptionsVerifiable[];\n\n private peerId: PeerId;\n private filterId: number;\n private threadId: number;\n private dialog: Dialog | ForumTopic.forumTopic;\n private canManageTopics: boolean;\n private li: HTMLElement;\n\n constructor(private managers: AppManagers) {\n\n }\n\n public attach(element: HTMLElement) {\n createContextMenu({\n listenTo: element,\n buttons: this.getButtons(),\n appendTo: document.getElementById('page-chats'),\n onOpen: async(li) => {\n this.li = li;\n li.classList.add('menu-open');\n this.peerId = li.dataset.peerId.toPeerId();\n this.threadId = +li.dataset.threadId || undefined;\n this.dialog = await this.managers.dialogsStorage.getDialogOrTopic(this.peerId, this.threadId);\n this.filterId = this.threadId ? undefined : appDialogsManager.filterId;\n this.canManageTopics = this.threadId ? await this.managers.appChatsManager.hasRights(this.peerId.toChatId(), 'manage_topics') : undefined;\n },\n onBeforeOpen: async() => {\n // delete button\n const langPackKey: LangPackKey = this.threadId ? 'Delete' : await this.managers.appPeersManager.getDeleteButtonText(this.peerId);\n const lastButton = this.buttons[this.buttons.length - 1];\n if(lastButton?.element) {\n lastButton.element.lastChild.replaceWith(i18n(langPackKey));\n }\n },\n onClose: () => {\n this.li.classList.remove('menu-open');\n this.li = this.peerId = this.dialog = this.filterId = this.threadId = this.canManageTopics = undefined;\n },\n findElement: (e) => {\n return findUpTag(e.target, DIALOG_LIST_ELEMENT_TAG);\n }\n });\n }\n\n private getButtons() {\n return this.buttons ??= [{\n icon: 'unread',\n text: 'MarkAsUnread',\n onClick: this.onUnreadClick,\n verify: async() => !this.threadId && !(await this.managers.appMessagesManager.isDialogUnread(this.dialog))\n }, {\n icon: 'readchats',\n text: 'MarkAsRead',\n onClick: this.onUnreadClick,\n verify: () => this.managers.appMessagesManager.isDialogUnread(this.dialog)\n }, {\n icon: 'pin',\n text: 'ChatList.Context.Pin',\n onClick: this.onPinClick,\n verify: async() => {\n if(this.threadId && !this.canManageTopics) {\n return false;\n }\n\n const isPinned = this.filterId !== undefined && this.filterId > 1 ?\n (await this.managers.appMessagesManager.getFilter(this.filterId)).pinnedPeerIds.includes(this.dialog.peerId) :\n !!this.dialog.pFlags?.pinned;\n return !isPinned;\n }\n }, {\n icon: 'unpin',\n text: 'ChatList.Context.Unpin',\n onClick: this.onPinClick,\n verify: async() => {\n if(this.threadId && !this.canManageTopics) {\n return false;\n }\n\n const isPinned = this.filterId !== undefined && this.filterId > 1 ?\n (await this.managers.appMessagesManager.getFilter(this.filterId)).pinnedPeerIds.includes(this.dialog.peerId) :\n !!this.dialog.pFlags?.pinned;\n return isPinned;\n }\n }, {\n icon: 'mute',\n text: 'ChatList.Context.Mute',\n onClick: this.onMuteClick,\n verify: async() => {\n return this.peerId !== rootScope.myId && !(await this.managers.appNotificationsManager.isPeerLocalMuted({peerId: this.dialog.peerId, threadId: this.threadId}));\n }\n }, {\n icon: 'unmute',\n text: 'ChatList.Context.Unmute',\n onClick: this.onUnmuteClick,\n verify: async() => {\n return this.peerId !== rootScope.myId && (await this.managers.appNotificationsManager.isPeerLocalMuted({peerId: this.dialog.peerId, threadId: this.threadId}));\n }\n }, {\n icon: 'archive',\n text: 'Archive',\n onClick: this.onArchiveClick,\n verify: () => this.filterId === 0 && this.peerId !== rootScope.myId\n }, {\n icon: 'unarchive',\n text: 'Unarchive',\n onClick: this.onArchiveClick,\n verify: () => this.filterId === 1 && this.peerId !== rootScope.myId\n }, {\n icon: 'hide',\n text: 'Hide',\n onClick: this.onHideTopicClick,\n verify: () => {\n return this.canManageTopics && (this.dialog as ForumTopic.forumTopic).id === GENERAL_TOPIC_ID;\n }\n }, {\n icon: 'lock',\n text: 'CloseTopic',\n onClick: this.onToggleTopicClick,\n verify: () => {\n return this.canManageTopics && !(this.dialog as ForumTopic.forumTopic).pFlags.closed;\n }\n }, {\n icon: 'lockoff',\n text: 'RestartTopic',\n onClick: this.onToggleTopicClick,\n verify: () => {\n return this.canManageTopics && !!(this.dialog as ForumTopic.forumTopic).pFlags.closed;\n }\n }, {\n icon: 'delete danger',\n text: 'Delete',\n onClick: this.onDeleteClick,\n verify: () => {\n if(this.threadId) {\n if(!this.canManageTopics) {\n return false;\n }\n\n return (this.dialog as ForumTopic.forumTopic).id !== GENERAL_TOPIC_ID;\n }\n\n return true;\n }\n }];\n }\n\n private onArchiveClick = async() => {\n const dialog = await this.managers.appMessagesManager.getDialogOnly(this.peerId);\n if(dialog) {\n this.managers.appMessagesManager.editPeerFolders([dialog.peerId], +!dialog.folder_id);\n }\n };\n\n private onHideTopicClick = () => {\n this.managers.appChatsManager.editForumTopic({\n chatId: this.peerId.toChatId(),\n topicId: this.threadId,\n hidden: true\n });\n };\n\n private onToggleTopicClick = () => {\n this.managers.appChatsManager.editForumTopic({\n chatId: this.peerId.toChatId(),\n topicId: this.threadId,\n closed: !(this.dialog as ForumTopic.forumTopic).pFlags.closed\n });\n };\n\n private onPinClick = () => {\n const {peerId, filterId, threadId} = this;\n this.managers.appMessagesManager.toggleDialogPin({\n peerId,\n filterId,\n topicId: threadId\n }).catch(async(err: ApiError) => {\n if(err.type === 'PINNED_DIALOGS_TOO_MUCH' || err.type === 'PINNED_TOO_MUCH') {\n if(threadId) {\n this.managers.apiManager.getLimit('topicPin').then((limit) => {\n toastNew({langPackKey: 'LimitReachedPinnedTopics', langPackArguments: [limit]});\n });\n } else if(filterId >= 1) {\n toastNew({langPackKey: 'PinFolderLimitReached'});\n } else {\n showLimitPopup('pin');\n }\n }\n });\n };\n\n private onUnmuteClick = () => {\n this.managers.appMessagesManager.togglePeerMute({peerId: this.peerId, mute: false, threadId: this.threadId});\n };\n\n private onMuteClick = () => {\n PopupElement.createPopup(PopupMute, this.peerId, this.threadId);\n };\n\n private onUnreadClick = async() => {\n const {peerId, dialog} = this;\n if(dialog.unread_count) {\n this.managers.appMessagesManager.readHistory(peerId, dialog.top_message, this.threadId);\n\n if(!this.threadId) {\n this.managers.appMessagesManager.markDialogUnread(peerId, true);\n }\n } else if(!this.threadId) {\n this.managers.appMessagesManager.markDialogUnread(peerId);\n }\n };\n\n private onDeleteClick = () => {\n PopupElement.createPopup(PopupDeleteDialog, this.peerId, undefined, undefined, this.threadId);\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport App from '../config/app';\nimport DEBUG from '../config/debug';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport {LangPackKey, i18n} from '../lib/langPack';\nimport {logger} from '../lib/logger';\nimport rootScope from '../lib/rootScope';\nimport Button from './button';\nimport ProgressivePreloader from './preloader';\nimport SetTransition from './singleTransition';\nimport sessionStorage from '../lib/sessionStorage';\nimport {ConnectionStatus} from '../lib/mtproto/connectionStatus';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport singleInstance from '../lib/mtproto/singleInstance';\n\nexport default class ConnectionStatusComponent {\n public static CHANGE_STATE_DELAY = 1000;\n\n private statusContainer: HTMLElement;\n private statusEl: HTMLElement;\n private statusPreloader: ProgressivePreloader;\n\n private currentLangPackKey: LangPackKey;\n\n private hadConnect = false;\n private retryAt: number;\n private connecting = false;\n private timedOut = false;\n private updating = false;\n\n private log: ReturnType;\n\n private setFirstConnectionTimeout: number;\n private setStateTimeout: number;\n\n constructor(private managers: AppManagers, chatsContainer: HTMLElement) {\n this.log = logger('CS', undefined, undefined);\n\n this.statusContainer = document.createElement('div');\n this.statusContainer.classList.add('connection-status'/* , 'hide' */);\n\n this.statusEl = Button('btn-primary bg-warning connection-status-button', {noRipple: true});\n this.statusPreloader = new ProgressivePreloader({cancelable: false});\n this.statusPreloader.constructContainer({color: 'transparent', bold: true});\n this.statusContainer.append(this.statusEl);\n\n chatsContainer.prepend(this.statusContainer);\n\n rootScope.addEventListener('connection_status_change', (status) => {\n // console.log(status);\n\n this.setConnectionStatus();\n });\n\n rootScope.addEventListener('state_synchronizing', (channelId) => {\n if(!channelId) {\n this.updating = true;\n DEBUG && this.log('updating', this.updating);\n this.setState();\n }\n });\n\n rootScope.addEventListener('state_synchronized', (channelId) => {\n DEBUG && this.log('state_synchronized', channelId);\n if(!channelId) {\n this.updating = false;\n DEBUG && this.log('updating', this.updating);\n this.setState();\n }\n });\n\n this.setFirstConnectionTimeout = window.setTimeout(this.setConnectionStatus, ConnectionStatusComponent.CHANGE_STATE_DELAY + 1e3);\n\n // let bool = true;\n // document.addEventListener('dblclick', () => {\n // this.setConnectionStatus(bool ? (bool = false, ConnectionStatus.Closed) : (bool = true, ConnectionStatus.Connected));\n // });\n }\n\n private setConnectionStatus = (overrideStatus?: ConnectionStatus) => {\n Promise.all([\n sessionStorage.get('dc'),\n rootScope.managers.rootScope.getConnectionStatus()\n ]).then(([baseDcId, connectionStatus]) => {\n if(!baseDcId) {\n baseDcId = App.baseDcId;\n }\n\n if(this.setFirstConnectionTimeout) {\n clearTimeout(this.setFirstConnectionTimeout);\n this.setFirstConnectionTimeout = 0;\n }\n\n const status = connectionStatus['NET-' + baseDcId];\n const online = status && (overrideStatus || status.status) === ConnectionStatus.Connected;\n\n if(this.connecting && online) {\n this.managers.apiUpdatesManager.forceGetDifference();\n }\n\n if(online && !this.hadConnect) {\n this.hadConnect = true;\n }\n\n this.timedOut = status && (overrideStatus || status.status) === ConnectionStatus.TimedOut;\n this.connecting = !online;\n this.retryAt = status && status.retryAt;\n DEBUG && this.log('connecting', this.connecting);\n this.setState();\n });\n };\n\n private setStatusText = (langPackKey: LangPackKey, args?: any[]) => {\n if(this.currentLangPackKey === langPackKey) return;\n this.currentLangPackKey = langPackKey;\n replaceContent(this.statusEl, i18n(langPackKey, args));\n this.statusPreloader.attach(this.statusEl);\n };\n\n private getA(langPackKey: LangPackKey, callback: () => void) {\n const a = document.createElement('a');\n a.classList.add('force-reconnect');\n a.append(i18n(langPackKey));\n attachClickEvent(a, (e) => {\n cancelEvent(e);\n callback();\n });\n\n return a;\n }\n\n private setState = () => {\n if(singleInstance.deactivatedReason) {\n return;\n }\n\n const timeout = ConnectionStatusComponent.CHANGE_STATE_DELAY;\n if(this.connecting) {\n if(this.timedOut) {\n const a = this.getA('ConnectionStatus.ForceReconnect', () => this.managers.networkerFactory.forceReconnect());\n this.setStatusText('ConnectionStatus.TimedOut', [a]);\n } else if(this.hadConnect) {\n if(this.retryAt !== undefined) {\n const timerSpan = document.createElement('span');\n const retryAt = this.retryAt;\n const setTime = () => {\n const now = Date.now();\n timerSpan.innerText = '' + Math.max(0, Math.round((retryAt - now) / 1000));\n if(now > retryAt) {\n clearInterval(interval);\n }\n };\n const interval = setInterval(setTime, 1e3);\n setTime();\n\n const a = this.getA('ConnectionStatus.Reconnect', () => this.managers.networkerFactory.forceReconnectTimeout());\n this.setStatusText('ConnectionStatus.ReconnectIn', [timerSpan, a]);\n } else {\n this.setStatusText('ConnectionStatus.Reconnecting');\n }\n } else {\n this.setStatusText('ConnectionStatus.Waiting');\n }\n } else if(this.updating) {\n this.setStatusText('Updating');\n }\n\n DEBUG && this.log('setState', this.connecting || this.updating);\n window.requestAnimationFrame(() => {\n if(this.setStateTimeout) clearTimeout(this.setStateTimeout);\n\n const cb = () => {\n SetTransition({\n element: this.statusContainer,\n className: 'is-shown',\n forwards: this.connecting || this.updating,\n duration: 200\n });\n this.setStateTimeout = 0;\n DEBUG && this.log('setState: isShown:', this.connecting || this.updating);\n };\n\n this.setStateTimeout = window.setTimeout(cb, timeout);\n // cb();\n /* if(timeout) this.setStateTimeout = window.setTimeout(cb, timeout);\n else cb(); */\n });\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Message} from '../layer';\n/* import findUpClassName from \"../helpers/dom/findUpClassName\";\nimport rootScope from \"../lib/rootScope\";\nimport Transition from \"./transition\"; */\n\nexport enum SENDING_STATUS {\n Error = -1,\n Pending,\n Sent,\n Read\n}\n\nexport function getSendingStatus(message: Message.message | Message.messageService) {\n return message.pFlags.is_outgoing ?\n SENDING_STATUS.Pending : (\n message.pFlags.unread ?\n SENDING_STATUS.Sent :\n SENDING_STATUS.Read\n );\n}\n\ntype C = 'check' | 'checks' | 'sending' | 'sendingerror' | 'premium_lock';\nexport function setSendingStatus(\n container: HTMLElement,\n message?: C | Message.message | Message.messageService,\n disableAnimationIfRippleFound?: boolean\n) {\n let className: C;\n if(typeof(message) === 'string') {\n className = message;\n } else if(message?.pFlags.out) {\n if(message.error) {\n className = 'sendingerror';\n } else if(message.pFlags.is_outgoing) {\n className = 'sending';\n } else if(message.pFlags.unread) {\n className = 'check';\n } else {\n className = 'checks';\n }\n }\n\n if(!className) {\n container.textContent = '';\n return;\n }\n\n const iconClassName = 'tgico-' + className;\n const lastElement = container.lastElementChild as HTMLElement;\n if(lastElement && lastElement.classList.contains(iconClassName)) {\n return;\n }\n\n const element = document.createElement('i');\n element.classList.add('sending-status-icon', /* 'transition-item', */ iconClassName);\n container.append(element);\n\n if(lastElement) {\n lastElement.remove();\n }\n\n /* if(!lastElement) {\n element.classList.add('active');\n return;\n }\n\n const select = Transition(container, undefined, 350, () => {\n lastElement.remove();\n }, false, true, false);\n\n let animate = rootScope.settings.animationsEnabled && className !== 'sending' && !lastElement.classList.contains('tgico-sending');\n if(disableAnimationIfRippleFound && animate) {\n const parent = findUpClassName(container, 'rp');\n if(parent.querySelector('.c-ripple__circle') || parent.matches(':hover')) {\n animate = false;\n }\n }\n\n select(element, animate, lastElement); */\n\n /* SetTransition(lastElement, 'is-visible', false, 350, () => {\n // lastElement.remove();\n }, 2);\n SetTransition(element, 'is-visible', true, 350, undefined, 2); */\n}\n","// https://spicyyoghurt.com/tools/easing-functions\nexport default function easeInOutSine(t: number, b: number, c: number, d: number) {\n return t >= d ? b + c : easeInOutSineApply(t / d, c) + b;\n}\n\nexport function easeInOutSineApply(v: number, c: number) {\n return -c / 2 * (Math.cos(Math.PI * v) - 1);\n}\n","export default function roundRect(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n width: number,\n height: number,\n radius: {[k in 'tl' | 'tr' | 'br' | 'bl']?: number} | number,\n fill?: boolean,\n stroke?: boolean\n) {\n const dpr = ctx.canvas.dpr;\n if(dpr) {\n x *= dpr;\n y *= dpr;\n width *= dpr;\n height *= dpr;\n }\n\n if(typeof(radius) === 'number') {\n if(dpr) radius *= dpr;\n radius = {tl: radius, tr: radius, br: radius, bl: radius};\n } else {\n const defaultRadius = {tl: 0, tr: 0, br: 0, bl: 0};\n for(const side in defaultRadius) {\n // @ts-ignore\n radius[side] = radius[side] ? (dpr ? radius[side] * dpr : radius[side]) : defaultRadius[side];\n }\n }\n\n ctx.beginPath();\n ctx.moveTo(x + radius.tl, y);\n ctx.lineTo(x + width - radius.tr, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + radius.tr);\n ctx.lineTo(x + width, y + height - radius.br);\n ctx.quadraticCurveTo(x + width, y + height, x + width - radius.br, y + height);\n ctx.lineTo(x + radius.bl, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - radius.bl);\n ctx.lineTo(x, y + radius.tl);\n ctx.quadraticCurveTo(x, y, x + radius.tl, y);\n ctx.closePath();\n\n if(fill) {\n ctx.fill();\n }\n\n if(stroke) {\n ctx.stroke();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {animate} from '../helpers/animation';\nimport customProperties from '../helpers/dom/customProperties';\nimport easeInOutSine from '../helpers/easing/easeInOutSine';\nimport mediaSizes from '../helpers/mediaSizes';\nimport roundRect from '../helpers/canvas/roundRect';\n\nconst DPR = window.devicePixelRatio;\nconst SIZE = 20 * DPR;\nconst MARGIN = 2.5 * DPR;\nconst WIDTH = 2 * DPR;\nconst RADIUS = 1 * DPR;\nconst LENGTH = 3;\n\nconst MIN_HEIGHT = 4;\nconst MAX_HEIGHT = 12;\nconst DURATION = 1000;\n\nexport default function groupCallActiveIcon(isActive = false) {\n const canvas = document.createElement('canvas');\n canvas.width = canvas.height = SIZE;\n const context = canvas.getContext('2d');\n\n const TOTAL_WIDTH = LENGTH * WIDTH + (LENGTH - 1) * MARGIN;\n const START_X = (SIZE - TOTAL_WIDTH) / 2;\n\n const startTime = Date.now();\n let wasMounted = false;\n // let hadRound = false;\n const renderFrame = () => {\n if(!canvas.isConnected) {\n if(wasMounted) {\n return false;\n }\n } else if(!wasMounted) {\n wasMounted = canvas.isConnected;\n }\n\n const time = Date.now();\n // if(((time - startTime) / DURATION) >= 1) {\n // hadRound = true;\n // }\n\n const progress = easeInOutSine((time - startTime) % DURATION, 0, 1, DURATION);\n\n context.clearRect(0, 0, SIZE, SIZE);\n context.fillStyle = isActive && !mediaSizes.isMobile ? customProperties.getProperty('primary-color') : '#fff';\n\n for(let i = 0; i < LENGTH; ++i) {\n const x = START_X + (i * WIDTH) + (i * MARGIN);\n\n let itemProgress: number;\n if(progress >= .5) {\n itemProgress = i % 2 ? 2 - progress * 2 : (progress - .5) * 2;\n } else {\n itemProgress = i % 2 ? progress * 2 : 1 - progress * 2;\n }\n\n let height = MIN_HEIGHT + (itemProgress * (MAX_HEIGHT - MIN_HEIGHT));\n /* if(!hadRound && i === 1) {\n console.log('call status animation', itemProgress, height, progress, progress >= .5);\n } */\n\n height *= DPR;\n const y = (SIZE - height) / 2;\n\n roundRect(context, x, y, WIDTH, height, RADIUS, true);\n }\n\n return true;\n };\n\n return {\n canvas,\n startAnimation: () => {\n animate(renderFrame);\n renderFrame();\n },\n setActive: (active: boolean) => {\n isActive = active;\n renderFrame();\n }\n };\n}\n","import customProperties from '../dom/customProperties';\nimport clamp from '../number/clamp';\n\nexport default class Shimmer {\n private canvas: HTMLCanvasElement;\n private ctx: CanvasRenderingContext2D;\n private font = '30pt Helvetica';\n private currTime = Date.now();\n private diffTime = 0;\n private spread = 0;\n private paused = false;\n private pausedTime = 0;\n private pauseInterval = 850;\n private lightSource = 0;\n private inc = 0.032;\n private lightSpread = 0.55;\n private animations = ['slide', 'slide', 'slide', 'slide'];\n private currentAnimationIndex = 0;\n private text: string;\n private fillStyle: CanvasRenderingContext2D['fillStyle'];\n\n private keepTime() {\n this.diffTime = Date.now() - this.currTime;\n this.currTime = Date.now();\n }\n\n private cycleAnimation() {\n ++this.currentAnimationIndex;\n if(this.currentAnimationIndex >= this.animations.length) {\n this.currentAnimationIndex = 0;\n }\n }\n\n private animate() {\n const currentAnimation = this.animations[this.currentAnimationIndex];\n if(currentAnimation === 'glow') {\n return this.animateGlow(); // return glow style\n } else if(currentAnimation === 'slide') {\n return this.animateSlide(); // return slide gradient\n } else {\n console.log('unknown animation type: ' + String(currentAnimation));\n }\n }\n\n private animateGlow() {\n var glowEnd = 255,\n rgbStart = 68,\n r = rgbStart,\n g = r,\n b = r,\n increment = 10,\n interval = 800;\n\n return () => {\n var smartInc = increment * (this.diffTime / (1000 / 60));\n if(this.paused) {\n if((Date.now() - this.pausedTime) > interval) {\n r = rgbStart;\n this.cycleAnimation()\n this.paused = false;\n }\n } else {\n r = parseInt('' + (r + smartInc));\n if(r >= glowEnd) {\n this.paused = true;\n this.pausedTime = Date.now()\n }\n }\n return 'rgb('+ r + ',' + r + ',' + r + ')';\n };\n }\n\n private animateSlide(): CanvasGradient {\n var gradient = this.ctx.createLinearGradient(0, 0, this.canvas.width, 0),\n smartInc = this.inc * (this.diffTime / (1000 / 60)),\n lightLeft,\n lightRight,\n lightCenter;\n if(this.paused) {\n if((Date.now() - this.pausedTime) > this.pauseInterval) {\n this.lightSource = -0.6;\n this.cycleAnimation()\n this.paused = false;\n return this.animateSlide();\n }\n } else {\n this.lightSource += smartInc;\n if(this.lightSource > (1 + this.lightSpread)) {\n this.paused = true;\n this.pausedTime = Date.now();\n }\n }\n // lighting positions:\n lightCenter = clamp(this.lightSource, 0, 1);\n lightLeft = clamp(this.lightSource - this.lightSpread, 0, 1);\n lightRight = clamp(this.lightSource + this.lightSpread, 0, 1);\n\n const backgroundColor = customProperties.getProperty('background-color-true');\n const shimmerColor = customProperties.getProperty('surface-color');\n gradient.addColorStop(lightLeft, backgroundColor);\n gradient.addColorStop(lightCenter, shimmerColor);\n gradient.addColorStop(lightRight, backgroundColor);\n\n return gradient;\n }\n\n public settings(dict: Partial<{\n canvas: Shimmer['canvas'],\n fillStyle: Shimmer['fillStyle'],\n font: Shimmer['font'],\n lightSpread: Shimmer['lightSpread'],\n inc: Shimmer['inc'],\n animations: Shimmer['animations'],\n text: Shimmer['text']\n }> = {}) {\n this.canvas = dict.canvas ?? document.createElement('canvas');\n this.ctx = this.canvas.getContext('2d');\n this.font = dict.font ?? this.font;\n this.lightSpread = dict.lightSpread ?? this.lightSpread;\n this.inc = dict.inc ?? this.inc;\n this.animations = dict.animations ?? this.animations;\n this.text = dict.text ?? this.text;\n this.fillStyle = dict.fillStyle;\n\n this.canvas.classList.add('shimmer-canvas');\n }\n\n public on() {\n const {width, height} = this.canvas;\n // record the time we ran:\n this.keepTime();\n // clear and fill the canvas:\n this.ctx.clearRect(0, 0, width, height);\n\n if(this.font) {\n this.ctx.font = this.font;\n }\n\n this.ctx.fillStyle = this.animate() as any;\n this.ctx.fillRect(0, 0, width, height);\n\n if(this.fillStyle) {\n this.ctx.fillStyle = this.fillStyle;\n this.ctx.fillRect(0, 0, width, height);\n }\n\n if(this.text) {\n this.ctx.fillText(this.text, 50, 50);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Scrollable from '../components/scrollable';\nimport rootScope from '../lib/rootScope';\nimport {animate} from './animation';\nimport {drawCircleFromStart} from './canvas/drawCircle';\nimport roundRect from './canvas/roundRect';\nimport Shimmer from './canvas/shimmer';\nimport customProperties from './dom/customProperties';\nimport easeInOutSine from './easing/easeInOutSine';\nimport liteMode from './liteMode';\nimport mediaSizes from './mediaSizes';\n\nexport default class DialogsPlaceholder {\n private canvas: HTMLCanvasElement;\n private ctx: CanvasRenderingContext2D;\n private shimmer: Shimmer;\n private tempId: number;\n private detachTime: number;\n\n private length: number;\n private dialogHeight: number;\n private availableLength: number;\n\n private avatarSize: number;\n private marginVertical: number;\n private totalHeight: number;\n private lineHeight: number;\n private lineBorderRadius: number;\n private lineMarginVertical: number;\n private statusWidth: number;\n private generatedValues: {\n firstLineWidth: number,\n secondLineWidth: number,\n statusWidth: number\n }[];\n\n private getRectFrom: () => DOMRectEditable;\n private onRemove: () => void;\n private blockScrollable: Scrollable;\n\n constructor(sizes: Partial<{\n avatarSize: number,\n marginVertical: number,\n totalHeight: number\n }> = {}) {\n this.shimmer = new Shimmer();\n this.tempId = 0;\n this.canvas = document.createElement('canvas');\n this.canvas.classList.add('dialogs-placeholder-canvas');\n this.ctx = this.canvas.getContext('2d');\n\n this.generatedValues = [];\n this.avatarSize = sizes.avatarSize ?? 54;\n this.marginVertical = sizes.marginVertical ?? 9;\n this.totalHeight = sizes.totalHeight ?? (this.avatarSize + this.marginVertical * 2);\n this.lineHeight = 10;\n this.lineBorderRadius = 6;\n this.lineMarginVertical = 8;\n this.statusWidth = 24;\n }\n\n public attach({container, rect, getRectFrom, onRemove, blockScrollable}: {\n container: HTMLElement,\n rect?: ReturnType,\n getRectFrom?: HTMLElement | DialogsPlaceholder['getRectFrom'],\n onRemove?: DialogsPlaceholder['onRemove'],\n blockScrollable?: DialogsPlaceholder['blockScrollable']\n }) {\n const {canvas} = this;\n\n this.onRemove = onRemove;\n this.getRectFrom = typeof(getRectFrom) === 'function' ? getRectFrom : (getRectFrom || container).getBoundingClientRect.bind(getRectFrom || container);\n if(this.blockScrollable = blockScrollable) {\n blockScrollable.container.style.overflowY = 'hidden';\n }\n\n this.updateCanvasSize(rect);\n this.startAnimation();\n container.append(canvas);\n }\n\n public detach(availableLength: number) {\n if(this.detachTime) {\n return;\n }\n\n this.availableLength = availableLength;\n this.detachTime = Date.now();\n\n if(!liteMode.isAvailable('animations')) {\n this.remove();\n }\n }\n\n public remove() {\n this.stopAnimation();\n\n if(this.canvas.parentElement) {\n this.canvas.remove();\n\n if(this.blockScrollable) {\n this.blockScrollable.container.style.overflowY = '';\n this.blockScrollable = undefined;\n }\n }\n\n this.onRemove?.();\n this.onRemove = undefined;\n }\n\n private updateCanvasSize(rect = this.getRectFrom()) {\n const {canvas} = this;\n const dpr = canvas.dpr = window.devicePixelRatio;\n canvas.width = rect.width * dpr;\n canvas.height = rect.height * dpr;\n canvas.style.width = rect.width + 'px';\n canvas.style.height = rect.height + 'px';\n }\n\n private renderDetachAnimationFrame() {\n const {\n canvas,\n ctx,\n detachTime,\n length,\n availableLength\n } = this;\n\n if(!detachTime) {\n return;\n } else if(!liteMode.isAvailable('animations')) {\n this.remove();\n return;\n }\n\n const {width} = canvas;\n\n ctx.globalCompositeOperation = 'destination-out';\n\n // ctx.fillStyle = 'rgba(0, 0, 0, 0)';\n // ctx.fillRect(0, 0, width, height);\n\n // const DURATION = 500;\n // const DELAY = DURATION;\n const DURATION = 150;\n const DELAY = 15;\n const elapsedTime = Date.now() - detachTime;\n let completed = true;\n for(let i = 0; i < length; ++i) {\n const delay = availableLength < length && i >= availableLength ? DELAY * (availableLength - 1) : DELAY * i;\n const elapsedRowTime = elapsedTime - delay;\n if(elapsedRowTime <= 0) {\n completed = false;\n continue;\n }\n\n const progress = easeInOutSine(elapsedRowTime, 0, 1, DURATION);\n\n ctx.beginPath();\n ctx.rect(0, this.dialogHeight * i, width, this.dialogHeight);\n ctx.fillStyle = `rgba(0, 0, 0, ${progress})`;\n ctx.fill();\n\n if(progress < 1) {\n completed = false;\n }\n }\n\n // const totalRadius = Math.sqrt(width ** 2 + height ** 2);\n // const gradient = ctx.createRadialGradient(\n // 0, 0, 0,\n // 0, 0, totalRadius);\n // gradient.addColorStop(0, 'rgba(0, 0, 0, 1)');\n // gradient.addColorStop(progress, 'rgba(0, 0, 0, 0)');\n // gradient.addColorStop(1, 'rgba(0, 0, 0, 0)');\n\n // const gradient = ctx.createLinearGradient(0, 0, 0, height);\n // gradient.addColorStop(0, 'rgba(0, 0, 0, 1)');\n // gradient.addColorStop(progress, 'rgba(0, 0, 0, 0)');\n // gradient.addColorStop(1, 'rgba(0, 0, 0, 0)');\n\n // ctx.fillStyle = gradient;\n // ctx.fillRect(0, 0, width, height);\n\n ctx.globalCompositeOperation = 'source-over';\n\n if(completed) {\n this.remove();\n }\n }\n\n private renderFrame() {\n this.shimmer.on();\n this.renderDetachAnimationFrame();\n }\n\n private startAnimation() {\n const {canvas, shimmer} = this;\n const tempId = ++this.tempId;\n const pattern = this.createPattern();\n\n shimmer.settings({\n canvas,\n fillStyle: pattern\n });\n\n const middleware = () => {\n return this.tempId === tempId;\n };\n\n this.renderFrame();\n animate(() => {\n if(!middleware()) {\n return false;\n }\n\n // ! should've removed the loop if animations are disabled\n if(liteMode.isAvailable('animations')) {\n this.renderFrame();\n }\n\n // ! tempId can be changed during renderFrame\n return middleware();\n });\n\n rootScope.addEventListener('theme_change', this.onThemeChange);\n mediaSizes.addEventListener('resize', this.onResize);\n }\n\n private stopAnimation() {\n ++this.tempId;\n rootScope.removeEventListener('theme_change', this.onThemeChange);\n mediaSizes.removeEventListener('resize', this.onResize);\n }\n\n private onThemeChange = () => {\n this.stopAnimation();\n this.startAnimation();\n };\n\n private onResize = () => {\n const {canvas} = this;\n const {width, height, dpr} = canvas;\n this.updateCanvasSize();\n if(canvas.width === width && canvas.height === height && canvas.dpr === dpr) {\n return;\n }\n\n this.stopAnimation();\n this.startAnimation();\n };\n\n private createPattern() {\n const {canvas, ctx} = this;\n\n const patternCanvas = document.createElement('canvas');\n const patternContext = patternCanvas.getContext('2d');\n const dpr = canvas.dpr;\n patternCanvas.dpr = dpr;\n patternCanvas.width = canvas.width;\n patternCanvas.height = canvas.height;\n\n patternContext.fillStyle = customProperties.getProperty('surface-color');\n patternContext.fillRect(0, 0, patternCanvas.width, patternCanvas.height);\n\n patternContext.fillStyle = '#000';\n patternContext.globalCompositeOperation = 'destination-out';\n\n const dialogHeight = this.dialogHeight = this.totalHeight * dpr;\n const length = this.length = Math.ceil(canvas.height / dialogHeight);\n for(let i = 0; i < length; ++i) {\n this.drawChat(patternContext, i, i * dialogHeight);\n }\n\n return ctx.createPattern(patternCanvas, 'no-repeat');\n }\n\n private drawChat(ctx: CanvasRenderingContext2D, i: number, y: number) {\n let generatedValues = this.generatedValues[i];\n if(!generatedValues) {\n generatedValues = this.generatedValues[i] = {\n firstLineWidth: 40 + Math.random() * 100, // 120\n secondLineWidth: 120 + Math.random() * 130, // 240\n statusWidth: 24 + Math.random() * 16\n };\n }\n\n const {\n firstLineWidth,\n secondLineWidth,\n statusWidth\n } = generatedValues;\n\n const {canvas} = ctx;\n const {dpr} = canvas;\n y /= dpr;\n\n const {\n avatarSize,\n marginVertical,\n lineHeight,\n lineBorderRadius,\n lineMarginVertical\n } = this;\n\n let marginLeft = 17;\n\n if(avatarSize) {\n drawCircleFromStart(ctx, marginLeft, y + marginVertical, avatarSize / 2, true);\n marginLeft += avatarSize + 10;\n }\n\n // 9 + 54 - 10 - 8 = 45 ........ 72 - 9 - 10 - 8\n roundRect(ctx, marginLeft, y + marginVertical + lineMarginVertical, firstLineWidth, lineHeight, lineBorderRadius, true);\n // roundRect(ctx, marginLeft, y + marginVertical + avatarSize - lineHeight - lineMarginVertical, secondLineWidth, lineHeight, lineBorderRadius, true);\n roundRect(ctx, marginLeft, y + this.totalHeight - marginVertical - lineHeight - lineMarginVertical, secondLineWidth, lineHeight, lineBorderRadius, true);\n\n roundRect(ctx, canvas.width / dpr - 24 - statusWidth, y + marginVertical + lineMarginVertical, statusWidth, lineHeight, lineBorderRadius, true);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDialogFilter as DialogFilter, MyDialogFilter} from '../storages/filters';\nimport type LazyLoadQueue from '../../components/lazyLoadQueue';\nimport type {Dialog, ForumTopic, MyMessage} from './appMessagesManager';\nimport type {MyPhoto} from './appPhotosManager';\nimport type {MyDocument} from './appDocsManager';\nimport type {State} from '../../config/state';\nimport AvatarElement from '../../components/avatar';\nimport DialogsContextMenu from '../../components/dialogsContextMenu';\nimport {horizontalMenu} from '../../components/horizontalMenu';\nimport ripple from '../../components/ripple';\nimport Scrollable, {ScrollableX, SliceSides} from '../../components/scrollable';\nimport {formatDateAccordingToTodayNew} from '../../helpers/date';\nimport {IS_MOBILE_SAFARI, IS_SAFARI} from '../../environment/userAgent';\nimport {logger, LogTypes} from '../logger';\nimport rootScope from '../rootScope';\nimport appImManager, {AppImManager, APP_TABS} from './appImManager';\nimport Button from '../../components/button';\nimport SetTransition from '../../components/singleTransition';\nimport {MyDraftMessage} from './appDraftsManager';\nimport DEBUG, {MOUNT_CLASS_TO} from '../../config/debug';\nimport PeerTitle from '../../components/peerTitle';\nimport I18n, {FormatterArguments, i18n, LangPackKey, _i18n} from '../langPack';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport lottieLoader from '../rlottie/lottieLoader';\nimport wrapPhoto from '../../components/wrappers/photo';\nimport AppEditFolderTab from '../../components/sidebarLeft/tabs/editFolder';\nimport appSidebarLeft from '../../components/sidebarLeft';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport positionElementByIndex from '../../helpers/dom/positionElementByIndex';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport ConnectionStatusComponent from '../../components/connectionStatus';\nimport {renderImageFromUrlPromise} from '../../helpers/dom/renderImageFromUrl';\nimport {fastRafConventional, fastRafPromise} from '../../helpers/schedulers';\nimport SortedUserList from '../../components/sortedUserList';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport handleTabSwipe from '../../helpers/dom/handleTabSwipe';\nimport windowSize from '../../helpers/windowSize';\nimport isInDOM from '../../helpers/dom/isInDOM';\nimport {setSendingStatus} from '../../components/sendingStatus';\nimport SortedList, {SortedElementBase} from '../../helpers/sortedList';\nimport debounce from '../../helpers/schedulers/debounce';\nimport {FOLDER_ID_ALL, FOLDER_ID_ARCHIVE, NULL_PEER_ID, REAL_FOLDERS, REAL_FOLDER_ID} from '../mtproto/mtproto_config';\nimport groupCallActiveIcon from '../../components/groupCallActiveIcon';\nimport {Chat, Message, NotifyPeer} from '../../layer';\nimport IS_GROUP_CALL_SUPPORTED from '../../environment/groupCallSupport';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport appNavigationController, {NavigationItem} from '../../components/appNavigationController';\nimport appMediaPlaybackController from '../../components/appMediaPlaybackController';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport {AppManagers} from './managers';\nimport appSidebarRight from '../../components/sidebarRight';\nimport PopupElement from '../../components/popups';\nimport choosePhotoSize from './utils/photos/choosePhotoSize';\nimport wrapEmojiText from '../richTextProcessor/wrapEmojiText';\nimport wrapMessageForReply from '../../components/wrappers/messageForReply';\nimport isMessageRestricted from './utils/messages/isMessageRestricted';\nimport getMediaFromMessage from './utils/messages/getMediaFromMessage';\nimport getMessageSenderPeerIdOrName from './utils/messages/getMessageSenderPeerIdOrName';\nimport wrapStickerEmoji from '../../components/wrappers/stickerEmoji';\nimport getDialogIndexKey from './utils/dialogs/getDialogIndexKey';\nimport getProxiedManagers from './getProxiedManagers';\nimport getDialogIndex from './utils/dialogs/getDialogIndex';\nimport {attachContextMenuListener} from '../../helpers/dom/attachContextMenuListener';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport wrapPeerTitle from '../../components/wrappers/peerTitle';\nimport middlewarePromise from '../../helpers/middlewarePromise';\nimport appDownloadManager from './appDownloadManager';\nimport groupCallsController from '../calls/groupCallsController';\nimport callsController from '../calls/callsController';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport noop from '../../helpers/noop';\nimport DialogsPlaceholder from '../../helpers/dialogsPlaceholder';\nimport pause from '../../helpers/schedulers/pause';\nimport apiManagerProxy from '../mtproto/mtprotoworker';\nimport filterAsync from '../../helpers/array/filterAsync';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport whichChild from '../../helpers/dom/whichChild';\nimport {getMiddleware, MiddlewareHelper} from '../../helpers/middleware';\nimport makeError from '../../helpers/makeError';\nimport getUnsafeRandomInt from '../../helpers/number/getUnsafeRandomInt';\nimport Row, {RowMediaSizeType} from '../../components/row'\nimport SettingSection from '../../components/settingSection';\nimport {SliderSuperTabEventable} from '../../components/sliderTab';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport {AckedResult} from '../mtproto/superMessagePort';\nimport ButtonMenuToggle from '../../components/buttonMenuToggle';\nimport getMessageThreadId from './utils/messages/getMessageThreadId';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport formatNumber from '../../helpers/number/formatNumber';\nimport AppSharedMediaTab from '../../components/sidebarRight/tabs/sharedMedia';\nimport {dispatchHeavyAnimationEvent} from '../../hooks/useHeavyAnimationCheck';\nimport AppArchivedTab from '../../components/sidebarLeft/tabs/archivedTab';\nimport shake from '../../helpers/dom/shake';\nimport AppEditTopicTab from '../../components/sidebarRight/tabs/editTopic';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\n\nexport const DIALOG_LIST_ELEMENT_TAG = 'A';\n\nexport type DialogDom = {\n avatarEl: AvatarElement,\n captionDiv: HTMLElement,\n titleSpan: HTMLSpanElement,\n titleSpanContainer: HTMLSpanElement,\n statusSpan: HTMLSpanElement,\n lastTimeSpan: HTMLSpanElement,\n unreadBadge?: HTMLElement,\n unreadAvatarBadge?: HTMLElement,\n callIcon?: ReturnType,\n mentionsBadge?: HTMLElement,\n lastMessageSpan: HTMLSpanElement,\n containerEl: HTMLElement,\n listEl: HTMLElement,\n subtitleEl: HTMLElement,\n\n setLastMessagePromise?: CancellablePromise,\n setUnreadMessagePromise?: CancellablePromise\n};\n\ninterface SortedDialog extends SortedElementBase {\n dom: DialogDom,\n dialogElement: DialogElement\n}\n\nfunction setPromiseMiddleware}, K extends keyof T>(obj: T, key: K) {\n const oldPromise: CancellablePromise = obj[key] as any;\n oldPromise?.reject();\n\n // @ts-ignore\n const deferred = obj[key] = deferredPromise();\n deferred.catch(() => {}).finally(() => {\n if((obj[key] as any) === deferred) {\n delete obj[key];\n }\n });\n\n const middleware = middlewarePromise(() => (obj[key] as any) === deferred);\n return {deferred, middleware};\n}\n\nconst BADGE_SIZE = 22;\nconst BADGE_TRANSITION_TIME = 250;\n\nclass SortedDialogList extends SortedList {\n public managers: AppManagers;\n public log: ReturnType;\n public list: HTMLElement;\n public indexKey: ReturnType;\n public onListLengthChange: () => void;\n public forumPeerId: PeerId;\n\n constructor(options: {\n managers: SortedDialogList['managers'],\n log?: SortedDialogList['log'],\n list: SortedDialogList['list'],\n indexKey: SortedDialogList['indexKey'],\n onListLengthChange?: SortedDialogList['onListLengthChange'],\n forumPeerId?: SortedDialogList['forumPeerId']\n }) {\n super({\n getIndex: (element) => this.managers.dialogsStorage.getDialogIndex(this.forumPeerId ?? element.id, this.indexKey, this.forumPeerId ? element.id : undefined),\n onDelete: (element) => {\n element.dom.listEl.remove();\n this.onListLengthChange?.();\n },\n onSort: (element, idx) => {\n const willChangeLength = element.dom.listEl.parentElement !== this.list;\n positionElementByIndex(element.dom.listEl, this.list, idx);\n\n if(willChangeLength) {\n this.onListLengthChange?.();\n }\n },\n onElementCreate: async(base) => {\n const loadPromises: Promise[] = [];\n\n const dialogElement = appDialogsManager.addListDialog({\n peerId: this.forumPeerId ?? base.id,\n loadPromises,\n isBatch: true,\n threadId: this.forumPeerId ? base.id : undefined,\n isMainList: this.indexKey === 'index_0'\n });\n (base as SortedDialog).dom = dialogElement.dom;\n (base as SortedDialog).dialogElement = dialogElement;\n\n await Promise.all(loadPromises);\n return base as SortedDialog;\n },\n updateElementWith: fastRafConventional,\n log: options.log\n });\n\n safeAssign(this, options);\n }\n\n public clear() {\n this.list.replaceChildren();\n super.clear();\n }\n}\n\nexport type DialogElementSize = RowMediaSizeType;\ntype DialogElementOptions = {\n peerId: PeerId,\n rippleEnabled?: boolean,\n onlyFirstName?: boolean,\n meAsSaved?: boolean,\n avatarSize?: RowMediaSizeType,\n autonomous?: boolean,\n loadPromises?: Promise[],\n fromName?: string,\n noIcons?: boolean,\n threadId?: number,\n wrapOptions?: WrapSomethingOptions,\n isMainList?: boolean\n};\nexport class DialogElement extends Row {\n public dom: DialogDom;\n\n constructor({\n peerId,\n rippleEnabled = true,\n onlyFirstName = false,\n meAsSaved = true,\n avatarSize = 'bigger',\n autonomous,\n loadPromises,\n fromName,\n noIcons,\n threadId,\n wrapOptions = {},\n isMainList\n }: DialogElementOptions) {\n super({\n clickable: true,\n noRipple: !rippleEnabled,\n havePadding: !threadId,\n title: true,\n titleRightSecondary: true,\n subtitle: true,\n subtitleRight: true,\n noWrap: true,\n asLink: true\n });\n\n this.subtitleRight.remove();\n\n const avatarEl = threadId ? undefined : new AvatarElement();\n if(avatarEl) {\n const avatarSizeMap: {[k in DialogElementSize]?: number} = {\n bigger: 54,\n abitbigger: 42,\n small: 32\n };\n const s = avatarSizeMap[avatarSize];\n avatarEl.classList.add('dialog-avatar', 'avatar-' + s);\n avatarEl.updateWithOptions({\n loadPromises,\n lazyLoadQueue: wrapOptions.lazyLoadQueue,\n isDialog: !!meAsSaved,\n peerId,\n peerTitle: fromName\n });\n\n this.applyMediaElement(avatarEl, avatarSize);\n }\n\n const captionDiv = this.container;\n\n const titleSpanContainer = this.title;\n titleSpanContainer.classList.add('user-title');\n\n this.titleRow.classList.add('dialog-title');\n\n const peerTitle = new PeerTitle();\n const peerTitlePromise = peerTitle.update({\n peerId,\n fromName,\n dialog: meAsSaved,\n onlyFirstName,\n withIcons: !noIcons,\n threadId: threadId\n });\n\n loadPromises?.push(peerTitlePromise);\n titleSpanContainer.append(peerTitle.element);\n\n // for muted icon\n titleSpanContainer.classList.add('tgico'); // * эта строка будет актуальна только для !container, но ладно\n\n // const titleIconsPromise = generateTitleIcons(peerId).then((elements) => {\n // titleSpanContainer.append(...elements);\n // });\n\n // if(loadPromises) {\n // loadPromises.push(titleIconsPromise);\n // }\n // }\n\n const span = this.subtitle;\n // span.classList.add('user-last-message');\n\n const li = this.container;\n li.classList.add('chatlist-chat', 'chatlist-chat-' + avatarSize);\n if(!autonomous) {\n (li as HTMLAnchorElement).href = '#' + peerId;\n }\n // if(rippleEnabled) {\n // ripple(li);\n // }\n\n if(avatarSize === 'bigger') {\n this.container.classList.add('row-big');\n } else if(avatarSize === 'small') {\n this.container.classList.add('row-small');\n }\n\n li.dataset.peerId = '' + peerId;\n if(threadId) {\n li.dataset.threadId = '' + threadId;\n }\n\n const statusSpan = document.createElement('span');\n statusSpan.classList.add('message-status', 'sending-status'/* , 'transition', 'reveal' */);\n\n const lastTimeSpan = document.createElement('span');\n lastTimeSpan.classList.add('message-time');\n\n const rightSpan = this.titleRight;\n rightSpan.classList.add('dialog-title-details');\n rightSpan.append(statusSpan, lastTimeSpan);\n\n this.subtitleRow.classList.add('dialog-subtitle');\n\n const dom: DialogDom = this.dom = {\n avatarEl,\n captionDiv,\n titleSpan: peerTitle.element,\n titleSpanContainer,\n statusSpan,\n lastTimeSpan,\n lastMessageSpan: span,\n containerEl: li,\n listEl: li,\n subtitleEl: this.subtitleRow\n };\n\n if(!autonomous) {\n (li as any).dialogDom = dom;\n\n const chat = appImManager.chat;\n if(chat && appImManager.isSamePeer(chat, {peerId, threadId: threadId, type: 'chat'})) {\n appDialogsManager.setDialogActive(li, true);\n }\n\n if(isMainList && appDialogsManager.forumTab?.peerId === peerId && !threadId) {\n li.classList.add('is-forum-open');\n }\n }\n }\n\n public createUnreadBadge() {\n if(this.dom.unreadBadge) return;\n const badge = this.dom.unreadBadge = document.createElement('div');\n badge.className = `dialog-subtitle-badge badge badge-${BADGE_SIZE}`;\n this.dom.subtitleEl.append(badge);\n }\n\n public createUnreadAvatarBadge() {\n if(this.dom.unreadAvatarBadge) return;\n const badge = this.dom.unreadAvatarBadge = document.createElement('div');\n badge.className = `dialog-subtitle-badge badge badge-${BADGE_SIZE} avatar-badge`;\n this.dom.listEl.append(badge);\n }\n\n public createMentionsBadge() {\n if(this.dom.mentionsBadge) return;\n const badge = this.dom.mentionsBadge = document.createElement('div');\n badge.className = `dialog-subtitle-badge badge badge-${BADGE_SIZE} mention mention-badge`;\n badge.innerText = '@';\n this.dom.lastMessageSpan.after(badge);\n }\n\n public toggleBadgeByKey(\n key: Extract,\n hasBadge: boolean,\n justCreated: boolean,\n batch?: boolean\n ) {\n SetTransition({\n element: this.dom[key],\n className: 'is-visible',\n forwards: hasBadge,\n duration: batch ? 0 : BADGE_TRANSITION_TIME,\n onTransitionEnd: hasBadge ? undefined : () => {\n this.dom[key].remove();\n delete this.dom[key];\n },\n useRafs: !justCreated || !isInDOM(this.dom[key]) ? 2 : 0\n });\n }\n}\n\nclass ForumTab extends SliderSuperTabEventable {\n private rows: HTMLElement;\n private subtitle: HTMLElement;\n\n public peerId: PeerId;\n private firstTime: boolean;\n\n private log: ReturnType;\n\n private xd: Some3;\n\n public async toggle(value: boolean) {\n if(this.init2) {\n await this.init2();\n }\n\n SetTransition({\n element: this.container,\n className: 'is-visible',\n forwards: value,\n duration: 300,\n onTransitionEnd: !value ? () => {\n this.onCloseAfterTimeout();\n } : undefined,\n useRafs: this.firstTime ? (this.firstTime = undefined, 2) : undefined\n });\n }\n\n public init(options: {\n peerId: PeerId,\n managers: AppManagers\n }) {\n safeAssign(this, options);\n\n this.log = logger('FORUM');\n this.firstTime = true;\n this.container.classList.add('topics-container');\n\n const isFloating = !this.slider;\n if(isFloating) {\n this.closeBtn.classList.replace('tgico-left', 'tgico-close');\n this.container.classList.add('active', 'is-floating');\n\n attachClickEvent(this.closeBtn, () => {\n appDialogsManager.toggleForumTab(undefined, this);\n }, {listenerSetter: this.listenerSetter});\n }\n\n this.rows = document.createElement('div');\n this.rows.classList.add('sidebar-header__rows');\n\n this.subtitle = document.createElement('div');\n this.subtitle.classList.add('sidebar-header__subtitle');\n\n this.title.replaceWith(this.rows);\n this.rows.append(this.title, this.subtitle);\n\n const list = appDialogsManager.createChatList();\n appDialogsManager.setListClickListener(list, null, true);\n this.scrollable.append(list);\n\n this.xd = new Some3(this.peerId, isFloating ? 80 : 0);\n this.xd.scrollable = this.scrollable;\n this.xd.sortedList = new SortedDialogList({\n managers: this.managers,\n log: this.log,\n list,\n indexKey: 'index_0',\n forumPeerId: this.peerId\n });\n this.xd.bindScrollable();\n\n const getOptionsForMessages = (): Parameters[0] => {\n return {\n peerId: this.peerId,\n type: 'chat'\n };\n };\n\n const btnMenu = ButtonMenuToggle({\n listenerSetter: this.listenerSetter,\n direction: 'bottom-left',\n buttons: [{\n icon: 'info',\n text: 'ForumTopic.Context.Info',\n onClick: async() => {\n const tab = appSidebarLeft.createTab(AppSharedMediaTab, true);\n tab.isFirst = true;\n tab.setPeer(this.peerId);\n (await tab.fillProfileElements())();\n tab.loadSidebarMedia(true);\n tab.open();\n }\n }, {\n icon: 'message',\n text: 'ForumTopic.Context.ShowAsMessages',\n onClick: () => {\n const chat = appImManager.chat;\n appImManager[chat?.peerId === this.peerId ? 'setPeer' : 'setInnerPeer'](getOptionsForMessages());\n },\n verify: () => {\n const chat = appImManager.chat;\n return !chat || !appImManager.isSamePeer(chat, getOptionsForMessages());\n }\n }, {\n icon: 'adduser',\n text: 'ForumTopic.Context.AddMember',\n onClick: () => {},\n verify: () => false && this.managers.appChatsManager.hasRights(this.peerId.toChatId(), 'invite_users')\n }, {\n icon: 'add',\n text: 'ForumTopic.Context.New',\n onClick: () => {\n appSidebarLeft.createTab(AppEditTopicTab).open(this.peerId);\n },\n separator: true,\n verify: () => this.managers.appChatsManager.hasRights(this.peerId.toChatId(), 'manage_topics')\n }]\n });\n\n this.listenerSetter.add(rootScope)('history_reload', (peerId) => {\n if(this.peerId !== peerId) {\n return;\n }\n\n this.xd.fullReset();\n });\n\n this.listenerSetter.add(rootScope)('chat_update', async(chatId) => {\n if(this.peerId !== chatId.toPeerId(true)) {\n return;\n }\n\n const chat = await this.managers.appChatsManager.getChat(chatId);\n if(!(chat as Chat.channel).pFlags.forum) {\n appDialogsManager.toggleForumTab(undefined, this);\n }\n });\n\n if(IS_TOUCH_SUPPORTED) {\n handleTabSwipe({\n element: this.container,\n onSwipe: () => {\n appDialogsManager.toggleForumTab(undefined, this);\n },\n middleware: this.middlewareHelper.get()\n });\n }\n\n this.header.append(btnMenu);\n\n if(!isFloating) {\n return this.init2();\n }\n }\n\n public async init2() {\n this.init2 = undefined;\n\n const middleware = this.middlewareHelper.get();\n const peerId = this.peerId;\n\n this.managers.apiUpdatesManager.subscribeToChannelUpdates(this.peerId.toChatId());\n middleware.onDestroy(() => {\n this.managers.apiUpdatesManager.unsubscribeFromChannelUpdates(this.peerId.toChatId());\n });\n\n const peerTitlePromise = wrapPeerTitle({\n peerId,\n dialog: true,\n wrapOptions: {middleware}\n });\n\n const setStatusPromise = appImManager.setPeerStatus({\n peerId,\n element: this.subtitle,\n needClear: true,\n useWhitespace: false,\n middleware,\n noTyping: true\n });\n\n // this.managers.dialogsStorage.getForumTopics(this.peerId).then((messagesForumTopics) => {\n // console.log(messagesForumTopics);\n\n // const promises = messagesForumTopics.topics.map((forumTopic) => {\n // return this.sortedDialogList.add(forumTopic.id);\n // });\n\n // return Promise.all(promises);\n // }).then(() => {\n // this.dialogsPlaceholder.detach(this.sortedDialogList.getAll().size);\n // });\n\n return Promise.all([\n peerTitlePromise,\n setStatusPromise,\n this.xd.onChatsScroll().then((loadResult) => {\n return loadResult.cached ? loadResult.renderPromise : undefined\n })\n ]).then(([\n peerTitle,\n setStatus,\n _\n ]) => {\n if(!middleware()) {\n return;\n }\n\n this.title.append(peerTitle);\n setStatus?.();\n });\n }\n\n public onCloseAfterTimeout() {\n super.onCloseAfterTimeout();\n this.xd.destroy();\n }\n}\n\nconst NOT_IMPLEMENTED_ERROR = new Error('not implemented');\n\ntype DialogKey = Parameters[0];\nclass Some {\n public sortedList: SortedDialogList;\n public scrollable: Scrollable;\n public loadedDialogsAtLeastOnce: boolean;\n public needPlaceholderAtFirstTime: boolean;\n protected offsets: {top: number, bottom: number};\n protected indexKey: ReturnType;\n protected sliceTimeout: number;\n protected managers: AppManagers;\n protected listenerSetter: ListenerSetter;\n protected loadDialogsPromise: Promise<{cached: boolean, renderPromise: Some2['loadDialogsRenderPromise']}>;\n protected loadDialogsRenderPromise: Promise;\n protected placeholder: DialogsPlaceholder;\n protected log: ReturnType;\n protected placeholderOptions: ConstructorParameters[0];\n\n constructor() {\n this.log = logger('CL');\n this.offsets = {top: 0, bottom: 0};\n this.managers = rootScope.managers;\n this.listenerSetter = new ListenerSetter();\n }\n\n public getOffsetIndex(side: 'top' | 'bottom') {\n return {index: this.scrollable.loadedAll[side] ? 0 : this.offsets[side]};\n }\n\n protected isDialogMustBeInViewport(dialog: T) {\n // return true;\n const topOffset = this.getOffsetIndex('top');\n const bottomOffset = this.getOffsetIndex('bottom');\n\n if(!topOffset.index && !bottomOffset.index) {\n return true;\n }\n\n const index = getDialogIndex(dialog, this.indexKey);\n return (!topOffset.index || index <= topOffset.index) &&\n (!bottomOffset.index || index >= bottomOffset.index);\n }\n\n public setIndexKey(indexKey: Some['indexKey']) {\n this.indexKey = indexKey;\n this.sortedList.indexKey = indexKey;\n }\n\n protected deleteDialogByKey(key: DialogKey) {\n this.sortedList.delete(key);\n }\n\n public deleteDialog(dialog: T) {\n return this.deleteDialogByKey(this.getDialogKey(dialog));\n }\n\n public updateDialog(dialog: T) {\n const key = this.getDialogKey(dialog);\n if(this.isDialogMustBeInViewport(dialog)) {\n if(!this.sortedList.has(key) && this.loadedDialogsAtLeastOnce) {\n this.sortedList.add(key);\n return;\n }\n } else {\n this.deleteDialog(dialog);\n return;\n }\n\n const dialogElement = this.getDialogElement(key);\n if(dialogElement) {\n appDialogsManager.setLastMessageN({\n dialog,\n dialogElement,\n setUnread: true\n });\n this.sortedList.update(key);\n }\n }\n\n public onChatsRegularScroll = () => {\n // return;\n\n if(this.sliceTimeout) clearTimeout(this.sliceTimeout);\n this.sliceTimeout = window.setTimeout(() => {\n this.sliceTimeout = undefined;\n\n if(!this.sortedList.list.childElementCount || appDialogsManager.processContact) {\n return;\n }\n\n /* const observer = new IntersectionObserver((entries) => {\n const\n });\n\n Array.from(this.chatList.children).forEach((el) => {\n observer.observe(el);\n }); */\n\n fastRafConventional(() => {\n const perf = performance.now();\n\n const scrollTopWas = this.scrollable.scrollTop;\n\n const firstElementChild = this.sortedList.list.firstElementChild;\n const rectContainer = this.scrollable.container.getBoundingClientRect();\n const rectTarget = firstElementChild.getBoundingClientRect();\n const children = Array.from(this.scrollable.splitUp.children) as HTMLElement[];\n\n // const padding = 8;\n // const offsetTop = this.folders.container.offsetTop;\n let offsetTop = this.scrollable.splitUp.offsetTop;\n if(offsetTop && scrollTopWas < offsetTop) offsetTop -= scrollTopWas;\n // const offsetTop = scrollTopWas < padding ? padding - scrollTopWas : 0;\n const firstY = rectContainer.y + offsetTop;\n const lastY = rectContainer.y/* - 8 */; // 8px - .chatlist padding-bottom\n\n const firstElement = findUpTag(document.elementFromPoint(Math.ceil(rectTarget.x), Math.ceil(firstY + 1)), firstElementChild.tagName) as HTMLElement;\n const lastElement = findUpTag(document.elementFromPoint(Math.ceil(rectTarget.x), Math.floor(lastY + rectContainer.height - 1)), firstElementChild.tagName) as HTMLElement;\n\n // alert('got element:' + rect.y);\n\n if(!firstElement || !lastElement) {\n return;\n }\n\n // alert('got element:' + !!firstElement);\n\n const firstElementRect = firstElement.getBoundingClientRect();\n const elementOverflow = firstElementRect.y - firstY;\n\n const sliced: HTMLElement[] = [];\n const firstIndex = children.indexOf(firstElement);\n const lastIndex = children.indexOf(lastElement);\n\n const saveLength = 10;\n\n const sliceFromStart = IS_SAFARI ? [] : children.slice(0, Math.max(0, firstIndex - saveLength));\n const sliceFromEnd = children.slice(lastIndex + saveLength);\n\n /* if(sliceFromStart.length !== sliceFromEnd.length) {\n console.log('not equal', sliceFromStart.length, sliceFromEnd.length);\n }\n\n if(sliceFromStart.length > sliceFromEnd.length) {\n const diff = sliceFromStart.length - sliceFromEnd.length;\n sliceFromStart.splice(0, diff);\n } else if(sliceFromEnd.length > sliceFromStart.length) {\n const diff = sliceFromEnd.length - sliceFromStart.length;\n sliceFromEnd.splice(sliceFromEnd.length - diff, diff);\n } */\n\n if(sliceFromStart.length) {\n this.scrollable.loadedAll.top = false;\n }\n\n if(sliceFromEnd.length) {\n this.scrollable.loadedAll.bottom = false;\n }\n\n sliced.push(...sliceFromStart);\n sliced.push(...sliceFromEnd);\n\n sliced.forEach((el) => {\n this.deleteDialogByKey(this.getDialogKeyFromElement(el));\n });\n\n this.setOffsets();\n\n // this.log('[slicer] elements', firstElement, lastElement, rect, sliced, sliceFromStart.length, sliceFromEnd.length);\n\n // this.log('[slicer] reset scrollTop', this.scroll.scrollTop, firstElement.offsetTop, firstElementRect.y, rect.y, elementOverflow);\n\n // alert('left length:' + children.length);\n\n const scrollTop = firstElement.offsetTop - elementOverflow;\n this.scrollable.scrollTop = this.scrollable.lastScrollPosition = scrollTop;\n\n this.log('slice time', performance.now() - perf, this.indexKey, scrollTop);\n /* const firstElementRect = firstElement.getBoundingClientRect();\n const scrollTop = */\n\n // this.scroll.scrollIntoView(firstElement, false);\n });\n }, 200);\n };\n\n public onChatsScrollTop() {\n return this.onChatsScroll('top');\n };\n\n public onChatsScroll(side: SliceSides = 'bottom') {\n return this.loadDialogs(side);\n };\n\n public createPlaceholder(): DialogsPlaceholder {\n const placeholder = this.placeholder = new DialogsPlaceholder(this.placeholderOptions);\n const getRectFrom = this.getRectFromForPlaceholder();\n placeholder.attach({\n container: this.sortedList.list.parentElement,\n getRectFrom,\n onRemove: () => {\n if(this.placeholder === placeholder) {\n this.placeholder = undefined;\n }\n },\n blockScrollable: this.scrollable\n });\n\n return placeholder;\n }\n\n public loadDialogs(side: SliceSides) {\n /* if(testScroll) {\n return;\n } */\n\n const log = this.log.bindPrefix('load-' + getUnsafeRandomInt(1000, 9999));\n log('try', side);\n\n if(this.loadDialogsPromise || this.loadDialogsRenderPromise/* || 1 === 1 */) return this.loadDialogsPromise;\n else if(this.scrollable.loadedAll[side]) {\n return Promise.resolve({\n cached: true,\n renderPromise: Promise.resolve()\n });\n }\n\n log.warn('start', side);\n const middlewareError = makeError('MIDDLEWARE');\n\n const cachedInfoPromise = deferredPromise();\n const renderPromise = new Promise(async(resolve, reject) => {\n const chatList = this.sortedList.list;\n\n let placeholder = this.placeholder;\n try {\n const getConversationsResult = this.loadDialogsInner(side);\n const a = await getConversationsResult;\n\n if(\n !chatList.childElementCount &&\n !placeholder &&\n (\n (!this.loadedDialogsAtLeastOnce && this.needPlaceholderAtFirstTime) ||\n !a.cached\n )\n ) {\n if(this.loadDialogsRenderPromise !== renderPromise) {\n throw middlewareError;\n }\n\n placeholder = this.createPlaceholder();\n\n cachedInfoPromise.resolve(false);\n }\n\n const result = await a.result;\n // await pause(5000);\n if(this.loadDialogsRenderPromise !== renderPromise) {\n throw middlewareError;\n }\n\n cachedInfoPromise.resolve(a.cached);\n\n // console.timeEnd('getDialogs time');\n\n // * loaded all\n // if(!result.dialogs.length || chatList.childElementCount === result.count) {\n // !result.dialogs.length не подходит, так как при супердревном диалоге getConversations его не выдаст.\n // if(chatList.childElementCount === result.count) {\n if(side === 'bottom') {\n if(result.isEnd) {\n this.scrollable.loadedAll[side] = true;\n }\n } else if(result.isTopEnd) {\n this.scrollable.loadedAll[side] = true;\n }\n\n const length = result.dialogs.length;\n log(`will render ${length} dialogs`);\n if(length) {\n const dialogs = side === 'top' ? result.dialogs.slice().reverse() : result.dialogs;\n\n const loadPromises = dialogs.map((dialog) => {\n return this.sortedList.add(this.getDialogKey(dialog as T));\n });\n\n await Promise.all(loadPromises).catch();\n if(this.loadDialogsRenderPromise !== renderPromise) {\n throw middlewareError;\n }\n }\n\n const offsetDialog = result.dialogs[side === 'top' ? 0 : length - 1];\n if(offsetDialog) {\n this.offsets[side] = getDialogIndex(offsetDialog, this.indexKey);\n }\n\n // don't set it before - no need to fire length change with every dialog\n this.loadedDialogsAtLeastOnce = true;\n appDialogsManager.onListLengthChange();\n\n log('getDialogs', result, chatList.childElementCount);\n\n setTimeout(() => {\n this.scrollable.onScroll();\n }, 0);\n\n if(placeholder) {\n // await pause(500);\n placeholder.detach(chatList.childElementCount);\n }\n } catch(err) {\n if((err as ApiError)?.type !== 'MIDDLEWARE') {\n log.error(err);\n }\n\n reject(err);\n cachedInfoPromise.reject(err);\n return;\n }\n\n resolve();\n }).finally(() => {\n if(this.loadDialogsRenderPromise === renderPromise) {\n log('end');\n this.loadDialogsRenderPromise = undefined;\n } else {\n log('has been cleared');\n }\n });\n\n this.loadDialogsRenderPromise = renderPromise;\n const loadDialogsPromise = this.loadDialogsPromise = cachedInfoPromise.then((cached) => {\n return {\n cached,\n renderPromise\n };\n }).finally(() => {\n if(this.loadDialogsPromise === loadDialogsPromise) {\n this.loadDialogsPromise = undefined;\n }\n });\n\n return loadDialogsPromise;\n }\n\n public async setOffsets() {\n const chatList = this.sortedList.list;\n const [firstDialog, lastDialog] = await Promise.all([\n this.getDialogFromElement(chatList.firstElementChild as HTMLElement),\n this.getDialogFromElement(chatList.lastElementChild as HTMLElement)\n ]);\n\n const {indexKey} = this;\n this.offsets.top = getDialogIndex(firstDialog, indexKey);\n this.offsets.bottom = getDialogIndex(lastDialog, indexKey);\n }\n\n public getDialogKey(dialog: T): DialogKey {\n throw NOT_IMPLEMENTED_ERROR;\n }\n\n public getDialogKeyFromElement(element: HTMLElement): DialogKey {\n throw NOT_IMPLEMENTED_ERROR;\n }\n\n public getRectFromForPlaceholder(): Parameters[0]['getRectFrom'] {\n throw NOT_IMPLEMENTED_ERROR;\n }\n\n public getDialogFromElement(element: HTMLElement): Promise {\n throw NOT_IMPLEMENTED_ERROR;\n }\n\n public loadDialogsInner(side: SliceSides): ReturnType {\n throw NOT_IMPLEMENTED_ERROR;\n }\n\n public async setTyping(dialog: T) {\n const key = this.getDialogKey(dialog);\n const dom = this.getDialogDom(key);\n if(!dom) {\n return;\n }\n\n const oldTypingElement = dom.lastMessageSpan.querySelector('.peer-typing-container') as HTMLElement;\n const newTypingElement = await appImManager.getPeerTyping(\n dialog.peerId,\n oldTypingElement,\n dialog._ === 'forumTopic' ? dialog.id : undefined\n );\n if(!oldTypingElement && newTypingElement) {\n replaceContent(dom.lastMessageSpan, newTypingElement);\n dom.lastMessageSpan.classList.add('user-typing');\n }\n }\n\n public unsetTyping(dialog: T) {\n const key = this.getDialogKey(dialog);\n const dialogElement = this.getDialogElement(key);\n if(!dialogElement) {\n return;\n }\n\n dialogElement.dom.lastMessageSpan.classList.remove('user-typing');\n appDialogsManager.setLastMessageN({\n dialog,\n lastMessage: null,\n dialogElement,\n setUnread: null\n });\n }\n\n public getDialogDom(key: DialogKey) {\n // return this.doms[peerId];\n const element = this.sortedList.get(key);\n return element?.dom;\n }\n\n public getDialogElement(key: DialogKey) {\n const element = this.sortedList.get(key);\n return element?.dialogElement;\n }\n\n public bindScrollable() {\n this.scrollable.container.addEventListener('scroll', this.onChatsRegularScroll);\n this.scrollable.onScrolledTop = this.onChatsScrollTop.bind(this);\n this.scrollable.onScrolledBottom = this.onChatsScroll.bind(this);\n this.scrollable.setVirtualContainer(this.sortedList.list);\n }\n\n public clear() {\n this.sortedList.clear();\n this.placeholder?.remove();\n }\n\n public reset() {\n this.scrollable.loadedAll.top = true;\n this.scrollable.loadedAll.bottom = false;\n this.offsets.top = this.offsets.bottom = 0;\n this.loadDialogsRenderPromise = undefined;\n this.loadDialogsPromise = undefined;\n }\n\n public fullReset() {\n this.reset();\n this.clear();\n return this.onChatsScroll();\n }\n\n public destroy() {\n this.clear();\n this.scrollable.destroy();\n this.listenerSetter.removeAll();\n }\n}\n\nclass Some3 extends Some {\n constructor(public peerId: PeerId, public paddingX: number) {\n super();\n\n this.placeholderOptions = {\n avatarSize: 0,\n marginVertical: 5,\n totalHeight: 64\n };\n\n this.listenerSetter.add(rootScope)('peer_typings', async({peerId, threadId, typings}) => {\n if(!threadId || this.peerId !== peerId) {\n return;\n }\n\n const dialog = await this.managers.dialogsStorage.getForumTopic(peerId, threadId);\n\n if(!dialog) return;\n\n if(typings.length) {\n this.setTyping(dialog);\n } else {\n this.unsetTyping(dialog);\n }\n });\n\n this.listenerSetter.add(rootScope)('dialogs_multiupdate', (dialogs) => {\n for(const [peerId, {dialog, topics}] of dialogs) {\n if(peerId !== this.peerId || !topics?.size) {\n continue;\n }\n\n topics.forEach((forumTopic) => {\n this.updateDialog(forumTopic);\n });\n }\n });\n\n this.listenerSetter.add(rootScope)('dialog_unread', ({dialog}) => {\n if(dialog?._ !== 'forumTopic' || dialog.peerId !== this.peerId) {\n return;\n }\n\n appDialogsManager.setUnreadMessagesN({dialog, dialogElement: this.getDialogElement(this.getDialogKey(dialog))});\n });\n\n this.listenerSetter.add(rootScope)('dialog_notify_settings', async(dialog) => {\n if(dialog.peerId !== this.peerId) {\n return;\n }\n\n if(dialog._ === 'dialog') {\n const all = this.sortedList.getAll();\n const entries = [...all.entries()];\n const promises = entries.map(([id]) => this.managers.dialogsStorage.getForumTopic(this.peerId, id));\n const topics = await Promise.all(promises);\n entries.forEach(([id, element], idx) => {\n appDialogsManager.setUnreadMessagesN({dialog: topics[idx], dialogElement: element.dialogElement}); // возможно это не нужно, но нужно менять is-muted\n });\n\n return;\n }\n\n appDialogsManager.setUnreadMessagesN({dialog, dialogElement: this.getDialogElement(this.getDialogKey(dialog))}); // возможно это не нужно, но нужно менять is-muted\n });\n\n this.listenerSetter.add(rootScope)('dialog_drop', (dialog) => {\n if(dialog._ !== 'forumTopic' || dialog.peerId !== this.peerId) {\n return;\n }\n\n this.deleteDialogByKey(this.getDialogKey(dialog));\n });\n\n this.listenerSetter.add(rootScope)('dialog_draft', ({dialog, drop, peerId}) => {\n if(dialog._ !== 'forumTopic' || dialog.peerId !== this.peerId) {\n return;\n }\n\n if(drop) {\n this.deleteDialog(dialog);\n } else {\n this.updateDialog(dialog);\n }\n });\n }\n\n protected isDialogMustBeInViewport(dialog: ForumTopic) {\n if(dialog.pFlags.hidden) return false;\n return super.isDialogMustBeInViewport(dialog);\n }\n\n public getDialogKey(dialog: ForumTopic) {\n return dialog.id;\n }\n\n public getDialogKeyFromElement(element: HTMLElement) {\n return +element.dataset.threadId;\n }\n\n public getRectFromForPlaceholder() {\n return (): DOMRectEditable => {\n const sidebarRect = appSidebarLeft.rect;\n const paddingY = 56;\n return {\n top: paddingY,\n right: sidebarRect.right,\n bottom: 0,\n left: this.paddingX,\n width: sidebarRect.width - this.paddingX,\n height: sidebarRect.height - paddingY\n };\n };\n }\n\n public getDialogFromElement(element: HTMLElement) {\n return this.managers.dialogsStorage.getForumTopic(+element.dataset.peerId, +element.dataset.threadId);\n }\n\n public async loadDialogsInner(side: SliceSides) {\n const {indexKey} = this;\n let loadCount = windowSize.height / 64 * 1.25 | 0;\n let offsetIndex = 0;\n\n const filterId = this.peerId;\n const {index: currentOffsetIndex} = this.getOffsetIndex(side);\n offsetIndex = currentOffsetIndex;\n if(currentOffsetIndex) {\n if(side === 'top') {\n const storage = await this.managers.dialogsStorage.getFolderDialogs(filterId, true);\n const index = storage.findIndex((dialog) => getDialogIndex(dialog, indexKey) <= currentOffsetIndex);\n const needIndex = Math.max(0, index - loadCount);\n loadCount = index - needIndex;\n offsetIndex = getDialogIndex(storage[needIndex], indexKey) + 1;\n } else {\n offsetIndex = currentOffsetIndex;\n }\n }\n\n return this.managers.acknowledged.dialogsStorage.getDialogs({\n offsetIndex,\n limit: loadCount,\n filterId,\n skipMigrated: true\n });\n }\n}\n\nclass Some2 extends Some {\n constructor(protected filterId: number) {\n super();\n\n this.needPlaceholderAtFirstTime = true;\n\n this.listenerSetter.add(rootScope)('peer_typings', async({peerId, typings}) => {\n const [dialog, isForum] = await Promise.all([\n this.managers.appMessagesManager.getDialogOnly(peerId),\n this.managers.appPeersManager.isForum(peerId)\n ]);\n\n if(!dialog || isForum) return;\n\n if(typings.length) {\n this.setTyping(dialog);\n } else {\n this.unsetTyping(dialog);\n }\n });\n\n this.listenerSetter.add(rootScope)('user_update', async(userId) => {\n if(!this.isActive) {\n return;\n }\n\n const peerId = userId.toPeerId();\n const dom = this.getDialogDom(peerId);\n if(!dom) {\n return;\n }\n\n const status = await this.managers.appUsersManager.getUserStatus(userId);\n const online = status?._ === 'userStatusOnline';\n this.setOnlineStatus(dom.avatarEl, online);\n });\n\n this.listenerSetter.add(rootScope)('chat_update', async(chatId) => {\n const peerId = chatId.toPeerId(true);\n this.processDialogForCallStatus(peerId);\n });\n\n this.listenerSetter.add(rootScope)('dialog_flush', ({dialog}) => {\n if(!this.isActive || !dialog) {\n return;\n }\n\n appDialogsManager.setLastMessageN({\n dialog,\n setUnread: true\n });\n this.validateDialogForFilter(dialog);\n });\n\n this.listenerSetter.add(rootScope)('dialogs_multiupdate', (dialogs) => {\n if(!this.isActive) {\n return;\n }\n\n for(const [peerId, {dialog, topics}] of dialogs) {\n if(dialog?._ !== 'dialog') {\n continue;\n }\n\n this.updateDialog(dialog);\n\n appDialogsManager.processContact?.(peerId.toPeerId());\n\n this.validateDialogForFilter(dialog);\n }\n });\n\n this.listenerSetter.add(rootScope)('dialog_drop', (dialog) => {\n if(!this.isActive || dialog._ !== 'dialog') {\n return;\n }\n\n this.deleteDialogByKey(dialog.peerId);\n appDialogsManager.processContact?.(dialog.peerId);\n });\n\n this.listenerSetter.add(rootScope)('dialog_unread', ({dialog}) => {\n if(!this.isActive || dialog?._ !== 'dialog') {\n return;\n }\n\n appDialogsManager.setUnreadMessagesN({dialog, dialogElement: this.getDialogElement(this.getDialogKey(dialog))});\n this.validateDialogForFilter(dialog);\n });\n\n this.listenerSetter.add(rootScope)('dialog_notify_settings', (dialog) => {\n if(!this.isActive || dialog._ === 'forumTopic') {\n return;\n }\n\n this.validateDialogForFilter(dialog);\n appDialogsManager.setUnreadMessagesN({dialog, dialogElement: this.getDialogElement(this.getDialogKey(dialog))}); // возможно это не нужно, но нужно менять is-muted\n });\n\n this.listenerSetter.add(rootScope)('dialog_draft', ({dialog, drop, peerId}) => {\n if(!this.isActive || dialog._ === 'forumTopic') {\n return;\n }\n\n if(drop) {\n this.deleteDialog(dialog);\n } else {\n this.updateDialog(dialog);\n }\n\n appDialogsManager.processContact?.(peerId);\n });\n\n this.listenerSetter.add(rootScope)('filter_update', async(filter) => {\n if(this.isActive && filter.id === this.filterId && !REAL_FOLDERS.has(filter.id)) {\n const dialogs = await this.managers.dialogsStorage.getCachedDialogs(true);\n await this.validateListForFilter();\n for(let i = 0, length = dialogs.length; i < length; ++i) {\n const dialog = dialogs[i];\n this.updateDialog(dialog);\n }\n }\n });\n }\n\n private get isActive() {\n return appDialogsManager.xd === this;\n }\n\n public getRectFromForPlaceholder() {\n return this.filterId === FOLDER_ID_ARCHIVE ? appDialogsManager.chatsContainer : appDialogsManager.folders.container;\n }\n\n public async loadDialogsInner(side: SliceSides) {\n const {filterId, indexKey} = this;\n let loadCount = windowSize.height / 72 * 1.25 | 0;\n let offsetIndex = 0;\n\n const doNotRenderChatList = appDialogsManager.doNotRenderChatList; // cache before awaits\n\n const {index: currentOffsetIndex} = this.getOffsetIndex(side);\n if(currentOffsetIndex) {\n if(side === 'top') {\n const storage = await this.managers.dialogsStorage.getFolderDialogs(filterId, true);\n const index = storage.findIndex((dialog) => getDialogIndex(dialog, indexKey) <= currentOffsetIndex);\n const needIndex = Math.max(0, index - loadCount);\n loadCount = index - needIndex;\n offsetIndex = getDialogIndex(storage[needIndex], indexKey) + 1;\n } else {\n offsetIndex = currentOffsetIndex;\n }\n }\n\n const promise = this.managers.acknowledged.dialogsStorage.getDialogs({\n offsetIndex,\n limit: loadCount,\n filterId,\n skipMigrated: true\n });\n\n const a = await promise;\n if(doNotRenderChatList) {\n a.result = Promise.reject(makeError('MIDDLEWARE'));\n }\n\n return a;\n }\n\n public setOnlineStatus(element: HTMLElement, online: boolean) {\n const className = 'is-online';\n const hasClassName = element.classList.contains(className);\n !hasClassName && online && element.classList.add(className);\n SetTransition({\n element: element,\n className: 'is-visible',\n forwards: online,\n duration: 250,\n onTransitionEnd: online ? undefined : () => {\n element.classList.remove(className);\n },\n useRafs: online && !hasClassName ? 2 : 0\n });\n }\n\n public generateScrollable(list: HTMLUListElement, filter: Parameters[0]) {\n const filterId = filter.id;\n const scrollable = new Scrollable(null, 'CL', 500);\n scrollable.container.dataset.filterId = '' + filterId;\n\n const indexKey = getDialogIndexKey(filter.localId);\n const sortedDialogList = new SortedDialogList({\n managers: rootScope.managers,\n log: this.log,\n list: list,\n indexKey,\n onListLengthChange: appDialogsManager.onListLengthChange\n });\n\n this.scrollable = scrollable;\n this.sortedList = sortedDialogList;\n this.setIndexKey(indexKey);\n this.bindScrollable();\n\n // list.classList.add('hide');\n // scrollable.container.style.backgroundColor = '#' + (Math.random() * (16 ** 6 - 1) | 0).toString(16);\n\n return scrollable;\n }\n\n public testDialogForFilter(dialog: Dialog) {\n if(!REAL_FOLDERS.has(this.filterId) ? getDialogIndex(dialog, this.indexKey) === undefined : this.filterId !== dialog.folder_id) {\n return false;\n }\n\n return true;\n }\n\n protected isDialogMustBeInViewport(dialog: Dialog) {\n if(dialog.migratedTo !== undefined || !this.testDialogForFilter(dialog)) return false;\n return super.isDialogMustBeInViewport(dialog);\n }\n\n /**\n * Удалит неподходящие чаты из списка, но не добавит их(!)\n */\n public async validateListForFilter() {\n this.sortedList.getAll().forEach(async(element) => {\n const dialog = await rootScope.managers.appMessagesManager.getDialogOnly(element.id);\n if(!this.testDialogForFilter(dialog)) {\n this.deleteDialog(dialog);\n }\n });\n }\n\n /**\n * Удалит неподходящий чат из списка, но не добавит его(!)\n */\n public validateDialogForFilter(dialog: Dialog) {\n if(!this.getDialogElement(dialog.peerId)) {\n return;\n }\n\n if(!this.testDialogForFilter(dialog)) {\n this.deleteDialog(dialog);\n }\n }\n\n public setCallStatus(dom: DialogDom, visible: boolean) {\n let {callIcon, listEl} = dom;\n if(!callIcon && visible) {\n const {canvas, startAnimation} = dom.callIcon = callIcon = groupCallActiveIcon(listEl.classList.contains('active'));\n canvas.classList.add('dialog-group-call-icon');\n listEl.append(canvas);\n startAnimation();\n }\n\n if(!callIcon) {\n return;\n }\n\n SetTransition({\n element: dom.callIcon.canvas,\n className: 'is-visible',\n forwards: visible,\n duration: BADGE_TRANSITION_TIME,\n onTransitionEnd: visible ? undefined : () => {\n dom.callIcon.canvas.remove();\n dom.callIcon = undefined;\n },\n useRafs: visible ? 2 : 0\n });\n }\n\n public async processDialogForCallStatus(peerId: PeerId, dom?: DialogDom) {\n if(!IS_GROUP_CALL_SUPPORTED) {\n return;\n }\n\n if(!dom) dom = this.getDialogDom(peerId);\n if(!dom) return;\n\n const chat = await rootScope.managers.appChatsManager.getChat(peerId.toChatId()) as Chat.chat | Chat.channel;\n this.setCallStatus(dom, !!(chat.pFlags.call_active && chat.pFlags.call_not_empty));\n }\n\n public onChatsScroll(side: SliceSides = 'bottom') {\n if(this.scrollable.loadedAll[side]) {\n appDialogsManager.loadContacts?.();\n }\n\n this.log('onChatsScroll', side);\n return super.onChatsScroll(side);\n }\n\n public toggleAvatarUnreadBadges(value: boolean, useRafs: number) {\n if(!value) {\n this.sortedList.getAll().forEach((sortedDialog) => {\n const {dom, dialogElement} = sortedDialog;\n if(!dom.unreadAvatarBadge) {\n return;\n }\n\n dialogElement.toggleBadgeByKey('unreadAvatarBadge', false, false, false);\n });\n\n return;\n }\n\n const reuseClassNames = ['unread', 'mention'];\n this.sortedList.getAll().forEach((sortedDialog) => {\n const {dom, dialogElement} = sortedDialog;\n const unreadContent = dom.unreadBadge?.textContent;\n if(!unreadContent || dom.unreadBadge.classList.contains('backwards')) {\n return;\n }\n\n const isUnreadAvatarBadgeMounted = !!dom.unreadAvatarBadge;\n dialogElement.createUnreadAvatarBadge();\n dialogElement.toggleBadgeByKey('unreadAvatarBadge', true, isUnreadAvatarBadgeMounted);\n dom.unreadAvatarBadge.textContent = unreadContent;\n const unreadAvatarBadgeClassList = dom.unreadAvatarBadge.classList;\n const unreadBadgeClassList = dom.unreadBadge.classList;\n reuseClassNames.forEach((className) => {\n unreadAvatarBadgeClassList.toggle(className, unreadBadgeClassList.contains(className));\n });\n });\n }\n\n public getDialogKey(dialog: Dialog) {\n return dialog.peerId;\n }\n\n public getDialogKeyFromElement(element: HTMLElement) {\n return +element.dataset.peerId;\n }\n\n public getDialogFromElement(element: HTMLElement) {\n return rootScope.managers.appMessagesManager.getDialogOnly(element.dataset.peerId.toPeerId());\n }\n}\n\n// const testScroll = false;\n// let testTopSlice = 1;\n\nexport class AppDialogsManager {\n public chatsContainer = document.getElementById('chatlist-container') as HTMLDivElement;\n\n private log = logger('DIALOGS', LogTypes.Log | LogTypes.Error | LogTypes.Warn | LogTypes.Debug);\n\n private contextMenu: DialogsContextMenu;\n\n public filterId: number;\n public folders: {[k in 'menu' | 'container' | 'menuScrollContainer']: HTMLElement} = {\n menu: document.getElementById('folders-tabs'),\n menuScrollContainer: null,\n container: document.getElementById('folders-container')\n };\n private filtersRendered: {\n [filterId: string]: {\n menu: HTMLElement,\n container: HTMLElement,\n unread: HTMLElement,\n title: HTMLElement\n }\n } = {};\n private showFiltersPromise: Promise;\n\n private lastActiveElements: Set = new Set();\n\n public loadContacts: () => void;\n public processContact: (peerId: PeerId) => void;\n\n private initedListeners = false;\n\n public onListLengthChange: () => Promise;\n private allChatsIntlElement: I18n.IntlElement;\n\n private emptyDialogsPlaceholderSubtitle: I18n.IntlElement;\n private updateContactsLengthPromise: Promise;\n\n private filtersNavigationItem: NavigationItem;\n\n private managers: AppManagers;\n private selectTab: ReturnType;\n\n public doNotRenderChatList: boolean;\n\n private stateMiddlewareHelper: MiddlewareHelper;\n\n private forumsTabs: Map;\n private forumsSlider: HTMLElement;\n public forumTab: ForumTab;\n private forumNavigationItem: NavigationItem;\n\n public xd: Some2;\n public xds: {[filterId: number]: Some2} = {};\n\n public start() {\n const managers = this.managers = getProxiedManagers();\n\n this.contextMenu = new DialogsContextMenu(managers);\n this.stateMiddlewareHelper = getMiddleware();\n\n this.folders.menuScrollContainer = this.folders.menu.parentElement;\n\n this.onListLengthChange = debounce(this._onListLengthChange, 100, false, true);\n\n const bottomPart = document.createElement('div');\n bottomPart.classList.add('connection-status-bottom');\n bottomPart.append(this.folders.container);\n\n this.forumsTabs = new Map();\n this.forumsSlider = document.createElement('div');\n this.forumsSlider.classList.add('topics-slider');\n this.chatsContainer.parentElement.parentElement.append(this.forumsSlider);\n // findUpClassName(this.chatsContainer, 'chatlist-container').append(this.forumsSlider);\n\n // appSidebarLeft.onOpenTab = () => {\n // return this.toggleForumTab();\n // };\n\n /* if(isTouchSupported && isSafari) {\n let allowUp: boolean, allowDown: boolean, slideBeginY: number;\n const container = this.scroll.container;\n container.addEventListener('touchstart', (event) => {\n allowUp = container.scrollTop > 0;\n allowDown = (container.scrollTop < container.scrollHeight - container.clientHeight);\n // @ts-ignore\n slideBeginY = event.pageY;\n });\n\n container.addEventListener('touchmove', (event: any) => {\n var up = (event.pageY > slideBeginY);\n var down = (event.pageY < slideBeginY);\n slideBeginY = event.pageY;\n if((up && allowUp) || (down && allowDown)) {\n event.stopPropagation();\n } else if(up || down) {\n event.preventDefault();\n }\n });\n } */\n\n if(IS_TOUCH_SUPPORTED) {\n handleTabSwipe({\n element: this.folders.container,\n onSwipe: (xDiff) => {\n const prevId = selectTab.prevId();\n selectTab(xDiff < 0 ? prevId + 1 : prevId - 1);\n },\n verifyTouchTarget: () => {\n return !this.forumTab;\n }\n });\n }\n\n this.allChatsIntlElement = new I18n.IntlElement({\n key: 'FilterAllChatsShort'\n });\n\n rootScope.addEventListener('premium_toggle', async(isPremium) => {\n if(isPremium) {\n return;\n }\n\n const isFolderAvailable = await this.managers.filtersStorage.isFilterIdAvailable(this.filterId);\n if(!isFolderAvailable) {\n selectTab(whichChild(this.filtersRendered[FOLDER_ID_ALL].menu), false);\n }\n });\n\n rootScope.addEventListener('state_cleared', () => {\n const clearCurrent = REAL_FOLDERS.has(this.filterId);\n // setTimeout(() =>\n apiManagerProxy.getState().then(async(state) => {\n this.xd.loadedDialogsAtLeastOnce = false;\n this.showFiltersPromise = undefined;\n\n /* const clearPromises: Promise[] = [];\n for(const name in this.managers.appStateManager.storagesResults) {\n const results = this.managers.appStateManager.storagesResults[name as keyof AppStateManager['storages']];\n const storage = this.managers.appStateManager.storages[name as keyof AppStateManager['storages']];\n results.length = 0;\n clearPromises.push(storage.clear());\n } */\n\n if(clearCurrent) {\n this.xd.clear();\n this.onTabChange();\n }\n\n this.onStateLoaded(state);\n })// , 5000);\n });\n\n this.setFilterId(FOLDER_ID_ALL, FOLDER_ID_ALL);\n this.addFilter({\n id: FOLDER_ID_ALL,\n title: '',\n localId: FOLDER_ID_ALL\n });\n\n const foldersScrollable = new ScrollableX(this.folders.menuScrollContainer);\n bottomPart.prepend(this.folders.menuScrollContainer);\n const selectTab = this.selectTab = horizontalMenu(this.folders.menu, this.folders.container, async(id, tabContent) => {\n /* if(id !== 0) {\n id += 1;\n } */\n\n const _id = id;\n id = +tabContent.dataset.filterId || FOLDER_ID_ALL;\n\n const isFilterAvailable = this.filterId === -1 || REAL_FOLDERS.has(id) || await this.managers.filtersStorage.isFilterIdAvailable(id);\n if(!isFilterAvailable) {\n return false;\n }\n\n const wasFilterId = this.filterId;\n if(!IS_MOBILE_SAFARI) {\n if(_id) {\n if(!this.filtersNavigationItem) {\n this.filtersNavigationItem = {\n type: 'filters',\n onPop: () => {\n selectTab(0);\n this.filtersNavigationItem = undefined;\n }\n };\n\n appNavigationController.spliceItems(1, 0, this.filtersNavigationItem);\n }\n } else if(this.filtersNavigationItem) {\n appNavigationController.removeItem(this.filtersNavigationItem);\n this.filtersNavigationItem = undefined;\n }\n }\n\n if(wasFilterId === id) return;\n\n this.xds[id].clear();\n const promise = this.setFilterIdAndChangeTab(id).then(({cached, renderPromise}) => {\n if(cached) {\n return renderPromise;\n }\n });\n\n if(wasFilterId !== -1) {\n return promise;\n }\n }, () => {\n for(const folderId in this.xds) {\n if(+folderId !== this.filterId) {\n this.xds[folderId].clear();\n }\n }\n }, undefined, foldersScrollable);\n\n apiManagerProxy.getState().then((state) => {\n // * it should've had a better place :(\n appMediaPlaybackController.setPlaybackParams(state.playbackParams);\n appMediaPlaybackController.addEventListener('playbackParams', (params) => {\n this.managers.appStateManager.pushToState('playbackParams', params);\n });\n\n return this.onStateLoaded(state);\n })/* .then(() => {\n const isLoadedMain = this.managers.appMessagesManager.dialogsStorage.isDialogsLoaded(0);\n const isLoadedArchive = this.managers.appMessagesManager.dialogsStorage.isDialogsLoaded(1);\n const wasLoaded = isLoadedMain || isLoadedArchive;\n const a: Promise = isLoadedMain ? Promise.resolve() : this.managers.appMessagesManager.getConversationsAll('', 0);\n const b: Promise = isLoadedArchive ? Promise.resolve() : this.managers.appMessagesManager.getConversationsAll('', 1);\n a.finally(() => {\n b.then(() => {\n if(wasLoaded) {\n (apiUpdatesManager.updatesState.syncLoading || Promise.resolve()).then(() => {\n this.managers.appMessagesManager.refreshConversations();\n });\n }\n });\n });\n }) */;\n\n mediaSizes.addEventListener('resize', () => {\n this.changeFiltersAllChatsKey();\n });\n\n new ConnectionStatusComponent(this.managers, this.chatsContainer);\n this.chatsContainer.append(bottomPart);\n\n setTimeout(() => {\n lottieLoader.loadLottieWorkers();\n }, 200);\n\n PopupElement.MANAGERS = rootScope.managers = managers;\n appDownloadManager.construct(managers);\n appSidebarLeft.construct(managers);\n appSidebarRight.construct(managers);\n groupCallsController.construct(managers);\n callsController.construct(managers);\n appImManager.construct(managers);\n\n // start\n\n this.xd = this.xds[this.filterId];\n\n // selectTab(0, false);\n }\n\n public get chatList() {\n return this.xd.sortedList.list;\n }\n\n public setFilterId(filterId: number, localId: MyDialogFilter['localId']) {\n this.filterId = filterId;\n }\n\n public async setFilterIdAndChangeTab(filterId: number) {\n this.filterId = filterId;\n return this.onTabChange();\n }\n\n private initListeners() {\n rootScope.addEventListener('dialog_flush', ({dialog}) => {\n if(!dialog) {\n return;\n }\n\n this.setFiltersUnreadCount();\n });\n\n rootScope.addEventListener('folder_unread', async(folder) => {\n if(folder.id < 0) {\n const dialogElement = this.xd.getDialogElement(folder.id);\n if(!dialogElement) {\n return;\n }\n\n this.setUnreadMessagesN({\n dialog: await this.managers.dialogsStorage.getDialogOnly(folder.id),\n dialogElement\n });\n } else {\n this.setFilterUnreadCount(folder.id);\n }\n });\n\n rootScope.addEventListener('contacts_update', (userId) => {\n this.processContact?.(userId.toPeerId());\n });\n\n appImManager.addEventListener('peer_changed', ({peerId, threadId, isForum}) => {\n const options: Parameters[0] = {peerId, threadId: isForum ? threadId : undefined};\n // const perf = performance.now();\n for(const element of this.lastActiveElements) {\n const elementThreadId = +element.dataset.threadId || undefined;\n const elementPeerId = element.dataset.peerId.toPeerId();\n if(!appImManager.isSamePeer({peerId: elementPeerId, threadId: elementThreadId}, options)) {\n this.setDialogActive(element, false);\n }\n }\n\n const elements = Array.from(document.querySelectorAll(`[data-autonomous=\"0\"] .chatlist-chat[data-peer-id=\"${peerId}\"]`)) as HTMLElement[];\n elements.forEach((element) => {\n const elementThreadId = +element.dataset.threadId || undefined;\n if(appImManager.isSamePeer({peerId, threadId: elementThreadId}, options)) {\n this.setDialogActive(element, true);\n }\n });\n // this.log('peer_changed total time:', performance.now() - perf);\n });\n\n rootScope.addEventListener('filter_update', async(filter) => {\n if(REAL_FOLDERS.has(filter.id)) {\n return;\n }\n\n if(!this.filtersRendered[filter.id]) {\n this.addFilter(filter);\n return;\n }\n\n const elements = this.filtersRendered[filter.id];\n setInnerHTML(elements.title, wrapEmojiText(filter.title));\n });\n\n rootScope.addEventListener('filter_delete', (filter) => {\n const elements = this.filtersRendered[filter.id];\n if(!elements) return;\n\n // set tab\n // (this.folders.menu.firstElementChild.children[Math.max(0, filter.id - 2)] as HTMLElement).click();\n elements.container.remove();\n elements.menu.remove();\n\n this.xds[filter.id].destroy();\n delete this.xds[filter.id];\n delete this.filtersRendered[filter.id];\n\n this.onFiltersLengthChange();\n\n if(this.filterId === filter.id) {\n this.selectTab(0, false);\n }\n });\n\n rootScope.addEventListener('filter_order', async(order) => {\n order = order.slice();\n indexOfAndSplice(order, FOLDER_ID_ARCHIVE);\n\n const containerToAppend = this.folders.menu as HTMLElement;\n const r = await Promise.all(order.map(async(filterId) => {\n const [indexKey, filter] = await Promise.all([\n this.managers.dialogsStorage.getDialogIndexKeyByFilterId(filterId),\n this.managers.filtersStorage.getFilter(filterId)\n ]);\n\n return {indexKey, filter};\n }));\n\n order.forEach((filterId, idx) => {\n const {indexKey, filter} = r[idx];\n const renderedFilter = this.filtersRendered[filterId];\n\n this.xds[filterId].setIndexKey(indexKey);\n\n positionElementByIndex(renderedFilter.menu, containerToAppend, filter.localId);\n positionElementByIndex(renderedFilter.container, this.folders.container, filter.localId);\n });\n\n /* if(this.filterId) {\n const tabIndex = order.indexOf(this.filterId) + 1;\n selectTab.prevId = tabIndex;\n } */\n });\n }\n\n public setDialogActive(listEl: HTMLElement, active: boolean) {\n const dom = (listEl as any).dialogDom as DialogDom;\n listEl.classList.toggle('active', active);\n listEl.classList.toggle('is-forum-open', this.forumTab?.peerId === listEl.dataset.peerId.toPeerId() && !listEl.dataset.threadId);\n if(active) {\n this.lastActiveElements.add(listEl);\n } else {\n this.lastActiveElements.delete(listEl);\n }\n\n if(dom?.callIcon) {\n dom.callIcon.setActive(active);\n }\n }\n\n private async onStateLoaded(state: State) {\n this.stateMiddlewareHelper.clean();\n const middleware = this.stateMiddlewareHelper.get();\n const filtersArr = state.filtersArr;\n const haveFilters = filtersArr.length > REAL_FOLDERS.size;\n // const filter = filtersArr.find((filter) => filter.id !== FOLDER_ID_ARCHIVE);\n\n const addFilters = (filters: MyDialogFilter[]) => {\n for(const filter of filters) {\n this.addFilter(filter);\n }\n };\n\n let addFiltersPromise: Promise;\n if(haveFilters) {\n addFilters(filtersArr);\n } else {\n addFiltersPromise = this.managers.filtersStorage.getDialogFilters().then(addFilters);\n }\n\n this.doNotRenderChatList = true;\n const loadDialogsPromise = this.xd.onChatsScroll();\n const m = middlewarePromise(middleware);\n try {\n await m(loadDialogsPromise);\n } catch(err) {\n\n }\n\n // show the placeholder before the filters, and then will reset to the default tab again\n if(!haveFilters) {\n this.selectTab(0, false);\n }\n\n addFiltersPromise && await m(addFiltersPromise);\n // this.folders.menu.children[0].classList.add('active');\n\n this.doNotRenderChatList = undefined;\n\n this.filterId = -1;\n this.selectTab(0, false);\n\n if(!this.initedListeners) {\n this.initListeners();\n this.initedListeners = true;\n }\n\n haveFilters && this.showFiltersPromise && await m(this.showFiltersPromise);\n\n this.managers.appNotificationsManager.getNotifyPeerTypeSettings();\n\n await (await m(loadDialogsPromise)).renderPromise.catch(noop);\n this.managers.appMessagesManager.fillConversations();\n }\n\n /* private getOffset(side: 'top' | 'bottom'): {index: number, pos: number} {\n if(!this.scroll.loadedAll[side]) {\n const element = (side === 'top' ? this.chatList.firstElementChild : this.chatList.lastElementChild) as HTMLElement;\n if(element) {\n const peerId = element.dataset.peerId;\n const dialog = this.managers.appMessagesManager.getDialogByPeerId(peerId);\n return {index: dialog[0].index, pos: dialog[1]};\n }\n }\n\n return {index: 0, pos: -1};\n } */\n\n public onTabChange = () => {\n this.xd = this.xds[this.filterId];\n this.xd.reset();\n return this.xd.onChatsScroll();\n };\n\n private async setFilterUnreadCount(filterId: number) {\n // if(filterId === FOLDER_ID_ALL) {\n // return;\n // }\n\n const unreadSpan = this.filtersRendered[filterId]?.unread;\n if(!unreadSpan) {\n return;\n }\n\n const {unreadUnmutedCount, unreadCount} = await this.managers.dialogsStorage.getFolderUnreadCount(filterId);\n\n unreadSpan.classList.toggle('badge-gray', !unreadUnmutedCount);\n const count = filterId === FOLDER_ID_ALL ? unreadUnmutedCount : unreadCount;\n unreadSpan.innerText = count ? '' + count : '';\n }\n\n private setFiltersUnreadCount() {\n for(const filterId in this.filtersRendered) {\n this.setFilterUnreadCount(+filterId);\n }\n }\n\n public l(filter: Parameters[0]) {\n const ul = this.createChatList();\n const xd = this.xds[filter.id] = new Some2(filter.id);\n const scrollable = xd.generateScrollable(ul, filter);\n this.setListClickListener(ul, null, true);\n\n return {ul, xd, scrollable};\n }\n\n private addFilter(filter: Pick) {\n if(filter.id === FOLDER_ID_ARCHIVE) {\n return;\n }\n\n const containerToAppend = this.folders.menu as HTMLElement;\n const renderedFilter = this.filtersRendered[filter.id];\n if(renderedFilter) {\n positionElementByIndex(renderedFilter.menu, containerToAppend, filter.localId);\n positionElementByIndex(renderedFilter.container, this.folders.container, filter.localId);\n return;\n }\n\n const menuTab = document.createElement('div');\n menuTab.classList.add('menu-horizontal-div-item');\n const span = document.createElement('span');\n const titleSpan = document.createElement('span');\n titleSpan.classList.add('text-super');\n if(filter.id === FOLDER_ID_ALL) titleSpan.append(this.allChatsIntlElement.element);\n else setInnerHTML(titleSpan, wrapEmojiText(filter.title));\n const unreadSpan = document.createElement('div');\n unreadSpan.classList.add('badge', 'badge-20', 'badge-primary');\n const i = document.createElement('i');\n span.append(titleSpan, unreadSpan, i);\n ripple(menuTab);\n menuTab.append(span);\n\n menuTab.dataset.filterId = '' + filter.id;\n\n positionElementByIndex(menuTab, containerToAppend, filter.localId);\n // containerToAppend.append(li);\n\n const {ul, scrollable} = this.l(filter);\n scrollable.container.classList.add('tabs-tab', 'chatlist-parts');\n\n /* const parts = document.createElement('div');\n parts.classList.add('chatlist-parts'); */\n\n const top = document.createElement('div');\n top.classList.add('chatlist-top');\n\n const bottom = document.createElement('div');\n bottom.classList.add('chatlist-bottom');\n\n top.append(ul);\n scrollable.container.append(top, bottom);\n /* parts.append(top, bottom);\n scrollable.container.append(parts); */\n\n const div = scrollable.container;\n // this.folders.container.append(div);\n positionElementByIndex(scrollable.container, this.folders.container, filter.localId);\n\n this.filtersRendered[filter.id] = {\n menu: menuTab,\n container: div,\n unread: unreadSpan,\n title: titleSpan\n };\n\n this.onFiltersLengthChange();\n }\n\n private changeFiltersAllChatsKey() {\n const scrollable = this.folders.menuScrollContainer.firstElementChild;\n const key: LangPackKey = scrollable.scrollWidth > scrollable.clientWidth ? 'FilterAllChatsShort' : 'FilterAllChats';\n this.allChatsIntlElement.compareAndUpdate({key});\n }\n\n private onFiltersLengthChange() {\n let promise = this.showFiltersPromise;\n return promise ??= this.showFiltersPromise = pause(0).then(() => {\n if(this.showFiltersPromise !== promise) {\n return;\n }\n\n const length = Object.keys(this.filtersRendered).length;\n const show = length > 1;\n const wasShowing = !this.folders.menuScrollContainer.classList.contains('hide');\n\n if(show !== wasShowing) {\n this.folders.menuScrollContainer.classList.toggle('hide', !show);\n if(show && !wasShowing) {\n this.setFiltersUnreadCount();\n }\n\n this.chatsContainer.classList.toggle('has-filters', show);\n }\n\n this.changeFiltersAllChatsKey();\n\n this.showFiltersPromise = undefined;\n });\n }\n\n private generateEmptyPlaceholder(options: {\n title: LangPackKey,\n subtitle?: LangPackKey,\n subtitleArgs?: FormatterArguments,\n classNameType: string\n }) {\n const BASE_CLASS = 'empty-placeholder';\n const container = document.createElement('div');\n container.classList.add(BASE_CLASS, BASE_CLASS + '-' + options.classNameType);\n\n const header = document.createElement('div');\n header.classList.add(BASE_CLASS + '-header');\n _i18n(header, options.title);\n\n const subtitle = document.createElement('div');\n subtitle.classList.add(BASE_CLASS + '-subtitle');\n if(options.subtitle) {\n _i18n(subtitle, options.subtitle, options.subtitleArgs);\n }\n\n container.append(header, subtitle);\n\n return {container, header, subtitle};\n }\n\n private checkIfPlaceholderNeeded() {\n if(this.filterId === FOLDER_ID_ARCHIVE) {\n return;\n }\n\n const chatList = this.chatList;\n const part = chatList.parentElement as HTMLElement;\n let placeholderContainer = (Array.from(part.children) as HTMLElement[]).find((el) => el.matches('.empty-placeholder'));\n const needPlaceholder = this.xd.scrollable.loadedAll.bottom && !chatList.childElementCount/* || true */;\n // chatList.style.display = 'none';\n\n if(needPlaceholder && placeholderContainer) {\n return;\n } else if(!needPlaceholder) {\n if(placeholderContainer) {\n part.classList.remove('with-placeholder');\n placeholderContainer.remove();\n }\n\n return;\n }\n\n let placeholder: ReturnType, type: 'dialogs' | 'folder';\n if(!this.filterId) {\n placeholder = this.generateEmptyPlaceholder({\n title: 'ChatList.Main.EmptyPlaceholder.Title',\n classNameType: type = 'dialogs'\n });\n\n placeholderContainer = placeholder.container;\n\n const img = document.createElement('img');\n img.classList.add('empty-placeholder-dialogs-icon');\n\n this.emptyDialogsPlaceholderSubtitle = new I18n.IntlElement({\n element: placeholder.subtitle\n });\n\n Promise.all([\n this.updateContactsLength(false),\n renderImageFromUrlPromise(img, 'assets/img/EmptyChats.svg'),\n fastRafPromise()\n ]).then(([usersLength]) => {\n placeholderContainer.classList.add('visible');\n part.classList.toggle('has-contacts', !!usersLength);\n });\n\n placeholderContainer.prepend(img);\n } else {\n placeholder = this.generateEmptyPlaceholder({\n title: 'FilterNoChatsToDisplay',\n subtitle: 'FilterNoChatsToDisplayInfo',\n classNameType: type = 'folder'\n });\n\n placeholderContainer = placeholder.container;\n\n const div = document.createElement('div');\n const emoji = '📂';\n const size = 128;\n wrapStickerEmoji({\n div,\n emoji: emoji,\n width: size,\n height: size\n });\n\n placeholderContainer.prepend(div);\n\n const button = Button('btn-primary btn-color-primary btn-control tgico', {\n text: 'FilterHeaderEdit',\n icon: 'settings'\n });\n\n attachClickEvent(button, async() => {\n const tab = appSidebarLeft.createTab(AppEditFolderTab);\n tab.setInitFilter(await this.managers.filtersStorage.getFilter(this.filterId));\n tab.open();\n });\n\n placeholderContainer.append(button);\n }\n\n part.append(placeholderContainer);\n part.classList.add('with-placeholder');\n part.dataset.placeholderType = type;\n }\n\n private updateContactsLength(updatePartClassName: boolean) {\n return this.updateContactsLengthPromise ??= this.managers.appUsersManager.getContacts().then((users) => {\n const subtitle = this.emptyDialogsPlaceholderSubtitle;\n if(subtitle) {\n let key: LangPackKey, args: FormatterArguments;\n\n if(users.length/* && false */) {\n key = 'ChatList.Main.EmptyPlaceholder.Subtitle';\n args = [i18n('Contacts.Count', [users.length])];\n } else {\n key = 'ChatList.Main.EmptyPlaceholder.SubtitleNoContacts';\n args = [];\n }\n\n subtitle.compareAndUpdate({\n key,\n args\n });\n }\n\n if(updatePartClassName) {\n const chatList = this.chatList;\n const part = chatList.parentElement as HTMLElement;\n part.classList.toggle('has-contacts', !!users.length);\n }\n\n this.updateContactsLengthPromise = undefined;\n\n return users.length;\n });\n }\n\n private removeContactsPlaceholder() {\n const chatList = this.chatList;\n const parts = chatList.parentElement.parentElement;\n const bottom = chatList.parentElement.nextElementSibling as HTMLElement;\n parts.classList.remove('with-contacts');\n bottom.replaceChildren();\n this.loadContacts = undefined;\n this.processContact = undefined;\n }\n\n private _onListLengthChange = () => {\n if(!this.xd.loadedDialogsAtLeastOnce) {\n return;\n }\n\n this.checkIfPlaceholderNeeded();\n\n if(this.filterId !== FOLDER_ID_ALL) return;\n\n const chatList = this.chatList;\n const count = chatList.childElementCount;\n\n const parts = chatList.parentElement.parentElement;\n const bottom = chatList.parentElement.nextElementSibling as HTMLElement;\n const hasContacts = !!bottom.childElementCount;\n if(count >= 10) {\n if(hasContacts) {\n this.removeContactsPlaceholder();\n }\n\n return;\n } else if(hasContacts) return;\n\n parts.classList.add('with-contacts');\n\n const section = new SettingSection({\n name: 'Contacts',\n noDelimiter: true,\n fakeGradientDelimiter: true\n });\n\n section.container.classList.add('hide');\n\n this.managers.appUsersManager.getContactsPeerIds(undefined, undefined, 'online').then((contacts) => {\n let ready = false;\n const onListLengthChange = () => {\n if(ready) {\n section.container.classList.toggle('hide', !sortedUserList.list.childElementCount);\n }\n\n this.updateContactsLength(true);\n };\n\n const sortedUserList = new SortedUserList({\n avatarSize: 'abitbigger',\n createChatListOptions: {\n dialogSize: 48,\n new: true\n },\n autonomous: false,\n onListLengthChange,\n managers: this.managers\n });\n\n this.loadContacts = () => {\n const pageCount = windowSize.height / 60 | 0;\n const promise = filterAsync(contacts.splice(0, pageCount), this.verifyPeerIdForContacts);\n\n promise.then((arr) => {\n arr.forEach((peerId) => {\n sortedUserList.add(peerId);\n });\n });\n\n if(!contacts.length) {\n this.loadContacts = undefined;\n }\n };\n\n this.loadContacts();\n\n this.processContact = async(peerId) => {\n if(peerId.isAnyChat()) {\n return;\n }\n\n const good = await this.verifyPeerIdForContacts(peerId);\n const added = sortedUserList.has(peerId);\n if(!added && good) sortedUserList.add(peerId);\n else if(added && !good) sortedUserList.delete(peerId);\n };\n\n const list = sortedUserList.list;\n list.classList.add('chatlist-new');\n this.setListClickListener(list);\n section.content.append(list);\n\n ready = true;\n onListLengthChange();\n });\n\n bottom.append(section.container);\n };\n\n private verifyPeerIdForContacts = async(peerId: PeerId) => {\n const [isContact, dialog] = await Promise.all([\n this.managers.appPeersManager.isContact(peerId),\n this.managers.appMessagesManager.getDialogOnly(peerId)\n ]);\n\n return isContact && !dialog;\n };\n\n public async toggleForumTab(newTab?: ForumTab, hideTab = this.forumTab) {\n if(!hideTab && !newTab) {\n return;\n }\n\n if(hideTab) {\n const dialogElement = this.xd.getDialogElement(hideTab.peerId);\n if(dialogElement) {\n dialogElement.dom.listEl.classList.remove('is-forum-open');\n }\n }\n\n if(hideTab === newTab) {\n newTab = undefined;\n }\n\n hideTab?.toggle(false);\n const promise = newTab?.toggle(true);\n if(hideTab === this.forumTab) {\n this.forumTab = newTab;\n }\n\n if(newTab) {\n const dialogElement = this.xd.getDialogElement(newTab.peerId);\n if(dialogElement) {\n dialogElement.dom.listEl.classList.add('is-forum-open');\n }\n\n appImManager.selectTab(APP_TABS.CHATLIST);\n }\n\n if(promise) {\n await promise;\n }\n\n if(newTab && !this.forumNavigationItem) {\n this.forumNavigationItem = {\n type: 'forum',\n onPop: () => {\n this.forumNavigationItem = undefined;\n this.toggleForumTab();\n }\n };\n\n appNavigationController.pushItem(this.forumNavigationItem);\n } else if(!newTab && this.forumNavigationItem) {\n appNavigationController.removeItem(this.forumNavigationItem);\n this.forumNavigationItem = undefined;\n }\n\n const forwards = !!newTab;\n const useRafs = promise ? 2 : undefined;\n this.xd.toggleAvatarUnreadBadges(forwards, useRafs);\n\n const deferred = deferredPromise();\n const duration = 300;\n SetTransition({\n element: this.forumsSlider.parentElement,\n className: 'is-forum-visible',\n duration,\n forwards,\n useRafs,\n onTransitionEnd: () => {\n deferred.resolve();\n }\n });\n\n dispatchHeavyAnimationEvent(deferred, duration).then(() => deferred.resolve());\n }\n\n public toggleForumTabByPeerId(peerId: PeerId, show?: boolean) {\n const {managers} = this;\n const history = appSidebarLeft.getHistory();\n const lastTab = history[history.length - 1];\n let forumTab: ForumTab;\n if(lastTab/* && !(lastTab instanceof AppArchivedTab) */) {\n if(lastTab instanceof ForumTab && lastTab.peerId === peerId && show) {\n shake(lastTab.container);\n return;\n }\n\n forumTab = appSidebarLeft.createTab(ForumTab);\n forumTab.open({peerId, managers});\n return;\n }\n\n forumTab = this.forumsTabs.get(peerId);\n const isSameTab = this.forumTab && this.forumTab === forumTab;\n show ??= !isSameTab;\n if(show === isSameTab) {\n if(show) {\n shake(forumTab.container);\n }\n\n return;\n }\n\n if(show && !forumTab) {\n forumTab = new ForumTab(undefined);\n forumTab.init({peerId, managers});\n\n this.forumsTabs.set(peerId, forumTab);\n this.forumsSlider.append(forumTab.container);\n\n forumTab.managers = this.managers;\n forumTab.eventListener.addEventListener('destroy', () => {\n this.forumsTabs.delete(peerId);\n });\n }\n\n return this.toggleForumTab(forumTab);\n }\n\n public setListClickListener(\n list: HTMLUListElement,\n onFound?: () => void,\n withContext = false,\n autonomous = false,\n openInner = false\n ) {\n let lastActiveListElement: HTMLElement;\n\n const setPeerFunc = (openInner ? appImManager.setInnerPeer : appImManager.setPeer).bind(appImManager);\n\n list.dataset.autonomous = '' + +autonomous;\n list.addEventListener('mousedown', (e) => {\n if(e.button !== 0) return;\n\n this.log('dialogs click list');\n const target = e.target as HTMLElement;\n const elem = findUpTag(target, DIALOG_LIST_ELEMENT_TAG);\n\n if(!elem) {\n return;\n }\n\n const peerId = elem.dataset.peerId.toPeerId();\n const lastMsgId = +elem.dataset.mid || undefined;\n const threadId = +elem.dataset.threadId || undefined;\n\n onFound?.();\n\n const isForum = !!elem.querySelector('.is-forum');\n if(isForum && !e.shiftKey && !lastMsgId) {\n this.toggleForumTabByPeerId(peerId);\n return;\n }\n\n if(e.ctrlKey || e.metaKey) {\n window.open((elem as HTMLAnchorElement).href || ('#' + peerId), '_blank');\n cancelEvent(e);\n return;\n }\n\n if(autonomous) {\n const sameElement = lastActiveListElement === elem;\n if(lastActiveListElement && !sameElement) {\n lastActiveListElement.classList.remove('active');\n }\n\n if(elem) {\n elem.classList.add('active');\n lastActiveListElement = elem;\n this.lastActiveElements.add(elem);\n }\n }\n\n if(\n (!threadId || lastMsgId) &&\n this.xd.sortedList.list === list &&\n this.xd !== this.xds[FOLDER_ID_ARCHIVE]\n ) {\n this.toggleForumTab();\n }\n\n setPeerFunc({\n peerId,\n lastMsgId,\n threadId: threadId\n });\n }, {capture: true});\n\n // cancel link click\n // ! do not change it to attachClickEvent\n list.addEventListener('click', (e) => {\n if(e.button === 0) {\n cancelEvent(e);\n }\n }, {capture: true});\n\n if(withContext) {\n this.contextMenu.attach(list);\n }\n }\n\n public createChatList(options: {\n // avatarSize?: number,\n // handheldsSize?: number,\n // size?: number,\n new?: boolean,\n dialogSize?: number,\n ignoreClick?: boolean\n } = {}) {\n const list = document.createElement('ul');\n list.classList.add('chatlist'/* ,\n 'chatlist-avatar-' + (options.avatarSize || 54) *//* , 'chatlist-' + (options.size || 72) */);\n\n if(options.new) {\n list.classList.add('chatlist-new');\n }\n\n if(options.dialogSize) {\n list.classList.add('chatlist-' + options.dialogSize);\n }\n\n // if(options.ignoreClick) {\n // list.classList.add('disable-hover');\n // }\n\n /* if(options.handheldsSize) {\n list.classList.add('chatlist-handhelds-' + options.handheldsSize);\n } */\n\n return list;\n }\n\n public setLastMessageN(options: Parameters[0]) {\n const promise = this.setLastMessage(options);\n return promise.catch((err: ApiError) => {\n if(err?.type !== 'MIDDLEWARE') {\n this.log.error('set last message error', err);\n }\n });\n }\n\n private async setLastMessage({\n dialog,\n lastMessage,\n dialogElement,\n highlightWord,\n isBatch = false,\n setUnread = false\n }: {\n dialog: Dialog | ForumTopic,\n lastMessage?: Message.message | Message.messageService,\n dialogElement?: DialogElement,\n highlightWord?: string,\n isBatch?: boolean,\n setUnread?: boolean\n }) {\n if(!dialogElement) {\n dialogElement = this.xd.getDialogElement(dialog.peerId);\n\n if(!dialogElement) {\n return;\n }\n }\n\n const {dom} = dialogElement;\n const {peerId} = dialog;\n\n const {deferred: promise, middleware} = setPromiseMiddleware(dom, 'setLastMessagePromise');\n\n let draftMessage: MyDraftMessage;\n if(!lastMessage) {\n if(\n dialog.draft?._ === 'draftMessage' && (\n !peerId.isAnyChat() ||\n dialog._ === 'forumTopic' ||\n !(await this.managers.appPeersManager.isForum(peerId))\n )\n ) {\n draftMessage = dialog.draft;\n }\n\n lastMessage = (dialog as Dialog).topMessage;\n if(lastMessage?.mid !== dialog.top_message) {\n const promise = this.managers.appMessagesManager.getMessageByPeer(peerId, dialog.top_message);\n lastMessage = await middleware(promise);\n }\n }\n\n const isSearch = setUnread !== null && !setUnread;\n // * do not uncomment `setUnread` - unsetTyping right after this call will interrupt setting unread badges\n if(/* setUnread */!isSearch) {\n this.setUnreadMessagesN({dialog, dialogElement, isBatch, setLastMessagePromise: promise});\n }\n\n if(!lastMessage/* || (lastMessage._ === 'messageService' && !lastMessage.rReply) */) {\n dom.lastMessageSpan.replaceChildren();\n dom.lastTimeSpan.replaceChildren();\n delete dom.listEl.dataset.mid;\n\n promise.resolve();\n return;\n }\n\n const isRestricted = lastMessage && isMessageRestricted(lastMessage as Message.message);\n\n /* if(!dom.lastMessageSpan.classList.contains('user-typing')) */ {\n let mediaContainer: HTMLElement;\n const willPrepend: (Promise | HTMLElement)[] = [];\n if(lastMessage && !draftMessage && !isRestricted) {\n const media = getMediaFromMessage(lastMessage, true);\n const videoTypes: Set = new Set(['video', 'gif', 'round']);\n if(media && (media._ === 'photo' || videoTypes.has(media.type))) {\n const size = choosePhotoSize(media, 20, 20);\n\n if(size._ !== 'photoSizeEmpty') {\n mediaContainer = document.createElement('div');\n mediaContainer.classList.add('dialog-subtitle-media');\n\n if((media as MyDocument).type === 'round') {\n mediaContainer.classList.add('is-round');\n }\n\n willPrepend.push(wrapPhoto({\n photo: media,\n message: lastMessage,\n container: mediaContainer,\n withoutPreloader: true,\n size\n }).then(() => mediaContainer));\n\n if(videoTypes.has((media as MyDocument).type)) {\n const playIcon = document.createElement('span');\n playIcon.classList.add('tgico-play');\n\n mediaContainer.append(playIcon);\n }\n }\n }\n }\n\n /* if(lastMessage.from_id === auth.id) { // You: */\n if(draftMessage) {\n const span = document.createElement('span');\n span.classList.add('danger');\n span.append(i18n('Draft'), ': ');\n willPrepend.unshift(span);\n } else if(peerId.isAnyChat() && peerId !== lastMessage.fromId && !(lastMessage as Message.messageService).action) {\n const span = document.createElement('span');\n span.classList.add('primary-text');\n\n if(lastMessage.fromId === rootScope.myId) {\n span.append(i18n('FromYou'));\n willPrepend.unshift(span);\n } else {\n // str = sender.first_name || sender.last_name || sender.username;\n const p = middleware(wrapPeerTitle({\n peerId: lastMessage.fromId,\n onlyFirstName: true\n })).then((element) => {\n span.prepend(element);\n return span;\n }, noop);\n\n willPrepend.unshift(p);\n }\n\n span.append(': ');\n // console.log(sender, senderBold.innerText);\n }\n\n const withoutMediaType = !!mediaContainer && !!(lastMessage as Message.message)?.message;\n\n let fragment: DocumentFragment;\n if(highlightWord && (lastMessage as Message.message).message) {\n fragment = await middleware(wrapMessageForReply({message: lastMessage, highlightWord, withoutMediaType}));\n } else if(draftMessage) {\n fragment = await middleware(wrapMessageForReply({message: draftMessage}));\n } else if(lastMessage) {\n fragment = await middleware(wrapMessageForReply({message: lastMessage, withoutMediaType}));\n } else { // rare case\n fragment = document.createDocumentFragment();\n }\n\n if(willPrepend.length) {\n const elements = await middleware(Promise.all(willPrepend));\n fragment.prepend(...elements);\n }\n\n replaceContent(dom.lastMessageSpan, fragment);\n }\n\n if(lastMessage || draftMessage/* && lastMessage._ !== 'draftMessage' */) {\n const date = draftMessage ? Math.max(draftMessage.date, lastMessage.date || 0) : lastMessage.date;\n replaceContent(dom.lastTimeSpan, formatDateAccordingToTodayNew(new Date(date * 1000)));\n } else dom.lastTimeSpan.textContent = '';\n\n if(isSearch) {\n dom.listEl.dataset.mid = '' + lastMessage.mid;\n\n const replyTo = lastMessage.reply_to;\n if(replyTo?.pFlags?.forum_topic) {\n dom.listEl.dataset.threadId = '' + getMessageThreadId(lastMessage);\n }\n }\n\n promise.resolve();\n }\n\n public setUnreadMessagesN(options: Parameters[0]) {\n return this.setUnreadMessages(options).catch(() => {});\n }\n\n private async setUnreadMessages({\n dialog,\n dialogElement,\n isBatch = false,\n setLastMessagePromise\n }: {\n dialog: Dialog | ForumTopic,\n dialogElement: DialogElement,\n isBatch?: boolean,\n setLastMessagePromise?: Promise\n }) {\n const {dom} = dialogElement;\n if(!dom) {\n // this.log.error('setUnreadMessages no dom!', dialog);\n return;\n }\n\n const isTopic = dialog._ === 'forumTopic';\n\n const {deferred, middleware} = setPromiseMiddleware(dom, 'setUnreadMessagePromise');\n\n const {peerId} = dialog;\n const promises = Promise.all([\n this.managers.appNotificationsManager.isPeerLocalMuted({peerId: peerId, respectType: true, threadId: isTopic ? dialog.id : undefined}),\n dialog.draft?._ !== 'draftMessage' ? this.managers.appMessagesManager.getMessageByPeer(peerId, dialog.top_message) : undefined,\n isTopic ? !!dialog.pFlags.pinned : this.managers.dialogsStorage.isDialogPinned(peerId, this.filterId),\n this.managers.appMessagesManager.isDialogUnread(dialog),\n peerId.isAnyChat() && !isTopic ? this.managers.acknowledged.dialogsStorage.getForumUnreadCount(peerId).then((result) => {\n if(result.cached) {\n return result.result;\n } else {\n result.result.then(() => {\n this.setUnreadMessagesN({dialog, dialogElement});\n });\n\n return {count: 0, hasUnmuted: false};\n }\n }).catch(() => undefined as {count: number, hasUnmuted: boolean}) : undefined\n ]);\n\n let [isMuted, lastMessage, isPinned, isDialogUnread, forumUnreadCount] = await middleware(promises);\n const wasMuted = dom.listEl.classList.contains('is-muted');\n\n const {count: unreadTopicsCount, hasUnmuted: hasUnmutedTopic} = forumUnreadCount || {};\n\n let setStatusMessage: MyMessage;\n if(lastMessage && lastMessage.pFlags.out && lastMessage.peerId !== rootScope.myId) {\n setStatusMessage = lastMessage;\n }\n\n const unreadCount = unreadTopicsCount ?? dialog.unread_count;\n if(unreadTopicsCount !== undefined) {\n isDialogUnread = !!unreadCount;\n }\n\n if(isTopic && !isDialogUnread) {\n isDialogUnread = !getServerMessageId(dialog.read_inbox_max_id);\n }\n\n const hasUnreadBadge = isPinned || isDialogUnread;\n const hasUnreadAvatarBadge = this.xd !== this.xds[FOLDER_ID_ARCHIVE] && !isTopic && !!this.forumTab && this.xd.getDialogElement(peerId) === dialogElement && isDialogUnread;\n // dom.messageEl.classList.toggle('has-badge', hasBadge);\n\n // * have to await all promises before modifying something\n\n if(setLastMessagePromise) {\n try {\n await middleware(setLastMessagePromise);\n } catch(err) {\n return;\n }\n }\n\n const transitionDuration = isBatch ? 0 : BADGE_TRANSITION_TIME;\n\n dom.listEl.classList.toggle('no-unmuted-topic', !isMuted && hasUnmutedTopic !== undefined && !hasUnmutedTopic);\n\n if(isMuted !== wasMuted) {\n SetTransition({\n element: dom.listEl,\n className: 'is-muted',\n forwards: isMuted,\n duration: transitionDuration\n });\n }\n\n setSendingStatus(dom.statusSpan, isTopic && dialog.pFlags.closed ? 'premium_lock' : setStatusMessage, true);\n\n // if(isTopic) {\n // dom.statusSpan.parentElement.classList.toggle('is-closed', !!dialog.pFlags.closed);\n // }\n\n const isUnreadBadgeMounted = !!dom.unreadBadge;\n if(hasUnreadBadge) {\n dialogElement.createUnreadBadge();\n }\n\n const isUnreadAvatarBadgeMounted = !!dom.unreadAvatarBadge;\n if(hasUnreadAvatarBadge) {\n dialogElement.createUnreadAvatarBadge();\n }\n\n const hasMentionsBadge = dialog.unread_mentions_count && (dialog.unread_mentions_count > 1 || dialog.unread_count > 1);\n const isMentionsBadgeMounted = !!dom.mentionsBadge;\n if(hasMentionsBadge) {\n dialogElement.createMentionsBadge();\n }\n\n const a: [Parameters[0], boolean, boolean][] = [\n ['unreadBadge', hasUnreadBadge, isUnreadBadgeMounted],\n ['unreadAvatarBadge', hasUnreadAvatarBadge, isUnreadAvatarBadgeMounted],\n ['mentionsBadge', hasMentionsBadge, isMentionsBadgeMounted]\n ];\n\n a.forEach(([key, hasBadge, isBadgeMounted]) => {\n const badge = dom[key];\n if(!badge) {\n return;\n }\n\n dialogElement.toggleBadgeByKey(key, hasBadge, isBadgeMounted, isBatch);\n });\n\n if(!hasUnreadBadge) {\n deferred.resolve();\n return;\n }\n\n if(isPinned) {\n dom.unreadBadge.classList.add('tgico-chatspinned', 'tgico');\n } else if(dom.unreadBadge) {\n dom.unreadBadge.classList.remove('tgico-chatspinned', 'tgico');\n }\n\n let isUnread = true, isMention = false, unreadBadgeText: string;\n if(dialog.unread_mentions_count && unreadCount === 1) {\n unreadBadgeText = '@';\n isMention = true;\n // dom.unreadBadge.classList.add('tgico-mention', 'tgico');\n } else if(isDialogUnread) {\n // dom.unreadMessagesSpan.innerText = '' + (unreadCount ? formatNumber(unreadCount, 1) : ' ');\n unreadBadgeText = '' + (unreadCount ? formatNumber(unreadCount, 1) : ' ');\n } else {\n unreadBadgeText = '';\n isUnread = false;\n }\n\n if(isTopic) {\n const notVisited = isDialogUnread && unreadBadgeText === ' ';\n dom.unreadBadge.classList.toggle('not-visited', notVisited);\n }\n\n const b: Array<[HTMLElement, string]> = [\n [dom.unreadBadge, unreadBadgeText],\n [dom.unreadAvatarBadge, unreadBadgeText || undefined]\n ];\n\n b.filter(Boolean).forEach(([badge, text]) => {\n if(text !== undefined) {\n badge.innerText = unreadBadgeText;\n }\n\n badge.classList.toggle('unread', isUnread);\n badge.classList.toggle('mention', isMention);\n });\n\n deferred.resolve();\n }\n\n private async getDialog(dialog: Dialog | ForumTopic | PeerId, threadId?: number) {\n if(typeof(dialog) !== 'object') {\n let originalDialog: Dialog | ForumTopic;\n if(threadId) {\n originalDialog = await this.managers.dialogsStorage.getForumTopic(dialog, threadId);\n if(!originalDialog) {\n const peerId = dialog || NULL_PEER_ID;\n return {\n peerId,\n pFlags: {}\n } as any as ForumTopic;\n }\n } else {\n originalDialog = await this.managers.appMessagesManager.getDialogOnly(dialog);\n if(!originalDialog) {\n const peerId = dialog || NULL_PEER_ID;\n return {\n peerId,\n peer: await this.managers.appPeersManager.getOutputPeer(peerId),\n pFlags: {}\n } as any as Dialog;\n }\n }\n\n return originalDialog;\n }\n\n return dialog as Dialog | ForumTopic;\n }\n\n public addListDialog(options: Parameters[0] & {isBatch?: boolean}) {\n options.autonomous = false;\n\n const ret = this.addDialogNew(options);\n\n if(ret) {\n const {peerId} = options;\n const getDialogPromise = this.getDialog(peerId, options.threadId);\n const promise = getDialogPromise.then((dialog) => {\n const promises: Promise[] = [];\n const isUser = peerId.isUser();\n if(!isUser && dialog._ === 'dialog') {\n promises.push(this.xd.processDialogForCallStatus(peerId, ret.dom));\n }\n\n if(peerId !== rootScope.myId && isUser) {\n promises.push(this.managers.appUsersManager.getUserStatus(peerId.toUserId()).then((status) => {\n if(status?._ === 'userStatusOnline') {\n this.xd.setOnlineStatus(ret.dom.avatarEl, true);\n }\n }));\n }\n\n promises.push(this.setLastMessageN({\n dialog,\n dialogElement: ret,\n isBatch: options.isBatch,\n setUnread: true\n }));\n\n return Promise.all(promises);\n });\n\n options.loadPromises?.push(promise);\n }\n\n return ret;\n }\n\n /**\n * use for rendering search result\n */\n public addDialogAndSetLastMessage(options: Omit[0], 'dialog'> & {\n message: MyMessage,\n peerId: PeerId,\n query?: string\n }) {\n const {peerId, message, query} = options;\n const ret = this.addDialogNew({\n ...options,\n ...getMessageSenderPeerIdOrName(message),\n peerId\n });\n\n this.setLastMessageN({\n dialog: {_: 'dialog', peerId} as any,\n lastMessage: message,\n dialogElement: ret,\n highlightWord: query\n });\n\n if(message.peerId !== peerId) {\n ret.dom.listEl.dataset.peerId = '' + message.peerId;\n }\n\n return ret;\n }\n\n public addDialogNew(options: DialogElementOptions & {container?: HTMLElement | Scrollable | false, append?: boolean}) {\n const d = new DialogElement({\n autonomous: !!options.container,\n avatarSize: 'bigger',\n ...options\n // avatarSize: !options.avatarSize || options.avatarSize >= 54 ? 'bigger' : 'abitbigger',\n });\n\n if(options.container) {\n const method = !options.append ? 'append' : 'prepend';\n options.container[method](d.container);\n }\n\n return d;\n // return this.addDialog(options.peerId, options.container, options.rippleEnabled, options.onlyFirstName, options.meAsSaved, options.append, options.avatarSize, options.autonomous, options.lazyLoadQueue, options.loadPromises, options.fromName, options.noIcons);\n }\n}\n\nconst appDialogsManager = new AppDialogsManager();\nMOUNT_CLASS_TO.appDialogsManager = appDialogsManager;\nexport default appDialogsManager;\n","export default function getUnsafeRandomInt(min: number, max: number) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {DownloadMediaOptions, DownloadOptions} from '../mtproto/apiFileManager';\nimport type {AppMessagesManager} from './appMessagesManager';\nimport type {MyDocument} from './appDocsManager';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport {InputFile, Photo, PhotoSize} from '../../layer';\nimport getFileNameForUpload from '../../helpers/getFileNameForUpload';\nimport {AppManagers} from './managers';\nimport rootScope from '../rootScope';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport noop from '../../helpers/noop';\nimport getDownloadMediaDetails from './utils/download/getDownloadMediaDetails';\nimport getDownloadFileNameFromOptions from './utils/download/getDownloadFileNameFromOptions';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport makeError from '../../helpers/makeError';\nimport createDownloadAnchor from '../../helpers/dom/createDownloadAnchor';\nimport {getFileNameByLocation} from '../../helpers/fileName';\nimport getDocumentDownloadOptions from './utils/docs/getDocumentDownloadOptions';\nimport getPhotoDownloadOptions from './utils/photos/getPhotoDownloadOptions';\nimport apiManagerProxy from '../mtproto/mtprotoworker';\n\nexport type ResponseMethodBlob = 'blob';\nexport type ResponseMethodJson = 'json';\nexport type ResponseMethod = ResponseMethodBlob | ResponseMethodJson;\n\n/* export type DownloadBlob = {promise: Promise, controller: AbortController};\nexport type DownloadJson = {promise: Promise, controller: AbortController}; */\nexport type DownloadBlob = CancellablePromise;\nexport type DownloadUrl = CancellablePromise;\nexport type DownloadJson = CancellablePromise;\n// export type Download = DownloadBlob/* | DownloadJson */;\nexport type Download = DownloadBlob | DownloadUrl/* | DownloadJson */;\n\nexport type Progress = {done: number, fileName: string, total: number, offset: number};\nexport type ProgressCallback = (details: Progress) => void;\n\ntype DownloadType = 'url' | 'blob' | 'void' | 'disc';\n\nexport class AppDownloadManager {\n private downloads: {[fileName: string]: {main: Download} & {[type in DownloadType]?: Download}} = {};\n // private downloadsToDisc: {[fileName: string]: Download} = {};\n private progress: {[fileName: string]: Progress} = {};\n // private progressCallbacks: {[fileName: string]: Array} = {};\n private managers: AppManagers;\n\n public construct(managers: AppManagers) {\n this.managers = managers;\n rootScope.addEventListener('download_progress', (details) => {\n // const callbacks = this.progressCallbacks[details.fileName];\n // if(callbacks) {\n // callbacks.forEach((callback) => callback(details));\n // }\n\n const download = this.downloads[details.fileName];\n if(download?.main?.notifyAll) {\n this.progress[details.fileName] = details;\n download.main.notifyAll(details);\n }\n });\n }\n\n private getNewDeferred(fileName: string, type?: DownloadType) {\n const deferred = deferredPromise();\n\n let download = this.downloads[fileName];\n if(!download) {\n download = this.downloads[fileName] = {\n main: deferred as any\n };\n\n deferred.cancel = () => {\n const error = makeError('DOWNLOAD_CANCELED');\n\n this.managers.apiFileManager.cancelDownload(fileName);\n\n deferred.reject(error);\n deferred.cancel = noop;\n };\n\n deferred.catch(() => {\n this.clearDownload(fileName, type);\n }).finally(() => {\n delete this.progress[fileName];\n // delete this.progressCallbacks[fileName];\n });\n } else {\n const main = download.main;\n (['cancel', 'addNotifyListener', 'notify', 'notifyAll'] as (keyof CancellablePromise)[]).forEach((key) => {\n if(!main[key]) {\n return;\n }\n\n // @ts-ignore\n deferred[key] = main[key].bind(main);\n });\n }\n\n const haveToClear = type === 'disc';\n if(haveToClear) {\n deferred.catch(noop).finally(() => {\n this.clearDownload(fileName, type);\n });\n }\n\n return download[type] = deferred as any;\n }\n\n public getNewDeferredForUpload>(fileName: string, promise: T) {\n const deferred = this.getNewDeferred(fileName);\n promise.then(deferred.resolve, deferred.reject);\n\n deferred.finally(() => {\n this.clearDownload(fileName);\n });\n\n return deferred as CancellablePromise>;\n }\n\n private clearDownload(fileName: string, type?: DownloadType) {\n const downloads = this.downloads[fileName];\n if(!downloads) {\n return;\n }\n\n delete downloads[type];\n\n const length = Object.keys(downloads).length;\n if(!length || (downloads.main && length === 1)) {\n delete this.downloads[fileName];\n }\n }\n\n public getUpload(fileName: string): ReturnType['promise'] {\n let deferred: CancellablePromise = this.getDownload(fileName);\n if(deferred) {\n return deferred;\n }\n\n deferred = this.getNewDeferred(fileName);\n this.managers.appMessagesManager.getUploadPromise(fileName).then(deferred.resolve, deferred.reject);\n return deferred;\n }\n\n /* public fakeDownload(fileName: string, value: Blob | string) {\n const deferred = this.getNewDeferred(fileName);\n if(typeof(value) === 'string') {\n fetch(value)\n .then((response) => response.blob())\n .then((blob) => deferred.resolve(blob));\n } else {\n deferred.resolve(value);\n }\n\n return deferred;\n } */\n\n private d(fileName: string, getPromise: () => Promise, type?: DownloadType) {\n let deferred = this.getDownload(fileName, type);\n if(deferred) return deferred;\n\n deferred = this.getNewDeferred(fileName, type);\n getPromise().then(deferred.resolve, deferred.reject);\n return deferred;\n }\n\n public download(options: DownloadOptions): DownloadBlob {\n const fileName = getDownloadFileNameFromOptions(options);\n return this.d(fileName, () => this.managers.apiFileManager.download(options), 'blob') as any;\n }\n\n public downloadMedia(options: DownloadMediaOptions, type: DownloadType = 'blob', promiseBefore?: Promise): DownloadBlob {\n const {downloadOptions, fileName} = getDownloadMediaDetails(options);\n\n return this.d(fileName, () => {\n let cb: any;\n if(type === 'url') {\n cb = this.managers.apiFileManager.downloadMediaURL;\n } else if(type === 'void'/* || type === 'disc' */) {\n cb = this.managers.apiFileManager.downloadMediaVoid;\n } else /* if(type === 'blob') */ {\n cb = this.managers.apiFileManager.downloadMedia;\n }\n\n if(promiseBefore) {\n return promiseBefore.then(() => cb(options));\n }\n\n return cb(options);\n }, type) as any;\n }\n\n public downloadMediaURL(options: DownloadMediaOptions): DownloadUrl {\n return this.downloadMedia(options, 'url') as any;\n }\n\n public downloadMediaVoid(options: DownloadMediaOptions): DownloadBlob {\n return this.downloadMedia(options, 'void');\n }\n\n public upload(file: File | Blob, fileName?: string, promise?: Promise) {\n if(!fileName) {\n fileName = getFileNameForUpload(file);\n }\n\n if(!promise) {\n promise = this.managers.apiFileManager.upload({file, fileName});\n }\n\n const deferred = this.getNewDeferredForUpload(fileName, promise);\n return deferred as any as CancellablePromise;\n }\n\n public getDownload(fileName: string, type?: DownloadType) {\n const d = this.downloads[fileName];\n return d && d[type];\n }\n\n // public addProgressCallback(fileName: string, callback: ProgressCallback) {\n // const progress = this.progress[fileName];\n // (this.progressCallbacks[fileName] ?? (this.progressCallbacks[fileName] = [])).push(callback);\n\n // if(progress) {\n // callback(progress);\n // }\n // }\n\n public downloadToDisc(options: DownloadMediaOptions, justAttach?: boolean) {\n const media = options.media;\n const isDocument = media._ === 'document';\n if(!isDocument && !options.thumb) {\n options.thumb = (media as Photo.photo).sizes.slice().pop() as PhotoSize.photoSize;\n }\n\n // const {fileName: cacheFileName} = getDownloadMediaDetails(options);\n // if(justAttach) {\n // const promise = this.downloadsToDisc[cacheFileName];\n // if(promise) {\n // return promise;\n // }\n // }\n\n // const {downloadOptions, fileName} = getDownloadMediaDetails(options);\n // if(downloadOptions.size && downloadOptions.size > MAX_FILE_SAVE_SIZE) {\n const id = '' + (Math.random() * 0x7FFFFFFF | 0);\n // const id = 'test';\n const url = `download/${id}`;\n options.downloadId = id;\n\n const pingPromise = apiManagerProxy.pingServiceWorkerWithIframe();\n\n const promise = this.downloadMedia(options, 'disc', pingPromise);\n // this.downloadsToDisc[cacheFileName] = promise;\n\n if(justAttach) {\n return promise;\n }\n\n const iframe = document.createElement('iframe');\n iframe.hidden = true;\n\n pingPromise.then(() => {\n iframe.src = url;\n document.body.append(iframe);\n });\n\n // createDownloadAnchor(url, 'asd.txt');\n\n // const events = [\n // 'emptied',\n // 'abort',\n // 'suspend',\n // 'reset',\n // 'error',\n // 'ended',\n // 'load'\n // ].forEach((event) => {\n // iframe.addEventListener(event, () => alert(event));\n // iframe.contentWindow.addEventListener(event, () => alert(event));\n // });\n\n let element: HTMLElement, hadProgress = false;\n const onProgress = () => {\n if(hadProgress) {\n return;\n }\n\n hadProgress = true;\n element = iframe;\n\n indexOfAndSplice(promise.listeners, onProgress);\n };\n\n promise.addNotifyListener(onProgress);\n promise.then((blob) => {\n if(!blob) {\n return;\n }\n\n const url = URL.createObjectURL(blob);\n const downloadOptions = isDocument ?\n getDocumentDownloadOptions(media) :\n getPhotoDownloadOptions(media as any, options.thumb as PhotoSize.photoSize);\n const fileName = (options.media as MyDocument).file_name || getFileNameByLocation(downloadOptions.location);\n createDownloadAnchor(url, downloadOptions.fileName || fileName, () => {\n URL.revokeObjectURL(url);\n });\n }).catch(noop).finally(() => {\n if(!hadProgress) {\n onProgress();\n }\n\n setTimeout(() => {\n element?.remove();\n }, 1000);\n\n // if(this.downloadsToDisc[cacheFileName] === promise) {\n // delete this.downloadsToDisc[cacheFileName];\n // }\n });\n\n return promise;\n }\n}\n\nconst appDownloadManager = new AppDownloadManager();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.appDownloadManager = appDownloadManager);\nexport default appDownloadManager;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function createDownloadAnchor(url: string, fileName: string, onRemove?: () => void) {\n const a = document.createElement('a');\n a.href = url;\n a.download = fileName;\n a.target = '_blank';\n\n a.style.position = 'absolute';\n a.style.top = '1px';\n a.style.left = '1px';\n\n document.body.append(a);\n\n try {\n const clickEvent = document.createEvent('MouseEvents');\n clickEvent.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n a.dispatchEvent(clickEvent);\n } catch(e) {\n console.error('Download click error', e);\n try {\n a.click();\n } catch(e) {\n window.open(url as string, '_blank');\n }\n }\n\n setTimeout(() => {\n a.remove();\n onRemove && onRemove();\n }, 100);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type Chat from './chat';\nimport type ChatTopbar from './topbar';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport DivAndCaption from '../divAndCaption';\nimport ripple from '../ripple';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport {Message} from '../../layer';\nimport safeAssign from '../../helpers/object/safeAssign';\n\nconst classNames: string[] = ['is-pinned-message-shown', 'is-pinned-audio-shown'];\nconst CLASSNAME_BASE = 'pinned-container';\nconst HEIGHT = 52;\n\nexport default class PinnedContainer {\n public wrapperUtils: HTMLElement;\n public btnClose: HTMLElement;\n protected wrapper: HTMLElement;\n\n protected topbar: ChatTopbar;\n protected chat: Chat;\n protected listenerSetter: ListenerSetter;\n public className: string;\n public divAndCaption: DivAndCaption<(title: string | HTMLElement | DocumentFragment, subtitle: string | HTMLElement | DocumentFragment, message?: any) => void>;\n\n protected floating = false;\n\n public onClose?: () => void | Promise;\n\n constructor(options: {\n topbar: PinnedContainer['topbar'],\n chat: PinnedContainer['chat'],\n listenerSetter: PinnedContainer['listenerSetter'],\n className: PinnedContainer['className'],\n divAndCaption: PinnedContainer['divAndCaption'],\n onClose?: PinnedContainer['onClose'],\n floating?: PinnedContainer['floating']\n }) {\n safeAssign(this, options);\n\n const {divAndCaption, className} = this;\n divAndCaption.container.classList.add(CLASSNAME_BASE, 'hide');\n divAndCaption.title.classList.add(CLASSNAME_BASE + '-title');\n divAndCaption.subtitle.classList.add(CLASSNAME_BASE + '-subtitle');\n divAndCaption.content.classList.add(CLASSNAME_BASE + '-content');\n\n this.btnClose = document.createElement('button');\n this.btnClose.classList.add(CLASSNAME_BASE + '-close', `pinned-${className}-close`, 'btn-icon', 'tgico-close');\n\n this.wrapper = document.createElement('div');\n this.wrapper.classList.add(CLASSNAME_BASE + '-wrapper');\n ripple(this.wrapper);\n\n this.wrapperUtils = document.createElement('div');\n this.wrapperUtils.classList.add(CLASSNAME_BASE + '-wrapper-utils');\n this.wrapperUtils.append(this.btnClose);\n\n this.wrapper.append(...Array.from(divAndCaption.container.children), this.wrapperUtils);\n\n divAndCaption.container.append(this.wrapper/* , this.close */);\n\n this.attachOnCloseEvent(this.btnClose);\n }\n\n public attachOnCloseEvent(elem: HTMLElement) {\n attachClickEvent(elem, (e) => {\n cancelEvent(e);\n\n ((this.onClose ? this.onClose() : null) || Promise.resolve(true)).then((needClose) => {\n if(needClose) {\n this.toggle(true);\n }\n });\n }, {listenerSetter: this.listenerSetter});\n }\n\n public toggle(hide?: boolean) {\n const isHidden = this.divAndCaption.container.classList.contains('hide');\n if(hide === undefined) {\n hide = !isHidden;\n } else if(hide === isHidden) {\n return;\n }\n\n // const scrollable = this.chat.bubbles.scrollable;\n\n const isFloating = (this.floating || mediaSizes.isMobile) && !hide;\n // const scrollTop = isFloating || this.divAndCaption.container.classList.contains('is-floating') ? scrollable.scrollTop : undefined;\n\n this.divAndCaption.container.classList.toggle('is-floating', isFloating);\n this.divAndCaption.container.classList.toggle('hide', hide);\n\n this.topbar.container.classList.toggle('is-pinned-floating', isFloating);\n this.topbar.container.classList.toggle(`is-pinned-${this.className}-shown`, !hide);\n\n // const active = classNames.filter((className) => this.topbar.container.classList.contains(className));\n // const maxActive = hide ? 0 : 1;\n\n // * not sure when it became unneeded\n // if(scrollTop !== undefined && active.length <= maxActive/* && !scrollable.isScrolledDown */) {\n // scrollable.scrollTop = scrollTop + ((hide ? -1 : 1) * HEIGHT);\n // }\n\n this.topbar.setFloating();\n this.topbar.setUtilsWidth();\n }\n\n public isVisible() {\n return !this.divAndCaption.container.classList.contains('hide');\n }\n\n public isFloating() {\n return this.divAndCaption.container.classList.contains('is-floating');\n }\n\n public fill(title: string | HTMLElement | DocumentFragment, subtitle: string | HTMLElement | DocumentFragment, message: Message.message) {\n this.divAndCaption.container.dataset.peerId = '' + message.peerId;\n this.divAndCaption.container.dataset.mid = '' + message.mid;\n this.divAndCaption.fill(title, subtitle, message);\n this.topbar.setUtilsWidth();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AppMessagesManager} from '../../lib/appManagers/appMessagesManager';\nimport type ChatTopbar from './topbar';\nimport rootScope from '../../lib/rootScope';\nimport appMediaPlaybackController, {AppMediaPlaybackController} from '../appMediaPlaybackController';\nimport DivAndCaption from '../divAndCaption';\nimport PinnedContainer from './pinnedContainer';\nimport Chat from './chat';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport PeerTitle from '../peerTitle';\nimport {i18n} from '../../lib/langPack';\nimport {formatFullSentTime} from '../../helpers/date';\nimport ButtonIcon from '../buttonIcon';\nimport {DocumentAttribute} from '../../layer';\nimport MediaProgressLine from '../mediaProgressLine';\nimport VolumeSelector from '../volumeSelector';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport {AppManagers} from '../../lib/appManagers/managers';\n\nexport default class ChatAudio extends PinnedContainer {\n private toggleEl: HTMLElement;\n private progressLine: MediaProgressLine;\n private volumeSelector: VolumeSelector;\n private fasterEl: HTMLElement;\n private repeatEl: HTMLButtonElement;\n\n constructor(protected topbar: ChatTopbar, protected chat: Chat, protected managers: AppManagers) {\n super({\n topbar,\n chat,\n listenerSetter: topbar.listenerSetter,\n className: 'audio',\n divAndCaption: new DivAndCaption(\n 'pinned-audio',\n (title: string | HTMLElement | DocumentFragment, subtitle: string | HTMLElement | DocumentFragment) => {\n replaceContent(this.divAndCaption.title, title);\n replaceContent(this.divAndCaption.subtitle, subtitle);\n }\n ),\n onClose: () => {\n appMediaPlaybackController.stop(undefined, true);\n },\n floating: true\n });\n\n this.divAndCaption.border.remove();\n\n const prevEl = ButtonIcon('fast_rewind active', {noRipple: true});\n const nextEl = ButtonIcon('fast_forward active', {noRipple: true});\n\n const attachClick = (elem: HTMLElement, callback: () => void) => {\n attachClickEvent(elem, (e) => {\n cancelEvent(e);\n callback();\n }, {listenerSetter: this.topbar.listenerSetter});\n };\n\n attachClick(prevEl, () => {\n appMediaPlaybackController.previous();\n });\n\n attachClick(nextEl, () => {\n appMediaPlaybackController.next();\n });\n\n this.toggleEl = ButtonIcon('', {noRipple: true});\n this.toggleEl.classList.add('active', 'pinned-audio-ico', 'tgico');\n attachClick(this.toggleEl, () => {\n appMediaPlaybackController.toggle();\n });\n this.wrapper.prepend(this.wrapper.firstElementChild, prevEl, this.toggleEl, nextEl);\n\n this.volumeSelector = new VolumeSelector(this.listenerSetter, true);\n const volumeProgressLineContainer = document.createElement('div');\n volumeProgressLineContainer.classList.add('progress-line-container');\n volumeProgressLineContainer.append(this.volumeSelector.container);\n const tunnel = document.createElement('div');\n tunnel.classList.add('pinned-audio-volume-tunnel');\n this.volumeSelector.btn.classList.add('pinned-audio-volume', 'active');\n this.volumeSelector.btn.prepend(tunnel);\n this.volumeSelector.btn.append(volumeProgressLineContainer);\n\n this.repeatEl = ButtonIcon('audio_repeat', {noRipple: true});\n attachClick(this.repeatEl, () => {\n const params = appMediaPlaybackController.getPlaybackParams();\n if(!params.round) {\n appMediaPlaybackController.round = true;\n } else if(params.loop) {\n appMediaPlaybackController.round = false;\n appMediaPlaybackController.loop = false;\n } else {\n appMediaPlaybackController.loop = !appMediaPlaybackController.loop;\n }\n });\n\n const fasterEl = this.fasterEl = ButtonIcon('playback_2x', {noRipple: true});\n attachClick(fasterEl, () => {\n appMediaPlaybackController.playbackRate = fasterEl.classList.contains('active') ? 1 : 1.75;\n });\n\n this.wrapperUtils.prepend(this.volumeSelector.btn, fasterEl, this.repeatEl);\n\n const progressWrapper = document.createElement('div');\n progressWrapper.classList.add('pinned-audio-progress-wrapper');\n\n this.progressLine = new MediaProgressLine({\n withTransition: true,\n useTransform: true\n });\n this.progressLine.container.classList.add('pinned-audio-progress');\n progressWrapper.append(this.progressLine.container);\n this.wrapper.insertBefore(progressWrapper, this.wrapperUtils);\n\n this.topbar.listenerSetter.add(appMediaPlaybackController)('play', this.onMediaPlay);\n this.topbar.listenerSetter.add(appMediaPlaybackController)('pause', this.onPause);\n this.topbar.listenerSetter.add(appMediaPlaybackController)('stop', this.onStop);\n this.topbar.listenerSetter.add(appMediaPlaybackController)('playbackParams', this.onPlaybackParams);\n\n const playingDetails = appMediaPlaybackController.getPlayingDetails();\n if(playingDetails) {\n this.onMediaPlay(playingDetails);\n this.onPlaybackParams(playingDetails.playbackParams);\n }\n }\n\n public destroy() {\n if(this.progressLine) {\n this.progressLine.removeListeners();\n }\n }\n\n private onPlaybackParams = (playbackParams: ReturnType) => {\n this.fasterEl.classList.toggle('active', playbackParams.playbackRate > 1);\n\n this.repeatEl.classList.remove('tgico-audio_repeat', 'tgico-audio_repeat_single');\n this.repeatEl.classList.add(playbackParams.loop ? 'tgico-audio_repeat_single' : 'tgico-audio_repeat');\n this.repeatEl.classList.toggle('active', playbackParams.loop || playbackParams.round);\n };\n\n private onPause = () => {\n this.toggleEl.classList.remove('flip-icon');\n };\n\n private onStop = () => {\n this.toggle(true);\n };\n\n private onMediaPlay = ({doc, message, media, playbackParams}: ReturnType) => {\n let title: string | HTMLElement | DocumentFragment, subtitle: string | HTMLElement | DocumentFragment;\n const isMusic = doc.type !== 'voice' && doc.type !== 'round';\n if(!isMusic) {\n title = new PeerTitle({peerId: message.fromId, fromName: message.fwd_from?.from_name}).element;\n\n // subtitle = 'Voice message';\n subtitle = formatFullSentTime(message.date);\n } else {\n const audioAttribute = doc.attributes.find((attr) => attr._ === 'documentAttributeAudio') as DocumentAttribute.documentAttributeAudio;\n title = wrapEmojiText(audioAttribute?.title ?? doc.file_name);\n subtitle = audioAttribute?.performer ? wrapEmojiText(audioAttribute.performer) : i18n('AudioUnknownArtist');\n }\n\n this.fasterEl.classList.toggle('hide', isMusic);\n this.repeatEl.classList.toggle('hide', !isMusic);\n\n this.onPlaybackParams(playbackParams);\n this.volumeSelector.setVolume();\n\n this.progressLine.setMedia({\n media,\n duration: doc.duration\n });\n\n this.fill(title, subtitle, message);\n // this.toggleEl.classList.add('flip-icon');\n this.toggleEl.classList.toggle('flip-icon', !media.paused);\n this.toggle(false);\n };\n}\n","// https://github.com/evgeny-nadymov/telegram-react/blob/master/src/Components/ColumnMiddle/PinnedMessageBorder.js\n\nenum BAR_HEIGHTS {\n ONE = 32,\n TWO = 15,\n THREE = 10,\n FOUR = 8,\n MORE = 8\n};\n\nconst GAP = 1;\nconst WIDTH = 2;\nconst BASE_CLASS = 'pinned-message-border';\n\nexport default class PinnedMessageBorder {\n private border: HTMLElement;\n private wrapper: HTMLElement;\n private svg: SVGSVGElement;\n private defs: SVGDefsElement;\n private clipPath: SVGClipPathElement;\n private path: SVGPathElement;\n private mark: HTMLElement;\n\n private count: number;\n private index: number;\n\n private drawRect = (x: number, y: number, width: number, height: number, radius: number) => {\n return `M${x},${y + radius}a${radius},${radius},0,0,1,${width},0v${height - 2 * radius}a${radius},${radius},0,0,1,${-width},0Z`;\n };\n\n private getClipPath = (id: string, barHeight: number, count: number) => {\n const radius = 1;\n\n let d = '';\n /* if(count === 3) {\n d = this.drawRect(0, 0, WIDTH, barHeight, radius)\n + this.drawRect(0, barHeight + GAP, WIDTH, barHeight + 1, radius)\n + this.drawRect(0, barHeight * 2 + GAP * 2 + 1, WIDTH, barHeight, radius);\n } */if(count === 2) {\n d = this.drawRect(0, 0, WIDTH, barHeight, radius) + this.drawRect(0, barHeight + GAP * 2, WIDTH, barHeight, radius);\n } else {\n for(let i = 0; i < count; ++i) {\n d += this.drawRect(0, (barHeight + GAP) * i, WIDTH, barHeight, radius);\n }\n }\n\n if(!this.clipPath) {\n this.clipPath = document.createElementNS('http://www.w3.org/2000/svg', 'clipPath');\n this.path = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n\n this.clipPath.append(this.path);\n }\n\n this.clipPath.id = id;\n this.path.setAttributeNS(null, 'd', d);\n\n return this.clipPath;\n };\n\n private getBarHeight = (count: number, index: number) => {\n let barHeight: number;\n if(count <= 1) {\n barHeight = BAR_HEIGHTS.ONE;\n } else if(count === 2) {\n barHeight = BAR_HEIGHTS.TWO;\n } else if(count === 3) {\n barHeight = BAR_HEIGHTS.THREE;\n } else if(count === 4) {\n barHeight = BAR_HEIGHTS.FOUR;\n } else if(count > 3) {\n barHeight = BAR_HEIGHTS.MORE;\n }\n\n return barHeight;\n };\n\n private getMarkHeight = (count: number, index: number) => {\n let markHeight: number;\n if(count <= 1) {\n markHeight = BAR_HEIGHTS.ONE;\n } else if(count === 2) {\n markHeight = BAR_HEIGHTS.TWO;\n } else if(count === 3) {\n markHeight = BAR_HEIGHTS.THREE;\n } else if(count === 4) {\n markHeight = BAR_HEIGHTS.FOUR;\n } else if(count > 3) {\n markHeight = BAR_HEIGHTS.MORE;\n }\n\n return markHeight;\n };\n\n private getMarkTranslateY = (index: number, barHeight: number, count: number) => {\n if(count === 1) {\n return 0;\n } else if(count === 2) {\n return !index ? 0 : barHeight + GAP;\n }\n\n if(count === 3) {\n if(!index) {\n return 0;\n } else if(index === 1) {\n return barHeight + GAP;\n }\n\n return barHeight * 2 + GAP * 2 + 1;\n } else {\n return (barHeight + GAP) * index;\n }\n };\n\n private getTrackTranslateY = (index: number, count: number, barHeight: number, trackHeight: number) => {\n if(count <= 4) {\n return 0;\n }\n\n if(index <= 1) {\n return 0;\n } else if(index >= (count - 2)) {\n return trackHeight - BAR_HEIGHTS.ONE - barHeight;\n }\n\n // return (index + 1) * barHeight + index * GAP;\n return (index - 2) * barHeight + index * GAP;\n // return (barHeight + GAP * 2) / 2 + (index - 2) * (barHeight + GAP);\n };\n\n private getTrackHeight = (count: number, barHeight: number) => {\n return count <= 3 ? BAR_HEIGHTS.ONE : barHeight * count + GAP * (count - 1);\n };\n\n public render(count: number, index: number) {\n if(!this.border) {\n this.border = document.createElement('div');\n this.border.classList.add(BASE_CLASS);\n\n this.wrapper = document.createElement('div');\n this.border.append(this.wrapper);\n }\n\n if(count === 1) {\n if(this.count !== count) {\n this.wrapper.className = BASE_CLASS + '-wrapper-1';\n this.border.classList.remove(BASE_CLASS + '-mask');\n this.wrapper.innerHTML = this.wrapper.style.cssText = '';\n }\n\n return this.border;\n }\n\n const barHeight = this.getBarHeight(count, index);\n const markHeight = this.getMarkHeight(count, index);\n const trackHeight = this.getTrackHeight(count, barHeight);\n\n const clipPathId = `clipPath_${count}`;\n const clipPath = this.getClipPath(clipPathId, barHeight, count);\n\n const markTranslateY = this.getMarkTranslateY(index, barHeight, count);\n const trackTranslateY = this.getTrackTranslateY(index, count, barHeight, trackHeight);\n\n this.border.classList.toggle(BASE_CLASS + '-mask', count > 4);\n\n if(index <= 1) {\n this.border.classList.add('mask-bottom');\n this.border.classList.remove('mask-top');\n } else if(index >= (count - 2)) {\n this.border.classList.add('mask-top');\n this.border.classList.remove('mask-bottom');\n } else {\n this.border.classList.add('mask-top', 'mask-bottom');\n }\n\n this.wrapper.className = BASE_CLASS + '-wrapper';\n this.wrapper.style.cssText = `clip-path: url(#${clipPathId}); width: 2px; height: ${trackHeight}px; transform: translateY(-${trackTranslateY}px);`;\n\n if(!this.svg) {\n this.svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n this.svg.setAttributeNS(null, 'height', '0');\n this.svg.setAttributeNS(null, 'width', '0');\n\n this.defs = document.createElementNS('http://www.w3.org/2000/svg', 'defs');\n this.defs.append(clipPath);\n\n this.svg.append(this.defs);\n\n this.mark = document.createElement('div');\n this.mark.classList.add(BASE_CLASS + '-mark');\n }\n\n if(!this.svg.parentElement) {\n this.wrapper.append(this.svg, this.mark);\n }\n\n this.mark.style.cssText = `height: ${markHeight}px; transform: translateY(${markTranslateY}px);`;\n\n this.count = count;\n this.index = index;\n\n return this.border;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ChatTopbar from './topbar';\nimport PopupPinMessage from '../popups/unpinMessage';\nimport PinnedContainer from './pinnedContainer';\nimport PinnedMessageBorder from './pinnedMessageBorder';\nimport ReplyContainer, {wrapReplyDivAndCaption} from './replyContainer';\nimport rootScope from '../../lib/rootScope';\nimport Chat from './chat';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport ButtonIcon from '../buttonIcon';\nimport {getHeavyAnimationPromise} from '../../hooks/useHeavyAnimationCheck';\nimport {i18n} from '../../lib/langPack';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport handleScrollSideEvent from '../../helpers/dom/handleScrollSideEvent';\nimport debounce from '../../helpers/schedulers/debounce';\nimport throttle from '../../helpers/schedulers/throttle';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport {Message} from '../../layer';\nimport {logger} from '../../lib/logger';\nimport PopupElement from '../popups';\n\nclass AnimatedSuper {\n static DURATION = 200;\n static BASE_CLASS = 'animated-super';\n container: HTMLDivElement;\n rows: {[index: string]: {element: HTMLElement, timeout?: number, new?: true}} = {};\n clearTimeout: number;\n\n constructor() {\n this.container = document.createElement('div');\n this.container.className = AnimatedSuper.BASE_CLASS;\n }\n\n public getRow(index: number, animateFirst = false) {\n if(this.rows[index]) return this.rows[index].element;\n const row = document.createElement('div');\n const isFirst = !Object.keys(this.rows).length && !animateFirst;\n row.className = AnimatedSuper.BASE_CLASS + '-row' + (isFirst ? '' : ' is-hiding hide');\n this.rows[index] = {element: row, new: true};\n this.container.append(row);\n return row;\n }\n\n public clearRow(index: number) {\n if(!this.rows[index]) return;\n this.rows[index].element.remove();\n delete this.rows[index];\n }\n\n public clearRows(currentIndex?: number) {\n if(this.clearTimeout) clearTimeout(this.clearTimeout);\n this.clearTimeout = window.setTimeout(() => {\n for(const i in this.rows) {\n if(+i === currentIndex) continue;\n this.clearRow(+i);\n }\n }, AnimatedSuper.DURATION);\n }\n\n public setNewRow(index: number, reflow = false) {\n const row = this.rows[index];\n if(row.new) {\n if(reflow) {\n row.element.classList.remove('hide');\n void row.element.offsetLeft; // reflow\n } else {\n row.element.classList.remove('is-hiding', 'hide');\n }\n\n delete row.new;\n }\n\n this.clearRows(index);\n }\n\n public animate(index: number, previousIndex: number, fromTop = index > previousIndex, ignorePrevious = false) {\n if(index === previousIndex) { // * handle if set index 0 and previousIndex 0\n return this.setNewRow(index);\n }\n\n const row = this.rows[index];\n const previousRow = this.rows[previousIndex];\n if(!previousRow && !ignorePrevious) {\n return this.setNewRow(index);\n }\n\n const sides = ['from-top', 'from-bottom'];\n if(!fromTop) sides.reverse();\n\n row.element.classList.add(sides[0]);\n row.element.classList.remove(sides[1]);\n if(previousRow) {\n previousRow.element.classList.add(sides[1]);\n previousRow.element.classList.remove(sides[0]);\n }\n\n if(row.new) {\n this.setNewRow(index, true);\n }\n\n row.element.classList.toggle('is-hiding', false);\n previousRow && previousRow.element.classList.toggle('is-hiding', true);\n\n /* const height = row.element.getBoundingClientRect().height;\n row.element.style.transform = `translateY(${fromTop ? height * -1 : height}px)`;\n if(previousRow) {\n previousRow.element.style.transform = `translateY(${fromTop ? height : height * -1}px)`;\n } */\n\n /* row.element.style.setProperty('--height', row.element.getBoundingClientRect().height + 'px');\n if(previousRow) {\n previousRow.element.style.setProperty('--height', previousRow.element.getBoundingClientRect().height + 'px');\n } */\n\n this.clearRows(index);\n }\n}\n\nclass AnimatedCounter {\n static EMPTY_INDEX = -1;\n static BASE_CLASS = 'animated-counter';\n container: HTMLElement;\n decimals: {\n container: HTMLElement,\n placeholder: HTMLElement,\n animatedSuper: AnimatedSuper\n }[] = [];\n previousNumber = 0;\n clearTimeout: number;\n\n constructor(private reverse = false) {\n this.container = document.createElement('div');\n this.container.className = AnimatedCounter.BASE_CLASS;\n }\n\n getDecimal(index: number) {\n if(this.decimals[index]) return this.decimals[index];\n const item = document.createElement('div');\n item.className = AnimatedCounter.BASE_CLASS + '-decimal';\n\n const placeholder = document.createElement('div');\n placeholder.className = AnimatedCounter.BASE_CLASS + '-decimal-placeholder';\n\n const animatedSuper = new AnimatedSuper();\n animatedSuper.container.className = AnimatedCounter.BASE_CLASS + '-decimal-wrapper';\n\n item.append(placeholder, animatedSuper.container);\n\n this.container.append(item);\n\n return this.decimals[index] = {container: item, placeholder, animatedSuper};\n }\n\n clear(number: number) {\n if(this.clearTimeout) clearTimeout(this.clearTimeout);\n\n const decimals = ('' + number).length;\n if(decimals >= this.decimals.length) {\n return;\n }\n\n this.clearTimeout = window.setTimeout(() => {\n const byDecimal = this.decimals.splice(decimals, this.decimals.length - decimals);\n byDecimal.forEach((decimal) => {\n decimal.container.remove();\n });\n }, AnimatedSuper.DURATION);\n }\n\n /* prepareNumber(number: number) {\n const decimals = ('' + number).length;\n if(this.decimals.length < decimals) {\n for(let i = this.decimals.length; i < decimals; ++i) {\n this.getDecimal(i);\n }\n }\n } */\n\n hideLeft(number: number) {\n const decimals = ('' + number).length;\n const byDecimal = this.decimals.slice(decimals);// this.decimals.splice(deleteCount, this.decimals.length - deleteCount);\n byDecimal.forEach((decimal) => {\n const previousDecimalNumber = +decimal.placeholder.innerText || 0;\n const row = decimal.animatedSuper.getRow(AnimatedCounter.EMPTY_INDEX, true);\n decimal.animatedSuper.animate(AnimatedCounter.EMPTY_INDEX, previousDecimalNumber, this.reverse ? number < this.previousNumber : number > this.previousNumber, true);\n });\n\n this.clear(number);\n }\n\n setCount(number: number) {\n // this.prepareNumber(number);\n\n const previousByDecimal = Array.from('' + this.previousNumber).map((n) => +n);\n const byDecimal = Array.from('' + number).map((n) => +n);\n byDecimal.forEach((decimalNumber, idx) => {\n const decimal = this.getDecimal(idx);\n // const row = decimal.animatedSuper.getRow(number, true);\n const row = decimal.animatedSuper.getRow(decimalNumber, true);\n const previousDecimalNumber = previousByDecimal[idx] ?? AnimatedCounter.EMPTY_INDEX;\n row.innerText = decimal.placeholder.innerText = '' + decimalNumber;\n // decimal.animatedSuper.animate(number, this.previousNumber, this.reverse ? number < this.previousNumber : number > this.previousNumber, true);\n decimal.animatedSuper.animate(decimalNumber, previousDecimalNumber, this.reverse ? number < this.previousNumber : number > this.previousNumber, true);\n });\n\n this.hideLeft(number);\n // this.clear(number);\n this.previousNumber = number;\n }\n}\n\nexport default class ChatPinnedMessage {\n private static LOAD_COUNT = 50;\n private static LOAD_OFFSET = 5;\n\n public pinnedMessageContainer: PinnedContainer;\n private pinnedMessageBorder: PinnedMessageBorder;\n\n private pinnedMaxMid = 0;\n public pinnedMid = 0;\n public pinnedIndex = -1;\n private wasPinnedIndex = 0;\n private wasPinnedMediaIndex = 0;\n\n public locked = false;\n private waitForScrollBottom = false;\n\n public count = 0;\n private mids: number[] = [];\n private offsetIndex = 0;\n\n private loading = false;\n private loadedBottom = false;\n private loadedTop = false;\n\n private animatedSubtitle: AnimatedSuper;\n private animatedMedia: AnimatedSuper;\n private animatedCounter: AnimatedCounter;\n\n private listenerSetter: ListenerSetter;\n private scrollDownListenerSetter: ListenerSetter = null;\n\n public hidden = false;\n\n private getCurrentIndexPromise: Promise = null;\n private btnOpen: HTMLButtonElement;\n\n private setPinnedMessage: () => void;\n\n private isStatic: boolean;\n\n private debug: boolean;\n\n public setCorrectIndexThrottled: (lastScrollDirection?: number) => void;\n\n private log: ReturnType;\n\n constructor(private topbar: ChatTopbar, private chat: Chat, private managers: AppManagers) {\n this.listenerSetter = new ListenerSetter();\n this.log = logger('PM');\n this.debug = true;\n this.isStatic = false;\n\n const dAC = new ReplyContainer('pinned-message', chat.animationGroup);\n this.pinnedMessageContainer = new PinnedContainer({\n topbar,\n chat,\n listenerSetter: this.listenerSetter,\n className: 'message',\n divAndCaption: dAC,\n onClose: async() => {\n if(await managers.appPeersManager.canPinMessage(this.chat.peerId)) {\n PopupElement.createPopup(PopupPinMessage, this.chat.peerId, this.pinnedMid, true);\n } else {\n PopupElement.createPopup(PopupPinMessage, this.chat.peerId, 0, true);\n }\n\n return false;\n }\n });\n\n this.pinnedMessageBorder = new PinnedMessageBorder();\n dAC.border.replaceWith(this.pinnedMessageBorder.render(1, 0));\n\n this.animatedSubtitle = new AnimatedSuper();\n dAC.subtitle.append(this.animatedSubtitle.container);\n\n this.animatedMedia = new AnimatedSuper();\n this.animatedMedia.container.classList.add('pinned-message-media-container');\n dAC.content.prepend(this.animatedMedia.container);\n\n this.animatedCounter = new AnimatedCounter(true);\n dAC.title.append(i18n('PinnedMessage'), ' ', this.animatedCounter.container);\n\n const btnClose = this.pinnedMessageContainer.btnClose.cloneNode(true) as HTMLElement;\n this.pinnedMessageContainer.attachOnCloseEvent(btnClose);\n dAC.container.prepend(btnClose);\n\n this.btnOpen = ButtonIcon('pinlist pinned-container-close pinned-message-pinlist', {noRipple: true});\n\n this.pinnedMessageContainer.wrapperUtils.prepend(this.btnOpen);\n\n attachClickEvent(this.btnOpen, (e) => {\n cancelEvent(e);\n this.topbar.openPinned(true);\n }, {listenerSetter: this.listenerSetter});\n\n this.listenerSetter.add(rootScope)('peer_pinned_messages', ({peerId}) => {\n if(peerId === this.chat.peerId) {\n // this.wasPinnedIndex = 0;\n // setTimeout(() => {\n if(this.hidden) {\n this.pinnedMessageContainer.toggle(this.hidden = false);\n }\n\n this.loadedTop = this.loadedBottom = false;\n this.pinnedIndex = -1;\n this.pinnedMid = 0;\n this.count = 0;\n this.mids = [];\n this.offsetIndex = 0;\n this.pinnedMaxMid = 0;\n this.setCorrectIndex(0);\n // }, 300);\n }\n });\n\n this.listenerSetter.add(rootScope)('peer_pinned_hidden', ({peerId}) => {\n if(peerId === this.chat.peerId) {\n this.pinnedMessageContainer.toggle(this.hidden = true);\n }\n });\n\n // * 200 - no lags\n // * 100 - need test\n this.setPinnedMessage = debounce(() => this._setPinnedMessage(), 100, true, true);\n this.setCorrectIndexThrottled = throttle(this.setCorrectIndex.bind(this), 100, false);\n\n this.isStatic = !this.chat.isPinnedMessagesNeeded();\n }\n\n public destroy() {\n this.pinnedMessageContainer.divAndCaption.container.remove();\n this.pinnedMessageContainer.toggle(true);\n this.listenerSetter.removeAll();\n this.unsetScrollDownListener(false);\n }\n\n public setCorrectIndex(lastScrollDirection?: number) {\n if(this.isStatic) return;\n // return;\n\n if(this.locked || this.hidden/* || this.chat.setPeerPromise || this.chat.bubbles.messagesQueuePromise */) {\n return;\n }\n\n if((this.loadedBottom || this.loadedTop) && !this.count) {\n return;\n }\n\n // const perf = performance.now();\n const el = this.chat.bubbles.getBubbleByPoint('bottom');\n // this.log('setCorrectIndex: get last element perf:', performance.now() - perf, el);\n if(!el) return;\n\n // return;\n\n const mid = el.dataset.mid;\n if(el && mid !== undefined) {\n // this.log('setCorrectIndex will test mid:', mid);\n this.testMid(+mid, lastScrollDirection);\n }\n }\n\n public testMid(mid: number, lastScrollDirection?: number) {\n if(this.isStatic) return;\n\n // if(lastScrollDirection !== undefined) return;\n if(this.hidden) return;\n\n // this.log('testMid', mid);\n\n let currentIndex: number = this.mids.findIndex((_mid) => _mid <= mid);\n if(currentIndex !== -1 && !this.isNeededMore(currentIndex)) {\n currentIndex += this.offsetIndex;\n } else if(this.loadedTop && mid < this.mids[this.mids.length - 1]) {\n // currentIndex = 0;\n currentIndex = this.mids.length - 1 + this.offsetIndex;\n } else {\n if(!this.getCurrentIndexPromise) {\n this.getCurrentIndexPromise = this.getCurrentIndex(mid, lastScrollDirection !== undefined);\n }\n\n return;\n }\n\n // const idx = Math.max(0, this.mids.indexOf(mid));\n\n /* if(currentIndex === this.count) {\n currentIndex = 0;\n } */\n\n // this.log('testMid: pinned currentIndex', currentIndex, mid);\n\n const changed = this.pinnedIndex !== currentIndex;\n if(changed) {\n if(this.waitForScrollBottom && lastScrollDirection !== undefined) {\n if(this.pinnedIndex === 0 || this.pinnedIndex > currentIndex) { // если не скроллил вниз и пытается поставить нижний пиннед - выйти\n return;\n }\n }\n\n this.pinnedIndex = currentIndex;\n this.pinnedMid = this.mids.find((_mid) => _mid <= mid) || this.mids[this.mids.length - 1];\n this.setPinnedMessage();\n }\n }\n\n private isNeededMore(currentIndex: number) {\n return (this.count > ChatPinnedMessage.LOAD_COUNT &&\n (\n (!this.loadedBottom && currentIndex <= ChatPinnedMessage.LOAD_OFFSET) ||\n (!this.loadedTop && (this.count - 1 - currentIndex) <= ChatPinnedMessage.LOAD_OFFSET)\n )\n );\n }\n\n private async getCurrentIndex(mid: number, correctAfter = true) {\n if(this.loading) return;\n this.loading = true;\n\n try {\n const log = this.debug ? this.log.bindPrefix('getCurrentIndex') : undefined;\n log && log('start', mid, correctAfter);\n\n let gotRest = false;\n const promises = [\n this.managers.appMessagesManager.getSearch({\n peerId: this.chat.peerId,\n inputFilter: {_: 'inputMessagesFilterPinned'},\n maxId: mid,\n limit: ChatPinnedMessage.LOAD_COUNT,\n backLimit: ChatPinnedMessage.LOAD_COUNT,\n threadId: this.chat.threadId\n })\n .then((r) => {\n gotRest = true;\n return r;\n })\n ];\n\n if(!this.pinnedMaxMid) {\n const promise = this.managers.appMessagesManager.getPinnedMessage(this.chat.peerId, this.chat.threadId).then((p) => {\n if(!p.maxId) return;\n this.pinnedMaxMid = p.maxId;\n\n if(!gotRest && correctAfter) {\n this.mids = [this.pinnedMaxMid];\n this.count = p.count;\n this.pinnedIndex = 0;\n this.pinnedMid = this.mids[0];\n this.setPinnedMessage();\n // this.pinnedMessageContainer.toggle(false);\n }\n });\n\n promises.push(promise as any);\n }\n\n const result = (await Promise.all(promises))[0];\n\n let backLimited = result.history.findIndex((message) => message.mid <= mid);\n if(backLimited === -1) {\n backLimited = result.history.length;\n }/* else {\n backLimited -= 1;\n } */\n\n this.offsetIndex = result.offset_id_offset ? result.offset_id_offset - backLimited : 0;\n this.mids = result.history.map((message) => message.mid).slice();\n this.count = result.count;\n\n if(!this.count) {\n this.pinnedMessageContainer.toggle(true);\n }\n\n this.loadedTop = (this.offsetIndex + this.mids.length) === this.count;\n this.loadedBottom = !this.offsetIndex;\n\n log && log('result', mid, result, backLimited, this.offsetIndex, this.loadedTop, this.loadedBottom);\n } catch(err) {\n this.log.error('getCurrentIndex error', err);\n }\n\n this.loading = false;\n\n if(this.locked) {\n this.testMid(mid);\n } else if(correctAfter) {\n this.setCorrectIndex(0);\n }\n\n this.getCurrentIndexPromise = null;\n // return result.offset_id_offset || 0;\n }\n\n public setScrollDownListener() {\n this.waitForScrollBottom = true;\n\n if(!this.scrollDownListenerSetter) {\n this.scrollDownListenerSetter = new ListenerSetter();\n handleScrollSideEvent(this.chat.bubbles.scrollable.container, 'bottom', () => {\n this.unsetScrollDownListener();\n }, this.scrollDownListenerSetter);\n }\n }\n\n public unsetScrollDownListener(refreshPosition = true) {\n this.waitForScrollBottom = false;\n\n if(this.scrollDownListenerSetter) {\n this.scrollDownListenerSetter.removeAll();\n this.scrollDownListenerSetter = null;\n }\n\n if(refreshPosition) {\n this.setCorrectIndex(0);\n }\n }\n\n public async handleFollowingPinnedMessage() {\n this.locked = true;\n\n this.debug && this.log('handleFollowingPinnedMessage');\n try {\n this.setScrollDownListener();\n\n const setPeerPromise = this.chat.setPeerPromise;\n if(setPeerPromise instanceof Promise) {\n await setPeerPromise;\n }\n\n // await this.chat.bubbles.scrollable.scrollLockedPromise;\n await getHeavyAnimationPromise();\n\n if(this.getCurrentIndexPromise) {\n await this.getCurrentIndexPromise;\n }\n\n this.debug && this.log('handleFollowingPinnedMessage: unlock');\n this.locked = false;\n\n /* // подождём, пока скролл остановится\n setTimeout(() => {\n this.log('handleFollowingPinnedMessage: unlock');\n this.locked = false;\n }, 50); */\n } catch(err) {\n this.log.error('handleFollowingPinnedMessage error:', err);\n\n this.locked = false;\n this.waitForScrollBottom = false;\n this.setCorrectIndex(0);\n }\n }\n\n public async followPinnedMessage(mid: number) {\n const message = await this.chat.getMessage(mid);\n if(!message) {\n return;\n }\n\n this.chat.setMessageId(mid);\n (this.chat.setPeerPromise || Promise.resolve()).then(() => { // * debounce fast clicker\n this.handleFollowingPinnedMessage();\n this.testMid(this.pinnedIndex >= (this.count - 1) ? this.pinnedMaxMid : mid - 1);\n });\n }\n\n public async _setPinnedMessage() {\n // ///this.log('setting pinned message', message);\n // return;\n /* const promise: Promise = this.chat.setPeerPromise || this.chat.bubbles.messagesQueuePromise || Promise.resolve();\n Promise.all([\n promise\n ]).then(() => { */\n // const mids = results[0];\n const count = this.count;\n if(count) {\n const pinnedIndex = this.pinnedIndex;\n const message = await this.chat.getMessage(this.pinnedMid);\n\n // this.animatedCounter.prepareNumber(count);\n\n // setTimeout(() => {\n const isLast = pinnedIndex === 0;\n this.animatedCounter.container.classList.toggle('is-last', isLast);\n // SetTransition(this.animatedCounter.container, 'is-last', isLast, AnimatedSuper.DURATION);\n if(!isLast) {\n this.animatedCounter.setCount(count - pinnedIndex);\n }\n // }, 100);\n\n // this.pinnedMessageContainer.fill(undefined, message.message, message);\n this.pinnedMessageContainer.toggle(false);\n\n const fromTop = pinnedIndex > this.wasPinnedIndex;\n\n this.debug && this.log('setPinnedMessage: fromTop', fromTop, pinnedIndex, this.wasPinnedIndex);\n\n const writeTo = this.animatedSubtitle.getRow(pinnedIndex);\n const writeMediaTo = this.animatedMedia.getRow(pinnedIndex);\n writeMediaTo.classList.add('pinned-message-media');\n // writeMediaTo.innerHTML = writeMediaTo.style.cssText = writeMediaTo.dataset.docId = '';\n const loadPromises: Promise[] = [];\n const isMediaSet = await wrapReplyDivAndCaption({\n title: undefined,\n titleEl: null,\n subtitle: (message as Message.message).message,\n subtitleEl: writeTo,\n message,\n mediaEl: writeMediaTo,\n loadPromises,\n animationGroup: this.chat.animationGroup\n });\n\n await Promise.all(loadPromises);\n\n this.pinnedMessageContainer.divAndCaption.container.classList.toggle('is-media', isMediaSet);\n\n // if(this.wasPinnedIndex !== this.pinnedIndex) {\n this.animatedSubtitle.animate(pinnedIndex, this.wasPinnedIndex);\n if(isMediaSet) {\n this.animatedMedia.animate(pinnedIndex, this.wasPinnedMediaIndex); // * wasPinnedMediaIndex из-за того, что блок меняется с другим алгоритмом\n this.wasPinnedMediaIndex = pinnedIndex;\n } else {\n this.animatedMedia.clearRows();\n }\n // }\n\n this.pinnedMessageBorder.render(count, count - pinnedIndex - 1);\n this.wasPinnedIndex = pinnedIndex;\n this.pinnedMessageContainer.divAndCaption.container.dataset.mid = '' + message.mid;\n } else {\n this.pinnedMessageContainer.toggle(true);\n this.wasPinnedIndex = 0;\n }\n\n this.pinnedMessageContainer.divAndCaption.container.classList.toggle('is-many', this.count > 1);\n // });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ListenerSetter from '../listenerSetter';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\n\nexport default function handleScrollSideEvent(elem: HTMLElement, side: 'top' | 'bottom', callback: () => void, listenerSetter: ListenerSetter) {\n if(IS_TOUCH_SUPPORTED) {\n let lastY: number;\n const options = {passive: true};\n listenerSetter.add(elem)('touchstart', (e) => {\n if(e.touches.length > 1) {\n onTouchEnd();\n return;\n }\n\n lastY = e.touches[0].clientY;\n\n listenerSetter.add(elem)('touchmove', onTouchMove, options);\n listenerSetter.add(elem)('touchend', onTouchEnd, options);\n }, options);\n\n const onTouchMove = (e: TouchEvent) => {\n const clientY = e.touches[0].clientY;\n\n const isDown = clientY < lastY;\n if(side === 'bottom' && isDown) callback();\n else if(side === 'top' && !isDown) callback();\n lastY = clientY;\n // alert('isDown: ' + !!isDown);\n };\n\n const onTouchEnd = () => {\n listenerSetter.removeManual(elem, 'touchmove', onTouchMove, options);\n listenerSetter.removeManual(elem, 'touchend', onTouchEnd, options);\n };\n } else {\n listenerSetter.add(elem)('wheel', (e) => {\n const isDown = e.deltaY > 0;\n // this.log('wheel', e, isDown);\n if(side === 'bottom' && isDown) callback();\n else if(side === 'top' && !isDown) callback();\n }, {passive: true});\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Channel} from '../../lib/appManagers/appChatsManager';\nimport type {AppSidebarRight} from '../sidebarRight';\nimport type Chat from './chat';\nimport {RIGHT_COLUMN_ACTIVE_CLASSNAME} from '../sidebarRight';\nimport mediaSizes, {ScreenSize} from '../../helpers/mediaSizes';\nimport {IS_SAFARI} from '../../environment/userAgent';\nimport rootScope from '../../lib/rootScope';\nimport AvatarElement from '../avatar';\nimport Button from '../button';\nimport ButtonIcon from '../buttonIcon';\nimport ButtonMenuToggle from '../buttonMenuToggle';\nimport ChatAudio from './audio';\nimport ChatPinnedMessage from './pinnedMessage';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport PopupDeleteDialog from '../popups/deleteDialog';\nimport appNavigationController from '../appNavigationController';\nimport {LEFT_COLUMN_ACTIVE_CLASSNAME} from '../sidebarLeft';\nimport PeerTitle from '../peerTitle';\nimport {i18n} from '../../lib/langPack';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport blurActiveElement from '../../helpers/dom/blurActiveElement';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport {toast, toastNew} from '../toast';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport {ChatFull, Chat as MTChat, GroupCall} from '../../layer';\nimport PopupPickUser from '../popups/pickUser';\nimport PopupPeer from '../popups/peer';\nimport AppEditContactTab from '../sidebarRight/tabs/editContact';\nimport appMediaPlaybackController from '../appMediaPlaybackController';\nimport IS_GROUP_CALL_SUPPORTED from '../../environment/groupCallSupport';\nimport IS_CALL_SUPPORTED from '../../environment/callSupport';\nimport {CallType} from '../../lib/calls/types';\nimport PopupMute from '../popups/mute';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport hasRights from '../../lib/appManagers/utils/chats/hasRights';\nimport wrapPeerTitle from '../wrappers/peerTitle';\nimport groupCallsController from '../../lib/calls/groupCallsController';\nimport apiManagerProxy from '../../lib/mtproto/mtprotoworker';\nimport {makeMediaSize} from '../../helpers/mediaSize';\nimport {FOLDER_ID_ALL} from '../../lib/mtproto/mtproto_config';\nimport formatNumber from '../../helpers/number/formatNumber';\nimport PopupElement from '../popups';\n\ntype ButtonToVerify = {element?: HTMLElement, verify: () => boolean | Promise};\n\nexport default class ChatTopbar {\n public container: HTMLDivElement;\n private btnBack: HTMLButtonElement;\n private btnBackBadge: HTMLElement;\n private chatInfo: HTMLDivElement;\n private avatarElement: AvatarElement;\n private title: HTMLDivElement;\n private subtitle: HTMLDivElement;\n private chatUtils: HTMLDivElement;\n private btnJoin: HTMLButtonElement;\n private btnPinned: HTMLButtonElement;\n private btnCall: HTMLButtonElement;\n private btnGroupCall: HTMLButtonElement;\n private btnMute: HTMLButtonElement;\n private btnSearch: HTMLButtonElement;\n private btnMore: HTMLElement;\n\n private chatAudio: ChatAudio;\n public pinnedMessage: ChatPinnedMessage;\n\n private setUtilsRAF: number;\n private setPeerStatusInterval: number;\n\n public listenerSetter: ListenerSetter;\n\n private menuButtons: Parameters[0]['buttons'];\n private buttonsToVerify: ButtonToVerify[];\n private chatInfoContainer: HTMLDivElement;\n private person: HTMLDivElement;\n\n constructor(\n private chat: Chat,\n private appSidebarRight: AppSidebarRight,\n private managers: AppManagers\n ) {\n this.listenerSetter = new ListenerSetter();\n\n this.menuButtons = [];\n this.buttonsToVerify = [];\n }\n\n public construct() {\n // this.chat.log.error('Topbar construction');\n\n this.container = document.createElement('div');\n this.container.classList.add('sidebar-header', 'topbar', 'hide');\n this.container.dataset.floating = '0';\n\n this.btnBack = ButtonIcon('left sidebar-close-button', {noRipple: true});\n this.btnBackBadge = document.createElement('span');\n this.btnBackBadge.classList.add('badge', 'badge-20', 'badge-primary', 'back-unread-badge');\n this.btnBack.append(this.btnBackBadge);\n\n // * chat info section\n this.chatInfoContainer = document.createElement('div');\n this.chatInfoContainer.classList.add('chat-info-container');\n\n this.chatInfo = document.createElement('div');\n this.chatInfo.classList.add('chat-info');\n\n const person = this.person = document.createElement('div');\n person.classList.add('person');\n\n const content = document.createElement('div');\n content.classList.add('content');\n\n const top = document.createElement('div');\n top.classList.add('top');\n\n this.title = document.createElement('div');\n this.title.classList.add('user-title');\n\n top.append(this.title);\n\n const bottom = document.createElement('div');\n bottom.classList.add('bottom');\n\n if(this.subtitle) {\n bottom.append(this.subtitle);\n }\n\n content.append(top, bottom);\n if(this.avatarElement) {\n person.append(this.avatarElement);\n }\n\n person.append(content);\n this.chatInfo.append(person);\n\n // * chat utils section\n this.chatUtils = document.createElement('div');\n this.chatUtils.classList.add('chat-utils');\n\n this.chatAudio = new ChatAudio(this, this.chat, this.managers);\n\n if(this.menuButtons.length) {\n this.btnMore = ButtonMenuToggle({\n listenerSetter: this.listenerSetter,\n direction: 'bottom-left',\n buttons: this.menuButtons,\n onOpen: async(e, element) => {\n const deleteButton = this.menuButtons[this.menuButtons.length - 1];\n if(deleteButton?.element) {\n const deleteButtonText = await this.managers.appPeersManager.getDeleteButtonText(this.peerId);\n deleteButton.element.lastChild.replaceWith(i18n(deleteButtonText));\n }\n }\n });\n }\n\n this.chatUtils.append(...[\n // this.chatAudio ? this.chatAudio.divAndCaption.container : null,\n this.pinnedMessage ? this.pinnedMessage.pinnedMessageContainer.divAndCaption.container : null,\n this.btnJoin,\n this.btnPinned,\n this.btnCall,\n this.btnGroupCall,\n this.btnMute,\n this.btnSearch,\n this.btnMore\n ].filter(Boolean));\n\n this.pushButtonToVerify(this.btnCall, this.verifyCallButton.bind(this, 'voice'));\n this.pushButtonToVerify(this.btnGroupCall, this.verifyVideoChatButton);\n\n this.chatInfoContainer.append(this.btnBack, this.chatInfo, this.chatUtils);\n this.container.append(this.chatInfoContainer);\n\n if(this.chatAudio) {\n // this.container.append(this.chatAudio.divAndCaption.container, this.chatUtils);\n this.container.append(this.chatAudio.divAndCaption.container);\n }\n\n // * construction end\n\n // * fix topbar overflow section\n\n this.listenerSetter.add(window)('resize', this.onResize);\n this.listenerSetter.add(mediaSizes)('changeScreen', this.onChangeScreen);\n\n attachClickEvent(this.container, (e) => {\n const container = findUpClassName(e.target, 'pinned-container');\n blurActiveElement();\n if(container) {\n cancelEvent(e);\n\n if(findUpClassName(e.target, 'progress-line') || findUpClassName(e.target, 'pinned-container-wrapper-utils')) {\n return;\n }\n\n const mid = +container.dataset.mid;\n if(container.classList.contains('pinned-message')) {\n // if(!this.pinnedMessage.locked) {\n this.pinnedMessage.followPinnedMessage(mid);\n // }\n } else {\n const peerId = container.dataset.peerId.toPeerId();\n const searchContext = appMediaPlaybackController.getSearchContext();\n this.chat.appImManager.setInnerPeer({\n peerId,\n lastMsgId: mid,\n type: searchContext.isScheduled ? 'scheduled' : (searchContext.threadId ? 'discussion' : undefined),\n threadId: searchContext.threadId\n });\n }\n } else {\n if(mediaSizes.activeScreen === ScreenSize.medium && document.body.classList.contains(LEFT_COLUMN_ACTIVE_CLASSNAME)) {\n onBtnBackClick();\n } else if(findUpTag(e.target, 'AVATAR-ELEMENT')) {\n this.appSidebarRight.toggleSidebar(!document.body.classList.contains(RIGHT_COLUMN_ACTIVE_CLASSNAME));\n } else {\n this.appSidebarRight.toggleSidebar(true);\n }\n }\n }, {listenerSetter: this.listenerSetter});\n\n const onBtnBackClick = (e?: Event) => {\n if(e) {\n cancelEvent(e);\n }\n\n // const item = appNavigationController.findItemByType('chat');\n // * return manually to chat by arrow, since can't get back to\n if(mediaSizes.activeScreen === ScreenSize.medium && document.body.classList.contains(LEFT_COLUMN_ACTIVE_CLASSNAME)) {\n this.chat.appImManager.setPeer({peerId: this.peerId});\n } else {\n const isFirstChat = this.chat.appImManager.chats.indexOf(this.chat) === 0;\n appNavigationController.back(isFirstChat ? 'im' : 'chat');\n /* return;\n\n if(mediaSizes.activeScreen === ScreenSize.medium && !appNavigationController.findItemByType('chat')) {\n this.chat.appImManager.setPeer(0);\n blurActiveElement();\n } else {\n appNavigationController.back('chat');\n } */\n }\n };\n\n attachClickEvent(this.btnBack, onBtnBackClick, {listenerSetter: this.listenerSetter});\n }\n\n private pushButtonToVerify(element: HTMLElement, verify: ButtonToVerify['verify']) {\n if(!element) {\n return;\n }\n\n this.buttonsToVerify.push({element, verify});\n }\n\n private verifyButtons = (e?: Event) => {\n const isMenuOpen = !!e || !!(this.btnMore && this.btnMore.classList.contains('menu-open'));\n\n e && cancelEvent(e);\n\n const r = async() => {\n const buttons = this.buttonsToVerify.concat(isMenuOpen ? this.menuButtons as any : []);\n const results = await Promise.all(buttons.map(async(button) => {\n return {\n result: await button.verify(),\n button\n }\n }));\n\n results.forEach(({button, result}) => {\n button.element.classList.toggle('hide', !result);\n });\n };\n\n r();\n };\n\n private verifyVideoChatButton = async(type?: 'group' | 'broadcast') => {\n if(!IS_GROUP_CALL_SUPPORTED || this.peerId.isUser() || this.chat.type !== 'chat' || this.chat.threadId) return false;\n\n const currentGroupCall = groupCallsController.groupCall;\n const chatId = this.peerId.toChatId();\n if(currentGroupCall?.chatId === chatId) {\n return false;\n }\n\n if(type) {\n if(((await this.managers.appPeersManager.isBroadcast(this.peerId)) && type === 'group') ||\n ((await this.managers.appPeersManager.isAnyGroup(this.peerId)) && type === 'broadcast')) {\n return false;\n }\n }\n\n const chat = await this.managers.appChatsManager.getChat(chatId);\n return (chat as MTChat.chat).pFlags?.call_active || hasRights(chat, 'manage_call');\n };\n\n private verifyCallButton = async(type?: CallType) => {\n if(!IS_CALL_SUPPORTED || !this.peerId.isUser()) return false;\n const userId = this.peerId.toUserId();\n const userFull = await this.managers.appProfileManager.getCachedFullUser(userId);\n\n return !!userFull && !!(type === 'voice' ? userFull.pFlags.phone_calls_available : userFull.pFlags.video_calls_available);\n };\n\n public constructUtils() {\n this.menuButtons = [{\n icon: 'search',\n text: 'Search',\n onClick: () => {\n this.chat.initSearch();\n },\n verify: () => mediaSizes.isMobile\n }, /* {\n icon: 'pinlist',\n text: 'Pinned Messages',\n onClick: () => this.openPinned(false),\n verify: () => mediaSizes.isMobile\n }, */{\n icon: 'mute',\n text: 'ChatList.Context.Mute',\n onClick: this.onMuteClick,\n verify: async() => this.chat.type === 'chat' && rootScope.myId !== this.peerId && !(await this.managers.appNotificationsManager.isPeerLocalMuted({peerId: this.peerId, respectType: false, threadId: this.chat.threadId}))\n }, {\n icon: 'unmute',\n text: 'ChatList.Context.Unmute',\n onClick: () => {\n this.managers.appMessagesManager.togglePeerMute({peerId: this.peerId, threadId: this.chat.threadId});\n },\n verify: async() => this.chat.type === 'chat' && rootScope.myId !== this.peerId && (await this.managers.appNotificationsManager.isPeerLocalMuted({peerId: this.peerId, respectType: false, threadId: this.chat.threadId}))\n }, {\n icon: 'comments',\n text: 'ViewDiscussion',\n onClick: () => {\n const middleware = this.chat.bubbles.getMiddleware();\n Promise.resolve(this.managers.appProfileManager.getChannelFull(this.peerId.toChatId())).then((channelFull) => {\n if(middleware() && channelFull.linked_chat_id) {\n this.chat.appImManager.setInnerPeer({\n peerId: channelFull.linked_chat_id.toPeerId(true)\n });\n }\n });\n },\n verify: async() => {\n const chatFull = await this.managers.appProfileManager.getCachedFullChat(this.peerId.toChatId());\n return this.chat.type === 'chat' && !!(chatFull as ChatFull.channelFull)?.linked_chat_id;\n }\n }, {\n icon: 'phone',\n text: 'Call',\n onClick: this.onCallClick.bind(this, 'voice'),\n verify: this.verifyCallButton.bind(this, 'voice')\n }, {\n icon: 'videocamera',\n text: 'VideoCall',\n onClick: this.onCallClick.bind(this, 'video'),\n verify: this.verifyCallButton.bind(this, 'video')\n }, {\n icon: 'videochat',\n text: 'PeerInfo.Action.LiveStream',\n onClick: this.onJoinGroupCallClick,\n verify: this.verifyVideoChatButton.bind(this, 'broadcast')\n }, {\n icon: 'videochat',\n text: 'PeerInfo.Action.VoiceChat',\n onClick: this.onJoinGroupCallClick,\n verify: this.verifyVideoChatButton.bind(this, 'group')\n }, {\n icon: 'select',\n text: 'Chat.Menu.SelectMessages',\n onClick: () => {\n const selection = this.chat.selection;\n selection.toggleSelection(true, true);\n apiManagerProxy.getState().then((state) => {\n if(state.chatContextMenuHintWasShown) {\n return;\n }\n\n const original = selection.toggleByElement.bind(selection);\n selection.toggleByElement = async(bubble) => {\n this.managers.appStateManager.pushToState('chatContextMenuHintWasShown', true);\n toast(i18n('Chat.Menu.Hint'));\n\n selection.toggleByElement = original;\n selection.toggleByElement(bubble);\n };\n });\n },\n verify: () => !this.chat.selection.isSelecting && !!this.chat.bubbles.getRenderedLength()\n }, {\n icon: 'select',\n text: 'Chat.Menu.ClearSelection',\n onClick: () => {\n this.chat.selection.cancelSelection();\n },\n verify: () => this.chat.selection.isSelecting\n }, {\n icon: 'adduser',\n text: 'AddContact',\n onClick: () => {\n if(!this.appSidebarRight.isTabExists(AppEditContactTab)) {\n const tab = this.appSidebarRight.createTab(AppEditContactTab);\n tab.peerId = this.peerId;\n tab.open();\n\n this.appSidebarRight.toggleSidebar(true);\n }\n },\n verify: async() => this.peerId.isUser() && !(await this.managers.appPeersManager.isContact(this.peerId))\n }, {\n icon: 'forward',\n text: 'ShareContact',\n onClick: () => {\n const contactPeerId = this.peerId;\n PopupElement.createPopup(PopupPickUser, {\n peerTypes: ['dialogs', 'contacts'],\n onSelect: (peerId) => {\n return new Promise((resolve, reject) => {\n PopupElement.createPopup(PopupPeer, '', {\n titleLangKey: 'SendMessageTitle',\n descriptionLangKey: 'SendContactToGroupText',\n descriptionLangArgs: [new PeerTitle({peerId, dialog: true}).element],\n buttons: [{\n langKey: 'Send',\n callback: () => {\n resolve();\n\n this.managers.appMessagesManager.sendContact(peerId, contactPeerId);\n this.chat.appImManager.setInnerPeer({peerId});\n }\n }, {\n langKey: 'Cancel',\n callback: () => {\n reject();\n },\n isCancel: true\n }],\n peerId,\n overlayClosable: true\n }).show();\n });\n },\n placeholder: 'ShareModal.Search.Placeholder',\n chatRightsActions: ['send_plain'],\n selfPresence: 'ChatYourSelf'\n });\n },\n verify: async() => rootScope.myId !== this.peerId && this.peerId.isUser() && (await this.managers.appPeersManager.isContact(this.peerId)) && !!(await this.managers.appUsersManager.getUser(this.peerId.toUserId())).phone\n }, {\n icon: 'gift',\n text: 'GiftPremium',\n onClick: () => this.chat.appImManager.giftPremium(this.peerId),\n verify: () => this.chat.canGiftPremium()\n }, {\n icon: 'bots',\n text: 'Settings',\n onClick: () => {\n this.managers.appMessagesManager.sendText(this.peerId, '/settings');\n },\n verify: async() => {\n try {\n const attachMenuBot = await this.managers.appAttachMenuBotsManager.getAttachMenuBot(this.peerId.toUserId());\n return !!attachMenuBot?.pFlags?.has_settings;\n } catch(err) {\n return false;\n }\n }\n }, {\n icon: 'lock',\n text: 'BlockUser',\n onClick: () => {\n PopupElement.createPopup(PopupPeer, '', {\n peerId: this.peerId,\n titleLangKey: 'BlockUser',\n descriptionLangKey: 'AreYouSureBlockContact2',\n descriptionLangArgs: [new PeerTitle({peerId: this.peerId}).element],\n buttons: [{\n langKey: 'BlockUser',\n isDanger: true,\n callback: () => {\n this.managers.appUsersManager.toggleBlock(this.peerId, true).then((value) => {\n if(value) {\n toastNew({langPackKey: 'UserBlocked'});\n }\n });\n }\n }]\n }).show();\n },\n verify: async() => {\n if(!this.peerId.isUser()) return false;\n const userFull = await this.managers.appProfileManager.getCachedFullUser(this.peerId.toUserId());\n return this.peerId !== rootScope.myId && userFull && !userFull.pFlags?.blocked;\n }\n }, {\n icon: 'lockoff',\n text: 'Unblock',\n onClick: () => {\n this.managers.appUsersManager.toggleBlock(this.peerId, false).then((value) => {\n if(value) {\n toastNew({langPackKey: 'UserUnblocked'});\n }\n });\n },\n verify: async() => {\n const userFull = await this.managers.appProfileManager.getCachedFullUser(this.peerId.toUserId());\n return !!userFull?.pFlags?.blocked;\n }\n }, {\n icon: 'delete danger',\n text: 'Delete',\n onClick: () => {\n PopupElement.createPopup(PopupDeleteDialog, this.peerId/* , 'leave' */);\n },\n verify: async() => this.chat.type === 'chat' && !!(await this.managers.appMessagesManager.getDialogOnly(this.peerId))\n }];\n\n this.btnSearch = ButtonIcon('search');\n this.attachClickEvent(this.btnSearch, (e) => {\n this.chat.initSearch();\n }, true);\n }\n\n public attachClickEvent(el: HTMLElement, cb: (e: MouseEvent) => void, noBlur?: boolean) {\n attachClickEvent(el, (e) => {\n cancelEvent(e);\n !noBlur && blurActiveElement();\n cb(e);\n }, {listenerSetter: this.listenerSetter});\n }\n\n private onCallClick(type: CallType) {\n this.chat.appImManager.callUser(this.peerId.toUserId(), type);\n }\n\n private onJoinGroupCallClick = () => {\n this.chat.appImManager.joinGroupCall(this.peerId);\n };\n\n private constructAvatar() {\n const avatarElement = new AvatarElement();\n avatarElement.isDialog = true;\n avatarElement.classList.add('avatar-42', 'person-avatar');\n return avatarElement;\n }\n\n private get peerId() {\n return this.chat.peerId;\n }\n\n public constructPeerHelpers() {\n this.avatarElement = this.constructAvatar();\n\n this.subtitle = document.createElement('div');\n this.subtitle.classList.add('info');\n\n this.pinnedMessage = new ChatPinnedMessage(this, this.chat, this.managers);\n\n this.btnJoin = Button('btn-primary btn-color-primary chat-join hide');\n this.btnCall = ButtonIcon('phone');\n this.btnGroupCall = ButtonIcon('videochat');\n this.btnPinned = ButtonIcon('pinlist');\n this.btnMute = ButtonIcon('mute');\n\n this.attachClickEvent(this.btnCall, this.onCallClick.bind(this, 'voice'));\n this.attachClickEvent(this.btnGroupCall, this.onJoinGroupCallClick);\n\n this.attachClickEvent(this.btnPinned, () => {\n this.openPinned(true);\n });\n\n this.attachClickEvent(this.btnMute, this.onMuteClick);\n\n this.attachClickEvent(this.btnJoin, async() => {\n const middleware = this.chat.bubbles.getMiddleware();\n this.btnJoin.setAttribute('disabled', 'true');\n\n const chatId = this.peerId.toChatId();\n let promise: Promise;\n if(await this.managers.appChatsManager.isChannel(chatId)) {\n promise = this.managers.appChatsManager.joinChannel(chatId);\n } else {\n promise = this.managers.appChatsManager.addChatUser(chatId, rootScope.myId);\n }\n\n promise.finally(() => {\n if(!middleware()) {\n return;\n }\n\n this.btnJoin.removeAttribute('disabled');\n });\n });\n\n this.listenerSetter.add(rootScope)('folder_unread', (folder) => {\n if(folder.id !== FOLDER_ID_ALL) {\n return;\n }\n\n const size = folder.unreadUnmutedPeerIds.size;\n this.btnBackBadge.textContent = size ? '' + formatNumber(size, 1) : '';\n // this.btnBack.classList.remove('tgico-left', 'tgico-previous');\n // this.btnBack.classList.add(size ? 'tgico-previous' : 'tgico-left');\n });\n\n this.listenerSetter.add(rootScope)('chat_update', async(chatId) => {\n if(this.peerId === chatId.toPeerId(true)) {\n const chat = await this.managers.appChatsManager.getChat(chatId) as Channel/* | Chat */;\n\n this.btnJoin.classList.toggle('hide', !(chat as Channel)?.pFlags?.left);\n this.setUtilsWidth();\n this.verifyButtons();\n }\n });\n\n this.listenerSetter.add(rootScope)('dialog_notify_settings', (dialog) => {\n if(dialog.peerId === this.peerId) {\n this.setMutedState();\n }\n });\n\n this.listenerSetter.add(rootScope)('peer_typings', ({peerId}) => {\n if(this.peerId === peerId) {\n this.setPeerStatus();\n }\n });\n\n this.listenerSetter.add(rootScope)('user_update', (userId) => {\n if(this.peerId === userId.toPeerId()) {\n this.setPeerStatus();\n }\n });\n\n this.listenerSetter.add(rootScope)('peer_full_update', (peerId) => {\n if(this.peerId === peerId) {\n this.verifyButtons();\n }\n });\n\n this.chat.addEventListener('setPeer', (mid, isTopMessage) => {\n const middleware = this.chat.bubbles.getMiddleware();\n apiManagerProxy.getState().then((state) => {\n if(!middleware() || !this.pinnedMessage) return;\n\n this.pinnedMessage.hidden = !!state.hiddenPinnedMessages[this.chat.peerId];\n\n if(isTopMessage) {\n this.pinnedMessage.unsetScrollDownListener();\n this.pinnedMessage.testMid(mid, 0); // * because slider will not let get bubble by document.elementFromPoint\n } else if(!this.pinnedMessage.locked) {\n this.pinnedMessage.handleFollowingPinnedMessage();\n this.pinnedMessage.testMid(mid);\n }\n });\n });\n\n this.listenerSetter.add(rootScope)('peer_pinned_messages', ({peerId, mids}) => {\n if(this.chat.type !== 'pinned' || peerId !== this.peerId) {\n return;\n }\n\n if(mids) {\n this.setTitle();\n }\n });\n\n this.setPeerStatusInterval = window.setInterval(this.setPeerStatus, 60e3);\n\n return this;\n }\n\n public openPinned(byCurrent: boolean) {\n this.chat.appImManager.setInnerPeer({\n peerId: this.peerId,\n lastMsgId: byCurrent ? +this.pinnedMessage.pinnedMessageContainer.divAndCaption.container.dataset.mid : 0,\n type: 'pinned'\n });\n }\n\n private onMuteClick = () => {\n PopupElement.createPopup(PopupMute, this.peerId);\n };\n\n private onResize = () => {\n this.setUtilsWidth(true);\n this.setFloating();\n };\n\n private onChangeScreen = (from: ScreenSize, to: ScreenSize) => {\n this.container.classList.toggle('is-pinned-floating', mediaSizes.isMobile);\n // this.chatAudio && this.chatAudio.divAndCaption.container.classList.toggle('is-floating', to === ScreenSize.mobile);\n this.pinnedMessage && this.pinnedMessage.pinnedMessageContainer.divAndCaption.container.classList.toggle('is-floating', to === ScreenSize.mobile);\n this.onResize();\n };\n\n public destroy() {\n // this.chat.log.error('Topbar destroying');\n this.listenerSetter.removeAll();\n window.clearInterval(this.setPeerStatusInterval);\n\n this.pinnedMessage?.destroy(); // * возможно это можно не делать\n this.chatAudio?.destroy();\n\n delete this.chatAudio;\n delete this.pinnedMessage;\n }\n\n public cleanup() {\n if(!this.chat.peerId) {\n this.container.classList.add('hide');\n }\n }\n\n public async finishPeerChange(isTarget: boolean) {\n const {peerId, threadId} = this.chat;\n\n let newAvatar: AvatarElement;\n if(this.chat.type === 'chat') {\n if(this.avatarElement?.peerId !== this.peerId || this.avatarElement.threadId !== this.chat.threadId) {\n newAvatar = this.constructAvatar();\n } else {\n newAvatar = this.avatarElement;\n }\n }\n\n const [isBroadcast, isAnyChat, chat, _, setTitleCallback, setStatusCallback, state] = await Promise.all([\n this.managers.appPeersManager.isBroadcast(peerId),\n this.managers.appPeersManager.isAnyChat(peerId),\n peerId.isAnyChat() ? this.managers.appChatsManager.getChat(peerId.toChatId()) : undefined,\n newAvatar ? newAvatar.updateWithOptions({peerId, threadId, wrapOptions: {customEmojiSize: makeMediaSize(32, 32)}}) : undefined,\n this.setTitleManual(),\n this.setPeerStatusManual(true),\n apiManagerProxy.getState()\n ]);\n\n return () => {\n const canHaveSomeButtons = !(this.chat.type === 'pinned' || this.chat.type === 'scheduled');\n this.btnMute && this.btnMute.classList.toggle('hide', !isBroadcast || !canHaveSomeButtons);\n if(this.btnJoin) {\n if(isAnyChat && !this.chat.isRestricted && canHaveSomeButtons) {\n replaceContent(this.btnJoin, i18n(isBroadcast ? 'Chat.Subscribe' : 'ChannelJoin'));\n this.btnJoin.classList.toggle('hide', !(chat as MTChat.chat)?.pFlags?.left);\n } else {\n this.btnJoin.classList.add('hide');\n }\n }\n\n if(this.btnSearch) {\n this.btnSearch.classList.toggle('hide', !canHaveSomeButtons);\n }\n\n if(this.btnPinned) {\n this.btnPinned.classList.toggle('hide', !canHaveSomeButtons);\n }\n\n if(this.avatarElement !== newAvatar) {\n if(newAvatar) {\n if(this.avatarElement) {\n this.avatarElement.replaceWith(newAvatar);\n } else {\n this.person.prepend(newAvatar);\n }\n }\n\n this.avatarElement?.remove();\n this.avatarElement = newAvatar;\n }\n\n this.setUtilsWidth();\n\n this.verifyButtons();\n\n if(this.btnMore) {\n this.btnMore.classList.toggle('hide', !canHaveSomeButtons);\n }\n\n const isPinnedMessagesNeeded = this.chat.isPinnedMessagesNeeded();\n if(isPinnedMessagesNeeded || this.chat.type === 'discussion') {\n if(this.chat.wasAlreadyUsed || !this.pinnedMessage) { // * change\n const newPinnedMessage = new ChatPinnedMessage(this, this.chat, this.managers);\n if(this.pinnedMessage) {\n this.pinnedMessage.pinnedMessageContainer.divAndCaption.container.replaceWith(newPinnedMessage.pinnedMessageContainer.divAndCaption.container);\n this.pinnedMessage.destroy();\n // this.pinnedMessage.pinnedMessageContainer.toggle(true);\n } else {\n this.chatUtils.prepend(this.pinnedMessage.pinnedMessageContainer.divAndCaption.container);\n }\n\n this.pinnedMessage = newPinnedMessage;\n }\n\n if(isPinnedMessagesNeeded) {\n this.pinnedMessage.hidden = !!state.hiddenPinnedMessages[peerId];\n } else if(this.chat.type === 'discussion') {\n this.pinnedMessage.pinnedMid = this.chat.threadId;\n this.pinnedMessage.count = 1;\n this.pinnedMessage.pinnedIndex = 0;\n this.pinnedMessage._setPinnedMessage();\n }\n } else if(this.pinnedMessage) {\n this.pinnedMessage.destroy();\n this.pinnedMessage = undefined;\n }\n\n setTitleCallback();\n setStatusCallback?.();\n this.subtitle.classList.toggle('hide', !setStatusCallback);\n this.setMutedState();\n\n this.container.classList.remove('hide');\n };\n }\n\n public async setTitleManual(count?: number) {\n const {peerId, threadId} = this.chat;\n const middleware = () => this.chat.bubbles.getMiddleware();\n let titleEl: HTMLElement, icons: Element[];\n if(this.chat.type === 'pinned') {\n if(count === undefined) titleEl = i18n('Loading');\n else titleEl = i18n('PinnedMessagesCount', [count]);\n\n if(count === undefined) {\n this.managers.appMessagesManager.getSearchCounters(peerId, [{_: 'inputMessagesFilterPinned'}], false).then((result) => {\n if(!middleware()) return;\n const count = result[0].count;\n this.setTitle(count);\n\n // ! костыль х2, это нужно делать в другом месте\n if(!count) {\n this.chat.appImManager.setPeer(); // * close tab\n\n // ! костыль, это скроет закреплённые сообщения сразу, вместо того, чтобы ждать пока анимация перехода закончится\n const originalChat = this.chat.appImManager.chat;\n if(originalChat.topbar.pinnedMessage) {\n originalChat.topbar.pinnedMessage.pinnedMessageContainer.toggle(true);\n }\n }\n });\n }\n } else if(this.chat.type === 'scheduled') {\n titleEl = i18n(peerId === rootScope.myId ? 'Reminders' : 'ScheduledMessages');\n } else if(this.chat.type === 'discussion') {\n if(count === undefined) {\n const result = await this.managers.acknowledged.appMessagesManager.getHistory(peerId, 0, 1, 0, threadId);\n if(!middleware()) return;\n if(result.cached) {\n const historyResult = await result.result;\n if(!middleware()) return;\n count = historyResult.count;\n } else result.result.then((historyResult) => {\n if(!middleware()) return;\n this.setTitle(historyResult.count);\n });\n }\n\n if(count === undefined) titleEl = i18n('Loading');\n else titleEl = i18n('Chat.Title.Comments', [count]);\n } else if(this.chat.type === 'chat') {\n [titleEl/* , icons */] = await Promise.all([\n wrapPeerTitle({\n peerId,\n dialog: true,\n withIcons: !threadId,\n threadId: threadId\n })\n // generateTitleIcons(peerId)\n ]);\n\n if(!middleware()) {\n return;\n }\n }\n\n return () => {\n replaceContent(this.title, titleEl);\n // if(icons) {\n // this.title.append(...icons);\n // }\n };\n }\n\n public setTitle(count?: number) {\n this.setTitleManual(count).then((setTitleCallback) => setTitleCallback());\n }\n\n public async setMutedState() {\n if(!this.btnMute) return;\n\n const peerId = this.peerId;\n const muted = await this.managers.appNotificationsManager.isPeerLocalMuted({peerId, respectType: false, threadId: this.chat.threadId});\n if(await this.managers.appPeersManager.isBroadcast(peerId)) { // not human\n this.btnMute.classList.remove('tgico-mute', 'tgico-unmute');\n this.btnMute.classList.add(muted ? 'tgico-unmute' : 'tgico-mute');\n this.btnMute.style.display = '';\n } else {\n this.btnMute.style.display = 'none';\n }\n }\n\n // ! У МЕНЯ ПРОСТО СГОРЕЛО, САФАРИ КОНЧЕННЫЙ БРАУЗЕР - ЕСЛИ НЕ СКРЫВАТЬ БЛОК, ТО ПРИ ПЕРЕВОРОТЕ ЭКРАНА НА АЙФОНЕ БЛОК БУДЕТ НЕПРАВИЛЬНО ШИРИНЫ, ДАЖЕ БЕЗ ЭТОЙ ФУНКЦИИ!\n public setUtilsWidth = (resize = false) => {\n // return;\n if(this.setUtilsRAF) window.cancelAnimationFrame(this.setUtilsRAF);\n\n if(IS_SAFARI && resize) {\n this.chatUtils.classList.add('hide');\n }\n\n // mutationObserver.disconnect();\n this.setUtilsRAF = window.requestAnimationFrame(() => {\n // mutationRAF = window.requestAnimationFrame(() => {\n\n // setTimeout(() => {\n if(IS_SAFARI && resize) {\n this.chatUtils.classList.remove('hide');\n }\n /* this.chatInfo.style.removeProperty('--utils-width');\n void this.chatInfo.offsetLeft; // reflow */\n const width = /* chatUtils.scrollWidth */this.chatUtils.getBoundingClientRect().width;\n this.chat.log('utils width:', width);\n this.container.style.setProperty('--utils-width', width + 'px');\n // this.chatInfo.classList.toggle('have-utils-width', !!width);\n // }, 0);\n\n this.setUtilsRAF = 0;\n\n // mutationObserver.observe(chatUtils, observeOptions);\n // });\n });\n };\n\n public setFloating = () => {\n const containers = [this.chatAudio, this.pinnedMessage?.pinnedMessageContainer].filter(Boolean);\n const count = containers.reduce((acc, container) => {\n const isFloating = container.isFloating();\n this.container.classList.toggle(`is-pinned-${container.className}-floating`, isFloating);\n\n if(!container.isVisible()) {\n return acc;\n }\n\n return acc + +isFloating;\n }, 0);\n this.container.dataset.floating = '' + count;\n };\n\n public setPeerStatusManual = async(needClear = false) => {\n if(!this.subtitle || this.chat.type !== 'chat') return;\n\n if(this.chat.threadId) {\n const title = await wrapPeerTitle({peerId: this.peerId, dialog: true});\n const span = i18n('TopicProfileStatus', [title]);\n return () => replaceContent(this.subtitle, span);\n }\n\n const peerId = this.peerId;\n return this.chat.appImManager.setPeerStatus({\n peerId,\n element: this.subtitle,\n needClear,\n useWhitespace: false,\n middleware: () => peerId === this.peerId\n });\n };\n\n public setPeerStatus = (needClear?: boolean) => {\n return this.setPeerStatusManual(needClear).then((callback) => {\n callback?.();\n });\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appSidebarRight from '..';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport AppSearch, {SearchGroup} from '../../appSearch';\nimport ButtonIcon from '../../buttonIcon';\nimport InputSearch from '../../inputSearch';\nimport PopupElement from '../../popups';\nimport PopupDatePicker from '../../popups/datePicker';\nimport {SliderSuperTab} from '../../slider';\n\nexport default class AppPrivateSearchTab extends SliderSuperTab {\n private inputSearch: InputSearch;\n private appSearch: AppSearch;\n private btnPickDate: HTMLElement;\n\n private peerId: PeerId;\n private threadId = 0;\n private query = '';\n private onDatePick: (timestamp: number) => void;\n\n onOpenAfterTimeout() {\n this.appSearch.beginSearch(this.peerId, this.threadId, this.query);\n }\n\n public init(\n peerId: PeerId,\n threadId?: number,\n onDatePick?: AppPrivateSearchTab['onDatePick'],\n query?: string\n ) {\n this.container.id = 'search-private-container';\n this.container.classList.add('chatlist-container');\n this.inputSearch = new InputSearch('Search');\n this.title.replaceWith(this.inputSearch.container);\n\n this.btnPickDate = ButtonIcon('calendar sidebar-header-right');\n this.header.append(this.btnPickDate);\n\n const c = document.createElement('div');\n c.classList.add('chatlist-container');\n this.scrollable.container.replaceWith(c);\n this.appSearch = new AppSearch(c, this.inputSearch, {\n messages: new SearchGroup('Chat.Search.PrivateSearch', 'messages')\n });\n\n if(!this.peerId) {\n this.query = query;\n this.peerId = peerId;\n this.threadId = threadId;\n this.onDatePick = onDatePick;\n\n this.btnPickDate.classList.toggle('hide', !this.onDatePick);\n if(this.onDatePick) {\n attachClickEvent(this.btnPickDate, () => {\n PopupElement.createPopup(PopupDatePicker, new Date(), this.onDatePick).show();\n });\n }\n\n query && this.appSearch.searchInput.inputField.setValueSilently(query);\n\n appSidebarRight.toggleSidebar(true);\n } else {\n this.appSearch.beginSearch(this.peerId, this.threadId, query);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ChatTopbar from './topbar';\nimport AppSearch, {SearchGroup} from '../appSearch';\nimport PopupDatePicker from '../popups/datePicker';\nimport ripple from '../ripple';\nimport InputSearch from '../inputSearch';\nimport type Chat from './chat';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport whichChild from '../../helpers/dom/whichChild';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport {i18n} from '../../lib/langPack';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport appNavigationController, {NavigationItem} from '../appNavigationController';\nimport {IS_MOBILE_SAFARI} from '../../environment/userAgent';\nimport PopupElement from '../popups';\nimport {DIALOG_LIST_ELEMENT_TAG} from '../../lib/appManagers/appDialogsManager';\n\nexport default class ChatSearch {\n private element: HTMLElement;\n private backBtn: HTMLElement;\n private inputSearch: InputSearch;\n\n private results: HTMLElement;\n\n private footer: HTMLElement;\n private dateBtn: HTMLElement;\n private foundCountEl: HTMLElement;\n private controls: HTMLElement;\n private downBtn: HTMLElement;\n private upBtn: HTMLElement;\n\n private appSearch: AppSearch;\n private searchGroup: SearchGroup;\n\n private foundCount = 0;\n private selectedIndex = 0;\n private setPeerPromise: Promise;\n private listenerSetter: ListenerSetter;\n private navigationItem: NavigationItem;\n\n constructor(private topbar: ChatTopbar, private chat: Chat, query?: string) {\n this.element = document.createElement('div');\n this.element.classList.add('sidebar-header', 'chat-search', 'chatlist-container');\n\n this.backBtn = document.createElement('button');\n this.backBtn.classList.add('btn-icon', 'tgico-left', 'sidebar-close-button');\n ripple(this.backBtn);\n\n const listenerSetter = this.listenerSetter = new ListenerSetter();\n\n const attachClick = (element: HTMLElement, callback: (e: MouseEvent) => void) => {\n attachClickEvent(element, callback, {listenerSetter});\n };\n\n attachClick(this.backBtn, () => {\n this.destroy();\n });\n\n this.inputSearch = new InputSearch('Search');\n\n // Results\n this.results = document.createElement('div');\n this.results.classList.add('chat-search-results', 'chatlist-container');\n\n this.searchGroup = new SearchGroup(false, 'messages', undefined, '', false);\n attachClick(this.searchGroup.list, this.onResultsClick);\n\n this.appSearch = new AppSearch(this.results, this.inputSearch, {\n messages: this.searchGroup\n }, (count) => {\n this.foundCount = count;\n\n if(!this.foundCount) {\n replaceContent(this.foundCountEl, this.inputSearch.value ? i18n('NoResult') : '');\n this.results.classList.remove('active');\n this.chat.bubbles.container.classList.remove('search-results-active');\n this.upBtn.setAttribute('disabled', 'true');\n this.downBtn.setAttribute('disabled', 'true');\n } else {\n this.selectResult(this.searchGroup.list.children[0] as HTMLElement);\n }\n });\n this.appSearch.beginSearch(this.chat.peerId, this.chat.threadId);\n\n // appImManager.topbar.parentElement.insertBefore(this.results, appImManager.bubblesContainer);\n this.chat.bubbles.container.append(this.results);\n\n // Footer\n this.footer = document.createElement('div');\n this.footer.classList.add('chat-search-footer');\n\n attachClick(this.footer, this.onFooterClick);\n ripple(this.footer);\n\n this.foundCountEl = document.createElement('span');\n this.foundCountEl.classList.add('chat-search-count');\n\n this.dateBtn = document.createElement('button');\n this.dateBtn.classList.add('btn-icon', 'tgico-calendar');\n\n this.controls = document.createElement('div');\n this.controls.classList.add('chat-search-controls');\n\n this.upBtn = document.createElement('button');\n this.upBtn.classList.add('btn-icon', 'tgico-up');\n this.downBtn = document.createElement('button');\n this.downBtn.classList.add('btn-icon', 'tgico-down');\n\n this.upBtn.setAttribute('disabled', 'true');\n this.downBtn.setAttribute('disabled', 'true');\n\n attachClick(this.dateBtn, this.onDateClick);\n attachClick(this.upBtn, this.onUpClick);\n attachClick(this.downBtn, this.onDownClick);\n this.controls.append(this.upBtn, this.downBtn);\n\n this.footer.append(this.foundCountEl, this.dateBtn, this.controls);\n\n this.topbar.container.parentElement.insertBefore(this.footer, chat.input.chatInput);\n\n // Append container\n this.element.append(this.backBtn, this.inputSearch.container);\n\n this.topbar.container.classList.add('hide-pinned');\n this.topbar.container.parentElement.append(this.element);\n\n this.inputSearch.input.focus();\n\n if(query) {\n this.setQuery(query);\n }\n\n if(!IS_MOBILE_SAFARI) {\n this.navigationItem = {\n type: 'mobile-search',\n onPop: () => {\n this.destroy();\n }\n };\n\n appNavigationController.pushItem(this.navigationItem);\n }\n }\n\n public destroy() {\n this.topbar.container.classList.remove('hide-pinned');\n this.element.remove();\n this.inputSearch.remove();\n this.results.remove();\n this.footer.remove();\n this.listenerSetter.removeAll();\n this.chat.bubbles.container.classList.remove('search-results-active');\n this.chat.search = undefined;\n appNavigationController.removeItem(this.navigationItem);\n }\n\n public setQuery(query: string) {\n this.inputSearch.inputField.value = query;\n }\n\n private onDateClick = (e: MouseEvent) => {\n cancelEvent(e);\n PopupElement.createPopup(PopupDatePicker, new Date(), this.chat.bubbles.onDatePick).show();\n };\n\n private selectResult(elem: HTMLElement) {\n if(this.setPeerPromise) return this.setPeerPromise;\n\n const peerId = elem.dataset.peerId.toPeerId();\n const lastMsgId = +elem.dataset.mid || undefined;\n\n const index = whichChild(elem);\n\n if(index === (this.foundCount - 1)) {\n this.upBtn.setAttribute('disabled', 'true');\n } else {\n this.upBtn.removeAttribute('disabled');\n }\n\n if(!index) {\n this.downBtn.setAttribute('disabled', 'true');\n } else {\n this.downBtn.removeAttribute('disabled');\n }\n\n this.results.classList.remove('active');\n this.chat.bubbles.container.classList.remove('search-results-active');\n\n const res = this.chat.setPeer({peerId, lastMsgId});\n this.setPeerPromise = ((res instanceof Promise ? res : Promise.resolve(res)) as Promise).then(() => {\n this.selectedIndex = index;\n replaceContent(this.foundCountEl, i18n('Of', [index + 1, this.foundCount]));\n\n const renderedCount = this.searchGroup.list.childElementCount;\n if(this.selectedIndex >= (renderedCount - 6)) {\n this.appSearch.searchMore();\n }\n }).finally(() => {\n this.setPeerPromise = null;\n });\n }\n\n private onResultsClick = (e: MouseEvent) => {\n const target = findUpTag(e.target, DIALOG_LIST_ELEMENT_TAG);\n if(target) {\n this.selectResult(target);\n }\n };\n\n private onFooterClick = (e: MouseEvent) => {\n if(this.foundCount) {\n this.chat.bubbles.container.classList.toggle('search-results-active');\n this.results.classList.toggle('active');\n }\n };\n\n private onUpClick = (e: MouseEvent) => {\n cancelEvent(e);\n this.selectResult(this.searchGroup.list.children[this.selectedIndex + 1] as HTMLElement);\n };\n\n private onDownClick = (e: MouseEvent) => {\n cancelEvent(e);\n this.selectResult(this.searchGroup.list.children[this.selectedIndex - 1] as HTMLElement);\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport deepEqual from '../../helpers/object/deepEqual';\nimport {renderImageFromUrlPromise} from '../../helpers/dom/renderImageFromUrl';\nimport mediaSizes, {ScreenSize} from '../../helpers/mediaSizes';\nimport windowSize from '../../helpers/windowSize';\nimport IS_IMAGE_BITMAP_SUPPORTED from '../../environment/imageBitmapSupport';\n\ntype ChatBackgroundPatternRendererInitOptions = {\n url: string,\n width: number,\n height: number,\n mask?: boolean\n};\n\nexport default class ChatBackgroundPatternRenderer {\n private static INSTANCES: ChatBackgroundPatternRenderer[] = [];\n\n // private pattern: CanvasPattern;\n private objectUrl: string;\n private options: ChatBackgroundPatternRendererInitOptions;\n private canvases: Set;\n // private createCanvasPatternPromise: Promise;\n // private exportCanvasPatternToImagePromise: Promise;\n private renderImageFromUrlPromise: Promise;\n private image: HTMLImageElement;\n private imageBitmap: ImageBitmap;\n\n constructor() {\n this.canvases = new Set();\n }\n\n public static getInstance(options: ChatBackgroundPatternRendererInitOptions) {\n let instance = this.INSTANCES.find((instance) => {\n return deepEqual(instance.options, options);\n });\n\n if(!instance) {\n instance = new ChatBackgroundPatternRenderer();\n instance.init(options);\n this.INSTANCES.push(instance);\n }\n\n return instance;\n }\n\n public init(options: ChatBackgroundPatternRendererInitOptions) {\n // if(this.options) {\n // if(this.options.width !== options.width || this.options.height !== options.height) {\n // this.createCanvasPatternPromise =\n // this.pattern =\n // this.exportCanvasPatternToImagePromise =\n // undefined;\n // }\n // }\n\n this.options = options;\n }\n\n public renderToCanvas(canvas: HTMLCanvasElement) {\n // return this.createCanvasPattern(canvas).then(() => {\n // return this.fillCanvas(canvas);\n // });\n\n return this.renderImageFromUrl(this.options.url).then(() => {\n return this.fillCanvas(canvas);\n });\n }\n\n private renderImageFromUrl(url: string) {\n if(this.renderImageFromUrlPromise) return this.renderImageFromUrlPromise;\n const img = this.image = document.createElement('img');\n img.crossOrigin = 'anonymous';\n return this.renderImageFromUrlPromise = renderImageFromUrlPromise(img, url, false).then(() => {\n if(!IS_IMAGE_BITMAP_SUPPORTED) {\n return img;\n }\n\n return createImageBitmap(img, {\n resizeWidth: 1440,\n resizeHeight: 2960\n }).then((imageBitmap) => {\n this.imageBitmap = imageBitmap;\n return img;\n });\n });\n }\n\n /* private createCanvasPattern(canvas: HTMLCanvasElement) {\n if(this.createCanvasPatternPromise) return this.createCanvasPatternPromise;\n return this.createCanvasPatternPromise = this.renderImageFromUrl(this.options.url).then((img) => {\n let createPatternFrom: HTMLImageElement | HTMLCanvasElement;\n if(IS_SAFARI) {\n const canvas = createPatternFrom = document.createElement('canvas');\n canvas.width = img.naturalWidth;\n canvas.height = img.naturalHeight;\n const ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n } else {\n createPatternFrom = img;\n }\n\n const perf = performance.now();\n this.pattern = canvas.getContext('2d').createPattern(createPatternFrom, 'repeat-x');\n console.warn('creating pattern time:', performance.now() - perf);\n\n return this.pattern;\n });\n }\n\n public exportCanvasPatternToImage(canvas: HTMLCanvasElement) {\n if(this.exportCanvasPatternToImagePromise) return this.exportCanvasPatternToImagePromise;\n return this.exportCanvasPatternToImagePromise = new Promise((resolve) => {\n canvas.toBlob((blob) => {\n const newUrl = this.objectUrl = URL.createObjectURL(blob);\n resolve(newUrl);\n }, 'image/png');\n });\n } */\n\n public cleanup(canvas: HTMLCanvasElement) {\n this.canvases.delete(canvas);\n\n if(!this.canvases.size) {\n indexOfAndSplice(ChatBackgroundPatternRenderer.INSTANCES, this);\n\n if(this.objectUrl) {\n this.imageBitmap?.close();\n URL.revokeObjectURL(this.objectUrl);\n }\n }\n }\n\n public fillCanvas(canvas: HTMLCanvasElement) {\n const context = canvas.getContext('2d');\n const {width, height} = canvas;\n // const perf = performance.now();\n // if(context.fillStyle instanceof CanvasPattern) {\n // context.clearRect(0, 0, width, height);\n // }\n\n const source = this.imageBitmap || this.image;\n\n let imageWidth = source.width, imageHeight = source.height;\n // let patternHeight = 1480 * canvas.dpr;\n // if(+canvas.dataset.originalHeight !== height) patternHeight *= .6875;\n const patternHeight = (500 + (windowSize.height / 2.5)) * canvas.dpr;\n const ratio = patternHeight / imageHeight;\n imageWidth *= ratio;\n imageHeight = patternHeight;\n\n if(this.options.mask) {\n context.fillStyle = '#000';\n context.fillRect(0, 0, width, height);\n context.globalCompositeOperation = 'destination-out';\n } else {\n context.globalCompositeOperation = 'source-over';\n }\n\n const d = (y: number) => {\n for(let x = 0; x < width; x += imageWidth) {\n context.drawImage(source, x, y, imageWidth, imageHeight);\n }\n };\n\n const centerY = (height - imageHeight) / 2;\n d(centerY);\n\n if(centerY > 0) {\n let topY = centerY;\n do {\n d(topY -= imageHeight);\n } while(topY >= 0);\n }\n\n const endY = height - 1;\n for(let bottomY = centerY + imageHeight; bottomY < endY; bottomY += imageHeight) {\n d(bottomY);\n }\n\n // for(let x = 0; x < width; x += imageWidth) {\n // for(let y = 0; y < height; y += imageHeight) {\n // context.drawImage(img, x, y, imageWidth, imageHeight);\n // }\n // }\n // context.fillStyle = this.pattern;\n // context.fillRect(0, 0, width, height);\n // console.warn('fill canvas time', performance.now() - perf);\n }\n\n public setCanvasDimensions(canvas: HTMLCanvasElement) {\n const devicePixelRatio = Math.min(2, window.devicePixelRatio);\n const width = this.options.width * devicePixelRatio;\n let height = this.options.height * devicePixelRatio;\n\n canvas.dpr = devicePixelRatio;\n canvas.dataset.originalHeight = '' + height;\n if(mediaSizes.activeScreen === ScreenSize.large) height *= 1.5;\n canvas.width = width;\n canvas.height = height;\n }\n\n public createCanvas() {\n const canvas = document.createElement('canvas');\n this.canvases.add(canvas);\n this.setCanvasDimensions(canvas);\n return canvas;\n }\n\n public resize(width: number, height: number) {\n this.init({\n ...this.options,\n width,\n height\n });\n\n const promises: Promise[] = [];\n for(const canvas of this.canvases) {\n this.setCanvasDimensions(canvas);\n promises.push(this.renderToCanvas(canvas));\n }\n\n return Promise.all(promises);\n }\n\n public static resizeInstances(width: number, height: number) {\n return Promise.all(this.INSTANCES.map((instance) => instance.resize(width, height)));\n }\n\n /* public setResizeMode(resizing: boolean) {\n const canvases = Array.from(this.canvases);\n const canvas = canvases[canvases.length - 1];\n canvas.style.display = resizing ? 'none' : '';\n const img = this.img;\n img.style.display = resizing ? '' : 'none';\n\n return {img, canvas};\n } */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {ChatRights} from '../../lib/appManagers/appChatsManager';\nimport {AppImManager, APP_TABS, ChatSetPeerOptions} from '../../lib/appManagers/appImManager';\nimport type {MessageSendingParams, MessagesStorageKey} from '../../lib/appManagers/appMessagesManager';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport {logger, LogTypes} from '../../lib/logger';\nimport rootScope from '../../lib/rootScope';\nimport appSidebarRight from '../sidebarRight';\nimport ChatBubbles from './bubbles';\nimport ChatContextMenu from './contextMenu';\nimport ChatInput from './input';\nimport ChatSelection from './selection';\nimport ChatTopbar from './topbar';\nimport {NULL_PEER_ID, REPLIES_PEER_ID} from '../../lib/mtproto/mtproto_config';\nimport SetTransition from '../singleTransition';\nimport AppPrivateSearchTab from '../sidebarRight/tabs/search';\nimport renderImageFromUrl from '../../helpers/dom/renderImageFromUrl';\nimport mediaSizes, {ScreenSize} from '../../helpers/mediaSizes';\nimport ChatSearch from './search';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport getAutoDownloadSettingsByPeerId, {ChatAutoDownloadSettings} from '../../helpers/autoDownload';\nimport ChatBackgroundGradientRenderer from './gradientRenderer';\nimport ChatBackgroundPatternRenderer from './patternRenderer';\nimport pause from '../../helpers/schedulers/pause';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport SlicedArray from '../../helpers/slicedArray';\nimport themeController from '../../helpers/themeController';\nimport AppSharedMediaTab from '../sidebarRight/tabs/sharedMedia';\nimport noop from '../../helpers/noop';\nimport middlewarePromise from '../../helpers/middlewarePromise';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport {Message, WallPaper} from '../../layer';\nimport animationIntersector, {AnimationItemGroup} from '../animationIntersector';\nimport {getColorsFromWallPaper} from '../../helpers/color';\nimport liteMode from '../../helpers/liteMode';\n\nexport type ChatType = 'chat' | 'pinned' | 'discussion' | 'scheduled';\n\nexport default class Chat extends EventListenerBase<{\n setPeer: (mid: number, isTopMessage: boolean) => void\n}> {\n public container: HTMLElement;\n public backgroundEl: HTMLElement;\n\n public topbar: ChatTopbar;\n public bubbles: ChatBubbles;\n public input: ChatInput;\n public selection: ChatSelection;\n public contextMenu: ChatContextMenu;\n public search: ChatSearch;\n\n public wasAlreadyUsed: boolean;\n // public initPeerId = 0;\n public peerId: PeerId;\n public threadId: number;\n public setPeerPromise: Promise;\n public peerChanged: boolean;\n\n public log: ReturnType;\n\n public type: ChatType;\n public messagesStorageKey: MessagesStorageKey;\n\n public noForwards: boolean;\n\n public inited: boolean;\n\n public isRestricted: boolean;\n public autoDownload: ChatAutoDownloadSettings;\n\n public gradientRenderer: ChatBackgroundGradientRenderer;\n public patternRenderer: ChatBackgroundPatternRenderer;\n public gradientCanvas: HTMLCanvasElement;\n public patternCanvas: HTMLCanvasElement;\n public backgroundTempId: number;\n public setBackgroundPromise: Promise;\n public sharedMediaTab: AppSharedMediaTab;\n public sharedMediaTabs: AppSharedMediaTab[];\n // public renderDarkPattern: () => Promise;\n\n public isBot: boolean;\n public isChannel: boolean;\n public isBroadcast: boolean;\n public isAnyGroup: boolean;\n public isMegagroup: boolean;\n public isForum: boolean;\n public isAllMessagesForum: boolean;\n public isAnonymousSending: boolean;\n\n public animationGroup: AnimationItemGroup;\n\n constructor(\n public appImManager: AppImManager,\n public managers: AppManagers\n ) {\n super();\n\n this.type = 'chat';\n this.animationGroup = `chat-${Math.round(Math.random() * 65535)}`;\n\n this.container = document.createElement('div');\n this.container.classList.add('chat', 'tabs-tab');\n\n this.backgroundEl = document.createElement('div');\n this.backgroundEl.classList.add('chat-background');\n\n // * constructor end\n\n this.log = logger('CHAT', LogTypes.Log | LogTypes.Warn | LogTypes.Debug | LogTypes.Error);\n this.log.warn('constructor');\n\n this.peerId = NULL_PEER_ID;\n\n this.container.append(this.backgroundEl);\n this.appImManager.chatsContainer.append(this.container);\n\n this.backgroundTempId = 0;\n this.sharedMediaTabs = [];\n }\n\n public setBackground(url: string, skipAnimation?: boolean): Promise {\n const theme = themeController.getTheme();\n const themeSettings = theme.settings;\n const wallPaper = themeSettings.wallpaper;\n const colors = getColorsFromWallPaper(wallPaper);\n\n let item: HTMLElement;\n const isColorBackground = !!colors && !(wallPaper as WallPaper.wallPaper).slug && !wallPaper.settings.intensity;\n if(\n isColorBackground &&\n document.documentElement.style.cursor === 'grabbing' &&\n this.gradientRenderer &&\n !this.patternRenderer\n ) {\n this.gradientCanvas.dataset.colors = colors;\n this.gradientRenderer.init(this.gradientCanvas);\n return Promise.resolve();\n }\n\n const tempId = ++this.backgroundTempId;\n\n const previousGradientRenderer = this.gradientRenderer;\n const previousPatternRenderer = this.patternRenderer;\n const previousGradientCanvas = this.gradientCanvas;\n const previousPatternCanvas = this.patternCanvas;\n\n this.gradientRenderer =\n this.patternRenderer =\n this.gradientCanvas =\n this.patternCanvas =\n // this.renderDarkPattern =\n undefined;\n\n const intensity = wallPaper.settings?.intensity && wallPaper.settings.intensity / 100;\n const isDarkPattern = !!intensity && intensity < 0;\n\n let patternRenderer: ChatBackgroundPatternRenderer;\n let patternCanvas = item?.firstElementChild as HTMLCanvasElement;\n let gradientCanvas: HTMLCanvasElement;\n if(!item) {\n item = document.createElement('div');\n item.classList.add('chat-background-item');\n\n if(url) {\n if(intensity) {\n item.classList.add('is-pattern');\n\n const rect = this.appImManager.chatsContainer.getBoundingClientRect();\n patternRenderer = this.patternRenderer = ChatBackgroundPatternRenderer.getInstance({\n url,\n width: rect.width,\n height: rect.height,\n mask: isDarkPattern\n });\n\n patternCanvas = this.patternCanvas = patternRenderer.createCanvas();\n patternCanvas.classList.add('chat-background-item-canvas', 'chat-background-item-pattern-canvas');\n\n if(isDarkPattern) {\n item.classList.add('is-dark');\n }\n\n // if(isDarkPattern) {\n // this.renderDarkPattern = () => {\n // return patternRenderer.exportCanvasPatternToImage(patternCanvas).then((url) => {\n // if(this.backgroundTempId !== tempId) {\n // return;\n // }\n\n // gradientCanvas.style.webkitMaskImage = `url(${url})`;\n // });\n // };\n // }\n } else {\n item.classList.add('is-image');\n }\n } else {\n item.classList.add('is-color');\n }\n }\n\n let gradientRenderer: ChatBackgroundGradientRenderer;\n if(colors) {\n // if(color.includes(',')) {\n const {canvas, gradientRenderer: _gradientRenderer} = ChatBackgroundGradientRenderer.create(colors);\n gradientRenderer = this.gradientRenderer = _gradientRenderer;\n gradientCanvas = this.gradientCanvas = canvas;\n gradientCanvas.classList.add('chat-background-item-canvas', 'chat-background-item-color-canvas');\n\n if(liteMode.isAvailable('animations')) {\n gradientRenderer.scrollAnimate(true);\n }\n // } else {\n // item.style.backgroundColor = color;\n // item.style.backgroundImage = 'none';\n // }\n }\n\n if(patternRenderer) {\n const setOpacityTo = isDarkPattern ? gradientCanvas : patternCanvas;\n let opacityMax = Math.abs(intensity) * (isDarkPattern ? .5 : 1);\n if(isDarkPattern) {\n opacityMax = Math.max(0.3, opacityMax);\n }\n setOpacityTo.style.setProperty('--opacity-max', '' + opacityMax);\n }\n\n const promise = new Promise((resolve) => {\n const cb = () => {\n if(this.backgroundTempId !== tempId) {\n if(patternRenderer) {\n patternRenderer.cleanup(patternCanvas);\n }\n\n if(gradientRenderer) {\n gradientRenderer.cleanup();\n }\n\n return;\n }\n\n const prev = this.backgroundEl.lastElementChild as HTMLElement;\n\n if(prev === item) {\n resolve();\n return;\n }\n\n const append = [\n gradientCanvas,\n // isDarkPattern && this.renderDarkPattern ? undefined : patternCanvas\n patternCanvas\n ].filter(Boolean);\n if(append.length) {\n item.append(...append);\n }\n\n this.backgroundEl.append(item);\n\n SetTransition({\n element: item,\n className: 'is-visible',\n forwards: true,\n duration: !skipAnimation ? 200 : 0,\n onTransitionEnd: prev ? () => {\n previousPatternRenderer?.cleanup(previousPatternCanvas);\n previousGradientRenderer?.cleanup();\n\n prev.remove();\n } : null,\n useRafs: 2\n });\n\n resolve();\n };\n\n if(patternRenderer) {\n const renderPatternPromise = patternRenderer.renderToCanvas(patternCanvas);\n renderPatternPromise.then(() => {\n if(this.backgroundTempId !== tempId) {\n return;\n }\n\n // let promise: Promise;\n // if(isDarkPattern && this.renderDarkPattern) {\n // promise = this.renderDarkPattern();\n // } else {\n // const promise = Promise.resolve();\n // }\n\n // promise.then(cb);\n cb();\n });\n } else if(url) {\n renderImageFromUrl(item, url, cb);\n } else {\n cb();\n }\n });\n\n return this.setBackgroundPromise = Promise.race([\n pause(500),\n promise\n ]);\n }\n\n public setType(type: ChatType) {\n this.type = type;\n }\n\n public init(/* peerId: PeerId */) {\n // this.initPeerId = peerId;\n\n this.topbar = new ChatTopbar(this, appSidebarRight, this.managers);\n this.bubbles = new ChatBubbles(this, this.managers);\n this.input = new ChatInput(this, this.appImManager, this.managers);\n this.contextMenu = new ChatContextMenu(this, this.managers);\n this.selection = new ChatSelection(this, this.bubbles, this.input, this.managers);\n\n this.topbar.constructUtils();\n this.topbar.constructPeerHelpers();\n\n this.topbar.construct();\n this.input.construct();\n\n this.bubbles.constructPeerHelpers();\n this.input.constructPeerHelpers();\n\n if(!IS_TOUCH_SUPPORTED) {\n this.bubbles.setReactionsHoverListeners();\n }\n\n this.bubbles.attachContainerListeners();\n\n this.container.append(this.topbar.container, this.bubbles.container, this.input.chatInput);\n\n this.bubbles.listenerSetter.add(rootScope)('dialog_migrate', ({migrateFrom, migrateTo}) => {\n if(this.peerId === migrateFrom) {\n this.setPeer({peerId: migrateTo});\n }\n });\n\n this.bubbles.listenerSetter.add(rootScope)('dialog_drop', (dialog) => {\n if(dialog.peerId === this.peerId && (dialog._ === 'dialog' || this.threadId === dialog.id)) {\n this.appImManager.setPeer();\n }\n });\n\n this.bubbles.listenerSetter.add(rootScope)('chat_update', async(chatId) => {\n const {peerId} = this;\n if(peerId.isAnyChat() && peerId.toChatId() === chatId) {\n const isAnonymousSending = await this.managers.appMessagesManager.isAnonymousSending(peerId);\n if(peerId === this.peerId) {\n this.isAnonymousSending = isAnonymousSending;\n }\n }\n });\n\n const freezeObservers = (freeze: boolean) => {\n const cb = () => {\n this.bubbles.observer?.toggleObservingNew(freeze);\n animationIntersector.toggleIntersectionGroup(this.animationGroup, freeze);\n if(freeze) {\n animationIntersector.checkAnimations(freeze, this.animationGroup);\n }\n };\n\n if(!freeze) {\n setTimeout(() => {\n cb();\n }, 400);\n } else {\n cb();\n }\n };\n\n this.bubbles.listenerSetter.add(this.appImManager)('chat_changing', ({to}) => {\n freezeObservers(to !== this);\n });\n\n this.bubbles.listenerSetter.add(this.appImManager)('tab_changing', (tabId) => {\n freezeObservers(this.appImManager.chat !== this || (tabId !== APP_TABS.CHAT && mediaSizes.activeScreen === ScreenSize.mobile));\n });\n }\n\n public beforeDestroy() {\n this.bubbles.cleanup();\n }\n\n private cleanupBackground() {\n ++this.backgroundTempId;\n if(this.patternRenderer) {\n this.patternRenderer.cleanup(this.patternCanvas);\n this.patternRenderer = undefined;\n }\n\n if(this.gradientRenderer) {\n this.gradientRenderer.cleanup();\n this.gradientRenderer = undefined;\n }\n }\n\n public destroy() {\n // const perf = performance.now();\n\n this.destroySharedMediaTab();\n this.topbar.destroy();\n this.bubbles.destroy();\n this.input.destroy();\n this.contextMenu && this.contextMenu.destroy();\n this.selection && this.selection.attachListeners(undefined, undefined);\n\n this.cleanupBackground();\n\n delete this.topbar;\n delete this.bubbles;\n delete this.input;\n delete this.selection;\n delete this.contextMenu;\n\n this.container.remove();\n\n // this.log.error('Chat destroy time:', performance.now() - perf);\n }\n\n public cleanup(helperToo = true) {\n this.input.cleanup(helperToo);\n this.topbar.cleanup();\n this.selection.cleanup();\n }\n\n public get isForumTopic() {\n return !!(this.isForum && this.threadId);\n }\n\n public async onChangePeer(options: ChatSetPeerOptions, m: ReturnType) {\n const {peerId, threadId} = this;\n\n const searchTab = appSidebarRight.getTab(AppPrivateSearchTab);\n searchTab?.close();\n\n const [\n noForwards,\n isRestricted,\n isAnyGroup,\n _,\n isMegagroup,\n isBroadcast,\n isChannel,\n isBot,\n isForum,\n isAnonymousSending\n ] = await m(Promise.all([\n this.managers.appPeersManager.noForwards(peerId),\n this.managers.appPeersManager.isPeerRestricted(peerId),\n this._isAnyGroup(peerId),\n this.setAutoDownloadMedia(),\n this.managers.appPeersManager.isMegagroup(peerId),\n this.managers.appPeersManager.isBroadcast(peerId),\n this.managers.appPeersManager.isChannel(peerId),\n this.managers.appPeersManager.isBot(peerId),\n this.managers.appPeersManager.isForum(peerId),\n this.managers.appMessagesManager.isAnonymousSending(peerId)\n ]));\n\n // ! WARNING: TEMPORARY, HAVE TO GET TOPIC\n if(isForum && threadId) {\n await m(this.managers.dialogsStorage.getForumTopicOrReload(peerId, threadId));\n }\n\n this.noForwards = noForwards;\n this.isRestricted = isRestricted;\n this.isAnyGroup = isAnyGroup;\n this.isMegagroup = isMegagroup;\n this.isBroadcast = isBroadcast;\n this.isChannel = isChannel;\n this.isBot = isBot;\n this.isForum = isForum;\n this.isAllMessagesForum = isForum && !threadId;\n this.isAnonymousSending = isAnonymousSending;\n\n if(threadId && !this.isForum) {\n options.type = 'discussion';\n }\n\n const type = options.type ?? 'chat';\n this.setType(type);\n\n this.messagesStorageKey = `${this.peerId}_${this.type === 'scheduled' ? 'scheduled' : 'history'}`;\n\n this.container.classList.toggle('no-forwards', this.noForwards);\n\n this.sharedMediaTab = appSidebarRight.createSharedMediaTab();\n this.sharedMediaTabs.push(this.sharedMediaTab);\n\n this.sharedMediaTab.setPeer(peerId, threadId);\n this.input.clearHelper(); // костыль\n this.selection.cleanup(); // TODO: REFACTOR !!!!!!\n }\n\n public setPeer(options: ChatSetPeerOptions) {\n const {peerId, threadId} = options;\n if(!peerId) {\n this.inited = undefined;\n } else if(!this.inited) {\n if(this.init) {\n this.init(/* peerId */);\n this.init = null;\n }\n\n this.inited = true;\n }\n\n // const appMediaViewer = (window as any).appMediaViewer as AppMediaViewerBase;\n // if(appMediaViewer) {\n // appMediaViewer.close();\n // }\n\n const samePeer = this.appImManager.isSamePeer(this, options);\n if(!samePeer) {\n this.appImManager.dispatchEvent('peer_changing', this);\n this.peerId = peerId || NULL_PEER_ID;\n this.threadId = threadId;\n } else if(this.setPeerPromise) {\n return;\n }\n\n if(!peerId) {\n appSidebarRight.toggleSidebar(false);\n this.cleanup(true);\n this.bubbles.setPeer({samePeer: false, peerId});\n this.peerId = 0;\n this.appImManager.dispatchEvent('peer_changed', this);\n\n appSidebarRight.replaceSharedMediaTab();\n this.destroySharedMediaTab();\n this.sharedMediaTab = undefined;\n\n return;\n }\n\n this.peerChanged = samePeer;\n\n const bubblesSetPeerPromise = this.bubbles.setPeer({...options, samePeer});\n const setPeerPromise = this.setPeerPromise = bubblesSetPeerPromise.then((result) => {\n return result.promise;\n }).catch(noop).finally(() => {\n if(this.setPeerPromise === setPeerPromise) {\n this.setPeerPromise = null;\n }\n });\n\n return bubblesSetPeerPromise;\n }\n\n public destroySharedMediaTab(tab = this.sharedMediaTab) {\n if(!tab) {\n return;\n }\n\n indexOfAndSplice(this.sharedMediaTabs, tab);\n tab.destroy();\n }\n\n public async setAutoDownloadMedia() {\n this.autoDownload = await getAutoDownloadSettingsByPeerId(this.peerId);\n }\n\n public setMessageId(messageId?: number, mediaTimestamp?: number) {\n return this.setPeer({\n peerId: this.peerId,\n threadId: this.threadId,\n lastMsgId: messageId,\n mediaTimestamp\n });\n }\n\n public async finishPeerChange(isTarget: boolean, isJump: boolean, lastMsgId: number, startParam?: string) {\n if(this.peerChanged) return;\n\n const peerId = this.peerId;\n this.peerChanged = true;\n this.wasAlreadyUsed = true;\n\n const middleware = this.bubbles.getMiddleware();\n\n this.cleanup(false);\n\n const sharedMediaTab = this.sharedMediaTab;\n\n const callbacksPromise = Promise.all([\n this.topbar.finishPeerChange(isTarget),\n this.bubbles.finishPeerChange(),\n this.input.finishPeerChange(startParam),\n sharedMediaTab.fillProfileElements()\n ]);\n\n const callbacks = await callbacksPromise;\n sharedMediaTab.loadSidebarMedia(true);\n\n if(!middleware()) {\n return;\n }\n\n callbacks.forEach((callback) => {\n callback?.();\n });\n\n appSidebarRight.replaceSharedMediaTab(sharedMediaTab);\n\n this.sharedMediaTabs.filter((tab) => tab !== sharedMediaTab).forEach((tab) => this.destroySharedMediaTab(tab));\n\n this.container.dataset.type = this.type;\n this.log.setPrefix('CHAT-' + peerId + '-' + this.type);\n\n this.appImManager.dispatchEvent('peer_changed', this);\n }\n\n public getMessage(mid: number) {\n return this.managers.appMessagesManager.getMessageFromStorage(this.messagesStorageKey, mid);\n }\n\n public async getMidsByMid(mid: number) {\n return this.managers.appMessagesManager.getMidsByMessage(await this.getMessage(mid));\n }\n\n public getHistoryStorage(ignoreThreadId?: boolean) {\n return this.managers.appMessagesManager.getHistoryStorageTransferable(this.peerId, ignoreThreadId ? undefined : this.threadId)\n .then((historyStorageTransferable) => {\n return {\n ...historyStorageTransferable,\n history: SlicedArray.fromJSON(historyStorageTransferable.historySerialized)\n }\n });\n }\n\n public getDialogOrTopic() {\n return this.isForum && this.threadId ? this.managers.dialogsStorage.getForumTopic(this.peerId, this.threadId) : this.managers.dialogsStorage.getDialogOnly(this.peerId);\n }\n\n public getHistoryMaxId() {\n return this.getHistoryStorage().then((historyStorage) => historyStorage.maxId);\n }\n\n public async _isAnyGroup(peerId: PeerId) {\n return peerId === rootScope.myId || peerId === REPLIES_PEER_ID || (await this.managers.appPeersManager.isAnyGroup(peerId));\n }\n\n public initSearch(query?: string) {\n if(!this.peerId) return;\n\n if(mediaSizes.isMobile) {\n if(!this.search) {\n this.search = new ChatSearch(this.topbar, this, query);\n } else {\n this.search.setQuery(query);\n }\n } else {\n let tab = appSidebarRight.getTab(AppPrivateSearchTab);\n if(!tab) {\n tab = appSidebarRight.createTab(AppPrivateSearchTab);\n }\n\n tab.open(this.peerId, this.threadId, this.bubbles.onDatePick, query);\n }\n }\n\n public canSend(action?: ChatRights) {\n return this.managers.appMessagesManager.canSendToPeer(this.peerId, this.threadId, action);\n }\n\n public isStartButtonNeeded() {\n return Promise.all([\n this.managers.appPeersManager.isBot(this.peerId),\n this.managers.appMessagesManager.getDialogOnly(this.peerId),\n this.getHistoryStorage(true)\n ]).then(([isBot, dialog, historyStorage]) => {\n return isBot && !dialog && !historyStorage.history.length;\n });\n }\n\n public getMessageSendingParams(): MessageSendingParams {\n return {\n threadId: this.threadId,\n replyToMsgId: this.input.replyToMsgId,\n scheduleDate: this.input.scheduleDate,\n silent: this.input.sendSilent,\n sendAsPeerId: this.input.sendAsPeerId,\n updateStickersetOrder: rootScope.settings.stickers.dynamicPackOrder\n };\n }\n\n public isOurMessage(message: Message.message | Message.messageService) {\n return message.fromId === rootScope.myId || (!!message.pFlags.out && this.isMegagroup);\n }\n\n public isOutMessage(message: Message.message | Message.messageService) {\n const fwdFrom = (message as Message.message).fwd_from;\n const isOut = this.isOurMessage(message) && (!fwdFrom || this.peerId !== rootScope.myId);\n return !!isOut;\n }\n\n public isAvatarNeeded(message: Message.message | Message.messageService) {\n return this.isAnyGroup && !this.isOutMessage(message);\n }\n\n public isPinnedMessagesNeeded() {\n return this.type === 'chat' || this.isForum;\n }\n\n public canGiftPremium() {\n const peerId = this.peerId;\n return peerId.isUser() && this.managers.appProfileManager.canGiftPremium(this.peerId.toUserId());\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {State} from '../config/state';\nimport rootScope from '../lib/rootScope';\n\nexport type ChatAutoDownloadSettings = {\n photo: number,\n video: number,\n file: number\n};\n\nexport default async function getAutoDownloadSettingsByPeerId(peerId: PeerId): Promise {\n let type: keyof State['settings']['autoDownload'];\n\n let photoSizeMax = 0, videoSizeMax = 0, fileSizeMax = 0;\n const settings = rootScope.settings;\n const appPeersManager = rootScope.managers.appPeersManager;\n if(!settings.autoDownloadNew.pFlags.disabled && peerId) {\n if(peerId.isUser()) {\n if(await appPeersManager.isContact(peerId)) {\n type = 'contacts';\n } else {\n type = 'private';\n }\n } else if(await appPeersManager.isBroadcast(peerId)) {\n type = 'channels';\n } else {\n type = 'groups';\n }\n\n if(settings.autoDownload.photo[type]) photoSizeMax = settings.autoDownloadNew.photo_size_max;\n if(settings.autoDownload.video[type]) videoSizeMax = settings.autoDownloadNew.video_size_max;\n if(settings.autoDownload.file[type]) fileSizeMax = settings.autoDownloadNew.file_size_max;\n }\n\n return {\n photo: photoSizeMax,\n video: videoSizeMax,\n file: fileSizeMax\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AppImManager} from '../../lib/appManagers/appImManager';\nimport ButtonIcon from '../buttonIcon';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport {IS_APPLE, IS_MOBILE} from '../../environment/userAgent';\nimport appNavigationController from '../appNavigationController';\nimport {_i18n} from '../../lib/langPack';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport isSelectionEmpty from '../../helpers/dom/isSelectionEmpty';\nimport {MarkdownType} from '../../helpers/dom/getRichElementValue';\nimport getVisibleRect from '../../helpers/dom/getVisibleRect';\nimport clamp from '../../helpers/number/clamp';\nimport matchUrl from '../../lib/richTextProcessor/matchUrl';\nimport matchUrlProtocol from '../../lib/richTextProcessor/matchUrlProtocol';\nimport hasMarkupInSelection from '../../helpers/dom/hasMarkupInSelection';\n\nexport default class MarkupTooltip {\n public container: HTMLElement;\n private wrapper: HTMLElement;\n private buttons: {[type in MarkdownType]: HTMLElement} = {} as any;\n private linkBackButton: HTMLElement;\n private linkApplyButton: HTMLButtonElement;\n private hideTimeout: number;\n private addedListener = false;\n private waitingForMouseUp = false;\n private linkInput: HTMLInputElement;\n private savedRange: Range;\n private mouseUpCounter: number = 0;\n // private log: ReturnType;\n\n constructor(private appImManager: AppImManager) {\n // this.log = logger('MARKUP');\n }\n\n private init() {\n this.container = document.createElement('div');\n this.container.classList.add('markup-tooltip', 'z-depth-1', 'hide');\n\n this.wrapper = document.createElement('div');\n this.wrapper.classList.add('markup-tooltip-wrapper');\n\n const tools1 = document.createElement('div');\n const tools2 = document.createElement('div');\n tools1.classList.add('markup-tooltip-tools');\n tools2.classList.add('markup-tooltip-tools');\n\n const arr = ['bold', 'italic', 'underline', 'strikethrough', 'monospace', 'spoiler', 'link'] as (keyof MarkupTooltip['buttons'])[];\n arr.forEach((c) => {\n const button = ButtonIcon(c, {noRipple: true});\n tools1.append(this.buttons[c] = button);\n\n if(c !== 'link') {\n button.addEventListener('mousedown', (e) => {\n cancelEvent(e);\n this.appImManager.chat.input.applyMarkdown(c);\n this.cancelClosening();\n\n /* this.mouseUpCounter = 0;\n this.setMouseUpEvent(); */\n // this.hide();\n });\n } else {\n attachClickEvent(button, (e) => {\n cancelEvent(e);\n this.showLinkEditor();\n this.cancelClosening();\n });\n }\n });\n\n this.linkBackButton = ButtonIcon('left', {noRipple: true});\n this.linkInput = document.createElement('input');\n _i18n(this.linkInput, 'MarkupTooltip.LinkPlaceholder', undefined, 'placeholder');\n this.linkInput.classList.add('input-clear');\n this.linkInput.addEventListener('keydown', (e) => {\n const valid = !this.linkInput.value.length || !!matchUrl(this.linkInput.value);// /^(http)|(https):\\/\\//i.test(this.linkInput.value);\n\n if(e.key === 'Enter') {\n if(!valid) {\n if(this.linkInput.classList.contains('error')) {\n this.linkInput.classList.remove('error');\n void this.linkInput.offsetLeft; // reflow\n }\n\n this.linkInput.classList.add('error');\n } else {\n this.applyLink(e);\n }\n }\n });\n\n this.linkInput.addEventListener('input', (e) => {\n const valid = this.isLinkValid();\n\n this.linkInput.classList.toggle('is-valid', valid);\n this.linkInput.classList.remove('error');\n });\n\n this.linkBackButton.addEventListener('mousedown', (e) => {\n // this.log('linkBackButton click');\n cancelEvent(e);\n this.container.classList.remove('is-link');\n // input.value = '';\n this.resetSelection();\n this.setTooltipPosition();\n this.cancelClosening();\n });\n\n this.linkApplyButton = ButtonIcon('check markup-tooltip-link-apply', {noRipple: true});\n this.linkApplyButton.addEventListener('mousedown', (e) => {\n // this.log('linkApplyButton click');\n this.applyLink(e);\n });\n\n const applyDiv = document.createElement('div');\n applyDiv.classList.add('markup-tooltip-link-apply-container');\n\n const delimiter1 = document.createElement('span');\n const delimiter2 = document.createElement('span');\n const delimiter3 = document.createElement('span');\n delimiter1.classList.add('markup-tooltip-delimiter');\n delimiter2.classList.add('markup-tooltip-delimiter');\n delimiter3.classList.add('markup-tooltip-delimiter');\n tools1.insertBefore(delimiter1, this.buttons.link);\n applyDiv.append(delimiter3, this.linkApplyButton);\n tools2.append(this.linkBackButton, delimiter2, this.linkInput, applyDiv);\n // tools1.insertBefore(delimiter2, this.buttons.link.nextSibling);\n\n this.wrapper.append(tools1, tools2);\n this.container.append(this.wrapper);\n document.body.append(this.container);\n\n window.addEventListener('resize', () => {\n this.hide();\n });\n }\n\n public showLinkEditor() {\n if(!this.container || !this.container.classList.contains('is-visible')) { // * if not inited yet (Ctrl+A + Ctrl+K)\n this.show();\n }\n\n const button = this.buttons.link;\n this.container.classList.add('is-link');\n\n const selection = document.getSelection();\n this.savedRange = selection.getRangeAt(0);\n\n if(button.classList.contains('active')) {\n const startContainer = this.savedRange.startContainer;\n const anchor = startContainer.parentElement as HTMLAnchorElement;\n this.linkInput.value = anchor.href;\n } else {\n this.linkInput.value = '';\n }\n\n this.setTooltipPosition(true);\n\n setTimeout(() => {\n this.linkInput.focus(); // !!! instant focus will break animation\n }, 200);\n this.linkInput.classList.toggle('is-valid', this.isLinkValid());\n }\n\n private applyLink(e: Event) {\n cancelEvent(e);\n this.resetSelection();\n let url = this.linkInput.value;\n if(url && !matchUrlProtocol(url)) {\n url = 'https://' + url;\n }\n this.appImManager.chat.input.applyMarkdown('link', url);\n setTimeout(() => {\n this.hide();\n }, 0);\n }\n\n private isLinkValid() {\n return !this.linkInput.value.length || !!matchUrl(this.linkInput.value);\n }\n\n private resetSelection(range: Range = this.savedRange) {\n const selection = window.getSelection();\n selection.removeAllRanges();\n selection.addRange(range);\n this.appImManager.chat.input.messageInput.focus();\n }\n\n public hide() {\n // return;\n\n if(this.init) return;\n\n this.container.classList.remove('is-visible');\n // document.removeEventListener('mouseup', this.onMouseUp);\n document.removeEventListener('mouseup', this.onMouseUpSingle);\n this.waitingForMouseUp = false;\n\n appNavigationController.removeByType('markup');\n\n if(this.hideTimeout) clearTimeout(this.hideTimeout);\n this.hideTimeout = window.setTimeout(() => {\n this.hideTimeout = undefined;\n this.container.classList.add('hide');\n this.container.classList.remove('is-link');\n }, 200);\n }\n\n public getActiveMarkupButton() {\n const currentMarkups: Set = new Set();\n\n // const nodes = getSelectedNodes();\n // const parents = [...new Set(nodes.map((node) => node.parentNode))];\n // // if(parents.length > 1 && parents) return [];\n\n // (parents as HTMLElement[]).forEach((node) => {\n // for(const type in markdownTags) {\n // const tag = markdownTags[type as MarkdownType];\n // const closest = node.closest(tag.match + ', [contenteditable=\"true\"]');\n // if(closest !== this.appImManager.chat.input.messageInput) {\n // currentMarkups.add(this.buttons[type as MarkdownType]);\n // }\n // }\n // });\n\n const types = Object.keys(this.buttons) as MarkdownType[];\n const markup = hasMarkupInSelection(types);\n types.forEach((type) => {\n if(markup[type]) {\n currentMarkups.add(this.buttons[type as MarkdownType]);\n }\n });\n\n return [...currentMarkups];\n }\n\n public setActiveMarkupButton() {\n const activeButtons = this.getActiveMarkupButton();\n\n for(const i in this.buttons) {\n // @ts-ignore\n const button = this.buttons[i];\n button.classList.toggle('active', activeButtons.includes(button));\n }\n }\n\n private setTooltipPosition(isLinkToggle = false) {\n const selection = document.getSelection();\n const range = selection.getRangeAt(0);\n\n const bodyRect = document.body.getBoundingClientRect();\n const selectionRect = range.getBoundingClientRect();\n const inputRect = this.appImManager.chat.input.rowsWrapper.getBoundingClientRect();\n\n this.container.style.maxWidth = inputRect.width + 'px';\n\n const visibleRect = getVisibleRect(undefined, this.appImManager.chat.input.messageInput, false, selectionRect);\n\n const selectionTop = visibleRect.rect.top/* selectionRect.top */ + (bodyRect.top * -1);\n\n const currentTools = this.container.classList.contains('is-link') ? this.wrapper.lastElementChild : this.wrapper.firstElementChild;\n\n const sizesRect = currentTools.getBoundingClientRect();\n const top = selectionTop - sizesRect.height - 8;\n\n const minX = inputRect.left;\n const maxX = (inputRect.left + inputRect.width) - Math.min(inputRect.width, sizesRect.width);\n let left: number;\n if(isLinkToggle) {\n const containerRect = this.container.getBoundingClientRect();\n left = clamp(containerRect.left, minX, maxX);\n } else {\n const x = selectionRect.left + (selectionRect.width - sizesRect.width) / 2;\n left = clamp(x, minX, maxX);\n }\n\n /* const isClamped = x !== minX && x !== maxX && (left === minX || left === maxX || this.container.getBoundingClientRect().left >= maxX);\n\n if(isLinkToggle && this.container.classList.contains('is-link') && !isClamped) return; */\n\n this.container.style.transform = `translate3d(${left}px, ${top}px, 0)`;\n }\n\n public show() {\n if(this.init) {\n this.init();\n this.init = null;\n }\n\n if(isSelectionEmpty()) {\n this.hide();\n return;\n }\n\n if(this.hideTimeout !== undefined) {\n clearTimeout(this.hideTimeout);\n }\n\n if(this.container.classList.contains('is-visible')) {\n return;\n }\n\n this.setActiveMarkupButton();\n\n this.container.classList.remove('is-link');\n const isFirstShow = this.container.classList.contains('hide');\n if(isFirstShow) {\n this.container.classList.remove('hide');\n this.container.classList.add('no-transition');\n }\n\n this.setTooltipPosition();\n\n if(isFirstShow) {\n void this.container.offsetLeft; // reflow\n this.container.classList.remove('no-transition');\n }\n\n this.container.classList.add('is-visible');\n\n if(!IS_MOBILE) {\n appNavigationController.pushItem({\n type: 'markup',\n onPop: () => {\n this.hide();\n }\n });\n }\n\n // this.log('selection', selectionRect, activeButton);\n }\n\n /* private onMouseUp = (e: Event) => {\n this.log('onMouseUp');\n if(findUpClassName(e.target, 'markup-tooltip')) return;\n\n this.hide();\n //document.removeEventListener('mouseup', this.onMouseUp);\n }; */\n\n private onMouseUpSingle = (e?: Event) => {\n // this.log('onMouseUpSingle');\n this.waitingForMouseUp = false;\n\n if(IS_TOUCH_SUPPORTED) {\n e && cancelEvent(e);\n if(this.mouseUpCounter++ === 0) {\n this.resetSelection(this.savedRange);\n } else {\n this.hide();\n return;\n }\n }\n\n this.show();\n\n /* !isTouchSupported && document.addEventListener('mouseup', this.onMouseUp); */\n };\n\n public setMouseUpEvent() {\n if(this.waitingForMouseUp) return;\n this.waitingForMouseUp = true;\n\n // this.log('setMouseUpEvent');\n\n document.addEventListener('mouseup', this.onMouseUpSingle, {once: true});\n }\n\n public cancelClosening() {\n if(IS_TOUCH_SUPPORTED && !IS_APPLE) {\n document.removeEventListener('mouseup', this.onMouseUpSingle);\n document.addEventListener('mouseup', (e) => {\n cancelEvent(e);\n this.mouseUpCounter = 1;\n this.waitingForMouseUp = false;\n this.setMouseUpEvent();\n }, {once: true});\n }\n }\n\n public handleSelection() {\n if(this.addedListener) return;\n this.addedListener = true;\n document.addEventListener('selectionchange', (e) => {\n // this.log('selectionchange');\n\n if(document.activeElement === this.linkInput) {\n return;\n }\n\n const messageInput = this.appImManager.chat.input.messageInput;\n if(document.activeElement !== messageInput) {\n this.hide();\n return;\n }\n\n const selection = document.getSelection();\n if(isSelectionEmpty(selection)) {\n this.hide();\n return;\n }\n\n if(IS_TOUCH_SUPPORTED) {\n if(IS_APPLE) {\n this.show();\n this.setTooltipPosition(); // * because can skip this in .show();\n } else {\n if(this.mouseUpCounter === 2) {\n this.mouseUpCounter = 0;\n return;\n }\n\n this.savedRange = selection.getRangeAt(0);\n this.setMouseUpEvent();\n /* document.addEventListener('touchend', (e) => {\n cancelEvent(e);\n this.resetSelection(range);\n this.show();\n }, {once: true, passive: false}); */\n }\n } else if(this.container && this.container.classList.contains('is-visible')) {\n this.setActiveMarkupButton();\n this.setTooltipPosition();\n } else if(messageInput.matches(':active')) {\n this.setMouseUpEvent();\n } else {\n this.show();\n }\n });\n\n document.addEventListener('beforeinput', (e) => {\n if(e.inputType === 'historyRedo' || e.inputType === 'historyUndo') {\n e.target.addEventListener('input', () => this.setActiveMarkupButton(), {once: true});\n }\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport generatePathData from '../../helpers/generatePathData';\nimport {FormatterArguments, i18n, LangPackKey} from '../../lib/langPack';\n\nexport default class ChatDragAndDrop {\n container: HTMLDivElement;\n svg: SVGSVGElement;\n outlineWrapper: HTMLDivElement;\n path: SVGPathElement;\n\n constructor(appendTo: HTMLElement, private options: {\n icon?: string,\n header: LangPackKey,\n headerArgs?: FormatterArguments,\n subtitle?: LangPackKey,\n onDrop: (e: DragEvent) => void\n }) {\n this.container = document.createElement('div');\n this.container.classList.add('drop', 'z-depth-1');\n\n this.outlineWrapper = document.createElement('div');\n this.outlineWrapper.classList.add('drop-outline-wrapper');\n\n this.svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n this.svg.classList.add('drop-outline');\n\n this.path = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n this.path.classList.add('drop-outline-path');\n\n let dropIcon: HTMLElement;\n if(options.icon) {\n dropIcon = document.createElement('div');\n dropIcon.classList.add('drop-icon', 'tgico-' + options.icon);\n }\n\n const dropHeader = document.createElement('div');\n dropHeader.classList.add('drop-header');\n dropHeader.append(i18n(options.header, options.headerArgs));\n\n let dropSubtitle: HTMLElement;\n if(options.subtitle) {\n dropSubtitle = document.createElement('div');\n dropSubtitle.classList.add('drop-subtitle');\n dropSubtitle.append(i18n(options.subtitle));\n }\n\n this.svg.append(this.path);\n this.outlineWrapper.append(this.svg);\n\n this.container.append(...[this.outlineWrapper, dropIcon, dropHeader, dropSubtitle].filter(Boolean));\n appendTo.append(this.container);\n\n this.container.addEventListener('dragover', this.onDragOver);\n this.container.addEventListener('dragleave', this.onDragLeave);\n this.container.addEventListener('drop', this.onDrop);\n }\n\n onDragOver = (e: DragEvent) => {\n this.container.classList.add('is-dragover');\n // SetTransition(this.container, 'is-dragover', true, 500);\n };\n\n onDragLeave = (e: DragEvent) => {\n this.container.classList.remove('is-dragover');\n // SetTransition(this.container, 'is-dragover', false, 500);\n };\n\n onDrop = (e: DragEvent) => {\n this.options.onDrop(e);\n };\n\n destroy() {\n delete this.options;\n this.container.remove();\n this.container.removeEventListener('dragover', this.onDragOver);\n this.container.removeEventListener('dragleave', this.onDragLeave);\n this.container.removeEventListener('drop', this.onDrop);\n }\n\n setPath() {\n const rect = this.outlineWrapper.getBoundingClientRect();\n this.svg.setAttributeNS(null, 'preserveAspectRatio', 'none');\n this.svg.setAttributeNS(null, 'viewBox', `0 0 ${rect.width} ${rect.height}`);\n this.svg.setAttributeNS(null, 'width', `${rect.width}`);\n this.svg.setAttributeNS(null, 'height', `${rect.height}`);\n\n const radius = 10;\n // const strokeWidth = 2;\n const sizeX = rect.width - radius;\n const sizeY = rect.height - radius;\n const pos = radius / 2;\n const d = generatePathData(pos, pos, sizeX, sizeY, radius, radius, radius, radius);\n this.path.setAttributeNS(null, 'd', d);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {doubleRaf} from '../schedulers';\n\nexport default function disableTransition(elements: HTMLElement[]) {\n elements.forEach((el) => el.classList.add('no-transition'));\n\n doubleRaf().then(() => {\n elements.forEach((el) => el.classList.remove('no-transition'));\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nexport const MAX_SPEED = 8.2;\nexport const MIN_SPEED = 0.8;\n\n// import { MIN_SPEED, MAX_SPEED } from './BlobDrawable';\n\ntype Radius = number[];\n\nexport default class LineBlobDrawable {\n public maxRadius: number;\n public minRadius: number;\n private N: number;\n private radius: Radius;\n private radiusNext: Radius;\n private progress: number[];\n private speed: number[];\n\n constructor(n: number) {\n this.maxRadius = 10;\n this.minRadius = 0;\n\n this.N = n;\n this.radius = new Array(n + 1);\n\n this.radiusNext = new Array(n + 1);\n this.progress = new Array(n + 1);\n this.speed = new Array(n + 1);\n\n for(let i = 0; i <= n; i++) {\n this.generateBlob(this.radius, i);\n this.generateBlob(this.radiusNext, i);\n this.progress[i] = 0;\n }\n }\n\n private generateBlob(radius: Radius, i: number) {\n const {maxRadius, minRadius, speed} = this;\n\n const radDif = maxRadius - minRadius;\n radius[i] = minRadius + Math.random() * radDif;\n speed[i] = 0.017 + 0.003 * Math.random();\n }\n\n private generateNextBlob() {\n const {radius, radiusNext, progress, N} = this;\n for(let i = 0; i < N; i++) {\n this.generateBlob(radius, i);\n this.generateBlob(radiusNext, i);\n progress[i] = 0.0;\n }\n }\n\n public update(amplitude: number, speedScale: number) {\n const {N, progress, speed, radius, radiusNext} = this;\n for(let i = 0; i <= N; i++) {\n progress[i] += (speed[i] * MIN_SPEED) + amplitude * speed[i] * MAX_SPEED * speedScale;\n if(progress[i] >= 1.0) {\n progress[i] = 0.0;\n radius[i] = radiusNext[i];\n this.generateBlob(radiusNext, i);\n }\n }\n }\n\n public draw(left: number, top: number, right: number, bottom: number, canvas: HTMLCanvasElement, paint: (ctx: CanvasRenderingContext2D) => void, pinnedTop: number, progressToPinned: number) {\n if(canvas.getContext) {\n const ctx = canvas.getContext('2d');\n // ctx.globalAlpha = 0.5;\n // ctx.lineWidth = 1;\n\n ctx.beginPath();\n ctx.moveTo(right, bottom);\n ctx.lineTo(left, bottom);\n\n const {radius, radiusNext, N} = this;\n for(let i = 0; i <= N; i++) {\n if(i === 0) {\n const progress = this.progress[i];\n const r1 = radius[i] * (1.0 - progress) + radiusNext[i] * progress;\n const y = (top - r1) * progressToPinned + pinnedTop * (1.0 - progressToPinned);\n ctx.lineTo(left, y);\n } else {\n const progress = this.progress[i - 1];\n const r1 = radius[i - 1] * (1.0 - progress) + radiusNext[i - 1] * progress;\n const progressNext = this.progress[i];\n const r2 = radius[i] * (1.0 - progressNext) + radiusNext[i] * progressNext;\n const x1 = (right - left) / N * (i - 1);\n const x2 = (right - left) / N * i;\n const cx = x1 + (x2 - x1) / 2;\n\n const y1 = (top - r1) * progressToPinned + pinnedTop * (1.0 - progressToPinned);\n const y2 = (top - r2) * progressToPinned + pinnedTop * (1.0 - progressToPinned);\n ctx.bezierCurveTo(cx, y1, cx, y2, x2, y2);\n if(i === N) {\n ctx.lineTo(right, bottom);\n }\n }\n }\n\n // ctx.scale(1.0, 1.0);\n paint(ctx);\n ctx.fill();\n ctx.closePath();\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport GROUP_CALL_STATE from '../lib/calls/groupCallState';\nimport LineBlobDrawable from './lineBlobDrawable';\n\nexport class WeavingState {\n public shader: (ctx: CanvasRenderingContext2D, left: number, top: number, right: number, bottom: number) => void;\n\n constructor(public stateId: GROUP_CALL_STATE) {\n this.createGradient(stateId);\n }\n\n public createGradient(stateId: GROUP_CALL_STATE) {\n this.shader = (ctx, left, top, right, bottom) => {\n ctx.fillStyle = WeavingState.getGradientFromType(ctx, stateId, left, top, right, bottom);\n };\n }\n\n // Android colors\n static getGradientFromType(ctx: CanvasRenderingContext2D, type: GROUP_CALL_STATE, x0: number, y0: number, x1: number, y1: number) {\n const gradient = ctx.createLinearGradient(x0, y0, x1, y1);\n if(type === GROUP_CALL_STATE.MUTED_BY_ADMIN) {\n gradient.addColorStop(0, '#F05459');\n gradient.addColorStop(.4, '#766EE9');\n gradient.addColorStop(1, '#57A4FE');\n } else if(type === GROUP_CALL_STATE.UNMUTED) {\n gradient.addColorStop(0, '#52CE5D');\n gradient.addColorStop(1, '#00B1C0');\n } else if(type === GROUP_CALL_STATE.MUTED) {\n gradient.addColorStop(0, '#0976E3');\n gradient.addColorStop(1, '#2BCEFF');\n } else if(type === GROUP_CALL_STATE.CONNECTING) {\n gradient.addColorStop(0, '#8599aa');\n gradient.addColorStop(1, '#8599aa');\n }\n\n return gradient;\n }\n\n update(height: number, width: number, dt: number, amplitude: number) {\n // TODO: move gradient here\n }\n}\n\nexport default class TopbarWeave {\n private focused: boolean;\n private resizing: boolean;\n private lastUpdateTime: number;\n private amplitude: number;\n private amplitude2: number;\n\n private states: Map;\n private previousState: WeavingState;\n private currentState: WeavingState;\n private progressToState: number;\n\n private scale: number;\n private left: number;\n private top: number;\n private right: number;\n private bottom: number;\n\n private mounted: boolean;\n private media: MediaQueryList;\n\n private container: HTMLDivElement;\n private canvas: HTMLCanvasElement;\n\n private resizeHandler: number;\n private raf: number;\n\n private lbd: LineBlobDrawable;\n private lbd1: LineBlobDrawable;\n private lbd2: LineBlobDrawable;\n\n private animateToAmplitude: number;\n private animateAmplitudeDiff: number;\n private animateAmplitudeDiff2: number;\n\n constructor() {\n this.focused = true;\n this.resizing = false;\n this.lastUpdateTime = Date.now();\n this.amplitude = 0.0;\n this.amplitude2 = 0.0;\n\n this.states = new Map([\n [GROUP_CALL_STATE.UNMUTED, new WeavingState(GROUP_CALL_STATE.UNMUTED)],\n [GROUP_CALL_STATE.MUTED, new WeavingState(GROUP_CALL_STATE.MUTED)],\n [GROUP_CALL_STATE.MUTED_BY_ADMIN, new WeavingState(GROUP_CALL_STATE.MUTED_BY_ADMIN)],\n [GROUP_CALL_STATE.CONNECTING, new WeavingState(GROUP_CALL_STATE.CONNECTING)]\n ]);\n this.previousState = null;\n this.currentState = this.states.get(GROUP_CALL_STATE.CONNECTING);\n this.progressToState = 1.0;\n }\n\n public componentDidMount() {\n if(this.mounted) {\n return;\n }\n\n this.mounted = true;\n // window.addEventListener('blur', this.handleBlur);\n // window.addEventListener('focus', this.handleFocus);\n window.addEventListener('resize', this.handleResize);\n this.media = window.matchMedia('screen and (min-resolution: 2dppx)');\n this.media.addEventListener('change', this.handleDevicePixelRatioChanged);\n\n this.setSize();\n this.forceUpdate();\n\n this.lbd = new LineBlobDrawable(3);\n this.lbd1 = new LineBlobDrawable(7);\n this.lbd2 = new LineBlobDrawable(8);\n this.setAmplitude(this.amplitude);\n\n this.draw();\n }\n\n public componentWillUnmount() {\n this.mounted = false;\n // window.removeEventListener('blur', this.handleBlur);\n // window.removeEventListener('focus', this.handleFocus);\n window.removeEventListener('resize', this.handleResize);\n this.media.addEventListener('change', this.handleDevicePixelRatioChanged);\n\n const {canvas} = this;\n const ctx = canvas.getContext('2d');\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n }\n\n private setSize() {\n this.scale = window.devicePixelRatio;\n this.top = 20 * this.scale;\n this.right = (this.mounted ? this.container.offsetWidth : 1261) * this.scale;\n this.bottom = (this.mounted ? this.container.offsetHeight : 68) * this.scale;\n this.left = 0 * this.scale;\n this.setCanvasSize();\n }\n\n private setCanvasSize() {\n this.canvas.width = this.right;\n this.canvas.height = this.bottom;\n }\n\n private handleDevicePixelRatioChanged = (e: Event) => {\n this.setSize();\n this.forceUpdate();\n }\n\n private handleResize = () => {\n if(this.resizeHandler) {\n clearTimeout(this.resizeHandler);\n this.resizeHandler = null;\n }\n\n this.resizing = true;\n this.resizeCanvas();\n this.resizeHandler = window.setTimeout(() => {\n this.resizing = false;\n this.invokeDraw();\n }, 250);\n }\n\n private resizeCanvas() {\n this.scale = window.devicePixelRatio;\n this.right = this.container.offsetWidth * this.scale;\n\n this.forceUpdate();\n this.invokeDraw();\n }\n\n public handleFocus = () => {\n this.focused = true;\n this.invokeDraw();\n }\n\n public handleBlur = () => {\n this.focused = false;\n }\n\n private invokeDraw = () => {\n if(this.raf) return;\n\n this.draw();\n }\n\n private draw = (force = false) => {\n this.raf = null;\n if(!this.mounted) {\n return;\n }\n const {lbd, lbd1, lbd2, scale, left, top, right, bottom, currentState, previousState, focused, resizing, canvas} = this;\n if(!focused && !resizing && this.progressToState >= 1.0) {\n return;\n }\n\n // console.log('[top] draw', [focused, resizing, this.mounted]);\n\n const newTime = Date.now();\n let dt = (newTime - this.lastUpdateTime);\n if(dt > 20) {\n dt = 17;\n }\n\n // console.log('draw start', this.amplitude, this.animateToAmplitude);\n if(this.animateToAmplitude !== this.amplitude) {\n this.amplitude += this.animateAmplitudeDiff * dt;\n if(this.animateAmplitudeDiff > 0) {\n if(this.amplitude > this.animateToAmplitude) {\n this.amplitude = this.animateToAmplitude;\n }\n } else {\n if(this.amplitude < this.animateToAmplitude) {\n this.amplitude = this.animateToAmplitude;\n }\n }\n }\n\n if(this.animateToAmplitude !== this.amplitude2) {\n this.amplitude2 += this.animateAmplitudeDiff2 * dt;\n if(this.animateAmplitudeDiff2 > 0) {\n if(this.amplitude2 > this.animateToAmplitude) {\n this.amplitude2 = this.animateToAmplitude;\n }\n } else {\n if(this.amplitude2 < this.animateToAmplitude) {\n this.amplitude2 = this.animateToAmplitude;\n }\n }\n }\n\n if(previousState) {\n this.progressToState += dt / 250;\n if(this.progressToState > 1) {\n this.progressToState = 1;\n this.previousState = null;\n }\n }\n\n const {amplitude, amplitude2, progressToState} = this;\n\n const top1 = 6 * amplitude2 * scale;\n const top2 = 6 * amplitude2 * scale;\n\n const ctx = canvas.getContext('2d');\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n lbd.minRadius = 0;\n lbd.maxRadius = (2 + 2 * amplitude) * scale;\n lbd1.minRadius = 0;\n lbd1.maxRadius = (3 + 9 * amplitude) * scale;\n lbd2.minRadius = 0;\n lbd2.maxRadius = (3 + 9 * amplitude) * scale;\n\n lbd.update(amplitude, 0.3);\n lbd1.update(amplitude, 0.7);\n lbd2.update(amplitude, 0.7);\n\n for(let i = 0; i < 2; i++) {\n if(i === 0 && !previousState) {\n continue;\n }\n\n let alpha = 1;\n let state: WeavingState = null;\n if(i === 0) {\n alpha = 1 - progressToState;\n state = previousState;\n // previousState.setToPaint(paint);\n } else {\n alpha = previousState ? progressToState : 1;\n currentState.update(bottom - top, right - left, dt, amplitude);\n state = currentState;\n // currentState.setToPaint(paint);\n }\n\n const paint1 = (ctx: CanvasRenderingContext2D) => {\n ctx.globalAlpha = 0.3 * alpha;\n state.shader(ctx, left, top, right, bottom);\n };\n const paint = (ctx: CanvasRenderingContext2D) => {\n ctx.globalAlpha = i === 0 ? 1 : alpha;\n state.shader(ctx, left, top, right, bottom);\n };\n\n lbd1.draw(left, top - top1, right, bottom, canvas, paint1, top, 1.0);\n lbd2.draw(left, top - top2, right, bottom, canvas, paint1, top, 1.0);\n lbd.draw(left, top, right, bottom, canvas, paint, top, 1.0);\n }\n\n if(!force) {\n this.raf = requestAnimationFrame(() => this.draw());\n }\n };\n\n public setCurrentState = (stateId: GROUP_CALL_STATE, animated: boolean) => {\n const {currentState, states} = this;\n\n if(currentState?.stateId === stateId) {\n return;\n }\n\n this.previousState = animated ? currentState : null;\n this.currentState = states.get(stateId);\n this.progressToState = this.previousState ? 0.0 : 1.0;\n };\n\n public setAmplitude(value: number) {\n const {amplitude} = this;\n this.animateToAmplitude = value;\n this.animateAmplitudeDiff = (value - amplitude) / 250;\n this.animateAmplitudeDiff2 = (value - amplitude) / 120;\n }\n\n private forceUpdate() {\n this.setCanvasSize();\n }\n\n public render(className: string) {\n const container = this.container = document.createElement('div');\n container.classList.add(className);\n\n const canvas = this.canvas = document.createElement('canvas');\n canvas.classList.add(className + '-canvas');\n\n container.append(canvas);\n\n return container;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport liteMode from '../../helpers/liteMode';\nimport noop from '../../helpers/noop';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport rootScope from '../rootScope';\nimport lottieLoader, {LottieAssetName} from './lottieLoader';\nimport type RLottiePlayer from './rlottiePlayer';\nimport {RLottieColor} from './rlottiePlayer';\n\nexport type RLottieIconOptions = {\n width: number,\n height: number,\n container?: HTMLElement,\n skipAnimation?: boolean\n};\n\nexport type RLottieIconItemPartOptions = {\n startFrame: number,\n endFrame: number,\n name?: string\n};\n\nexport type RLottieIconItemOptions = {\n name: LottieAssetName,\n parts: RLottieIconItemPartOptions[],\n initFrame?: number,\n player?: RLottiePlayer,\n autoplay?: boolean,\n color?: RLottieColor,\n inverseColor?: RLottieColor,\n};\n\nexport class RLottieIconItemPart implements RLottieIconItemPartOptions {\n public startFrame: number;\n public endFrame: number;\n public name?: string;\n\n constructor(public item: RLottieIconItem, options: RLottieIconItemPartOptions) {\n safeAssign(this, options);\n }\n\n public play(callback?: () => void) {\n return this.item.playPart(this, callback);\n }\n}\n\n// export type RLottieIconItemPart = RLottieIconItemPartOptions;\n\nexport class RLottieIconItem implements RLottieIconItemOptions {\n public name: LottieAssetName;\n public parts: RLottieIconItemPart[];\n public player: RLottiePlayer;\n public initFrame: number;\n public autoplay: boolean;\n public color: RLottieColor;\n public inverseColor: RLottieColor;\n public loadPromise: Promise;\n public onLoadForPart: () => void;\n public onLoadForColor: () => void;\n\n constructor(public icon: RLottieIcon, options: RLottieIconItemOptions) {\n this.autoplay = false;\n\n safeAssign(this, options);\n\n this.parts = this.parts.map((options) => this.createPart(options));\n }\n\n public load() {\n let loadPromise = this.loadPromise;\n if(loadPromise) {\n return loadPromise;\n }\n\n const {container, canvas, width, height} = this.icon;\n loadPromise = lottieLoader.loadAnimationAsAsset({\n container,\n canvas,\n width,\n height,\n group: 'none',\n loop: false,\n autoplay: this.autoplay ?? false,\n initFrame: this.initFrame,\n skipFirstFrameRendering: this.initFrame === undefined,\n color: this.color,\n inverseColor: this.inverseColor\n }, this.name).then((player) => {\n return lottieLoader.waitForFirstFrame(player);\n }).then((player) => {\n this.player = player;\n\n if(this.onLoadForColor) {\n this.onLoadForColor();\n this.onLoadForColor = undefined;\n }\n\n if(this.onLoadForPart) {\n this.onLoadForPart();\n this.onLoadForPart = undefined;\n }\n });\n\n this.loadPromise = loadPromise;\n this.icon.loadPromises.set(this.name, loadPromise);\n return loadPromise;\n }\n\n public createPart(options: RLottieIconItemPartOptions) {\n return new RLottieIconItemPart(this, options);\n }\n\n public getPart(index: string | number | RLottieIconItemPart) {\n if(index instanceof RLottieIconItemPart) return index;\n else if(typeof(index) === 'string') return this.parts.find((part) => part.name === index);\n else return this.parts[index];\n }\n\n public playPart(part: RLottieIconItemPart, callback?: () => void) {\n return this.icon.playPart(this, part, callback);\n }\n}\n\nexport default class RLottieIcon {\n public container: HTMLElement;\n public canvas: HTMLCanvasElement;\n public width: number;\n public height: number;\n\n protected items: Map;\n public loadPromises: Map>;\n\n protected skipAnimation: boolean;\n\n constructor(options: RLottieIconOptions) {\n safeAssign(this, options);\n\n if(!this.container) this.container = document.createElement('div');\n this.container.classList.add('rlottie-icon');\n\n const {width, height} = this;\n this.container.style.width = width + 'px';\n this.container.style.height = height + 'px';\n\n const canvas = this.canvas = document.createElement('canvas');\n canvas.classList.add('rlottie');\n canvas.width = width;\n canvas.height = height;\n\n this.items = new Map();\n this.loadPromises = new Map();\n }\n\n public get loadPromise() {\n return Promise.all([...this.loadPromises.values()]).then(noop);\n }\n\n public getItem(name?: LottieAssetName): RLottieIconItem {\n return !name && this.items.size === 1 ? this.items.values().next().value : this.items.get(name);\n }\n\n public add(options: Omit) {\n const item = new RLottieIconItem(this, options);\n this.items.set(options.name, item);\n\n return item;\n }\n\n public playPart(item: RLottieIconItem, index: Parameters[0], callback?: () => void) {\n if(!item.player) {\n item.onLoadForPart = () => {\n this.playPart(item, index, callback);\n };\n\n return;\n }\n\n const part = item.getPart(index);\n item.player.playPart({\n from: liteMode.isAvailable('animations') && !this.skipAnimation ? part.startFrame : part.endFrame,\n to: part.endFrame,\n callback\n });\n }\n\n /* public playToPart(item: RLottieIconItem, index: Parameters[0], toEnd: boolean) {\n if(!item.player) return;\n const part = item.getPart(index);\n const toFrame = toEnd ? part.endFrame : part.startFrame;\n item.player.playToFrame({\n frame: toFrame\n });\n } */\n\n public static generateEqualParts(length: number, frameCount: number): RLottieIconItemPartOptions[] {\n return new Array(length).fill(0).map((_, idx) => {\n const startFrame = idx * frameCount;\n return {startFrame, endFrame: startFrame + frameCount - 1};\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport noop from '../helpers/noop';\nimport safeAssign from '../helpers/object/safeAssign';\nimport {LottieAssetName} from '../lib/rlottie/lottieLoader';\nimport RLottieIcon, {RLottieIconItemPartOptions, RLottieIconItemPart} from '../lib/rlottie/rlottieIcon';\nimport {RLottieColor} from '../lib/rlottie/rlottiePlayer';\n\nexport type SuperRLottieIconAddItemOptions = {name: LottieAssetName, parts: RLottieIconItemPartOptions};\nexport type SuperRLottieIconGetInfoResult = RLottieIconItemPart;\nexport class SuperRLottieIcon extends RLottieIcon {\n protected getPart: (state: Options['PartState'], prevState?: Options['PartState']) => SuperRLottieIconGetInfoResult;\n protected getColor?: (state: Options['ColorState'], prevState?: Options['ColorState']) => RLottieColor;\n\n protected partState: Options['PartState'];\n protected colorState: Options['ColorState'];\n protected loaded: boolean;\n\n constructor(options: {\n width: number,\n height: number,\n skipAnimation?: boolean,\n getPart: (state: Options['PartState'], prevState?: Options['PartState']) => SuperRLottieIconGetInfoResult,\n getColor?: (state: Options['ColorState'], prevState?: Options['ColorState']) => RLottieColor,\n }) {\n super({\n width: options.width,\n height: options.height\n });\n\n safeAssign(this, options);\n\n // hook the first call\n /* const originalFunction = this.setState.bind(this);\n this.setState = (partState, colorState) => {\n this.setState = originalFunction;\n this.load(partState, colorState);\n return originalFunction(partState, colorState);\n }; */\n }\n\n public load(partState: Options['PartState'], colorState?: Options['ColorState']) {\n if(this.loaded) {\n return this.loadPromise;\n }\n\n this.loaded = true;\n this.partState = partState;\n this.colorState = colorState;\n\n const part = this.getPart(partState);\n const color = colorState !== undefined && this.getColor && this.getColor(colorState);\n\n const item = part.item;\n item.initFrame = part.endFrame;\n item.color = color;\n\n const promises = [...this.items.values()].map((item) => item.load());\n return Promise.all(promises).then(noop);\n }\n\n /**\n * Will redirect setting color state to part callback to synchronize the rendering\n */\n public setState(partState: Options['PartState'], colorState?: Options['ColorState'], partCallback?: () => void) {\n if(!this.loaded) this.load(partState, colorState);\n\n let changedPartState = false, changedColorState = false;\n if(partState !== undefined) changedPartState = this.setPartState(partState, colorState, partCallback);\n else if(colorState !== undefined) changedColorState = this.setColorState(colorState);\n\n return changedPartState || changedColorState;\n }\n\n public setPartState(state: Options['PartState'], colorState?: Options['ColorState'], callback?: () => void) {\n const {partState: prevState} = this;\n if(prevState === state) {\n return colorState !== undefined ? this.setColorState(colorState) : false;\n }\n\n if(colorState !== undefined) {\n this.setColorState(colorState, false);\n }\n\n this.partState = state;\n\n const part = this.getPart(state, prevState);\n part.play(callback);\n\n return true;\n }\n\n public setColorState(state: Options['ColorState'], renderIfPaused = true) {\n const {colorState: prevState} = this;\n if(prevState === state || !this.getColor) {\n return false;\n }\n\n this.colorState = state;\n\n const item = this.getItem();\n const color = this.getColor(state, prevState);\n const invoke = () => {\n item.player.setColor(color, renderIfPaused);\n };\n\n if(item.player) {\n invoke();\n } else {\n item.onLoadForColor = invoke;\n }\n\n return true;\n }\n\n public destroy() {\n this.items.forEach((item) => {\n item.loadPromise.then(() => {\n item.player.remove();\n });\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {RLottieIconItemPartOptions} from '../../lib/rlottie/rlottieIcon';\nimport {GROUP_CALL_MICROPHONE_BUTTON_STATE} from '.';\nimport {SuperRLottieIcon} from '../superIcon';\n\nexport default class GroupCallMicrophoneIcon extends SuperRLottieIcon<{\n PartState: GROUP_CALL_MICROPHONE_BUTTON_STATE\n}> {\n constructor() {\n super({\n width: 36,\n height: 36,\n getPart: (state, prevState) => {\n const states = GROUP_CALL_MICROPHONE_BUTTON_STATE;\n let partName: string;\n switch(state) {\n case states.HAND:\n partName = prevState === states.MUTED ? 'muted-to-hand' : 'unmuted-to-hand';\n break;\n case states.MUTED:\n partName = prevState === states.HAND ? 'hand-to-muted' : 'mute';\n break;\n case states.UNMUTED:\n partName = 'unmute';\n break;\n }\n\n return this.getItem().getPart(partName);\n }\n });\n\n const className = 'group-call-microphone-icon';\n this.container.classList.add(className + '-container');\n\n const parts: RLottieIconItemPartOptions[] = [{\n startFrame: 0,\n endFrame: 35,\n name: 'hand-to-muted'\n }, {\n startFrame: 36,\n endFrame: 68,\n name: 'unmute'\n }, {\n startFrame: 69,\n endFrame: 98,\n name: 'mute'\n }, {\n startFrame: 99,\n endFrame: 135,\n name: 'muted-to-hand'\n }, {\n startFrame: 136,\n endFrame: 172,\n name: 'unmuted-to-hand'\n }, {\n startFrame: 173,\n endFrame: 201,\n name: 'scheduled-crossing'\n }, {\n startFrame: 202,\n endFrame: 236,\n name: 'scheduled-to-muted'\n }, {\n startFrame: 237,\n endFrame: 273,\n name: 'scheduled-to-hand'\n }, {\n startFrame: 274,\n endFrame: 310,\n name: 'scheduled-crossed-to-hand'\n }, {\n startFrame: 311,\n endFrame: 343,\n name: 'scheduled-uncrossing'\n }, {\n startFrame: 344,\n endFrame: 375,\n name: 'scheduled-to-muted'\n }, {\n startFrame: 376,\n endFrame: 403,\n name: 'play-to-muted'\n }];\n\n this.add({\n name: 'voip_filled',\n parts\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport RLottieIcon from '../../lib/rlottie/rlottieIcon';\nimport {GROUP_CALL_PARTICIPANT_CLEARED_MUTED_STATE, GROUP_CALL_PARTICIPANT_MUTED_STATE, getColorByMutedState, clearMutedStateModifier} from '.';\nimport {SuperRLottieIcon} from '../superIcon';\n\nexport default class GroupCallParticipantMutedIcon extends SuperRLottieIcon<{\n PartState: GROUP_CALL_PARTICIPANT_CLEARED_MUTED_STATE,\n ColorState: GROUP_CALL_PARTICIPANT_MUTED_STATE\n}> {\n constructor(private colored: boolean) {\n super({\n width: 32,\n height: 32,\n getPart: (state, prevState) => {\n const states = GROUP_CALL_PARTICIPANT_MUTED_STATE;\n\n let index: number;\n switch(state) {\n case states.HAND:\n index = 3;\n break;\n case states.MUTED:\n index = prevState === states.HAND ? 0 : 2;\n break;\n case states.UNMUTED:\n index = 1;\n break;\n }\n\n return this.getItem().getPart(index);\n },\n getColor: colored ? (state, prevState) => {\n return getColorByMutedState(state);\n } : undefined\n });\n\n const className = 'group-call-participant-muted-icon';\n this.container.classList.add(className + '-container');\n\n const parts = RLottieIcon.generateEqualParts(4, 21);\n this.add({\n name: 'voice_outlined2',\n parts\n });\n }\n\n public setState(state: GROUP_CALL_PARTICIPANT_MUTED_STATE) {\n return super.setState(clearMutedStateModifier(state), state);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '../popups';\nimport {hexToRgb} from '../../helpers/color';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport customProperties from '../../helpers/dom/customProperties';\nimport {GroupCall, GroupCallParticipant} from '../../layer';\nimport type {AppChatsManager} from '../../lib/appManagers/appChatsManager';\nimport type {AppGroupCallsManager} from '../../lib/appManagers/appGroupCallsManager';\nimport type {AppPeersManager} from '../../lib/appManagers/appPeersManager';\nimport GROUP_CALL_STATE from '../../lib/calls/groupCallState';\nimport {RLottieColor} from '../../lib/rlottie/rlottiePlayer';\nimport rootScope from '../../lib/rootScope';\nimport ButtonIcon from '../buttonIcon';\nimport GroupCallMicrophoneIcon from './microphoneIcon';\nimport GroupCallParticipantsElement from './participants';\nimport GroupCallParticipantsVideoElement from './participantVideos';\nimport PopupPeer from '../popups/peer';\nimport GroupCallDescriptionElement from './description';\nimport GroupCallTitleElement from './title';\nimport {addFullScreenListener, cancelFullScreen, isFullScreen, requestFullScreen} from '../../helpers/dom/fullScreen';\nimport Scrollable from '../scrollable';\nimport {MovableState} from '../movableElement';\nimport animationIntersector from '../animationIntersector';\nimport {IS_APPLE_MOBILE} from '../../environment/userAgent';\nimport throttle from '../../helpers/schedulers/throttle';\nimport IS_SCREEN_SHARING_SUPPORTED from '../../environment/screenSharingSupport';\nimport GroupCallInstance from '../../lib/calls/groupCallInstance';\nimport makeButton from '../call/button';\nimport MovablePanel from '../../helpers/movablePanel';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport toggleClassName from '../../helpers/toggleClassName';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport themeController from '../../helpers/themeController';\nimport groupCallsController from '../../lib/calls/groupCallsController';\n\nexport enum GROUP_CALL_PARTICIPANT_MUTED_STATE {\n UNMUTED,\n MUTED,\n MUTED_FOR_ME,\n MUTED_BY_ADMIN,\n HAND\n}\n\nexport type GROUP_CALL_PARTICIPANT_CLEARED_MUTED_STATE = Exclude;\n\nexport function getGroupCallParticipantMutedState(participant: GroupCallParticipant) {\n const states = GROUP_CALL_PARTICIPANT_MUTED_STATE;\n if(participant.pFlags.muted_by_you) {\n return states.MUTED_FOR_ME;\n } else if(participant.raise_hand_rating !== undefined) {\n return states.HAND;\n } else if(participant.pFlags.muted) {\n return participant.pFlags.can_self_unmute ? states.MUTED : states.MUTED_BY_ADMIN;\n } else {\n return states.UNMUTED;\n }\n}\n\nexport function clearMutedStateModifier(state: GROUP_CALL_PARTICIPANT_MUTED_STATE): GROUP_CALL_PARTICIPANT_CLEARED_MUTED_STATE {\n const states = GROUP_CALL_PARTICIPANT_MUTED_STATE;\n switch(state) {\n case states.MUTED_BY_ADMIN:\n case states.MUTED_FOR_ME:\n return states.MUTED;\n default:\n return state;\n }\n}\n\nexport function getColorByMutedState(state: GROUP_CALL_PARTICIPANT_MUTED_STATE) {\n const states = GROUP_CALL_PARTICIPANT_MUTED_STATE;\n let colorStr: 'blue' | 'green' | 'secondary' | 'red';\n switch(state) {\n case states.HAND:\n colorStr = 'blue';\n break;\n case states.MUTED:\n case states.MUTED_FOR_ME:\n case states.MUTED_BY_ADMIN:\n colorStr = state === states.MUTED ? 'secondary' : 'red';\n break;\n case states.UNMUTED:\n colorStr = 'green';\n break;\n }\n\n const propertyValue = customProperties.getProperty('gc-' + colorStr + '-text-color');\n const color: RLottieColor = hexToRgb(propertyValue);\n\n return color;\n}\n\nexport enum GROUP_CALL_MICROPHONE_BUTTON_STATE {\n HAND,\n MUTED,\n UNMUTED,\n}\n\nexport function getGroupCallMicrophoneButtonState(groupCall: GroupCall.groupCall, participant: GroupCallParticipant) {\n const states = GROUP_CALL_MICROPHONE_BUTTON_STATE;\n if(!participant.pFlags.can_self_unmute) {\n return states.HAND;\n } else if(participant.pFlags.muted) {\n return states.MUTED\n } else {\n return states.UNMUTED;\n }\n}\n\nlet previousState: MovableState = {\n width: 420,\n height: 640\n};\n\nconst className = 'group-call';\n\nexport default class PopupGroupCall extends PopupElement {\n private instance: GroupCallInstance;\n private groupCallTitle: GroupCallTitleElement;\n private groupCallDescription: GroupCallDescriptionElement;\n private groupCallBodyHeaderDescription: GroupCallDescriptionElement;\n private groupCallParticipants: GroupCallParticipantsElement;\n private groupCallParticipantsVideo: GroupCallParticipantsVideoElement;\n private groupCallMicrophoneIcon: GroupCallMicrophoneIcon;\n private videosCount: number;\n private btnFullScreen: HTMLButtonElement;\n private btnExitFullScreen: HTMLButtonElement;\n private btnInvite: HTMLButtonElement;\n private btnShowColumn: HTMLButtonElement;\n private movablePanel: MovablePanel;\n private buttonsContainer: HTMLDivElement;\n private btnFullScreen2: HTMLButtonElement;\n private btnVideo: HTMLDivElement;\n private btnScreen: HTMLDivElement;\n\n constructor() {\n super('popup-group-call', {\n body: true,\n withoutOverlay: true,\n closable: true,\n title: true\n });\n\n this.videosCount = 0;\n this.container.classList.add(className, 'night');\n\n const instance = this.instance = groupCallsController.groupCall;\n const {listenerSetter} = this;\n\n if(!IS_APPLE_MOBILE) {\n const btnFullScreen = this.btnFullScreen = ButtonIcon('fullscreen');\n const btnFullScreen2 = this.btnFullScreen2 = ButtonIcon('fullscreen ' + className + '-cfs');\n const btnExitFullScreen = this.btnExitFullScreen = ButtonIcon('smallscreen');\n\n attachClickEvent(btnFullScreen, this.onFullScreenClick, {listenerSetter});\n attachClickEvent(btnFullScreen2, this.onFullScreenClick, {listenerSetter});\n\n attachClickEvent(btnExitFullScreen, () => {\n cancelFullScreen();\n }, {listenerSetter});\n\n addFullScreenListener(this.container, this.onFullScreenChange, listenerSetter);\n }\n\n const btnInvite = this.btnInvite = ButtonIcon('adduser');\n const btnShowColumn = this.btnShowColumn = ButtonIcon('rightpanel ' + className + '-only-big');\n\n attachClickEvent(btnShowColumn, this.toggleRightColumn, {listenerSetter});\n\n const headerInfo = document.createElement('div');\n headerInfo.classList.add(className + '-header-info');\n\n this.title.classList.add(className + '-header-title');\n\n const subtitle = document.createElement('div');\n subtitle.classList.add(className + '-header-subtitle');\n\n headerInfo.append(this.title, subtitle);\n\n this.header.classList.add(className + '-header');\n this.header.append(...[this.btnExitFullScreen, headerInfo/* , btnInvite */, this.btnFullScreen, btnShowColumn].filter(Boolean));\n\n const newHeader = this.header.cloneNode(false) as HTMLElement;\n const newHeaderInfo = headerInfo.cloneNode(false) as HTMLElement;\n const newHeaderTitle = this.title.cloneNode(false) as HTMLElement;\n\n newHeaderInfo.append(newHeaderTitle);\n\n const btnHideColumn = ButtonIcon('rightpanel');\n newHeader.append(...[btnHideColumn, newHeaderInfo, this.btnFullScreen2].filter(Boolean));\n\n attachClickEvent(btnHideColumn, this.toggleRightColumn, {listenerSetter});\n\n this.body.prepend(newHeader);\n\n const videosScrollable = new Scrollable(undefined);\n videosScrollable.container.classList.add('group-call-big-video-container');\n this.container.append(videosScrollable.container);\n\n this.groupCallTitle = new GroupCallTitleElement(this.title);\n this.groupCallDescription = new GroupCallDescriptionElement(subtitle);\n this.groupCallBodyHeaderDescription = new GroupCallDescriptionElement(newHeaderTitle);\n this.constructButtons();\n\n this.groupCallParticipantsVideo = new GroupCallParticipantsVideoElement({\n appendTo: videosScrollable.container,\n instance,\n listenerSetter,\n displayPinned: true,\n onLengthChange: (length) => {\n this.videosCount = length;\n this.toggleBigLayout();\n },\n managers: this.managers\n });\n this.groupCallParticipants = new GroupCallParticipantsElement({\n appendTo: this.body,\n instance,\n listenerSetter,\n managers: this.managers\n });\n\n this.movablePanel = new MovablePanel({\n listenerSetter,\n movableOptions: {\n minWidth: 400,\n minHeight: 480,\n element: this.element,\n verifyTouchTarget: (e) => {\n const target = e.target;\n if(findUpClassName(target, 'chatlist') ||\n findUpClassName(target, 'group-call-button') ||\n findUpClassName(target, 'btn-icon') ||\n findUpClassName(target, 'group-call-participants-video-container') ||\n isFullScreen()) {\n return false;\n }\n\n return true;\n }\n },\n onResize: () => this.toggleBigLayout(),\n previousState\n });\n\n listenerSetter.add(instance)('state', () => {\n this.updateInstance();\n });\n\n listenerSetter.add(rootScope)('group_call_update', (groupCall) => {\n if(this.instance?.id === groupCall.id) {\n this.updateInstance();\n }\n });\n\n listenerSetter.add(instance)('pinned', () => {\n this.setHasPinned();\n });\n\n listenerSetter.add(this.groupCallParticipantsVideo)('toggleControls', this.onToggleControls);\n\n this.addEventListener('close', () => {\n const {movablePanel} = this;\n previousState = movablePanel.state;\n\n this.groupCallParticipantsVideo.destroy();\n this.groupCallParticipants.destroy();\n this.groupCallMicrophoneIcon.destroy();\n\n movablePanel.destroy();\n });\n\n this.toggleRightColumn();\n this.onFullScreenChange();\n\n this.updateInstance();\n }\n\n private constructButtons() {\n const buttons = this.buttonsContainer = document.createElement('div');\n buttons.classList.add(className + '-buttons');\n\n const _makeButton = makeButton.bind(null, className, this.listenerSetter);\n\n const btnVideo = this.btnVideo = _makeButton({\n // text: 'VoiceChat.Video.Stream.Video',\n callback: this.onVideoClick,\n icon: 'videocamera_filled'\n });\n\n const btnScreen = this.btnScreen = _makeButton({\n // text: 'VoiceChat.Video.Stream.Screencast',\n callback: this.onScreenClick,\n icon: 'sharescreen_filled'\n });\n\n btnScreen.classList.toggle('hide', !IS_SCREEN_SHARING_SUPPORTED);\n\n const btnMute = _makeButton({\n noRipple: true,\n callback: throttle(this.onMuteClick, 600, true)\n });\n btnMute.classList.add(className + '-microphone-button');\n\n const microphoneIcon = this.groupCallMicrophoneIcon = new GroupCallMicrophoneIcon();\n btnMute.append(microphoneIcon.container);\n\n const btnMore = _makeButton({\n // text: 'VoiceChat.Video.Stream.More'\n icon: 'settings_filled'\n });\n\n btnMore.classList.add('btn-disabled');\n btnMore.classList.toggle('hide', !IS_SCREEN_SHARING_SUPPORTED);\n\n const btnLeave = _makeButton({\n // text: 'VoiceChat.Leave',\n isDanger: true,\n callback: this.onLeaveClick,\n icon: 'close'\n });\n\n buttons.append(btnVideo, btnScreen, btnMute, btnMore, btnLeave);\n\n this.container.append(buttons);\n }\n\n private onFullScreenClick = () => {\n requestFullScreen(this.container);\n };\n\n private onToggleControls = (show: boolean) => {\n this.container.classList.toggle('show-controls', show);\n this.buttonsContainer.classList.toggle('show-controls', show);\n };\n\n private toggleDisability = toggleClassName.bind(null, 'btn-disabled');\n\n private onVideoClick = () => {\n const toggle = this.toggleDisability([this.btnVideo], true);\n this.instance.toggleVideoSharing().finally(() => {\n toggle();\n });\n };\n\n private onScreenClick = () => {\n const toggle = this.toggleDisability([this.btnScreen], true);\n this.instance.toggleScreenSharing().finally(() => {\n toggle();\n });\n };\n\n private onMuteClick = () => {\n const participant = this.instance.participant;\n if(!participant.pFlags.can_self_unmute) {\n if(participant.raise_hand_rating === undefined) {\n this.instance.changeRaiseHand(true);\n }\n } else {\n this.instance.toggleMuted();\n }\n };\n\n private onLeaveClick = async() => {\n const hangUp = (discard: boolean) => {\n this.instance.hangUp(discard);\n };\n\n if(await this.managers.appChatsManager.hasRights(this.instance.chatId, 'manage_call')) {\n PopupElement.createPopup(PopupPeer, 'popup-end-video-chat', {\n titleLangKey: 'VoiceChat.End.Title',\n descriptionLangKey: 'VoiceChat.End.Text',\n checkboxes: [{\n text: 'VoiceChat.End.Third'\n }],\n buttons: [{\n langKey: 'VoiceChat.End.OK',\n callback: (checkboxes) => {\n hangUp(!!checkboxes.size);\n },\n isDanger: true\n }]\n }).show();\n } else {\n hangUp(false);\n }\n };\n\n public getContainer() {\n return this.container;\n }\n\n private onFullScreenChange = () => {\n this.toggleBigLayout();\n const isFull = isFullScreen();\n\n const {btnFullScreen, btnExitFullScreen} = this;\n\n const wasFullScreen = this.container.classList.contains('is-full-screen');\n this.container.classList.toggle('is-full-screen', isFull);\n btnFullScreen && btnFullScreen.classList.toggle('hide', isFull);\n btnExitFullScreen && btnExitFullScreen.classList.toggle('hide', !isFull);\n this.btnClose.classList.toggle('hide', isFull);\n\n if(isFull !== wasFullScreen) {\n animationIntersector.checkAnimations2(isFull);\n\n themeController.setThemeColor(isFull ? '#000000' : undefined);\n }\n };\n\n private toggleBigLayout = () => {\n const isFull = isFullScreen();\n const movable = this.movablePanel?.movable;\n const isBig = (isFull || !!(movable && movable.width >= 680)) && !!this.videosCount;\n\n /* if(!isBig && isFull) {\n cancelFullScreen();\n return;\n } */\n\n const wasBig = this.container.classList.contains('is-big-layout');\n let buttons: HTMLElement[];\n if(isBig && !wasBig) { // fix buttons transition to 0 opacity\n buttons = Array.from(this.buttonsContainer.children) as HTMLElement[];\n buttons.forEach((element) => {\n element.style.opacity = '0';\n });\n\n void this.buttonsContainer.offsetLeft;\n }\n\n this.container.classList.toggle('is-big-layout', isBig);\n this.btnInvite.classList.toggle('hide', isBig);\n this.btnShowColumn.classList.toggle('hide', !isBig);\n\n if(buttons) {\n // window.requestAnimationFrame(() => {\n buttons.forEach((element) => {\n element.style.opacity = '';\n });\n // });\n }\n };\n\n private toggleRightColumn = () => {\n this.container.classList.toggle('is-right-column-shown');\n };\n\n private setHasPinned() {\n this.container.classList.toggle('has-pinned', !!this.instance.pinnedSource);\n }\n\n private updateInstance() {\n if(this.instance.state === GROUP_CALL_STATE.CLOSED) {\n if(this.container.classList.contains('is-full-screen')) {\n cancelFullScreen();\n }\n\n this.hide();\n return;\n }\n\n const {participant, groupCall} = this.instance;\n if(!participant) {\n return;\n }\n\n this.setTitle();\n this.setDescription();\n this.setHasPinned();\n\n const microphoneButtonState = getGroupCallMicrophoneButtonState(groupCall as any, participant);\n this.container.dataset.micState = microphoneButtonState === GROUP_CALL_MICROPHONE_BUTTON_STATE.HAND ? 'hand' : (microphoneButtonState === GROUP_CALL_MICROPHONE_BUTTON_STATE.MUTED ? 'muted' : 'unmuted');\n this.groupCallMicrophoneIcon.setState(microphoneButtonState);\n }\n\n private setTitle() {\n this.groupCallTitle.update(this.instance);\n }\n\n private setDescription() {\n this.groupCallDescription.update(this.instance);\n this.groupCallBodyHeaderDescription.update(this.instance);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport {GroupCallParticipant} from '../../layer';\nimport {i18n} from '../../lib/langPack';\nimport {GROUP_CALL_PARTICIPANT_MUTED_STATE} from '.';\nimport {GroupCallParticipantVideoType} from './participantVideo';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\n\nconst className = 'group-call-participant-status';\nexport default class GroupCallParticipantStatusElement {\n public container: HTMLElement;\n\n constructor(private withIcons: GroupCallParticipantVideoType[]) {\n this.container = document.createElement('div');\n this.container.classList.add(className + '-container');\n }\n\n public setState(state: GROUP_CALL_PARTICIPANT_MUTED_STATE, participant: GroupCallParticipant) {\n const states = GROUP_CALL_PARTICIPANT_MUTED_STATE;\n const icons = this.withIcons.filter((type) => !!participant[type]).map((type) => {\n const iconClassName = `tgico-${type === 'presentation' ? 'listscreenshare' : 'videocamera_filled'}`;\n const i = document.createElement('i');\n i.classList.add(className + '-icon', className + '-icon-' + type, iconClassName);\n return i;\n });\n\n let element2: HTMLElement, actionClassName: string;\n if(state === states.MUTED_FOR_ME) {\n element2 = i18n('VoiceChat.Status.MutedForYou');\n actionClassName = 'is-muted';\n } else if(state === states.UNMUTED) {\n element2 = i18n('VoiceChat.Status.Speaking');\n actionClassName = 'is-speaking';\n } else if(state === states.HAND) {\n element2 = i18n('VoiceChat.Status.WantsSpeak');\n actionClassName = 'is-waiting';\n } else if(participant.about && !icons.length) {\n setInnerHTML(this.container, wrapEmojiText(participant.about));\n return;\n } else {\n element2 = i18n('VoiceChat.Status.Listening');\n actionClassName = 'is-listening';\n }\n\n const span = document.createElement('span');\n span.classList.add(className, actionClassName);\n span.append(...icons, element2);\n\n replaceContent(this.container, span);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport positionElementByIndex from '../../helpers/dom/positionElementByIndex';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport {fastRaf} from '../../helpers/schedulers';\nimport SortedList, {SortedElementBase} from '../../helpers/sortedList';\nimport appDialogsManager, {DialogDom, AppDialogsManager, DialogElementSize} from '../../lib/appManagers/appDialogsManager';\nimport {getGroupCallParticipantMutedState} from '.';\nimport GroupCallParticipantMutedIcon from './participantMutedIcon';\nimport GroupCallParticipantStatusElement from './participantStatus';\nimport type GroupCallInstance from '../../lib/calls/groupCallInstance';\nimport type LazyLoadQueue from '../lazyLoadQueue';\n\ninterface SortedParticipant extends SortedElementBase {\n dom: DialogDom,\n mutedIcon: GroupCallParticipantMutedIcon,\n status: GroupCallParticipantStatusElement\n}\n\nexport default class GroupCallParticipantsList extends SortedList {\n public list: HTMLUListElement;\n\n protected lazyLoadQueue: LazyLoadQueue;\n protected avatarSize: DialogElementSize = 'abitbigger';\n protected rippleEnabled = true;\n protected autonomous = true;\n protected createChatListOptions: Parameters[0] = {/* new: true, */dialogSize: 72};\n\n constructor(private instance: GroupCallInstance) {\n super({\n getIndex: async(element) => (await this.instance.getParticipantByPeerId(element.id)).date,\n onDelete: (element) => {\n element.dom.listEl.remove();\n this.onElementDestroy(element);\n },\n onUpdate: async(element) => {\n const participant = await this.instance.getParticipantByPeerId(element.id);\n const state = getGroupCallParticipantMutedState(participant);\n\n element.mutedIcon.setState(state);\n element.status.setState(state, participant);\n },\n onSort: (element, idx) => {\n positionElementByIndex(element.dom.listEl, this.list, idx);\n },\n onElementCreate: (base) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: base.id,\n container: false,\n avatarSize: this.avatarSize,\n autonomous: this.autonomous,\n meAsSaved: false,\n rippleEnabled: this.rippleEnabled,\n wrapOptions: {\n lazyLoadQueue: this.lazyLoadQueue\n }\n });\n\n const className = 'group-call-participant';\n dom.listEl.classList.add(className);\n\n const mutedIcon = new GroupCallParticipantMutedIcon(true);\n const status = new GroupCallParticipantStatusElement(['presentation', 'video']);\n replaceContent(dom.lastMessageSpan, status.container);\n dom.listEl.append(mutedIcon.container);\n (base as SortedParticipant).mutedIcon = mutedIcon;\n (base as SortedParticipant).status = status;\n\n /* instance.getParticipantByPeerId(base.id).then((participant) => {\n const mutedState = getGroupCallParticipantMutedState(participant);\n\n mutedIcon.setState(mutedState);\n status.setState(mutedState, participant);\n }); */\n\n (base as SortedParticipant).dom = dom;\n\n return base as SortedParticipant;\n },\n updateElementWith: fastRaf\n });\n\n this.list = appDialogsManager.createChatList(this.createChatListOptions);\n }\n\n public destroy() {\n this.elements.forEach((element) => {\n this.onElementDestroy(element);\n });\n }\n\n protected onElementDestroy(element: SortedParticipant) {\n element.mutedIcon.destroy();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {animate} from '../../helpers/animation';\n\nexport default function callVideoCanvasBlur(video: HTMLVideoElement) {\n const canvas = document.createElement('canvas');\n canvas.classList.add('call-video-blur');\n const size = 16;\n canvas.width = size;\n canvas.height = size;\n\n const ctx = canvas.getContext('2d', {alpha: false});\n ctx.filter = 'blur(2px)';\n const renderFrame = () => {\n ctx.drawImage(video, 0, 0, video.videoWidth, video.videoHeight, 0, 0, canvas.width, canvas.height);\n };\n\n animate(() => {\n renderFrame();\n return canvas.isConnected;\n });\n\n renderFrame();\n\n return canvas;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {GroupCallParticipant} from '../../layer';\nimport type {GroupCallOutputSource} from '../../lib/appManagers/appGroupCallsManager';\nimport {i18n} from '../../lib/langPack';\nimport PeerTitle from '../peerTitle';\nimport {getGroupCallParticipantMutedState} from '.';\nimport GroupCallParticipantMutedIcon from './participantMutedIcon';\nimport GroupCallParticipantStatusElement from './participantStatus';\nimport GroupCallInstance from '../../lib/calls/groupCallInstance';\nimport callVideoCanvasBlur from '../call/videoCanvasBlur';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport {AppManagers} from '../../lib/appManagers/managers';\n\nconst className = 'group-call-participant-video';\n\nexport type GroupCallParticipantVideoType = 'video' | 'presentation';\nexport default class GroupCallParticipantVideoElement {\n public container: HTMLElement;\n private peerTitle: PeerTitle;\n private subtitle: HTMLElement;\n private info: HTMLElement;\n private left: HTMLElement;\n private right: HTMLElement;\n private header: HTMLElement;\n private groupCallParticipantMutedIcon: GroupCallParticipantMutedIcon;\n private groupCallParticipantStatus: GroupCallParticipantStatusElement;\n\n constructor(private managers: AppManagers, private instance: GroupCallInstance, public source: GroupCallOutputSource) {\n this.container = document.createElement('div');\n this.container.classList.add(className + '-container');\n\n this.info = document.createElement('div');\n this.info.classList.add(className + '-info');\n\n this.left = document.createElement('div');\n this.left.classList.add(className + '-info-left');\n\n this.right = document.createElement('div');\n this.right.classList.add(className + '-info-right');\n\n this.info.append(this.left, this.right);\n\n this.container.append(this.info);\n }\n\n public setPinned(value: boolean) {\n if(!value) {\n if(this.header) {\n this.header.remove();\n this.header = undefined;\n }\n\n return;\n } else if(this.header) {\n return;\n }\n\n // if(!this.header) {\n this.header = document.createElement('div');\n this.header.classList.add(className + '-header');\n\n const icon = document.createElement('i');\n icon.classList.add('group-call-pin-icon', 'tgico-pin');\n this.header.append(icon);\n\n this.container.append(this.header);\n // }\n\n // this.container.classList.toggle('is-pinned', value);\n }\n\n public setParticipant(participant: GroupCallParticipant, type: GroupCallParticipantVideoType, video: HTMLVideoElement) {\n let peerTitleElement: HTMLElement;\n if(participant.pFlags.self) {\n peerTitleElement = i18n('VoiceChat.Status.You');\n peerTitleElement.classList.add('peer-title');\n } else {\n this.peerTitle = new PeerTitle({\n peerId: getPeerId(participant.peer)\n });\n\n peerTitleElement = this.peerTitle.element;\n }\n\n this.groupCallParticipantMutedIcon = new GroupCallParticipantMutedIcon(false);\n this.groupCallParticipantStatus = new GroupCallParticipantStatusElement([type]);\n\n this.left.append(peerTitleElement, this.groupCallParticipantStatus.container);\n\n this.right.append(this.groupCallParticipantMutedIcon.container);\n\n video.classList.add(className, 'call-video');\n\n if(video.paused) {\n video.play();\n }\n\n const canvas = callVideoCanvasBlur(video);\n canvas.classList.add(className + '-blur');\n\n this.container.prepend(canvas, video);\n\n this.updateParticipant(participant);\n }\n\n public updateParticipant(participant: GroupCallParticipant) {\n const state = getGroupCallParticipantMutedState(participant);\n\n this.groupCallParticipantMutedIcon.setState(state);\n this.groupCallParticipantStatus.setState(state, participant);\n }\n\n public destroy() {\n this.groupCallParticipantMutedIcon.destroy();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport ControlsHover from '../../helpers/dom/controlsHover';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport {GroupCallParticipant} from '../../layer';\nimport {GroupCallOutputSource} from '../../lib/appManagers/appGroupCallsManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport GroupCallInstance from '../../lib/calls/groupCallInstance';\nimport rootScope from '../../lib/rootScope';\nimport GroupCallParticipantVideoElement, {GroupCallParticipantVideoType} from './participantVideo';\n\nexport default class GroupCallParticipantsVideoElement extends ControlsHover {\n private container: HTMLDivElement;\n private instance: GroupCallInstance;\n private participantsElements: Map>;\n private displayPinned: boolean;\n private containers: Map;\n private onLengthChange: (length: number) => void;\n private managers: AppManagers;\n\n constructor(options: {\n appendTo: HTMLElement,\n instance: GroupCallInstance,\n listenerSetter: ListenerSetter,\n displayPinned: boolean,\n onLengthChange?: GroupCallParticipantsVideoElement['onLengthChange'],\n managers: AppManagers\n }) {\n super();\n safeAssign(this, options);\n\n const className = 'group-call-participants-video';\n const container = this.container = document.createElement('div');\n this.container.classList.add(className + '-container');\n\n options.appendTo.append(container);\n\n this.participantsElements = new Map();\n this.containers = new Map();\n\n const {listenerSetter} = this;\n\n listenerSetter.add(rootScope)('group_call_participant', ({groupCallId, participant}) => {\n if(this.instance.id === groupCallId) {\n this.updateParticipant(participant);\n }\n });\n\n listenerSetter.add(this.instance)('pinned', (source) => {\n this.participantsElements.forEach((map) => {\n map.forEach((element) => {\n this.setElementDisplay(element, source);\n });\n });\n });\n\n attachClickEvent(this.container, (e) => {\n const container = findUpClassName(e.target, 'group-call-participant-video-container');\n if(!container) {\n return;\n }\n\n const element = this.containers.get(container);\n if(this.instance.pinnedSource === element.source) {\n this.instance.unpinAll();\n return;\n }\n\n this.instance.pinSource(element.source);\n }, {listenerSetter});\n\n this.setInstance(this.instance);\n\n this.setup({\n element: container,\n listenerSetter: listenerSetter,\n showOnLeaveToClassName: 'group-call-buttons'\n });\n }\n\n private shouldDisplayElement(element: GroupCallParticipantVideoElement, pinnedSource: GroupCallOutputSource) {\n return this.displayPinned ? !pinnedSource || element.source === pinnedSource : pinnedSource && element.source !== pinnedSource;\n }\n\n private setElementDisplay(element: GroupCallParticipantVideoElement, pinnedSource: GroupCallOutputSource) {\n const shouldDisplay = this.shouldDisplayElement(element, pinnedSource);\n element.container.classList.toggle('video-hidden', !shouldDisplay);\n\n const isPinned = element.source === pinnedSource;\n element.setPinned(isPinned);\n }\n\n private updateParticipant(participant: GroupCallParticipant) {\n const peerId = getPeerId(participant.peer);\n const types: GroupCallParticipantVideoType[] = ['video', 'presentation'];\n const hasAnyVideo = types.some((type) => !!participant[type]);\n let participantElements = this.participantsElements.get(peerId);\n if(!hasAnyVideo && !participantElements) {\n return;\n }\n\n if(!participantElements) {\n this.participantsElements.set(peerId, participantElements = new Map());\n }\n\n types.forEach((type) => {\n let element = participantElements.get(type);\n const participantVideo = participant[type];\n if(!!participantVideo === !!element) {\n if(element) {\n element.updateParticipant(participant);\n }\n\n return;\n }\n\n if(participantVideo) {\n const result = this.instance.getVideoElementFromParticipantByType(participant, type);\n if(!result) {\n return;\n }\n\n const {video, source} = result;\n\n element = new GroupCallParticipantVideoElement(this.managers, this.instance, source);\n\n this.containers.set(element.container, element);\n\n this.setElementDisplay(element, this.instance.pinnedSource);\n participantElements.set(type, element);\n element.setParticipant(participant, type, video);\n\n this.container.prepend(element.container);\n } else {\n participantElements.delete(type);\n element.container.remove();\n\n if(!participantElements.size) {\n this.participantsElements.delete(peerId);\n this.containers.delete(element.container);\n element.destroy();\n }\n }\n\n this._onLengthChange();\n });\n }\n\n private _onLengthChange() {\n const length = this.container.childElementCount;\n this.container.dataset.length = '' + length;\n this.container.dataset.layout = length <= 2 ? '1' : (length === 3 ? '3' : '4');\n\n this.onLengthChange && this.onLengthChange(length);\n }\n\n public async setInstance(instance: GroupCallInstance) {\n (await instance.participants).forEach((participant) => {\n this.updateParticipant(participant);\n });\n }\n\n public destroy() {\n this.containers.forEach((element) => {\n element.destroy();\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupGroupCall from '.';\nimport filterAsync from '../../helpers/array/filterAsync';\nimport contextMenuController from '../../helpers/contextMenuController';\nimport {attachContextMenuListener} from '../../helpers/dom/attachContextMenuListener';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport {addFullScreenListener, isFullScreen} from '../../helpers/dom/fullScreen';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport noop from '../../helpers/noop';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport positionMenu from '../../helpers/positionMenu';\nimport ScrollableLoader from '../../helpers/scrollableLoader';\nimport {GroupCallParticipant} from '../../layer';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport GroupCallInstance from '../../lib/calls/groupCallInstance';\nimport rootScope from '../../lib/rootScope';\nimport {ButtonMenuItemOptions, ButtonMenuSync} from '../buttonMenu';\nimport confirmationPopup from '../confirmationPopup';\nimport PeerTitle from '../peerTitle';\nimport PopupElement from '../popups';\nimport Scrollable from '../scrollable';\nimport GroupCallParticipantsList from './participantsList';\nimport GroupCallParticipantsVideoElement from './participantVideos';\n\nexport class GroupCallParticipantContextMenu {\n private buttons: (ButtonMenuItemOptions & {verify: (peerId: PeerId) => boolean | Promise})[];\n private element: HTMLElement;\n private chatId: ChatId;\n private targetPeerId: PeerId;\n private participant: GroupCallParticipant;\n private instance: GroupCallInstance;\n private canManageCall: boolean;\n private managers: AppManagers;\n\n constructor(options: {\n listenerSetter: ListenerSetter,\n onContextElement: HTMLElement,\n managers: AppManagers,\n instance: GroupCallInstance,\n }) {\n this.buttons = [{\n icon: 'gc_microphoneoff',\n text: 'VoiceChat.MutePeer',\n verify: () => this.canManageCall && this.participant.pFlags.can_self_unmute,\n onClick: () => this.toggleParticipantMuted(true)\n }, {\n icon: 'gc_microphone',\n text: 'VoiceChat.UnmutePeer',\n verify: () => this.canManageCall && !this.participant.pFlags.can_self_unmute,\n onClick: () => this.toggleParticipantMuted(false)\n }, {\n icon: 'gc_microphoneoff',\n text: 'VoiceChat.MuteForMe',\n verify: () => !this.canManageCall && !this.participant.pFlags.muted_by_you,\n onClick: () => this.toggleParticipantMuted(true)\n }, {\n icon: 'gc_microphone',\n text: 'VoiceChat.UnmuteForMe',\n verify: () => !this.canManageCall && this.participant.pFlags.muted_by_you,\n onClick: () => this.toggleParticipantMuted(false)\n }, {\n icon: 'newprivate',\n text: 'VoiceChat.OpenProfile',\n verify: () => true,\n onClick: this.onOpenProfileClick\n }, {\n icon: 'deleteuser danger',\n text: 'VoiceChat.RemovePeer',\n verify: () => this.managers.appChatsManager.hasRights(this.chatId, 'ban_users'),\n onClick: async() => {\n confirmationPopup({\n peerId: this.targetPeerId,\n title: new PeerTitle({peerId: this.targetPeerId}).element,\n descriptionLangKey: await this.managers.appChatsManager.isBroadcast(this.chatId) ? 'VoiceChat.RemovePeer.Confirm.Channel' : 'VoiceChat.RemovePeer.Confirm',\n descriptionLangArgs: [new PeerTitle({peerId: this.targetPeerId}).element],\n button: {\n langKey: 'VoiceChat.RemovePeer.Confirm.OK',\n isDanger: true\n }\n }).then(() => {\n this.managers.appChatsManager.kickFromChat(this.chatId, this.targetPeerId);\n }, noop);\n }\n }];\n\n const {listenerSetter} = options;\n this.managers = options.managers;\n this.instance = options.instance;\n this.chatId = this.instance.chatId;\n\n this.element = ButtonMenuSync({buttons: this.buttons, listenerSetter});\n this.element.classList.add('group-call-participant-menu', 'night');\n\n attachContextMenuListener({\n element: options.onContextElement,\n callback: async(e) => {\n const li = findUpClassName(e.target, 'group-call-participant');\n if(!li) {\n return;\n }\n\n if(this.element.parentElement !== appendTo) {\n appendTo.append(this.element);\n }\n\n cancelEvent(e);\n\n const peerId = this.targetPeerId = li.dataset.peerId.toPeerId();\n this.participant = await this.instance.getParticipantByPeerId(peerId);\n if(this.participant.pFlags.self) {\n return;\n }\n\n this.canManageCall = await this.managers.appChatsManager.hasRights(this.chatId, 'manage_call');\n\n await filterAsync(this.buttons, async(button) => {\n const good = await button.verify(peerId);\n button.element.classList.toggle('hide', !good);\n return good;\n });\n\n positionMenu((e as TouchEvent).touches ? (e as TouchEvent).touches[0] : e as MouseEvent, this.element, 'right');\n contextMenuController.openBtnMenu(this.element);\n },\n listenerSetter\n });\n\n listenerSetter.add(rootScope)('group_call_participant', ({groupCallId, participant}) => {\n if(this.instance.id === groupCallId) {\n const peerId = getPeerId(participant.peer);\n if(this.targetPeerId === peerId) {\n contextMenuController.close();\n }\n }\n });\n\n let appendTo: HTMLElement = document.body;\n addFullScreenListener(document.body, () => {\n const isFull = isFullScreen();\n appendTo = isFull ? PopupElement.getPopups(PopupGroupCall)[0].getContainer(): document.body;\n\n if(!isFull) {\n contextMenuController.close();\n }\n }, listenerSetter);\n }\n\n private onOpenProfileClick = () => {\n const popup = PopupElement.getPopups(PopupGroupCall)[0];\n if(popup) {\n popup.hide();\n }\n\n appImManager.setInnerPeer({peerId: this.targetPeerId});\n };\n\n private toggleParticipantMuted = (muted: boolean) => {\n this.instance.editParticipant(this.participant, {\n muted\n });\n };\n};\n\nexport default class GroupCallParticipantsElement {\n private container: HTMLDivElement;\n private sortedList: GroupCallParticipantsList;\n private instance: GroupCallInstance;\n private listenerSetter: ListenerSetter;\n private groupCallParticipantsVideo: GroupCallParticipantsVideoElement;\n private contextMenu: GroupCallParticipantContextMenu;\n private managers: AppManagers;\n\n constructor(options: {\n appendTo: HTMLElement,\n instance: GroupCallInstance,\n listenerSetter: ListenerSetter,\n managers: AppManagers\n }) {\n safeAssign(this, options);\n\n const className = 'group-call-participants';\n\n const scrollable = new Scrollable(undefined);\n scrollable.container.classList.add(className + '-scrollable');\n\n const container = this.container = document.createElement('div');\n container.classList.add(className);\n\n // const invite = Button(`btn-primary btn-transparent ${className}-invite`, {icon: 'adduser', text: 'VoiceChat.Invite.InviteMembers'});\n\n const sortedList = this.sortedList = new GroupCallParticipantsList(this.instance);\n\n const {instance, listenerSetter} = this;\n this.contextMenu = new GroupCallParticipantContextMenu({\n ...options,\n onContextElement: sortedList.list,\n listenerSetter,\n instance\n });\n\n this.groupCallParticipantsVideo = new GroupCallParticipantsVideoElement({\n ...options,\n appendTo: scrollable.container,\n displayPinned: false\n });\n\n scrollable.append(/* invite, */sortedList.list);\n container.append(scrollable.container);\n\n options.appendTo.append(container);\n\n listenerSetter.add(rootScope)('group_call_participant', ({groupCallId, participant}) => {\n if(this.instance.id === groupCallId) {\n this.updateParticipant(participant);\n }\n });\n\n const scrollableLoader = new ScrollableLoader({\n scrollable,\n getPromise: () => {\n return this.managers.appGroupCallsManager.getGroupCallParticipants(this.instance.id).then(({participants, isEnd}) => {\n participants.forEach((participant) => {\n this.updateParticipant(participant);\n });\n\n return isEnd;\n });\n }\n });\n\n this.setInstance(instance);\n }\n\n private updateParticipant(participant: GroupCallParticipant) {\n const peerId = getPeerId(participant.peer);\n const has = this.sortedList.has(peerId);\n if(participant.pFlags.left) {\n if(has) {\n this.sortedList.delete(peerId);\n }\n\n return;\n }\n\n if(!has) {\n this.sortedList.add(peerId);\n return;\n }\n\n this.sortedList.update(peerId);\n }\n\n public async setInstance(instance: GroupCallInstance) {\n // @ts-ignore\n /* const users = appUsersManager.users;\n for(const userId in users) {\n const participant: GroupCallParticipant = {\n _: 'groupCallParticipant',\n date: 0,\n peer: {_: 'peerUser', user_id: userId.toPeerId()},\n pFlags: {\n muted: true\n },\n source: 1\n };\n\n instance.participants.set(userId.toPeerId(), participant);\n this.updateParticipant(participant);\n } */\n const participants = await instance.participants;\n participants.forEach((participant) => {\n this.updateParticipant(participant);\n });\n }\n\n public destroy() {\n this.sortedList.destroy();\n this.groupCallParticipantsVideo.destroy();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {GroupCall} from '../../layer';\nimport GroupCallInstance from '../../lib/calls/groupCallInstance';\nimport GROUP_CALL_STATE from '../../lib/calls/groupCallState';\nimport I18n, {LangPackKey, FormatterArguments} from '../../lib/langPack';\n\nexport default class GroupCallDescriptionElement {\n private descriptionIntl: I18n.IntlElement;\n\n constructor(private appendTo: HTMLElement) {\n this.descriptionIntl = new I18n.IntlElement({\n key: 'VoiceChat.Status.Connecting'\n });\n\n this.descriptionIntl.element.classList.add('group-call-description');\n }\n\n public detach() {\n this.descriptionIntl.element.remove();\n }\n\n public update(instance: GroupCallInstance) {\n const {state} = instance;\n\n let key: LangPackKey, args: FormatterArguments;\n if(state === GROUP_CALL_STATE.CONNECTING) {\n key = 'VoiceChat.Status.Connecting';\n } else {\n key = 'VoiceChat.Status.Members';\n args = [(instance.groupCall as GroupCall.groupCall).participants_count];\n }\n\n const {descriptionIntl} = this;\n descriptionIntl.compareAndUpdate({\n key,\n args\n });\n\n if(!this.descriptionIntl.element.parentElement) {\n this.appendTo.append(this.descriptionIntl.element);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport {GroupCall} from '../../layer';\nimport GroupCallInstance from '../../lib/calls/groupCallInstance';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport PeerTitle from '../peerTitle';\n\nexport default class GroupCallTitleElement {\n private peerTitle: PeerTitle;\n\n constructor(private appendTo: HTMLElement) {\n this.peerTitle = new PeerTitle({peerId: 0});\n }\n\n public update(instance: GroupCallInstance) {\n const {peerTitle, appendTo} = this;\n const groupCall = instance.groupCall as GroupCall.groupCall;\n const peerId = instance.chatId.toPeerId(true);\n if(groupCall.title) {\n setInnerHTML(appendTo, wrapEmojiText(groupCall.title));\n } else {\n if(peerTitle.options.peerId !== peerId) {\n peerTitle.options.peerId = peerId;\n peerTitle.update();\n }\n\n if(peerTitle.element.parentElement !== appendTo) {\n appendTo.append(peerTitle.element);\n }\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport {i18n, LangPackKey} from '../../lib/langPack';\nimport ripple from '../ripple';\n\nexport default function makeButton(className: string, listenerSetter: ListenerSetter, options: {\n text?: LangPackKey | HTMLElement,\n isDanger?: boolean,\n noRipple?: boolean,\n callback?: () => void,\n icon?: string,\n isConfirm?: boolean,\n}) {\n const _className = className + '-button';\n const buttonDiv = document.createElement('div');\n buttonDiv.classList.add(_className, 'call-button', 'rp-overflow');\n\n if(options.icon) {\n buttonDiv.classList.add('tgico-' + options.icon);\n }\n\n if(!options.noRipple) {\n ripple(buttonDiv);\n }\n\n if(options.isDanger) {\n buttonDiv.classList.add(_className + '-red');\n }\n\n if(options.isConfirm) {\n buttonDiv.classList.add(_className + '-green');\n }\n\n if(options.callback) {\n attachClickEvent(buttonDiv, options.callback, {listenerSetter});\n }\n\n let ret = buttonDiv;\n if(options.text) {\n const div = document.createElement('div');\n div.classList.add(_className + '-container', 'call-button-container');\n\n const textEl = typeof(options.text) === 'string' ? i18n(options.text) : options.text;\n textEl.classList.add(_className + '-text', 'call-button-text');\n\n div.append(buttonDiv, textEl);\n\n ret = div;\n }\n\n return ret;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport EventListenerBase from '../helpers/eventListenerBase';\nimport mediaSizes from '../helpers/mediaSizes';\nimport clamp from '../helpers/number/clamp';\nimport safeAssign from '../helpers/object/safeAssign';\nimport windowSize from '../helpers/windowSize';\nimport SwipeHandler from './swipeHandler';\n\ntype ResizeSide = 'n' | 'e' | 's' | 'w' | 'ne' | 'se' | 'sw' | 'nw';\nexport type MovableState = {\n top?: number;\n left?: number;\n width: number;\n height: number;\n};\n\nconst className = 'movable-element';\nconst resizeHandlerClassName = className + '-resize-handler';\n\nexport type MovableElementOptions = {\n minWidth: MovableElement['minWidth'],\n minHeight: MovableElement['minHeight'],\n element: MovableElement['element'],\n verifyTouchTarget?: MovableElement['verifyTouchTarget']\n};\n\nexport default class MovableElement extends EventListenerBase<{\n resize: () => void\n}> {\n private minWidth: number;\n private minHeight: number;\n private element: HTMLElement;\n private verifyTouchTarget: SwipeHandler['verifyTouchTarget'];\n\n private top: number;\n private left: number;\n private _width: number;\n private _height: number;\n\n private swipeHandler: SwipeHandler;\n private handlers: HTMLElement[];\n\n constructor(options: MovableElementOptions) {\n super(true);\n safeAssign(this, options);\n\n this.top = this.left = this.width = this.height = 0;\n this.element.classList.add(className);\n\n this.addResizeHandlers();\n this.setSwipeHandler();\n\n mediaSizes.addEventListener('resize', this.onResize);\n }\n\n private onResize = () => {\n this.fixDimensions();\n this.fixPosition();\n this.setPosition();\n };\n\n public destroyElements() {\n this.element.classList.remove(className);\n\n if(this.handlers) {\n this.handlers.forEach((handler) => {\n handler.remove();\n });\n }\n }\n\n public destroy() {\n mediaSizes.removeEventListener('resize', this.onResize);\n this.swipeHandler.removeListeners();\n }\n\n private addResizeHandlers() {\n const sides: ResizeSide[] = ['n', 'e', 's', 'w', 'ne', 'se', 'sw', 'nw'];\n this.handlers = sides.map((side) => {\n const div = document.createElement('div');\n div.dataset.side = side;\n div.classList.add(resizeHandlerClassName, resizeHandlerClassName + '-side-' + side);\n this.element.append(div);\n return div;\n });\n }\n\n private setSwipeHandler() {\n let startTop: number, startLeft: number, startWidth: number, startHeight: number, resizingSide: ResizeSide;\n const swipeHandler = this.swipeHandler = new SwipeHandler({\n element: this.element,\n onSwipe: (xDiff, yDiff, e) => {\n // console.log(xDiff, yDiff, e);\n\n if(resizingSide) {\n if(resizingSide.includes('e') || resizingSide.includes('w')) {\n const isEnlarging = resizingSide.includes('e') && xDiff > 0 || resizingSide.includes('w') && xDiff < 0;\n const resizeDiff = Math.abs(xDiff) * (isEnlarging ? 1 : -1);\n\n const maxPossible = resizingSide.includes('e') ? windowSize.width - startLeft : startWidth + startLeft;\n this.width = Math.min(maxPossible, startWidth + resizeDiff);\n }\n\n if(resizingSide.includes('n') || resizingSide.includes('s')) {\n const isEnlarging = resizingSide.includes('s') && yDiff > 0 || resizingSide.includes('n') && yDiff < 0;\n const resizeDiff = Math.abs(yDiff) * (isEnlarging ? 1 : -1);\n\n const maxPossible = resizingSide.includes('s') ? windowSize.height - startTop : startHeight + startTop;\n this.height = Math.min(maxPossible, startHeight + resizeDiff);\n }\n\n this.fixDimensions();\n\n if(resizingSide.includes('w')) {\n this.left = Math.min(startLeft + startWidth - this.minWidth, startLeft + xDiff);\n }\n\n if(resizingSide.includes('n')) {\n this.top = Math.min(startTop + startHeight - this.minHeight, startTop + yDiff);\n }\n } else {\n this.top = startTop + yDiff;\n this.left = startLeft + xDiff;\n }\n\n this.fixPosition();\n this.setPosition();\n },\n verifyTouchTarget: (e) => {\n const target = e.target;\n if(this.verifyTouchTarget && !this.verifyTouchTarget(e)) {\n return false;\n }\n\n const resizeHandler = findUpClassName(target, resizeHandlerClassName);\n if(resizeHandler) {\n resizingSide = resizeHandler.dataset.side as ResizeSide;\n swipeHandler.setCursor('');\n } else {\n resizingSide = undefined;\n swipeHandler.setCursor('grabbing');\n }\n\n return true;\n },\n onFirstSwipe: () => {\n startTop = this.top;\n startLeft = this.left;\n startWidth = this.width;\n startHeight = this.height;\n }\n });\n }\n\n public setPositionToCenter() {\n this.top = (windowSize.height / 2) - (this.height / 2);\n this.left = (windowSize.width / 2) - (this.width / 2);\n this.setPosition();\n }\n\n private fixDimensions() {\n this.width = clamp(this.width, this.minWidth, windowSize.width);\n this.height = clamp(this.height, this.minHeight, windowSize.height);\n }\n\n private fixPosition() {\n this.top = clamp(this.top, 0, windowSize.height - this.height);\n this.left = clamp(this.left, 0, windowSize.width - this.width);\n }\n\n private setPosition() {\n this.element.style.top = this.top + 'px';\n this.element.style.left = this.left + 'px';\n this.element.style.right = 'auto';\n this.element.style.bottom = 'auto';\n this.element.style.width = this.width + 'px';\n this.element.style.height = this.height + 'px';\n\n this.dispatchEvent('resize');\n }\n\n public get width() {\n return this._width;\n }\n\n public get height() {\n return this._height;\n }\n\n private set width(value: number) {\n this._width = value;\n }\n\n private set height(value: number) {\n this._height = value;\n }\n\n public get state(): MovableState {\n const {top, left, width, height} = this;\n return {\n top,\n left,\n width,\n height\n };\n }\n\n public set state(state: MovableState) {\n const {top, left, width, height} = state;\n this.top = top;\n this.left = left;\n this.width = width;\n this.height = height;\n this.onResize();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport MovableElement, {MovableElementOptions, MovableState} from '../components/movableElement';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport ListenerSetter from './listenerSetter';\nimport mediaSizes, {ScreenSize} from './mediaSizes';\nimport safeAssign from './object/safeAssign';\n\nexport default class MovablePanel {\n #movable: MovableElement;\n private listenerSetter: ListenerSetter;\n private previousState: MovableState;\n private onResize: () => void;\n private movableOptions: MovableElementOptions;\n\n constructor(options: {\n listenerSetter: ListenerSetter,\n previousState: MovableState,\n onResize?: () => void,\n movableOptions: MovableElementOptions\n }) {\n safeAssign(this, options);\n\n this.toggleMovable(!IS_TOUCH_SUPPORTED);\n\n this.listenerSetter.add(mediaSizes)('changeScreen', (from, to) => {\n if(to === ScreenSize.mobile || from === ScreenSize.mobile) {\n this.toggleMovable(!IS_TOUCH_SUPPORTED);\n }\n });\n }\n\n public destroy() {\n const movable = this.movable;\n if(movable) {\n movable.destroy();\n }\n }\n\n public get movable() {\n return this.#movable;\n }\n\n public get state() {\n return this.movable ? this.movable.state : this.previousState;\n }\n\n public set state(state: MovableState) {\n this.previousState = state;\n }\n\n private toggleMovable(enabled: boolean) {\n let {movable} = this;\n if(enabled) {\n if(movable) {\n return;\n }\n\n movable = this.#movable = new MovableElement(this.movableOptions);\n\n movable.state = this.previousState;\n if(this.previousState.top === undefined) {\n movable.setPositionToCenter();\n }\n\n if(this.onResize) {\n this.listenerSetter.add(movable)('resize', this.onResize);\n }\n } else {\n if(!movable) {\n return;\n }\n\n this.previousState = movable.state;\n movable.destroyElements();\n movable.destroy();\n this.#movable = undefined;\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function toggleClassName(className: string, elements: HTMLElement[], disable: boolean) {\n elements.forEach((element) => {\n element.classList.toggle(className, disable);\n });\n\n return () => toggleClassName(className, elements, !disable);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport toHHMMSS from '../../helpers/string/toHHMMSS';\nimport CALL_STATE from '../../lib/calls/callState';\nimport {i18n, LangPackKey} from '../../lib/langPack';\n\nexport default class CallDescriptionElement {\n private container: HTMLElement;\n private state: CALL_STATE;\n private interval: number;\n\n constructor(private appendTo: HTMLElement) {\n this.container = document.createElement('div');\n this.container.classList.add('call-description');\n }\n\n public detach() {\n if(this.interval !== undefined) {\n clearInterval(this.interval);\n this.interval = undefined;\n }\n\n this.container.remove();\n this.state = undefined;\n }\n\n public update(instance: any) {\n const {connectionState} = instance;\n\n if(this.state === connectionState) {\n return;\n }\n\n this.state = connectionState;\n\n let element: HTMLElement;\n if(connectionState === CALL_STATE.CONNECTED) {\n element = document.createElement('span');\n element.classList.add('call-description-duration');\n\n const setTime = () => {\n element.innerText = toHHMMSS(instance.duration, true);\n };\n\n this.interval = window.setInterval(setTime, 1000);\n setTime();\n } else {\n let langPackKey: LangPackKey;\n switch(connectionState) {\n case CALL_STATE.PENDING:\n langPackKey = instance.isOutgoing ? 'Call.StatusRinging' : 'Call.StatusCalling';\n break;\n case CALL_STATE.REQUESTING:\n langPackKey = 'Call.StatusRequesting';\n break;\n case CALL_STATE.EXCHANGING_KEYS:\n langPackKey = 'VoipExchangingKeys';\n break;\n case CALL_STATE.CLOSED:\n langPackKey = instance.connectedAt !== undefined ? 'Call.StatusEnded' : 'Call.StatusFailed';\n break;\n default:\n langPackKey = 'Call.StatusConnecting';\n break;\n }\n\n element = i18n(langPackKey);\n if(this.interval !== undefined) {\n clearInterval(this.interval);\n this.interval = undefined;\n }\n }\n\n this.container.classList.toggle('has-duration', connectionState === CALL_STATE.CONNECTED);\n replaceContent(this.container, element);\n\n if(!this.container.parentElement) {\n this.appendTo.append(this.container);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SuperRLottieIcon} from '../superIcon';\n\nexport default class GroupCallMicrophoneIconMini extends SuperRLottieIcon<{\n PartState: boolean,\n ColorState: boolean,\n Items: {\n name: 'voice_mini'\n }[]\n}> {\n constructor(colored?: boolean, skipAnimation?: boolean) {\n super({\n width: 36,\n height: 36,\n getPart: (state) => {\n return this.getItem().getPart(state ? 'unmute' : 'mute');\n },\n getColor: colored ? (state) => {\n return state ? [255, 255, 255] : [158, 158, 158];\n } : undefined,\n skipAnimation\n });\n\n this.add({\n name: 'voice_mini',\n parts: [{\n startFrame: 0,\n endFrame: 35,\n name: 'hand-to-muted'\n }, {\n startFrame: 36,\n endFrame: 68,\n name: 'unmute'\n }, {\n startFrame: 69,\n endFrame: 98,\n name: 'mute'\n }, {\n startFrame: 99,\n endFrame: 135,\n name: 'muted-to-hand'\n }, {\n startFrame: 136,\n endFrame: 171,\n name: 'unmuted-to-hand'\n }]\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_SCREEN_SHARING_SUPPORTED from '../../environment/screenSharingSupport';\nimport {IS_MOBILE} from '../../environment/userAgent';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport ControlsHover from '../../helpers/dom/controlsHover';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport {addFullScreenListener, cancelFullScreen, isFullScreen, requestFullScreen} from '../../helpers/dom/fullScreen';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport MovablePanel from '../../helpers/movablePanel';\nimport onMediaLoad from '../../helpers/onMediaLoad';\nimport themeController from '../../helpers/themeController';\nimport toggleClassName from '../../helpers/toggleClassName';\nimport CallInstance from '../../lib/calls/callInstance';\nimport CALL_STATE from '../../lib/calls/callState';\nimport I18n, {i18n} from '../../lib/langPack';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport animationIntersector from '../animationIntersector';\nimport AvatarElement from '../avatar';\nimport ButtonIcon from '../buttonIcon';\nimport GroupCallMicrophoneIconMini from '../groupCall/microphoneIconMini';\nimport {MovableState} from '../movableElement';\nimport PeerTitle from '../peerTitle';\nimport PopupElement from '../popups';\nimport SetTransition from '../singleTransition';\nimport makeButton from './button';\nimport CallDescriptionElement from './description';\nimport callVideoCanvasBlur from './videoCanvasBlur';\n\nconst className = 'call';\n\nconst MIN_WIDTH = 400;\nconst MIN_HEIGHT = 580;\n\nconst INIT_STATE: MovableState = {\n width: MIN_WIDTH,\n height: MIN_HEIGHT\n};\n\nlet previousState: MovableState = {...INIT_STATE};\n\nexport default class PopupCall extends PopupElement {\n private peerId: PeerId;\n\n private description: CallDescriptionElement;\n private emojisSubtitle: HTMLElement;\n\n private partyStates: HTMLElement;\n private partyMutedState: HTMLElement;\n\n private firstButtonsRow: HTMLElement;\n private secondButtonsRow: HTMLElement;\n\n private declineI18nElement: I18n.IntlElement;\n\n private makeButton: (options: Parameters[2]) => HTMLElement;\n private btnAccept: HTMLElement;\n private btnDecline: HTMLElement;\n private btnVideo: HTMLElement;\n private btnScreen: HTMLElement;\n private btnMute: HTMLElement;\n private btnFullScreen: HTMLButtonElement;\n private btnExitFullScreen: HTMLButtonElement;\n\n private movablePanel: MovablePanel;\n private microphoneIcon: GroupCallMicrophoneIconMini;\n private muteI18nElement: I18n.IntlElement;\n\n private videoContainers: {\n input?: HTMLElement,\n output?: HTMLElement\n };\n\n private controlsHover: ControlsHover;\n\n constructor(private instance: CallInstance) {\n super('popup-call', {\n withoutOverlay: true,\n closable: true\n });\n\n this.videoContainers = {};\n\n const {container, listenerSetter} = this;\n container.classList.add(className, 'night');\n\n const avatarContainer = document.createElement('div');\n avatarContainer.classList.add(className + '-avatar');\n\n const peerId = this.peerId = this.instance.interlocutorUserId.toPeerId();\n const avatar = new AvatarElement();\n avatar.classList.add('avatar-full');\n avatar.updateWithOptions({\n isBig: true,\n peerId: peerId\n });\n avatarContainer.append(avatar);\n\n const title = new PeerTitle({\n peerId\n }).element;\n\n title.classList.add(className + '-title');\n\n const subtitle = document.createElement('div');\n subtitle.classList.add(className + '-subtitle');\n\n const description = this.description = new CallDescriptionElement(subtitle);\n\n const emojisSubtitle = this.emojisSubtitle = document.createElement('div');\n emojisSubtitle.classList.add(className + '-emojis');\n\n container.append(avatarContainer, title, subtitle);\n\n if(!IS_MOBILE) {\n this.btnFullScreen = ButtonIcon('fullscreen');\n this.btnExitFullScreen = ButtonIcon('smallscreen hide');\n attachClickEvent(this.btnFullScreen, this.onFullScreenClick, {listenerSetter});\n attachClickEvent(this.btnExitFullScreen, () => cancelFullScreen(), {listenerSetter});\n addFullScreenListener(this.container, this.onFullScreenChange, listenerSetter);\n this.header.prepend(this.btnExitFullScreen);\n this.header.append(this.btnFullScreen);\n\n container.append(emojisSubtitle);\n } else {\n this.header.append(emojisSubtitle);\n }\n\n this.partyStates = document.createElement('div');\n this.partyStates.classList.add(className + '-party-states');\n\n this.partyMutedState = document.createElement('div');\n this.partyMutedState.classList.add(className + '-party-state');\n const stateText = i18n('VoipUserMicrophoneIsOff', [new PeerTitle({peerId, onlyFirstName: true, limitSymbols: 18}).element]);\n stateText.classList.add(className + '-party-state-text');\n const mutedIcon = new GroupCallMicrophoneIconMini(false, true);\n mutedIcon.setState(false, false);\n this.partyMutedState.append(\n mutedIcon.container,\n stateText\n );\n\n this.partyStates.append(this.partyMutedState);\n this.container.append(this.partyStates);\n\n this.makeButton = makeButton.bind(null, className, this.listenerSetter);\n this.constructFirstButtons();\n this.constructSecondButtons();\n\n listenerSetter.add(instance)('state', () => {\n this.updateInstance();\n });\n\n listenerSetter.add(instance)('mediaState', () => {\n this.updateInstance();\n });\n\n this.movablePanel = new MovablePanel({\n listenerSetter,\n movableOptions: {\n minWidth: MIN_WIDTH,\n minHeight: MIN_HEIGHT,\n element: this.element,\n verifyTouchTarget: (e) => {\n const target = e.target;\n if(findUpClassName(target, 'call-button') ||\n findUpClassName(target, 'btn-icon') ||\n isFullScreen()) {\n return false;\n }\n\n return true;\n }\n },\n // onResize: () => this.toggleBigLayout(),\n previousState: !this.instance.wasTryingToJoin && !this.instance.isOutgoing ? {...INIT_STATE} : previousState\n });\n\n const movableElement = this.movablePanel.movable;\n if(movableElement) {\n this.listenerSetter.add(movableElement)('resize', () => {\n this.resizeVideoContainers();\n });\n }\n\n const controlsHover = this.controlsHover = new ControlsHover();\n controlsHover.setup({\n element: this.container,\n listenerSetter: this.listenerSetter,\n showOnLeaveToClassName: 'call-buttons'\n });\n controlsHover.showControls(false);\n\n this.addEventListener('close', () => {\n const {movablePanel} = this;\n previousState = movablePanel.state;\n\n this.microphoneIcon.destroy();\n\n movablePanel.destroy();\n });\n\n this.updateInstance();\n }\n\n public getCallInstance() {\n return this.instance;\n }\n\n private constructFirstButtons() {\n const buttons = this.firstButtonsRow = document.createElement('div');\n buttons.classList.add(className + '-buttons', 'is-first');\n\n const toggleDisability = toggleClassName.bind(null, 'btn-disabled');\n\n const btnVideo = this.btnVideo = this.makeButton({\n text: 'Call.Camera',\n icon: 'videocamera_filled',\n callback: () => {\n const toggle = toggleDisability([btnVideo, btnScreen], true);\n this.instance.toggleVideoSharing().finally(toggle);\n }\n });\n\n const btnScreen = this.btnScreen = this.makeButton({\n text: 'Call.Screen',\n icon: 'sharescreen_filled',\n callback: () => {\n const toggle = toggleDisability([btnVideo, btnScreen], true);\n this.instance.toggleScreenSharing().finally(toggle);\n }\n });\n\n if(!IS_SCREEN_SHARING_SUPPORTED) {\n btnScreen.classList.add('hide');\n this.container.classList.add('no-screen');\n }\n\n this.muteI18nElement = new I18n.IntlElement({\n key: 'Call.Mute'\n });\n const btnMute = this.btnMute = this.makeButton({\n text: this.muteI18nElement.element,\n callback: () => {\n this.instance.toggleMuted();\n }\n });\n\n const microphoneIcon = this.microphoneIcon = new GroupCallMicrophoneIconMini(true, true);\n btnMute.firstElementChild.append(microphoneIcon.container);\n\n // btnVideo.classList.add('disabled');\n // btnScreen.classList.add('disabled');\n\n buttons.append(btnVideo, btnScreen, btnMute);\n this.container.append(buttons);\n }\n\n private constructSecondButtons() {\n const buttons = this.secondButtonsRow = document.createElement('div');\n buttons.classList.add(className + '-buttons', 'is-second');\n\n this.declineI18nElement = new I18n.IntlElement({\n key: 'Call.Decline'\n });\n const btnDecline = this.btnDecline = this.makeButton({\n text: this.declineI18nElement.element,\n icon: 'endcall_filled',\n callback: () => {\n this.instance.hangUp('phoneCallDiscardReasonHangup');\n },\n isDanger: true\n });\n\n const btnAccept = this.btnAccept = this.makeButton({\n text: 'Call.Accept',\n icon: 'phone_filled',\n callback: () => {\n this.instance.acceptCall();\n },\n isConfirm: true\n });\n\n buttons.append(btnDecline, btnAccept);\n this.container.append(buttons);\n }\n\n private onFullScreenClick = () => {\n requestFullScreen(this.container);\n };\n\n private onFullScreenChange = () => {\n const isFull = isFullScreen();\n\n const {btnFullScreen, btnExitFullScreen} = this;\n\n const wasFullScreen = this.container.classList.contains('is-full-screen');\n this.container.classList.toggle('is-full-screen', isFull);\n btnFullScreen && btnFullScreen.classList.toggle('hide', isFull);\n btnExitFullScreen && btnExitFullScreen.classList.toggle('hide', !isFull);\n this.btnClose.classList.toggle('hide', isFull);\n\n if(isFull !== wasFullScreen) {\n animationIntersector.checkAnimations(isFull);\n\n themeController.setThemeColor(isFull ? '#000000' : undefined);\n\n this.resizeVideoContainers();\n }\n };\n\n private createVideoContainer(video: HTMLVideoElement) {\n const _className = className + '-video';\n const container = document.createElement('div');\n container.classList.add(_className + '-container');\n\n video.classList.add(_className);\n if(video.paused) {\n video.play();\n }\n\n attachClickEvent(container, () => {\n if(!container.classList.contains('small')) {\n return;\n }\n\n const big = Object.values(this.videoContainers).find((container) => !container.classList.contains('small'));\n big.classList.add('small');\n big.style.cssText = container.style.cssText;\n container.classList.remove('small');\n container.style.cssText = '';\n\n this.resizeVideoContainers();\n });\n\n const canvas = callVideoCanvasBlur(video);\n canvas.classList.add(_className + '-blur');\n\n container.append(canvas, video);\n\n return container;\n }\n\n private updateInstance() {\n const {instance} = this;\n const {connectionState} = instance;\n if(connectionState === CALL_STATE.CLOSED) {\n if(this.container.classList.contains('is-full-screen')) {\n cancelFullScreen();\n }\n\n this.btnVideo.classList.add('disabled');\n\n this.hide();\n return;\n }\n\n const isPendingIncoming = !instance.isOutgoing && connectionState === CALL_STATE.PENDING;\n this.declineI18nElement.compareAndUpdate({\n key: connectionState === CALL_STATE.PENDING ? 'Call.Decline' : 'Call.End'\n });\n this.btnAccept.classList.toggle('disable', !isPendingIncoming);\n this.btnAccept.classList.toggle('hide-me', !isPendingIncoming);\n this.container.classList.toggle('two-button-rows', isPendingIncoming);\n\n const isMuted = instance.isMuted;\n const onFrame = () => {\n this.btnMute.firstElementChild.classList.toggle('active', isMuted);\n };\n\n const player = this.microphoneIcon.getItem().player;\n this.microphoneIcon.setState(!isMuted, !isMuted, onFrame);\n if(!player) {\n onFrame();\n }\n\n this.muteI18nElement.compareAndUpdate({\n key: isMuted ? 'VoipUnmute' : 'Call.Mute'\n });\n\n const isSharingVideo = instance.isSharingVideo;\n this.btnVideo.firstElementChild.classList.toggle('active', isSharingVideo);\n\n const isSharingScreen = instance.isSharingScreen;\n this.btnScreen.firstElementChild.classList.toggle('active', isSharingScreen);\n\n const outputState = instance.getMediaState('output');\n\n SetTransition({\n element: this.partyMutedState,\n className: 'is-visible',\n forwards: !!outputState?.muted,\n duration: 300\n });\n\n const containers = this.videoContainers;\n const oldContainers = {...containers};\n ['input' as const, 'output' as const].forEach((type) => {\n const mediaState = instance.getMediaState(type);\n const video = instance.getVideoElement(type) as HTMLVideoElement;\n\n const hasFrame = !!(video && video.videoWidth && video.videoHeight);\n if(video && !hasFrame && !video.dataset.hasPromise) {\n video.dataset.hasPromise = '1';\n // container.classList.add('hide');\n onMediaLoad(video).then(() => {\n delete video.dataset.hasPromise;\n this.updateInstance();\n // this.resizeVideoContainers();\n // container.classList.remove('hide');\n });\n }\n\n const isActive = !!video && hasFrame && !!(mediaState && (mediaState.videoState === 'active' || mediaState.screencastState === 'active'));\n let videoContainer = containers[type];\n\n if(isActive && video && !videoContainer) {\n videoContainer = containers[type] = this.createVideoContainer(video);\n this.container.append(videoContainer);\n }\n\n if(!isActive && videoContainer) {\n videoContainer.remove();\n delete containers[type];\n }\n });\n\n {\n const input = containers.input;\n const output = containers.output;\n if(Object.keys(oldContainers).length !== Object.keys(containers).length && input) {\n input.classList.toggle('small', !!output);\n }\n\n if(output && !input) {\n output.classList.remove('small');\n }\n }\n\n this.resizeVideoContainers();\n\n this.container.classList.toggle('no-video', !Object.keys(containers).length);\n\n if(!this.emojisSubtitle.textContent && connectionState < CALL_STATE.EXCHANGING_KEYS) {\n Promise.resolve(instance.getEmojisFingerprint()).then((emojis) => {\n replaceContent(this.emojisSubtitle, wrapEmojiText(emojis.join('')));\n });\n }\n\n this.setDescription();\n }\n\n private resizeVideoContainers() {\n Object.values(this.videoContainers).forEach((container) => {\n const isSmall = container.classList.contains('small');\n if(isSmall) {\n const video = container.querySelector('video');\n const popupWidth = this.movablePanel.state;\n const MAX_WIDTH_PX = 240;\n const MAX_HEIGHT_PX = 240;\n\n const isVertical = video.videoHeight > video.videoWidth;\n const MAX_SIZE = isVertical ? MAX_HEIGHT_PX : MAX_WIDTH_PX;\n\n const biggestSideSize = 1 / 3 * (isFullScreen() ? 0xFFFF : (isVertical ? popupWidth.height : popupWidth.width));\n const widthRatio = isVertical ? video.videoWidth / video.videoHeight : 1;\n const heightRatio = isVertical ? 1 : video.videoHeight / video.videoWidth;\n container.style.width = biggestSideSize * widthRatio + 'px';\n container.style.height = biggestSideSize * heightRatio + 'px';\n container.style.maxWidth = MAX_SIZE * widthRatio + 'px';\n container.style.maxHeight = MAX_SIZE * heightRatio + 'px';\n } else {\n container.style.cssText = '';\n }\n });\n }\n\n private setDescription() {\n this.description.update(this.instance);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport GROUP_CALL_STATE from '../lib/calls/groupCallState';\nimport rootScope from '../lib/rootScope';\nimport ButtonIcon from './buttonIcon';\nimport TopbarWeave from './topbarWeave';\nimport SetTransition from './singleTransition';\nimport PopupGroupCall from './groupCall';\nimport GroupCallDescriptionElement from './groupCall/description';\nimport GroupCallTitleElement from './groupCall/title';\nimport PopupElement from './popups';\nimport throttle from '../helpers/schedulers/throttle';\nimport GroupCallInstance from '../lib/calls/groupCallInstance';\nimport CALL_STATE from '../lib/calls/callState';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport PeerTitle from './peerTitle';\nimport CallDescriptionElement from './call/description';\nimport PopupCall from './call';\nimport GroupCallMicrophoneIconMini from './groupCall/microphoneIconMini';\nimport CallInstance from '../lib/calls/callInstance';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport groupCallsController from '../lib/calls/groupCallsController';\nimport StreamManager from '../lib/calls/streamManager';\nimport callsController from '../lib/calls/callsController';\n\nfunction convertCallStateToGroupState(state: CALL_STATE, isMuted: boolean) {\n switch(state) {\n case CALL_STATE.CLOSING:\n case CALL_STATE.CLOSED:\n return GROUP_CALL_STATE.CLOSED;\n case CALL_STATE.CONNECTED:\n return isMuted ? GROUP_CALL_STATE.MUTED : GROUP_CALL_STATE.UNMUTED;\n default:\n return GROUP_CALL_STATE.CONNECTING;\n }\n}\n\nconst CLASS_NAME = 'topbar-call';\n\nexport default class TopbarCall {\n public container: HTMLElement;\n private listenerSetter: ListenerSetter;\n private weave: TopbarWeave;\n private center: HTMLDivElement;\n private groupCallTitle: GroupCallTitleElement;\n private groupCallDescription: GroupCallDescriptionElement;\n private groupCallMicrophoneIconMini: GroupCallMicrophoneIconMini;\n private callDescription: CallDescriptionElement;\n\n private currentDescription: GroupCallDescriptionElement | CallDescriptionElement;\n\n private instance: GroupCallInstance | any/* CallInstance */;\n private instanceListenerSetter: ListenerSetter;\n\n constructor(\n private managers: AppManagers\n ) {\n const listenerSetter = this.listenerSetter = new ListenerSetter();\n\n listenerSetter.add(callsController)('instance', ({instance}) => {\n if(!this.instance) {\n this.updateInstance(instance);\n }\n });\n\n listenerSetter.add(callsController)('accepting', (instance) => {\n if(this.instance !== instance) {\n this.updateInstance(instance);\n }\n });\n\n listenerSetter.add(groupCallsController)('instance', (instance) => {\n this.updateInstance(instance);\n });\n\n listenerSetter.add(rootScope)('group_call_update', (groupCall) => {\n const instance = groupCallsController.groupCall;\n if(instance?.id === groupCall.id) {\n this.updateInstance(instance);\n }\n });\n\n listenerSetter.add(StreamManager.ANALYSER_LISTENER)('amplitude', ({amplitudes, type}) => {\n const {weave} = this;\n if(!amplitudes.length || !weave/* || type !== 'input' */) return;\n\n let max = 0;\n for(let i = 0; i < amplitudes.length; ++i) {\n const {type, value} = amplitudes[i];\n max = value > max ? value : max;\n }\n\n weave.setAmplitude(max);\n });\n }\n\n private onState = () => {\n this.updateInstance(this.instance);\n };\n\n private clearCurrentInstance() {\n if(!this.instance) return;\n this.center.textContent = '';\n\n if(this.currentDescription) {\n this.currentDescription.detach();\n this.currentDescription = undefined;\n }\n\n this.instance = undefined;\n this.instanceListenerSetter.removeAll();\n }\n\n private updateInstance(instance: TopbarCall['instance']) {\n if(this.construct) {\n this.construct();\n this.construct = undefined;\n }\n\n const isChangingInstance = this.instance !== instance;\n if(isChangingInstance) {\n this.clearCurrentInstance();\n\n this.instance = instance;\n this.instanceListenerSetter = new ListenerSetter();\n\n this.instanceListenerSetter.add(instance as GroupCallInstance)('state', this.onState);\n\n if(instance instanceof GroupCallInstance) {\n this.currentDescription = this.groupCallDescription;\n } else {\n this.currentDescription = this.callDescription;\n this.instanceListenerSetter.add(instance)('muted', this.onState);\n }\n\n this.container.classList.toggle('is-call', !(instance instanceof GroupCallInstance));\n }\n\n const isMuted = this.instance.isMuted;\n const state = instance instanceof GroupCallInstance ? instance.state : convertCallStateToGroupState(instance.connectionState, isMuted);\n\n const {weave} = this;\n\n weave.componentDidMount();\n\n const isClosed = state === GROUP_CALL_STATE.CLOSED;\n if((!document.body.classList.contains('is-calling') || isChangingInstance) || isClosed) {\n if(isClosed) {\n weave.setAmplitude(0);\n }\n\n SetTransition({\n element: document.body,\n className: 'is-calling',\n forwards: !isClosed,\n duration: 250,\n onTransitionEnd: isClosed ? () => {\n weave.componentWillUnmount();\n\n this.clearCurrentInstance();\n } : undefined\n });\n }\n\n if(isClosed) {\n return;\n }\n\n weave.setCurrentState(state, true);\n // if(state === GROUP_CALL_STATE.CONNECTING) {\n // weave.setCurrentState(state, true);\n // } else {\n // /* var a = 0;\n // animate(() => {\n // a += 0.1;\n // if(a > 1) a = 0;\n // weave.setAmplitude(a);\n // return true;\n // });\n // weave.setAmplitude(1); */\n // weave.setCurrentState(state, true);\n // }\n\n this.setTitle(instance);\n this.setDescription(instance);\n this.groupCallMicrophoneIconMini.setState(!isMuted);\n }\n\n private setDescription(instance: TopbarCall['instance']) {\n return this.currentDescription.update(instance as any);\n }\n\n private setTitle(instance: TopbarCall['instance']) {\n if(instance instanceof GroupCallInstance) {\n return this.groupCallTitle.update(instance);\n } else {\n replaceContent(this.center, new PeerTitle({peerId: instance.interlocutorUserId.toPeerId()}).element);\n }\n }\n\n private construct() {\n const {listenerSetter} = this;\n const container = this.container = document.createElement('div');\n container.classList.add('sidebar-header', CLASS_NAME + '-container');\n\n const left = document.createElement('div');\n left.classList.add(CLASS_NAME + '-left');\n\n const groupCallMicrophoneIconMini = this.groupCallMicrophoneIconMini = new GroupCallMicrophoneIconMini();\n\n const mute = ButtonIcon();\n mute.append(groupCallMicrophoneIconMini.container);\n left.append(mute);\n\n const throttledMuteClick = throttle(() => {\n this.instance.toggleMuted();\n }, 600, true);\n\n attachClickEvent(mute, (e) => {\n cancelEvent(e);\n throttledMuteClick();\n }, {listenerSetter});\n\n const center = this.center = document.createElement('div');\n center.classList.add(CLASS_NAME + '-center');\n\n this.groupCallTitle = new GroupCallTitleElement(center);\n this.groupCallDescription = new GroupCallDescriptionElement(left);\n\n this.callDescription = new CallDescriptionElement(left);\n\n const right = document.createElement('div');\n right.classList.add(CLASS_NAME + '-right');\n\n const end = ButtonIcon('endcall_filled');\n right.append(end);\n\n attachClickEvent(end, (e) => {\n cancelEvent(e);\n\n const {instance} = this;\n if(!instance) {\n return;\n }\n\n if(instance instanceof GroupCallInstance) {\n instance.hangUp();\n } else {\n instance.hangUp('phoneCallDiscardReasonHangup');\n }\n }, {listenerSetter});\n\n attachClickEvent(container, () => {\n if(this.instance instanceof GroupCallInstance) {\n if(PopupElement.getPopups(PopupGroupCall).length) {\n return;\n }\n\n PopupElement.createPopup(PopupGroupCall).show();\n } else if(this.instance instanceof CallInstance) {\n const popups = PopupElement.getPopups(PopupCall);\n if(popups.find((popup) => popup.getCallInstance() === this.instance)) {\n return;\n }\n\n PopupElement.createPopup(PopupCall, this.instance).show();\n }\n }, {listenerSetter});\n\n container.append(left, center, right);\n\n const weave = this.weave = new TopbarWeave();\n const weaveContainer = weave.render(CLASS_NAME + '-weave');\n container.prepend(weaveContainer);\n\n document.getElementById('column-center').prepend(container);\n weave.componentDidMount();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {PushNotificationObject} from '../serviceWorker/push';\nimport getPeerTitle from '../../components/wrappers/getPeerTitle';\nimport wrapMessageForReply from '../../components/wrappers/messageForReply';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport {FontFamily} from '../../config/font';\nimport {NOTIFICATION_BADGE_PATH, NOTIFICATION_ICON_PATH} from '../../config/notifications';\nimport {IS_MOBILE} from '../../environment/userAgent';\nimport IS_VIBRATE_SUPPORTED from '../../environment/vibrateSupport';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport drawCircle from '../../helpers/canvas/drawCircle';\nimport customProperties from '../../helpers/dom/customProperties';\nimport idleController from '../../helpers/idleController';\nimport deepEqual from '../../helpers/object/deepEqual';\nimport tsNow from '../../helpers/tsNow';\nimport {Message, MessagePeerReaction, PeerNotifySettings} from '../../layer';\nimport I18n, {FormatterArguments, LangPackKey} from '../langPack';\nimport apiManagerProxy from '../mtproto/mtprotoworker';\nimport singleInstance from '../mtproto/singleInstance';\nimport webPushApiManager, {PushSubscriptionNotify} from '../mtproto/webPushApiManager';\nimport fixEmoji from '../richTextProcessor/fixEmoji';\nimport getAbbreviation from '../richTextProcessor/getAbbreviation';\nimport wrapPlainText from '../richTextProcessor/wrapPlainText';\nimport rootScope from '../rootScope';\nimport appImManager from './appImManager';\nimport appRuntimeManager from './appRuntimeManager';\nimport {AppManagers} from './managers';\nimport generateMessageId from './utils/messageId/generateMessageId';\nimport getMessageThreadId from './utils/messages/getMessageThreadId';\nimport getPeerColorById from './utils/peers/getPeerColorById';\nimport getPeerId from './utils/peers/getPeerId';\nimport {logger} from '../logger';\n\ntype MyNotification = Notification & {\n hidden?: boolean,\n show?: () => void,\n};\n\nexport type NotifyOptions = Partial<{\n tag: string;\n image: string;\n key: string;\n title: string;\n message: string;\n silent: boolean;\n onclick: () => void;\n noIncrement: boolean;\n}>;\n\nexport type NotificationSettings = {\n nodesktop: boolean,\n volume: number,\n novibrate: boolean,\n nopreview: boolean,\n nopush: boolean,\n nosound: boolean\n};\n\nexport class UiNotificationsManager {\n private notificationsUiSupport: boolean;\n private notificationsShown: {[key: string]: MyNotification | true} = {};\n private notificationIndex = 0;\n private notificationsCount = 0;\n private soundsPlayed: {[tag: string]: number} = {};\n private vibrateSupport = IS_VIBRATE_SUPPORTED;\n private nextSoundAt: number;\n private prevSoundVolume: number;\n\n private faviconElements = Array.from(document.head.querySelectorAll('link[rel=\"icon\"], link[rel=\"alternate icon\"]'));\n\n private titleBackup = document.title;\n private titleChanged = false;\n private titleInterval: number;\n private prevFavicon: string;\n\n private notifySoundEl: HTMLElement;\n\n private stopped = false;\n\n private topMessagesDeferred: CancellablePromise;\n\n private settings: NotificationSettings = {} as any;\n\n private registeredDevice: any;\n private pushInited = false;\n\n private managers: AppManagers;\n private setAppBadge: (contents?: any) => Promise;\n\n private avatarCanvas: HTMLCanvasElement;\n private avatarContext: CanvasRenderingContext2D;\n private avatarGradients: {[color: string]: CanvasGradient};\n\n private log: ReturnType;\n\n construct(managers: AppManagers) {\n this.managers = managers;\n\n this.log = logger('NOTIFICATIONS');\n\n navigator.vibrate = navigator.vibrate || (navigator as any).mozVibrate || (navigator as any).webkitVibrate;\n this.setAppBadge = (navigator as any).setAppBadge && (navigator as any).setAppBadge.bind(navigator);\n this.setAppBadge && this.setAppBadge(0);\n\n this.notificationsUiSupport = ('Notification' in window) || ('mozNotification' in navigator);\n\n this.notifySoundEl = document.createElement('div');\n this.notifySoundEl.id = 'notify-sound';\n document.body.append(this.notifySoundEl);\n\n this.topMessagesDeferred = deferredPromise();\n\n singleInstance.addEventListener('deactivated', () => {\n this.stop();\n });\n\n singleInstance.addEventListener('activated', () => {\n if(this.stopped) {\n this.start();\n }\n });\n\n idleController.addEventListener('change', (idle) => {\n if(this.stopped) {\n return;\n }\n\n if(!idle) {\n this.clear();\n }\n\n this.toggleToggler();\n });\n\n rootScope.addEventListener('notification_reset', (peerString) => {\n this.soundReset(peerString);\n });\n\n rootScope.addEventListener('notification_cancel', (str) => {\n this.cancel(str);\n });\n\n if(this.setAppBadge) {\n rootScope.addEventListener('folder_unread', (folder) => {\n if(folder.id === 0) {\n this.setAppBadge(folder.unreadUnmutedPeerIds.size);\n }\n });\n }\n\n webPushApiManager.addEventListener('push_init', (tokenData) => {\n this.pushInited = true;\n if(!this.settings.nodesktop && !this.settings.nopush) {\n if(tokenData) {\n this.registerDevice(tokenData);\n } else {\n webPushApiManager.subscribe();\n }\n } else {\n this.unregisterDevice(tokenData);\n }\n });\n webPushApiManager.addEventListener('push_subscribe', (tokenData) => {\n this.registerDevice(tokenData);\n });\n webPushApiManager.addEventListener('push_unsubscribe', (tokenData) => {\n this.unregisterDevice(tokenData);\n });\n\n rootScope.addEventListener('dialogs_multiupdate', () => {\n // unregisterTopMsgs()\n this.topMessagesDeferred.resolve();\n }, {once: true});\n\n webPushApiManager.addEventListener('push_notification_click', (notificationData) => {\n if(notificationData.action === 'push_settings') {\n /* this.topMessagesDeferred.then(() => {\n $modal.open({\n templateUrl: templateUrl('settings_modal'),\n controller: 'SettingsModalController',\n windowClass: 'settings_modal_window mobile_modal',\n backdrop: 'single'\n })\n }); */\n return;\n }\n\n if(notificationData.action === 'mute1d') {\n this.managers.apiManager.invokeApi('account.updateDeviceLocked', {\n period: 86400\n }).then(() => {\n // var toastData = toaster.pop({\n // type: 'info',\n // body: _('push_action_mute1d_success'),\n // bodyOutputType: 'trustedHtml',\n // clickHandler: () => {\n // toaster.clear(toastData)\n // },\n // showCloseButton: false\n // })\n });\n\n return;\n }\n\n const peerId = notificationData.custom && notificationData.custom.peerId.toPeerId();\n console.log('click', notificationData, peerId);\n if(peerId) {\n this.topMessagesDeferred.then(async() => {\n const chatId = peerId.isAnyChat() ? peerId.toChatId() : undefined;\n if(chatId && !(await this.managers.appChatsManager.hasChat(chatId))) {\n return;\n }\n\n if(peerId.isUser() && !(await this.managers.appUsersManager.hasUser(peerId.toUserId()))) {\n return;\n }\n\n appImManager.setInnerPeer({\n peerId,\n lastMsgId: generateMessageId(+notificationData.custom.msg_id)\n });\n });\n }\n });\n }\n\n public async buildNotification({\n message,\n fwdCount,\n peerReaction,\n peerTypeNotifySettings\n }: {\n message: Message.message | Message.messageService,\n fwdCount?: number,\n peerReaction?: MessagePeerReaction,\n peerTypeNotifySettings?: PeerNotifySettings\n }) {\n const peerId = message.peerId;\n const isAnyChat = peerId.isAnyChat();\n const notification: NotifyOptions = {};\n const [peerString, isForum = false] = await Promise.all([\n this.managers.appPeersManager.getPeerString(peerId),\n isAnyChat && this.managers.appPeersManager.isForum(peerId)\n ]);\n let notificationMessage: string;\n let wrappedMessage = false;\n\n if(peerTypeNotifySettings.show_previews) {\n if(message._ === 'message' && message.fwd_from && fwdCount > 1) {\n notificationMessage = I18n.format('Notifications.Forwarded', true, [fwdCount]);\n } else {\n notificationMessage = await wrapMessageForReply({message, plain: true});\n\n const reaction = peerReaction?.reaction;\n if(reaction?._ === 'reactionEmoji') {\n const langPackKey: LangPackKey = /* isAnyChat ? 'Notification.Group.Reacted' : */'Notification.Contact.Reacted';\n const args: FormatterArguments = [\n fixEmoji(reaction.emoticon), // can be plain heart\n notificationMessage\n ];\n\n /* if(isAnyChat) {\n args.unshift(appPeersManager.getPeerTitle(message.fromId, true));\n } */\n\n notificationMessage = I18n.format(langPackKey, true, args);\n } else {\n wrappedMessage = true;\n }\n }\n } else {\n notificationMessage = I18n.format('Notifications.New', true);\n }\n\n if(peerReaction) {\n notification.noIncrement = true;\n notification.silent = true;\n }\n\n const peerTitleOptions/* : Partial[0]> */ = {\n plainText: true as const,\n managers: this.managers\n };\n\n const threadId = isForum ? getMessageThreadId(message, isForum) : undefined;\n const notificationFromPeerId = peerReaction ? getPeerId(peerReaction.peer_id) : message.fromId;\n const peerTitle = notification.title = await getPeerTitle({...peerTitleOptions, peerId, threadId: threadId});\n if(isForum) {\n const peerTitle = await getPeerTitle({...peerTitleOptions, peerId});\n notification.title += ` (${peerTitle})`;\n\n if(wrappedMessage && notificationFromPeerId !== message.peerId) {\n notificationMessage = await getPeerTitle({...peerTitleOptions, peerId: notificationFromPeerId}) +\n ': ' + notificationMessage;\n }\n } else if(isAnyChat && notificationFromPeerId !== message.peerId) {\n notification.title = await getPeerTitle({...peerTitleOptions, peerId: notificationFromPeerId}) +\n ' @ ' +\n notification.title;\n }\n\n notification.title = wrapPlainText(notification.title);\n\n notification.onclick = () => {\n appImManager.setInnerPeer({peerId, lastMsgId: message.mid, threadId});\n };\n\n notification.message = notificationMessage;\n notification.key = 'msg' + message.mid;\n notification.tag = peerString;\n notification.silent = true;// message.pFlags.silent || false;\n\n const peerPhoto = await this.managers.appPeersManager.getPeerPhoto(peerId);\n if(peerPhoto) {\n const url = await this.managers.appAvatarsManager.loadAvatar(peerId, peerPhoto, 'photo_small');\n\n if(!peerReaction) { // ! WARNING, message can be already read\n message = await this.managers.appMessagesManager.getMessageByPeer(message.peerId, message.mid);\n if(!message || !message.pFlags.unread) return;\n }\n\n notification.image = url;\n } else {\n let {avatarCanvas, avatarContext} = this;\n if(!this.avatarCanvas) {\n avatarCanvas = this.avatarCanvas = document.createElement('canvas');\n avatarContext = this.avatarContext = avatarCanvas.getContext('2d');\n\n const SIZE = 54;\n const dpr = 1;\n avatarCanvas.dpr = dpr;\n avatarCanvas.width = avatarCanvas.height = SIZE * dpr;\n\n this.avatarGradients = {};\n } else {\n avatarContext.clearRect(0, 0, avatarCanvas.width, avatarCanvas.height);\n }\n\n const color = getPeerColorById(peerId, true);\n let gradient = this.avatarGradients[color];\n if(!gradient) {\n gradient = this.avatarGradients[color] = avatarContext.createLinearGradient(avatarCanvas.width / 2, 0, avatarCanvas.width / 2, avatarCanvas.height);\n\n const colorTop = customProperties.getProperty(`peer-avatar-${color}-top`);\n const colorBottom = customProperties.getProperty(`peer-avatar-${color}-bottom`);\n gradient.addColorStop(0, colorTop);\n gradient.addColorStop(1, colorBottom);\n }\n\n avatarContext.fillStyle = gradient;\n\n drawCircle(avatarContext, avatarCanvas.width / 2, avatarCanvas.height / 2, avatarCanvas.width / 2);\n avatarContext.fill();\n\n const fontSize = 20 * avatarCanvas.dpr;\n const abbreviation = getAbbreviation(peerTitle);\n\n avatarContext.font = `700 ${fontSize}px ${FontFamily}`;\n avatarContext.textBaseline = 'middle';\n avatarContext.textAlign = 'center';\n avatarContext.fillStyle = 'white';\n avatarContext.fillText(abbreviation.text, avatarCanvas.width / 2, avatarCanvas.height * (window.devicePixelRatio > 1 || true ? .5625 : .5));\n\n notification.image = avatarCanvas.toDataURL();\n }\n\n const pushData: PushNotificationObject = {\n custom: {\n msg_id: '' + message.mid,\n peerId: '' + peerId\n },\n description: '',\n loc_key: '',\n loc_args: [],\n mute: '',\n random_id: 0,\n title: ''\n };\n\n const result = await this.notify(notification, pushData);\n if(result && this.registeredDevice) {\n webPushApiManager.ignorePushByMid(peerId, message.mid);\n }\n }\n\n private toggleToggler(enable = idleController.isIdle) {\n if(IS_MOBILE) return;\n\n const resetTitle = (isBlink?: boolean) => {\n this.titleChanged = false;\n document.title = this.titleBackup;\n this.setFavicon();\n };\n\n window.clearInterval(this.titleInterval);\n this.titleInterval = 0;\n\n if(!enable) {\n resetTitle();\n } else {\n this.titleInterval = window.setInterval(() => {\n const count = this.notificationsCount;\n if(!count) {\n this.toggleToggler(false);\n } else if(this.titleChanged) {\n resetTitle(true);\n } else {\n this.titleChanged = true;\n document.title = I18n.format('Notifications.Count', true, [count]);\n // this.setFavicon('assets/img/favicon_unread.ico');\n\n // fetch('assets/img/favicon.ico')\n // .then((res) => res.blob())\n // .then((blob) => {\n // const img = document.createElement('img');\n // img.src = URL.createObjectURL(blob);\n\n const canvas = document.createElement('canvas');\n canvas.width = 32 * window.devicePixelRatio;\n canvas.height = canvas.width;\n\n const ctx = canvas.getContext('2d');\n ctx.beginPath();\n ctx.arc(canvas.width / 2, canvas.height / 2, canvas.width / 2, 0, 2 * Math.PI, false);\n ctx.fillStyle = '#3390ec';\n ctx.fill();\n\n let fontSize = 24;\n let str = '' + count;\n if(count < 10) {\n fontSize = 22;\n } else if(count < 100) {\n fontSize = 20;\n } else {\n str = '99+';\n fontSize = 16;\n }\n\n fontSize *= window.devicePixelRatio;\n\n ctx.font = `700 ${fontSize}px ${FontFamily}`;\n ctx.textBaseline = 'middle';\n ctx.textAlign = 'center';\n ctx.fillStyle = 'white';\n ctx.fillText(str, canvas.width / 2, canvas.height * .5625);\n\n /* const ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height); */\n\n this.setFavicon(canvas.toDataURL());\n // });\n }\n }, 1000);\n }\n }\n\n private setFavicon(href?: string) {\n if(this.prevFavicon === href) {\n return;\n }\n\n this.prevFavicon = href;\n this.faviconElements.forEach((element, idx, arr) => {\n const link = element.cloneNode() as HTMLLinkElement;\n\n link.dataset.href ||= link.href;\n\n href ??= link.dataset.href;\n link.href = href;\n element.replaceWith(arr[idx] = link);\n });\n }\n\n public async notify(data: NotifyOptions, pushData: PushNotificationObject) {\n this.log('notify', data, idleController.isIdle, this.notificationsUiSupport, this.stopped);\n\n if(this.stopped) {\n return;\n }\n\n data.image ||= NOTIFICATION_ICON_PATH;\n\n if(!data.noIncrement) {\n ++this.notificationsCount;\n }\n\n if(!this.titleInterval) {\n this.toggleToggler();\n }\n\n const idx = ++this.notificationIndex;\n const key = data.key || 'k' + idx;\n this.notificationsShown[key] = true;\n\n const now = tsNow();\n if(this.settings.volume > 0 && !this.settings.nosound/* &&\n (\n !data.tag ||\n !this.soundsPlayed[data.tag] ||\n now > this.soundsPlayed[data.tag] + 60000\n ) */\n ) {\n this.testSound(this.settings.volume);\n this.soundsPlayed[data.tag] = now;\n }\n\n if(!this.notificationsUiSupport ||\n 'Notification' in window && Notification.permission !== 'granted') {\n return;\n }\n\n if(this.settings.nodesktop) {\n if(this.vibrateSupport && !this.settings.novibrate) {\n navigator.vibrate([200, 100, 200]);\n return;\n }\n\n return;\n }\n\n if(!('Notification' in window)) {\n return;\n }\n\n let notification: MyNotification;\n\n const notificationOptions: NotificationOptions = {\n badge: NOTIFICATION_BADGE_PATH,\n icon: data.image || '',\n body: data.message || '',\n tag: data.tag || '',\n silent: data.silent || false,\n data: pushData\n };\n\n try {\n if(data.tag) {\n for(const i in this.notificationsShown) {\n const notification = this.notificationsShown[i];\n if(typeof(notification) !== 'boolean' && notification.tag === data.tag) {\n notification.hidden = true;\n }\n }\n }\n\n // throw new Error('test');\n notification = new Notification(data.title, notificationOptions);\n } catch(e) {\n try {\n const registration = await navigator.serviceWorker.ready;\n await registration.showNotification(data.title, notificationOptions);\n const notifications = await registration.getNotifications({tag: notificationOptions.tag});\n notification = notifications[notifications.length - 1];\n } catch(err) {\n this.log.error('creating push error', err, data, notificationOptions);\n }\n\n if(!notification) {\n this.notificationsUiSupport = false;\n webPushApiManager.setLocalNotificationsDisabled();\n return;\n }\n }\n\n notification.onclick = () => {\n this.log('notification onclick');\n notification.close();\n appRuntimeManager.focus();\n this.clear();\n data.onclick?.();\n };\n\n notification.onclose = () => {\n this.log('notification onclose');\n if(!notification.hidden) {\n delete this.notificationsShown[key];\n this.clear();\n }\n };\n\n notification.show?.();\n this.notificationsShown[key] = notification;\n\n if(!IS_MOBILE) {\n setTimeout(() => {\n this.hide(key);\n }, 8000);\n }\n\n return true;\n }\n\n public updateLocalSettings = () => {\n const keys = ['notify_nodesktop', 'notify_volume', 'notify_novibrate', 'notify_nopreview', 'notify_nopush'];\n const promises = keys.map(() => undefined);\n // const promises = keys.map((k) => stateStorage.get(k as any));\n Promise.all(promises)\n .then((updSettings) => {\n this.settings.nodesktop = updSettings[0];\n this.settings.volume = updSettings[1] === undefined ? 0.5 : updSettings[1];\n this.settings.novibrate = updSettings[2];\n this.settings.nopreview = updSettings[3];\n this.settings.nopush = updSettings[4];\n\n if(this.pushInited) {\n const needPush = !this.settings.nopush && !this.settings.nodesktop && webPushApiManager.isAvailable || false;\n const hasPush = this.registeredDevice !== false;\n if(needPush !== hasPush) {\n if(needPush) {\n webPushApiManager.subscribe();\n } else {\n webPushApiManager.unsubscribe();\n }\n }\n }\n\n webPushApiManager.setSettings(this.settings);\n });\n\n apiManagerProxy.getState().then((state) => {\n this.settings.nosound = !state.settings.notifications.sound;\n });\n }\n\n public getLocalSettings() {\n return this.settings;\n }\n\n private hide(key: string) {\n const notification = this.notificationsShown[key];\n if(notification) {\n this.closeNotification(notification);\n }\n }\n\n public soundReset(tag: string) {\n delete this.soundsPlayed[tag];\n }\n\n private requestPermission = () => {\n Notification.requestPermission();\n window.removeEventListener('click', this.requestPermission);\n };\n\n public testSound(volume: number) {\n const now = tsNow();\n if(this.nextSoundAt && now < this.nextSoundAt && this.prevSoundVolume === volume) {\n return;\n }\n\n this.nextSoundAt = now + 1000;\n this.prevSoundVolume = volume;\n const filename = 'assets/audio/notification.mp3';\n const audio = document.createElement('audio');\n audio.autoplay = true;\n audio.setAttribute('mozaudiochannel', 'notification');\n audio.volume = volume;\n audio.innerHTML = `\n \n \n `;\n this.notifySoundEl.append(audio);\n\n audio.addEventListener('ended', () => {\n audio.remove();\n }, {once: true});\n }\n\n public cancel(key: string) {\n const notification = this.notificationsShown[key];\n this.log('cancel', key, notification);\n if(notification) {\n if(this.notificationsCount > 0) {\n --this.notificationsCount;\n }\n\n this.closeNotification(notification);\n delete this.notificationsShown[key];\n }\n }\n\n private closeNotification(notification: boolean | MyNotification) {\n try {\n if(typeof(notification) !== 'boolean' && notification.close) {\n this.log('close notification', notification);\n notification.hidden = true;\n notification.close();\n }\n } catch(e) {}\n }\n\n public clear() {\n this.log.warn('clear');\n\n for(const i in this.notificationsShown) {\n const notification = this.notificationsShown[i];\n this.closeNotification(notification);\n }\n\n this.notificationsShown = {};\n this.notificationsCount = 0;\n\n webPushApiManager.hidePushNotifications();\n }\n\n public start() {\n this.log('start');\n\n this.updateLocalSettings();\n rootScope.addEventListener('settings_updated', this.updateLocalSettings);\n webPushApiManager.start();\n\n if(!this.notificationsUiSupport) {\n return false;\n }\n\n if('Notification' in window && Notification.permission !== 'granted' && Notification.permission !== 'denied') {\n window.addEventListener('click', this.requestPermission);\n }\n\n try {\n if('onbeforeunload' in window) {\n window.addEventListener('beforeunload', this.clear);\n }\n } catch(e) {}\n }\n\n private stop() {\n this.log('stop');\n\n this.clear();\n window.clearInterval(this.titleInterval);\n this.titleInterval = 0;\n this.setFavicon();\n this.stopped = true;\n }\n\n private registerDevice(tokenData: PushSubscriptionNotify) {\n if(this.registeredDevice && deepEqual(this.registeredDevice, tokenData)) {\n return false;\n }\n\n this.managers.apiManager.invokeApi('account.registerDevice', {\n token_type: tokenData.tokenType,\n token: tokenData.tokenValue,\n other_uids: [],\n app_sandbox: false,\n secret: new Uint8Array()\n }).then(() => {\n this.log('registered device');\n this.registeredDevice = tokenData;\n }, (error) => {\n error.handled = true;\n });\n }\n\n private unregisterDevice(tokenData: PushSubscriptionNotify) {\n if(!this.registeredDevice) {\n return false;\n }\n\n this.managers.apiManager.invokeApi('account.unregisterDevice', {\n token_type: tokenData.tokenType,\n token: tokenData.tokenValue,\n other_uids: []\n }).then(() => {\n this.registeredDevice = false;\n }, (error) => {\n error.handled = true;\n });\n }\n}\n\nconst uiNotificationsManager = new UiNotificationsManager();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.uiNotificationsManager = uiNotificationsManager);\nexport default uiNotificationsManager;\n","export const NOTIFICATION_ICON_PATH = 'assets/img/logo_filled_rounded.png';\nexport const NOTIFICATION_BADGE_PATH = 'assets/img/logo_plain.svg'; // masked\n","export default async function getFilesFromEvent(e: ClipboardEvent | DragEvent, onlyTypes = false): Promise {\n const files: any[] = [];\n\n const scanFiles = async(entry: any, item: DataTransferItem) => {\n if(entry.isDirectory) {\n const directoryReader = entry.createReader();\n await new Promise((resolve, reject) => {\n directoryReader.readEntries(async(entries: any) => {\n for(const entry of entries) {\n await scanFiles(entry, item);\n }\n\n resolve();\n });\n });\n } else if(entry) {\n if(onlyTypes) {\n files.push(entry.type);\n } else {\n const itemFile = item.getAsFile(); // * Safari can't handle entry.file with pasting\n const file = entry instanceof File ?\n entry :\n (\n entry instanceof DataTransferItem ?\n entry.getAsFile() :\n await new Promise((resolve, reject) => entry.file(resolve, (err: any) => resolve(itemFile)))\n );\n\n /* if(!onlyTypes) {\n console.log('getFilesFromEvent: got file', item, file);\n } */\n\n if(!file) return;\n files.push(file);\n }\n }\n };\n\n if(e instanceof DragEvent && e.dataTransfer.files && !e.dataTransfer.items) {\n for(let i = 0; i < e.dataTransfer.files.length; i++) {\n const file = e.dataTransfer.files[i];\n files.push(onlyTypes ? file.type : file);\n }\n } else {\n // @ts-ignore\n const items = (e.dataTransfer || e.clipboardData || e.originalEvent.clipboardData).items;\n\n const promises: Promise[] = [];\n for(let i = 0; i < items.length; ++i) {\n const item: DataTransferItem = items[i];\n if(item.kind === 'file') {\n const entry = (onlyTypes ? item : item.webkitGetAsEntry()) || item.getAsFile();\n promises.push(scanFiles(entry, item));\n }\n }\n\n await Promise.all(promises);\n }\n\n /* if(!onlyTypes) {\n console.log('getFilesFromEvent: got files:', e, files);\n } */\n\n return files;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {T_ME_PREFIXES} from '../lib/mtproto/mtproto_config';\nimport cancelEvent from './dom/cancelEvent';\nimport parseUriParams from './string/parseUriParams';\n\nexport default function addAnchorListener(options: {\n name: 'showMaskedAlert' | 'execBotCommand' | 'searchByHashtag' | 'addstickers' | 'im' |\n 'resolve' | 'privatepost' | 'addstickers' | 'voicechat' | 'joinchat' | 'join' | 'invoice' |\n 'addemoji' | 'setMediaTimestamp',\n protocol?: 'tg',\n callback: (params: Params, element?: HTMLAnchorElement) => boolean | any,\n noPathnameParams?: boolean,\n noUriParams?: boolean,\n noCancelEvent?: boolean\n}) {\n (window as any)[(options.protocol ? options.protocol + '_' : '') + options.name] = (element?: HTMLAnchorElement/* , e: Event */) => {\n !options.noCancelEvent && cancelEvent(null);\n\n let href = element.href;\n if(!href) {\n return;\n }\n\n let pathnameParams: any[];\n let uriParams: any;\n\n const u = new URL(href);\n const match = u.host.match(/(.+?)\\.t(?:elegram)?\\.me/);\n if(match && !T_ME_PREFIXES.has(match[1])) {\n u.pathname = match[1] + (u.pathname === '/' ? '' : u.pathname);\n href = u.toString();\n }\n\n if(!options.noPathnameParams) pathnameParams = new URL(href).pathname.split('/').slice(1);\n if(!options.noUriParams) uriParams = parseUriParams(href);\n\n const res = options.callback({pathnameParams, uriParams} as Params, element);\n return res === undefined ? res : false;\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport paymentsWrapCurrencyAmount from '../../helpers/paymentsWrapCurrencyAmount';\nimport {PremiumGiftOption} from '../../layer';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport I18n, {i18n, _i18n} from '../../lib/langPack';\nimport AvatarElement from '../avatar';\nimport Button from '../button';\nimport CheckboxField from '../checkboxField';\nimport Row from '../row';\nimport wrapPeerTitle from '../wrappers/peerTitle';\n\nconst className = 'popup-gift-premium';\n\nexport default class PopupGiftPremium extends PopupElement {\n constructor(\n private peerId: PeerId,\n private giftOptions: PremiumGiftOption[]\n ) {\n super(className, {closable: true, overlayClosable: true, body: true, scrollable: true});\n\n this.construct();\n }\n\n public async construct() {\n const {peerId, giftOptions} = this;\n const avatar = new AvatarElement();\n avatar.classList.add('avatar-100', className + '-avatar');\n await avatar.updateWithOptions({\n peerId\n });\n\n const title = document.createElement('span');\n _i18n(title, 'GiftTelegramPremiumTitle');\n title.classList.add(className + '-title');\n\n const subtitle = i18n('GiftTelegramPremiumDescription', [await wrapPeerTitle({peerId})]);\n subtitle.classList.add(className + '-subtitle');\n\n const shortestOption = this.giftOptions.slice().sort((a, b) => a.months - b.months)[0];\n\n const wrapCurrency = (amount: number | string) => paymentsWrapCurrencyAmount(amount, shortestOption.currency, false, true);\n\n const rows = this.giftOptions.map((giftOption, idx) => {\n let subtitle = i18n('PricePerMonth', [wrapCurrency(+giftOption.amount / giftOption.months)]);\n if(giftOption !== shortestOption) {\n const span = document.createElement('span');\n const badge = document.createElement('span');\n badge.classList.add(className + '-discount');\n const shortestAmount = +shortestOption.amount * giftOption.months / shortestOption.months;\n const discount = Math.round((1 - +giftOption.amount / shortestAmount) * 100);\n badge.textContent = '-' + discount + '%';\n span.append(badge, subtitle);\n subtitle = span;\n }\n\n const isYears = !(giftOption.months % 12);\n const checkboxField = new CheckboxField({\n // text: 'Months',\n // textArgs: [giftOption.months],\n checked: idx === 0,\n round: true,\n name: 'gift-months',\n asRadio: true\n });\n\n const row = new Row({\n title: i18n(isYears ? 'Years' : 'Months', [isYears ? giftOption.months / 12 : giftOption.months]),\n checkboxField,\n clickable: true,\n subtitle,\n titleRightSecondary: wrapCurrency(giftOption.amount)\n });\n\n row.container.classList.add(className + '-option');\n\n return row;\n });\n\n const form = document.createElement('form');\n form.classList.add(className + '-options');\n form.append(...rows.map((row) => row.container));\n\n const buttonText = new I18n.IntlElement({key: 'GiftSubscriptionFor', args: [wrapCurrency(giftOptions[0].amount)]});\n\n const getSelectedOption = () => giftOptions[rows.findIndex((row) => row.checkboxField.checked)];\n\n this.listenerSetter.add(form)('change', () => {\n buttonText.compareAndUpdate({\n args: [\n wrapCurrency(getSelectedOption().amount)\n ]\n });\n });\n\n const giftButton = Button(`btn-primary ${className}-confirm shimmer`);\n giftButton.append(buttonText.element);\n\n attachClickEvent(giftButton, () => {\n const giftOption = getSelectedOption();\n appImManager.openUrl(giftOption.bot_url);\n this.hide();\n }, {listenerSetter: this.listenerSetter});\n\n this.scrollable.append(\n avatar,\n title,\n subtitle,\n form,\n giftButton\n );\n\n this.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {GroupCallId, MyGroupCall} from './appGroupCallsManager';\nimport type GroupCallInstance from '../calls/groupCallInstance';\nimport type CallInstance from '../calls/callInstance';\nimport animationIntersector, {AnimationItemGroup} from '../../components/animationIntersector';\nimport appSidebarLeft, {LEFT_COLUMN_ACTIVE_CLASSNAME} from '../../components/sidebarLeft';\nimport appSidebarRight, {RIGHT_COLUMN_ACTIVE_CLASSNAME} from '../../components/sidebarRight';\nimport mediaSizes, {ScreenSize} from '../../helpers/mediaSizes';\nimport {logger, LogTypes} from '../logger';\nimport rootScope from '../rootScope';\nimport Chat, {ChatType} from '../../components/chat/chat';\nimport PopupNewMedia, {getCurrentNewMediaPopup} from '../../components/popups/newMedia';\nimport MarkupTooltip from '../../components/chat/markupTooltip';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport SetTransition from '../../components/singleTransition';\nimport ChatDragAndDrop from '../../components/chat/dragAndDrop';\nimport {doubleRaf} from '../../helpers/schedulers';\nimport lottieLoader from '../rlottie/lottieLoader';\nimport useHeavyAnimationCheck, {dispatchHeavyAnimationEvent} from '../../hooks/useHeavyAnimationCheck';\nimport stateStorage from '../stateStorage';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport appNavigationController from '../../components/appNavigationController';\nimport AppPrivateSearchTab from '../../components/sidebarRight/tabs/search';\nimport I18n, {i18n, join, LangPackKey} from '../langPack';\nimport {ChatFull, ChatInvite, ChatParticipant, ChatParticipants, Message, MessageAction, MessageMedia, SendMessageAction, User, Chat as MTChat, UrlAuthResult, WallPaper} from '../../layer';\nimport PeerTitle from '../../components/peerTitle';\nimport PopupPeer, {PopupPeerCheckboxOptions} from '../../components/popups/peer';\nimport blurActiveElement from '../../helpers/dom/blurActiveElement';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport disableTransition from '../../helpers/dom/disableTransition';\nimport placeCaretAtEnd from '../../helpers/dom/placeCaretAtEnd';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport whichChild from '../../helpers/dom/whichChild';\nimport PopupElement from '../../components/popups';\nimport singleInstance, {InstanceDeactivateReason, SingleInstance} from '../mtproto/singleInstance';\nimport PopupStickers from '../../components/popups/stickers';\nimport PopupJoinChatInvite from '../../components/popups/joinChatInvite';\nimport {toast, toastNew} from '../../components/toast';\nimport debounce from '../../helpers/schedulers/debounce';\nimport pause from '../../helpers/schedulers/pause';\nimport {InternalLink, InternalLinkTypeMap, INTERNAL_LINK_TYPE} from './internalLink';\nimport MEDIA_MIME_TYPES_SUPPORTED from '../../environment/mediaMimeTypesSupport';\nimport IMAGE_MIME_TYPES_SUPPORTED from '../../environment/imageMimeTypesSupport';\nimport {NULL_PEER_ID} from '../mtproto/mtproto_config';\nimport telegramMeWebManager from '../mtproto/telegramMeWebManager';\nimport {ONE_DAY} from '../../helpers/date';\nimport TopbarCall from '../../components/topbarCall';\nimport confirmationPopup from '../../components/confirmationPopup';\nimport IS_GROUP_CALL_SUPPORTED from '../../environment/groupCallSupport';\nimport IS_CALL_SUPPORTED from '../../environment/callSupport';\nimport {CallType} from '../calls/types';\nimport {Modify, SendMessageEmojiInteractionData} from '../../types';\nimport htmlToSpan from '../../helpers/dom/htmlToSpan';\nimport getVisibleRect from '../../helpers/dom/getVisibleRect';\nimport {simulateClickEvent} from '../../helpers/dom/clickEvent';\nimport PopupCall from '../../components/call';\nimport copy from '../../helpers/object/copy';\nimport getObjectKeysAndSort from '../../helpers/object/getObjectKeysAndSort';\nimport numberThousandSplitter from '../../helpers/number/numberThousandSplitter';\nimport ChatBackgroundPatternRenderer from '../../components/chat/patternRenderer';\nimport {IS_FIREFOX} from '../../environment/userAgent';\nimport compareVersion from '../../helpers/compareVersion';\nimport {AppManagers} from './managers';\nimport uiNotificationsManager from './uiNotificationsManager';\nimport appMediaPlaybackController from '../../components/appMediaPlaybackController';\nimport {PHONE_NUMBER_REG_EXP} from '../richTextProcessor';\nimport wrapEmojiText from '../richTextProcessor/wrapEmojiText';\nimport wrapRichText, {CustomEmojiRendererElement, renderEmojis} from '../richTextProcessor/wrapRichText';\nimport wrapUrl from '../richTextProcessor/wrapUrl';\nimport generateMessageId from './utils/messageId/generateMessageId';\nimport getUserStatusString from '../../components/wrappers/getUserStatusString';\nimport getChatMembersString from '../../components/wrappers/getChatMembersString';\nimport {STATE_INIT} from '../../config/state';\nimport CacheStorageController from '../files/cacheStorage';\nimport themeController from '../../helpers/themeController';\nimport overlayCounter from '../../helpers/overlayCounter';\nimport appDialogsManager from './appDialogsManager';\nimport idleController from '../../helpers/idleController';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport {AckedResult} from '../mtproto/superMessagePort';\nimport groupCallsController from '../calls/groupCallsController';\nimport callsController from '../calls/callsController';\nimport getFilesFromEvent from '../../helpers/files/getFilesFromEvent';\nimport apiManagerProxy from '../mtproto/mtprotoworker';\nimport appRuntimeManager from './appRuntimeManager';\nimport paymentsWrapCurrencyAmount from '../../helpers/paymentsWrapCurrencyAmount';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport {CLICK_EVENT_NAME} from '../../helpers/dom/clickEvent';\nimport PopupPayment from '../../components/popups/payment';\nimport wrapPeerTitle from '../../components/wrappers/peerTitle';\nimport NBSP from '../../helpers/string/nbsp';\nimport {makeMediaSize, MediaSize} from '../../helpers/mediaSize';\nimport {MiddleEllipsisElement} from '../../components/middleEllipsis';\nimport addAnchorListener from '../../helpers/addAnchorListener';\nimport parseUriParams from '../../helpers/string/parseUriParams';\nimport getMessageThreadId from './utils/messages/getMessageThreadId';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport {MTAppConfig} from '../mtproto/appConfig';\nimport PopupForward from '../../components/popups/forward';\nimport AppBackgroundTab from '../../components/sidebarLeft/tabs/background';\nimport partition from '../../helpers/array/partition';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport liteMode, {LiteModeKey} from '../../helpers/liteMode';\nimport RLottiePlayer from '../rlottie/rlottiePlayer';\nimport PopupGiftPremium from '../../components/popups/giftPremium';\n\nexport type ChatSavedPosition = {\n mids: number[],\n top: number\n};\n\nexport type ChatSetPeerOptions = {\n peerId: PeerId,\n lastMsgId?: number,\n threadId?: number,\n startParam?: string,\n stack?: number,\n commentId?: number,\n type?: ChatType,\n mediaTimestamp?: number\n};\n\nexport type ChatSetInnerPeerOptions = Modify;\n\nexport enum APP_TABS {\n CHATLIST,\n CHAT,\n PROFILE\n}\n\nexport class AppImManager extends EventListenerBase<{\n chat_changing: (details: {from: Chat, to: Chat}) => void,\n peer_changed: (chat: Chat) => void,\n peer_changing: (chat: Chat) => void,\n tab_changing: (tabId: number) => void\n}> {\n public columnEl = document.getElementById('column-center') as HTMLDivElement;\n public chatsContainer: HTMLElement;\n\n public offline = false;\n public updateStatusInterval = 0;\n\n public log: ReturnType;\n\n public setPeerPromise: Promise = null;\n\n private tabId: APP_TABS;\n\n public chats: Chat[] = [];\n private prevTab: HTMLElement;\n private chatsSelectTabDebounced: () => void;\n\n public markupTooltip: MarkupTooltip;\n private backgroundPromises: {[slug: string]: Promise};\n\n private topbarCall: TopbarCall;\n public emojiAnimationContainer: HTMLDivElement;\n\n private lastBackgroundUrl: string;\n\n public managers: AppManagers;\n\n public cacheStorage = new CacheStorageController('cachedFiles');\n public customEmojiSize: MediaSize;\n\n get myId() {\n return rootScope.myId;\n }\n\n get chat(): Chat {\n return this.chats[this.chats.length - 1];\n }\n\n public construct(managers: AppManagers) {\n this.managers = managers;\n\n const {\n apiUpdatesManager\n } = managers;\n apiUpdatesManager.attach(I18n.lastRequestedLangCode);\n\n appMediaPlaybackController.construct(managers);\n uiNotificationsManager.construct(managers);\n uiNotificationsManager.start();\n\n this.log = logger('IM', LogTypes.Log | LogTypes.Warn | LogTypes.Debug | LogTypes.Error);\n\n this.backgroundPromises = {};\n STATE_INIT.settings.themes.forEach((theme) => {\n const themeSettings = theme.settings;\n if(!themeSettings) {\n return;\n }\n\n const {wallpaper} = themeSettings;\n const slug = (wallpaper as WallPaper.wallPaper).slug;\n if(!slug) {\n return;\n }\n\n const url = 'assets/img/' + slug + '.svg' + (IS_FIREFOX ? '?1' : '');\n this.backgroundPromises[slug] = Promise.resolve(url);\n });\n\n this.selectTab(APP_TABS.CHATLIST);\n\n idleController.addEventListener('change', (idle) => {\n this.offline = idle;\n this.updateStatus();\n if(idle) {\n clearInterval(this.updateStatusInterval);\n } else {\n this.updateStatusInterval = window.setInterval(() => this.updateStatus(), 50e3);\n }\n });\n\n this.chatsContainer = document.createElement('div');\n this.chatsContainer.classList.add('chats-container', 'tabs-container');\n this.chatsContainer.dataset.animation = 'navigation';\n\n this.emojiAnimationContainer = document.createElement('div');\n this.emojiAnimationContainer.classList.add('emoji-animation-container');\n this.appendEmojiAnimationContainer(mediaSizes.activeScreen);\n\n this.columnEl.append(this.chatsContainer);\n\n this.createNewChat();\n this.chatsSelectTab(this.chat.container);\n\n appNavigationController.onHashChange = this.onHashChange;\n // window.addEventListener('hashchange', this.onHashChange);\n\n this.setSettings();\n rootScope.addEventListener('settings_updated', this.setSettings);\n\n const onPremiumToggle = (isPremium: boolean) => {\n document.body.classList.toggle('is-premium', isPremium);\n };\n rootScope.addEventListener('premium_toggle', onPremiumToggle);\n onPremiumToggle(rootScope.premium);\n this.managers.rootScope.getPremium().then(onPremiumToggle);\n\n useHeavyAnimationCheck(() => {\n animationIntersector.setOnlyOnePlayableGroup('lock');\n animationIntersector.checkAnimations2(true);\n }, () => {\n animationIntersector.setOnlyOnePlayableGroup();\n animationIntersector.checkAnimations2(false);\n });\n\n themeController.AppBackgroundTab = AppBackgroundTab;\n\n if(IS_FIREFOX && apiManagerProxy.oldVersion && compareVersion(apiManagerProxy.oldVersion, '1.4.3') === -1) {\n this.deleteFilesIterative((response) => {\n return response.headers.get('Content-Type') === 'image/svg+xml';\n }).then(() => {\n this.applyCurrentTheme();\n });\n } else {\n this.applyCurrentTheme();\n }\n\n // * fix simultaneous opened both sidebars, can happen when floating sidebar is opened with left sidebar\n mediaSizes.addEventListener('changeScreen', (from, to) => {\n if(document.body.classList.contains(LEFT_COLUMN_ACTIVE_CLASSNAME) &&\n document.body.classList.contains(RIGHT_COLUMN_ACTIVE_CLASSNAME)) {\n appSidebarRight.toggleSidebar(false);\n }\n\n this.appendEmojiAnimationContainer(to);\n });\n\n mediaSizes.addEventListener('resize', () => {\n // const perf = performance.now();\n const rect = this.chatsContainer.getBoundingClientRect();\n ChatBackgroundPatternRenderer.resizeInstances(rect.width, rect.height).then(() => {\n // this.log.warn('resize bg time:', performance.now() - perf);\n // for(const chat of this.chats) {\n // if(chat.renderDarkPattern) {\n // chat.renderDarkPattern();\n // }\n // }\n });\n });\n\n this.addEventListener('peer_changing', (chat) => {\n this.saveChatPosition(chat);\n });\n\n rootScope.addEventListener('theme_change', () => {\n this.applyCurrentTheme();\n });\n\n rootScope.addEventListener('choosing_sticker', (choosing) => {\n this.setChoosingStickerTyping(!choosing);\n });\n\n rootScope.addEventListener('peer_title_edit', ({peerId, threadId}) => {\n if(this.chat?.peerId === peerId && !threadId && this.tabId !== undefined) {\n this.overrideHash(peerId);\n }\n });\n\n rootScope.addEventListener('peer_typings', ({peerId, typings}) => {\n const chat = this.chat;\n if(\n !chat ||\n chat.peerId !== peerId ||\n overlayCounter.isOverlayActive || (\n mediaSizes.activeScreen === ScreenSize.mobile &&\n this.tabId !== APP_TABS.CHAT\n )\n ) {\n return;\n }\n\n const typing = typings.find((typing) => typing.action._ === 'sendMessageEmojiInteraction');\n if(typing?.action?._ === 'sendMessageEmojiInteraction') {\n const action = typing.action;\n const bubble = chat.bubbles.bubbles[generateMessageId(typing.action.msg_id)];\n if(bubble && bubble.classList.contains('emoji-big') && getVisibleRect(bubble, chat.bubbles.scrollable.container)) {\n const stickerWrapper: HTMLElement = bubble.querySelector('.media-sticker-wrapper:not(.bubble-hover-reaction-sticker):not(.reaction-sticker)');\n\n const data: SendMessageEmojiInteractionData = JSON.parse(action.interaction.data);\n data.a.forEach((a) => {\n setTimeout(() => {\n simulateClickEvent(stickerWrapper);\n }, a.t * 1000);\n });\n\n this.managers.appMessagesManager.setTyping(peerId, {\n _: 'sendMessageEmojiInteractionSeen',\n emoticon: action.emoticon\n });\n }\n }\n });\n\n const onInstanceDeactivated = (reason: InstanceDeactivateReason) => {\n const isUpdated = reason === 'version';\n const popup = PopupElement.createPopup(PopupElement, 'popup-instance-deactivated', {overlayClosable: true});\n const c = document.createElement('div');\n c.classList.add('instance-deactivated-container');\n (popup as any).container.replaceWith(c);\n\n const header = document.createElement('div');\n header.classList.add('header');\n header.append(i18n(isUpdated ? 'Deactivated.Version.Title' : 'Deactivated.Title'));\n\n const subtitle = document.createElement('div');\n subtitle.classList.add('subtitle');\n subtitle.append(i18n(isUpdated ? 'Deactivated.Version.Subtitle' : 'Deactivated.Subtitle'));\n\n c.append(header, subtitle);\n\n document.body.classList.add('deactivated');\n\n const onClose = isUpdated ? () => {\n appRuntimeManager.reload();\n } : () => {\n document.body.classList.add('deactivated-backwards');\n\n singleInstance.activateInstance();\n\n setTimeout(() => {\n document.body.classList.remove('deactivated', 'deactivated-backwards');\n }, 333);\n };\n\n popup.addEventListener('close', onClose);\n popup.show();\n };\n\n singleInstance.addEventListener('deactivated', onInstanceDeactivated);\n if(singleInstance.deactivatedReason) {\n onInstanceDeactivated(singleInstance.deactivatedReason);\n }\n\n // remove scroll listener when setting chat to tray\n this.addEventListener('chat_changing', ({to}) => {\n this.toggleChatGradientAnimation(to);\n });\n\n rootScope.addEventListener('service_notification', (update) => {\n confirmationPopup({\n button: {langKey: 'OK', isCancel: true},\n description: wrapRichText(update.message)\n });\n });\n\n rootScope.addEventListener('payment_sent', async({peerId, mid, receiptMessage}) => {\n const message = await this.managers.appMessagesManager.getMessageByPeer(peerId, mid);\n if(!message) {\n return;\n }\n\n const action = receiptMessage.action as MessageAction.messageActionPaymentSent;\n toastNew({\n langPackKey: 'PaymentInfoHint',\n langPackArguments: [\n paymentsWrapCurrencyAmount(action.total_amount, action.currency),\n wrapEmojiText(((message as Message.message).media as MessageMedia.messageMediaInvoice).title)\n ]\n });\n });\n\n (window as any).onSpoilerClick = (e: MouseEvent) => {\n const spoiler = findUpClassName(e.target, 'spoiler');\n const parentElement = findUpClassName(spoiler, 'spoilers-container') || spoiler.parentElement;\n\n const className = 'is-spoiler-visible';\n const isVisible = parentElement.classList.contains(className);\n if(!isVisible) {\n cancelEvent(e);\n\n if(CLICK_EVENT_NAME !== 'click') {\n window.addEventListener('click', cancelEvent, {capture: true, once: true});\n }\n }\n\n const duration = 400 / 2;\n const showDuration = 5000;\n const useRafs = !isVisible ? 2 : 0;\n if(useRafs) {\n parentElement.classList.add('will-change');\n }\n\n const spoilerTimeout = parentElement.dataset.spoilerTimeout;\n if(spoilerTimeout !== null) {\n clearTimeout(+spoilerTimeout);\n delete parentElement.dataset.spoilerTimeout;\n }\n\n SetTransition({\n element: parentElement,\n className,\n forwards: true,\n duration,\n onTransitionEnd: () => {\n parentElement.dataset.spoilerTimeout = '' + window.setTimeout(() => {\n SetTransition({\n element: parentElement,\n className,\n forwards: false,\n duration,\n onTransitionEnd: () => {\n parentElement.classList.remove('will-change');\n delete parentElement.dataset.spoilerTimeout;\n }\n });\n }, showDuration);\n },\n useRafs\n });\n };\n\n document.addEventListener('mousemove', (e) => {\n const mediaStickerWrapper = findUpClassName(e.target, 'media-sticker-wrapper');\n if(!mediaStickerWrapper ||\n mediaStickerWrapper.classList.contains('custom-emoji') ||\n findUpClassName(e.target, 'emoji-big')) {\n return;\n }\n\n const animations = animationIntersector.getAnimations(mediaStickerWrapper);\n animations?.forEach((animationItem) => {\n const {liteModeKey, animation} = animationItem;\n if(!liteModeKey || !animation?.paused || liteMode.isAvailable(liteModeKey)) {\n return;\n }\n\n if(animation instanceof RLottiePlayer) {\n animation.playOrRestart();\n } else {\n animation.play();\n }\n });\n });\n\n rootScope.addEventListener('sticker_updated', ({type, faved}) => {\n if(type === 'faved') {\n toastNew({\n langPackKey: faved ? 'AddedToFavorites' : 'RemovedFromFavorites'\n });\n } else if(!faved) {\n toastNew({\n langPackKey: 'RemovedFromRecent'\n });\n }\n });\n\n apiManagerProxy.addEventListener('notificationBuild', async(options) => {\n const isForum = await this.managers.appPeersManager.isForum(options.message.peerId);\n const threadId = getMessageThreadId(options.message, isForum);\n if(this.chat.peerId === options.message.peerId && this.chat.threadId === threadId && !idleController.isIdle) {\n return;\n }\n\n uiNotificationsManager.buildNotification(options);\n });\n\n this.addEventListener('peer_changed', async({peerId}) => {\n document.body.classList.toggle('has-chat', !!peerId);\n\n this.emojiAnimationContainer.textContent = '';\n\n this.overrideHash(peerId);\n\n apiManagerProxy.updateTabState('chatPeerIds', this.chats.map((chat) => chat.peerId).filter(Boolean));\n });\n\n // stateStorage.get('chatPositions').then((c) => {\n stateStorage.setToCache('chatPositions', /* c || */{});\n // });\n\n if(IS_CALL_SUPPORTED || IS_GROUP_CALL_SUPPORTED) {\n this.topbarCall = new TopbarCall(managers);\n }\n\n if(IS_CALL_SUPPORTED) {\n callsController.addEventListener('instance', ({instance/* , hasCurrent */}) => {\n // if(hasCurrent) {\n // return;\n // }\n\n const popup = PopupElement.createPopup(PopupCall, instance);\n\n instance.addEventListener('acceptCallOverride', () => {\n return this.discardCurrentCall(instance.interlocutorUserId.toPeerId(), undefined, instance)\n .then(() => {\n callsController.dispatchEvent('accepting', instance);\n return true;\n })\n .catch(() => false);\n });\n\n popup.addEventListener('close', () => {\n const currentCall = callsController.currentCall;\n if(currentCall && currentCall !== instance && !instance.wasTryingToJoin) {\n instance.hangUp('phoneCallDiscardReasonBusy');\n }\n }, {once: true});\n\n popup.show();\n });\n\n callsController.addEventListener('incompatible', async(userId) => {\n toastNew({\n langPackKey: 'VoipPeerIncompatible',\n langPackArguments: [\n await wrapPeerTitle({peerId: userId.toPeerId()})\n ]\n });\n });\n }\n\n // ! do not remove this line\n // ! instance can be deactivated before the UI starts, because it waits in background for RAF that is delayed\n singleInstance.activateInstance();\n\n const setAuthorized = () => {\n telegramMeWebManager.setAuthorized(true);\n };\n\n setInterval(setAuthorized, ONE_DAY);\n setAuthorized();\n\n addAnchorListener<{}>({\n name: 'showMaskedAlert',\n callback: (params, element) => {\n const href = element.href;\n\n const a = element.cloneNode(true) as HTMLAnchorElement;\n a.className = 'anchor-url';\n a.innerText = href;\n a.removeAttribute('onclick');\n\n PopupElement.createPopup(PopupPeer, 'popup-masked-url', {\n titleLangKey: 'OpenUrlTitle',\n descriptionLangKey: 'OpenUrlAlert2',\n descriptionLangArgs: [a],\n buttons: [{\n langKey: 'Open',\n callback: () => {\n a.click();\n }\n }]\n }).show();\n }\n });\n\n addAnchorListener<{uriParams: {command: string, bot: string}}>({\n name: 'execBotCommand',\n callback: ({uriParams}) => {\n const {command, bot} = uriParams;\n\n /* const promise = bot ? this.openUsername(bot).then(() => this.chat.peerId) : Promise.resolve(this.chat.peerId);\n promise.then((peerId) => {\n this.managers.appMessagesManager.sendText(peerId, '/' + command);\n }); */\n\n this.managers.appMessagesManager.sendText(this.chat.peerId, '/' + command + (bot ? '@' + bot : ''));\n\n // console.log(command, bot);\n }\n });\n\n addAnchorListener<{uriParams: {hashtag: string}}>({\n name: 'searchByHashtag',\n callback: ({uriParams}) => {\n const {hashtag} = uriParams;\n if(!hashtag) {\n return;\n }\n\n this.chat.initSearch('#' + hashtag + ' ');\n }\n });\n\n addAnchorListener<{}>({\n name: 'setMediaTimestamp',\n callback: (_, element) => {\n const timestamp = +element.dataset.timestamp;\n const bubble = findUpClassName(element, 'bubble');\n if(bubble) {\n this.chat.bubbles.playMediaWithTimestamp(element, timestamp);\n return;\n }\n\n if(findUpClassName(element, 'media-viewer-caption')) {\n const appMediaViewer = (window as any).appMediaViewer;\n appMediaViewer.setMediaTimestamp(timestamp);\n }\n }\n });\n\n ([\n ['addstickers', INTERNAL_LINK_TYPE.STICKER_SET],\n ['addemoji', INTERNAL_LINK_TYPE.EMOJI_SET]\n ] as [\n 'addstickers' | 'addemoji',\n INTERNAL_LINK_TYPE.STICKER_SET | INTERNAL_LINK_TYPE.EMOJI_SET\n ][]).forEach(([name, type]) => {\n addAnchorListener<{pathnameParams: [typeof name, string]}>({\n name,\n callback: ({pathnameParams}) => {\n if(!pathnameParams[1]) {\n return;\n }\n\n const link: InternalLink = {\n _: type,\n set: pathnameParams[1]\n };\n\n this.processInternalLink(link);\n }\n });\n\n addAnchorListener<{\n uriParams: {\n set: string\n }\n }>({\n name,\n protocol: 'tg',\n callback: ({uriParams}) => {\n const link = this.makeLink(type, uriParams);\n this.processInternalLink(link);\n }\n });\n });\n\n // * t.me/invoice/asdasdad\n // * t.me/$asdasdad\n addAnchorListener<{pathnameParams: ['invoice', string] | string}>({\n name: 'invoice',\n callback: ({pathnameParams}) => {\n const link: InternalLink = {\n _: INTERNAL_LINK_TYPE.INVOICE,\n slug: pathnameParams.length > 1 ? pathnameParams[1] : pathnameParams[0].slice(1)\n };\n\n this.processInternalLink(link);\n }\n });\n\n // Support old t.me/joinchat/asd and new t.me/+asd\n addAnchorListener<{pathnameParams: ['joinchat', string]}>({\n name: 'joinchat',\n callback: ({pathnameParams}) => {\n const link: InternalLink = {\n _: INTERNAL_LINK_TYPE.JOIN_CHAT,\n invite: pathnameParams[1] || decodeURIComponent(pathnameParams[0]).slice(1)\n };\n\n this.processInternalLink(link);\n }\n });\n\n if(IS_GROUP_CALL_SUPPORTED) {\n addAnchorListener<{\n uriParams: Omit\n }>({\n name: 'voicechat',\n protocol: 'tg',\n callback: ({uriParams}) => {\n const link = this.makeLink(INTERNAL_LINK_TYPE.VOICE_CHAT, uriParams);\n this.processInternalLink(link);\n }\n });\n }\n\n addAnchorListener<{\n // pathnameParams: ['c', string, string],\n // uriParams: {thread?: number}\n // } | {\n // pathnameParams: [string, string?],\n // uriParams: {comment?: number}\n pathnameParams: ['c', string, string] | [string, string?],\n uriParams: {thread?: string, comment?: string, t?: string} | {comment?: string, start?: string, t?: string}\n }>({\n name: 'im',\n callback: async({pathnameParams, uriParams}, element) => {\n let link: InternalLink;\n if(PHONE_NUMBER_REG_EXP.test(pathnameParams[0])) {\n link = {\n _: INTERNAL_LINK_TYPE.USER_PHONE_NUMBER,\n phone: pathnameParams[0].slice(1)\n };\n } else if(pathnameParams[0] === 'c') {\n pathnameParams.shift();\n const thread = 'thread' in uriParams ? uriParams.thread : pathnameParams[2] && pathnameParams[1];\n link = {\n _: INTERNAL_LINK_TYPE.PRIVATE_POST,\n channel: pathnameParams[0],\n post: pathnameParams[2] || pathnameParams[1],\n thread,\n comment: uriParams.comment,\n stack: this.getStackFromElement(element),\n t: uriParams.t\n };\n } else {\n const thread = 'thread' in uriParams ? uriParams.thread : pathnameParams[2] && pathnameParams[1];\n link = {\n _: INTERNAL_LINK_TYPE.MESSAGE,\n domain: pathnameParams[0],\n post: pathnameParams[2] || pathnameParams[1],\n thread,\n comment: uriParams.comment,\n start: 'start' in uriParams ? uriParams.start : undefined,\n stack: this.getStackFromElement(element),\n t: uriParams.t\n };\n }\n\n this.processInternalLink(link);\n }\n });\n\n addAnchorListener<{\n uriParams: {\n domain: string,\n\n // telegrampassport\n scope?: string,\n nonce?: string,\n payload?: string,\n bot_id?: string,\n public_key?: string,\n callback_url?: string,\n\n // regular\n start?: string,\n startgroup?: string,\n game?: string,\n voicechat?: string,\n post?: string,\n thread?: string,\n comment?: string,\n phone?: string,\n t?: string\n }\n }>({\n name: 'resolve',\n protocol: 'tg',\n callback: ({uriParams}, element) => {\n let link: InternalLink;\n if(uriParams.phone) {\n link = this.makeLink(INTERNAL_LINK_TYPE.USER_PHONE_NUMBER, uriParams as Required);\n } else if(uriParams.domain === 'telegrampassport') {\n\n } else {\n link = this.makeLink(INTERNAL_LINK_TYPE.MESSAGE, {\n ...uriParams,\n stack: this.getStackFromElement(element)\n });\n }\n\n this.processInternalLink(link);\n }\n });\n\n addAnchorListener<{\n uriParams: {\n channel: string,\n post: string,\n thread?: string,\n comment?: string\n }\n }>({\n name: 'privatepost',\n protocol: 'tg',\n callback: ({uriParams}) => {\n const link = this.makeLink(INTERNAL_LINK_TYPE.PRIVATE_POST, uriParams);\n this.processInternalLink(link);\n }\n });\n\n addAnchorListener<{\n uriParams: {\n slug: string\n }\n }>({\n name: 'invoice',\n protocol: 'tg',\n callback: ({uriParams}) => {\n const link = this.makeLink(INTERNAL_LINK_TYPE.INVOICE, uriParams);\n this.processInternalLink(link);\n }\n });\n\n ['joinchat' as const, 'join' as const].forEach((name) => {\n addAnchorListener<{\n uriParams: {\n invite: string\n }\n }>({\n name,\n protocol: 'tg',\n callback: ({uriParams}) => {\n const link = this.makeLink(INTERNAL_LINK_TYPE.JOIN_CHAT, uriParams);\n this.processInternalLink(link);\n }\n });\n });\n\n this.onHashChange(true);\n this.attachKeydownListener();\n this.handleAutologinDomains();\n this.checkForShare();\n }\n\n private checkForShare() {\n const share = apiManagerProxy.share;\n if(share) {\n apiManagerProxy.share = undefined;\n PopupElement.createPopup(PopupForward, undefined, async(peerId) => {\n await this.setPeer({peerId});\n if(share.files?.length) {\n const foundMedia = share.files.some((file) => MEDIA_MIME_TYPES_SUPPORTED.has(file.type));\n PopupElement.createPopup(PopupNewMedia, this.chat, share.files, foundMedia ? 'media' : 'document');\n } else {\n this.managers.appMessagesManager.sendText(peerId, share.text);\n }\n });\n }\n }\n\n public handleUrlAuth(options: {\n peerId?: PeerId,\n mid?: number,\n buttonId?: number,\n url: string\n }) {\n const {peerId, mid, buttonId, url} = options;\n\n const openWindow = (url: string) => {\n window.open(url, '_blank');\n };\n\n const onUrlAuthResultAccepted = (urlAuthResult: UrlAuthResult.urlAuthResultAccepted) => {\n openWindow(urlAuthResult.url);\n };\n\n const onUrlAuthResult = async(urlAuthResult: UrlAuthResult): Promise => {\n if(urlAuthResult._ === 'urlAuthResultRequest') {\n const b = document.createElement('b');\n b.append(urlAuthResult.domain);\n const peerTitle = await wrapPeerTitle({peerId: rootScope.myId});\n const botPeerTitle = await wrapPeerTitle({peerId: urlAuthResult.bot.id.toPeerId()});\n\n const logInCheckbox: PopupPeerCheckboxOptions = {\n text: 'OpenUrlOption1',\n textArgs: [b.cloneNode(true), peerTitle],\n checked: true\n };\n\n const allowMessagesCheckbox: PopupPeerCheckboxOptions = urlAuthResult.pFlags.request_write_access ? {\n text: 'OpenUrlOption2',\n textArgs: [botPeerTitle],\n checked: true\n } : undefined;\n\n const checkboxes: PopupPeerCheckboxOptions[] = [\n logInCheckbox,\n allowMessagesCheckbox\n ];\n\n const confirmationPromise = confirmationPopup({\n titleLangKey: 'OpenUrlTitle',\n button: {\n langKey: 'Open'\n },\n descriptionLangKey: 'OpenUrlAlert2',\n descriptionLangArgs: [b],\n checkboxes: checkboxes.filter(Boolean)\n });\n\n if(allowMessagesCheckbox) {\n logInCheckbox.checkboxField.input.addEventListener('change', () => {\n const disabled = !logInCheckbox.checkboxField.checked;\n allowMessagesCheckbox.checkboxField.toggleDisability(disabled);\n\n if(disabled) {\n allowMessagesCheckbox.checkboxField.checked = false;\n }\n });\n }\n\n const [logInChecked, allowMessagesChecked] = await confirmationPromise;\n\n if(!logInChecked) {\n openWindow(url);\n return;\n }\n\n const result = await this.managers.appSeamlessLoginManager.acceptUrlAuth(\n url,\n peerId,\n mid,\n buttonId,\n allowMessagesChecked\n );\n\n return onUrlAuthResult(result);\n } else if(urlAuthResult._ === 'urlAuthResultAccepted') {\n onUrlAuthResultAccepted(urlAuthResult);\n } else {\n openWindow(url);\n }\n };\n\n return this.managers.appSeamlessLoginManager.requestUrlAuth(\n url,\n peerId,\n mid,\n buttonId\n ).then((urlAuthResult) => {\n onUrlAuthResult(urlAuthResult);\n });\n }\n\n private handleAutologinDomains() {\n let appConfig: MTAppConfig;\n rootScope.addEventListener('app_config', (_appConfig) => {\n appConfig = _appConfig;\n });\n\n const onAnchorClick = (element: HTMLAnchorElement) => {\n const url = new URL(element.href);\n if(appConfig.url_auth_domains.includes(url.hostname)) {\n this.handleUrlAuth({url: element.href});\n cancelEvent();\n return;\n }\n\n if(!appConfig.autologin_token || !appConfig.autologin_domains) {\n return;\n }\n\n const originalUrl = element.dataset.originalUrl ??= element.href;\n if(appConfig.autologin_domains.includes(url.hostname)) {\n url.searchParams.set('autologin_token', appConfig.autologin_token);\n element.href = url.toString();\n\n setTimeout(() => {\n element.href = originalUrl;\n delete element.dataset.originalUrl;\n }, 0);\n }\n };\n\n document.addEventListener('click', (e) => {\n const anchor = findUpTag(e.target as HTMLElement, 'A') as HTMLAnchorElement;\n if(anchor?.href) {\n onAnchorClick(anchor);\n }\n });\n\n // addAnchorListener({\n // name: 'handleUrlClick',\n // callback: (_, element) => {\n // onAnchorClick(element);\n // },\n // noCancelEvent: true,\n // noPathnameParams: true,\n // noUriParams: true\n // });\n }\n\n private getStackFromElement(element: HTMLElement) {\n const possibleBubble = findUpClassName(element, 'bubble');\n return possibleBubble ? +possibleBubble.dataset.mid : undefined;\n }\n\n private deleteFilesIterative(callback: (response: Response) => boolean) {\n return this.cacheStorage.timeoutOperation((cache) => {\n const perf = performance.now();\n return cache.keys().then((requests) => {\n const promises = requests.map((request) => {\n return cache.match(request).then((response) => {\n return callback(response);\n });\n });\n\n return Promise.all(promises).then((values) => {\n values.map((isBad, idx) => {\n if(!isBad) {\n return;\n }\n\n const request = requests[idx];\n return cache.delete(request);\n });\n\n return Promise.all(values.filter(Boolean));\n });\n }).then(() => {\n this.log('deleted files', performance.now() - perf);\n });\n });\n }\n\n private toggleChatGradientAnimation(activatingChat: Chat) {\n this.chats.forEach((chat) => {\n if(chat.gradientRenderer) {\n chat.gradientRenderer.scrollAnimate(liteMode.isAvailable('animations') && chat === activatingChat);\n }\n });\n }\n\n private appendEmojiAnimationContainer(screen: ScreenSize) {\n const appendTo = screen === ScreenSize.mobile ? this.columnEl : document.body;\n if(this.emojiAnimationContainer.parentElement !== appendTo) {\n appendTo.append(this.emojiAnimationContainer)\n }\n }\n\n private attachKeydownListener() {\n const IGNORE_KEYS = new Set(['PageUp', 'PageDown', 'Meta', 'Control']);\n const onKeyDown = (e: KeyboardEvent) => {\n const key = e.key;\n const isSelectionCollapsed = document.getSelection().isCollapsed;\n if(overlayCounter.isOverlayActive || IGNORE_KEYS.has(key)) return;\n\n const target = e.target as HTMLElement;\n\n const isTargetAnInput = (target.tagName === 'INPUT' && !['checkbox', 'radio'].includes((target as HTMLInputElement).type)) || target.isContentEditable;\n\n // if(target.tagName === 'INPUT') return;\n\n // this.log('onkeydown', e, document.activeElement);\n\n const chat = this.chat;\n\n if((key.startsWith('Arrow') || (e.shiftKey && key === 'Shift')) && !isSelectionCollapsed) {\n return;\n } else if(e.code === 'KeyC' && (e.ctrlKey || e.metaKey) && !isTargetAnInput) {\n return;\n } else if(e.altKey && (key === 'ArrowUp' || key === 'ArrowDown')) {\n cancelEvent(e);\n this.managers.dialogsStorage.getNextDialog(this.chat.peerId, key === 'ArrowDown', appDialogsManager.filterId).then((dialog) => {\n if(dialog) {\n this.setPeer({peerId: dialog.peerId});\n }\n });\n } else if(key === 'ArrowUp' && this.chat.type !== 'scheduled') {\n if(!chat.input.editMsgId && chat.input.isInputEmpty()) {\n this.managers.appMessagesManager.getFirstMessageToEdit(chat.peerId, chat.threadId).then((message) => {\n if(message) {\n chat.input.initMessageEditing(message.mid);\n cancelEvent(e); // * prevent from scrolling\n }\n });\n } else {\n return;\n }\n } else if(key === 'ArrowDown') {\n return;\n }\n\n if(\n chat?.input?.messageInput &&\n target !== chat.input.messageInput &&\n !isTargetAnInput &&\n !IS_TOUCH_SUPPORTED &&\n (!mediaSizes.isMobile || this.tabId === APP_TABS.CHAT) &&\n !chat.selection.isSelecting &&\n !chat.input.recording &&\n chat.input.messageInput.isContentEditable\n ) {\n chat.input.messageInput.focus();\n placeCaretAtEnd(chat.input.messageInput);\n\n // clone and dispatch same event to new input. it is needed for sending message if input was blurred\n const newEvent = new KeyboardEvent(e.type, e);\n chat.input.messageInput.dispatchEvent(newEvent);\n }\n };\n\n document.body.addEventListener('keydown', onKeyDown);\n }\n\n private makeLink(type: T, uriParams: Omit) {\n return {\n _: type,\n ...uriParams\n } as any as InternalLinkTypeMap[T];\n }\n\n public async processInternalLink(link: InternalLink) {\n switch(link?._) {\n case INTERNAL_LINK_TYPE.MESSAGE: {\n const postId = link.post ? generateMessageId(+link.post) : undefined;\n const commentId = link.comment ? generateMessageId(+link.comment) : undefined;\n const threadId = link.thread ? generateMessageId(+link.thread) : undefined;\n\n this.openUsername({\n userName: link.domain,\n lastMsgId: postId,\n commentId,\n startParam: link.start,\n stack: link.stack,\n threadId,\n mediaTimestamp: link.t && +link.t\n });\n break;\n }\n\n case INTERNAL_LINK_TYPE.PRIVATE_POST: {\n const chatId = link.channel.toChatId();\n const peerId = chatId.toPeerId(true);\n\n const chat = await this.managers.appChatsManager.getChat(chatId);\n if(!chat) {\n try {\n await this.managers.appChatsManager.resolveChannel(chatId);\n } catch(err) {\n toastNew({langPackKey: 'LinkNotFound'});\n throw err;\n }\n }\n\n const postId = generateMessageId(+link.post);\n const threadId = link.thread ? generateMessageId(+link.thread) : undefined;\n\n this.op({\n peer: chat,\n lastMsgId: postId,\n threadId,\n stack: link.stack,\n mediaTimestamp: link.t && +link.t\n });\n break;\n }\n\n case INTERNAL_LINK_TYPE.EMOJI_SET:\n case INTERNAL_LINK_TYPE.STICKER_SET: {\n PopupElement.createPopup(PopupStickers, {id: link.set}, link._ === INTERNAL_LINK_TYPE.EMOJI_SET).show();\n break;\n }\n\n case INTERNAL_LINK_TYPE.JOIN_CHAT: {\n this.managers.appChatsManager.checkChatInvite(link.invite).then((chatInvite) => {\n if((chatInvite as ChatInvite.chatInvitePeek).chat) {\n this.managers.appChatsManager.saveApiChat((chatInvite as ChatInvite.chatInvitePeek).chat, true);\n }\n\n // console.log(chatInvite);\n\n if(chatInvite._ === 'chatInviteAlready' ||\n chatInvite._ === 'chatInvitePeek'/* && chatInvite.expires > tsNow(true) */) {\n this.setInnerPeer({\n peerId: chatInvite.chat.id.toPeerId(true)\n });\n return;\n }\n\n PopupElement.createPopup(PopupJoinChatInvite, link.invite, chatInvite);\n }, (err) => {\n if(err.type === 'INVITE_HASH_EXPIRED') {\n toast(i18n('InviteExpired'));\n }\n });\n break;\n }\n\n case INTERNAL_LINK_TYPE.VOICE_CHAT: {\n if(IS_GROUP_CALL_SUPPORTED) {\n this.joinGroupCall(link.chat_id.toPeerId(true), link.id);\n }\n\n break;\n }\n\n case INTERNAL_LINK_TYPE.USER_PHONE_NUMBER: {\n this.managers.appUsersManager.resolvePhone(link.phone).then((user) => {\n this.setInnerPeer({\n peerId: user.id.toPeerId(false)\n });\n }).catch((err) => {\n if(err.type === 'PHONE_NOT_OCCUPIED') {\n toastNew({langPackKey: 'Alert.UserDoesntExists'});\n }\n });\n\n break;\n }\n\n case INTERNAL_LINK_TYPE.INVOICE: {\n this.managers.appPaymentsManager.getInputInvoiceBySlug(link.slug).then((inputInvoice) => {\n this.managers.appPaymentsManager.getPaymentForm(inputInvoice).then((paymentForm) => {\n // const message: Message.message = {\n // _: 'message',\n // date: 0,\n // id: 0,\n // peerId: 0,\n // peer_id: undefined,\n // message: '',\n // media: {\n // _: 'messageMediaInvoice',\n // currency: paymentForm.invoice.currency,\n // description: paymentForm.description,\n\n // }\n // };\n PopupElement.createPopup(PopupPayment, undefined, inputInvoice, paymentForm);\n });\n });\n break;\n }\n\n default: {\n this.log.warn('Not supported internal link:', link);\n break;\n }\n }\n }\n\n public openUrl(url: string) {\n const {url: wrappedUrl, onclick} = wrapUrl(url);\n if(!onclick) {\n return;\n }\n\n const a = document.createElement('a');\n a.href = wrappedUrl;\n (window as any)[onclick](a);\n }\n\n private onHashChange = (saveState?: boolean) => {\n try {\n this.onHashChangeUnsafe(saveState);\n } catch(err) {\n this.log.error('hash change error', err);\n }\n };\n\n private onHashChangeUnsafe = (saveState?: boolean) => {\n const hash = location.hash;\n if(!saveState) {\n appNavigationController.replaceState();\n }\n\n const splitted = hash.split('?');\n const params = parseUriParams(hash, splitted);\n this.log('hashchange', hash, splitted[0], params);\n if(!hash) {\n return;\n }\n\n if(params.tgaddr) {\n this.openUrl(params.tgaddr);\n return;\n }\n\n switch(splitted[0]) {\n default: {\n params.p = splitted[0].slice(1);\n }\n\n case '#/im': {\n if(!Object.keys(params).length) {\n break;\n }\n\n const p: string = params.p;\n const postId = params.post !== undefined ? generateMessageId(+params.post) : undefined;\n\n switch(p[0]) {\n case '@': {\n this.openUsername({\n userName: p,\n lastMsgId: postId\n });\n break;\n }\n\n default: { // peerId\n this.setInnerPeer({\n peerId: postId ? p.toPeerId(true) : p.toPeerId(),\n lastMsgId: postId\n });\n break;\n }\n }\n }\n }\n\n // appNavigationController.replaceState();\n // location.hash = '';\n };\n\n private async op(options: {\n peer: User.user | MTChat\n } & Omit) {\n let {peer, commentId, threadId, lastMsgId} = options;\n const isUser = peer._ === 'user';\n const peerId = peer.id.toPeerId(!isUser);\n\n const isForum = peer._ === 'channel' && peer.pFlags.forum;\n // open forum tab\n if(!commentId && !threadId && !lastMsgId && isForum) {\n appDialogsManager.toggleForumTabByPeerId(peerId, true);\n return;\n }\n\n // handle t.me/username/thread or t.me/username/messageId\n if(isForum && lastMsgId && !threadId) {\n const message = await this.managers.appMessagesManager.reloadMessages(peerId, lastMsgId);\n if(message) {\n threadId = options.threadId = getMessageThreadId(message, isForum);\n } else {\n threadId = options.threadId = lastMsgId;\n lastMsgId = options.lastMsgId = undefined;\n }\n }\n\n if(threadId) {\n return this.openThread({\n ...(options as any as Parameters[0]),\n peerId\n });\n } else if(commentId) {\n return this.openComment({\n peerId,\n msgId: lastMsgId,\n commentId\n });\n }\n\n return this.setInnerPeer({\n ...options,\n peerId\n });\n }\n\n public openPremiumBot() {\n return this.managers.apiManager.getAppConfig().then((appConfig) => {\n return this.openUsername({userName: appConfig.premium_bot_username});\n });\n }\n\n public openUsername(options: {\n userName: string\n } & Omit) {\n const {userName} = options;\n return this.managers.appUsersManager.resolveUsername(userName).then((peer) => {\n return this.op({\n peer,\n ...options\n });\n }, (err: ApiError) => {\n if(err.type === 'USERNAME_NOT_OCCUPIED') {\n toastNew({langPackKey: 'NoUsernameFound'});\n } else if(err.type === 'USERNAME_INVALID') {\n toastNew({langPackKey: 'Alert.UserDoesntExists'});\n }\n });\n }\n\n /**\n * Opens thread when peerId of discussion group is known\n */\n public async openThread(options: {\n peerId: PeerId,\n lastMsgId: number,\n threadId: number,\n stack?: number\n }) {\n if(await this.managers.appChatsManager.isForum(options.peerId.toChatId())) {\n await this.managers.dialogsStorage.getForumTopicOrReload(options.peerId, options.threadId);\n return this.setInnerPeer(options);\n }\n\n return this.managers.appMessagesManager.reloadMessages(options.peerId, options.threadId).then((message) => {\n if(!message) {\n options.lastMsgId = undefined;\n } else {\n this.managers.appMessagesManager.generateThreadServiceStartMessage(message);\n }\n\n return this.setInnerPeer({\n ...options,\n type: 'discussion'\n });\n });\n }\n\n /**\n * Opens comment directly from original channel\n */\n public openComment(options: {\n peerId: PeerId,\n msgId: number,\n commentId: number\n }) {\n return this.managers.appMessagesManager.getDiscussionMessage(options.peerId, options.msgId).then((message) => {\n return this.openThread({\n peerId: message.peerId,\n lastMsgId: options.commentId,\n threadId: message.mid\n });\n });\n }\n\n public async callUser(userId: UserId, type: CallType) {\n const call = callsController.getCallByUserId(userId);\n if(call) {\n return;\n }\n\n const userFull = await this.managers.appProfileManager.getProfile(userId);\n if(userFull.pFlags.phone_calls_private) {\n wrapPeerTitle({peerId: userId.toPeerId()}).then((element) => {\n return confirmationPopup({\n descriptionLangKey: 'Call.PrivacyErrorMessage',\n descriptionLangArgs: [element],\n button: {\n langKey: 'OK',\n isCancel: true\n }\n });\n });\n\n return;\n }\n\n await this.discardCurrentCall(userId.toPeerId());\n\n callsController.startCallInternal(userId, type === 'video');\n }\n\n private discardCurrentCall(toPeerId: PeerId, ignoreGroupCall?: GroupCallInstance, ignoreCall?: CallInstance) {\n if(groupCallsController.groupCall && groupCallsController.groupCall !== ignoreGroupCall) return this.discardGroupCallConfirmation(toPeerId);\n else if(callsController.currentCall && callsController.currentCall !== ignoreCall) return this.discardCallConfirmation(toPeerId);\n else return Promise.resolve();\n }\n\n private async discardCallConfirmation(toPeerId: PeerId) {\n const currentCall = callsController.currentCall;\n if(currentCall) {\n await Promise.all([\n wrapPeerTitle({peerId: currentCall.interlocutorUserId.toPeerId(false)}),\n wrapPeerTitle({peerId: toPeerId})\n ]).then(([title1, title2]) => {\n return confirmationPopup({\n titleLangKey: 'Call.Confirm.Discard.Call.Header',\n descriptionLangKey: toPeerId.isUser() ? 'Call.Confirm.Discard.Call.ToCall.Text' : 'Call.Confirm.Discard.Call.ToVoice.Text',\n descriptionLangArgs: [title1, title2],\n button: {\n langKey: 'OK'\n }\n });\n });\n\n if(!currentCall.isClosing) {\n await currentCall.hangUp('phoneCallDiscardReasonDisconnect');\n }\n }\n }\n\n private async discardGroupCallConfirmation(toPeerId: PeerId) {\n const currentGroupCall = groupCallsController.groupCall;\n if(currentGroupCall) {\n await Promise.all([\n wrapPeerTitle({peerId: currentGroupCall.chatId.toPeerId(true)}),\n wrapPeerTitle({peerId: toPeerId})\n ]).then(([title1, title2]) => {\n return confirmationPopup({\n titleLangKey: 'Call.Confirm.Discard.Voice.Header',\n descriptionLangKey: toPeerId.isUser() ? 'Call.Confirm.Discard.Voice.ToCall.Text' : 'Call.Confirm.Discard.Voice.ToVoice.Text',\n descriptionLangArgs: [title1, title2],\n button: {\n langKey: 'OK'\n }\n });\n });\n\n if(groupCallsController.groupCall === currentGroupCall) {\n await currentGroupCall.hangUp();\n }\n }\n }\n\n public async joinGroupCall(peerId: PeerId, groupCallId?: GroupCallId) {\n const chatId = peerId.toChatId();\n const hasRights = this.managers.appChatsManager.hasRights(chatId, 'manage_call');\n const next = async() => {\n const chatFull = await this.managers.appProfileManager.getChatFull(chatId);\n let call: MyGroupCall;\n if(!chatFull.call) {\n if(!hasRights) {\n return;\n }\n\n call = await this.managers.appGroupCallsManager.createGroupCall(chatId);\n } else {\n call = chatFull.call;\n }\n\n groupCallsController.joinGroupCall(chatId, call.id, true, false);\n };\n\n if(groupCallId) {\n const groupCall = await this.managers.appGroupCallsManager.getGroupCallFull(groupCallId);\n if(groupCall._ === 'groupCallDiscarded') {\n if(!hasRights) {\n toastNew({\n langPackKey: 'VoiceChat.Chat.Ended'\n });\n\n return;\n }\n\n await confirmationPopup({\n descriptionLangKey: 'VoiceChat.Chat.StartNew',\n button: {\n langKey: 'VoiceChat.Chat.StartNew.OK'\n }\n });\n }\n }\n\n // await this.discardCurrentCall(peerId);\n\n next();\n };\n\n public setCurrentBackground(broadcastEvent = false): ReturnType {\n const theme = themeController.getTheme();\n\n const slug = (theme.settings?.wallpaper as WallPaper.wallPaper)?.slug;\n if(slug) {\n const defaultTheme = STATE_INIT.settings.themes.find((t) => t.name === theme.name);\n // const isDefaultBackground = theme.background.blur === defaultTheme.background.blur &&\n // slug === defaultslug;\n\n // if(!isDefaultBackground) {\n return this.getBackground(slug).then((url) => {\n return this.setBackground(url, broadcastEvent);\n }, () => { // * if NO_ENTRY_FOUND\n theme.settings = copy(defaultTheme.settings); // * reset background\n return this.setCurrentBackground(true);\n });\n // }\n }\n\n return this.setBackground('', broadcastEvent);\n }\n\n private getBackground(slug: string) {\n if(this.backgroundPromises[slug]) return this.backgroundPromises[slug];\n return this.backgroundPromises[slug] = this.cacheStorage.getFile('backgrounds/' + slug).then((blob) => {\n return URL.createObjectURL(blob);\n });\n }\n\n public setBackground(url: string, broadcastEvent = true): Promise {\n this.lastBackgroundUrl = url;\n const promises = this.chats.map((chat) => chat.setBackground(url));\n return promises[promises.length - 1].then(() => {\n if(broadcastEvent) {\n rootScope.dispatchEvent('background_change');\n }\n });\n }\n\n public saveChatPosition(chat: Chat) {\n if(!(['chat', 'discussion'] as ChatType[]).includes(chat.type) || !chat.peerId) {\n return;\n }\n\n // const bubble = chat.bubbles.getBubbleByPoint('top');\n // if(bubble) {\n // const top = bubble.getBoundingClientRect().top;\n const chatBubbles = chat.bubbles;\n const key = chat.peerId + (chat.threadId ? '_' + chat.threadId : '');\n const chatPositions = stateStorage.getFromCache('chatPositions');\n if(!(chatBubbles.scrollable.getDistanceToEnd() <= 16 && chatBubbles.scrollable.loadedAll.bottom) && chatBubbles.getRenderedLength()) {\n chatBubbles.sliceViewport(true);\n const top = chatBubbles.scrollable.scrollTop;\n\n const position = {\n mids: getObjectKeysAndSort(chatBubbles.bubbles, 'desc').filter((mid) => mid > 0 && !chatBubbles.skippedMids.has(mid)),\n top\n };\n\n chatPositions[key] = position;\n\n this.log('saved chat position:', position);\n } else {\n delete chatPositions[key];\n\n this.log('deleted chat position');\n }\n\n stateStorage.set({chatPositions}, true);\n // }\n }\n\n public getChatSavedPosition(chat: Chat): ChatSavedPosition {\n if(!(['chat', 'discussion'] as ChatType[]).includes(chat.type) || !chat.peerId) {\n return;\n }\n\n const key = chat.peerId + (chat.threadId ? '_' + chat.threadId : '');\n const cache = stateStorage.getFromCache('chatPositions');\n return cache && cache[key];\n }\n\n public applyCurrentTheme(slug?: string, backgroundUrl?: string, broadcastEvent?: boolean) {\n if(backgroundUrl) {\n this.backgroundPromises[slug] = Promise.resolve(backgroundUrl);\n }\n\n themeController.setTheme();\n\n return this.setCurrentBackground(broadcastEvent === undefined ? !!slug : broadcastEvent);\n }\n\n private setSettings = () => {\n const {messagesTextSize} = rootScope.settings;\n\n this.customEmojiSize = makeMediaSize(messagesTextSize + 4, messagesTextSize + 4);\n document.documentElement.style.setProperty('--messages-text-size', messagesTextSize + 'px');\n\n const firstTime = !this.customEmojiSize;\n if(!firstTime) {\n const ellipsisElements = document.querySelectorAll('middle-ellipsis-element');\n ellipsisElements.forEach((element) => {\n element.disconnectedCallback();\n element.dataset.fontSize = '' + messagesTextSize;\n if(element.title) element.textContent = element.title;\n element.connectedCallback();\n });\n\n const renderers = document.querySelectorAll('.chat custom-emoji-renderer-element');\n renderers.forEach((renderer) => {\n renderer.forceRenderAfterSize = true;\n });\n }\n\n document.body.classList.toggle('animation-level-0', !liteMode.isAvailable('animations'));\n document.body.classList.toggle('animation-level-1', false);\n document.body.classList.toggle('animation-level-2', liteMode.isAvailable('animations'));\n\n this.chatsSelectTabDebounced = debounce(() => {\n const topbar = this.chat.topbar;\n topbar.pinnedMessage?.setCorrectIndex(0); // * буду молиться богам, чтобы это ничего не сломало, но это исправляет получение пиннеда после анимации\n\n this.managers.apiFileManager.setQueueId(this.chat.bubbles.lazyLoadQueue.queueId);\n }, liteMode.isAvailable('animations') ? 250 : 0, false, true);\n\n const c: LiteModeKey[] = ['stickers_chat', 'stickers_panel'];\n const changedLoop = animationIntersector.setLoop(rootScope.settings.stickers.loop);\n const changedAutoplay = !!c.filter((key) => animationIntersector.setAutoplay(liteMode.isAvailable(key), key)).length;\n if(changedLoop || changedAutoplay) {\n animationIntersector.checkAnimations2(false);\n }\n\n for(const chat of this.chats) {\n chat.setAutoDownloadMedia();\n }\n\n I18n.setTimeFormat(rootScope.settings.timeFormat);\n\n this.toggleChatGradientAnimation(this.chat);\n };\n\n // * не могу использовать тут TransitionSlider, так как мне нужен отрисованный блок рядом\n // * (или под текущим чатом) чтобы правильно отрендерить чат (напр. scrollTop)\n private chatsSelectTab(tab: HTMLElement, animate?: boolean) {\n if(this.prevTab === tab) {\n return;\n }\n\n if(animate === false && this.prevTab) { // * will be used for Safari iOS history swipe\n disableTransition([tab, this.prevTab].filter(Boolean));\n }\n\n if(this.prevTab) {\n this.prevTab.classList.remove('active');\n this.chatsSelectTabDebounced();\n\n // ! нужно переделать на animation, так как при лаге анимация будет длиться не 250мс\n if(liteMode.isAvailable('animations') && animate !== false) {\n dispatchHeavyAnimationEvent(pause(250 + 150), 250 + 150);\n }\n\n const prevIdx = whichChild(this.prevTab);\n const idx = whichChild(tab);\n if(idx > prevIdx) {\n appNavigationController.pushItem({\n type: 'chat',\n onPop: (canAnimate) => {\n this.setPeer({}, canAnimate);\n blurActiveElement();\n }\n });\n }\n }\n\n tab.classList.add('active');\n this.prevTab = tab;\n }\n\n private init() {\n document.addEventListener('paste', this.onDocumentPaste, true);\n\n if(!IS_TOUCH_SUPPORTED) {\n this.attachDragAndDropListeners();\n }\n\n // if(!isTouchSupported) {\n this.markupTooltip = new MarkupTooltip(this);\n this.markupTooltip.handleSelection();\n // }\n }\n\n private attachDragAndDropListeners() {\n const drops: ChatDragAndDrop[] = [];\n const mediaDrops: ChatDragAndDrop[] = [];\n let mounted = false;\n const toggle = async(e: DragEvent, mount: boolean) => {\n if(mount === mounted) return;\n\n const _types = e.dataTransfer.types;\n // @ts-ignore\n const isFiles = _types.contains ? _types.contains('Files') : _types.indexOf('Files') >= 0;\n\n const newMediaPopup = getCurrentNewMediaPopup();\n const types: string[] = await getFilesFromEvent(e, true);\n if(!isFiles || (!(await this.canDrag()) && !newMediaPopup)) { // * skip dragging text case\n counter = 0;\n return;\n }\n\n const rights = await PopupNewMedia.canSend(this.chat.peerId, true);\n\n const _dropsContainer = newMediaPopup ? mediaDropsContainer : dropsContainer;\n const _drops = newMediaPopup ? mediaDrops : drops;\n\n if(mount && !_drops.length) {\n const force = isFiles && !types.length; // * can't get file items not from 'drop' on Safari\n\n const [foundMedia, foundDocuments] = partition(types, (t) => MEDIA_MIME_TYPES_SUPPORTED.has(t));\n const [foundPhotos, foundVideos] = partition(foundMedia, (t) => IMAGE_MIME_TYPES_SUPPORTED.has(t));\n\n if(!rights.send_docs) {\n foundDocuments.length = 0;\n } else {\n foundDocuments.push(...foundMedia);\n }\n\n if(!rights.send_photos) {\n foundPhotos.forEach((mimeType) => indexOfAndSplice(foundMedia, mimeType));\n foundPhotos.length = 0;\n }\n\n if(!rights.send_videos) {\n foundVideos.forEach((mimeType) => indexOfAndSplice(foundMedia, mimeType));\n foundVideos.length = 0;\n }\n\n this.log('drag files', types, foundMedia, foundDocuments, foundPhotos, foundVideos);\n\n if(newMediaPopup) {\n newMediaPopup.appendDrops(_dropsContainer);\n\n const length = (rights.send_docs ? [foundDocuments] : [foundPhotos, foundVideos]).reduce((acc, v) => acc + v.length, 0);\n if(length || force) {\n _drops.push(new ChatDragAndDrop(_dropsContainer, {\n header: 'Preview.Dragging.AddItems',\n headerArgs: [length],\n onDrop: (e: DragEvent) => {\n toggle(e, false);\n this.log('drop', e);\n this.onDocumentPaste(e, 'document');\n }\n }));\n }\n } else {\n if(foundDocuments.length || force) {\n _drops.push(new ChatDragAndDrop(_dropsContainer, {\n icon: 'dragfiles',\n header: 'Chat.DropTitle',\n subtitle: 'Chat.DropAsFilesDesc',\n onDrop: (e: DragEvent) => {\n toggle(e, false);\n this.log('drop', e);\n this.onDocumentPaste(e, 'document');\n }\n }));\n }\n\n if(foundMedia.length || force) {\n _drops.push(new ChatDragAndDrop(_dropsContainer, {\n icon: 'dragmedia',\n header: 'Chat.DropTitle',\n subtitle: 'Chat.DropQuickDesc',\n onDrop: (e: DragEvent) => {\n toggle(e, false);\n this.log('drop', e);\n this.onDocumentPaste(e, 'media');\n }\n }));\n }\n\n this.chat.container.append(_dropsContainer);\n }\n }\n\n // if(!mount) return;\n\n SetTransition({\n element: _dropsContainer,\n className: 'is-visible',\n forwards: mount,\n duration: 200,\n onTransitionEnd: () => {\n if(!mount) {\n _drops.forEach((drop) => {\n drop.destroy();\n });\n\n _drops.length = 0;\n }\n }\n });\n\n if(mount) {\n _drops.forEach((drop) => {\n drop.setPath();\n });\n } else {\n counter = 0;\n }\n\n document.body.classList.toggle('is-dragging', mount);\n mounted = mount;\n };\n\n /* document.body.addEventListener('dragover', (e) => {\n cancelEvent(e);\n }); */\n\n let counter = 0;\n document.body.addEventListener('dragenter', (e) => {\n counter++;\n });\n\n document.body.addEventListener('dragover', (e) => {\n // this.log('dragover', e/* , e.dataTransfer.types[0] */);\n toggle(e, true);\n cancelEvent(e);\n });\n\n document.body.addEventListener('dragleave', (e) => {\n // this.log('dragleave', e, counter);\n // if((e.pageX <= 0 || e.pageX >= this.managers.appPhotosManager.windowW) || (e.pageY <= 0 || e.pageY >= this.managers.appPhotosManager.windowH)) {\n counter--;\n if(counter === 0) {\n // if(!findUpClassName(e.target, 'drops-container')) {\n toggle(e, false);\n }\n });\n\n const dropsContainer = document.createElement('div');\n dropsContainer.classList.add('drops-container');\n\n const mediaDropsContainer = dropsContainer.cloneNode(true) as HTMLElement;\n }\n\n private async canDrag() {\n const chat = this.chat;\n const peerId = chat?.peerId;\n return !(!peerId || overlayCounter.isOverlayActive || !(await chat.canSend('send_media')));\n }\n\n private onDocumentPaste = async(e: ClipboardEvent | DragEvent, attachType?: 'media' | 'document') => {\n const newMediaPopup = getCurrentNewMediaPopup();\n\n // console.log('document paste');\n // console.log('item', event.clipboardData.getData());\n\n if(e instanceof DragEvent) {\n const _types = e.dataTransfer.types;\n // @ts-ignore\n const isFiles = _types.contains ? _types.contains('Files') : _types.indexOf('Files') >= 0;\n if(isFiles) {\n cancelEvent(e);\n }\n }\n\n const files = await getFilesFromEvent(e);\n if(!(await this.canDrag()) && !newMediaPopup) return;\n if(files.length) {\n if(newMediaPopup) {\n newMediaPopup.addFiles(files);\n return;\n }\n\n const chatInput = this.chat.input;\n chatInput.willAttachType = attachType || (MEDIA_MIME_TYPES_SUPPORTED.has(files[0].type) ? 'media' : 'document');\n PopupElement.createPopup(PopupNewMedia, this.chat, files, chatInput.willAttachType);\n }\n };\n\n private async overrideHash(peerId?: PeerId) {\n let str: string;\n if(peerId) {\n const username = await this.managers.appPeersManager.getPeerUsername(peerId);\n str = username ? '@' + username : '' + peerId;\n }\n\n appNavigationController.overrideHash(str);\n }\n\n public selectTab(id: APP_TABS, animate?: boolean) {\n if(animate === false) { // * will be used for Safari iOS history swipe\n disableTransition([appSidebarLeft.sidebarEl, this.columnEl, appSidebarRight.sidebarEl]);\n }\n\n document.body.classList.toggle(LEFT_COLUMN_ACTIVE_CLASSNAME, id === APP_TABS.CHATLIST);\n\n const prevTabId = this.tabId;\n if(prevTabId !== undefined) {\n this.overrideHash(id > APP_TABS.CHATLIST ? this.chat?.peerId : undefined);\n this.dispatchEvent('tab_changing', id);\n }\n\n this.log('selectTab', id, prevTabId);\n\n let animationPromise: Promise = liteMode.isAvailable('animations') ? doubleRaf() : Promise.resolve();\n if(\n prevTabId !== undefined &&\n prevTabId !== id &&\n liteMode.isAvailable('animations') &&\n animate !== false/* &&\n mediaSizes.activeScreen !== ScreenSize.large */\n ) {\n const transitionTime = (mediaSizes.isMobile ? 250 : 200) + 100; // * cause transition time could be > 250ms\n animationPromise = pause(transitionTime);\n dispatchHeavyAnimationEvent(animationPromise, transitionTime);\n\n // ! it's very heavy operation. will blink in firefox\n /* this.columnEl.classList.add('disable-hover');\n animationPromise.finally(() => {\n this.columnEl.classList.remove('disable-hover');\n }); */\n }\n\n this.tabId = id;\n blurActiveElement();\n if(mediaSizes.isMobile && prevTabId === APP_TABS.PROFILE && id < APP_TABS.PROFILE) {\n document.body.classList.remove(RIGHT_COLUMN_ACTIVE_CLASSNAME);\n }\n\n if(prevTabId !== undefined && id > prevTabId) {\n if(id < APP_TABS.PROFILE || !appNavigationController.findItemByType('im')) {\n appNavigationController.pushItem({\n type: 'im',\n onPop: (canAnimate) => {\n // this.selectTab(prevTabId, !isSafari);\n this.setPeer({}, canAnimate);\n }\n });\n }\n }\n\n const onImTabChange = (window as any).onImTabChange;\n onImTabChange && onImTabChange(id);\n\n // this._selectTab(id, mediaSizes.isMobile);\n // document.body.classList.toggle(RIGHT_COLUMN_ACTIVE_CLASSNAME, id === 2);\n\n return animationPromise;\n }\n\n public updateStatus() {\n return this.managers.appUsersManager.updateMyOnlineStatus(this.offline);\n }\n\n private createNewChat() {\n const chat = new Chat(\n this,\n this.managers\n );\n\n if(this.chats.length) {\n chat.setBackground(this.lastBackgroundUrl, true);\n }\n\n this.chats.push(chat);\n\n return chat;\n }\n\n private spliceChats(fromIndex: number, justReturn = true, animate?: boolean, spliced?: Chat[]) {\n if(fromIndex >= this.chats.length) return;\n\n const chatFrom = this.chat;\n if(this.chats.length > 1 && justReturn) {\n this.dispatchEvent('peer_changing', this.chat);\n }\n\n if(!spliced) {\n spliced = this.chats.splice(fromIndex, this.chats.length - fromIndex);\n }\n\n const chatTo = this.chat;\n this.dispatchEvent('chat_changing', {from: chatFrom, to: chatTo});\n\n // * -1 because one item is being sliced when closing the chat by calling .removeByType\n for(let i = 0; i < spliced.length - 1; ++i) {\n appNavigationController.removeByType('chat', true);\n }\n\n // * fix middle chat z-index on animation\n if(spliced.length > 1) {\n spliced.slice(0, -1).forEach((chat) => {\n chat.container.remove();\n });\n }\n\n this.chatsSelectTab(chatTo.container, animate);\n\n if(justReturn) {\n this.dispatchEvent('peer_changed', chatTo);\n\n const searchTab = appSidebarRight.getTab(AppPrivateSearchTab);\n searchTab?.close();\n\n appSidebarRight.replaceSharedMediaTab(chatTo.sharedMediaTab);\n }\n\n spliced.forEach((chat) => {\n chat.beforeDestroy();\n });\n\n setTimeout(() => {\n // chat.setPeer(0);\n spliced.forEach((chat) => {\n chat.destroy();\n });\n }, 250 + 100);\n }\n\n public async setPeer(options: Partial = {}, animate?: boolean): Promise {\n if(this.init) {\n this.init();\n this.init = null;\n }\n\n options.peerId ??= NULL_PEER_ID;\n\n const {peerId, lastMsgId, threadId} = options;\n\n const chat = this.chat;\n const chatIndex = this.chats.indexOf(chat);\n const isSamePeer = this.isSamePeer(chat, options as any);\n if(!peerId) {\n if(chatIndex > 0) {\n this.spliceChats(chatIndex, undefined, animate);\n return;\n } else if(mediaSizes.activeScreen === ScreenSize.medium) { // * floating sidebar case\n this.selectTab(+!this.tabId, animate);\n return;\n }\n } else if(chatIndex > 0 && chat.peerId && !isSamePeer) {\n // const firstChat = this.chats[0];\n // if(firstChat.peerId !== chat.peerId) {\n /* // * slice idx > 0, set background and slice first, so new one will be the first\n const spliced = this.chats.splice(1, this.chats.length - 1);\n this.createNewChat();\n this.chats.splice(0, 1); */\n const spliced = this.chats.splice(1, this.chats.length - 1);\n if(this.chat.peerId === peerId) {\n this.spliceChats(0, true, true, spliced);\n return;\n } else {\n const ret = this.setPeer(options);\n this.spliceChats(0, false, false, spliced);\n return ret;\n }\n // } else {\n // this.spliceChats(1, false, animate);\n // }\n\n // return ret;\n }\n\n // * don't reset peer if returning\n if(isSamePeer && mediaSizes.activeScreen <= ScreenSize.medium && document.body.classList.contains(LEFT_COLUMN_ACTIVE_CLASSNAME)) {\n this.selectTab(APP_TABS.CHAT, animate);\n return false;\n }\n\n if(peerId || mediaSizes.activeScreen !== ScreenSize.mobile) {\n const result = await chat.setPeer(options as any as Parameters[0]);\n\n // * wait for cached render\n const promise = result?.cached ? result.promise : Promise.resolve();\n if(peerId) {\n Promise.all([\n promise,\n chat.setBackgroundPromise\n ]).then(() => {\n // window.requestAnimationFrame(() => {\n setTimeout(() => { // * setTimeout is better here\n setTimeout(() => {\n this.chatsSelectTab(this.chat.container);\n }, 0);\n this.selectTab(APP_TABS.CHAT, animate);\n }, 0);\n });\n }\n }\n\n if(!peerId) {\n this.selectTab(APP_TABS.CHATLIST, animate);\n return false;\n }\n }\n\n public async setInnerPeer(options: ChatSetInnerPeerOptions) {\n const {peerId} = options;\n if(peerId === NULL_PEER_ID || !peerId) {\n return;\n }\n\n if(!options.type) {\n if(options.threadId && !(await this.managers.appPeersManager.isForum(options.peerId))) {\n options.type = 'discussion';\n }\n\n options.type ??= 'chat';\n }\n\n // * reuse current chat\n const existingIndex = this.chats.findIndex((chat) => this.isSamePeer(chat, options) || (mediaSizes.activeScreen === ScreenSize.mobile && this.tabId === 0));\n if(existingIndex !== -1) {\n this.spliceChats(existingIndex + 1);\n return this.setPeer(options);\n }\n\n const oldChat = this.chat;\n let chat = oldChat;\n if(oldChat.inited) { // * use first not inited chat\n chat = this.createNewChat();\n }\n\n this.dispatchEvent('chat_changing', {from: oldChat, to: chat});\n\n // this.chatsSelectTab(chat.container);\n\n return this.setPeer(options);\n }\n\n public openScheduled(peerId: PeerId) {\n this.setInnerPeer({\n peerId,\n type: 'scheduled'\n });\n }\n\n private getTypingElement(action: SendMessageAction) {\n const el = document.createElement('span');\n let c = 'peer-typing';\n el.classList.add(c);\n el.dataset.action = action._;\n switch(action._) {\n case 'sendMessageTypingAction': {\n // default: {\n c += '-text';\n for(let i = 0; i < 3; ++i) {\n const dot = document.createElement('span');\n dot.className = c + '-dot';\n el.append(dot);\n }\n break;\n }\n\n case 'sendMessageUploadAudioAction':\n case 'sendMessageUploadDocumentAction':\n case 'sendMessageUploadRoundAction':\n case 'sendMessageUploadVideoAction':\n case 'sendMessageUploadPhotoAction': {\n c += '-upload';\n /* const trail = document.createElement('span');\n trail.className = c + '-trail';\n el.append(trail); */\n break;\n }\n\n case 'sendMessageRecordAudioAction':\n case 'sendMessageRecordRoundAction':\n case 'sendMessageRecordVideoAction': {\n c += '-record';\n break;\n }\n\n case 'sendMessageEmojiInteractionSeen':\n case 'sendMessageChooseStickerAction': {\n c += '-choosing-sticker';\n for(let i = 0; i < 2; ++i) {\n const eye = document.createElement('div');\n eye.className = c + '-eye';\n el.append(eye);\n }\n break;\n }\n }\n\n el.classList.add(c);\n\n return el;\n }\n\n public async getPeerTyping(peerId: PeerId, container?: HTMLElement, threadId?: number) {\n // const log = this.log.bindPrefix('getPeerTyping-' + peerId);\n // log('getting peer typing');\n\n const isUser = peerId.isUser();\n if(isUser && await this.managers.appUsersManager.isBot(peerId)) {\n // log('a bot');\n return;\n }\n\n const typings = await this.managers.appProfileManager.getPeerTypings(peerId, threadId);\n if(!typings?.length) {\n // log('have no typing');\n return;\n }\n\n const typing = typings[0];\n\n const langPackKeys: {\n [peerType in 'private' | 'chat' | 'multi']?: Partial<{[action in SendMessageAction['_']]: LangPackKey}>\n } = {\n private: {\n 'sendMessageTypingAction': 'Peer.Activity.User.TypingText',\n 'sendMessageUploadAudioAction': 'Peer.Activity.User.SendingFile',\n 'sendMessageUploadDocumentAction': 'Peer.Activity.User.SendingFile',\n 'sendMessageUploadPhotoAction': 'Peer.Activity.User.SendingPhoto',\n 'sendMessageUploadVideoAction': 'Peer.Activity.User.SendingVideo',\n 'sendMessageUploadRoundAction': 'Peer.Activity.User.SendingVideo',\n 'sendMessageRecordVideoAction': 'Peer.Activity.User.RecordingVideo',\n 'sendMessageRecordAudioAction': 'Peer.Activity.User.RecordingAudio',\n 'sendMessageRecordRoundAction': 'Peer.Activity.User.RecordingVideo',\n 'sendMessageGamePlayAction': 'Peer.Activity.User.PlayingGame',\n 'sendMessageChooseStickerAction': 'Peer.Activity.User.ChoosingSticker',\n 'sendMessageEmojiInteractionSeen': 'Peer.Activity.User.EnjoyingAnimations'\n },\n chat: {\n 'sendMessageTypingAction': 'Peer.Activity.Chat.TypingText',\n 'sendMessageUploadAudioAction': 'Peer.Activity.Chat.SendingFile',\n 'sendMessageUploadDocumentAction': 'Peer.Activity.Chat.SendingFile',\n 'sendMessageUploadPhotoAction': 'Peer.Activity.Chat.SendingPhoto',\n 'sendMessageUploadVideoAction': 'Peer.Activity.Chat.SendingVideo',\n 'sendMessageUploadRoundAction': 'Peer.Activity.Chat.SendingVideo',\n 'sendMessageRecordVideoAction': 'Peer.Activity.Chat.RecordingVideo',\n 'sendMessageRecordAudioAction': 'Peer.Activity.Chat.RecordingAudio',\n 'sendMessageRecordRoundAction': 'Peer.Activity.Chat.RecordingVideo',\n 'sendMessageGamePlayAction': 'Peer.Activity.Chat.PlayingGame',\n 'sendMessageChooseStickerAction': 'Peer.Activity.Chat.ChoosingSticker',\n 'sendMessageEmojiInteractionSeen': 'Peer.Activity.Chat.EnjoyingAnimations'\n },\n multi: {\n 'sendMessageTypingAction': 'Peer.Activity.Chat.Multi.TypingText1',\n 'sendMessageUploadAudioAction': 'Peer.Activity.Chat.Multi.SendingFile1',\n 'sendMessageUploadDocumentAction': 'Peer.Activity.Chat.Multi.SendingFile1',\n 'sendMessageUploadPhotoAction': 'Peer.Activity.Chat.Multi.SendingPhoto1',\n 'sendMessageUploadVideoAction': 'Peer.Activity.Chat.Multi.SendingVideo1',\n 'sendMessageUploadRoundAction': 'Peer.Activity.Chat.Multi.SendingVideo1',\n 'sendMessageRecordVideoAction': 'Peer.Activity.Chat.Multi.RecordingVideo1',\n 'sendMessageRecordAudioAction': 'Peer.Activity.Chat.Multi.RecordingAudio1',\n 'sendMessageRecordRoundAction': 'Peer.Activity.Chat.Multi.RecordingVideo1',\n 'sendMessageGamePlayAction': 'Peer.Activity.Chat.Multi.PlayingGame1',\n 'sendMessageChooseStickerAction': 'Peer.Activity.Chat.Multi.ChoosingSticker1'\n }\n };\n\n const mapa = isUser ? langPackKeys.private : (typings.length > 1 ? langPackKeys.multi : langPackKeys.chat);\n let action = typing.action;\n\n if(typings.length > 1) {\n const s: any = {};\n typings.forEach((typing) => {\n const type = typing.action._;\n if(s[type] === undefined) s[type] = 0;\n ++s[type];\n });\n\n if(Object.keys(s).length > 1) {\n action = {\n _: 'sendMessageTypingAction'\n };\n }\n }\n\n const langPackKey = mapa[action._];\n if(!langPackKey) {\n // log('no langPackKey');\n return;\n }\n\n let peerTitlePromise: Promise;\n let args: any[];\n if(peerId.isAnyChat()) {\n const peerTitle = new PeerTitle();\n peerTitlePromise = peerTitle.update({peerId: typing.userId.toPeerId(false), onlyFirstName: true});\n args = [\n peerTitle.element,\n typings.length - 1\n ];\n\n await peerTitlePromise;\n }\n\n if(!container) {\n container = document.createElement('span');\n container.classList.add('online', 'peer-typing-container');\n }\n\n container.classList.toggle('peer-typing-flex', action._ === 'sendMessageChooseStickerAction' || action._ === 'sendMessageEmojiInteractionSeen');\n\n let typingElement = container.firstElementChild as HTMLElement;\n if(!typingElement) {\n typingElement = this.getTypingElement(action);\n container.prepend(typingElement);\n } else {\n if(typingElement.dataset.action !== action._) {\n typingElement.replaceWith(this.getTypingElement(action));\n }\n }\n\n if(action._ === 'sendMessageEmojiInteractionSeen') {\n if(args) {\n args.pop();\n } else {\n args = [];\n }\n\n const span = htmlToSpan(wrapEmojiText(action.emoticon));\n args.push(span);\n }\n\n const descriptionElement = i18n(langPackKey, args);\n descriptionElement.classList.add('peer-typing-description');\n\n if(container.childElementCount > 1) container.lastElementChild.replaceWith(descriptionElement);\n else container.append(descriptionElement);\n\n // log('returning typing');\n return container;\n }\n\n private async getChatStatus(chatId: ChatId, noTyping?: boolean): Promise> {\n const typingEl = noTyping ? undefined : await this.getPeerTyping(chatId.toPeerId(true));\n if(typingEl) {\n return {cached: true, result: Promise.resolve(typingEl)};\n }\n\n const result = await this.managers.acknowledged.appProfileManager.getChatFull(chatId);\n const dooo = async(chatInfo: ChatFull) => {\n // this.chat.log('chatInfo res:', chatInfo);\n\n const participants_count = (chatInfo as ChatFull.channelFull).participants_count ||\n ((chatInfo as ChatFull.chatFull).participants as ChatParticipants.chatParticipants)?.participants?.length ||\n 1;\n // if(participants_count) {\n let subtitle = await getChatMembersString(chatId);\n\n if(participants_count < 2) {\n return subtitle;\n }\n\n const onlines = await this.managers.appProfileManager.getOnlines(chatId);\n if(onlines > 1) {\n const span = document.createElement('span');\n\n span.append(...join([subtitle, i18n('OnlineCount', [numberThousandSplitter(onlines)])], false));\n subtitle = span;\n }\n\n return subtitle;\n // }\n };\n\n const promise = Promise.resolve(result.result).then(dooo);\n return {\n cached: result.cached,\n result: promise\n };\n }\n\n private async getUserStatus(userId: UserId, ignoreSelf?: boolean) {\n const result: AckedResult = {\n cached: true,\n result: Promise.resolve(undefined as HTMLElement)\n };\n\n const user = await this.managers.appUsersManager.getUser(userId);\n if(!user || (user.pFlags.self && !ignoreSelf)) {\n return result;\n }\n\n const subtitle = getUserStatusString(user);\n\n if(!user.pFlags.bot && !user.pFlags.support) {\n let typingEl = await this.getPeerTyping(userId.toPeerId());\n if(!typingEl && user.status?._ === 'userStatusOnline') {\n typingEl = document.createElement('span');\n typingEl.classList.add('online');\n typingEl.append(subtitle);\n }\n\n if(typingEl) {\n result.result = Promise.resolve(typingEl);\n return result;\n }\n }\n\n result.result = Promise.resolve(subtitle);\n return result;\n }\n\n private async getPeerStatus(peerId: PeerId, ignoreSelf?: boolean, noTyping?: boolean) {\n if(!peerId) return;\n let promise: Promise>;\n if(peerId.isAnyChat()) {\n promise = this.getChatStatus(peerId.toChatId(), noTyping);\n } else {\n promise = this.getUserStatus(peerId.toUserId(), ignoreSelf);\n }\n\n return promise;\n }\n\n public async setPeerStatus(options: {\n peerId: PeerId,\n element: HTMLElement,\n needClear: boolean,\n useWhitespace: boolean,\n middleware: () => boolean,\n ignoreSelf?: boolean,\n noTyping?: boolean\n }) {\n // const log = this.log.bindPrefix('status-' + peerId);\n // log('setting status', element);\n\n const {peerId, element, needClear, useWhitespace, middleware, ignoreSelf, noTyping} = options;\n\n if(!needClear) {\n // * good good good\n const typingContainer = element.querySelector('.peer-typing-container') as HTMLElement;\n if(typingContainer && await this.getPeerTyping(peerId, typingContainer)) {\n // log('already have a status');\n return;\n }\n }\n\n const result = await this.getPeerStatus(peerId, ignoreSelf, noTyping);\n // log('getPeerStatus result', result);\n if(!middleware()) {\n // log.warn('middleware');\n return;\n }\n\n const set = async() => {\n const subtitle = result && await result.result;\n if(!middleware()) {\n return;\n }\n\n return () => replaceContent(element, subtitle || placeholder);\n };\n\n const placeholder = useWhitespace ? NBSP : ''; // ! HERE U CAN FIND WHITESPACE\n if(!result || result.cached || needClear === undefined) {\n return await set();\n } else if(needClear) {\n return () => {\n element.textContent = placeholder;\n return set().then((callback) => callback?.());\n };\n }\n }\n\n public setChoosingStickerTyping(cancel: boolean) {\n this.managers.appMessagesManager.setTyping(this.chat.peerId, {_: cancel ? 'sendMessageCancelAction' : 'sendMessageChooseStickerAction'}, undefined, this.chat.threadId);\n }\n\n public isSamePeer(options1: {peerId: PeerId, threadId?: number, type?: ChatType}, options2: typeof options1) {\n return options1.peerId === options2.peerId &&\n options1.threadId === options2.threadId &&\n (typeof(options1.type) !== typeof(options2.type) || options1.type === options2.type);\n }\n\n public giftPremium(peerId: PeerId) {\n this.managers.appProfileManager.getProfile(peerId.toUserId()).then((profile) => {\n PopupElement.createPopup(PopupGiftPremium, peerId, profile.premium_gifts);\n });\n }\n}\n\nconst appImManager = new AppImManager();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.appImManager = appImManager);\nexport default appImManager;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport enum INTERNAL_LINK_TYPE {\n MESSAGE,\n PRIVATE_POST,\n STICKER_SET,\n JOIN_CHAT,\n VOICE_CHAT,\n USER_PHONE_NUMBER,\n INVOICE,\n EMOJI_SET\n};\n\nexport type InternalLink = InternalLink.InternalLinkMessage | InternalLink.InternalLinkPrivatePost | InternalLink.InternalLinkStickerSet | InternalLink.InternalLinkJoinChat | InternalLink.InternalLinkVoiceChat | InternalLink.InternalLinkUserPhoneNumber | InternalLink.InternalLinkInvoice | InternalLink.InternalLinkEmojiSet;\n\nexport namespace InternalLink {\n export interface InternalLinkMessage {\n _: INTERNAL_LINK_TYPE.MESSAGE,\n domain: string,\n post?: string,\n comment?: string,\n thread?: string,\n start?: string,\n t?: string, // media timestamp\n stack?: number // local\n }\n\n export interface InternalLinkPrivatePost {\n _: INTERNAL_LINK_TYPE.PRIVATE_POST,\n channel: string,\n post: string,\n thread?: string,\n comment?: string,\n t?: string // media timestamp\n stack?: number // local\n }\n\n export interface InternalLinkStickerSet {\n _: INTERNAL_LINK_TYPE.STICKER_SET,\n set: string\n }\n\n export interface InternalLinkJoinChat {\n _: INTERNAL_LINK_TYPE.JOIN_CHAT,\n invite: string\n }\n\n /**\n * LOCAL LINK\n */\n export interface InternalLinkVoiceChat {\n _: INTERNAL_LINK_TYPE.VOICE_CHAT,\n id: string,\n access_hash: string,\n chat_id: string\n }\n\n export interface InternalLinkUserPhoneNumber {\n _: INTERNAL_LINK_TYPE.USER_PHONE_NUMBER,\n phone: string\n }\n\n export interface InternalLinkInvoice {\n _: INTERNAL_LINK_TYPE.INVOICE,\n slug: string\n }\n\n export interface InternalLinkEmojiSet {\n _: INTERNAL_LINK_TYPE.EMOJI_SET,\n set: string\n }\n}\n\nexport type InternalLinkTypeMap = {\n [INTERNAL_LINK_TYPE.MESSAGE]: InternalLink.InternalLinkMessage,\n [INTERNAL_LINK_TYPE.PRIVATE_POST]: InternalLink.InternalLinkPrivatePost,\n [INTERNAL_LINK_TYPE.STICKER_SET]: InternalLink.InternalLinkStickerSet,\n [INTERNAL_LINK_TYPE.JOIN_CHAT]: InternalLink.InternalLinkJoinChat,\n [INTERNAL_LINK_TYPE.VOICE_CHAT]: InternalLink.InternalLinkVoiceChat,\n [INTERNAL_LINK_TYPE.USER_PHONE_NUMBER]: InternalLink.InternalLinkUserPhoneNumber,\n [INTERNAL_LINK_TYPE.INVOICE]: InternalLink.InternalLinkInvoice,\n [INTERNAL_LINK_TYPE.EMOJI_SET]: InternalLink.InternalLinkEmojiSet\n};\n","import {Message, MessageMedia} from '../../../../layer';\n\nexport default function canSaveMessageMedia(message: Message.message | Message.messageService) {\n return message &&\n !message.pFlags.is_outgoing &&\n !(message as Message.message).pFlags.noforwards &&\n !((message as Message.message).media as MessageMedia.messageMediaInvoice)?.extended_media\n}\n","import {Document, Game, Message, MessageAction, MessageExtendedMedia, MessageMedia, Photo, WebPage} from '../../../../layer';\n\nexport default function getMediaFromMessage(message: Message, onlyInner: true): Photo.photo | Document.document;\nexport default function getMediaFromMessage(message: Message, onlyInner?: false): Photo.photo | Document.document | Game.game | WebPage.webPage;\nexport default function getMediaFromMessage(message: Message, onlyInner = false): Photo.photo | Document.document | Game.game | WebPage.webPage {\n if(!message) return;\n\n let media: any;\n if((message as Message.messageService).action) {\n media = ((message as Message.messageService).action as MessageAction.messageActionChannelEditPhoto).photo;\n } else if((message as Message.message).media) {\n let messageMedia = (message as Message.message).media;\n if((messageMedia as MessageMedia.messageMediaWebPage).webpage) {\n messageMedia = (messageMedia as MessageMedia.messageMediaWebPage).webpage as any as MessageMedia;\n } else if((messageMedia as MessageMedia.messageMediaInvoice).extended_media?._ === 'messageExtendedMedia') {\n messageMedia = ((messageMedia as MessageMedia.messageMediaInvoice).extended_media as MessageExtendedMedia.messageExtendedMedia).media;\n }\n\n media = (messageMedia as MessageMedia.messageMediaDocument).document ||\n (messageMedia as MessageMedia.messageMediaPhoto).photo ||\n (onlyInner ? undefined : (messageMedia as MessageMedia.messageMediaGame).game || messageMedia);\n }\n\n return media as any;\n}\n","import {Message} from '../../../../layer';\nimport type {MyMessage} from '../../appMessagesManager';\n\nexport default function getMessageSenderPeerIdOrName(message: MyMessage) {\n if(message.fromId) {\n return {\n peerId: message.fromId\n };\n } else {\n return {\n fromName: (message as Message.message).fwd_from?.from_name\n };\n }\n}\n","import {isRestricted} from '../../../../helpers/restrictions';\nimport {Message} from '../../../../layer';\n\nexport default function isMessageRestricted(message: Message.message) {\n return !!(message.restriction_reason && isRestricted(message.restriction_reason));\n}\n","// https://github.com/eelcohn/Telegram-API/wiki/Calculating-color-for-a-Telegram-user-on-IRC\n/*\n HTML-color IRC-color Description\n #c03d33 4 red\n #4fad2d 3 green\n #d09306 7 yellow\n #168acd 10 blue\n #8544d6 6 purple\n #cd4073 13 pink\n #2996ad 11 sea\n #ce671b 5 orange\n*/\nconst DialogColorsFg = ['#fc5c51', '#0fb297', '#d09306', '#3d72ed', '#895dd5', '#cd4073', '#00c1a6', '#fa790f'];\nconst DialogColors = ['red', 'green', 'yellow', 'blue', 'violet', 'pink', 'cyan', 'orange'];\nconst DialogColorsMap = [0, 7, 4, 1, 6, 3, 5];\n\nexport default function getPeerColorById(peerId: PeerId, pic = true) {\n if(!peerId) return '';\n\n const idx = DialogColorsMap[Math.abs(+peerId) % 7];\n const color = (pic ? DialogColors : DialogColorsFg)[idx];\n return color;\n}\n","import {Chat, User} from '../../../../layer';\n\nexport default function getPeerEditableUsername(peer: User.user | Chat.channel) {\n if(peer.username) {\n return peer.username;\n }\n\n const usernames = peer.usernames;\n const username = usernames?.find((username) => username.pFlags.editable);\n return username?.username;\n}\n","import isObject from '../../../../helpers/object/isObject';\nimport {InputChannel, InputPeer, Peer} from '../../../../layer';\nimport {NULL_PEER_ID} from '../../../mtproto/mtproto_config';\n\nexport default function getPeerId(peerId: {user_id: UserId} | {channel_id: ChatId} | {chat_id: ChatId} | InputPeer | InputChannel | PeerId | string): PeerId {\n if(peerId !== undefined && ((peerId as string).isPeerId ? (peerId as string).isPeerId() : false)) return peerId as PeerId;\n // if(typeof(peerId) === 'string' && /^[uc]/.test(peerId)) return peerId as PeerId;\n // if(typeof(peerId) === 'number') return peerId;\n else if(isObject(peerId)) {\n const userId = (peerId as Peer.peerUser).user_id;\n if(userId !== undefined) {\n return userId.toPeerId(false);\n }\n\n const chatId = (peerId as Peer.peerChannel).channel_id || (peerId as Peer.peerChat).chat_id;\n if(chatId !== undefined) {\n return chatId.toPeerId(true);\n }\n\n return NULL_PEER_ID; // maybe it is an inputPeerSelf\n // } else if(!peerId) return 'u0';\n } else if(!peerId) return NULL_PEER_ID;\n\n const isUser = (peerId as string).charAt(0) === 'u';\n const peerParams = (peerId as string).substr(1).split('_');\n\n return isUser ? peerParams[0].toPeerId() : (peerParams[0] || '').toPeerId(true);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../../appDocsManager';\nimport type {MyPhoto} from '../../appPhotosManager';\nimport type {PhotoSize, VideoSize, WebDocument} from '../../../../layer';\nimport calcImageInBox from '../../../../helpers/calcImageInBox';\nimport {THUMB_TYPE_FULL} from '../../../mtproto/mtproto_config';\n\nexport default function choosePhotoSize(\n photo: MyPhoto | MyDocument | WebDocument,\n boxWidth = 0,\n boxHeight = 0,\n useBytes = false,\n pushDocumentSize = false\n) {\n if(window.devicePixelRatio > 1) {\n boxWidth *= 2;\n boxHeight *= 2;\n }\n\n /*\n s box 100x100\n m box 320x320\n x box 800x800\n y box 1280x1280\n w box 2560x2560\n a crop 160x160\n b crop 320x320\n c crop 640x640\n d crop 1280x1280 */\n\n let sizes: PhotoSize[] = (photo as MyPhoto).sizes || (photo as MyDocument).thumbs as PhotoSize[];\n let bestPhotoSize: typeof sizes[0] = {_: 'photoSizeEmpty', type: THUMB_TYPE_FULL};\n if(pushDocumentSize && sizes && photo._ !== 'photo') {\n sizes = sizes.concat({\n _: 'photoSize',\n w: photo.w,\n h: photo.h,\n size: photo.size,\n type: THUMB_TYPE_FULL\n });\n }\n\n if(sizes?.length) {\n for(let i = 0, length = sizes.length; i < length; ++i) {\n const photoSize = sizes[i];\n if(!('w' in photoSize) && !('h' in photoSize)) continue;\n\n bestPhotoSize = photoSize;\n\n const size = calcImageInBox(photoSize.w, photoSize.h, boxWidth, boxHeight);\n if(size.width >= boxWidth || size.height >= boxHeight) {\n break;\n }\n }\n\n if(useBytes && bestPhotoSize._ === 'photoSizeEmpty' && sizes[0]._ === 'photoStrippedSize') {\n bestPhotoSize = sizes[0];\n }\n }\n\n return bestPhotoSize;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport safeAssign from '../../helpers/object/safeAssign';\nimport {logger} from '../logger';\nimport createDataChannel from './helpers/createDataChannel';\nimport createPeerConnection from './helpers/createPeerConnection';\nimport LocalConferenceDescription from './localConferenceDescription';\nimport StreamManager from './streamManager';\nimport {Ssrc} from './types';\n\nexport type CallConnectionInstanceOptions = {\n streamManager: StreamManager,\n connection?: RTCPeerConnection,\n log?: ReturnType\n};\n\nexport default abstract class CallConnectionInstanceBase {\n public connection: RTCPeerConnection;\n public streamManager: StreamManager;\n public dataChannel: RTCDataChannel;\n public description: LocalConferenceDescription;\n public sources: {\n audio: Ssrc,\n video?: Ssrc,\n };\n protected negotiating: Promise;\n protected log: ReturnType;\n\n constructor(options: CallConnectionInstanceOptions) {\n safeAssign(this, options);\n\n if(!this.log) {\n this.log = this.connection?.log || logger('CALL-CONNECTION-BASE');\n }\n\n this.sources = {} as any;\n }\n\n public createPeerConnection(config?: RTCConfiguration) {\n return this.connection || (this.connection = createPeerConnection(config, this.log.bindPrefix('connection')).connection);\n }\n\n public createDataChannel(dict?: RTCDataChannelInit) {\n return this.dataChannel || (this.dataChannel = createDataChannel(this.connection, dict, this.log.bindPrefix('data')));\n }\n\n public createDescription() {\n return this.description || (this.description = new LocalConferenceDescription(this.connection));\n }\n\n public appendStreamToConference() {\n return this.streamManager.appendToConference(this.description);\n }\n\n public closeConnection() {\n const {connection} = this;\n if(!connection) {\n return;\n }\n\n try {\n connection.log('close');\n connection.close();\n } catch(e) {\n this.log.error(e);\n }\n }\n\n public closeConnectionAndStream(stopStream: boolean) {\n this.closeConnection();\n stopStream && this.streamManager.stop();\n }\n\n protected abstract negotiateInternal(): CallConnectionInstanceBase['negotiating'];\n\n public negotiate() {\n const promise = this.negotiating;\n if(promise) {\n return promise;\n }\n\n return this.negotiating = this.negotiateInternal().finally(() => {\n this.negotiating = undefined;\n });\n }\n\n public sendDataChannelData(data: any) {\n if(this.dataChannel.readyState !== 'open') {\n return;\n }\n\n this.dataChannel.send(JSON.stringify(data));\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Logger, logger} from '../../logger';\n\nexport default function createPeerConnection(config: RTCConfiguration, log?: Logger) {\n if(!log) {\n log = logger('RTCPeerConnection');\n }\n\n log('constructor');\n\n // @ts-ignore\n const connection = new RTCPeerConnection(config);\n connection.addEventListener('track', (event) => {\n log('ontrack', event);\n });\n connection.addEventListener('signalingstatechange', () => {\n log('onsignalingstatechange', connection.signalingState);\n });\n connection.addEventListener('connectionstatechange', () => {\n log('onconnectionstatechange', connection.connectionState);\n });\n connection.addEventListener('negotiationneeded', () => { // * will be fired every time input device changes\n log('onnegotiationneeded', connection.signalingState);\n });\n connection.addEventListener('icecandidate', (event) => {\n log('onicecandidate', event);\n });\n connection.addEventListener('iceconnectionstatechange', () => {\n log('oniceconnectionstatechange', connection.iceConnectionState);\n });\n connection.addEventListener('datachannel', () => {\n log('ondatachannel');\n });\n\n connection.log = log;\n\n return {connection};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Logger, logger} from '../../logger';\n\nexport default function createDataChannel(connection: RTCPeerConnection, dict?: RTCDataChannelInit, log?: Logger) {\n // return;\n\n if(!log) {\n log = logger('RTCDataChannel');\n }\n\n const channel = connection.createDataChannel('data', dict);\n\n channel.addEventListener('message', (e) => {\n log('onmessage', e);\n });\n channel.addEventListener('open', () => {\n log('onopen');\n });\n channel.addEventListener('close', () => {\n log('onclose');\n });\n\n channel.log = log;\n\n return channel;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport SDP from '../sdp';\nimport {CallSignalingData, P2PVideoCodec} from '../types';\nimport parseMediaSectionInfo from './parseMediaSectionInfo';\n\nexport default function parseSignalingData(sdp: SDP) {\n const info = parseMediaSectionInfo(sdp, sdp.media[0]);\n\n const data: CallSignalingData.initialSetup = {\n '@type': 'InitialSetup',\n 'fingerprints': [info.fingerprint],\n 'ufrag': info.ufrag,\n 'pwd': info.pwd,\n 'audio': undefined,\n 'video': undefined,\n 'screencast': undefined\n };\n\n const convertNumber = (number: number) => '' + number;\n\n for(const section of sdp.media) {\n const mediaType = section.mediaType;\n if(mediaType === 'application' || !section.isSending) {\n continue;\n }\n\n const codec: P2PVideoCodec = data[mediaType === 'video' && data['video'] ? 'screencast' : mediaType] = {} as any;\n const info = parseMediaSectionInfo(sdp, section);\n codec.ssrc = convertNumber(info.source);\n\n if(info.sourceGroups) {\n codec.ssrcGroups = info.sourceGroups.map((sourceGroup) => ({semantics: sourceGroup.semantics, ssrcs: sourceGroup.sources.map(convertNumber)}));\n }\n\n const rtpExtensions: P2PVideoCodec['rtpExtensions'] = codec.rtpExtensions = [];\n section.attributes.get('extmap').forEach((attribute) => {\n rtpExtensions.push({\n id: +attribute.key,\n uri: attribute.value\n });\n });\n\n const payloadTypesMap: Map = new Map();\n\n const getPayloadType = (id: number) => {\n let payloadType = payloadTypesMap.get(id);\n if(!payloadType) {\n payloadTypesMap.set(id, payloadType = {\n id\n } as any);\n }\n\n return payloadType;\n };\n\n section.attributes.get('rtpmap').forEach((attribute) => {\n const id = +attribute.key;\n const payloadType = getPayloadType(id);\n const splitted = attribute.value.split('/');\n const [name, clockrate, channels] = splitted;\n payloadType.name = name;\n payloadType.clockrate = +clockrate;\n payloadType.channels = channels ? +channels : 0;\n });\n\n section.attributes.get('rtcp-fb').forEach((attribute) => {\n const id = +attribute.key;\n const payloadType = getPayloadType(id);\n payloadType.feedbackTypes = attribute.lines.map((line) => {\n const splitted = line.split(' ');\n const [type, subtype] = splitted;\n return {\n type,\n subtype: subtype || ''\n };\n });\n });\n\n section.attributes.get('fmtp').forEach((attribute) => {\n const id = +attribute.key;\n const payloadType = getPayloadType(id);\n const parameters: P2PVideoCodec['payloadTypes'][0]['parameters'] = payloadType.parameters = {};\n const splitted = attribute.value.split(';');\n for(const str of splitted) {\n const [key, value] = str.split('=');\n parameters[key] = value;\n }\n });\n\n codec.payloadTypes = Array.from(payloadTypesMap.values());\n\n /* if(codec.payloadTypes.length > 5) {\n codec.payloadTypes.length = Math.min(codec.payloadTypes.length, 5);\n } */\n }\n\n return data;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport CallConnectionInstanceBase, {CallConnectionInstanceOptions} from './callConnectionInstanceBase';\nimport CallInstance from './callInstance';\nimport parseSignalingData from './helpers/parseSignalingData';\nimport {parseSdp} from './sdp/utils';\n\nexport default class CallConnectionInstance extends CallConnectionInstanceBase {\n private call: CallInstance;\n\n constructor(options: CallConnectionInstanceOptions & {\n call: CallConnectionInstance['call']\n }) {\n super(options);\n }\n\n protected async negotiateInternal() {\n const {connection, call} = this;\n\n if(!connection.localDescription && !connection.remoteDescription && !call.isOutgoing) {\n return;\n }\n\n let descriptionInit: RTCSessionDescriptionInit;\n if(call.offerReceived) {\n call.offerReceived = false;\n\n const answer = descriptionInit = await connection.createAnswer();\n\n this.log('[sdp] local', answer.type, answer.sdp);\n await connection.setLocalDescription(answer);\n\n this.log('[InitialSetup] send 2');\n } else {\n const offer = descriptionInit = await connection.createOffer();\n\n this.log('[sdp] local', offer.sdp);\n await connection.setLocalDescription(offer);\n\n call.offerSent = true;\n\n this.log('[InitialSetup] send 0');\n }\n\n const initialSetup = parseSignalingData(parseSdp(descriptionInit.sdp));\n call.sendCallSignalingData(initialSetup);\n }\n}\n","const subtle = typeof(window) !== 'undefined' && 'crypto' in window ? window.crypto.subtle : self.crypto.subtle;\n\nexport default subtle;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport bufferConcats from '../../../helpers/bytes/bufferConcats';\nimport subtle from '../../crypto/subtle';\nimport sha256 from '../../crypto/utils/sha256';\n\nconst kMaxIncomingPacketSize = 128 * 1024 * 1024;\n\nexport default class P2PEncryptor {\n private type: 'Signaling';\n private counter: number;\n private seqMap: Map;\n\n constructor(private isOutgoing: boolean, private p2pKey: Uint8Array) {\n this.type = 'Signaling';\n this.counter = 0;\n this.seqMap = new Map();\n }\n\n private concatSHA256(parts: Uint8Array[]) {\n return sha256(bufferConcats(...parts));\n }\n\n private async encryptPrepared(buffer: Uint8Array) {\n const result = {\n counter: 0, // this.counterFromSeq(this.readSeq(buffer)),\n bytes: new Uint8Array(16 + buffer.length)\n };\n\n const x = (this.isOutgoing ? 0 : 8) + (this.type === 'Signaling' ? 128 : 0);\n const key = this.p2pKey;\n\n const msgKeyLarge = await this.concatSHA256([key.subarray(x + 88, x + 88 + 32), buffer]);\n const msgKey = result.bytes;\n for(let i = 0; i < 16; ++i) {\n msgKey[i] = msgKeyLarge[i + 8];\n }\n\n const aesKeyIv = await this.prepareAesKeyIv(key, msgKey, x);\n\n const bytes = await this.aesProcessCtr(buffer, buffer.length, aesKeyIv, true);\n\n result.bytes = new Uint8Array([...result.bytes.subarray(0, 16), ...bytes]);\n\n return result;\n }\n\n public encryptRawPacket(buffer: Uint8Array) {\n const seq = ++this.counter;\n const arr = new ArrayBuffer(4);\n const view = new DataView(arr);\n view.setUint32(0, seq >>> 0, false); // byteOffset = 0; litteEndian = false\n\n const result = new Uint8Array([...new Uint8Array(arr), ...buffer]);\n\n return this.encryptPrepared(result);\n }\n\n private async prepareAesKeyIv(key: Uint8Array, msgKey: Uint8Array, x: number) {\n const [sha256a, sha256b] = await Promise.all([\n this.concatSHA256([\n msgKey.subarray(0, 16),\n key.subarray(x, x + 36)\n ]),\n\n this.concatSHA256([\n key.subarray(40 + x, 40 + x + 36),\n msgKey.subarray(0, 16)\n ])\n ]);\n\n return {\n key: new Uint8Array([\n ...sha256a.subarray(0, 8),\n ...sha256b.subarray(8, 8 + 16),\n ...sha256a.subarray(24, 24 + 8)\n ]),\n iv: new Uint8Array([\n ...sha256b.subarray(0, 4),\n ...sha256a.subarray(8, 8 + 8),\n ...sha256b.subarray(24, 24 + 4)\n ])\n };\n }\n\n private async aesProcessCtr(encryptedData: Uint8Array, dataSize: number, aesKeyIv: {key: Uint8Array, iv: Uint8Array}, encrypt = true) {\n const cryptoKey = await subtle.importKey(\n 'raw',\n aesKeyIv.key,\n {name: 'AES-CTR'},\n false,\n [encrypt ? 'encrypt' : 'decrypt']\n );\n\n const buffer: ArrayBuffer = await subtle[encrypt ? 'encrypt' : 'decrypt']({\n name: 'AES-CTR',\n counter: aesKeyIv.iv,\n length: aesKeyIv.iv.length * 8\n },\n cryptoKey,\n encryptedData\n );\n\n return new Uint8Array(buffer);\n }\n\n private constTimeIsDifferent(a: Uint8Array, b: Uint8Array, count: number) {\n let msgKeyEquals = true;\n for(let i = 0; i < count; ++i) {\n if(a[i] !== b[i]) {\n msgKeyEquals = false;\n }\n }\n\n return !msgKeyEquals;\n }\n\n public async decryptRawPacket(buffer: Uint8Array) {\n if(buffer.length < 21 || buffer.length > kMaxIncomingPacketSize) {\n return;\n }\n\n const {isOutgoing, type} = this;\n\n const x = (isOutgoing ? 8 : 0) + (type === 'Signaling' ? 128 : 0);\n const key = this.p2pKey;\n\n const msgKey = buffer.subarray(0, 16);\n const encryptedData = buffer.subarray(16);\n const encryptedDataSize = buffer.length - 16;\n\n const aesKeyIv = await this.prepareAesKeyIv(key, msgKey, x);\n\n const decryptionBuffer = await this.aesProcessCtr(encryptedData, encryptedDataSize, aesKeyIv, false);\n\n const msgKeyLarge = await this.concatSHA256([\n key.subarray(88 + x, 88 + x + 32),\n decryptionBuffer\n ]);\n\n if(this.constTimeIsDifferent(msgKeyLarge.subarray(8), msgKey, 16)) {\n return;\n }\n\n const dataView = new DataView(decryptionBuffer.buffer);\n const seq = dataView.getUint32(0);\n if(this.seqMap.has(seq)) {\n return;\n }\n this.seqMap.set(seq, seq);\n\n return decryptionBuffer.slice(4);\n }\n}\n","import convertToUint8Array from '../../../helpers/bytes/convertToUint8Array';\nimport subtle from '../subtle';\n// import sha256 from '@cryptography/sha256';\n\nexport default function sha256(bytes: Parameters[0]) {\n return subtle.digest('SHA-256', convertToUint8Array(bytes)).then((b) => {\n // console.log('legacy', performance.now() - perfS);\n return new Uint8Array(b);\n });\n /* //console.log('SHA-256 hash start');\n\n let perfS = performance.now();\n\n\n let perfD = performance.now();\n let words = typeof(bytes) === 'string' ? bytes : bytesToWordss(bytes as any);\n let hash = sha256(words);\n console.log('darutkin', performance.now() - perfD);\n\n //console.log('SHA-256 hash finish', hash, sha256(words, 'hex'));\n\n return bytesFromWordss(hash); */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport StringFromLineBuilder from '../stringFromLineBuilder';\nimport {addDataChannel, addExtmap, addPayloadTypes, addSsrc} from './p2PSdpBuilder';\n\nexport default class ChromeP2PSdpBuilder {\n static generateOffer(info: any) {\n const {fingerprints, ufrag, pwd, audio, video} = info;\n audio.type = 'audio';\n video.type = 'video';\n const media = [audio, video];\n\n const stringBuilder = new StringFromLineBuilder();\n stringBuilder.add(\n 'v=0',\n 'o=- 1 2 IN IP4 127.0.0.1',\n 's=-',\n 't=0 0'\n );\n\n if(fingerprints) {\n fingerprints.forEach((x: any) => {\n const {hash, fingerprint, setup} = x;\n stringBuilder.add(\n `a=fingerprint:${hash} ${fingerprint}`,\n `a=setup:${setup}`\n );\n });\n }\n if(ufrag && pwd) {\n stringBuilder.add(\n `a=ice-ufrag:${ufrag}`,\n `a=ice-pwd:${pwd}`\n );\n }\n\n stringBuilder.add(\n 'a=group:BUNDLE 0 1 2',\n 'a=extmap-allow-mixed',\n 'a=msid-semantic: WMS *'\n );\n const streamName = 'stream' + media.map((x) => x.ssrc).join('_');\n for(let i = 0; i < media.length; i++) {\n const m = media[i];\n const {type, ssrc, ssrcGroups, payloadTypes, rtpExtensions} = m;\n switch(type) {\n case 'audio': {\n stringBuilder.add(\n `m=audio 56930 UDP/TLS/RTP/SAVPF ${payloadTypes.map((x: any) => x.id).join(' ')}`,\n 'c=IN IP4 0.0.0.0',\n 'a=rtcp:9 IN IP4 0.0.0.0',\n 'a=ice-options:trickle',\n `a=mid:${i}`,\n 'a=sendrecv',\n addExtmap(rtpExtensions)\n );\n if(ssrc) {\n stringBuilder.add(`a=msid:${streamName} audio${ssrc}`);\n }\n stringBuilder.add(\n 'a=rtcp-mux',\n addPayloadTypes(payloadTypes),\n addSsrc(type, ssrc, ssrcGroups, streamName)\n );\n\n break;\n }\n\n case 'video': {\n stringBuilder.add(\n `m=video 61986 UDP/TLS/RTP/SAVPF ${payloadTypes.map((x: any) => x.id).join(' ')}`,\n 'c=IN IP4 0.0.0.0',\n 'a=rtcp:9 IN IP4 0.0.0.0',\n 'a=ice-options:trickle',\n `a=mid:${i}`,\n 'a=sendrecv',\n addExtmap(rtpExtensions)\n );\n if(ssrc) {\n stringBuilder.add(`a=msid:${streamName} video${ssrc}`);\n }\n stringBuilder.add(\n 'a=rtcp-mux',\n 'a=rtcp-rsize',\n addPayloadTypes(payloadTypes),\n addSsrc(type, ssrc, ssrcGroups, streamName)\n );\n break;\n }\n }\n }\n stringBuilder.add(addDataChannel(2));\n return stringBuilder.finalize();\n }\n\n static generateAnswer(info: any) {\n const {fingerprints, ufrag, pwd, audio, video} = info;\n audio.type = 'audio';\n video.type = 'video';\n const media = [audio, video];\n\n const stringBuilder = new StringFromLineBuilder();\n stringBuilder.add(\n 'v=0',\n 'o=- 1 2 IN IP4 127.0.0.1',\n 's=-',\n 't=0 0'\n );\n\n if(fingerprints) {\n fingerprints.forEach((x: any) => {\n const {hash, fingerprint, setup} = x;\n stringBuilder.add(\n `a=fingerprint:${hash} ${fingerprint}`,\n `a=setup:${setup}`\n );\n });\n }\n if(ufrag && pwd) {\n stringBuilder.add(\n `a=ice-ufrag:${ufrag}`,\n `a=ice-pwd:${pwd}`\n );\n }\n\n stringBuilder.add(\n 'a=group:BUNDLE 0 1 2',\n 'a=extmap-allow-mixed',\n 'a=msid-semantic: WMS *'\n );\n const streamName = 'stream' + media.map((x) => x.ssrc).join('_');\n for(let i = 0; i < media.length; i++) {\n const m = media[i];\n const {type, ssrc, ssrcGroups, payloadTypes, rtpExtensions} = m;\n switch(type) {\n case 'audio': {\n stringBuilder.add(\n `m=audio 56930 UDP/TLS/RTP/SAVPF ${payloadTypes.map((x: any) => x.id).join(' ')}`,\n 'c=IN IP4 0.0.0.0',\n 'a=rtcp:9 IN IP4 0.0.0.0',\n 'a=ice-options:trickle',\n `a=mid:${i}`,\n 'a=sendrecv',\n addExtmap(rtpExtensions)\n );\n if(ssrc) {\n stringBuilder.add(`a=msid:${streamName} audio${ssrc}`);\n }\n stringBuilder.add(\n 'a=rtcp-mux',\n addPayloadTypes(payloadTypes),\n addSsrc(type, ssrc, ssrcGroups, streamName)\n );\n break;\n }\n\n case 'video': {\n stringBuilder.add(\n `m=video 61986 UDP/TLS/RTP/SAVPF ${payloadTypes.map((x: any) => x.id).join(' ')}`,\n 'c=IN IP4 0.0.0.0',\n 'a=rtcp:9 IN IP4 0.0.0.0',\n 'a=ice-options:trickle',\n `a=mid:${i}`,\n 'a=sendrecv',\n addExtmap(rtpExtensions)\n );\n if(ssrc) {\n stringBuilder.add(`a=msid:${streamName} video${ssrc}`);\n }\n\n stringBuilder.add(\n 'a=rtcp-mux',\n 'a=rtcp-rsize',\n addPayloadTypes(payloadTypes),\n addSsrc(type, ssrc, ssrcGroups, streamName)\n );\n break;\n }\n }\n }\n stringBuilder.add(addDataChannel(2));\n return stringBuilder.finalize();\n }\n}\n","/*\n* Copyright (c) 2018-present, Evgeny Nadymov\n*\n* This source code is licensed under the GPL v.3.0 license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport ChromeP2PSdpBuilder from './chromeP2PSdpBuilder';\nimport { FirefoxP2PSdpBuilder } from './firefoxP2PSdpBuilder';\nimport { SafariP2PSdpBuilder } from './safariP2PSdpBuilder';\n// import { TG_CALLS_SDP_STRING } from '../../Stores/CallStore';\n\nexport function p2pParseCandidate(candidate) {\n if(!candidate || !candidate.startsWith('candidate:')) {\n return;\n }\n \n const sdpString = candidate;\n candidate = candidate.substr('candidate:'.length);\n \n const [foundation, component, protocol, priority, ip, port, ...other] = candidate.split(' ');\n const c = {\n sdpString,\n foundation,\n component,\n protocol,\n priority,\n address: { ip, port }\n };\n \n for(let i = 0; i < other.length; i += 2) {\n switch(other[i]) {\n case 'typ': {\n c.type = other[i + 1];\n break;\n }\n case 'raddr': {\n if(!c.relAddress) {\n c.relAddress = {};\n }\n \n c.relAddress.ip = other[i + 1];\n break;\n }\n case 'rport': {\n if(!c.relAddress) {\n c.relAddress = {};\n }\n \n c.relAddress.port = other[i + 1];\n break;\n }\n case 'generation': {\n c.generation = other[i + 1];\n break;\n }\n case 'tcptype': {\n c.tcpType = other[i + 1];\n break;\n }\n case 'network-id': {\n c.networkId = other[i + 1];\n break;\n }\n case 'network-cost': {\n c.networkCost = other[i + 1];\n break;\n }\n case 'ufrag': {\n c.username = other[i + 1];\n break;\n }\n }\n }\n \n return c;\n}\n\nexport function p2pParseSdp(sdp) {\n const lines = sdp.split('\\r\\n');\n const lookup = (prefix, force = true, lineFrom = 0, lineTo = Number.MAX_VALUE) => {\n if (lineTo === -1) {\n lineTo = Number.MAX_VALUE;\n }\n for (let i = lineFrom; i < lines.length && i < lineTo; i++) {\n const line = lines[i];\n if (line.startsWith(prefix)) {\n return line.substr(prefix.length);\n }\n }\n \n if (force) {\n console.error(\"Can't find prefix\", prefix);\n }\n \n return null;\n };\n const findIndex = (prefix, lineFrom = 0, lineTo = Number.MAX_VALUE) => {\n if (lineTo === -1) {\n lineTo = Number.MAX_VALUE;\n }\n for (let i = lineFrom; i < lines.length && i < lineTo; i++) {\n const line = lines[i];\n if (line.startsWith(prefix)) {\n return i;\n }\n }\n \n return -1;\n };\n \n const pwdIndex = findIndex('a=ice-pwd:');\n const ufragIndex = findIndex('a=ice-ufrag:');\n if (pwdIndex === -1 && ufragIndex === -1) {\n return {\n // sessionId: lookup('o=').split(' ')[1],\n ufrag: null,\n pwd: null,\n fingerprints: []\n };\n }\n \n const info = {\n // sessionId: lookup('o=').split(' ')[1],\n ufrag: null,\n pwd: null,\n fingerprints: []\n };\n \n let mediaIndex = findIndex('m=');\n const fingerprint = lookup('a=fingerprint:', false);\n const setup = lookup('a=setup:', false);\n if (fingerprint && setup) {\n info.fingerprints.push({\n hash: fingerprint.split(' ')[0],\n fingerprint: fingerprint.split(' ')[1],\n setup\n });\n }\n \n const ufrag = lookup('a=ice-ufrag:', false);\n const pwd = lookup('a=ice-pwd:', false);\n if (ufrag && pwd) {\n info.ufrag = ufrag;\n info.pwd = pwd;\n }\n \n while (mediaIndex !== -1) {\n let nextMediaIndex = findIndex('m=', mediaIndex + 1);\n \n const extmap = [];\n const types = [];\n const mediaType = lookup('m=', true, mediaIndex, nextMediaIndex).split(' ')[0];\n const media = {\n // type: lookup('m=', true, mediaIndex, nextMediaIndex).split(' ')[0],\n // mid: lookup('a=mid:', true, mediaIndex, nextMediaIndex),\n // dir: findDirection(mediaIndex, nextMediaIndex),\n rtpExtensions: extmap,\n payloadTypes: types\n }\n \n const lineTo = nextMediaIndex === -1 ? lines.length : nextMediaIndex;\n const fmtp = new Map();\n const rtcpFb = new Map();\n for (let i = mediaIndex; i < lineTo; i++) {\n const line = lines[i];\n if (line.startsWith('a=extmap:')) {\n const [ id, uri ] = line.substr('a=extmap:'.length).split(' ');\n extmap.push({ id: parseInt(id), uri });\n } else if (line.startsWith('a=fmtp:')) {\n const [ id, str ] = line.substr('a=fmtp:'.length).split(' ');\n const obj = { };\n const arr = str.split(';').map(x => {\n const [ key, value ] = x.split('=');\n obj[key] = value;\n return { [key]: value };\n });\n fmtp.set(parseInt(id), obj);\n } else if (line.startsWith('a=rtcp-fb:')) {\n const [ id, type = '', subtype = '' ] = line.substr('a=rtcp-fb:'.length).split(' ');\n if (rtcpFb.has(parseInt(id))) {\n rtcpFb.get(parseInt(id)).push({ type, subtype });\n } else {\n rtcpFb.set(parseInt(id), [{ type, subtype }])\n }\n } else if (line.startsWith('a=rtpmap')) {\n const [ id, str ] = line.substr('a=rtpmap:'.length).split(' ');\n const [ name, clockrate, channels = '0' ] = str.split('/');\n const obj = { id: parseInt(id), name, clockrate: parseInt(clockrate), channels: parseInt(channels) };\n \n types.push(obj);\n }\n }\n \n for (let i = 0; i < types.length; i++) {\n const { id } = types[i];\n if (rtcpFb.has(id)) {\n types[i].feedbackTypes = rtcpFb.get(id);\n }\n if (fmtp.has(id)) {\n types[i].parameters = fmtp.get(id);\n }\n }\n \n const ssrc = lookup('a=ssrc:', false, mediaIndex, nextMediaIndex);\n if (ssrc) {\n media.ssrc = ssrc.split(' ')[0];\n }\n \n const ssrcGroup = lookup('a=ssrc-group:', false, mediaIndex, nextMediaIndex);\n if (ssrcGroup) {\n const [ semantics, ...ssrcs ] = ssrcGroup.split(' ');\n media.ssrcGroups = [{\n semantics,\n ssrcs\n }]\n }\n \n switch (mediaType) {\n case 'audio': {\n info.audio = media;\n break;\n }\n case 'video': {\n info.video = media;\n break;\n }\n }\n \n mediaIndex = nextMediaIndex;\n }\n\n if(!info.video.ssrcGroups) {\n info.video.ssrcGroups = [];\n }\n\n info['@type'] = 'InitialSetup';\n \n // console.log('[p2pParseSdp]', sdp, info);\n return info;\n}\n\nexport function isFirefox() {\n return navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n}\n\nfunction isSafari() {\n return navigator.userAgent.toLowerCase().indexOf('safari') > -1 && navigator.userAgent.toLowerCase().indexOf('chrome') === -1;\n}\n\nexport function addExtmap(extmap) {\n let sdp = [];\n // return sdp;\n for (let j = 0; j < extmap.length; j++) {\n const ext = extmap[j];\n const { id, uri } = ext;\n // if (isFirefox() && uri.indexOf(''))\n console.log('[extmap] add', id, uri);\n sdp.push(`a=extmap:${id} ${uri}`);\n }\n \n return sdp.join('\\n');\n}\n\nexport function addPayloadTypes(types) {\n let sdp = [];\n console.log('[SDP] addPayloadTypes', types);\n for (let i = 0; i < types.length; i++) {\n const type = types[i];\n const { id, name, clockrate, channels, feedbackTypes, parameters } = type;\n sdp.push(`a=rtpmap:${id} ${name}/${clockrate}${channels ? '/' + channels : ''}`);\n if (feedbackTypes) {\n feedbackTypes.forEach(x => {\n const { type, subtype } = x;\n sdp.push(`a=rtcp-fb:${id} ${[type, subtype].join(' ')}`);\n });\n }\n if (parameters) {\n const fmtp = [];\n Object.getOwnPropertyNames(parameters).forEach(pName => {\n fmtp.push(`${pName}=${parameters[pName]}`);\n });\n \n sdp.push(`a=fmtp:${id} ${fmtp.join(';')}`);\n }\n }\n \n return sdp.join('\\n');\n}\n\nexport function addSsrc(type, ssrc, ssrcGroups, streamName) {\n let sdp = [];\n \n if (ssrcGroups && ssrcGroups.length > 0) {\n ssrcGroups.forEach(ssrcGroup => {\n if (ssrcGroup && ssrcGroup.ssrcs.length > 0) {\n sdp.push(`a=ssrc-group:${ssrcGroup.semantics} ${ssrcGroup.ssrcs.join(' ')}`);\n ssrcGroup.ssrcs.forEach(ssrc => {\n sdp.push(\n `a=ssrc:${ssrc} cname:stream${ssrc}`,\n `a=ssrc:${ssrc} msid:${streamName} ${type}${ssrc}`,\n `a=ssrc:${ssrc} mslabel:${type}${ssrc}`,\n `a=ssrc:${ssrc} label:${type}${ssrc}`\n );\n });\n }\n });\n } else if (ssrc) {\n sdp.push(\n `a=ssrc:${ssrc} cname:stream${ssrc}`,\n `a=ssrc:${ssrc} msid:${streamName} ${type}${ssrc}`,\n `a=ssrc:${ssrc} mslabel:${type}${ssrc}`,\n `a=ssrc:${ssrc} label:${type}${ssrc}`\n );\n }\n \n return sdp.join('\\n');\n}\n\nexport function addDataChannel(mid) {\n return `m=application 9 UDP/DTLS/SCTP webrtc-datachannel\nc=IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:2\na=sctp-port:5000\na=max-message-size:262144`;\n}\n\nexport class P2PSdpBuilder {\n static generateCandidate(info) {\n if (!info) return null;\n \n const { sdpString, sdpMLineIndex, sdpMid, foundation, component, protocol, priority, address, type, relAddress, generation, tcpType, networkId, networkCost, username } = info;\n if (/* TG_CALLS_SDP_STRING */true) {\n if (sdpString) {\n return {\n candidate: sdpString,\n sdpMLineIndex,\n sdpMid\n };\n }\n }\n throw 'no sdpString';\n \n let candidate = `candidate:${foundation} ${component} ${protocol} ${priority} ${address.ip} ${address.port}`;\n const attrs = []\n if (type) {\n attrs.push(`typ ${type}`);\n }\n if (relAddress) {\n attrs.push(`raddr ${relAddress.ip}`);\n attrs.push(`rport ${relAddress.port}`);\n }\n if (tcpType) {\n attrs.push(`tcptype ${tcpType}`);\n }\n if (generation) {\n attrs.push(`generation ${generation}`);\n }\n if (username) {\n attrs.push(`ufrag ${username}`);\n }\n if (networkId) {\n attrs.push(`network-id ${networkId}`);\n }\n if (networkCost) {\n attrs.push(`network-cost ${networkCost}`);\n }\n if (attrs.length > 0) {\n candidate += ` ${attrs.join(' ')}`;\n }\n \n return { candidate, sdpMid, sdpMLineIndex };\n }\n \n static generateOffer(info) {\n if (isFirefox()) {\n return FirefoxP2PSdpBuilder.generateOffer(info);\n } else if (isSafari()) {\n return SafariP2PSdpBuilder.generateOffer(info);\n }\n \n return ChromeP2PSdpBuilder.generateOffer(info);\n }\n \n static generateAnswer(info) {\n if (isFirefox()) {\n return FirefoxP2PSdpBuilder.generateAnswer(info);\n } else if (isSafari()) {\n return SafariP2PSdpBuilder.generateAnswer(info);\n }\n \n return ChromeP2PSdpBuilder.generateAnswer(info);\n }\n}","/*\n * Copyright (c) 2018-present, Evgeny Nadymov\n *\n * This source code is licensed under the GPL v.3.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { addDataChannel, addExtmap, addPayloadTypes, addSsrc } from './p2PSdpBuilder';\n\nexport class FirefoxP2PSdpBuilder {\n static generateOffer(info) {\n const { fingerprints, ufrag, pwd, audio, video } = info;\n audio.type = 'audio';\n video.type = 'video';\n const media = [audio, video];\n\n let sdp = `v=0\no=- 1 0 IN IP4 0.0.0.0\ns=-\nt=0 0`;\n if (fingerprints) {\n fingerprints.forEach(x => {\n const { hash, fingerprint, setup } = x;\n sdp += `\na=fingerprint:${hash} ${fingerprint}\na=setup:${setup}`;\n });\n }\n if (ufrag && pwd) {\n sdp += `\na=ice-ufrag:${ufrag}\na=ice-pwd:${pwd}`;\n }\n\n sdp += `\na=group:BUNDLE 0 1 2\na=ice-options:trickle\na=msid-semantic:WMS *`;\n const streamName = 'stream' + media.map(x => x.ssrc).join('_');\n for (let i = 0; i < media.length; i++) {\n const m = media[i];\n const { type, ssrc, ssrcGroups, payloadTypes, rtpExtensions } = m;\n switch (type) {\n case 'audio': {\n sdp += `\nm=audio 9 UDP/TLS/RTP/SAVPF ${payloadTypes.map(x => x.id).join(' ')}\nc=IN IP4 0.0.0.0\na=mid:${i}\na=sendrecv`;\n sdp += addExtmap(rtpExtensions);\n sdp += `\na=rtcp-mux`;\n sdp += addPayloadTypes(payloadTypes);\n sdp += addSsrc(type, ssrc, ssrcGroups, streamName);\n\n break;\n }\n case 'video': {\n sdp += `\nm=video 9 UDP/TLS/RTP/SAVPF ${payloadTypes.map(x => x.id).join(' ')}\nc=IN IP4 0.0.0.0\na=mid:${i}\na=sendrecv`;\n sdp += addExtmap(rtpExtensions);\n sdp += `\na=rtcp-mux\na=rtcp-rsize`;\n sdp += addPayloadTypes(payloadTypes);\n sdp += addSsrc(type, ssrc, ssrcGroups, streamName);\n\n break;\n }\n }\n }\n sdp += addDataChannel(2);\n sdp += `\n`;\n\n return sdp;\n }\n\n static generateAnswer(info) {\n const { fingerprints, ufrag, pwd, audio, video } = info;\n audio.type = 'audio';\n video.type = 'video';\n const media = [audio, video];\n\n let sdp = `v=0\no=- 1 0 IN IP4 0.0.0.0\ns=-\nt=0 0`;\n if (fingerprints) {\n fingerprints.forEach(x => {\n const { hash, fingerprint, setup } = x;\n sdp += `\na=fingerprint:${hash} ${fingerprint}\na=setup:${setup}`;\n });\n }\n if (ufrag && pwd) {\n sdp += `\na=ice-ufrag:${ufrag}\na=ice-pwd:${pwd}`;\n }\n\n sdp += `\na=group:BUNDLE 0 1 2\na=ice-options:trickle\na=msid-semantic:WMS *`;\n const streamName = 'stream' + media.map(x => x.ssrc).join('_');\n for (let i = 0; i < media.length; i++) {\n const m = media[i];\n const { type, mid, ssrc, ssrcGroups, payloadTypes, dir, rtpExtensions } = m;\n switch (type) {\n case 'audio': {\n sdp += `\nm=audio 9 UDP/TLS/RTP/SAVPF ${payloadTypes.map(x => x.id).join(' ')}\nc=IN IP4 0.0.0.0\na=mid:${i}\na=sendrecv`;\n sdp += addExtmap(rtpExtensions);\n sdp += `\na=rtcp-mux`;\n sdp += addPayloadTypes(payloadTypes);\n sdp += addSsrc(type, ssrc, ssrcGroups, streamName);\n\n break;\n }\n case 'video': {\n sdp += `\nm=video 9 UDP/TLS/RTP/SAVPF ${payloadTypes.map(x => x.id).join(' ')}\nc=IN IP4 0.0.0.0\na=mid:${i}\na=sendrecv`;\n sdp += addExtmap(rtpExtensions);\n sdp += `\na=rtcp-mux\na=rtcp-rsize`;\n sdp += addPayloadTypes(payloadTypes);\n sdp += addSsrc(type, ssrc, ssrcGroups, streamName);\n break;\n }\n }\n }\n sdp += addDataChannel(2);\n sdp += `\n`;\n\n return sdp;\n }\n}","/*\n * Copyright (c) 2018-present, Evgeny Nadymov\n *\n * This source code is licensed under the GPL v.3.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { addDataChannel, addExtmap, addPayloadTypes, addSsrc } from './p2PSdpBuilder';\n\nexport class SafariP2PSdpBuilder {\n static generateOffer(info) {\n const { fingerprints, ufrag, pwd, audio, video } = info;\n audio.type = 'audio';\n video.type = 'video';\n const media = [audio, video];\n\n if (!media.length) {\n return `v=0\no=- 1 2 IN IP4 127.0.0.1\ns=-\nt=0 0\na=msid-semantic: WMS\n`;\n }\n\n let sdp = `v=0\no=- 1 2 IN IP4 127.0.0.1\ns=-\nt=0 0`;\n if (fingerprints) {\n fingerprints.forEach(x => {\n const { hash, fingerprint, setup } = x;\n sdp += `\na=fingerprint:${hash} ${fingerprint}\na=setup:${setup}`;\n });\n }\n if (ufrag && pwd) {\n sdp += `\na=ice-ufrag:${ufrag}\na=ice-pwd:${pwd}`;\n }\n\n sdp += `\na=group:BUNDLE 0 1 2\na=extmap-allow-mixed\na=msid-semantic: WMS *`;\n const streamName = 'stream' + media.map(x => x.ssrc).join('_');\n for (let i = 0; i < media.length; i++) {\n const m = media[i];\n const { type, ssrc, ssrcGroups, payloadTypes, rtpExtensions } = m;\n switch (type) {\n case 'audio': {\n sdp += `\nm=audio 9 UDP/TLS/RTP/SAVPF ${payloadTypes.map(x => x.id).join(' ')}\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:${i}\na=sendrecv`;\n sdp += addExtmap(rtpExtensions);\n if (ssrc) {\n sdp += `\na=msid:${streamName} audio${ssrc}`;\n }\n sdp += `\na=rtcp-mux`;\n sdp += addPayloadTypes(payloadTypes);\n sdp += addSsrc(type, ssrc, ssrcGroups, streamName);\n\n break;\n }\n case 'video': {\n sdp += `\nm=video 9 UDP/TLS/RTP/SAVPF ${payloadTypes.map(x => x.id).join(' ')}\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:${i}\na=sendrecv`;\n sdp += addExtmap(rtpExtensions);\n if (ssrc) {\n sdp += `\na=msid:${streamName} video${ssrc}`;\n }\n sdp += `\na=rtcp-mux\na=rtcp-rsize`;\n sdp += addPayloadTypes(payloadTypes);\n sdp += addSsrc(type, ssrc, ssrcGroups, streamName);\n break;\n }\n }\n }\n sdp += addDataChannel(2);\n sdp += `\n`;\n\n return sdp;\n }\n\n static generateAnswer(info) {\n const { fingerprints, ufrag, pwd, audio, video } = info;\n audio.type = 'audio';\n video.type = 'video';\n const media = [audio, video];\n\n if (!media.length) {\n return `v=0\no=- 1 2 IN IP4 127.0.0.1\ns=-\nt=0 0\na=msid-semantic: WMS\n`;\n }\n\n let sdp = `v=0\no=- 1 2 IN IP4 127.0.0.1\ns=-\nt=0 0`;\n if (fingerprints) {\n fingerprints.forEach(x => {\n const { hash, fingerprint, setup } = x;\n sdp += `\na=fingerprint:${hash} ${fingerprint}\na=setup:${setup}`;\n });\n }\n if (ufrag && pwd) {\n sdp += `\na=ice-ufrag:${ufrag}\na=ice-pwd:${pwd}`;\n }\n\n sdp += `\na=group:BUNDLE 0 1 2\na=extmap-allow-mixed\na=msid-semantic: WMS *`;\n const streamName = 'stream' + media.map(x => x.ssrc).join('_');\n for (let i = 0; i < media.length; i++) {\n const m = media[i];\n const { type, ssrc, ssrcGroups, payloadTypes, rtpExtensions } = m;\n switch (type) {\n case 'audio': {\n sdp += `\nm=audio 9 UDP/TLS/RTP/SAVPF ${payloadTypes.map(x => x.id).join(' ')}\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:${i}\na=sendrecv`;\n sdp += addExtmap(rtpExtensions);\n if (ssrc) {\n sdp += `\na=msid:${streamName} audio${ssrc}`;\n }\n sdp += `\na=rtcp-mux`;\n sdp += addPayloadTypes(payloadTypes);\n sdp += addSsrc(type, ssrc, ssrcGroups, streamName);\n\n break;\n }\n case 'video': {\n sdp += `\nm=video 9 UDP/TLS/RTP/SAVPF ${payloadTypes.map(x => x.id).join(' ')}\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:${i}\na=sendrecv`;\n sdp += addExtmap(rtpExtensions);\n if (ssrc) {\n sdp += `\na=msid:${streamName} video${ssrc}`;\n }\n sdp += `\na=rtcp-mux\na=rtcp-rsize`;\n sdp += addPayloadTypes(payloadTypes);\n sdp += addSsrc(type, ssrc, ssrcGroups, streamName);\n break;\n }\n }\n }\n sdp += addDataChannel(2);\n sdp += `\n`;\n\n return sdp;\n }\n}","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ctx from '../../environment/ctx';\nimport {IS_SAFARI} from '../../environment/userAgent';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport debounce from '../../helpers/schedulers/debounce';\nimport {GroupCallParticipantVideoSourceGroup, PhoneCall, PhoneCallDiscardReason, PhoneCallProtocol, Update} from '../../layer';\nimport {emojiFromCodePoints} from '../../vendor/emoji';\nimport type {CallId} from '../appManagers/appCallsManager';\nimport type {AppManagers} from '../appManagers/managers';\nimport {logger} from '../logger';\nimport apiManagerProxy from '../mtproto/mtprotoworker';\nimport CallConnectionInstance from './callConnectionInstance';\nimport CallInstanceBase from './callInstanceBase';\nimport callsController from './callsController';\nimport CALL_STATE from './callState';\nimport {GROUP_CALL_AMPLITUDE_ANALYSE_INTERVAL_MS} from './constants';\nimport parseSignalingData from './helpers/parseSignalingData';\nimport stopTrack from './helpers/stopTrack';\nimport localConferenceDescription, {ConferenceEntry, generateSsrc} from './localConferenceDescription';\nimport getCallProtocol from './p2P/getCallProtocol';\nimport getRtcConfiguration from './p2P/getRtcConfiguration';\nimport P2PEncryptor from './p2P/p2PEncryptor';\nimport {p2pParseCandidate, P2PSdpBuilder} from './p2P/p2PSdpBuilder';\nimport {parseSdp} from './sdp/utils';\nimport {WebRTCLineType} from './sdpBuilder';\nimport StreamManager from './streamManager';\nimport {AudioCodec, CallMediaState, CallSignalingData, DiffieHellmanInfo, P2PAudioCodec, P2PVideoCodec, VideoCodec} from './types';\n\nexport default class CallInstance extends CallInstanceBase<{\n state: (state: CALL_STATE) => void,\n id: (id: CallId, prevId: CallId) => void,\n muted: (muted: boolean) => void,\n mediaState: (mediaState: CallMediaState) => void,\n acceptCallOverride: () => Promise,\n}> {\n public dh: Partial;\n public id: CallId;\n public call: PhoneCall;\n public interlocutorUserId: UserId;\n public protocol: PhoneCallProtocol;\n public isOutgoing: boolean;\n public encryptionKey: Uint8Array;\n public connectionInstance: CallConnectionInstance;\n public encryptor: P2PEncryptor;\n public decryptor: P2PEncryptor;\n public candidates: RTCIceCandidate[];\n\n public offerReceived: boolean;\n public offerSent: boolean;\n\n public createdParticipantEntries: boolean;\n public release: () => Promise;\n public _connectionState: CALL_STATE;\n\n public createdAt: number;\n public connectedAt: number;\n public discardReason: string;\n\n private managers: AppManagers;\n\n private hangUpTimeout: number;\n\n private mediaStates: {\n input: CallMediaState,\n output?: CallMediaState\n };\n\n private sendMediaState: () => Promise;\n\n private decryptQueue: Uint8Array[];\n\n private getEmojisFingerprintPromise: Promise;\n private emojisFingerprint: [string, string, string, string];\n\n private wasStartingScreen: boolean;\n private wasStartingVideo: boolean;\n public wasTryingToJoin: boolean;\n\n public streamManager: StreamManager;\n\n constructor(options: {\n isOutgoing: boolean,\n interlocutorUserId: UserId,\n managers: CallInstance['managers'],\n protocol?: PhoneCallProtocol\n }) {\n super();\n\n this.log = logger('CALL');\n\n if(!this.protocol) {\n this.protocol = getCallProtocol();\n }\n\n safeAssign(this, options);\n\n this.createdAt = Date.now();\n this.offerReceived = false;\n this.offerSent = false;\n this.decryptQueue = [];\n this.candidates = [];\n\n this.addEventListener('state', (state) => {\n this.log('state', CALL_STATE[state]);\n\n if(state === CALL_STATE.CLOSED) {\n this.cleanup();\n }\n });\n\n const streamManager = this.streamManager = new StreamManager(GROUP_CALL_AMPLITUDE_ANALYSE_INTERVAL_MS);\n streamManager.direction = 'sendrecv';\n streamManager.types.push('screencast');\n if(!this.isOutgoing) {\n streamManager.locked = true;\n streamManager.canCreateConferenceEntry = false;\n }\n\n let mediaState: CallMediaState = {\n '@type': 'MediaState',\n 'type': 'input',\n 'lowBattery': false,\n 'muted': true,\n 'screencastState': 'inactive',\n 'videoRotation': 0,\n 'videoState': 'inactive'\n };\n\n const self = this;\n mediaState = new Proxy(mediaState, {\n set: function(target, key, value) {\n // @ts-ignore\n target[key] = value;\n self.setMediaState(mediaState);\n self.sendMediaState();\n return true;\n }\n });\n\n this.mediaStates = {\n input: mediaState\n };\n\n this.sendMediaState = debounce(this._sendMediaState.bind(this), 0, false, true);\n }\n\n get connectionState() {\n const {_connectionState, connectionInstance} = this;\n if(_connectionState !== undefined) {\n return _connectionState;\n } else if(!connectionInstance) {\n return CALL_STATE.CONNECTING;\n } else {\n const {iceConnectionState} = connectionInstance.connection;\n if(iceConnectionState === 'closed') {\n return CALL_STATE.CLOSED;\n } else if(iceConnectionState !== 'connected' && (!IS_SAFARI || iceConnectionState !== 'completed')) {\n return CALL_STATE.CONNECTING;\n } else {\n return CALL_STATE.CONNECTED;\n }\n }\n }\n\n get sortIndex() {\n const connectionState = this.connectionState;\n const state = CALL_STATE.CLOSED - connectionState + 1;\n let index = state * 10000000000000;\n index += 2147483647000 - (connectionState === CALL_STATE.PENDING && this.isOutgoing ? 0 : this.createdAt);\n return index;\n }\n\n public getVideoElement(type: CallMediaState['type']) {\n if(type === 'input') return this.elements.get('main');\n else {\n const mediaState = this.getMediaState('output');\n if(!mediaState) {\n return;\n }\n\n const type: WebRTCLineType = mediaState.videoState === 'active' ? 'video' : (mediaState.screencastState === 'active' ? 'screencast' : undefined);\n if(!type) {\n return;\n }\n\n const entry = this.description.findEntry((entry) => entry.type === type);\n if(!entry) {\n return;\n }\n\n return this.elements.get('' + entry.recvEntry.source);\n }\n }\n\n public async startScreenSharingInternal() {\n try {\n this.wasStartingScreen = true;\n this.wasStartingVideo = false;\n this.streamManager.types = ['audio', 'screencast'];\n await this.requestScreen();\n } catch(err) {\n this.log.error('startScreenSharing error', err);\n }\n }\n\n public async toggleScreenSharing() {\n if(this.isSharingVideo) {\n await this.stopVideoSharing();\n }\n\n if(this.isSharingScreen) {\n return this.stopVideoSharing();\n } else {\n return this.startScreenSharingInternal();\n }\n }\n\n public async startVideoSharingInternal() {\n try {\n this.wasStartingScreen = false;\n this.wasStartingVideo = true;\n this.streamManager.types = ['audio', 'video'];\n await this.requestInputSource(false, true, false);\n } catch(err) {\n this.log.error('startVideoSharing error', err);\n }\n }\n\n public async stopVideoSharing() {\n const mediaState = this.getMediaState('input');\n mediaState.videoState = mediaState.screencastState = 'inactive';\n\n const {streamManager, description} = this;\n const track = streamManager.inputStream.getVideoTracks()[0];\n if(track) {\n stopTrack(track);\n streamManager.appendToConference(description); // clear sender track\n }\n }\n\n public async toggleVideoSharing() {\n if(this.isSharingScreen) {\n await this.stopVideoSharing();\n }\n\n if(this.isSharingVideo) {\n return this.stopVideoSharing();\n } else {\n return this.startVideoSharingInternal();\n }\n }\n\n public getMediaState(type: CallMediaState['type']) {\n return this.mediaStates[type];\n }\n\n public setMediaState(mediaState: CallMediaState) {\n this.mediaStates[mediaState.type] = mediaState;\n this.dispatchEvent('mediaState', mediaState);\n }\n\n public isSharingVideoType(type: 'video' | 'screencast') {\n try {\n const hasVideoTrack = super.isSharingVideo;\n return hasVideoTrack && !!((this.wasStartingScreen && type === 'screencast') || (this.wasStartingVideo && type === 'video'));\n\n // ! it will be used before the track appears\n // return !!this.description.entries.find((entry) => entry.type === type && entry.transceiver.sender.track.enabled);\n } catch(err) {\n return false;\n }\n }\n\n public get isSharingVideo() {\n return this.isSharingVideoType('video');\n }\n\n public get isSharingScreen() {\n return this.isSharingVideoType('screencast');\n }\n\n public get isMuted() {\n const audioTrack = this.streamManager.inputStream.getAudioTracks()[0];\n return !audioTrack?.enabled;\n }\n\n public get isClosing() {\n const {connectionState} = this;\n return connectionState === CALL_STATE.CLOSING || connectionState === CALL_STATE.CLOSED;\n }\n\n public get description(): localConferenceDescription {\n return this.connectionInstance?.description;\n }\n\n public setHangUpTimeout(timeout: number, reason: PhoneCallDiscardReason['_']) {\n this.clearHangUpTimeout();\n this.hangUpTimeout = ctx.setTimeout(() => {\n this.hangUpTimeout = undefined;\n this.hangUp(reason);\n }, timeout);\n }\n\n public clearHangUpTimeout() {\n if(this.hangUpTimeout !== undefined) {\n clearTimeout(this.hangUpTimeout);\n this.hangUpTimeout = undefined;\n }\n }\n\n public setPhoneCall(phoneCall: PhoneCall) {\n this.call = phoneCall;\n\n const {id} = phoneCall;\n if(this.id !== id) {\n const prevId = this.id;\n this.id = id;\n this.dispatchEvent('id', id, prevId);\n }\n }\n\n public async acceptCall() {\n const canAccept = (await Promise.all(this.dispatchResultableEvent('acceptCallOverride')))[0] ?? true;\n if(this.isClosing || !canAccept) {\n return;\n }\n\n // this.clearHangUpTimeout();\n this.overrideConnectionState(CALL_STATE.EXCHANGING_KEYS);\n\n const call = this.call as PhoneCall.phoneCallRequested;\n this.requestInputSource(true, !!call.pFlags.video, false);\n\n const g_a_hash = call.g_a_hash;\n this.managers.appCallsManager.generateDh().then(async(dh) => {\n this.dh = { // ! it is correct\n g_a_hash,\n b: dh.a,\n g_b: dh.g_a,\n g_b_hash: dh.g_a_hash,\n p: dh.p\n };\n\n return this.managers.apiManager.invokeApi('phone.acceptCall', {\n peer: await this.managers.appCallsManager.getCallInput(this.id),\n protocol: this.protocol,\n g_b: this.dh.g_b\n });\n }).then(async(phonePhoneCall) => {\n await this.managers.appCallsManager.savePhonePhoneCall(phonePhoneCall);\n }).catch((err) => {\n this.log.error('accept call error', err);\n // if(err.type === 'CALL_PROTOCOL_COMPAT_LAYER_INVALID') {\n\n // }\n\n this.hangUp('phoneCallDiscardReasonHangup');\n });\n }\n\n public joinCall() {\n this.log('joinCall');\n\n this.getEmojisFingerprint();\n\n this.overrideConnectionState();\n\n const {isOutgoing, encryptionKey, streamManager} = this;\n\n const configuration = getRtcConfiguration(this.call as PhoneCall.phoneCall);\n this.log('joinCall configuration', configuration);\n if(!configuration) return;\n\n const connectionInstance = this.connectionInstance = new CallConnectionInstance({\n call: this,\n streamManager,\n log: this.log.bindPrefix('connection')\n });\n\n const connection = connectionInstance.createPeerConnection(configuration);\n connection.addEventListener('iceconnectionstatechange', () => {\n const state = this.connectionState;\n if(this.connectedAt === undefined && state === CALL_STATE.CONNECTED) {\n this.connectedAt = Date.now();\n }\n\n this.dispatchEvent('state', state);\n });\n connection.addEventListener('negotiationneeded', () => {\n connectionInstance.negotiate();\n });\n connection.addEventListener('icecandidate', (event) => {\n const {candidate} = event;\n connection.log('onicecandidate', candidate);\n if(candidate?.candidate) {\n this.sendIceCandidate(candidate);\n }\n });\n connection.addEventListener('track', (event) => {\n const {track} = event;\n connection.log('ontrack', track);\n this.onTrack(event);\n });\n\n const description = connectionInstance.createDescription();\n\n this.encryptor = new P2PEncryptor(isOutgoing, encryptionKey);\n this.decryptor = new P2PEncryptor(!isOutgoing, encryptionKey);\n\n this.log('currentCall', this);\n\n if(isOutgoing) {\n connectionInstance.appendStreamToConference();\n }\n\n this.createDataChannel();\n\n this.processDecryptQueue();\n }\n\n private createDataChannelEntry() {\n const dataChannelEntry = this.description.createEntry('application');\n dataChannelEntry.setDirection('sendrecv');\n dataChannelEntry.sendEntry = dataChannelEntry.recvEntry = dataChannelEntry;\n }\n\n private createDataChannel() {\n if(this.connectionInstance.dataChannel) {\n return;\n }\n\n const channel = this.connectionInstance.createDataChannel({\n id: 0,\n negotiated: true\n });\n channel.addEventListener('message', (e) => {\n this.applyDataChannelData(JSON.parse(e.data));\n });\n channel.addEventListener('open', () => {\n this.sendMediaState();\n });\n }\n\n private applyDataChannelData(data: CallMediaState) {\n switch(data['@type']) {\n case 'MediaState': {\n data.type = 'output';\n this.log('got output media state', data);\n this.setMediaState(data);\n break;\n }\n\n default:\n this.log.error('unknown data channel data:', data);\n break;\n }\n }\n\n private _sendMediaState() {\n const {connectionInstance} = this;\n if(!connectionInstance) return;\n\n const mediaState = {...this.getMediaState('input')};\n // mediaState.videoRotation = 90;\n delete mediaState.type;\n this.log('sendMediaState', mediaState);\n\n connectionInstance.sendDataChannelData(mediaState);\n }\n\n public async sendCallSignalingData(data: CallSignalingData) {\n /* if(data['@type'] === 'InitialSetup') {\n this.filterNotVP8(data);\n } */\n\n const json = JSON.stringify(data);\n const arr = new TextEncoder().encode(json);\n const {bytes} = await this.encryptor.encryptRawPacket(arr);\n\n this.log('sendCallSignalingData', this.id, json);\n await this.managers.apiManager.invokeApi('phone.sendSignalingData', {\n peer: await this.managers.appCallsManager.getCallInput(this.id),\n data: bytes\n });\n }\n\n public sendIceCandidate(iceCandidate: RTCIceCandidate) {\n this.log('sendIceCandidate', iceCandidate);\n const {candidate, sdpMLineIndex} = iceCandidate;\n if(sdpMLineIndex !== 0) {\n return;\n }\n\n const parsed = p2pParseCandidate(candidate);\n // const parsed = {sdpString: candidate};\n /* if(parsed.address.ip !== '') {\n return;\n } */\n\n this.sendCallSignalingData({\n '@type': 'Candidates',\n 'candidates': [parsed]\n });\n }\n\n public async confirmCall() {\n const {protocol, id, call} = this;\n const dh = this.dh as DiffieHellmanInfo.a;\n\n // this.clearHangUpTimeout();\n this.overrideConnectionState(CALL_STATE.EXCHANGING_KEYS);\n const {key, key_fingerprint} = await this.managers.appCallsManager.computeKey((call as PhoneCall.phoneCallAccepted).g_b, dh.a, dh.p);\n\n const phonePhoneCall = await this.managers.apiManager.invokeApi('phone.confirmCall', {\n peer: await this.managers.appCallsManager.getCallInput(id),\n protocol: protocol,\n g_a: dh.g_a,\n key_fingerprint: key_fingerprint\n });\n\n this.encryptionKey = key;\n await this.managers.appCallsManager.savePhonePhoneCall(phonePhoneCall);\n this.joinCall();\n }\n\n public getEmojisFingerprint() {\n if(this.emojisFingerprint) return this.emojisFingerprint;\n if(this.getEmojisFingerprintPromise) return this.getEmojisFingerprintPromise;\n return this.getEmojisFingerprintPromise = apiManagerProxy.invokeCrypto('get-emojis-fingerprint', this.encryptionKey, this.dh.g_a).then((codePoints) => {\n this.getEmojisFingerprintPromise = undefined;\n return this.emojisFingerprint = codePoints.map((codePoints) => emojiFromCodePoints(codePoints)) as [string, string, string, string];\n });\n }\n\n private unlockStreamManager() {\n this.connectionInstance.streamManager.locked = false;\n this.connectionInstance.appendStreamToConference();\n }\n\n private async doTheMagic() {\n this.connectionInstance.appendStreamToConference();\n\n const connection = this.connectionInstance.connection;\n\n let answer = await connection.createAnswer();\n\n this.log('[sdp] local', answer.type, answer.sdp);\n await connection.setLocalDescription(answer);\n\n connection.getTransceivers().filter((transceiver) => transceiver.direction === 'recvonly').forEach((transceiver) => {\n const entry = this.connectionInstance.description.getEntryByMid(transceiver.mid);\n entry.transceiver = entry.recvEntry.transceiver = transceiver;\n transceiver.direction = 'sendrecv';\n });\n\n const isAnswer = false;\n\n const description = this.description;\n const bundle = description.entries.map((entry) => entry.mid);\n const sdpDescription: RTCSessionDescriptionInit = {\n type: isAnswer ? 'answer' : 'offer',\n sdp: description.generateSdp({\n bundle,\n entries: description.entries.filter((entry) => bundle.includes(entry.mid)),\n // isAnswer: isAnswer\n isAnswer: !isAnswer\n })\n };\n\n await connection.setRemoteDescription(sdpDescription);\n\n answer = await connection.createAnswer();\n\n await connection.setLocalDescription(answer);\n\n const initialSetup = parseSignalingData(parseSdp(answer.sdp));\n this.log('[InitialSetup] send 1');\n this.sendCallSignalingData(initialSetup);\n\n this.unlockStreamManager();\n }\n\n public overrideConnectionState(state?: CALL_STATE) {\n this._connectionState = state;\n this.dispatchEvent('state', this.connectionState);\n }\n\n public get duration() {\n return this.connectedAt !== undefined ? (Date.now() - this.connectedAt) / 1000 | 0 : 0;\n }\n\n protected onInputStream(stream: MediaStream): void {\n super.onInputStream(stream);\n\n const videoTrack = stream.getVideoTracks()[0];\n if(videoTrack) {\n const state = this.getMediaState('input');\n\n // handle starting camera\n if(!this.wasStartingScreen && !this.wasStartingVideo) {\n this.wasStartingVideo = true;\n }\n\n if(this.isSharingVideo) {\n state.videoState = 'active';\n } else if(this.isSharingScreen) {\n state.screencastState = 'active';\n }\n\n videoTrack.addEventListener('ended', () => {\n this.stopVideoSharing();\n }, {once: true});\n }\n\n if(stream.getAudioTracks().length) {\n this.onMutedChange();\n }\n }\n\n private onMutedChange() {\n const isMuted = this.isMuted;\n this.dispatchEvent('muted', isMuted);\n\n const state = this.getMediaState('input');\n state.muted = isMuted;\n }\n\n public toggleMuted(): Promise {\n return this.requestAudioSource(true).then(() => {\n this.setMuted();\n this.onMutedChange();\n });\n }\n\n public async hangUp(discardReason?: PhoneCallDiscardReason['_'], discardedByOtherParty?: boolean) {\n if(this.isClosing) {\n return;\n }\n\n this.discardReason = discardReason;\n this.log('hangUp', discardReason);\n this.overrideConnectionState(CALL_STATE.CLOSED);\n\n if(this.connectionInstance) {\n this.connectionInstance.closeConnectionAndStream(true);\n }\n\n if(discardReason && !discardedByOtherParty) {\n let hasVideo = false;\n for(const type in this.mediaStates) {\n const mediaState = this.mediaStates[type as 'input' | 'output'];\n hasVideo = mediaState.videoState === 'active' || mediaState.screencastState === 'active' || hasVideo;\n }\n\n await this.managers.appCallsManager.discardCall(this.id, this.duration, discardReason, hasVideo);\n }\n }\n\n private performCodec(_codec: P2PAudioCodec | P2PVideoCodec) {\n const payloadTypes: AudioCodec['payload-types'] = _codec.payloadTypes.map((payloadType) => {\n return {\n ...payloadType,\n 'rtcp-fbs': payloadType.feedbackTypes\n }\n });\n\n const codec: AudioCodec = {\n 'rtp-hdrexts': _codec.rtpExtensions,\n 'payload-types': payloadTypes\n };\n\n return codec;\n }\n\n private setDataToDescription(data: CallSignalingData.initialSetup) {\n this.description.setData({\n transport: {\n 'pwd': data.pwd,\n 'ufrag': data.ufrag,\n 'fingerprints': data.fingerprints,\n 'rtcp-mux': true\n },\n audio: this.performCodec(data.audio),\n video: data.video ? this.performCodec(data.video) as VideoCodec : undefined,\n screencast: data.screencast ? this.performCodec(data.screencast) as VideoCodec : undefined\n });\n }\n\n private filterNotVP8(initialSetup: CallSignalingData.initialSetup) {\n if(!this.isOutgoing) { // only VP8 works now\n [initialSetup.video, initialSetup.screencast].filter(Boolean).forEach((codec) => {\n const payloadTypes = codec.payloadTypes;\n const idx = payloadTypes.findIndex((payloadType) => payloadType.name === 'VP8');\n const vp8PayloadType = payloadTypes[idx];\n const rtxIdx = payloadTypes.findIndex((payloadType) => +payloadType.parameters?.apt === vp8PayloadType.id);\n codec.payloadTypes = [payloadTypes[idx], payloadTypes[rtxIdx]];\n });\n }\n }\n\n public async applyCallSignalingData(data: CallSignalingData) {\n this.log('applyCallSignalingData', this, data);\n\n const {connection, description} = this.connectionInstance;\n\n switch(data['@type']) {\n case 'InitialSetup': {\n this.log('[sdp] InitialSetup', data);\n\n this.filterNotVP8(data);\n this.setDataToDescription(data);\n\n const performSsrcGroups = (ssrcGroups: P2PVideoCodec['ssrcGroups']): GroupCallParticipantVideoSourceGroup[] => {\n return ssrcGroups.map((ssrcGroup) => {\n return {\n _: 'groupCallParticipantVideoSourceGroup',\n semantics: ssrcGroup.semantics,\n sources: ssrcGroup.ssrcs.map((source) => +source)\n };\n });\n };\n\n const ssrcs = [\n generateSsrc('audio', +data.audio.ssrc),\n data.video ? generateSsrc('video', performSsrcGroups(data.video.ssrcGroups)) : undefined,\n data.screencast ? generateSsrc('screencast', performSsrcGroups(data.screencast.ssrcGroups)) : undefined\n ].filter(Boolean);\n\n ssrcs.forEach((ssrc) => {\n let entry = description.getEntryBySource(ssrc.source);\n if(entry) {\n return;\n }\n\n const sendRecvEntry = description.findFreeSendRecvEntry(ssrc.type, false);\n entry = new ConferenceEntry(sendRecvEntry.mid, ssrc.type);\n entry.setDirection('sendrecv');\n sendRecvEntry.recvEntry = entry;\n\n description.setEntrySource(entry, ssrc.sourceGroups || ssrc.source);\n });\n\n this.createDataChannelEntry();\n\n const isAnswer = this.offerSent;\n this.offerSent = false;\n\n const bundle = description.entries.map((entry) => entry.mid);\n const sdpDescription: RTCSessionDescriptionInit = {\n type: isAnswer ? 'answer' : 'offer',\n sdp: description.generateSdp({\n bundle,\n entries: description.entries.filter((entry) => bundle.includes(entry.mid)),\n // isAnswer: isAnswer\n isAnswer: !isAnswer\n })\n };\n\n this.log('[sdp] remote', sdpDescription.sdp);\n\n await connection.setRemoteDescription(sdpDescription);\n\n await this.tryToReleaseCandidates();\n\n if(!isAnswer) {\n await this.doTheMagic();\n }\n\n break;\n }\n\n case 'Candidates': {\n for(const candidate of data.candidates) {\n const init: RTCIceCandidateInit = P2PSdpBuilder.generateCandidate(candidate);\n init.sdpMLineIndex = 0;\n const iceCandidate = new RTCIceCandidate(init);\n this.candidates.push(iceCandidate);\n }\n\n await this.tryToReleaseCandidates();\n break;\n }\n\n default: {\n this.log.error('unrecognized signaling data', data);\n }\n }\n }\n\n public async tryToReleaseCandidates() {\n const {connectionInstance} = this;\n if(!connectionInstance) {\n return;\n }\n\n const {connection} = connectionInstance;\n if(connection.remoteDescription) {\n const promises: Promise[] = this.candidates.map((candidate) => this.addIceCandidate(connection, candidate));\n this.candidates.length = 0;\n\n await Promise.all(promises);\n } else {\n this.log('[candidates] postpone');\n }\n }\n\n private async addIceCandidate(connection: RTCPeerConnection, candidate: RTCIceCandidate) {\n this.log('[candidate] start', candidate);\n try {\n // if(!candidate.address) return;\n await connection.addIceCandidate(candidate);\n this.log('[candidate] add', candidate);\n } catch(e) {\n this.log.error('[candidate] error', candidate, e);\n }\n }\n\n private async processDecryptQueue() {\n const {encryptor} = this;\n if(!encryptor) {\n this.log.warn('got encrypted signaling data before the encryption key');\n return;\n }\n\n const length = this.decryptQueue.length;\n if(!length) {\n return;\n }\n\n const queue = this.decryptQueue.slice();\n this.decryptQueue.length = 0;\n\n for(const data of queue) {\n const decryptedData = await encryptor.decryptRawPacket(data);\n if(!decryptedData) {\n continue;\n }\n\n // this.log('[update] updateNewCallSignalingData', update, decryptedData);\n\n const str = new TextDecoder().decode(decryptedData);\n try {\n const signalingData: CallSignalingData = JSON.parse(str);\n this.log('[update] updateNewCallSignalingData', signalingData);\n this.applyCallSignalingData(signalingData);\n } catch(err) {\n this.log.error('wrong signaling data', str);\n this.hangUp('phoneCallDiscardReasonDisconnect');\n callsController.dispatchEvent('incompatible', this.interlocutorUserId);\n }\n }\n }\n\n public onUpdatePhoneCallSignalingData(data: Uint8Array) {\n this.decryptQueue.push(data);\n this.processDecryptQueue();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport {PhoneCallProtocol} from '../../../layer';\n\nexport default function getCallProtocol(): PhoneCallProtocol {\n return {\n _: 'phoneCallProtocol',\n pFlags: {\n udp_p2p: true,\n udp_reflector: true\n },\n min_layer: 92,\n max_layer: 92,\n library_versions: ['4.0.0']\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport {PhoneCall} from '../../../layer';\n\nexport default function getRtcConfiguration(call: PhoneCall.phoneCall): RTCConfiguration {\n const iceServers: RTCIceServer[] = [];\n call.connections.forEach((connection) => {\n switch(connection._) {\n /* case 'callServerTypeTelegramReflector': {\n break;\n } */\n case 'phoneConnectionWebrtc': {\n const {ip, ipv6, port, username, password} = connection;\n const urls: string[] = [];\n if(connection.pFlags.turn) {\n if(ip) {\n urls.push(`turn:${ip}:${port}`);\n }\n if(ipv6) {\n urls.push(`turn:[${ipv6}]:${port}`);\n }\n } else if(connection.pFlags.stun) {\n if(ip) {\n urls.push(`stun:${ip}:${port}`);\n }\n if(ipv6) {\n urls.push(`stun:[${ipv6}]:${port}`);\n }\n }\n\n if(urls.length > 0) {\n iceServers.push({\n urls,\n username,\n credential: password\n });\n }\n break;\n }\n }\n });\n\n return {\n iceServers,\n iceTransportPolicy: call.pFlags.p2p_allowed ? 'all' : 'relay'\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport getScreenStream from './getScreenStream';\nimport getStream from './getStream';\n\n/**\n * ! Use multiple constraints together only with first invoke\n */\nexport default function getStreamCached() {\n const _cache: {\n main: Partial<{\n audio: Promise,\n video: Promise\n }>,\n screen: Partial<{\n audio: Promise,\n video: Promise\n }>\n } = {\n main: {},\n screen: {}\n };\n\n return async(options: {\n isScreen: true,\n constraints: DisplayMediaStreamOptions,\n } | {\n isScreen?: false,\n constraints: MediaStreamConstraints,\n muted: boolean\n }) => {\n const {isScreen, constraints} = options;\n const cache = _cache[isScreen ? 'screen' : 'main'];\n let promise: Promise = cache[constraints.audio ? 'audio' : 'video'];\n\n if(!promise) {\n promise = (isScreen ? getScreenStream : getStream)(constraints, (options as any).muted);\n if(constraints.audio && !cache.audio) cache.audio = promise.finally(() => cache.audio = undefined);\n if(constraints.video && !cache.video) cache.video = promise.finally(() => cache.video = undefined);\n }\n\n try {\n return await promise;\n /* let out: Partial<{\n audio: MediaStream,\n video: MediaStream\n }> = {};\n\n await Promise.all([\n constraints.audio && cache.audio.then((stream) => out.audio = stream),\n constraints.video && cache.video.then((stream) => out.video = stream)\n ].filter(Boolean));\n\n return out; */\n } catch(err) {\n throw err;\n }\n };\n}\n\n(window as any).getStreamCached = getStreamCached;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport EventListenerBase, {EventListenerListeners} from '../../helpers/eventListenerBase';\nimport noop from '../../helpers/noop';\nimport {logger} from '../logger';\nimport getAudioConstraints from './helpers/getAudioConstraints';\nimport getScreenConstraints from './helpers/getScreenConstraints';\nimport getStreamCached from './helpers/getStreamCached';\nimport getVideoConstraints from './helpers/getVideoConstraints';\nimport stopTrack from './helpers/stopTrack';\nimport LocalConferenceDescription from './localConferenceDescription';\nimport StreamManager, {StreamItem} from './streamManager';\n\nexport type TryAddTrackOptions = {\n stream: MediaStream,\n track: MediaStreamTrack,\n type: StreamItem['type'],\n source?: string\n};\n\nexport default abstract class CallInstanceBase extends EventListenerBase {\n protected log: ReturnType;\n protected outputDeviceId: string;\n\n protected player: HTMLElement;\n protected elements: Map;\n\n protected audio: HTMLAudioElement;\n // protected fixedSafariAudio: boolean;\n\n protected getStream: ReturnType;\n\n constructor() {\n super(false);\n\n const player = this.player = document.createElement('div');\n player.classList.add('call-player');\n player.style.display = 'none';\n document.body.append(player);\n\n this.elements = new Map();\n\n // possible Safari fix\n const audio = this.audio = new Audio();\n audio.autoplay = true;\n audio.volume = 1.0;\n this.player.append(audio);\n this.elements.set('audio', audio);\n\n this.fixSafariAudio();\n\n this.getStream = getStreamCached();\n }\n\n public get isSharingAudio() {\n return !!this.streamManager.hasInputTrackKind('audio');\n }\n\n public get isSharingVideo() {\n return !!this.streamManager.hasInputTrackKind('video');\n }\n\n public abstract get isMuted(): boolean;\n public abstract get isClosing(): boolean;\n\n public fixSafariAudio() {\n // if(this.fixedSafariAudio) return;\n this.audio.play().catch(noop);\n // this.fixedSafariAudio = true;\n }\n\n public requestAudioSource(muted: boolean) {\n return this.requestInputSource(true, false, muted);\n }\n\n public requestInputSource(audio: boolean, video: boolean, muted: boolean) {\n const {streamManager} = this;\n if(streamManager) {\n const isAudioGood = !audio || this.isSharingAudio;\n const isVideoGood = !video || this.isSharingVideo;\n if(isAudioGood && isVideoGood) {\n return Promise.resolve();\n }\n }\n\n const constraints: MediaStreamConstraints = {\n audio: audio && getAudioConstraints(),\n video: video && getVideoConstraints()\n };\n\n return this.getStream({\n constraints,\n muted\n }).then((stream) => {\n this.onInputStream(stream);\n });\n }\n\n public requestScreen() {\n return this.getStream({\n isScreen: true,\n constraints: getScreenConstraints(true)\n }).then((stream) => {\n this.onInputStream(stream);\n });\n }\n\n public getElement(endpoint: number | string) {\n return this.elements.get('' + endpoint);\n }\n\n public abstract get streamManager(): StreamManager;\n public abstract get description(): LocalConferenceDescription;\n public abstract toggleMuted(): Promise;\n\n public cleanup() {\n this.player.textContent = '';\n this.player.remove();\n this.elements.clear();\n\n // can have no connectionInstance but streamManager with input stream\n this.streamManager.stop();\n\n super.cleanup();\n }\n\n public onTrack(event: RTCTrackEvent) {\n this.tryAddTrack({\n stream: event.streams[0],\n track: event.track,\n type: 'output'\n });\n }\n\n public saveInputVideoStream(stream: MediaStream, type?: string) {\n const track = stream.getVideoTracks()[0];\n this.tryAddTrack({\n stream,\n track,\n type: 'input',\n source: type || 'main'\n });\n }\n\n public tryAddTrack({stream, track, type, source}: TryAddTrackOptions) {\n if(!source) {\n source = StreamManager.getSource(stream, type);\n }\n\n this.log('tryAddTrack', stream, track, type, source);\n\n const isOutput = type === 'output';\n\n const {player, elements, streamManager} = this;\n\n const tagName = track.kind as StreamItem['kind'];\n const isVideo = tagName === 'video';\n\n const elementEndpoint = isVideo ? source : tagName;\n let element = elements.get(elementEndpoint);\n\n if(isVideo) {\n track.addEventListener('ended', () => {\n this.log('[track] onended');\n elements.delete(elementEndpoint);\n // element.remove();\n }, {once: true});\n }\n\n if(isOutput) {\n streamManager.addTrack(stream, track, type);\n }\n\n const useStream = isVideo ? stream : streamManager.outputStream;\n if(!element) {\n element = document.createElement(tagName);\n element.autoplay = true;\n element.srcObject = useStream;\n element.volume = 1.0;\n\n if((element as any).sinkId !== 'undefined') {\n const {outputDeviceId} = this;\n if(outputDeviceId) {\n (element as any).setSinkId(outputDeviceId);\n }\n }\n\n if(!isVideo) {\n player.appendChild(element);\n } else {\n element.setAttribute('playsinline', 'true');\n element.muted = true;\n }\n // audio.play();\n\n elements.set(elementEndpoint, element);\n } else {\n if(element.paused) {\n element.play().catch(noop);\n }\n\n // ! EVEN IF MEDIASTREAM IS THE SAME NEW TRACK WON'T PLAY WITHOUT REPLACING IT WHEN NEW PARTICIPANT IS ENTERING !\n // if(element.srcObject !== useStream) {\n element.srcObject = useStream;\n // }\n }\n\n return source;\n }\n\n public setMuted(muted?: boolean) {\n this.streamManager.inputStream.getAudioTracks().forEach((track) => {\n if(track?.kind === 'audio') {\n track.enabled = muted === undefined ? !track.enabled : !muted;\n }\n });\n }\n\n protected onInputStream(stream: MediaStream): void {\n if(!this.isClosing) {\n const videoTracks = stream.getVideoTracks();\n if(videoTracks.length) {\n this.saveInputVideoStream(stream, 'main');\n }\n\n const {streamManager, description} = this;\n streamManager.addStream(stream, 'input');\n\n if(description) {\n streamManager.appendToConference(description);\n }\n } else { // if call is declined earlier than stream appears\n stream.getTracks().forEach((track) => {\n stopTrack(track);\n });\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nenum CALL_STATE {\n CONNECTED,\n CONNECTING,\n EXCHANGING_KEYS,\n PENDING,\n REQUESTING,\n CLOSING,\n CLOSED\n}\n\nexport default CALL_STATE;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport AudioAssetPlayer from '../../helpers/audioAssetPlayer';\n\nexport type CallAudioAssetName = 'call_busy.mp3' | 'call_connect.mp3' | 'call_end.mp3' | 'call_incoming.mp3' | 'call_outgoing.mp3' | 'voip_failed.mp3' | 'voip_connecting.mp3';\n\nlet audioAsset: AudioAssetPlayer;\nexport default function getCallAudioAsset() {\n return audioAsset ??= new AudioAssetPlayer([\n 'call_busy.mp3',\n 'call_connect.mp3',\n 'call_end.mp3',\n 'call_incoming.mp3',\n 'call_outgoing.mp3',\n 'voip_failed.mp3'\n ]);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport getCallAudioAsset, {CallAudioAssetName} from '../../components/call/getAudioAsset';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport IS_CALL_SUPPORTED from '../../environment/callSupport';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport insertInDescendSortedArray from '../../helpers/array/insertInDescendSortedArray';\nimport AudioAssetPlayer from '../../helpers/audioAssetPlayer';\nimport bytesCmp from '../../helpers/bytes/bytesCmp';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport tsNow from '../../helpers/tsNow';\nimport {PhoneCallProtocol} from '../../layer';\nimport {CallId} from '../appManagers/appCallsManager';\nimport {AppManagers} from '../appManagers/managers';\nimport {logger} from '../logger';\nimport apiManagerProxy from '../mtproto/mtprotoworker';\nimport {NULL_PEER_ID} from '../mtproto/mtproto_config';\nimport rootScope from '../rootScope';\nimport CallInstance from './callInstance';\nimport CALL_STATE from './callState';\n\nconst CALL_REQUEST_TIMEOUT = 45e3;\n\nexport class CallsController extends EventListenerBase<{\n instance: (details: {hasCurrent: boolean, instance: CallInstance}) => void,\n accepting: (instance: CallInstance) => void, // это костыль. используется при параллельном вызове, чтобы заменить звонок в topbarCall\n incompatible: (userId: UserId) => void,\n}> {\n private log: ReturnType;\n private managers: AppManagers;\n private audioAsset: AudioAssetPlayer;\n private instances: Map;\n private sortedInstances: Array;\n private tempId: number;\n\n public construct(managers: AppManagers) {\n this.managers = managers;\n this.log = logger('CC');\n\n if(!IS_CALL_SUPPORTED) {\n return;\n }\n\n this.audioAsset = getCallAudioAsset();\n this.tempId = 0;\n this.instances = new Map();\n this.sortedInstances = [];\n\n rootScope.addEventListener('call_update', async(call) => {\n let instance = this.instances.get(call.id);\n\n if(instance) {\n instance.setPhoneCall(call);\n }\n\n switch(call._) {\n case 'phoneCallDiscarded': {\n if(instance) {\n instance.hangUp(call.reason?._, true);\n }\n\n break;\n }\n\n case 'phoneCallAccepted': {\n if(instance) {\n /* if(!this.verifyProtocolCompatibility(call.protocol)) {\n instance.hangUp('phoneCallDiscardReasonDisconnect');\n rootScope.dispatchEvent('call_incompatible', instance.interlocutorUserId);\n break;\n } */\n\n instance.confirmCall();\n }\n\n break;\n }\n\n case 'phoneCallRequested': {\n if(!instance) {\n /* if(!this.verifyProtocolCompatibility(call.protocol)) {\n rootScope.dispatchEvent('call_incompatible', call.admin_id);\n break;\n } */\n\n instance = this.createCallInstance({\n isOutgoing: false,\n interlocutorUserId: call.admin_id\n });\n\n instance.overrideConnectionState(CALL_STATE.PENDING);\n instance.setPhoneCall(call);\n instance.setHangUpTimeout(CALL_REQUEST_TIMEOUT, 'phoneCallDiscardReasonMissed');\n }\n\n break;\n }\n\n case 'phoneCall': {\n if(!instance || instance.encryptionKey) {\n break;\n }\n\n const g_a = instance.dh.g_a = call.g_a_or_b;\n const dh = instance.dh;\n const g_a_hash = await apiManagerProxy.invokeCrypto('sha256', g_a);\n if(!bytesCmp(dh.g_a_hash, g_a_hash)) {\n this.log.error('Incorrect g_a_hash', dh.g_a_hash, g_a_hash);\n break;\n }\n\n const {key, key_fingerprint} = await this.managers.appCallsManager.computeKey(g_a, dh.b, dh.p);\n if(call.key_fingerprint !== key_fingerprint) {\n this.log.error('Incorrect key fingerprint', call.key_fingerprint, key_fingerprint, g_a, dh);\n instance.hangUp('phoneCallDiscardReasonDisconnect');\n break;\n }\n\n instance.encryptionKey = key;\n instance.joinCall();\n\n break;\n }\n }\n });\n\n rootScope.addEventListener('call_signaling', ({callId, data}) => {\n const instance = this.instances.get(callId);\n if(instance?.id !== callId) {\n return;\n }\n\n instance.onUpdatePhoneCallSignalingData(data);\n });\n }\n\n public get currentCall() {\n return this.sortedInstances[0];\n }\n\n public getCallByUserId(userId: UserId) {\n for(const [callId, instance] of this.instances) {\n if(instance.interlocutorUserId === userId) {\n return instance;\n }\n }\n }\n\n private createCallInstance(options: {\n isOutgoing: boolean,\n interlocutorUserId: UserId,\n protocol?: PhoneCallProtocol\n }) {\n const call = new CallInstance({\n managers: this.managers,\n ...options\n });\n\n call.addEventListener('state', (state) => {\n const currentCall = this.currentCall;\n if(state === CALL_STATE.CLOSED) {\n this.instances.delete(call.id);\n indexOfAndSplice(this.sortedInstances, call);\n } else {\n insertInDescendSortedArray(this.sortedInstances, call, 'sortIndex');\n }\n\n if(state === CALL_STATE.EXCHANGING_KEYS) {\n call.wasTryingToJoin = true;\n }\n\n const hasConnected = call.connectedAt !== undefined;\n if(state === CALL_STATE.EXCHANGING_KEYS || (state === CALL_STATE.CONNECTING && hasConnected)) {\n call.setHangUpTimeout(CALL_REQUEST_TIMEOUT, 'phoneCallDiscardReasonDisconnect');\n } else {\n call.clearHangUpTimeout();\n }\n\n if(currentCall === call || !currentCall) {\n if(state === CALL_STATE.CLOSED) {\n if(!call.isOutgoing && !call.wasTryingToJoin) { // incoming call has been accepted on other device or ended\n this.audioAsset.stopSound();\n } else if(call.wasTryingToJoin && !hasConnected) { // something has happened during the key exchanging\n this.audioAsset.playSound('voip_failed.mp3');\n } else {\n this.audioAsset.playSound(call.discardReason === 'phoneCallDiscardReasonBusy' ? 'call_busy.mp3' : 'call_end.mp3');\n }\n } else if(state === CALL_STATE.PENDING) {\n this.audioAsset.playSound(call.isOutgoing ? 'call_outgoing.mp3' : 'call_incoming.mp3', true);\n } else if(state === CALL_STATE.EXCHANGING_KEYS) {\n this.audioAsset.playSoundIfDifferent('call_connect.mp3');\n } else if(state === CALL_STATE.CONNECTING) {\n if(call.duration) {\n this.audioAsset.playSound('voip_connecting.mp3', true);\n }\n } else {\n this.audioAsset.stopSound();\n }\n }\n });\n\n call.addEventListener('id', (id, prevId) => {\n if(prevId !== undefined) {\n this.instances.delete(prevId);\n }\n\n const hasCurrent = !!this.currentCall;\n this.instances.set(id, call);\n\n if(prevId === undefined) {\n this.dispatchEvent('instance', {instance: call, hasCurrent: hasCurrent});\n }\n });\n\n return call;\n }\n\n public async startCallInternal(userId: UserId, isVideo: boolean) {\n this.log('p2pStartCallInternal', userId, isVideo);\n\n const fullInfo = await this.managers.appProfileManager.getProfile(userId);\n if(!fullInfo) return;\n\n const {video_calls_available} = fullInfo.pFlags;\n\n const call = this.createCallInstance({\n isOutgoing: true,\n interlocutorUserId: userId\n });\n\n call.requestInputSource(true, !!(isVideo && video_calls_available), false);\n\n call.overrideConnectionState(CALL_STATE.REQUESTING);\n call.setPhoneCall({\n _: 'phoneCallWaiting',\n access_hash: '',\n admin_id: NULL_PEER_ID,\n date: tsNow(true),\n id: --this.tempId,\n participant_id: userId,\n protocol: call.protocol,\n pFlags: {\n video: isVideo || undefined\n }\n });\n\n // return;\n this.managers.appCallsManager.generateDh().then(async(dh) => {\n call.dh = dh;\n\n return this.managers.appCallsManager.requestCall(userId, call.protocol, call.dh.g_a_hash, isVideo && video_calls_available);\n }).then((phoneCall) => {\n call.overrideConnectionState(CALL_STATE.PENDING);\n call.setPhoneCall(phoneCall);\n call.setHangUpTimeout(CALL_REQUEST_TIMEOUT, 'phoneCallDiscardReasonHangup');\n });\n }\n}\n\nconst callsController = new CallsController();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.callsController = callsController);\nexport default callsController;\n","export const GROUP_CALL_AMPLITUDE_ANALYSE_COUNT_MAX = 50;\nexport const GROUP_CALL_AMPLITUDE_ANALYSE_INTERVAL_MS = 100;\nexport const GROUP_CALL_PARTICIPANTS_LOAD_LIMIT = 100;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport throttle from '../../helpers/schedulers/throttle';\nimport {GroupCallConnectionType, JoinGroupCallJsonPayload} from '../appManagers/appGroupCallsManager';\nimport {AppManagers} from '../appManagers/managers';\nimport rootScope from '../rootScope';\nimport CallConnectionInstanceBase, {CallConnectionInstanceOptions} from './callConnectionInstanceBase';\nimport GroupCallInstance from './groupCallInstance';\nimport filterServerCodecs from './helpers/filterServerCodecs';\nimport fixLocalOffer from './helpers/fixLocalOffer';\nimport processMediaSection from './helpers/processMediaSection';\nimport {ConferenceEntry} from './localConferenceDescription';\nimport SDP from './sdp';\nimport SDPMediaSection from './sdp/mediaSection';\nimport {WebRTCLineType} from './sdpBuilder';\nimport {UpdateGroupCallConnectionData} from './types';\n\nexport default class GroupCallConnectionInstance extends CallConnectionInstanceBase {\n private groupCall: GroupCallInstance;\n public updateConstraints?: boolean;\n private type: GroupCallConnectionType;\n private options: {\n type: Extract,\n isMuted?: boolean,\n joinVideo?: boolean,\n rejoin?: boolean\n } | {\n type: Extract,\n };\n\n private updateConstraintsInterval: number;\n public negotiateThrottled: () => void;\n\n private managers: AppManagers;\n\n constructor(options: CallConnectionInstanceOptions & {\n groupCall: GroupCallConnectionInstance['groupCall'],\n type: GroupCallConnectionInstance['type'],\n options: GroupCallConnectionInstance['options'],\n managers: AppManagers\n }) {\n super(options);\n\n this.negotiateThrottled = throttle(this.negotiate.bind(this), 0, false);\n }\n\n public createPeerConnection() {\n return this.connection || super.createPeerConnection({\n iceServers: [],\n iceTransportPolicy: 'all',\n bundlePolicy: 'max-bundle',\n rtcpMuxPolicy: 'require',\n iceCandidatePoolSize: 0\n // sdpSemantics: \"unified-plan\",\n // extmapAllowMixed: true,\n });\n }\n\n public createDataChannel() {\n if(this.dataChannel) {\n return this.dataChannel;\n }\n\n const dataChannel = super.createDataChannel();\n\n dataChannel.addEventListener('open', () => {\n this.maybeUpdateRemoteVideoConstraints();\n });\n\n dataChannel.addEventListener('close', () => {\n if(this.updateConstraintsInterval) {\n clearInterval(this.updateConstraintsInterval);\n this.updateConstraintsInterval = undefined;\n }\n });\n\n return dataChannel;\n }\n\n public createDescription() {\n if(this.description) {\n return this.description;\n }\n\n const description = super.createDescription();\n\n /* const perType = 0;\n const types = ['audio' as const, 'video' as const];\n const count = types.length * perType;\n const init: RTCRtpTransceiverInit = {direction: 'recvonly'};\n types.forEach((type) => {\n for(let i = 0; i < perType; ++i) {\n description.createEntry(type).createTransceiver(connection, init);\n }\n }); */\n\n return description;\n }\n\n public appendStreamToConference() {\n super.appendStreamToConference();/* .then(() => {\n currentGroupCall.connections.main.negotiating = false;\n this.startNegotiation({\n type: type,\n isMuted: muted,\n rejoin\n });\n }); */\n }\n\n private async invokeJoinGroupCall(localSdp: SDP, mainChannels: SDPMediaSection[], options: GroupCallConnectionInstance['options']) {\n const {groupCall, description} = this;\n const groupCallId = groupCall.id;\n\n const processedChannels = mainChannels.map((section) => {\n const processed = processMediaSection(localSdp, section);\n\n this.sources[processed.entry.type as 'video' | 'audio'] = processed.entry;\n\n return processed;\n });\n\n const audioChannel = processedChannels.find((channel) => channel.media.mediaType === 'audio');\n const videoChannel = processedChannels.find((channel) => channel.media.mediaType === 'video');\n let {source, params} = audioChannel || {};\n const useChannel = videoChannel || audioChannel;\n\n const channels: {[type in WebRTCLineType]?: typeof audioChannel} = {\n audio: audioChannel,\n video: videoChannel\n };\n\n description.entries.forEach((entry) => {\n if(entry.direction === 'sendonly') {\n const channel = channels[entry.type];\n if(!channel) return;\n\n description.setEntrySource(entry, channel.sourceGroups || channel.source);\n description.setEntryPeerId(entry, rootScope.myId);\n }\n });\n\n // overwrite ssrc with audio in video params\n if(params !== useChannel.params) {\n const data: JoinGroupCallJsonPayload = JSON.parse(useChannel.params.data);\n // data.ssrc = source || data.ssrc - 1; // audio channel can be missed in screensharing\n if(source) data.ssrc = source;\n else delete data.ssrc;\n params = {\n _: 'dataJSON',\n data: JSON.stringify(data)\n };\n }\n\n const update = await this.managers.appGroupCallsManager.joinGroupCall(groupCallId, params, options);\n\n const data: UpdateGroupCallConnectionData = JSON.parse(update.params.data);\n\n data.audio = data.audio || groupCall.connections.main.description.audio;\n description.setData(data);\n filterServerCodecs(mainChannels, data);\n\n return data;\n }\n\n protected async negotiateInternal() {\n const {connection, description} = this;\n const isNewConnection = connection.iceConnectionState === 'new' && !description.getEntryByMid('0').source;\n const log = this.log.bindPrefix('startNegotiation');\n log('start');\n\n const originalOffer = await connection.createOffer({iceRestart: false});\n\n if(isNewConnection && this.dataChannel) {\n const dataChannelEntry = description.createEntry('application');\n dataChannelEntry.setDirection('sendrecv');\n }\n\n const {sdp: localSdp, offer} = fixLocalOffer({\n offer: originalOffer,\n data: description\n });\n\n log('[sdp] setLocalDescription', offer.sdp);\n await connection.setLocalDescription(offer);\n\n const mainChannels = localSdp.media.filter((media) => {\n return media.mediaType !== 'application' && media.isSending;\n });\n\n if(isNewConnection) {\n try {\n await this.invokeJoinGroupCall(localSdp, mainChannels, this.options);\n } catch(e) {\n this.log.error('[tdweb] joinGroupCall error', e);\n }\n }\n\n /* if(!data) {\n log('abort 0');\n this.closeConnectionAndStream(connection, streamManager);\n return;\n } */\n\n /* if(connection.iceConnectionState !== 'new') {\n log(`abort 1 connectionState=${connection.iceConnectionState}`);\n this.closeConnectionAndStream(connection, streamManager);\n return;\n } */\n /* if(this.currentGroupCall !== currentGroupCall || connectionHandler.connection !== connection) {\n log('abort', this.currentGroupCall, currentGroupCall);\n this.closeConnectionAndStream(connection, streamManager);\n return;\n } */\n\n const isAnswer = true;\n // const _bundleMids = bundleMids.slice();\n const entriesToDelete: ConferenceEntry[] = [];\n const bundle = localSdp.bundle;\n forEachReverse(bundle, (mid, idx, arr) => {\n const entry = description.getEntryByMid(mid);\n if(entry.shouldBeSkipped(isAnswer)) {\n arr.splice(idx, 1);\n entriesToDelete.push(entry);\n }\n });\n\n /* forEachReverse(description.entries, (entry, idx, arr) => {\n const mediaSection = _parsedSdp.media.find((section) => section.oa.get('mid').oa === entry.mid);\n const deleted = !mediaSection;\n // const deleted = !_bundleMids.includes(entry.mid); // ! can't use it because certain mid can be missed in bundle\n if(deleted) {\n arr.splice(idx, 1);\n }\n }); */\n\n const entries = localSdp.media.map((section) => {\n const mid = section.mid;\n let entry = description.getEntryByMid(mid);\n if(!entry) {\n entry = new ConferenceEntry(mid, section.mediaType);\n entry.setDirection('inactive');\n }\n\n return entry;\n });\n\n const answerDescription: RTCSessionDescriptionInit = {\n type: 'answer',\n sdp: description.generateSdp({\n bundle,\n entries,\n isAnswer\n })\n };\n\n entriesToDelete.forEach((entry) => {\n description.deleteEntry(entry);\n });\n\n log(`[sdp] setRemoteDescription signaling=${connection.signalingState} ice=${connection.iceConnectionState} gathering=${connection.iceGatheringState} connection=${connection.connectionState}`, answerDescription.sdp);\n await connection.setRemoteDescription(answerDescription);\n\n log('end');\n }\n\n public negotiate() {\n let promise = this.negotiating;\n if(promise) {\n return promise;\n }\n\n promise = super.negotiate();\n\n if(this.updateConstraints) {\n promise.then(() => {\n this.maybeUpdateRemoteVideoConstraints();\n this.updateConstraints = false;\n });\n }\n\n if(this.options.type === 'presentation') {\n promise.then(() => {\n this.connection.getTransceivers().find((transceiver) => {\n if(transceiver.sender?.track?.kind === 'video') {\n transceiver.sender.setParameters({\n ...transceiver.sender.getParameters(),\n degradationPreference: 'maintain-resolution'\n });\n }\n });\n });\n }\n\n return promise;\n }\n\n public maybeUpdateRemoteVideoConstraints() {\n if(this.dataChannel.readyState !== 'open') {\n return;\n }\n\n this.log('maybeUpdateRemoteVideoConstraints');\n\n // * https://github.com/TelegramMessenger/tgcalls/blob/6f2746e04c9b040f8c8dfc64d916a1853d09c4ce/tgcalls/group/GroupInstanceCustomImpl.cpp#L2549\n type VideoConstraints = {minHeight?: number, maxHeight: number};\n const obj: {\n colibriClass: 'ReceiverVideoConstraints',\n constraints: {[endpoint: string]: VideoConstraints},\n defaultConstraints: VideoConstraints,\n onStageEndpoints: string[]\n } = {\n colibriClass: 'ReceiverVideoConstraints',\n constraints: {},\n defaultConstraints: {maxHeight: 0},\n onStageEndpoints: []\n };\n\n for(const entry of this.description.entries) {\n if(entry.direction !== 'recvonly' || entry.type !== 'video') {\n continue;\n }\n\n const {endpoint} = entry;\n obj.onStageEndpoints.push(endpoint);\n obj.constraints[endpoint] = {\n minHeight: 180,\n maxHeight: 720\n };\n }\n\n this.sendDataChannelData(obj);\n\n if(!obj.onStageEndpoints.length) {\n if(this.updateConstraintsInterval) {\n clearInterval(this.updateConstraintsInterval);\n this.updateConstraintsInterval = undefined;\n }\n } else if(!this.updateConstraintsInterval) {\n this.updateConstraintsInterval = window.setInterval(this.maybeUpdateRemoteVideoConstraints.bind(this), 5000);\n }\n }\n\n public addInputVideoStream(stream: MediaStream) {\n // const {sources} = this;\n // if(sources?.video) {\n // const source = this.sources.video.source;\n // stream.source = '' + source;\n this.groupCall.saveInputVideoStream(stream, this.type);\n // }\n\n this.streamManager.addStream(stream, 'input');\n this.appendStreamToConference(); // replace sender track\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {DataJSON} from '../../../layer';\nimport {JoinGroupCallJsonPayload} from '../../appManagers/appGroupCallsManager';\nimport SDP from '../sdp';\nimport {Ssrc} from '../types';\nimport parseMediaSectionInfo from './parseMediaSectionInfo';\n\nexport default function processMediaSection(sdp: SDP, media: SDP['media'][0]) {\n const sectionInfo = parseMediaSectionInfo(sdp, media);\n\n const mediaType: Exclude = media.mediaType as any;\n const entry: Ssrc = {\n source: sectionInfo.source,\n sourceGroups: sectionInfo.sourceGroups,\n type: mediaType\n };\n\n // do not change this value, otherwise onconnectionstatechange won't fire\n sectionInfo.fingerprint.setup = 'active';\n const payload: JoinGroupCallJsonPayload = {\n 'fingerprints': [sectionInfo.fingerprint],\n 'pwd': sectionInfo.pwd,\n 'ssrc': sectionInfo.source,\n 'ssrc-groups': sectionInfo.sourceGroups || [],\n 'ufrag': sectionInfo.ufrag\n };\n const paramsDataJson = JSON.stringify(payload);\n\n const params: DataJSON = {\n _: 'dataJSON',\n data: paramsDataJson\n };\n\n return {\n params,\n source: sectionInfo.source,\n media,\n sourceGroups: sectionInfo.sourceGroups,\n entry\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport forEachReverse from '../../../helpers/array/forEachReverse';\nimport SDPMediaSection from '../sdp/mediaSection';\nimport {UpdateGroupCallConnectionData, Codec} from '../types';\n\nexport default function filterServerCodecs(mainChannels: SDPMediaSection[], data: UpdateGroupCallConnectionData) {\n // ! Need to filter server's extmap for Firefox\n const performExtmap = (channel: typeof mainChannels[0]) => {\n const out: {[id: string]: string} = {};\n const extmap = channel.attributes.get('extmap');\n extmap.forEach((extmap) => {\n const id = extmap.key.split('/', 1)[0];\n out[id] = extmap.value;\n });\n\n return out;\n };\n\n const codecsToPerform: [Codec, 'audio' | 'video'][] = /* flatten([data, dataPresentation].filter(Boolean).map((data) => {\n return */['audio' as const, 'video' as const].filter((type) => data[type]).map((type) => ([data[type], type]));\n // }));\n\n codecsToPerform.forEach(([codec, type]) => {\n const channel = mainChannels.find((line) => line.mediaType === type);\n if(!channel) {\n return;\n }\n\n const extmap = performExtmap(channel);\n forEachReverse(codec['rtp-hdrexts'], (value, index, arr) => {\n if(extmap[value.id] !== value.uri) {\n arr.splice(index, 1);\n console.log(`[sdp] filtered extmap:`, value, index, type);\n }\n });\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport forEachReverse from '../../../helpers/array/forEachReverse';\nimport copy from '../../../helpers/object/copy';\nimport {ConferenceEntry} from '../localConferenceDescription';\nimport {parseSdp, addSimulcast} from '../sdp/utils';\nimport {generateMediaFirstLine, SDPBuilder} from '../sdpBuilder';\nimport {UpdateGroupCallConnectionData} from '../types';\nimport parseMediaSectionInfo from './parseMediaSectionInfo';\n\nexport default function fixLocalOffer(options: {\n offer: RTCSessionDescriptionInit,\n data: UpdateGroupCallConnectionData,\n skipAddingMulticast?: boolean\n // mids?: string[]\n}) {\n const {offer, data} = options;\n const sdp = parseSdp(offer.sdp);\n let hasMunged = false;\n\n if(!options.skipAddingMulticast) {\n hasMunged = addSimulcast(sdp) || hasMunged;\n }\n\n // const bundleLine = parsedSdp.session.lines.find((line) => line.Ha?.key === 'group');\n // const bundleMids = bundleLine.value.split(' ').slice(1);\n\n forEachReverse(sdp.media, (section, idx, arr) => {\n // const mid = section.oa.get('mid').oa;\n\n // это может случиться при выключении и включении видео. почему-то появится секция уже удалённая\n // ! нельзя тут модифицировать локальное описание, будет критовать\n /* if(mids && !mids.includes(mid) && !bundleMids.includes(mid)) {\n console.error('wtf');\n hasMunged = true;\n arr.splice(idx, 1);\n return;\n } */\n\n if(/* section.mediaType !== 'video' || */section.isSending) {\n return;\n }\n\n if(section.mediaType === 'application') {\n return;\n }\n\n const mediaLine = section.mediaLine;\n const mediaLineParts = mediaLine.mediaLineParts;\n const mediaCodecIds = mediaLineParts.ids;\n const localMLine = mediaLine.toString();\n\n const codec = data[section.mediaType];\n const payloadTypes = codec['payload-types'];\n\n /* forEachReverse(payloadTypes, (payloadType, idx, arr) => {\n if(!mediaCodecIds.includes('' + payloadType.id) && section.mediaType === 'video') {\n // if(payloadType.name === 'H265') {\n console.warn('[sdp] filtered unsupported codec', payloadType, mediaCodecIds, section.mediaType);\n arr.splice(idx, 1);\n }\n }); */\n\n const codecIds = payloadTypes.map((payload) => '' + payload.id);\n const correctMLine = generateMediaFirstLine(section.mediaType, undefined, codecIds);\n\n if(localMLine !== correctMLine) {\n const sectionInfo = parseMediaSectionInfo(sdp, section);\n\n const newData = {...data};\n newData.transport = copy(newData.transport);\n newData.transport.ufrag = sectionInfo.ufrag;\n newData.transport.pwd = sectionInfo.pwd;\n newData.transport.fingerprints = [sectionInfo.fingerprint];\n newData.transport.candidates = [];\n\n const entry = new ConferenceEntry(sectionInfo.mid, mediaLineParts.type);\n entry.setPort(mediaLineParts.port);\n sectionInfo.source && entry.setSource(sectionInfo.sourceGroups || sectionInfo.source);\n entry.setDirection(section.direction);\n\n const newSdp = new SDPBuilder().addSsrcEntry(entry, newData).finalize();\n\n const newChannel = parseSdp(newSdp).media[0];\n arr[idx] = newChannel;\n\n hasMunged = true;\n }\n });\n\n if(hasMunged) {\n const mungedSdp = sdp.toString();\n offer.sdp = mungedSdp;\n }\n\n return {offer, sdp/* , bundleMids */};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {GroupCallConnectionType, GroupCallId, GroupCallOutputSource} from '../appManagers/appGroupCallsManager';\nimport {IS_SAFARI} from '../../environment/userAgent';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport throttle from '../../helpers/schedulers/throttle';\nimport {GroupCall, GroupCallParticipant} from '../../layer';\nimport {logger} from '../logger';\nimport {NULL_PEER_ID} from '../mtproto/mtproto_config';\nimport rootScope from '../rootScope';\nimport CallInstanceBase, {TryAddTrackOptions} from './callInstanceBase';\nimport GroupCallConnectionInstance from './groupCallConnectionInstance';\nimport GROUP_CALL_STATE from './groupCallState';\nimport getScreenConstraints from './helpers/getScreenConstraints';\nimport getScreenStream from './helpers/getScreenStream';\nimport getStream from './helpers/getStream';\nimport getVideoConstraints from './helpers/getVideoConstraints';\nimport stopTrack from './helpers/stopTrack';\nimport localConferenceDescription from './localConferenceDescription';\nimport {WebRTCLineType} from './sdpBuilder';\nimport StreamManager from './streamManager';\nimport {Ssrc} from './types';\nimport getPeerId from '../appManagers/utils/peers/getPeerId';\nimport {AppManagers} from '../appManagers/managers';\nimport {generateSelfVideo, makeSsrcFromParticipant, makeSsrcsFromParticipant} from './groupCallsController';\n\nexport default class GroupCallInstance extends CallInstanceBase<{\n state: (state: GROUP_CALL_STATE) => void,\n pinned: (source?: GroupCallOutputSource) => void,\n}> {\n public id: GroupCallId;\n public chatId: ChatId;\n public handleUpdateGroupCallParticipants: boolean;\n public updatingSdp: boolean;\n public isSpeakingMap: Map;\n public connections: {[k in GroupCallConnectionType]?: GroupCallConnectionInstance};\n public groupCall: GroupCall;\n public participant: GroupCallParticipant;\n\n // will be set with negotiation\n public joined: boolean;\n\n private pinnedSources: Array;\n private participantsSsrcs: Map;\n private hadAutoPinnedSources: Set;\n private dispatchPinnedThrottled: () => void;\n private startVideoSharingPromise: Promise;\n private startScreenSharingPromise: Promise;\n\n private managers: AppManagers;\n\n constructor(options: {\n id: GroupCallInstance['id'],\n chatId: GroupCallInstance['chatId'],\n isSpeakingMap?: GroupCallInstance['isSpeakingMap'],\n connections?: GroupCallInstance['connections'],\n managers: AppManagers\n }) {\n super();\n\n safeAssign(this, options);\n\n if(!this.log) {\n this.log = logger('GROUP-CALL');\n }\n\n if(!this.connections) {\n this.connections = {};\n }\n\n if(!this.isSpeakingMap) {\n this.isSpeakingMap = new Map();\n }\n\n this.pinnedSources = [];\n this.participantsSsrcs = new Map();\n this.hadAutoPinnedSources = new Set();\n this.dispatchPinnedThrottled = throttle(() => {\n this.dispatchEvent('pinned', this.pinnedSource);\n }, 0, false);\n\n this.addEventListener('state', (state) => {\n if(state === GROUP_CALL_STATE.CLOSED) {\n this.cleanup();\n }\n });\n }\n\n get connectionState() {\n return this.connections.main.connection.iceConnectionState;\n }\n\n get state() {\n const {connectionState} = this;\n if(connectionState === 'closed') {\n return GROUP_CALL_STATE.CLOSED;\n } else if(connectionState !== 'connected' && (!IS_SAFARI || connectionState !== 'completed')) {\n return GROUP_CALL_STATE.CONNECTING;\n } else {\n const {participant} = this;\n if(!participant.pFlags.can_self_unmute) {\n return GROUP_CALL_STATE.MUTED_BY_ADMIN;\n } else if(participant.pFlags.muted) {\n return GROUP_CALL_STATE.MUTED;\n } else {\n return GROUP_CALL_STATE.UNMUTED;\n }\n }\n }\n\n get participants() {\n return this.managers.appGroupCallsManager.getCachedParticipants(this.id);\n }\n\n get isSharingScreen() {\n return !!this.connections.presentation;\n }\n\n get pinnedSource() {\n return this.pinnedSources[this.pinnedSources.length - 1];\n }\n\n public get isMuted() {\n return this.state !== GROUP_CALL_STATE.UNMUTED;\n }\n\n public get isClosing() {\n const {state} = this;\n return state === GROUP_CALL_STATE.CLOSED;\n }\n\n public get streamManager(): StreamManager {\n return this.connections.main.streamManager;\n }\n\n public get description(): localConferenceDescription {\n return this.connections.main.description;\n }\n\n public pinSource(source: GroupCallOutputSource) {\n indexOfAndSplice(this.pinnedSources, source);\n this.pinnedSources.push(source);\n this.dispatchPinnedThrottled();\n }\n\n public unpinSource(source: GroupCallOutputSource) {\n this.hadAutoPinnedSources.delete(source);\n indexOfAndSplice(this.pinnedSources, source);\n this.dispatchPinnedThrottled();\n }\n\n public unpinAll() {\n this.pinnedSources.length = 0;\n this.dispatchPinnedThrottled();\n }\n\n public async getParticipantByPeerId(peerId: PeerId) {\n return NULL_PEER_ID === peerId ? this.participant : (await this.participants).get(peerId);\n }\n\n public toggleMuted() {\n return this.requestAudioSource(true).then(() => this.changeUserMuted(NULL_PEER_ID));\n }\n\n public async changeUserMuted(peerId: PeerId, muted?: boolean) {\n const participant = await this.getParticipantByPeerId(peerId);\n if(NULL_PEER_ID === peerId && participant.pFlags.can_self_unmute) {\n muted = muted === undefined ? !participant.pFlags.muted : muted;\n }\n\n return this.editParticipant(participant, {muted});\n }\n\n public getElement(endpoint: GroupCallOutputSource) {\n return super.getElement(endpoint);\n }\n\n public getVideoElementFromParticipantByType(participant: GroupCallParticipant, type: 'video' | 'presentation') {\n let source: GroupCallOutputSource;\n if(participant.pFlags.self) {\n const connectionType: GroupCallConnectionType = type === 'video' ? 'main' : 'presentation';\n source = connectionType;\n } else {\n const codec = participant[type];\n source = codec.source_groups[0].sources[0];\n }\n\n const element = this.getElement(source) as HTMLVideoElement;\n if(!element) return;\n\n const clone = element.cloneNode() as typeof element;\n clone.srcObject = element.srcObject;\n return {video: clone, source};\n }\n\n public createConnectionInstance(options: {\n streamManager: StreamManager,\n type: GroupCallConnectionType,\n options: GroupCallConnectionInstance['options'],\n }) {\n return this.connections[options.type] = new GroupCallConnectionInstance({\n groupCall: this,\n log: this.log.bindPrefix(options.type),\n managers: this.managers,\n ...options\n });\n }\n\n public changeRaiseHand(raise: boolean) {\n return this.editParticipant(this.participant, {raiseHand: raise});\n }\n\n public async startScreenSharingInternal() {\n try {\n const type: GroupCallConnectionType = 'presentation';\n\n const stream = await getScreenStream(getScreenConstraints());\n const streamManager = new StreamManager();\n\n const connectionInstance = this.createConnectionInstance({\n streamManager,\n type,\n options: {\n type\n }\n });\n\n const connection = connectionInstance.createPeerConnection();\n connection.addEventListener('negotiationneeded', () => {\n connectionInstance.negotiate();\n });\n\n stream.getVideoTracks()[0].addEventListener('ended', () => {\n if(this.connections.presentation) { // maybe user has stopped screensharing through browser's ui\n this.stopScreenSharing();\n }\n }, {once: true});\n\n connectionInstance.createDescription();\n connectionInstance.addInputVideoStream(stream);\n } catch(err) {\n this.log.error('start screen sharing error', err);\n }\n }\n\n public startScreenSharing() {\n return this.startScreenSharingPromise ??= this.startScreenSharingInternal().finally(() => {\n this.startScreenSharingPromise = undefined;\n });\n }\n\n public stopScreenSharing() {\n const connectionInstance = this.connections.presentation;\n if(!connectionInstance) {\n return Promise.resolve();\n }\n\n delete this.connections.presentation;\n this.unpinSource('presentation');\n connectionInstance.closeConnectionAndStream(true);\n\n delete this.participant.presentation;\n this.managers.appGroupCallsManager.saveApiParticipant(this.id, this.participant);\n\n return this.managers.appGroupCallsManager.leaveGroupCallPresentation(this.id);\n }\n\n public toggleScreenSharing() {\n if(this.isSharingScreen) {\n return this.stopScreenSharing();\n } else {\n return this.startScreenSharing();\n }\n }\n\n public async startVideoSharingInternal() {\n const constraints: MediaStreamConstraints = {\n video: getVideoConstraints()\n };\n\n try {\n const stream = await getStream(constraints, false);\n const connectionInstance = this.connections.main;\n connectionInstance.addInputVideoStream(stream);\n\n await this.editParticipant(this.participant, {\n videoPaused: false,\n videoStopped: false\n });\n } catch(err) {\n this.log.error('startVideoSharing error', err, constraints);\n }\n }\n\n public startVideoSharing() {\n return this.startVideoSharingPromise ??= this.startVideoSharingInternal().finally(() => {\n this.startVideoSharingPromise = undefined;\n });\n }\n\n public async stopVideoSharing() {\n const connectionInstance = this.connections.main;\n const track = connectionInstance.streamManager.inputStream.getVideoTracks()[0];\n if(!track) {\n return;\n }\n\n stopTrack(track);\n connectionInstance.streamManager.appendToConference(connectionInstance.description); // clear sender track\n\n await this.editParticipant(this.participant, {\n videoStopped: true\n });\n }\n\n public toggleVideoSharing() {\n if(this.isSharingVideo) {\n return this.stopVideoSharing();\n } else {\n return this.startVideoSharing();\n }\n }\n\n public async hangUp(discard = false, rejoin = false, isDiscarded = false) {\n for(const type in this.connections) {\n const connection = this.connections[type as GroupCallConnectionType];\n connection.closeConnectionAndStream(!rejoin);\n }\n\n this.dispatchEvent('state', this.state);\n\n if(isDiscarded) {\n return;\n }\n\n if(!rejoin) {\n const d = discard || (this.joined ? this.connections.main.sources.audio.source : undefined);\n this.managers.appGroupCallsManager.hangUp(this.id, d);\n }\n }\n\n public tryAddTrack(options: Omit) {\n const {description} = this;\n const source = super.tryAddTrack(options);\n\n if(options.type === 'output') {\n const entry = description.getEntryBySource(+source);\n this.getParticipantByPeerId(entry.peerId).then((participant) => {\n if(participant) {\n rootScope.dispatchEvent('group_call_participant', {groupCallId: this.id, participant});\n }\n });\n }\n\n return source;\n }\n\n public async editParticipant(participant: GroupCallParticipant, options: Partial<{\n muted: boolean,\n volume: number,\n raiseHand: boolean,\n videoStopped: boolean,\n videoPaused: boolean,\n presentationPaused: boolean\n }>) {\n if(!Object.keys(options).length) {\n return;\n }\n\n // let processUpdate = true;\n if(participant) {\n // const {currentGroupCall} = this;\n // const isCurrentCall = currentGroupCall?.id === groupCallId;\n const isCurrentCall = true;\n const isUpdatingMeInCurrentCall = isCurrentCall && participant.pFlags.self;\n\n if(isUpdatingMeInCurrentCall) {\n if(options.muted !== undefined && !this.isSharingAudio) {\n delete options.muted;\n\n if(!Object.keys(options).length) {\n return;\n }\n }\n }\n\n // if(isCurrentCall) {\n const muted = options.muted;\n if(muted !== undefined) {\n /* const isAdmin = appChatsManager.hasRights(currentGroupCall.chatId, 'manage_call');\n if(isAdmin) {\n if(muted) {\n participant.pFlags.muted = true;\n delete participant.pFlags.can_self_unmute;\n } else {\n participant.pFlags.can_self_unmute = true;\n }\n } else */if(participant.pFlags.self) {\n if(muted) {\n participant.pFlags.muted = true;\n } else if(participant.pFlags.can_self_unmute) {\n delete participant.pFlags.muted;\n }\n }/* else {\n if(muted) {\n participant.pFlags.muted_by_you = true;\n } else {\n delete participant.pFlags.muted_by_you;\n }\n } */\n }\n // }\n\n /* const a: [keyof GroupCallParticipant['pFlags'], keyof typeof options][] = [\n ['muted', 'muted']\n ];\n\n a.forEach(([key, optionKey]) => {\n const value = options[optionKey];\n if(value === undefined) {\n return;\n }\n\n if(value) {\n participant.pFlags[key] = true;\n } else {\n delete participant.pFlags[key];\n }\n }); */\n\n if(options.raiseHand !== undefined) {\n if(options.raiseHand) participant.raise_hand_rating = '1';\n else delete participant.raise_hand_rating;\n }\n\n if(isUpdatingMeInCurrentCall) {\n if(options.videoStopped !== undefined) {\n if(options.videoStopped) delete participant.video;\n else participant.video = generateSelfVideo(this.connections.main.sources.video);\n }\n\n if(!participant.pFlags.muted && participant.pFlags.can_self_unmute) {\n this.setMuted(false);\n }\n\n this.dispatchEvent('state', this.state);\n }\n\n // rootScope.dispatchEvent('group_call_participant', {groupCallId, participant});\n\n /* if(participant.pFlags.self) {\n processUpdate = false;\n } */\n }\n\n return this.managers.appGroupCallsManager.editParticipant(this.id, participant, options);\n }\n\n public onParticipantUpdate(participant: GroupCallParticipant, doNotDispatchParticipantUpdate?: PeerId) {\n const connectionInstance = this.connections.main;\n const {connection, description} = connectionInstance;\n\n const peerId = getPeerId(participant.peer);\n const hasLeft = !!participant.pFlags.left;\n const oldSsrcs = this.participantsSsrcs.get(peerId) || [];\n\n if(participant.presentation && !hasLeft) {\n const {source} = makeSsrcFromParticipant(participant, 'video', participant.presentation.source_groups, participant.presentation.endpoint);\n if(!this.hadAutoPinnedSources.has(source)) {\n this.hadAutoPinnedSources.add(source);\n this.pinSource(participant.pFlags.self ? 'presentation' : source);\n }\n }\n\n if(participant.pFlags.self) {\n this.participant = participant;\n\n if(connectionInstance.sources.audio.source !== participant.source) {\n this.hangUp();\n }\n\n let mute = false;\n if(!participant.pFlags.can_self_unmute) {\n this.stopScreenSharing();\n this.stopVideoSharing();\n mute = true;\n } else if(participant.pFlags.muted) {\n mute = true;\n }\n\n if(mute) {\n this.setMuted(true);\n }\n\n if(doNotDispatchParticipantUpdate !== peerId) {\n this.dispatchEvent('state', this.state);\n }\n\n return;\n }\n\n const ssrcs = hasLeft ? [] : makeSsrcsFromParticipant(participant);\n\n if(!hasLeft) {\n this.participantsSsrcs.set(peerId, ssrcs);\n } else {\n this.participantsSsrcs.delete(peerId);\n }\n\n // const TEST_OLD = false;\n\n const modifiedTypes: Set = new Set();\n oldSsrcs.forEach((oldSsrc) => {\n const oldSource = oldSsrc.source;\n const newSsrc = ssrcs.find((ssrc) => ssrc.source === oldSource);\n if(!newSsrc) {\n this.unpinSource(oldSource);\n\n const oldEntry = description.getEntryBySource(oldSource);\n if(oldEntry && oldEntry.direction !== 'inactive') {\n oldEntry.setDirection('inactive');\n modifiedTypes.add(oldEntry.type);\n }\n }\n });\n\n ssrcs.forEach((ssrc) => {\n let entry = description.getEntryBySource(ssrc.source);\n if(entry) {\n if(entry.direction === 'inactive') {\n entry.setDirection(entry.originalDirection);\n modifiedTypes.add(entry.type);\n }\n\n return;\n }\n\n entry = description.createEntry(ssrc.type);\n description.setEntrySource(entry, ssrc.sourceGroups || ssrc.source);\n description.setEntryPeerId(entry, peerId);\n\n // if(TEST_OLD) {\n // description.bundleMids.push(entry.mid);\n // entry.setDirection('recvonly');\n // } else {\n ssrc.type === 'video' && entry.setEndpoint(ssrc.endpoint);\n entry.createTransceiver(connection, {direction: 'recvonly'});\n // }\n\n modifiedTypes.add(entry.type);\n });\n\n /* if(TEST_OLD) {\n this.setRemoteOffer({\n connection,\n description,\n ssrcs\n });\n } else */if(modifiedTypes.size) {\n if(modifiedTypes.has('video')) {\n connectionInstance.updateConstraints = true;\n }\n\n connectionInstance.negotiateThrottled();\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nenum GROUP_CALL_STATE {\n UNMUTED,\n MUTED,\n MUTED_BY_ADMIN,\n CONNECTING,\n CLOSED\n}\n\nexport default GROUP_CALL_STATE;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport AudioAssetPlayer from '../../helpers/audioAssetPlayer';\n\nexport type GroupCallAudioAssetName = 'group_call_connect.mp3' | 'group_call_end.mp3' | 'group_call_start.mp3' | 'voip_onallowtalk.mp3';\n\nlet audioAsset: AudioAssetPlayer;\nexport default function getGroupCallAudioAsset() {\n return audioAsset ??= new AudioAssetPlayer([\n 'group_call_connect.mp3',\n 'group_call_end.mp3',\n 'group_call_start.mp3',\n 'voip_onallowtalk.mp3'\n ]);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport getGroupCallAudioAsset from '../../components/groupCall/getAudioAsset';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport {GroupCallParticipant, GroupCallParticipantVideo, GroupCallParticipantVideoSourceGroup} from '../../layer';\nimport {GroupCallId, GroupCallConnectionType} from '../appManagers/appGroupCallsManager';\nimport {AppManagers} from '../appManagers/managers';\nimport {logger} from '../logger';\nimport rootScope from '../rootScope';\nimport GroupCallInstance from './groupCallInstance';\nimport GROUP_CALL_STATE from './groupCallState';\nimport createMainStreamManager from './helpers/createMainStreamManager';\nimport {generateSsrc} from './localConferenceDescription';\nimport {WebRTCLineType} from './sdpBuilder';\nimport StreamManager from './streamManager';\nimport {Ssrc} from './types';\n\nconst IS_MUTED = true;\n\nexport function makeSsrcsFromParticipant(participant: GroupCallParticipant) {\n return [\n makeSsrcFromParticipant(participant, 'audio', participant.source),\n participant.video?.audio_source && makeSsrcFromParticipant(participant, 'audio', participant.video.audio_source),\n participant.video && makeSsrcFromParticipant(participant, 'video', participant.video.source_groups, participant.video.endpoint),\n participant.presentation?.audio_source && makeSsrcFromParticipant(participant, 'audio', participant.presentation.audio_source),\n participant.presentation && makeSsrcFromParticipant(participant, 'video', participant.presentation.source_groups, participant.presentation.endpoint)\n ].filter(Boolean);\n};\n\nexport function makeSsrcFromParticipant(participant: GroupCallParticipant, type: WebRTCLineType, source?: number | GroupCallParticipantVideoSourceGroup[], endpoint?: string): Ssrc {\n return generateSsrc(type, source, endpoint);\n}\n\nexport function generateSelfVideo(source: Ssrc, audioSource?: number): GroupCallParticipantVideo {\n return source && {\n _: 'groupCallParticipantVideo',\n pFlags: {},\n endpoint: '',\n source_groups: source.sourceGroups,\n audio_source: audioSource\n };\n}\n\nexport class GroupCallsController extends EventListenerBase<{\n instance: (instance: GroupCallInstance) => void\n}> {\n private audioAsset: ReturnType;\n private log: ReturnType;\n private currentGroupCall: GroupCallInstance;\n private managers: AppManagers;\n\n public construct(managers: AppManagers) {\n this.managers = managers;\n this.audioAsset = getGroupCallAudioAsset();\n this.log = logger('GCC');\n\n rootScope.addEventListener('group_call_update', (groupCall) => {\n const {currentGroupCall} = this;\n if(currentGroupCall?.id === groupCall.id) {\n currentGroupCall.groupCall = groupCall;\n\n if(groupCall._ === 'groupCallDiscarded') {\n currentGroupCall.hangUp(false, false, true);\n }\n }\n });\n\n rootScope.addEventListener('group_call_participant', ({groupCallId, participant}) => {\n const {currentGroupCall} = this;\n if(currentGroupCall?.id === groupCallId) {\n currentGroupCall.onParticipantUpdate(participant/* , this.doNotDispatchParticipantUpdate */);\n }\n });\n }\n\n get groupCall() {\n return this.currentGroupCall;\n }\n\n public setCurrentGroupCall(groupCall: GroupCallInstance) {\n this.currentGroupCall = groupCall;\n\n if(groupCall) {\n this.dispatchEvent('instance', groupCall);\n }\n }\n\n public startConnectingSound() {\n this.stopConnectingSound();\n this.audioAsset.playSoundWithTimeout('group_call_connect.mp3', true, 2500);\n }\n\n public stopConnectingSound() {\n this.audioAsset.stopSound();\n this.audioAsset.cancelDelayedPlay();\n }\n\n public async joinGroupCall(chatId: ChatId, groupCallId: GroupCallId, muted = IS_MUTED, rejoin?: boolean, joinVideo?: boolean) {\n this.audioAsset.createAudio();\n\n this.log(`joinGroupCall chatId=${chatId} id=${groupCallId} muted=${muted} rejoin=${rejoin}`);\n\n let streamManager: StreamManager;\n if(rejoin) {\n streamManager = this.currentGroupCall.connections.main.streamManager;\n } else {\n streamManager = await createMainStreamManager(muted, joinVideo);\n }\n\n return this.joinGroupCallInternal(chatId, groupCallId, streamManager, muted, rejoin, joinVideo)\n .then(() => {\n // have to refresh participants because of the new connection\n const {currentGroupCall} = this;\n currentGroupCall.participants.then((participants) => {\n if(this.currentGroupCall !== currentGroupCall || currentGroupCall.state === GROUP_CALL_STATE.CLOSED) {\n return;\n }\n\n participants.forEach((participant) => {\n if(!participant.pFlags.self) {\n currentGroupCall.onParticipantUpdate(participant);\n }\n });\n });\n });\n }\n\n private async joinGroupCallInternal(chatId: ChatId, groupCallId: GroupCallId, streamManager: StreamManager, muted: boolean, rejoin = false, joinVideo?: boolean) {\n const log = this.log.bindPrefix('joinGroupCallInternal');\n log('start', groupCallId);\n\n const type: GroupCallConnectionType = 'main';\n\n let {currentGroupCall} = this;\n if(currentGroupCall && rejoin) {\n // currentGroupCall.connections.main.connection = connection;\n currentGroupCall.handleUpdateGroupCallParticipants = false;\n currentGroupCall.updatingSdp = false;\n log('update currentGroupCall', groupCallId, currentGroupCall);\n } else {\n currentGroupCall = new GroupCallInstance({\n chatId,\n id: groupCallId,\n managers: this.managers\n });\n\n currentGroupCall.fixSafariAudio();\n\n currentGroupCall.addEventListener('state', (state) => {\n if(this.currentGroupCall === currentGroupCall && state === GROUP_CALL_STATE.CLOSED) {\n this.setCurrentGroupCall(null);\n this.stopConnectingSound();\n this.audioAsset.playSound('group_call_end.mp3');\n rootScope.dispatchEvent('chat_update', currentGroupCall.chatId);\n }\n });\n\n currentGroupCall.groupCall = await this.managers.appGroupCallsManager.getGroupCallFull(groupCallId);\n\n const connectionInstance = currentGroupCall.createConnectionInstance({\n streamManager,\n type,\n options: {\n type,\n isMuted: muted,\n joinVideo,\n rejoin\n }\n });\n\n const connection = connectionInstance.createPeerConnection();\n connection.addEventListener('negotiationneeded', () => {\n connectionInstance.negotiate();\n });\n\n connection.addEventListener('track', (event) => {\n log('ontrack', event);\n currentGroupCall.onTrack(event);\n });\n\n connection.addEventListener('iceconnectionstatechange', () => {\n currentGroupCall.dispatchEvent('state', currentGroupCall.state);\n\n const {iceConnectionState} = connection;\n if(iceConnectionState === 'disconnected' || iceConnectionState === 'checking' || iceConnectionState === 'new') {\n this.startConnectingSound();\n } else {\n this.stopConnectingSound();\n }\n\n switch(iceConnectionState) {\n case 'checking': {\n break;\n }\n\n case 'closed': {\n currentGroupCall.hangUp();\n break;\n }\n\n case 'completed': {\n break;\n }\n\n case 'connected': {\n if(!currentGroupCall.joined) {\n currentGroupCall.joined = true;\n this.audioAsset.playSound('group_call_start.mp3');\n this.managers.appGroupCallsManager.getGroupCallParticipants(groupCallId);\n }\n\n break;\n }\n\n case 'disconnected': {\n break;\n }\n\n case 'failed': {\n // TODO: replace with ICE restart\n currentGroupCall.hangUp();\n // connection.restartIce();\n break;\n }\n\n case 'new': {\n break;\n }\n }\n });\n\n connectionInstance.createDescription();\n connectionInstance.createDataChannel();\n\n connectionInstance.appendStreamToConference();\n\n this.setCurrentGroupCall(currentGroupCall);\n log('set currentGroupCall', groupCallId, currentGroupCall);\n\n this.startConnectingSound();\n\n return connectionInstance.negotiate();\n }\n }\n}\n\nconst groupCallsController = new GroupCallsController();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.groupCallController = groupCallsController);\nexport default groupCallsController;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {GROUP_CALL_AMPLITUDE_ANALYSE_INTERVAL_MS} from '../constants';\nimport StreamManager from '../streamManager';\nimport getAudioConstraints from './getAudioConstraints';\nimport getStream from './getStream';\nimport getVideoConstraints from './getVideoConstraints';\n\nexport default async function createMainStreamManager(muted?: boolean, joinVideo?: boolean) {\n const constraints: MediaStreamConstraints = {\n audio: getAudioConstraints(),\n video: joinVideo && getVideoConstraints()\n };\n\n const streamManager = new StreamManager(GROUP_CALL_AMPLITUDE_ANALYSE_INTERVAL_MS);\n\n try {\n const stream = await getStream(constraints, muted);\n streamManager.addStream(stream, 'input');\n } catch(err) {\n console.error('joinGroupCall getStream error', err, constraints);\n streamManager.inputStream = new MediaStream();\n }\n\n return streamManager;\n}\n","import constraintSupported, {MyMediaTrackSupportedConstraints} from '../../../environment/constraintSupport';\n\nexport default function getAudioConstraints(): MediaTrackConstraints {\n const constraints: MediaTrackConstraints = {\n channelCount: 2\n };\n\n const desirable: (keyof MyMediaTrackSupportedConstraints)[] = [\n 'noiseSuppression',\n 'echoCancellation',\n 'autoGainControl'\n ];\n\n desirable.forEach((constraint) => {\n if(constraintSupported(constraint)) {\n // @ts-ignore\n constraints[constraint] = true;\n }\n });\n\n return constraints;\n}\n","export type MyMediaTrackSupportedConstraints = MediaTrackSupportedConstraints & {\n noiseSuppression?: boolean,\n autoGainControl?: boolean\n};\n\nexport default function constraintSupported(constraint: keyof MyMediaTrackSupportedConstraints) {\n return (!!navigator?.mediaDevices?.getSupportedConstraints() as any as MyMediaTrackSupportedConstraints)[constraint];\n}\n","export default function getScreenConstraints(skipAudio?: boolean) {\n const constraints: DisplayMediaStreamOptions = {\n video: {\n // @ts-ignore\n // cursor: 'always',\n width: {max: 1920},\n height: {max: 1080},\n frameRate: {max: 30}\n }\n };\n\n if(!skipAudio) {\n constraints.audio = true;\n }\n\n return constraints;\n}\n","export default async function getScreenStream(constraints: DisplayMediaStreamOptions) {\n const screenStream = await navigator.mediaDevices.getDisplayMedia(constraints);\n const track = screenStream.getVideoTracks()[0];\n track.contentHint = 'text';\n return screenStream;\n}\n","export default async function getStream(constraints: MediaStreamConstraints, muted: boolean) {\n // console.log('getStream', constraints);\n\n const stream = await navigator.mediaDevices.getUserMedia(constraints);\n stream.getTracks().forEach((x) => {\n x.enabled = !muted;\n });\n\n // console.log('getStream result', stream);\n return stream;\n}\n\n(window as any).getStream = getStream;\n","export default function getVideoConstraints(): MediaTrackConstraints {\n return {\n width: {min: 1280, max: 1920/* , ideal: 1920 */},\n height: {min: 720, max: 1080/* , ideal: 1080 */},\n frameRate: {min: 24, max: 30}\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport SDP from '../sdp';\nimport SDPMediaSection from '../sdp/mediaSection';\nimport {toTelegramSource} from '../utils';\nimport {parseSourceGroups} from './parseSourceGroups';\n\nexport default function parseMediaSectionInfo(sdp: SDP, channel: SDPMediaSection) {\n const clientInfo = channel.lookupAttributeKeys({\n 'ice-ufrag': true,\n 'ice-pwd': true,\n 'fingerprint': true,\n 'setup': true,\n 'ssrc': true,\n 'mid': true,\n 'ssrc-group': false\n });\n\n if(!clientInfo.fingerprint) { // support Firefox\n const line = sdp.session.lines.find((line) => line.parsed?.key === 'fingerprint');\n clientInfo.fingerprint = line.parsed.value;\n }\n\n const telegramSourceGroups = parseSourceGroups(clientInfo['ssrc-group']);\n const [hash, fingerprint] = clientInfo.fingerprint.split(' ', 2);\n const ssrc = clientInfo.ssrc && toTelegramSource(+clientInfo.ssrc.split(' ', 1)[0]);\n // ssrc = telegramSourceGroups ? telegramSourceGroups[0].sources[0] : ssrc;\n\n return {\n raw: clientInfo,\n ufrag: clientInfo['ice-ufrag'],\n pwd: clientInfo['ice-pwd'],\n fingerprint: {\n fingerprint,\n setup: clientInfo.setup,\n hash\n },\n source: ssrc,\n sourceGroups: telegramSourceGroups,\n mid: clientInfo.mid\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {GroupCallParticipantVideoSourceGroup} from '../../../layer';\nimport {toTelegramSource} from '../utils';\n\nexport function parseSourceGroups(sdpLines: string[]) {\n const telegramSourceGroups = sdpLines.map((str) => {\n const [semantics, ...rest] = str.split(' ');\n\n const sourceGroup: GroupCallParticipantVideoSourceGroup = {\n _: 'groupCallParticipantVideoSourceGroup',\n semantics,\n // sources: rest.map((ssrc) => +ssrc)\n sources: rest.map((ssrc) => toTelegramSource(+ssrc))\n };\n\n return sourceGroup;\n });\n\n /* const simIndex = telegramSourceGroups.findIndex((g) => g.semantics === 'SIM');\n if(simIndex !== -1) {\n const sourceGroup = telegramSourceGroups.splice(simIndex, 1)[0];\n telegramSourceGroups.unshift(sourceGroup);\n } */\n\n return telegramSourceGroups.length ? telegramSourceGroups : undefined;\n}\n","import simulateEvent from '../../../helpers/dom/dispatchEvent';\n\nexport default function stopTrack(track: MediaStreamTrack) {\n track.stop();\n simulateEvent(track, 'ended');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport {GroupCallParticipantVideoSourceGroup} from '../../layer';\nimport {fixMediaLineType, SDPBuilder, WebRTCLineType, WEBRTC_MEDIA_PORT} from './sdpBuilder';\nimport {AudioCodec, GroupCallConnectionTransport, Ssrc, UpdateGroupCallConnectionData, VideoCodec} from './types';\n\nexport class ConferenceEntry {\n public source: number;\n public sourceGroups: GroupCallParticipantVideoSourceGroup[];\n public transceiver: RTCRtpTransceiver;\n public originalDirection: RTCRtpTransceiverDirection;\n public direction: RTCRtpTransceiverDirection;\n public port: string;\n public endpoint: string;\n public peerId: PeerId;\n\n public sendEntry: ConferenceEntry;\n public recvEntry: ConferenceEntry;\n\n constructor(public mid: string, public type: WebRTCLineType) {\n this.port = WEBRTC_MEDIA_PORT;\n }\n\n public setDirection(direction: RTCRtpTransceiverDirection) {\n if(!this.originalDirection) {\n this.originalDirection = direction;\n }\n\n return this.direction = direction;\n }\n\n public setPort(port: string) {\n return this.port = port;\n }\n\n public setEndpoint(endpoint: string) {\n return this.endpoint = endpoint;\n }\n\n public setPeerId(peerId: PeerId) {\n return this.peerId = peerId;\n }\n\n public createTransceiver(connection: RTCPeerConnection, init?: RTCRtpTransceiverInit) {\n if(init?.direction) {\n this.setDirection(init.direction);\n }\n\n return this.transceiver = connection.addTransceiver(fixMediaLineType(this.type), init);\n }\n\n public setSource(source: number | GroupCallParticipantVideoSourceGroup[]) {\n let sourceGroups: GroupCallParticipantVideoSourceGroup[];\n if(Array.isArray(source)) {\n if(!source[0]) return;\n sourceGroups = source;\n source = sourceGroups[0].sources[0];\n }\n\n this.sourceGroups = sourceGroups;\n return this.source = source;\n }\n\n public shouldBeSkipped(isAnswer?: boolean) {\n return isAnswer && this.direction === 'inactive';\n }\n}\n\nexport function generateSsrc(type: WebRTCLineType, source: number | GroupCallParticipantVideoSourceGroup[], endpoint?: string): Ssrc {\n let sourceGroups: GroupCallParticipantVideoSourceGroup[];\n if(Array.isArray(source)) {\n if(!source[0]) return;\n sourceGroups = source;\n source = sourceGroups[0].sources[0];\n }\n\n return {\n endpoint,\n type,\n source,\n sourceGroups\n };\n}\n\nexport default class LocalConferenceDescription implements UpdateGroupCallConnectionData {\n public readonly sessionId: string;\n // public ssrcs: Ssrc[];\n public readonly transport: GroupCallConnectionTransport;\n public readonly audio?: AudioCodec;\n public readonly video: VideoCodec;\n public readonly screencast?: VideoCodec;\n\n private maxSeenId: number;\n public readonly entries: ConferenceEntry[];\n private entriesByMid: Map;\n private entriesBySource: Map;\n private entriesByPeerId: Map>;\n\n constructor(public connection: RTCPeerConnection) {\n this.sessionId = '' + Date.now();\n // this.ssrcs = [];\n this.maxSeenId = -1;\n this.entries = [];\n this.entriesByMid = new Map();\n this.entriesBySource = new Map();\n this.entriesByPeerId = new Map();\n }\n\n public setData(data: UpdateGroupCallConnectionData) {\n return safeAssign(this, data);\n }\n\n public createEntry(type: WebRTCLineType) {\n const mid = '' + ++this.maxSeenId;\n const entry = new ConferenceEntry(mid, type);\n this.entries.push(entry);\n this.entriesByMid.set(mid, entry);\n return entry;\n }\n\n public deleteEntry(entry: ConferenceEntry) {\n indexOfAndSplice(this.entries, entry);\n this.entriesByMid.delete(entry.mid);\n this.entriesBySource.delete(entry.source);\n\n const set = this.entriesByPeerId.get(entry.peerId);\n if(set) {\n set.delete(entry);\n if(!set.size) {\n this.entriesByPeerId.delete(entry.peerId);\n }\n }\n }\n\n public setEntrySource(entry: ConferenceEntry, source: Parameters[0]) {\n entry.setSource(source);\n this.entriesBySource.set(entry.source, entry);\n }\n\n public setEntryPeerId(entry: ConferenceEntry, peerId: ConferenceEntry['peerId']) {\n entry.setPeerId(peerId);\n let set = this.entriesByPeerId.get(peerId);\n if(!set) {\n this.entriesByPeerId.set(peerId, set = new Set());\n }\n\n set.add(entry);\n }\n\n public findEntry(verify: Parameters[0]) {\n return this.entries.find(verify);\n }\n\n public findFreeSendRecvEntry(type: WebRTCLineType, isSending: boolean) {\n let entry = this.entries.find((entry) => {\n return entry.direction === 'sendrecv' && entry.type === type && !(isSending ? entry.sendEntry : entry.recvEntry);\n });\n\n if(!entry) {\n entry = this.createEntry(type);\n entry.setDirection('sendrecv');\n }\n\n return entry;\n }\n\n public getEntryByMid(mid: ConferenceEntry['mid']) {\n return this.entriesByMid.get(mid);\n }\n\n public getEntryBySource(source: ConferenceEntry['source']) {\n return this.entriesBySource.get(source);\n }\n\n public getEntriesByPeerId(peerId: ConferenceEntry['peerId']) {\n return this.entriesByPeerId.get(peerId);\n }\n\n public generateSdp(options: Omit[0], 'conference'>) {\n return SDPBuilder.fromConference({\n conference: this,\n ...options\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport SDPMediaSection from './mediaSection';\nimport SDPSessionSection from './sessionSection';\n\nexport type AttributeKey = 'group' | 'rtcp' | 'ice-ufrag' |\n 'ice-pwd' | 'ice-options' | 'fingerprint' | 'setup' |\n 'mid' | 'extmap' | 'sendonly' | 'msid' | 'rtcp-mux' |\n 'rtpmap' | 'rtcp-fb' | 'fmtp' | 'ssrc' | 'ssrc-group' |\n 'extmap-allow-mixed' | 'msid-semantic';\n\nexport type AttributeMap = {[k in AttributeKey]?: boolean};\n\nexport default class SDP {\n #session: SDPSessionSection;\n #media: SDPMediaSection[];\n\n constructor(session: SDP['session'], mediaSections: SDP['media']) {\n this.#session = session;\n this.#media = mediaSections;\n }\n\n public get session() {\n return this.#session;\n }\n\n public get media() {\n return this.#media;\n }\n\n public get bundle() {\n const bundleLine = this.session.lines.find((line) => line.parsed?.key === 'group');\n return bundleLine.value.split(' ').slice(1);\n }\n\n toString() {\n return this.session.lines\n .concat(...this.media.map((section) => section.lines))\n .map((line) => line.toString()).join('\\r\\n') + '\\r\\n';\n }\n\n /* get buggedMedia() {\n const bundle = this.bundle;\n type A = {\n mid: SDPMediaSection['mid'],\n mediaType: SDPMediaSection['mediaType'],\n direction: SDPMediaSection['direction']\n };\n const out: A[] = [];\n for(let i = 0, length = this.media.length; i < length; ++i) {\n const section = this.media[i];\n const mid = section.mid;\n if(!bundle.includes(mid)) {\n out.push(section);\n }\n }\n\n return out;\n } */\n\n /* get mediaTypes() {\n return this.media.map((section) => {\n return {mid: section.oa.get('mid').oa, type: section.mediaType, direction: section.direction};\n });\n } */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function splitStringByLimitWithRest(str: string, separator: string, limit: number) {\n const splitted = str.split(separator);\n const out: string[] = [];\n\n while(limit > 0 && splitted.length) {\n out.push(splitted.shift());\n --limit;\n }\n\n if(splitted.length) {\n out.push(splitted.join(separator));\n }\n\n return out;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default class UniqueNumberGenerator {\n #set: Set;\n #min: number;\n #max: number;\n\n constructor(min: number, max: number) {\n this.#set = new Set();\n this.#min = min;\n this.#max = max;\n }\n\n public generate() {\n const min = this.#min;\n const max = this.#max;\n const set = this.#set;\n\n const maxTries = max - min + 1;\n let value = Math.floor(min + maxTries * Math.random()), _try = 0;\n while(set.has(value)) {\n if(value < max) {\n ++value;\n } else {\n value = min;\n }\n\n if(++_try >= maxTries) {\n return null;\n }\n }\n\n set.add(value);\n return value;\n }\n\n public add(value: number) {\n this.#set.add(value);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AttributeKey} from '.';\n\nexport default class SDPAttributeSplitted {\n #key: AttributeKey;\n #value: string;\n\n // key = 'ssrc-group', value = 'SIM 1 2 3'\n constructor(key: AttributeKey, value: string) {\n this.#key = key;\n this.#value = value;\n }\n\n public get key() {\n return this.#key;\n }\n\n public get value() {\n return this.#value;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default class SDPMediaLineParts {\n #type: 'audio' | 'video' | 'application';\n #port: string;\n #protocol: string;\n #ids: string[];\n\n constructor(\n type: SDPMediaLineParts['type'],\n port: SDPMediaLineParts['port'],\n protocol: SDPMediaLineParts['protocol'],\n ids: SDPMediaLineParts['ids']\n ) {\n this.#type = type;\n this.#port = port;\n this.#protocol = protocol;\n this.#ids = ids;\n }\n\n public get type() {\n return this.#type;\n }\n\n public get port() {\n return this.#port;\n }\n\n public get protocol() {\n return this.#protocol;\n }\n\n public get ids() {\n return this.#ids;\n }\n\n toString() {\n return this.type + ' ' + this.port + ' ' + this.protocol + ' ' + this.ids.join(' ');\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport splitStringByLimitWithRest from '../../../helpers/string/splitStringByLimitWithRest';\nimport SDPAttributeSplitted from './attributeSplitted';\nimport SDPMediaLineParts from './mediaLineParts';\n\nexport default class SDPLine {\n #key: 'm' | 'a' | 'o' | 'v' | 's' | 't' | 'c';\n #value: string;\n #mediaLineParts: SDPMediaLineParts;\n #parsed?: SDPAttributeSplitted;\n\n // key = 'a', value = 'ssrc-group:SIM 1 2 3'\n constructor(key: SDPLine['key'], value: string | SDPMediaLineParts | SDPAttributeSplitted) {\n this.#key = key;\n\n if(typeof(value) === 'string') {\n this.#value = value;\n\n if(key === 'm') {\n const splitted = value.split(' ');\n this.#mediaLineParts = new SDPMediaLineParts(splitted[0] as any, splitted[1], splitted[2], splitted.slice(3));\n } else {\n if(key === 'a') {\n const result = splitStringByLimitWithRest(value, ':', 1);\n value = result[0];\n this.#parsed = result.length === 1 ? new SDPAttributeSplitted(value as any, null) : new SDPAttributeSplitted(value as any, result[1]);\n }\n }\n } else {\n if(value instanceof SDPMediaLineParts) {\n this.#mediaLineParts = value;\n this.#value = value.toString();\n } else if(value instanceof SDPAttributeSplitted) {\n this.#parsed = value;\n this.#value = value.value ? `${value.key}:${value.value}` : value.key;\n }\n }\n }\n\n public get key() {\n return this.#key;\n }\n\n public get value() {\n return this.#value;\n }\n\n public get parsed() {\n return this.#parsed;\n }\n\n public get mediaLineParts() {\n return this.#mediaLineParts;\n }\n\n toString() {\n return `${this.key}=${this.value}`;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport splitStringByLimitWithRest from '../../../helpers/string/splitStringByLimitWithRest';\n\nexport default class SDPAttributeInner {\n #key: string;\n #lines: Array;\n #prefix: string;\n #nestedMap: Map;\n #missed: boolean;\n #keys: Array;\n\n constructor(key: SDPAttributeInner['key'], lines: SDPAttributeInner['lines'], prefix: string = ':', missed = false) {\n this.#key = key;\n this.#lines = lines;\n this.#prefix = prefix;\n this.#missed = missed;\n this.#nestedMap = missed ? new Map() : null;\n this.#keys = missed ? [] : null;\n }\n\n public get lines() {\n return this.#lines;\n }\n\n public get value() {\n return this.#missed || !this.lines.length ? null : this.lines[0];\n }\n\n public get exists() {\n return !this.#missed;\n }\n\n public get key() {\n return this.#key;\n }\n\n public get keys() {\n SDPAttributeInner.fill(this);\n return this.#keys;\n }\n\n public forEach(callback: Parameters['forEach']>[0]) {\n SDPAttributeInner.fill(this);\n this.#nestedMap.forEach(callback);\n }\n\n public get(key: string) {\n SDPAttributeInner.fill(this);\n return this.#nestedMap.get(key) || new SDPAttributeInner(key, [], ':', true);\n }\n\n private static fill(attribute: SDPAttributeInner) {\n if(attribute.#nestedMap !== null) {\n return;\n }\n\n const map: Map> = new Map();\n attribute.lines.forEach((str) => {\n const [key, rest] = splitStringByLimitWithRest(str, attribute.#prefix, 1);\n const values = map.get(key) || [];\n map.set(key, [...values, rest || '']);\n });\n\n const nestedMap = attribute.#nestedMap = SDPAttributeInner.makeAttributes(map);\n attribute.#keys = Array.from(nestedMap.keys());\n }\n\n private static makeAttributes(innerParts: Map>) {\n const out: Map = new Map();\n\n innerParts.forEach((lines, key) => {\n out.set(key, new SDPAttributeInner(key, lines));\n });\n\n return out;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport SDPAttributeInner from './attributeInner';\nimport SDPLine from './line';\n\nexport default class SDPAttributes {\n #lines: SDPLine[];\n #attributes: Map;\n\n constructor(lines: SDPLine[]) {\n this.#lines = lines;\n this.#attributes = new Map();\n SDPAttributes.fillAttributes(this);\n }\n\n public get(key: string) {\n return this.#attributes.get(key) || new SDPAttributeInner(key, [], ' ', true);\n }\n\n private static fillAttributes(attributes: SDPAttributes) {\n const attributesMap: Map> = new Map();\n attributes.#lines.forEach((line) => {\n if(line.key === 'a') {\n const {key, value} = line.parsed;\n\n let linesArray = attributesMap.get(key);\n if(!linesArray) {\n linesArray = [];\n attributesMap.set(key, linesArray);\n }\n\n linesArray.push(value || '');\n }\n });\n\n attributesMap.forEach((linesArray, key) => {\n attributes.#attributes.set(key, new SDPAttributeInner(key, linesArray, ' ', false));\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AttributeMap} from '.';\nimport {NoExtraProperties} from '../../../types';\nimport SDPAttributes from './attributes';\nimport SDPLine from './line';\n\nexport type SDPMediaDirection = 'sendonly' | 'recvonly' | 'inactive' | 'sendrecv';\nexport default class SDPMediaSection {\n #lines: Array;\n #mediaLine: SDPLine;\n #attributes: SDPAttributes;\n #direction: SDPMediaDirection;\n\n constructor(lines: Array) {\n this.#lines = lines;\n this.#mediaLine = lines[0];\n this.#attributes = this.#direction = null;\n }\n\n public get lines() {\n return this.#lines;\n }\n\n public get mediaLine() {\n return this.#mediaLine;\n }\n\n public get mediaLineParts() {\n return this.#mediaLine.mediaLineParts;\n }\n\n public get mediaType() {\n return this.mediaLineParts.type;\n }\n\n public get direction() {\n if(!this.#direction) {\n const attributes = this.attributes;\n\n let direction: SDPMediaDirection;\n if(attributes.get('sendonly').exists) direction = 'sendonly';\n else if(attributes.get('recvonly').exists) direction = 'recvonly';\n else if(attributes.get('inactive').exists) direction = 'inactive';\n else direction = 'sendrecv';\n\n this.#direction = direction;\n }\n\n return this.#direction;\n }\n\n public get isSending() {\n return this.direction === 'sendrecv' || this.direction === 'sendonly';\n }\n\n public get isReceiving() {\n return this.direction === 'sendrecv' || this.direction === 'recvonly';\n }\n\n public get attributes() {\n this.#attributes || (this.#attributes = new SDPAttributes(this.lines));\n return this.#attributes;\n }\n\n public get mid() {\n return this.attributes.get('mid').value;\n }\n\n public lookupAttributeKeys(keys: NoExtraProperties): {[k in keyof T]: T[k] extends true ? string : string[]} {\n const out: any = {};\n\n for(const key in keys) {\n const result = this.attributes.get(key);\n // @ts-ignore\n const resultShouldBeArray = !keys[key];\n if(!result) {\n out[key] = resultShouldBeArray ? [] : undefined;\n } else {\n out[key] = resultShouldBeArray ? result.lines : result.value;\n }\n }\n\n return out;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport SDPLine from './line';\n\nexport default class SDPSessionSection {\n #lines: SDPLine[];\n #sessionId: string;\n\n constructor(lines: SDPLine[]) {\n this.#lines = lines;\n this.#sessionId = lines.filter((line) => line.key === 'o').map((line) => line.value.split(' ')[1])[0];\n }\n\n public get lines() {\n return this.#lines;\n }\n\n public get sessionId() {\n return this.#sessionId;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport SDP from '.';\nimport splitStringByLimitWithRest from '../../../helpers/string/splitStringByLimitWithRest';\nimport UniqueNumberGenerator from '../../../helpers/uniqueNumberGenerator';\nimport SDPLine from './line';\nimport SDPMediaSection from './mediaSection';\nimport SDPSessionSection from './sessionSection';\n\nexport function parseSdp(str: string) {\n function createSection() {\n if(sessionSection) {\n mediaSections.push(new SDPMediaSection(lines));\n } else {\n sessionSection = new SDPSessionSection(lines);\n }\n }\n\n let sessionSection: SDPSessionSection = null, lines: SDPLine[] = [];\n const mediaSections: SDPMediaSection[] = [];\n str.split(/\\r?\\n/).forEach((lineStr) => {\n if(!isIncorrectSdpLine(lineStr)) {\n const line = parseSdpLine(lineStr);\n if(line.key === 'm') {\n createSection();\n lines = [];\n }\n\n lines.push(line);\n }\n });\n\n createSection();\n return new SDP(sessionSection, mediaSections);\n}\n\nexport function isIncorrectSdpLine(str: string) {\n return /^[\\s\\xa0]*$/.test(str);\n}\n\nexport function parseSdpLine(str: string) {\n const splitted = splitStringByLimitWithRest(str, '=', 1);\n return new SDPLine(splitted[0] as any, splitted[1]);\n}\n\nexport function addSimulcast(sdp: SDP) {\n let generator: UniqueNumberGenerator;\n sdp.media.forEach((section, idx) => {\n if(section.mediaType === 'video' && section.isSending && !section.attributes.get('ssrc-group').get('SIM').exists) {\n if(!generator) {\n generator = new UniqueNumberGenerator(2, 4294967295);\n }\n\n const originalSsrcs = section.attributes.get('ssrc-group').get('FID').value.split(' ');\n const lines = section.lines;\n originalSsrcs.forEach((ssrc) => generator.add(+ssrc)); // fix possible duplicates\n const ssrcs = [originalSsrcs[0], generator.generate(), generator.generate()];\n const ssrcs2 = [originalSsrcs[1], generator.generate(), generator.generate()];\n\n lines.push(parseSdpLine('a=ssrc-group:SIM ' + ssrcs.join(' ')));\n\n const ssrcsStrLines = section.attributes.get('ssrc').get(originalSsrcs[0]).lines;\n\n ssrcs.forEach((ssrc, idx) => {\n const ssrc2 = ssrcs2[idx];\n if(idx > 0) {\n lines.push(parseSdpLine('a=ssrc-group:FID ' + ssrc + ' ' + ssrc2));\n\n ssrcsStrLines.forEach((v) => {\n lines.push(parseSdpLine('a=ssrc:' + ssrc + ' ' + v));\n });\n\n ssrcsStrLines.forEach((v) => {\n lines.push(parseSdpLine('a=ssrc:' + ssrc2 + ' ' + v));\n });\n }\n });\n\n sdp.media[idx] = new SDPMediaSection(lines);\n }\n });\n\n return !!generator;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport {IS_FIREFOX} from '../../environment/userAgent';\nimport LocalConferenceDescription, {ConferenceEntry} from './localConferenceDescription';\nimport StringFromLineBuilder from './stringFromLineBuilder';\nimport {GroupCallConnectionTransport, PayloadType, UpdateGroupCallConnectionData} from './types';\nimport {fromTelegramSource} from './utils';\n\n// screencast is for Peer-to-Peer only\nexport type WebRTCLineTypeTrue = 'video' | 'audio' | 'application';\nexport type WebRTCLineType = WebRTCLineTypeTrue | 'screencast';\n\nexport const WEBRTC_MEDIA_PORT = '9';\n\nexport function fixMediaLineType(mediaType: WebRTCLineType) {\n return mediaType === 'screencast' ? 'video' : mediaType;\n}\n\nexport function performCandidate(c: GroupCallConnectionTransport['candidates'][0]) {\n const arr: string[] = [];\n arr.push('a=candidate:');\n arr.push(`${c.foundation} ${c.component} ${c.protocol.toUpperCase()} ${c.priority} ${c.ip} ${c.port} typ ${c.type}`);\n if(c['rel-addr'] !== undefined) {\n arr.push(` raddr ${c['rel-addr']} rport ${c['rel-port']}`);\n }\n arr.push(` generation ${c.generation}`);\n return arr.join('');\n}\n\nexport function getConnectionTypeForMediaType(mediaType: WebRTCLineType) {\n // return mediaType === 'application' ? 'DTLS/SCTP' : 'RTP/SAVPF';\n return mediaType === 'application' ? 'DTLS/SCTP' : 'UDP/TLS/RTP/SAVPF';\n}\n\nexport function generateMediaFirstLine(mediaType: WebRTCLineType, port = WEBRTC_MEDIA_PORT, payloadIds: (string | number)[]) {\n const connectionType = getConnectionTypeForMediaType(mediaType);\n return `m=${fixMediaLineType(mediaType)} ${port} ${connectionType} ${payloadIds.join(' ')}`;\n}\n\ntype ConferenceData = UpdateGroupCallConnectionData | LocalConferenceDescription;\n\n// https://tools.ietf.org/id/draft-ietf-rtcweb-sdp-08.html\n// https://datatracker.ietf.org/doc/html/draft-roach-mmusic-unified-plan-00\nexport class SDPBuilder extends StringFromLineBuilder {\n public addCandidate(c: GroupCallConnectionTransport['candidates'][0]) {\n return this.add(performCandidate(c));\n }\n\n /* public addDataChannel(mid: string, transport: GroupCallConnectionTransport, isAnswer?: boolean) {\n this.add(\n 'm=application 9 UDP/DTLS/SCTP webrtc-datachannel',\n 'c=IN IP4 0.0.0.0',\n 'a=ice-options:trickle',\n `a=mid:${mid}`\n );\n\n // if(!isAnswer) {\n this.add('a=sendrecv');\n // }\n\n this.addTransport(transport, isAnswer);\n\n return this.add(\n 'a=sctp-port:5000',\n 'a=max-message-size:262144'\n );\n } */\n\n public addHeader(sId: string, bundleMids: string[]) {\n const bundle = bundleMids.join(' ');\n return this.add(\n 'v=0', // version\n `o=- ${sId} 2 IN IP4 0.0.0.0`, // sessionId, 2=sessionVersion\n 's=-', // name of the session\n 't=0 0', // time when session is valid\n 'a=extmap-allow-mixed',\n `a=group:BUNDLE ${bundle}`,\n 'a=ice-options:trickle',\n // 'a=ice-lite', // ice-lite: is a minimal version of the ICE specification, intended for servers running on a public IP address.\n 'a=msid-semantic:WMS *'\n );\n }\n\n public addTransport(transport: GroupCallConnectionTransport, skipCandidates?: boolean) {\n this.add(\n `a=ice-ufrag:${transport.ufrag}`,\n `a=ice-pwd:${transport.pwd}`,\n 'a=ice-options:trickle' // ! test\n );\n\n for(const fingerprint of transport.fingerprints) {\n this.add(\n `a=fingerprint:${fingerprint.hash} ${fingerprint.fingerprint}`,\n `a=setup:${fingerprint.setup}`\n );\n }\n\n if(!skipCandidates && transport.candidates) {\n for(const candidate of transport.candidates) {\n this.addCandidate(candidate);\n }\n }\n\n return this;\n }\n\n public addSsrc(entry: ConferenceEntry) {\n let streamName = 'stream';\n let {type, sourceGroups} = entry;\n\n // let source = ssrc.source ?? ssrc.sourceGroups[0].sources[0];\n // source = fromTelegramSource(source);\n const source = fromTelegramSource(entry.source);\n\n streamName += source;\n type += source as any;\n\n // streamName += mid;\n // type += mid as any;\n\n // streamName = type = entry.transceiver.receiver.track.id as any;\n\n const addMsid = () => {\n this.add(`a=msid:${streamName} ${type}`);\n };\n\n const addSource = (ssrc: number) => {\n this.add(\n `a=ssrc:${ssrc} cname:${streamName}`,\n `a=ssrc:${ssrc} msid:${streamName} ${type}`,\n `a=ssrc:${ssrc} mslabel:${streamName}`,\n `a=ssrc:${ssrc} label:${type}`\n );\n };\n\n addMsid();\n if(sourceGroups?.length) {\n sourceGroups.forEach((ssrcGroup) => {\n if(ssrcGroup.sources.length) {\n const sources = ssrcGroup.sources.map(fromTelegramSource);\n this.add(`a=ssrc-group:${ssrcGroup.semantics} ${sources.join(' ')}`);\n sources.forEach(addSource);\n }\n });\n } else {\n addSource(source);\n }\n\n return this;\n }\n\n public addSsrcEntry(entry: ConferenceEntry, data: ConferenceData, isAnswer?: boolean) {\n const add = (...x: string[]) => this.add(...x);\n\n const {type, mid, direction, port} = entry;\n const transport = data.transport;\n\n /* if(type === 'application') {\n return this.addDataChannel(mid, transport, isAnswer);\n } */\n\n const isApplication = type === 'application';\n const codec = isApplication ? undefined : data[type];\n\n const isInactive = direction === 'inactive';\n if(entry.shouldBeSkipped(isAnswer)) {\n return add(\n `m=${fixMediaLineType(type)} 0 ${getConnectionTypeForMediaType(type)} 0`,\n `c=IN IP4 0.0.0.0`,\n `a=inactive`,\n `a=mid:${mid}`\n );\n }\n\n const payloadTypes = !isApplication ? codec['payload-types'] : [{id: 5000} as PayloadType];\n const ids = payloadTypes.map((type) => type.id);\n add(\n generateMediaFirstLine(type, port, ids),\n 'c=IN IP4 0.0.0.0',\n `a=rtcp:${port} IN IP4 0.0.0.0`\n );\n\n if(transport['rtcp-mux']) {\n add('a=rtcp-mux');\n }\n\n add(`a=mid:${mid}`);\n /* if(type === 'video') {\n add('b=AS:2500');\n } */\n\n let setDirection = direction;\n if(direction !== 'sendrecv' && isAnswer && !(isInactive || isApplication)) {\n setDirection = direction === 'sendonly' ? 'recvonly' : 'sendonly';\n }\n\n // a=bundle-only\n add(`a=${setDirection}`);\n\n // this.addTransport(transport, isAnswer);\n this.addTransport(transport);\n\n if(!isApplication) {\n const hdrexts = codec['rtp-hdrexts'];\n if(hdrexts?.length) {\n hdrexts.forEach((hdrext) => {\n add(`a=extmap:${hdrext.id} ${hdrext.uri}`);\n });\n }\n\n payloadTypes.forEach((type) => {\n add(`a=rtpmap:${type.id} ${type.name}/${type.clockrate}${type.channels && type.channels > 1 ? `/${type.channels}` : ''}`);\n\n const parameters = type.parameters;\n if(Array.isArray(parameters)) {\n if(parameters.length) {\n console.error('parameters is array???', parameters);\n }\n } else if(parameters && Object.keys(parameters).length) {\n const p: string[] = [];\n for(const i in parameters) {\n p.push(`${i}=${parameters[i]}`);\n }\n add(`a=fmtp:${type.id} ${p.join(';')}`);\n }\n\n const fbs = type['rtcp-fbs'];\n if(fbs?.length) {\n fbs.forEach((fb) => {\n add(`a=rtcp-fb:${type.id} ${fb.type}${fb.subtype ? ' ' + fb.subtype : ''}`);\n });\n }\n });\n } else {\n add(`a=sctpmap:${payloadTypes[0].id} webrtc-datachannel 256`);\n }\n\n if(entry.source && (setDirection === 'sendonly' || setDirection === 'sendrecv')) {\n this.addSsrc(entry);\n }\n\n return this;\n }\n\n public addConference(options: {\n conference: LocalConferenceDescription,\n bundle: string[],\n entries: ConferenceEntry[],\n isAnswer?: boolean,\n }) {\n const {conference, entries, bundle, isAnswer} = options;\n this.addHeader(conference.sessionId, bundle);\n\n if(IS_FIREFOX) {\n this.addTransport(conference.transport); // support Firefox\n }\n\n for(const entry of entries) {\n // this.addSsrcEntry(entry, conference, isAnswer);\n this.addSsrcEntry((isAnswer ? entry.recvEntry || entry.sendEntry : entry.sendEntry || entry.recvEntry) || entry, conference, isAnswer);\n }\n\n return this;\n }\n\n public static fromConference(options: Parameters[0]) {\n return new SDPBuilder().addConference(options).finalize();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport {logger} from '../logger';\nimport rootScope from '../rootScope';\nimport {GROUP_CALL_AMPLITUDE_ANALYSE_COUNT_MAX} from './constants';\nimport stopTrack from './helpers/stopTrack';\nimport LocalConferenceDescription from './localConferenceDescription';\nimport {fixMediaLineType, WebRTCLineType} from './sdpBuilder';\nimport {getAmplitude, toTelegramSource} from './utils';\n\nexport type StreamItemBase = {\n type: 'input' | 'output',\n track: MediaStreamTrack,\n source: string,\n stream: MediaStream\n};\n\nexport type StreamItem = StreamAudioItem | StreamVideoItem;\n\nexport type StreamAudioItem = StreamItemBase & {kind: 'audio', streamAnalyser: AudioStreamAnalyser};\nexport type StreamVideoItem = StreamItemBase & {kind: 'video'};\n\nexport type StreamAmplitude = {\n type: 'input' | 'output';\n source: string;\n stream: MediaStream;\n track: MediaStreamTrack;\n value: number;\n};\n\nclass AudioStreamAnalyser {\n public analyser: AnalyserNode;\n public gain: GainNode;\n public streamSource: MediaStreamAudioSourceNode;\n\n constructor(context: AudioContext, stream: MediaStream) {\n const streamSource = this.streamSource = context.createMediaStreamSource(stream);\n const analyser = this.analyser = context.createAnalyser();\n const gain = this.gain = context.createGain();\n // const streamDestination = context.createMediaStreamDestination();\n\n analyser.minDecibels = -100;\n analyser.maxDecibels = -30;\n analyser.smoothingTimeConstant = 0.05;\n analyser.fftSize = 1024;\n\n // connect Web Audio API\n streamSource.connect(analyser);\n // analyser.connect(context.destination);\n }\n}\n\nexport default class StreamManager {\n public static ANALYSER_LISTENER = new EventListenerBase<{amplitude: (details: {amplitudes: StreamAmplitude[], type: 'all' | 'input'}) => void}>();\n private context: AudioContext;\n public outputStream: MediaStream;\n public inputStream: MediaStream;\n\n private timer: number;\n private counter: number;\n\n private items: StreamItem[];\n\n private log: ReturnType;\n\n public direction: RTCRtpTransceiver['direction'];\n public canCreateConferenceEntry: boolean;\n public locked: boolean;\n public types: WebRTCLineType[];\n\n constructor(private interval?: number) {\n this.context = new (window.AudioContext || (window as any).webkitAudioContext)();\n this.items = [];\n this.outputStream = new MediaStream();\n this.inputStream = new MediaStream();\n this.counter = 0;\n this.log = logger('SM');\n this.direction = 'sendonly';\n this.canCreateConferenceEntry = true;\n // this.lol = true;\n this.types = ['audio', 'video'];\n }\n\n public addStream(stream: MediaStream, type: StreamItem['type']) {\n stream.getTracks().forEach((track) => {\n this.addTrack(stream, track, type);\n });\n }\n\n public addTrack(stream: MediaStream, track: MediaStreamTrack, type: StreamItem['type']) {\n this.log('addTrack', type, track, stream);\n\n const {context, items, inputStream, outputStream} = this;\n const kind: StreamItem['kind'] = track.kind as any;\n const source = StreamManager.getSource(stream, type);\n\n // this.removeTrack(track);\n switch(type) {\n case 'input': {\n if(!inputStream) {\n this.inputStream = stream;\n } else {\n inputStream.addTrack(track);\n }\n\n break;\n }\n\n case 'output': {\n for(let i = 0; i < items.length; ++i) {\n const {track: t, type, source: itemSource} = items[i];\n if(itemSource === source && type === 'input') {\n items.splice(i, 1);\n outputStream.removeTrack(t);\n break;\n }\n }\n\n if(kind !== 'video') {\n outputStream.addTrack(track);\n }\n\n break;\n }\n }\n\n this.finalizeAddingTrack({\n type,\n source,\n stream,\n track,\n kind,\n streamAnalyser: kind === 'audio' ? new AudioStreamAnalyser(context, stream) : undefined\n });\n\n if(kind === 'audio' && this.interval) {\n this.changeTimer();\n }\n }\n\n private finalizeAddingTrack(item: StreamItem) {\n const {track} = item;\n track.addEventListener('ended', () => {\n this.removeTrack(track);\n }, {once: true});\n\n this.items.push(item);\n }\n\n public hasInputTrackKind(kind: StreamItem['kind']) {\n return this.items.find((item) => item.type === 'input' && item.kind === kind);\n }\n\n public static getSource(stream: MediaStream, type: StreamItem['type']) {\n return type === 'input' ? (stream.source || stream.id) : '' + toTelegramSource(+stream.id.substring(6));\n }\n\n public removeTrack(track: MediaStreamTrack) {\n this.log('removeTrack', track);\n\n const {items} = this;\n\n let handled = false;\n for(let i = 0, length = items.length; !handled && i < length; ++i) {\n const {track: t, type} = items[i];\n switch(type) {\n case 'output': {\n if(t === track) {\n items.splice(i, 1);\n this.outputStream.removeTrack(track);\n handled = true;\n }\n\n break;\n }\n\n case 'input': {\n if(t === track) {\n items.splice(i, 1);\n this.inputStream.removeTrack(track);\n handled = true;\n }\n\n break;\n }\n }\n }\n\n if(track.kind === 'audio' && this.interval) {\n this.changeTimer();\n }\n }\n\n public replaceInputAudio(stream: MediaStream, oldTrack: MediaStreamTrack) {\n this.removeTrack(oldTrack);\n this.addStream(stream, 'input');\n }\n\n private changeTimer() {\n if(this.timer !== undefined) {\n clearInterval(this.timer);\n }\n\n if(this.items.length) {\n this.timer = window.setInterval(this.analyse, this.interval);\n }\n }\n\n public getAmplitude = (item: StreamAudioItem): StreamAmplitude => {\n const {streamAnalyser, stream, track, source, type} = item;\n const analyser = streamAnalyser.analyser;\n if(!analyser) return;\n\n const array = new Uint8Array(analyser.frequencyBinCount);\n analyser.getByteFrequencyData(array);\n const value = getAmplitude(array);\n\n return {\n type,\n source,\n stream,\n track,\n value\n };\n };\n\n public analyse = () => {\n const all = this.counter % 3 === 0;\n const filteredItems = all ? this.items : this.items.filter((x) => x.type === 'input');\n const audioItems = filteredItems.filter((x) => x.kind === 'audio') as StreamAudioItem[];\n const amplitudes = audioItems.slice(0, GROUP_CALL_AMPLITUDE_ANALYSE_COUNT_MAX).map(this.getAmplitude);\n if(++this.counter >= 1000) {\n this.counter = 0;\n }\n\n StreamManager.ANALYSER_LISTENER.dispatchEvent('amplitude', {\n amplitudes,\n type: all ? 'all' : 'input'\n });\n };\n\n /* public appendToConnection(connection: RTCPeerConnection) {\n if(this.inputStream) {\n this.inputStream.getTracks().forEach((track) => {\n connection.log('addTrack', track);\n connection.addTrack(track, this.inputStream);\n\n if(track.kind === 'video') {\n track.enabled = true;\n }\n });\n }\n } */\n\n public appendToConference(conference: LocalConferenceDescription) {\n if(this.locked) {\n return;\n }\n\n const {inputStream, direction, canCreateConferenceEntry} = this;\n const transceiverInit: RTCRtpTransceiverInit = {direction, streams: [inputStream]};\n const types = this.types.map((type) => {\n return [\n type,\n /* type === 'video' || type === 'screencast' ?\n {sendEncodings: [{maxBitrate: 2500000}], ...transceiverInit} : */\n transceiverInit\n ] as const;\n });\n\n const tracks = inputStream.getTracks();\n // const transceivers = conference.connection.getTransceivers();\n for(const [type, transceiverInit] of types) {\n let entry = conference.findEntry((entry) => entry.direction === direction && entry.type === type);\n if(!entry) {\n if(!canCreateConferenceEntry) {\n continue;\n }\n\n entry = conference.createEntry(type);\n }\n /* const entry = conference.findFreeSendRecvEntry(type, true);\n if(!entry.transceiver) {\n entry.transceiver = transceivers.find((transceiver) => transceiver.mid === entry.mid);\n } */\n\n let {transceiver} = entry;\n if(!transceiver) {\n transceiver = entry.createTransceiver(conference.connection, transceiverInit);\n\n /* if(this.isScreenSharingManager) {\n transceiver.sender.setParameters({\n ...transceiver.sender.getParameters(),\n degradationPreference: 'maintain-resolution'\n });\n } */\n }\n\n if(entry.direction !== transceiver.direction) {\n transceiver.direction = entry.direction;\n }\n\n const mediaTrackType = fixMediaLineType(type);\n const trackIdx = tracks.findIndex((track) => track.kind === mediaTrackType);\n const track = trackIdx !== -1 ? tracks.splice(trackIdx, 1)[0] : undefined;\n const sender = transceiver.sender;\n if(sender.track === track) {\n continue;\n }\n\n // try { // ! don't use await here. it will wait for adding track and fake one won't be visible in startNegotiation.\n /* await */sender.replaceTrack(track).catch((err) => {\n this.log.error(err);\n });\n // } catch(err) {\n\n // }\n }\n }\n\n public stop() {\n try {\n const tracks = this.inputStream.getTracks().concat(this.outputStream.getTracks());\n tracks.forEach((track) => {\n stopTrack(track);\n });\n } catch(e) {\n this.log.error(e);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nexport default class StringFromLineBuilder {\n private lines: string[];\n private newLine: string[];\n\n constructor(private joiner = '\\r\\n') {\n this.lines = [];\n this.newLine = [];\n }\n\n public add(...strs: string[]) {\n this.lines.push(...strs);\n return this;\n }\n\n public push(word: string) {\n this.newLine.push(word);\n return this;\n }\n\n public addJoined(separator = '') {\n this.add(this.newLine.join(separator));\n this.newLine = [];\n return this;\n }\n\n public join() {\n return this.lines.join(this.joiner);\n }\n\n public finalize() {\n return this.join() + this.joiner;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\n// NOTE: telegram returns sign source, while webrtc uses unsign source internally\n// unsign => sign\nexport function toTelegramSource(source: number) {\n return source << 0;\n}\n\n// NOTE: telegram returns sign source, while webrtc uses unsign source internally\n// sign => unsign\nexport function fromTelegramSource(source: number) {\n return source >>> 0;\n}\n\nexport function getAmplitude(array: Uint8Array, scale = 3) {\n if(!array) return 0;\n\n const {length} = array;\n let total = 0;\n for(let i = 0; i < length; ++i) {\n total += array[i] * array[i];\n }\n const rms = Math.sqrt(total / length) / 255;\n\n return Math.min(1, rms * scale);\n}\n","export const SEND_WHEN_ONLINE_TIMESTAMP = 0x7FFFFFFE;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\nimport getEmojiEntityFromEmoji from './getEmojiEntityFromEmoji';\nimport emojiRegExp from '../../vendor/emoji/regex';\n\nconst EMOJI_REG_EXP = new RegExp(`(^${emojiRegExp})`);\n\nexport default function getAbbreviation(str: string, onlyFirst = false): {\n text: string,\n entities: MessageEntity[]\n} {\n const splitted = (str || '').trim().split(' ');\n if(!splitted[0]) return {text: '', entities: []};\n\n const entities: MessageEntity.messageEntityEmoji[] = [];\n\n const firstEmojiMatch = splitted[0].match(EMOJI_REG_EXP);\n const first = firstEmojiMatch?.[0] || splitted[0][0];\n if(firstEmojiMatch) {\n entities.push(getEmojiEntityFromEmoji(first));\n }\n\n const length = splitted.length;\n if(onlyFirst || length === 1) return {text: first, entities};\n\n const lastEmojiMatch = splitted[length - 1].match(EMOJI_REG_EXP);\n const last = lastEmojiMatch?.[0] || splitted[length - 1][0];\n if(lastEmojiMatch) {\n entities.push({\n ...getEmojiEntityFromEmoji(last),\n offset: first.length\n });\n }\n\n return {text: first + last, entities};\n}\n","import {MessageEntity} from '../../layer';\nimport {toCodePoints} from '../../vendor/emoji';\n\nexport default function getEmojiEntityFromEmoji(emoji: string): MessageEntity.messageEntityEmoji {\n return {\n _: 'messageEntityEmoji',\n offset: 0,\n length: emoji.length,\n unicode: toCodePoints(emoji).join('-').replace(/-?fe0f/g, '')\n };\n}\n","import {EMAIL_REG_EXP} from '.';\n\nexport default function matchEmail(text: string) {\n return !text ? null : text.match(EMAIL_REG_EXP);\n}\n","export default function setBlankToAnchor(anchor: HTMLAnchorElement) {\n anchor.target = '_blank';\n anchor.rel = 'noopener noreferrer';\n return anchor;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport wrapEmojiText from './wrapEmojiText';\nimport getAbbreviation from './getAbbreviation';\n\nexport default function wrapAbbreviation(str: string, onlyFirst?: boolean) {\n const {text, entities} = getAbbreviation(str, onlyFirst);\n return wrapEmojiText(text, undefined, entities);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../rootScope';\nimport wrapRichText from './wrapRichText';\n\nexport default function wrapDraftText(text: string, options: Partial<{\n wrappingForPeerId: PeerId\n}> & Parameters[1] = {}) {\n if(!text) {\n return wrapRichText('');\n }\n\n let entities = options.entities;\n if(entities && !rootScope.premium && options.wrappingForPeerId !== rootScope.myId) {\n entities = entities.filter((entity) => entity._ !== 'messageEntityCustomEmoji');\n }\n\n const fragment = wrapRichText(text, {\n ...options,\n entities,\n noLinks: true,\n wrappingDraft: true,\n passEntities: {\n messageEntityTextUrl: true,\n messageEntityMentionName: true\n }\n });\n\n return fragment;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\nimport parseEntities from './parseEntities';\nimport wrapRichText from './wrapRichText';\n\nexport default function wrapEmojiText(text: string, isDraft = false, entities?: MessageEntity[]) {\n if(!text) return wrapRichText('');\n\n entities ??= parseEntities(text).filter((e) => e._ === 'messageEntityEmoji');\n return wrapRichText(text, {entities, wrappingDraft: isDraft});\n}\n","import IS_EMOJI_SUPPORTED from './emojiSupport';\n\nexport type EMOJI_VERSION = '' | '14';\n\nconst EMOJI_VERSIONS_SUPPORTED: {\n [v in EMOJI_VERSION]: boolean\n} = {} as any;\n\n// Thanks to WebZ for the detect\nfunction isEmojiSupported(emoji: string) {\n const ALLOWABLE_CALCULATION_ERROR_SIZE = 5;\n const inlineEl = document.createElement('span');\n inlineEl.classList.add('emoji');\n document.body.appendChild(inlineEl);\n\n inlineEl.innerText = emoji; // Emoji from 14.0 version\n const newEmojiWidth = inlineEl.offsetWidth;\n inlineEl.innerText = '❤️'; // Emoji from 1.0 version\n const legacyEmojiWidth = inlineEl.offsetWidth;\n\n document.body.removeChild(inlineEl);\n\n return Math.abs(newEmojiWidth - legacyEmojiWidth) < ALLOWABLE_CALCULATION_ERROR_SIZE;\n}\n\nif(IS_EMOJI_SUPPORTED) {\n EMOJI_VERSIONS_SUPPORTED[''] = true;\n\n const a: [keyof typeof EMOJI_VERSIONS_SUPPORTED, string][] = [\n ['14', '🫱🏻']\n ];\n\n a.forEach(([version, emoji]) => {\n EMOJI_VERSIONS_SUPPORTED[version] = isEmojiSupported(emoji);\n });\n}\n\nexport default EMOJI_VERSIONS_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {EMOJI_VERSION} from '../../environment/emojiVersionsSupport';\nimport {SITE_HASHTAGS} from '.';\nimport {EmojiVersions} from '../../config/emoji';\nimport IS_EMOJI_SUPPORTED from '../../environment/emojiSupport';\nimport buildURLHash from '../../helpers/buildURLHash';\nimport copy from '../../helpers/object/copy';\nimport encodeEntities from '../../helpers/string/encodeEntities';\nimport {MessageEntity} from '../../layer';\nimport encodeSpoiler from './encodeSpoiler';\nimport parseEntities from './parseEntities';\nimport setBlankToAnchor from './setBlankToAnchor';\nimport wrapUrl from './wrapUrl';\nimport EMOJI_VERSIONS_SUPPORTED from '../../environment/emojiVersionsSupport';\nimport {CLICK_EVENT_NAME} from '../../helpers/dom/clickEvent';\nimport IS_CUSTOM_EMOJI_SUPPORTED from '../../environment/customEmojiSupport';\nimport rootScope from '../rootScope';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport wrapSticker, {videosCache} from '../../components/wrappers/sticker';\nimport RLottiePlayer, {getLottiePixelRatio} from '../rlottie/rlottiePlayer';\nimport animationIntersector, {AnimationItemGroup} from '../../components/animationIntersector';\nimport type {MyDocument} from '../appManagers/appDocsManager';\nimport LazyLoadQueue from '../../components/lazyLoadQueue';\nimport {Awaited} from '../../types';\nimport {MediaSize} from '../../helpers/mediaSize';\nimport IS_WEBM_SUPPORTED from '../../environment/webmSupport';\nimport assumeType from '../../helpers/assumeType';\nimport noop from '../../helpers/noop';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport getViewportSlice from '../../helpers/dom/getViewportSlice';\nimport {getMiddleware, Middleware, MiddlewareHelper} from '../../helpers/middleware';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport BOM from '../../helpers/string/bom';\nimport framesCache from '../../helpers/framesCache';\nimport wrapTelegramUrlToAnchor from './wrapTelegramUrlToAnchor';\n\nconst resizeObserver = new ResizeObserver((entries) => {\n for(const entry of entries) {\n const renderer = entry.target.parentElement as CustomEmojiRendererElement;\n renderer.setDimensionsFromRect(entry.contentRect);\n }\n});\n\nconst globalLazyLoadQueue = new LazyLoadQueue();\n\nexport class CustomEmojiElement extends HTMLElement {\n public elements: CustomEmojiElements;\n public renderer: CustomEmojiRendererElement;\n public player: RLottiePlayer | HTMLVideoElement;\n public paused: boolean;\n public syncedPlayer: SyncedPlayer;\n public clean: boolean;\n public lastChildWas: Node;\n // public docId: DocId;\n public placeholder: HTMLImageElement;\n public middlewareHelper: MiddlewareHelper;\n\n constructor() {\n super();\n this.paused = true;\n this.classList.add('custom-emoji');\n }\n\n public get docId() {\n return this.dataset.docId;\n }\n\n public static create(docId: DocId) {\n const element = new CustomEmojiElement();\n // element.docId = docId;\n element.dataset.docId = '' + docId;\n return element;\n }\n\n public get isConnected() {\n return this.placeholder?.isConnected ?? super.isConnected;\n }\n\n public connectedCallback() {\n // if(this.isConnected) {\n // return;\n // }\n\n if(this.player) {\n animationIntersector.addAnimation({\n animation: this,\n group: this.renderer.animationGroup,\n controlled: true\n });\n }\n\n // this.connectedCallback = undefined;\n }\n\n public disconnectedCallback() {\n if(this.isConnected || !this.renderer?.isSelectable) { // prepend on sibling can invoke disconnectedCallback\n return;\n }\n\n this.clear();\n }\n\n public destroy() {\n this.clear();\n }\n\n public clear(replaceChildren = true) {\n if(this.clean) {\n return;\n }\n\n // if(this.docId === '5399836826758290421') {\n // console.log('clear', this, this.isConnected);\n // }\n\n this.clean = true;\n this.pause();\n\n const {syncedPlayer} = this;\n if(syncedPlayer) {\n syncedPlayer.pausedElements.delete(this);\n }\n\n this.middlewareHelper?.clean();\n\n if(this.renderer) {\n const elements = this.renderer.customEmojis.get(this.docId);\n if(elements?.delete(this) && !elements.size) {\n this.renderer.customEmojis.delete(this.docId);\n this.renderer.playersSynced.delete(elements);\n }\n\n if(replaceChildren) {\n if(this.renderer.isSelectable) {\n this.replaceChildren(createCustomFiller(true));\n } else {\n // otherwise https://bugs.chromium.org/p/chromium/issues/detail?id=1144736#c27 will happen\n this.replaceChildren();\n }\n }\n }\n\n if(this.player) {\n animationIntersector.removeAnimationByPlayer(this);\n }\n\n if(globalLazyLoadQueue) {\n globalLazyLoadQueue.delete({div: this});\n }\n\n /* this.disconnectedCallback = */this.elements =\n this.renderer =\n this.player =\n this.syncedPlayer =\n undefined;\n }\n\n public pause() {\n if(this.paused) {\n return;\n }\n\n this.paused = true;\n\n if(this.player instanceof HTMLVideoElement && !this.syncedPlayer) {\n this.renderer.lastPausedVideo = this.player;\n this.player.pause();\n }\n\n if(this.syncedPlayer && !this.syncedPlayer.pausedElements.has(this)) {\n this.syncedPlayer.pausedElements.add(this);\n\n if(this.syncedPlayer.player && this.syncedPlayer.pausedElements.size === this.syncedPlayer.middlewares.size) {\n this.syncedPlayer.player.pause();\n }\n }\n }\n\n public play() {\n if(!this.paused) {\n return;\n }\n\n this.paused = false;\n\n if(this.player instanceof HTMLVideoElement) {\n this.player.currentTime = this.renderer.lastPausedVideo?.currentTime ?? this.player.currentTime;\n this.player.play().catch(noop);\n }\n\n if(this.syncedPlayer && this.syncedPlayer.pausedElements.has(this)) {\n this.syncedPlayer.pausedElements.delete(this);\n\n if(this.syncedPlayer.pausedElements.size !== this.syncedPlayer.middlewares.size) {\n this.player.play();\n }\n }\n }\n\n public remove() {\n this.clear();\n // this.elements = this.renderer = this.player = undefined;\n }\n\n public get autoplay() {\n return true;\n }\n\n public get loop() {\n return true;\n }\n}\n\ntype CustomEmojiElements = Set;\n\nexport class CustomEmojiRendererElement extends HTMLElement {\n public canvas: HTMLCanvasElement;\n public context: CanvasRenderingContext2D;\n\n public playersSynced: Map;\n public clearedElements: WeakSet;\n public customEmojis: Parameters[1]['customEmojis'];\n public lastPausedVideo: HTMLVideoElement;\n\n public lastRect: DOMRect;\n public isDimensionsSet: boolean;\n\n public animationGroup: AnimationItemGroup;\n public size: MediaSize;\n\n public isSelectable: boolean;\n public isCanvasClean: boolean;\n\n public ignoreSettingDimensions: boolean;\n\n public forceRenderAfterSize: boolean;\n\n public middlewareHelper: MiddlewareHelper;\n\n public auto: boolean;\n\n constructor() {\n super();\n\n this.classList.add('custom-emoji-renderer');\n this.canvas = document.createElement('canvas');\n this.canvas.classList.add('custom-emoji-canvas');\n this.context = this.canvas.getContext('2d');\n this.append(this.canvas);\n\n this.playersSynced = new Map();\n this.clearedElements = new WeakSet();\n this.customEmojis = new Map();\n\n this.animationGroup = 'EMOJI';\n this.isCanvasClean = false;\n }\n\n public connectedCallback() {\n if(emojiRenderers.has(this)) {\n return;\n }\n\n // this.setDimensions();\n // animationIntersector.addAnimation(this, this.animationGroup);\n resizeObserver.observe(this.canvas);\n emojiRenderers.add(this);\n\n this.connectedCallback = undefined;\n }\n\n public disconnectedCallback() {\n if(this.isConnected || !this.auto) {\n return;\n }\n\n this.destroy?.();\n\n this.disconnectedCallback = undefined;\n }\n\n public destroy() {\n // if(this.isConnected) {\n // return;\n // }\n\n resizeObserver.unobserve(this.canvas);\n\n this.customEmojis.forEach((elements) => {\n elements.forEach((element) => {\n element.clear();\n });\n });\n\n emojiRenderers.delete(this);\n this.playersSynced.clear();\n this.middlewareHelper?.clean();\n this.customEmojis.clear();\n\n this.destroy =\n this.lastPausedVideo =\n undefined;\n }\n\n public getOffsets(offsetsMap: Map = new Map()) {\n if(!this.playersSynced.size) {\n return offsetsMap;\n }\n\n const overflowElement = findUpClassName(this, 'scrollable') || this.offsetParent as HTMLElement;\n if(!overflowElement) {\n return offsetsMap;\n }\n\n const overflowRect = overflowElement.getBoundingClientRect();\n const rect = this.getBoundingClientRect();\n\n for(const elements of this.playersSynced.keys()) {\n const elementsArr = Array.from(elements);\n const placeholders = this.isSelectable ? elementsArr.map((element) => element.placeholder) : elementsArr;\n const {visible} = getViewportSlice({\n overflowElement,\n overflowRect,\n elements: placeholders,\n extraSize: this.size.height * 2.5 // let's add some margin\n });\n\n const offsets = visible.map(({rect: elementRect}) => {\n const top = elementRect.top - rect.top;\n const left = elementRect.left - rect.left;\n return {top, left, width: elementRect.width};\n });\n\n if(offsets.length) {\n offsetsMap.set(elements, offsets);\n }\n }\n\n // const rect = this.getBoundingClientRect();\n // const visibleRect = getVisibleRect(this, overflowElement, undefined, rect);\n // const minTop = visibleRect ? visibleRect.rect.top - this.size.height : 0;\n // const maxTop = Infinity;\n // for(const elements of this.playersSynced.keys()) {\n // const offsets = elements.map((element) => {\n // const elementRect = element.getBoundingClientRect();\n // const top = elementRect.top - rect.top;\n // const left = elementRect.left - rect.left;\n // return top >= minTop && (top + elementRect.height) <= maxTop ? {top, left} : undefined;\n // }).filter(Boolean);\n\n // if(offsets.length) {\n // offsetsMap.set(elements, offsets);\n // }\n // }\n\n return offsetsMap;\n }\n\n public clearCanvas() {\n if(this.isCanvasClean) {\n return;\n }\n\n const {context, canvas} = this;\n context.clearRect(0, 0, canvas.width, canvas.height);\n this.isCanvasClean = true;\n }\n\n public render(offsetsMap: ReturnType) {\n const {context, canvas, isDimensionsSet} = this;\n if(!isDimensionsSet) {\n this.setDimensionsFromRect(undefined, false);\n }\n\n this.isCanvasClean = false;\n\n const {width, height, dpr} = canvas;\n for(const [elements, offsets] of offsetsMap) {\n const player = this.playersSynced.get(elements);\n const frame = syncedPlayersFrames.get(player) || (player instanceof HTMLVideoElement ? player : undefined);\n if(!frame) {\n continue;\n }\n\n const isImageData = frame instanceof ImageData;\n let frameWidth: number, frameHeight: number;\n if(player instanceof HTMLVideoElement) {\n frameWidth = this.size.width * dpr;\n frameHeight = this.size.height * dpr;\n } else {\n frameWidth = frame.width;\n frameHeight = frame.height;\n }\n\n // ! check performance of scaling\n const elementWidth = Math.round(offsets[0].width * dpr);\n if(elementWidth !== frameWidth) {\n // if(this.size.width === 36) {\n // console.warn('different width', elementWidth, frameWidth, this);\n // }\n\n frameWidth = elementWidth;\n frameHeight = elementWidth;\n }\n\n const maxTop = height - frameHeight;\n const maxLeft = width - frameWidth;\n\n if(!this.clearedElements.has(elements) && !this.isSelectable) {\n if(this.isSelectable/* && false */) {\n elements.forEach((element) => {\n element.lastChildWas ??= element.lastChild;\n replaceContent(element, element.firstChild);\n });\n } else {\n elements.forEach((element) => {\n element.replaceChildren();\n });\n }\n\n this.clearedElements.add(elements);\n }\n\n offsets.forEach(({top, left}) => {\n top = Math.round(top * dpr), left = Math.round(left * dpr);\n if(left < 0 ||/* top > maxTop || */left > maxLeft) {\n return;\n }\n\n if(isImageData) {\n context.putImageData(frame, left, top);\n } else {\n // context.clearRect(left, top, width, height);\n context.drawImage(frame, left, top, frameWidth, frameHeight);\n }\n });\n }\n }\n\n public checkForAnyFrame() {\n for(const player of this.playersSynced.values()) {\n if(syncedPlayersFrames.has(player) || player instanceof HTMLVideoElement) {\n return true;\n }\n }\n\n return false;\n }\n\n public remove() {\n super.remove();\n // this.canvas.remove();\n }\n\n // public setDimensions() {\n // const {canvas} = this;\n // sequentialDom.mutateElement(canvas, () => {\n // const rect = canvas.getBoundingClientRect();\n // this.setDimensionsFromRect(rect);\n // });\n // }\n\n public setDimensionsFromRect(rect: DOMRect = this.lastRect, forceRenderAfter = true) {\n const {canvas} = this;\n const {dpr} = canvas;\n\n if(this.lastRect !== rect) {\n this.lastRect = rect;\n }\n\n if(!rect || !dpr || this.ignoreSettingDimensions) {\n return;\n }\n\n const {width, height} = rect;\n // if(this.isSelectable) {\n // height = this.parentElement.scrollHeight || height;\n\n // this.style.width = width + 'px';\n // this.style.height = height + 'px';\n // }\n\n const newWidth = Math.floor(Math.round(width * dpr));\n const newHeight = Math.floor(Math.round(height * dpr));\n if(canvas.width === newWidth && canvas.height === newHeight) {\n return;\n }\n\n canvas.width = newWidth;\n canvas.height = newHeight;\n this.isDimensionsSet = true;\n this.isCanvasClean = true;\n\n if(this.forceRenderAfterSize || (this.isSelectable && forceRenderAfter)) {\n this.forceRenderAfterSize = undefined;\n this.forceRender();\n }\n }\n\n public forceRender() {\n if(!this.isDimensionsSet) {\n return;\n }\n\n if(!renderEmojis(new Set([this]))) {\n this.clearCanvas();\n }\n }\n\n public add(\n addCustomEmojis: Parameters[1]['customEmojis'],\n lazyLoadQueue?: LazyLoadQueue | false,\n onlyThumb?: boolean,\n withThumb?: boolean\n ) {\n const renderer = this;\n\n addCustomEmojis.forEach((addElements, docId) => { // prevent adding old elements\n let elements = this.customEmojis.get(docId);\n if(!elements) this.customEmojis.set(docId, elements = new Set());\n else this.clearedElements.delete(elements);\n\n for(const el of addElements) {\n if(elements.has(el)) {\n addElements.delete(el);\n } else {\n el.clean = false;\n el.renderer = renderer;\n el.elements = elements;\n el.middlewareHelper = this.middlewareHelper.get().create();\n elements.add(el);\n\n if(el.lastChildWas && !el.lastChildWas.parentNode) {\n el.append(el.lastChildWas);\n }\n }\n }\n\n if(!addElements.size) {\n addCustomEmojis.delete(docId);\n }\n });\n\n if(!addCustomEmojis.size) {\n return;\n }\n\n const usingOwnQueue = !!(!lazyLoadQueue && lazyLoadQueue !== false && globalLazyLoadQueue);\n\n const docIds = Array.from(addCustomEmojis.keys());\n\n const managers = rootScope.managers;\n const middleware = this.middlewareHelper.get();\n const size = this.size;\n\n const loadPromise = managers.appEmojiManager.getCachedCustomEmojiDocuments(docIds).then((docs) => {\n if(middleware && !middleware()) return;\n\n const loadPromises: Promise[] = [];\n const wrap = (doc: MyDocument, _loadPromises?: Promise[]) => {\n const docId = doc.id;\n const newElements = addCustomEmojis.get(docId);\n const customEmojis = renderer.customEmojis.get(docId);\n const isLottie = doc.sticker === 2;\n const isStatic = doc.mime_type === 'video/webm' && !IS_WEBM_SUPPORTED;\n const willHaveSyncedPlayer = (isLottie || (doc.sticker === 3 && this.isSelectable)) && !onlyThumb && !isStatic;\n\n const loadPromises: Promise[] = [];\n const newElementsArray = Array.from(newElements);\n const promise = wrapSticker({\n div: newElementsArray,\n doc,\n width: size.width,\n height: size.height,\n loop: true,\n play: CUSTOM_EMOJI_INSTANT_PLAY,\n managers,\n isCustomEmoji: true,\n group: 'none',\n loadPromises,\n middleware,\n exportLoad: usingOwnQueue || lazyLoadQueue === false ? 2 : 1, // 2 - export load always, 1 - do not export load if cached static\n needFadeIn: false,\n loadStickerMiddleware: willHaveSyncedPlayer && middleware ? middleware.create().get(() => {\n // if(syncedPlayers.get(key) !== syncedPlayer) {\n // return false;\n // }\n\n // let good = false;\n // for(const middleware of syncedPlayer.middlewares) {\n // if(middleware()) {\n // good = true;\n // break;\n // }\n // }\n\n // return good;\n return !!syncedPlayer.middlewares.size;\n }) : undefined,\n static: isStatic,\n onlyThumb,\n withThumb: withThumb ?? (renderer.clearedElements.has(customEmojis) ? false : undefined),\n syncedVideo: this.isSelectable\n });\n\n if(_loadPromises) {\n promise.then(() => _loadPromises.push(...loadPromises));\n }\n\n const addition: {\n onRender?: (_p: Awaited['render']>) => Promise,\n elements: typeof newElements\n } = {\n elements: newElements\n };\n\n if(doc.sticker === 1 || onlyThumb || isStatic) {\n if(this.isSelectable) {\n addition.onRender = () => Promise.all(loadPromises).then(() => {\n if(middleware && !middleware()) return;\n newElementsArray.forEach((element) => {\n const {placeholder} = element;\n placeholder.src = (element.firstElementChild as HTMLImageElement).src;\n });\n });\n }\n\n return promise.then((res) => ({...res, ...addition}));\n }\n\n // eslint-disable-next-line prefer-const\n addition.onRender = (_p) => Promise.all(loadPromises).then(() => {\n if((middleware && !middleware()) || !doc.animated) {\n return;\n }\n\n const players = Array.isArray(_p) ? _p as HTMLVideoElement[] : [_p as RLottiePlayer];\n const player = Array.isArray(players) ? players[0] : players;\n assumeType(player);\n newElementsArray.forEach((element, idx) => {\n const player = players[idx] || players[0];\n element.player = player;\n\n if(syncedPlayer) {\n element.syncedPlayer = syncedPlayer;\n if(element.paused) {\n element.syncedPlayer.pausedElements.add(element);\n } else if(player.paused) {\n player.play();\n }\n }\n\n if(element.isConnected) {\n animationIntersector.addAnimation({\n animation: element,\n group: element.renderer.animationGroup,\n controlled: true\n });\n }\n });\n\n if(player instanceof RLottiePlayer || (player instanceof HTMLVideoElement && this.isSelectable)) {\n syncedPlayer.player = player;\n renderer.playersSynced.set(customEmojis, player);\n }\n\n if(player instanceof RLottiePlayer) {\n player.group = renderer.animationGroup;\n\n player.overrideRender ??= (frame) => {\n syncedPlayersFrames.set(player, frame);\n // frames.set(containers, frame);\n };\n } else if(player instanceof HTMLVideoElement) {\n // player.play();\n\n // const cache = framesCache.getCache(key);\n // let {width, height} = renderer.size;\n // width *= dpr;\n // height *= dpr;\n\n // const onFrame = (frame: ImageBitmap | HTMLCanvasElement) => {\n // topFrames.set(player, frame);\n // player.requestVideoFrameCallback(callback);\n // };\n\n // let frameNo = -1, lastTime = 0;\n // const callback: VideoFrameRequestCallback = (now, metadata) => {\n // const time = player.currentTime;\n // if(lastTime > time) {\n // frameNo = -1;\n // }\n\n // const _frameNo = ++frameNo;\n // lastTime = time;\n // // const frameNo = Math.floor(player.currentTime * 1000 / CUSTOM_EMOJI_FRAME_INTERVAL);\n // // const frameNo = metadata.presentedFrames;\n // const imageBitmap = cache.framesNew.get(_frameNo);\n\n // if(imageBitmap) {\n // onFrame(imageBitmap);\n // } else if(IS_IMAGE_BITMAP_SUPPORTED) {\n // createImageBitmap(player, {resizeWidth: width, resizeHeight: height}).then((imageBitmap) => {\n // cache.framesNew.set(_frameNo, imageBitmap);\n // if(frameNo === _frameNo) onFrame(imageBitmap);\n // });\n // } else {\n // const canvas = document.createElement('canvas');\n // const context = canvas.getContext('2d');\n // canvas.width = width;\n // canvas.height = height;\n // context.drawImage(player, 0, 0);\n // cache.framesNew.set(_frameNo, canvas);\n // onFrame(canvas);\n // }\n // };\n\n // // player.requestVideoFrameCallback(callback);\n // // setInterval(callback, CUSTOM_EMOJI_FRAME_INTERVAL);\n }\n\n if(willHaveSyncedPlayer) {\n const dpr = getLottiePixelRatio(this.size.width, this.size.height);\n renderer.canvas.dpr = dpr;\n setRenderInterval();\n }\n });\n\n let syncedPlayer: SyncedPlayer;\n const key = [docId, size.width, size.height].join('-');\n if(willHaveSyncedPlayer) {\n syncedPlayer = syncedPlayers.get(key);\n if(!syncedPlayer) {\n syncedPlayer = {\n player: undefined,\n middlewares: new Set(),\n pausedElements: new Set(),\n key\n };\n\n syncedPlayers.set(key, syncedPlayer);\n }\n\n for(const element of newElements) {\n const middleware = element.middlewareHelper.get();\n syncedPlayer.middlewares.add(middleware);\n middleware.onClean(() => {\n syncedPlayer.middlewares.delete(middleware);\n\n if(!syncedPlayer.middlewares.size) {\n if(syncedPlayer.player) {\n const frame = syncedPlayersFrames.get(syncedPlayer.player);\n if(frame) {\n (frame as ImageBitmap).close?.();\n syncedPlayersFrames.delete(syncedPlayer.player);\n }\n\n syncedPlayersFrames.delete(syncedPlayer.player);\n if(syncedPlayer.player instanceof RLottiePlayer) {\n syncedPlayer.player.overrideRender = noop;\n syncedPlayer.player.remove();\n } else if(syncedPlayer.player instanceof HTMLVideoElement) {\n const cacheName = framesCache.generateName('' + element.docId, 0, 0, undefined, undefined);\n delete videosCache[cacheName];\n }\n\n syncedPlayer.player = undefined;\n }\n\n if(syncedPlayers.get(syncedPlayer.key) === syncedPlayer && syncedPlayers.delete(syncedPlayer.key) && !syncedPlayers.size) {\n clearRenderInterval();\n }\n }\n });\n }\n }\n\n return promise.then((res) => ({...res, ...addition}));\n };\n\n const missing: DocId[] = [];\n const cachedPromises = docs.map((doc, idx) => {\n if(!doc) {\n missing.push(docIds[idx]);\n return;\n }\n\n return wrap(doc, loadPromises);\n }).filter(Boolean);\n\n const uncachedPromisesPromise = !missing.length ?\n Promise.resolve([] as typeof cachedPromises) :\n managers.appEmojiManager.getCustomEmojiDocuments(missing).then((docs) => {\n if(middleware && !middleware()) return [];\n return docs.filter(Boolean).map((doc) => wrap(doc));\n });\n\n const loadFromPromises = (promises: typeof cachedPromises) => {\n return Promise.all(promises).then((arr) => {\n const promises = arr.map(({load, onRender, elements}) => {\n if(!load) {\n return;\n }\n\n const l = () => load().then(onRender);\n\n if(usingOwnQueue) {\n elements.forEach((element) => {\n globalLazyLoadQueue.push({\n div: element,\n load: () => {\n elements.forEach((element) => {\n globalLazyLoadQueue.delete({div: element});\n });\n\n return l();\n }\n });\n });\n } else {\n return l();\n }\n });\n\n return Promise.all(promises);\n });\n };\n\n const load = () => {\n if(middleware && !middleware()) return;\n const cached = loadFromPromises(cachedPromises);\n const uncached = uncachedPromisesPromise.then((promises) => loadFromPromises(promises));\n return Promise.all([cached, uncached]);\n };\n\n if(lazyLoadQueue) {\n lazyLoadQueue.push({\n div: renderer.canvas,\n load\n });\n } else {\n load();\n }\n\n return Promise.all(cachedPromises).then(() => Promise.all(loadPromises)).then(() => {});\n });\n\n // recordPromise(loadPromise, 'render emojis: ' + docIds.length);\n\n return loadPromise;\n }\n\n public static create(options: CustomEmojiRendererElementOptions) {\n const renderer = new CustomEmojiRendererElement();\n renderer.animationGroup = options.animationGroup;\n renderer.size = options.customEmojiSize || mediaSizes.active.customEmoji;\n renderer.isSelectable = options.isSelectable;\n if(options.wrappingDraft) {\n renderer.contentEditable = 'false';\n renderer.style.height = 'inherit';\n }\n // const middleware = () => !!renderer.disconnectedCallback && (!options.middleware || options.middleware());\n let middleware = options.middleware;\n if(middleware) {\n renderer.middlewareHelper = middleware.create();\n middleware = renderer.middlewareHelper.get();\n middleware.onDestroy(() => {\n renderer.destroy?.();\n });\n } else {\n // console.error('no middleware', this, options);\n renderer.auto = true;\n renderer.middlewareHelper = getMiddleware();\n }\n\n return renderer;\n }\n}\n\ntype CustomEmojiRenderer = CustomEmojiRendererElement;\ntype SyncedPlayer = {\n player: RLottiePlayer | HTMLVideoElement,\n middlewares: Set,\n pausedElements: Set,\n key: string\n};\ntype CustomEmojiFrame = Parameters[0] | HTMLVideoElement;\n\nconst CUSTOM_EMOJI_INSTANT_PLAY = true; // do not wait for animationIntersector\nlet emojiRenderInterval: number;\nconst emojiRenderers: Set = new Set();\nconst syncedPlayers: Map = new Map();\nconst syncedPlayersFrames: Map = new Map();\nexport const renderEmojis = (renderers = emojiRenderers) => {\n const r = Array.from(renderers);\n const t = r.filter((r) => r.isConnected && r.checkForAnyFrame() && !r.ignoreSettingDimensions);\n if(!t.length) {\n return false;\n }\n\n const o = t.map((renderer) => {\n const paused = [...renderer.playersSynced.values()].reduce((acc, v) => acc + +!!v.paused, 0);\n if(renderer.playersSynced.size === paused) {\n return;\n }\n\n const offsets = renderer.getOffsets();\n if(offsets.size) {\n return [renderer, offsets] as const;\n }\n }).filter(Boolean);\n\n for(const [renderer] of o) {\n renderer.clearCanvas();\n }\n\n for(const [renderer, offsets] of o) {\n renderer.render(offsets);\n }\n\n return true;\n};\nconst CUSTOM_EMOJI_FPS = 60;\nconst CUSTOM_EMOJI_FRAME_INTERVAL = 1000 / CUSTOM_EMOJI_FPS;\nconst setRenderInterval = () => {\n if(emojiRenderInterval) {\n return;\n }\n\n emojiRenderInterval = window.setInterval(renderEmojis, CUSTOM_EMOJI_FRAME_INTERVAL);\n renderEmojis();\n};\nconst clearRenderInterval = () => {\n if(!emojiRenderInterval) {\n return;\n }\n\n clearInterval(emojiRenderInterval);\n emojiRenderInterval = undefined;\n};\n\n(window as any).syncedPlayers = syncedPlayers;\n(window as any).emojiRenderers = emojiRenderers;\n\ncustomElements.define('custom-emoji-element', CustomEmojiElement);\ncustomElements.define('custom-emoji-renderer-element', CustomEmojiRendererElement);\n\ntype CustomEmojiRendererElementOptions = Partial<{\n loadPromises: Promise[],\n customEmojiRenderer: CustomEmojiRendererElement,\n\n isSelectable: boolean,\n wrappingDraft: boolean\n}> & WrapSomethingOptions;\n\n/**\n * * Expecting correctly sorted nested entities (RichTextProcessor.sortEntities)\n */\nexport default function wrapRichText(text: string, options: Partial<{\n entities: MessageEntity[],\n contextSite: string,\n highlightUsername: string,\n noLinks: boolean,\n noLinebreaks: boolean,\n noCommands: boolean,\n wrappingDraft: boolean,\n // mustWrapEmoji: boolean,\n fromBot: boolean,\n noTextFormat: boolean,\n passEntities: Partial<{\n [_ in MessageEntity['_']]: boolean\n }>,\n maxMediaTimestamp: number,\n noEncoding: boolean,\n isSelectable: boolean,\n\n contextHashtag?: string,\n\n // ! recursive, do not provide\n nasty?: {\n i: number,\n usedLength: number,\n text: string,\n lastEntity?: MessageEntity\n },\n voodoo?: boolean,\n customEmojis?: Map,\n customWraps?: Set,\n}> & CustomEmojiRendererElementOptions = {}) {\n const fragment = document.createDocumentFragment();\n if(!text) {\n return fragment;\n }\n\n const nasty = options.nasty ??= {\n i: 0,\n usedLength: 0,\n text\n };\n\n const wrapSomething = (wrapElement: HTMLElement, noFiller?: boolean) => {\n const element = document.createElement('span');\n // element.append(BOM, a, BOM);\n if(options.wrappingDraft) {\n element.contentEditable = 'false';\n }\n // element.style.display = 'inline-block';\n element.classList.add('input-something');\n element.append(/* BOM, */wrapElement);\n\n (lastElement || fragment).append(element);\n\n wrapElement.classList.add('input-selectable');\n // if(wrapElement instanceof HTMLImageElement) {\n // element.prepend(f());\n // } else {\n !noFiller && wrapElement.append(createCustomFiller(true));\n // }\n\n customWraps.add(element);\n\n return element;\n };\n\n options.isSelectable ||= options.wrappingDraft;\n\n const customEmojis = options.customEmojis ??= new Map() as Map;\n const customWraps = options.customWraps ??= new Set();\n\n const entities = options.entities ??= parseEntities(nasty.text);\n\n const passEntities = options.passEntities ??= {};\n const contextSite = options.contextSite ??= 'Telegram';\n const contextExternal = contextSite !== 'Telegram';\n\n const textLength = nasty.text.length;\n const length = entities.length;\n let lastElement: HTMLElement | DocumentFragment;\n for(; nasty.i < length; ++nasty.i) {\n let entity = entities[nasty.i];\n\n // * check whether text was sliced\n // TODO: consider about moving it to other function\n if(entity.offset >= textLength) {\n if(entity._ !== 'messageEntityCaret') { // * can set caret to the end\n continue;\n }\n } else if((entity.offset + entity.length) > textLength) {\n entity = copy(entity);\n // entity.length = entity.offset + entity.length - textLength;\n entity.length = textLength - entity.offset;\n }\n\n if(entity.length) {\n nasty.lastEntity = entity;\n }\n\n let nextEntity = entities[nasty.i + 1];\n\n const startOffset = entity.offset;\n const endOffset = startOffset + entity.length;\n const endPartOffset = Math.min(endOffset, nextEntity?.offset ?? 0xFFFF);\n const fullEntityText = nasty.text.slice(startOffset, endOffset);\n const sliced = nasty.text.slice(startOffset, endPartOffset);\n let partText = sliced;\n\n if(nasty.usedLength < startOffset) {\n (lastElement || fragment).append(nasty.text.slice(nasty.usedLength, startOffset));\n }\n\n if(lastElement) {\n lastElement = fragment;\n }\n\n nasty.usedLength = endPartOffset;\n\n let element: HTMLElement,\n property: 'textContent' | 'alt' = 'textContent',\n usedText = false;\n switch(entity._) {\n case 'messageEntityBold': {\n if(!options.noTextFormat) {\n if(options.wrappingDraft) {\n element = document.createElement('span');\n // element.style.fontWeight = 'bold';\n element.style.fontFamily = 'markup-bold';\n } else {\n element = document.createElement('strong');\n }\n }\n\n break;\n }\n\n case 'messageEntityItalic': {\n if(!options.noTextFormat) {\n if(options.wrappingDraft) {\n element = document.createElement('span');\n // element.style.fontStyle = 'italic';\n element.style.fontFamily = 'markup-italic';\n } else {\n element = document.createElement('em');\n }\n }\n\n break;\n }\n\n case 'messageEntityStrike': {\n if(options.wrappingDraft) {\n element = document.createElement('span');\n // const styleName = IS_SAFARI ? 'text-decoration' : 'text-decoration-line';\n // element.style.cssText = `${styleName}: line-through;`;\n element.style.fontFamily = 'markup-strikethrough';\n } else/* if(!options.noTextFormat) */ {\n element = document.createElement('del');\n }\n\n break;\n }\n\n case 'messageEntityUnderline': {\n if(options.wrappingDraft) {\n element = document.createElement('span');\n // const styleName = IS_SAFARI ? 'text-decoration' : 'text-decoration-line';\n // element.style.cssText = `${styleName}: underline;`;\n element.style.fontFamily = 'markup-underline';\n } else if(!options.noTextFormat) {\n element = document.createElement('u');\n }\n\n break;\n }\n\n case 'messageEntityPre':\n case 'messageEntityCode': {\n if(options.wrappingDraft) {\n element = document.createElement('span');\n // element.style.fontFamily = 'var(--font-monospace)';\n element.style.fontFamily = 'markup-monospace';\n } else if(!options.noTextFormat) {\n element = document.createElement('code');\n }\n\n break;\n }\n\n // case 'messageEntityPre': {\n // if(options.wrappingDraft) {\n // element = document.createElement('span');\n // element.style.fontFamily = 'var(--font-monospace)';\n // } else if(!options.noTextFormat) {\n // element = document.createElement('pre');\n // const inner = document.createElement('code');\n // if(entity.language) {\n // inner.className = 'language-' + entity.language;\n // inner.textContent = entityText;\n // usedText = true;\n // }\n // }\n\n // break;\n // }\n\n case 'messageEntityHighlight': {\n element = document.createElement('i');\n element.className = 'text-highlight';\n break;\n }\n\n case 'messageEntityBotCommand': {\n // if(!(options.noLinks || options.noCommands || contextExternal)/* && !entity.unsafe */) {\n if(!options.noLinks && passEntities[entity._]) {\n let command = fullEntityText.slice(1);\n let bot: string | boolean;\n let atPos: number;\n if((atPos = command.indexOf('@')) !== -1) {\n bot = command.slice(atPos + 1);\n command = command.slice(0, atPos);\n } else {\n bot = options.fromBot;\n }\n\n element = document.createElement('a');\n (element as HTMLAnchorElement).href = encodeEntities('tg://bot_command?command=' + encodeURIComponent(command) + (bot ? '&bot=' + encodeURIComponent(bot) : ''));\n if(!contextExternal) {\n element.setAttribute('onclick', 'execBotCommand(this)');\n }\n }\n\n break;\n }\n\n case 'messageEntityCustomEmoji': {\n if(!IS_CUSTOM_EMOJI_SUPPORTED) {\n break;\n }\n\n while(nextEntity?._ === 'messageEntityEmoji' && nextEntity.offset < endOffset) {\n ++nasty.i;\n nasty.lastEntity = nextEntity;\n nasty.usedLength += nextEntity.length;\n nextEntity = entities[nasty.i + 1];\n }\n\n const customEmojiElement = element = CustomEmojiElement.create(entity.document_id);\n const {docId} = customEmojiElement;\n let set = customEmojis.get(docId);\n if(!set) customEmojis.set(docId, set = new Set());\n set.add(customEmojiElement);\n customEmojiElement.dataset.stickerEmoji = fullEntityText;\n\n if(options.wrappingDraft) {\n element = document.createElement('img');\n (element as HTMLImageElement).alt = fullEntityText;\n for(const i in customEmojiElement.dataset) {\n element.dataset[i] = customEmojiElement.dataset[i];\n }\n (element as any).customEmojiElement = customEmojiElement;\n customEmojiElement.placeholder = element as HTMLImageElement;\n element.classList.add('custom-emoji-placeholder');\n (element as HTMLImageElement).src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAtJREFUGFdjYAACAAAFAAGq1chRAAAAAElFTkSuQmCC';\n property = 'alt';\n break;\n }\n\n if(options.isSelectable) {\n // const s = document.createElement('span');\n // s.append(fullEntityText);\n // element.append(s);\n // element.textContent = fullEntityText;\n // element.textContent = 'a';\n // element.contentEditable = 'false';\n\n // const x = f();\n // x.style.display = 'inline-block';\n // x.contentEditable = 'false';\n // (lastElement || fragment).append(BOM);\n // (lastElement || fragment).append(x);\n\n element = wrapSomething(element, !!options.customEmojiRenderer);\n\n // const a = element;\n // element = document.createElement('span');\n // element.append(BOM, a, BOM);\n // element.contentEditable = 'false';\n }\n\n property = 'alt';\n break;\n }\n\n case 'messageEntityEmoji': {\n let isSupported = IS_EMOJI_SUPPORTED;\n if(isSupported) {\n for(const version in EmojiVersions) {\n if(version) {\n const emojiData = EmojiVersions[version as EMOJI_VERSION];\n if(emojiData.hasOwnProperty(entity.unicode) && !EMOJI_VERSIONS_SUPPORTED[version as EMOJI_VERSION]) {\n isSupported = false;\n break;\n }\n }\n }\n }\n\n // if(!(options.wrappingDraft && isSupported)) { // * fix safari emoji\n if(!isSupported) { // no wrapping needed\n // if(isSupported) { // ! contenteditable=\"false\" нужен для поля ввода, иначе там будет меняться шрифт в Safari, или же рендерить смайлик напрямую, без контейнера\n // insertPart(entity, '', '');\n // } else {\n element = document.createElement('img');\n (element as HTMLImageElement).src = `assets/img/emoji/${entity.unicode}.png`;\n property = 'alt';\n element.className = 'emoji';\n\n // if(options.isSelectable) {\n // usedText = true;\n // (element as HTMLImageElement).alt = partText;\n // element = wrapSomething(element);\n // }\n\n // const a = element;\n // a.contentEditable = 'false';\n // element = document.createElement('span');\n // element.append(a);\n // element.contentEditable = 'false';\n // }\n // } else if(options.mustWrapEmoji) {\n } else if(!options.wrappingDraft) {\n element = document.createElement('span');\n element.className = 'emoji';\n }/* else if(!IS_SAFARI) {\n insertPart(entity, '', '');\n } */\n /* if(!isSupported) {\n insertPart(entity, `\"`,`);\n } */\n\n break;\n }\n\n case 'messageEntityCaret': {\n element = document.createElement('span');\n element.className = 'composer-sel';\n break;\n }\n\n // case 'messageEntityLinebreak': {\n // if(options.noLinebreaks) {\n // insertPart(entity, ' ');\n // } else {\n // insertPart(entity, '
');\n // }\n\n // break;\n // }\n\n case 'messageEntityUrl':\n case 'messageEntityTextUrl': {\n if(!(options.noLinks && !passEntities[entity._])) {\n // let inner: string;\n let url: string = (entity as MessageEntity.messageEntityTextUrl).url || fullEntityText;\n let masked = false;\n let onclick: string;\n\n const wrapped = wrapUrl(url, true);\n url = wrapped.url;\n onclick = wrapped.onclick;\n\n if(entity._ === 'messageEntityTextUrl') {\n if(nextEntity?._ === 'messageEntityUrl' &&\n nextEntity.length === entity.length &&\n nextEntity.offset === entity.offset) {\n nasty.lastEntity = nextEntity;\n ++nasty.i;\n }\n\n if(url !== fullEntityText) {\n masked = true;\n }\n } else {\n // inner = encodeEntities(replaceUrlEncodings(entityText));\n }\n\n const currentContext = !!onclick;\n if(!onclick && masked && !currentContext) {\n onclick = 'showMaskedAlert';\n }\n\n if(options.wrappingDraft) {\n onclick = undefined;\n }\n\n const href = (currentContext || typeof electronHelpers === 'undefined') ?\n url :\n `javascript:electronHelpers.openExternal('${url}');`;\n\n element = document.createElement('a');\n element.className = 'anchor-url';\n (element as HTMLAnchorElement).href = href;\n\n if(!(currentContext || typeof electronHelpers !== 'undefined')) {\n setBlankToAnchor(element as HTMLAnchorElement);\n }\n\n if(onclick) {\n element.setAttribute('onclick', onclick + '(this)');\n }\n }\n\n break;\n }\n\n case 'messageEntityEmail': {\n if(!options.noLinks) {\n element = document.createElement('a');\n (element as HTMLAnchorElement).href = encodeEntities('mailto:' + fullEntityText);\n setBlankToAnchor(element as HTMLAnchorElement);\n }\n\n break;\n }\n\n case 'messageEntityHashtag': {\n const contextUrl = !options.noLinks && SITE_HASHTAGS[contextSite];\n if(contextUrl) {\n const hashtag = fullEntityText.slice(1);\n element = document.createElement('a');\n element.className = 'anchor-hashtag';\n (element as HTMLAnchorElement).href = contextUrl.replace('{1}', encodeURIComponent(hashtag));\n if(contextExternal) {\n setBlankToAnchor(element as HTMLAnchorElement);\n } else {\n element.setAttribute('onclick', 'searchByHashtag(this)');\n }\n }\n\n break;\n }\n\n case 'messageEntityMentionName': {\n if(!(options.noLinks && !passEntities[entity._])) {\n element = document.createElement('a');\n (element as HTMLAnchorElement).href = buildURLHash('' + entity.user_id);\n element.className = 'follow';\n element.dataset.follow = '' + entity.user_id;\n }\n\n break;\n }\n\n case 'messageEntityMention': {\n // const contextUrl = !options.noLinks && siteMentions[contextSite];\n if(!options.noLinks) {\n const username = fullEntityText.slice(1);\n\n element = wrapTelegramUrlToAnchor('t.me/' + username);\n element.className = 'mention';\n\n // insertPart(entity, ``, '');\n }\n\n break;\n }\n\n case 'messageEntitySpoiler': {\n if(options.noTextFormat) {\n const encoded = encodeSpoiler(nasty.text, entity);\n nasty.text = encoded.text;\n partText = encoded.entityText;\n if(endPartOffset !== endOffset) {\n nasty.usedLength += endOffset - endPartOffset;\n }\n let n: MessageEntity;\n for(; n = entities[nasty.i + 1], n && n.offset < endOffset;) {\n // nasty.usedLength += n.length;\n ++nasty.i;\n nasty.lastEntity = n;\n nextEntity = entities[nasty.i + 1];\n }\n } else if(options.wrappingDraft) {\n element = document.createElement('span');\n // element.style.fontFamily = 'spoiler';\n element.style.fontFamily = 'markup-spoiler';\n } else {\n const container = document.createElement('span');\n container.className = 'spoiler';\n element = document.createElement('span');\n element.className = 'spoiler-text';\n element.textContent = partText;\n usedText = true;\n container.append(element);\n fragment.append(container);\n\n container[`on${CLICK_EVENT_NAME}`] = (window as any).onSpoilerClick;\n }\n\n break;\n }\n\n case 'messageEntityTimestamp': {\n if(!options.maxMediaTimestamp || entity.time > options.maxMediaTimestamp) {\n break;\n }\n\n element = document.createElement('a');\n element.classList.add('timestamp');\n element.dataset.timestamp = '' + entity.time;\n (element as HTMLAnchorElement).href = '#';\n element.setAttribute('onclick', 'setMediaTimestamp(this)');\n\n if(options.maxMediaTimestamp === Infinity) {\n element.classList.add('is-disabled');\n }\n\n break;\n }\n }\n\n if(!usedText && partText) {\n if(element) {\n // @ts-ignore\n element[property] = partText;\n } else {\n (element || fragment).append(partText);\n }\n }\n\n if(element && !element.parentNode) {\n (lastElement || fragment).append(element);\n }\n\n while(nextEntity && nextEntity.offset < endOffset) {\n ++nasty.i;\n\n (element || fragment).append(wrapRichText(nasty.text, {\n ...options,\n voodoo: true\n }));\n\n nextEntity = entities[nasty.i + 1];\n }\n\n // if(!element?.parentNode) {\n // (lastElement || fragment).append(element ?? partText);\n // }\n\n if(nasty.usedLength <= endOffset) {\n if(nasty.usedLength < endOffset) {\n (element || fragment).append(nasty.text.slice(nasty.usedLength, endOffset));\n nasty.usedLength = endOffset;\n }\n\n lastElement = fragment;\n nasty.lastEntity = undefined;\n } else if(entity.length > partText.length && element) {\n lastElement = element;\n } else {\n lastElement = fragment;\n }\n\n if(options.voodoo) {\n return fragment;\n }\n }\n\n if(nasty.lastEntity) {\n nasty.usedLength = nasty.lastEntity.offset + nasty.lastEntity.length;\n }\n\n if(nasty.usedLength < textLength) {\n (lastElement || fragment).append(nasty.text.slice(nasty.usedLength));\n }\n\n if((!options.wrappingDraft || options.customEmojiRenderer) && customEmojis.size) {\n let renderer = options.customEmojiRenderer;\n if(!renderer) {\n renderer = CustomEmojiRendererElement.create(options);\n fragment.prepend(renderer);\n }\n\n const loadPromise = renderer.add(customEmojis, options.lazyLoadQueue, options.wrappingDraft);\n options.loadPromises?.push(loadPromise);\n // recordPromise(loadPromise, 'render emojis: ' + docIds.length);\n }\n\n if(customWraps.size) {\n insertCustomFillers(customWraps);\n }\n\n return fragment;\n}\n\nexport const createCustomFiller = (notFiller?: boolean) => {\n const x = document.createElement('span');\n x.classList.add(notFiller ? 'input-filler2' : 'input-filler');\n x.textContent = BOM;\n return x;\n};\n\nexport function isCustomFillerNeededBySiblingNode(node: ChildNode) {\n if(\n // !node?.textContent ||\n // node.textContent.endsWith('\\n') ||\n node?.textContent !== BOM ||\n (node as HTMLElement)?.getAttribute?.('contenteditable') === 'false'\n ) {\n // if(!node || (node as HTMLElement).firstElementChild || node.textContent.endsWith('\\n')) {\n if(!node || node.textContent !== BOM || (node as HTMLElement).firstElementChild) {\n return 2;\n } else if(node.nodeType === node.ELEMENT_NODE) {\n return 1;\n }/* else if(node.nodeType === node.TEXT_NODE && !node.nodeValue) {\n (node as CharacterData).insertData(0, BOM);\n } */\n }\n\n return 0;\n}\n\nexport function insertCustomFillers(elements: Iterable) {\n const check = (element: HTMLElement, node: ChildNode, method: 'before' | 'after') => {\n const needed = isCustomFillerNeededBySiblingNode(node);\n if(needed === 2) {\n element[method](createCustomFiller());\n } else if(needed === 1) {\n node.appendChild(document.createTextNode(BOM));\n }\n };\n\n for(const element of elements) {\n const {previousSibling, nextSibling} = element;\n check(element, previousSibling, 'before');\n check(element, nextSibling, 'after');\n }\n}\n\n(window as any).wrapRichText = wrapRichText;\n","// just for the future\nexport default function buildURLHash(str: string) {\n return '#' + encodeURIComponent(str);\n}\n","import wrapUrl from './wrapUrl';\n\nexport default function wrapTelegramUrlToAnchor(url1: string) {\n const {url, onclick} = wrapUrl(url1);\n const element = document.createElement('a');\n (element as HTMLAnchorElement).href = url;\n if(onclick) {\n element.setAttribute('onclick', `${onclick}(this)`);\n }\n\n return element;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport CAN_USE_TRANSFERABLES from '../../environment/canUseTransferables';\nimport EventListenerBase from '../../helpers/eventListenerBase';\n\nexport default class QueryableWorker extends EventListenerBase<{\n ready: () => void,\n frame: (reqId: number, frameNo: number, frame: Uint8ClampedArray | ImageBitmap) => void,\n loaded: (reqId: number, frameCount: number, fps: number) => void,\n error: (reqId: number, error: Error) => void,\n workerError: (error: ErrorEvent) => void\n}> {\n constructor(private worker: Worker) {\n super();\n\n this.worker.onerror = (error) => {\n try {\n this.dispatchEvent('workerError', error);\n this.cleanup();\n this.terminate();\n } catch(err) {\n\n }\n };\n\n this.worker.onmessage = (event) => {\n this.dispatchEvent(event.data.queryMethodListener, ...event.data.queryMethodArguments);\n };\n }\n\n public postMessage(message: any) {\n this.worker.postMessage(message);\n }\n\n public terminate() {\n this.worker.terminate();\n }\n\n public sendQuery(args: any[], transfer?: Transferable[]) {\n this.worker.postMessage({\n queryMethod: args.shift(),\n queryMethodArguments: args\n }, CAN_USE_TRANSFERABLES ? transfer: undefined);\n }\n}\n","const IS_WEB_ASSEMBLY_SUPPORTED = typeof(WebAssembly) !== 'undefined';\n\nexport default IS_WEB_ASSEMBLY_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {LiteModeKey} from '../../helpers/liteMode';\nimport animationIntersector, {AnimationItemGroup} from '../../components/animationIntersector';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport pause from '../../helpers/schedulers/pause';\nimport {logger, LogTypes} from '../logger';\nimport RLottiePlayer, {RLottieOptions} from './rlottiePlayer';\nimport QueryableWorker from './queryableWorker';\nimport blobConstruct from '../../helpers/blob/blobConstruct';\nimport apiManagerProxy from '../mtproto/mtprotoworker';\nimport IS_WEB_ASSEMBLY_SUPPORTED from '../../environment/webAssemblySupport';\nimport makeError from '../../helpers/makeError';\nimport App from '../../config/app';\n\nexport type LottieAssetName = 'EmptyFolder' | 'Folders_1' | 'Folders_2' |\n 'TwoFactorSetupMonkeyClose' | 'TwoFactorSetupMonkeyCloseAndPeek' |\n 'TwoFactorSetupMonkeyCloseAndPeekToIdle' | 'TwoFactorSetupMonkeyIdle' |\n 'TwoFactorSetupMonkeyPeek' | 'TwoFactorSetupMonkeyTracking' |\n 'voice_outlined2' | 'voip_filled' | 'voice_mini' | 'jolly_roger';\n\nexport class LottieLoader {\n private loadPromise: Promise = !IS_WEB_ASSEMBLY_SUPPORTED ? Promise.reject() : undefined;\n private loaded = false;\n\n private workersLimit = App.threads;\n private players: {[reqId: number]: RLottiePlayer} = {};\n private playersByCacheName: {[cacheName: string]: Set} = {};\n\n private workers: QueryableWorker[] = [];\n private curWorkerNum = 0;\n\n private log = logger('LOTTIE', LogTypes.Error);\n\n public getAnimation(element: HTMLElement) {\n for(const i in this.players) {\n if(this.players[i].el.includes(element)) {\n return this.players[i];\n }\n }\n\n return null;\n }\n\n public loadLottieWorkers() {\n if(this.loadPromise) {\n return this.loadPromise;\n }\n\n return this.loadPromise = new Promise((resolve, reject) => {\n let remain = this.workersLimit;\n for(let i = 0; i < this.workersLimit; ++i) {\n const worker = new Worker(new URL('./rlottie.worker.ts', import.meta.url));\n const queryableWorker = this.workers[i] = new QueryableWorker(worker);\n\n queryableWorker.addEventListener('ready', () => {\n this.log('worker #' + i + ' ready');\n\n queryableWorker.addEventListener('frame', this.onFrame);\n queryableWorker.addEventListener('loaded', this.onPlayerLoaded);\n queryableWorker.addEventListener('error', this.onPlayerError);\n\n --remain;\n if(!remain) {\n this.log('workers ready');\n resolve();\n this.loaded = true;\n }\n }, {once: true});\n\n queryableWorker.addEventListener('workerError', (error) => {\n reject('rlottie load error: ' + error.message);\n this.loaded = false;\n }, {once: true});\n }\n });\n }\n\n private makeAssetUrl(name: LottieAssetName) {\n return 'assets/tgs/' + name + '.json';\n }\n\n public loadAnimationAsAsset(params: Omit, name: LottieAssetName) {\n // (params as RLottieOptions).name = name;\n return this.loadAnimationFromURL(params, this.makeAssetUrl(name));\n }\n\n public loadAnimationDataFromURL(url: string): Promise {\n if(!IS_WEB_ASSEMBLY_SUPPORTED) {\n return this.loadPromise as any;\n }\n\n this.loadLottieWorkers();\n\n return fetch(url)\n .then((res) => {\n if(!res.headers || res.headers.get('content-type') === 'application/octet-stream') {\n return res.arrayBuffer()\n .then((data) => apiManagerProxy.invokeCrypto('gzipUncompress', data))\n .then((arr) => blobConstruct(arr as Uint8Array, ''));\n } else {\n return res.blob();\n }\n });\n /* .then((str) => {\n return new Promise((resolve) => setTimeout(() => resolve(str), 2e3));\n }) */\n }\n\n public loadAnimationFromURLManually(name: LottieAssetName) {\n const url = this.makeAssetUrl(name);\n return this.loadAnimationDataFromURL(url).then((blob) => {\n return (params: Omit) => this.loadAnimationFromURLNext(blob, params, url);\n });\n }\n\n public loadAnimationFromURL(params: Omit, url: string) {\n return this.loadAnimationDataFromURL(url).then((blob) => {\n return this.loadAnimationFromURLNext(blob, params, url);\n });\n }\n\n public loadAnimationFromURLNext(blob: Blob, params: Omit, url: string) {\n const newParams = Object.assign(params, {animationData: blob, needUpscale: true});\n newParams.name ||= url;\n return this.loadAnimationWorker(newParams);\n }\n\n public waitForFirstFrame(player: RLottiePlayer) {\n return Promise.race([\n /* new Promise((resolve) => {\n player.addEventListener('firstFrame', () => {\n setTimeout(() => resolve(), 1500);\n }, true);\n }) */\n new Promise((resolve) => {\n player.addEventListener('firstFrame', resolve, {once: true});\n }),\n pause(2500)\n ]).then(() => player);\n }\n\n public async loadAnimationWorker(params: RLottieOptions): Promise {\n if(!IS_WEB_ASSEMBLY_SUPPORTED) {\n return this.loadPromise as any;\n }\n\n if(!this.loaded) {\n await this.loadLottieWorkers();\n }\n\n const {middleware, group = ''} = params;\n if(middleware && !middleware()) {\n throw makeError('MIDDLEWARE');\n }\n\n if(params.sync) {\n const cacheName = RLottiePlayer.CACHE.generateName(params.name, params.width, params.height, params.color, params.toneIndex);\n const players = this.playersByCacheName[cacheName];\n if(players?.size) {\n return Promise.resolve(players.entries().next().value[0]);\n }\n }\n\n const containers = Array.isArray(params.container) ? params.container : [params.container];\n if(!params.width || !params.height) {\n params.width = parseInt(containers[0].style.width);\n params.height = parseInt(containers[0].style.height);\n }\n\n if(!params.width || !params.height) {\n throw new Error('No size for sticker!');\n }\n\n params.group = group;\n\n const player = this.initPlayer(containers, params);\n\n animationIntersector.addAnimation({\n animation: player,\n group,\n controlled: middleware,\n liteModeKey: params.liteModeKey\n });\n\n return player;\n }\n\n private onPlayerLoaded = (reqId: number, frameCount: number, fps: number) => {\n const player = this.players[reqId];\n if(!player) {\n this.log.warn('onPlayerLoaded on destroyed player:', reqId, frameCount);\n return;\n }\n\n this.log.debug('onPlayerLoaded');\n player.onLoad(frameCount, fps);\n };\n\n private onFrame = (reqId: number, frameNo: number, frame: Uint8ClampedArray | ImageBitmap) => {\n const player = this.players[reqId];\n if(!player) {\n this.log.warn('onFrame on destroyed player:', reqId, frameNo);\n return;\n }\n\n if(player.clamped !== undefined && frame instanceof Uint8ClampedArray) {\n player.clamped = frame;\n }\n\n player.renderFrame(frame, frameNo);\n };\n\n private onPlayerError = (reqId: number, error: Error) => {\n const player = this.players[reqId];\n if(!player) {\n return;\n }\n\n // ! will need refactoring later, this is not the best way to remove the animation\n const animations = animationIntersector.getAnimations(player.el[0]);\n animations.forEach((animation) => {\n animationIntersector.removeAnimation(animation);\n });\n };\n\n public onDestroy(reqId: number) {\n delete this.players[reqId];\n }\n\n public destroyWorkers() {\n if(!IS_WEB_ASSEMBLY_SUPPORTED) {\n return;\n }\n\n this.workers.forEach((worker, idx) => {\n worker.terminate();\n this.log('worker #' + idx + ' terminated');\n });\n\n this.log('workers destroyed');\n this.workers.length = 0;\n this.curWorkerNum = 0;\n this.loaded = false;\n this.loadPromise = undefined;\n }\n\n private initPlayer(el: RLottiePlayer['el'], options: RLottieOptions) {\n const player = new RLottiePlayer({\n el,\n worker: this.workers[this.curWorkerNum++],\n options\n });\n\n const {reqId, cacheName} = player;\n this.players[reqId] = player;\n\n const playersByCacheName = cacheName ? this.playersByCacheName[cacheName] ??= new Set() : undefined;\n if(cacheName) {\n playersByCacheName.add(player);\n }\n\n if(this.curWorkerNum >= this.workers.length) {\n this.curWorkerNum = 0;\n }\n\n player.addEventListener('destroy', () => {\n this.onDestroy(reqId);\n if(playersByCacheName.delete(player) && !playersByCacheName.size) {\n delete this.playersByCacheName[cacheName];\n }\n });\n\n player.loadFromData(options.animationData);\n\n return player;\n }\n}\n\nconst lottieLoader = new LottieLoader();\nMOUNT_CLASS_TO.lottieLoader = lottieLoader;\nexport default lottieLoader;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AnimationItemGroup, AnimationItemWrapper} from '../../components/animationIntersector';\nimport type {Middleware} from '../../helpers/middleware';\nimport type {LiteModeKey} from '../../helpers/liteMode';\nimport CAN_USE_TRANSFERABLES from '../../environment/canUseTransferables';\nimport IS_APPLE_MX from '../../environment/appleMx';\nimport {IS_ANDROID, IS_APPLE_MOBILE, IS_APPLE, IS_SAFARI} from '../../environment/userAgent';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport clamp from '../../helpers/number/clamp';\nimport QueryableWorker from './queryableWorker';\nimport IS_IMAGE_BITMAP_SUPPORTED from '../../environment/imageBitmapSupport';\nimport framesCache, {FramesCache, FramesCacheItem} from '../../helpers/framesCache';\n\nexport type RLottieOptions = {\n container: HTMLElement | HTMLElement[],\n middleware?: Middleware,\n canvas?: HTMLCanvasElement,\n autoplay?: boolean,\n animationData: Blob,\n loop?: RLottiePlayer['loop'],\n width?: number,\n height?: number,\n group?: AnimationItemGroup,\n noCache?: boolean,\n needUpscale?: boolean,\n skipRatio?: number,\n initFrame?: number, // index\n color?: RLottieColor,\n inverseColor?: RLottieColor,\n name?: string,\n skipFirstFrameRendering?: boolean,\n toneIndex?: number,\n sync?: boolean,\n liteModeKey?: LiteModeKey\n};\n\nexport type RLottieColor = [number, number, number];\n\nexport function getLottiePixelRatio(width: number, height: number, needUpscale?: boolean) {\n let pixelRatio = clamp(window.devicePixelRatio, 1, 2);\n if(pixelRatio > 1 && !needUpscale) {\n if(width > 90 && height > 90) {\n if(!IS_APPLE && mediaSizes.isMobile) {\n pixelRatio = 1;\n }\n } else if((width > 60 && height > 60) || IS_ANDROID) {\n pixelRatio = Math.max(1.5, pixelRatio - 1.5);\n }\n }\n\n return pixelRatio;\n}\n\nexport default class RLottiePlayer extends EventListenerBase<{\n enterFrame: (frameNo: number) => void,\n ready: () => void,\n firstFrame: () => void,\n cached: () => void,\n destroy: () => void\n}> implements AnimationItemWrapper {\n public static CACHE = framesCache;\n private static reqId = 0;\n\n public reqId = 0;\n public curFrame: number;\n private frameCount: number;\n private fps: number;\n private skipDelta: number;\n public name: string;\n public cacheName: string;\n private toneIndex: number;\n\n private worker: QueryableWorker;\n\n private width = 0;\n private height = 0;\n\n public el: HTMLElement[];\n public canvas: HTMLCanvasElement[];\n private contexts: CanvasRenderingContext2D[];\n\n public paused = true;\n // public paused = false;\n public direction = 1;\n private speed = 1;\n public autoplay = true;\n public _autoplay: boolean; // ! will be used to store original value for settings.stickers.loop\n public loop: number | boolean = true;\n public _loop: RLottiePlayer['loop']; // ! will be used to store original value for settings.stickers.loop\n public group: AnimationItemGroup = '';\n public liteModeKey: LiteModeKey;\n\n private frInterval: number;\n private frThen: number;\n private rafId: number;\n\n // private caching = false;\n // private removed = false;\n\n private cache: FramesCacheItem;\n private imageData: ImageData;\n public clamped: Uint8ClampedArray;\n private cachingDelta = 0;\n\n private initFrame: number;\n private color: RLottieColor;\n private inverseColor: RLottieColor;\n\n public minFrame: number;\n public maxFrame: number;\n\n private playedTimes = 0;\n\n private currentMethod: RLottiePlayer['mainLoopForwards'] | RLottiePlayer['mainLoopBackwards'];\n private frameListener: (currentFrame: number) => void;\n private skipFirstFrameRendering: boolean;\n private playToFrameOnFrameCallback: (frameNo: number) => void;\n\n public overrideRender: (frame: ImageData | HTMLCanvasElement | ImageBitmap) => void;\n private renderedFirstFrame: boolean;\n\n private raw: boolean;\n\n constructor({el, worker, options}: {\n el: RLottiePlayer['el'],\n worker: QueryableWorker,\n options: RLottieOptions\n }) {\n super(true);\n\n this.reqId = ++RLottiePlayer['reqId'];\n this.el = el;\n this.worker = worker;\n\n for(const i in options) {\n if(this.hasOwnProperty(i)) {\n // @ts-ignore\n this[i] = options[i];\n }\n }\n\n this._loop = this.loop;\n this._autoplay = this.autoplay;\n\n // ! :(\n this.initFrame = options.initFrame;\n this.color = options.color;\n this.inverseColor = options.inverseColor;\n this.name = options.name;\n this.skipFirstFrameRendering = options.skipFirstFrameRendering;\n this.toneIndex = options.toneIndex;\n this.raw = this.color !== undefined;\n this.liteModeKey = options.liteModeKey;\n\n if(this.name) {\n this.cacheName = RLottiePlayer.CACHE.generateName(this.name, this.width, this.height, this.color, this.toneIndex);\n }\n\n // * Skip ratio (30fps)\n let skipRatio: number;\n if(options.skipRatio !== undefined) skipRatio = options.skipRatio;\n else if((IS_ANDROID || IS_APPLE_MOBILE || (IS_APPLE && !IS_SAFARI && !IS_APPLE_MX)) && this.width < 100 && this.height < 100 && !options.needUpscale) {\n skipRatio = 0.5;\n }\n\n this.skipDelta = skipRatio !== undefined ? 1 / skipRatio | 0 : 1;\n\n // options.needUpscale = true;\n\n // * Pixel ratio\n const pixelRatio = getLottiePixelRatio(this.width, this.height, options.needUpscale);\n\n this.width = Math.round(this.width * pixelRatio);\n this.height = Math.round(this.height * pixelRatio);\n\n // options.noCache = true;\n\n // * Cache frames params\n if(!options.noCache/* && false */) {\n // проверка на размер уже после скейлинга, сделано для попапа и сайдбара, где стикеры 80х80 и 68х68, туда нужно 75%\n if(IS_APPLE && this.width > 100 && this.height > 100) {\n this.cachingDelta = 2; // 2 // 50%\n } else if(this.width < 100 && this.height < 100) {\n this.cachingDelta = Infinity; // 100%\n } else {\n this.cachingDelta = 4; // 75%\n }\n }\n\n // this.cachingDelta = Infinity;\n // this.cachingDelta = 0;\n // if(isApple) {\n // this.cachingDelta = 0; //2 // 50%\n // }\n\n if(!this.canvas) {\n this.canvas = this.el.map(() => {\n const canvas = document.createElement('canvas');\n canvas.classList.add('rlottie');\n canvas.width = this.width;\n canvas.height = this.height;\n canvas.dpr = pixelRatio;\n return canvas;\n });\n }\n\n this.contexts = this.canvas.map((canvas) => canvas.getContext('2d'));\n\n if(!IS_IMAGE_BITMAP_SUPPORTED || this.raw) {\n this.imageData = new ImageData(this.width, this.height);\n\n if(CAN_USE_TRANSFERABLES) {\n this.clamped = new Uint8ClampedArray(this.width * this.height * 4);\n }\n }\n\n if(this.name) {\n this.cache = RLottiePlayer.CACHE.getCache(this.cacheName);\n } else {\n this.cache = FramesCache.createCache();\n }\n }\n\n public clearCache() {\n if(this.cachingDelta === Infinity) {\n return;\n }\n\n if(this.cacheName && this.cache.counter > 1) { // skip clearing because same sticker can be still visible\n return;\n }\n\n this.cache.clearCache();\n }\n\n public sendQuery(args: any[], transfer?: Transferable[]) {\n this.worker.sendQuery([args.shift(), this.reqId, ...args], transfer);\n }\n\n public loadFromData(data: RLottieOptions['animationData']) {\n this.sendQuery(['loadFromData', data, this.width, this.height, this.toneIndex, this.color !== undefined/* , this.canvas.transferControlToOffscreen() */]);\n }\n\n public play() {\n if(!this.paused) {\n return;\n }\n\n this.paused = false;\n this.setMainLoop();\n }\n\n public pause(clearPendingRAF = true) {\n if(this.paused) {\n return;\n }\n\n this.paused = true;\n if(clearPendingRAF) {\n clearTimeout(this.rafId);\n this.rafId = undefined;\n }\n // window.cancelAnimationFrame(this.rafId);\n }\n\n private resetCurrentFrame() {\n return this.curFrame = this.initFrame ?? (this.direction === 1 ? this.minFrame : this.maxFrame);\n }\n\n public stop(renderFirstFrame = true) {\n this.pause();\n\n const curFrame = this.resetCurrentFrame();\n if(renderFirstFrame) {\n this.requestFrame(curFrame);\n // this.sendQuery('renderFrame', this.curFrame);\n }\n }\n\n public restart() {\n this.stop(false);\n this.play();\n }\n\n public playOrRestart() {\n if(!this.paused) {\n return;\n }\n\n if(this.curFrame === this.maxFrame) {\n this.restart();\n } else {\n this.play();\n }\n }\n\n public setSpeed(speed: number) {\n if(this.speed === speed) {\n return;\n }\n\n this.speed = speed;\n\n if(!this.paused) {\n this.setMainLoop();\n }\n }\n\n public setDirection(direction: number) {\n if(this.direction === direction) {\n return;\n }\n\n this.direction = direction;\n\n if(!this.paused) {\n this.setMainLoop();\n }\n }\n\n public remove() {\n this.pause();\n this.sendQuery(['destroy']);\n if(this.cacheName) RLottiePlayer.CACHE.releaseCache(this.cacheName);\n this.dispatchEvent('destroy');\n this.cleanup();\n }\n\n private applyColor(frame: Uint8ClampedArray) {\n const [r, g, b] = this.color;\n for(let i = 0, length = frame.length; i < length; i += 4) {\n if(frame[i + 3] !== 0) {\n frame[i] = r;\n frame[i + 1] = g;\n frame[i + 2] = b;\n }\n }\n }\n\n private applyInversing(frame: Uint8ClampedArray) {\n const [r, g, b] = this.inverseColor;\n for(let i = 0, length = frame.length; i < length; i += 4) {\n if(frame[i + 3] === 0) {\n frame[i] = r;\n frame[i + 1] = g;\n frame[i + 2] = b;\n frame[i + 3] = 255;\n } else {\n frame[i + 3] = 0;\n }\n }\n }\n\n public renderFrame2(frame: Uint8ClampedArray | HTMLCanvasElement | ImageBitmap, frameNo: number) {\n /* this.setListenerResult('enterFrame', frameNo);\n return; */\n\n try {\n if(frame instanceof Uint8ClampedArray) {\n if(this.color) {\n this.applyColor(frame);\n }\n\n if(this.inverseColor) {\n this.applyInversing(frame);\n }\n\n this.imageData.data.set(frame);\n }\n\n // this.context.putImageData(new ImageData(frame, this.width, this.height), 0, 0);\n this.contexts.forEach((context, idx) => {\n let cachedSource: HTMLCanvasElement | ImageBitmap = this.cache.framesNew.get(frameNo);\n if(!(frame instanceof Uint8ClampedArray)) {\n cachedSource = frame;\n } else if(idx > 0) {\n cachedSource = this.canvas[0];\n }\n\n if(!cachedSource) {\n // console.log('drawing from data');\n const c = document.createElement('canvas');\n c.width = context.canvas.width;\n c.height = context.canvas.height;\n c.getContext('2d').putImageData(this.imageData, 0, 0);\n this.cache.framesNew.set(frameNo, c);\n cachedSource = c;\n }\n\n if(this.overrideRender && this.renderedFirstFrame) {\n this.overrideRender(cachedSource || this.imageData);\n } else if(cachedSource) {\n // console.log('drawing from canvas');\n context.clearRect(0, 0, cachedSource.width, cachedSource.height);\n context.drawImage(cachedSource, 0, 0);\n } else {\n context.putImageData(this.imageData, 0, 0);\n }\n\n if(!this.renderedFirstFrame) {\n this.renderedFirstFrame = true;\n }\n });\n\n this.dispatchEvent('enterFrame', frameNo);\n } catch(err) {\n console.error('RLottiePlayer renderFrame error:', err/* , frame */, this.width, this.height);\n this.autoplay = false;\n this.pause();\n }\n }\n\n public renderFrame(frame: Parameters[0], frameNo: number) {\n const canCacheFrame = this.cachingDelta && (frameNo % this.cachingDelta || !frameNo);\n if(canCacheFrame) {\n if(frame instanceof Uint8ClampedArray && !this.cache.frames.has(frameNo)) {\n this.cache.frames.set(frameNo, new Uint8ClampedArray(frame));// frame;\n } else if(IS_IMAGE_BITMAP_SUPPORTED && frame instanceof ImageBitmap && !this.cache.framesNew.has(frameNo)) {\n this.cache.framesNew.set(frameNo, frame);\n }\n }\n\n /* if(!this.listenerResults.hasOwnProperty('cached')) {\n this.setListenerResult('enterFrame', frameNo);\n if(frameNo === (this.frameCount - 1)) {\n this.setListenerResult('cached');\n }\n\n return;\n } */\n\n if(this.frInterval) {\n const now = Date.now(), delta = now - this.frThen;\n\n if(delta < 0) {\n const timeout = this.frInterval > -delta ? -delta % this.frInterval : this.frInterval;\n if(this.rafId) clearTimeout(this.rafId);\n this.rafId = window.setTimeout(() => {\n this.renderFrame2(frame, frameNo);\n }, timeout);\n // await new Promise((resolve) => setTimeout(resolve, -delta % this.frInterval));\n return;\n }\n }\n\n this.renderFrame2(frame, frameNo);\n }\n\n public requestFrame(frameNo: number) {\n const frame = this.cache.frames.get(frameNo);\n const frameNew = this.cache.framesNew.get(frameNo);\n if(frameNew) {\n this.renderFrame(frameNew, frameNo);\n } else if(frame) {\n this.renderFrame(frame, frameNo);\n } else {\n if(this.clamped && !this.clamped.length) { // fix detached\n this.clamped = new Uint8ClampedArray(this.width * this.height * 4);\n }\n\n this.sendQuery(['renderFrame', frameNo], this.clamped ? [this.clamped.buffer] : undefined);\n }\n }\n\n private onLap() {\n if(++this.playedTimes === this.loop) {\n this.loop = false;\n }\n\n if(!this.loop) {\n this.pause(false);\n return false;\n }\n\n return true;\n }\n\n private mainLoopForwards() {\n const {skipDelta, maxFrame} = this;\n const frame = (this.curFrame + skipDelta) > maxFrame ? this.curFrame = (this.loop ? this.minFrame : this.maxFrame) : this.curFrame += skipDelta;\n // console.log('mainLoopForwards', this.curFrame, skipDelta, frame);\n\n this.requestFrame(frame);\n if((frame + skipDelta) > maxFrame) {\n return this.onLap();\n }\n\n return true;\n }\n\n private mainLoopBackwards() {\n const {skipDelta, minFrame} = this;\n const frame = (this.curFrame - skipDelta) < minFrame ? this.curFrame = (this.loop ? this.maxFrame : this.minFrame) : this.curFrame -= skipDelta;\n // console.log('mainLoopBackwards', this.curFrame, skipDelta, frame);\n\n this.requestFrame(frame);\n if((frame - skipDelta) < minFrame) {\n return this.onLap();\n }\n\n return true;\n }\n\n public setMainLoop() {\n // window.cancelAnimationFrame(this.rafId);\n clearTimeout(this.rafId);\n this.rafId = undefined;\n\n this.frInterval = 1000 / this.fps / this.speed * this.skipDelta;\n this.frThen = Date.now() - this.frInterval;\n\n // console.trace('setMainLoop', this.frInterval, this.direction, this, JSON.stringify(this.listenerResults), this.listenerResults);\n\n const method = (this.direction === 1 ? this.mainLoopForwards : this.mainLoopBackwards).bind(this);\n this.currentMethod = method;\n // this.frameListener && this.removeListener('enterFrame', this.frameListener);\n\n // setTimeout(() => {\n // this.addListener('enterFrame', this.frameListener);\n // }, 0);\n\n if(this.frameListener) {\n const lastResult = this.listenerResults.enterFrame;\n if(lastResult !== undefined) {\n this.frameListener(this.curFrame);\n }\n }\n\n // this.mainLoop(method);\n // this.r(method);\n // method();\n }\n\n public playPart(options: {\n from: number,\n to: number,\n callback?: () => void\n }) {\n this.pause();\n\n const {from, to, callback} = options;\n this.curFrame = from - 1;\n\n return this.playToFrame({\n frame: to,\n direction: to > from ? 1 : -1,\n callback\n });\n }\n\n public playToFrame(options: {\n frame: number,\n speed?: number,\n direction?: number,\n callback?: () => void\n }) {\n this.pause();\n\n const {frame, speed, callback, direction} = options;\n this.setDirection(direction === undefined ? this.curFrame > frame ? -1 : 1 : direction);\n speed !== undefined && this.setSpeed(speed);\n\n const bounds = [this.curFrame, frame];\n if(this.direction === -1) bounds.reverse();\n\n this.loop = false;\n this.setMinMax(bounds[0], bounds[1]);\n\n if(this.playToFrameOnFrameCallback) {\n this.removeEventListener('enterFrame', this.playToFrameOnFrameCallback);\n }\n\n if(callback) {\n this.playToFrameOnFrameCallback = (frameNo: number) => {\n if(frameNo === frame) {\n this.removeEventListener('enterFrame', this.playToFrameOnFrameCallback);\n callback();\n }\n };\n\n this.addEventListener('enterFrame', this.playToFrameOnFrameCallback);\n }\n\n this.play();\n }\n\n public setColor(color: RLottieColor, renderIfPaused: boolean) {\n this.color = color;\n\n if(renderIfPaused && this.paused) {\n this.renderFrame2(this.imageData.data, this.curFrame);\n }\n }\n\n public setInverseColor(color: RLottieColor) {\n this.inverseColor = color;\n }\n\n private setMinMax(minFrame = 0, maxFrame = this.frameCount - 1) {\n this.minFrame = minFrame;\n this.maxFrame = maxFrame;\n }\n\n public async onLoad(frameCount: number, fps: number) {\n this.frameCount = frameCount;\n this.fps = fps;\n this.setMinMax();\n if(this.initFrame !== undefined) {\n this.initFrame = clamp(this.initFrame, this.minFrame, this.maxFrame);\n }\n\n const curFrame = this.resetCurrentFrame();\n\n // * Handle 30fps stickers if 30fps set\n if(this.fps < 60 && this.skipDelta !== 1) {\n const diff = 60 / fps;\n this.skipDelta = this.skipDelta / diff | 0;\n }\n\n this.frInterval = 1000 / this.fps / this.speed * this.skipDelta;\n this.frThen = Date.now() - this.frInterval;\n // this.sendQuery('renderFrame', 0);\n\n // Кешировать сразу не получится, рендер стикера (тайгер) занимает 519мс,\n // если рендерить 75% с получением каждого кадра из воркера, будет 475мс, т.е. при 100% было бы 593мс, потеря на передаче 84мс.\n\n /* console.time('cache' + this.reqId);\n for(let i = 0; i < frameCount; ++i) {\n //if(this.removed) return;\n\n if(i % 4) {\n await new Promise((resolve) => {\n delete this.listenerResults.enterFrame;\n this.addListener('enterFrame', resolve, true);\n this.requestFrame(i);\n });\n }\n }\n\n console.timeEnd('cache' + this.reqId); */\n // console.log('cached');\n /* this.el.innerHTML = '';\n this.el.append(this.canvas);\n return; */\n\n !this.skipFirstFrameRendering && this.requestFrame(curFrame);\n this.dispatchEvent('ready');\n this.addEventListener('enterFrame', () => {\n this.dispatchEvent('firstFrame');\n\n if(!this.canvas[0].parentNode && this.el && !this.overrideRender) {\n this.el.forEach((container, idx) => container.append(this.canvas[idx]));\n }\n\n // console.log('enterFrame firstFrame');\n\n // let lastTime = this.frThen;\n this.frameListener = () => {\n if(this.paused || !this.currentMethod) {\n return;\n }\n\n const time = Date.now();\n // console.log(`enterFrame handle${this.reqId}`, time, (time - lastTime), this.frInterval);\n /* if(Math.round(time - lastTime + this.frInterval * 0.25) < Math.round(this.frInterval)) {\n return;\n } */\n\n // lastTime = time;\n\n this.frThen = time + this.frInterval;\n const canContinue = this.currentMethod();\n if(!canContinue && !this.loop && this.autoplay) {\n this.autoplay = false;\n }\n };\n\n this.addEventListener('enterFrame', this.frameListener);\n // setInterval(this.frameListener, this.frInterval);\n\n // ! fix autoplaying since there will be no animationIntersector for it\n if(this.group === 'none' && this.autoplay) {\n this.play();\n }\n }, {once: true});\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Page from './page';\nimport lottieLoader from '../lib/rlottie/lottieLoader';\nimport {horizontalMenu} from '../components/horizontalMenu';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport fastSmoothScroll from '../helpers/fastSmoothScroll';\nimport whichChild from '../helpers/dom/whichChild';\n\nclass PagesManager {\n private pageId = -1;\n private page: Page;\n\n private selectTab: ReturnType;\n public pagesDiv: HTMLDivElement;\n public scrollableDiv: HTMLElement;\n\n constructor() {\n this.pagesDiv = document.getElementById('auth-pages') as HTMLDivElement;\n this.scrollableDiv = this.pagesDiv.querySelector('.scrollable') as HTMLElement;\n this.selectTab = horizontalMenu(null, this.scrollableDiv.querySelector('.tabs-container') as HTMLDivElement, null, () => {\n if(this.page?.onShown) {\n this.page.onShown();\n }\n });\n }\n\n public setPage(page: Page) {\n if(page.isAuthPage) {\n this.pagesDiv.style.display = '';\n\n const id = whichChild(page.pageEl);\n if(this.pageId === id) return;\n\n this.selectTab(id);\n\n if(this.pageId !== -1 && id > 1) {\n lottieLoader.loadLottieWorkers();\n }\n\n\n this.pageId = id;\n\n if(this.scrollableDiv) {\n fastSmoothScroll({\n container: this.scrollableDiv,\n element: this.scrollableDiv.firstElementChild as HTMLElement,\n position: 'start'\n });\n }\n } else {\n this.pagesDiv.style.display = 'none';\n page.pageEl.style.display = '';\n\n this.pageId = -1;\n }\n\n this.page = page;\n }\n}\n\nconst pagesManager = new PagesManager();\nMOUNT_CLASS_TO.pagesManager = pagesManager;\nexport default pagesManager;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport pagesManager from './pagesManager';\n\nexport default class Page {\n public pageEl: HTMLDivElement;\n private installed = false;\n\n constructor(\n className: string,\n public isAuthPage: boolean,\n private onFirstMount?: (...args: any[]) => Promise | void,\n private onMount?: (...args: any[]) => Promise | void,\n public onShown?: () => void\n ) {\n this.pageEl = document.body.querySelector('.' + className) as HTMLDivElement;\n }\n\n public async mount(...args: any[]) {\n // this.pageEl.style.display = '';\n\n if(this.onMount) {\n const res = this.onMount(...args);\n if(res instanceof Promise) {\n await res;\n }\n }\n\n if(!this.installed) {\n if(this.onFirstMount) {\n try {\n const res = this.onFirstMount(...args);\n if(res instanceof Promise) {\n await res;\n }\n } catch(err) {\n console.error('PAGE MOUNT ERROR:', err);\n }\n }\n\n this.installed = true;\n }\n\n pagesManager.setPage(this);\n }\n}\n","// https://github.com/twitter/twemoji-parser/blob/master/src/lib/regex.js\n\nexport function encodeEmoji(emojiText: string) {\n const codepoints = toCodePoints(removeVS16s(emojiText)).join('-');\n return codepoints;\n}\n\nconst vs16RegExp = /\\uFE0F/g;\n// avoid using a string literal like '\\u200D' here because minifiers expand it inline\nconst zeroWidthJoiner = String.fromCharCode(0x200d);\n\nconst removeVS16s = (rawEmoji: string) => (rawEmoji.indexOf(zeroWidthJoiner) < 0 ? rawEmoji.replace(vs16RegExp, '') : rawEmoji);\n\nexport function toCodePoints(unicodeSurrogates: string): Array {\n const points = [];\n let char = 0;\n let previous = 0;\n let i = 0;\n while(i < unicodeSurrogates.length) {\n char = unicodeSurrogates.charCodeAt(i++);\n if(previous) {\n points.push((0x10000 + ((previous - 0xd800) << 10) + (char - 0xdc00)).toString(16));\n previous = 0;\n } else if(char > 0xd800 && char <= 0xdbff) {\n previous = char;\n } else {\n points.push(char.toString(16));\n }\n }\n\n if(points.length && points[0].length === 2) {\n points[0] = '00' + points[0];\n }\n\n return points;\n}\n\nexport function getEmojiToneIndex(input: string) {\n const match = input.match(/[\\uDFFB-\\uDFFF]/);\n return match ? 5 - (57343 - match[0].charCodeAt(0)) : 0;\n}\n\nconst VIRTUAL_COUNTRIES_EMOJIS: Map = new Map([\n ['FT', '🏴‍☠']\n]);\n\nexport function getCountryEmoji(iso2: string) {\n return VIRTUAL_COUNTRIES_EMOJIS.get(iso2) ??\n String.fromCharCode(55356, 56741 + iso2.charCodeAt(0), 55356, 56741 + iso2.charCodeAt(1));\n}\n\nexport function emojiFromCodePoints(codePoints: string) {\n return codePoints.split('-').reduce((prev, curr) => prev + String.fromCodePoint(parseInt(curr, 16)), '');\n}\n","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.Recorder=t():e.Recorder=t()}(\"undefined\"!=typeof self?self:this,(function(){return function(e){var t={};function o(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,i){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},o.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var n in e)o.d(i,n,function(t){return e[t]}.bind(null,n));return i},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,\"a\",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p=\"\",o(o.s=0)}([function(e,t,o){\"use strict\";(function(t){var o=t.AudioContext||t.webkitAudioContext,i=function(e){if(!i.isRecordingSupported())throw new Error(\"Recording is not supported in this browser\");e||(e={}),this.state=\"inactive\",this.config=Object.assign({bufferLength:4096,encoderApplication:2049,encoderFrameSize:20,encoderPath:\"encoderWorker.min.js\",encoderSampleRate:48e3,maxFramesPerPage:40,mediaTrackConstraints:!0,monitorGain:0,numberOfChannels:1,recordingGain:1,resampleQuality:3,streamPages:!1,reuseWorker:!1,wavBitDepth:16},e),this.encodedSamplePosition=0};i.isRecordingSupported=function(){return o&&t.navigator&&t.navigator.mediaDevices&&t.navigator.mediaDevices.getUserMedia&&t.WebAssembly},i.prototype.clearStream=function(){this.stream&&(this.stream.getTracks?this.stream.getTracks().forEach((function(e){e.stop()})):this.stream.stop(),delete this.stream),this.audioContext&&this.closeAudioContext&&(this.audioContext.close(),delete this.audioContext)},i.prototype.encodeBuffers=function(e){if(\"recording\"===this.state){for(var t=[],o=0;o{this.encodeBuffers(e.inputBuffer)},this.monitorGainNode=this.audioContext.createGain(),this.setMonitorGain(this.config.monitorGain),this.monitorGainNode.connect(this.audioContext.destination),this.recordingGainNode=this.audioContext.createGain(),this.setRecordingGain(this.config.recordingGain),this.recordingGainNode.connect(this.scriptProcessorNode)},i.prototype.initSourceNode=function(e){return e&&e.context?t.Promise.resolve(e):t.navigator.mediaDevices.getUserMedia({audio:this.config.mediaTrackConstraints}).then(e=>(this.stream=e,this.audioContext.createMediaStreamSource(e)))},i.prototype.loadWorker=function(){this.encoder||(this.encoder=new t.Worker(this.config.encoderPath))},i.prototype.initWorker=function(){var e=(this.config.streamPages?this.streamPage:this.storePage).bind(this);return this.recordedPages=[],this.totalLength=0,this.loadWorker(),new Promise((t,o)=>{var i=o=>{switch(o.data.message){case\"ready\":t();break;case\"page\":this.encodedSamplePosition=o.data.samplePosition,e(o.data.page);break;case\"done\":this.encoder.removeEventListener(\"message\",i),this.finish()}};this.encoder.addEventListener(\"message\",i),this.encoder.postMessage(Object.assign({command:\"init\",originalSampleRate:this.audioContext.sampleRate,wavSampleRate:this.audioContext.sampleRate},this.config))})},i.prototype.pause=function(e){if(\"recording\"===this.state){if(this.state=\"paused\",e&&this.config.streamPages){var t=this.encoder;return new Promise((e,o)=>{var i=o=>{\"flushed\"===o.data.message&&(t.removeEventListener(\"message\",i),this.onpause(),e())};t.addEventListener(\"message\",i),t.postMessage({command:\"flush\"})})}return this.onpause(),Promise.resolve()}},i.prototype.resume=function(){\"paused\"===this.state&&(this.state=\"recording\",this.onresume())},i.prototype.setRecordingGain=function(e){this.config.recordingGain=e,this.recordingGainNode&&this.audioContext&&this.recordingGainNode.gain.setTargetAtTime(e,this.audioContext.currentTime,.01)},i.prototype.setMonitorGain=function(e){this.config.monitorGain=e,this.monitorGainNode&&this.audioContext&&this.monitorGainNode.gain.setTargetAtTime(e,this.audioContext.currentTime,.01)},i.prototype.start=function(e){if(\"inactive\"===this.state)return this.initAudioContext(e),this.initAudioGraph(),this.encodedSamplePosition=0,this.initWorker().then(()=>this.initSourceNode(e)).then(e=>{this.sourceNode=e,this.state=\"recording\",this.onstart(),this.encoder.postMessage({command:\"getHeaderPages\"}),this.sourceNode.connect(this.monitorGainNode),this.sourceNode.connect(this.recordingGainNode)})},i.prototype.stop=function(){if(\"inactive\"!==this.state){this.state=\"inactive\",this.monitorGainNode.disconnect(),this.scriptProcessorNode.disconnect(),this.recordingGainNode.disconnect(),this.sourceNode.disconnect(),this.clearStream();var e=this.encoder;return new Promise(t=>{var o=i=>{\"done\"===i.data.message&&(e.removeEventListener(\"message\",o),t())};e.addEventListener(\"message\",o),e.postMessage({command:\"done\"}),this.config.reuseWorker||e.postMessage({command:\"close\"})})}return Promise.resolve()},i.prototype.destroyWorker=function(){\"inactive\"===this.state&&this.encoder&&(this.encoder.postMessage({command:\"close\"}),delete this.encoder)},i.prototype.storePage=function(e){this.recordedPages.push(e),this.totalLength+=e.length},i.prototype.streamPage=function(e){this.ondataavailable(e)},i.prototype.finish=function(){if(!this.config.streamPages){var e=new Uint8Array(this.totalLength);this.recordedPages.reduce((function(t,o){return e.set(o,t),t+o.length}),0),this.ondataavailable(e)}this.onstop(),this.config.reuseWorker||delete this.encoder},i.prototype.ondataavailable=function(){},i.prototype.onpause=function(){},i.prototype.onresume=function(){},i.prototype.onstart=function(){},i.prototype.onstop=function(){},e.exports=i}).call(this,o(1))},function(e,t){var o;o=function(){return this}();try{o=o||new Function(\"return this\")()}catch(e){\"object\"==typeof window&&(o=window)}e.exports=o}])}));","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nvar NEWTON_ITERATIONS = 4;\nvar NEWTON_MIN_SLOPE = 0.001;\nvar SUBDIVISION_PRECISION = 0.0000001;\nvar SUBDIVISION_MAX_ITERATIONS = 10;\n\nvar kSplineTableSize = 11;\nvar kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nvar float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\nfunction B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\nfunction C (aA1) { return 3.0 * aA1; }\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); }\n\nfunction binarySubdivide (aX, aA, aB, mX1, mX2) {\n var currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing (x) {\n return x;\n}\n\nmodule.exports = function bezier (mX1, mY1, mX2, mY2) {\n if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if (mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for (var i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX (aX) {\n var intervalStart = 0.0;\n var currentSample = 1;\n var lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n var guessForT = intervalStart + dist * kSampleStepSize;\n\n var initialSlope = getSlope(guessForT, mX1, mX2);\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing (x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if (x === 0 || x === 1) {\n return x;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n};\n"],"names":["animationIntersector","constructor","this","observer","IntersectionObserver","entries","entry","target","group","byGroups","intersectionLockedGroups","animation","find","p","el","isIntersecting","visible","add","checkAnimation","delete","_animation","clearCache","Set","overrideIdleGroups","byPlayer","Map","lockedGroups","onlyOnePlayableGroup","videosLocked","doc","type","checkAnimations2","idle","setOverrideIdleGroup","override","getAnimations","element","found","player","push","removeAnimation","HTMLVideoElement","remove","IS_SAFARI","setTimeout","src","load","length","unobserve","removeAnimationByPlayer","item","get","addAnimation","options","observeElement","controlled","liteModeKey","has","canvas","placeholder","HTMLElement","onClean","loop","observe","set","checkAnimations","blurred","destroy","imitateIntersection","undefined","groups","Object","keys","animations","paused","pause","autoplay","play","getOnlyOnePlayableGroup","setOnlyOnePlayableGroup","lockGroup","unlockGroup","refreshGroup","forEach","lockIntersectionGroup","unlockIntersectionGroup","toggleIntersectionGroup","lock","setAutoplay","changed","animationItem","dataset","stickerPlay","stickerLoop","setLoop","SHOULD_USE_SAFARI_FIX","navigator","userAgent","match","err","AppMediaPlaybackController","media","scheduled","mediaDetails","waitingMediaForLoad","waitingScheduledMediaForLoad","waitingDocumentsForLoad","playbackRates","voice","video","audio","seekBackward","details","playingMedia","currentTime","Math","max","seekOffset","seekForward","min","duration","seekTo","seekTime","onMediaDocumentLoad","managers","appDocsManager","getDoc","docId","supportsStreaming","handleSafariStreamable","cacheContext","thumbsStorage","getCacheContext","url","playbackRate","id","size","onPlay","e","peerId","mid","pip","message","getMessageByMedia","stop","setMedia","verify","listLoader","current","getCurrent","jumpLength","withOtherSide","previous","getPrevious","idx","findIndex","getNext","go","setTargets","dispatchEvent","getPlayingDetails","pauseMediaInOtherTabs","onPause","onEnded","isTrusted","lockedSwitchers","round","next","toggle","force","clean","s","isScheduled","storage","playingMediaType","playItem","searchContext","getMedia","resolveWaitingForLoadMedia","dispatchJump","goRound","browserPlay","bindBrowserCallback","browserPause","browserStop","browserSeekBackward","browserSeekForward","browserSeekTo","browserNext","browserPrevious","seekToStart","construct","container","document","createElement","style","cssText","body","append","mediaSession","actions","seekbackward","seekforward","seekto","previoustrack","nexttrack","action","setActionHandler","console","warn","skipMediaPlayEvent","properties","key","_key","value","dispatchPlaybackParams","defineProperties","getPlaybackParams","volume","muted","setPlaybackParams","params","_volume","_muted","_playbackRate","_loop","_round","addMedia","autoload","pFlags","is_scheduled","setAttribute","addEventListener","media_unread","fromId","appMessagesManager","readMessages","once","deferred","resolve","w","waitingStorage","then","promise","isSafariBuffering","safariBuffering","setSafariBuffering","setNewMediadata","pictureInPictureElement","artwork","isVoice","title","artist","thumbs","bytes","sizes","h","thumb","appPeersManager","getPeerPhoto","plainText","onlyFirstName","attribute","attributes","_","file_name","performer","IS_APPLE","metadata","MediaMetadata","setCurrentMediadata","playbackParams","cb","willBePlayed","willBePlayedMedia","setSearchContext","context","getSearchContext","prev","reset","loadCount","loadWhenLeft","processItem","onJump","older","onEmptied","reverse","folderId","getPlaybackMediaTypeFromMessage","mediaType","setSingleMedia","wasPlaying","toggleSwitchers","playPaused","removeEventListener","enabled","setPictureInPicture","listenerSetter","removeAll","appMediaPlaybackController","AppMediaViewer","captionTimeout","super","isForDocument","inputFilter","isMediaCompatibleForDocumentViewer","onPrevClick","openMedia","getMessageByPeer","fromRight","onNextClick","onDeleteClick","content","close","onForwardClick","onAuthorClick","Number","MAX_SAFE_INTEGER","threadId","tab","lastMsgId","onDownloadClick","queueId","caption","classList","setCaptionTimeout","clearTimeout","window","onAdditionalScroll","wholeDiv","buttons","btnMenuForward","icon","text","onClick","btnMenuDownload","btnMenuDelete","setBtnMenuToggle","setListeners","forward","author","onCaptionClick","a","contains","spoiler","HTMLAnchorElement","onclick","getAttribute","includes","capture","click","getScheduledMessageByPeer","setCaption","html","entities","totalEntities","maxMediaTimestamp","firstElementChild","prevTargets","nextTargets","mediaTimestamp","setMoverPromise","fwd_from","from_name","noForwards","isServiceMessage","cantForwardMessage","canForward","cantDownloadMessage","download","canDeleteMessage","hide","button","_openMedia","timestamp","date","static","mime_type","VideoPlayer","streamable","onPlaybackRackMenuToggle","onPip","onPipClose","wrapper","setup","canHideControls","playbackRateButton","showOnLeaveToClassName","ignoreClickClassName","parentNode","insertBefore","appendChild","skin","stylePlayer","controls","querySelector","progress","onSeekStart","onSeekEnd","prepend","catch","name","finally","initDuration","buildControls","timeDuration","insertAdjacentHTML","pipButton","querySelectorAll","fullScreenButton","timeElapsed","textContent","toHHMMSS","volumeSelector","leftControls","btn","parentElement","Array","from","togglePlay","requestPictureInPicture","visibility","debounceTime","debouncedPip","debounce","listener","timeout","overlayCounter","code","good","toggleFullScreen","altKey","nextIdx","PLAYBACK_RATES","indexOf","cancelEvent","onFullScreen","bind","hideControls","showControls","setPlaybackRateIcon","onMediaLoad","isPaused","IS_MOBILE","pictureInPictureEnabled","map","rate","regularText","btnMenu","onOpen","onClose","PLAYBACK_RATES_ICONS","className","IS_APPLE_MOBILE","webkitEnterFullscreen","enterFullscreen","isFull","setTimestamp","cleanup","removeListeners","isBetween","num","ZOOM_MIN_VALUE","MEDIA_VIEWER_CLASSNAME","AppMediaViewerBase","topButtons","tempId","preloader","preloaderStreamable","isFirstOpen","pageEl","getElementById","zoomElements","transform","x","y","scale","lastTransform","lastZoomCenter","lastDragOffset","lastDragDelta","onSwipeFirst","ctrlKeyDown","moversContainer","rangeSelector","isGesturingNow","lastGestureTime","Date","now","clampZoomDebounced","isZooming","initialContentRect","getBoundingClientRect","onSwipeReset","draggingType","ignoreNextClick","isZoomingNow","closing","s1","scaleFactor","x1","y1","k","elapsedTime","Vx","abs","Vy","calculateOffsetBoundaries","setTransform","resetZoom","onZoom","initialCenterX","initialCenterY","zoom","zoomAdd","currentCenterX","currentCenterY","dragOffsetX","dragOffsetY","zoomFactor","windowSize","clamp","ZOOM_MAX_VALUE","offsetX","offsetY","scaledCenterX","scaledCenterY","scaleOffsetX","scaleOffsetY","calculateScaleOffset","offsetTop","inBoundsX","inBoundsY","minX","maxX","minY","maxY","getZoomBoundaries","setZoomValue","toFixed","btnOut","btnIn","toggleZoom","setMoverAnimationPromise","tagName","highlightSwitchersTimeout","mover","classNames","findUpClassName","onKeyDown","addZoomStep","ctrlKey","metaKey","onKeyUp","rootScope","log","logger","cancelable","lazyLoadQueue","overlaysDiv","mainDiv","topbar","topbarLeft","onlyMobile","authorRight","avatarEl","nameEl","buttonsDiv","concat","noRipple","step","withTransition","setHandlers","onScrub","addZoom","onMouseDown","onMouseUp","main","innerHTML","onLoadedMore","setNewMover","moveLength","adjustPosition","xDiff","yDiff","setLastGestureTime","swipeHandler","onReset","onFirstSwipe","onSwipe","cancelDrag","onDoubleClick","centerX","centerY","ZOOM_INITIAL_VALUE","changeZoomByPosition","verifyTouchTarget","findUpAsChild","cursor","changeZoom","enable","isVisible","auto","mousedown","zoomValue","setProgress","videoPlayer","lockControls","getZoomBounce","left","right","top","bottom","btnMenuToggle","buttonOptions","direction","Promise","reject","navigationItem","appNavigationController","clear","setMoverToTarget","onAnimationEnd","appMediaViewer","removeGlobalListeners","toggleOverlay","active","toggleGlobalListeners","setGlobalListeners","setMediaTimestamp","removeCenterFromMover","wasActive","delay","liteMode","realParent","rect","SVGImageElement","SVGForeignObjectElement","needOpacity","overflowElement","visibleRect","getVisibleRect","overflow","vertical","horizontal","containerRect","aspecter","width","HTMLImageElement","setFullAspect","offsetLeft","height","scaleX","scaleY","borderRadius","getComputedStyle","getPropertyValue","brSplitted","str","splitted","split","i","fillPropertyValue","r","parseInt","join","path","opacity","isOut","ret","isFulfilled","isRejected","SVGSVGElement","sizeTailPath","toggleWholeActive","mediaElement","selector","queryFrom","matches","elements","pop","getContext","naturalWidth","naturalHeight","videoWidth","videoHeight","HTMLCanvasElement","drawImage","image","Image","createVideo","clipId","newClipId","newSvg","createElementNS","setAttributeNS","outerHTML","replace","lastElementChild","defs","use","SVGUseElement","d","getAttributeNS","sX","sY","br","v","generatePathData","foreignObject","renderImageFromUrl","display","proportion","upscale","start","diff","_br","moveTheMover","toLeft","windowW","newTransform","p1","newMover","updateMediaSource","toLowerCase","setAuthorInfo","isPeerId","wrapTitlePromise","dialog","wrapEmojiText","oldAvatar","newAvatar","cloneNode","all","updateWithOptions","peerTitle","replaceContent","replaceWith","setAuthorPromise","isDocument","isVideo","useContainerAsTarget","replaceChildren","onPop","canAnimate","IS_MOBILE_SAFARI","maxWidth","padding","windowH","mediaSizes","maxHeight","thumbPromise","setAttachmentSize","photoSize","img","downloaded","gotThumb","getStrippedThumbIfNeeded","loadPromise","useController","div","moverVideo","canPlayThrough","createPlayer","ckin","overlay","open","otherMediaViewer","releaseSingleMedia","show","readyState","HAVE_FUTURE_DATA","attach","attachCanPlay","detach","loading","networkState","NETWORK_LOADING","isntEnoughData","unshift","appDownloadManager","toast","langPackKey","error","cancellablePromise","photoSizes","slice","filter","sort","b","fullPhotoSize","cancellableFullPromise","attachPromise","haveImage","fullImage","setManual","onPopState","hash","location","state","debug","isPossibleSwipe","currentHash","overriddenHash","overrideHash","onHashChange","pushState","navigations","manual","handleItem","onEscape","back","onTouchStart","touches","passive","history","scrollRestoration","replaceState","pushItem","noBlurOnPop","findItemByType","index","backByItem","splice","onItemAdded","noHistory","unshiftItem","spliceItems","items","origin","pathname","search","removeItem","removeByType","single","SearchGroup","clearable","clickable","autonomous","onFound","noIcons","list","setActive","childElementCount","AppSearch","searchInput","searchGroups","onSearch","minMsgId","loadedCount","foundCount","searchPromise","searchTimeout","query","listsContainer","scrollable","messages","setVirtualContainer","onChange","searchMore","onScrolledBottom","trim","beginSearch","inputField","input","focus","maxId","limit","res","count","shift","searchGroup","avatarSize","meAsSaved","SearchContextMenu","attachTo","searchSuper","onGotoClick","appImManager","selection","isSelecting","selectionForwardBtn","onSelectClick","toggleByElement","onClearSelectionClick","cancelSelection","selectionDeleteBtn","attachContextMenuListener","callback","init","MouseEvent","preventDefault","cancelBubble","toPeerId","isSelected","isMidSelected","selectedMessages","getSelectedMessages","withSelection","positionMenu","contextMenuController","AppSearchSuper","tabs","prevTabId","middleware","historyStorage","usedFromHistory","loadMutex","nextRates","loadPromises","loaded","loadedChats","firstLoad","monthContainers","mediaTabsMap","asChatList","groupByMonth","hideEmptyTabs","showSender","onTransitionStart","onTransitionEnd","safeAssign","searchContextMenu","navScrollableContainer","navScrollable","nav","tabsMenu","mediaTab","mediaTabs","menuTab","span","ripple","unlockScroll","tabsContainer","handleTabSwipe","prevId","selectTab","children","onTouchMove","lockers","lockTouchScroll","contentTab","searchGroupMedia","canLoadMediaTab","horizontalMenu","tabContent","animate","skipScroll","scrollIntoViewNew","position","startCallback","scrollStartCallback","newMediaTab","onChangeTab","fromMediaTab","scrollTop","scroll","scrollHeight","rect2","onScroll","onMediaClick","targetClassName","mediaSpoiler","event","targets","containerEl","copySearchContext","inputMessagesFilterPhotoVideo","inputMessagesFilterDocument","useHeavyAnimationCheck","unlockAndRefresh","filterMessagesByType","filterMessagesByInputFilter","processEmptyFilter","dialogElement","appDialogsManager","setLastMessagePromise","lastMessage","highlightWord","noop","processPhotoVideoFilter","promises","getMediaFromMessage","wrapped","choosePhotoSize","boxWidth","boxHeight","onlyPreview","withoutPreloader","noPlayButton","photo","noBlur","animationGroup","multiply","images","full","Boolean","processDocumentFilter","withTime","fontWeight","voiceAsMusic","autoDownloadSize","getSize","processUrlFilter","webPage","webpage","entity","display_url","sliced","offset","matchUrl","same","URL","hostname","description","previewDiv","setInnerHTML","wrapAbbreviation","subtitleFragment","htmlToDocumentFragment","wrapRichText","innerText","decodeURIComponent","href","firstChild","wrapPlainText","row","titleRight","subtitle","havePadding","applyMediaElement","performSearchResult","elemsToAppend","sharedMediaDiv","processCallback","results","awaited","method","monthContainer","getMonthContainerByTimestamp","toggleElementCheckbox","afterPerforming","parent","child","loadChats","renderedPeerIds","inputMessagesFilterEmpty","setResults","showMembersCount","dom","peer","getPeer","participants_count","participants","regExp","RegExp","escapeRegExp","cleanSearchText","titleSpan","lastMessageSpan","getChatMembersString","toChatId","username","getPeerUsername","user","appUsersManager","getUser","phone","formatPhoneNumber","formatted","onLoad","arg","getContactsPeerIds","contacts","searchContacts","my_results","globalContacts","showMore","intlElement","isShort","update","dialogsStorage","getDialogs","offsetIndex","filterId","dialogs","minDate","renderRecentSearch","recent","recentSearch","isUser","getUserStatusString","toUserId","getTopPeers","peers","people","subtitleEl","loadMembers","chatId","userId","renderParticipants","membersList","rippleEnabled","li","findUpTag","DIALOG_LIST_ELEMENT_TAG","peerIds","participant","getParticipantPeerId","isAnyChat","filtered","filterAsync","deleted","LOAD_COUNT","getCommonChats","messagesChats","lastChat","chats","appChatsManager","isChannel","appProfileManager","getChannelParticipants","getChatFull","chatFull","loadType","justLoad","used","slicedLength","ids","notFilteredMessages","m","checkForTriggers","getSearch","nextRate","next_rate","loadFirstTime","filters","counters","canViewMembers","canViewGroups","getSearchCounters","firstMediaTab","counter","c","membersTab","loadFirstTimePromise","toLoad","t","findAndSplice","setHours","setDate","dateTimestamp","getTime","containers","month","getFullYear","year","dateElement","haveTimestamps","getObjectKeysAndSort","positionElementByIndex","isBroadcast","hasRights","isForum","getProfile","common_chats_count","cleanScrollPositions","cleanupHTML","goFirst","putPreloader","empty","newInputFilter","copy","setQuery","maxDate","AppSelectPeers","chatsContainer","selected","freezed","loadedWhat","peerType","multiSelect","exceptSelf","tempIds","selfPresence","needSwitchList","design","onInput","cachedContacts","getMoreResults","f","renderResultsFunc","renderResults","splitUp","notRendered","filterPeerTypeBy","section","innerContainer","topContainer","selectedContainer","selectedScrollable","sectionNameLangPackKey","noShadow","checkbox","checked","debouncedInput","appendTo","getResultsPromise","onFirstRender","renderSaved","testSelfSearch","getTempId","getMoreDialogs","archived","pageCount","skipMigrated","newOffsetIndex","chatRightsActions","filterByRights","isEnd","getMoreContacts","every","isGlobalSearch","searchResult","resultPeerIds","arr","getMoreChannelParticipants","channelParticipants","getParticipants","q","chatParticipants","getMoreSomething","call","isNonContactUser","checkboxField","label","isDialog","insertAdjacentElement","offsetWidth","getSelected","addInitial","values","requestAnimationFrame","forceDirection","constructDownloadPreloader","tryAgainOnFail","circle","totalLength","mids","attr","elem","findMediaTargets","anchor","anchorMid","isBubbles","justAudioSelector","selectors","prefix","mediaItems","AudioElement","render","isRealVoice","isOutgoing","is_outgoing","uploadingFileName","getDurationStr","HAVE_CURRENT_DATA","downloadDiv","onTypeLoad","audioEl","out","waveform","Uint8Array","valueCount","result","dataView","DataView","buffer","byteIndex","bitShift","getUint16","decodeWaveform","svg","svgContainer","availW","barHeightMax","minW","maxW","normValue","wfSize","barCount","maxValue","maxDelta","barX","sumI","bar_value","barWidth","createWaveformBars","fakeSvgContainer","waveformContainer","timeDiv","transcriptionState","speechRecognitionDiv","speechRecognitionIcon","speechRecognitionLoader","speechTextDiv","transcribeAudio","progressLine","onTimeUpdate","throttledTimeUpdate","addAudioListener","readyPromise","mousemove","scrub","targetTouches","pageX","scrubTime","wrapVoiceMessage","descriptionEl","audioAttribute","parts","titleEl","middleEllipsisEl","fontSize","sizeType","subtitleDiv","launched","lastChild","wrapAudio","audioTimeDiv","onTypeDisconnect","getTimeStr","imgs","autoDownload","shouldPlay","controlledAutoplay","onDownloadInit","pauseListener","notifyAll","done","total","cancel","Error","playListener","setDownloadFunction","setTargetsIfNeeded","hadSearchContext","useSearch","playWithTimestamp","disconnectedCallback","isConnected","customElements","define","AvatarListLoader","loadMore","photoId","appPhotosManager","getUserPhotos","photos","loadedAllUp","AppMediaViewerAvatar","getPhoto","onAvatarUpdate","openAvatarViewer","getTarget","hadMessage","isObject","data","believeMe","seen","getAvatarQueueKey","AvatarElement","addedToQueue","middlewareHelper","attachClickEvent","updateOptions","wasPeerId","wasThreadId","newPeerId","wrapOptions","create","onlyThumb","putPhoto","isBig","AvatarEdit","clearRect","Button","asLink","asDiv","rippleSquare","disabled","textArgs","tabIndex","ButtonMenuItem","separator","iconDoc","noCheckboxClickListener","textElement","iconElement","noFadeIn","processUrl","fetch","response","color","DOMParser","parseFromString","stroke","strokeWidth","keepOpen","menu","checkForClose","multiline","ButtonMenuSync","ButtonMenu","ButtonMenuToggleHandler","openedMenu","ButtonMenuToggle","attachListenerSetter","onOpenBefore","onCloseAfter","closeTimeout","filteredButtons","_element","BubbleGroup","chat","createAvatar","avatarLoadPromise","avatarContainer","fwdFrom","fwdFromId","isForwardFromChannel","from_id","currentPeerId","avatar","bubbles","firstTimestamp","firstItem","firstMid","lastTimestamp","lastItem","lastMid","updateClassNames","first","bubble","_length","last","insertItem","insertInDescendSortedArray","sortGroupItemsKey","insertGroup","indexOfAndSplice","mount","mounted","onItemUnmount","forEachReverse","mountItem","onItemMount","unmountItem","dateContainer","getDateContainerByTimestamp","dateGroups","_group","dateGroupsLength","unmountedLength","reduce","acc","STICKY_OFFSET","deleteEmptyDateGroups","BubbleGroups","itemsArr","itemsMap","newGroupDiff","sortItemsKey","sortGroupsKey","removeItemFromCache","removeAndUnmountBubble","getItemByBubble","siblings","getSiblingsAtIndex","modifiedGroups","previousSibling","nextSibling","canItemsBeGrouped","groupUngrouped","mountUnmountGroups","toMount","toUnmount","partition","getLastGroup","changeBubbleMid","insertItemToArray","changeItemBubble","changeBubbleByBubble","to","item1","item2","isAllMessagesForum","getMessageThreadId","itemIndex","findGroupSiblingByItem","findGroupSiblingInItems","previousItem","siblingGroupedItem","nextItem","addItemToGroup","addItemToCache","array","getMessageFromId","createItem","SERVICE_AS_REGULAR","getDateForDateContainer","groupMid","splitSiblingsOnGrouping","previousGroup","prepareForGrouping","hadGroup","foundItem","splittedGroups","TAG_NAME","RepliesElement","updated","postKey","replies","leftPart","recent_repliers","stackedAvatars","getPeerId","compareAndUpdate","args","isUnread","read_max_id","max_id","textSpan","iconSpan","rippleContainer","formatNumber","subscribeRepliesThread","updateMessage","makeEdited","edited","makeSponsored","MessageRender","setTime","chatType","editedSpan","sponsoredSpan","isSponsored","sponsored","isMessage","time","views","postAuthor","post_author","postViewsSpan","channelViews","edit_date","edit_hide","pinned","timeSpan","inner","clonedArgs","renderReplies","bubbleContainer","messageDiv","isFooter","repliesFooter","setReply","isReplacing","currentReplyDiv","reply_to_mid","replyToPeerId","reply_to","reply_to_peer_id","originalMessage","originalPeerTitle","titlePeerId","originalMessageFwdFromId","needUpdate","replyMid","fillPromise","isAnyGroup","SuperIntersectionObserver","observing","observingQueue","freezedObservingNew","callbacks","disconnect","toggleObservingNew","queue","isMentionUnread","mentioned","wrapAlbum","attachmentDiv","uploading","prepareAlbum","minWidth","spacing","forMedia","containerWidth","containerHeight","hasSpoiler","mediaDiv","withTail","noAutoplayAttribute","itemWidth","itemHeight","getMediaDurationFromMessage","AppPollResultsTab","resultsDiv","poll","appPollsManager","getPoll","setTitle","quiz","question","percents","voters","total_voters","roundPercents","fragment","createDocumentFragment","hr","answer","answers","answerEl","answerTitle","answerPercents","minHeight","getVotes","option","votesList","votes","vote","user_id","next_offset","lineTotalLength","sum","minIndex","minRemainder","remainder","maxRemainder","pollElement","isClosed","closed","performResults","chosenIndexes","PollElement","setMaxLength","resizePolls","hideQuizHint","onHide","prevQuizHint","prevQuizHintOnHide","prevQuizHintTimeout","isListenerSet","isQuiz","isRetracted","isPublic","isMultiple","chosingIndexes","sentVote","clickHandler","answerIndex","foundIndex","sendVotes","MAX_LENGTH","MAX_OFFSET","svgLines","setLineProgress","getTotalLength","descKey","public_voters","multiple_choice","multipleSelect","descDiv","nextElementSibling","typeDiv","avatarsDiv","close_period","close_date","timeLeftDiv","quizTimer","radius","circumference","PI","period","closeTime","quizInterval","setInterval","timeLeft","strokeDashoffset","strokeDasharray","clearInterval","getResults","answerDivs","numberDivs","footerDiv","viewResults","votersCountDiv","sendVoteBtn","canVote","setVotersCount","detachClickEvent","initQuizHint","solution","solution_entities","toggleHint","textEl","setQuizHint","correctResult","correct","chosen","indexes","sendVotePromise","sendVote","timeEl","forwards","recent_voters","isVoted","hideSendVoteBtn","hideViewResultsBtn","maxPercents","getPercentValue","iterate","fullTime","times","votersCount","multiplier","rtlChars","justRtlDirCheck","IGNORE_ACTIONS","TEST_SCROLL_TIMES","TEST_SCROLL","PEER_CHANGED_ERROR","BIG_EMOJI_SIZES","BIG_EMOJI_SIZES_LENGTH","getMainMidForGrouped","ChatBubbles","unreadOut","skippedMids","bubblesNewByGroupedId","bubblesNew","dateMessages","scrolledDown","isScrollingTimeout","unreaded","unreadedSeen","messagesQueueOnRenderAdditional","firstUnreadBubble","followStack","isHeavyAnimationInProgress","isFirstLoad","passEntities","viewsMids","isTopPaddingSet","renderingMessages","bubblesToEject","bubblesToReplace","setPeerTempId","renderNewPromises","extendedMediaMessages","unreadedObserverCallback","onUnreadedInViewport","viewsObserverCallback","sendViewCountersDebounced","sponsoredMessage","randomId","random_id","viewSponsoredMessage","stickerEffectObserverCallback","isInDOM","onBubblesMouseMove","unhoverPrevious","canSelectBubble","hoverBubble","hoverReaction","setHoverVisible","stickerWrapper","getMessage","getGroupsFirstMessage","getMiddleware","appReactionsManager","getAvailableReactionsByMessage","availableReactions","availableReaction","select_animation","needUpscale","withThumb","needFadeIn","assumeType","sendReaction","onBubblesClick","setInnerPeer","previousElementSibling","chatInner","onDatePick","selectedText","contactDiv","callDiv","callUser","appPaymentsManager","getInputInvoiceByPeerId","reactionElement","reactionsElement","reactionCount","getReactionCount","reaction","stickerEmojiEl","findUpAttribute","bubbleMid","reply_to_top_id","saved_from_msg_id","openThread","message1","getMessageWithReplies","getDiscussionMessage","channel_id","via","appDraftsManager","setDraft","nameDiv","peerIdStr","savedFrom","inputInvoice","messageId","stickerSetInput","checkTargetForMediaViewer","getMidsByMessage","isReplyClick","replyToMid","reply_to_msg_id","ignoreHeavyAnimation","scrollDimensions","forceDown","sliceViewportDebounced","pinnedMessage","setCorrectIndexThrottled","lastScrollDirection","setStickyDateManually","distanceToEnd","getDistanceToEnd","loadedAll","setPeerPromise","processBatch","loadQueue","filterQueue","avatarPromises","groupBubbles","updatePosition","perf","performance","timePromises","groupCollapsed","groupEnd","setUnreadDelimiter","restoreScroll","scrollSaver","prepareToSaveScroll","ejectBubbles","oldBubble","replaceSaved","bubbleGroups","local","updatePlaceholderPosition","setAllSeen","requestHistory","setMessageId","constructBubbles","batchProcessor","process","possibleError","storageKey","sequential","messagesStorageKey","messagesQueuePromise","newItem","_items","scrollingToBubble","scrollToEnd","deleteMessagesByIds","tempMessage","_bubble","groupedId","grouped_id","getMessagesByAlbum","reactionsElements","changeMessage","repliesElement","newDiv","safeRenderMessage","scrollToBubbleIfLast","pending","audioElement","transcribedText","dots","createTextNode","before","deletedMids","wasMainMid","mainMid","changedResults","getMountedBubble","createScrollSaver","save","reactions","appendReactionsElementToBubble","restore","obj","timestamps","removeAttribute","listenTo","findTarget","closest","stickyIntersector","stuck","dateMessage","dateBubble","previousStickyDate","sliceViewport","setScroll","attachContainerListeners","contextMenu","attachListeners","highlightBubble","MAX","replyAfter","swipeAvatar","shouldReply","handleHorizontalSwipe","canSend","_target","_swipeAvatar","initMessageReply","listenerOptions","constructPeerHelpers","updateGradient","renderNewMessage","msgs","setUnreadCount","updateUnreadByDialog","getChat","hadRights","hadPlainRights","canSendPlain","hasPlainRights","canEmbedLinks","finishPeerChange","willSendWebPage","lastUrl","onMessageInput","forum","setPeer","reloadMessages","toDelete","setLoaded","postViewsElements","different","postViews","root","incrementMessageViews","onUpdate","getScheduledMessagesStorage","queuePromise","createResizeObserver","resizeObserver","wasHeight","resizing","skip","scrolled","part","rAF","onResizeEnd","offsetHeight","isScrolledDown","setScrollTopSilently","setEndRAF","cancelAnimationFrame","ResizeObserver","contentRect","realDiff","_part","needScrollTop","destroyResizeObserver","setReactionsHoverListeners","useRafs","getRenderedLength","readUnreaded","readPromise","idleController","bubblesMaxId","getHistoryMaxId","readContents","readHistory","documentDiv","groupedItem","SINGLE_MEDIA_CLASSNAME","isSingleMedia","parents","hasAspecter","albumItem","onGoDownClick","bad","getBubbleByPoint","verticalSide","getViewportSlice","getGroupedBubble","groupId","getMidsByAlbum","getBubbleGroupedItems","findNextMountedBubbleByMsgId","filterCallback","_mid","foundMid","loadMoreHistory","getHistoryTopPromise","getHistoryBottomPromise","getHistory1","destroyScrollable","onScrolledTop","getHistoryStorage","readMaxId","readOutboxMaxId","msgId","destroyBubble","permanent","ignoreOnScroll","ignoreNextScrollEvent","deleteSelectedMids","pollExtendedMediaMessages","getExtendedMedia","setExtendedMediaMessagesPollInterval","pollExtendedMediaMessagesPromise","setTopPadding","setPaddingTo","isPaddingNeeded","clientHeight","paddingTop","unsetPadding","_renderNewMessage","newMessage","getLastBubble","performHistoryResult","scrollToBubbleEnd","scrollToBubble","forceDuration","fallbackToElementStartWhenCentering","whichChild","isChangingHeight","messageInput","margin","axis","getNormalSize","dimensions","gradientRenderer","toNextPosition","getProgress","lastScrollPosition","datasetKey","createDateBubble","today","day","bubbleContent","serviceMsg","fakeBubble","observeStickyHeaderChanges","bubblesToo","cleanupPlaceholders","attachedUnreadBubble","fetchNewPromise","getSponsoredMessagePromise","onAnimateLadder","resolveLadderAnimation","attachPlaceholderOnRender","emptyPlaceholderBubble","cancelMeasure","samePeer","stack","startParam","bindPrefix","middlewarePromise","onChangePeer","isRestricted","topMessage","getPinnedMessagesMaxId","isTarget","followingUnread","savedPosition","overrideAdditionMsgId","getChatSavedPosition","getReadMaxIdIfUnread","getDialogOrTopic","unread_count","foundSlice","findSliceOffset","isJump","isStartButtonNeeded","setStartParam","playMediaWithTimestampAndMid","apiFileManager","setQueueId","messageEntityBotCommand","isBot","additionMsgId","maxBubbleId","oldChatInner","oldPlaceholderBubble","haveToScrollToBubble","fromUp","scrollFromDown","scrollFromUp","willScrollOnLoad","setPeerOptions","cached","waitPromise","setPeerCached","mountedByLastMsgId","isPinnedMessagesNeeded","setCorrectIndex","unlock","lastBubble","onRenderScrollSet","afterSetPromise","setFetchReactionsInterval","setFetchHistoryInterval","onScrolledAllDown","isForumTopic","getDialogOnly","unread_mark","markDialogUnread","playMediaWithTimestamp","albumItemMid","textMid","attachment","fetchReactions","getMessagesReactions","needFetchInterval","isFetchIntervalNeeded","apiUpdatesManager","unsubscribeFromChannelUpdates","subscribeToChannelUpdates","historyMaxId","canWrite","renderMessagesQueue","addToQueue","isAvatarNeeded","additionalCallback","wrapMediaSpoiler","processResult","newBubble","originalPromise","renderMessage","albumMids","reactionsMessage","albumMessages","albumMustBeRenderedFull","our","isOurMessage","contentWrapper","isInUnread","unread","customEmojiSize","ignoreAction","langPack","chat_id","is_single","messageMessage","albumTextMessage","messageMedia","needToSetHTML","getAlbumText","bigEmojis","emojiEntities","strLength","curr","setProperty","Infinity","richTextOptions","richText","canHaveTail","isStandaloneMedia","sticker","appStickersManager","getAnimatedEmojiSticker","haveRTLChar","test","topicNameButtonContainer","withIcons","replyMarkup","reply_markup","replyMarkupRows","rows","containerDiv","rowDiv","buttonEl","noLinks","noLinebreaks","botId","viaBotId","same_peer","appInlineBotsManager","checkSwitchReturn","popup","switchInlineQuery","mediaInvoice","extended_media","receipt_msg_id","button_id","toggleDisability","handleUrlAuth","buttonId","haveButtons","column","callbackButtonClick","callbackAnswer","status","messageWithReplies","getMessageWithCommentReplies","withReplies","isOutMessage","nameContainer","canHideNameIfMedia","isMessageEmpty","viewButton","processingWebPage","IS_ANDROID","wrapUrl","telegram_channel","telegram_megagroup","telegram_bot","makeViewButton","box","quote","previewResizer","preview","quoteTextDiv","mediaSize","noInfo","docDiv","file","canTranscribeVoice","site_name","strong","titleDiv","textDiv","isSquare","animated","isEmoji","boxSize","emojiSticker","animatedSticker","staticSticker","emoji","noPremium","nopremium","getStickerEffectThumb","isRound","newNameContainer","richTextFragment","getMidsByMid","wrapGroupedDocuments","lastContainer","addClassName","formatCallDuration","reason","contact","contactDetails","contactNameDiv","fullName","first_name","last_name","contactNumberDiv","phone_number","avatarElem","wrapPoll","isTest","extendedMedia","isAlreadyPaid","isNotPaid","innerMedia","wrappedPrice","paymentsWrapCurrencyAmount","total_amount","currency","priceEl","video_duration","videoTime","l","joiner","access_hash","dc_id","file_reference","dotRenderer","needName","titleVia","mustHaveName","isHidden","isForward","replyContainer","withPremiumIcon","getPeerColorById","scam","fake","generateFakeIcon","after","goto","generateTail","documentContainer","documentMessageDiv","viewportSlice","deleteViewportSlice","getSaved","historyResult","needReflowScroll","reflowScrollableElement","setLoadedPromises","firstSlice","lastSlice","both","processLocalMessageRender","detached","backLimit","acknowledged","getHistory","ackedResult","getScheduledMessages","animateAsLadder","additionMsgIds","isAdditionRender","targetMid","sortedMids","topIds","middleIds","bottomIds","getServerMessageId","setBubbles","animationPromise","lastMsDelay","elementsToAnimate","transitionDelay","topRes","middleRes","bottomRes","delays","renderEmptyPlaceholder","BASE_CLASS","listElements","getRestrictionReasonText","stickerDiv","getGreetingSticker","renderPromise","order","channel_post","generateMessageId","start_param","chat_invite","chat_invite_hash","link","invite","processInternalLink","creator","isWaitingForAnimation","noTransition","setOn","onDestroy","generateLocalMessageId","addOffset","generateLocalFirstMessage","service","fill","peer_id","getOutputPeer","saveMessages","extraSize","ignoreScrollSaving","invisibleTop","invisibleBottom","invisible","side","checkPlaceholders","toggleSponsoredMessage","renderBotPlaceholder","checkIfEmptyPlaceholderNeeded","getSponsoredMessage","sponsoredMessages","messagePromise","_log","processPromise","userFull","bot_info","botInfo","description_document","description_photo","isBackLimit","resultPromise","isFirstMessageRender","serviceStartMessageId","getThreadServiceMessageId","getProfileByPeerId","sup","_promise","mustBeCount","PopupReportMessagesConfirm","onConfirm","noTitle","descriptionLangKey","langKey","isValid","reportMessages","bool","STICKER_EMOJI","header","maxLength","toggleAttribute","PopupReportMessages","titleLangKey","preloadStickerPromise","preloadAnimatedEmojiSticker","buttonsEl","marginTop","PopupSponsored","descriptionLangArgs","isCancel","PopupReactedList","closable","overlayClosable","canViewReadParticipants","canViewMessageReadParticipants","recent_reactions","chosen_order","btnClose","loaders","hasAllReactions","createFakeReaction","hasReadParticipants","readUserIds","getMessageReadParticipants","noDelimiter","chatlist","dialogSize","skipReadParticipants","skipReactionsList","nextOffset","loader","getPromise","getMessageReactionsListAndReadParticipants","combined","stickerContainer","getReactionCached","emoticon","static_icon","docIds","document_id","listEl","setIsChosen","setCanRenderAvatars","renderCounter","allReactionsSticker","REACTIONS_CLASS_NAME","REACTION_CLASS_NAME","CAN_USE_TRANSFORM","ChatReactionsMenu","reactionsMap","players","onScrollProcessItem","onMouseMove","reactionDiv","appear","select","restart","widthContainer","reactionsContainer","reactionsScrollable","callbackify","premium","renderReaction","setVisible","canUseAnimations","scaleContainer","appearWrapper","selectWrapper","skipRatio","isFirst","appear_animation","frameNo","maxFrame","selectLoadPromise","selectPlayer","lottieLoader","REACTION_SIZE","ChatContextMenu","onContextMenu","hasOwnProperty","isSelectable","isTextSelected","isSelectionEmpty","isAnchorTarget","isUsernameTarget","selectedMid","isOverBubble","isTargetAGroupedItem","viewerPeerId","canOpenReactedList","linkToMessage","getUrlToMessage","selectedMessagesText","getSelectedMessagesText","initResult","menuPadding","reactionsMenu","reactionsMenuPosition","isReactionsMenuVisible","offsetSize","nextVisiblePart","MIN_NEXT_VISIBLE_PART","minSize","onSendScheduledClick","selectionSendNowBtn","onReplyClick","onFaveStickerClick","unfave","faveSticker","onEditClick","getMessageWithText","initMessageEditing","onCopyClick","execCommand","onCopyAnchorLinkClick","onCopyLinkClick","isPrivate","onPinClick","onUnpinClick","onRetractVote","onStopPoll","stopPoll","filterButtons","setButtons","verifyFavoriteSticker","toAdd","favedStickers","getFavedStickersStickers","some","_doc","hasAttribute","notDirect","scheduleSending","editMessage","scheduleDate","onMessageSent","canEditMessage","selectedMids","getMessageFromStorage","canPinMessage","canDownload","localName","emojiInputsPromise","inputs","getUniqueCustomEmojisFromMessage","withTarget","isArray","canSaveMessageMedia","isGoodType","hasTarget","filterUnique","viewsButton","recentReactions","isViewingReactions","participantsCount","reactedLength","i18nElem","fakeText","AVATAR_SIZE","MAX_AVATARS","PADDING_PER_AVATAR","paddingRight","reactionsCount","fakeElem","readParticipants","avatars","totalSize","paddingLeft","emojisButton","setPadding","inputsPromise","appEmojiManager","getCachedCustomEmojiDocuments","docs","getStickerSet","getCustomEmojiDocuments","threadMessage","ChatBackgroundGradientRenderer","_width","_height","_tails","_scrollTails","_curve","_positions","_phases","onWheel","_animatingToNextPosition","_scrollDelta","deltaY","_onWheelRAF","drawOnWheel","floor","ceil","changeTailAndDraw","drawNextPositionAnimated","transitionValue","nextPositionTail","_nextPositionTail","_nextPositionTails","_nextPositionLeft","frames","_frames","drawImageData","_incrementalCurve","hexToRgb","hex","g","getPositions","positions","getNextPositions","phase","curveMax","curve","pos","distances","nextPos","distance","curPosition","tail","changeTail","_tail","_phase","curPos","drawGradient","getGradientImageData","_hctx","createImageData","pixels","centerDistanceY","centerDistanceY2","centerDistanceX","swirlFactor","sqrt","theta","sinTheta","sin","cosTheta","cos","pixelX","pixelY","distanceSum","_colors","distanceX","distanceY","putImageData","_ctx","_hc","colors","alpha","_canvas","fillStyle","fillRect","tails","nextPhaseOnIdx","inc","curves","scrollAnimate","createCanvas","PopupCreatePoll","withConfirm","onSubmitClick","send","radioLabel","isEmpty","isInputEmpty","questions","appendMoreField","handleChange","correctAnswers","optionInputFields","labelOptions","questionInputField","sendMenu","onSilentClick","sendSilent","onScheduleClick","openSide","onContextElement","btnConfirm","setPeerId","dd","settingsCaption","anonymousCheckboxField","multipleCheckboxField","quizCheckboxField","quizSolutionField","setValueSilently","quizElements","quizSolutionCaption","quizHr","quizSolutionContainer","quizSolutionSubtitle","getFilledAnswers","HTMLInputElement","getRichValueWithCaret","validate","quizSolution","valid","quizSolutionEntities","inputMediaPoll","getInputMediaPoll","sendOther","getMessageSendingParams","helperType","clearHelper","questionField","radioField","deleteBtn","HANDLE_EVENT","ACTIVE_CLASS_NAME","AXIS_Y_KEYS","AXIS_X_KEYS","attachListNavigation","onSelect","waitForKey","waitForKeySet","keyNames","getCurrentTarget","setCurrentTarget","scrollTo","hadTarget","fastSmoothScroll","getNextTargetX","currentTarget","isNext","nextTarget","handleArrowKey","property","endProperty","currentRect","targetRect","getNextTargetY","fireSelect","canContinue","attached","resetTarget","_onKeyDown","AutocompleteHelper","hidden","onVisible","listType","attachNavigation","controller","addHelper","toggleListNavigation","fromController","skipAnimation","hideOtherHelpers","StickersHelper","onChangeScreen","checkEmoticon","getStickersByEmoticon","stickers","ready","superStickerRenderer","renderSticker","getMinDate","getMaxDate","setFullYear","getDate","PopupSchedule","initDate","onPick","canSendWhenOnline","noButtons","showOverflowMonths","confirmShortcutIsSendShortcut","controlsDiv","monthTitle","btnSendWhenOnline","EmojiHelper","chatInput","onEmojiSelected","scrollLeft","emojis","checkQuery","firstChar","getBothEmojiKeywords","searchEmojis","AutocompletePeerHelper","doNotShow","listElement","BASE","BASE_CLASS_LIST_ELEMENT","processPeerFullForCommands","botInfos","ignoreCase","commands","command","indexObject","CommandsHelper","getReadyToSend","sendMessage","AutocompleteHelperController","helpers","helper","preserveHelper","MentionsHelper","usernames","getPeerActiveUsernames","insertAtCaret","topMsgId","trimmed","getMentions","ReplyKeyboard","onBodyTouchStart","btnHover","attachButtonListener","checkAvailability","isActive","checkForceReply","touchListener","confirmationPopup","sendContact","sendText","getReplyMarkup","getHistoryStorageTransferable","ANIMATION_GROUP","InlineHelper","queryId","queryAndResultIds","generateQId","resultId","sendInlineResult","clearDraft","_checkQuery","canSendInline","resolveUsername","bot","getInlineResults","botResults","query_id","gifsMasonry","isGallery","gallery","noCommands","mediaContainer","dcId","mimeType","blob","readBlobAsDataURL","dataURL","renderMediaWithFadeIn","observeAnimated","switch_pm","btnSwitchToPM","switchToPM","POSTING_NOT_ALLOWED_MAP","ChatBotCommands","setUserId","modifyAckedResult","acked","modifyAckedPromise","ChatSendAs","onReady","closeBtn","sendAsButtons","previousAvatar","onSendAsMenuToggle","isChanged","updateButtons","sendAsPeerId","changeSendAsPeerId","executeButtonsUpdate","sendAsPeerIds","saveDefaultSendAs","updateAvatar","getDefaultSendAs","getChannelFull","channelFull","default_send_as","updateManual","updatingPromise","wasSkippingAnimation","getSendAs","sendAsPeers","sendAsPeer","premium_required","addedListener","send_voices","send_stickers","send_gifs","send_media","send_plain","send_polls","send_inline","ChatInput","lastTimeType","replyElements","recording","recordCanceled","recordStartTime","lockRedo","canRedoFromHTML","undoHistory","executedHistory","canUndoFromHTML","onCancelRecordClick","recorder","opusDecodeController","onEmoticonsOpen","toggleClass","btnToggleEmoticons","onEmoticonsClose","isUserOnlineVisible","openScheduled","prepareDocumentExecute","undoRedo","needHTML","sameHTMLTimes","currentHTML","handleMarkdownShortcut","formatKeys","markupTooltip","applyMarkdown","getSelection","showLinkEditor","shiftKey","richValue","markdownEntities","caretPos","messageInputField","parseMarkdown","mergeEntities","parseEntities","urlEntities","getWebPagePromise","appWebPagesManager","getWebPage","setTopInfo","noWebPage","onHelperCancel","helperFunc","setTyping","botCommands","activeElement","placeCaretAtEnd","updateBotCommandsToggle","editMsgId","saveDraftDebounced","checkAutocomplete","updateSendBtn","autocomplete","getEmojiEntityFromEmoji","onBtnSendClick","forwarding","flag","blurActiveElement","restricted","voice_messages_forbidden","langPackArguments","releaseMediaPlayback","setRecording","showDiscardPopup","btnCancelRecord","recordingOverlayListener","recordingNavigationItem","sourceNode","analyser","createAnalyser","connect","fftSize","frequencyData","frequencyBinCount","getByteFrequencyData","recordRippleEl","ms","recordTimeEl","needReturn","draft","getCurrentInputAsDraft","no_webpage","originalDraft","canPassEntitiesTypes","draftsAreEqual","onHelperClick","forwardElements","replyToMsgId","inputContainer","rowsWrapperWrapper","rowsWrapper","fakeRowsWrapper","fakeSelectionWrapper","goDownBtn","controlContainer","createButtonIcon","iconBtn","cancelBtn","onHideAuthorClick","isChangingAuthor","onHideCaptionClick","forwardButtons","canToggleHideAuthor","hideSender","showCaption","hideCaption","changePeer","changeForwardRecipient","forwardBtnMenu","forwardWasDroppingAuthor","replyTitle","forwardHover","modifyArgs","newMessageWrapper","replyInTopicOverlay","inputMessageContainer","goDownUnreadBadge","goMentionBtn","goMentionUnreadBadge","goToNextMention","btnScheduled","btnToggleReplyMarkup","replyKeyboard","botCommandsToggle","scaler","botCommandsIcon","onAttachMediaClick","videos","fileInput","accept","willAttachType","attachMenuButtons","giftPremium","canGiftPremium","appAttachMenuBotsManager","getAttachMenuBots","attachMenu","attachMenuBots","attachMenuBotsButtons","attachMenuBot","inactive","getAttachMenuBotIcon","short_name","requestWebView","bot_id","webViewResultUrl","SANDBOX_ATTRIBUTES","P","titleRaw","telegramWebView","sandbox","iframe","onMount","verifyMap","attachMenuPeerTypeSameBotPM","attachMenuPeerTypeBotPM","attachMenuPeerTypePM","attachMenuPeerTypeChat","attachMenuPeerTypeBroadcast","peer_types","multiple","autocompleteHelperController","stickersHelper","emojiHelper","commandsHelper","mentionsHelper","inlineHelper","btnSendContainer","btnSend","emoticonsDropdown","attachMessageInputField","previousQuery","onFakeInput","saveDraft","center","encoderSampleRate","monitorGain","numberOfChannels","recordingGain","reuseWorker","files","touchMouseDown","onstop","ondataavailable","typedArray","dataBlob","Blob","sendFile","isVoiceMessage","isMedia","objectURL","botStartBtn","toggleBotStartBtnDisability","startBot","pinnedControlBtn","originalChat","pinnedMessageContainer","_center","neededFakeContainer","fakeWrapperTo","oldFakeWrapperTo","needTranslateX","fakeSelectionRect","fakeRowsRect","widthFrom","widthTo","initTranslateX","getNeededFakeContainer","isReplyInTopicOverlayNeeded","appNotificationsManager","isPeerLocalMuted","respectType","hasMentions","unread_mentions_count","ignoreEmptyValue","tsNow","syncDraft","helperToo","clearInput","fromUpdate","getDraft","inputFake","wrappedDraft","wrappingForPeerId","myEntities","apiEntities","wrapDraftText","wrapDraft","currentDraft","setInputValue","createSendAs","firstChange","sendAs","updateOffset","getPlaceholderKey","updateMessageInputPlaceholder","previousSendAs","ackedPeerFull","ackedScheduledMids","setSendAsCallback","filteredAttachMenuButtons","filterAttachMenuButtons","placeholderKey","hasBotCommands","updateBotCommands","updateMessageInput","haveSomethingInControl","isAnonymousSending","oldKey","newKey","isEditingAndLocked","restoreInputLock","contentEditable","oldInputField","withLinebreaks","attachMessageInputListeners","fixSafariStickyInputFocusing","isSendShortcutPressed","range","createRange","sel","setStart","childNodes","collapse","removeAllRanges","addRange","readAllHistory","isContentEditable","commandsMap","canCombine","hasMarkup","resetCurrentFontFormatting","executed","prepareApplyingMarkdown","hasMarkupInSelection","resetCurrentFormatting","setActiveMarkupButton","simulateInputEvent","insertText","insertEntity","isHelper","makeFocused","fullValue","substr","AUTO_COMPLETE_REG_EXP","matchIndex","toString","modify","hadValue","_value","foundHelper","checkInlineAutocomplete","needPlaceholder","setPreloaderShow","btnPreloader","inlineMatch","bot_inline_placeholder","inlinePlaceholder","helperWaitingForward","canSetDraft","fireEvent","clearValue","fixSafariStickyInput","getValueAndEntities","clearReply","endOffset","unicode","pushRecentEmoji","sendingParams","fromPeerId","forwardMessages","dropAuthor","dropCaptions","isDroppingCaptions","sendMessageWithDocument","silent","saveRecentSticker","hideCaptionCheckboxField","replyFragment","usingMids","initMessagesForward","fromPeerIdsMids","fromPeerIds","smth","messagesWithCaptionsLength","peerTitles","titleKey","senderTitles","firstMessage","usingFullAlbum","newReply","intl","peerTitleEl","_message","setReplyToMsgId","callerFunc","replyParent","oldReply","haveReply","CLASS_NAME","REACTION_DISPLAY_BLOCK_COUNTER_AT","ReactionElement","_reactionCount","canRenderAvatars","doNotRenderSticker","hadStickerContainer","getReaction","center_icon","renderDoc","wrapPromise","wrapStickerPromise","displayOn","renderAvatars","isChosen","fireAroundAnimation","REACTION_INLINE_SIZE","REACTION_BLOCK_SIZE","around_animation","stickerPromise","iconPlayer","aroundPlayer","removeOnFrame","REACTIONS_ELEMENTS","ReactionsElement","sorted","middlewareHelpers","connectedCallback","onConnectCallback","isPlaceholder","hasReactions","getAvailableReactions","counts","totalReactions","can_see_list","handleChangedResults","MEDIA_SIZE","wrapReplyDivAndCaption","mediaEl","mediaChildren","withoutMediaType","video_thumbs","videoSize","ReplyContainer","isMediaSet","accumulateMapSet","AppSelection","targetLookupClassName","verifyTarget","selecting","firstTarget","processElement","checkBetween","seenSet","seenLength","elementsBetween","getElementsBetween","toggleByMid","canceledSelection","getElementFromTarget","verifyMouseMoveTarget","removeManual","listenElement","documentListenerOptions","firstRect","lastRect","isHigher","lookupBetweenParentClassName","lookupBetweenElementsQuery","firstIndex","lastIndex","doNotAnimate","onCancelSelection","toggleSelection","navigationType","random","verifyTouchLongPress","isElementShouldBeSelected","appendCheckbox","hasCheckbox","getCheckboxInputFromElement","updateContainer","forceSelection","cantForward","cantDelete","cantSend","getStorageKey","cantForwardDeleteMids","onUpdateContainer","selectedMessagesPromises","toggleCheckboxes","wasSelecting","toggleResult","onToggleSelection","updateElementSelection","toggleMid","unselect","SearchSelection","selectionCountEl","selectionGotoBtn","selectionContainer","btnCancel","attachClickOptions","transitionElement","ChatSelection","isGroupedBubbleSelected","getMidsFromGroupContainer","groupContainer","isGroupedSelected","isGroupedMidsSelected","selectionInputWrapper","selectionLeft","selectionRight","translateButtonsX","isGrouped","groupedCheckboxInput","SendMenu","sendMenuButtons","CheckboxField","restriction","asRadio","stateKey","stateValues","stateValueReverse","stateValue","checkSvg","bg","border","withRipple","withHover","isDisabled","disable","CheckboxFields","createField","info","isNested","nestedTo","nested","asRestrictions","subtitleLangKey","accordion","restrictionText","nodes","nestedCounter","_info","setNestedCounter","titleRow","getNestedCheckedLength","toggleWith","unchecked","processToggleWith","fields","processNestedTo","CodeInputField","assign","lastLength","setLabel","onFill","checkboxes","cancelButton","countries","setCountries","country","default_name","localeCompare","VIRTUAL_COUNTRIES","CountryInputField","hidePicker","hideTimeout","selectCountryByTarget","defaultName","phoneCodeEl","phoneCode","countryCode","lastCountrySelected","lastCountryCodeSelected","country_codes","_countryCode","country_code","onCountryChange","liMap","arrowDown","selectList","initSelect","noPhoneCodes","iso2","liArr","spanEmoji","mouseDownHandlerAttached","onKeyPress","names","abbr","word","blur","selectCountryByIso2","countryName","DivAndCaption","DotRenderer","dpr","devicePixelRatio","prepare","generateDot","adding","Path2D","arc","mOpacity","draw","dot","addOpacity","easedOpacity","globalAlpha","renderFirstFrame","EditPeer","_disabled","uploadAvatar","changedLength","requiredLength","requiredValidLength","inputFields","required","nextBtn","withoutAvatar","doNotEditAvatar","avatarEdit","_upload","popupOptions","lockWithPromise","unlockOnSuccess","GifsTab","gifsContainer","EmoticonsDropdown","masonry","EMOTICONSSTICKERGROUP","getGifs","processInvisibleDiv","ANIMATIONGROUP","AppGifsTab","onGifsClick","fileId","inputSearch","gifsDiv","onCloseAfterTimeout","newSearch","gifBotPeerId","AppStickersTab","setsDiv","stickerSet","toggleStickerSet","installed_date","renderFeatured","renderSet","countDiv","stickersDiv","documents","withLock","getFeaturedStickers","coveredSets","filterRendered","covered","searchStickerSets","scrollOptions","transitionFunction","ignoreOutClickClassName","tabId","onSelectTabClick","stickersTab","gifsTab","rights","searchButton","emojiTab","checkRights","canSendToPeer","tabsEl","savedRange","getGoodRange","onOpened","refresh","onClosed","getSavedRange","setStartAfter","newRange","cloneRange","collapsed","node","endContainer","newStartNode","nodeType","TEXT_NODE","nodeValue","ELEMENT_NODE","selectNode","newOffset","deleteContents","HIDE_EMOJI_TAB","INIT_TAB_ID","lastMouseMoveEvent","mouseMoveEventAttached","onMouseOut","getElement","forceClose","addLazyLoadQueueRepeat","divs","intersector","getVisible","clearVisible","rangeCount","getRangeAt","menuOnClick","emoticons","menuScroll","prevTab","jumpedTo","getElementPosition","elementPosition","scrollToTab","scrollingToContent","getCategoryByContainer","which","getCategoryByMenuTab","additionalOffset","setActiveStatic","clientWidth","sendDocId","loadedURLs","appendEmoji","unify","kek","wrapSingleEmoji","fixEmoji","getEmojiFromElement","superEmoji","stickerEmoji","EMOJI_RECENT_ID","EMOJI_RECENT_CATEGORY","CUSTOM_EMOJI_RECENT_CATEGORY","EMOJI_CATEGORIES","category","EMOJI_ELEMENT_SIZE","EmojiTab","onCategoryVisibility","categoriesMap","renderer","newChildren","customEmojis","customEmojiElement","clearCanvas","onContentClick","isStandalone","activeElements","menuInnerScroll","intersectionOptions","categoriesIntersector","menuOnClickResult","innerScrollWrapper","preparedMap","noRegularEmoji","titleLangPackKey","createLocalCategory","unified","addEmojiToCategory","batch","getRecentEmojis","stickerSetId","getLocalStickerSet","getCustomEmojis","recentCustom","mainSet","sets","recentCategory","categories","recentCustomCategory","CUSTOM_EMOJI_RECENT_ID","createRendererForCategory","toggleLocalCategory","resizeCategories","renderStickerSet","toggleCustomCategory","postponedEvent","positionCategory","toggleRenderers","ignore","ignoreSettingDimensions","setDimensionsFromRect","deleteCategory","isCategoryVisible","forceRender","closeScrollTop","createCategory","menuTabPadding","stickerEmojiRaw","setCategoryItemsHeight","getCustomCategory","hasPremium","canSeeCustomCategory","activeEmoji","spliceExceed","onLocalCategoryUpdate","LazyLoadQueueRepeat","parallelLimit","onVisibilityChange","elementsMap","queueItem","wasSeen","setProcessQueueTimeout","SuperStickerRenderer","regularLazyLoadQueue","checkAnimationContainer","processVisible","processInvisible","unobserveAnimated","StickersTabCategory","noMenuTab","getContainerSize","getElementMediaSize","gapX","gapY","elementSize","itemsPerRow","EmoticonsTabC","categoryItemsClassName","postponedEvents","categoriesByMenuTabMap","localCategories","menuWrapper","isLocal","esgWidth","customProperties","posItems","foundMenuScroll","posMenu","notMountedItems","notMountedMenus","itemsIdx","menuIdx","StickersTab","setFavedLimit","categoryAppendStickers","clearCategoryItems","onCategoryStickers","deleteSticker","unshiftSticker","favedCategory","clearButton","clearRecentStickers","premiumCategory","apiManager","getLimit","getRecentStickersStickers","getAllStickers","getPremiumStickers","isPremium","race","rendererLazyLoadQueue","faved","createStickersContextMenu","verifyRecent","unshiftRecentSticker","deleteRecentSticker","generateDelimiter","delimiter","isScam","LazyLoadQueueRepeat2","spliced","findAndSpliceAll","GifsMasonry","scrollPromise","processVisibleDiv","noPreview","transitionTime","scrollableX","proxy","Proxy","apply","that","selectTarget","result1","canChange","mutateCallback","useStripe","indicator","currentIndicator","shiftLeft","insertRichTextAsHTML","createCustomEmojiRendererForInput","customEmojiRenderer","richInputHandler","customEmojiElements","ces","documentFragmentToHTML","pre","getCaretPosNew","onBeforeInput","inputType","removeExtraBOMs","originalEvent","clipboardData","getData","usePlainText","filterEntity","curChild","lines","textLength","lineIndex","line","nextLine","correctedText","entities2","InputState","wrappingDraft","processCustomEmojisInInput","hasSet","InputField","showLengthOn","canBeEdited","labelText","onInputCallbacks","isCollapsed","focusOnNext","clientX","inputMode","labelEl","showingLength","wasError","inputLength","isError","selectNodeContents","selectElementContents","fromSet","originalValue","isValidToChange","setDraftValue","setOriginalValue","setState","Valid","setError","USELESS_REG_EXP","InputFieldAnimated","updateInnerHTML","setHeight","noAnimation","newHeight","currentHeight","transitionDuration","onChangeHeight","InputSearch","prevValue","onClearClick","onClear","searchIcon","clearBtn","LazyLoadQueue","getItem","addElement","LazyLoadQueueIntersector","inProcess","loadItem","intersectorTimeout","processQueue","MediaProgressLine","useTransform","onLoadedData","setSeekMax","progressRAF","setLoadProgress","onProgress","filledLoad","buf","buffered","numRanges","nearestStart","end","realDuration","seek","testQueue","pendingTest","setTestQueue","testElement","getElementWidth","mapped","firstTime","font","textWidth","elementWidth","newElementWidth","widthChanged","smallerText","smallerWidth","smallerTextLength","half","half1","half2","MiddleEllipsisElement","PasswordMonkey","passwordInputField","needFrame","noCache","currentFrame","setSpeed","onVisibilityClickAdditional","passwordVisible","setDirection","curFrame","TrackingMonkey","playAnimation","frame","idleAnimation","PasswordInputHelpers","onVisibilityClick","toggleVisible","stealthy","PasswordInputField","PeerProfileAvatars","draggable","loadCallback","intersectionObserver","loadCallbacks","addTab","gradient","arrowPrevious","arrowNext","checkScrollTop","SWITCH_ZONE","freeze","_e","clickX","toRight","cancelNextClick","lastDiffX","lastX","SCALE","TRANSLATE_TEMPLATE","addIndex","loadNearestToTarget","filterChatPhotosMessages","chat_photo","generateFakeAvatarMessage","activeTab","photo_id","setText","PeerProfile","bio","isAnonymous","getUserPhone","notifications","togglePeerMute","setPeerStatus","setMoreDetails","n","fillUsername","self","fillUserPhone","setAvatar","setPeerStatusInterval","needClear","useWhitespace","ignoreSelf","clearSetMoreDetailsTimeout","canBeDetailed","_setAvatar","isTopic","oldAvatars","getUsernamesAlso","also","anchorCopy","formatUserPhone","fillNotifications","notificationsRow","fillName","fillRows","fillProfileElements","cleaned","_setMoreDetails","peerFull","getMiddlewarePromise","about","exportedInvite","exported_invite","address","setMoreDetailsTimeout","isPeerRestricted","setPromise","makeError","generateTitleIcons","noVerifiedIcon","noFakeIcon","noPremiumIcon","verified","use2","generateVerifiedIcon","emojiStatus","emoji_status","generatePremiumIcon","weakMap","WeakMap","PeerTitle","setOptions","setHasInner","hasInner","fromName","limitSymbols","topic","forumTopic","getTopicIconPromise","icons","topicIcon","getPeerTitle","PopupAvatar","cropper","crop","removeHandlers","h6","cropContainer","contents","onload","originalImage","cropComponent","cropImage","event_state","cropLeft","cropTop","cropWidth","cropHeight","scaledRatio","overlayColor","CROPWIDTH","CROPHEIGHT","updateCropSize","updateCropImage","startMoving","keyHandler","imgZoom","newWidth","String","fromCharCode","charCode","stopPropagation","container_width","container_height","container_left","container_top","mouse_x","scrollX","mouse_y","clientY","pageY","scrollY","saveEventState","moving","endMoving","currentTouch","complete","toBlob","darkenCanvas","onCrop","postCanvas","ctx","PopupDatePicker","selectedDate","selectedMonth","setMonth","getMonth","minMonth","prevBtn","maxMonth","onDateClick","selectedEl","setTimeTitle","monthsContainer","handleTimeInput","onOverflow","maxString","hoursInputField","minutesInputField","number","setMinutes","getMinutes","getHours","popupCenterer","timeOptions","minute","hour","sendDate","dateOptions","weekday","renderElement","firstDate","weekStartDate","getDay","dayIndex","clonedDate","PopupDeleteDialog","peerTitleElement","getDialogType","callbackLeave","flush","leave","flushHistory","callbackDelete","titleArgs","descriptionArgs","isDanger","titleLangArgs","PopupDeleteMessages","revoke","deleteScheduledMessages","deleteMessages","isMegagroup","_hasRights","canRevoke","PopupForward","peerIdMids","chatRightsAction","peerTypes","messagesPromises","DEFAULT_APPEND_TO","appendPopupTo","onFullScreenChange","PopupElement","reAppend","MANAGERS","withoutOverlay","attachScrollableListeners","btnConfirmOnEnter","buttonsElements","langArgs","POPUPS","setClassOn","attachBorderListeners","onContentUpdate","popupConstructor","ctor","addCancelButton","PopupJoinChatInvite","chatInvite","request_needed","broadcast","importChatInvite","savePhoto","peopleCount","pin","descriptionPremium","descriptionLocked","folders","_a","limitPremium","isLocked","limitContainer","hint","free","setHintActive","showLimitPopup","appConfig","premium_purchase_blocked","ONE_HOUR","PopupMute","mutePeer","muteUntil","radioForm","createPosterFromMedia","scaleMediaElement","quality","getGifDuration","arrayBuffer","currentPopup","getCurrentNewMediaPopup","PopupNewMedia","ignoreInputValue","attachFile","willAttach","shouldCompress","itemDiv","defineNotNumerableProperties","attachMedia","attachDocument","sendFileDetails","backgroundColor","onlyVisible","actionsPromises","captionMaxLength","captionLengthMax","canSendPhotos","send_photos","canSendVideos","send_videos","canSendDocs","send_docs","changeType","hasAnyMedia","mimeTypes","changeGroup","canGroupSomething","changeSpoilers","canToggleSpoilers","wasInputValue","attachFiles","createContextMenu","applyMediaSpoiler","removeMediaSpoiler","findElement","widthStr","heightStr","containerWidthStr","containerHeightStr","toDataURL","strippedBytes","reveal","destroyAfter","appendDrops","mediaCount","mediaWithSpoilers","addFiles","toPush","_file","lastModified","foundBad","sendFileParams","noSound","shake","scaledBlob","sendAlbum","modifyMimeTypeForTelegram","scaleImageForTelegram","convertWebp","PHOTO_SIDE_LIMIT","revokeObjectURL","startsWith","audioDecodedByteCount","webkitAudioDecodedByteCount","onseeked","onerror","createPosterFromVideo","scaled","isPhoto","isAudio","Audio","onRender","foundPhotos","foundVideos","foundFiles","appendMediaToContainer","calcImageInBox","firstType","oldSendFileDetails","albumContainer","o","oldParams","stringResults","numberResults","replaceNonNumber","CARD_BRAND_REGEXP","visa","mastercard","amex","discover","diners","diners14","jcb","unionpay","elo","mir","CARD_BRANDS","minLength","cvcMaxLength","cvcMinLength","unknown","detectCardBrand","card","sanitizedCard","brand","detectUnifiedCardBrand","createArray","delta","charCodeAt","buggedRegExp","getDistanceFromBuggedToNormal","char","fixBuggedNumbers","makeOptionalCharacter","consumed","makeRequiredCharacter","partial","wrapCharacterRegExpFactory","optional","_regExp","source","makeCharacter","makeMonthDigitPatternCharacter","digit","capitalCharacter","toUpperCase","cleanedResult","formattingCharacter","str1","makeFormattingCharacter","optionalPattern","spaceCharacter","yearOptionalPattern","sixteenPattern","fifteenPattern","requiredPostcodes","generateFourPattern","cardFormattingPatterns","cardNumber","cardExpiry","cardCvc","cardCvcFromBrand","pattern","postalCodeFromCountry","optionalDigits","accumulateLengths","strs","accumulate","nbspRegExp","makeValidationError","validateCardNumber","sanitized","getCardInfoByNumber","ignoreIncomplete","validateCompleteCardNumber","makeCardNumberError","validateCardExpiry","monthStr","yearStr","_year","nextMonth","isNaN","validateExpiry","createVerificationIframe","allow","PopupPaymentVerification","openPathAfter","path_full","InputFieldCorrected","lastKeyDown","deleting","lastTransformed","getPattern","pushRest","autocorrectComplete","selectionStart","selectionEnd","character","getCharacter","meta","formatInputValueByPattern","formatMethod","transformedValue","validateNew","onBlur","justReturn","validateMethod","validateAnyIncomplete","errorKeys","handleInputFieldsOnChange","_onChange","original","createCountryZipFields","zip","countryInputField","postcodeInputField","SUPPORTED_NATIVE_PROVIDERS","PopupPaymentCard","paymentForm","savedCard","native_provider","cardOut","token","credentials","can_save_credentials","cardSection","nativeParams","JSON","parse","native_params","lastBrand","lastBrandImg","brandIconTempId","cardInputField","invalid","incomplete","transformed","getPaymentBrandIconPath","setBrandIcon","cvcInputField","nameInputField","need_cardholder_name","expireInputField","switchFocusOrder","previousInputField","nextInputField","inputFieldsRow","form","billingSection","need_country","need_zip","canSave","saveCheckboxField","saveRow","payButton","PaymentButton","expiryFull","expiryMonth","expiryYear","cvc","cardholderName","nativeProvider","URLSearchParams","headers","publishable_key","json","expiration_month","expiration_year","security_code","public_token","stringify","PopupPaymentCardConfirmation","passwordState","captionArgs","inputCheckPassword","passwordManager","getInputCheckPassword","tmpPassword","invokeApi","password","handled","PopupPaymentShipping","invoice","savedInfo","saved_info","addressSection","address1InputField","address2InputField","cityInputField","stateInputField","receiverSection","emailInputField","telInputField","shipping_address_requested","name_requested","email_requested","phone_requested","validateEmail","matchEmail","validatePhone","selectedCountry","shipping_address","street_line1","street_line2","city","country_iso2","post_code","email","requestedInfo","validateRequestedInfo","shippingAddress","ADDRESS_STREET_LINE1_INVALID","ADDRESS_STREET_LINE2_INVALID","ADDRESS_COUNTRY_INVALID","ADDRESS_CITY_INVALID","ADDRESS_STATE_INVALID","ADDRESS_POSTCODE_INVALID","REQ_INFO_NAME_INVALID","REQ_INFO_EMAIL_INVALID","REQ_INFO_PHONE_INVALID","focusField","PopupPaymentShippingMethods","shippingOption","shipping_options","prices","amount","lastShippingId","PopupPayment","isReceipt","tipButtonsMap","confirmed","onConfirmed","popupPaymentVerification","itemEl","detailsClassName","photoEl","linesClassName","linesEl","botName","preloaderContainer","getPaymentReceipt","msg_id","getPaymentForm","savedCredentials","saved_credentials","lastRequestedInfo","providerPeerTitle","getState","provider_id","wrapAmount","skipSymbol","isRecurring","recurring","peerTitle2","makeLabel","pricesClassName","makePricesElements","price","_label","wrappedAmount","pricesElements","getTipsAmount","shippingAmount","setTotal","totalAmount","totalLabel","payI18n","canTip","max_tip_amount","tip_amount","tipsClassName","currencyData","getInputValue","setInputWidth","getTextWidth","unsetActiveTip","tipEl","tipsLabel","haveToIgnoreEvents","onSelectionChange","ignoreNextSelectionChange","onFocus","onFocusOut","symbol","space_between","symbol_left","tipsEl","tipClassName","tipButtons","suggested_tip_amounts","tipAmount","prevTipEl","setRowIcon","createMedia","createRow","noWrap","setRowTitle","setCardSubtitle","methodRow","onMethodClick","previousCardDetails","previousToken","credentials_title","providerRow","providerAvatar","shippingAddressRow","shippingNameRow","shippingEmailRow","shippingPhoneRow","shippingMethodRow","lastShippingOption","onShippingAddressClick","onShippingMethodClick","setShippingTitle","postAddress","setShippingInfo","setShippingOption","lastShippingPricesElements","shipping","acceptTermsCheckboxField","recurring_terms_url","acceptTermsRow","recurringElements","lastTmpPasword","missingInfo","tmp_password","paymentResult","sendPaymentForm","form_id","_passwordState","valid_until","PopupPeer","PopupPickUser","PopupSendNow","sendScheduledMessages","PopupStickers","isEmojis","onStickersClick","updateAdded","stickersFooter","onStickerSetUpdate","_set","updateButton","loadStickerSet","createStickerSetElements","headerRow","buttonRight","added","itemsContainer","setsPromises","firstSet","isStickerPack","onSend","containersPromises","toggleStickerSets","isAdd","buttonAppend","installed","PopupPinMessage","unpin","canUnpin","oneSide","unpinAllMessages","hidePinnedMessages","updatePinnedMessage","buttonText","getPinnedMessagesCount","pinButtonText","ProgressivePreloader","isUpload","attachMethod","loadFunc","constructContainer","bold","constructDownloadIcon","downloadSvg","cancelSvg","func","startTime","onEnd","notify","TRANSITION_TIME","addNotifyListener","Layouter","ratios","countRatios","proportions","countProportions","averageRatio","maxSizeRatio","layout","ComplexLayouter","layoutTwo","layoutThree","layoutFour","layoutTwoTopBottom","layoutTwoLeftRightEqual","layoutTwoLeftRight","layoutThreeLeftAndOther","layoutThreeTopAndOther","layoutFourTopAndOther","layoutFourLeftAndOther","geometry","sides","RectPart","minimalWidth","secondWidth","firstWidth","firstHeight","thirdHeight","secondHeight","rightWidth","leftWidth","thirdWidth","h0","w0","w2","w1","h1","h2","ratio","cropRatios","attempts","multiHeight","pushAttempt","lineCounts","heights","second","third","fourth","optimalAttempt","optimalDiff","attempt","lineCount","totalHeight","minLineHeight","bad1","bad2","optimalCounts","optimalHeights","rowCount","colCount","lineHeight","col","widthItem","heightItem","borderTopLeftRadius","borderBottomLeftRadius","borderTopRightRadius","borderBottomRightRadius","putAvatar","renderThumbPromise","thumbImage","isFullLoaded","loadThumbPromise","stripped_thumb","getPreviewURLFromBytes","sequentialDom","myId","getForumTopic","avatarAvailable","avatarRendered","appAvatarsManager","isAvatarCached","getPeerInitials","returnDiv","setButtonLoader","RadioField","alignRight","RadioForm","radios","RangeSelector","events","setFilled","filled","stepStr","decimals","_removeListeners","addProgress","rectMax","offsetAxisValue","rippleClickId","attachListenerTo","handler","drawRipple","clickId","_handler","touchStartFired","clickY","isRippleUnneeded","touchEnd","setContent","Row","checkboxFieldOptions","subtitleRight","subtitleRow","subtitleLangArgs","isToggle","withCheckboxSubtitle","titleRightSecondary","titleRightContent","_title","createTitle","navigationTab","buttonRightLangKey","_subtitle","createSubtitle","midtitle","_midtitle","createMidtitle","disableWithPromise","makeSortable","sortIcon","toggleSorting","CreateRowFromCheckboxField","RadioFormFromRows","RadioFormFromValues","checkedRadioField","ScrollableBase","logPrefix","onScrollMeasure","needCheckAfterAnimation","scrollPosition","scrollProperty","addScrollListener","addedScrollListener","removeScrollListener","removeHeavyAnimationListener","Scrollable","onScrollOffset","withPaddingContainer","maxScrollTop","ScrollableX","splitCount","scrollHorizontally","deltaX","scrollWidth","SettingSection","fakeGradientDelimiter","generateContentElement","nameArgs","captionOld","generateSection","AppNewGroupTab","isGeoChat","inputWrapper","groupNameInputField","groupLocationInputField","valueCheck","userLocationCoords","userLocationAddress","createChannel","geo_point","megagroup","inputFile","editPhoto","inviteToChannel","createChat","chatsSection","new","startLocating","usersPromise","myUserPromise","getSelf","users","setTitlePromise","myUser","joined","isLast","geolocation","getCurrentPosition","lat","coords","latitude","long","longitude","uri","display_name","GeolocationPositionError","PrivacyType","getPrivacyRulesDetails","rules","types","allowPeers","disallowPeers","rule","PrivacySection","onRadioChange","captions","captionElement","radioSection","exceptions","radioRows","skipTypes","noExceptions","exceptionTexts","exception","_peerIds","slider","createTab","skippable","takeOut","newPeerIds","generateStr","splitPeersByType","selectedPeerIds","appPrivacyManager","getPrivacy","inputKey","setRadio","eventListener","chatKey","usersKey","getUserInput","setPrivacy","AppPrivacyPhoneNumberTab","captionEl","mePath","phoneSection","sCaption","AppTwoStepVerificationSetTab","inputContent","btnReturn","sliceTabsUntilTab","AppSettingsTab","canFocus","isFirstInput","AppTwoStepVerificationEmailConfirmationTab","codeInputField","confirmPasswordEmail","goNext","btnChange","btnResend","cancelPasswordEmail","AppTwoStepVerificationEmailTab","resendPasswordEmail","onOpenAfterTimeout","onContinueClick","btnContinue","btnSkip","toggleButtons","updateSettings","currentPassword","plainPassword","newPassword","symbols","AppTwoStepVerificationHintTab","onSkipClick","saveHint","AppTwoStepVerificationReEnterPasswordTab","monkey","verifyInput","AppTwoStepVerificationEnterPasswordTab","isNew","has_password","getStateInterval","_state","check","auth","AppTwoStepVerificationTab","removeTabFromHistory","btnChangePassword","btnDisablePassword","btnSetRecoveryEmail","has_recovery","btnSetPassword","AppPrivacyLastSeenTab","AppPrivacyProfilePhotoTab","AppPrivacyForwardMessagesTab","AppPrivacyAddToGroupsTab","AppPrivacyCallsTab","AppActiveSessionsTab","Session","app_name","app_version","ip","date_active","date_created","device_model","system_version","platform","authorizations","session","btnTerminate","otherSection","onError","onTerminateClick","menuElement","AppBlockedUsersTab","btnAdd","toggleBlock","blocked","getBlocked","convertKeyToInputKey","AppPrivacyVoicesTab","AppActiveWebSessionsTab","sessions","region","domain","browser","appSeamlessLoginManager","resetWebAuthorizations","leftLength","resetWebAuthorization","AppPrivacyAndSecurityTab","fromTab","getAppConfig","globalPrivacy","getGlobalPrivacySettings","contentSettings","webAuthorizations","getWebAuthorizations","SUBTITLE","blockedPeerIds","blockedUsersRow","twoFactorRowOptions","email_unconfirmed_pattern","twoFactorRow","activeSessionsRow","updateActiveSessions","websitesRow","updateActiveWebsites","websites","setBlockedCount","updateBlocked","rowsByKeys","numberVisibilityRow","lastSeenTimeRow","photoVisibilityRow","callRow","linkAccountRow","groupChatsAddRow","voicesRow","updatePrivacyRow","disallowLength","allowLength","destroyed","setGlobalPrivacySettings","archive_and_mute_new_noncontact_peers","settings","onPremiumToggle","autoarchive_setting_available","_enabled","sensitive_enabled","sensitive_can_change","payment","clearSavedInfo","deleteButton","clearAllDrafts","auths","AppPowerSavingTab","infoSection","checkboxFields","wrap","mainKey","flatten","field","created","onAllChange","wasAll","appStateManager","setByKey","RangeSettingSelector","initialValue","minValue","writeValue","valueDiv","valueContainer","AppGeneralSettingsTab","themes","chatBackgroundButton","initArgs","getLiteModeStatus","animationsCheckboxField","animationsRow","liteModeRow","themesContainer","themesMap","currentTheme","themeController","isNight","applyThemeOnItem","theme","wallPaperContainer","wallPaperContainers","lastOnFrameNo","lastActive","onFrameNo","availableBaseThemes","defaultThemes","default","themeSettings","base_theme","wallPaper","wallpaper","emoticonContainer","bubbleIn","dayRow","nightRow","systemRow","newIsNight","enterRow","ctrlEnterRow","kilometersRow","milesRow","formats","format","runFirst","getNextTimeout","_callback","run","eachTimeout","getSeconds","eachMinute","toLocaleTimeString","AppChatFoldersTab","filtersRendered","animationData","renderFolder","dialogFilter","non_contacts","broadcasts","bots","folder","getFolderDialogs","channels","filtersStorage","getFilter","setInitFilter","localId","getInitArgs","createFolderBtn","foldersSection","suggestedSection","canCreateFolder","onFiltersContainerUpdate","renderFiltersPromise","toggleAllChats","getSuggestedFilters","loadAnimationPromise","onSort","prevIdx","newIdx","updateDialogFiltersOrder","getDialogFilters","getSuggestedDialogsFilters","suggestedFilters","includePeerIds","excludePeerIds","pinnedPeerIds","createDialogFilter","AppNotificationsTab","NotifySection","enabledRow","typeText","previewEnabledRow","inputNotifyPeer","getNotifySettings","notifySettings","applySettings","isMuted","show_previews","mute","showPreviews","inputSettings","mute_until","flags","updateNotifySettings","notify_settings","contactsSignUpRow","soundRow","sound","getContactSignUpNotification","setContactSignUpNotification","AppLanguageTab","languages1","lang_pack","languages2","rendered","webLangCodes","language","lang_code","native_name","autoDownloadPeerTypeSection","contactsCheckboxField","privateCheckboxField","groupsCheckboxField","channelsCheckboxField","AppAutoDownloadPhotoTab","AppAutoDownloadFileTab","debouncedSave","sizeMax","MIN","MAX_RANGE","upTo","formatBytes","AppAutoDownloadVideoTab","AUTO_DOWNLOAD_FOR_KEYS","private","AppDataAndStorageTab","autoCheckboxField","autoRow","resetButton","deepEqual","setSubtitles","setAutoDownloadSubtitle","photoRow","videoRow","fileRow","openTab","tabConstructor","autoDownloadNew","onDisabledChange","peerKeys","enabledKeys","isAll","AppQuickReactionTab","getQuickReaction","quickReaction","setDefaultReaction","AppStickersAndEmojiTab","allStickers","suggestStickersRow","none","setStickersSuggestDescription","setStickersSuggest","listenForClick","reactionsRow","renderQuickReaction","getCustomEmojiDocument","loopStickersRow","suggestEmojiRow","bigEmojiRow","dynamicPackOrderRow","stickerSets","stickersContent","reorderStickerSets","logOut","edit","profile","changeAvatarBtn","upload","uploadProfilePhoto","updateChangeAvatarBtn","languageArgs","devicesRow","languageRow","buttonsSection","getEditProfileArgs","editProfileArgs","getAuthorizations","overwrite","getAuthorizationsPromise","AppNewChannelTab","channelNameInputField","channelDescriptionInputField","onLengthChange","channelId","PopupCreateContact","importContact","lastNameInputField","editPeer","AppContactsTab","openContacts","isContact","sortedUserList","createList","renderPage","AppArchivedTab","wasFilterId","ul","AppPeopleNearbyTab","isLocationWatched","parseDistance","startWatching","latestLocationSaved","getLocated","accuracy","watchPosition","isLongitudeDifferent","isLatitudeDifferent","distanceCheck","calculateDistance","stopWatching","lat1","long1","lat2","long2","asin","LEFT_COLUMN_ACTIVE_CLASSNAME","AppSidebarLeft","sidebarEl","sidebarHeader","onContactsClick","backBtn","btnArchive","isDialogsLoaded","themeCheckboxField","sessionStorage","kz_version","installPrompt","toolsBtn","btnMenuFooter","rel","archivedCount","newBtnMenu","updateBtn","reload","initSearch","unreadPeerIds","checkUpdateInterval","cache","ok","hasUpdate","onResize","documentElement","searchContainer","pickedElements","selectedPeerId","selectedMinDate","selectedMaxDate","updatePicked","removeProperty","unselectEntity","renderEntity","dates","dateData","pushRecentSearch","peopleContainer","hideNewBtnMenuTimeout","transition","activeClassName","clearRecentSearchBtn","clearRecentSearch","appSidebarLeft","AppAddMembersTab","attachToPromise","isPrivacy","removeLoader","averageColorFromCanvas","pixel","getImageData","pixelsLength","outPixel","Uint8ClampedArray","highlightningColor","rgba","ColorPicker","hue","saturation","lightness","onGrabStart","boxDragger","onGrabEnd","sliders","hueDragger","hexInputField","rgbInputField","setColor","rgbRegExp","attachBoxListeners","attachHueListeners","attachGrabListeners","boxRect","saturationHandler","hueRect","hueHandler","updateHexInput","updateRgbInput","rgb","boxX","percentY","boxY","percentHue","hueX","updatePicker","getCurrentColor","rgbaArray","hexa","hsl","hsla","posX","posY","lightnessX","lightnessY","AppBackgroundColorTab","_applyColor","updateColorPicker","colorPicker","background_color","pushToState","onColorChange","applyColor","gridSection","grid","throttle","isColored","AppBackgroundTab","clicked","wallPapersByElement","elementsByKey","onUploadClick","requestFile","endsWith","createObjectURL","File","prepareWallPaperUpload","uploadPromise","uploadWallPaper","uploadDeferred","getWallPaperKey","setBackgroundDocument","addWallPaper","onResetClick","defaultTheme","blurCheckboxField","onGridClick","getWallPaperKeyFromTheme","backgrounds","uploadButton","colorButton","wallPapers","gridContainer","hasFile","isDark","dark","intensity","webkitMaskImage","_tempId","saveToCache","slug","hadSettings","getPixelPromise","imageUrl","imageSource","averageColorFromImageSource","averageColor","AppIncludedChatsTab","getContacts","foundInFilters","dialogsByFilters","onSelectChange","confirmBtn","editFolderTab","originalFilter","cmp","pinned_peers","other","otherLegacy","getInputPeerById","setFilter","onAppConfig","dialog_filters_chats_limit_premium","dialog_filters_chats_limit_default","categoriesSection","exclude_muted","ico","exclude_archived","exclude_read","selectedPeers","addedInitial","_add","AppEditFolderTab","deleteFolderButton","updateDialogFilter","menuBtn","inputSection","generateList","h2Text","includedFlagsContainer","excludedFlagsContainer","include","include_peers","editCheckForChange","reloadMissingPromises","reloadMissingPeerIds","onEditOpen","onCreateOpen","ignoreClick","hasPeer","renderMore","exclude_peers","purchaseUsernameCaption","purchaseText","setUsername","AppEditProfileTab","bioMaxLength","firstNameInputField","bioInputField","usernameInputField","isPurchase","availableText","takenText","invalidText","profilePromise","updateProfile","updateUsername","RIGHT_COLUMN_ACTIVE_CLASSNAME","AppSidebarRight","canHideFirst","isColumnProportionSet","toggleSidebar","setColumnProportion","createSharedMediaTab","replaceSharedMediaTab","previousTab","sharedMediaTab","historyTabIds","_selectTab","getFrom","setFrom","onCloseTab","isNavigation","willChange","appSidebarRight","AppEditContactTab","privacy","notificationsCheckboxField","profileNameDiv","profileSubtitleDiv","phoneRow","privacyRule","sharePhoneCheckboxField","btnDelete","deleteContacts","addContact","AppEditTopicTab","colorIndex","isGeneral","originalTopic","iconDiv","icon_emoji_id","setIcon","editForumTopic","topicId","iconEmojiId","createForumTopic","iconColor","emojiElement","icon_color","isMainIcon","newTopic","oldTopic","oldEl","applyFadeAnimation","fadeIn","iterations","easing","AppChatTypeTab","privateRow","publicRow","privateSection","publicContainer","chatUpdateListeners","basic","linkRow","btnRevoke","getChatInviteLink","publicSection","linkInputField","applyBtn","getValue","head","usernamesSection","getPeerEditableUsername","wasUsername","migrateChat","makeChannelPrivate","toggleNoForwards","onChatUpdate","noforwards","addChatUpdateListener","AppUserPermissionsTab","destroyListener","ChatPermissions","banned_rights","editBanned","btnDeleteException","clearChannelParticipantBannedRights","kickFromChannel","kickFromChat","defaultBannedRights","default_banned_rights","defaultRights","combineParticipantBannedRights","mediaNested","exceptionText","mediaToggleWith","mainFlag","embed_links","until_date","IGNORE_FLAGS","AppGroupPermissionsTab","chatPermissions","editChatDefaultBannedRights","addExceptionRow","openPermissions","getParticipant","setSubtitle","bannedRights","cantWhat","dialogDom","needAdd","new_participant","view_messages","prev_participant","exceptionsCount","setLength","setLoader","migrateFrom","migrateTo","AppChatReactionsTab","getActiveAvailableReactions","_chatReactions","available_reactions","chatReactions","makeReactionFromEmoticons","getCaptionLangPackKey","toggleSection","reactionsSection","toggleCheckboxFieldsByEmoticons","checkboxFieldsByEmoticon","toggleCheckboxField","toggleRow","saveReactionsDebounced","allow_custom","saveReactions","setChatAvailableReactions","isDebounced","AppEditChatTab","_init","canChangeType","canChangePermissions","canManageTopics","getCachedFullChat","chatNameInputField","descriptionInputField","chatTypeRow","setChatTypeSubtitle","availableReactionsLength","setReactionsLength","chatAvailableReactions","permissionsRow","setPermissionsLength","forum_upgrade_participants_min","topicsRow","setTopics","toggleForum","editTitle","editAbout","signMessagesCheckboxField","signatures","toggleSignatures","showChatHistoryCheckboxField","togglePreHistoryHidden","hidden_prehistory","historiesStorage","AppSharedMediaTab","newCloseBtn","animatedCloseIcon","transitionContainer","transitionFirstItem","titleI18n","editBtn","transitionLastItem","secondTitle","setIsSharedMedia","isSharedMedia","isHeavy","onCloseBtnClick","toggleEditBtn","deleteDeletedMessages","btnAddMembers","showConfirmation","addChatUser","_deleteDeletedMessages","setLoadMutex","peerChanged","changeTitleKey","loadSidebarMedia","destroyable","SetTransition","raf","afterTimeout","SidebarSlider","closeTab","closingId","onOpenTab","preserveTab","getTab","isTabExists","deleteTab","doNotAppend","SliderSuperTab","_constructor","SliderSuperTabEventable","dispatchResultableEvent","SortedUserList","getIndex","getUserStatusForSort","onDelete","onListLengthChange","willChangeLength","onElementCreate","base","updateElementWith","updateListWith","createChatListOptions","doTimeout","updateList","SORT_INTERVAL","AVATAR_CLASS_NAME","AVATAR_CONTAINER_CLASS_NAME","StackedAvatars","hasViewer","attachStickerViewerListeners","originalFindTarget","checkForParent","_middleware","previousTransformer","doThatSticker","lockGroups","isSwitching","effectThumb","mediaRect","fitted","aspectFitted","transformer","transformX","transformY","relativeEffect","loopEffect","firstFramePromise","prevPlayer","onMousePreMove","newMediaContainer","_previousTransformer","StickyIntersector","observeHeaders","observeElements","headersObserver","targetInfo","boundingClientRect","stickyTarget","rootBoundsInfo","rootBounds","threshold","elementsObserver","addSentinel","sentinel","headerSentinel","getEvent","getDistance","hypot","getTouchCenter","attachGlobalListenerTo","RESET_GLOBAL","TOUCH_MOVE_OPTIONS","MOUSE_MOVE_OPTIONS","WHEEL_OPTIONS","SwipeHandler","handleMove","setCursorTo","hadMove","releaseWheelDrag","releaseWheelZoom","resetValues","handleStart","isMouseDown","initialDistance","initialTouchCenter","verifyResult","withDelay","xDown","yDown","eventUp","onStart","xUp","yUp","xAdded","yAdded","setHadMove","endDistance","touchCenter","dispatchOnSwipe","handleWheel","is","onWheelCapture","onWheelZoom","handleWheelDrag","isDragCanceled","sign","initialDragOffset","dx","dy","wheelZoom","setCursor","onSwipeResult","TelInputField","pasted","lastValue","telEl","pixelRatio","letterSpacing","originalFunc","formattedPhoneNumber","leftPattern","TelegramWebView","onTelegramWebViewEvent","eventType","eventData","contentWindow","toastEl","hideToast","toastNew","transitions","navigation","prevTabContent","animateFirst","withAnimationListener","animationFunction","_animateFirst","onTransitionEndCallbacks","animationDeferred","listenerName","onEndEvent","overrideFrom","onTransitionEndCallback","transitionTimeout","_from","isUsernameValid","UsernameInputField","checkUsernameDebounced","checkUsername","checkUsernamePromise","checkPromise","available","UsernamesSection","_usernames","sortedList","editable","changeActive","applyUsernames","getAll","_peerId","cancelClick","newActive","toggleUsername","reorderUsernames","VisibilityIntersector","locked","change","refreshVisible","VolumeSelector","onMuteClick","setVolume","iconIndex","ICONS","wrapCustomEmoji","repeat","wrapCustomEmojiAwaited","wrapDocument","noAutoDownload","uploadFileName","extSplitted","ext","icoDiv","icoTextEl","hadContext","hasThumb","fileName","bytesContainer","descriptionParts","bytesMaxEl","sizeDiv","_downloadDiv","addByteProgress","sizeContainer","_bytesContainer","_d","canOpenAfter","downloadFileName","downloadId","isDownloading","support","was_online","dateEl","toggleMediaSpoiler","onMediaSpoilerClick","wrapMediaSpoilerWithImage","wrapMessageActionTextNew","plain","hadColors","wrapJoinVoiceChatAnchor","wrapLinkToMessage","dir","wrapSomeText","htmlToSpan","wrapTopicIcon","ns","contentSpan","gradientId","strokeColor","clone","topicAvatar","wrapMessageActionTopicIcon","wrapMessageActionTopicIconAndName","wrapMessageActionTextNewUnsafe","unsafeMessage","getNameDivHTML","post","schedule_date","daysToStart","tomorrowDate","_args","fetchMessageReplyTo","anchorHTML","isRecurringInit","recurring_init","isRecurringUsed","recurring_used","invoiceMessage","titleElement","authorElement","isMe","isIconChanged","isIconRemoved","isTitleChanged","isHiddenChanged","waited","wrapMessageForReply","hasAlbumKey","addPart","albumText","game","actionWrapped","restriction_reason","exec","messageWrapped","noTextFormat","wrapPeerTitle","wrapPhoto","noThumb","blurAfter","isImageFromDocument","isWebDoc","isFit","renderOnLoad","canAttachPreloader","haveToDownload","onlyCache","getDownloadPromise","wrapReply","setColorPeerId","wrapSenderToPeer","senderTitle","fromMe","wrapSentTime","STICKER_EFFECT_MULTIPLIER","locksUrls","videosCache","_timeout","wrapSticker","loadStickerMiddleware","exportLoad","asStatic","fullThumb","isCustomEmoji","syncedVideo","isEffect","stickerType","isAnimated","willHaveLock","lockUrl","toneIndex","isThumbNeededForType","lottieCachedThumb","getLottieCachedThumb","haveThumbCached","afterRender","getPathFromBytes","getPreviewURLFromThumb","stickerThumbConverted","webpWorkerController","saveWebPConvertedStrippedThumb","getImageFromStrippedThumb","middlewareError","sync","setLockColor","skipx","skipy","imageData","sr","sg","sb","sa","outCanvas","outContext","computeLockColor","onFirstFrame","saveLottiePreview","preloadAnimatedEmojiStickerAnimation","isSingleVideo","cacheName","framesCache","cachePromise","previousTime","playedTimes","onTimeupdate","mediaLength","lastPromise","_media","preloadSticker","playing","isAvailable","animationDiv","attachStickerEffectHandler","onEmojiStickerClick","getAnimatedEmojiSoundDocument","activeAnimations","emojiData","sendInteractionThrottled","interaction","withRandomOffset","onUnmount","wrapStickerAnimation","unmountAnimation","vibrate","generateRandomSigned","randomOffsetX","randomOffsetY","setPosition","factor","stableOffsetX","stableOffsetY","rectX","rectY","addOffsetX","addOffsetY","wrapStickerEmoji","wrapStickerSetThumb","downloadOptions","getStickerSetThumbDownloadOptions","getDocPromise","thumb_document_id","wrapStickerToRow","previousMedia","_size","wrapTopicNameButton","roundVideoCircumference","wrapVideo","isAlbumItem","canAutoplay","spanTime","spanPlay","needPlayButton","photoRes","divRound","halfSize","globalVideo","onPaused","onFrame","renderDeferred","loadPhotoThumbFunc","wrapWebPageDescription","shortDescriptionText","wrapWebPageTitle","shortTitle","EmojiVersions","Emoji","version","FontFamily","FontSize","FontWeight","instances","getAnimationInstance","cancelAnimationByKey","instance","isCancelled","animateSingle","tick","createAnimationInstance","AudioAssetPlayer","assets","playSound","assetName","createAudio","playSoundIfDifferent","stopSound","cancelDelayedPlay","playSoundWithTimeout","heavyQueue","processingQueue","addHeavyTask","processHeavyQueue","todo","possiblePromise","realResult","timedChunk","requireBlurPromise","fastBlurFunc","processBlurNext","dataUri","JPEG_HEADER","bytesFromHex","JPEG_TAIL","getPreviewBytesFromURL","needle","jpegBytes","atob","isSticker","convertToUint8Array","btoa","bytesToDataURL","imageW","imageH","boxW","boxH","noZoom","boxedImageW","boxedImageH","drawCircle","beginPath","closePath","drawCircleFromStart","measureText","createImageBitmap","resizeWidth","resizeHeight","badCharsRe","trimRe","C2L","clearBadCharsAndTrim","latinize","processSearchText","clearBadChars","hasTag","includeTag","charAt","originalText","ch","latinizeCh","latinizeString","fixCyrillic","fallbackCopyTextToClipboard","textArea","removeChild","copyTextToClipboard","clipboard","writeText","ContextMenuController","diffX","diffY","isOpened","openBtnMenu","months","days","ONE_DAY","getWeekNumber","UTC","dayNum","getUTCDay","setUTCDate","getUTCDate","yearStart","getUTCFullYear","formatDateAccordingToTodayNew","formatFullSentTimeRaw","formatTime","capitalize","textTransform","formatFullSentTime","getFullDate","monthAsNumber","noSeconds","leadingZero","noTime","minYear","yearPattern","monthYearOrDayPattern","yearOrDayAndMonthPattern","shortDate","longDate","numberOfDaysEachMonth","fillTipDates","dayOfWeek","formatWeekLong","getDayOfWeek","g1","g2","createForDayMonth","createForMonthYear","selectedYear","currentYear","g3","validDateForMonth","formatterYearMax","k1","formatterMonthYear","formatterDayMonth","T_ME","copyWhat","copyText","_cancelContextMenuOpening","_cancelContextMenuOpeningTimeout","cancelContextMenuOpening","onCancel","onMove","isTouch","onTouchEnd","touch","changedTouches","lastMouseDownElement","hasMouseMovedSinceDown","CLICK_EVENT_NAME","simulateClickEvent","ControlsHover","setHideTimeout","hideControlsTimeout","isShown","controlsLocked","toggleControls","relatedTarget","onBeforeOpen","disablePictureInPicture","resetCache","computedStyle","getProperty","getPropertyAsSize","simulateEvent","Event","tag","requestFullScreen","requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","msRequestFullscreen","cancelFullScreen","mozCancelFullScreen","webkitCancelFullScreen","msExitFullscreen","addFullScreenListener","addListener","eventName","getFullScreenElement","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","msFullscreenElement","isFullScreen","getCaretPosF","childNodesLength","alt","markdownTags","entityName","underline","italic","monospace","strikethrough","mentionName","BLOCK_TAGS","BOM_REG_EXP","SELECTION_SEPARATOR","checkNodeForEntity","follow","isLineEmpty","getRichElementValue","selNode","selOffset","pushLine","isBlock","isTableCell","wasEntitiesLength","wasNodeEmpty","withEntities","withCaret","DocumentFragment","startOffset","startContainer","possibleChildrenFocusOffset","getCaretPos","overflowRect","foundVisible","lookForSticky","overflowTop","overflowRight","overflowBottom","overflowLeft","sticky","windowWidth","windowHeight","cancelY","onlyFull","commonAncestor","commonAncestorContainer","treeWalker","createTreeWalker","NodeFilter","SHOW_ELEMENT","SHOW_TEXT","acceptNode","intersectsNode","FILTER_ACCEPT","FILTER_REJECT","nextNode","resultBoolean","template","selectionRange","START_TO_END","isComposing","secondaryKey","isSwipingBackSafari","TouchEvent","ignoreTouchCheck","prevPos","backgroundImage","useCache","isImage","renderImageFromUrlPromise","compareNodes","node1","node1Offset","node2","node2Offset","NOT_ONLY_BOMS_REG_EXP","USING_BOMS","RichInputHandler","saveSelectionOnChange","saveRangeForElement","lastNode","lastOffset","setSelectionClassName","caret","getCaretPosN","move","superMove","getFiller","addInputCallback","processEmptiedFillers","fixInsertedLineBreaks","moveFirst","setEnd","isBOM","deleteData","processFilledFillers","removeEmptyTextNodes","fixBuggedCaret","savedRanges","IS_FIREFOX","inputCaptureCallbacks","anchorNode","findPreviousSmthIndex","something","fromSelectionChange","smthIndex","moved","idxidx","rangeString","onlyBOMs","restoreSavedRange","newCallback","sibling","needed","textNode","removePossibleBOMSiblings","removePossibleBOMSiblingsByNode","cleanSiblings","insertData","bomNode","focusNode","focusNodeBefore","focusOffset","focusOffsetBefore","collapseToStart","collapseToEnd","focusNodeAfter","focusOffsetAfter","fillers","smths","INSTANCE","keyframes","Sortable","elementRect","lastSiblings","getSortableTarget","scrollableRect","toEnd","addScrollPos","scrollPos","startScrollPos","isVertical","countNonElements","DropdownHover","onClickOut","ignoreButtons","ignoreMouseOut","toElement","willBeActive","inited","timeouts","setIgnoreMouseOut","onmouseout","onmouseover","FocusDirection","maxDistance","Static","scrollWithJs","rectStartKey","rectEndKey","sizeKey","scrollSizeKey","elementScrollSizeKey","scrollPositionKey","possibleElementPosition","containerSize","scrollSize","remainingPath","absPath","startAt","shortTransition","longTransition","currentPath","FILENAME_JOINER","getFileNameByLocation","thumb_size","big","stickerset","thumb_version","volume_id","local_id","strictDecimals","_decimals","dm","fixed","pow","parseFloat","CALL_DURATION_LANG_KEYS","mm","showLast","formatDuration","strings","prefixes","maxPrefixLength","setPrefix","originalStr","prefixCountry","patterns","searchForPattern","mostMatchedPatternMatches","mostMatchedPattern","_pattern","patternMatches","FramesCache","framesNew","framesURLs","getCache","createCache","releaseCache","getCacheCounter","generateName","arcParameter","rx","ry","xAxisRotation","largeArcFlag","sweepFlag","tl","tr","bl","useBlur","ignoreCache","ListLoader","loadedAllDown","unsetCurrent","toPrevious","goUnsafe","down","loadPromiseDown","loadPromiseUp","processedArr","processed","ListenerSetter","listeners","addManual","onceCallback","onceFired","_listener","isEnabled","MediaSize","aspect","aspectCovered","makeMediaSize","ScreenSize","CUSTOM_EMOJI_SIZE","ESG_CUSTOM_EMOJI_SIZE","EMOJI_STATUS_SIZE","MediaSizes","screenSizes","mobile","medium","large","handhelds","regular","album","esgSticker","documentName","extendedInvoice","customEmoji","esgCustomEmoji","popupSticker","desktop","isMobile","handleResize","innerWidth","activeScreen","wasScreen","throwWhat","numberThousandSplitter","HAVE_METADATA","useCanplayOnIos","loadEventName","errorEventName","OverlayClickHandler","withOverlay","useNative","isNegative","amountExp","exp","dec_point","thousands_sep","isFinite","prec","sep","dec","toFixedFix","number_format","decimal_sep","native","splitter","additionalPadding","getScrollWidthFromElement","menuWidth","menuHeight","paddingBottom","maxTop","maxLeft","minLeft","intermediateX","intermediateY","possibleSides","platforms","getRestrictionReason","reasons","savingLottiePreview","isSavingLottiePreview","saving","throttleWithRaf","fn","schedulerFn","waiting","throttleWith","ScrollSaver","findElements","findAndSetElements","_save","scrollHeightMinusTop","onRestore","useReflow","setScrollTop","newScrollTop","_restore","previousScrollHeightMinusTop","ScrollableLoader","SearchListLoader","filterMids","onHistoryDelete","shouldBeDeleted","onHistoryMultiappend","isInner","otherSideLoader","filterMessagesByInputFilterFromStorage","goToOtherEnd","do","kind","scheduleFlush","measure","mutate","mutateElement","read","write","pushDocumentSize","_isWebDocument","comments","BatchProcessor","setQueue","renderedQueue","SortedList","_updateList","canUpdate","createPromise","noScheduler","encodeEntities","limitFrom","leadZero","sec_num","hours","minutes","seconds","textToSvgURL","reader","FileReader","readAsDataURL","visualViewport","innerHeight","ANIMATION_START_EVENT","ANIMATION_END_EVENT","isAnimating","heavyAnimationPromise","promisesInQueue","dispatchHeavyAnimationEvent","_heavyAnimationPromise","onHeavyAnimationEnd","interruptHeavyAnimation","getHeavyAnimationPromise","handleAnimationStart","handleAnimationEnd","DialogsContextMenu","onArchiveClick","editPeerFolders","folder_id","onHideTopicClick","onToggleTopicClick","toggleDialogPin","onUnmuteClick","onUnreadClick","top_message","getButtons","getDeleteButtonText","lastButton","isDialogUnread","ConnectionStatusComponent","hadConnect","connecting","timedOut","updating","setConnectionStatus","overrideStatus","baseDcId","connectionStatus","setFirstConnectionTimeout","online","forceGetDifference","retryAt","setStatusText","currentLangPackKey","statusEl","statusPreloader","singleInstance","CHANGE_STATE_DELAY","getA","networkerFactory","forceReconnect","timerSpan","interval","forceReconnectTimeout","setStateTimeout","statusContainer","SENDING_STATUS","easeInOutSine","easeInOutSineApply","roundRect","defaultRadius","moveTo","lineTo","quadraticCurveTo","DPR","SIZE","MARGIN","WIDTH","RADIUS","Shimmer","currTime","diffTime","spread","pausedTime","pauseInterval","lightSource","lightSpread","currentAnimationIndex","keepTime","cycleAnimation","currentAnimation","animateGlow","animateSlide","smartInc","lightLeft","lightRight","lightCenter","createLinearGradient","shimmerColor","addColorStop","dict","on","fillText","DialogsPlaceholder","onThemeChange","stopAnimation","startAnimation","updateCanvasSize","shimmer","generatedValues","marginVertical","lineBorderRadius","lineMarginVertical","statusWidth","getRectFrom","onRemove","blockScrollable","overflowY","availableLength","detachTime","renderDetachAnimationFrame","globalCompositeOperation","completed","elapsedRowTime","dialogHeight","renderFrame","createPattern","patternCanvas","patternContext","drawChat","firstLineWidth","secondLineWidth","marginLeft","setPromiseMiddleware","oldPromise","SortedDialogList","getDialogIndex","forumPeerId","indexKey","addListDialog","isBatch","isMainList","DialogElement","bigger","abitbigger","small","captionDiv","titleSpanContainer","peerTitlePromise","statusSpan","lastTimeSpan","rightSpan","setDialogActive","forumTab","createUnreadBadge","unreadBadge","badge","createUnreadAvatarBadge","unreadAvatarBadge","createMentionsBadge","mentionsBadge","toggleBadgeByKey","hasBadge","justCreated","ForumTab","init2","isFloating","toggleForumTab","createChatList","setListClickListener","xd","Some3","bindScrollable","getOptionsForMessages","fullReset","setStatusPromise","noTyping","onChatsScroll","loadResult","setStatus","NOT_IMPLEMENTED_ERROR","Some","onChatsRegularScroll","sliceTimeout","processContact","scrollTopWas","rectContainer","rectTarget","firstY","lastY","firstElement","elementFromPoint","lastElement","elementOverflow","sliceFromStart","sliceFromEnd","deleteDialogByKey","getDialogKeyFromElement","setOffsets","offsets","getOffsetIndex","isDialogMustBeInViewport","topOffset","bottomOffset","setIndexKey","deleteDialog","getDialogKey","updateDialog","loadedDialogsAtLeastOnce","getDialogElement","setLastMessageN","setUnread","onChatsScrollTop","loadDialogs","createPlaceholder","placeholderOptions","getRectFromForPlaceholder","loadDialogsPromise","loadDialogsRenderPromise","cachedInfoPromise","chatList","getConversationsResult","loadDialogsInner","needPlaceholderAtFirstTime","isTopEnd","offsetDialog","firstDialog","lastDialog","getDialogFromElement","getDialogDom","oldTypingElement","newTypingElement","unsetTyping","paddingX","typings","topics","setUnreadMessagesN","drop","sidebarRect","currentOffsetIndex","needIndex","Some2","getUserStatus","setOnlineStatus","processDialogForCallStatus","validateDialogForFilter","getCachedDialogs","validateListForFilter","doNotRenderChatList","hasClassName","generateScrollable","getDialogIndexKey","sortedDialogList","testDialogForFilter","migratedTo","setCallStatus","callIcon","START_X","wasMounted","itemProgress","groupCallActiveIcon","call_active","call_not_empty","loadContacts","toggleAvatarUnreadBadges","sortedDialog","reuseClassNames","unreadContent","isUnreadAvatarBadgeMounted","unreadAvatarBadgeClassList","unreadBadgeClassList","AppDialogsManager","Log","menuScrollContainer","lastActiveElements","initedListeners","xds","onTabChange","_onListLengthChange","checkIfPlaceholderNeeded","hasContacts","removeContactsPlaceholder","updateContactsLength","verifyPeerIdForContacts","getProxiedManagers","stateMiddlewareHelper","bottomPart","forumsTabs","forumsSlider","allChatsIntlElement","isFilterIdAvailable","clearCurrent","showFiltersPromise","onStateLoaded","setFilterId","addFilter","foldersScrollable","_id","filtersNavigationItem","setFilterIdAndChangeTab","changeFiltersAllChatsKey","groupCallsController","callsController","initListeners","setFiltersUnreadCount","setFilterUnreadCount","elementThreadId","elementPeerId","onFiltersLengthChange","containerToAppend","getDialogIndexKeyByFilterId","renderedFilter","filtersArr","haveFilters","addFilters","addFiltersPromise","getNotifyPeerTypeSettings","fillConversations","unreadSpan","unreadUnmutedCount","unreadCount","getFolderUnreadCount","wasShowing","generateEmptyPlaceholder","classNameType","subtitleArgs","placeholderContainer","emptyDialogsPlaceholderSubtitle","usersLength","placeholderType","updatePartClassName","updateContactsLengthPromise","newTab","hideTab","forumNavigationItem","toggleForumTabByPeerId","lastTab","isSameTab","withContext","openInner","lastActiveListElement","setPeerFunc","setLastMessage","draftMessage","isSearch","isMessageRestricted","willPrepend","videoTypes","playIcon","replyTo","forum_topic","setUnreadMessages","isDialogPinned","getForumUnreadCount","hasUnmuted","isPinned","forumUnreadCount","wasMuted","unreadTopicsCount","hasUnmutedTopic","setStatusMessage","read_inbox_max_id","hasUnreadBadge","hasUnreadAvatarBadge","disableAnimationIfRippleFound","iconClassName","setSendingStatus","isUnreadBadgeMounted","hasMentionsBadge","isMentionsBadgeMounted","isBadgeMounted","unreadBadgeText","isMention","notVisited","getDialog","originalDialog","addDialogNew","addDialogAndSetLastMessage","getMessageSenderPeerIdOrName","downloads","getNewDeferred","cancelDownload","clearDownload","getNewDeferredForUpload","getUpload","getDownload","getUploadPromise","getDownloadFileNameFromOptions","downloadMedia","promiseBefore","getDownloadMediaDetails","downloadMediaURL","downloadMediaVoid","getFileNameForUpload","downloadToDisc","justAttach","pingPromise","hadProgress","getDocumentDownloadOptions","getPhotoDownloadOptions","clickEvent","createEvent","initMouseEvent","createDownloadAnchor","CLASSNAME_BASE","PinnedContainer","floating","divAndCaption","wrapperUtils","attachOnCloseEvent","needClose","setFloating","setUtilsWidth","ChatAudio","onPlaybackParams","fasterEl","repeatEl","toggleEl","onStop","onMediaPlay","isMusic","prevEl","nextEl","attachClick","volumeProgressLineContainer","tunnel","progressWrapper","playingDetails","BAR_HEIGHTS","PinnedMessageBorder","drawRect","getClipPath","barHeight","GAP","clipPath","getBarHeight","ONE","TWO","THREE","FOUR","MORE","getMarkHeight","markHeight","getMarkTranslateY","getTrackTranslateY","trackHeight","getTrackHeight","clipPathId","markTranslateY","trackTranslateY","mark","AnimatedSuper","getRow","clearRow","clearRows","currentIndex","DURATION","setNewRow","reflow","previousIndex","fromTop","ignorePrevious","previousRow","AnimatedCounter","previousNumber","getDecimal","animatedSuper","decimal","hideLeft","previousDecimalNumber","EMPTY_INDEX","setCount","previousByDecimal","decimalNumber","ChatPinnedMessage","pinnedMaxMid","pinnedMid","pinnedIndex","wasPinnedIndex","wasPinnedMediaIndex","waitForScrollBottom","loadedBottom","loadedTop","scrollDownListenerSetter","getCurrentIndexPromise","isStatic","dAC","pinnedMessageBorder","animatedSubtitle","animatedMedia","animatedCounter","btnOpen","openPinned","setPinnedMessage","_setPinnedMessage","unsetScrollDownListener","testMid","isNeededMore","getCurrentIndex","LOAD_OFFSET","correctAfter","gotRest","getPinnedMessage","backLimited","offset_id_offset","setScrollDownListener","isDown","handleScrollSideEvent","refreshPosition","handleFollowingPinnedMessage","followPinnedMessage","writeTo","writeMediaTo","ChatTopbar","verifyButtons","isMenuOpen","btnMore","buttonsToVerify","menuButtons","verifyVideoChatButton","currentGroupCall","groupCall","verifyCallButton","getCachedFullUser","phone_calls_available","video_calls_available","onJoinGroupCallClick","joinGroupCall","resize","setUtilsRAF","chatUtils","chatAudio","setPeerStatusManual","btnBack","btnBackBadge","chatInfoContainer","chatInfo","person","avatarElement","deleteButtonText","btnJoin","btnPinned","btnCall","btnGroupCall","btnMute","btnSearch","pushButtonToVerify","onBtnBackClick","isFirstChat","constructUtils","linked_chat_id","onCallClick","chatContextMenuHintWasShown","contactPeerId","getAttachMenuBot","has_settings","constructAvatar","joinChannel","unreadUnmutedPeerIds","setMutedState","isTopMessage","hiddenPinnedMessages","byCurrent","setTitleCallback","setStatusCallback","setTitleManual","canHaveSomeButtons","wasAlreadyUsed","newPinnedMessage","AppPrivateSearchTab","appSearch","btnPickDate","ChatSearch","selectedIndex","onResultsClick","selectResult","onFooterClick","onUpClick","onDownClick","foundCountEl","upBtn","downBtn","footer","dateBtn","renderedCount","ChatBackgroundPatternRenderer","canvases","INSTANCES","renderToCanvas","fillCanvas","crossOrigin","imageBitmap","objectUrl","imageWidth","imageHeight","patternHeight","mask","topY","endY","bottomY","setCanvasDimensions","originalHeight","Chat","backgroundEl","backgroundTempId","sharedMediaTabs","setBackground","patternRenderer","gradientCanvas","previousGradientRenderer","previousPatternRenderer","previousPatternCanvas","isDarkPattern","getInstance","_gradientRenderer","setOpacityTo","opacityMax","setBackgroundPromise","setType","freezeObservers","APP_TABS","CHAT","beforeDestroy","cleanupBackground","destroySharedMediaTab","searchTab","_isAnyGroup","setAutoDownloadMedia","getForumTopicOrReload","isSamePeer","bubblesSetPeerPromise","photoSizeMax","videoSizeMax","fileSizeMax","photo_size_max","video_size_max","file_size_max","getAutoDownloadSettingsByPeerId","callbacksPromise","ignoreThreadId","historyStorageTransferable","historySerialized","updateStickersetOrder","MarkupTooltip","waitingForMouseUp","mouseUpCounter","onMouseUpSingle","resetSelection","tools1","tools2","cancelClosening","linkBackButton","linkInput","applyLink","isLinkValid","setTooltipPosition","linkApplyButton","applyDiv","delimiter1","delimiter2","delimiter3","matchUrlProtocol","getActiveMarkupButton","currentMarkups","markup","activeButtons","isLinkToggle","bodyRect","selectionRect","inputRect","selectionTop","sizesRect","isFirstShow","setMouseUpEvent","handleSelection","ChatDragAndDrop","dropIcon","onDragOver","onDragLeave","onDrop","outlineWrapper","dropHeader","dropSubtitle","headerArgs","setPath","sizeX","sizeY","disableTransition","LineBlobDrawable","maxRadius","minRadius","N","radiusNext","speed","generateBlob","radDif","generateNextBlob","amplitude","speedScale","paint","pinnedTop","progressToPinned","r1","progressNext","x2","cx","y2","bezierCurveTo","WeavingState","stateId","createGradient","shader","getGradientFromType","x0","y0","dt","TopbarWeave","handleDevicePixelRatioChanged","setSize","forceUpdate","resizeHandler","resizeCanvas","invokeDraw","handleFocus","focused","handleBlur","lbd","lbd1","lbd2","currentState","previousState","progressToState","lastUpdateTime","animateToAmplitude","animateAmplitudeDiff","amplitude2","animateAmplitudeDiff2","top1","top2","paint1","setCurrentState","states","componentDidMount","matchMedia","setAmplitude","componentWillUnmount","setCanvasSize","RLottieIconItemPart","playPart","RLottieIconItem","createPart","initFrame","skipFirstFrameRendering","inverseColor","onLoadForColor","onLoadForPart","getPart","RLottieIcon","startFrame","endFrame","frameCount","SuperRLottieIcon","partState","colorState","getColor","partCallback","changedPartState","changedColorState","setPartState","setColorState","prevState","renderIfPaused","invoke","GroupCallMicrophoneIcon","GROUP_CALL_MICROPHONE_BUTTON_STATE","partName","HAND","MUTED","UNMUTED","GroupCallParticipantMutedIcon","colored","GROUP_CALL_PARTICIPANT_MUTED_STATE","colorStr","MUTED_FOR_ME","MUTED_BY_ADMIN","propertyValue","getColorByMutedState","generateEqualParts","clearMutedStateModifier","GroupCallParticipantStatusElement","element2","actionClassName","GroupCallParticipantsList","getParticipantByPeerId","onElementDestroy","getGroupCallParticipantMutedState","mutedIcon","callVideoCanvasBlur","GroupCallParticipantVideoElement","setPinned","setParticipant","groupCallParticipantMutedIcon","groupCallParticipantStatus","updateParticipant","GroupCallParticipantsVideoElement","participantsElements","groupCallId","setElementDisplay","pinnedSource","pinSource","unpinAll","setInstance","shouldDisplayElement","displayPinned","shouldDisplay","hasAnyVideo","participantElements","participantVideo","getVideoElementFromParticipantByType","_onLengthChange","GroupCallParticipantContextMenu","onOpenProfileClick","PopupGroupCall","targetPeerId","toggleParticipantMuted","editParticipant","canManageCall","can_self_unmute","muted_by_you","getContainer","GroupCallParticipantsElement","groupCallParticipantsVideo","appGroupCallsManager","getGroupCallParticipants","GroupCallDescriptionElement","descriptionIntl","GroupCallTitleElement","makeButton","_className","buttonDiv","isConfirm","resizeHandlerClassName","MovableElement","fixDimensions","fixPosition","addResizeHandlers","setSwipeHandler","destroyElements","handlers","startTop","startLeft","startWidth","startHeight","resizingSide","isEnlarging","resizeDiff","maxPossible","setPositionToCenter","MovablePanel","toggleMovable","movable","movableOptions","toggleClassName","raise_hand_rating","onFullScreenClick","onToggleControls","buttonsContainer","onVideoClick","btnVideo","toggleVideoSharing","onScreenClick","btnScreen","toggleScreenSharing","toggleMuted","changeRaiseHand","onLeaveClick","hangUp","discard","toggleBigLayout","btnFullScreen","btnExitFullScreen","wasFullScreen","movablePanel","videosCount","wasBig","btnInvite","btnShowColumn","toggleRightColumn","btnFullScreen2","headerInfo","newHeader","newHeaderInfo","newHeaderTitle","btnHideColumn","videosScrollable","groupCallTitle","groupCallDescription","groupCallBodyHeaderDescription","constructButtons","groupCallParticipants","updateInstance","setHasPinned","groupCallMicrophoneIcon","_makeButton","microphoneIcon","btnLeave","setDescription","microphoneButtonState","getGroupCallMicrophoneButtonState","micState","CallDescriptionElement","connectionState","connectedAt","GroupCallMicrophoneIconMini","INIT_STATE","PopupCall","resizeVideoContainers","videoContainers","interlocutorUserId","emojisSubtitle","partyStates","partyMutedState","stateText","constructFirstButtons","constructSecondButtons","wasTryingToJoin","movableElement","controlsHover","getCallInstance","firstButtonsRow","muteI18nElement","secondButtonsRow","declineI18nElement","btnDecline","btnAccept","acceptCall","createVideoContainer","isPendingIncoming","isSharingVideo","isSharingScreen","outputState","getMediaState","oldContainers","mediaState","getVideoElement","hasFrame","hasPromise","videoState","screencastState","videoContainer","output","getEmojisFingerprint","popupWidth","MAX_WIDTH_PX","MAX_HEIGHT_PX","MAX_SIZE","biggestSideSize","widthRatio","heightRatio","TopbarCall","onState","amplitudes","weave","clearCurrentInstance","currentDescription","instanceListenerSetter","isChangingInstance","callDescription","convertCallStateToGroupState","groupCallMicrophoneIconMini","throttledMuteClick","weaveContainer","uiNotificationsManager","notificationsShown","notificationIndex","notificationsCount","soundsPlayed","vibrateSupport","faviconElements","titleBackup","titleChanged","stopped","pushInited","updateLocalSettings","updSettings","nodesktop","novibrate","nopreview","nopush","needPush","webPushApiManager","registeredDevice","nosound","requestPermission","Notification","mozVibrate","webkitVibrate","setAppBadge","notificationsUiSupport","notifySoundEl","topMessagesDeferred","toggleToggler","peerString","soundReset","tokenData","unregisterDevice","registerDevice","notificationData","custom","hasChat","hasUser","buildNotification","fwdCount","peerReaction","peerTypeNotifySettings","notification","getPeerString","notificationMessage","wrappedMessage","noIncrement","peerTitleOptions","notificationFromPeerId","peerPhoto","loadAvatar","avatarCanvas","avatarContext","avatarGradients","colorTop","colorBottom","abbreviation","getAbbreviation","textBaseline","textAlign","pushData","loc_key","loc_args","resetTitle","isBlink","setFavicon","titleInterval","prevFavicon","testSound","permission","notificationOptions","registration","serviceWorker","showNotification","getNotifications","appRuntimeManager","onclose","getLocalSettings","closeNotification","nextSoundAt","prevSoundVolume","filename","token_type","tokenType","tokenValue","other_uids","app_sandbox","secret","getFilesFromEvent","onlyTypes","scanFiles","isDirectory","directoryReader","createReader","readEntries","itemFile","getAsFile","DataTransferItem","DragEvent","dataTransfer","webkitGetAsEntry","addAnchorListener","protocol","noCancelEvent","pathnameParams","uriParams","u","host","noPathnameParams","noUriParams","parseUriParams","PopupGiftPremium","giftOptions","shortestOption","wrapCurrency","giftOption","shortestAmount","discount","isYears","getSelectedOption","giftButton","bot_url","AppImManager","columnEl","offline","updateStatusInterval","cacheStorage","saveState","onHashChangeUnsafe","tgaddr","openUrl","postId","openUsername","userName","setSettings","messagesTextSize","forceRenderAfterSize","chatsSelectTabDebounced","changedLoop","changedAutoplay","toggleChatGradientAnimation","onDocumentPaste","attachType","newMediaPopup","_types","canDrag","backgroundPromises","CHATLIST","updateStatus","emojiAnimationContainer","appendEmojiAnimationContainer","createNewChat","chatsSelectTab","getPremium","compareVersion","deleteFilesIterative","applyCurrentTheme","resizeInstances","saveChatPosition","choosing","setChoosingStickerTyping","typing","onInstanceDeactivated","isUpdated","receiptMessage","onSpoilerClick","spoilerTimeout","mediaStickerWrapper","playOrRestart","stateStorage","topbarCall","discardCurrentCall","currentCall","setAuthorized","telegramMeWebManager","hashtag","makeLink","thread","channel","comment","getStackFromElement","attachKeydownListener","handleAutologinDomains","checkForShare","share","foundMedia","openWindow","onUrlAuthResult","urlAuthResult","botPeerTitle","logInCheckbox","allowMessagesCheckbox","request_write_access","confirmationPromise","logInChecked","allowMessagesChecked","acceptUrlAuth","onUrlAuthResultAccepted","requestUrlAuth","_appConfig","onAnchorClick","url_auth_domains","autologin_token","autologin_domains","originalUrl","searchParams","possibleBubble","timeoutOperation","requests","request","isBad","activatingChat","screen","IGNORE_KEYS","isSelectionCollapsed","isTargetAnInput","getFirstMessageToEdit","getNextDialog","newEvent","KeyboardEvent","commentId","resolveChannel","op","checkChatInvite","saveApiChat","resolvePhone","getInputInvoiceBySlug","wrappedUrl","openComment","openPremiumBot","premium_bot_username","generateThreadServiceStartMessage","phone_calls_private","ignoreGroupCall","ignoreCall","discardGroupCallConfirmation","discardCallConfirmation","title1","title2","isClosing","getGroupCallFull","createGroupCall","setCurrentBackground","broadcastEvent","getBackground","getFile","lastBackgroundUrl","chatBubbles","chatPositions","backgroundUrl","attachDragAndDropListeners","drops","mediaDrops","isFiles","_dropsContainer","mediaDropsContainer","dropsContainer","_drops","foundDocuments","PROFILE","onImTabChange","updateMyOnlineStatus","spliceChats","fromIndex","chatFrom","chatTo","chatIndex","existingIndex","oldChat","getTypingElement","eye","getPeerTyping","getPeerTypings","langPackKeys","multi","mapa","typingElement","descriptionElement","getChatStatus","typingEl","onlines","getOnlines","getPeerStatus","typingContainer","options1","options2","premium_gifts","INTERNAL_LINK_TYPE","onlyInner","DialogColorsFg","DialogColors","DialogColorsMap","pic","peerParams","useBytes","bestPhotoSize","CallConnectionInstanceBase","connection","sources","createPeerConnection","config","RTCPeerConnection","signalingState","iceConnectionState","createDataChannel","dataChannel","createDescription","appendStreamToConference","streamManager","appendToConference","closeConnection","closeConnectionAndStream","stopStream","negotiate","negotiating","negotiateInternal","sendDataChannelData","parseSignalingData","sdp","parseMediaSectionInfo","fingerprint","ufrag","pwd","convertNumber","isSending","codec","ssrc","sourceGroups","ssrcGroups","sourceGroup","semantics","ssrcs","rtpExtensions","payloadTypesMap","getPayloadType","payloadType","clockrate","feedbackTypes","subtype","parameters","payloadTypes","CallConnectionInstance","localDescription","remoteDescription","descriptionInit","offerReceived","createAnswer","setLocalDescription","offer","createOffer","offerSent","initialSetup","sendCallSignalingData","crypto","subtle","P2PEncryptor","p2pKey","seqMap","concatSHA256","bufferConcats","encryptPrepared","msgKeyLarge","subarray","msgKey","aesKeyIv","prepareAesKeyIv","aesProcessCtr","encryptRawPacket","seq","ArrayBuffer","setUint32","sha256a","sha256b","iv","encryptedData","dataSize","encrypt","cryptoKey","constTimeIsDifferent","msgKeyEquals","decryptRawPacket","encryptedDataSize","decryptionBuffer","getUint32","ChromeP2PSdpBuilder","fingerprints","stringBuilder","streamName","addExtmap","addPayloadTypes","addSsrc","finalize","FirefoxP2PSdpBuilder","SafariP2PSdpBuilder","isFirefox","isSafari","extmap","j","fmtp","getOwnPropertyNames","pName","ssrcGroup","P2PSdpBuilder","sdpString","sdpMLineIndex","sdpMid","foundation","component","priority","relAddress","generation","tcpType","networkId","networkCost","candidate","generateOffer","generateAnswer","CallInstance","udp_p2p","udp_reflector","min_layer","max_layer","library_versions","createdAt","decryptQueue","candidates","canCreateConferenceEntry","setMediaState","sendMediaState","mediaStates","_sendMediaState","_connectionState","connectionInstance","sortIndex","findEntry","recvEntry","startScreenSharingInternal","wasStartingScreen","wasStartingVideo","requestScreen","stopVideoSharing","startVideoSharingInternal","requestInputSource","track","inputStream","getVideoTracks","stopTrack","isSharingVideoType","audioTrack","getAudioTracks","setHangUpTimeout","clearHangUpTimeout","hangUpTimeout","setPhoneCall","phoneCall","canAccept","overrideConnectionState","g_a_hash","appCallsManager","generateDh","dh","g_b","g_a","g_b_hash","getCallInput","phonePhoneCall","savePhonePhoneCall","joinCall","encryptionKey","configuration","iceServers","connections","ipv6","port","urls","turn","stun","credential","iceTransportPolicy","p2p_allowed","getRtcConfiguration","sendIceCandidate","onTrack","encryptor","decryptor","processDecryptQueue","createDataChannelEntry","dataChannelEntry","createEntry","sendEntry","negotiated","applyDataChannelData","TextEncoder","encode","iceCandidate","parsed","p2pParseCandidate","confirmCall","key_fingerprint","computeKey","emojisFingerprint","getEmojisFingerprintPromise","codePoints","unlockStreamManager","doTheMagic","getTransceivers","transceiver","getEntryByMid","bundle","sdpDescription","generateSdp","isAnswer","setRemoteDescription","onInputStream","stream","videoTrack","onMutedChange","requestAudioSource","setMuted","discardReason","discardedByOtherParty","hasVideo","discardCall","performCodec","_codec","setDataToDescription","setData","transport","screencast","filterNotVP8","vp8PayloadType","rtxIdx","apt","applyCallSignalingData","performSsrcGroups","getEntryBySource","sendRecvEntry","findFreeSendRecvEntry","setEntrySource","tryToReleaseCandidates","generateCandidate","RTCIceCandidate","addIceCandidate","decryptedData","TextDecoder","decode","signalingData","onUpdatePhoneCallSignalingData","getStreamCached","_cache","isScreen","constraints","getScreenStream","getStream","CallInstanceBase","fixSafariAudio","isSharingAudio","hasInputTrackKind","isAudioGood","isVideoGood","getAudioConstraints","getVideoConstraints","getScreenConstraints","endpoint","tryAddTrack","streams","saveInputVideoStream","isOutput","elementEndpoint","addTrack","useStream","outputStream","srcObject","sinkId","outputDeviceId","setSinkId","getTracks","addStream","CALL_STATE","audioAsset","CALL_REQUEST_TIMEOUT","CallsController","sortedInstances","createCallInstance","admin_id","g_a_or_b","bytesCmp","callId","getCallByUserId","hasConnected","hasCurrent","startCallInternal","fullInfo","participant_id","requestCall","GROUP_CALL_AMPLITUDE_ANALYSE_COUNT_MAX","GROUP_CALL_AMPLITUDE_ANALYSE_INTERVAL_MS","GroupCallConnectionInstance","negotiateThrottled","bundlePolicy","rtcpMuxPolicy","iceCandidatePoolSize","maybeUpdateRemoteVideoConstraints","updateConstraintsInterval","invokeJoinGroupCall","localSdp","mainChannels","processedChannels","sectionInfo","payload","processMediaSection","audioChannel","videoChannel","useChannel","setEntryPeerId","performExtmap","filterServerCodecs","isNewConnection","originalOffer","iceRestart","hasMunged","skipAddingMulticast","mediaLine","mediaLineParts","localMLine","codecIds","newData","setPort","setSource","newSdp","addSsrcEntry","newChannel","mungedSdp","fixLocalOffer","entriesToDelete","shouldBeSkipped","answerDescription","deleteEntry","iceGatheringState","updateConstraints","sender","setParameters","getParameters","degradationPreference","colibriClass","defaultConstraints","onStageEndpoints","addInputVideoStream","GroupCallInstance","isSpeakingMap","pinnedSources","participantsSsrcs","hadAutoPinnedSources","dispatchPinnedThrottled","getCachedParticipants","presentation","unpinSource","changeUserMuted","source_groups","createConnectionInstance","raise","raiseHand","stopScreenSharing","startScreenSharing","startScreenSharingPromise","saveApiParticipant","leaveGroupCallPresentation","videoPaused","videoStopped","startVideoSharing","startVideoSharingPromise","rejoin","isDiscarded","isUpdatingMeInCurrentCall","onParticipantUpdate","doNotDispatchParticipantUpdate","hasLeft","oldSsrcs","modifiedTypes","oldSsrc","oldSource","oldEntry","originalDirection","setEndpoint","createTransceiver","GROUP_CALL_STATE","makeSsrcsFromParticipant","makeSsrcFromParticipant","audio_source","generateSelfVideo","audioSource","GroupCallsController","setCurrentGroupCall","startConnectingSound","stopConnectingSound","joinVideo","MediaStream","createMainStreamManager","joinGroupCallInternal","handleUpdateGroupCallParticipants","updatingSdp","channelCount","constraint","mediaDevices","getSupportedConstraints","constraintSupported","skipAudio","frameRate","screenStream","getDisplayMedia","contentHint","getUserMedia","clientInfo","lookupAttributeKeys","telegramSourceGroups","sdpLines","rest","parseSourceGroups","raw","ConferenceEntry","addTransceiver","generateSsrc","LocalConferenceDescription","sessionId","maxSeenId","entriesByMid","entriesBySource","entriesByPeerId","getEntriesByPeerId","conference","SDP","mediaSections","splitStringByLimitWithRest","UniqueNumberGenerator","generate","maxTries","_try","SDPAttributeSplitted","SDPMediaLineParts","SDPLine","SDPAttributeInner","missed","exists","nestedMap","makeAttributes","innerParts","SDPAttributes","fillAttributes","attributesMap","linesArray","SDPMediaSection","isReceiving","resultShouldBeArray","SDPSessionSection","parseSdp","createSection","sessionSection","lineStr","isIncorrectSdpLine","parseSdpLine","addSimulcast","generator","originalSsrcs","ssrcs2","ssrcsStrLines","ssrc2","WEBRTC_MEDIA_PORT","fixMediaLineType","getConnectionTypeForMediaType","generateMediaFirstLine","payloadIds","connectionType","SDPBuilder","addCandidate","performCandidate","addHeader","sId","bundleMids","addTransport","skipCandidates","addSource","addMsid","isApplication","isInactive","hdrexts","hdrext","fbs","fb","addConference","AudioStreamAnalyser","streamSource","createMediaStreamSource","gain","createGain","minDecibels","maxDecibels","smoothingTimeConstant","StreamManager","getAmplitude","streamAnalyser","analyse","ANALYSER_LISTENER","AudioContext","webkitAudioContext","getSource","itemSource","removeTrack","finalizeAddingTrack","changeTimer","substring","replaceInputAudio","oldTrack","timer","transceiverInit","tracks","mediaTrackType","trackIdx","replaceTrack","StringFromLineBuilder","newLine","addJoined","toTelegramSource","fromTelegramSource","rms","SEND_WHEN_ONLINE_TIMESTAMP","EMOJI_REG_EXP","onlyFirst","firstEmojiMatch","lastEmojiMatch","E","setBlankToAnchor","messageEntityTextUrl","messageEntityMentionName","isDraft","EMOJI_VERSIONS_SUPPORTED","inlineEl","newEmojiWidth","legacyEmojiWidth","isEmojiSupported","globalLazyLoadQueue","CustomEmojiElement","syncedPlayer","pausedElements","playersSynced","createCustomFiller","lastPausedVideo","middlewares","CustomEmojiRendererElement","clearedElements","WeakSet","isCanvasClean","emojiRenderers","getOffsets","offsetsMap","offsetParent","elementsArr","placeholders","isDimensionsSet","syncedPlayersFrames","isImageData","ImageData","frameWidth","frameHeight","lastChildWas","checkForAnyFrame","forceRenderAfter","renderEmojis","addCustomEmojis","addElements","usingOwnQueue","_loadPromises","newElements","isLottie","willHaveSyncedPlayer","newElementsArray","CUSTOM_EMOJI_INSTANT_PLAY","addition","_p","overrideRender","setRenderInterval","syncedPlayers","clearRenderInterval","missing","cachedPromises","uncachedPromisesPromise","loadFromPromises","uncached","emojiRenderInterval","renderers","nasty","usedLength","wrapSomething","wrapElement","noFiller","customWraps","contextSite","contextExternal","lastEntity","nextEntity","endPartOffset","fullEntityText","partText","usedText","fontFamily","atPos","fromBot","encodeURIComponent","isSupported","masked","currentContext","electronHelpers","contextUrl","wrapTelegramUrlToAnchor","encoded","encodeSpoiler","entityText","voodoo","insertCustomFillers","notFiller","isCustomFillerNeededBySiblingNode","url1","QueryableWorker","worker","terminate","onmessage","queryMethodListener","queryMethodArguments","postMessage","sendQuery","transfer","queryMethod","workersLimit","playersByCacheName","workers","curWorkerNum","onPlayerLoaded","reqId","fps","clamped","onPlayerError","getAnimation","loadLottieWorkers","remain","Worker","queryableWorker","makeAssetUrl","loadAnimationAsAsset","loadAnimationFromURL","loadAnimationDataFromURL","blobConstruct","loadAnimationFromURLManually","loadAnimationFromURLNext","newParams","loadAnimationWorker","waitForFirstFrame","initPlayer","destroyWorkers","loadFromData","getLottiePixelRatio","RLottiePlayer","cachingDelta","_autoplay","CACHE","skipDelta","contexts","setMainLoop","clearPendingRAF","rafId","resetCurrentFrame","minFrame","requestFrame","applyInversing","renderFrame2","cachedSource","renderedFirstFrame","ImageBitmap","frInterval","frThen","frameNew","onLap","mainLoopForwards","mainLoopBackwards","currentMethod","frameListener","listenerResults","enterFrame","playToFrame","bounds","setMinMax","playToFrameOnFrameCallback","setInverseColor","pagesManager","pageId","pagesDiv","scrollableDiv","page","onShown","setPage","isAuthPage","Page","onFirstMount","encodeEmoji","emojiText","toCodePoints","removeVS16s","vs16RegExp","zeroWidthJoiner","rawEmoji","unicodeSurrogates","points","getEmojiToneIndex","VIRTUAL_COUNTRIES_EMOJIS","getCountryEmoji","emojiFromCodePoints","fromCodePoint","module","exports","defineProperty","enumerable","Symbol","toStringTag","__esModule","prototype","isRecordingSupported","bufferLength","encoderApplication","encoderFrameSize","encoderPath","maxFramesPerPage","mediaTrackConstraints","resampleQuality","streamPages","wavBitDepth","encodedSamplePosition","WebAssembly","clearStream","audioContext","closeAudioContext","encodeBuffers","getChannelData","encoder","buffers","initAudioContext","initAudioGraph","scriptProcessorNode","createScriptProcessor","destination","onaudioprocess","inputBuffer","monitorGainNode","setMonitorGain","recordingGainNode","setRecordingGain","initSourceNode","loadWorker","initWorker","streamPage","storePage","recordedPages","samplePosition","finish","originalSampleRate","sampleRate","wavSampleRate","onpause","resume","onresume","setTargetAtTime","onstart","destroyWorker","Function","kSampleStepSize","float32ArraySupported","Float32Array","A","aA1","aA2","B","C","calcBezier","aT","getSlope","LinearEasing","mX1","mY1","mX2","mY2","sampleValues","aX","intervalStart","currentSample","kSplineTableSize","guessForT","initialSlope","aGuessT","currentSlope","newtonRaphsonIterate","aA","aB","currentX","currentT","binarySubdivide","getTForX"],"sourceRoot":""} \ No newline at end of file diff --git a/public/508.864916919938e5f14eb7.chunk.js b/public/508.dfcdc07d46a7ba4348a1.chunk.js similarity index 98% rename from public/508.864916919938e5f14eb7.chunk.js rename to public/508.dfcdc07d46a7ba4348a1.chunk.js index 699bb61c..a729a0af 100644 --- a/public/508.864916919938e5f14eb7.chunk.js +++ b/public/508.dfcdc07d46a7ba4348a1.chunk.js @@ -1,2 +1,2 @@ (()=>{"use strict";(()=>{if("undefined"!=typeof __webpack_require__){var e=__webpack_require__.u,t=__webpack_require__.e,r={},i={};__webpack_require__.u=function(t){return e(t)+(r.hasOwnProperty(t)?"?"+r[t]:"")},__webpack_require__.e=function(n){return t(n).catch((function(t){var a=i.hasOwnProperty(n)?i[n]:999999;if(a<1){var o=e(n);throw t.message="Loading chunk "+n+" failed after 999999 retries.\n("+o+")",t.request=o,t}return new Promise((function(e){setTimeout((function(){var t=Date.now();r[n]=t,i[n]=a-1,e(__webpack_require__.e(n))}),3e3)}))}))}}})();const e="undefined"!=typeof window?window:self,t=navigator?navigator.userAgent:null,r=(navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i),navigator.userAgent.toLowerCase().indexOf("android"),/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor),(/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&e.MSStream,!!("safari"in e)||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome"))));let i;if(navigator.userAgent.toLowerCase().indexOf("firefox"),(void 0===navigator.maxTouchPoints||navigator.maxTouchPoints>0)&&navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i),r)try{i=+navigator.userAgent.match(/Version\/(.+?) /)[1]>=14}catch(e){i=!1}else i=!0;const n=i,a="undefined"!=typeof ImageBitmap;const o=[[[16219713,13335381],[16757049,16168585],[16765248,16764327],[16768889,16768965]],[[16219713,10771e3],[16757049,14653547],[16765248,15577475],[16768889,16040864]],[[16219713,7354903],[16757049,11233085],[16765248,12812110],[16768889,14194279]],[[16219713,4858889],[16757049,8207886],[16765248,9852201],[16768889,11100983]],[[16219713,2101002],[16757049,4270372],[16765248,5848375],[16768889,6505791]]],s=e=>Math.round(255*Math.min(Math.max(e,0),1));importScripts("rlottie-wasm.js");const h=self.Module;class d{constructor(e,t,r,i){this.reqId=e,this.width=t,this.height=r,this.raw=i}init(e,t){if(!this.dead){this.fps=Math.max(1,Math.min(60,t||60));try{this.handle=c.Api.init(),this.stringOnWasmHeap=allocate(intArrayFromString(e),"i8",0),this.frameCount=c.Api.loadFromData(this.handle,this.stringOnWasmHeap),c.Api.resize(this.handle,this.width,this.height),m(["loaded",this.reqId,this.frameCount,this.fps]),!this.raw&&a&&(this.imageData=new ImageData(this.width,this.height))}catch(e){console.error("init RLottieItem error:",e),m(["error",this.reqId,e])}}}render(e,t){if(!this.dead&&void 0!==this.handle&&!(this.frameCount{m(["frame",this.reqId,e,t],[t])}))):(t?t.set(i):t=new Uint8ClampedArray(i),m(["frame",this.reqId,e,t],[t.buffer]))}catch(e){console.error("Render error:",e),this.dead=!0,m(["error",this.reqId,e])}}destroy(){this.dead=!0,void 0!==this.handle&&c.Api.destroy(this.handle)}}const c=new class{constructor(){this.Api={}}initApi(){this.Api={init:h.cwrap("lottie_init","",[]),destroy:h.cwrap("lottie_destroy","",["number"]),resize:h.cwrap("lottie_resize","",["number","number","number"]),buffer:h.cwrap("lottie_buffer","number",["number"]),render:h.cwrap("lottie_render","",["number","number"]),loadFromData:h.cwrap("lottie_load_from_data","number",["number","number"])}}init(){this.initApi(),m(["ready"])}};h.onRuntimeInitialized=function(){c.init()};const u={},f={loadFromData:function(e,t,r,i,n,a){const h=u[e]=new d(e,r,i,a);(function(e){return function(e,t){return new Promise((t=>{const r=new FileReader;r.addEventListener("loadend",(e=>{t(e.target.result)})),r.readAsText(e)}))}(e)})(t).then((t=>{try{if("number"==typeof n&&n>=1&&n<=5){const e=JSON.parse(t);(function(e,t){const r=o[Math.max(t-1,0)],i=e=>{switch(e.ty){case"st":case"fl":(e=>{const t=e.c.k,i=s(t[2])|s(t[1])<<8|s(t[0])<<16,n=r.find((e=>e[0]===i));n&&(t[0]=(n[1]>>16&255)/255,t[1]=(n[1]>>8&255)/255,t[2]=(255&n[1])/255)})(e)}e.hasOwnProperty("it")&&n(e.it)},n=e=>{for(const t of e)i(t)};try{for(const t of e.layers)if(t.shapes)for(const e of t.shapes)e.it?n(e.it):i(e)}catch(r){console.warn("cant apply replacements",r,e,t)}})(e,n),t=JSON.stringify(e)}const e=t.match(/"fr":\s*?(\d+?),/),r=+(null==e?void 0:e[1])||60;h.init(t,r)}catch(r){console.error("Invalid file for sticker:",t),m(["error",e,r])}}))},destroy:function(e){const t=u[e];t&&(t.destroy(),delete u[e])},renderFrame:function(e,t,r){u[e].render(t,r)}};function m(e,t){postMessage({queryMethodListener:e.shift(),queryMethodArguments:e},n?t:void 0)}onmessage=function(e){f[e.data.queryMethod].apply(f,e.data.queryMethodArguments)}})(); -//# sourceMappingURL=508.864916919938e5f14eb7.chunk.js.map \ No newline at end of file +//# sourceMappingURL=508.dfcdc07d46a7ba4348a1.chunk.js.map \ No newline at end of file diff --git a/public/508.864916919938e5f14eb7.chunk.js.map b/public/508.dfcdc07d46a7ba4348a1.chunk.js.map similarity index 99% rename from public/508.864916919938e5f14eb7.chunk.js.map rename to public/508.dfcdc07d46a7ba4348a1.chunk.js.map index e6f6a16e..9451d3bf 100644 --- a/public/508.864916919938e5f14eb7.chunk.js.map +++ b/public/508.dfcdc07d46a7ba4348a1.chunk.js.map @@ -1 +1 @@ -{"version":3,"file":"508.864916919938e5f14eb7.chunk.js","mappings":"mBAAA,MACE,GAAmC,oBAAxBA,oBAAqC,CAC9C,IAAIC,EAAeD,oBAAoBE,EACnCC,EAAgBH,oBAAoBI,EACpCC,EAAW,CAAC,EACZC,EAAW,CAAC,EAIhBN,oBAAoBE,EAAI,SAAUK,GAEhC,OADaN,EAAaM,IAGvBF,EAASG,eAAeD,GAAW,IAAMF,EAASE,GAAW,GAElE,EACAP,oBAAoBI,EAAI,SAAUG,GAEhC,OADaJ,EAAcI,GACbE,OAAM,SAAUC,GAC5B,IAAIC,EAAUL,EAASE,eAAeD,GAClCD,EAASC,GACT,OACJ,GAAII,EAAU,EAAG,CACf,IAAIC,EAAUX,EAAaM,GAQ3B,MAPAG,EAAMG,QACJ,iBACAN,EACA,mCACAK,EACA,IACFF,EAAMI,QAAUF,EACVF,CACR,CACA,OAAO,IAAIK,SAAQ,SAAUC,GAE3BC,YAAW,WACT,IACIC,EACKC,KAAKC,MAGdf,EAASE,GAAWW,EACpBZ,EAASC,GAAWI,EAAU,EAC9BK,EAAQhB,oBAAoBI,EAAEG,GAChC,GArCG,IAsCL,GACF,GACF,CACF,CACD,EAjDD,GCAA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AS7E,EAAeuB,EAAiBC,GAEpDe,EAAMvC,GAAOsB,OAAOC,EAASC,EAC/B,GAGF,SAASN,EAAM4D,EAAaC,GAC1BC,YAAY,CAACC,oBAAqBH,EAAKI,QAASC,qBAAsBL,GAAO,EAAwBC,OAAW7F,EAClH,CAEAkG,UAAY,SAASlI,GAEnBsF,EAAmBtF,EAAEyE,KAAK0D,aAAaC,MAAM9C,EAAoBtF,EAAEyE,KAAKwD,qBAC1E,C","sources":["webpack://tweb/webpack/runtime/compat","webpack://tweb/./src/environment/ctx.ts","webpack://tweb/./src/environment/userAgent.ts","webpack://tweb/./src/environment/canUseTransferables.ts","webpack://tweb/./src/environment/imageBitmapSupport.ts","webpack://tweb/./src/lib/rlottie/applyReplacements.ts","webpack://tweb/./src/lib/rlottie/rlottie.worker.ts","webpack://tweb/./src/helpers/blob/readBlobAsText.ts","webpack://tweb/./src/helpers/blob/readBlobAs.ts"],"sourcesContent":["(() => {\n if (typeof __webpack_require__ !== 'undefined') {\n var oldGetScript = __webpack_require__.u;\n var oldLoadScript = __webpack_require__.e;\n var queryMap = {};\n var countMap = {};\n var getRetryDelay = function () {\n return 3000;\n };\n __webpack_require__.u = function (chunkId) {\n var result = oldGetScript(chunkId);\n return (\n result +\n (queryMap.hasOwnProperty(chunkId) ? '?' + queryMap[chunkId] : '')\n );\n };\n __webpack_require__.e = function (chunkId) {\n var result = oldLoadScript(chunkId);\n return result.catch(function (error) {\n var retries = countMap.hasOwnProperty(chunkId)\n ? countMap[chunkId]\n : 999999;\n if (retries < 1) {\n var realSrc = oldGetScript(chunkId);\n error.message =\n 'Loading chunk ' +\n chunkId +\n ' failed after 999999 retries.\\n(' +\n realSrc +\n ')';\n error.request = realSrc;\n throw error;\n }\n return new Promise(function (resolve) {\n var retryAttempt = 999999 - retries + 1;\n setTimeout(function () {\n var retryAttemptString = '&retry-attempt=' + retryAttempt;\n var cacheBust = (function () {\n return Date.now();\n })();\n +retryAttemptString;\n queryMap[chunkId] = cacheBust;\n countMap[chunkId] = retries - 1;\n resolve(__webpack_require__.e(chunkId));\n }, getRetryDelay(retryAttempt));\n });\n });\n };\n }\n})();\n","const ctx = typeof(window) !== 'undefined' ? window : self;\n\nexport default ctx;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ctx from './ctx';\n\nexport const USER_AGENT = navigator ? navigator.userAgent : null;\nexport const IS_APPLE = navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i) !== -1;\nexport const IS_ANDROID = navigator.userAgent.toLowerCase().indexOf('android') !== -1;\nexport const IS_CHROMIUM = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);\n\n// https://stackoverflow.com/a/58065241\nexport const IS_APPLE_MOBILE = (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&\n !(ctx as any).MSStream;\n\nexport const IS_SAFARI = !!('safari' in ctx) || !!(USER_AGENT && (/\\b(iPad|iPhone|iPod)\\b/.test(USER_AGENT) || (!!USER_AGENT.match('Safari') && !USER_AGENT.match('Chrome'))))/* || true */;\nexport const IS_FIREFOX = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n\nexport const IS_MOBILE_SAFARI = IS_SAFARI && IS_APPLE_MOBILE;\n\nexport const IS_MOBILE = (navigator.maxTouchPoints === undefined || navigator.maxTouchPoints > 0) && navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i) != -1;\n","import {IS_SAFARI} from './userAgent';\n\n/*\n * This is used as a workaround for a memory leak in Safari caused by using Transferable objects to\n * transfer data between WebWorkers and the main thread.\n * https://github.com/mapbox/mapbox-gl-js/issues/8771\n *\n * This should be removed once the underlying Safari issue is fixed.\n */\n\nlet CAN_USE_TRANSFERABLES: boolean;\nif(!IS_SAFARI) CAN_USE_TRANSFERABLES = true;\nelse {\n try {\n const match = navigator.userAgent.match(/Version\\/(.+?) /);\n CAN_USE_TRANSFERABLES = +match[1] >= 14;\n } catch(err) {\n CAN_USE_TRANSFERABLES = false;\n }\n}\n\nexport default CAN_USE_TRANSFERABLES;\n","const IS_IMAGE_BITMAP_SUPPORTED = typeof(ImageBitmap) !== 'undefined';\n\nexport default IS_IMAGE_BITMAP_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// https://github.com/telegramdesktop/tdesktop/blob/97d8ee75d51874fcb74a9bfadc79f835c82be54a/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp#L46\nconst COLORREPLACEMENTS = [\n [\n [0xf77e41, 0xcb7b55],\n [0xffb139, 0xf6b689],\n [0xffd140, 0xffcda7],\n [0xffdf79, 0xffdfc5]\n ],\n\n [\n [0xf77e41, 0xa45a38],\n [0xffb139, 0xdf986b],\n [0xffd140, 0xedb183],\n [0xffdf79, 0xf4c3a0]\n ],\n\n [\n [0xf77e41, 0x703a17],\n [0xffb139, 0xab673d],\n [0xffd140, 0xc37f4e],\n [0xffdf79, 0xd89667]\n ],\n\n [\n [0xf77e41, 0x4a2409],\n [0xffb139, 0x7d3e0e],\n [0xffd140, 0x965529],\n [0xffdf79, 0xa96337]\n ],\n\n [\n [0xf77e41, 0x200f0a],\n [0xffb139, 0x412924],\n [0xffd140, 0x593d37],\n [0xffdf79, 0x63453f]\n ]\n];\n\nconst convert = (value: number) => {\n return Math.round(Math.min(Math.max(value, 0), 1) * 255);\n};\n\ntype LottieShape = {\n c: {\n k: number[]\n },\n ty: 'st' | 'fl',\n it?: LottieShape[]\n};\n\nexport default function applyReplacements(object: {\n layers: Array<{shapes: LottieShape[]}>\n}, toneIndex: number) {\n const replacements = COLORREPLACEMENTS[Math.max(toneIndex - 1, 0)];\n\n const applyTo = (smth: LottieShape) => {\n const k = smth.c.k;\n const color = convert(k[2]) | (convert(k[1]) << 8) | (convert(k[0]) << 16);\n\n const foundReplacement = replacements.find((p) => p[0] === color);\n if(foundReplacement) {\n k[0] = ((foundReplacement[1] >> 16) & 255) / 255;\n k[1] = ((foundReplacement[1] >> 8) & 255) / 255;\n k[2] = (foundReplacement[1] & 255) / 255;\n }\n\n // console.log('foundReplacement!', foundReplacement, color.toString(16), k);\n };\n\n const checkSmth = (smth: LottieShape) => {\n switch(smth.ty) {\n case 'st':\n case 'fl':\n applyTo(smth);\n break;\n }\n\n if(smth.hasOwnProperty('it')) {\n iterateIt(smth.it);\n }\n };\n\n const iterateIt = (it: LottieShape['it']) => {\n for(const smth of it) {\n checkSmth(smth);\n }\n };\n\n try {\n for(const layer of object.layers) {\n if(!layer.shapes) continue;\n\n for(const shape of layer.shapes) {\n if(!shape.it) {\n checkSmth(shape);\n continue;\n }\n\n iterateIt(shape.it);\n }\n }\n } catch(err) {\n console.warn('cant apply replacements', err, object, toneIndex);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport CAN_USE_TRANSFERABLES from '../../environment/canUseTransferables';\nimport IS_IMAGE_BITMAP_SUPPORTED from '../../environment/imageBitmapSupport';\nimport readBlobAsText from '../../helpers/blob/readBlobAsText';\nimport applyReplacements from './applyReplacements';\n\nimportScripts('rlottie-wasm.js');\n// import Module, { allocate, intArrayFromString } from './rlottie-wasm';\n\nconst _Module = (self as any).Module as any;\n\nconst DEFAULT_FPS = 60;\n\ntype LottieHandlePointer = number;\n\n// throw new Error('test');\n\nexport class RLottieItem {\n private stringOnWasmHeap: number;\n private handle: LottieHandlePointer;\n private frameCount: number;\n private fps: number;\n\n private dead: boolean;\n // private context: OffscreenCanvasRenderingContext2D;\n\n private imageData: ImageData;\n\n constructor(\n private reqId: number,\n private width: number,\n private height: number,\n private raw?: boolean/* ,\n private canvas: OffscreenCanvas */\n ) {\n }\n\n public init(json: string, fps: number) {\n if(this.dead) {\n return;\n }\n\n this.fps = Math.max(1, Math.min(60, fps || DEFAULT_FPS));\n\n // this.context = canvas.getContext('2d');\n /* let frame = 0;\n setInterval(() => {\n if(frame >= this.frameCount) frame = 0;\n let _frame = frame++;\n this.render(_frame, null);\n }, 1000 / this.fps); */\n\n try {\n this.handle = worker.Api.init();\n\n // @ts-ignore\n this.stringOnWasmHeap = allocate(intArrayFromString(json), 'i8', 0);\n\n this.frameCount = worker.Api.loadFromData(this.handle, this.stringOnWasmHeap);\n\n worker.Api.resize(this.handle, this.width, this.height);\n\n reply(['loaded', this.reqId, this.frameCount, this.fps]);\n\n if(!this.raw && IS_IMAGE_BITMAP_SUPPORTED) {\n this.imageData = new ImageData(this.width, this.height);\n }\n } catch(e) {\n console.error('init RLottieItem error:', e);\n reply(['error', this.reqId, e]);\n }\n }\n\n public render(frameNo: number, clamped?: Uint8ClampedArray) {\n if(this.dead || this.handle === undefined) return;\n // return;\n\n if(this.frameCount < frameNo || frameNo < 0) {\n return;\n }\n\n try {\n worker.Api.render(this.handle, frameNo);\n\n const bufferPointer = worker.Api.buffer(this.handle);\n\n const data = _Module.HEAPU8.subarray(bufferPointer, bufferPointer + (this.width * this.height * 4));\n\n if(this.imageData) {\n this.imageData.data.set(data);\n createImageBitmap(this.imageData).then((imageBitmap) => {\n reply(['frame', this.reqId, frameNo, imageBitmap], [imageBitmap]);\n });\n } else {\n if(!clamped) {\n clamped = new Uint8ClampedArray(data);\n } else {\n clamped.set(data);\n }\n\n // this.context.putImageData(new ImageData(clamped, this.width, this.height), 0, 0);\n\n reply(['frame', this.reqId, frameNo, clamped], [clamped.buffer]);\n }\n } catch(e) {\n console.error('Render error:', e);\n this.dead = true;\n reply(['error', this.reqId, e]);\n }\n }\n\n public destroy() {\n this.dead = true;\n\n if(this.handle !== undefined) {\n worker.Api.destroy(this.handle);\n }\n }\n}\n\nclass RLottieWorker {\n public Api: {\n init: () => LottieHandlePointer,\n destroy: (handle: LottieHandlePointer) => void,\n resize: (handle: LottieHandlePointer, width: number, height: number) => void,\n buffer: (handle: LottieHandlePointer) => number,\n render: (handle: LottieHandlePointer, frameNo: number) => void,\n loadFromData: (handle: LottieHandlePointer, bufferPointer: number) => number\n } = {} as any;\n\n public initApi() {\n this.Api = {\n init: _Module.cwrap('lottie_init', '', []),\n destroy: _Module.cwrap('lottie_destroy', '', ['number']),\n resize: _Module.cwrap('lottie_resize', '', ['number', 'number', 'number']),\n buffer: _Module.cwrap('lottie_buffer', 'number', ['number']),\n render: _Module.cwrap('lottie_render', '', ['number', 'number']),\n loadFromData: _Module.cwrap('lottie_load_from_data', 'number', ['number', 'number'])\n };\n }\n\n public init() {\n this.initApi();\n reply(['ready']);\n }\n}\n\nconst worker = new RLottieWorker();\n\n_Module.onRuntimeInitialized = function() {\n worker.init();\n};\n\nconst items: {[reqId: string]: RLottieItem} = {};\nconst queryableFunctions = {\n loadFromData: function(reqId: number, blob: Blob, width: number, height: number, toneIndex: number, raw: boolean/* , canvas: OffscreenCanvas */) {\n const item = items[reqId] = new RLottieItem(reqId, width, height, raw/* , canvas */);\n readBlobAsText(blob).then((json) => {\n try {\n if(typeof(toneIndex) === 'number' && toneIndex >= 1 && toneIndex <= 5) {\n /* params.animationData = copy(params.animationData);\n this.applyReplacements(params.animationData, toneIndex); */\n\n const newAnimationData = JSON.parse(json);\n applyReplacements(newAnimationData, toneIndex);\n json = JSON.stringify(newAnimationData);\n }\n\n // ! WARNING, с этой проверкой не все стикеры работают, например - ДУРКА\n /* if(!/\"tgs\":\\s*?1./.test(jsString)) {\n throw new Error('Invalid file');\n } */\n\n /* let perf = performance.now();\n let json = JSON.parse(jsString);\n console.log('sticker decode:', performance.now() - perf); */\n\n const match = json.match(/\"fr\":\\s*?(\\d+?),/);\n const frameRate = +match?.[1] || DEFAULT_FPS;\n\n // console.log('Rendering sticker:', reqId, frameRate, 'now rendered:', Object.keys(items).length);\n\n item.init(json, frameRate);\n } catch(err) {\n console.error('Invalid file for sticker:', json);\n reply(['error', reqId, err]);\n }\n });\n },\n destroy: function(reqId: number) {\n const item = items[reqId];\n if(!item) {\n return;\n }\n\n item.destroy();\n delete items[reqId];\n },\n renderFrame: function(reqId: number, frameNo: number, clamped?: Uint8ClampedArray) {\n // console.log('worker renderFrame', reqId, frameNo, clamped);\n items[reqId].render(frameNo, clamped);\n }\n};\n\nfunction reply(args: any[], transfer?: Transferable[]) {\n postMessage({queryMethodListener: args.shift(), queryMethodArguments: args}, CAN_USE_TRANSFERABLES ? transfer : undefined);\n}\n\nonmessage = function(e) {\n // @ts-ignore\n queryableFunctions[e.data.queryMethod].apply(queryableFunctions, e.data.queryMethodArguments);\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport readBlobAs from './readBlobAs';\n\nexport default function readBlobAsText(blob: Blob) {\n return readBlobAs(blob, 'readAsText');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import { IS_WEB_WORKER } from \"../context\";\n\n// const id = IS_WEB_WORKER ? Math.random() * 0x1000 | 0 : 0;\nexport default function readBlobAs(blob: Blob, method: 'readAsText'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsDataURL'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsArrayBuffer'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsArrayBuffer' | 'readAsText' | 'readAsDataURL'): Promise {\n // const perf = performance.now();\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.addEventListener('loadend', (e) => {\n // console.log(`readBlobAs [${id}] ${method} time ${performance.now() - perf}`);\n resolve(e.target.result);\n });\n reader[method](blob);\n });\n}\n"],"names":["__webpack_require__","oldGetScript","u","oldLoadScript","e","queryMap","countMap","chunkId","hasOwnProperty","catch","error","retries","realSrc","message","request","Promise","resolve","setTimeout","cacheBust","Date","now","window","self","USER_AGENT","navigator","userAgent","IS_SAFARI","search","toLowerCase","indexOf","test","vendor","platform","maxTouchPoints","match","CAN_USE_TRANSFERABLES","undefined","err","COLORREPLACEMENTS","convert","value","Math","round","min","max","importScripts","_Module","Module","RLottieItem","constructor","reqId","width","height","raw","init","json","fps","this","dead","handle","worker","Api","stringOnWasmHeap","allocate","intArrayFromString","frameCount","loadFromData","resize","reply","imageData","ImageData","console","render","frameNo","clamped","bufferPointer","buffer","data","HEAPU8","subarray","set","createImageBitmap","then","imageBitmap","Uint8ClampedArray","destroy","initApi","cwrap","onRuntimeInitialized","items","queryableFunctions","blob","toneIndex","item","method","reader","FileReader","addEventListener","target","result","readBlobAs","readBlobAsText","newAnimationData","JSON","parse","object","replacements","checkSmth","smth","ty","k","c","color","foundReplacement","find","p","applyTo","iterateIt","it","layer","layers","shapes","shape","warn","applyReplacements","stringify","frameRate","renderFrame","args","transfer","postMessage","queryMethodListener","shift","queryMethodArguments","onmessage","queryMethod","apply"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"508.dfcdc07d46a7ba4348a1.chunk.js","mappings":"mBAAA,MACE,GAAmC,oBAAxBA,oBAAqC,CAC9C,IAAIC,EAAeD,oBAAoBE,EACnCC,EAAgBH,oBAAoBI,EACpCC,EAAW,CAAC,EACZC,EAAW,CAAC,EAIhBN,oBAAoBE,EAAI,SAAUK,GAEhC,OADaN,EAAaM,IAGvBF,EAASG,eAAeD,GAAW,IAAMF,EAASE,GAAW,GAElE,EACAP,oBAAoBI,EAAI,SAAUG,GAEhC,OADaJ,EAAcI,GACbE,OAAM,SAAUC,GAC5B,IAAIC,EAAUL,EAASE,eAAeD,GAClCD,EAASC,GACT,OACJ,GAAII,EAAU,EAAG,CACf,IAAIC,EAAUX,EAAaM,GAQ3B,MAPAG,EAAMG,QACJ,iBACAN,EACA,mCACAK,EACA,IACFF,EAAMI,QA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AKC,EAAMuE,E,CAChB,MAAMzF,GACNkC,QAAQ7D,MAAM,4BAA6B6C,GAC3Ca,EAAM,CAAC,QAASlB,EAAOb,G,IAG7B,EACAgD,QAAS,SAASnC,GAChB,MAAM2C,EAAOJ,EAAMvC,GACf2C,IAIJA,EAAKR,iBACEI,EAAMvC,GACf,EACA6E,YAAa,SAAS7E,EAAeuB,EAAiBC,GAEpDe,EAAMvC,GAAOsB,OAAOC,EAASC,EAC/B,GAGF,SAASN,EAAM4D,EAAaC,GAC1BC,YAAY,CAACC,oBAAqBH,EAAKI,QAASC,qBAAsBL,GAAO,EAAwBC,OAAW7F,EAClH,CAEAkG,UAAY,SAASlI,GAEnBsF,EAAmBtF,EAAEyE,KAAK0D,aAAaC,MAAM9C,EAAoBtF,EAAEyE,KAAKwD,qBAC1E,C","sources":["webpack://tweb/webpack/runtime/compat","webpack://tweb/./src/environment/ctx.ts","webpack://tweb/./src/environment/userAgent.ts","webpack://tweb/./src/environment/canUseTransferables.ts","webpack://tweb/./src/environment/imageBitmapSupport.ts","webpack://tweb/./src/lib/rlottie/applyReplacements.ts","webpack://tweb/./src/lib/rlottie/rlottie.worker.ts","webpack://tweb/./src/helpers/blob/readBlobAsText.ts","webpack://tweb/./src/helpers/blob/readBlobAs.ts"],"sourcesContent":["(() => {\n if (typeof __webpack_require__ !== 'undefined') {\n var oldGetScript = __webpack_require__.u;\n var oldLoadScript = __webpack_require__.e;\n var queryMap = {};\n var countMap = {};\n var getRetryDelay = function () {\n return 3000;\n };\n __webpack_require__.u = function (chunkId) {\n var result = oldGetScript(chunkId);\n return (\n result +\n (queryMap.hasOwnProperty(chunkId) ? '?' + queryMap[chunkId] : '')\n );\n };\n __webpack_require__.e = function (chunkId) {\n var result = oldLoadScript(chunkId);\n return result.catch(function (error) {\n var retries = countMap.hasOwnProperty(chunkId)\n ? countMap[chunkId]\n : 999999;\n if (retries < 1) {\n var realSrc = oldGetScript(chunkId);\n error.message =\n 'Loading chunk ' +\n chunkId +\n ' failed after 999999 retries.\\n(' +\n realSrc +\n ')';\n error.request = realSrc;\n throw error;\n }\n return new Promise(function (resolve) {\n var retryAttempt = 999999 - retries + 1;\n setTimeout(function () {\n var retryAttemptString = '&retry-attempt=' + retryAttempt;\n var cacheBust = (function () {\n return Date.now();\n })();\n +retryAttemptString;\n queryMap[chunkId] = cacheBust;\n countMap[chunkId] = retries - 1;\n resolve(__webpack_require__.e(chunkId));\n }, getRetryDelay(retryAttempt));\n });\n });\n };\n }\n})();\n","const ctx = typeof(window) !== 'undefined' ? window : self;\n\nexport default ctx;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ctx from './ctx';\n\nexport const USER_AGENT = navigator ? navigator.userAgent : null;\nexport const IS_APPLE = navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i) !== -1;\nexport const IS_ANDROID = navigator.userAgent.toLowerCase().indexOf('android') !== -1;\nexport const IS_CHROMIUM = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);\n\n// https://stackoverflow.com/a/58065241\nexport const IS_APPLE_MOBILE = (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&\n !(ctx as any).MSStream;\n\nexport const IS_SAFARI = !!('safari' in ctx) || !!(USER_AGENT && (/\\b(iPad|iPhone|iPod)\\b/.test(USER_AGENT) || (!!USER_AGENT.match('Safari') && !USER_AGENT.match('Chrome'))))/* || true */;\nexport const IS_FIREFOX = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n\nexport const IS_MOBILE_SAFARI = IS_SAFARI && IS_APPLE_MOBILE;\n\nexport const IS_MOBILE = (navigator.maxTouchPoints === undefined || navigator.maxTouchPoints > 0) && navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i) != -1;\n","import {IS_SAFARI} from './userAgent';\n\n/*\n * This is used as a workaround for a memory leak in Safari caused by using Transferable objects to\n * transfer data between WebWorkers and the main thread.\n * https://github.com/mapbox/mapbox-gl-js/issues/8771\n *\n * This should be removed once the underlying Safari issue is fixed.\n */\n\nlet CAN_USE_TRANSFERABLES: boolean;\nif(!IS_SAFARI) CAN_USE_TRANSFERABLES = true;\nelse {\n try {\n const match = navigator.userAgent.match(/Version\\/(.+?) /);\n CAN_USE_TRANSFERABLES = +match[1] >= 14;\n } catch(err) {\n CAN_USE_TRANSFERABLES = false;\n }\n}\n\nexport default CAN_USE_TRANSFERABLES;\n","const IS_IMAGE_BITMAP_SUPPORTED = typeof(ImageBitmap) !== 'undefined';\n\nexport default IS_IMAGE_BITMAP_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// https://github.com/telegramdesktop/tdesktop/blob/97d8ee75d51874fcb74a9bfadc79f835c82be54a/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp#L46\nconst COLORREPLACEMENTS = [\n [\n [0xf77e41, 0xcb7b55],\n [0xffb139, 0xf6b689],\n [0xffd140, 0xffcda7],\n [0xffdf79, 0xffdfc5]\n ],\n\n [\n [0xf77e41, 0xa45a38],\n [0xffb139, 0xdf986b],\n [0xffd140, 0xedb183],\n [0xffdf79, 0xf4c3a0]\n ],\n\n [\n [0xf77e41, 0x703a17],\n [0xffb139, 0xab673d],\n [0xffd140, 0xc37f4e],\n [0xffdf79, 0xd89667]\n ],\n\n [\n [0xf77e41, 0x4a2409],\n [0xffb139, 0x7d3e0e],\n [0xffd140, 0x965529],\n [0xffdf79, 0xa96337]\n ],\n\n [\n [0xf77e41, 0x200f0a],\n [0xffb139, 0x412924],\n [0xffd140, 0x593d37],\n [0xffdf79, 0x63453f]\n ]\n];\n\nconst convert = (value: number) => {\n return Math.round(Math.min(Math.max(value, 0), 1) * 255);\n};\n\ntype LottieShape = {\n c: {\n k: number[]\n },\n ty: 'st' | 'fl',\n it?: LottieShape[]\n};\n\nexport default function applyReplacements(object: {\n layers: Array<{shapes: LottieShape[]}>\n}, toneIndex: number) {\n const replacements = COLORREPLACEMENTS[Math.max(toneIndex - 1, 0)];\n\n const applyTo = (smth: LottieShape) => {\n const k = smth.c.k;\n const color = convert(k[2]) | (convert(k[1]) << 8) | (convert(k[0]) << 16);\n\n const foundReplacement = replacements.find((p) => p[0] === color);\n if(foundReplacement) {\n k[0] = ((foundReplacement[1] >> 16) & 255) / 255;\n k[1] = ((foundReplacement[1] >> 8) & 255) / 255;\n k[2] = (foundReplacement[1] & 255) / 255;\n }\n\n // console.log('foundReplacement!', foundReplacement, color.toString(16), k);\n };\n\n const checkSmth = (smth: LottieShape) => {\n switch(smth.ty) {\n case 'st':\n case 'fl':\n applyTo(smth);\n break;\n }\n\n if(smth.hasOwnProperty('it')) {\n iterateIt(smth.it);\n }\n };\n\n const iterateIt = (it: LottieShape['it']) => {\n for(const smth of it) {\n checkSmth(smth);\n }\n };\n\n try {\n for(const layer of object.layers) {\n if(!layer.shapes) continue;\n\n for(const shape of layer.shapes) {\n if(!shape.it) {\n checkSmth(shape);\n continue;\n }\n\n iterateIt(shape.it);\n }\n }\n } catch(err) {\n console.warn('cant apply replacements', err, object, toneIndex);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport CAN_USE_TRANSFERABLES from '../../environment/canUseTransferables';\nimport IS_IMAGE_BITMAP_SUPPORTED from '../../environment/imageBitmapSupport';\nimport readBlobAsText from '../../helpers/blob/readBlobAsText';\nimport applyReplacements from './applyReplacements';\n\nimportScripts('rlottie-wasm.js');\n// import Module, { allocate, intArrayFromString } from './rlottie-wasm';\n\nconst _Module = (self as any).Module as any;\n\nconst DEFAULT_FPS = 60;\n\ntype LottieHandlePointer = number;\n\n// throw new Error('test');\n\nexport class RLottieItem {\n private stringOnWasmHeap: number;\n private handle: LottieHandlePointer;\n private frameCount: number;\n private fps: number;\n\n private dead: boolean;\n // private context: OffscreenCanvasRenderingContext2D;\n\n private imageData: ImageData;\n\n constructor(\n private reqId: number,\n private width: number,\n private height: number,\n private raw?: boolean/* ,\n private canvas: OffscreenCanvas */\n ) {\n }\n\n public init(json: string, fps: number) {\n if(this.dead) {\n return;\n }\n\n this.fps = Math.max(1, Math.min(60, fps || DEFAULT_FPS));\n\n // this.context = canvas.getContext('2d');\n /* let frame = 0;\n setInterval(() => {\n if(frame >= this.frameCount) frame = 0;\n let _frame = frame++;\n this.render(_frame, null);\n }, 1000 / this.fps); */\n\n try {\n this.handle = worker.Api.init();\n\n // @ts-ignore\n this.stringOnWasmHeap = allocate(intArrayFromString(json), 'i8', 0);\n\n this.frameCount = worker.Api.loadFromData(this.handle, this.stringOnWasmHeap);\n\n worker.Api.resize(this.handle, this.width, this.height);\n\n reply(['loaded', this.reqId, this.frameCount, this.fps]);\n\n if(!this.raw && IS_IMAGE_BITMAP_SUPPORTED) {\n this.imageData = new ImageData(this.width, this.height);\n }\n } catch(e) {\n console.error('init RLottieItem error:', e);\n reply(['error', this.reqId, e]);\n }\n }\n\n public render(frameNo: number, clamped?: Uint8ClampedArray) {\n if(this.dead || this.handle === undefined) return;\n // return;\n\n if(this.frameCount < frameNo || frameNo < 0) {\n return;\n }\n\n try {\n worker.Api.render(this.handle, frameNo);\n\n const bufferPointer = worker.Api.buffer(this.handle);\n\n const data = _Module.HEAPU8.subarray(bufferPointer, bufferPointer + (this.width * this.height * 4));\n\n if(this.imageData) {\n this.imageData.data.set(data);\n createImageBitmap(this.imageData).then((imageBitmap) => {\n reply(['frame', this.reqId, frameNo, imageBitmap], [imageBitmap]);\n });\n } else {\n if(!clamped) {\n clamped = new Uint8ClampedArray(data);\n } else {\n clamped.set(data);\n }\n\n // this.context.putImageData(new ImageData(clamped, this.width, this.height), 0, 0);\n\n reply(['frame', this.reqId, frameNo, clamped], [clamped.buffer]);\n }\n } catch(e) {\n console.error('Render error:', e);\n this.dead = true;\n reply(['error', this.reqId, e]);\n }\n }\n\n public destroy() {\n this.dead = true;\n\n if(this.handle !== undefined) {\n worker.Api.destroy(this.handle);\n }\n }\n}\n\nclass RLottieWorker {\n public Api: {\n init: () => LottieHandlePointer,\n destroy: (handle: LottieHandlePointer) => void,\n resize: (handle: LottieHandlePointer, width: number, height: number) => void,\n buffer: (handle: LottieHandlePointer) => number,\n render: (handle: LottieHandlePointer, frameNo: number) => void,\n loadFromData: (handle: LottieHandlePointer, bufferPointer: number) => number\n } = {} as any;\n\n public initApi() {\n this.Api = {\n init: _Module.cwrap('lottie_init', '', []),\n destroy: _Module.cwrap('lottie_destroy', '', ['number']),\n resize: _Module.cwrap('lottie_resize', '', ['number', 'number', 'number']),\n buffer: _Module.cwrap('lottie_buffer', 'number', ['number']),\n render: _Module.cwrap('lottie_render', '', ['number', 'number']),\n loadFromData: _Module.cwrap('lottie_load_from_data', 'number', ['number', 'number'])\n };\n }\n\n public init() {\n this.initApi();\n reply(['ready']);\n }\n}\n\nconst worker = new RLottieWorker();\n\n_Module.onRuntimeInitialized = function() {\n worker.init();\n};\n\nconst items: {[reqId: string]: RLottieItem} = {};\nconst queryableFunctions = {\n loadFromData: function(reqId: number, blob: Blob, width: number, height: number, toneIndex: number, raw: boolean/* , canvas: OffscreenCanvas */) {\n const item = items[reqId] = new RLottieItem(reqId, width, height, raw/* , canvas */);\n readBlobAsText(blob).then((json) => {\n try {\n if(typeof(toneIndex) === 'number' && toneIndex >= 1 && toneIndex <= 5) {\n /* params.animationData = copy(params.animationData);\n this.applyReplacements(params.animationData, toneIndex); */\n\n const newAnimationData = JSON.parse(json);\n applyReplacements(newAnimationData, toneIndex);\n json = JSON.stringify(newAnimationData);\n }\n\n // ! WARNING, с этой проверкой не все стикеры работают, например - ДУРКА\n /* if(!/\"tgs\":\\s*?1./.test(jsString)) {\n throw new Error('Invalid file');\n } */\n\n /* let perf = performance.now();\n let json = JSON.parse(jsString);\n console.log('sticker decode:', performance.now() - perf); */\n\n const match = json.match(/\"fr\":\\s*?(\\d+?),/);\n const frameRate = +match?.[1] || DEFAULT_FPS;\n\n // console.log('Rendering sticker:', reqId, frameRate, 'now rendered:', Object.keys(items).length);\n\n item.init(json, frameRate);\n } catch(err) {\n console.error('Invalid file for sticker:', json);\n reply(['error', reqId, err]);\n }\n });\n },\n destroy: function(reqId: number) {\n const item = items[reqId];\n if(!item) {\n return;\n }\n\n item.destroy();\n delete items[reqId];\n },\n renderFrame: function(reqId: number, frameNo: number, clamped?: Uint8ClampedArray) {\n // console.log('worker renderFrame', reqId, frameNo, clamped);\n items[reqId].render(frameNo, clamped);\n }\n};\n\nfunction reply(args: any[], transfer?: Transferable[]) {\n postMessage({queryMethodListener: args.shift(), queryMethodArguments: args}, CAN_USE_TRANSFERABLES ? transfer : undefined);\n}\n\nonmessage = function(e) {\n // @ts-ignore\n queryableFunctions[e.data.queryMethod].apply(queryableFunctions, e.data.queryMethodArguments);\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport readBlobAs from './readBlobAs';\n\nexport default function readBlobAsText(blob: Blob) {\n return readBlobAs(blob, 'readAsText');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import { IS_WEB_WORKER } from \"../context\";\n\n// const id = IS_WEB_WORKER ? Math.random() * 0x1000 | 0 : 0;\nexport default function readBlobAs(blob: Blob, method: 'readAsText'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsDataURL'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsArrayBuffer'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsArrayBuffer' | 'readAsText' | 'readAsDataURL'): Promise {\n // const perf = performance.now();\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.addEventListener('loadend', (e) => {\n // console.log(`readBlobAs [${id}] ${method} time ${performance.now() - perf}`);\n resolve(e.target.result);\n });\n reader[method](blob);\n });\n}\n"],"names":["__webpack_require__","oldGetScript","u","oldLoadScript","e","queryMap","countMap","chunkId","hasOwnProperty","catch","error","retries","realSrc","message","request","Promise","resolve","setTimeout","cacheBust","Date","now","window","self","USER_AGENT","navigator","userAgent","IS_SAFARI","search","toLowerCase","indexOf","test","vendor","platform","maxTouchPoints","match","CAN_USE_TRANSFERABLES","undefined","err","COLORREPLACEMENTS","convert","value","Math","round","min","max","importScripts","_Module","Module","RLottieItem","constructor","reqId","width","height","raw","init","json","fps","this","dead","handle","worker","Api","stringOnWasmHeap","allocate","intArrayFromString","frameCount","loadFromData","resize","reply","imageData","ImageData","console","render","frameNo","clamped","bufferPointer","buffer","data","HEAPU8","subarray","set","createImageBitmap","then","imageBitmap","Uint8ClampedArray","destroy","initApi","cwrap","onRuntimeInitialized","items","queryableFunctions","blob","toneIndex","item","method","reader","FileReader","addEventListener","target","result","readBlobAs","readBlobAsText","newAnimationData","JSON","parse","object","replacements","checkSmth","smth","ty","k","c","color","foundReplacement","find","p","applyTo","iterateIt","it","layer","layers","shapes","shape","warn","applyReplacements","stringify","frameRate","renderFrame","args","transfer","postMessage","queryMethodListener","shift","queryMethodArguments","onmessage","queryMethod","apply"],"sourceRoot":""} \ No newline at end of file diff --git a/public/61.043c67ed911cb9f8422c.chunk.js b/public/61.8c05eb6b6906de5287fa.chunk.js similarity index 99% rename from public/61.043c67ed911cb9f8422c.chunk.js rename to public/61.8c05eb6b6906de5287fa.chunk.js index 41a69fb7..407f60bc 100644 --- a/public/61.043c67ed911cb9f8422c.chunk.js +++ b/public/61.8c05eb6b6906de5287fa.chunk.js @@ -1,2 +1,2 @@ (()=>{"use strict";var t,e,r={2061:(t,e,r)=>{let n,a;const o=null;function f(t){return JSON.parse(JSON.stringify(t))}function c(t,e,r,a,o){for(n=0;n=0;--r)e=f(d(t[r],e));return e}function g(t){if(!t)throw Error("assert :P")}const P=function(){function t(t){return t==Ee||t==je||t==Ce||t==Fe}function e(t){return A(t,1)}function r(t,e){const r=1+((t.la-1)*e>>8),n=r<<8;let a=0;for(t.Z>=n?(a=1,t.la-=r,t.Z-=n):(a=0,t.la=r);t.la<128;)t.Z<<=1,t.la<<=1,8==++t.gc&&(t.gc=0,t.bc&&(t.Z+=t.qa[t.Ia++],t.bc--));return a}function P(t,e,r,n){(n-=r)>=2?(t.Z=e[r+0]<<8|e[r+1],t.qa=e,t.Ia=r+2,t.bc=n-2):(t.Z=0,t.qa=o,t.bc=0),t.la=255,t.gc=0}function A(t,e){var n=0,a=0;for(a=e-1;a>=0;a--)n|=r(t,128)<=8&&t.Q>>=8,t.T+=t.qa[t.Ia+t.Q]<<24>>>0,++t.Q,t.g-=8}function y(t){t.g>=8&&w(t),t.Q==t.ya&&32==t.g&&(t.L=1)}function S(t,e){let r=0;if(g(e>=0),!t.L&&e=32&&(t.L=1,t.g+e>32))return r;r=t.T>>t.g&fr[e],t.g+=e,t.g>=8&&t.g>=8&&w(t)}else t.fa=1;return r}function T(t){return t.Pa==t.gb}function R(t,e){return g(t!=o),0==e?0:(t.gb=2*e-1,t.Y=v(t.gb,Dr),t.Y==o?0:(t.Y[0].s=-1,t.Pa=1))}function O(t){t!=o&&(t.Y=o,t.Y=o,t.gb=0,t.Pa=0)}function V(t,e,r,n){for(var a=t.Y,o=0,f=+t.gb;n-- >0;){if(o>=f)return 0;if(a[o].s<0){if(T(t))return 0;const e=t,r=e.Y,n=+e.Pa;a[o].s=n-o,e.Pa+=2,r[n+0].s=-1,r[n+1].s=-1}else if(0==a[o].s)return 0;o+=a[o].s+(r>>n&1)}if(a[o].s<0)a[o].s=0;else if(0!=a[o].s)return 0;return a[o].kc=e,1}function I(t,e,r){var n=0;let a=0,f=0;for(g(t!=o),g(e!=o),n=0;n0&&(++a,f=n);if(!R(t,a))return 0;if(1==a)return f<0||f>=r?(O(t),0):V(t,f,0,0);if(a=0,f=d(r,0),f==o)return(a=a&&T(t))||O(t),a;var c=0;c=0,n=d(pr+1,0);let i=0;const u=d(pr+1,0);let b=0;for(g(e!=o),g(r>0),g(f!=o),c=0;cb&&(b=e[c]);if(b>pr)n=0;else{for(c=0;c0?u[e[c]]++:jr;n=1}if(!n)return(a=a&&T(t))||O(t),a;for(n=0;n0&&!V(t,n,f[n],e[n]))return(a=a&&T(t))||O(t),a;return(a=T(t))||O(t),a}function _(t,e,r,n,a,o,f){var c=0;for(c=0;ct.P.v)&&(r=0==e)){t:{let e=t.Ga;var a=t.G,i=t.ub;r=t.P.l;let h=t.P.v;const v=t.Xb;var u=[o];let p=o,P=h*r;var b=o,s=o;s="WEBP_FILTER_TYPE";let A=0;u=0;var l=0;let k=0;if(g(r>0&&h>0&&n>=r),g(e!=o&&v!=o),i<=Sr)r=0;else if(k=e[a+0]>>0&3,s=e[a+0]>>2&3,A=e[a+0]>>4&3,u=e[a+0]>>6&3,kRr||s>=Sn||A>Or||0!=u)r=0;else{if(k==Tr)l=i>=P,u=e,p=a+Sr;else{if(p=0,(u=d(P,0))==o){r=0;break t}l=a+Sr,i-=Sr,a=u,b=f(tr);let t=0;const n=qt();n==o?l=0:(n.l=r,n.v=h,n.N=b,st(Ve),b.put=Pe,b.Mb=ge,b.Pb=Ae,b.ka=o,b.ka=a,b.fd=0,b.width=r,b.height=h,n.a=ze,m(n.o,e,l,i),n.Wa=An,Jt(r,h,1,n,o)&&Yt(n,r)&&(n.Wa=Pn,t=Ht(n,n.V,n.Ha,n.l,n.v,xt)),n!=o&&Kt(n),l=t)}if(l){for(e=Tn[s],e!=o?((b=d(P,0))==o&&(l=0,k!=Tr&&(p=u=o)),e(u,p,r,h,1,r,b,s=0),P=b,k=s):(P=u,k=p),e=0;h-- >0;)c(v,e,P,k,r),k+=r,e+=n;A==Or&&(l=u==o||p<=0||r<=0?0:1)}r=l}}r=!r}return r?o:0==e?t.Xb:+e*n}function U(t,e,r,n){if(n==o||t<=0||e<=0)return Ke;if(r!=o){if(r.Ua){const n=r.wc,a=r.vc,o=-2&r.t,f=-2&r.k;if(o<0||f<0||n<=0||a<=0||o+n>t||f+a>e)return Ke;t=n,e=a}if(r.I){if(r.Ba<=0||r.Aa<=0)return Ke;t=r.Ba,e=r.Aa}}return n.width=t,n.height=e,function(t){let e=t.width;const r=t.height;let n=t.J;if(e<=0||r<=0||!(n>=Ie&&n=Ie&&f=c*Rn[f],n&=t.ma!=o):(u=(t=t.c.Va).nb*parseInt((i+1)/2,10),b=t.rb*parseInt((i+1)/2,10),s=t.Fa*i,n&=t.F*i<=t.Wc,n&=u<=t.Rc,n&=b<=t.Uc,n&=s<=t.Wb,n&=t.F>=c,n&=t.nb>=parseInt((c+1)/2,10),n&=t.rb>=parseInt((c+1)/2,10),n&=t.y!=o,n&=t.c!=o,n&=t.S!=o,f==Ne&&(n&=t.Fa>=c,n&=s<=t.Wb,n&=t.p!=o)):n=0,n?ze:Ke}(n)}function M(t){return-256&t?t<0?0:255:t}function B(t,e,r,n){const a=d(16,0);let o,f;for(o=0,f=0;f<4;++f){var c=t[e+0]+t[e+8],i=t[e+0]-t[e+8],u=(t[e+4]*Bn>>16)-(t[e+12]*Mn>>16),b=(t[e+4]*Mn>>16)+(t[e+12]*Bn>>16);a[o+0]=c+b,a[o+1]=i+u,a[o+2]=i-u,a[o+3]=c-b,o+=4,e++}for(f=o=0;f<4;++f)c=(t=a[o+0]+4)+a[o+8],i=t-a[o+8],u=(a[o+4]*Bn>>16)-(a[o+12]*Mn>>16),b=(a[o+4]*Mn>>16)+(a[o+12]*Bn>>16),r[n+0+0*en]=M(r[n+0+0*en]+(c+b>>3)),r[n+1+0*en]=M(r[n+1+0*en]+(i+u>>3)),r[n+2+0*en]=M(r[n+2+0*en]+(i-u>>3)),r[n+3+0*en]=M(r[n+3+0*en]+(c-b>>3)),o++,n+=en}function D(t,e,r,n,a){B(t,e,r,n),a&&B(t,e+16,r,n+4)}function E(t,e,r,n){Cn(t,e+0,r,n+0,1),Cn(t,e+32,r,n+4*en,1)}function C(t,e,r,n){let a;for(t=t[e+0]+4,a=0;a<4;++a)for(e=0;e<4;++e)r[n+e+a*en]=M(r[n+e+a*en]+(t>>3))}function F(t,e,r,n){t[e+0]&&C(t,e+0,r,n+0),t[e+16]&&C(t,e+16,r,n+4),t[e+32]&&C(t,e+32,r,n+4*en),t[e+48]&&C(t,e+48,r,n+4*en+4)}function G(t,e,r){const n=e-en,a=Wn,o=255-t[n-1];let f;for(f=0;f>2}function H(t,e,r){let n,a;for(n=0;n<8;++n)for(a=0;a<8;++a)e[r+a+n*en]=t}function z(t,e,r){const n=t[e-r],a=t[e+0],o=3*(a-n)+In[1020+t[e-2*r]-t[e+r]],f=_n[112+(o+4>>3)];t[e-r]=Wn[255+n+_n[112+(o+3>>3)]],t[e+0]=Wn[255+a-f]}function q(t,e,r,n){const a=t[e+0],o=t[e+r];return On[255+t[e-2*r]-t[e-r]]>n||On[255+o-a]>n}function K(t,e,r,n,a){const o=t[e-3*r],f=t[e-2*r],c=t[e-r],i=t[e+0],u=t[e+r],b=t[e+2*r],s=t[e+3*r];return 2*On[255+c-i]+Vn[255+f-u]>n?0:On[255+t[e-4*r]-o]<=a&&On[255+o-f]<=a&&On[255+f-c]<=a&&On[255+s-b]<=a&&On[255+b-u]<=a&&On[255+u-i]<=a}function J(t,e,r,n){let a;for(a=0;a<16;++a)2*On[255+t[e+a-r]-t[e+a+0]]+Vn[255+t[e+a-2*r]-t[e+a+r]]<=n&&z(t,e+a,r)}function Y(t,e,r,n){let a;for(a=0;a<16;++a)2*On[255+t[e+a*r-1]-t[e+a*r+0]]+Vn[255+t[e+a*r-2]-t[e+a*r+1]]<=n&&z(t,e+a*r,1)}function x(t,e,r,n){let a;for(a=3;a>0;--a)J(t,(e+=4*r)+0,r,n)}function Q(t,e,r,n){let a;for(a=3;a>0;--a)Y(t,(e+=4)+0,r,n)}function $(t,e,r,n,a,o,f,c){for(;a-- >0;){if(K(t,e+0,r,o,f))if(q(t,e+0,r,c))z(t,e+0,r);else{const n=t,a=e+0,o=r,f=n[a-2*o],c=n[a-o],u=n[a+0],b=n[a+o],s=n[a+2*o],l=27*(i=In[1020+3*(u-c)+In[1020+f-b]])+63>>7,h=18*i+63>>7;var i=9*i+63>>7;n[a-3*o]=Wn[255+n[a-3*o]+i],n[a-2*o]=Wn[255+f+h],n[a-o]=Wn[255+c+l],n[a+0]=Wn[255+u-l],n[a+o]=Wn[255+b-h],n[a+2*o]=Wn[255+s-i]}e+=n}}function X(t,e,r,n,a,o,f,c){for(;a-- >0;){if(K(t,e+0,r,o,f))if(q(t,e+0,r,c))z(t,e+0,r);else{const n=t,a=e+0,o=r,f=n[a-o],c=n[a+0],u=n[a+o],b=_n[112+(4+(i=3*(c-f))>>3)];var i=_n[112+(i+3>>3)];const s=b+1>>1;n[a-2*o]=Wn[255+n[a-2*o]+s],n[a-o]=Wn[255+f+i],n[a+0]=Wn[255+c-b],n[a+o]=Wn[255+u-s]}e+=n}}function Z(t,e,r,n,a,o){$(t,e+0,r,1,16,n,a,o)}function tt(t,e,r,n,a,o){$(t,e+0,1,r,16,n,a,o)}function et(t,e,r,n,a,o){let f;for(f=3;f>0;--f)X(t,(e+=4*r)+0,r,1,16,n,a,o)}function rt(t,e,r,n,a,o){let f;for(f=3;f>0;--f)X(t,(e+=4)+0,1,r,16,n,a,o)}function nt(t,e,r,n,a,o,f,c){$(t,e,a,1,8,o,f,c),$(r,n,a,1,8,o,f,c)}function at(t,e,r,n,a,o,f,c){$(t,e,1,a,8,o,f,c),$(r,n,1,a,8,o,f,c)}function ot(t,e,r,n,a,o,f,c){X(t,e+4*a,a,1,8,o,f,c),X(r,n+4*a,a,1,8,o,f,c)}function ft(t,e,r,n,a,o,f,c){X(t,e+4,1,a,8,o,f,c),X(r,n+4,1,a,8,o,f,c)}function ct(t,e){return e==Fr?0==t.i?0==t.d?Kr:qr:0==t.d?zr:Fr:e}function it(t,e,r,a){for(n=0;n<4;++n)t[e+n]=r[a+n]}function ut(t,e){return t<0?0:t>e?e:t}function bt(t){t.a="VP8_STATUS_OK",t.xc="OK"}function st(t){t>>>8!=Ve>>>8&&alert("mismatch error")}function lt(t,e,r){return t.a==ze&&(t.a=e,t.xc=r,t.za=0),0}function ht(t,a){let c=[0],i=0;var u=[0],b=f(fn),s=f(cn);let l=f(nr);if(u="VP8StatusCode",b=f(rr),t==o)return alert("(dec == null)"),0;if(bt(t),a==o)return lt(t,"VP8_STATUS_INVALID_PARAM","null VP8Io passed to VP8GetHeaders()");if(b.data=a.data,b.b=a.b,b.e=a.e,b.b=[b.b],b.e=[b.e],(u=ye(b=[b]))!=ze)return lt(t,u,"Incorrect/incomplete header.");if((b=b[0]).b=b.b[0],b.e=b.e[0],b.ia)return lt(t,Je,"Unexpected lossless format encountered.");if(t.Ga==o&&(g(0==t.ub),t.Ga=b.$,t.G=b.G,t.ub=b.pa),i=b.data,c=b.b+b.offset,u=b.e-b.offset,g(b.e>=b.offset),u[0]<4)return lt(t,$e,"Truncated header.");if(l=i[c+0]|i[c+1]<<8|i[c+2]<<16,(b=t.Ac).fb=!(1&l)+0,b.Jc=l>>1&7,b.Nc=l>>4&1,b.Ra=l>>5,b.Jc>3)return lt(t,"VP8_STATUS_BITSTREAM_ERROR","Incorrect keyframe parameters.");if(!b.Nc)return lt(t,"VP8_STATUS_UNSUPPORTED_FEATURE","Frame not displayable.");if(c+=3,u-=3,s=t.P,b.fb){if(u<7)return lt(t,"VP8_STATUS_NOT_ENOUGH_DATA","cannot parse picture header");if(!(u>=3&&157==i[c+0]&&1==i[c+1]&&42==i[c+2]))return lt(t,"VP8_STATUS_BITSTREAM_ERROR","Bad code word");for(s.l=16383&(i[c+4]<<8|i[c+3]),s.gd=i[c+4]>>6,s.v=16383&(i[c+6]<<8|i[c+5]),s.hd=i[c+6]>>6,c+=7,u-=7,t.Ma=s.l+15>>4,t.hb=s.v+15>>4,a.width=s.l,a.height=s.v,a.I=0,a.Ua=0,a.k=0,a.t=0,a.Ka=a.width,a.K=a.height,a.m=a.width,a.h=a.height,l=t.R,n=0;nu)return lt(t,"VP8_STATUS_NOT_ENOUGH_DATA","bad partition length");l=t.o,P(l,i,c,c+b.Ra),c+=b.Ra,u-=b.Ra,b.fb&&(s.uc=e(l),s.$c=e(l)),s=l;var h=t.Ca;let d=t.R;if(g(s!=o),g(h!=o),h.pb=e(s),h.pb){if(h.ob=e(s),e(s)){var v;for(h.tb=e(s),v=0;v0)if(t.Ca.pb)for(d=0;du&&(w=s),P(t.ic[+m],d,v,y),d=w,v=y,h+=3}P(t.ic[+p],d,v,u),u=v0){t.yb[w]=t.yb[0];continue}y=u}const e=t.yb[w];e.sc[0]=oa[ut(y+s,127)],e.sc[1]=fa[ut(y+0,127)],e.sb[0]=2*oa[ut(y+h,127)],e.sb[1]=101581*fa[ut(y+d,127)]>>16,e.sb[1]<8&&(e.sb[1]=8),e.qc[0]=oa[ut(y+v,117)],e.qc[1]=fa[ut(y+p,127)]}if(!b.fb)return lt(t,Ye,"Not a key frame.");for(t.Zc=259,e(l),u=t.R,s=0;s<$r;++s)for(h=0;h0)+0],16==o||!r(t,c[0]))return o}else c=e[sa[o]][0];if(16==o)return 16}}function vt(t,e){return((16777216*t[0]+65536*t[1]+256*t[2]+1*t[3])*pa&4278190080)>>e}function pt(t,e){let a,f=0;if(t==o)return 0;if(e==o)return lt(t,"VP8_STATUS_INVALID_PARAM","NULL VP8Io parameter in VP8Decode().");if(!t.za&&!ht(t,e))return 0;if(g(t.za),e.Mb&&!e.Mb(e))lt(t,Qe,"Frame setup failed"),a=t.a;else{e.Za&&(t.A=0);const r=ea[t.A];2==t.A?(t.lb=0,t.mb=0):(t.lb=e.t-r>>4,t.mb=e.k-r>>4,t.lb<0&&(t.lb=0),t.mb<0&&(t.mb=0)),t.Ya=e.K+15+r>>4,t.wb=e.Ka+15+r>>4,t.wb>t.Ma&&(t.wb=t.Ma),t.Ya>t.hb&&(t.Ya=t.hb),a=ze}if(f=a==ze){if(f){let r,n;t:{if(t.Ja=0,t.qb){const e=t.rc;if(!WebPWorkerReset(e)){r=lt(t,qe,"thread initialization failed.");break t}e.Qd=t,e.Rd=t.oa.N,e.Ud=FinishRow,t.jb=t.A>0?ra:ra-1}else t.jb=na;r=1}if(!(n=!r)){let e;t:{const r=t.jb,n=t.Ma,a=4*n,f=32*n,c=n+1,i=t.A>0?n*(t.qb?2:1):0,s=rn,l=f*(16*r+parseInt(3*ea[t.A]/2,10)),h=t.Ga!=o?t.P.l*t.P.v:0,v=a+f+c+i+s+384+l+h+ta;if(v!=v)e=0;else{if(v>t.Gb){if(t.ib=0,t.Gb=0,t.ib==o){e=lt(t,"VP8_STATUS_OUT_OF_MEMORY","no memory during frame initialization.");break t}t.Gb=v}t.dc=205,t.Xc=b(205,16*n),t.Sc=b(205,8*n),t.Vc=b(205,8*n),t.M=i?u(ln,i):o,t.Sd=i?0:o,t.oa.ha=0,t.oa.M=t.M,g(0==(s&ta)),t.Ea=b(205,1*s),t.z=-12851,t.H=16*n,t.r=8*n;const f=ea[t.A],p=f*t.H,P=f/2*t.r;t.ca=d(l,205),t.da=+p,t.aa=t.ca,t.ba=t.da+16*r*t.H+P,t.ra=t.aa,t.sa=t.ba+8*r*t.r+P,t.Xb=h?d(h,0):o,t.La=u(hn,c),t.dc=b(Fr,a),e=1}}n=!e}if(n)f=0;else{if(e.width=t.P.l,e.height=t.P.v,e.w=0,e.y=t.ca,e.D=t.da,e.c=t.aa,e.B=t.ba,e.S=t.ra,e.C=t.sa,e.F=t.H,e.Da=t.r,e.p=o,e.q=o,!Un){let t;for(t=-255;t<=255;++t)On[255+t]=t<0?-t:t,Vn[255+t]=On[255+t]>>1;for(t=-1020;t<=1020;++t)In[1020+t]=t<-128?-128:t>127?127:t;for(t=-112;t<=112;++t)_n[112+t]=t<-16?-16:t>15?15:t;for(t=-255;t<=510;++t)Wn[255+t]=t<0?0:t>255?255:t;Un=1}Cn=D,Fn=E,Gn=C,Nn=F,Ln=Z,Hn=tt,zn=nt,qn=at,Kn=et,Jn=rt,Yn=ot,xn=ft,Qn=J,$n=Y,Xn=x,Zn=Q,f=1}}if(f)t:{for(t.d=0;t.d0&&u.d>=u.mb&&u.d<=u.Ya)+0,t.i=0;t.i0);A=-k,W[W[W.length-1]+P]=A,h[v]=A,v++}D[p]=A}}else{for(A=r(u,156)?r(u,128)?Hr:Lr:r(u,163)?Nr:Gr,e.Eb[0]=A,k=0;k<4;++k)W[k+W[W.length-1]]=A;for(k=0;k<4;++k)D[k]=A}if(e.Tc=r(u,142)?r(u,114)?r(u,183)?Hr:Lr:Nr:Gr,u.Ab)s=0;else{if(g.Nb)l.X=g.X=0,e.wa||(l.ua=g.ua=0),e.ja=0,e.Oa=0;else{let t=0,r=0;var m=0,w=da;const n=e.yb[e.Lb];var y=e.z;const a=e.La[0],f=d(4,0),c=d(4,0);let u=d(4,0),s=d(4,0),l=0,h=0;var S=0;let v=0,p=0;if(y=b(0,384),e.wa)m=0,w=e.R.z[3];else{const t=d(16,0);var T=g.ua+a.ua;g.ua=a.ua=(dt(o,e.R.z[1],T,n.sb,0,t)>0)+0,m=1,w=e.R.z[0];var R=t,O=y,V=d(16,0),I=0;for(I=0;I<4;++I){var _=R[0+I]+R[12+I],U=R[4+I]+R[8+I],M=R[4+I]-R[8+I],B=R[0+I]-R[12+I];V[0+I]=_+U,V[8+I]=_-U,V[4+I]=B+M,V[12+I]=B-M}for(I=0;I<4;++I){const t=O[O.length-1],e=V[0+4*I]+3;_=e+V[3+4*I],U=V[1+4*I]+V[2+4*I],M=V[1+4*I]-V[2+4*I],B=e-V[3+4*I],O[t+0]=_+U>>3,O[t+16]=B+M>>3,O[t+32]=_-U>>3,O[t+48]=B-M>>3,O[O.length-1]+=64}y[y.length-1]=0}for(u=i(va[15&g.X]),s=i(va[15&a.X]),v=0;v<4;++v){var j=s[v];for(S=0;S<4;++S){var G=dt(o,w,T=j+u[S],n.sc,m,y);u[S]=j=(G>0)+0,c[S]=(0!=y[y[y.length-1]+0])+0,f[S]=(G>1)+0,y[y.length-1]+=16}s[v]=j,h|=vt(c,24-4*v),l|=vt(f,24-4*v)}for(t=vt(u,24),r=vt(s,24),u=i(va[g.X>>4]),s=i(va[a.X>>4]),p=0;p<4;p+=2){for(v=0;v<2;++v){for(j=s[p+v],S=0;S<2;++S)T=j+u[p+S],G=dt(o,e.R.z[2],T,n.qc,0,y),u[p+S]=j=(G>0)+0,c[2*v+S]=(0!=y[y[y.length-1]+0])+0,f[2*v+S]=(G>1)+0,y[y.length-1]+=16;s[p+v]=j}h|=vt(c,8-2*p),l|=vt(f,8-2*p)}t|=vt(u,20),r|=vt(s,20),g.X=t,a.X=r,e.z=y,e.Oa=l+0,e.ja=l|h,g.Nb=!e.ja+0}s=!o.Ab}if(!s){f=lt(t,"VP8_STATUS_NOT_ENOUGH_DATA",`Premature end-of-file encountered.${t.i} ${t.d}`);break t}const E=t,C=E.Ea,F=nn,J=E.Ea,Y=an,x=E.Ea,Q=on;if(E.i>0){var N=0;for(N=-1;N<16;++N)it(C,F+N*en-4,C,F+N*en+12);for(N=-1;N<8;++N)it(J,Y+N*en-4,J,Y+N*en+4),it(x,Q+N*en-4,x,Q+N*en+4)}else{for(N=0;N<16;++N)C[F+N*en-1]=129;for(N=0;N<8;++N)J[Y+N*en-1]=129,x[Q+N*en-1]=129;E.d>0&&(C[F-1-en]=J[Y-1-en]=x[Q-1-en]=129)}const Z=E.Xc,tt=16*+E.i,et=E.Sc,rt=8*+E.i,nt=E.Vc,at=8*+E.i,ot=E.z;let ft=0;if(E.d>0)c(C,F-en,Z,tt,16),c(J,Y-en,et,rt,8),c(x,Q-en,nt,at,8);else if(0==E.i){for(n=0;n<21;++n)C[F-en-1+n]=127;for(n=0;n<9;++n)J[Y-en-1+n]=127;for(n=0;n<9;++n)x[Q-en-1+n]=127}if(E.wa){const t=F-en+16;E.d>0&&(E.i>=E.Ma-1?C[t+0]=C[t+1]=C[t+2]=C[t+3]=Z[tt+15]:c(C,t+0,Z,tt+16,4));for(let e=0;e<4;++e)C[e+t+4*en]=C[e+t+4*en]=C[e+t+8*en]=C[e+t+12*en]=C[e+t+0];for(ft=0;ft<16;ft++){var L=C,H=F+aa[ft];Dn[E.Eb[ft]](L,H),E.Oa&1<0){const t=ht.M[1+ht.i],e=ht.La[1+ht.i].Nb;let r=ht.Zb[ht.Lb];ht.ga.oc&&(r+=ht.ga.Lc[0],ht.wa&&(r+=ht.ga.Gc[0])),r=r<0?0:r>63?63:r,t.zc=r,ht.ga.kb>0&&(r=ht.ga.kb>4?r>>2:r>>1,r>9-ht.ga.kb&&(r=9-ht.ga.kb)),t.yc=r<1?1:r,t.ab=(!e||ht.wa)+0}var K=0,$=8*ht.Ja*ht.r,X=ht.ca,ut=ht.da+16*ht.i+16*ht.Ja*ht.H,bt=ht.aa,st=ht.ba+8*ht.i+$,pt=ht.ra,Pt=ht.sa+8*ht.i+$;for(K=0;K<16;++K)c(X,ut+K*ht.H,ht.Ea,+nn+K*en,16);for(K=0;K<8;++K)c(bt,st+K*ht.r,ht.Ea,+an+K*en,8),c(pt,Pt+K*ht.r,ht.Ea,+on+K*en,8)}const E=t,C=e;var At=1;const F=E.oa;if(E.qb){const t=E.rc;if(At&=WebPWorkerSync(t),g(t.a==OK),At){if(F.N=C,F.ha=E.Ja,F.d=E.d,F.W=E.W,F.W){const t=F.M;F.M=E.M,E.M=t}WebPWorkerLaunch(t),++E.Ja==E.jb&&(E.Ja=0)}}else{F.d=E.d,F.W=E.W;e:{let t=1;const e=E.oa,r=ea[E.A],n=r*E.H,a=parseInt(r/2)*E.r,f=16*e.ha*E.H,i=8*e.ha*E.r,u=E.ca,b=E.da-n+f,s=E.aa,l=E.ba-a+i,h=E.ra,d=E.sa-a+i,v=0==e.d,p=(e.d>=E.hb-1)+0;var kt=16*e.d;let P=16*(e.d+1);if(e.W){const t=E;let e=0;const r=t.oa.d;for(g(t.oa.W),e=t.lb;e0&&$n(u,b,c,h+4),i.ab&&Zn(u,b,c,h),o>0&&Qn(u,b,c,h+4),i.ab&&Xn(u,b,c,h);else{const t=n.r,e=n.aa,r=n.ba+8*f.ha*t+8*a,d=n.ra,v=n.sa+8*f.ha*t+8*a,p=n.Ac.fb?s>=40?2:s>=15?1:0:s>=40?3:s>=20?2:s>=15?1:0;a>0&&(Hn(u,b,c,h+4,l,p),qn(e,r,d,v,t,h+4,l,p)),i.ab&&(Jn(u,b,c,h,l,p),xn(e,r,d,v,t,h,l,p)),o>0&&(Ln(u,b,c,h+4,l,p),zn(e,r,d,v,t,h+4,l,p)),i.ab&&(Kn(u,b,c,h,l,p),Yn(e,r,d,v,t,h,l,p))}}}if(C.put){if(v?(C.y=E.ca,C.D=E.da+f,C.c=E.aa,C.B=E.ba+i,C.S=E.ra,C.C=E.sa+i):(kt-=r,C.y=u,C.D=b,C.c=s,C.B=l,C.S=h,C.C=d),p||(P-=r),P>C.K&&(P=C.K),E.Ga!=o&&kt>1),C.C+=E.r*(t>>1),C.p!=o&&(C.q+=C.width*t)}kt>1,C.C+=C.t>>1,C.p!=o&&(C.q+=C.t),C.w=kt-C.k,C.m=C.Ka-C.t,C.h=P-kt,t=C.put(C))}e.ha+1==E.jb&&!p&&(c(E.ca,E.da-n,u,b+16*E.H,n),c(E.aa,E.ba-a,s,l+8*E.r,a),c(E.ra,E.sa-a,h,d+8*E.r,a)),At=t}}if(!At){f=lt(t,"VP8_STATUS_USER_ABORT","Output aborted.");break t}}let a;if(!(a=t.qb&&!WebPWorkerSync(t.rc))){let e;(e=t.fc>0)&&(g(t),g(t.fc>0),e=!1),a=e}f=a?0:1}const a=f;e.Pb&&e.Pb(e),f=1&a}return f?(t.za=0,f):(gt(t),0)}function gt(t){t!=o&&(t.ib&&(t.ib=0),t.ib=o,t.Gb=0,t.za=0)}function Pt(t,e){return t+(1<>e}function At(t,e,r,n,a){const o=Ga[r]+Na[e]>>ga;e=Fa[e],n[a+0]=La[t+Ca[r]-Pa],n[a+1]=La[t+o-Pa],n[a+2]=La[t+e-Pa]}function kt(t,e,r,n,a){const o=Ga[r]+Na[e]>>ga;e=Fa[e],n[a+0]=248&La[t+Ca[r]-Pa]|La[t+o-Pa]>>5,n[a+1]=La[t+o-Pa]<<3&224|La[t+e-Pa]>>3}function mt(t,e,r,n,a){n[a+0]=255,At(t,e,r,n,a+1)}function wt(t,e,r,n,a){const o=Fa[e];n[a+0]=Ha[t+Ca[r]-Pa]<<4|Ha[t+(Ga[r]+Na[e]>>ga)-Pa],n[a+1]=15|Ha[t+o-Pa]<<4}function yt(t,e,r,n,a){const o=Ca[r];r=Ga[r]+Na[e]>>ga,n[a+0]=La[t+Fa[e]-Pa],n[a+1]=La[t+r-Pa],n[a+2]=La[t+o-Pa]}function St(t,e,r,n,a){yt(t,e,r,n,a),n[a+3]=255}function Tt(t,e,r,n,a){At(t,e,r,n,a),n[a+3]=255}function Rt(t,e,r){t[e]=((((4278255360&t[e])>>>0)+((4278255360&r)>>>0)&4278255360)>>>0|(16711935&t[e])+(16711935&r)&16711935)>>>0}function Ot(t,e){return((4278124286&(t^e))>>>1)+((t&e)>>>0)>>>0}function Vt(t){return t<256&&t>0?t:t<=0?0:~t>>24&255}function It(t,e){return Vt(t+parseInt((t-e)/2,10))}function _t(){return dr}function Wt(t,e){return(t&=255)>127&&(t-=256),(e&=255)>127&&(e-=256),t*e>>>5}function Ut(t,e,r,n,a,o,f){var c=0;const i=8>>t.n,u=t.U,b=t.u;if(i<8){t=(1<>8&255),o[f++]=b[e&s],e>>=i}}else for(c=e;c>8&255]}function Mt(t,e,r,n,a){for(r=e+r;e>16&255,n[a++]=r>>8&255,n[a++]=r>>0&255,n[a++]=r>>24&255}}function Bt(t,e,r,n,a){for(r=e+r;e>16&240|r>>12&15,n[a++]=r>>0&240|r>>28&15}}function Dt(t,e,r,n,a){for(r=e+r;e>24&255,n[a++]=r>>16&255,n[a++]=r>>8&255,n[a++]=r>>0&255}}function Et(t,e,r,n){return S(t,8)!=ir?0:(e[0]=S(t,ur)+1,r[0]=S(t,ur)+1,n[0]=S(t,1),S(t,br),1)}function jt(t,e){let r=0;return t<4?t+1:(r=t-2>>1,(2+(1&t)<e.ya){var r=t.Y,n=0;for(g(r!=o);0!=r[n].s;){var a=r,f=e;const t=f.T>>f.g&1;f.L?f.fa=1:(++f.g,f.g>=8&&w(f),f.Q==f.ya&&32==f.g&&(f.L=1)),n=n+a[n].s+t}return r[n].kc}for(n=0,g((r=t.Y)!=o);0!=r[n].s;)a=r,f=e.T>>e.g&1,++e.g,n=n+a[n].s+f;return r[n].kc}function Ft(t,e){if(t!=o){var r=0,n=0;for(r=0;r>t.eb)+(e>>t.eb)])0;){e=t.nc[a];let O=i;var h=b,d=l;switch(l=n,b=r,g(O<(v=u)),g(v<=e.Vb),e.Qc){case wr:for(h=0,e=b+(v-O)*e.U;b>8&255,P=16711935&(P=(P=(16711935&v[d])>>>0)+(p<<16|p));l[b++]=((4278255360&v[d])>>>0|P)>>>0,32==O&&h++}break;case kr:var A=O;if(h=v,d=l,p=b,P=(S=e).U,0==A){var k=0;for(Rt(d,p,dr),k=1;k>S.n)*w;A>8&15],k=1;k>8&15]),e=t(d[p+k-1],d,p+k-P),Rt(d,p+k,e)}p+=P,0==(++A&m)&&(S+=w)}v!=e.Vb&&c(l,b-(e=e.U),l,b+(v-O-1)*e,e);break;case mr:for(h=e.U,d=(1<>e.n)*p;O>0&255,S.Bc=y>>8&255,S.Kc=y>>16&255),S=(y=l[b+w])>>>8,T=y>>>16,R=y,T+=Wt(m.Cc,S),T&=255,R+=Wt(m.Bc,S),R+=Wt(m.Kc,T),R&=255,l[b+w]=(4278255360&y|T<<16|R)>>>0;b+=h,++O,0==(O&d)&&(e+=p)}break;case yr:h==l&&e.n>0?(h=(v-O)*Pt(e.U,e.n),s(l,d=b+(v-O)*e.U-h,l,b,h),Ut(e,O,v,l,d,l,b)):Ut(e,O,v,h,d,l,b)}b=n,l=r}}function Lt(t,e){var r=t.V,n=t.Ha+t.l*t.O;if(!((o=e-t.O)<=0)){Nt(t,o,r,n);var a=t.N;r=t.Xa;let l=[t.vb];n=t.O;var o=e,f=l,c=a.width;if(g(na.K&&(o=a.K),n=o?n=0:(f[0]+=a.t,a.w=n-a.k,a.m=a.Ka-a.t,a.h=o-n,n=1),n){if(l=l[0],n=t.Ib,o=a.width,n.J0;){const t=r;let n=l,a=i;const b=f;let h=e;switch(c){case Ie:for(a=n+a;n>16&255,b[h++]=s>>8&255,b[h++]=s>>0&255}break;case _e:Mt(t,n,a,b,h);break;case Ee:Mt(t,n,a,b,h),WebPApplyAlphaMultiply(b,0,a,1,0);break;case We:for(a=n+a;n>0&255,b[h++]=s>>8&255,b[h++]=s>>16&255;break;case Ue:Dt(t,n,a,b,h);break;case je:Dt(t,n,a,b,h),WebPApplyAlphaMultiply(b,0,a,1,0);break;case Me:Dt(t,n,a,b,h);break;case Ce:Dt(t,n,a,b,h),WebPApplyAlphaMultiply(b,1,a,1,0);break;case Be:Bt(t,n,a,b,h);break;case Fe:Bt(t,n,a,b,h),WebPApplyAlphaMultiply4444(b,a,1,0);break;case De:for(a=n+a;n>16&248|s>>13&7,b[h++]=s>>5&224|s>>3&31;break;default:g(0)}l+=o,e+=u}r=a}t.xa+=r}else t.xa=a.I?EmitRescaledRowsYUVA(t,r,l,o,a.h):EmitRowsYUVA(t,r,l,o,a.m,a.h);g(t.xa<=n.height)}t.O=e,g(t.O<=t.v)}}function Ht(t,e,r,n,a,f){let c=1,i=0,u=0;const b=t.o,s=t.cb;let l=s.Db,h=r,d=r;r+=n*a;const v=(a=gr+Pr)+s.xb,p=s.xb>0?s.Yb:o,P=s.Dc;let A=!1;for(g(l!=o);!b.L&&h>>0)+(A<<16)+(c<<8)+k}if(A=!1,++h,++i,i>=n&&(i=0,++u,f!=o&&u%wa==0&&f(t,u),p!=o))for(;d>>p.bb]=c}else if(wDa?k-=Da:(w=Ea[k-1],w=(w>>4)*n+(8-(15&w)),k=w>=1?w:1),w=0,w=0;w=n;)i-=n,++u,f!=o&&u%wa==0&&f(t,u);if(h>>p.bb]=c}else if(w>>p.bb]=w;w=e,k=h,g(A<=-1>>>(m=p).bb),w[k]=m.ea[A],A=!0;continue}(c=!b.fa)||End}return f!=o&&f(t,u),b.fa||!c||b.L&&h16?0:h>4?1:h>2?2:3,l[0]=Pt(c.U,p),c.n=p,l=p=Jt(h,1,0,_,c.u))if(l=h,p=0,h=1<<(8>>>(_=c).n)>>>0,(P=Array(h))==o)l=0;else{A=_.u[0];var k=_.b;for(P[0]=_.u[0][_.b+0],p=1;p>>0)+((4278255360&P[p-1])>>>0)&4278255360)>>>0|(16711935&A[k+p])+(16711935&P[p-1])&16711935)>>>0;for(;p=1&&s<=lr)){n.a=Je;break}if(c)t:{c=n;var m=t[0],w=e[0],_=(l=s,k=A=0,k=c.o,c.cb);if(p=[o],h=o,P=1,r&&S(k,1)){if(w=(m=Pt(m,A=S(k,3)+2))*(W=Pt(w,A)),!Jt(m,W,0,c,p)){c.a=Je,Ft(h,P),c=0;break t}for(p=p[0],_.eb=A,A=0;A>>8&65535,p[A]=m,m>=P&&(P=m+1)}if(k.fa)Ft(h,P),c=0;else if(g(P<=65536),(h=v(P,mn))==o)c.a=qe,Ft(h,P),c=0;else{for(A=0;A0&&(m+=1<=t){(E=E&&T(e))||O(e),U=E;break r}if(!V(e,M[j],B[j],D[j])){(E=E&&T(e))||O(e),U=E;break r}}(E=(E=1)&&T(e))||O(e),U=E}else U=0}}else{if(U=0,B=[],(M=S(W,4)+4)>Ma){m.a=Je,m=0;break e}if((D=Array(t))==o){m.a=qe,m=0;break e}for(U=0;UB){U.a=Je,O(a),U=E;break r}}else r=B;for(e=0;eB){U.a=Je,O(a),U=E;break r}for(C=C?n:0;F-- >0;)M[e++]=C}}E=1,O(a),U=E}else U.a=Je,U=0}U&&(U=I(e,D,t))}(U=U&&!W.fa)?m=1:(m.a=Je,m=0)}if(!m){Ft(h,P),c=0;break t}}_.ac=p,_.hc=P,_.Db=h,c=1}}if(!c){n.a=Je;break}if(s>0){if(u.xb=1<0),l.ea=d(_,0),l.ea==o?s=0:(l.bb=32-s,s=1),!s){n.a=qe,c=0;break}}else u.xb=0;if(s=n,l=t[0],_=e[0],h=(p=s.cb).eb,s.l=l,s.v=_,p.Ec=Pt(l,h),p.Dc=0==h?-1:(1<>>8&255;t.O=t.xa=e}}function ut(t,e){return t<0?0:t>e?e:t}function Qt(t,e,r,n,a,o,f,c,i,u,b,s,l,h,d,v,p,g,P){let A;const k=p-1>>1;let m=a[o+0]|f[c+0]<<16,w=i[u+0]|b[s+0]<<16;if(t){var y=3*m+w+131074>>2;g(t[e+0],255&y,y>>16,l,h)}for(r&&(y=3*w+m+131074>>2,g(r[n+0],255&y,y>>16,d,v)),A=1;A<=k;++A){const p=a[o+A]|f[c+A]<<16,k=i[u+A]|b[s+A]<<16,S=(y=m+p+w+k+524296)+2*(p+w)>>3,T=y+2*(m+k)>>3;t&&(y=S+m>>1,m=T+p>>1,g(t[e+2*A-1],255&y,y>>16,l,h+(2*A-1)*P),g(t[e+2*A-0],255&m,m>>16,l,h+(2*A-0)*P)),r&&(y=T+w>>1,m=S+k>>1,g(r[n+2*A-1],255&y,y>>16,d,v+(2*A-1)*P),g(r[n+2*A+0],255&m,m>>16,d,v+(2*A+0)*P)),m=p,w=k}1&p||(t&&(y=3*m+w+131074>>2,g(t[e+p-1],255&y,y>>16,l,h+(p-1)*P)),r&&(y=3*w+m+131074>>2,g(r[n+p-1],255&y,y>>16,d,v+(p-1)*P)))}function $t(t,e,r,n,a,o,f,c,i,u,b,s,l,h,d,v,p){Qt(t,e,r,n,a,o,f,c,i,u,b,s,l,h,d,v,p,At,3)}function Xt(t,e,r,n,a,o,f,c,i,u,b,s,l,h,d,v,p){Qt(t,e,r,n,a,o,f,c,i,u,b,s,l,h,d,v,p,yt,3)}function Zt(t,e,r,n,a,o,f,c,i,u,b,s,l,h,d,v,p){Qt(t,e,r,n,a,o,f,c,i,u,b,s,l,h,d,v,p,Tt,4)}function te(t,e,r,n,a,o,f,c,i,u,b,s,l,h,d,v,p){Qt(t,e,r,n,a,o,f,c,i,u,b,s,l,h,d,v,p,St,4)}function ee(t,e,r,n,a,o,f,c,i,u,b,s,l,h,d,v,p){Qt(t,e,r,n,a,o,f,c,i,u,b,s,l,h,d,v,p,mt,4)}function re(t,e,r,n,a,o,f,c,i,u,b,s,l,h,d,v,p){Qt(t,e,r,n,a,o,f,c,i,u,b,s,l,h,d,v,p,wt,2)}function ne(t,e,r,n,a,o,f,c,i,u,b,s,l,h,d,v,p){Qt(t,e,r,n,a,o,f,c,i,u,b,s,l,h,d,v,p,kt,2)}function ae(t,e,r,n,a,o,f,c,i,u,b,s,l,h,d){let v;for(v=0;v0;){var f=t,c=e+(r?1:0),i=t,u=e+(r?0:3),b=0;for(b=0;b>1)*r.nb,i=r.S,u=r.C+(t.w>>1)*r.rb,b=t.m,s=t.h,l=parseInt((b+1)/2,10),h=parseInt((s+1)/2,10);let d;for(d=0;d>4;b[s+2*h]=240&b[s+2*h]|t,l&=t}a+=e.width,s+=i.f}15!=l&&t(c)&&WebPApplyAlphaMultiply4444(b,f,o,u,i.f)}return 0}function ge(e){let r=e.ka;const n=r.j.J,a=n>1,n=e.m+2*t;let a;const f=[];for(a=0;a>ga,Na[e]=-22014*(e-128)+ja,Ga[e]=-45773*(e-128),Fa[e]=113618*(e-128)+ja>>ga;for(e=Pa;e>ga,La[e-Pa]=ut(r,255),Ha[e-Pa]=ut(r+8>>4,15);za=1}return 1}function Pe(t){const e=t.ka;let r=t.m;const n=t.h;return g(!(1&t.w)),r<=0||n<=0?0:(r=e.$a(t,e),e.ec+=r,e.zb&&e.zb(t,e),1)}function Ae(t){(t=t.ka).memory="",t.memory=o}function ke(t,e){return t[e+0]|t[e+1]<<8|t[e+2]<<16}function me(t,e){return(ke(t,e)|t[e+3]<<24)>>>0}function we(t,e,r,n,a,c,i){var u=0,b=[0],s="VP8StatusCode";const l=f(rr);if(t==o||r[0]<_r)return $e;l.data=t,l.b=[e[0]],l.e=[r[0]],l.na=[l.na];t:{if(u=l.na,g(t!=o),g(r!=o),g(u!=o),u[0]=0,r[0]>=_r&&!h(t,e[0],"RIFF",Vr)){if(h(t,e[0]+8,"WEBP",Vr)){s=Je;break t}if((P=me(t,e[0]+Vr))0,P=[0];t:if(s=Ir+Wr,g(t!=o),g(r!=o),g(b!=o),b[0]=0,r[0]=Mr){s=Je;break t}P!=o&&(P[0]=p),n!=o&&(n[0]=d),a!=o&&(a[0]=v),e[0]+=s,r[0]-=s,b[0]=1}s=ze}if(s!=ze)return s;if(!u&&b[0])return Je;if(c!=o&&(c[0]=!!(P[0]&Ur)),b&&i==o)return ze;if(r0&&n>b){s=Je;break t}if(p=d&&v>b-d){s=Je;break t}u[0]=v,e[0]+=Ir,r[0]-=Ir,P[0]=s}else P[0]=r>=1&&t[e+0]==ir,u[0]=r[0];s=ze}if(l.ta=l.ta[0],l.ia=l.ia[0],s!=ze)return s;if(l.ta>Br)return Je;if(l.ia){if(r[0]=3&&157==t[b+3+0]&&1==t[b+3+1]&&42==t[b+3+2]?(u=t[b+0]|t[b+1]<<8|t[b+2]<<16,P=16383&(t[b+7]<<8|t[b+6]),t=16383&(t[b+9]<<8|t[b+8]),!(!(1&u)+0)||(u>>1&7)>3||!(u>>4&1)||u>>5>=l.ta?t=0:(n&&(n[0]=P),a&&(a[0]=t),t=1)):t=0}return t?(c!=o&&(c[0]|=l.$!=o),i!=o&&(i[0]=l,i[0].offset=e[0]-i[0].b,g(e[0]-i[0].b0,e.Ua&&(i=t.wc,u=t.vc,f=t.t,c=t.k,rn||c+u>a))return 0;if(e.t=f,e.k=c,e.Ka=f+i,e.K=c+u,e.m=i,e.h=u,e.I=t!=o&&t.I>0,e.I){if(t.Ba<=0||t.Aa<=0)return 0;e.Ba=t.Ba,e.Aa=t.Aa}return e.Za=t&&t.Za,e.Bb=t==o||!t.ed,e.I&&(e.Za=e.Ba<3*n/4&&e.Aa<3*a/4,e.Bb=0),1}var Ve=512,Ie=0,_e=1,We=2,Ue=3,Me=4,Be=5,De=6,Ee=7,je=8,Ce=9,Fe=10,Ge=11,Ne=12,Le=13;this.WEBP_CSP_MODE=this.Cd={nd:0,od:1,kd:2,ld:3,jd:4,pd:5,qd:6,rd:7,sd:8,md:9};var He={J:"WEBP_CSP_MODE",width:0,height:0,Fc:0,c:{RGBA:{ma:0,Sa:0,f:0,size:0},Va:{y:0,c:0,S:0,p:0,D:0,B:0,C:0,q:0,F:0,nb:0,rb:0,Fa:0,Wc:0,Rc:0,Uc:0,Wb:0}},Ic:d(4,0),Jb:o,jc:0},ze=0,qe=1,Ke=2,Je=3,Ye=4,xe=5,Qe=6,$e=7;this.VP8StatusCode=this.td={xd:0,yd:1,vd:2,ud:3,Ad:4,zd:5,Bd:6,wd:7};var Xe={width:{value:0},height:{value:0},$b:{value:0},tc:0,Yd:0,rotate:0,be:0,Ic:d(3,0)};this.WebPGetFeatures=this.Md=function(t,e,r){let n="VP8StatusCode";return Ve>>>8!=Ve>>>8||r==o?t=Ke:(n=Re(t,[0],e=[e],r),t=n==$e?Je:n),t};const Ze={Za:0,ed:0,Ua:0,t:0,k:0,wc:0,vc:0,I:0,Ba:0,Aa:0,ae:0,Td:0,Xd:0,Ic:d(6,0)};this.WebPDecoderConfig=this.Kd={input:f(Xe),j:f(He),options:f(Ze)},this.WebPInitDecoderConfig=this.Nd=function(t){return Ve>>>8!=Ve>>>8||t==o?t=0:(g((t=t.input)!=o),t.tc=0,t=1),t};var tr={width:0,height:0,w:0,m:0,h:0,y:0,c:0,S:0,D:0,B:0,C:0,F:0,Da:0,ka:0,put:0,Mb:0,Pb:0,Bb:0,e:0,data:0,b:0,Za:0,Ua:0,t:0,Ka:0,k:0,K:0,I:0,Ba:0,Aa:0,p:0,q:0},er={j:f(He),Sb:0,Qb:0,lc:0,Tb:0,Rb:0,mc:0,ec:0,Qa:f(Ze),memory:0,$a:"(OutputFunc)",zb:"(OutputFunc)",ad:"(OutputRowFunc)"},rr={data:0,b:0,e:0,offset:0,$:o,G:0,pa:0,ta:0,na:0,ia:0},nr={qa:0,Ia:o,Pd:0,Ab:0,la:0,Z:0,gc:0},ar={T:0,qa:0,Ia:0,ya:0,Q:0,g:0,L:0,fa:0},or=25,fr=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],cr=10,ir=47,ur=14,br=3,sr=5,lr=11,hr=5,dr=4278190080,vr=8,pr=15,gr=256,Pr=24,Ar=4,kr=0,mr=1,wr=2,yr=3,Sr=1,Tr=0,Rr=1,Or=1,Vr=4,Ir=8,_r=12,Wr=10,Ur=16,Mr=1*Math.pow(2,32),Br=-1-Ir-1>>>0,Dr={kc:0,s:0},Er={Y:"HuffmanTreeNode*",gb:0,Pa:0},jr=-1;var Cr=506832829,Fr=0,Gr=Fr,Nr=2,Lr=3,Hr=1,zr=4,qr=5,Kr=6,Jr=3,Yr=4,xr=4,Qr=4,$r=4,Xr=8,Zr=3,tn=11,en=32,rn=17*en+9*en,nn=1*en+8,an=nn+16*en+en,on=an+16,fn={fb:0,Jc:0,Nc:0,Ra:0},cn={l:0,v:0,gd:0,hd:0,uc:0,$c:0};const un={pb:0,ob:0,tb:0,Kb:d(Yr,0),Cb:d(Yr,0)},bn={Ta:d(Jr,0),z:p([$r,Xr,Zr,tn],0)},sn={Oc:0,Fb:0,kb:0,oc:0,Lc:d(xr,0),Gc:d(xr,0)};var ln={zc:0,yc:0,ab:0},hn={X:0,ua:0,Nb:0};const dn=d(2,0),vn={sc:f(dn),sb:f(dn),qc:f(dn)},pn={ha:0,d:0,W:0,M:ln,N:tr};var gn={a:"VP8StatusCode",za:0,xc:0,o:f(nr),Ac:f(fn),P:f(cn),ga:f(sn),Ca:f(un),rc:"WebPWorker",qb:0,Ja:0,jb:0,oa:pn,Ma:0,hb:0,lb:0,mb:0,wb:0,Ya:0,Hb:0,ic:v(8,nr),Zc:0,yb:v(Yr,vn),R:f(bn),pc:0,Pc:0,dc:0,cc:d(4,0),Xc:0,Sc:0,Vc:0,La:f(hn),M:f(ln),Ea:0,z:0,ca:0,aa:0,ra:0,da:0,ba:0,sa:0,H:0,r:0,ib:0,Gb:0,i:0,d:0,wa:0,Eb:d(16,0),Vd:0,Tc:0,Lb:0,ja:0,Oa:0,A:0,W:0,Zb:d(Yr,0),Ga:o,G:0,ub:0,Xb:0,Od:0,cd:0,dd:0,Wd:0,fc:0},Pn=0,An=1,kn=2;var mn={va:v(hr,Er)};const wn={xb:0,Yb:f({ea:0,bb:0}),Dc:0,eb:0,Ec:0,ac:0,bd:0,hc:0,Db:"HTreeGroup"};var yn={a:"VP8StatusCode",Wa:"VP8LDecodeState",Ob:"VP8LDecodeState",N:"VP8Io",Ib:"WebPDecBuffer",Hc:"WebPDecBuffer",V:0,Ha:0,Xa:0,vb:0,o:f(ar),l:0,v:0,O:0,xa:0,cb:f(wn),Na:0,nc:v(Ar,{Qc:"VP8LImageTransformType",n:0,U:0,Vb:0,u:0,b:0}),Ub:0,Mc:0,$d:0,Zd:"*WebPRescaler"},Sn=4,Tn=[o,function(t,e,r,n,a,f,i,u){let b=0,s=u;for(g(t!=o),g(i!=o),g(r>0),g(n>0),g(a>0),g(f>=r*a),b=0;b0),g(n>0),g(a>0),g(f>=r*a),c(i,u,t,e,a),_(t,e+a,i,s,i,u+a,a*(r-1)),b=1;b0),g(n>0),g(a>0),g(f>=r*a),c(i,u,t,e,a),_(t,e+a,i,b,i,u+a,a*(r-1)),s=1;s255?255:r)&255}}}],Rn=[3,4,3,4,4,2,2,4,4,4,2,1,1];this.WebPFreeDecBuffer=this.Yc=function(t){t!=o&&(t.Fc||(t.Jb=""),t.jc=0,t.Jb=t.jc=o)},a=this;var On=d(511,0),Vn=d(511,0),In=d(2041,0),_n=d(225,0),Wn=d(766,0),Un=0,Mn=85627,Bn=35468,Dn=[function(t,e){let r,n=4;for(r=0;r<4;++r)n+=t[e+r-en]+t[e-1+r*en];for(n>>=3,r=0;r<4;++r)l(t,e+r*en,n,4)},function(t,e){G(t,e,4)},function(t,e){let r=e-en;const n=[];for(n.push(L(t[r-1],t[r+0],t[r+1])),n.push(L(t[r+0],t[r+1],t[r+2])),n.push(L(t[r+1],t[r+2],t[r+3])),n.push(L(t[r+2],t[r+3],t[r+4])),r=0;r<4;++r)c(t,e+r*en,n,0,4)},function(t,e){const r=t[e-1],n=t[e-1+en],a=t[e-1+2*en],o=t[e-1+3*en];t[e+0+0*en]=t[e+1+0*en]=t[e+2+0*en]=t[e+3+0*en]=L(t[e-1-en],r,n),t[e+0+1*en]=t[e+1+1*en]=t[e+2+1*en]=t[e+3+1*en]=L(r,n,a),t[e+0+2*en]=t[e+1+2*en]=t[e+2+2*en]=t[e+3+2*en]=L(n,a,o),t[e+0+3*en]=t[e+1+3*en]=t[e+2+3*en]=t[e+3+3*en]=L(a,o,o)},function(t,e){const r=t[e-1+0*en],n=t[e-1+1*en],a=t[e-1+2*en],o=t[e-1-en],f=t[e+0-en],c=t[e+1-en],i=t[e+2-en],u=t[e+3-en];t[e+0+3*en]=L(n,a,t[e-1+3*en]),t[e+0+2*en]=t[e+1+3*en]=L(r,n,a),t[e+0+1*en]=t[e+1+2*en]=t[e+2+3*en]=L(o,r,n),t[e+0+0*en]=t[e+1+1*en]=t[e+2+2*en]=t[e+3+3*en]=L(f,o,r),t[e+1+0*en]=t[e+2+1*en]=t[e+3+2*en]=L(c,f,o),t[e+2+0*en]=t[e+3+1*en]=L(i,c,f),t[e+3+0*en]=L(u,i,c)},function(t,e){const r=t[e-1+0*en],n=t[e-1+1*en],a=t[e-1+2*en],o=t[e-1-en],f=t[e+0-en],c=t[e+1-en],i=t[e+2-en],u=t[e+3-en];t[e+0+0*en]=t[e+1+2*en]=o+f+1>>1,t[e+1+0*en]=t[e+2+2*en]=f+c+1>>1,t[e+2+0*en]=t[e+3+2*en]=c+i+1>>1,t[e+3+0*en]=i+u+1>>1,t[e+0+3*en]=L(a,n,r),t[e+0+2*en]=L(n,r,o),t[e+0+1*en]=t[e+1+3*en]=L(r,o,f),t[e+1+1*en]=t[e+2+3*en]=L(o,f,c),t[e+2+1*en]=t[e+3+3*en]=L(f,c,i),t[e+3+1*en]=L(c,i,u)},function(t,e){const r=t[e+1-en],n=t[e+2-en],a=t[e+3-en],o=t[e+4-en],f=t[e+5-en],c=t[e+6-en],i=t[e+7-en];t[e+0+0*en]=L(t[e+0-en],r,n),t[e+1+0*en]=t[e+0+1*en]=L(r,n,a),t[e+2+0*en]=t[e+1+1*en]=t[e+0+2*en]=L(n,a,o),t[e+3+0*en]=t[e+2+1*en]=t[e+1+2*en]=t[e+0+3*en]=L(a,o,f),t[e+3+1*en]=t[e+2+2*en]=t[e+1+3*en]=L(o,f,c),t[e+3+2*en]=t[e+2+3*en]=L(f,c,i),t[e+3+3*en]=L(c,i,i)},function(t,e){const r=t[e+0-en],n=t[e+1-en],a=t[e+2-en],o=t[e+3-en],f=t[e+4-en],c=t[e+5-en],i=t[e+6-en],u=t[e+7-en];t[e+0+0*en]=r+n+1>>1,t[e+1+0*en]=t[e+0+2*en]=n+a+1>>1,t[e+2+0*en]=t[e+1+2*en]=a+o+1>>1,t[e+3+0*en]=t[e+2+2*en]=o+f+1>>1,t[e+0+1*en]=L(r,n,a),t[e+1+1*en]=t[e+0+3*en]=L(n,a,o),t[e+2+1*en]=t[e+1+3*en]=L(a,o,f),t[e+3+1*en]=t[e+2+3*en]=L(o,f,c),t[e+3+2*en]=L(f,c,i),t[e+3+3*en]=L(c,i,u)},function(t,e){const r=t[e-1+0*en],n=t[e-1+1*en],a=t[e-1+2*en],o=t[e-1+3*en],f=t[e-1-en],c=t[e+0-en],i=t[e+1-en],u=t[e+2-en];t[e+0+0*en]=t[e+2+1*en]=r+f+1>>1,t[e+0+1*en]=t[e+2+2*en]=n+r+1>>1,t[e+0+2*en]=t[e+2+3*en]=a+n+1>>1,t[e+0+3*en]=o+a+1>>1,t[e+3+0*en]=L(c,i,u),t[e+2+0*en]=L(f,c,i),t[e+1+0*en]=t[e+3+1*en]=L(r,f,c),t[e+1+1*en]=t[e+3+2*en]=L(n,r,f),t[e+1+2*en]=t[e+3+3*en]=L(a,n,r),t[e+1+3*en]=L(o,a,n)},function(t,e){const r=t[e-1+0*en],n=t[e-1+1*en],a=t[e-1+2*en],o=t[e-1+3*en];t[e+0+0*en]=r+n+1>>1,t[e+2+0*en]=t[e+0+1*en]=n+a+1>>1,t[e+2+1*en]=t[e+0+2*en]=a+o+1>>1,t[e+1+0*en]=L(r,n,a),t[e+3+0*en]=t[e+1+1*en]=L(n,a,o),t[e+3+1*en]=t[e+1+2*en]=L(a,o,o),t[e+3+2*en]=t[e+2+2*en]=t[e+0+3*en]=t[e+1+3*en]=t[e+2+3*en]=t[e+3+3*en]=o}],En=[function(t,e){let r,n=16;for(r=0;r<16;++r)n+=t[e-1+r*en]+t[e+r-en];N(n>>5,t,e)},function(t,e){G(t,e,16)},function(t,e){let r;for(r=0;r<16;++r)c(t,e+r*en,t,e-en,16)},function(t,e){let r;for(r=16;r>0;--r)l(t,e+0,t[e-1],16),e+=en},function(t,e){let r,n=8;for(r=0;r<16;++r)n+=t[e-1+r*en];N(n>>4,t,e)},function(t,e){let r,n=8;for(r=0;r<16;++r)n+=t[e+r-en];N(n>>4,t,e)},function(t,e){N(128,t,e)}],jn=[function(t,e){let r,n=8;for(r=0;r<8;++r)n+=t[e+r-en]+t[e-1+r*en];H(1*(n>>4),t,e)},function(t,e){G(t,e,8)},function(t,e){let r;for(r=0;r<8;++r)c(t,e+r*en,t,e-en,8)},function(t,e){let r;for(r=0;r<8;++r)l(t,e+0,t[e-1],8),e+=en},function(t,e){let r,n=4;for(r=0;r<8;++r)n+=t[e-1+r*en];H(1*(n>>3),t,e)},function(t,e){let r,n=4;for(r=0;r<8;++r)n+=t[e+r-en];H(1*(n>>3),t,e)},function(t,e){H(128,t,e)}];let Cn,Fn,Gn,Nn,Ln,Hn,zn,qn,Kn,Jn,Yn,xn,Qn,$n,Xn,Zn;var ta=31,ea=[0,2,8],ra=3,na=1,aa=[0+0*en,4+0*en,8+0*en,12+0*en,0+4*en,4+4*en,8+4*en,12+4*en,0+8*en,4+8*en,8+8*en,12+8*en,0+12*en,4+12*en,8+12*en,12+12*en],oa=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],fa=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],ca=[-Fr,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],ia=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],ua=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],ba=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]];this.WebPGetDecoderVersion=this.Ld=function(){return 512};var sa=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],la=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],ha=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],da=p([Zr,tn],"");d(4,0);var va=[[0,0,0,0],[1,0,0,0],[0,1,0,0],[1,1,0,0],[0,0,1,0],[1,0,1,0],[0,1,1,0],[1,1,1,0],[0,0,0,1],[1,0,0,1],[0,1,0,1],[1,1,0,1],[0,0,1,1],[1,0,1,1],[0,1,1,1],[1,1,1,1]],pa=134480385,ga=16,Pa=-227,Aa=482,ka=[_t,function(t){return t},function(t,e,r){return e[r+0]},function(t,e,r){return e[r+1]},function(t,e,r){return e[r-1]},function(t,e,r){return Ot(Ot(t,e[r+1]),e[r+0])},function(t,e,r){return Ot(t,e[r-1])},function(t,e,r){return Ot(t,e[r+0])},function(t,e,r){return Ot(e[r-1],e[r+0])},function(t,e,r){return Ot(e[r+0],e[r+1])},function(t,e,r){return Ot(Ot(t,e[r-1]),Ot(e[r+0],e[r+1]))},function(t,e,r){return Math.abs((t>>24&255)-(e[r-1]>>24&255))-Math.abs((e[r+0]>>24&255)-(e[r-1]>>24&255))+(Math.abs((t>>16&255)-(e[r-1]>>16&255))-Math.abs((e[r+0]>>16&255)-(e[r-1]>>16&255)))+(Math.abs((t>>8&255)-(e[r-1]>>8&255))-Math.abs((e[r+0]>>8&255)-(e[r-1]>>8&255)))+(Math.abs((255&t)-(255&e[r-1]))-Math.abs((255&e[r+0])-(255&e[r-1])))<=0?e[r+0]:t},function(t,e,r){return(Vt((t>>24&255)+(e[r+0]>>24&255)-(e[r-1]>>24&255))<<24|Vt((t>>16&255)+(e[r+0]>>16&255)-(e[r-1]>>16&255))<<16|Vt((t>>8&255)+(e[r+0]>>8&255)-(e[r-1]>>8&255))<<8|Vt((255&t)+(255&e[r+0])-(255&e[r-1])))>>>0},function(t,e,r){const n=e[r-1];return(It((t=Ot(t,e[r+0]))>>24&255,n>>24&255)<<24|It(t>>16&255,n>>16&255)<<16|It(t>>8&255,n>>8&255)<<8|It(t>>0&255,n>>0&255))>>>0},_t,_t],ma={Cc:0,Bc:0,Kc:0},wa=16,ya=16,Sa=16,Ta=[2,3,7],Ra=[3,3,11],Oa=0,Va=1,Ia=2,_a=3,Wa=4,Ua=[gr+Pr,gr,gr,gr,40],Ma=19,Ba=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Da=120,Ea=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],ja=1<{var e;e=t.data,m.push(e),y()}))}},n={};function a(t){var e=n[t];if(void 0!==e)return e.exports;var o=n[t]={exports:{}};return r[t].call(o.exports,o,o.exports,a),o.exports}a.m=r,a.x=()=>{var t=a.O(void 0,[699,866,158],(()=>a(2061)));return a.O(t)},t=[],a.O=(e,r,n,o)=>{if(!r){var f=1/0;for(b=0;b=o)&&Object.keys(a.O).every((t=>a.O[t](r[i])))?r.splice(i--,1):(c=!1,o0&&t[b-1][2]>o;b--)t[b]=t[b-1];t[b]=[r,n,o]},a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,r)=>(a.f[r](t,e),e)),[])),a.u=t=>({158:"npm.iobuffer",699:"npm.pako",866:"npm.fast-png"}[t]+"."+{158:"8fe11aa09121a6fd9200",699:"89deb457201f16c93925",866:"a7cba17ee621cb2ad512"}[t]+".chunk.js"),a.miniCssF=t=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");r.length&&(t=r[r.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),(()=>{if(void 0!==a){var t=a.u,e=a.e,r={},n={};a.u=function(e){return t(e)+(r.hasOwnProperty(e)?"?"+r[e]:"")},a.e=function(o){return e(o).catch((function(e){var f=n.hasOwnProperty(o)?n[o]:999999;if(f<1){var c=t(o);throw e.message="Loading chunk "+o+" failed after 999999 retries.\n("+c+")",e.request=c,e}return new Promise((function(t){setTimeout((function(){var e=Date.now();r[o]=e,n[o]=f-1,t(a.e(o))}),3e3)}))}))}}})(),(()=>{var t={61:1};a.f.i=(e,r)=>{t[e]||importScripts(a.p+a.u(e))};var e=this.webpackChunktweb=this.webpackChunktweb||[],r=e.push.bind(e);e.push=e=>{var[n,o,f]=e;for(var c in o)a.o(o,c)&&(a.m[c]=o[c]);for(f&&f(a);n.length;)t[n.pop()]=1;r(e)}})(),e=a.x,a.x=()=>Promise.all([699,866,158].map(a.e,a)).then(e),a.x()})(); -//# sourceMappingURL=61.043c67ed911cb9f8422c.chunk.js.map \ No newline at end of file +//# sourceMappingURL=61.8c05eb6b6906de5287fa.chunk.js.map \ No newline at end of file diff --git a/public/61.043c67ed911cb9f8422c.chunk.js.map b/public/61.8c05eb6b6906de5287fa.chunk.js.map similarity index 99% rename from public/61.043c67ed911cb9f8422c.chunk.js.map rename to public/61.8c05eb6b6906de5287fa.chunk.js.map index f4f2a742..e3c2da25 100644 --- a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AKC,MAGdX,EAASxB,GAAWiC,EACpBR,EAASzB,GAAW2B,EAAU,EAC9BI,EAAQzD,EAAoB7b,EAAEud,GAChC,GArCG,IAsCL,GACF,GACF,CACF,CACD,EAjDD,G,MCIA,IAAIoC,EAAkB,CACrB,GAAI,GAgBL9D,EAAoBnZ,EAAEpF,EAAI,CAACigB,EAASI,KAE/BgC,EAAgBpC,IAElBc,cAAcxC,EAAoBte,EAAIse,EAAoBhZ,EAAE0a,GAE9D,EAGD,IAAIqC,EAAqBtH,KAAuB,iBAAIA,KAAuB,kBAAK,GAC5EuH,EAA6BD,EAAmBxhB,KAAK0hB,KAAKF,GAC9DA,EAAmBxhB,KAvBCuL,IACnB,IAAK6S,EAAUuD,EAAaC,GAAWrW,EACvC,IAAI,IAAImS,KAAYiE,EAChBlE,EAAoB3X,EAAE6b,EAAajE,KACrCD,EAAoBpZ,EAAEqZ,GAAYiE,EAAYjE,IAIhD,IADGkE,GAASA,EAAQnE,GACdW,EAASre,QACdwhB,EAAgBnD,EAASyD,OAAS,EACnCJ,EAA2BlW,EAAK,C,KbnB7BtM,EAAOwe,EAAoBQ,EAC/BR,EAAoBQ,EAAI,IAChBmB,QAAQC,IAAI,CAAC,IAAI,IAAI,KAAKyC,IAAIrE,EAAoB7b,EAAG6b,IAAsBsE,KAAK9iB,GcD9Dwe,EAAoBQ,G","sources":["webpack://tweb/webpack/runtime/chunk loaded","webpack://tweb/webpack/runtime/startup chunk dependencies","webpack://tweb/./src/vendor/libwebp-0.2.0.js","webpack://tweb/./src/lib/webp/webp.worker.ts","webpack://tweb/./src/lib/webp/webp.ts","webpack://tweb/webpack/bootstrap","webpack://tweb/webpack/runtime/define property getters","webpack://tweb/webpack/runtime/ensure chunk","webpack://tweb/webpack/runtime/get javascript chunk filename","webpack://tweb/webpack/runtime/get mini-css chunk filename","webpack://tweb/webpack/runtime/global","webpack://tweb/webpack/runtime/hasOwnProperty shorthand","webpack://tweb/webpack/runtime/publicPath","webpack://tweb/webpack/runtime/compat","webpack://tweb/webpack/runtime/importScripts chunk loading","webpack://tweb/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn Promise.all([699,866,158].map(__webpack_require__.e, __webpack_require__)).then(next);\n};","// Copyright 2011 Google Inc.\n//\n// This code is licensed under the same terms as WebM:\n// Software License Agreement: http://www.webmproject.org/license/software/\n// Additional IP Rights Grant: http://www.webmproject.org/license/additional/\n// -----------------------------------------------------------------------------\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n// IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// -----------------------------------------------------------------------------\n//\n// Copyright 2011-2013 Dominik Homberger\n// Libwebp Javascript / libwebpjs - the libwebp implementation in javascript (v0.2.0)\n//\n// Author: Dominik Homberger (dominik.homberger@gmail.com)\n\nlet i;\nlet a;\nlet self;\nconst ca = 0;\nconst p = null;\nconst s = 0;\nconst x = 0;\nconst la = s;\nconst E = s;\nconst bb = 0;\nconst Mb = 0;\n\nfunction M(F) {\n return JSON.parse(JSON.stringify(F));\n}\n\nfunction N(F, G, w, D, S) {\n for (i = 0; i < S; ++i) F[G + i] = w[D + i];\n}\n\nfunction Nb(F) {\n const G = [];\n const w = F.length;\n let D;\n for (D = 0; D < w; ++D) G.push(F[D]);\n return G;\n}\n\nfunction ic(F, G) {\n const w = [];\n w.push(M(F));\n let D;\n for (D = 0; D < G; ++D) w.push(M(F));\n w.push(0);\n return w;\n}\n\nfunction rc(F, G) {\n const w = [];\n let D;\n for (D = 0; D < G; ++D) w.push(F);\n w.push(0);\n return w;\n}\n\nfunction memmove(arr1, index1, arr2, index2, length) {\n let i;\n for (i = 0; i < length; i++) {\n arr1[index1 + i] = arr2[index2 + i];\n }\n}\n\nfunction jd(F, G, w, D) {\n let S;\n for (S = 0; S < D; ++S) F[G + S] = w;\n}\n\nfunction kd(F, G, w, D) {\n let S = '';\n let ga;\n for (ga = 0; ga < D; ++ga) S += String.fromCharCode(F[G + ga]);\n return w == S ? 0 : 1;\n}\n\nfunction U(F, G) {\n let w; const\n D = [];\n for (w = 0; w < F; ++w) D.push(G);\n return D;\n}\n\nfunction ld(F, G) {\n let w; const\n D = [];\n for (w = 0; w < F; ++w) D.push(M(G));\n return D;\n}\n\nfunction md(F, G) {\n let w;\n for (w = F.length - 1; w >= 0; --w) G = M(U(F[w], G));\n return G;\n}\n\nfunction $(F) {\n if (!F) throw Error('assert :P');\n}\nexport const WebPDecoder = function () {\n function F(a) {\n return a == Ob || a == Pb || a == Bb || a == Qb;\n }\n\n function G(a) {\n return S(a, 1);\n }\n\n function w(a, b) {\n const c = 1 + ((a.la - 1) * b >> 8);\n const d = c << 8;\n let e = s;\n a.Z >= d ? (e = 1, a.la -= c, a.Z -= d) : (e = 0, a.la = c);\n for (; a.la < 128;) a.Z <<= 1, a.la <<= 1, ++a.gc == 8 && (a.gc = 0, a.bc && (a.Z += a.qa[a.Ia++], a.bc--));\n return e;\n }\n\n function D(a, b, c, d) {\n d -= c;\n d >= 2 ? (a.Z = b[c + 0] << 8 | b[c + 1], a.qa = b, a.Ia = c + 2, a.bc = d - 2) : (a.Z = 0, a.qa = p, a.bc = 0);\n a.la = 255;\n a.gc = 0;\n }\n\n function S(a, b) {\n for (var c = 0, d = s, d = b - 1; d >= 0; d--) c |= w(a, 128) << d;\n return c;\n }\n\n function ga(a, b) {\n const c = S(a, b);\n return G(a) ? -c : c;\n }\n\n function Rb(a, b, c, d) {\n let e = Mb;\n $(a != p);\n $(b != p);\n $(d < 4294967288);\n a.qa = b;\n a.Ia = c;\n a.ya = d;\n a.T = 0;\n a.Q = 0;\n a.g = 0;\n a.L = 0;\n for (e = a.fa = 0; e < 4 && e < a.ya; ++e) a.T |= a.qa[a.Ia + a.Q] << 8 * e, ++a.Q;\n }\n\n function Sb(a) {\n for (; a.g >= 8 && a.Q < a.ya;) a.T >>>= 8, a.T += a.qa[a.Ia + a.Q] << 24 >>> 0, ++a.Q, a.g -= 8;\n }\n\n function Da(a) {\n a.g >= 8 && Sb(a);\n a.Q == a.ya && a.g == 32 && (a.L = 1);\n }\n\n function T(a, b) {\n let c = 0;\n $(b >= 0);\n if (!a.L && b < gf) {\n if (a.Q == a.ya && a.g + b >= 32 && (a.L = 1, a.g + b > 32)) return c;\n c = a.T >> a.g & hf[b];\n a.g += b;\n a.g >= 8 && a.g >= 8 && Sb(a);\n } else a.fa = 1;\n return c;\n }\n\n function ma(a) {\n return a.Pa == a.gb;\n }\n\n function nd(a, b) {\n $(a != p);\n if (b == 0) return 0;\n a.gb = 2 * b - 1;\n a.Y = ld(a.gb, jf);\n if (a.Y == p) return 0;\n a.Y[0].s = -1;\n return a.Pa = 1;\n }\n\n function ja(a) {\n a != p && (a.Y = p, a.Y = p, a.gb = 0, a.Pa = 0);\n }\n\n function jc(a, b, c, d) {\n for (var e = a.Y, g = 0, k = +a.gb; d-- > 0;) {\n if (g >= k) return 0;\n if (e[g].s < 0) {\n if (ma(a)) return 0;\n const h = a;\n const n = h.Y;\n const l = +h.Pa;\n e[g].s = l - g;\n h.Pa += 2;\n n[l + 0].s = -1;\n n[l + 1].s = -1;\n } else if (e[g].s == 0) return 0;\n g += e[g].s + (c >> d & 1);\n }\n if (e[g].s < 0) e[g].s = 0;\n else if (e[g].s != 0) return 0;\n e[g].kc = b;\n return 1;\n }\n\n function od(a, b, c) {\n var d = s;\n let e = 0;\n let g = 0;\n $(a != p);\n $(b != p);\n for (d = 0; d < c; ++d) b[d] > 0 && (++e, g = d);\n if (!nd(a, e)) return 0;\n if (e == 1) return g < 0 || g >= c ? (ja(a), 0) : jc(a, g, 0, 0);\n e = 0;\n g = U(c, s);\n if (g == p) return (e = e && ma(a)) || ja(a), e;\n var k = s;\n var k = s;\n var d = U(Tb + 1, 0);\n let h = s;\n const n = U(Tb + 1, 0);\n let l = 0;\n $(b != p);\n $(c > 0);\n $(g != p);\n for (k = 0; k < c; ++k) b[k] > l && (l = b[k]);\n if (l > Tb) d = 0;\n else {\n for (k = 0; k < c; ++k) ++d[b[k]];\n h = d[0] = 0;\n n[0] = -1;\n for (k = 1; k <= l; ++k) h = h + d[k - 1] << 1, n[k] = h;\n for (k = 0; k < c; ++k) g[k] = b[k] > 0 ? n[b[k]]++ : pd;\n d = 1;\n }\n if (!d) return (e = e && ma(a)) || ja(a), e;\n for (d = 0; d < c; ++d) {\n if (b[d] > 0 && !jc(a, d, g[d], b[d])) {\n return (e = e && ma(a)) || ja(a), e;\n }\n }\n (e = ma(a)) || ja(a);\n return e;\n }\n\n function Ea(a, b, c, d, e, g, k) {\n for (var h = s, h = 0; h < k; ++h) e[g + h] = a[b + h] + c[d + h] & 255;\n }\n\n function qd(a, b, c) {\n const d = a.P.l;\n if (!(c = b < 0 || c < 0 || b + c > a.P.v)) {\n if (c = b == 0) {\n a: {\n let e = a.Ga;\n var g = a.G;\n var k = a.ub;\n c = a.P.l;\n let h = a.P.v;\n const n = a.Xb;\n var l = [p];\n let m = p;\n let f = h * c;\n var q = p;\n var r = p;\n var r = 'WEBP_FILTER_TYPE';\n let u = s;\n var l = s;\n var v = 0;\n let C = s;\n $(c > 0 && h > 0 && d >= c);\n $(e != p && n != p);\n if (k <= Ub) c = 0;\n else if (C = e[g + 0] >> 0 & 3, r = e[g + 0] >> 2 & 3, u = e[g + 0] >> 4 & 3, l = e[g + 0] >> 6 & 3, C < kc || C > kf || r >= lf || u > rd || l != 0) c = 0;\n else {\n if (C == kc) v = k >= f, l = e, m = g + Ub;\n else {\n l = U(f, 0);\n m = 0;\n if (l\n == p) {\n c = 0;\n break a;\n }\n var v = g + Ub;\n var k = k - Ub;\n var g = l;\n var q = M(Vb);\n let A = 0;\n const z = sd();\n z == p ? v = 0 : (z.l = c, z.v = h, z.N = q, td(na), q.put = ud, q.Mb = vd, q.Pb = wd, q.ka = p, q.ka = g, q.fd = 0, q.width = c, q.height = h, z.a = L, Rb(z.o, e, v, k), z.Wa = Cb, Ka(c, h, 1, z, p) && xd(z, c) && (z.Wa = Db, A = lc(z, z.V, z.Ha, z.l, z.v, mf)), z != p && sa(z), v = A);\n }\n if (v) {\n e = nf[r];\n e != p ? (q = U(f, 0), r = 0, q == p && (v = 0, C != kc && (m = l = p)), e(l, m, c, h, 1, c, q, r), f = q, C = r) : (f = l, C = m);\n for (e = 0; h-- > 0;) N(n, e, f, C, c), C += c, e += d;\n u == rd && (v = l == p || m <= 0 || c <= 0 ? 0 : 1);\n }\n c = v;\n }\n }\n c = !c;\n }\n }\n return c ? p : b == 0 ? a.Xb : +b * d;\n }\n\n function of(a) {\n let b = a.width;\n const c = a.height;\n let d = a.J;\n if (b <= 0 || c <= 0 || !(d >= Qa && d < Cc)) return ta;\n if (!a.Fc && a.Jb == p) {\n var e = p;\n var g = 0;\n var k = 0;\n var h = 0;\n var n = 0;\n var e = bb;\n var l = b * yd[d];\n var m = l * c;\n d < ua || (g = parseInt((b + 1) / 2, 10), h = g * parseInt((c + 1) / 2, 10), d == Ra && (k = b, n = k * c));\n e = m + 2 * h + n;\n if (e != e) return ta;\n e = U(e, 205);\n if (e == p) return cb;\n a.Jb = e;\n a.jc = p;\n d < ua ? (b = a.c.RGBA, b.ma = e, b.Sa = p, b.f = l, b.size = m) : (b = a.c.Va, b.y = e, b.D = p, b.F = l, b.Wc = m, b.c = e, b.B = p + m, b.nb = g, b.Rc = h, b.S = e, b.C = p + m + h, b.rb = g, b.Uc = h, d == Ra && (b.p = e, b.q = p + m + 2 * h), b.Wb = n, b.Fa = k);\n }\n d = 1;\n g = a.J;\n k = a.width;\n h = a.height;\n g >= Qa && g < Cc ? g < ua ? (a = a.c.RGBA, d\n &= a.f * h <= a.size, d &= a.f >= k * yd[g], d &= a.ma != p) : (a = a.c.Va, n = a.nb * parseInt((h + 1) / 2, 10), l = a.rb * parseInt((h + 1) / 2, 10), m = a.Fa * h, d &= a.F * h <= a.Wc, d &= n <= a.Rc, d &= l <= a.Uc, d &= m <= a.Wb, d &= a.F >= k, d &= a.nb >= parseInt((k + 1) / 2, 10), d &= a.rb >= parseInt((k + 1) / 2, 10), d &= a.y != p, d &= a.c != p, d &= a.S != p, g == Ra && (d &= a.Fa >= k, d &= m <= a.Wb, d &= a.p != p)) : d = 0;\n return d ? L : ta;\n }\n\n function zd(a, b, c, d) {\n if (d == p || a <= 0 || b <= 0) return ta;\n if (c != p) {\n if (c.Ua) {\n const e = c.wc;\n const g = c.vc;\n const k = c.t & -2;\n const h = c.k & -2;\n if (k < 0 || h < 0 || e <= 0 || g <= 0 || k + e > a || h + g > b) return ta;\n a = e;\n b = g;\n }\n if (c.I) {\n if (c.Ba <= 0\n || c.Aa <= 0) return ta;\n a = c.Ba;\n b = c.Aa;\n }\n }\n d.width = a;\n d.height = b;\n return of(d);\n }\n\n function mb(a) {\n return !(a & -256) ? a : a < 0 ? 0 : 255;\n }\n\n function Ad(a, b, c, d) {\n const e = U(16, 0);\n let g;\n g = 0;\n let k;\n for (k = 0; k < 4; ++k) {\n var h = a[b + 0] + a[b + 8];\n var n = a[b + 0] - a[b + 8];\n var l = (a[b + 4] * Wb >> 16) - (a[b + 12] * Xb >> 16);\n var m = (a[b + 4] * Xb >> 16) + (a[b + 12] * Wb >> 16);\n e[g + 0] = h + m;\n e[g + 1] = n + l;\n e[g + 2] = n - l;\n e[g + 3] = h - m;\n g += 4;\n b++;\n }\n for (k = g = 0; k < 4; ++k) {\n a = e[g + 0] + 4, h = a + e[g + 8], n = a - e[g + 8], l = (e[g + 4] * Wb >> 16) - (e[g + 12] * Xb >> 16), m = (e[g + 4] * Xb >> 16) + (e[g + 12] * Wb >> 16), c[d + 0 + 0 * f] = mb(c[d + 0 + 0 * f] + (h + m >> 3)), c[d + 1 + 0 * f] = mb(c[d\n + 1 + 0 * f] + (n + l >> 3)), c[d + 2 + 0 * f] = mb(c[d + 2 + 0 * f] + (n - l >> 3)), c[d + 3 + 0 * f] = mb(c[d + 3 + 0 * f] + (h - m >> 3)), g++, d += f;\n }\n }\n\n function pf(a, b, c, d, e) {\n Ad(a, b, c, d);\n e && Ad(a, b + 16, c, d + 4);\n }\n\n function qf(a, b, c, d) {\n mc(a, b + 0, c, d + 0, 1);\n mc(a, b + 32, c, d + 4 * f, 1);\n }\n\n function nc(a, b, c, d) {\n a = a[b + 0] + 4;\n let e;\n for (e = 0; e < 4; ++e) for (b = 0; b < 4; ++b) c[d + b + e * f] = mb(c[d + b + e * f] + (a >> 3));\n }\n\n function rf(a, b, c, d) {\n a[b + 0] && nc(a, b + 0, c, d + 0);\n a[b + 16] && nc(a, b + 16, c, d + 4);\n a[b + 32] && nc(a, b + 32, c, d + 4 * f);\n a[b + 48] && nc(a, b + 48, c, d + 4 * f + 4);\n }\n\n function Dc(a, b, c) {\n const d = b - f;\n const e = oa;\n const g = 255 - a[d - 1];\n let k;\n for (k = 0; k\n < c; ++k) {\n const h = e;\n const n = g + a[b - 1];\n var l;\n for (l = 0; l < c; ++l) a[b + l] = h[n + a[d + l]];\n b += f;\n }\n }\n\n function Yb(a, b, c) {\n let d;\n for (d = 0; d < 16; ++d) for (i = 0; i < 16; ++i) b[c + d * f + i] = a;\n }\n\n function y(a, b, c) {\n return a + 2 * b + c + 2 >> 2;\n }\n\n function Zb(a, b, c) {\n let d; let\n e;\n for (d = 0; d < 8; ++d) for (e = 0; e < 8; ++e) b[c + e + d * f] = a;\n }\n\n function nb(a, b, c) {\n const d = a[b - c];\n const e = a[b + 0];\n const g = 3 * (e - d) + sc[1020 + a[b - 2 * c] - a[b + c]];\n const k = oc[112 + (g + 4 >> 3)];\n a[b - c] = oa[255 + d + oc[112 + (g + 3 >> 3)]];\n a[b + 0] = oa[255 + e - k];\n }\n\n function Bd(a, b, c, d) {\n const e = a[b + 0];\n const g = a[b + c];\n return va[255 + a[b - 2 * c] - a[b - c]] > d || va[255 + g - e] > d;\n }\n\n function Cd(a,\n b, c, d, e) {\n const g = a[b - 3 * c];\n const k = a[b - 2 * c];\n const h = a[b - c];\n const n = a[b + 0];\n const l = a[b + c];\n const m = a[b + 2 * c];\n const f = a[b + 3 * c];\n return 2 * va[255 + h - n] + tc[255 + k - l] > d ? 0 : va[255 + a[b - 4 * c] - g] <= e && va[255 + g - k] <= e && va[255 + k - h] <= e && va[255 + f - m] <= e && va[255 + m - l] <= e && va[255 + l - n] <= e;\n }\n\n function Dd(a, b, c, d) {\n let e;\n for (e = 0; e < 16; ++e) 2 * va[255 + a[b + e - c] - a[b + e + 0]] + tc[255 + a[b + e - 2 * c] - a[b + e + c]] <= d && nb(a, b + e, c);\n }\n\n function Ed(a, b, c, d) {\n let e;\n for (e = 0; e < 16; ++e) 2 * va[255 + a[b + e * c - 1] - a[b + e * c + 0]] + tc[255 + a[b + e * c - 2] - a[b + e * c + 1]] <= d && nb(a, b + e * c, 1);\n }\n\n function sf(a, b, c, d) {\n let e;\n for (e = 3; e > 0; --e) {\n b\n += 4 * c, Dd(a, b + 0, c, d);\n }\n }\n\n function tf(a, b, c, d) {\n let e;\n for (e = 3; e > 0; --e) b += 4, Ed(a, b + 0, c, d);\n }\n\n function Fa(a, b, c, d, e, g, k, h) {\n for (; e-- > 0;) {\n if (Cd(a, b + 0, c, g, k)) {\n if (Bd(a, b + 0, c, h)) nb(a, b + 0, c);\n else {\n const n = a;\n const l = b + 0;\n const m = c;\n const f = n[l - 2 * m];\n const q = n[l - m];\n const r = n[l + 0];\n const u = n[l + m];\n const v = n[l + 2 * m];\n var C = sc[1020 + 3 * (r - q) + sc[1020 + f - u]];\n const A = 27 * C + 63 >> 7;\n const z = 18 * C + 63 >> 7;\n var C = 9 * C + 63 >> 7;\n n[l - 3 * m] = oa[255 + n[l - 3 * m] + C];\n n[l - 2 * m] = oa[255 + f + z];\n n[l - m] = oa[255 + q + A];\n n[l + 0] = oa[255 + r - A];\n n[l + m] = oa[255 + u - z];\n n[l + 2 * m] = oa[255 + v - C];\n }\n }\n b += d;\n }\n }\n\n function Ga(a, b, c, d, e, g, k, h) {\n for (; e-- > 0;) {\n if (Cd(a, b + 0, c,\n g, k)) {\n if (Bd(a, b + 0, c, h)) nb(a, b + 0, c);\n else {\n const n = a;\n const l = b + 0;\n const m = c;\n const f = n[l - m];\n const q = n[l + 0];\n const r = n[l + m];\n var u = 3 * (q - f);\n const v = oc[112 + (u + 4 >> 3)];\n var u = oc[112 + (u + 3 >> 3)];\n const C = v + 1 >> 1;\n n[l - 2 * m] = oa[255 + n[l - 2 * m] + C];\n n[l - m] = oa[255 + f + u];\n n[l + 0] = oa[255 + q - v];\n n[l + m] = oa[255 + r - C];\n }\n }\n b += d;\n }\n }\n\n function uf(a, b, c, d, e, g) {\n Fa(a, b + 0, c, 1, 16, d, e, g);\n }\n\n function vf(a, b, c, d, e, g) {\n Fa(a, b + 0, 1, c, 16, d, e, g);\n }\n\n function wf(a, b, c, d, e, g) {\n let k;\n for (k = 3; k > 0; --k) b += 4 * c, Ga(a, b + 0, c, 1, 16, d, e, g);\n }\n\n function xf(a, b, c, d, e, g) {\n let k;\n for (k = 3; k > 0; --k) b += 4, Ga(a, b + 0, 1, c, 16, d, e, g);\n }\n\n function yf(a, b, c, d, e,\n g, k, h) {\n Fa(a, b, e, 1, 8, g, k, h);\n Fa(c, d, e, 1, 8, g, k, h);\n }\n\n function zf(a, b, c, d, e, g, k, h) {\n Fa(a, b, 1, e, 8, g, k, h);\n Fa(c, d, 1, e, 8, g, k, h);\n }\n\n function Af(a, b, c, d, e, g, k, h) {\n Ga(a, b + 4 * e, e, 1, 8, g, k, h);\n Ga(c, d + 4 * e, e, 1, 8, g, k, h);\n }\n\n function Bf(a, b, c, d, e, g, k, h) {\n Ga(a, b + 4, 1, e, 8, g, k, h);\n Ga(c, d + 4, 1, e, 8, g, k, h);\n }\n\n function Fd(a, b) {\n return b == $b ? a.i == 0 ? a.d == 0 ? Cf : Df : a.d == 0 ? Ef : $b : b;\n }\n\n function Ec(a, b, c, d) {\n for (i = 0; i < 4; ++i) a[b + i] = c[d + i];\n }\n\n function wa(a, b) {\n return a < 0 ? 0 : a > b ? b : a;\n }\n\n function Gd(a) {\n a.a = 'VP8_STATUS_OK';\n a.xc = 'OK';\n }\n\n function td(a) {\n a >>> 8 != na >>> 8 && alert('mismatch error');\n }\n\n function Y(a, b, c) {\n a.a == L && (a.a = b, a.xc = c, a.za = 0);\n // alert(b + \": \" + c);\n return 0;\n }\n\n function Hd(a, b) {\n let c = [0];\n let d = x;\n var e = [Mb];\n var g = M(Id);\n var k = M(Jd);\n let h = M(Fc);\n var e = 'VP8StatusCode';\n var g = M(Gc);\n if (a == p) return alert('(dec == null)'), 0;\n Gd(a);\n if (b == p) return Y(a, 'VP8_STATUS_INVALID_PARAM', 'null VP8Io passed to VP8GetHeaders()');\n g.data = b.data;\n g.b = b.b;\n g.e = b.e;\n g.b = [g.b];\n g.e = [g.e];\n g = [g];\n e = Kd(g);\n if (e != L) return Y(a, e, 'Incorrect/incomplete header.');\n g = g[0];\n g.b = g.b[0];\n g.e = g.e[0];\n if (g.ia) return Y(a, W, 'Unexpected lossless format encountered.');\n a.Ga == p && ($(a.ub == 0), a.Ga = g.$, a.G = g.G, a.ub = g.pa);\n d = g.data;\n c = g.b + g.offset;\n e = g.e - g.offset;\n $(g.e >= g.offset);\n if (e[0] < 4) return Y(a, Z, 'Truncated header.');\n h = d[c + 0] | d[c + 1] << 8 | d[c + 2] << 16;\n g = a.Ac;\n g.fb = !(h & 1) + 0;\n g.Jc = h >> 1 & 7;\n g.Nc = h >> 4 & 1;\n g.Ra = h >> 5;\n if (g.Jc > 3) return Y(a, 'VP8_STATUS_BITSTREAM_ERROR', 'Incorrect keyframe parameters.');\n if (!g.Nc) return Y(a, 'VP8_STATUS_UNSUPPORTED_FEATURE', 'Frame not displayable.');\n c += 3;\n e -= 3;\n k = a.P;\n if (g.fb) {\n if (e < 7) return Y(a, 'VP8_STATUS_NOT_ENOUGH_DATA', 'cannot parse picture header');\n if (!(e\n >= 3 && d[c + 0] == 157 && d[c + 1] == 1 && d[c + 2] == 42)) return Y(a, 'VP8_STATUS_BITSTREAM_ERROR', 'Bad code word');\n k.l = (d[c + 4] << 8 | d[c + 3]) & 16383;\n k.gd = d[c + 4] >> 6;\n k.v = (d[c + 6] << 8 | d[c + 5]) & 16383;\n k.hd = d[c + 6] >> 6;\n c += 7;\n e -= 7;\n a.Ma = k.l + 15 >> 4;\n a.hb = k.v + 15 >> 4;\n b.width = k.l;\n b.height = k.v;\n b.I = 0;\n b.Ua = 0;\n b.k = 0;\n b.t = 0;\n b.Ka = b.width;\n b.K = b.height;\n b.m = b.width;\n b.h = b.height;\n h = a.R;\n for (i = 0; i < h.Ta.length; ++i) h.Ta[i] = 255;\n h.z = M(Ff);\n h = a.Ca;\n $(h != p);\n h.pb = 0;\n h.ob = 0;\n h.tb = 1;\n for (i = 0; i < h.Kb.length; ++i) h.Kb[i] = 0;\n for (i = 0; i < h.Cb.length; ++i) h.Cb[i] = 0;\n a.Lb = 0;\n }\n if (g.Ra\n > e) return Y(a, 'VP8_STATUS_NOT_ENOUGH_DATA', 'bad partition length');\n h = a.o;\n D(h, d, c, c + g.Ra);\n c += g.Ra;\n e -= g.Ra;\n g.fb && (k.uc = G(h), k.$c = G(h));\n var k = h;\n var n = a.Ca;\n let l = a.R;\n $(k != p);\n $(n != p);\n n.pb = G(k);\n if (n.pb) {\n n.ob = G(k);\n if (G(k)) {\n var m;\n n.tb = G(k);\n for (m = 0; m < xa; ++m) n.Kb[m] = G(k) ? ga(k, 7) : 0;\n for (m = 0; m < xa; ++m) n.Cb[m] = G(k) ? ga(k, 6) : 0;\n }\n if (n.ob) for (m = 0; m < Ld; ++m) l.Ta[m] = G(k) ? S(k, 8) : 255;\n } else n.ob = 0;\n if (k.Ab) return Y(a, 'VP8_STATUS_BITSTREAM_ERROR', 'cannot parse segment header');\n k = h;\n n = a.ga;\n n.Oc = G(k);\n n.Fb = S(k, 6);\n n.kb = S(k, 3);\n n.oc = G(k);\n if (n.oc\n && G(k)) {\n for (l = 0; l < Hc; ++l) G(k) && (n.Lc[l] = ga(k, 6));\n for (l = 0; l < Gf; ++l) G(k) && (n.Gc[l] = ga(k, 6));\n }\n a.A = n.Fb == 0 ? 0 : n.Oc ? 1 : 2;\n if (a.A > 0) {\n if (a.Ca.pb) for (l = 0; l < xa; ++l) m = a.Ca.Cb[l], a.Ca.tb || (m += n.Fb), a.Zb[l] = m;\n else a.Zb[0] = n.Fb;\n }\n if (k.Ab) return Y(a, 'VP8_STATUS_BITSTREAM_ERROR', 'cannot parse filter header');\n var k = d;\n var f = c;\n var n = f;\n var e = f + e;\n m = 0;\n let q = s;\n let r = s;\n a.Hb = 1 << S(a.o, 2);\n q = a.Hb - 1;\n l = k;\n m = f + 3 * q;\n if (e < m) e = 'VP8_STATUS_NOT_ENOUGH_DATA';\n else {\n for (r = 0; r < q; ++r) {\n var f = l;\n var u = m + (k[n + 0] | k[n + 1] << 8 | k[n + 2] << 16);\n u > e && (f = k);\n D(a.ic[+r], l, m, u);\n l = f;\n m = u;\n n += 3;\n }\n D(a.ic[+q], l, m, e);\n e = m < e ? 'VP8_STATUS_OK' : 'VP8_STATUS_SUSPENDED';\n }\n if (e != 'VP8_STATUS_OK') return Y(a, 'VP8_STATUS_BITSTREAM_ERROR', 'cannot parse partitions');\n q = a.o;\n e = S(q, 7);\n k = G(q) ? ga(q, 4) : 0;\n n = G(q) ? ga(q, 4) : 0;\n l = G(q) ? ga(q, 4) : 0;\n m = G(q) ? ga(q, 4) : 0;\n q = G(q) ? ga(q, 4) : 0;\n r = a.Ca;\n f = s;\n for (f = 0; f < xa; ++f) {\n u = s;\n if (r.pb) u = r.Kb[f], r.tb || (u += e);\n else if (f > 0) {\n a.yb[f] = a.yb[0];\n continue;\n } else u = e;\n const v = a.yb[f];\n v.sc[0] = Ic[wa(u + k, 127)];\n v.sc[1] = Jc[wa(u + 0, 127)];\n v.sb[0] = 2 * Ic[wa(u + n, 127)];\n v.sb[1] = 101581 * Jc[wa(u + l, 127)] >> 16;\n v.sb[1] < 8\n && (v.sb[1] = 8);\n v.qc[0] = Ic[wa(u + m, 117)];\n v.qc[1] = Jc[wa(u + q, 127)];\n }\n if (g.fb) a.Zc = 259;\n else return Y(a, Hf, 'Not a key frame.');\n G(h);\n e = a.R;\n for (k = 0; k < Md; ++k) for (n = 0; n < Nd; ++n) for (l = 0; l < Kc; ++l) for (m = 0; m < Lc; ++m) w(h, If[k][n][l][m]) && (e.z[k][n][l][m] = S(h, 8));\n a.pc = G(h);\n a.pc && (a.Pc = S(h, 8));\n if (a.P.uc) {\n c -= 8;\n h = Mb;\n if (g.Ra < 8 || d[c + 8 - 1] != 1) return Y(a, W, 'RIFF: Inconsistent extra information.');\n h = d[c + 0] << 0 | d[c + 1] << 8 | d[c + 2] << 16;\n a.fc = h;\n a.dd = p;\n a.cd = d[c + 3];\n }\n return a.za = 1;\n }\n\n function Mc(a, b, c, d, e, g) {\n let k = b[e][c];\n if (!w(a, k[0])) return 0;\n for (;;) {\n ++e;\n if (w(a, k[1])) {\n var h;\n if (w(a, k[2])) {\n if (w(a, k[3])) {\n if (w(a, k[6])) {\n h = x;\n c = w(a, k[8]);\n k = w(a, k[9 + c]);\n k = 2 * c + k;\n c = 0;\n h = Jf[k];\n var n;\n for (n = 0; n < h.length - 1; ++n) c += c + w(a, h[n]);\n c += 3 + (8 << k);\n } else w(a, k[7]) ? (c = 7 + 2 * w(a, 165), c += w(a, 145)) : c = 5 + w(a, 159);\n } else c = w(a, k[4]) ? 3 + w(a, k[5]) : 2;\n k = b[Nc[e]][2];\n } else k = b[Nc[e]][1], c = 1;\n h = Kf[e - 1];\n g[g[g.length - 1] + h] = (w(a, 128) ? -c : c) * d[(h > 0) + 0];\n if (e == 16 || !w(a, k[0])) return e;\n } else k = b[Nc[e]][0];\n if (e == 16) return 16;\n }\n }\n\n function ob(a, b) {\n return ((16777216 * a[0] + 65536 * a[1] + 256 * a[2] + 1 * a[3]) * Lf\n & 4278190080) >> b;\n }\n\n function Mf(a, b) {\n let c = 0;\n if (a == p) return 0;\n if (b == p) return Y(a, 'VP8_STATUS_INVALID_PARAM', 'NULL VP8Io parameter in VP8Decode().');\n if (!a.za && !Hd(a, b)) return 0;\n $(a.za);\n let d;\n if (b.Mb && !b.Mb(b)) Y(a, Nf, 'Frame setup failed'), d = a.a;\n else {\n b.Za && (a.A = 0);\n const e = uc[a.A];\n a.A == 2 ? (a.lb = 0, a.mb = 0) : (a.lb = b.t - e >> 4, a.mb = b.k - e >> 4, a.lb < 0 && (a.lb = 0), a.mb < 0 && (a.mb = 0));\n a.Ya = b.K + 15 + e >> 4;\n a.wb = b.Ka + 15 + e >> 4;\n a.wb > a.Ma && (a.wb = a.Ma);\n a.Ya > a.hb && (a.Ya = a.hb);\n d = L;\n }\n if (c = d == L) {\n if (c) {\n let g;\n b: {\n a.Ja = 0;\n if (a.qb) {\n const k = a.rc;\n if (!WebPWorkerReset(k)) {\n g = Y(a, cb, 'thread initialization failed.');\n break b;\n }\n k.Qd = a;\n k.Rd = a.oa.N;\n k.Ud = FinishRow;\n a.jb = a.A > 0 ? Od : Od - 1;\n } else a.jb = Of;\n g = 1;\n }\n let h;\n if (!(h = !g)) {\n let n;\n b: {\n const l = a.jb;\n const m = a.Ma;\n const t = 4 * m;\n const q = 32 * m;\n const r = m + 1;\n const u = a.A > 0 ? m * (a.qb ? 2 : 1) : 0;\n const v = Pf;\n const C = q * (16 * l + parseInt(3 * uc[a.A] / 2, 10));\n const A = a.Ga != p ? a.P.l * a.P.v : 0;\n const z = t + q + r + u + v + 384 + C + A + Pd;\n if (z != z) n = 0;\n else {\n if (z > a.Gb) {\n a.ib = 0;\n a.Gb = 0;\n if (a.ib == p) {\n n = Y(a, 'VP8_STATUS_OUT_OF_MEMORY', 'no memory during frame initialization.');\n break b;\n }\n a.Gb = z;\n }\n a.dc = 205;\n a.Xc = rc(205, 16 * m);\n a.Sc = rc(205, 8 * m);\n a.Vc = rc(205, 8 * m);\n a.M = u ? ic(Oc, u) : p;\n a.Sd = u ? 0 : p;\n a.oa.ha = 0;\n a.oa.M = a.M;\n $((v & Pd) == 0);\n a.Ea = rc(205, 1 * v);\n a.z = -12851;\n a.H = 16 * m;\n a.r = 8 * m;\n const Ha = uc[a.A];\n const G = Ha * a.H;\n const y = Ha / 2 * a.r;\n a.ca = U(C, 205);\n a.da = +G;\n a.aa = a.ca;\n a.ba = a.da + 16 * l * a.H + y;\n a.ra = a.aa;\n a.sa = a.ba + 8 * l * a.r + y;\n a.Xb = A ? U(A, x) : p;\n a.La = ic(Qd, r);\n a.dc = rc($b, t);\n n = 1;\n }\n }\n h = !n;\n }\n if (h) c = 0;\n else {\n b.width = a.P.l;\n b.height = a.P.v;\n b.w = 0;\n b.y = a.ca;\n b.D = a.da;\n b.c = a.aa;\n b.B = a.ba;\n b.S = a.ra;\n b.C = a.sa;\n b.F = a.H;\n b.Da = a.r;\n b.p = p;\n b.q = p;\n if (!Rd) {\n let B;\n for (B = -255; B <= 255; ++B) va[255 + B] = B < 0 ? -B : B, tc[255 + B] = va[255 + B] >> 1;\n for (B = -1020; B\n <= 1020; ++B) sc[1020 + B] = B < -128 ? -128 : B > 127 ? 127 : B;\n for (B = -112; B <= 112; ++B) oc[112 + B] = B < -16 ? -16 : B > 15 ? 15 : B;\n for (B = -255; B <= 510; ++B) oa[255 + B] = B < 0 ? 0 : B > 255 ? 255 : B;\n Rd = 1;\n }\n mc = pf;\n Pc = qf;\n Qc = nc;\n Rc = rf;\n Sd = uf;\n Td = vf;\n Ud = yf;\n Vd = zf;\n Wd = wf;\n Xd = xf;\n Yd = Af;\n Zd = Bf;\n $d = Dd;\n ae = Ed;\n be = sf;\n ce = tf;\n c = 1;\n }\n }\n if (c) {\n a: {\n for (a.d = 0; a.d < a.Ya; ++a.d) {\n const Qf = a.ic[a.d & a.Hb - 1];\n const db = a;\n const F = db.La[0];\n F.X = 0;\n F.ua = 0;\n jd(db.cc, 0, $b, db.cc.length);\n db.W = (db.A > 0 && db.d >= db.mb && db.d <= db.Ya) + 0;\n for (a.i = 0; a.i < a.Ma; a.i++) {\n var D;\n const H = a;\n const T = Qf;\n const ya = H.o;\n const S = H.La[0];\n const J = H.La[1 + H.i];\n H.Ca.ob && (H.Lb = !w(ya,\n H.R.Ta[0]) ? 0 + w(ya, H.R.Ta[1]) : 2 + w(ya, H.R.Ta[2]));\n J.Nb = H.pc ? w(ya, H.Pc) : 0;\n const O = H.dc;\n O[O.length - 1] = 0 + 4 * H.i;\n const Sc = H.cc;\n H.wa = !w(ya, 145);\n if (H.wa) {\n for (var ga = H.Eb, ja = 0, Z = ca, Z = 0; Z < 4; ++Z) {\n var V = Sc[Z];\n var R;\n for (R = 0; R < 4; ++R) {\n const ta = Rf[O[O[O.length - 1] + R]][V];\n var za = 0;\n do za = Sf[2 * za + w(ya, ta[za])]; while (za > 0);\n V = -za;\n O[O[O.length - 1] + R] = V;\n ga[ja] = V;\n ja++;\n }\n Sc[Z] = V;\n }\n } else {\n var V = w(ya, 156) ? w(ya, 128) ? de : ee : w(ya, 163) ? fe : ge;\n H.Eb[0] = V;\n for (za = 0; za < 4; ++za) O[za + O[O.length - 1]] = V;\n for (za = 0; za < 4; ++za) Sc[za] = V;\n }\n H.Tc = !w(ya, 142) ? ge : !w(ya, 114) ? fe\n : w(ya, 183) ? de : ee;\n if (ya.Ab) D = 0;\n else {\n if (J.Nb) S.X = J.X = 0, H.wa || (S.ua = J.ua = 0), H.ja = 0, H.Oa = 0;\n else {\n let ia = ca;\n let ka = ca;\n var sa = ca;\n var wa = Tf;\n const Aa = H.yb[H.Lb];\n var aa = H.z;\n const ma = H.La[0];\n const ua = U(4, 0);\n const xa = U(4, 0);\n let ea = U(4, 0);\n let pb = U(4, 0);\n let na = 0;\n let Ba = 0;\n var pa = ca;\n let qa = ca;\n let Sa = ca;\n var aa = rc(0, 384);\n if (H.wa) sa = 0, wa = H.R.z[3];\n else {\n const ab = U(16, 0);\n var Ca = J.ua + ma.ua;\n J.ua = ma.ua = (Mc(T, H.R.z[1], Ca, Aa.sb, 0, ab) > 0) + 0;\n for (var sa = 1, wa = H.R.z[0], qb = ab, Ta = aa, La = U(16, s), X = s, X = 0; X < 4; ++X) {\n var Da = qb[0 + X] + qb[12 + X];\n var Ea = qb[4 + X] + qb[8 + X];\n var Fa = qb[4 + X] - qb[8 + X];\n var Ga = qb[0 + X] - qb[12 + X];\n La[0 + X] = Da + Ea;\n La[8\n + X] = Da - Ea;\n La[4 + X] = Ga + Fa;\n La[12 + X] = Ga - Fa;\n }\n for (X = 0; X < 4; ++X) {\n const Oa = Ta[Ta.length - 1];\n const lb = La[0 + 4 * X] + 3;\n var Da = lb + La[3 + 4 * X];\n var Ea = La[1 + 4 * X] + La[2 + 4 * X];\n var Fa = La[1 + 4 * X] - La[2 + 4 * X];\n var Ga = lb - La[3 + 4 * X];\n Ta[Oa + 0] = Da + Ea >> 3;\n Ta[Oa + 16] = Ga + Fa >> 3;\n Ta[Oa + 32] = Da - Ea >> 3;\n Ta[Oa + 48] = Ga - Fa >> 3;\n Ta[Ta.length - 1] += 64;\n }\n aa[aa.length - 1] = 0;\n }\n ea = Nb(vc[J.X & 15]);\n pb = Nb(vc[ma.X & 15]);\n for (qa = 0; qa < 4; ++qa) {\n for (var Eb = pb[qa], pa = 0; pa < 4; ++pa) {\n var Ca = Eb + ea[pa];\n var Ka = Mc(T, wa, Ca, Aa.sc, sa, aa);\n ea[pa] = Eb = (Ka > 0) + 0;\n xa[pa] = (aa[aa[aa.length - 1] + 0] != 0) + 0;\n ua[pa] = (Ka > 1) + 0;\n aa[aa.length\n - 1] += 16;\n }\n pb[qa] = Eb;\n Ba |= ob(xa, 24 - 4 * qa);\n na |= ob(ua, 24 - 4 * qa);\n }\n ia = ob(ea, 24);\n ka = ob(pb, 24);\n ea = Nb(vc[J.X >> 4]);\n pb = Nb(vc[ma.X >> 4]);\n for (Sa = 0; Sa < 4; Sa += 2) {\n for (qa = 0; qa < 2; ++qa) {\n Eb = pb[Sa + qa];\n for (pa = 0; pa < 2; ++pa) Ca = Eb + ea[Sa + pa], Ka = Mc(T, H.R.z[2], Ca, Aa.qc, 0, aa), ea[Sa + pa] = Eb = (Ka > 0) + 0, xa[2 * qa + pa] = (aa[aa[aa.length - 1] + 0] != 0) + 0, ua[2 * qa + pa] = (Ka > 1) + 0, aa[aa.length - 1] += 16;\n pb[Sa + qa] = Eb;\n }\n Ba |= ob(xa, 8 - 2 * Sa);\n na |= ob(ua, 8 - 2 * Sa);\n }\n ia |= ob(ea, 20);\n ka |= ob(pb, 20);\n J.X = ia;\n ma.X = ka;\n H.z = aa;\n H.Oa = na + 0;\n H.ja = na | Ba;\n J.Nb = !H.ja + 0;\n }\n D = !T.Ab;\n }\n if (!D) {\n c = Y(a, 'VP8_STATUS_NOT_ENOUGH_DATA',\n `Premature end-of-file encountered.${a.i} ${a.d}`);\n break a;\n }\n const P = a;\n const da = P.Ea;\n const Ma = Tc;\n const Ua = P.Ea;\n const Va = Uc;\n const Wa = P.Ea;\n const Xa = he;\n if (P.i > 0) {\n for (var ba = ca, ba = -1; ba < 16; ++ba) Ec(da, Ma + ba * f - 4, da, Ma + ba * f + 12);\n for (ba = -1; ba < 8; ++ba) Ec(Ua, Va + ba * f - 4, Ua, Va + ba * f + 4), Ec(Wa, Xa + ba * f - 4, Wa, Xa + ba * f + 4);\n } else {\n for (ba = 0; ba < 16; ++ba) da[Ma + ba * f - 1] = 129;\n for (ba = 0; ba < 8; ++ba) Ua[Va + ba * f - 1] = 129, Wa[Xa + ba * f - 1] = 129;\n P.d > 0 && (da[Ma - 1 - f] = Ua[Va - 1 - f] = Wa[Xa - 1 - f] = 129);\n }\n const Qa = P.Xc;\n const Ra = 16 * +P.i;\n const mb = P.Sc;\n const vb = 8 * +P.i;\n const wb = P.Vc;\n const xb = 8 * +P.i;\n const Za = P.z;\n let fa = ca;\n if (P.d > 0) {\n N(da, Ma - f, Qa, Ra,\n 16), N(Ua, Va - f, mb, vb, 8), N(Wa, Xa - f, wb, xb, 8);\n } else if (P.i == 0) {\n for (i = 0; i < 21; ++i) da[Ma - f - 1 + i] = 127;\n for (i = 0; i < 9; ++i) Ua[Va - f - 1 + i] = 127;\n for (i = 0; i < 9; ++i) Wa[Xa - f - 1 + i] = 127;\n }\n if (P.wa) {\n const Ya = Ma - f + 16;\n P.d > 0 && (P.i >= P.Ma - 1 ? da[Ya + 0] = da[Ya + 1] = da[Ya + 2] = da[Ya + 3] = Qa[Ra + 15] : N(da, Ya + 0, Qa, Ra + 16, 4));\n for (let Fb = 0; Fb < 4; ++Fb) da[Fb + Ya + 4 * f] = da[Fb + Ya + 4 * f] = da[Fb + Ya + 8 * f] = da[Fb + Ya + 12 * f] = da[Fb + Ya + 0];\n for (fa = 0; fa < 16; fa++) {\n var ac = da;\n var bc = Ma + ie[fa];\n Uf[P.Eb[fa]](ac, bc);\n P.Oa & 1 << fa ? mc(Za, 16 * +fa, ac, bc, 0) : P.ja & 1 << fa && Qc(Za, 16 * +fa, ac, bc);\n }\n } else {\n var $a = Fd(P, P.Eb[0]);\n Vf[$a](da, Ma);\n if (P.ja) for (fa = 0; fa < 16; fa++) ac = da, bc = Ma + ie[fa], P.Oa & 1 << fa ? mc(Za, 16 * +fa, ac, bc, 0) : P.ja & 1 << fa && Qc(Za, 16 * +fa, ac, bc);\n }\n $a = Fd(P, P.Tc);\n je[$a](Ua, Va);\n je[$a](Wa, Xa);\n if (P.ja & 983040) {\n const zb = P.z;\n var Pa = 256;\n P.Oa & 983040 ? Pc(zb, Pa, Ua, Va) : Rc(zb, Pa, Ua, Va);\n }\n if (P.ja & 15728640) {\n const Ab = P.z;\n var Pa = 320;\n P.Oa & 15728640 ? Pc(Ab, Pa, Wa, Xa) : Rc(Ab, Pa, Wa, Xa);\n }\n P.d < P.hb - 1 && (N(Qa, Ra, da, Ma + 15 * f, 16), N(mb, vb, Ua, Va + 7 * f, 8), N(wb, xb, Wa, Xa + 7 * f, 8));\n const Q = a;\n if (Q.A > 0) {\n const kb = Q.M[1 + Q.i];\n const Kb = Q.La[1 + Q.i].Nb;\n let ha = Q.Zb[Q.Lb];\n Q.ga.oc && (ha\n += Q.ga.Lc[0], Q.wa && (ha += Q.ga.Gc[0]));\n ha = ha < 0 ? 0 : ha > 63 ? 63 : ha;\n kb.zc = ha;\n Q.ga.kb > 0 && (ha = Q.ga.kb > 4 ? ha >> 2 : ha >> 1, ha > 9 - Q.ga.kb && (ha = 9 - Q.ga.kb));\n kb.yc = ha < 1 ? 1 : ha;\n kb.ab = (!Kb || Q.wa) + 0;\n }\n for (var Ia = ca, Bb = 8 * Q.Ja * Q.r, Qb = Q.ca, Ub = Q.da + 16 * Q.i + 16 * Q.Ja * Q.H, Wb = Q.aa, Xb = Q.ba + 8 * Q.i + Bb, Yb = Q.ra, Zb = Q.sa + 8 * Q.i + Bb, Ia = 0; Ia < 16; ++Ia) N(Qb, Ub + Ia * Q.H, Q.Ea, +Tc + Ia * f, 16);\n for (Ia = 0; Ia < 8; ++Ia) N(Wb, Xb + Ia * Q.r, Q.Ea, +Uc + Ia * f, 8), N(Yb, Zb + Ia * Q.r, Q.Ea, +he + Ia * f, 8);\n }\n const K = a;\n const I = b;\n var cc = 1;\n const eb = K.oa;\n if (K.qb) {\n const nb = K.rc;\n var cc = cc & WebPWorkerSync(nb);\n $(nb.a == OK);\n if (cc) {\n eb.N = I;\n eb.ha = K.Ja;\n eb.d = K.d;\n eb.W = K.W;\n if (eb.W) {\n const hc = eb.M;\n eb.M = K.M;\n K.M = hc;\n }\n WebPWorkerLaunch(nb);\n ++K.Ja == K.jb && (K.Ja = 0);\n }\n } else {\n eb.d = K.d;\n eb.W = K.W;\n b: {\n let Hb = 1;\n const rb = K.oa;\n const ib = uc[K.A];\n const yb = ib * K.H;\n const dc = parseInt(ib / 2) * K.r;\n const Ib = 16 * rb.ha * K.H;\n const jb = 8 * rb.ha * K.r;\n const Jb = K.ca;\n const Lb = K.da - yb + Ib;\n const Ob = K.aa;\n const Pb = K.ba - dc + jb;\n const Rb = K.ra;\n const Sb = K.sa - dc + jb;\n const jc = rb.d == 0;\n const Tb = (rb.d >= K.hb - 1) + 0;\n var ra = 16 * rb.d;\n let fb = 16 * (rb.d + 1);\n if (rb.W) {\n const pc = K;\n let wc = s;\n const kc = pc.oa.d;\n $(pc.oa.W);\n for (wc = pc.lb; wc < pc.wb; ++wc) {\n const Na = pc;\n const ec = wc;\n const Vb = kc;\n const xc = Na.oa;\n const gb = Na.H;\n const fc = xc.M[1 + ec];\n const sb = Na.ca;\n const tb = Na.da + 16 * xc.ha\n * gb + 16 * ec;\n const Gb = fc.zc;\n const hb = fc.yc;\n const Ja = 2 * Gb + hb;\n if (Gb != 0) {\n if (Na.A == 1) ec > 0 && ae(sb, tb, gb, Ja + 4), fc.ab && ce(sb, tb, gb, Ja), Vb > 0 && $d(sb, tb, gb, Ja + 4), fc.ab && be(sb, tb, gb, Ja);\n else {\n const gc = Na.r;\n const yc = Na.aa;\n const zc = Na.ba + 8 * xc.ha * gc + 8 * ec;\n const Ac = Na.ra;\n const Bc = Na.sa + 8 * xc.ha * gc + 8 * ec;\n const ub = Na.Ac.fb ? Gb >= 40 ? 2 : Gb >= 15 ? 1 : 0 : Gb >= 40 ? 3 : Gb >= 20 ? 2 : Gb >= 15 ? 1 : 0;\n ec > 0 && (Td(sb, tb, gb, Ja + 4, hb, ub), Vd(yc, zc, Ac, Bc, gc, Ja + 4, hb, ub));\n fc.ab && (Xd(sb, tb, gb, Ja, hb, ub), Zd(yc, zc, Ac, Bc, gc, Ja, hb, ub));\n Vb > 0 && (Sd(sb, tb, gb, Ja + 4, hb, ub), Ud(yc, zc, Ac, Bc, gc, Ja + 4, hb, ub));\n fc.ab && (Wd(sb, tb, gb,\n Ja, hb, ub), Yd(yc, zc, Ac, Bc, gc, Ja, hb, ub));\n }\n }\n }\n }\n if (I.put) {\n jc ? (I.y = K.ca, I.D = K.da + Ib, I.c = K.aa, I.B = K.ba + jb, I.S = K.ra, I.C = K.sa + jb) : (ra -= ib, I.y = Jb, I.D = Lb, I.c = Ob, I.B = Pb, I.S = Rb, I.C = Sb);\n Tb || (fb -= ib);\n fb > I.K && (fb = I.K);\n if (K.Ga != p && ra < fb && (ra == 0 ? (I.p = qd(K, ra, fb - ra), I.q = 0) : I.q = qd(K, ra, fb - ra), I.p == p)) {\n cc = Y(K, W, 'Could not decode alpha data.');\n break b;\n }\n if (ra < I.k) {\n const qc = I.k - ra;\n var ra = I.k;\n $(!(qc & 1));\n I.D += K.H * qc;\n I.B += K.r * (qc >> 1);\n I.C += K.r * (qc >> 1);\n I.p != p && (I.q += I.width * qc);\n }\n ra < fb && (I.D += I.t, I.B += I.t >> 1, I.C += I.t >> 1, I.p != p && (I.q += I.t),\n I.w = ra - I.k, I.m = I.Ka - I.t, I.h = fb - ra, Hb = I.put(I));\n }\n rb.ha + 1 == K.jb && !Tb && (N(K.ca, K.da - yb, Jb, Lb + 16 * K.H, yb), N(K.aa, K.ba - dc, Ob, Pb + 8 * K.r, dc), N(K.ra, K.sa - dc, Rb, Sb + 8 * K.r, dc));\n cc = Hb;\n }\n }\n if (!cc) {\n c = Y(a, 'VP8_STATUS_USER_ABORT', 'Output aborted.');\n break a;\n }\n }\n let Cb;\n if (!(Cb = a.qb && !WebPWorkerSync(a.rc))) {\n let Db;\n if (Db = a.fc > 0) $(a), $(a.fc > 0), Db = !1;\n Cb = Db;\n }\n c = Cb ? 0 : 1;\n }\n }\n const lc = c;\n b.Pb && b.Pb(b);\n c = lc & 1;\n }\n if (!c) return ke(a), 0;\n a.za = 0;\n return c;\n }\n\n function ke(a) {\n a != p && (a.ib && (a.ib = 0), a.ib = p, a.Gb = 0, a.za = 0);\n }\n\n function Aa(a, b) {\n return a + (1 << b) - 1 >> b;\n }\n\n function hc(a, b, c, d, e) {\n const g = vb[c] + wb[b] >> ea;\n b = xb[b];\n d[e + 0] = ia[a + Za[c] - J];\n d[e + 1] = ia[a + g - J];\n d[e + 2] = ia[a + b - J];\n }\n\n function le(a, b, c, d, e) {\n const g = vb[c] + wb[b] >> ea;\n b = xb[b];\n d[e + 0] = ia[a + Za[c] - J] & 248 | ia[a + g - J] >> 5;\n d[e + 1] = ia[a + g - J] << 3 & 224 | ia[a + b - J] >> 3;\n }\n\n function me(a, b, c, d, e) {\n d[e + 0] = 255;\n hc(a, b, c, d, e + 1);\n }\n\n function ne(a, b, c, d, e) {\n const g = xb[b];\n d[e + 0] = Hb[a + Za[c] - J] << 4 | Hb[a + (vb[c] + wb[b] >> ea) - J];\n d[e + 1] = 15 | Hb[a + g - J] << 4;\n }\n\n function Vc(a, b, c, d, e) {\n const g = Za[c];\n c = vb[c] + wb[b] >> ea;\n d[e + 0] = ia[a + xb[b] - J];\n d[e + 1] = ia[a + c - J];\n d[e + 2] = ia[a + g - J];\n }\n\n function oe(a, b, c, d, e) {\n Vc(a, b, c, d, e);\n d[e + 3] = 255;\n }\n\n function pe(a, b, c, d, e) {\n hc(a, b, c, d, e);\n d[e + 3] = 255;\n }\n\n function ib(a, b, c) {\n a[b] = ((((a[b] & 4278255360) >>> 0) + ((c & 4278255360) >>> 0) & 4278255360) >>> 0 | (a[b] & 16711935) + (c & 16711935) & 16711935) >>> 0;\n }\n\n function ka(a, b) {\n return (((a ^ b) & 4278124286) >>> 1) + ((a & b) >>> 0) >>> 0;\n }\n\n function $a(a) {\n return a < 256 && a > 0 ? a : a <= 0 ? 0 : ~a >> 24 & 255;\n }\n\n function yb(a, b) {\n return $a(a + parseInt((a - b) / 2, 10));\n }\n\n function Wc() {\n return qe;\n }\n\n function Xc(a, b) {\n a &= 255;\n b &= 255;\n a > 127 && (a -= 256);\n b > 127 && (b -= 256);\n return a * b >>> 5;\n }\n\n function re(a,\n b, c, d, e, g, k) {\n var h = s;\n const n = 8 >> a.n;\n const l = a.U;\n const f = a.u;\n if (n < 8) {\n a = (1 << a.n) - 1;\n for (var t = (1 << n) - 1, h = b; h < c; ++h) {\n b = 0;\n for (var q = s, q = 0; q < l; ++q) (q & a) == 0 && (b = d[e++] >> 8 & 255), g[k++] = f[b & t], b >>= n;\n }\n } else for (h = b; h < c; ++h) for (q = 0; q < l; ++q) g[k++] = f[d[e++] >> 8 & 255];\n }\n\n function se(a, b, c, d, e) {\n for (c = b + c; b < c;) {\n const g = a[b++];\n d[e++] = g >> 16 & 255;\n d[e++] = g >> 8 & 255;\n d[e++] = g >> 0 & 255;\n d[e++] = g >> 24 & 255;\n }\n }\n\n function te(a, b, c, d, e) {\n for (c = b + c; b < c;) {\n const g = a[b++];\n d[e++] = g >> 16 & 240 | g >> 12 & 15;\n d[e++] = g >> 0 & 240 | g >> 28 & 15;\n }\n }\n\n function Ib(a, b, c, d, e) {\n for (c = b + c; b < c;) {\n const g = a[b++];\n d[e++] = g >> 24 & 255;\n d[e++] = g >> 16 & 255;\n d[e++] = g >> 8 & 255;\n d[e++] = g >> 0 & 255;\n }\n }\n\n function ue(a, b, c, d) {\n if (T(a, 8) != ve) return 0;\n b[0] = T(a, we) + 1;\n c[0] = T(a, we) + 1;\n d[0] = T(a, 1);\n T(a, Wf);\n return 1;\n }\n\n function xe(a, b) {\n let c = s;\n if (a < 4) return a + 1;\n c = a - 2 >> 1;\n return (2 + (a & 1) << c) + T(b, c) + 1;\n }\n\n function Oa(a, b) {\n if (b.Q + 8 > b.ya) {\n var c = a.Y;\n var d = 0;\n for ($(c != p); c[d].s != 0;) {\n var e = c;\n var g = b;\n const k = g.T >> g.g & 1;\n g.L ? g.fa = 1 : (++g.g, g.g >= 8 && Sb(g), g.Q == g.ya && g.g == 32 && (g.L = 1));\n d = d + e[d].s + k;\n }\n return c[d].kc;\n }\n c = a.Y;\n d = 0;\n for ($(c != p); c[d].s != 0;) {\n e = c, g = b.T >> b.g & 1, ++b.g, d = d\n + e[d].s + g;\n }\n return c[d].kc;\n }\n\n function zb(a, b) {\n if (a != p) for (var c = s, d = s, c = 0; c < b; ++c) for (var e = a[c].va, d = 0; d < Yc; ++d) ja(e[d]);\n }\n\n function ye(a, b, c) {\n b = a.eb == 0 ? 0 : a.ac[a.bd + a.Ec * (c >> a.eb) + (b >> a.eb)];\n $(b < a.hc);\n return a.Db[+b];\n }\n\n function ze(a, b, c, d) {\n let e = a.Na;\n const g = a.O;\n const k = g + b;\n var h = c;\n var f = d;\n d = a.Xa;\n c = a.vb;\n for (N(d, c, h, f, a.l * b); e-- > 0;) {\n b = a.nc[e];\n let l = g;\n var m = k;\n var t = h;\n var q = f;\n var f = d;\n var h = c;\n $(l < m);\n $(m <= b.Vb);\n switch (b.Qc) {\n case Ae:\n t = 0;\n for (b = h + (m - l) * b.U; h < b;) {\n var m = f;\n var q = h;\n var r = m[q] >> 8 & 255;\n var u = (m[q] & 16711935) >>> 0;\n var u = u + (r << 16 | r);\n var u = u & 16711935;\n f[h++] = ((m[q] & 4278255360)\n >>> 0 | u) >>> 0;\n l == 32 && t++;\n }\n break;\n case Be:\n var v = b;\n var C = l;\n var t = m;\n var q = f;\n var r = h;\n var u = v.U;\n if (C == 0) {\n var A = s;\n ib(q, r, qe);\n for (A = 1; A < u; ++A) ib(q, r + A, q[r + A - 1]);\n r += u;\n ++C;\n }\n for (var z = (1 << v.n) - 1, Ha = Aa(u, v.n), w = v.u, v = +(C >> v.n) * Ha; C < t;) {\n var y = w;\n var B = v;\n let G = p;\n ib(q, r, q[r - u + 0]);\n G = Ce[y[B++] >> 8 & 15];\n for (A = 1; A < u; ++A) {\n let F = E;\n (A & z) == 0 && (G = Ce[y[B++] >> 8 & 15]);\n F = G(q[r + A - 1], q, r + A - u);\n ib(q, r + A, F);\n }\n r += u;\n ++C;\n (C & z) == 0 && (v += Ha);\n }\n m != b.Vb && (b = b.U, N(f, h - b, f, h + (m - l - 1) * b, b));\n break;\n case De:\n t = b.U;\n q = (1 << b.n) - 1;\n r = Aa(t, b.n);\n u = b.u;\n for (b = +(l >> b.n) * r; l < m;) {\n A = u;\n C = b;\n z = M(Xf);\n Ha = s;\n for (Ha = 0; Ha < t; ++Ha) (Ha & q) == 0 && (w = A[C++], v = z, v.Cc = w >> 0 & 255, v.Bc = w >> 8 & 255, v.Kc = w >> 16 & 255), w = f[h + Ha], v = w >>> 8, y = w >>> 16, B = w, y += Xc(z.Cc, v), y &= 255, B += Xc(z.Bc, v), B += Xc(z.Kc, y), B &= 255, f[h + Ha] = (w & 4278255360 | y << 16 | B) >>> 0;\n h += t;\n ++l;\n (l & q) == 0 && (b += r);\n }\n break;\n case Ee:\n t == f && b.n > 0 ? (t = (m - l) * Aa(b.U, b.n), q = h + (m - l) * b.U - t, memmove(f, q, f, h, t), re(b, l, m, f, q, f, h)) : re(b, l, m, t, q, f, h);\n }\n h = d;\n f = c;\n }\n }\n\n function Yf(a, b) {\n var c = a.V;\n var d = a.Ha + a.l * a.O;\n var e = b - a.O;\n if (!(e <= 0)) {\n ze(a, e, c, d);\n var g = a.N;\n var c = a.Xa;\n let k = [a.vb];\n var d = a.O;\n var e = b;\n var h = k;\n var f = g.width;\n $(d < e);\n $(g.t < g.Ka);\n e > g.K && (e = g.K);\n if (d < g.k) {\n var l = g.k - d;\n var d = g.k;\n h[0] += f * l;\n }\n d >= e ? d = 0 : (h[0] += g.t, g.w = d - g.k, g.m = g.Ka - g.t, g.h = e - d, d = 1);\n if (d) {\n k = k[0];\n d = a.Ib;\n e = g.width;\n if (d.J < ua) {\n var m = d.c.RGBA;\n var h = m.ma;\n let t = m.Sa + a.xa * m.f;\n if (g.I) c = EmitRescaledRows(a, c, k, e, g.h, h, t, m.f);\n else {\n for (var f = d.J, l = g.m, g = g.h, m = m.f, q = g; q-- > 0;) {\n const r = c;\n let u = k;\n let v = l;\n const C = h;\n let A = t;\n switch (f) {\n case Qa:\n for (v = u + v; u < v;) {\n var z = r[u++];\n C[A++] = z >> 16 & 255;\n C[A++] = z >> 8 & 255;\n C[A++] = z >> 0 & 255;\n }\n break;\n case jb:\n se(r, u, v, C, A);\n break;\n case Ob:\n se(r, u, v, C, A);\n WebPApplyAlphaMultiply(C, 0, v,\n 1, 0);\n break;\n case Zc:\n for (v = u + v; u < v;) z = r[u++], C[A++] = z >> 0 & 255, C[A++] = z >> 8 & 255, C[A++] = z >> 16 & 255;\n break;\n case Pa:\n Ib(r, u, v, C, A);\n break;\n case Pb:\n Ib(r, u, v, C, A);\n WebPApplyAlphaMultiply(C, 0, v, 1, 0);\n break;\n case Ab:\n Ib(r, u, v, C, A);\n break;\n case Bb:\n Ib(r, u, v, C, A);\n WebPApplyAlphaMultiply(C, 1, v, 1, 0);\n break;\n case kb:\n te(r, u, v, C, A);\n break;\n case Qb:\n te(r, u, v, C, A);\n WebPApplyAlphaMultiply4444(C, v, 1, 0);\n break;\n case Fe:\n for (v = u + v; u < v;) z = r[u++], C[A++] = z >> 16 & 248 | z >> 13 & 7, C[A++] = z >> 5 & 224 | z >> 3 & 31;\n break;\n default:\n $(0);\n }\n k += e;\n t += m;\n }\n c = g;\n }\n a.xa += c;\n } else {\n a.xa = g.I ? EmitRescaledRowsYUVA(a, c, k, e, g.h) : EmitRowsYUVA(a, c, k, e, g.m, g.h);\n }\n $(a.xa <= d.height);\n }\n a.O = b;\n $(a.O <= a.v);\n }\n }\n\n function lc(a, b, c, d, e, g) {\n let k = 1;\n let h = 0;\n let f = 0;\n const l = a.o;\n const m = a.cb;\n let t = m.Db;\n let q = c;\n let r = c;\n c += d * e;\n e = Ba + Ge;\n const u = e + m.xb;\n const v = m.xb > 0 ? m.Yb : p;\n const C = m.Dc;\n let A = !1;\n $(t != p);\n for (; !l.L && q < c;) {\n let z = s;\n A || ((h & C) == 0 && (t = ye(m, h, f)), Da(l), z = Oa(t.va[Zf], l));\n if (z < Ba || A) {\n if (!A) {\n var w = k = A = s;\n var y = s;\n Da(l);\n A = Oa(t.va[$f], l);\n k = z;\n Da(l);\n w = Oa(t.va[ag], l);\n Da(l);\n y = Oa(t.va[bg], l);\n b[q] = (y << 24 >>> 0) + (A << 16) + (k << 8) + w;\n }\n A = !1;\n ++q;\n ++h;\n if (h >= d && (h = 0, ++f, g != p && f\n % $c == 0 && g(a, f), v != p)) for (; r < q;) k = b[r++], v.ea[ad * k >>> v.bb] = k;\n } else if (z < e) {\n w = w = s;\n k = xe(z - Ba, l);\n z = Oa(t.va[cg], l);\n Da(l);\n w = xe(z, l);\n w > He ? w -= He : (z = dg[w - 1], z = (z >> 4) * d + (8 - (z & 15)), w = z >= 1 ? z : 1);\n z = s;\n for (z = 0; z < k; ++z) b[q + z] = b[q + z - w];\n q += k;\n for (h += k; h >= d;) h -= d, ++f, g != p && f % $c == 0 && g(a, f);\n if (q < c && (t = ye(m, h, f), v != p)) for (; r < q;) k = b[r++], v.ea[ad * k >>> v.bb] = k;\n } else if (z < u) {\n A = z - e;\n for ($(v != p); r < q;) z = b[r++], v.ea[ad * z >>> v.bb] = z;\n z = b;\n w = q;\n y = v;\n $(A <= -1 >>> y.bb);\n z[w] = y.ea[A];\n A = !0;\n continue;\n }(k = !l.fa) || End;\n }\n g != p && g(a, f);\n l.fa || !k || l.L && q < c ? (k = 0, a.a = !l.L ? W : Ie) : q == c && (a.Ob = Db);\n return k;\n }\n\n function bd(a) {\n $(a);\n a.ac = p;\n zb(a.Db, a.hc);\n const b = a.Yb;\n b != p && (b.ea = p, b.ea = p);\n $(a);\n }\n\n function sd() {\n const a = M(eg);\n if (a == p) return p;\n a.a = L;\n a.Wa = cd;\n a.Ob = cd;\n return a;\n }\n\n function sa(a) {\n let b = s;\n if (a != p) {\n bd(a.cb);\n a.V = p;\n a.V = p;\n for (b = 0; b < a.Na; ++b) {\n const c = a.nc[b];\n c.u = p;\n c.u = p;\n }\n a.Na = 0;\n a.Ub = 0;\n a.Mc = p;\n a.Mc = p;\n a.Ib = p;\n }\n }\n\n function Ka(a, b, c, d, e) {\n var g = 1;\n a = [a];\n b = [b];\n for (var k = d.o, h = d.cb, f = p, l = p, l = 0; ;) {\n if (c) {\n for (; g && T(k, 1);) {\n var m = a;\n var t = b;\n var q = d;\n var r = 1;\n var u = q.o;\n var g = q.nc[q.Na];\n var v = T(u, 2);\n if (q.Ub & 1 << v) g = 0;\n else {\n q.Ub\n |= 1 << v;\n g.Qc = v;\n g.U = m[0];\n g.Vb = t[0];\n g.u = [p];\n g.b = 0;\n ++q.Na;\n $(q.Na <= Je);\n switch (v) {\n case Be:\n case De:\n g.n = T(u, 3) + 2;\n r = Ka(Aa(g.U, g.n), Aa(g.Vb, g.n), 0, q, g.u);\n break;\n case Ee:\n t = T(u, 8) + 1;\n r = t > 16 ? 0 : t > 4 ? 1 : t > 2 ? 2 : 3;\n m[0] = Aa(g.U, r);\n g.n = r;\n if (m = r = Ka(t, 1, 0, q, g.u)) {\n if (m = t, q = g, r = s, t = 1 << (8 >>> q.n) >>> 0, u = Array(t), u == p) m = 0;\n else {\n var v = q.u[0];\n var C = q.b;\n u[0] = q.u[0][q.b + 0];\n for (r = 1; r < m; ++r) u[r] = ((((v[C + r] & 4278255360) >>> 0) + ((u[r - 1] & 4278255360) >>> 0) & 4278255360) >>> 0 | (v[C + r] & 16711935) + (u[r - 1] & 16711935) & 16711935) >>> 0;\n for (; r < t; ++r) u[r] = 0;\n q.u[0] = p;\n q.b = p;\n q.u[0] = u;\n q.b = 0;\n m = 1;\n }\n }\n r = m;\n break;\n case Ae:\n break;\n default:\n $(0);\n }\n g.u = g.u[0];\n g = r;\n }\n }\n }\n if (g && T(k, 1) && (l = T(k, 4), g = l >= 1 && l <= fg, !g)) {\n d.a = W;\n break;\n }\n if (g) {\n a: {\n var g = d;\n var A = a[0];\n var z = b[0];\n var m = l;\n var C = v = s;\n var C = g.o;\n var q = g.cb;\n var r = [p];\n var t = p;\n var u = 1;\n if (c && T(C, 1)) {\n var v = T(C, 3) + 2;\n var A = Aa(A, v);\n var w = Aa(z, v);\n var z = A * w;\n if (!Ka(A, w, 0, g, r)) {\n g.a = W;\n zb(t, u);\n g = 0;\n break a;\n }\n r = r[0];\n q.eb = v;\n for (v = 0; v < z; ++v) A = r[v] >>> 8 & 65535, r[v] = A, A >= u && (u = A + 1);\n }\n if (C.fa) zb(t, u), g = 0;\n else if ($(u <= 65536), t = ld(u, gg), t == p) g.a = cb, zb(t, u), g = 0;\n else {\n for (v = 0; v < u; ++v) {\n z = t[v].va;\n for (C = 0; C < Yc; ++C) {\n A = hg[C];\n C == 0 && m > 0 && (A += 1 << m);\n b: {\n const y = A;\n var A = g;\n const G = z[+C];\n var B = 0;\n var w = A.o;\n if (T(w, 1)) {\n var F = Array(2);\n var D = Array(2);\n var L = Array(2);\n var B = T(w, 1) + 1;\n var J = T(w, 1);\n F[0] = T(w, J == 0 ? 1 : 8);\n D[0] = 0;\n L[0] = B - 1;\n B == 2 && (F[1] = T(w, 8), D[1] = 1, L[1] = B - 1);\n c: {\n var J = 0;\n var H = s;\n $(G != p);\n $(L != p);\n $(D != p);\n $(F != p);\n if (nd(G, B)) {\n for (H = 0; H < B; ++H) {\n if (D[H] != pd) {\n if (F[H] < 0 || F[H] >= y) {\n (J = J && ma(G)) || ja(G);\n B = J;\n break c;\n }\n if (!jc(G, F[H], D[H], L[H])) {\n (J = J && ma(G)) || ja(G);\n B = J;\n break c;\n }\n }\n }(J = (J = 1) && ma(G)) || ja(G);\n B = J;\n } else B = 0;\n }\n } else {\n B = s;\n D = [];\n F = T(w, 4) + 4;\n if (F > Ke) {\n A.a = W;\n A = 0;\n break b;\n }\n L = Array(y);\n if (L == p) {\n A.a = cb;\n A = 0;\n break b;\n }\n for (B = 0; B < F; ++B) D[ig[B]] = T(w, 3);\n c: {\n var B = A;\n var O = D;\n var D = y;\n var F = L;\n var J = 0;\n var H = B.o;\n let S = s;\n let V = s;\n let Y = jg;\n const Z = M(Le);\n if (od(Z, O, Ke)) {\n if (T(H, 1)) {\n if (S = 2 + 2 * T(H, 3), V = 2 + T(H, S), V > D) {\n B.a = W;\n ja(Z);\n B = J;\n break c;\n }\n } else V = D;\n for (S = 0; S < D;) {\n var R = s;\n if (V-- == 0) break;\n Da(H);\n R = Oa(Z, H);\n if (R < Me) F[S++] = R, R != 0 && (Y = R);\n else {\n var O = R == kg;\n var R = R - Me;\n const ea = lg[R];\n var R = T(H, mg[R]) + ea;\n if (S + R > D) {\n B.a = W;\n ja(Z);\n B = J;\n break c;\n }\n for (O = O ? Y : 0; R-- > 0;) F[S++] = O;\n }\n }\n J = 1;\n ja(Z);\n B = J;\n } else B.a = W, B = 0;\n }\n B && (B = od(G, L, y));\n }(B = B && !w.fa) ? A = 1 : (A.a = W, A = 0);\n }\n if (!A) {\n zb(t, u);\n g = 0;\n break a;\n }\n }\n }\n q.ac = r;\n q.hc = u;\n q.Db = t;\n g = 1;\n }\n }\n }\n if (!g) {\n d.a = W;\n break;\n }\n if (l > 0) {\n if (h.xb = 1 << l, m = h.Yb, q = 1 << l, $(m != p), $(l > 0), m.ea = U(q, 0), m.ea == p ? l = 0 : (m.bb = 32 - l, l = 1), !l) {\n d.a = cb;\n g = 0;\n break;\n }\n } else h.xb = 0;\n l = d;\n m = a[0];\n q = b[0];\n r = l.cb;\n t = r.eb;\n l.l = m;\n l.v = q;\n r.Ec = Aa(m, t);\n r.Dc = t == 0 ? -1 : (1 << t) - 1;\n if (c) {\n d.Ob = Cb;\n break;\n }\n f = Array(a * b);\n l = 0;\n if (f == p) {\n d.a = cb;\n g = 0;\n break;\n }\n g = (g = lc(d, f, l, a, b, p)) && !k.fa;\n break;\n }\n g ? (e != p ? e[0] = f : ($(f == p), $(c)), c || bd(h)) : (bd(h), d.a == W && d.o.L && (d.a = Ie));\n return g;\n }\n\n function xd(a, b) {\n const c = a.l * a.v;\n const d = c + b + b * $c;\n $(a.l <= b);\n a.V = Array(d);\n a.Ha = 0;\n if (a.V == p) {\n return a.Xa = p, a.a = cb, 0;\n }\n a.Xa = a.V;\n a.vb = a.Ha + c + b;\n return 1;\n }\n\n function mf(a, b) {\n var c = b - a.O;\n var d = a.V;\n var e = a.Ha + a.l * a.O;\n if (!(c <= 0)) {\n ze(a, c, d, e);\n for (var e = a.N.width, c = e * c, d = a.N.ka, e = a.N.fd + e * a.O, g = a.Xa, k = a.vb, h = s, h = 0; h < c; ++h) d[e + h] = g[k + h] >>> 8 & 255;\n a.O = a.xa = b;\n }\n }\n\n function ng(a, b) {\n const c = [s];\n const d = [s];\n const e = [s];\n if (a == p) return 0;\n if (b == p) return a.a = ta, 0;\n a.N = b;\n a.a = L;\n Rb(a.o, b.data, b.b, b.e);\n if (!ue(a.o, c, d, e)) return a.a = W, sa(a), $(a.a != L), 0;\n a.Ob = cd;\n b.width = c[0];\n b.height = d[0];\n a.Wa = Cb;\n return !Ka(c[0], d[0], 1, a, p) ? (sa(a), $(a.a != L), 0) : 1;\n }\n\n function og(a) {\n let b = p;\n let c = p;\n if (a == p) return 0;\n b = a.N;\n $(b != p);\n c = b.ka;\n $(c != p);\n a.Ib = c.j;\n a.Hc = c.Hc;\n $(a.Ib != p);\n if (!Ne(c.Qa, b, Pa)) return a.a = ta, sa(a), $(a.a != L), 0;\n if (!xd(a, b.width) || b.I && !AllocateAndInitRescaler(a, b)) return sa(a), $(a.a != L), 0;\n a.Wa = Db;\n if (!lc(a, a.V, a.Ha, a.l, a.v, Yf)) return sa(a), $(a.a != L), 0;\n c.ec = a.xa;\n sa(a);\n return 1;\n }\n\n function wa(a, b) {\n return a < 0 ? 0 : a > b ? b : a;\n }\n\n function ab(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, C, w, z) {\n let y; const G = C - 1 >> 1;\n let F = e[g + 0] | k[h + 0] << 16;\n let B = f[l + 0] | m[t + 0] << 16;\n if (a) {\n var D = 3 * F + B + 131074 >> 2;\n w(a[b + 0], D & 255, D >> 16, q, r);\n }\n c && (D = 3 * B + F + 131074 >> 2, w(c[d + 0], D & 255, D >> 16, u, v));\n for (y = 1; y <= G; ++y) {\n const J = e[g + y] | k[h + y] << 16;\n const L = f[l + y] | m[t + y] << 16;\n var D = F + J + B + L + 524296;\n const O = D + 2 * (J + B) >> 3;\n const H = D + 2 * (F + L) >> 3;\n a && (D = O + F >> 1, F = H + J >> 1, w(a[b + 2 * y - 1], D & 255, D >> 16, q, r + (2 * y - 1) * z), w(a[b + 2 * y - 0], F & 255, F >> 16, q, r + (2 * y - 0) * z));\n c && (D = H + B >> 1, F = O + L >> 1, w(c[d + 2 * y - 1], D & 255, D >> 16, u, v + (2 * y - 1) * z), w(c[d + 2 * y + 0], F & 255, F >> 16, u, v + (2 * y + 0) * z));\n F = J;\n B = L;\n }\n C & 1 || (a && (D = 3 * F + B + 131074 >> 2, w(a[b + C - 1], D & 255, D >> 16, q, r + (C - 1) * z)), c && (D = 3 * B + F + 131074 >> 2, w(c[d + C - 1], D & 255, D >> 16, u, v + (C - 1) * z)));\n }\n\n function pg(a,\n b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w) {\n ab(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w, hc, 3);\n }\n\n function qg(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w) {\n ab(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w, Vc, 3);\n }\n\n function Oe(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w) {\n ab(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w, pe, 4);\n }\n\n function Pe(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w) {\n ab(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w, oe, 4);\n }\n\n function Qe(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w) {\n ab(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w, me, 4);\n }\n\n function Re(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w) {\n ab(a, b, c, d, e, g, k, h,\n f, l, m, t, q, r, u, v, w, ne, 2);\n }\n\n function rg(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w) {\n ab(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w, le, 2);\n }\n\n function Ca(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u) {\n let v;\n for (v = 0; v < q - 1; v += 2) r(a[b + 0], e[g + 0], k[h + 0], f, l), r(a[b + 1], e[g + 0], k[h + 0], f, l + u), r(c[d + 0], e[g + 0], k[h + 0], m, t), r(c[d + 1], e[g + 0], k[h + 0], m, t + u), b += 2, d += 2, g++, h++, l += 2 * u, t += 2 * u;\n v == q - 1 && (r(a[b + 0], e[g + 0], k[h + 0], f, l), r(c[d + 0], e[g + 0], k[h + 0], m, t));\n }\n\n function Se(a, b, c, d, e, g, k, f, n, l, m, t, q) {\n Ca(a, b, c, d, e, g, k, f, n, l, m, t, q, pe, 4);\n }\n\n function Te(a, b, c, d, e, g, k, f, n, l,\n m, t, q) {\n Ca(a, b, c, d, e, g, k, f, n, l, m, t, q, oe, 4);\n }\n\n function Ue(a, b, c, d, e, g, k, f, n, l, m, t, q) {\n Ca(a, b, c, d, e, g, k, f, n, l, m, t, q, me, 4);\n }\n\n function Ve(a, b, c, d, e, g, k, f, n, l, m, t, q) {\n Ca(a, b, c, d, e, g, k, f, n, l, m, t, q, ne, 2);\n }\n\n function sg(a, b, c, d, e, g) {\n for (; e-- > 0;) {\n for (var k = a, f = b + (c ? 1 : 0), n = a, l = b + (c ? 0 : 3), m = s, m = 0; m < d; ++m) {\n var t = n[l + 4 * m];\n if (t != 255) {\n var t = 32897 * t;\n let q = k;\n let r = f + 4 * m + 0;\n k[f + 4 * m + 0] * t >>> 23;\n q[r] = ca;\n q = k;\n r = f + 4 * m + 1;\n k[f + 4 * m + 1] * t >>> 23;\n q[r] = ca;\n q = k;\n r = f + 4 * m + 2;\n k[f + 4 * m + 2] * t >>> 23;\n q[r] = ca;\n }\n }\n b += g;\n }\n }\n\n function tg(a, b) {\n const c = b.j.c.Va;\n const d = c.y;\n const e = c.D + a.w * c.F;\n const g = c.c;\n const k = c.B + (a.w >> 1) * c.nb;\n const f = c.S;\n const n = c.C + (a.w >> 1) * c.rb;\n const l = a.m;\n const m = a.h;\n const t = parseInt((l + 1) / 2, 10);\n const q = parseInt((m + 1) / 2, 10);\n let r;\n for (r = 0; r < m; ++r) N(d, e + r * c.F, a.y, a.D + r * a.F, l);\n for (r = 0; r < q; ++r) N(g, k + r * c.nb, a.c, a.B + r * a.Da, t), N(f, n + r * c.rb, a.S, a.C + r * a.Da, t);\n return a.h;\n }\n\n function ug(a, b) {\n var c = b.j;\n const d = c.c.RGBA;\n const e = d.ma;\n let g = d.Sa + a.w * d.f;\n const k = a.y;\n let f = a.D;\n const n = a.c;\n let l = a.B;\n const m = a.S;\n let t = a.C;\n var c = vg[c.J];\n const q = a.m;\n const r = a.h - 1;\n let u;\n for (u = 0; u < r; u += 2) c(k, f, k, f + a.F, n, l, m, t, e, g, e, g + d.f, q), f += 2 * a.F, l += a.Da, t += a.Da, g += 2 * d.f;\n u == r && c(k, f, k, f, n, l, m, t, e, g, e, g, q);\n return a.h;\n }\n\n function wg(a, b) {\n let c = a.h;\n const d = b.j.c.RGBA;\n const e = d.ma;\n let g = d.Sa + a.w * d.f;\n const k = V[b.j.J];\n const f = a.y;\n let n = a.D;\n const l = a.c;\n let m = a.B;\n const t = a.S;\n let q = a.C;\n let r = b.Qb;\n let u = b.Rb;\n let v = b.lc;\n let w = b.mc;\n let A = a.w;\n const z = a.w + a.h;\n const y = a.m;\n const D = parseInt((y + 1) / 2, 10);\n A == 0 ? k(p, p, f, n, l, m, t, q, l, m, t, q, p, p, e, g, y) : (k(b.Sb, b.Tb, f, n, r, u, v, w, l, m, t, q, e, g - d.f, e, g, y), ++c);\n for (; A + 2 < z; A += 2) r = l, u = m, v = t, w = q, m += a.Da, q += a.Da, g += 2 * d.f, n += 2 * a.F, k(f, n - a.F, f, n, r, u, v, w, l, m, t, q, e, g - d.f, e, g, y);\n n += a.F;\n a.k + z < a.K ? (N(b.Sb, b.Tb, f, n, 1 * y), N(b.Qb, b.Rb, l, m, 1 * D), N(b.lc, b.mc, t, q, 1 * D), c--) : z & 1 || k(f, n, p, p, l, m, t, q, l, m,\n t, q, e, g + d.f, p, p, y);\n return c;\n }\n\n function xg(a, b) {\n var c = a.p;\n var d = a.q;\n const e = b.j.c.Va;\n const g = a.m;\n const f = a.h;\n const h = e.p;\n let n = e.q + a.w * e.Fa;\n var c = a.p;\n var d = a.q;\n let l = s;\n if (c != p) for (l = 0; l < f; ++l) N(h, n, c, d, 1 * g), d += a.width, n += e.Fa;\n else if (e.p != p) for (l = 0; l < f; ++l) jd(h, n, 255, g), n += e.Fa;\n return 0;\n }\n\n function We(a, b, c) {\n let d = a.w;\n c[0] = a.h;\n a.Bb && (d == 0 ? --c[0] : (--d, b[0] -= a.width), a.k + a.w + a.h == a.K && (c[0] = a.K - a.k - d));\n return d;\n }\n\n function yg(a, b) {\n const c = a.p;\n var d = [a.q];\n if (c != p) {\n for (var e = a.m, g = b.j.J, f = g == Ab || g == Bb, h = b.j.c.RGBA, n = [s], l = We(a, d, n), d = d[0], m = h.ma, l = h.Sa + l * h.f,\n t = l + (f ? 0 : 3), q = 255, r = s, u = s, u = 0; u < n[0]; ++u) {\n for (r = 0; r < e; ++r) {\n const v = c[d + r];\n m[t + 4 * r] = v;\n q &= v;\n }\n d += a.width;\n t += h.f;\n }\n q != 255 && F(g) && WebPApplyAlphaMultiply(m, l, f, e, n, h.f);\n }\n return 0;\n }\n\n function zg(a, b) {\n const c = a.p;\n var d = [a.q];\n if (c != p) {\n const e = a.m;\n const g = b.j.J;\n const f = b.j.c.RGBA;\n const h = [s];\n var n = We(a, d, h);\n var d = d[0];\n const l = f.ma;\n var n = f.Sa + n * f.f;\n let m = n + 1;\n let t = 15;\n let q = s;\n for (j = 0; j < h[0]; ++j) {\n for (q = 0; q < e; ++q) {\n const r = c[d + q] >> 4;\n l[m + 2 * q] = l[m + 2 * q] & 240 | r;\n t &= r;\n }\n d += a.width;\n m += f.f;\n }\n t != 15 && F(g) && WebPApplyAlphaMultiply4444(l, n, e, h, f.f);\n }\n return 0;\n }\n\n function vd(a) {\n let b = a.ka;\n const c = b.j.J;\n const d = c\n < ua;\n const e = c == jb || c == Pa || c == Ab || c == kb || c == Ra || F(c);\n b.memory = p;\n b.$a = p;\n b.zb = p;\n b.ad = p;\n if (!Ne(b.Qa, a, e ? ua : Ra)) return 0;\n if (a.I) {\n if (!(d ? InitRGBRescaler(a, b) : InitYUVRescaler(a, b))) return alert('memory error #1'), 0;\n } else {\n if (d) {\n if (b.$a = ug, a.Bb) {\n const g = a.m + 1 >> 1;\n const f = a.m + 2 * g;\n let h; const\n n = [];\n for (h = 0; h < f; ++h) n.push(205);\n n.push(0);\n b.memory = n;\n if (b.memory == p) return alert('memory error #2'), 0;\n b.Sb = b.memory;\n b.Tb = 0;\n b.Qb = b.Sb;\n b.Rb = b.Tb + a.m;\n b.lc = b.Qb;\n b.mc = b.Rb + g;\n b.$a = wg;\n V[Qa] = pg;\n V[jb] = Oe;\n V[Zc] = qg;\n V[Pa] = Pe;\n V[Ab] = Qe;\n V[kb] = Re;\n V[Fe] = rg;\n }\n } else {\n b.$a = tg;\n }\n e && (F(c) && (WebPApplyAlphaMultiply = sg, V[Ob] = Oe, V[Pb] = Pe, V[Bb] = Qe, V[Qb] = Re), b.zb = c == kb || c == Qb ? zg : d ? yg : xg);\n }\n if (d && !Xe) {\n for (a = 0; a < 256; ++a) Za[a] = 89858 * (a - 128) + Jb >> ea, wb[a] = -22014 * (a - 128) + Jb, vb[a] = -45773 * (a - 128), xb[a] = 113618 * (a - 128) + Jb >> ea;\n for (a = J; a < dd; ++a) b = 76283 * (a - 16) + Jb >> ea, ia[a - J] = wa(b, 255), Hb[a - J] = wa(b + 8 >> 4, 15);\n Xe = 1;\n }\n return 1;\n }\n\n function ud(a) {\n const b = a.ka;\n let c = a.m;\n const d = a.h;\n $(!(a.w & 1));\n if (c <= 0 || d <= 0) return 0;\n c = b.$a(a, b);\n b.ec += c;\n b.zb && b.zb(a, b);\n return 1;\n }\n\n function wd(a) {\n a = a.ka;\n a.memory = '';\n a.memory = p;\n }\n\n function ed(a,\n b) {\n return a[b + 0] | a[b + 1] << 8 | a[b + 2] << 16;\n }\n\n function Kb(a, b) {\n return (ed(a, b) | a[b + 3] << 24) >>> 0;\n }\n\n function Ye(a, b, c, d, e, g, f) {\n var h = 0;\n var n = [0];\n var l = 'VP8StatusCode';\n const m = M(Gc);\n if (a == p || c[0] < Lb) return Z;\n m.data = a;\n m.b = [b[0]];\n m.e = [c[0]];\n m.na = [m.na];\n a: {\n h = m.na;\n $(a != p);\n $(c != p);\n $(h != p);\n h[0] = 0;\n if (c[0] >= Lb && !kd(a, b[0], 'RIFF', O)) {\n if (kd(a, b[0] + 8, 'WEBP', O)) {\n l = W;\n break a;\n }\n var t = Kb(a, b[0] + O);\n if (t < O + R) {\n l = W;\n break a;\n }\n h[0] = t;\n b[0] += Lb;\n c[0] -= Lb;\n } else h[0] = 0;\n l = L;\n }\n m.na = m.na[0];\n if (l != L) return l;\n h = m.na > 0;\n t = [0];\n a: if (l = R + fd, $(a != p), $(c != p), $(n != p), n[0] = 0, c[0] < R) l = Z;\n else {\n if (!kd(a, b[0], 'VP8X', O)) {\n var q = s;\n var r = s;\n var u = E;\n if (Kb(a, b[0] + O) != fd) {\n l = W;\n break a;\n }\n if (c[0] < l) {\n l = Z;\n break a;\n }\n u = Kb(a, b[0] + 8);\n q = 1 + ed(a, b[0] + 12);\n r = 1 + ed(a, b[0] + 15);\n if (q * r >= Ag) {\n l = W;\n break a;\n }\n t != p && (t[0] = u);\n d != p && (d[0] = q);\n e != p && (e[0] = r);\n b[0] += l;\n c[0] -= l;\n n[0] = 1;\n }\n l = L;\n }\n if (l != L) return l;\n if (!h && n[0]) return W;\n g != p && (g[0] = !!(t[0] & Bg));\n if (n && f == p) return L;\n if (c < O) return Z;\n if (h && n[0] || !h && !n[0] && !kd(a, b[0], 'ALPH', O)) {\n m.$ = [m.$];\n m.G = [m.G];\n m.pa = [m.pa];\n a: {\n var n = m.na;\n var h = m.$;\n var t = m.G;\n var l = m.pa;\n var q = x;\n var r = 0;\n var u = Mb;\n let v = O + R + fd;\n $(a != p);\n $(c != p);\n q = a;\n r = b[0];\n u = c[0];\n $(h != p);\n $(l != p);\n h[0] = p;\n t[0] = p;\n for (l[0] = 0; ;) {\n let w = E;\n let y = E;\n b[0] = r;\n c[0] = u;\n if (u < R) {\n l = Z;\n break a;\n }\n w = Kb(q, r + O);\n y = R + w + 1 & -2;\n v += y;\n if (n > 0 && v > n) {\n l = W;\n break a;\n }\n if (u < y) {\n l = Z;\n break a;\n }\n if (kd(q, r, 'ALPH', O)) {\n if (!kd(q, r, 'VP8 ', O) || !kd(q, 'VP8L', O)) {\n l = L;\n break a;\n }\n } else h[0] = q, t[0] = r + R, l[0] = w;\n r += y;\n u -= y;\n }\n l = ca;\n }\n m.$ = m.$[0];\n m.G = m.G[0];\n m.pa = m.pa[0];\n if (l != L) return l;\n }\n m.ta = [m.ta];\n m.ia = [m.ia];\n a: if (n = m.na, h = m.ta, t = m.ia, r = !kd(a, b[0], 'VP8 ', O), l = !kd(a, b[0], 'VP8L', O), q = O + R, $(a != p), $(c != p), $(h != p), $(t != p), c[0] < R) l = Z;\n else {\n if (r || l) {\n r = Kb(a, b[0] + O);\n if (n >= q && r > n - q) {\n l = W;\n break a;\n }\n h[0] = r;\n b[0] += R;\n c[0] -= R;\n t[0] = l;\n } else t[0] = c >= 1 && a[b + 0] == ve, h[0] = c[0];\n l = L;\n }\n m.ta = m.ta[0];\n m.ia = m.ia[0];\n if (l != L) return l;\n if (m.ta > Ze) return W;\n if (m.ia) {\n if (c[0] < $e) return Z;\n n = b[0];\n h = c[0];\n d = d ? d[0] : p;\n e = e ? e[0] : p;\n t = g ? g[0] : p;\n a == p || h < $e ? a = 0 : (l = [s], q = [s], r = [s], u = M(af), Rb(u, a, n, h), ue(u, l, q, r) ? (d != p && (d[0] = l[0]), e != p && (e[0] = q[0]), t != p && (t[0] = r[0]), a = 1) : a = 0);\n } else {\n if (c < bf) return Z;\n n = b[0];\n h = c[0];\n d = d ? d[0] : p;\n e = e ? e[0] : p;\n !(a == p || h < bf) && h - 3 >= 3 && a[n + 3 + 0] == 157 && a[n\n + 3 + 1] == 1 && a[n + 3 + 2] == 42 ? (h = a[n + 0] | a[n + 1] << 8 | a[n + 2] << 16, t = (a[n + 7] << 8 | a[n + 6]) & 16383, a = (a[n + 9] << 8 | a[n + 8]) & 16383, !(!(h & 1) + 0) || (h >> 1 & 7) > 3 || !(h >> 4 & 1) || h >> 5 >= m.ta ? a = 0 : (d && (d[0] = t), e && (e[0] = a), a = 1)) : a = 0;\n }\n if (!a) return W;\n g != p && (g[0] |= m.$ != p);\n f != p && (f[0] = m, f[0].offset = b[0] - f[0].b, $(b[0] - f[0].b < Ze), $(f[0].offset == f[0].e - c[0]));\n return L;\n }\n\n function Kd(a) {\n $(a != p);\n return Ye(a[0].data, a[0].b, a[0].e, p, p, p, a);\n }\n\n function cf(a, b, c, d) {\n let e = 'VP8StatusCode';\n const g = M(Vb);\n let f = M(Gc);\n f.data = a;\n f.b = b;\n f.e = c;\n f.b = [f.b];\n f.e = [f.e];\n f = [f];\n e = Kd(f);\n if (e\n != L) return e;\n f = f[0];\n f.b = f.b[0];\n f.e = f.e[0];\n $(d != p);\n td(na);\n g.data = f.data;\n g.b = b + f.offset;\n g.e = f.e - f.offset;\n g.put = ud;\n g.Mb = vd;\n g.Pb = wd;\n g.ka = d;\n if (f.ia) {\n a = sd();\n if (a == p) return cb;\n ng(a, g) ? (e = zd(g.width, g.height, d.Qa, d.j), e == L && !og(a) && (e = a.a)) : e = a.a;\n a != p && sa(a);\n } else {\n e = M(Cg);\n e != p && (Gd(e), e.za = 0, e.Hb = 1);\n a = e;\n if (a == p) return cb;\n a.qb = 0;\n a.Ga = f.$;\n a.G = f.G;\n a.ub = f.pa;\n Hd(a, g) ? (e = zd(g.width, g.height, d.Qa, d.j), e == L && !Mf(a, g) && (e = a.a)) : e = a.a;\n a != p && ke(a);\n }\n e != L && (self || this).Yc(d.j);\n return e;\n }\n\n function lb(a, b, c, d, e) {\n const g = {\n value: 0,\n };\n c = {\n value: c,\n };\n const f = M(df);\n const h = M(gd);\n f.j = h;\n h.J = a;\n const n = {\n value: h.width,\n };\n const l = {\n value: h.height,\n };\n let m;\n m = c;\n const t = M(ef);\n hd(b, g, m, t) != L ? m = 0 : (n != p && (n.value = t.width), l != p && (l.value = t.height), m = 1);\n if (!m) return p;\n h.width = n.value;\n h.height = l.value;\n d != p && (d.value = h.width.value);\n e != p && (e.value = h.height.value);\n return cf(b, g.value, c.value, f) != L ? p : a < ua ? h.c.RGBA.ma : h.c.Va.y;\n }\n\n function hd(a, b, c, d) {\n if (d == p || a == p) return ta;\n $(d != p);\n d.tc = 0;\n d.width = [d.width];\n d.height = [d.height];\n d.$b = [d.$b];\n return Ye(a, b, c, d.width, d.height, d.$b, p);\n }\n\n function Ne(a,\n b, c) {\n const d = b.width;\n const e = b.height;\n let g = 0;\n let f = 0;\n let h = d;\n let n = e;\n b.Ua = a != p && a.Ua > 0;\n if (b.Ua && (h = a.wc, n = a.vc, g = a.t, f = a.k, c < ua || (g &= -2, f &= -2), g < 0 || f < 0 || h <= 0 || n <= 0 || g + h > d || f + n > e)) return 0;\n b.t = g;\n b.k = f;\n b.Ka = g + h;\n b.K = f + n;\n b.m = h;\n b.h = n;\n b.I = a != p && a.I > 0;\n if (b.I) {\n if (a.Ba <= 0 || a.Aa <= 0) return 0;\n b.Ba = a.Ba;\n b.Aa = a.Aa;\n }\n b.Za = a && a.Za;\n b.Bb = a == p || !a.ed;\n b.I && (b.Za = b.Ba < 3 * d / 4 && b.Aa < 3 * e / 4, b.Bb = 0);\n return 1;\n }\n var na = 512;\n var Qa = 0;\n var jb = 1;\n var Zc = 2;\n var Pa = 3;\n var Ab = 4;\n var kb = 5;\n var Fe = 6;\n var Ob = 7;\n var Pb = 8;\n var Bb = 9;\n var Qb = 10;\n var ua = 11;\n var Ra = 12;\n var Cc = 13;\n this.WEBP_CSP_MODE = this.Cd = {\n nd: 0,\n od: 1,\n kd: 2,\n ld: 3,\n jd: 4,\n pd: 5,\n qd: 6,\n rd: 7,\n sd: 8,\n md: 9,\n };\n var gd = {\n J: 'WEBP_CSP_MODE',\n width: s,\n height: s,\n Fc: s,\n c: {\n RGBA: {\n ma: x,\n Sa: 0,\n f: s,\n size: Mb,\n },\n Va: {\n y: x,\n c: x,\n S: x,\n p: x,\n D: x,\n B: x,\n C: x,\n q: x,\n F: s,\n nb: s,\n rb: s,\n Fa: s,\n Wc: Mb,\n Rc: Mb,\n Uc: Mb,\n Wb: Mb,\n },\n },\n Ic: U(4, E),\n Jb: p,\n jc: x,\n };\n var L = 0;\n var cb = 1;\n var ta = 2;\n var W = 3;\n var Hf = 4;\n var Ie = 5;\n var Nf = 6;\n var Z = 7;\n this.VP8StatusCode = this.td = {\n xd: 0,\n yd: 1,\n vd: 2,\n ud: 3,\n Ad: 4,\n zd: 5,\n Bd: 6,\n wd: 7,\n };\n var ef = {\n width: {\n value: s,\n },\n height: {\n value: s,\n },\n $b: {\n value: s,\n },\n tc: s,\n Yd: s,\n rotate: s,\n be: s,\n Ic: U(3, E),\n };\n this.WebPGetFeatures = this.Md = function (a, b, c) {\n let d = 'VP8StatusCode';\n na >>> 8 != na >>> 8 || c == p ? a = ta : (b = [b], d = hd(a, [0], b, c), a = d == Z ? W : d);\n return a;\n };\n const ff = {\n Za: s,\n ed: s,\n Ua: s,\n t: s,\n k: s,\n wc: s,\n vc: s,\n I: s,\n Ba: s,\n Aa: s,\n ae: s,\n Td: s,\n Xd: s,\n Ic: U(6, E),\n };\n this.WebPDecoderConfig = this.Kd = {\n input: M(ef),\n j: M(gd),\n options: M(ff),\n };\n this.WebPInitDecoderConfig = this.Nd = function (a) {\n na >>> 8 != na >>> 8 || a == p ? a = 0 : (a = a.input, $(a != p), a.tc = 0, a = 1);\n return a;\n };\n var Vb = {\n width: s,\n height: s,\n w: s,\n m: s,\n h: s,\n y: x,\n c: x,\n S: x,\n D: 0,\n B: 0,\n C: 0,\n F: s,\n Da: s,\n ka: 0,\n put: 0,\n Mb: 0,\n Pb: 0,\n Bb: s,\n e: Mb,\n data: x,\n b: 0,\n Za: s,\n Ua: s,\n t: s,\n Ka: s,\n k: s,\n K: s,\n I: s,\n Ba: s,\n Aa: s,\n p: x,\n q: 0,\n };\n var df = {\n j: M(gd),\n Sb: x,\n Qb: x,\n lc: x,\n Tb: 0,\n Rb: 0,\n mc: 0,\n ec: s,\n Qa: M(ff),\n memory: 0,\n $a: '(OutputFunc)',\n zb: '(OutputFunc)',\n ad: '(OutputRowFunc)',\n };\n var Gc = {\n data: x,\n b: x,\n e: Mb,\n offset: Mb,\n $: p,\n G: x,\n pa: Mb,\n ta: Mb,\n na: Mb,\n ia: s,\n };\n var Fc = {\n qa: x,\n Ia: p,\n Pd: x,\n Ab: s,\n la: E,\n Z: E,\n gc: s,\n };\n var af = {\n T: bb,\n qa: x,\n Ia: x,\n ya: Mb,\n Q: Mb,\n g: s,\n L: s,\n fa: s,\n };\n var gf = 25;\n var hf = [0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215];\n var bf = 10;\n var ve = 47;\n var we = 14;\n var Wf = 3;\n var $e = 5;\n var fg = 11;\n var Yc = 5;\n var qe = 4278190080;\n var jg = 8;\n var Tb = 15;\n var Ba = 256;\n var Ge = 24;\n var Je = 4;\n var Be = 0;\n var De = 1;\n var Ae = 2;\n var Ee = 3;\n var Ub = 1;\n var kc = 0;\n var kf = 1;\n var rd = 1;\n var O = 4;\n var R = 8;\n var Lb = 12;\n var fd = 10;\n var Bg = 16;\n var Ag = 1 * Math.pow(2, 32);\n var Ze = -1 - R - 1 >>> 0;\n var jf = {\n kc: s,\n s,\n };\n var Le = {\n Y: 'HuffmanTreeNode*',\n gb: s,\n Pa: s,\n };\n var pd = -1;\n const Dg = {\n ea: E,\n bb: s,\n };\n var ad = 506832829;\n var $b = 0;\n var ge = $b;\n var fe = 2;\n var ee = 3;\n var de = 1;\n var Ef = 4;\n var Df = 5;\n var Cf = 6;\n var Ld = 3;\n var xa = 4;\n var Hc = 4;\n var Gf = 4;\n var Md = 4;\n var Nd = 8;\n var Kc = 3;\n var Lc = 11;\n var f = 32;\n var Pf = 17 * f + 9 * f;\n var Tc = 1 * f + 8;\n var Uc = Tc + 16 * f + f;\n var he = Uc + 16;\n var Id = {\n fb: x,\n Jc: x,\n Nc: x,\n Ra: E,\n };\n var Jd = {\n l: 0,\n v: 0,\n gd: x,\n hd: x,\n uc: x,\n $c: x,\n };\n const Eg = {\n pb: s,\n ob: s,\n tb: s,\n Kb: U(xa, 0),\n Cb: U(xa, 0),\n };\n const Fg = {\n Ta: U(Ld, x),\n z: md([Md, Nd, Kc, Lc], x),\n };\n const Gg = {\n Oc: s,\n Fb: s,\n kb: s,\n oc: s,\n Lc: U(Hc, s),\n Gc: U(Hc, s),\n };\n var Oc = {\n zc: s,\n yc: s,\n ab: s,\n };\n var Qd = {\n X: s,\n ua: s,\n Nb: s,\n };\n const id = U(2, s);\n const Hg = {\n sc: M(id),\n sb: M(id),\n qc: M(id),\n };\n const Ig = {\n ha: s,\n d: s,\n W: s,\n M: Oc,\n N: Vb,\n };\n var Cg = {\n a: 'VP8StatusCode',\n za: s,\n xc: 0,\n o: M(Fc),\n Ac: M(Id),\n P: M(Jd),\n ga: M(Gg),\n Ca: M(Eg),\n rc: 'WebPWorker',\n qb: s,\n Ja: s,\n jb: s,\n oa: Ig,\n Ma: s,\n hb: s,\n lb: s,\n mb: s,\n wb: s,\n Ya: s,\n Hb: s,\n ic: ld(8, Fc),\n Zc: E,\n yb: ld(xa, Hg),\n R: M(Fg),\n pc: s,\n Pc: x,\n dc: x,\n cc: U(4, x),\n Xc: x,\n Sc: x,\n Vc: x,\n La: M(Qd),\n M: M(Oc),\n Ea: x,\n z: 0,\n ca: x,\n aa: x,\n ra: x,\n da: s,\n ba: s,\n sa: s,\n H: s,\n r: s,\n ib: 0,\n Gb: Mb,\n i: s,\n d: s,\n wa: x,\n Eb: U(16, x),\n Vd: 0,\n Tc: x,\n Lb: x,\n ja: E,\n Oa: E,\n A: s,\n W: s,\n Zb: U(xa, x),\n Ga: p,\n G: 0,\n ub: Mb,\n Xb: x,\n Od: 0,\n cd: s,\n dd: x,\n Wd: 0,\n fc: Mb,\n };\n var Db = 0;\n var Cb = 1;\n var cd = 2;\n const Jg = {\n Qc: 'VP8LImageTransformType',\n n: s,\n U: s,\n Vb: s,\n u: E,\n b: E,\n };\n var gg = {\n va: ld(Yc, Le),\n };\n const Kg = {\n xb: s,\n Yb: M(Dg),\n Dc: s,\n eb: s,\n Ec: s,\n ac: E,\n bd: E,\n hc: s,\n Db: 'HTreeGroup',\n };\n var eg = {\n a: 'VP8StatusCode',\n Wa: 'VP8LDecodeState',\n Ob: 'VP8LDecodeState',\n N: 'VP8Io',\n Ib: 'WebPDecBuffer',\n Hc: 'WebPDecBuffer',\n V: E,\n Ha: E,\n Xa: E,\n vb: E,\n o: M(af),\n l: s,\n v: s,\n O: s,\n xa: s,\n cb: M(Kg),\n Na: s,\n nc: ld(Je, Jg),\n Ub: E,\n Mc: x,\n $d: x,\n Zd: '*WebPRescaler',\n };\n var lf = 4;\n var nf = [p, function (a, b, c, d, e, g, f, h) {\n let n = s;\n let l = h;\n $(a != p);\n $(f != p);\n $(c > 0);\n $(d > 0);\n $(e > 0);\n $(g >= c * e);\n for (n = 0; n < d; ++n) {\n n == 0 ? N(f, h, a, b, e) : Ea(a, b, f, l - g, f, h, e), Ea(a, b + e, f, l, f, h + e, e * (c - 1)),\n l += g, b += g, h += g;\n }\n }, function (a, b, c, d, e, f, k, h) {\n let n = s;\n let l = h;\n $(a != p);\n $(k != p);\n $(c > 0);\n $(d > 0);\n $(e > 0);\n $(f >= c * e);\n N(k, h, a, b, e);\n Ea(a, b + e, k, l, k, h + e, e * (c - 1));\n for (n = 1; n < d; ++n) b += f, h += f, Ea(a, b, k, l, k, h, e * c), l += f;\n }, function (a, b, c, d, e, f, k, h) {\n var n = h;\n let l = s;\n $(a != p);\n $(k != p);\n $(c > 0);\n $(d > 0);\n $(e > 0);\n $(f >= c * e);\n N(k, h, a, b, e);\n Ea(a, b + e, k, n, k, h + e, e * (c - 1));\n for (l = 1; l < d; ++l) {\n let m = s;\n var n = n + f;\n b += f;\n h += f;\n Ea(a, b, k, n - f, k, h, e);\n for (m = e; m < c * e; ++m) {\n const t = k[n + m - e] + k[n + m - f] - k[n + m - f - e];\n k[h + m] = a[b + m] + (t < 0 ? 0 : t > 255 ? 255 : t) & 255;\n }\n }\n }];\n var yd = [3, 4, 3, 4, 4, 2, 2, 4, 4, 4,\n 2, 1, 1,\n ];\n this.WebPFreeDecBuffer = this.Yc = function (a) {\n a != p && (a.Fc || (a.Jb = ''), a.jc = 0, a.Jb = a.jc = p);\n };\n self = this;\n var va = U(511, x);\n var tc = U(511, x);\n var sc = U(2041, 0);\n var oc = U(225, 0);\n var oa = U(766, x);\n var Rd = 0;\n var Xb = 85627;\n var Wb = 35468;\n var Uf = [function (a, b) {\n let c = 4;\n let d;\n for (d = 0; d < 4; ++d) c += a[b + d - f] + a[b - 1 + d * f];\n c >>= 3;\n for (d = 0; d < 4; ++d) jd(a, b + d * f, c, 4);\n }, function (a, b) {\n Dc(a, b, 4);\n }, function (a, b) {\n let c = b - f;\n const d = [];\n d.push(y(a[c - 1], a[c + 0], a[c + 1]));\n d.push(y(a[c + 0], a[c + 1], a[c + 2]));\n d.push(y(a[c + 1], a[c + 2], a[c + 3]));\n d.push(y(a[c + 2], a[c + 3], a[c + 4]));\n for (c = 0; c < 4; ++c) N(a, b + c * f, d, 0, 4);\n },\n function (a, b) {\n const c = a[b - 1];\n const d = a[b - 1 + f];\n const e = a[b - 1 + 2 * f];\n const g = a[b - 1 + 3 * f];\n a[b + 0 + 0 * f] = a[b + 1 + 0 * f] = a[b + 2 + 0 * f] = a[b + 3 + 0 * f] = y(a[b - 1 - f], c, d);\n a[b + 0 + 1 * f] = a[b + 1 + 1 * f] = a[b + 2 + 1 * f] = a[b + 3 + 1 * f] = y(c, d, e);\n a[b + 0 + 2 * f] = a[b + 1 + 2 * f] = a[b + 2 + 2 * f] = a[b + 3 + 2 * f] = y(d, e, g);\n a[b + 0 + 3 * f] = a[b + 1 + 3 * f] = a[b + 2 + 3 * f] = a[b + 3 + 3 * f] = y(e, g, g);\n },\n function (a, b) {\n const c = a[b - 1 + 0 * f];\n const d = a[b - 1 + 1 * f];\n const e = a[b - 1 + 2 * f];\n const g = a[b - 1 - f];\n const k = a[b + 0 - f];\n const h = a[b + 1 - f];\n const n = a[b + 2 - f];\n const l = a[b + 3 - f];\n a[b + 0 + 3 * f] = y(d, e, a[b - 1 + 3 * f]);\n a[b + 0 + 2 * f] = a[b + 1 + 3 * f] = y(c, d, e);\n a[b + 0 + 1 * f] = a[b + 1 + 2 * f] = a[b + 2 + 3 * f] = y(g, c, d);\n a[b\n + 0 + 0 * f] = a[b + 1 + 1 * f] = a[b + 2 + 2 * f] = a[b + 3 + 3 * f] = y(k, g, c);\n a[b + 1 + 0 * f] = a[b + 2 + 1 * f] = a[b + 3 + 2 * f] = y(h, k, g);\n a[b + 2 + 0 * f] = a[b + 3 + 1 * f] = y(n, h, k);\n a[b + 3 + 0 * f] = y(l, n, h);\n },\n function (a, b) {\n const c = a[b - 1 + 0 * f];\n const d = a[b - 1 + 1 * f];\n const e = a[b - 1 + 2 * f];\n const g = a[b - 1 - f];\n const k = a[b + 0 - f];\n const h = a[b + 1 - f];\n const n = a[b + 2 - f];\n const l = a[b + 3 - f];\n a[b + 0 + 0 * f] = a[b + 1 + 2 * f] = g + k + 1 >> 1;\n a[b + 1 + 0 * f] = a[b + 2 + 2 * f] = k + h + 1 >> 1;\n a[b + 2 + 0 * f] = a[b + 3 + 2 * f] = h + n + 1 >> 1;\n a[b + 3 + 0 * f] = n + l + 1 >> 1;\n a[b + 0 + 3 * f] = y(e, d, c);\n a[b + 0 + 2 * f] = y(d, c, g);\n a[b + 0 + 1 * f] = a[b + 1 + 3 * f] = y(c, g, k);\n a[b + 1 + 1 * f] = a[b + 2 + 3 * f] = y(g, k, h);\n a[b + 2 + 1 * f] = a[b + 3 + 3 * f] = y(k, h, n);\n a[b + 3 + 1 * f] = y(h, n, l);\n },\n function (a, b) {\n const c = a[b + 1 - f];\n const d = a[b + 2 - f];\n const e = a[b + 3 - f];\n const g = a[b + 4 - f];\n const k = a[b + 5 - f];\n const h = a[b + 6 - f];\n const n = a[b + 7 - f];\n a[b + 0 + 0 * f] = y(a[b + 0 - f], c, d);\n a[b + 1 + 0 * f] = a[b + 0 + 1 * f] = y(c, d, e);\n a[b + 2 + 0 * f] = a[b + 1 + 1 * f] = a[b + 0 + 2 * f] = y(d, e, g);\n a[b + 3 + 0 * f] = a[b + 2 + 1 * f] = a[b + 1 + 2 * f] = a[b + 0 + 3 * f] = y(e, g, k);\n a[b + 3 + 1 * f] = a[b + 2 + 2 * f] = a[b + 1 + 3 * f] = y(g, k, h);\n a[b + 3 + 2 * f] = a[b + 2 + 3 * f] = y(k, h, n);\n a[b + 3 + 3 * f] = y(h, n, n);\n },\n function (a, b) {\n const c = a[b + 0 - f];\n const d = a[b + 1 - f];\n const e = a[b + 2 - f];\n const g = a[b + 3 - f];\n const k = a[b + 4 - f];\n const h = a[b + 5 - f];\n const n = a[b + 6 - f];\n const l = a[b + 7 - f];\n a[b + 0 + 0 * f] = c + d + 1 >> 1;\n a[b + 1 + 0 * f] = a[b\n + 0 + 2 * f] = d + e + 1 >> 1;\n a[b + 2 + 0 * f] = a[b + 1 + 2 * f] = e + g + 1 >> 1;\n a[b + 3 + 0 * f] = a[b + 2 + 2 * f] = g + k + 1 >> 1;\n a[b + 0 + 1 * f] = y(c, d, e);\n a[b + 1 + 1 * f] = a[b + 0 + 3 * f] = y(d, e, g);\n a[b + 2 + 1 * f] = a[b + 1 + 3 * f] = y(e, g, k);\n a[b + 3 + 1 * f] = a[b + 2 + 3 * f] = y(g, k, h);\n a[b + 3 + 2 * f] = y(k, h, n);\n a[b + 3 + 3 * f] = y(h, n, l);\n },\n function (a, b) {\n const c = a[b - 1 + 0 * f];\n const d = a[b - 1 + 1 * f];\n const e = a[b - 1 + 2 * f];\n const g = a[b - 1 + 3 * f];\n const k = a[b - 1 - f];\n const h = a[b + 0 - f];\n const n = a[b + 1 - f];\n const l = a[b + 2 - f];\n a[b + 0 + 0 * f] = a[b + 2 + 1 * f] = c + k + 1 >> 1;\n a[b + 0 + 1 * f] = a[b + 2 + 2 * f] = d + c + 1 >> 1;\n a[b + 0 + 2 * f] = a[b + 2 + 3 * f] = e + d + 1 >> 1;\n a[b + 0 + 3 * f] = g + e + 1 >> 1;\n a[b + 3 + 0 * f] = y(h, n, l);\n a[b + 2 + 0 * f] = y(k, h, n);\n a[b\n + 1 + 0 * f] = a[b + 3 + 1 * f] = y(c, k, h);\n a[b + 1 + 1 * f] = a[b + 3 + 2 * f] = y(d, c, k);\n a[b + 1 + 2 * f] = a[b + 3 + 3 * f] = y(e, d, c);\n a[b + 1 + 3 * f] = y(g, e, d);\n },\n function (a, b) {\n const c = a[b - 1 + 0 * f];\n const d = a[b - 1 + 1 * f];\n const e = a[b - 1 + 2 * f];\n const g = a[b - 1 + 3 * f];\n a[b + 0 + 0 * f] = c + d + 1 >> 1;\n a[b + 2 + 0 * f] = a[b + 0 + 1 * f] = d + e + 1 >> 1;\n a[b + 2 + 1 * f] = a[b + 0 + 2 * f] = e + g + 1 >> 1;\n a[b + 1 + 0 * f] = y(c, d, e);\n a[b + 3 + 0 * f] = a[b + 1 + 1 * f] = y(d, e, g);\n a[b + 3 + 1 * f] = a[b + 1 + 2 * f] = y(e, g, g);\n a[b + 3 + 2 * f] = a[b + 2 + 2 * f] = a[b + 0 + 3 * f] = a[b + 1 + 3 * f] = a[b + 2 + 3 * f] = a[b + 3 + 3 * f] = g;\n },\n ];\n var Vf = [function (a, b) {\n let c = 16;\n let d;\n for (d = 0; d < 16; ++d) c += a[b - 1 + d * f] + a[b + d - f];\n Yb(c >> 5, a, b);\n }, function (a,\n b) {\n Dc(a, b, 16);\n }, function (a, b) {\n let c;\n for (c = 0; c < 16; ++c) N(a, b + c * f, a, b - f, 16);\n }, function (a, b) {\n let c;\n for (c = 16; c > 0; --c) jd(a, b + 0, a[b - 1], 16), b += f;\n }, function (a, b) {\n let c = 8;\n let d;\n for (d = 0; d < 16; ++d) c += a[b - 1 + d * f];\n Yb(c >> 4, a, b);\n }, function (a, b) {\n let c = 8;\n let d;\n for (d = 0; d < 16; ++d) c += a[b + d - f];\n Yb(c >> 4, a, b);\n }, function (a, b) {\n Yb(128, a, b);\n }];\n var je = [function (a, b) {\n let c = 8;\n let d;\n for (d = 0; d < 8; ++d) c += a[b + d - f] + a[b - 1 + d * f];\n Zb(1 * (c >> 4), a, b);\n }, function (a, b) {\n Dc(a, b, 8);\n }, function (a, b) {\n let c;\n for (c = 0; c < 8; ++c) N(a, b + c * f, a, b - f, 8);\n }, function (a, b) {\n let c;\n for (c = 0; c < 8; ++c) {\n jd(a,\n b + 0, a[b - 1], 8), b += f;\n }\n }, function (a, b) {\n let c = 4;\n let d;\n for (d = 0; d < 8; ++d) c += a[b - 1 + d * f];\n Zb(1 * (c >> 3), a, b);\n }, function (a, b) {\n let c = 4;\n let d;\n for (d = 0; d < 8; ++d) c += a[b + d - f];\n Zb(1 * (c >> 3), a, b);\n }, function (a, b) {\n Zb(128, a, b);\n }];\n let mc; let Pc; let Qc; let Rc; let Sd; let Td; let Ud; let Vd; let Wd; let Xd; let Yd; let Zd; let $d; let ae; let be; let ce; var Pd = 31;\n var uc = [0, 2, 8];\n var Od = 3;\n var Of = 1;\n var ie = [0 + 0 * f, 4 + 0 * f, 8 + 0 * f, 12 + 0 * f, 0 + 4 * f, 4 + 4 * f, 8 + 4 * f, 12 + 4 * f, 0 + 8 * f, 4 + 8 * f, 8 + 8 * f, 12 + 8 * f, 0 + 12 * f, 4 + 12 * f, 8 + 12 * f, 12 + 12 * f];\n var Ic = [4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38,\n 39, 40, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 93, 95, 96, 98, 100, 101, 102, 104, 106, 108, 110, 112, 114, 116, 118, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 143, 145, 148, 151, 154, 157,\n ];\n var Jc = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96,\n 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 234, 239, 245, 249, 254, 259, 264, 269, 274, 279, 284,\n ];\n var Sf = [-$b, 1, -1, 2, -2, 3, 4, 6, -3, 5, -4, -5, -6, 7, -7, 8, -8, -9];\n var Ff = [\n [\n [\n [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n ],\n [\n [253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128],\n [189, 129, 242, 255, 227, 213, 255, 219, 128, 128,\n 128,\n ],\n [106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128],\n ],\n [\n [1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128],\n [181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128],\n [78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128],\n ],\n [\n [1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128],\n [184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128],\n [77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128],\n ],\n [\n [1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128],\n [170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128],\n [37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128],\n ],\n [\n [1, 204, 254, 255, 245, 255, 128, 128, 128, 128,\n 128,\n ],\n [207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128],\n [102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128],\n ],\n [\n [1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128],\n [177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128],\n [80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128],\n ],\n [\n [1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n [246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n [255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n ],\n ],\n [\n [\n [198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62],\n [131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1],\n [68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128],\n ],\n [\n [1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128],\n [184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128],\n [81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128],\n ],\n [\n [1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128],\n [99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128],\n [23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128],\n ],\n [\n [1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128],\n [109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128],\n [44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128],\n ],\n [\n [1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128],\n [94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128],\n [22,\n 100, 174, 245, 186, 161, 255, 199, 128, 128, 128,\n ],\n ],\n [\n [1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128],\n [124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128],\n [35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128],\n ],\n [\n [1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128],\n [121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128],\n [45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128],\n ],\n [\n [1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128],\n [203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128],\n [137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128],\n ],\n ],\n [\n [\n [253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128],\n [175, 13,\n 224, 243, 193, 185, 249, 198, 255, 255, 128,\n ],\n [73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128],\n ],\n [\n [1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128],\n [239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128],\n [155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128],\n ],\n [\n [1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128],\n [201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128],\n [69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128],\n ],\n [\n [1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128],\n [223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128],\n [141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128],\n ],\n [\n [1, 16, 248, 255,\n 255, 128, 128, 128, 128, 128, 128,\n ],\n [190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128],\n [149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n ],\n [\n [1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n [247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n [240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n ],\n [\n [1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128],\n [213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128],\n [55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n ],\n [\n [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n [128, 128, 128, 128,\n 128, 128, 128, 128, 128, 128, 128,\n ],\n ],\n ],\n [\n [\n [202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255],\n [126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128],\n [61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128],\n ],\n [\n [1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128],\n [166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128],\n [39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128],\n ],\n [\n [1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128],\n [124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128],\n [24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128],\n ],\n [\n [1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128],\n [149, 150, 226, 252, 216,\n 205, 255, 171, 128, 128, 128,\n ],\n [28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128],\n ],\n [\n [1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128],\n [123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128],\n [20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128],\n ],\n [\n [1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128],\n [168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128],\n [47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128],\n ],\n [\n [1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128],\n [141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128],\n [42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128],\n ],\n [\n [1, 1, 255, 128, 128, 128, 128,\n 128, 128, 128, 128,\n ],\n [244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n [238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n ],\n ],\n ];\n var Rf = [\n [\n [231, 120, 48, 89, 115, 113, 120, 152, 112],\n [152, 179, 64, 126, 170, 118, 46, 70, 95],\n [175, 69, 143, 80, 85, 82, 72, 155, 103],\n [56, 58, 10, 171, 218, 189, 17, 13, 152],\n [114, 26, 17, 163, 44, 195, 21, 10, 173],\n [121, 24, 80, 195, 26, 62, 44, 64, 85],\n [144, 71, 10, 38, 171, 213, 144, 34, 26],\n [170, 46, 55, 19, 136, 160, 33, 206, 71],\n [63, 20, 8, 114, 114, 208, 12, 9, 226],\n [81, 40, 11, 96, 182, 84, 29, 16, 36],\n ],\n [\n [134, 183, 89, 137, 98, 101, 106, 165, 148],\n [72, 187, 100, 130, 157, 111,\n 32, 75, 80,\n ],\n [66, 102, 167, 99, 74, 62, 40, 234, 128],\n [41, 53, 9, 178, 241, 141, 26, 8, 107],\n [74, 43, 26, 146, 73, 166, 49, 23, 157],\n [65, 38, 105, 160, 51, 52, 31, 115, 128],\n [104, 79, 12, 27, 217, 255, 87, 17, 7],\n [87, 68, 71, 44, 114, 51, 15, 186, 23],\n [47, 41, 14, 110, 182, 183, 21, 17, 194],\n [66, 45, 25, 102, 197, 189, 23, 18, 22],\n ],\n [\n [88, 88, 147, 150, 42, 46, 45, 196, 205],\n [43, 97, 183, 117, 85, 38, 35, 179, 61],\n [39, 53, 200, 87, 26, 21, 43, 232, 171],\n [56, 34, 51, 104, 114, 102, 29, 93, 77],\n [39, 28, 85, 171, 58, 165, 90, 98, 64],\n [34, 22, 116, 206, 23, 34, 43, 166, 73],\n [107, 54, 32, 26, 51, 1, 81, 43, 31],\n [68, 25, 106, 22,\n 64, 171, 36, 225, 114,\n ],\n [34, 19, 21, 102, 132, 188, 16, 76, 124],\n [62, 18, 78, 95, 85, 57, 50, 48, 51],\n ],\n [\n [193, 101, 35, 159, 215, 111, 89, 46, 111],\n [60, 148, 31, 172, 219, 228, 21, 18, 111],\n [112, 113, 77, 85, 179, 255, 38, 120, 114],\n [40, 42, 1, 196, 245, 209, 10, 25, 109],\n [88, 43, 29, 140, 166, 213, 37, 43, 154],\n [61, 63, 30, 155, 67, 45, 68, 1, 209],\n [100, 80, 8, 43, 154, 1, 51, 26, 71],\n [142, 78, 78, 16, 255, 128, 34, 197, 171],\n [41, 40, 5, 102, 211, 183, 4, 1, 221],\n [51, 50, 17, 168, 209, 192, 23, 25, 82],\n ],\n [\n [138, 31, 36, 171, 27, 166, 38, 44, 229],\n [67, 87, 58, 169, 82, 115, 26, 59, 179],\n [63, 59, 90, 180, 59, 166, 93, 73,\n 154,\n ],\n [40, 40, 21, 116, 143, 209, 34, 39, 175],\n [47, 15, 16, 183, 34, 223, 49, 45, 183],\n [46, 17, 33, 183, 6, 98, 15, 32, 183],\n [57, 46, 22, 24, 128, 1, 54, 17, 37],\n [65, 32, 73, 115, 28, 128, 23, 128, 205],\n [40, 3, 9, 115, 51, 192, 18, 6, 223],\n [87, 37, 9, 115, 59, 77, 64, 21, 47],\n ],\n [\n [104, 55, 44, 218, 9, 54, 53, 130, 226],\n [64, 90, 70, 205, 40, 41, 23, 26, 57],\n [54, 57, 112, 184, 5, 41, 38, 166, 213],\n [30, 34, 26, 133, 152, 116, 10, 32, 134],\n [39, 19, 53, 221, 26, 114, 32, 73, 255],\n [31, 9, 65, 234, 2, 15, 1, 118, 73],\n [75, 32, 12, 51, 192, 255, 160, 43, 51],\n [88, 31, 35, 67, 102, 85, 55, 186, 85],\n [56, 21, 23, 111, 59, 205, 45, 37, 192],\n [55, 38, 70, 124, 73, 102, 1, 34, 98],\n ],\n [\n [125, 98, 42, 88, 104, 85, 117, 175, 82],\n [95, 84, 53, 89, 128, 100, 113, 101, 45],\n [75, 79, 123, 47, 51, 128, 81, 171, 1],\n [57, 17, 5, 71, 102, 57, 53, 41, 49],\n [38, 33, 13, 121, 57, 73, 26, 1, 85],\n [41, 10, 67, 138, 77, 110, 90, 47, 114],\n [115, 21, 2, 10, 102, 255, 166, 23, 6],\n [101, 29, 16, 10, 85, 128, 101, 196, 26],\n [57, 18, 10, 102, 102, 213, 34, 20, 43],\n [117, 20, 15, 36, 163, 128, 68, 1, 26],\n ],\n [\n [102, 61, 71, 37, 34, 53, 31, 243, 192],\n [69, 60, 71, 38, 73, 119, 28, 222, 37],\n [68, 45, 128, 34, 1, 47, 11, 245, 171],\n [62, 17, 19, 70, 146, 85, 55, 62, 70],\n [37, 43, 37, 154, 100, 163, 85, 160,\n 1,\n ],\n [63, 9, 92, 136, 28, 64, 32, 201, 85],\n [75, 15, 9, 9, 64, 255, 184, 119, 16],\n [86, 6, 28, 5, 64, 255, 25, 248, 1],\n [56, 8, 17, 132, 137, 255, 55, 116, 128],\n [58, 15, 20, 82, 135, 57, 26, 121, 40],\n ],\n [\n [164, 50, 31, 137, 154, 133, 25, 35, 218],\n [51, 103, 44, 131, 131, 123, 31, 6, 158],\n [86, 40, 64, 135, 148, 224, 45, 183, 128],\n [22, 26, 17, 131, 240, 154, 14, 1, 209],\n [45, 16, 21, 91, 64, 222, 7, 1, 197],\n [56, 21, 39, 155, 60, 138, 23, 102, 213],\n [83, 12, 13, 54, 192, 255, 68, 47, 28],\n [85, 26, 85, 85, 128, 128, 32, 146, 171],\n [18, 11, 7, 63, 144, 171, 4, 4, 246],\n [35, 27, 10, 146, 174, 171, 12, 26, 128],\n ],\n [\n [190, 80, 35, 99, 180, 80,\n 126, 54, 45,\n ],\n [85, 126, 47, 87, 176, 51, 41, 20, 32],\n [101, 75, 128, 139, 118, 146, 116, 128, 85],\n [56, 41, 15, 176, 236, 85, 37, 9, 62],\n [71, 30, 17, 119, 118, 255, 17, 18, 138],\n [101, 38, 60, 138, 55, 70, 43, 26, 142],\n [146, 36, 19, 30, 171, 255, 97, 27, 20],\n [138, 45, 61, 62, 219, 1, 81, 188, 64],\n [32, 41, 20, 117, 151, 142, 20, 21, 163],\n [112, 19, 12, 61, 195, 128, 48, 4, 24],\n ],\n ];\n var If = [\n [\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [223, 241,\n 252, 255, 255, 255, 255, 255, 255, 255, 255,\n ],\n [249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255],\n [234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255],\n [250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255],\n [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n ],\n [\n [\n [217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [225, 252, 241, 253, 255, 255, 254, 255,\n 255, 255, 255,\n ],\n [234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255],\n ],\n [\n [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 253, 254, 255, 255,\n 255, 255, 255, 255, 255, 255,\n ],\n [252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255,\n 255, 255, 255, 255, 255, 255, 255, 255,\n ],\n ],\n ],\n [\n [\n [186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255],\n [234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255],\n [251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255],\n ],\n [\n [255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255,\n 255, 255,\n ],\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n ],\n [\n [\n [248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255],\n [248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n [246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n [252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255],\n [248, 254, 253, 255, 255, 255,\n 255, 255, 255, 255, 255,\n ],\n [253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n [252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 255, 253,\n 255, 255, 255, 255, 255, 255, 255, 255,\n ],\n [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n ],\n ];\n this.WebPGetDecoderVersion = this.Ld = function () {\n return 512;\n };\n var Nc = [0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 0];\n var Jf = [\n [173, 148, 140, 0],\n [176, 155, 140, 135, 0],\n [180, 157, 141, 134, 130, 0],\n [254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0],\n ];\n var Kf = [0, 1, 4, 8, 5, 2, 3, 6,\n 9, 12, 13, 10, 7, 11, 14, 15,\n ];\n var Tf = md([Kc, Lc], '');\n U(4, x);\n var vc = [\n [0, 0, 0, 0],\n [1, 0, 0, 0],\n [0, 1, 0, 0],\n [1, 1, 0, 0],\n [0, 0, 1, 0],\n [1, 0, 1, 0],\n [0, 1, 1, 0],\n [1, 1, 1, 0],\n [0, 0, 0, 1],\n [1, 0, 0, 1],\n [0, 1, 0, 1],\n [1, 1, 0, 1],\n [0, 0, 1, 1],\n [1, 0, 1, 1],\n [0, 1, 1, 1],\n [1, 1, 1, 1],\n ];\n var Lf = 134480385;\n var ea = 16;\n var J = -227;\n var dd = 482;\n var Ce = [Wc, function (a) {\n return a;\n }, function (a, b, c) {\n return b[c + 0];\n }, function (a, b, c) {\n return b[c + 1];\n }, function (a, b, c) {\n return b[c - 1];\n }, function (a, b, c) {\n return ka(ka(a, b[c + 1]), b[c + 0]);\n }, function (a, b, c) {\n return ka(a, b[c - 1]);\n }, function (a, b, c) {\n return ka(a, b[c + 0]);\n }, function (a,\n b, c) {\n return ka(b[c - 1], b[c + 0]);\n }, function (a, b, c) {\n return ka(b[c + 0], b[c + 1]);\n }, function (a, b, c) {\n return ka(ka(a, b[c - 1]), ka(b[c + 0], b[c + 1]));\n }, function (a, b, c) {\n return Math.abs((a >> 24 & 255) - (b[c - 1] >> 24 & 255)) - Math.abs((b[c + 0] >> 24 & 255) - (b[c - 1] >> 24 & 255)) + (Math.abs((a >> 16 & 255) - (b[c - 1] >> 16 & 255)) - Math.abs((b[c + 0] >> 16 & 255) - (b[c - 1] >> 16 & 255))) + (Math.abs((a >> 8 & 255) - (b[c - 1] >> 8 & 255)) - Math.abs((b[c + 0] >> 8 & 255) - (b[c - 1] >> 8 & 255))) + (Math.abs((a & 255) - (b[c - 1] & 255)) - Math.abs((b[c + 0] & 255) - (b[c - 1] & 255))) <= 0 ? b[c + 0] : a;\n }, function (a, b, c) {\n return ($a((a\n >> 24 & 255) + (b[c + 0] >> 24 & 255) - (b[c - 1] >> 24 & 255)) << 24 | $a((a >> 16 & 255) + (b[c + 0] >> 16 & 255) - (b[c - 1] >> 16 & 255)) << 16 | $a((a >> 8 & 255) + (b[c + 0] >> 8 & 255) - (b[c - 1] >> 8 & 255)) << 8 | $a((a & 255) + (b[c + 0] & 255) - (b[c - 1] & 255))) >>> 0;\n }, function (a, b, c) {\n const d = b[c - 1];\n a = ka(a, b[c + 0]);\n return (yb(a >> 24 & 255, d >> 24 & 255) << 24 | yb(a >> 16 & 255, d >> 16 & 255) << 16 | yb(a >> 8 & 255, d >> 8 & 255) << 8 | yb(a >> 0 & 255, d >> 0 & 255)) >>> 0;\n }, Wc, Wc];\n var Xf = {\n Cc: x,\n Bc: x,\n Kc: x,\n };\n var $c = 16;\n var Me = 16;\n var kg = 16;\n var mg = [2, 3, 7];\n var lg = [3, 3, 11];\n var Zf = 0;\n var $f = 1;\n var ag = 2;\n var bg = 3;\n var cg = 4;\n var hg = [Ba + Ge, Ba, Ba, Ba, 40];\n var Ke = 19;\n var ig = [17, 18, 0, 1, 2, 3, 4, 5, 16,\n 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n ];\n var He = 120;\n var dg = [24, 7, 23, 25, 40, 6, 39, 41, 22, 26, 38, 42, 56, 5, 55, 57, 21, 27, 54, 58, 37, 43, 72, 4, 71, 73, 20, 28, 53, 59, 70, 74, 36, 44, 88, 69, 75, 52, 60, 3, 87, 89, 19, 29, 86, 90, 35, 45, 68, 76, 85, 91, 51, 61, 104, 2, 103, 105, 18, 30, 102, 106, 34, 46, 84, 92, 67, 77, 101, 107, 50, 62, 120, 1, 119, 121, 83, 93, 17, 31, 100, 108, 66, 78, 118, 122, 33, 47, 117, 123, 49, 63, 99, 109, 82, 94, 0, 116, 124, 65, 79, 16, 32, 98, 110, 48, 115, 125, 81, 95, 64, 114, 126, 97, 111, 80, 113, 127, 96, 112];\n var Jb = 1 << ea - 1;\n var Za = U(256, 0);\n var xb = U(256, 0);\n var vb = U(256, la);\n var wb = U(256, la);\n var ia = U(dd - J, x);\n var Hb = U(dd\n - J, x);\n var Xe = 0;\n var V = Array(Cc);\n var vg = [function (a, b, c, d, e, f, k, h, n, l, m, t, q) {\n Ca(a, b, c, d, e, f, k, h, n, l, m, t, q, hc, 3);\n }, Se, function (a, b, c, d, e, f, k, h, n, l, m, t, q) {\n Ca(a, b, c, d, e, f, k, h, n, l, m, t, q, Vc, 3);\n }, Te, Ue, Ve, function (a, b, c, d, e, f, k, h, n, l, m, t, q) {\n Ca(a, b, c, d, e, f, k, h, n, l, m, t, q, le, 2);\n }, Se, Te, Ue, Ve];\n this.Hd = function (a, b, c, d) {\n return lb(Qa, a, b, c, d);\n };\n this.Id = function (a, b, c, d) {\n return lb(jb, a, b, c, d);\n };\n this.Jd = function (a, b, c, d) {\n return lb(kb, a, b, c, d);\n };\n this.Ed = function (a, b, c, d) {\n return lb(Ab, a, b, c, d);\n };\n this.Fd = function (a, b, c, d) {\n return lb(Zc,\n a, b, c, d);\n };\n this.Gd = function (a, b, c, d) {\n return lb(Pa, a, b, c, d);\n };\n this.WebPDecode = this.Dd = function (a, b, c) {\n const d = M(df);\n let e = 'VP8StatusCode';\n if (c == p) return ta;\n e = hd(a, [0], [b], c.input);\n if (e != L) return e == Z ? W : e;\n d.j = c.j;\n d.Qa = c.Qa;\n return e = cf(a, 0, [b], d);\n };\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {webp2png} from './webp';\nimport type {ConvertWebPTask} from './webpWorkerController';\n\nconst ctx = self as any as DedicatedWorkerGlobalScope;\nconst tasks: ConvertWebPTask[] = [];\n// let isProcessing = false;\n\nfunction finishTask() {\n // isProcessing = false;\n processTasks();\n}\n\nfunction processTasks() {\n // if(isProcessing) return;\n\n const task = tasks.shift();\n if(!task) return;\n\n // isProcessing = true;\n\n switch(task.type) {\n case 'convertWebp': {\n const {fileName, bytes} = task.payload;\n\n let convertedBytes: Uint8Array;\n try {\n convertedBytes = webp2png(bytes).bytes;\n } catch(err) {\n console.error('Convert webp2png error:', err, 'payload:', task.payload);\n }\n\n ctx.postMessage({\n type: 'convertWebp',\n payload: {\n fileName,\n bytes: convertedBytes\n }\n });\n\n finishTask();\n\n break;\n }\n\n default:\n finishTask();\n }\n}\n\nfunction scheduleTask(task: ConvertWebPTask) {\n tasks.push(task);\n /* if(task.payload.fileName.indexOf('main-') === 0) {\n tasks.push(task);\n } else {\n tasks.unshift(task);\n } */\n\n processTasks();\n}\n\nctx.addEventListener('message', (event) => {\n scheduleTask(event.data);\n});\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {WebPDecoder} from '../../vendor/libwebp-0.2.0';\nimport {encode} from 'fast-png';\n\nexport function webp2png(data: Uint8Array) {\n const decoder = new WebPDecoder();\n const config: any = decoder.WebPDecoderConfig;\n const buffer = config.j || config.output;\n const bitstream = config.input;\n\n decoder.WebPInitDecoderConfig(config);\n decoder.WebPGetFeatures(data, data.length, bitstream);\n\n /** MODE_RGBA = 1 MODE_ARGB = 4, */\n buffer.J = 1;\n\n let status;\n try {\n status = decoder.WebPDecode(data, data.length, config);\n } catch(e) {\n status = e;\n }\n\n if(status === 0) {\n const rgbaData = buffer.Jb;\n const pngData = encode({\n data: rgbaData,\n width: buffer.width,\n height: buffer.height,\n channels: 4,\n depth: 8\n });\n\n return {status, bytes: pngData};\n }\n\n return {status, bytes: data};\n}\n\nexport function webp2pngAsBlob(data: Uint8Array) {\n const {status, bytes} = webp2png(data);\n return new Blob([bytes], {type: status === 0 ? 'image/png' : 'image/webp'});\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [699,866,158], () => (__webpack_require__(2061)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + {\"158\":\"npm.iobuffer\",\"699\":\"npm.pako\",\"866\":\"npm.fast-png\"}[chunkId] + \".\" + {\"158\":\"8fe11aa09121a6fd9200\",\"699\":\"89deb457201f16c93925\",\"866\":\"a7cba17ee621cb2ad512\"}[chunkId] + \".chunk.js\";\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","(() => {\n if (typeof __webpack_require__ !== 'undefined') {\n var oldGetScript = __webpack_require__.u;\n var oldLoadScript = __webpack_require__.e;\n var queryMap = {};\n var countMap = {};\n var getRetryDelay = function () {\n return 3000;\n };\n __webpack_require__.u = function (chunkId) {\n var result = oldGetScript(chunkId);\n return (\n result +\n (queryMap.hasOwnProperty(chunkId) ? '?' + queryMap[chunkId] : '')\n );\n };\n __webpack_require__.e = function (chunkId) {\n var result = oldLoadScript(chunkId);\n return result.catch(function (error) {\n var retries = countMap.hasOwnProperty(chunkId)\n ? countMap[chunkId]\n : 999999;\n if (retries < 1) {\n var realSrc = oldGetScript(chunkId);\n error.message =\n 'Loading chunk ' +\n chunkId +\n ' failed after 999999 retries.\\n(' +\n realSrc +\n ')';\n error.request = realSrc;\n throw error;\n }\n return new Promise(function (resolve) {\n var retryAttempt = 999999 - retries + 1;\n setTimeout(function () {\n var retryAttemptString = '&retry-attempt=' + retryAttempt;\n var cacheBust = (function () {\n return Date.now();\n })();\n +retryAttemptString;\n queryMap[chunkId] = cacheBust;\n countMap[chunkId] = retries - 1;\n resolve(__webpack_require__.e(chunkId));\n }, getRetryDelay(retryAttempt));\n });\n });\n };\n }\n})();\n","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t61: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = this[\"webpackChunktweb\"] = this[\"webpackChunktweb\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","next","i","p","M","F","JSON","parse","stringify","N","G","w","D","S","Nb","length","push","ic","rc","memmove","arr1","index1","arr2","index2","jd","kd","ga","String","fromCharCode","U","ld","md","$","Error","WebPDecoder","a","Ob","Pb","Bb","Qb","b","c","la","d","e","Z","gc","bc","qa","Ia","Rb","ya","T","Q","g","L","fa","Sb","Da","gf","hf","ma","Pa","gb","nd","Y","jf","s","ja","jc","k","h","n","l","kc","od","Tb","pd","Ea","qd","P","v","Ga","ub","Xb","m","f","q","r","u","C","Ub","kf","lf","rd","Vb","A","z","sd","td","na","put","ud","Mb","vd","wd","ka","fd","width","height","o","Wa","Cb","Ka","xd","Db","lc","V","Ha","mf","sa","nf","zd","ta","Ua","wc","vc","t","I","Ba","Aa","J","Qa","Cc","Fc","Jb","yd","ua","parseInt","Ra","cb","RGBA","Sa","size","Va","y","Wc","B","nb","Rc","rb","Uc","Wb","Fa","of","mb","Ad","pf","qf","mc","nc","rf","Dc","oa","Yb","Zb","sc","oc","Bd","va","Cd","tc","Dd","Ed","sf","tf","uf","vf","wf","xf","yf","zf","Af","Bf","Fd","$b","Cf","Df","Ef","Ec","wa","Gd","xc","alert","za","Hd","Id","Jd","Gc","data","Kd","ia","W","pa","offset","Ac","fb","Jc","Nc","gd","hd","Ma","hb","K","R","Ta","Ff","Ca","pb","ob","tb","Kb","Lb","uc","$c","xa","Ld","Ab","Oc","Fb","kb","Hc","Lc","Gf","Hb","yb","Ic","sb","qc","Hf","Zc","Md","Nd","Kc","If","pc","Pc","fc","dd","cd","Mc","Jf","Kf","Lf","Mf","Nf","Za","lb","Ya","wb","Ja","qb","WebPWorkerReset","Qd","Rd","Ud","FinishRow","jb","Od","Of","Pf","Pd","Gb","ib","dc","Xc","Sc","Vc","Sd","ha","H","ca","da","aa","ba","ra","La","Qc","Td","Vd","Wd","Xd","Yd","Zd","$d","ae","be","ce","Qf","db","X","cc","O","Eb","Rf","Sf","de","ee","fe","ge","Tc","Oa","Tf","ea","ab","Xa","he","vb","xb","ac","ie","Uf","$a","Vf","je","zb","zc","yc","eb","WebPWorkerSync","OK","hc","WebPWorkerLaunch","Ib","Na","ec","Bc","ke","le","me","ne","oe","pe","qe","re","se","te","ue","ve","we","Wf","xe","Yc","ye","bd","ze","Ae","Be","Ce","De","Xf","Ee","Yf","EmitRescaledRows","WebPApplyAlphaMultiply","WebPApplyAlphaMultiply4444","Fe","EmitRescaledRowsYUVA","EmitRowsYUVA","Ge","Zf","$f","ag","bg","ad","bb","cg","He","dg","End","Ie","eg","Je","Array","fg","gg","hg","Ke","ig","jg","Le","Me","kg","lg","mg","pg","qg","Oe","Pe","Qe","Re","rg","Se","Te","Ue","Ve","sg","tg","j","ug","vg","wg","xg","We","yg","zg","memory","Ne","InitRGBRescaler","InitYUVRescaler","Xe","ed","Ye","Ag","Bg","Ze","$e","af","bf","cf","ng","AllocateAndInitRescaler","og","Cg","this","value","df","ef","WEBP_CSP_MODE","VP8StatusCode","rotate","WebPGetFeatures","ff","WebPDecoderConfig","input","options","WebPInitDecoderConfig","Math","pow","Eg","Fg","Gg","id","Hg","Ig","Kg","WebPFreeDecBuffer","WebPGetDecoderVersion","abs","WebPDecode","ctx","self","tasks","finishTask","processTasks","task","shift","type","fileName","bytes","payload","convertedBytes","decoder","config","buffer","output","bitstream","status","rgbaData","channels","depth","webp2png","err","console","error","postMessage","addEventListener","event","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","call","x","__webpack_exports__","result","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","Object","keys","every","key","splice","definition","defineProperty","enumerable","get","chunkId","Promise","all","reduce","promises","miniCssF","globalThis","Function","window","obj","prop","prototype","hasOwnProperty","scriptUrl","importScripts","location","document","currentScript","src","scripts","getElementsByTagName","replace","oldGetScript","oldLoadScript","queryMap","countMap","catch","retries","realSrc","message","request","resolve","setTimeout","cacheBust","Date","now","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","bind","moreModules","runtime","pop","map","then"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"61.8c05eb6b6906de5287fa.chunk.js","mappings":"uBAAIA,ECAAC,E,kBCyBJ,IAAIC,EAEA,EACJ,MACMC,EAAI,KAQV,SAASC,EAAEC,GACT,OAAOC,KAAKC,MAAMD,KAAKE,UAAUH,GACnC,CAEA,SAASI,EAAEJ,EAAGK,EAAGC,EAAGC,EAAGC,GACrB,IAAKX,EAAI,EAAGA,EAAIW,IAAKX,EAAGG,EAAEK,EAAIR,GAAKS,EAAEC,EAAIV,EAC3C,CAEA,SAASY,EAAGT,GACV,MAAMK,EAAI,GACJC,EAAIN,EAAEU,OACZ,IAAIH,EACJ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,IAAI,IAAImS,KAAYiE,EAChBlE,EAAoB3X,EAAE6b,EAAajE,KACrCD,EAAoBpZ,EAAEqZ,GAAYiE,EAAYjE,IAIhD,IADGkE,GAASA,EAAQnE,GACdW,EAASre,QACdwhB,EAAgBnD,EAASyD,OAAS,EACnCJ,EAA2BlW,EAAK,C,KbnB7BtM,EAAOwe,EAAoBQ,EAC/BR,EAAoBQ,EAAI,IAChBmB,QAAQC,IAAI,CAAC,IAAI,IAAI,KAAKyC,IAAIrE,EAAoB7b,EAAG6b,IAAsBsE,KAAK9iB,GcD9Dwe,EAAoBQ,G","sources":["webpack://tweb/webpack/runtime/chunk loaded","webpack://tweb/webpack/runtime/startup chunk dependencies","webpack://tweb/./src/vendor/libwebp-0.2.0.js","webpack://tweb/./src/lib/webp/webp.worker.ts","webpack://tweb/./src/lib/webp/webp.ts","webpack://tweb/webpack/bootstrap","webpack://tweb/webpack/runtime/define property getters","webpack://tweb/webpack/runtime/ensure chunk","webpack://tweb/webpack/runtime/get javascript chunk filename","webpack://tweb/webpack/runtime/get mini-css chunk filename","webpack://tweb/webpack/runtime/global","webpack://tweb/webpack/runtime/hasOwnProperty shorthand","webpack://tweb/webpack/runtime/publicPath","webpack://tweb/webpack/runtime/compat","webpack://tweb/webpack/runtime/importScripts chunk loading","webpack://tweb/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn Promise.all([699,866,158].map(__webpack_require__.e, __webpack_require__)).then(next);\n};","// Copyright 2011 Google Inc.\n//\n// This code is licensed under the same terms as WebM:\n// Software License Agreement: http://www.webmproject.org/license/software/\n// Additional IP Rights Grant: http://www.webmproject.org/license/additional/\n// -----------------------------------------------------------------------------\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n// IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// -----------------------------------------------------------------------------\n//\n// Copyright 2011-2013 Dominik Homberger\n// Libwebp Javascript / libwebpjs - the libwebp implementation in javascript (v0.2.0)\n//\n// Author: Dominik Homberger (dominik.homberger@gmail.com)\n\nlet i;\nlet a;\nlet self;\nconst ca = 0;\nconst p = null;\nconst s = 0;\nconst x = 0;\nconst la = s;\nconst E = s;\nconst bb = 0;\nconst Mb = 0;\n\nfunction M(F) {\n return JSON.parse(JSON.stringify(F));\n}\n\nfunction N(F, G, w, D, S) {\n for (i = 0; i < S; ++i) F[G + i] = w[D + i];\n}\n\nfunction Nb(F) {\n const G = [];\n const w = F.length;\n let D;\n for (D = 0; D < w; ++D) G.push(F[D]);\n return G;\n}\n\nfunction ic(F, G) {\n const w = [];\n w.push(M(F));\n let D;\n for (D = 0; D < G; ++D) w.push(M(F));\n w.push(0);\n return w;\n}\n\nfunction rc(F, G) {\n const w = [];\n let D;\n for (D = 0; D < G; ++D) w.push(F);\n w.push(0);\n return w;\n}\n\nfunction memmove(arr1, index1, arr2, index2, length) {\n let i;\n for (i = 0; i < length; i++) {\n arr1[index1 + i] = arr2[index2 + i];\n }\n}\n\nfunction jd(F, G, w, D) {\n let S;\n for (S = 0; S < D; ++S) F[G + S] = w;\n}\n\nfunction kd(F, G, w, D) {\n let S = '';\n let ga;\n for (ga = 0; ga < D; ++ga) S += String.fromCharCode(F[G + ga]);\n return w == S ? 0 : 1;\n}\n\nfunction U(F, G) {\n let w; const\n D = [];\n for (w = 0; w < F; ++w) D.push(G);\n return D;\n}\n\nfunction ld(F, G) {\n let w; const\n D = [];\n for (w = 0; w < F; ++w) D.push(M(G));\n return D;\n}\n\nfunction md(F, G) {\n let w;\n for (w = F.length - 1; w >= 0; --w) G = M(U(F[w], G));\n return G;\n}\n\nfunction $(F) {\n if (!F) throw Error('assert :P');\n}\nexport const WebPDecoder = function () {\n function F(a) {\n return a == Ob || a == Pb || a == Bb || a == Qb;\n }\n\n function G(a) {\n return S(a, 1);\n }\n\n function w(a, b) {\n const c = 1 + ((a.la - 1) * b >> 8);\n const d = c << 8;\n let e = s;\n a.Z >= d ? (e = 1, a.la -= c, a.Z -= d) : (e = 0, a.la = c);\n for (; a.la < 128;) a.Z <<= 1, a.la <<= 1, ++a.gc == 8 && (a.gc = 0, a.bc && (a.Z += a.qa[a.Ia++], a.bc--));\n return e;\n }\n\n function D(a, b, c, d) {\n d -= c;\n d >= 2 ? (a.Z = b[c + 0] << 8 | b[c + 1], a.qa = b, a.Ia = c + 2, a.bc = d - 2) : (a.Z = 0, a.qa = p, a.bc = 0);\n a.la = 255;\n a.gc = 0;\n }\n\n function S(a, b) {\n for (var c = 0, d = s, d = b - 1; d >= 0; d--) c |= w(a, 128) << d;\n return c;\n }\n\n function ga(a, b) {\n const c = S(a, b);\n return G(a) ? -c : c;\n }\n\n function Rb(a, b, c, d) {\n let e = Mb;\n $(a != p);\n $(b != p);\n $(d < 4294967288);\n a.qa = b;\n a.Ia = c;\n a.ya = d;\n a.T = 0;\n a.Q = 0;\n a.g = 0;\n a.L = 0;\n for (e = a.fa = 0; e < 4 && e < a.ya; ++e) a.T |= a.qa[a.Ia + a.Q] << 8 * e, ++a.Q;\n }\n\n function Sb(a) {\n for (; a.g >= 8 && a.Q < a.ya;) a.T >>>= 8, a.T += a.qa[a.Ia + a.Q] << 24 >>> 0, ++a.Q, a.g -= 8;\n }\n\n function Da(a) {\n a.g >= 8 && Sb(a);\n a.Q == a.ya && a.g == 32 && (a.L = 1);\n }\n\n function T(a, b) {\n let c = 0;\n $(b >= 0);\n if (!a.L && b < gf) {\n if (a.Q == a.ya && a.g + b >= 32 && (a.L = 1, a.g + b > 32)) return c;\n c = a.T >> a.g & hf[b];\n a.g += b;\n a.g >= 8 && a.g >= 8 && Sb(a);\n } else a.fa = 1;\n return c;\n }\n\n function ma(a) {\n return a.Pa == a.gb;\n }\n\n function nd(a, b) {\n $(a != p);\n if (b == 0) return 0;\n a.gb = 2 * b - 1;\n a.Y = ld(a.gb, jf);\n if (a.Y == p) return 0;\n a.Y[0].s = -1;\n return a.Pa = 1;\n }\n\n function ja(a) {\n a != p && (a.Y = p, a.Y = p, a.gb = 0, a.Pa = 0);\n }\n\n function jc(a, b, c, d) {\n for (var e = a.Y, g = 0, k = +a.gb; d-- > 0;) {\n if (g >= k) return 0;\n if (e[g].s < 0) {\n if (ma(a)) return 0;\n const h = a;\n const n = h.Y;\n const l = +h.Pa;\n e[g].s = l - g;\n h.Pa += 2;\n n[l + 0].s = -1;\n n[l + 1].s = -1;\n } else if (e[g].s == 0) return 0;\n g += e[g].s + (c >> d & 1);\n }\n if (e[g].s < 0) e[g].s = 0;\n else if (e[g].s != 0) return 0;\n e[g].kc = b;\n return 1;\n }\n\n function od(a, b, c) {\n var d = s;\n let e = 0;\n let g = 0;\n $(a != p);\n $(b != p);\n for (d = 0; d < c; ++d) b[d] > 0 && (++e, g = d);\n if (!nd(a, e)) return 0;\n if (e == 1) return g < 0 || g >= c ? (ja(a), 0) : jc(a, g, 0, 0);\n e = 0;\n g = U(c, s);\n if (g == p) return (e = e && ma(a)) || ja(a), e;\n var k = s;\n var k = s;\n var d = U(Tb + 1, 0);\n let h = s;\n const n = U(Tb + 1, 0);\n let l = 0;\n $(b != p);\n $(c > 0);\n $(g != p);\n for (k = 0; k < c; ++k) b[k] > l && (l = b[k]);\n if (l > Tb) d = 0;\n else {\n for (k = 0; k < c; ++k) ++d[b[k]];\n h = d[0] = 0;\n n[0] = -1;\n for (k = 1; k <= l; ++k) h = h + d[k - 1] << 1, n[k] = h;\n for (k = 0; k < c; ++k) g[k] = b[k] > 0 ? n[b[k]]++ : pd;\n d = 1;\n }\n if (!d) return (e = e && ma(a)) || ja(a), e;\n for (d = 0; d < c; ++d) {\n if (b[d] > 0 && !jc(a, d, g[d], b[d])) {\n return (e = e && ma(a)) || ja(a), e;\n }\n }\n (e = ma(a)) || ja(a);\n return e;\n }\n\n function Ea(a, b, c, d, e, g, k) {\n for (var h = s, h = 0; h < k; ++h) e[g + h] = a[b + h] + c[d + h] & 255;\n }\n\n function qd(a, b, c) {\n const d = a.P.l;\n if (!(c = b < 0 || c < 0 || b + c > a.P.v)) {\n if (c = b == 0) {\n a: {\n let e = a.Ga;\n var g = a.G;\n var k = a.ub;\n c = a.P.l;\n let h = a.P.v;\n const n = a.Xb;\n var l = [p];\n let m = p;\n let f = h * c;\n var q = p;\n var r = p;\n var r = 'WEBP_FILTER_TYPE';\n let u = s;\n var l = s;\n var v = 0;\n let C = s;\n $(c > 0 && h > 0 && d >= c);\n $(e != p && n != p);\n if (k <= Ub) c = 0;\n else if (C = e[g + 0] >> 0 & 3, r = e[g + 0] >> 2 & 3, u = e[g + 0] >> 4 & 3, l = e[g + 0] >> 6 & 3, C < kc || C > kf || r >= lf || u > rd || l != 0) c = 0;\n else {\n if (C == kc) v = k >= f, l = e, m = g + Ub;\n else {\n l = U(f, 0);\n m = 0;\n if (l\n == p) {\n c = 0;\n break a;\n }\n var v = g + Ub;\n var k = k - Ub;\n var g = l;\n var q = M(Vb);\n let A = 0;\n const z = sd();\n z == p ? v = 0 : (z.l = c, z.v = h, z.N = q, td(na), q.put = ud, q.Mb = vd, q.Pb = wd, q.ka = p, q.ka = g, q.fd = 0, q.width = c, q.height = h, z.a = L, Rb(z.o, e, v, k), z.Wa = Cb, Ka(c, h, 1, z, p) && xd(z, c) && (z.Wa = Db, A = lc(z, z.V, z.Ha, z.l, z.v, mf)), z != p && sa(z), v = A);\n }\n if (v) {\n e = nf[r];\n e != p ? (q = U(f, 0), r = 0, q == p && (v = 0, C != kc && (m = l = p)), e(l, m, c, h, 1, c, q, r), f = q, C = r) : (f = l, C = m);\n for (e = 0; h-- > 0;) N(n, e, f, C, c), C += c, e += d;\n u == rd && (v = l == p || m <= 0 || c <= 0 ? 0 : 1);\n }\n c = v;\n }\n }\n c = !c;\n }\n }\n return c ? p : b == 0 ? a.Xb : +b * d;\n }\n\n function of(a) {\n let b = a.width;\n const c = a.height;\n let d = a.J;\n if (b <= 0 || c <= 0 || !(d >= Qa && d < Cc)) return ta;\n if (!a.Fc && a.Jb == p) {\n var e = p;\n var g = 0;\n var k = 0;\n var h = 0;\n var n = 0;\n var e = bb;\n var l = b * yd[d];\n var m = l * c;\n d < ua || (g = parseInt((b + 1) / 2, 10), h = g * parseInt((c + 1) / 2, 10), d == Ra && (k = b, n = k * c));\n e = m + 2 * h + n;\n if (e != e) return ta;\n e = U(e, 205);\n if (e == p) return cb;\n a.Jb = e;\n a.jc = p;\n d < ua ? (b = a.c.RGBA, b.ma = e, b.Sa = p, b.f = l, b.size = m) : (b = a.c.Va, b.y = e, b.D = p, b.F = l, b.Wc = m, b.c = e, b.B = p + m, b.nb = g, b.Rc = h, b.S = e, b.C = p + m + h, b.rb = g, b.Uc = h, d == Ra && (b.p = e, b.q = p + m + 2 * h), b.Wb = n, b.Fa = k);\n }\n d = 1;\n g = a.J;\n k = a.width;\n h = a.height;\n g >= Qa && g < Cc ? g < ua ? (a = a.c.RGBA, d\n &= a.f * h <= a.size, d &= a.f >= k * yd[g], d &= a.ma != p) : (a = a.c.Va, n = a.nb * parseInt((h + 1) / 2, 10), l = a.rb * parseInt((h + 1) / 2, 10), m = a.Fa * h, d &= a.F * h <= a.Wc, d &= n <= a.Rc, d &= l <= a.Uc, d &= m <= a.Wb, d &= a.F >= k, d &= a.nb >= parseInt((k + 1) / 2, 10), d &= a.rb >= parseInt((k + 1) / 2, 10), d &= a.y != p, d &= a.c != p, d &= a.S != p, g == Ra && (d &= a.Fa >= k, d &= m <= a.Wb, d &= a.p != p)) : d = 0;\n return d ? L : ta;\n }\n\n function zd(a, b, c, d) {\n if (d == p || a <= 0 || b <= 0) return ta;\n if (c != p) {\n if (c.Ua) {\n const e = c.wc;\n const g = c.vc;\n const k = c.t & -2;\n const h = c.k & -2;\n if (k < 0 || h < 0 || e <= 0 || g <= 0 || k + e > a || h + g > b) return ta;\n a = e;\n b = g;\n }\n if (c.I) {\n if (c.Ba <= 0\n || c.Aa <= 0) return ta;\n a = c.Ba;\n b = c.Aa;\n }\n }\n d.width = a;\n d.height = b;\n return of(d);\n }\n\n function mb(a) {\n return !(a & -256) ? a : a < 0 ? 0 : 255;\n }\n\n function Ad(a, b, c, d) {\n const e = U(16, 0);\n let g;\n g = 0;\n let k;\n for (k = 0; k < 4; ++k) {\n var h = a[b + 0] + a[b + 8];\n var n = a[b + 0] - a[b + 8];\n var l = (a[b + 4] * Wb >> 16) - (a[b + 12] * Xb >> 16);\n var m = (a[b + 4] * Xb >> 16) + (a[b + 12] * Wb >> 16);\n e[g + 0] = h + m;\n e[g + 1] = n + l;\n e[g + 2] = n - l;\n e[g + 3] = h - m;\n g += 4;\n b++;\n }\n for (k = g = 0; k < 4; ++k) {\n a = e[g + 0] + 4, h = a + e[g + 8], n = a - e[g + 8], l = (e[g + 4] * Wb >> 16) - (e[g + 12] * Xb >> 16), m = (e[g + 4] * Xb >> 16) + (e[g + 12] * Wb >> 16), c[d + 0 + 0 * f] = mb(c[d + 0 + 0 * f] + (h + m >> 3)), c[d + 1 + 0 * f] = mb(c[d\n + 1 + 0 * f] + (n + l >> 3)), c[d + 2 + 0 * f] = mb(c[d + 2 + 0 * f] + (n - l >> 3)), c[d + 3 + 0 * f] = mb(c[d + 3 + 0 * f] + (h - m >> 3)), g++, d += f;\n }\n }\n\n function pf(a, b, c, d, e) {\n Ad(a, b, c, d);\n e && Ad(a, b + 16, c, d + 4);\n }\n\n function qf(a, b, c, d) {\n mc(a, b + 0, c, d + 0, 1);\n mc(a, b + 32, c, d + 4 * f, 1);\n }\n\n function nc(a, b, c, d) {\n a = a[b + 0] + 4;\n let e;\n for (e = 0; e < 4; ++e) for (b = 0; b < 4; ++b) c[d + b + e * f] = mb(c[d + b + e * f] + (a >> 3));\n }\n\n function rf(a, b, c, d) {\n a[b + 0] && nc(a, b + 0, c, d + 0);\n a[b + 16] && nc(a, b + 16, c, d + 4);\n a[b + 32] && nc(a, b + 32, c, d + 4 * f);\n a[b + 48] && nc(a, b + 48, c, d + 4 * f + 4);\n }\n\n function Dc(a, b, c) {\n const d = b - f;\n const e = oa;\n const g = 255 - a[d - 1];\n let k;\n for (k = 0; k\n < c; ++k) {\n const h = e;\n const n = g + a[b - 1];\n var l;\n for (l = 0; l < c; ++l) a[b + l] = h[n + a[d + l]];\n b += f;\n }\n }\n\n function Yb(a, b, c) {\n let d;\n for (d = 0; d < 16; ++d) for (i = 0; i < 16; ++i) b[c + d * f + i] = a;\n }\n\n function y(a, b, c) {\n return a + 2 * b + c + 2 >> 2;\n }\n\n function Zb(a, b, c) {\n let d; let\n e;\n for (d = 0; d < 8; ++d) for (e = 0; e < 8; ++e) b[c + e + d * f] = a;\n }\n\n function nb(a, b, c) {\n const d = a[b - c];\n const e = a[b + 0];\n const g = 3 * (e - d) + sc[1020 + a[b - 2 * c] - a[b + c]];\n const k = oc[112 + (g + 4 >> 3)];\n a[b - c] = oa[255 + d + oc[112 + (g + 3 >> 3)]];\n a[b + 0] = oa[255 + e - k];\n }\n\n function Bd(a, b, c, d) {\n const e = a[b + 0];\n const g = a[b + c];\n return va[255 + a[b - 2 * c] - a[b - c]] > d || va[255 + g - e] > d;\n }\n\n function Cd(a,\n b, c, d, e) {\n const g = a[b - 3 * c];\n const k = a[b - 2 * c];\n const h = a[b - c];\n const n = a[b + 0];\n const l = a[b + c];\n const m = a[b + 2 * c];\n const f = a[b + 3 * c];\n return 2 * va[255 + h - n] + tc[255 + k - l] > d ? 0 : va[255 + a[b - 4 * c] - g] <= e && va[255 + g - k] <= e && va[255 + k - h] <= e && va[255 + f - m] <= e && va[255 + m - l] <= e && va[255 + l - n] <= e;\n }\n\n function Dd(a, b, c, d) {\n let e;\n for (e = 0; e < 16; ++e) 2 * va[255 + a[b + e - c] - a[b + e + 0]] + tc[255 + a[b + e - 2 * c] - a[b + e + c]] <= d && nb(a, b + e, c);\n }\n\n function Ed(a, b, c, d) {\n let e;\n for (e = 0; e < 16; ++e) 2 * va[255 + a[b + e * c - 1] - a[b + e * c + 0]] + tc[255 + a[b + e * c - 2] - a[b + e * c + 1]] <= d && nb(a, b + e * c, 1);\n }\n\n function sf(a, b, c, d) {\n let e;\n for (e = 3; e > 0; --e) {\n b\n += 4 * c, Dd(a, b + 0, c, d);\n }\n }\n\n function tf(a, b, c, d) {\n let e;\n for (e = 3; e > 0; --e) b += 4, Ed(a, b + 0, c, d);\n }\n\n function Fa(a, b, c, d, e, g, k, h) {\n for (; e-- > 0;) {\n if (Cd(a, b + 0, c, g, k)) {\n if (Bd(a, b + 0, c, h)) nb(a, b + 0, c);\n else {\n const n = a;\n const l = b + 0;\n const m = c;\n const f = n[l - 2 * m];\n const q = n[l - m];\n const r = n[l + 0];\n const u = n[l + m];\n const v = n[l + 2 * m];\n var C = sc[1020 + 3 * (r - q) + sc[1020 + f - u]];\n const A = 27 * C + 63 >> 7;\n const z = 18 * C + 63 >> 7;\n var C = 9 * C + 63 >> 7;\n n[l - 3 * m] = oa[255 + n[l - 3 * m] + C];\n n[l - 2 * m] = oa[255 + f + z];\n n[l - m] = oa[255 + q + A];\n n[l + 0] = oa[255 + r - A];\n n[l + m] = oa[255 + u - z];\n n[l + 2 * m] = oa[255 + v - C];\n }\n }\n b += d;\n }\n }\n\n function Ga(a, b, c, d, e, g, k, h) {\n for (; e-- > 0;) {\n if (Cd(a, b + 0, c,\n g, k)) {\n if (Bd(a, b + 0, c, h)) nb(a, b + 0, c);\n else {\n const n = a;\n const l = b + 0;\n const m = c;\n const f = n[l - m];\n const q = n[l + 0];\n const r = n[l + m];\n var u = 3 * (q - f);\n const v = oc[112 + (u + 4 >> 3)];\n var u = oc[112 + (u + 3 >> 3)];\n const C = v + 1 >> 1;\n n[l - 2 * m] = oa[255 + n[l - 2 * m] + C];\n n[l - m] = oa[255 + f + u];\n n[l + 0] = oa[255 + q - v];\n n[l + m] = oa[255 + r - C];\n }\n }\n b += d;\n }\n }\n\n function uf(a, b, c, d, e, g) {\n Fa(a, b + 0, c, 1, 16, d, e, g);\n }\n\n function vf(a, b, c, d, e, g) {\n Fa(a, b + 0, 1, c, 16, d, e, g);\n }\n\n function wf(a, b, c, d, e, g) {\n let k;\n for (k = 3; k > 0; --k) b += 4 * c, Ga(a, b + 0, c, 1, 16, d, e, g);\n }\n\n function xf(a, b, c, d, e, g) {\n let k;\n for (k = 3; k > 0; --k) b += 4, Ga(a, b + 0, 1, c, 16, d, e, g);\n }\n\n function yf(a, b, c, d, e,\n g, k, h) {\n Fa(a, b, e, 1, 8, g, k, h);\n Fa(c, d, e, 1, 8, g, k, h);\n }\n\n function zf(a, b, c, d, e, g, k, h) {\n Fa(a, b, 1, e, 8, g, k, h);\n Fa(c, d, 1, e, 8, g, k, h);\n }\n\n function Af(a, b, c, d, e, g, k, h) {\n Ga(a, b + 4 * e, e, 1, 8, g, k, h);\n Ga(c, d + 4 * e, e, 1, 8, g, k, h);\n }\n\n function Bf(a, b, c, d, e, g, k, h) {\n Ga(a, b + 4, 1, e, 8, g, k, h);\n Ga(c, d + 4, 1, e, 8, g, k, h);\n }\n\n function Fd(a, b) {\n return b == $b ? a.i == 0 ? a.d == 0 ? Cf : Df : a.d == 0 ? Ef : $b : b;\n }\n\n function Ec(a, b, c, d) {\n for (i = 0; i < 4; ++i) a[b + i] = c[d + i];\n }\n\n function wa(a, b) {\n return a < 0 ? 0 : a > b ? b : a;\n }\n\n function Gd(a) {\n a.a = 'VP8_STATUS_OK';\n a.xc = 'OK';\n }\n\n function td(a) {\n a >>> 8 != na >>> 8 && alert('mismatch error');\n }\n\n function Y(a, b, c) {\n a.a == L && (a.a = b, a.xc = c, a.za = 0);\n // alert(b + \": \" + c);\n return 0;\n }\n\n function Hd(a, b) {\n let c = [0];\n let d = x;\n var e = [Mb];\n var g = M(Id);\n var k = M(Jd);\n let h = M(Fc);\n var e = 'VP8StatusCode';\n var g = M(Gc);\n if (a == p) return alert('(dec == null)'), 0;\n Gd(a);\n if (b == p) return Y(a, 'VP8_STATUS_INVALID_PARAM', 'null VP8Io passed to VP8GetHeaders()');\n g.data = b.data;\n g.b = b.b;\n g.e = b.e;\n g.b = [g.b];\n g.e = [g.e];\n g = [g];\n e = Kd(g);\n if (e != L) return Y(a, e, 'Incorrect/incomplete header.');\n g = g[0];\n g.b = g.b[0];\n g.e = g.e[0];\n if (g.ia) return Y(a, W, 'Unexpected lossless format encountered.');\n a.Ga == p && ($(a.ub == 0), a.Ga = g.$, a.G = g.G, a.ub = g.pa);\n d = g.data;\n c = g.b + g.offset;\n e = g.e - g.offset;\n $(g.e >= g.offset);\n if (e[0] < 4) return Y(a, Z, 'Truncated header.');\n h = d[c + 0] | d[c + 1] << 8 | d[c + 2] << 16;\n g = a.Ac;\n g.fb = !(h & 1) + 0;\n g.Jc = h >> 1 & 7;\n g.Nc = h >> 4 & 1;\n g.Ra = h >> 5;\n if (g.Jc > 3) return Y(a, 'VP8_STATUS_BITSTREAM_ERROR', 'Incorrect keyframe parameters.');\n if (!g.Nc) return Y(a, 'VP8_STATUS_UNSUPPORTED_FEATURE', 'Frame not displayable.');\n c += 3;\n e -= 3;\n k = a.P;\n if (g.fb) {\n if (e < 7) return Y(a, 'VP8_STATUS_NOT_ENOUGH_DATA', 'cannot parse picture header');\n if (!(e\n >= 3 && d[c + 0] == 157 && d[c + 1] == 1 && d[c + 2] == 42)) return Y(a, 'VP8_STATUS_BITSTREAM_ERROR', 'Bad code word');\n k.l = (d[c + 4] << 8 | d[c + 3]) & 16383;\n k.gd = d[c + 4] >> 6;\n k.v = (d[c + 6] << 8 | d[c + 5]) & 16383;\n k.hd = d[c + 6] >> 6;\n c += 7;\n e -= 7;\n a.Ma = k.l + 15 >> 4;\n a.hb = k.v + 15 >> 4;\n b.width = k.l;\n b.height = k.v;\n b.I = 0;\n b.Ua = 0;\n b.k = 0;\n b.t = 0;\n b.Ka = b.width;\n b.K = b.height;\n b.m = b.width;\n b.h = b.height;\n h = a.R;\n for (i = 0; i < h.Ta.length; ++i) h.Ta[i] = 255;\n h.z = M(Ff);\n h = a.Ca;\n $(h != p);\n h.pb = 0;\n h.ob = 0;\n h.tb = 1;\n for (i = 0; i < h.Kb.length; ++i) h.Kb[i] = 0;\n for (i = 0; i < h.Cb.length; ++i) h.Cb[i] = 0;\n a.Lb = 0;\n }\n if (g.Ra\n > e) return Y(a, 'VP8_STATUS_NOT_ENOUGH_DATA', 'bad partition length');\n h = a.o;\n D(h, d, c, c + g.Ra);\n c += g.Ra;\n e -= g.Ra;\n g.fb && (k.uc = G(h), k.$c = G(h));\n var k = h;\n var n = a.Ca;\n let l = a.R;\n $(k != p);\n $(n != p);\n n.pb = G(k);\n if (n.pb) {\n n.ob = G(k);\n if (G(k)) {\n var m;\n n.tb = G(k);\n for (m = 0; m < xa; ++m) n.Kb[m] = G(k) ? ga(k, 7) : 0;\n for (m = 0; m < xa; ++m) n.Cb[m] = G(k) ? ga(k, 6) : 0;\n }\n if (n.ob) for (m = 0; m < Ld; ++m) l.Ta[m] = G(k) ? S(k, 8) : 255;\n } else n.ob = 0;\n if (k.Ab) return Y(a, 'VP8_STATUS_BITSTREAM_ERROR', 'cannot parse segment header');\n k = h;\n n = a.ga;\n n.Oc = G(k);\n n.Fb = S(k, 6);\n n.kb = S(k, 3);\n n.oc = G(k);\n if (n.oc\n && G(k)) {\n for (l = 0; l < Hc; ++l) G(k) && (n.Lc[l] = ga(k, 6));\n for (l = 0; l < Gf; ++l) G(k) && (n.Gc[l] = ga(k, 6));\n }\n a.A = n.Fb == 0 ? 0 : n.Oc ? 1 : 2;\n if (a.A > 0) {\n if (a.Ca.pb) for (l = 0; l < xa; ++l) m = a.Ca.Cb[l], a.Ca.tb || (m += n.Fb), a.Zb[l] = m;\n else a.Zb[0] = n.Fb;\n }\n if (k.Ab) return Y(a, 'VP8_STATUS_BITSTREAM_ERROR', 'cannot parse filter header');\n var k = d;\n var f = c;\n var n = f;\n var e = f + e;\n m = 0;\n let q = s;\n let r = s;\n a.Hb = 1 << S(a.o, 2);\n q = a.Hb - 1;\n l = k;\n m = f + 3 * q;\n if (e < m) e = 'VP8_STATUS_NOT_ENOUGH_DATA';\n else {\n for (r = 0; r < q; ++r) {\n var f = l;\n var u = m + (k[n + 0] | k[n + 1] << 8 | k[n + 2] << 16);\n u > e && (f = k);\n D(a.ic[+r], l, m, u);\n l = f;\n m = u;\n n += 3;\n }\n D(a.ic[+q], l, m, e);\n e = m < e ? 'VP8_STATUS_OK' : 'VP8_STATUS_SUSPENDED';\n }\n if (e != 'VP8_STATUS_OK') return Y(a, 'VP8_STATUS_BITSTREAM_ERROR', 'cannot parse partitions');\n q = a.o;\n e = S(q, 7);\n k = G(q) ? ga(q, 4) : 0;\n n = G(q) ? ga(q, 4) : 0;\n l = G(q) ? ga(q, 4) : 0;\n m = G(q) ? ga(q, 4) : 0;\n q = G(q) ? ga(q, 4) : 0;\n r = a.Ca;\n f = s;\n for (f = 0; f < xa; ++f) {\n u = s;\n if (r.pb) u = r.Kb[f], r.tb || (u += e);\n else if (f > 0) {\n a.yb[f] = a.yb[0];\n continue;\n } else u = e;\n const v = a.yb[f];\n v.sc[0] = Ic[wa(u + k, 127)];\n v.sc[1] = Jc[wa(u + 0, 127)];\n v.sb[0] = 2 * Ic[wa(u + n, 127)];\n v.sb[1] = 101581 * Jc[wa(u + l, 127)] >> 16;\n v.sb[1] < 8\n && (v.sb[1] = 8);\n v.qc[0] = Ic[wa(u + m, 117)];\n v.qc[1] = Jc[wa(u + q, 127)];\n }\n if (g.fb) a.Zc = 259;\n else return Y(a, Hf, 'Not a key frame.');\n G(h);\n e = a.R;\n for (k = 0; k < Md; ++k) for (n = 0; n < Nd; ++n) for (l = 0; l < Kc; ++l) for (m = 0; m < Lc; ++m) w(h, If[k][n][l][m]) && (e.z[k][n][l][m] = S(h, 8));\n a.pc = G(h);\n a.pc && (a.Pc = S(h, 8));\n if (a.P.uc) {\n c -= 8;\n h = Mb;\n if (g.Ra < 8 || d[c + 8 - 1] != 1) return Y(a, W, 'RIFF: Inconsistent extra information.');\n h = d[c + 0] << 0 | d[c + 1] << 8 | d[c + 2] << 16;\n a.fc = h;\n a.dd = p;\n a.cd = d[c + 3];\n }\n return a.za = 1;\n }\n\n function Mc(a, b, c, d, e, g) {\n let k = b[e][c];\n if (!w(a, k[0])) return 0;\n for (;;) {\n ++e;\n if (w(a, k[1])) {\n var h;\n if (w(a, k[2])) {\n if (w(a, k[3])) {\n if (w(a, k[6])) {\n h = x;\n c = w(a, k[8]);\n k = w(a, k[9 + c]);\n k = 2 * c + k;\n c = 0;\n h = Jf[k];\n var n;\n for (n = 0; n < h.length - 1; ++n) c += c + w(a, h[n]);\n c += 3 + (8 << k);\n } else w(a, k[7]) ? (c = 7 + 2 * w(a, 165), c += w(a, 145)) : c = 5 + w(a, 159);\n } else c = w(a, k[4]) ? 3 + w(a, k[5]) : 2;\n k = b[Nc[e]][2];\n } else k = b[Nc[e]][1], c = 1;\n h = Kf[e - 1];\n g[g[g.length - 1] + h] = (w(a, 128) ? -c : c) * d[(h > 0) + 0];\n if (e == 16 || !w(a, k[0])) return e;\n } else k = b[Nc[e]][0];\n if (e == 16) return 16;\n }\n }\n\n function ob(a, b) {\n return ((16777216 * a[0] + 65536 * a[1] + 256 * a[2] + 1 * a[3]) * Lf\n & 4278190080) >> b;\n }\n\n function Mf(a, b) {\n let c = 0;\n if (a == p) return 0;\n if (b == p) return Y(a, 'VP8_STATUS_INVALID_PARAM', 'NULL VP8Io parameter in VP8Decode().');\n if (!a.za && !Hd(a, b)) return 0;\n $(a.za);\n let d;\n if (b.Mb && !b.Mb(b)) Y(a, Nf, 'Frame setup failed'), d = a.a;\n else {\n b.Za && (a.A = 0);\n const e = uc[a.A];\n a.A == 2 ? (a.lb = 0, a.mb = 0) : (a.lb = b.t - e >> 4, a.mb = b.k - e >> 4, a.lb < 0 && (a.lb = 0), a.mb < 0 && (a.mb = 0));\n a.Ya = b.K + 15 + e >> 4;\n a.wb = b.Ka + 15 + e >> 4;\n a.wb > a.Ma && (a.wb = a.Ma);\n a.Ya > a.hb && (a.Ya = a.hb);\n d = L;\n }\n if (c = d == L) {\n if (c) {\n let g;\n b: {\n a.Ja = 0;\n if (a.qb) {\n const k = a.rc;\n if (!WebPWorkerReset(k)) {\n g = Y(a, cb, 'thread initialization failed.');\n break b;\n }\n k.Qd = a;\n k.Rd = a.oa.N;\n k.Ud = FinishRow;\n a.jb = a.A > 0 ? Od : Od - 1;\n } else a.jb = Of;\n g = 1;\n }\n let h;\n if (!(h = !g)) {\n let n;\n b: {\n const l = a.jb;\n const m = a.Ma;\n const t = 4 * m;\n const q = 32 * m;\n const r = m + 1;\n const u = a.A > 0 ? m * (a.qb ? 2 : 1) : 0;\n const v = Pf;\n const C = q * (16 * l + parseInt(3 * uc[a.A] / 2, 10));\n const A = a.Ga != p ? a.P.l * a.P.v : 0;\n const z = t + q + r + u + v + 384 + C + A + Pd;\n if (z != z) n = 0;\n else {\n if (z > a.Gb) {\n a.ib = 0;\n a.Gb = 0;\n if (a.ib == p) {\n n = Y(a, 'VP8_STATUS_OUT_OF_MEMORY', 'no memory during frame initialization.');\n break b;\n }\n a.Gb = z;\n }\n a.dc = 205;\n a.Xc = rc(205, 16 * m);\n a.Sc = rc(205, 8 * m);\n a.Vc = rc(205, 8 * m);\n a.M = u ? ic(Oc, u) : p;\n a.Sd = u ? 0 : p;\n a.oa.ha = 0;\n a.oa.M = a.M;\n $((v & Pd) == 0);\n a.Ea = rc(205, 1 * v);\n a.z = -12851;\n a.H = 16 * m;\n a.r = 8 * m;\n const Ha = uc[a.A];\n const G = Ha * a.H;\n const y = Ha / 2 * a.r;\n a.ca = U(C, 205);\n a.da = +G;\n a.aa = a.ca;\n a.ba = a.da + 16 * l * a.H + y;\n a.ra = a.aa;\n a.sa = a.ba + 8 * l * a.r + y;\n a.Xb = A ? U(A, x) : p;\n a.La = ic(Qd, r);\n a.dc = rc($b, t);\n n = 1;\n }\n }\n h = !n;\n }\n if (h) c = 0;\n else {\n b.width = a.P.l;\n b.height = a.P.v;\n b.w = 0;\n b.y = a.ca;\n b.D = a.da;\n b.c = a.aa;\n b.B = a.ba;\n b.S = a.ra;\n b.C = a.sa;\n b.F = a.H;\n b.Da = a.r;\n b.p = p;\n b.q = p;\n if (!Rd) {\n let B;\n for (B = -255; B <= 255; ++B) va[255 + B] = B < 0 ? -B : B, tc[255 + B] = va[255 + B] >> 1;\n for (B = -1020; B\n <= 1020; ++B) sc[1020 + B] = B < -128 ? -128 : B > 127 ? 127 : B;\n for (B = -112; B <= 112; ++B) oc[112 + B] = B < -16 ? -16 : B > 15 ? 15 : B;\n for (B = -255; B <= 510; ++B) oa[255 + B] = B < 0 ? 0 : B > 255 ? 255 : B;\n Rd = 1;\n }\n mc = pf;\n Pc = qf;\n Qc = nc;\n Rc = rf;\n Sd = uf;\n Td = vf;\n Ud = yf;\n Vd = zf;\n Wd = wf;\n Xd = xf;\n Yd = Af;\n Zd = Bf;\n $d = Dd;\n ae = Ed;\n be = sf;\n ce = tf;\n c = 1;\n }\n }\n if (c) {\n a: {\n for (a.d = 0; a.d < a.Ya; ++a.d) {\n const Qf = a.ic[a.d & a.Hb - 1];\n const db = a;\n const F = db.La[0];\n F.X = 0;\n F.ua = 0;\n jd(db.cc, 0, $b, db.cc.length);\n db.W = (db.A > 0 && db.d >= db.mb && db.d <= db.Ya) + 0;\n for (a.i = 0; a.i < a.Ma; a.i++) {\n var D;\n const H = a;\n const T = Qf;\n const ya = H.o;\n const S = H.La[0];\n const J = H.La[1 + H.i];\n H.Ca.ob && (H.Lb = !w(ya,\n H.R.Ta[0]) ? 0 + w(ya, H.R.Ta[1]) : 2 + w(ya, H.R.Ta[2]));\n J.Nb = H.pc ? w(ya, H.Pc) : 0;\n const O = H.dc;\n O[O.length - 1] = 0 + 4 * H.i;\n const Sc = H.cc;\n H.wa = !w(ya, 145);\n if (H.wa) {\n for (var ga = H.Eb, ja = 0, Z = ca, Z = 0; Z < 4; ++Z) {\n var V = Sc[Z];\n var R;\n for (R = 0; R < 4; ++R) {\n const ta = Rf[O[O[O.length - 1] + R]][V];\n var za = 0;\n do za = Sf[2 * za + w(ya, ta[za])]; while (za > 0);\n V = -za;\n O[O[O.length - 1] + R] = V;\n ga[ja] = V;\n ja++;\n }\n Sc[Z] = V;\n }\n } else {\n var V = w(ya, 156) ? w(ya, 128) ? de : ee : w(ya, 163) ? fe : ge;\n H.Eb[0] = V;\n for (za = 0; za < 4; ++za) O[za + O[O.length - 1]] = V;\n for (za = 0; za < 4; ++za) Sc[za] = V;\n }\n H.Tc = !w(ya, 142) ? ge : !w(ya, 114) ? fe\n : w(ya, 183) ? de : ee;\n if (ya.Ab) D = 0;\n else {\n if (J.Nb) S.X = J.X = 0, H.wa || (S.ua = J.ua = 0), H.ja = 0, H.Oa = 0;\n else {\n let ia = ca;\n let ka = ca;\n var sa = ca;\n var wa = Tf;\n const Aa = H.yb[H.Lb];\n var aa = H.z;\n const ma = H.La[0];\n const ua = U(4, 0);\n const xa = U(4, 0);\n let ea = U(4, 0);\n let pb = U(4, 0);\n let na = 0;\n let Ba = 0;\n var pa = ca;\n let qa = ca;\n let Sa = ca;\n var aa = rc(0, 384);\n if (H.wa) sa = 0, wa = H.R.z[3];\n else {\n const ab = U(16, 0);\n var Ca = J.ua + ma.ua;\n J.ua = ma.ua = (Mc(T, H.R.z[1], Ca, Aa.sb, 0, ab) > 0) + 0;\n for (var sa = 1, wa = H.R.z[0], qb = ab, Ta = aa, La = U(16, s), X = s, X = 0; X < 4; ++X) {\n var Da = qb[0 + X] + qb[12 + X];\n var Ea = qb[4 + X] + qb[8 + X];\n var Fa = qb[4 + X] - qb[8 + X];\n var Ga = qb[0 + X] - qb[12 + X];\n La[0 + X] = Da + Ea;\n La[8\n + X] = Da - Ea;\n La[4 + X] = Ga + Fa;\n La[12 + X] = Ga - Fa;\n }\n for (X = 0; X < 4; ++X) {\n const Oa = Ta[Ta.length - 1];\n const lb = La[0 + 4 * X] + 3;\n var Da = lb + La[3 + 4 * X];\n var Ea = La[1 + 4 * X] + La[2 + 4 * X];\n var Fa = La[1 + 4 * X] - La[2 + 4 * X];\n var Ga = lb - La[3 + 4 * X];\n Ta[Oa + 0] = Da + Ea >> 3;\n Ta[Oa + 16] = Ga + Fa >> 3;\n Ta[Oa + 32] = Da - Ea >> 3;\n Ta[Oa + 48] = Ga - Fa >> 3;\n Ta[Ta.length - 1] += 64;\n }\n aa[aa.length - 1] = 0;\n }\n ea = Nb(vc[J.X & 15]);\n pb = Nb(vc[ma.X & 15]);\n for (qa = 0; qa < 4; ++qa) {\n for (var Eb = pb[qa], pa = 0; pa < 4; ++pa) {\n var Ca = Eb + ea[pa];\n var Ka = Mc(T, wa, Ca, Aa.sc, sa, aa);\n ea[pa] = Eb = (Ka > 0) + 0;\n xa[pa] = (aa[aa[aa.length - 1] + 0] != 0) + 0;\n ua[pa] = (Ka > 1) + 0;\n aa[aa.length\n - 1] += 16;\n }\n pb[qa] = Eb;\n Ba |= ob(xa, 24 - 4 * qa);\n na |= ob(ua, 24 - 4 * qa);\n }\n ia = ob(ea, 24);\n ka = ob(pb, 24);\n ea = Nb(vc[J.X >> 4]);\n pb = Nb(vc[ma.X >> 4]);\n for (Sa = 0; Sa < 4; Sa += 2) {\n for (qa = 0; qa < 2; ++qa) {\n Eb = pb[Sa + qa];\n for (pa = 0; pa < 2; ++pa) Ca = Eb + ea[Sa + pa], Ka = Mc(T, H.R.z[2], Ca, Aa.qc, 0, aa), ea[Sa + pa] = Eb = (Ka > 0) + 0, xa[2 * qa + pa] = (aa[aa[aa.length - 1] + 0] != 0) + 0, ua[2 * qa + pa] = (Ka > 1) + 0, aa[aa.length - 1] += 16;\n pb[Sa + qa] = Eb;\n }\n Ba |= ob(xa, 8 - 2 * Sa);\n na |= ob(ua, 8 - 2 * Sa);\n }\n ia |= ob(ea, 20);\n ka |= ob(pb, 20);\n J.X = ia;\n ma.X = ka;\n H.z = aa;\n H.Oa = na + 0;\n H.ja = na | Ba;\n J.Nb = !H.ja + 0;\n }\n D = !T.Ab;\n }\n if (!D) {\n c = Y(a, 'VP8_STATUS_NOT_ENOUGH_DATA',\n `Premature end-of-file encountered.${a.i} ${a.d}`);\n break a;\n }\n const P = a;\n const da = P.Ea;\n const Ma = Tc;\n const Ua = P.Ea;\n const Va = Uc;\n const Wa = P.Ea;\n const Xa = he;\n if (P.i > 0) {\n for (var ba = ca, ba = -1; ba < 16; ++ba) Ec(da, Ma + ba * f - 4, da, Ma + ba * f + 12);\n for (ba = -1; ba < 8; ++ba) Ec(Ua, Va + ba * f - 4, Ua, Va + ba * f + 4), Ec(Wa, Xa + ba * f - 4, Wa, Xa + ba * f + 4);\n } else {\n for (ba = 0; ba < 16; ++ba) da[Ma + ba * f - 1] = 129;\n for (ba = 0; ba < 8; ++ba) Ua[Va + ba * f - 1] = 129, Wa[Xa + ba * f - 1] = 129;\n P.d > 0 && (da[Ma - 1 - f] = Ua[Va - 1 - f] = Wa[Xa - 1 - f] = 129);\n }\n const Qa = P.Xc;\n const Ra = 16 * +P.i;\n const mb = P.Sc;\n const vb = 8 * +P.i;\n const wb = P.Vc;\n const xb = 8 * +P.i;\n const Za = P.z;\n let fa = ca;\n if (P.d > 0) {\n N(da, Ma - f, Qa, Ra,\n 16), N(Ua, Va - f, mb, vb, 8), N(Wa, Xa - f, wb, xb, 8);\n } else if (P.i == 0) {\n for (i = 0; i < 21; ++i) da[Ma - f - 1 + i] = 127;\n for (i = 0; i < 9; ++i) Ua[Va - f - 1 + i] = 127;\n for (i = 0; i < 9; ++i) Wa[Xa - f - 1 + i] = 127;\n }\n if (P.wa) {\n const Ya = Ma - f + 16;\n P.d > 0 && (P.i >= P.Ma - 1 ? da[Ya + 0] = da[Ya + 1] = da[Ya + 2] = da[Ya + 3] = Qa[Ra + 15] : N(da, Ya + 0, Qa, Ra + 16, 4));\n for (let Fb = 0; Fb < 4; ++Fb) da[Fb + Ya + 4 * f] = da[Fb + Ya + 4 * f] = da[Fb + Ya + 8 * f] = da[Fb + Ya + 12 * f] = da[Fb + Ya + 0];\n for (fa = 0; fa < 16; fa++) {\n var ac = da;\n var bc = Ma + ie[fa];\n Uf[P.Eb[fa]](ac, bc);\n P.Oa & 1 << fa ? mc(Za, 16 * +fa, ac, bc, 0) : P.ja & 1 << fa && Qc(Za, 16 * +fa, ac, bc);\n }\n } else {\n var $a = Fd(P, P.Eb[0]);\n Vf[$a](da, Ma);\n if (P.ja) for (fa = 0; fa < 16; fa++) ac = da, bc = Ma + ie[fa], P.Oa & 1 << fa ? mc(Za, 16 * +fa, ac, bc, 0) : P.ja & 1 << fa && Qc(Za, 16 * +fa, ac, bc);\n }\n $a = Fd(P, P.Tc);\n je[$a](Ua, Va);\n je[$a](Wa, Xa);\n if (P.ja & 983040) {\n const zb = P.z;\n var Pa = 256;\n P.Oa & 983040 ? Pc(zb, Pa, Ua, Va) : Rc(zb, Pa, Ua, Va);\n }\n if (P.ja & 15728640) {\n const Ab = P.z;\n var Pa = 320;\n P.Oa & 15728640 ? Pc(Ab, Pa, Wa, Xa) : Rc(Ab, Pa, Wa, Xa);\n }\n P.d < P.hb - 1 && (N(Qa, Ra, da, Ma + 15 * f, 16), N(mb, vb, Ua, Va + 7 * f, 8), N(wb, xb, Wa, Xa + 7 * f, 8));\n const Q = a;\n if (Q.A > 0) {\n const kb = Q.M[1 + Q.i];\n const Kb = Q.La[1 + Q.i].Nb;\n let ha = Q.Zb[Q.Lb];\n Q.ga.oc && (ha\n += Q.ga.Lc[0], Q.wa && (ha += Q.ga.Gc[0]));\n ha = ha < 0 ? 0 : ha > 63 ? 63 : ha;\n kb.zc = ha;\n Q.ga.kb > 0 && (ha = Q.ga.kb > 4 ? ha >> 2 : ha >> 1, ha > 9 - Q.ga.kb && (ha = 9 - Q.ga.kb));\n kb.yc = ha < 1 ? 1 : ha;\n kb.ab = (!Kb || Q.wa) + 0;\n }\n for (var Ia = ca, Bb = 8 * Q.Ja * Q.r, Qb = Q.ca, Ub = Q.da + 16 * Q.i + 16 * Q.Ja * Q.H, Wb = Q.aa, Xb = Q.ba + 8 * Q.i + Bb, Yb = Q.ra, Zb = Q.sa + 8 * Q.i + Bb, Ia = 0; Ia < 16; ++Ia) N(Qb, Ub + Ia * Q.H, Q.Ea, +Tc + Ia * f, 16);\n for (Ia = 0; Ia < 8; ++Ia) N(Wb, Xb + Ia * Q.r, Q.Ea, +Uc + Ia * f, 8), N(Yb, Zb + Ia * Q.r, Q.Ea, +he + Ia * f, 8);\n }\n const K = a;\n const I = b;\n var cc = 1;\n const eb = K.oa;\n if (K.qb) {\n const nb = K.rc;\n var cc = cc & WebPWorkerSync(nb);\n $(nb.a == OK);\n if (cc) {\n eb.N = I;\n eb.ha = K.Ja;\n eb.d = K.d;\n eb.W = K.W;\n if (eb.W) {\n const hc = eb.M;\n eb.M = K.M;\n K.M = hc;\n }\n WebPWorkerLaunch(nb);\n ++K.Ja == K.jb && (K.Ja = 0);\n }\n } else {\n eb.d = K.d;\n eb.W = K.W;\n b: {\n let Hb = 1;\n const rb = K.oa;\n const ib = uc[K.A];\n const yb = ib * K.H;\n const dc = parseInt(ib / 2) * K.r;\n const Ib = 16 * rb.ha * K.H;\n const jb = 8 * rb.ha * K.r;\n const Jb = K.ca;\n const Lb = K.da - yb + Ib;\n const Ob = K.aa;\n const Pb = K.ba - dc + jb;\n const Rb = K.ra;\n const Sb = K.sa - dc + jb;\n const jc = rb.d == 0;\n const Tb = (rb.d >= K.hb - 1) + 0;\n var ra = 16 * rb.d;\n let fb = 16 * (rb.d + 1);\n if (rb.W) {\n const pc = K;\n let wc = s;\n const kc = pc.oa.d;\n $(pc.oa.W);\n for (wc = pc.lb; wc < pc.wb; ++wc) {\n const Na = pc;\n const ec = wc;\n const Vb = kc;\n const xc = Na.oa;\n const gb = Na.H;\n const fc = xc.M[1 + ec];\n const sb = Na.ca;\n const tb = Na.da + 16 * xc.ha\n * gb + 16 * ec;\n const Gb = fc.zc;\n const hb = fc.yc;\n const Ja = 2 * Gb + hb;\n if (Gb != 0) {\n if (Na.A == 1) ec > 0 && ae(sb, tb, gb, Ja + 4), fc.ab && ce(sb, tb, gb, Ja), Vb > 0 && $d(sb, tb, gb, Ja + 4), fc.ab && be(sb, tb, gb, Ja);\n else {\n const gc = Na.r;\n const yc = Na.aa;\n const zc = Na.ba + 8 * xc.ha * gc + 8 * ec;\n const Ac = Na.ra;\n const Bc = Na.sa + 8 * xc.ha * gc + 8 * ec;\n const ub = Na.Ac.fb ? Gb >= 40 ? 2 : Gb >= 15 ? 1 : 0 : Gb >= 40 ? 3 : Gb >= 20 ? 2 : Gb >= 15 ? 1 : 0;\n ec > 0 && (Td(sb, tb, gb, Ja + 4, hb, ub), Vd(yc, zc, Ac, Bc, gc, Ja + 4, hb, ub));\n fc.ab && (Xd(sb, tb, gb, Ja, hb, ub), Zd(yc, zc, Ac, Bc, gc, Ja, hb, ub));\n Vb > 0 && (Sd(sb, tb, gb, Ja + 4, hb, ub), Ud(yc, zc, Ac, Bc, gc, Ja + 4, hb, ub));\n fc.ab && (Wd(sb, tb, gb,\n Ja, hb, ub), Yd(yc, zc, Ac, Bc, gc, Ja, hb, ub));\n }\n }\n }\n }\n if (I.put) {\n jc ? (I.y = K.ca, I.D = K.da + Ib, I.c = K.aa, I.B = K.ba + jb, I.S = K.ra, I.C = K.sa + jb) : (ra -= ib, I.y = Jb, I.D = Lb, I.c = Ob, I.B = Pb, I.S = Rb, I.C = Sb);\n Tb || (fb -= ib);\n fb > I.K && (fb = I.K);\n if (K.Ga != p && ra < fb && (ra == 0 ? (I.p = qd(K, ra, fb - ra), I.q = 0) : I.q = qd(K, ra, fb - ra), I.p == p)) {\n cc = Y(K, W, 'Could not decode alpha data.');\n break b;\n }\n if (ra < I.k) {\n const qc = I.k - ra;\n var ra = I.k;\n $(!(qc & 1));\n I.D += K.H * qc;\n I.B += K.r * (qc >> 1);\n I.C += K.r * (qc >> 1);\n I.p != p && (I.q += I.width * qc);\n }\n ra < fb && (I.D += I.t, I.B += I.t >> 1, I.C += I.t >> 1, I.p != p && (I.q += I.t),\n I.w = ra - I.k, I.m = I.Ka - I.t, I.h = fb - ra, Hb = I.put(I));\n }\n rb.ha + 1 == K.jb && !Tb && (N(K.ca, K.da - yb, Jb, Lb + 16 * K.H, yb), N(K.aa, K.ba - dc, Ob, Pb + 8 * K.r, dc), N(K.ra, K.sa - dc, Rb, Sb + 8 * K.r, dc));\n cc = Hb;\n }\n }\n if (!cc) {\n c = Y(a, 'VP8_STATUS_USER_ABORT', 'Output aborted.');\n break a;\n }\n }\n let Cb;\n if (!(Cb = a.qb && !WebPWorkerSync(a.rc))) {\n let Db;\n if (Db = a.fc > 0) $(a), $(a.fc > 0), Db = !1;\n Cb = Db;\n }\n c = Cb ? 0 : 1;\n }\n }\n const lc = c;\n b.Pb && b.Pb(b);\n c = lc & 1;\n }\n if (!c) return ke(a), 0;\n a.za = 0;\n return c;\n }\n\n function ke(a) {\n a != p && (a.ib && (a.ib = 0), a.ib = p, a.Gb = 0, a.za = 0);\n }\n\n function Aa(a, b) {\n return a + (1 << b) - 1 >> b;\n }\n\n function hc(a, b, c, d, e) {\n const g = vb[c] + wb[b] >> ea;\n b = xb[b];\n d[e + 0] = ia[a + Za[c] - J];\n d[e + 1] = ia[a + g - J];\n d[e + 2] = ia[a + b - J];\n }\n\n function le(a, b, c, d, e) {\n const g = vb[c] + wb[b] >> ea;\n b = xb[b];\n d[e + 0] = ia[a + Za[c] - J] & 248 | ia[a + g - J] >> 5;\n d[e + 1] = ia[a + g - J] << 3 & 224 | ia[a + b - J] >> 3;\n }\n\n function me(a, b, c, d, e) {\n d[e + 0] = 255;\n hc(a, b, c, d, e + 1);\n }\n\n function ne(a, b, c, d, e) {\n const g = xb[b];\n d[e + 0] = Hb[a + Za[c] - J] << 4 | Hb[a + (vb[c] + wb[b] >> ea) - J];\n d[e + 1] = 15 | Hb[a + g - J] << 4;\n }\n\n function Vc(a, b, c, d, e) {\n const g = Za[c];\n c = vb[c] + wb[b] >> ea;\n d[e + 0] = ia[a + xb[b] - J];\n d[e + 1] = ia[a + c - J];\n d[e + 2] = ia[a + g - J];\n }\n\n function oe(a, b, c, d, e) {\n Vc(a, b, c, d, e);\n d[e + 3] = 255;\n }\n\n function pe(a, b, c, d, e) {\n hc(a, b, c, d, e);\n d[e + 3] = 255;\n }\n\n function ib(a, b, c) {\n a[b] = ((((a[b] & 4278255360) >>> 0) + ((c & 4278255360) >>> 0) & 4278255360) >>> 0 | (a[b] & 16711935) + (c & 16711935) & 16711935) >>> 0;\n }\n\n function ka(a, b) {\n return (((a ^ b) & 4278124286) >>> 1) + ((a & b) >>> 0) >>> 0;\n }\n\n function $a(a) {\n return a < 256 && a > 0 ? a : a <= 0 ? 0 : ~a >> 24 & 255;\n }\n\n function yb(a, b) {\n return $a(a + parseInt((a - b) / 2, 10));\n }\n\n function Wc() {\n return qe;\n }\n\n function Xc(a, b) {\n a &= 255;\n b &= 255;\n a > 127 && (a -= 256);\n b > 127 && (b -= 256);\n return a * b >>> 5;\n }\n\n function re(a,\n b, c, d, e, g, k) {\n var h = s;\n const n = 8 >> a.n;\n const l = a.U;\n const f = a.u;\n if (n < 8) {\n a = (1 << a.n) - 1;\n for (var t = (1 << n) - 1, h = b; h < c; ++h) {\n b = 0;\n for (var q = s, q = 0; q < l; ++q) (q & a) == 0 && (b = d[e++] >> 8 & 255), g[k++] = f[b & t], b >>= n;\n }\n } else for (h = b; h < c; ++h) for (q = 0; q < l; ++q) g[k++] = f[d[e++] >> 8 & 255];\n }\n\n function se(a, b, c, d, e) {\n for (c = b + c; b < c;) {\n const g = a[b++];\n d[e++] = g >> 16 & 255;\n d[e++] = g >> 8 & 255;\n d[e++] = g >> 0 & 255;\n d[e++] = g >> 24 & 255;\n }\n }\n\n function te(a, b, c, d, e) {\n for (c = b + c; b < c;) {\n const g = a[b++];\n d[e++] = g >> 16 & 240 | g >> 12 & 15;\n d[e++] = g >> 0 & 240 | g >> 28 & 15;\n }\n }\n\n function Ib(a, b, c, d, e) {\n for (c = b + c; b < c;) {\n const g = a[b++];\n d[e++] = g >> 24 & 255;\n d[e++] = g >> 16 & 255;\n d[e++] = g >> 8 & 255;\n d[e++] = g >> 0 & 255;\n }\n }\n\n function ue(a, b, c, d) {\n if (T(a, 8) != ve) return 0;\n b[0] = T(a, we) + 1;\n c[0] = T(a, we) + 1;\n d[0] = T(a, 1);\n T(a, Wf);\n return 1;\n }\n\n function xe(a, b) {\n let c = s;\n if (a < 4) return a + 1;\n c = a - 2 >> 1;\n return (2 + (a & 1) << c) + T(b, c) + 1;\n }\n\n function Oa(a, b) {\n if (b.Q + 8 > b.ya) {\n var c = a.Y;\n var d = 0;\n for ($(c != p); c[d].s != 0;) {\n var e = c;\n var g = b;\n const k = g.T >> g.g & 1;\n g.L ? g.fa = 1 : (++g.g, g.g >= 8 && Sb(g), g.Q == g.ya && g.g == 32 && (g.L = 1));\n d = d + e[d].s + k;\n }\n return c[d].kc;\n }\n c = a.Y;\n d = 0;\n for ($(c != p); c[d].s != 0;) {\n e = c, g = b.T >> b.g & 1, ++b.g, d = d\n + e[d].s + g;\n }\n return c[d].kc;\n }\n\n function zb(a, b) {\n if (a != p) for (var c = s, d = s, c = 0; c < b; ++c) for (var e = a[c].va, d = 0; d < Yc; ++d) ja(e[d]);\n }\n\n function ye(a, b, c) {\n b = a.eb == 0 ? 0 : a.ac[a.bd + a.Ec * (c >> a.eb) + (b >> a.eb)];\n $(b < a.hc);\n return a.Db[+b];\n }\n\n function ze(a, b, c, d) {\n let e = a.Na;\n const g = a.O;\n const k = g + b;\n var h = c;\n var f = d;\n d = a.Xa;\n c = a.vb;\n for (N(d, c, h, f, a.l * b); e-- > 0;) {\n b = a.nc[e];\n let l = g;\n var m = k;\n var t = h;\n var q = f;\n var f = d;\n var h = c;\n $(l < m);\n $(m <= b.Vb);\n switch (b.Qc) {\n case Ae:\n t = 0;\n for (b = h + (m - l) * b.U; h < b;) {\n var m = f;\n var q = h;\n var r = m[q] >> 8 & 255;\n var u = (m[q] & 16711935) >>> 0;\n var u = u + (r << 16 | r);\n var u = u & 16711935;\n f[h++] = ((m[q] & 4278255360)\n >>> 0 | u) >>> 0;\n l == 32 && t++;\n }\n break;\n case Be:\n var v = b;\n var C = l;\n var t = m;\n var q = f;\n var r = h;\n var u = v.U;\n if (C == 0) {\n var A = s;\n ib(q, r, qe);\n for (A = 1; A < u; ++A) ib(q, r + A, q[r + A - 1]);\n r += u;\n ++C;\n }\n for (var z = (1 << v.n) - 1, Ha = Aa(u, v.n), w = v.u, v = +(C >> v.n) * Ha; C < t;) {\n var y = w;\n var B = v;\n let G = p;\n ib(q, r, q[r - u + 0]);\n G = Ce[y[B++] >> 8 & 15];\n for (A = 1; A < u; ++A) {\n let F = E;\n (A & z) == 0 && (G = Ce[y[B++] >> 8 & 15]);\n F = G(q[r + A - 1], q, r + A - u);\n ib(q, r + A, F);\n }\n r += u;\n ++C;\n (C & z) == 0 && (v += Ha);\n }\n m != b.Vb && (b = b.U, N(f, h - b, f, h + (m - l - 1) * b, b));\n break;\n case De:\n t = b.U;\n q = (1 << b.n) - 1;\n r = Aa(t, b.n);\n u = b.u;\n for (b = +(l >> b.n) * r; l < m;) {\n A = u;\n C = b;\n z = M(Xf);\n Ha = s;\n for (Ha = 0; Ha < t; ++Ha) (Ha & q) == 0 && (w = A[C++], v = z, v.Cc = w >> 0 & 255, v.Bc = w >> 8 & 255, v.Kc = w >> 16 & 255), w = f[h + Ha], v = w >>> 8, y = w >>> 16, B = w, y += Xc(z.Cc, v), y &= 255, B += Xc(z.Bc, v), B += Xc(z.Kc, y), B &= 255, f[h + Ha] = (w & 4278255360 | y << 16 | B) >>> 0;\n h += t;\n ++l;\n (l & q) == 0 && (b += r);\n }\n break;\n case Ee:\n t == f && b.n > 0 ? (t = (m - l) * Aa(b.U, b.n), q = h + (m - l) * b.U - t, memmove(f, q, f, h, t), re(b, l, m, f, q, f, h)) : re(b, l, m, t, q, f, h);\n }\n h = d;\n f = c;\n }\n }\n\n function Yf(a, b) {\n var c = a.V;\n var d = a.Ha + a.l * a.O;\n var e = b - a.O;\n if (!(e <= 0)) {\n ze(a, e, c, d);\n var g = a.N;\n var c = a.Xa;\n let k = [a.vb];\n var d = a.O;\n var e = b;\n var h = k;\n var f = g.width;\n $(d < e);\n $(g.t < g.Ka);\n e > g.K && (e = g.K);\n if (d < g.k) {\n var l = g.k - d;\n var d = g.k;\n h[0] += f * l;\n }\n d >= e ? d = 0 : (h[0] += g.t, g.w = d - g.k, g.m = g.Ka - g.t, g.h = e - d, d = 1);\n if (d) {\n k = k[0];\n d = a.Ib;\n e = g.width;\n if (d.J < ua) {\n var m = d.c.RGBA;\n var h = m.ma;\n let t = m.Sa + a.xa * m.f;\n if (g.I) c = EmitRescaledRows(a, c, k, e, g.h, h, t, m.f);\n else {\n for (var f = d.J, l = g.m, g = g.h, m = m.f, q = g; q-- > 0;) {\n const r = c;\n let u = k;\n let v = l;\n const C = h;\n let A = t;\n switch (f) {\n case Qa:\n for (v = u + v; u < v;) {\n var z = r[u++];\n C[A++] = z >> 16 & 255;\n C[A++] = z >> 8 & 255;\n C[A++] = z >> 0 & 255;\n }\n break;\n case jb:\n se(r, u, v, C, A);\n break;\n case Ob:\n se(r, u, v, C, A);\n WebPApplyAlphaMultiply(C, 0, v,\n 1, 0);\n break;\n case Zc:\n for (v = u + v; u < v;) z = r[u++], C[A++] = z >> 0 & 255, C[A++] = z >> 8 & 255, C[A++] = z >> 16 & 255;\n break;\n case Pa:\n Ib(r, u, v, C, A);\n break;\n case Pb:\n Ib(r, u, v, C, A);\n WebPApplyAlphaMultiply(C, 0, v, 1, 0);\n break;\n case Ab:\n Ib(r, u, v, C, A);\n break;\n case Bb:\n Ib(r, u, v, C, A);\n WebPApplyAlphaMultiply(C, 1, v, 1, 0);\n break;\n case kb:\n te(r, u, v, C, A);\n break;\n case Qb:\n te(r, u, v, C, A);\n WebPApplyAlphaMultiply4444(C, v, 1, 0);\n break;\n case Fe:\n for (v = u + v; u < v;) z = r[u++], C[A++] = z >> 16 & 248 | z >> 13 & 7, C[A++] = z >> 5 & 224 | z >> 3 & 31;\n break;\n default:\n $(0);\n }\n k += e;\n t += m;\n }\n c = g;\n }\n a.xa += c;\n } else {\n a.xa = g.I ? EmitRescaledRowsYUVA(a, c, k, e, g.h) : EmitRowsYUVA(a, c, k, e, g.m, g.h);\n }\n $(a.xa <= d.height);\n }\n a.O = b;\n $(a.O <= a.v);\n }\n }\n\n function lc(a, b, c, d, e, g) {\n let k = 1;\n let h = 0;\n let f = 0;\n const l = a.o;\n const m = a.cb;\n let t = m.Db;\n let q = c;\n let r = c;\n c += d * e;\n e = Ba + Ge;\n const u = e + m.xb;\n const v = m.xb > 0 ? m.Yb : p;\n const C = m.Dc;\n let A = !1;\n $(t != p);\n for (; !l.L && q < c;) {\n let z = s;\n A || ((h & C) == 0 && (t = ye(m, h, f)), Da(l), z = Oa(t.va[Zf], l));\n if (z < Ba || A) {\n if (!A) {\n var w = k = A = s;\n var y = s;\n Da(l);\n A = Oa(t.va[$f], l);\n k = z;\n Da(l);\n w = Oa(t.va[ag], l);\n Da(l);\n y = Oa(t.va[bg], l);\n b[q] = (y << 24 >>> 0) + (A << 16) + (k << 8) + w;\n }\n A = !1;\n ++q;\n ++h;\n if (h >= d && (h = 0, ++f, g != p && f\n % $c == 0 && g(a, f), v != p)) for (; r < q;) k = b[r++], v.ea[ad * k >>> v.bb] = k;\n } else if (z < e) {\n w = w = s;\n k = xe(z - Ba, l);\n z = Oa(t.va[cg], l);\n Da(l);\n w = xe(z, l);\n w > He ? w -= He : (z = dg[w - 1], z = (z >> 4) * d + (8 - (z & 15)), w = z >= 1 ? z : 1);\n z = s;\n for (z = 0; z < k; ++z) b[q + z] = b[q + z - w];\n q += k;\n for (h += k; h >= d;) h -= d, ++f, g != p && f % $c == 0 && g(a, f);\n if (q < c && (t = ye(m, h, f), v != p)) for (; r < q;) k = b[r++], v.ea[ad * k >>> v.bb] = k;\n } else if (z < u) {\n A = z - e;\n for ($(v != p); r < q;) z = b[r++], v.ea[ad * z >>> v.bb] = z;\n z = b;\n w = q;\n y = v;\n $(A <= -1 >>> y.bb);\n z[w] = y.ea[A];\n A = !0;\n continue;\n }(k = !l.fa) || End;\n }\n g != p && g(a, f);\n l.fa || !k || l.L && q < c ? (k = 0, a.a = !l.L ? W : Ie) : q == c && (a.Ob = Db);\n return k;\n }\n\n function bd(a) {\n $(a);\n a.ac = p;\n zb(a.Db, a.hc);\n const b = a.Yb;\n b != p && (b.ea = p, b.ea = p);\n $(a);\n }\n\n function sd() {\n const a = M(eg);\n if (a == p) return p;\n a.a = L;\n a.Wa = cd;\n a.Ob = cd;\n return a;\n }\n\n function sa(a) {\n let b = s;\n if (a != p) {\n bd(a.cb);\n a.V = p;\n a.V = p;\n for (b = 0; b < a.Na; ++b) {\n const c = a.nc[b];\n c.u = p;\n c.u = p;\n }\n a.Na = 0;\n a.Ub = 0;\n a.Mc = p;\n a.Mc = p;\n a.Ib = p;\n }\n }\n\n function Ka(a, b, c, d, e) {\n var g = 1;\n a = [a];\n b = [b];\n for (var k = d.o, h = d.cb, f = p, l = p, l = 0; ;) {\n if (c) {\n for (; g && T(k, 1);) {\n var m = a;\n var t = b;\n var q = d;\n var r = 1;\n var u = q.o;\n var g = q.nc[q.Na];\n var v = T(u, 2);\n if (q.Ub & 1 << v) g = 0;\n else {\n q.Ub\n |= 1 << v;\n g.Qc = v;\n g.U = m[0];\n g.Vb = t[0];\n g.u = [p];\n g.b = 0;\n ++q.Na;\n $(q.Na <= Je);\n switch (v) {\n case Be:\n case De:\n g.n = T(u, 3) + 2;\n r = Ka(Aa(g.U, g.n), Aa(g.Vb, g.n), 0, q, g.u);\n break;\n case Ee:\n t = T(u, 8) + 1;\n r = t > 16 ? 0 : t > 4 ? 1 : t > 2 ? 2 : 3;\n m[0] = Aa(g.U, r);\n g.n = r;\n if (m = r = Ka(t, 1, 0, q, g.u)) {\n if (m = t, q = g, r = s, t = 1 << (8 >>> q.n) >>> 0, u = Array(t), u == p) m = 0;\n else {\n var v = q.u[0];\n var C = q.b;\n u[0] = q.u[0][q.b + 0];\n for (r = 1; r < m; ++r) u[r] = ((((v[C + r] & 4278255360) >>> 0) + ((u[r - 1] & 4278255360) >>> 0) & 4278255360) >>> 0 | (v[C + r] & 16711935) + (u[r - 1] & 16711935) & 16711935) >>> 0;\n for (; r < t; ++r) u[r] = 0;\n q.u[0] = p;\n q.b = p;\n q.u[0] = u;\n q.b = 0;\n m = 1;\n }\n }\n r = m;\n break;\n case Ae:\n break;\n default:\n $(0);\n }\n g.u = g.u[0];\n g = r;\n }\n }\n }\n if (g && T(k, 1) && (l = T(k, 4), g = l >= 1 && l <= fg, !g)) {\n d.a = W;\n break;\n }\n if (g) {\n a: {\n var g = d;\n var A = a[0];\n var z = b[0];\n var m = l;\n var C = v = s;\n var C = g.o;\n var q = g.cb;\n var r = [p];\n var t = p;\n var u = 1;\n if (c && T(C, 1)) {\n var v = T(C, 3) + 2;\n var A = Aa(A, v);\n var w = Aa(z, v);\n var z = A * w;\n if (!Ka(A, w, 0, g, r)) {\n g.a = W;\n zb(t, u);\n g = 0;\n break a;\n }\n r = r[0];\n q.eb = v;\n for (v = 0; v < z; ++v) A = r[v] >>> 8 & 65535, r[v] = A, A >= u && (u = A + 1);\n }\n if (C.fa) zb(t, u), g = 0;\n else if ($(u <= 65536), t = ld(u, gg), t == p) g.a = cb, zb(t, u), g = 0;\n else {\n for (v = 0; v < u; ++v) {\n z = t[v].va;\n for (C = 0; C < Yc; ++C) {\n A = hg[C];\n C == 0 && m > 0 && (A += 1 << m);\n b: {\n const y = A;\n var A = g;\n const G = z[+C];\n var B = 0;\n var w = A.o;\n if (T(w, 1)) {\n var F = Array(2);\n var D = Array(2);\n var L = Array(2);\n var B = T(w, 1) + 1;\n var J = T(w, 1);\n F[0] = T(w, J == 0 ? 1 : 8);\n D[0] = 0;\n L[0] = B - 1;\n B == 2 && (F[1] = T(w, 8), D[1] = 1, L[1] = B - 1);\n c: {\n var J = 0;\n var H = s;\n $(G != p);\n $(L != p);\n $(D != p);\n $(F != p);\n if (nd(G, B)) {\n for (H = 0; H < B; ++H) {\n if (D[H] != pd) {\n if (F[H] < 0 || F[H] >= y) {\n (J = J && ma(G)) || ja(G);\n B = J;\n break c;\n }\n if (!jc(G, F[H], D[H], L[H])) {\n (J = J && ma(G)) || ja(G);\n B = J;\n break c;\n }\n }\n }(J = (J = 1) && ma(G)) || ja(G);\n B = J;\n } else B = 0;\n }\n } else {\n B = s;\n D = [];\n F = T(w, 4) + 4;\n if (F > Ke) {\n A.a = W;\n A = 0;\n break b;\n }\n L = Array(y);\n if (L == p) {\n A.a = cb;\n A = 0;\n break b;\n }\n for (B = 0; B < F; ++B) D[ig[B]] = T(w, 3);\n c: {\n var B = A;\n var O = D;\n var D = y;\n var F = L;\n var J = 0;\n var H = B.o;\n let S = s;\n let V = s;\n let Y = jg;\n const Z = M(Le);\n if (od(Z, O, Ke)) {\n if (T(H, 1)) {\n if (S = 2 + 2 * T(H, 3), V = 2 + T(H, S), V > D) {\n B.a = W;\n ja(Z);\n B = J;\n break c;\n }\n } else V = D;\n for (S = 0; S < D;) {\n var R = s;\n if (V-- == 0) break;\n Da(H);\n R = Oa(Z, H);\n if (R < Me) F[S++] = R, R != 0 && (Y = R);\n else {\n var O = R == kg;\n var R = R - Me;\n const ea = lg[R];\n var R = T(H, mg[R]) + ea;\n if (S + R > D) {\n B.a = W;\n ja(Z);\n B = J;\n break c;\n }\n for (O = O ? Y : 0; R-- > 0;) F[S++] = O;\n }\n }\n J = 1;\n ja(Z);\n B = J;\n } else B.a = W, B = 0;\n }\n B && (B = od(G, L, y));\n }(B = B && !w.fa) ? A = 1 : (A.a = W, A = 0);\n }\n if (!A) {\n zb(t, u);\n g = 0;\n break a;\n }\n }\n }\n q.ac = r;\n q.hc = u;\n q.Db = t;\n g = 1;\n }\n }\n }\n if (!g) {\n d.a = W;\n break;\n }\n if (l > 0) {\n if (h.xb = 1 << l, m = h.Yb, q = 1 << l, $(m != p), $(l > 0), m.ea = U(q, 0), m.ea == p ? l = 0 : (m.bb = 32 - l, l = 1), !l) {\n d.a = cb;\n g = 0;\n break;\n }\n } else h.xb = 0;\n l = d;\n m = a[0];\n q = b[0];\n r = l.cb;\n t = r.eb;\n l.l = m;\n l.v = q;\n r.Ec = Aa(m, t);\n r.Dc = t == 0 ? -1 : (1 << t) - 1;\n if (c) {\n d.Ob = Cb;\n break;\n }\n f = Array(a * b);\n l = 0;\n if (f == p) {\n d.a = cb;\n g = 0;\n break;\n }\n g = (g = lc(d, f, l, a, b, p)) && !k.fa;\n break;\n }\n g ? (e != p ? e[0] = f : ($(f == p), $(c)), c || bd(h)) : (bd(h), d.a == W && d.o.L && (d.a = Ie));\n return g;\n }\n\n function xd(a, b) {\n const c = a.l * a.v;\n const d = c + b + b * $c;\n $(a.l <= b);\n a.V = Array(d);\n a.Ha = 0;\n if (a.V == p) {\n return a.Xa = p, a.a = cb, 0;\n }\n a.Xa = a.V;\n a.vb = a.Ha + c + b;\n return 1;\n }\n\n function mf(a, b) {\n var c = b - a.O;\n var d = a.V;\n var e = a.Ha + a.l * a.O;\n if (!(c <= 0)) {\n ze(a, c, d, e);\n for (var e = a.N.width, c = e * c, d = a.N.ka, e = a.N.fd + e * a.O, g = a.Xa, k = a.vb, h = s, h = 0; h < c; ++h) d[e + h] = g[k + h] >>> 8 & 255;\n a.O = a.xa = b;\n }\n }\n\n function ng(a, b) {\n const c = [s];\n const d = [s];\n const e = [s];\n if (a == p) return 0;\n if (b == p) return a.a = ta, 0;\n a.N = b;\n a.a = L;\n Rb(a.o, b.data, b.b, b.e);\n if (!ue(a.o, c, d, e)) return a.a = W, sa(a), $(a.a != L), 0;\n a.Ob = cd;\n b.width = c[0];\n b.height = d[0];\n a.Wa = Cb;\n return !Ka(c[0], d[0], 1, a, p) ? (sa(a), $(a.a != L), 0) : 1;\n }\n\n function og(a) {\n let b = p;\n let c = p;\n if (a == p) return 0;\n b = a.N;\n $(b != p);\n c = b.ka;\n $(c != p);\n a.Ib = c.j;\n a.Hc = c.Hc;\n $(a.Ib != p);\n if (!Ne(c.Qa, b, Pa)) return a.a = ta, sa(a), $(a.a != L), 0;\n if (!xd(a, b.width) || b.I && !AllocateAndInitRescaler(a, b)) return sa(a), $(a.a != L), 0;\n a.Wa = Db;\n if (!lc(a, a.V, a.Ha, a.l, a.v, Yf)) return sa(a), $(a.a != L), 0;\n c.ec = a.xa;\n sa(a);\n return 1;\n }\n\n function wa(a, b) {\n return a < 0 ? 0 : a > b ? b : a;\n }\n\n function ab(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, C, w, z) {\n let y; const G = C - 1 >> 1;\n let F = e[g + 0] | k[h + 0] << 16;\n let B = f[l + 0] | m[t + 0] << 16;\n if (a) {\n var D = 3 * F + B + 131074 >> 2;\n w(a[b + 0], D & 255, D >> 16, q, r);\n }\n c && (D = 3 * B + F + 131074 >> 2, w(c[d + 0], D & 255, D >> 16, u, v));\n for (y = 1; y <= G; ++y) {\n const J = e[g + y] | k[h + y] << 16;\n const L = f[l + y] | m[t + y] << 16;\n var D = F + J + B + L + 524296;\n const O = D + 2 * (J + B) >> 3;\n const H = D + 2 * (F + L) >> 3;\n a && (D = O + F >> 1, F = H + J >> 1, w(a[b + 2 * y - 1], D & 255, D >> 16, q, r + (2 * y - 1) * z), w(a[b + 2 * y - 0], F & 255, F >> 16, q, r + (2 * y - 0) * z));\n c && (D = H + B >> 1, F = O + L >> 1, w(c[d + 2 * y - 1], D & 255, D >> 16, u, v + (2 * y - 1) * z), w(c[d + 2 * y + 0], F & 255, F >> 16, u, v + (2 * y + 0) * z));\n F = J;\n B = L;\n }\n C & 1 || (a && (D = 3 * F + B + 131074 >> 2, w(a[b + C - 1], D & 255, D >> 16, q, r + (C - 1) * z)), c && (D = 3 * B + F + 131074 >> 2, w(c[d + C - 1], D & 255, D >> 16, u, v + (C - 1) * z)));\n }\n\n function pg(a,\n b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w) {\n ab(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w, hc, 3);\n }\n\n function qg(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w) {\n ab(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w, Vc, 3);\n }\n\n function Oe(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w) {\n ab(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w, pe, 4);\n }\n\n function Pe(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w) {\n ab(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w, oe, 4);\n }\n\n function Qe(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w) {\n ab(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w, me, 4);\n }\n\n function Re(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w) {\n ab(a, b, c, d, e, g, k, h,\n f, l, m, t, q, r, u, v, w, ne, 2);\n }\n\n function rg(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w) {\n ab(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u, v, w, le, 2);\n }\n\n function Ca(a, b, c, d, e, g, k, h, f, l, m, t, q, r, u) {\n let v;\n for (v = 0; v < q - 1; v += 2) r(a[b + 0], e[g + 0], k[h + 0], f, l), r(a[b + 1], e[g + 0], k[h + 0], f, l + u), r(c[d + 0], e[g + 0], k[h + 0], m, t), r(c[d + 1], e[g + 0], k[h + 0], m, t + u), b += 2, d += 2, g++, h++, l += 2 * u, t += 2 * u;\n v == q - 1 && (r(a[b + 0], e[g + 0], k[h + 0], f, l), r(c[d + 0], e[g + 0], k[h + 0], m, t));\n }\n\n function Se(a, b, c, d, e, g, k, f, n, l, m, t, q) {\n Ca(a, b, c, d, e, g, k, f, n, l, m, t, q, pe, 4);\n }\n\n function Te(a, b, c, d, e, g, k, f, n, l,\n m, t, q) {\n Ca(a, b, c, d, e, g, k, f, n, l, m, t, q, oe, 4);\n }\n\n function Ue(a, b, c, d, e, g, k, f, n, l, m, t, q) {\n Ca(a, b, c, d, e, g, k, f, n, l, m, t, q, me, 4);\n }\n\n function Ve(a, b, c, d, e, g, k, f, n, l, m, t, q) {\n Ca(a, b, c, d, e, g, k, f, n, l, m, t, q, ne, 2);\n }\n\n function sg(a, b, c, d, e, g) {\n for (; e-- > 0;) {\n for (var k = a, f = b + (c ? 1 : 0), n = a, l = b + (c ? 0 : 3), m = s, m = 0; m < d; ++m) {\n var t = n[l + 4 * m];\n if (t != 255) {\n var t = 32897 * t;\n let q = k;\n let r = f + 4 * m + 0;\n k[f + 4 * m + 0] * t >>> 23;\n q[r] = ca;\n q = k;\n r = f + 4 * m + 1;\n k[f + 4 * m + 1] * t >>> 23;\n q[r] = ca;\n q = k;\n r = f + 4 * m + 2;\n k[f + 4 * m + 2] * t >>> 23;\n q[r] = ca;\n }\n }\n b += g;\n }\n }\n\n function tg(a, b) {\n const c = b.j.c.Va;\n const d = c.y;\n const e = c.D + a.w * c.F;\n const g = c.c;\n const k = c.B + (a.w >> 1) * c.nb;\n const f = c.S;\n const n = c.C + (a.w >> 1) * c.rb;\n const l = a.m;\n const m = a.h;\n const t = parseInt((l + 1) / 2, 10);\n const q = parseInt((m + 1) / 2, 10);\n let r;\n for (r = 0; r < m; ++r) N(d, e + r * c.F, a.y, a.D + r * a.F, l);\n for (r = 0; r < q; ++r) N(g, k + r * c.nb, a.c, a.B + r * a.Da, t), N(f, n + r * c.rb, a.S, a.C + r * a.Da, t);\n return a.h;\n }\n\n function ug(a, b) {\n var c = b.j;\n const d = c.c.RGBA;\n const e = d.ma;\n let g = d.Sa + a.w * d.f;\n const k = a.y;\n let f = a.D;\n const n = a.c;\n let l = a.B;\n const m = a.S;\n let t = a.C;\n var c = vg[c.J];\n const q = a.m;\n const r = a.h - 1;\n let u;\n for (u = 0; u < r; u += 2) c(k, f, k, f + a.F, n, l, m, t, e, g, e, g + d.f, q), f += 2 * a.F, l += a.Da, t += a.Da, g += 2 * d.f;\n u == r && c(k, f, k, f, n, l, m, t, e, g, e, g, q);\n return a.h;\n }\n\n function wg(a, b) {\n let c = a.h;\n const d = b.j.c.RGBA;\n const e = d.ma;\n let g = d.Sa + a.w * d.f;\n const k = V[b.j.J];\n const f = a.y;\n let n = a.D;\n const l = a.c;\n let m = a.B;\n const t = a.S;\n let q = a.C;\n let r = b.Qb;\n let u = b.Rb;\n let v = b.lc;\n let w = b.mc;\n let A = a.w;\n const z = a.w + a.h;\n const y = a.m;\n const D = parseInt((y + 1) / 2, 10);\n A == 0 ? k(p, p, f, n, l, m, t, q, l, m, t, q, p, p, e, g, y) : (k(b.Sb, b.Tb, f, n, r, u, v, w, l, m, t, q, e, g - d.f, e, g, y), ++c);\n for (; A + 2 < z; A += 2) r = l, u = m, v = t, w = q, m += a.Da, q += a.Da, g += 2 * d.f, n += 2 * a.F, k(f, n - a.F, f, n, r, u, v, w, l, m, t, q, e, g - d.f, e, g, y);\n n += a.F;\n a.k + z < a.K ? (N(b.Sb, b.Tb, f, n, 1 * y), N(b.Qb, b.Rb, l, m, 1 * D), N(b.lc, b.mc, t, q, 1 * D), c--) : z & 1 || k(f, n, p, p, l, m, t, q, l, m,\n t, q, e, g + d.f, p, p, y);\n return c;\n }\n\n function xg(a, b) {\n var c = a.p;\n var d = a.q;\n const e = b.j.c.Va;\n const g = a.m;\n const f = a.h;\n const h = e.p;\n let n = e.q + a.w * e.Fa;\n var c = a.p;\n var d = a.q;\n let l = s;\n if (c != p) for (l = 0; l < f; ++l) N(h, n, c, d, 1 * g), d += a.width, n += e.Fa;\n else if (e.p != p) for (l = 0; l < f; ++l) jd(h, n, 255, g), n += e.Fa;\n return 0;\n }\n\n function We(a, b, c) {\n let d = a.w;\n c[0] = a.h;\n a.Bb && (d == 0 ? --c[0] : (--d, b[0] -= a.width), a.k + a.w + a.h == a.K && (c[0] = a.K - a.k - d));\n return d;\n }\n\n function yg(a, b) {\n const c = a.p;\n var d = [a.q];\n if (c != p) {\n for (var e = a.m, g = b.j.J, f = g == Ab || g == Bb, h = b.j.c.RGBA, n = [s], l = We(a, d, n), d = d[0], m = h.ma, l = h.Sa + l * h.f,\n t = l + (f ? 0 : 3), q = 255, r = s, u = s, u = 0; u < n[0]; ++u) {\n for (r = 0; r < e; ++r) {\n const v = c[d + r];\n m[t + 4 * r] = v;\n q &= v;\n }\n d += a.width;\n t += h.f;\n }\n q != 255 && F(g) && WebPApplyAlphaMultiply(m, l, f, e, n, h.f);\n }\n return 0;\n }\n\n function zg(a, b) {\n const c = a.p;\n var d = [a.q];\n if (c != p) {\n const e = a.m;\n const g = b.j.J;\n const f = b.j.c.RGBA;\n const h = [s];\n var n = We(a, d, h);\n var d = d[0];\n const l = f.ma;\n var n = f.Sa + n * f.f;\n let m = n + 1;\n let t = 15;\n let q = s;\n for (j = 0; j < h[0]; ++j) {\n for (q = 0; q < e; ++q) {\n const r = c[d + q] >> 4;\n l[m + 2 * q] = l[m + 2 * q] & 240 | r;\n t &= r;\n }\n d += a.width;\n m += f.f;\n }\n t != 15 && F(g) && WebPApplyAlphaMultiply4444(l, n, e, h, f.f);\n }\n return 0;\n }\n\n function vd(a) {\n let b = a.ka;\n const c = b.j.J;\n const d = c\n < ua;\n const e = c == jb || c == Pa || c == Ab || c == kb || c == Ra || F(c);\n b.memory = p;\n b.$a = p;\n b.zb = p;\n b.ad = p;\n if (!Ne(b.Qa, a, e ? ua : Ra)) return 0;\n if (a.I) {\n if (!(d ? InitRGBRescaler(a, b) : InitYUVRescaler(a, b))) return alert('memory error #1'), 0;\n } else {\n if (d) {\n if (b.$a = ug, a.Bb) {\n const g = a.m + 1 >> 1;\n const f = a.m + 2 * g;\n let h; const\n n = [];\n for (h = 0; h < f; ++h) n.push(205);\n n.push(0);\n b.memory = n;\n if (b.memory == p) return alert('memory error #2'), 0;\n b.Sb = b.memory;\n b.Tb = 0;\n b.Qb = b.Sb;\n b.Rb = b.Tb + a.m;\n b.lc = b.Qb;\n b.mc = b.Rb + g;\n b.$a = wg;\n V[Qa] = pg;\n V[jb] = Oe;\n V[Zc] = qg;\n V[Pa] = Pe;\n V[Ab] = Qe;\n V[kb] = Re;\n V[Fe] = rg;\n }\n } else {\n b.$a = tg;\n }\n e && (F(c) && (WebPApplyAlphaMultiply = sg, V[Ob] = Oe, V[Pb] = Pe, V[Bb] = Qe, V[Qb] = Re), b.zb = c == kb || c == Qb ? zg : d ? yg : xg);\n }\n if (d && !Xe) {\n for (a = 0; a < 256; ++a) Za[a] = 89858 * (a - 128) + Jb >> ea, wb[a] = -22014 * (a - 128) + Jb, vb[a] = -45773 * (a - 128), xb[a] = 113618 * (a - 128) + Jb >> ea;\n for (a = J; a < dd; ++a) b = 76283 * (a - 16) + Jb >> ea, ia[a - J] = wa(b, 255), Hb[a - J] = wa(b + 8 >> 4, 15);\n Xe = 1;\n }\n return 1;\n }\n\n function ud(a) {\n const b = a.ka;\n let c = a.m;\n const d = a.h;\n $(!(a.w & 1));\n if (c <= 0 || d <= 0) return 0;\n c = b.$a(a, b);\n b.ec += c;\n b.zb && b.zb(a, b);\n return 1;\n }\n\n function wd(a) {\n a = a.ka;\n a.memory = '';\n a.memory = p;\n }\n\n function ed(a,\n b) {\n return a[b + 0] | a[b + 1] << 8 | a[b + 2] << 16;\n }\n\n function Kb(a, b) {\n return (ed(a, b) | a[b + 3] << 24) >>> 0;\n }\n\n function Ye(a, b, c, d, e, g, f) {\n var h = 0;\n var n = [0];\n var l = 'VP8StatusCode';\n const m = M(Gc);\n if (a == p || c[0] < Lb) return Z;\n m.data = a;\n m.b = [b[0]];\n m.e = [c[0]];\n m.na = [m.na];\n a: {\n h = m.na;\n $(a != p);\n $(c != p);\n $(h != p);\n h[0] = 0;\n if (c[0] >= Lb && !kd(a, b[0], 'RIFF', O)) {\n if (kd(a, b[0] + 8, 'WEBP', O)) {\n l = W;\n break a;\n }\n var t = Kb(a, b[0] + O);\n if (t < O + R) {\n l = W;\n break a;\n }\n h[0] = t;\n b[0] += Lb;\n c[0] -= Lb;\n } else h[0] = 0;\n l = L;\n }\n m.na = m.na[0];\n if (l != L) return l;\n h = m.na > 0;\n t = [0];\n a: if (l = R + fd, $(a != p), $(c != p), $(n != p), n[0] = 0, c[0] < R) l = Z;\n else {\n if (!kd(a, b[0], 'VP8X', O)) {\n var q = s;\n var r = s;\n var u = E;\n if (Kb(a, b[0] + O) != fd) {\n l = W;\n break a;\n }\n if (c[0] < l) {\n l = Z;\n break a;\n }\n u = Kb(a, b[0] + 8);\n q = 1 + ed(a, b[0] + 12);\n r = 1 + ed(a, b[0] + 15);\n if (q * r >= Ag) {\n l = W;\n break a;\n }\n t != p && (t[0] = u);\n d != p && (d[0] = q);\n e != p && (e[0] = r);\n b[0] += l;\n c[0] -= l;\n n[0] = 1;\n }\n l = L;\n }\n if (l != L) return l;\n if (!h && n[0]) return W;\n g != p && (g[0] = !!(t[0] & Bg));\n if (n && f == p) return L;\n if (c < O) return Z;\n if (h && n[0] || !h && !n[0] && !kd(a, b[0], 'ALPH', O)) {\n m.$ = [m.$];\n m.G = [m.G];\n m.pa = [m.pa];\n a: {\n var n = m.na;\n var h = m.$;\n var t = m.G;\n var l = m.pa;\n var q = x;\n var r = 0;\n var u = Mb;\n let v = O + R + fd;\n $(a != p);\n $(c != p);\n q = a;\n r = b[0];\n u = c[0];\n $(h != p);\n $(l != p);\n h[0] = p;\n t[0] = p;\n for (l[0] = 0; ;) {\n let w = E;\n let y = E;\n b[0] = r;\n c[0] = u;\n if (u < R) {\n l = Z;\n break a;\n }\n w = Kb(q, r + O);\n y = R + w + 1 & -2;\n v += y;\n if (n > 0 && v > n) {\n l = W;\n break a;\n }\n if (u < y) {\n l = Z;\n break a;\n }\n if (kd(q, r, 'ALPH', O)) {\n if (!kd(q, r, 'VP8 ', O) || !kd(q, 'VP8L', O)) {\n l = L;\n break a;\n }\n } else h[0] = q, t[0] = r + R, l[0] = w;\n r += y;\n u -= y;\n }\n l = ca;\n }\n m.$ = m.$[0];\n m.G = m.G[0];\n m.pa = m.pa[0];\n if (l != L) return l;\n }\n m.ta = [m.ta];\n m.ia = [m.ia];\n a: if (n = m.na, h = m.ta, t = m.ia, r = !kd(a, b[0], 'VP8 ', O), l = !kd(a, b[0], 'VP8L', O), q = O + R, $(a != p), $(c != p), $(h != p), $(t != p), c[0] < R) l = Z;\n else {\n if (r || l) {\n r = Kb(a, b[0] + O);\n if (n >= q && r > n - q) {\n l = W;\n break a;\n }\n h[0] = r;\n b[0] += R;\n c[0] -= R;\n t[0] = l;\n } else t[0] = c >= 1 && a[b + 0] == ve, h[0] = c[0];\n l = L;\n }\n m.ta = m.ta[0];\n m.ia = m.ia[0];\n if (l != L) return l;\n if (m.ta > Ze) return W;\n if (m.ia) {\n if (c[0] < $e) return Z;\n n = b[0];\n h = c[0];\n d = d ? d[0] : p;\n e = e ? e[0] : p;\n t = g ? g[0] : p;\n a == p || h < $e ? a = 0 : (l = [s], q = [s], r = [s], u = M(af), Rb(u, a, n, h), ue(u, l, q, r) ? (d != p && (d[0] = l[0]), e != p && (e[0] = q[0]), t != p && (t[0] = r[0]), a = 1) : a = 0);\n } else {\n if (c < bf) return Z;\n n = b[0];\n h = c[0];\n d = d ? d[0] : p;\n e = e ? e[0] : p;\n !(a == p || h < bf) && h - 3 >= 3 && a[n + 3 + 0] == 157 && a[n\n + 3 + 1] == 1 && a[n + 3 + 2] == 42 ? (h = a[n + 0] | a[n + 1] << 8 | a[n + 2] << 16, t = (a[n + 7] << 8 | a[n + 6]) & 16383, a = (a[n + 9] << 8 | a[n + 8]) & 16383, !(!(h & 1) + 0) || (h >> 1 & 7) > 3 || !(h >> 4 & 1) || h >> 5 >= m.ta ? a = 0 : (d && (d[0] = t), e && (e[0] = a), a = 1)) : a = 0;\n }\n if (!a) return W;\n g != p && (g[0] |= m.$ != p);\n f != p && (f[0] = m, f[0].offset = b[0] - f[0].b, $(b[0] - f[0].b < Ze), $(f[0].offset == f[0].e - c[0]));\n return L;\n }\n\n function Kd(a) {\n $(a != p);\n return Ye(a[0].data, a[0].b, a[0].e, p, p, p, a);\n }\n\n function cf(a, b, c, d) {\n let e = 'VP8StatusCode';\n const g = M(Vb);\n let f = M(Gc);\n f.data = a;\n f.b = b;\n f.e = c;\n f.b = [f.b];\n f.e = [f.e];\n f = [f];\n e = Kd(f);\n if (e\n != L) return e;\n f = f[0];\n f.b = f.b[0];\n f.e = f.e[0];\n $(d != p);\n td(na);\n g.data = f.data;\n g.b = b + f.offset;\n g.e = f.e - f.offset;\n g.put = ud;\n g.Mb = vd;\n g.Pb = wd;\n g.ka = d;\n if (f.ia) {\n a = sd();\n if (a == p) return cb;\n ng(a, g) ? (e = zd(g.width, g.height, d.Qa, d.j), e == L && !og(a) && (e = a.a)) : e = a.a;\n a != p && sa(a);\n } else {\n e = M(Cg);\n e != p && (Gd(e), e.za = 0, e.Hb = 1);\n a = e;\n if (a == p) return cb;\n a.qb = 0;\n a.Ga = f.$;\n a.G = f.G;\n a.ub = f.pa;\n Hd(a, g) ? (e = zd(g.width, g.height, d.Qa, d.j), e == L && !Mf(a, g) && (e = a.a)) : e = a.a;\n a != p && ke(a);\n }\n e != L && (self || this).Yc(d.j);\n return e;\n }\n\n function lb(a, b, c, d, e) {\n const g = {\n value: 0,\n };\n c = {\n value: c,\n };\n const f = M(df);\n const h = M(gd);\n f.j = h;\n h.J = a;\n const n = {\n value: h.width,\n };\n const l = {\n value: h.height,\n };\n let m;\n m = c;\n const t = M(ef);\n hd(b, g, m, t) != L ? m = 0 : (n != p && (n.value = t.width), l != p && (l.value = t.height), m = 1);\n if (!m) return p;\n h.width = n.value;\n h.height = l.value;\n d != p && (d.value = h.width.value);\n e != p && (e.value = h.height.value);\n return cf(b, g.value, c.value, f) != L ? p : a < ua ? h.c.RGBA.ma : h.c.Va.y;\n }\n\n function hd(a, b, c, d) {\n if (d == p || a == p) return ta;\n $(d != p);\n d.tc = 0;\n d.width = [d.width];\n d.height = [d.height];\n d.$b = [d.$b];\n return Ye(a, b, c, d.width, d.height, d.$b, p);\n }\n\n function Ne(a,\n b, c) {\n const d = b.width;\n const e = b.height;\n let g = 0;\n let f = 0;\n let h = d;\n let n = e;\n b.Ua = a != p && a.Ua > 0;\n if (b.Ua && (h = a.wc, n = a.vc, g = a.t, f = a.k, c < ua || (g &= -2, f &= -2), g < 0 || f < 0 || h <= 0 || n <= 0 || g + h > d || f + n > e)) return 0;\n b.t = g;\n b.k = f;\n b.Ka = g + h;\n b.K = f + n;\n b.m = h;\n b.h = n;\n b.I = a != p && a.I > 0;\n if (b.I) {\n if (a.Ba <= 0 || a.Aa <= 0) return 0;\n b.Ba = a.Ba;\n b.Aa = a.Aa;\n }\n b.Za = a && a.Za;\n b.Bb = a == p || !a.ed;\n b.I && (b.Za = b.Ba < 3 * d / 4 && b.Aa < 3 * e / 4, b.Bb = 0);\n return 1;\n }\n var na = 512;\n var Qa = 0;\n var jb = 1;\n var Zc = 2;\n var Pa = 3;\n var Ab = 4;\n var kb = 5;\n var Fe = 6;\n var Ob = 7;\n var Pb = 8;\n var Bb = 9;\n var Qb = 10;\n var ua = 11;\n var Ra = 12;\n var Cc = 13;\n this.WEBP_CSP_MODE = this.Cd = {\n nd: 0,\n od: 1,\n kd: 2,\n ld: 3,\n jd: 4,\n pd: 5,\n qd: 6,\n rd: 7,\n sd: 8,\n md: 9,\n };\n var gd = {\n J: 'WEBP_CSP_MODE',\n width: s,\n height: s,\n Fc: s,\n c: {\n RGBA: {\n ma: x,\n Sa: 0,\n f: s,\n size: Mb,\n },\n Va: {\n y: x,\n c: x,\n S: x,\n p: x,\n D: x,\n B: x,\n C: x,\n q: x,\n F: s,\n nb: s,\n rb: s,\n Fa: s,\n Wc: Mb,\n Rc: Mb,\n Uc: Mb,\n Wb: Mb,\n },\n },\n Ic: U(4, E),\n Jb: p,\n jc: x,\n };\n var L = 0;\n var cb = 1;\n var ta = 2;\n var W = 3;\n var Hf = 4;\n var Ie = 5;\n var Nf = 6;\n var Z = 7;\n this.VP8StatusCode = this.td = {\n xd: 0,\n yd: 1,\n vd: 2,\n ud: 3,\n Ad: 4,\n zd: 5,\n Bd: 6,\n wd: 7,\n };\n var ef = {\n width: {\n value: s,\n },\n height: {\n value: s,\n },\n $b: {\n value: s,\n },\n tc: s,\n Yd: s,\n rotate: s,\n be: s,\n Ic: U(3, E),\n };\n this.WebPGetFeatures = this.Md = function (a, b, c) {\n let d = 'VP8StatusCode';\n na >>> 8 != na >>> 8 || c == p ? a = ta : (b = [b], d = hd(a, [0], b, c), a = d == Z ? W : d);\n return a;\n };\n const ff = {\n Za: s,\n ed: s,\n Ua: s,\n t: s,\n k: s,\n wc: s,\n vc: s,\n I: s,\n Ba: s,\n Aa: s,\n ae: s,\n Td: s,\n Xd: s,\n Ic: U(6, E),\n };\n this.WebPDecoderConfig = this.Kd = {\n input: M(ef),\n j: M(gd),\n options: M(ff),\n };\n this.WebPInitDecoderConfig = this.Nd = function (a) {\n na >>> 8 != na >>> 8 || a == p ? a = 0 : (a = a.input, $(a != p), a.tc = 0, a = 1);\n return a;\n };\n var Vb = {\n width: s,\n height: s,\n w: s,\n m: s,\n h: s,\n y: x,\n c: x,\n S: x,\n D: 0,\n B: 0,\n C: 0,\n F: s,\n Da: s,\n ka: 0,\n put: 0,\n Mb: 0,\n Pb: 0,\n Bb: s,\n e: Mb,\n data: x,\n b: 0,\n Za: s,\n Ua: s,\n t: s,\n Ka: s,\n k: s,\n K: s,\n I: s,\n Ba: s,\n Aa: s,\n p: x,\n q: 0,\n };\n var df = {\n j: M(gd),\n Sb: x,\n Qb: x,\n lc: x,\n Tb: 0,\n Rb: 0,\n mc: 0,\n ec: s,\n Qa: M(ff),\n memory: 0,\n $a: '(OutputFunc)',\n zb: '(OutputFunc)',\n ad: '(OutputRowFunc)',\n };\n var Gc = {\n data: x,\n b: x,\n e: Mb,\n offset: Mb,\n $: p,\n G: x,\n pa: Mb,\n ta: Mb,\n na: Mb,\n ia: s,\n };\n var Fc = {\n qa: x,\n Ia: p,\n Pd: x,\n Ab: s,\n la: E,\n Z: E,\n gc: s,\n };\n var af = {\n T: bb,\n qa: x,\n Ia: x,\n ya: Mb,\n Q: Mb,\n g: s,\n L: s,\n fa: s,\n };\n var gf = 25;\n var hf = [0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215];\n var bf = 10;\n var ve = 47;\n var we = 14;\n var Wf = 3;\n var $e = 5;\n var fg = 11;\n var Yc = 5;\n var qe = 4278190080;\n var jg = 8;\n var Tb = 15;\n var Ba = 256;\n var Ge = 24;\n var Je = 4;\n var Be = 0;\n var De = 1;\n var Ae = 2;\n var Ee = 3;\n var Ub = 1;\n var kc = 0;\n var kf = 1;\n var rd = 1;\n var O = 4;\n var R = 8;\n var Lb = 12;\n var fd = 10;\n var Bg = 16;\n var Ag = 1 * Math.pow(2, 32);\n var Ze = -1 - R - 1 >>> 0;\n var jf = {\n kc: s,\n s,\n };\n var Le = {\n Y: 'HuffmanTreeNode*',\n gb: s,\n Pa: s,\n };\n var pd = -1;\n const Dg = {\n ea: E,\n bb: s,\n };\n var ad = 506832829;\n var $b = 0;\n var ge = $b;\n var fe = 2;\n var ee = 3;\n var de = 1;\n var Ef = 4;\n var Df = 5;\n var Cf = 6;\n var Ld = 3;\n var xa = 4;\n var Hc = 4;\n var Gf = 4;\n var Md = 4;\n var Nd = 8;\n var Kc = 3;\n var Lc = 11;\n var f = 32;\n var Pf = 17 * f + 9 * f;\n var Tc = 1 * f + 8;\n var Uc = Tc + 16 * f + f;\n var he = Uc + 16;\n var Id = {\n fb: x,\n Jc: x,\n Nc: x,\n Ra: E,\n };\n var Jd = {\n l: 0,\n v: 0,\n gd: x,\n hd: x,\n uc: x,\n $c: x,\n };\n const Eg = {\n pb: s,\n ob: s,\n tb: s,\n Kb: U(xa, 0),\n Cb: U(xa, 0),\n };\n const Fg = {\n Ta: U(Ld, x),\n z: md([Md, Nd, Kc, Lc], x),\n };\n const Gg = {\n Oc: s,\n Fb: s,\n kb: s,\n oc: s,\n Lc: U(Hc, s),\n Gc: U(Hc, s),\n };\n var Oc = {\n zc: s,\n yc: s,\n ab: s,\n };\n var Qd = {\n X: s,\n ua: s,\n Nb: s,\n };\n const id = U(2, s);\n const Hg = {\n sc: M(id),\n sb: M(id),\n qc: M(id),\n };\n const Ig = {\n ha: s,\n d: s,\n W: s,\n M: Oc,\n N: Vb,\n };\n var Cg = {\n a: 'VP8StatusCode',\n za: s,\n xc: 0,\n o: M(Fc),\n Ac: M(Id),\n P: M(Jd),\n ga: M(Gg),\n Ca: M(Eg),\n rc: 'WebPWorker',\n qb: s,\n Ja: s,\n jb: s,\n oa: Ig,\n Ma: s,\n hb: s,\n lb: s,\n mb: s,\n wb: s,\n Ya: s,\n Hb: s,\n ic: ld(8, Fc),\n Zc: E,\n yb: ld(xa, Hg),\n R: M(Fg),\n pc: s,\n Pc: x,\n dc: x,\n cc: U(4, x),\n Xc: x,\n Sc: x,\n Vc: x,\n La: M(Qd),\n M: M(Oc),\n Ea: x,\n z: 0,\n ca: x,\n aa: x,\n ra: x,\n da: s,\n ba: s,\n sa: s,\n H: s,\n r: s,\n ib: 0,\n Gb: Mb,\n i: s,\n d: s,\n wa: x,\n Eb: U(16, x),\n Vd: 0,\n Tc: x,\n Lb: x,\n ja: E,\n Oa: E,\n A: s,\n W: s,\n Zb: U(xa, x),\n Ga: p,\n G: 0,\n ub: Mb,\n Xb: x,\n Od: 0,\n cd: s,\n dd: x,\n Wd: 0,\n fc: Mb,\n };\n var Db = 0;\n var Cb = 1;\n var cd = 2;\n const Jg = {\n Qc: 'VP8LImageTransformType',\n n: s,\n U: s,\n Vb: s,\n u: E,\n b: E,\n };\n var gg = {\n va: ld(Yc, Le),\n };\n const Kg = {\n xb: s,\n Yb: M(Dg),\n Dc: s,\n eb: s,\n Ec: s,\n ac: E,\n bd: E,\n hc: s,\n Db: 'HTreeGroup',\n };\n var eg = {\n a: 'VP8StatusCode',\n Wa: 'VP8LDecodeState',\n Ob: 'VP8LDecodeState',\n N: 'VP8Io',\n Ib: 'WebPDecBuffer',\n Hc: 'WebPDecBuffer',\n V: E,\n Ha: E,\n Xa: E,\n vb: E,\n o: M(af),\n l: s,\n v: s,\n O: s,\n xa: s,\n cb: M(Kg),\n Na: s,\n nc: ld(Je, Jg),\n Ub: E,\n Mc: x,\n $d: x,\n Zd: '*WebPRescaler',\n };\n var lf = 4;\n var nf = [p, function (a, b, c, d, e, g, f, h) {\n let n = s;\n let l = h;\n $(a != p);\n $(f != p);\n $(c > 0);\n $(d > 0);\n $(e > 0);\n $(g >= c * e);\n for (n = 0; n < d; ++n) {\n n == 0 ? N(f, h, a, b, e) : Ea(a, b, f, l - g, f, h, e), Ea(a, b + e, f, l, f, h + e, e * (c - 1)),\n l += g, b += g, h += g;\n }\n }, function (a, b, c, d, e, f, k, h) {\n let n = s;\n let l = h;\n $(a != p);\n $(k != p);\n $(c > 0);\n $(d > 0);\n $(e > 0);\n $(f >= c * e);\n N(k, h, a, b, e);\n Ea(a, b + e, k, l, k, h + e, e * (c - 1));\n for (n = 1; n < d; ++n) b += f, h += f, Ea(a, b, k, l, k, h, e * c), l += f;\n }, function (a, b, c, d, e, f, k, h) {\n var n = h;\n let l = s;\n $(a != p);\n $(k != p);\n $(c > 0);\n $(d > 0);\n $(e > 0);\n $(f >= c * e);\n N(k, h, a, b, e);\n Ea(a, b + e, k, n, k, h + e, e * (c - 1));\n for (l = 1; l < d; ++l) {\n let m = s;\n var n = n + f;\n b += f;\n h += f;\n Ea(a, b, k, n - f, k, h, e);\n for (m = e; m < c * e; ++m) {\n const t = k[n + m - e] + k[n + m - f] - k[n + m - f - e];\n k[h + m] = a[b + m] + (t < 0 ? 0 : t > 255 ? 255 : t) & 255;\n }\n }\n }];\n var yd = [3, 4, 3, 4, 4, 2, 2, 4, 4, 4,\n 2, 1, 1,\n ];\n this.WebPFreeDecBuffer = this.Yc = function (a) {\n a != p && (a.Fc || (a.Jb = ''), a.jc = 0, a.Jb = a.jc = p);\n };\n self = this;\n var va = U(511, x);\n var tc = U(511, x);\n var sc = U(2041, 0);\n var oc = U(225, 0);\n var oa = U(766, x);\n var Rd = 0;\n var Xb = 85627;\n var Wb = 35468;\n var Uf = [function (a, b) {\n let c = 4;\n let d;\n for (d = 0; d < 4; ++d) c += a[b + d - f] + a[b - 1 + d * f];\n c >>= 3;\n for (d = 0; d < 4; ++d) jd(a, b + d * f, c, 4);\n }, function (a, b) {\n Dc(a, b, 4);\n }, function (a, b) {\n let c = b - f;\n const d = [];\n d.push(y(a[c - 1], a[c + 0], a[c + 1]));\n d.push(y(a[c + 0], a[c + 1], a[c + 2]));\n d.push(y(a[c + 1], a[c + 2], a[c + 3]));\n d.push(y(a[c + 2], a[c + 3], a[c + 4]));\n for (c = 0; c < 4; ++c) N(a, b + c * f, d, 0, 4);\n },\n function (a, b) {\n const c = a[b - 1];\n const d = a[b - 1 + f];\n const e = a[b - 1 + 2 * f];\n const g = a[b - 1 + 3 * f];\n a[b + 0 + 0 * f] = a[b + 1 + 0 * f] = a[b + 2 + 0 * f] = a[b + 3 + 0 * f] = y(a[b - 1 - f], c, d);\n a[b + 0 + 1 * f] = a[b + 1 + 1 * f] = a[b + 2 + 1 * f] = a[b + 3 + 1 * f] = y(c, d, e);\n a[b + 0 + 2 * f] = a[b + 1 + 2 * f] = a[b + 2 + 2 * f] = a[b + 3 + 2 * f] = y(d, e, g);\n a[b + 0 + 3 * f] = a[b + 1 + 3 * f] = a[b + 2 + 3 * f] = a[b + 3 + 3 * f] = y(e, g, g);\n },\n function (a, b) {\n const c = a[b - 1 + 0 * f];\n const d = a[b - 1 + 1 * f];\n const e = a[b - 1 + 2 * f];\n const g = a[b - 1 - f];\n const k = a[b + 0 - f];\n const h = a[b + 1 - f];\n const n = a[b + 2 - f];\n const l = a[b + 3 - f];\n a[b + 0 + 3 * f] = y(d, e, a[b - 1 + 3 * f]);\n a[b + 0 + 2 * f] = a[b + 1 + 3 * f] = y(c, d, e);\n a[b + 0 + 1 * f] = a[b + 1 + 2 * f] = a[b + 2 + 3 * f] = y(g, c, d);\n a[b\n + 0 + 0 * f] = a[b + 1 + 1 * f] = a[b + 2 + 2 * f] = a[b + 3 + 3 * f] = y(k, g, c);\n a[b + 1 + 0 * f] = a[b + 2 + 1 * f] = a[b + 3 + 2 * f] = y(h, k, g);\n a[b + 2 + 0 * f] = a[b + 3 + 1 * f] = y(n, h, k);\n a[b + 3 + 0 * f] = y(l, n, h);\n },\n function (a, b) {\n const c = a[b - 1 + 0 * f];\n const d = a[b - 1 + 1 * f];\n const e = a[b - 1 + 2 * f];\n const g = a[b - 1 - f];\n const k = a[b + 0 - f];\n const h = a[b + 1 - f];\n const n = a[b + 2 - f];\n const l = a[b + 3 - f];\n a[b + 0 + 0 * f] = a[b + 1 + 2 * f] = g + k + 1 >> 1;\n a[b + 1 + 0 * f] = a[b + 2 + 2 * f] = k + h + 1 >> 1;\n a[b + 2 + 0 * f] = a[b + 3 + 2 * f] = h + n + 1 >> 1;\n a[b + 3 + 0 * f] = n + l + 1 >> 1;\n a[b + 0 + 3 * f] = y(e, d, c);\n a[b + 0 + 2 * f] = y(d, c, g);\n a[b + 0 + 1 * f] = a[b + 1 + 3 * f] = y(c, g, k);\n a[b + 1 + 1 * f] = a[b + 2 + 3 * f] = y(g, k, h);\n a[b + 2 + 1 * f] = a[b + 3 + 3 * f] = y(k, h, n);\n a[b + 3 + 1 * f] = y(h, n, l);\n },\n function (a, b) {\n const c = a[b + 1 - f];\n const d = a[b + 2 - f];\n const e = a[b + 3 - f];\n const g = a[b + 4 - f];\n const k = a[b + 5 - f];\n const h = a[b + 6 - f];\n const n = a[b + 7 - f];\n a[b + 0 + 0 * f] = y(a[b + 0 - f], c, d);\n a[b + 1 + 0 * f] = a[b + 0 + 1 * f] = y(c, d, e);\n a[b + 2 + 0 * f] = a[b + 1 + 1 * f] = a[b + 0 + 2 * f] = y(d, e, g);\n a[b + 3 + 0 * f] = a[b + 2 + 1 * f] = a[b + 1 + 2 * f] = a[b + 0 + 3 * f] = y(e, g, k);\n a[b + 3 + 1 * f] = a[b + 2 + 2 * f] = a[b + 1 + 3 * f] = y(g, k, h);\n a[b + 3 + 2 * f] = a[b + 2 + 3 * f] = y(k, h, n);\n a[b + 3 + 3 * f] = y(h, n, n);\n },\n function (a, b) {\n const c = a[b + 0 - f];\n const d = a[b + 1 - f];\n const e = a[b + 2 - f];\n const g = a[b + 3 - f];\n const k = a[b + 4 - f];\n const h = a[b + 5 - f];\n const n = a[b + 6 - f];\n const l = a[b + 7 - f];\n a[b + 0 + 0 * f] = c + d + 1 >> 1;\n a[b + 1 + 0 * f] = a[b\n + 0 + 2 * f] = d + e + 1 >> 1;\n a[b + 2 + 0 * f] = a[b + 1 + 2 * f] = e + g + 1 >> 1;\n a[b + 3 + 0 * f] = a[b + 2 + 2 * f] = g + k + 1 >> 1;\n a[b + 0 + 1 * f] = y(c, d, e);\n a[b + 1 + 1 * f] = a[b + 0 + 3 * f] = y(d, e, g);\n a[b + 2 + 1 * f] = a[b + 1 + 3 * f] = y(e, g, k);\n a[b + 3 + 1 * f] = a[b + 2 + 3 * f] = y(g, k, h);\n a[b + 3 + 2 * f] = y(k, h, n);\n a[b + 3 + 3 * f] = y(h, n, l);\n },\n function (a, b) {\n const c = a[b - 1 + 0 * f];\n const d = a[b - 1 + 1 * f];\n const e = a[b - 1 + 2 * f];\n const g = a[b - 1 + 3 * f];\n const k = a[b - 1 - f];\n const h = a[b + 0 - f];\n const n = a[b + 1 - f];\n const l = a[b + 2 - f];\n a[b + 0 + 0 * f] = a[b + 2 + 1 * f] = c + k + 1 >> 1;\n a[b + 0 + 1 * f] = a[b + 2 + 2 * f] = d + c + 1 >> 1;\n a[b + 0 + 2 * f] = a[b + 2 + 3 * f] = e + d + 1 >> 1;\n a[b + 0 + 3 * f] = g + e + 1 >> 1;\n a[b + 3 + 0 * f] = y(h, n, l);\n a[b + 2 + 0 * f] = y(k, h, n);\n a[b\n + 1 + 0 * f] = a[b + 3 + 1 * f] = y(c, k, h);\n a[b + 1 + 1 * f] = a[b + 3 + 2 * f] = y(d, c, k);\n a[b + 1 + 2 * f] = a[b + 3 + 3 * f] = y(e, d, c);\n a[b + 1 + 3 * f] = y(g, e, d);\n },\n function (a, b) {\n const c = a[b - 1 + 0 * f];\n const d = a[b - 1 + 1 * f];\n const e = a[b - 1 + 2 * f];\n const g = a[b - 1 + 3 * f];\n a[b + 0 + 0 * f] = c + d + 1 >> 1;\n a[b + 2 + 0 * f] = a[b + 0 + 1 * f] = d + e + 1 >> 1;\n a[b + 2 + 1 * f] = a[b + 0 + 2 * f] = e + g + 1 >> 1;\n a[b + 1 + 0 * f] = y(c, d, e);\n a[b + 3 + 0 * f] = a[b + 1 + 1 * f] = y(d, e, g);\n a[b + 3 + 1 * f] = a[b + 1 + 2 * f] = y(e, g, g);\n a[b + 3 + 2 * f] = a[b + 2 + 2 * f] = a[b + 0 + 3 * f] = a[b + 1 + 3 * f] = a[b + 2 + 3 * f] = a[b + 3 + 3 * f] = g;\n },\n ];\n var Vf = [function (a, b) {\n let c = 16;\n let d;\n for (d = 0; d < 16; ++d) c += a[b - 1 + d * f] + a[b + d - f];\n Yb(c >> 5, a, b);\n }, function (a,\n b) {\n Dc(a, b, 16);\n }, function (a, b) {\n let c;\n for (c = 0; c < 16; ++c) N(a, b + c * f, a, b - f, 16);\n }, function (a, b) {\n let c;\n for (c = 16; c > 0; --c) jd(a, b + 0, a[b - 1], 16), b += f;\n }, function (a, b) {\n let c = 8;\n let d;\n for (d = 0; d < 16; ++d) c += a[b - 1 + d * f];\n Yb(c >> 4, a, b);\n }, function (a, b) {\n let c = 8;\n let d;\n for (d = 0; d < 16; ++d) c += a[b + d - f];\n Yb(c >> 4, a, b);\n }, function (a, b) {\n Yb(128, a, b);\n }];\n var je = [function (a, b) {\n let c = 8;\n let d;\n for (d = 0; d < 8; ++d) c += a[b + d - f] + a[b - 1 + d * f];\n Zb(1 * (c >> 4), a, b);\n }, function (a, b) {\n Dc(a, b, 8);\n }, function (a, b) {\n let c;\n for (c = 0; c < 8; ++c) N(a, b + c * f, a, b - f, 8);\n }, function (a, b) {\n let c;\n for (c = 0; c < 8; ++c) {\n jd(a,\n b + 0, a[b - 1], 8), b += f;\n }\n }, function (a, b) {\n let c = 4;\n let d;\n for (d = 0; d < 8; ++d) c += a[b - 1 + d * f];\n Zb(1 * (c >> 3), a, b);\n }, function (a, b) {\n let c = 4;\n let d;\n for (d = 0; d < 8; ++d) c += a[b + d - f];\n Zb(1 * (c >> 3), a, b);\n }, function (a, b) {\n Zb(128, a, b);\n }];\n let mc; let Pc; let Qc; let Rc; let Sd; let Td; let Ud; let Vd; let Wd; let Xd; let Yd; let Zd; let $d; let ae; let be; let ce; var Pd = 31;\n var uc = [0, 2, 8];\n var Od = 3;\n var Of = 1;\n var ie = [0 + 0 * f, 4 + 0 * f, 8 + 0 * f, 12 + 0 * f, 0 + 4 * f, 4 + 4 * f, 8 + 4 * f, 12 + 4 * f, 0 + 8 * f, 4 + 8 * f, 8 + 8 * f, 12 + 8 * f, 0 + 12 * f, 4 + 12 * f, 8 + 12 * f, 12 + 12 * f];\n var Ic = [4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38,\n 39, 40, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 93, 95, 96, 98, 100, 101, 102, 104, 106, 108, 110, 112, 114, 116, 118, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 143, 145, 148, 151, 154, 157,\n ];\n var Jc = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96,\n 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 234, 239, 245, 249, 254, 259, 264, 269, 274, 279, 284,\n ];\n var Sf = [-$b, 1, -1, 2, -2, 3, 4, 6, -3, 5, -4, -5, -6, 7, -7, 8, -8, -9];\n var Ff = [\n [\n [\n [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n ],\n [\n [253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128],\n [189, 129, 242, 255, 227, 213, 255, 219, 128, 128,\n 128,\n ],\n [106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128],\n ],\n [\n [1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128],\n [181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128],\n [78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128],\n ],\n [\n [1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128],\n [184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128],\n [77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128],\n ],\n [\n [1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128],\n [170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128],\n [37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128],\n ],\n [\n [1, 204, 254, 255, 245, 255, 128, 128, 128, 128,\n 128,\n ],\n [207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128],\n [102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128],\n ],\n [\n [1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128],\n [177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128],\n [80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128],\n ],\n [\n [1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n [246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n [255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n ],\n ],\n [\n [\n [198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62],\n [131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1],\n [68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128],\n ],\n [\n [1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128],\n [184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128],\n [81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128],\n ],\n [\n [1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128],\n [99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128],\n [23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128],\n ],\n [\n [1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128],\n [109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128],\n [44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128],\n ],\n [\n [1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128],\n [94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128],\n [22,\n 100, 174, 245, 186, 161, 255, 199, 128, 128, 128,\n ],\n ],\n [\n [1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128],\n [124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128],\n [35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128],\n ],\n [\n [1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128],\n [121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128],\n [45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128],\n ],\n [\n [1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128],\n [203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128],\n [137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128],\n ],\n ],\n [\n [\n [253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128],\n [175, 13,\n 224, 243, 193, 185, 249, 198, 255, 255, 128,\n ],\n [73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128],\n ],\n [\n [1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128],\n [239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128],\n [155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128],\n ],\n [\n [1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128],\n [201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128],\n [69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128],\n ],\n [\n [1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128],\n [223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128],\n [141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128],\n ],\n [\n [1, 16, 248, 255,\n 255, 128, 128, 128, 128, 128, 128,\n ],\n [190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128],\n [149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n ],\n [\n [1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n [247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n [240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n ],\n [\n [1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128],\n [213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128],\n [55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n ],\n [\n [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128],\n [128, 128, 128, 128,\n 128, 128, 128, 128, 128, 128, 128,\n ],\n ],\n ],\n [\n [\n [202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255],\n [126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128],\n [61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128],\n ],\n [\n [1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128],\n [166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128],\n [39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128],\n ],\n [\n [1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128],\n [124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128],\n [24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128],\n ],\n [\n [1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128],\n [149, 150, 226, 252, 216,\n 205, 255, 171, 128, 128, 128,\n ],\n [28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128],\n ],\n [\n [1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128],\n [123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128],\n [20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128],\n ],\n [\n [1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128],\n [168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128],\n [47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128],\n ],\n [\n [1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128],\n [141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128],\n [42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128],\n ],\n [\n [1, 1, 255, 128, 128, 128, 128,\n 128, 128, 128, 128,\n ],\n [244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n [238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128],\n ],\n ],\n ];\n var Rf = [\n [\n [231, 120, 48, 89, 115, 113, 120, 152, 112],\n [152, 179, 64, 126, 170, 118, 46, 70, 95],\n [175, 69, 143, 80, 85, 82, 72, 155, 103],\n [56, 58, 10, 171, 218, 189, 17, 13, 152],\n [114, 26, 17, 163, 44, 195, 21, 10, 173],\n [121, 24, 80, 195, 26, 62, 44, 64, 85],\n [144, 71, 10, 38, 171, 213, 144, 34, 26],\n [170, 46, 55, 19, 136, 160, 33, 206, 71],\n [63, 20, 8, 114, 114, 208, 12, 9, 226],\n [81, 40, 11, 96, 182, 84, 29, 16, 36],\n ],\n [\n [134, 183, 89, 137, 98, 101, 106, 165, 148],\n [72, 187, 100, 130, 157, 111,\n 32, 75, 80,\n ],\n [66, 102, 167, 99, 74, 62, 40, 234, 128],\n [41, 53, 9, 178, 241, 141, 26, 8, 107],\n [74, 43, 26, 146, 73, 166, 49, 23, 157],\n [65, 38, 105, 160, 51, 52, 31, 115, 128],\n [104, 79, 12, 27, 217, 255, 87, 17, 7],\n [87, 68, 71, 44, 114, 51, 15, 186, 23],\n [47, 41, 14, 110, 182, 183, 21, 17, 194],\n [66, 45, 25, 102, 197, 189, 23, 18, 22],\n ],\n [\n [88, 88, 147, 150, 42, 46, 45, 196, 205],\n [43, 97, 183, 117, 85, 38, 35, 179, 61],\n [39, 53, 200, 87, 26, 21, 43, 232, 171],\n [56, 34, 51, 104, 114, 102, 29, 93, 77],\n [39, 28, 85, 171, 58, 165, 90, 98, 64],\n [34, 22, 116, 206, 23, 34, 43, 166, 73],\n [107, 54, 32, 26, 51, 1, 81, 43, 31],\n [68, 25, 106, 22,\n 64, 171, 36, 225, 114,\n ],\n [34, 19, 21, 102, 132, 188, 16, 76, 124],\n [62, 18, 78, 95, 85, 57, 50, 48, 51],\n ],\n [\n [193, 101, 35, 159, 215, 111, 89, 46, 111],\n [60, 148, 31, 172, 219, 228, 21, 18, 111],\n [112, 113, 77, 85, 179, 255, 38, 120, 114],\n [40, 42, 1, 196, 245, 209, 10, 25, 109],\n [88, 43, 29, 140, 166, 213, 37, 43, 154],\n [61, 63, 30, 155, 67, 45, 68, 1, 209],\n [100, 80, 8, 43, 154, 1, 51, 26, 71],\n [142, 78, 78, 16, 255, 128, 34, 197, 171],\n [41, 40, 5, 102, 211, 183, 4, 1, 221],\n [51, 50, 17, 168, 209, 192, 23, 25, 82],\n ],\n [\n [138, 31, 36, 171, 27, 166, 38, 44, 229],\n [67, 87, 58, 169, 82, 115, 26, 59, 179],\n [63, 59, 90, 180, 59, 166, 93, 73,\n 154,\n ],\n [40, 40, 21, 116, 143, 209, 34, 39, 175],\n [47, 15, 16, 183, 34, 223, 49, 45, 183],\n [46, 17, 33, 183, 6, 98, 15, 32, 183],\n [57, 46, 22, 24, 128, 1, 54, 17, 37],\n [65, 32, 73, 115, 28, 128, 23, 128, 205],\n [40, 3, 9, 115, 51, 192, 18, 6, 223],\n [87, 37, 9, 115, 59, 77, 64, 21, 47],\n ],\n [\n [104, 55, 44, 218, 9, 54, 53, 130, 226],\n [64, 90, 70, 205, 40, 41, 23, 26, 57],\n [54, 57, 112, 184, 5, 41, 38, 166, 213],\n [30, 34, 26, 133, 152, 116, 10, 32, 134],\n [39, 19, 53, 221, 26, 114, 32, 73, 255],\n [31, 9, 65, 234, 2, 15, 1, 118, 73],\n [75, 32, 12, 51, 192, 255, 160, 43, 51],\n [88, 31, 35, 67, 102, 85, 55, 186, 85],\n [56, 21, 23, 111, 59, 205, 45, 37, 192],\n [55, 38, 70, 124, 73, 102, 1, 34, 98],\n ],\n [\n [125, 98, 42, 88, 104, 85, 117, 175, 82],\n [95, 84, 53, 89, 128, 100, 113, 101, 45],\n [75, 79, 123, 47, 51, 128, 81, 171, 1],\n [57, 17, 5, 71, 102, 57, 53, 41, 49],\n [38, 33, 13, 121, 57, 73, 26, 1, 85],\n [41, 10, 67, 138, 77, 110, 90, 47, 114],\n [115, 21, 2, 10, 102, 255, 166, 23, 6],\n [101, 29, 16, 10, 85, 128, 101, 196, 26],\n [57, 18, 10, 102, 102, 213, 34, 20, 43],\n [117, 20, 15, 36, 163, 128, 68, 1, 26],\n ],\n [\n [102, 61, 71, 37, 34, 53, 31, 243, 192],\n [69, 60, 71, 38, 73, 119, 28, 222, 37],\n [68, 45, 128, 34, 1, 47, 11, 245, 171],\n [62, 17, 19, 70, 146, 85, 55, 62, 70],\n [37, 43, 37, 154, 100, 163, 85, 160,\n 1,\n ],\n [63, 9, 92, 136, 28, 64, 32, 201, 85],\n [75, 15, 9, 9, 64, 255, 184, 119, 16],\n [86, 6, 28, 5, 64, 255, 25, 248, 1],\n [56, 8, 17, 132, 137, 255, 55, 116, 128],\n [58, 15, 20, 82, 135, 57, 26, 121, 40],\n ],\n [\n [164, 50, 31, 137, 154, 133, 25, 35, 218],\n [51, 103, 44, 131, 131, 123, 31, 6, 158],\n [86, 40, 64, 135, 148, 224, 45, 183, 128],\n [22, 26, 17, 131, 240, 154, 14, 1, 209],\n [45, 16, 21, 91, 64, 222, 7, 1, 197],\n [56, 21, 39, 155, 60, 138, 23, 102, 213],\n [83, 12, 13, 54, 192, 255, 68, 47, 28],\n [85, 26, 85, 85, 128, 128, 32, 146, 171],\n [18, 11, 7, 63, 144, 171, 4, 4, 246],\n [35, 27, 10, 146, 174, 171, 12, 26, 128],\n ],\n [\n [190, 80, 35, 99, 180, 80,\n 126, 54, 45,\n ],\n [85, 126, 47, 87, 176, 51, 41, 20, 32],\n [101, 75, 128, 139, 118, 146, 116, 128, 85],\n [56, 41, 15, 176, 236, 85, 37, 9, 62],\n [71, 30, 17, 119, 118, 255, 17, 18, 138],\n [101, 38, 60, 138, 55, 70, 43, 26, 142],\n [146, 36, 19, 30, 171, 255, 97, 27, 20],\n [138, 45, 61, 62, 219, 1, 81, 188, 64],\n [32, 41, 20, 117, 151, 142, 20, 21, 163],\n [112, 19, 12, 61, 195, 128, 48, 4, 24],\n ],\n ];\n var If = [\n [\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [223, 241,\n 252, 255, 255, 255, 255, 255, 255, 255, 255,\n ],\n [249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255],\n [234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255],\n [250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255],\n [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n ],\n [\n [\n [217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [225, 252, 241, 253, 255, 255, 254, 255,\n 255, 255, 255,\n ],\n [234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255],\n ],\n [\n [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 253, 254, 255, 255,\n 255, 255, 255, 255, 255, 255,\n ],\n [252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255,\n 255, 255, 255, 255, 255, 255, 255, 255,\n ],\n ],\n ],\n [\n [\n [186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255],\n [234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255],\n [251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255],\n ],\n [\n [255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255,\n 255, 255,\n ],\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n ],\n [\n [\n [248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255],\n [248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n [246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n [252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255],\n [248, 254, 253, 255, 255, 255,\n 255, 255, 255, 255, 255,\n ],\n [253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255],\n [252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 255, 253,\n 255, 255, 255, 255, 255, 255, 255, 255,\n ],\n [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n [\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255],\n ],\n ],\n ];\n this.WebPGetDecoderVersion = this.Ld = function () {\n return 512;\n };\n var Nc = [0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 0];\n var Jf = [\n [173, 148, 140, 0],\n [176, 155, 140, 135, 0],\n [180, 157, 141, 134, 130, 0],\n [254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0],\n ];\n var Kf = [0, 1, 4, 8, 5, 2, 3, 6,\n 9, 12, 13, 10, 7, 11, 14, 15,\n ];\n var Tf = md([Kc, Lc], '');\n U(4, x);\n var vc = [\n [0, 0, 0, 0],\n [1, 0, 0, 0],\n [0, 1, 0, 0],\n [1, 1, 0, 0],\n [0, 0, 1, 0],\n [1, 0, 1, 0],\n [0, 1, 1, 0],\n [1, 1, 1, 0],\n [0, 0, 0, 1],\n [1, 0, 0, 1],\n [0, 1, 0, 1],\n [1, 1, 0, 1],\n [0, 0, 1, 1],\n [1, 0, 1, 1],\n [0, 1, 1, 1],\n [1, 1, 1, 1],\n ];\n var Lf = 134480385;\n var ea = 16;\n var J = -227;\n var dd = 482;\n var Ce = [Wc, function (a) {\n return a;\n }, function (a, b, c) {\n return b[c + 0];\n }, function (a, b, c) {\n return b[c + 1];\n }, function (a, b, c) {\n return b[c - 1];\n }, function (a, b, c) {\n return ka(ka(a, b[c + 1]), b[c + 0]);\n }, function (a, b, c) {\n return ka(a, b[c - 1]);\n }, function (a, b, c) {\n return ka(a, b[c + 0]);\n }, function (a,\n b, c) {\n return ka(b[c - 1], b[c + 0]);\n }, function (a, b, c) {\n return ka(b[c + 0], b[c + 1]);\n }, function (a, b, c) {\n return ka(ka(a, b[c - 1]), ka(b[c + 0], b[c + 1]));\n }, function (a, b, c) {\n return Math.abs((a >> 24 & 255) - (b[c - 1] >> 24 & 255)) - Math.abs((b[c + 0] >> 24 & 255) - (b[c - 1] >> 24 & 255)) + (Math.abs((a >> 16 & 255) - (b[c - 1] >> 16 & 255)) - Math.abs((b[c + 0] >> 16 & 255) - (b[c - 1] >> 16 & 255))) + (Math.abs((a >> 8 & 255) - (b[c - 1] >> 8 & 255)) - Math.abs((b[c + 0] >> 8 & 255) - (b[c - 1] >> 8 & 255))) + (Math.abs((a & 255) - (b[c - 1] & 255)) - Math.abs((b[c + 0] & 255) - (b[c - 1] & 255))) <= 0 ? b[c + 0] : a;\n }, function (a, b, c) {\n return ($a((a\n >> 24 & 255) + (b[c + 0] >> 24 & 255) - (b[c - 1] >> 24 & 255)) << 24 | $a((a >> 16 & 255) + (b[c + 0] >> 16 & 255) - (b[c - 1] >> 16 & 255)) << 16 | $a((a >> 8 & 255) + (b[c + 0] >> 8 & 255) - (b[c - 1] >> 8 & 255)) << 8 | $a((a & 255) + (b[c + 0] & 255) - (b[c - 1] & 255))) >>> 0;\n }, function (a, b, c) {\n const d = b[c - 1];\n a = ka(a, b[c + 0]);\n return (yb(a >> 24 & 255, d >> 24 & 255) << 24 | yb(a >> 16 & 255, d >> 16 & 255) << 16 | yb(a >> 8 & 255, d >> 8 & 255) << 8 | yb(a >> 0 & 255, d >> 0 & 255)) >>> 0;\n }, Wc, Wc];\n var Xf = {\n Cc: x,\n Bc: x,\n Kc: x,\n };\n var $c = 16;\n var Me = 16;\n var kg = 16;\n var mg = [2, 3, 7];\n var lg = [3, 3, 11];\n var Zf = 0;\n var $f = 1;\n var ag = 2;\n var bg = 3;\n var cg = 4;\n var hg = [Ba + Ge, Ba, Ba, Ba, 40];\n var Ke = 19;\n var ig = [17, 18, 0, 1, 2, 3, 4, 5, 16,\n 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n ];\n var He = 120;\n var dg = [24, 7, 23, 25, 40, 6, 39, 41, 22, 26, 38, 42, 56, 5, 55, 57, 21, 27, 54, 58, 37, 43, 72, 4, 71, 73, 20, 28, 53, 59, 70, 74, 36, 44, 88, 69, 75, 52, 60, 3, 87, 89, 19, 29, 86, 90, 35, 45, 68, 76, 85, 91, 51, 61, 104, 2, 103, 105, 18, 30, 102, 106, 34, 46, 84, 92, 67, 77, 101, 107, 50, 62, 120, 1, 119, 121, 83, 93, 17, 31, 100, 108, 66, 78, 118, 122, 33, 47, 117, 123, 49, 63, 99, 109, 82, 94, 0, 116, 124, 65, 79, 16, 32, 98, 110, 48, 115, 125, 81, 95, 64, 114, 126, 97, 111, 80, 113, 127, 96, 112];\n var Jb = 1 << ea - 1;\n var Za = U(256, 0);\n var xb = U(256, 0);\n var vb = U(256, la);\n var wb = U(256, la);\n var ia = U(dd - J, x);\n var Hb = U(dd\n - J, x);\n var Xe = 0;\n var V = Array(Cc);\n var vg = [function (a, b, c, d, e, f, k, h, n, l, m, t, q) {\n Ca(a, b, c, d, e, f, k, h, n, l, m, t, q, hc, 3);\n }, Se, function (a, b, c, d, e, f, k, h, n, l, m, t, q) {\n Ca(a, b, c, d, e, f, k, h, n, l, m, t, q, Vc, 3);\n }, Te, Ue, Ve, function (a, b, c, d, e, f, k, h, n, l, m, t, q) {\n Ca(a, b, c, d, e, f, k, h, n, l, m, t, q, le, 2);\n }, Se, Te, Ue, Ve];\n this.Hd = function (a, b, c, d) {\n return lb(Qa, a, b, c, d);\n };\n this.Id = function (a, b, c, d) {\n return lb(jb, a, b, c, d);\n };\n this.Jd = function (a, b, c, d) {\n return lb(kb, a, b, c, d);\n };\n this.Ed = function (a, b, c, d) {\n return lb(Ab, a, b, c, d);\n };\n this.Fd = function (a, b, c, d) {\n return lb(Zc,\n a, b, c, d);\n };\n this.Gd = function (a, b, c, d) {\n return lb(Pa, a, b, c, d);\n };\n this.WebPDecode = this.Dd = function (a, b, c) {\n const d = M(df);\n let e = 'VP8StatusCode';\n if (c == p) return ta;\n e = hd(a, [0], [b], c.input);\n if (e != L) return e == Z ? W : e;\n d.j = c.j;\n d.Qa = c.Qa;\n return e = cf(a, 0, [b], d);\n };\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {webp2png} from './webp';\nimport type {ConvertWebPTask} from './webpWorkerController';\n\nconst ctx = self as any as DedicatedWorkerGlobalScope;\nconst tasks: ConvertWebPTask[] = [];\n// let isProcessing = false;\n\nfunction finishTask() {\n // isProcessing = false;\n processTasks();\n}\n\nfunction processTasks() {\n // if(isProcessing) return;\n\n const task = tasks.shift();\n if(!task) return;\n\n // isProcessing = true;\n\n switch(task.type) {\n case 'convertWebp': {\n const {fileName, bytes} = task.payload;\n\n let convertedBytes: Uint8Array;\n try {\n convertedBytes = webp2png(bytes).bytes;\n } catch(err) {\n console.error('Convert webp2png error:', err, 'payload:', task.payload);\n }\n\n ctx.postMessage({\n type: 'convertWebp',\n payload: {\n fileName,\n bytes: convertedBytes\n }\n });\n\n finishTask();\n\n break;\n }\n\n default:\n finishTask();\n }\n}\n\nfunction scheduleTask(task: ConvertWebPTask) {\n tasks.push(task);\n /* if(task.payload.fileName.indexOf('main-') === 0) {\n tasks.push(task);\n } else {\n tasks.unshift(task);\n } */\n\n processTasks();\n}\n\nctx.addEventListener('message', (event) => {\n scheduleTask(event.data);\n});\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {WebPDecoder} from '../../vendor/libwebp-0.2.0';\nimport {encode} from 'fast-png';\n\nexport function webp2png(data: Uint8Array) {\n const decoder = new WebPDecoder();\n const config: any = decoder.WebPDecoderConfig;\n const buffer = config.j || config.output;\n const bitstream = config.input;\n\n decoder.WebPInitDecoderConfig(config);\n decoder.WebPGetFeatures(data, data.length, bitstream);\n\n /** MODE_RGBA = 1 MODE_ARGB = 4, */\n buffer.J = 1;\n\n let status;\n try {\n status = decoder.WebPDecode(data, data.length, config);\n } catch(e) {\n status = e;\n }\n\n if(status === 0) {\n const rgbaData = buffer.Jb;\n const pngData = encode({\n data: rgbaData,\n width: buffer.width,\n height: buffer.height,\n channels: 4,\n depth: 8\n });\n\n return {status, bytes: pngData};\n }\n\n return {status, bytes: data};\n}\n\nexport function webp2pngAsBlob(data: Uint8Array) {\n const {status, bytes} = webp2png(data);\n return new Blob([bytes], {type: status === 0 ? 'image/png' : 'image/webp'});\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [699,866,158], () => (__webpack_require__(2061)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + {\"158\":\"npm.iobuffer\",\"699\":\"npm.pako\",\"866\":\"npm.fast-png\"}[chunkId] + \".\" + {\"158\":\"8fe11aa09121a6fd9200\",\"699\":\"89deb457201f16c93925\",\"866\":\"a7cba17ee621cb2ad512\"}[chunkId] + \".chunk.js\";\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","(() => {\n if (typeof __webpack_require__ !== 'undefined') {\n var oldGetScript = __webpack_require__.u;\n var oldLoadScript = __webpack_require__.e;\n var queryMap = {};\n var countMap = {};\n var getRetryDelay = function () {\n return 3000;\n };\n __webpack_require__.u = function (chunkId) {\n var result = oldGetScript(chunkId);\n return (\n result +\n (queryMap.hasOwnProperty(chunkId) ? '?' + queryMap[chunkId] : '')\n );\n };\n __webpack_require__.e = function (chunkId) {\n var result = oldLoadScript(chunkId);\n return result.catch(function (error) {\n var retries = countMap.hasOwnProperty(chunkId)\n ? countMap[chunkId]\n : 999999;\n if (retries < 1) {\n var realSrc = oldGetScript(chunkId);\n error.message =\n 'Loading chunk ' +\n chunkId +\n ' failed after 999999 retries.\\n(' +\n realSrc +\n ')';\n error.request = realSrc;\n throw error;\n }\n return new Promise(function (resolve) {\n var retryAttempt = 999999 - retries + 1;\n setTimeout(function () {\n var retryAttemptString = '&retry-attempt=' + retryAttempt;\n var cacheBust = (function () {\n return Date.now();\n })();\n +retryAttemptString;\n queryMap[chunkId] = cacheBust;\n countMap[chunkId] = retries - 1;\n resolve(__webpack_require__.e(chunkId));\n }, getRetryDelay(retryAttempt));\n });\n });\n };\n }\n})();\n","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t61: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = this[\"webpackChunktweb\"] = this[\"webpackChunktweb\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","next","i","p","M","F","JSON","parse","stringify","N","G","w","D","S","Nb","length","push","ic","rc","memmove","arr1","index1","arr2","index2","jd","kd","ga","String","fromCharCode","U","ld","md","$","Error","WebPDecoder","a","Ob","Pb","Bb","Qb","b","c","la","d","e","Z","gc","bc","qa","Ia","Rb","ya","T","Q","g","L","fa","Sb","Da","gf","hf","ma","Pa","gb","nd","Y","jf","s","ja","jc","k","h","n","l","kc","od","Tb","pd","Ea","qd","P","v","Ga","ub","Xb","m","f","q","r","u","C","Ub","kf","lf","rd","Vb","A","z","sd","td","na","put","ud","Mb","vd","wd","ka","fd","width","height","o","Wa","Cb","Ka","xd","Db","lc","V","Ha","mf","sa","nf","zd","ta","Ua","wc","vc","t","I","Ba","Aa","J","Qa","Cc","Fc","Jb","yd","ua","parseInt","Ra","cb","RGBA","Sa","size","Va","y","Wc","B","nb","Rc","rb","Uc","Wb","Fa","of","mb","Ad","pf","qf","mc","nc","rf","Dc","oa","Yb","Zb","sc","oc","Bd","va","Cd","tc","Dd","Ed","sf","tf","uf","vf","wf","xf","yf","zf","Af","Bf","Fd","$b","Cf","Df","Ef","Ec","wa","Gd","xc","alert","za","Hd","Id","Jd","Gc","data","Kd","ia","W","pa","offset","Ac","fb","Jc","Nc","gd","hd","Ma","hb","K","R","Ta","Ff","Ca","pb","ob","tb","Kb","Lb","uc","$c","xa","Ld","Ab","Oc","Fb","kb","Hc","Lc","Gf","Hb","yb","Ic","sb","qc","Hf","Zc","Md","Nd","Kc","If","pc","Pc","fc","dd","cd","Mc","Jf","Kf","Lf","Mf","Nf","Za","lb","Ya","wb","Ja","qb","WebPWorkerReset","Qd","Rd","Ud","FinishRow","jb","Od","Of","Pf","Pd","Gb","ib","dc","Xc","Sc","Vc","Sd","ha","H","ca","da","aa","ba","ra","La","Qc","Td","Vd","Wd","Xd","Yd","Zd","$d","ae","be","ce","Qf","db","X","cc","O","Eb","Rf","Sf","de","ee","fe","ge","Tc","Oa","Tf","ea","ab","Xa","he","vb","xb","ac","ie","Uf","$a","Vf","je","zb","zc","yc","eb","WebPWorkerSync","OK","hc","WebPWorkerLaunch","Ib","Na","ec","Bc","ke","le","me","ne","oe","pe","qe","re","se","te","ue","ve","we","Wf","xe","Yc","ye","bd","ze","Ae","Be","Ce","De","Xf","Ee","Yf","EmitRescaledRows","WebPApplyAlphaMultiply","WebPApplyAlphaMultiply4444","Fe","EmitRescaledRowsYUVA","EmitRowsYUVA","Ge","Zf","$f","ag","bg","ad","bb","cg","He","dg","End","Ie","eg","Je","Array","fg","gg","hg","Ke","ig","jg","Le","Me","kg","lg","mg","pg","qg","Oe","Pe","Qe","Re","rg","Se","Te","Ue","Ve","sg","tg","j","ug","vg","wg","xg","We","yg","zg","memory","Ne","InitRGBRescaler","InitYUVRescaler","Xe","ed","Ye","Ag","Bg","Ze","$e","af","bf","cf","ng","AllocateAndInitRescaler","og","Cg","this","value","df","ef","WEBP_CSP_MODE","VP8StatusCode","rotate","WebPGetFeatures","ff","WebPDecoderConfig","input","options","WebPInitDecoderConfig","Math","pow","Eg","Fg","Gg","id","Hg","Ig","Kg","WebPFreeDecBuffer","WebPGetDecoderVersion","abs","WebPDecode","ctx","self","tasks","finishTask","processTasks","task","shift","type","fileName","bytes","payload","convertedBytes","decoder","config","buffer","output","bitstream","status","rgbaData","channels","depth","webp2png","err","console","error","postMessage","addEventListener","event","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","call","x","__webpack_exports__","result","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","Object","keys","every","key","splice","definition","defineProperty","enumerable","get","chunkId","Promise","all","reduce","promises","miniCssF","globalThis","Function","window","obj","prop","prototype","hasOwnProperty","scriptUrl","importScripts","location","document","currentScript","src","scripts","getElementsByTagName","replace","oldGetScript","oldLoadScript","queryMap","countMap","catch","retries","realSrc","message","request","resolve","setTimeout","cacheBust","Date","now","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","bind","moreModules","runtime","pop","map","then"],"sourceRoot":""} \ No newline at end of file diff --git a/public/742.4a4829b5ed21258b69e6.chunk.js b/public/742.4a4829b5ed21258b69e6.chunk.js deleted file mode 100644 index 8cc942ec..00000000 --- a/public/742.4a4829b5ed21258b69e6.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -(this.webpackChunktweb=this.webpackChunktweb||[]).push([[742],{5814:(e,t,i)=>{"use strict";i.d(t,{Z:()=>m});var s=i(5400),n=i(3512),a=i(4762),o=i(410),r=i(8487),d=i(3772),l=i(1655),c=i(7625),h=i(2586),u=i(3013),p=i(3035);const f=new class{constructor(){this.observer=new IntersectionObserver((e=>{for(const t of e){const e=t.target;for(const i in this.byGroups){if(this.intersectionLockedGroups[i])continue;const s=this.byGroups[i].find((t=>t.el===e));if(s){if(t.isIntersecting)this.visible.add(s),this.checkAnimation(s,!1);else{this.visible.delete(s),this.checkAnimation(s,!0);const e=s.animation;e instanceof d.Z&&e.clearCache()}break}}}})),this.visible=new Set,this.overrideIdleGroups=new Set,this.byGroups={},this.byPlayer=new Map,this.lockedGroups={},this.onlyOnePlayableGroup="",this.intersectionLockedGroups={},this.videosLocked=!1,u.Z.addEventListener("play",(({doc:e})=>{"round"===e.type&&(this.videosLocked=!0,this.checkAnimations2())})),u.Z.addEventListener("pause",(()=>{this.videosLocked&&(this.videosLocked=!1,this.checkAnimations2())})),h.Z.addEventListener("change",(e=>{this.checkAnimations2(e)}))}setOverrideIdleGroup(e,t){t?this.overrideIdleGroups.add(e):this.overrideIdleGroups.delete(e)}getAnimations(e){const t=[];for(const i in this.byGroups)for(const s of this.byGroups[i])s.el===e&&t.push(s);return t}removeAnimation(e){const{el:t,animation:i}=e;i instanceof HTMLVideoElement||i.remove(),i instanceof HTMLVideoElement&&a.IS_SAFARI&&setTimeout((()=>{i.src="",i.load()}),1e3);const s=this.byGroups[e.group];s&&((0,l.Z)(s,e),s.length||delete this.byGroups[e.group]),this.observer.unobserve(t),this.visible.delete(e),this.byPlayer.delete(i)}removeAnimationByPlayer(e){const t=this.byPlayer.get(e);t&&this.removeAnimation(t)}addAnimation(e){var t,i,a,o;let{animation:r,group:l="",observeElement:c,controlled:h,liteModeKey:u}=e;if("none"===l||this.byPlayer.has(r))return;c||(r instanceof d.Z?c=r.el[0]:r instanceof s.KZ?c=r.canvas:r instanceof s.LD?c=null!==(t=r.placeholder)&&void 0!==t?t:r:r instanceof HTMLElement&&(c=r));const p={el:c,animation:r,group:l,controlled:h,liteModeKey:u};h&&"boolean"!=typeof h&&h.onClean((()=>{this.removeAnimationByPlayer(r)})),r instanceof d.Z&&!n.Z.settings.stickers.loop&&r.loop&&(r.loop=n.Z.settings.stickers.loop),(null!==(i=(a=this.byGroups)[o=l])&&void 0!==i?i:a[o]=[]).push(p),this.observer.observe(p.el),this.byPlayer.set(r,p)}checkAnimations(e,t,i,s){if(void 0!==t&&!this.byGroups[t])return;const n=void 0!==t?[t]:Object.keys(this.byGroups);for(const t of n){if(s&&this.intersectionLockedGroups[t])continue;const n=this.byGroups[t];(0,c.Z)(n,(t=>{this.checkAnimation(t,e,i)}))}}checkAnimations2(e){this.checkAnimations(e,void 0,void 0,!0)}checkAnimation(e,t,i){const{el:s,animation:n,group:a}=e;i||!this.lockedGroups[a]&&!(0,r.Z)(s)?e.controlled&&!i||this.removeAnimation(e):t||this.onlyOnePlayableGroup&&this.onlyOnePlayableGroup!==a||n instanceof HTMLVideoElement&&this.videosLocked?n.paused||n.pause():!(n.paused&&this.visible.has(e)&&n.autoplay)||this.onlyOnePlayableGroup&&this.onlyOnePlayableGroup!==a||h.Z.isIdle&&!this.overrideIdleGroups.has(e.group)||n.play()}getOnlyOnePlayableGroup(){return this.onlyOnePlayableGroup}setOnlyOnePlayableGroup(e=""){this.onlyOnePlayableGroup=e}lockGroup(e){this.lockedGroups[e]=!0}unlockGroup(e){delete this.lockedGroups[e],this.checkAnimations(void 0,e)}refreshGroup(e){const t=this.byGroups[e];(null==t?void 0:t.length)&&(t.forEach((e=>{this.observer.unobserve(e.el)})),(0,p.T2)((()=>{t.forEach((e=>{this.observer.observe(e.el)}))})))}lockIntersectionGroup(e){this.intersectionLockedGroups[e]=!0}unlockIntersectionGroup(e){delete this.intersectionLockedGroups[e],this.refreshGroup(e)}toggleIntersectionGroup(e,t){t?this.lockIntersectionGroup(e):this.unlockIntersectionGroup(e)}setAutoplay(e,t){let i=!1;return this.byPlayer.forEach(((s,a)=>{s.liteModeKey===t&&(i=!0,a.autoplay=!!e&&!!+s.el.dataset.stickerPlay,a.loop=!!e&&!!+s.el.dataset.stickerLoop&&n.Z.settings.stickers.loop)})),i}setLoop(e){let t=!1;return this.byPlayer.forEach(((i,s)=>{+i.el.dataset.stickerLoop&&s.loop!==e&&(s instanceof d.Z||s instanceof HTMLVideoElement)&&(t=!0,s.loop=e,s.autoplay=!!+i.el.dataset.stickerPlay)})),t}};o.GO&&(o.GO.animationIntersector=f);const m=f},3013:(e,t,i)=>{"use strict";i.d(t,{Z:()=>L});var s=i(3512),n=i(3725),a=i(4762),o=i(410),r=i(6669),d=i(5432),l=i(2325),c=i(3719),h=i(8479),u=i(6848),p=i(3699),f=i(7530),m=i(493),g=i(2312),v=i(925),b=i(3241),y=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const w=(()=>{try{return a.IS_SAFARI&&+navigator.userAgent.match(/ Version\/(\d+)/)[1]<14}catch(e){return!1}})();class S extends b.Z{constructor(){super(...arguments),this.media=new Map,this.scheduled=new Map,this.mediaDetails=new Map,this.waitingMediaForLoad=new Map,this.waitingScheduledMediaForLoad=new Map,this.waitingDocumentsForLoad={},this.playbackRates={voice:1,video:1,audio:1},this.seekBackward=(e,t=this.playingMedia)=>{t&&(t.currentTime=Math.max(0,t.currentTime-(e.seekOffset||10)))},this.seekForward=(e,t=this.playingMedia)=>{t&&(t.currentTime=Math.min(t.duration,t.currentTime+(e.seekOffset||10)))},this.seekTo=(e,t=this.playingMedia)=>{t&&(t.currentTime=e.seekTime)},this.onMediaDocumentLoad=e=>y(this,void 0,void 0,(function*(){const t=this.mediaDetails.get(e),i=yield this.managers.appDocsManager.getDoc(t.docId);"audio"===i.type&&i.supportsStreaming&&w&&this.handleSafariStreamable(e);const s=yield this.managers.thumbsStorage.getCacheContext(i);e.src=s.url,this.playingMedia===e&&(e.playbackRate=this.playbackRate,"audio"===i.type&&(e.loop=this.loop));const n=this.waitingDocumentsForLoad[i.id];n&&(n.delete(e),n.size||delete this.waitingDocumentsForLoad[i.id])})),this.onPlay=e=>{const t=e.target,i=this.mediaDetails.get(t),{peerId:s,mid:n}=i,a=this.pip;a&&a.pause();const o=this.getMessageByMedia(t);if(this.playingMedia!==t){this.stop(),this.setMedia(t,o);const e=e=>e.mid===n&&e.peerId===s,i=this.listLoader,a=i.getCurrent();if(!a||!e(a)){let t;for(const s of[!1,!0]){const n=i.getPrevious(s);let a=n.findIndex(e);if(-1!==a?t=-(n.length-a):(a=i.getNext(s).findIndex(e),-1!==a&&(t=a+1)),void 0!==t)break}t?this.go(t,!1):this.setTargets({peerId:s,mid:n})}}setTimeout((()=>{this.playingMedia===t&&(this.dispatchEvent("play",this.getPlayingDetails()),this.pauseMediaInOtherTabs())}),0)},this.onPause=e=>{this.dispatchEvent("pause")},this.onEnded=e=>{if(e&&!e.isTrusted)return;this.onPause(e);const t=this.listLoader;!this.lockedSwitchers&&(this.round||!t.current||t.next.length)&&t.getNext(!0).length&&this.next()||(this.stop(),this.dispatchEvent("stop"))},this.play=()=>this.toggle(!0),this.pause=()=>this.toggle(!1),this.stop=(e=this.playingMedia,t)=>{if(!e)return!1;if(e.paused||e.pause(),e.currentTime=0,(0,r.Z)(e,"ended"),e===this.playingMedia){const t=this.mediaDetails.get(e);if(null==t?void 0:t.clean){e.src="";const i=t.peerId,s=t.isScheduled?this.scheduled:this.media,n=s.get(i);n&&(n.delete(t.mid),n.size||s.delete(i)),e.remove(),this.mediaDetails.delete(e)}this.playingMedia=void 0,this.playingMediaType=void 0}return t&&this.dispatchEvent("stop"),!0},this.playItem=e=>{const{peerId:t,mid:i}=e,s=this.searchContext.isScheduled;this.getMedia(t,i,s).play(),setTimeout((()=>{this.resolveWaitingForLoadMedia(t,i,s)}),0)},this.go=(e,t)=>{const i=this.listLoader;if(!this.lockedSwitchers&&i)return"audio"===this.playingMediaType?i.goRound(e,t):i.go(e,t)},this.browserPlay=this.bindBrowserCallback((e=>this.toggle(!0,e))),this.browserPause=this.bindBrowserCallback((e=>this.toggle(!1,e))),this.browserStop=this.bindBrowserCallback((e=>this.stop(e))),this.browserSeekBackward=this.bindBrowserCallback(((e,t)=>this.seekBackward(t,e))),this.browserSeekForward=this.bindBrowserCallback(((e,t)=>this.seekForward(t,e))),this.browserSeekTo=this.bindBrowserCallback(((e,t)=>this.seekTo(t,e))),this.browserNext=this.bindBrowserCallback((e=>e||this.next())),this.browserPrevious=this.bindBrowserCallback((e=>e?this.seekToStart(e):this.previous())),this.next=()=>this.go(1),this.previous=()=>{if(!this.seekToStart(this.playingMedia))return this.go(-1)}}construct(e){if(this.managers=e,this.container=document.createElement("div"),this.container.style.cssText="display: none;",document.body.append(this.container),navigator.mediaSession){const e={play:this.browserPlay,pause:this.browserPause,stop:this.browserStop,seekbackward:this.browserSeekBackward,seekforward:this.browserSeekForward,seekto:this.browserSeekTo,previoustrack:this.browserPrevious,nexttrack:this.browserNext};for(const t in e)try{navigator.mediaSession.setActionHandler(t,e[t])}catch(e){console.warn("MediaSession action is not supported:",t)}}s.Z.addEventListener("document_downloaded",(e=>{const t=this.waitingDocumentsForLoad[e];if(t)for(const e of t)this.onMediaDocumentLoad(e)})),s.Z.addEventListener("media_play",(()=>{this.skipMediaPlayEvent?this.skipMediaPlayEvent=!1:!this.pause()&&this.pip&&this.pip.pause()}));const t={};["volume","muted","playbackRate","loop","round"].forEach((e=>{const i="_"+e;t[e]={get:()=>this[i],set:t=>{this[i]!==t&&(this[i]=t,!this.playingMedia||"loop"===e&&"audio"!==this.playingMediaType||"round"===e||(this.playingMedia[e]=t),"playbackRate"===e&&void 0!==this.playingMediaType&&(this.playbackRates[this.playingMediaType]=t),this.dispatchPlaybackParams())}}})),Object.defineProperties(this,t)}dispatchPlaybackParams(){this.dispatchEvent("playbackParams",this.getPlaybackParams())}getPlaybackParams(){const{volume:e,muted:t,playbackRate:i,playbackRates:s,loop:n,round:a}=this;return{volume:e,muted:t,playbackRate:i,playbackRates:s,loop:n,round:a}}setPlaybackParams(e){this.playbackRates=e.playbackRates,this._volume=e.volume,this._muted=e.muted,this._playbackRate=e.playbackRate,this._loop=e.loop,this._round=e.round}addMedia(e,t,i){const{peerId:a,mid:o}=e,r=e.pFlags.is_scheduled?this.scheduled:this.media;let d=r.get(e.peerId);d||r.set(e.peerId,d=new Map);let l=d.get(o);if(l)return l;const c=(0,f.Z)(e,!0);d.set(o,l=document.createElement("round"===c.type||"video"===c.type?"video":"audio")),"round"===c.type&&l.setAttribute("playsinline","true");const h={peerId:a,mid:o,docId:c.id,doc:c,message:e,clean:i,isScheduled:e.pFlags.is_scheduled};this.mediaDetails.set(l,h),l.volume=1,this.container.append(l),l.addEventListener("play",this.onPlay),l.addEventListener("pause",this.onPause),l.addEventListener("ended",this.onEnded),"audio"!==c.type&&(null==e?void 0:e.pFlags.media_unread)&&e.fromId!==s.Z.myId&&l.addEventListener("timeupdate",(()=>{this.managers.appMessagesManager.readMessages(a,[o])}),{once:!0});const u=(0,n.Z)();if(t)u.resolve();else{const t=e.pFlags.is_scheduled?this.waitingScheduledMediaForLoad:this.waitingMediaForLoad;let i=t.get(a);i||t.set(a,i=new Map),i.set(o,u)}return u.then((()=>y(this,void 0,void 0,(function*(){if(c.supportsStreaming||(yield this.managers.thumbsStorage.getCacheContext(c)).url)this.onMediaDocumentLoad(l);else{let e=this.waitingDocumentsForLoad[c.id];e||(e=this.waitingDocumentsForLoad[c.id]=new Set),e.add(l),g.Z.downloadMediaURL({media:c})}})))),l}getMedia(e,t,i){const s=(i?this.scheduled:this.media).get(e);return null==s?void 0:s.get(t)}handleSafariStreamable(e){e.addEventListener("play",(()=>{const t=e.currentTime;e.addEventListener("progress",(()=>{e.currentTime=e.duration-1,e.addEventListener("progress",(()=>{e.currentTime=t,e.paused||e.play()}),{once:!0})}),{once:!0})}))}resolveWaitingForLoadMedia(e,t,i){const s=i?this.waitingScheduledMediaForLoad:this.waitingMediaForLoad,n=s.get(e);if(!n)return;const a=n.get(t);a&&(a.resolve(),n.delete(t),n.size||s.delete(e))}isSafariBuffering(e){return!!e.safariBuffering}setSafariBuffering(e,t){e.safariBuffering=t}setNewMediadata(e,t=this.playingMedia){var i,s;return y(this,void 0,void 0,(function*(){if(document.pictureInPictureElement)return;yield(0,v.Z)(t,void 0,!1);const n=(0,f.Z)(e,!0),o=[],r="voice"===n.type||"round"===n.type;let c="",h="";if(null===(i=n.thumbs)||void 0===i?void 0:i.length){const i=n.thumbs[n.thumbs.length-1];if(!i.bytes){const s=yield this.managers.thumbsStorage.getCacheContext(n,i.type);s.url?o.push({src:s.url,sizes:`${i.w}x${i.h}`,type:"image/jpeg"}):g.Z.downloadMediaURL({media:n,thumb:i}).then((()=>{this.playingMedia===t&&s.url&&this.setNewMediadata(e)}))}}else if(r){const t=e.fromId||e.peerId;yield this.managers.appPeersManager.getPeerPhoto(t),c=yield(0,m.Z)({peerId:t,plainText:!0,onlyFirstName:!1}),h=l.ZP.format("voice"===n.type?"AttachAudio":"AttachRound",!0)}if(!r){const e=n.attributes.find((e=>"documentAttributeAudio"===e._));c=null!==(s=null==e?void 0:e.title)&&void 0!==s?s:n.file_name,h=null==e?void 0:e.performer}o.length||(a.IS_APPLE?d.Z?o.push({src:"assets/img/apple-touch-icon-precomposed.png",sizes:"180x180",type:"image/png"}):o.push({src:"assets/img/apple-touch-icon.png",sizes:"180x180",type:"image/png"}):[72,96,144,192,256,384,512].forEach((e=>{const t=`${e}x${e}`;o.push({src:`assets/img/android-chrome-${t}.png`,sizes:t,type:"image/png"})})));const u=new MediaMetadata({title:c,artist:h,artwork:o});navigator.mediaSession.metadata=u}))}setCurrentMediadata(){const{playingMedia:e}=this;if(!e)return;const t=this.getMessageByMedia(e);this.setNewMediadata(t,e)}getMessageByMedia(e){return this.mediaDetails.get(e).message}getPlayingDetails(){const{playingMedia:e}=this;if(!e)return;const t=this.getMessageByMedia(e);return{doc:(0,f.Z)(t,!0),message:t,media:e,playbackParams:this.getPlaybackParams()}}pauseMediaInOtherTabs(){this.skipMediaPlayEvent=!0,s.Z.dispatchEvent("media_play")}toggle(e,t=this.playingMedia){return!!t&&(void 0===e&&(e=t.paused),t.paused===e&&(e?t.play():t.pause(),!0))}bindBrowserCallback(e){return t=>{e(this.pip,t)}}seekToStart(e){return(null==e?void 0:e.currentTime)>5&&(e.currentTime=0,this.toggle(!0,e),!0)}willBePlayed(e){this.willBePlayedMedia=e}setSearchContext(e){return!(0,u.Z)(this.searchContext,e)&&(this.searchContext=(0,h.Z)(e),!0)}getSearchContext(){return this.searchContext}setTargets(e,t,i){let s=this.listLoader;s?s.reset():s=this.listLoader=new c.Z({loadCount:10,loadWhenLeft:5,processItem:e=>(this.addMedia(e,!1),{peerId:e.peerId,mid:e.mid}),onJump:(e,t)=>{this.playItem(e)},onEmptied:()=>{this.dispatchEvent("stop"),this.stop()}});const n=void 0===this.searchContext.folderId;t?s.setTargets(t,i,n):s.reverse=n,s.setSearchContext(this.searchContext),s.current=e,s.load(!0),s.load(!1)}getPlaybackMediaTypeFromMessage(e){const t=(0,f.Z)(e,!0);let i="audio";return(null==t?void 0:t.type)&&("voice"===t.type||"round"===t.type?i="voice":"video"===t.type&&(i="video")),i}setMedia(e,t){const i=this.getPlaybackMediaTypeFromMessage(t);this._playbackRate=this.playbackRates[i],this.playingMedia=e,this.playingMediaType=i,this.playingMedia.volume=this.volume,this.playingMedia.muted=this.muted,this.playingMedia.playbackRate=this.playbackRate,"audio"===i&&(this.playingMedia.loop=this.loop),"mediaSession"in navigator&&this.setNewMediadata(t)}setSingleMedia(e,t){const i=this.playingMedia,s=this.pause();let n;return e?(n=()=>{const e=this.pip;e&&e.pause(),this.pauseMediaInOtherTabs()},e.paused||n(),e.addEventListener("play",n)):this.pauseMediaInOtherTabs(),this.willBePlayed(void 0),e?this.setMedia(e,t):this.playingMedia=void 0,this.toggleSwitchers(!1),(t=s)=>{this.toggleSwitchers(!0),i&&(this.mediaDetails.get(i)?this.setMedia(i,this.getMessageByMedia(i)):this.next()||this.previous()),this.playingMedia===e&&(this.playingMedia=void 0,this.playingMediaType=void 0),e&&e.removeEventListener("play",n),t&&this.play()}}toggleSwitchers(e){this.lockedSwitchers=!e}setPictureInPicture(e){this.pip=e;const t=new p.Z;t.add(e)("leavepictureinpicture",(()=>{this.pip===e&&(this.pip=void 0,t.removeAll())}),{once:!0}),t.add(e)("play",(t=>{this.playingMedia!==e&&this.pause(),this.pauseMediaInOtherTabs()}))}}const C=new S;o.GO.appMediaPlaybackController=C;const L=C},1784:(e,t,i)=>{"use strict";i.d(t,{Z:()=>L});var s=i(2341),n=i(3910),a=i(2738),o=i(8497),r=i(4668),d=i(130),l=i(4755),c=i(3719),h=i(2312),u=i(6219),p=i(3709),f=i(7530),m=i(5400),g=i(8544),v=i(5128),b=i(4524),y=i(8805),w=i(4332),S=i(1669),C=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class L extends g.Z{get searchContext(){return this.listLoader.searchContext}constructor(){let e;super(new c.Z({processItem:e=>{const t="inputMessagesFilterDocument"===this.searchContext.inputFilter._,{mid:i,peerId:s}=e,n=(0,f.Z)(e,!0);if(n&&(!t||L.isMediaCompatibleForDocumentViewer(n)))return{element:null,mid:i,peerId:s}}}),["delete","forward"]),this.onPrevClick=e=>C(this,void 0,void 0,(function*(){this.openMedia({message:yield this.getMessageByPeer(e.peerId,e.mid),target:e.element,fromRight:-1})})),this.onNextClick=e=>C(this,void 0,void 0,(function*(){this.openMedia({message:yield this.getMessageByPeer(e.peerId,e.mid),target:e.element,fromRight:1})})),this.onDeleteClick=()=>{const e=this.target;new v.Z(e.peerId,[e.mid],"chat",(()=>{this.target={element:this.content.media},this.close()}))},this.onForwardClick=()=>{const e=this.target;e.mid&&new b.Z({[e.peerId]:[e.mid]},(()=>this.close()))},this.onAuthorClick=e=>C(this,void 0,void 0,(function*(){const{mid:t,peerId:i}=this.target;if(t&&t!==Number.MAX_SAFE_INTEGER){const s=this.searchContext.threadId,n=yield this.getMessageByPeer(i,t);this.close(e).then((()=>C(this,void 0,void 0,(function*(){if(l.Z.isMobile){const e=w.ZP.getTab(S.Z);e&&e.close()}u.ZP.setInnerPeer({peerId:n.peerId,lastMsgId:t,type:s?"discussion":void 0,threadId:s})}))))}})),this.onDownloadClick=()=>{const{message:e}=this.target,t=(0,f.Z)(e,!0);t&&h.Z.downloadToDisc({media:t,queueId:u.ZP.chat.bubbles.lazyLoadQueue.queueId})},this.listLoader.onEmptied=()=>{this.close()},this.content.caption=document.createElement("div"),this.content.caption.classList.add(g.x+"-caption","spoilers-container");const t=()=>{e&&clearTimeout(e),e=window.setTimeout((()=>{e=void 0,this.content.caption.classList.remove("is-focused")}),800)};this.content.caption.addEventListener("touchstart",(()=>{l.Z.isMobile&&(this.content.caption.classList.add("is-focused"),e&&(clearTimeout(e),e=void 0),document.addEventListener("touchend",t,{once:!0}))})),new y.ZP(this.content.caption).onAdditionalScroll=t,this.wholeDiv.append(this.content.caption),(0,a.fc)(this.buttons.delete,this.onDeleteClick);const i=[this.btnMenuForward={icon:"forward",text:"Forward",onClick:this.onForwardClick},this.btnMenuDownload={icon:"download",text:"MediaViewer.Context.Download",onClick:this.onDownloadClick},this.btnMenuDelete={icon:"delete danger",text:"Delete",onClick:this.onDeleteClick}];this.setBtnMenuToggle(i),this.setListeners()}setListeners(){super.setListeners(),(0,a.fc)(this.buttons.forward,this.onForwardClick),(0,a.fc)(this.author.container,this.onAuthorClick);const e=t=>{const i=(0,r.Z)(t.target,"A");if(i.classList.contains("timestamp"))return;const s=(0,o.Z)(t.target,"spoiler");if(i instanceof HTMLAnchorElement&&(!s||this.content.caption.classList.contains("is-spoiler-visible"))){const s=i.getAttribute("onclick");if(!s||s.includes("showMaskedAlert"))return;return(0,n.Z)(t),this.close().then((()=>{this.content.caption.removeEventListener("click",e,{capture:!0}),i.click()})),!1}};this.content.caption.addEventListener("click",e,{capture:!0})}getMessageByPeer(e,t){return this.searchContext.isScheduled?this.managers.appMessagesManager.getScheduledMessageByPeer(e,t):this.managers.appMessagesManager.getMessageByPeer(e,t)}setCaption(e){const t=e.message;let i="";if(t){const s=(0,f.Z)(e,!0);i=(0,m.ZP)(t,{entities:e.totalEntities,maxMediaTimestamp:"video"===(null==s?void 0:s.type)&&s.duration||void 0})}(0,d.Z)(this.content.caption.firstElementChild,i),this.content.caption.classList.toggle("hide",!t)}setSearchContext(e){return this.listLoader.setSearchContext(e),this}openMedia({message:e,target:t,fromRight:i=0,reverse:s=!1,prevTargets:n=[],nextTargets:a=[],mediaTimestamp:o}){const r=Object.create(null,{_openMedia:{get:()=>super._openMedia}});return C(this,void 0,void 0,(function*(){if(this.setMoverPromise)return this.setMoverPromise;const d=e.mid,l=e.fwd_from&&!e.fromId?e.fwd_from.from_name:e.fromId,c=(0,f.Z)(e,!0),h=yield this.managers.appPeersManager.noForwards(e.peerId),u="messageService"===e._,m=u||!(yield this.managers.appMessagesManager.canForward(e)),g=(u?h:m)||!(0,p.Z)(e);[[[this.buttons.forward,this.btnMenuForward],m],[[this.buttons.download,this.btnMenuDownload],g],[[this.buttons.delete,this.btnMenuDelete],!(yield this.managers.appMessagesManager.canDeleteMessage(e))]].forEach((([e,t])=>{e.forEach((e=>{e instanceof HTMLElement?e.classList.toggle("hide",t):e.verify=()=>!t}))})),this.wholeDiv.classList.toggle("no-forwards",g),this.setCaption(e);const v=r._openMedia.call(this,{media:c,timestamp:e.date,fromId:l,fromRight:i,target:t,reverse:s,prevTargets:n,nextTargets:a,message:e,mediaTimestamp:o});return this.target.mid=d,this.target.peerId=e.peerId,this.target.message=e,v}))}static isMediaCompatibleForDocumentViewer(e){return"photo"===e._||s.Z.has(e.mime_type)}}},8544:(e,t,i)=>{"use strict";i.d(t,{x:()=>te,Z:()=>ie});var s=i(3725),n=i(4755),a=i(5432),o=i(4762),r=i(5003),d=i(3013),l=i(3910),c=i(3699),h=i(3003),u=i(5322),p=i(7529),f=i(6733),m=i(5157),g=i(7207),v=i(8427),b=i(5701),y=i(3815),w=i(925),S=i(2738);class C extends p.Z{constructor({video:e,play:t=!1,streamable:i=!1,duration:s,onPlaybackRackMenuToggle:n,onPip:a,onPipClose:o}){if(super(),this.video=e,this.wrapper=document.createElement("div"),this.wrapper.classList.add("ckin__player"),this.onPlaybackRackMenuToggle=n,this.onPip=a,this.onPipClose=o,this.listenerSetter=new c.Z,this.setup({element:this.wrapper,listenerSetter:this.listenerSetter,canHideControls:()=>!(this.video.paused||this.playbackRateButton&&this.playbackRateButton.classList.contains("menu-open")),showOnLeaveToClassName:"media-viewer-caption",ignoreClickClassName:"ckin__controls"}),e.parentNode.insertBefore(this.wrapper,e),this.wrapper.appendChild(e),this.skin="default",this.stylePlayer(s),this.setBtnMenuToggle(),"default"===this.skin){const t=this.wrapper.querySelector(".default__controls.ckin__controls");this.progress=new g.Z({onSeekStart:()=>{this.wrapper.classList.add("is-seeking")},onSeekEnd:()=>{this.wrapper.classList.remove("is-seeking")}}),this.progress.setMedia({media:e,streamable:i,duration:s}),t.prepend(this.progress.container)}t&&e.play().catch((t=>{"NotAllowedError"===t.name&&(e.muted=!0,e.autoplay=!0,e.play())})).finally((()=>{this.wrapper.classList.toggle("is-playing",!this.video.paused)}))}stylePlayer(e){const{wrapper:t,video:i,skin:s,listenerSetter:n}=this;t.classList.add(s);const o=this.buildControls();let r;if(t.insertAdjacentHTML("beforeend",o),"default"===s){this.playbackRateButton=this.wrapper.querySelector(".playback-rate"),this.pipButton=this.wrapper.querySelector(".pip");const e=t.querySelectorAll(".toggle"),s=t.querySelector(".fullscreen"),o=t.querySelector("#time-elapsed");r=t.querySelector("#time-duration"),r.textContent=(0,m.Z)(0|i.duration);const c=new v.Z(n),h=t.querySelector(".left-controls");if(c.btn.classList.remove("btn-icon"),h.insertBefore(c.btn,o.parentElement),Array.from(e).forEach((e=>{(0,S.fc)(e,(()=>{this.togglePlay()}),{listenerSetter:this.listenerSetter})})),this.pipButton){(0,S.fc)(this.pipButton,(()=>{this.video.requestPictureInPicture()}),{listenerSetter:this.listenerSetter});const e=e=>{this.wrapper.style.visibility=e?"hidden":"",this.onPip&&this.onPip(e)},t=20,s=(0,b.Z)(e,t,!1,!0);n.add(i)("enterpictureinpicture",(()=>{s(!0),n.add(i)("leavepictureinpicture",(()=>{const e=n.add(i)("pause",(()=>{clearTimeout(s),this.onPipClose&&this.onPipClose()}),{once:!0}),s=setTimeout((()=>{n.remove(e)}),t)}),{once:!0})})),n.add(i)("leavepictureinpicture",(()=>{s(!1)}))}a.Z||((0,S.fc)(i,(()=>{this.togglePlay()}),{listenerSetter:this.listenerSetter}),n.add(document)("keydown",(e=>{if(y.Z.overlaysActive>1||document.pictureInPictureElement===i)return;const{key:s,code:n}=e;let a=!0;if("KeyF"===n)this.toggleFullScreen();else if("KeyM"===n)d.Z.muted=!d.Z.muted;else if("Space"===n)this.togglePlay();else if(!e.altKey||"Equal"!==n&&"Minus"!==n)!t.classList.contains("ckin__fullscreen")||"ArrowLeft"!==s&&"ArrowRight"!==s?a=!1:"ArrowLeft"===s?d.Z.seekBackward({action:"seekbackward"}):d.Z.seekForward({action:"seekforward"});else{const e="Equal"===n?1:-1,t=d.Z.playbackRate,i=C.PLAYBACK_RATES.indexOf(t)+e;i>=0&&i{a.Z||this.toggleFullScreen()})),(0,S.fc)(s,(()=>{this.toggleFullScreen()}),{listenerSetter:this.listenerSetter}),(0,f.Ms)(t,this.onFullScreen.bind(this,s),n),n.add(i)("timeupdate",(()=>{o.textContent=(0,m.Z)(0|i.currentTime)})),n.add(i)("play",(()=>{t.classList.add("played"),a.Z||n.add(i)("play",(()=>{this.hideControls(!0)}))}),{once:!0}),n.add(i)("pause",(()=>{this.showControls(!1)})),n.add(d.Z)("playbackParams",(()=>{this.setPlaybackRateIcon()}))}n.add(i)("play",(()=>{t.classList.add("is-playing")})),n.add(i)("pause",(()=>{t.classList.remove("is-playing")})),i.duration||e?r.textContent=(0,m.Z)(Math.round(i.duration||e)):(0,w.Z)(i).then((()=>{r.textContent=(0,m.Z)(Math.round(i.duration))}))}togglePlay(e=this.video.paused){this.video[e?"play":"pause"]()}buildControls(){const e=this.skin;if("default"===e)return`\n \n
\n
\n
\n
\n \n
\n \n / \n \n
\n
\n
\n \n ${!o.IS_MOBILE&&document.pictureInPictureEnabled?``:""}\n \n
\n
\n
`}setBtnMenuToggle(){const e=C.PLAYBACK_RATES.map(((e,t)=>({regularText:e+"x",onClick:()=>{d.Z.playbackRate=e}}))),t=(0,h.b)({buttons:e});t.classList.add("top-left"),(0,u.v)({el:this.playbackRateButton,onOpen:this.onPlaybackRackMenuToggle?()=>{this.onPlaybackRackMenuToggle(!0)}:void 0,onClose:this.onPlaybackRackMenuToggle?()=>{this.onPlaybackRackMenuToggle(!1)}:void 0}),this.playbackRateButton.append(t),this.setPlaybackRateIcon()}setPlaybackRateIcon(){const e=this.playbackRateButton;C.PLAYBACK_RATES_ICONS.forEach((t=>{t="tgico-"+t,e.classList.remove(t)}));let t=C.PLAYBACK_RATES.indexOf(d.Z.playbackRate);-1===t&&(t=C.PLAYBACK_RATES.indexOf(1)),e.classList.add("tgico-"+C.PLAYBACK_RATES_ICONS[t])}toggleFullScreen(){const e=this.wrapper;if(o.IS_APPLE_MOBILE){const e=this.video;return e.webkitEnterFullscreen(),void e.enterFullscreen()}(0,f.rB)()?(0,f.C8)():(0,f.Dj)(e)}onFullScreen(e){const t=(0,f.rB)();this.wrapper.classList.toggle("ckin__fullscreen",t),t?(e.classList.remove("tgico-fullscreen"),e.classList.add("tgico-smallscreen"),e.setAttribute("title","Exit Full Screen")):(e.classList.remove("tgico-smallscreen"),e.classList.add("tgico-fullscreen"),e.setAttribute("title","Full Screen"))}setTimestamp(e){this.video.currentTime=e,this.togglePlay(!0)}cleanup(){super.cleanup(),this.listenerSetter.removeAll(),this.progress.removeListeners(),this.onPlaybackRackMenuToggle=this.onPip=void 0}}C.PLAYBACK_RATES=[.5,1,1.5,2],C.PLAYBACK_RATES_ICONS=["playback_05","playback_1x","playback_15","playback_2x"];var L=i(3512),E=i(5814),I=i(9331),M=i(2230),Z=i(3442),P=i(3757),T=i(632),k=i(5824),x=i(8497),A=i(6740),_=i(8204),F=i(9171),D=i(5565),R=i(3035),B=i(65),N=i(241),O=i(3241),U=i(1507),H=i(7660),z=i(8580),j=i(1713),G=i(8115),V=i(4421),K=i(2312),W=i(7362),$=i(2796),q=i(3228);function Y(e,t,i){return e>=t&&e<=i}var Q=i(5975),X=i(5994),J=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const ee=.5,te="media-viewer";class ie extends O.Z{get target(){return this.listLoader.current}set target(e){this.listLoader.current=e}constructor(e,t){super(!1),this.listLoader=e,this.author={},this.content={},this.buttons={},this.tempId=0,this.preloader=null,this.preloaderStreamable=null,this.isFirstOpen=!0,this.pageEl=document.getElementById("page-chats"),this.zoomElements={},this.transform={x:0,y:0,scale:1},this.lastTransform=this.transform,this.lastZoomCenter=this.transform,this.lastDragOffset=this.transform,this.lastDragDelta=this.transform,this.onSwipeFirst=e=>{this.lastDragOffset=this.lastDragDelta={x:0,y:0},this.lastTransform=Object.assign({},this.transform),"wheel"===(null==e?void 0:e.type)&&this.ctrlKeyDown||(this.moversContainer.classList.add("no-transition"),this.zoomElements.rangeSelector.container.classList.remove("with-transition")),this.isGesturingNow=!0,this.lastGestureTime=Date.now(),this.clampZoomDebounced.clearTimeout(),this.lastTransform.x||this.lastTransform.y||this.isZooming||(this.initialContentRect=this.content.media.getBoundingClientRect())},this.onSwipeReset=e=>{this.moversContainer.classList.remove("no-transition"),this.zoomElements.rangeSelector.container.classList.add("with-transition"),this.clampZoomDebounced.clearTimeout(),"mouseup"===(null==e?void 0:e.type)&&"mousemove"===this.draggingType&&(this.ignoreNextClick=!0);const{draggingType:t}=this;if(this.isZoomingNow=!1,this.isGesturingNow=!1,this.draggingType=void 0,!this.closing)if(this.transform.scale>1){const e=Math.min(this.transform.scale,4),i=e/this.transform.scale;let s=this.transform.x*i+(this.lastZoomCenter.x-i*this.lastZoomCenter.x),n=this.transform.y*i+(this.lastZoomCenter.y-i*this.lastZoomCenter.y);if(t&&"wheel"!==t&&this.lastTransform.scale===this.transform.scale){const e=.1,t=Math.max(1,Date.now()-this.lastGestureTime),i=Math.abs(this.lastDragOffset.x)/t,a=Math.abs(this.lastDragOffset.y)/t;s-=Math.abs(this.lastDragOffset.x)*i*e*-this.lastDragDelta.x,n-=Math.abs(this.lastDragOffset.y)*a*e*-this.lastDragDelta.y}const[a]=this.calculateOffsetBoundaries({x:s,y:n,scale:e});this.lastTransform=a,this.setTransform(a)}else this.transform.scale<1&&this.resetZoom()},this.onZoom=({initialCenterX:e,initialCenterY:t,zoom:i,zoomAdd:s,currentCenterX:n,currentCenterY:a,dragOffsetX:o,dragOffsetY:r,zoomFactor:d})=>{e||(e=N.Z.width/2),t||(t=N.Z.height/2),n||(n=N.Z.width/2),a||(a=N.Z.height/2),this.isZoomingNow=!0;const l=void 0!==s?(0,q.Z)(this.lastTransform.scale+s,ee,12):null!=i?i:(0,q.Z)(this.lastTransform.scale*d,ee,12),c=l/this.lastTransform.scale,h=Math.abs(Math.min(this.lastTransform.x,0)),u=Math.abs(Math.min(this.lastTransform.y,0));this.lastZoomCenter={x:n,y:a};const p=h+e,f=u+t,{scaleOffsetX:m,scaleOffsetY:g}=this.calculateScaleOffset({x:p,y:f,scale:c}),[v]=this.calculateOffsetBoundaries({x:this.lastTransform.x+m+o,y:this.lastTransform.y+g+r,scale:l});this.setTransform(v)},this.calculateOffsetBoundaries=({x:e,y:t,scale:i},s=0)=>{if(!this.initialContentRect)return[{x:e,y:t,scale:i},!0,!0];let n=!0,a=!0;const{minX:o,maxX:r,minY:d,maxY:l}=this.getZoomBoundaries(i,s);return n=Y(e,r,o),e=(0,q.Z)(e,r,o),a=Y(t,l,d),[{x:e,y:t=(0,q.Z)(t,l,d),scale:i},n,a]},this.setZoomValue=(e=this.transform.scale)=>{var t;null!==(t=this.initialContentRect)&&void 0!==t||(this.initialContentRect=this.content.media.getBoundingClientRect()),1===e&&(this.transform.x=0,this.transform.y=0),this.moversContainer.style.transform=`translate3d(${this.transform.x.toFixed(3)}px, ${this.transform.y.toFixed(3)}px, 0px) scale(${e.toFixed(3)})`,this.zoomElements.btnOut.classList.toggle("inactive",e<=ee),this.zoomElements.btnIn.classList.toggle("inactive",e>=4),this.toggleZoom(1!==e)},this.onClick=e=>{if(this.ignoreNextClick)return void(this.ignoreNextClick=void 0);if(this.setMoverAnimationPromise)return;const t=e.target;if("A"===t.tagName)return;if((0,l.Z)(e),a.Z)return this.highlightSwitchersTimeout?clearTimeout(this.highlightSwitchersTimeout):this.wholeDiv.classList.add("highlight-switchers"),void(this.highlightSwitchersTimeout=window.setTimeout((()=>{this.wholeDiv.classList.remove("highlight-switchers"),this.highlightSwitchersTimeout=0}),3e3));if((0,S.Cf)(e))return;const i=this.isZooming&&!1;let s=null;const n=["ckin__player","media-viewer-buttons","media-viewer-author","media-viewer-caption","zoom-container"];i&&n.push("media-viewer-movers"),n.find((e=>{try{if(s=(0,x.Z)(t,e),s)return!0}catch(e){return!1}})),s&&(i||"IMG"!==t.tagName&&"image"!==t.tagName)||this.close()},this.onKeyDown=e=>{if(y.Z.overlaysActive>1)return;const t=e.key;let i=!0;"ArrowRight"===t?!this.isZooming&&this.buttons.next.click():"ArrowLeft"===t?!this.isZooming&&this.buttons.prev.click():"-"===t||"="===t?this.ctrlKeyDown&&this.addZoomStep("="===t):i=!1,(e.ctrlKey||e.metaKey)&&(this.ctrlKeyDown=!0),i&&(0,l.Z)(e)},this.onKeyUp=e=>{y.Z.overlaysActive>1||e.ctrlKey||e.metaKey||(this.ctrlKeyDown=!1,this.isZooming&&this.setZoomValue())},this.managers=L.Z.managers,this.log=(0,r.kg)("AMV"),this.preloader=new Z.Z,this.preloaderStreamable=new Z.Z({cancelable:!1,streamable:!0}),this.preloader.construct(),this.preloaderStreamable.construct(),this.lazyLoadQueue=new V.Z,this.wholeDiv=document.createElement("div"),this.wholeDiv.classList.add(te+"-whole"),this.overlaysDiv=document.createElement("div"),this.overlaysDiv.classList.add("overlays");const i=document.createElement("div");i.classList.add(te);const s=this.topbar=document.createElement("div");s.classList.add(te+"-topbar",te+"-appear");const n=document.createElement("div");n.classList.add(te+"-topbar-left"),this.buttons["mobile-close"]=(0,M.Z)("close",{onlyMobile:!0}),this.author.container=document.createElement("div"),this.author.container.classList.add(te+"-author","no-select");const o=document.createElement("div");this.author.avatarEl=new I.Z,this.author.avatarEl.classList.add(te+"-userpic","avatar-44"),this.author.nameEl=document.createElement("div"),this.author.nameEl.classList.add(te+"-name"),this.author.date=document.createElement("div"),this.author.date.classList.add(te+"-date"),o.append(this.author.nameEl,this.author.date),this.author.container.append(this.author.avatarEl,o);const d=document.createElement("div");d.classList.add(te+"-buttons"),t.concat(["download","zoom","close"]).forEach((e=>{const t=(0,M.Z)(e,{noRipple:!0});this.buttons[e]=t,d.append(t)})),this.buttons.zoom.classList.add("zoom-in"),this.zoomElements.container=document.createElement("div"),this.zoomElements.container.classList.add("zoom-container"),this.zoomElements.btnOut=(0,M.Z)("zoomout",{noRipple:!0}),(0,S.fc)(this.zoomElements.btnOut,(()=>this.addZoomStep(!1))),this.zoomElements.btnIn=(0,M.Z)("zoomin",{noRipple:!0}),(0,S.fc)(this.zoomElements.btnIn,(()=>this.addZoomStep(!0))),this.zoomElements.rangeSelector=new B.Z({step:.01,min:ee,max:4,withTransition:!0},1),this.zoomElements.rangeSelector.setListeners(),this.zoomElements.rangeSelector.setHandlers({onScrub:e=>{var t;const i=e-this.transform.scale;this.addZoom(i),null===(t=this.clampZoomDebounced)||void 0===t||t.clearTimeout()},onMouseDown:()=>{this.onSwipeFirst()},onMouseUp:()=>{this.onSwipeReset()}}),this.zoomElements.container.append(this.zoomElements.btnOut,this.zoomElements.rangeSelector.container,this.zoomElements.btnIn),a.Z||this.wholeDiv.append(this.zoomElements.container),this.content.main=document.createElement("div"),this.content.main.classList.add(te+"-content"),this.content.container=document.createElement("div"),this.content.container.classList.add(te+"-container"),this.content.media=document.createElement("div"),this.content.media.classList.add(te+"-media"),this.content.container.append(this.content.media),this.content.main.append(this.content.container),i.append(this.content.main),this.overlaysDiv.append(i),n.append(this.buttons["mobile-close"],this.author.container),s.append(n,d),this.buttons.prev=document.createElement("div"),this.buttons.prev.className=`${te}-switcher ${te}-switcher-left`,this.buttons.prev.innerHTML=``,this.buttons.next=document.createElement("div"),this.buttons.next.className=`${te}-switcher ${te}-switcher-right`,this.buttons.next.innerHTML=``,this.moversContainer=document.createElement("div"),this.moversContainer.classList.add(te+"-movers"),this.moversContainer.append(this.buttons.prev,this.buttons.next),this.wholeDiv.append(this.overlaysDiv,this.topbar,this.moversContainer),this.listLoader.onLoadedMore=()=>{this.buttons.prev.classList.toggle("hide",!this.listLoader.previous.length),this.buttons.next.classList.toggle("hide",!this.listLoader.next.length)},this.setNewMover()}setListeners(){(0,S.fc)(this.buttons.download,this.onDownloadClick),[this.buttons.close,this.buttons["mobile-close"],this.preloaderStreamable.preloader].forEach((e=>{(0,S.fc)(e,this.close.bind(this))})),[[-1,this.buttons.prev],[1,this.buttons.next]].forEach((([e,t])=>{t.addEventListener("click",(t=>{(0,l.Z)(t),this.setMoverPromise||this.listLoader.go(e)}))})),(0,S.fc)(this.buttons.zoom,(()=>{this.isZooming?this.resetZoom():this.addZoomStep(!0)})),this.wholeDiv.addEventListener("click",this.onClick),this.listLoader.onJump=(e,t)=>{t?this.onNextClick(e):this.onPrevClick(e)};const e=(e,t)=>{const[i,s]=[e-this.lastDragOffset.x,t-this.lastDragOffset.y],[n,a,o]=this.calculateOffsetBoundaries({x:this.transform.x+i,y:this.transform.y+s,scale:this.transform.scale});return this.lastDragDelta={x:i,y:s},this.lastDragOffset={x:e,y:t},this.setTransform(n),{inBoundsX:a,inBoundsY:o}},t=(0,b.Z)((()=>{this.lastGestureTime=Date.now()}),500,!1,!0);this.clampZoomDebounced=(0,b.Z)((()=>{this.onSwipeReset()}),300,!1,!0),this.swipeHandler=new P.Z({element:this.wholeDiv,onReset:this.onSwipeReset,onFirstSwipe:this.onSwipeFirst,onSwipe:(i,s,n,o)=>{if(!(0,f.rB)())if(!this.isZooming||this.isZoomingNow){if(!this.isZoomingNow&&a.Z)return Math.abs(i)/N.Z.width>.2||Math.abs(i)>125?(i>0?this.buttons.prev.click():this.buttons.next.click(),!0):(Math.abs(s)/N.Z.height>.2||Math.abs(s)>125)&&(this.close(),!0)}else{t(),this.draggingType=n.type;const{inBoundsX:a,inBoundsY:r}=e(i,s);null==o||o(!a,!r)}},onZoom:this.onZoom,onDoubleClick:({centerX:e,centerY:t})=>{if(this.isZooming)this.resetZoom();else{const i=3;this.changeZoomByPosition(e,t,i)}},verifyTouchTarget:e=>!((0,f.rB)()||(0,Q.Z)(e.target,this.zoomElements.container)||(0,x.Z)(e.target,"ckin__controls")||(0,x.Z)(e.target,"media-viewer-caption")||(0,x.Z)(e.target,"media-viewer-topbar")&&"wheel"!==e.type),cursor:""})}changeZoomByPosition(e,t,i){const{scaleOffsetX:s,scaleOffsetY:n}=this.calculateScaleOffset({x:e,y:t,scale:i}),a=this.calculateOffsetBoundaries({x:s,y:n,scale:i})[0];this.setTransform(a)}setTransform(e){this.transform=e,this.changeZoom(e.scale)}calculateScaleOffset({x:e,y:t,scale:i}){return{scaleOffsetX:e-i*e,scaleOffsetY:t-i*t}}toggleZoom(e){const t=this.isZooming,i=void 0===e;if((this.zoomElements.rangeSelector.mousedown||this.ctrlKeyDown)&&(e=!0),null!=e||(e=!t),t!==e){if(this.buttons.zoom.classList.toggle("zoom-in",!e),this.zoomElements.container.classList.toggle("is-visible",this.isZooming=e),this.wholeDiv.classList.toggle("is-zooming",e),i||!e){const t=e?this.transform.scale:1;this.setZoomValue(t),this.zoomElements.rangeSelector.setProgress(t)}this.videoPlayer&&this.videoPlayer.lockControls(!e&&void 0)}}addZoomStep(e){this.addZoom(.5*(e?1:-1))}resetZoom(){this.setTransform({x:0,y:0,scale:1})}changeZoom(e=this.transform.scale){this.transform.scale=e,this.zoomElements.rangeSelector.setProgress(e),this.setZoomValue(e)}addZoom(e){this.lastTransform=this.transform,this.onZoom({zoomAdd:e,currentCenterX:0,currentCenterY:0,initialCenterX:0,initialCenterY:0,dragOffsetX:0,dragOffsetY:0}),this.lastTransform=this.transform,this.clampZoomDebounced()}getZoomBounce(){return this.isGesturingNow&&a.Z?50:0}getZoomBoundaries(e=this.transform.scale,t=0){if(!this.initialContentRect)return{minX:0,maxX:0,minY:0,maxY:0};const i=(N.Z.width-N.Z.width*e)/2,s=(N.Z.height-N.Z.height*e)/2;return{minX:Math.max(-this.initialContentRect.left*e,i),maxX:N.Z.width-this.initialContentRect.right*e,minY:Math.max(-this.initialContentRect.top*e+t,s),maxY:N.Z.height-this.initialContentRect.bottom*e}}setBtnMenuToggle(e){const t=(0,u.Z)({buttonOptions:{onlyMobile:!0},direction:"bottom-left",buttons:e});this.topbar.append(t)}close(e){var t,i;if(e&&(0,l.Z)(e),this.setMoverAnimationPromise)return Promise.reject();this.closing=!0,null===(t=this.swipeHandler)||void 0===t||t.removeListeners(),this.navigationItem&&k.Z.removeItem(this.navigationItem),this.lazyLoadQueue.clear();const s=this.setMoverToTarget(null===(i=this.target)||void 0===i?void 0:i.element,!0).then((({onAnimationEnd:e})=>e));return this.listLoader.reset(),this.listLoader.cleanup&&this.listLoader.cleanup(),this.setMoverPromise=null,this.tempId=-1,window.appMediaViewer===this&&(window.appMediaViewer=void 0),this.removeGlobalListeners(),s.finally((()=>{this.wholeDiv.remove(),this.toggleOverlay(!1)})),s}toggleOverlay(e){y.Z.isOverlayActive=e,E.Z.checkAnimations2(e)}toggleGlobalListeners(e){e?this.setGlobalListeners():this.removeGlobalListeners()}removeGlobalListeners(){window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp)}setGlobalListeners(){window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp)}setMediaTimestamp(e){var t;null===(t=this.videoPlayer)||void 0===t||t.setTimestamp(e)}setMoverToTarget(e,t=!1,i=0){return J(this,void 0,void 0,(function*(){this.dispatchEvent("setMoverBefore");const n=this.content.mover;t||(n.innerHTML="");const a=this.isZooming&&t?this.transform.scale:1;this.removeCenterFromMover(n);const o=0!==i,r=X.Z.isAvailable("animations")?o?350:200:0;let d,l;e&&(e instanceof I.Z||e.classList.contains("grid-item")?(d=e,l=e.getBoundingClientRect()):e instanceof SVGImageElement||e.parentElement instanceof SVGForeignObjectElement?(d=(0,x.Z)(e,"attachment"),l=d.getBoundingClientRect()):e.classList.contains("profile-avatars-avatar")&&(d=(0,x.Z)(e,"profile-avatars-container"),l=d.getBoundingClientRect(),t&&e.getBoundingClientRect().left!==l.left&&(e=d=l=void 0))),e||(e=this.content.media),l||(d=e.parentElement,l=e.getBoundingClientRect());let c=!1;if(e!==this.content.media&&!e.classList.contains("profile-avatars-avatar")){const i=(0,x.Z)(d,"scrollable"),s=(0,_.Z)(d,i,!0);!t||s&&2!==s.overflow.vertical&&2!==s.overflow.horizontal?!s||1!==s.overflow.vertical&&1!==s.overflow.horizontal||(c=!0):(d=(e=this.content.media).parentElement,l=e.getBoundingClientRect())}const h=this.content.media.getBoundingClientRect();let u,p,f,m="";if(o?(u=1===i?N.Z.width:-h.width,p=h.top):(u=l.left,p=l.top),m+=`translate3d(${u}px,${p}px,0) `,e instanceof HTMLImageElement||e instanceof HTMLVideoElement||"DIV"===e.tagName){if(n.firstElementChild&&n.firstElementChild.classList.contains("media-viewer-aspecter")){f=n.firstElementChild;const e=f.querySelector(".ckin__player");if(e){const t=e.firstElementChild;f.append(t),e.remove()}f.style.cssText||(n.classList.remove("active"),this.setFullAspect(f,h,l),n.offsetLeft,n.classList.add("active"))}else f=document.createElement("div"),f.classList.add("media-viewer-aspecter"),n.prepend(f);f.style.cssText=`width: ${l.width}px; height: ${l.height}px; transform: scale3d(${h.width/l.width}, ${h.height/l.height}, 1);`}n.style.width=h.width+"px",n.style.height=h.height+"px";const g=l.width/h.width,v=l.height/h.height;o||(m+=`scale3d(${g},${v},1) `);let b=window.getComputedStyle(d).getPropertyValue("border-radius");const y=function(e){const t=e.split(" ");if(4!==t.length){t[0]||(t[0]="0px");for(let e=t.length;e<4;++e)t[e]=t[e%2]||t[0]||"0px"}return t}(b);if(b=y.map((e=>parseInt(e)/g+"px")).join(" "),o||(n.style.borderRadius=b),t&&1!==a){const e=l.left-(N.Z.width*g-l.width)/2,t=l.top-(N.Z.height*v-l.height)/2;this.moversContainer.style.transform=`matrix(${g}, 0, 0, ${v}, ${e}, ${t})`}else n.style.transform=m;let w;c&&(n.style.opacity="0");const S=e.classList.contains("is-out"),C=this.setMoverAnimationPromise=(0,s.Z)(),L={onAnimationEnd:C},E=setTimeout((()=>{C.isFulfilled||C.isRejected||C.resolve()}),1e3);if(C.finally((()=>{this.dispatchEvent("setMoverAfter"),this.setMoverAnimationPromise===C&&(this.setMoverAnimationPromise=null),clearTimeout(E)})),t)return e instanceof SVGSVGElement&&(w=n.querySelector("path"),w&&this.sizeTailPath(w,h,g,r,!1,S,b)),e.classList.contains("media-viewer-media")&&n.classList.add("hiding"),this.toggleWholeActive(!1),setTimeout((()=>{n.style.borderRadius=b,n.firstElementChild&&(n.firstElementChild.style.borderRadius=b)}),r/2),setTimeout((()=>{n.innerHTML="",n.classList.remove("moving","active","hiding"),n.style.cssText="display: none;",C.resolve()}),r),n.classList.remove("opening"),L;{let t,i;const s="video, img, .canvas-thumbnail",a=e.matches(s)?e.parentElement:e,r=Array.from(a.querySelectorAll(s));if(r.length){e=r.pop();const t=document.createElement("canvas"),i=t.getContext("2d");e instanceof HTMLImageElement?(t.width=e.naturalWidth,t.height=e.naturalHeight):e instanceof HTMLVideoElement?(t.width=e.videoWidth,t.height=e.videoHeight):e instanceof HTMLCanvasElement&&(t.width=e.width,t.height=e.height),t.className="canvas-thumbnail thumbnail media-photo",i.drawImage(e,0,0),e=t}if("DIV"===e.tagName||"AVATAR-ELEMENT"===e.tagName){const s=Array.from(e.querySelectorAll("img")).pop();s&&(t=new Image,i=s.src,n.append(t))}else if(e instanceof HTMLImageElement)t=new Image,i=e.src;else if(e instanceof HTMLVideoElement)t=(0,H.Z)(),t.src=e.src;else if(e instanceof SVGSVGElement){const t=e.dataset.clipId,i=t+"-mv",{width:s,height:a}=h,o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttributeNS(null,"width",""+s),o.setAttributeNS(null,"height",""+a),o.setAttributeNS(null,"viewBox",`0 0 ${s} ${a}`),o.setAttributeNS(null,"preserveAspectRatio","xMidYMid meet"),o.insertAdjacentHTML("beforeend",e.firstElementChild.outerHTML.replace(t,i)),o.insertAdjacentHTML("beforeend",e.lastElementChild.outerHTML.replace(t,i));const r=o.firstElementChild,d=r.firstElementChild.firstElementChild;if(d instanceof SVGUseElement){let e,t=d.getAttributeNS(null,"transform");t=t.replace(/translate\((.+?), (.+?)\) scale\((.+?), (.+?)\)/,((e,t,i,n,o)=>`translate(${t=2!=(t=+t)?s-2/g:2/g}, ${a}) scale(${+n/g}, ${+o/v})`)),d.setAttributeNS(null,"transform",t),w=r.firstElementChild.lastElementChild;const i=b.split(" ").map((e=>parseInt(e)));e=S?(0,F.Z)(0,0,s-9/g,a,...i):(0,F.Z)(9/g,0,s-9/g,a,...i),w.setAttributeNS(null,"d",e)}const l=o.lastElementChild;l.setAttributeNS(null,"width",""+h.width),l.setAttributeNS(null,"height",""+h.height),n.prepend(o)}else e instanceof HTMLCanvasElement&&(t=e);f&&(f.style.borderRadius=b,t&&f.append(t)),t=n.querySelector("video, img"),t instanceof HTMLImageElement&&(t.classList.add("thumbnail"),f||(t.style.width=h.width+"px",t.style.height=h.height+"px"),i&&(yield(0,A.cj)(t,i))),n.style.display="",(0,R.T2)((()=>{n.classList.add(o?"moving":"active")}))}return n.classList.add("opening"),yield(0,R.d1)(),n.style.transform=`translate3d(${h.left}px,${h.top}px,0) scale3d(1,1,1)`,c&&(n.style.opacity=""),f&&this.setFullAspect(f,h,l),setTimeout((()=>{n.style.borderRadius="",n.firstElementChild&&(n.firstElementChild.style.borderRadius="")}),0),n.dataset.timeout=""+setTimeout((()=>{n.classList.remove("moving","opening"),f&&(n.querySelector("video"),n.classList.remove("active"),f.style.cssText="",n.offsetLeft),n.classList.add("center","no-transition"),n.classList.add("active"),delete n.dataset.timeout,C.resolve()}),r),w&&this.sizeTailPath(w,h,g,r,!0,S,b),L}))}toggleWholeActive(e){e?this.wholeDiv.classList.add("active"):(this.wholeDiv.classList.add("backwards"),setTimeout((()=>{this.wholeDiv.classList.remove("active")}),0))}setFullAspect(e,t,i){const s=t.width/t.height;let{width:n,height:a}=i;s>0?n=a*s:a=n*s,e.style.cssText=`width: ${n}px; height: ${a}px; transform: scale3d(${t.width/n}, ${t.height/a}, 1);`}sizeTailPath(e,t,i,s,n,a,o){const r=Date.now(),{width:d,height:l}=t;s/=2;const c=o.split(" ").map((e=>parseInt(e))),h=()=>{const t=Date.now()-r;let o=s?t/s:1;o>1&&(o=1),n&&(o=1-o);const u=c.map((e=>e*o));let p;p=a?(0,F.Z)(0,0,d-9/i*o,l,...u):(0,F.Z)(9/i*o,0,d,l,...u),e.setAttributeNS(null,"d",p),t{const a=t?-s.width:i;return e.replace(n,a+"px")}));e.style.transform=n,setTimeout((()=>{e.remove()}),350)}setNewMover(){const e=document.createElement("div");return e.classList.add("media-viewer-mover"),e.style.display="none",this.content.mover?this.content.mover.parentElement.append(e):this.moversContainer.append(e),this.content.mover=e}updateMediaSource(e,t,i){const s=e.tagName.toLowerCase()===i?e:e.querySelector(i);if(s&&!(0,x.Z)(e,"document")){if((0,x.Z)(e,"attachment")){const t=e.parentElement.parentElement.querySelector(".preloader-container");if(t){if("video"===i)return void(t.classList.contains("manual")&&t.click());t.remove()}}s.src!==t&&(0,A.ZP)(s,t),s.classList.contains("thumbnail")&&s.parentElement.classList.contains("media-container-aspecter")&&s.classList.remove("thumbnail")}}setAuthorInfo(e,t){const i=e.isPeerId();let s;if(i)s=(0,W.Z)({peerId:e,dialog:!1,onlyFirstName:!1,plainText:!1});else{const t=s=document.createElement("span");t.append((0,G.Z)(e)),t.classList.add("peer-title")}const n=this.author.avatarEl,a=this.author.avatarEl=n.cloneNode();return Promise.all([this.author.avatarEl.updateWithOptions({peerId:e||U.NM,peerTitle:i?void 0:""+e}),s]).then((([e,i])=>{this.author.avatarEl===a&&((0,D.Z)(this.author.date,(0,T.OD)(t)),(0,D.Z)(this.author.nameEl,i),n.replaceWith(this.author.avatarEl))}))}_openMedia({media:e,timestamp:t,fromId:i,fromRight:s,target:a,reverse:r=!1,prevTargets:c=[],nextTargets:h=[],message:u,mediaTimestamp:p}){return J(this,void 0,void 0,(function*(){if(this.setMoverPromise)return this.setMoverPromise;const f=this.setAuthorInfo(i,t),m="document"===e._,g=m&&e.mime_type&&(["video","gif"].includes(e.type)||0===e.mime_type.indexOf("video/"));this.isFirstOpen&&(this.isFirstOpen=!1,this.listLoader.setTargets(c,h,r),window.appMediaViewer=this),this.listLoader.next.length<10&&setTimeout((()=>{this.listLoader.load(!0)}),0),this.buttons.prev.classList.toggle("hide",!this.listLoader.previous.length),this.buttons.next.classList.toggle("hide",!this.listLoader.next.length);const v=this.content.media,b=!a||a===v;b&&(a=v),this.target={element:a};const y=++this.tempId;v.firstElementChild&&v.replaceChildren(),0!==s?(this.moveTheMover(this.content.mover,1===s),this.setNewMover()):(this.navigationItem={type:"media",onPop:e=>{if(this.setMoverAnimationPromise)return!1;!e&&o.IS_MOBILE_SAFARI&&this.wholeDiv.remove(),this.close()}},k.Z.pushItem(this.navigationItem),this.toggleOverlay(!0),this.setGlobalListeners(),yield f,this.wholeDiv.parentElement||(this.pageEl.insertBefore(this.wholeDiv,document.getElementById("main-columns")),this.wholeDiv.offsetLeft),this.toggleWholeActive(!0));const w=this.content.mover,S=N.Z.width;let L=0;const E=N.Z.height;E<1e6&&!n.Z.isMobile&&(L=120);const I=E-120-L;let M=Promise.resolve();const Z=(0,j.Z)(e,v,S,I,!n.Z.isMobile,void 0,!!(m&&e.w&&e.h)).photoSize;if(b){const t=yield this.managers.thumbsStorage.getCacheContext(e,Z.type);let i;if(t.downloaded)i=new Image,i.src=t.url;else{const s=(0,z.Z)(e,t,!0);s&&(M=s.loadPromise,i=s.image)}i&&(i.classList.add("thumbnail"),v.append(i))}const P=!(!m||!e.supportsStreaming),T=P?this.preloaderStreamable:this.preloader,x=(t=(null==Z?void 0:Z.type))=>this.managers.thumbsStorage.getCacheContext(e,t);let _;if(g){const t=u&&"gif"!==e.type,i=(0,H.Z)({pip:t});this.wholeDiv.classList.contains("no-forwards")&&i.addEventListener("contextmenu",l.Z);const n=()=>this.setMoverToTarget(a,!1,s).then((({onAnimationEnd:s})=>{const n=w.firstElementChild&&w.firstElementChild.classList.contains("media-viewer-aspecter")?w.firstElementChild:w,r=w.querySelector("video");r&&r.remove(),i.setAttribute("playsinline","true"),i.addEventListener("timeupdate",(()=>{this.tempId!==y&&i.pause()})),this.addEventListener("setMoverAfter",(()=>{i.src="",i.load()}),{once:!0}),o.IS_SAFARI&&(i.autoplay=!0),"gif"===e.type?(i.muted=!0,i.autoplay=!0,i.loop=!0):e.duration<60&&(i.loop=!0),void 0!==p&&(i.currentTime=p),n.append(i);const c=new Promise((e=>{i.addEventListener("canplay",e,{once:!0})})),h=()=>{"gif"!==e.type&&(i.dataset.ckin="default",i.dataset.overlay="1",Promise.all([c,s]).then((()=>{this.tempId===y&&((this.videoPlayer=new C({video:i,play:!0,streamable:P,onPlaybackRackMenuToggle:e=>{this.wholeDiv.classList.toggle("hide-caption",!!e)},onPip:e=>{const s=window.appMediaViewer;if(!e&&s&&s!==this)return this.releaseSingleMedia=void 0,void this.close();this.moversContainer.lastElementChild.classList.toggle("hiding",e),this.toggleWholeActive(!e),this.toggleOverlay(!e),this.toggleGlobalListeners(!e),this.navigationItem&&(e?k.Z.removeItem(this.navigationItem):k.Z.pushItem(this.navigationItem)),t&&(e?(this.releaseSingleMedia(!1),this.releaseSingleMedia=void 0,d.Z.setPictureInPicture(i)):this.releaseSingleMedia=d.Z.setSingleMedia(i,u))},onPipClose:()=>{this.close()}})).addEventListener("toggleControls",(e=>{this.wholeDiv.classList.toggle("has-video-controls",e)})),this.addEventListener("setMoverBefore",(()=>{this.wholeDiv.classList.remove("has-video-controls"),this.videoPlayer.cleanup(),this.videoPlayer=void 0}),{once:!0}),this.isZooming&&this.videoPlayer.lockControls(!1))})))};if(P){s.then((()=>{i.readyState{i.addEventListener("canplay",(()=>{T.detach(),i.parentElement.classList.remove("is-buffering")}),{once:!0})};i.addEventListener("waiting",(()=>{const t=i.networkState===i.NETWORK_LOADING,s=i.readyState{(0,l.Z)(e)})),e()}this.lazyLoadQueue.unshift({load:()=>J(this,void 0,void 0,(function*(){const r=P?Promise.resolve():K.Z.downloadMediaURL({media:e});return P||s.then((()=>J(this,void 0,void 0,(function*(){(yield x()).url||T.attach(w,!0,r)})))),Promise.all([r,s]).then((()=>J(this,void 0,void 0,(function*(){if(this.tempId!==y)return void this.log.warn("media viewer changed video");const e=(yield x()).url;i.addEventListener("error",(()=>{(0,$.bC)({langPackKey:o.IS_MOBILE?"Video.Unsupported.Mobile":"Video.Unsupported.Desktop"}),4!==i.error.code&&this.log.error("Error "+i.error.code+"; details: "+i.error.message),null==T||T.detach()}),{once:!0}),a instanceof SVGSVGElement?n.firstElementChild.lastElementChild.append(i):(0,A.ZP)(i,e),t&&(this.releaseSingleMedia=d.Z.setSingleMedia(i,u),this.addEventListener("setMoverBefore",(()=>{this.releaseSingleMedia&&(this.releaseSingleMedia(),this.releaseSingleMedia=void 0)}),{once:!0})),this.updateMediaSource(a,e,"video"),h()})))),r}))})}));_=M.then(n)}else{const t=()=>this.setMoverToTarget(a,!1,s).then((({onAnimationEnd:t})=>{this.lazyLoadQueue.unshift({load:()=>J(this,void 0,void 0,(function*(){const i=m?K.Z.downloadMediaURL({media:e}):K.Z.downloadMediaURL({media:e,thumb:Z}),s=!m&&e.sizes.slice().filter((e=>e.w));s&&s.sort(((e,t)=>t.size-e.size));const o=null==s?void 0:s[0],r=!m&&o!==Z&&K.Z.downloadMediaURL({media:e,thumb:o});return t.then((()=>J(this,void 0,void 0,(function*(){(yield x()).url||this.preloader.attachPromise(i)})))),Promise.all([t,i]).then((()=>J(this,void 0,void 0,(function*(){var e;if(this.tempId!==y)return void this.log.warn("media viewer changed photo");const t=(yield x()).url;if(a instanceof SVGSVGElement)this.updateMediaSource(a,t,"img"),this.updateMediaSource(w,t,"img"),n.Z.isMobile&&w.querySelectorAll("img").forEach((e=>{e.classList.remove("thumbnail")}));else{const i=w.firstElementChild&&w.firstElementChild.classList.contains("media-viewer-aspecter")?w.firstElementChild:w,s=["CANVAS","IMG"].includes(null===(e=i.firstElementChild)||void 0===e?void 0:e.tagName)?i.firstElementChild:null;if((null==s?void 0:s.src)!==t){const e=new Image;e.classList.add("thumbnail"),(0,A.ZP)(e,t,(()=>{(0,R.T2)((()=>{this.updateMediaSource(a,t,"img"),s&&(0,R.T2)((()=>{s.remove()})),i.append(e)}))}),!1),r&&r.then((t=>{const i=new Image;i.classList.add("thumbnail"),(0,A.ZP)(i,t,(()=>{(0,R.T2)((()=>{e.replaceWith(i)}))}),!1)}))}}})))).catch((e=>{this.log.error(e),this.preloader.attach(w),this.preloader.setManual()})),i}))})}));_=M.then(t)}return this.setMoverPromise=_.catch((()=>{this.setMoverAnimationPromise=null})).finally((()=>{this.setMoverPromise=null}))}))}}},5824:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(410),n=i(4762),a=i(5003),o=i(8799),r=i(3910),d=i(3444),l=i(1655);const c=new class{constructor(){if(this.onPopState=e=>{const t=window.location.hash,i=e.state;if(this.debug&&this.log("popstate",e,this.isPossibleSwipe,t),t!==this.currentHash)if(this.debug&&this.log.warn(`hash changed, new=${t}, current=${this.currentHash}, overridden=${this.overriddenHash}`),i===this.id&&this.overriddenHash&&this.overriddenHash!==t)this.overrideHash(this.overriddenHash);else{if(!i||this.overriddenHash||!t)return this.currentHash=t,void(this.onHashChange&&this.onHashChange());this.overrideHash()}if(i!==this.id&&(this.pushState(),!this.navigations.length))return;const s=this.navigations.pop();s?(this.manual=!this.isPossibleSwipe,this.handleItem(s)):this.pushState()},this.onKeyDown=e=>{const t=this.navigations[this.navigations.length-1];t&&("Escape"!==e.key||t.onEscape&&!t.onEscape()||((0,r.Z)(e),this.back(t.type)))},this.onTouchStart=e=>{e.touches.length>1||(this.debug&&this.log("touchstart"),(0,d.Z)(e)&&(this.isPossibleSwipe=!0,window.addEventListener("touchend",(()=>{setTimeout((()=>{this.isPossibleSwipe=!1}),100)}),{passive:!0,once:!0})))},this.navigations=[],this.id=Date.now(),this.manual=!1,this.log=(0,a.kg)("NC"),this.debug=!0,this.currentHash=window.location.hash,this.overriddenHash="",this.isPossibleSwipe=!1,window.addEventListener("popstate",this.onPopState),window.addEventListener("keydown",this.onKeyDown,{capture:!0,passive:!1}),n.IS_MOBILE_SAFARI){const e={passive:!0};window.addEventListener("touchstart",this.onTouchStart,e)}history.scrollRestoration="manual",this.pushState()}overrideHash(e=""){e&&"#"!==e[0]?e="#"+e:"#"===e&&(e=""),this.currentHash!==e&&(this.overriddenHash=this.currentHash=e,this.replaceState(),this.pushState())}handleItem(e){const t=e.onPop(!!this.manual&&void 0);this.debug&&this.log("popstate, navigation:",e,this.navigations),!1===t?this.pushItem(e):e.noBlurOnPop||(0,o.Z)(),this.manual=!1}findItemByType(e){for(let t=this.navigations.length-1;t>=0;--t){const i=this.navigations[t];if(i.type===e)return{item:i,index:t}}}back(e){if(e){const t=this.findItemByType(e);if(t)return void this.backByItem(t.item,t.index)}history.back()}backByItem(e,t=this.navigations.indexOf(e)){this.manual=!0,this.navigations.splice(t,1),this.handleItem(e)}onItemAdded(e){this.debug&&this.log("onItemAdded",e,this.navigations),e.noHistory||this.pushState()}pushItem(e){this.navigations.push(e),this.onItemAdded(e)}unshiftItem(e){this.navigations.unshift(e),this.onItemAdded(e)}spliceItems(e,t,...i){this.navigations.splice(e,t,...i),i.forEach((e=>{this.onItemAdded(e)}))}pushState(){this.debug&&this.log("push"),this.manual=!1,history.pushState(this.id,"")}replaceState(){this.debug&&this.log.warn("replace");const e=location.origin+location.pathname+location.search+this.overriddenHash;history.replaceState(this.id,"",e)}removeItem(e){e&&(0,l.Z)(this.navigations,e)}removeByType(e,t=!1){for(let i=this.navigations.length-1;i>=0&&(this.navigations[i].type!==e||(this.navigations.splice(i,1),!t));--i);}};s.GO.appNavigationController=c;const h=c},5884:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l,z:()=>d});var s=i(5005),n=i(8805),a=i(5565),o=i(2325),r=i(3512);class d{constructor(e,t,i=!0,n,a=!0,r=!0,d,l){this.name=e,this.type=t,this.clearable=i,this.autonomous=r,this.onFound=d,this.noIcons=l,this.list=s.default.createChatList(),this.container=document.createElement("div"),n&&(this.container.className=n),e&&(this.nameEl=document.createElement("div"),this.nameEl.classList.add("search-group__name"),"string"==typeof e&&this.nameEl.append((0,o.ag)(e)),this.container.append(this.nameEl)),this.container.classList.add("search-group","search-group-"+t),this.container.append(this.list),this.container.style.display="none",a&&s.default.setListClickListener(this.list,d,void 0,r)}clear(){this.container.style.display="none",this.clearable&&(this.list.innerHTML="")}setActive(){this.container.style.display=""}toggle(){this.list.childElementCount?this.setActive():this.clear()}}class l{constructor(e,t,i,s,a){this.container=e,this.searchInput=t,this.searchGroups=i,this.onSearch=s,this.noIcons=a,this.minMsgId=0,this.loadedCount=-1,this.foundCount=-1,this.searchPromise=null,this.searchTimeout=0,this.query="",this.listsContainer=null,this.threadId=0,this.scrollable=new n.ZP(this.container),this.listsContainer=this.scrollable.container;for(const e in this.searchGroups)this.listsContainer.append(this.searchGroups[e].container);this.searchGroups.messages&&this.scrollable.setVirtualContainer(this.searchGroups.messages.list),this.searchInput.onChange=e=>{this.query=e,this.reset(!1),this.searchMore()},this.scrollable.onScrolledBottom=()=>{this.query.trim()&&(this.searchTimeout||(this.searchTimeout=window.setTimeout((()=>{this.searchMore(),this.searchTimeout=0}),0)))}}reset(e=!0){e&&(this.searchInput.value="",this.query="",this.peerId=void 0,this.threadId=0),this.minMsgId=0,this.loadedCount=-1,this.foundCount=-1;for(const e in this.searchGroups)this.searchGroups[e].clear();this.searchPromise=null}beginSearch(e,t=0,i=""){this.peerId=e,this.threadId=t,this.query!==i&&(this.searchInput.inputField.value=i),this.searchInput.input.focus()}searchMore(){if(this.searchPromise)return this.searchPromise;const e=this.query;if(!e.trim())return void(this.onSearch&&this.onSearch(0));if(-1!==this.foundCount&&this.loadedCount>=this.foundCount)return Promise.resolve();const t=this.minMsgId||0;return this.searchPromise=r.Z.managers.appMessagesManager.getSearch({peerId:this.peerId,query:e,inputFilter:{_:"inputMessagesFilterEmpty"},maxId:t,limit:20,threadId:this.threadId}).then((t=>{if(this.searchPromise=null,this.searchInput.value!==e)return;const{count:i,history:n}=t;n.length&&n[0].mid===this.minMsgId&&n.shift();const r=this.searchGroups.messages;n.forEach((t=>{try{const i=this.peerId?t.fromId:t.peerId;s.default.addDialogAndSetLastMessage({peerId:i,container:this.scrollable,avatarSize:"bigger",meAsSaved:!1,message:t,query:e,noIcons:this.noIcons})}catch(e){console.error("[appSearch] render search result",e)}})),r.toggle(),this.minMsgId=n.length&&n[n.length-1].mid,-1===this.loadedCount&&(this.loadedCount=0),this.loadedCount+=n.length,-1===this.foundCount&&(this.foundCount=i,r.nameEl&&(0,a.Z)(r.nameEl,(0,o.ag)(i?"Chat.Search.MessagesFound":"Chat.Search.NoMessagesFound",[i])),this.onSearch&&this.onSearch(this.foundCount))})).catch((e=>{console.error("search error",e),this.searchPromise=null}))}}},6360:(e,t,i)=>{"use strict";i.d(t,{Z:()=>ge});var s=i(5005),n=i(5003),a=i(3512),o=i(5884),r=i(6008),d=i(2153),l=i(279),c=i(1405),h=i(8805),u=i(8594),p=i(2325),f=i(8497),m=i(3624),g=i(2894),v=i(4668),b=i(4332),y=i(4755),w=i(6219),S=i(4484),C=i(467),L=i(5432),E=i(1154),I=i(241),M=i(6272),Z=i(3003),P=i(4524),T=i(5128),k=i(7479),x=i(5705),A=i(6054),_=i(3910),F=i(2738),D=i(1784),R=i(8479),B=i(7401),N=i(5953),O=i(3738),U=i(4064),H=i(130),z=i(7030),j=i(2498),G=i(1336),V=i(5798),K=i(2342),W=i(2491),$=i(5400),q=i(5671),Y=i(1604),Q=i(7530),X=i(6566),J=i(177),ee=i(3061),te=i(2566),ie=i(6976),se=i(3416),ne=i(1483),ae=i(3855),oe=i(3699),re=i(296),de=i(9492),le=i(2887),ce=i(319),he=i(6131),ue=i(2353),pe=i(4499),fe=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class me{constructor(e,t,i){this.attachTo=e,this.searchSuper=t,this.listenerSetter=i,this.onGotoClick=()=>{w.ZP.setInnerPeer({peerId:this.peerId,lastMsgId:this.mid,threadId:this.searchSuper.searchContext.threadId})},this.onForwardClick=()=>{this.searchSuper.selection.isSelecting?(0,F.tH)(this.searchSuper.selection.selectionForwardBtn):new P.Z({[this.peerId]:[this.mid]})},this.onSelectClick=()=>{this.searchSuper.selection.toggleByElement(this.target)},this.onClearSelectionClick=()=>{this.searchSuper.selection.cancelSelection()},this.onDeleteClick=()=>{this.searchSuper.selection.isSelecting?(0,F.tH)(this.searchSuper.selection.selectionDeleteBtn):new T.Z(this.peerId,[this.mid],"chat")},this.managers=t.managers;L.Z||(0,ie.E)({element:e,callback:e=>{let i;this.init&&(this.init(),this.init=null);try{i=(0,f.Z)(e.target,"search-super-item")}catch(e){}if(i){if(e instanceof MouseEvent&&e.preventDefault(),this.element.classList.contains("active"))return!1;e instanceof MouseEvent&&(e.cancelBubble=!0),(()=>{fe(this,void 0,void 0,(function*(){this.target=i,this.peerId=i.dataset.peerId.toPeerId(),this.mid=+i.dataset.mid,this.isSelected=t.selection.isMidSelected(this.peerId,this.mid),this.message=yield this.managers.appMessagesManager.getMessageByPeer(this.peerId,this.mid),this.noForwards=t.selection.isSelecting?this.searchSuper.selection.selectionForwardBtn.classList.contains("hide"):!(yield this.managers.appMessagesManager.canForward(this.message)),this.selectedMessages=t.selection.isSelecting?yield t.selection.getSelectedMessages():void 0,yield Promise.all(this.buttons.map((e=>fe(this,void 0,void 0,(function*(){let t;t=!(this.searchSuper.selection.isSelecting&&!e.withSelection||e.verify&&!(yield e.verify())),e.element.classList.toggle("hide",!t)}))))),i.classList.add("menu-open"),(0,ne.Z)(e,this.element),se.Z.openBtnMenu(this.element,(()=>{i.classList.remove("menu-open")}))}))})()}},listenerSetter:i})}init(){this.buttons=[{icon:"forward",text:"Forward",onClick:this.onForwardClick,verify:()=>!this.noForwards},{icon:"forward",text:"Message.Context.Selection.Forward",onClick:this.onForwardClick,verify:()=>this.searchSuper.selection.isSelecting&&!this.noForwards,withSelection:!0},{icon:"download",text:"MediaViewer.Context.Download",onClick:()=>pe.Z.onDownloadClick(this.message,this.noForwards),verify:()=>!this.searchSuper.selection.isSelecting&&pe.Z.canDownload(this.message,void 0,this.noForwards)},{icon:"download",text:"Message.Context.Selection.Download",onClick:()=>pe.Z.onDownloadClick(this.selectedMessages,this.noForwards),verify:()=>this.searchSuper.selection.isSelecting&&pe.Z.canDownload(this.selectedMessages,void 0,this.noForwards),withSelection:!0},{icon:"message",text:"Message.Context.Goto",onClick:this.onGotoClick,withSelection:!0},{icon:"select",text:"Message.Context.Select",onClick:this.onSelectClick,verify:()=>!this.isSelected,withSelection:!0},{icon:"select",text:"Message.Context.Selection.Clear",onClick:this.onClearSelectionClick,verify:()=>this.isSelected,withSelection:!0},{icon:"delete danger",text:"Delete",onClick:this.onDeleteClick,verify:()=>!this.searchSuper.selection.isSelecting&&this.managers.appMessagesManager.canDeleteMessage(this.message)},{icon:"delete danger",text:"Message.Context.Selection.Delete",onClick:this.onDeleteClick,verify:()=>this.searchSuper.selection.isSelecting&&!this.searchSuper.selection.selectionDeleteBtn.classList.contains("hide"),withSelection:!0}],this.element=(0,Z.b)({buttons:this.buttons,listenerSetter:this.listenerSetter}),this.element.classList.add("search-contextmenu","contextmenu"),document.getElementById("page-chats").append(this.element)}}class ge{constructor(e){this.tabs={},this.prevTabId=-1,this.lazyLoadQueue=new d.Z,this.middleware=(0,m.k)(),this.historyStorage={},this.usedFromHistory={},this.loadMutex=Promise.resolve(),this.nextRates={},this.loadPromises={},this.loaded={},this.loadedChats=!1,this.firstLoad=!0,this.log=(0,n.kg)("SEARCH-SUPER"),this.monthContainers={},this.mediaTabsMap=new Map,this.asChatList=!1,this.groupByMonth=!0,this.hideEmptyTabs=!0,this.showSender=!1,this.onTransitionStart=()=>{this.container.classList.add("sliding")},this.onTransitionEnd=()=>{this.container.classList.remove("sliding")},(0,N.Z)(this,e),this.container=document.createElement("div"),this.container.classList.add("search-super"),this.listenerSetter=new oe.Z,this.searchContextMenu=new me(this.container,this,this.listenerSetter),this.selection=new A.e(this,this.managers,this.listenerSetter);const t=this.navScrollableContainer=document.createElement("div");t.classList.add("search-super-tabs-scrollable","menu-horizontal-scrollable","sticky");const i=this.navScrollable=new h.v7(t);i.container.classList.add("search-super-nav-scrollable");const s=this.nav=document.createElement("nav");s.classList.add("search-super-tabs","menu-horizontal-div"),this.tabsMenu=s,i.container.append(s);for(const e of this.mediaTabs){const t=document.createElement("div");t.classList.add("menu-horizontal-div-item");const i=document.createElement("span"),s=document.createElement("i");i.append((0,p.ag)(e.name)),i.append(s),t.append(i),(0,c.Z)(t),this.tabsMenu.append(t),this.mediaTabsMap.set(e.type,e),e.menuTab=t}let a;this.tabsContainer=document.createElement("div"),this.tabsContainer.classList.add("search-super-tabs-container","tabs-container"),L.Z&&(this.swipeHandler=(0,E.Z)({element:this.tabsContainer,onSwipe:(e,t,i)=>{e*=-1;const s=this.selectTab.prevId(),n=Array.from(this.tabsMenu.children);let o;if(e>0){for(let e=s+1;e=0;--e)if(!n[e].classList.contains("hide")){o=e;break}void 0!==o&&(a=function(e){const t=e=>{(0,_.Z)(e)};let i=2;const s=()=>{--i||e.removeEventListener("touchmove",t,{capture:!0})};return e.addEventListener("touchmove",t,{capture:!0,passive:!1}),e.addEventListener("touchend",s,{once:!0}),s}(this.tabsContainer),this.selectTab(o))},verifyTouchTarget:e=>!(0,f.Z)(e.target,"scrollable-x")}));for(const e of this.mediaTabs){const t=document.createElement("div");t.classList.add("search-super-container-"+e.type,"tabs-tab");const i=document.createElement("div");i.classList.add("search-super-content-"+e.type),t.append(i),this.tabsContainer.append(t),this.tabs[e.inputFilter]=i,e.contentTab=i}this.container.append(t,this.tabsContainer),this.searchGroupMedia=new o.z(!1,"messages",!0),this.scrollable.onScrolledBottom=()=>{this.mediaTab.contentTab&&this.canLoadMediaTab(this.mediaTab)&&this.load(!0)},this.selectTab=(0,r.X)(this.tabsMenu,this.tabsContainer,((e,t,i)=>{if(this.prevTabId===e&&!this.skipScroll)return void this.scrollable.scrollIntoViewNew({element:this.container,position:"start",startCallback:this.scrollStartCallback});const s=this.mediaTabs[e];this.onChangeTab&&this.onChangeTab(s);const n=this.mediaTab;if(this.mediaTab=s,-1!==this.prevTabId&&i&&this.onTransitionStart(),this.skipScroll)this.skipScroll=!1;else{const e=this.container.offsetTop;let t=this.scrollable.scrollTop;if(tn&&(s.scroll={scrollTop:n,scrollHeight:0})}if(s.scroll){const e=n.scroll.scrollTop-s.scroll.scrollTop;e&&(s.contentTab.style.transform=`translateY(${e}px)`)}}-1===this.prevTabId||s.contentTab.childElementCount||this.load(!0),this.prevTabId=e}),(()=>{this.scrollable.onScroll(),void 0!==this.mediaTab.scroll&&(this.mediaTab.contentTab.style.transform="",this.scrollable.scrollTop=this.mediaTab.scroll.scrollTop),a&&(a(),a=void 0),this.onTransitionEnd()}),void 0,i,this.listenerSetter),(0,F.fc)(this.tabsContainer,(e=>{this.selection.isSelecting&&((0,_.Z)(e),this.selection.toggleByElement((0,f.Z)(e.target,"search-super-item")))}),{capture:!0,passive:!1,listenerSetter:this.listenerSetter});const l=(e,t,i,s)=>fe(this,void 0,void 0,(function*(){const n=(0,f.Z)(s.target,e);if(!n)return;const a=+n.dataset.mid;if(!a)return void this.log.warn("no messageId by click on target:",n);const o=n.querySelector(".media-spoiler-container");if(o)return void(0,he.kN)({event:s,mediaSpoiler:o});const r=n.dataset.peerId.toPeerId(),d=Array.from(this.tabs[i].querySelectorAll("."+t)).map((t=>{const i=(0,f.Z)(t,e);return{element:t,mid:+i.dataset.mid,peerId:i.dataset.peerId.toPeerId()}})),l=d.findIndex((e=>e.mid===a&&e.peerId===r)),c=yield this.managers.appMessagesManager.getMessageByPeer(r,a);(new D.Z).setSearchContext(this.copySearchContext(i)).openMedia({message:c,target:d[l].element,fromRight:0,reverse:!1,prevTargets:d.slice(0,l),nextTargets:d.slice(l+1)})}));(0,F.fc)(this.tabs.inputMessagesFilterPhotoVideo,l.bind(null,"grid-item","grid-item","inputMessagesFilterPhotoVideo"),{listenerSetter:this.listenerSetter}),(0,F.fc)(this.tabs.inputMessagesFilterDocument,l.bind(null,"document-with-thumb","media-container","inputMessagesFilterDocument"),{listenerSetter:this.listenerSetter}),this.mediaTab=this.mediaTabs[0],(0,u.ZP)((()=>{this.lazyLoadQueue.lock()}),(()=>{this.lazyLoadQueue.unlockAndRefresh()}),this.listenerSetter)}filterMessagesByType(e,t){return(0,X.Z)(t,e,e.length)}processEmptyFilter({message:e,searchGroup:t}){const i=[],n=s.default.addDialogNew({peerId:e.peerId,container:t.list,avatarSize:"bigger",loadPromises:i}),a=s.default.setLastMessageN({dialog:{_:"dialog",peerId:e.peerId},lastMessage:e,dialogElement:n,highlightWord:this.searchContext.query});return i.push(a),Promise.all(i).then(ce.Z)}processPhotoVideoFilter({message:e,promises:t,middleware:i}){return fe(this,void 0,void 0,(function*(){const s=(0,Q.Z)(e,!0),n=document.createElement("div");let a;n.classList.add("grid-item");const o=(0,z.Z)(s,200,200);if(a="photo"!==s._?yield(yield(0,le.Z)({doc:s,message:e,container:n,boxWidth:0,boxHeight:0,lazyLoadQueue:this.lazyLoadQueue,middleware:i,onlyPreview:!0,withoutPreloader:!0,noPlayButton:!0,photoSize:o})).thumb:yield(0,de.Z)({photo:s,message:e,container:n,boxWidth:0,boxHeight:0,lazyLoadQueue:this.lazyLoadQueue,middleware:i,withoutPreloader:!0,noBlur:!0,size:o}),e.media.pFlags.spoiler){const e=yield(0,he.ZP)({animationGroup:"chat",media:s,middleware:i,width:140,height:140,multiply:.3});n.append(e)}return[a.images.thumb,a.images.full].filter(Boolean).forEach((e=>{e.classList.add("grid-item-media")})),t.push(a.loadPromises.thumb),{element:n,message:e}}))}processDocumentFilter({message:e,inputFilter:t}){return fe(this,void 0,void 0,(function*(){const i=(0,Q.Z)(e,!0),s=this.showSender||["voice","round"].includes(i.type),n=yield(0,re.Z)({message:e,withTime:!s,fontWeight:400,voiceAsMusic:!0,showSender:s,searchContext:this.copySearchContext(t),lazyLoadQueue:this.lazyLoadQueue,autoDownloadSize:0,getSize:()=>320});return["audio","voice","round"].includes(i.type)&&n.classList.add("audio-48"),{message:e,element:n}}))}processUrlFilter({message:e,promises:t,middleware:i}){var s;return fe(this,void 0,void 0,(function*(){let n=null===(s=e.media)||void 0===s?void 0:s.webpage;if(!n){const t=e.totalEntities?e.totalEntities.find((e=>"messageEntityUrl"===e._||"messageEntityTextUrl"===e._)):null;let i,s,a;if(t)a=e.message.slice(t.offset,t.offset+t.length);else{const t=(0,K.Z)(e.message);if(!t)return;i=t[0]}i="messageEntityTextUrl"===(null==t?void 0:t._)?t.url:i||a,s=i;const o=e.message===i;i.match(/^(ftp|http|https):\/\//)||(s="https://"+i,i=i.includes("@")?i:"https://"+i),s=new URL(s).hostname,n={_:"webPage",url:i,display_url:s,id:"",hash:0},o||(n.description=e.message)}if("webPageEmpty"===n._)return;const a=document.createElement("div");a.classList.add("preview"),n.photo?(0,de.Z)({container:a,message:null,photo:n.photo,boxWidth:0,boxHeight:0,withoutPreloader:!0,lazyLoadQueue:this.lazyLoadQueue,middleware:i,size:(0,z.Z)(n.photo,60,60,!1),loadPromises:t,noBlur:!0}):(a.classList.add("empty"),(0,H.Z)(a,(0,V.Z)(n.title||n.display_url||n.description||n.url,!0)));const o=(0,G.Z)(n),r=(0,j.Z)(n),d=(0,x.Z)((0,$.ZP)(n.url||"")).firstElementChild;if(d instanceof HTMLAnchorElement)try{d.innerText=decodeURIComponent(d.href)}catch(e){}r.firstChild&&r.append("\n"),r.append(d),this.showSender&&r.append("\n",yield(0,q.Z)(e)),o.textContent||o.append((0,W.Z)(n.display_url.split("/",1)[0]));const l=new k.ZP({title:o,titleRight:(0,Y.Z)(e),subtitle:r,havePadding:!0,clickable:!0,noRipple:!0});return l.applyMediaElement(a,"big"),l.container.innerText.trim().length?{message:e,element:l.container}:void 0}))}performSearchResult(e,t,i=!0){return fe(this,void 0,void 0,(function*(){const s=[],n=t.contentTab,a=[],o=this.middleware.get();let r,d=t.inputFilter;yield(0,u.e9)(),"inputMessagesFilterPhotoVideo"===d&&this.searchContext.query.trim()?(d="inputMessagesFilterEmpty",r=this.searchGroupMedia,n.append(r.container)):"inputMessagesFilterEmpty"===d&&(r=this.searchGroups.messages);const l={elemsToAppend:s,inputFilter:d,message:void 0,middleware:o,promises:a,searchGroup:r};let c;switch(d){case"inputMessagesFilterEmpty":c=this.processEmptyFilter;break;case"inputMessagesFilterPhotoVideo":c=this.processPhotoVideoFilter;break;case"inputMessagesFilterVoice":case"inputMessagesFilterRoundVoice":case"inputMessagesFilterMusic":case"inputMessagesFilterDocument":c=this.processDocumentFilter;break;case"inputMessagesFilterUrl":c=this.processUrlFilter}if(c){c=c.bind(this);const t=e.map((e=>fe(this,void 0,void 0,(function*(){try{return l.message=e,yield c(l)}catch(t){this.log.error("error rendering filter",d,l,e,t)}})))),i=(yield Promise.all(t)).filter(Boolean);s.push(...i)}if(r&&r.list.childElementCount&&r.setActive(),this.loadMutex&&a.push(this.loadMutex),!a.length||(yield Promise.all(a),o())){if(s.length){const e=i?"append":"prepend";s.forEach((t=>{var i;const{element:s,message:n}=t,a=this.getMonthContainerByTimestamp(this.groupByMonth?n.date:0,d);s.classList.add("search-super-item"),s.dataset.mid=""+n.mid,s.dataset.peerId=""+n.peerId,a.items[e](s),(null===(i=this.selection)||void 0===i?void 0:i.isSelecting)&&this.selection.toggleElementCheckbox(s,!0)}))}this.afterPerforming("inputMessagesFilterEmpty"===d?1:s.length,n)}}))}afterPerforming(e,t){if(t){const i=t.parentElement;if(Array.from(i.children).slice(1).forEach((e=>{e.remove()})),!e&&!t.childElementCount){const e=document.createElement("div");e.innerText="Nothing interesting here yet...",e.classList.add("position-center","text-center","content-empty","no-select"),i.append(e)}}}loadChats(){const e=new Set,t=this.middleware.get();for(const e in this.searchGroups){const t=this.searchGroups[e];this.tabs.inputMessagesFilterEmpty.append(t.container),t.clear()}const i=this.searchContext.query;if(i){const n=(t,n,o=!1)=>{t.map((t=>{if(e.has(t))return;e.add(t);const{dom:i}=s.default.addDialogNew({peerId:t,container:n.list,avatarSize:"abitbigger",autonomous:n.autonomous});return{dom:i,peerId:t}})).filter(Boolean).forEach((({dom:e,peerId:t})=>fe(this,void 0,void 0,(function*(){const s=yield this.managers.appPeersManager.getPeer(t);if(o&&(s.participants_count||s.participants)){const s=new RegExp(`(${(0,O.Z)(i)}|${(0,O.Z)((0,C.ZP)(i))})`,"gi");e.titleSpan.innerHTML=e.titleSpan.innerHTML.replace(s,"$1"),e.lastMessageSpan.append(yield(0,J.Z)(t.toChatId()))}else if(t===a.Z.myId)e.lastMessageSpan.append((0,p.ag)("Presence.YourChat"));else{let i=yield this.managers.appPeersManager.getPeerUsername(t);if(i)i="@"+i;else{const e=yield this.managers.appUsersManager.getUser(t);e&&e.phone&&(i="+"+(0,M.u)(e.phone).formatted)}e.lastMessageSpan.textContent=i}})))),n.toggle()},o=e=>{if(t())return e};return Promise.all([this.managers.appUsersManager.getContactsPeerIds(i,!0,void 0,10).then(o).then((e=>{e&&n(e,this.searchGroups.contacts,!0)})),this.managers.appUsersManager.searchContacts(i,20).then(o).then((e=>{if(e&&(n(e.my_results,this.searchGroups.contacts,!0),n(e.results,this.searchGroups.globalContacts),this.searchGroups.globalContacts.container.classList.add("is-short"),this.searchGroups.globalContacts.nameEl.lastElementChild!==this.searchGroups.globalContacts.nameEl.firstElementChild&&this.searchGroups.globalContacts.nameEl.lastElementChild.remove(),this.searchGroups.globalContacts.list.childElementCount>3)){const e=document.createElement("div");e.classList.add("search-group__show-more");const t=new p.ZP.IntlElement({key:"Separator.ShowMore"});e.append(t.element),this.searchGroups.globalContacts.nameEl.append(e),(0,F.fc)(e,(()=>{const e=this.searchGroups.globalContacts.container.classList.toggle("is-short");t.key=e?"Separator.ShowMore":"Separator.ShowLess",t.update()}))}})),this.managers.dialogsStorage.getDialogs({query:i,offsetIndex:0,limit:20,filterId:0}).then(o).then((e=>{e&&n(e.dialogs.map((e=>e.peerId)),this.searchGroups.contacts,!0)}))])}if(this.searchContext.peerId||this.searchContext.minDate)return Promise.resolve();{const e=(e=!0)=>ae.Z.getState().then((i=>{t()&&(this.searchGroups.recent.list.replaceChildren(),i.recentSearch.slice(0,20).forEach((e=>fe(this,void 0,void 0,(function*(){const{dom:t}=s.default.addDialogNew({peerId:e,container:this.searchGroups.recent.list,meAsSaved:!0,avatarSize:"abitbigger",autonomous:!0});t.lastMessageSpan.append(yield e.isUser()?(0,ee.Z)(yield this.managers.appUsersManager.getUser(e.toUserId())):(0,J.Z)(e.toChatId()))})))),i.recentSearch.length?e&&this.searchGroups.recent.setActive():this.searchGroups.recent.clear())}));return Promise.all([this.managers.appUsersManager.getTopPeers("correspondents").then((e=>{if(!t())return;const i=e.findIndex((e=>e.id===a.Z.myId));-1!==i&&(e=e.slice()).splice(i,1),e.forEach((e=>{const{dom:t}=s.default.addDialogNew({peerId:e.id,container:this.searchGroups.people.list,onlyFirstName:!0,avatarSize:"bigger",autonomous:!1,noIcons:this.searchGroups.people.noIcons});t.subtitleEl.remove()})),this.searchGroups.people.toggle()})),e()])}}loadMembers(e){return fe(this,void 0,void 0,(function*(){const t="members"===e.type?this.searchContext.peerId.toChatId():void 0,i="groups"===e.type?this.searchContext.peerId.toUserId():void 0,n=this.middleware.get();let a;const o=a=>fe(this,void 0,void 0,(function*(){if(this.loadMutex&&(yield this.loadMutex,!n()))return;let o=this.membersList;o||(o=this.membersList=new g.Z({lazyLoadQueue:this.lazyLoadQueue,rippleEnabled:!1,managers:this.managers}),(0,F.fc)(o.list,(e=>{const t=(0,v.Z)(e.target,s.DIALOG_LIST_ELEMENT_TAG);if(!t)return;const i=t.dataset.peerId.toPeerId();let n=Promise.resolve();y.Z.isMobile&&(n=b.ZP.toggleSidebar(!1)),n.then((()=>{w.ZP.setInnerPeer({peerId:i})}))})),e.contentTab.append(o.list),this.afterPerforming(1,e.contentTab));const r=a.map((e=>{const s=i?e.id.toPeerId(!0):(0,te.Z)(e);if(!(t?s.isAnyChat():s.isUser()))return s})).filter(Boolean),d=yield(0,ue.Z)(r,(e=>fe(this,void 0,void 0,(function*(){const t=yield this.managers.appPeersManager.getPeer(e);return!!n()&&!(!t||t.pFlags.deleted)}))));for(const e of d)o.add(e)}));if(i){const t=this.membersList?200:50;a=this.managers.appUsersManager.getCommonChats(i,t,this.nextRates[e.inputFilter]).then((i=>{if(!n())return;const s=i.chats[i.chats.length-1];return this.nextRates[e.inputFilter]=null==s?void 0:s.id,i.chats.length{if(!n())return;const s=e.contentTab.firstElementChild;return this.nextRates[e.inputFilter]=(s?s.childElementCount:0)+t.participants.length,t.participants.length{if(!n())return;this.loaded[e.inputFilter]=!0;const i=t.participants;return"chatParticipantsForbidden"!==i._?o(i.participants):void 0}));return this.loadPromises[e.inputFilter]=a.finally((()=>{n()&&(this.loadPromises[e.inputFilter]=null)}))}))}loadType(e,t,i,s){var n,a;const o=e.inputFilter;if(this.loadPromises[o])return this.loadPromises[o];if("members"===e.type||"groups"===e.type)return this.loadMembers(e);const r=null!==(n=(a=this.historyStorage)[o])&&void 0!==n?n:a[o]=[];if(!("inputMessagesFilterEmpty"!==o||r.length||(this.loadedChats||(this.loadChats(),this.loadedChats=!0),this.searchContext.query.trim()||this.searchContext.peerId||this.searchContext.minDate)))return this.loaded[o]=!0,Promise.resolve();const d=this.loadPromises[o]=Promise.resolve().then((()=>fe(this,void 0,void 0,(function*(){var n,a;if(r.length&&this.usedFromHistory[o]this.managers.appMessagesManager.getMessageByPeer(e.peerId,e.mid))));t.push(...this.filterMessagesByType(a,o))}while(n{setTimeout((()=>{this.scrollable.checkForTriggers()}),0)}))}const l=r.length?r[r.length-1].mid:0,c=yield this.managers.appMessagesManager.getSearch(Object.assign(Object.assign({},this.searchContext),{inputFilter:{_:o},maxId:l,limit:i,nextRate:null!==(n=(a=this.nextRates)[o])&&void 0!==n?n:a[o]=0}));if(r.push(...c.history.map((e=>({mid:e.mid,peerId:e.peerId})))),s()&&((c.history.length{setTimeout((()=>{if(s()&&this.mediaTab===e){const e=this.load(!0,!0);e&&e.then((()=>{s()&&setTimeout((()=>{this.scrollable.checkForTriggers()}),0)}))}}),0)})),this.performSearchResult(this.filterMessagesByType(c.history,o),e)})))).catch((e=>{this.log.error("load error:",e)})).finally((()=>{this.loadPromises[o]=null}));return d}canLoadMediaTab(e){const t=e.inputFilter;return!this.loaded[t]||this.historyStorage[t]&&this.usedFromHistory[t]"inputMessagesFilterEmpty"!==e.inputFilter)),n=s.map((e=>({_:e.inputFilter}))),[a,o,r]=yield Promise.all([this.managers.appMessagesManager.getSearchCounters(t,n,void 0,i),this.canViewMembers(),this.canViewGroups()]);if(!e())return;if(this.loadMutex&&(yield this.loadMutex,!e()))return;let d,l=0;s.forEach((e=>{const t=a.find((t=>t.filter._===e.inputFilter));e.menuTab.classList.toggle("hide",!t.count),e.menuTab.classList.remove("active"),t.count&&(void 0===d&&(d=e),++l)}));const c=this.mediaTabsMap.get("members");[[c,o],[this.mediaTabsMap.get("groups"),r]].forEach((([e,t])=>{e&&(e.menuTab.classList.toggle("hide",!t),t&&++l)})),o&&(d=c),this.container.classList.toggle("hide",!d),this.container.parentElement.classList.toggle("search-empty",!d),d&&(this.skipScroll=!0,this.selectTab(this.mediaTabs.indexOf(d),!1),this.navScrollableContainer.classList.toggle("hide",l<=1))}))}load(e=!1,t=!1){var i;return fe(this,void 0,void 0,(function*(){const s=this.searchContext.peerId;this.log("load",e,s,this.loadPromises);const n=this.middleware.get();if(this.firstLoad){if(yield null!==(i=this.loadFirstTimePromise)&&void 0!==i?i:this.loadFirstTimePromise=this.loadFirstTime(),!n())return;this.loadFirstTimePromise=void 0,this.firstLoad=!1}let a=e?[this.mediaTab]:this.mediaTabs.filter((e=>e!==this.mediaTab));if(a=a.filter((e=>this.canLoadMediaTab(e))),s.isUser()?(0,U.Z)(a,(e=>"members"===e.type)):(0,U.Z)(a,(e=>"groups"===e.type)),!a.length)return;const o=t?50:Math.round(3*(I.Z.height/130|0)*1.25),r=a.map((e=>this.loadType(e,t,o,n)));return Promise.all(r).catch((e=>{this.log.error("Load error all promises:",e)}))}))}getMonthContainerByTimestamp(e,t){var i;const s=new Date(1e3*e);s.setHours(0,0,0),s.setDate(1);const n=s.getTime(),a=null!==(i=this.monthContainers[t])&&void 0!==i?i:this.monthContainers[t]={};if(!(n in a)){const e=document.createElement("div");e.className="search-super-month";const i=document.createElement("div");i.classList.add("search-super-month-name");const o={month:"long"};s.getFullYear()!==(new Date).getFullYear()&&(o.year="numeric");const r=new p.ZP.IntlDateElement({date:s,options:o}).element;i.append(r),e.append(i);const d=document.createElement("div");d.classList.add("search-super-month-items"),e.append(i,d);const l=(0,B.Z)(a,"desc");let c=0;for(;cl[c]);++c);a[n]={container:e,items:d},(0,S.Z)(e,this.tabs[t],c)}return a[n]}canViewMembers(){const{peerId:e}=this.searchContext;if(!e.isAnyChat()||!this.mediaTabsMap.has("members"))return Promise.resolve(!1);const t=e.toChatId();return Promise.all([this.managers.appChatsManager.isBroadcast(t),this.managers.appChatsManager.hasRights(t,"view_participants"),this.managers.appChatsManager.isForum(t)]).then((([e,t,i])=>!e&&t&&(!this.searchContext.threadId||!i)))}canViewGroups(){return fe(this,void 0,void 0,(function*(){const{peerId:e}=this.searchContext;return!(!e.isUser()||!this.mediaTabsMap.has("groups"))&&!!(yield this.managers.appProfileManager.getProfile(e.toUserId())).common_chats_count}))}cleanup(){var e;this.loadPromises={},this.loaded={},this.loadedChats=!1,this.nextRates={},this.firstLoad=!0,this.prevTabId=-1,this.lazyLoadQueue.clear(),this.mediaTabs.forEach((e=>{this.usedFromHistory[e.inputFilter]=-1})),(null===(e=this.selection)||void 0===e?void 0:e.isSelecting)&&this.selection.cancelSelection(),this.middleware.clean(),this.loadFirstTimePromise=void 0,this.cleanScrollPositions(),this.membersList=void 0}cleanScrollPositions(){this.mediaTabs.forEach((e=>{e.scroll=void 0}))}cleanupHTML(e=!1){this.mediaTabs.forEach((e=>{if(e.contentTab.replaceChildren(),this.hideEmptyTabs&&(this.container.classList.add("hide"),this.container.parentElement.classList.add("search-empty")),"chats"!==e.type&&!this.historyStorage[e.inputFilter]){const t=e.contentTab.parentElement;t.querySelector(".preloader")||(0,l.y)(t,!0);const i=t.querySelector(".content-empty");i&&i.remove()}})),this.monthContainers={},this.searchGroupMedia.clear(),this.scrollable.scrollTop=0}copySearchContext(e){const t=(0,R.Z)(this.searchContext);return t.inputFilter={_:e},t.nextRate=this.nextRates[e],t}setQuery({peerId:e,query:t,threadId:i,historyStorage:s,folderId:n,minDate:a,maxDate:o}){this.searchContext={peerId:e,query:t||"",inputFilter:{_:this.mediaTab.inputFilter},threadId:i,folderId:n,minDate:a,maxDate:o},this.historyStorage=null!=s?s:{},this.cleanup()}destroy(){var e,t;this.cleanup(),this.listenerSetter.removeAll(),this.scrollable.destroy(),null===(e=this.swipeHandler)||void 0===e||e.removeListeners(),null===(t=this.selection)||void 0===t||t.cleanup(),this.scrollStartCallback=void 0,this.onChangeTab=void 0,this.selectTab=void 0,this.searchContextMenu=void 0,this.swipeHandler=void 0,this.selection=void 0}}},5644:(e,t,i)=>{"use strict";i.d(t,{Z:()=>_});var s=i(5005),n=i(3512),a=i(8805),o=i(4789),r=i(9807),d=i(2325),l=i(8763),c=i(8497),h=i(8842),u=i(3910),p=i(5565),f=i(5701),m=i(241),g=i(2738),v=i(6690),b=i(1655),y=i(5953),w=i(4064),S=i(9331),C=i(2353),L=i(2566),E=i(177),I=i(3061),M=i(8493),Z=i(7120),P=i(8050),T=i(36),k=i(5029),x=i(5994),A=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class _{constructor(e){this.container=document.createElement("div"),this.list=s.default.createChatList(),this.chatsContainer=document.createElement("div"),this.selected=new Set,this.freezed=!1,this.folderId=0,this.offsetIndex=0,this.query="",this.loadedWhat={},this.renderedPeerIds=new Set,this.peerType=["dialogs"],this.multiSelect=!0,this.rippleEnabled=!0,this.avatarSize="abitbigger",this.exceptSelf=!1,this.tempIds={},this.selfPresence="Presence.YourChat",this.needSwitchList=!1,this.design="round",this.onInput=()=>{const e=this.input.value;if(this.query!==e){(this.peerType.includes("contacts")||this.peerType.includes("dialogs"))&&(this.cachedContacts=void 0),this.peerType.includes("dialogs")&&(this.folderId=0,this.offsetIndex=0);for(const e in this.tempIds)++this.tempIds[e];this.list=s.default.createChatList(),this.promise=void 0,this.loadedWhat={},this.query=e,this.renderedPeerIds.clear(),this.needSwitchList=!0,this.getMoreResults()}},this.checkForTriggers=()=>{this.scrollable.checkForTriggers()},(0,y.Z)(this,e),this.container.classList.add("selector","selector-"+this.design);const t=(this.renderResultsFunc||this.renderResults).bind(this);if(this.renderResultsFunc=e=>A(this,void 0,void 0,(function*(){return this.needSwitchList&&(this.scrollable.splitUp.replaceWith(this.list),this.scrollable.setVirtualContainer(this.list),this.needSwitchList=!1),e=e.filter((e=>{const t=!this.renderedPeerIds.has(e);return t&&this.renderedPeerIds.add(e),t})),this.filterPeerTypeBy&&(e=yield(0,C.Z)(e,(e=>A(this,void 0,void 0,(function*(){if(e.isPeerId()&&(yield this.managers.appPeersManager.getPeer(e)))for(const t of this.filterPeerTypeBy)if(yield this.managers.appPeersManager[t](e))return!0;return!0}))))),t(e)})),this.input=document.createElement("input"),this.input.classList.add("selector-search-input"),this.placeholder?(0,d.$d)(this.input,this.placeholder,void 0,"placeholder"):(0,d.$d)(this.input,"SendMessageTo",void 0,"placeholder"),this.input.type="text",this.multiSelect){const e=new k.Z({});e.innerContainer.classList.add("selector-search-section");const t=document.createElement("div");t.classList.add("selector-search-container"),this.selectedContainer=document.createElement("div"),this.selectedContainer.classList.add("selector-search"),this.selectedContainer.append(this.input),t.append(this.selectedContainer),this.selectedScrollable=new a.ZP(t),(0,g.fc)(this.selectedContainer,(e=>{if(this.freezed)return;let t=e.target;if(t=(0,c.Z)(t,"selector-user"),!t)return;const i=t.dataset.key,s=this.chatsContainer.querySelector('[data-peer-id="'+i+'"]');s?(0,g.tH)(s):this.remove(i.toPeerId())})),e.content.append(t),this.container.append(e.container)}this.chatsContainer.classList.add("chatlist-container");const i=new k.Z({name:this.sectionNameLangPackKey,noShadow:!0});i.content.append(this.list),this.chatsContainer.append(i.container),this.scrollable=new a.ZP(this.chatsContainer),this.scrollable.setVirtualContainer(this.list),(0,g.fc)(this.chatsContainer,(e=>{const t=(0,l.Z)(e.target,"data-peer-id");if((0,u.Z)(e),!t)return;if(this.freezed)return;let i=t.dataset.peerId;if(i=i.isPeerId()?i.toPeerId():i,!this.multiSelect)return void this.add(i);this.selected.has(i)?this.remove(i):this.add(i);const s=t.querySelector("input");s.checked=!s.checked}));const n=(0,f.Z)(this.onInput,200,!1,!0);this.input.addEventListener("input",n),this.scrollable.onScrolledBottom=()=>{this.getMoreResults()},this.scrollable.container.prepend((0,T.G)()),this.container.append(this.chatsContainer),this.appendTo.append(this.container),setTimeout((()=>{const t=this.getMoreResults();e.onFirstRender&&t.then((()=>{e.onFirstRender()}))}),0)}renderSaved(){return A(this,void 0,void 0,(function*(){this.exceptSelf||this.offsetIndex||0!==this.folderId||!this.peerType.includes("dialogs")||this.query&&!(yield this.managers.appUsersManager.testSelfSearch(this.query))||(yield this.renderResultsFunc([n.Z.myId]))}))}getTempId(e){var t,i;null!==(t=(i=this.tempIds)[e])&&void 0!==t||(i[e]=0);const s=++this.tempIds[e];return{tempId:s,middleware:()=>this.tempIds[e]===s}}getMoreDialogs(){return A(this,void 0,void 0,(function*(){if(this.loadedWhat.dialogs&&this.loadedWhat.archived)return;const e=m.Z.height/56*1.25|0,{middleware:t}=this.getTempId("dialogs"),i=this.managers.dialogsStorage.getDialogs({query:this.query,offsetIndex:this.offsetIndex,limit:e,filterId:this.folderId,skipMigrated:!0});i.catch((()=>{t()&&(this.loadedWhat[this.loadedWhat.dialogs?"archived":"dialogs"]=!0)}));const s=yield i;if(!t())return;let a=s.dialogs;if(a.length){const e=(0,P.Z)(a[a.length-1])||0;if(a=a.slice(),(0,w.Z)(a,(e=>e.peerId===n.Z.myId)),this.chatRightsActions&&(a=yield(0,C.Z)(a,(e=>this.filterByRights(e.peerId))),!t()))return;if(yield this.renderSaved(),!t())return;this.offsetIndex=e}if(this.renderResultsFunc(a.map((e=>e.peerId))),s.isEnd){if(!this.loadedWhat.dialogs){if(yield this.renderSaved(),!t())return;return this.loadedWhat.dialogs=!0,this.offsetIndex=0,this.folderId=1,this.getMoreDialogs()}if(this.loadedWhat.archived=!0,!this.loadedWhat.contacts)return this.getMoreContacts()}}))}filterByRights(e){return A(this,void 0,void 0,(function*(){const t=yield this.managers.appPeersManager.getPeer(e);return e.isUser()?"send_plain"!==this.chatRightsActions[0]||(0,M.Z)(t):!!this.chatRightsActions.every((e=>(0,Z.Z)(t,e)))||void 0}))}getMoreContacts(){return A(this,void 0,void 0,(function*(){if(this.loadedWhat.contacts)return;const e=this.peerType.includes("contacts");if(!this.cachedContacts){const{middleware:t}=this.getTempId("contacts"),i=Promise.all([e?this.managers.appUsersManager.getContactsPeerIds(this.query):[],this.query?this.managers.appUsersManager.searchContacts(this.query):void 0]);i.catch((()=>{t()&&(this.loadedWhat.contacts=!0)}));const[s,a]=yield i;if(!t())return;if(a){let i=e?a.my_results.concat(a.results):a.my_results;if(this.chatRightsActions&&(i=yield(0,C.Z)(i,(e=>this.filterByRights(e))),!t()))return;this.peerType.includes("dialogs")||(i=i.filter((e=>e.isUser()))),this.cachedContacts=(0,v.Z)(s.concat(i))}else this.cachedContacts=s.slice();(0,b.Z)(this.cachedContacts,n.Z.myId)}const t=m.Z.height/56*1.25|0,i=this.cachedContacts.splice(0,t);this.renderResultsFunc(i),this.cachedContacts.length||(this.loadedWhat.contacts=!0)}))}getMoreChannelParticipants(){var e;return A(this,void 0,void 0,(function*(){if(this.loadedWhat.channelParticipants)return;const{middleware:t}=this.getTempId("channelParticipants"),i=this.managers.appProfileManager.getParticipants(this.peerId.toChatId(),{_:"channelParticipantsSearch",q:this.query},50,this.list.childElementCount);i.catch((()=>{t()&&(this.loadedWhat.channelParticipants=!0)}));const s=yield i;if(!t())return;const{participants:a}=s,o=a.map((e=>(0,L.Z)(e)));(0,b.Z)(o,n.Z.myId),this.renderResultsFunc(o);const r=null!==(e=s.count)&&void 0!==e?e:a.length;(this.list.childElementCount>=r||a.length<50)&&(this.loadedWhat.channelParticipants=!0)}))}getMoreResults(){if(this.promise)return this.promise;const e=(()=>this.peerType.includes("dialogs")&&!this.loadedWhat.archived?this.getMoreSomething("dialogs"):!this.peerType.includes("contacts")&&!this.peerType.includes("dialogs")||this.loadedWhat.contacts?this.peerType.includes("channelParticipants")&&!this.loadedWhat.channelParticipants?this.getMoreSomething("channelParticipants"):void 0:this.getMoreSomething("contacts"))();if(!e)return Promise.resolve();const t=this.promise=e.catch((e=>{console.error("get more result error",e)})).finally((()=>{this.promise===t&&(this.promise=void 0),this.checkForTriggers()}));return t}getMoreSomething(e){return{dialogs:this.getMoreDialogs,contacts:this.getMoreContacts,channelParticipants:this.getMoreChannelParticipants}[e].call(this)}renderResults(e){return A(this,void 0,void 0,(function*(){!this.peerType.includes("dialogs")&&this.loadedWhat.contacts&&(e=yield(0,C.Z)(e,(e=>this.managers.appUsersManager.isNonContactUser(e)))),e.forEach((e=>A(this,void 0,void 0,(function*(){const{dom:t}=s.default.addDialogNew({peerId:e,container:this.scrollable,rippleEnabled:this.rippleEnabled,avatarSize:this.avatarSize});if(this.multiSelect){const i=this.selected.has(e),s=new r.Z;i&&(s.input.checked=!0),t.containerEl.prepend(s.label)}let i;i=e.isAnyChat()?yield(0,E.Z)(e.toChatId()):e===n.Z.myId?(0,d.ag)(this.selfPresence):(0,I.Z)(yield this.managers.appUsersManager.getUser(e.toUserId())),t.lastMessageSpan.append(i)}))))}))}add(e,t,i=!0){var s;if(this.selected.add(e),!this.multiSelect)return void this.onChange(this.selected.size);this.query.trim()&&(this.input.value="",this.onInput());const n=document.createElement("div");n.classList.add("selector-user","scale-in");const a=new S.Z;if(a.classList.add("selector-user-avatar","tgico","avatar-32"),a.isDialog=!0,n.dataset.key=""+e,e.isPeerId()){if(void 0===t){const i=new h.Z;i.update({peerId:e.toPeerId(),dialog:!0}),t=i.element}a.updateWithOptions({peerId:e})}return t&&("string"==typeof t?n.innerHTML=t:((0,p.Z)(n,t),n.append(t))),n.insertAdjacentElement("afterbegin",a),this.selectedContainer.insertBefore(n,this.input),null===(s=this.onChange)||void 0===s||s.call(this,this.selected.size),i&&this.selectedScrollable.scrollIntoViewNew({element:this.input,position:"center"}),n}remove(e){if(!this.multiSelect)return;const t=this.selectedContainer.querySelector(`[data-key="${e}"]`);t.classList.remove("scale-in"),t.offsetWidth,t.classList.add("scale-out");const i=()=>{this.selected.delete(e),t.remove(),this.onChange&&this.onChange(this.selected.size)};x.Z.isAvailable("animations")?t.addEventListener("animationend",i,{once:!0}):i()}getSelected(){return[...this.selected]}addInitial(e){e.forEach((e=>{this.add(e,void 0,!1)})),window.requestAnimationFrame((()=>{this.selectedScrollable.scrollIntoViewNew({element:this.input,position:"center",forceDirection:o.f.Static})}))}}},8448:(e,t,i)=>{"use strict";i.d(t,{ZP:()=>D,ns:()=>F});var s=i(3442),n=i(3013),a=i(4755),o=i(4762),r=i(3512),d=i(3910),l=i(2738),c=i(3725),h=i(3699),u=i(319),p=i(8497),f=i(2325),m=i(3251),g=i(632),v=i(9966),b=i(1507),y=i(4081),w=i(5296),S=i(3228),C=i(5157),L=i(7207),E=i(130),I=i(8115),M=i(5671),Z=i(1604),P=i(7530),T=i(2312),k=i(9492),x=i(3035),A=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function _(e=!0){const t=new s.Z({cancelable:!0,tryAgainOnFail:e});return t.construct(),e||(t.circle.setAttributeNS(null,"r","23"),t.totalLength=143.58203125),t}r.Z.addEventListener("messages_media_read",(({mids:e,peerId:t})=>{e.forEach((e=>{const i=`[data-mid="${e}"][data-peer-id="${t}"]`;Array.from(document.querySelectorAll(`audio-element.is-unread${i}, .media-round.is-unread${i}`)).forEach((e=>{e.classList.remove("is-unread")}))}))}));const F=(e,t)=>{let i,s;const n=!e.classList.contains("search-super-item"),a=(0,p.Z)(e,n?"bubbles-inner":"tabs-tab");if(a){const t=':not([data-is-outgoing="1"])',o=`.audio:not(.is-voice)${t}`;let r;if(r=e.matches(o)?[o]:[`.audio.is-voice${t}`,`.media-round${t}`],n){const e=".bubble:not(.webpage) ";r=r.map((t=>e+t))}const d=r.join(", "),l=Array.from(a.querySelectorAll(d)),c=l.indexOf(e),h=l.map((e=>({peerId:e.dataset.peerId.toPeerId(),mid:+e.dataset.mid})));i=h.slice(0,c),s=h.slice(c+1)}return(s.length&&s[0].midt)&&([i,s]=[s.reverse(),i.reverse()]),[i,s]};class D extends HTMLElement{constructor(){super(...arguments),this.withTime=!1,this.voiceAsMusic=!1,this.showSender=!1,this.listenerSetter=new h.Z}render(){var e,t,i;return A(this,void 0,void 0,(function*(){this.classList.add("audio"),this.managers=r.Z.managers,this.dataset.mid=""+this.message.mid,this.dataset.peerId=""+this.message.peerId;const s=(0,P.Z)(this.message),o="voice"===s.type,h=!this.voiceAsMusic&&o,b=this.message.pFlags.is_outgoing,F=null===(e=this.message)||void 0===e?void 0:e.uploadingFileName,D=()=>{const e=this.audio&&this.audio.readyState>=this.audio.HAVE_CURRENT_DATA?this.audio.duration:s.duration;return(0,C.Z)(0|e)};this.innerHTML='\n
\n
\n
\n
\n
\n
';const R=this.firstElementChild,B=document.createElement("div");B.classList.add("audio-download"),"audio"!==s.type&&this.message&&this.message.pFlags.media_unread&&this.classList.add("is-unread"),F&&(this.classList.add("is-outgoing"),this.append(B));const N=yield h?function(e){return A(this,void 0,void 0,(function*(){e.classList.add("is-voice");const t=e.message,i=(0,P.Z)(t);t.pFlags.out&&e.classList.add("is-out");let s=i.attributes.find((e=>"documentAttributeAudio"===e._)).waveform||new Uint8Array([]);s=function(e){e instanceof Uint8Array||(e=new Uint8Array(e));const t=8*e.length/5|0;if(!t)return new Uint8Array([]);let i;try{const s=new DataView(e.buffer);i=new Uint8Array(t);for(let e=0;e>n&31}}catch(e){i=new Uint8Array([])}return i}(s.slice(0,63));const{svg:n,container:o,availW:r}=function(e,t){const i=a.Z.isMobile?16:23,s=a.Z.isMobile?152:190,n=a.Z.isMobile?190:256,o=(0,S.Z)(t/60*n,s,n),r=Math.max(...e),d=e.length,l=Math.min(o/4|0,d);let c=0;const h=i-4;let u,p,f="";for(let t=0,s=0,n=0;t=d){n=n+l-d,n<(l+1)/2&&c`,s+=4,c=n<(l+1)/2?0:a}else c',t.append(i),t.onclick=()=>{const n=((0,p.Z)(e,"document-wrapper")||(0,p.Z)(e,"quote-text")).querySelector(".audio-transcribed-text");if(0===e.transcriptionState)if(n)n.classList.remove("hide"),i.classList.remove("tgico-transcribe"),i.classList.add("tgico-up"),e.transcriptionState=2;else{const i=e.message;if(i.pFlags.is_outgoing)return;e.transcriptionState=1,!s.parentElement&&t.append(s),(0,x.d1)().then((()=>{1===e.transcriptionState&&s.classList.add("active")})),e.managers.appMessagesManager.transcribeAudio(i).catch(u.Z)}else 2===e.transcriptionState&&(n.classList.add("hide"),i.classList.remove("tgico-up"),i.classList.add("tgico-transcribe"),e.transcriptionState=0)},e.append(t)}let m,g=n;return g||(m=new L.Z,h.append(m.container)),()=>{let t=e.audio;const s=()=>{c&&(c.style.width=t.currentTime/t.duration*100+"%")};(!t.paused||t.currentTime>0&&t.currentTime!==t.duration)&&s();const n=(0,v.Z)(s);return e.addAudioListener("timeupdate",n),e.addAudioListener("ended",n),e.addAudioListener("play",(()=>{(0,w.cK)((()=>!!t&&(s(),!t.paused)),e)})),g&&e.readyPromise.then((()=>{let i=!1,s=!1;function n(e){let i;if(e instanceof MouseEvent)i=e.offsetX;else{const t=e.target.getBoundingClientRect();i=e.targetTouches[0].pageX-t.left}const s=i/r*t.duration;t.currentTime=s}g.addEventListener("mouseleave",(t=>{i&&(e.togglePlay(void 0,!0),i=!1),s=!1})),g.addEventListener("mousemove",(e=>{s=!0,i&&n(e)})),g.addEventListener("mousedown",(s=>{s.preventDefault(),0===s.button&&(t.paused||e.togglePlay(void 0,!1),n(s),i=!0)})),g.addEventListener("mouseup",(t=>{s&&i&&(e.togglePlay(void 0,!0),i=!1)})),(0,l.fc)(g,(e=>{(0,d.Z)(e),t.paused||n(e)}))}),u.Z),!g&&m.setMedia({media:t,streamable:i.supportsStreaming,duration:i.duration}),()=>{null==g||g.remove(),g=null,t=null}}}))}(this):function(e){var t;return A(this,void 0,void 0,(function*(){const i=e.withTime,s=e.message,n=(0,P.Z)(s),a="voice"===n.type||"round"===n.type,o=document.createElement("div");o.classList.add("audio-description");const r=n.attributes.find((e=>"documentAttributeAudio"===e._));if(!a){const t=[];(null==r?void 0:r.performer)&&t.push((0,I.Z)(r.performer)),i?t.push((0,g.OD)(s.date)):t.length||t.push((0,y.Z)(n.size)),e.showSender&&t.push(yield(0,M.Z)(s)),o.append(...(0,f.A1)(t," • "))}e.insertAdjacentHTML("beforeend",'\n
\n
\n
\n
');const d=e.querySelector(".audio-title"),l=new m.I;l.dataset.fontWeight=e.dataset.fontWeight,l.dataset.fontSize=e.dataset.fontSize,l.dataset.sizeType=e.dataset.sizeType,l.getSize=e.getSize,a?l.append(yield(0,M.Z)(s)):(0,E.Z)(l,(0,I.Z)(null!==(t=null==r?void 0:r.title)&&void 0!==t?t:n.file_name)),d.append(l),e.showSender&&d.append((0,Z.Z)(s));const c=e.querySelector(".audio-subtitle");return c.append(o),()=>{let t=!1,i=new L.Z;i.setMedia({media:e.audio,streamable:n.supportsStreaming,duration:n.duration}),e.addAudioListener("ended",(()=>{e.classList.remove("audio-show-progress"),c.lastChild.replaceWith(o),t=!1}));const s=()=>{t||(e.classList.add("audio-show-progress"),t=!0,i&&c.lastChild.replaceWith(i.container))};return e.addAudioListener("play",s),(!e.audio.paused||e.audio.currentTime>0)&&s(),()=>{i.removeListeners(),i.container.remove(),i=null}}}))}(this),O=this.querySelector(".audio-time");O.textContent=D();const U=this.onLoad=e=>{this.onLoad=void 0;const t=this.audio=n.Z.addMedia(this.message,e),i=this.readyPromise=(0,c.Z)();this.audio.readyState>=this.audio.HAVE_CURRENT_DATA?i.resolve():this.addAudioListener("canplay",(()=>i.resolve()),{once:!0}),this.onTypeDisconnect=N();const s=()=>(0,C.Z)(0|t.currentTime)+(h?" / "+D():""),a=()=>{O.innerText=s(),R.classList.toggle("playing",!t.paused)};(!t.paused||t.currentTime>0&&t.currentTime!==t.duration)&&a(),(0,l.fc)(R,(e=>this.togglePlay(e)),{listenerSetter:this.listenerSetter}),this.addAudioListener("ended",(()=>{R.classList.remove("playing"),O.innerText=D()})),this.addAudioListener("timeupdate",(()=>{!t.currentTime&&t.paused||n.Z.isSafariBuffering(t)||(O.innerText=s())})),this.addAudioListener("pause",(()=>{R.classList.remove("playing")})),this.addAudioListener("play",a)};if(null===(t=s.thumbs)||void 0===t?void 0:t.length){const e=[],t=yield(0,k.Z)({photo:s,message:null,container:R,boxWidth:48,boxHeight:48,loadPromises:this.loadPromises,withoutPreloader:!0,lazyLoadQueue:this.lazyLoadQueue});R.style.width=R.style.height="",t.images.thumb&&e.push(t.images.thumb),t.images.full&&e.push(t.images.full),this.classList.add("audio-with-thumb"),e.forEach((e=>e.classList.add("audio-thumb")))}if(b)F&&(this.preloader=_(!1),this.preloader.attachPromise(T.Z.getUpload(F)),this.dataset.isOutgoing="1",this.preloader.attach(B,!1));else{let e=this.preloader;const t="audio"!==s.type;U(t);const a=this.load=(t,i)=>{if(this.load=void 0,!this.audio.src){if(n.Z.resolveWaitingForLoadMedia(this.message.peerId,this.message.mid,this.message.pFlags.is_scheduled),this.onDownloadInit(t),!e)if(s.supportsStreaming){let e;this.classList.add("corner-download");const i=()=>{const i=_(!1),s=(0,c.Z)();s.notifyAll({done:75,total:100}),s.catch((()=>{this.audio.pause(),n.Z.willBePlayed(void 0)})),s.cancel=()=>{s.cancel=u.Z;const e=new Error;e.type="CANCELED",s.reject(e)},i.attach(B,!1,s),e=this.addAudioListener("pause",(()=>{s.cancel()}),{once:!0}),this.onDownloadInit(t)},s=this.addAudioListener("play",i);this.readyPromise.then((()=>{this.listenerSetter.remove(s),e&&this.listenerSetter.remove(e)}))}else{e=_(),t||(this.readyPromise=(0,c.Z)());const i=()=>{this.onDownloadInit(t);const i=T.Z.downloadMediaURL({media:s});return t||i.then((()=>{this.readyPromise.resolve()})),e.attach(B,!1,i),{download:i}};e.setDownloadFunction(i),i()}this.classList.contains("corner-download")?R.append(B):this.append(B),this.classList.add("downloading"),this.readyPromise.then((()=>{this.classList.remove("downloading"),B.classList.add("downloaded"),setTimeout((()=>{B.remove()}),200),i||n.Z.willBePlayedMedia!==this.audio||(this.audio.play(),n.Z.willBePlayed(void 0))}))}};(null===(i=this.audio)||void 0===i?void 0:i.src)||(t?a(!1):(0,l.fc)(R,(()=>{a(!0)}),{once:!0,capture:!0,passive:!1,listenerSetter:this.listenerSetter}))}}))}onDownloadInit(e){e&&(n.Z.willBePlayed(this.audio),o.IS_SAFARI&&!this.audio.autoplay&&(this.audio.autoplay=!0))}togglePlay(e,t=this.audio.paused){e&&(0,d.Z)(e),t?(this.setTargetsIfNeeded(),this.audio.play().catch((()=>{}))):this.audio.pause()}setTargetsIfNeeded(){const e=!!this.searchContext;if(n.Z.setSearchContext(this.searchContext||{peerId:b.NM,inputFilter:{_:"inputMessagesFilterEmpty"},useSearch:!1})){const[t,i]=e?F(this,this.message.mid):[];n.Z.setTargets({peerId:this.message.peerId,mid:this.message.mid},t,i)}}playWithTimestamp(e){var t;null===(t=this.load)||void 0===t||t.call(this,!0),this.audio.currentTime=e,this.togglePlay(void 0,!0)}get addAudioListener(){return this.listenerSetter.add(this.audio)}disconnectedCallback(){setTimeout((()=>{this.isConnected||(this.onTypeDisconnect&&(this.onTypeDisconnect(),this.onTypeDisconnect=null),this.readyPromise&&this.readyPromise.reject(),this.listenerSetter&&(this.listenerSetter.removeAll(),this.listenerSetter=null),this.preloader&&(this.preloader=null))}),100)}}customElements.define("audio-element",D)},9331:(e,t,i)=>{"use strict";i.d(t,{Z:()=>C,C:()=>b});var s=i(3512),n=i(2738),a=i(3910),o=i(1784),r=i(6074);class d extends r.Z{constructor(e){super(Object.assign(Object.assign({},e),{loadMore:(e,t,i)=>{if(this.peerId.isAnyChat()||!t)return Promise.resolve({count:0,items:[]});const s=null==e?void 0:e.photoId;return this.managers.appPhotosManager.getUserPhotos(this.peerId,s,i).then((e=>{const t=e.photos.map((e=>({element:null,photoId:e})));return{count:e.count,items:t}}))}})),this.loadedAllUp=!0,this.peerId=e.peerId}}var l=i(2312),c=i(6219),h=i(8544);class u extends h.Z{constructor(e){super(new d({peerId:e,managers:s.Z.managers}),[]),this.onPrevClick=e=>{this.openMedia({photoId:e.photoId,target:e.element,fromRight:-1})},this.onNextClick=e=>{this.openMedia({photoId:e.photoId,target:e.element,fromRight:1})},this.onDownloadClick=()=>{l.Z.downloadToDisc({media:this.target.photo,queueId:c.ZP.chat.bubbles.lazyLoadQueue.queueId})},this.peerId=e,this.setBtnMenuToggle([{icon:"download",text:"MediaViewer.Context.Download",onClick:this.onDownloadClick}]),this.setListeners()}openMedia({photoId:e,target:t,fromRight:i=0,prevTargets:s,nextTargets:n}){const a=Object.create(null,{_openMedia:{get:()=>super._openMedia}});return o=this,r=void 0,l=function*(){if(this.setMoverPromise)return this.setMoverPromise;const o=yield this.managers.appPhotosManager.getPhoto(e),r=a._openMedia.call(this,{media:o,timestamp:o.date,fromId:this.peerId,fromRight:i,target:t,reverse:!1,prevTargets:s,nextTargets:n});return this.target.photoId=o.id,this.target.photo=o,r},new((d=void 0)||(d=Promise))((function(e,t){function i(e){try{n(l.next(e))}catch(e){t(e)}}function s(e){try{n(l.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof d?n:new d((function(e){e(n)}))).then(i,s)}n((l=l.apply(o,r||[])).next())}));var o,r,d,l}}var p=i(5880),f=i(9931),m=i(3624),g=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const v=({peerId:e,threadId:t})=>{let i='avatar-element[data-peer-id="'+e+'"]';t&&(i+='[data-thread-id="'+t+'"]'),Array.from(document.querySelectorAll(i)).forEach((e=>{e.update()}))};function b(e,t,i,n,a,r){return g(this,void 0,void 0,(function*(){let d=yield s.Z.managers.appProfileManager.getFullPhoto(t);if(!i()||!d)return;const l=()=>Array.from(e.querySelectorAll("img")).find((e=>!e.classList.contains("emoji")))?e:null;if(t.isAnyChat()){const e=!!n,c="inputMessagesFilterChatPhotos";if(!n&&(n=yield s.Z.managers.appMessagesManager.getSearch({peerId:t,inputFilter:{_:c},maxId:0,limit:1}).then((e=>e.history[0])),!i()))return;if(n){n.action.photo.id!==d.id&&(e||(n=s.Z.managers.appMessagesManager.generateFakeAvatarMessage(t,d)));const i=e=>e.map((e=>({element:e.element,mid:e.item.mid,peerId:e.item.peerId})));return void(new o.Z).setSearchContext({peerId:t,inputFilter:{_:c}}).openMedia({message:n,target:l(),prevTargets:a?i(a):void 0,nextTargets:r?i(r):void 0})}}if(d){!(0,p.Z)(n)&&n&&(d=yield s.Z.managers.appPhotosManager.getPhoto(n));const e=e=>e.map((e=>({element:e.element,photoId:e.item})));new u(t).openMedia({photoId:d.id,target:l(),prevTargets:a?e(a):void 0,nextTargets:r?e(r):void 0})}}))}s.Z.addEventListener("avatar_update",v),s.Z.addEventListener("peer_title_edit",(e=>g(void 0,void 0,void 0,(function*(){(yield s.Z.managers.appAvatarsManager.isAvatarCached(e.peerId))||v(e)}))));const y=new Map,w=new Set;function S(e,t){return e+(t?"_"+t:"")}class C extends HTMLElement{constructor(){super(),this.addedToQueue=!1,this.classList.add("avatar-like"),this.middlewareHelper=(0,m.k)()}disconnectedCallback(){var e;const t=S(this.peerId,this.threadId),i=y.get(t);(null==i?void 0:i.has(this))&&(i.delete(this),i.size||y.delete(t)),null===(e=this.lazyLoadQueue)||void 0===e||e.delete({div:this})}attachClickEvent(){let e=!1;(0,n.fc)(this,(t=>g(this,void 0,void 0,(function*(){if((0,a.Z)(t),e)return;const i=this.peerId;e=!0,yield b(this,this.peerId,(()=>this.peerId===i)),e=!1}))))}updateOptions(e){for(const t in e)this[t]=e[t]}updateWithOptions(e){var t;const i=this.peerId,s=this.threadId;this.updateOptions(e);const n=this.peerId,a=this.threadId;if(i===n&&s===a)return;if(this.dataset.peerId=""+n,a?this.dataset.threadId=""+a:s&&delete this.dataset.threadId,i){const e=S(i,s),t=y.get(e);t&&(t.delete(this),t.size||y.delete(e))}const o=null===(t=e.wrapOptions)||void 0===t?void 0:t.middleware;return this.middlewareHelper.destroy(),o?this.middlewareHelper=o.create():this.middlewareHelper.destroy(),this.update()}remove(){this.middlewareHelper.destroy(),super.remove()}r(e=!1){const t=(0,f.Z)({div:this,peerId:this.peerId,isDialog:this.isDialog,title:this.peerTitle,onlyThumb:e,isBig:this.isBig,threadId:this.threadId,wrapOptions:Object.assign({middleware:this.middlewareHelper.get()},this.wrapOptions||{})});return this.loadPromises&&(this.loadPromises.push(t),t.finally((()=>{this.loadPromises=void 0}))),t}update(){if(this.lazyLoadQueue){if(!w.has(this.peerId)){if(this.addedToQueue)return;this.addedToQueue=!0;const e=S(this.peerId,this.threadId);let t=y.get(e);return t||y.set(e,t=new Set),t.add(this),this.lazyLoadQueue.push({div:this,load:()=>(w.add(this.peerId),this.update())}),this.r(!0)}this.addedToQueue&&this.lazyLoadQueue.delete({div:this})}w.add(this.peerId);const e=this.r();this.addedToQueue&&e.finally((()=>{this.addedToQueue=!1}));const t=S(this.peerId,this.threadId),i=y.get(t);if(i){i.delete(this);const e=Array.from(i);y.delete(t);for(let t=0,i=e.length;t{"use strict";i.d(t,{Z:()=>o});var s=i(2738),n=i(1168),a=i(6765);class o{constructor(e,t){this.container=document.createElement("div"),this.container.classList.add("avatar-edit"),this.canvas=document.createElement("canvas"),this.canvas.classList.add("avatar-edit-canvas"),this.icon=document.createElement("span"),this.icon.classList.add("tgico","tgico-cameraadd"),this.container.append(this.canvas,this.icon),(0,s.fc)(this.container,(()=>{n.Z.createPopup(a.Z,t).open(this.canvas,e)}))}clear(){this.canvas.getContext("2d").clearRect(0,0,this.canvas.width,this.canvas.height)}}},4494:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(2325),n=i(1405);function a(e,t={}){const i=document.createElement(t.asLink?"a":t.asDiv?"div":"button");return i.className=e+(t.icon?" tgico-"+t.icon:""),t.noRipple||(t.rippleSquare&&i.classList.add("rp-square"),(0,n.Z)(i)),t.onlyMobile&&i.classList.add("only-handhelds"),t.disabled&&i.setAttribute("disabled","true"),t.text&&i.append((0,s.ag)(t.text)),i}},8119:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(4494);const n=(e={})=>(0,s.Z)("btn-circle btn-corner z-depth-1"+(e.className?" "+e.className:""),e)},2230:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(4494);const n=(e,t={})=>(0,s.Z)("btn-icon",Object.assign({icon:e||void 0},t))},3003:(e,t,i)=>{"use strict";i.d(t,{Z:()=>v,b:()=>g});var s=i(7238),n=i(3416),a=i(3910),o=i(2738),r=i(8497),d=i(130),l=i(2325),c=i(9492),h=i(8812),u=i(8222),p=i(4762),f=i(1405);function m(e){if(e.element)return[e.separator,e.element].filter(Boolean);const{icon:t,iconDoc:i,text:s,onClick:m,checkboxField:g,noCheckboxClickListener:v}=e,b=document.createElement("div");b.className="btn-menu-item rp-overflow"+(t?" tgico-"+t:""),p.IS_MOBILE&&(0,f.Z)(b);let y=e.textElement;if(y||(y=e.textElement=s?(0,l.ag)(s,e.textArgs):document.createElement("span"),e.regularText&&(0,d.Z)(y,e.regularText)),i){const t=document.createElement("span");t.classList.add("btn-menu-item-icon"),b.append(t),e.loadPromise=(0,c.Z)({container:t,photo:i,boxWidth:24,boxHeight:24,withoutPreloader:!0,noFadeIn:!0,noBlur:!0,processUrl:e=>fetch(e).then((e=>e.text())).then((e=>{const t=u.Z.getProperty("primary-text-color"),i=(new DOMParser).parseFromString(e,"image/svg+xml").firstElementChild;return i.querySelectorAll("path").forEach((e=>{e.setAttributeNS(null,"fill",t),e.style.stroke=t,e.style.strokeWidth=".25px"})),(0,h.Z)(i.outerHTML)}))}).then((e=>e.loadPromises.thumb))}y.classList.add("btn-menu-item-text"),b.append(y);const w=!!g||!!e.keepOpen;return m&&(0,o.fc)(b,(t=>{var i;(0,a.Z)(t);const s=(0,r.Z)(t.target,"btn-menu");s&&!s.classList.contains("active")||(m(t),!1!==(null===(i=e.checkForClose)||void 0===i?void 0:i.call(e))&&(w||n.Z.close(),g&&!v&&(g.checked="radio"===g.input.type||!g.checked)))}),e.options),g&&b.append(g.label),!0===e.separator&&(e.separator=document.createElement("hr")),e.multiline&&b.classList.add("is-multiline"),[e.separator,e.element=b].filter(Boolean)}function g({listenerSetter:e,buttons:t}){const i=document.createElement("div");i.classList.add("btn-menu"),e&&t.forEach((t=>{t.options?t.options.listenerSetter=e:t.options={listenerSetter:e}}));const n=t.map(m);return i.append(...(0,s.Z)(n)),i}function v(e){return t=this,i=void 0,n=function*(){const t=g(e);return yield Promise.all(e.buttons.map((({loadPromise:e})=>e))),t},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n}},5322:(e,t,i)=>{"use strict";i.d(t,{Z:()=>u,v:()=>h});var s=i(3416),n=i(3910),a=i(2738),o=i(3699),r=i(2230),d=i(3003),l=i(2353),c=i(3035);function h({el:e,onOpen:t,options:i,onClose:o}){((null==i?void 0:i.listenerSetter)?i.listenerSetter.add(e):e.addEventListener.bind(e))(a.pf,(i=>{if(!e.classList.contains("btn-menu-toggle")||(0,a.Cf)(i))return!1;if((0,n.Z)(i),e.classList.contains("menu-open"))s.Z.close();else{const n=null==t?void 0:t(i),a=()=>{const t=e.querySelector(".btn-menu");s.Z.openBtnMenu(t,o)};n instanceof Promise?n.then(a):a()}}))}function u({buttonOptions:e,listenerSetter:t,container:i,direction:s,buttons:n,onOpenBefore:a,onOpen:u,onClose:p,onCloseAfter:f}){e&&(e.asDiv=!0);const m=null!=i?i:(0,r.Z)("more",e);m.classList.add("btn-menu-toggle");const g=new o.Z;let v,b;return h({el:m,onOpen:e=>{return t=this,i=void 0,r=function*(){if(yield null==a?void 0:a(e),b)return clearTimeout(b),void(b=void 0);const t=yield(i=n,(0,l.Z)(i,(e=>{var t,i;return null===(i=null===(t=null==e?void 0:e.verify)||void 0===t?void 0:t.call(e))||void 0===i||i})));var i;if(!t.length)return;const o=v=yield(0,d.Z)({buttons:t,listenerSetter:g});o.classList.add(s),yield null==u?void 0:u(e,o),m.append(o),yield(0,c.d1)()},new((o=void 0)||(o=Promise))((function(e,s){function n(e){try{d(r.next(e))}catch(e){s(e)}}function a(e){try{d(r.throw(e))}catch(e){s(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(n,a)}d((r=r.apply(t,i||[])).next())}));var t,i,o,r},options:{listenerSetter:t},onClose:()=>{null==p||p(),b=window.setTimeout((()=>{null==f||f(),b=void 0,g.removeAll(),n.forEach((e=>e.element=void 0)),v.remove()}),300)}}),m}},5729:(e,t,i)=>{"use strict";i.d(t,{zp:()=>Dt,O3:()=>Ot,ZP:()=>Gt,ZK:()=>Vt});var s=i(5432),n=i(3512),a=i(1655),o=i(6519),r=i(4484),d=i(9331),l=i(1507),c=i(7625),h=i(54),u=i(4993);class p{constructor(e,t,i){this.container=document.createElement("div"),this.container.classList.add("bubbles-group"),this.chat=e,this.groups=t,this.items=[],this.dateTimestamp=i,this.offset=0}createAvatar(e){if(this.avatarLoadPromise)return this.avatarLoadPromise;if("messageService"===e._)return;this.avatarContainer=document.createElement("div"),this.avatarContainer.classList.add("bubbles-group-avatar-container"),++this.offset;const t=e.fwd_from,i=e.fwdFromId,s=e.from_id&&"peerChannel"===e.from_id._&&e.fromId===i,a=this.chat.peerId;this.avatar=new d.Z,this.avatar.classList.add("bubbles-group-avatar","user-avatar","avatar-40");const o=(t&&(a===n.Z.myId||a===l.hj)||s?i:e.fromId)||l.NM,r=this.avatar.updateWithOptions({lazyLoadQueue:this.chat.bubbles.lazyLoadQueue,peerId:o,peerTitle:!i&&t&&t.from_name?t.from_name:void 0});return this.avatarLoadPromise=r,this.avatarContainer.append(this.avatar),this.container.append(this.avatarContainer),this.avatarLoadPromise}get firstTimestamp(){return this.firstItem.timestamp}get firstMid(){return this.firstItem.mid}get firstItem(){return this.items[this.items.length-1]}get lastTimestamp(){return this.lastItem.timestamp}get lastMid(){return this.lastItem.mid}get lastItem(){return this.items[0]}updateClassNames(){const e=this.items,t=e.length;if(!t)return;const i=e[t-1].bubble;if(1===e.length)return void i.classList.add("is-group-first","is-group-last");i.classList.remove("is-group-last"),i.classList.add("is-group-first");for(let i=1,s=t-1;i{this.mountItem(e,s-1-i,t)})),e&&this.updateClassNames(),this.onItemMount()}mountItem(e,t=this.items.indexOf(e),i=this.offset){e.mounted||((0,r.Z)(e.bubble,this.container,i+t),e.mounted=!0)}unmountItem(e){e.mounted&&(e.bubble.remove(),e.mounted=!1,this.onItemUnmount())}onItemMount(){if(this.mounted)return;const e=this.chat.bubbles.getDateContainerByTimestamp(this.dateTimestamp/1e3),t=this.groups.groups.filter((e=>e.dateTimestamp===this.dateTimestamp)),i=t.length,s=t.indexOf(this),n=t.slice(s+1).reduce(((e,t)=>e+(t.mounted?0:1)),0);(0,r.Z)(this.container,e.container,Ot+i-1-s-n),this.mounted=!0}onItemUnmount(){this.mounted&&(this.items.length?this.updateClassNames():(this.container.remove(),this.chat.bubbles.deleteEmptyDateGroups(),this.mounted=!1))}}class f{constructor(e){this.chat=e,this.itemsArr=[],this.itemsMap=new Map,this.groups=[],this.newGroupDiff=121,this.sortItemsKey="scheduled"===e.type?"timestamp":"mid",this.sortGroupsKey="scheduled"===e.type?"lastTimestamp":"lastMid",this.sortGroupItemsKey="groupMid"}removeItem(e){var t;null===(t=e.group)||void 0===t||t.removeItem(e),this.removeItemFromCache(e)}removeAndUnmountBubble(e){const t=this.getItemByBubble(e);if(!t)return e.parentElement&&e.remove(),!1;const i=this.itemsArr,s=i.indexOf(t),n=this.getSiblingsAtIndex(s,i),a=t.group;this.removeItem(t);const o=new Set;a&&(a.unmountItem(t),o.add(a));const[r,d]=n;if(r&&d&&this.canItemsBeGrouped(r,d)&&r.group!==d.group){const e=d.group;this.f(d.group.items),e.onItemUnmount(),o.add(r.group),this.groupUngrouped()}return this.mountUnmountGroups(Array.from(o)),!0}mountUnmountGroups(e){const[t,i]=(0,h.Z)(e,(e=>!!e.items.length));i.forEach((e=>{e.onItemUnmount()})),t.forEach((e=>{e.mount(!0)}))}f(e,t=0,i=e.length){for(;ts.add(e)))}}return s}cleanup(){this.itemsArr=[],this.groups=[],this.itemsMap.clear()}}var m=i(2986),g=i(4524),v=i(9298),b=i(3442),y=i(8805),w=i(5117),S=i(5814),C=i(4755),L=i(4762),E=i(2325),I=i(1405),M=i(632),Z=i(130),P=i(2559),T=i(2946),k=i(8115),x=i(8842),A=i(6700),_=i(5565),F=i(2149);const D="replies-element";n.Z.addEventListener("replies_updated",(e=>{Array.from(document.querySelectorAll(D+`[data-post-key="${e.peerId}_${e.mid}"]`)).forEach((t=>{t.message=e,t.render()}))}));class R extends HTMLElement{constructor(){super(),this.updated=!1,this.managers=n.Z.managers}init(){this.render(),this.dataset.postKey=this.message.peerId+"_"+this.message.mid,this.classList.add("replies","replies-"+this.type)}render(){const e=this.message.replies;if("footer"===this.type){let t;this.firstElementChild&&(t=this.firstElementChild),(null==e?void 0:e.recent_repliers)?(t&&!t.classList.contains("replies-footer-avatars")&&(this.innerHTML="",t=null),this.stackedAvatars||(this.stackedAvatars=new F.Z({lazyLoadQueue:this.lazyLoadQueue,avatarSize:30}),this.stackedAvatars.container.classList.add("replies-footer-avatars")),t=this.stackedAvatars.container,this.stackedAvatars.render(e.recent_repliers.map((e=>(0,T.Z)(e))),this.loadPromises)):(t&&!t.classList.contains("tgico-comments")&&(t.remove(),t=null),t||(t=document.createElement("span"),t.classList.add("tgico-comments"))),t.parentElement||this.prepend(t),this.text||(this.text=new E.ZP.IntlElement);const i=this.text;if(e?e.replies?i.compareAndUpdate({key:"Comments",args:[e.replies]}):i.compareAndUpdate({key:"LeaveAComment"}):i.compareAndUpdate({key:"ViewInChat"}),e){let t=!1;e.replies&&void 0!==e.read_max_id&&void 0!==e.max_id&&(t=e.read_max_id${(null==e?void 0:e.replies)?(0,P.Z)(e.replies,0):""}`;!e||this.updated||this.message.pFlags.is_outgoing||(this.managers.appMessagesManager.subscribeRepliesThread(this.message.peerId,this.message.mid),this.managers.appMessagesManager.updateMessage(this.message.peerId,this.message.mid,"replies_updated"),this.updated=!0),this.loadPromises&&(this.loadPromises=void 0)}}customElements.define(D,R);const B=()=>{const e=document.createElement("i");return e.classList.add("edited"),(0,E.$d)(e,"EditedMessage"),e},N=()=>(0,E.ag)("SponsoredMessage");var O;!function(e){e.setTime=e=>{var t;const{chatType:i,message:s}=e,n=new Date(1e3*s.date),a=[];let o,r;const d=!!s.pFlags.sponsored,l=!("action"in s)&&!d,c=d?void 0:(0,M.mr)(n);if(l){if(s.views){const e=s.post_author||(null===(t=s.fwd_from)||void 0===t?void 0:t.post_author),i=document.createElement("span");i.classList.add("post-views"),i.innerHTML=(0,P.Z)(s.views,1);const n=document.createElement("i");if(n.classList.add("tgico-channelviews","time-icon"),a.push(i,n),e){const t=document.createElement("span");(0,Z.Z)(t,(0,k.Z)(e)),t.insertAdjacentHTML("beforeend",", "),a.push(t)}}if(s.edit_date&&"scheduled"!==i&&!s.pFlags.edit_hide&&a.unshift(o=B()),"pinned"!==i&&s.pFlags.pinned){const e=document.createElement("i");e.classList.add("tgico-pinnedchat","time-icon"),a.unshift(e)}}else d&&a.push(r=N());c&&a.push(c);let h=d?void 0:(0,M.xE)(n);l&&(h+=(s.edit_date&&!s.pFlags.edit_hide?`\nEdited: ${(0,M.xE)(new Date(1e3*s.edit_date))}`:"")+(s.fwd_from?`\nOriginal: ${(0,M.xE)(new Date(1e3*s.fwd_from.date))}`:""));const u=document.createElement("span");u.classList.add("time","tgico"),u.append(...a);const p=document.createElement("div");p.classList.add("inner","tgico"),h&&(p.title=h);let f=a;return o&&(f[f.indexOf(o)]=B()),r&&(f[f.indexOf(r)]=N()),f=f.map((e=>e instanceof HTMLElement&&!e.classList.contains("i18n")&&!e.classList.contains("reactions")?e.cloneNode(!0):e)),c&&(f[f.length-1]=(0,M.mr)(n)),p.append(...f),u.append(p),u},e.renderReplies=({bubble:e,bubbleContainer:t,message:i,messageDiv:s,loadPromises:n,lazyLoadQueue:a})=>{const o=!e.classList.contains("sticker")&&!e.classList.contains("emoji-big")&&!e.classList.contains("round"),r=new R;return r.message=i,r.type=o?"footer":"beside",r.loadPromises=n,r.lazyLoadQueue=a,r.init(),t.prepend(r),o},e.setReply=({chat:e,bubble:t,bubbleContainer:i,message:s})=>{return a=this,o=void 0,d=function*(){const a=!i;a&&(i=t.querySelector(".bubble-content"));const o=a?i.querySelector(".reply"):null;if(!s.reply_to_mid)return null==o||o.remove(),void t.classList.remove("is-reply");const r=s.reply_to.reply_to_peer_id?(0,T.Z)(s.reply_to.reply_to_peer_id):e.peerId,d=yield n.Z.managers.appMessagesManager.getMessageByPeer(r,s.reply_to_mid);let l,c;if(d){const e=d.fwdFromId;c=s.fwdFromId&&s.fwdFromId===e?s.fwdFromId:d.fromId||e,l=new x.Z({peerId:c,dialog:!1,onlyFirstName:!1,plainText:!1}).element}else n.Z.managers.appMessagesManager.fetchMessageReplyTo(s),e.bubbles.needUpdate.push({replyToPeerId:r,replyMid:s.reply_to_mid,mid:s.mid}),l=(0,E.ag)("Loading");const{container:h,fillPromise:u}=(0,A.Z)(l,void 0,e.animationGroup,d,e.isAnyGroup?c:void 0);return yield u,o?(o.classList.contains("floating-part")&&h.classList.add("floating-part"),o.replaceWith(h)):i.append(h),t.classList.add("is-reply"),h},new((r=void 0)||(r=Promise))((function(e,t){function i(e){try{n(d.next(e))}catch(e){t(e)}}function s(e){try{n(d.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,s)}n((d=d.apply(a,o||[])).next())}));var a,o,r,d}}(O||(O={}));var U=i(2153),H=i(3699),z=i(8448),j=i(4789),G=i(8594),V=i(3035),K=i(3725),W=i(410),$=i(252),q=i(8497),Y=i(4668),Q=i(2796),X=i(3624),J=i(3910),ee=i(2738),te=i(5705),ie=i(2359),se=i(2648),ne=i(5296),ae=i(8938),oe=i(5701),re=i(586),de=i(241),le=i(6272),ce=i(1784),he=i(9099),ue=i(2416),pe=i(8763),fe=i(5975),me=i(8939),ge=i(993),ve=i(4494),be=i(8204),ye=i(1842),we=i(8737),Se=i(8947),Ce=i(5418),Le=i(286),Ee=i(7401),Ie=i(4881);class Me{constructor(e){this.observing=new Map,this.observingQueue=new Map,this.freezedObservingNew=!1,this.observer=new IntersectionObserver((e=>{const t=this.observing;for(let i=0,s=e.length;i({w:e.size.w,h:e.size.h}))),maxWidth:C.Z.active.album.width,minWidth:100,spacing:2,forMedia:!0});const{width:p,height:f}=t.style,m=parseInt(p),g=parseInt(f);u.forEach(((e,s)=>{var n;const{size:r,media:u,message:p}=e,f=!!(null===(n=p.media.pFlags)||void 0===n?void 0:n.spoiler),v=t.children[s];v.dataset.mid=""+p.mid,v.dataset.peerId=""+p.peerId;const b=v.firstElementChild;let y;if(y="photo"===u._?(0,nt.Z)({photo:u,message:p,container:b,boxWidth:0,boxHeight:0,isOut:o,lazyLoadQueue:a,middleware:i,size:r,loadPromises:d,autoDownloadSize:l.photo,managers:c}):(0,at.Z)({doc:u,container:b,message:p,boxWidth:0,boxHeight:0,withTail:!1,isOut:o,lazyLoadQueue:a,middleware:i,loadPromises:d,autoDownload:l,managers:c,noAutoplayAttribute:f}),y&&(null==d||d.push(y)),f){const e=(y||Promise.resolve()).then((()=>{return e=this,t=void 0,n=function*(){if(!i())return;const{width:e,height:t}=v.style,s=+e.slice(0,-1)/100*m,n=+t.slice(0,-1)/100*g,a=yield(0,st.ZP)({media:u,animationGroup:h,middleware:i,width:s,height:n});i()&&b.append(a)},new((s=void 0)||(s=Promise))((function(i,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,r)}d((n=n.apply(e,t||[])).next())}));var e,t,s,n}));null==d||d.push(e)}}))}var rt=i(296);function dt(e){var t;const i=null===(t=e.media)||void 0===t?void 0:t.document;return["voice","audio","video"].includes(null==i?void 0:i.type)&&i.duration||void 0}var lt=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))},ct=i(6219),ht=i(4332),ut=i(3552),pt=i(5005);class ft extends ut._{init(e){return t=this,i=void 0,n=function*(){this.container.id="poll-results-container",this.container.classList.add("chatlist-container"),this.resultsDiv=document.createElement("div"),this.resultsDiv.classList.add("poll-results"),this.scrollable.append(this.resultsDiv);const t=yield this.managers.appPollsManager.getPoll(e.media.poll.id);this.setTitle(t.poll.pFlags.quiz?"PollResults.Title.Quiz":"PollResults.Title.Poll");const i=document.createElement("h3");(0,Z.Z)(i,(0,k.Z)(t.poll.question));const s=t.results.results.map((e=>e.voters/t.results.total_voters*100));bt(s);const n=document.createDocumentFragment();t.results.results.forEach(((i,a)=>{if(!i.voters)return;const o=document.createElement("hr"),r=t.poll.answers[a],d=document.createElement("div");d.classList.add("poll-results-answer");const l=document.createElement("div");(0,Z.Z)(l,(0,k.Z)(r.text));const c=document.createElement("div");c.innerText=Math.round(s[a])+"%",d.append(l,c);const h=pt.default.createChatList();h.classList.add("poll-results-voters"),pt.default.setListClickListener(h,(()=>{ht.ZP.onCloseBtnClick()}),void 0,!0),h.style.minHeight=48*Math.min(i.voters,4)+"px",n.append(o,d,h);let u,p=4,f=!1,m=Math.max(0,i.voters-4);const g=()=>{f||(f=!0,this.managers.appPollsManager.getVotes(e,r.option,u,p).then((e=>{e.votes.forEach((e=>{const{dom:t}=pt.default.addDialogNew({peerId:e.user_id.toPeerId(!1),container:h,rippleEnabled:!1,meAsSaved:!1,avatarSize:"small"});t.lastMessageSpan.parentElement.remove()})),u&&(m=Math.max(0,m-e.votes.length),m&&v.lastElementChild.replaceWith((0,E.ag)("PollResults.LoadMore",[Math.min(20,m)]))),u=e.next_offset,p=20,m&&e.votes.length||v.remove()})).finally((()=>{f=!1})))},v=(0,ve.Z)("poll-results-more btn btn-primary btn-transparent",{icon:"down"});v.addEventListener("click",g),v.append((0,E.ag)("PollResults.LoadMore",[Math.min(20,m)])),n.append(v),g()})),this.resultsDiv.append(i,n),ht.ZP.toggleSidebar(!0).then((()=>{}))},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n}}var mt=i(5157),gt=i(5994);let vt=0;const bt=e=>{const t=e.reduce(((e,t)=>e+Math.round(t)),0);if(t>100){const i=t-100,s=e.length;for(let t=0;t=.5&&si&&(i=s,t=n)}if(-1===t)return;e[t]+=1-i}}};n.Z.addEventListener("poll_update",(({poll:e,results:t})=>{Array.from(document.querySelectorAll(`poll-element[poll-id="${e.id}"]`)).forEach((i=>{i.isClosed=!!e.pFlags.closed,i.performResults(t,e.chosenIndexes)}))})),C.Z.addEventListener("resize",(()=>{Et.setMaxLength(),Et.resizePolls()})),C.Z.addEventListener("changeScreen",(()=>{Et.setMaxLength()}));const yt=(e,t,i)=>{e.classList.remove("active"),clearTimeout(i),setTimeout((()=>{t(),e.remove(),wt===e&&St===t&&Ct===i&&(wt=St=null,Ct=0)}),200)};let wt,St,Ct,Lt=!1;class Et extends HTMLElement{constructor(){super(...arguments),this.isClosed=!1,this.isQuiz=!1,this.isRetracted=!1,this.isPublic=!1,this.isMultiple=!1,this.chosenIndexes=[],this.chosingIndexes=[],this.sentVote=!1,this.clickHandler=e=>{const t=(0,q.Z)(e.target,"poll-answer");if(!t)return;(0,J.Z)(e);const i=+t.dataset.index;if(this.isMultiple){t.classList.toggle("is-chosing");const e=this.chosingIndexes.indexOf(i);-1!==e?this.chosingIndexes.splice(e,1):this.chosingIndexes.push(i)}else this.sendVotes([i])}}static setMaxLength(){const e=de.Z.width<=360?de.Z.width-120:C.Z.active.poll.width;this.MAX_LENGTH=e+9+this.MAX_OFFSET+-13.7}static resizePolls(){this.MAX_LENGTH&&Array.from(document.querySelectorAll("poll-element.is-voted")).forEach((e=>{e.svgLines.forEach(((t,i)=>{e.setLineProgress(i,1)}))}))}render(){return e=this,t=void 0,s=function*(){vt||(vt=document.getElementById("poll-line").getTotalLength(),Et.setMaxLength());const{poll:e,results:t}=this.message.media;let i;this.message.pFlags.is_scheduled&&this.classList.add("disable-hover"),e.pFlags&&(this.isPublic=!!e.pFlags.public_voters,this.isQuiz=!!e.pFlags.quiz,this.isClosed=!!e.pFlags.closed,this.isMultiple=!!e.pFlags.multiple_choice,this.isClosed?(i="Chat.Poll.Type.Closed",this.classList.add("is-closed")):i=this.isQuiz?this.isPublic?"Chat.Poll.Type.Quiz":"Chat.Poll.Type.AnonymousQuiz":this.isPublic?"Chat.Poll.Type.Public":"Chat.Poll.Type.Anonymous"),this.classList.toggle("is-multiple",this.isMultiple);const s=this.isMultiple?'':"",a=e.answers.map(((e,t)=>`\n
\n
\n
\n \n \n \n ${s}\n
\n
\n
\n \n \n
\n `)).join("");if(this.innerHTML=`\n
\n
\n
\n
\n
\n ${a}`,(0,Z.Z)(this.firstElementChild,(0,k.Z)(e.question)),Array.from(this.querySelectorAll(".poll-answer-text")).forEach(((t,i)=>{(0,Z.Z)(t,(0,k.Z)(e.answers[i].text))})),this.descDiv=this.firstElementChild.nextElementSibling,this.typeDiv=this.descDiv.firstElementChild,this.avatarsDiv=this.descDiv.lastElementChild,i&&this.typeDiv.append((0,E.ag)(i)),this.isQuiz&&(this.classList.add("is-quiz"),e.close_period&&e.close_date)){const t=document.createElement("div");t.classList.add("poll-time"),this.descDiv.append(t);const i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.classList.add("poll-quiz-timer"),this.quizTimer=i;const s=2,a=7,o=2*Math.PI*a,r=document.createElementNS("http://www.w3.org/2000/svg","circle");r.classList.add("poll-quiz-timer-circle"),r.setAttributeNS(null,"cx","16"),r.setAttributeNS(null,"cy","16"),r.setAttributeNS(null,"r",""+a),r.setAttributeNS(null,"stroke-width",""+s),i.append(r),this.descDiv.append(i);const d=1e3*e.close_period,l=1e3*(e.close_date-(yield n.Z.managers.timeManager.getServerTimeOffset()));this.quizInterval=window.setInterval((()=>{const e=Date.now(),i=(l-e)/d,s=(l-e)/1e3+1|0;t.innerHTML=(0,mt.Z)(s),s<=5&&(t.style.color="#ee545c",r.style.stroke="#ee545c"),r.style.strokeDashoffset=o+i*o,r.style.strokeDasharray=`${o} ${o}`,e>=l&&(clearInterval(this.quizInterval),t.innerHTML="",r.style.strokeDashoffset=o,this.quizInterval=0,setTimeout((()=>{this.managers.appPollsManager.getResults(this.message)}),3e3))}),1e3)}this.answerDivs=Array.from(this.querySelectorAll(".poll-answer")),this.svgLines=Array.from(this.querySelectorAll(".poll-line")),this.numberDivs=Array.from(this.querySelectorAll(".poll-answer-percents"));const o=document.createElement("div");o.classList.add("poll-footer"),this.viewResults=document.createElement("div"),this.viewResults.className="poll-footer-button poll-view-results hide",this.viewResults.append((0,E.ag)("Chat.Poll.ViewResults")),this.votersCountDiv=document.createElement("div"),this.votersCountDiv.className="poll-votes-count",o.append(this.viewResults,this.votersCountDiv),this.append(o),this.viewResults.addEventListener("click",(e=>{(0,J.Z)(e),ht.ZP.isTabExists(ft)||ht.ZP.createTab(ft).open(this.message)})),(0,I.Z)(this.viewResults),this.isMultiple&&(this.sendVoteBtn=document.createElement("div"),this.sendVoteBtn.classList.add("poll-footer-button","poll-send-vote"),this.sendVoteBtn.append((0,E.ag)("Chat.Poll.SubmitVote")),(0,I.Z)(this.sendVoteBtn),e.chosenIndexes.length||this.votersCountDiv.classList.add("hide"),(0,ee.fc)(this.sendVoteBtn,(e=>{(0,J.Z)(e),this.chosingIndexes.length&&this.sendVotes(this.chosingIndexes).then((()=>{this.chosingIndexes.length=0,this.answerDivs.forEach((e=>{e.classList.remove("is-chosing")}))}))})),o.append(this.sendVoteBtn));const r=!(e.chosenIndexes.length||this.isClosed);r&&!this.isPublic||this.performResults(t,e.chosenIndexes,!1),r&&(this.setVotersCount(t),this.detachClickEvent=(0,ee.fc)(this,this.clickHandler))},new((i=void 0)||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}));var e,t,i,s}initQuizHint(e){if(e.solution&&e.solution_entities){const t=document.createElement("div");if(t.classList.add("tgico-tip","poll-hint"),this.descDiv.append(t),(0,ee.fc)(t,(i=>{(0,J.Z)(i),t.classList.add("active"),((e,t,i)=>{wt&&yt(wt,St,Ct);const n=document.createElement("div");n.classList.add("quiz-hint");const a=document.createElement("div");a.classList.add("container","tgico");const o=document.createElement("div");o.classList.add("text"),a.append(o),n.append(a),(0,Z.Z)(o,(0,_e.ZP)(e,{entities:t})),ct.ZP.chat.bubbles.container.append(n),n.offsetLeft,n.classList.add("active"),wt=n,St=i,Ct=window.setTimeout((()=>{yt(n,i,Ct)}),s.Z?5e3:7e3),Lt||(Lt=!0,ct.ZP.addEventListener("peer_changed",(()=>{wt&&yt(wt,St,Ct)})))})(e.solution,e.solution_entities,(()=>{t.classList.remove("active")}))})),this.sentVote){const i=e.results.find((e=>e.pFlags.correct));i&&!i.pFlags.chosen&&(0,ee.tH)(t)}}}sendVotes(e){if(this.sendVotePromise)return this.sendVotePromise;const t=this.answerDivs.filter(((t,i)=>e.includes(i)));return t.forEach((e=>{e.classList.add("is-voting")})),this.classList.add("disable-hover"),this.sentVote=!0,this.sendVotePromise=this.managers.appPollsManager.sendVote(this.message,e).then((()=>{t.forEach((e=>{e.classList.remove("is-voting")})),this.classList.remove("disable-hover")})).catch((()=>{this.sentVote=!1})).finally((()=>{this.sendVotePromise=null}))}performResults(e,t,i=!0){var s,n,a;if(gt.Z.isAvailable("animations")||(i=!1),this.isQuiz&&((null===(s=e.results)||void 0===s?void 0:s.length)||this.isClosed)){this.answerDivs.forEach(((t,i)=>{t.classList.toggle("is-correct",!!e.results[i].pFlags.correct)})),this.initQuizHint&&(this.initQuizHint(e),this.initQuizHint=null),this.quizInterval&&(clearInterval(this.quizInterval),this.quizInterval=0),(null===(n=this.quizTimer)||void 0===n?void 0:n.parentElement)&&this.quizTimer.remove();const t=this.descDiv.querySelector(".poll-time");t&&t.remove()}if(this.isClosed&&(this.classList.add("is-closed"),(0,_.Z)(this.typeDiv,(0,E.ag)("Chat.Poll.Type.Closed"))),(this.chosenIndexes.length!==t.length||this.isClosed)&&(this.isRetracted=this.chosenIndexes.length&&!t.length,this.chosenIndexes=t.slice(),this.isRetracted?this.detachClickEvent=(0,ee.fc)(this,this.clickHandler):(null===(a=this.detachClickEvent)||void 0===a||a.call(this),this.detachClickEvent=void 0)),this.chosenIndexes.length||this.isRetracted||this.isClosed){const t=e.results.map((t=>e.total_voters?t.voters/e.total_voters*100:0));this.classList.toggle("no-transition",!i),i&&(0,he.Z)({element:this,className:"",forwards:!this.isRetracted,duration:340}),(0,V.T2)((()=>{this.setResults(this.isRetracted?this.percents:t,this.chosenIndexes,i),this.percents=t,this.isRetracted=!1}))}if(this.setVotersCount(e),this.isPublic){this.isMultiple||(this.viewResults.classList.toggle("hide",!e.total_voters||!this.chosenIndexes.length),this.votersCountDiv.classList.toggle("hide",!!this.chosenIndexes.length));const t=(e.recent_voters||[]).map((e=>e.toPeerId())),i=new F.Z({avatarSize:16});i.render(t),(0,_.Z)(this.avatarsDiv,i.container)}if(this.isMultiple){const t=!!this.chosenIndexes.length,i=this.isClosed||t,s=!this.isPublic||!e.total_voters||!t&&!this.isClosed;this.sendVoteBtn.classList.toggle("hide",i),this.viewResults.classList.toggle("hide",s),this.votersCountDiv.classList.toggle("hide",!i||!s)}}setResults(e,t,i){this.svgLines.forEach((e=>e.style.display="")),this.answerDivs.forEach(((e,i)=>{e.classList.toggle("is-chosen",t.includes(i))}));const s=Math.max(...e);if(this.maxPercents=e.map((e=>e/s)),this.isRetracted)this.svgLines.forEach(((e,t)=>{this.setLineProgress(t,-1)}));else{const e=()=>{this.svgLines.forEach(((e,t)=>{this.setLineProgress(t,1)}))};i?(0,V.T2)(e):e()}let n;e=e.slice(),bt(e);const a=t=>{e.forEach(((e,i)=>{const s=n(e,t);this.numberDivs[i].innerText=s+"%"}))};if(this.isRetracted)if(n=(e,t)=>Math.round(e/10*t),i)for(let e=9,t=0;e>=0;--e,++t)setTimeout((()=>{a(e)}),34*t);else a(0);else if(n=(e,t)=>Math.round(e/10*(t+1)),i)for(let e=0;e<10;++e)setTimeout((()=>{a(e)}),34*e);else a(9);if(this.isRetracted){i&&this.classList.add("is-retracting"),this.classList.remove("is-voted");const e=()=>{this.svgLines.forEach((e=>e.style.display="none"))};i?setTimeout((()=>{this.classList.remove("is-retracting"),e()}),340):e()}else this.classList.add("is-voted")}setVotersCount(e){const t=e.total_voters||0;let i;const s=[t];i=this.isClosed?this.isQuiz?t?"Chat.Quiz.TotalVotes":"Chat.Quiz.TotalVotesResultEmpty":t?"Chat.Poll.TotalVotes1":"Chat.Poll.TotalVotesResultEmpty":this.isQuiz?t?"Chat.Quiz.TotalVotes":"Chat.Quiz.TotalVotesEmpty":t?"Chat.Poll.TotalVotes1":"Chat.Poll.TotalVotesEmpty",(0,_.Z)(this.votersCountDiv,(0,E.ag)(i,s))}setLineProgress(e,t){const i=this.svgLines[e];-1===t?(i.style.strokeDasharray="",i.style.strokeDashoffset=""):(i.style.strokeDasharray=t*this.maxPercents[e]*Et.MAX_LENGTH+", 485.9",i.style.strokeDashoffset=""+t*Et.MAX_OFFSET)}}Et.MAX_OFFSET=-46.5,Et.MAX_LENGTH=0,customElements.define("poll-element",Et);const It="֑-߿יִ-﷽ﹰ-ﻼ",Mt=(new RegExp("^[^A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿]*["+It+"]"),new RegExp("["+It+"]"));var Zt=i(1564),Pt=i(6628),Tt=i(5345),kt=i(3591),xt=i(9102),At=i(1656),_t=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const Ft=new Map([["messageActionHistoryClear",!0],["messageActionChatCreate",e=>e.pFlags.out]]),Dt=new Set;ge.Z&&Dt.add("messageActionPhoneCall");const Rt=void 0;let Bt=Rt,Nt=0;const Ot=3,Ut=new Error("peer changed"),Ht={1:96,2:90,3:84,4:72,5:60,6:48,7:36},zt=Object.keys(Ht).length;function jt(e){return Math.max(...e)}class Gt{constructor(e,t){let i;this.chat=e,this.managers=t,this.unreadOut=new Set,this.needUpdate=[],this.bubbles={},this.skippedMids=new Set,this.bubblesNewByGroupedId={},this.bubblesNew={},this.dateMessages={},this.scrolledDown=!0,this.isScrollingTimeout=0,this.unreaded=new Map,this.unreadedSeen=new Set,this.preloader=null,this.messagesQueueOnRenderAdditional=null,this.firstUnreadBubble=null,this.middlewareHelper=(0,X.k)(),this.followStack=[],this.isHeavyAnimationInProgress=!1,this.isFirstLoad=!0,this.passEntities={},this.viewsMids=new Set,this.isTopPaddingSet=!1,this.renderingMessages=new Set,this.bubblesToEject=new Set,this.bubblesToReplace=new Map,this.setPeerTempId=0,this.renderNewPromises=new Set,this.extendedMediaMessages=new Set,this.unreadedObserverCallback=e=>{if(e.isIntersecting){const t=e.target,i=this.unreaded.get(t);this.onUnreadedInViewport(t,i)}},this.viewsObserverCallback=e=>{if(e.isIntersecting){const t=+e.target.dataset.mid;if(this.observer.unobserve(e.target,this.viewsObserverCallback),t)this.viewsMids.add(t),this.sendViewCountersDebounced();else{const{sponsoredMessage:e}=this,t=null==e?void 0:e.random_id;t&&(this.managers.appChatsManager.viewSponsoredMessage(this.peerId.toChatId(),t),delete e.random_id)}}},this.stickerEffectObserverCallback=e=>{if(e.isIntersecting){this.observer.unobserve(e.target,this.stickerEffectObserverCallback);const t=e.target.querySelector(".attachment");(0,G.e9)().then((()=>{(0,Ye.Z)(t)&&(0,ee.tH)(t)}))}},this.onBubblesMouseMove=e=>_t(this,void 0,void 0,(function*(){const t=(0,q.Z)(e.target,"bubble-content");if("scheduled"===this.chat.type||!t||this.chat.selection.isSelecting||(0,q.Z)(e.target,"service")||(0,q.Z)(e.target,"bubble-beside-button"))this.unhoverPrevious();else{const e=(0,q.Z)(t,"bubble");if(!this.chat.selection.canSelectBubble(e))return void this.unhoverPrevious();let{hoverBubble:i,hoverReaction:s}=this;if(e===i)return;if(this.unhoverPrevious(),i=this.hoverBubble=e,s=this.hoverReaction,s)s.dataset.loaded&&this.setHoverVisible(s,!0);else{s=this.hoverReaction=document.createElement("div"),s.classList.add("bubble-hover-reaction");const i=document.createElement("div");i.classList.add("bubble-hover-reaction-sticker"),s.append(i),t.append(s);let n=yield this.chat.getMessage(+e.dataset.mid);if("message"!==(null==n?void 0:n._))return void this.unhoverPrevious();n=yield this.managers.appMessagesManager.getGroupsFirstMessage(n);const a=this.getMiddleware((()=>this.hoverReaction===s));Promise.all([this.managers.appReactionsManager.getAvailableReactionsByMessage(n),(0,Ce.Z)(400)]).then((([e])=>{const t=e[0];t?(0,et.ZP)({div:i,doc:t.select_animation,width:18,height:18,needUpscale:!0,middleware:a,group:this.chat.animationGroup,withThumb:!1,needFadeIn:!1}).then((({render:e})=>e)).then((e=>{(0,ae.Z)(e),e.addEventListener("firstFrame",(()=>{a()&&(s.dataset.loaded="1",this.setHoverVisible(s,!0))}),{once:!0}),(0,ee.fc)(s,(e=>{(0,J.Z)(e),this.managers.appReactionsManager.sendReaction(n,t),this.unhoverPrevious()}),{listenerSetter:this.listenerSetter})}),Ke.Z):s.remove()}))}}})),this.unhoverPrevious=()=>{const{hoverBubble:e,hoverReaction:t}=this;e&&(this.setHoverVisible(t,!1),this.hoverBubble=void 0,this.hoverReaction=void 0)},this.onBubblesClick=e=>_t(this,void 0,void 0,(function*(){var t;let i=e.target,n=null;try{n=(0,q.Z)(i,"bubble")}catch(e){}if(!n&&!this.chat.selection.isSelecting){const e=(0,q.Z)(i,"user-avatar");if(!e)return;const t=e.dataset.peerId.toPeerId();return void(t!==l.NM?this.chat.appImManager.setInnerPeer({peerId:t}):(0,Q.Am)(E.ZP.format("HidAccount",!0)))}if(n.classList.contains("is-date")&&(0,q.Z)(i,"bubble-content")){if(n.classList.contains("is-fake")&&(n=n.previousElementSibling),n.classList.contains("is-sticky")&&!this.chatInner.classList.contains("is-scrolling"))return;for(const e in this.dateMessages)if(this.dateMessages[e].div===n){Te.Z.createPopup(m.Z,new Date(+e),this.onDatePick).show();break}return}if(!s.Z&&(0,q.Z)(i,"time"))return void this.chat.selection.toggleByElement(n);if(this.chat.selection.isSelecting&&e.isTrusted){if(n.classList.contains("service")&&void 0===n.dataset.mid)return;return(0,J.Z)(e),s.Z&&this.chat.selection.selectedText?void(this.chat.selection.selectedText=void 0):void this.chat.selection.toggleByElement((0,q.Z)(i,"grouped-item")||n)}const a=(0,q.Z)(i,"media-spoiler-container");if(a)return void(0,st.kN)({event:e,mediaSpoiler:a});const o=(0,q.Z)(i,"contact");if(o){const t=o.dataset.peerId.toPeerId();if(t)this.chat.appImManager.setInnerPeer({peerId:t});else{const t=o.querySelector(".contact-number");(0,Pe.T)(t.innerText.replace(/\s/g,"")),(0,Q.bC)({langPackKey:"PhoneCopied"}),(0,J.Z)(e)}return}const r=(0,q.Z)(i,"bubble-call");if(r)return void this.chat.appImManager.callUser(this.peerId.toUserId(),r.dataset.type);if((0,q.Z)(i,"is-buy")){(0,J.Z)(e);const t=yield this.chat.getMessage(+n.dataset.mid);if(!t)return;return void new qe.ZP(t,yield this.managers.appPaymentsManager.getInputInvoiceByPeerId(t.peerId,t.mid))}const d=(0,Y.Z)(i,"REACTION-ELEMENT");if(d){if((0,J.Z)(e),d.classList.contains("is-inactive"))return;const t=d.parentElement,i=t.getReactionCount(d),s=t.getMessage();return void this.managers.appReactionsManager.sendReaction(s,i.reaction)}const c=(0,pe.Z)(i,"data-sticker-emoji");if(c&&1===c.parentElement.querySelectorAll("[data-sticker-emoji]").length&&n.classList.contains("emoji-big"))return void(0,et._2)({event:e,container:c,managers:this.managers,middleware:this.getMiddleware(),peerId:this.peerId});if((0,q.Z)(i,"replies")){const e=+n.dataset.mid;if(this.peerId===l.hj){const t=yield this.chat.getMessage(e),i=(0,T.Z)(t.reply_to.reply_to_peer_id),s=t.reply_to.reply_to_top_id,n=t.fwd_from.saved_from_msg_id;this.chat.appImManager.openThread({peerId:i,lastMsgId:n,threadId:s})}else{const t=yield this.chat.getMessage(e),i=yield this.managers.appMessagesManager.getMessageWithReplies(t),s=i.replies;s&&this.managers.appMessagesManager.getDiscussionMessage(this.peerId,i.mid).then((e=>{this.chat.appImManager.setInnerPeer({peerId:s.channel_id.toPeerId(!0),type:"discussion",threadId:e.mid})}))}return}const h=(0,q.Z)(i,"is-via");if(h){const t=h.querySelector(".peer-title");if(i===t||(0,fe.Z)(i,t)){const i=t.innerText+" ";return this.managers.appDraftsManager.setDraft(this.peerId,this.chat.threadId,i),void(0,J.Z)(e)}}const u=(0,q.Z)(i,"peer-title")||(0,Y.Z)(i,"AVATAR-ELEMENT")||(0,pe.Z)(i,"data-saved-from");if(u&&u!==n){i=u||i;const e=i.dataset.peerId||i.getAttribute("peer")||i.peerId,t=i.dataset.savedFrom;if("string"==typeof e||t)if(t){const[e,s]=t.split("_");if(i.classList.contains("is-receipt-link")){const t=yield this.managers.appMessagesManager.getMessageByPeer(e.toPeerId(),+s);if(t){const e=yield this.managers.appPaymentsManager.getInputInvoiceByPeerId(this.peerId,+n.dataset.mid);new qe.ZP(t,e,void 0,!0)}}else this.chat.appImManager.setInnerPeer({peerId:e.toPeerId(),lastMsgId:+s})}else{const t=e.toPeerId();t!==l.NM?this.chat.appImManager.setInnerPeer({peerId:t}):(0,Q.Am)(E.ZP.format("HidAccount",!0))}}else if(n.classList.contains("sticker")&&i.parentElement.classList.contains("attachment")){const e=+n.dataset.mid,i=null===(t=(yield this.chat.getMessage(e)).media)||void 0===t?void 0:t.document;(null==i?void 0:i.stickerSetInput)&&new v.Z(i.stickerSetInput).show()}else if(!(yield this.checkTargetForMediaViewer(i,e))&&(-1===["IMG","DIV","SPAN"].indexOf(i.tagName)&&(i=(0,Y.Z)(i,"DIV")),-1!==["DIV","SPAN"].indexOf(i.tagName))){if(i.classList.contains("goto-original")){const e=n.dataset.savedFrom,[t,i]=e.split("_");return void this.chat.appImManager.setInnerPeer({peerId:t.toPeerId(),lastMsgId:+i})}if(i.classList.contains("forward")){const e=+n.dataset.mid,t=yield this.managers.appMessagesManager.getMessageByPeer(this.peerId,e);return void new g.Z({[this.peerId]:yield this.managers.appMessagesManager.getMidsByMessage(t)})}let t=!1;try{t=!!(0,q.Z)(e.target,"reply")}catch(e){}if(t&&n.classList.contains("is-reply")){const e=+n.dataset.mid;this.followStack.push(e);const t=yield this.chat.getMessage(e),i=t.reply_to.reply_to_peer_id?(0,T.Z)(t.reply_to.reply_to_peer_id):this.peerId,s=t.reply_to.reply_to_msg_id;this.chat.appImManager.setInnerPeer({peerId:i,lastMsgId:s,type:this.chat.type,threadId:this.chat.threadId})}}})),this.onScroll=(e,t,i)=>{var s,n,a,o,r;if(this.isHeavyAnimationInProgress){if(null===(s=this.sliceViewportDebounced)||void 0===s||s.clearTimeout(),this.scrolledDown&&!e)return}else null===(n=this.chat.topbar.pinnedMessage)||void 0===n||n.setCorrectIndexThrottled(this.scrollable.lastScrollDirection),null===(a=this.sliceViewportDebounced)||void 0===a||a.call(this),this.setStickyDateManually();if(t&&t.distanceToEnd<300&&this.scrolledDown)return;const d=i?0:null!==(o=null==t?void 0:t.distanceToEnd)&&void 0!==o?o:this.scrollable.getDistanceToEnd();(0!==this.scrollable.lastScrollDirection&&d>0||t||i)&&(this.isScrollingTimeout?clearTimeout(this.isScrollingTimeout):this.chatInner.classList.contains("is-scrolling")||this.chatInner.classList.add("is-scrolling"),this.isScrollingTimeout=window.setTimeout((()=>{this.chatInner.classList.remove("is-scrolling"),this.isScrollingTimeout=0}),1350+(null!==(r=null==t?void 0:t.duration)&&void 0!==r?r:0))),d<300&&(i||this.scrollable.loadedAll.bottom||this.chat.setPeerPromise||!this.peerId)?(this.container.classList.add("scrolled-down"),this.scrolledDown=!0):this.container.classList.contains("scrolled-down")&&(this.container.classList.remove("scrolled-down"),this.scrolledDown=!1)},this.processBatch=(...e)=>_t(this,void 0,void 0,(function*(){var t,i,s;let[n,a,o]=e;const r=e=>e.filter((e=>e&&this.bubbles[e.bubble.dataset.mid]===e.bubble));n=r(n),o("messages rendered");const d=null===(t=n[0])||void 0===t?void 0:t.reverse,{groups:l,avatarPromises:c}=this.groupBubbles(n.filter((e=>e.updatePosition))),h=n.reduce(((e,t)=>{const i=performance.now(),s=t.promises.slice(),n=s.map((e=>_t(this,void 0,void 0,(function*(){return yield e,performance.now()-i}))));return Promise.all(n).then((e=>{o.groupCollapsed("media message time",performance.now()-i,t,e),e.forEach(((e,t)=>{o("media message time",e,t,s[t])})),o.groupEnd()})),e.push(...t.promises),e}),[]);h.push(...c),o("media promises to call",h,n,this.isHeavyAnimationInProgress),yield a(Promise.all([...h,this.setUnreadDelimiter()]).catch(Ke.Z)),yield a((0,V.AD)()),o("media promises end"),n=r(n);const{restoreScroll:u,scrollSaver:p}=this.prepareToSaveScroll(d);null===(i=this.messagesQueueOnRenderAdditional)||void 0===i||i.call(this),this.ejectBubbles();for(const[e,t]of this.bubblesToReplace){if(p&&p.replaceSaved(t,e),!n.find((t=>t.bubble===e)))continue;const i=this.bubbleGroups.getItemByBubble(e);i?(i.mounted=!1,l.includes(i.group)||l.push(i.group)):this.log.error("NO ITEM BY BUBBLE",e),this.bubblesToReplace.delete(e)}this.chat.selection.isSelecting&&n.forEach((({bubble:e})=>{this.chat.selection.toggleElementCheckbox(e,!0)})),n.forEach((({message:e,bubble:t,updatePosition:i})=>{e.pFlags.local&&i&&this.chatInner[e.pFlags.sponsored?"append":"prepend"](t)})),this.bubbleGroups.mountUnmountGroups(l),null===(s=this.updatePlaceholderPosition)||void 0===s||s.call(this),null==u||u(),(0,Ce.Z)(this.chat.setPeerPromise?1e3:0).then((()=>(0,G.e9)())).then((()=>{this.lazyLoadQueue.setAllSeen()}))})),this.onDatePick=e=>{const t=this.peerId;this.managers.appMessagesManager.requestHistory(t,0,2,-1,e,this.chat.threadId).then((e=>{var i;(null===(i=null==e?void 0:e.messages)||void 0===i?void 0:i.length)?this.peerId===t&&this.chat.setMessageId(e.messages[0].mid):this.log.error("no history!")}))},this.log=this.chat.log,this.listenerSetter=new H.Z,this.constructBubbles(),this.batchProcessor=new Tt.s({log:this.log,process:this.processBatch,possibleError:Ut}),this.bubbleGroups=new f(this.chat),this.preloader=new b.Z({cancelable:!1}),this.lazyLoadQueue=new U.Z(void 0,!0),this.lazyLoadQueue.queueId=++Nt,this.listenerSetter.add(n.Z)("history_update",(({storageKey:e,sequential:t,message:i})=>_t(this,void 0,void 0,(function*(){if(this.chat.messagesStorageKey!==e||"scheduled"===this.chat.type)return;const{mid:s}=i,o=this.bubbles[s];if(!o)return;if(this.renderNewPromises.size&&(yield Promise.all(Array.from(this.renderNewPromises))),this.messagesQueuePromise&&(yield this.messagesQueuePromise),this.bubbles[s]!==o)return;const r=this.bubbleGroups.getItemByBubble(o);if(!r)return;if(r.mid===s)return;if(t){const e=r.group,d=this.bubbleGroups.createItem(o,i),l=this.bubbleGroups.itemsArr.slice();(0,a.Z)(l,r);const c=this.bubbleGroups.findGroupSiblingByItem(d,l);if(e===(null==c?void 0:c.group)||e===this.bubbleGroups.getLastGroup()&&1===e.items.length&&d.dateTimestamp===r.dateTimestamp||this.peerId===n.Z.myId&&t&&d.dateTimestamp===r.dateTimestamp)return void this.bubbleGroups.changeBubbleMid(o,s)}this.bubbleGroups.removeAndUnmountBubble(o);const{groups:d}=this.groupBubbles([{bubble:o,message:i}]);this.bubbleGroups.mountUnmountGroups(d),this.scrollingToBubble&&this.scrollToEnd()})))),this.listenerSetter.add(n.Z)("dialog_flush",(({peerId:e})=>{this.peerId===e&&this.deleteMessagesByIds(Object.keys(this.bubbles).map((e=>+e)))})),this.listenerSetter.add(n.Z)("message_sent",(e=>_t(this,void 0,void 0,(function*(){const{storageKey:t,tempId:i,tempMessage:s,mid:a,message:o}=e;if(this.chat.messagesStorageKey!==t)return;const r=this.bubbles,d=r[i];if(d){const e=r[i];r[a]=e,e.dataset.mid=""+a,delete r[i],(0,V.T2)((()=>{const t=+e.dataset.mid;r[t]===e&&e.classList.contains("is-outgoing")&&(e.classList.remove("is-sending","is-outgoing"),e.classList.add(this.peerId===n.Z.myId&&"scheduled"!==this.chat.type||!this.unreadOut.has(t)?"is-read":"is-sent"))}))}if(this.unreadOut.has(i)&&(this.unreadOut.delete(i),this.unreadOut.add(a)),"scheduled"===this.chat.type&&(Date.now()/1e3|0)>=s.date-10&&this.deleteMessagesByIds([a]),!d)return;let l,c;const h=o.grouped_id;if(h){l=yield this.managers.appMessagesManager.getMessagesByAlbum(h);const e=l.map((({mid:e})=>e));if(!e.length||jt(e)!==a||r[a]!==d)return;if(r[a]!==d)return;c=Array.from(d.querySelectorAll(".grouped-item")).map((e=>+e.dataset.mid))}else l=[o],c=[i];const u=Array.from(d.querySelectorAll("reactions-element"));u.length&&u.forEach((e=>{e.changeMessage(o)})),l.forEach(((e,t)=>{var i,a,o,r,l;if(!e)return;const u=c[t],p=e.mid,f=d.querySelector(`.document-container[data-mid="${p}"]`)||d;if("message"!==e._)return;if(e.replies){const t=d.querySelector("replies-element");t&&(t.message=e,t.init())}const m=null!==(i=e.media)&&void 0!==i?i:{},g=m.document,v=m.poll,b=m.webpage;if(g){const t=f.querySelector(`.document-container[data-mid="${u}"] .document`);if(t){const i=(0,q.Z)(t,"document-container");!(null===(r=null===(o=null===(a=s.media)||void 0===a?void 0:a.document)||void 0===o?void 0:o.thumbs)||void 0===r?void 0:r.length)&&(null===(l=g.thumbs)||void 0===l?void 0:l.length)&&(0,G.e9)().then((()=>_t(this,void 0,void 0,(function*(){const i=t.querySelector(".time"),s=yield(0,rt.Z)({message:e,fontSize:n.Z.settings.messagesTextSize});t.replaceWith(s),i&&(s.querySelector(".document")||s).append(i)})))),i&&(i.dataset.mid=""+p)}const i=f.querySelector(`audio-element[data-mid="${u}"], .document[data-doc-id="${u}"], .media-round[data-mid="${u}"]`);i&&(i instanceof z.ZP||i.classList.contains("media-round")?(i.dataset.mid=""+e.mid,delete i.dataset.isOutgoing,i.message=e,i.onLoad(!0)):(i.dataset.docId=""+g.id,i.doc=g))}else if(v){const t=f.querySelector("poll-element");t&&(t.message=e,t.setAttribute("poll-id",""+v.id),t.setAttribute("message-id",""+p))}else b&&!f.querySelector(".web")&&(0,G.e9)().then((()=>{this.safeRenderMessage(e,!0,f),this.scrollToBubbleIfLast(f)}));if(h){const e=f.querySelector(`.grouped-item[data-mid="${u}"]`)||f;e&&(e.dataset.mid=""+p)}}))})))),this.listenerSetter.add(n.Z)("message_edit",(({storageKey:e,message:t})=>_t(this,void 0,void 0,(function*(){if(e!==this.chat.messagesStorageKey)return;const i=this.bubbles[t.mid];i&&(yield(0,G.e9)(),this.bubbles[t.mid]===i&&this.safeRenderMessage(t,!0,i))})))),this.listenerSetter.add(n.Z)("message_error",(({storageKey:e,tempId:t})=>_t(this,void 0,void 0,(function*(){if(e!==this.chat.messagesStorageKey)return;const i=this.bubbles[t];i&&(yield(0,G.e9)(),this.bubbles[t]===i&&(i.classList.remove("is-outgoing"),i.classList.add("is-error")))})))),this.listenerSetter.add(n.Z)("message_transcribed",(({peerId:e,mid:t,text:i,pending:s})=>{if(e!==this.peerId)return;const n=this.bubbles[t];if(!n)return;const a=n.querySelector("audio-element");if(!a)return;const o=n.querySelector(".document-wrapper, .quote-text.has-document"),r=a.querySelector(".audio-to-text-button span"),d=a.querySelector(".loader");if(o&&r){let e=o.querySelector(".audio-transcribed-text");if(e){if(!s){const t=e.querySelector(".audio-transcribing-dots");null==t||t.remove()}}else if(e=document.createElement("div"),e.classList.add("audio-transcribed-text"),e.append(document.createTextNode("")),o.classList.contains("document-wrapper")?a.before(e):o.append(e),s){const t=document.createElement("span");t.classList.add("audio-transcribing-dots"),e.append(t)}i||s?i&&(e.firstChild.textContent=i):(e.replaceChildren((0,E.ag)("Chat.Voice.Transribe.Error")),e.classList.add("is-error")),r.classList.remove("tgico-transcribe"),r.classList.add("tgico-up"),!s&&d&&(d.classList.remove("active"),setTimeout((()=>{d.remove()}),300)),a.transcriptionState=2}})),this.listenerSetter.add(n.Z)("album_edit",(({peerId:e,messages:t,deletedMids:i})=>{if(e!==this.peerId)return;const s=t.map((({mid:e})=>e)),n=jt(s.concat(Array.from(i))),a=this.bubbles[n];if(!a)return;const o=jt(s),r=t.find((e=>e.mid===o));this.safeRenderMessage(r,!0,a)})),this.listenerSetter.add(n.Z)("messages_reactions",(e=>_t(this,void 0,void 0,(function*(){if("scheduled"===this.chat.type)return;let t;const i=e.map((({message:e,changedResults:t})=>_t(this,void 0,void 0,(function*(){if(this.peerId!==e.peerId)return;const i=yield this.getMountedBubble(e.mid,e);return i?{bubble:(0,q.Z)(i.bubble,"bubble"),message:e,changedResults:t}:void 0}))));(yield Promise.all(i)).filter(Boolean).forEach((({bubble:e,message:i,changedResults:s})=>{t||(t=this.createScrollSaver(!1),t.save());const n=i.peerId+"_"+i.mid,a=Se.G.get(n);if(a)for(const e of a)e.update(i,s);else{if(!i.reactions||!i.reactions.results.length)return;this.appendReactionsElementToBubble(e,i,i,s)}})),t&&t.restore()})))),this.listenerSetter.add(n.Z)("messages_downloaded",(({peerId:e,mids:t})=>_t(this,void 0,void 0,(function*(){const i=this.getMiddleware();yield(0,G.e9)(),i()&&t.forEach((t=>{this.needUpdate;const i=[];(0,c.Z)(this.needUpdate,((s,n)=>{s.replyMid===t&&s.replyToPeerId===e&&(this.needUpdate.splice(n,1)[0],i.push(s))})),i.forEach((({mid:e,replyMid:t,replyToPeerId:i})=>_t(this,void 0,void 0,(function*(){const t=this.bubbles[e];if(!t)return;const i=yield this.chat.getMessage(e);O.setReply({chat:this.chat,bubble:t,message:i})}))))}))})))),(0,Xe.Z)({listenTo:this.scrollable.container,listenerSetter:this.listenerSetter,findTarget:e=>{const t=e.target;return t.closest(".attachment.media-sticker-wrapper")||(0,q.Z)(t,"attachment")&&t.closest(".custom-emoji")}}),(0,ee.fc)(this.scrollable.container,this.onBubblesClick,{listenerSetter:this.listenerSetter}),this.listenerSetter.add(this.scrollable.container)("mousedown",(e=>{if(0!==e.button)return;const t=(0,Y.Z)(e.target,"CODE");if(t){(0,J.Z)(e),i=t,(0,Pe.T)(i.textContent);const s=e=>{(0,J.Z)(e),(0,Q.bC)({langPackKey:"TextCopied",onClose:()=>{n()}})},n=(0,ee.fc)(window,s,{listenerSetter:this.listenerSetter,once:!0,capture:!0})}else var i})),this.stickyIntersector=new w.Z(this.scrollable.container,((e,t)=>{for(const i in this.dateMessages){const s=this.dateMessages[i];if(s.container===t){const t=s.div;t.classList.toggle("is-sticky",e),e&&(this.previousStickyDate=t);break}}this.previousStickyDate})),L.IS_SAFARI||(this.sliceViewportDebounced=(0,oe.Z)(this.sliceViewport.bind(this),3e3,!1,!0)),(0,G.ZP)((()=>{this.isHeavyAnimationInProgress=!0,this.lazyLoadQueue.lock(),i=this.getMiddleware()}),(()=>{this.isHeavyAnimationInProgress=!1,(null==i?void 0:i())&&this.lazyLoadQueue.unlockAndRefresh(),i=null}),this.listenerSetter)}constructBubbles(){const e=this.container=document.createElement("div");e.classList.add("bubbles","scrolled-down"),(this.chatInner=document.createElement("div")).classList.add("bubbles-inner"),this.setScroll(),e.append(this.scrollable.container)}attachContainerListeners(){const e=this.container;if(this.chat.contextMenu.attachTo(e),this.chat.selection.attachListeners(e,new H.Z),W.ZP&&this.listenerSetter.add(e)("dblclick",(e=>_t(this,void 0,void 0,(function*(){const t=(0,q.Z)(e.target,"grouped-item")||(0,q.Z)(e.target,"bubble");if(t){const e=+t.dataset.mid;this.log("debug message:",yield this.chat.getMessage(e)),this.highlightBubble(t)}})))),L.IS_MOBILE){if(s.Z){const t="is-gesturing-reply",i=64,s=.75*i;let n,a,o,r=!1;(0,ue.Z)({element:e,verifyTouchTarget:e=>_t(this,void 0,void 0,(function*(){if("pinned"===this.chat.type||this.chat.selection.isSelecting||!(yield this.chat.canSend()))return!1;if(n=(0,q.Z)(e.target,"bubble"),n){try{const e=n.parentElement.querySelector(".bubbles-group-avatar");e&&(0,be.Z)(e,n)&&(o=e)}catch(e){}[n,o].filter(Boolean).forEach((e=>{(0,he.Z)({element:e,className:t,forwards:!0,duration:250}),e.offsetLeft})),a?(a.classList.remove("is-visible"),a.style.opacity=""):(a=document.createElement("span"),a.classList.add("tgico-reply_filled","bubble-gesture-reply-icon")),n.append(a)}return!!n})),onSwipe:e=>{r=e>=s,r&&!a.classList.contains("is-visible")&&a.classList.add("is-visible"),a.style.opacity=""+Math.min(1,e/s);const t=`translateX(${-Math.max(0,Math.min(i,e))}px)`;n.style.transform=t,o&&(o.style.transform=t),(0,ze.s)()},onReset:()=>{const e=n,i=o;n=o=void 0;const s=()=>{a.parentElement===e&&(a.classList.remove("is-visible"),a.remove())};[e,i].filter(Boolean).forEach(((e,i)=>{(0,he.Z)({element:e,className:t,forwards:!1,duration:250,onTransitionEnd:0===i?s:void 0})})),(0,V.T2)((()=>{if(e.style.transform="",i&&(i.style.transform=""),r){const{mid:t}=e.dataset;this.chat.input.initMessageReply(+t),r=!1}}))},listenerOptions:{capture:!0}})}}else this.listenerSetter.add(e)("dblclick",(e=>_t(this,void 0,void 0,(function*(){if("pinned"===this.chat.type||this.chat.selection.isSelecting||!(yield this.chat.canSend()))return;const t=e.target,i=t.classList.contains("bubble")?t:t.classList.contains("document-selection")?t.parentElement:null;if(i&&!i.classList.contains("bubble-first")){const e=+i.dataset.mid;if((yield this.chat.getMessage(e)).pFlags.is_outgoing)return;this.chat.input.initMessageReply(e)}}))))}constructPeerHelpers(){this.listenerSetter.add(n.Z)("history_append",(({storageKey:e,message:t})=>_t(this,void 0,void 0,(function*(){e===this.chat.messagesStorageKey&&"scheduled"!==this.chat.type&&(gt.Z.isAvailable("chat_background")&&(this.updateGradient=!0),this.scrollable.loadedAll.bottom?this.renderNewMessage(t,!0):this.chat.setMessageId())})))),this.listenerSetter.add(n.Z)("history_multiappend",(e=>{this.peerId===e.peerId&&"scheduled"!==this.chat.type&&this.renderNewMessage(e)})),this.listenerSetter.add(n.Z)("history_delete",(({peerId:e,msgs:t})=>{e===this.peerId&&"scheduled"!==this.chat.type&&this.deleteMessagesByIds(Array.from(t))})),this.listenerSetter.add(n.Z)("dialog_unread",(({peerId:e})=>{e===this.peerId&&(this.chat.input.setUnreadCount(),(0,G.e9)().then((()=>{this.updateUnreadByDialog()})))})),this.listenerSetter.add(n.Z)("dialogs_multiupdate",(e=>{e.has(this.peerId)&&"scheduled"!==this.chat.type&&this.chat.input.setUnreadCount()})),this.listenerSetter.add(n.Z)("dialog_notify_settings",(e=>{this.peerId===e.peerId&&"scheduled"!==this.chat.type&&this.chat.input.setUnreadCount()})),this.listenerSetter.add(n.Z)("chat_update",(e=>_t(this,void 0,void 0,(function*(){const{peerId:t}=this;if(t!==e.toPeerId(!0))return;const i=yield this.managers.appChatsManager.getChat(e),s=this.chatInner.classList.contains("has-rights"),n=this.chat.input.canSendPlain(),[a,o,r]=yield Promise.all([this.chat.canSend("send_messages"),this.chat.canSend("send_plain"),this.chat.canSend("embed_links")]);s===a&&n===o||(yield Promise.all([this.finishPeerChange(),this.chat.input.finishPeerChange()])).forEach((e=>e())),(r&&!this.chat.input.willSendWebPage||!r&&this.chat.input.willSendWebPage)&&(this.chat.input.lastUrl="",this.chat.input.onMessageInput()),!!i.pFlags.forum!==this.chat.isForum&&"chat"===this.chat.type&&(this.chat.peerId=0,this.chat.appImManager.setPeer({peerId:t}))})))),this.listenerSetter.add(n.Z)("history_reload",(e=>{if(e!==this.peerId)return;const t=(0,Ee.Z)(this.bubbles,"desc").filter((e=>e>0)),i=this.getMiddleware();this.managers.appMessagesManager.reloadMessages(this.peerId,t).then((e=>{if(!i())return;const s=[];e.forEach(((e,i)=>{const n=t[i];if(e){const t=this.bubbles[e.mid];if(!t)return;this.safeRenderMessage(e,!0,t)}else s.push(n)})),this.deleteMessagesByIds(s),this.setLoaded("top",!1),this.setLoaded("bottom",!1),this.scrollable.checkForTriggers()}))})),this.listenerSetter.add(n.Z)("settings_updated",(({key:e})=>_t(this,void 0,void 0,(function*(){if("settings.emoji.big"===e){const e=this.getMiddleware(),t=(0,Ee.Z)(this.bubbles,"desc").map((e=>_t(this,void 0,void 0,(function*(){const t=this.bubbles[e];if(t.classList.contains("can-have-big-emoji"))return{bubble:t,message:yield this.chat.getMessage(e)}})))),i=yield Promise.all(t);if(!e())return;i.filter(Boolean).forEach((({bubble:e,message:t})=>{this.bubbles[t.mid]===e&&this.safeRenderMessage(t,!0,e)}))}})))),this.listenerSetter.add(n.Z)("messages_views",(e=>{"scheduled"!==this.chat.type&&(0,V.T2)((()=>{let t;for(const{peerId:i,views:s,mid:n}of e){if(this.peerId!==i)continue;const e=this.bubbles[n];if(!e)continue;const a=Array.from(e.querySelectorAll(".post-views"));if(!a.length)continue;const o=(0,P.Z)(s,1);let r=!1;a.forEach((e=>{(r||e.textContent!==o)&&(t||(t=this.createScrollSaver(!0),t.save()),r=!0,e.textContent=o)}))}null==t||t.restore()}))})),this.observer=new Me({root:this.scrollable.container}),this.sendViewCountersDebounced=(0,oe.Z)((()=>{const e=[...this.viewsMids];this.viewsMids.clear(),this.managers.appMessagesManager.incrementMessageViews(this.peerId,e)}),1e3,!1,!0),this.listenerSetter.add(n.Z)("peer_pinned_messages",(({peerId:e,mids:t,pinned:i})=>{"pinned"===this.chat.type&&e===this.peerId&&t&&(i||this.deleteMessagesByIds(t))}));const e=()=>_t(this,void 0,void 0,(function*(){this.chat.topbar.setTitle((yield this.managers.appMessagesManager.getScheduledMessagesStorage(this.peerId)).size)}));this.listenerSetter.add(n.Z)("scheduled_new",(t=>{"scheduled"===this.chat.type&&t.peerId===this.peerId&&(this.renderNewMessage(t),e())})),this.listenerSetter.add(n.Z)("scheduled_delete",(({peerId:t,mids:i})=>{"scheduled"===this.chat.type&&t===this.peerId&&(this.deleteMessagesByIds(i),e())}))}get peerId(){return this.chat.peerId}get messagesQueuePromise(){return this.batchProcessor.queuePromise}createScrollSaver(e=!0){return new Le.Z(this.scrollable,".bubble:not(.is-date)",e)}createResizeObserver(){if(!("ResizeObserver"in window)||this.resizeObserver)return;const e=this.scrollable.container;let t=0,i=!1,s=!1,n=0,a=0,o=0;const r=()=>{const r=e.offsetHeight,d=this.scrollable.isScrolledDown;r===t||s&&d||(a+=t-r),a&&this.scrollable.setScrollTopSilently(this.scrollable.scrollTop+Math.round(a)),t=r,n=0,o=0,a=0,i=!1,s=!1},d=e=>{o&&window.cancelAnimationFrame(o),o=window.requestAnimationFrame(e?r:()=>{o=window.requestAnimationFrame(r)})};(this.resizeObserver=new ResizeObserver((e=>{if(s)return void d(!1);const o=e[0].contentRect.height;if(!t)return void(t=o);const r=t-o;let l=r+a;const c=l%1;if(l-=c,!i&&(i=!0,r<0&&this.scrollable.isScrolledDown))return a=-r,s=!0,void d(!1);if(n+=l,l){const e=this.scrollable.scrollTop+l;this.scrollable.setScrollTopSilently(e)}d(!1),a=c,t=o}))).observe(e)}destroyResizeObserver(){const e=this.resizeObserver;e&&(e.disconnect(),this.resizeObserver=void 0)}setReactionsHoverListeners(){this.listenerSetter.add(je.Z)("toggle",this.unhoverPrevious),this.listenerSetter.add(He.Z)("change",this.unhoverPrevious),this.listenerSetter.add(this.chat.selection)("toggle",this.unhoverPrevious),this.listenerSetter.add(this.container)("mousemove",this.onBubblesMouseMove)}setHoverVisible(e,t){e.parentElement&&e.parentElement.classList.toggle("hover-reaction-visible",t),(0,he.Z)({element:e,className:"is-visible",forwards:t,duration:200,onTransitionEnd:t?void 0:()=>{e.remove()},useRafs:2})}setStickyDateManually(){}getRenderedLength(){return Object.keys(this.bubbles).length-this.skippedMids.size}onUnreadedInViewport(e,t){this.unreadedSeen.add(t),this.observer.unobserve(e,this.unreadedObserverCallback),this.unreaded.delete(e),this.readUnreaded()}readUnreaded(){if(this.readPromise)return;const e=this.getMiddleware();this.readPromise=Ue.Z.getFocusPromise().then((()=>_t(this,void 0,void 0,(function*(){if(!e())return;let t=Math.max(...Array.from(this.unreadedSeen));if(this.scrollable.loadedAll.bottom){const e=Math.max(...Object.keys(this.bubbles).map((e=>+e)));t>=e&&(t=Math.max((yield this.chat.getHistoryMaxId())||0,t))}this.unreaded.forEach(((e,i)=>{e<=t&&this.onUnreadedInViewport(i,e)}));const i=[];for(const e of this.unreadedSeen)De(yield this.chat.getMessage(e))&&i.push(e);return this.managers.appMessagesManager.readMessages(this.peerId,i),this.unreadedSeen.clear(),W.ZP&&this.log("will readHistory by maxId:",t),this.managers.appMessagesManager.readHistory(this.peerId,t,this.chat.threadId).catch((e=>{this.log.error("readHistory err:",e),this.managers.appMessagesManager.readHistory(this.peerId,t,this.chat.threadId)})).finally((()=>{e()&&(this.readPromise=void 0,this.unreadedSeen.size&&this.readUnreaded())}))}))))}checkTargetForMediaViewer(e,t,i){return _t(this,void 0,void 0,(function*(){const s=(0,q.Z)(e,"bubble"),n=(0,q.Z)(e,"document-with-thumb");if("IMG"===e.tagName&&!e.classList.contains("emoji")&&!e.classList.contains("document-thumb")||e.classList.contains("album-item")||"VIDEO"===e.tagName&&!s.classList.contains("round")||n&&!n.querySelector(".preloader-container")||e.classList.contains("canvas-thumbnail")){const a=(0,q.Z)(e,"album-item")||(0,q.Z)(e,"document-container"),o=(a||s).querySelector(".preloader-container");if(o&&t)return(0,ee.tH)(o),void(0,J.Z)(t);(0,J.Z)(t);const r=+(a||s).dataset.mid,d=yield this.chat.getMessage(r);if(!d)return void this.log.warn("no message by messageId:",r);const l="webpage",c=s.classList.contains(l),h=n?e=>ce.Z.isMediaCompatibleForDocumentViewer(e):e=>"photo"===e._||["video","gif"].includes(e.type),u=[],p=c?[r]:(yield Promise.all(Object.keys(this.bubbles).map((e=>+e)).map((e=>_t(this,void 0,void 0,(function*(){const t=yield this.chat.getMessage(e),i=(0,Re.Z)(t);return i&&h(i)&&e})))))).filter(Boolean).sort(((e,t)=>e-t));p.forEach((e=>{let t;n?t=".document-container":(t=".album-item video, .album-item img, .preview video, .preview img, ",t+=this.bubbles[e].classList.contains("with-media-tail")?".bubble__media-container":".attachment video, .attachment img");const i=Array.from(this.bubbles[e].querySelectorAll(t)),s=new Set;if(n)i.forEach((e=>{u.push({element:e.querySelector(".document-ico"),mid:+e.dataset.mid,peerId:this.peerId})}));else{const t=!!this.bubbles[e].querySelector(".media-container-aspecter");i.forEach((i=>{if(t&&!(0,q.Z)(i,"media-container-aspecter"))return;const n=(0,q.Z)(i,"album-item"),a=n||i.parentElement;s.has(a)||(s.add(a),u.push({element:i,mid:n?+n.dataset.mid:e,peerId:this.peerId}))}))}})),u.sort(((e,t)=>e.mid-t.mid));const f=u.findIndex((e=>e.mid===r));return W.ZP&&this.log("open mediaViewer single with ids:",p,f,u),u[f]?((new ce.Z).setSearchContext({threadId:this.chat.threadId,peerId:this.peerId,inputFilter:{_:n?"inputMessagesFilterDocument":"inputMessagesFilterPhotoVideo"},useSearch:"scheduled"!==this.chat.type&&!c,isScheduled:"scheduled"===this.chat.type}).openMedia({message:d,target:u[f].element,fromRight:0,reverse:!0,prevTargets:u.slice(0,f),nextTargets:u.slice(f+1),mediaTimestamp:i}),!0):void this.log("no target for media viewer!",e)}}))}onGoDownClick(){return _t(this,void 0,void 0,(function*(){if(!this.followStack.length)return void this.chat.setMessageId();const e=this.getMiddleware(),t=this.followStack.slice(),i=yield Promise.all(t.map((e=>this.chat.getMessage(e))));if(!e())return;t.forEach(((e,t)=>{const s=i[t],n=this.bubbles[e];let a=!0;if(n){const e=n.getBoundingClientRect();a=de.Z.height/2>e.top}else s&&(a=!1);a&&this.followStack.splice(this.followStack.indexOf(e),1)})),this.followStack.sort(((e,t)=>t-e));const s=this.followStack.pop();this.chat.setMessageId(s)}))}getBubbleByPoint(e){const t=this.getViewportSlice(),i=t.visible["top"===e?0:t.visible.length-1];return null==i?void 0:i.element}getGroupedBubble(e){return _t(this,void 0,void 0,(function*(){const t=yield this.managers.appMessagesManager.getMidsByAlbum(e);for(const e of t)if(this.bubbles[e]&&!this.skippedMids.has(e))return{bubble:this.bubbles[e],mid:e}}))}getBubbleGroupedItems(e){return Array.from(e.querySelectorAll(".grouped-item"))}getMountedBubble(e,t){return _t(this,void 0,void 0,(function*(){if(void 0===t&&(t=yield this.chat.getMessage(e)),!t)return;const i=t.grouped_id;if(i){const t=yield this.getGroupedBubble(i);if(t)return t.bubble=t.bubble.querySelector(`.document-container[data-mid="${e}"]`)||t.bubble,t}const s=this.bubbles[e];return s&&!this.skippedMids.has(e)?{bubble:s,mid:e}:void 0}))}findNextMountedBubbleByMsgId(e,t){const i=(0,Ee.Z)(this.bubbles,t?"desc":"asc");let s;s=t?t=>te{var t;return!!s(e)&&!!(null===(t=this.bubbles[e])||void 0===t?void 0:t.parentElement)}));return this.bubbles[n]}loadMoreHistory(e,t=!1){if(!this.peerId||this.chat.setPeerPromise||this.isHeavyAnimationInProgress||e&&(this.getHistoryTopPromise||this.scrollable.loadedAll.top)||!e&&(this.getHistoryBottomPromise||this.scrollable.loadedAll.bottom))return;const i=Object.keys(this.bubbles).map((e=>+e)).filter((e=>e>0&&!this.skippedMids.has(e))).sort(((e,t)=>e-t));i.length||i.push(0),e?(W.ZP&&this.log("Will load more (up) history by id:",i[0],"maxId:",i[i.length-1],t),this.getHistory1(i[0],!0,void 0,void 0,t)):(W.ZP&&this.log("Will load more (down) history by id:",i[i.length-1],t),this.getHistory1(i[i.length-1],!1,!0,void 0,t))}setScroll(){this.scrollable&&this.destroyScrollable(),this.scrollable=new y.ZP(null,"IM",300),this.setLoaded("top",!1,!1),this.setLoaded("bottom",!1,!1),this.scrollable.container.append(this.chatInner),this.scrollable.onAdditionalScroll=this.onScroll,this.scrollable.onScrolledTop=()=>this.loadMoreHistory(!0),this.scrollable.onScrolledBottom=()=>this.loadMoreHistory(!1),s.Z}updateUnreadByDialog(){return _t(this,void 0,void 0,(function*(){const e=yield this.chat.getHistoryStorage(),t=this.peerId===n.Z.myId?e.readMaxId:e.readOutboxMaxId;for(const e of this.unreadOut)if(e>0&&e<=t){const t=this.bubbles[e];if(t){if(this.unreadOut.delete(e),t.classList.contains("is-outgoing")||t.classList.contains("is-error"))continue;t.classList.remove("is-sent","is-sending","is-outgoing"),t.classList.add("is-read")}}}))}destroyBubble(e,t=+e.dataset.mid){e.middlewareHelper.destroy(),this.bubbles[t]===e&&delete this.bubbles[t],this.skippedMids.delete(t),this.firstUnreadBubble===e&&(this.firstUnreadBubble=null),this.bubbleGroups.removeAndUnmountBubble(e),this.observer&&(this.observer.unobserve(e,this.unreadedObserverCallback),this.unreaded.delete(e),this.observer.unobserve(e,this.viewsObserverCallback),this.viewsMids.delete(t),this.observer.unobserve(e,this.stickerEffectObserverCallback))}deleteMessagesByIds(e,t=!0,i){let s=!1;e.forEach((e=>{const t=this.bubbles[e];t&&(this.destroyBubble(t,e),s=!0)})),s&&(this.scrollable.ignoreNextScrollEvent(),t&&this.chat.selection.isSelecting&&this.chat.selection.deleteSelectedMids(this.peerId,e),S.Z.checkAnimations(!1,this.chat.animationGroup),this.deleteEmptyDateGroups(),i||this.scrollable.onScroll())}pollExtendedMediaMessages(){const e=Array.from(this.extendedMediaMessages);return this.managers.appMessagesManager.getExtendedMedia(this.peerId,e)}setExtendedMediaMessagesPollInterval(){!this.pollExtendedMediaMessagesPromise&&this.extendedMediaMessages.size&&(this.pollExtendedMediaMessagesPromise=(0,Ce.Z)(3e4).then((()=>this.pollExtendedMediaMessages())).then((()=>this.setExtendedMediaMessagesPollInterval())))}setTopPadding(e=this.getMiddleware()){let t,i=!1;if(!this.isTopPaddingSet&&"scheduled"!==this.chat.type){const{clientHeight:e,scrollHeight:s}=this.scrollable.container;i=e===s,i&&(t=this.chatInner,t.style.paddingTop=e+"px",this.scrollable.setScrollTopSilently(s),this.isTopPaddingSet=!0)}return{isPaddingNeeded:i,unsetPadding:i?()=>{e()&&i&&(t.style.paddingTop="",this.isTopPaddingSet=!1)}:void 0}}renderNewMessage(e,t){const i=this._renderNewMessage(e,t);return this.renderNewPromises.add(i),i.catch(Ke.Z).finally((()=>{this.renderNewPromises.delete(i)})),i}_renderNewMessage(e,t){return _t(this,void 0,void 0,(function*(){if(!this.scrollable.loadedAll.bottom){const t=this.chat.setPeerPromise;if(t){const i=this.getMiddleware();t.then((()=>_t(this,void 0,void 0,(function*(){if(!i())return;const t=yield this.chat.getMessage(e.mid);i()&&this.renderNewMessage(t)}))))}return}if(this.chat.threadId&&(0,u.Z)(e,this.chat.isForum)!==this.chat.threadId)return;if(this.bubbles[e.mid])return;t||(t=this.scrolledDown&&(!this.scrollingToBubble||this.scrollingToBubble===this.getLastBubble()||this.scrollingToBubble===this.chatInner));const i=this.getMiddleware(),{isPaddingNeeded:s,unsetPadding:n}=this.setTopPadding(i),a=this.performHistoryResult({history:[e]},!1);return t&&a.then((()=>{if(!i())return;let t;"scheduled"===this.chat.type&&(t=this.bubbles[e.mid]);const a=t?this.scrollToBubbleEnd(t):this.scrollToEnd();s&&a.then(n)})),a}))}getLastBubble(){var e;const t=this.bubbleGroups.getLastGroup();return null===(e=null==t?void 0:t.lastItem)||void 0===e?void 0:e.bubble}scrollToBubble(e,t,i,s){const n=(0,q.Z)(e,"bubble");let a;if(e.parentElement||this.log.error("element is not connected",n),n&&"end"!==t){const e=this.bubbleGroups.getItemByBubble(n);e&&e.group.firstItem===e&&(0,se.Z)(e.group.container)===(this.stickyIntersector?Ot:1)&&(a=e.group.container.parentElement)}const o=this.chat.input.messageInput&&this.chat.input.messageInput.classList.contains("is-changing-height")||this.chat.container.classList.contains("is-toggling-helper"),r=this.scrollable.scrollIntoViewNew({element:e,position:t,margin:4,forceDirection:i,forceDuration:s,axis:"y",getNormalSize:o?({rect:e})=>{let t=de.Z.height;return t-=this.container.offsetTop,t-=C.Z.isMobile||de.Z.height<570?58:78,t}:void 0,fallbackToElementStartWhenCentering:a,startCallback:e=>{if(this.onScroll(!0,e),this.updateGradient){const{gradientRenderer:t}=this.chat;null==t||t.toNextPosition(e.getProgress),this.updateGradient=void 0}}});return i===j.f.Static&&(this.scrollable.lastScrollPosition=this.scrollable.scrollTop),r}scrollToEnd(){return this.scrollToBubbleEnd(this.chatInner)}scrollToBubbleEnd(e){return _t(this,void 0,void 0,(function*(){if(e){this.scrollingToBubble=e;const t=this.getMiddleware();if(yield this.scrollToBubble(e,"end",void 0,void 0),!t())return;this.scrollingToBubble=void 0}}))}scrollToBubbleIfLast(e){return _t(this,void 0,void 0,(function*(){if(this.getLastBubble()===e)return this.scrollToEnd()}))}highlightBubble(e){const t="highlightTimeout";e.dataset[t]&&(clearTimeout(+e.dataset[t]),e.classList.remove("is-highlighted"),e.offsetWidth),e.classList.add("is-highlighted"),e.dataset[t]=""+setTimeout((()=>{e.classList.remove("is-highlighted"),delete e.dataset[t]}),2e3)}createDateBubble(e,t=new Date(1e3*e)){let i;const s=new Date;s.setHours(0,0,0,0);const n="scheduled"===this.chat.type;if(s.getTime()===t.getTime())i=(0,E.ag)(n?"Chat.Date.ScheduledForToday":"Date.Today");else if(n&&e===re._)i=(0,E.ag)("MessageScheduledUntilOnline");else{const e={day:"numeric",month:"long"};t.getFullYear()!==s.getFullYear()&&(e.year="numeric"),i=new E.ZP.IntlDateElement({date:t,options:e}).element,n&&(i=(0,E.ag)("Chat.Date.ScheduledFor",[i]))}const a=document.createElement("div");a.className="bubble service is-date";const o=document.createElement("div");o.classList.add("bubble-content");const r=document.createElement("div");return r.classList.add("service-msg"),r.append(i),o.append(r),a.append(o),a}getDateForDateContainer(e){const t=new Date(1e3*e);return t.setHours(0,0,0),{date:t,dateTimestamp:t.getTime()}}getDateContainerByTimestamp(e){var t;const{date:i,dateTimestamp:s}=this.getDateForDateContainer(e);let n=this.dateMessages[s];if(n)return n;const a=this.createDateBubble(e,i),o=this.createDateBubble(e,i);o.classList.add("is-fake");const r=document.createElement("section");r.className="bubbles-date-group",r.append(a,o),n=this.dateMessages[s]={div:a,container:r,firstTimestamp:i.getTime()};const d=(0,Ee.Z)(this.dateMessages,"asc"),l=d.length;let c,h=0;for(;hthis.setPeerTempId===r,u=(0,Ge.Z)(h,Ut);i||(yield u(this.chat.onChangePeer(e,u)));const p=this.chat.type;("scheduled"===p||this.chat.isRestricted)&&(a=0);const f=yield u(this.chat.getHistoryStorage()),m="pinned"===p?yield u(this.managers.appMessagesManager.getPinnedMessagesMaxId(s,this.chat.threadId)):null!==(t=f.maxId)&&void 0!==t?t:0,g=void 0!==a;let v,b,y,w=0;if(!g)if(i||(b=this.chat.appImManager.getChatSavedPosition(this.chat)),b);else if(m){w=yield u(this.managers.appMessagesManager.getReadMaxIdIfUnread(s,this.chat.threadId));const e=yield u(this.chat.getDialogOrTopic());if(!w||i||e&&1===e.unread_count)a=m;else{const e=f.history.findSliceOffset(w);e&&e.slice.isEnd($.D.Bottom)&&(y=e.slice[e.offset-25]||e.slice[0]||w),v=!g,a=w}}const C=a!==m;if(void 0===o&&(yield u(this.chat.isStartButtonNeeded()))&&(o=l.gZ),i){n&&a&&this.followStack.push(n);const e=yield u(this.getMountedBubble(a));if(e)return g?(this.scrollToBubble(e.bubble,"center"),this.highlightBubble(e.bubble),this.chat.dispatchEvent("setPeer",a,!1)):m&&!C&&(this.scrollToEnd(),this.chat.dispatchEvent("setPeer",a,!0)),void 0!==o&&this.chat.input.setStartParam(o),null}else this.peerId&&(this.lazyLoadQueue.queueId=++Nt,this.managers.apiFileManager.setQueueId(this.chat.bubbles.lazyLoadQueue.queueId)),this.followStack.length=0,this.passEntities={messageEntityBotCommand:(yield u(this.managers.appPeersManager.isAnyGroup(s)))||this.chat.isBot};W.ZP&&c("setPeer peerId:",s,f,a,m);const L=null!=y?y:C||"scheduled"===p||this.chat.isRestricted?0:m;let E=0;if(i){const e=this.getBubbleByPoint("bottom");e&&(E=+e.dataset.mid),E<=0&&(E=Math.max(...Object.keys(this.bubbles).map((e=>+e))))}else this.isFirstLoad=!0,this.destroyResizeObserver();const I=this.chatInner,M=this.emptyPlaceholderBubble;this.cleanup();const Z=this.chatInner=document.createElement("div");i?(Z.className=I.className,Z.classList.remove("disable-hover","is-scrolling")):Z.classList.add("bubbles-inner"),this.lazyLoadQueue.lock();const P=i||m&&C||g,T=E>0&&(!a||Ethis.performHistoryResult({history:b.mids},!0))),cached:!0,waitPromise:Promise.resolve()}:yield u(this.getHistory1(a,!0,C,L)),this.setPeerCached=A.cached,c.warn("got history");const{promise:F,cached:D}=A;D||i||(yield u(this.chat.finishPeerChange(g,C,a,o)),this.scrollable.container.textContent="",this.preloader.attach(this.container)),S.Z.lockGroup(this.chat.animationGroup);const R=u(F).then((()=>_t(this,void 0,void 0,(function*(){var t;c.warn("promise fulfilled");const n=P?yield u(a?this.getMountedBubble(a):{bubble:this.getLastBubble()}):void 0;D&&!i&&(c.warn("finishing peer change"),yield u(this.chat.finishPeerChange(g,C,a,o)),c.warn("finished peer change")),this.preloader.detach(),this.resolveLadderAnimation&&(this.resolveLadderAnimation(),this.resolveLadderAnimation=void 0),this.setPeerCached=void 0;const r=this.scrollable;if(r.lastScrollDirection=0,r.lastScrollPosition=0,(0,_.Z)(r.container,Z),M&&this.cleanupPlaceholders(M),this.attachPlaceholderOnRender&&this.attachPlaceholderOnRender(),!g&&this.chat.isPinnedMessagesNeeded()&&(null===(t=this.chat.topbar.pinnedMessage)||void 0===t||t.setCorrectIndex(0)),this.container.classList.toggle("has-groups",!!Object.keys(this.dateMessages).length),c.warn("mounted chat",this.chatInner===Z,this.chatInner.parentElement,performance.now()-d),S.Z.unlockGroup(this.chat.animationGroup),S.Z.checkAnimations(!1,this.chat.animationGroup),this.lazyLoadQueue.unlock(),b)r.setScrollTopSilently(b.top);else if(P){let e;if(k)r.setScrollTopSilently(99999);else if(x){const t=this.setTopPadding();t.isPaddingNeeded&&(e=t.unsetPadding),r.setScrollTopSilently(0)}let t,s=v&&this.firstUnreadBubble||(null==n?void 0:n.bubble);if((null==s?void 0:s.parentElement)||(s=this.findNextMountedBubbleByMsgId(a,!1)||this.findNextMountedBubbleByMsgId(a,!0)),s){const e=this.getLastBubble(),n=v?"start":C||g||e!==s?"center":"end";t="end"===n&&e===s&&i?this.scrollToEnd():this.scrollToBubble(s,n,i?void 0:j.f.Static),!v&&g&&this.highlightBubble(s)}e&&(t||Promise.resolve()).then((()=>{e()}))}else r.setScrollTopSilently(99999);this.onRenderScrollSet(),this.onScroll();const l=Promise.all([R,(0,G.e9)()]);if(l.then((()=>{h()&&(r.checkForTriggers(),void 0!==e.mediaTimestamp)&&(D&&!i&>.Z.isAvailable("animations")&&this.chat.appImManager.chats.length>1?(0,Ce.Z)(400):Promise.resolve()).then((()=>this.getMountedBubble(a))).then((t=>{h()&&t&&this.playMediaWithTimestamp(t.bubble,e.mediaTimestamp)}))})),this.chat.dispatchEvent("setPeer",a,!C),Promise.all([this.setFetchReactionsInterval(l),this.setFetchHistoryInterval({afterSetPromise:l,lastMsgId:a,samePeer:i,savedPosition:b,topMessage:m})]).then((()=>{c("scrolledAllDown:",r.loadedAll.bottom),r.loadedAll.bottom&&m&&!this.unreaded.size&&this.onScrolledAllDown()})),"chat"===p&&!this.chat.isForumTopic){const e=yield u(this.managers.appMessagesManager.getDialogOnly(s));(null==e?void 0:e.pFlags.unread_mark)&&this.managers.appMessagesManager.markDialogUnread(s,!0)}})))).catch((e=>{throw c.error("setPeer promise error:",e),h()||this.preloader.detach(),e}));return{cached:D,promise:R}}))}playMediaWithTimestamp(e,t){const i=(0,q.Z)(e,"bubble"),s=(0,q.Z)(e,"grouped-item"),n=s?+s.dataset.mid:+i.dataset.textMid;let a=i.querySelector(".attachment");if(a){n&&(a=a.querySelector(`[data-mid="${n}"]`));const e=a.querySelector("img, video, canvas");return void this.checkTargetForMediaViewer(e,void 0,t)}const o=(s||i).querySelector(".audio");o&&o.playWithTimestamp(t)}setFetchReactionsInterval(e){return _t(this,void 0,void 0,(function*(){const t=this.getMiddleware();if(this.chat.isChannel){const i=()=>_t(this,void 0,void 0,(function*(){if(!t())return;const e=[];for(const t in this.bubbles){let i=yield this.chat.getMessage(+t);"message"===(null==i?void 0:i._)&&(i=yield this.managers.appMessagesManager.getGroupsFirstMessage(i),e.push(i.mid))}(e.length?this.managers.appReactionsManager.getMessagesReactions(this.peerId,e):Promise.resolve()).then((()=>{setTimeout(i,1e4)}))}));Promise.all([e,(0,G.e9)(),(0,Ce.Z)(500)]).then((()=>{i()}))}}))}setFetchHistoryInterval({lastMsgId:e,topMessage:t,afterSetPromise:i,savedPosition:s,samePeer:n}){return _t(this,void 0,void 0,(function*(){const e=this.peerId;if(e.isUser())return;const t=this.getMiddleware(),n=yield this.managers.appMessagesManager.isFetchIntervalNeeded(e);if(!s&&!n)return;if(yield i,!t())return;const a=e.toChatId();t.onClean((()=>{this.managers.apiUpdatesManager.unsubscribeFromChannelUpdates(a)})),this.managers.apiUpdatesManager.subscribeToChannelUpdates(a)}))}onScrolledAllDown(){return _t(this,void 0,void 0,(function*(){if("chat"===this.chat.type||"discussion"===this.chat.type){const e=yield this.chat.getHistoryMaxId();this.managers.appMessagesManager.readHistory(this.peerId,e,this.chat.threadId,!0)}}))}finishPeerChange(){return _t(this,void 0,void 0,(function*(){const[e,t,i]=yield Promise.all([this.chat.isChannel,this.chat.canSend(),this.chat.isAnyGroup]);return()=>{this.chatInner.classList.toggle("has-rights",t),this.container.classList.toggle("is-chat-input-hidden",!t),this.chatInner.classList.toggle("is-chat",i),this.chatInner.classList.toggle("is-channel",e),this.createResizeObserver()}}))}renderMessagesQueue(e){return this.batchProcessor.addToQueue(e)}ejectBubbles(){for(const e of this.bubblesToEject)e.remove();this.bubblesToEject.clear()}groupBubbles(e){let t;"scheduled"===this.chat.type&&(t=new Set,e.forEach((({bubble:e,message:i})=>{const s=this.bubbleGroups.getItemByBubble(e),n=null==s?void 0:s.group;n&&s.message.date!==i.date&&(this.bubbleGroups.removeItem(s),t.add(n))}))),e.forEach((({bubble:e,message:t})=>{this.bubbleGroups.prepareForGrouping(e,t)}));const i=this.bubbleGroups.groupUngrouped(),s=Array.from(i).map((e=>{if(e.avatar)return;const t=e.firstItem;return t&&this.chat.isAvatarNeeded(t.message)?e.createAvatar(t.message):void 0})).filter(Boolean);if(t)for(const e of t)i.add(e);return{groups:[...i],avatarPromises:s}}getMiddleware(e){return this.middlewareHelper.get(e)}wrapMediaSpoiler({media:e,promise:t,middleware:i,attachmentDiv:s}){return _t(this,void 0,void 0,(function*(){if(yield t,!i())return;const{width:n,height:a}=s.style,o=yield(0,st.ZP)({media:e,width:parseInt(n),height:parseInt(a),middleware:i,animationGroup:this.chat.animationGroup});i()&&s.append(o)}))}safeRenderMessage(e,t,i,s=!0,n){return _t(this,void 0,void 0,(function*(){if(!e||this.renderingMessages.has(e.mid)||this.bubbles[e.mid]&&!i)return;const a=this.getMiddleware().create(),o=a.get();let r;try{this.renderingMessages.add(e.mid);const d=document.createElement("div");d.middlewareHelper=a,d.dataset.mid=""+e.mid,d.dataset.peerId=""+e.peerId,d.dataset.timestamp=""+e.date,i&&(i.middlewareHelper.destroy(),this.skippedMids.delete(e.mid),this.bubblesToEject.add(i),this.bubblesToReplace.delete(i),this.bubblesToReplace.set(d,i),this.bubbleGroups.changeBubbleByBubble(i,d)),i=this.bubbles[e.mid]=d;let l=this.renderMessage(e,t,i,o);n&&(l=n(l,i));const c=l.then((e=>e&&o()?Object.assign(Object.assign({},e),{updatePosition:s}):void 0));if(this.renderMessagesQueue(c.catch((()=>{}))),r=yield c,!o())return;r||this.skippedMids.add(+e.mid)}catch(e){this.log.error("renderMessage error:",e)}return o()?(this.renderingMessages.delete(e.mid),r):void 0}))}renderMessage(e,t=!1,i,s){var a,o,r;return _t(this,void 0,void 0,(function*(){const c="message"===e._,h=c&&e.grouped_id;let p,f;const m=h?yield this.managers.appMessagesManager.getMessagesByAlbum(h):void 0,v="pinned"!==this.chat.type;if(h&&v){p=m.map((e=>e.mid));const t=jt(p);if(e.mid!==t)return}c&&(f=h?m[0]:e);const b=this.chat.isOurMessage(e),y=document.createElement("div");y.classList.add("message","spoilers-container");const w=document.createElement("div");w.classList.add("bubble-content-wrapper");const S=document.createElement("div");S.classList.add("bubble-content"),i.classList.add("bubble"),w.append(S),i.append(w);let M=!b&&!e.pFlags.out&&(e.pFlags.unread||De(e));if(!M&&this.chat.peerId.isAnyChat()){const t=yield this.managers.appMessagesManager.getReadMaxIdIfUnread(this.chat.peerId,this.chat.threadId);void 0!==t&&t"messageEntityEmoji"===e._)),t=_.replace(/\s/g,"").length;if(e.reduce(((e,t)=>e+t.length),0)===t){U=Math.min(zt,e.length),N=C.Z.active.customEmoji;const t=Ht[U];t&&(N=(0,Je.C)(t,t),i.style.setProperty("--emoji-size",t+"px"))}}null!=N||(N=this.chat.appImManager.customEmojiSize);const H=dt(D||e);D&&B&&(i.dataset.textMid=""+D.mid);const z={entities:F,passEntities:this.passEntities,loadPromises:P,lazyLoadQueue:this.lazyLoadQueue,customEmojiSize:N,middleware:s,animationGroup:this.chat.animationGroup,maxMediaTimestamp:H},j=_?(0,_e.ZP)(_,z):"";let G,V=!0,K=!1;if(U){if(n.Z.settings.emoji.big){const e=1===U&&!F.find((e=>"messageEntityCustomEmoji"===e._))&&(yield this.managers.appStickersManager.getAnimatedEmojiSticker(_));1===U&&!R&&e?R={_:"messageMediaDocument",document:e,pFlags:{}}:(G=document.createElement("div"),G.classList.add("attachment","spoilers-container"),(0,Z.Z)(G,j),S.append(G)),i.classList.add("is-message-empty","emoji-big"),K=!0,V=!1,B=!1}i.classList.add("can-have-big-emoji")}B&&(0,Z.Z)(y,j);const W=($=_,Mt.test($));var $;const Y=O.setTime({chatType:this.chat.type,message:e,reactionsMessage:f});let X;if(y.append(Y),S.prepend(y),W&&Y.classList.add("is-block"),c&&this.chat.isAllMessagesForum){const t=yield(0,xt.Z)({peerId:this.peerId,threadId:(0,u.Z)(e,this.chat.isForum),lastMsgId:e.mid,wrapOptions:{middleware:s},withIcons:!0}),{element:i}=t;X=document.createElement("div"),X.classList.add("topic-name-button-container"),X.append(i)}if(c&&e.views){if(i.classList.add("channel-post"),!(null===(a=e.fwd_from)||void 0===a?void 0:a.saved_from_msg_id)&&"pinned"!==this.chat.type){const e=document.createElement("div");e.classList.add("bubble-beside-button","forward","tgico-forward_filled"),S.prepend(e),i.classList.add("with-beside-button")}!e.pFlags.is_outgoing&&this.observer&&this.observer.observe(i,this.viewsObserverCallback)}const ie=c&&e.reply_markup;let ne="replyInlineMarkup"===(null==ie?void 0:ie._)&&ie.rows;if(ne&&(ne=ne.filter((e=>e.buttons.length))),ne){const t=document.createElement("div");t.classList.add("reply-markup"),ne.forEach((i=>{const s=i.buttons,n=document.createElement("div");n.classList.add("reply-markup-row"),s.forEach((t=>{let i,s=(0,_e.ZP)(t.text,{noLinks:!0,noLinebreaks:!0});switch(t._){case"keyboardButtonUrl":{const e=(0,_e.ZP)(" ",{entities:[{_:"messageEntityTextUrl",length:1,offset:0,url:t.url}]});i=(0,te.Z)(e).firstElementChild,i.classList.add("is-link");break}case"keyboardButtonSwitchInline":i=document.createElement("button"),i.classList.add("is-switch-inline"),(0,ee.fc)(i,(i=>{(0,J.Z)(i);const s=e.viaBotId||e.fromId;let n;n=t.pFlags.same_peer?Promise.resolve(this.peerId):this.managers.appInlineBotsManager.checkSwitchReturn(s).then((e=>e||new Promise(((e,t)=>{const i=new g.Z(void 0,(t=>{e(t)}));i.addEventListener("close",(()=>{t()}))})))),n.then((e=>{const i=this.peerId===e?this.chat.threadId:void 0;this.chat.appImManager.setInnerPeer({peerId:e}),this.managers.appInlineBotsManager.switchInlineQuery(e,i,s,t.query)}))}));break;case"keyboardButtonBuy":{const e="messageMediaInvoice"===R._?R:void 0;if(null==e?void 0:e.extended_media)break;i=document.createElement("button"),i.classList.add("is-buy"),(null==e?void 0:e.receipt_msg_id)&&(s=(0,E.ag)("Message.ReplyActionButtonShowReceipt"));break}case"keyboardButtonUrlAuth":{i=document.createElement("button"),i.classList.add("is-url-auth");const{peerId:s}=this,{mid:n}=e,{url:a,button_id:o}=t;(0,ee.fc)(i,(()=>{const e=(0,At.Z)([i],!0);this.chat.appImManager.handleUrlAuth({peerId:s,mid:n,url:a,buttonId:o}).then((()=>{e()}))}));break}default:i=document.createElement("button")}if(!i)return;i.classList.add("reply-markup-button","rp","tgico");const a=document.createElement("span");a.classList.add("reply-markup-button-text"),"string"==typeof s?a.insertAdjacentHTML("beforeend",s):a.append(s),(0,I.Z)(i),i.append(a),n.append(i)})),n.childElementCount&&t.append(n)}));const s=!!t.childElementCount;s&&(0,ee.fc)(t,(t=>{let i=t.target;if(i.classList.contains("reply-markup-button")||(i=(0,q.Z)(i,"reply-markup-button")),!i||i.classList.contains("is-link")||i.classList.contains("is-switch-inline")||i.classList.contains("is-buy")||i.classList.contains("is-url-auth"))return;(0,J.Z)(t);const s=(0,se.Z)(i),n=ne[(0,se.Z)(i.parentElement)];if(!n.buttons||!n.buttons[s])return void this.log.warn("no such button",n,s,e);const a=n.buttons[s];this.managers.appInlineBotsManager.callbackButtonClick(this.peerId,e.mid,a).then((e=>{"string"==typeof e.message&&e.message.length&&(0,Q.Am)((0,_e.ZP)(e.message,{noLinks:!0,noLinebreaks:!0}))}))})),s&&(i.classList.add("with-reply-markup"),w.append(t))}const ae=e.pFlags.is_outgoing;if(b){(e.pFlags.unread||ae)&&this.unreadOut.add(e.mid);let t="";t=e.error?"is-error":ae?"is-sending":e.pFlags.unread||e.pFlags.is_scheduled?"is-sent":"is-read",i.classList.add(t)}ae&&!e.error&&i.classList.add("is-outgoing");const oe=c&&(yield this.managers.appMessagesManager.getMessageWithCommentReplies(e)),re=!!oe&&e.mid>0;re&&i.classList.add("with-replies");const de=c&&e.fwd_from,ce=c&&e.fwdFromId,he=this.chat.isOutMessage(e);let ue=S;const pe=!(e.viaBotId||e.fromId!==n.Z.myId&&e.pFlags.out),fe=!_;let ge;if(R){G=document.createElement("div"),G.classList.add("attachment"),fe&&i.classList.add("is-message-empty");let t=!1;switch(R._){case"messageMediaPhoto":{const t=R.photo;if(fe&&(V=!1),pe&&i.classList.add("hide-name"),i.classList.add("photo"),v&&h&&1!==p.length){i.classList.add("is-album","is-grouped"),ot({messages:m,attachmentDiv:G,middleware:this.getMiddleware(),isOut:b,lazyLoadQueue:this.lazyLoadQueue,chat:this.chat,loadPromises:P,autoDownload:this.chat.autoDownload});break}const n=!L.IS_ANDROID&&V&&!re&&!1;n&&i.classList.add("with-media-tail");const a=(0,nt.Z)({photo:t,message:e,container:G,withTail:n,isOut:he,lazyLoadQueue:this.lazyLoadQueue,middleware:this.getMiddleware(),loadPromises:P,autoDownloadSize:this.chat.autoDownload.photo});R.pFlags.spoiler&&P.push(this.wrapMediaSpoiler({media:t,promise:a,middleware:s,attachmentDiv:G}));break}case"messageMediaWebPage":{t=!0;const s=R.webpage;if("webPage"!==s._)break;const a=(0,kt.Z)(s.url);if("im"===(null==a?void 0:a.onclick)){const e={telegram_channel:"Chat.Message.ViewChannel",telegram_megagroup:"OpenGroup",telegram_bot:"Chat.Message.ViewBot"}[s.type]||"OpenMessage";ge=this.makeViewButton({text:e,asLink:!0}),ge.href=a.url,ge.setAttribute("onclick",`${a.onclick}(this)`)}i.classList.add("webpage");const o=document.createElement("div");o.classList.add("web");const r=document.createElement("div");let d,l;r.classList.add("quote");const c=s.photo;(c||s.document)&&(d=document.createElement("div"),d.classList.add("preview-resizer"),l=document.createElement("div"),l.classList.add("preview"),d.append(l));const h=document.createElement("div");h.classList.add("quote-text");const u=s.document;if(u)if("gif"===u.type||"video"===u.type||"round"===u.type){const t="round"===u.type?C.Z.active.round:C.Z.active.webpage;"round"===u.type?(i.classList.add("round"),l.classList.add("is-round")):i.classList.add("video"),(0,at.Z)({doc:u,container:l,message:e,boxWidth:t.width,boxHeight:t.height,lazyLoadQueue:this.lazyLoadQueue,middleware:this.getMiddleware(),isOut:he,group:this.chat.animationGroup,loadPromises:P,autoDownload:this.chat.autoDownload,noInfo:e.mid<0})}else{const t=yield(0,rt.Z)({message:e,autoDownloadSize:this.chat.autoDownload.file,lazyLoadQueue:this.lazyLoadQueue,loadPromises:P,sizeType:"documentName",searchContext:{useSearch:!1,peerId:this.peerId,inputFilter:{_:"inputMessagesFilterEmpty"}},fontSize:n.Z.settings.messagesTextSize,canTranscribeVoice:!0});l.append(t),l.classList.add("preview-with-document"),h.classList.add("has-document")}let p;if(d&&h.append(d),s.site_name){const e=(0,_e.ZP)(s.url),t=(0,te.Z)(e).firstElementChild;t.classList.add("webpage-name");const i=document.createElement("strong");(0,Z.Z)(i,(0,k.Z)(s.site_name)),t.textContent="",t.append(i),h.append(t),p=t}const f=(0,Ae.Z)(s);if(f.textContent){const e=document.createElement("div");e.classList.add("title");const t=document.createElement("strong");(0,Z.Z)(t,f),e.append(t),h.append(e),p=e}const m=(0,xe.Z)(s);if(m.textContent){const e=document.createElement("div");e.classList.add("text"),(0,Z.Z)(e,m),h.append(e),p=e}if(r.append(h),c&&!u){i.classList.add("photo");const t=c.sizes[c.sizes.length-1];let s=!1;t.w===t.h&&p?(i.classList.add("is-square-photo"),s=!0,(0,ke.Z)(c,l,48,48,!1)):t.h>t.w&&i.classList.add("is-vertical-photo"),(0,nt.Z)({photo:c,message:e,container:l,boxWidth:s?0:C.Z.active.webpage.width,boxHeight:s?0:C.Z.active.webpage.height,isOut:he,lazyLoadQueue:this.lazyLoadQueue,middleware:this.getMiddleware(),loadPromises:P,withoutPreloader:s,autoDownloadSize:this.chat.autoDownload.photo})}o.append(r),y.insertBefore(o,Y);break}case"messageMediaDocument":{const a=R.document;if(a.sticker){i.classList.add("sticker"),V=!1,K=!0,a.animated&&i.classList.add("sticker-animated");const e=C.Z.active,t=i.classList.contains("emoji-big"),n=t?e.emojiSticker:a.animated?e.animatedSticker:e.staticSticker;(0,ke.Z)(a,G,n.width,n.height),S.style.minWidth=G.style.width,S.style.minHeight=G.style.height,(0,et.ZP)({doc:a,div:G,middleware:s,lazyLoadQueue:this.lazyLoadQueue,group:this.chat.animationGroup,play:!0,liteModeKey:"stickers_chat",loop:!0,emoji:t?_:void 0,withThumb:!0,loadPromises:P,isOut:he,noPremium:null===(o=null==R?void 0:R.pFlags)||void 0===o?void 0:o.nopremium}),((0,Qe.Z)(a)||t)&&(M||ae)&&this.observer.observe(i,this.stickerEffectObserverCallback)}else if("video"===a.type||"gif"===a.type||"round"===a.type){const t="round"===a.type;if(t&&(K=!0),(t||fe)&&(V=!1),pe&&i.classList.add("hide-name"),i.classList.add(t?"round":"video"),v&&h&&1!==p.length)i.classList.add("is-album","is-grouped"),ot({messages:m,attachmentDiv:G,middleware:s,isOut:b,lazyLoadQueue:this.lazyLoadQueue,chat:this.chat,loadPromises:P,autoDownload:this.chat.autoDownload});else{const n=!L.IS_ANDROID&&!L.IS_APPLE&&!t&&V&&!re&&!1;n&&i.classList.add("with-media-tail");const o=(0,at.Z)({doc:a,container:G,message:e,boxWidth:C.Z.active.regular.width,boxHeight:C.Z.active.regular.height,withTail:n,isOut:he,lazyLoadQueue:this.lazyLoadQueue,middleware:s,group:this.chat.animationGroup,loadPromises:P,autoDownload:this.chat.autoDownload,searchContext:t?{peerId:this.peerId,inputFilter:{_:"inputMessagesFilterRoundVoice"},threadId:this.chat.threadId,useSearch:!e.pFlags.is_scheduled,isScheduled:e.pFlags.is_scheduled}:void 0,noInfo:e.mid<0,noAutoplayAttribute:!!R.pFlags.spoiler});R.pFlags.spoiler&&P.push(this.wrapMediaSpoiler({media:a,promise:o,middleware:s,attachmentDiv:G}))}}else{const s=yield function({albumMustBeRenderedFull:e,message:t,bubble:i,messageDiv:s,chat:n,loadPromises:a,autoDownloadSize:o,lazyLoadQueue:r,searchContext:d,useSearch:l,sizeType:c,managers:h,fontWeight:u,fontSize:p,richTextFragment:f,richTextOptions:m,canTranscribeVoice:g}){return lt(this,void 0,void 0,(function*(){let l;const v=e?yield n.getMidsByMid(t.mid):[t.mid],b=v.map(((e,t)=>lt(this,void 0,void 0,(function*(){const i=yield n.getMessage(e),s=yield(0,rt.Z)({message:i,loadPromises:a,autoDownloadSize:o,lazyLoadQueue:r,searchContext:d,sizeType:c,managers:h,fontWeight:u,fontSize:p,canTranscribeVoice:g}),b=document.createElement("div");b.classList.add("document-container"),b.dataset.mid=""+e,b.dataset.peerId=""+i.peerId;const y=document.createElement("div");if(y.classList.add("document-wrapper"),i.message){const e=document.createElement("div");e.classList.add("document-message");let t=f;t||(t=(0,_e.ZP)(i.message,Object.assign(Object.assign({},m),{entities:i.totalEntities,maxMediaTimestamp:dt(i)}))),(0,Z.Z)(e,t),y.append(e)}if(v.length>1){const e=document.createElement("div");e.classList.add("document-selection"),b.append(e),b.classList.add("grouped-item"),0===t&&(l=y)}return y.append(s),b.append(y),b})))),y=yield Promise.all(b);return s.append(...y),v.length>1&&i.classList.add("is-multiple-documents","is-grouped"),l}))}({albumMustBeRenderedFull:v,message:e,bubble:i,messageDiv:y,chat:this.chat,loadPromises:P,autoDownloadSize:this.chat.autoDownload.file,lazyLoadQueue:this.lazyLoadQueue,searchContext:"voice"===a.type||"audio"===a.type?{peerId:this.peerId,inputFilter:{_:"voice"===a.type?"inputMessagesFilterRoundVoice":"inputMessagesFilterMusic"},threadId:this.chat.threadId,useSearch:!e.pFlags.is_scheduled,isScheduled:e.pFlags.is_scheduled}:void 0,sizeType:"documentName",fontSize:n.Z.settings.messagesTextSize,richTextFragment:"string"==typeof j?void 0:j,richTextOptions:z,canTranscribeVoice:!0});s&&(ue=s);const o=y.lastElementChild.querySelector(".document-message, .document, .audio");o&&o.append(Y),i.classList.remove("is-message-empty");const r=(["photo","pdf"].includes(a.type)?"document":a.type||"document")+"-message";y.classList.add(r),"audio"!==a.type&&"voice"!==a.type||i.classList.add("min-content"),t=!0}break}case"messageMediaCall":{const e=R.action,s=document.createElement("div");s.classList.add("bubble-call",e.pFlags.video?"tgico-videocamera":"tgico-phone");const n=e.pFlags.video?"video":"voice";s.dataset.type=n;const a=document.createElement("div");a.classList.add("bubble-call-title"),(0,E.$d)(a,he?e.pFlags.video?"CallMessageVideoOutgoing":"CallMessageOutgoing":e.pFlags.video?"CallMessageVideoIncoming":"CallMessageIncoming");const o=document.createElement("div");if(o.classList.add("bubble-call-subtitle"),void 0!==e.duration)o.append((0,me.Z)(e.duration));else{let t;switch(e.reason._){case"phoneCallDiscardReasonBusy":t="Call.StatusBusy";break;case"phoneCallDiscardReasonMissed":t="Chat.Service.Call.Missed";break;default:t="Chat.Service.Call.Cancelled"}o.classList.add("is-reason"),(0,E.$d)(o,t)}o.classList.add("tgico","arrow-"+(void 0!==e.duration?"green":"red")),s.append(a,o),t=!0,i.classList.remove("is-message-empty"),y.classList.add("call-message"),y.append(s);break}case"messageMediaContact":{const e=R,s=document.createElement("div");s.classList.add("contact"),s.dataset.peerId=""+e.user_id,t=!0;const n=document.createElement("div");n.className="contact-details";const a=document.createElement("div");a.className="contact-name";const o=[e.first_name,e.last_name].filter(Boolean).join(" ");a.append(o.trim()?(0,k.Z)(o):(0,E.ag)("AttachContact"));const r=document.createElement("div");r.className="contact-number",r.textContent=e.phone_number?"+"+(0,le.u)(e.phone_number).formatted:"Unknown phone number",s.append(n),n.append(a,r);const l=new d.Z;l.updateWithOptions({lazyLoadQueue:this.lazyLoadQueue,peerId:e.user_id.toPeerId(),peerTitle:e.user_id?void 0:o.trim()?o:E.ZP.format("AttachContact",!0)[0]}),l.classList.add("contact-avatar","avatar-54"),s.prepend(l),i.classList.remove("is-message-empty"),y.classList.add("contact-message"),y.append(s);break}case"messageMediaPoll":{i.classList.remove("is-message-empty");const t=function(e,t=n.Z.managers){const i=new Et;return i.message=e,i.managers=t,i.setAttribute("peer-id",""+e.peerId),i.setAttribute("poll-id",e.media.poll.id),i.setAttribute("message-id",""+e.mid),i.render(),i}(e);y.prepend(t),y.classList.add("poll-message");break}case"messageMediaInvoice":{const t=R.pFlags.test,n=R.extended_media,a="messageExtendedMedia"===(null==n?void 0:n._),o="messageExtendedMediaPreview"===(null==n?void 0:n._);let r=a?n.media.photo||n.media.document:R.photo;const d=(0,$e.Z)(R.total_amount,R.currency);let l,c;if(n){if(o&&(l=document.createElement("span"),l.classList.add("extended-media-buy","tgico-premium_lock"),G.classList.add("is-buy"),(0,E.$d)(l,"Checkout.PayPrice",[d]),void 0!==n.video_duration)){const e=document.createElement("span");e.classList.add("video-time"),e.textContent=(0,mt.Z)(n.video_duration,!1),G.append(e)}}else{l=document.createElement(r?"span":"div");const e=document.createDocumentFragment(),i=(0,E.ag)(R.receipt_msg_id?"PaymentReceipt":t?"PaymentTestInvoice":"PaymentInvoice");i.classList.add("text-uppercase");const s=" "+Zt.Z,n=document.createElement("span");if(n.classList.add("text-bold"),n.textContent=d+s,e.append(n,i),t&&R.receipt_msg_id){const t=document.createElement("span");t.classList.add("text-uppercase","pre-wrap"),t.append(s+"(Test)"),e.append(t)}(0,Z.Z)(l,e)}if(o&&(n.thumb.w=n.w,n.thumb.h=n.h,r={_:"photo",access_hash:"",pFlags:{},date:0,dc_id:0,file_reference:[],id:0,sizes:[n.thumb]}),r){const t=n?C.Z.active.extendedInvoice:C.Z.active.invoice;"document"===r._?((0,at.Z)({doc:r,container:G,withTail:!1,isOut:he,lazyLoadQueue:this.lazyLoadQueue,middleware:s,loadPromises:P,boxWidth:t.width,boxHeight:t.height,group:this.chat.animationGroup,message:e}),i.classList.add("video")):((0,nt.Z)({photo:r,container:G,withTail:!1,isOut:he,lazyLoadQueue:this.lazyLoadQueue,middleware:s,loadPromises:P,boxWidth:t.width,boxHeight:t.height,message:a?e:void 0}),i.classList.add("photo")),l&&(n||l.classList.add("video-time"),G.append(l))}else G=void 0;if(o){const{mid:t}=e;this.extendedMediaMessages.add(t),s.onClean((()=>{this.extendedMediaMessages.delete(t)})),this.setExtendedMediaMessagesPollInterval();const{width:i,height:n}=G.style,a=Pt.Z.create({width:parseInt(i),height:parseInt(n),middleware:s,animationGroup:this.chat.animationGroup});G.append(a.canvas)}n||(c=document.createElement("div"),c.classList.add("bubble-primary-color"),(0,Z.Z)(c,(0,k.Z)(R.title)));const h=a?void 0:(0,k.Z)(R.description);y.prepend(...[c,!r&&l,h].filter(Boolean)),h?i.classList.remove("is-message-empty"):V=!1,i.classList.add("is-invoice");break}default:G=void 0,i.classList.remove("is-message-empty"),y.append((0,E.ag)(E.nK),Y),this.log.warn("unrecognized media type:",R._,e)}!t&&G&&S.append(G)}K&&i.classList.add("just-media"),ge&&Y.before(ge);let ve="";const be=e.fromId!==n.Z.myId&&this.chat.isAnyGroup||e.viaBotId||e.pFlags.sponsored;if(be||de||e.reply_to_mid||X){let t,s;const a="peerChannel"===(null===(r=e.from_id)||void 0===r?void 0:r._)&&e.fromId===ce,o=!!e.viaBotId,d=de&&!de.from_id;e.viaBotId&&(s=document.createElement("span"),s.innerText="@"+(yield this.managers.appPeersManager.getPeerUsername(e.viaBotId)),s.classList.add("peer-title")),o&&i.classList.add("must-have-name");const h=ce||de;let u,p;if(d?(t=document.createElement("span"),(0,Z.Z)(t,(0,k.Z)(de.from_name)),t.classList.add("peer-title"),i.classList.add("hidden-profile")):t=new x.Z({peerId:ce||e.fromId,withPremiumIcon:!h,wrapOptions:A}).element,c&&e.reply_to_mid&&e.reply_to_mid!==this.chat.threadId&&(!this.chat.isAllMessagesForum||e.reply_to.reply_to_top_id)&&(u=yield O.setReply({chat:this.chat,bubble:i,bubbleContainer:S,message:e})),h)if(this.peerId===n.Z.myId||a||i.classList.add("forwarded"),e.savedFrom&&(ve=e.savedFrom,t.dataset.savedFrom=ve),p=document.createElement("div"),t.dataset.peerId=""+ce,this.peerId!==n.Z.myId&&this.peerId!==l.hj&&!a||K){const e=[t];if(K){const t=document.createElement("br");t.classList.add("hide-ol"),e.unshift(t)}p.append((0,E.ag)("ForwardedFrom",[e]))}else p.style.color=(0,Be.Z)(ce,!1),p.classList.add("colored-name"),p.append(t);else if(!e.viaBotId)if(!K&&be){p=document.createElement("div"),p.append(t);const i=yield this.managers.appPeersManager.getPeer(e.fromId),s=null==i?void 0:i.pFlags;s&&(s.scam||s.fake)&&p.append((0,Ze.Z)(s.scam)),b||(p.style.color=(0,Be.Z)(e.fromId,!1),p.classList.add("colored-name")),p.dataset.peerId=""+e.fromId}else i.classList.add("hide-name");if(e.viaBotId){p?p.append(" "):p=document.createElement("div");const e=document.createElement("span");e.append((0,E.ag)("ViaBot")," ",s),e.classList.add("is-via"),p.append(e)}X&&(K?X.classList.add("floating-part"):(p||(p=document.createElement("div")),p.append(X),i.classList.remove("hide-name"))),p?(p.classList.add("name"),K?(ue.append(ue=document.createElement("div")),ue.classList.add("name-with-reply","floating-part")):p.classList.add("floating-part"),ue.append(p),K&&u&&ue.append(u)):K&&u&&u.classList.add("floating-part"),X&&K&&(G?G.after(X):this.log.error("no attachment div?",i,e))}else i.classList.add("hide-name");if("pinned"===this.chat.type&&(ve=`${this.chat.peerId}_${e.mid}`),oe&&oe.mid===this.chat.threadId&&i.classList.add("is-thread-starter","is-group-last"),ve&&("pinned"===this.chat.type||de.saved_from_msg_id)&&this.peerId!==l.hj){const e=document.createElement("div");e.classList.add("bubble-beside-button","goto-original","tgico-arrow_next"),S.append(e),i.dataset.savedFrom=ve,i.classList.add("with-beside-button")}return i.classList.add(he?"is-out":"is-in"),re&&(O.renderReplies({bubble:i,bubbleContainer:S,message:oe,messageDiv:y,loadPromises:P,lazyLoadQueue:this.lazyLoadQueue})?V=!0:i.classList.add("with-beside-replies")),c&&this.appendReactionsElementToBubble(i,e,f),V&&(i.classList.add("can-have-tail"),S.append(Vt())),T}))}appendReactionsElementToBubble(e,t,i,s){if(this.peerId.isUser(),!(null==i?void 0:i.reactions)||!i.reactions.results.length)return;const n=new Se.Z;if(n.init(i,"block",e.middlewareHelper.get()),n.render(s),e.classList.contains("is-message-empty"))e.querySelector(".bubble-content-wrapper").append(n);else{const s=e.querySelector(".message");if(e.classList.contains("is-multiple-documents")){const e=s.lastElementChild;let a=e.querySelector(".document-message"),o=a&&a.querySelector(".time");o||(o=O.setTime({chatType:this.chat.type,message:t,reactionsMessage:i})),n.append(o),a||(a=document.createElement("div"),a.classList.add("document-message"),e.querySelector(".document-wrapper").prepend(a)),a.append(n)}else{const t=Array.from(e.querySelectorAll(".time")).pop();n.append(t),s.append(n)}}}prepareToSaveScroll(e){if(!this.chatInner.parentElement)return{};const t=this.log.bindPrefix("prepareToSaveScroll");t("save");const i=this.createScrollSaver(e);if(i.save(),this.getRenderedLength()&&!this.chat.setPeerPromise){const e=this.getViewportSlice();this.deleteViewportSlice(e,!0)}return{restoreScroll:()=>{t("restore"),i.restore(e),this.onRenderScrollSet(i.getSaved())},scrollSaver:i}}performHistoryResult(e,t){var i;return _t(this,void 0,void 0,(function*(){let s=e.history;s=s.slice(),this.needReflowScroll&&((0,ie.Z)(this.scrollable.container),this.needReflowScroll=!1);const n=yield Promise.all(s.map((e=>"number"==typeof e?this.chat.getMessage(e):e))),a=[];if(!this.scrollable.loadedAll.bottom||!this.scrollable.loadedAll.top){let t=e.isEnd;if(!t){const e=yield this.chat.getHistoryStorage(),i=e.history.first,n=e.history.last;t={top:!1,bottom:!1,both:!1},!i.isEnd($.D.Bottom)||i.length&&!s.includes(i[0])||(t.bottom=!0),!n.isEnd($.D.Top)||n.length&&!s.includes(n[n.length-1])||(t.top=!0)}if(!t.bottom&&this.setPeerOptions){const{lastMsgId:e,topMessage:i,savedPosition:s}=this.setPeerOptions;this.setPeerOptions=void 0,(!e&&!s||this.bubbles[i]||e===i)&&(t.bottom=!0)}t.top&&a.push(this.setLoaded("top",!0)),t.bottom&&a.push(this.setLoaded("bottom",!0))}yield Promise.all(a);const o=n.map((e=>e?e.pFlags.local?this.processLocalMessageRender(e):this.safeRenderMessage(e,t):void 0));yield Promise.all(o),yield this.messagesQueuePromise,this.scrollable.loadedAll.top&&this.messagesQueueOnRenderAdditional&&(this.messagesQueueOnRenderAdditional(),null===(i=this.messagesQueueOnRenderAdditional)||void 0===i||i.call(this))}))}onRenderScrollSet(e){const t="has-sticky-dates";if(this.container.classList.contains(t)||this.preloader.detached&&(null!=e||(e={scrollHeight:this.scrollable.scrollHeight,clientHeight:this.scrollable.container.clientHeight}),e.scrollHeight===e.clientHeight))this.willScrollOnLoad=void 0;else{const e=this.getMiddleware(),i=()=>{e()&&this.container.classList.add(t)};this.willScrollOnLoad?i():setTimeout(i,600)}}requestHistory(e,t,i){return"chat"===this.chat.type||"discussion"===this.chat.type?this.managers.acknowledged.appMessagesManager.getHistory(this.peerId,e,t,i,this.chat.threadId):"pinned"===this.chat.type?this.managers.acknowledged.appMessagesManager.getSearch({peerId:this.peerId,inputFilter:{_:"inputMessagesFilterPinned"},maxId:e,limit:t,backLimit:i}).then((e=>({cached:e.cached,result:Promise.resolve(e.result).then((e=>({history:e.history.map((e=>e.mid))})))}))):"scheduled"===this.chat.type?this.managers.acknowledged.appMessagesManager.getScheduledMessages(this.peerId).then((e=>({cached:e.cached,result:Promise.resolve(e.result).then((e=>({history:e.slice().reverse()})))}))):void 0}animateAsLadder(e,t,i,s,n){return _t(this,void 0,void 0,(function*(){const a=this.log.bindPrefix("ladder");if(this.chat.setPeerPromise&&!this.resolveLadderAnimation)return a.warn("will be delayed"),void(this.resolveLadderAnimation=this.animateAsLadder.bind(this,e,t,i,s,n));if(!Object.keys(this.bubbles).length)return void a.warn("no bubbles");let o,r=(0,Ee.Z)(this.bubbles,"desc");i&&t.length&&(r=r.filter((e=>!t.includes(e)))),o=s?n||Math.max(...r):e||Math.max(...r);const d=r.slice(r.findIndex((e=>o>e))),l=i?[]:[o],c=i?[]:r.slice(0,r.findIndex((e=>o>=e))).reverse();W.ZP&&a("targeting mid:",o,n,e,d.map((e=>(0,Ne.Z)(e))),c.map((e=>(0,Ne.Z)(e))));const h=[];this.chatInner.classList.add("zoom-fading");const u=i?10:40,p=i?0:1,f=(e,t=0)=>{const i=(0,K.Z)();let s=0;return e.forEach(((n,o)=>{const r=this.bubbles[n];if(!r||this.skippedMids.has(n))return void a.warn("no bubble by mid:",n);s=(o+t||.1)*u;const d=r.lastElementChild,l=[d],c=this.bubbleGroups.getItemByBubble(r);if(c&&c.group.avatar&&c.group.lastItem===c&&l.push(c.group.avatar),l.forEach((e=>{e.classList.add("zoom-fade","can-zoom-fade"),e.style.transitionDelay=s+"ms"})),o===e.length-1){const e=t=>{t.target===d&&(i.resolve(),d.removeEventListener("transitionend",e))};d.addEventListener("transitionend",e)}h.push(...l)})),e.length||i.resolve(),{lastMsDelay:s,animationPromise:i}},m=f(d,p),g=f(l),v=f(c,p),b=[m.animationPromise,g.animationPromise,v.animationPromise],y=[m.lastMsDelay,g.lastMsDelay,v.lastMsDelay];let w;return this.onAnimateLadder&&(yield this.onAnimateLadder()),(0,V.T2)((()=>{this.setStickyDateManually(),h.forEach((e=>{e.classList.remove("zoom-fade")}))})),(d.length||l.length||c.length)&&(w=Promise.all(b),(0,G.YW)(w,Math.max(...y)+200).then((()=>{(0,V.T2)((()=>{h.forEach((e=>{e.style.transitionDelay="",e.classList.remove("can-zoom-fade")})),this.chatInner.classList.remove("zoom-fading")}))}))),w}))}renderEmptyPlaceholder(e,t,i,s){return _t(this,void 0,void 0,(function*(){const i="empty-bubble-placeholder";let n,a;if(t.classList.add(i,i+"-"+e),"group"===e?n=(0,E.ag)("GroupEmptyTitle1"):"saved"===e?n=(0,E.ag)("ChatYourSelfTitle"):"noMessages"===e||"greeting"===e?n=(0,E.ag)("NoMessages"):"noScheduledMessages"===e?n=(0,E.ag)("NoScheduledMessages"):"restricted"===e&&(n=document.createElement("span"),n.innerText=yield this.managers.appPeersManager.getRestrictionReasonText(this.peerId)),n.classList.add("center",i+"-title"),s.push(n),"group"===e)s.push((0,E.ag)("GroupEmptyTitle2")),a=[(0,E.ag)("GroupDescription1"),(0,E.ag)("GroupDescription2"),(0,E.ag)("GroupDescription3"),(0,E.ag)("GroupDescription4")];else if("saved"===e)a=[(0,E.ag)("ChatYourSelfDescription1"),(0,E.ag)("ChatYourSelfDescription2"),(0,E.ag)("ChatYourSelfDescription3"),(0,E.ag)("ChatYourSelfDescription4")];else if("greeting"===e){const e=(0,E.ag)("NoMessagesGreetingsDescription");e.classList.add("center",i+"-subtitle");const t=document.createElement("div");t.classList.add(i+"-sticker");const n=this.getMiddleware();yield this.managers.appStickersManager.getGreetingSticker().then((e=>_t(this,void 0,void 0,(function*(){if(!n())return;const i=[];return yield(0,et.ZP)({doc:e,div:t,middleware:n,lazyLoadQueue:this.lazyLoadQueue,group:this.chat.animationGroup,play:!0,loop:!0,withThumb:!0,loadPromises:i,liteModeKey:"stickers_chat"}),(0,ee.fc)(t,(e=>{(0,J.Z)(e),Ve.Jo.onMediaClick({target:e.target})})),Promise.all(i)})))),s.push(e,t)}a&&(s.push(...a.map((e=>{const t=document.createElement("span");return t.classList.add(i+"-list-item"),t.append(e),t}))),"group"===e?a.forEach((e=>{const t=document.createElement("span");t.classList.add("tgico-check"),e.prepend(t)})):"saved"===e&&a.forEach((e=>{const t=document.createElement("span");t.classList.add(i+"-list-bullet"),t.innerText="•",e.prepend(t)}))),s.length>1&&t.classList.add("has-description"),s.forEach((e=>e.classList.add(i+"-line")))}))}processLocalMessageRender(e,t,i=this.getMiddleware()){return _t(this,void 0,void 0,(function*(){const s=!!e.pFlags.sponsored,o=(0,Ge.Z)(i);return this.safeRenderMessage(e,!s,void 0,!1,(i=>_t(this,void 0,void 0,(function*(){const{bubble:r}=yield o(i);if(!r)return i;r.message=e,r.classList.add("is-group-last","is-group-first");const d=()=>{this.updatePlaceholderPosition===d&&(this.updatePlaceholderPosition=void 0),u[p](r)};s||(r.classList.add("bubble-first"),r.classList.remove("can-have-tail","is-in"));const l=[],c=this.chat.isBot;let h,u=this.container,p="append";if(this.chat.isRestricted)h=this.renderEmptyPlaceholder("restricted",r,e,l);else if(s){let i,s,n,a;r.classList.add("avoid-selection"),r.style.order="999999";const o=this.sponsoredMessage=e.sponsoredMessage,d=(0,T.Z)(o.from_id);o.channel_post?(i="OpenChannelPost",s=(0,Oe.Z)(o.channel_post)):o.start_param||c?(i="Chat.Message.ViewBot",n=o.start_param):i=(yield this.managers.appPeersManager.isAnyGroup(d))?"Chat.Message.ViewGroup":"Chat.Message.ViewChannel",a=o.chat_invite?()=>{new ye.Z(o.chat_invite_hash,o.chat_invite)}:o.chat_invite_hash?()=>{const e={_:we.z.JOIN_CHAT,invite:o.chat_invite_hash};this.chat.appImManager.processInternalLink(e)}:()=>{this.chat.appImManager.setInnerPeer({peerId:d,lastMsgId:s,startParam:n})};const l=this.makeViewButton({text:i});this.observer.observe(l,this.viewsObserverCallback),a&&(0,ee.fc)(l,a),r.querySelector(".bubble-content").prepend(l),u=this.chatInner,p="append",t=!1}else if(c&&"message"===e._){const e=document.createElement("b");e.append((0,E.ag)("BotInfoTitle")),l.push(e,"\n\n"),u=this.chatInner,p="prepend"}else h=this.chat.isAnyGroup&&(yield o(this.managers.appPeersManager.getPeer(this.peerId))).pFlags.creator?this.renderEmptyPlaceholder("group",r,e,l):"scheduled"===this.chat.type?this.renderEmptyPlaceholder("noScheduledMessages",r,e,l):n.Z.myId===this.peerId?this.renderEmptyPlaceholder("saved",r,e,l):this.peerId.isUser()&&!c&&(yield o(this.chat.canSend()))&&"chat"===this.chat.type?this.renderEmptyPlaceholder("greeting",r,e,l):this.renderEmptyPlaceholder("noMessages",r,e,l);h&&(yield h),l.length&&r.querySelector(".message, .service-msg").prepend(...l);const f=!!this.messagesQueueOnRenderAdditional,m=this.setPeerCached&&!f;if(m){const e=r.firstElementChild;e.classList.add("no-transition"),this.chat.setPeerPromise&&this.chat.setPeerPromise.catch(Ke.Z).finally((()=>{e.classList.remove("no-transition")}))}if(void 0!==t||m||(t=!0),f||t?(this.updatePlaceholderPosition=d,this.onAnimateLadder=()=>{if(this.onAnimateLadder=void 0,!this.messagesQueuePromise)return(0,V.AD)()}):this.chat.setPeerPromise?this.attachPlaceholderOnRender=()=>{this.attachPlaceholderOnRender=void 0,d()}:this.updatePlaceholderPosition=d,!f&&t){yield o((0,G.e9)());const t=(0,Ee.Z)(this.bubbles);(0,a.Z)(t,e.mid),this.animateAsLadder(e.mid,t,!1,0,0)}return r.middlewareHelper.onDestroy((()=>{this.emptyPlaceholderBubble===r&&(this.emptyPlaceholderBubble=void 0)})),this.emptyPlaceholderBubble=r,i}))))}))}makeViewButton(e){return(0,ve.Z)("btn-primary btn-primary-transparent bubble-view-button",e)}generateLocalMessageId(e=0){const t=("scheduled"===this.chat.type?-1:0)+e,i=-Math.abs(t);return{id:i,mid:-Math.abs((0,Oe.Z)(i))}}generateLocalFirstMessage(e,t,i=0){return _t(this,void 0,void 0,(function*(){const{id:s,mid:n}=this.generateLocalMessageId(i);let a={_:e?"messageService":"message",date:0,id:s,mid:n,peer_id:yield this.managers.appPeersManager.getOutputPeer(this.peerId),pFlags:{local:!0}};return e||(a.message=""),(0,ae.Z)(a),t&&t(a),a=(yield this.managers.appMessagesManager.saveMessages([a],{storage:new Map}))[0],a.mid=n,a}))}getViewportSlice(){return(0,Ie.Z)({overflowElement:this.scrollable.container,selector:".bubbles-date-group .bubble:not(.is-date)",extraSize:2*Math.max(700,de.Z.height)})}deleteViewportSlice(e,t){const{invisibleTop:i,invisibleBottom:s}=e,n=i.concat(s);if(!n.length)return;i.length&&(this.setLoaded("top",!1),this.getHistoryTopPromise=void 0),s.length&&(this.setLoaded("bottom",!1),this.getHistoryBottomPromise=void 0);const a=n.map((({element:e})=>+e.dataset.mid));let o;t||(o=this.createScrollSaver(!!i.length),o.save()),this.deleteMessagesByIds(a,!1,!0),o?o.restore():i.length&&(this.scrollable.lastScrollPosition=this.scrollable.scrollTop)}sliceViewport(e){if(L.IS_SAFARI||this.isHeavyAnimationInProgress&&!e)return;const t=this.getViewportSlice();this.deleteViewportSlice(t)}setLoaded(e,t,i=!0){return _t(this,void 0,void 0,(function*(){if(this.scrollable.loadedAll[e]!==t)return this.log.bindPrefix("setLoaded")("change",e,t),this.scrollable.loadedAll[e]=t,this.scrollable.onScroll(),i?!this.chat.isRestricted&&("bottom"===e&&this.chat.isBroadcast&&this.toggleSponsoredMessage(t),"top"===e&&t&&this.chat.isBot)?this.renderBotPlaceholder():this.checkIfEmptyPlaceholderNeeded():void 0}))}toggleSponsoredMessage(e){return _t(this,void 0,void 0,(function*(){const t=this.log.bindPrefix("sponsored");t("checking");const{mid:i}=this.generateLocalMessageId(1);if(e){const e=this.getMiddleware((()=>this.scrollable.loadedAll.bottom&&this.getSponsoredMessagePromise===i)),i=this.getSponsoredMessagePromise=this.managers.appChatsManager.getSponsoredMessage(this.peerId.toChatId()).then((i=>_t(this,void 0,void 0,(function*(){if(!e()||"messages.sponsoredMessagesEmpty"===i._)return;const s=i.messages[0];if(!s)return void t("no message");const n=this.generateLocalFirstMessage(!1,(e=>{e.message=s.message,e.from_id=s.from_id,e.entities=s.entities,e.pFlags.sponsored=!0,e.sponsoredMessage=s}),1);return Promise.all([n,this.getHistoryTopPromise,this.messagesQueuePromise]).then((([i])=>{if(e())return t("rendering",i),this.performHistoryResult({history:[i]},!1)}))})))).finally((()=>{this.getSponsoredMessagePromise===i&&(this.getSponsoredMessagePromise=void 0)}))}else t("clearing rendered",i),this.getSponsoredMessagePromise=void 0,this.deleteMessagesByIds([i])}))}renderBotPlaceholder(){return _t(this,void 0,void 0,(function*(){const e=this.log.bindPrefix("bot placeholder"),t=this.getMiddleware(),i=yield this.managers.acknowledged.appProfileManager.getProfile(this.peerId.toUserId());e("getting profile, cached:",i.cached);const s=i.result.then((s=>_t(this,void 0,void 0,(function*(){var n;if(!t())return;if(!(null===(n=s.bot_info)||void 0===n?void 0:n.description))return e.warn("no description"),this.checkIfEmptyPlaceholderNeeded();const a=yield this.generateLocalFirstMessage(!1,(e=>{const t=s.bot_info;e.message=t.description,t.description_document&&(e.media={_:"messageMediaDocument",document:t.description_document,pFlags:{}}),t.description_photo&&(e.media={_:"messageMediaPhoto",photo:t.description_photo,pFlags:{}})}));return t()?(e("rendering"),{renderPromise:this.processLocalMessageRender(a,!i.cached).then((()=>{e("done")}))}):void 0}))));if(i.cached)return s}))}checkIfEmptyPlaceholderNeeded(){return _t(this,void 0,void 0,(function*(){if(this.scrollable.loadedAll.top&&this.scrollable.loadedAll.bottom&&void 0===this.emptyPlaceholderBubble&&(this.chat.isRestricted||!(yield this.chat.getHistoryStorage()).count||Object.keys(this.bubbles).length&&!this.getRenderedLength()||"scheduled"===this.chat.type&&!Object.keys(this.bubbles).length)){this.log("inject empty peer placeholder");const e=yield this.generateLocalFirstMessage(!0);return{renderPromise:this.processLocalMessageRender(e)}}}))}getHistory1(e,t,i,s,n){const a=this.getMiddleware(n?void 0:()=>(t?this.getHistoryTopPromise:this.getHistoryBottomPromise)===r),o=this.getHistory(e,t,i,s,n,a),r=o.then((e=>e&&(e.waitPromise||e.promise)));return t?this.getHistoryTopPromise=r:this.getHistoryBottomPromise=r,r.then((()=>{a()&&(t?this.getHistoryTopPromise=void 0:this.getHistoryBottomPromise=void 0,n||"chat"===this.chat.type&&setTimeout((()=>{t?this.loadMoreHistory(!0,!0):this.loadMoreHistory(!1,!0)}),0))})),o}getHistory(e=0,t=!1,i=!1,s=0,n=!1,a){return _t(this,void 0,void 0,(function*(){const o=this.peerId,r=this.chat.isBroadcast,d=Math.min(30,de.Z.height/40|0);let l=r?20:Object.keys(this.bubbles).length>0?Math.max(35,d):d;if(void 0!==Bt){if(!Bt)return{cached:!1,promise:Promise.resolve(),waitPromise:Promise.resolve()};Object.keys(this.bubbles).length>0&&--Bt}let c,h=0;if(i&&(h=l,t||(l=0)),s&&!i)if("pinned"===this.chat.type)c=[s];else{const t=(yield this.chat.getHistoryStorage()).history.slice;if(t.length=0;--e){const t=yield this.chat.getMessage(c[e]);if(!(null==t?void 0:t.grouped_id))break;c.splice(e,1)}e=c[c.length-1]||e}}let u,p=yield this.requestHistory(e,l,h);this.log("i vin brehnya",p,e,l,h);const f=(null==c?void 0:c.length)&&!p.cached,m=this.isFirstLoad&&h&&!p.cached||f;f&&(u=p.result,p={cached:!0,result:Promise.resolve({history:c})}),this.isFirstLoad=!1;const g=e=>_t(this,void 0,void 0,(function*(){var t;if(null===(t=e.isEnd)||void 0===t?void 0:t.top){if("discussion"===this.chat.type){const t=yield this.managers.appMessagesManager.getThreadServiceMessageId(this.peerId,this.chat.threadId);t&&e.history.push(t);const i=yield this.chat.getMidsByMid(this.chat.threadId);e.history.push(...i.reverse())}yield this.managers.appProfileManager.getProfileByPeerId(o)}})),v=e=>(0,G.e9)().then((()=>g(e))).then((()=>(!f&&s&&e.history.unshift(s),this.performHistoryResult(e,t)))),b=e=>{const t=Promise.resolve(e).then((e=>{if(a&&!a())throw Ut;if(!n)return v(e);this.scrollable.onScroll()}),(e=>{throw this.log.error("getHistory error:",e),e}));return t};let y,w;if(p.cached){if(n)return this.scrollable.onScroll(),null;w=!0,y=v(yield p.result)}else w=!1,y=b(p.result);const S=f?b(u):y;if(m&>.Z.isAvailable("animations")){let i=f?2:1;this.messagesQueueOnRenderAdditional=()=>{this.log("messagesQueueOnRenderAdditional"),--i||(this.messagesQueueOnRenderAdditional=void 0,this.animateAsLadder(s,c,f,h,e).then((()=>{setTimeout((()=>{this.loadMoreHistory(t,!0)}),0)})))}}else this.messagesQueueOnRenderAdditional=void 0;return n?null:{cached:w,promise:y,waitPromise:S}}))}setUnreadDelimiter(){return _t(this,void 0,void 0,(function*(){if("chat"!==this.chat.type&&"discussion"!==this.chat.type)return;if(this.attachedUnreadBubble)return;const e=yield this.chat.getHistoryMaxId();let t=yield this.managers.appMessagesManager.getReadMaxIdIfUnread(this.peerId,this.chat.threadId);if(t&&(t=Object.keys(this.bubbles).filter((e=>!this.bubbles[e].classList.contains("is-out"))).map((e=>+e)).sort(((e,t)=>e-t)).find((e=>e>t)),t&&this.bubbles[t])){const i=this.bubbles[t];this.firstUnreadBubble&&this.firstUnreadBubble!==i&&(this.firstUnreadBubble.classList.remove("is-first-unread"),this.firstUnreadBubble=null),t!==e&&i.classList.add("is-first-unread"),this.firstUnreadBubble=i,this.attachedUnreadBubble=!0}}))}deleteEmptyDateGroups(){const e=this.stickyIntersector?Ot:1;let t=!1;for(const i in this.dateMessages){const s=this.dateMessages[i];s.container.childElementCount===e&&(s.container.remove(),this.stickyIntersector&&this.stickyIntersector.unobserve(s.container,s.div),delete this.dateMessages[i],t=!0)}t&&(Object.keys(this.dateMessages).length||this.container.classList.remove("has-groups"),this.checkIfEmptyPlaceholderNeeded(),this.setStickyDateManually())}}function Vt(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttributeNS(null,"viewBox","0 0 11 20"),e.setAttributeNS(null,"width","11"),e.setAttributeNS(null,"height","20"),e.classList.add("bubble-tail");const t=document.createElementNS("http://www.w3.org/2000/svg","use");return t.setAttributeNS(null,"href","#message-tail-filled"),e.append(t),e}},4499:(e,t,i)=>{"use strict";i.d(t,{Z:()=>we});var s=i(5432),n=i(3003),a=i(5128),o=i(4524),r=i(684),d=i(2166),l=i(1962),c=i(2796),h=i(2325),u=i(8497),p=i(3910),f=i(2738),m=i(1452),g=i(2648),v=i(6787),b=i(4494),y=i(8127),w=i(503),S=i(5772);class C extends y.Z{constructor(e,t,i,s){super("popup-report-messages-confirm",{noTitle:!0,descriptionLangKey:"ReportInfo",buttons:[{langKey:"ReportChat",callback:()=>{a.isValid()&&(s&&s(),this.managers.appMessagesManager.reportMessages(e,t,i,a.value).then((e=>{e&&(0,c.bC)({langPackKey:"ReportSentInfo"})})))}}],body:!0});const n=document.createElement("div");(0,S.Z)({div:n,emoji:C.STICKER_EMOJI,width:100,height:100}).then((({render:e})=>e)).finally((()=>{this.show()})),this.header.replaceWith(n);const a=new w.ZP({label:"ReportHint",maxLength:512,placeholder:"ReportChatDescription"});a.input.addEventListener("input",(()=>{this.buttons[0].element.toggleAttribute("disabled",!a.isValid())})),this.body.append(a.container)}}C.STICKER_EMOJI="👮‍♀️";class L extends y.Z{constructor(e,t,i){super("popup-report-messages",{titleLangKey:"ChatTitle.ReportMessages",buttons:[],body:!0}),t=t.slice();const s=[["ReportChatSpam","inputReportReasonSpam"],["ReportChatViolence","inputReportReasonViolence"],["ReportChatChild","inputReportReasonChildAbuse"],["ReportChatPornography","inputReportReasonPornography"],["ReportChatOther","inputReportReasonOther"],["ReportChatPersonalDetails","inputReportReasonPersonalDetails"],["ReportChatIllegalDrugs","inputReportReasonIllegalDrugs"]];s.forEach((e=>{const t=(0,b.Z)("btn-primary btn-transparent",{text:e[0]});this.body.append(t)}));const n=(0,v.Z)(C.STICKER_EMOJI);(0,f.fc)(this.body,(a=>{const o=(0,u.Z)(a.target,"btn-primary"),r=s[(0,g.Z)(o)][1];n.then((()=>{this.hide(),new C(e,t,r,i)}))}),{listenerSetter:this.listenerSetter}),this.buttonsEl.style.marginTop=".5rem",this.show()}}var E=i(8938);class I extends y.Z{constructor(){super("popup-sponsored",{titleLangKey:"Chat.Message.Sponsored.What",descriptionLangKey:"Chat.Message.Ad.Text",descriptionLangArgs:[(0,h.ag)("Chat.Message.Sponsored.Link")],buttons:[{langKey:"OK",isCancel:!0},{langKey:"Chat.Message.Ad.ReadMore",callback:()=>{window.open(h.ZP.format("Chat.Message.Sponsored.Link",!0))},isCancel:!0}],scrollable:!0}),this.scrollable.append(this.description),this.show()}}var M=i(3699),Z=i(3624),P=i(8842),T=i(2149),k=i(4762),x=i(1168),A=i(8947),_=i(6008),F=i(8805),D=i(8936),R=i(5005),B=i(5565),N=i(3541),O=i(2482),U=i(3061),H=i(9405),z=i(9083),j=i(5029),G=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class V extends x.Z{constructor(e){super("popup-reacted-list",{closable:!0,overlayClosable:!0,body:!0}),this.message=e,this.init()}init(){return G(this,void 0,void 0,(function*(){const e=this.middlewareHelper.get(),t=yield this.managers.appMessagesManager.getGroupsFirstMessage(this.message);if(!e())return;const i=yield this.managers.appMessagesManager.canViewMessageReadParticipants(t);if(!e())return;const s=new A.Z,n=Object.assign(Object.assign({},t),{mid:0,id:0,reactions:Object.assign(Object.assign({_:"messageReactions",results:[]},t.reactions),{pFlags:{},recent_reactions:[]})});n.reactions.results=n.reactions.results.map((e=>Object.assign(Object.assign({},e),{chosen_order:void 0,pFlags:{}}))),s.init(n,"block",this.middlewareHelper.get()),s.render(),s.classList.add("no-stripe"),s.classList.remove("has-no-reactions"),s.append(this.btnClose),this.header.append(s);const a=document.createElement("div");a.classList.add("tabs-container"),a.dataset.animation="tabs";const o=new Map;let r=!1;if(n.reactions.results.length){const e=this.createFakeReaction("reactions",n.reactions.results.reduce(((e,t)=>e+t.count),0));s.prepend(e),n.reactions.results.unshift(e.reactionCount),r=!0}let d=!1;if(i)try{const i=yield this.managers.appMessagesManager.getMessageReadParticipants(t.peerId,t.mid);if(!e())return;if(!i.length)throw"";const a=this.createFakeReaction("checks",i.length);s.prepend(a),n.reactions.results.unshift(a.reactionCount),d=!0}catch(e){}n.reactions.results.forEach((i=>{const s=new F.ZP(void 0);s.container.classList.add("tabs-tab");const n=new j.Z({noShadow:!0,noDelimiter:!0}),r=R.default.createChatList({dialogSize:72});R.default.setListClickListener(r,(()=>{this.hide()}),void 0,!1,!0),n.content.append(r),s.container.append(n.container);const d="checks"!==i.reaction,l="checks"===i.reaction;["checks","reactions"].includes(i.reaction)&&(i.reaction=void 0);const c=(0,H.C)(24,24);let h;const u=new D.Z({scrollable:s,getPromise:()=>G(this,void 0,void 0,(function*(){const s=yield this.managers.appMessagesManager.getMessageReactionsListAndReadParticipants(t,void 0,i.reaction,h,d,l);return h=s.nextOffset,yield Promise.all(s.combined.map((({peerId:t,reaction:i})=>G(this,void 0,void 0,(function*(){const{dom:s}=R.default.addDialogNew({peerId:t,autonomous:!0,container:r,avatarSize:"abitbigger",rippleEnabled:!1,meAsSaved:!1});if(i){const t=document.createElement("div");if(t.classList.add("reacted-list-reaction-icon"),"reactionEmoji"===i._){const s=yield this.managers.appReactionsManager.getReactionCached(i.emoticon);(0,N.ZP)({doc:s.static_icon,div:t,width:24,height:24,middleware:e})}else"reactionCustomEmoji"===i._&&t.append((0,z.Z)({docIds:[i.document_id],customEmojiSize:c,middleware:e}));s.listEl.append(t)}(0,B.Z)(s.lastMessageSpan,(0,U.Z)(yield this.managers.appUsersManager.getUser(t.toUserId())))}))))),!h}))});o.set(s.container,u),a.append(s.container)})),this.body.append(a);const l=(0,_.X)(s,a,((e,t)=>{if(e===s.childElementCount-1)return!1;const i=s.children[e],n=l.prevId();-1!==n&&s.children[n].setIsChosen(!1),i.setIsChosen(!0),o.get(t).load()}),void 0,void 0,void 0,this.listenerSetter);l(0,!1),this.show()}))}createFakeReaction(e,t){const i=new O.ZP;i.init("block",this.middlewareHelper.get()),i.reactionCount={_:"reactionCount",count:t,reaction:e},i.setCanRenderAvatars(!1),i.renderCounter();const s=document.createElement("div");return s.classList.add("reaction-counter","reaction-sticker-icon","tgico-"+e),i.prepend(s),i}}var K=i(6654),W=i(8204),$=i(5994),q=i(319),Y=i(3035),Q=i(1447),X=i(3512),J=i(5814);const ee="btn-menu-reactions",te=ee+"-reaction",ie=!k.IS_SAFARI;class se{constructor(e,t,i){this.managers=e,this.type=t,this.onScroll=()=>{this.reactionsMap.forEach(((e,t)=>{this.onScrollProcessItem(t,e)}))},this.onMouseMove=e=>{var t;const i=(0,u.Z)(e.target,te);if(!i)return;const s=this.reactionsMap.get(i);if(!s)return;if(!(null===(t=s.appear)||void 0===t?void 0:t.paused))return;const n=s.select;n&&n.paused&&(n.autoplay=!0,n.restart())};const n=this.widthContainer=document.createElement("div");n.classList.add(ee+"-container"),n.classList.add(ee+"-container-"+t);const a=this.container=document.createElement("div");a.classList.add(ee);const o=this.scrollable="vertical"===t?new F.ZP(void 0):new F.v7(void 0);a.append(o.container),o.onAdditionalScroll=this.onScroll,o.setListeners(),o.container.classList.add("no-scrollbar"),this.reactionsMap=new Map,this.animationGroup=`CHAT-MENU-REACTIONS-${Date.now()}`,J.Z.setOverrideIdleGroup(this.animationGroup,!0),s.Z||a.addEventListener("mousemove",this.onMouseMove),(0,f.fc)(a,(e=>{const t=(0,u.Z)(e.target,te);if(!t)return;const i=this.reactionsMap.get(t);i&&this.managers.appReactionsManager.sendReaction(this.message,i.reaction)})),n.append(a),this.middleware=null!=i?i:(0,Z.k)()}init(e){this.message=e;const t=this.middleware.get(),i=this.managers.appReactionsManager.getAvailableReactionsByMessage(e);(0,K.Z)(i,(e=>{if(!t()||!e.length)return;e.forEach((e=>{e.pFlags.premium&&!X.Z.premium||this.renderReaction(e)}));const s=()=>{this.container.classList.add("is-visible")};i instanceof Promise?(0,Y.T2)(s):s()}))}cleanup(){this.middleware.clean(),this.scrollable.removeListeners(),this.reactionsMap.clear(),J.Z.setOverrideIdleGroup(this.animationGroup,!1),J.Z.checkAnimations(!0,this.animationGroup,!0)}canUseAnimations(){return $.Z.isAvailable("animations")&&$.Z.isAvailable("stickers_chat")&&!k.IS_MOBILE}renderReaction(e){const t=document.createElement("div");t.classList.add(te);const i=document.createElement("div");i.classList.add(te+"-scale");const n=document.createElement("div");let a;n.classList.add(te+"-appear"),this.canUseAnimations()&&(a=document.createElement("div"),a.classList.add(te+"-select","hide"));const o={selectWrapper:a,appearWrapper:n,reaction:{_:"reactionEmoji",emoticon:e.reaction}};this.reactionsMap.set(t,o);const r=this.middleware.get(),d=26*(s.Z?1:1.25),l={width:d,height:d,skipRatio:1,needFadeIn:!1,withThumb:!1,group:this.animationGroup,middleware:r};if(this.canUseAnimations()){let t=!0;(0,N.ZP)(Object.assign({doc:e.appear_animation,div:n,play:!0,liteModeKey:!1},l)).then((({render:e})=>e)).then((e=>{(0,E.Z)(e),o.appear=e,e.addEventListener("enterFrame",(s=>{e.maxFrame===s&&i.then((e=>{(0,E.Z)(e),n.classList.add("hide"),a.classList.remove("hide"),t&&(o.select=e,t=!1)}),q.Z)}))}),q.Z);const i=(0,N.ZP)(Object.assign({doc:e.select_animation,div:a,liteModeKey:!1},l)).then((({render:e})=>e)).then((e=>((0,E.Z)(e),Q.Z.waitForFirstFrame(e)))).catch(q.Z)}else delete l.needFadeIn,delete l.withThumb,(0,N.ZP)(Object.assign({doc:e.static_icon,div:n,liteModeKey:!1},l));i.append(n),a&&i.append(a),t.append(i),this.scrollable.append(t)}onScrollProcessItem(e,t){const i=e.firstElementChild,s=(0,W.Z)(e,this.scrollable.container);let n;if(s)if(s.overflow.left||s.overflow.right){const e=Math.abs(s.rect.left-s.rect.right);n="scale("+Math.min(Math.pow(e,2)/Math.pow(34,2),1)+")"}else n="";else{if(!t.appearWrapper.classList.contains("hide")||!t.appear)return;t.select&&t.select.stop(),t.appear.stop(),t.appear.autoplay=!0,t.appearWrapper.classList.remove("hide"),t.selectWrapper.classList.add("hide"),n=""}ie&&(i.style.transform=n)}}var ne=i(2946),ae=i(2790),oe=i(1483),re=i(3416),de=i(6976),le=i(2353),ce=i(2312),he=i(1507),ue=i(6690),pe=i(8115),fe=i(3725),me=i(9298),ge=i(7530),ve=i(3709),be=i(2381),ye=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class we{constructor(e,t){this.chat=e,this.managers=t,this.onContextMenu=e=>{let t,i;try{i=(0,u.Z)(e.target,"bubble-content-wrapper"),t=i?i.parentElement:(0,u.Z)(e.target,"bubble")}catch(e){}if(!t||t.classList.contains("bubble-first"))return;let s=this.element;if((e instanceof MouseEvent||e.hasOwnProperty("preventDefault"))&&e.preventDefault(),s&&s.classList.contains("active"))return!1;(e instanceof MouseEvent||e.hasOwnProperty("cancelBubble"))&&(e.cancelBubble=!0);let n=+t.dataset.mid;n&&(()=>{ye(this,void 0,void 0,(function*(){const a=this.isSponsored=n<0;this.isSelectable=this.chat.selection.canSelectBubble(t),this.peerId=this.chat.peerId,this.target=e.target,this.isTextSelected=!(0,m.Z)(),this.isAnchorTarget="A"===this.target.tagName&&("_blank"===this.target.target||this.target.classList.contains("anchor-url")),this.isUsernameTarget="A"===this.target.tagName&&this.target.classList.contains("mention");const o=yield this.chat.getMidsByMid(n);if(this.chat.selection.isSelecting&&!i){if(a)return;if(o.length>1){const e=this.chat.selection.isMidSelected(this.peerId,n)?n:o.find((e=>this.chat.selection.isMidSelected(this.peerId,e)));e&&(n=e)}}this.isOverBubble=!!i;const r=(0,u.Z)(this.target,"grouped-item");this.isTargetAGroupedItem=!!r,this.mid=r?+r.dataset.mid:n,this.isSelected=this.chat.selection.isMidSelected(this.peerId,this.mid),this.message=t.message||(yield this.chat.getMessage(this.mid)),this.albumMessages=this.message.grouped_id?yield this.managers.appMessagesManager.getMessagesByAlbum(this.message.grouped_id):void 0,this.noForwards=!a&&!(yield this.managers.appMessagesManager.canForward(this.message)),this.viewerPeerId=void 0,this.canOpenReactedList=void 0,this.linkToMessage=yield this.getUrlToMessage(),this.selectedMessagesText=yield this.getSelectedMessagesText(),this.selectedMessages=this.chat.selection.isSelecting?yield this.chat.selection.getSelectedMessages():void 0;const d=yield this.init();if(!d)return;s=d.element;const{cleanup:l,destroy:c,menuPadding:h,reactionsMenu:p,reactionsMenuPosition:f}=d;let g=!1;if(p){const e="is-visible";if(g=p.container.classList.contains(e),g&&p.container.classList.remove(e),"horizontal"===f){const e=s.offsetWidth,t=(e-8)/34%1,i=.65;if(t{p&&p.container.classList.remove("is-visible"),this.mid=0,this.peerId=void 0,this.target=null,this.viewerPeerId=void 0,this.canOpenReactedList=void 0,l(),setTimeout((()=>{c()}),300)})),g&&p.container.classList.add("is-visible")}))})()},this.onSendScheduledClick=()=>ye(this,void 0,void 0,(function*(){this.chat.selection.isSelecting?(0,f.tH)(this.chat.selection.selectionSendNowBtn):new l.Z(this.peerId,yield this.chat.getMidsByMid(this.mid))})),this.onReplyClick=()=>{this.chat.input.initMessageReply(this.mid)},this.onFaveStickerClick=e=>{const t=this.message.media.document.id;this.managers.appStickersManager.faveSticker(t,e)},this.onEditClick=()=>{const e=this.getMessageWithText();this.chat.input.initMessageEditing(this.isTargetAGroupedItem?this.mid:e.mid)},this.onCopyClick=()=>ye(this,void 0,void 0,(function*(){(0,m.Z)()?(0,d.T)(this.selectedMessagesText):document.execCommand("copy")})),this.onCopyAnchorLinkClick=()=>{(0,d.T)(this.target.href)},this.onCopyLinkClick=()=>{const{url:e,isPrivate:t}=this.linkToMessage,i=t?"LinkCopiedPrivateInfo":"LinkCopied";(0,c.Am)(h.ZP.format(i,!0)),(0,d.T)(e)},this.onPinClick=()=>{new r.Z(this.peerId,this.mid)},this.onUnpinClick=()=>{new r.Z(this.peerId,this.mid,!0)},this.onRetractVote=()=>{this.managers.appPollsManager.sendVote(this.message,[])},this.onStopPoll=()=>{this.managers.appPollsManager.stopPoll(this.message)},this.onForwardClick=()=>ye(this,void 0,void 0,(function*(){if(this.chat.selection.isSelecting)(0,f.tH)(this.chat.selection.selectionForwardBtn);else{const e=this.peerId,t=this.isTargetAGroupedItem?[this.mid]:yield this.chat.getMidsByMid(this.mid);o.Z.create({[e]:t})}})),this.onSelectClick=()=>{this.chat.selection.toggleByElement((0,u.Z)(this.target,"grouped-item")||(0,u.Z)(this.target,"bubble"))},this.onClearSelectionClick=()=>{this.chat.selection.cancelSelection()},this.onDeleteClick=()=>ye(this,void 0,void 0,(function*(){this.chat.selection.isSelecting?(0,f.tH)(this.chat.selection.selectionDeleteBtn):new a.Z(this.peerId,this.isTargetAGroupedItem?[this.mid]:yield this.chat.getMidsByMid(this.mid),this.chat.type)})),this.listenerSetter=new M.Z,this.attachListenerSetter=new M.Z,this.middleware=(0,Z.k)()}attachTo(e){this.attachListenerSetter.removeAll(),s.Z?(0,f.fc)(e,(e=>{this.chat.selection.isSelecting||(this.chat.log("touchend",e),!e.target.closest([".name",".peer-title",".reply",".document","audio-element","avatar-element","a",".bubble-beside-button","replies-element","[data-saved-from]:not(.bubble)","poll-element",".attachment",".reply-markup-button"].join(", "))&&((0,p.Z)(e),this.onContextMenu(e)))}),{listenerSetter:this.attachListenerSetter}):(0,de.E)({element:e,callback:this.onContextMenu,listenerSetter:this.attachListenerSetter})}cleanup(){this.listenerSetter.removeAll(),this.reactionsMenu&&this.reactionsMenu.cleanup(),this.middleware.clean()}destroy(){this.cleanup(),this.attachListenerSetter.removeAll()}filterButtons(e){return ye(this,void 0,void 0,(function*(){return this.isSponsored?e.filter((e=>e.isSponsored)):(0,le.Z)(e,(e=>ye(this,void 0,void 0,(function*(){let t;return this.chat.selection.isSelecting&&!e.withSelection?t=!1:(this.isOverBubble||s.Z,t=yield e.verify()),!!t}))))}))}setButtons(){const e=e=>ye(this,void 0,void 0,(function*(){var t;const i=null===(t=this.message.media)||void 0===t?void 0:t.document;if(!(null==i?void 0:i.sticker))return!1;const s=yield this.managers.acknowledged.appStickersManager.getFavedStickersStickers();if(!s.cached)return!1;const n=(yield s.result).some((e=>e.id===i.id));return e?!n:n}));this.buttons=[{icon:"send2",text:"MessageScheduleSend",onClick:this.onSendScheduledClick,verify:()=>"scheduled"===this.chat.type&&!this.message.pFlags.is_outgoing},{icon:"send2",text:"Message.Context.Selection.SendNow",onClick:this.onSendScheduledClick,verify:()=>"scheduled"===this.chat.type&&this.isSelected&&!this.chat.selection.selectionSendNowBtn.hasAttribute("disabled"),notDirect:()=>!0,withSelection:!0},{icon:"schedule",text:"MessageScheduleEditTime",onClick:()=>{this.chat.input.scheduleSending((()=>{(0,E.Z)(this.message),this.managers.appMessagesManager.editMessage(this.message,this.message.message,{scheduleDate:this.chat.input.scheduleDate,entities:this.message.entities}),this.chat.input.onMessageSent(!1,!1)}),new Date(1e3*this.message.date))},verify:()=>"scheduled"===this.chat.type},{icon:"reply",text:"Reply",onClick:this.onReplyClick,verify:()=>ye(this,void 0,void 0,(function*(){return(yield this.chat.canSend())&&!this.message.pFlags.is_outgoing&&!!this.chat.input.messageInput&&"scheduled"!==this.chat.type}))},{icon:"favourites",text:"AddToFavorites",onClick:this.onFaveStickerClick.bind(this,!1),verify:()=>e(!0)},{icon:"favourites",text:"DeleteFromFavorites",onClick:this.onFaveStickerClick.bind(this,!0),verify:()=>e(!1)},{icon:"edit",text:"Edit",onClick:this.onEditClick,verify:()=>ye(this,void 0,void 0,(function*(){return(yield this.managers.appMessagesManager.canEditMessage(this.message,"text"))&&!!this.chat.input.messageInput}))},{icon:"copy",text:"Copy",onClick:this.onCopyClick,verify:()=>!(this.noForwards||!this.message.message||this.isTextSelected||this.isAnchorTarget&&this.message.message===this.target.innerText)},{icon:"copy",text:"Chat.CopySelectedText",onClick:this.onCopyClick,verify:()=>!this.noForwards&&!!this.message.message&&this.isTextSelected},{icon:"copy",text:"Message.Context.Selection.Copy",onClick:this.onCopyClick,verify:()=>ye(this,void 0,void 0,(function*(){if(!this.isSelected||this.noForwards)return!1;for(const[e,t]of this.chat.selection.selectedMids){const i=`${e}_${"scheduled"===this.chat.type?"scheduled":"history"}`;for(const e of t)if((yield this.managers.appMessagesManager.getMessageFromStorage(i,e)).message)return!0}return!1})),notDirect:()=>!0,withSelection:!0},{icon:"copy",text:"CopyLink",onClick:this.onCopyAnchorLinkClick,verify:()=>this.isAnchorTarget,withSelection:!0},{icon:"copy",text:"Text.Context.Copy.Username",onClick:()=>{(0,d.T)(this.target.innerHTML)},verify:()=>this.isUsernameTarget,withSelection:!0},{icon:"copy",text:"Text.Context.Copy.Hashtag",onClick:()=>{(0,d.T)(this.target.innerHTML)},verify:()=>this.target.classList.contains("anchor-hashtag"),withSelection:!0},{icon:"link",text:"MessageContext.CopyMessageLink1",onClick:this.onCopyLinkClick,verify:()=>ye(this,void 0,void 0,(function*(){return(yield this.managers.appPeersManager.isChannel(this.peerId))&&!this.message.pFlags.is_outgoing}))},{icon:"pin",text:"Message.Context.Pin",onClick:this.onPinClick,verify:()=>ye(this,void 0,void 0,(function*(){return!this.message.pFlags.is_outgoing&&"messageService"!==this.message._&&!this.message.pFlags.pinned&&(yield this.managers.appPeersManager.canPinMessage(this.peerId))&&"scheduled"!==this.chat.type}))},{icon:"unpin",text:"Message.Context.Unpin",onClick:this.onUnpinClick,verify:()=>ye(this,void 0,void 0,(function*(){return this.message.pFlags.pinned&&(yield this.managers.appPeersManager.canPinMessage(this.peerId))}))},{icon:"download",text:"MediaViewer.Context.Download",onClick:()=>we.onDownloadClick(this.message,this.noForwards),verify:()=>we.canDownload(this.message,this.target,this.noForwards)},{icon:"checkretract",text:"Chat.Poll.Unvote",onClick:this.onRetractVote,verify:()=>{var e;const t=null===(e=this.message.media)||void 0===e?void 0:e.poll;return t&&t.chosenIndexes.length&&!t.pFlags.closed&&!t.pFlags.quiz}},{icon:"stop",text:"Chat.Poll.Stop",onClick:this.onStopPoll,verify:()=>ye(this,void 0,void 0,(function*(){var e;const t=null===(e=this.message.media)||void 0===e?void 0:e.poll;return(yield this.managers.appMessagesManager.canEditMessage(this.message,"poll"))&&t&&!t.pFlags.closed&&!this.message.pFlags.is_outgoing}))},{icon:"forward",text:"Forward",onClick:this.onForwardClick,verify:()=>!(this.noForwards||"scheduled"===this.chat.type||this.message.pFlags.is_outgoing&&this.message.fromId!==he.yF||"messageService"===this.message._)},{icon:"forward",text:"Message.Context.Selection.Forward",onClick:this.onForwardClick,verify:()=>this.chat.selection.selectionForwardBtn&&this.isSelected&&!this.chat.selection.selectionForwardBtn.hasAttribute("disabled"),notDirect:()=>!0,withSelection:!0},{icon:"download",text:"Message.Context.Selection.Download",onClick:()=>we.onDownloadClick(this.selectedMessages,this.noForwards),verify:()=>this.selectedMessages&&we.canDownload(this.selectedMessages,void 0,this.noForwards),withSelection:!0},{icon:"flag",text:"ReportChat",onClick:()=>{new L(this.peerId,[this.mid])},verify:()=>ye(this,void 0,void 0,(function*(){return!this.message.pFlags.out&&"message"===this.message._&&!this.message.pFlags.is_outgoing&&(yield this.managers.appPeersManager.isChannel(this.peerId))})),notDirect:()=>!0,withSelection:!0},{icon:"select",text:"Message.Context.Select",onClick:this.onSelectClick,verify:()=>!this.message.action&&!this.isSelected&&this.isSelectable,notDirect:()=>!0,withSelection:!0},{icon:"select",text:"Message.Context.Selection.Clear",onClick:this.onClearSelectionClick,verify:()=>this.isSelected,notDirect:()=>!0,withSelection:!0},{onClick:()=>{if(this.viewerPeerId)this.chat.appImManager.setInnerPeer({peerId:this.viewerPeerId});else{if(!this.canOpenReactedList)return!1;new V(this.message)}},verify:()=>ye(this,void 0,void 0,(function*(){var e,t;return!this.peerId.isUser()&&(!!(null===(t=null===(e=this.message.reactions)||void 0===e?void 0:e.recent_reactions)||void 0===t?void 0:t.length)||(yield this.managers.appMessagesManager.canViewMessageReadParticipants(this.message)))})),notDirect:()=>!0,localName:"views"},{icon:"delete danger",text:"Delete",onClick:this.onDeleteClick,verify:()=>ye(this,void 0,void 0,(function*(){return this.managers.appMessagesManager.canDeleteMessage(this.message)}))},{icon:"delete danger",text:"Message.Context.Selection.Delete",onClick:this.onDeleteClick,verify:()=>this.isSelected&&!this.chat.selection.selectionDeleteBtn.hasAttribute("disabled"),notDirect:()=>!0,withSelection:!0},{icon:"info",text:"Chat.Message.Sponsored.What",onClick:()=>{new I},verify:()=>!1,isSponsored:!0},{text:"Loading",onClick:()=>{this.emojiInputsPromise.then((e=>{new me.Z(e,!0).show()}))},verify:()=>!!this.getUniqueCustomEmojisFromMessage().length,notDirect:()=>!0,localName:"emojis"}]}static canDownload(e,t,i){var n,a;if(Array.isArray(e))return e.some((e=>we.canDownload(e,t,i)));if(!(0,ve.Z)(e)||i)return!1;let o=!1;if(null===(n=e.media)||void 0===n?void 0:n.photo)o=!0;else{if(!(null===(a=e.media)||void 0===a?void 0:a.document))return!1;o=!0}let r=!t||!!s.Z;return o&&t&&(r||(r=!!((0,u.Z)(t,"document")||(0,u.Z)(t,"audio")||(0,u.Z)(t,"media-sticker-wrapper")||(0,u.Z)(t,"media-photo")||(0,u.Z)(t,"media-video")))),o&&r}getMessageWithText(){return this.albumMessages&&(0,be.Z)(this.albumMessages)||this.message}getUniqueCustomEmojisFromMessage(){const e=[],t=this.getMessageWithText(),i=t.entities;if(i){const t=i.filter((e=>"messageEntityCustomEmoji"===e._));e.push(...t.map((e=>e.document_id)))}const s=t.reactions;if(s){const t=s.results.filter((e=>"reactionCustomEmoji"===e.reaction._));e.push(...t.map((e=>e.reaction.document_id)))}return(0,ue.Z)(e)}init(){return ye(this,void 0,void 0,(function*(){this.cleanup(),this.setButtons();const e=yield this.filterButtons(this.buttons);if(!e.length)return;const t=this.element=yield(0,n.Z)({buttons:e,listenerSetter:this.listenerSetter});t.id="bubble-contextmenu",t.classList.add("contextmenu");const i=e.find((e=>"views"===e.localName));if(i){const e=this.message.reactions,t=null==e?void 0:e.recent_reactions,s=!!(null==t?void 0:t.length),n=(yield this.managers.appMessagesManager.canViewMessageReadParticipants(this.message))?(yield this.managers.appPeersManager.getPeer(this.peerId)).participants_count:void 0,a=e?e.results.reduce(((e,t)=>e+t.count),0):void 0;i.element.classList.add("tgico-"+(s?"reactions":"checks"));const o=new h.ZP.IntlElement({key:s?void 0===n?"Chat.Context.ReactedFast":"Chat.Context.Reacted":"NobodyViewed",args:s?void 0===n?[a]:[n,n]:void 0,element:i.textElement});let r;r=s?void 0===n?(0,h.ag)("Chat.Context.ReactedFast",[a]):(0,h.ag)(t.length===n?"Chat.Context.ReactedFast":"Chat.Context.Reacted",[t.length,n]):(0,h.ag)("Loading"),r.classList.add("btn-menu-item-text-fake"),i.element.append(r);const d=22,l=3,c=1.125;o.element.style.visibility="hidden",o.element.style.paddingRight=s?c*Math.min(l,t.length)+"rem":"1rem";const u=this.middleware.get();this.managers.appMessagesManager.getMessageReactionsListAndReadParticipants(this.message).then((e=>{if(!u())return;r&&r.remove();const a=e.combined,p=void 0===n?e.reactionsCount:s?a.filter((e=>e.reaction)).length:a.length;let f;if(1===a.length)f=new P.Z({peerId:a[0].peerId,onlyFirstName:!0,dialog:!1}).element,(!s||e.readParticipants.length<=1)&&(this.viewerPeerId=a[0].peerId);else if(s){const e=p===a.length||void 0===n;f=(0,h.ag)(e?"Chat.Context.ReactedFast":"Chat.Context.Reacted",e?[p]:[p,a.length])}else a.length?f=(0,h.ag)("MessageSeen",[a.length]):o.element.style.visibility="";if(f&&(f.style.paddingRight=c*Math.min(l,p)+"rem",f.classList.add("btn-menu-item-text-fake"),i.element.append(f)),a.length){const e=new T.Z({avatarSize:d});e.render(t?t.map((e=>(0,ne.Z)(e.peer_id))):a.map((e=>e.peerId))),i.element.append(e.container),this.canOpenReactedList=!0}}))}let a,o,r;if(!("message"!==this.message._||this.chat.selection.isSelecting||this.message.pFlags.is_outgoing||this.message.pFlags.is_scheduled||this.message.pFlags.local)){r=k.IS_APPLE||s.Z?"horizontal":"vertical",o=this.reactionsMenu=new se(this.managers,r,this.middleware),o.init(yield this.managers.appMessagesManager.getGroupsFirstMessage(this.message));const e=44,t=0;a="vertical"===r?{top:t,left:e}:{top:e,right:0,left:t}}const d=e.find((e=>"emojis"===e.localName));if(d){d.element.classList.add("is-multiline"),d.element.parentElement.insertBefore(document.createElement("hr"),d.element);const e=()=>{null!=a||(a={}),a.bottom=24},t=this.getUniqueCustomEmojisFromMessage(),i=this.emojiInputsPromise=(0,fe.Z)();yield this.managers.appEmojiManager.getCachedCustomEmojiDocuments(t).then((s=>ye(this,void 0,void 0,(function*(){const n=t=>ye(this,void 0,void 0,(function*(){const s=new Map;t.forEach((e=>{e&&!s.has(e.stickerSetInput.id)&&s.set(e.stickerSetInput.id,e.stickerSetInput)}));const n=[...s.values()];if(i.resolve(n),1===s.size){const t=yield this.managers.acknowledged.appStickersManager.getStickerSet(n[0]),i=t.result.then((e=>{const t=(0,h.ag)("MessageContainsEmojiPack",[(0,pe.Z)(e.set.title)]);(0,B.Z)(d.textElement,t)}));return t.cached?i:void e()}(0,B.Z)(d.textElement,(0,h.ag)("MessageContainsEmojiPacks",[s.size]))}));if(!s.some((e=>!e)))return n(s);e(),this.managers.appEmojiManager.getCustomEmojiDocuments(t).then(n)}))))}return this.chat.container.append(t),{element:t,cleanup:()=>{this.cleanup(),o&&o.cleanup()},destroy:()=>{t.remove(),o&&o.widthContainer.remove()},menuPadding:a,reactionsMenu:o,reactionsMenuPosition:r}}))}getUrlToMessage(){return ye(this,void 0,void 0,(function*(){if(this.peerId.isUser())return;let e;const{peerId:t,mid:i}=this,s=this.chat.threadId;"discussion"===this.chat.type&&(e=yield this.managers.appMessagesManager.getMessageByPeer(t,s));const n=yield this.managers.appPeersManager.getPeerUsername(e?e.fromId:t),a=(0,ae.Z)(i);let o="https://t.me/";return n?(o+=n,o+=e?`/${(0,ae.Z)(e.fwd_from.channel_post)}?comment=${a}`:s?`/${(0,ae.Z)(s)}/${a}`:"/"+a):(o+="c/"+t.toChatId(),o+=e?`/${a}?thread=${(0,ae.Z)(e.mid)}`:s?`/${(0,ae.Z)(s)}/${a}`:"/"+a),{url:o,isPrivate:!n}}))}getSelectedMessagesText(){return ye(this,void 0,void 0,(function*(){if(!(0,m.Z)())return"";const e=this.chat.selection.isSelecting?[...this.chat.selection.selectedMids.get(this.peerId)].sort(((e,t)=>e-t)):[this.mid];return(yield Promise.all(e.map((e=>ye(this,void 0,void 0,(function*(){const t=yield this.chat.getMessage(e);return(null==t?void 0:t.message)?t.message+"\n":""})))))).join("")}))}static onDownloadClick(e,t){return Array.isArray(e)?e.map((e=>this.onDownloadClick(e))):this.canDownload(e,void 0,t)?ce.Z.downloadToDisc({media:(0,ge.Z)(e,!0)}):void 0}}},1571:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(5296),n=i(2064);class a{constructor(){this._width=50,this._height=50,this._tails=90,this._scrollTails=50,this._curve=[0,.25,.5,.75,1,1.5,2,2.5,3,3.5,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,18.3,18.6,18.9,19.2,19.5,19.8,20.1,20.4,20.7,21,21.3,21.6,21.9,22.2,22.5,22.8,23.1,23.4,23.7,24,24.3,24.6,24.9,25.2,25.5,25.8,26.1,26.3,26.4,26.5,26.6,26.7,26.8,26.9,27],this._positions=[{x:.8,y:.1},{x:.6,y:.2},{x:.35,y:.25},{x:.25,y:.6},{x:.2,y:.9},{x:.4,y:.8},{x:.65,y:.75},{x:.75,y:.4}],this._phases=this._positions.length,this.onWheel=e=>{this._animatingToNextPosition||(this._scrollDelta+=e.deltaY,void 0===this._onWheelRAF&&(this._onWheelRAF=requestAnimationFrame(this.drawOnWheel)))},this.drawOnWheel=()=>{const e=this._scrollDelta/this._scrollTails;this._scrollDelta%=this._scrollTails;const t=e>0?Math.floor(e):Math.ceil(e);t&&this.changeTailAndDraw(t),this._onWheelRAF=void 0},this.drawNextPositionAnimated=e=>{var t;let i,s;if(e){const s=e();i=s>=1;const a=-1*(n=s)*(n-2),o=null!==(t=this._nextPositionTail)&&void 0!==t?t:0,r=(this._nextPositionTail=this._nextPositionTails*a)-o;r&&(this._nextPositionLeft-=r,this.changeTailAndDraw(r))}else{const e=this._frames;s=e.shift(),i=!e.length}var n;return s&&this.drawImageData(s),i&&(this._nextPositionLeft=void 0,this._nextPositionTails=void 0,this._nextPositionTail=void 0,this._animatingToNextPosition=void 0),!i};const e=this._tails/this._curve[this._curve.length-1];for(let t=0,i=this._curve.length;t{var s;return e-(null!==(s=i[t-1])&&void 0!==s?s:0)}))}hexToRgb(e){const t=(0,n.oo)(e);return{r:t[0],g:t[1],b:t[2]}}getPositions(e){const t=this._positions.slice();t.push(...t.splice(0,e));const i=[];for(let e=0;e({x:(e.x-s[i].x)/t,y:(e.y-s[i].y)/t})));return i.map((e=>n.map(((t,i)=>({x:s[i].x+t.x*e,y:s[i].y+t.y*e})))))}curPosition(e,t){return this.getNextPositions(e,this._tails,[t])[0]}changeTail(e){for(this._tail+=e;this._tail>=this._tails;)this._tail-=this._tails,++this._phase>=this._phases&&(this._phase-=this._phases);for(;this._tail<0;)this._tail+=this._tails,--this._phase<0&&(this._phase+=this._phases)}changeTailAndDraw(e){this.changeTail(e);const t=this.curPosition(this._phase,this._tail);this.drawGradient(t)}getGradientImageData(e){const t=this._hctx.createImageData(this._width,this._height),i=t.data;let s=0;for(let t=0;tthis.hexToRgb(e))),this._hc||(this._hc=document.createElement("canvas"),this._hc.width=this._width,this._hc.height=this._height,this._hctx=this._hc.getContext("2d",{alpha:!1})),this._canvas=e,this._ctx=this._canvas.getContext("2d",{alpha:!1}),this.update()}update(){if(this._colors.length<2){const e=this._colors[0];return this._ctx.fillStyle=`rgb(${e.r}, ${e.g}, ${e.b})`,void this._ctx.fillRect(0,0,this._width,this._height)}const e=this.curPosition(this._phase,this._tail);this.drawGradient(e)}toNextPosition(e){var t,i;if(this._colors.length<2)return;if(e)return this._nextPositionLeft=this._tails+(null!==(t=this._nextPositionLeft)&&void 0!==t?t:0),this._nextPositionTails=this._nextPositionLeft,this._nextPositionTail=void 0,this._animatingToNextPosition=!0,void(0,s.cK)(this.drawNextPositionAnimated.bind(this,e),this);const n=this._tail,a=this._tails;let o;const r=[];for(let e=0,t=this._incrementalCurve.length;ea&&void 0===o&&(o=e,s%=a),r.push(s)}[r.slice(0,o),void 0!==o?r.slice(o):[]].forEach(((e,t,i)=>{const s=e[e.length-1];if(void 0!==s&&s>a&&(e[e.length-1]=+s.toFixed(2)),this._tail=null!=s?s:0,!e.length)return;const n=this.getNextPositions(this._phase,a,e);t!==i.length-1&&++this._phase>=this._phases&&(this._phase-=this._phases);const o=n.map((e=>this.getGradientImageData(e)));this._frames.push(...o)})),this._animatingToNextPosition=!0,(0,s.cK)(this.drawNextPositionAnimated,this)}scrollAnimate(e){}cleanup(){this.scrollAnimate(!1)}static createCanvas(e){const t=document.createElement("canvas");return t.width=50,t.height=50,void 0!==e&&(t.dataset.colors=e),t}static create(e){const t=this.createCanvas(e),i=new a;return i.init(t),{gradientRenderer:i,canvas:t}}}},8843:(e,t,i)=>{"use strict";i.d(t,{m:()=>Bt,Z:()=>Nt});var s=i(6219),n=i(4329),a=i.n(n),o=i(5432),r=i(9043),d=i(3003),l=i(3173),c=i(1168),h=i(9807),u=i(503),p=i(1218),f=i(8805),m=i(6676),g=i(2325),v=i(4668),b=i(3910),y=i(1293),w=i(2648),S=i(2738),C=i(9336),L=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class E extends c.Z{constructor(e){super("popup-create-poll popup-new-media",{closable:!0,withConfirm:"Create",body:!0,title:"NewPoll"}),this.chat=e,this.tempId=0,this.onSubmitClick=()=>{this.send()},this.onInput=e=>{const t=e.target,i=(0,v.Z)(t,"LABEL"),s=(0,y.Z)(t);s||(t.parentElement.classList.add("is-filled"),i.classList.remove("hidden-widget"),i.firstElementChild.removeAttribute("disabled")),!i.nextElementSibling&&!s&&this.questions.childElementCount<10&&this.appendMoreField(),this.handleChange()},this.onDeleteClick=e=>{const t=e.target,i=(0,v.Z)(t,"LABEL"),s=(0,w.Z)(i);this.correctAnswers&&this.correctAnswers[0][0]===s&&(this.correctAnswers=void 0),i.remove(),this.optionInputFields.splice(s,1),this.optionInputFields.forEach(((e,t)=>{e.options.labelOptions.length=0,e.options.labelOptions.push(t+1),g.ZP.weakMap.get(e.label.firstElementChild).update()})),this.handleChange()},this.construct()}construct(){return L(this,void 0,void 0,(function*(){if(this.questionInputField=new u.ZP({placeholder:"AskAQuestion",label:"AskAQuestion",name:"question",maxLength:255}),this.listenerSetter.add(this.questionInputField.input)("input",(()=>{this.handleChange()})),this.optionInputFields=[],"scheduled"!==this.chat.type){const e=new m.Z({onSilentClick:()=>{this.chat.input.sendSilent=!0,this.send()},onScheduleClick:()=>{this.chat.input.scheduleSending((()=>{this.send()}))},openSide:"bottom-left",onContextElement:this.btnConfirm});e.setPeerId(this.chat.peerId),this.header.append(e.sendMenu)}this.header.append(this.questionInputField.container);const e=document.createElement("hr"),t=document.createElement("div");t.classList.add("caption"),(0,g.$d)(t,"PollOptions"),this.questions=document.createElement("form"),this.questions.classList.add("poll-create-questions");const i=document.createElement("div");i.classList.add("poll-create-settings");const s=document.createElement("div");s.classList.add("caption"),(0,g.$d)(s,"Settings"),(yield this.chat.managers.appPeersManager.isBroadcast(this.chat.peerId))||(this.anonymousCheckboxField=new h.Z({text:"NewPoll.Anonymous",name:"anonymous"}),this.anonymousCheckboxField.input.checked=!0,i.append(this.anonymousCheckboxField.label)),this.multipleCheckboxField=new h.Z({text:"NewPoll.MultipleChoice",name:"multiple"}),this.quizCheckboxField=new h.Z({text:"NewPoll.Quiz",name:"quiz"}),this.listenerSetter.add(this.multipleCheckboxField.input)("change",(()=>{const e=this.multipleCheckboxField.input.checked;this.quizCheckboxField.input.toggleAttribute("disabled",e)})),this.listenerSetter.add(this.quizCheckboxField.input)("change",(()=>{const e=this.quizCheckboxField.input.checked;Array.from(this.questions.children).map((t=>{t.classList.toggle("radio-field",e)})),e||(this.correctAnswers=void 0,this.quizSolutionField.setValueSilently("")),n.forEach((t=>t.classList.toggle("hide",!e))),this.multipleCheckboxField.input.toggleAttribute("disabled",e),this.handleChange()})),i.append(this.multipleCheckboxField.label,this.quizCheckboxField.label);const n=[],a=document.createElement("div");a.classList.add("caption"),(0,g.$d)(a,"AccDescrQuizExplanation");const o=document.createElement("hr"),r=document.createElement("div");r.classList.add("poll-create-questions"),this.quizSolutionField=new u.ZP({placeholder:"NewPoll.Explanation.Placeholder",label:"NewPoll.Explanation.Placeholder",name:"solution",maxLength:200}),this.listenerSetter.add(this.questionInputField.input)("input",(()=>{this.handleChange()}));const d=document.createElement("div");d.classList.add("subtitle"),(0,g.$d)(d,"AddAnExplanationInfo"),r.append(this.quizSolutionField.container,d),n.push(o,a,r),n.forEach((e=>e.classList.add("hide"))),this.body.parentElement.insertBefore(e,this.body),this.body.append(t,this.questions,document.createElement("hr"),s,i,...n),(0,S.fc)(this.btnConfirm,this.onSubmitClick,{listenerSetter:this.listenerSetter}),this.scrollable=new f.ZP(this.body),this.appendMoreField(),this.onEscape=()=>!this.getFilledAnswers().length,this.handleChange()}))}getFilledAnswers(){return Array.from(this.questions.children).map(((e,t)=>{const i=e.querySelector(".input-field-input");return i instanceof HTMLInputElement?i.value:(0,C.Z)(i,!1,!1).value})).filter((e=>!!e.trim()))}validate(){var e;const t=this.questionInputField.value;if(!t)return!1;if(t.length>255)return!1;if(this.quizCheckboxField.input.checked&&!(null===(e=this.correctAnswers)||void 0===e?void 0:e.length))return!1;const i=this.getFilledAnswers();if(i.length<2)return!1;if(i.find((e=>e.length>100)))return!1;const{value:s}=(0,C.Z)(this.quizSolutionField.input,!1,!1);return!(s.length>200)}handleChange(){const e=this.validate();this.btnConfirm.toggleAttribute("disabled",!e)}send(e=!1){return L(this,void 0,void 0,(function*(){const t=this.questionInputField.value,i=this.getFilledAnswers(),{value:s,entities:n}=(0,C.Z)(this.quizSolutionField.input,!0,!1);if("scheduled"===this.chat.type&&!e)return void this.chat.input.scheduleSending((()=>{this.send(!0)}));this.hide();const a={};this.anonymousCheckboxField&&!this.anonymousCheckboxField.input.checked&&(a.public_voters=!0),this.multipleCheckboxField.input.checked&&(a.multiple_choice=!0),this.quizCheckboxField.input.checked&&(a.quiz=!0);const o={_:"poll",pFlags:a,question:t,answers:i.map(((e,t)=>({_:"pollAnswer",text:e,option:new Uint8Array([t])}))),id:void 0},r=yield this.chat.managers.appPollsManager.getInputMediaPoll(o,this.correctAnswers,s,n);this.chat.managers.appMessagesManager.sendOther(this.chat.peerId,r,Object.assign({},this.chat.getMessageSendingParams())),"reply"===this.chat.input.helperType&&this.chat.input.clearHelper(),this.chat.input.onMessageSent(!1,!1)}))}appendMoreField(){const e=this.tempId++,t=this.questions.childElementCount+1,i=new u.ZP({placeholder:"NewPoll.OptionsAddOption",label:"NewPoll.OptionLabel",labelOptions:[t],name:"question-"+e,maxLength:100});this.listenerSetter.add(i.input)("input",this.onInput);const s=new p.Z({text:"",name:"question"});s.main.append(i.container),(0,S.fc)(i.input,b.Z,{listenerSetter:this.listenerSetter}),s.label.classList.add("hidden-widget"),s.input.disabled=!0,this.quizCheckboxField.input.checked||s.label.classList.remove("radio-field"),this.listenerSetter.add(s.input)("change",(()=>{if(s.input.checked){const e=(0,w.Z)(s.label);this.correctAnswers=[new Uint8Array([e])],this.handleChange()}}));const n=document.createElement("span");n.classList.add("btn-icon","tgico-close"),i.container.append(n),(0,S.fc)(n,this.onDeleteClick,{listenerSetter:this.listenerSetter,once:!0}),this.questions.append(s.label),this.scrollable.scrollIntoViewNew({element:this.questions.lastElementChild,position:"center"}),this.optionInputFields.push(i)}}var I=i(4524),M=i(805),Z=i(2796),P=i(3699),T=i(4755),k=i(6787),x=i(3512),A=i(6057),_=i(2153),F=i(9259),D=i(4789),R=i(5975),B=i(8497);const N="keydown",O="active",U=["ArrowUp","ArrowDown"],H=["ArrowLeft","ArrowRight"];function z({list:e,type:t,onSelect:i,once:s,waitForKey:n}){let a=(null==n?void 0:n.length)?new Set(n):void 0;const o=new Set("xy"===t?U.concat(H):"x"===t?H:U);let r;const d=()=>r||e.querySelector("."+O)||e.firstElementChild,l=(e,i)=>{if(r===e)return;let s=!1;r&&(s=!0,r.classList.remove(O)),r=e,r&&(r.classList.add(O),s&&p&&i&&(0,D.Z)({container:p,element:r,position:"center",forceDuration:100,axis:"x"===t?"x":"y"}))},c=(t,i)=>{let s;return s=i?t.nextElementSibling||e.firstElementChild:t.previousElementSibling||e.lastElementChild,s};let h;h="xy"===t?(t,i)=>"ArrowUp"===i||"ArrowDown"===i?((t,i)=>{const s=i?"nextElementSibling":"previousElementSibling",n=i?"firstElementChild":"lastElementChild",a=t.getBoundingClientRect();let o=t[s]||e[n];for(;o!==t;){const t=o.getBoundingClientRect();if(t.x===a.x&&t.y!==a.y)break;o=o[s]||e[n]}return o})(t,"ArrowDown"===i):c(t,"ArrowRight"===i):(e,t)=>c(e,"ArrowRight"===t||"ArrowDown"===t);let u=i=>{const s=i.key;if(o.has(s)){if((0,b.Z)(i),e.childElementCount>1){let e=d();e=h(e,s),l(e,!0)}}else("Enter"===s||"xy"!==t&&"Tab"===s)&&((0,b.Z)(i),g(d()))};const p=(0,B.Z)(e,"scrollable");e.classList.add("navigable-list");const f=t=>{const i=(0,R.Z)(t.target,e);i&&l(i,!1)},m=t=>{(0,b.Z)(t);const i=(0,R.Z)(t.target,e);i&&(l(i,!1),g(d()))},g=e=>{return t=this,n=void 0,o=function*(){const t=yield i(e);(void 0!==t?!t:s)&&C()},new((a=void 0)||(a=Promise))((function(e,i){function s(e){try{d(o.next(e))}catch(e){i(e)}}function r(e){try{d(o.throw(e))}catch(e){i(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(s,r)}d((o=o.apply(t,n||[])).next())}));var t,n,a,o};let v,y=!1;const w=()=>{y||(y=!0,document.addEventListener(N,u,{capture:!0,passive:!1}),e.addEventListener("mousemove",f,{passive:!0}),v=(0,S.fc)(e,m))},C=()=>{y&&(y=!1,document.removeEventListener(N,u,{capture:!0}),e.removeEventListener("mousemove",f),v(),v=void 0)},L=()=>{a||l(e.firstElementChild,!1)};if(a){const e=u;u=t=>{a.has(t.key)&&((0,b.Z)(t),document.removeEventListener(N,u,{capture:!0}),u=e,document.addEventListener(N,u,{capture:!0,passive:!1}),a=void 0,L())}}else L();return w(),{attach:w,detach:C,resetTarget:L}}var j=i(3241),G=i(4762),V=i(5824),K=i(9099),W=i(5953),$=i(5994);class q extends j.Z{constructor(e){var t;super(!1),this.hidden=!0,this.onVisible=()=>{var e;null===(e=this.detach)||void 0===e||e.call(this);const t=this.list,{attach:i,detach:s,resetTarget:n}=z({list:t,type:this.listType,onSelect:this.onSelect,once:!0,waitForKey:this.waitForKey});this.attach=i,this.detach=s,this.resetTarget=n,G.IS_MOBILE||this.navigationItem||(this.navigationItem={type:"autocomplete-helper",onPop:()=>{this.navigationItem=void 0,this.toggle(!0)},noBlurOnPop:!0},V.Z.pushItem(this.navigationItem)),this.addEventListener("hidden",(()=>{this.resetTarget=void 0,this.attach=void 0,this.detach=void 0,t.innerHTML="",s(),this.navigationItem&&(V.Z.removeItem(this.navigationItem),this.navigationItem=void 0)}),{once:!0})},(0,W.Z)(this,e),this.container=document.createElement("div"),this.container.classList.add("autocomplete-helper","z-depth-1"),e.appendTo.append(this.container),this.attachNavigation(),null===(t=this.controller)||void 0===t||t.addHelper(this)}toggleListNavigation(e){var t,i;e?null===(t=this.attach)||void 0===t||t.call(this):null===(i=this.detach)||void 0===i||i.call(this)}attachNavigation(){this.addEventListener("visible",this.onVisible)}toggle(e,t=!1,i){var s;if(this.init)return;if(void 0===e&&(e=this.container.classList.contains("is-visible")&&!this.container.classList.contains("backwards")),this.hidden===e)return void(e||this.dispatchEvent("visible"));this.hidden=e,e?(this.navigationItem&&(V.Z.removeItem(this.navigationItem),this.navigationItem=void 0),!t&&this.controller&&this.controller.hideOtherHelpers(),null===(s=this.detach)||void 0===s||s.call(this)):(this.controller&&this.controller.hideOtherHelpers(this),this.dispatchEvent("visible"));const n=this.controller||e?0:2;e&&this.dispatchEvent("hiding"),(0,K.Z)({element:this.container,className:"is-visible",forwards:!e,duration:$.Z.isAvailable("animations")&&!i?300:0,onTransitionEnd:()=>{this.hidden&&this.dispatchEvent("hidden")},useRafs:n})}}class Y extends q{constructor(e,t,i,s){super({appendTo:e,controller:t,listType:"xy",onSelect:e=>{return t=this,i=void 0,n=function*(){return!(yield l.Jo.onMediaClick({target:e},!0))},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n},waitForKey:["ArrowUp","ArrowDown"]}),this.chat=i,this.managers=s,this.container.classList.add("stickers-helper"),this.addEventListener("visible",(()=>{setTimeout((()=>{this.scrollable.container.scrollTop=0}),0),x.Z.dispatchEvent("choosing_sticker",!0)})),this.addEventListener("hidden",(()=>{this.onChangeScreen&&(T.Z.removeEventListener("changeScreen",this.onChangeScreen),this.onChangeScreen=void 0,this.listenerSetter.removeAll(),this.listenerSetter=void 0),x.Z.dispatchEvent("choosing_sticker",!1)}))}checkEmoticon(e){var t;const i=this.controller.getMiddleware();null===(t=this.lazyLoadQueue)||void 0===t||t.clear(),(0,k.Z)(e),this.managers.appStickersManager.getStickersByEmoticon(e,!0,"all"===x.Z.settings.stickers.suggest).then((e=>{if(!i())return;this.init&&(this.init(),this.init=null);const t=this.list.cloneNode();let s;this.lazyLoadQueue.clear(),s=e.length?new Promise((i=>{const s=[];e.forEach((e=>{t.append(this.superStickerRenderer.renderSticker(e,void 0,s))})),Promise.all(s).finally(i)})):Promise.resolve(),s.then((()=>{this.list.replaceWith(t),this.list=t,this.onChangeScreen||(this.onChangeScreen=()=>{const e=this.list.childElementCount*T.Z.active.esgSticker.width+(this.list.childElementCount-1);this.list.style.width=e+"px"},T.Z.addEventListener("changeScreen",this.onChangeScreen),this.listenerSetter=new P.Z,(0,F.Z)({listenTo:this.container,listenerSetter:this.listenerSetter})),this.onChangeScreen(),this.toggle(!e.length),this.scrollable.scrollTop=0}))}))}init(){this.list=document.createElement("div"),this.list.classList.add("stickers-helper-stickers","super-stickers"),this.container.append(this.list),this.scrollable=new f.ZP(this.container),this.lazyLoadQueue=new _.Z,this.superStickerRenderer=new A.vT(this.lazyLoadQueue,this.chat.animationGroup,this.managers)}}var Q=i(2230),X=i(5322),J=i(4494),ee=i(586),te=i(2986);const ie=()=>{const e=new Date;return e.setHours(0,0,0,0),e},se=()=>{const e=new Date;return e.setFullYear(e.getFullYear()+1),e.setDate(e.getDate()-1),e};class ne extends te.Z{constructor(e,t,i){var s;if(super((s=e).getTime()>se().getTime()?new Date:s,t,{noButtons:!0,noTitle:!0,closable:!0,withConfirm:!0,minDate:ie(),maxDate:se(),withTime:!0,showOverflowMonths:!0,confirmShortcutIsSendShortcut:!0,title:!0}),this.element.classList.add("popup-schedule"),this.header.append(this.controlsDiv),this.title.replaceWith(this.monthTitle),this.body.append(this.btnConfirm),i){const e=(0,J.Z)("btn-primary btn-secondary btn-primary-transparent primary",{text:"Schedule.SendWhenOnline"});this.body.append(e),(0,S.fc)(e,(()=>{t(ee._),this.hide()}))}}}var ae=i(684),oe=i(7298),re=i(5729),de=i(8119),le=i(8799),ce=i(6760),he=i(6299),ue=i(2398),pe=i(6039);class fe extends q{constructor(e,t,i,s){super({appendTo:e,controller:t,listType:"x",onSelect:e=>{i.onEmojiSelected((0,pe.xG)(e),!0)}}),this.managers=s,this.container.classList.add("emoji-helper")}init(){this.list=document.createElement("div"),this.list.classList.add("emoji-helper-emojis","super-emojis"),this.container.append(this.list),this.scrollable=new f.v7(this.container),this.addEventListener("visible",(()=>{setTimeout((()=>{this.scrollable.container.scrollLeft=0}),0)}))}render(e,t){if(this.init){if(!e.length)return;this.init(),this.init=null}(e=e.slice(0,80)).length&&(this.list.innerHTML="",e.forEach((e=>{(0,pe.IA)(e,this.list,!1,!0)}))),this.waitForKey=t?["ArrowUp","ArrowDown"]:void 0,this.toggle(!e.length)}checkQuery(e,t){const i=this.controller.getMiddleware();this.managers.appEmojiManager.getBothEmojiKeywords().then((()=>{return s=this,n=void 0,o=function*(){if(!i())return;const s=e.replace(/^:/,""),n=yield this.managers.appEmojiManager.searchEmojis(s);i()&&this.render(n,":"!==t)},new((a=void 0)||(a=Promise))((function(e,t){function i(e){try{d(o.next(e))}catch(e){t(e)}}function r(e){try{d(o.throw(e))}catch(e){t(e)}}function d(t){var s;t.done?e(t.value):(s=t.value,s instanceof a?s:new a((function(e){e(s)}))).then(i,r)}d((o=o.apply(s,n||[])).next())}));var s,n,a,o}))}}var me=i(130),ge=i(8115),ve=i(9331),be=i(8842);class ye extends q{constructor(e,t,i,s){super({appendTo:e,controller:t,listType:"y",onSelect:s}),this.className=i,this.container.classList.add(ye.BASE_CLASS,i)}init(){this.list=document.createElement("div"),this.list.classList.add(ye.BASE_CLASS+"-list",this.className+"-list"),this.container.append(this.list),this.scrollable=new f.ZP(this.container),this.addEventListener("visible",(()=>{setTimeout((()=>{this.scrollable.container.scrollTop=0}),0)}))}render(e,t){if(this.init){if(!e.length)return;this.init(),this.init=null}e.length&&(this.list.innerHTML="",e.forEach((e=>{const t=ye.listElement({className:this.className,peerId:e.peerId,name:e.name,description:e.description});this.list.append(t)}))),t||this.toggle(!e.length)}static listElement(e){const t=ye.BASE_CLASS_LIST_ELEMENT;e.className+="-list-element";const i=document.createElement("div");i.classList.add(t,e.className),i.dataset.peerId=""+e.peerId;const s=new ve.Z;s.classList.add("avatar-30",t+"-avatar",e.className+"-avatar"),s.updateWithOptions({isDialog:!1,peerId:e.peerId});const n=document.createElement("div");if(n.classList.add(t+"-name",e.className+"-name"),e.name?(0,me.Z)(n,(0,ge.Z)(e.name)):n.append(new be.Z({peerId:e.peerId,dialog:!1,onlyFirstName:!1,plainText:!1}).element),i.append(s,n),e.description){const s=document.createElement("div");s.classList.add(t+"-description",e.className+"-description"),(0,me.Z)(s,(0,ge.Z)(e.description)),i.append(s)}return i}}ye.BASE_CLASS="autocomplete-peer-helper",ye.BASE_CLASS_LIST_ELEMENT=ye.BASE_CLASS+"-list-element";var we=i(7381);function Se(e,t,i){const s=[].concat(t.bot_info);let n;void 0!==i&&(n=new we.Z({ignoreCase:!0}));const a=new Map;let o;if(s.forEach((t=>{t.commands&&t.commands.forEach((({command:i,description:s},o)=>{const r="/"+i;a.set(i,{peerId:t.user_id?t.user_id.toPeerId(!1):e,command:i,name:r,description:s,index:o}),n&&n.indexObject(i,r)}))})),n){const e=n.search(i);o=Array.from(e).map((e=>a.get(e)))}else o=[...a.values()];return o=o.sort(((e,t)=>a.get(e.command).index-a.get(t.command).index)),o}class Ce extends ye{constructor(e,t,i,s){super(e,t,"commands-helper",(e=>{const t=e.querySelector(`.${ye.BASE_CLASS_LIST_ELEMENT}-name`).innerHTML;return i.getReadyToSend((()=>{i.messageInput.innerHTML=t,i.sendMessage(!0)}))})),this.managers=s}checkQuery(e,t){return i=this,s=void 0,a=function*(){if(!(yield this.managers.appUsersManager.isBot(t)))return!1;const i=this.controller.getMiddleware();return this.managers.appProfileManager.getProfileByPeerId(t).then((s=>{if(!i())return;const n=Se(t,s,e);this.render(n)})),!0},new((n=void 0)||(n=Promise))((function(e,t){function o(e){try{d(a.next(e))}catch(e){t(e)}}function r(e){try{d(a.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(i,s||[])).next())}));var i,s,n,a}}var Le=i(3624);class Ee{constructor(){this.helpers=new Set,this.middleware=(0,Le.k)()}toggleListNavigation(e){for(const t of this.helpers)t.toggleListNavigation(e)}getMiddleware(){return this.middleware.clean(),this.middleware.get()}addHelper(e){this.helpers.add(e)}hideOtherHelpers(e){this.helpers.forEach((t=>{t!==e&&t.toggle(!0,!0)})),e||this.middleware.clean()}}var Ie=i(5102),Me=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class Ze extends ye{constructor(e,t,i,s){super(e,t,"mentions-helper",(e=>{const t=e.dataset.peerId.toUserId();Promise.resolve(s.appUsersManager.getUser(t)).then((e=>{let t,s="";const n=(0,Ie.Z)(e);n[0]?s="@"+n[0]:(s=e.first_name||e.last_name,t={_:"messageEntityMentionName",length:s.length,offset:0,user_id:e.id}),s+=" ",i.insertAtCaret(s,t)}))})),this.managers=s}checkQuery(e,t,i){const s=e.trim();if(e.length!==s.length)return!1;const n=this.controller.getMiddleware();return this.managers.appProfileManager.getMentions(t&&t.toChatId(),s,i).then((e=>Me(this,void 0,void 0,(function*(){if(!n())return;e=e.filter((e=>e!==x.Z.myId));const t=e.map((e=>Me(this,void 0,void 0,(function*(){const t=yield this.managers.appUsersManager.getUser(e),i=(0,Ie.Z)(t);return{peerId:e,description:i[0]?"@"+i[0]:void 0}}))));this.render((yield Promise.all(t)).filter(Boolean))})))),!0}}var Pe=i(5494),Te=i(6339),ke=i(8594),xe=i(5592),Ae=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class _e extends Te.Z{constructor(e){super({element:document.createElement("div")}),this.onBodyTouchStart=e=>{const t=e.touches[0].target;(0,R.Z)(t,this.element)||t===this.btnHover||((0,b.Z)(e),this.toggle(!1))},(0,W.Z)(this,e),this.element.classList.add(_e.BASE_CLASS),this.element.style.display="none",this.scrollable=new f.ZP,this.element.append(this.scrollable.container),this.attachButtonListener(this.btnHover,this.listenerSetter),this.listenerSetter.add(x.Z)("history_reply_markup",(({peerId:e})=>Ae(this,void 0,void 0,(function*(){this.peerId===e&&(this.checkAvailability()&&this.isActive()&&(yield this.render()),(0,ke.e9)().then((()=>{this.checkForceReply()})))}))))}init(){return this.appendTo.append(this.element),this.listenerSetter.add(this)("open",(()=>Ae(this,void 0,void 0,(function*(){yield this.render(),o.Z&&(this.touchListener=this.listenerSetter.add(document.body)("touchstart",this.onBodyTouchStart,{passive:!1,capture:!0}),this.listenerSetter.add(this)("close",(()=>{this.listenerSetter.remove(this.touchListener)}),{once:!0}))})))),(0,S.fc)(this.element,(e=>{const t=(0,B.Z)(e.target,"btn");if(!t)return;const i=t.dataset.type,{peerId:s}=this;"keyboardButtonRequestPhone"===i?(0,xe.Z)({titleLangKey:"ShareYouPhoneNumberTitle",button:{langKey:"OK"},descriptionLangKey:"AreYouSureShareMyContactInfoBot"}).then((()=>{this.managers.appMessagesManager.sendContact(s,x.Z.myId)})):this.managers.appMessagesManager.sendText(s,t.dataset.text),this.toggle(!1)}),{listenerSetter:this.listenerSetter}),super.init()}checkForceReply(){return Ae(this,void 0,void 0,(function*(){const e=yield this.getReplyMarkup();"replyKeyboardForceReply"!==e._||e.pFlags.hidden||e.pFlags.used||(e.pFlags.used=!0,this.chatInput.initMessageReply(e.mid))}))}getReplyMarkup(){var e;return Ae(this,void 0,void 0,(function*(){return null!==(e=(yield this.managers.appMessagesManager.getHistoryStorageTransferable(this.peerId)).replyMarkup)&&void 0!==e?e:{_:"replyKeyboardHide",pFlags:{}}}))}render(e){return Ae(this,void 0,void 0,(function*(){void 0===e&&(e=yield this.getReplyMarkup()),this.scrollable.container.replaceChildren();for(const t of e.rows){const e=document.createElement("div");e.classList.add(_e.BASE_CLASS+"-row");for(const i of t.buttons){const t=document.createElement("button");t.classList.add(_e.BASE_CLASS+"-button","btn"),(0,me.Z)(t,(0,ge.Z)(i.text)),t.dataset.text=i.text,t.dataset.type=i._,e.append(t)}this.scrollable.container.append(e)}}))}checkAvailability(e){var t;return Ae(this,void 0,void 0,(function*(){void 0===e&&(e=yield this.getReplyMarkup());const i="replyKeyboardHide"===e._||!(null===(t=e.rows)||void 0===t?void 0:t.length);return this.btnHover.classList.toggle("hide",i),i&&this.toggle(!1),!i}))}setPeer(e){this.peerId=e,this.checkAvailability(),this.checkForceReply()}}_e.BASE_CLASS="reply-keyboard";var Fe=i(5701),De=i(8938),Re=i(1080),Be=i(8678),Ne=i(2830),Oe=i(5400),Ue=i(515),He=i(2312),ze=i(9492);const je="INLINE-HELPER";class Ge extends q{constructor(e,t,i,s){super({appendTo:e,controller:t,listType:"xy",waitForKey:["ArrowUp","ArrowDown"],onSelect:e=>{if(!e)return!1;const{peerId:t,botId:i,queryId:s}=this.list.dataset;return this.chat.input.getReadyToSend((()=>{const n=(0,Ue.Z)(s,e.dataset.resultId);this.managers.appInlineBotsManager.sendInlineResult(t.toPeerId(),i,n,Object.assign(Object.assign({},this.chat.getMessageSendingParams()),{clearDraft:!0})),this.chat.input.onMessageSent(!0,!0)}))}}),this.chat=i,this.managers=s,this._checkQuery=(e,t,i,s)=>{return n=this,a=void 0,r=function*(){const n=this.controller.getMiddleware(),a=yield this.managers.appUsersManager.resolveUsername(t);if(!n())throw"PEER_CHANGED";if("user"!==a._||!a.pFlags.bot)throw"NOT_A_BOT";if(!s){if(!n())throw"PEER_CHANGED";throw this.init&&(this.init(),this.init=null),this.container.classList.add("cant-send"),this.toggle(!1),"NO_INLINES"}const o=this.managers.appInlineBotsManager.getInlineResults(e,a.id,i).then((t=>{if(!n())throw"PEER_CHANGED";this.init&&(this.init(),this.init=null);const i=this.list.cloneNode();i.dataset.peerId=""+e,i.dataset.botId=""+a.id,i.dataset.queryId=""+t.query_id;const s=new Re.Z(null,je,this.scrollable,!1);this.lazyLoadQueue.clear(),this.superStickerRenderer.clear();const o=[],r=!!t.pFlags.gallery;for(const e of t.results){const t=document.createElement("div");t.classList.add("inline-helper-result"),t.dataset.resultId=e.id;const a=r?void 0:document.createElement("div");if(a&&(a.classList.add("inline-helper-result-preview"),t.append(a)),i.append(t),r)t.classList.add("grid-item");else{a.classList.add("empty"),(0,me.Z)(a,(0,ge.Z)([...e.title.trim()][0]));const s=document.createElement("div");s.classList.add("inline-helper-result-title"),(0,me.Z)(s,(0,ge.Z)(e.title));const n=document.createElement("div");n.classList.add("inline-helper-result-description"),(0,me.Z)(n,(0,Oe.ZP)(e.description,{noCommands:!0,noLinks:!0})),t.append(s,n);const o=document.createElement("div");o.classList.add("inline-helper-separator"),i.append(o)}if("botInlineResult"===e._){if(e.thumb&&0===e.thumb.mime_type.indexOf("image/")){let i;a?(i=document.createElement("div"),a.append(i)):i=t,i.classList.add("media-container"),r&&i.classList.add("no-border-radius"),this.lazyLoadQueue.push({div:t,load:()=>He.Z.download({dcId:4,location:{_:"inputWebFileLocation",access_hash:e.thumb.access_hash,url:e.thumb.url},size:e.thumb.size,mimeType:e.thumb.mime_type}).then((e=>{const t=new Image;t.classList.add("media-photo"),(0,Be.Z)(e).then((e=>{(0,Ne.Z)(i,t,e,!0)}))}))})}}else{const i=e.document||e.photo;if(["sticker","gif"].includes(null==i?void 0:i.type)&&r)(0,De.Z)(i),"gif"===i.type?s.add(i,t):"sticker"===i.type&&(t.classList.add("super-sticker"),this.superStickerRenderer.renderSticker(i,t,o),i.animated&&this.superStickerRenderer.observeAnimated(t));else if(i){const e=r?48:void 0;r&&t.classList.add("no-border-radius"),(0,ze.Z)({photo:i,container:r?t:a,boxWidth:e,boxHeight:e,middleware:n,lazyLoadQueue:this.lazyLoadQueue,loadPromises:o})}}}return Promise.all(o).then((()=>{var o;if(!n())return void s.clear();i.classList.toggle("is-gallery",r),i.classList.toggle("super-stickers",r),this.container.classList.toggle("is-gallery",r);const d=this.list.parentElement;if(d.textContent="",t.switch_pm){const i=(0,J.Z)("btn-primary btn-secondary btn-primary-transparent primary");(0,me.Z)(i,(0,ge.Z)(t.switch_pm.text)),(0,S.fc)(i,(i=>{this.chat.appImManager.setInnerPeer({peerId:e}),this.managers.appInlineBotsManager.switchToPM(e,a.id,t.switch_pm.start_param)})),d.append(i)}d.append(this.list=i),this.container.classList.remove("cant-send"),null===(o=this.gifsMasonry)||void 0===o||o.detach(),this.gifsMasonry=s,s.attach(),this.onChangeScreen||(this.onChangeScreen=()=>{if(this.list.classList.contains("is-gallery")){const e=this.list.childElementCount*T.Z.active.popupSticker.width+(this.list.childElementCount-1);this.list.style.width=e+"px"}else this.list.style.width=""},T.Z.addEventListener("changeScreen",this.onChangeScreen)),this.onChangeScreen(),this.toggle(!t.results.length&&!t.switch_pm),this.scrollable.scrollTop=0}))}));return{user:a,renderPromise:o}},new((o=void 0)||(o=Promise))((function(e,t){function i(e){try{d(r.next(e))}catch(e){t(e)}}function s(e){try{d(r.throw(e))}catch(e){t(e)}}function d(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(i,s)}d((r=r.apply(n,a||[])).next())}));var n,a,o,r},this.container.classList.add("inline-helper"),this.addEventListener("visible",(()=>{setTimeout((()=>{this.scrollable.container.scrollTop=0}),0)})),this.checkQuery=(0,Fe.Z)(this._checkQuery,200,!0,!0),this.addEventListener("hidden",(()=>{this.onChangeScreen&&(T.Z.removeEventListener("changeScreen",this.onChangeScreen),this.onChangeScreen=void 0)}))}init(){this.list=document.createElement("div"),this.list.classList.add("inline-helper-results"),this.container.append(this.list),this.scrollable=new f.ZP(this.container),this.lazyLoadQueue=new _.Z,this.superStickerRenderer=new A.vT(this.lazyLoadQueue,je,this.managers);const e=(0,g.ag)(Bt.send_inline);e.classList.add("inline-helper-cant-send"),this.container.append(e)}}var Ve=i(279),Ke=i(3035),We=i(5128),$e=i(8090),qe=i(8127),Ye=i(3013),Qe=i(1507),Xe=i(5133),Je=i(1656),et=i(6654);class tt extends ye{constructor(e,t,i){super(e,void 0,"bot-commands",(e=>{const i=e.querySelector(`.${ye.BASE_CLASS_LIST_ELEMENT}-name`).innerHTML;return t.getReadyToSend((()=>{t.messageInput.innerHTML=i,t.sendMessage(!0),this.toggle(!0)}))})),this.managers=i}setUserId(e,t){var i;if(this.userId!==e||!(null===(i=this.list)||void 0===i?void 0:i.childElementCount))return this.userId=e,(0,et.Z)(this.managers.appProfileManager.getProfile(e),(i=>{if(!t())return;const s=Se(e.toPeerId(!1),i),n=50*s.length+8+24;this.container.style.setProperty("--height",n+"px"),this.render(s)}));this.toggle(!1)}}var it=i(8479),st=i(5157),nt=(i(1544),i(7197)),at=i(6241),ot=i(6535),rt=i(2821),dt=i(3066),lt=i(496),ct=i(2790),ht=i(3416),ut=i(671);function pt(e){return t=this,i=void 0,n=function*(){return{cached:e.cached,result:e.cached?yield e.result:e.result}},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n}function ft(e){return e.then(pt)}var mt=i(1655),gt=i(2946),vt=i(177),bt=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class yt{constructor(e,t,i){this.managers=e,this.onReady=t,this.onChange=i,this.middleware=(0,Le.k)(),this.listenerSetter=new P.Z,this.construct()}construct(){this.container=document.createElement("div"),this.container.classList.add("new-message-send-as-container"),this.closeBtn=document.createElement("div"),this.closeBtn.classList.add("new-message-send-as-close","new-message-send-as-avatar","tgico-close");const e=[{text:"SendMessageAsTitle",onClick:void 0}];let t;this.buttons=[];const i=e=>{e&&(t=this.avatar);const i=this.avatar!==t,s=!e&&i?2:0;(0,K.Z)({element:this.closeBtn,className:"is-visible",forwards:e,duration:300,useRafs:s}),i||(0,K.Z)({element:t,className:"is-visible",forwards:!e,duration:300,useRafs:s})};(0,X.Z)({buttonOptions:{noRipple:!0},listenerSetter:this.listenerSetter,container:this.container,direction:"top-right",buttons:e,onOpenBefore:()=>{i(!0)},onOpen:(t,i)=>{e[0].element.classList.add("btn-menu-item-header"),this.btnMenu=i,this.btnMenu.classList.add("scrollable","scrollable-y"),this.btnMenu.append(...this.buttons.map((e=>e.element)))},onClose:()=>{i(!1)},onCloseAfter:()=>{this.btnMenu=void 0}}),this.container.append(this.closeBtn)}updateButtons(e){var t;return bt(this,void 0,void 0,(function*(){const i=e.map(((e,t)=>bt(this,void 0,void 0,(function*(){const i=document.createElement("div"),s=document.createElement("div");return s.classList.add("btn-menu-item-subtitle"),e.isUser()?s.append((0,g.ag)("Chat.SendAs.PersonalAccount")):e===this.peerId?s.append((0,g.ag)("VoiceChat.DiscussionGroup")):s.append(yield(0,vt.Z)(e.toChatId())),i.append(new be.Z({peerId:e}).element,s),{onClick:t?()=>bt(this,void 0,void 0,(function*(){const t=this.peerId;this.changeSendAsPeerId(e);const i=this.middleware.get(),s=()=>{if(this.sendAsPeerId!==e||!i())return;const t=this.sendAsPeerIds.slice();(0,mt.Z)(t,e),t.unshift(e),this.updateButtons(t)};$.Z.isAvailable("animations")?setTimeout(s,250):s(),this.managers.appMessagesManager.saveDefaultSendAs(t,e)})):void 0,textElement:i}})))),s=yield Promise.all(i);(0,d.b)({buttons:s}),s.forEach(((t,i)=>{const s=e[i],n=new ve.Z;n.classList.add("avatar-26","btn-menu-item-icon"),n.updateWithOptions({peerId:s}),i||n.classList.add("active"),t.element.prepend(n)})),this.buttons=s,null===(t=this.btnMenu)||void 0===t||t.append(...this.buttons.map((e=>e.element)))}))}updateAvatar(e,t){return bt(this,void 0,void 0,(function*(){const i=this.avatar;if(i&&i.peerId===e)return;i||(t=!0);const s=t?0:2,n=t?0:300,a=this.avatar=new ve.Z;a.classList.add("new-message-send-as-avatar","avatar-30"),yield a.updateWithOptions({isDialog:!1,peerId:e}),(0,K.Z)({element:a,className:"is-visible",forwards:!0,duration:n,useRafs:s}),i&&(0,K.Z)({element:i,className:"is-visible",forwards:!1,duration:n,onTransitionEnd:()=>{i.remove()},useRafs:s}),this.container.append(a)}))}changeSendAsPeerId(e,t){return this.sendAsPeerId=e,this.onChange(e),this.updateAvatar(e,t)}getDefaultSendAs(){return this.managers.acknowledged.appProfileManager.getChannelFull(this.peerId.toChatId()).then((e=>({cached:e.cached,result:e.result.then((e=>e.default_send_as?(0,gt.Z)(e.default_send_as):void 0))})))}updateManual(e){return bt(this,void 0,void 0,(function*(){const t=this.peerId;if(this.updatingPromise||!(yield this.managers.appPeersManager.isChannel(t)))return;const i=this.middleware.get((()=>!this.updatingPromise||this.updatingPromise===d)),{container:s}=this,n=t.toChatId(),a=(yield ft(this.getDefaultSendAs())).result,o=e;a instanceof Promise&&(e=void 0);const r=o&&!e,d=this.updatingPromise=(0,et.Z)(a,(t=>bt(this,void 0,void 0,(function*(){if(!i()||void 0===t)return;if(yield this.changeSendAsPeerId(t,e),!i())return;this.managers.appChatsManager.getSendAs(n).then((e=>{if(!i())return;const s=e.filter((e=>!e.pFlags.premium_required)).map((e=>e.peer)).map((e=>(0,gt.Z)(e)));this.sendAsPeerIds=s.slice(),(0,mt.Z)(s,t),s.unshift(t),this.updateButtons(s)}));const a=()=>{this.onReady(s,e),this.addedListener||(this.listenerSetter.add(x.Z)("peer_full_update",(e=>{this.peerId===e&&this.update()})),this.addedListener=!0)};if(!r)return a;a()}))));return d.finally((()=>{this.updatingPromise===d&&(this.updatingPromise=void 0)})),r?void 0:d}))}update(e){return this.updateManual(e).then((e=>null==e?void 0:e()))}setPeerId(e){this.middleware.clean(),this.updatingPromise=void 0,this.peerId=e}destroy(){this.container.remove(),this.setPeerId(),this.listenerSetter.removeAll()}}var wt=i(2353),St=i(9496),Ct=i(13),Lt=i(9298),Et=i(7362),It=i(6700),Mt=i(7545),Zt=i(669),Pt=i(6034),Tt=i(1452),kt=i(8794),xt=i(1439),At=i(7625),_t=i(2423),Ft=i(1174),Dt=i(554),Rt=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const Bt={send_voices:"GlobalAttachVoiceRestricted",send_stickers:"GlobalAttachStickersRestricted",send_gifs:"GlobalAttachGifRestricted",send_media:"GlobalAttachMediaRestricted",send_plain:"GlobalSendMessageRestricted",send_polls:"ErrorSendRestrictedPollsAll",send_inline:"GlobalAttachInlineRestricted"};class Nt{constructor(e,t,i){this.chat=e,this.appImManager=t,this.managers=i,this.lastUrl="",this.lastTimeType=0,this.replyElements={},this.willSendWebPage=null,this.recording=!1,this.recordCanceled=!1,this.recordStartTime=0,this.lockRedo=!1,this.canRedoFromHTML="",this.undoHistory=[],this.executedHistory=[],this.canUndoFromHTML="",this.onCancelRecordClick=e=>{e&&(0,b.Z)(e),this.recordCanceled=!0,this.recorder.stop(),r.Z.setKeepAlive(!1)},this.onEmoticonsOpen=()=>{const e=o.Z?"flip-icon":"active";this.btnToggleEmoticons.classList.toggle(e,!0)},this.onEmoticonsClose=()=>{const e=o.Z?"flip-icon":"active";this.btnToggleEmoticons.classList.toggle(e,!1)},this.scheduleSending=(e=this.sendMessage.bind(this,!0),t=new Date)=>Rt(this,void 0,void 0,(function*(){const{peerId:i}=this.chat,s=this.chat.bubbles.getMiddleware(),n=x.Z.myId!==i&&i.isUser()&&(yield this.managers.appUsersManager.isUserOnlineVisible(i));new ne(t,(t=>{s()&&(t<=10+(Date.now()/1e3|0)&&(t=void 0),this.scheduleDate=t,e(),"scheduled"!==this.chat.type&&t&&setTimeout((()=>{s()&&(c.Z.getPopups(Lt.Z).forEach((e=>e.hide())),this.appImManager.openScheduled(i))}),0))}),n).show()})),this.prepareDocumentExecute=()=>(this.executedHistory.push(this.messageInput.innerHTML),()=>this.canUndoFromHTML=this.messageInput.innerHTML),this.undoRedo=(e,t,i)=>{(0,b.Z)(e);let s=this.messageInput.innerHTML;if(s&&s!==i){this.lockRedo=!0;let e=0;do{document.execCommand(t,!1,null);const i=this.messageInput.innerHTML;if(s===i){if(++e>2)break}else e=0;s=i}while(s!==i);this.lockRedo=!1}},this.handleMarkdownShortcut=e=>{const t={KeyB:"bold",KeyI:"italic",KeyU:"underline",KeyS:"strikethrough",KeyM:"monospace",KeyP:"spoiler"};this.appImManager.markupTooltip&&(t.KeyK="link");const i=e.code,s=t[i],n=document.getSelection();if(!(0,Tt.Z)(n)&&s&&("KeyK"===i?this.appImManager.markupTooltip.showLinkEditor():this.applyMarkdown(s),(0,b.Z)(e)),"KeyZ"===i){let t=this.messageInput.innerHTML;e.shiftKey?this.undoHistory.length&&(this.executedHistory.push(t),t=this.undoHistory.pop(),this.undoRedo(e,"redo",t),t=this.messageInput.innerHTML,this.canRedoFromHTML=this.undoHistory.length?t:"",this.canUndoFromHTML=t):!this.executedHistory.length||this.canUndoFromHTML&&t!==this.canUndoFromHTML||(this.undoHistory.push(t),t=this.executedHistory.pop(),this.undoRedo(e,"undo",t),this.canUndoFromHTML=this.canRedoFromHTML=this.messageInput.innerHTML)}},this.onMessageInput=e=>{var t,i,s;const{value:n,entities:a,caretPos:o}=(0,C.Z)(this.messageInputField.input),r=(0,rt.Z)(n,a,!0),d=(0,at.Z)(a,(0,ot.Z)(r));this.canRedoFromHTML&&!this.lockRedo&&this.messageInput.innerHTML!==this.canRedoFromHTML&&(this.canRedoFromHTML="",this.undoHistory.length=0);const l=(!(null===(t=this.editMessage)||void 0===t?void 0:t.media)||"messageMediaWebPage"===this.editMessage.media._)&&d.filter((e=>"messageEntityUrl"===e._||"messageEntityTextUrl"===e._));if(l.length)for(const e of l){let t;if("messageEntityTextUrl"===e._)t=e.url;else if(t=n.slice(e.offset,e.offset+e.length),!t.includes("http://")&&!t.includes("https://"))continue;if(this.lastUrl!==t){this.lastUrl=t;const e=this.getWebPagePromise=Promise.all([this.managers.appWebPagesManager.getWebPage(t),this.chat.canSend("embed_links")]).then((([i,s])=>{this.getWebPagePromise===e&&(this.getWebPagePromise=void 0),this.lastUrl===t&&("webPage"===(null==i?void 0:i._)&&s?(this.setTopInfo("webpage",(()=>{}),i.site_name||i.title||"Webpage",i.description||i.url||""),delete this.noWebPage,this.willSendWebPage=i):this.willSendWebPage&&this.onHelperCancel())}))}break}else this.lastUrl&&(this.lastUrl="",delete this.noWebPage,this.willSendWebPage=null,this.helperType?this.helperFunc():this.clearHelper());if(n.trim()){const t=Date.now();t-this.lastTimeType>=6e3&&(null==e?void 0:e.isTrusted)&&(this.lastTimeType=t,this.managers.appMessagesManager.setTyping(this.chat.peerId,{_:"sendMessageTypingAction"},void 0,this.chat.threadId)),null===(s=this.botCommands)||void 0===s||s.toggle(!0)}else this.lastTimeType&&this.managers.appMessagesManager.setTyping(this.chat.peerId,{_:"sendMessageCancelAction"},void 0,this.chat.threadId),null===(i=this.appImManager.markupTooltip)||void 0===i||i.hide(),document.activeElement!==this.messageInput||G.IS_MOBILE||setTimeout((()=>{document.activeElement===this.messageInput&&(this.messageInput.textContent="1",(0,ue.Z)(this.messageInput),this.messageInput.textContent="")}),0);this.botCommands&&this.updateBotCommandsToggle(),this.editMsgId||this.saveDraftDebounced(),this.checkAutocomplete(n,o,d),this.updateSendBtn()},this.onEmojiSelected=(e,t)=>{const i=e.docId?{_:"messageEntityCustomEmoji",document_id:e.docId,length:e.emoji.length,offset:0}:(0,nt.Z)(e.emoji);this.insertAtCaret(e.emoji,i,t)},this.onBtnSendClick=e=>Rt(this,void 0,void 0,(function*(){if((0,b.Z)(e),!this.recorder||this.recording||!this.isInputEmpty()||this.forwarding||this.editMsgId)this.recording?Date.now()-this.recordStartTime<500?this.onCancelRecordClick():this.recorder.stop():this.sendMessage();else{const e=this.chat.peerId.isAnyChat(),t="send_voices";if(e&&!(yield this.chat.canSend(t)))return void(0,Z.bC)({langPackKey:Bt[t]});this.chatInput.classList.add("is-locked"),(0,le.Z)();let i=!1;if(!e){const e=yield this.managers.appProfileManager.getProfile(this.chat.peerId.toUserId());(null==e?void 0:e.pFlags.voice_messages_forbidden)&&((0,Z.bC)({langPackKey:"Chat.SendVoice.PrivacyError",langPackArguments:[yield(0,Et.Z)({peerId:this.chat.peerId})]}),i=!0)}if(i)return void this.chatInput.classList.remove("is-locked");this.recorder.start().then((()=>{this.releaseMediaPlayback=Ye.Z.setSingleMedia(),this.recordCanceled=!1,this.setRecording(!0),r.Z.setKeepAlive(!0);const e=()=>{new qe.Z("popup-cancel-record",{titleLangKey:"DiscardVoiceMessageTitle",descriptionLangKey:"DiscardVoiceMessageDescription",buttons:[{langKey:"DiscardVoiceMessageAction",callback:()=>{(0,S.tH)(this.btnCancelRecord)}},{langKey:"Continue",isCancel:!0}]}).show()};this.recordingOverlayListener=this.listenerSetter.add(document.body)("mousedown",(t=>{(0,B.Z)(t.target,"chat-input")||(0,B.Z)(t.target,"popup-cancel-record")||((0,b.Z)(t),e())}),{capture:!0,passive:!1}),V.Z.pushItem(this.recordingNavigationItem={type:"voice",onPop:()=>(setTimeout((()=>{e()}),0),!1)}),this.recordStartTime=Date.now();const t=this.recorder.sourceNode,i=t.context.createAnalyser();t.connect(i),i.fftSize=32;const s=new Uint8Array(i.frequencyBinCount),n=255*s.length,a=()=>{if(!this.recording)return;i.getByteFrequencyData(s);let e=0;s.forEach((t=>{e+=t}));const t=Math.min(1,e/n+.36);this.recordRippleEl.style.transform=`scale(${t})`;const o=Date.now()-this.recordStartTime,r=o%1e3,d=(0,st.Z)(o/1e3)+","+("00"+Math.round(r/10)).slice(-2);this.recordTimeEl.innerText=d,(0,Ke.T2)(a)};a()})).catch((e=>{switch(e.name){case"NotAllowedError":(0,Z.Am)("Please allow access to your microphone");break;case"NotReadableError":(0,Z.Am)(e.message);break;default:console.error("Recorder start error:",e,e.name,e.message),(0,Z.Am)(e.message)}this.setRecording(!1),this.chatInput.classList.remove("is-locked")}))}})),this.onHelperCancel=(e,t)=>Rt(this,void 0,void 0,(function*(){var i;if(e&&(0,b.Z)(e),this.willSendWebPage){const e=this.lastUrl;let t=!1;if(this.helperType&&(yield this.helperFunc(),t=!0),this.lastUrl=e,this.noWebPage=!0,this.willSendWebPage=null,t)return}if("edit"===this.helperType&&!t){const e=this.editMessage,t=this.getCurrentInputAsDraft(!0);t&&delete t.pFlags.no_webpage;const s=Object.assign(Object.assign({},e),{_:"draftMessage"});if(null===(i=s.entities)||void 0===i?void 0:i.length){const e=new Set(Object.values(_t.SC));s.entities=s.entities.slice(),(0,At.Z)(s.entities,((t,i,s)=>{e.has(t._)||s.splice(i,1)})),s.entities.length||delete s.entities}if(!(0,Pt.Z)(t,s))return void new qe.Z("discard-editing",{buttons:[{langKey:"Alert.Confirm.Discard",callback:()=>{this.onHelperCancel(void 0,!0)}}],descriptionLangKey:"Chat.Edit.Cancel.Text"}).show()}this.clearHelper(),this.updateSendBtn()})),this.onHelperClick=e=>{if((0,b.Z)(e),(0,B.Z)(e.target,"reply"))if("forward"===this.helperType){const{forwardElements:e}=this;e&&o.Z&&!e.container.classList.contains("active")&&ht.Z.openBtnMenu(e.container)}else"reply"===this.helperType?this.chat.setMessageId(this.replyToMsgId):"edit"===this.helperType&&this.chat.setMessageId(this.editMsgId)},this.listenerSetter=new P.Z}construct(){this.chatInput=document.createElement("div"),this.chatInput.classList.add("chat-input","hide"),this.inputContainer=document.createElement("div"),this.inputContainer.classList.add("chat-input-container"),this.rowsWrapperWrapper=document.createElement("div"),this.rowsWrapperWrapper.classList.add("rows-wrapper-wrapper"),this.rowsWrapper=document.createElement("div"),this.rowsWrapper.classList.add("rows-wrapper","chat-input-wrapper"),this.rowsWrapperWrapper.append(this.rowsWrapper);const e=(0,re.ZK)();this.rowsWrapper.append(e);const t=this.fakeRowsWrapper=document.createElement("div");t.classList.add("fake-wrapper","fake-rows-wrapper");const i=this.fakeSelectionWrapper=document.createElement("div");i.classList.add("fake-wrapper","fake-selection-wrapper"),this.inputContainer.append(this.rowsWrapperWrapper,t,i),this.chatInput.append(this.inputContainer),this.goDownBtn=(0,de.Z)({icon:"arrow_down",className:"bubbles-corner-button chat-secondary-button bubbles-go-down hide"}),this.inputContainer.append(this.goDownBtn),(0,S.fc)(this.goDownBtn,(e=>{(0,b.Z)(e),this.chat.bubbles.onGoDownClick()}),{listenerSetter:this.listenerSetter});const s=this.controlContainer=document.createElement("div");s.classList.add("chat-input-control","chat-input-wrapper"),this.inputContainer.append(s)}createButtonIcon(...e){const t=(0,Q.Z)(...e);return t.tabIndex=-1,t}constructPeerHelpers(){this.replyElements.container=document.createElement("div"),this.replyElements.container.classList.add("reply-wrapper"),this.replyElements.iconBtn=this.createButtonIcon(""),this.replyElements.cancelBtn=this.createButtonIcon("close reply-cancel",{noRipple:!0}),this.replyElements.container.append(this.replyElements.iconBtn,this.replyElements.cancelBtn);const e=()=>{s=!0},t=()=>{s=!1},i=this.forwardElements={};let s=!1;const n=[i.showSender={text:"Chat.Alert.Forward.Action.Show1",onClick:e,checkForClose:()=>this.canToggleHideAuthor(),checkboxField:new h.Z({checked:!0})},i.hideSender={text:"Chat.Alert.Forward.Action.Hide1",onClick:e,checkForClose:()=>this.canToggleHideAuthor(),checkboxField:new h.Z({checked:!1})},i.showCaption={text:"Chat.Alert.Forward.Action.ShowCaption",onClick:t,checkboxField:new h.Z({checked:!0})},i.hideCaption={text:"Chat.Alert.Forward.Action.HideCaption",onClick:t,checkboxField:new h.Z({checked:!1})},i.changePeer={text:"Chat.Alert.Forward.Action.Another",onClick:()=>{this.changeForwardRecipient()},icon:"replace"}],u=i.container=(0,d.b)({buttons:n,listenerSetter:this.listenerSetter}),p=Array.from(u.children);[{elements:p.slice(0,2),onChange:(e,t)=>{const n=!!+e;s&&(this.forwardWasDroppingAuthor=!n);const a=this.replyElements.container.querySelector(".reply-title");if(a){const e=a.firstElementChild,t=g.ZP.weakMap.get(e),s=i.showSender.checkboxField.checked?"Chat.Accessory.Forward":"Chat.Accessory.Hidden";t.key=s,t.update()}}},{elements:p.slice(2,4),onChange:e=>{const t=!!+e;let s;s=t&&void 0!==this.forwardWasDroppingAuthor?this.forwardWasDroppingAuthor?i.hideSender:i.showSender:t?i.showSender:i.hideSender,s.checkboxField.checked=!0}}].forEach((e=>{const t=(0,Xe.Z)(e.elements.map((e=>({container:e,input:e.querySelector("input")}))),e.onChange),i=document.createElement("hr");t.append(i),u.append(t)})),u.append(i.changePeer.element),o.Z||(this.forwardHover=new Te.Z({element:u})),i.modifyArgs=n.slice(0,-1),this.replyElements.container.append(u),i.modifyArgs.forEach(((e,t)=>{const{input:i}=e.checkboxField;i.type="radio",i.name=t<2?"author":"caption",i.value=""+ +!(t%2)})),this.newMessageWrapper=document.createElement("div"),this.newMessageWrapper.classList.add("new-message-wrapper"),this.replyInTopicOverlay=document.createElement("div"),this.replyInTopicOverlay.classList.add("reply-in-topic-overlay","hide"),this.replyInTopicOverlay.append((0,g.ag)("Chat.Input.ReplyToAnswer")),this.btnToggleEmoticons=this.createButtonIcon("none toggle-emoticons",{noRipple:!0}),this.inputMessageContainer=document.createElement("div"),this.inputMessageContainer.classList.add("input-message-container"),this.goDownUnreadBadge=document.createElement("span"),this.goDownUnreadBadge.classList.add("badge","badge-24","badge-primary"),this.goDownBtn.append(this.goDownUnreadBadge),this.goMentionBtn=(0,de.Z)({icon:"mention",className:"bubbles-corner-button chat-secondary-button bubbles-go-mention"}),this.goMentionUnreadBadge=document.createElement("span"),this.goMentionUnreadBadge.classList.add("badge","badge-24","badge-primary"),this.goMentionBtn.append(this.goMentionUnreadBadge),this.inputContainer.append(this.goMentionBtn),(0,S.fc)(this.goMentionBtn,(e=>{(0,b.Z)(e);const t=this.chat.bubbles.getMiddleware();this.managers.appMessagesManager.goToNextMention(this.chat.peerId,this.chat.threadId).then((e=>{t()&&e&&this.chat.setMessageId(e)}))}),{listenerSetter:this.listenerSetter}),this.btnScheduled=this.createButtonIcon("scheduled btn-scheduled float hide",{noRipple:!0}),(0,S.fc)(this.btnScheduled,(e=>{this.appImManager.openScheduled(this.chat.peerId)}),{listenerSetter:this.listenerSetter}),this.listenerSetter.add(x.Z)("scheduled_new",(({peerId:e})=>{this.chat.peerId===e&&this.btnScheduled.classList.remove("hide")})),this.listenerSetter.add(x.Z)("scheduled_delete",(({peerId:e})=>{this.chat.peerId===e&&this.managers.appMessagesManager.getScheduledMessages(this.chat.peerId).then((e=>{this.btnScheduled.classList.toggle("hide",!e.length)}))})),this.btnToggleReplyMarkup=this.createButtonIcon("botcom toggle-reply-markup float hide",{noRipple:!0}),this.replyKeyboard=new _e({appendTo:this.rowsWrapper,listenerSetter:this.listenerSetter,managers:this.managers,btnHover:this.btnToggleReplyMarkup,chatInput:this}),this.listenerSetter.add(this.replyKeyboard)("open",(()=>this.btnToggleReplyMarkup.classList.add("active"))),this.listenerSetter.add(this.replyKeyboard)("close",(()=>this.btnToggleReplyMarkup.classList.remove("active"))),this.botCommands=new tt(this.rowsWrapper,this,this.managers),this.botCommandsToggle=document.createElement("div"),this.botCommandsToggle.classList.add("new-message-bot-commands");const f=document.createElement("div");f.classList.add("new-message-bot-commands-icon-scale");const v=this.botCommandsIcon=document.createElement("div");v.classList.add("animated-menu-icon","animated-menu-close-icon"),f.append(v),this.botCommandsToggle.append(f),(0,S.fc)(this.botCommandsToggle,(e=>{(0,b.Z)(e),v.classList.contains("state-back")?(this.botCommands.toggle(!0),v.classList.remove("state-back")):(this.botCommands.setUserId(this.chat.peerId.toUserId(),this.chat.bubbles.getMiddleware()),v.classList.add("state-back"))}),{listenerSetter:this.listenerSetter}),this.botCommands.addEventListener("visible",(()=>{v.classList.add("state-back")})),this.botCommands.addEventListener("hiding",(()=>{v.classList.remove("state-back")}));const y=(e,t)=>{this.fileInput.value="";const i=[...e?Ft.Z:[],...t?Dt.Z:[]].join(", ");this.fileInput.setAttribute("accept",i),this.willAttachType="media",this.fileInput.click()};this.attachMenuButtons=[{icon:"image",text:"Chat.Input.Attach.PhotoOrVideo",onClick:()=>y(!0,!0)},{icon:"document",text:"Chat.Input.Attach.Document",onClick:()=>{this.fileInput.value="",this.fileInput.removeAttribute("accept"),this.willAttachType="document",this.fileInput.click()}},{icon:"poll",text:"Poll",onClick:()=>Rt(this,void 0,void 0,(function*(){const e="send_polls";(yield this.chat.canSend(e))?c.Z.createPopup(E,this.chat).show():(0,Z.bC)({langPackKey:Bt[e]})})),verify:()=>this.chat.peerId.isAnyChat()||this.chat.isBot}],this.managers.appAttachMenuBotsManager.getAttachMenuBots();const w=this.attachMenuButtons.slice();this.attachMenu=(0,X.Z)({buttonOptions:{noRipple:!0},listenerSetter:this.listenerSetter,direction:"top-left",buttons:this.attachMenuButtons,onOpenBefore:()=>Rt(this,void 0,void 0,(function*(){const e=yield this.managers.appAttachMenuBotsManager.getAttachMenuBots(),t=w.slice(),i=e.filter((e=>!e.pFlags.inactive)).map((e=>{const t=(0,kt.Z)(e);return{regularText:(0,ge.Z)(e.short_name),onClick:()=>{this.managers.appAttachMenuBotsManager.requestWebView(Object.assign({botId:e.bot_id,peerId:this.chat.peerId},this.chat.getMessageSendingParams())).then((t=>{const i=["allow-scripts","allow-same-origin","allow-popups","allow-forms","allow-modals","allow-storage-access-by-user-activation"].join(" ");class s extends c.Z{constructor(t){super("popup-payment popup-payment-verification",{closable:!0,overlayClosable:!0,body:!0,titleRaw:e.short_name}),this.url=t,this.d()}destroy(){return this.telegramWebView.destroy(),super.destroy()}d(){const e=this.telegramWebView=new xt.Z({url:this.url,sandbox:i});e.iframe.classList.add("payment-verification"),this.body.append(e.iframe),this.show(),e.onMount()}}new s(t.url)}))},iconDoc:null==t?void 0:t.icon,verify:()=>Rt(this,void 0,void 0,(function*(){let t=!1;const i={attachMenuPeerTypeSameBotPM:()=>this.chat.peerId.toUserId()===e.bot_id,attachMenuPeerTypeBotPM:()=>this.chat.isBot,attachMenuPeerTypePM:()=>this.chat.peerId.isUser(),attachMenuPeerTypeChat:()=>this.chat.isAnyGroup,attachMenuPeerTypeBroadcast:()=>this.chat.isBroadcast};for(const s of e.peer_types){const e=i[s._];if(t=yield e(),t)break}return t}))}}));t.splice(t.length,0,...i),this.attachMenuButtons.splice(0,this.attachMenuButtons.length,...t)}))}),this.attachMenu.classList.add("attach-file","tgico-attach"),this.attachMenu.classList.remove("tgico-more"),this.recordTimeEl=document.createElement("div"),this.recordTimeEl.classList.add("record-time"),this.fileInput=document.createElement("input"),this.fileInput.type="file",this.fileInput.multiple=!0,this.fileInput.style.display="none",this.newMessageWrapper.append(...[this.botCommandsToggle,this.btnToggleEmoticons,this.inputMessageContainer,this.btnScheduled,this.btnToggleReplyMarkup,this.attachMenu,this.recordTimeEl,this.fileInput].filter(Boolean)),this.rowsWrapper.append(this.replyElements.container),this.autocompleteHelperController=new Ee,this.stickersHelper=new Y(this.rowsWrapper,this.autocompleteHelperController,this.chat,this.managers),this.emojiHelper=new fe(this.rowsWrapper,this.autocompleteHelperController,this,this.managers),this.commandsHelper=new Ce(this.rowsWrapper,this.autocompleteHelperController,this,this.managers),this.mentionsHelper=new Ze(this.rowsWrapper,this.autocompleteHelperController,this,this.managers),this.inlineHelper=new Ge(this.rowsWrapper,this.autocompleteHelperController,this.chat,this.managers),this.rowsWrapper.append(this.newMessageWrapper),this.btnCancelRecord=this.createButtonIcon("binfilled btn-circle btn-record-cancel chat-secondary-button"),this.btnSendContainer=document.createElement("div"),this.btnSendContainer.classList.add("btn-send-container"),this.recordRippleEl=document.createElement("div"),this.recordRippleEl.classList.add("record-ripple"),this.btnSend=this.createButtonIcon("none btn-circle btn-send animated-button-icon"),this.btnSend.insertAdjacentHTML("afterbegin",'\n \n \n \n \n '),this.btnSendContainer.append(this.recordRippleEl,this.btnSend),this.sendMenu=new m.Z({onSilentClick:()=>{this.sendSilent=!0,this.sendMessage()},onScheduleClick:()=>{this.scheduleSending(void 0)},listenerSetter:this.listenerSetter,openSide:"top-left",onContextElement:this.btnSend,onOpen:()=>!("scheduled"===this.chat.type||this.isInputEmpty()&&!Object.keys(this.forwarding).length)}),this.btnSendContainer.append(this.sendMenu.sendMenu),this.inputContainer.append(this.btnCancelRecord,this.btnSendContainer),l.ZP.attachButtonListener(this.btnToggleEmoticons,this.listenerSetter),this.listenerSetter.add(l.ZP)("open",this.onEmoticonsOpen),this.listenerSetter.add(l.ZP)("close",this.onEmoticonsClose),this.attachMessageInputField(),this.listenerSetter.add(x.Z)("settings_updated",(()=>{var e;(this.stickersHelper||this.emojiHelper)&&(this.previousQuery="",this.checkAutocomplete()),null===(e=this.messageInputField)||void 0===e||e.onFakeInput()})),this.listenerSetter.add(x.Z)("draft_updated",(({peerId:e,threadId:t,draft:i,force:s})=>{this.chat.threadId===t&&this.chat.peerId===e&&"scheduled"!==this.chat.type&&this.setDraft(i,!0,s)})),this.listenerSetter.add(this.appImManager)("peer_changing",(e=>{this.chat!==e||"chat"!==this.chat.type&&"discussion"!==this.chat.type||this.saveDraft()})),this.listenerSetter.add(this.appImManager)("chat_changing",(({from:e,to:t})=>{this.chat===e?this.autocompleteHelperController.toggleListNavigation(!1):this.chat===t&&this.autocompleteHelperController.toggleListNavigation(!0)})),this.listenerSetter.add(x.Z)("scheduled_delete",(({peerId:e,mids:t})=>{"scheduled"===this.chat.type&&this.chat.peerId===e&&t.includes(this.editMsgId)&&this.onMessageSent()})),this.listenerSetter.add(x.Z)("history_delete",(({peerId:e,msgs:t})=>{this.chat.peerId===e&&"scheduled"!==this.chat.type&&(t.has(this.editMsgId)&&this.onMessageSent(),this.replyToMsgId&&t.has(this.replyToMsgId)&&this.clearHelper("reply"))})),this.listenerSetter.add(x.Z)("dialogs_multiupdate",(e=>{!e.has(this.chat.peerId)||"chat"!==this.chat.type&&"discussion"!==this.chat.type||(this.startParam===Qe.gZ?this.setStartParam():this.center(!0))}));try{this.recorder=new(a())({encoderSampleRate:48e3,monitorGain:0,numberOfChannels:1,recordingGain:1,reuseWorker:!0})}catch(e){console.error("Recorder constructor error:",e)}this.updateSendBtn(),this.listenerSetter.add(this.fileInput)("change",(e=>{const t=e.target.files;t.length&&(c.Z.createPopup(M.Z,this.chat,Array.from(t).slice(),this.willAttachType),this.fileInput.value="")}),!1),(0,S.fc)(this.btnSend,this.onBtnSendClick,{listenerSetter:this.listenerSetter,touchMouseDown:!0}),this.recorder&&((0,S.fc)(this.btnCancelRecord,this.onCancelRecordClick,{listenerSetter:this.listenerSetter}),this.recorder.onstop=()=>{this.setRecording(!1),this.chatInput.classList.remove("is-locked"),this.recordRippleEl.style.transform=""},this.recorder.ondataavailable=e=>{if(this.releaseMediaPlayback&&(this.releaseMediaPlayback(),this.releaseMediaPlayback=void 0),this.recordingOverlayListener&&(this.listenerSetter.remove(this.recordingOverlayListener),this.recordingOverlayListener=void 0),this.recordingNavigationItem&&(V.Z.removeItem(this.recordingNavigationItem),this.recordingNavigationItem=void 0),this.recordCanceled)return;const{peerId:t,threadId:i}=this.chat,s=this.replyToMsgId,n=(Date.now()-this.recordStartTime)/1e3|0,a=new Blob([e],{type:"audio/ogg"});r.Z.decode(e,!0).then((e=>{r.Z.setKeepAlive(!1),this.managers.appMessagesManager.sendFile(t,{file:a,isVoiceMessage:!0,isMedia:!0,duration:n,waveform:e.waveform,objectURL:e.url,replyToMsgId:s,threadId:i,clearDraft:!0}),this.onMessageSent(!1,!0)}))}),(0,S.fc)(this.replyElements.cancelBtn,this.onHelperCancel,{listenerSetter:this.listenerSetter}),(0,S.fc)(this.replyElements.container,this.onHelperClick,{listenerSetter:this.listenerSetter}),this.saveDraftDebounced=(0,Fe.Z)((()=>this.saveDraft()),2500,!1,!0),this.botStartBtn=(0,J.Z)("btn-primary btn-transparent text-bold chat-input-control-button"),this.botStartBtn.append((0,g.ag)("BotStart")),(0,S.fc)(this.botStartBtn,(()=>{const{startParam:e}=this;if(void 0===e)return;const t=this.toggleBotStartBtnDisability=(0,Je.Z)([this.botStartBtn],!0),i=this.chat.peerId,s=this.chat.bubbles.getMiddleware((()=>this.chat.peerId===i&&this.startParam===e&&this.toggleBotStartBtnDisability===t));this.managers.appMessagesManager.startBot(i.toUserId(),void 0,e).then((()=>{s()&&(t(),this.toggleBotStartBtnDisability=void 0,this.setStartParam())}))}),{listenerSetter:this.listenerSetter}),this.controlContainer.append(this.botStartBtn,this.replyInTopicOverlay),this.pinnedControlBtn=(0,J.Z)("btn-primary btn-transparent text-bold chat-input-control-button",{icon:"unpin"}),this.controlContainer.append(this.pinnedControlBtn),this.listenerSetter.add(this.pinnedControlBtn)("click",(()=>{const e=this.chat.peerId;new ae.Z(e,0,!0,(()=>{this.chat.appImManager.setPeer();const e=this.chat.appImManager.chat;e.topbar.pinnedMessage&&e.topbar.pinnedMessage.pinnedMessageContainer.toggle(!0)}))}))}_center(e,t){if(!e&&!this.inputContainer.classList.contains("is-centering"))return;if(e===this.fakeWrapperTo)return;const i=e||this.fakeWrapperTo,s=!!e,n=this.fakeWrapperTo;let a,o="",r="";const d=i.getBoundingClientRect(),l=this.fakeRowsWrapper.getBoundingClientRect(),c=l.width,h=d.width;if(c!==h){const e=h/c,t=(c-h)/2;if(a=d.left-l.left-t,s&&(o=`translateX(${a}px) scaleX(${e})`,e<1)){const t=16;r=t+t*(1-e)+"px"}}this.fakeWrapperTo=e;const u=t?200:0;return(0,K.Z)({element:this.inputContainer,className:"is-centering",forwards:s,duration:u}),(0,K.Z)({element:this.rowsWrapperWrapper,className:"is-centering-to-control",forwards:!!(s&&e&&e.classList.contains("chat-input-control")),duration:u}),this.rowsWrapper.style.transform=o,this.rowsWrapper.style.borderRadius=r,{transform:o,borderRadius:r,needTranslateX:n&&(e&&e.classList.contains("chat-input-control")&&n===this.fakeSelectionWrapper||n.classList.contains("chat-input-control"))?-.5*a:a,widthFrom:c,widthTo:h}}center(e=!1){return Rt(this,void 0,void 0,(function*(){return this._center(yield this.getNeededFakeContainer(),e)}))}setStartParam(e){this.startParam!==e&&(this.startParam=e,this.center(!0))}isReplyInTopicOverlayNeeded(){return this.chat.isForum&&!this.chat.isForumTopic&&!this.replyToMsgId&&"chat"===this.chat.type}getNeededFakeContainer(e=this.startParam){return Rt(this,void 0,void 0,(function*(){return this.chat.selection.isSelecting?this.fakeSelectionWrapper:void 0!==e||"pinned"===this.chat.type||(yield this.chat.isStartButtonNeeded())||this.isReplyInTopicOverlayNeeded()?this.controlContainer:void 0}))}getReadyToSend(e){return"scheduled"===this.chat.type?(this.scheduleSending(e),!0):(e(),!1)}setUnreadCount(){return Rt(this,void 0,void 0,(function*(){if(!this.goDownUnreadBadge)return;const e=yield this.managers.dialogsStorage.getDialogOrTopic(this.chat.peerId,"discussion"===this.chat.type?void 0:this.chat.threadId),t=null==e?void 0:e.unread_count;if(this.goDownUnreadBadge.innerText=""+(t||""),this.goDownUnreadBadge.classList.toggle("badge-gray",yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:this.chat.peerId,respectType:!0,threadId:this.chat.threadId})),this.goMentionUnreadBadge&&"chat"===this.chat.type){const t=!(!(null==e?void 0:e.unread_mentions_count)||!e.unread_count);this.goMentionUnreadBadge.innerText=t?""+e.unread_mentions_count:"",this.goMentionBtn.classList.toggle("is-visible",t)}}))}getCurrentInputAsDraft(e){const{value:t,entities:i}=(0,C.Z)(this.messageInputField.input,!0,!1);let s;return(t.length||e||this.replyToMsgId)&&(s={_:"draftMessage",date:(0,oe.Z)(!0),message:t,entities:i.length?i:void 0,pFlags:{no_webpage:this.noWebPage},reply_to_msg_id:this.replyToMsgId}),s}saveDraft(){if(!this.chat.peerId||this.editMsgId||"scheduled"===this.chat.type)return;const e=this.getCurrentInputAsDraft();this.managers.appDraftsManager.syncDraft(this.chat.peerId,this.chat.threadId,e)}destroy(){this.listenerSetter.removeAll()}cleanup(e=!0){this.chat.peerId||(this.chatInput.classList.add("hide"),this.goDownBtn.classList.add("hide")),(0,ce.Z)(),this.lastTimeType=0,this.startParam=void 0,this.toggleBotStartBtnDisability&&(this.toggleBotStartBtnDisability(),this.toggleBotStartBtnDisability=void 0),this.messageInput&&(this.clearInput(),e&&this.clearHelper())}setDraft(e,t=!0,i=!1){return Rt(this,void 0,void 0,(function*(){if(!i&&!(0,y.Z)(this.messageInput)||"scheduled"===this.chat.type)return!1;if(!e&&!(e=yield this.managers.appDraftsManager.getDraft(this.chat.peerId,this.chat.threadId)))return i&&(this.chat.container.classList.contains("is-helper-active")&&this.t(),this.messageInputField.inputFake.textContent="",this.messageInputField.onFakeInput(!1),(this.chat.bubbles.messagesQueuePromise||Promise.resolve()).then((()=>{(0,Ke.T2)((()=>{this.onMessageSent()}))}))),!1;const s=function(e,t,i){const s=(0,ot.Z)(e.message),n=e.entities||[],a=(0,at.Z)(n.slice(),s);return(0,dt.Z)(e.message,{entities:a,wrappingForPeerId:t,loadPromises:void 0})}(e,this.chat.peerId),n=this.getCurrentInputAsDraft();return!((0,Pt.Z)(e,n)&&this.replyToMsgId===e.reply_to_msg_id||(t&&this.clearHelper(),this.noWebPage=e.pFlags.no_webpage,e.reply_to_msg_id&&this.initMessageReply(e.reply_to_msg_id),this.setInputValue(s,t,t),0))}))}createSendAs(){if(this.sendAsPeerId=void 0,"chat"===this.chat.type||"discussion"===this.chat.type){let e=!0;this.sendAs=new yt(this.managers,((e,t)=>{let i=0;e.parentElement||(this.newMessageWrapper.prepend(e),i=2),this.updateOffset("as",!0,t,i)}),(t=>{this.sendAsPeerId=t,e?e=!1:this.getPlaceholderKey().then((e=>{this.updateMessageInputPlaceholder(e)}))}))}else this.sendAs=void 0;return this.sendAs}finishPeerChange(e){return Rt(this,void 0,void 0,(function*(){const t=this.chat.peerId,{forwardElements:i,btnScheduled:s,replyKeyboard:n,sendMenu:a,goDownBtn:o,chatInput:r,botCommandsToggle:d}=this,l=this.sendAs,c=this.createSendAs(),[h,u,p,f,m,v,b,y,w,S]=yield Promise.all([this.managers.appPeersManager.isBroadcast(t),this.managers.appPeersManager.canPinMessage(t),this.managers.appPeersManager.isBot(t),this.chat.canSend("send_messages"),this.chat.canSend("send_plain"),this.getNeededFakeContainer(e),ft(this.managers.acknowledged.appProfileManager.getProfileByPeerId(t)),s?ft(this.managers.acknowledged.appMessagesManager.getScheduledMessages(t)):void 0,c?(c.setPeerId(this.chat.peerId),c.updateManual(!0)):void 0,this.filterAttachMenuButtons()]),C=this.messageInput?yield this.getPlaceholderKey(m):void 0;return()=>{var c;if(r.classList.remove("hide"),o.classList.toggle("is-broadcast",h),o.classList.remove("hide"),this.goDownUnreadBadge&&this.setUnreadCount(),"pinned"===this.chat.type&&r.classList.toggle("can-pin",u),i&&(this.forwardWasDroppingAuthor=!1,i.showCaption.checkboxField.setValueSilently(!0),i.showSender.checkboxField.setValueSilently(!0)),s&&y){s.classList.add("hide");const e=this.chat.bubbles.getMiddleware();(0,et.Z)(y.result,(t=>{e()&&t&&s.classList.toggle("hide",!t.length)}))}if(this.newMessageWrapper&&this.updateOffset(null,!1,!0),d&&(this.hasBotCommands=void 0,this.botCommands.toggle(!0,void 0,!0),this.updateBotCommandsToggle(!0),d.remove(),p)){const e=this.chat.bubbles.getMiddleware(),t=b.result;(0,et.Z)(t,(i=>{e()&&this.updateBotCommands(i,!(t instanceof Promise))}))}null==l||l.destroy(),null==w||w(),null==n||n.setPeer(t),null==a||a.setPeerId(t),this.messageInput&&(this.updateMessageInput(f,m,C,S),this.messageInput.dataset.peerId=""+t),null===(c=this.messageInputField)||void 0===c||c.onFakeInput(void 0,!0);let L=!1;if(this.pinnedControlBtn){const e="pinned"===this.chat.type;L||(L=e),this.pinnedControlBtn.classList.toggle("hide",!e),this.pinnedControlBtn.replaceChildren((0,g.ag)(u?"Chat.Input.UnpinAll":"Chat.Pinned.DontShow"))}{const e=this.chat.isForum&&!this.chat.isForumTopic&&"chat"===this.chat.type;L||(L=e),this.replyInTopicOverlay.classList.toggle("hide",!e)}this.botStartBtn.classList.toggle("hide",L),this.startParam=e,this._center(v,!1)}}))}updateOffset(e,t,i,s){e?this.newMessageWrapper.dataset.offset=e:delete this.newMessageWrapper.dataset.offset,(0,K.Z)({element:this.newMessageWrapper,className:"has-offset",forwards:t,duration:i?0:300,useRafs:s})}updateBotCommands(e,t){var i,s;this.hasBotCommands=!!(null===(s=null===(i=e.bot_info)||void 0===i?void 0:i.commands)||void 0===s?void 0:s.length),this.updateBotCommandsToggle(t)}updateBotCommandsToggle(e){const{botCommandsToggle:t,hasBotCommands:i}=this,s=!!i&&this.isInputEmpty();if(!i){if(!t.parentElement)return;t.remove()}const n=s,a=t.parentElement?0:2;t.parentElement||this.newMessageWrapper.prepend(t),this.updateOffset("commands",n,e,a)}getPlaceholderKey(e){return Rt(this,void 0,void 0,(function*(){null!=e||(e=yield this.chat.canSend("send_plain"));const{peerId:t,threadId:i,isForum:s}=this.chat;let n;return n=e?i&&!s?"Comment":(yield this.managers.appPeersManager.isBroadcast(t))?"ChannelBroadcast":void 0!==this.sendAsPeerId&&this.sendAsPeerId!==x.Z.myId||(yield this.managers.appMessagesManager.isAnonymousSending(t))?"SendAnonymously":"Message":"Channel.Persmission.MessageBlock",n}))}updateMessageInputPlaceholder(e){const t=g.ZP.weakMap.get(this.messageInput);if(!t)return;const i=t.key;return t.compareAndUpdate({key:e}),{oldKey:i,newKey:e}}filterAttachMenuButtons(){if(this.attachMenuButtons)return(0,wt.Z)(this.attachMenuButtons,(e=>!e.verify||e.verify()))}updateMessageInput(e,t,i,s){const{chatInput:n,attachMenu:a,messageInput:o}=this;n.classList.contains("is-hidden")!==!e&&(n.classList.add("no-transition"),n.classList.toggle("is-hidden",!e),n.offsetLeft,n.classList.remove("no-transition"));const r=e&&!t&&this.restoreInputLock;!r&&this.updateMessageInputPlaceholder(i),r?this.restoreInputLock=()=>{this.updateMessageInputPlaceholder(i),this.messageInput.contentEditable="false"}:e&&t?(this.restoreInputLock=void 0,o.contentEditable="true",this.setDraft(void 0,!1),o.innerHTML||this.messageInputField.onFakeInput(void 0,!0)):(o.contentEditable="false",t||this.messageInputField.onFakeInput(void 0,!0)),a&&(a.toggleAttribute("disabled",!s.length),a.classList.toggle("btn-disabled",!s.length)),this.updateSendBtn()}attachMessageInputField(){const e=this.messageInputField;this.messageInputField=new St.Z({placeholder:"Message",name:"message",withLinebreaks:!0}),this.messageInputField.input.tabIndex=-1,this.messageInputField.input.classList.replace("input-field-input","input-message-input"),this.messageInputField.inputFake.classList.replace("input-field-input","input-message-input"),this.messageInput=this.messageInputField.input,this.attachMessageInputListeners(),$e.T&&(0,$e.Z)(this.messageInput),e?(e.input.replaceWith(this.messageInputField.input),e.inputFake.replaceWith(this.messageInputField.inputFake)):this.inputMessageContainer.append(this.messageInputField.input,this.messageInputField.inputFake)}attachMessageInputListeners(){this.listenerSetter.add(this.messageInput)("keydown",(e=>{const t=e.key;if((0,he.Z)(e))(0,b.Z)(e),this.sendMessage();else if(e.ctrlKey||e.metaKey)this.handleMarkdownShortcut(e);else if(("PageUp"===t||"PageDown"===t)&&!e.shiftKey)if(e.preventDefault(),"PageUp"===t){const e=document.createRange(),t=window.getSelection();e.setStart(this.messageInput.childNodes[0]||this.messageInput,0),e.collapse(!0),t.removeAllRanges(),t.addRange(e)}else(0,ue.Z)(this.messageInput)})),(0,S.fc)(this.messageInput,(e=>{this.canSendPlain()||(0,Z.bC)({langPackKey:Bt.send_plain})}),{listenerSetter:this.listenerSetter}),o.Z&&(0,S.fc)(this.messageInput,(e=>{if(l.ZP.isActive())return l.ZP.toggle(!1),(0,le.Z)(),void(0,b.Z)(e);this.appImManager.selectTab(s.oo.CHAT)}),{listenerSetter:this.listenerSetter}),this.listenerSetter.add(this.messageInput)("input",this.onMessageInput),this.listenerSetter.add(this.messageInput)("keyup",(()=>{this.checkAutocomplete()})),this.listenerSetter.add(this.messageInput)("focusin",(()=>{"chat"!==this.chat.type&&"discussion"!==this.chat.type||!this.chat.bubbles.scrollable.loadedAll.bottom||this.managers.appMessagesManager.readAllHistory(this.chat.peerId,this.chat.threadId)}))}canSendPlain(){return!(!this.messageInput.isContentEditable&&!this.chatInput.classList.contains("is-hidden"))}applyMarkdown(e,t){var i;const s={link:t?()=>document.execCommand("createLink",!1,t):()=>document.execCommand("unlink",!1,null)},n=e=>{s[e]=()=>{const t=(a.includes(e)?a:[e]).filter((e=>c[e]));return(0,mt.Z)(t,e)||t.push(e),t.length?document.execCommand("fontName",!1,"markup-"+t.join("-")):this.resetCurrentFontFormatting()}},a=["bold","italic","underline","strikethrough","spoiler"];if(a.forEach((e=>{n(e)})),n("monospace"),!s[e])return!1;const o=s[e],r=[],d=Zt.Z.getInstance().prepareApplyingMarkdown(),l=this.listenerSetter.add(this.messageInput)("input",b.Z,{capture:!0,passive:!1});r.push(document.execCommand("styleWithCSS",!1,"true"));const c=(0,Mt.Z)(Object.keys(s));return c.monospace&&"link"===e&&r.push(this.resetCurrentFormatting()),r.push("function"==typeof o?o():document.execCommand(o,!1,null)),r.push(document.execCommand("styleWithCSS",!1,"false")),d(),null===(i=this.appImManager.markupTooltip)||void 0===i||i.setActiveMarkupButton(),this.listenerSetter.remove(l),this.messageInputField.simulateInputEvent(),!0}resetCurrentFormatting(){return document.execCommand("removeFormat",!1,null)}resetCurrentFontFormatting(){return document.execCommand("fontName",!1,"Roboto")}insertAtCaret(e,t,i=!0){if(!this.canSendPlain())return void(0,Z.bC)({langPackKey:Bt.send_plain});Zt.Z.getInstance().makeFocused(this.messageInput);const{value:s,caretPos:n,entities:a}=(0,C.Z)(this.messageInput),o=n>=0?n:s.length,r=s.substr(0,o),d=(s.substr(o),i?r.match(Nt.AUTO_COMPLETE_REG_EXP):null),l=d?d.index+(d[0].length-d[2].length):r.length;if(r.slice(0,l),i&&-1!==n){const e=d[2],t=document.getSelection();let i=0;for(;t.toString()!==e;){if(++i>=1e4)throw new Error("lolwhat");t.modify("extend","backward","character")}}(0,u.rf)(this.messageInput,e,t?[t]:void 0,this.chat.peerId)}checkAutocomplete(e,t,i){return Rt(this,void 0,void 0,(function*(){const s=void 0!==e;if(!s){const s=(0,C.Z)(this.messageInputField.input,!0,!0);e=s.value,t=s.caretPos,i=s.entities}if(-1===t&&(t=e.length),void 0===i||!s){const t=(0,rt.Z)(e,i,!0);i=(0,at.Z)(i,(0,ot.Z)(t))}if(e=e.slice(0,t),this.previousQuery===e)return;this.previousQuery=e;const n=e.match(Nt.AUTO_COMPLETE_REG_EXP);let a,o;if(n){const t=i[0];let s=n[2];const o=s[0];if(this.stickersHelper&&"none"!==x.Z.settings.stickers.suggest&&(yield this.chat.canSend("send_stickers"))&&"messageEntityEmoji"===(null==t?void 0:t._)&&t.length===e.length&&!t.offset)a=this.stickersHelper,this.stickersHelper.checkEmoticon(e);else if("@"===o){const e=this.chat.threadId?(0,ct.Z)(this.chat.threadId):void 0;(yield this.mentionsHelper.checkQuery(s,this.chat.peerId.isUser()?Qe.NM:this.chat.peerId,e))&&(a=this.mentionsHelper)}else n[1]||"/"!==o?x.Z.settings.emoji.suggest&&(s=s.replace(/^\s*/,""),e.match(/^\s*:(.+):\s*$/)||e.match(/:[;!@#$%^&*()-=|]/)||!s||(a=this.emojiHelper,this.emojiHelper.checkQuery(s,o))):(yield this.commandsHelper.checkQuery(s,this.chat.peerId))&&(a=this.commandsHelper)}a||(o=yield this.chat.canSend("send_inline")),a=this.checkInlineAutocomplete(e,o,a),this.autocompleteHelperController.hideOtherHelpers(a)}))}checkInlineAutocomplete(e,t,i){let s=!1;const n=e=>{this.btnPreloader&&(e&&!t&&(e=!1),(0,K.Z)({element:this.btnPreloader,className:"show",forwards:e,duration:400}))};if(!i){const a=e.match(/^@([a-zA-Z\\d_]{3,32})\s/);if(a){const o=a[1],r=e.slice(a[0].length);s=a[0].length===e.length,i=this.inlineHelper,this.btnPreloader?n(!0):(this.btnPreloader=this.createButtonIcon("none btn-preloader float show disable-hover",{noRipple:!0}),(0,Ve.y)(this.btnPreloader,!0),this.inputMessageContainer.parentElement.insertBefore(this.btnPreloader,this.inputMessageContainer.nextSibling)),this.inlineHelper.checkQuery(this.chat.peerId,o,r,t).then((({user:e,renderPromise:t})=>{s&&e.bot_inline_placeholder&&(this.messageInput.dataset.inlinePlaceholder=e.bot_inline_placeholder),t.then((()=>{n(!1)}))})).catch((e=>{n(!1)}))}}return s||delete this.messageInput.dataset.inlinePlaceholder,i!==this.inlineHelper&&n(!1),i}setRecording(e){this.recording!==e&&((0,K.Z)({element:this.chatInput,className:"is-recording",forwards:e,duration:200}),this.recording=e,this.updateSendBtn())}changeForwardRecipient(){if(this.helperWaitingForward)return;this.helperWaitingForward=!0;const e=(0,it.Z)(this.forwarding),t=this.helperFunc;this.clearHelper(),this.updateSendBtn();let i=!1;new I.Z(e,(()=>{i=!0})).addEventListener("close",(()=>{this.helperWaitingForward=!1,i||t()}))}clearInput(e=!0,t=!0,i=""){return Rt(this,void 0,void 0,(function*(){if(document.activeElement===this.messageInput&&G.IS_MOBILE_SAFARI){const e=document.createElement("input");document.body.append(e),(0,Pe.Z)(e),this.messageInputField.setValueSilently(i),(0,Pe.Z)(this.messageInput),e.remove()}else this.messageInputField.setValueSilently(i);o.Z||(this.canRedoFromHTML="",this.undoHistory.length=0,this.executedHistory.length=0,this.canUndoFromHTML="");let s=!1;e&&(s=yield this.setDraft(void 0,!1)),!s&&t&&this.onMessageInput()}))}isInputEmpty(){return(0,y.Z)(this.messageInput)}updateSendBtn(){let e;const t=this.isInputEmpty();e=this.editMsgId?"edit":!this.recorder||this.recording||!t||this.forwarding?"scheduled"===this.chat.type?"schedule":"send":"record",["send","record","edit","schedule"].forEach((t=>{this.btnSend.classList.toggle(t,e===t)})),this.btnScheduled&&this.btnScheduled.classList.toggle("show",t&&"scheduled"!==this.chat.type),this.btnToggleReplyMarkup&&this.btnToggleReplyMarkup.classList.toggle("show",t&&"scheduled"!==this.chat.type)}getValueAndEntities(e){const{entities:t,value:i}=(0,C.Z)(e,!0,!1),s=(0,ot.Z)(i);return{value:i,totalEntities:(0,at.Z)(t,s)}}onMessageSent(e=!0,t){"scheduled"!==this.chat.type&&this.managers.appMessagesManager.readAllHistory(this.chat.peerId,this.chat.threadId,!0),this.scheduleDate=void 0,this.sendSilent=void 0;const{totalEntities:i}=this.getValueAndEntities(this.messageInput);let s=0;i.filter((e=>{if("messageEntityEmoji"===e._||"messageEntityCustomEmoji"===e._){const t=e.offset+e.length;return!(t<=s||(s=t,0))}return!1})).forEach((e=>{const t="messageEntityEmoji"===e._?{emoji:(0,ut.zu)(e.unicode)}:{docId:e.document_id,emoji:""};this.managers.appEmojiManager.pushRecentEmoji(t)})),e&&(this.lastUrl="",delete this.noWebPage,this.willSendWebPage=null,this.clearInput()),(t||e)&&this.clearHelper(),this.updateSendBtn()}sendMessage(e=!1){const{editMsgId:t,chat:i}=this;if("scheduled"===i.type&&!e&&!t)return void this.scheduleSending();const{peerId:s}=i,{noWebPage:n}=this,a=this.chat.getMessageSendingParams(),{value:o,entities:r}=(0,C.Z)(this.messageInputField.input,!0,!1);if(t){const e=this.editMessage;if(!o.trim()&&!e.media)return void new We.Z(s,[t],i.type);this.managers.appMessagesManager.editMessage(e,o,{entities:r,noWebPage:n}),this.onMessageSent()}else o.trim()&&(this.managers.appMessagesManager.sendText(s,o,Object.assign(Object.assign({entities:r},a),{noWebPage:n,webPage:this.getWebPagePromise?void 0:this.willSendWebPage,clearDraft:!0})),"scheduled"===this.chat.type?this.onMessageSent(!0):this.onMessageSent(!1,!1));if(this.forwarding){const e=(0,it.Z)(this.forwarding);for(const t in e)this.managers.appMessagesManager.forwardMessages(s,t.toPeerId(),e[t],Object.assign(Object.assign({},a),{dropAuthor:this.forwardElements&&this.forwardElements.hideSender.checkboxField.checked,dropCaptions:this.isDroppingCaptions()})).catch((e=>Rt(this,void 0,void 0,(function*(){"VOICE_MESSAGES_FORBIDDEN"===e.type&&(0,Z.bC)({langPackKey:"Chat.SendVoice.PrivacyError",langPackArguments:[yield(0,Et.Z)({peerId:s})]})}))));o||this.onMessageSent()}}sendMessageWithDocument(e,t=!1,i=!1,s=!1){return Rt(this,void 0,void 0,(function*(){const n="sticker"===(e=yield this.managers.appDocsManager.getDoc(e)).type?"send_stickers":"gif"===e.type?"send_gifs":"send_media";return this.chat.peerId.isAnyChat()&&!(yield this.chat.canSend(n))?((0,Z.bC)({langPackKey:Bt[n]}),!1):"scheduled"!==this.chat.type||t?!(!e||e.sticker&&(0,Ct.Z)(e)&&!x.Z.premium||(this.managers.appMessagesManager.sendFile(this.chat.peerId,Object.assign(Object.assign({},this.chat.getMessageSendingParams()),{file:e,isMedia:!0,clearDraft:i,silent:s})),this.onMessageSent(i,!0),"sticker"===e.type&&this.managers.appStickersManager.saveRecentSticker(e.id),0)):(this.scheduleSending((()=>this.sendMessageWithDocument(e,!0,i,s))),!1)}))}canToggleHideAuthor(){const{forwardElements:e}=this;if(!e)return!1;const t=e.hideCaption.checkboxField;return!t.checked||(0,v.Z)(t.label,"FORM").classList.contains("hide")}isDroppingCaptions(){return!this.canToggleHideAuthor()}initMessageEditing(e){return Rt(this,void 0,void 0,(function*(){const t=yield this.chat.getMessage(e);let i=(0,dt.Z)(t.message,{entities:t.totalEntities,wrappingForPeerId:this.chat.peerId});const s=()=>Rt(this,void 0,void 0,(function*(){let n;if(!this.messageInput.isContentEditable){const e=yield this.getPlaceholderKey(!0),{contentEditable:t}=this.messageInput;this.messageInput.contentEditable="true";const{oldKey:i}=this.updateMessageInputPlaceholder(e);n=()=>{this.messageInput.contentEditable=t,this.updateMessageInputPlaceholder(i)}}const a=yield(0,lt.Z)({message:t,usingMids:[t.mid]});this.setTopInfo("edit",s,(0,g.ag)("AccDescrEditing"),a,i,t),this.editMsgId=e,this.editMessage=t,i=void 0,this.restoreInputLock=n}));s()}))}initMessagesForward(e){const t=()=>Rt(this,void 0,void 0,(function*(){const i=Object.keys(e).map((e=>e.toPeerId())),s=new Set;let n=0,a=0;const o=i.map((t=>Rt(this,void 0,void 0,(function*(){const i=e[t],o=i.map((e=>Rt(this,void 0,void 0,(function*(){var i;const n=yield this.managers.appMessagesManager.getMessageByPeer(t,e);!(null===(i=n.fwd_from)||void 0===i?void 0:i.from_name)||n.fromId||n.fwdFromId?s.add("P"+n.fromId):s.add("N"+n.fwd_from.from_name),n.media&&n.message&&++a}))));yield Promise.all(o),n+=i.length}))));yield Promise.all(o);const r=s.size>2,d=[...s].map((e=>{const t=e[0];if(e=e.slice(1),"P"===t){const t=e.toPeerId();return t===x.Z.myId?(0,g.ag)("Chat.Accessory.Forward.You"):new be.Z({peerId:t,dialog:!1,onlyFirstName:r}).element}return r?e.split(" ")[0]:e})),{forwardElements:l}=this;(0,v.Z)(l.showCaption.checkboxField.label,"FORM").classList.toggle("hide",!a);const c=l.hideCaption.checkboxField.checked;a&&c?l.hideSender.checkboxField.setValueSilently(!0):void 0!==this.forwardWasDroppingAuthor&&(this.forwardWasDroppingAuthor?l.hideSender:l.showSender).checkboxField.setValueSilently(!0);const h=l.showSender.checkboxField.checked?"Chat.Accessory.Forward":"Chat.Accessory.Hidden",u=(0,g.ag)(h,[n]),p=document.createDocumentFragment();let f,m;if(d.length<3?p.append(...(0,g.v_)(d,!1)):p.append(d[0],(0,g.ag)("AndOther",[d.length-1])),1===i.length){const t=i[0],s=e[t];if(f=yield this.managers.appMessagesManager.getMessageByPeer(t,s[0]),m=!!f.grouped_id,m){const e=yield this.managers.appMessagesManager.getMidsByMessage(f);(e.length!==n||e.find((e=>!s.includes(e))))&&(m=!1)}}const b=document.createDocumentFragment();if(m||1===n){const t=e[i[0]],s=yield(0,lt.Z)({message:f,usingMids:t});b.append(p,": ",s)}else b.append((0,g.ag)("Chat.Accessory.Forward.From"),": ",p);const y=this.setTopInfo("forward",t,u,b);l.modifyArgs.forEach(((e,t)=>{const s=e.textElement,n=g.ZP.weakMap.get(s);n.args=[t<2?i.length:a],n.update()})),this.forwardHover&&this.forwardHover.attachButtonListener(y,this.listenerSetter),this.forwarding=e}));t()}initMessageReply(e){return Rt(this,void 0,void 0,(function*(){if(this.replyToMsgId===e)return;let t=yield this.chat.getMessage(e);const i=()=>{let s;t?s=new be.Z({peerId:t.fromId,dialog:!1}).element:(s=(0,g.ag)("Loading"),this.managers.appMessagesManager.reloadMessages(this.chat.peerId,e).then((s=>{this.replyToMsgId===e&&(t=s,t?i():this.clearHelper("reply"))}))),this.setTopInfo("reply",i,s,t&&t.message,void 0,t),this.setReplyToMsgId(e)};i()}))}setReplyToMsgId(e){this.replyToMsgId=e,this.center(!0)}clearHelper(e){var t;"edit"===this.helperType&&"edit"!==e&&this.clearInput(),e&&(this.lastUrl="",delete this.noWebPage,this.willSendWebPage=null),"reply"!==e&&(this.setReplyToMsgId(void 0),this.forwarding=void 0),this.editMsgId=this.editMessage=void 0,this.helperType=this.helperFunc=void 0,this.restoreInputLock&&(null===(t=this.restoreInputLock)||void 0===t||t.call(this),this.restoreInputLock=void 0),this.chat.container.classList.contains("is-helper-active")&&(V.Z.removeByType("input-helper"),this.chat.container.classList.remove("is-helper-active"),this.t())}t(){const e="is-toggling-helper";(0,K.Z)({element:this.chat.container,className:e,forwards:!0,duration:150,onTransitionEnd:()=>{this.chat.container.classList.remove(e)}})}setInputValue(e,t=!0,i=!0){e||(e=""),t?this.clearInput(!1,!1,e):this.messageInputField.setValueSilently(e),(0,Ke.T2)((()=>{i&&(0,ue.Z)(this.messageInput),this.onMessageInput(),this.messageInput.scrollTop=this.messageInput.scrollHeight}))}setTopInfo(e,t,i="",s="",n,a){if(this.willSendWebPage&&"reply"===e)return;"webpage"!==e&&(this.clearHelper(e),this.helperType=e,this.helperFunc=t);const o=this.replyElements.container,r=o.lastElementChild.previousElementSibling,d=r.classList.contains("reply");this.replyElements.iconBtn.replaceWith(this.replyElements.iconBtn=this.createButtonIcon(("webpage"===e?"link":e)+" active reply-icon",{noRipple:!0}));const{container:l}=(0,It.Z)(i,s,this.chat.animationGroup,a);return d?r.replaceWith(l):o.insertBefore(l,o.lastElementChild),"webpage"===e&&(l.style.cursor="default"),this.chat.container.classList.contains("is-helper-active")||(this.chat.container.classList.add("is-helper-active"),this.t()),G.IS_MOBILE||V.Z.pushItem({type:"input-helper",onPop:()=>{this.onHelperCancel()}}),void 0!==n&&this.setInputValue(n),setTimeout((()=>{this.updateSendBtn()}),0),l}}Nt.AUTO_COMPLETE_REG_EXP=/(\s|^)((?:(?:@|^\/)\S*)|(?::|^[^:@\/])(?!.*[:@\/]).*)$/},2482:(e,t,i)=>{"use strict";i.d(t,{U7:()=>b,ZP:()=>y});var s=i(6654),n=i(2559),a=i(2946),o=i(3512),r=i(9099),d=i(2149),l=i(3541),c=i(9083),h=i(6775),u=i(9405),p=i(3035),f=i(319),m=i(5994);const g="reaction",v=g+"-element",b=4;class y extends HTMLElement{constructor(){super(),this.classList.add(g),this.managers=o.Z.managers}get reactionCount(){return this._reactionCount}set reactionCount(e){this._reactionCount=e}get count(){return this.reactionCount.count}init(e,t){this.type=e,this.classList.add(g+"-"+e),this.middleware=t}setCanRenderAvatars(e){this.canRenderAvatars=e}render(e){const t=!!this.stickerContainer;t||(this.stickerContainer=document.createElement("div"),this.stickerContainer.classList.add(g+"-sticker"),this.append(this.stickerContainer));const i=this.reactionCount;if(!e&&!t){const e=i.reaction;if("reactionEmoji"===e._){const t=this.managers.appReactionsManager.getReaction(e.emoticon);(0,s.Z)(t,(e=>{var t;e.center_icon||this.stickerContainer.classList.add("is-static"),e.pFlags.inactive&&this.classList.add("is-inactive"),this.renderDoc(null!==(t=e.center_icon)&&void 0!==t?t:e.static_icon)}))}else if("reactionCustomEmoji"===e._){this.stickerContainer.classList.add("is-custom");const t=(0,c.Z)({docIds:[e.document_id],customEmojiSize:(0,u.C)(22,22)});this.stickerContainer.append(t)}}}renderDoc(e){const t="inline"===this.type?14:22,i=this.wrapStickerPromise=(0,l.ZP)({div:this.stickerContainer,doc:e,width:t,height:t,static:!0,managers:this.managers,middleware:this.middleware}).then((({render:e})=>e)).finally((()=>{this.wrapStickerPromise===i&&(this.wrapStickerPromise=void 0)}))}renderCounter(){var e;const t=this.reactionCount,i="inline"===this.type?2:b;if(t.count>=i||"block"===this.type&&!this.canRenderAvatars){this.counter||(this.counter=document.createElement("inline"===this.type?"i":"span"),this.counter.classList.add(g+"-counter"));const e=(0,n.Z)(t.count);this.counter.textContent!==e&&(this.counter.textContent=e),this.counter.parentElement||this.append(this.counter)}else(null===(e=this.counter)||void 0===e?void 0:e.parentElement)&&(this.counter.remove(),this.counter=void 0)}renderAvatars(e){"inline"!==this.type&&(this.reactionCount.count>=b||!this.canRenderAvatars?this.stackedAvatars&&(this.stackedAvatars.container.remove(),this.stackedAvatars=void 0):(this.stackedAvatars||(this.stackedAvatars=new d.Z({avatarSize:24}),this.append(this.stackedAvatars.container)),this.stackedAvatars.render(e.map((e=>(0,a.Z)(e.peer_id))))))}setIsChosen(e=void 0!==this.reactionCount.chosen_order){"inline"!==this.type&&(this.classList.contains("is-chosen")&&!this.classList.contains("backwards"))!==e&&(0,r.Z)({element:this,className:"is-chosen",forwards:e,duration:this.isConnected?300:0})}fireAroundAnimation(){if(!m.Z.isAvailable("effects_reactions"))return;const e=this.reactionCount.reaction;"reactionEmoji"===e._&&(0,s.Z)(this.managers.appReactionsManager.getReaction(e.emoticon),(e=>{const t="inline"===this.type?28:40,i=document.createElement("div");i.classList.add(g+"-sticker-activate"),Promise.all([(0,l.ZP)({div:i,doc:e.center_icon,width:t,height:t,withThumb:!1,needUpscale:!0,play:!1,skipRatio:1,group:"none",needFadeIn:!1,managers:this.managers,middleware:this.middleware}).then((({render:e})=>e)),(0,h.Z)({doc:e.around_animation,size:80,target:this.stickerContainer,side:"center",skipRatio:1,play:!1,managers:this.managers,middleware:this.middleware}).stickerPromise.catch(f.Z)]).then((([e,t])=>{const s=()=>{e.remove(),i.remove(),this.stickerContainer.classList.remove("has-animation")};if(!t)return void s();const n=()=>{(0,p.T2)(s)};e.addEventListener("enterFrame",(t=>{t===e.maxFrame&&(this.wrapStickerPromise?this.wrapStickerPromise.then((()=>{setTimeout(n,1e3)})):n())})),e.addEventListener("firstFrame",(()=>{this.stickerContainer.append(i),this.stickerContainer.classList.add("has-animation"),e.play(),t.play()}),{once:!0})}))}))}}customElements.define(v,y)},8947:(e,t,i)=>{"use strict";i.d(t,{G:()=>h,Z:()=>u});var s=i(7625),n=i(4484),a=i(6219),o=i(5285),r=i(3512),d=i(2482);const l="reactions",c=l+"-element",h=new Map;class u extends HTMLElement{constructor(){super(),this.classList.add(l),this.sorted=[],this.middlewareHelpers=new Map,this.managers=r.Z.managers}connectedCallback(){let e=h.get(this.key);e||h.set(this.key,e=new Set),e.add(this),this.onConnectCallback&&this.isConnected&&(this.onConnectCallback(),this.onConnectCallback=void 0)}disconnectedCallback(){const e=h.get(this.key);e.delete(this),e.size||h.delete(this.key)}getReactionCount(e){return this.sorted[this.sorted.indexOf(e)].reactionCount}getMessage(){return this.message}init(e,t,i,s=this.isPlaceholder){void 0!==this.key&&this.disconnectedCallback(),this.middleware!==i&&i.onDestroy((()=>{this.middlewareHelpers.clear()})),this.message=e,this.key=this.message.peerId+"_"+this.message.mid,this.middleware=i,this.isPlaceholder=s,this.type!==t&&(this.type=t,this.classList.add(l+"-"+t)),this.connectedCallback()}changeMessage(e){return this.init(e,this.type,this.middleware)}update(e,t){this.message=e,this.render(t)}render(e){const t=this.message.reactions,i=!(!t||!t.results.length);if(this.classList.toggle("has-no-reactions",!i),!i&&!this.sorted.length)return;this.managers.appReactionsManager.getAvailableReactions();const a=i?t.results:[];a.sort(((e,t)=>{var i,s;return t.count-e.count||(null!==(i=e.chosen_order)&&void 0!==i?i:0)-(null!==(s=t.chosen_order)&&void 0!==s?s:0)})),(0,s.Z)(this.sorted,((e,t,i)=>{const s=e.reactionCount.reaction;a.some((e=>(0,o.Z)(e.reaction,s)))||(this.middlewareHelpers.get(e).destroy(),this.middlewareHelpers.delete(e),i.splice(t,1),e.remove())}));const r=a.reduce(((e,t)=>e+t.count),0),l=t&&(!!t.pFlags.can_see_list||this.message.peerId.isUser())&&r{let s=this.sorted.find((t=>(0,o.Z)(t.reactionCount.reaction,e.reaction)));if(!s){const e=this.middleware.create();s=new d.ZP,s.init(this.type,e.get()),this.middlewareHelpers.set(s,e)}(0,n.Z)(s,this,i);const a=t.recent_reactions?t.recent_reactions.filter((t=>(0,o.Z)(t.reaction,e.reaction))):[];return s.reactionCount=Object.assign({},e),s.setCanRenderAvatars(l),s.render(this.isPlaceholder),s.renderCounter(),s.renderAvatars(a),s.setIsChosen(),s})),!this.isPlaceholder&&(null==e?void 0:e.length)&&(this.isConnected?this.handleChangedResults(e):this.onConnectCallback=()=>{this.handleChangedResults(e)}),!this.sorted.length&&"block"===this.type){const e=this.parentElement;if(this.remove(),e.classList.contains("document-message")&&!e.childNodes.length)return void e.remove();const t=this.querySelector(".time");t&&e.append(t)}}handleChangedResults(e){this.message.peerId===a.ZP.chat.peerId&&e.forEach((e=>{const t=this.sorted.find((t=>(0,o.Z)(t.reactionCount.reaction,e.reaction)));null==t||t.fireAroundAnimation()}))}}customElements.define(c,u)},3484:(e,t,i)=>{"use strict";i.d(t,{Z:()=>g,o:()=>m});var s=i(5565),n=i(8456),a=i(6219),o=i(7030),r=i(8115),d=i(4561),l=i(496),c=i(9492),h=i(3541),u=i(2887),p=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const f=32;function m(e){var t;return p(this,void 0,void 0,(function*(){let{title:i,titleEl:d,subtitle:p,subtitleEl:m,mediaEl:g,message:v,loadPromises:b,animationGroup:y}=e;void 0!==i&&("string"==typeof i&&(i=(0,n.Z)(i,140),i=(0,r.Z)(i)),(0,s.Z)(d,i)),b||(b=[]);let w=null==v?void 0:v.media,S=!1,C=!1;const L=g?Array.from(g.children).slice():[];let E;if(w&&g){m.textContent="",m.append(yield(0,l.Z)({message:v,animationGroup:y,withoutMediaType:!0})),w=w.webpage||w;const e=w.photo,i=w.document;if(e||i&&(null===(t=i.thumbs)||void 0===t?void 0:t.length)){E=a.ZP.chat.bubbles.getMiddleware();const t=a.ZP.chat.bubbles.lazyLoadQueue;if("sticker"===(null==i?void 0:i.type))yield(0,h.ZP)({doc:i,div:g,lazyLoadQueue:t,group:y,width:f,height:f,middleware:E,loadPromises:b}),S=!0;else if("gif"===(null==i?void 0:i.type)&&i.video_thumbs)S=!0,yield(0,u.Z)({doc:i,container:g,boxWidth:f,boxHeight:f,lazyLoadQueue:t,noPlayButton:!0,noInfo:!0,middleware:E,loadPromises:b,withoutPreloader:!0,videoSize:i.video_thumbs[0],group:y});else{const s=e||i;C="round"===(null==i?void 0:i.type);try{yield(0,c.Z)({photo:s,container:g,boxWidth:f,boxHeight:f,size:(0,o.Z)(s,f,f),middleware:E,lazyLoadQueue:t,noBlur:!0,withoutPreloader:!0,loadPromises:b}),S=!0}catch(e){}}}}else v?(m.textContent="",m.append(yield(0,l.Z)({message:v}))):("string"==typeof p&&(p=(0,n.Z)(p,140),p=(0,r.Z)(p)),(0,s.Z)(m,p||""));return Promise.all(b).then((()=>{E&&!E()||(L.forEach((e=>e.remove())),g&&g.classList.toggle("is-round",C))})),S}))}class g extends d.Z{constructor(e,t){super(e,((e,i="",s)=>p(this,void 0,void 0,(function*(){this.mediaEl||(this.mediaEl=document.createElement("div"),this.mediaEl.classList.add(this.className+"-media"));const n=yield m({title:e,titleEl:this.title,subtitle:i,subtitleEl:this.subtitle,mediaEl:this.mediaEl,message:s,animationGroup:t});this.container.classList.toggle("is-media",n),n?this.content.prepend(this.mediaEl):this.mediaEl.remove()})))),this.className=e,this.animationGroup=t}}},6054:(e,t,i)=>{"use strict";i.d(t,{e:()=>k,Z:()=>x});var s=i(5432),n=i(4494),a=i(2230),o=i(9807),r=i(5128),d=i(4524),l=i(9099),c=i(1962),h=i(5824),u=i(4762),p=i(2325),f=i(8497),m=i(8799),g=i(3910),v=i(6760),b=i(5565),y=i(8487),w=i(144),S=i(2738),C=i(5975),L=i(3241),E=i(5953),I=i(6976),M=(i(6690),i(6219)),Z=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const P=e=>[...e.values()].reduce(((e,t)=>e+t.size),0);class T extends L.Z{constructor(e){super(!1),this.selectedMids=new Map,this.isSelecting=!1,this.onMouseDown=e=>{const t=(0,f.Z)(e.target,this.targetLookupClassName);if(0!==e.button)return;if(this.verifyTarget&&!this.verifyTarget(e,t))return;const i=new Map;let s,n=t;const a=(e,t=!0)=>{const o=+e.dataset.mid;if(!o||!e.dataset.peerId)return;const r=e.dataset.peerId.toPeerId();(0,y.Z)(n)||(n=e);let d=i.get(r);if(d||i.set(r,d=new Set),d.has(o))return;const l=this.isMidSelected(r,o);if(void 0===s&&(s=!l),d.add(o),s&&!l||!s&&l){const s=P(i);if(this.toggleByElement&&t){s<2&&(0,C.Z)(e,n)&&(n=e);const t=this.getElementsBetween(n,e);t.length&&t.forEach((e=>{a(e,!1)}))}if(this.selectedMids.size)this.toggleByElement&&this.toggleByElement(e);else if(2===s&&this.toggleByMid)for(const[e,t]of i)for(const i of t)this.toggleByMid(e,i)}};let o=!1;const r=e=>{o||((0,v.Z)(),o=!0);const t=this.getElementFromTarget(e.target);if(t)return this.verifyMouseMoveTarget&&!this.verifyMouseMoveTarget(e,t,s)?(this.listenerSetter.removeManual(this.listenElement,"mousemove",r),void this.listenerSetter.removeManual(document,"mouseup",d,l)):void a(t)},d=e=>{i.size&&(0,S.fc)(window,g.Z,{capture:!0,once:!0,passive:!1}),this.listenerSetter.removeManual(this.listenElement,"mousemove",r),(0,v.Z)()},l={once:!0};this.listenerSetter.add(this.listenElement)("mousemove",r),this.listenerSetter.add(document)("mouseup",d,l)},this.getElementsBetween=(e,t)=>{if(e===t)return[];const i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),n=(i.top-s.top||i.left-s.left)<0,a=(0,f.Z)(e,this.lookupBetweenParentClassName);if(!a)return[];const o=Array.from(a.querySelectorAll(this.lookupBetweenElementsQuery));let r=o.indexOf(e),d=o.indexOf(t);return n||([d,r]=[r,d]),o.slice(r+1,d)},this.cancelSelection=e=>Z(this,void 0,void 0,(function*(){e&&(this.doNotAnimate=!0),this.onCancelSelection&&(yield this.onCancelSelection()),this.selectedMids.clear(),this.toggleSelection(),(0,v.Z)(),e&&(this.doNotAnimate=void 0)})),(0,E.Z)(this,e),this.navigationType="multiselect-"+(0,w.a)()}attachListeners(e,t){if(this.listenElement&&this.listenerSetter.removeAll(),this.listenElement=e,this.listenerSetter=t,e)return s.Z?(t.add(e)("touchend",(()=>{this.isSelecting&&(this.selectedText=window.getSelection?window.getSelection().toString():document.selection?document.selection.createRange().text:"")})),void(0,I.E)({element:e,callback:t=>{if(this.isSelecting||this.verifyTouchLongPress&&!this.verifyTouchLongPress())return;document.body.classList.add("no-select"),e.addEventListener("touchend",(e=>{(0,g.Z)(e),document.body.classList.remove("no-select")}),{once:!0,capture:!0}),(0,v.Z)();const i=this.getElementFromTarget(t.target);i&&this.toggleByElement(i)},listenerSetter:t})):void t.add(e)("mousedown",this.onMouseDown)}isElementShouldBeSelected(e){return this.isMidSelected(e.dataset.peerId.toPeerId(),+e.dataset.mid)}appendCheckbox(e,t){e.prepend(t.label)}toggleElementCheckbox(e,t){const i=!!this.getCheckboxInputFromElement(e);if(t){if(i)return!1;const t=new o.Z({name:e.dataset.mid,round:!0});this.isSelecting&&this.isElementShouldBeSelected(e)&&(t.input.checked=!0,e.classList.add("is-selected")),this.appendCheckbox(e,t)}else i&&(this.getCheckboxInputFromElement(e).parentElement.remove(),(0,l.Z)({element:e,className:"is-selected",forwards:!1,duration:200}));return!0}getCheckboxInputFromElement(e){var t;return"LABEL"===(null===(t=e.firstElementChild)||void 0===t?void 0:t.tagName)&&e.firstElementChild.firstElementChild}updateContainer(e=!1){var t;return Z(this,void 0,void 0,(function*(){const i=this.selectedMids.size;if(!i&&!e)return;let s=!i,n=!i;const a=!i;for(const[e,t]of this.selectedMids){const i=this.getStorageKey(e),a=yield this.managers.appMessagesManager.cantForwardDeleteMids(i,Array.from(t));if(s=a.cantForward,n=a.cantDelete,s&&n)break}null===(t=this.onUpdateContainer)||void 0===t||t.call(this,s,n,a)}))}getStorageKey(e){return`${e}_${this.isScheduled?"scheduled":"history"}`}getSelectedMessages(){const e=[];return this.selectedMids.forEach(((t,i)=>{const s=this.getStorageKey(i),n=Array.from(t).map((e=>this.managers.appMessagesManager.getMessageFromStorage(s,e)));e.push(...n)})),Promise.all(e)}toggleSelection(e=!0,t=!1){var i;const n=this.isSelecting,a=this.selectedMids.size;if(this.isSelecting=!!a||t,n===this.isSelecting)return!1;this.dispatchEvent("toggle",this.isSelecting),s.Z||(this.listenElement.classList.toggle("no-select",this.isSelecting),n&&(0,v.Z)()),(0,m.Z)();const o=!!a||t,r=null===(i=this.onToggleSelection)||void 0===i?void 0:i.call(this,o,!this.doNotAnimate);return u.IS_MOBILE_SAFARI||(o?h.Z.pushItem({type:this.navigationType,onPop:()=>{this.cancelSelection()}}):h.Z.removeByType(this.navigationType)),t&&(r||Promise.resolve()).then((()=>this.updateContainer(t))),!0}cleanup(){this.doNotAnimate=!0,this.selectedMids.clear(),this.toggleSelection(!1),this.doNotAnimate=void 0}updateElementSelection(e,t){this.toggleElementCheckbox(e,!0),this.getCheckboxInputFromElement(e).checked=t,this.toggleSelection(),this.updateContainer(),(0,l.Z)({element:e,className:"is-selected",forwards:t,duration:200})}isMidSelected(e,t){const i=this.selectedMids.get(e);return!!(null==i?void 0:i.has(t))}length(){return P(this.selectedMids)}toggleMid(e,t,i){let s=this.selectedMids.get(e);return i||void 0===i&&(null==s?void 0:s.has(t))?s&&(s.delete(t),s.size||this.selectedMids.delete(e)):(s||(s=new Set,this.selectedMids.set(e,s)),s.add(t)),!0}deleteSelectedMids(e,t){const i=this.selectedMids.get(e);i&&(t.forEach((e=>{i.delete(e)})),i.size||this.selectedMids.delete(e),this.updateContainer(),this.toggleSelection())}}class k extends T{constructor(e,t,i){super({managers:t,verifyTarget:(e,t)=>!!t&&this.isSelecting,getElementFromTarget:e=>(0,f.Z)(e,"search-super-item"),targetLookupClassName:"search-super-item",lookupBetweenParentClassName:"tabs-tab",lookupBetweenElementsQuery:".search-super-item"}),this.searchSuper=e,this.toggleByElement=e=>{const t=+e.dataset.mid,i=e.dataset.peerId.toPeerId();this.toggleMid(i,t)&&this.updateElementSelection(e,this.isMidSelected(i,t))},this.toggleByMid=(e,t)=>{const i=this.searchSuper.mediaTab.contentTab.querySelector(`.search-super-item[data-peer-id="${e}"][data-mid="${t}"]`);this.toggleByElement(i)},this.onUpdateContainer=(e,t,i)=>{const s=this.length();(0,b.Z)(this.selectionCountEl,(0,p.ag)("messages",[s])),this.selectionGotoBtn.classList.toggle("hide",1!==s),this.selectionForwardBtn.classList.toggle("hide",e),this.selectionDeleteBtn&&this.selectionDeleteBtn.classList.toggle("hide",t)},this.onToggleSelection=(e,t)=>{if((0,l.Z)({element:this.searchSuper.navScrollableContainer,className:"is-selecting",forwards:e,duration:t?200:0,onTransitionEnd:()=>{this.isSelecting||(this.selectionContainer.remove(),this.selectionContainer=this.selectionForwardBtn=this.selectionDeleteBtn=null,this.selectedText=void 0)}}),(0,l.Z)({element:this.searchSuper.container,className:"is-selecting",forwards:e,duration:200}),this.isSelecting&&!this.selectionContainer){const e="search-super-selection";this.selectionContainer=document.createElement("div"),this.selectionContainer.classList.add(e+"-container");const t=(0,a.Z)(`close ${e}-cancel`,{noRipple:!0});(0,S.fc)(t,(()=>this.cancelSelection()),{listenerSetter:this.listenerSetter,once:!0}),this.selectionCountEl=document.createElement("div"),this.selectionCountEl.classList.add(e+"-count"),this.selectionGotoBtn=(0,a.Z)(`message ${e}-goto`);const i={listenerSetter:this.listenerSetter};(0,S.fc)(this.selectionGotoBtn,(()=>{const e=[...this.selectedMids.keys()][0],t=[...this.selectedMids.get(e)][0];this.cancelSelection(),M.ZP.setInnerPeer({peerId:e,lastMsgId:t})}),i),this.selectionForwardBtn=(0,a.Z)(`forward ${e}-forward`),(0,S.fc)(this.selectionForwardBtn,(()=>{const e={};for(const[t,i]of this.selectedMids)e[t]=Array.from(i).sort(((e,t)=>e-t));new d.Z(e,(()=>{this.cancelSelection()}))}),i),this.isPrivate&&(this.selectionDeleteBtn=(0,a.Z)(`delete danger ${e}-delete`),(0,S.fc)(this.selectionDeleteBtn,(()=>{const e=[...this.selectedMids.keys()][0];new r.Z(e,[...this.selectedMids.get(e)],"chat",(()=>{this.cancelSelection()}))}),i)),this.selectionContainer.append(...[t,this.selectionCountEl,this.selectionGotoBtn,this.selectionForwardBtn,this.selectionDeleteBtn].filter(Boolean));const s=this.selectionContainer;s.style.opacity="0",this.searchSuper.navScrollableContainer.append(s),s.offsetLeft,s.style.opacity=""}},this.isPrivate=!e.showSender,this.attachListeners(e.container,i)}toggleSelection(e=!0,t=!1){const i=super.toggleSelection(e,t);return i&&e&&Array.from(this.searchSuper.tabsContainer.querySelectorAll(".search-super-item")).forEach((e=>{this.toggleElementCheckbox(e,this.isSelecting)})),i}}class x extends T{constructor(e,t,i,s){super({managers:s,getElementFromTarget:e=>(0,f.Z)(e,"grouped-item")||(0,f.Z)(e,"bubble"),verifyTarget:(e,t)=>!(!this.selectedMids.size&&!e.target.classList.contains("bubble")&&!e.target.classList.contains("document-selection")&&t),verifyMouseMoveTarget:(e,t,i)=>!(e.target!==t&&!e.target.classList.contains("document-selection")&&void 0===i&&!this.selectedMids.size),verifyTouchLongPress:()=>!this.chat.input.recording,targetLookupClassName:"bubble",lookupBetweenParentClassName:"bubbles-inner",lookupBetweenElementsQuery:".bubble:not(.is-multiple-documents), .grouped-item",isScheduled:"scheduled"===e.type}),this.chat=e,this.bubbles=t,this.input=i,this.toggleByElement=e=>{if(!this.canSelectBubble(e))return;const t=+e.dataset.mid;if(e.classList.contains("is-grouped")){if(!this.isGroupedBubbleSelected(e)){const t=this.selectedMids.get(this.chat.peerId);t&&this.getMidsFromGroupContainer(e).forEach((e=>t.delete(e)))}this.bubbles.getBubbleGroupedItems(e).map(this.toggleByElement)}else if(this.toggleMid(this.chat.peerId,t)){if(e.classList.contains("grouped-item")){const t=(0,f.Z)(e,"bubble"),i=this.isGroupedBubbleSelected(t),s=this.isGroupedMidsSelected(t);(s||i)&&this.updateElementSelection(t,s)}this.updateElementSelection(e,this.isMidSelected(this.chat.peerId,t))}},this.toggleByMid=(e,t)=>Z(this,void 0,void 0,(function*(){const e=yield this.bubbles.getMountedBubble(t);e&&this.toggleByElement(e.bubble)})),this.onToggleSelection=(e,t)=>Z(this,void 0,void 0,(function*(){const{needTranslateX:i,widthFrom:s,widthTo:o}=yield this.chat.input.center(t);(0,l.Z)({element:this.listenElement,className:"is-selecting",forwards:e,duration:t?200:0,onTransitionEnd:()=>{this.isSelecting||(this.selectionInputWrapper.remove(),this.selectionInputWrapper=this.selectionContainer=this.selectionSendNowBtn=this.selectionForwardBtn=this.selectionDeleteBtn=this.selectionLeft=this.selectionRight=null,this.selectedText=void 0)}});const h=sthis.cancelSelection()),{once:!0,listenerSetter:this.listenerSetter}),this.selectionCountEl=document.createElement("div"),this.selectionCountEl.classList.add("selection-container-count"),"scheduled"===this.chat.type?(this.selectionSendNowBtn=(0,n.Z)("btn-primary btn-transparent btn-short text-bold selection-container-send",{icon:"send2"}),this.selectionSendNowBtn.append((0,p.ag)("MessageScheduleSend")),(0,S.fc)(this.selectionSendNowBtn,(()=>{new c.Z(this.chat.peerId,[...this.selectedMids.get(this.chat.peerId)],(()=>{this.cancelSelection()}))}),e)):(this.selectionForwardBtn=(0,n.Z)("btn-primary btn-transparent text-bold selection-container-forward",{icon:"forward"}),this.selectionForwardBtn.append((0,p.ag)("Forward")),(0,S.fc)(this.selectionForwardBtn,(()=>{const e={};for(const[t,i]of this.selectedMids)e[t]=Array.from(i).sort(((e,t)=>e-t));new d.Z(e,(()=>{this.cancelSelection()}))}),e)),this.selectionDeleteBtn=(0,n.Z)("btn-primary btn-transparent danger text-bold selection-container-delete",{icon:"delete"}),this.selectionDeleteBtn.append((0,p.ag)("Delete")),(0,S.fc)(this.selectionDeleteBtn,(()=>{new r.Z(this.chat.peerId,[...this.selectedMids.get(this.chat.peerId)],this.chat.type,(()=>{this.cancelSelection()}))}),e);const i=this.selectionLeft=document.createElement("div");i.classList.add("selection-container-left"),i.append(t,this.selectionCountEl);const s=this.selectionRight=document.createElement("div");s.classList.add("selection-container-right"),s.append(...[this.selectionSendNowBtn,this.selectionForwardBtn,this.selectionDeleteBtn].filter(Boolean)),void 0!==h&&(i.style.transform=`translateX(${-h}px)`,s.style.transform=`translateX(${h}px)`),this.selectionContainer.append(i,s),this.selectionInputWrapper.style.opacity="0",this.selectionInputWrapper.append(this.selectionContainer),this.input.inputContainer.append(this.selectionInputWrapper),this.selectionInputWrapper.offsetLeft,this.selectionInputWrapper.style.opacity=""}this.selectionLeft.style.transform="",this.selectionRight.style.transform=""}else this.selectionLeft&&void 0!==h&&(this.selectionLeft.style.transform=`translateX(-${h}px)`,this.selectionRight.style.transform=`translateX(${h}px)`)})),this.onUpdateContainer=(e,t,i)=>{(0,b.Z)(this.selectionCountEl,(0,p.ag)("messages",[this.length()])),this.selectionSendNowBtn&&this.selectionSendNowBtn.toggleAttribute("disabled",i),this.selectionForwardBtn&&this.selectionForwardBtn.toggleAttribute("disabled",e),this.selectionDeleteBtn&&this.selectionDeleteBtn.toggleAttribute("disabled",t)},this.onCancelSelection=()=>Z(this,void 0,void 0,(function*(){}))}appendCheckbox(e,t){t.label.classList.add("bubble-select-checkbox"),e.classList.contains("document-container")?e.querySelector(".document, audio-element").append(t.label):super.appendCheckbox(e,t)}toggleSelection(e=!0,t=!1){const i=super.toggleSelection(e,t);if(i&&e)for(const e in this.bubbles.bubbles){if(this.bubbles.skippedMids.has(+e))continue;const t=this.bubbles.bubbles[e];this.toggleElementCheckbox(t,this.isSelecting)}return i}toggleElementCheckbox(e,t){if(!this.canSelectBubble(e))return;const i=super.toggleElementCheckbox(e,t);return i&&e.classList.contains("is-grouped")&&this.bubbles.getBubbleGroupedItems(e).forEach((e=>this.toggleElementCheckbox(e,t))),i}isElementShouldBeSelected(e){const t=e.classList.contains("is-grouped");return super.isElementShouldBeSelected(e)&&(!t||this.isGroupedMidsSelected(e))}isGroupedBubbleSelected(e){const t=this.getCheckboxInputFromElement(e);return null==t?void 0:t.checked}getMidsFromGroupContainer(e){const t=this.chat.bubbles.getBubbleGroupedItems(e);return t.length||t.push(e),t.map((e=>+e.dataset.mid))}isGroupedMidsSelected(e){const t=this.getMidsFromGroupContainer(e),i=t.filter((e=>this.isMidSelected(this.chat.peerId,e)));return t.length===i.length}getCheckboxInputFromElement(e){return e.classList.contains("document-container")?e.querySelector("label input"):super.getCheckboxInputFromElement(e)}canSelectBubble(e){return!(e.classList.contains("service")||e.classList.contains("is-outgoing")||e.classList.contains("is-error")||e.classList.contains("bubble-first")||e.classList.contains("avoid-selection"))}}},6676:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(3416),n=i(6976),a=i(3910),o=i(3512),r=i(3003);class d{constructor(e){this.sendMenuButtons=[{icon:"mute",text:"Chat.Send.WithoutSound",onClick:e.onSilentClick,verify:()=>"schedule"===this.type},{icon:"schedule",text:"Chat.Send.ScheduledMessage",onClick:e.onScheduleClick,verify:()=>"schedule"===this.type},{icon:"schedule",text:"Chat.Send.SetReminder",onClick:e.onScheduleClick,verify:()=>"reminder"===this.type}],this.sendMenu=(0,r.b)({buttons:this.sendMenuButtons,listenerSetter:e.listenerSetter}),this.sendMenu.classList.add("menu-send",e.openSide),(0,n.E)({element:e.onContextElement,callback:t=>{e.onOpen&&!e.onOpen()||(this.sendMenuButtons.forEach((e=>{e.element.classList.toggle("hide",!e.verify())})),(0,a.Z)(t),s.Z.openBtnMenu(this.sendMenu))},listenerSetter:e.listenerSetter})}setPeerId(e){this.type=e===o.Z.myId?"reminder":"schedule"}}},9807:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var s=i(1405),n=i(2325),a=i(9750),o=i(3512),r=i(3855),d=i(6669);class l{constructor(e={}){const t=this.label=document.createElement("label");t.classList.add("checkbox-field"),e.restriction&&!e.toggle&&t.classList.add("checkbox-field-restriction"),e.round&&t.classList.add("checkbox-field-round"),e.disabled&&this.toggleDisability(!0),this.listenerSetter=e.listenerSetter;const i=this.input=document.createElement("input");if(i.classList.add("checkbox-field-input"),i.type="checkbox",e.name&&(i.id="input-"+e.name),e.checked&&(i.checked=!0),e.stateKey){let t=!1;const s=()=>{if(!t)return;let s;e.stateValues?s=e.stateValues[i.checked?1:0]:(s=i.checked,e.stateValueReverse&&(s=!s)),o.Z.managers.appStateManager.setByKey(e.stateKey,s)};void 0===e.checked&&r.Z.getState().then((i=>{t=!0;const s=(0,a.Z)(i,e.stateKey);let n;e.stateValues?n=1===e.stateValues.indexOf(s):(n=s,e.stateValueReverse&&(n=!n)),this.setValueSilently(n)})),e.listenerSetter?e.listenerSetter.add(i)("change",s):i.addEventListener("change",s)}let d;if(e.text?(d=this.span=document.createElement("span"),d.classList.add("checkbox-caption"),(0,n.$d)(d,e.text,e.textArgs)):t.classList.add("checkbox-without-caption"),t.append(i),e.toggle){t.classList.add("checkbox-field-toggle"),e.restriction&&t.classList.add("checkbox-field-toggle-restriction");const i=document.createElement("div");i.classList.add("checkbox-toggle"),t.append(i)}else{const e=document.createElement("div");e.classList.add("checkbox-box");const i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.classList.add("checkbox-box-check"),i.setAttributeNS(null,"viewBox","0 0 24 24");const s=document.createElementNS("http://www.w3.org/2000/svg","use");s.setAttributeNS(null,"href","#check"),s.setAttributeNS(null,"x","-1"),i.append(s);const n=document.createElement("div");n.classList.add("checkbox-box-background");const a=document.createElement("div");a.classList.add("checkbox-box-border"),e.append(a,n,i),t.append(e)}d&&t.append(d),e.withRipple?(t.classList.add("checkbox-ripple","hover-effect"),(0,s.Z)(t,void 0,void 0,!0)):e.withHover&&t.classList.add("hover-effect")}get checked(){return this.input.checked}set checked(e){this.setValueSilently(e),(0,d.Z)(this.input,"change")}setValueSilently(e){this.input.checked=e}isDisabled(){return this.label.classList.contains("checkbox-disabled")}toggleDisability(e){return this.label.classList.toggle("checkbox-disabled",e),this.input.disabled=e,()=>this.toggleDisability(!e)}}},8610:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(3910),n=i(2738),a=i(5975),o=i(5953),r=i(2325),d=i(9807),l=i(7479),c=i(2796);class h{constructor(e){(0,o.Z)(this,e)}createField(e,t){var i;if(e.nestedTo&&!t)return;const o=e.row=new l.ZP({titleLangKey:t?void 0:e.text,checkboxField:e.checkboxField=new d.Z({text:t?e.text:void 0,checked:!e.nested&&e.checked,toggle:!t,listenerSetter:this.listenerSetter,restriction:this.asRestrictions&&!t,name:e.name}),listenerSetter:this.listenerSetter,subtitleLangKey:e.description,clickable:e.nested?e=>{(0,a.Z)(e.target,o.checkboxField.label)||((0,s.Z)(e),o.container.classList.toggle("accordion-toggler-expanded"),u.classList.toggle("is-expanded"))}:void 0});e.restrictionText&&(e.checkboxField.input.disabled=!0,(0,n.fc)(e.checkboxField.label,(t=>{(0,c.Am)(r.ZP.format(e.restrictionText,!0))}),{listenerSetter:this.listenerSetter}));const h=[o.container];let u,p;if(e.nested){const t=u=document.createElement("div");t.classList.add("accordion"),t.style.setProperty("--max-height",48*e.nested.length+"px");const s=e;e.nested.forEach((e=>{var i;null!==(i=e.nestedTo)&&void 0!==i||(e.nestedTo=s),t.append(...this.createField(e,!0).nodes)})),h.push(t);const n=document.createElement("span");n.classList.add("tgico-down","accordion-icon"),p=e.nestedCounter=document.createElement("b"),this.setNestedCounter(e),o.title.append(" ",p," ",n),o.container.classList.add("accordion-toggler"),o.titleRow.classList.add("with-delimiter"),o.checkboxField.setValueSilently(this.getNestedCheckedLength(e)===e.nested.length),null!==(i=e.toggleWith)&&void 0!==i||(e.toggleWith={checked:e.nested,unchecked:e.nested})}if(e.toggleWith||e.nestedTo){const t=e.toggleWith?e=>{const{toggleWith:i,nested:s}=e,n=e.checkboxField.checked,a=n?i.checked:i.unchecked;a&&(this.fields.filter((e=>a.includes(e))).forEach((e=>{e.checkboxField.setValueSilently(n),e.nestedTo&&!s&&this.setNestedCounter(e.nestedTo),e.toggleWith&&t(e)})),e.nested&&this.setNestedCounter(e))}:void 0,i=e.nestedTo?()=>{const t=this.getNestedCheckedLength(e.nestedTo);e.nestedTo.checkboxField.setValueSilently(t===e.nestedTo.nested.length),this.setNestedCounter(e.nestedTo,t)}:void 0;this.listenerSetter.add(e.checkboxField.input)("change",(()=>{null==t||t(e),null==i||i()}))}return{row:o,nodes:h}}getNestedCheckedLength(e){return e.nested.reduce(((e,t)=>e+ +t.checkboxField.checked),0)}setNestedCounter(e,t=this.getNestedCheckedLength(e)){e.nestedCounter.textContent=`${t}/${e.nested.length}`}}},4489:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(503);class n extends s.ZP{constructor(e){super(Object.assign(e,{plainText:!0})),this.options=e;const t=this.input;t.type="tel",t.setAttribute("required",""),t.autocomplete="off";let i=0;this.input.addEventListener("input",(t=>{this.input.classList.remove("error"),this.setLabel();const s=this.value.replace(/\D/g,"").slice(0,e.length);this.setValueSilently(s);const n=this.value.length;if(n===e.length)e.onFill(this.value);else if(n===i)return;i=n}))}}},5592:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(1168),n=i(8127);function a(e){return new Promise(((t,i)=>{var a;const{button:o,checkbox:r}=e;o.callback=i=>{t(r||!i?i?!!i.size:void 0:e.checkboxes.map((e=>i.has(e.text))))};const d=(0,s.x)(e.buttons||[o]),l=d.find((e=>e.isCancel));l.callback=()=>{i()},e.buttons=d,null!==(a=e.checkboxes)&&void 0!==a||(e.checkboxes=r&&[r]),new n.Z("popup-confirmation",e).show()}))}},5431:(e,t,i)=>{"use strict";i.d(t,{Z:()=>S});var s=i(9976),n=i(3910),a=i(8497),o=i(4668),r=i(5565),d=i(130),l=i(4789),c=i(144),h=i(2325),u=i(8115),p=i(3512),f=i(671),m=i(503),g=i(8805);let v;const b=()=>{v=h.ZP.countriesList.filter((e=>{var t;return!(null===(t=e.pFlags)||void 0===t?void 0:t.hidden)})).sort(((e,t)=>(e.name||e.default_name).localeCompare(t.name||t.default_name)))};let y=()=>{b(),p.Z.addEventListener("language_change",(()=>{b()}))};const w=new Set(["FT"]);class S extends m.ZP{constructor(e={}){super(Object.assign({label:"Country",name:(0,c.a)()},e)),this.options=e,this.hidePicker=()=>{void 0===this.hideTimeout&&(this.selectWrapper.classList.remove("active"),this.hideTimeout=window.setTimeout((()=>{this.selectWrapper.classList.add("hide"),this.hideTimeout=void 0}),200))},this.selectCountryByTarget=e=>{var t,i;const s=e.querySelector("[data-default-name]").dataset.defaultName,n=e.querySelector(".phone-code"),a=null==n?void 0:n.innerText,o=a&&a.replace(/\D/g,"");(0,r.Z)(this.input,(0,h.ag)(s)),this.simulateInputEvent(),this.lastCountrySelected=v.find((e=>e.default_name===s)),this.lastCountryCodeSelected=o&&this.lastCountrySelected.country_codes.find((e=>e.country_code===o)),null===(i=(t=this.options).onCountryChange)||void 0===i||i.call(t,this.lastCountrySelected,this.lastCountryCodeSelected),this.hidePicker()},y&&(y(),y=void 0),this.liMap=new Map,this.container.classList.add("input-select");const t=this.selectWrapper=document.createElement("div");t.classList.add("select-wrapper","z-depth-3","hide");const i=document.createElement("span");i.classList.add("arrow","arrow-down"),this.container.append(i);const p=document.createElement("ul");t.appendChild(p),new g.ZP(t);let m=()=>{m=null,v.forEach((t=>{if(e.noPhoneCodes&&w.has(t.iso2))return;const i=(0,f.Ml)(t.iso2),n=[];for(let a=0,o=Math.min(t.country_codes.length,e.noPhoneCodes?1:1/0);a{if(0!==e.button)return;const t=(0,o.Z)(e.target,"LI");this.selectCountryByTarget(t)})),this.container.appendChild(t)};m(),this.input.addEventListener("focus",(e=>{m?m():v.forEach((e=>{const t=this.liMap.get(e.iso2);t&&t.forEach((e=>e.style.display=""))})),clearTimeout(this.hideTimeout),this.hideTimeout=void 0,t.classList.remove("hide"),t.offsetWidth,t.classList.add("active"),this.select(),(0,l.Z)({container:(0,a.Z)(this.container,"scrollable-y"),element:this.input,position:"start",margin:4}),setTimeout((()=>{b||(document.addEventListener("mousedown",S,{capture:!0}),b=!0)}),0)}));let b=!1;const S=e=>{(0,a.Z)(e.target,"input-select")||e.target!==this.input&&(this.hidePicker(),document.removeEventListener("mousedown",S,{capture:!0}),b=!1)},C=e=>{const t=e.key;if(e.ctrlKey||"Control"===t)return!1;const i=this.value.toLowerCase(),s=[];v.forEach((e=>{const t=this.liMap.get(e.iso2);if(!t)return;const n=[e.name,e.default_name,e.iso2];n.filter(Boolean).forEach((e=>{const t=e.split(" ").filter((e=>/\w/.test(e))).map((e=>e[0])).join("");t.length>1&&n.push(t)}));const a=!!n.filter(Boolean).find((e=>-1!==e.toLowerCase().indexOf(i)));t.forEach((e=>e.style.display=a?"":"none")),a&&s.push(e)})),0===s.length?v.forEach((e=>{const t=this.liMap.get(e.iso2);t&&t.forEach((e=>e.style.display=""))})):1===s.length&&"Enter"===t&&((0,n.Z)(e),this.selectCountryByTarget(this.liMap.get(s[0].iso2)[0]))};this.input.addEventListener("keyup",C),this.input.addEventListener("keydown",(e=>{"Enter"===e.key&&C(e)})),i.addEventListener("mousedown",(e=>{this.input.matches(":focus")?(this.hidePicker(),this.input.blur()):(e.cancelBubble=!0,e.preventDefault(),this.input.focus())}))}getSelected(){return{country:this.lastCountrySelected,code:this.lastCountryCodeSelected}}selectCountryByIso2(e){this.selectCountryByTarget(this.liMap.get(e)[0])}override(e,t,i){var s,n;(0,r.Z)(this.input,e?(0,h.ag)(e.default_name):i),this.lastCountrySelected=e,this.lastCountryCodeSelected=t,null===(n=(s=this.options).onCountryChange)||void 0===n||n.call(s,this.lastCountrySelected,this.lastCountryCodeSelected)}}},4561:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(130);class n{constructor(e,t){this.className=e,this.fill=t,this.container=document.createElement("div"),this.container.className=e,this.border=document.createElement("div"),this.border.classList.add(e+"-border"),this.content=document.createElement("div"),this.content.classList.add(e+"-content"),this.title=document.createElement("div"),this.title.classList.add(e+"-title"),(0,s.m)(this.title),this.subtitle=document.createElement("div"),this.subtitle.classList.add(e+"-subtitle"),(0,s.m)(this.subtitle),this.content.append(this.title,this.subtitle),this.container.append(this.border,this.content)}}},6628:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(4762),n=i(5296),a=i(5994),o=i(3228),r=i(5814);class d{constructor(e,t,i){this.width=e,this.height=t,this.multiply=i,this.loop=!0;const s=this.canvas=document.createElement("canvas"),n=this.dpr=window.devicePixelRatio;s.width=e*n,s.height=t*n,s.classList.add("canvas-thumbnail","canvas-dots"),this.paused=!0,this.autoplay=!0,this.tempId=0,this.context=s.getContext("2d")}prepare(){let e=Math.round(this.width*this.height/(35*(s.IS_MOBILE?2:1)));e*=this.multiply||1,e=Math.min(a.Z.isAvailable("chat_spoilers")?s.IS_MOBILE?1e3:2200:400,e),e=Math.round(e);const t=this.dots=new Array(e);for(let i=0;i=.8?1:.5)*this.dpr,a=new Path2D;return a.arc(t,i,n,0,2*Math.PI,!1),{x:t,y:i,opacity:s,radius:n,mOpacity:s,adding:null!=e?e:Math.random()>=.5,counter:0,path:a}}draw(){const{context:e,canvas:t,dots:i}=this;e.clearRect(0,0,t.width,t.height),e.fillStyle="#fff";for(let t=0,s=i.length;t=1&&(i[t]=this.generateDot(s.adding))):s.mOpacity>=1&&(s.adding=!1)}}remove(){this.pause()}pause(){this.paused||(this.paused=!0,++this.tempId)}renderFirstFrame(){this.dots||this.prepare(),this.draw()}play(){if(!this.paused)return;this.paused=!1;const e=++this.tempId;this.dots||this.prepare(),(0,n.jt)((()=>this.tempId===e&&!this.paused&&(this.draw(),!0)))}static create({width:e,height:t,middleware:i,animationGroup:s,multiply:n}){const a=new d(e,t,n);return a.renderFirstFrame(),r.Z.addAnimation({animation:a,group:s,observeElement:a.canvas,controlled:i}),a}}},2621:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(187),n=i(9331),a=i(8119),o=i(5953),r=i(1507);class d{constructor(e){this._disabled=!1,this.avatarSize=120,this.isChanged=()=>{if(this.uploadAvatar)return!0;let e=0,t=0,i=0;return this.inputFields.forEach((s=>{s.isValid()&&(s.isChanged()&&++e,s.required&&++i),s.required&&++t})),t===i&&e>0},this.handleChange=()=>{this.nextBtn.classList.toggle("is-visible",this.isChanged())},(0,o.Z)(this,e),this.peerId||(this.peerId=r.NM),this.nextBtn?this.nextBtn.classList.contains("btn-corner")||(this.handleChange=()=>{this.nextBtn.toggleAttribute("disabled",!this.isChanged()||this.disabled)}):this.nextBtn=(0,a.Z)({icon:"check"}),e.withoutAvatar||(this.avatarElem=new n.Z,this.avatarElem.classList.add("avatar-placeholder","avatar-"+this.avatarSize),this.avatarElem.updateWithOptions({peerId:this.peerId}),e.doNotEditAvatar||(this.avatarEdit=new s.Z((e=>{this.uploadAvatar=e,this.handleChange(),this.avatarElem.remove()}),e.popupOptions),this.avatarEdit.container.append(this.avatarElem))),this.inputFields.forEach((e=>{this.listenerSetter.add(e.input)("input",this.handleChange)})),this.handleChange()}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this.inputFields.forEach((t=>t.input.toggleAttribute("disabled",e))),this.handleChange()}lockWithPromise(e,t=!1){this.disabled=!0,e.then((()=>{t&&(this.disabled=!1)}),(()=>{this.disabled=!1}))}}},3173:(e,t,i)=>{"use strict";i.d(t,{Yd:()=>J,Jo:()=>te,ZP:()=>se});var s=i(5432),n=i(6219),a=i(3512),o=i(5814),r=i(6008),d=i(2153),l=i(4332),c=i(5117),h=i(6039),u=i(1080),p=i(8805),f=i(279),m=i(2738);class g{constructor(e){this.managers=e}init(){this.content=document.getElementById("content-gifs");const e=this.content.firstElementChild;(0,m.fc)(e,te.onMediaClick);const t=this.scrollable=new p.ZP(this.content,"GIFS"),i=new u.Z(e,J,t),s=(0,f.y)(this.content,!0);this.managers.appDocsManager.getGifs().then((e=>{e.forEach((e=>{i.add(e)})),s.remove()})),se.addLazyLoadQueueRepeat(i.lazyLoadQueue,i.processInvisibleDiv),this.init=null}onClose(){}}var v=i(6057),b=i(410),y=i(3552),w=i(3607),S=i(4755),C=i(8497),L=i(1507),E=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const I="GIFS-SEARCH";class M extends y._{constructor(){super(...arguments),this.nextOffset="",this.loadedAll=!1,this.onGifsClick=e=>E(this,void 0,void 0,(function*(){const t=(0,C.Z)(e.target,"gif");if(!t)return;const i=t.dataset.docId;(yield n.ZP.chat.input.sendMessageWithDocument(i))?S.Z.isMobile&&l.ZP.onCloseBtnClick():console.warn("got no doc by id:",i)}))}init(){this.container.id="search-gifs-container",this.inputSearch=new w.Z("SearchGifsTitle",(e=>{this.reset(),this.search(e)})),this.title.replaceWith(this.inputSearch.container),this.gifsDiv=document.createElement("div"),this.gifsDiv.classList.add("gifs-masonry"),(0,m.fc)(this.gifsDiv,this.onGifsClick,{listenerSetter:this.listenerSetter}),this.scrollable.append(this.gifsDiv),this.masonry=new u.Z(this.gifsDiv,I,this.scrollable),l.ZP.toggleSidebar(!0).then((()=>{this.search("",!0),this.scrollable.onScrolledBottom=()=>{this.search(this.inputSearch.value,!1)}}))}onClose(){this.scrollable.onScrolledBottom=()=>{}}onCloseAfterTimeout(){return this.reset(),this.gifsDiv.innerHTML="",o.Z.checkAnimations(void 0,I),this.inputSearch.remove(),super.onCloseAfterTimeout()}reset(){this.searchPromise=null,this.nextOffset="",this.loadedAll=!1,this.masonry.clear()}search(e,t=!0){return E(this,void 0,void 0,(function*(){if(!this.searchPromise&&!this.loadedAll){this.gifBotPeerId||(this.gifBotPeerId=(yield this.managers.appUsersManager.resolveUsername("gif")).id.toPeerId(!1));try{this.searchPromise=this.managers.appInlineBotsManager.getInlineResults(L.NM,this.gifBotPeerId,e,this.nextOffset);const{results:i,next_offset:s}=yield this.searchPromise;if(this.inputSearch.value!==e)return;this.searchPromise=null,this.nextOffset=s,t&&(this.gifsDiv.innerHTML=""),i.length?i.forEach((e=>{"botInlineMediaResult"===e._&&e.document&&this.masonry.add(e.document)})):this.loadedAll=!0,this.scrollable.onScroll()}catch(e){throw this.searchPromise=null,console.error("gifs loading error:",e),e}}}))}}var Z=i(9298),P=i(2325),T=i(7625),k=i(130),x=i(8115),A=i(9259),_=i(3541);class F extends y._{init(){this.container.id="stickers-container",this.container.classList.add("chatlist-container"),this.lazyLoadQueue=new d.Z,this.inputSearch=new w.Z("StickersTab.SearchPlaceholder",(e=>{this.search(e)})),this.title.replaceWith(this.inputSearch.container),this.setsDiv=document.createElement("div"),this.setsDiv.classList.add("sticker-sets"),this.scrollable.append(this.setsDiv),(0,A.Z)({listenTo:this.setsDiv,listenerSetter:this.listenerSetter}),(0,m.fc)(this.setsDiv,(e=>{const t=(0,C.Z)(e.target,"sticker-set-sticker");if(t){const e=t.dataset.docId;return void n.ZP.chat.input.sendMessageWithDocument(e)}const i=(0,C.Z)(e.target,"sticker-set");if(!i)return;const s=i.dataset.stickerSet,a=i.dataset.access_hash,o=(0,C.Z)(e.target,"sticker-set-button");o?(e.preventDefault(),e.cancelBubble=!0,o.setAttribute("disabled","true"),this.managers.appStickersManager.getStickerSet({id:s,access_hash:a}).then((e=>{this.managers.appStickersManager.toggleStickerSet(e.set).then((t=>{t&&(o.textContent="",o.append((0,P.ag)(e.set.installed_date?"Stickers.SearchAdded":"Stickers.SearchAdd")),o.classList.toggle("gray",!!e.set.installed_date))})).finally((()=>{o.removeAttribute("disabled")}))}))):this.managers.appStickersManager.getStickerSet({id:s,access_hash:a}).then((e=>{new Z.Z(e.set).show()}))}),{listenerSetter:this.listenerSetter}),l.ZP.toggleSidebar(!0).then((()=>{this.renderFeatured()}))}onCloseAfterTimeout(){return this.setsDiv.innerHTML="",o.Z.checkAnimations(void 0,"STICKERS-SEARCH"),super.onCloseAfterTimeout()}renderSet(e){const t=document.createElement("div");t.classList.add("sticker-set");const i=document.createElement("div");i.classList.add("sticker-set-header");const s=document.createElement("div");s.classList.add("sticker-set-details"),s.innerHTML='
',(0,k.Z)(s.firstElementChild,(0,x.Z)(e.title));const n=document.createElement("div");n.classList.add("sticker-set-count"),n.append((0,P.ag)("Stickers",[e.count])),s.append(n);const a=document.createElement("button");a.classList.add("btn-primary","btn-color-primary","sticker-set-button"),a.append((0,P.ag)(e.installed_date?"Stickers.SearchAdded":"Stickers.SearchAdd")),e.installed_date&&a.classList.add("gray"),i.append(s,a);const o=document.createElement("div");o.classList.add("sticker-set-stickers");const r=Math.min(5,e.count);for(let e=0;e{for(let t=0;t{this.inputSearch.value||(e=this.filterRendered("",e)).forEach((e=>{this.renderSet(e.set)}))}))}filterRendered(e,t){t=t.slice();const i=Array.from(this.setsDiv.children);return(0,T.Z)(i,(i=>{const s=i.dataset.stickerSet,n=t.findIndex((e=>e.set.id===s));-1!==n?t.splice(n,1):e&&i.dataset.title.toLowerCase().includes(e.toLowerCase())||i.remove()})),o.Z.checkAnimations(void 0,"STICKERS-SEARCH"),t}search(e){return e?this.managers.appStickersManager.searchStickerSets(e,!1).then((t=>{this.inputSearch.value===e&&(t=this.filterRendered(e,t)).forEach((e=>{this.renderSet(e.set)}))})):this.renderFeatured()}}var D,R=i(4668),B=i(8799),N=i(2648),O=i(3910),U=i(6339),H=i(5418),z=i(4762),j=i(3815),G=i(319),V=i(4789),K=i(6802),W=i.n(K),$=i(669),q=i(3299),Y=i(2796),Q=i(8843),X=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const J="emoticons-dropdown",ee={forceDuration:200,transitionFunction:W()(.42,0,.58,1)};class te extends U.Z{constructor(){super({element:document.getElementById("emoji-dropdown"),ignoreOutClickClassName:"input-message-input"}),this.tabId=-1,this.onSelectTabClick=e=>{if(this.tabId===e){const{tab:e}=this;return void this.scrollTo(e,e.scrollable.container.firstElementChild)}const t={[this.stickersTab.tabId]:"send_stickers",[this.gifsTab.tabId]:"send_gifs"}[e];if(t&&!this.rights[t])return(0,Y.bC)({langPackKey:Q.m[t]}),!1;o.Z.checkAnimations(!0,J),this.tabId=e,this.searchButton.classList.toggle("hide",this.tabId===this.emojiTab.tabId),this.deleteBtn.classList.toggle("hide",this.tabId!==this.emojiTab.tabId)},this.checkRights=()=>X(this,void 0,void 0,(function*(){const{peerId:e,threadId:t}=n.ZP.chat,i=Object.keys(this.rights),s=yield Promise.all(i.map((i=>this.managers.appMessagesManager.canSendToPeer(e,t,i))));i.forEach(((e,t)=>{this.rights[e]=s[t]}));const a=this.tabsEl.querySelector(".active");!a||(0,N.Z)(a)===this.emojiTab.tabId+1||this.rights.send_stickers&&this.rights.send_gifs||this.selectTab(this.emojiTab.tabId,!1)})),this.rights={send_gifs:void 0,send_stickers:void 0},this.addEventListener("open",(()=>X(this,void 0,void 0,(function*(){var e;s.Z&&(0,B.Z)()&&(yield(0,H.Z)(100)),this.element.parentElement!==n.ZP.chat.input.chatInput&&n.ZP.chat.input.chatInput.append(this.element),this.savedRange=this.getGoodRange(),te.lazyLoadQueue.lock(),o.Z.lockIntersectionGroup(J);const t=this.tab;null===(e=t.onOpen)||void 0===e||e.call(t)})))),this.addEventListener("opened",(()=>{var e;o.Z.unlockIntersectionGroup(J),te.lazyLoadQueue.unlockAndRefresh();const t=this.tab;null===(e=t.onOpened)||void 0===e||e.call(t)})),this.addEventListener("close",(()=>{var e;te.lazyLoadQueue.lock(),o.Z.lockIntersectionGroup(J),o.Z.checkAnimations(!0,J);const t=this.tab;null===(e=t.onClose)||void 0===e||e.call(t)})),this.addEventListener("closed",(()=>{var e;o.Z.unlockIntersectionGroup(J),te.lazyLoadQueue.unlock(),te.lazyLoadQueue.refresh(),this.savedRange=void 0;const t=this.tab;null===(e=t.onClosed)||void 0===e||e.call(t)}))}get tab(){return this.tabs[this.tabId]}init(){this.managers=a.Z.managers,this.emojiTab=new h.ZP({managers:this.managers}),this.stickersTab=new v.ZP(this.managers),this.gifsTab=new g(this.managers),this.tabs={},[this.emojiTab,this.stickersTab,this.gifsTab].forEach(((e,t)=>{e.tabId=t,this.tabs[t]=e})),this.container=this.element.querySelector(".emoji-container .tabs-container"),this.container.prepend(this.emojiTab.container,this.stickersTab.container),this.tabsEl=this.element.querySelector(".emoji-tabs"),this.selectTab=(0,r.X)(this.tabsEl,this.container,this.onSelectTabClick,(()=>{var e;const{tab:t}=this;null===(e=t.init)||void 0===e||e.call(t),o.Z.checkAnimations(!1,J)})),this.searchButton=this.element.querySelector(".emoji-tabs-search"),this.searchButton.addEventListener("click",(()=>{this.tabId===this.stickersTab.tabId?l.ZP.isTabExists(F)||l.ZP.createTab(F).open():l.ZP.isTabExists(M)||l.ZP.createTab(M).open()})),this.deleteBtn=this.element.querySelector(".emoji-tabs-delete"),(0,m.fc)(this.deleteBtn,(e=>{(0,O.Z)(e);const t=n.ZP.chat.input.messageInput;let i=$.Z.getInstance().getSavedRange(t);i||(i=document.createRange(),i.setStartAfter(t.lastChild));const s=i.cloneRange();if(i.collapsed){const{node:e,offset:n}=(0,q.q)(t,i.endContainer,i.endOffset);let a;if(n)a=e;else{if(a=e.previousSibling,!a)return;for(;a.nodeType===a.TEXT_NODE&&!a.nodeValue&&(a=a.previousSibling););if(a.nodeType===a.ELEMENT_NODE&&!a.isContentEditable)return}if(a.nodeType===a.ELEMENT_NODE&&"IMG"===a.tagName)s.selectNode(a);else{const e=[...a.textContent];let t;if(n){let i=0;t=e.find((e=>(i+=e.length,i>=n)))}else t=e.pop()||"";const i=n?n-t.length:a.textContent.length-t.length;s.setStart(a,i)}}s.deleteContents(),n.ZP.chat.input.messageInputField.simulateInputEvent()}));const e=z.IS_APPLE_MOBILE&&!1,t=e?this.stickersTab.tabId:this.emojiTab.tabId;if(e&&this.tabsEl.children[1].classList.add("hide"),(0,m.tH)(this.tabsEl.children[t+1]),this.tabs[t].init&&this.tabs[t].init(),!s.Z){let e,t=!1;const i=t=>{e=t};j.Z.addEventListener("change",(s=>{s?t||(document.body.addEventListener("mousemove",i),t=!0):t&&(document.body.removeEventListener("mousemove",i),e&&this.onMouseOut(e))}))}return n.ZP.addEventListener("peer_changing",(()=>{this.toggle(!1)})),n.ZP.addEventListener("peer_changed",this.checkRights),this.checkRights(),super.init()}getElement(){return this.element}scrollTo(e,t){e.scrollable.scrollIntoViewNew(Object.assign({element:t,axis:"y",position:"start"},ee))}static sendDocId(e,t,i){return X(this,void 0,void 0,(function*(){return(yield n.ZP.chat.input.sendMessageWithDocument(e,void 0,t,i))?(ie.container&&(ie.forceClose=!0,ie.toggle(!1)),!0):(console.warn("got no doc by id:",e),!1)}))}addLazyLoadQueueRepeat(e,t){this.addEventListener("close",(()=>{e.lock()})),this.addEventListener("closed",(()=>{const i=e.intersector.getVisible();for(const e of i)t(e);e.intersector.clearVisible()})),this.addEventListener("opened",(()=>{e.unlockAndRefresh()}))}getSavedRange(){return this.getGoodRange()||this.savedRange}getGoodRange(){const e=document.getSelection();if(e.rangeCount&&document.activeElement===n.ZP.chat.input.messageInput)return e.getRangeAt(0)}}D=te,te.lazyLoadQueue=new d.Z(1),te.menuOnClick=(e,t,i,s,n,a)=>{let o=-1;const r=(e,t=!0)=>{if(e===n)return!1;let i=!1;return n&&(n.elements.menuTab.classList.remove("active"),n.menuScroll&&n.menuScroll!==e.menuScroll&&(i=!0,n.menuScroll.container.parentElement.classList.remove("active"),n.menuScroll.scrollIntoViewNew(Object.assign({element:n.menuScroll.container.firstElementChild,forceDirection:t?void 0:V.f.Static,position:"center",axis:"x"},ee)))),e.elements.menuTab.classList.add("active"),e.menuScroll&&(e.menuScroll.container.parentElement.classList.add("active"),t&&s.scrollIntoViewNew(Object.assign({element:e.menuScroll.container.parentElement,position:"center",axis:"x"},ee))),n&&((e,t)=>{const i=e.menuScroll||s;i&&i.scrollIntoViewNew(Object.assign({element:e.elements.menuTab,position:"center",axis:"x",getElementPosition:t?({elementPosition:e})=>e-106:void 0},ee))})(e,i),n=e,!0};let d=!1;const l=new c.Z(i.container,((t,s)=>{if(d)return;if(Math.abs(o-i.container.scrollTop)<=1)return;o=-1;const n=e.getCategoryByContainer(s),a=(0,N.Z)(s);(t||!a&&!n.menuScroll)&&r(n)}));(0,m.fc)(t,(t=>{let s=(0,C.Z)(t.target,"menu-horizontal-div-item");if(!s){if(s=(0,C.Z)(t.target,"menu-horizontal-inner"),!s||s.classList.contains("active"))return;s=s.firstElementChild.firstElementChild}const n=(0,N.Z)(s),a=e.getCategoryByMenuTab(s);r(a);let l=0,c=0;if(n>0||a.menuScroll){const e=a.elements.container;c=1,l=e.offsetTop+c}o=l,d=!0,i.scrollIntoViewNew(Object.assign({element:l?a.elements.container:i.container.firstElementChild,position:"start",axis:"y",getElementPosition:l?({elementPosition:e})=>e+c:void 0},ee)).finally((()=>{r(a),d=!1}))}),{listenerSetter:a});const h=i.onAdditionalScroll?i.onAdditionalScroll.bind(i):G.Z;return i.onAdditionalScroll=()=>{e.content.parentElement.classList.toggle("scrolled-top",!i.scrollTop),h()},{stickyIntersector:l,setActive:r,setActiveStatic:t=>{if(null==n?void 0:n.local)return;e.scrollable.scrollTop=t.elements.container.offsetTop+1;const i=e.menuScroll.container,s=t.elements.menuTab;i.scrollLeft=s.offsetLeft-i.clientWidth/2+s.offsetWidth/2,r(t,!1)}}},te.onMediaClick=(e,t=!1,i)=>X(void 0,void 0,void 0,(function*(){const s=(0,R.Z)(e.target,"DIV");if(!s)return!1;const n=s.dataset.docId;return!!n&&D.sendDocId(n,t,i)}));const ie=new te;b.GO.emoticonsDropdown=ie;const se=ie},6039:(e,t,i)=>{"use strict";i.d(t,{IA:()=>D,ZP:()=>G,xG:()=>R});var s=i(3173),n=i(3910),a=i(8497),o=i(3035),r=i(5418),d=i(6219),l=i(3512),c=i(671),h=i(279),u=i(8805),p=i(9976),f=i(5432),m=i(8799),g=i(3447),v=i(7746),b=i(8115),y=i(7197),w=i(5400),S=i(2738),C=i(6057),L=i(9405),E=i(2940),I=i(4755),M=i(1273),Z=i(9259),P=i(4064),T=i(4484),k=i(9298),x=i(2796),A=i(5953),_=i(5994);const F=new Set;function D(e,t,i=!1,s=!1){var n;const a=document.createElement("span");let r;if(a.classList.add("super-emoji"),s&&!p.Z?r=function(e){return(0,w.ZP)(e,{entities:[(0,y.Z)(e)]})}(e):(e=(0,v.Z)(e),r=(0,b.Z)(e)),a.append(r),a.children.length>1){const e=a.firstElementChild;a.innerHTML="",a.append(e)}if("IMG"===(null===(n=a.firstElementChild)||void 0===n?void 0:n.tagName)){const e=a.firstElementChild,t=e.src;if(!F.has(t)){e.setAttribute("loading","lazy");const i=document.createElement("span");i.classList.add("emoji-placeholder"),_.Z.isAvailable("animations")&&(e.style.opacity="0",i.style.opacity="1"),e.addEventListener("load",(()=>{(0,o.T2)((()=>{_.Z.isAvailable("animations")&&(e.style.opacity="",i.style.opacity=""),a.classList.remove("empty"),F.add(t)}))}),{once:!0}),a.append(i)}}return t&&(i?t.prepend(a):t.appendChild(a)),a}function R(e){const t=(0,a.Z)(e,"super-emoji");if(!t)return;const i=t.firstElementChild;return i&&i.classList.contains("custom-emoji")?{emoji:i.dataset.stickerEmoji,docId:i.dataset.docId}:e.nodeType===e.TEXT_NODE?{emoji:e.nodeValue}:("SPAN"===e.tagName&&!e.classList.contains("emoji")&&e.firstElementChild&&(e=e.firstElementChild),{emoji:e.getAttribute("alt")||e.innerText})}const B="Emoji.Recent",N=[B,"recent"],O=["",""],U=[["Emoji.SmilesAndPeople","smile"],["Emoji.AnimalsAndNature","animals"],["Emoji.FoodAndDrink","eats"],["Emoji.TravelAndPlaces","car"],["Emoji.ActivityAndSport","sport"],["Emoji.Objects","lamp"],["Emoji.Flags","flag"],["Skin Tones",""]];let H;function z(){if(H)return H;H=new Map([[O,[]],[N,[]]]);for(const e in g.Z){const t=""+g.Z[e],i=U[+t[0]-1];if(!i)continue;let s=H.get(i);s||(s=[],H.set(i,s)),s[+t.slice(1)||0]=e}H.delete(U.pop()),U.unshift(O,N);const e=U.map((([e])=>e)),t=[...H.entries()].sort(((t,i)=>e.indexOf(t[0][0])-e.indexOf(i[0][0])));return H=new Map(t),H}const j=(0,L.C)(42,42);class G extends C.pw{constructor(e){super(e.managers,"super-emojis",(()=>j),16,4,0),this.onCategoryVisibility=({target:e,visible:t})=>{const i=this.categoriesMap.get(e),s=i.elements.renderer,n=[];if(s){n.push(s);const e=new Map;t?(n.push(...i.items.map((({docId:t,element:i})=>{if(!t)return i;const s=i.firstElementChild;return s.clear(!1),e.set(s.docId,new Set([s])),i}))),s.add(e,void 0,void 0,!1)):(s.clearCanvas(),s.middlewareHelper.clean())}else t&&n.push(...i.items.map((({element:e})=>e)));if(i.elements.items.replaceChildren(...n),s&&!t){const e=new Map;i.items.forEach((({docId:t,element:i})=>{if(!t)return;const s=i.firstElementChild;s.clear(),e.set(s.docId,new Set([s]))})),s.add(e,void 0,!0)}},this.onContentClick=e=>{(0,n.Z)(e);const{target:t}=e,i=(0,a.Z)(t,"emoji-category"),s=this.categoriesMap.get(i);if((0,a.Z)(t,"category-title")){if(s.local)return;return void new k.Z({id:s.set.id,access_hash:s.set.access_hash},!0).show()}const o=R(t);if(o){if(o.docId&&!l.Z.premium&&(this.isStandalone?""!==s.id:this.peerId!==l.Z.myId)){const e=document.createElement("a");return e.onclick=()=>{d.ZP.openPremiumBot(),(0,x.PE)()},void(0,x.bC)({langPackKey:"CustomEmoji.PremiumAlert",langPackArguments:[e]})}this.onClick?this.onClick(Object.assign(Object.assign({},o),{element:(0,a.Z)(t,"super-emoji").firstElementChild})):d.ZP.chat.input.onEmojiSelected(o,!1),f.Z&&(0,m.Z)()}},(0,A.Z)(this,e),this.container.classList.add("emoji-padding"),this.content.id="content-emoji",this.activeElements=[]}destroy(){var e;super.destroy(),null===(e=this.menuInnerScroll)||void 0===e||e.destroy()}init(){super.init(),this.init=void 0;const e={root:this.isStandalone?this.content:s.ZP.getElement()};this.categoriesIntersector=new E.Z(this.onCategoryVisibility,e),this.menuOnClickResult=s.Jo.menuOnClick(this,this.menu,this.scrollable,this.menuScroll,void 0,this.listenerSetter);const t=(0,h.y)(this.content,!0);let i,n;if(!this.isStandalone){const e=this.menuInnerScroll=new u.v7(void 0);e.container.classList.add("menu-horizontal-inner-scroll"),i=document.createElement("div"),i.classList.add("menu-horizontal-inner"),i.append(e.container)}z(),n=this.noRegularEmoji?new Map([[[O[0],"recent"],[]]]):z(),n.forEach(((e,[t,i])=>{const s=this.createLocalCategory(t,t,i,!i);s.elements.container.classList.remove("hide"),s.elements.items.classList.add(i&&!this.isStandalone?"is-local":"not-local"),e.forEach((e=>{const t=(0,c.zu)(e);this.addEmojiToCategory({category:s,emoji:{emoji:t},batch:!0})}))}));const a=Promise.all([this.isStandalone?void 0:(0,r.Z)(200),!this.noRegularEmoji&&this.managers.appEmojiManager.getRecentEmojis("native"),!this.isStandalone&&this.managers.appEmojiManager.getRecentEmojis("custom"),this.stickerSetId&&this.managers.appStickersManager.getLocalStickerSet(this.stickerSetId),this.managers.appEmojiManager.getCustomEmojis()]).then((([e,n,a,o,r])=>{t.remove(),o&&(a=o.documents.map((e=>e.id)));const c=this.categories[B],h=this.categories[""];if(this.isStandalone||[c&&[c,n],h&&[h,a]].filter(Boolean).forEach((([e,t])=>{e.limit=32,t.splice(32,t.length-32)})),c&&n)for(const e of n)this.addEmojiToCategory({category:c,emoji:{emoji:e},batch:!0});if(h){if(this.createRendererForCategory(h),a)for(const e of a)this.addEmojiToCategory({category:h,emoji:{emoji:"",docId:e},batch:!0});h.elements.container.style.paddingTop=".5rem"}U.forEach((([e])=>{const t=this.categories[e];t&&(this.toggleLocalCategory(t,!0),e!==B&&""!==e&&(t.menuScroll=this.menuInnerScroll,this.menuInnerScroll.container.append(t.elements.menuTab)))})),this.resizeCategories(),c&&i&&c.elements.menuTab.after(i),r.sets.forEach((e=>{this.renderStickerSet(e)})),this.listenerSetter.add(l.Z)("premium_toggle",(()=>{this.toggleCustomCategory()})),this.listenerSetter.add(l.Z)("stickers_top",this.postponedEvent((e=>{const t=this.categories[e];t&&(this.positionCategory(t,!0),this.listenerSetter.add(s.ZP)("openAfterLayout",(()=>{this.menuOnClickResult.setActiveStatic(t)}),{once:!0}))})));const u=e=>{for(const t in this.categories){const i=this.categories[t].elements.renderer;i&&(i.ignoreSettingDimensions=e,e||i.setDimensionsFromRect(void 0,!0))}};!this.isStandalone&&this.listenerSetter.add(s.ZP)("opened",(()=>{u(!1)})),!this.isStandalone&&this.listenerSetter.add(s.ZP)("close",(()=>{u(!0)})),this.listenerSetter.add(l.Z)("stickers_installed",(e=>{!this.categories[e.id]&&e.pFlags.emojis&&this.renderStickerSet(e,!0)})),this.listenerSetter.add(l.Z)("stickers_deleted",(e=>{const t=this.categories[e.id];if(this.deleteCategory(t)){const{renderer:e}=t.elements;e&&e.middlewareHelper.clean()}})),!this.isStandalone&&this.listenerSetter.add(l.Z)("emoji_recent",this.postponedEvent((e=>{const t=this.categories[e.docId?"":B];if(!t)return;const i=e.docId?t=>t.docId===e.docId:t=>t.emoji===e.emoji,s=(0,P.Z)(t.items,i);if(s){if(t.items.unshift(s),this.isCategoryVisible(t)){const{renderer:e}=t.elements;(0,T.Z)(s.element,t.elements.items,e?1:0,-1),null==e||e.forceRender()}}else this.addEmojiToCategory({category:t,emoji:e,batch:!1,prepend:!0});0===this.closeScrollTop&&this.menuOnClickResult.setActive(e.docId?this.categories[B]:t)}))),!this.isStandalone&&this.listenerSetter.add(d.ZP)("peer_changed",(()=>{this.toggleCustomCategory()})),this.toggleCustomCategory(),this.menuOnClickResult.setActive(null!=c?c:h)}));return(0,S.fc)(this.content,this.onContentClick,{listenerSetter:this.listenerSetter}),(0,Z.Z)({listenTo:this.content,listenerSetter:this.listenerSetter}),a}renderStickerSet(e,t){const i=this.createCategory(e,(0,b.Z)(e.title));this.positionCategory(i,t);const{container:n,menuTabPadding:a}=i.elements;i.elements.items.classList.add("not-local"),i.elements.container.classList.add("is-premium-set"),i.elements.title.classList.add("tgico"),this.createRendererForCategory(i),this.managers.appStickersManager.getStickerSet(e).then((({documents:e})=>{e.forEach((e=>{this.addEmojiToCategory({category:i,emoji:{docId:e.id,emoji:e.stickerEmojiRaw},batch:!0})})),this.onCategoryVisibility({target:i.elements.container,visible:this.isCategoryVisible(i)}),i.setCategoryItemsHeight(),n.classList.remove("hide")})),(0,M.Z)({set:e,container:a,group:s.Yd,lazyLoadQueue:s.Jo.lazyLoadQueue,width:32,height:32,autoplay:!1})}get peerId(){return d.ZP.chat.peerId}getCustomCategory(){return this.categories[""]}toggleCustomCategory(){const e=this.categories[""],t=l.Z.premium||this.peerId===l.Z.myId,i=t||this.isStandalone;super.toggleLocalCategory(e,!!e.items.length&&i),this.content.classList.toggle("has-premium",t)}toggleLocalCategory(e,t){""!==e.id?super.toggleLocalCategory(e,t):this.toggleCustomCategory()}createRendererForCategory(e){const t=w.KZ.create({animationGroup:s.Yd,customEmojiSize:I.Z.active.esgCustomEmoji});e.elements.renderer=t,e.elements.items.append(t)}addEmojiToCategory(e){const{category:t,emoji:i,batch:s,prepend:n}=e;let a=e.element;if(a){const e=document.createElement("span");e.classList.add("super-emoji"),e.append(a),a=e}else if(i.docId){const e=w.LD.create(i.docId),t=document.createElement("span");t.classList.add("super-emoji"),t.append(e),a=t}else a=D(i.emoji,void 0,!1);const o=Object.assign(Object.assign({},i||{emoji:void 0}),{element:a});(e.active||this.activeEmoji&&(o.docId?this.activeEmoji.docId===o.docId:this.activeEmoji.emoji===o.emoji))&&(this.activeEmoji,this.activeElements.push(o),a.classList.add("active")),t.items[n?"unshift":"push"](o),s||this.spliceExceed(t)||this.onLocalCategoryUpdate(t)}setActive(e){var t,i;(e===this.activeEmoji||(null==e?void 0:e.docId)?e.docId!==(null===(t=this.activeEmoji)||void 0===t?void 0:t.docId):(null==e?void 0:e.emoji)!==(null===(i=this.activeEmoji)||void 0===i?void 0:i.emoji))&&(this.activeEmoji=e,this.activeElements.forEach((e=>{e.element.classList.remove("active")})),this.activeElements.length=0,this.categoriesMap.forEach((t=>{t.items.forEach((t=>{(e.docId?t.docId===e.docId:t.emoji===e.emoji)&&(t.element.classList.add("active"),this.activeElements.push(t))}))})))}onClose(){this.closeScrollTop=this.scrollable.scrollTop}}},6057:(e,t,i)=>{"use strict";i.d(t,{pw:()=>D,vT:()=>_,ZP:()=>R});var s=i(3173),n=i(8497),a=i(4755),o=i(2325),r=i(8115),d=i(3512),l=i(5814),c=i(1655),h=i(7009),u=i(2940);class p extends h.Z{constructor(e,t,i){super(e),this.onVisibilityChange=t,this.elementsMap=new Map,this.intersector=new u.Z((e=>{var t;const{target:i,visible:s}=e,n=this.elementsMap.get(i);n.visible=s,s?(n.wasSeen=!0,this.queue.includes(n)||this.queue.push(n)):(0,c.Z)(this.queue,n),null===(t=this.onVisibilityChange)||void 0===t||t.call(this,e),this.setProcessQueueTimeout()}),i)}clear(){super.clear(),this.elementsMap.clear()}observe(e){this.elementsMap.set(e.div,e),super.observe(e)}unobserve(e){this.elementsMap.delete(e.div),super.unobserve(e)}}var f=i(279),m=i(9298),g=i(8805),v=i(4064),b=i(2738),y=i(4484),w=i(319),S=i(2230),C=i(5592),L=i(3163),E=i(5975),I=i(7625),M=i(9259),Z=i(3699),P=i(3541),T=i(1273),k=i(8222),x=i(241),A=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class _{constructor(e,t,i,s){this.regularLazyLoadQueue=e,this.group=t,this.managers=i,this.options=s,this.animated=new Set,this.checkAnimationContainer=(e,t)=>{l.Z.getAnimations(e).forEach((e=>{t?l.Z.checkAnimation(e,!1):l.Z.removeAnimation(e)}))},this.processVisible=e=>A(this,void 0,void 0,(function*(){const t=e.dataset.docId,i=yield this.managers.appDocsManager.getDoc(t),s=a.Z.active.esgSticker.width,n=(0,P.ZP)({doc:i,div:e,width:s,height:s,lazyLoadQueue:null,group:this.group,onlyThumb:!1,play:!0,loop:!0,withLock:!0}).then((({render:e})=>e));return n.then((()=>{this.checkAnimationContainer(e,this.lazyLoadQueue.intersector.isVisible(e))})),n})),this.processInvisible=e=>A(this,void 0,void 0,(function*(){const t=e.dataset.docId,i=yield this.managers.appDocsManager.getDoc(t);this.checkAnimationContainer(e,!1),e.textContent="",this.renderSticker(i,e)})),this.lazyLoadQueue=new p(void 0,(({target:e,visible:t})=>{t||this.processInvisible(e)}),s)}clear(){this.lazyLoadQueue.clear()}renderSticker(e,t,i){return t||((t=document.createElement("div")).classList.add("grid-item","super-sticker"),t.dataset.docId=""+e.id,e.animated&&this.observeAnimated(t)),(0,P.ZP)({doc:e,div:t,lazyLoadQueue:this.regularLazyLoadQueue,group:this.group,onlyThumb:e.animated,loadPromises:i}),t}observeAnimated(e){this.animated.add(e),this.lazyLoadQueue.observe({div:e,load:this.processVisible})}unobserveAnimated(e){this.animated.delete(e),this.lazyLoadQueue.delete({div:e})}}class F{constructor(e){var t,i;const s=document.createElement("div");s.classList.add("emoji-category");const n=document.createElement("div");let a,o,r;n.classList.add("category-items"),e.title&&(a=document.createElement("div"),a.classList.add("category-title"),a.append(e.title)),e.noMenuTab||(o=(0,S.Z)(void 0,{noRipple:!0}),o.classList.add("menu-horizontal-div-item"),r=document.createElement("div"),r.classList.add("menu-horizontal-div-item-padding"),o.append(r)),a&&s.append(a),s.append(n),this.elements={container:s,title:a,items:n,menuTab:o,menuTabPadding:r},this.id=e.id,this.items=[],this.getContainerSize=e.getContainerSize,this.getElementMediaSize=e.getElementMediaSize,this.gapX=null!==(t=e.gapX)&&void 0!==t?t:0,this.gapY=null!==(i=e.gapY)&&void 0!==i?i:0}setCategoryItemsHeight(){const{width:e}=this.getContainerSize(),t=this.getElementMediaSize().width;let i=e/t;this.gapX&&(i-=Math.floor(i-1)*this.gapX/t),i=Math.floor(i);const s=Math.ceil(this.items.length/i);let n=s*t;this.gapY&&(n+=(s-1)*this.gapY),this.elements.items.style.minHeight=n+"px"}}class D{constructor(e,t,i,n,a,o){this.managers=e,this.categoryItemsClassName=t,this.getElementMediaSize=i,this.padding=n,this.gapX=a,this.gapY=o,this.mounted=!1,this.resizeCategories=()=>{for(const[e,t]of this.categoriesMap)t.setCategoryItemsHeight()},this.postponedEvent=e=>(...t)=>{s.ZP.isActive()?this.postponedEvents.push({cb:e,args:t}):e(...t)},this.categories={},this.categoriesMap=new Map,this.categoriesByMenuTabMap=new Map,this.localCategories=[],this.postponedEvents=[],this.listenerSetter=new Z.Z,this.container=document.createElement("div"),this.container.classList.add("tabs-tab","emoticons-container"),this.menuWrapper=document.createElement("div"),this.menuWrapper.classList.add("menu-wrapper","emoticons-menu-wrapper"),this.menu=document.createElement("nav"),this.menu.className="menu-horizontal-div no-stripe justify-start emoticons-menu",this.menuWrapper.append(this.menu),this.menuScroll=new g.v7(this.menuWrapper),this.content=document.createElement("div"),this.content.classList.add("emoticons-content"),this.container.append(this.menuWrapper,this.content),this.scrollable=new g.ZP(this.content,"STICKERS")}getCategoryByContainer(e){return this.categoriesMap.get(e)}getCategoryByMenuTab(e){return this.categoriesByMenuTabMap.get(e)}createCategory(e,t,i,s){const n=new F({id:""+e.id,title:t,overflowElement:this.content,getContainerSize:()=>{let e,t;if(this.getContainerSize){const i=this.getContainerSize();e=i.width,t=i.height}else{const t=k.Z.getPropertyAsSize("esg-width");e=void 0===t?x.Z.width:t}return{width:e-this.padding,height:t}},getElementMediaSize:this.getElementMediaSize,gapX:this.gapX,gapY:this.gapY,noMenuTab:s});this.categoryItemsClassName&&n.elements.items.classList.add(this.categoryItemsClassName);const a=n.elements.container;return a.classList.add("hide"),n.set=e,this.categories[e.id]=n,this.categoriesMap.set(a,n),!s&&this.categoriesByMenuTabMap.set(n.elements.menuTab,n),this.categoriesIntersector.observe(a),!s&&this.menuOnClickResult.stickyIntersector.observeStickyHeaderChanges(a),i||!s&&n.elements.menuTab.classList.add("not-local"),n}positionCategory(e,t){const{menuTab:i,container:s}=e.elements,n=t?this.localCategories.filter((e=>e.mounted)).length:65535;let a=!1;const o=t?this.localCategories.filter((e=>e.menuScroll&&!a?(a=!0,!0):e.mounted&&!e.menuScroll&&e.elements.menuTab)).length:65535;(0,y.Z)(s,this.scrollable.container,n),(0,y.Z)(i,this.menu,o)}isCategoryVisible(e){return this.categoriesIntersector.getVisible().includes(e.elements.container)}toggleLocalCategory(e,t){var i;if(t){const t=this.localCategories.indexOf(e),i=this.localCategories.slice(0,t);let s=0,n=0;i.forEach((e=>{e.mounted?e.elements.menuTab&&!e.menuScroll||++n:(++s,++n)}));const a=t-s,o=t-n;e.elements.menuTab&&(0,y.Z)(e.elements.menuTab,this.menu,o),(0,y.Z)(e.elements.container,this.scrollable.container,a)}else null===(i=e.elements.menuTab)||void 0===i||i.remove(),e.elements.container.remove();e.mounted=t}createLocalCategory(e,t,i,s){const n=this.createCategory({id:e},t&&(0,o.ag)(t),!0,s);return n.local=!0,this.localCategories.push(n),n.elements.title&&n.elements.title.classList.add("disable-hover"),s||(i&&n.elements.menuTab.classList.add("tgico","tgico-"+i),n.elements.menuTabPadding.remove()),this.toggleLocalCategory(n,!1),n}onLocalCategoryUpdate(e){e.setCategoryItemsHeight(),this.toggleLocalCategory(e,!!e.items.length)}deleteCategory(e){return!!e&&(e.elements.container.remove(),e.elements.menuTab.remove(),this.categoriesIntersector.unobserve(e.elements.container),delete this.categories[e.id],this.categoriesMap.delete(e.elements.container),this.categoriesByMenuTabMap.delete(e.elements.menuTab),!0)}spliceExceed(e){if(void 0===e.limit)return!1;const{items:t,limit:i}=e;return t.splice(i,t.length-i).forEach((({element:e})=>{e.remove()})),this.onLocalCategoryUpdate(e),!0}init(){this.listenerSetter.add(s.ZP)("closed",(()=>{this.postponedEvents.forEach((({cb:e,args:t})=>{e(...t)})),this.postponedEvents.length=0}))}destroy(){var e,t,i,s;this.getContainerSize=void 0,this.postponedEvents.length=0,null===(e=this.categoriesIntersector)||void 0===e||e.disconnect(),this.listenerSetter.removeAll(),this.scrollable.destroy(),null===(t=this.menuScroll)||void 0===t||t.destroy(),null===(s=null===(i=this.menuOnClickResult)||void 0===i?void 0:i.stickyIntersector)||void 0===s||s.disconnect()}}class R extends D{constructor(e){super(e,"super-stickers",(()=>a.Z.active.esgSticker),6,4,4),this.onCategoryVisibility=({target:e,visible:t,entry:i})=>{const s=this.categoriesMap.get(e);s.elements.items.replaceChildren(...t?s.items.map((({element:e})=>e)):[])},this.setTyping=(e=!1)=>{(e||s.ZP.isActive()&&s.ZP.tab===this)&&d.Z.dispatchEvent("choosing_sticker",!e)},this.container.classList.add("stickers-padding"),this.content.id="content-stickers"}setFavedLimit(e){this.categories.faved.limit=e}categoryAppendStickers(e,t){const{container:i}=e.elements;t.then((t=>{const s=this.isCategoryVisible(e);t.forEach((t=>{const i=this.superStickerRenderer.renderSticker(t);e.items.push({document:t,element:i}),s&&e.elements.items.append(i)})),e.setCategoryItemsHeight(),i.classList.remove("hide")}))}renderStickerSet(e,t=!1){return A(this,void 0,void 0,(function*(){const i=this.createCategory(e,(0,r.Z)(e.title)),{menuTabPadding:n}=i.elements,a=this.managers.appStickersManager.getStickerSet(e);this.categoryAppendStickers(i,a.then((e=>e.documents))),this.positionCategory(i,t),(0,T.Z)({set:e,container:n,group:s.Yd,lazyLoadQueue:s.Jo.lazyLoadQueue,width:32,height:32,autoplay:!1})}))}init(){super.init(),this.scrollable.onAdditionalScroll=()=>{this.setTyping()};const e={root:s.ZP.getElement()};this.categoriesIntersector=new u.Z(this.onCategoryVisibility,e);const t=e=>{e.elements.items.replaceChildren(),e.items.forEach((({element:e})=>this.superStickerRenderer.unobserveAnimated(e))),e.items.length=0};this.scrollable.container.addEventListener("click",(e=>{const t=e.target;if((0,n.Z)(t,"category-title")){const e=(0,n.Z)(t,"emoji-category"),i=this.categoriesMap.get(e);if(i.local)return;new m.Z({id:i.set.id,access_hash:i.set.access_hash}).show()}else s.Jo.onMediaClick(e)})),this.menuOnClickResult=s.Jo.menuOnClick(this,this.menu,this.scrollable,this.menuScroll);const i=(0,f.y)(this.content,!0),o=(e,t)=>{e.limit&&(t=t.slice(0,e.limit));const i=new Set(t.map((e=>e.id)));(0,I.Z)(e.items,(t=>{i.has(t.document.id)||this.deleteSticker(e,t.document,!0)})),this.toggleLocalCategory(e,!!t.length),(0,I.Z)(t,((t,i)=>{this.unshiftSticker(e,t,!0,i)})),this.spliceExceed(e),e.elements.container.classList.remove("hide")},r=this.createLocalCategory("faved","FavoriteStickers","savedmessages"),l=this.createLocalCategory("recent","Stickers.Recent","recent");l.limit=20;const c=(0,S.Z)("close",{noRipple:!0});l.elements.title.append(c),(0,b.fc)(c,(()=>{(0,C.Z)({titleLangKey:"ClearRecentStickersAlertTitle",descriptionLangKey:"ClearRecentStickersAlertMessage",button:{langKey:"Clear"}}).then((()=>{this.managers.appStickersManager.clearRecentStickers()}),w.Z)}));const h=this.createLocalCategory("premium","PremiumStickersShort"),p=document.createElement("span");p.classList.add("tgico-star","color-premium"),h.elements.menuTab.append(p);const g=[Promise.all([this.managers.apiManager.getLimit("favedStickers"),this.managers.appStickersManager.getFavedStickersStickers()]).then((([e,t])=>{this.setFavedLimit(e),o(r,t)})),this.managers.appStickersManager.getRecentStickersStickers().then((e=>{o(l,e)})),this.managers.appStickersManager.getAllStickers().then((e=>{for(const t of e.sets)this.renderStickerSet(t)})),this.managers.appStickersManager.getPremiumStickers().then((e=>{const t=e.length;this.toggleLocalCategory(h,d.Z.premium&&!!t),this.categoryAppendStickers(h,Promise.resolve(e)),d.Z.addEventListener("premium_toggle",(e=>{this.toggleLocalCategory(this.categories.premium,e&&!!t)}))}))];Promise.race(g).finally((()=>{i.remove()})),Promise.all(g).finally((()=>{this.mounted=!0,this.setTyping();const e=this.categories.faved,t=this.categories.recent;this.menuOnClickResult.setActive(e.items.length?e:t),d.Z.addEventListener("stickers_installed",(e=>{this.categories[e.id]||this.renderStickerSet(e,!0)}))})),this.superStickerRenderer=new _(s.Jo.lazyLoadQueue,s.Yd,this.managers,e);const v=this.superStickerRenderer.lazyLoadQueue;s.ZP.addLazyLoadQueueRepeat(v,this.superStickerRenderer.processInvisible),d.Z.addEventListener("sticker_updated",(({type:e,document:t,faved:i})=>{const s=this.categories["faved"===e?"faved":"recent"];s&&(i?this.unshiftSticker(s,t):this.deleteSticker(s,t))})),d.Z.addEventListener("stickers_deleted",(({id:e})=>{const i=this.categories[e];this.deleteCategory(i)&&t(i)})),d.Z.addEventListener("stickers_top",this.postponedEvent((e=>{const t=this.categories[e];t&&(this.positionCategory(t,!0),s.ZP.addEventListener("openAfterLayout",(()=>{this.menuOnClickResult.setActiveStatic(t)}),{once:!0}))}))),d.Z.addEventListener("stickers_order",(({type:e,order:t})=>{"stickers"===e&&t.forEach((e=>{const t=this.categories[e];t&&this.positionCategory(t,!1)}))})),d.Z.addEventListener("stickers_updated",(({type:e,stickers:t})=>{const i=this.categories["faved"===e?"faved":"recent"];i&&o(i,t)})),d.Z.addEventListener("app_config",(()=>{this.managers.apiManager.getLimit("favedStickers").then((e=>{this.setFavedLimit(e)}))})),a.Z.addEventListener("resize",this.resizeCategories),(0,M.Z)({listenTo:this.content,listenerSetter:new Z.Z});const y="menu";(0,L.Z)({listenTo:this.content,verifyRecent:e=>!!(0,E.Z)(e,this.categories.recent.elements.items),onOpen:()=>{s.ZP.setIgnoreMouseOut(y,!0)},onClose:()=>{s.ZP.setIgnoreMouseOut(y,!1)}}),this.init=null}deleteSticker(e,t,i){const s=(0,v.Z)(e.items,(e=>e.document.id===t.id));s&&(s.element.remove(),i||this.onLocalCategoryUpdate(e))}unshiftSticker(e,t,i,s){if(void 0!==s){const i=e.items[s];if(i&&i.document.id===t.id)return}let n=(0,v.Z)(e.items,(e=>e.document.id===t.id));n||(n={element:this.superStickerRenderer.renderSticker(t),document:t}),e.items.unshift(n),e.elements.items.prepend(n.element),i||this.spliceExceed(e)}unshiftRecentSticker(e){this.managers.appStickersManager.saveRecentSticker(e.id)}deleteRecentSticker(e){this.managers.appStickersManager.saveRecentSticker(e.id,!0)}onClosed(){this.setTyping(!0)}onOpened(){this.setTyping(),this.resizeCategories()}}},36:(e,t,i)=>{"use strict";i.d(t,{G:()=>s});const s=()=>{const e=document.createElement("div");return e.classList.add("gradient-delimiter"),e}},5948:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(2325);function n(e){const t=document.createElement("span");return t.classList.add("badge-fake"),(0,s.$d)(t,e?"ScamMessage":"FakeMessage"),t}},1080:(e,t,i)=>{"use strict";i.d(t,{Z:()=>f});var s=i(5814),n=i(3725),a=i(3035),o=i(3512),r=i(8847),d=i(7009),l=i(2940);class c extends d.Z{constructor(e,t){super(e),this.onVisibilityChange=t,this.intersector=new l.Z((e=>{const{target:t,visible:i}=e,s=(0,r.Z)(this.queue,(e=>e.div===t));i&&s.length&&s.forEach((e=>{this.queue.unshift(e)})),this.onVisibilityChange&&this.onVisibilityChange(e),this.setProcessQueueTimeout()}))}observe(e){super.observe(e)}}var h=i(2887),u=i(319),p=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class f{constructor(e,t,i,r=!0){this.element=e,this.group=t,this.scrollable=i,this.scrollPromise=Promise.resolve(),this.timeout=0,this.onScroll=()=>{this.timeout?clearTimeout(this.timeout):this.scrollPromise=(0,n.Z)(),this.timeout=window.setTimeout((()=>{this.timeout=0,this.scrollPromise.resolve()}),150)},this.processInvisibleDiv=e=>this.scrollPromise.then((()=>p(this,void 0,void 0,(function*(){if(this.lazyLoadQueue.intersector.isVisible(e))return;const t=e.querySelector("video"),i=e.querySelector("img, canvas");i&&(i.classList.remove("hide"),yield(0,a.d1)()),!this.lazyLoadQueue.intersector.isVisible(e)&&t&&(t.remove(),t.src="",t.load(),s.Z.getAnimations(t).forEach((e=>{s.Z.removeAnimation(e)})))})))),this.managers=o.Z.managers,this.lazyLoadQueue=new c(void 0,(({target:e,visible:t})=>{t?this.processVisibleDiv(e):this.processInvisibleDiv(e)})),r&&this.attach()}attach(){this.scrollable.container.addEventListener("scroll",this.onScroll)}detach(){this.clear(),this.scrollable.container.removeEventListener("scroll",this.onScroll)}clear(){this.lazyLoadQueue.clear()}processVisibleDiv(e){e.querySelector("video")||this.lazyLoadQueue.push({div:e,load:()=>{const t=e.dataset.docId;return Promise.all([this.managers.appDocsManager.getDoc(t),this.scrollPromise]).then((([t])=>p(this,void 0,void 0,(function*(){const i=(yield(0,h.Z)({doc:t,container:e,lazyLoadQueue:null,group:this.group,noInfo:!0,noPreview:!0})).loadPromise;return i.finally((()=>{const t=e.querySelector("video"),i=e.querySelector("img, canvas");i&&i.classList.add("hide"),t&&!t.parentElement&&setTimeout((()=>{t.src="",t.load(),s.Z.getAnimations(t).forEach((e=>{s.Z.removeAnimation(e)}))}),0),this.lazyLoadQueue.intersector.isVisible(e)||this.processInvisibleDiv(e)})),i}))))}})}add(e,t=this.element){const i=document.createElement("div");i.classList.add("gif","grid-item"),i.dataset.docId=""+e.id,t.append(i),this.lazyLoadQueue.observe({div:i,load:u.Z}),(0,h.Z)({doc:e,container:i,lazyLoadQueue:null,noInfo:!0,onlyPreview:!0})}}},6008:(e,t,i)=>{"use strict";i.d(t,{X:()=>c});var s=i(426),n=i(3035),a=i(4789),o=i(5975),r=i(2648),d=i(2738),l=i(5994);function c(e,t,i,c,h=200,u,p){const f=(0,s.Z)({content:t,type:e||"tabs"===t.dataset.animation?"tabs":"navigation",transitionTime:h,onTransitionEnd:c,listenerSetter:p});if(!e)return f;const m=new Proxy(f,{apply:(t,i,s)=>{const n=+s[0],a=void 0===s[1]||s[1],o=e.querySelector(`[data-tab="${n}"]`)||e.children[n];g(o,n,a)}}),g=(s,o,r=!0)=>{return d=this,c=void 0,m=function*(){const d=t.children[o];if(i){const e=i(o,d,r),t=e instanceof Promise?yield e:e;if(void 0!==t&&!t)return}u&&u.scrollIntoViewNew({element:s.parentElement.children[o],position:"center",forceDirection:r?void 0:a.f.Static,forceDuration:h,axis:"x"}),l.Z.isAvailable("animations")||(r=!1);const c=f.prevId();if(s.classList.contains("active")||o===c)return!1;const p=r?n.T2:e=>e(),m=e.querySelector(b.toLowerCase()+".active");m&&p((()=>{m.classList.remove("active")})),v&&-1!==c&&r&&p((()=>{const e=s.querySelector("i"),t=s.parentElement.children[c].querySelector("i");t.classList.remove("animate"),e.classList.remove("animate");const i=t.parentElement.parentElement.offsetLeft-e.parentElement.parentElement.offsetLeft,a=t.clientWidth/e.clientWidth;e.style.transform=`translate3d(${i}px, 0, 0) scale3d(${a}, 1, 1)`,(0,n.T2)((()=>{e.classList.add("animate"),e.style.transform="none"}))})),p((()=>{s.classList.add("active")})),f(o,r)},new((p=void 0)||(p=Promise))((function(e,t){function i(e){try{n(m.next(e))}catch(e){t(e)}}function s(e){try{n(m.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof p?n:new p((function(e){e(n)}))).then(i,s)}n((m=m.apply(d,c||[])).next())}));var d,c,p,m},v=!e.classList.contains("no-stripe"),b=e.firstElementChild.tagName;return(0,d.fc)(e,(t=>{let i,s=t.target;if(s=(0,o.Z)(s,e),!s)return!1;if(s.dataset.tab){if(i=+s.dataset.tab,-1===i)return!1}else i=(0,r.Z)(s);g(s,i)}),{listenerSetter:p}),m}},503:(e,t,i)=>{"use strict";i.d(t,{I1:()=>C,ZP:()=>I,rf:()=>w});var s=i(3910),n=i(6669),a=i(1544),o=i(8763),r=i(4668),d=i(3299),l=i(9336),c=i(1293),h=i(5565),u=i(669),p=i(130),f=i(2325),m=i(1507),g=i(6241),v=i(6535),b=i(3066),y=i(5400);function w(e,t,i,o){return r=this,l=void 0,h=function*(){const r=[],l=(null==i?void 0:i.some((e=>"messageEntityCustomEmoji"===e._)))?L():void 0,c=(0,b.Z)(t,{entities:i,wrappingForPeerId:o,loadPromises:r,customEmojiRenderer:l});c.querySelectorAll('[contenteditable="false"]').forEach((e=>{e.contentEditable="inherit",e.classList.add("pc")})),r.length&&(yield Promise.all(r)),c.querySelectorAll(".input-selectable").forEach((e=>{e.prepend((0,y.SZ)(!0))}));const h=u.Y?u.Z.getInstance():void 0,p=Array.from(c.querySelectorAll(".custom-emoji-placeholder")).map((e=>(e.dataset.ces="1",e.customEmojiElement))),f=(0,a.Z)(c);null==l||l.destroy();const m=(0,d.Z)(e);if(m.node);else{const t=document.createRange();let i=e.lastChild;i||e.append(i=document.createTextNode("")),t.setStartAfter(i),t.collapse(!0),m.selection.removeAllRanges(),m.selection.addRange(t)}e.addEventListener("input",s.Z,{capture:!0,once:!0,passive:!1}),null==h||h.onBeforeInput({inputType:"insertContent"}),window.document.execCommand("insertHTML",!1,f),Array.from(e.querySelectorAll("[data-ces]")).forEach(((e,t)=>{delete e.dataset.ces;const i=p[t];e.customEmojiElement=i,i.placeholder=e})),e.querySelectorAll(".pc").forEach((e=>{e.contentEditable="false"})),null==h||h.removeExtraBOMs(e),(0,n.Z)(e,"input")},new((c=void 0)||(c=Promise))((function(e,t){function i(e){try{n(h.next(e))}catch(e){t(e)}}function s(e){try{n(h.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof c?n:new c((function(e){e(n)}))).then(i,s)}n((h=h.apply(r,l||[])).next())}));var r,l,c,h}let S=()=>{document.addEventListener("paste",(e=>{const t=(0,o.Z)(e.target,'contenteditable="true"');if(!t)return;const i=!!t.dataset.noLinebreaks;let s,n;e.preventDefault();let a=(e.originalEvent||e).clipboardData.getData("text/plain"),r=!0,d=(e.originalEvent||e).clipboardData.getData("text/html");const c=e=>"messageEntityEmoji"===e._||"messageEntityLinebreak"===e._&&!i;if(i){const e=/[\r\n]/g;a=a.replace(e,""),d=d.replace(e,"")}const h=(t.dataset.peerId||m.NM).toPeerId();if(d.trim()){d=d.replace(//,""),d=d.replace(//,""),d=d.replace('
',"");const e=d.match(/([\s\S]*)<\/body>/);e&&(d=e[1].trim());const t=(new DOMParser).parseFromString(d,"text/html").body||document.createElement("body");let i=t.firstChild;for(;i;){const e=i.nextSibling;i.nodeType===i.TEXT_NODE&&(i.nodeValue.trim()||i.remove()),i=e}const o=(0,l.Z)(t,!0,!1);h||(o.entities=o.entities.filter((e=>"messageEntityCustomEmoji"!==e._)));{const e=o.value.split("\n");let t=0;for(let i=0;i{e.offset>=n&&(e.offset-=1)})),t+=a.length}t+=1}const i=e.join("\n");o.value=i}if(o.value.replace(/\s/g,"").length===a.replace(/\s/g,"").length||o.entities.find((e=>"messageEntityCustomEmoji"===e._))){s=o.value,n=o.entities,r=!1;let e=(0,v.Z)(s);e=e.filter(c),(0,g.Z)(n,e)}}r&&(s=a,n=(0,v.Z)(s),n=n.filter(c)),w(t,s,n,h)})),S=null};var C;function L(){return y.KZ.create({wrappingDraft:!0,isSelectable:!0})}function E(e){const t=Array.from(e.querySelectorAll(".custom-emoji, .custom-emoji-placeholder"));let i=e.querySelector(".custom-emoji-renderer");if(!i&&t.length)i=L(),e.prepend(i);else if(i&&!t.length)return void i.remove();if(!i)return;const s=new Map;t.forEach((e=>{const t=e instanceof y.LD?e:e.customEmojiElement,{docId:i}=t;let n=s.get(i);n||s.set(i,n=new Set),n.add(t)}));for(const[e,t]of s){let s=i.customEmojis.get(e);if(s)for(const e of s)t.has(e)||e.destroy();else s=new Set;for(const e of t)s.has(e)||e.connectedCallback()}i.add(s,!1),i.forceRender()}!function(e){e[e.Neutral=0]="Neutral",e[e.Valid=1]="Valid",e[e.Error=2]="Error"}(C||(C={}));class I{constructor(e={}){this.options=e,this.container=document.createElement("div"),this.container.classList.add("input-field"),this.required=e.required,this.validate=e.validate,void 0!==e.maxLength&&void 0===e.showLengthOn&&(e.showLengthOn=Math.min(40,Math.round(e.maxLength/3)));const{placeholder:t,maxLength:i,showLengthOn:s,name:n,plainText:a,canBeEdited:o=!0,autocomplete:d}=e,h=e.label||e.labelText,m=[];let g;if(a?(this.container.innerHTML=`\n \n `,g=this.container.firstElementChild):(S&&S(),this.container.innerHTML='
',g=this.container.firstElementChild,g.contentEditable=""+!!o,u.Z.getInstance(),g.addEventListener("mousedown",(e=>{var t;const i=document.getSelection();if(!i.isCollapsed)return;const s=(0,r.Z)(e.target,"IMG");if(!s)return;const n=s.getBoundingClientRect(),a=n.left+n.width/2,o=e.clientX>=a,d=document.createRange();d.setStartAfter(o?s:null!==(t=s.previousSibling)&&void 0!==t?t:s),i.removeAllRanges(),i.addRange(d)})),m.push((()=>{(0,c.Z)(g)&&g.replaceChildren(),u.Y&&Array.from(g.querySelectorAll("br:not(.br-not-br)")).forEach((e=>{e.remove()})),(0,y.Cx)(Array.from(g.querySelectorAll(".input-something"))),E(g)}))),(0,p.m)(g),e.inputMode&&(g.inputMode=e.inputMode),t&&(0,f.$d)(g,t,void 0,"placeholder"),h||t){const e=document.createElement("div");e.classList.add("input-field-border"),this.container.append(e)}if(h&&(this.label=document.createElement("label"),this.setLabel(),this.container.append(this.label)),i){const e=this.container.lastElementChild;let t=!1;const n=()=>{const n=g.classList.contains("error"),o=a?g.value.length:[...(0,l.Z)(g,!1,!1).value].length,r=i-o,d=r<0;g.classList.toggle("error",d),d||r<=s?(this.setLabel(),e.append(` (${i-o})`),t||(t=!0)):(n&&!d||t)&&(this.setLabel(),t=!1)};m.push(n)}!e.withLinebreaks&&!a&&(g.dataset.noLinebreaks="1",g.addEventListener("keypress",(e=>{if("Enter"===e.key)return e.preventDefault(),!1}))),m.length&&g.addEventListener("input",(()=>{m.forEach((e=>e()))})),this.input=g}select(){this.value&&(this.options.plainText?this.input.select():function(e){const t=document.createRange();t.selectNodeContents(e);const i=window.getSelection();i.removeAllRanges(),i.addRange(t)}(this.input))}setLabel(){this.label.textContent="",this.options.labelText?(0,p.Z)(this.label,this.options.labelText):this.label.append((0,f.ag)(this.options.label,this.options.labelOptions))}get value(){return this.options.plainText?this.input.value:(0,l.Z)(this.input,!1,!1).value}set value(e){this.setValueSilently(e,!0),this.simulateInputEvent()}simulateInputEvent(){(0,n.Z)(this.input,"input")}setValueSilently(e,t){this.options.plainText?this.input.value=e:((0,h.Z)(this.input,e),E(this.input))}isChanged(){return this.value!==this.originalValue}isValid(){return!this.input.classList.contains("error")&&(!this.validate||this.validate())&&(!this.required||!(0,c.Z)(this.input))}isValidToChange(){return this.isValid()&&this.isChanged()}setDraftValue(e="",t){this.options.plainText||(e=(0,a.Z)((0,b.Z)(e))),t?this.setValueSilently(e,!1):this.value=e}setOriginalValue(e="",t){this.originalValue=e,this.setDraftValue(e,t)}setState(e,t){t?(this.label.textContent="",this.label.append((0,f.ag)(t,this.options.labelOptions))):this.setLabel(),this.input.classList.toggle("error",!!(e&C.Error)),this.input.classList.toggle("valid",!!(e&C.Valid))}setError(e){this.setState(C.Error,e)}}},9496:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var s=i(669),n=i(6854),a=i(2325),o=i(503),r=i(9099);const d=new RegExp(`(${n.Z})|(
)`,"g");class l extends o.ZP{constructor(e){super(e),this.input.addEventListener("input",(()=>{this.updateInnerHTML(),this.onFakeInput()})),e.placeholder&&(0,a.$d)(this.inputFake,e.placeholder,void 0,"placeholder"),this.input.classList.add("scrollable","scrollable-y","no-scrollbar"),this.inputFake=document.createElement("div"),this.inputFake.contentEditable="true",this.inputFake.tabIndex=-1,this.inputFake.className=this.input.className+" input-field-input-fake"}onFakeInput(e=!0,t){var i;const{scrollHeight:s}=this.inputFake;null!=t||(t=!this.input.isContentEditable);const n=+this.input.style.height.replace("px","");if(n===s)return;const a=t?0:Math.round(50*Math.log(Math.abs(s-n)));this.input.style.transitionDuration=`${a}ms`,e&&(null===(i=this.onChangeHeight)||void 0===i||i.call(this,s),this.input.style.height=s?s+"px":"");const o="is-changing-height";(0,r.Z)({element:this.input,className:o,forwards:!0,duration:a,onTransitionEnd:()=>{this.input.classList.remove(o)}})}updateInnerHTML(e=this.input.innerHTML){e=e.replace(//,"").replace(/().+?\/custom-emoji-element>/g,"$1"),s.Y&&(e=e.replace(d,"")),this.inputFake.innerHTML=e}setValueSilently(e,t){super.setValueSilently(e,t),this.updateInnerHTML(),t||this.onFakeInput()}}},3607:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(503);class n{constructor(e,t){this.prevValue="",this.timeout=0,this.onInput=()=>{if(!this.onChange)return;const e=this.value;e!==this.prevValue&&(this.prevValue=e,clearTimeout(this.timeout),this.timeout=window.setTimeout((()=>{this.onChange(e)}),200))},this.onClearClick=()=>{this.value="",this.onChange&&this.onChange(""),this.onClear&&this.onClear()},this.inputField=new s.ZP({placeholder:e,plainText:!0}),this.container=this.inputField.container,this.container.classList.remove("input-field"),this.container.classList.add("input-search"),this.onChange=t,this.input=this.inputField.input,this.input.classList.add("input-search-input");const i=document.createElement("i");i.classList.add("tgico","tgico-search"),this.clearBtn=document.createElement("i"),this.clearBtn.classList.add("tgico","btn-icon","tgico-close"),this.input.addEventListener("input",this.onInput),this.clearBtn.addEventListener("click",this.onClearClick),this.container.append(i,this.clearBtn)}get value(){return this.inputField.value}set value(e){this.prevValue=e,clearTimeout(this.timeout),this.inputField.value=e}remove(){clearTimeout(this.timeout),this.input.removeEventListener("input",this.onInput),this.clearBtn.removeEventListener("click",this.onClearClick)}}},2153:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(2940),n=i(8847),a=i(4064),o=i(7009),r=i(8594);class d extends o.Z{constructor(e,t){super(e),this.onVisibilityChange=({target:e,visible:t})=>{(0,n.Z)(this.queue,(t=>t.div===e)).forEach((e=>{t&&(e.wasSeen=!0),e.visible=t;const i=this.queue.findIndex((e=>!e.visible));this.queue.splice(Math.max(0,i),0,e)})),this.setProcessQueueTimeout()},this.intersector=new s.Z(this.onVisibilityChange),!t&&(0,r.ZP)((()=>{this.lock()}),(()=>{this.unlockAndRefresh()}))}getItem(){return(0,a.Z)(this.queue,(e=>e.wasSeen))}processItem(e){const t=Object.create(null,{processItem:{get:()=>super.processItem}});return i=this,s=void 0,a=function*(){yield t.processItem.call(this,e),this.intersector.unobserve(e.div)},new((n=void 0)||(n=Promise))((function(e,t){function o(e){try{d(a.next(e))}catch(e){t(e)}}function r(e){try{d(a.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(i,s||[])).next())}));var i,s,n,a}addElement(e,t){var i;return!!super.addElement(e,t)&&(this.observe(t),null!==(i=t.wasSeen)&&void 0!==i||(t.wasSeen=!1),!0)}setAllSeen(){this.queue.forEach((e=>{e.wasSeen=!0})),this.setProcessQueueTimeout()}}},7009:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(8847),n=i(4421);class a extends n.Z{constructor(e){super(e),this.queue=[],this.inProcess=new Set}lock(){super.lock(),this.intersector.lock()}unlock(){super.unlock(),this.intersector.unlock()}unlockAndRefresh(){super.unlock(),this.intersector.unlockAndRefresh()}clear(){super.clear(),this.intersector.disconnect()}refresh(){this.intersector.refresh()}loadItem(e){return e.load(e.div)}addElement(e,t){if(this.queue.find((e=>e.div===t.div&&e.load===t.load)))return!1;for(const e of this.inProcess)if(e.div===t.div&&e.load===t.load)return!1;return this.queue[e](t),!0}setProcessQueueTimeout(){var e;null!==(e=this.intersectorTimeout)&&void 0!==e||(this.intersectorTimeout=window.setTimeout((()=>{this.intersectorTimeout=void 0,this.processQueue()}),0))}push(e){super.push(e)}unshift(e){super.unshift(e)}delete(e){(0,s.Z)(this.queue,(t=>t.div===e.div)),this.unobserve(e)}observe(e){this.intersector.observe(e.div)}unobserve(e){this.intersector.unobserve(e.div)}}},7207:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(3013),n=i(65);class a extends n.Z{constructor(e={}){super({step:1e3/60/1e3,min:0,max:1,withTransition:e.withTransition,useTransform:e.useTransform},0),this.options=e,this.onLoadedData=()=>{this.setSeekMax()},this.onEnded=()=>{this.setProgress()},this.onPlay=()=>{const e=()=>{this.setProgress(),this.progressRAF=this.media.paused?void 0:window.requestAnimationFrame(e)};this.progressRAF&&(window.cancelAnimationFrame(this.progressRAF),this.progressRAF=void 0),this.streamable&&this.setLoadProgress(),e()},this.onTimeUpdate=()=>{this.media.paused&&(this.setProgress(),this.streamable&&this.setLoadProgress())},this.onProgress=e=>{this.setLoadProgress()}}setMedia({media:e,streamable:t,duration:i}){this.media&&this.removeListeners(),t&&!this.filledLoad?(this.filledLoad=document.createElement("div"),this.filledLoad.classList.add("progress-line__filled","progress-line__loaded"),this.container.prepend(this.filledLoad)):this.filledLoad&&this.filledLoad.classList.toggle("hide",!t),this.media=e,this.streamable=t,(!e.paused||e.currentTime>0)&&this.onPlay();let s=!1;this.setSeekMax(i),this.setListeners(),this.setHandlers({onMouseDown:()=>{var e,t;s=!this.media.paused,s&&this.media.pause(),null===(t=null===(e=this.options)||void 0===e?void 0:e.onSeekStart)||void 0===t||t.call(e)},onMouseUp:e=>{var t,i;s&&this.media.play(),null===(i=null===(t=this.options)||void 0===t?void 0:t.onSeekEnd)||void 0===i||i.call(t)}})}scrub(e){const t=super.scrub(e);return this.media.currentTime=t,t}setLoadProgress(){if(s.Z.isSafariBuffering(this.media))return;const e=this.media.buffered,t=e.length,i=this.media.currentTime;let n=0,a=0;for(let s=0;s=t&&t>=n&&(n=t,a=e.end(s))}const o=this.max?a/this.max:0;this.filledLoad.style.width=100*o+"%"}setSeekMax(e){const t=this.media.duration||0;(void 0===e||t)&&(e=t),(this.max=e)?this.seek.setAttribute("max",""+this.max):this.media.addEventListener("loadeddata",this.onLoadedData)}setProgress(){if(s.Z.isSafariBuffering(this.media))return;const e=this.media.currentTime;super.setProgress(e)}setListeners(){super.setListeners(),this.media.addEventListener("ended",this.onEnded),this.media.addEventListener("play",this.onPlay),this.media.addEventListener("pause",this.onTimeUpdate),this.media.addEventListener("timeupdate",this.onTimeUpdate),this.streamable&&this.media.addEventListener("progress",this.onProgress)}removeListeners(){super.removeListeners(),this.media&&(this.media.removeEventListener("loadeddata",this.onLoadedData),this.media.removeEventListener("ended",this.onEnded),this.media.removeEventListener("play",this.onPlay),this.media.removeEventListener("pause",this.onTimeUpdate),this.media.removeEventListener("timeupdate",this.onTimeUpdate),this.streamable&&this.media.removeEventListener("progress",this.onProgress)),this.progressRAF&&(window.cancelAnimationFrame(this.progressRAF),this.progressRAF=void 0)}}},3251:(e,t,i)=>{"use strict";i.d(t,{I:()=>f});var s=i(3189),n=i(8097),a=i(4755),o=i(3228),r=i(3035);const d=new Map,l=new Set;let c=!1;function h(){c||(c=!0,(0,r.T2)((()=>{c=!1,l.forEach(p),l.clear()})))}function u(e){const t=e.getSize;if(t)return t();const i=e.dataset.sizeType;return i?a.Z.active[i].width:e.getBoundingClientRect().width}function p(e){let t=d.get(e);const i=!t;let{text:a,textLength:r,from:l,multiplier:c,font:h,textWidth:p,elementWidth:f}=t||{};if(i){a=e.textContent,r=a.length,l=50,c=l>0&&l/100;let i=e.dataset.fontSize;i&&+i&&(i+="px"),h=`${e.dataset.fontWeight||s.U9} ${i||s.Bf} ${s.bt}`,p=(0,n.Z)(a,h),f=u(e),t={text:a,textLength:r,from:l,multiplier:c,font:h,textWidth:p,elementWidth:f},d.set(e,t)}const m=u(e),g=i||f!==m;if(!i&&g&&(t.elementWidth=f=m),g)if(p>f){e.setAttribute("title",a);let i=a,s=f;for(;i.length>3;){const t=i.length,a=c&&(0,o.Z)(c*t<<0,1,t-2)||Math.max(t+l-1,1),r=i.substr(0,a).replace(/\s*$/,""),d=i.substr(a+1).replace(/^\s*/,"");if(i=r+d,s=(0,n.Z)(i+"…",h),s{for(const[e]of d)l.add(e);h()}),{capture:!0,passive:!0});class f extends HTMLElement{connectedCallback(){d.set(this,null),this.dataset.sizeType||this.getSize?p(this):(l.add(this),h())}disconnectedCallback(){d.delete(this),l.delete(this)}}customElements.define("middle-ellipsis-element",f)},4425:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(1447);class n{constructor(e,t){this.passwordInputField=e,this.size=t,this.needFrame=0,this.container=document.createElement("div"),this.container.classList.add("media-sticker-wrapper")}load(){return this.loadPromise?this.loadPromise:this.loadPromise=s.Z.loadAnimationAsAsset({container:this.container,loop:!1,autoplay:!1,width:this.size,height:this.size,noCache:!0},"TwoFactorSetupMonkeyPeek").then((e=>(this.animation=e,this.animation.addEventListener("enterFrame",(e=>{(1===this.animation.direction&&e>=this.needFrame||-1===this.animation.direction&&e<=this.needFrame)&&(this.animation.setSpeed(1),this.animation.pause())})),this.passwordInputField.helpers.onVisibilityClickAdditional=()=>{this.passwordInputField.helpers.passwordVisible?(this.animation.setDirection(1),this.animation.curFrame=0,this.needFrame=16,this.animation.play()):(this.animation.setDirection(-1),this.animation.curFrame=16,this.needFrame=0,this.animation.play())},s.Z.waitForFirstFrame(e))))}remove(){this.animation&&this.animation.remove()}}},3083:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(1447);class n{constructor(e,t){this.inputField=e,this.size=t,this.max=45,this.needFrame=0,this.container=document.createElement("div"),this.container.classList.add("media-sticker-wrapper");const i=e.input;i.addEventListener("blur",(()=>{this.playAnimation(0)})),i.addEventListener("input",(t=>{this.playAnimation(e.value.length)}))}playAnimation(e){if(!this.animation)return;let t;(e=Math.min(e,30))?(t=Math.round(Math.min(this.max,e)*(165/this.max)+11.33),this.idleAnimation&&(this.idleAnimation.stop(!0),this.idleAnimation.canvas[0].style.display="none"),this.animation.canvas[0].style.display=""):t=0;const i=this.needFrame>t?-1:1;this.animation.setDirection(i),0!==this.needFrame&&0===t&&this.animation.setSpeed(7),this.needFrame=t,this.animation.play()}load(){return this.loadPromise?this.loadPromise:this.loadPromise=Promise.all([s.Z.loadAnimationAsAsset({container:this.container,loop:!0,autoplay:!0,width:this.size,height:this.size},"TwoFactorSetupMonkeyIdle").then((e=>(this.idleAnimation=e,this.inputField.value.length||e.play(),s.Z.waitForFirstFrame(e)))),s.Z.loadAnimationAsAsset({container:this.container,loop:!1,autoplay:!1,width:this.size,height:this.size},"TwoFactorSetupMonkeyTracking").then((e=>(this.animation=e,this.inputField.value.length||(this.animation.canvas[0].style.display="none"),this.animation.addEventListener("enterFrame",(e=>{(1===this.animation.direction&&e>=this.needFrame||-1===this.animation.direction&&e<=this.needFrame)&&(this.animation.setSpeed(1),this.animation.pause()),0===e&&0===this.needFrame&&this.idleAnimation&&(this.idleAnimation.canvas[0].style.display="",this.idleAnimation.play(),this.animation.canvas[0].style.display="none")})),s.Z.waitForFirstFrame(e))))])}remove(){this.animation&&this.animation.remove(),this.idleAnimation&&this.idleAnimation.remove()}}},6830:(e,t,i)=>{"use strict";i.d(t,{T:()=>a,Z:()=>o});var s=i(3910),n=i(503);class a{constructor(e,t){this.container=e,this.input=t,this.passwordVisible=!1,this.onVisibilityClick=e=>{(0,s.Z)(e),this.passwordVisible=!this.passwordVisible,this.toggleVisible.classList.toggle("eye-hidden",this.passwordVisible),this.input.type=this.passwordVisible?"text":"password",this.onVisibilityClickAdditional&&this.onVisibilityClickAdditional()},t.type="password",t.setAttribute("required",""),t.name="notsearch_password",t.autocomplete="off";const i=document.createElement("input");i.classList.add("stealthy"),i.tabIndex=-1,i.type="password",t.parentElement.prepend(i),t.parentElement.insertBefore(i.cloneNode(),t.nextSibling);const n=this.toggleVisible=document.createElement("span");n.classList.add("toggle-visible","tgico"),e.classList.add("input-field-password"),e.append(n),n.addEventListener("click",this.onVisibilityClick),n.addEventListener("touchend",this.onVisibilityClick)}}class o extends n.ZP{constructor(e={}){super(Object.assign({plainText:!0},e)),this.helpers=new a(this.container,this.input)}}},8261:(e,t,i)=>{"use strict";i.d(t,{Z:()=>G});var s=i(2365),n=i(3725),a=i(2166),o=i(3532),r=i(2738),d=i(5565),l=i(130),c=i(3699),h=i(5471),u=i(9405),p=i(3624),f=i(8631),m=i(6219),g=i(2790),v=i(5102),b=i(2325),y=i(5400),w=i(3512),S=i(9331),C=i(9807),L=i(36),E=i(5432),I=i(4064),M=i(3910),Z=i(1708),P=i(6074),T=i(3035),k=i(7030),x=i(9931),A=i(3757),_=i(9492),F=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class D{constructor(e,t){this.scrollable=e,this.managers=t,this.processItem=e=>F(this,void 0,void 0,(function*(){const t=document.createElement("div");let i;t.classList.add(D.BASE_CLASS+"-avatar","media-container","hide"),this.avatars.append(t),e&&(i="object"!=typeof e?yield this.managers.appPhotosManager.getPhoto(e):e.action.photo);const s=new Image;s.classList.add("avatar-photo"),s.draggable=!1;const n=()=>F(this,void 0,void 0,(function*(){if(i){const e=yield(0,_.Z)({container:t,photo:i,size:(0,k.Z)(i,420,420,!1),withoutPreloader:!0});[e.images.thumb,e.images.full].filter(Boolean).forEach((e=>{e.classList.add("avatar-photo")}))}else{const e=yield this.managers.appPeersManager.getPeerPhoto(this.peerId);yield(0,x.Y)(t,this.peerId,e,"photo_big",s)}t.classList.remove("hide")}));return this.avatars.childElementCount<=3?yield n():(this.intersectionObserver.observe(t),this.loadCallbacks.set(t,n)),this.addTab(),e})),this.container=document.createElement("div"),this.container.classList.add(D.BASE_CLASS+"-container"),this.avatars=document.createElement("div"),this.avatars.classList.add(D.BASE_CLASS+"-avatars"),this.gradient=document.createElement("div"),this.gradient.classList.add(D.BASE_CLASS+"-gradient"),this.info=document.createElement("div"),this.info.classList.add(D.BASE_CLASS+"-info"),this.tabs=document.createElement("div"),this.tabs.classList.add(D.BASE_CLASS+"-tabs"),this.arrowPrevious=document.createElement("div"),this.arrowPrevious.classList.add(D.BASE_CLASS+"-arrow","tgico-avatarprevious"),this.arrowNext=document.createElement("div"),this.arrowNext.classList.add(D.BASE_CLASS+"-arrow",D.BASE_CLASS+"-arrow-next","tgico-avatarnext"),this.container.append(this.avatars,this.gradient,this.info,this.tabs,this.arrowPrevious,this.arrowNext),this.loadCallbacks=new Map,this.listenerSetter=new c.Z;const i=()=>0===this.scrollable.scrollTop||(this.scrollable.scrollIntoViewNew({element:this.scrollable.container.firstElementChild,position:"start"}),!1),s=1/3;let n=!1,a=!1;(0,r.fc)(this.container,(e=>F(this,void 0,void 0,(function*(){if(a)return void(0,M.Z)(e);if(n)return void(n=!1);if(!i())return;const t=this.container.getBoundingClientRect(),o=e.pageX,r=o-t.left;if(!this.listLoader.previous.length&&!this.listLoader.next.length||r>t.width*s&&r{t.push({element:this.avatars.children[i],item:e})}));const i=t.slice(0,this.listLoader.previous.length),s=t.slice(this.listLoader.previous.length+1),n=this.avatars.children[this.listLoader.previous.length];a=!0,(0,S.C)(n,e,(()=>e===this.peerId),this.listLoader.current,i,s),a=!1}else{const e=o>t.right-t.width/2;let i;this.avatars.classList.add("no-transition"),this.avatars.offsetLeft,i=0!==this.listLoader.index||e?this.listLoader.index===this.listLoader.count-1&&e?-(this.listLoader.count-1):e?1:-1:this.listLoader.count-1,this.listLoader.go(i),(0,T.T2)((()=>{this.avatars.classList.remove("no-transition")}))}}))),{listenerSetter:this.listenerSetter});const o=()=>{n=!0,document.body.addEventListener(E.Z?"touchend":"click",(e=>{n=!1}),{once:!0})};let d=0,l=0,h=0,u=0;this.swipeHandler=new A.Z({element:this.avatars,onSwipe:(e,t)=>{h=e*=-1;let i=l+e*-D.SCALE;return i>0?i=0:ii()?!this.container.classList.contains("is-single")&&!a:(o(),(0,M.Z)(e),!1),onFirstSwipe:()=>{const e=this.avatars.getBoundingClientRect();d=e.width,u=-d*(this.tabs.childElementCount-1),l=e.left-this.container.getBoundingClientRect().left,this.avatars.style.transform=D.TRANSLATE_TEMPLATE.replace("{x}",l+"px"),this.container.classList.add("is-swiping"),this.avatars.classList.add("no-transition"),this.avatars.offsetLeft},onReset:()=>{const e=Math.ceil(Math.abs(h)/(d/D.SCALE))*(h>=0?1:-1);o(),this.avatars.classList.remove("no-transition"),(0,T.T2)((()=>{this.listLoader.go(e),this.container.classList.remove("is-swiping")}))}}),this.intersectionObserver=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&this.loadNearestToTarget(e.target)}))}))}setPeer(e){return F(this,void 0,void 0,(function*(){this.peerId=e;const t=yield this.managers.appPeersManager.getPeerPhoto(e);if(!t)return;const i=this.listLoader=new P.Z({loadCount:50,loadMore:(t,s,n)=>{if(!s)return Promise.resolve({count:void 0,items:[]});if(e.isUser()){const i=t;return this.managers.appPhotosManager.getUserPhotos(e,i,n).then((e=>({count:e.count,items:e.photos})))}{const t=[];return i.current||t.push(this.managers.appProfileManager.getChatFull(e.toChatId())),t.push(this.managers.appMessagesManager.getSearch({peerId:e,maxId:Number.MAX_SAFE_INTEGER,inputFilter:{_:"inputMessagesFilterChatPhotos"},limit:n,backLimit:0})),Promise.all(t).then((e=>F(this,void 0,void 0,(function*(){const t=e.pop();if((0,Z.Z)(t),!i.current){const s=e[0],n=(0,I.Z)(t.history,(e=>e.action.photo.id===s.chat_photo.id));i.current=n||(yield this.managers.appMessagesManager.generateFakeAvatarMessage(this.peerId,s.chat_photo))}return{count:t.count,items:t.history}}))))}},processItem:this.processItem,onJump:(e,t)=>{const i=this.listLoader.index,s=100*D.SCALE*i;this.avatars.style.transform=D.TRANSLATE_TEMPLATE.replace("{x}",`-${s}%`);const n=this.tabs.querySelector(".active");n&&n.classList.remove("active"),this.tabs.children[i].classList.add("active"),this.loadNearestToTarget(this.avatars.children[i])}});"userProfilePhoto"===t._&&(i.current=t.photo_id),yield this.processItem(i.current),i.load(!0)}))}addTab(){const e=document.createElement("div");e.classList.add(D.BASE_CLASS+"-tab"),this.tabs.append(e),1===this.tabs.childElementCount&&e.classList.add("active"),this.container.classList.toggle("is-single",this.tabs.childElementCount<=1)}loadNearestToTarget(e){const t=Array.from(e.parentElement.children),i=t.indexOf(e);t.slice(Math.max(0,i-3),Math.min(t.length,i+3)).forEach((e=>{const t=this.loadCallbacks.get(e);t&&(t(),this.loadCallbacks.delete(e),this.intersectionObserver.unobserve(e))}))}cleanup(){var e;this.listenerSetter.removeAll(),this.swipeHandler.removeListeners(),null===(e=this.intersectionObserver)||void 0===e||e.disconnect()}}D.BASE_CLASS="profile-avatars",D.SCALE=s.Z?2:1,D.TRANSLATE_TEMPLATE=s.Z?`translate3d({x}, 0, -1px) scale(${D.SCALE})`:"translate({x}, 0)";var R=i(7479),B=i(5029),N=i(2796),O=i(8210),U=i(7362),H=i(9102),z=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const j=(e,t)=>{(0,l.Z)(t.title,e||""),t.container.style.display=e?"":"none"};class G{constructor(e,t,i,n=!0){this.managers=e,this.scrollable=t,this.listenerSetter=i,this.isDialog=n,s.Z||this.scrollable.container.classList.add("no-parallax"),i||(this.listenerSetter=new c.Z),this.middlewareHelper=(0,p.k)()}init(){this.init=null,this.element=document.createElement("div"),this.element.classList.add("profile-content"),this.section=new B.Z({noDelimiter:!0}),this.name=document.createElement("div"),this.name.classList.add("profile-name"),this.subtitle=document.createElement("div"),this.subtitle.classList.add("profile-subtitle"),this.bio=new R.ZP({title:" ",subtitle:!0,icon:"info",clickable:e=>{"A"!==e.target.tagName&&((0,a.T)(this.bio.title.textContent),(0,N.Am)(b.ZP.format("BioCopied",!0)))},listenerSetter:this.listenerSetter,contextMenu:{buttons:[{icon:"copy",text:"Text.CopyLabel_About",onClick:()=>{(0,r.tH)(this.bio.container)},verify:()=>!this.peerId.isUser()},{icon:"copy",text:"Text.CopyLabel_Bio",onClick:()=>{(0,r.tH)(this.bio.container)},verify:()=>this.peerId.isUser()}]}}),this.bio.title.classList.add("pre-wrap"),this.username=new R.ZP({title:" ",subtitleLangKey:"Username",icon:"username",clickable:()=>{(0,a.T)("@"+this.username.title.textContent),(0,N.Am)(b.ZP.format("UsernameCopied",!0))},listenerSetter:this.listenerSetter,contextMenu:{buttons:[{icon:"copy",text:"Text.CopyLabel_Username",onClick:()=>{(0,r.tH)(this.username.container)}}]}}),this.phone=new R.ZP({title:" ",subtitle:!0,icon:"phone",clickable:()=>{(0,a.T)(this.phone.title.textContent.replace(/\s/g,"")),(0,N.Am)(b.ZP.format("PhoneCopied",!0))},listenerSetter:this.listenerSetter,contextMenu:{buttons:[{icon:"copy",text:"Text.CopyLabel_PhoneNumber",onClick:()=>{(0,r.tH)(this.phone.container)}},{icon:"info",text:"PeerInfo.Phone.AnonymousInfo",textArgs:[document.createElement("a")],onClick:()=>{window.open("https://fragment.com/numbers","_blank")},separator:!0,multiline:!0,verify:()=>z(this,void 0,void 0,(function*(){const{isAnonymous:e}=(yield this.managers.appUsersManager.getUserPhone(this.peerId.toUserId()))||{};return e}))}]}}),this.link=new R.ZP({title:" ",subtitleLangKey:"SetUrlPlaceholder",icon:"link",clickable:()=>{const e=this.link.title.textContent;(0,a.T)(e);const t=e.includes("/c/");(0,N.Am)(b.ZP.format(t?"LinkCopiedPrivateInfo":"LinkCopied",!0))},listenerSetter:this.listenerSetter,contextMenu:{buttons:[{icon:"copy",text:"Text.CopyLabel_ShareLink",onClick:()=>{(0,r.tH)(this.link.container)}}]}}),this.location=new R.ZP({title:" ",subtitleLangKey:"ChatLocation",icon:"location"}),this.section.content.append(this.phone.container,this.username.container,this.location.container,this.bio.container,this.link.container);const{listenerSetter:e}=this;this.isDialog&&(this.notifications=new R.ZP({checkboxField:new C.Z({toggle:!0}),titleLangKey:"Notifications",icon:"unmute",listenerSetter:this.listenerSetter}),e.add(this.notifications.checkboxField.input)("change",(e=>{e.isTrusted&&this.managers.appMessagesManager.togglePeerMute({peerId:this.peerId,threadId:this.threadId})})),e.add(w.Z)("dialog_notify_settings",(e=>z(this,void 0,void 0,(function*(){if(this.peerId===e.peerId){const e=yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:this.peerId,respectType:!1,threadId:this.threadId});this.notifications.checkboxField.checked=!e}})))),this.section.content.append(this.notifications.container)),this.element.append(this.section.container),s.Z&&this.element.append((0,L.G)()),e.add(w.Z)("peer_typings",(({peerId:e})=>{this.peerId===e&&this.setPeerStatus()})),e.add(w.Z)("peer_bio_edit",(e=>{e===this.peerId&&this.setMoreDetails(!0)}));const t=({peerId:e,threadId:t})=>z(this,void 0,void 0,(function*(){return this.peerId===e&&(!(yield this.managers.appPeersManager.isForum(this.peerId))||!this.threadId||this.threadId===t)}));e.add(w.Z)("peer_title_edit",(e=>z(this,void 0,void 0,(function*(){(yield t(e))&&(this.fillUsername(),this.setMoreDetails(!0))})))),e.add(w.Z)("user_update",(e=>{this.peerId===e.toPeerId()&&this.setPeerStatus()})),e.add(w.Z)("contacts_update",(e=>z(this,void 0,void 0,(function*(){this.peerId===e.toPeerId()&&((yield this.managers.appUsersManager.getUser(e)).pFlags.self&&this.isDialog||this.fillUserPhone())})))),e.add(w.Z)("avatar_update",(e=>z(this,void 0,void 0,(function*(){(yield t(e))&&this.setAvatar()})))),this.setPeerStatusInterval=window.setInterval((()=>this.setPeerStatus()),6e4)}setPeerStatus(e=!1,t){return z(this,void 0,void 0,(function*(){const i=this.peerId,s=[];s.push((()=>{this.element.classList.toggle("is-me",i===w.Z.myId)}));let n=Promise.resolve();if(i&&(w.Z.myId!==i||!this.isDialog)){const t=yield this.managers.appPeersManager.isForum(this.peerId),a=this.middlewareHelper.get();n=t&&this.threadId?(0,H.Z)({peerId:i,wrapOptions:{middleware:a}}).then((({element:e})=>{this.subtitle.replaceChildren(e)})):m.ZP.setPeerStatus({peerId:i,element:this.subtitle,needClear:e,useWhitespace:!0,middleware:a,ignoreSelf:!this.isDialog}),n.then((e=>e&&s.push(e)))}const a=()=>s.forEach((e=>e()));return n.then((()=>{if(t)return a;a()}))}))}cleanupHTML(){[this.bio,this.phone,this.username,this.location,this.link].forEach((e=>{e.container.style.display="none"})),this.notifications&&(this.notifications.container.style.display="",this.notifications.checkboxField.checked=!0),this.clearSetMoreDetailsTimeout()}canBeDetailed(){return this.peerId!==w.Z.myId||!this.isDialog}createAvatar(){const e=new S.Z;return e.classList.add("profile-avatar","avatar-120"),e.isDialog=this.isDialog,e.attachClickEvent(),e}_setAvatar(){return z(this,void 0,void 0,(function*(){const{peerId:e}=this,t=!(!this.threadId||!(yield this.managers.appPeersManager.isForum(e)));if(this.canBeDetailed()&&!t&&(yield this.managers.appPeersManager.getPeerPhoto(e))){const t=this.avatars;return this.avatars=new D(this.scrollable,this.managers),yield this.avatars.setPeer(e),()=>{var e;this.avatars.info.append(this.name,this.subtitle),null===(e=this.avatar)||void 0===e||e.remove(),this.avatar=void 0,t?t.container.replaceWith(this.avatars.container):this.element.prepend(this.avatars.container),s.Z&&this.scrollable.container.classList.add("parallax")}}const i=this.createAvatar();return yield i.updateWithOptions({peerId:e,threadId:t?this.threadId:void 0,wrapOptions:{customEmojiSize:(0,u.C)(120,120),middleware:this.middlewareHelper.get()}}),()=>{var e;s.Z&&this.scrollable.container.classList.remove("parallax"),this.avatars&&(this.avatars.container.remove(),this.avatars.cleanup(),this.avatars=void 0),null===(e=this.avatar)||void 0===e||e.remove(),this.avatar=i,this.section.content.prepend(this.avatar,this.name,this.subtitle)}}))}setAvatar(e){const t=this._setAvatar();return e?t:t.then((e=>e()))}getUsernamesAlso(e){const t=e.slice(1);if(t.length){const e=t.map((e=>(0,o.Z)({username:e})));return(0,b.ag)("UsernameAlso",[(0,b.v_)(e,!1)])}}fillUsername(){return z(this,void 0,void 0,(function*(){const{peerId:e}=this;if(e.isUser()&&this.canBeDetailed()){const t=yield this.managers.appPeersManager.getPeerActiveUsernames(e),i=this.getUsernamesAlso(t);return()=>{this.username.subtitle.replaceChildren(i||(0,b.ag)("Username")),j(t[0],this.username)}}}))}fillUserPhone(){return z(this,void 0,void 0,(function*(){const{peerId:e}=this;if(e.isUser()&&this.canBeDetailed()){const{phone:t,isAnonymous:i}=(yield this.managers.appUsersManager.getUserPhone(e.toUserId()))||{};return()=>{this.phone.subtitle.replaceChildren((0,b.ag)(i?"AnonymousNumber":"Phone")),j(t?(0,O.Z)(t):void 0,this.phone)}}}))}fillNotifications(){return z(this,void 0,void 0,(function*(){const e=this.notifications;if(e){if(this.canBeDetailed()){const t=yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:this.peerId,respectType:!1,threadId:this.threadId});return()=>{e.checkboxField.checked=!t}}return()=>{e.container.style.display="none"}}}))}fillName(){return z(this,void 0,void 0,(function*(){const{peerId:e}=this,[t]=yield Promise.all([(0,U.Z)({peerId:e,dialog:this.isDialog,withIcons:!this.threadId,threadId:this.threadId})]);return()=>{(0,d.Z)(this.name,t)}}))}fillRows(e){return z(this,void 0,void 0,(function*(){return Promise.all([this.fillName(),this.fillUsername(),this.fillUserPhone(),this.fillNotifications(),this.setMoreDetails(void 0,e),this.setPeerStatus(!0,!0)]).then((e=>()=>{e.forEach((e=>null==e?void 0:e()))}))}))}fillProfileElements(){return z(this,void 0,void 0,(function*(){if(!this.cleaned)return;this.cleaned=!1,this.cleanupHTML();const e=(0,n.Z)();this.middlewareHelper.get().onClean((()=>{e.reject()}));const t=yield Promise.all([this.setAvatar(!0),this.fillRows(e)]);return()=>{e.resolve(),t.forEach((e=>null==e?void 0:e()))}}))}_setMoreDetails(e,t){return z(this,void 0,void 0,(function*(){const i=this.getMiddlewarePromise();if(this.threadId&&(yield i(this.managers.appPeersManager.isForum(e)))){let t="https://t.me/";const s=(0,g.Z)(this.threadId),n=yield i(this.managers.appPeersManager.getPeerUsername(e));return t+=n?`${n}/${s}`:`c/${e.toChatId()}/${s}`,()=>{j(t,this.link)}}const s=[];if(s.push((()=>{this.bio.subtitle.replaceChildren((0,b.ag)(e.isUser()?"UserBio":"Info")),j(t.about?(0,y.ZP)(t.about):void 0,this.bio)})),!e.isUser()){const n=yield i(this.managers.appChatsManager.getChat(e.toChatId())),a=(0,v.Z)(n);let o;if(a.length)o=this.getUsernamesAlso(a),s.push((()=>j("https://t.me/"+a[0],this.link)));else{const e=t.exported_invite;"chatInviteExported"===(null==e?void 0:e._)&&s.push((()=>j(e.link,this.link)))}s.push((()=>this.link.subtitle.replaceChildren(o||(0,b.ag)("SetUrlPlaceholder"))))}const n=t.location;return"channelLocation"==(null==n?void 0:n._)&&s.push((()=>j(n.address,this.location))),this.setMoreDetailsTimeout=window.setTimeout((()=>this.setMoreDetails(!0)),6e4),()=>{s.forEach((e=>e()))}}))}setMoreDetails(e,t){return z(this,void 0,void 0,(function*(){this.clearSetMoreDetailsTimeout();const{peerId:i}=this,s=this.getMiddlewarePromise();if(!i||!this.canBeDetailed()||(yield s(this.managers.appPeersManager.isPeerRestricted(i))))return;const n=yield s(this.managers.acknowledged.appProfileManager.getProfileByPeerId(i,e)),a=s(n.result).then((e=>z(this,void 0,void 0,(function*(){if(!(yield s(this.managers.appPeersManager.isPeerRestricted(i))))return yield s(this._setMoreDetails(i,e))}))));if(n.cached&&t)return a;(t||Promise.resolve()).then((()=>a)).then((e=>{null==e||e()}))}))}getMiddlewarePromise(){return(0,f.Z)(this.middlewareHelper.get(),(0,h.Z)("MIDDLEWARE"))}setPeer(e,t){var i;this.peerId===e&&this.threadId===t||(null===(i=this.init)||void 0===i||i.call(this),this.peerId=e,this.threadId=t,this.middlewareHelper.clean(),this.cleaned=!0)}clearSetMoreDetailsTimeout(){void 0!==this.setMoreDetailsTimeout&&(clearTimeout(this.setMoreDetailsTimeout),this.setMoreDetailsTimeout=void 0)}destroy(){var e;this.peerId=this.threadId=void 0,this.clearSetMoreDetailsTimeout(),clearInterval(this.setPeerStatusInterval),null===(e=this.avatars)||void 0===e||e.cleanup(),this.middlewareHelper.destroy()}}},8842:(e,t,i)=>{"use strict";i.d(t,{Z:()=>g});var s=i(3512),n=i(2325),a=i(5565),o=i(1507),r=i(8456),d=i(130),l=i(5953),c=i(8115),h=i(493),u=(i(4755),i(5948));i(3541);function p(e,t,i,n,a){return o=this,r=void 0,l=function*(){const t=[],o=yield s.Z.managers.appPeersManager.getPeer(e);if(o.pFlags.verified&&!i&&t.push(function(){const e=document.createElement("span");e.classList.add("verified-icon","tgico");const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"viewBox","0 0 26 26"),t.setAttributeNS(null,"width","26"),t.setAttributeNS(null,"height","26"),t.classList.add("verified-icon-svg");const i=document.createElementNS("http://www.w3.org/2000/svg","use");i.setAttributeNS(null,"href","#verified-icon-background"),i.classList.add("verified-icon-background");const s=document.createElementNS("http://www.w3.org/2000/svg","use");return s.setAttributeNS(null,"href","#verified-icon-check"),s.classList.add("verified-icon-check"),t.append(s,i),e.append(t),e}()),!o.pFlags.fake&&!o.pFlags.scam||n||t.push((0,u.Z)(o.pFlags.scam)),o.pFlags.premium&&!a){const e=o.emoji_status;e&&e._,t.push(function(){const e=document.createElement("span");return e.classList.add("premium-icon","tgico-star"),e}())}return t},new((d=void 0)||(d=Promise))((function(e,t){function i(e){try{n(l.next(e))}catch(e){t(e)}}function s(e){try{n(l.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof d?n:new d((function(e){e(n)}))).then(i,s)}n((l=l.apply(o,r||[])).next())}));var o,r,d,l}var f=i(9345);const m=new WeakMap;s.Z.addEventListener("peer_title_edit",(({peerId:e,threadId:t})=>{let i=`.peer-title[data-peer-id="${e}"]`;t&&(i+=`[data-thread-id="${t}"]`),Array.from(document.querySelectorAll(i)).forEach((e=>{const t=m.get(e);null==t||t.update()}))}));class g{constructor(e){this.element=document.createElement("span"),this.element.classList.add("peer-title"),(0,d.m)(this.element),this.options={},e&&this.update(e),m.set(this.element,this)}setOptions(e){if(e){(0,l.Z)(this.options,e);for(const t in e){const i=e[t];"object"!=typeof i&&"function"!=typeof i&&(this.element.dataset[t]=i?""+("boolean"==typeof i?+i:i):"0")}}}setHasInner(e){this.hasInner!==e&&(this.hasInner=e,this.element.classList.toggle("with-icons",e))}update(e){var t,i,l,u,m,g,v,b;return m=this,g=void 0,b=function*(){this.setOptions(e);let m,g=this.options.fromName;if(void 0!==g)return void 0!==this.options.limitSymbols&&(g=(0,r.Z)(g,this.options.limitSymbols,this.options.limitSymbols)),void(0,d.Z)(this.element,(0,c.Z)(g));null!==(t=(u=this.options).peerId)&&void 0!==t||(u.peerId=o.NM);const{peerId:v,threadId:b}=this.options;if(v===s.Z.myId&&this.options.dialog)(0,a.Z)(this.element,(0,n.ag)(this.options.onlyFirstName?"Saved":"SavedMessages"));else{if(b){const[e,t]=yield Promise.all([s.Z.managers.dialogsStorage.getForumTopic(v,b),s.Z.managers.appPeersManager.isForum(v)]);if(!e&&t)return s.Z.managers.dialogsStorage.getForumTopicById(v,b).then((e=>{if(!e&&this.options.threadId===b)return this.options.threadId=void 0,void this.update({threadId:void 0});this.update()}),(()=>{this.options.threadId===b&&(this.options.threadId=void 0,this.update({threadId:void 0}))})),(0,d.Z)(this.element,(0,n.ag)("Loading")),void this.setHasInner(!1)}const e=b&&this.options.withIcons?s.Z.managers.dialogsStorage.getForumTopic(v,b).then((e=>{var t;return(0,f.e)(Object.assign(Object.assign({},null!==(t=this.options.wrapOptions)&&void 0!==t?t:{}),{topic:e}))})):void 0,[t,a,o]=yield Promise.all([(0,h.Z)(this.options),this.options.withIcons&&p(v,null===(i=this.options.wrapOptions)||void 0===i||i.middleware)||this.options.withPremiumIcon&&p(v,null===(l=this.options.wrapOptions)||void 0===l||l.middleware,!0,!0),e]);if((null==a?void 0:a.length)||o){const e=document.createElement("span");e.classList.add("peer-title-inner"),m=!0,(0,d.Z)(e,t);const i=document.createDocumentFragment();i.append(...[o,e,...null!=a?a:[]].filter(Boolean)),(0,d.Z)(this.element,i)}else(0,d.Z)(this.element,t)}this.setHasInner(m)},new((v=void 0)||(v=Promise))((function(e,t){function i(e){try{n(b.next(e))}catch(e){t(e)}}function s(e){try{n(b.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof v?n:new v((function(e){e(n)}))).then(i,s)}n((b=b.apply(m,g||[])).next())}))}}},6765:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(1168),n=i(2325),a=i(2738),o=i(8678),r=i(2312);class d extends s.Z{constructor(e={}){super("popup-avatar",{closable:!0,withConfirm:!0}),this.image=new Image,this.cropper={crop:()=>{},removeHandlers:()=>{}},this.h6=document.createElement("h6"),(0,n.$d)(this.h6,"Popup.Avatar.Title"),this.btnClose.classList.remove("btn-icon"),this.header.append(this.h6),this.cropContainer=document.createElement("div"),this.cropContainer.classList.add("crop"),this.cropContainer.append(this.image),e.isForum&&this.cropContainer.classList.add("is-forum"),this.input=document.createElement("input"),this.input.type="file",this.input.style.display="none",this.listenerSetter.add(this.input)("change",(e=>{const t=e.target.files[0];t&&(0,o.Z)(t).then((e=>{this.image=new Image,this.cropContainer.append(this.image),this.image.src=e,this.image.onload=()=>{this.show(),this.cropper=function(e,t){let i,s,n,a={},o=0,r=0,d=0,l=0,c=0;function h(){e.classList.add("crop-blur"),e.draggable=!1,n=new Image,n.src=e.src,n.draggable=!1,n.classList.add("crop-overlay-image"),t||(t=document.createElement("canvas")),i=document.createElement("div"),i.classList.add("crop-component"),s=document.createElement("div"),s.classList.add("crop-overlay");const a=document.createElement("div");a.classList.add("crop-overlay-color"),i.appendChild(s),e.parentNode.appendChild(i),i.appendChild(n),i.appendChild(e),i.appendChild(a),s.appendChild(n),n.style.maxWidth=e.width+"px",c=e.naturalWidth/e.offsetWidth;const o=e.offsetWidth/2-100,r=e.offsetHeight/2-100;u(200,200),p(o,r),f(o,r),s.addEventListener("mousedown",b,!1),s.addEventListener("touchstart",b,!1),s.addEventListener("wheel",v,!1),document.addEventListener("keypress",g,!1)}function u(e,t){d=e*c,l=t*c,s.style.width=e+"px",s.style.height=t+"px"}function p(e,t){r=t*c,o=e*c,n.style.top=-t+"px",n.style.left=-e+"px"}function f(e,t){s.style.top=t+"px",s.style.left=e+"px"}function m(e){e=e*Math.PI*2;let t,i,a,o,r=Math.floor(s.clientWidth+e),d=Math.floor(s.clientHeight+e),l=n.clientWidth,c=n.clientHeight;r<50||r>l||(t=s.offsetLeft-e/2,i=s.offsetTop-e/2,a=t+r,o=i+d,t<0&&(t=0),i<0&&(i=0),a>l||o>c||(u(r,r),p(t,i),f(t,i)))}function g(e){switch(e.preventDefault(),String.fromCharCode(e.charCode)){case"+":m(4);break;case"-":m(-4)}}function v(e){e.preventDefault(),m(e.deltaY>0?1:-1)}function b(e){e.preventDefault(),e.stopPropagation(),function(e){a.container_width=s.offsetWidth,a.container_height=s.offsetHeight,a.container_left=s.offsetLeft,a.container_top=s.offsetTop,a.mouse_x=(e.clientX||e.pageX||e.touches&&e.touches[0].clientX)+window.scrollX,a.mouse_y=(e.clientY||e.pageY||e.touches&&e.touches[0].clientY)+window.scrollY}(e),document.addEventListener("mousemove",w),document.addEventListener("touchmove",w),document.addEventListener("mouseup",y),document.addEventListener("touchend",y)}function y(e){e.preventDefault(),document.removeEventListener("mouseup",y),document.removeEventListener("touchend",y),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",w)}function w(e){let t,i,o,r,d={x:0,y:0};e.preventDefault(),e.stopPropagation(),d.x=e.pageX||e.touches&&e.touches[0].pageX,d.y=e.pageY||e.touches&&e.touches[0].pageY,t=d.x-(a.mouse_x-a.container_left),i=d.y-(a.mouse_y-a.container_top),o=s.offsetWidth,r=s.offsetHeight,t<0?t=0:t>n.offsetWidth-o&&(t=n.offsetWidth-o),i<0?i=0:i>n.offsetHeight-r&&(i=n.offsetHeight-r),p(t,i),f(t,i)}return e.complete?h():e.onload=h,{crop:function(){t.width=d,t.height=l,t.getContext("2d").drawImage(e,o,r,d,l,0,0,d,l)},removeHandlers:function(){s.removeEventListener("mousedown",b),s.removeEventListener("touchstart",b),s.removeEventListener("wheel",v),document.removeEventListener("mouseup",y),document.removeEventListener("touchend",y),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",w),document.removeEventListener("keypress",g),i.remove(),s.remove(),n.remove()}}}(this.image,this.canvas),this.input.value=""}}))}),!1),this.btnConfirm.className="btn-primary btn-color-primary btn-circle btn-crop btn-icon tgico-check z-depth-1",(0,a.fc)(this.btnConfirm,(()=>{this.cropper.crop(),this.hide(),this.canvas.toBlob((e=>{this.blob=e,this.darkenCanvas(),this.resolve()}),"image/jpeg",1)}),{listenerSetter:this.listenerSetter}),this.container.append(this.cropContainer,this.btnConfirm,this.input),this.addEventListener("closeAfterTimeout",(()=>{this.cropper.removeHandlers(),this.image&&this.image.remove()}))}resolve(){this.onCrop((()=>r.Z.upload(this.blob)))}open(e,t){this.canvas=e,this.onCrop=t,this.input.click()}darkenCanvas(){const e=this.canvas.getContext("2d");e.fillStyle="rgba(0, 0, 0, 0.3)",e.fillRect(0,0,this.canvas.width,this.canvas.height)}}},2986:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(1168),n=i(2738),a=i(4755),o=i(2325),r=i(503);class d extends s.Z{constructor(e,t,i={}){if(super("popup-date-picker",Object.assign({body:!0,overlayClosable:!0,buttons:i.noButtons?[]:[{langKey:"JumpToDate",callback:()=>{this.onPick&&this.onPick(this.selectedDate.getTime()/1e3|0)}},{langKey:"Cancel",isCancel:!0}],title:!0},i)),this.onPick=t,this.options=i,this.onPrevClick=e=>{this.selectedMonth.setMonth(this.selectedMonth.getMonth()-1),this.setMonth(),this.selectedMonth.getTime()===this.minMonth.getTime()&&this.prevBtn.setAttribute("disabled","true"),this.nextBtn.removeAttribute("disabled")},this.onNextClick=e=>{this.selectedMonth.setMonth(this.selectedMonth.getMonth()+1),this.setMonth(),this.selectedMonth.getTime()===this.maxMonth.getTime()&&this.nextBtn.setAttribute("disabled","true"),this.prevBtn.removeAttribute("disabled")},this.onDateClick=e=>{const t=e.target;if(!t.dataset.timestamp)return;if(this.selectedEl){if(this.selectedEl===t)return;this.selectedEl.classList.remove("active")}this.selectedEl=t,t.classList.add("active");const i=+t.dataset.timestamp;this.selectedDate=new Date(i),this.setTitle(),this.setTimeTitle()},this.minDate=i.minDate||new Date("2013-08-01T00:00:00"),e{const n=""+e;this.listenerSetter.add(t.input)("input",(a=>{let o=t.value.replace(/\D/g,"");o.length>2?o=o.slice(0,2):(1===o.length&&+o[0]>+n[0]||2===o.length&&+o>e)&&(2===o.length&&s&&s(+o[1]),o="0"+o[0]),t.setValueSilently(o),i(o.length)}))};this.hoursInputField=new r.ZP({plainText:!0}),this.minutesInputField=new r.ZP({plainText:!0}),i(23,this.hoursInputField,(e=>{2===e&&this.minutesInputField.input.focus(),this.setTimeTitle()}),(e=>{this.minutesInputField.value=(e+this.minutesInputField.value).slice(0,2)})),i(59,this.minutesInputField,(e=>{e||this.hoursInputField.input.focus(),this.setTimeTitle()})),this.selectedDate=e,e.setMinutes(e.getMinutes()+10),this.hoursInputField.setValueSilently(("0"+e.getHours()).slice(-2)),this.minutesInputField.setValueSilently(("0"+e.getMinutes()).slice(-2)),e.setHours(0,0,0,0),this.timeDiv.append(this.hoursInputField.container,t,this.minutesInputField.container),(0,n.fc)(this.btnConfirm,(()=>{this.onPick&&(this.selectedDate.setHours(+this.hoursInputField.value||0,+this.minutesInputField.value||0,0,0),this.onPick(this.selectedDate.getTime()/1e3|0)),this.hide()}),{listenerSetter:this.listenerSetter}),this.body.append(this.timeDiv),this.prevBtn.classList.add("primary"),this.nextBtn.classList.add("primary")}const s=document.createElement("div");s.classList.add("popup-centerer"),s.append(this.container),this.element.append(s),e.setHours(0,0,0,0),this.selectedDate=e,this.maxDate=i.maxDate||new Date,this.maxDate.setHours(0,0,0,0),this.selectedMonth=new Date(this.selectedDate),this.selectedMonth.setDate(1),this.maxMonth=new Date(this.maxDate),this.maxMonth.setDate(1),this.minMonth=new Date(this.minDate),this.minMonth.setHours(0,0,0,0),this.minMonth.setDate(1),this.selectedMonth.getTime()===this.minMonth.getTime()&&this.prevBtn.setAttribute("disabled","true"),this.selectedMonth.getTime()===this.maxMonth.getTime()&&this.nextBtn.setAttribute("disabled","true"),i.noTitle&&(this.setTitle=()=>{}),this.setTimeTitle(),this.setTitle(),this.setMonth()}setTimeTitle(){if(this.btnConfirm&&this.selectedDate){let e;const t=[],i=new Date;i.setHours(0,0,0,0);const s={minute:"2-digit",hour:"2-digit"},n=new Date(this.selectedDate.getTime());if(n.setHours(+this.hoursInputField.value,+this.minutesInputField.value),this.selectedDate.getTime()===i.getTime())e="Schedule.SendToday";else{e="Schedule.SendDate";const s={month:"short",day:"numeric"};n.getFullYear()!==i.getFullYear()&&(s.year="numeric"),t.push(new o.ZP.IntlDateElement({date:n,options:s}).element)}t.push(new o.ZP.IntlDateElement({date:n,options:s}).element),this.btnConfirm.firstChild.replaceWith((0,o.ag)(e,t))}}setTitle(){this.title.textContent="",this.title.append(new o.ZP.IntlDateElement({date:this.selectedDate,options:{day:"numeric",month:"long",weekday:"short"}}).element)}renderElement(e,t=""){const i=document.createElement("button");return i.classList.add("btn-icon","date-picker-month-date"),e&&i.setAttribute("disabled","true"),t&&i.append(t),i}setMonth(){const e=new Date(this.selectedMonth),t={year:"numeric",month:this.timeDiv&&a.Z.isMobile?"short":"long"};this.monthTitle.textContent="",this.monthTitle.append(new o.ZP.IntlDateElement({date:e,options:t}).element),this.month&&this.month.remove(),this.month=document.createElement("div"),this.month.classList.add("date-picker-month");const i=new Date,s=i.getDay();1!==s&&i.setHours(-24*(s-1));for(let e=0;e<7;++e){const e=this.renderElement(!0,new o.ZP.IntlDateElement({date:i,options:{weekday:"narrow"}}).element);e.classList.remove("date-picker-month-date"),e.classList.add("date-picker-month-day"),this.month.append(e),i.setDate(i.getDate()+1)}let n=e.getDay()-1;-1===n&&(n=6);const r=new Date(e.getTime());r.setDate(r.getDate()-n-1);for(let e=0;ethis.maxDate||e{"use strict";i.d(t,{Z:()=>o});var s=i(1168),n=i(7362),a=i(8127);class o{constructor(e,t,i,s){this.peerId=e,this.peerType=t,this.onSelect=i,this.threadId=s,this.construct()}construct(){return e=this,t=void 0,o=function*(){let{peerId:e,peerType:t,onSelect:i,threadId:o}=this;const r=yield(0,n.Z)({peerId:e,threadId:o}),d=s.Z.MANAGERS;void 0===t&&(t=yield d.appPeersManager.getDialogType(e));const l=(t,s=g&&!!t.size)=>{let n=d.appChatsManager.leave(e.toChatId());s&&(n=n.then((()=>d.appMessagesManager.flushHistory(e)))),null==i||i(n)},c=t=>{let s;if(o)s=d.appMessagesManager.flushHistory(e,!1,!0,o);else if(e.isUser())s=d.appMessagesManager.flushHistory(e,!1,g?!!t.size:void 0);else{if(!t.size)return l(t);s=d.appChatsManager.delete(e.toChatId())}null==i||i(s)};let h,u,p,f,m,g;switch(t){case"channel":(yield d.appChatsManager.hasRights(e.toChatId(),"delete_chat"))?(h="ChannelDeleteMenu",p="AreYouSureDeleteAndExitChannel",m=[{langKey:"ChannelDeleteMenu",isDanger:!0,callback:c}],g=[{text:"DeleteChannelForAll"}]):(h="LeaveChannelMenu",p="ChannelLeaveAlertWithName",f=[r],m=[{langKey:"LeaveChannel",isDanger:!0,callback:l}]);break;case"chat":h="DeleteChatUser",p="AreYouSureDeleteThisChatWithUser",f=[r],m=[{langKey:"DeleteChatUser",isDanger:!0,callback:c}],g=[{text:"DeleteMessagesOptionAlso",textArgs:[yield(0,n.Z)({peerId:e})]}];break;case"saved":h="DeleteChatUser",p="AreYouSureDeleteThisChatSavedMessages",m=[{langKey:"DeleteChatUser",isDanger:!0,callback:c}];break;case"megagroup":case"group":o?(h="DeleteTopics",u=[1],p="DeleteSelectedTopic",f=[r],m=[{langKey:"Delete",isDanger:!0,callback:c}]):(yield d.appChatsManager.hasRights(e.toChatId(),"delete_chat"))?(h="DeleteMegaMenu",p="AreYouSureDeleteAndExit",m=[{langKey:"DeleteMegaMenu",isDanger:!0,callback:c}],g=[{text:"DeleteChat.DeleteGroupForAll"}]):(h="LeaveMegaMenu",p="AreYouSureDeleteAndExitName",f=[r],m=[{langKey:"DeleteChatUser",isDanger:!0,callback:e=>l(e,!0)}])}new a.Z("popup-delete-chat",{peerId:e,threadId:o,titleLangKey:h,titleLangArgs:u,descriptionLangKey:p,descriptionLangArgs:f,buttons:m,checkboxes:g}).show()},new((i=void 0)||(i=Promise))((function(s,n){function a(e){try{d(o.next(e))}catch(e){n(e)}}function r(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,r)}d((o=o.apply(e,t||[])).next())}));var e,t,i,o}}},5128:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(3512),n=i(1168),a=i(8127),o=i(2325),r=i(7120),d=i(2353),l=i(7362),c=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class h{constructor(e,t,i,s,n){this.peerId=e,this.mids=t,this.type=i,this.onConfirm=s,this.threadId=n,this.construct()}construct(){return c(this,void 0,void 0,(function*(){let{peerId:e,mids:t,type:i,onConfirm:h,threadId:u}=this;const p=yield(0,l.Z)({peerId:e,threadId:u}),f=n.Z.MANAGERS;t=t.slice();const m=(s,n)=>{h&&h(),"scheduled"===i?f.appMessagesManager.deleteScheduledMessages(e,t):f.appMessagesManager.deleteMessages(e,t,!!s.size||n)},g=[{langKey:"Delete",isDanger:!0,callback:m}],v=[];let b,y,w,S;if(1===t.length?b="DeleteSingleMessagesTitle":(b="DeleteMessagesTitle",y=[(0,o.ag)("messages",[t.length])]),w=(yield f.appPeersManager.isMegagroup(e))?1===t.length?"AreYouSureDeleteSingleMessageMega":"AreYouSureDeleteFewMessagesMega":1===t.length?"AreYouSureDeleteSingleMessage":"AreYouSureDeleteFewMessages",e===s.Z.myId||"scheduled"===i);else if(e.isUser())v.push({text:"DeleteMessagesOptionAlso",textArgs:[p]});else{const i=yield f.appChatsManager.getChat(e.toChatId()),n=(0,r.Z)(i,"delete_messages");if("chat"===i._){const i=n?t.slice():yield(0,d.Z)(t,(t=>c(this,void 0,void 0,(function*(){return(yield f.appMessagesManager.getMessageByPeer(e,t)).fromId===s.Z.myId}))));i.length&&(i.length===t.length?v.push({text:"DeleteForAll"}):(v.push({text:"DeleteMessagesOption"}),w="DeleteMessagesTextGroup",S=[(0,o.ag)("messages",[i.length])]))}else g[0].callback=e=>m(e,!0)}(0,n.x)(g),new a.Z("popup-delete-chat",{peerId:e,threadId:u,titleLangKey:b,titleLangArgs:y,descriptionLangKey:w,descriptionLangArgs:S,buttons:g,checkboxes:v}).show()}))}}},4524:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var s=i(7238),n=i(6219),a=i(3512),o=i(2796),r=i(2995),d=i(7530),l=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class c extends r.Z{constructor(e,t,i=["send_plain"]){super({peerTypes:["dialogs","contacts"],onSelect:!e&&t?t:i=>l(this,void 0,void 0,(function*(){if(t){const e=t(i);e instanceof Promise&&(yield e)}if(i!==a.Z.myId)n.ZP.setInnerPeer({peerId:i}),n.ZP.chat.input.initMessagesForward(e);else{let t=0;for(const s in e){const n=e[s];t+=n.length,this.managers.appMessagesManager.forwardMessages(i,s.toPeerId(),n)}(0,o.bC)({langPackKey:t>0?"FwdMessagesToSavedMessages":"FwdMessageToSavedMessages"})}})),placeholder:"ShareModal.Search.ForwardPlaceholder",chatRightsActions:i,selfPresence:"ChatYourSelf"})}static create(...e){return l(this,void 0,void 0,(function*(){const[t]=e,i=Object.keys(t).map((e=>t[e].map((t=>a.Z.managers.appMessagesManager.getMessageByPeer(e.toPeerId(),t))))),n=yield Promise.all((0,s.Z)(i)),o=new Set;n.forEach((e=>{if(!e)return;const t=(0,d.Z)(e);let i;if(t)if("webPage"===t._)i="embed_links";else if("photo"===t._)i="send_photos";else if("game"===t._)i="send_games";else switch(t.type){case"audio":i="send_audios";break;case"gif":i="send_gifs";break;case"round":i="send_roundvideos";break;case"sticker":i="send_stickers";break;case"voice":i="send_voices";break;case"video":i="send_videos";break;default:i="send_docs"}else i=e.viaBotId?"send_inline":"send_plain";i&&o.add(i)})),new c(e[0],e[1],Array.from(o))}))}}},1168:(e,t,i)=>{"use strict";i.d(t,{Z:()=>L,x:()=>E});var s=i(1405),n=i(5814),a=i(5824),o=i(2325),r=i(8497),d=i(8799),l=i(3699),c=i(2738),h=i(6299),u=i(3910),p=i(3241),f=i(6733),m=i(1655),g=i(3815),v=i(8805),b=i(3624),y=i(8115);const w=document.body;let S=w;const C=()=>{S=(0,f.W7)()||w,L.reAppend()};(0,f.Ms)(w,C);class L extends p.Z{constructor(e,t={}){if(super(!1),this.element=document.createElement("div"),this.container=document.createElement("div"),this.header=document.createElement("div"),this.title=document.createElement("div"),this.onEscape=()=>!0,this.hide=()=>{a.Z.backByItem(this.navigationItem)},this.element.classList.add("popup"),this.element.className="popup"+(e?" "+e:""),this.container.classList.add("popup-container","z-depth-1"),this.header.classList.add("popup-header"),(t.title||t.titleRaw)&&(this.title.classList.add("popup-title"),"string"==typeof t.title?(0,o.$d)(this.title,t.title):t.titleRaw&&this.title.append((0,y.Z)(t.titleRaw)),this.header.append(this.title)),this.middlewareHelper=(0,b.k)(),this.listenerSetter=new l.Z,this.managers=L.MANAGERS,this.confirmShortcutIsSendShortcut=t.confirmShortcutIsSendShortcut,t.closable&&(this.btnClose=document.createElement("span"),this.btnClose.classList.add("btn-icon","popup-close","tgico-close"),this.header.prepend(this.btnClose),(0,c.fc)(this.btnClose,this.hide,{listenerSetter:this.listenerSetter,once:!0})),this.withoutOverlay=t.withoutOverlay,this.withoutOverlay&&this.element.classList.add("no-overlay"),t.overlayClosable&&(0,c.fc)(this.element,(e=>{(0,r.Z)(e.target,"popup-container")||this.hide()}),{listenerSetter:this.listenerSetter}),t.withConfirm&&(this.btnConfirm=document.createElement("button"),this.btnConfirm.classList.add("btn-primary","btn-color-primary"),!0!==t.withConfirm&&this.btnConfirm.append((0,o.ag)(t.withConfirm)),this.header.append(this.btnConfirm),(0,s.Z)(this.btnConfirm)),this.container.append(this.header),t.body&&(this.body=document.createElement("div"),this.body.classList.add("popup-body"),this.container.append(this.body)),t.scrollable){const e=this.scrollable=new v.ZP(this.body);this.attachScrollableListeners(),this.body||this.container.insertBefore(e.container,this.header.nextSibling)}let i=this.btnConfirm;const n=this.buttons=t.buttons;if(null==n?void 0:n.length){const e=this.buttonsEl=document.createElement("div");e.classList.add("popup-buttons");const t=n.map((e=>{const t=document.createElement("button");return t.className="btn"+(e.isDanger?" danger":" primary"),e.noRipple||(0,s.Z)(t),e.text?t.textContent=e.text:t.append((0,o.ag)(e.langKey,e.langArgs)),(0,c.fc)(t,(()=>{var t;null===(t=e.callback)||void 0===t||t.call(e),this.destroy()}),{listenerSetter:this.listenerSetter,once:!0}),e.element=t}));if(!i&&2===n.length){const e=n.find((e=>!e.isCancel));e&&(i=e.element)}e.append(...t),this.container.append(e)}this.btnConfirmOnEnter=i,this.element.append(this.container),L.POPUPS.push(this)}attachScrollableListeners(e){return this.scrollable.attachBorderListeners(e)}onContentUpdate(){this.scrollable&&this.scrollable.onAdditionalScroll()}show(){this.navigationItem={type:"popup",onPop:()=>this.destroy(),onEscape:this.onEscape},a.Z.pushItem(this.navigationItem),(0,d.Z)(),S.append(this.element),this.element.offsetWidth,this.element.classList.add("active"),this.onContentUpdate(),this.withoutOverlay||(g.Z.isOverlayActive=!0,n.Z.checkAnimations2(!0)),setTimeout((()=>{this.element.classList.contains("active")&&this.listenerSetter.add(document.body)("keydown",(e=>{L.POPUPS[L.POPUPS.length-1]===this&&(this.confirmShortcutIsSendShortcut?(0,h.Z)(e):"Enter"===e.key)&&((0,c.tH)(this.btnConfirmOnEnter),(0,u.Z)(e))}))}),0)}destroy(){this.dispatchEvent("close"),this.element.classList.add("hiding"),this.element.classList.remove("active"),this.listenerSetter.removeAll(),this.middlewareHelper.destroy(),this.withoutOverlay||(g.Z.isOverlayActive=!1),a.Z.removeItem(this.navigationItem),this.navigationItem=void 0,(0,m.Z)(L.POPUPS,this),C(),setTimeout((()=>{var e;this.element.remove(),this.dispatchEvent("closeAfterTimeout"),this.cleanup(),null===(e=this.scrollable)||void 0===e||e.destroy(),this.withoutOverlay||n.Z.checkAnimations2(!1)}),150)}static reAppend(){this.POPUPS.forEach((e=>{const{element:t,container:i}=e,s=t.parentElement;s&&s!==S&&S!==i&&S.append(t)}))}static getPopups(e){return this.POPUPS.filter((t=>t instanceof e))}static createPopup(e,...t){return new e(...t)}}L.POPUPS=[];const E=e=>(e.find((e=>e.isCancel))||e.push({langKey:"Cancel",isCancel:!0}),e)},1842:(e,t,i)=>{"use strict";i.d(t,{Z:()=>f});var s=i(1168),n=i(130),a=i(2575),o=i(6219),r=i(2325),d=i(1507),l=i(8115),c=i(9331),h=i(9931),u=i(2796),p=i(9492);class f extends s.Z{constructor(e,t){super("popup-join-chat-invite",{closable:!0,overlayClosable:!0,body:!0,buttons:(0,s.x)([{langKey:t.pFlags.request_needed?"RequestJoin.Button":t.pFlags.broadcast?"JoinByPeekChannelTitle":"JoinByPeekGroupTitle",callback:()=>{this.managers.appChatsManager.importChatInvite(e).then((e=>{const t=e.toPeerId(!0);o.ZP.setInnerPeer({peerId:t})}),(e=>{"INVITE_REQUEST_SENT"===e.type&&(0,u.bC)({langPackKey:"RequestToJoinSent"})}))}}])}),this.hash=e,this.chatInvite=t,this.construct()}construct(){return e=this,t=void 0,s=function*(){this.header.remove();const{chatInvite:e,managers:t,hash:i}=this,s=new c.Z;s.classList.add("avatar-100"),s.isDialog=!1,"photo"===e.photo._?(e.photo=yield t.appPhotosManager.savePhoto(e.photo),(0,p.Z)({container:s,message:null,photo:e.photo,boxHeight:100,boxWidth:100,withoutPreloader:!0}),s.style.width=s.style.height=""):(0,h.Z)({div:s,peerId:d.NM,isDialog:!1,title:e.title});const o=document.createElement("div");o.classList.add("chat-title"),(0,n.Z)(o,(0,l.Z)(e.title));const u=e.pFlags.broadcast,f=(0,r.ag)(u?"Subscribers":"Members",[(0,a.Z)(e.participants_count)]);if(f.classList.add("chat-participants-count"),this.body.append(s,o,f),e.pFlags.request_needed){const e=document.createElement("div");(0,r.$d)(e,u?"RequestToJoinChannelDescription":"RequestToJoinGroupDescription"),e.classList.add("chat-participants-count","request-caption"),this.body.append(e)}this.show()},new((i=void 0)||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}));var e,t,i,s}}},3186:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(5994),n=i(3035),a=i(6219),o=i(2325),r=i(3512),d=i(8127);const l={pin:{title:"LimitReached",description:"LimitReachedPinDialogs",descriptionPremium:"LimitReachedPinDialogsPremium",descriptionLocked:"LimitReachedPinDialogsLocked",icon:"limit_pin"},folders:{title:"LimitReached",description:"LimitReachedFolders",descriptionPremium:"LimitReachedFoldersPremium",descriptionLocked:"LimitReachedFoldersLocked",icon:"limit_folders"}};class c extends d.Z{constructor(e,t){super("popup-limit",{buttons:void 0===e.isPremium?[{langKey:"LimitReached.Ok",isCancel:!0}]:e.isPremium?[{langKey:"OK",isCancel:!0}]:[{langKey:"IncreaseLimit",callback:()=>{a.ZP.openPremiumBot()},noRipple:!0},{langKey:"Cancel",isCancel:!0}],descriptionLangKey:void 0===e.isPremium?t.descriptionLocked:e.isPremium?t.descriptionPremium:t.description,descriptionLangArgs:e.isPremium?[e.limitPremium]:[e.limit,e.limitPremium],titleLangKey:t.title});const i=void 0===e.isPremium;if(i)this.element.classList.add("is-locked");else if(e.isPremium)this.element.classList.add("is-premium");else{const e=this.buttons.find((e=>!e.isCancel));e.element.classList.add("popup-limit-button");const t=document.createElement("i");t.classList.add("popup-limit-button-icon","tgico-premium_double"),e.element.append(t)}const r=document.createElement("div");r.classList.add("popup-limit-line");const d=document.createElement("div");d.classList.add("popup-limit-hint");const l=document.createElement("span");if(l.classList.add("popup-limit-hint-icon","tgico-"+t.icon),d.append(l,""+(e.isPremium?e.limitPremium:e.limit)),r.append(d),!i){const t=document.createElement("div");t.classList.add("limit-line");const i=document.createElement("div");i.classList.add("limit-line-free");const s=document.createElement("div");s.classList.add("limit-line-premium"),t.append(i,s),(0,o.$d)(i,"LimitFree"),s.append((0,o.ag)("LimitPremium"),""+e.limitPremium),r.append(t)}this.container.insertBefore(r,this.description);const c=()=>{d.classList.add("active")};s.Z.isAvailable("animations")?(0,n.d1)().then(c):c()}}function h(e){return function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const t=l[e],[i,s,n]=yield Promise.all([r.Z.managers.apiManager.getAppConfig(),...[!1,!0].map((t=>r.Z.managers.apiManager.getLimit(e,t)))]),a=i.premium_purchase_blocked;new c({isPremium:a?void 0:r.Z.premium,limit:s,limitPremium:n},t).show()}))}},3897:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(7298),n=i(1507),a=i(7479),o=i(8127);const r=[{value:3600,langPackKey:"ChatList.Mute.1Hour"},{value:14400,langPackKey:"ChatList.Mute.4Hours"},{value:28800,langPackKey:"ChatList.Mute.8Hours"},{value:86400,langPackKey:"ChatList.Mute.1Day"},{value:259200,langPackKey:"ChatList.Mute.3Days"},{value:-1,langPackKey:"ChatList.Mute.Forever",checked:!0}];class d extends o.Z{constructor(e,t){let i;super("popup-mute",{peerId:e,titleLangKey:"Notifications",buttons:[{langKey:"ChatList.Context.Mute",callback:()=>{this.managers.appMessagesManager.mutePeer({peerId:e,muteUntil:-1===i?n.rU:(0,s.Z)(!0)+i,threadId:t})}}],body:!0});const o=(0,a.ZC)(r,(e=>{i=+e}));this.body.append(o),this.show()}}},805:(e,t,i)=>{"use strict";i.d(t,{Z:()=>H,Y:()=>U});var s=i(1168),n=i(2796),a=i(6676),o=i(9405),r=i(7814);function d(e){let t,i;return e instanceof HTMLVideoElement?(t=e.videoWidth,i=e.videoHeight):(t=e.naturalWidth,i=e.naturalHeight),(0,r.Z)({media:e,mediaSize:(0,o.C)(t,i),boxSize:(0,o.C)(320,240),quality:.9})}var l=i(2325),c=i(9897),h=i(2398),u=i(2738),p=i(2341);function f(e){const t=e.src;return fetch(t).then((e=>e.arrayBuffer())).then((e=>{const t=new Uint8Array(e);let i=0;for(let e=0,s=t.length;e{const{input:e}=this.messageInputField;this.scrollable.onAdditionalScroll(),e.scrollTop>0&&e.scrollHeight>130&&this.scrollable.container.classList.remove("scrolled-bottom")},this.onKeyDown=e=>{const t=e.target,{input:i}=this.messageInputField;if(t!==i){if("INPUT"===t.tagName||t.isContentEditable)return;i.focus(),(0,h.Z)(i)}},this.attachFile=e=>{const t=this.willAttach,i=this.shouldCompress(e.type),s=document.createElement("div");s.classList.add("popup-item");const n={file:e};(0,M.Z)(n,["scaledBlob","middlewareHelper","itemDiv","mediaSpoiler"]),n.middlewareHelper=this.middlewareHelper.get().create(),n.itemDiv=s;const a=i?this.attachMedia(n):this.attachDocument(n);return t.sendFileDetails.push(n),a.catch((e=>{s.style.backgroundColor="#000",console.error("error rendering file",e)}))},this.animationGroup="",this.construct(i)}static canSend(e,t){return N(this,void 0,void 0,(function*(){const i=["send_photos","send_videos","send_docs","send_audios","send_gifs"],s=i.map((i=>!(e.isAnyChat()&&!t)||F.Z.managers.appChatsManager.hasRights(e.toChatId(),i))),n={},a=yield Promise.all(s);return i.forEach(((e,t)=>{n[e]=a[t]})),n}))}construct(e){return N(this,void 0,void 0,(function*(){this.willAttach={type:e,sendFileDetails:[],group:!0};const t=yield this.managers.apiManager.getLimit("caption");this.captionLengthMax=t;const i=yield H.canSend(this.chat.peerId,!0),s=i.send_photos,n=i.send_videos,o=i.send_docs;(0,u.fc)(this.btnConfirm,(()=>this.send()),{listenerSetter:this.listenerSetter});const r=yield(0,T.Z)({listenerSetter:this.listenerSetter,direction:"bottom-left",buttons:[{icon:"image",text:"Popup.Attach.AsMedia",onClick:()=>this.changeType("media"),verify:()=>{if(!this.hasAnyMedia()||"document"!==this.willAttach.type)return!1;if(!s&&!n)return!1;if(!s||!n){const e=s?A.Z:_.Z,{media:t,files:i}=this.partition(e);if(i.length)return!1}return!0}},{icon:"document",text:"SendAsFile",onClick:()=>this.changeType("document"),verify:()=>1===this.files.length&&"document"!==this.willAttach.type&&o},{icon:"document",text:"SendAsFiles",onClick:()=>this.changeType("document"),verify:()=>this.files.length>1&&"document"!==this.willAttach.type&&o},{icon:"groupmedia",text:"Popup.Attach.GroupMedia",onClick:()=>this.changeGroup(!0),verify:()=>!this.willAttach.group&&this.canGroupSomething()},{icon:"groupmediaoff",text:"Popup.Attach.UngroupMedia",onClick:()=>this.changeGroup(!1),verify:()=>this.willAttach.group&&this.canGroupSomething()},{icon:"mediaspoiler",text:"EnablePhotoSpoiler",onClick:()=>this.changeSpoilers(!0),verify:()=>this.canToggleSpoilers(!0,!0)},{icon:"mediaspoiler",text:"Popup.Attach.EnableSpoilers",onClick:()=>this.changeSpoilers(!0),verify:()=>this.canToggleSpoilers(!0,!1)},{icon:"mediaspoileroff",text:"DisablePhotoSpoiler",onClick:()=>this.changeSpoilers(!1),verify:()=>this.canToggleSpoilers(!1,!0)},{icon:"mediaspoileroff",text:"Popup.Attach.RemoveSpoilers",onClick:()=>this.changeSpoilers(!1),verify:()=>this.canToggleSpoilers(!1,!1)}]});this.header.append(r),this.btnConfirm.remove(),this.mediaContainer=document.createElement("div"),this.mediaContainer.classList.add("popup-photo"),this.scrollable.container.append(this.mediaContainer);const d=this.inputContainer=document.createElement("div");d.classList.add("popup-input-container");const l=document.createElement("div");let c,h,p;if(l.classList.add("popup-input-inputs","input-message-container"),this.messageInputField=new x.Z({placeholder:"PreviewSender.CaptionPlaceholder",name:"message",withLinebreaks:!0,maxLength:this.captionLengthMax}),this.listenerSetter.add(this.scrollable.container)("scroll",this.onScroll),this.listenerSetter.add(this.messageInputField.input)("scroll",this.onScroll),this.messageInputField.input.classList.replace("input-field-input","input-message-input"),this.messageInputField.inputFake.classList.replace("input-field-input","input-message-input"),l.append(this.messageInputField.input,this.messageInputField.inputFake),d.append(l,this.btnConfirm),this.ignoreInputValue||(this.messageInputField.value=this.wasInputValue=this.chat.input.messageInputField.input.innerHTML,this.chat.input.messageInputField.value=""),this.container.append(d),this.attachFiles(),this.addEventListener("close",(()=>{this.files.length=0,this.willAttach.sendFileDetails.length=0,O===this&&(O=void 0)})),(0,C.Z)({buttons:[{icon:"mediaspoiler",text:"EnablePhotoSpoiler",onClick:()=>{this.applyMediaSpoiler(p)},verify:()=>h&&!p.mediaSpoiler},{icon:"mediaspoileroff",text:"DisablePhotoSpoiler",onClick:()=>{this.removeMediaSpoiler(p)},verify:()=>!(!h||!p.mediaSpoiler)}],listenTo:this.mediaContainer,listenerSetter:this.listenerSetter,findElement:e=>(c=(0,L.Z)(e.target,"popup-item"),h=c.classList.contains("popup-item-media"),p=this.willAttach.sendFileDetails.find((e=>e.itemDiv===c)),c)}),"scheduled"!==this.chat.type){const e=new a.Z({onSilentClick:()=>{this.chat.input.sendSilent=!0,this.send()},onScheduleClick:()=>{this.chat.input.scheduleSending((()=>{this.send()}))},openSide:"top-left",onContextElement:this.btnConfirm,listenerSetter:this.listenerSetter});e.setPeerId(this.chat.peerId),this.container.append(e.sendMenu)}O=this}))}applyMediaSpoiler(e,t){return N(this,void 0,void 0,(function*(){const i=e.middlewareHelper.get(),{width:s,height:n}=e.itemDiv.style;let a,d;if(e.itemDiv.classList.contains("album-item")){const{width:t,height:i}=e.itemDiv.parentElement.style,o=parseInt(t),r=parseInt(i);a=+s.slice(0,-1)/100*o,d=+n.slice(0,-1)/100*r}else a=parseInt(s),d=parseInt(n);const{url:l}=yield(0,r.Z)({media:e.itemDiv.firstElementChild,boxSize:(0,o.C)(40,40),mediaSize:(0,o.C)(a,d),toDataURL:!0,quality:.2}),c=(0,Z.o)(l),h={_:"photoStrippedSize",bytes:c,type:"i"};e.strippedBytes=c;const u={_:"photo",sizes:[h],id:0,access_hash:0,date:0,dc_id:0,file_reference:[],pFlags:{}},p=yield(0,E.ZP)({middleware:i,width:a,height:d,animationGroup:this.animationGroup,media:u});i()&&(t||p.classList.add("is-revealing"),e.mediaSpoiler=p,e.itemDiv.append(p),yield(0,I.d1)(),i()&&(0,E.MR)({mediaSpoiler:p,reveal:!1}))}))}removeMediaSpoiler(e){(0,E.MR)({mediaSpoiler:e.mediaSpoiler,reveal:!0,destroyAfter:!0}),e.mediaSpoiler=void 0}appendDrops(e){this.body.append(e)}get type(){return this.willAttach.type}set type(e){this.willAttach.type=e}partition(e=p.Z){const[t,i]=(0,k.Z)(this.willAttach.sendFileDetails,(t=>e.has(t.file.type)));return{media:t,files:i}}mediaCount(){return this.partition().media.length}hasAnyMedia(){return this.mediaCount()>0}canGroupSomething(){const{media:e,files:t}=this.partition();return e.length>1||t.length>1}canToggleSpoilers(e,t){let i="media"===this.willAttach.type&&this.hasAnyMedia();if(t&&i&&(i=1===this.files.length),i){const s=this.willAttach.sendFileDetails.filter((e=>p.Z.has(e.file.type))),n=s.filter((e=>e.mediaSpoiler));i=!!t||s.length>1,i&&(i=e?s.length!==n.length:s.length===n.length)}return i}changeType(e){this.willAttach.type=e,this.attachFiles()}changeGroup(e){this.willAttach.group=e,this.attachFiles()}changeSpoilers(e){this.partition().media.forEach((t=>{e&&!t.mediaSpoiler?this.applyMediaSpoiler(t):!e&&t.mediaSpoiler&&this.removeMediaSpoiler(t)}))}addFiles(e){const t=e.filter((e=>!this.files.find((t=>t.lastModified===e.lastModified&&t.name===e.name&&t.size===e.size))));t.length&&(this.files.push(...t),this.attachFiles())}send(e=!1){return N(this,void 0,void 0,(function*(){let t=this.messageInputField.value;if(t.length>this.captionLengthMax)return void(0,n.Am)(l.ZP.format("Error.PreviewSender.CaptionTooLong",!0));const{peerId:i,input:s}=this.chat,a=yield H.canSend(i),o=this.willAttach;o.isMedia="media"===o.type||void 0;const{sendFileDetails:r,isMedia:d}=o;let c=!1;if(this.iterate((e=>{if(c)return;const t=e.map((e=>{const t=[[R,"GlobalAttachAudioRestricted","send_audios"],[()=>!p.Z.has(e.file.type),"GlobalAttachDocumentsRestricted","send_docs"]];d&&t.unshift([A.Z,"GlobalAttachPhotoRestricted","send_photos"],[()=>_.Z.has(e.file.type)&&e.noSound,"GlobalAttachGifRestricted","send_gifs"],[_.Z,"GlobalAttachVideoRestricted","send_videos"]);const i=t.find((([t])=>"function"==typeof t?t():t.has(e.file.type)));return i?a[i[2]]?void 0:i[1]:d||a.send_docs?void 0:"GlobalAttachDocumentsRestricted"})).find((e=>"string"==typeof e));t&&((0,n.bC)({langPackKey:t}),B.Z.isAvailable("animations")&&(0,D.Z)(this.body)),c||(c=!!t)})),c)return;if("scheduled"===this.chat.type&&!e)return void this.chat.input.scheduleSending((()=>{this.send(!0)}));const{length:h}=r,u=this.chat.getMessageSendingParams();this.iterate((e=>{t&&e.length!==h&&(this.managers.appMessagesManager.sendText(i,t,Object.assign(Object.assign({},u),{clearDraft:!0})),t=void 0);const s=e.map((e=>Object.assign(Object.assign({},e),{file:e.scaledBlob||e.file,spoiler:!!e.mediaSpoiler}))),n=Object.assign(Object.assign({},o),{sendFileDetails:s});this.managers.appMessagesManager.sendAlbum(i,Object.assign(Object.assign(Object.assign({},u),{caption:t,isMedia:d,clearDraft:!0}),n)),t=void 0})),s.replyToMsgId=this.chat.threadId,s.onMessageSent(),this.wasInputValue=void 0,this.hide()}))}modifyMimeTypeForTelegram(e){return"image/webp"===e?"image/jpeg":e}scaleImageForTelegram(e,t,i){return N(this,void 0,void 0,(function*(){const s=2560;let n,a=e.src;if("image/gif"!==t&&(Math.max(e.naturalWidth,e.naturalHeight)>s||i&&"image/webp"===t)){const{blob:i}=yield(0,r.Z)({media:e,boxSize:(0,o.C)(s,s),mediaSize:(0,o.C)(e.naturalWidth,e.naturalHeight),mimeType:this.modifyMimeTypeForTelegram(t)});n=i,URL.revokeObjectURL(a),a=yield y.Z.invoke("createObjectURL",i),yield(0,P.cj)(e,a)}return n&&{url:a,blob:n}}))}attachMedia(e){return N(this,void 0,void 0,(function*(){const{itemDiv:t}=e;t.classList.add("popup-item-media");const i=e.file;if(i.type.startsWith("video/")){const s=(0,g.Z)();let n;s.src=e.objectURL=yield y.Z.invoke("createObjectURL",i),s.autoplay=!0,s.controls=!1,s.muted=!0,s.addEventListener("timeupdate",(()=>{s.pause()}),{once:!0}),t.append(s);try{yield(0,b.Z)(s)}catch(e){n=e}if(e.width=s.videoWidth,e.height=s.videoHeight,e.duration=Math.floor(s.duration),n)throw n;const a=s.webkitAudioDecodedByteCount;void 0!==a&&(e.noSound=!a);const o=yield function(e){return new Promise(((t,i)=>{e.onseeked=()=>{e.onseeked=()=>{d(e).then(t),e.onseeked=void 0},e.currentTime=0},e.onerror=i,e.currentTime=Math.min(e.duration,1)}))}(s);e.thumb=Object.assign({url:yield y.Z.invoke("createObjectURL",o.blob)},o)}else{const s=new Image;t.append(s);const n=e.objectURL=yield y.Z.invoke("createObjectURL",i);yield(0,P.cj)(s,n);const a=e.file.type,o=yield this.scaleImageForTelegram(s,a,!0);if(o&&(e.objectURL=o.url,e.scaledBlob=o.blob),e.width=s.naturalWidth,e.height=s.naturalHeight,"image/gif"===i.type)return e.noSound=!0,Promise.all([f(s).then((t=>{e.duration=Math.ceil(t)})),d(s).then((t=>N(this,void 0,void 0,(function*(){e.thumb=Object.assign({url:yield y.Z.invoke("createObjectURL",t.blob)},t)}))))]).then((()=>{}))}}))}attachDocument(e){return N(this,void 0,void 0,(function*(){const{itemDiv:t}=e;t.classList.add("popup-item-document");const i=e.file,s=i.type.startsWith("image/"),n=R.has(i.type);(s||n||i.size<2e7)&&(e.objectURL||(e.objectURL=yield y.Z.invoke("createObjectURL",i)));const a=[];let o;if(s&&e.objectURL){o=new Image,yield(0,P.cj)(o,e.objectURL);const t=yield this.scaleImageForTelegram(o,e.file.type);t&&(e.objectURL=t.url)}if(n&&e.objectURL)try{const t=new Audio;t.src=e.objectURL,t.muted=!0,t.autoplay=!0,yield(0,b.Z)(t),e.duration=t.duration,a.push({_:"documentAttributeAudio",duration:e.duration,pFlags:{}})}catch(e){console.error("audio loading error",e)}const r={_:"document",file:i,file_name:i.name||"",size:i.size,type:n?"audio":s?"photo":void 0,access_hash:0,attributes:a,date:0,dc_id:0,file_reference:[],id:0,pFlags:{},duration:e.duration};let d;e.objectURL&&(d={url:e.objectURL,downloaded:i.size,type:w.Pt});const l=yield(0,S.Z)({message:{_:"message",pFlags:{is_outgoing:!0},mid:0,peerId:0,media:{_:"messageMediaDocument",document:r}},cacheContext:d});s&&(e.width=o.naturalWidth,e.height=o.naturalHeight),t.append(l)}))}shouldCompress(e){return"media"===this.willAttach.type&&p.Z.has(e)}onRender(){this.element.classList.contains("active")||(this.listenerSetter.add(document.body)("keydown",this.onKeyDown),!this.ignoreInputValue&&this.addEventListener("close",(()=>{this.wasInputValue&&(this.chat.input.messageInputField.value=this.wasInputValue)})),this.show())}setTitle(){const{willAttach:e,title:t,files:i}=this;let s;const n=[];if("document"===e.type)s="PreviewSender.SendFile",n.push(i.length);else{let e=0,t=0,a=0;i.forEach((i=>{i.type.startsWith("image/")?++e:i.type.startsWith("video/")?++t:++a})),[e,t,a].filter((e=>e>0)).length>1?(s="PreviewSender.SendFile",n.push(i.length)):e?(s="PreviewSender.SendPhoto",n.push(e)):t&&(s="PreviewSender.SendVideo",n.push(t))}(0,m.Z)(t,(0,l.ag)(s,n))}appendMediaToContainer(e){if(this.shouldCompress(e.file.type)){const t=(0,c.Z)(e.width,e.height,384,320);e.itemDiv.style.width=t.width+"px",e.itemDiv.style.height=t.height+"px"}this.mediaContainer.append(e.itemDiv)}iterate(e){const{sendFileDetails:t}=this.willAttach;if(!this.willAttach.group)return void t.forEach((t=>e([t])));const i=t.length;for(let s=0;s{e.middlewareHelper.destroy()}));const n=e.map((e=>this.attachFile(e)));Promise.all(n).then((()=>{i.replaceChildren(),e.length&&(this.setTitle(),this.iterate((e=>{const t=this.shouldCompress(e[0].file.type);if(t&&e.length>1){const t=document.createElement("div");t.classList.add("popup-item-album","popup-item"),t.append(...e.map((e=>e.itemDiv))),(0,v.Z)({container:t,items:e.map((e=>({w:e.width,h:e.height}))),maxWidth:384,minWidth:100,spacing:4}),i.append(t)}else e.forEach((e=>{this.appendMediaToContainer(e)}));t&&e.forEach((e=>{const t=s.find((t=>t.file===e.file));t&&t.mediaSpoiler&&this.applyMediaSpoiler(e,!0)}))})))})).then((()=>{this.onRender(),this.onScroll()}))}}window.PopupNewMedia=H},8683:(e,t,i)=>{"use strict";i.d(t,{BE:()=>Re,ZP:()=>Be,LI:()=>De});var s=i(1168),n=i(7445),a=i(3189),o=i(1470),r=i(8097);const d=function(e){const t={},i={};return s=>{var n,a;const o="_"+s;return null!==(n=(a="string"==typeof s?t:i)[o])&&void 0!==n?n:a[o]=e(s)}};function l(e){return e.replace(/\D/g,"")}const c={visa:/^4/,mastercard:/^(51|52|53|54|55|222|23|24|25|26|27)/,amex:/^(34|37)/,discover:/^(60|64|65)/,diners:/^(30|38|39)/,diners14:/^(36)/,jcb:/^(35)/,unionpay:/^(62[0-6,8-9]|627[0-6,8-9]|6277[0-7,9]|62778[1-9]|81)/,elo:/^(5067|509|636368|627780)/,mir:/^(220[0-4])/},h={visa:{minLength:16,maxLength:16,cvcMaxLength:3,cvcMinLength:null},mastercard:{minLength:16,maxLength:16,cvcMaxLength:3,cvcMinLength:null},amex:{minLength:15,maxLength:15,cvcMaxLength:4,cvcMinLength:3},unionpay:{minLength:13,maxLength:19,cvcMaxLength:3,cvcMinLength:null},diners:{minLength:16,maxLength:16,cvcMaxLength:3,cvcMinLength:null},diners14:{minLength:14,maxLength:14,cvcMaxLength:3,cvcMinLength:null},discover:{minLength:16,maxLength:16,cvcMaxLength:3,cvcMinLength:null},jcb:{minLength:16,maxLength:16,cvcMaxLength:3,cvcMinLength:null},elo:{minLength:16,maxLength:16,cvcMaxLength:3,cvcMinLength:null},mir:{minLength:16,maxLength:16,cvcMaxLength:3,cvcMinLength:null},unknown:{minLength:16,maxLength:16,cvcMaxLength:4,cvcMinLength:3}},u=d(((e="")=>{const t=Object.keys(c),i=l(e);let s,n=0;return t.forEach((e=>{const t=c[e],a=i.match(t);if(a){const t=a[0];t&&t.length>n&&(s=e,n=t.length)}})),s||"unknown"}));function p(e=""){return"diners14"===(t=u(e))?"diners":t;var t}var f=i(2738),m=i(5975),g=i(8497),v=i(2398),b=i(6740),y=i(5565),w=i(130),S=i(1656),C=i(6272),L=i(5180),E=i(286),I=i(7298),M=i(2325),Z=i(8115),P=i(5400),T=i(3512),k=i(9331),x=i(4494),A=i(9807),_=i(8842),F=i(279),D=i(7479),R=i(2796),B=i(7362),N=i(9492),O=i(4762);function U(e,t,i){const s=new Array(e);return s.fill(t),i?s.map(i):s}const H="0".charCodeAt(0)-"0".charCodeAt(0),z=/[0-9]/g;function j(e){return String.fromCharCode(e.charCodeAt(0)-H)}function G(e){return e.replace(z,j)}function V(e,t){return{type:"optional",result:e,consumed:t}}function K(e,t,i){return{type:"required",result:e,consumed:t,partial:i}}function W(e,t){return i=>{const s=new RegExp("^".concat(e.source.replace(/^\^/,""))),n=i.match(s),a=t?V:K;if(n){const e=n[0];return a(e,n.index+e.length)}return a("",i.length)}}const $=W(/1[0-2]|0?[1-9]|0/),q={digit:function(e){return W(/[0-9]/)(G(e))},capitalCharacter:function(e){const t=W(/\w/)(e);return t.result?K(t.result.toUpperCase(),t.consumed):t},month:e=>{const t=$(G(e)),i=l(t.result);return["0","1"].includes(t.result)&&1===e.length||"0"===t.result&&e.length>=2?K(t.result,e.length,!0):K(1===i.length?"0"+i:i,t.consumed)},formattingCharacter:e=>t=>{const i=e===t[0]?1:0;return function(e,t){return{type:"formatting",result:e,consumed:t}}(e,i)},optionalPattern:e=>t=>{const i=W(e,!0)(t);return i.result?i:V("",0)}},Y=q.digit,Q=q.capitalCharacter,X=q.formattingCharacter(" "),J=q.optionalPattern(/\d\d/),ee=[Y,Y,Y,Y,X,Y,Y,Y,Y,Y,Y,X,Y,Y,Y,Y,Y],te=[Y,Y,Y,Y,X,Y,Y,Y,Y,Y,Y,X,Y,Y,Y,Y],ie=new Set(["DZ","AR","AM","AU","AT","AZ","PT","BD","BY","BE","BA","BR","BN","BG","CA","IC","CN","CO","HR","CY","CZ","DK","EC","GB","EE","FO","FI","FR","GE","DE","GR","GL","GU","GG","NL","HU","IN","ID","IL","IT","JP","JE","KZ","KR","FM","KG","LV","LI","LT","LU","MK","MG","PT","MY","MH","MQ","YT","MX","MN","ME","NL","NZ","GB","NO","PK","PH","PL","FM","PT","PR","RE","RU","SA","SF","RS","SG","SK","SI","ZA","ES","LK","SX","VI","VI","SE","CH","TW","TJ","TH","TU","TN","TR","TM","VI","UA","GB","US","UY","UZ","VA","VN","GB","FM"]),se=d((e=>{const t=[];for(let i=0,s=0;i[q.month,q.formattingCharacter("/"),Y,Y,J],cardCvc:e=>ne.cardCvcFromBrand(u(e)),cardCvcFromBrand:d((e=>{const t=h[e],{cvcMinLength:i,cvcMaxLength:s}=t,n=U(i||s,Y);if(i&&i{switch(e){case"US":return U(5,Y);case"CA":return O.IS_ANDROID?null:[Q,Q,Q,X,Q,Q,Q];default:const t=U(10,q.optionalPattern(/\d/));return ie.has(e)&&(t[0]=Y),t}}))},ae=ne;function oe(e){return(0,o.Z)(e.map((e=>e.length)),0)}var re=i(1564);const de=new RegExp(re.Z,"g");function le(e){return e?{type:"invalid",code:e}:null}function ce(e,t={}){const{sanitized:i,minLength:s}=function(e){const t=l(e),i=u(e);return{sanitized:t,brand:i,minLength:h[i].minLength}}(e);return function(e,t,i){return e.length>=t?function(e){const t="0".charCodeAt(0),i=e.length%2;let s=0;for(let n=e.length-1;n>=0;--n){const a=i===n%2;let o=e.charCodeAt(n)-t;a&&(o*=2),o>9&&(o-=9),s+=o}return!(s%10)}(e)||"mir"===u(e)?null:le("invalid"):i?null:le("incomplete")}(i,s,t.ignoreIncomplete)}function he(e,t={}){const i=e.replace(de,"").split(/ ?\/ ?/),[s,n=""]=i,[a,o]=[s,n].map((e=>+e)),r=2===n.length?o%100:o;return n.length<2||3===n.length?t.ignoreIncomplete?null:le("incomplete"):le(function(e,t,i){const s=new Date(Date.now()),n=e<100?s.getFullYear()%100:s.getFullYear(),a=s.getMonth()+1;return isNaN(e)||isNaN(t)?(null==i?void 0:i.ignoreIncomplete)?null:"incomplete":e-n<0?"invalid_expiry_year_past":e-n>50?"invalid_expiry_year":!(e-n)&&t{this.dispatchEvent("finish"),this.hide(),this.openPathAfter&&ge.ZP.openUrl("https://t.me"+e.path_full)})),this.body.append(e.iframe),this.show(),e.onMount()}destroy(){return this.telegramWebView.destroy(),super.destroy()}}var we=i(6830),Se=i(5029);class Ce extends me.ZP{constructor(e){super(e),this.options=e,this.onKeyDown=e=>{var t,i;this.lastKeyDown=e.key,null===(i=(t=this.options).onKeyDown)||void 0===i||i.call(t,e)},this.onInput=()=>{var e,t;const i=this.value,s="Backspace"===this.lastKeyDown&&(this.lastTransformed&&this.lastTransformed.value.length||0)-i.length==1,n=this.lastTransformed=function(e){const{value:t,getPattern:i,deleting:s,input:n}=e,a=!s&&!!t.length,o=function(e,t,i={},s){const n=e(t);if(!n)return{value:t,selection:null,autocorrectComplete:!!t};const a=n.length,o=[],r=[];let d=0,l=0,c=0===i.selectionStart?0:null,h=0===i.selectionEnd?0:null;const u=e=>{e>0&&(null===c&&l+1>=i.selectionStart&&(c=oe(o)+(s?r.length:0)),null===h&&l+1>=i.selectionEnd&&(h=oe(o)+(s?r.length:0)),l+=e)};for(;d=t.length)break;r.push(a),++d,u(c)}}return s&&o.push(...r),{value:o.join(""),selection:{selectionStart:null===c||t.length&&i.selectionStart===t.length?oe(o):c,selectionEnd:null===h||t.length&&i.selectionEnd===t.length?oe(o):h},autocorrectComplete:d===a}}(i,t,{selectionStart:n?n.selectionStart:0,selectionEnd:n?n.selectionEnd:0},a),{value:r,selection:d}=o;return{value:r,meta:{autocorrectComplete:o.autocorrectComplete,empty:!r},selection:d}}({value:i,getPattern:this.options.formatMethod,deleting:s,input:this.input}),a=n.value;a!==i&&(this.setValueSilently(a),n.selection&&(this.input.selectionStart=n.selection.selectionStart,this.input.selectionEnd=n.selection.selectionEnd)),this.validateNew(a,{ignoreIncomplete:!0}),null===(t=(e=this.options).onChange)||void 0===t||t.call(e,n)},this.onBlur=()=>{var e;const t=null===(e=this.lastTransformed)||void 0===e?void 0:e.value;t&&this.validateNew(t)},this.validate=()=>this.validateNew(),this.input.addEventListener("keydown",this.onKeyDown),this.input.addEventListener("input",this.onInput),this.input.addEventListener("blur",this.onBlur)}update(){this.onInput()}validateNew(e,t,i){var s,n,a,o,r;let d;if(void 0===e&&(e=null!==(n=null===(s=this.lastTransformed)||void 0===s?void 0:s.value)&&void 0!==n?n:""),void 0===t&&(t={}),d=this.options.validateMethod?null===(o=(a=this.options).validateMethod)||void 0===o?void 0:o.call(a,e,t):function(e,t,i={}){return e.meta.autocorrectComplete||i.ignoreIncomplete?null:le("incomplete")}(this.lastTransformed,0,t),null==d?void 0:d.code){const e=null===(r=this.options.errorKeys)||void 0===r?void 0:r[d.code];return!i&&this.setState(me.I1.Error,e),!1}return!i&&this.setState(me.I1.Neutral),!0}}function Le(e,t){const i=()=>{const i=e.every((e=>"validateNew"in e?e.validateNew(void 0,void 0,!0):e.isValid()));t(i)};return e.forEach((e=>{if(e instanceof Ce){const t=e.options.onChange;e.options.onChange=(...e)=>{null==t||t(...e),i()},"update"in e&&e.update()}else e.input.addEventListener("input",i)})),{validate:i}}function Ee(e,t){let i,s;return(e||t)&&(e&&(i=new fe.Z({noPhoneCodes:!0,onCountryChange:()=>{null==s||s.update()},required:!0,autocomplete:"country"})),t&&(s=new Ce({label:"PaymentShippingZipPlaceholder",plainText:!0,inputMode:"numeric",autocomplete:"postal-code",formatMethod:()=>{const{country:e}=i.getSelected(),t=null==e?void 0:e.iso2;return ae.postalCodeFromCountry(t&&t.toUpperCase())}}))),{countryInputField:i,postcodeInputField:s}}const Ie=new Set(["stripe","smartglocal"]);class Me extends s.Z{constructor(e,t){if(super("popup-payment popup-payment-card",{closable:!0,overlayClosable:!0,body:!0,scrollable:Ie.has(e.native_provider),title:"PaymentCardInfo"}),this.paymentForm=e,this.savedCard=t,Ie.has(e.native_provider))this.d();else{const t=this.telegramWebView=be({url:e.url});t.addEventListener("payment_form_submit",(t=>{const i={title:t.title,save:!1};this.dispatchEvent("finish",{token:t.credentials,card:i}),this.hide(),e.pFlags.can_save_credentials&&(0,pe.Z)({titleLangKey:"PaymentCardSavePaymentInformation",descriptionLangKey:"PaymentCardSavePaymentInformationInfoLine1",button:{langKey:"Save"}}).then((()=>{i.save=!0}),ue.Z)})),this.body.append(t.iframe),this.show(),t.onMount()}}destroy(){var e;return null===(e=this.telegramWebView)||void 0===e||e.destroy(),super.destroy()}d(){const e=this.savedCard,t=new Se.Z({name:"PaymentInfo.Card.Title",noDelimiter:!0,noShadow:!0}),i=JSON.parse(this.paymentForm.native_params.data);let s,n,a=0;const o=new Ce({label:"PaymentCardNumber",plainText:!0,inputMode:"numeric",autocomplete:"cc-number",formatMethod:ae.cardNumber,validateMethod:ce,errorKeys:{invalid:"PaymentCard.Error.Invalid",incomplete:"PaymentCard.Error.Incomplete"},onChange:e=>{(e=>{if(s===e)return;const t=++a;s=e;const i=De(e);if(!i)return void(n&&(n.remove(),n=void 0));const r=new Image;r.classList.add("input-field-icon"),(0,b.cj)(r,i,!1).then((()=>{a===t&&(n?n.replaceWith(r):o.container.append(r),n=r)}))})(p(e.value)),l.update()}});let r;i.need_cardholder_name&&(r=new me.ZP({label:"Checkout.NewCard.CardholderNamePlaceholder",maxLength:255,required:!0,autocomplete:"cc-name"}));const d=new Ce({label:"SecureId.Identity.Placeholder.ExpiryDate",plainText:!0,inputMode:"numeric",autocomplete:"cc-exp",formatMethod:ae.cardExpiry,validateMethod:he});d.input.addEventListener("input",(()=>{let e=d.value;if(e.length<5)return;const t=e.split("/");4===t[1].length&&(e=[t[0],t[1].slice(2)].join("/"),d.setValueSilently(e))}),{capture:!0});const l=new Ce({labelText:"CVC",plainText:!0,inputMode:"numeric",autocomplete:"cc-csc",name:"cvc",formatMethod:()=>ae.cardCvc(o.value)}),c=(new we.T(l.container,l.input),[o,d,l,r].filter(Boolean));c.forEach((e=>{const t=t=>{if(!e.value&&"Backspace"===t.key){const t=c[c.indexOf(e)-1];t&&(0,v.Z)(t.input,!0)}};if(e instanceof Ce){e.options.onKeyDown=t;const i=e.options.onChange;e.options.onChange=t=>{if(null==i||i(t),document.activeElement===e.input&&t.meta.autocorrectComplete)for(let t=c.indexOf(e),i=c.length;te.container))));const y=!!this.paymentForm.pFlags.can_save_credentials,w=new A.Z({text:"PaymentCardSavePaymentInformation",checked:!!y}),S=new D.ZP({checkboxField:w,subtitleLangKey:y?"PaymentCardSavePaymentInformationInfoLine1":"Checkout.2FA.Text"});y||S.container.classList.add("is-disabled"),(f||t).content.append(S.container),this.scrollable.append(...[t,f].filter(Boolean).map((e=>e.container)));const C=Re({key:"PaymentInfo.Done",onClick:()=>{return e=this,t=void 0,n=function*(){const e={cardNumber:o.value,expiryFull:d.value,expiryMonth:d.value.split("/")[0],expiryYear:d.value.split("/")[1],cvc:l.value,cardholderName:null==r?void 0:r.value,country:null==m?void 0:m.value,zip:null==g?void 0:g.value,save:null==w?void 0:w.checked},t=this.paymentForm.native_provider;let s;if("stripe"===t){const t=new URL("https://api.stripe.com/v1/tokens");t.search=new URLSearchParams({"card[number]":e.cardNumber,"card[exp_month]":e.expiryMonth,"card[exp_year]":e.expiryYear,"card[cvc]":e.cvc,"card[address_zip]":e.zip,"card[address_country]":e.country,"card[name]":e.cardholderName}).toString();const n=yield fetch(t.toString(),{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:`Bearer ${i.publishable_key}`}});s=yield n.json()}else if("smartglocal"===t){const t={card:{number:e.cardNumber.replace(/[^\d]+/g,""),expiration_month:e.expiryMonth,expiration_year:e.expiryYear,security_code:e.cvc.replace(/[^\d]+/g,"")}},n="https://tgb.smart-glocal.com/cds/v1/tokenize/card",a=yield fetch(n,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","X-PUBLIC-TOKEN":i.public_token},body:JSON.stringify(t)});s={type:"card",token:(yield a.json()).data.token}}this.dispatchEvent("finish",{token:s,card:e}),this.hide()},new((s=void 0)||(s=Promise))((function(i,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,r)}d((n=n.apply(e,t||[])).next())}));var e,t,s,n}});Le([o,r,d,l,m,g].filter(Boolean),(e=>{C.disabled=!e})),e&&(o.value=e.cardNumber,d.value=e.expiryFull,l.value=e.cvc,r&&(r.value=e.cardholderName),m&&(m.value=e.country),g&&(g.value=e.zip)),this.body.append(this.btnConfirmOnEnter=C),this.show(),o.validateNew(void 0,void 0,!0)||(0,v.Z)(o.input)}}class Ze extends s.Z{constructor(e,t){super("popup-payment popup-payment-card-confirmation",{closable:!0,overlayClosable:!0,body:!0,scrollable:!0,title:"Checkout.PasswordEntry.Title"});const i=new Se.Z({noDelimiter:!0,noShadow:!0,caption:"Checkout.PasswordEntry.Text",captionArgs:[e]}),s=new we.Z({labelText:t.hint});i.content.append(s.container),this.scrollable.append(i.container);const n=()=>{a.disabled=!s.value,s.setState(me.I1.Neutral)};s.input.addEventListener("input",n);const a=Re({key:"Checkout.PasswordEntry.Pay",onClick:()=>{return e=this,i=void 0,a=function*(){try{const e=yield this.managers.passwordManager.getInputCheckPassword(s.value,t),i=yield this.managers.apiManager.invokeApi("account.getTmpPassword",{password:e,period:60});this.dispatchEvent("finish",i),this.hide()}catch(e){throw"PASSWORD_HASH_INVALID"===e.type&&(e.handled=!0,s.setError("PASSWORD_HASH_INVALID")),e}},new((n=void 0)||(n=Promise))((function(t,s){function o(e){try{d(a.next(e))}catch(e){s(e)}}function r(e){try{d(a.throw(e))}catch(e){s(e)}}function d(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(e,i||[])).next())}));var e,i,n,a}});this.body.append(this.btnConfirmOnEnter=a),n(),this.show(),(0,v.Z)(s.input)}}var Pe=i(1171),Te=i(709);class ke extends s.Z{constructor(e,t,i){super("popup-payment popup-payment-shipping",{closable:!0,overlayClosable:!0,body:!0,scrollable:!0,title:"PaymentShippingInfo"}),this.paymentForm=e,this.inputInvoice=t,this.focus=i,this.d()}d(){const e=this.paymentForm.invoice,t=this.paymentForm.saved_info;let i,s,n,a,o,r,d,l,c,h,u;if(e.pFlags.shipping_address_requested){i=new Se.Z({name:"PaymentShippingAddress",noDelimiter:!0,noShadow:!0}),s=new me.ZP({label:"PaymentShippingAddress1Placeholder",maxLength:64,required:!0}),n=new me.ZP({label:"PaymentShippingAddress2Placeholder",maxLength:64}),a=new me.ZP({label:"PaymentShippingCityPlaceholder",maxLength:64,required:!0}),o=new me.ZP({label:"PaymentShippingStatePlaceholder",maxLength:64});const e=Ee(!0,!0);r=e.countryInputField,d=e.postcodeInputField,i.content.append(...[s,n,a,o,r,d].filter(Boolean).map((e=>e.container)))}if([e.pFlags.name_requested,e.pFlags.email_requested,e.pFlags.phone_requested].includes(!0)){l=new Se.Z({name:"PaymentShippingReceiver",noDelimiter:!0,noShadow:!0});const t=()=>{const e=h.value,t=(0,Pe.Z)(e);return!(!t||t[0].length!==e.length)},i=()=>!!u.value.match(/\d/);e.pFlags.name_requested&&(c=new me.ZP({label:"PaymentShippingName",maxLength:256,required:!0})),e.pFlags.email_requested&&(h=new me.ZP({label:"PaymentShippingEmailPlaceholder",maxLength:64,required:!0,validate:t})),e.pFlags.phone_requested&&(u=new Te.Z({required:!0,validate:i})),l.content.append(...[c,h,u].filter(Boolean).map((e=>e.container)))}const p=new A.Z({text:"PaymentShippingSave",checked:!0}),f=new D.ZP({checkboxField:p,subtitleLangKey:"PaymentShippingSaveInfo"});(l||i).content.append(f.container),this.scrollable.append(...[i,l].filter(Boolean).map((e=>e.container)));const m=Re({key:"PaymentInfo.Done",onClick:()=>{return e=this,t=void 0,l=function*(){const e=r&&r.getSelected().country,t={_:"paymentRequestedInfo",shipping_address:e&&{_:"postAddress",street_line1:s.value,street_line2:n.value,city:a.value,state:o.value,country_iso2:null==e?void 0:e.iso2,post_code:d.value},name:null==c?void 0:c.value,email:null==h?void 0:h.value,phone:null==u?void 0:u.value};try{const e=yield this.managers.appPaymentsManager.validateRequestedInfo(this.inputInvoice,t,null==p?void 0:p.checked);this.dispatchEvent("finish",{shippingAddress:t,requestedInfo:e}),this.hide()}catch(e){const t={ADDRESS_STREET_LINE1_INVALID:s,ADDRESS_STREET_LINE2_INVALID:n,ADDRESS_COUNTRY_INVALID:r,ADDRESS_CITY_INVALID:a,ADDRESS_STATE_INVALID:o,ADDRESS_POSTCODE_INVALID:d,REQ_INFO_NAME_INVALID:c,REQ_INFO_EMAIL_INVALID:h,REQ_INFO_PHONE_INVALID:u}[e.type];throw t&&(t.setError(),e.handled=!0),e}},new((i=void 0)||(i=Promise))((function(s,n){function a(e){try{r(l.next(e))}catch(e){n(e)}}function o(e){try{r(l.throw(e))}catch(e){n(e)}}function r(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}r((l=l.apply(e,t||[])).next())}));var e,t,i,l}});if(this.body.append(this.btnConfirmOnEnter=m),t){const e=t.shipping_address;e&&(s.value=e.street_line1,n.value=e.street_line2,a.value=e.city,o.value=e.state,r.selectCountryByIso2(e.country_iso2),d.value=e.post_code),t.name&&c&&(c.value=t.name),t.email&&h&&(h.value=t.email),t.phone&&u&&(u.value=t.phone)}const{validate:g}=Le([s,n,a,o,r,d,c,h,u].filter(Boolean),(e=>{m.disabled=!e}));let b;g(),this.show(),b=this.focus?{name:c,email:h,phone:u}[this.focus]:s,b&&(0,v.Z)(b.input)}}var xe=i(1218);class Ae extends s.Z{constructor(e,t,i){super("popup-payment popup-payment-shipping-methods",{closable:!0,overlayClosable:!0,body:!0,scrollable:!0,title:"PaymentShippingMethod"}),this.paymentForm=e,this.requestedInfo=t,this.shippingOption=i,this.d()}d(){const e=new Se.Z({name:"PaymentCheckoutShippingMethod",noDelimiter:!0,noShadow:!0}),t=this.requestedInfo.shipping_options.map((e=>new D.ZP({radioField:new xe.Z({text:e.title,name:"shipping-method",value:e.id}),subtitle:(0,L.Z)((0,o.Z)(e.prices.map((({amount:e})=>+e)),0),this.paymentForm.invoice.currency)})));let i;const s=(0,D.De)(t,(e=>{i=e}));this.shippingOption?t.find((e=>e.radioField.input.value===this.shippingOption.id)).radioField.checked=!0:t[0].radioField.checked=!0,e.content.append(s),this.scrollable.append(e.container);const n=Re({key:"PaymentInfo.Done",onClick:()=>{this.dispatchEvent("finish",this.requestedInfo.shipping_options.find((e=>e.id===i))),this.hide()}});this.body.append(this.btnConfirmOnEnter=n),this.show()}}var _e=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const Fe=["amex","card","diners","discover","jcb","mastercard","visa","unionpay","mir","logo"];function De(e){if(Fe.includes(e))return`assets/img/${e}.svg`}function Re(e){var t,i;const s=null!==(t=e.textEl)&&void 0!==t?t:new M.ZP.IntlElement({key:null!==(i=e.key)&&void 0!==i?i:"PaymentInfo.Done"}),n=s.key,a=(0,x.Z)("btn-primary btn-color-primary payment-item-pay");return a.append(s.element),(0,f.fc)(a,(()=>_e(this,void 0,void 0,(function*(){const t=e.onClick();if(!(t instanceof Promise))return;const i=(0,F.y)(a),o=(0,S.Z)([a],!0);s.compareAndUpdate({key:"PleaseWait"});try{yield t}catch(e){e.handled||console.error("payment button error",e),o(),s.compareAndUpdate({key:n}),i.remove()}})))),a}class Be extends s.Z{constructor(e,t,i,s){super("popup-payment",{closable:!0,overlayClosable:!0,body:!0,scrollable:!0,title:!0}),this.message=e,this.inputInvoice=t,this.paymentForm=i,this.isReceipt=s,this.tipButtonsMap=new Map,this.d().catch((e=>{console.error("payment popup error",e),this.hide()}))}d(){var e,t,i;return _e(this,void 0,void 0,(function*(){this.element.classList.add("is-loading"),this.show();let s=!1;const d=()=>{s||(s=!0,tt&&tt.hide(),this.hide())};let{paymentForm:l,message:c}=this;c&&this.listenerSetter.add(T.Z)("payment_sent",(({peerId:e,mid:t})=>{c.peerId===e&&c.mid===t&&d()}));const h=null==c?void 0:c.media,u=null!==(e=this.isReceipt)&&void 0!==e?e:h?!!h.receipt_msg_id||"messageExtendedMedia"===(null===(t=h.extended_media)||void 0===t?void 0:t._):"payments.paymentReceipt"===l._,S=h?h.pFlags.test:l.invoice.pFlags.test,O=h?h.photo:l.photo,U=h?h.title:l.title,H=h?h.description:l.description;(0,M.$d)(this.title,u?"PaymentReceipt":"PaymentCheckout"),S&&this.title.append(" (Test)");const z="payment-item",j=document.createElement("div");j.classList.add(z);const G=z+"-details",V=document.createElement("div");let K;V.classList.add(G),O&&(K=document.createElement("div"),K.classList.add(G+"-photo","media-container-contain"),(0,N.Z)({photo:O,container:K,boxWidth:100,boxHeight:100,size:{_:"photoSizeEmpty",type:""}}),V.append(K));const W=G+"-lines",$=document.createElement("div");$.classList.add(W);const q=document.createElement("div");q.classList.add(W+"-title");const Y=document.createElement("div");Y.classList.add(W+"-description");const Q=document.createElement("div");Q.classList.add(W+"-bot-name"),$.append(q,Y,Q),(0,w.Z)(q,(0,Z.Z)(U)),(0,w.Z)(Y,(0,Z.Z)(H));const X=new _.Z;Q.append(X.element),V.append($),j.append(V),this.scrollable.append(j);const J=document.createElement("div");J.classList.add(z+"-preloader-container"),(0,F.y)(J,!0),this.scrollable.container.append(J);const ee=this.inputInvoice;l||(l=u?yield this.managers.appPaymentsManager.getPaymentReceipt(c.peerId,h.receipt_msg_id||ee.msg_id):yield this.managers.appPaymentsManager.getPaymentForm(ee),this.paymentForm=l);let te=l.saved_info||l.info;const ie=null===(i=l.saved_credentials)||void 0===i?void 0:i[0];let[se,ne,ae]=yield Promise.all([!u&&te&&this.managers.appPaymentsManager.validateRequestedInfo(ee,te),ie&&this.managers.passwordManager.getState(),(0,B.Z)({peerId:l.provider_id.toPeerId()})]);yield X.update({peerId:l.bot_id.toPeerId()}),J.remove(),this.element.classList.remove("is-loading");const oe=(e,t)=>(0,L.Z)(e,de,t),{invoice:re}=l,de=re.currency,le=re.pFlags.recurring&&!u;yield X.update({peerId:l.bot_id.toPeerId()});const ce=le?yield(0,B.Z)({peerId:l.bot_id.toPeerId()}):void 0;J.remove(),this.element.classList.remove("is-loading");const he=()=>{const e=document.createElement("div");e.classList.add(ue+"-price");const t=document.createElement("span"),i=document.createElement("span");return e.append(t,i),{label:e,left:t,right:i}},ue=z+"-prices",pe=document.createElement("div");pe.classList.add(ue);const fe=e=>e.map((e=>{const{amount:t,label:i}=e,s=he();s.left.textContent=i;const n=oe(t);return s.right.textContent=n,s.label})),me=fe(re.prices);let ge=()=>0,ve=0;const be=()=>{const e=oe(Ce+ge()+ve);Se.right.textContent=e,we.compareAndUpdate({key:"PaymentCheckoutPay",args:[e]})},we=new M.ZP.IntlElement,Se=he();Se.label.classList.add("is-total"),(0,M.$d)(Se.left,"PaymentTransactionTotal");const Ce=(0,o.Z)(re.prices.map((({amount:e})=>+e)),0),Le=void 0!==re.max_tip_amount&&!u||!!l.tip_amount;if(Le){const e=z+"-tips",t=n.Z[de];ge=()=>+i().replace(/\D/g,"");const i=()=>c.value,s=()=>{const e=(0,r.Z)(i(),`500 ${a.Bf} ${a.bt}`);c.style.width=e+"px"},o=e=>{e=Math.min(+e,+re.max_tip_amount);const t=oe(e,!0);c.value=t,document.activeElement===c&&(0,v.Z)(c),C&&C();const i=this.tipButtonsMap.get(e);i&&i.classList.add("active"),s(),be()},d=he();(0,M.$d)(d.left,u?"PaymentTip":"PaymentTipOptional");const c=document.createElement("input");c.type="tel",c.classList.add("input-clear",e+"-input"),d.right.append(c),u?d.label.classList.add("disable-hover"):d.label.style.cursor="text",d.label.addEventListener("mousedown",(e=>{(0,m.Z)(e.target,c)||(0,v.Z)(c)}));const h=c instanceof HTMLInputElement?1:2,p=()=>{w?--w:(w=h,(0,v.Z)(c))},b=()=>{setTimeout((()=>{w=h,(0,v.Z)(c),document.addEventListener("selectionchange",p)}),0)},y=()=>{c.addEventListener("focus",b,{once:!0}),document.removeEventListener("selectionchange",p)};let w;c.addEventListener("focusout",y),y(),c.addEventListener("input",(()=>{o(ge())}));const S=[t.symbol,t.space_between?" ":""];let C;if(t.symbol_left||S.reverse(),d.right[t.symbol_left?"prepend":"append"](S.join("")),me.push(d.label),u)o(l.tip_amount);else{const t=document.createElement("div");t.classList.add(e);const i=e+"-tip",s=re.suggested_tip_amounts.map((e=>{const t=(0,x.Z)(i,{noRipple:!0});return t.textContent=oe(e),this.tipButtonsMap.set(+e,t),t}));C=()=>{const e=t.querySelector(".active");e&&e.classList.remove("active")},(0,f.fc)(t,(e=>{const t=(0,g.Z)(e.target,i);if(!t)return;let s=0;if(t.classList.contains("active"))t.classList.remove("active");else{C(),t.classList.add("active");for(const[e,i]of this.tipButtonsMap)if(i===t){s=e;break}}o(s)})),o(0),t.append(...s),me.push(t)}}else be();me.push(Se.label),pe.append(...me),j.append(pe);const Ee=(e,t)=>_e(this,void 0,void 0,(function*(){const i=document.createElement("img");i.classList.add("media-photo"),yield(0,b.cj)(i,De(t));let s=e.media;s?(0,y.Z)(s,i):(s=e.createMedia("small"),s.classList.add("media-container-cover"),s.append(i)),e.container.classList.remove("row-with-icon")})),Ie=e=>{e.titleLangKey&&(e.subtitleLangKey=e.titleLangKey),e.noWrap=!0;const t=new D.ZP(e);return t.container.classList.add(z+"-row"),e.titleLangKey&&t.subtitle.classList.add("hide"),t},Pe=(e,t)=>{if(e.title.textContent=t,!t){const t=M.ZP.weakMap.get(e.subtitle.firstElementChild);e.title.append((0,M.ag)(t.key))}e.subtitle.classList.toggle("hide",!t)},Te=e=>{let t,i,s;"title"in e?(t=e.title.split(" ").shift(),i=e.title,s=e.icon):(t=p(e.cardNumber),i=t+" *"+e.cardNumber.split(" ").pop()),Ne.title.classList.remove("tgico","tgico-card_outline"),Ee(Ne,s||t.toLowerCase()),Pe(Ne,i)},xe=()=>{new Me(l,Fe).addEventListener("finish",(({token:e,card:t})=>{Be=e,Fe=t,Te(t)}))};let Fe,Be;const Ne=Ie({titleLangKey:"PaymentCheckoutMethod",clickable:u?void 0:xe,icon:"card_outline"});Ne.container.classList.add(z+"-method-row"),ie?Te(ie):l.credentials_title&&Te({title:l.credentials_title});const Oe=Ie({title:ae,subtitleLangKey:"PaymentCheckoutProvider"}),Ue=new k.Z;let He,ze,je,Ge,Ve,Ke,We,$e;Ue.classList.add("avatar-32"),Oe.createMedia("small").append(Ue),Ue.updateWithOptions({peerId:l.provider_id.toPeerId()});const qe=re.pFlags.shipping_address_requested?e=>{if(!e)return Ve.subtitle.classList.add("hide"),void(0,y.Z)(Ve.title,(0,M.ag)("PaymentShippingAddress"));const t=e.shipping_address;Pe(He,[t.city,t.street_line1,t.street_line2].filter(Boolean).join(", ")),Ve.container.classList.toggle("hide",!se&&!u)}:void 0,Ye=e=>{qe&&qe(e),ze&&Pe(ze,e.name),je&&Pe(je,e.email),Ge&&Pe(Ge,e.phone&&"+"+(0,C.u)(e.phone).formatted)};if(u||(We=e=>{new ke(l,ee,e).addEventListener("finish",(({shippingAddress:e,requestedInfo:t})=>{se=t,te=l.saved_info=e,Ye(e)}))}),re.pFlags.shipping_address_requested){const e=e=>{const i=new E.Z(this.scrollable,void 0,!0);if(i.save(),t&&t.forEach((e=>e.remove())),!e)return ve=0,be(),i.restore(),void this.onContentUpdate();Ke=e,Pe(Ve,e.title),ve=(0,o.Z)(e.prices.map((({amount:e})=>+e)),0),t=fe(e.prices);let s=Se.label;Le&&(s=s.previousElementSibling,u||(s=s.previousElementSibling)),t.forEach((e=>s.parentElement.insertBefore(e,s))),be(),i.restore(),this.onContentUpdate()};let t;He=Ie({icon:"location",titleLangKey:"PaymentShippingAddress",clickable:!u&&We.bind(null,void 0)}),Ve=Ie({icon:"shipping",titleLangKey:"PaymentCheckoutShippingMethod",clickable:!u&&($e=()=>{new Ae(l,se,Ke).addEventListener("finish",(t=>{e(t)}))})}),Ve.container.classList.add("hide");const i=l.shipping;i&&e(i)}re.pFlags.name_requested&&(ze=Ie({icon:"newprivate",titleLangKey:"PaymentCheckoutName",clickable:!u&&We.bind(null,"name")})),re.pFlags.email_requested&&(je=Ie({icon:"mention",titleLangKey:"PaymentShippingEmailPlaceholder",clickable:!u&&We.bind(null,"email")})),re.pFlags.phone_requested&&(Ge=Ie({icon:"phone",titleLangKey:"PaymentCheckoutPhoneNumber",clickable:!u&&We.bind(null,"phone")})),te&&Ye(te);const Qe=[Ne,Oe,He,Ve,ze,je,Ge].filter(Boolean),Xe=le&&new A.Z({text:"Payments.Recurrent.Accept",textArgs:[(0,P.ZP)(re.recurring_terms_url),ce]}),Je=le&&Ie({checkboxField:Xe}),et=le?[document.createElement("hr"),Je.container]:[];let tt,it;this.scrollable.append(...[document.createElement("hr"),...Qe.map((e=>e.container)),...et].filter(Boolean));const st=()=>{nt.disabled=!(!Xe||Xe.checked)};let nt;nt=Re(u?{onClick:()=>this.hide(),key:"Done"}:{onClick:()=>{const e=re.pFlags.name_requested&&!(null==te?void 0:te.name)?"name":re.pFlags.email_requested&&!(null==te?void 0:te.email)?"email":re.pFlags.phone_requested&&!(null==te?void 0:te.phone)?"phone":void 0;if(re.pFlags.shipping_address_requested){if(!se)return void We();if(!Ke)return void $e()}else if(e)return void We(e);return Fe||it?Promise.resolve().then((()=>_e(this,void 0,void 0,(function*(){const e=it?{_:"inputPaymentCredentialsSaved",id:ie.id,tmp_password:it.tmp_password}:{_:"inputPaymentCredentials",data:{_:"dataJSON",data:JSON.stringify(Be.token?Be:{type:Be.type,id:Be.id})},pFlags:{save:Fe.save||void 0}};try{const t=yield this.managers.appPaymentsManager.sendPaymentForm(ee,l.form_id,null==se?void 0:se.id,null==Ke?void 0:Ke.id,e,ge());"payments.paymentResult"===t._?d():(tt=new ye(t.url,!h.extended_media),tt.addEventListener("finish",(()=>{tt=void 0,d()})),yield new Promise(((e,t)=>{tt.addEventListener("close",(()=>{if(tt=void 0,s)e();else{const e=new Error("payment not finished");e.handled=!0,t(e)}}))})))}catch(e){throw"BOT_PRECHECKOUT_TIMEOUT"===e.type?((0,R.bC)({langPackKey:"Error.AnError"}),e.handled=!0):"TMP_PASSWORD_INVALID"===e.type&&(ne=it=void 0,(0,f.tH)(nt),e.handled=!0),e}})))):ie?void Promise.resolve(null!=ne?ne:this.managers.passwordManager.getState()).then((e=>{new Ze(ie.title,e).addEventListener("finish",(e=>{ne=void 0,it=e,(0,f.tH)(nt);const t=e.valid_until-(0,I.Z)(!0)-5;setTimeout((()=>{it===e&&(it=void 0)}),1e3*t)}))})):void xe()},textEl:we}),st(),Xe&&Xe.input.addEventListener("change",st),this.body.append(this.btnConfirmOnEnter=nt),this.onContentUpdate()}))}}},8127:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(9331),n=i(1168),a=i(2325),o=i(9807),r=i(130);class d extends n.Z{constructor(e,t={}){if(super("popup-peer"+(e?" "+e:""),Object.assign(Object.assign({overlayClosable:!0},t),{title:!0,buttons:t.buttons&&(0,n.x)(t.buttons)})),this.className=e,t.peerId){const e=new s.Z;e.classList.add("avatar-32"),e.updateWithOptions({isDialog:!0,peerId:t.peerId,threadId:t.threadId,wrapOptions:{middleware:this.middlewareHelper.get()}}),this.header.prepend(e)}t.noTitle||(t.titleLangKey||!t.title?this.title.append((0,a.ag)(t.titleLangKey||"AppName",t.titleLangArgs)):t.title instanceof HTMLElement?this.title.append(t.title):this.title.innerText=t.title||"");const i=document.createDocumentFragment();if(t.descriptionLangKey||t.description){const e=this.description=document.createElement("p");e.classList.add("popup-description"),t.descriptionLangKey?e.append((0,a.ag)(t.descriptionLangKey,t.descriptionLangArgs)):t.description&&(0,r.Z)(e,t.description),i.append(e)}t.checkboxes&&(this.container.classList.add("have-checkbox"),t.checkboxes.forEach((e=>{e.withRipple=!0;const t=new o.Z(e);e.checkboxField=t,i.append(t.label)})),t.buttons.forEach((e=>{if(e.callback){const i=e.callback;e.callback=()=>{const e=new Set;t.checkboxes.forEach((t=>{t.checkboxField.checked&&e.add(t.text)})),i(e)}}}))),this.container.insertBefore(i,this.header.nextElementSibling)}}},2995:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(5432),n=i(5644),a=i(1168);class o extends a.Z{constructor(e){super("popup-forward",{closable:!0,overlayClosable:!0,body:!0,title:!0}),this.selector=new n.Z({appendTo:this.body,onChange:()=>{return t=this,i=void 0,n=function*(){const t=this.selector.getSelected(),i=t[t.length-1].toPeerId();if(e.onSelect){const t=e.onSelect(i);if(t instanceof Promise)try{yield t}catch(e){return}}this.selector=null,this.hide()},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n},peerType:e.peerTypes,onFirstRender:()=>{this.show(),this.selector.checkForTriggers(),s.Z||this.selector.input.focus()},chatRightsActions:e.chatRightsActions,multiSelect:!1,rippleEnabled:!1,avatarSize:"abitbigger",peerId:e.peerId,placeholder:e.placeholder,selfPresence:e.selfPresence,managers:this.managers}),this.scrollable=this.selector.scrollable,this.attachScrollableListeners(),this.title.append(this.selector.input)}}},1962:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(8127);class n extends s.Z{constructor(e,t,i){super("popup-delete-chat",{title:`Send Message${t.length>1?"s":""} Now`,description:t.length>1?"Send "+t.length+" messages now?":"Send message now?",buttons:[{langKey:"Send",callback:()=>{i&&i(),this.managers.appMessagesManager.sendScheduledMessages(e,t)}}]}),this.show()}}},9298:(e,t,i)=>{"use strict";i.d(t,{Z:()=>Z});var s=i(1168),n=i(3541),a=i(2153),o=i(279),r=i(5814),d=i(6219),l=i(4755),c=i(2325),h=i(4494),u=i(8497),p=i(1656),f=i(2738),m=i(2796),g=i(130),v=i(8115),b=i(3163),y=i(9259),w=i(7479),S=i(5565),C=i(3512),L=i(9083),E=i(3173),I=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const M="STICKERS-POPUP";class Z extends s.Z{constructor(e,t){super("popup-stickers",{closable:!0,overlayClosable:!0,body:!0,scrollable:!0,title:!0}),this.stickerSetInput=e,this.isEmojis=t,this.onStickersClick=e=>I(this,void 0,void 0,(function*(){const t=(0,u.Z)(e.target,"sticker-set-sticker");if(!t)return;const i=t.dataset.docId;(yield d.ZP.chat.input.sendMessageWithDocument(i))&&this.hide()})),this.title.append((0,c.ag)("Loading")),this.updateAdded={},E.ZP.setIgnoreMouseOut("popup",!0),this.addEventListener("close",(()=>{E.ZP.setIgnoreMouseOut("popup",!1),r.Z.setOnlyOnePlayableGroup()})),this.appendTo=this.scrollable.container,this.appendTo.classList.add("is-loading"),(0,o.y)(this.appendTo,!0),this.stickersFooter=document.createElement("div"),this.stickersFooter.classList.add("sticker-set-footer");const i=(0,h.Z)("btn-primary btn-primary-transparent disable-hover",{noRipple:!0,text:"Loading"});this.stickersFooter.append(i),this.body.append(this.stickersFooter),(0,y.Z)({listenTo:this.appendTo,listenerSetter:this.listenerSetter});const s=e=>{const t=this.sets.findIndex((t=>t.id===e.id));if(-1===t)return;this.sets[t]=e;const i=this.updateAdded[e.id];null==i||i(!!e.installed_date),this.updateButton()};this.listenerSetter.add(C.Z)("stickers_installed",s),this.listenerSetter.add(C.Z)("stickers_deleted",s),this.loadStickerSet()}createStickerSetElements(e){const t=document.createElement("div");let i,s;t.classList.add("sticker-set"),e&&(i=new w.ZP({title:(0,v.Z)(e.title),subtitle:(0,c.ag)(e.pFlags.emojis?"EmojiCount":"Stickers",[e.count]),buttonRight:!0}),s=e=>{(0,S.Z)(i.buttonRight,(0,c.ag)(e?"Stickers.SearchAdded":"Stickers.SearchAdd")),i.buttonRight.classList.toggle("active",e)},s(!!e.installed_date),t.append(i.container));const n=document.createElement("div");return n.classList.add("sticker-set-stickers"),t.append(n),{container:t,headerRow:i,updateAdded:s,itemsContainer:n}}loadStickerSet(){var e;return I(this,void 0,void 0,(function*(){const t=this.middlewareHelper.get(),i=(Array.isArray(this.stickerSetInput)?this.stickerSetInput:[this.stickerSetInput]).map((e=>this.managers.appStickersManager.getStickerSet(e)));let s=yield Promise.all(i);if(!t())return;let o=s[0];if(1===s.length&&!o)return(0,m.bC)({langPackKey:this.isEmojis?"AddEmojiNotFound":"StickerSet.DontExist"}),void this.hide();s=s.filter(Boolean),o=s[0],this.sets=s.map((e=>e.set));const d=null!==(e=this.isEmojis)&&void 0!==e?e:this.isEmojis=!!o.set.pFlags.emojis;if(!d){(0,f.fc)(this.appendTo,this.onStickersClick,{listenerSetter:this.listenerSetter});const{destroy:e}=(0,b.Z)({listenTo:this.appendTo,isStickerPack:!0,onSend:()=>this.hide()});this.addEventListener("close",e)}r.Z.setOnlyOnePlayableGroup(M);const u=new a.Z,y=[],w=s.map((e=>I(this,void 0,void 0,(function*(){const{container:i,itemsContainer:a,headerRow:o,updateAdded:r}=this.createStickerSetElements(s.length>1?e.set:void 0);let c;o&&(0,f.fc)(o.buttonRight,(()=>{this.managers.appStickersManager.toggleStickerSet(e.set)}),{listenerSetter:this.listenerSetter}),this.updateAdded[e.set.id]=r;const h=e.documents.filter((e=>"document"===(null==e?void 0:e._)));if(d){const e=(0,L.Z)({docIds:h.map((e=>e.id)),loadPromises:y,animationGroup:M,customEmojiSize:l.Z.active.esgCustomEmoji,middleware:t});Array.from(e.children).slice(1).forEach((e=>{const t=document.createElement("span");t.classList.add("super-emoji"),e.replaceWith(t),t.append(e)})),c=[e],a.classList.replace("sticker-set-stickers","super-emojis"),a.classList.add("is-emojis","not-local")}else c=yield Promise.all(h.map((e=>I(this,void 0,void 0,(function*(){const i=document.createElement("div");i.classList.add("sticker-set-sticker");const s=l.Z.active.popupSticker.width;return yield(0,n.ZP)({doc:e,div:i,lazyLoadQueue:u,group:M,play:!0,loop:!0,width:s,height:s,withLock:!0,loadPromises:y,middleware:t}),i})))));return a.append(...c.filter(Boolean)),i})))),S=yield Promise.all(w);yield Promise.all(y);const C=this.button=(0,h.Z)("",{noRipple:!0});this.updateButton(),(0,f.fc)(C,(()=>{const e=(0,p.Z)([C],!0);this.managers.appStickersManager.toggleStickerSets(s.map((e=>e.set))).then((()=>{this.hide()})).catch((()=>{e()}))}),{listenerSetter:this.listenerSetter}),1===s.length?(0,g.Z)(this.title,(0,v.Z)(o.set.title)):(0,g.Z)(this.title,(0,c.ag)("Emoji")),this.stickersFooter.textContent="",this.stickersFooter.append(C),this.appendTo.classList.remove("is-loading"),this.appendTo.textContent="",this.appendTo.append(...S),this.scrollable.onAdditionalScroll()}))}updateButton(){const{sets:e,isEmojis:t}=this;let i,s;if(1===e.length){const n=e[0];s=(0,c.ag)(t?"EmojiCount":"Stickers",[n.count]),i=!n.installed_date}else{const t=e.filter((e=>e.installed_date));let n;e.length===t.length?(i=!1,n=e.length):(i=!0,n=e.length-t.length),s=(0,c.ag)("EmojiPackCount",[n])}this.button.className=i?"btn-primary btn-color-primary":"btn-primary btn-primary-transparent danger",(0,S.Z)(this.button,(0,c.ag)(i?"AddStickersCount":"RemoveStickersCount",[s]))}}},684:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(1168),n=i(8127),a=i(3512),o=i(7362);class r{constructor(e,t,i,s){this.peerId=e,this.mid=t,this.unpin=i,this.onConfirm=s,this.construct()}construct(){return e=this,t=void 0,r=function*(){const{peerId:e,mid:t,unpin:i,onConfirm:r}=this;let d,l,c;const h=[],u=[],p=s.Z.MANAGERS,f=yield p.appPeersManager.canPinMessage(e),m=(s,n,a)=>{setTimeout((()=>{let s;s=i&&!t?f?p.appMessagesManager.unpinAllMessages(e):p.appMessagesManager.hidePinnedMessages(e):p.appMessagesManager.updatePinnedMessage(e,t,i,a,n),r&&s.then(r)}),300)};if(i){let i="UnpinMessage";t?(d="UnpinMessageAlertTitle",l="Chat.Confirm.Unpin"):f?(d="Popup.Unpin.AllTitle",l="Chat.UnpinAllMessagesConfirmation",c=[""+((yield p.appMessagesManager.getPinnedMessagesCount(e))||1)]):(d="Popup.Unpin.HideTitle",l="Popup.Unpin.HideDescription",i="Popup.Unpin.Hide"),h.push({langKey:i,isDanger:!0,callback:m})}else{d="PinMessageAlertTitle";const t="PinMessage";e.isAnyChat()?(h.push({langKey:t,callback:e=>m(0,!1,!e.size)}),(yield p.appChatsManager.isBroadcast(e.toChatId()))?l="PinMessageAlertChannel":(l="PinMessageAlert",u.push({text:"PinNotify",checked:!0}))):(l="PinMessageAlertChat",e===a.Z.myId?h.push({langKey:t,callback:m}):(h.push({langKey:t,callback:e=>m(0,!e.size)}),u.push({text:"PinAlsoFor",textArgs:[yield(0,o.Z)({peerId:e})],checked:!0})))}(0,s.x)(h),new n.Z("popup-delete-chat",{peerId:e,titleLangKey:d,descriptionLangKey:l,descriptionLangArgs:c,buttons:h,checkboxes:u}).show()},new((i=void 0)||(i=Promise))((function(s,n){function a(e){try{d(r.next(e))}catch(e){n(e)}}function o(e){try{d(r.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}d((r=r.apply(e,t||[])).next())}));var e,t,i,r}}},3442:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var s=i(9099),n=i(3035),a=i(3910),o=i(2738),r=i(8487),d=i(5953);class l{constructor(e){this.tempId=0,this.detached=!0,this.promise=null,this.isUpload=!1,this.cancelable=!0,this.streamable=!1,this.tryAgainOnFail=!0,this.attachMethod="append",this.onClick=e=>{var t,i,s;e&&(0,a.Z)(e),this.preloader.classList.contains("manual")?null===(t=this.loadFunc)||void 0===t||t.call(this,e):null===(s=null===(i=this.promise)||void 0===i?void 0:i.cancel)||void 0===s||s.call(i)},e&&(0,d.Z)(this,e),this.isUpload&&(this.tryAgainOnFail=!1)}constructContainer(e={}){this.preloader||(this.preloader=document.createElement("div"),this.preloader.classList.add("preloader-container"),e.color&&this.preloader.classList.add("preloader-"+e.color),e.bold&&this.preloader.classList.add("preloader-bold"),this.streamable&&this.preloader.classList.add("preloader-streamable"))}constructDownloadIcon(){this.constructContainer()}construct(){this.construct=null,this.constructContainer(),this.preloader.innerHTML=`\n
\n \n \n \n
`,this.streamable?this.totalLength=118.61124420166016:this.totalLength=149.82473754882812,this.cancelable?(this.preloader.innerHTML+='\n \n \n \n \n \n \n \n \n \n \n \n ',this.downloadSvg=this.preloader.lastElementChild,this.cancelSvg=this.downloadSvg.previousElementSibling):this.preloader.classList.add("preloader-swing"),this.circle=this.preloader.firstElementChild.firstElementChild.firstElementChild,this.cancelable&&(0,o.fc)(this.preloader,this.onClick)}setDownloadFunction(e){this.loadFunc=e}setManual(){this.preloader.classList.add("manual"),this.setProgress(0)}attachPromise(e){if(this.isUpload&&this.promise)return;this.promise=e;const t=--this.tempId,i=Date.now(),s=s=>{if(e.notify=e.notifyAll=null,t!==this.tempId)return;const a=Date.now()-i;if(!s&&this.cancelable){this.setProgress(100);const e=150;a{t===this.tempId&&this.detach()}),e)}else this.tryAgainOnFail?(this.attach(this.preloader.parentElement),(0,n.T2)((()=>{this.setManual()}))):this.detach();this.promise=e=null};e.then((()=>s(null))).catch((e=>s(e))),e.addNotifyListener&&e.addNotifyListener((e=>{if(t!==this.tempId)return;const i=e.done/e.total*100;this.setProgress(i)}))}attach(e,t=!1,i){var n;null===(n=this.construct)||void 0===n||n.call(this),this.preloader.parentElement&&this.preloader.classList.remove("manual"),this.detached=!1,i&&this.attachPromise(i);let a=0;(this.detached||this.preloader.parentElement!==e)&&(a=(0,r.Z)(this.preloader)?1:2,this.preloader.parentElement!==e&&e[this.attachMethod](this.preloader)),(0,s.Z)({element:this.preloader,className:"is-visible",forwards:!0,duration:200,useRafs:a}),this.cancelable&&t&&this.setProgress(0)}detach(){var e;this.detached||(this.detached=!0,(null===(e=this.preloader)||void 0===e?void 0:e.parentElement)&&(0,s.Z)({element:this.preloader,className:"is-visible",forwards:!1,duration:200,onTransitionEnd:()=>{this.preloader.remove()},useRafs:1}))}setProgress(e){if(this.totalLength||(0,r.Z)(this.circle))if(0!==e)try{this.totalLength||(this.totalLength=this.circle.getTotalLength()),this.circle.style.strokeDasharray=Math.max(5,e/100*this.totalLength)+", "+this.totalLength}catch(e){}else this.circle.style.strokeDasharray=""}}},2635:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(1470),n=i(3228);class a{constructor(e,t,i,n,o=t){this.sizes=e,this.maxWidth=t,this.minWidth=i,this.spacing=n,this.maxHeight=o,this.count=e.length,this.ratios=a.countRatios(e),this.proportions=a.countProportions(this.ratios),this.averageRatio=(0,s.Z)(this.ratios,1)/this.count,this.maxSizeRatio=t/this.maxHeight}layout(){return this.count?this.count>=5||this.ratios.find((e=>e>2))?new o(this.ratios,this.averageRatio,this.maxWidth,this.minWidth,this.spacing).layout():2===this.count?this.layoutTwo():3===this.count?this.layoutThree():this.layoutFour():[]}layoutTwo(){return"ww"===this.proportions&&this.averageRatio>1.4*this.maxSizeRatio&&this.ratios[1]-this.ratios[0]<.2?this.layoutTwoTopBottom():"ww"===this.proportions||"qq"===this.proportions?this.layoutTwoLeftRightEqual():this.layoutTwoLeftRight()}layoutThree(){return"n"===this.proportions[0]?this.layoutThreeLeftAndOther():this.layoutThreeTopAndOther()}layoutFour(){return"w"===this.proportions[0]?this.layoutFourTopAndOther():this.layoutFourLeftAndOther()}layoutTwoTopBottom(){const e=this.maxWidth,t=Math.round(Math.min(e/this.ratios[0],Math.min(e/this.ratios[1],(this.maxHeight-this.spacing)/2)));return[{geometry:{x:0,y:0,width:e,height:t},sides:11},{geometry:{x:0,y:t+this.spacing,width:e,height:t},sides:14}]}layoutTwoLeftRightEqual(){const e=(this.maxWidth-this.spacing)/2,t=Math.round(Math.min(e/this.ratios[0],Math.min(e/this.ratios[1],1*this.maxHeight)));return[{geometry:{x:0,y:0,width:e,height:t},sides:13},{geometry:{x:e+this.spacing,y:0,width:e,height:t},sides:7}]}layoutTwoLeftRight(){const e=Math.round(1.5*this.minWidth),t=Math.min(Math.round(Math.max(.4*(this.maxWidth-this.spacing),(this.maxWidth-this.spacing)/this.ratios[0]/(1/this.ratios[0]+1/this.ratios[1]))),this.maxWidth-this.spacing-e),i=this.maxWidth-t-this.spacing,s=Math.min(this.maxHeight,Math.round(Math.min(i/this.ratios[0],t/this.ratios[1])));return[{geometry:{x:0,y:0,width:i,height:s},sides:13},{geometry:{x:i+this.spacing,y:0,width:t,height:s},sides:7}]}layoutThreeLeftAndOther(){const e=this.maxHeight,t=Math.round(Math.min((this.maxHeight-this.spacing)/2,this.ratios[1]*(this.maxWidth-this.spacing)/(this.ratios[2]+this.ratios[1]))),i=e-t-this.spacing,s=Math.max(this.minWidth,Math.round(Math.min((this.maxWidth-this.spacing)/2,Math.min(t*this.ratios[2],i*this.ratios[1])))),n=Math.min(Math.round(e*this.ratios[0]),this.maxWidth-this.spacing-s);return[{geometry:{x:0,y:0,width:n,height:e},sides:13},{geometry:{x:n+this.spacing,y:0,width:s,height:i},sides:3},{geometry:{x:n+this.spacing,y:i+this.spacing,width:s,height:t},sides:6}]}layoutThreeTopAndOther(){const e=this.maxWidth,t=Math.round(Math.min(e/this.ratios[0],.66*(this.maxHeight-this.spacing))),i=(this.maxWidth-this.spacing)/2,s=Math.min(this.maxHeight-t-this.spacing,Math.round(Math.min(i/this.ratios[1],i/this.ratios[2]))),n=e-i-this.spacing;return[{geometry:{x:0,y:0,width:e,height:t},sides:11},{geometry:{x:0,y:t+this.spacing,width:i,height:s},sides:12},{geometry:{x:i+this.spacing,y:t+this.spacing,width:n,height:s},sides:6}]}layoutFourTopAndOther(){const e=this.maxWidth,t=Math.round(Math.min(e/this.ratios[0],.66*(this.maxHeight-this.spacing))),i=Math.round((this.maxWidth-2*this.spacing)/(this.ratios[1]+this.ratios[2]+this.ratios[3])),s=Math.max(this.minWidth,Math.round(Math.min(.4*(this.maxWidth-2*this.spacing),i*this.ratios[1]))),n=Math.round(Math.max(Math.max(1*this.minWidth,.33*(this.maxWidth-2*this.spacing)),i*this.ratios[3])),a=e-s-n-2*this.spacing,o=Math.min(this.maxHeight-t-this.spacing,i);return[{geometry:{x:0,y:0,width:e,height:t},sides:11},{geometry:{x:0,y:t+this.spacing,width:s,height:o},sides:12},{geometry:{x:s+this.spacing,y:t+this.spacing,width:a,height:o},sides:4},{geometry:{x:s+this.spacing+a+this.spacing,y:t+this.spacing,width:n,height:o},sides:6}]}layoutFourLeftAndOther(){const e=this.maxHeight,t=Math.round(Math.min(e*this.ratios[0],.6*(this.maxWidth-this.spacing))),i=Math.round((this.maxHeight-2*this.spacing)/(1/this.ratios[1]+1/this.ratios[2]+1/this.ratios[3])),s=Math.round(i/this.ratios[1]),n=Math.round(i/this.ratios[2]),a=e-s-n-2*this.spacing,o=Math.max(this.minWidth,Math.min(this.maxWidth-t-this.spacing,i));return[{geometry:{x:0,y:0,width:t,height:e},sides:13},{geometry:{x:t+this.spacing,y:0,width:o,height:s},sides:3},{geometry:{x:t+this.spacing,y:s+this.spacing,width:o,height:n},sides:2},{geometry:{x:t+this.spacing,y:s+n+2*this.spacing,width:o,height:a},sides:6}]}static countRatios(e){return e.map((e=>e.w/e.h))}static countProportions(e){return e.map((e=>e>1.2?"w":e<.8?"n":"q")).join("")}}class o{constructor(e,t,i,s,n,a=4*i/3){this.averageRatio=t,this.maxWidth=i,this.minWidth=s,this.spacing=n,this.maxHeight=a,this.ratios=o.cropRatios(e,t),this.count=e.length}static cropRatios(e,t){return e.map((e=>t>1.1?(0,n.Z)(e,1,2.75):(0,n.Z)(e,.6667,1)))}layout(){const e=new Array(this.count),t=[],i=(e,t)=>{const i=this.ratios.slice(e,e+t),n=(0,s.Z)(i,0);return(this.maxWidth-(t-1)*this.spacing)/n},n=e=>{const s=[];let n=0;for(const t of e)s.push(i(n,t)),n+=t;t.push({lineCounts:e,heights:s})};for(let e=1;e!==this.count;++e){const t=this.count-e;e>3||t>3||n([e,t])}for(let e=1;e!==this.count-1;++e)for(let t=1;t!==this.count-e;++t){const i=this.count-e-t;e>3||t>(this.averageRatio<.85?4:3)||i>3||n([e,t,i])}for(let e=1;e!==this.count-1;++e)for(let t=1;t!==this.count-e;++t)for(let i=1;i!==this.count-e-t;++i){const s=this.count-e-t-i;e>3||t>3||i>3||s>3||n([e,t,i,s])}let a=null,o=0;for(const e of t){const{heights:t,lineCounts:i}=e,n=i.length,r=(0,s.Z)(t,0)+this.spacing*(n-1),d=Math.min(...t),l=(Math.max(...t),d{for(let e=1;e!==n;++e)if(i[e-1]>i[e])return 1.5;return 1})(),h=Math.abs(r-this.maxHeight)*l*c;(!a||h2&e.sides)),s=i.geometry.width+i.geometry.x,n=t.find((e=>4&e.sides)),o=n.geometry.height+n.geometry.y,r=e.container;r.style.width=s+"px",r.style.height=o+"px";const d=r.children;t.forEach((({geometry:t,sides:i},n)=>{let a;if(a=d[n],a||(a=document.createElement("div"),r.append(a)),a.classList.add("album-item","grouped-item"),a.style.width=t.width/s*100+"%",a.style.height=t.height/o*100+"%",a.style.top=t.y/o*100+"%",a.style.left=t.x/s*100+"%",8&i&&1&i&&(a.style.borderTopLeftRadius="inherit"),8&i&&4&i&&(a.style.borderBottomLeftRadius="inherit"),2&i&&1&i&&(a.style.borderTopRightRadius="inherit"),2&i&&4&i&&(a.style.borderBottomRightRadius="inherit"),e.forMedia){const e=document.createElement("div");e.classList.add("album-item-media"),a.append(e)}}))}},9931:(e,t,i)=>{"use strict";i.d(t,{Z:()=>y,Y:()=>v});var s=i(4059),n=i(6740),a=i(5565),o=i(130),r=i(9674),d=i(5990),l=i(7256),c=i(1507),h=i(5798),u=i(3512),p=i(9345),f=i(319),m=i(5994),g=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function v(e,t,i,o,d=new Image,l=!1){return g(this,void 0,void 0,(function*(){const l=yield u.Z.managers.acknowledged.appAvatarsManager.loadAvatar(t,i,o),c=l.result,h=l.cached;let p,g,b;if(d.classList.add("avatar-photo"),h)g=()=>{(0,a.Z)(e,d),e.dataset.color=""};else{const l=m.Z.isAvailable("animations");l&&d.classList.add("fade-in");let c=!1;if("photo_big"===o){const s=yield v(e,t,i,"photo_small");p=s.loadThumbPromise||s.loadPromise,b=s.thumbImage}else if(i.stripped_thumb){b=new Image,e.classList.add("avatar-relative"),b.classList.add("avatar-photo","avatar-photo-thumbnail");const t=(0,s.Z)(i.stripped_thumb);p=(0,n.cj)(b,t).then((()=>{c||(0,a.Z)(e,b)}))}g=()=>{c=!0,b?e.append(d):(0,a.Z)(e,d),setTimeout((()=>{e.childElementCount&&r.Z.mutateElement(d,(()=>{e.dataset.color="",l&&d.classList.remove("fade-in"),null==b||b.remove()}))}),l?200:0)}}const y=c.then((e=>(0,n.cj)(d,e))).then(g);return p&&(yield p.catch(f.Z)),{cached:h,loadPromise:y,loadThumbPromise:h?y:p||Promise.resolve(),thumbImage:b}}))}function b(e,t,i,s,n,a){(0,o.Z)(e,t),e.dataset.color=i,e.classList.remove("tgico-saved","tgico-deletedaccount","tgico-reply_filled","is-forum","is-topic"),s&&e.classList.add(s),n&&e.classList.add("is-forum"),a&&e.classList.add("is-topic")}function y({div:e,peerId:t,isDialog:i=!1,title:s="",onlyThumb:n=!1,isBig:a,threadId:o,wrapOptions:r={}}){var f,m;return g(this,void 0,void 0,(function*(){const g=u.Z.myId;if(t===g&&i)return void b(e,"","","tgico-saved");const y=u.Z.managers;if(o){const i=yield y.dialogsStorage.getForumTopic(t,o);return b(e,"","",void 0,void 0,!0),r.customEmojiSize&&e.style.setProperty("--size",r.customEmojiSize.width+"px"),(0,p.e)(Object.assign(Object.assign({},r),{topic:i,lazyLoadQueue:!1})).then((t=>{e.replaceChildren(t)}))}const w=yield y.appPeersManager.getPeer(t);if(t!==c.NM&&t.isUser()&&(null===(f=null==w?void 0:w.pFlags)||void 0===f?void 0:f.deleted))return void b(e,"",(0,d.Z)(t),"tgico-deletedaccount");const S=!!(null===(m=null==w?void 0:w.pFlags)||void 0===m?void 0:m.forum),C=a?"photo_big":"photo_small",L=(0,l.Z)(w),E=!!L,I=!!e.firstElementChild&&!e.firstElementChild.classList.contains("emoji");if(!E||!I||!(yield y.appAvatarsManager.isAvatarCached(t,C))){let n="";if(!t||t===g&&i||(n=(0,d.Z)(t)),t===c.hj)return void b(e,"",n,"tgico-reply_filled");const a=s?(0,h.Z)(s):function(e){var t;let i="";return e&&(i=null!==(t=e.title)&&void 0!==t?t:[e.first_name,e.last_name].filter(Boolean).join(" ")),(0,h.Z)(i)}(w);b(e,a,n,"",S)}return E?v(e,t,L,C,void 0,n):void 0}))}},279:(e,t,i)=>{"use strict";function s(e,t=!1){const i='\n \n \n ';if(t){const t=document.createElement("div");return t.classList.add("preloader"),t.innerHTML=i,e&&e.appendChild(t),t}return e.insertAdjacentHTML("beforeend",i),e.lastElementChild}function n(e,t="check"){return e.classList.remove("tgico-"+t),e.disabled=!0,s(e),()=>{e.innerHTML="",e.classList.add("tgico-"+t),e.removeAttribute("disabled")}}i.d(t,{p:()=>n,y:()=>s}),i(410).GO.putPreloader=s},1218:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(6669),n=i(9750),a=i(2325),o=i(3855),r=i(3512);class d{constructor(e){const t=this.label=document.createElement("label");t.classList.add("radio-field"),e.alignRight&&t.classList.add("radio-field-right");const i=this.input=document.createElement("input");i.type="radio",i.name="input-radio-"+e.name,e.value&&(i.value=e.value,e.stateKey&&(o.Z.getState().then((t=>{i.checked=(0,n.Z)(t,e.stateKey)===e.value})),i.addEventListener("change",(()=>{r.Z.managers.appStateManager.setByKey(e.stateKey,e.value)}))));const s=this.main=document.createElement("div");s.classList.add("radio-field-main"),e.text?s.innerHTML=e.text:e.langKey&&(0,a.$d)(s,e.langKey),t.append(i,s)}get checked(){return this.input.checked}set checked(e){this.setValueSilently(e),(0,s.Z)(this.input,"change")}setValueSilently(e){this.input.checked=e}}},5133:(e,t,i)=>{"use strict";function s(e,t){const i=document.createElement("form");return e.forEach((e=>{const{container:s,input:n}=e;i.append(s),n.addEventListener("change",(e=>{n.checked&&t(n.value,e)}))})),i}i.d(t,{Z:()=>s})},65:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(5077),n=i(3228),a=i(5953);class o{constructor(e,t=0){this.mousedown=!1,this.events={},this.withTransition=!1,this.useTransform=!1,this.vertical=!1,this.onMouseMove=e=>{this.scrub(e)},this.onMouseDown=e=>{var t;this.rect=this.container.getBoundingClientRect(),this.mousedown=!0,this.scrub(e),this.container.classList.add("is-focused"),(null===(t=this.events)||void 0===t?void 0:t.onMouseDown)&&this.events.onMouseDown(e)},this.onMouseUp=e=>{var t;this.mousedown=!1,this.container.classList.remove("is-focused"),(null===(t=this.events)||void 0===t?void 0:t.onMouseUp)&&this.events.onMouseUp(e)},this.onInput=()=>{var e;const t=+this.seek.value;this.setFilled(t),(null===(e=this.events)||void 0===e?void 0:e.onScrub)&&this.events.onScrub(t)},(0,a.Z)(this,e),this.container=document.createElement("div"),this.container.classList.add("progress-line"),this.useTransform?this.container.classList.add("use-transform"):this.withTransition&&this.container.classList.add("with-transition"),this.filled=document.createElement("div"),this.filled.classList.add("progress-line__filled");const i=this.seek=document.createElement("input");i.classList.add("progress-line__seek"),i.type="range",i.step=""+this.step,i.min=""+this.min,i.max=""+this.max,i.value=""+t,t&&this.setProgress(t);const s=""+this.step,n=s.indexOf(".");this.decimals=-1===n?0:s.length-n-1,this.container.append(this.filled,i)}get value(){return+this.seek.value}setHandlers(e){this.events=e}setListeners(){this.seek.addEventListener("input",this.onInput),this._removeListeners=(0,s.Z)(this.container,this.onMouseDown,this.onMouseMove,this.onMouseUp)}setProgress(e){this.seek.value=""+e,this.setFilled(+this.seek.value)}addProgress(e){this.seek.value=""+(+this.seek.value+e),this.setFilled(+this.seek.value)}setFilled(e){let t=(e-this.min)/(this.max-this.min);t=(0,n.Z)(t,0,1),this.useTransform?this.filled.style.transform=`scaleX(${t})`:this.filled.style.width=100*t+"%"}scrub(e){var t;const i=this.vertical?this.rect.height:this.rect.width,s=(0,n.Z)(this.vertical?-(e.y-this.rect.bottom):e.x-this.rect.left,0,i);let a=this.min+s/i*(this.max-this.min);return a-this.min<(this.max-this.min)/2&&(a-=this.step/10),a=+a.toFixed(this.decimals),a=(0,n.Z)(a,this.min,this.max),this.setProgress(a),(null===(t=this.events)||void 0===t?void 0:t.onScrub)&&this.events.onScrub(a),a}removeListeners(){this._removeListeners&&(this._removeListeners(),this._removeListeners=null),this.seek.removeEventListener("input",this.onInput),this.events={}}}},1405:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var s=i(8497),n=i(9674),a=i(5432),o=i(5975),r=i(3035),d=i(5994);let l=0;function c(e,t=(()=>Promise.resolve()),i=null,c=!1,h=e){if(e.querySelector(".c-ripple"))return;e.classList.add("rp");const u=document.createElement("div");let p;u.classList.add("c-ripple"),e.classList.contains("rp-square")&&u.classList.add("is-square"),e[c?"prepend":"append"](u);const f=(e,s)=>{const o=Date.now(),d=document.createElement("div"),c=l++,h=1e3*+window.getComputedStyle(u).getPropertyValue("--ripple-duration").replace("s",""),f=p=()=>{const e=Date.now()-o,t=()=>{n.Z.mutate((()=>{d.remove()})),null==i||i(c)};if(ed.classList.add("hiding")),Math.max(i-h/2,0)),setTimeout(t,i)}else d.classList.add("hiding"),setTimeout(t,h/2);a.Z||(window.removeEventListener("contextmenu",p),window.removeEventListener("mousemove",p)),p=null,g=!1};null==t||t(c),(0,r.T2)((()=>{if(f!==p)return;const t=u.getBoundingClientRect();d.classList.add("c-ripple__circle");const i=e-t.left,n=s-t.top,a=Math.sqrt(Math.pow(Math.abs(n-t.height/2)+t.height/2,2)+Math.pow(Math.abs(i-t.width/2)+t.width/2,2)),o=i-a/2,r=n-a/2;d.style.width=d.style.height=a+"px",d.style.left=o+"px",d.style.top=r+"px",u.append(d)}))},m=t=>t.target!==e&&(["BUTTON","A"].includes(t.target.tagName)||(0,s.Z)(t.target,"c-ripple")!==u)&&(h===e||!(0,o.Z)(t.target,h))&&!(0,s.Z)(t.target,"checkbox-field");let g=!1;if(a.Z){const e=()=>{null==p||p()};h.addEventListener("touchstart",(t=>{if(!d.Z.isAvailable("animations"))return;if(t.touches.length>1||g||m(t))return;g=!0;const{clientX:i,clientY:s}=t.touches[0];f(i,s),h.addEventListener("touchend",e,{once:!0}),window.addEventListener("touchmove",(t=>{t.cancelBubble=!0,t.stopPropagation(),e(),h.removeEventListener("touchend",e)}),{once:!0})}),{passive:!0})}else h.addEventListener("mousedown",(e=>{if(![0,2].includes(e.button))return;if(!d.Z.isAvailable("animations"))return;if("0"===h.dataset.ripple||m(e))return;if(g)return void(g=!1);const{clientX:t,clientY:i}=e;f(t,i),window.addEventListener("mouseup",p,{once:!0,passive:!0}),window.addEventListener("contextmenu",p,{once:!0,passive:!0})}),{passive:!0})}},7479:(e,t,i)=>{"use strict";i.d(t,{De:()=>g,ZC:()=>v,ZP:()=>f,tG:()=>m});var s=i(9807),n=i(1218),a=i(1405),o=i(5133),r=i(2325),d=i(5565),l=i(130),c=i(2738),h=i(4494),u=i(4531);const p=(e,t)=>{!0===t||("string"==typeof t?(0,l.Z)(e,t):e.append(t))};class f{constructor(e={}){this.freezed=!1,e.checkboxFieldOptions&&(e.checkboxField=new s.Z(Object.assign({listenerSetter:e.listenerSetter},e.checkboxFieldOptions)));const t=e.asLink?"a":e.radioField||e.checkboxField?"label":"div";if(this.container=document.createElement(t),this.container.classList.add("row","no-subtitle"),e.noWrap&&this.container.classList.add("no-wrap"),e.subtitle){const t=this.subtitle;if(p(t,e.subtitle),e.noWrap&&t.classList.add("no-wrap"),e.subtitleRight){this.container.append(this.subtitleRow=this.createRow()),this.subtitleRow.classList.add("row-subtitle-row");const i=this.subtitleRight=document.createElement("div");i.classList.add("row-subtitle","row-subtitle-right"),p(i,e.subtitleRight),this.subtitleRow.append(t,i)}}else e.subtitleLangKey&&this.subtitle.append((0,r.ag)(e.subtitleLangKey,e.subtitleLangArgs));let i=!!e.havePadding;if(e.radioField||e.checkboxField){if(e.radioField&&(this.radioField=e.radioField,this.container.append(this.radioField.label),i=!0),e.checkboxField){this.checkboxField=e.checkboxField;const t=e.checkboxField.label.classList.contains("checkbox-field-toggle");if(t?(this.container.classList.add("row-with-toggle"),e.titleRight=this.checkboxField.label):(i=!0,this.container.append(this.checkboxField.label)),e.withCheckboxSubtitle&&!t){const t=()=>{(0,d.Z)(this.subtitle,(0,r.ag)(this.checkboxField.input.checked?"Checkbox.Enabled":"Checkbox.Disabled"))};e.listenerSetter?e.listenerSetter.add(this.checkboxField.input)("change",t):this.checkboxField.input.addEventListener("change",t)}}(e.radioField||e.checkboxField).label.classList.add("disable-hover")}if(e.title||e.titleLangKey){let t;const i=e.titleRight||e.titleRightSecondary;if(i?(this.container.append(t=this.titleRow=this.createRow()),this.titleRow.classList.add("row-title-row")):t=this.container,this.title=this.createTitle(),e.noWrap&&this.title.classList.add("no-wrap"),e.title?p(this.title,e.title):e.titleLangKey&&this.title.append((0,r.ag)(e.titleLangKey)),t.append(this.title),i){const s=this.titleRight=document.createElement("div");s.classList.add("row-title","row-title-right"),e.titleRightSecondary&&s.classList.add("row-title-right-secondary"),p(s,i),t.append(s)}}e.icon&&(i=!0,this.container.classList.add("tgico","tgico-"+e.icon),this.container.classList.add("row-with-icon")),i&&this.container.classList.add("row-with-padding"),e.navigationTab&&(e.clickable=()=>e.navigationTab.open()),(e.clickable||e.radioField||e.checkboxField)&&("function"==typeof e.clickable&&(0,c.fc)(this.container,(t=>{this.freezed||e.clickable(t)}),{listenerSetter:e.listenerSetter}),this.container.classList.add("row-clickable","hover-effect"),e.noRipple||(0,a.Z)(this.container,void 0,void 0,!0)),(e.buttonRight||e.buttonRightLangKey)&&(this.buttonRight=e.buttonRight instanceof HTMLElement?e.buttonRight:(0,h.Z)("btn-primary btn-color-primary",{text:e.buttonRightLangKey}),this.container.append(this.buttonRight)),e.contextMenu&&(0,u.Z)(Object.assign(Object.assign({},e.contextMenu),{listenTo:this.container,listenerSetter:e.listenerSetter}))}get subtitle(){var e;return null!==(e=this._subtitle)&&void 0!==e?e:this._subtitle=this.createSubtitle()}get midtitle(){var e;return null!==(e=this._midtitle)&&void 0!==e?e:this._midtitle=this.createMidtitle()}createRow(){const e=document.createElement("div");return e.classList.add("row-row"),e}createTitle(){const e=document.createElement("div");return e.classList.add("row-title"),(0,l.m)(e),e}createSubtitle(){const e=document.createElement("div");return e.classList.add("row-subtitle"),(0,l.m)(e),this.title?this.title.after(e):this.container.prepend(e),this.container.classList.remove("no-subtitle"),e}createMidtitle(){const e=document.createElement("div");return e.classList.add("row-midtitle"),this.subtitle.parentElement.insertBefore(e,this.subtitle),e}createMedia(e){const t=document.createElement("div");return this.applyMediaElement(t,e)}applyMediaElement(e,t){return this.container.classList.add("row-with-padding"),this.media=e,e.classList.add("row-media"),t&&e.classList.add("row-media-"+t),this.container.append(e),e}isDisabled(){return this.container.classList.contains("is-disabled")}toggleDisability(e=!this.container.classList.contains("is-disabled")){return this.container.classList.toggle("is-disabled",e),()=>this.toggleDisability(!e)}disableWithPromise(e){const t=this.toggleDisability(!0);e.finally((()=>{t()}))}makeSortable(){const e=document.createElement("span");this.container.classList.add("row-sortable","tgico"),e.classList.add("row-sortable-icon","tgico-menu"),this.container.append(e)}toggleSorting(e){this.container.classList.toggle("cant-sort",!e)}}const m=e=>new f({checkboxField:e,listenerSetter:e.listenerSetter}),g=(e,t)=>(0,o.Z)(e.map((e=>({container:e.container,input:e.radioField.input}))),t),v=(e,t)=>{const i="name-"+(8388607*Math.random()|0);let s;const a=e.map((({langPackKey:e,value:t,checked:a})=>{const o=new f({radioField:new n.Z({langKey:e,name:i,value:""+t})});return a&&(s=o.radioField),o})),o=g(a,t);return s&&(s.checked=!0),o}},8805:(e,t,i)=>{"use strict";i.d(t,{ZP:()=>l,v7:()=>c});var s=i(5432),n=i(5003),a=i(4789),o=i(8594),r=i(3910);class d{constructor(e,t="",i=document.createElement("div")){this.el=e,this.container=i,this.onScrollMeasure=0,this.lastScrollPosition=0,this.lastScrollDirection=0,this.isHeavyAnimationInProgress=!1,this.needCheckAfterAnimation=!1,this.onScroll=()=>{if(this.isHeavyAnimationInProgress)return this.cancelMeasure(),void(this.needCheckAfterAnimation=!0);(this.onScrolledTop||this.onScrolledBottom||this.splitUp||this.onAdditionalScroll)&&(this.onScrollMeasure||(this.onScrollMeasure=window.setTimeout((()=>{this.onScrollMeasure=0;const e=this.container[this.scrollProperty];this.lastScrollDirection=this.lastScrollPosition===e?0:this.lastScrollPositionthis.container.append(e))),e.append(this.container))}addScrollListener(){this.addedScrollListener||(this.addedScrollListener=!0,this.container.addEventListener("scroll",this.onScroll,{passive:!0,capture:!0}))}removeScrollListener(){this.addedScrollListener&&(this.addedScrollListener=!1,this.container.removeEventListener("scroll",this.onScroll,{capture:!0}))}setListeners(){this.removeHeavyAnimationListener||(window.addEventListener("resize",this.onScroll,{passive:!0}),this.addScrollListener(),this.removeHeavyAnimationListener=(0,o.ZP)((()=>{this.isHeavyAnimationInProgress=!0,this.onScrollMeasure&&(this.cancelMeasure(),this.needCheckAfterAnimation=!0)}),(()=>{this.isHeavyAnimationInProgress=!1,this.needCheckAfterAnimation&&(this.onScroll(),this.needCheckAfterAnimation=!1)})))}removeListeners(){this.removeHeavyAnimationListener&&(window.removeEventListener("resize",this.onScroll),this.removeScrollListener(),this.removeHeavyAnimationListener(),this.removeHeavyAnimationListener=void 0)}destroy(){this.removeListeners(),this.onAdditionalScroll=void 0,this.onScrolledTop=void 0,this.onScrolledBottom=void 0}append(...e){this.container.append(...e)}scrollIntoViewNew(e){return(0,a.Z)(Object.assign(Object.assign({},e),{container:this.container}))}cancelMeasure(){this.onScrollMeasure&&(clearTimeout(this.onScrollMeasure),this.onScrollMeasure=0)}}class l extends d{constructor(e,t="",i=300,s){super(e,t),this.onScrollOffset=i,this.loadedAll={top:!0,bottom:!1},this.checkForTriggers=()=>{if(!this.onScrolledTop&&!this.onScrolledBottom)return;if(this.isHeavyAnimationInProgress)return void this.onScroll();const e=this.container.scrollHeight;if(!e)return;const t=e-this.container.clientHeight,i=this.lastScrollPosition;this.onScrolledTop&&i<=this.onScrollOffset&&this.lastScrollDirection<=0&&this.onScrolledTop(),this.onScrolledBottom&&t-i<=this.onScrollOffset&&this.lastScrollDirection>=0&&this.onScrolledBottom()},this.container.classList.add("scrollable-y"),this.setListeners(),this.scrollProperty="scrollTop"}attachBorderListeners(e=this.container){const t=this.onAdditionalScroll;this.onAdditionalScroll=()=>{null==t||t(),e.classList.toggle("scrolled-top",!this.scrollTop),e.classList.toggle("scrolled-bottom",this.isScrolledDown)},e.classList.add("scrolled-top","scrolled-bottom","scrollable-y-bordered")}setVirtualContainer(e){this.splitUp=e,this.log("setVirtualContainer:",e,this)}prepend(...e){(this.splitUp||this.padding||this.container).prepend(...e)}append(...e){(this.splitUp||this.padding||this.container).append(...e)}getDistanceToEnd(){return this.scrollHeight-Math.round(this.scrollTop+this.container.offsetHeight)}get isScrolledDown(){return this.getDistanceToEnd()<=1}set scrollTop(e){this.container.scrollTop=e}get scrollTop(){return this.container.scrollTop}setScrollTopSilently(e){this.lastScrollPosition=e,this.ignoreNextScrollEvent(),this.scrollTop=e}ignoreNextScrollEvent(){this.removeHeavyAnimationListener&&(this.removeScrollListener(),this.container.addEventListener("scroll",(e=>{(0,r.Z)(e),this.addScrollListener()}),{capture:!0,passive:!1,once:!0}))}get scrollHeight(){return this.container.scrollHeight}}class c extends d{constructor(e,t="",i=300,n=15,a=document.createElement("div")){if(super(e,t,a),this.onScrollOffset=i,this.splitCount=n,this.container=a,this.container.classList.add("scrollable-x"),!s.Z){const e=e=>{!e.deltaX&&this.container.scrollWidth>this.container.clientWidth&&(this.container.scrollLeft+=e.deltaY/4,(0,r.Z)(e))};this.container.addEventListener("wheel",e,{passive:!1})}this.scrollProperty="scrollLeft"}}},5029:(e,t,i)=>{"use strict";i.d(t,{R:()=>r,Z:()=>o});var s=i(2325),n=i(36);const a="sidebar-left-section";class o{constructor(e={}){var t;const i=this.container=document.createElement("div");i.classList.add(a+"-container");const o=this.innerContainer=document.createElement("div");if(o.classList.add(a),e.noShadow&&o.classList.add("no-shadow"),e.fakeGradientDelimiter)o.append((0,n.G)()),o.classList.add("with-fake-delimiter");else if(e.noDelimiter)o.classList.add("no-delimiter");else{const e=document.createElement("hr");o.append(e)}const r=this.content=this.generateContentElement();if(e.name){const t=this.title=document.createElement("div");t.classList.add("sidebar-left-h2",a+"-name"),(0,s.XZ)({element:t,key:e.name,args:e.nameArgs}),r.append(t)}i.append(o);const d=null!==(t=e.caption)&&void 0!==t?t:e.captionOld;if(d){const t=this.caption=this.generateContentElement();t.classList.add(a+"-caption"),e.captionOld||i.append(t),!0!==d&&(0,s.XZ)({element:t,key:d,args:e.captionArgs})}}generateContentElement(){const e=document.createElement("div");return e.classList.add(a+"-content"),this.innerContainer.append(e),e}}const r=(e,t,i)=>{const s=new o({name:t,caption:i});return e.append(s.container),s.content}},7856:(e,t,i)=>{"use strict";i.d(t,{ir:()=>Qt,ZP:()=>ei});var s=i(6219),n=i(3512),a=i(5884),o=i(9331),r=i(8805),d=i(3607),l=i(3552),c=i(426),h=i(5005),u=i(503),p=i(187),f=i(2325),m=i(8119),g=i(3061),v=i(2738),b=i(5029);class y extends l._{constructor(){super(...arguments),this.uploadAvatar=null,this.isGeoChat=!1}init(e,t=!1){this.isGeoChat=t,this.peerIds=e,this.container.classList.add("new-group-container"),this.setTitle("NewGroup"),this.avatarEdit=new p.Z((e=>{this.uploadAvatar=e}));const i=new b.Z({}),n=document.createElement("div");n.classList.add("input-wrapper"),this.groupNameInputField=new u.ZP({label:"CreateGroup.NameHolder",maxLength:128}),this.groupLocationInputField=new u.ZP({label:"ChatLocation",name:"location",canBeEdited:!1}),n.append(this.groupNameInputField.container,this.groupLocationInputField.container),this.listenerSetter.add(this.groupNameInputField.input)("input",(()=>{let e=!!this.groupNameInputField.value.length&&!this.groupNameInputField.input.classList.contains("error");this.isGeoChat&&(e=e&&!!this.userLocationCoords&&!!this.userLocationAddress),this.nextBtn.classList.toggle("is-visible",!!e)})),this.nextBtn=(0,m.Z)({icon:"arrow_next"}),(0,v.fc)(this.nextBtn,(()=>{const e=this.groupNameInputField.value;let t;if(this.isGeoChat){if(!this.userLocationAddress||!this.userLocationCoords)return;t=this.managers.appChatsManager.createChannel({title:e,about:"",geo_point:Object.assign({_:"inputGeoPoint"},this.userLocationCoords),address:this.userLocationAddress,megagroup:!0}).then((e=>(this.uploadAvatar&&this.uploadAvatar().then((t=>{this.managers.appChatsManager.editPhoto(e,t)})),this.peerIds.length&&this.managers.appChatsManager.inviteToChannel(e,this.peerIds),e)))}else this.nextBtn.disabled=!0,t=this.managers.appChatsManager.createChat(e,this.peerIds.map((e=>e.toUserId()))).then((e=>(this.uploadAvatar&&this.uploadAvatar().then((t=>{this.managers.appChatsManager.editPhoto(e,t)})),e)));t&&t.then((e=>{this.close(),s.ZP.setInnerPeer({peerId:e.toPeerId(!0)})}))}),{listenerSetter:this.listenerSetter});const a=new b.Z({name:"Members",nameArgs:[this.peerIds.length]});this.peerIds.length||a.container.classList.add("hide");const o=this.list=h.default.createChatList({new:!0});a.content.append(o),i.content.append(this.avatarEdit.container,n),this.content.append(this.nextBtn),this.scrollable.append(i.container,a.container),t?(this.setTitle("NearbyCreateGroup"),this.groupLocationInputField.container.classList.remove("hide"),this.groupLocationInputField.setValueSilently(f.ZP.format("Loading",!0)),this.startLocating()):this.groupLocationInputField.container.classList.add("hide");const r=Promise.all(this.peerIds.map((e=>this.managers.appUsersManager.getUser(e.toUserId())))),d=this.managers.appUsersManager.getSelf(),l=r.then((e=>e.map((e=>{const{dom:t}=h.default.addDialogNew({peerId:e.id.toPeerId(!1),container:this.list,rippleEnabled:!1,avatarSize:"abitbigger"});t.lastMessageSpan.append((0,g.Z)(e))})))),c=this.peerIds.length>0&&this.peerIds.length<5?Promise.all([r,d]).then((([e,t])=>{const i=e.map((e=>[e.first_name,e.last_name].filter(Boolean).join(" ")));i.unshift(t.first_name);const s=(0,f.A1)(i,(e=>e?", ":" & ")).join("");this.groupNameInputField.setDraftValue(s)})):Promise.resolve();return Promise.all([l,c])}onCloseAfterTimeout(){this.avatarEdit.clear(),this.uploadAvatar=null,this.groupNameInputField.value="",this.groupLocationInputField.container.classList.add("hide"),this.nextBtn.disabled=!1}startLocating(){navigator.geolocation.getCurrentPosition((e=>{this.userLocationCoords={lat:e.coords.latitude,long:e.coords.longitude};let t="https://nominatim.openstreetmap.org/reverse";t+="?lat="+e.coords.latitude,t+="&lon="+e.coords.longitude,t+="&format=json",t+="&addressdetails=1",t+="&accept-language=en",fetch(t).then((e=>e.json())).then((e=>{this.userLocationAddress=e.display_name,this.groupLocationInputField.setValueSilently(e.display_name)}))}),(e=>{e instanceof GeolocationPositionError?this.groupLocationInputField.setValueSilently("Location permission denied. Please retry later."):this.groupLocationInputField.setValueSilently("An error has occurred. Please retry later.")}))}}var w,S=i(6360),C=i(632),L=i(410),E=i(5322),I=i(4494),M=i(6024),Z=i(7479),P=i(5565),T=i(144);function k(e){const t=[],i={users:[],chats:[]},s={users:[],chats:[]};return e.forEach((e=>{switch(e._){case"privacyValueAllowAll":t.push(2);break;case"privacyValueDisallowAll":t.push(0);break;case"privacyValueAllowContacts":t.push(1);break;case"privacyValueAllowChatParticipants":i.chats.push(...e.chats);break;case"privacyValueAllowUsers":i.users.push(...e.users);break;case"privacyValueDisallowChatParticipants":s.chats.push(...e.chats);break;case"privacyValueDisallowUsers":s.users.push(...e.users)}})),{type:t[0],disallowPeers:s,allowPeers:i}}!function(e){e[e.Everybody=2]="Everybody",e[e.Contacts=1]="Contacts",e[e.Nobody=0]="Nobody"}(w||(w={}));const x=w;var A=i(1218),_=i(5670);class F{constructor(e){this.options=e,this.onRadioChange=e=>{e=+e,this.type=e;const t=this.options.captions[this.type],i=this.radioSection.caption;t?t instanceof HTMLElement?(0,P.Z)(i,t):(0,f.$d)(i,t):i.innerHTML="",i.classList.toggle("hide",!t),this.exceptions&&(this.exceptions.get("allow").row.container.classList.toggle("hide",this.type===x.Everybody),this.exceptions.get("disallow").row.container.classList.toggle("hide",this.type===x.Nobody)),this.options.onRadioChange&&this.options.onRadioChange(e)},e.captions&&e.captions.reverse();const t=e.managers;this.radioSection=new b.Z({name:e.title,caption:!0}),this.radioRows=new Map;let i=[{type:x.Everybody,langKey:"PrivacySettingsController.Everbody"},{type:x.Contacts,langKey:"PrivacySettingsController.MyContacts"},{type:x.Nobody,langKey:"PrivacySettingsController.Nobody"}];e.skipTypes&&(i=i.filter((t=>!e.skipTypes.includes(t.type))));const s=(0,T.a)();i.forEach((({type:e,langKey:t})=>{const i=new Z.ZP({radioField:new A.Z({langKey:t,name:s,value:""+e})});this.radioRows.set(e,i)}));const n=(0,Z.De)([...this.radioRows.values()],this.onRadioChange);if(this.radioSection.content.append(n),e.appendTo&&e.appendTo.append(this.radioSection.container),!e.noExceptions){const t=(0,b.R)(e.appendTo,"PrivacyExceptions","PrivacySettingsController.PeerInfo");this.exceptions=new Map([["disallow",{titleLangKey:e.exceptionTexts[0],key:"disallow",row:null,icon:"deleteuser",subtitleLangKey:"PrivacySettingsController.AddUsers",clickable:!0}],["allow",{titleLangKey:e.exceptionTexts[1],key:"allow",row:null,icon:"adduser",subtitleLangKey:"PrivacySettingsController.AddUsers",clickable:!0}]]),this.exceptions.forEach((i=>{i.row=new Z.ZP(i),i.row.container.addEventListener("click",(()=>{a.then((()=>{const t=this.peerIds[i.key];e.tab.slider.createTab(_.Z).open({type:"privacy",skippable:!0,title:i.titleLangKey,placeholder:"PrivacyModal.Search.Placeholder",takeOut:e=>{t.length=0,t.push(...e),i.row.subtitle.innerHTML="",i.row.subtitle.append(...this.generateStr(this.splitPeersByType(e)))},selectedPeerIds:t})}))})),t.append(i.row.container)}))}const a=t.appPrivacyManager.getPrivacy(e.inputKey).then((i=>{const s=k(i);this.setRadio(s.type),this.exceptions&&(this.peerIds={},["allow","disallow"].forEach((e=>{const t=[],i="allow"===e?s.allowPeers:s.disallowPeers;t.push(...i.users.map((e=>e.toPeerId()))),t.push(...i.chats.map((e=>e.toPeerId(!0)))),this.peerIds[e]=t;const n=this.exceptions.get(e).row.subtitle;n.innerHTML="",n.append(...this.generateStr(i))}))),e.tab.eventListener.addEventListener("destroy",(()=>{return i=this,s=void 0,a=function*(){const i=[];switch(this.type){case x.Everybody:i.push({_:"inputPrivacyValueAllowAll"});break;case x.Contacts:i.push({_:"inputPrivacyValueAllowContacts"});break;case x.Nobody:i.push({_:"inputPrivacyValueDisallowAll"})}if(this.exceptions){const e=[["allow","inputPrivacyValueAllowChatParticipants","inputPrivacyValueAllowUsers"],["disallow","inputPrivacyValueDisallowChatParticipants","inputPrivacyValueDisallowUsers"]];for(const[s,n,a]of e){if(this.exceptions.get(s).row.container.classList.contains("hide"))continue;const e=this.peerIds[s];if(e){const s=this.splitPeersByType(e);s.chats.length&&i.push({_:n,chats:s.chats}),s.users.length&&i.push({_:a,users:yield Promise.all(s.users.map((e=>t.appUsersManager.getUserInput(e))))})}}}t.appPrivacyManager.setPrivacy(e.inputKey,i)},new((n=void 0)||(n=Promise))((function(e,t){function o(e){try{d(a.next(e))}catch(e){t(e)}}function r(e){try{d(a.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(i,s||[])).next())}));var i,s,n,a}),{once:!0})}))}setRadio(e){const t=this.radioRows.get(e);this.onRadioChange(e),t.radioField.input.checked=!0}splitPeersByType(e){const t={users:[],chats:[]};return e.forEach((e=>{t[e.isAnyChat()?"chats":"users"].push(e.isAnyChat()?e.toChatId():e)})),t}generateStr(e){return e.users.length||e.chats.length?(0,f.v_)([e.users.length?(0,f.ag)("Users",[e.users.length]):null,e.chats.length?(0,f.ag)("Chats",[e.chats.length]):null].filter(Boolean),!1):[(0,f.ag)("PrivacySettingsController.AddUsers")]}}var D=i(3532);class R extends M.h{init(){return e=this,t=void 0,s=function*(){this.container.classList.add("privacy-tab","privacy-phone-number"),this.setTitle("PrivacyPhone");const e="+"+(yield this.managers.appUsersManager.getSelf()).phone,t=document.createElement("div");t.append((0,f.ag)("PrivacyPhoneInfo"),document.createElement("br"),document.createElement("br"),(0,f.ag)("PrivacyPhoneInfo4"),document.createElement("br"),(0,D.Z)({mePath:e}));const i=new F({tab:this,title:"PrivacyPhoneTitle",inputKey:"inputPrivacyKeyPhoneNumber",captions:[t,t,""],exceptionTexts:["PrivacySettingsController.NeverShare","PrivacySettingsController.AlwaysShare"],appendTo:this.scrollable,onRadioChange:e=>{n.setRadio(x.Everybody),n.radioSection.container.classList.toggle("hide",e!==x.Nobody)},managers:this.managers}),s="PrivacyPhoneInfo3",n=new F({tab:this,title:"PrivacyPhoneTitle2",inputKey:"inputPrivacyKeyAddedByPhone",captions:[s,s,""],noExceptions:!0,skipTypes:[x.Nobody],managers:this.managers});this.scrollable.container.insertBefore(n.radioSection.container,i.radioSection.container.nextSibling)},new((i=void 0)||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}));var e,t,i,s}}var B=i(8127),N=i(5772),O=i(279);class U extends l._{init(){this.container.classList.add("two-step-verification","two-step-verification-set"),this.setTitle("TwoStepVerificationPasswordSet");const e=new b.Z({captionOld:"TwoStepVerificationPasswordSetInfo",noDelimiter:!0}),t=document.createElement("div");(0,N.Z)({emoji:"🥳",div:t,width:160,height:160}),e.content.append(t);const i=e.generateContentElement(),s=document.createElement("div");s.classList.add("input-wrapper");const n=(0,I.Z)("btn-primary btn-color-primary",{text:"TwoStepVerificationPasswordReturnSettings"});(0,v.fc)(n,(e=>{this.close()})),this.slider.sliceTabsUntilTab(Tt,this),s.append(n),i.append(s),this.scrollable.container.append(e.container)}}var H=i(4489),z=i(4762);function j(e){return!z.IS_MOBILE_SAFARI||!e}var G=i(1656);class V extends l._{constructor(){super(...arguments),this.isFirst=!1}init(){this.container.classList.add("two-step-verification","two-step-verification-email-confirmation"),this.setTitle("TwoStepAuth.RecoveryTitle");const e=new b.Z({captionOld:!0,noDelimiter:!0});(0,f.$d)(e.caption,"TwoStepAuth.ConfirmEmailCodeDesc",[this.email]);const t=document.createElement("div");(0,N.Z)({div:t,width:160,height:160,emoji:"📬"}),e.content.append(t);const i=e.generateContentElement(),s=document.createElement("div");s.classList.add("input-wrapper");const n=this.codeInputField=new H.Z({name:"recovery-email-code",label:"TwoStepAuth.RecoveryCode",length:this.length,onFill:e=>{d(!0),this.managers.passwordManager.confirmPasswordEmail(""+e).then((e=>{r()})).catch((e=>{switch(e.type){case"CODE_INVALID":n.input.classList.add("error"),(0,P.Z)(n.label,(0,f.ag)("TwoStepAuth.RecoveryCodeInvalid"));break;case"EMAIL_HASH_EXPIRED":n.input.classList.add("error"),(0,P.Z)(n.label,(0,f.ag)("TwoStepAuth.RecoveryCodeExpired"));break;default:console.error("confirm error",e)}d(!1)}))}}),a=(0,I.Z)("btn-primary btn-primary-transparent primary",{text:"TwoStepAuth.EmailCodeChangeEmail"}),o=(0,I.Z)("btn-primary btn-secondary btn-primary-transparent primary",{text:"ResendCode"}),r=()=>{this.slider.createTab(U).open()},d=e=>{(0,G.Z)([n.input,a,o],e)};(0,v.fc)(a,(e=>{d(!0),this.managers.passwordManager.cancelPasswordEmail().then((e=>{this.slider.sliceTabsUntilTab($,this),this.close()}),(()=>{d(!1)}))})),(0,v.fc)(o,(e=>{d(!0);const t=(0,O.y)(o);this.managers.passwordManager.resendPasswordEmail().then((e=>{t.remove(),d(!1)}))})),s.append(n.container,a,o),i.append(s),this.scrollable.container.append(e.container)}onOpenAfterTimeout(){j(this.isFirst)&&this.codeInputField.input.focus()}}var K=i(3910),W=i(1171);class $ extends l._{constructor(){super(...arguments),this.isFirst=!1}init(){this.container.classList.add("two-step-verification","two-step-verification-email"),this.setTitle("RecoveryEmailTitle");const e=new b.Z({captionOld:!0,noDelimiter:!0}),t=document.createElement("div");(0,N.Z)({div:t,width:160,height:160,emoji:"💌"}),e.content.append(t);const i=e.generateContentElement(),s=document.createElement("div");s.classList.add("input-wrapper");const n=this.inputField=new u.ZP({name:"recovery-email",label:"RecoveryEmail",plainText:!0});n.input.addEventListener("keypress",(e=>{if("Enter"===e.key)return(0,K.Z)(e),d()})),n.input.addEventListener("input",(e=>{n.input.classList.remove("error")}));const a=(0,I.Z)("btn-primary btn-color-primary",{text:"Continue"}),o=(0,I.Z)("btn-primary btn-secondary btn-primary-transparent primary",{text:"YourEmailSkip"}),r=()=>{this.slider.createTab(U).open()},d=()=>{const e=n.value.trim(),t=(0,W.Z)(e);if(!t||t[0].length!==e.length)return void n.input.classList.add("error");l(!0);const i=(0,O.y)(a);this.managers.passwordManager.updateSettings({hint:this.hint,currentPassword:this.plainPassword,newPassword:this.newPassword,email:e}).then((e=>{r()}),(t=>{if(t.type.includes("EMAIL_UNCONFIRMED")){const i=+t.type.match(/^EMAIL_UNCONFIRMED_(\d+)/)[1],s=this.slider.createTab(V);s.state=this.state,s.email=e,s.length=i,s.open()}else console.log("password set error",t);l(!1),i.remove()}))};(0,v.fc)(a,d);const l=e=>{e?(a.setAttribute("disabled","true"),o.setAttribute("disabled","true")):(a.removeAttribute("disabled"),o.removeAttribute("disabled"))};(0,v.fc)(o,(e=>{new B.Z("popup-skip-email",{buttons:[{langKey:"Cancel",isCancel:!0},{langKey:"YourEmailSkip",callback:()=>{l(!0),(0,O.y)(o),this.managers.passwordManager.updateSettings({hint:this.hint,currentPassword:this.plainPassword,newPassword:this.newPassword,email:""}).then((()=>{r()}),(e=>{l(!1)}))},isDanger:!0}],titleLangKey:"YourEmailSkipWarning",descriptionLangKey:"YourEmailSkipWarningText"}).show()})),s.append(n.container,a,o),i.append(s),this.scrollable.container.append(e.container)}onOpenAfterTimeout(){j(this.isFirst)&&this.inputField.input.focus()}}var q=i(130),Y=i(8115),Q=i(4425),X=i(6830),J=i(3083),ee=i(2796);class te extends l._{init(){this.container.classList.add("two-step-verification","two-step-verification-hint"),this.setTitle("TwoStepAuth.SetupHintTitle");const e=new b.Z({noDelimiter:!0}),t=document.createElement("div");(0,N.Z)({div:t,width:160,height:160,emoji:"💡"}),e.content.append(t);const i=document.createElement("div");i.classList.add("input-wrapper");const s=this.inputField=new u.ZP({name:"hint",label:"TwoStepAuth.SetupHintPlaceholder"});s.input.addEventListener("keypress",(e=>{if("Enter"===e.key)return(0,K.Z)(e),s.value?r():d()}));const n=(e,t)=>{e&&(0,K.Z)(e);const i=t?s.value:void 0;if(i&&this.newPassword===i)return void(0,ee.Am)(f.ZP.format("PasswordAsHintError",!0));const n=this.slider.createTab($);n.state=this.state,n.plainPassword=this.plainPassword,n.newPassword=this.newPassword,n.hint=i,n.open()},a=(0,I.Z)("btn-primary btn-color-primary",{text:"Continue"}),o=(0,I.Z)("btn-primary btn-secondary btn-primary-transparent primary",{text:"YourEmailSkip"}),r=e=>n(e,!0),d=e=>n(e,!1);(0,v.fc)(a,r),(0,v.fc)(o,d),i.append(s.container,a,o),e.content.append(i),this.scrollable.container.append(e.container)}onOpenAfterTimeout(){this.inputField.input.focus()}}class ie extends l._{init(){this.container.classList.add("two-step-verification","two-step-verification-enter-password","two-step-verification-re-enter-password"),this.setTitle("PleaseReEnterPassword");const e=new b.Z({noDelimiter:!0}),t=document.createElement("div");t.classList.add("input-wrapper");const i=this.passwordInputField=new X.Z({name:"re-enter-password",label:"PleaseReEnterPassword"}),s=new J.Z(i,157),n=(0,I.Z)("btn-primary btn-color-primary",{text:"Continue"});t.append(i.container,n),e.content.append(s.container,t),this.scrollable.container.append(e.container),i.input.addEventListener("keypress",(e=>{if(i.input.classList.contains("error")&&i.setState(u.I1.Neutral),"Enter"===e.key)return o()}));const a=()=>this.newPassword===i.value||(i.setError(),!1),o=e=>{if(e&&(0,K.Z)(e),!a())return;const t=this.slider.createTab(te);t.state=this.state,t.plainPassword=this.plainPassword,t.newPassword=this.newPassword,t.open()};return(0,v.fc)(n,o),s.load()}onOpenAfterTimeout(){this.passwordInputField.input.focus()}}class se extends l._{constructor(){super(...arguments),this.isFirst=!0}init(){const e=!this.state.pFlags.has_password||this.plainPassword;this.container.classList.add("two-step-verification","two-step-verification-enter-password"),this.setTitle(e?"PleaseEnterFirstPassword":"PleaseEnterCurrentPassword");const t=new b.Z({noDelimiter:!0}),i=document.createElement("div");i.classList.add("input-wrapper");const s=this.passwordInputField=new X.Z({name:"enter-password",label:e?"PleaseEnterFirstPassword":this.state.hint?void 0:"LoginPassword",labelText:!e&&this.state.hint?(0,Y.Z)(this.state.hint):void 0}),n=new Q.Z(s,157),a=(0,I.Z)("btn-primary btn-color-primary"),o=new f.ZP.IntlElement({key:"Continue"});a.append(o.element),i.append(s.container,a),t.content.append(n.container,i),this.scrollable.container.append(t.container),s.input.addEventListener("keypress",(e=>{if(s.input.classList.contains("error")&&(s.input.classList.remove("error"),o.key="Continue",o.update()),"Enter"===e.key)return d()}));const r=()=>!!s.value.length||(s.input.classList.add("error"),!1);let d;if(e)d=e=>{if(e&&(0,K.Z)(e),!r())return;const t=this.slider.createTab(ie);t.state=this.state,t.newPassword=s.value,t.plainPassword=this.plainPassword,t.open()};else{let e;const t=()=>(e||(e=window.setInterval(t,1e4)),this.managers.passwordManager.getState().then((e=>{this.state=e,this.state.hint?(0,q.Z)(s.label,(0,Y.Z)(this.state.hint)):(0,P.Z)(s.label,(0,f.ag)("LoginPassword"))})));d=i=>{if(!r())return void(0,K.Z)(i);a.setAttribute("disabled","true"),o.key="PleaseWait",o.update();const d=(0,O.y)(a),l=s.value;this.managers.passwordManager.check(s.value,this.state).then((t=>{if(console.log(t),"auth.authorization"===t._){clearInterval(e),n&&n.remove();const t=this.slider.createTab(ne);t.state=this.state,t.plainPassword=l,t.open(),this.slider.removeTabFromHistory(this)}}),(e=>{a.removeAttribute("disabled"),s.input.classList.add("error"),e.type,o.key="PASSWORD_HASH_INVALID",o.update(),d.remove(),s.select(),t()}))},t()}return(0,v.fc)(a,d),n.load()}onOpenAfterTimeout(){j(this.isFirst)&&this.passwordInputField.input.focus()}}class ne extends l._{init(){this.container.classList.add("two-step-verification","two-step-verification-main"),this.setTitle("TwoStepVerificationTitle");const e=new b.Z({captionOld:!0,noDelimiter:!0}),t=document.createElement("div");(0,N.Z)({div:t,width:168,height:168,emoji:"🔐"}),e.content.append(t);const i=e.generateContentElement();if(this.state.pFlags.has_password){(0,f.$d)(e.caption,"TwoStepAuth.GenericHelp");const t=(0,I.Z)("btn-primary btn-transparent",{icon:"edit",text:"TwoStepAuth.ChangePassword"}),s=(0,I.Z)("btn-primary btn-transparent",{icon:"passwordoff",text:"TwoStepAuth.RemovePassword"}),n=(0,I.Z)("btn-primary btn-transparent",{icon:"email",text:this.state.pFlags.has_recovery?"TwoStepAuth.ChangeEmail":"TwoStepAuth.SetupEmail"});(0,v.fc)(t,(()=>{const e=this.slider.createTab(se);e.state=this.state,e.plainPassword=this.plainPassword,e.open()})),(0,v.fc)(s,(()=>{new B.Z("popup-disable-password",{buttons:[{langKey:"Disable",callback:()=>{this.managers.passwordManager.updateSettings({currentPassword:this.plainPassword}).then((()=>{this.slider.sliceTabsUntilTab(Tt,this),this.close()}))},isDanger:!0}],titleLangKey:"TurnPasswordOffQuestionTitle",descriptionLangKey:"TurnPasswordOffQuestion"}).show()})),(0,v.fc)(n,(()=>{const e=this.slider.createTab($);e.state=this.state,e.hint=this.state.hint,e.plainPassword=this.plainPassword,e.newPassword=this.plainPassword,e.isFirst=!0,e.open()})),i.append(t,s,n)}else{(0,f.$d)(e.caption,"TwoStepAuth.SetPasswordHelp");const t=document.createElement("div");t.classList.add("input-wrapper");const s=(0,I.Z)("btn-primary btn-color-primary",{text:"TwoStepVerificationSetPassword"});t.append(s),i.append(t),(0,v.fc)(s,(e=>{const t=this.slider.createTab(se);t.state=this.state,t.open()}))}this.scrollable.container.append(e.container)}}class ae extends M.h{init(){this.container.classList.add("privacy-tab","privacy-last-seen"),this.setTitle("PrivacyLastSeen");const e="PrivacySettingsController.LastSeenDescription";new F({tab:this,title:"LastSeenTitle",inputKey:"inputPrivacyKeyStatusTimestamp",captions:[e,e,e],exceptionTexts:["PrivacySettingsController.NeverShare","PrivacySettingsController.AlwaysShare"],appendTo:this.scrollable,managers:this.managers})}}class oe extends M.h{init(){this.container.classList.add("privacy-tab","privacy-profile-photo"),this.setTitle("PrivacyProfilePhoto");const e="PrivacySettingsController.ProfilePhoto.CustomHelp";new F({tab:this,title:"PrivacyProfilePhotoTitle",inputKey:"inputPrivacyKeyProfilePhoto",captions:[e,e,e],exceptionTexts:["PrivacySettingsController.NeverShare","PrivacySettingsController.AlwaysShare"],appendTo:this.scrollable,skipTypes:[x.Nobody],managers:this.managers})}}class re extends M.h{init(){this.container.classList.add("privacy-tab","privacy-forward-messages"),this.setTitle("PrivacySettings.Forwards");const e="PrivacySettingsController.Forwards.CustomHelp";new F({tab:this,title:"PrivacyForwardsTitle",inputKey:"inputPrivacyKeyForwards",captions:[e,e,e],exceptionTexts:["PrivacySettingsController.NeverAllow","PrivacySettingsController.AlwaysAllow"],appendTo:this.scrollable,managers:this.managers})}}class de extends M.h{init(){this.container.classList.add("privacy-tab","privacy-add-to-groups"),this.setTitle("PrivacySettings.Groups");const e="PrivacySettingsController.GroupDescription";new F({tab:this,title:"WhoCanAddMe",inputKey:"inputPrivacyKeyChatInvite",captions:[e,e,e],exceptionTexts:["PrivacySettingsController.NeverAllow","PrivacySettingsController.AlwaysAllow"],appendTo:this.scrollable,skipTypes:[x.Nobody],managers:this.managers})}}class le extends M.h{init(){this.container.classList.add("privacy-tab","privacy-calls"),this.setTitle("PrivacySettings.VoiceCalls");const e="PrivacySettingsController.PhoneCallDescription";new F({tab:this,title:"WhoCanCallMe",inputKey:"inputPrivacyKeyPhoneCall",captions:[e,e,e],exceptionTexts:["PrivacySettingsController.NeverAllow","PrivacySettingsController.AlwaysAllow"],appendTo:this.scrollable,managers:this.managers});{const e="PrivacySettingsController.P2p.Desc";new F({tab:this,title:"PrivacyP2PHeader",inputKey:"inputPrivacyKeyPhoneP2P",captions:[e,e,e],exceptionTexts:["PrivacySettingsController.NeverAllow","PrivacySettingsController.AlwaysAllow"],appendTo:this.scrollable,managers:this.managers})}}}var ce=i(3003),he=i(8497),ue=i(4064),pe=i(6976),fe=i(1483),me=i(3416);class ge extends M.h{init(){this.container.classList.add("active-sessions-container"),this.setTitle("SessionsTitle");const e=e=>{const t=new Z.ZP({title:[e.app_name,e.app_version].join(" "),subtitle:[e.ip,e.country].join(" - "),clickable:!0,titleRight:e.pFlags.current?void 0:(0,C.zM)(new Date(1e3*Math.max(e.date_active,e.date_created)))});return t.container.dataset.hash=""+e.hash,t.midtitle.textContent=[e.device_model,e.system_version||e.platform].filter(Boolean).join(", "),t},t=this.authorizations.slice();{const n=new b.Z({name:"CurrentSession",caption:"ClearOtherSessionsHelp"}),a=(0,ue.Z)(t,(e=>e.pFlags.current)),o=e(a);if(n.content.append(o.container),t.length){const e=(0,I.Z)("btn-primary btn-transparent danger",{icon:"stop",text:"TerminateAllSessions"});(0,v.fc)(e,(t=>{new B.Z("revoke-session",{buttons:[{langKey:"Terminate",isDanger:!0,callback:()=>{const t=(0,G.Z)([e],!0);this.managers.apiManager.invokeApi("auth.resetAuthorizations").then((t=>{e.remove(),i.container.remove()}),s).finally((()=>{t()}))}}],titleLangKey:"AreYouSureSessionsTitle",descriptionLangKey:"AreYouSureSessions"}).show()}),{listenerSetter:this.listenerSetter}),n.content.append(e)}this.scrollable.append(n.container)}if(!t.length)return;const i=new b.Z({name:"OtherSessions",caption:"SessionsListInfo"});t.forEach((t=>{i.content.append(e(t).container)})),this.scrollable.append(i.container);const s=e=>{"FRESH_RESET_AUTHORISATION_FORBIDDEN"===e.type&&(0,ee.Am)(f.ZP.format("RecentSessions.Error.FreshReset",!0))};let n;const a=()=>{const e=n.dataset.hash;new B.Z("revoke-session",{buttons:[{langKey:"Terminate",isDanger:!0,callback:()=>{this.managers.apiManager.invokeApi("account.resetAuthorization",{hash:e}).then((e=>{e&&n.remove()}),s)}}],titleLangKey:"AreYouSureSessionTitle",descriptionLangKey:"TerminateSessionText"}).show()},o=this.menuElement=(0,ce.b)({buttons:[{icon:"stop",text:"Terminate",onClick:a}]});o.id="active-sessions-contextmenu",o.classList.add("contextmenu"),document.getElementById("page-chats").append(o),(0,pe.E)({element:this.scrollable.container,callback:e=>{n=(0,he.Z)(e.target,"row"),n&&"0"!==n.dataset.hash&&(e instanceof MouseEvent&&e.preventDefault(),e instanceof MouseEvent&&(e.cancelBubble=!0),(0,fe.Z)(e,o),me.Z.openBtnMenu(o))},listenerSetter:this.listenerSetter}),(0,v.fc)(this.scrollable.container,(e=>{n=(0,he.Z)(e.target,"row"),n&&"0"!==n.dataset.hash&&a()}),{listenerSetter:this.listenerSetter})}onCloseAfterTimeout(){var e;return null===(e=this.menuElement)||void 0===e||e.remove(),super.onCloseAfterTimeout()}}var ve=i(2995),be=i(4668),ye=i(8210),we=i(5102);class Se extends l._{init(){this.container.classList.add("blocked-users-container"),this.setTitle("BlockedUsers");const e=new b.Z({caption:"BlockedUsersInfo"});e.caption.parentElement.prepend(e.caption),this.scrollable.append(e.container);const t=(0,m.Z)({icon:"add",className:"is-visible"});this.content.append(t),(0,v.fc)(t,(e=>{new ve.Z({peerTypes:["contacts"],placeholder:"BlockModal.Search.Placeholder",onSelect:e=>{this.managers.appUsersManager.toggleBlock(e,!0)}})}),{listenerSetter:this.listenerSetter});const i=h.default.createChatList();this.scrollable.container.classList.add("chatlist-container"),e.content.append(i);const s=(e,t)=>{return s=this,n=void 0,o=function*(){const{dom:s}=h.default.addDialogNew({peerId:e,container:i,rippleEnabled:!0,avatarSize:"abitbigger",append:t}),n=yield this.managers.appUsersManager.getUser(e.toUserId());if(!n)return;const a=(0,we.Z)(n)[0];n.pFlags.bot?s.lastMessageSpan.append("@"+a):n.phone?s.lastMessageSpan.innerHTML=(0,ye.Z)(n.phone):s.lastMessageSpan.append(a?"@"+a:(0,g.Z)(n))},new((a=void 0)||(a=Promise))((function(e,t){function i(e){try{d(o.next(e))}catch(e){t(e)}}function r(e){try{d(o.throw(e))}catch(e){t(e)}}function d(t){var s;t.done?e(t.value):(s=t.value,s instanceof a?s:new a((function(e){e(s)}))).then(i,r)}d((o=o.apply(s,n||[])).next())}));var s,n,a,o};for(const e of this.peerIds)s(e,!0);let a;const o=this.menuElement=(0,ce.b)({buttons:[{icon:"lockoff",text:"Unblock",onClick:()=>{const e=a.dataset.peerId.toPeerId();this.managers.appUsersManager.toggleBlock(e,!1)},options:{listenerSetter:this.listenerSetter}}]});o.id="blocked-users-contextmenu",o.classList.add("contextmenu"),document.getElementById("page-chats").append(o),(0,pe.E)({element:this.scrollable.container,callback:e=>{a=(0,be.Z)(e.target,h.DIALOG_LIST_ELEMENT_TAG),a&&(e instanceof MouseEvent&&e.preventDefault(),e instanceof MouseEvent&&(e.cancelBubble=!0),(0,fe.Z)(e,o),me.Z.openBtnMenu(o))},listenerSetter:this.listenerSetter}),this.listenerSetter.add(n.Z)("peer_block",(e=>{const{peerId:t,blocked:n}=e,a=i.querySelector(`[data-peer-id="${t}"]`);n?a||s(t,!1):a&&a.remove()}));let r=!1;this.scrollable.onScrolledBottom=()=>{r||(r=!0,this.managers.appUsersManager.getBlocked(i.childElementCount,50).then((e=>{for(const t of e.peerIds)s(t,!0);(e.peerIds.length<50||i.childElementCount===e.count)&&(this.scrollable.onScrolledBottom=null),this.scrollable.checkForTriggers()})).finally((()=>{r=!1})))}}onOpenAfterTimeout(){this.scrollable.onScroll()}onCloseAfterTimeout(){return this.menuElement&&this.menuElement.remove(),super.onCloseAfterTimeout()}}var Ce=i(9807);function Le(e){return"input"+(e[0].toUpperCase()+e.slice(1))}var Ee=i(5592),Ie=i(319);class Me extends M.h{init(){this.container.classList.add("privacy-tab","privacy-voices"),this.setTitle("PrivacyVoiceMessages");const e="PrivacyVoiceMessagesInfo";new F({tab:this,title:"PrivacyVoiceMessagesTitle",inputKey:"inputPrivacyKeyVoiceMessages",captions:[e,e,e],exceptionTexts:["PrivacySettingsController.NeverAllow","PrivacySettingsController.AlwaysAllow"],appendTo:this.scrollable,managers:this.managers})}}var Ze=i(7362),Pe=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class Te extends M.h{init(e){return Pe(this,void 0,void 0,(function*(){this.container.classList.add("active-sessions-container"),this.setTitle("WebSessionsTitle");const t=e=>Pe(this,void 0,void 0,(function*(){const t=e.bot_id.toPeerId(),i=new Z.ZP({title:yield(0,Ze.Z)({peerId:t}),subtitle:[e.ip,e.region].join(" - "),clickable:!0,titleRight:(0,C.zM)(new Date(1e3*Math.max(e.date_active,e.date_created)))}),s=i.createMedia("big"),n=new o.Z;return n.classList.add("avatar-48"),yield n.updateWithOptions({peerId:t}),s.append(n),i.container.dataset.hash=""+e.hash,i.container.dataset.peerId=""+t,i.midtitle.textContent=[e.domain,e.browser,e.platform].filter(Boolean).join(", "),i}));{const e=new b.Z({caption:"ClearOtherWebSessionsHelp"}),t=(0,I.Z)("btn-primary btn-transparent danger",{icon:"stop",text:"TerminateAllWebSessions"});(0,v.fc)(t,(()=>Pe(this,void 0,void 0,(function*(){yield(0,Ee.Z)({descriptionLangKey:"AreYouSureWebSessions",button:{langKey:"Disconnect",isDanger:!0}}),(0,G.Z)([t],!0),this.managers.appSeamlessLoginManager.resetWebAuthorizations().then((()=>{this.close()}))}))),{listenerSetter:this.listenerSetter}),e.content.append(t),this.scrollable.append(e.container)}{const i=new b.Z({name:"OtherWebSessions",caption:"TerminateWebSessionInfo"}),s=yield Promise.all(e.map(t));i.content.append(...s.map((e=>e.container)));let n=s.length;(0,v.fc)(i.content,(e=>Pe(this,void 0,void 0,(function*(){const t=(0,he.Z)(e.target,"row");if(!t)return;yield(0,Ee.Z)({descriptionLangKey:"TerminateWebSessionText",descriptionLangArgs:[yield(0,Ze.Z)({peerId:t.dataset.peerId.toPeerId()})],button:{langKey:"Disconnect",isDanger:!0}});const i=t.dataset.hash;t.classList.add("is-disabled"),this.managers.appSeamlessLoginManager.resetWebAuthorization(i).then((()=>{--n?t.remove():this.close()}))}))),{listenerSetter:this.listenerSetter}),this.scrollable.append(i.container)}}))}}class ke extends M.h{static getInitArgs(e){return{appConfig:e.managers.apiManager.getAppConfig(),globalPrivacy:e.managers.appPrivacyManager.getGlobalPrivacySettings(),contentSettings:e.managers.apiManager.invokeApi("account.getContentSettings"),webAuthorizations:e.managers.appSeamlessLoginManager.getWebAuthorizations()}}init(e){this.container.classList.add("dont-u-dare-block-me"),this.setTitle("PrivacySettings");const t="Loading",i=[];{const s=new b.Z({noDelimiter:!0,caption:"SessionsInfo"});let a;const o=new Z.ZP({icon:"deleteuser",titleLangKey:"BlockedUsers",subtitleLangKey:t,clickable:()=>{const e=this.slider.createTab(Se);e.peerIds=a,e.open()},listenerSetter:this.listenerSetter});let r;o.freezed=!0;const d={icon:"lock",titleLangKey:"TwoStepVerification",subtitleLangKey:t,clickable:e=>{let t;r.pFlags.has_password?t=this.slider.createTab(se):r.email_unconfirmed_pattern?(t=this.slider.createTab(V),t.email=r.email_unconfirmed_pattern,t.length=6,t.isFirst=!0,this.managers.passwordManager.resendPasswordEmail()):t=this.slider.createTab(ne),t.state=r,t.open()},listenerSetter:this.listenerSetter},l=new Z.ZP(d);l.freezed=!0;const c=this.activeSessionsRow=new Z.ZP({icon:"activesessions",titleLangKey:"SessionsTitle",subtitleLangKey:t,clickable:()=>{const e=this.slider.createTab(ge);e.authorizations=this.authorizations,e.eventListener.addEventListener("destroy",(()=>{this.updateActiveSessions()}),{once:!0}),e.open()},listenerSetter:this.listenerSetter});c.freezed=!0;const h=this.websitesRow=new Z.ZP({icon:"mention",titleLangKey:"OtherWebSessions",subtitleLangKey:t,clickable:()=>{const e=this.slider.createTab(Te);e.eventListener.addEventListener("destroy",(()=>{this.updateActiveWebsites()})),e.open(this.websites)},listenerSetter:this.listenerSetter});h.freezed=!0,s.content.append(o.container,l.container,c.container,h.container),this.scrollable.append(s.container);const u=e=>{e?(0,P.Z)(o.subtitle,(0,f.ag)("PrivacySettingsController.UserCount",[e])):(0,P.Z)(o.subtitle,(0,f.ag)("BlockedEmpty",[e]))};this.listenerSetter.add(n.Z)("peer_block",(()=>{p()}));const p=()=>{this.managers.appUsersManager.getBlocked().then((e=>{o.freezed=!1,u(e.count),a=e.peerIds}))};p(),this.managers.passwordManager.getState().then((e=>{r=e,(0,P.Z)(l.subtitle,(0,f.ag)(e.pFlags.has_password?"PrivacyAndSecurity.Item.On":"PrivacyAndSecurity.Item.Off")),l.freezed=!1})),this.updateActiveSessions(),i.push(this.updateActiveWebsites(e.webAuthorizations))}{const e=new b.Z({name:"PrivacyTitle",caption:"GroupsAndChannelsHelp"});e.content.classList.add("privacy-navigation-container");const i={},s=i.inputPrivacyKeyPhoneNumber=new Z.ZP({titleLangKey:"PrivacyPhoneTitle",subtitleLangKey:t,clickable:()=>{this.slider.createTab(R).open()},listenerSetter:this.listenerSetter}),a=i.inputPrivacyKeyStatusTimestamp=new Z.ZP({titleLangKey:"LastSeenTitle",subtitleLangKey:t,clickable:()=>{this.slider.createTab(ae).open()},listenerSetter:this.listenerSetter}),o=i.inputPrivacyKeyProfilePhoto=new Z.ZP({titleLangKey:"PrivacyProfilePhotoTitle",subtitleLangKey:t,clickable:()=>{this.slider.createTab(oe).open()},listenerSetter:this.listenerSetter}),r=i.inputPrivacyKeyPhoneCall=new Z.ZP({titleLangKey:"WhoCanCallMe",subtitleLangKey:t,clickable:()=>{this.slider.createTab(le).open()},listenerSetter:this.listenerSetter}),d=i.inputPrivacyKeyForwards=new Z.ZP({titleLangKey:"PrivacyForwardsTitle",subtitleLangKey:t,clickable:()=>{this.slider.createTab(re).open()},listenerSetter:this.listenerSetter}),l=i.inputPrivacyKeyChatInvite=new Z.ZP({titleLangKey:"WhoCanAddMe",subtitleLangKey:t,clickable:()=>{this.slider.createTab(de).open()},listenerSetter:this.listenerSetter}),c=i.inputPrivacyKeyVoiceMessages=new Z.ZP({titleLangKey:"PrivacyVoiceMessagesTitle",subtitleLangKey:t,clickable:()=>{n.Z.premium?this.slider.createTab(Me).open():(0,ee.bC)({langPackKey:"PrivacyVoiceMessagesPremiumOnly"})},listenerSetter:this.listenerSetter}),h=e=>{const t=i[e];t&&this.managers.appPrivacyManager.getPrivacy(e).then((e=>{const i=k(e),s=i.type===x.Everybody?"PrivacySettingsController.Everbody":i.type===x.Contacts?"PrivacySettingsController.MyContacts":"PrivacySettingsController.Nobody",n=i.disallowPeers.users.length+i.disallowPeers.chats.length,a=i.allowPeers.users.length+i.allowPeers.chats.length;t.subtitle.innerHTML="";const o=(0,f.ag)(s);t.subtitle.append(o),(n||a)&&t.subtitle.append(` (${[-n,a?"+"+a:0].filter(Boolean).join(", ")})`)}))};e.content.append(s.container,a.container,o.container,r.container,d.container,l.container,c.container),this.scrollable.append(e.container);for(const e in i)h(e);n.Z.addEventListener("privacy_update",(e=>{h(Le(e.key._))}))}{const t=new b.Z({name:"NewChatsFromNonContacts",caption:"ArchiveAndMuteInfo"}),s=new Ce.Z({text:"ArchiveAndMute"}),a=new Z.ZP({checkboxField:s});let o,r;t.content.append(a.container),this.eventListener.addEventListener("destroy",(()=>{if(r=!0,void 0!==o&&o!==s.checked)return this.managers.appPrivacyManager.setGlobalPrivacySettings({_:"globalPrivacySettings",archive_and_mute_new_noncontact_peers:s.checked})}),{once:!0});const d=Promise.all([e.appConfig,e.globalPrivacy]).then((([e,i])=>{if(r)return;const a=i=>{t.container.classList.toggle("hide",!i&&!e.autoarchive_setting_available)};this.listenerSetter.add(n.Z)("premium_toggle",a),a(n.Z.premium),o=!!i.archive_and_mute_new_noncontact_peers,s.setValueSilently(o)}));i.push(d),this.scrollable.append(t.container)}{const t=new b.Z({name:"Privacy.SensitiveContent",caption:"PrivacyAndSecurity.SensitiveDesc"});t.container.classList.add("hide");const s=new Ce.Z({text:"PrivacyAndSecurity.SensitiveText"}),n=new Z.ZP({checkboxField:s});let a;t.content.append(n.container),this.eventListener.addEventListener("destroy",(()=>{if(void 0===a)return;const e=n.checkboxField.checked;return e!==a?this.managers.apiManager.invokeApi("account.setContentSettings",{sensitive_enabled:e}):void 0}),{once:!0});const o=e.contentSettings.then((e=>{e.pFlags.sensitive_can_change&&(a=!!e.pFlags.sensitive_enabled,s.setValueSilently(a),t.container.classList.remove("hide"))}));i.push(o),this.scrollable.append(t.container)}{const e=new b.Z({name:"PrivacyPayments",caption:"PrivacyPaymentsClearInfo"}),t=()=>{const e={titleLangKey:"PrivacyPaymentsClearAlertTitle",descriptionLangKey:"PrivacyPaymentsClearAlertText",button:{langKey:"Clear"},checkboxes:[{text:"PrivacyClearShipping",checked:!0},{text:"PrivacyClearPayment",checked:!0}]};(0,Ee.Z)(e).then((()=>{const[t,s]=e.checkboxes.map((e=>e.checkboxField.checked)),n=(0,G.Z)([i],!0);this.managers.appPaymentsManager.clearSavedInfo(t,s).then((()=>{(t||s)&&(n(),(0,ee.bC)({langPackKey:t&&s?"PrivacyPaymentsPaymentShippingCleared":t?"PrivacyPaymentsShippingInfoCleared":"PrivacyPaymentsPaymentInfoCleared"}))}))}),Ie.Z)},i=(0,I.Z)("btn-primary btn-transparent",{icon:"delete",text:"PrivacyPaymentsClear"});this.listenerSetter.add(i)("click",t),e.content.append(i),this.scrollable.append(e.container)}{const e=new b.Z({name:"FilterChats"}),t=()=>{new B.Z("popup-delete-drafts",{buttons:[{langKey:"Delete",callback:()=>{const e=(0,G.Z)([i],!0);this.managers.appDraftsManager.clearAllDrafts().then((()=>{e()}))},isDanger:!0}],titleLangKey:"AreYouSureClearDraftsTitle",descriptionLangKey:"AreYouSureClearDrafts"}).show()},i=(0,I.Z)("btn-primary btn-transparent",{icon:"delete",text:"PrivacyDeleteCloudDrafts"});this.listenerSetter.add(i)("click",t),e.content.append(i),this.scrollable.append(e.container)}return Promise.all(i)}updateActiveSessions(){return this.managers.apiManager.invokeApi("account.getAuthorizations").then((e=>{this.activeSessionsRow.freezed=!1,this.authorizations=e.authorizations,(0,f.$d)(this.activeSessionsRow.subtitle,"Privacy.Devices",[this.authorizations.length])}))}updateActiveWebsites(e=this.managers.appSeamlessLoginManager.getWebAuthorizations()){return e.then((e=>{this.websitesRow.freezed=!1,this.websites=e,(0,f.$d)(this.websitesRow.subtitle,"Privacy.Websites",[this.websites.length]),this.websitesRow.container.classList.toggle("hide",!this.websites.length)}))}}var xe=i(65),Ae=i(9439),_e=i(6761);var Fe=i(3731),De=i(236),Re=i(6714),Be=i(5994),Ne=i(7238),Oe=i(5418),Ue=i(8610);class He extends M.Z{init(){this.container.classList.add("power-saving-container"),this.setTitle("LiteMode.Title");const e=document.createElement("form");let t;{const i=t=new b.Z({caption:"LiteMode.Info"});e.append(i.container)}const i=["all","video","gif",["stickers",["stickers_panel","stickers_chat"]],["effects",["effects_reactions","effects_premiumstickers","effects_emoji"]],["chat",["chat_background","chat_spoilers"]],"animations"];let s,a;{const o=new b.Z({}),r=e=>{const t=Array.isArray(e),i=t?e[0]:e,s=t?(0,Ne.Z)(e[1].map(r)):void 0,a=n.Z.settings.liteMode[i];return[{key:i,text:"all"===i?"LiteMode.EnableText":`LiteMode.Key.${i}.Title`,checked:"all"===i?a:!a,nested:s,name:"power-saving-"+i},...s||[]]};s=(0,Ne.Z)(i.map(r)),a=new Ue.Z({fields:s,listenerSetter:this.listenerSetter}),s.forEach(((e,i)=>{const s=a.createField(e);if(!s)return;const{row:n,nodes:r}=s;(0===i?t:o).content.append(...r)})),(0,v.fc)(o.content,(()=>{n.Z.settings.liteMode.all&&(0,ee.bC)({langPackKey:"LiteMode.DisableAlert"})}),{listenerSetter:this.listenerSetter}),e.append(o.container)}const o=e=>{s.forEach((t=>{"all"!==t.key&&(t.nested&&a.setNestedCounter(t,e?0:void 0),t.checkboxField.input.classList.toggle("is-fake-disabled",e),t.row.toggleDisability(e))}))};this.listenerSetter.add(e)("change",(()=>{return e=this,t=void 0,a=function*(){const e={};s.forEach((t=>{const i=t.checkboxField.checked;e[t.key]="all"===t.key?i:!i}));const t=n.Z.settings.liteMode.all;t!==e.all&&(o(!t),e.all&&(yield(0,Oe.Z)(200))),yield this.managers.appStateManager.setByKey("settings.liteMode",n.Z.settings.liteMode=e)},new((i=void 0)||(i=Promise))((function(s,n){function o(e){try{d(a.next(e))}catch(e){n(e)}}function r(e){try{d(a.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((a=a.apply(e,t||[])).next())}));var e,t,i,a})),o(n.Z.settings.liteMode.all),this.scrollable.append(e)}}var ze=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class je{constructor(e,t,i,s,n,a=!0){const o="range-setting-selector";this.container=document.createElement("div"),this.container.classList.add(o);const r=document.createElement("div");r.classList.add(o+"-details");const d=document.createElement("div");d.classList.add(o+"-name"),(0,f.$d)(d,e);const l=this.valueContainer=document.createElement("div");l.classList.add(o+"-value"),a&&(l.innerHTML=""+i),r.append(d,l),this.range=new xe.Z({step:t,min:s,max:n},i),this.range.setListeners(),this.range.setHandlers({onScrub:e=>{this.onChange&&this.onChange(e),a&&(l.innerText=""+e)}}),this.container.append(r,this.range.container)}}class Ge extends M.h{static getInitArgs(){return{themes:n.Z.managers.appThemesManager.getThemes()}}init(e){this.container.classList.add("general-settings-container"),this.setTitle("General");const t=b.R.bind(null,this.scrollable),i=[];{const e=t("Settings"),i=new je("TextSize",1,n.Z.settings.messagesTextSize,12,20);i.onChange=e=>{n.Z.managers.appStateManager.setByKey("settings.messagesTextSize",e)};const s=(0,I.Z)("btn-primary btn-transparent",{icon:"image",text:"ChatBackground"}),a=Ae.Z.getInitArgs();(0,v.fc)(s,(()=>{this.slider.createTab(Ae.Z).open(a)}));const o=()=>n.Z.settings.liteMode.all?"Checkbox.Enabled":"Checkbox.Disabled",r=new f.ZP.IntlElement,d=()=>{r.compareAndUpdate({key:o()}),l.setValueSilently(Be.Z.isAvailable("animations")),l.toggleDisability(Be.Z.isEnabled())},l=new Ce.Z({text:"EnableAnimations",name:"animations",stateKey:"settings.liteMode.animations",stateValueReverse:!0,checked:!1,listenerSetter:this.listenerSetter}),c=new Z.ZP({checkboxField:l,clickable:()=>{l.isDisabled()&&(0,ee.bC)({langPackKey:"LiteMode.DisableAlert"})},listenerSetter:this.listenerSetter}),h=new Z.ZP({icon:"animations",titleLangKey:"LiteMode.EnableText",titleRightSecondary:r.element,clickable:()=>{this.slider.createTab(He).open()},listenerSetter:this.listenerSetter});d(),this.listenerSetter.add(n.Z)("settings_updated",d),e.append(i.container,s,c.container,h.container)}{const s=t("ColorTheme"),a=new r.v7(null),o=a.container;o.classList.add("themes-container");const d=new Map;let l=Re.Z.getTheme(),c=Re.Z.isNight();const h=e=>{Re.Z.applyTheme(e.theme,e.container);const t=e.container.querySelector(".background-item");null==t||t.remove();const i=e.wallPaperContainers[c?"baseThemeNight":"baseThemeClassic"];i&&e.container.prepend(i)};let u;(0,v.fc)(o,(e=>ze(this,void 0,void 0,(function*(){const t=(0,he.Z)(e.target,"theme-container");if(!t)return;const i=o.querySelector(".active");i&&i.classList.remove("active");const s=d.get(t);if(t.classList.add("active"),yield Re.Z.applyNewTheme(s.theme),null==u||u(-1),s.player&&Be.Z.isAvailable("animations"))if(z.IS_SAFARI)s.player.paused&&s.player.restart();else{s.player.paused&&s.player.stop(!0),s.player.el[0].style.transform="scale(2)";const e=u=t=>{s.player.maxFrame!==t&&-1!==t||(s.player.el[0].style.transform="",s.player.removeEventListener("enterFrame",e),u===e&&(u=void 0))};setTimeout((()=>{u===e&&(s.player.play(),s.player.addEventListener("enterFrame",e))}),250)}}))),{listenerSetter:this.listenerSetter});const p=new Set(["baseThemeClassic","baseThemeNight"]),f=e.themes.then((e=>ze(this,void 0,void 0,(function*(){const t=e.filter((e=>e.pFlags.default));t.unshift(De.t);const i=t.map((e=>ze(this,void 0,void 0,(function*(){const t=document.createElement("div"),i={container:t,theme:e,wallPaperContainers:{}},s=e.settings.filter((e=>p.has(e.base_theme._))).map((e=>{const t=e.wallpaper,s=Ae.Z.addWallPaper(t);return i.wallPaperContainers[e.base_theme._]=s.container,s}));d.set(t,i),h(i),e.id===l.id&&t.classList.add("active");const n=[];let a;if(e.emoticon){a=document.createElement("div"),a.classList.add("theme-emoticon");const t=49;(0,N.Z)({div:a,width:t,height:t,emoji:e.emoticon,managers:this.managers,loadPromises:n,middleware:this.middlewareHelper.get(),play:!1}).then((({render:e})=>e)).then((e=>{i.player=e}))}const o=document.createElement("div");o.classList.add("theme-bubble");const r=o.cloneNode();return r.classList.add("is-in"),o.classList.add("is-out"),n.push(...s.map((e=>e.loadPromise))),t.classList.add("theme-container"),yield Promise.all(n),a&&t.append(a),t.append(r,o),t})))),s=yield Promise.all(i);a.append(...s)}))));i.push(f);const m=document.createElement("form");m.style.marginTop=".5rem";const g="theme",b="settings.theme",y=new Z.ZP({radioField:new A.Z({langKey:"ThemeDay",name:g,value:"day",stateKey:b})}),w=new Z.ZP({radioField:new A.Z({langKey:"ThemeNight",name:g,value:"night",stateKey:b})}),S=new Z.ZP({radioField:new A.Z({langKey:"AutoNightSystemDefault",name:g,value:"system",stateKey:b})});this.listenerSetter.add(n.Z)("settings_updated",(({key:e,value:t,settings:i})=>{e===b&&n.Z.dispatchEvent("theme_change")})),this.listenerSetter.add(n.Z)("theme_change",(()=>{l=Re.Z.getTheme();const e=Re.Z.isNight();if(c===e)return;c=e;const t=o.querySelector(".active");let i;t&&t.classList.remove("active"),d.forEach((e=>{h(e),e.theme.id===l.id&&(e.container.classList.add("active"),i=e.container)})),i&&a.scrollIntoViewNew({element:i,position:"center",axis:"x"})})),m.append(y.container,w.container,S.container),s.append(o,m)}{const e=t("General.Keyboard"),i=document.createElement("form"),s="send-shortcut",n="settings.sendShortcut",a=new Z.ZP({radioField:new A.Z({langKey:"General.SendShortcut.Enter",name:s,value:"enter",stateKey:n}),subtitleLangKey:"General.SendShortcut.NewLine.ShiftEnter"}),o=new Z.ZP({radioField:new A.Z({name:s,value:"ctrlEnter",stateKey:n}),subtitleLangKey:"General.SendShortcut.NewLine.Enter"});(0,f.$d)(o.radioField.main,"General.SendShortcut.CtrlEnter",[z.IS_APPLE?"⌘":"Ctrl"]),i.append(a.container,o.container),e.append(i)}if(Fe.Z){const e=t("DistanceUnitsTitle"),i=document.createElement("form"),s="distance-unit",n="settings.distanceUnit",a=new Z.ZP({radioField:new A.Z({langKey:"DistanceUnitsKilometers",name:s,value:"kilometers",stateKey:n})}),o=new Z.ZP({radioField:new A.Z({langKey:"DistanceUnitsMiles",name:s,value:"miles",stateKey:n})});i.append(a.container,o.container),e.append(i)}{const e=t("General.TimeFormat"),i=document.createElement("form"),s="time-format",n="settings.timeFormat",a=[["h12","General.TimeFormat.h12"],["h23","General.TimeFormat.h23"]],o=a.map((([e,t])=>new Z.ZP({radioField:new A.Z({langKey:t,name:s,value:e,stateKey:n})}))),r=function(e,t=!0){return function(e,t,i=!0){const s=e;let n;return i||(e=Ie.Z),function i(){e(),n=_e.Z.setTimeout(i,t())}(),e=s,()=>{clearTimeout(n)}}(e,(()=>1e3*(60-(new Date).getSeconds())),t)}((()=>{const e=new Date;a.forEach((([t],i)=>{const s=e.toLocaleTimeString("en-us-u-hc-"+t,{hour:"2-digit",minute:"2-digit"});o[i].subtitle.textContent=s}))}));this.eventListener.addEventListener("destroy",r),i.append(...o.map((e=>e.container))),e.append(i)}return Promise.all(i)}}var Ve=i(2010),Ke=i(1447),We=i(534),$e=i(4484),qe=i(1507),Ye=i(2914),Qe=i(2648),Xe=i(1655),Je=i(3186),et=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class tt extends l._{constructor(){super(...arguments),this.filtersRendered={}}static getInitArgs(){return{animationData:Ke.Z.loadAnimationFromURLManually("Folders_1"),filters:n.Z.managers.filtersStorage.getDialogFilters()}}renderFolder(e,t,i,s){return et(this,void 0,void 0,(function*(){let n,a="";const o=[];if("dialogFilterSuggested"===e._)n=e.filter,a=e.description;else{if(n=e,1===Object.keys(n.pFlags).length){const e=n.pFlags;let t;e.contacts?t="FilterAllContacts":e.non_contacts?t="FilterAllNonContacts":e.groups?t="FilterAllGroups":e.broadcasts?t="FilterAllChannels":e.bots&&(t="FilterAllBots"),t&&o.push((0,f.ag)(t))}if(!o.length){const e=yield this.managers.dialogsStorage.getFolderDialogs(n.id);let t=0,i=0,s=0;yield Promise.all(e.map((e=>et(this,void 0,void 0,(function*(){(yield this.managers.appPeersManager.isAnyGroup(e.peerId))?s++:(yield this.managers.appPeersManager.isBroadcast(e.peerId))?i++:t++}))))),t&&o.push((0,f.ag)("Chats",[t])),i&&o.push((0,f.ag)("Channels",[i])),s&&o.push((0,f.ag)("Groups",[s]))}}if(i)n.id!==qe.J$&&(0,P.Z)(i.title,(0,Y.Z)(n.title)),i.subtitle.textContent="",i.subtitle.append(...(0,f.v_)(o));else if(i=new Z.ZP({title:n.id===qe.J$?(0,f.ag)("FilterAllChats"):(0,Y.Z)(n.title),subtitle:a,clickable:!0,buttonRightLangKey:"dialogFilterSuggested"===e._?"Add":void 0}),o.length&&i.subtitle.append(...(0,f.v_)(o)),"dialogFilter"===e._){const e=n.id;if(!this.filtersRendered[n.id]&&n.id!==qe.J$){const t=We.Z.getInitArgs();(0,v.fc)(i.container,(()=>et(this,void 0,void 0,(function*(){const i=yield this.managers.filtersStorage.getFilter(e),s=this.slider.createTab(We.Z);s.setInitFilter(i),s.open(t)}))),{listenerSetter:this.listenerSetter})}this.filtersRendered[n.id]=i,i.makeSortable()}const r=i.container;if(s){const e=n.localId;void 0!==e?(0,$e.Z)(r,r.parentElement||t,e):t&&t.append(r)}return i}))}init(e=tt.getInitArgs()){this.container.classList.add("chat-folders-container"),this.setTitle("ChatList.Filter.List.Title"),this.scrollable.container.classList.add("chat-folders"),this.stickerContainer=document.createElement("div"),this.stickerContainer.classList.add("sticker-container");const t=document.createElement("div");t.classList.add("caption"),(0,f.XZ)({element:t,key:"ChatList.Filter.Header"}),this.createFolderBtn=(0,I.Z)("btn-primary btn-color-primary btn-control tgico",{text:"ChatList.Filter.NewTitle",icon:"add"}),this.foldersSection=new b.Z({name:"Filters"}),this.foldersSection.container.classList.add("hide"),this.list=document.createElement("div"),this.foldersSection.content.append(this.list),this.suggestedSection=new b.Z({name:"FilterRecommended"}),this.suggestedSection.container.classList.add("hide"),this.scrollable.append(this.stickerContainer,t,this.createFolderBtn,this.foldersSection.container,this.suggestedSection.container),(0,v.fc)(this.createFolderBtn,(()=>et(this,void 0,void 0,(function*(){(yield this.canCreateFolder())?this.slider.createTab(We.Z).open():(0,Je.Z)("folders")}))),{listenerSetter:this.listenerSetter});const i=()=>{this.foldersSection.container.classList.toggle("hide",!Object.keys(this.filtersRendered).length)},s=[],a=e.filters.then((e=>et(this,void 0,void 0,(function*(){for(const t of e)t.id!==qe.Zi&&(yield this.renderFolder(t,this.list,void 0,!0));this.toggleAllChats(),i()}))));return s.push(a),this.listenerSetter.add(n.Z)("filter_update",(e=>et(this,void 0,void 0,(function*(){const t=this.filtersRendered[e.id];t?yield this.renderFolder(e,null,t):e.id!==qe.Zi&&(yield this.renderFolder(e,this.list,void 0,!0)),i(),this.getSuggestedFilters()})))),this.listenerSetter.add(n.Z)("filter_delete",(e=>{const t=this.filtersRendered[e.id];t&&(this.getSuggestedFilters(),t.container.remove(),delete this.filtersRendered[e.id]),i()})),this.listenerSetter.add(n.Z)("filter_order",(e=>{e.filter((e=>!!this.filtersRendered[e])).forEach(((e,t)=>{const i=this.filtersRendered[e].container;(0,$e.Z)(i,i.parentElement,t+1)}))})),this.listenerSetter.add(n.Z)("premium_toggle",(()=>{this.toggleAllChats()})),this.loadAnimationPromise=e.animationData.then((e=>et(this,void 0,void 0,(function*(){const t=yield e({container:this.stickerContainer,loop:!1,autoplay:!1,width:86,height:86});return this.animation=t,Ke.Z.waitForFirstFrame(t)})))),s.push(this.loadAnimationPromise),new Ye.Z({list:this.list,middleware:this.middlewareHelper.get(),onSort:(e,t)=>{let i=[];for(const e in this.filtersRendered){const t=this.filtersRendered[e];i[(0,Qe.Z)(t.container)]=+e}i=i.filter((e=>void 0!==e)),n.Z.premium||(0,Xe.Z)(i,qe.J$),this.managers.filtersStorage.updateDialogFiltersOrder(i)},scrollable:this.scrollable}),this.getSuggestedFilters(),Promise.all(s)}onOpenAfterTimeout(){return this.loadAnimationPromise.then((()=>{this.animation.autoplay=!0,this.animation.play()})),super.onOpenAfterTimeout()}toggleAllChats(){this.filtersRendered[qe.J$].container.classList.toggle("hide",!n.Z.premium)}canCreateFolder(){return et(this,void 0,void 0,(function*(){const[e,t]=yield Promise.all([this.managers.apiManager.getLimit("folders"),this.managers.filtersStorage.getDialogFilters()]);return t.filter((e=>!qe.DZ.has(e.id))).lengthet(this,void 0,void 0,(function*(){this.suggestedSection.container.classList.toggle("hide",!e.length),Array.from(this.suggestedSection.content.children).slice(1).forEach((e=>e.remove()));for(const t of e){const e=yield this.renderFolder(t);this.suggestedSection.content.append(e.container);const i=e.buttonRight;(0,v.fc)(i,(s=>et(this,void 0,void 0,(function*(){if((0,K.Z)(s),!(yield this.canCreateFolder()))return void(0,Je.Z)("folders");i.setAttribute("disabled","true");const n=t.filter;n.includePeerIds=[],n.excludePeerIds=[],n.pinnedPeerIds=[],this.managers.filtersStorage.createDialogFilter(n,!0).then((()=>{e.container.remove(),this.suggestedSection.container.classList.toggle("hide",1===this.suggestedSection.content.childElementCount)})).finally((()=>{i.removeAttribute("disabled")}))}))),{listenerSetter:this.listenerSetter})}}))))}}var it=i(8479),st=i(3855),nt=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class at extends M.h{init(){this.container.classList.add("notifications-container"),this.setTitle("Telegram.NotificationSettingsViewController");const e=e=>{const t=new b.Z({name:e.name}),i=new Z.ZP({checkboxField:new Ce.Z({text:e.typeText,checked:!0}),subtitleLangKey:"Loading",listenerSetter:this.listenerSetter,withCheckboxSubtitle:!0}),s=new Z.ZP({checkboxField:new Ce.Z({text:"MessagePreview",checked:!0}),subtitleLangKey:"Loading",listenerSetter:this.listenerSetter,withCheckboxSubtitle:!0});t.content.append(i.container,s.container),this.scrollable.append(t.container);const a={_:e.inputKey},o=this.managers.appNotificationsManager.getNotifySettings(a);(o instanceof Promise?o:Promise.resolve(o)).then((t=>{const o=()=>nt(this,void 0,void 0,(function*(){const e=yield this.managers.appNotificationsManager.isMuted(t);return i.checkboxField.checked=!e,s.checkboxField.checked=t.show_previews,e}));o(),this.eventListener.addEventListener("destroy",(()=>nt(this,void 0,void 0,(function*(){const e=!i.checkboxField.checked,n=s.checkboxField.checked;if(e===(yield this.managers.appNotificationsManager.isMuted(t))&&n===t.show_previews)return;const o=(0,it.Z)(t);o._="inputPeerNotifySettings",o.mute_until=e?qe.rU:0,o.show_previews=n,delete o.flags,this.managers.appNotificationsManager.updateNotifySettings(a,o)}))),{once:!0}),this.listenerSetter.add(n.Z)("notify_settings",(i=>{const s=Le(i.peer._);e.inputKey===s&&(t=i.notify_settings,o())}))}))};e({name:"NotificationsPrivateChats",typeText:"NotificationsForPrivateChats",inputKey:"inputNotifyUsers"}),e({name:"NotificationsGroups",typeText:"NotificationsForGroups",inputKey:"inputNotifyChats"}),e({name:"NotificationsChannels",typeText:"NotificationsForChannels",inputKey:"inputNotifyBroadcasts"});{const e=new b.Z({name:"NotificationsOther"}),t=new Z.ZP({checkboxField:new Ce.Z({text:"ContactJoined",checked:!0}),subtitleLangKey:"Loading",listenerSetter:this.listenerSetter,withCheckboxSubtitle:!0}),i=new Z.ZP({checkboxField:new Ce.Z({text:"Notifications.Sound",checked:!0,stateKey:"settings.notifications.sound",listenerSetter:this.listenerSetter}),subtitleLangKey:"Loading",listenerSetter:this.listenerSetter,withCheckboxSubtitle:!0});st.Z.getState().then((e=>{i.checkboxField.checked=e.settings.notifications.sound})),e.content.append(t.container,i.container),this.scrollable.append(e.container),this.managers.appNotificationsManager.getContactSignUpNotification().then((e=>{t.checkboxField.checked=e,this.eventListener.addEventListener("destroy",(()=>{const i=t.checkboxField.checked;e!==i&&this.managers.appNotificationsManager.setContactSignUpNotification(!i)}),{once:!0})}))}}}class ot extends l._{static getInitArgs(){return{languages1:n.Z.managers.apiManager.invokeApiCacheable("langpack.getLanguages",{lang_pack:"web"}),languages2:Promise.resolve([])}}init(e){this.header.classList.add("with-border"),this.container.classList.add("language-container"),this.setTitle("Telegram.LanguageViewController");const t=new b.Z({}),i=new Map,s=Promise.all([e.languages1,e.languages2]).then((([e,s])=>{const n=new Set,a=e.map((e=>e.lang_code)),o=(0,T.a)();e.concat(s).forEach((e=>{if(n.has(e.lang_code))return;n.add(e.lang_code);const t=new Z.ZP({radioField:new A.Z({text:e.name,name:o,value:e.lang_code}),subtitle:e.native_name});i.set(e.lang_code,t)}));const r=(0,Z.De)([...i.values()],(e=>{f.ZP.getLangPack(e,a.includes(e))}));f.ZP.getCacheLangPack().then((e=>{const t=i.get(e.lang_code);t?t.radioField.setValueSilently(!0):console.error("no row",t,e)})),t.content.append(r)}));return this.scrollable.append(t.container),s}}var rt=i(4081),dt=i(6848),lt=i(5701);function ct(e,t,i){const s=new b.Z({name:t}),n="settings.autoDownload."+e+".",a=new Ce.Z({text:"AutodownloadContacts",name:"contacts",stateKey:n+"contacts",listenerSetter:i}),o=new Ce.Z({text:"AutodownloadPrivateChats",name:"private",stateKey:n+"private",listenerSetter:i}),r=new Ce.Z({text:"AutodownloadGroupChats",name:"groups",stateKey:n+"groups",listenerSetter:i}),d=new Ce.Z({text:"AutodownloadChannels",name:"channels",stateKey:n+"channels",listenerSetter:i});return s.content.append((0,Z.tG)(a).container,(0,Z.tG)(o).container,(0,Z.tG)(r).container,(0,Z.tG)(d).container),s}class ht extends M.h{init(){this.setTitle("AutoDownloadPhotos");const e=ct("photo","AutoDownloadPhotosTitle",this.listenerSetter);this.scrollable.append(e.container)}}class ut extends M.h{init(){this.setTitle("AutoDownloadFiles");const e=(0,lt.Z)((e=>{this.managers.appStateManager.setByKey("settings.autoDownloadNew.file_size_max",e)}),200,!1,!0),t=ct("file","AutoDownloadFilesTitle",this.listenerSetter),i=524288,s=20447232,a=n.Z.settings.autoDownloadNew.file_size_max,o=Math.sqrt(Math.sqrt((a-i)/s)),r=new f.ZP.IntlElement({key:"AutodownloadSizeLimitUpTo",args:[(0,rt.Z)(a)]}),d=new je("AutoDownloadMaxFileSize",.01,o,0,1,!1);d.onChange=t=>{const n=Math.pow(t,4)*s+i|0;r.compareAndUpdate({args:[(0,rt.Z)(n)]}),e(n)},d.valueContainer.append(r.element),t.content.append(d.container),this.scrollable.append(t.container)}}class pt extends M.h{init(){this.setTitle("AutoDownloadVideos");const e=ct("video","AutoDownloadVideosTitle",this.listenerSetter);this.scrollable.append(e.container)}}const ft={contacts:"AutoDownloadContacts",private:"AutoDownloadPm",groups:"AutoDownloadGroups",channels:"AutoDownloadChannels"};class mt extends M.h{init(){this.setTitle("DataSettings");{const e=new b.Z({name:"AutomaticMediaDownload",caption:"AutoDownloadAudioInfo"}),t=new Ce.Z({text:"AutoDownloadMedia",name:"auto",checked:!n.Z.settings.autoDownloadNew.pFlags.disabled,listenerSetter:this.listenerSetter}),i=new Z.ZP({checkboxField:t,listenerSetter:this.listenerSetter}),s=()=>{(0,G.Z)([c],(0,dt.Z)(n.Z.settings.autoDownload,De.h.settings.autoDownload)&&(0,dt.Z)(n.Z.settings.autoDownloadNew,De.h.settings.autoDownloadNew))},a=()=>{this.setAutoDownloadSubtitle(r,n.Z.settings.autoDownload.photo),this.setAutoDownloadSubtitle(d,n.Z.settings.autoDownload.video),this.setAutoDownloadSubtitle(l,n.Z.settings.autoDownload.file,n.Z.settings.autoDownloadNew.file_size_max)},o=e=>{const t=this.slider.createTab(e);t.open(),this.listenerSetter.add(t.eventListener)("destroy",(()=>{a(),s()}),{once:!0})},r=new Z.ZP({titleLangKey:"AutoDownloadPhotos",subtitle:"",clickable:()=>{o(ht)},listenerSetter:this.listenerSetter}),d=new Z.ZP({titleLangKey:"AutoDownloadVideos",subtitle:"",clickable:()=>{o(pt)},listenerSetter:this.listenerSetter}),l=new Z.ZP({titleLangKey:"AutoDownloadFiles",subtitle:"",clickable:()=>{o(ut)},listenerSetter:this.listenerSetter}),c=(0,I.Z)("btn-primary btn-transparent primary",{icon:"delete",text:"ResetAutomaticMediaDownload"});(0,v.fc)(c,(()=>{(0,Ee.Z)({titleLangKey:"ResetAutomaticMediaDownloadAlertTitle",descriptionLangKey:"ResetAutomaticMediaDownloadAlert",button:{langKey:"Reset"}}).then((()=>{const e=n.Z.settings;e.autoDownloadNew=(0,it.Z)(De.h.settings.autoDownloadNew),e.autoDownload=(0,it.Z)(De.h.settings.autoDownload),n.Z.settings=e,this.managers.appStateManager.setByKey("settings",e),a(),t.checked=!n.Z.settings.autoDownloadNew.pFlags.disabled}))}));const h=()=>{const e=!t.checked,i=n.Z.settings.autoDownloadNew;e?i.pFlags.disabled=!0:delete i.pFlags.disabled,[r,d,l].forEach((t=>{t.container.classList.toggle("is-disabled",e)})),this.managers.appStateManager.setByKey("settings.autoDownloadNew",i),s()};t.input.addEventListener("change",h),h(),a(),e.content.append(i.container,r.container,d.container,l.container,c),this.scrollable.append(e.container)}}setAutoDownloadSubtitle(e,t,i){let s;const n=[],a=Object.keys(t),o=a.map((e=>t[e]?ft[e]:void 0)).filter(Boolean);if(o.length&&0!==i){const e=o.length===a.length;if(void 0!==i?(s=e?"AutoDownloadUpToOnAllChats":"AutoDownloadOnUpToFor",n.push((0,rt.Z)(i))):s=e?"AutoDownloadOnAllChats":"AutoDownloadOnFor",!e){const e=document.createElement("span");e.append(...(0,f.v_)(o.map((e=>(0,f.ag)(e))),!0,!1)),n.push(e)}}else s="AutoDownloadOff";(0,P.Z)(e.subtitle,(0,f.ag)(s,n))}}var gt=i(2230),vt=i(8261),bt=i(6765),yt=i(1168),wt=i(8938),St=i(4531),Ct=i(2153),Lt=i(9298),Et=i(1273),It=i(62);class Mt extends M.Z{init(){return this.setTitle("DoubleTapSetting"),this.container.classList.add("quick-reaction-container"),Promise.all([this.managers.appReactionsManager.getQuickReaction(),this.managers.appReactionsManager.getAvailableReactions()]).then((([e,t])=>{t=t.filter((e=>!e.pFlags.inactive));const i=new b.Z,s=t.map((t=>{const i=new A.Z({name:"quick-reaction",text:t.title,value:t.reaction,alignRight:!0}),s=new Z.ZP({radioField:i,havePadding:!0});return i.main.classList.add("quick-reaction-title"),(0,It.Z)({row:s,doc:t.static_icon,size:"small"}),t.reaction===e.reaction&&i.setValueSilently(!0),s})),n=(0,Z.De)(s,(e=>{this.managers.appReactionsManager.setDefaultReaction({_:"reactionEmoji",emoticon:e})}));i.content.append(n),this.scrollable.append(i.container)}))}}class Zt extends M.Z{static getInitArgs(){return{allStickers:n.Z.managers.appStickersManager.getAllStickers(),quickReaction:n.Z.managers.appReactionsManager.getQuickReaction()}}init(e){this.container.classList.add("stickers-emoji-container"),this.setTitle("StickersName");const t=[];{const t=new b.Z({caption:"LoopAnimatedStickersInfo"}),i=new Z.ZP({icon:"lamp",titleLangKey:"Stickers.SuggestStickers",clickable:!0,listenerSetter:this.listenerSetter,titleRightSecondary:!0}),s={all:"SuggestStickersAll",installed:"SuggestStickersInstalled",none:"SuggestStickersNone"},a=()=>{i.titleRight.replaceChildren((0,f.ag)(s[n.Z.settings.stickers.suggest]))};a();const o=e=>{if(n.Z.settings.stickers.suggest!==e)return n.Z.settings.stickers.suggest=e,a(),this.managers.appStateManager.setByKey("settings.stickers.suggest",e)};(0,St.Z)({buttons:[{icon:"stickers_face",text:"SuggestStickersAll",onClick:o.bind(this,"all")},{icon:"newprivate",text:"SuggestStickersInstalled",onClick:o.bind(this,"installed")},{icon:"stop",text:"SuggestStickersNone",onClick:o.bind(this,"none")}],listenTo:i.container,middleware:this.middlewareHelper.get(),listenForClick:!0});const r=new Z.ZP({titleLangKey:"DoubleTapSetting",havePadding:!0,clickable:()=>{this.slider.createTab(Mt).open()},listenerSetter:this.listenerSetter}),d=()=>{e.quickReaction.then((e=>"availableReaction"===e._?e.static_icon:this.managers.appEmojiManager.getCustomEmojiDocument(e.document_id))).then((e=>{(0,It.Z)({row:r,doc:e,size:"small"})}))};d(),this.listenerSetter.add(n.Z)("quick_reaction",(()=>{e=Zt.getInitArgs(),d()}));const l=new Z.ZP({icon:"flip",titleLangKey:"InstalledStickers.LoopAnimated",checkboxField:new Ce.Z({name:"loop",stateKey:"settings.stickers.loop",listenerSetter:this.listenerSetter,toggle:!0}),listenerSetter:this.listenerSetter});t.content.append(r.container,i.container,l.container),this.scrollable.append(t.container)}{const e=new b.Z({name:"Emoji"}),t=new Z.ZP({icon:"lamp",titleLangKey:"GeneralSettings.EmojiPrediction",checkboxField:new Ce.Z({name:"suggest-emoji",stateKey:"settings.emoji.suggest",listenerSetter:this.listenerSetter,toggle:!0}),listenerSetter:this.listenerSetter}),i=new Z.ZP({icon:"smile",titleLangKey:"GeneralSettings.BigEmoji",checkboxField:new Ce.Z({name:"emoji-big",stateKey:"settings.emoji.big",listenerSetter:this.listenerSetter,toggle:!0}),listenerSetter:this.listenerSetter});e.content.append(t.container,i.container),this.scrollable.append(e.container)}{const e=new b.Z({name:"DynamicPackOrder",caption:"DynamicPackOrderInfo"}),t=new Z.ZP({titleLangKey:"DynamicPackOrder",checkboxField:new Ce.Z({name:"dynamic-pack-order",stateKey:"settings.stickers.dynamicPackOrder",listenerSetter:this.listenerSetter,toggle:!0}),listenerSetter:this.listenerSetter});e.content.append(t.container),this.scrollable.append(e.container)}{const i=new b.Z({name:"Telegram.InstalledStickerPacksController",caption:"StickersBotInfo"}),s={},a=i.generateContentElement(),o=new Ct.Z,r=(e,t="append")=>{const i=new Z.ZP({title:(0,Y.Z)(e.title),subtitleLangKey:"Stickers",subtitleLangArgs:[e.count],havePadding:!0,clickable:()=>{new Lt.Z({id:e.id,access_hash:e.access_hash}).show()},listenerSetter:this.listenerSetter});i.container.dataset.id=""+e.id,i.makeSortable(),s[e.id]=i;const n=document.createElement("div");n.classList.add("row-media"),(0,Et.Z)({set:e,container:n,group:"GENERAL-SETTINGS",lazyLoadQueue:o,width:36,height:36,autoplay:!0,middleware:this.middlewareHelper.get()}),i.container.append(n),a[t](i.container)},d=e.allStickers.then((e=>{(0,wt.Z)(e);const t=e.sets.map((e=>r(e)));return Promise.all(t)}));t.push(d),this.listenerSetter.add(n.Z)("stickers_installed",(e=>{s[e.id]||r(e,"prepend")})),this.listenerSetter.add(n.Z)("stickers_deleted",(e=>{s[e.id]&&(s[e.id].container.remove(),delete s[e.id])})),this.listenerSetter.add(n.Z)("stickers_order",(({type:e,order:t})=>{"stickers"===e&&t.forEach(((e,t)=>{const i=s[e];i&&(0,$e.Z)(i.container,a,t)}))})),this.listenerSetter.add(n.Z)("stickers_top",(e=>{const t=s[e];t&&(0,$e.Z)(t.container,a,0)})),new Ye.Z({list:a,middleware:this.middlewareHelper.get(),onSort:(e,t)=>{const i=Array.from(a.children).map((e=>e.dataset.id));this.managers.appStickersManager.reorderStickerSets(i)}}),this.scrollable.append(i.container)}return Promise.all(t)}}var Pt=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class Tt extends l._{constructor(){super(...arguments),this.buttons={}}init(){return Pt(this,void 0,void 0,(function*(){this.container.classList.add("settings-container"),this.setTitle("Settings");const e=(0,E.Z)({listenerSetter:this.listenerSetter,direction:"bottom-left",buttons:[{icon:"logout",text:"EditAccount.Logout",onClick:()=>{new B.Z("logout",{titleLangKey:"LogOut",descriptionLangKey:"LogOut.Description",buttons:[{langKey:"LogOut",callback:()=>{this.managers.apiManager.logOut()},isDanger:!0}]}).show()}}]});this.buttons.edit=(0,gt.Z)("edit"),this.header.append(this.buttons.edit,e),this.profile=new vt.Z(this.managers,this.scrollable,this.listenerSetter,!1),this.profile.init(),this.profile.setPeer(n.Z.myId);const t=this.profile.fillProfileElements(),i=(0,I.Z)("btn-circle btn-corner z-depth-1 profile-change-avatar",{icon:"cameraadd"});(0,v.fc)(i,(()=>{const e=document.createElement("canvas");yt.Z.createPopup(bt.Z).open(e,(e=>{e().then((e=>this.managers.appProfileManager.uploadProfilePhoto(e)))}))}),{listenerSetter:this.listenerSetter}),this.profile.element.lastElementChild.firstElementChild.append(i);const s=()=>Pt(this,void 0,void 0,(function*(){var e;const t=yield this.managers.appUsersManager.getSelf();i.classList.toggle("hide","userProfilePhoto"!==(null===(e=t.photo)||void 0===e?void 0:e._))}));s(),this.listenerSetter.add(n.Z)("avatar_update",(({peerId:e})=>{n.Z.myId===e&&s()}));const a=document.createElement("div");a.classList.add("profile-buttons");const o=(e,t,i,s)=>{if(!s){const e=i.getInitArgs;e&&(s=()=>[e(this)])}return{icon:e,text:t,tabConstructor:i,getInitArgs:s,args:null==s?void 0:s()}},r=[o("unmute","AccountSettings.Notifications",at),o("data","DataSettings",mt),o("lock","AccountSettings.PrivacyAndSecurity",ke),o("settings","Telegram.GeneralSettingsViewController",Ge),o("folder","AccountSettings.Filters",tt),o("stickers_face","StickersName",Zt)].map((e=>{const{icon:t,text:i,tabConstructor:s,getInitArgs:n}=e;return new Z.ZP({titleLangKey:i,icon:t,clickable:()=>Pt(this,void 0,void 0,(function*(){const t=e.args?yield e.args:[],i=this.slider.createTab(s);i.open(...t),i instanceof M.h&&n&&i.eventListener.addEventListener("destroyAfter",(t=>{e.args=t.then((()=>n()))}))})),listenerSetter:this.listenerSetter})})),d=ot.getInitArgs();r.push(this.devicesRow=new Z.ZP({titleLangKey:"Devices",titleRightSecondary:" ",icon:"activesessions",clickable:()=>Pt(this,void 0,void 0,(function*(){this.authorizations||(yield this.updateActiveSessions());const e=this.slider.createTab(ge);e.authorizations=this.authorizations,e.eventListener.addEventListener("destroy",(()=>{this.authorizations=void 0,this.updateActiveSessions(!0)}),{once:!0}),e.open()})),listenerSetter:this.listenerSetter}),this.languageRow=new Z.ZP({titleLangKey:"AccountSettings.Language",titleRightSecondary:(0,f.ag)("LanguageName"),icon:"language",clickable:()=>{this.slider.createTab(ot).open(d)},listenerSetter:this.listenerSetter})),a.append(...r.map((e=>e.container)));const l=new b.Z;l.content.append(a),this.scrollable.append(this.profile.element,l.container);const c=()=>{h=Ve.Z.getInitArgs()};let h;(0,v.fc)(this.buttons.edit,(()=>{this.slider.createTab(Ve.Z).open(h)}),{listenerSetter:this.listenerSetter}),c(),this.listenerSetter.add(n.Z)("user_update",(e=>{n.Z.myId.toUserId()===e&&c()})),Ke.Z.loadLottieWorkers(),this.updateActiveSessions(),(yield t)()}))}getAuthorizations(e){if(this.getAuthorizationsPromise&&!e)return this.getAuthorizationsPromise;const t=this.getAuthorizationsPromise=this.managers.apiManager.invokeApi("account.getAuthorizations").finally((()=>{this.getAuthorizationsPromise===t&&(this.getAuthorizationsPromise=void 0)}));return t}updateActiveSessions(e){return this.getAuthorizations(e).then((e=>{this.authorizations=e.authorizations,this.devicesRow.titleRight.textContent=""+this.authorizations.length}))}onCloseAfterTimeout(){return this.profile.destroy(),super.onCloseAfterTimeout()}}class kt extends l._{constructor(){super(...arguments),this.uploadAvatar=null}init(){this.container.classList.add("new-channel-container"),this.setTitle("NewChannel"),this.avatarEdit=new p.Z((e=>{this.uploadAvatar=e}));const e=new b.Z({caption:"Channel.DescriptionHolderDescrpiton"}),t=document.createElement("div");t.classList.add("input-wrapper"),this.channelNameInputField=new u.ZP({label:"EnterChannelName",maxLength:128}),this.channelDescriptionInputField=new u.ZP({label:"DescriptionOptionalPlaceholder",maxLength:255}),t.append(this.channelNameInputField.container,this.channelDescriptionInputField.container);const i=()=>{this.nextBtn.classList.toggle("is-visible",!!this.channelNameInputField.value.length&&!this.channelNameInputField.input.classList.contains("error")&&!this.channelDescriptionInputField.input.classList.contains("error"))};this.channelNameInputField.input.addEventListener("input",i),this.channelDescriptionInputField.input.addEventListener("input",i),this.nextBtn=(0,m.Z)({icon:"arrow_next"}),(0,v.fc)(this.nextBtn,(()=>{const e=this.channelNameInputField.value,t=this.channelDescriptionInputField.value;this.nextBtn.disabled=!0,this.managers.appChatsManager.createChannel({title:e,about:t,broadcast:!0}).then((e=>{this.uploadAvatar&&this.uploadAvatar().then((t=>{this.managers.appChatsManager.editPhoto(e,t)})),s.ZP.setInnerPeer({peerId:e.toPeerId(!0)}),ei.removeTabFromHistory(this),this.slider.createTab(_.Z).open({type:"channel",skippable:!0,title:"GroupAddMembers",placeholder:"SendMessageTo",takeOut:t=>this.managers.appChatsManager.inviteToChannel(e,t)})}))}),{listenerSetter:this.listenerSetter}),this.content.append(this.nextBtn),e.content.append(this.avatarEdit.container,t),this.scrollable.append(e.container)}onCloseAfterTimeout(){return this.avatarEdit.clear(),this.uploadAvatar=null,this.channelNameInputField.value="",this.channelDescriptionInputField.value="",this.nextBtn.disabled=!1,super.onCloseAfterTimeout()}}var xt=i(241),At=i(2621),_t=i(709),Ft=i(6272);class Dt extends yt.Z{constructor(){super("popup-create-contact popup-send-photo popup-new-media",{closable:!0,withConfirm:"Add",title:"AddContactTitle"}),this.construct()}construct(){return e=this,t=void 0,s=function*(){(0,v.fc)(this.btnConfirm,(()=>{const e=this.managers.appUsersManager.importContact(i.value,s.value,n.value);e.then((()=>{this.hide()}),(e=>{"NO_USER"===e.type&&((0,ee.bC)({langPackKey:"Contacts.PhoneNumber.NotRegistred"}),d.disabled=!1)})),d.lockWithPromise(e)}),{listenerSetter:this.listenerSetter});const e=[],t=document.createElement("div");t.classList.add("name-fields");const i=new u.ZP({label:"FirstName",name:"create-contact-name",maxLength:70,required:!0}),s=new u.ZP({label:"LastName",name:"create-contact-lastname",maxLength:70}),n=new _t.Z({required:!0});e.push(i,s,n);const a=()=>{const e=i.value+" "+s.value;d.avatarElem.peerTitle=e,d.avatarElem.update()};this.listenerSetter.add(i.input)("input",a),this.listenerSetter.add(s.input)("input",a),n.validate=()=>!!n.value.match(/\d/);const o=yield this.managers.appUsersManager.getSelf(),r=(0,Ft.u)(o.phone);r.code&&(n.value="+"+r.code.country_code);const d=new At.Z({inputFields:e,listenerSetter:this.listenerSetter,doNotEditAvatar:!0,nextBtn:this.btnConfirm,avatarSize:100});t.append(i.container,s.container,d.avatarElem),this.container.append(t,n.container),this.show()},new((i=void 0)||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}));var e,t,i,s}}var Rt=i(2894),Bt=i(3624);class Nt extends l._{init(){this.container.id="contacts-container";const e=(0,m.Z)({icon:"add",className:"is-visible"});this.content.append(e),(0,v.fc)(e,(()=>{yt.Z.createPopup(Dt)}),{listenerSetter:this.listenerSetter}),this.inputSearch=new d.Z("Search",(e=>{this.openContacts(e)})),this.listenerSetter.add(n.Z)("contacts_update",(e=>{return t=this,i=void 0,n=function*(){const t=yield this.managers.appUsersManager.isContact(e),i=e.toPeerId();t?this.sortedUserList.add(i):this.sortedUserList.delete(i)},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n})),this.title.replaceWith(this.inputSearch.container),this.middleware=(0,Bt.k)(),this.openContacts()}createList(){const e=new Rt.Z({managers:this.managers}),t=e.list;return t.id="contacts",t.classList.add("contacts-container"),h.default.setListClickListener(t,(()=>{this.close()}),void 0,!0),e}onClose(){this.middleware.clean()}onOpenAfterTimeout(){!z.IS_MOBILE&&j(!0)&&this.inputSearch.input.focus()}openContacts(e){this.middleware.clean();const t=this.middleware.get();this.scrollable.onScrolledBottom=null,this.scrollable.container.textContent="",this.managers.appUsersManager.getContactsPeerIds(e,void 0,"online").then((e=>{if(!t())return;const i=this.sortedUserList=this.createList();let s=()=>{const t=xt.Z.height/56*1.25|0;e.splice(0,t).forEach((e=>{i.add(e)})),e.length||(s=void 0,this.scrollable.onScrolledBottom=null)};s(),this.scrollable.onScrolledBottom=()=>{s?s():this.scrollable.onScrolledBottom=null},(0,P.Z)(this.scrollable.container,i.list)}))}}class Ot extends l._{init(){if(this.wasFilterId=h.default.filterId,this.container.id="chats-archived-container",this.setTitle("ArchivedChats"),this.header.classList.add("can-have-forum"),this.content.classList.add("can-have-forum"),!h.default.xds[Ot.filterId]){const{ul:e,scrollable:t}=h.default.l({title:void 0,id:Ot.filterId,localId:qe.Zi});t.container.append(e)}const e=h.default.xds[Ot.filterId].scrollable;return this.scrollable.container.replaceWith(e.container),e.attachBorderListeners(this.container),h.default.setFilterIdAndChangeTab(Ot.filterId).then((({cached:e,renderPromise:t})=>{if(e)return t}))}onOpenAfterTimeout(){h.default.xds[this.wasFilterId].clear()}onClose(){this.scrollable.onAdditionalScroll=void 0,h.default.setFilterIdAndChangeTab(this.wasFilterId)}onCloseAfterTimeout(){return h.default.xds[Ot.filterId].clear(),super.onCloseAfterTimeout()}}Ot.filterId=qe.Zi;class Ut extends l._{constructor(){super(...arguments),this.isLocationWatched=!1}parseDistance(e){return"miles"===n.Z.settings.distanceUnit?e>1609.34?(0,f.ag)("MilesAway",[Math.round(e/1609)]):(0,f.ag)("FootsAway",[Math.round(3.281*e)]):e>=1e3?(0,f.ag)("KMetersAway2",[e/1e3]):(0,f.ag)("MetersAway2",[e])}startWatching(){this.latestLocationSaved&&!this.isLocationWatched&&(this.isLocationWatched=!0,(0,ee.Am)("Your position is now being shared. Do not close the page or it will be suspended."),this.managers.appUsersManager.getLocated(this.latestLocationSaved.latitude,this.latestLocationSaved.longitude,this.latestLocationSaved.accuracy,!0,2147483647),navigator.geolocation.watchPosition((e=>{const t=e.coords.longitude!==this.latestLocationSaved.longitude,i=e.coords.latitude!==this.latestLocationSaved.latitude,s=this.calculateDistance(e.coords.latitude,e.coords.longitude,this.latestLocationSaved.latitude,this.latestLocationSaved.longitude)>100;(i||t)&&s&&(this.managers.appUsersManager.getLocated(e.coords.latitude,e.coords.longitude,e.coords.accuracy,!0,2147483647),this.latestLocationSaved={latitude:e.coords.latitude,longitude:e.coords.longitude,accuracy:e.coords.accuracy})})))}stopWatching(){this.isLocationWatched&&(this.isLocationWatched=!1,(0,ee.Am)("The sharing of your position has been stopped. You will no longer be visible to other users."),this.managers.appUsersManager.getLocated(0,0,0,!1,0))}calculateDistance(e,t,i,s){const n=.017453292519943295;return 12742*Math.asin(Math.sqrt(.5-Math.cos((i-e)*n)+Math.cos(e*n)*Math.cos(i*n)*(1-Math.cos((s-t)*n)/2)))}}var Ht=i(5824),zt=i(8842),jt=i(4159),Gt=i(7487),Vt=i(1405),Kt=i(2559),Wt=i(4755),$t=i(3035),qt=i(6472),Yt=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const Qt="is-left-column-shown";class Xt extends l.Z{constructor(){super({sidebarEl:document.getElementById("column-left"),navigationType:"left"}),this.searchGroups={}}construct(e){this.managers=e,this.inputSearch=new d.Z("Search");const t=this.sidebarEl.querySelector(".item-main .sidebar-header");t.append(this.inputSearch.container);const i=()=>{this.createTab(Nt).open()};this.backBtn=this.sidebarEl.querySelector(".sidebar-back-button");const a={icon:"archive",text:"ArchivedChats",onClick:()=>{this.createTab(Ot).open()},verify:()=>Yt(this,void 0,void 0,(function*(){return!!(yield this.managers.dialogsStorage.getFolderDialogs(qe.Zi,!1)).length||!(yield this.managers.dialogsStorage.isDialogsLoaded(qe.Zi))}))},o=new Ce.Z({toggle:!0,checked:"night"===Re.Z.getTheme().name});o.input.addEventListener("change",(()=>Yt(this,void 0,void 0,(function*(){Re.Z.switchTheme(o.input.checked?"night":"day")})))),n.Z.addEventListener("theme_change",(()=>{o.setValueSilently("night"===Re.Z.getTheme().name)}));const r=[{icon:"savedmessages",text:"SavedMessages",onClick:()=>{setTimeout((()=>{s.ZP.setPeer({peerId:s.ZP.myId})}),0)}},a,{icon:"user",text:"Contacts",onClick:i},Fe.Z?{icon:"group",text:"PeopleNearby",onClick:()=>{this.createTab(Ut).open()}}:void 0,{icon:"settings",text:"Settings",onClick:()=>{this.createTab(Tt).open()}},{icon:"darkmode",text:"DarkMode",onClick:()=>{},checkboxField:o},{icon:"animations",text:"Animations",onClick:()=>{},checkboxField:new Ce.Z({toggle:!0,checked:!0,stateKey:"settings.liteMode.animations",stateValueReverse:!0}),verify:()=>!Be.Z.isEnabled()},{icon:"animations",text:"LiteMode.Title",onClick:()=>{this.createTab(He).open()},verify:()=>Be.Z.isEnabled()},{icon:"help",text:"TelegramFeatures",onClick:()=>{const e=f.ZP.format("TelegramFeaturesUrl",!0);s.ZP.openUrl(e)}},{icon:"bug",text:"ReportBug",onClick:()=>{const e=document.createElement("a");e.target="_blank",e.href="https://bugs.telegram.org/?tag_ids=40&sort=time",document.body.append(e),e.click(),setTimeout((()=>{e.remove()}),0)}},{icon:"char z",text:"ChatList.Menu.SwitchTo.Z",onClick:()=>{Promise.all([Gt.Z.set({kz_version:"Z"}),Gt.Z.delete("tgme_sync")]).then((()=>{location.href="https://web.telegram.org/z/"}))},verify:()=>jt.Z.isMainDomain},{icon:"download",text:"PWA.Install",onClick:()=>{const e=(0,qt.B)();null==e||e()},verify:()=>!!(0,qt.B)()}].filter(Boolean);this.toolsBtn=(0,E.Z)({direction:"bottom-right",buttons:r,onOpen:(e,t)=>{var i;const s=document.createElement("a");s.href="https://github.com/morethanwords/tweb/blob/master/CHANGELOG.md",s.target="_blank",s.rel="noopener noreferrer",s.classList.add("btn-menu-footer"),s.addEventListener(v.pf,(e=>{e.stopPropagation(),me.Z.close()}));const n=document.createElement("span");n.classList.add("btn-menu-footer-text"),n.innerHTML="Telegram Web"+jt.Z.suffix+" "+jt.Z.versionFull,s.append(n),t.classList.add("has-footer"),t.append(s),null===(i=a.element)||void 0===i||i.append(this.archivedCount)}}),this.toolsBtn.classList.remove("tgico-more"),this.toolsBtn.classList.add("sidebar-tools-button","is-visible"),this.backBtn.parentElement.insertBefore(this.toolsBtn,this.backBtn),this.newBtnMenu=(0,E.Z)({direction:"top-left",buttons:[{icon:"newchannel",text:"NewChannel",onClick:()=>{this.createTab(kt).open()}},{icon:"newgroup",text:"NewGroup",onClick:()=>{this.createTab(_.Z).open({type:"chat",skippable:!0,takeOut:e=>this.createTab(y).open(e),title:"GroupAddMembers",placeholder:"SendMessageTo"})}},{icon:"newprivate",text:"NewPrivateChat",onClick:i}]}),this.newBtnMenu.className="btn-circle rp btn-corner z-depth-1 btn-menu-toggle animated-button-icon",this.newBtnMenu.insertAdjacentHTML("afterbegin",'\n \n \n '),this.newBtnMenu.id="new-menu",t.nextElementSibling.append(this.newBtnMenu),this.updateBtn=document.createElement("div"),this.updateBtn.className="btn-circle rp btn-corner z-depth-1 btn-update is-hidden",(0,Vt.Z)(this.updateBtn),this.updateBtn.append((0,f.ag)("Update")),(0,v.fc)(this.updateBtn,(()=>{this.updateBtn.classList.contains("is-hidden")||location.reload()})),t.nextElementSibling.append(this.updateBtn),this.inputSearch.input.addEventListener("focus",(()=>this.initSearch()),{once:!0}),this.archivedCount=document.createElement("span"),this.archivedCount.className="archived-count badge badge-24 badge-gray",n.Z.addEventListener("folder_unread",(e=>{if(e.id===qe.Zi){const t=e.unreadPeerIds.size;this.archivedCount.textContent=""+(0,Kt.Z)(t,1),this.archivedCount.classList.toggle("hide",!t)}})),this.managers.appUsersManager.getTopPeers("correspondents");const l={type:"global-search-focus",onPop:()=>(setTimeout((()=>{this.inputSearch.input.focus()}),0),!1),noHistory:!0};Ht.Z.pushItem(l),st.Z.getState().then((()=>{const e=setInterval((()=>{fetch("version",{cache:"no-cache"}).then((e=>200===e.status&&e.ok&&e.text()||Promise.reject())).then((t=>{t!==jt.Z.versionFull&&(this.hasUpdate=!0,clearInterval(e),this.newBtnMenu.classList.contains("is-hidden")||this.updateBtn.classList.remove("is-hidden"))})).catch(Ie.Z)}),18e5)}));const c=()=>{const e=this.rect=this.tabsContainer.getBoundingClientRect();document.documentElement.style.setProperty("--left-column-width",e.width+"px")};(0,$t.T2)(c),Wt.Z.addEventListener("resize",c)}initSearch(){const e=this.sidebarEl.querySelector("#search-container"),t=new r.ZP(e),i=()=>{(0,v.tH)(this.backBtn)};this.searchGroups={contacts:new a.z("SearchAllChatsShort","contacts",void 0,void 0,void 0,void 0,i),globalContacts:new a.z("GlobalSearch","contacts",void 0,void 0,void 0,void 0,i),messages:new a.z("SearchMessages","messages"),people:new a.z(!1,"contacts",!0,"search-group-people",!0,!1,i,!0),recent:new a.z("Recent","contacts",!0,"search-group-recent",!0,!0,i)};const s=this.searchSuper=new S.Z({mediaTabs:[{inputFilter:"inputMessagesFilterEmpty",name:"FilterChats",type:"chats"},{inputFilter:"inputMessagesFilterPhotoVideo",name:"SharedMediaTab2",type:"media"},{inputFilter:"inputMessagesFilterUrl",name:"SharedLinksTab2",type:"links"},{inputFilter:"inputMessagesFilterDocument",name:"SharedFilesTab2",type:"files"},{inputFilter:"inputMessagesFilterMusic",name:"SharedMusicTab2",type:"music"},{inputFilter:"inputMessagesFilterRoundVoice",name:"SharedVoiceTab2",type:"voice"}],scrollable:t,searchGroups:this.searchGroups,asChatList:!0,hideEmptyTabs:!1,showSender:!0,managers:this.managers});e.prepend(s.nav.parentElement.parentElement),t.container.append(s.container),s.setQuery({peerId:"".toPeerId(),folderId:0}),s.selectTab(0),s.load(!0);const n=[];let d="".toPeerId(),l=0,u=0;const p=()=>{this.inputSearch.container.classList.toggle("is-picked-twice",2===n.length),this.inputSearch.container.classList.toggle("is-picked",!!n.length),n.length?this.inputSearch.input.style.setProperty("--paddingLeft",n[n.length-1].getBoundingClientRect().right-this.inputSearch.input.getBoundingClientRect().left+"px"):this.inputSearch.input.style.removeProperty("--paddingLeft")},f=document.createElement("div");f.classList.add("search-helper"),f.addEventListener("click",(e=>{const t=(0,he.Z)(e.target,"selector-user");if(!t)return;const i=t.dataset.key;if(0===i.indexOf("date_")){const[e,t,s]=i.split("_");l=+t,u=+s}else d=i.toPeerId();t.addEventListener("click",(()=>{g(t)})),this.inputSearch.container.append(t),this.inputSearch.onChange(this.inputSearch.value=""),n.push(t),p()})),s.nav.parentElement.append(f);const m=(e,t)=>{const i=document.createElement("div");i.classList.add("selector-user");const s=new o.Z;return s.classList.add("selector-user-avatar","tgico","avatar-32"),s.isDialog=!0,i.dataset.key=""+e,e.isPeerId()?(void 0===t&&(t=new zt.Z({peerId:e.toPeerId()}).element),s.updateWithOptions({peerId:e})):s.classList.add("tgico-calendarfilter"),t&&("string"==typeof t?i.innerHTML=t:((0,P.Z)(i,t),i.append(t))),i.insertAdjacentElement("afterbegin",s),i},g=e=>{0===e.dataset.key.indexOf("date_")?l=u=0:d="".toPeerId(),e.remove(),(0,Xe.Z)(n,e),setTimeout((()=>{p(),this.inputSearch.onChange(this.inputSearch.value)}),0)};this.inputSearch.onClear=()=>{n.forEach((e=>{g(e)}))},this.inputSearch.onChange=e=>{if(s.cleanupHTML(),s.setQuery({peerId:d,folderId:d?void 0:0,query:e,minDate:l,maxDate:u}),s.load(!0),f.innerHTML="",s.nav.classList.remove("hide"),!d&&e.trim()){const t=s.middleware.get();Promise.all([this.managers.dialogsStorage.getDialogs({query:e}).then((({dialogs:e})=>e.map((e=>e.peerId)))),this.managers.appUsersManager.getContactsPeerIds(e,!0)]).then((e=>{t()&&(new Set(e[0].concat(e[1])).forEach((e=>{f.append(m(e))})),s.nav.classList.toggle("hide",!!f.innerHTML))}))}if(!l&&e.trim()){const t=[];(0,C.fl)(e,t),t.forEach((e=>{f.append(m("date_"+e.minDate+"_"+e.maxDate,e.title))})),s.nav.classList.toggle("hide",!!f.innerHTML)}},s.tabs.inputMessagesFilterEmpty.addEventListener("mousedown",(e=>{const t=(0,be.Z)(e.target,h.DIALOG_LIST_ELEMENT_TAG);if(!t)return;const i=(0,he.Z)(t,"search-group");if(!i||i.classList.contains("search-group-recent")||i.classList.contains("search-group-people"))return;const s=t.getAttribute("data-peer-id").toPeerId();this.managers.appUsersManager.pushRecentSearch(s)}),{capture:!0});const b=document.createElement("div");b.classList.add("search-group-scrollable"),b.append(this.searchGroups.people.list),this.searchGroups.people.container.append(b),new r.v7(b);let y,w=!0;const L=(0,c.Z)({content:e.parentElement,type:"zoom-fade",transitionTime:150,onTransitionEnd:e=>{y&&clearTimeout(y),0!==e||w||(s.selectTab(0,!1),this.inputSearch.onClearClick(),y=window.setTimeout((()=>{y=0,this.newBtnMenu.classList.remove("is-hidden"),this.hasUpdate&&this.updateBtn.classList.remove("is-hidden")}),150)),w=!1}});L(0);const E="is-visible",I=()=>{this.toolsBtn.classList.remove(E),this.backBtn.classList.add(E),this.newBtnMenu.classList.add("is-hidden"),this.updateBtn.classList.add("is-hidden"),this.toolsBtn.parentElement.firstElementChild.classList.toggle("state-back",!0);const e="global-search";z.IS_MOBILE_SAFARI||Ht.Z.findItemByType(e)||Ht.Z.pushItem({onPop:()=>{i()},type:e}),L(1)};this.inputSearch.input.addEventListener("focus",I),I(),(0,v.fc)(this.backBtn,(e=>{this.toolsBtn.classList.add(E),this.backBtn.classList.remove(E),this.toolsBtn.parentElement.firstElementChild.classList.toggle("state-back",!1),Ht.Z.removeByType("global-search"),L(0)}));const M=(0,gt.Z)("close");this.searchGroups.recent.nameEl.append(M),M.addEventListener("click",(()=>{(0,Ee.Z)({descriptionLangKey:"Search.Confirm.ClearHistory",button:{langKey:"ClearButton",isDanger:!0}}).then((()=>this.managers.appUsersManager.clearRecentSearch().then((()=>{this.searchGroups.recent.clear()}))))}))}}const Jt=new Xt;L.GO.appSidebarLeft=Jt;const ei=Jt},5670:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(3552),n=i(5644),a=i(279),o=i(8119);class r extends s._{init(e){this.container.classList.add("add-members-container"),this.nextBtn=(0,o.Z)({icon:"arrow_next"}),this.content.append(this.nextBtn),this.scrollable.container.remove(),this.nextBtn.addEventListener("click",(()=>{const e=this.selector.getSelected().map((e=>e.toPeerId())),t=this.takeOut(e);!this.skippable||t instanceof Promise?t instanceof Promise?this.attachToPromise(t):void 0===t&&this.close():this.close()})),this.setTitle(e.title),this.peerType=e.type,this.takeOut=e.takeOut,this.skippable=e.skippable;const t="privacy"===this.peerType;this.selector=new n.Z({appendTo:this.content,onChange:this.skippable?null:e=>{this.nextBtn.classList.toggle("is-visible",!!e)},peerType:[t?"dialogs":"contacts"],placeholder:e.placeholder,exceptSelf:t,filterPeerTypeBy:t?["isAnyGroup","isUser"]:void 0,managers:this.managers,design:"square"}),e.selectedPeerIds&&this.selector.addInitial(e.selectedPeerIds),this.nextBtn.classList.add("tgico-arrow_next"),this.nextBtn.innerHTML="",this.nextBtn.disabled=!1,this.nextBtn.classList.toggle("is-visible",this.skippable)}attachToPromise(e){const t=(0,a.p)(this.nextBtn,"arrow_next");e.then((()=>{this.close()}),(()=>{t()}))}}},9439:(e,t,i)=>{"use strict";i.d(t,{Z:()=>B});var s=i(6740);function n(e){const t=e.getContext("2d"),i=new Array(4).fill(0),s=t.getImageData(0,0,e.width,e.height).data,n=s.length/4;for(let e=0;e0&&(i=Math.min(100,i+5+.1*(100-i))),s=Math.max(0,.65*s),`hsla(${t}, ${i}%, ${s}%, .4)`}var h=i(8479),u=i(9674),p=i(1571),f=i(2312),m=i(6219),g=i(3512),v=i(4494),b=i(9807),y=i(3442),w=i(3552),S=i(6724),C=i(6714),L=i(5077),E=i(3228),I=i(503);class M{constructor(){this.hue=0,this.saturation=100,this.lightness=50,this.alpha=1,this.elements={},this.onGrabStart=()=>{document.documentElement.style.cursor=this.elements.boxDragger.style.cursor="grabbing"},this.onGrabEnd=()=>{document.documentElement.style.cursor=this.elements.boxDragger.style.cursor=""},this.container=document.createElement("div"),this.container.classList.add(M.BASE_CLASS);const e=`\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n `;this.container.innerHTML=e,this.elements.box=this.container.firstElementChild,this.elements.boxDragger=this.elements.box.lastElementChild,this.elements.saturation=this.elements.box.firstElementChild.firstElementChild,this.elements.sliders=this.elements.box.nextElementSibling,this.elements.hue=this.elements.sliders.firstElementChild,this.elements.hueDragger=this.elements.hue.lastElementChild,this.hexInputField=new I.ZP({plainText:!0,label:"Appearance.Color.Hex"}),this.rgbInputField=new I.ZP({plainText:!0,label:"Appearance.Color.RGB"});const t=document.createElement("div");t.className=M.BASE_CLASS+"-inputs",t.append(this.hexInputField.container,this.rgbInputField.container),this.container.append(t),this.hexInputField.input.addEventListener("input",(()=>{let e=this.hexInputField.value.replace(/#/g,"").slice(0,6);const t=e.match(/([a-fA-F\d]+)/),i=t&&t[0].length===e.length&&[6].includes(e.length);this.hexInputField.setState(i?I.I1.Neutral:I.I1.Error),e="#"+e,this.hexInputField.setValueSilently(e),i&&this.setColor(e,!1,!0)}));const i=/^(?:rgb)?\(?([01]?\d\d?|2[0-4]\d|25[0-5])(?:\W+)([01]?\d\d?|2[0-4]\d|25[0-5])\W+(?:([01]?\d\d?|2[0-4]\d|25[0-5])\)?)$/;this.rgbInputField.input.addEventListener("input",(()=>{const e=this.rgbInputField.value.match(i);this.rgbInputField.setState(e?I.I1.Neutral:I.I1.Error),e&&this.setColor((0,l.dI)(+e[1],+e[2],+e[3]),!0,!1)})),this.attachBoxListeners(),this.attachHueListeners()}attachBoxListeners(){(0,L.Z)(this.elements.box,(()=>{this.onGrabStart(),this.boxRect=this.elements.box.getBoundingClientRect()}),(e=>{this.saturationHandler(e.x,e.y)}),(()=>{this.onGrabEnd()}))}attachHueListeners(){(0,L.Z)(this.elements.hue,(()=>{this.onGrabStart(),this.hueRect=this.elements.hue.getBoundingClientRect()}),(e=>{this.hueHandler(e.x)}),(()=>{this.onGrabEnd()}))}setColor(e,t=!0,i=!0){if(void 0===e)e={h:0,s:100,l:50,a:1};else if("string"==typeof e)if("#"===e[0])e=(0,l.cw)(e);else{const t=e.match(/[.?\d]+/g);e=(0,l.dI)(+t[0],+t[1],+t[2],void 0===t[3]?1:+t[3])}this.boxRect=this.elements.box.getBoundingClientRect();const s=this.boxRect.width/100*e.s,n=100-e.l/(100-e.s/2)*100,a=this.boxRect.height/100*n;this.saturationHandler(this.boxRect.left+s,this.boxRect.top+a,!1),this.hueRect=this.elements.hue.getBoundingClientRect();const o=e.h/360,r=this.hueRect.left+this.hueRect.width*o;this.hueHandler(r,!1),this.hue=e.h,this.saturation=e.s,this.lightness=e.l,this.alpha=e.a,this.updatePicker(t,i)}getCurrentColor(){const e=(0,l.Y6)(this.hue,this.saturation,this.lightness,this.alpha),t=(0,l.t1)(e),i=t.slice(0,-2);return{hsl:`hsl(${this.hue}, ${this.saturation}%, ${this.lightness}%)`,rgb:`rgb(${e[0]}, ${e[1]}, ${e[2]})`,hex:i,hsla:`hsla(${this.hue}, ${this.saturation}%, ${this.lightness}%, ${this.alpha})`,rgba:`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]})`,hexa:t,rgbaArray:e}}updatePicker(e=!0,t=!0){const i=this.getCurrentColor();this.elements.boxDragger.setAttributeNS(null,"fill",i.hex),e&&(this.hexInputField.setValueSilently(i.hex),this.hexInputField.setState(I.I1.Neutral)),t&&(this.rgbInputField.setValueSilently(i.rgbaArray.slice(0,-1).join(", ")),this.rgbInputField.setState(I.I1.Neutral)),this.onChange&&this.onChange(i)}hueHandler(e,t=!0){const i=(0,E.Z)(e-this.hueRect.left,0,this.hueRect.width)/this.hueRect.width;this.hue=Math.round(360*i);const s=`hsla(${this.hue}, 100%, 50%, ${this.alpha})`;this.elements.hueDragger.setAttributeNS(null,"x",100*i+"%"),this.elements.hueDragger.setAttributeNS(null,"fill",s),this.elements.saturation.lastElementChild.setAttributeNS(null,"stop-color",s),t&&this.updatePicker()}saturationHandler(e,t,i=!0){const s=this.boxRect.width,n=this.boxRect.height,a=(0,E.Z)(e-this.boxRect.left,0,s)/s*100,o=(0,E.Z)(t-this.boxRect.top,0,n)/n*100,r=this.elements.boxDragger;r.setAttributeNS(null,"x",a+"%"),r.setAttributeNS(null,"y",o+"%");const d=(0,E.Z)(a,0,100),l=100-d/2,c=100-(0,E.Z)(o,0,100),h=(0,E.Z)(c/100*l,0,100);this.saturation=d,this.lightness=h,i&&this.updatePicker()}}M.BASE_CLASS="color-picker";var Z=i(5029);class P extends w._{constructor(){super(...arguments),this._applyColor=(e,t=!0)=>{if(t)this.colorPicker.setColor(e);else{const t=(0,l.Pi)(e),i=this.theme.settings,s=c(t),n={_:"wallPaperNoFile",id:0,pFlags:{},settings:{_:"wallPaperSettings",background_color:parseInt(e.slice(1),16),pFlags:{}}};i.wallpaper=n,i.highlightningColor=s,this.managers.appStateManager.pushToState("settings",g.Z.settings),m.ZP.applyCurrentTheme(void 0,void 0,!0),this.setActive()}},this.onColorChange=e=>{this.applyColor(e.hex,!1)}}init(){this.container.classList.add("background-container","background-color-container"),this.setTitle("SetColor"),this.theme=C.Z.getTheme();const e=new Z.Z({});this.colorPicker=new M,e.content.append(this.colorPicker.container),this.scrollable.append(e.container);const t=new Z.Z({}),i=this.grid=document.createElement("div");i.classList.add("grid"),["#E6EBEE","#B2CEE1","#008DD0","#C6E7CB","#C4E1A6","#60B16E","#CCD0AF","#A6A997","#7A7072","#FDD7AF","#FDB76E","#DD8851"].forEach((e=>{const t=document.createElement("div");t.classList.add("grid-item"),t.dataset.color=e.toLowerCase();const s=document.createElement("div");s.classList.add("grid-item-media"),s.style.backgroundColor=e,t.append(s),i.append(t)})),(0,r.fc)(i,(e=>{const t=(0,d.Z)(e.target,"grid-item");if(!t||t.classList.contains("active"))return;const i=t.dataset.color;i&&this.applyColor(i)}),{listenerSetter:this.listenerSetter}),t.content.append(i),this.scrollable.append(t.container),this.applyColor=(0,S.Z)(this._applyColor,16,!0)}setActive(){const e=this.grid.querySelector(".active"),t=this.theme.settings.wallpaper.settings.background_color,i=t?this.grid.querySelector(`.grid-item[data-color="${t}"]`):null;e!==i&&(e&&e.classList.remove("active"),i&&i.classList.add("active"))}onOpen(){setTimeout((()=>{var e,t;const i=this.theme.settings,s=null===(t=null===(e=null==i?void 0:i.wallpaper)||void 0===e?void 0:e.settings)||void 0===t?void 0:t.background_color,n=!!s&&"wallPaperNoFile"===i.wallpaper._;n&&(this.colorPicker.onChange=this.onColorChange),this.colorPicker.setColor(s&&"#"+s.toString(16)||"#cccccc"),n||(this.colorPicker.onChange=this.onColorChange)}),0)}onCloseAfterTimeout(){return this.colorPicker.onChange=void 0,this.colorPicker=void 0,super.onCloseAfterTimeout()}}var T,k=i(7030),x=i(236),A=i(7814),_=i(9405),F=i(9492),D=i(7479),R=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class B extends w._{constructor(){super(...arguments),this.clicked=new Set,this.wallPapersByElement=new Map,this.elementsByKey=new Map,this.onUploadClick=()=>{(function(e){const t=document.createElement("input");t.type="file",t.style.display="none",e&&(t.accept=e),document.body.append(t);const i=new Promise(((e,i)=>{t.addEventListener("change",(t=>{const s=t.target.files[0];s?e(s):i("NO_FILE_SELECTED")}),{once:!0})})).finally((()=>{t.remove()}));return t.click(),i})("image/x-png,image/png,image/jpeg").then((e=>R(this,void 0,void 0,(function*(){if(e.name.endsWith(".png")){const t=document.createElement("img"),i=URL.createObjectURL(e);yield(0,s.cj)(t,i,!1);const n="image/jpeg",{blob:a}=yield(0,A.Z)({media:t,size:new _.c(t.naturalWidth,t.naturalHeight),mimeType:n});e=new File([a],e.name.replace(/\.png$/,".jpg"),{type:n})}const t=yield this.managers.appDocsManager.prepareWallPaperUpload(e),i=this.managers.appDocsManager.uploadWallPaper(t.id),n=f.Z.getNewDeferredForUpload(e.name,i),a=(0,o.Z)();a.addNotifyListener=n.addNotifyListener,a.cancel=n.cancel,n.then((e=>{this.clicked.delete(r),this.elementsByKey.delete(r),this.wallPapersByElement.set(l,e);const t=this.getWallPaperKey(e);this.elementsByKey.set(t,l),B.setBackgroundDocument(e).then(a.resolve,a.reject)}),a.reject);const r=this.getWallPaperKey(t);a.catch((()=>{l.remove()}));const d=new y.Z({isUpload:!0,cancelable:!0,tryAgainOnFail:!1}),{container:l}=yield this.addWallPaper(t,!1);this.clicked.add(r),d.attach(l,!1,a)}))))},this.onResetClick=()=>{var e,t,i,s;const n=x.h.settings.themes.find((e=>e.name===this.theme.name));n&&(++B.tempId,this.theme.settings=(0,h.Z)(n.settings),this.managers.appStateManager.pushToState("settings",g.Z.settings),m.ZP.applyCurrentTheme(void 0,void 0,!0),this.blurCheckboxField.setValueSilently(null===(s=null===(i=null===(t=null===(e=this.theme.settings)||void 0===e?void 0:e.wallpaper)||void 0===t?void 0:t.settings)||void 0===i?void 0:i.pFlags)||void 0===s?void 0:s.blur))},this.onGridClick=e=>{const t=(0,d.Z)(e.target,"grid-item");if(!t)return;const i=this.wallPapersByElement.get(t);if("wallPaperNoFile"===i._)return void B.setBackgroundDocument(i);const s=this.getWallPaperKey(i);if(this.clicked.has(s))return;this.clicked.add(s);const n=i.document,a=new y.Z({cancelable:!0,tryAgainOnFail:!1}),o=()=>R(this,void 0,void 0,(function*(){var e,s,o,r;const d=B.setBackgroundDocument(i);(yield this.managers.thumbsStorage.getCacheContext(n)).url&&!(null===(r=null===(o=null===(s=null===(e=this.theme.settings)||void 0===e?void 0:e.wallpaper)||void 0===s?void 0:s.settings)||void 0===o?void 0:o.pFlags)||void 0===r?void 0:r.blur)||a.attach(t,!0,d)}));a.construct(),(0,r.fc)(t,(e=>{a.preloader.parentElement?(a.onClick(e),a.detach()):o()}),{listenerSetter:this.listenerSetter}),o()},this.setActive=()=>{const e=this.grid.querySelector(".active"),t=this.elementsByKey.get(this.getWallPaperKeyFromTheme(this.theme));e!==t&&(e&&e.classList.remove("active"),t&&t.classList.add("active"))}}static getInitArgs(){return{backgrounds:g.Z.managers.appThemesManager.getWallPapers()}}get theme(){return C.Z.getTheme()}init(e=B.getInitArgs()){var t,i,s;this.container.classList.add("background-container","background-image-container"),this.setTitle("ChatBackground");{const e=(0,Z.R)(this.scrollable),n=(0,v.Z)("btn-primary btn-transparent",{icon:"cameraadd",text:"ChatBackground.UploadWallpaper"}),a=(0,v.Z)("btn-primary btn-transparent",{icon:"colorize",text:"SetColor"}),d=(0,v.Z)("btn-primary btn-transparent",{icon:"favourites",text:"Appearance.Reset"});(0,r.fc)(n,this.onUploadClick,{listenerSetter:this.listenerSetter}),(0,r.fc)(a,(()=>{this.slider.createTab(P).open()}),{listenerSetter:this.listenerSetter}),(0,r.fc)(d,this.onResetClick,{listenerSetter:this.listenerSetter});const l=null===(t=this.theme.settings)||void 0===t?void 0:t.wallpaper,c=this.blurCheckboxField=new b.Z({text:"ChatBackground.Blur",name:"blur",checked:null===(s=null===(i=null==l?void 0:l.settings)||void 0===i?void 0:i.pFlags)||void 0===s?void 0:s.blur});this.listenerSetter.add(c.input)("change",(()=>R(this,void 0,void 0,(function*(){this.theme.settings.wallpaper.settings.pFlags.blur=c.input.checked||void 0,yield this.managers.appStateManager.pushToState("settings",g.Z.settings),setTimeout((()=>{const e=o.querySelector(".active");if(!e)return;const t=this.wallPapersByElement.get(e);t.pFlags.pattern||"wallPaperNoFile"===t._||B.setBackgroundDocument(t)}),100)})))),e.append(n,a,d,(0,D.tG)(c).container)}g.Z.addEventListener("background_change",this.setActive);const n=e.backgrounds.then((e=>{const t=e.map((e=>this.addWallPaper(e)));return Promise.all(t)})),a=(0,Z.R)(this.scrollable),o=this.grid=document.createElement("div");return o.classList.add("grid"),(0,r.fc)(o,this.onGridClick,{listenerSetter:this.listenerSetter}),a.append(o),n}getWallPaperKey(e){return""+e.id}getWallPaperKeyFromTheme(e){var t;return""+(this.getWallPaperKey(null===(t=e.settings)||void 0===t?void 0:t.wallpaper)||"")}static addWallPaper(e,t=document.createElement("div")){var i;const s=(0,l.EM)(e),n="wallPaper"===e._;if(n&&e.pFlags.pattern&&!s)return;const a=!!e.pFlags.dark;let o=n?e.document:void 0;n&&!o&&(o={_:"webDocumentNoProxy",attributes:[],size:1e5,url:"assets/img/pattern.svg",w:1440,h:2960,mime_type:"image/svg+xml"}),t.classList.add("background-item"),t.dataset.id=""+e.id;const r=document.createElement("div");r.classList.add("background-item-media");const d=[];let c,h;if(n){h=(0,k.Z)(o,200,200),c=(0,F.Z)({photo:o,message:null,container:r,withoutPreloader:!0,size:h,noFadeIn:e.pFlags.pattern}),e.pFlags.pattern&&r.classList.add("is-pattern");const i=c.then((({loadPromises:e,images:t})=>R(this,void 0,void 0,(function*(){return(yield e.thumb)||e.full,t})))).then((i=>{var s;return e.pFlags.pattern&&(a?(i.full.style.display="none",i.thumb&&(i.thumb.style.display="none")):(null===(s=e.settings)||void 0===s?void 0:s.intensity)&&(i.full.style.opacity=""+Math.abs(e.settings.intensity)/100)),u.Z.mutate((()=>{t.append(r)}))}));d.push(i)}else t.append(r);if(null===(i=e.settings)||void 0===i?void 0:i.background_color){const{canvas:t}=p.Z.create(s);if(t.classList.add("background-colors-canvas"),a&&n){const i=c.then((({loadPromises:i})=>i.full.then((()=>R(this,void 0,void 0,(function*(){const i=yield g.Z.managers.thumbsStorage.getCacheContext(o,h.type);t.style.webkitMaskImage=`url(${i.url})`,t.style.opacity=""+(e.pFlags.dark?100+e.settings.intensity:e.settings.intensity)/100,r.append(t)}))))));d.push(i)}else r.append(t)}return{container:t,media:r,loadPromise:Promise.all(d)}}addWallPaper(e,t=!0){const i=B.addWallPaper(e);if(i){const{container:s,media:n}=i;s.classList.add("grid-item"),n.classList.add("grid-item-media");const a=this.getWallPaperKey(e);this.wallPapersByElement.set(s,e),this.elementsByKey.set(a,s),this.getWallPaperKeyFromTheme(this.theme)===a&&s.classList.add("active"),this.grid[t?"append":"prepend"](s)}return i&&i.loadPromise.then((()=>i))}}T=B,B.tempId=0,B.setBackgroundDocument=(e,t)=>{const i=++T.tempId,r=()=>i===T.tempId,d=e.document,h=(0,o.Z)();let u;d?(u=f.Z.downloadMediaURL({media:d,queueId:m.ZP.chat.bubbles?m.ZP.chat.bubbles.lazyLoadQueue.queueId:0}),h.addNotifyListener=u.addNotifyListener,h.cancel=u.cancel):u=Promise.resolve();const v=(e,t)=>{fetch(t).then((t=>{m.ZP.cacheStorage.save("backgrounds/"+e,t)}))};return u.then((()=>R(void 0,void 0,void 0,(function*(){var i,o,u;if(!r())return void h.resolve();const f=!!t;null!=t||(t=C.Z.getTheme().settings);const b=i=>{var a;let o;const d=(0,l.EM)(e);if(i&&!d)o=function(e){const t=document.createElement("img");return(0,s.cj)(t,e,!1).then((()=>function(e,t,i){const s=document.createElement("canvas"),a=t/i;return 1===a?(s.width=50,s.height=s.width/a):a>1?(s.height=50,s.width=s.height/a):s.width=s.height=50,s.getContext("2d").drawImage(e,0,0,t,i,0,0,s.width,s.height),n(s)}(t,t.naturalWidth,t.naturalHeight)))}(i);else{const{canvas:e}=p.Z.create(d);o=Promise.resolve(n(e))}const u=null!==(a=e.slug)&&void 0!==a?a:"";Promise.all([o,u&&v(u,i)]).then((([s])=>{if(!r())return void h.resolve();const n=c(Array.from(s));t.wallpaper=e,t.highlightningColor=n,f||g.Z.managers.appStateManager.pushToState("settings",g.Z.settings),m.ZP.applyCurrentTheme(u,i,!0).then(h.resolve)}))};if(!d)return void b();const y=yield g.Z.managers.thumbsStorage.getCacheContext(d);(null===(u=null===(o=null===(i=t.wallpaper)||void 0===i?void 0:i.settings)||void 0===o?void 0:o.pFlags)||void 0===u?void 0:u.blur)?setTimeout((()=>{const{canvas:e,promise:t}=(0,a.Z)(y.url,12,4);t.then((()=>{r()?b(e.toDataURL()):h.resolve()}))}),200):r()&&b(y.url)})))),h}},534:(e,t,i)=>{"use strict";i.d(t,{Z:()=>T});var s=i(5005),n=i(1447),a=i(3552),o=i(2796),r=i(503),d=i(2230),l=i(5322),c=i(4494),h=i(5644),u=i(9807),p=i(2325),f=i(8479),m=i(7625),g=i(130),v=i(8115),b=i(1507),y=i(3512),w=i(2738),S=i(5029),C=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class L extends a._{constructor(){super(...arguments),this.renderResults=e=>C(this,void 0,void 0,(function*(){yield this.managers.appUsersManager.getContacts(),e.forEach((e=>{const{dom:t}=s.default.addDialogNew({peerId:e,container:this.selector.scrollable,rippleEnabled:!0,avatarSize:"abitbigger"}),i=this.selector.selected.has(e);t.containerEl.append(this.checkbox(i));const n=[];this.dialogsByFilters.forEach(((t,i)=>{if(t.has(e)){const e=document.createElement("span");(0,g.Z)(e,(0,v.Z)(i.title)),n.push(e)}})),(0,p.v_)(n,!1).forEach((e=>{t.lastMessageSpan.append(e)}))}))})),this.onSelectChange=e=>{"included"===this.type&&(this.confirmBtn.style.display=e?"":"none")}}init(e,t,i){this.originalFilter=e,this.filter=(0,f.Z)(this.originalFilter),this.type=t,this.editFolderTab=i,this.content.remove(),this.container.classList.add("included-chatlist-container"),this.confirmBtn=(0,d.Z)("check btn-confirm blue",{noRipple:!0}),this.confirmBtn.style.display="none",this.header.append(this.confirmBtn),(0,w.fc)(this.confirmBtn,(()=>C(this,void 0,void 0,(function*(){const e=this.selector.getSelected();if("included"===this.type)for(const e in this.filter.pFlags)0!==e.indexOf("exclude_")&&delete this.filter.pFlags[e];else for(const e in this.filter.pFlags)0===e.indexOf("exclude_")&&delete this.filter.pFlags[e];const t=[];for(const i of e)i.isPeerId()?t.push(i.toPeerId()):this.filter.pFlags[i]=!0;let i;i="included"===this.type?e=>t.includes(e):e=>!t.includes(e),(0,m.Z)(this.filter.pinnedPeerIds,((e,t)=>{i(e)||(this.filter.pinnedPeerIds.splice(t,1),this.filter.pinned_peers.splice(t,1))}));const s="included"===this.type?"excludePeerIds":"includePeerIds",n="included"===this.type?"exclude_peers":"include_peers";(0,m.Z)(this.filter[s],((e,i)=>{t.includes(e)&&(this.filter[s].splice(i,1),this.filter[n].splice(i,1))})),this.filter["included"===this.type?"includePeerIds":"excludePeerIds"]=t,this.filter["included"===this.type?"include_peers":"exclude_peers"]=yield Promise.all(t.map((e=>this.managers.appPeersManager.getInputPeerById(e)))),this.editFolderTab.setFilter(this.filter,!1),this.close()}))),{listenerSetter:this.listenerSetter});const s=e=>{this.limit=y.Z.premium?e.dialog_filters_chats_limit_premium:e.dialog_filters_chats_limit_default};return this.listenerSetter.add(y.Z)("app_config",s),this.dialogsByFilters=new Map,Promise.all([this.managers.filtersStorage.getDialogFilters().then((e=>C(this,void 0,void 0,(function*(){yield Promise.all(e.filter((e=>!b.DZ.has(e.id))).map((e=>C(this,void 0,void 0,(function*(){const t=(yield this.managers.dialogsStorage.getFolderDialogs(e.id)).map((e=>e.peerId));this.dialogsByFilters.set(e,new Set(t))})))))})))),this.managers.apiManager.getAppConfig().then((e=>{s(e)}))])}checkbox(e){const t=new u.Z({round:!0});return e&&(t.input.checked=e),t.label}onOpen(){this.confirmBtn.style.display="excluded"===this.type?"":"none",this.setTitle("included"===this.type?"FilterAlwaysShow":"FilterNeverShow");const e=this.filter,t=new S.Z({noDelimiter:!0,name:"FilterChatTypes"});let i;t.container.classList.add("folder-categories"),i="excluded"===this.type?{exclude_muted:{ico:"mute",text:"ChatList.Filter.MutedChats"},exclude_archived:{ico:"archive",text:"ChatList.Filter.Archive"},exclude_read:{ico:"readchats",text:"ChatList.Filter.ReadChats"}}:{contacts:{ico:"newprivate",text:"ChatList.Filter.Contacts"},non_contacts:{ico:"noncontacts",text:"ChatList.Filter.NonContacts"},groups:{ico:"group",text:"ChatList.Filter.Groups"},broadcasts:{ico:"newchannel",text:"ChatList.Filter.Channels"},bots:{ico:"bots",text:"ChatList.Filter.Bots"}};const s=document.createDocumentFragment();for(const e in i){const t=(0,c.Z)("btn-primary btn-transparent folder-category-button",{icon:i[e].ico,text:i[e].text});t.dataset.peerId=e,t.append(this.checkbox()),s.append(t)}t.content.append(s);const n=("included"===this.type?e.includePeerIds:e.excludePeerIds).slice();this.selector=new h.Z({appendTo:this.container,onChange:this.onSelectChange,peerType:["dialogs"],renderResultsFunc:this.renderResults,placeholder:"Search",sectionNameLangPackKey:"FilterChats",managers:this.managers}),this.selector.selected=new Set(n);let a=!1;const r=this.selector.add.bind(this.selector);this.selector.add=(e,t,s)=>{if(this.selector.selected.size>=this.limit&&a&&!i[e]){const t=this.selector.list.querySelector(`[data-peer-id="${e}"] [type="checkbox"]`);t&&setTimeout((()=>{t.checked=!1}),0);const i=p.ZP.format("excluded"===this.type?"ChatList.Filter.Exclude.LimitReached":"ChatList.Filter.Include.LimitReached",!0);return void(0,o.Am)(i)}const n=r(e,i[e]?(0,p.ag)(i[e].text):void 0,s);return i[e]&&n.querySelector("avatar-element").classList.add("tgico-"+i[e].ico),n},this.selector.scrollable.container.append(t.container,this.selector.scrollable.container.lastElementChild),this.selector.addInitial(n),a=!0;for(const s in e.pFlags)i.hasOwnProperty(s)&&e.pFlags[s]&&(0,w.tH)(t.content.querySelector(`[data-peer-id="${s}"]`))}onCloseAfterTimeout(){return this.selector&&(this.selector.container.remove(),this.selector=null),super.onCloseAfterTimeout()}}var E=i(8127),I=i(6848),M=i(3066),Z=i(2353),P=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class T extends a._{constructor(){super(...arguments),this.flags={}}static getInitArgs(){return{animationData:n.Z.loadAnimationFromURLManually("Folders_2")}}init(e=T.getInitArgs()){this.container.classList.add("edit-folder-container"),this.caption=document.createElement("div"),this.caption.classList.add("caption"),this.caption.append((0,p.ag)("FilterIncludeExcludeInfo")),this.stickerContainer=document.createElement("div"),this.stickerContainer.classList.add("sticker-container"),this.confirmBtn=(0,d.Z)("check btn-confirm hide blue");let t=!1;const i={icon:"delete danger",text:"FilterMenuDelete",onClick:()=>{new E.Z("filter-delete",{titleLangKey:"ChatList.Filter.Confirm.Remove.Header",descriptionLangKey:"ChatList.Filter.Confirm.Remove.Text",buttons:[{langKey:"Delete",callback:()=>{t||(t=!0,this.managers.filtersStorage.updateDialogFilter(this.filter,!0).then((e=>{this.close()})).finally((()=>{t=!1})))},isDanger:!0}]}).show()}};this.menuBtn=(0,l.Z)({listenerSetter:this.listenerSetter,direction:"bottom-left",buttons:[i]}),this.menuBtn.classList.add("hide"),this.header.append(this.confirmBtn,this.menuBtn);const s=new S.Z({}),a=document.createElement("div");a.classList.add("input-wrapper"),this.nameInputField=new r.ZP({label:"FilterNameHint",maxLength:12}),a.append(this.nameInputField.container),s.content.append(a);const h=(e,t,i,s)=>{const n=new S.Z({name:t,noDelimiter:!0});n.container.classList.add("folder-list",e);const a=n.generateContentElement();return a.classList.add("folder-categories"),i.forEach((e=>{const t=(0,c.Z)("folder-category-button btn btn-primary btn-transparent",{icon:e.icon,text:e.text,noRipple:!e.withRipple||void 0});e.name&&(s[e.name]=t),a.append(t)})),n};this.includePeerIds=h("folder-list-included","FilterInclude",[{icon:"add primary",text:"ChatList.Filter.Include.AddChat",withRipple:!0},{text:"ChatList.Filter.Contacts",icon:"newprivate",name:"contacts"},{text:"ChatList.Filter.NonContacts",icon:"noncontacts",name:"non_contacts"},{text:"ChatList.Filter.Groups",icon:"group",name:"groups"},{text:"ChatList.Filter.Channels",icon:"channel",name:"broadcasts"},{text:"ChatList.Filter.Bots",icon:"bots",name:"bots"}],this.flags),this.excludePeerIds=h("folder-list-excluded","FilterExclude",[{icon:"minus primary",text:"ChatList.Filter.Exclude.AddChat",withRipple:!0},{text:"ChatList.Filter.MutedChats",icon:"mute",name:"exclude_muted"},{text:"ChatList.Filter.Archive",icon:"archive",name:"exclude_archived"},{text:"ChatList.Filter.ReadChats",icon:"readchats",name:"exclude_read"}],this.flags),this.scrollable.append(this.stickerContainer,this.caption,s.container,this.includePeerIds.container,this.excludePeerIds.container);const u=this.includePeerIds.container.querySelector(".folder-categories"),f=this.excludePeerIds.container.querySelector(".folder-categories");(0,w.fc)(u.querySelector(".btn"),(()=>{this.slider.createTab(L).open(this.filter,"included",this)}),{listenerSetter:this.listenerSetter}),(0,w.fc)(f.querySelector(".btn"),(()=>{this.slider.createTab(L).open(this.filter,"excluded",this)}),{listenerSetter:this.listenerSetter}),(0,w.fc)(this.confirmBtn,(()=>{if(this.nameInputField.input.classList.contains("error"))return;if(!this.nameInputField.value.trim())return void this.nameInputField.input.classList.add("error");let e,t=Array.from(u.children).slice(1).reduce(((e,t)=>e+ +!t.style.display),0);t+=this.filter.include_peers.length,t?(this.confirmBtn.setAttribute("disabled","true"),e=this.filter.id?this.managers.filtersStorage.updateDialogFilter(this.filter):this.managers.filtersStorage.createDialogFilter(this.filter),e.then((e=>{this.close()})).catch((e=>{"DIALOG_FILTERS_TOO_MUCH"===e.type?(0,o.Am)("Sorry, you can't create more folders."):console.error("updateDialogFilter error:",e)})).finally((()=>{this.confirmBtn.removeAttribute("disabled")}))):(0,o.Am)("Please choose at least one chat for this folder.")}),{listenerSetter:this.listenerSetter}),this.listenerSetter.add(this.nameInputField.input)("input",(()=>{this.filter.title=this.nameInputField.value,this.editCheckForChange()}));const m="edit"===this.type?[this.managers.filtersStorage.reloadMissingPeerIds(this.filter.id,"pinned_peers"),this.managers.filtersStorage.reloadMissingPeerIds(this.filter.id,"include_peers"),this.managers.filtersStorage.reloadMissingPeerIds(this.filter.id,"exclude_peers")]:[];return Promise.all([this.loadAnimationPromise=e.animationData.then((e=>P(this,void 0,void 0,(function*(){const t=yield e({container:this.stickerContainer,loop:!1,autoplay:!1,width:86,height:86});return this.animation=t,n.Z.waitForFirstFrame(t)})))),...m]).then((()=>{"edit"===this.type?(this.setFilter(this.originalFilter,!0),this.onEditOpen()):(this.setInitFilter(),this.onCreateOpen())}))}onOpenAfterTimeout(){this.loadAnimationPromise.then((()=>{this.animation.autoplay=!0,this.animation.play()}))}onCreateOpen(){this.setTitle("FilterNew"),this.menuBtn.classList.add("hide"),this.confirmBtn.classList.remove("hide");for(const e in this.flags)this.flags[e].style.display="none"}onEditOpen(){this.setTitle("create"===this.type?"FilterNew":"FilterHeaderEdit"),"edit"===this.type&&(this.menuBtn.classList.remove("hide"),this.confirmBtn.classList.add("hide"));const e=this.filter;this.nameInputField.value=(0,M.Z)(e.title);for(const t in this.flags)this.flags[t].style.display=e.pFlags[t]?"":"none";["includePeerIds","excludePeerIds"].forEach((t=>P(this,void 0,void 0,(function*(){const i=this[t],n=s.default.createChatList({ignoreClick:!0});let a=e[t];const o=e=>P(this,void 0,void 0,(function*(){return!!(yield this.managers.appMessagesManager.getDialogOnly(e))||!!e.isUser()&&"user"===(yield this.managers.appUsersManager.getUser(e.toUserId()))._})),r=yield(0,Z.Z)(a,(e=>o(e)));a.length=0,a.push(...r),a=a.slice();const d=e=>P(this,void 0,void 0,(function*(){for(let t=0,i=Math.min(a.length,e);td(20)),{listenerSetter:this.listenerSetter}),l.append((0,p.ag)("FilterShowMoreChats",[a.length])),e.append(l)}d(4)}))))}editCheckForChange(){if("edit"===this.type){const e=!(0,I.Z)(this.originalFilter,this.filter);this.confirmBtn.classList.toggle("hide",!e),this.menuBtn.classList.toggle("hide",e)}}setFilter(e,t){this.container&&Array.from(this.container.querySelectorAll("ul, .load-more")).forEach((e=>e.remove())),t?(this.originalFilter=e,this.filter=(0,f.Z)(e)):(this.filter=e,this.onEditOpen(),this.editCheckForChange())}setInitFilter(e){void 0===e?(this.setFilter({_:"dialogFilter",id:0,title:"",pFlags:{},pinned_peers:[],include_peers:[],exclude_peers:[],pinnedPeerIds:[],includePeerIds:[],excludePeerIds:[]},!0),this.type="create"):(this.setFilter(e,!0),this.type="edit")}}},2010:(e,t,i)=>{"use strict";i.d(t,{J:()=>f,Z:()=>m});var s=i(503),n=i(3552),a=i(2621),o=i(6726),r=i(2325),d=i(2738),l=i(3512),c=i(2521),h=i(6082),u=i(5029),p=i(9522);function f(){const e=document.createElement("div"),t=(0,c.Z)(document.createElement("a")),i=(0,r.ag)("Username.Purchase",[t]);return i.classList.add("username-purchase-help"),e.append(i,document.createElement("br"),document.createElement("br")),e.classList.add("hide"),{element:e,setUsername:i=>{i&&(t.href="https://fragment.com/username/"+i),e.classList.toggle("hide",!i)}}}class m extends n._{static getInitArgs(){return{bioMaxLength:l.Z.managers.apiManager.getLimit("bio"),user:l.Z.managers.appUsersManager.getSelf(),userFull:l.Z.managers.appProfileManager.getProfile(l.Z.myId.toUserId())}}init(e){return t=this,i=void 0,c=function*(){this.container.classList.add("edit-profile-container"),this.setTitle("EditAccount.Title");const t=[],[i,n,c]=yield Promise.all([e.bioMaxLength,e.user,e.userFull]);{const e=(0,u.R)(this.scrollable,void 0,"Bio.Description"),n=document.createElement("div");n.classList.add("input-wrapper"),this.firstNameInputField=new s.ZP({label:"EditProfile.FirstNameLabel",name:"first-name",maxLength:70}),this.lastNameInputField=new s.ZP({label:"Login.Register.LastName.Placeholder",name:"last-name",maxLength:64}),this.bioInputField=new s.ZP({label:"EditProfile.BioLabel",name:"bio",maxLength:i}),n.append(this.firstNameInputField.container,this.lastNameInputField.container,this.bioInputField.container);const o=document.createElement("div");o.classList.add("caption"),(0,r.XZ)({element:o,key:"Bio.Description"}),t.push(this.firstNameInputField,this.lastNameInputField,this.bioInputField),this.editPeer=new a.Z({peerId:l.Z.myId,inputFields:t,listenerSetter:this.listenerSetter}),this.content.append(this.editPeer.nextBtn),e.append(this.editPeer.avatarEdit.container,n)}{const e=new u.Z({name:"EditAccount.Username",caption:!0}),i=document.createElement("div");i.classList.add("input-wrapper"),this.usernameInputField=new o.l({label:"EditProfile.Username.Label",name:"username",plainText:!0,listenerSetter:this.listenerSetter,onChange:()=>{this.editPeer.handleChange();const{error:e}=this.usernameInputField,t="USERNAME_PURCHASE_AVAILABLE"===(null==e?void 0:e.type);n(t?this.usernameInputField.value:void 0)},availableText:"EditProfile.Username.Available",takenText:"EditProfile.Username.Taken",invalidText:"EditProfile.Username.Invalid"},this.managers),i.append(this.usernameInputField.container);const s=e.caption,{setUsername:n,element:a}=f();s.append(a,(0,r.ag)("UsernameHelp")),t.push(this.usernameInputField),e.content.append(i),this.scrollable.append(e.container)}{const e=new p.Z({peerId:l.Z.myId,peer:n,listenerSetter:this.listenerSetter,usernameInputField:this.usernameInputField,middleware:this.middlewareHelper.get()});this.scrollable.append(e.container)}(0,d.fc)(this.editPeer.nextBtn,(()=>{this.editPeer.nextBtn.disabled=!0;const e=[],t=this.managers.appProfileManager.updateProfile(this.firstNameInputField.value,this.lastNameInputField.value,this.bioInputField.value);e.push(t.then((()=>{this.close()}),(e=>{console.error("updateProfile error:",e)}))),this.editPeer.uploadAvatar&&e.push(this.editPeer.uploadAvatar().then((e=>this.managers.appProfileManager.uploadProfilePhoto(e)))),this.usernameInputField.isValidToChange()&&e.push(this.managers.appUsersManager.updateUsername(this.usernameInputField.value)),Promise.race(e).finally((()=>{this.editPeer.nextBtn.removeAttribute("disabled")}))}),{listenerSetter:this.listenerSetter}),this.firstNameInputField.setOriginalValue(n.first_name,!0),this.lastNameInputField.setOriginalValue(n.last_name,!0),this.bioInputField.setOriginalValue(c.about,!0),this.usernameInputField.setOriginalValue((0,h.Z)(n),!0),this.editPeer.handleChange()},new((n=void 0)||(n=Promise))((function(e,s){function a(e){try{r(c.next(e))}catch(e){s(e)}}function o(e){try{r(c.throw(e))}catch(e){s(e)}}function r(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(a,o)}r((c=c.apply(t,i||[])).next())}));var t,i,n,c}}},4332:(e,t,i)=>{"use strict";i.d(t,{HQ:()=>d,ZP:()=>h});var s=i(6219),n=i(3552),a=i(4755),o=i(1669),r=i(410);const d="is-right-column-shown";class l extends n.Z{constructor(){super({sidebarEl:document.getElementById("column-right"),canHideFirst:!0,navigationType:"right"}),this.isColumnProportionSet=!1}construct(e){this.managers=e,a.Z.addEventListener("changeScreen",((e,t)=>{t===a._.medium&&e!==a._.mobile&&this.toggleSidebar(!1)})),a.Z.addEventListener("resize",(()=>{this.setColumnProportion()}))}createSharedMediaTab(){const e=this.createTab(o.Z,!1,!0);return e.slider=this,e}replaceSharedMediaTab(e){const t=this.sharedMediaTab;if(t){const i=this.historyTabIds.indexOf(t);this._selectTab.getFrom()===t.container&&this._selectTab.setFrom(null==e?void 0:e.container),e?(-1!==i&&(this.historyTabIds[i]=e),t.container.classList.contains("active")&&e.container.classList.add("active"),t.container.replaceWith(e.container)):(-1!==i&&this.historyTabIds.splice(i,1),t.container.remove())}else this.tabsContainer.prepend(e.container);this.sharedMediaTab=e}onCloseTab(e,t,i){this.historyTabIds.length||this.toggleSidebar(!1,t),super.onCloseTab(e,t,i)}setColumnProportion(){const e=this.sidebarEl.scrollWidth/this.sidebarEl.previousElementSibling.scrollWidth;document.documentElement.style.setProperty("--right-column-proportion",""+e)}toggleSidebar(e,t){const i=document.body.classList.contains(d);let n;if(void 0!==e?e?i||(n=!0):i&&(n=!0):n=!0,!n)return Promise.resolve();i||this.historyTabIds.length||this.sharedMediaTab.open(),this.isColumnProportionSet||(this.setColumnProportion(),this.isColumnProportionSet=!0);const a=s.ZP.selectTab(i?s.oo.CHAT:s.oo.PROFILE,t);return document.body.classList.toggle(d,e),a}}const c=new l;r.GO.appSidebarRight=c;const h=c},4240:(e,t,i)=>{"use strict";i.d(t,{Z:()=>S});var s=i(3552),n=i(503),a=i(2621),o=i(7479),r=i(9807),d=i(4494),l=i(8842),c=i(3512),h=i(8127),u=i(1168),p=i(2325),f=i(2738),m=i(1656),g=i(2946),v=i(8210),b=i(5029),y=i(7362),w=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class S extends s._{init(){return w(this,void 0,void 0,(function*(){const{peerId:e}=this,t=e.toUserId();this.container.classList.add("edit-peer-container","edit-contact-container");const[i,s]=yield Promise.all([this.managers.appUsersManager.isContact(t),this.managers.appPrivacyManager.getPrivacy("inputPrivacyKeyPhoneNumber")]),S=!i;this.setTitle(S?"AddContactTitle":"Edit");{const i=new b.Z({noDelimiter:!0}),s=[],d=document.createElement("div");if(d.classList.add("input-wrapper"),this.nameInputField=new n.ZP({label:"FirstName",name:"contact-name",maxLength:70,required:!0}),this.lastNameInputField=new n.ZP({label:"LastName",name:"contact-lastname",maxLength:70}),t){const e=yield this.managers.appUsersManager.getUser(t);S?(this.nameInputField.setDraftValue(e.first_name),this.lastNameInputField.setDraftValue(e.last_name)):(this.nameInputField.setOriginalValue(e.first_name),this.lastNameInputField.setOriginalValue(e.last_name))}if(d.append(this.nameInputField.container,this.lastNameInputField.container),s.push(this.nameInputField,this.lastNameInputField),this.editPeer=new a.Z({peerId:e,inputFields:s,listenerSetter:this.listenerSetter,doNotEditAvatar:!0}),this.content.append(this.editPeer.nextBtn),e){const s=document.createElement("div");s.classList.add("avatar-edit"),s.append(this.editPeer.avatarElem);const n=new r.Z({text:"Notifications"});n.input.addEventListener("change",(t=>{t.isTrusted&&this.managers.appMessagesManager.togglePeerMute({peerId:e})})),this.listenerSetter.add(c.Z)("notify_settings",(e=>w(this,void 0,void 0,(function*(){if("notifyPeer"!==e.peer._)return;const t=(0,g.Z)(e.peer.peer);if(t==t){const t=!(yield this.managers.appNotificationsManager.isMuted(e.notify_settings));t!==n.checked&&(n.checked=t)}}))));const a=document.createElement("div");a.classList.add("profile-name"),a.append(new l.Z({peerId:e}).element);const h=document.createElement("div");if(h.classList.add("profile-subtitle"),h.append((0,p.ag)("EditContact.OriginalName")),i.content.append(s,a,h,d),S){const s=yield this.managers.appUsersManager.getUser(t),n=new o.ZP({icon:"phone",titleLangKey:s.phone?void 0:"MobileHidden",title:s.phone?(0,v.Z)(s.phone):void 0,subtitleLangKey:s.phone?"Phone":"MobileHiddenExceptionInfo",subtitleLangArgs:s.phone?void 0:[new l.Z({peerId:e}).element]});i.content.append(n.container)}else{const t=new o.ZP({checkboxField:n,withCheckboxSubtitle:!0,listenerSetter:this.listenerSetter}),s=!(yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:e,respectType:!1}));n.checked=s,i.content.append(t.container)}}else i.content.append(d);this.scrollable.append(i.container)}if(S){if(s.some((e=>"privacyValueDisallowAll"===e._))&&!s.some((e=>"privacyValueAllowUsers"===e._&&e.users.includes(t)))){const e=new b.Z({caption:"NewContact.Exception.ShareMyPhoneNumber.Desc",captionArgs:[yield(0,y.Z)({peerId:this.peerId})]}),t=this.sharePhoneCheckboxField=new r.Z({text:"NewContact.Exception.ShareMyPhoneNumber",checked:!0}),i=(0,o.tG)(t);e.content.append(i.container),this.scrollable.append(e.container)}}else{const i=new b.Z,s=(0,d.Z)("btn-primary btn-transparent danger",{icon:"delete",text:"PeerInfo.DeleteContact"});(0,f.fc)(s,(()=>{new h.Z("popup-delete-contact",{peerId:e,titleLangKey:"DeleteContact",descriptionLangKey:"AreYouSureDeleteContact",buttons:(0,u.x)([{langKey:"Delete",callback:()=>{const e=(0,m.Z)([s],!0);this.managers.appUsersManager.deleteContacts([t]).then((()=>{this.close()}),(()=>{e()}))},isDanger:!0}])}).show()}),{listenerSetter:this.listenerSetter}),i.content.append(s),this.scrollable.append(i.container)}(0,f.fc)(this.editPeer.nextBtn,(()=>w(this,void 0,void 0,(function*(){var e;this.editPeer.nextBtn.disabled=!0,this.managers.appUsersManager.addContact(t,this.nameInputField.value,this.lastNameInputField.value,(yield this.managers.appUsersManager.getUser(t)).phone,null===(e=this.sharePhoneCheckboxField)||void 0===e?void 0:e.checked).finally((()=>{this.editPeer.nextBtn.removeAttribute("disabled"),this.close()}))}))),{listenerSetter:this.listenerSetter})}))}}},730:(e,t,i)=>{"use strict";i.d(t,{Z:()=>C});var s=i(2738),n=i(1656),a=i(9405),o=i(8479),r=i(6848),d=i(6219),l=i(1507),c=i(3785),h=i(2230),u=i(9807),p=i(6039),f=i(503),m=i(7479),g=i(5029),v=i(7856),b=i(6024),y=i(9345),w=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const S=(0,a.C)(64,64);class C extends b.Z{init(e,t){return w(this,void 0,void 0,(function*(){this.colorIndex=0;const i=!t,a=t===l.Ox;this.container.classList.add("edit-topic-container"),this.setTitle(i?"NewTopic":"ForumTopic.Title.Edit");const r=e.toChatId();t&&(this.topic=this.originalTopic=(0,o.Z)(yield this.managers.dialogsStorage.getForumTopic(e,t)));{const i=new g.Z({name:a?"CreateGeneralTopicTitle":"CreateTopicTitle"}),o=this.iconDiv=document.createElement("div");o.classList.add("edit-topic-icon-container"),!t&&(0,s.fc)(o,(()=>{this.topic.icon_emoji_id||(this.colorIndex=(this.colorIndex+1)%l.OS.length,this.setIcon())}),{listenerSetter:this.listenerSetter}),t&&o.classList.add("disable-hover");const c=document.createElement("div");c.classList.add("input-wrapper");const u=this.nameInputField=new f.ZP({label:"ForumTopic.Name.Placeholder",withLinebreaks:!1,name:"topic-name",maxLength:70,required:!0});this.topic&&u.setOriginalValue(this.topic.title,!0);const p=this.confirmBtn=(0,h.Z)("check btn-confirm blue hide",{noRipple:!0});this.header.append(p),(0,s.fc)(p,(()=>{const i=(0,n.Z)([p],!0);t?this.managers.appChatsManager.editForumTopic({chatId:r,topicId:t,title:u.value,iconEmojiId:this.topic.icon_emoji_id||0}).then((()=>{this.close()})).catch((e=>{console.error("edit topic error",e),i()})):this.managers.appChatsManager.createForumTopic({chatId:r,iconColor:l.OS[this.colorIndex],iconEmojiId:this.topic.icon_emoji_id,title:u.value}).then((t=>{this.close(),d.ZP.setInnerPeer({peerId:e,threadId:t})})).catch((e=>{console.error("create topic error",e),i()}))}),{listenerSetter:this.listenerSetter}),this.listenerSetter.add(u.input)("input",(()=>{var e;this.validate(),this.setIcon(null===(e=this.topic)||void 0===e?void 0:e.icon_emoji_id)})),c.append(u.container),i.content.append(o,c),this.scrollable.append(i.container)}const c=[];if(a){const e=new g.Z({caption:"EditTopicHideInfo"}),i=new u.Z({checked:!this.topic.pFlags.hidden,text:"EditTopicHide"});this.listenerSetter.add(i.input)("change",(()=>{const e=this.managers.appChatsManager.editForumTopic({chatId:r,topicId:t,hidden:!i.checked});s.disableWithPromise(e)}));const s=new m.ZP({checkboxField:i});e.content.append(s.container),this.scrollable.append(e.container)}else{const e=new g.Z({});e.container.classList.add("edit-topic-emoticons-container");const t=new p.ZP({managers:this.managers,isStandalone:!0,noRegularEmoji:!0,stickerSetId:"inputStickerSetEmojiDefaultTopicIcons",onClick:e=>{t.setActive(e.docId?e:{emoji:void 0,docId:void 0}),this.setIcon(e.docId)}});t.getContainerSize=()=>({width:v.ZP.rect.width,height:400}),this.middlewareHelper.onDestroy((()=>{t.destroy()})),t.container.classList.remove("tabs-tab"),this.emojiElement=document.createElement("span"),this.emojiElement.classList.add("super-emoji-topic-icon");const i=t.init().then((()=>w(this,void 0,void 0,(function*(){var e;const i=t.getCustomCategory(),s=null===(e=this.topic)||void 0===e?void 0:e.icon_emoji_id;t.addEmojiToCategory({category:i,element:this.emojiElement,batch:!1,prepend:!0,active:!s}),s&&t.setActive({docId:s,emoji:""})}))));c.push(i),e.content.replaceWith(t.container),this.scrollable.append(e.container)}return Promise.all(c).then((()=>this.s()))}))}validate(){let e=this.nameInputField.isValidToChange();!e&&this.originalTopic&&(e=this.topic.icon_emoji_id!==this.originalTopic.icon_emoji_id),this.confirmBtn.classList.toggle("hide",!e)}s(){var e,t;return(null===(e=this.topic)||void 0===e?void 0:e.icon_color)&&(this.colorIndex=l.OS.indexOf(this.topic.icon_color)),this.setIcon(null===(t=this.topic)||void 0===t?void 0:t.icon_emoji_id,void 0,!0)}setIcon(e,t=this.iconDiv,i){var s;return w(this,void 0,void 0,(function*(){const n=this.nameInputField.value,a=t===this.iconDiv;if(a){const t={id:null===(s=this.topic)||void 0===s?void 0:s.id,icon_color:l.OS[this.colorIndex],title:(0,c.Z)(n,!0).text||"A",icon_emoji_id:e},a=this.topic;if(this.topic=t,!i&&a&&a.icon_color===t.icon_color&&a.title===t.title||this.setIcon(void 0,this.emojiElement),(0,r.Z)(a,t)&&!i)return;this.validate()}const o=yield(0,y.e)({topic:a?this.topic:Object.assign(Object.assign({},this.topic),{icon_emoji_id:void 0}),customEmojiSize:S,middleware:this.middlewareHelper.get()}),d=document.createElement("div");d.classList.add("edit-topic-icon"),d.append(o);const h=t.lastElementChild;t.append(d);const u=(e,t)=>{const i=e.animate([{opacity:"0",transform:"scale(0.8)"},{opacity:"1",transform:"scale(1)"}],{duration:200,iterations:1,easing:"ease-in-out",fill:"forwards",direction:t?"normal":"reverse"});return new Promise((e=>{i.addEventListener("finish",(()=>{e()}),{once:!0})}))};h&&u(h,!1).then((()=>h.remove())),u(d,!0)}))}}},1669:(e,t,i)=>{"use strict";i.d(t,{Z:()=>ue});var s=i(3512),n=i(6360),a=i(3552),o=i(426),r=i(503),d=i(2621),l=i(7479),c=i(4494),h=i(2166),u=i(144),p=i(279),f=i(1218),m=i(2796),g=i(6726),v=i(6024),b=i(2325),y=i(8127),w=i(8119),S=i(2738),C=i(1656),L=i(9807),E=i(5029),I=i(9522),M=i(6082),Z=i(5102),P=i(2010),T=i(5592),k=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class x extends v.h{init(){return k(this,void 0,void 0,(function*(){this.container.classList.add("edit-peer-container","group-type-container");const e=yield this.managers.appChatsManager.isBroadcast(this.chatId);this.setTitle(e?"ChannelType":"GroupType");const t=new E.Z({name:e?"ChannelType":"GroupType"}),i=(0,u.a)(),n=new l.ZP({radioField:new f.Z({langKey:e?"ChannelPrivate":"MegaPrivate",name:i,value:"private"}),subtitleLangKey:e?"ChannelPrivateInfo":"MegaPrivateInfo"}),a=new l.ZP({radioField:new f.Z({langKey:e?"ChannelPublic":"MegaPublic",name:i,value:"public"}),subtitleLangKey:e?"ChannelPublicInfo":"MegaPublicInfo"}),o=(0,l.De)([n,a],(e=>{const t=[[v.container],[H]];"public"===e&&t.reverse(),t[0].forEach((e=>e.classList.remove("hide"))),t[1].forEach((e=>e.classList.add("hide"))),R()}));let r=yield this.managers.appChatsManager.getChat(this.chatId);const d={basic:[]};this.listenerSetter.add(s.Z)("chat_update",(e=>k(this,void 0,void 0,(function*(){this.chatId===e&&(r=yield this.managers.appChatsManager.getChat(this.chatId),d.basic.forEach((e=>e())))})))),t.content.append(o);const v=new E.Z({}),x=new l.ZP({title:this.chatFull.exported_invite.link,subtitleLangKey:e?"ChannelPrivateLinkHelp":"MegaPrivateLinkHelp",clickable:()=>{(0,h.T)(this.chatFull.exported_invite.link),(0,m.Am)(b.ZP.format("LinkCopied",!0))},listenerSetter:this.listenerSetter}),A=(0,c.Z)("btn-primary btn-transparent danger",{icon:"delete",text:"RevokeLink"});(0,S.fc)(A,(()=>{new y.Z("revoke-link",{buttons:[{langKey:"RevokeButton",callback:()=>{const e=(0,C.Z)([A],!0);this.managers.appProfileManager.getChatInviteLink(this.chatId,!0).then((t=>{e(),x.title.innerHTML=t}))}}],titleLangKey:"RevokeLink",descriptionLangKey:"RevokeAlert"}).show()}),{listenerSetter:this.listenerSetter}),v.content.append(x.container,A);const _=new E.Z({caption:!0,noDelimiter:!0}),F=document.createElement("div");F.classList.add("input-wrapper");const D="t.me/",R=()=>{const e=n.radioField.checked&&z!==D||B.isValidToChange()&&B.input.classList.contains("valid");j.classList.toggle("is-visible",e);const{error:t}=B,i="USERNAME_PURCHASE_AVAILABLE"===(null==t?void 0:t.type);N(i?B.getValue():void 0)},B=new g.l({label:"SetUrlPlaceholder",name:"group-public-link",plainText:!0,listenerSetter:this.listenerSetter,availableText:"Link.Available",invalidText:"Link.Invalid",takenText:"Link.Taken",onChange:R,peerId:this.chatId.toPeerId(!0),head:D},this.managers),{setUsername:N,element:O}=(0,P.J)();_.caption.append(O,(0,b.ag)(e?"Channel.UsernameAboutChannel":"Channel.UsernameAboutGroup"));const U=new I.Z({peerId:this.chatId.toPeerId(!0),peer:r,listenerSetter:this.listenerSetter,usernameInputField:B,middleware:this.middlewareHelper.get()}),H=document.createElement("div");H.append(_.container,U.container);const z=D+((0,M.Z)(r)||"");F.append(B.container),_.content.append(F);const j=(0,w.Z)({icon:"check",className:"is-visible"});this.content.append(j),(0,S.fc)(j,(()=>k(this,void 0,void 0,(function*(){const t=a.radioField.checked?B.getValue():"";if(!t){const t=yield this.managers.appChatsManager.getChat(this.chatId),i=(0,M.Z)(t);i&&(yield(0,T.Z)({descriptionLangKey:e?"ChannelVisibility.Confirm.MakePrivate.Channel":"ChannelVisibility.Confirm.MakePrivate.Group",descriptionLangArgs:[i],button:{langKey:"OK"}}))}(0,p.p)(j),this.managers.appChatsManager.migrateChat(this.chatId).then((e=>t?this.managers.appChatsManager.updateUsername(e,t):this.managers.appChatsManager.makeChannelPrivate(e))).then((()=>{this.close()}))}))),{listenerSetter:this.listenerSetter}),(z!==D||(0,Z.Z)(r).length?a:n).radioField.checked=!0,B.setOriginalValue(z,!0),this.scrollable.append(t.container,v.container,H);{const t=new E.Z({name:"SavingContentTitle",caption:e?"RestrictSavingContentInfoChannel":"RestrictSavingContentInfoGroup"}),i=new L.Z({text:"RestrictSavingContent",withRipple:!0});this.listenerSetter.add(i.input)("change",(()=>{const e=i.toggleDisability(!0);this.managers.appChatsManager.toggleNoForwards(this.chatId,i.checked).then((()=>{e()}))}));const s=()=>{i.setValueSilently(!!r.pFlags.noforwards)};((e,t="basic")=>{d[t].push(e)})(s),s(),t.content.append(i.label),this.scrollable.append(t.container)}}))}}var A=i(4668),_=i(5565),F=i(8936),D=i(5005),R=i(8479),B=i(7120),N=i(2946),O=i(2995),U=i(6848),H=i(3061),z=i(7362),j=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class G extends v.h{init(){return j(this,void 0,void 0,(function*(){let e;this.container.classList.add("edit-peer-container","user-permissions-container"),this.setTitle("UserRestrictions");const t=yield this.managers.appChatsManager.isChannel(this.chatId);{const t=new E.Z({name:"UserRestrictionsCanDo"}),i=document.createElement("div");i.classList.add("chatlist-container"),t.content.insertBefore(i,t.title);const s=D.default.createChatList({new:!0});i.append(s);const{dom:n}=D.default.addDialogNew({peerId:this.userId.toPeerId(!1),container:s,rippleEnabled:!0,avatarSize:"abitbigger"});n.lastMessageSpan.append((0,H.Z)(yield this.managers.appUsersManager.getUser(this.userId)));const a=new W({chatId:this.chatId,listenerSetter:this.listenerSetter,appendTo:t.content,participant:"channelParticipantBanned"===this.participant._?this.participant:void 0},this.managers);e=()=>{const e=a.takeOut();"channelParticipantBanned"===this.participant._&&(0,U.Z)(this.participant.banned_rights.pFlags,e.pFlags)||this.managers.appChatsManager.editBanned(this.chatId,this.participant,e)},this.eventListener.addEventListener("destroy",e,{once:!0}),this.scrollable.append(t.container)}{const i=new E.Z({});if("channelParticipantBanned"===this.participant._){const t=(0,c.Z)("btn-primary btn-transparent danger",{icon:"delete",text:"GroupPermission.Delete"});(0,S.fc)(t,(()=>{const i=(0,C.Z)([t],!0);this.managers.appChatsManager.clearChannelParticipantBannedRights(this.chatId,this.participant).then((()=>{this.eventListener.removeEventListener("destroy",e),this.close()}),(()=>{i()}))}),{listenerSetter:this.listenerSetter}),i.content.append(t)}const s=(0,c.Z)("btn-primary btn-transparent danger",{icon:"deleteuser",text:"UserRestrictionsBlock"});(0,S.fc)(s,(()=>j(this,void 0,void 0,(function*(){const i=(0,C.Z)([s],!0);try{const e=this.userId.toPeerId();yield(0,T.Z)({peerId:this.chatId.toPeerId(!0),descriptionLangKey:"Permissions.RemoveFromGroup",descriptionLangArgs:[yield(0,z.Z)({peerId:e})],titleLangKey:"ChannelBlockUser",button:{langKey:"Remove",isDanger:!0}}),t?yield this.managers.appChatsManager.kickFromChannel(this.chatId,this.participant):yield this.managers.appChatsManager.kickFromChat(this.chatId,this.participant)}catch(e){return void i()}this.eventListener.removeEventListener("destroy",e),this.close()}))),{listenerSetter:this.listenerSetter}),i.content.append(s),this.scrollable.append(i.container)}}))}}var V=i(8610),K=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class W extends V.Z{constructor(e,t){super({listenerSetter:e.listenerSetter,fields:[],asRestrictions:!0}),this.options=e,this.managers=t,this.construct()}construct(){return K(this,void 0,void 0,(function*(){const e=this.options,t=this.chat=yield this.managers.appChatsManager.getChat(e.chatId),i=this.defaultBannedRights=t.default_banned_rights,s=this.rights=e.participant?function(e,t){if(e.default_banned_rights){t=(0,R.Z)(t);const i=e.default_banned_rights.pFlags;for(const e in i)t.pFlags[e]=i[e]}return t}(t,e.participant.banned_rights):i,n=[{flags:["send_photos"],text:"UserRestrictionsSendPhotos",exceptionText:"UserRestrictionsNoSendPhotos"},{flags:["send_videos"],text:"UserRestrictionsSendVideos",exceptionText:"UserRestrictionsNoSendVideos"},{flags:["send_stickers","send_gifs"],text:"UserRestrictionsSendStickers",exceptionText:"UserRestrictionsNoSendStickers"},{flags:["send_audios"],text:"UserRestrictionsSendMusic",exceptionText:"UserRestrictionsNoSendMusic"},{flags:["send_docs"],text:"UserRestrictionsSendFiles",exceptionText:"UserRestrictionsNoSendDocs"},{flags:["send_voices"],text:"UserRestrictionsSendVoices",exceptionText:"UserRestrictionsNoSendVoice"},{flags:["send_roundvideos"],text:"UserRestrictionsSendRound",exceptionText:"UserRestrictionsNoSendRound"},{flags:["embed_links"],text:"UserRestrictionsEmbedLinks",exceptionText:"UserRestrictionsNoEmbedLinks"},{flags:["send_polls"],text:"UserRestrictionsSendPolls",exceptionText:"UserRestrictionsNoSendPolls"}],a=n,o=[{flags:["send_plain"],text:"UserRestrictionsSend",exceptionText:"UserRestrictionsNoSend"},{flags:["send_media"],text:"UserRestrictionsSendMedia",exceptionText:"UserRestrictionsNoSendMedia",nested:n},{flags:["invite_users"],text:"UserRestrictionsInviteUsers",exceptionText:"UserRestrictionsNoInviteUsers"},{flags:["pin_messages"],text:"UserRestrictionsPinMessages",exceptionText:"UserRestrictionsNoPinMessages"},{flags:["change_info"],text:"UserRestrictionsChangeInfo",exceptionText:"UserRestrictionsNoChangeInfo"}],r={};o.push(...n),o.forEach((e=>{const i=e.flags[0];r[i]=e,e.checked=(0,B.Z)(t,i,s)})),n.forEach((e=>e.nestedTo=r.send_media)),r.send_media.toggleWith={unchecked:a,checked:a},r.embed_links.toggleWith={checked:[r.send_plain]},r.send_plain.toggleWith={unchecked:[r.embed_links]},this.fields=o;for(const s of this.fields){if((this.options.participant&&i.pFlags[s.flags[0]]||(0,Z.Z)(t)[0]&&(s.flags.includes("pin_messages")||s.flags.includes("change_info")))&&(s.restrictionText=this.restrictionText),s.nestedTo)continue;const{nodes:n}=this.createField(s);e.appendTo.append(...n)}}))}takeOut(){const e={_:"chatBannedRights",until_date:2147483647,pFlags:{}},t=new Set(["send_media"]);for(const i of this.fields)!i.checkboxField.checked&&i.flags.forEach((i=>{t.has(i)||(e.pFlags[i]=!0)}));return e}}class $ extends v.h{init(){return K(this,void 0,void 0,(function*(){let e;this.container.classList.add("edit-peer-container","group-permissions-container"),this.setTitle("ChannelPermissions");{const t=new E.Z({name:"ChannelPermissionsHeader"});e=new W({chatId:this.chatId,listenerSetter:this.listenerSetter,appendTo:t.content},this.managers),this.eventListener.addEventListener("destroy",(()=>{this.managers.appChatsManager.editChatDefaultBannedRights(this.chatId,e.takeOut())}),{once:!0}),this.scrollable.append(t.container)}{const t=new E.Z({name:"PrivacyExceptions"}),i=new l.ZP({titleLangKey:"ChannelAddException",subtitleLangKey:"Loading",icon:"adduser",clickable:()=>{new O.Z({peerTypes:["channelParticipants"],onSelect:e=>{setTimeout((()=>{n(e)}),0)},placeholder:"ExceptionModal.Search.Placeholder",peerId:-this.chatId})},listenerSetter:this.listenerSetter}),n=e=>K(this,void 0,void 0,(function*(){let t;try{t=yield this.managers.appProfileManager.getParticipant(this.chatId,e)}catch(e){return void(0,m.Am)("User is no longer participant")}const i=this.slider.createTab(G);i.participant=t,i.chatId=this.chatId,i.userId=e,i.open()}));t.content.append(i.container);const a=t.generateContentElement();a.classList.add("chatlist-container");const o=D.default.createChatList({new:!0});a.append(o),(0,S.fc)(o,(e=>{const t=(0,A.Z)(e.target,D.DIALOG_LIST_ELEMENT_TAG);if(!t)return;const i=t.dataset.peerId.toPeerId();n(i)}),{listenerSetter:this.listenerSetter});const r=(t,i)=>K(this,void 0,void 0,(function*(){const s=i.banned_rights,n=(yield this.managers.appChatsManager.getChat(this.chatId)).default_banned_rights,a=[];e.fields.forEach((e=>{const t=e.flags[0];s.pFlags[t]&&!n.pFlags[t]&&a.push(e.exceptionText)}));const o=t.lastMessageSpan;a.length&&o.replaceChildren(...(0,b.v_)(a.map((e=>(0,b.ag)(e))),!1)),o.classList.toggle("hide",!a.length)})),d=(e,t)=>{const{dom:i}=D.default.addDialogNew({peerId:(0,N.Z)(e.peer),container:o,rippleEnabled:!0,avatarSize:"abitbigger",append:t});i.listEl.dialogDom=i,r(i,e)};this.listenerSetter.add(s.Z)("chat_participant",(e=>{var t,i,s;const n="channelParticipantBanned"===(null===(t=e.new_participant)||void 0===t?void 0:t._)&&!e.new_participant.banned_rights.pFlags.view_messages,a=o.querySelector(`[data-peer-id="${e.user_id}"]`);n?(a?r(a.dialogDom,e.new_participant):d(e.new_participant,!1),"channelParticipantBanned"!==(null===(i=e.prev_participant)||void 0===i?void 0:i._)&&++u):(null==a||a.remove(),"channelParticipantBanned"===(null===(s=e.prev_participant)||void 0===s?void 0:s._)&&--u),c()}));const c=()=>{(0,_.Z)(i.subtitle,(0,b.ag)(u?"Permissions.ExceptionsCount":"Permissions.NoExceptions",[u]))};let h,u=0;const p=()=>(h=new F.Z({scrollable:this.scrollable,getPromise:()=>this.managers.appProfileManager.getChannelParticipants(this.chatId,{_:"channelParticipantsBanned",q:""},50,o.childElementCount).then((e=>{for(const t of e.participants)d(t,!0);return u=e.count,c(),e.participants.length<50||e.count===o.childElementCount}))}),h.load());this.scrollable.append(t.container),(yield this.managers.appChatsManager.isChannel(this.chatId))?yield p():(c(),this.listenerSetter.add(s.Z)("dialog_migrate",(({migrateFrom:e,migrateTo:t})=>{this.chatId===e&&(this.chatId=t,p())})))}}))}onOpenAfterTimeout(){this.scrollable.onScroll()}}var q=i(6194),Y=i(5701),Q=i(62),X=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class J extends v.h{init(){var e;return X(this,void 0,void 0,(function*(){this.setTitle("Reactions");const t=yield this.managers.appReactionsManager.getActiveAvailableReactions(),i=yield this.managers.appProfileManager.getChatFull(this.chatId),s=yield this.managers.appChatsManager.isBroadcast(this.chatId);let n=null!==(e=i.available_reactions)&&void 0!==e?e:{_:"chatReactionsNone"},a=n,o=new Set("chatReactionsSome"===n._?n.reactions.map((e=>e.emoticon)):[]);const r=e=>e.map((e=>({_:"reactionEmoji",emoticon:e}))),d=()=>s?"EnableReactionsChannelInfo":"chatReactionsAll"===a._?"EnableAllReactionsInfo":"chatReactionsNone"===a._?"DisableReactionsInfo":"EnableSomeReactionsInfo",c=new E.Z({name:s?void 0:"AvailableReactions",caption:d()}),h=new E.Z({name:"OnlyAllowThisReactions"}),u=()=>{var e;const t=null!==(e=a.reactions)&&void 0!==e?e:[];o=new Set(t.map((({emoticon:e})=>e))),f.forEach(((e,t)=>{e.setValueSilently(o.has(t))}))};let p;if(s){p=new L.Z({toggle:!0,checked:"chatReactionsSome"===n._});const e=new l.ZP({checkboxField:p,titleLangKey:"EnableReactions",listenerSetter:this.listenerSetter});c.content.append(e.container),this.listenerSetter.add(p.input)("change",(()=>{let e=!0;p.checked?m.every((e=>!e.checked))?a={_:"chatReactionsSome",reactions:r(t.map((({reaction:e})=>e)))}:"chatReactionsSome"!==a._?a={_:"chatReactionsSome",reactions:r(Array.from(o))}:e=!1:a={_:"chatReactionsNone"},e&&(u(),v())}))}else{const e=[["chatReactionsAll","AllReactions"],["chatReactionsSome","SomeReactions"],["chatReactionsNone","NoReactions"]],t=()=>{h.container.classList.toggle("hide","chatReactionsSome"!==a._)};let i=n._;const s=(0,l.ZC)(e.map((([e,t])=>({langPackKey:t,value:e,checked:n._===e}))),(e=>{i=e,a="chatReactionsAll"===i?{_:i,pFlags:{allow_custom:!0}}:"chatReactionsNone"===i?{_:i}:{_:i,reactions:r(["👍","👎"])},(0,_.Z)(c.caption,(0,b.ag)(d())),u(),v(),t()}));c.content.append(s),t()}const f=new Map,m=t.map((e=>{const t=e.reaction,i=new L.Z({toggle:!0,checked:o.has(t)});f.set(t,i),this.listenerSetter.add(i.input)("change",(()=>{i.checked?(o.add(t),p&&!p.checked&&(p.checked=!0)):(o.delete(t),(null==p?void 0:p.checked)&&!o.size&&(p.checked=!1)),v()}));const s=new l.ZP({checkboxField:i,title:e.title,havePadding:!0,listenerSetter:this.listenerSetter});return(0,Q.Z)({row:s,doc:e.static_icon,size:"small"}),h.content.append(s.container),i})),g=()=>X(this,void 0,void 0,(function*(){v.clearTimeout(),"chatReactionsSome"===a._&&(a.reactions=r(Array.from(o))),this.managers.appChatsManager.setChatAvailableReactions(this.chatId,a),n=a})),v=(0,Y.Z)(g,3e3,!1,!0);this.eventListener.addEventListener("destroy",(()=>{v.isDebounced()&&g()}),{once:!0}),this.scrollable.append(c.container,h.container)}))}}var ee=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class te extends a._{_init(){return ee(this,void 0,void 0,(function*(){this.listenerSetter.removeAll(),this.scrollable.container.replaceChildren(),this.container.classList.add("edit-peer-container","edit-group-container"),this.setTitle("Edit");let[e,t,i,n,a,o,h,u]=yield Promise.all([this.managers.appProfileManager.getChatFull(this.chatId,!0),this.managers.appChatsManager.getChat(this.chatId),this.managers.appChatsManager.isBroadcast(this.chatId),this.managers.appChatsManager.isChannel(this.chatId),this.managers.appChatsManager.hasRights(this.chatId,"change_type"),this.managers.appChatsManager.hasRights(this.chatId,"change_permissions"),this.managers.appChatsManager.hasRights(this.chatId,"manage_topics"),this.managers.apiManager.getAppConfig()]);const p={full:[],basic:[]},f=(e,t="basic")=>{p[t].push(e)};this.listenerSetter.add(s.Z)("chat_update",(e=>ee(this,void 0,void 0,(function*(){this.chatId===e&&(t=yield this.managers.appChatsManager.getChat(this.chatId),p.basic.forEach((e=>e())))})))),this.listenerSetter.add(s.Z)("chat_full_update",(t=>ee(this,void 0,void 0,(function*(){this.chatId===t&&(e=(yield this.managers.appProfileManager.getCachedFullChat(t))||e,p.full.forEach((e=>e())))}))));const m=this.chatId.toPeerId(!0);{const s=new E.Z({noDelimiter:!0,caption:!0}),n=[],c=document.createElement("div");if(c.classList.add("input-wrapper"),this.chatNameInputField=new r.ZP({label:i?"EnterChannelName":"CreateGroup.NameHolder",name:"chat-name",maxLength:255,required:!0}),this.descriptionInputField=new r.ZP({label:"DescriptionPlaceholder",name:"chat-description",maxLength:255}),this.chatNameInputField.setOriginalValue(t.title),this.descriptionInputField.setOriginalValue(e.about),c.append(this.chatNameInputField.container,this.descriptionInputField.container),n.push(this.chatNameInputField,this.descriptionInputField),this.editPeer=new d.Z({peerId:m,inputFields:n,listenerSetter:this.listenerSetter,popupOptions:{isForum:t.pFlags.forum}}),this.content.append(this.editPeer.nextBtn),s.content.append(this.editPeer.avatarEdit.container,c),a){const n=new l.ZP({titleLangKey:i?"ChannelType":"GroupType",clickable:()=>{const t=this.slider.createTab(x);t.chatId=this.chatId,t.chatFull=e,t.open()},icon:"lock",listenerSetter:this.listenerSetter}),a=()=>{let e;const s=(0,Z.Z)(t)[0];e=i?s?"TypePublic":"TypePrivate":s?"TypePublicGroup":"TypePrivateGroup",n.subtitle.replaceChildren((0,b.ag)(e))};a(),f(a),s.content.append(n.container)}if(a||o){const t=new l.ZP({titleLangKey:"Reactions",icon:"reactions",clickable:()=>{const e=this.slider.createTab(J);e.chatId=this.chatId,e.open()},listenerSetter:this.listenerSetter}),i=(yield this.managers.appReactionsManager.getAvailableReactions()).filter((e=>!e.pFlags.inactive)).length,n=()=>{var s;const n=null!==(s=e.available_reactions)&&void 0!==s?s:{_:"chatReactionsNone"};if("chatReactionsSome"===n._){const e=n.reactions.length;e===i?(0,_.Z)(t.subtitle,(0,b.ag)("ReactionsAll")):t.subtitle.textContent=e+"/"+i}else(0,_.Z)(t.subtitle,(0,b.ag)("chatReactionsAll"===n._?"ReactionsAll":"Checkbox.Disabled"))};n(),f(n,"full"),s.content.append(t.container)}if(o&&!i){const e=["send_stickers","send_polls","send_photos","send_videos","send_roundvideos","send_audios","send_voices","send_docs","send_plain","embed_links","invite_users","pin_messages","change_info"],i=new l.ZP({titleLangKey:"ChannelPermissions",clickable:()=>{const e=this.slider.createTab($);e.chatId=this.chatId,e.open()},icon:"permissions",listenerSetter:this.listenerSetter}),n=()=>{i.subtitle.textContent=e.reduce(((e,i)=>e+ +(0,B.Z)(t,i,t.default_banned_rights)),0)+"/"+e.length};n(),f(n),s.content.append(i.container)}if(h&&(t.participants_count>=u.forum_upgrade_participants_min||t.pFlags.forum)&&!i){const e=new l.ZP({checkboxField:new L.Z({toggle:!0}),titleLangKey:"Topics",clickable:()=>{},icon:"topics",listenerSetter:this.listenerSetter}),i=()=>{const i=!!t.pFlags.forum;this.editPeer.avatarElem.parentElement.classList.toggle("is-forum",i),e.checkboxField.setValueSilently(i)};this.listenerSetter.add(e.checkboxField.input)("change",(t=>{if(!t.isTrusted)return;const i=this.managers.appChatsManager.toggleForum(this.chatId,e.checkboxField.checked);e.disableWithPromise(i)})),i(),f(i),s.caption.replaceChildren((0,b.ag)("ForumToggleDescription")),s.content.append(e.container)}if(s.caption.classList.toggle("hide",!s.caption.childElementCount),this.scrollable.append(s.container),(0,S.fc)(this.editPeer.nextBtn,(()=>{this.editPeer.nextBtn.disabled=!0;const e=[],t=this.chatId;this.chatNameInputField.isValidToChange()&&e.push(this.managers.appChatsManager.editTitle(t,this.chatNameInputField.value)),this.descriptionInputField.isValidToChange()&&e.push(this.managers.appChatsManager.editAbout(t,this.descriptionInputField.value)),this.editPeer.uploadAvatar&&e.push(this.editPeer.uploadAvatar().then((e=>this.managers.appChatsManager.editPhoto(t,e)))),Promise.race(e).finally((()=>{this.editPeer.nextBtn.removeAttribute("disabled"),this.close()}))}),{listenerSetter:this.listenerSetter}),i&&(yield this.managers.appChatsManager.hasRights(this.chatId,"change_info"))){const e=new L.Z({text:"ChannelSignMessages",checked:!!t.pFlags.signatures});this.listenerSetter.add(e.input)("change",(()=>{const t=e.toggleDisability(!0);this.managers.appChatsManager.toggleSignatures(this.chatId,e.checked).then((()=>{t()}))})),f((()=>{e.setValueSilently(!!t.pFlags.signatures)})),s.content.append((0,l.tG)(e).container)}}if(!i){const t=new E.Z({});if(!i&&a){const i=new L.Z({text:"ChatHistory"});this.listenerSetter.add(i.input)("change",(()=>{const e=i.toggleDisability(!0);this.managers.appChatsManager.togglePreHistoryHidden(this.chatId,!i.checked).then((()=>{e()}))}));const s=()=>{i.setValueSilently(n&&!e.pFlags.hidden_prehistory)};s(),f(s),t.content.append((0,l.tG)(i).container)}t.content.childElementCount&&this.scrollable.append(t.container)}if(yield this.managers.appChatsManager.hasRights(this.chatId,"delete_chat")){const e=new E.Z({}),t=(0,c.Z)("btn-primary btn-transparent danger",{icon:"delete",text:i?"PeerInfo.DeleteChannel":"DeleteAndExitButton"});(0,S.fc)(t,(()=>{new q.Z(m,void 0,(e=>{const i=(0,C.Z)([t],!0);e.then((()=>{this.close()}),(()=>{i()}))}))}),{listenerSetter:this.listenerSetter}),e.content.append(t),this.scrollable.append(e.container)}n||this.listenerSetter.add(s.Z)("dialog_migrate",(({migrateFrom:e,migrateTo:t})=>{m===e&&(this.chatId=t.toChatId(),this._init())}))}))}init(){return this._init()}}var ie=i(8842),se=i(4240),ne=i(2230),ae=i(5670),oe=i(8261),re=i(4993),de=i(730),le=i(5994),ce=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const he={};class ue extends a._{init(){this.container.classList.add("shared-media-container","profile-container");const e=(0,c.Z)("btn-icon sidebar-close-button",{noRipple:!0});this.closeBtn.replaceWith(e),this.closeBtn=e;const t=document.createElement("div");t.classList.add("animated-close-icon"),e.append(t),this.isFirst&&t.classList.add("state-back");const i=document.createElement("div");i.className="transition slide-fade";const a=document.createElement("div");a.classList.add("transition-item"),this.titleI18n=new b.ZP.IntlElement,this.title.append(this.titleI18n.element),this.editBtn=(0,ne.Z)("edit"),a.append(this.title,this.editBtn);const r=document.createElement("div");r.classList.add("transition-item");const d=this.title.cloneNode();d.append((0,b.ag)("PeerInfo.SharedMedia")),r.append(d),i.append(a,r),this.header.append(i),this.profile=new oe.Z(this.managers,this.scrollable,this.listenerSetter),this.profile.init(),this.scrollable.append(this.profile.element),this.scrollable.onAdditionalScroll=()=>{const e=this.searchSuper.nav.getBoundingClientRect();if(!e.width)return;const t=e.top-1;l(t<=56)};const l=e=>{t.classList.toggle("state-back",this.isFirst||e),this.searchSuper.container.classList.toggle("is-full-viewport",e),h(+e),e||this.searchSuper.cleanScrollPositions()},h=(0,o.Z)({content:i,type:"slide-fade",transitionTime:400,isHeavy:!1});h(0),(0,S.fc)(this.closeBtn,(e=>{h.prevId()?(this.scrollable.scrollIntoViewNew({element:this.scrollable.container.firstElementChild,position:"start"}),h(0),this.isFirst||t.classList.remove("state-back")):this.scrollable.isHeavyAnimationInProgress||this.slider.onCloseBtnClick()}),{listenerSetter:this.listenerSetter}),(0,S.fc)(this.editBtn,(()=>ce(this,void 0,void 0,(function*(){let e;const{peerId:t,threadId:i}=this;e=i&&(yield this.managers.appPeersManager.isForum(t))?this.slider.createTab(de.Z):t.isAnyChat()?this.slider.createTab(te):this.slider.createTab(se.Z),e&&(e instanceof de.Z?e.open(t,this.threadId):(e instanceof te?e.chatId=t.toChatId():e.peerId=t,e.open()))}))),{listenerSetter:this.listenerSetter}),this.listenerSetter.add(s.Z)("contacts_update",(e=>{this.peerId===e&&this.toggleEditBtn()})),this.listenerSetter.add(s.Z)("chat_update",(e=>{this.peerId===e.toPeerId(!0)&&this.toggleEditBtn()})),this.listenerSetter.add(s.Z)("history_multiappend",(e=>{this.renderNewMessage(e)})),this.listenerSetter.add(s.Z)("history_delete",(({peerId:e,msgs:t})=>{this.deleteDeletedMessages(e,Array.from(t))})),this.listenerSetter.add(s.Z)("message_sent",(({message:e})=>{this.renderNewMessage(e)})),this.searchSuper=new n.Z({mediaTabs:[{inputFilter:"inputMessagesFilterEmpty",name:"PeerMedia.Members",type:"members"},{inputFilter:"inputMessagesFilterPhotoVideo",name:"SharedMediaTab2",type:"media"},{inputFilter:"inputMessagesFilterDocument",name:"SharedFilesTab2",type:"files"},{inputFilter:"inputMessagesFilterUrl",name:"SharedLinksTab2",type:"links"},{inputFilter:"inputMessagesFilterMusic",name:"SharedMusicTab2",type:"music"},{inputFilter:"inputMessagesFilterRoundVoice",name:"SharedVoiceTab2",type:"voice"},{inputFilter:"inputMessagesFilterEmpty",name:"ChatList.Filter.Groups",type:"groups"}],scrollable:this.scrollable,onChangeTab:e=>{const t="members"===e.type&&le.Z.isAvailable("animations")?250:0;setTimeout((()=>{u.classList.toggle("is-hidden","members"!==e.type)}),t)},managers:this.managers}),this.searchSuper.scrollStartCallback=()=>{l(!0)},this.profile.element.append(this.searchSuper.container);const u=(0,w.Z)({icon:"addmember_filled"});this.content.append(u),(0,S.fc)(u,(()=>ce(this,void 0,void 0,(function*(){const e=this.peerId,t=this.peerId.toChatId(),i=yield this.managers.appChatsManager.isChannel(t),s=(t,s)=>{let n,a,o,r,d;if(t.length>1)n="AddMembersAlertTitle",a=[(0,b.ag)("Members",[t.length])],o="AddMembersAlertCountText",r=t.map((e=>{const t=document.createElement("b");return t.append(new ie.Z({peerId:e}).element),t})),i||(d=[{text:"AddMembersForwardMessages",checked:!0}]);else{n="AddOneMemberAlertTitle",o="AddMembersAlertNamesText";const e=document.createElement("b");e.append(new ie.Z({peerId:t[0]}).element),r=[e],i||(d=[{text:"AddOneMemberForwardMessages",textArgs:[new ie.Z({peerId:t[0]}).element],checked:!0}])}r.push(new ie.Z({peerId:e}).element),new y.Z("popup-add-members",{peerId:e,titleLangKey:n,descriptionLangKey:o,descriptionLangArgs:r,buttons:[{langKey:"Add",callback:s}],checkboxes:d}).show()},n=e=>{"USER_PRIVACY_RESTRICTED"===e.type&&(0,m.bC)({langPackKey:"InviteToGroupError"})};if(i){const e=this.slider.createTab(ae.Z);e.open({type:"channel",skippable:!1,takeOut:i=>(s(i,(()=>{const s=this.managers.appChatsManager.inviteToChannel(t,i);s.catch(n),e.attachToPromise(s)})),!1),title:"GroupAddMembers",placeholder:"SendMessageTo"})}else new O.Z({peerTypes:["contacts"],placeholder:"Search",onSelect:e=>{setTimeout((()=>{s([e],(i=>{this.managers.appChatsManager.addChatUser(t,e,i.size?void 0:0).catch(n)}))}),0)}})}))),{listenerSetter:this.listenerSetter})}_renderNewMessage(e,t){var i;const s=null===(i=he[e.peerId])||void 0===i?void 0:i[t];if(s)for(const t of this.searchSuper.mediaTabs){const i=t.inputFilter,n=s[i];if(!n)continue;const a=this.searchSuper.filterMessagesByType([e],i).filter((e=>!n.find((t=>t.mid===e.mid&&t.peerId===e.peerId))));a.length&&(n.unshift(...a.map((e=>({mid:e.mid,peerId:e.peerId})))),this.peerId===e.peerId&&-1!==this.searchSuper.usedFromHistory[i]&&(this.searchSuper.usedFromHistory[i]+=a.length,this.searchSuper.performSearchResult(a,t,!1)))}}renderNewMessage(e){return ce(this,void 0,void 0,(function*(){if(this.init)return;const{peerId:t}=e,i=yield this.managers.appPeersManager.isForum(t),s=(0,re.Z)(e,i);this._renderNewMessage(e),s&&this._renderNewMessage(e,s)}))}_deleteDeletedMessages(e,t,i){for(const s of i)for(const i of this.searchSuper.mediaTabs){const n=i.inputFilter,a=e[n];if(!a)continue;const o=a.findIndex((e=>e.mid===s));if(-1!==o&&(a.splice(o,1),this.peerId===t)){const e=this.searchSuper.tabs[n].querySelector(`[data-mid="${s}"][data-peer-id="${t}"]`);e&&(this.searchSuper.selection.isSelecting&&this.searchSuper.selection.toggleByElement(e),e.remove()),this.searchSuper.usedFromHistory[n]>=o+1&&--this.searchSuper.usedFromHistory[n]}}}deleteDeletedMessages(e,t){if(this.init)return;const i=he[e];if(i){for(const s in i)this._deleteDeletedMessages(i[s],e,t);this.scrollable.onScroll()}}cleanupHTML(){return ce(this,void 0,void 0,(function*(){const e=this.peerId.isAnyChat(),[t,i]=yield Promise.all([!!e&&this.searchSuper.canViewMembers(),!!e&&this.managers.appChatsManager.hasRights(this.peerId.toChatId(),"invite_users")]);return()=>{this.profile.cleanupHTML(),this.editBtn.classList.add("hide"),this.searchSuper.cleanupHTML(!0),this.container.classList.toggle("can-add-members",t&&i)}}))}setLoadMutex(e){this.searchSuper.loadMutex=e}setPeer(e,t){var i,s,n;return(this.peerId!==e||this.threadId!==t)&&(this.peerId=e,this.threadId=t,this.peerChanged=!0,this.init&&(this.init(),this.init=null),this.searchSuper.setQuery({peerId:e,threadId:t,historyStorage:null!==(s=(n=null!==(i=he[e])&&void 0!==i?i:he[e]={})[t])&&void 0!==s?s:n[t]={}}),this.profile.setPeer(e,t),!0)}changeTitleKey(){return ce(this,void 0,void 0,(function*(){const e=this.managers.appPeersManager.isForum(this.peerId);return()=>{this.titleI18n.compareAndUpdate({key:this.threadId&&e?"AccDescrTopic":"Profile"})}}))}fillProfileElements(){return ce(this,void 0,void 0,(function*(){if(!this.peerChanged)return;this.peerChanged=!1;const e=yield Promise.all([this.cleanupHTML(),this.toggleEditBtn(!0),this.profile.fillProfileElements(),this.changeTitleKey()]);return()=>{e.forEach((e=>{null==e||e()}))}}))}toggleEditBtn(e){return ce(this,void 0,void 0,(function*(){let t;if(this.peerId.isUser())t=this.peerId!==s.Z.myId&&(yield this.managers.appUsersManager.isContact(this.peerId.toUserId()));else{const e=this.peerId.toChatId(),i=this.threadId&&(yield this.managers.appChatsManager.isForum(e));t=yield this.managers.appChatsManager.hasRights(e,i?"manage_topics":"change_info")}const i=()=>{this.editBtn.classList.toggle("hide",!t)};return e?i:i()}))}loadSidebarMedia(e,t){this.searchSuper.load(e,t)}onOpenAfterTimeout(){super.onOpenAfterTimeout(),this.scrollable.onScroll()}onCloseAfterTimeout(){super.onCloseAfterTimeout(),this.destroyable&&(this.profile.destroy(),this.searchSuper.destroy())}destroy(){this.destroyable=!0,this.onCloseAfterTimeout()}}},9099:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(5994);const n=e=>{const{element:t,className:i,forwards:a,duration:o,onTransitionEnd:r,onTransitionStart:d,useRafs:l}=e,{timeout:c,raf:h}=t.dataset;if(void 0!==c&&clearTimeout(+c),void 0!==h&&(window.cancelAnimationFrame(+h),l||delete t.dataset.raf),l&&s.Z.isAvailable("animations")&&o)return void(t.dataset.raf=""+window.requestAnimationFrame((()=>{delete t.dataset.raf,n(Object.assign(Object.assign({},e),{useRafs:l-1}))})));a&&i&&t.classList.add(i);const u=()=>{delete t.dataset.timeout,!a&&i&&t.classList.remove("backwards",i),t.classList.remove("animating"),null==r||r()};if(null==d||d(),!s.Z.isAvailable("animations")||!o)return t.classList.remove("animating","backwards"),void u();t.classList.add("animating"),t.classList.toggle("backwards",!a),t.dataset.timeout=""+setTimeout(u,o)},a=n},3552:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l,_:()=>a.Z});var s=i(426),n=i(5824),a=i(6024),o=i(1655),r=i(5953),d=i(3624);class l{constructor(e){var t;this.historyTabIds=[],this.canHideFirst=!1,this.onCloseBtnClick=()=>{n.Z.findItemByType(this.navigationType)?n.Z.back(this.navigationType):this.historyTabIds.length&&this.closeTab(this.historyTabIds[this.historyTabIds.length-1])},this.closeTab=(e,t,i)=>{if(void 0!==e&&this.historyTabIds[this.historyTabIds.length-1]!==e)return this.removeTabFromHistory(e),!1;const s=this.historyTabIds.pop();this.onCloseTab(s,t,i);const n=this.historyTabIds[this.historyTabIds.length-1];return this._selectTab(void 0!==n?n instanceof a.Z?n.container:n:this.canHideFirst?-1:0,t),!0},(0,r.Z)(this,e),null!==(t=this.tabs)&&void 0!==t||(this.tabs=new Map),this.tabsContainer=this.sidebarEl.querySelector(".sidebar-slider"),this._selectTab=(0,s.Z)({content:this.tabsContainer,type:"navigation",transitionTime:250}),this.canHideFirst||this._selectTab(0),this.middlewareHelper=(0,d.k)()}getMiddleware(){return this.middlewareHelper.get()}selectTab(e){var t,i,s,o,r;return i=this,s=void 0,r=function*(){if(this.historyTabIds[this.historyTabIds.length-1]===e)return!1;const i=e instanceof a.Z?e:this.tabs.get(e);return this.onOpenTab&&(yield this.onOpenTab()),i&&(null===(t=i.onOpen)||void 0===t||t.call(i),i.onOpenAfterTimeout&&setTimeout((()=>{i.onOpenAfterTimeout()}),250)),n.Z.pushItem({type:this.navigationType,onPop:e=>(this.closeTab(void 0,e,!0),!0)}),this.historyTabIds.push(e),this._selectTab(e instanceof a.Z?e.container:e),!0},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{d(r.next(e))}catch(e){t(e)}}function a(e){try{d(r.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(n,a)}d((r=r.apply(i,s||[])).next())}))}removeTabFromHistory(e){(0,o.Z)(this.historyTabIds,e),this.onCloseTab(e,void 0)}sliceTabsUntilTab(e,t){for(let i=this.historyTabIds.length-1;i>=0;--i){const s=this.historyTabIds[i];if(s!==t){if(s instanceof e)break;this.removeTabFromHistory(s)}}}getTab(e){return this.historyTabIds.find((t=>t instanceof e))}getHistory(){return this.historyTabIds}isTabExists(e){return!!this.getTab(e)}onCloseTab(e,t,i){var s;i||n.Z.removeByType(this.navigationType,!0);const o=e instanceof a.Z?e:this.tabs.get(e);if(o){try{null===(s=o.onClose)||void 0===s||s.call(o)}catch(e){console.error("tab onClose error",o)}o.onCloseAfterTimeout&&setTimeout((()=>{o.onCloseAfterTimeout()}),280)}}addTab(e){e.container.parentElement||(this.tabsContainer.append(e.container),e.closeBtn&&e.closeBtn.addEventListener("click",this.onCloseBtnClick))}deleteTab(e){this.tabs.delete(e)}createTab(e,t=!0,i){const s=new e(i?void 0:this,t);return s.managers=this.managers,s}}},6024:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c,h:()=>h});var s=i(3241),n=i(3699),a=i(3624),o=i(319),r=i(2325),d=i(2230),l=i(8805);class c{constructor(e,t){this._constructor(e,t)}_constructor(e,t=!0){var i;this.slider=e,this.middlewareHelper=e?e.getMiddleware().create():(0,a.k)(),this.destroyable=t,this.container=document.createElement("div"),this.container.classList.add("tabs-tab","sidebar-slider-item"),this.header=document.createElement("div"),this.header.classList.add("sidebar-header"),this.closeBtn=(0,d.Z)("left sidebar-close-button",{noRipple:!0}),this.title=document.createElement("div"),this.title.classList.add("sidebar-header__title"),this.header.append(this.closeBtn,this.title),this.content=document.createElement("div"),this.content.classList.add("sidebar-content"),this.scrollable=new l.ZP(this.content,void 0,void 0,!0),this.scrollable.attachBorderListeners(this.container),this.container.append(this.header,this.content),null===(i=this.slider)||void 0===i||i.addTab(this),this.listenerSetter=new n.Z}close(){return this.slider.closeTab(this)}open(...e){return t=this,i=void 0,n=function*(){if(this.init)try{const t=this.init(...e);this.init=null,t instanceof Promise&&(yield t)}catch(e){console.error("open tab error",e)}this.slider.selectTab(this)},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n}init(...e){}onOpen(){}onOpenAfterTimeout(){}onClose(){}onCloseAfterTimeout(){var e,t,i;this.destroyable&&(null===(e=this.slider)||void 0===e||e.deleteTab(this),this.container.remove(),this.scrollable.destroy(),null===(t=this.listenerSetter)||void 0===t||t.removeAll(),null===(i=this.middlewareHelper)||void 0===i||i.destroy())}setTitle(e){this.title.replaceChildren((0,r.ag)(e))}}class h extends c{constructor(e){super(e),this.eventListener=new s.Z}onClose(){this.eventListener.dispatchEvent("close")}onCloseAfterTimeout(){const e=this.eventListener.dispatchResultableEvent("destroy");return this.eventListener.dispatchEvent("destroyAfter",Promise.all(e).then(o.Z,o.Z)),this.eventListener.cleanup(),super.onCloseAfterTimeout()}}},2894:(e,t,i)=>{"use strict";i.d(t,{Z:()=>f});var s=i(5005),n=i(8594),a=i(8487),o=i(4484),r=i(5565),d=i(3035),l=i(5345),c=i(5953),h=i(3061),u=i(177),p=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class f extends l.Z{constructor(e){let t;super({getIndex:e.getIndex||(e=>e.id.isAnyChat()?0:this.managers.appUsersManager.getUserStatusForSort(e.id)),onDelete:e=>{e.dom.listEl.remove(),this.onListLengthChange&&this.onListLengthChange()},onUpdate:e.onUpdate||(e=>p(this,void 0,void 0,(function*(){if(e.id.isAnyChat()){const t=yield(0,u.Z)(e.id.toChatId(),this.managers);(0,r.Z)(e.dom.lastMessageSpan,t)}else{const t=(0,h.Z)(yield this.managers.appUsersManager.getUser(e.id));(0,r.Z)(e.dom.lastMessageSpan,t)}}))),onSort:(e,t)=>{const i=e.dom.listEl.parentElement!==this.list;(0,o.Z)(e.dom.listEl,this.list,t),i&&this.onListLengthChange&&this.onListLengthChange()},onElementCreate:e=>{const{dom:t}=s.default.addDialogNew({peerId:e.id,container:!1,avatarSize:this.avatarSize,autonomous:this.autonomous,meAsSaved:!1,rippleEnabled:this.rippleEnabled,wrapOptions:{lazyLoadQueue:this.lazyLoadQueue}});return e.dom=t,e},updateElementWith:d.T2,updateListWith:e=>p(this,void 0,void 0,(function*(){return Array.from(this.elements.values()).some((e=>e.id.isUser()))&&(0,a.Z)(this.list)?(yield(0,n.e9)(),(0,a.Z)(this.list)?void e(!0):e(!1)):e(!1)}))}),this.avatarSize="abitbigger",this.rippleEnabled=!0,this.autonomous=!0,(0,c.Z)(this,e),this.list=s.default.createChatList(this.createChatListOptions);const i=()=>{t=window.setTimeout((()=>{this.updateList((e=>{e&&i()}))}),f.SORT_INTERVAL)};i()}}f.SORT_INTERVAL=3e4},2149:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(9331);const n="stacked-avatars",a=n+"-avatar",o=a+"-container";class r{constructor(e){this.lazyLoadQueue=e.lazyLoadQueue,this.avatarSize=e.avatarSize,this.container=document.createElement("div"),this.container.classList.add(n),this.container.style.setProperty("--avatar-size",e.avatarSize+"px")}render(e,t){const i=this.container.children;(e=e.slice().reverse()).length>3&&(e=e.slice(-3)),e.forEach(((e,n)=>{let r=i[n];r||(r=document.createElement("div"),r.classList.add(o));let d=r.firstElementChild;d||(d=new s.Z,d.classList.add("avatar-"+this.avatarSize,a),d.updateOptions({isDialog:!1,loadPromises:t})),d.updateWithOptions({lazyLoadQueue:this.lazyLoadQueue,peerId:e}),d.parentNode||r.append(d),r.parentNode||this.container.append(r)})),Array.from(i).slice(e.length).forEach((e=>e.remove()))}}},9259:(e,t,i)=>{"use strict";i.d(t,{Z:()=>I});var s=i(5432),n=i(3910),a=i(2738),o=i(5975),r=i(8497),d=i(8204),l=i(9405),c=i(3624),h=i(3035),u=i(5418),p=i(241),f=i(13),m=i(8115),g=i(5400),v=i(1447),b=i(3772),y=i(3512),w=i(5814),S=i(9099),C=i(3541),L=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};let E=!1;function I({listenTo:e,listenerSetter:t,selector:i,findTarget:I}){if(s.Z)return;const M=(t,s)=>{let n;if(I)n=I(t);else{const e=i||".media-sticker-wrapper";n=t.target.closest(e)}return!n||s&&!(0,o.Z)(n,e)?void 0:n},Z=y.Z.managers;t.add(e)("mousedown",(e=>{if(E||e.buttons>1||0!==e.button)return;let t=M(e);if(!t)return;const i=t.dataset.docId;if(!i)return;const s="sticker-viewer",y="STICKER-VIEWER",I=w.Z.getOnlyOnePlayableGroup(),P=(0,c.k)();let T,k;const x=({mediaContainer:e,doc:t,middleware:i,lockGroups:n,isSwitching:o})=>L(this,void 0,void 0,(function*(){const c=(0,f.Z)(t),S=e.getBoundingClientRect(),L=(0,l.C)(t.w,t.h),E=c?280:360,I=(0,l.C)(E,E),M=S.width===S.height?I:L.aspectFitted(I),P=(0,r.Z)(e,"bubble"),k=!P||P.classList.contains("is-out"),x=document.createElement("div");x.classList.add(s+"-transformer");const A=document.createElement("div");A.classList.add(s+"-sticker"),A.style.width=M.width+"px",A.style.height=M.height+"px";const _=document.createElement("div");if(_.classList.add(s+"-emoji"),_.append((0,m.Z)(t.stickerEmojiRaw)),c){const e=(E*C.Vp-E)/3*(k?1:-1);x.classList.add("has-effect"),x.style.setProperty("--translateX",`${e}px`),_.style.setProperty("--translateX",-e+"px")}const F=(0,r.Z)(e,"scrollable"),D=(0,d.Z)(e,F,!0,S);(D.overflow.vertical||D.overflow.horizontal)&&A.classList.add("is-overflow");const R=e.getBoundingClientRect(),B=R.width/M.width,N=R.height/M.height,O=R.left-(p.Z.width-R.width)/2,U=R.top-(p.Z.height-R.height)/2;x.style.transform=`translate(${O}px, ${U}px) scale(${B}, ${N})`,o&&x.classList.add("is-switching"),x.append(A,_),T.append(x);const H=yield(0,C.ZP)({doc:t,div:A,group:y,width:M.width,height:M.height,play:!1,loop:!0,middleware:i,managers:Z,needFadeIn:!1,isOut:k,withThumb:!1,relativeEffect:!0,loopEffect:!0}).then((({render:e})=>e));if(!i())return;T.parentElement||document.body.append(T);const z=Array.isArray(H)?H[0]:H,j=z instanceof b.Z?new Promise((e=>z.addEventListener("firstFrame",e,{once:!0}))):Promise.resolve();if(yield Promise.all([j,(0,h.d1)()]),yield(0,u.Z)(0),i()){if(n&&(w.Z.setOnlyOnePlayableGroup(y),w.Z.checkAnimations2(!0)),z instanceof b.Z){const t=e instanceof g.LD?e.player:v.Z.getAnimation(e);if(t){if(z.curFrame=t.curFrame,z.play(),yield new Promise((e=>{let t=0;const i=()=>{2==++t&&(e(),z.removeEventListener("enterFrame",i))};z.addEventListener("enterFrame",i)})),!i())return;z.pause()}}else if(z instanceof HTMLVideoElement){const t=e.querySelector("video");t&&(z.currentTime=t.currentTime)}return{ready:()=>{(z instanceof b.Z||z instanceof HTMLVideoElement)&&z.play(),c&&(0,a.tH)(A)},transformer:x}}})),A=window.setTimeout((()=>L(this,void 0,void 0,(function*(){document.removeEventListener("mousemove",F),T=document.createElement("div"),T.classList.add(s),E=!0;const e=P.get(),n=yield Z.appDocsManager.getDoc(i);if(!e())return;let a;try{if(a=yield x({doc:n,mediaContainer:t,middleware:e,lockGroups:!0}),!a)return}catch(e){return}const{ready:o,transformer:r}=a;k=r,(0,S.Z)({element:T,className:"is-visible",forwards:!0,duration:200,onTransitionEnd:()=>{e()&&o()}}),document.addEventListener("mousemove",_)}))),125),_=e=>L(this,void 0,void 0,(function*(){const i=M(e,!0);if(!i||t===i)return;const s=i.dataset.docId;if(!s)return;t=i,P.clean();const n=P.get(),a=yield Z.appDocsManager.getDoc(s);if(!n())return;let o;try{if(o=yield x({doc:a,mediaContainer:t,middleware:n,isSwitching:!0}),!o)return}catch(e){return void console.error("sticker viewer error",e)}const{ready:r,transformer:d}=o,l=k;(0,S.Z)({element:l,className:"is-switching",forwards:!0,duration:200,onTransitionEnd:()=>{l.remove()}}),k=d,(0,S.Z)({element:d,className:"is-switching",forwards:!1,duration:200,onTransitionEnd:()=>{n()&&r()}})})),F=e=>{(0,o.Z)(e.target,t)||D()},D=()=>{clearTimeout(A),P.clean(),T&&((0,S.Z)({element:T,className:"is-visible",forwards:!1,duration:200,onTransitionEnd:()=>{T.remove(),w.Z.setOnlyOnePlayableGroup(I),w.Z.checkAnimations2(!1),E=!1}}),(0,a.fc)(document.body,n.Z,{capture:!0,once:!0})),document.removeEventListener("mousemove",F),document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",D,{capture:!0})};document.addEventListener("mousemove",F),document.addEventListener("mouseup",D,{once:!0,capture:!0})}))}},5117:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});class s{constructor(e,t){this.container=e,this.handler=t,this.observeHeaders(),this.observeElements()}observeHeaders(){this.headersObserver=new IntersectionObserver((e=>{for(const t of e){const e=t.boundingClientRect,i=t.target.parentElement,s=t.rootBounds;e.bottom=s.top&&e.bottom{const t=e.filter((e=>e.boundingClientRect.tope.boundingClientRect.top-t.boundingClientRect.top))[0];if(!t)return;const i=t.isIntersecting?t.target:t.target.nextElementSibling;this.handler(!0,i)}),{root:this.container})}addSentinel(e,t){const i=document.createElement("div");return i.classList.add("sticky_sentinel",t),e.appendChild(i)}observeStickyHeaderChanges(e){const t=this.addSentinel(e,"sticky_sentinel--top");this.headersObserver.observe(t),this.elementsObserver.observe(e)}disconnect(){this.headersObserver.disconnect(),this.elementsObserver.disconnect()}unobserve(e,t){this.elementsObserver.unobserve(e),this.headersObserver.unobserve(t)}}},3757:(e,t,i)=>{"use strict";i.d(t,{Z:()=>E});var s=i(3910),n=i(5432),a=i(5953),o=i(3416),r=i(3699),d=i(6976),l=i(5418),c=i(3725),h=i(3228),u=i(5701),p=i(5003),f=i(3444),m=i(241);const g=e=>"touches"in e?e.touches[0]:e;function v(e,t){return t?Math.hypot(t.pageX-e.pageX,t.pageY-e.pageY):0}function b(e,t){return{x:(e.pageX+t.pageX)/2,y:(e.pageY+t.pageY)/2}}const y=document;let w=!1;o.Z.addEventListener("toggle",(e=>{w=e}));const S={passive:!1},C=!1,L={capture:!0,passive:!1};class E{constructor(e){var t,i,o,d,m;this.reset=e=>{var t,i,s;this.log("reset"),n.Z?this.listenerSetter.removeManual(y,"touchmove",this.handleMove,S):(this.listenerSetter.removeManual(y,"mousemove",this.handleMove,C),this.setCursorTo.style.cursor=""),this.hadMove&&(null===(t=this.onReset)||void 0===t||t.call(this,e)),null===(i=this.releaseWheelDrag)||void 0===i||i.clearTimeout(),null===(s=this.releaseWheelZoom)||void 0===s||s.clearTimeout(),this.resetValues()},this.handleStart=e=>{return t=this,i=void 0,o=function*(){var t,i;if(this.log("start"),this.isMouseDown){const t=e.touches;return void(2===(null==t?void 0:t.length)&&(this.initialDistance=v(t[0],t[1]),this.initialTouchCenter=b(t[0],t[1])))}const a=g(e);if(![0,1].includes(Math.max(0,null!==(t=a.button)&&void 0!==t?t:0)))return;if(1===a.button&&(0,s.Z)(e),(0,f.Z)(e))return;const o=++this.tempId,r=null===(i=this.verifyTouchTarget)||void 0===i?void 0:i.call(this,e);if(void 0!==r){let e;if(r instanceof Promise){if(e=yield r,this.tempId!==o)return}else e=r;if(!e)return this.reset()}if(this.isMouseDown=!0,this.withDelay&&!n.Z){const e=Object.assign(Object.assign({},C),{once:!0}),t=(0,c.Z)(),i=()=>t.resolve(),s=this.listenerSetter.add(y)("mousemove",i,e);if(yield Promise.race([(0,l.Z)(300),t]),t.resolve(),this.listenerSetter.remove(s),this.tempId!==o)return}this.xDown=a.clientX,this.yDown=a.clientY,this.eventUp=a,n.Z?this.listenerSetter.add(y)("touchmove",this.handleMove,S):this.listenerSetter.add(y)("mousemove",this.handleMove,C),this.onStart&&(this.onStart(),this.hadMove=!0,this.handleMove(a))},new((a=void 0)||(a=Promise))((function(e,s){function n(e){try{d(o.next(e))}catch(e){s(e)}}function r(e){try{d(o.throw(e))}catch(e){s(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(n,r)}d((o=o.apply(t,i||[])).next())}));var t,i,a,o},this.handleMove=e=>{var t,i;if(void 0===this.xDown||void 0===this.yDown||w)return void this.reset();if(this.cancelEvent&&(0,s.Z)(e),(null===(t=this.releaseWheelDrag)||void 0===t?void 0:t.isDebounced())||(null===(i=this.releaseWheelZoom)||void 0===i?void 0:i.isDebounced()))return;this.log("move");const n=this.eventUp=g(e),a=n.clientX,o=n.clientY,r=a-this.xDown+this.xAdded,d=o-this.yDown+this.yAdded;if(!this.hadMove){if(!r&&!d)return;this.setHadMove(e)}const l=e.touches;if(this.onZoom&&this.initialDistance>0&&2===l.length){const e=v(l[0],l[1]),t=b(l[0],l[1]),i=t.x-this.initialTouchCenter.x,s=t.y-this.initialTouchCenter.y,n={zoomFactor:e/this.initialDistance,initialCenterX:this.initialTouchCenter.x,initialCenterY:this.initialTouchCenter.y,dragOffsetX:i,dragOffsetY:s,currentCenterX:t.x,currentCenterY:t.y};this.onZoom(n)}this.dispatchOnSwipe(r,d,e)},this.handleWheel=e=>{var t;if(!this.hadMove&&this.verifyTouchTarget){const t=this.verifyTouchTarget(e);if(void 0!==t&&!t)return void this.reset(e)}if((0,s.Z)(e),this.log("wheel"),this.onDoubleClick&&Object.is(e.deltaX,-0)&&Object.is(e.deltaY,-0)&&e.ctrlKey)return this.onWheelCapture(e),this.onDoubleClick({centerX:e.pageX,centerY:e.pageY}),void this.reset();e.metaKey||e.ctrlKey||e.shiftKey?((null===(t=this.releaseWheelDrag)||void 0===t?void 0:t.isDebounced())&&this.reset(),this.onWheelZoom(e)):this.handleWheelDrag(e)},this.handleWheelDrag=e=>{this.log("wheel drag"),this.onWheelCapture(e),this.isDragCanceled.x&&Math.sign(this.initialDragOffset.x)!==Math.sign(e.deltaX)||(this.initialDragOffset.x-=e.deltaX),this.isDragCanceled.y&&Math.sign(this.initialDragOffset.y)!==Math.sign(e.deltaY)||(this.initialDragOffset.y-=e.deltaY);const{x:t,y:i}=this.initialDragOffset;this.releaseWheelDrag(e),this.dispatchOnSwipe(t,i,e,((e,t)=>{this.isDragCanceled={x:e,y:t}}))},this.onWheelCapture=e=>{this.hadMove||(this.log("wheel capture"),this.handleStart(e),this.setHadMove(e),this.initialTouchCenter={x:e.x,y:e.y})},this.onWheelZoom=e=>{if(!this.onZoom)return;this.log("wheel zoom"),this.onWheelCapture(e);const t=e.x-this.initialTouchCenter.x,i=e.y-this.initialTouchCenter.y,s=(0,h.Z)(e.deltaY,-25,25);this.wheelZoom-=.01*s;const n={zoomAdd:this.wheelZoom-1,initialCenterX:this.initialTouchCenter.x,initialCenterY:this.initialTouchCenter.y,dragOffsetX:t,dragOffsetY:i,currentCenterX:e.x,currentCenterY:e.y};this.onZoom(n),this.releaseWheelZoom(e)},(0,a.Z)(this,e),this.log=(0,p.kg)("SWIPE-HANDLER"),null!==(t=this.cursor)&&void 0!==t||(this.cursor="grabbing"),null!==(i=this.cancelEvent)&&void 0!==i||(this.cancelEvent=!0),null!==(o=this.listenerOptions)&&void 0!==o||(this.listenerOptions=S),null!==(d=this.setCursorTo)&&void 0!==d||(this.setCursorTo=this.element),this.listenerSetter=new r.Z,this.setListeners(),this.resetValues(),this.tempId=0,null===(m=e.middleware)||void 0===m||m.onDestroy((()=>{this.reset(),this.removeListeners()})),this.releaseWheelDrag=(0,u.Z)(this.reset,150,!1),this.releaseWheelZoom=(0,u.Z)(this.reset,150,!1)}setListeners(){n.Z?(this.withDelay?(0,d.E)({element:this.element,callback:e=>{(0,s.Z)(e),this.handleStart(e)},listenerSetter:this.listenerSetter,listenerOptions:this.listenerOptions}):this.listenerSetter.add(this.element)("touchstart",this.handleStart,this.listenerOptions),this.onDoubleClick&&this.listenerSetter.add(this.element)("dblclick",(e=>{this.onDoubleClick({centerX:e.pageX,centerY:e.pageY})})),this.listenerSetter.add(y)("touchend",this.reset)):(this.listenerSetter.add(this.element)("mousedown",this.handleStart,this.listenerOptions),this.listenerSetter.add(y)("mouseup",this.reset),(this.onZoom||this.onDoubleClick)&&this.listenerSetter.add(this.element)("wheel",this.handleWheel,L))}removeListeners(){this.log("remove listeners"),this.reset(),this.listenerSetter.removeAll()}setCursor(e=""){this.cursor=e,!n.Z&&this.hadMove&&this.setCursorTo.style.setProperty("cursor",this.cursor,"important")}add(e,t){this.xAdded=e,this.yAdded=t,this.handleMove({clientX:this.eventUp.clientX,clientY:this.eventUp.clientY,target:this.eventUp.target})}resetValues(){++this.tempId,this.hadMove=!1,this.xAdded=this.yAdded=0,this.xDown=this.yDown=this.eventUp=this.isMouseDown=void 0,this.onZoom&&(this.initialDistance=0,this.initialTouchCenter={x:m.Z.width/2,y:m.Z.height/2},this.initialDragOffset={x:0,y:0},this.isDragCanceled={x:!1,y:!1},this.wheelZoom=1)}setHadMove(e){var t;this.hadMove||(this.log("had move"),this.hadMove=!0,this.setCursorTo.style.setProperty("cursor",this.cursor,"important"),null===(t=this.onFirstSwipe)||void 0===t||t.call(this,e))}dispatchOnSwipe(...e){const t=this.onSwipe(...e);void 0!==t&&t&&this.reset()}}},709:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(2398),n=i(6272),a=i(4762),o=i(503);class r extends o.ZP{constructor(e={}){super(Object.assign({label:"Contacts.PhoneNumber.Placeholder",name:"phone"},e)),this.pasted=!1,this.lastValue="",this.container.classList.add("input-field-phone");const t=this.input;if(t instanceof HTMLInputElement)t.type="tel",t.autocomplete="rr55RandomRR55";else{t.inputMode="decimal";const e=window.devicePixelRatio;if(e>1){let i;a.IS_APPLE?i=-.16*e:a.IS_ANDROID&&(i=0),t.style.setProperty("--letter-spacing",i+"px")}const i=this.setValueSilently.bind(this);this.setValueSilently=e=>{i(e),(0,s.Z)(this.input,!0)}}t.addEventListener("input",(()=>{t.classList.remove("error");const i=this.value;let s;Math.abs(i.length-this.lastValue.length)>1&&!this.pasted&&a.IS_APPLE_MOBILE&&this.setValueSilently(this.lastValue+i),this.pasted=!1,this.setLabel();let o,r,d,l="";"+"===this.value.replace(/\++/,"+")?this.setValueSilently("+"):(s=(0,n.u)(this.value),o=s.formatted,r=s.country,l=s.leftPattern,d=s.code,this.setValueSilently(this.lastValue=o?"+"+o:"")),t.dataset.leftPattern=l,e.onInput&&e.onInput(s)})),t.addEventListener("paste",(()=>{this.pasted=!0})),t.addEventListener("keypress",(e=>{const t=e.key;if(/\D/.test(t)&&!e.metaKey&&!e.ctrlKey&&"Backspace"!==t&&("+"!==t||!e.shiftKey))return e.preventDefault(),!1}))}}},1439:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(3241);const n=new WeakMap;window.addEventListener("message",(e=>{const t=n.get(e.source);t&&t(JSON.parse(e.data))}));class a extends s.Z{constructor({url:e,sandbox:t}){super(!1),this.onTelegramWebViewEvent=({eventType:e,eventData:t})=>{""===t&&(t=void 0),console.log("onTelegramWebViewEvent",e,t),this.dispatchEvent(e,t)};const i=this.iframe=document.createElement("iframe");i.src=e,t&&i.setAttribute("sandbox",t)}onMount(){n.set(this.iframe.contentWindow,this.onTelegramWebViewEvent)}destroy(){this.cleanup(),n.delete(this.iframe.contentWindow)}}},2796:(e,t,i)=>{"use strict";i.d(t,{Am:()=>c,PE:()=>l,bC:()=>h});var s=i(5565),n=i(2296),a=i(2325);const o=document.createElement("div");let r;o.classList.add("toast");const d=new n.Z("toast");function l(){d.close(),o.classList.remove("is-visible"),r&&clearTimeout(+r),r=window.setTimeout((()=>{o.remove(),r=void 0}),200)}function c(e,t){d.close(),(0,s.Z)(o,e),o.parentElement||(document.body.append(o),o.offsetLeft),o.classList.add("is-visible"),r&&clearTimeout(+r),d.open(o),r=window.setTimeout(l,3e3),t&&d.addEventListener("toggle",t,{once:!0})}function h(e){c((0,a.ag)(e.langPackKey,e.langPackArguments),e.onClose)}d.addEventListener("toggle",(e=>{e||l()}))},426:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var s=i(3725),n=i(8594),a=i(2648),o=i(3910),r=i(5994);const d={navigation:{callback:(e,t,i)=>{const s=t.getBoundingClientRect().width,n=[e,t];return i&&n.reverse(),n[0].style.filter="brightness(80%)",n[0].style.transform=`translate3d(${.25*-s}px, 0, 0)`,n[1].style.transform=`translate3d(${s}px, 0, 0)`,e.classList.add("active"),e.offsetWidth,e.style.transform="",e.style.filter="",()=>{t.style.transform=t.style.filter=""}},animateFirst:!1},tabs:{callback:(e,t,i)=>{const s=t.getBoundingClientRect().width,n=[e,t];return i&&n.reverse(),n[0].style.transform=`translate3d(${-s}px, 0, 0)`,n[1].style.transform=`translate3d(${s}px, 0, 0)`,e.classList.add("active"),e.offsetWidth,e.style.transform="",()=>{t.style.transform=""}},animateFirst:!1}},l=e=>{let{content:t,type:i,transitionTime:l,onTransitionEnd:c,isHeavy:h=!0,once:u=!1,withAnimationListener:p=!0,listenerSetter:f,animateFirst:m=!1}=e;const{callback:g,animateFirst:v}=d[i]||{};t.dataset.animation=i,void 0!==v&&(m=v);const b=new Map;let y,w=null;if(p){const e=g?"transitionend":"animationend",i=s=>{if((0,o.Z)(s),s.target.parentElement!==t)return;const n=b.get(s.target);null==n||n(),s.target===w&&(!y&&h||(y&&(y.resolve(),y=void 0),null==c||c(S.prevId()),t.classList.remove("animating","backwards","disable-hover"),u&&(f?f.removeManual(t,e,i):t.removeEventListener(e,i),w=y=void 0,b.clear())))};f?f.add(t)(e,i):t.addEventListener(e,i)}function S(e,i=!0,o){o&&(w=o),e instanceof HTMLElement&&(e=(0,a.Z)(e));const d=S.prevId();if(e===d)return!1;const u=t.children[e];if(r.Z.isAvailable("animations")&&(-1!==d||m)||(i=!1),!p){const e=t.dataset.timeout;void 0!==e&&clearTimeout(+e),delete t.dataset.timeout}if(!i){if(w)w.classList.remove("active","to","from");else if(u){const e=b.get(u);null==e||e()}return u&&(u.classList.remove("to","from"),u.classList.add("active")),t.classList.remove("animating","backwards","disable-hover"),w=u,void(null==c||c(e))}p||(t.dataset.timeout=""+window.setTimeout((()=>{u.classList.remove("to"),w&&w.classList.remove("from"),t.classList.remove("animating","backwards","disable-hover"),delete t.dataset.timeout}),l)),w&&(w.classList.remove("to"),w.classList.add("from")),t.classList.add("animating");const f=d{u.classList.remove("to"),b.delete(u)}))}if(w){let e;const t=w,i=()=>{clearTimeout(e),t.classList.remove("active","from"),null==v||v(),b.delete(t)};u?(e=window.setTimeout(i,l+100),b.set(t,i)):(e=window.setTimeout(i,l),b.set(t,(()=>{clearTimeout(e),b.delete(t)}))),t.dataset.transitionTimeout=""+e,h&&(y||(y=(0,s.Z)()),(0,n.YW)(y,2*l))}w=u}return S.prevId=()=>w?(0,a.Z)(w):-1,S.getFrom=()=>w,S.setFrom=e=>w=e,S}},6726:(e,t,i)=>{"use strict";i.d(t,{l:()=>o});var s=i(5701),n=i(503);function a(e){return(e.length>=3&&e.length<=32||!e.length)&&/^[a-zA-Z0-9_]*$/.test(e)}class o extends n.ZP{constructor(e,t){super(e),this.managers=t,this.checkUsernameDebounced=(0,s.Z)(this.checkUsername.bind(this),150,!1,!0),e.listenerSetter.add(this.input)("input",(()=>{var e,t,i,s;const o=this.getValue();if(this.error=void 0,o===this.originalValue||!o.length)return this.setState(n.I1.Neutral),void(null===(t=(e=this.options).onChange)||void 0===t||t.call(e));a(o)?this.setState(n.I1.Neutral):this.setError(this.options.invalidText),this.input.classList.contains("error")?null===(s=(i=this.options).onChange)||void 0===s||s.call(i):this.checkUsernameDebounced(o)}))}getValue(){let e=this.value;return this.options.head&&(e=e.slice(this.options.head.length),this.setValueSilently(this.options.head+e)),e}checkUsername(e){if(this.checkUsernamePromise)return;let t;this.error=void 0,t=this.options.peerId?this.managers.appChatsManager.checkUsername(this.options.peerId.toChatId(),e):this.managers.appUsersManager.checkUsername(e);const i=this.checkUsernamePromise=t.then((t=>{this.getValue()===e&&(t?this.setState(n.I1.Valid,this.options.availableText):this.setError(this.options.takenText))}),(t=>{this.getValue()===e&&(this.error=t,"USERNAME_PURCHASE_AVAILABLE"===t.type?this.setError(this.options.takenText):this.setError(this.options.invalidText))})).then((()=>{var t,s;this.checkUsernamePromise===i&&(this.checkUsernamePromise=void 0),null===(s=(t=this.options).onChange)||void 0===s||s.call(t);const n=this.getValue();n!==e&&this.isValidToChange()&&a(n)&&this.checkUsername(n)}))}}},9522:(e,t,i)=>{"use strict";i.d(t,{Z:()=>g});var s=i(2738),n=i(5975),a=i(2398),o=i(4484),r=i(2914),d=i(319),l=i(5345),c=i(2325),h=i(3512),u=i(5592),p=i(7479),f=i(5029),m=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class g extends f.Z{constructor(e){super({name:"UsernamesProfileHeader",caption:e.peerId.isUser()?"UsernamesProfileHelp":"UsernamesChannelHelp"});const{peerId:t,peer:i,usernameInputField:f,listenerSetter:g,middleware:v}=e,b=h.Z.managers,y=t.isUser()?void 0:t.toChatId(),w=this,S="usernames",C=document.createElement("div");let L;C.classList.add(S);const E=new l.Z({getIndex:e=>L.length-L.findIndex((t=>t.username===e.id)),onDelete:e=>{e.row.container.remove()},onSort:(e,t)=>{(0,o.Z)(e.row.container,C,t)},onElementCreate:e=>{const t=L.find((t=>t.username===e.id)),i=new p.ZP({title:"@"+t.username,subtitle:!0,clickable:!0}),s=!!t.pFlags.editable,n=!!t.pFlags.active;return s&&(i.container.dataset.editable="1"),i.container.dataset.username=t.username,i.container.classList.add(S+"-username"),i.subtitle.classList.add(S+"-username-status"),i.createMedia("medium").classList.add(S+"-username-icon","tgico"),i.makeSortable(),I(i,n),e.row=i,e}}),I=(e,t)=>{e.subtitle.replaceChildren((0,c.ag)(e.container.dataset.editable?"UsernameLinkEditable":t?"UsernameLinkActive":"UsernameLinkInactive")),e.container.classList.toggle("active",t),e.toggleSorting(t)},M=(e=[])=>{L=e,E.getAll().forEach((t=>{e.some((e=>e.username===t.id))||E.delete(t.id)})),e.forEach((e=>{if(E.has(e.username)){const t=E.get(e.username);E.update(e.username,t),I(t.row,!!e.pFlags.active)}else E.add(e.username)})),w.container.classList.toggle("hide",!E.getAll().size)};M(i.usernames),g.add(h.Z)("peer_title_edit",(({peerId:e})=>m(this,void 0,void 0,(function*(){if(e!==t)return;const i=yield b.appPeersManager.getPeer(t);M(i.usernames)}))));let Z=!1;(0,s.fc)(C,(e=>m(this,void 0,void 0,(function*(){if(Z)return void(Z=!1);const t=(0,n.Z)(e.target,C);if(!t)return;if(t.dataset.editable)return void(0,a.Z)(f.input,!0,!0);const i=t.dataset.username,s=t.classList.contains("active");let o,r;s?(o="UsernameDeactivateLink",r=y?"UsernameDeactivateLinkChannelMessage":"UsernameDeactivateLinkProfileMessage"):(o="UsernameActivateLink",r=y?"UsernameActivateLinkChannelMessage":"UsernameActivateLinkProfileMessage");try{yield(0,u.Z)({titleLangKey:o,descriptionLangKey:r,button:{langKey:s?"Hide":"Show"}})}catch(e){return}const l=!s;let c;c=y?b.appChatsManager.toggleUsername(y,i,l):b.appUsersManager.toggleUsername(i,l),c.catch((e=>{"USERNAMES_ACTIVE_TOO_MUCH"===e.type?(0,u.Z)({titleLangKey:"UsernameActivateErrorTitle",descriptionLangKey:"UsernameActivateErrorMessage",button:{langKey:"OK",isCancel:!0}}).catch(d.Z):console.error("turn username error",e)}))})))),new r.Z({list:C,middleware:v,onSort:(e,t)=>{const i=L.splice(e,1)[0];L.splice(t,0,i),E.updateList();const s=L.filter((e=>e.pFlags.active)).map((e=>e.username));y?b.appChatsManager.reorderUsernames(y,s):b.appUsersManager.reorderUsernames(s)}}),w.content.append(C)}}},2940:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});class s{constructor(e,t){this.items=new Map,this.locked=!1,this.observer=new IntersectionObserver((t=>{if(this.locked)return;const i=[];t.forEach(((e,t)=>{const s=e.target;if(this.items.get(s)===e.isIntersecting)return;this.items.set(s,e.isIntersecting);const n={target:s,visible:e.isIntersecting,entry:e,index:t};i.push(n)})),i.forEach((t=>{e(t)}))}),t)}getVisible(){const e=[];return this.items.forEach(((t,i)=>{t&&e.push(i)})),e}clearVisible(){const e=this.getVisible();for(const t of e)this.items.set(t,!1)}isVisible(e){return this.items.get(e)}disconnect(){this.observer.disconnect(),this.items.clear()}refresh(){this.observer.disconnect();const e=[...this.items.keys()];for(const t of e)this.observer.observe(t)}refreshVisible(){const e=this.getVisible();for(const t of e)this.observer.unobserve(t);for(const t of e)this.observer.observe(t)}observe(e){this.items.set(e,!1),this.observer.observe(e)}unobserve(e){this.observer.unobserve(e),this.items.delete(e)}unlock(){this.locked=!1}unlockAndRefresh(){this.unlock(),this.refresh()}lock(){this.locked=!0}}},8427:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(3910),n=i(2738),a=i(3013),o=i(65);class r extends o.Z{constructor(e,t=!1){super({step:.01,min:0,max:1,vertical:t},1),this.listenerSetter=e,this.vertical=t,this.onMuteClick=e=>{e&&(0,s.Z)(e),a.Z.muted=!a.Z.muted},this.setVolume=()=>{const{volume:e,muted:t}=a.Z;let i;i=!e||t?0:e>.5?3:e>0&&e<.25?1:2,r.ICONS.forEach((e=>this.icon.classList.remove("tgico-"+e))),this.icon.classList.add("tgico-"+r.ICONS[i]),this.mousedown||this.setProgress(t?0:e)},this.setListeners(),this.setHandlers({onScrub:e=>{const t=Math.max(Math.min(e,1),0);a.Z.muted=!1,a.Z.volume=t}});const i="player-volume",o=this.btn=document.createElement("div");o.classList.add("btn-icon",i);const d=this.icon=document.createElement("span");d.classList.add(i+"__icon"),o.append(d,this.container),(0,n.fc)(d,this.onMuteClick,{listenerSetter:this.listenerSetter}),this.listenerSetter.add(a.Z)("playbackParams",this.setVolume),this.setVolume()}}r.ICONS=["volume_off","volume_mute","volume_down","volume_up"]},9083:(e,t,i)=>{"use strict";i.d(t,{N:()=>a,Z:()=>n});var s=i(5400);function n({docIds:e,loadPromises:t,middleware:i,lazyLoadQueue:n,customEmojiSize:a,animationGroup:o}){const r=" ".repeat(e.length),d=[];return e.forEach(((e,t)=>{d.push({_:"messageEntityCustomEmoji",offset:t,length:1,document_id:e})})),(0,s.ZP)(r,{entities:d,loadPromises:t,animationGroup:o,customEmojiSize:a,middleware:i,lazyLoadQueue:n})}function a(e){var t;const i=null!==(t=e.loadPromises)&&void 0!==t?t:e.loadPromises=[],s=n(e);return Promise.all(i).then((()=>s))}},296:(e,t,i)=>{"use strict";i.d(t,{Z:()=>M});var s=i(2341),n=i(467),a=i(632),o=i(2738),r=i(8497),d=i(4081),l=i(5994),c=i(319),h=i(2312),u=i(6219),p=i(1243),f=i(7030),m=i(2325),g=i(1507),v=i(2491),b=i(3512),y=i(8448),w=i(3251),S=i(3442),C=i(9492),L=i(5671),E=i(1604),I=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function M({message:e,withTime:t,fontWeight:i,voiceAsMusic:M,showSender:Z,searchContext:P,loadPromises:T,autoDownloadSize:k,lazyLoadQueue:x,sizeType:A,managers:_=b.Z.managers,cacheContext:F,fontSize:D,getSize:R,canTranscribeVoice:B}){var N;return I(this,void 0,void 0,(function*(){null!=i||(i=500),null!=A||(A=""),null!=D||(D=16);const b=0===k,O=e.media.document||e.media.webpage.document,U=null==e?void 0:e.uploadingFileName;if("audio"===O.type||"voice"===O.type||"round"===O.type){const s=new y.ZP;return s.withTime=t,s.message=e,s.noAutoDownload=b,s.lazyLoadQueue=x,s.loadPromises=T,B&&"voice"===O.type&&(s.transcriptionState=0),s.getSize=R,M&&(s.voiceAsMusic=M),P&&(s.searchContext=P),Z&&(s.showSender=Z),s.dataset.fontWeight=""+i,s.dataset.fontSize=""+D,s.dataset.sizeType=A,yield s.render(),s}const H=O.file_name?O.file_name.split("."):"";let z="";z=H.length>1&&Array.isArray(H)?(0,n.ST)(H.pop().split(" ",1)[0].toLowerCase()):"file";const j=document.createElement("div");j.classList.add("document",`ext-${z}`),j.dataset.docId=""+O.id,j.doc=O;const G=document.createElement("div");let V;G.classList.add("document-ico");const K=!!F,W=()=>K?F:_.thumbsStorage.getCacheContext(O);F=yield W();let $=!1;if((null===(N=O.thumbs)||void 0===N?void 0:N.length)||e.pFlags.is_outgoing&&F.url&&"photo"===O.type){j.classList.add("document-with-thumb"),$=!0;const t=[];if(e.pFlags.is_outgoing&&["photo","video"].includes(O.type)&&F.url)G.innerHTML=``,t.push(G.firstElementChild);else{performance.now();const e=yield(0,C.Z)({photo:O,message:null,container:G,boxWidth:54,boxHeight:54,loadPromises:T,withoutPreloader:!0,lazyLoadQueue:x,size:(0,f.Z)(O,54,54,!0),managers:_});G.style.width=G.style.height="",e.images.thumb&&t.push(e.images.thumb),e.images.full&&t.push(e.images.full)}t.forEach((e=>e.classList.add("document-thumb")))}else V=document.createElement("span"),V.classList.add("document-ico-text"),V.innerText=z,G.append(V);const q=O.file_name?(0,v.Z)(O.file_name):"Unknown.file";document.createElement("div").classList.add("document-description");const Y=document.createElement("span"),Q=[(0,d.Z)(O.size)];if(t&&Q.push((0,a.OD)(e.date)),Z&&Q.push(yield(0,L.Z)(e)),!t&&!Z){const e=document.createElement("span"),t=(0,d.Z)(O.size);e.append(" / ",t),e.style.visibility="hidden",Q.push(e)}j.innerHTML=`\n ${F.downloaded&&!U||!e.mid||!$?"":'
'}\n
\n
\n `;const X=j.querySelector(".document-name"),J=new w.I;J.dataset.fontWeight=""+i,J.dataset.fontSize=""+D,J.dataset.sizeType=A,J.getSize=R,J.textContent=q,e.mid||j.classList.add("downloaded"),X.append(J),Z&&X.append((0,E.Z)(e));const ee=j.querySelector(".document-size");if(Y.append(...(0,m.A1)(Q," · ")),ee.append(Y),j.prepend(G),!U&&e.pFlags.is_outgoing&&!e.mid)return j;let te,ie=null;const se=()=>{if(j.classList.remove("downloading"),O.size>g.Iw&&!U)return ie.setManual(),ie.attach(te),ie.preloader.classList.add("manual"),void ie.setDownloadFunction(ae);if(O.size<=g.Iw&&j.classList.add("downloaded"),te){if(te!==G){const e=te;setTimeout((()=>{e.remove()}),200)}te=null}ie&&(ie=null)},ne=e=>{j.classList.add("downloading");const t=document.createElement("span"),i=(0,d.Z)(O.size);t.style.position="absolute",t.style.left="0",e.then(se,c.Z).finally((()=>{Y.style.visibility="",t.remove()}));const s=e=>(0,d.Z)(e);let n=s(0);Y.style.visibility="hidden",t.append(n," / ",i),Y.parentElement.append(t),e.addNotifyListener((e=>{const t=s(e.done);n.replaceWith(t),n=t}))},ae=e=>{var t;const i=!e||e.isTrusted,n=j.doc;let a;const o=u.ZP.chat.bubbles?u.ZP.chat.bubbles.lazyLoadQueue.queueId:void 0;if(i)if("pdf"===n.type){const e=!ie||ie.detached;a=h.Z.downloadMediaURL({media:n,queueId:o}),e&&a.then((()=>{setTimeout((()=>I(this,void 0,void 0,(function*(){const e=(yield W()).url;window.open(e)}))),l.Z.isAvailable("animations")?250:0)}))}else a=s.Z.has(n.mime_type)&&(null===(t=n.thumbs)||void 0===t?void 0:t.length)?h.Z.downloadMediaURL({media:n,queueId:o}):h.Z.downloadToDisc({media:n,queueId:o});else a=h.Z.downloadToDisc({media:n,queueId:o},!0);a.catch((()=>{j.classList.remove("downloading")})),te&&(ie.attach(te,!0,a),ne(a))},{fileName:oe}=(0,p.Z)({media:O,downloadId:"1"});if(yield _.apiFileManager.isDownloading(oe)){te=j.querySelector(".document-download")||G;const e=h.Z.downloadToDisc({media:O},!0);ie=new S.Z,ie.attach(te,!1,e),ie.setDownloadFunction(ae),ne(e)}else if(!F.downloaded||U)if(te=j.querySelector(".document-download")||G,ie=new S.Z({isUpload:!!U}),U){const e=h.Z.getUpload(U);ie.attachPromise(e),ie.attach(te),ne(e)}else ie.construct(),ie.setManual(),ie.attach(te),ie.setDownloadFunction(ae),void 0!==k&&k>=O.size&&(0,o.tH)(ie.preloader);return(0,o.fc)(j,(e=>{(0,r.Z)(e.target,"time")||(ie?ie.onClick(e):ae(e))})),j}))}b.Z.addEventListener("document_downloading",(e=>{Array.from(document.querySelectorAll(`.document[data-doc-id="${e}"]`)).forEach((e=>{e.querySelector(".preloader-container.manual")&&(0,o.tH)(e)}))}))},8210:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(6272);function n(e){return"+"+(0,s.u)(e).formatted}},177:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(2575),n=i(2325),a=i(3512);function o(e,t=a.Z.managers){var i,o,r,d,l,c;return r=this,d=void 0,c=function*(){const a=yield t.appChatsManager.getChat(e);if("chatForbidden"===a._)return(0,n.ag)("YouWereKicked");const r=yield t.appProfileManager.getCachedFullChat(e);let d;d=r?"channelFull"===r._?r.participants_count:null===(i=r.participants.participants)||void 0===i?void 0:i.length:a.participants_count||(null===(o=a.participants)||void 0===o?void 0:o.participants.length),d=d||1;const l=a.pFlags.broadcast?"Peer.Status.Subscribers":"Peer.Status.Member";return(0,n.ag)(l,[(0,s.Z)(d)])},new((l=void 0)||(l=Promise))((function(e,t){function i(e){try{n(c.next(e))}catch(e){t(e)}}function s(e){try{n(c.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof l?n:new l((function(e){e(n)}))).then(i,s)}n((c=c.apply(r,d||[])).next())}))}},493:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(8456),n=i(5102),a=i(2325),o=i(8115),r=i(3512);function d(e){return t=this,i=void 0,l=function*(){const{peerId:t=r.Z.myId,plainText:i,onlyFirstName:d,limitSymbols:l,managers:c=r.Z.managers,threadId:h}=e;let u="";if(t.isUser()){const e=yield c.appUsersManager.getUser(t.toUserId());e&&(e.first_name&&(u+=e.first_name),!e.last_name||d&&u||(u+=" "+e.last_name)),u=u?u.trim():!e||e.pFlags.deleted?a.ZP.format(d?"Deleted":"HiddenName",!0):(0,n.Z)(e)[0]||""}else{if(h){const e=yield c.dialogsStorage.getForumTopic(t,h);u=(null==e?void 0:e.title)||""}if(!u){const e=yield c.appChatsManager.getChat(t.toChatId());u=(null==e?void 0:e.title)||""}d&&(u=u.split(" ")[0])}return void 0!==l&&(u=(0,s.Z)(u,l,l)),i?u:(0,o.Z)(u)},new((d=void 0)||(d=Promise))((function(e,s){function n(e){try{o(l.next(e))}catch(e){s(e)}}function a(e){try{o(l.throw(e))}catch(e){s(e)}}function o(t){var i;t.done?e(t.value):(i=t.value,i instanceof d?i:new d((function(e){e(i)}))).then(n,a)}o((l=l.apply(t,i||[])).next())}));var t,i,d,l}},3061:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(632),n=i(2325),a=i(1507);function o(e){var t;if(!e)return document.createElement("span");let i,o;switch(e.id){case a.hj.toUserId():i="Peer.RepliesNotifications";break;case a.yF.toUserId():i="Peer.ServiceNotifications";break;default:if(e.pFlags.bot){i="Bot";break}if(e.pFlags.support){i="SupportStatus";break}switch(null===(t=e.status)||void 0===t?void 0:t._){case"userStatusRecently":i="Lately";break;case"userStatusLastWeek":i="WithinAWeek";break;case"userStatusLastMonth":i="WithinAMonth";break;case"userStatusOffline":{const t=e.status.was_online,n=new Date,a=(n.getTime()/1e3|0)-t;if(a<60)i="Peer.Status.justNow";else if(a<3600)i="Peer.Status.minAgo",o=[a/60|0];else if(a<86400&&n.getDate()===new Date(1e3*t).getDate())i="LastSeen.HoursAgo",o=[a/3600|0];else{i="Peer.Status.LastSeenAt";const{dateEl:e,timeEl:n}=(0,s.rz)(t);o=[e,n]}break}case"userStatusOnline":i="Online";break;default:i="ALongTimeAgo"}}return(0,n.ag)(i,o)}},6131:(e,t,i)=>{"use strict";i.d(t,{MR:()=>d,ZP:()=>c,kN:()=>l});var s=i(3910),n=i(1046),a=i(319),o=i(6628),r=i(9099);function d(e){const{mediaSpoiler:t,reveal:i,destroyAfter:s}=e;(0,r.Z)({element:t,forwards:i,className:"is-revealing",duration:250,onTransitionEnd:()=>{i&&s&&(t.remove(),t.middlewareHelper.destroy())}})}function l(e){const{mediaSpoiler:t,event:i}=e;if((0,s.Z)(i),t.classList.contains("is-revealing"))return;const n=t.parentElement.querySelector("video");n&&!t.parentElement.querySelector(".video-play")&&(n.autoplay=!0,n.play().catch(a.Z)),d({mediaSpoiler:t,reveal:!0,destroyAfter:!0})}function c(e){return t=this,i=void 0,a=function*(){const{media:t}=e,i=(t.sizes||t.thumbs).find((e=>"photoStrippedSize"===e._));if(!i)return;const{image:s,loadPromise:a}=(0,n.Z)(t,i,!0);return yield a,function(e){const{middleware:t,image:i}=e;if(!t())return;i.classList.add("media-spoiler-thumbnail");const s=document.createElement("div");s.classList.add("media-spoiler-container"),s.middlewareHelper=t.create();const n=o.Z.create(Object.assign(Object.assign({},e),{middleware:s.middlewareHelper.get()}));return s.append(i,n.canvas),s}(Object.assign(Object.assign({},e),{image:s}))},new((s=void 0)||(s=Promise))((function(e,n){function o(e){try{d(a.next(e))}catch(e){n(e)}}function r(e){try{d(a.throw(e))}catch(e){n(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((a=a.apply(t,i||[])).next())}));var t,i,s,a}},6239:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(9345);function n(e){return t=this,i=void 0,a=function*(){try{return yield(0,s.Z)(e)}catch(t){return console.error("wrapMessageActionTextNewUnsafe error:",t),e.plain?"":document.createElement("span")}},new((n=void 0)||(n=Promise))((function(e,s){function o(e){try{d(a.next(e))}catch(e){s(e)}}function r(e){try{d(a.throw(e))}catch(e){s(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(t,i||[])).next())}));var t,i,n,a}},9345:(e,t,i)=>{"use strict";i.d(t,{Z:()=>F,e:()=>x});var s=i(1655),n=i(632),a=i(2614),o=i(130),r=i(8939),d=i(5180),l=i(2946),c=i(2325),h=i(1507),u=i(8115),p=i(2491),f=i(5400),m=i(3512),g=i(2064),v=i(5798);let b,y,w;const S=new Map;var C=i(9083),L=i(493),E=i(3591);function I(e){const t=e.action,{onclick:i,url:s}=(0,E.Z)(`tg://voicechat?chat_id=${e.peerId.toChatId()}&id=${t.call.id}&access_hash=${t.call.access_hash}`);if(!i)return document.createElement("span");const n=document.createElement("a");return n.href=s,n.setAttribute("onclick",i+"(this)"),n}var M=i(496),Z=i(7362),P=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function T(e){return P(this,void 0,void 0,(function*(){const t=yield(0,M.Z)(e);if(e.plain)return t;const i=document.createElement("i");return i.dataset.savedFrom=e.message.peerId+"_"+e.message.mid,i.dir="auto",i.append(t),i}))}function k(e,t){return t?e:(0,a.Z)((0,u.Z)(e))}function x(e){return P(this,void 0,void 0,(function*(){const t=e.topic;let i=null==t?void 0:t.icon_emoji_id;return(null==t?void 0:t.id)===h.Ox&&(i="5390854796011906616"),i?e.plain?m.Z.managers.appEmojiManager.getCustomEmojiDocument(i).then((e=>e.stickerEmojiRaw)):(0,C.N)(Object.assign(Object.assign({},e),{docIds:[i]})).then((e=>(e.lastElementChild.classList.add("topic-icon"),e))):e.plain?"":function(e,t){if(!b){w=document.getElementById("svg-defs");const e="http://www.w3.org/2000/svg";b=document.createElementNS(e,"svg"),b.setAttributeNS(null,"width","26"),b.setAttributeNS(null,"height","26"),b.setAttributeNS(null,"viewBox","0 0 26 26"),b.classList.add("topic-icon-svg");const t=document.createElementNS(e,"use");t.setAttributeNS(null,"href","#topic-icon"),b.append(t),y=document.createElement("span"),y.classList.add("topic-icon","avatar-like");const i=document.createElement("span");i.classList.add("topic-icon-content"),y.append(b,i)}e||(console.error("NO TOPIC ICON COLOR!"),e=h.OS[0]),t||(console.error("NO TOPIC NAME!"),t="");const i=e.toString(16),s=`topic-icon-gradient-${e}`;let n=S.get(e);if(!n){const{h:t,s:a,l:o,a:r}=(0,g.cw)("#"+i);w.insertAdjacentHTML("beforeend",`\n \n \n \n \n `),S.set(e,n=`hsla(${t}, ${a}%, ${Math.max(0,o-40)}%, ${r})`)}const a=y.cloneNode(!0);return a.firstElementChild.style.fill=`url(#${s})`,a.firstElementChild.style.stroke=n,a.lastElementChild.append((0,v.Z)(t,!0)),a}(null==t?void 0:t.icon_color,null==t?void 0:t.title)}))}function A(e){const t=e.message.action;return x(Object.assign(Object.assign({},e),{topic:t}))}function _(e){return P(this,void 0,void 0,(function*(){const t=e.message.action,i=document.createElement("span");return i.classList.add("topic-name"),i.append(yield A(e),k(t.title,e.plain)),i}))}function F(e){var t;return P(this,void 0,void 0,(function*(){const{plain:i,message:h,noLinks:g}=e,v=i?void 0:document.createElement("span"),b="action"in h&&h.action;if(b.message){const e=b.message;return i?(0,p.Z)(e):((0,o.Z)(v,(0,f.ZP)(e,{noLinebreaks:!0})),v)}{let o,p,y=b._;const w=m.Z.managers,S=(e,t)=>t?(0,L.Z)({peerId:e,plainText:t}):(0,Z.Z)({peerId:e});switch(b._){case"messageActionPhoneCall":y+="."+b.type,p=[(0,r.Z)(b.duration,i)];break;case"messageActionGroupCall":y+="."+b.type,p=[],y.endsWith("You")||h.pFlags.post||p.push(S(h.fromId,i)),void 0!==b.duration?p.push((0,r.Z)(b.duration,i)):g?p.push(""):p.push(I(h));break;case"messageActionInviteToGroupCall":{const e=[h.fromId,b.users[0].toPeerId()];let t="Chat.Service.VoiceChatInvitation";const n=m.Z.myId;e[0]===n?t+="ByYou":e[1]===n&&(t+="ForYou"),(0,s.Z)(e,n),o=t,p=e.map((e=>S(e,i))),p.push(g?"":I(h));break}case"messageActionGroupCallScheduled":{const e=new Date,t=new Date(1e3*b.schedule_date),s=(t.getTime()-e.getTime())/864e5,a=new Date(e);a.setDate(a.getDate()+1);const r=yield w.appPeersManager.isBroadcast(h.peerId);o=r?"ChatList.Service.VoiceChatScheduled.Channel":"ChatList.Service.VoiceChatScheduled",p=[];const d=m.Z.myId;let l;h.fromId===d?o+="You":r||p.push(S(h.fromId,i));const u=[];s<1&&t.getDate()===e.getDate()?l="TodayAtFormattedWithToday":s<2&&t.getDate()===a.getDate()?l="Time.TomorrowAt":(l="formatDateAtTime",u.push(new c.ZP.IntlDateElement({date:t,options:{day:"2-digit",month:"2-digit",year:"2-digit"}}).element)),u.push((0,n.mr)(t));const f=(0,c.ag)(l,u);p.push(f);break}case"messageActionChatCreate":{const e=m.Z.myId;h.fromId===e?y+="You":p=[S(h.fromId,i)];break}case"messageActionPinMessage":{const t=h.peerId,s=yield w.appMessagesManager.getMessageByPeer(t,h.reply_to_mid);p=[S(h.fromId,i)],s?p.push(T(Object.assign(Object.assign({},e),{message:s}))):(o="ActionPinnedNoText",h.reply_to_mid&&w.appMessagesManager.fetchMessageReplyTo(h));break}case"messageActionChatJoinedByRequest":{const e=yield w.appPeersManager.isBroadcast(h.peerId);h.pFlags.out?o=e?"RequestToJoinChannelApproved":"RequestToJoinGroupApproved":(o=e?"ChatService.UserJoinedChannelByRequest":"ChatService.UserJoinedGroupByRequest",p=[S(h.fromId,i)]);break}case"messageActionContactSignUp":case"messageActionChatReturn":case"messageActionChatLeave":case"messageActionChatJoined":case"messageActionChatEditPhoto":case"messageActionChatDeletePhoto":case"messageActionChatEditVideo":case"messageActionChatJoinedByLink":case"messageActionChannelEditVideo":case"messageActionChannelDeletePhoto":p=[S(h.fromId,i)];break;case"messageActionChannelEditTitle":case"messageActionChatEditTitle":p=[],"messageActionChatEditTitle"===b._&&p.push(S(h.fromId,i)),p.push(k(b.title));break;case"messageActionChatDeleteUser":case"messageActionChatAddUsers":case"messageActionChatAddUser":{const e=b.users||[b.user_id];if(p=[S(h.fromId,i)],e.length>1){const t=(0,c.v_)(yield Promise.all(e.map((e=>S(e.toPeerId(),i)))),!1,i);if(i)p.push(...t);else{const e=document.createElement("span");e.append(...t),p.push(e)}}else p.push(S(e[0].toPeerId(),i));break}case"messageActionBotAllowed":{const e=(0,f.ZP)(b.domain,{entities:[{_:"messageEntityUrl",length:b.domain.length,offset:0}],noLinks:g});p=[(0,a.Z)(e)];break}case"messageActionPaymentSent":{const s=b.pFlags.recurring_init,n=b.pFlags.recurring_used;if(o=n?"Chat.Service.PaymentSentRecurringUsedNoTitle":s?"Chat.Service.PaymentSentRecurringInitNoTitle":"Chat.Service.PaymentSent1NoTitle",p=[(0,d.Z)(b.total_amount,b.currency),S(h.peerId,i)],h.reply_to_mid){const i=yield w.appMessagesManager.getMessageByPeer((null===(t=h.reply_to)||void 0===t?void 0:t.reply_to_peer_id)?(0,l.Z)(h.reply_to.reply_to_peer_id):h.peerId,h.reply_to_mid);i?(o=n?"Chat.Service.PaymentSentRecurringUsed":s?"Chat.Service.PaymentSentRecurringInit":"Chat.Service.PaymentSent1",p.push(T(Object.assign(Object.assign({},e),{message:i})).then((e=>(e instanceof HTMLElement&&e.classList.add("is-receipt-link"),e))))):w.appMessagesManager.fetchMessageReplyTo(h)}break}case"messageActionSetMessagesTTL":{p=[];const e=yield w.appPeersManager.isBroadcast(h.peerId);if(b.period){let t;if(e?o="ActionTTLChannelChanged":h.fromId===m.Z.myId?o="ActionTTLYouChanged":(o="ActionTTLChanged",p.push(S(h.fromId,i))),b.period>1814400){let e;const s=[],a=31536e3;b.period>=a?(e="Years",s.push(b.period/a|0)):(e="Months",s.push(b.period/(30*n.s2)|0)),t=i?c.ZP.format(e,!0,s):(0,c.ag)(e,s)}else t=(0,r.Z)(b.period,i);p.push(t)}else e?o="ActionTTLChannelDisabled":h.fromId===m.Z.myId?o="ActionTTLYouDisabled":(o="ActionTTLDisabled",p.push(S(h.fromId,i)));break}case"messageActionTopicEdit":{let t,s,n;const a=!!h.pFlags.out,r=void 0!==b.icon_emoji_id,d=r&&!+b.icon_emoji_id,l=void 0!==b.title,c=void 0!==b.hidden;a||(n=S(h.fromId,i)),l&&(s=k(b.title)),r&&!d&&(t=A(e)),p=n?[n]:[],b.closed?o=a?"Chat.Service.Group.TopicEdited.You.Paused":"Chat.Service.Group.TopicEdited.Paused":!1===b.closed?o=a?"Chat.Service.Group.TopicEdited.You.Resumed":"Chat.Service.Group.TopicEdited.Resumed":d&&l?(o=a?"Chat.Service.TopicEdited.You.Mixed.IconRemoved":"Chat.Service.TopicEdited.Mixed.IconRemoved",p.push(s)):r&&l?(o=a?"Chat.Service.TopicEdited.You.Mixed":"Chat.Service.TopicEdited.Mixed",p.push(_(e))):d?o=a?"Chat.Service.Group.TopicEdited.You.Icon.Removed":"Chat.Service.Group.TopicEdited.Icon.Removed":l?(o=a?"Chat.Service.Group.TopicEdited.You.Title":"Chat.Service.Group.TopicEdited.Title",p.push(s)):r?(o=a?"Chat.Service.Group.TopicEdited.You.Icon":"Chat.Service.Group.TopicEdited.Icon",p.push(t)):c&&(o=a?b.hidden?"Chat.Service.Group.TopicEdited.You.Hided":"Chat.Service.Group.TopicEdited.You.Unhided":b.hidden?"Chat.Service.Group.TopicEdited.Hided":"Chat.Service.Group.TopicEdited.Unhided");break}case"messageActionTopicCreate":p=[_(e)],o="TopicWasCreatedAction";break;case"messageActionSetChatTheme":{const e=!!h.pFlags.out;let t;e||(t=S(h.fromId,i)),p=t?[t]:[],b.emoticon?(p.push((0,u.Z)(b.emoticon)),o=e?"ChatThemeChangedYou":"ChatThemeChangedTo"):o=e?"ChatThemeDisabledYou":"ChatThemeDisabled";break}default:o=c.Hz[y]||`[${b._}]`}o||(o=c.Hz[y],void 0===o&&(o="["+y+"]"));const C=p&&(yield Promise.all(p));return i?c.ZP.format(o,!0,C):(0,c.$d)(v,o,C)}}))}},496:(e,t,i)=>{"use strict";i.d(t,{Z:()=>v});var s=i(8938),n=i(5705),a=i(677),o=i(3738),r=i(8456),d=i(5381),l=i(2325),c=i(6535),h=i(1346),u=i(8115),p=i(2491),f=i(5400),m=i(3512),g=i(6239);function v(e){var t,i,v,b,y,w;return v=this,b=void 0,w=function*(){let{message:v,text:b,usingMids:y,plain:w,highlightWord:S,withoutMediaType:C}=e;null!=b||(b=v.message);const L=[];let E=!1;const I=(e,t)=>{if(e){if(void 0===t&&E)return;t=w?l.ZP.format(e,!0):(0,l.ag)(e)}if(w)L.push(t);else{const e=document.createElement("span");"string"==typeof t?e.innerHTML=t:e.append(t),L.push(e)}},M=m.Z.managers.appMessagesManager,Z=(0,d.Z)(v);let P=null!==(t=v.totalEntities)&&void 0!==t?t:v.entities;if(v.media&&!Z){(0,s.Z)(v);let e=!0;if(v.grouped_id){if(y){const t=yield M.getMidsByMessage(v);if(y.length===t.length){for(const i of t)if(!y.includes(i)){e=!1;break}}else e=!1}if(e){const e=yield M.getAlbumText(v.grouped_id);b=(null==e?void 0:e.message)||"",P=(null==e?void 0:e.totalEntities)||[],C||(I("AttachAlbum"),E=!0)}}else e=!1;if(!e&&!C||!b){const e=v.media;switch(e._){case"messageMediaPhoto":I("AttachPhoto");break;case"messageMediaDice":I(void 0,w?e.emoticon:(0,u.Z)(e.emoticon));break;case"messageMediaVenue":b=e.title,I("AttachLocation");break;case"messageMediaGeo":I("AttachLocation");break;case"messageMediaGeoLive":I("AttachLiveLocation");break;case"messageMediaPoll":const t="📊 "+(e.poll.question||"poll");I(void 0,w?t:(0,u.Z)(t));break;case"messageMediaContact":I("AttachContact");break;case"messageMediaGame":{const t="🎮 "+e.game.title;I(void 0,w?t:(0,u.Z)(t));break}case"messageMediaDocument":{const t=e.document;if("video"===t.type)I("AttachVideo");else if("voice"===t.type)I("AttachAudio");else if("gif"===t.type)I("AttachGif");else if("round"===t.type)I("AttachRound");else if("sticker"===t.type){const e=L.length;if(t.stickerEmojiRaw){const e=t.stickerEmojiRaw+" ";I(void 0,w?e:(0,u.Z)(e))}I("AttachSticker");const i=L.splice(e,2);if(w)L.push(i[0]+(i[1]?i[1]:""));else{const e=window.document.createElement("span");e.append(...i),L.push(e)}b=""}else if("audio"===t.type){const e=t.attributes.find((e=>"documentAttributeAudio"===e._&&(e.title||e.performer))),i="🎵 "+(e?[e.title,e.performer].filter(Boolean).join(" - "):t.file_name);I(void 0,w?i:(0,u.Z)(i))}else I(void 0,w?t.file_name:(0,u.Z)(t.file_name));break}case"messageMediaInvoice":"messageExtendedMediaPreview"===(null===(i=e.extended_media)||void 0===i?void 0:i._)?I(void 0,w?e.description:(0,u.Z)(e.description)):I(void 0,w?e.title:(0,u.Z)(e.title));break;case"messageMediaUnsupported":I(l.nK)}}const t=L.length;for(let e=1;e{"use strict";i.d(t,{Z:()=>n});var s=i(8842);function n(e){return t=this,i=void 0,a=function*(){const t=new s.Z;return yield t.update(e),t.element},new((n=void 0)||(n=Promise))((function(e,s){function o(e){try{d(a.next(e))}catch(e){s(e)}}function r(e){try{d(a.throw(e))}catch(e){s(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(t,i||[])).next())}));var t,i,n,a}},9492:(e,t,i)=>{"use strict";i.d(t,{Z:()=>b});var s=i(2830),n=i(4755),a=i(3512),o=i(3442),r=i(6705),d=i(8580),l=i(1713),c=i(7030),h=i(2312),u=i(3114),p=i(7660),f=i(319),m=i(1507),g=i(5994),v=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function b({photo:e,message:t,container:i,boxWidth:y,boxHeight:w,withTail:S,isOut:C,lazyLoadQueue:L,middleware:E,size:I,withoutPreloader:M,loadPromises:Z,autoDownloadSize:P,noBlur:T,noThumb:k,noFadeIn:x,blurAfter:A,managers:_=a.Z.managers,processUrl:F}){return v(this,void 0,void 0,(function*(){const a={loadPromises:{thumb:Promise.resolve(),full:Promise.resolve()},images:{thumb:null,full:null},preloader:null,aspecter:null},D="document"===e._,R=D&&e.mime_type.startsWith("image/")&&!I,B=(0,u.Z)(e);if(!(e.sizes||e.thumbs||B||R))return y&&w&&!I&&D&&(0,l.Z)(e,i,y,w,void 0,t),a;let N=0===P;I||(void 0===y&&(y=n.Z.active.regular.width),void 0===w&&(w=n.Z.active.regular.height)),i.classList.add("media-container");let O,U,H,z=i,j=!0,G=Promise.resolve();if(y&&w&&!I){const s=(0,l.Z)(e,i,y,w,void 0,t,void 0,R?{_:"photoSize",w:e.w,h:e.h,size:e.size,type:m.Pt}:void 0);if(I=s.photoSize,j=s.isFit,U=yield _.thumbsStorage.getCacheContext(e,I.type),!j&&!B){z=document.createElement("div"),z.classList.add("media-container-aspecter"),z.style.width=s.size.width+"px",z.style.height=s.size.height+"px";const n=(0,d.Z)(e,U,!T,!0);if(n){G=n.loadPromise;const e=n.image;e.classList.add("media-photo"),i.append(e)}else(yield b({container:i,message:t,photo:e,boxWidth:0,boxHeight:0,size:I,lazyLoadQueue:L,isOut:C,loadPromises:Z,middleware:E,withoutPreloader:M,withTail:S,autoDownloadSize:P,noBlur:T,noThumb:!0,blurAfter:!0,managers:_})).images.full.classList.add("media-photo","thumbnail");i.classList.add("media-container-fitted"),i.append(z)}}else I||(I=(0,c.Z)(e,y,w,!0)),U=yield _.thumbsStorage.getCacheContext(e,null==I?void 0:I.type);if(!k&&!B){const t=(0,d.Z)(e,U,!T);t&&(G=Promise.all([G,t.loadPromise]),a.loadPromises.thumb=a.loadPromises.full=G,O=a.images.thumb=t.image,O.classList.add("media-photo"),z.append(O))}if(a.aspecter=z,"photoSizeEmpty"===(null==I?void 0:I._)&&D||(null==I?void 0:I.bytes))return a;"videoSize"===(null==I?void 0:I._)?(H=a.images.full=(0,p.Z)(),H.autoplay=!0,H.loop=!0,H.muted=!0,H.classList.add("media-photo")):(H=a.images.full=new Image,H.classList.add("media-photo"));const V=(O||!U.downloaded)&&g.Z.isAvailable("animations")&&!x;let K;const W=null==t?void 0:t.uploadingFileName;M||(U.downloaded&&!W||(K=new o.Z({attachMethod:"prepend",isUpload:!!W})),W&&(K.attachPromise(h.Z.getUpload(W)),K.attach(i),N=void 0));const $=e=>(0,s.Z)(i,H,e,V,z,O),q=e=>v(this,void 0,void 0,(function*(){if(!E||E()){if(F&&(e=yield F(e)),A){const t=(0,r.Z)(e,12);return t.promise.then((()=>$(t.canvas.toDataURL())))}return $(e)}}));let Y;const Q=I.w>=150&&I.h>=150||N,X=()=>v(this,void 0,void 0,(function*(){N&&!M&&K&&(K.construct(),K.setManual());const t=(()=>{const t=R&&!I;return h.Z.downloadMediaURL({media:e,thumb:I,queueId:null==L?void 0:L.queueId,onlyCache:t?void 0:N})})(),s=yield _.thumbsStorage.getCacheContext(e,null==I?void 0:I.type);K&&!s.downloaded&&!M&&Q&&K.attach(i,!1,t),N=void 0;const n=t.then(q);return n.catch(f.Z),{download:t,render:n}}));return K&&K.setDownloadFunction(X),U.downloaded?G=Y=(yield X()).render:L?L.push({div:i,load:()=>X().then((({download:e})=>e))}):Y=(yield X()).render,Z&&G&&Z.push(G),yield G,a.loadPromises.thumb=G,a.loadPromises.full=Y||Promise.resolve(),a.preloader=K,a}))}},6700:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(2064),n=i(5990),a=i(3484);function o(e,t,i,o,r){const d=new a.Z("reply",i),l=d.fill(e,t,o);if(r){const e=(0,n.Z)(r,!1),[t,i,a]=(0,s.oo)(e);d.container.style.setProperty("--override-color",`${t}, ${i}, ${a}`),d.container.classList.add("is-overriding-color")}return{container:d.container,fillPromise:l}}},5671:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(2291),n=i(2325),a=i(3512),o=i(7362);function r(e){return t=this,i=void 0,d=function*(){const t=document.createElement("span");t.classList.add("sender-title");const i=e.fromId===a.Z.myId&&e.peerId!==a.Z.myId;if(t.append(i?(0,n.ag)("FromYou"):yield(0,o.Z)(Object.assign(Object.assign({},(0,s.Z)(e)),{dialog:e.peerId===a.Z.myId}))),(yield a.Z.managers.appPeersManager.isAnyGroup(e.peerId))||i){const i=yield(0,o.Z)({peerId:e.peerId});t.append(" ➝ ",i)}return t},new((r=void 0)||(r=Promise))((function(e,s){function n(e){try{o(d.next(e))}catch(e){s(e)}}function a(e){try{o(d.throw(e))}catch(e){s(e)}}function o(t){var i;t.done?e(t.value):(i=t.value,i instanceof r?i:new r((function(e){e(i)}))).then(n,a)}o((d=d.apply(t,i||[])).next())}));var t,i,r,d}},1604:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(632);function n(e){const t=document.createElement("span");return t.classList.add("sent-time"),t.append((0,s.zM)(new Date(1e3*e.date))),t}},3541:(e,t,i)=>{"use strict";i.d(t,{Vp:()=>R,ZP:()=>U,_2:()=>H,_i:()=>N});var s=i(5269),n=i(3725),a=i(3910),o=i(2738),r=i(7660),d=i(8497),l=i(6740),c=i(1046),h=i(1185),u=i(5471),p=i(9405),f=i(4755),m=i(925),g=i(3174),v=i(6724),b=i(9674),y=i(2312),w=i(6219),S=i(2790),C=i(7030),L=i(13),E=i(1447),I=i(3512),M=i(7730),Z=i(671),P=i(5814),T=i(9298),k=i(2796),x=i(6775),A=i(645),_=i(4762),F=i(5994),D=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const R=1.49,B={},N={},O=(e,t,i)=>{const s=()=>{e.removeEventListener("animationend",s),t(),clearTimeout(n)};e.addEventListener("animationend",s);const n=setTimeout(s,i)};function U({doc:e,div:t,middleware:i,loadStickerMiddleware:d,lazyLoadQueue:m,exportLoad:v,group:w,play:S,onlyThumb:_,emoji:U,width:H,height:z,withThumb:j,loop:G,loadPromises:V,needFadeIn:K,needUpscale:W,skipRatio:$,static:q,managers:Y=I.Z.managers,fullThumb:Q,isOut:X,noPremium:J,withLock:ee,relativeEffect:te,loopEffect:ie,isCustomEmoji:se,syncedVideo:ne,liteModeKey:ae,isEffect:oe}){var re;return D(this,void 0,void 0,(function*(){t=Array.isArray(t)?t:[t],null!=ae||(ae="stickers_panel"),se&&(U=e.stickerEmojiRaw);const I=e.sticker;if(1===I&&(q=!0),!H&&!z){const t=f.Z.active,i=U?t.emojiSticker:e.animated?t.animatedSticker:t.staticSticker,s=(0,p.C)(e.w,e.h).aspectFitted(i);H=s.width,z=s.height}let de;2===I&&E.Z.loadLottieWorkers(),G=!(U&&!se)&&G,t.forEach((t=>{t.dataset.docId=""+e.id,U&&(t.dataset.stickerEmoji=U),t.dataset.stickerPlay=""+ +(S||!1),t.dataset.stickerLoop=""+ +(G||!1),t.classList.add("media-sticker-wrapper")})),!S||F.Z.isAvailable(ae)||se||oe||(S=!1,G=!1);const le=(t=(null==de?void 0:de.type))=>D(this,void 0,void 0,(function*(){return de=yield Y.thumbsStorage.getCacheContext(e,t)})),ce=!q&&(2===I||3===I),he=(0,L.Z)(e);void 0!==X&&he&&!X&&t.forEach((e=>e.classList.add("reflect-x")));const ue=he&ⅇif(ue){const i=B[e.id];t.forEach((e=>{e.classList.add("is-premium-sticker","tgico-premium_lock"),i&&e.style.setProperty("--lock-url",`url(${i})`)}))}if(q&&1!==I){const t=(0,C.Z)(e,H,z,!1);yield le(t.type)}else yield le(null==Q?void 0:Q.type);const pe=U&&!se?(0,Z.tB)(U):-1,fe=de.downloaded&&!K,me=ce,ge=2===I||3===I?yield Y.appDocsManager.getLottieCachedThumb(e.id,pe):void 0,ve={render:void 0,load:void 0};let be=(0,n.Z)(),ye=!1;if(((null===(re=e.thumbs)||void 0===re?void 0:re.length)||ge)&&!t[0].firstElementChild&&(!fe||me||_)&&!1!==j){let n=ge||e.thumbs[0];const a=(e,t)=>{e.childElementCount?be.resolve():b.Z.mutateElement(e,(()=>{e.childElementCount||(t.classList.add("media-sticker","thumbnail"),e.append(t)),be.resolve()}))};if("url"in n)ye=!0,t.forEach((e=>{const t=new Image;(0,l.ZP)(t,n.url,(()=>a(e,t)))}));else if("bytes"in n){if("photoPathSize"===n._){n.bytes.length||(n=e.thumbs.find((e=>{var t;return null===(t=e.bytes)||void 0===t?void 0:t.length}))||n);const i=function(e){let t="M";for(let i=0,s=e.length;i=192?t+="AACAAAAHAAALMAAAQASTAVAAAZaacaaaahaaalmaaaqastava.az0123456789-,"[s-128-64]:(s>=128?t+=",":s>=64&&(t+="-"),t+=""+(63&s))}return t+="z",t}(n.bytes),s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg");a.classList.add("rlottie-vector","media-sticker","thumbnail"),a.setAttributeNS(null,"viewBox",`0 0 ${e.w||512} ${e.h||512}`);const o=document.createElementNS(s,"path");o.setAttributeNS(null,"d",i),F.Z.isAvailable("animations")&&!se&&o.setAttributeNS(null,"fill","url(#g)"),a.append(o),t.forEach(((e,t)=>e.append(t>0?a.cloneNode(!0):a))),ye=!0,be.resolve()}else if(pe<=0){const o=()=>{t.forEach((t=>{const i=new Image,s=(0,h.Z)(e,n,!0);(0,l.ZP)(i,s,(()=>a(t,i)))}))};s.Z||e.pFlags.stickerThumbConverted||de.url?(ye=!0,o()):(ye=!0,M.Z.convert("main-"+e.id,n.bytes).then((s=>{Y.appDocsManager.saveWebPConvertedStrippedThumb(e.id,s),n.bytes=s,e.pFlags.stickerThumbConverted=!0,i&&!i()||t[0].childElementCount?be.resolve():o()})).catch((()=>be.resolve())))}}else if((2===I&&pe<=0||3===I)&&(j||_)){const s=()=>D(this,void 0,void 0,(function*(){if(t[0].childElementCount||i&&!i())return void be.resolve();const s=(e,t,s)=>{e.childElementCount||i&&!i()?be.resolve():s?(0,l.ZP)(t,s,(()=>a(e,t))):a(e,t)};yield le(),t.forEach((t=>{if(de.url)s(t,new Image,de.url);else if("bytes"in n){const i=(0,c.Z)(e,n,!0);i.loadPromise.then((()=>s(t,i.image,"")))}else y.Z.downloadMediaURL({media:e,thumb:n}).then((e=>D(this,void 0,void 0,(function*(){return s(t,new Image,e)}))))}))}));if(m&&_)return m.push({div:t[0],load:s}),be.resolve(),ve;s(),n.url&&(ye=!0)}}if(V&&ye&&V.push(be),_)return ve;const we=(0,u.Z)("MIDDLEWARE"),Se=()=>D(this,void 0,void 0,(function*(){if(i&&!i())throw we;if(2===I&&!q){const s=yield y.Z.downloadMedia({media:e,queueId:null==m?void 0:m.queueId,thumb:Q});if(i&&!i())throw we;const n=yield E.Z.loadAnimationWorker({container:t[0],loop:G,autoplay:S,animationData:s,width:H,height:z,name:"doc"+e.id,needUpscale:W,skipRatio:$,toneIndex:pe,sync:se,middleware:null!=d?d:i,group:w,liteModeKey:ae||void 0}),a=ue?()=>{var i,s;const a=null!==(i=B[s=e.id])&&void 0!==i?i:B[s]=function(e){var t;const i=e.getContext("2d"),s=20*(null!==(t=e.dpr)&&void 0!==t?t:1),n=s,a=s,o=(e.width-n)/2,r=e.height-a-0,d=i.getImageData(o,r,n,a).data;let l=0,c=0,h=0,u=0;for(let e=0;ee.style.setProperty("--lock-url",`url(${a})`)))}:void 0,o=(e,t)=>{const i=e.firstElementChild!==t&&e.firstElementChild;!1!==K&&(K=(K||!i||"svg"===i.tagName)&&F.Z.isAvailable("animations"));const s=()=>{i&&i!==t&&"DIV"!==i.tagName&&i.remove()};K?b.Z.mutate((()=>{t&&t.classList.add("fade-in"),i&&i.classList.add("fade-out"),O(t||i,(()=>{b.Z.mutate((()=>{t&&t.classList.remove("fade-in"),s()}))}),400)})):i&&b.Z.mutate(s)};return n.addEventListener("firstFrame",(()=>{const i=n.canvas[0];(!1!==j||se)&&(0,g.O)(e,i,pe),ue&&a(),se||t.forEach(((e,t)=>{o(e,n.canvas[t])}))}),{once:!0}),U&&Y.appStickersManager.preloadAnimatedEmojiStickerAnimation(U),n}if(q||3===I){const s=ce&&ne,n=s?A.Z.generateName(""+e.id,0,0,void 0,void 0):void 0,a=N[n];if(a)return a;const o=(s?t.slice(0,1):t).map((()=>{let e;if(q)e=new Image;else{const t=e=(0,r.Z)();if(t.muted=!0,S&&(t.autoplay=!0),G&&(t.loop=!0),G&&"number"==typeof G){let i=0,s=0;function n(){i>this.currentTime&&++s===G&&(this.autoplay=!1,this.loop=!1,this.pause(),t.removeEventListener("timeupdate",n)),i=this.currentTime}t.addEventListener("timeupdate",n)}}return e.classList.add("media-sticker"),e})),c=t.map(((e,t)=>e.firstElementChild!==o[t]&&e.firstElementChild));!1!==K&&(K=(K||!fe||(q?c[0]:!c[0]||"svg"===c[0].tagName))&&F.Z.isAvailable("animations")),K&&o.forEach((e=>e.classList.add("fade-in")));const h=new Promise(((n,a)=>D(this,void 0,void 0,(function*(){const r=()=>D(this,void 0,void 0,(function*(){if(i&&!i())return void a(we);const r=o.length,d=[];let h;yield le(),t.forEach(((t,u)=>{const p=o[u];p&&(h=(0,l.cj)(p,de.url)),h.then((()=>((t,o,l)=>{b.Z.mutateElement(t,(()=>{if(!i||i())if(o){if(o){const t=H*window.devicePixelRatio,i=z*window.devicePixelRatio;if(!(0,g.k)(e,pe,t,i)){const s=document.createElement("canvas");s.width=t,s.height=i,s.getContext("2d").drawImage(o,0,0,s.width,s.height),(0,g.O)(e,s,pe)}}s?n(o):(t.append(o),K?(l&&l.classList.add("fade-out"),O(o,(()=>{o.classList.remove("fade-in"),null==l||l.remove()}),400)):null==l||l.remove(),ce&&P.Z.addAnimation({animation:o,observeElement:t,group:w,controlled:i,liteModeKey:ae||void 0}),d.push(o)===r&&n(d))}else s&&ce||null==l||l.remove();else a(we)}))})(t,p,c[u])))}))}));if(yield le(),de.url)r();else{let t;if(1!==I&&q){const i=(0,C.Z)(e,H,z,!1);t=y.Z.downloadMediaURL({media:e,thumb:i,queueId:null==m?void 0:m.queueId})}else t=y.Z.downloadMediaURL({media:e,queueId:null==m?void 0:m.queueId});t.then(r,a)}}))));return n&&(N[n]=h,d&&h.finally((()=>{d()||delete N[n]}))),h}}));if(v&&(1===v&&(!fe||ce)||2===v))return ve.load=Se,ve;const Ce=!m||fe&&!ce?Se():(m.push({div:t[0],load:Se}),Promise.resolve());return fe&&q&&(be=Ce,V&&V.push(be)),2===I&&he&&void 0!==X&&!J&&function({container:e,doc:t,managers:i,middleware:s,isOut:n,width:r,loadPromise:d,relativeEffect:l,loopEffect:c}){i.appStickersManager.preloadSticker(t.id,!0);let h=!1;(0,o.fc)(e,(i=>D(this,void 0,void 0,(function*(){const o=F.Z.isAvailable("effects_premiumstickers")||l;if((0,a.Z)(i),!i.isTrusted&&!o)return;if(h||!o){const e=document.createElement("a");return e.onclick=()=>{(0,k.PE)(),new T.Z(t.stickerSetInput).show()},void(0,k.bC)({langPackKey:"Sticker.Premium.Click.Info",langPackArguments:[e]})}h=!0,yield d;const{animationDiv:u,stickerPromise:p}=(0,x.Z)({doc:t,middleware:s,side:n?"right":"left",size:r*R,target:e,play:!0,fullThumb:(0,L.Z)(t),relativeEffect:l,loopEffect:c});void 0===n||n||u.classList.add("reflect-x"),p.then((e=>{e.addEventListener("destroy",(()=>{h=!1}))}))}))))}({container:t[0],doc:e,managers:Y,middleware:i,isOut:X,width:H,loadPromise:Ce,relativeEffect:te,loopEffect:ie}),ve.render=Ce,ve}))}function H({event:e,container:t,managers:i,peerId:s,middleware:n}){var o,r,l,c,h,u;return D(this,void 0,void 0,(function*(){(0,a.Z)(e);const p=(0,d.Z)(t,"bubble"),f=t.dataset.stickerEmoji,g=t.classList.contains("custom-emoji")?void 0:E.Z.getAnimation(t);if(null==g?void 0:g.paused){const e=yield i.appStickersManager.getAnimatedEmojiSoundDocument(f);if(e){const i=document.createElement("audio");i.style.display="none",t.parentElement.append(i);try{const t=yield y.Z.downloadMediaURL({media:e});i.src=t,i.play(),yield(0,m.Z)(i,void 0,!0),i.addEventListener("ended",(()=>{i.src="",i.remove()}),{once:!0})}catch(e){}}g.autoplay=!0,g.restart()}if(!s.isUser()||!F.Z.isAvailable("effects_emoji"))return;const b=null!==(o=(c=t).activeAnimations)&&void 0!==o?o:c.activeAnimations=new Set;if(b.size>=(_.IS_MOBILE?3:5))return;const C=yield i.appStickersManager.getAnimatedEmojiSticker(f,!0);if(!C)return;const L=null!==(r=(h=t).emojiData)&&void 0!==r?r:h.emojiData={a:[],v:1},I=null!==(l=(u=t).sendInteractionThrottled)&&void 0!==l?l:u.sendInteractionThrottled=(0,v.Z)((()=>{if(!L.a.length)return;const e=L.a[0].t;L.a.forEach((t=>{t.t=(t.t-e)/1e3}));const s=(0,d.Z)(t,"bubble");i.appMessagesManager.setTyping(w.ZP.chat.peerId,{_:"sendMessageEmojiInteraction",msg_id:(0,S.Z)(+s.dataset.mid),emoticon:f,interaction:{_:"dataJSON",data:JSON.stringify(L)}},!0,w.ZP.chat.threadId),L.a.length=0}),1e3,!1),M={};b.add(M);const Z=p?p.classList.contains("is-out"):void 0,{animationDiv:P}=(0,x.Z)({doc:C,middleware:n,side:Z?"right":"left",size:360,target:t,play:!0,withRandomOffset:!0,onUnmount:()=>{b.delete(M)}});void 0===Z||Z||P.classList.add("reflect-x"),e.isTrusted&&(L.a.push({i:1,t:Date.now()}),I())}))}},6775:(e,t,i)=>{"use strict";i.d(t,{Z:()=>u});var s=i(2131),n=i(8938),a=i(8487),o=i(5471),r=i(3624),d=i(9966),l=i(241),c=i(6219),h=i(3541);function u({size:e,doc:t,middleware:i,target:u,side:p,skipRatio:f,play:m,managers:g,fullThumb:v,withRandomOffset:b,relativeEffect:y,loopEffect:w,onUnmount:S}){var C;const L=document.createElement("div");let E;L.classList.add("emoji-animation"),L.style.width=e+"px",L.style.height=e+"px";const I=()=>{M.clean(),null==E||E.remove(),L.remove(),c.ZP.chat.bubbles.scrollable.container.removeEventListener("scroll",A),null==S||S()},M=null!==(C=null==i?void 0:i.create())&&void 0!==C?C:(0,r.k)();i=M.get();const Z=(0,h.ZP)({div:L,doc:t,middleware:i,withThumb:!1,needFadeIn:!1,loop:!!w,width:e,height:e,play:m,group:"none",skipRatio:f,managers:g,fullThumb:v,isEffect:!0}).then((({render:e})=>e)).then((e=>{if((0,n.Z)(e),!i())throw e.remove(),(0,o.Z)("MIDDLEWARE");return E=e,E.addEventListener("enterFrame",(e=>{(w||e!==E.maxFrame)&&(0,a.Z)(u)||I()})),s.Z&&E.addEventListener("firstFrame",(()=>{navigator.vibrate(100)}),{once:!0}),E})),P=e=>{const t=Math.random()*e*2;return t>e?-t%e:t},T=b?P(16):0,k=b?P(4):0,x=()=>{if(!(0,a.Z)(u))return void I();const t=u.getBoundingClientRect(),i=t.width/200,s="center"===p?0:16*("right"===p?1:-1)*i,n="center"===p?0:0*i,o="right"===p?t.right:t.left,r=t.top,d=("center"===p?(t.width-e)/2:"right"===p?-e:0)+s+T,c=(t.height-e)/2+n+k,h=o+d,f=r+c;f<=-e||f>=l.Z.height?I():y?("center"!==p?L.style[p]=-1*Math.abs(s)+"px":L.style.left=d+"px",L.style.top=c+"px"):(L.style.top=f+"px",L.style.left=h+"px")},A=(0,d.Z)(x);return c.ZP.chat.bubbles.scrollable.container.addEventListener("scroll",A),x(),y?(L.classList.add("is-relative"),u.parentElement.append(L)):c.ZP.emojiAnimationContainer.append(L),{animationDiv:L,stickerPromise:Z}}},5772:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(3512),n=i(3541);function a(e){return t=this,i=void 0,o=function*(){const{emoji:t,div:i,managers:a=s.Z.managers}=e,o=yield a.appStickersManager.getAnimatedEmojiSticker(t);if(!o)throw i.classList.add("media-sticker-wrapper"),new Error("no sticker");return(0,n.ZP)(Object.assign({doc:o,play:!0,loop:!1},e))},new((a=void 0)||(a=Promise))((function(e,s){function n(e){try{d(o.next(e))}catch(e){s(e)}}function r(e){try{d(o.throw(e))}catch(e){s(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(n,r)}d((o=o.apply(t,i||[])).next())}));var t,i,a,o}},1273:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(7660),n=i(6740),a=i(2312),o=i(1447),r=i(3512),d=i(5814),l=i(3541),c=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function h({set:e,lazyLoadQueue:t,container:i,group:h,autoplay:u,width:p,height:f,managers:m=r.Z.managers,middleware:g}){var v;return c(this,void 0,void 0,(function*(){if(null===(v=e.thumbs)||void 0===v?void 0:v.length)return i.classList.add("media-sticker-wrapper"),void t.push({div:i,load:()=>c(this,void 0,void 0,(function*(){const t=yield m.appStickersManager.getStickerSetThumbDownloadOptions(e),r=a.Z.download(t);if(e.pFlags.animated&&!e.pFlags.videos)return r.then((t=>{o.Z.loadAnimationWorker({container:i,loop:!0,autoplay:u,animationData:t,width:p,height:f,needUpscale:!0,name:"setThumb"+e.id,group:h,middleware:g})}));{let t;return e.pFlags.videos?(t=(0,s.Z)(),t.autoplay=!0,t.muted=!0,t.loop=!0):t=new Image,t.classList.add("media-sticker"),r.then((s=>{(0,n.ZP)(t,URL.createObjectURL(s),(()=>{i.append(t),e.pFlags.videos&&d.Z.addAnimation({animation:t,group:h})}))}))}}))});let r;r=e.thumb_document_id?m.appEmojiManager.getCustomEmojiDocument(e.thumb_document_id):m.appStickersManager.getStickerSet(e).then((e=>e.documents[0]));const b=yield r;"documentEmpty"!==b._&&(0,l.ZP)({doc:b,div:i,group:h,lazyLoadQueue:t,managers:m,width:p,height:f,middleware:g})}))}},62:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(3541);function n({doc:e,row:t,size:i,managers:n}){const a=t.media,o=t.createMedia("small");a&&o.classList.add("hide");const r=a?[]:void 0,d="small"===i?32:48,l=(0,s.ZP)({div:o,doc:e,width:d,height:d,loadPromises:r,managers:n}).then((({render:e})=>e));return r&&Promise.all(r).then((()=>{o.classList.remove("hide"),a.remove()})),l}},9102:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(2790),n=i(4497),a=i(7362);function o(e){return t=this,i=void 0,r=function*(){const{peerId:t,threadId:i,lastMsgId:o}=e,r=Promise.resolve(),d=(0,n.Z)("t.me/c/"+t.toChatId()+(i?"/"+(0,s.Z)(i):"")+(o?"/"+(0,s.Z)(o):""));return d.classList.add("topic-name","topic-name-button"),d.append(yield(0,a.Z)(e)),{cached:!0,element:d,loadPromise:r}},new((o=void 0)||(o=Promise))((function(e,s){function n(e){try{d(r.next(e))}catch(e){s(e)}}function a(e){try{d(r.throw(e))}catch(e){s(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(n,a)}d((r=r.apply(t,i||[])).next())}));var t,i,o,r}},2887:(e,t,i)=>{"use strict";i.d(t,{Z:()=>A});var s=i(4762),n=i(5296),a=i(3725),o=i(3910),r=i(2738),d=i(7660),l=i(8487),c=i(6740),h=i(8580),u=i(5994),p=i(5471),f=i(4755),m=i(319),g=i(925),v=i(3035),b=i(6724),y=i(9674),w=i(5157),S=i(2312),C=i(6219),L=i(1507),E=i(3512),I=i(5814),M=i(3013),Z=i(8448),P=i(3442),T=i(9492),k=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};let x=0;function A({doc:e,container:t,message:i,boxWidth:A,boxHeight:_,withTail:F,isOut:D,middleware:R,lazyLoadQueue:B,noInfo:N,group:O,onlyPreview:U,noPreview:H,withoutPreloader:z,loadPromises:j,noPlayButton:G,photoSize:V,videoSize:K,searchContext:W,autoDownload:$,managers:q=E.Z.managers,noAutoplayAttribute:Y}){var Q;return k(this,void 0,void 0,(function*(){const E=null==$?void 0:$.video;let X=0===E;const J=!(A&&_),ee=("video"!==e.type||e.size<=52428800&&!J)&&("gif"===e.type?u.Z.isAvailable("gif"):u.Z.isAvailable("video"));let te,ie;if(!N){te=document.createElement("span"),te.classList.add("video-time"),t.append(te);let i=!1;"gif"!==e.type?(te.innerText=(0,w.Z)(e.duration,!1),G||"round"===e.type||(ee&&!X?te.classList.add("tgico","can-autoplay"):i=!0)):(te.innerText="GIF",ee||G||(i=!0,X=void 0)),i&&(ie=document.createElement("span"),ie.classList.add("video-play","tgico-largeplay","btn-circle","position-center"),t.append(ie))}const se={};if("image/gif"===e.mime_type){const s=yield(0,T.Z)({photo:e,message:i,container:t,boxWidth:A,boxHeight:_,withTail:F,isOut:D,lazyLoadQueue:B,middleware:R,withoutPreloader:z,loadPromises:j,autoDownloadSize:E,size:V,managers:q});return se.thumb=s,se.loadPromise=s.loadPromises.full,se}let ne;const ae=(0,d.Z)();if(ae.classList.add("media-video"),ae.muted=!0,"round"===e.type){const s=document.createElement("div");s.classList.add("media-round","z-depth-1"),s.dataset.mid=""+i.mid,s.dataset.peerId=""+i.peerId,s.message=i;const a=f.Z.active.round,d=a.width/2,c=3.5,h=d-2*c;s.innerHTML=`\n \n `;const u=s.firstElementChild.firstElementChild;x||(x=2*Math.PI*h),u.style.strokeDasharray=x+" "+x,u.style.strokeDashoffset=""+x,te.classList.add("tgico"),i.pFlags.media_unread&&s.classList.add("is-unread");const p=document.createElement("canvas");p.width=p.height=e.w,s.prepend(p,te),s.append(ae),t.append(s);const m=p.getContext("2d"),g=()=>{const e=s.message,t=M.Z.addMedia(e,!X),i=()=>{(C.ZP.chat.setPeerPromise||Promise.resolve()).finally((()=>{(0,l.Z)(t)||(t.removeEventListener("play",h),t.removeEventListener("timeupdate",c),t.removeEventListener("pause",f),t.removeEventListener("ended",g))}))},a=()=>{m.drawImage(t,0,0);const e=x-t.currentTime/t.duration*x;return u.style.strokeDashoffset=""+e,!t.paused},d=()=>{t.duration&&((0,l.Z)(t)?(t.paused&&a(),te.innerText=(0,w.Z)(t.duration-t.currentTime,!1)):i())},c=(0,b.Z)((()=>{(0,v.T2)(d)}),1e3,!1),h=()=>{ae.classList.add("hide"),s.classList.remove("is-paused"),(0,n.cK)(a,p),ne&&ne.preloader&&ne.preloader.classList.contains("manual")&&ne.onClick()},f=()=>{(0,l.Z)(t)?s.classList.add("is-paused"):i()},g=()=>{ae.classList.remove("hide"),s.classList.add("is-paused"),ae.currentTime=0,te.innerText=(0,w.Z)(t.duration,!1),t.currentTime&&(t.currentTime=0)};t.addEventListener("play",h),t.addEventListener("timeupdate",c),t.addEventListener("pause",f),t.addEventListener("ended",g),(0,r.fc)(p,(i=>{if((0,o.Z)(i),ne&&!ne.detached&&ne.onClick(),t.paused){const i=!!W;if(M.Z.setSearchContext(W||{peerId:L.NM,inputFilter:{_:"inputMessagesFilterEmpty"},useSearch:!1})){const[t,n]=i?(0,Z.ns)(s,e.mid):[];M.Z.setTargets({peerId:e.peerId,mid:e.mid},t,n)}t.play()}else t.pause()})),t.paused?t.duration&&t.currentTime!==t.duration&&t.currentTime>0?(a(),d(),ae.classList.add("hide")):f():h()};i.pFlags.is_outgoing?(s.onLoad=g,s.dataset.isOutgoing="1"):g()}else Y||(ae.autoplay=!0);let oe,re;if(i){if(oe=yield(0,T.Z)({photo:e,message:i,container:t,boxWidth:A,boxHeight:_,withTail:F,isOut:D,lazyLoadQueue:B,middleware:R,withoutPreloader:!0,loadPromises:j,autoDownloadSize:null==$?void 0:$.photo,size:V,managers:q}),se.thumb=oe,!ee&&"gif"!==e.type||U)return se.loadPromise=oe.loadPromises.full,se;if(F){const e=(oe.images.thumb||oe.images.full).parentElement;ae.width=+e.getAttributeNS(null,"width"),ae.height=+e.getAttributeNS(null,"height"),e.append(ae)}}else if(!H){const i=(0,h.Z)(e,{},!0);if(i){const e=i.image;e.classList.add("media-poster"),t.append(e),se.thumb={loadPromises:{thumb:i.loadPromise,full:Promise.resolve()},images:{thumb:e,full:null},preloader:null,aspecter:null},null==j||j.push(i.loadPromise),se.loadPromise=i.loadPromise}}if(U)return se;!ae.parentElement&&t&&((null==oe?void 0:oe.aspecter)||t).append(ae);const de=()=>k(this,void 0,void 0,(function*(){return re=yield q.thumbsStorage.getCacheContext(e,null==K?void 0:K.type)}));yield de();const le=null==i?void 0:i.uploadingFileName;le?(ne=new P.Z({attachMethod:"prepend",isUpload:!0}),ne.attachPromise(S.Z.getUpload(le)),ne.attach(t,!1),X=void 0):re.downloaded||e.supportsStreaming||z?e.supportsStreaming&&(ne=new P.Z({cancelable:!1,attachMethod:"prepend"})):ne=new P.Z({attachMethod:"prepend"});const ce=(0,a.Z)();if(ae.addEventListener("error",(e=>{4!==ae.error.code&&console.error("Error "+ae.error.code+"; details: "+ae.error.message),ne&&!le&&ne.detach(),ce.isFulfilled||ce.resolve()}),{once:!0}),"video"===e.type){const e=()=>{ae.duration&&(te.innerText=(0,w.Z)(ae.duration-ae.currentTime,!1))},t=(0,b.Z)((()=>{(0,v.T2)(e)}),1e3,!1);ae.addEventListener("timeupdate",t),ie&&ae.addEventListener("timeupdate",(()=>{y.Z.mutateElement(ie,(()=>{ie.remove()}))}),{once:!0})}ae.muted=!0,ae.loop=!0,Y||(ae.autoplay=!0);let he=X&&(null===(Q=null==oe?void 0:oe.preloader)||void 0===Q?void 0:Q.loadFunc);const ue=()=>k(this,void 0,void 0,(function*(){ne&&X&&!z&&(ne.construct(),ne.setManual()),yield de();let n=Promise.resolve();if(ne&&!le||z)if(re.downloaded||e.supportsStreaming)e.supportsStreaming&&(X?n=Promise.reject((0,p.Z)("NO_AUTO_DOWNLOAD")):!re.downloaded&&ne&&(ne.attach(t,!1,null),ae.addEventListener(s.IS_SAFARI?"timeupdate":"canplay",(()=>{ne.detach()}),{once:!0})));else{const i=n=S.Z.downloadMediaURL({media:e,queueId:null==B?void 0:B.queueId,onlyCache:X,thumb:K});ne&&ne.attach(t,!1,i)}return!X&&he&&(he(),he=null),X=void 0,n.then((()=>k(this,void 0,void 0,(function*(){!R||R()?("round"===e.type&&M.Z.resolveWaitingForLoadMedia(i.peerId,i.mid,i.pFlags.is_scheduled),yield de(),(0,g.Z)(ae).then((()=>{O&&I.Z.addAnimation({animation:ae,group:O}),ne&&!le&&ne.detach(),ce.resolve()}),(e=>{console.error("video load error",e),te&&te.classList.add("is-error"),ce.reject(e)})),(0,c.ZP)(ae,re.url)):ce.resolve()}))),m.Z),{download:n,render:Promise.all([n,ce])}}));return ne&&!le&&ne.setDownloadFunction(ue),t.preloader=ne,"gif"!==e.type||ee?se.loadPromise=B?(B.push({div:t,load:()=>ue().then((({render:e})=>e))}),Promise.resolve()):(yield ue()).render:(0,r.fc)(t,(e=>{(0,o.Z)(e),ie.remove(),ue()}),{capture:!0,once:!0}),se.thumb&&(yield se.thumb.loadPromises.thumb),se}))}f.Z.addEventListener("changeScreen",((e,t)=>{if(t===f._.mobile||e===f._.mobile){const e=Array.from(document.querySelectorAll(".media-round .progress-ring")),t=f.Z.active.round.width,i=t/2,s=i-7;x=2*Math.PI*s,e.forEach((e=>{e.setAttributeNS(null,"width",""+t),e.setAttributeNS(null,"height",""+t);const n=e.firstElementChild;n.setAttributeNS(null,"cx",""+i),n.setAttributeNS(null,"cy",""+i),n.setAttributeNS(null,"r",""+s),n.style.strokeDasharray=x+" "+x,n.style.strokeDashoffset=""+x}))}}))},2498:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(8456),n=i(5400);function a(e){const t=(0,s.Z)(e.description||"",150,180);return(0,n.ZP)(t)}},1336:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(8456),n=i(5400);function a(e){let t=e.title||e.author||e.site_name||"";return t=(0,s.Z)(t,80,100),(0,n.ZP)(t,{noLinks:!0,noLinebreaks:!0})}},7445:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});const s={AED:{code:"AED",title:"United Arab Emirates Dirham",symbol:"AED",native:"د.إ.‏",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"367",max_amount:"3673030"},AFN:{code:"AFN",title:"Afghan Afghani",symbol:"AFN",native:"؋",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"8729",max_amount:"87299487"},ALL:{code:"ALL",title:"Albanian Lek",symbol:"ALL",native:"Lek",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!1,exp:2,min_amount:"11842",max_amount:"118421187"},AMD:{code:"AMD",title:"Armenian Dram",symbol:"AMD",native:"դր.",thousands_sep:",",decimal_sep:".",symbol_left:!1,space_between:!0,exp:2,min_amount:"40943",max_amount:"409436718"},ARS:{code:"ARS",title:"Argentine Peso",symbol:"ARS",native:"$",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!0,exp:2,min_amount:"14705",max_amount:"147059002"},AUD:{code:"AUD",title:"Australian Dollar",symbol:"AU$",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"153",max_amount:"1536825"},AZN:{code:"AZN",title:"Azerbaijani Manat",symbol:"AZN",native:"ман.",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"169",max_amount:"1699858"},BAM:{code:"BAM",title:"Bosnia & Herzegovina Convertible Mark",symbol:"BAM",native:"KM",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"199",max_amount:"1990677"},BDT:{code:"BDT",title:"Bangladeshi Taka",symbol:"BDT",native:"৳",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"10009",max_amount:"100094046"},BGN:{code:"BGN",title:"Bulgarian Lev",symbol:"BGN",native:"лв.",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"199",max_amount:"1993315"},BND:{code:"BND",title:"Brunei Dollar",symbol:"BND",native:"$",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!1,exp:2,min_amount:"142",max_amount:"1421883"},BOB:{code:"BOB",title:"Bolivian Boliviano",symbol:"BOB",native:"Bs",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!0,exp:2,min_amount:"683",max_amount:"6832607"},BRL:{code:"BRL",title:"Brazilian Real",symbol:"R$",native:"R$",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!0,exp:2,min_amount:"539",max_amount:"5397799"},BYN:{code:"BYN",title:"Belarusian ruble",symbol:"BYN",native:"BYN",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"249",max_amount:"2495801"},CAD:{code:"CAD",title:"Canadian Dollar",symbol:"CA$",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"136",max_amount:"1366860"},CHF:{code:"CHF",title:"Swiss Franc",symbol:"CHF",native:"CHF",thousands_sep:"'",decimal_sep:".",symbol_left:!1,space_between:!0,exp:2,min_amount:"97",max_amount:"976705"},CLP:{code:"CLP",title:"Chilean Peso",symbol:"CLP",native:"$",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!0,exp:0,min_amount:"963",max_amount:"9637495"},CNY:{code:"CNY",title:"Chinese Renminbi Yuan",symbol:"CN¥",native:"CN¥",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"709",max_amount:"7094102"},COP:{code:"COP",title:"Colombian Peso",symbol:"COP",native:"$",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!0,exp:2,min_amount:"452870",max_amount:"4528700000"},CRC:{code:"CRC",title:"Costa Rican Colón",symbol:"CRC",native:"₡",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!1,exp:2,min_amount:"62506",max_amount:"625061070"},CZK:{code:"CZK",title:"Czech Koruna",symbol:"CZK",native:"Kč",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"2497",max_amount:"24975029"},DKK:{code:"DKK",title:"Danish Krone",symbol:"DKK",native:"kr",thousands_sep:"",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"755",max_amount:"7555990"},DOP:{code:"DOP",title:"Dominican Peso",symbol:"DOP",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"5275",max_amount:"52757308"},DZD:{code:"DZD",title:"Algerian Dinar",symbol:"DZD",native:"د.ج.‏",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"14035",max_amount:"140353307"},EGP:{code:"EGP",title:"Egyptian Pound",symbol:"EGP",native:"ج.م.‏",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"1953",max_amount:"19537405"},ETB:{code:"ETB",title:"Ethiopian Birr",symbol:"ETB",native:"ብር",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"5224",max_amount:"52247069"},EUR:{code:"EUR",title:"Euro",symbol:"€",native:"€",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"101",max_amount:"1016045"},GBP:{code:"GBP",title:"British Pound",symbol:"£",native:"£",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"89",max_amount:"894445"},GEL:{code:"GEL",title:"Georgian Lari",symbol:"GEL",native:"GEL",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"283",max_amount:"2830234"},GTQ:{code:"GTQ",title:"Guatemalan Quetzal",symbol:"GTQ",native:"Q",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"778",max_amount:"7781323"},HKD:{code:"HKD",title:"Hong Kong Dollar",symbol:"HK$",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"784",max_amount:"7849750"},HNL:{code:"HNL",title:"Honduran Lempira",symbol:"HNL",native:"L",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"2441",max_amount:"24413729"},HRK:{code:"HRK",title:"Croatian Kuna",symbol:"HRK",native:"kn",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"764",max_amount:"7648805"},HUF:{code:"HUF",title:"Hungarian Forint",symbol:"HUF",native:"Ft",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"42685",max_amount:"426850229"},IDR:{code:"IDR",title:"Indonesian Rupiah",symbol:"IDR",native:"Rp",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!1,exp:2,min_amount:"1523370",max_amount:"15233700000"},ILS:{code:"ILS",title:"Israeli New Sheqel",symbol:"₪",native:"₪",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"354",max_amount:"3543350"},INR:{code:"INR",title:"Indian Rupee",symbol:"₹",native:"₹",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"8155",max_amount:"81555550"},ISK:{code:"ISK",title:"Icelandic Króna",symbol:"ISK",native:"kr",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!0,exp:0,min_amount:"142",max_amount:"1425603"},JMD:{code:"JMD",title:"Jamaican Dollar",symbol:"JMD",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"15013",max_amount:"150131044"},JPY:{code:"JPY",title:"Japanese Yen",symbol:"¥",native:"¥",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:0,min_amount:"144",max_amount:"1443065"},KES:{code:"KES",title:"Kenyan Shilling",symbol:"KES",native:"Ksh",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"12075",max_amount:"120750271"},KGS:{code:"KGS",title:"Kyrgyzstani Som",symbol:"KGS",native:"KGS",thousands_sep:" ",decimal_sep:"-",symbol_left:!1,space_between:!0,exp:2,min_amount:"8018",max_amount:"80182898"},KRW:{code:"KRW",title:"South Korean Won",symbol:"₩",native:"₩",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:0,min_amount:"1431",max_amount:"14315201"},KZT:{code:"KZT",title:"Kazakhstani Tenge",symbol:"KZT",native:"₸",thousands_sep:" ",decimal_sep:"-",symbol_left:!0,space_between:!1,exp:2,min_amount:"47186",max_amount:"471867112"},LBP:{code:"LBP",title:"Lebanese Pound",symbol:"LBP",native:"ل.ل.‏",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"150999",max_amount:"1509998778"},LKR:{code:"LKR",title:"Sri Lankan Rupee",symbol:"LKR",native:"රු.",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"35546",max_amount:"355469651"},MAD:{code:"MAD",title:"Moroccan Dirham",symbol:"MAD",native:"د.م.‏",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"1093",max_amount:"10938136"},MDL:{code:"MDL",title:"Moldovan Leu",symbol:"MDL",native:"MDL",thousands_sep:",",decimal_sep:".",symbol_left:!1,space_between:!0,exp:2,min_amount:"1926",max_amount:"19264439"},MNT:{code:"MNT",title:"Mongolian Tögrög",symbol:"MNT",native:"MNT",thousands_sep:" ",decimal_sep:",",symbol_left:!0,space_between:!1,exp:2,min_amount:"322444",max_amount:"3224442056"},MUR:{code:"MUR",title:"Mauritian Rupee",symbol:"MUR",native:"MUR",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"4453",max_amount:"44535174"},MVR:{code:"MVR",title:"Maldivian Rufiyaa",symbol:"MVR",native:"MVR",thousands_sep:",",decimal_sep:".",symbol_left:!1,space_between:!0,exp:2,min_amount:"1546",max_amount:"15460397"},MXN:{code:"MXN",title:"Mexican Peso",symbol:"MX$",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"2012",max_amount:"20122860"},MYR:{code:"MYR",title:"Malaysian Ringgit",symbol:"MYR",native:"RM",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"463",max_amount:"4632502"},MZN:{code:"MZN",title:"Mozambican Metical",symbol:"MZN",native:"MTn",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"6382",max_amount:"63829729"},NGN:{code:"NGN",title:"Nigerian Naira",symbol:"NGN",native:"₦",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"43203",max_amount:"432039828"},NIO:{code:"NIO",title:"Nicaraguan Córdoba",symbol:"NIO",native:"C$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"3556",max_amount:"35566412"},NOK:{code:"NOK",title:"Norwegian Krone",symbol:"NOK",native:"kr",thousands_sep:" ",decimal_sep:",",symbol_left:!0,space_between:!0,exp:2,min_amount:"1069",max_amount:"10690975"},NPR:{code:"NPR",title:"Nepalese Rupee",symbol:"NPR",native:"नेरू",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"12954",max_amount:"129546657"},NZD:{code:"NZD",title:"New Zealand Dollar",symbol:"NZ$",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"174",max_amount:"1746220"},PAB:{code:"PAB",title:"Panamanian Balboa",symbol:"PAB",native:"B/.",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"98",max_amount:"988722"},PEN:{code:"PEN",title:"Peruvian Nuevo Sol",symbol:"PEN",native:"S/.",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"390",max_amount:"3902208"},PHP:{code:"PHP",title:"Philippine Peso",symbol:"PHP",native:"₱",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"5862",max_amount:"58627496"},PKR:{code:"PKR",title:"Pakistani Rupee",symbol:"PKR",native:"₨",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"22642",max_amount:"226426805"},PLN:{code:"PLN",title:"Polish Złoty",symbol:"PLN",native:"zł",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"493",max_amount:"4932350"},PYG:{code:"PYG",title:"Paraguayan Guaraní",symbol:"PYG",native:"₲",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!0,exp:0,min_amount:"6977",max_amount:"69772317"},QAR:{code:"QAR",title:"Qatari Riyal",symbol:"QAR",native:"ر.ق.‏",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"364",max_amount:"3640989"},RON:{code:"RON",title:"Romanian Leu",symbol:"RON",native:"RON",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"502",max_amount:"5028645"},RSD:{code:"RSD",title:"Serbian Dinar",symbol:"RSD",native:"дин.",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"11918",max_amount:"119184990"},RUB:{code:"RUB",title:"Russian Ruble",symbol:"RUB",native:"₽",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"7128",max_amount:"71281218"},SAR:{code:"SAR",title:"Saudi Riyal",symbol:"SAR",native:"ر.س.‏",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"375",max_amount:"3756546"},SEK:{code:"SEK",title:"Swedish Krona",symbol:"SEK",native:"kr",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"1109",max_amount:"11094972"},SGD:{code:"SGD",title:"Singapore Dollar",symbol:"SGD",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"143",max_amount:"1430495"},THB:{code:"THB",title:"Thai Baht",symbol:"฿",native:"฿",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"3780",max_amount:"37800497"},TJS:{code:"TJS",title:"Tajikistani Somoni",symbol:"TJS",native:"TJS",thousands_sep:" ",decimal_sep:";",symbol_left:!1,space_between:!0,exp:2,min_amount:"975",max_amount:"9753854"},TRY:{code:"TRY",title:"Turkish Lira",symbol:"TRY",native:"TL",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"1854",max_amount:"18543598"},TTD:{code:"TTD",title:"Trinidad and Tobago Dollar",symbol:"TTD",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"672",max_amount:"6722681"},TWD:{code:"TWD",title:"New Taiwan Dollar",symbol:"NT$",native:"NT$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"3173",max_amount:"31738502"},TZS:{code:"TZS",title:"Tanzanian Shilling",symbol:"TZS",native:"TSh",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"233199",max_amount:"2331999890"},UAH:{code:"UAH",title:"Ukrainian Hryvnia",symbol:"UAH",native:"₴",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!1,exp:2,min_amount:"3633",max_amount:"36338830"},UGX:{code:"UGX",title:"Ugandan Shilling",symbol:"UGX",native:"USh",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:0,min_amount:"3816",max_amount:"38166726"},USD:{code:"USD",title:"United States Dollar",symbol:"$",native:"$",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!1,exp:2,min_amount:"100",max_amount:1e6},UYU:{code:"UYU",title:"Uruguayan Peso",symbol:"UYU",native:"$",thousands_sep:".",decimal_sep:",",symbol_left:!0,space_between:!0,exp:2,min_amount:"4080",max_amount:"40801205"},UZS:{code:"UZS",title:"Uzbekistani Som",symbol:"UZS",native:"UZS",thousands_sep:" ",decimal_sep:",",symbol_left:!1,space_between:!0,exp:2,min_amount:"1089058",max_amount:"10890583014"},VND:{code:"VND",title:"Vietnamese Đồng",symbol:"₫",native:"₫",thousands_sep:".",decimal_sep:",",symbol_left:!1,space_between:!0,exp:0,min_amount:"23862",max_amount:"238625000"},YER:{code:"YER",title:"Yemeni Rial",symbol:"YER",native:"ر.ي.‏",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"25030",max_amount:"250300677"},ZAR:{code:"ZAR",title:"South African Rand",symbol:"ZAR",native:"R",thousands_sep:",",decimal_sep:".",symbol_left:!0,space_between:!0,exp:2,min_amount:"1789",max_amount:"17894299"}}},3447:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a,i:()=>s});const s={14:{"1f6dd":4867,"1f6de":4916,"1f6df":4923,"1f7f0":62832,"1f979":183,"1f9cc":1557,"1fa7b":61332,"1fa7c":61330,"1faa9":51093,"1faaa":61364,"1faab":61189,"1faac":51085,"1fab7":2651,"1fab8":2631,"1fab9":2672,"1faba":2673,"1fac3":1520,"1fac4":1521,"1fac5":1505,"1fad7":3793,"1fad8":3707,"1fad9":3804,"1fae0":111,"1fae1":136,"1fae2":132,"1fae3":133,"1fae4":174,"1fae5":142,"1fae6":1385,"1fae7":61353,"1faf0":1341,"1faf1":1332,"1faf2":1333,"1faf3":1334,"1faf4":1335,"1faf5":1351,"1faf6":1360,"1faf1-1f3fb-200d-1faf2-1f3fc":0,"1faf1-1f3fb-200d-1faf2-1f3fd":0,"1faf1-1f3fb-200d-1faf2-1f3fe":0,"1faf1-1f3fb-200d-1faf2-1f3ff":0,"1faf1-1f3fc-200d-1faf2-1f3fb":0,"1faf1-1f3fc-200d-1faf2-1f3fd":0,"1faf1-1f3fc-200d-1faf2-1f3fe":0,"1faf1-1f3fc-200d-1faf2-1f3ff":0,"1faf1-1f3fd-200d-1faf2-1f3fb":0,"1faf1-1f3fd-200d-1faf2-1f3fc":0,"1faf1-1f3fd-200d-1faf2-1f3fe":0,"1faf1-1f3fd-200d-1faf2-1f3ff":0,"1faf1-1f3fe-200d-1faf2-1f3fb":0,"1faf1-1f3fe-200d-1faf2-1f3fc":0,"1faf1-1f3fe-200d-1faf2-1f3fd":0,"1faf1-1f3fe-200d-1faf2-1f3ff":0,"1faf1-1f3ff-200d-1faf2-1f3fb":0,"1faf1-1f3ff-200d-1faf2-1f3fc":0,"1faf1-1f3ff-200d-1faf2-1f3fd":0,"1faf1-1f3ff-200d-1faf2-1f3fe":0,"1fac3-1f3fb":0,"1fac3-1f3fc":0,"1fac3-1f3fd":0,"1fac3-1f3fe":0,"1fac3-1f3ff":0,"1fac4-1f3fb":0,"1fac4-1f3fc":0,"1fac4-1f3fd":0,"1fac4-1f3fe":0,"1fac4-1f3ff":0,"1fac5-1f3fb":0,"1fac5-1f3fc":0,"1fac5-1f3fd":0,"1fac5-1f3fe":0,"1fac5-1f3ff":0,"1faf0-1f3fb":0,"1faf0-1f3fc":0,"1faf0-1f3fd":0,"1faf0-1f3fe":0,"1faf0-1f3ff":0,"1faf1-1f3fb":0,"1faf1-1f3fc":0,"1faf1-1f3fd":0,"1faf1-1f3fe":0,"1faf1-1f3ff":0,"1faf2-1f3fb":0,"1faf2-1f3fc":0,"1faf2-1f3fd":0,"1faf2-1f3fe":0,"1faf2-1f3ff":0,"1faf3-1f3fb":0,"1faf3-1f3fc":0,"1faf3-1f3fd":0,"1faf3-1f3fe":0,"1faf3-1f3ff":0,"1faf4-1f3fb":0,"1faf4-1f3fc":0,"1faf4-1f3fd":0,"1faf4-1f3fe":0,"1faf4-1f3ff":0,"1faf5-1f3fb":0,"1faf5-1f3fc":0,"1faf5-1f3fd":0,"1faf5-1f3fe":0,"1faf5-1f3ff":0,"1faf6-1f3fb":0,"1faf6-1f3fc":0,"1faf6-1f3fd":0,"1faf6-1f3fe":0,"1faf6-1f3ff":0},"":{2049:62835,2122:62863,2139:62888,2194:62764,2195:62763,2196:62762,2197:62756,2198:62758,2199:62760,2328:61194,2600:4990,2601:4998,2602:41013,2603:41018,2604:41020,2611:62851,2614:41014,2615:3781,2618:2667,2620:1106,2622:62753,2623:62754,2626:62783,2638:62780,2639:177,2648:62788,2649:62789,2650:62796,2651:62797,2652:62798,2653:62799,2660:51095,2663:51098,2665:51096,2666:51097,2668:4865,2692:61297,2693:4922,2694:61300,2696:61311,2697:61319,2699:61309,2702:61284,2705:62850,2708:4931,2709:61245,2712:61259,2714:62852,2716:62828,2721:62779,2728:51029,2733:62858,2734:62859,2744:41017,2747:62860,2753:62836,2754:62837,2755:62838,2757:62839,2763:1137,2764:1141,2795:62829,2796:62830,2797:62831,2934:62767,2935:62768,3030:62840,3297:62912,3299:62913,"0023-20e3":62864,"002a-20e3":62865,"0030-20e3":62866,"0031-20e3":62867,"0032-20e3":62868,"0033-20e3":62869,"0034-20e3":62870,"0035-20e3":62871,"0036-20e3":62872,"0037-20e3":62873,"0038-20e3":62874,"0039-20e3":62875,"00a9":62861,"00ae":62862,"1f004":51101,"1f0cf":51100,"1f170":62882,"1f171":62884,"1f17e":62893,"1f17f":62895,"1f18e":62883,"1f191":62885,"1f192":62886,"1f193":62887,"1f194":62889,"1f195":62891,"1f196":62892,"1f197":62894,"1f198":62896,"1f199":62897,"1f19a":62898,"1f1e6-1f1e8":71594,"1f1e6-1f1e9":71595,"1f1e6-1f1ea":71596,"1f1e6-1f1eb":71597,"1f1e6-1f1ec":71598,"1f1e6-1f1ee":71599,"1f1e6-1f1f1":71600,"1f1e6-1f1f2":71601,"1f1e6-1f1f4":71602,"1f1e6-1f1f6":71603,"1f1e6-1f1f7":71604,"1f1e6-1f1f8":71605,"1f1e6-1f1f9":71606,"1f1e6-1f1fa":71607,"1f1e6-1f1fc":71608,"1f1e6-1f1fd":71609,"1f1e6-1f1ff":71610,"1f1e7-1f1e6":71611,"1f1e7-1f1e7":71612,"1f1e7-1f1e9":71613,"1f1e7-1f1ea":71614,"1f1e7-1f1eb":71615,"1f1e7-1f1ec":71616,"1f1e7-1f1ed":71617,"1f1e7-1f1ee":71618,"1f1e7-1f1ef":71619,"1f1e7-1f1f1":71620,"1f1e7-1f1f2":71621,"1f1e7-1f1f3":71622,"1f1e7-1f1f4":71623,"1f1e7-1f1f6":71624,"1f1e7-1f1f7":71625,"1f1e7-1f1f8":71626,"1f1e7-1f1f9":71627,"1f1e7-1f1fb":71628,"1f1e7-1f1fc":71629,"1f1e7-1f1fe":71630,"1f1e7-1f1ff":71631,"1f1e8-1f1e6":71632,"1f1e8-1f1e8":71633,"1f1e8-1f1e9":71634,"1f1e8-1f1eb":71635,"1f1e8-1f1ec":71636,"1f1e8-1f1ed":71637,"1f1e8-1f1ee":71638,"1f1e8-1f1f0":71639,"1f1e8-1f1f1":71640,"1f1e8-1f1f2":71641,"1f1e8-1f1f3":71642,"1f1e8-1f1f4":71643,"1f1e8-1f1f5":71644,"1f1e8-1f1f7":71645,"1f1e8-1f1fa":71646,"1f1e8-1f1fb":71647,"1f1e8-1f1fc":71648,"1f1e8-1f1fd":71649,"1f1e8-1f1fe":71650,"1f1e8-1f1ff":71651,"1f1e9-1f1ea":71652,"1f1e9-1f1ec":71653,"1f1e9-1f1ef":71654,"1f1e9-1f1f0":71655,"1f1e9-1f1f2":71656,"1f1e9-1f1f4":71657,"1f1e9-1f1ff":71658,"1f1ea-1f1e6":71659,"1f1ea-1f1e8":71660,"1f1ea-1f1ea":71661,"1f1ea-1f1ec":71662,"1f1ea-1f1ed":71663,"1f1ea-1f1f7":71664,"1f1ea-1f1f8":71665,"1f1ea-1f1f9":71666,"1f1ea-1f1fa":71667,"1f1eb-1f1ee":71668,"1f1eb-1f1ef":71669,"1f1eb-1f1f0":71670,"1f1eb-1f1f2":71671,"1f1eb-1f1f4":71672,"1f1eb-1f1f7":71673,"1f1ec-1f1e6":71674,"1f1ec-1f1e7":71675,"1f1ec-1f1e9":71676,"1f1ec-1f1ea":71677,"1f1ec-1f1eb":71678,"1f1ec-1f1ec":71679,"1f1ec-1f1ed":71680,"1f1ec-1f1ee":71681,"1f1ec-1f1f1":71682,"1f1ec-1f1f2":71683,"1f1ec-1f1f3":71684,"1f1ec-1f1f5":71685,"1f1ec-1f1f6":71686,"1f1ec-1f1f7":71687,"1f1ec-1f1f8":71688,"1f1ec-1f1f9":71689,"1f1ec-1f1fa":71690,"1f1ec-1f1fc":71691,"1f1ec-1f1fe":71692,"1f1ed-1f1f0":71693,"1f1ed-1f1f2":71694,"1f1ed-1f1f3":71695,"1f1ed-1f1f7":71696,"1f1ed-1f1f9":71697,"1f1ed-1f1fa":71698,"1f1ee-1f1e8":71699,"1f1ee-1f1e9":71700,"1f1ee-1f1ea":71701,"1f1ee-1f1f1":71702,"1f1ee-1f1f2":71703,"1f1ee-1f1f3":71704,"1f1ee-1f1f4":71705,"1f1ee-1f1f6":71706,"1f1ee-1f1f7":71707,"1f1ee-1f1f8":71708,"1f1ee-1f1f9":71709,"1f1ef-1f1ea":71710,"1f1ef-1f1f2":71711,"1f1ef-1f1f4":71712,"1f1ef-1f1f5":71713,"1f1f0-1f1ea":71714,"1f1f0-1f1ec":71715,"1f1f0-1f1ed":71716,"1f1f0-1f1ee":71717,"1f1f0-1f1f2":71718,"1f1f0-1f1f3":71719,"1f1f0-1f1f5":71720,"1f1f0-1f1f7":71721,"1f1f0-1f1fc":71722,"1f1f0-1f1fe":71723,"1f1f0-1f1ff":71724,"1f1f1-1f1e6":71725,"1f1f1-1f1e7":71726,"1f1f1-1f1e8":71727,"1f1f1-1f1ee":71728,"1f1f1-1f1f0":71729,"1f1f1-1f1f7":71730,"1f1f1-1f1f8":71731,"1f1f1-1f1f9":71732,"1f1f1-1f1fa":71733,"1f1f1-1f1fb":71734,"1f1f1-1f1fe":71735,"1f1f2-1f1e6":71736,"1f1f2-1f1e8":71737,"1f1f2-1f1e9":71738,"1f1f2-1f1ea":71739,"1f1f2-1f1eb":71740,"1f1f2-1f1ec":71741,"1f1f2-1f1ed":71742,"1f1f2-1f1f0":71743,"1f1f2-1f1f1":71744,"1f1f2-1f1f2":71745,"1f1f2-1f1f3":71746,"1f1f2-1f1f4":71747,"1f1f2-1f1f5":71748,"1f1f2-1f1f6":71749,"1f1f2-1f1f7":71750,"1f1f2-1f1f8":71751,"1f1f2-1f1f9":71752,"1f1f2-1f1fa":71753,"1f1f2-1f1fb":71754,"1f1f2-1f1fc":71755,"1f1f2-1f1fd":71756,"1f1f2-1f1fe":71757,"1f1f2-1f1ff":71758,"1f1f3-1f1e6":71759,"1f1f3-1f1e8":71760,"1f1f3-1f1ea":71761,"1f1f3-1f1eb":71762,"1f1f3-1f1ec":71763,"1f1f3-1f1ee":71764,"1f1f3-1f1f1":71765,"1f1f3-1f1f4":71766,"1f1f3-1f1f5":71767,"1f1f3-1f1f7":71768,"1f1f3-1f1fa":71769,"1f1f3-1f1ff":71770,"1f1f4-1f1f2":71771,"1f1f5-1f1e6":71772,"1f1f5-1f1ea":71773,"1f1f5-1f1eb":71774,"1f1f5-1f1ec":71775,"1f1f5-1f1ed":71776,"1f1f5-1f1f0":71777,"1f1f5-1f1f1":71778,"1f1f5-1f1f2":71779,"1f1f5-1f1f3":71780,"1f1f5-1f1f7":71781,"1f1f5-1f1f8":71782,"1f1f5-1f1f9":71783,"1f1f5-1f1fc":71784,"1f1f5-1f1fe":71785,"1f1f6-1f1e6":71786,"1f1f7-1f1ea":71787,"1f1f7-1f1f4":71788,"1f1f7-1f1f8":71789,"1f1f7-1f1fa":71790,"1f1f7-1f1fc":71791,"1f1f8-1f1e6":71792,"1f1f8-1f1e7":71793,"1f1f8-1f1e8":71794,"1f1f8-1f1e9":71795,"1f1f8-1f1ea":71796,"1f1f8-1f1ec":71797,"1f1f8-1f1ed":71798,"1f1f8-1f1ee":71799,"1f1f8-1f1ef":71800,"1f1f8-1f1f0":71801,"1f1f8-1f1f1":71802,"1f1f8-1f1f2":71803,"1f1f8-1f1f3":71804,"1f1f8-1f1f4":71805,"1f1f8-1f1f7":71806,"1f1f8-1f1f8":71807,"1f1f8-1f1f9":71808,"1f1f8-1f1fb":71809,"1f1f8-1f1fd":71810,"1f1f8-1f1fe":71811,"1f1f8-1f1ff":71812,"1f1f9-1f1e6":71813,"1f1f9-1f1e8":71814,"1f1f9-1f1e9":71815,"1f1f9-1f1eb":71816,"1f1f9-1f1ec":71817,"1f1f9-1f1ed":71818,"1f1f9-1f1ef":71819,"1f1f9-1f1f0":71820,"1f1f9-1f1f1":71821,"1f1f9-1f1f2":71822,"1f1f9-1f1f3":71823,"1f1f9-1f1f4":71824,"1f1f9-1f1f7":71825,"1f1f9-1f1f9":71826,"1f1f9-1f1fb":71827,"1f1f9-1f1fc":71828,"1f1f9-1f1ff":71829,"1f1fa-1f1e6":71830,"1f1fa-1f1ec":71831,"1f1fa-1f1f2":71832,"1f1fa-1f1f3":71833,"1f1fa-1f1f8":71834,"1f1fa-1f1fe":71835,"1f1fa-1f1ff":71836,"1f1fb-1f1e6":71837,"1f1fb-1f1e8":71838,"1f1fb-1f1ea":71839,"1f1fb-1f1ec":71840,"1f1fb-1f1ee":71841,"1f1fb-1f1f3":71842,"1f1fb-1f1fa":71843,"1f1fc-1f1eb":71844,"1f1fc-1f1f8":71845,"1f1fd-1f1f0":71846,"1f1fe-1f1ea":71847,"1f1fe-1f1f9":71848,"1f1ff-1f1e6":71849,"1f1ff-1f1f2":71850,"1f1ff-1f1fc":71851,"1f201":62899,"1f202":62900,"1f21a":62906,"1f22f":62903,"1f232":62907,"1f233":62911,"1f234":62910,"1f235":62915,"1f236":62902,"1f237":62901,"1f238":62909,"1f239":62905,"1f23a":62914,"1f250":62904,"1f251":62908,"1f300":41010,"1f301":4857,"1f302":41012,"1f303":4858,"1f304":4860,"1f305":4861,"1f306":4862,"1f307":4863,"1f308":41011,"1f309":4864,"1f30a":41023,"1f30b":4815,"1f30c":4997,"1f30d":4806,"1f30e":4807,"1f30f":4808,"1f310":4809,"1f311":4977,"1f312":4978,"1f313":4979,"1f314":4980,"1f315":4981,"1f316":4982,"1f317":4983,"1f318":4984,"1f319":4985,"1f31a":4986,"1f31b":4987,"1f31c":4988,"1f31d":4991,"1f31e":4992,"1f31f":4995,"1f320":4996,"1f321":4989,"1f324":41001,"1f325":41002,"1f326":41003,"1f327":41004,"1f328":41005,"1f329":41006,"1f32a":41007,"1f32b":41008,"1f32c":41009,"1f32d":3725,"1f32e":3727,"1f32f":3728,"1f330":3708,"1f331":2659,"1f332":2661,"1f333":2662,"1f334":2663,"1f335":2664,"1f336":3698,"1f337":2658,"1f338":2649,"1f339":2653,"1f33a":2655,"1f33b":2656,"1f33c":2657,"1f33d":3697,"1f33e":2665,"1f33f":2666,"1f340":2668,"1f341":2669,"1f342":2670,"1f343":2671,"1f344":3705,"1f345":3690,"1f346":3694,"1f347":3674,"1f348":3675,"1f349":3676,"1f34a":3677,"1f34b":3678,"1f34c":3679,"1f34d":3680,"1f34e":3682,"1f34f":3683,"1f350":3684,"1f351":3685,"1f352":3686,"1f353":3687,"1f354":3722,"1f355":3724,"1f356":3718,"1f357":3719,"1f358":3744,"1f359":3745,"1f35a":3746,"1f35b":3747,"1f35c":3748,"1f35d":3749,"1f35e":3709,"1f35f":3723,"1f360":3750,"1f361":3756,"1f362":3751,"1f363":3752,"1f364":3753,"1f365":3754,"1f366":3765,"1f367":3766,"1f368":3767,"1f369":3768,"1f36a":3769,"1f36b":3774,"1f36c":3775,"1f36d":3776,"1f36e":3777,"1f36f":3778,"1f370":3771,"1f371":3743,"1f372":3735,"1f373":3733,"1f374":3801,"1f375":3783,"1f376":3784,"1f377":3786,"1f378":3787,"1f379":3788,"1f37a":3789,"1f37b":3790,"1f37c":3779,"1f37d":3800,"1f37e":3785,"1f37f":3739,"1f380":51040,"1f381":51041,"1f382":3770,"1f383":51024,"1f384":51025,"1f385":1527,"1f386":51026,"1f387":51027,"1f388":51030,"1f389":51031,"1f38a":51032,"1f38b":51033,"1f38c":71588,"1f38d":51034,"1f38e":51035,"1f38f":51036,"1f390":51037,"1f391":51038,"1f392":61134,"1f393":61147,"1f396":51045,"1f397":51042,"1f399":61167,"1f39a":61168,"1f39b":61169,"1f39e":61203,"1f39f":51043,"1f3a0":4866,"1f3a1":4868,"1f3a2":4869,"1f3a3":51072,"1f3a4":61170,"1f3a5":61202,"1f3a6":62819,"1f3a7":61171,"1f3a8":51105,"1f3a9":61146,"1f3aa":4871,"1f3ab":51044,"1f3ac":61205,"1f3ad":51103,"1f3ae":51086,"1f3af":51078,"1f3b0":51088,"1f3b1":51081,"1f3b2":51089,"1f3b3":51060,"1f3b4":51102,"1f3b5":61165,"1f3b6":61166,"1f3b7":61173,"1f3b8":61175,"1f3b9":61176,"1f3ba":61177,"1f3bb":61178,"1f3bc":61164,"1f3bd":51074,"1f3be":51058,"1f3bf":51075,"1f3c0":51054,"1f3c1":71586,"1f3c2":1600,"1f3c3-200d-2640":1584,"1f3c3-200d-2642":1583,"1f3c3":1582,"1f3c4-200d-2640":1606,"1f3c4-200d-2642":1605,"1f3c4":1604,"1f3c5":51047,"1f3c6":51046,"1f3c7":1598,"1f3c8":51056,"1f3c9":51057,"1f3ca-200d-2640":1612,"1f3ca-200d-2642":1611,"1f3ca":1610,"1f3cb-200d-2640":1618,"1f3cb-200d-2642":1617,"1f3cb":1616,"1f3cc-200d-2640":1603,"1f3cc-200d-2642":1602,"1f3cc":1601,"1f3cd":4902,"1f3ce":4901,"1f3cf":51061,"1f3d0":51055,"1f3d1":51062,"1f3d2":51063,"1f3d3":51065,"1f3d4":4813,"1f3d5":4817,"1f3d6":4818,"1f3d7":4824,"1f3d8":4829,"1f3d9":4859,"1f3da":4830,"1f3db":4823,"1f3dc":4819,"1f3dd":4820,"1f3de":4821,"1f3df":4822,"1f3e0":4831,"1f3e1":4832,"1f3e2":4833,"1f3e3":4834,"1f3e4":4835,"1f3e5":4836,"1f3e6":4837,"1f3e7":62729,"1f3e8":4838,"1f3e9":4839,"1f3ea":4840,"1f3eb":4841,"1f3ec":4842,"1f3ed":4843,"1f3ee":61216,"1f3ef":4844,"1f3f0":4845,"1f3f3-200d-1f308":71591,"1f3f3-200d-26a7":71592,"1f3f3":71590,"1f3f4-200d-2620":71593,"1f3f4-e0067-e0062-e0065-e006e-e0067-e007f":71852,"1f3f4-e0067-e0062-e0073-e0063-e0074-e007f":71853,"1f3f4-e0067-e0062-e0077-e006c-e0073-e007f":71854,"1f3f4":71589,"1f3f5":2652,"1f3f7":61234,"1f3f8":51066,"1f3f9":61303,"1f3fa":3805,"1f3fb":9525,"1f3fc":9526,"1f3fd":9527,"1f3fe":9528,"1f3ff":9529,"1f400":2576,"1f401":2575,"1f402":2556,"1f403":2557,"1f404":2558,"1f405":2547,"1f406":2548,"1f407":2579,"1f408-200d-2b1b":2544,"1f408":2543,"1f409":2618,"1f40a":2613,"1f40b":2622,"1f40c":2632,"1f40d":2616,"1f40e":2550,"1f40f":2563,"1f410":2565,"1f411":2564,"1f412":2531,"1f413":2596,"1f414":2595,"1f415-200d-1f9ba":2537,"1f415":2535,"1f416":2560,"1f417":2561,"1f418":2570,"1f419":2629,"1f41a":2630,"1f41b":2634,"1f41c":2635,"1f41d":2636,"1f41e":2638,"1f41f":2625,"1f420":2626,"1f421":2627,"1f422":2614,"1f423":2597,"1f424":2598,"1f425":2599,"1f426":2600,"1f427":2601,"1f428":2586,"1f429":2538,"1f42a":2566,"1f42b":2567,"1f42c":2623,"1f42d":2574,"1f42e":2555,"1f42f":2546,"1f430":2578,"1f431":2542,"1f432":2617,"1f433":2621,"1f434":2549,"1f435":2530,"1f436":2534,"1f437":2559,"1f438":2612,"1f439":2577,"1f43a":2539,"1f43b-200d-2744":2585,"1f43b":2584,"1f43c":2587,"1f43d":2562,"1f43e":2593,"1f43f":2580,"1f440":1381,"1f441-200d-1f5e8":1159,"1f441":1382,"1f442":1373,"1f443":1375,"1f444":1384,"1f445":1383,"1f446":1347,"1f447":1349,"1f448":1345,"1f449":1346,"1f44a":1355,"1f44b":1327,"1f44c":1336,"1f44d":1352,"1f44e":1353,"1f44f":1358,"1f450":1361,"1f451":61144,"1f452":61145,"1f453":61110,"1f454":61115,"1f455":61116,"1f456":61117,"1f457":61122,"1f458":61123,"1f459":61128,"1f45a":61129,"1f45b":61130,"1f45c":61131,"1f45d":61132,"1f45e":61136,"1f45f":61137,"1f460":61140,"1f461":61141,"1f462":61143,"1f463":1687,"1f464":1684,"1f465":1685,"1f466":1388,"1f467":1389,"1f468-200d-1f33e":1457,"1f468-200d-1f373":1460,"1f468-200d-1f37c":1524,"1f468-200d-1f393":1448,"1f468-200d-1f3a4":1478,"1f468-200d-1f3a8":1481,"1f468-200d-1f3eb":1451,"1f468-200d-1f3ed":1466,"1f468-200d-1f466-200d-1f466":1674,"1f468-200d-1f466":1673,"1f468-200d-1f467-200d-1f466":1676,"1f468-200d-1f467-200d-1f467":1677,"1f468-200d-1f467":1675,"1f468-200d-1f468-200d-1f466":1663,"1f468-200d-1f468-200d-1f466-200d-1f466":1666,"1f468-200d-1f468-200d-1f467":1664,"1f468-200d-1f468-200d-1f467-200d-1f466":1665,"1f468-200d-1f468-200d-1f467-200d-1f467":1667,"1f468-200d-1f469-200d-1f466":1658,"1f468-200d-1f469-200d-1f466-200d-1f466":1661,"1f468-200d-1f469-200d-1f467":1659,"1f468-200d-1f469-200d-1f467-200d-1f466":1660,"1f468-200d-1f469-200d-1f467-200d-1f467":1662,"1f468-200d-1f4bb":1475,"1f468-200d-1f4bc":1469,"1f468-200d-1f527":1463,"1f468-200d-1f52c":1472,"1f468-200d-1f680":1487,"1f468-200d-1f692":1490,"1f468-200d-1f9af":1574,"1f468-200d-1f9b0":1396,"1f468-200d-1f9b1":1397,"1f468-200d-1f9b2":1399,"1f468-200d-1f9b3":1398,"1f468-200d-1f9bc":1577,"1f468-200d-1f9bd":1580,"1f468-200d-2695":1445,"1f468-200d-2696":1454,"1f468-200d-2708":1484,"1f468-200d-2764-200d-1f468":1655,"1f468-200d-2764-200d-1f48b-200d-1f468":1651,"1f468":1392,"1f469-200d-1f33e":1458,"1f469-200d-1f373":1461,"1f469-200d-1f37c":1523,"1f469-200d-1f393":1449,"1f469-200d-1f3a4":1479,"1f469-200d-1f3a8":1482,"1f469-200d-1f3eb":1452,"1f469-200d-1f3ed":1467,"1f469-200d-1f466-200d-1f466":1679,"1f469-200d-1f466":1678,"1f469-200d-1f467-200d-1f466":1681,"1f469-200d-1f467-200d-1f467":1682,"1f469-200d-1f467":1680,"1f469-200d-1f469-200d-1f466":1668,"1f469-200d-1f469-200d-1f466-200d-1f466":1671,"1f469-200d-1f469-200d-1f467":1669,"1f469-200d-1f469-200d-1f467-200d-1f466":1670,"1f469-200d-1f469-200d-1f467-200d-1f467":1672,"1f469-200d-1f4bb":1476,"1f469-200d-1f4bc":1470,"1f469-200d-1f527":1464,"1f469-200d-1f52c":1473,"1f469-200d-1f680":1488,"1f469-200d-1f692":1491,"1f469-200d-1f9af":1575,"1f469-200d-1f9b0":1401,"1f469-200d-1f9b1":1403,"1f469-200d-1f9b2":1407,"1f469-200d-1f9b3":1405,"1f469-200d-1f9bc":1578,"1f469-200d-1f9bd":1581,"1f469-200d-2695":1446,"1f469-200d-2696":1455,"1f469-200d-2708":1485,"1f469-200d-2764-200d-1f468":1654,"1f469-200d-2764-200d-1f469":1656,"1f469-200d-2764-200d-1f48b-200d-1f468":1650,"1f469-200d-2764-200d-1f48b-200d-1f469":1652,"1f469":1400,"1f46a":1657,"1f46b":1647,"1f46c":1648,"1f46d":1646,"1f46e-200d-2640":1494,"1f46e-200d-2642":1493,"1f46e":1492,"1f46f-200d-2640":1590,"1f46f-200d-2642":1589,"1f46f":1588,"1f470-200d-2640":1518,"1f470-200d-2642":1517,"1f470":1516,"1f471-200d-2640":1409,"1f471-200d-2642":1410,"1f471":1391,"1f472":1511,"1f473-200d-2640":1510,"1f473-200d-2642":1509,"1f473":1508,"1f474":1412,"1f475":1413,"1f476":1386,"1f477-200d-2640":1504,"1f477-200d-2642":1503,"1f477":1502,"1f478":1507,"1f479":1109,"1f47a":1110,"1f47b":1111,"1f47c":1526,"1f47d":1112,"1f47e":1113,"1f47f":1104,"1f480":1105,"1f481-200d-2640":1428,"1f481-200d-2642":1427,"1f481":1426,"1f482-200d-2640":1500,"1f482-200d-2642":1499,"1f482":1498,"1f483":1585,"1f484":61152,"1f485":1366,"1f486-200d-2640":1560,"1f486-200d-2642":1559,"1f486":1558,"1f487-200d-2640":1563,"1f487-200d-2642":1562,"1f487":1561,"1f488":4870,"1f489":61326,"1f48a":61328,"1f48b":1127,"1f48c":1128,"1f48d":61153,"1f48e":61154,"1f48f":1649,"1f490":2648,"1f491":1653,"1f492":4846,"1f493":1133,"1f494":1138,"1f495":1135,"1f496":1131,"1f497":1132,"1f498":1129,"1f499":1145,"1f49a":1144,"1f49b":1143,"1f49c":1146,"1f49d":1130,"1f49e":1134,"1f49f":1136,"1f4a0":62946,"1f4a1":61214,"1f4a2":1151,"1f4a3":1157,"1f4a4":1163,"1f4a5":1152,"1f4a6":1154,"1f4a7":41022,"1f4a8":1155,"1f4a9":1107,"1f4aa":1368,"1f4ab":1153,"1f4ac":1158,"1f4ad":1162,"1f4ae":2650,"1f4af":1150,"1f4b0":61235,"1f4b1":62841,"1f4b2":62842,"1f4b3":61242,"1f4b4":61237,"1f4b5":61238,"1f4b6":61239,"1f4b7":61240,"1f4b8":61241,"1f4b9":61244,"1f4ba":4936,"1f4bb":61191,"1f4bc":61265,"1f4bd":61197,"1f4be":61198,"1f4bf":61199,"1f4c0":61200,"1f4c1":61266,"1f4c2":61267,"1f4c3":61227,"1f4c4":61229,"1f4c5":61269,"1f4c6":61270,"1f4c7":61273,"1f4c8":61274,"1f4c9":61275,"1f4ca":61276,"1f4cb":61277,"1f4cc":61278,"1f4cd":61279,"1f4ce":61280,"1f4cf":61282,"1f4d0":61283,"1f4d1":61232,"1f4d2":61226,"1f4d3":61225,"1f4d4":61218,"1f4d5":61219,"1f4d6":61220,"1f4d7":61221,"1f4d8":61222,"1f4d9":61223,"1f4da":61224,"1f4db":62847,"1f4dc":61228,"1f4dd":61264,"1f4de":61185,"1f4df":61186,"1f4e0":61187,"1f4e1":61325,"1f4e2":61159,"1f4e3":61160,"1f4e4":61249,"1f4e5":61250,"1f4e6":61251,"1f4e7":61246,"1f4e8":61247,"1f4e9":61248,"1f4ea":61253,"1f4eb":61252,"1f4ec":61254,"1f4ed":61255,"1f4ee":61256,"1f4ef":61161,"1f4f0":61230,"1f4f1":61182,"1f4f2":61183,"1f4f3":62823,"1f4f4":62824,"1f4f5":62751,"1f4f6":62822,"1f4f7":61207,"1f4f8":61208,"1f4f9":61209,"1f4fa":61206,"1f4fb":61172,"1f4fc":61210,"1f4fd":61204,"1f4ff":61151,"1f500":62801,"1f501":62802,"1f502":62803,"1f503":62769,"1f504":62770,"1f505":62820,"1f506":62821,"1f507":61155,"1f508":61156,"1f509":61157,"1f50a":61158,"1f50b":61188,"1f50c":61190,"1f50d":61211,"1f50e":61212,"1f50f":61290,"1f510":61291,"1f511":61292,"1f512":61288,"1f513":61289,"1f514":61162,"1f515":61163,"1f516":61233,"1f517":61313,"1f518":62947,"1f519":62771,"1f51a":62772,"1f51b":62773,"1f51c":62774,"1f51d":62775,"1f51e":62752,"1f51f":62876,"1f520":62877,"1f521":62878,"1f522":62879,"1f523":62880,"1f524":62881,"1f525":41021,"1f526":61215,"1f527":61306,"1f528":61294,"1f529":61308,"1f52a":3803,"1f52b":61301,"1f52c":61323,"1f52d":61324,"1f52e":51082,"1f52f":62787,"1f530":62848,"1f531":62846,"1f532":62949,"1f533":62948,"1f534":62916,"1f535":62920,"1f536":62940,"1f537":62941,"1f538":62942,"1f539":62943,"1f53a":62944,"1f53b":62945,"1f53c":62811,"1f53d":62813,"1f549":62778,"1f54a":2602,"1f54b":4854,"1f54c":4850,"1f54d":4852,"1f54e":62786,"1f550":4955,"1f551":4957,"1f552":4959,"1f553":4961,"1f554":4963,"1f555":4965,"1f556":4967,"1f557":4969,"1f558":4971,"1f559":4973,"1f55a":4975,"1f55b":4953,"1f55c":4956,"1f55d":4958,"1f55e":4960,"1f55f":4962,"1f560":4964,"1f561":4966,"1f562":4968,"1f563":4970,"1f564":4972,"1f565":4974,"1f566":4976,"1f567":4954,"1f56f":61213,"1f570":4952,"1f573":1156,"1f574":1587,"1f575-200d-2640":1497,"1f575-200d-2642":1496,"1f575":1495,"1f576":61111,"1f577":2641,"1f578":2642,"1f579":51087,"1f57a":1586,"1f587":61281,"1f58a":61261,"1f58b":61260,"1f58c":61262,"1f58d":61263,"1f590":1329,"1f595":1348,"1f596":1331,"1f5a4":1148,"1f5a5":61192,"1f5a8":61193,"1f5b1":61195,"1f5b2":61196,"1f5bc":51104,"1f5c2":61268,"1f5c3":61285,"1f5c4":61286,"1f5d1":61287,"1f5d2":61271,"1f5d3":61272,"1f5dc":61310,"1f5dd":61293,"1f5de":61231,"1f5e1":61299,"1f5e3":1683,"1f5e8":1160,"1f5ef":1161,"1f5f3":61257,"1f5fa":4810,"1f5fb":4816,"1f5fc":4847,"1f5fd":4848,"1f5fe":4811,"1f5ff":61362,"1f600":11,"1f601":14,"1f602":18,"1f603":12,"1f604":13,"1f605":16,"1f606":15,"1f607":114,"1f608":1103,"1f609":112,"1f60a":113,"1f60b":124,"1f60c":150,"1f60d":116,"1f60e":170,"1f60f":144,"1f610":139,"1f611":140,"1f612":145,"1f613":195,"1f614":151,"1f615":173,"1f616":192,"1f617":119,"1f618":118,"1f619":122,"1f61a":121,"1f61b":125,"1f61c":126,"1f61d":128,"1f61e":194,"1f61f":175,"1f620":1101,"1f621":1100,"1f622":189,"1f623":193,"1f624":199,"1f625":188,"1f626":184,"1f627":185,"1f628":186,"1f629":196,"1f62a":152,"1f62b":197,"1f62c":147,"1f62d":190,"1f62e-200d-1f4a8":148,"1f62e":178,"1f62f":179,"1f630":187,"1f631":191,"1f632":180,"1f633":181,"1f634":154,"1f635-200d-1f4ab":165,"1f635":164,"1f636-200d-1f32b":143,"1f636":141,"1f637":155,"1f638":1116,"1f639":1117,"1f63a":1115,"1f63b":1118,"1f63c":1119,"1f63d":1120,"1f63e":1123,"1f63f":1122,"1f640":1121,"1f641":176,"1f642":19,"1f643":110,"1f644":146,"1f645-200d-2640":1422,"1f645-200d-2642":1421,"1f645":1420,"1f646-200d-2640":1425,"1f646-200d-2642":1424,"1f646":1423,"1f647-200d-2640":1437,"1f647-200d-2642":1436,"1f647":1435,"1f648":1124,"1f649":1125,"1f64a":1126,"1f64b-200d-2640":1431,"1f64b-200d-2642":1430,"1f64b":1429,"1f64c":1359,"1f64d-200d-2640":1416,"1f64d-200d-2642":1415,"1f64d":1414,"1f64e-200d-2640":1419,"1f64e-200d-2642":1418,"1f64e":1417,"1f64f":1364,"1f680":4942,"1f681":4937,"1f682":4872,"1f683":4873,"1f684":4874,"1f685":4875,"1f686":4876,"1f687":4877,"1f688":4878,"1f689":4879,"1f68a":4880,"1f68b":4883,"1f68c":4884,"1f68d":4885,"1f68e":4886,"1f68f":4911,"1f690":4887,"1f691":4888,"1f692":4889,"1f693":4890,"1f694":4891,"1f695":4892,"1f696":4893,"1f697":4894,"1f698":4895,"1f699":4896,"1f69a":4898,"1f69b":4899,"1f69c":4900,"1f69d":4881,"1f69e":4882,"1f69f":4938,"1f6a0":4939,"1f6a1":4940,"1f6a2":4930,"1f6a3-200d-2640":1609,"1f6a3-200d-2642":1608,"1f6a3":1607,"1f6a4":4926,"1f6a5":4918,"1f6a6":4919,"1f6a7":4921,"1f6a8":4917,"1f6a9":71587,"1f6aa":61333,"1f6ab":62745,"1f6ac":61358,"1f6ad":62747,"1f6ae":62730,"1f6af":62748,"1f6b0":62731,"1f6b1":62749,"1f6b2":4907,"1f6b3":62746,"1f6b4-200d-2640":1621,"1f6b4-200d-2642":1620,"1f6b4":1619,"1f6b5-200d-2640":1624,"1f6b5-200d-2642":1623,"1f6b5":1622,"1f6b6-200d-2640":1566,"1f6b6-200d-2642":1565,"1f6b6":1564,"1f6b7":62750,"1f6b8":62743,"1f6b9":62733,"1f6ba":62734,"1f6bb":62735,"1f6bc":62736,"1f6bd":61340,"1f6be":62737,"1f6bf":61342,"1f6c0":1643,"1f6c1":61343,"1f6c2":62738,"1f6c3":62739,"1f6c4":62740,"1f6c5":62741,"1f6cb":61338,"1f6cc":1644,"1f6cd":61133,"1f6ce":4944,"1f6cf":61337,"1f6d0":62776,"1f6d1":4920,"1f6d2":61357,"1f6d5":4851,"1f6d6":4828,"1f6d7":61334,"1f6e0":61298,"1f6e1":61304,"1f6e2":4914,"1f6e3":4912,"1f6e4":4913,"1f6e5":4929,"1f6e9":4932,"1f6eb":4933,"1f6ec":4934,"1f6f0":4941,"1f6f3":4927,"1f6f4":4908,"1f6f5":4903,"1f6f6":4925,"1f6f7":51076,"1f6f8":4943,"1f6f9":4909,"1f6fa":4906,"1f6fb":4897,"1f6fc":4910,"1f7e0":62917,"1f7e1":62918,"1f7e2":62919,"1f7e3":62921,"1f7e4":62922,"1f7e5":62925,"1f7e6":62929,"1f7e7":62926,"1f7e8":62927,"1f7e9":62928,"1f7ea":62930,"1f7eb":62931,"1f90c":1337,"1f90d":1149,"1f90e":1147,"1f90f":1338,"1f910":137,"1f911":129,"1f912":156,"1f913":171,"1f914":135,"1f915":157,"1f916":1114,"1f917":130,"1f918":1343,"1f919":1344,"1f91a":1328,"1f91b":1356,"1f91c":1357,"1f91d":1363,"1f91e":1340,"1f91f":1342,"1f920":167,"1f921":1108,"1f922":158,"1f923":17,"1f924":153,"1f925":149,"1f926-200d-2640":1440,"1f926-200d-2642":1439,"1f926":1438,"1f927":160,"1f928":138,"1f929":117,"1f92a":127,"1f92b":134,"1f92c":1102,"1f92d":131,"1f92e":159,"1f92f":166,"1f930":1519,"1f931":1522,"1f932":1362,"1f933":1367,"1f934":1506,"1f935-200d-2640":1515,"1f935-200d-2642":1514,"1f935":1513,"1f936":1528,"1f937-200d-2640":1443,"1f937-200d-2642":1442,"1f937":1441,"1f938-200d-2640":1627,"1f938-200d-2642":1626,"1f938":1625,"1f939-200d-2640":1639,"1f939-200d-2642":1638,"1f939":1637,"1f93a":1597,"1f93c-200d-2640":1630,"1f93c-200d-2642":1629,"1f93c":1628,"1f93d-200d-2640":1633,"1f93d-200d-2642":1632,"1f93d":1631,"1f93e-200d-2640":1636,"1f93e-200d-2642":1635,"1f93e":1634,"1f93f":51073,"1f940":2654,"1f941":61180,"1f942":3791,"1f943":3792,"1f944":3802,"1f945":51069,"1f947":51048,"1f948":51049,"1f949":51050,"1f94a":51067,"1f94b":51068,"1f94c":51077,"1f94d":51064,"1f94e":51053,"1f94f":51059,"1f950":3710,"1f951":3693,"1f952":3700,"1f953":3721,"1f954":3695,"1f955":3696,"1f956":3711,"1f957":3738,"1f958":3734,"1f959":3730,"1f95a":3732,"1f95b":3780,"1f95c":3706,"1f95d":3689,"1f95e":3715,"1f95f":3757,"1f960":3758,"1f961":3759,"1f962":3799,"1f963":3737,"1f964":3794,"1f965":3692,"1f966":3702,"1f967":3773,"1f968":3713,"1f969":3720,"1f96a":3726,"1f96b":3742,"1f96c":3701,"1f96d":3681,"1f96e":3755,"1f96f":3714,"1f970":115,"1f971":198,"1f972":123,"1f973":168,"1f974":163,"1f975":161,"1f976":162,"1f977":1501,"1f978":169,"1f97a":182,"1f97b":61124,"1f97c":61113,"1f97d":61112,"1f97e":61138,"1f97f":61139,"1f980":3760,"1f981":2545,"1f982":2643,"1f983":2594,"1f984":2551,"1f985":2603,"1f986":2604,"1f987":2583,"1f988":2628,"1f989":2606,"1f98a":2540,"1f98b":2633,"1f98c":2553,"1f98d":2532,"1f98e":2615,"1f98f":2572,"1f990":3762,"1f991":3763,"1f992":2569,"1f993":2552,"1f994":2582,"1f995":2619,"1f996":2620,"1f997":2639,"1f998":2591,"1f999":2568,"1f99a":2610,"1f99b":2573,"1f99c":2611,"1f99d":2541,"1f99e":3761,"1f99f":2644,"1f9a0":2647,"1f9a1":2592,"1f9a2":2605,"1f9a3":2571,"1f9a4":2607,"1f9a5":2588,"1f9a6":2589,"1f9a7":2533,"1f9a8":2590,"1f9a9":2609,"1f9aa":3764,"1f9ab":2581,"1f9ac":2554,"1f9ad":2624,"1f9ae":2536,"1f9af":61312,"1f9b4":1380,"1f9b5":1371,"1f9b6":1372,"1f9b7":1379,"1f9b8-200d-2640":1532,"1f9b8-200d-2642":1531,"1f9b8":1530,"1f9b9-200d-2640":1535,"1f9b9-200d-2642":1534,"1f9b9":1533,"1f9ba":61114,"1f9bb":1374,"1f9bc":4905,"1f9bd":4904,"1f9be":1369,"1f9bf":1370,"1f9c0":3717,"1f9c1":3772,"1f9c2":3741,"1f9c3":3796,"1f9c4":3703,"1f9c5":3704,"1f9c6":3731,"1f9c7":3716,"1f9c8":3740,"1f9c9":3797,"1f9ca":3798,"1f9cb":3795,"1f9cd-200d-2640":1569,"1f9cd-200d-2642":1568,"1f9cd":1567,"1f9ce-200d-2640":1572,"1f9ce-200d-2642":1571,"1f9ce":1570,"1f9cf-200d-2640":1434,"1f9cf-200d-2642":1433,"1f9cf":1432,"1f9d0":172,"1f9d1-200d-1f33e":1456,"1f9d1-200d-1f373":1459,"1f9d1-200d-1f37c":1525,"1f9d1-200d-1f384":1529,"1f9d1-200d-1f393":1447,"1f9d1-200d-1f3a4":1477,"1f9d1-200d-1f3a8":1480,"1f9d1-200d-1f3eb":1450,"1f9d1-200d-1f3ed":1465,"1f9d1-200d-1f4bb":1474,"1f9d1-200d-1f4bc":1468,"1f9d1-200d-1f527":1462,"1f9d1-200d-1f52c":1471,"1f9d1-200d-1f680":1486,"1f9d1-200d-1f692":1489,"1f9d1-200d-1f91d-200d-1f9d1":1645,"1f9d1-200d-1f9af":1573,"1f9d1-200d-1f9b0":1402,"1f9d1-200d-1f9b1":1404,"1f9d1-200d-1f9b2":1408,"1f9d1-200d-1f9b3":1406,"1f9d1-200d-1f9bc":1576,"1f9d1-200d-1f9bd":1579,"1f9d1-200d-2695":1444,"1f9d1-200d-2696":1453,"1f9d1-200d-2708":1483,"1f9d1":1390,"1f9d2":1387,"1f9d3":1411,"1f9d4-200d-2640":1395,"1f9d4-200d-2642":1394,"1f9d4":1393,"1f9d5":1512,"1f9d6-200d-2640":1593,"1f9d6-200d-2642":1592,"1f9d6":1591,"1f9d7-200d-2640":1596,"1f9d7-200d-2642":1595,"1f9d7":1594,"1f9d8-200d-2640":1642,"1f9d8-200d-2642":1641,"1f9d8":1640,"1f9d9-200d-2640":1538,"1f9d9-200d-2642":1537,"1f9d9":1536,"1f9da-200d-2640":1541,"1f9da-200d-2642":1540,"1f9da":1539,"1f9db-200d-2640":1544,"1f9db-200d-2642":1543,"1f9db":1542,"1f9dc-200d-2640":1547,"1f9dc-200d-2642":1546,"1f9dc":1545,"1f9dd-200d-2640":1550,"1f9dd-200d-2642":1549,"1f9dd":1548,"1f9de-200d-2640":1553,"1f9de-200d-2642":1552,"1f9de":1551,"1f9df-200d-2640":1556,"1f9df-200d-2642":1555,"1f9df":1554,"1f9e0":1376,"1f9e1":1142,"1f9e2":61148,"1f9e3":61118,"1f9e4":61119,"1f9e5":61120,"1f9e6":61121,"1f9e7":51039,"1f9e8":51028,"1f9e9":51090,"1f9ea":61320,"1f9eb":61321,"1f9ec":61322,"1f9ed":4812,"1f9ee":61201,"1f9ef":61356,"1f9f0":61316,"1f9f1":4825,"1f9f2":61317,"1f9f3":4945,"1f9f4":61346,"1f9f5":51106,"1f9f6":51108,"1f9f7":61347,"1f9f8":51091,"1f9f9":61348,"1f9fa":61349,"1f9fb":61350,"1f9fc":61352,"1f9fd":61355,"1f9fe":61243,"1f9ff":51084,"1fa70":61142,"1fa71":61125,"1fa72":61126,"1fa73":61127,"1fa74":61135,"1fa78":61327,"1fa79":61329,"1fa7a":61331,"1fa80":51079,"1fa81":51080,"1fa82":4935,"1fa83":61302,"1fa84":51083,"1fa85":51092,"1fa86":51094,"1fa90":4993,"1fa91":61339,"1fa92":61345,"1fa93":61295,"1fa94":61217,"1fa95":61179,"1fa96":61149,"1fa97":61174,"1fa98":61181,"1fa99":61236,"1fa9a":61305,"1fa9b":61307,"1fa9c":61318,"1fa9d":61315,"1fa9e":61335,"1fa9f":61336,"1faa0":61341,"1faa1":51107,"1faa2":51109,"1faa3":61351,"1faa4":61344,"1faa5":61354,"1faa6":61360,"1faa7":61363,"1faa8":4826,"1fab0":2645,"1fab1":2646,"1fab2":2637,"1fab3":2640,"1fab4":2660,"1fab5":4827,"1fab6":2608,"1fac0":1377,"1fac1":1378,"1fac2":1686,"1fad0":3688,"1fad1":3699,"1fad2":3691,"1fad3":3712,"1fad4":3729,"1fad5":3736,"1fad6":3782,"203c":62834,"21a9":62765,"21aa":62766,"231a":4948,"231b":4946,"23cf":62818,"23e9":62805,"23ea":62809,"23eb":62812,"23ec":62814,"23ed":62806,"23ee":62810,"23ef":62807,"23f0":4949,"23f1":4950,"23f2":4951,"23f3":4947,"23f8":62815,"23f9":62816,"23fa":62817,"24c2":62890,"25aa":62938,"25ab":62939,"25b6":62804,"25c0":62808,"25fb":62935,"25fc":62934,"25fd":62937,"25fe":62936,"260e":61184,"261d":1350,"262a":62784,"262e":62785,"262f":62781,"263a":120,"264a":62790,"264b":62791,"264c":62792,"264d":62793,"264e":62794,"264f":62795,"265f":51099,"267b":62844,"267e":62833,"267f":62732,"269b":62777,"269c":62845,"26a0":62742,"26a1":41016,"26a7":62827,"26aa":62924,"26ab":62923,"26b0":61359,"26b1":61361,"26bd":51051,"26be":51052,"26c4":41019,"26c5":4999,"26c8":41e3,"26ce":62800,"26cf":61296,"26d1":61150,"26d3":61314,"26d4":62744,"26e9":4853,"26ea":4849,"26f0":4814,"26f1":41015,"26f2":4855,"26f3":51070,"26f4":4928,"26f5":4924,"26f7":1599,"26f8":51071,"26f9-200d-2640":1615,"26f9-200d-2642":1614,"26f9":1613,"26fa":4856,"26fd":4915,"270a":1354,"270b":1330,"270c":1339,"270d":1365,"270f":61258,"271d":62782,"274c":62853,"274e":62854,"2764-200d-1f525":1139,"2764-200d-1fa79":1140,"27a1":62757,"27b0":62855,"27bf":62856,"2b05":62761,"2b06":62755,"2b07":62759,"2b1b":62932,"2b1c":62933,"2b50":4994,"2b55":62849,"303d":62857,"1f385-1f3fb":0,"1f385-1f3fc":0,"1f385-1f3fd":0,"1f385-1f3fe":0,"1f385-1f3ff":0,"1f3c2-1f3fb":0,"1f3c2-1f3fc":0,"1f3c2-1f3fd":0,"1f3c2-1f3fe":0,"1f3c2-1f3ff":0,"1f3c3-1f3fb-200d-2640":0,"1f3c3-1f3fc-200d-2640":0,"1f3c3-1f3fd-200d-2640":0,"1f3c3-1f3fe-200d-2640":0,"1f3c3-1f3ff-200d-2640":0,"1f3c3-1f3fb-200d-2642":0,"1f3c3-1f3fc-200d-2642":0,"1f3c3-1f3fd-200d-2642":0,"1f3c3-1f3fe-200d-2642":0,"1f3c3-1f3ff-200d-2642":0,"1f3c3-1f3fb":0,"1f3c3-1f3fc":0,"1f3c3-1f3fd":0,"1f3c3-1f3fe":0,"1f3c3-1f3ff":0,"1f3c4-1f3fb-200d-2640":0,"1f3c4-1f3fc-200d-2640":0,"1f3c4-1f3fd-200d-2640":0,"1f3c4-1f3fe-200d-2640":0,"1f3c4-1f3ff-200d-2640":0,"1f3c4-1f3fb-200d-2642":0,"1f3c4-1f3fc-200d-2642":0,"1f3c4-1f3fd-200d-2642":0,"1f3c4-1f3fe-200d-2642":0,"1f3c4-1f3ff-200d-2642":0,"1f3c4-1f3fb":0,"1f3c4-1f3fc":0,"1f3c4-1f3fd":0,"1f3c4-1f3fe":0,"1f3c4-1f3ff":0,"1f3c7-1f3fb":0,"1f3c7-1f3fc":0,"1f3c7-1f3fd":0,"1f3c7-1f3fe":0,"1f3c7-1f3ff":0,"1f3ca-1f3fb-200d-2640":0,"1f3ca-1f3fc-200d-2640":0,"1f3ca-1f3fd-200d-2640":0,"1f3ca-1f3fe-200d-2640":0,"1f3ca-1f3ff-200d-2640":0,"1f3ca-1f3fb-200d-2642":0,"1f3ca-1f3fc-200d-2642":0,"1f3ca-1f3fd-200d-2642":0,"1f3ca-1f3fe-200d-2642":0,"1f3ca-1f3ff-200d-2642":0,"1f3ca-1f3fb":0,"1f3ca-1f3fc":0,"1f3ca-1f3fd":0,"1f3ca-1f3fe":0,"1f3ca-1f3ff":0,"1f3cb-1f3fb-200d-2640":0,"1f3cb-1f3fc-200d-2640":0,"1f3cb-1f3fd-200d-2640":0,"1f3cb-1f3fe-200d-2640":0,"1f3cb-1f3ff-200d-2640":0,"1f3cb-1f3fb-200d-2642":0,"1f3cb-1f3fc-200d-2642":0,"1f3cb-1f3fd-200d-2642":0,"1f3cb-1f3fe-200d-2642":0,"1f3cb-1f3ff-200d-2642":0,"1f3cb-1f3fb":0,"1f3cb-1f3fc":0,"1f3cb-1f3fd":0,"1f3cb-1f3fe":0,"1f3cb-1f3ff":0,"1f3cc-1f3fb-200d-2640":0,"1f3cc-1f3fc-200d-2640":0,"1f3cc-1f3fd-200d-2640":0,"1f3cc-1f3fe-200d-2640":0,"1f3cc-1f3ff-200d-2640":0,"1f3cc-1f3fb-200d-2642":0,"1f3cc-1f3fc-200d-2642":0,"1f3cc-1f3fd-200d-2642":0,"1f3cc-1f3fe-200d-2642":0,"1f3cc-1f3ff-200d-2642":0,"1f3cc-1f3fb":0,"1f3cc-1f3fc":0,"1f3cc-1f3fd":0,"1f3cc-1f3fe":0,"1f3cc-1f3ff":0,"1f442-1f3fb":0,"1f442-1f3fc":0,"1f442-1f3fd":0,"1f442-1f3fe":0,"1f442-1f3ff":0,"1f443-1f3fb":0,"1f443-1f3fc":0,"1f443-1f3fd":0,"1f443-1f3fe":0,"1f443-1f3ff":0,"1f446-1f3fb":0,"1f446-1f3fc":0,"1f446-1f3fd":0,"1f446-1f3fe":0,"1f446-1f3ff":0,"1f447-1f3fb":0,"1f447-1f3fc":0,"1f447-1f3fd":0,"1f447-1f3fe":0,"1f447-1f3ff":0,"1f448-1f3fb":0,"1f448-1f3fc":0,"1f448-1f3fd":0,"1f448-1f3fe":0,"1f448-1f3ff":0,"1f449-1f3fb":0,"1f449-1f3fc":0,"1f449-1f3fd":0,"1f449-1f3fe":0,"1f449-1f3ff":0,"1f44a-1f3fb":0,"1f44a-1f3fc":0,"1f44a-1f3fd":0,"1f44a-1f3fe":0,"1f44a-1f3ff":0,"1f44b-1f3fb":0,"1f44b-1f3fc":0,"1f44b-1f3fd":0,"1f44b-1f3fe":0,"1f44b-1f3ff":0,"1f44c-1f3fb":0,"1f44c-1f3fc":0,"1f44c-1f3fd":0,"1f44c-1f3fe":0,"1f44c-1f3ff":0,"1f44d-1f3fb":0,"1f44d-1f3fc":0,"1f44d-1f3fd":0,"1f44d-1f3fe":0,"1f44d-1f3ff":0,"1f44e-1f3fb":0,"1f44e-1f3fc":0,"1f44e-1f3fd":0,"1f44e-1f3fe":0,"1f44e-1f3ff":0,"1f44f-1f3fb":0,"1f44f-1f3fc":0,"1f44f-1f3fd":0,"1f44f-1f3fe":0,"1f44f-1f3ff":0,"1f450-1f3fb":0,"1f450-1f3fc":0,"1f450-1f3fd":0,"1f450-1f3fe":0,"1f450-1f3ff":0,"1f466-1f3fb":0,"1f466-1f3fc":0,"1f466-1f3fd":0,"1f466-1f3fe":0,"1f466-1f3ff":0,"1f467-1f3fb":0,"1f467-1f3fc":0,"1f467-1f3fd":0,"1f467-1f3fe":0,"1f467-1f3ff":0,"1f468-1f3fb-200d-1f33e":0,"1f468-1f3fc-200d-1f33e":0,"1f468-1f3fd-200d-1f33e":0,"1f468-1f3fe-200d-1f33e":0,"1f468-1f3ff-200d-1f33e":0,"1f468-1f3fb-200d-1f373":0,"1f468-1f3fc-200d-1f373":0,"1f468-1f3fd-200d-1f373":0,"1f468-1f3fe-200d-1f373":0,"1f468-1f3ff-200d-1f373":0,"1f468-1f3fb-200d-1f37c":0,"1f468-1f3fc-200d-1f37c":0,"1f468-1f3fd-200d-1f37c":0,"1f468-1f3fe-200d-1f37c":0,"1f468-1f3ff-200d-1f37c":0,"1f468-1f3fb-200d-1f393":0,"1f468-1f3fc-200d-1f393":0,"1f468-1f3fd-200d-1f393":0,"1f468-1f3fe-200d-1f393":0,"1f468-1f3ff-200d-1f393":0,"1f468-1f3fb-200d-1f3a4":0,"1f468-1f3fc-200d-1f3a4":0,"1f468-1f3fd-200d-1f3a4":0,"1f468-1f3fe-200d-1f3a4":0,"1f468-1f3ff-200d-1f3a4":0,"1f468-1f3fb-200d-1f3a8":0,"1f468-1f3fc-200d-1f3a8":0,"1f468-1f3fd-200d-1f3a8":0,"1f468-1f3fe-200d-1f3a8":0,"1f468-1f3ff-200d-1f3a8":0,"1f468-1f3fb-200d-1f3eb":0,"1f468-1f3fc-200d-1f3eb":0,"1f468-1f3fd-200d-1f3eb":0,"1f468-1f3fe-200d-1f3eb":0,"1f468-1f3ff-200d-1f3eb":0,"1f468-1f3fb-200d-1f3ed":0,"1f468-1f3fc-200d-1f3ed":0,"1f468-1f3fd-200d-1f3ed":0,"1f468-1f3fe-200d-1f3ed":0,"1f468-1f3ff-200d-1f3ed":0,"1f468-1f3fb-200d-1f4bb":0,"1f468-1f3fc-200d-1f4bb":0,"1f468-1f3fd-200d-1f4bb":0,"1f468-1f3fe-200d-1f4bb":0,"1f468-1f3ff-200d-1f4bb":0,"1f468-1f3fb-200d-1f4bc":0,"1f468-1f3fc-200d-1f4bc":0,"1f468-1f3fd-200d-1f4bc":0,"1f468-1f3fe-200d-1f4bc":0,"1f468-1f3ff-200d-1f4bc":0,"1f468-1f3fb-200d-1f527":0,"1f468-1f3fc-200d-1f527":0,"1f468-1f3fd-200d-1f527":0,"1f468-1f3fe-200d-1f527":0,"1f468-1f3ff-200d-1f527":0,"1f468-1f3fb-200d-1f52c":0,"1f468-1f3fc-200d-1f52c":0,"1f468-1f3fd-200d-1f52c":0,"1f468-1f3fe-200d-1f52c":0,"1f468-1f3ff-200d-1f52c":0,"1f468-1f3fb-200d-1f680":0,"1f468-1f3fc-200d-1f680":0,"1f468-1f3fd-200d-1f680":0,"1f468-1f3fe-200d-1f680":0,"1f468-1f3ff-200d-1f680":0,"1f468-1f3fb-200d-1f692":0,"1f468-1f3fc-200d-1f692":0,"1f468-1f3fd-200d-1f692":0,"1f468-1f3fe-200d-1f692":0,"1f468-1f3ff-200d-1f692":0,"1f468-1f3fb-200d-1f9af":0,"1f468-1f3fc-200d-1f9af":0,"1f468-1f3fd-200d-1f9af":0,"1f468-1f3fe-200d-1f9af":0,"1f468-1f3ff-200d-1f9af":0,"1f468-1f3fb-200d-1f9b0":0,"1f468-1f3fc-200d-1f9b0":0,"1f468-1f3fd-200d-1f9b0":0,"1f468-1f3fe-200d-1f9b0":0,"1f468-1f3ff-200d-1f9b0":0,"1f468-1f3fb-200d-1f9b1":0,"1f468-1f3fc-200d-1f9b1":0,"1f468-1f3fd-200d-1f9b1":0,"1f468-1f3fe-200d-1f9b1":0,"1f468-1f3ff-200d-1f9b1":0,"1f468-1f3fb-200d-1f9b2":0,"1f468-1f3fc-200d-1f9b2":0,"1f468-1f3fd-200d-1f9b2":0,"1f468-1f3fe-200d-1f9b2":0,"1f468-1f3ff-200d-1f9b2":0,"1f468-1f3fb-200d-1f9b3":0,"1f468-1f3fc-200d-1f9b3":0,"1f468-1f3fd-200d-1f9b3":0,"1f468-1f3fe-200d-1f9b3":0,"1f468-1f3ff-200d-1f9b3":0,"1f468-1f3fb-200d-1f9bc":0,"1f468-1f3fc-200d-1f9bc":0,"1f468-1f3fd-200d-1f9bc":0,"1f468-1f3fe-200d-1f9bc":0,"1f468-1f3ff-200d-1f9bc":0,"1f468-1f3fb-200d-1f9bd":0,"1f468-1f3fc-200d-1f9bd":0,"1f468-1f3fd-200d-1f9bd":0,"1f468-1f3fe-200d-1f9bd":0,"1f468-1f3ff-200d-1f9bd":0,"1f468-1f3fb-200d-2695":0,"1f468-1f3fc-200d-2695":0,"1f468-1f3fd-200d-2695":0,"1f468-1f3fe-200d-2695":0,"1f468-1f3ff-200d-2695":0,"1f468-1f3fb-200d-2696":0,"1f468-1f3fc-200d-2696":0,"1f468-1f3fd-200d-2696":0,"1f468-1f3fe-200d-2696":0,"1f468-1f3ff-200d-2696":0,"1f468-1f3fb-200d-2708":0,"1f468-1f3fc-200d-2708":0,"1f468-1f3fd-200d-2708":0,"1f468-1f3fe-200d-2708":0,"1f468-1f3ff-200d-2708":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fb":0,"1f468-1f3fc":0,"1f468-1f3fd":0,"1f468-1f3fe":0,"1f468-1f3ff":0,"1f469-1f3fb-200d-1f33e":0,"1f469-1f3fc-200d-1f33e":0,"1f469-1f3fd-200d-1f33e":0,"1f469-1f3fe-200d-1f33e":0,"1f469-1f3ff-200d-1f33e":0,"1f469-1f3fb-200d-1f373":0,"1f469-1f3fc-200d-1f373":0,"1f469-1f3fd-200d-1f373":0,"1f469-1f3fe-200d-1f373":0,"1f469-1f3ff-200d-1f373":0,"1f469-1f3fb-200d-1f37c":0,"1f469-1f3fc-200d-1f37c":0,"1f469-1f3fd-200d-1f37c":0,"1f469-1f3fe-200d-1f37c":0,"1f469-1f3ff-200d-1f37c":0,"1f469-1f3fb-200d-1f393":0,"1f469-1f3fc-200d-1f393":0,"1f469-1f3fd-200d-1f393":0,"1f469-1f3fe-200d-1f393":0,"1f469-1f3ff-200d-1f393":0,"1f469-1f3fb-200d-1f3a4":0,"1f469-1f3fc-200d-1f3a4":0,"1f469-1f3fd-200d-1f3a4":0,"1f469-1f3fe-200d-1f3a4":0,"1f469-1f3ff-200d-1f3a4":0,"1f469-1f3fb-200d-1f3a8":0,"1f469-1f3fc-200d-1f3a8":0,"1f469-1f3fd-200d-1f3a8":0,"1f469-1f3fe-200d-1f3a8":0,"1f469-1f3ff-200d-1f3a8":0,"1f469-1f3fb-200d-1f3eb":0,"1f469-1f3fc-200d-1f3eb":0,"1f469-1f3fd-200d-1f3eb":0,"1f469-1f3fe-200d-1f3eb":0,"1f469-1f3ff-200d-1f3eb":0,"1f469-1f3fb-200d-1f3ed":0,"1f469-1f3fc-200d-1f3ed":0,"1f469-1f3fd-200d-1f3ed":0,"1f469-1f3fe-200d-1f3ed":0,"1f469-1f3ff-200d-1f3ed":0,"1f469-1f3fb-200d-1f4bb":0,"1f469-1f3fc-200d-1f4bb":0,"1f469-1f3fd-200d-1f4bb":0,"1f469-1f3fe-200d-1f4bb":0,"1f469-1f3ff-200d-1f4bb":0,"1f469-1f3fb-200d-1f4bc":0,"1f469-1f3fc-200d-1f4bc":0,"1f469-1f3fd-200d-1f4bc":0,"1f469-1f3fe-200d-1f4bc":0,"1f469-1f3ff-200d-1f4bc":0,"1f469-1f3fb-200d-1f527":0,"1f469-1f3fc-200d-1f527":0,"1f469-1f3fd-200d-1f527":0,"1f469-1f3fe-200d-1f527":0,"1f469-1f3ff-200d-1f527":0,"1f469-1f3fb-200d-1f52c":0,"1f469-1f3fc-200d-1f52c":0,"1f469-1f3fd-200d-1f52c":0,"1f469-1f3fe-200d-1f52c":0,"1f469-1f3ff-200d-1f52c":0,"1f469-1f3fb-200d-1f680":0,"1f469-1f3fc-200d-1f680":0,"1f469-1f3fd-200d-1f680":0,"1f469-1f3fe-200d-1f680":0,"1f469-1f3ff-200d-1f680":0,"1f469-1f3fb-200d-1f692":0,"1f469-1f3fc-200d-1f692":0,"1f469-1f3fd-200d-1f692":0,"1f469-1f3fe-200d-1f692":0,"1f469-1f3ff-200d-1f692":0,"1f469-1f3fb-200d-1f9af":0,"1f469-1f3fc-200d-1f9af":0,"1f469-1f3fd-200d-1f9af":0,"1f469-1f3fe-200d-1f9af":0,"1f469-1f3ff-200d-1f9af":0,"1f469-1f3fb-200d-1f9b0":0,"1f469-1f3fc-200d-1f9b0":0,"1f469-1f3fd-200d-1f9b0":0,"1f469-1f3fe-200d-1f9b0":0,"1f469-1f3ff-200d-1f9b0":0,"1f469-1f3fb-200d-1f9b1":0,"1f469-1f3fc-200d-1f9b1":0,"1f469-1f3fd-200d-1f9b1":0,"1f469-1f3fe-200d-1f9b1":0,"1f469-1f3ff-200d-1f9b1":0,"1f469-1f3fb-200d-1f9b2":0,"1f469-1f3fc-200d-1f9b2":0,"1f469-1f3fd-200d-1f9b2":0,"1f469-1f3fe-200d-1f9b2":0,"1f469-1f3ff-200d-1f9b2":0,"1f469-1f3fb-200d-1f9b3":0,"1f469-1f3fc-200d-1f9b3":0,"1f469-1f3fd-200d-1f9b3":0,"1f469-1f3fe-200d-1f9b3":0,"1f469-1f3ff-200d-1f9b3":0,"1f469-1f3fb-200d-1f9bc":0,"1f469-1f3fc-200d-1f9bc":0,"1f469-1f3fd-200d-1f9bc":0,"1f469-1f3fe-200d-1f9bc":0,"1f469-1f3ff-200d-1f9bc":0,"1f469-1f3fb-200d-1f9bd":0,"1f469-1f3fc-200d-1f9bd":0,"1f469-1f3fd-200d-1f9bd":0,"1f469-1f3fe-200d-1f9bd":0,"1f469-1f3ff-200d-1f9bd":0,"1f469-1f3fb-200d-2695":0,"1f469-1f3fc-200d-2695":0,"1f469-1f3fd-200d-2695":0,"1f469-1f3fe-200d-2695":0,"1f469-1f3ff-200d-2695":0,"1f469-1f3fb-200d-2696":0,"1f469-1f3fc-200d-2696":0,"1f469-1f3fd-200d-2696":0,"1f469-1f3fe-200d-2696":0,"1f469-1f3ff-200d-2696":0,"1f469-1f3fb-200d-2708":0,"1f469-1f3fc-200d-2708":0,"1f469-1f3fd-200d-2708":0,"1f469-1f3fe-200d-2708":0,"1f469-1f3ff-200d-2708":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fb":0,"1f469-1f3fc":0,"1f469-1f3fd":0,"1f469-1f3fe":0,"1f469-1f3ff":0,"1f46b-1f3fb":0,"1f46b-1f3fc":0,"1f46b-1f3fd":0,"1f46b-1f3fe":0,"1f46b-1f3ff":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3fe":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3fe":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3fe":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fe":0,"1f46c-1f3fb":0,"1f46c-1f3fc":0,"1f46c-1f3fd":0,"1f46c-1f3fe":0,"1f46c-1f3ff":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3fe":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3fe":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3fe":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fe":0,"1f46d-1f3fb":0,"1f46d-1f3fc":0,"1f46d-1f3fd":0,"1f46d-1f3fe":0,"1f46d-1f3ff":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3fe":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3fe":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3fe":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fe":0,"1f46e-1f3fb-200d-2640":0,"1f46e-1f3fc-200d-2640":0,"1f46e-1f3fd-200d-2640":0,"1f46e-1f3fe-200d-2640":0,"1f46e-1f3ff-200d-2640":0,"1f46e-1f3fb-200d-2642":0,"1f46e-1f3fc-200d-2642":0,"1f46e-1f3fd-200d-2642":0,"1f46e-1f3fe-200d-2642":0,"1f46e-1f3ff-200d-2642":0,"1f46e-1f3fb":0,"1f46e-1f3fc":0,"1f46e-1f3fd":0,"1f46e-1f3fe":0,"1f46e-1f3ff":0,"1f470-1f3fb-200d-2640":0,"1f470-1f3fc-200d-2640":0,"1f470-1f3fd-200d-2640":0,"1f470-1f3fe-200d-2640":0,"1f470-1f3ff-200d-2640":0,"1f470-1f3fb-200d-2642":0,"1f470-1f3fc-200d-2642":0,"1f470-1f3fd-200d-2642":0,"1f470-1f3fe-200d-2642":0,"1f470-1f3ff-200d-2642":0,"1f470-1f3fb":0,"1f470-1f3fc":0,"1f470-1f3fd":0,"1f470-1f3fe":0,"1f470-1f3ff":0,"1f471-1f3fb-200d-2640":0,"1f471-1f3fc-200d-2640":0,"1f471-1f3fd-200d-2640":0,"1f471-1f3fe-200d-2640":0,"1f471-1f3ff-200d-2640":0,"1f471-1f3fb-200d-2642":0,"1f471-1f3fc-200d-2642":0,"1f471-1f3fd-200d-2642":0,"1f471-1f3fe-200d-2642":0,"1f471-1f3ff-200d-2642":0,"1f471-1f3fb":0,"1f471-1f3fc":0,"1f471-1f3fd":0,"1f471-1f3fe":0,"1f471-1f3ff":0,"1f472-1f3fb":0,"1f472-1f3fc":0,"1f472-1f3fd":0,"1f472-1f3fe":0,"1f472-1f3ff":0,"1f473-1f3fb-200d-2640":0,"1f473-1f3fc-200d-2640":0,"1f473-1f3fd-200d-2640":0,"1f473-1f3fe-200d-2640":0,"1f473-1f3ff-200d-2640":0,"1f473-1f3fb-200d-2642":0,"1f473-1f3fc-200d-2642":0,"1f473-1f3fd-200d-2642":0,"1f473-1f3fe-200d-2642":0,"1f473-1f3ff-200d-2642":0,"1f473-1f3fb":0,"1f473-1f3fc":0,"1f473-1f3fd":0,"1f473-1f3fe":0,"1f473-1f3ff":0,"1f474-1f3fb":0,"1f474-1f3fc":0,"1f474-1f3fd":0,"1f474-1f3fe":0,"1f474-1f3ff":0,"1f475-1f3fb":0,"1f475-1f3fc":0,"1f475-1f3fd":0,"1f475-1f3fe":0,"1f475-1f3ff":0,"1f476-1f3fb":0,"1f476-1f3fc":0,"1f476-1f3fd":0,"1f476-1f3fe":0,"1f476-1f3ff":0,"1f477-1f3fb-200d-2640":0,"1f477-1f3fc-200d-2640":0,"1f477-1f3fd-200d-2640":0,"1f477-1f3fe-200d-2640":0,"1f477-1f3ff-200d-2640":0,"1f477-1f3fb-200d-2642":0,"1f477-1f3fc-200d-2642":0,"1f477-1f3fd-200d-2642":0,"1f477-1f3fe-200d-2642":0,"1f477-1f3ff-200d-2642":0,"1f477-1f3fb":0,"1f477-1f3fc":0,"1f477-1f3fd":0,"1f477-1f3fe":0,"1f477-1f3ff":0,"1f478-1f3fb":0,"1f478-1f3fc":0,"1f478-1f3fd":0,"1f478-1f3fe":0,"1f478-1f3ff":0,"1f47c-1f3fb":0,"1f47c-1f3fc":0,"1f47c-1f3fd":0,"1f47c-1f3fe":0,"1f47c-1f3ff":0,"1f481-1f3fb-200d-2640":0,"1f481-1f3fc-200d-2640":0,"1f481-1f3fd-200d-2640":0,"1f481-1f3fe-200d-2640":0,"1f481-1f3ff-200d-2640":0,"1f481-1f3fb-200d-2642":0,"1f481-1f3fc-200d-2642":0,"1f481-1f3fd-200d-2642":0,"1f481-1f3fe-200d-2642":0,"1f481-1f3ff-200d-2642":0,"1f481-1f3fb":0,"1f481-1f3fc":0,"1f481-1f3fd":0,"1f481-1f3fe":0,"1f481-1f3ff":0,"1f482-1f3fb-200d-2640":0,"1f482-1f3fc-200d-2640":0,"1f482-1f3fd-200d-2640":0,"1f482-1f3fe-200d-2640":0,"1f482-1f3ff-200d-2640":0,"1f482-1f3fb-200d-2642":0,"1f482-1f3fc-200d-2642":0,"1f482-1f3fd-200d-2642":0,"1f482-1f3fe-200d-2642":0,"1f482-1f3ff-200d-2642":0,"1f482-1f3fb":0,"1f482-1f3fc":0,"1f482-1f3fd":0,"1f482-1f3fe":0,"1f482-1f3ff":0,"1f483-1f3fb":0,"1f483-1f3fc":0,"1f483-1f3fd":0,"1f483-1f3fe":0,"1f483-1f3ff":0,"1f485-1f3fb":0,"1f485-1f3fc":0,"1f485-1f3fd":0,"1f485-1f3fe":0,"1f485-1f3ff":0,"1f486-1f3fb-200d-2640":0,"1f486-1f3fc-200d-2640":0,"1f486-1f3fd-200d-2640":0,"1f486-1f3fe-200d-2640":0,"1f486-1f3ff-200d-2640":0,"1f486-1f3fb-200d-2642":0,"1f486-1f3fc-200d-2642":0,"1f486-1f3fd-200d-2642":0,"1f486-1f3fe-200d-2642":0,"1f486-1f3ff-200d-2642":0,"1f486-1f3fb":0,"1f486-1f3fc":0,"1f486-1f3fd":0,"1f486-1f3fe":0,"1f486-1f3ff":0,"1f487-1f3fb-200d-2640":0,"1f487-1f3fc-200d-2640":0,"1f487-1f3fd-200d-2640":0,"1f487-1f3fe-200d-2640":0,"1f487-1f3ff-200d-2640":0,"1f487-1f3fb-200d-2642":0,"1f487-1f3fc-200d-2642":0,"1f487-1f3fd-200d-2642":0,"1f487-1f3fe-200d-2642":0,"1f487-1f3ff-200d-2642":0,"1f487-1f3fb":0,"1f487-1f3fc":0,"1f487-1f3fd":0,"1f487-1f3fe":0,"1f487-1f3ff":0,"1f48f-1f3fb":0,"1f48f-1f3fc":0,"1f48f-1f3fd":0,"1f48f-1f3fe":0,"1f48f-1f3ff":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f491-1f3fb":0,"1f491-1f3fc":0,"1f491-1f3fd":0,"1f491-1f3fe":0,"1f491-1f3ff":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fe":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fe":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fe":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fe":0,"1f4aa-1f3fb":0,"1f4aa-1f3fc":0,"1f4aa-1f3fd":0,"1f4aa-1f3fe":0,"1f4aa-1f3ff":0,"1f574-1f3fb":0,"1f574-1f3fc":0,"1f574-1f3fd":0,"1f574-1f3fe":0,"1f574-1f3ff":0,"1f575-1f3fb-200d-2640":0,"1f575-1f3fc-200d-2640":0,"1f575-1f3fd-200d-2640":0,"1f575-1f3fe-200d-2640":0,"1f575-1f3ff-200d-2640":0,"1f575-1f3fb-200d-2642":0,"1f575-1f3fc-200d-2642":0,"1f575-1f3fd-200d-2642":0,"1f575-1f3fe-200d-2642":0,"1f575-1f3ff-200d-2642":0,"1f575-1f3fb":0,"1f575-1f3fc":0,"1f575-1f3fd":0,"1f575-1f3fe":0,"1f575-1f3ff":0,"1f57a-1f3fb":0,"1f57a-1f3fc":0,"1f57a-1f3fd":0,"1f57a-1f3fe":0,"1f57a-1f3ff":0,"1f590-1f3fb":0,"1f590-1f3fc":0,"1f590-1f3fd":0,"1f590-1f3fe":0,"1f590-1f3ff":0,"1f595-1f3fb":0,"1f595-1f3fc":0,"1f595-1f3fd":0,"1f595-1f3fe":0,"1f595-1f3ff":0,"1f596-1f3fb":0,"1f596-1f3fc":0,"1f596-1f3fd":0,"1f596-1f3fe":0,"1f596-1f3ff":0,"1f645-1f3fb-200d-2640":0,"1f645-1f3fc-200d-2640":0,"1f645-1f3fd-200d-2640":0,"1f645-1f3fe-200d-2640":0,"1f645-1f3ff-200d-2640":0,"1f645-1f3fb-200d-2642":0,"1f645-1f3fc-200d-2642":0,"1f645-1f3fd-200d-2642":0,"1f645-1f3fe-200d-2642":0,"1f645-1f3ff-200d-2642":0,"1f645-1f3fb":0,"1f645-1f3fc":0,"1f645-1f3fd":0,"1f645-1f3fe":0,"1f645-1f3ff":0,"1f646-1f3fb-200d-2640":0,"1f646-1f3fc-200d-2640":0,"1f646-1f3fd-200d-2640":0,"1f646-1f3fe-200d-2640":0,"1f646-1f3ff-200d-2640":0,"1f646-1f3fb-200d-2642":0,"1f646-1f3fc-200d-2642":0,"1f646-1f3fd-200d-2642":0,"1f646-1f3fe-200d-2642":0,"1f646-1f3ff-200d-2642":0,"1f646-1f3fb":0,"1f646-1f3fc":0,"1f646-1f3fd":0,"1f646-1f3fe":0,"1f646-1f3ff":0,"1f647-1f3fb-200d-2640":0,"1f647-1f3fc-200d-2640":0,"1f647-1f3fd-200d-2640":0,"1f647-1f3fe-200d-2640":0,"1f647-1f3ff-200d-2640":0,"1f647-1f3fb-200d-2642":0,"1f647-1f3fc-200d-2642":0,"1f647-1f3fd-200d-2642":0,"1f647-1f3fe-200d-2642":0,"1f647-1f3ff-200d-2642":0,"1f647-1f3fb":0,"1f647-1f3fc":0,"1f647-1f3fd":0,"1f647-1f3fe":0,"1f647-1f3ff":0,"1f64b-1f3fb-200d-2640":0,"1f64b-1f3fc-200d-2640":0,"1f64b-1f3fd-200d-2640":0,"1f64b-1f3fe-200d-2640":0,"1f64b-1f3ff-200d-2640":0,"1f64b-1f3fb-200d-2642":0,"1f64b-1f3fc-200d-2642":0,"1f64b-1f3fd-200d-2642":0,"1f64b-1f3fe-200d-2642":0,"1f64b-1f3ff-200d-2642":0,"1f64b-1f3fb":0,"1f64b-1f3fc":0,"1f64b-1f3fd":0,"1f64b-1f3fe":0,"1f64b-1f3ff":0,"1f64c-1f3fb":0,"1f64c-1f3fc":0,"1f64c-1f3fd":0,"1f64c-1f3fe":0,"1f64c-1f3ff":0,"1f64d-1f3fb-200d-2640":0,"1f64d-1f3fc-200d-2640":0,"1f64d-1f3fd-200d-2640":0,"1f64d-1f3fe-200d-2640":0,"1f64d-1f3ff-200d-2640":0,"1f64d-1f3fb-200d-2642":0,"1f64d-1f3fc-200d-2642":0,"1f64d-1f3fd-200d-2642":0,"1f64d-1f3fe-200d-2642":0,"1f64d-1f3ff-200d-2642":0,"1f64d-1f3fb":0,"1f64d-1f3fc":0,"1f64d-1f3fd":0,"1f64d-1f3fe":0,"1f64d-1f3ff":0,"1f64e-1f3fb-200d-2640":0,"1f64e-1f3fc-200d-2640":0,"1f64e-1f3fd-200d-2640":0,"1f64e-1f3fe-200d-2640":0,"1f64e-1f3ff-200d-2640":0,"1f64e-1f3fb-200d-2642":0,"1f64e-1f3fc-200d-2642":0,"1f64e-1f3fd-200d-2642":0,"1f64e-1f3fe-200d-2642":0,"1f64e-1f3ff-200d-2642":0,"1f64e-1f3fb":0,"1f64e-1f3fc":0,"1f64e-1f3fd":0,"1f64e-1f3fe":0,"1f64e-1f3ff":0,"1f64f-1f3fb":0,"1f64f-1f3fc":0,"1f64f-1f3fd":0,"1f64f-1f3fe":0,"1f64f-1f3ff":0,"1f6a3-1f3fb-200d-2640":0,"1f6a3-1f3fc-200d-2640":0,"1f6a3-1f3fd-200d-2640":0,"1f6a3-1f3fe-200d-2640":0,"1f6a3-1f3ff-200d-2640":0,"1f6a3-1f3fb-200d-2642":0,"1f6a3-1f3fc-200d-2642":0,"1f6a3-1f3fd-200d-2642":0,"1f6a3-1f3fe-200d-2642":0,"1f6a3-1f3ff-200d-2642":0,"1f6a3-1f3fb":0,"1f6a3-1f3fc":0,"1f6a3-1f3fd":0,"1f6a3-1f3fe":0,"1f6a3-1f3ff":0,"1f6b4-1f3fb-200d-2640":0,"1f6b4-1f3fc-200d-2640":0,"1f6b4-1f3fd-200d-2640":0,"1f6b4-1f3fe-200d-2640":0,"1f6b4-1f3ff-200d-2640":0,"1f6b4-1f3fb-200d-2642":0,"1f6b4-1f3fc-200d-2642":0,"1f6b4-1f3fd-200d-2642":0,"1f6b4-1f3fe-200d-2642":0,"1f6b4-1f3ff-200d-2642":0,"1f6b4-1f3fb":0,"1f6b4-1f3fc":0,"1f6b4-1f3fd":0,"1f6b4-1f3fe":0,"1f6b4-1f3ff":0,"1f6b5-1f3fb-200d-2640":0,"1f6b5-1f3fc-200d-2640":0,"1f6b5-1f3fd-200d-2640":0,"1f6b5-1f3fe-200d-2640":0,"1f6b5-1f3ff-200d-2640":0,"1f6b5-1f3fb-200d-2642":0,"1f6b5-1f3fc-200d-2642":0,"1f6b5-1f3fd-200d-2642":0,"1f6b5-1f3fe-200d-2642":0,"1f6b5-1f3ff-200d-2642":0,"1f6b5-1f3fb":0,"1f6b5-1f3fc":0,"1f6b5-1f3fd":0,"1f6b5-1f3fe":0,"1f6b5-1f3ff":0,"1f6b6-1f3fb-200d-2640":0,"1f6b6-1f3fc-200d-2640":0,"1f6b6-1f3fd-200d-2640":0,"1f6b6-1f3fe-200d-2640":0,"1f6b6-1f3ff-200d-2640":0,"1f6b6-1f3fb-200d-2642":0,"1f6b6-1f3fc-200d-2642":0,"1f6b6-1f3fd-200d-2642":0,"1f6b6-1f3fe-200d-2642":0,"1f6b6-1f3ff-200d-2642":0,"1f6b6-1f3fb":0,"1f6b6-1f3fc":0,"1f6b6-1f3fd":0,"1f6b6-1f3fe":0,"1f6b6-1f3ff":0,"1f6c0-1f3fb":0,"1f6c0-1f3fc":0,"1f6c0-1f3fd":0,"1f6c0-1f3fe":0,"1f6c0-1f3ff":0,"1f6cc-1f3fb":0,"1f6cc-1f3fc":0,"1f6cc-1f3fd":0,"1f6cc-1f3fe":0,"1f6cc-1f3ff":0,"1f90c-1f3fb":0,"1f90c-1f3fc":0,"1f90c-1f3fd":0,"1f90c-1f3fe":0,"1f90c-1f3ff":0,"1f90f-1f3fb":0,"1f90f-1f3fc":0,"1f90f-1f3fd":0,"1f90f-1f3fe":0,"1f90f-1f3ff":0,"1f918-1f3fb":0,"1f918-1f3fc":0,"1f918-1f3fd":0,"1f918-1f3fe":0,"1f918-1f3ff":0,"1f919-1f3fb":0,"1f919-1f3fc":0,"1f919-1f3fd":0,"1f919-1f3fe":0,"1f919-1f3ff":0,"1f91a-1f3fb":0,"1f91a-1f3fc":0,"1f91a-1f3fd":0,"1f91a-1f3fe":0,"1f91a-1f3ff":0,"1f91b-1f3fb":0,"1f91b-1f3fc":0,"1f91b-1f3fd":0,"1f91b-1f3fe":0,"1f91b-1f3ff":0,"1f91c-1f3fb":0,"1f91c-1f3fc":0,"1f91c-1f3fd":0,"1f91c-1f3fe":0,"1f91c-1f3ff":0,"1f91d-1f3fb":0,"1f91d-1f3fc":0,"1f91d-1f3fd":0,"1f91d-1f3fe":0,"1f91d-1f3ff":0,"1f91e-1f3fb":0,"1f91e-1f3fc":0,"1f91e-1f3fd":0,"1f91e-1f3fe":0,"1f91e-1f3ff":0,"1f91f-1f3fb":0,"1f91f-1f3fc":0,"1f91f-1f3fd":0,"1f91f-1f3fe":0,"1f91f-1f3ff":0,"1f926-1f3fb-200d-2640":0,"1f926-1f3fc-200d-2640":0,"1f926-1f3fd-200d-2640":0,"1f926-1f3fe-200d-2640":0,"1f926-1f3ff-200d-2640":0,"1f926-1f3fb-200d-2642":0,"1f926-1f3fc-200d-2642":0,"1f926-1f3fd-200d-2642":0,"1f926-1f3fe-200d-2642":0,"1f926-1f3ff-200d-2642":0,"1f926-1f3fb":0,"1f926-1f3fc":0,"1f926-1f3fd":0,"1f926-1f3fe":0,"1f926-1f3ff":0,"1f930-1f3fb":0,"1f930-1f3fc":0,"1f930-1f3fd":0,"1f930-1f3fe":0,"1f930-1f3ff":0,"1f931-1f3fb":0,"1f931-1f3fc":0,"1f931-1f3fd":0,"1f931-1f3fe":0,"1f931-1f3ff":0,"1f932-1f3fb":0,"1f932-1f3fc":0,"1f932-1f3fd":0,"1f932-1f3fe":0,"1f932-1f3ff":0,"1f933-1f3fb":0,"1f933-1f3fc":0,"1f933-1f3fd":0,"1f933-1f3fe":0,"1f933-1f3ff":0,"1f934-1f3fb":0,"1f934-1f3fc":0,"1f934-1f3fd":0,"1f934-1f3fe":0,"1f934-1f3ff":0,"1f935-1f3fb-200d-2640":0,"1f935-1f3fc-200d-2640":0,"1f935-1f3fd-200d-2640":0,"1f935-1f3fe-200d-2640":0,"1f935-1f3ff-200d-2640":0,"1f935-1f3fb-200d-2642":0,"1f935-1f3fc-200d-2642":0,"1f935-1f3fd-200d-2642":0,"1f935-1f3fe-200d-2642":0,"1f935-1f3ff-200d-2642":0,"1f935-1f3fb":0,"1f935-1f3fc":0,"1f935-1f3fd":0,"1f935-1f3fe":0,"1f935-1f3ff":0,"1f936-1f3fb":0,"1f936-1f3fc":0,"1f936-1f3fd":0,"1f936-1f3fe":0,"1f936-1f3ff":0,"1f937-1f3fb-200d-2640":0,"1f937-1f3fc-200d-2640":0,"1f937-1f3fd-200d-2640":0,"1f937-1f3fe-200d-2640":0,"1f937-1f3ff-200d-2640":0,"1f937-1f3fb-200d-2642":0,"1f937-1f3fc-200d-2642":0,"1f937-1f3fd-200d-2642":0,"1f937-1f3fe-200d-2642":0,"1f937-1f3ff-200d-2642":0,"1f937-1f3fb":0,"1f937-1f3fc":0,"1f937-1f3fd":0,"1f937-1f3fe":0,"1f937-1f3ff":0,"1f938-1f3fb-200d-2640":0,"1f938-1f3fc-200d-2640":0,"1f938-1f3fd-200d-2640":0,"1f938-1f3fe-200d-2640":0,"1f938-1f3ff-200d-2640":0,"1f938-1f3fb-200d-2642":0,"1f938-1f3fc-200d-2642":0,"1f938-1f3fd-200d-2642":0,"1f938-1f3fe-200d-2642":0,"1f938-1f3ff-200d-2642":0,"1f938-1f3fb":0,"1f938-1f3fc":0,"1f938-1f3fd":0,"1f938-1f3fe":0,"1f938-1f3ff":0,"1f939-1f3fb-200d-2640":0,"1f939-1f3fc-200d-2640":0,"1f939-1f3fd-200d-2640":0,"1f939-1f3fe-200d-2640":0,"1f939-1f3ff-200d-2640":0,"1f939-1f3fb-200d-2642":0,"1f939-1f3fc-200d-2642":0,"1f939-1f3fd-200d-2642":0,"1f939-1f3fe-200d-2642":0,"1f939-1f3ff-200d-2642":0,"1f939-1f3fb":0,"1f939-1f3fc":0,"1f939-1f3fd":0,"1f939-1f3fe":0,"1f939-1f3ff":0,"1f93d-1f3fb-200d-2640":0,"1f93d-1f3fc-200d-2640":0,"1f93d-1f3fd-200d-2640":0,"1f93d-1f3fe-200d-2640":0,"1f93d-1f3ff-200d-2640":0,"1f93d-1f3fb-200d-2642":0,"1f93d-1f3fc-200d-2642":0,"1f93d-1f3fd-200d-2642":0,"1f93d-1f3fe-200d-2642":0,"1f93d-1f3ff-200d-2642":0,"1f93d-1f3fb":0,"1f93d-1f3fc":0,"1f93d-1f3fd":0,"1f93d-1f3fe":0,"1f93d-1f3ff":0,"1f93e-1f3fb-200d-2640":0,"1f93e-1f3fc-200d-2640":0,"1f93e-1f3fd-200d-2640":0,"1f93e-1f3fe-200d-2640":0,"1f93e-1f3ff-200d-2640":0,"1f93e-1f3fb-200d-2642":0,"1f93e-1f3fc-200d-2642":0,"1f93e-1f3fd-200d-2642":0,"1f93e-1f3fe-200d-2642":0,"1f93e-1f3ff-200d-2642":0,"1f93e-1f3fb":0,"1f93e-1f3fc":0,"1f93e-1f3fd":0,"1f93e-1f3fe":0,"1f93e-1f3ff":0,"1f977-1f3fb":0,"1f977-1f3fc":0,"1f977-1f3fd":0,"1f977-1f3fe":0,"1f977-1f3ff":0,"1f9b5-1f3fb":0,"1f9b5-1f3fc":0,"1f9b5-1f3fd":0,"1f9b5-1f3fe":0,"1f9b5-1f3ff":0,"1f9b6-1f3fb":0,"1f9b6-1f3fc":0,"1f9b6-1f3fd":0,"1f9b6-1f3fe":0,"1f9b6-1f3ff":0,"1f9b8-1f3fb-200d-2640":0,"1f9b8-1f3fc-200d-2640":0,"1f9b8-1f3fd-200d-2640":0,"1f9b8-1f3fe-200d-2640":0,"1f9b8-1f3ff-200d-2640":0,"1f9b8-1f3fb-200d-2642":0,"1f9b8-1f3fc-200d-2642":0,"1f9b8-1f3fd-200d-2642":0,"1f9b8-1f3fe-200d-2642":0,"1f9b8-1f3ff-200d-2642":0,"1f9b8-1f3fb":0,"1f9b8-1f3fc":0,"1f9b8-1f3fd":0,"1f9b8-1f3fe":0,"1f9b8-1f3ff":0,"1f9b9-1f3fb-200d-2640":0,"1f9b9-1f3fc-200d-2640":0,"1f9b9-1f3fd-200d-2640":0,"1f9b9-1f3fe-200d-2640":0,"1f9b9-1f3ff-200d-2640":0,"1f9b9-1f3fb-200d-2642":0,"1f9b9-1f3fc-200d-2642":0,"1f9b9-1f3fd-200d-2642":0,"1f9b9-1f3fe-200d-2642":0,"1f9b9-1f3ff-200d-2642":0,"1f9b9-1f3fb":0,"1f9b9-1f3fc":0,"1f9b9-1f3fd":0,"1f9b9-1f3fe":0,"1f9b9-1f3ff":0,"1f9bb-1f3fb":0,"1f9bb-1f3fc":0,"1f9bb-1f3fd":0,"1f9bb-1f3fe":0,"1f9bb-1f3ff":0,"1f9cd-1f3fb-200d-2640":0,"1f9cd-1f3fc-200d-2640":0,"1f9cd-1f3fd-200d-2640":0,"1f9cd-1f3fe-200d-2640":0,"1f9cd-1f3ff-200d-2640":0,"1f9cd-1f3fb-200d-2642":0,"1f9cd-1f3fc-200d-2642":0,"1f9cd-1f3fd-200d-2642":0,"1f9cd-1f3fe-200d-2642":0,"1f9cd-1f3ff-200d-2642":0,"1f9cd-1f3fb":0,"1f9cd-1f3fc":0,"1f9cd-1f3fd":0,"1f9cd-1f3fe":0,"1f9cd-1f3ff":0,"1f9ce-1f3fb-200d-2640":0,"1f9ce-1f3fc-200d-2640":0,"1f9ce-1f3fd-200d-2640":0,"1f9ce-1f3fe-200d-2640":0,"1f9ce-1f3ff-200d-2640":0,"1f9ce-1f3fb-200d-2642":0,"1f9ce-1f3fc-200d-2642":0,"1f9ce-1f3fd-200d-2642":0,"1f9ce-1f3fe-200d-2642":0,"1f9ce-1f3ff-200d-2642":0,"1f9ce-1f3fb":0,"1f9ce-1f3fc":0,"1f9ce-1f3fd":0,"1f9ce-1f3fe":0,"1f9ce-1f3ff":0,"1f9cf-1f3fb-200d-2640":0,"1f9cf-1f3fc-200d-2640":0,"1f9cf-1f3fd-200d-2640":0,"1f9cf-1f3fe-200d-2640":0,"1f9cf-1f3ff-200d-2640":0,"1f9cf-1f3fb-200d-2642":0,"1f9cf-1f3fc-200d-2642":0,"1f9cf-1f3fd-200d-2642":0,"1f9cf-1f3fe-200d-2642":0,"1f9cf-1f3ff-200d-2642":0,"1f9cf-1f3fb":0,"1f9cf-1f3fc":0,"1f9cf-1f3fd":0,"1f9cf-1f3fe":0,"1f9cf-1f3ff":0,"1f9d1-1f3fb-200d-1f33e":0,"1f9d1-1f3fc-200d-1f33e":0,"1f9d1-1f3fd-200d-1f33e":0,"1f9d1-1f3fe-200d-1f33e":0,"1f9d1-1f3ff-200d-1f33e":0,"1f9d1-1f3fb-200d-1f373":0,"1f9d1-1f3fc-200d-1f373":0,"1f9d1-1f3fd-200d-1f373":0,"1f9d1-1f3fe-200d-1f373":0,"1f9d1-1f3ff-200d-1f373":0,"1f9d1-1f3fb-200d-1f37c":0,"1f9d1-1f3fc-200d-1f37c":0,"1f9d1-1f3fd-200d-1f37c":0,"1f9d1-1f3fe-200d-1f37c":0,"1f9d1-1f3ff-200d-1f37c":0,"1f9d1-1f3fb-200d-1f384":0,"1f9d1-1f3fc-200d-1f384":0,"1f9d1-1f3fd-200d-1f384":0,"1f9d1-1f3fe-200d-1f384":0,"1f9d1-1f3ff-200d-1f384":0,"1f9d1-1f3fb-200d-1f393":0,"1f9d1-1f3fc-200d-1f393":0,"1f9d1-1f3fd-200d-1f393":0,"1f9d1-1f3fe-200d-1f393":0,"1f9d1-1f3ff-200d-1f393":0,"1f9d1-1f3fb-200d-1f3a4":0,"1f9d1-1f3fc-200d-1f3a4":0,"1f9d1-1f3fd-200d-1f3a4":0,"1f9d1-1f3fe-200d-1f3a4":0,"1f9d1-1f3ff-200d-1f3a4":0,"1f9d1-1f3fb-200d-1f3a8":0,"1f9d1-1f3fc-200d-1f3a8":0,"1f9d1-1f3fd-200d-1f3a8":0,"1f9d1-1f3fe-200d-1f3a8":0,"1f9d1-1f3ff-200d-1f3a8":0,"1f9d1-1f3fb-200d-1f3eb":0,"1f9d1-1f3fc-200d-1f3eb":0,"1f9d1-1f3fd-200d-1f3eb":0,"1f9d1-1f3fe-200d-1f3eb":0,"1f9d1-1f3ff-200d-1f3eb":0,"1f9d1-1f3fb-200d-1f3ed":0,"1f9d1-1f3fc-200d-1f3ed":0,"1f9d1-1f3fd-200d-1f3ed":0,"1f9d1-1f3fe-200d-1f3ed":0,"1f9d1-1f3ff-200d-1f3ed":0,"1f9d1-1f3fb-200d-1f4bb":0,"1f9d1-1f3fc-200d-1f4bb":0,"1f9d1-1f3fd-200d-1f4bb":0,"1f9d1-1f3fe-200d-1f4bb":0,"1f9d1-1f3ff-200d-1f4bb":0,"1f9d1-1f3fb-200d-1f4bc":0,"1f9d1-1f3fc-200d-1f4bc":0,"1f9d1-1f3fd-200d-1f4bc":0,"1f9d1-1f3fe-200d-1f4bc":0,"1f9d1-1f3ff-200d-1f4bc":0,"1f9d1-1f3fb-200d-1f527":0,"1f9d1-1f3fc-200d-1f527":0,"1f9d1-1f3fd-200d-1f527":0,"1f9d1-1f3fe-200d-1f527":0,"1f9d1-1f3ff-200d-1f527":0,"1f9d1-1f3fb-200d-1f52c":0,"1f9d1-1f3fc-200d-1f52c":0,"1f9d1-1f3fd-200d-1f52c":0,"1f9d1-1f3fe-200d-1f52c":0,"1f9d1-1f3ff-200d-1f52c":0,"1f9d1-1f3fb-200d-1f680":0,"1f9d1-1f3fc-200d-1f680":0,"1f9d1-1f3fd-200d-1f680":0,"1f9d1-1f3fe-200d-1f680":0,"1f9d1-1f3ff-200d-1f680":0,"1f9d1-1f3fb-200d-1f692":0,"1f9d1-1f3fc-200d-1f692":0,"1f9d1-1f3fd-200d-1f692":0,"1f9d1-1f3fe-200d-1f692":0,"1f9d1-1f3ff-200d-1f692":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fb-200d-1f9af":0,"1f9d1-1f3fc-200d-1f9af":0,"1f9d1-1f3fd-200d-1f9af":0,"1f9d1-1f3fe-200d-1f9af":0,"1f9d1-1f3ff-200d-1f9af":0,"1f9d1-1f3fb-200d-1f9b0":0,"1f9d1-1f3fc-200d-1f9b0":0,"1f9d1-1f3fd-200d-1f9b0":0,"1f9d1-1f3fe-200d-1f9b0":0,"1f9d1-1f3ff-200d-1f9b0":0,"1f9d1-1f3fb-200d-1f9b1":0,"1f9d1-1f3fc-200d-1f9b1":0,"1f9d1-1f3fd-200d-1f9b1":0,"1f9d1-1f3fe-200d-1f9b1":0,"1f9d1-1f3ff-200d-1f9b1":0,"1f9d1-1f3fb-200d-1f9b2":0,"1f9d1-1f3fc-200d-1f9b2":0,"1f9d1-1f3fd-200d-1f9b2":0,"1f9d1-1f3fe-200d-1f9b2":0,"1f9d1-1f3ff-200d-1f9b2":0,"1f9d1-1f3fb-200d-1f9b3":0,"1f9d1-1f3fc-200d-1f9b3":0,"1f9d1-1f3fd-200d-1f9b3":0,"1f9d1-1f3fe-200d-1f9b3":0,"1f9d1-1f3ff-200d-1f9b3":0,"1f9d1-1f3fb-200d-1f9bc":0,"1f9d1-1f3fc-200d-1f9bc":0,"1f9d1-1f3fd-200d-1f9bc":0,"1f9d1-1f3fe-200d-1f9bc":0,"1f9d1-1f3ff-200d-1f9bc":0,"1f9d1-1f3fb-200d-1f9bd":0,"1f9d1-1f3fc-200d-1f9bd":0,"1f9d1-1f3fd-200d-1f9bd":0,"1f9d1-1f3fe-200d-1f9bd":0,"1f9d1-1f3ff-200d-1f9bd":0,"1f9d1-1f3fb-200d-2695":0,"1f9d1-1f3fc-200d-2695":0,"1f9d1-1f3fd-200d-2695":0,"1f9d1-1f3fe-200d-2695":0,"1f9d1-1f3ff-200d-2695":0,"1f9d1-1f3fb-200d-2696":0,"1f9d1-1f3fc-200d-2696":0,"1f9d1-1f3fd-200d-2696":0,"1f9d1-1f3fe-200d-2696":0,"1f9d1-1f3ff-200d-2696":0,"1f9d1-1f3fb-200d-2708":0,"1f9d1-1f3fc-200d-2708":0,"1f9d1-1f3fd-200d-2708":0,"1f9d1-1f3fe-200d-2708":0,"1f9d1-1f3ff-200d-2708":0,"1f9d1-1f3fb":0,"1f9d1-1f3fc":0,"1f9d1-1f3fd":0,"1f9d1-1f3fe":0,"1f9d1-1f3ff":0,"1f9d2-1f3fb":0,"1f9d2-1f3fc":0,"1f9d2-1f3fd":0,"1f9d2-1f3fe":0,"1f9d2-1f3ff":0,"1f9d3-1f3fb":0,"1f9d3-1f3fc":0,"1f9d3-1f3fd":0,"1f9d3-1f3fe":0,"1f9d3-1f3ff":0,"1f9d4-1f3fb-200d-2640":0,"1f9d4-1f3fc-200d-2640":0,"1f9d4-1f3fd-200d-2640":0,"1f9d4-1f3fe-200d-2640":0,"1f9d4-1f3ff-200d-2640":0,"1f9d4-1f3fb-200d-2642":0,"1f9d4-1f3fc-200d-2642":0,"1f9d4-1f3fd-200d-2642":0,"1f9d4-1f3fe-200d-2642":0,"1f9d4-1f3ff-200d-2642":0,"1f9d4-1f3fb":0,"1f9d4-1f3fc":0,"1f9d4-1f3fd":0,"1f9d4-1f3fe":0,"1f9d4-1f3ff":0,"1f9d5-1f3fb":0,"1f9d5-1f3fc":0,"1f9d5-1f3fd":0,"1f9d5-1f3fe":0,"1f9d5-1f3ff":0,"1f9d6-1f3fb-200d-2640":0,"1f9d6-1f3fc-200d-2640":0,"1f9d6-1f3fd-200d-2640":0,"1f9d6-1f3fe-200d-2640":0,"1f9d6-1f3ff-200d-2640":0,"1f9d6-1f3fb-200d-2642":0,"1f9d6-1f3fc-200d-2642":0,"1f9d6-1f3fd-200d-2642":0,"1f9d6-1f3fe-200d-2642":0,"1f9d6-1f3ff-200d-2642":0,"1f9d6-1f3fb":0,"1f9d6-1f3fc":0,"1f9d6-1f3fd":0,"1f9d6-1f3fe":0,"1f9d6-1f3ff":0,"1f9d7-1f3fb-200d-2640":0,"1f9d7-1f3fc-200d-2640":0,"1f9d7-1f3fd-200d-2640":0,"1f9d7-1f3fe-200d-2640":0,"1f9d7-1f3ff-200d-2640":0,"1f9d7-1f3fb-200d-2642":0,"1f9d7-1f3fc-200d-2642":0,"1f9d7-1f3fd-200d-2642":0,"1f9d7-1f3fe-200d-2642":0,"1f9d7-1f3ff-200d-2642":0,"1f9d7-1f3fb":0,"1f9d7-1f3fc":0,"1f9d7-1f3fd":0,"1f9d7-1f3fe":0,"1f9d7-1f3ff":0,"1f9d8-1f3fb-200d-2640":0,"1f9d8-1f3fc-200d-2640":0,"1f9d8-1f3fd-200d-2640":0,"1f9d8-1f3fe-200d-2640":0,"1f9d8-1f3ff-200d-2640":0,"1f9d8-1f3fb-200d-2642":0,"1f9d8-1f3fc-200d-2642":0,"1f9d8-1f3fd-200d-2642":0,"1f9d8-1f3fe-200d-2642":0,"1f9d8-1f3ff-200d-2642":0,"1f9d8-1f3fb":0,"1f9d8-1f3fc":0,"1f9d8-1f3fd":0,"1f9d8-1f3fe":0,"1f9d8-1f3ff":0,"1f9d9-1f3fb-200d-2640":0,"1f9d9-1f3fc-200d-2640":0,"1f9d9-1f3fd-200d-2640":0,"1f9d9-1f3fe-200d-2640":0,"1f9d9-1f3ff-200d-2640":0,"1f9d9-1f3fb-200d-2642":0,"1f9d9-1f3fc-200d-2642":0,"1f9d9-1f3fd-200d-2642":0,"1f9d9-1f3fe-200d-2642":0,"1f9d9-1f3ff-200d-2642":0,"1f9d9-1f3fb":0,"1f9d9-1f3fc":0,"1f9d9-1f3fd":0,"1f9d9-1f3fe":0,"1f9d9-1f3ff":0,"1f9da-1f3fb-200d-2640":0,"1f9da-1f3fc-200d-2640":0,"1f9da-1f3fd-200d-2640":0,"1f9da-1f3fe-200d-2640":0,"1f9da-1f3ff-200d-2640":0,"1f9da-1f3fb-200d-2642":0,"1f9da-1f3fc-200d-2642":0,"1f9da-1f3fd-200d-2642":0,"1f9da-1f3fe-200d-2642":0,"1f9da-1f3ff-200d-2642":0,"1f9da-1f3fb":0,"1f9da-1f3fc":0,"1f9da-1f3fd":0,"1f9da-1f3fe":0,"1f9da-1f3ff":0,"1f9db-1f3fb-200d-2640":0,"1f9db-1f3fc-200d-2640":0,"1f9db-1f3fd-200d-2640":0,"1f9db-1f3fe-200d-2640":0,"1f9db-1f3ff-200d-2640":0,"1f9db-1f3fb-200d-2642":0,"1f9db-1f3fc-200d-2642":0,"1f9db-1f3fd-200d-2642":0,"1f9db-1f3fe-200d-2642":0,"1f9db-1f3ff-200d-2642":0,"1f9db-1f3fb":0,"1f9db-1f3fc":0,"1f9db-1f3fd":0,"1f9db-1f3fe":0,"1f9db-1f3ff":0,"1f9dc-1f3fb-200d-2640":0,"1f9dc-1f3fc-200d-2640":0,"1f9dc-1f3fd-200d-2640":0,"1f9dc-1f3fe-200d-2640":0,"1f9dc-1f3ff-200d-2640":0,"1f9dc-1f3fb-200d-2642":0,"1f9dc-1f3fc-200d-2642":0,"1f9dc-1f3fd-200d-2642":0,"1f9dc-1f3fe-200d-2642":0,"1f9dc-1f3ff-200d-2642":0,"1f9dc-1f3fb":0,"1f9dc-1f3fc":0,"1f9dc-1f3fd":0,"1f9dc-1f3fe":0,"1f9dc-1f3ff":0,"1f9dd-1f3fb-200d-2640":0,"1f9dd-1f3fc-200d-2640":0,"1f9dd-1f3fd-200d-2640":0,"1f9dd-1f3fe-200d-2640":0,"1f9dd-1f3ff-200d-2640":0,"1f9dd-1f3fb-200d-2642":0,"1f9dd-1f3fc-200d-2642":0,"1f9dd-1f3fd-200d-2642":0,"1f9dd-1f3fe-200d-2642":0,"1f9dd-1f3ff-200d-2642":0,"1f9dd-1f3fb":0,"1f9dd-1f3fc":0,"1f9dd-1f3fd":0,"1f9dd-1f3fe":0,"1f9dd-1f3ff":0,"261d-1f3fb":0,"261d-1f3fc":0,"261d-1f3fd":0,"261d-1f3fe":0,"261d-1f3ff":0,"26f9-1f3fb-200d-2640":0,"26f9-1f3fc-200d-2640":0,"26f9-1f3fd-200d-2640":0,"26f9-1f3fe-200d-2640":0,"26f9-1f3ff-200d-2640":0,"26f9-1f3fb-200d-2642":0,"26f9-1f3fc-200d-2642":0,"26f9-1f3fd-200d-2642":0,"26f9-1f3fe-200d-2642":0,"26f9-1f3ff-200d-2642":0,"26f9-1f3fb":0,"26f9-1f3fc":0,"26f9-1f3fd":0,"26f9-1f3fe":0,"26f9-1f3ff":0,"270a-1f3fb":0,"270a-1f3fc":0,"270a-1f3fd":0,"270a-1f3fe":0,"270a-1f3ff":0,"270b-1f3fb":0,"270b-1f3fc":0,"270b-1f3fd":0,"270b-1f3fe":0,"270b-1f3ff":0,"270c-1f3fb":0,"270c-1f3fc":0,"270c-1f3fd":0,"270c-1f3fe":0,"270c-1f3ff":0,"270d-1f3fb":0,"270d-1f3fc":0,"270d-1f3fd":0,"270d-1f3fe":0,"270d-1f3ff":0}},n=s[""];for(const e in s)e&&Object.assign(n,s[e]);const a=n},3189:(e,t,i)=>{"use strict";i.d(t,{Bf:()=>n,U9:()=>a,bt:()=>s});const s='Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif',n="16px",a="400"},356:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});const s="undefined"!=typeof ImageBitmap},5296:(e,t,i)=>{"use strict";i.d(t,{Kx:()=>r,cK:()=>d,jt:()=>l});var s=i(3035),n=i(3725);const a=new Map;function o(e){return a.get(e)}function r(e){const t=o(e);t&&(t.isCancelled=!0,t.deferred.resolve())}function d(e,t,i){return i||(i=function(e){r(e);const t={isCancelled:!1,deferred:(0,n.Z)()};return a.set(e,t),t.deferred.then((()=>{o(e)===t&&a.delete(e)})),t}(t)),(0,s.T2)((()=>{i.isCancelled||(e()?d(e,t,i):i.deferred.resolve())})),i.deferred}function l(e){(0,s.T2)((()=>{e()&&l(e)}))}},1470:(e,t,i)=>{"use strict";function s(e,t){return e.reduce(((e,t)=>e+t),t)}i.d(t,{Z:()=>s})},2353:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function n(e,t){return s(this,void 0,void 0,(function*(){const i=e.map(((e,i,n)=>s(this,void 0,void 0,(function*(){if(yield t(e,i,n))return e}))));return(yield Promise.all(i)).filter(Boolean)}))}},8847:(e,t,i)=>{"use strict";function s(e,t){const i=[];let s=-1;for(;-1!==(s=e.findIndex(t));)i.push(e.splice(s,1)[0]);return i}i.d(t,{Z:()=>s})},54:(e,t,i)=>{"use strict";function s(e,t){const i=[],s=[];for(let n=0,a=e.length;ns})},5916:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});class s{constructor(e){this.assets=e,this.tempId=0}playSound(e,t=!1){++this.tempId,this.assetName=e;try{const i=this.createAudio();i.autoplay=!0,i.src="assets/audio/"+e,i.loop=t,i.play()}catch(t){console.error("playSound",e,t)}}playSoundIfDifferent(e,t){this.assetName!==e&&this.playSound(e,t)}createAudio(){let{audio:e}=this;return e||(e=this.audio=new Audio,e.play(),e)}stopSound(){this.audio&&this.audio.pause()}cancelDelayedPlay(){++this.tempId}playSoundWithTimeout(e,t,i){const s=++this.tempId;setTimeout((()=>{this.tempId===s&&this.playSound(e,t)}),i)}}},8678:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(3019);function n(e){return(0,s.Z)(e,"readAsDataURL")}},6705:(e,t,i)=>{"use strict";i.d(t,{Z:()=>m});var s=i(3725),n=i(8594),a=i(3035);const o=[];let r=!1;function d(e,t="push"){if(!e.items.length)return Promise.resolve([]);const i=e.promise=(0,s.Z)();return o[t](e),l(),i}function l(){r||function(e){if(!e.items.length)return e.promise.resolve([]),Promise.resolve([]);const t=e.items.slice(),i=[];return new Promise(((s,o)=>{const r=()=>{return d=this,l=void 0,h=function*(){const d=performance.now();do{yield(0,n.e9)();const s=e.process.apply(e.context,t.shift());let a;if(s instanceof Promise)try{a=yield s}catch(e){return void o(e)}else a=s;i.push(a)}while(t.length>0&&performance.now()-d<6);t.length>0?(0,a.T2)(r):s(i)},new((c=void 0)||(c=Promise))((function(e,t){function i(e){try{n(h.next(e))}catch(e){t(e)}}function s(e){try{n(h.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof c?n:new c((function(e){e(n)}))).then(i,s)}n((h=h.apply(d,l||[])).next())}));var d,l,c,h};(0,a.T2)(r)})).then(e.promise.resolve,e.promise.reject)}(o.shift()).finally((()=>{r=!1,o.length&&l()}))}var c=i(6663);let h,u;function p(e,t,i,s=document.createElement("canvas")){s.width=e.width,s.height=e.height;const n=s.getContext("2d",{alpha:!1});return c.Z?(n.filter=`blur(${t}px)`,n.drawImage(e,2*-t,2*-t,s.width+4*t,s.height+4*t)):(n.drawImage(e,0,0),u(n,0,0,s.width,s.height,t,i)),s}h=c.Z?Promise.resolve():i.e(77).then(i.bind(i,7077)).then((e=>{u=e.default}));const f=new Map;function m(e,t=2,i=2){if(!e)throw"no dataUri for blur: "+e;f.size>150&&f.clear();const s=document.createElement("canvas");s.className="canvas-thumbnail";let n=f.get(e);if(n)s.width=n.canvas.width,s.height=n.canvas.height,n.promise.then((()=>{s.getContext("2d").drawImage(n.canvas,0,0,s.width,s.height)}));else{const a=new Promise((n=>{h.then((()=>{const a=new Image;a.onload=()=>{d({items:[[a,t,i,s]],context:null,process:p},"unshift").then((()=>{n()}))},a.src=e}))}));f.set(e,n={canvas:s,promise:a})}return Object.assign(Object.assign({},n),{canvas:s})}},4059:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l,o:()=>d});var s=i(4762),n=i(3306),a=i(9818);const o=(0,n.Z)("ffd8ffe000104a46494600010100000100010000ffdb004300281c1e231e19282321232d2b28303c64413c37373c7b585d4964918099968f808c8aa0b4e6c3a0aadaad8a8cc8ffcbdaeef5ffffff9bc1fffffffaffe6fdfff8ffdb0043012b2d2d3c353c76414176f8a58ca5f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8ffc00011080000000003012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00"),r=(0,n.Z)("ffd9");function d(e){const t="base64,",i=e.slice(e.indexOf(t)+t.length),s=[...atob(i)].map((e=>e.charCodeAt(0)));return new Uint8Array(s)}function l(e,t=!1){let i,n;t||1!==e[0]?i=(0,a.Z)(e):(i=new Uint8Array(o.concat(Array.from(e.slice(3)),r)),i[164]=e[1],i[166]=e[2]),n=t?s.IS_SAFARI?"image/png":"image/webp":"image/jpeg";const d=function(e,t="image/jpeg"){return`data:${t};base64,${btoa(String.fromCharCode(...e))}`}(i,n);return d}},9897:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(410),n=i(9405);function a(e,t,i,s,a=!0){if(ei/s?r=t*i/e|0:(o=e*s/t|0,o>i&&(r=r*i/o|0,o=i)),a&&o>=e&&r>=t&&(o=e,r=t),(0,n.C)(o,r)}s.GO.calcImageInBox=a},2890:(e,t,i)=>{"use strict";function s(e,t,i,s,n,a){const o=e.canvas.dpr;o&&(t*=o,i*=o,s*=o),e.beginPath(),e.arc(t,i,s,0,2*Math.PI,!1),e.closePath(),n&&e.fill(),a&&e.stroke()}function n(e,t,i,n,a,o){return s(e,t+n,i+n,n,a,o)}i.d(t,{Z:()=>s,o:()=>n})},8097:(e,t,i)=>{"use strict";let s;function n(e,t){if(!s){const e=document.createElement("canvas");s=e.getContext("2d",{alpha:!1})}return s.font!==t&&(s.font=t),s.measureText(e).width}i.d(t,{Z:()=>n})},7814:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(356);function n(e){return new Promise((t=>{return i=this,n=void 0,o=function*(){var i,n,a;const o=document.createElement("canvas"),r=null!==(i=e.size)&&void 0!==i?i:e.mediaSize.aspectFitted(e.boxSize),d=window.devicePixelRatio&&1;o.width=r.width*d,o.height=r.height*d;const l=o.getContext("2d");let c;c=s.Z?yield createImageBitmap(e.media,{resizeWidth:r.width,resizeHeight:r.height}):e.media,l.drawImage(c,0,0,o.width,o.height),s.Z&&(null==c||c.close());const h=null!==(n=e.mimeType)&&void 0!==n?n:"image/jpeg",u=null!==(a=e.quality)&&void 0!==a?a:1;if(e.toDataURL){const e=o.toDataURL(h,u);t({url:e,size:r})}else o.toBlob((e=>{t({blob:e,size:r})}),h,u)},new((a=void 0)||(a=Promise))((function(e,t){function s(e){try{d(o.next(e))}catch(e){t(e)}}function r(e){try{d(o.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(s,r)}d((o=o.apply(i,n||[])).next())}));var i,n,a,o}))}},467:(e,t,i)=>{"use strict";i.d(t,{ST:()=>r,ZP:()=>d,gV:()=>l});var s=i(5813);const n=/[`~!@#$%^&*()\-_=+\[\]\\|{}'";:\/?.>,<]+/g,a=/^\s+|\s$/g,o={й:"q",ц:"w",у:"e",к:"r",е:"t",н:"y",г:"u",ш:"i",щ:"o",з:"p",х:"[",ъ:"]",ф:"a",ы:"s",в:"d",а:"f",п:"g",р:"h",о:"j",л:"k",д:"l",ж:";",э:"'",я:"z",ч:"x",с:"c",м:"v",и:"b",т:"n",ь:"m",б:",",ю:".",".":"/"};function r(e){return e.replace(n,"").replace(a,"")}function d(e,t=!0){return l(e,{clearBadChars:!0,latinize:t,ignoreCase:!0})}function l(e,t={}){const i=t.includeTag&&"%"===e.charAt(0),n=e;return t.clearBadChars&&(e=r(e)),t.latinize&&(e=function(e){return e.replace(/[^A-Za-z0-9]/g,(e=>{const t=s.Z[e];return null!=t?t:e}))}(e)),t.ignoreCase&&(e=e.toLowerCase()),i&&(e="%"+e),t.latinize&&(e+=""+function(e){return e.toLowerCase().replace(/[\wа-я]/g,(e=>{const t=o[e];return null!=t?t:e}))}(n)),e}},2166:(e,t,i)=>{"use strict";function s(e){var t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}catch(e){}document.body.removeChild(t)}function n(e){navigator.clipboard?navigator.clipboard.writeText(e).catch((t=>{console.error("clipboard error",t),s(e)})):s(e)}i.d(t,{T:()=>n})},3416:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(5432),n=i(4755),a=i(2296);class o extends a.Z{constructor(){super("menu",!0),this.onMouseMove=e=>{const t=this.element.getBoundingClientRect(),{clientX:i,clientY:s}=e,n=i>=t.right?i-t.right:t.left-i,a=s>=t.bottom?s-t.bottom:t.top-s;(n>=100||a>=100)&&this.close()},n.Z.addEventListener("resize",(()=>{this.element&&this.close()}))}isOpened(){return!!this.element}close(){this.element&&(this.element.classList.remove("active"),this.element.parentElement.classList.remove("menu-open")),super.close(),s.Z||window.removeEventListener("mousemove",this.onMouseMove)}openBtnMenu(e,t){super.open(e),this.element.classList.add("active","was-open"),this.element.parentElement.classList.add("menu-open"),t&&this.addEventListener("toggle",t,{once:!0}),s.Z||window.addEventListener("mousemove",this.onMouseMove)}}const r=new o},632:(e,t,i)=>{"use strict";i.d(t,{OD:()=>h,fl:()=>S,mr:()=>u,rz:()=>c,s2:()=>r,xE:()=>p,zM:()=>l});var s=i(410),n=i(2325);const a=["January","February","March","April","May","June","July","August","September","October","November","December"],o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r=86400,d=e=>{const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),i=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-i);const s=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-s.getTime())/r+1)/7)};function l(e){const t=new Date,i=t.getTime()/1e3|0,s=e.getTime()/1e3|0,a={};return i-s{const i=t.monthAsNumber?".":" ",s=("0"+e.getHours()).slice(-2)+":"+("0"+e.getMinutes()).slice(-2)+(t.noSeconds?"":":"+("0"+e.getSeconds()).slice(-2));return(t.leadingZero?("0"+e.getDate()).slice(-2):e.getDate())+i+(t.monthAsNumber?("0"+(e.getMonth()+1)).slice(-2):a[e.getMonth()])+i+e.getFullYear()+(t.noTime?"":", "+s)},f=2013,m=new RegExp("20[0-9]{1,2}"),g=new RegExp("(\\w{3,}) ([0-9]{0,4})","i"),v=new RegExp("([0-9]{0,4}) (\\w{2,})","i"),b=new RegExp("^([0-9]{1,4})(\\.| |/|\\-)([0-9]{1,4})$","i"),y=new RegExp("^([0-9]{1,2})(\\.| |/|\\-)([0-9]{1,2})(\\.| |/|\\-)([0-9]{1,4})$","i"),w=[31,29,31,30,31,30,31,31,30,31,30,31];function S(e,t){const i=e.trim().toLowerCase();if(i.length<3)return;if(0==="today".indexOf(i)){const e=new Date,i=e.getFullYear(),s=e.getMonth(),n=e.getDate();e.setFullYear(i,s,n),e.setHours(0,0,0);const a=e.getTime();e.setFullYear(i,s,n+1),e.setHours(0,0,0);const o=e.getTime()-1;return void t.push({title:"Today",minDate:a,maxDate:o})}if(0==="yesterday".indexOf(i)){const e=new Date,i=e.getFullYear(),s=e.getMonth(),n=e.getDate();e.setFullYear(i,s,n),e.setHours(0,0,0);const a=e.getTime()-864e5;e.setFullYear(i,s,n+1),e.setHours(0,0,0);const o=e.getTime()-86400001;return void t.push({title:"Yesterday",minDate:a,maxDate:o})}const s=function(e){const t=new Date;if(e.length<=3)return-1;for(let i=0;i<7;i++)if(t.setDate(t.getDate()+1),0===Z(t.getTime()).toLowerCase().indexOf(e))return t.getDay();return-1}(i);if(s>=0){const e=new Date,i=e.getTime(),n=s-e.getDay();e.setDate(e.getDate()+n),e.getTime()>i&&e.setTime(e.getTime()-6048e5);const a=e.getFullYear(),o=e.getMonth(),r=e.getDate();e.setFullYear(a,o,r),e.setHours(0,0,0);const d=e.getTime();e.setFullYear(a,o,r+1),e.setHours(0,0,0);const l=e.getTime()-1;return void t.push({title:Z(d),minDate:d,maxDate:l})}let n;if(null===(n=b.exec(i)))if(null===(n=y.exec(i)))if(null===(n=m.exec(i))){if(null!==(n=g.exec(i))){const e=n[1],i=n[2],s=T(e);if(s>=0){const e=+i;if(e>0&&e<=31)return void L(t,e-1,s);if(e>=f)return void C(t,s,e)}}if(null!==(n=v.exec(i))){const e=n[1],i=T(n[2]);if(i>=0){const s=+e;if(s>0&&s<=31)return void L(t,s-1,i);s>=f&&C(t,i,s)}}}else{let e=+i;const s=(new Date).getFullYear();if(e=e;i--){const e=new Date;e.setFullYear(i,0,1),e.setHours(0,0,0);const s=e.getTime();e.setFullYear(i+1,0,1),e.setHours(0,0,0);const n=e.getTime()-1;t.push({title:""+i,minDate:s,maxDate:n})}}else if(e<=s){const i=new Date;i.setFullYear(e,0,1),i.setHours(0,0,0);const s=i.getTime();i.setFullYear(e+1,0,1),i.setHours(0,0,0);const n=i.getTime()-1;t.push({title:""+e,minDate:s,maxDate:n})}}else{const e=n[1],i=n[3],s=n[5];if(!n[2]===n[4])return;const a=parseInt(e),o=parseInt(i)-1;let r=parseInt(s);r>=10&&r<=99&&(r+=2e3);const d=(new Date).getFullYear();if(P(a-1,o)&&r>=f&&r<=d){const e=new Date;e.setFullYear(r,o,a),e.setHours(0,0,0);const i=e.getTime();e.setFullYear(r,o,a+1),e.setHours(0,0,0);const s=e.getTime()-1;return void t.push({title:M(i),minDate:i,maxDate:s})}}else{const e=n[1],i=n[3],s=parseInt(e),a=parseInt(i);if(s>0&&s<=31){if(a>=f&&s<=12)return void C(t,s-1,a);a<=12&&L(t,s-1,a-1)}else s>=f&&a<=12&&C(t,a-1,s)}}function C(e,t,i){const s=(new Date).getFullYear(),n=Date.now();if(i>=f&&i<=s){const s=new Date;s.setFullYear(i,t,1),s.setHours(0,0,0);const a=s.getTime();if(a>n)return;s.setMonth(s.getMonth()+1);const o=s.getTime()-1;e.push({title:E(a),minDate:a,maxDate:o})}}function L(e,t,i){if(P(t,i)){const n=(new Date).getFullYear(),a=Date.now();for(let o=n;o>=f;o--){if(1===i&&28===t&&((s=o)%4!=0||s%100==0)&&s%400!=0)continue;const r=new Date;r.setFullYear(o,i,t+1),r.setHours(0,0,0);const d=r.getTime();if(d>a)continue;r.setFullYear(o,i,t+2),r.setHours(0,0,0);const l=r.getTime()-1;o===n?e.push({title:I(d),minDate:d,maxDate:l}):e.push({title:M(d),minDate:d,maxDate:l})}}var s}function E(e){const t=new Date(e);return a[t.getMonth()].slice(0,3)+" "+t.getFullYear()}function I(e){const t=new Date(e);return a[t.getMonth()].slice(0,3)+" "+t.getDate()}function M(e){const t=new Date(e);return("0"+t.getDate()).slice(-2)+"."+("0"+(t.getMonth()+1)).slice(-2)+"."+t.getFullYear()}function Z(e){const t=new Date(e);return o[t.getDay()]}function P(e,t){return t>=0&&t<12&&e>=0&&e{"use strict";i.d(t,{Z:()=>d});var s=i(2796),n=i(2166),a=i(3910),o=i(2738);const r="https://t.me/";function d(e={}){const t=document.createElement("a");t.classList.add("anchor-copy");let i,d="LinkCopied";if(e.mePath){const s=r+e.mePath;i=t.href=t.innerText=s}if(e.username){const s=r+e.username;t.href=s,i=t.innerText="@"+e.username,d="UsernameCopied"}return(0,o.fc)(t,(e=>{(0,a.Z)(e),(0,n.T)(null!=i?i:t.href),(0,s.bC)({langPackKey:d})})),t}},6976:(e,t,i)=>{"use strict";i.d(t,{E:()=>c,s:()=>l});var s=i(5432),n=i(4762),a=i(3416),o=i(3910);let r=!1,d=0;function l(){d&&clearTimeout(d),d=window.setTimeout((()=>{d=0,r=!1}),400),r=!0}function c({element:e,callback:t,listenerSetter:i,listenerOptions:d}){const l=i?i.add(e):e.addEventListener.bind(e),c=i?i.removeManual.bind(i,e):e.removeEventListener.bind(e);if(n.IS_APPLE&&s.Z||d){let e;const i=Object.assign(Object.assign({},d||{}),{capture:!0}),s=()=>{clearTimeout(e),c("touchmove",s,i),c("touchend",s,i),c("touchcancel",s,i)};l("touchstart",(n=>{n.touches.length>1?s():(l("touchmove",s,i),l("touchend",s,i),l("touchcancel",s,i),e=window.setTimeout((()=>{r?s():(t(n),s(),a.Z.isOpened()&&l("touchend",o.Z,{once:!0}))}),400))}),d)}else l("contextmenu",s.Z?e=>{t(e),a.Z.isOpened()&&l("touchend",o.Z,{once:!0})}:t,d)}},5077:(e,t,i)=>{"use strict";function s(e,t,i,s){const n=e=>{i({x:e.pageX,y:e.pageY,event:e})},a=t=>{document.removeEventListener("mousemove",n),e.addEventListener("mousedown",o,{once:!0}),null==s||s({x:t.pageX,y:t.pageY,event:t})},o=i=>{0===i.button?(t({x:i.pageX,y:i.pageY,event:i}),n(i),document.addEventListener("mousemove",n),document.addEventListener("mouseup",a,{once:!0})):e.addEventListener("mousedown",o,{once:!0})};e.addEventListener("mousedown",o,{once:!0});const r=e=>{e.preventDefault(),i({x:e.touches[0].clientX,y:e.touches[0].clientY,isTouch:!0,event:e})},d=t=>{document.removeEventListener("touchmove",r),e.addEventListener("touchstart",l,{passive:!1,once:!0});const i=t.touches[0]||t.changedTouches[0];null==s||s({x:i.clientX,y:i.clientY,isTouch:!0,event:t})},l=e=>{t({x:e.touches[0].clientX,y:e.touches[0].clientY,isTouch:!0,event:e}),r(e),document.addEventListener("touchmove",r,{passive:!1}),document.addEventListener("touchend",d,{passive:!1,once:!0})};return e.addEventListener("touchstart",l,{passive:!1,once:!0}),()=>{e.removeEventListener("mousedown",o),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",a),e.removeEventListener("touchstart",l),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",d)}}i.d(t,{Z:()=>s})},6760:(e,t,i)=>{"use strict";function s(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()}i.d(t,{Z:()=>s})},2738:(e,t,i)=>{"use strict";i.d(t,{Cf:()=>o,fc:()=>d,pf:()=>r,tH:()=>l});var s=i(5432),n=i(6669);let a;function o(e){if(e.isTrusted&&"click"===e.type&&e.target!==a)return!0}document.addEventListener("mousedown",(e=>{a=e.target}));const r=s.Z?"mousedown":"click";function d(e,t,i={}){const s=i.listenerSetter?i.listenerSetter.add(e):e.addEventListener.bind(e),n=i.listenerSetter?i.listenerSetter.removeManual.bind(i.listenerSetter,e):e.removeEventListener.bind(e);if(i.touchMouseDown=!0,"click"===r){const e=t;t=t=>{o(t)||e(t)}}return s(r,t,i),()=>n(r,t,i)}function l(e){(0,n.Z)(e,r)}},7529:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(5432),n=i(3241),a=i(5953),o=i(8497);class r extends n.Z{constructor(){super(!1),this.hideControls=(e=!1)=>{if(e)return void(this.hideControlsTimeout||(this.hideControlsTimeout=window.setTimeout(this.hideControls,3e3)));clearTimeout(this.hideControlsTimeout),this.hideControlsTimeout=0;const t=this.element.classList.contains("show-controls");if(!1!==this.controlsLocked){if(this.canHideControls&&!this.canHideControls()||!t||this.controlsLocked)return}else if(!t)return;this.dispatchEvent("toggleControls",!1),this.element.classList.remove("show-controls")},this.showControls=(e=!0)=>{this.hideControlsTimeout?(clearTimeout(this.hideControlsTimeout),this.hideControlsTimeout=0):this.element.classList.contains("show-controls")||!1===this.controlsLocked||(this.dispatchEvent("toggleControls",!0),this.element.classList.add("show-controls")),e&&!this.controlsLocked&&(this.hideControlsTimeout=window.setTimeout(this.hideControls,3e3))},this.toggleControls=e=>{const t=this.element.classList.contains("show-controls");if(void 0===e)t?this.hideControls():this.showControls();else{if(e===t)return;!1===e?this.hideControls():this.showControls()}},this.hideControlsTimeout=0}setup(e){(0,a.Z)(this,e);const{listenerSetter:t,element:i}=this;s.Z?t.add(i)("click",(e=>{this.ignoreClickClassName&&(0,o.Z)(e.target,this.ignoreClickClassName)||this.toggleControls()})):(t.add(i)("mousemove",(()=>{this.showControls()})),t.add(i)("mouseenter",(()=>{this.showControls(!1)})),t.add(i)("mouseleave",(e=>{e.relatedTarget&&this.showOnLeaveToClassName&&(0,o.Z)(e.relatedTarget,this.showOnLeaveToClassName)?this.showControls(!1):this.hideControls()})))}lockControls(e){this.controlsLocked=e,this.element.classList.toggle("disable-hover",!1===e),this.toggleControls(e)}}},4531:(e,t,i)=>{"use strict";i.d(t,{Z:()=>p});var s=i(3003),n=i(2353),a=i(6654),o=i(3416),r=i(3699),d=i(3624),l=i(1483),c=i(6976),h=i(2738),u=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function p({buttons:e,findElement:t,listenTo:i,appendTo:p,filterButtons:f,onOpen:m,onClose:g,onBeforeOpen:v,listenerSetter:b,middleware:y,listenForClick:w}){null!=p||(p=document.body),null!=b||(b=new r.Z);const S=new r.Z,C=y?y.create():(0,d.k)();let L;const E=e=>{const s=t?t(e):i;if(!s)return;let n=L;if((e instanceof MouseEvent||e.hasOwnProperty("preventDefault"))&&e.preventDefault(),n&&n.classList.contains("active"))return!1;(e instanceof MouseEvent||e.hasOwnProperty("cancelBubble"))&&(e.cancelBubble=!0),(()=>{u(this,void 0,void 0,(function*(){yield null==m?void 0:m(s);const t=yield Z();if(!t)return;n=t.element;const{cleanup:i,destroy:a}=t;(0,l.Z)(e,n),o.Z.openBtnMenu(n,(()=>{null==g||g(),i(),setTimeout((()=>{a()}),300)}))}))})()};(0,c.E)({element:i,callback:E,listenerSetter:b});const I=()=>{S.removeAll(),C.clean()},M=()=>{I(),b.removeAll()},Z=()=>u(this,void 0,void 0,(function*(){I(),e.forEach((e=>e.element=void 0));const t=f||(e=>(0,n.Z)(e,(e=>!(null==e?void 0:e.verify)||(0,a.Z)(e.verify(),(e=>null!=e&&e))))),i=yield t(e);if(!i.length)return;const o=L=yield(0,s.Z)({buttons:i,listenerSetter:S});return o.classList.add("contextmenu"),yield null==v?void 0:v(),p.append(o),{element:o,cleanup:I,destroy:()=>{o.remove()}}}));return y&&y.onDestroy((()=>{M()})),w&&(0,h.fc)(i,E,{listenerSetter:b}),{element:L,destroy:M,open:E}}},3163:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var s=i(9298),n=i(6219),a=i(3512),o=i(4531),r=i(8497),d=i(3173),l=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function c(e){const{listenTo:t,isStickerPack:i,verifyRecent:c,appendTo:h,onOpen:u,onClose:p,onSend:f}=e;let m,g;const v=e=>l(this,void 0,void 0,(function*(){const t=yield a.Z.managers.acknowledged.appStickersManager.getFavedStickersStickers();if(!t.cached)return!1;const i=(yield t.result).some((e=>e.id===g.id));return e?!i:i}));return(0,o.Z)({listenTo:t,appendTo:h,findElement:e=>m=(0,r.Z)(e.target,"media-sticker-wrapper"),onOpen:()=>l(this,void 0,void 0,(function*(){return g=yield a.Z.managers.appDocsManager.getDoc(m.dataset.docId),null==u?void 0:u()})),onClose:p,buttons:[{icon:"stickers",text:"Context.ViewStickerSet",onClick:()=>new s.Z(g.stickerSetInput).show(),verify:()=>!i},{icon:"favourites",text:"AddToFavorites",onClick:()=>a.Z.managers.appStickersManager.faveSticker(g.id,!1),verify:()=>v(!0)},{icon:"favourites",text:"DeleteFromFavorites",onClick:()=>a.Z.managers.appStickersManager.faveSticker(g.id,!0),verify:()=>v(!1)},{icon:"delete",text:"DeleteFromRecent",onClick:()=>a.Z.managers.appStickersManager.saveRecentSticker(g.id,!0),verify:()=>{var e;return null!==(e=null==c?void 0:c(m))&&void 0!==e&&e}},{icon:"mute",text:"Chat.Send.WithoutSound",onClick:()=>(null==f||f(),d.Jo.sendDocId(g.id,!1,!0)),verify:()=>!(!n.ZP.chat.peerId||n.ZP.chat.peerId===a.Z.myId)},{icon:"schedule",text:"Chat.Send.ScheduledMessage",onClick:()=>n.ZP.chat.input.scheduleSending((()=>n.ZP.chat.input.sendMessageWithDocument(g))),verify:()=>!!n.ZP.chat.peerId}]})}},7660:(e,t,i)=>{"use strict";function s(e={}){const t=document.createElement("video");return e.pip||(t.disablePictureInPicture=!0),t.setAttribute("playsinline","true"),t}i.d(t,{Z:()=>s})},8222:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(410),n=i(3512),a=i(4755);const o=new class{constructor(){this.resetCache=()=>{this.computedStyle=void 0;const e=this.cache;this.cache={};for(const t in e)this.getProperty(t)},this.cache={},n.Z.addEventListener("theme_change",this.resetCache),a.Z.addEventListener("resize",this.resetCache)}getProperty(e){let t=this.cache[e];return t||(this.computedStyle||(this.computedStyle=window.getComputedStyle(document.documentElement)),t=this.computedStyle.getPropertyValue("--"+e).trim(),this.cache[e]=t)}getPropertyAsSize(e){const t=this.getProperty(e);let i;return"%"===t[t.length-1]||(i=t.indexOf("rem")?16*+t.replace("rem",""):+t.replace("px","")),i}};s.GO&&(s.GO.customProperties=o);const r=o},6669:(e,t,i)=>{"use strict";function s(e,t){const i=new Event(t,{bubbles:!0,cancelable:!0});e.dispatchEvent(i)}i.d(t,{Z:()=>s})},1544:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(4056);function n(e){return Array.from(e.childNodes).map((e=>e.nodeType===e.TEXT_NODE?(0,s.Z)(e.textContent):e.outerHTML)).join("")}},5975:(e,t,i)=>{"use strict";function s(e,t){if(!e)return null;if(e.parentElement===t)return e;for(;e.parentElement;)if((e=e.parentElement).parentElement===t)return e;return null}i.d(t,{Z:()=>s})},8763:(e,t,i)=>{"use strict";function s(e,t){return e.closest(`[${t}]`)}i.d(t,{Z:()=>s})},4668:(e,t,i)=>{"use strict";function s(e,t){return e.closest(t)}i.d(t,{Z:()=>s})},6733:(e,t,i)=>{"use strict";function s(e){e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen()}function n(){document.cancelFullScreen?document.cancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}function a(e,t,i){const s=i?i.add(e):e.addEventListener.bind(e);"webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange".split(" ").forEach((e=>{s(e,t,!1)}))}function o(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement}function r(){return!!o()}i.d(t,{C8:()=>n,Dj:()=>s,Ms:()=>a,W7:()=>o,rB:()=>r})},3299:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n,q:()=>a});var s=i(5975);function n(e,t){const i=document.getSelection(),n=i[t?"anchorNode":"focusNode"],o=i[t?"anchorOffset":"focusOffset"];return(0,s.Z)(n,e)||n===e?Object.assign(Object.assign({},a(e,n,o)),{selection:i}):{selection:i}}function a(e,t,i){if(t===e){const s=e.childNodes,n=s.length;n&&i>=n?i=((t=s[n-1]).textContent||t.alt||"").length:(t=s[i],i=0)}return{node:t,offset:i}}},9041:(e,t,i)=>{"use strict";i.d(t,{CS:()=>r,ZP:()=>c,o8:()=>n});var s=i(6854);const n={bold:{match:'[style*="bold"], [style*="font-weight: 700"], [style*="font-weight: 600"], [style*="font-weight:700"], [style*="font-weight:600"], b, strong',entityName:"messageEntityBold"},underline:{match:'[style*="underline"], u, ins',entityName:"messageEntityUnderline"},italic:{match:'[style*="italic"], i, em',entityName:"messageEntityItalic"},monospace:{match:'[style*="monospace"], [face*="monospace"], pre',entityName:"messageEntityCode"},strikethrough:{match:'[style*="line-through"], [style*="strikethrough"], strike, del, s',entityName:"messageEntityStrike"},link:{match:"A:not(.follow)",entityName:"messageEntityTextUrl"},mentionName:{match:"A.follow",entityName:"messageEntityMentionName"},spoiler:{match:'[style*="spoiler"]',entityName:"messageEntitySpoiler"}},a=new Set(["DIV","P","BR","LI","SECTION","H6","H5","H4","H3","H2","H1","TR","OL","UL"]),o=new RegExp(s.Z,"g"),r="";function d(e,t,i,s){const a=e.parentElement;for(const e in n){const o=n[e],r=a.closest(o.match+', [contenteditable="true"]');null===(null==r?void 0:r.getAttribute("contenteditable"))&&("messageEntityTextUrl"===o.entityName?i.push({_:o.entityName,url:r.href,offset:s.offset,length:t.length}):"messageEntityMentionName"===o.entityName?i.push({_:o.entityName,offset:s.offset,length:t.length,user_id:r.dataset.follow.toUserId()}):i.push({_:o.entityName,offset:s.offset,length:t.length}))}}function l(e){const{length:t}=e;return!t||e[t-1]===r&&t===r.length}function c(e,t,i,s,n,h,u={offset:0}){var p;if(e.nodeType===e.TEXT_NODE){let t=e.nodeValue;return t=t.replace(o,""),t?s===e?i.push(t.substr(0,n)+r+t.substr(n)):i.push(t):s===e&&i.push(r),h&&t.length&&e.parentNode&&d(e,t,h,u),void(u.offset+=t.length)}if(e.nodeType!==e.ELEMENT_NODE)return;const f=()=>{t.push(i.join("")),i.length=0,++u.offset},m=s===e,g=a.has(e.tagName);if(g&&(i.length||"BR"===e.tagName))f();else{const t=e.dataset.stickerEmoji||e.alt,s=e.dataset.stickerEmoji;t&&h&&d(e,t,h,u),s&&h&&h.push({_:"messageEntityCustomEmoji",document_id:e.dataset.docId,offset:u.offset,length:t.length}),t&&(i.push(t),u.offset+=t.length)}m&&!n&&i.push(r);const v=e.matches('[style*="table-cell"], th, td'),b=null==h?void 0:h.length;t.length;let y=!0,w=e.firstChild;for(;w;)c(w,t,i,s,n,h,u),w=w.nextSibling,l(i)||(y=!1);if(y&&(null===(p=e.textContent)||void 0===p?void 0:p.replace(/[\r\n]/g,""))&&(y=!1),m&&n&&i.push(r),v&&e.nextSibling&&!l(i)&&(i.push(" "),++u.offset,void 0!==b))for(let e=b,t=h.length;e{"use strict";i.d(t,{Z:()=>r});var s=i(410),n=i(6875),a=i(1346),o=i(9041);function r(e,t=!0,i=!0){const s=[],r=[],{node:d,offset:l}=!(e instanceof DocumentFragment)&&i&&function(e){const t=window.getSelection();let i,s;if(null==t?void 0:t.rangeCount){const n=t.getRangeAt(0),a=n.startOffset;if(n.startContainer&&n.startContainer==n.endContainer&&a==n.endOffset){const t=a-1,o=e.childNodes;if(n.startContainer===e&&o[t]){i=o[t],s=0;for(let e=0;e{"use strict";i.d(t,{Z:()=>n});var s=i(8204);function n({overflowElement:e,overflowRect:t,selector:i,extraSize:n,elements:a}){null!=t||(t=e.getBoundingClientRect()),null!=a||(a=Array.from(e.querySelectorAll(i))),n&&(t={top:t.top-n,right:t.right+n,bottom:t.bottom+n,left:t.left-n});const o=[],r=[],d=[];let l=!1;for(const i of a){const n=i.getBoundingClientRect(),a=(0,s.Z)(i,e,!1,n,t);let c;a?(l=!0,c=r):c=l?d:o,c.push({element:i,rect:n,visibleRect:a})}return{invisibleTop:o,visible:r,invisibleBottom:d}}},8204:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(241);function n(e,t,i,n=e.getBoundingClientRect(),a=t.getBoundingClientRect()){let{top:o,right:r,bottom:d,left:l}=a;if(i){const e=t.querySelector(".sticky");e&&(o=e.getBoundingClientRect().bottom)}if(n.top>=d||n.bottom<=o||n.right<=l||n.left>=r)return null;const c={top:!1,right:!1,bottom:!1,left:!1,vertical:0,horizontal:0},h=s.Z.width,u=s.Z.height;return{rect:{top:n.topr&&r!==h?(c.right=!0,++c.horizontal,r):n.right,bottom:n.bottom>d&&d!==u?(c.bottom=!0,++c.vertical,d):n.bottom,left:n.left{"use strict";i.d(t,{Z:()=>r});var s=i(3757),n=i(3910),a=i(8497),o=i(3444);function r(e){let t=!1;return new s.Z(Object.assign(Object.assign({},e),{verifyTouchTarget:t=>!(0,a.Z)(t.target,"progress-line")&&!(0,o.Z)(t)&&(!e.verifyTouchTarget||e.verifyTouchTarget(t)),onSwipe:(i,s,a)=>{if(i*=-1,s*=-1,!t&&Math.abs(s)>20)return!0;if(Math.abs(i)>Math.abs(s))(0,n.Z)(a),t=!0;else if(!t&&Math.abs(s)>Math.abs(i))return!0;return e.onSwipe(i,s,a)},onReset:()=>{t=!1,e.onReset&&e.onReset()},cancelEvent:!1}))}},1154:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(6976),n=i(2416);function a(e){return(0,n.Z)(Object.assign(Object.assign({},e),{onSwipe:(t,i,n)=>{if(t*=-1,i*=-1,Math.abs(t)>50)return e.onSwipe(t,i,n),(0,s.s)(),!0}}))}},7545:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(9041);function n(e,t){const i={};e.forEach((e=>i[e]=0));const n=window.getSelection();let a=-1;if(!n.isCollapsed){const t=n.getRangeAt(0),o=t.commonAncestorContainer,r=o.nodeType===o.ELEMENT_NODE?o:o.parentElement,d=document.createTreeWalker(r.closest('[contenteditable="true"]'),NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode:e=>t.intersectsNode(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let l;for(a=0;l=d.nextNode();){++a;for(const t of e){const e=s.o8[t];(l.nodeType===l.ELEMENT_NODE?l:l.parentElement).closest(e.match)&&++i[t]}}}const o={};for(const s of e)o[s]=i[s]>=(t?a:1);return o}},5705:(e,t,i)=>{"use strict";function s(e){if(e instanceof DocumentFragment)return e;const t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content}i.d(t,{Z:()=>s})},2614:(e,t,i)=>{"use strict";function s(e){const t=document.createElement("span");return"string"==typeof e?t.innerHTML=e:t.append(e),t}i.d(t,{Z:()=>s})},8487:(e,t,i)=>{"use strict";function s(e){return null==e?void 0:e.isConnected}i.d(t,{Z:()=>s})},1293:(e,t,i)=>{"use strict";function s(e){return e.isContentEditable||"INPUT"!==e.tagName?!e.textContent.trim()&&!e.querySelector(".emoji, .custom-emoji, .custom-emoji-placeholder"):!e.value.trim()}i.d(t,{Z:()=>s})},1452:(e,t,i)=>{"use strict";function s(e=window.getSelection()){if(!(null==e?void 0:e.rangeCount))return!0;const t=e.getRangeAt(0);return!(!t.collapsed&&t.START_TO_END)}i.d(t,{Z:()=>s})},6299:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(3512),n=i(4762);function a(e){if("Enter"===e.key&&!n.IS_MOBILE&&!e.isComposing){if("enter"===s.Z.settings.sendShortcut){if(e.shiftKey||e.ctrlKey||e.metaKey)return;return!0}{const t=n.IS_APPLE?e.metaKey:e.ctrlKey;if(e.shiftKey||(n.IS_APPLE?e.ctrlKey:e.metaKey))return;if(t)return!0}}return!1}},3444:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(4762);function n(e){return s.IS_MOBILE_SAFARI&&e instanceof TouchEvent&&e.touches[0].clientX<30}},2398:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(5432);function n(e,t=!1,i=!0){if(!s.Z||t&&("INPUT"===document.activeElement.tagName||document.activeElement.isContentEditable))if(i&&e.focus(),e instanceof HTMLInputElement){const t=e.value.length;e.selectionStart=t,e.selectionEnd=t}else{const t=document.createRange();t.selectNodeContents(e),t.collapse(!1);const i=window.getSelection();i.removeAllRanges(),i.addRange(t)}}window.placeCaretAtEnd=n},4484:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(2648);function n(e,t,i,n){return void 0===n&&(n=e.parentElement===t?(0,s.Z)(e):-1),n!==i&&(-1!==n&&ni?t.insertBefore(e,t.children[i]):t.append(e):t.prepend(e),!0)}},2359:(e,t,i)=>{"use strict";function s(e){e.style.display="none",e.offsetLeft,e.style.display=""}i.d(t,{Z:()=>s})},6740:(e,t,i)=>{"use strict";i.d(t,{ZP:()=>o,cj:()=>r});var s=i(925);const n={},a=(e,t)=>{e instanceof HTMLImageElement||e instanceof HTMLVideoElement?e.src=t:e instanceof SVGImageElement?e.setAttributeNS(null,"href",t):e.style.backgroundImage="url("+t+")"};function o(e,t,i,o=!0){if(!t)return console.error("renderImageFromUrl: no url?",e,t),void(null==i||i());const r=e instanceof HTMLVideoElement;if(n[t]&&o||r)e&&a(e,t),i&&(r?(0,s.Z)(e).then(i):null==i||i());else{const s=e instanceof HTMLImageElement,o=s?e:new Image;o.src=t;const r=()=>{!s&&e&&a(e,t),n[t]=!0,null==i||i(),o.removeEventListener("error",d)},d=e=>{console.error("Render image from url failed:",e,t,o),o.removeEventListener("load",r),null==i||i()};o.addEventListener("load",r,{once:!0}),o.addEventListener("error",d,{once:!0})}}function r(e,t,i){return new Promise((s=>{o(e,t,s,i)}))}},2830:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(9674),n=i(6740);function a(e,t,i,a,o=e,r){return a&&t.classList.add("fade-in"),(0,n.cj)(t,i).then((()=>s.Z.mutateElement(e,(()=>{o.append(t),a?t.addEventListener("animationend",(()=>{s.Z.mutate((()=>{t.classList.remove("fade-in"),null==r||r.remove()}))}),{once:!0}):null==r||r.remove()}))))}},5565:(e,t,i)=>{"use strict";function s(e,t){if("string"==typeof t)return void(e.innerHTML=t);const i=e.firstChild;i?e.lastChild===i?i.replaceWith(t):(e.textContent="",e.append(t)):e.append(t)}i.d(t,{Z:()=>s})},669:(e,t,i)=>{"use strict";i.d(t,{Y:()=>m,Z:()=>g});var s=i(4762),n=i(5003),a=i(5400),o=i(3699),r=i(6854),d=i(3228),l=i(5975),c=i(2648);function h(e,t,i,s){let n;if(e===i)n=t-s;else if(e.parentElement===i.parentElement)n=(0,c.Z)(e,!0)-(0,c.Z)(i,!0);else{const t=[];let s=e.parentElement;do{t.push(s)}while(s=s.parentElement);s=i.parentElement;do{if(t.includes(s))break}while(s=s.parentElement);const a=s;e=(0,l.Z)(e,a),i=(0,l.Z)(i,a),n=(0,c.Z)(e,!0)-(0,c.Z)(i,!0)}return(0,d.Z)(n,-1,1)}window.compareNodes=h;var u=i(3299),p=i(2398);const f=new RegExp(`[^${r.Z}]`),m=!1;class g{constructor(){this.saveSelectionOnChange=e=>{const t=document.activeElement;this.saveRangeForElement(t)},this.onFocusOut=e=>{this.lastNode=this.lastOffset=void 0},this.onSelectionChange=e=>{var t;const{input:i}=this;if(!i)return void this.setSelectionClassName(document.getSelection());let s=this.getCaretPosN();for(;;){const{node:e,offset:n,selection:a,move:o}=s;if((null==e?void 0:e.nodeValue)!==r.Z||!this.lastNode)break;const d=h(e,n,this.lastNode,this.lastOffset)<0;void 0!==d&&(a.isCollapsed?this.superMove(i,s,d,!0):a.modify(a.isCollapsed?"move":"extend",d?"backward":"forward","character")),this.log("selectionchange",e,n,this.lastNode,this.lastOffset,e===this.lastNode,(0,c.Z)(this.getFiller(e)),(0,c.Z)(this.getFiller(this.lastNode)),d,a,document.getSelection(),document.getSelection().getRangeAt(0),null==e?void 0:e.parentNode,null===(t=this.lastNode)||void 0===t?void 0:t.parentNode),s=this.getCaretPosN(),this.lastNode=e,this.lastOffset=n;break}this.lastNode=this.lastOffset=void 0,this.setSelectionClassName(s.selection,i)},this.onBeforeInput=e=>{var t;const{input:i,log:s}=this;if(!i)return;const n=this.addInputCallback.bind(this,i),a=this.getCaretPosN();let{node:o,offset:d,selection:l,move:c}=a;if(s("beforeinput",e,o,d,l,a),this.lastNode=this.lastOffset=void 0,e.inputType.startsWith("delete")){if(n((()=>{this.processEmptiedFillers(i),this.removeExtraBOMs(i),this.fixInsertedLineBreaks(i)})),(null==o?void 0:o.nodeValue)===r.Z&&l.isCollapsed&&e.inputType.includes("deleteContent")){const t=e.inputType.includes("Backward"),s=d===r.Z.length&&t||!d&&!t;this.superMove(i,a,t,s)}}else{if(e.inputType.startsWith("insert")){if(null===(t=null==o?void 0:o.classList)||void 0===t?void 0:t.contains("input-something")){o=o.previousSibling.firstChild;const e=l.getRangeAt(0);e.setStart(o,0),e.setEnd(o,0),e.collapse(!0);const t=this.getCaretPosN();o=t.node,l=t.selection,d=t.offset}if(o&&o.textContent===r.Z&&d===r.Z.length){l.modify("move","backward","character");const e=this.getCaretPosN();o=e.node,l=e.selection,d=e.offset}e.inputType;{o&&o.nodeType===o.ELEMENT_NODE&&(o=o.firstChild,s.warn("fixing focus on span"));const t=(null==o?void 0:o.nodeValue)===r.Z;if(s("inserting line break",t,o,`"${null==o?void 0:o.nodeValue}"`,(null==o?void 0:o.parentElement)?Array.from(o.parentElement.childNodes).slice():[]),t){const e=o.parentElement;e.classList.replace("input-filler","input-filler-text"),e.childNodes.length,n((()=>{e.childNodes.length>1?(s("inserting line break, remove"),o=Array.from(e.childNodes).find((e=>e.nodeValue===r.Z)),e.t=o):o.nodeValue!==r.Z&&(s("inserting line break, deleteData"),o.deleteData(o.nodeValue.indexOf(r.Z),r.Z.length)),this.fixInsertedLineBreaks(i)}))}else"insertLineBreak"===e.inputType&&n((()=>{this.fixInsertedLineBreaks(i)}))}return}"historyUndo"===e.inputType?n((()=>{this.processFilledFillers(i),this.processEmptiedFillers(i),this.removeExtraBOMs(i),this.removeEmptyTextNodes(i),this.fixBuggedCaret()})):"historyRedo"===e.inputType&&n((()=>{this.processFilledFillers(i),this.processEmptiedFillers(i),i.querySelectorAll(".input-something:not([contenteditable])").forEach((e=>{e.contentEditable="false"})),this.removeExtraBOMs(i),this.fixBuggedCaret()}))}},this.onKeyDown=e=>{var t;const i=e.key;if("ArrowDown"===i||"ArrowUp"===i)this.lastNode=this.lastOffset=void 0;else{const{node:e,offset:t}=this.getCaretPosN();this.lastNode=e,this.lastOffset=t,this.lastNode===this.input&&(this.lastNode=this.lastOffset=void 0)}this.log("keydown",this.lastNode,null===(t=this.lastNode)||void 0===t?void 0:t.parentNode,this.lastOffset,this.getCaretPosN(),e)},this.log=(0,n.kg)("RICH-INPUT"),this.listenerSetter=new o.Z,this.savedRanges=new WeakMap,this.listenerSetter.add(document)("selectionchange",this.saveSelectionOnChange),m&&(this.listenerSetter.add(document)("focusout",this.onFocusOut),this.listenerSetter.add(document)("selectionchange",this.onSelectionChange),this.listenerSetter.add(document)("beforeinput",this.onBeforeInput),this.listenerSetter.add(document)("keydown",this.onKeyDown,{capture:!0}),s.IS_FIREFOX&&(this.inputCaptureCallbacks=[],this.listenerSetter.add(document)("input",(()=>{this.inputCaptureCallbacks.forEach((e=>e())),this.inputCaptureCallbacks.length=0}),{capture:!0})))}get input(){const e=document.getSelection(),{anchorNode:t}=e;if(t)return(t.closest?t:t.parentElement).closest('[contenteditable="true"]')}saveRangeForElement(e){e&&(e.isContentEditable||"INPUT"===e.tagName)&&document.getSelection().rangeCount&&this.savedRanges.set(e,document.getSelection().getRangeAt(0))}findPreviousSmthIndex(e,t,i){const s=Array.from(null!=i?i:e.querySelectorAll(".input-something")),n=s.findIndex((e=>h(e,0,t,0)>=0));return-1===n?s.length-1:Math.max(0,n-1)}superMove(e,t,i,s){var n,a;const{node:o,offset:d,move:l}=t,c=e.querySelectorAll(".input-something"),h=this.findPreviousSmthIndex(e,o,c),u=document.createRange();u[i?"setEnd":"setStart"](o,d),s&&l(i);const p=this.getCaretPosN();if((null===(n=p.node)||void 0===n?void 0:n.nodeValue)===r.Z&&(!s||o===this.lastNode)){const t=this.findPreviousSmthIndex(e,p.node,c);let n=!s;for(;;){const s=this.getCaretPosN(),d=this.findPreviousSmthIndex(e,s.node,c);u[i?"setStart":"setEnd"](s.node,s.offset);const p=u.toString(),m=!f.test(p);if(this.log("test cursor",p,m,t,d),!m||(null===(a=s.node)||void 0===a?void 0:a.nodeValue)!==r.Z||d!==t||!d&&!s.offset||!(d{e.classList.add("br-not-br")}))}fixBuggedCaret(){const e=document.getSelection(),t=e.getRangeAt(0);e.removeAllRanges(),e.addRange(t)}addInputCallback(e,t,i=!0){const n=()=>{this.log("input modify callback"),t()};i&&s.IS_FIREFOX?this.inputCaptureCallbacks.push(n):this.listenerSetter.add(e)("input",n,{once:!0,capture:i})}removeExtraBOMs(e){const t=e=>{var t;return null===(t=null==e?void 0:e.classList)||void 0===t?void 0:t.contains("input-something")};e.querySelectorAll(".input-filler").forEach((e=>{var i;const{previousSibling:s,nextSibling:n}=e;let o=!1;!(null===(i=null==n?void 0:n.classList)||void 0===i?void 0:i.contains("input-filler"))&&(0,a.Hc)(n)&&(o=t(s)||t(n)),o||(this.log.warn("removing empty bom node",e),e.remove())}))}getFiller(e){return e&&e.nodeType===e.TEXT_NODE&&e.parentElement!==this.input?e.parentElement:e}getCaretPosN(){const e=(0,u.Z)(this.input);return Object.assign(Object.assign({},e),{move:this.move.bind(this,e.selection)})}removeEmptyTextNodes(e){const{log:t}=this,i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:t=>t.parentElement!==e||t.nodeValue?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let s;for(;s=i.nextNode();)t.warn("removing empty text node",s),s.remove()}removePossibleBOMSiblings(e,t){[e,t].forEach((e=>{var t;(null===(t=null==e?void 0:e.classList)||void 0===t?void 0:t.contains("input-filler"))&&e.remove()}))}removePossibleBOMSiblingsByNode(e){const{previousSibling:t,nextSibling:i}=e;this.removePossibleBOMSiblings(t,i)}processEmptiedFillers(e){e.querySelectorAll(".input-filler-text").forEach((e=>{var t;this.removeExtraBOMs(e);let i=!0;if(e.textContent)f.test(e.textContent)||e.querySelector(".input-something")?i=!1:e.classList.replace("input-filler-text","input-filler");else{e.classList.replace("input-filler-text","input-filler");const i=Array.from(e.childNodes).find((e=>e.nodeType===e.TEXT_NODE));i?i.insertData(0,r.Z):(null===(t=e.t)||void 0===t?void 0:t.nodeValue)?e.append(e.t):e.append(document.createTextNode(r.Z))}i&&this.removePossibleBOMSiblingsByNode(e)}))}processFilledFillers(e){e.querySelectorAll(".input-filler").forEach((e=>{if(e.textContent!==r.Z){e.classList.replace("input-filler","input-filler-text");const t=e.t,i=Array.from(e.childNodes).find((e=>e.nodeType===e.TEXT_NODE&&e.nodeValue.includes(r.Z)));if(i&&!(null==t?void 0:t.nodeValue)){const e=i.nodeValue.indexOf(r.Z);-1!==e&&i.deleteData(e,r.Z.length)}}}))}setSelectionClassName(e,t){if(e.rangeCount){const i=e.getRangeAt(0);t?Array.from(t.querySelectorAll(".input-selectable")).forEach((e=>{e.classList.toggle("selection",!i.collapsed&&i.intersectsNode(e))})):Array.from(document.querySelectorAll(".input-selectable.selection")).forEach((e=>e.classList.remove("selection")))}}move(e,t){const{focusNode:i,focusOffset:s}=e;e.modify("extend",t?"backward":"forward","character"),t?e.collapseToStart():e.collapseToEnd();const{focusNode:n,focusOffset:a}=e;this.log("moving cursor",t,i,i.nodeType===i.ELEMENT_NODE?i:i.parentElement,s,n,n.nodeType===n.ELEMENT_NODE?n:n.parentElement,a)}prepareApplyingMarkdown(){const{input:e}=this,t=e.querySelectorAll(".input-filler"),i=e.querySelectorAll(".input-something");return i.forEach((e=>{e.contentEditable="inherit"})),()=>{t.forEach((e=>{e.contentEditable="inherit"})),i.forEach((e=>{e.contentEditable="false"})),this.removeExtraBOMs(e)}}static getInstance(){var e;return null!==(e=this.INSTANCE)&&void 0!==e?e:this.INSTANCE=new g}}},8928:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(5994);function n(e){if(!s.Z.isAvailable("animations"))return;const t=[{transform:"translateX(0)"},{transform:"translateX(.25rem)"},{transform:"translateX(-.25rem)"},{transform:"translateX(0)"}];e.animate([...t,...t,...t],{duration:300,iterations:1,easing:"ease-in-out"})}},2914:(e,t,i)=>{"use strict";i.d(t,{Z:()=>f});var s=i(3757),n=i(5432),a=i(5994),o=i(3228),r=i(5953),d=i(5418),l=i(3910),c=i(2738),h=i(5975),u=i(4484),p=i(2648);class f{constructor(e){this.onSwipe=(e,t)=>{t=(0,o.Z)(t,this.minY,this.maxY),this.element.style.transform=`translateY(${t}px)`;const i=Math.round(Math.abs(t)/this.elementRect.height),s=this.siblings;this.siblings=[];const n=t<0?"previousElementSibling":"nextElementSibling";let a=this.element[n];for(let e=0;e{this.siblings.includes(e)||(e.style.transform="")})),this.siblings.forEach((e=>{const i=this.elementRect.height*(t<0?1:-1);e.style.transform=`translateY(${i}px)`})),this.scrollableRect){const e=t,i=e>0,s=(i?this.elementRect.bottom:this.elementRect.top)+e-this.addScrollPos;let n=2;s+(i?0:this.elementRect.height)>=this.scrollableRect.bottom||(s-(i?this.elementRect.height:0)<=this.scrollableRect.top?n*=-1:n=void 0),void 0!==n&&(this.scrollable.container[this.scrollable.scrollProperty]+=n)}},this.verifyTouchTarget=e=>!this.list.classList.contains("is-reordering")&&(this.element=this.getSortableTarget(e.target),!!this.element),this.onScroll=()=>{const e=this.scrollable.container[this.scrollable.scrollProperty],t=this.addScrollPos=e-this.startScrollPos,i="scrollTop"===this.scrollable.scrollProperty;this.swipeHandler.add(i?0:t,i?t:0)},this.onStart=()=>{this.list.classList.add("is-reordering"),this.element.classList.add("is-dragging","no-transition"),this.swipeHandler.setCursor("grabbing"),this.elementRect=this.element.getBoundingClientRect(),this.containerRect=this.list.getBoundingClientRect(),this.minY=this.containerRect.top-this.elementRect.top,this.maxY=this.containerRect.bottom-this.elementRect.bottom,this.addScrollPos=0,this.scrollable&&(this.startScrollPos=this.scrollable.container[this.scrollable.scrollProperty],this.scrollableRect=this.scrollable.container.getBoundingClientRect(),this.scrollable.container.addEventListener("scroll",this.onScroll))},this.onReset=()=>{return e=this,t=void 0,s=function*(){const e=this.siblings.length,t=e&&e*(this.siblings[0].previousElementSibling===this.element?1:-1),i=(0,p.Z)(this.element),s=i+t;this.element.classList.remove("no-transition"),this.element.style.transform=t?`translateY(${t*this.elementRect.height}px)`:"",this.swipeHandler.setCursor(""),this.scrollable&&this.scrollable.container.removeEventListener("scroll",this.onScroll),n.Z||(0,c.fc)(document.body,l.Z,{capture:!0,once:!0}),a.Z.isAvailable("animations")&&(yield(0,d.Z)(250)),this.list.classList.remove("is-reordering"),this.element.classList.remove("is-dragging"),(0,u.Z)(this.element,this.list,s,i),[this.element,...this.siblings].forEach((e=>{e.style.transform=""})),this.element=this.siblings=this.elementRect=this.containerRect=this.minY=this.maxY=this.startScrollPos=this.addScrollPos=void 0,t&&this.onSort(i,s)},new((i=void 0)||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}));var e,t,i,s},(0,r.Z)(this,e),this.swipeHandler=new s.Z({element:this.list,onSwipe:this.onSwipe,verifyTouchTarget:this.verifyTouchTarget,onStart:this.onStart,onReset:this.onReset,setCursorTo:document.body,middleware:this.middleware,withDelay:!0})}getSortableTarget(e){if(!e)return;let t=(0,h.Z)(e,this.list);return t&&t.classList.contains("cant-sort")&&(t=void 0),t}}},1656:(e,t,i)=>{"use strict";function s(e,t){return t?e.forEach((e=>e.setAttribute("disabled","true"))):e.forEach((e=>e.removeAttribute("disabled"))),()=>s(e,!t)}i.d(t,{Z:()=>s})},2648:(e,t,i)=>{"use strict";function s(e,t){if(!e.parentNode)return-1;if(t)return Array.from(e.parentNode.childNodes).indexOf(e);let i=0;for(;null!==(e=e.previousElementSibling);)++i;return i}i.d(t,{Z:()=>s})},6339:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var s=i(2738),n=i(5975),a=i(3241),o=i(5432),r=i(5953),d=i(5824),l=i(8497),c=i(5994);class h extends a.Z{constructor(e){super(!1),this.onClickOut=e=>{const t=e.target;(0,n.Z)(t,this.element)||Array.from(this.ignoreButtons).some((e=>(0,n.Z)(t,e)||t===e))||!(this.ignoreMouseOut.size<=1)||this.ignoreOutClickClassName&&(0,l.Z)(t,this.ignoreOutClickClassName)||this.toggle(!1)},this.onMouseOut=e=>{if(!this.isActive())return;if(this.clearTimeout("toggle"),this.ignoreMouseOut.size)return;const t=e.toElement;t&&(0,n.Z)(t,this.element)||this.setTimeout("toggle",(()=>{this.toggle(!1)}),200)},this.toggle=e=>{return t=this,i=void 0,n=function*(){var t;const i=!!this.element.style.display&&void 0===e||e;if(this.init){if(!i)return;this.init(),this.init=null}if(i===this.isActive())return;const s=o.Z||!c.Z.isAvailable("animations")?0:200;if(this.element.style.display&&void 0===e||e){const e=this.dispatchResultableEvent("open");yield Promise.all(e),this.element.style.display="",this.element.offsetLeft,this.element.classList.add("active"),this.dispatchEvent("openAfterLayout"),d.Z.pushItem(this.navigationItem={type:"dropdown",onPop:()=>{this.toggle(!1)}}),this.clearTimeout("toggle"),this.setTimeout("done",(()=>{this.forceClose=!1,this.dispatchEvent("opened")}),s)}else this.dispatchEvent("close"),this.ignoreMouseOut.clear(),this.ignoreButtons.clear(),this.element.classList.remove("active"),d.Z.removeItem(this.navigationItem),null===(t=this.detachClickEvent)||void 0===t||t.call(this),this.detachClickEvent=void 0,this.clearTimeout("toggle"),this.setTimeout("done",(()=>{this.element.style.display="none",this.forceClose=!1,this.dispatchEvent("closed")}),s)},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n},(0,r.Z)(this,e),this.forceClose=!1,this.inited=!1,this.ignoreMouseOut=new Set,this.ignoreButtons=new Set,this.timeouts={}}attachButtonListener(e,t){let i=!0;o.Z?(0,s.fc)(e,(()=>{i?(i=!1,this.toggle(!0)):this.toggle()}),{listenerSetter:t}):(t.add(e)("mouseover",(s=>{i&&(t.add(e)("mouseout",(e=>{this.clearTimeout("toggle"),this.onMouseOut(e)})),i=!1),this.setTimeout("toggle",(()=>{this.toggle(!0)}),200)})),(0,s.fc)(e,(()=>{const t="click",i=!this.ignoreMouseOut.has(t);i&&!this.ignoreMouseOut.size&&(this.ignoreButtons.add(e),setTimeout((()=>{this.detachClickEvent=(0,s.fc)(window,this.onClickOut,{capture:!0})}),0)),this.setIgnoreMouseOut(t,i),this.toggle(i)}),{listenerSetter:t}))}clearTimeout(e){void 0!==this.timeouts[e]&&(clearTimeout(this.timeouts[e]),delete this.timeouts[e])}setTimeout(e,t,i){this.clearTimeout(e),this.timeouts[e]=window.setTimeout((()=>{this.clearTimeout(e),t()}),i)}init(){o.Z||(this.element.onmouseout=this.onMouseOut,this.element.onmouseover=e=>{this.forceClose||this.clearTimeout("toggle")})}isActive(){return this.element.classList.contains("active")}setIgnoreMouseOut(e,t){t?this.ignoreMouseOut.add(e):this.ignoreMouseOut.delete(e)}}},4789:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l,f:()=>s});var s,n=i(8594),a=i(3035),o=i(5296),r=i(8487),d=i(5994);function l(e){var t,i,o;if(null!==(t=e.margin)&&void 0!==t||(e.margin=0),null!==(i=e.maxDistance)&&void 0!==i||(e.maxDistance=1500),null!==(o=e.axis)&&void 0!==o||(e.axis="y"),d.Z.isAvailable("animations")&&0!==e.forceDuration||(e.forceDirection=s.Static),e.forceDirection===s.Static)return e.forceDuration=0,c(e);const r=(0,a.AD)().then((()=>c(e)));return"y"===e.axis?(0,n.YW)(r):r}function c(e){const{element:t,container:i,getNormalSize:s,getElementPosition:n,transitionFunction:a,axis:d,margin:l,position:p,forceDirection:f,maxDistance:m,forceDuration:g}=e;if(!(0,r.Z)(t))return(0,o.Kx)(i),Promise.resolve();const v="y"===d?"top":"left",b="y"===d?"bottom":"right",y="y"===d?"height":"width",w="y"===d?"scrollHeight":"scrollWidth",S="y"===d?"scrollHeight":"offsetWidth",C="y"===d?"scrollTop":"scrollLeft",L=t.getBoundingClientRect(),E=i.getBoundingClientRect?i.getBoundingClientRect():document.body.getBoundingClientRect(),I=L[v]-E[v],M=n?n({elementRect:L,containerRect:E,elementPosition:I}):I,Z=t[S],P=s?s({rect:E}):E[y];let T=i[C];const k=i[w];let x;switch(p){case"start":x=M-l;break;case"end":x=L[b]-E[b]+l;break;case"nearest":case"center":if(Zm?(T=i.scrollTop+=x-m,x=m):x<-m&&(T=i.scrollTop+=x+m,x=-m)),x<0){const e=-T;x=Math.max(x,e)}else if(x>0){const e=k-(T+P);x=Math.min(x,e)}const A=i[C]+x,_=Math.abs(x),F=null!=g?g:250+_/1500*350,D=Date.now(),R=null!=a?a:_<500?u:h,B=()=>F?Math.min((Date.now()-D)/F,1):1,N=()=>{const e=B(),t=R(e),s=x*(1-t);return i[C]=Math.round(A-s),e<1};if(!F||!x)return(0,o.Kx)(i),N(),Promise.resolve();if(e.startCallback){const t=k-Math.round(A+i["y"===d?"offsetHeight":"offsetWidth"]);e.startCallback({scrollSize:k,scrollPosition:T,distanceToEnd:t,path:x,duration:F,containerRect:E,elementRect:L,getProgress:B})}return(0,o.cK)(N,i)}function h(e){return 1-Math.pow(1-e,5)}function u(e){return 1-Math.pow(1-e,3.5)}!function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Static=2]="Static"}(s||(s={}))},8801:(e,t,i)=>{"use strict";i.d(t,{P:()=>n});const s="_";function n(e,t){const i=""["".length-1]||"";let n;switch(e._){case"inputPhotoFileLocation":n=["photo",""[0],e.id,e.thumb_size].filter(Boolean).join(s);break;case"inputDocumentFileLocation":n=["document",""[0],e.id,e.thumb_size].filter(Boolean).join(s);break;case"inputPeerPhotoFileLocation":n=["peerPhoto",e.photo_id,e.pFlags.big?"big":"small"].join(s);break;case"inputStickerSetThumb":n=["stickerSetThumb",e.stickerset.id||e.stickerset.short_name||e.stickerset.emoticon||e.stickerset._,e.thumb_version].join(s);break;case"inputFileLocation":n=[e.volume_id,e.local_id].join(s);break;case"inputWebFileLocation":n=["webFile",e.url].join(s);break;default:console.error("Unrecognized location:",e),n=""}return n+((null==t?void 0:t.downloadId)?"_download":"")+(i?"."+i:i)}},1708:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(7625);function n(e){(0,s.Z)(e.history,((t,i,s)=>{t.action.photo||(s.splice(i,1),void 0!==e.count&&--e.count)}))}},4081:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(2325);function n(e,t="auto"){if(0===e)return(0,s.ag)("FileSize.B",[0]);const i="auto"===t,n=Math.floor(Math.log(e)/Math.log(1024)),a="auto"===t?Math.max(0,n-1):t,o=Math.max(0,a),r=(e/Math.pow(1024,n)).toFixed(o);return(0,s.ag)(["FileSize.B","FileSize.KB","FileSize.MB","FileSize.GB"][n],[i?r:parseFloat(r)])}},8939:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(2325);const n={s:"Seconds",m:"Minutes",h:"Hours",d:"Days",w:"Weeks",mm:"Months",y:"Years"};function a(e,t){const i=function(e,t=2){e||(e=1);const i=[],s=[{m:1,t:"s"},{m:60,t:"m"},{m:60,t:"h"},{m:24,t:"d"},{m:7,t:"w"}];let n=1;s.forEach(((t,a)=>{if(n=Math.round(n*t.m),e=0;--e)0===a[e].duration&&a.splice(e,1);return a}(e,2);if(t){const e=i.map((e=>s.ZP.format(n[e.type],!0,[e.duration])));return(0,s.v_)(e,!1,t)}const a=i.map((e=>(0,s.ag)(n[e.type],[e.duration]))),o=document.createElement("span");return o.append(...(0,s.v_)(a,!1)),o}},6272:(e,t,i)=>{"use strict";i.d(t,{u:()=>r});var s=i(2325);const n=new Map;let a=0;const o=(e,t,i="")=>{i=t.country_code+i,a=Math.max(a,i.length),n.set(i,{country:e,code:t})};function r(e){e=e||"",n.size||s.ZP.countriesList.forEach((e=>{e.country_codes.forEach((t=>{t.prefixes?t.prefixes.forEach((i=>{o(e,t,i)})):o(e,t)}))}));let t=e.replace(/\D/g,"");const i=t.slice(0,a);let r;for(let e=i.length-1;e>=0&&(r=n.get(i.slice(0,e+1)),!r);--e);if(!r)return{formatted:t,country:void 0,code:void 0,leftPattern:""};const d=r.country,l=r.code.patterns||[],c=t.slice(r.code.country_code.length);let h="",u=0,p="";for(let e=l.length-1;e>=0;--e){h=l[e];const t=h.replace(/ /g,"");let i=0;for(let e=0,s=Math.min(c.length,t.length);eu&&(u=i,p=h)}h=p||h,h=h.replace(/\d/g,"X"),h=r.code.country_code+" "+h,h.split("").forEach(((e,i)=>{" "===e&&" "!==t[i]&&t.length>i&&(t=t.slice(0,i)+" "+t.slice(i))}));let f=h&&h.length>t.length?h.slice(t.length):"";return f&&(f=f.replace(/X/g,"‒")),{formatted:t,country:d,code:r.code,leftPattern:f}}},645:(e,t,i)=>{"use strict";i.d(t,{M:()=>s,Z:()=>n});class s{constructor(){this.cache=new Map}static createCache(){const e={frames:new Map,framesNew:new Map,framesURLs:new Map,clearCache:()=>{e.framesNew.forEach((e=>{var t,i;null===(i=(t=e).close)||void 0===i||i.call(t)})),e.frames.clear(),e.framesNew.clear(),e.framesURLs.clear()},counter:0};return e}getCache(e){let t=this.cache.get(e);return t||this.cache.set(e,t=s.createCache()),++t.counter,t}releaseCache(e){const t=this.cache.get(e);t&&!--t.counter&&this.cache.delete(e)}getCacheCounter(e){const t=this.cache.get(e);return null==t?void 0:t.counter}generateName(e,t,i,s,n){return[e,t,i,s?"colored":"",n||""].filter(Boolean).join("-")}}const n=new s},9171:(e,t,i)=>{"use strict";function s(e,t,i,s,n,a,o){return[e,",",t," ",i," ",s,",",n," ",a,",",o].join("")}function n(e,t,i,n,a,o,r,d){const l=[];return l.push("M"+(e+i/2)+","+t),l.push("H"+(e+i-o)),o>0&&l.push("A"+s(o,o,0,0,1,e+i,t+o)),l.push("V"+(t+n-r)),r>0&&l.push("A"+s(r,r,0,0,1,e+i-r,t+n)),l.push("H"+(e+d)),d>0&&l.push("A"+s(d,d,0,0,1,e+0,t+n-d)),l.push("V"+(t+a)),a>0&&l.push("A"+s(a,a,0,0,1,e+a,t+0)),l.push("Z"),l.join(" ")}i.d(t,{Z:()=>n}),i(410).GO.generatePathData=n},1046:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(6740),n=i(1185),a=i(6705);function o(e,t,i){const o=(0,n.Z)(e,t,!1);let r,d;if(i){const e=(0,a.Z)(o);r=e.canvas,d=e.promise}else r=new Image,d=(0,s.cj)(r,o);return r.classList.add("thumbnail"),{image:r,loadPromise:d}}},1185:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(4059);function n(e,t,i=!1){return(0,s.Z)(t.bytes,i)}},8580:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(1507),n=i(1046);function a(e,t,i,a=!1){const o=["video","gif"].includes(e.type);if(!t.downloaded||o||a){if("document"===e._&&t.downloaded&&!a&&(!o||t.type!==s.Pt))return null;const r=e.sizes||e.thumbs,d=(null==r?void 0:r.length)?r.find((e=>"photoStrippedSize"===e._)):null;if(d&&"bytes"in d)return(0,n.Z)(e,d,i)}return null}},6074:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(7625),n=i(5953);class a{constructor(e){this.previous=[],this.next=[],this.reverse=!1,this.loadCount=50,this.loadWhenLeft=20,this.loadedAllUp=!1,this.loadedAllDown=!1,(0,n.Z)(this,e)}setTargets(e,t,i){this.previous=e,this.next=t,this.reverse=i}get index(){return void 0!==this.count?this.previous.length:-1}reset(e=!1){this.current=void 0,this.previous=[],this.next=[],this.setLoaded(!0,e),this.setLoaded(!1,e)}go(e,t=!0){let i,s;if(e>0){if(i=this.next.splice(0,e),s=i.pop(),!s)return;void 0!==this.current&&i.unshift(this.current),this.previous.push(...i)}else{if(i=this.previous.splice(Math.max(0,this.previous.length+e),-e),s=i.shift(),!s)return;void 0!==this.current&&i.push(this.current),this.next.unshift(...i)}return this.next.length0),this.current}unsetCurrent(e){e?this.previous.push(this.current):this.next.unshift(this.current),this.current=void 0}goUnsafe(e,t){const i=e>0?Math.max(0,e-this.next.length):Math.min(0,e+this.previous.length),s=this.go(e,!i&&t);return{item:i?void 0:s,leftLength:i}}setLoaded(e,t){return(e?this.loadedAllDown:this.loadedAllUp)!==t&&(e?this.loadedAllDown=t:this.loadedAllUp=t,t||(e?this.loadPromiseDown=null:this.loadPromiseUp=null),!0)}load(e){if(e?this.loadedAllDown:this.loadedAllUp)return Promise.resolve();let t,i=e?this.loadPromiseDown:this.loadPromiseUp;return i||(t=e?this.reverse?this.previous[0]:this.next[this.next.length-1]:this.reverse?this.next[this.next.length-1]:this.previous[0],null!=t||(t=this.current),i=this.loadMore(t,e,this.loadCount).then((t=>{return n=this,a=void 0,r=function*(){if((e?this.loadPromiseDown:this.loadPromiseUp)!==i)return;t.items.length{const t=this.processItem?this.processItem(e):e;t&&n.push(t)}));const a=yield Promise.all(n);e?this.reverse?this.previous.unshift(...a):this.next.push(...a):this.reverse?this.next.push(...a):this.previous.unshift(...a),this.onLoadedMore&&this.onLoadedMore()},new((o=void 0)||(o=Promise))((function(e,t){function i(e){try{d(r.next(e))}catch(e){t(e)}}function s(e){try{d(r.throw(e))}catch(e){t(e)}}function d(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(i,s)}d((r=r.apply(n,a||[])).next())}));var n,a,o,r}),(()=>{})).then((()=>{e?this.loadPromiseDown=null:this.loadPromiseUp=null})),e?this.loadPromiseDown=i:this.loadPromiseUp=i,i)}}},3699:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});class s{constructor(){this.listeners=new Set}add(e){return(t,i,s)=>{const n={element:e,event:t,callback:i,options:s};return this.addManual(n),n}}addManual(e){var t;e.element.addEventListener(e.event,e.callback,e.options),(null===(t=e.options)||void 0===t?void 0:t.once)&&(e.onceCallback=()=>{this.remove(e),e.onceFired=!0},e.element.addEventListener(e.event,e.onceCallback,e.options)),this.listeners.add(e)}remove(e){e.onceFired||(e.element.removeEventListener(e.event,e.callback,e.options),e.onceCallback&&e.element.removeEventListener(e.event,e.onceCallback,e.options)),this.listeners.delete(e)}removeManual(e,t,i,s){let n;for(const a of this.listeners)if(a.element===e&&a.event===t&&a.callback===i&&a.options===s){n=a;break}n&&this.remove(n)}removeAll(){this.listeners.forEach((e=>{this.remove(e)}))}}},5994:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(410),n=i(3512);const a=new class{isEnabled(){return n.Z.settings.liteMode.all}isAvailable(e){return!n.Z.settings.liteMode.all&&!n.Z.settings.liteMode[e]}};s.GO&&(s.GO.liteMode=a);const o=a},9405:(e,t,i)=>{"use strict";i.d(t,{C:()=>a,c:()=>n});var s=i(9897);class n{constructor(e=0,t=e){this.width=e,this.height=t}aspect(e,t){return(0,s.Z)(this.width,this.height,e.width,e.height,t)}aspectFitted(e){return this.aspect(e,!0)}aspectCovered(e){return this.aspect(e,!1)}}function a(e,t){return new n(e,t)}},4755:(e,t,i)=>{"use strict";i.d(t,{Z:()=>u,_:()=>s});var s,n=i(410),a=i(3241),o=i(9405);!function(e){e[e.mobile=0]="mobile",e[e.medium=1]="medium",e[e.large=2]="large"}(s||(s={}));const r=(0,o.C)(20,20),d=(0,o.C)(36,36),l=(0,o.C)(18,18);class c extends a.Z{constructor(){super(),this.screenSizes=[{key:s.mobile,value:600},{key:s.medium,value:1275},{key:s.large,value:1680}],this.sizes={handhelds:{regular:(0,o.C)(270,270),webpage:(0,o.C)(270,200),album:(0,o.C)(270,0),esgSticker:(0,o.C)(68,68),animatedSticker:(0,o.C)(180,180),staticSticker:(0,o.C)(180,180),emojiSticker:(0,o.C)(112,112),poll:(0,o.C)(240,0),round:(0,o.C)(200,200),documentName:(0,o.C)(200,0),invoice:(0,o.C)(270,270),extendedInvoice:(0,o.C)(270,270),customEmoji:r,esgCustomEmoji:d,emojiStatus:l,popupSticker:(0,o.C)(68,68)},desktop:{regular:(0,o.C)(420,340),webpage:(0,o.C)(420,340),album:(0,o.C)(420,0),esgSticker:(0,o.C)(72,72),animatedSticker:(0,o.C)(200,200),staticSticker:(0,o.C)(200,200),emojiSticker:(0,o.C)(112,112),poll:(0,o.C)(330,0),round:(0,o.C)(280,280),documentName:(0,o.C)(240,0),invoice:(0,o.C)(320,320),extendedInvoice:(0,o.C)(420,340),customEmoji:r,esgCustomEmoji:d,emojiStatus:l,popupSticker:(0,o.C)(80,80)}},this.isMobile=!1,this.handleResize=()=>{const e=window.innerWidth;let t=this.screenSizes[0].key;for(let i=this.screenSizes.length-1;i>=0;--i)if(this.screenSizes[i].value{this.rAF&&window.cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame((()=>{this.handleResize(),this.rAF=0}))})),this.handleResize()}}const h=new c;n.GO.mediaSizes=h;const u=h},8631:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});const s=(0,i(5471).Z)("MIDDLEWARE");function n(e,t=s){return i=>{if(!(i instanceof Promise)){if(i instanceof Error)throw i;return i}return i.then((i=>{if(!e())throw t;return i}))}}},2559:(e,t,i)=>{"use strict";function s(e,t=2){if(0===e)return"0";const i=t<0?0:t,s=Math.floor(Math.log(e)/Math.log(1e3));return parseFloat((e/Math.pow(1e3,s)).toFixed(i))+["","K","M","B","T"][s]}i.d(t,{Z:()=>s})},2575:(e,t,i)=>{"use strict";function s(e,t=" "){const i=e.toString().split(".");return i[0]=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,t),i.join(".")}i.d(t,{Z:()=>s})},925:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(4762);function n(e,t=e.HAVE_METADATA,i){return new Promise(((n,a)=>{if(e.readyState>=t)return void n();const o=s.IS_APPLE_MOBILE&&!i?"loadeddata":"canplay",r="error",d=()=>{e.removeEventListener(r,l),n()},l=t=>{e.removeEventListener(o,d),a(e.error)};e.addEventListener(o,d,{once:!0}),e.addEventListener(r,l,{once:!0})}))}},2296:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var s=i(5824),n=i(5432),a=i(4762),o=i(3910),r=i(2738),d=i(5975),l=i(3241);class c extends l.Z{constructor(e,t){super(!1),this.navigationType=e,this.withOverlay=t,this.onClick=e=>{var t;(0,r.Cf)(e)||this.element&&(0,d.Z)(e.target,this.element)||((null===(t=this.listenerOptions)||void 0===t?void 0:t.capture)&&(0,o.Z)(e),this.close())},this.listenerOptions=t?{}:{capture:!0}}close(){var e;this.element&&(null===(e=this.overlay)||void 0===e||e.remove(),this.element=void 0,this.dispatchEvent("toggle",!1)),n.Z||window.removeEventListener("contextmenu",this.onClick,this.listenerOptions),document.removeEventListener(r.pf,this.onClick,this.listenerOptions),a.IS_MOBILE_SAFARI||s.Z.removeByType(this.navigationType)}open(e){this.close(),a.IS_MOBILE_SAFARI||s.Z.pushItem({type:this.navigationType,onPop:e=>{this.close()}}),this.element=e,!this.overlay&&this.withOverlay&&(this.overlay=document.createElement("div"),this.overlay.classList.add("btn-menu-overlay"),this.overlay.addEventListener(r.pf,(e=>{(0,o.Z)(e),this.onClick(e)}))),this.overlay&&this.element.parentElement.insertBefore(this.overlay,this.element),n.Z||window.addEventListener("contextmenu",this.onClick,Object.assign(Object.assign({},this.listenerOptions),{once:!0})),document.addEventListener(r.pf,this.onClick,this.listenerOptions),this.dispatchEvent("toggle",!0)}}},5180:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(7445);function n(e,t,i){const n=(e=+e)<0,a=s.Z[t];if(!a)throw new Error("CURRENCY_WRAP_INVALID");const o=e/Math.pow(10,a.exp);let r=a.exp;"IRR"==t&&Math.floor(o)==o&&(r=0);let d=function(e,t,i,s){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var n=isFinite(+e)?+e:0,a=isFinite(+t)?Math.abs(t):0,o=void 0===s?",":s,r=void 0===i?".":i,d="";return(d=(a?function(e,t){var i=Math.pow(10,t);return""+Math.round(e*i)/i}(n,a):""+Math.round(n)).split("."))[0].length>3&&(d[0]=d[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(d[1]||"").length{"use strict";i.d(t,{Z:()=>n});var s=i(4755);function n(e,t,i,n){e.touches&&(e=e.touches[0]);const{pageX:a,pageY:o}=e,r=Array.from(t.children).find((e=>e.classList.contains("btn-menu-item")&&!e.classList.contains("hide")))||t;let{scrollWidth:d}=r;const{scrollHeight:l}=t,c=document.body.getBoundingClientRect(),h=c.width,u=c.height;d+=2*r.offsetLeft;let p=8,f=8,m=8,g=8;n&&(n.top&&n.top,n.right&&(f+=n.right),n.bottom&&(m+=n.bottom),n.left&&(g+=n.left)),i=s.Z.isMobile?"right":"left";let v="top";const b=u-l-m,y=h-d-f,w=g,S={x:{left:a,right:Math.min(y,a-d)},intermediateX:"right"===i?w:y,y:{top:o,bottom:o-l},intermediateY:b},C={left:S.x.left+d+f<=h,right:S.x.right>=g},L={top:S.y.top+l+m<=u,bottom:S.y.bottom-m>=m};{const e=C[i]?S.x[i]:(i="center",S.intermediateX);t.style.left=e+"px"}{const e=L[v]?S.y[v]:(v="center",S.intermediateY);t.style.top=e+"px"}return t.className=t.className.replace(/(top|center|bottom)-(left|center|right)/g,""),t.classList.add(("center"===v?v:"bottom")+"-"+("center"===i?i:"left"===i?"right":"left")),{width:d,height:l}}},6787:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var s=i(2312),n=i(1447),a=i(3512),o=i(671),r=i(4755),d=i(3174);function l(e,t,i){return a.Z.managers.appStickersManager.preloadAnimatedEmojiSticker(e).then((({doc:a})=>{if(a)return s.Z.downloadMedia({media:a}).then((s=>{return l=this,c=void 0,u=function*(){const l=r.Z.active.emojiSticker,c=(0,o.tB)(e),h=yield n.Z.loadAnimationWorker({container:void 0,animationData:s,width:null!=t?t:l.width,height:null!=i?i:l.height,name:"doc"+a.id,autoplay:!1,loop:!1,toneIndex:c,group:"none"});h.addEventListener("firstFrame",(()=>{(0,d.O)(a,h.canvas[0],c),h.remove()}),{once:!0})},new((h=void 0)||(h=Promise))((function(e,t){function i(e){try{n(u.next(e))}catch(e){t(e)}}function s(e){try{n(u.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof h?n:new h((function(e){e(n)}))).then(i,s)}n((u=u.apply(l,c||[])).next())}));var l,c,h,u}))}))}},677:(e,t,i)=>{"use strict";i.d(t,{RP:()=>a,X:()=>o});const s=new Set(["all","web","webk"]),n=new Set;function a(e){return e.find((e=>s.has(e.platform)&&!n.has(e.reason)))}function o(e){return!!a(e)}},3174:(e,t,i)=>{"use strict";i.d(t,{O:()=>o,k:()=>a});var s=i(3512);const n={};function a(e,t,i,s){const a=e.id+"-"+t,o=n[a];return o&&o.width>=i&&o.height>=s}function o(e,t,i){return o=this,r=void 0,l=function*(){const o=e.id+"-"+i,{width:r,height:d}=t;if(a(e,i,r,d))return;const l=n[o]={width:r,height:d},c=yield s.Z.managers.appDocsManager.getLottieCachedThumb(e.id,i);if(n[o]!==l)return;if(c&&c.w>=r&&c.h>=d)return;const h=new Promise((e=>{t.toBlob((t=>e(t)))})),u=yield h;n[o]===l&&s.Z.managers.appDocsManager.saveLottiePreview(e.id,u,r,d,i)},new((d=void 0)||(d=Promise))((function(e,t){function i(e){try{n(l.next(e))}catch(e){t(e)}}function s(e){try{n(l.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof d?n:new d((function(e){e(n)}))).then(i,s)}n((l=l.apply(o,r||[])).next())}));var o,r,d,l}},9966:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(3035);function n(e){return function(e,t){let i,s=!1;return(...n)=>{i=n,s||(s=!0,e((()=>{s=!1,t(...i)})))}}(s.T2,e)}},286:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(410),n=i(4762),a=i(8204),o=i(2359);class r{constructor(e,t,i){this.scrollable=e,this.query=t,this.reverse=i}get container(){return this.scrollable.container}getSaved(){return{scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,clientHeight:this.clientHeight}}findElements(){if(!this.query)return[];const{container:e}=this,t=e.getBoundingClientRect(),i=Array.from(e.querySelectorAll(this.query)),s=[];for(const n of i){const i=n.getBoundingClientRect();if((0,a.Z)(n,e,void 0,i,t))s.push({element:n,rect:i});else if(s.length)break}if(!s.length){const e=i[0];e&&s.push({element:e,rect:e.getBoundingClientRect()})}return s}replaceSaved(e,t){if(!this.elements)return;const i=this.elements.findIndex((({element:t})=>e===t));-1!==i&&(this.elements[i].element=t)}findAndSetElements(){this.elements=this.findElements()}save(){this.findAndSetElements(),this._save()}_save(){const{scrollTop:e,scrollHeight:t,clientHeight:i}=this.container;this.scrollHeight=t,this.scrollTop=e,this.clientHeight=i,this.scrollHeightMinusTop=this.reverse?t-e:e}onRestore(e){n.IS_SAFARI&&e&&(0,o.Z)(this.container)}setScrollTop(e,t){this.scrollable.setScrollTopSilently(this.scrollTop=e),this.onRestore(t)}restore(e){var t;const{scrollTop:i,scrollHeight:s}=this.scrollable;if(this.scrollHeight=s,!this.elements.length)return void this._restore(e);let n;if(n=this.elements[this.elements.length-1],!(null===(t=null==n?void 0:n.element)||void 0===t?void 0:t.parentElement)&&(this.findAndSetElements(),n=this.elements[this.elements.length-1],!n))return void this._restore(e);const{element:a,rect:o}=n,r=a.getBoundingClientRect().bottom-o.bottom;this.setScrollTop(i+r,e)}_restore(e){const{scrollHeightMinusTop:t,scrollable:i}=this,s=this.scrollHeight,n=this.reverse?s-t:t;this.setScrollTop(n,e)}}s.GO&&(s.GO.ScrollSaver=r)},8936:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(5953);class n{constructor(e){this.loading=!1,this.loaded=!1,(0,s.Z)(this,e),e.scrollable.onScrolledBottom=()=>{this.load()}}load(){return this.loaded?Promise.resolve():this.loading?this.promise:(this.loading=!0,void(this.promise=this.getPromise().then((e=>{this.loading=!1,this.promise=void 0,e?(this.loaded=!0,this.scrollable.onScrolledBottom=null):this.scrollable.checkForTriggers()}),(()=>{this.promise=void 0,this.loading=!1}))))}}},3719:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var s=i(3781),n=i(2790),a=i(3512),o=i(7625),r=i(1708),d=i(6074),l=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class c extends d.Z{constructor(e={}){var t;super(Object.assign(Object.assign({},e),{loadMore:(e,t,i)=>{const a=t?0:i;let o=null==e?void 0:e.mid;var d;return void 0===o&&(o=this.searchContext.maxId),t||(d=o,1,o=(0,s.Z)((0,n.Z)(d)+1)),this.managers.appMessagesManager.getSearch(Object.assign(Object.assign({},this.searchContext),{peerId:this.searchContext.peerId||(null==e?void 0:e.peerId),maxId:o,limit:a?0:i,backLimit:a})).then((e=>("inputMessagesFilterChatPhotos"===this.searchContext.inputFilter._&&(0,r.Z)(e),e.next_rate&&(this.searchContext.nextRate=e.next_rate),{count:e.count,items:e.history})))},processItem:t=>l(this,void 0,void 0,(function*(){if((yield this.filterMids([t.mid])).length)return e.processItem(t)}))})),this.onHistoryDelete=({peerId:e,msgs:t})=>{const i=i=>i.peerId===e&&t.has(i.mid),s=(e,t,s)=>{i(e)&&s.splice(t,1)};(0,o.Z)(this.previous,s),(0,o.Z)(this.next,s),this.current&&i(this.current)&&(this.current=void 0,this.onEmptied&&this.onEmptied())},this.onHistoryMultiappend=e=>l(this,void 0,void 0,(function*(){if(void 0!==this.searchContext.folderId)return;if(!this.loadedAllUp||this.loadPromiseUp)return;if(e.peerId!==this.searchContext.peerId)return;const t=yield this.filterMids([e.mid]),i=(yield Promise.all(t.map((e=>this.processItem(e))))).filter(Boolean);i.length&&(this.current?this.next.push(...i):this.previous.push(...i))})),this.onMessageSent=({message:e})=>{this.onHistoryMultiappend(e)},null!==(t=this.managers)&&void 0!==t||(this.managers=a.Z.managers),a.Z.addEventListener("history_delete",this.onHistoryDelete),a.Z.addEventListener("history_multiappend",this.onHistoryMultiappend),a.Z.addEventListener("message_sent",this.onMessageSent),e.isInner||(this.otherSideLoader=new c(Object.assign(Object.assign({},e),{isInner:!0})))}filterMids(e){return l(this,void 0,void 0,(function*(){const t=`${this.searchContext.peerId}_${this.searchContext.isScheduled?"scheduled":"history"}`;return yield this.managers.appMessagesManager.filterMessagesByInputFilterFromStorage(this.searchContext.inputFilter._,e,t,e.length)}))}setSearchContext(e){this.searchContext=e,void 0!==this.searchContext.folderId&&(this.loadedAllUp=!0,void 0===this.searchContext.nextRate&&(this.loadedAllDown=!0)),"inputMessagesFilterChatPhotos"===this.searchContext.inputFilter._&&(this.loadedAllUp=!0),!1===this.searchContext.useSearch&&(this.loadedAllDown=this.loadedAllUp=!0),this.otherSideLoader&&this.otherSideLoader.setSearchContext(e)}reset(){super.reset(),this.searchContext=void 0,this.otherSideLoader&&this.otherSideLoader.reset()}getPrevious(e){let t=this.previous;return this.otherSideLoader&&e&&(t=t.concat(this.otherSideLoader.previous)),t}getNext(e){let t=this.next;return this.otherSideLoader&&e&&(t=t.concat(this.otherSideLoader.next)),t}getCurrent(){var e;return this.current||(null===(e=this.otherSideLoader)||void 0===e?void 0:e.current)}goToOtherEnd(e){return e>0?this.go(-this.previous.length):this.go(this.next.length)}goRound(e,t){var i;let s;if(null===(i=this.otherSideLoader)||void 0===i?void 0:i.current){if(s=this.otherSideLoader.goUnsafe(e,t),s.item)return s.item;if(!((e=s.leftLength)>0?this.otherSideLoader.next:this.otherSideLoader.previous).length){if(!(e>0?this.otherSideLoader.loadedAllUp:this.otherSideLoader.loadedAllDown))return;if(e>0&&(1===this.otherSideLoader.searchContext.maxId||this.otherSideLoader.loadedAllDown)||e<0&&(0===this.otherSideLoader.searchContext.maxId||this.otherSideLoader.loadedAllUp))return this.otherSideLoader.goToOtherEnd(e);this.otherSideLoader.unsetCurrent(e>0)}}if(s=this.goUnsafe(e,t),!s.item){if(this.loadedAllUp&&this.loadedAllDown)return this.goToOtherEnd(e);this.otherSideLoader&&(e=s.leftLength,s=this.otherSideLoader.goUnsafe(e,t),s.item&&this.unsetCurrent(e>0))}return null==s?void 0:s.item}setLoaded(e,t){var i;const s=super.setLoaded(e,t);if(s&&this.otherSideLoader&&t&&!1!==(null===(i=this.searchContext)||void 0===i?void 0:i.useSearch)){const e=this.loadedAllUp;this.otherSideLoader.setSearchContext(Object.assign(Object.assign({},this.searchContext),{maxId:e?1:0})),this.otherSideLoader.reverse=this.reverse,this.otherSideLoader.setLoaded(e,!0),this.otherSideLoader.load(!e)}return s}cleanup(){this.reset(),a.Z.removeEventListener("history_delete",this.onHistoryDelete),a.Z.removeEventListener("history_multiappend",this.onHistoryMultiappend),a.Z.removeEventListener("message_sent",this.onMessageSent),this.onEmptied=void 0,this.otherSideLoader&&(this.otherSideLoader.cleanup(),this.otherSideLoader=void 0)}}},9674:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var s=i(3035),n=i(3725),a=i(410),o=i(8487);const r=new class{constructor(){this.promises={},this.raf=s.T2.bind(null),this.scheduled=!1}do(e,t){let i=this.promises[e];return i||(this.scheduleFlush(),i=this.promises[e]=(0,n.Z)()),void 0!==t&&i.then((()=>t())),i}measure(e){return this.do("read",e)}mutate(e){return this.do("write",e)}mutateElement(e,t){const i=(0,o.Z)(e),s=i?this.mutate():Promise.resolve();return void 0!==t&&(i?s.then((()=>t())):t()),s}scheduleFlush(){this.scheduled||(this.scheduled=!0,this.raf((()=>{this.promises.read&&this.promises.read.resolve(),this.promises.write&&this.promises.write.resolve(),this.scheduled=!1,this.promises={}})))}};a.GO&&(a.GO.sequentialDom=r);const d=r},1713:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var s=i(1507),n=i(7030),a=i(9405),o=i(3114);function r(e,t,i,r,d=!0,l,c,h){const u=(0,o.Z)(e);let p;h||(h=(0,n.Z)(e,i,r,void 0,c));const f="document"===e._;p=f||u?(0,a.C)(e.w||h.w||512,e.h||h.h||512):(0,a.C)(h.w||100,h.h||100);let m=(0,a.C)(i,r);m=p=p.aspect(m,d);let g=!0;return(!f||["video","gif"].includes(e.type)||u)&&(m.width<200&&m.height<200&&(m=p=p.aspectCovered((0,a.C)(200,200))),l&&(l.message||l.reply_to_mid||l.media.webpage||l.replies&&l.replies.pFlags.comments&&l.replies.channel_id.toChatId()!==s.IA)&&m.width<320&&(m=(0,a.C)(320,m.height),g=!1),g&&m.width<120&&l&&(m=(0,a.C)(120,m.height),g=!1)),t.style.width=m.width+"px",t.style.height=m.height+"px",{photoSize:h,size:p,isFit:g}}},5345:(e,t,i)=>{"use strict";i.d(t,{Z:()=>u,s:()=>h});var s=i(5003),n=i(6519),a=i(3624),o=i(8631),r=i(5953),d=i(5418),l=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};let c=0;class h{constructor(e){var t;(0,r.Z)(this,e),this.queue=[],null!==(t=this.middlewareHelper)&&void 0!==t||(this.middlewareHelper=(0,a.k)());const i="BATCH-PROCESSOR-"+ ++c;this.log?this.log=this.log.bindPrefix(i):this.log=(0,s.kg)(i)}get queuePromise(){return this.promise}clear(){this.log("clear"),this.queue.length=0,this.promise=void 0,this.middlewareHelper.clean()}addToQueue(e){return this.queue.push(e),this.setQueue()}setQueue(){if(!this.queue.length)return Promise.resolve();if(this.promise)return this.promise;const e=this.middlewareHelper.get(),t=this.log.bindPrefix("queue"),i=(0,o.Z)(e,this.possibleError),s=()=>l(this,void 0,void 0,(function*(){t("start",this.queue.length);const e=this.queue.splice(0,this.queue.length),n=performance.now(),a=e.map((e=>(e.then((e=>{t("render item time",performance.now()-n,e)})),e))),o=yield i(Promise.all(a));if(yield i(this.process(o,i,t)),t("queue rendered"),this.queue.length)return t("have new items to render"),s();t("end")}));t("setting pause");const n=this.promise=i((0,d.Z)(0)).then((()=>s().catch((e=>{throw e!==this.possibleError&&t.error("process queue error",e),e}))),(e=>{throw t("pause has been cleared"),e})).finally((()=>{this.promise===n&&(this.promise=void 0)}));return n}}class u{constructor(e){this.updateElementWith=e=>e(),this.updateListWith=e=>e(!0),(0,r.Z)(this,e),this.elements=new Map,this.sorted=[],this.middleware=(0,a.k)(),this.batchProcessor=new h({log:this.log,process:(e,t,i)=>l(this,void 0,void 0,(function*(){const i=e.map((e=>this.update(e.id,e)));yield t(Promise.all(i))}))})}clear(){this.batchProcessor.clear(),this.middleware.clean(),this.elements.clear(),this.sorted.length=0}_updateList(){this.elements.forEach((e=>{this.update(e.id)})),this.onSort&&this.sorted.forEach(((e,t)=>{this.onSort(e,t)}))}updateList(e){const t=this.middleware.get();this.updateListWith((i=>{t()&&(void 0===i||i)?(this._updateList(),null==e||e(!0)):null==e||e(!1)}))}has(e){return this.elements.has(e)}get(e){return this.elements.get(e)}getAll(){return this.elements}add(e){return l(this,void 0,void 0,(function*(){if(this.get(e))return;const t={id:e,index:0};this.elements.set(e,t);const i=Promise.resolve(this.onElementCreate(t));return this.batchProcessor.addToQueue(i)}))}delete(e,t){const i=this.elements.get(e);if(!i)return!1;this.elements.delete(e);const s=this.sorted.indexOf(i);if(-1!==s&&this.sorted.splice(s,1),this.onDelete)if(t)this.onDelete(i);else{const e=this.middleware.get();this.updateElementWith((()=>{e()&&this.onDelete(i)}))}return!0}update(e,t=this.get(e)){var i;return l(this,void 0,void 0,(function*(){if(!t)return;if(t.index=yield this.getIndex(t),this.get(e)!==t)return;null===(i=this.onUpdate)||void 0===i||i.call(this,t);const s=(0,n.Z)(this.sorted,t,"index");this.onSort(t,s)}))}}},6854:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});const s="\ufeff"},4056:(e,t,i)=>{"use strict";function s(e){return e.replace(/&/g,"&").replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,(e=>"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";")).replace(/([^\#-~| |!])/g,(e=>"&#"+e.charCodeAt(0)+";")).replace(//g,">")}i.d(t,{Z:()=>s})},3738:(e,t,i)=>{"use strict";function s(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}i.d(t,{Z:()=>s})},8456:(e,t,i)=>{"use strict";function s(e,t,i=t+10){return(e=e.trim()).length>i&&(e=e.slice(0,t)+"..."),e}i.d(t,{Z:()=>s})},1564:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});const s="‎"},5157:(e,t,i)=>{"use strict";function s(e,t=!1){const i=parseInt(e+"",10),s=Math.floor(i/3600);let n=Math.floor((i-3600*s)/60),a=i-3600*s-60*n;return s&&(t=!0),n<10&&(n=t?"0"+n:n),a<10&&(a="0"+a),(s?s+":":"")+n+":"+a}i.d(t,{Z:()=>s})},8812:(e,t,i)=>{"use strict";function s(e){const t=new Blob([e],{type:"image/svg+xml;charset=utf-8"});return new Promise((e=>{const i=new FileReader;i.onload=t=>{e(t.target.result)},i.readAsDataURL(t)}))}i.d(t,{Z:()=>s})},241:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(410),n=i(1352);const a=new class{constructor(){if(n.kC)return;const e="visualViewport"in window?window.visualViewport:window,t=()=>{this.width=e.width||e.innerWidth,this.height=e.height||e.innerHeight};e.addEventListener("resize",t),t()}};s.GO&&(s.GO.windowSize=a);const o=a},8594:(e,t,i)=>{"use strict";i.d(t,{YW:()=>p,ZP:()=>v,e9:()=>g,gp:()=>m});var s=i(3725),n=i(410),a=i(5418);const o=new(i(3241).Z),r="start",d="end";let l=!1,c=(0,s.Z)(),h=0;c.resolve();const u=console.log.bind(console.log,"[HEAVY-ANIMATION]:");function p(e,t){l||(c=(0,s.Z)(),o.dispatchEvent(r),l=!0,n.ZP&&u("start")),++h,n.ZP&&u("attach promise, length:",h,t);const i=[void 0!==t?(0,a.Z)(t):void 0,e.finally((()=>{}))].filter(Boolean),d=performance.now(),p=c;return Promise.race(i).then((()=>{c!==p||c.isFulfilled||(--h,n.ZP&&u("promise end, length:",h,performance.now()-d),h<=0&&f())})),c}function f(){c.isFulfilled||(l=!1,h=0,o.dispatchEvent(d),c.resolve(),n.ZP&&u("end"))}function m(){f()}function g(){return c}function v(e,t,i){l&&e();const s=i?i.add(o):o.addEventListener.bind(o),n=i?i.removeManual.bind(i,o):o.removeEventListener.bind(o);return s(r,e),s(d,t),()=>{n(d,t),n(r,e)}}window.dispatchHeavyAnimationEvent=p},5005:(e,t,i)=>{"use strict";i.r(t),i.d(t,{AppDialogsManager:()=>ct,DIALOG_LIST_ELEMENT_TAG:()=>tt,DialogElement:()=>nt,default:()=>ut});var s=i(9331),n=i(3512),a=i(6194),o=i(2325),r=i(4668),d=i(2796),l=i(3897),c=i(1507),h=i(3186),u=i(4531),p=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class f{constructor(e){this.managers=e,this.onArchiveClick=()=>p(this,void 0,void 0,(function*(){const e=yield this.managers.appMessagesManager.getDialogOnly(this.peerId);e&&this.managers.appMessagesManager.editPeerFolders([e.peerId],+!e.folder_id)})),this.onHideTopicClick=()=>{this.managers.appChatsManager.editForumTopic({chatId:this.peerId.toChatId(),topicId:this.threadId,hidden:!0})},this.onToggleTopicClick=()=>{this.managers.appChatsManager.editForumTopic({chatId:this.peerId.toChatId(),topicId:this.threadId,closed:!this.dialog.pFlags.closed})},this.onPinClick=()=>{const{peerId:e,filterId:t,threadId:i}=this;this.managers.appMessagesManager.toggleDialogPin({peerId:e,filterId:t,topicId:i}).catch((e=>p(this,void 0,void 0,(function*(){"PINNED_DIALOGS_TOO_MUCH"!==e.type&&"PINNED_TOO_MUCH"!==e.type||(i?this.managers.apiManager.getLimit("topicPin").then((e=>{(0,d.bC)({langPackKey:"LimitReachedPinnedTopics",langPackArguments:[e]})})):t>=1?(0,d.bC)({langPackKey:"PinFolderLimitReached"}):(0,h.Z)("pin"))}))))},this.onUnmuteClick=()=>{this.managers.appMessagesManager.togglePeerMute({peerId:this.peerId,mute:!1,threadId:this.threadId})},this.onMuteClick=()=>{new l.Z(this.peerId,this.threadId)},this.onUnreadClick=()=>p(this,void 0,void 0,(function*(){const{peerId:e,dialog:t}=this;t.unread_count?(this.managers.appMessagesManager.readHistory(e,t.top_message,this.threadId),this.threadId||this.managers.appMessagesManager.markDialogUnread(e,!0)):this.threadId||this.managers.appMessagesManager.markDialogUnread(e)})),this.onDeleteClick=()=>{new a.Z(this.peerId,void 0,void 0,this.threadId)}}attach(e){(0,u.Z)({listenTo:e,buttons:this.getButtons(),appendTo:document.getElementById("page-chats"),onOpen:e=>p(this,void 0,void 0,(function*(){this.li=e,e.classList.add("menu-open"),this.peerId=e.dataset.peerId.toPeerId(),this.threadId=+e.dataset.threadId||void 0,this.dialog=yield this.managers.dialogsStorage.getDialogOrTopic(this.peerId,this.threadId),this.filterId=this.threadId?void 0:ut.filterId,this.canManageTopics=this.threadId?yield this.managers.appChatsManager.hasRights(this.peerId.toChatId(),"manage_topics"):void 0})),onBeforeOpen:()=>p(this,void 0,void 0,(function*(){const e=this.threadId?"Delete":yield this.managers.appPeersManager.getDeleteButtonText(this.peerId),t=this.buttons[this.buttons.length-1];(null==t?void 0:t.element)&&t.element.lastChild.replaceWith((0,o.ag)(e))})),onClose:()=>{this.li.classList.remove("menu-open"),this.li=this.peerId=this.dialog=this.filterId=this.threadId=this.canManageTopics=void 0},findElement:e=>(0,r.Z)(e.target,tt)})}getButtons(){var e;return null!==(e=this.buttons)&&void 0!==e?e:this.buttons=[{icon:"unread",text:"MarkAsUnread",onClick:this.onUnreadClick,verify:()=>p(this,void 0,void 0,(function*(){return!this.threadId&&!(yield this.managers.appMessagesManager.isDialogUnread(this.dialog))}))},{icon:"readchats",text:"MarkAsRead",onClick:this.onUnreadClick,verify:()=>this.managers.appMessagesManager.isDialogUnread(this.dialog)},{icon:"pin",text:"ChatList.Context.Pin",onClick:this.onPinClick,verify:()=>p(this,void 0,void 0,(function*(){var e;return!(this.threadId&&!this.canManageTopics)&&!(void 0!==this.filterId&&this.filterId>1?(yield this.managers.appMessagesManager.getFilter(this.filterId)).pinnedPeerIds.includes(this.dialog.peerId):null===(e=this.dialog.pFlags)||void 0===e?void 0:e.pinned)}))},{icon:"unpin",text:"ChatList.Context.Unpin",onClick:this.onPinClick,verify:()=>p(this,void 0,void 0,(function*(){var e;return!(this.threadId&&!this.canManageTopics)&&(void 0!==this.filterId&&this.filterId>1?(yield this.managers.appMessagesManager.getFilter(this.filterId)).pinnedPeerIds.includes(this.dialog.peerId):!!(null===(e=this.dialog.pFlags)||void 0===e?void 0:e.pinned))}))},{icon:"mute",text:"ChatList.Context.Mute",onClick:this.onMuteClick,verify:()=>p(this,void 0,void 0,(function*(){return this.peerId!==n.Z.myId&&!(yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:this.dialog.peerId,threadId:this.threadId}))}))},{icon:"unmute",text:"ChatList.Context.Unmute",onClick:this.onUnmuteClick,verify:()=>p(this,void 0,void 0,(function*(){return this.peerId!==n.Z.myId&&(yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:this.dialog.peerId,threadId:this.threadId}))}))},{icon:"archive",text:"Archive",onClick:this.onArchiveClick,verify:()=>0===this.filterId&&this.peerId!==n.Z.myId},{icon:"unarchive",text:"Unarchive",onClick:this.onArchiveClick,verify:()=>1===this.filterId&&this.peerId!==n.Z.myId},{icon:"hide",text:"Hide",onClick:this.onHideTopicClick,verify:()=>this.canManageTopics&&this.dialog.id===c.Ox},{icon:"lock",text:"CloseTopic",onClick:this.onToggleTopicClick,verify:()=>this.canManageTopics&&!this.dialog.pFlags.closed},{icon:"lockoff",text:"RestartTopic",onClick:this.onToggleTopicClick,verify:()=>this.canManageTopics&&!!this.dialog.pFlags.closed},{icon:"delete danger",text:"Delete",onClick:this.onDeleteClick,verify:()=>!this.threadId||!!this.canManageTopics&&this.dialog.id!==c.Ox}]}}var m=i(6008),g=i(1405),v=i(8805),b=i(632),y=i(4762),w=i(5003),S=i(6219),C=i(4494),L=i(9099),E=i(410),I=i(8842),M=i(1447),Z=i(9492),P=i(534),T=i(7856),k=i(2738),x=i(4484),A=i(5565),_=i(4159),F=i(3442),D=i(7487),R=i(9174),B=i(3910),N=i(490);class O{constructor(e,t){this.managers=e,this.hadConnect=!1,this.connecting=!1,this.timedOut=!1,this.updating=!1,this.setConnectionStatus=e=>{Promise.all([D.Z.get("dc"),n.Z.managers.rootScope.getConnectionStatus()]).then((([t,i])=>{t||(t=_.Z.baseDcId),this.setFirstConnectionTimeout&&(clearTimeout(this.setFirstConnectionTimeout),this.setFirstConnectionTimeout=0);const s=i["NET-"+t],n=s&&(e||s.status)===R.Q.Connected;this.connecting&&n&&this.managers.apiUpdatesManager.forceGetDifference(),n&&!this.hadConnect&&(this.hadConnect=!0),this.timedOut=s&&(e||s.status)===R.Q.TimedOut,this.connecting=!n,this.retryAt=s&&s.retryAt,E.ZP&&this.log("connecting",this.connecting),this.setState()}))},this.setStatusText=(e,t)=>{this.currentLangPackKey!==e&&(this.currentLangPackKey=e,(0,A.Z)(this.statusEl,(0,o.ag)(e,t)),this.statusPreloader.attach(this.statusEl))},this.setState=()=>{if(N.Z.deactivatedReason)return;const e=O.CHANGE_STATE_DELAY;if(this.connecting)if(this.timedOut){const e=this.getA("ConnectionStatus.ForceReconnect",(()=>this.managers.networkerFactory.forceReconnect()));this.setStatusText("ConnectionStatus.TimedOut",[e])}else if(this.hadConnect)if(void 0!==this.retryAt){const e=document.createElement("span"),t=this.retryAt,i=()=>{const i=Date.now();e.innerText=""+Math.max(0,Math.round((t-i)/1e3)),i>t&&clearInterval(s)},s=setInterval(i,1e3);i();const n=this.getA("ConnectionStatus.Reconnect",(()=>this.managers.networkerFactory.forceReconnectTimeout()));this.setStatusText("ConnectionStatus.ReconnectIn",[e,n])}else this.setStatusText("ConnectionStatus.Reconnecting");else this.setStatusText("ConnectionStatus.Waiting");else this.updating&&this.setStatusText("Updating");E.ZP&&this.log("setState",this.connecting||this.updating),window.requestAnimationFrame((()=>{this.setStateTimeout&&clearTimeout(this.setStateTimeout),this.setStateTimeout=window.setTimeout((()=>{(0,L.Z)({element:this.statusContainer,className:"is-shown",forwards:this.connecting||this.updating,duration:200}),this.setStateTimeout=0,E.ZP&&this.log("setState: isShown:",this.connecting||this.updating)}),e)}))},this.log=(0,w.kg)("CS",void 0,void 0),this.statusContainer=document.createElement("div"),this.statusContainer.classList.add("connection-status"),this.statusEl=(0,C.Z)("btn-primary bg-warning connection-status-button",{noRipple:!0}),this.statusPreloader=new F.Z({cancelable:!1}),this.statusPreloader.constructContainer({color:"transparent",bold:!0}),this.statusContainer.append(this.statusEl),t.prepend(this.statusContainer),n.Z.addEventListener("connection_status_change",(e=>{this.setConnectionStatus()})),n.Z.addEventListener("state_synchronizing",(e=>{e||(this.updating=!0,E.ZP&&this.log("updating",this.updating),this.setState())})),n.Z.addEventListener("state_synchronized",(e=>{E.ZP&&this.log("state_synchronized",e),e||(this.updating=!1,E.ZP&&this.log("updating",this.updating),this.setState())})),this.setFirstConnectionTimeout=window.setTimeout(this.setConnectionStatus,O.CHANGE_STATE_DELAY+1e3)}getA(e,t){const i=document.createElement("a");return i.classList.add("force-reconnect"),i.append((0,o.ag)(e)),(0,k.fc)(i,(e=>{(0,B.Z)(e),t()})),i}}O.CHANGE_STATE_DELAY=1e3;var U,H=i(6740),z=i(3035),j=i(2894),G=i(5432),V=i(1154),K=i(241),W=i(8487);!function(e){e[e.Error=-1]="Error",e[e.Pending=0]="Pending",e[e.Sent=1]="Sent",e[e.Read=2]="Read"}(U||(U={}));var $=i(5345),q=i(5701),Y=i(5296),Q=i(8222);function X(e,t,i,s){return e>=s?t+i:function(e,t){return-t/2*(Math.cos(Math.PI*e)-1)}(e/s,i)+t}var J=i(4755);function ee(e,t,i,s,n,a,o,r){const d=e.canvas.dpr;if(d&&(t*=d,i*=d,s*=d,n*=d),"number"==typeof a)d&&(a*=d),a={tl:a,tr:a,br:a,bl:a};else{const e={tl:0,tr:0,br:0,bl:0};for(const t in e)a[t]=a[t]?d?a[t]*d:a[t]:e[t]}e.beginPath(),e.moveTo(t+a.tl,i),e.lineTo(t+s-a.tr,i),e.quadraticCurveTo(t+s,i,t+s,i+a.tr),e.lineTo(t+s,i+n-a.br),e.quadraticCurveTo(t+s,i+n,t+s-a.br,i+n),e.lineTo(t+a.bl,i+n),e.quadraticCurveTo(t,i+n,t,i+n-a.bl),e.lineTo(t,i+a.tl),e.quadraticCurveTo(t,i,t+a.tl,i),e.closePath(),o&&e.fill(),r&&e.stroke()}const te=window.devicePixelRatio,ie=20*te,se=2.5*te,ne=2*te,ae=1*te;var oe=i(6818),re=i(5824),de=i(3013),le=i(130),ce=i(4332),he=i(1168),ue=i(7030),pe=i(8115),fe=i(496),me=i(5381),ge=i(7530),ve=i(2291),be=i(5772),ye=i(3385),we=i(2554),Se=i(8050),Ce=i(3725),Le=i(7362),Ee=i(8631),Ie=i(2312),Me=i(2059),Ze=i(2493),Pe=i(319),Te=i(2890),ke=i(3228);class xe{constructor(){this.font="30pt Helvetica",this.currTime=Date.now(),this.diffTime=0,this.spread=0,this.paused=!1,this.pausedTime=0,this.pauseInterval=850,this.lightSource=0,this.inc=.032,this.lightSpread=.55,this.animations=["slide","slide","slide","slide"],this.currentAnimationIndex=0}keepTime(){this.diffTime=Date.now()-this.currTime,this.currTime=Date.now()}cycleAnimation(){++this.currentAnimationIndex,this.currentAnimationIndex>=this.animations.length&&(this.currentAnimationIndex=0)}animate(){const e=this.animations[this.currentAnimationIndex];return"glow"===e?this.animateGlow():"slide"===e?this.animateSlide():void console.log("unknown animation type: "+String(e))}animateGlow(){var e=68;return()=>{var t=this.diffTime/(1e3/60)*10;return this.paused?Date.now()-this.pausedTime>800&&(e=68,this.cycleAnimation(),this.paused=!1):(e=parseInt(""+(e+t)))>=255&&(this.paused=!0,this.pausedTime=Date.now()),"rgb("+e+","+e+","+e+")"}}animateSlide(){var e,t,i,s=this.ctx.createLinearGradient(0,0,this.canvas.width,0),n=this.inc*(this.diffTime/(1e3/60));if(this.paused){if(Date.now()-this.pausedTime>this.pauseInterval)return this.lightSource=-.6,this.cycleAnimation(),this.paused=!1,this.animateSlide()}else this.lightSource+=n,this.lightSource>1+this.lightSpread&&(this.paused=!0,this.pausedTime=Date.now());i=(0,ke.Z)(this.lightSource,0,1),e=(0,ke.Z)(this.lightSource-this.lightSpread,0,1),t=(0,ke.Z)(this.lightSource+this.lightSpread,0,1);const a=Q.Z.getProperty("background-color-true"),o=Q.Z.getProperty("surface-color");return s.addColorStop(e,a),s.addColorStop(i,o),s.addColorStop(t,a),s}settings(e={}){var t,i,s,n,a,o;this.canvas=null!==(t=e.canvas)&&void 0!==t?t:document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.font=null!==(i=e.font)&&void 0!==i?i:this.font,this.lightSpread=null!==(s=e.lightSpread)&&void 0!==s?s:this.lightSpread,this.inc=null!==(n=e.inc)&&void 0!==n?n:this.inc,this.animations=null!==(a=e.animations)&&void 0!==a?a:this.animations,this.text=null!==(o=e.text)&&void 0!==o?o:this.text,this.fillStyle=e.fillStyle,this.canvas.classList.add("shimmer-canvas")}on(){const{width:e,height:t}=this.canvas;this.keepTime(),this.ctx.clearRect(0,0,e,t),this.font&&(this.ctx.font=this.font),this.ctx.fillStyle=this.animate(),this.ctx.fillRect(0,0,e,t),this.fillStyle&&(this.ctx.fillStyle=this.fillStyle,this.ctx.fillRect(0,0,e,t)),this.text&&this.ctx.fillText(this.text,50,50)}}var Ae=i(5994);class _e{constructor(e={}){var t,i,s;this.onThemeChange=()=>{this.stopAnimation(),this.startAnimation()},this.onResize=()=>{const{canvas:e}=this,{width:t,height:i,dpr:s}=e;this.updateCanvasSize(),e.width===t&&e.height===i&&e.dpr===s||(this.stopAnimation(),this.startAnimation())},this.shimmer=new xe,this.tempId=0,this.canvas=document.createElement("canvas"),this.canvas.classList.add("dialogs-placeholder-canvas"),this.ctx=this.canvas.getContext("2d"),this.generatedValues=[],this.avatarSize=null!==(t=e.avatarSize)&&void 0!==t?t:54,this.marginVertical=null!==(i=e.marginVertical)&&void 0!==i?i:9,this.totalHeight=null!==(s=e.totalHeight)&&void 0!==s?s:this.avatarSize+2*this.marginVertical,this.lineHeight=10,this.lineBorderRadius=6,this.lineMarginVertical=8,this.statusWidth=24}attach({container:e,rect:t,getRectFrom:i,onRemove:s,blockScrollable:n}){const{canvas:a}=this;this.onRemove=s,this.getRectFrom="function"==typeof i?i:(i||e).getBoundingClientRect.bind(i||e),(this.blockScrollable=n)&&(n.container.style.overflowY="hidden"),this.updateCanvasSize(t),this.startAnimation(),e.append(a)}detach(e){this.detachTime||(this.availableLength=e,this.detachTime=Date.now(),Ae.Z.isAvailable("animations")||this.remove())}remove(){var e;this.stopAnimation(),this.canvas.parentElement&&(this.canvas.remove(),this.blockScrollable&&(this.blockScrollable.container.style.overflowY="",this.blockScrollable=void 0)),null===(e=this.onRemove)||void 0===e||e.call(this),this.onRemove=void 0}updateCanvasSize(e=this.getRectFrom()){const{canvas:t}=this,i=t.dpr=window.devicePixelRatio;t.width=e.width*i,t.height=e.height*i,t.style.width=e.width+"px",t.style.height=e.height+"px"}renderDetachAnimationFrame(){const{canvas:e,ctx:t,detachTime:i,length:s,availableLength:n}=this;if(!i)return;if(!Ae.Z.isAvailable("animations"))return void this.remove();const{width:a}=e;t.globalCompositeOperation="destination-out";const o=Date.now()-i;let r=!0;for(let e=0;e=n?15*(n-1):15*e);if(i<=0){r=!1;continue}const d=X(i,0,1,150);t.beginPath(),t.rect(0,this.dialogHeight*e,a,this.dialogHeight),t.fillStyle=`rgba(0, 0, 0, ${d})`,t.fill(),d<1&&(r=!1)}t.globalCompositeOperation="source-over",r&&this.remove()}renderFrame(){this.shimmer.on(),this.renderDetachAnimationFrame()}startAnimation(){const{canvas:e,shimmer:t}=this,i=++this.tempId,s=this.createPattern();t.settings({canvas:e,fillStyle:s});const a=()=>this.tempId===i;this.renderFrame(),(0,Y.jt)((()=>!!a()&&(Ae.Z.isAvailable("animations")&&this.renderFrame(),a()))),n.Z.addEventListener("theme_change",this.onThemeChange),J.Z.addEventListener("resize",this.onResize)}stopAnimation(){++this.tempId,n.Z.removeEventListener("theme_change",this.onThemeChange),J.Z.removeEventListener("resize",this.onResize)}createPattern(){const{canvas:e,ctx:t}=this,i=document.createElement("canvas"),s=i.getContext("2d"),n=e.dpr;i.dpr=n,i.width=e.width,i.height=e.height,s.fillStyle=Q.Z.getProperty("surface-color"),s.fillRect(0,0,i.width,i.height),s.fillStyle="#000",s.globalCompositeOperation="destination-out";const a=this.dialogHeight=this.totalHeight*n,o=this.length=Math.ceil(e.height/a);for(let e=0;e{})).finally((()=>{e[t]===s&&delete e[t]}));const n=(0,Ee.Z)((()=>e[t]===s));return{deferred:s,middleware:n}}class st extends $.Z{constructor(e){super({getIndex:e=>{var t;return this.managers.dialogsStorage.getDialogIndex(null!==(t=this.forumPeerId)&&void 0!==t?t:e.id,this.indexKey,this.forumPeerId?e.id:void 0)},onDelete:e=>{var t;e.dom.listEl.remove(),null===(t=this.onListLengthChange)||void 0===t||t.call(this)},onSort:(e,t)=>{var i;const s=e.dom.listEl.parentElement!==this.list;(0,x.Z)(e.dom.listEl,this.list,t),s&&(null===(i=this.onListLengthChange)||void 0===i||i.call(this))},onElementCreate:e=>et(this,void 0,void 0,(function*(){var t;const i=[],s=ht.addListDialog({peerId:null!==(t=this.forumPeerId)&&void 0!==t?t:e.id,loadPromises:i,isBatch:!0,threadId:this.forumPeerId?e.id:void 0,isMainList:"index_0"===this.indexKey});return e.dom=s.dom,e.dialogElement=s,yield Promise.all(i),e})),updateElementWith:z.TR,log:e.log}),(0,Ge.Z)(this,e)}clear(){this.list.replaceChildren(),super.clear()}}class nt extends He.ZP{constructor({peerId:e,rippleEnabled:t=!0,onlyFirstName:i=!1,meAsSaved:n=!0,avatarSize:a="bigger",autonomous:o,loadPromises:r,fromName:d,noIcons:l,threadId:c,wrapOptions:h={},isMainList:u}){var p;super({clickable:!0,noRipple:!t,havePadding:!c,title:!0,titleRightSecondary:!0,subtitle:!0,subtitleRight:!0,noWrap:!0,asLink:!0}),this.subtitleRight.remove();const f=c?void 0:new s.Z;if(f){const t={bigger:54,abitbigger:42,small:32}[a];f.classList.add("dialog-avatar","avatar-"+t),f.updateWithOptions({loadPromises:r,lazyLoadQueue:h.lazyLoadQueue,isDialog:!!n,peerId:e,peerTitle:d}),this.applyMediaElement(f,a)}const m=this.container,g=this.title;g.classList.add("user-title"),this.titleRow.classList.add("dialog-title");const v=new I.Z,b=v.update({peerId:e,fromName:d,dialog:n,onlyFirstName:i,withIcons:!l,threadId:c});null==r||r.push(b),g.append(v.element),g.classList.add("tgico");const y=this.subtitle,w=this.container;w.classList.add("chatlist-chat","chatlist-chat-"+a),o||(w.href="#"+e),"bigger"===a?this.container.classList.add("row-big"):"small"===a&&this.container.classList.add("row-small"),w.dataset.peerId=""+e,c&&(w.dataset.threadId=""+c);const C=document.createElement("span");C.classList.add("message-status","sending-status");const L=document.createElement("span");L.classList.add("message-time");const E=this.titleRight;E.classList.add("dialog-title-details"),E.append(C,L),this.subtitleRow.classList.add("dialog-subtitle");const M=this.dom={avatarEl:f,captionDiv:m,titleSpan:v.element,titleSpanContainer:g,statusSpan:C,lastTimeSpan:L,lastMessageSpan:y,containerEl:w,listEl:w,subtitleEl:this.subtitleRow};if(!o){w.dialogDom=M;const t=S.ZP.chat;t&&S.ZP.isSamePeer(t,{peerId:e,threadId:c,type:"chat"})&&ht.setDialogActive(w,!0),u&&(null===(p=ht.forumTab)||void 0===p?void 0:p.peerId)===e&&!c&&w.classList.add("is-forum-open")}}createUnreadBadge(){if(this.dom.unreadBadge)return;const e=this.dom.unreadBadge=document.createElement("div");e.className="dialog-subtitle-badge badge badge-22",this.dom.subtitleEl.append(e)}createUnreadAvatarBadge(){if(this.dom.unreadAvatarBadge)return;const e=this.dom.unreadAvatarBadge=document.createElement("div");e.className="dialog-subtitle-badge badge badge-22 avatar-badge",this.dom.listEl.append(e)}createMentionsBadge(){if(this.dom.mentionsBadge)return;const e=this.dom.mentionsBadge=document.createElement("div");e.className="dialog-subtitle-badge badge badge-22 mention mention-badge",e.innerText="@",this.dom.lastMessageSpan.after(e)}toggleBadgeByKey(e,t,i,s){(0,L.Z)({element:this.dom[e],className:"is-visible",forwards:t,duration:s?0:250,onTransitionEnd:t?void 0:()=>{this.dom[e].remove(),delete this.dom[e]},useRafs:i&&(0,W.Z)(this.dom[e])?0:2})}}class at extends je.h{toggle(e){return et(this,void 0,void 0,(function*(){this.init2&&(yield this.init2()),(0,L.Z)({element:this.container,className:"is-visible",forwards:e,duration:300,onTransitionEnd:e?void 0:()=>{this.onCloseAfterTimeout()},useRafs:this.firstTime?(this.firstTime=void 0,2):void 0})}))}init(e){(0,Ge.Z)(this,e),this.log=(0,w.kg)("FORUM"),this.firstTime=!0,this.container.classList.add("topics-container");const t=!this.slider;t&&(this.closeBtn.classList.replace("tgico-left","tgico-close"),this.container.classList.add("active","is-floating"),(0,k.fc)(this.closeBtn,(()=>{ht.toggleForumTab(void 0,this)}),{listenerSetter:this.listenerSetter})),this.rows=document.createElement("div"),this.rows.classList.add("sidebar-header__rows"),this.subtitle=document.createElement("div"),this.subtitle.classList.add("sidebar-header__subtitle"),this.title.replaceWith(this.rows),this.rows.append(this.title,this.subtitle);const i=ht.createChatList();ht.setListClickListener(i,null,!0),this.scrollable.append(i),this.xd=new dt(this.peerId,t?80:0),this.xd.scrollable=this.scrollable,this.xd.sortedList=new st({managers:this.managers,log:this.log,list:i,indexKey:"index_0",forumPeerId:this.peerId}),this.xd.bindScrollable();const s=()=>({peerId:this.peerId,type:"chat"}),a=(0,Ke.Z)({listenerSetter:this.listenerSetter,direction:"bottom-left",buttons:[{icon:"info",text:"ForumTopic.Context.Info",onClick:()=>et(this,void 0,void 0,(function*(){const e=T.ZP.createTab(qe.Z,!0);e.isFirst=!0,e.setPeer(this.peerId),(yield e.fillProfileElements())(),e.loadSidebarMedia(!0),e.open()}))},{icon:"message",text:"ForumTopic.Context.ShowAsMessages",onClick:()=>{const e=S.ZP.chat;S.ZP[(null==e?void 0:e.peerId)===this.peerId?"setPeer":"setInnerPeer"](s())},verify:()=>{const e=S.ZP.chat;return!e||!S.ZP.isSamePeer(e,s())}},{icon:"adduser",text:"ForumTopic.Context.AddMember",onClick:()=>{},verify:()=>!1},{icon:"add",text:"ForumTopic.Context.New",onClick:()=>{T.ZP.createTab(Xe.Z).open(this.peerId)},separator:!0,verify:()=>this.managers.appChatsManager.hasRights(this.peerId.toChatId(),"manage_topics")}]});if(this.listenerSetter.add(n.Z)("history_reload",(e=>{this.peerId===e&&this.xd.fullReset()})),this.listenerSetter.add(n.Z)("chat_update",(e=>et(this,void 0,void 0,(function*(){this.peerId===e.toPeerId(!0)&&((yield this.managers.appChatsManager.getChat(e)).pFlags.forum||ht.toggleForumTab(void 0,this))})))),G.Z&&(0,V.Z)({element:this.container,onSwipe:()=>{ht.toggleForumTab(void 0,this)},middleware:this.middlewareHelper.get()}),this.header.append(a),!t)return this.init2()}init2(){return et(this,void 0,void 0,(function*(){this.init2=void 0;const e=this.middlewareHelper.get(),t=this.peerId;this.managers.apiUpdatesManager.subscribeToChannelUpdates(this.peerId.toChatId()),e.onDestroy((()=>{this.managers.apiUpdatesManager.unsubscribeFromChannelUpdates(this.peerId.toChatId())}));const i=(0,Le.Z)({peerId:t,dialog:!0,wrapOptions:{middleware:e}}),s=S.ZP.setPeerStatus({peerId:t,element:this.subtitle,needClear:!0,useWhitespace:!1,middleware:e,noTyping:!0});return Promise.all([i,s,this.xd.onChatsScroll().then((e=>e.cached?e.renderPromise:void 0))]).then((([t,i,s])=>{e()&&(this.title.append(t),null==i||i())}))}))}onCloseAfterTimeout(){super.onCloseAfterTimeout(),this.xd.destroy()}}const ot=new Error("not implemented");class rt{constructor(){this.onChatsRegularScroll=()=>{this.sliceTimeout&&clearTimeout(this.sliceTimeout),this.sliceTimeout=window.setTimeout((()=>{this.sliceTimeout=void 0,this.sortedList.list.childElementCount&&!ht.processContact&&(0,z.TR)((()=>{const e=performance.now(),t=this.scrollable.scrollTop,i=this.sortedList.list.firstElementChild,s=this.scrollable.container.getBoundingClientRect(),n=i.getBoundingClientRect(),a=Array.from(this.scrollable.splitUp.children);let o=this.scrollable.splitUp.offsetTop;o&&t{this.deleteDialogByKey(this.getDialogKeyFromElement(e))})),this.setOffsets();const b=c.offsetTop-u;this.scrollable.scrollTop=this.scrollable.lastScrollPosition=b,this.log("slice time",performance.now()-e,this.indexKey,b)}))}),200)},this.log=(0,w.kg)("CL"),this.offsets={top:0,bottom:0},this.managers=n.Z.managers,this.listenerSetter=new Ve.Z}getOffsetIndex(e){return{index:this.scrollable.loadedAll[e]?0:this.offsets[e]}}isDialogMustBeInViewport(e){const t=this.getOffsetIndex("top"),i=this.getOffsetIndex("bottom");if(!t.index&&!i.index)return!0;const s=(0,Se.Z)(e,this.indexKey);return(!t.index||s<=t.index)&&(!i.index||s>=i.index)}setIndexKey(e){this.indexKey=e,this.sortedList.indexKey=e}deleteDialogByKey(e){this.sortedList.delete(e)}deleteDialog(e){return this.deleteDialogByKey(this.getDialogKey(e))}updateDialog(e){const t=this.getDialogKey(e);if(!this.isDialogMustBeInViewport(e))return void this.deleteDialog(e);if(!this.sortedList.has(t)&&this.loadedDialogsAtLeastOnce)return void this.sortedList.add(t);const i=this.getDialogElement(t);i&&(ht.setLastMessageN({dialog:e,dialogElement:i,setUnread:!0}),this.sortedList.update(t))}onChatsScrollTop(){return this.onChatsScroll("top")}onChatsScroll(e="bottom"){return this.loadDialogs(e)}createPlaceholder(){const e=this.placeholder=new _e(this.placeholderOptions),t=this.getRectFromForPlaceholder();return e.attach({container:this.sortedList.list.parentElement,getRectFrom:t,onRemove:()=>{this.placeholder===e&&(this.placeholder=void 0)},blockScrollable:this.scrollable}),e}loadDialogs(e){const t=this.log.bindPrefix("load-"+(i=1e3,s=9999,i=Math.ceil(i),s=Math.floor(s),Math.floor(Math.random()*(s-i+1))+i));var i,s;if(t("try",e),this.loadDialogsPromise||this.loadDialogsRenderPromise)return this.loadDialogsPromise;if(this.scrollable.loadedAll[e])return Promise.resolve({cached:!0,renderPromise:Promise.resolve()});t.warn("start",e);const n=(0,Ue.Z)("MIDDLEWARE"),a=(0,Ce.Z)(),o=new Promise(((i,s)=>et(this,void 0,void 0,(function*(){const r=this.sortedList.list;let d=this.placeholder;try{const i=this.loadDialogsInner(e),s=yield i;if(!r.childElementCount&&!d&&(!this.loadedDialogsAtLeastOnce&&this.needPlaceholderAtFirstTime||!s.cached)){if(this.loadDialogsRenderPromise!==o)throw n;d=this.createPlaceholder(),a.resolve(!1)}const l=yield s.result;if(this.loadDialogsRenderPromise!==o)throw n;a.resolve(s.cached),"bottom"===e?l.isEnd&&(this.scrollable.loadedAll[e]=!0):l.isTopEnd&&(this.scrollable.loadedAll[e]=!0);const c=l.dialogs.length;if(t(`will render ${c} dialogs`),c){const t=("top"===e?l.dialogs.slice().reverse():l.dialogs).map((e=>this.sortedList.add(this.getDialogKey(e))));if(yield Promise.all(t).catch(),this.loadDialogsRenderPromise!==o)throw n}const h=l.dialogs["top"===e?0:c-1];h&&(this.offsets[e]=(0,Se.Z)(h,this.indexKey)),this.loadedDialogsAtLeastOnce=!0,ht.onListLengthChange(),t("getDialogs",l,r.childElementCount),setTimeout((()=>{this.scrollable.onScroll()}),0),d&&d.detach(r.childElementCount)}catch(e){return"MIDDLEWARE"!==(null==e?void 0:e.type)&&t.error(e),s(e),void a.reject(e)}i()})))).finally((()=>{this.loadDialogsRenderPromise===o?(t("end"),this.loadDialogsRenderPromise=void 0):t("has been cleared")}));this.loadDialogsRenderPromise=o;const r=this.loadDialogsPromise=a.then((e=>({cached:e,renderPromise:o}))).finally((()=>{this.loadDialogsPromise===r&&(this.loadDialogsPromise=void 0)}));return r}setOffsets(){return et(this,void 0,void 0,(function*(){const e=this.sortedList.list,[t,i]=yield Promise.all([this.getDialogFromElement(e.firstElementChild),this.getDialogFromElement(e.lastElementChild)]),{indexKey:s}=this;this.offsets.top=(0,Se.Z)(t,s),this.offsets.bottom=(0,Se.Z)(i,s)}))}getDialogKey(e){throw ot}getDialogKeyFromElement(e){throw ot}getRectFromForPlaceholder(){throw ot}getDialogFromElement(e){throw ot}loadDialogsInner(e){throw ot}setTyping(e){return et(this,void 0,void 0,(function*(){const t=this.getDialogKey(e),i=this.getDialogDom(t);if(!i)return;const s=i.lastMessageSpan.querySelector(".peer-typing-container"),n=yield S.ZP.getPeerTyping(e.peerId,s,"forumTopic"===e._?e.id:void 0);!s&&n&&((0,A.Z)(i.lastMessageSpan,n),i.lastMessageSpan.classList.add("user-typing"))}))}unsetTyping(e){const t=this.getDialogKey(e),i=this.getDialogElement(t);i&&(i.dom.lastMessageSpan.classList.remove("user-typing"),ht.setLastMessageN({dialog:e,lastMessage:null,dialogElement:i,setUnread:null}))}getDialogDom(e){const t=this.sortedList.get(e);return null==t?void 0:t.dom}getDialogElement(e){const t=this.sortedList.get(e);return null==t?void 0:t.dialogElement}bindScrollable(){this.scrollable.container.addEventListener("scroll",this.onChatsRegularScroll),this.scrollable.onScrolledTop=this.onChatsScrollTop.bind(this),this.scrollable.onScrolledBottom=this.onChatsScroll.bind(this),this.scrollable.setVirtualContainer(this.sortedList.list)}clear(){var e;this.sortedList.clear(),null===(e=this.placeholder)||void 0===e||e.remove()}reset(){this.scrollable.loadedAll.top=!0,this.scrollable.loadedAll.bottom=!1,this.offsets.top=this.offsets.bottom=0,this.loadDialogsRenderPromise=void 0,this.loadDialogsPromise=void 0}fullReset(){return this.reset(),this.clear(),this.onChatsScroll()}destroy(){this.clear(),this.scrollable.destroy(),this.listenerSetter.removeAll()}}class dt extends rt{constructor(e,t){super(),this.peerId=e,this.paddingX=t,this.placeholderOptions={avatarSize:0,marginVertical:5,totalHeight:64},this.listenerSetter.add(n.Z)("peer_typings",(({peerId:e,threadId:t,typings:i})=>et(this,void 0,void 0,(function*(){if(!t||this.peerId!==e)return;const s=yield this.managers.dialogsStorage.getForumTopic(e,t);s&&(i.length?this.setTyping(s):this.unsetTyping(s))})))),this.listenerSetter.add(n.Z)("dialogs_multiupdate",(e=>{for(const[t,{dialog:i,topics:s}]of e)t===this.peerId&&(null==s?void 0:s.size)&&s.forEach((e=>{this.updateDialog(e)}))})),this.listenerSetter.add(n.Z)("dialog_unread",(({dialog:e})=>{"forumTopic"===(null==e?void 0:e._)&&e.peerId===this.peerId&&ht.setUnreadMessagesN({dialog:e,dialogElement:this.getDialogElement(this.getDialogKey(e))})})),this.listenerSetter.add(n.Z)("dialog_notify_settings",(e=>et(this,void 0,void 0,(function*(){if(e.peerId===this.peerId)if("dialog"!==e._)ht.setUnreadMessagesN({dialog:e,dialogElement:this.getDialogElement(this.getDialogKey(e))});else{const e=[...this.sortedList.getAll().entries()],t=e.map((([e])=>this.managers.dialogsStorage.getForumTopic(this.peerId,e))),i=yield Promise.all(t);e.forEach((([e,t],s)=>{ht.setUnreadMessagesN({dialog:i[s],dialogElement:t.dialogElement})}))}})))),this.listenerSetter.add(n.Z)("dialog_drop",(e=>{"forumTopic"===e._&&e.peerId===this.peerId&&this.deleteDialogByKey(this.getDialogKey(e))})),this.listenerSetter.add(n.Z)("dialog_draft",(({dialog:e,drop:t,peerId:i})=>{"forumTopic"===e._&&e.peerId===this.peerId&&(t?this.deleteDialog(e):this.updateDialog(e))}))}isDialogMustBeInViewport(e){return!e.pFlags.hidden&&super.isDialogMustBeInViewport(e)}getDialogKey(e){return e.id}getDialogKeyFromElement(e){return+e.dataset.threadId}getRectFromForPlaceholder(){return()=>{const e=T.ZP.rect;return{top:56,right:e.right,bottom:0,left:this.paddingX,width:e.width-this.paddingX,height:e.height-56}}}getDialogFromElement(e){return this.managers.dialogsStorage.getForumTopic(+e.dataset.peerId,+e.dataset.threadId)}loadDialogsInner(e){return et(this,void 0,void 0,(function*(){const{indexKey:t}=this;let i=K.Z.height/64*1.25|0,s=0;const n=this.peerId,{index:a}=this.getOffsetIndex(e);if(s=a,a)if("top"===e){const e=yield this.managers.dialogsStorage.getFolderDialogs(n,!0),o=e.findIndex((e=>(0,Se.Z)(e,t)<=a)),r=Math.max(0,o-i);i=o-r,s=(0,Se.Z)(e[r],t)+1}else s=a;return this.managers.acknowledged.dialogsStorage.getDialogs({offsetIndex:s,limit:i,filterId:n,skipMigrated:!0})}))}}class lt extends rt{constructor(e){super(),this.filterId=e,this.needPlaceholderAtFirstTime=!0,this.listenerSetter.add(n.Z)("peer_typings",(({peerId:e,typings:t})=>et(this,void 0,void 0,(function*(){const[i,s]=yield Promise.all([this.managers.appMessagesManager.getDialogOnly(e),this.managers.appPeersManager.isForum(e)]);i&&!s&&(t.length?this.setTyping(i):this.unsetTyping(i))})))),this.listenerSetter.add(n.Z)("user_update",(e=>et(this,void 0,void 0,(function*(){if(!this.isActive)return;const t=e.toPeerId(),i=this.getDialogDom(t);if(!i)return;const s=yield this.managers.appUsersManager.getUserStatus(e),n="userStatusOnline"===(null==s?void 0:s._);this.setOnlineStatus(i.avatarEl,n)})))),this.listenerSetter.add(n.Z)("chat_update",(e=>et(this,void 0,void 0,(function*(){const t=e.toPeerId(!0);this.processDialogForCallStatus(t)})))),this.listenerSetter.add(n.Z)("dialog_flush",(({dialog:e})=>{this.isActive&&e&&(ht.setLastMessageN({dialog:e,setUnread:!0}),this.validateDialogForFilter(e))})),this.listenerSetter.add(n.Z)("dialogs_multiupdate",(e=>{var t;if(this.isActive)for(const[i,{dialog:s,topics:n}]of e)"dialog"===(null==s?void 0:s._)&&(this.updateDialog(s),null===(t=ht.processContact)||void 0===t||t.call(ht,i.toPeerId()),this.validateDialogForFilter(s))})),this.listenerSetter.add(n.Z)("dialog_drop",(e=>{var t;this.isActive&&"dialog"===e._&&(this.deleteDialogByKey(e.peerId),null===(t=ht.processContact)||void 0===t||t.call(ht,e.peerId))})),this.listenerSetter.add(n.Z)("dialog_unread",(({dialog:e})=>{this.isActive&&"dialog"===(null==e?void 0:e._)&&(ht.setUnreadMessagesN({dialog:e,dialogElement:this.getDialogElement(this.getDialogKey(e))}),this.validateDialogForFilter(e))})),this.listenerSetter.add(n.Z)("dialog_notify_settings",(e=>{this.isActive&&"forumTopic"!==e._&&(this.validateDialogForFilter(e),ht.setUnreadMessagesN({dialog:e,dialogElement:this.getDialogElement(this.getDialogKey(e))}))})),this.listenerSetter.add(n.Z)("dialog_draft",(({dialog:e,drop:t,peerId:i})=>{var s;this.isActive&&"forumTopic"!==e._&&(t?this.deleteDialog(e):this.updateDialog(e),null===(s=ht.processContact)||void 0===s||s.call(ht,i))})),this.listenerSetter.add(n.Z)("filter_update",(e=>et(this,void 0,void 0,(function*(){if(this.isActive&&e.id===this.filterId&&!c.DZ.has(e.id)){const e=yield this.managers.dialogsStorage.getCachedDialogs(!0);yield this.validateListForFilter();for(let t=0,i=e.length;t(0,Se.Z)(e,i)<=o)),r=Math.max(0,a-s);s=a-r,n=(0,Se.Z)(e[r],i)+1}else n=o;const r=this.managers.acknowledged.dialogsStorage.getDialogs({offsetIndex:n,limit:s,filterId:t,skipMigrated:!0}),d=yield r;return a&&(d.result=Promise.reject((0,Ue.Z)("MIDDLEWARE"))),d}))}setOnlineStatus(e,t){const i="is-online",s=e.classList.contains(i);!s&&t&&e.classList.add(i),(0,L.Z)({element:e,className:"is-visible",forwards:t,duration:250,onTransitionEnd:t?void 0:()=>{e.classList.remove(i)},useRafs:t&&!s?2:0})}generateScrollable(e,t){const i=t.id,s=new v.ZP(null,"CL",500);s.container.dataset.filterId=""+i;const a=(0,ye.Z)(t.localId),o=new st({managers:n.Z.managers,log:this.log,list:e,indexKey:a,onListLengthChange:ht.onListLengthChange});return this.scrollable=s,this.sortedList=o,this.setIndexKey(a),this.bindScrollable(),s}testDialogForFilter(e){return c.DZ.has(this.filterId)?this.filterId===e.folder_id:void 0!==(0,Se.Z)(e,this.indexKey)}isDialogMustBeInViewport(e){return!(void 0!==e.migratedTo||!this.testDialogForFilter(e))&&super.isDialogMustBeInViewport(e)}validateListForFilter(){return et(this,void 0,void 0,(function*(){this.sortedList.getAll().forEach((e=>et(this,void 0,void 0,(function*(){const t=yield n.Z.managers.appMessagesManager.getDialogOnly(e.id);this.testDialogForFilter(t)||this.deleteDialog(t)}))))}))}validateDialogForFilter(e){this.getDialogElement(e.peerId)&&(this.testDialogForFilter(e)||this.deleteDialog(e))}setCallStatus(e,t){let{callIcon:i,listEl:s}=e;if(!i&&t){const{canvas:t,startAnimation:n}=e.callIcon=i=function(e=!1){const t=document.createElement("canvas");t.width=t.height=ie;const i=t.getContext("2d"),s=(ie-(3*ne+2*se))/2,n=Date.now();let a=!1;const o=()=>{if(t.isConnected)a||(a=t.isConnected);else if(a)return!1;const o=X((Date.now()-n)%1e3,0,1,1e3);i.clearRect(0,0,ie,ie),i.fillStyle=e&&!J.Z.isMobile?Q.Z.getProperty("primary-color"):"#fff";for(let e=0;e<3;++e){let t;t=o>=.5?e%2?2-2*o:2*(o-.5):e%2?2*o:1-2*o;let n=4+8*t;n*=te,ee(i,s+e*ne+e*se,(ie-n)/2,ne,n,ae,!0)}return!0};return{canvas:t,startAnimation:()=>{(0,Y.jt)(o),o()},setActive:t=>{e=t,o()}}}(s.classList.contains("active"));t.classList.add("dialog-group-call-icon"),s.append(t),n()}i&&(0,L.Z)({element:e.callIcon.canvas,className:"is-visible",forwards:t,duration:250,onTransitionEnd:t?void 0:()=>{e.callIcon.canvas.remove(),e.callIcon=void 0},useRafs:t?2:0})}processDialogForCallStatus(e,t){return et(this,void 0,void 0,(function*(){if(!oe.Z)return;if(t||(t=this.getDialogDom(e)),!t)return;const i=yield n.Z.managers.appChatsManager.getChat(e.toChatId());this.setCallStatus(t,!(!i.pFlags.call_active||!i.pFlags.call_not_empty))}))}onChatsScroll(e="bottom"){var t;return this.scrollable.loadedAll[e]&&(null===(t=ht.loadContacts)||void 0===t||t.call(ht)),this.log("onChatsScroll",e),super.onChatsScroll(e)}toggleAvatarUnreadBadges(e,t){if(!e)return void this.sortedList.getAll().forEach((e=>{const{dom:t,dialogElement:i}=e;t.unreadAvatarBadge&&i.toggleBadgeByKey("unreadAvatarBadge",!1,!1,!1)}));const i=["unread","mention"];this.sortedList.getAll().forEach((e=>{var t;const{dom:s,dialogElement:n}=e,a=null===(t=s.unreadBadge)||void 0===t?void 0:t.textContent;if(!a||s.unreadBadge.classList.contains("backwards"))return;const o=!!s.unreadAvatarBadge;n.createUnreadAvatarBadge(),n.toggleBadgeByKey("unreadAvatarBadge",!0,o),s.unreadAvatarBadge.textContent=a;const r=s.unreadAvatarBadge.classList,d=s.unreadBadge.classList;i.forEach((e=>{r.toggle(e,d.contains(e))}))}))}getDialogKey(e){return e.peerId}getDialogKeyFromElement(e){return+e.dataset.peerId}getDialogFromElement(e){return n.Z.managers.appMessagesManager.getDialogOnly(e.dataset.peerId.toPeerId())}}class ct{constructor(){this.chatsContainer=document.getElementById("chatlist-container"),this.log=(0,w.kg)("DIALOGS",w.v9.Log|w.v9.Error|w.v9.Warn|w.v9.Debug),this.folders={menu:document.getElementById("folders-tabs"),menuScrollContainer:null,container:document.getElementById("folders-container")},this.filtersRendered={},this.lastActiveElements=new Set,this.initedListeners=!1,this.xds={},this.onTabChange=()=>(this.xd=this.xds[this.filterId],this.xd.reset(),this.xd.onChatsScroll()),this._onListLengthChange=()=>{if(!this.xd.loadedDialogsAtLeastOnce)return;if(this.checkIfPlaceholderNeeded(),this.filterId!==c.J$)return;const e=this.chatList,t=e.childElementCount,i=e.parentElement.parentElement,s=e.parentElement.nextElementSibling,n=!!s.childElementCount;if(t>=10)return void(n&&this.removeContactsPlaceholder());if(n)return;i.classList.add("with-contacts");const a=new ze.Z({name:"Contacts",noDelimiter:!0,fakeGradientDelimiter:!0});a.container.classList.add("hide"),this.managers.appUsersManager.getContactsPeerIds(void 0,void 0,"online").then((e=>{let t=!1;const i=()=>{t&&a.container.classList.toggle("hide",!s.list.childElementCount),this.updateContactsLength(!0)},s=new j.Z({avatarSize:"abitbigger",createChatListOptions:{dialogSize:48,new:!0},autonomous:!1,onListLengthChange:i,managers:this.managers});this.loadContacts=()=>{const t=K.Z.height/60|0;(0,Re.Z)(e.splice(0,t),this.verifyPeerIdForContacts).then((e=>{e.forEach((e=>{s.add(e)}))})),e.length||(this.loadContacts=void 0)},this.loadContacts(),this.processContact=e=>et(this,void 0,void 0,(function*(){if(e.isAnyChat())return;const t=yield this.verifyPeerIdForContacts(e),i=s.has(e);!i&&t?s.add(e):i&&!t&&s.delete(e)}));const n=s.list;n.classList.add("chatlist-new"),this.setListClickListener(n),a.content.append(n),t=!0,i()})),s.append(a.container)},this.verifyPeerIdForContacts=e=>et(this,void 0,void 0,(function*(){const[t,i]=yield Promise.all([this.managers.appPeersManager.isContact(e),this.managers.appMessagesManager.getDialogOnly(e)]);return t&&!i}))}start(){const e=this.managers=(0,we.Z)();this.contextMenu=new f(e),this.stateMiddlewareHelper=(0,Oe.k)(),this.folders.menuScrollContainer=this.folders.menu.parentElement,this.onListLengthChange=(0,q.Z)(this._onListLengthChange,100,!1,!0);const t=document.createElement("div");t.classList.add("connection-status-bottom"),t.append(this.folders.container),this.forumsTabs=new Map,this.forumsSlider=document.createElement("div"),this.forumsSlider.classList.add("topics-slider"),this.chatsContainer.parentElement.parentElement.append(this.forumsSlider),G.Z&&(0,V.Z)({element:this.folders.container,onSwipe:e=>{const t=s.prevId();s(e<0?t+1:t-1)},verifyTouchTarget:()=>!this.forumTab}),this.allChatsIntlElement=new o.ZP.IntlElement({key:"FilterAllChatsShort"}),n.Z.addEventListener("premium_toggle",(e=>et(this,void 0,void 0,(function*(){e||(yield this.managers.filtersStorage.isFilterIdAvailable(this.filterId))||s((0,Ne.Z)(this.filtersRendered[c.J$].menu),!1)})))),n.Z.addEventListener("state_cleared",(()=>{const e=c.DZ.has(this.filterId);De.Z.getState().then((t=>et(this,void 0,void 0,(function*(){this.xd.loadedDialogsAtLeastOnce=!1,this.showFiltersPromise=void 0,e&&(this.xd.clear(),this.onTabChange()),this.onStateLoaded(t)}))))})),this.setFilterId(c.J$,c.J$),this.addFilter({id:c.J$,title:"",localId:c.J$});const i=new v.v7(this.folders.menuScrollContainer);t.prepend(this.folders.menuScrollContainer);const s=this.selectTab=(0,m.X)(this.folders.menu,this.folders.container,((e,t)=>et(this,void 0,void 0,(function*(){const i=e;if(e=+t.dataset.filterId||c.J$,-1!==this.filterId&&!c.DZ.has(e)&&!(yield this.managers.filtersStorage.isFilterIdAvailable(e)))return!1;const n=this.filterId;if(y.IS_MOBILE_SAFARI||(i?this.filtersNavigationItem||(this.filtersNavigationItem={type:"filters",onPop:()=>{s(0),this.filtersNavigationItem=void 0}},re.Z.spliceItems(1,0,this.filtersNavigationItem)):this.filtersNavigationItem&&(re.Z.removeItem(this.filtersNavigationItem),this.filtersNavigationItem=void 0)),n===e)return;this.xds[e].clear();const a=this.setFilterIdAndChangeTab(e).then((({cached:e,renderPromise:t})=>{if(e)return t}));return-1!==n?a:void 0}))),(()=>{for(const e in this.xds)+e!==this.filterId&&this.xds[e].clear()}),void 0,i);De.Z.getState().then((e=>(de.Z.setPlaybackParams(e.playbackParams),de.Z.addEventListener("playbackParams",(e=>{this.managers.appStateManager.pushToState("playbackParams",e)})),this.onStateLoaded(e)))),J.Z.addEventListener("resize",(()=>{this.changeFiltersAllChatsKey()})),new O(this.managers,this.chatsContainer),this.chatsContainer.append(t),setTimeout((()=>{M.Z.loadLottieWorkers()}),200),he.Z.MANAGERS=n.Z.managers=e,Ie.Z.construct(e),T.ZP.construct(e),ce.ZP.construct(e),Me.ZP.construct(e),Ze.Z.construct(e),S.ZP.construct(e),this.xd=this.xds[this.filterId]}get chatList(){return this.xd.sortedList.list}setFilterId(e,t){this.filterId=e}setFilterIdAndChangeTab(e){return et(this,void 0,void 0,(function*(){return this.filterId=e,this.onTabChange()}))}initListeners(){n.Z.addEventListener("dialog_flush",(({dialog:e})=>{e&&this.setFiltersUnreadCount()})),n.Z.addEventListener("folder_unread",(e=>et(this,void 0,void 0,(function*(){if(e.id<0){const t=this.xd.getDialogElement(e.id);if(!t)return;this.setUnreadMessagesN({dialog:yield this.managers.dialogsStorage.getDialogOnly(e.id),dialogElement:t})}else this.setFilterUnreadCount(e.id)})))),n.Z.addEventListener("contacts_update",(e=>{var t;null===(t=this.processContact)||void 0===t||t.call(this,e.toPeerId())})),S.ZP.addEventListener("peer_changed",(({peerId:e,threadId:t,isForum:i})=>{const s={peerId:e,threadId:i?t:void 0};for(const e of this.lastActiveElements){const t=+e.dataset.threadId||void 0,i=e.dataset.peerId.toPeerId();S.ZP.isSamePeer({peerId:i,threadId:t},s)||this.setDialogActive(e,!1)}Array.from(document.querySelectorAll(`[data-autonomous="0"] .chatlist-chat[data-peer-id="${e}"]`)).forEach((t=>{const i=+t.dataset.threadId||void 0;S.ZP.isSamePeer({peerId:e,threadId:i},s)&&this.setDialogActive(t,!0)}))})),n.Z.addEventListener("filter_update",(e=>et(this,void 0,void 0,(function*(){if(c.DZ.has(e.id))return;if(!this.filtersRendered[e.id])return void this.addFilter(e);const t=this.filtersRendered[e.id];(0,le.Z)(t.title,(0,pe.Z)(e.title))})))),n.Z.addEventListener("filter_delete",(e=>{const t=this.filtersRendered[e.id];t&&(t.container.remove(),t.menu.remove(),this.xds[e.id].destroy(),delete this.xds[e.id],delete this.filtersRendered[e.id],this.onFiltersLengthChange(),this.filterId===e.id&&this.selectTab(0,!1))})),n.Z.addEventListener("filter_order",(e=>et(this,void 0,void 0,(function*(){e=e.slice(),(0,Be.Z)(e,c.Zi);const t=this.folders.menu,i=yield Promise.all(e.map((e=>et(this,void 0,void 0,(function*(){const[t,i]=yield Promise.all([this.managers.dialogsStorage.getDialogIndexKeyByFilterId(e),this.managers.filtersStorage.getFilter(e)]);return{indexKey:t,filter:i}})))));e.forEach(((e,s)=>{const{indexKey:n,filter:a}=i[s],o=this.filtersRendered[e];this.xds[e].setIndexKey(n),(0,x.Z)(o.menu,t,a.localId),(0,x.Z)(o.container,this.folders.container,a.localId)}))}))))}setDialogActive(e,t){var i;const s=e.dialogDom;e.classList.toggle("active",t),e.classList.toggle("is-forum-open",(null===(i=this.forumTab)||void 0===i?void 0:i.peerId)===e.dataset.peerId.toPeerId()&&!e.dataset.threadId),t?this.lastActiveElements.add(e):this.lastActiveElements.delete(e),(null==s?void 0:s.callIcon)&&s.callIcon.setActive(t)}onStateLoaded(e){return et(this,void 0,void 0,(function*(){this.stateMiddlewareHelper.clean();const t=this.stateMiddlewareHelper.get(),i=e.filtersArr,s=i.length>c.DZ.size,n=e=>{for(const t of e)this.addFilter(t)};let a;s?n(i):a=this.managers.filtersStorage.getDialogFilters().then(n),this.doNotRenderChatList=!0;const o=this.xd.onChatsScroll(),r=(0,Ee.Z)(t);try{yield r(o)}catch(e){}s||this.selectTab(0,!1),a&&(yield r(a)),this.doNotRenderChatList=void 0,this.filterId=-1,this.selectTab(0,!1),this.initedListeners||(this.initListeners(),this.initedListeners=!0),s&&this.showFiltersPromise&&(yield r(this.showFiltersPromise)),this.managers.appNotificationsManager.getNotifyPeerTypeSettings(),yield(yield r(o)).renderPromise.catch(Pe.Z),this.managers.appMessagesManager.fillConversations()}))}setFilterUnreadCount(e){var t;return et(this,void 0,void 0,(function*(){const i=null===(t=this.filtersRendered[e])||void 0===t?void 0:t.unread;if(!i)return;const{unreadUnmutedCount:s,unreadCount:n}=yield this.managers.dialogsStorage.getFolderUnreadCount(e);i.classList.toggle("badge-gray",!s);const a=e===c.J$?s:n;i.innerText=a?""+a:""}))}setFiltersUnreadCount(){for(const e in this.filtersRendered)this.setFilterUnreadCount(+e)}l(e){const t=this.createChatList(),i=this.xds[e.id]=new lt(e.id),s=i.generateScrollable(t,e);return this.setListClickListener(t,null,!0),{ul:t,xd:i,scrollable:s}}addFilter(e){if(e.id===c.Zi)return;const t=this.folders.menu,i=this.filtersRendered[e.id];if(i)return(0,x.Z)(i.menu,t,e.localId),void(0,x.Z)(i.container,this.folders.container,e.localId);const s=document.createElement("div");s.classList.add("menu-horizontal-div-item");const n=document.createElement("span"),a=document.createElement("span");a.classList.add("text-super"),e.id===c.J$?a.append(this.allChatsIntlElement.element):(0,le.Z)(a,(0,pe.Z)(e.title));const o=document.createElement("div");o.classList.add("badge","badge-20","badge-primary");const r=document.createElement("i");n.append(a,o,r),(0,g.Z)(s),s.append(n),s.dataset.filterId=""+e.id,(0,x.Z)(s,t,e.localId);const{ul:d,scrollable:l}=this.l(e);l.container.classList.add("tabs-tab","chatlist-parts");const h=document.createElement("div");h.classList.add("chatlist-top");const u=document.createElement("div");u.classList.add("chatlist-bottom"),h.append(d),l.container.append(h,u);const p=l.container;(0,x.Z)(l.container,this.folders.container,e.localId),this.filtersRendered[e.id]={menu:s,container:p,unread:o,title:a},this.onFiltersLengthChange()}changeFiltersAllChatsKey(){const e=this.folders.menuScrollContainer.firstElementChild,t=e.scrollWidth>e.clientWidth?"FilterAllChatsShort":"FilterAllChats";this.allChatsIntlElement.compareAndUpdate({key:t})}onFiltersLengthChange(){let e=this.showFiltersPromise;return null!=e?e:e=this.showFiltersPromise=(0,Fe.Z)(0).then((()=>{if(this.showFiltersPromise!==e)return;const t=Object.keys(this.filtersRendered).length>1,i=!this.folders.menuScrollContainer.classList.contains("hide");t!==i&&(this.folders.menuScrollContainer.classList.toggle("hide",!t),t&&!i&&this.setFiltersUnreadCount(),this.chatsContainer.classList.toggle("has-filters",t)),this.changeFiltersAllChatsKey(),this.showFiltersPromise=void 0}))}generateEmptyPlaceholder(e){const t="empty-placeholder",i=document.createElement("div");i.classList.add(t,t+"-"+e.classNameType);const s=document.createElement("div");s.classList.add(t+"-header"),(0,o.$d)(s,e.title);const n=document.createElement("div");return n.classList.add(t+"-subtitle"),e.subtitle&&(0,o.$d)(n,e.subtitle,e.subtitleArgs),i.append(s,n),{container:i,header:s,subtitle:n}}checkIfPlaceholderNeeded(){if(this.filterId===c.Zi)return;const e=this.chatList,t=e.parentElement;let i=Array.from(t.children).find((e=>e.matches(".empty-placeholder")));const s=this.xd.scrollable.loadedAll.bottom&&!e.childElementCount;if(s&&i)return;if(!s)return void(i&&(t.classList.remove("with-placeholder"),i.remove()));let n,a;if(this.filterId){n=this.generateEmptyPlaceholder({title:"FilterNoChatsToDisplay",subtitle:"FilterNoChatsToDisplayInfo",classNameType:a="folder"}),i=n.container;const e=document.createElement("div"),t="📂",s=128;(0,be.Z)({div:e,emoji:t,width:s,height:s}),i.prepend(e);const o=(0,C.Z)("btn-primary btn-color-primary btn-control tgico",{text:"FilterHeaderEdit",icon:"settings"});(0,k.fc)(o,(()=>et(this,void 0,void 0,(function*(){const e=T.ZP.createTab(P.Z);e.setInitFilter(yield this.managers.filtersStorage.getFilter(this.filterId)),e.open()})))),i.append(o)}else{n=this.generateEmptyPlaceholder({title:"ChatList.Main.EmptyPlaceholder.Title",classNameType:a="dialogs"}),i=n.container;const e=document.createElement("img");e.classList.add("empty-placeholder-dialogs-icon"),this.emptyDialogsPlaceholderSubtitle=new o.ZP.IntlElement({element:n.subtitle}),Promise.all([this.updateContactsLength(!1),(0,H.cj)(e,"assets/img/EmptyChats.svg"),(0,z.AD)()]).then((([e])=>{i.classList.add("visible"),t.classList.toggle("has-contacts",!!e)})),i.prepend(e)}t.append(i),t.classList.add("with-placeholder"),t.dataset.placeholderType=a}updateContactsLength(e){var t;return null!==(t=this.updateContactsLengthPromise)&&void 0!==t?t:this.updateContactsLengthPromise=this.managers.appUsersManager.getContacts().then((t=>{const i=this.emptyDialogsPlaceholderSubtitle;if(i){let e,s;t.length?(e="ChatList.Main.EmptyPlaceholder.Subtitle",s=[(0,o.ag)("Contacts.Count",[t.length])]):(e="ChatList.Main.EmptyPlaceholder.SubtitleNoContacts",s=[]),i.compareAndUpdate({key:e,args:s})}return e&&this.chatList.parentElement.classList.toggle("has-contacts",!!t.length),this.updateContactsLengthPromise=void 0,t.length}))}removeContactsPlaceholder(){const e=this.chatList,t=e.parentElement.parentElement,i=e.parentElement.nextElementSibling;t.classList.remove("with-contacts"),i.replaceChildren(),this.loadContacts=void 0,this.processContact=void 0}toggleForumTab(e,t=this.forumTab){return et(this,void 0,void 0,(function*(){if(!t&&!e)return;if(t){const e=this.xd.getDialogElement(t.peerId);e&&e.dom.listEl.classList.remove("is-forum-open")}t===e&&(e=void 0),null==t||t.toggle(!1);const i=null==e?void 0:e.toggle(!0);if(t===this.forumTab&&(this.forumTab=e),e){const t=this.xd.getDialogElement(e.peerId);t&&t.dom.listEl.classList.add("is-forum-open"),S.ZP.selectTab(S.oo.CHATLIST)}i&&(yield i),e&&!this.forumNavigationItem?(this.forumNavigationItem={type:"forum",onPop:()=>{this.forumNavigationItem=void 0,this.toggleForumTab()}},re.Z.pushItem(this.forumNavigationItem)):!e&&this.forumNavigationItem&&(re.Z.removeItem(this.forumNavigationItem),this.forumNavigationItem=void 0);const s=!!e,n=i?2:void 0;this.xd.toggleAvatarUnreadBadges(s,n);const a=(0,Ce.Z)();(0,L.Z)({element:this.forumsSlider.parentElement,className:"is-forum-visible",duration:300,forwards:s,useRafs:n,onTransitionEnd:()=>{a.resolve()}}),(0,Ye.YW)(a,300).then((()=>a.resolve()))}))}toggleForumTabByPeerId(e,t){const{managers:i}=this,s=T.ZP.getHistory(),n=s[s.length-1];let a;if(n)return n instanceof at&&n.peerId===e&&t?void(0,Qe.Z)(n.container):(a=T.ZP.createTab(at),void a.open({peerId:e,managers:i}));a=this.forumsTabs.get(e);const o=this.forumTab&&this.forumTab===a;if(null!=t||(t=!o),t!==o)return t&&!a&&(a=new at(void 0),a.init({peerId:e,managers:i}),this.forumsTabs.set(e,a),this.forumsSlider.append(a.container),a.managers=this.managers,a.eventListener.addEventListener("destroy",(()=>{this.forumsTabs.delete(e)}))),this.toggleForumTab(a);t&&(0,Qe.Z)(a.container)}setListClickListener(e,t,i=!1,s=!1,n=!1){let a;const o=(n?S.ZP.setInnerPeer:S.ZP.setPeer).bind(S.ZP);e.dataset.autonomous=""+ +s,e.addEventListener("mousedown",(i=>{if(0!==i.button)return;this.log("dialogs click list");const n=i.target,d=(0,r.Z)(n,tt);if(!d)return;const l=d.dataset.peerId.toPeerId(),h=+d.dataset.mid||void 0,u=+d.dataset.threadId||void 0;if(null==t||t(),!d.querySelector(".is-forum")||i.shiftKey||h){if(i.ctrlKey||i.metaKey)return window.open(d.href||"#"+l,"_blank"),void(0,B.Z)(i);s&&(a&&!(a===d)&&a.classList.remove("active"),d&&(d.classList.add("active"),a=d,this.lastActiveElements.add(d))),u&&!h||this.xd.sortedList.list!==e||this.xd===this.xds[c.Zi]||this.toggleForumTab(),o({peerId:l,lastMsgId:h,threadId:u})}else this.toggleForumTabByPeerId(l)}),{capture:!0}),e.addEventListener("click",(e=>{0===e.button&&(0,B.Z)(e)}),{capture:!0}),i&&this.contextMenu.attach(e)}createChatList(e={}){const t=document.createElement("ul");return t.classList.add("chatlist"),e.new&&t.classList.add("chatlist-new"),e.dialogSize&&t.classList.add("chatlist-"+e.dialogSize),t}setLastMessageN(e){return this.setLastMessage(e).catch((e=>{"MIDDLEWARE"!==(null==e?void 0:e.type)&&this.log.error("set last message error",e)}))}setLastMessage({dialog:e,lastMessage:t,dialogElement:i,highlightWord:s,isBatch:a=!1,setUnread:r=!1}){var d,l;return et(this,void 0,void 0,(function*(){if(!i&&!(i=this.xd.getDialogElement(e.peerId)))return;const{dom:c}=i,{peerId:h}=e,{deferred:u,middleware:p}=it(c,"setLastMessagePromise");let f;if(!t&&("draftMessage"!==(null===(d=e.draft)||void 0===d?void 0:d._)||h.isAnyChat()&&"forumTopic"!==e._&&(yield this.managers.appPeersManager.isForum(h))||(f=e.draft),(null==(t=e.topMessage)?void 0:t.mid)!==e.top_message)){const i=this.managers.appMessagesManager.getMessageByPeer(h,e.top_message);t=yield p(i)}const m=null!==r&&!r;if(m||this.setUnreadMessagesN({dialog:e,dialogElement:i,isBatch:a,setLastMessagePromise:u}),!t)return c.lastMessageSpan.replaceChildren(),c.lastTimeSpan.replaceChildren(),delete c.listEl.dataset.mid,void u.resolve();const g=t&&(0,me.Z)(t);{let e;const i=[];if(t&&!f&&!g){const s=(0,ge.Z)(t,!0),n=new Set(["video","gif","round"]);if(s&&("photo"===s._||n.has(s.type))){const a=(0,ue.Z)(s,20,20);if("photoSizeEmpty"!==a._&&(e=document.createElement("div"),e.classList.add("dialog-subtitle-media"),"round"===s.type&&e.classList.add("is-round"),i.push((0,Z.Z)({photo:s,message:t,container:e,withoutPreloader:!0,size:a}).then((()=>e))),n.has(s.type))){const t=document.createElement("span");t.classList.add("tgico-play"),e.append(t)}}}if(f){const e=document.createElement("span");e.classList.add("danger"),e.append((0,o.ag)("Draft"),": "),i.unshift(e)}else if(h.isAnyChat()&&h!==t.fromId&&!t.action){const e=document.createElement("span");if(e.classList.add("primary-text"),t.fromId===n.Z.myId)e.append((0,o.ag)("FromYou")),i.unshift(e);else{const s=p((0,Le.Z)({peerId:t.fromId,onlyFirstName:!0})).then((t=>(e.prepend(t),e)),Pe.Z);i.unshift(s)}e.append(": ")}const a=!!e&&!!(null==t?void 0:t.message);let r;if(r=s&&t.message?yield p((0,fe.Z)({message:t,highlightWord:s,withoutMediaType:a})):f?yield p((0,fe.Z)({message:f})):t?yield p((0,fe.Z)({message:t,withoutMediaType:a})):document.createDocumentFragment(),i.length){const e=yield p(Promise.all(i));r.prepend(...e)}(0,A.Z)(c.lastMessageSpan,r)}if(t||f){const e=f?Math.max(f.date,t.date||0):t.date;(0,A.Z)(c.lastTimeSpan,(0,b.zM)(new Date(1e3*e)))}else c.lastTimeSpan.textContent="";if(m){c.listEl.dataset.mid=""+t.mid;const e=t.reply_to;(null===(l=null==e?void 0:e.pFlags)||void 0===l?void 0:l.forum_topic)&&(c.listEl.dataset.threadId=""+(0,We.Z)(t))}u.resolve()}))}setUnreadMessagesN(e){return this.setUnreadMessages(e).catch((()=>{}))}setUnreadMessages({dialog:e,dialogElement:t,isBatch:i=!1,setLastMessagePromise:s}){var a;return et(this,void 0,void 0,(function*(){const{dom:o}=t;if(!o)return;const r="forumTopic"===e._,{deferred:d,middleware:l}=it(o,"setUnreadMessagePromise"),{peerId:h}=e,u=Promise.all([this.managers.appNotificationsManager.isPeerLocalMuted({peerId:h,respectType:!0,threadId:r?e.id:void 0}),"draftMessage"!==(null===(a=e.draft)||void 0===a?void 0:a._)?this.managers.appMessagesManager.getMessageByPeer(h,e.top_message):void 0,r?!!e.pFlags.pinned:this.managers.dialogsStorage.isDialogPinned(h,this.filterId),this.managers.appMessagesManager.isDialogUnread(e),h.isAnyChat()&&!r?this.managers.acknowledged.dialogsStorage.getForumUnreadCount(h).then((i=>i.cached?i.result:(i.result.then((()=>{this.setUnreadMessagesN({dialog:e,dialogElement:t})})),{count:0,hasUnmuted:!1}))).catch((()=>{})):void 0]);let[p,f,m,g,v]=yield l(u);const b=o.listEl.classList.contains("is-muted"),{count:y,hasUnmuted:w}=v||{};let S;f&&f.pFlags.out&&f.peerId!==n.Z.myId&&(S=f);const C=null!=y?y:e.unread_count;void 0!==y&&(g=!!C),r&&!g&&(g=!(0,Je.Z)(e.read_inbox_max_id));const E=m||g,I=this.xd!==this.xds[c.Zi]&&!r&&!!this.forumTab&&this.xd.getDialogElement(h)===t&&g;if(s)try{yield l(s)}catch(e){return}const M=i?0:250;o.listEl.classList.toggle("no-unmuted-topic",!p&&void 0!==w&&!w),p!==b&&(0,L.Z)({element:o.listEl,className:"is-muted",forwards:p,duration:M}),function(e,t,i){let s;if("string"==typeof t?s=t:(null==t?void 0:t.pFlags.out)&&(s=t.error?"sendingerror":t.pFlags.is_outgoing?"sending":t.pFlags.unread?"check":"checks"),!s)return void(e.textContent="");const n="tgico-"+s,a=e.lastElementChild;if(a&&a.classList.contains(n))return;const o=document.createElement("i");o.classList.add("sending-status-icon",n),e.append(o),a&&a.remove()}(o.statusSpan,r&&e.pFlags.closed?"premium_lock":S);const Z=!!o.unreadBadge;E&&t.createUnreadBadge();const P=!!o.unreadAvatarBadge;I&&t.createUnreadAvatarBadge();const T=e.unread_mentions_count&&(e.unread_mentions_count>1||e.unread_count>1),k=!!o.mentionsBadge;if(T&&t.createMentionsBadge(),[["unreadBadge",E,Z],["unreadAvatarBadge",I,P],["mentionsBadge",T,k]].forEach((([e,s,n])=>{o[e]&&t.toggleBadgeByKey(e,s,n,i)})),!E)return void d.resolve();m?o.unreadBadge.classList.add("tgico-chatspinned","tgico"):o.unreadBadge&&o.unreadBadge.classList.remove("tgico-chatspinned","tgico");let x,A=!0,_=!1;if(e.unread_mentions_count&&1===C?(x="@",_=!0):g?x=""+(C?(0,$e.Z)(C,1):" "):(x="",A=!1),r){const e=g&&" "===x;o.unreadBadge.classList.toggle("not-visited",e)}[[o.unreadBadge,x],[o.unreadAvatarBadge,x||void 0]].filter(Boolean).forEach((([e,t])=>{void 0!==t&&(e.innerText=x),e.classList.toggle("unread",A),e.classList.toggle("mention",_)})),d.resolve()}))}getDialog(e,t){return et(this,void 0,void 0,(function*(){if("object"!=typeof e){let i;if(t){if(i=yield this.managers.dialogsStorage.getForumTopic(e,t),!i)return{peerId:e||c.NM,pFlags:{}}}else if(i=yield this.managers.appMessagesManager.getDialogOnly(e),!i){const t=e||c.NM;return{peerId:t,peer:yield this.managers.appPeersManager.getOutputPeer(t),pFlags:{}}}return i}return e}))}addListDialog(e){var t;e.autonomous=!1;const i=this.addDialogNew(e);if(i){const{peerId:s}=e,a=this.getDialog(s,e.threadId).then((t=>{const a=[],o=s.isUser();return o||"dialog"!==t._||a.push(this.xd.processDialogForCallStatus(s,i.dom)),s!==n.Z.myId&&o&&a.push(this.managers.appUsersManager.getUserStatus(s.toUserId()).then((e=>{"userStatusOnline"===(null==e?void 0:e._)&&this.xd.setOnlineStatus(i.dom.avatarEl,!0)}))),a.push(this.setLastMessageN({dialog:t,dialogElement:i,isBatch:e.isBatch,setUnread:!0})),Promise.all(a)}));null===(t=e.loadPromises)||void 0===t||t.push(a)}return i}addDialogAndSetLastMessage(e){const{peerId:t,message:i,query:s}=e,n=this.addDialogNew(Object.assign(Object.assign(Object.assign({},e),(0,ve.Z)(i)),{peerId:t}));return this.setLastMessageN({dialog:{_:"dialog",peerId:t},lastMessage:i,dialogElement:n,highlightWord:s}),i.peerId!==t&&(n.dom.listEl.dataset.peerId=""+i.peerId),n}addDialogNew(e){const t=new nt(Object.assign({autonomous:!!e.container,avatarSize:"bigger"},e));if(e.container){const i=e.append?"prepend":"append";e.container[i](t.container)}return t}}const ht=new ct;E.GO.appDialogsManager=ht;const ut=ht},2312:(e,t,i)=>{"use strict";i.d(t,{Z:()=>v});var s=i(3725),n=i(2202),a=i(3512),o=i(410),r=i(319),d=i(1243),l=i(7086),c=i(1655),h=i(5471),u=i(8801),p=i(6658),f=i(7667),m=i(3855);const g=new class{constructor(){this.downloads={},this.progress={}}construct(e){this.managers=e,a.Z.addEventListener("download_progress",(e=>{var t;const i=this.downloads[e.fileName];(null===(t=null==i?void 0:i.main)||void 0===t?void 0:t.notifyAll)&&(this.progress[e.fileName]=e,i.main.notifyAll(e))}))}getNewDeferred(e,t){const i=(0,s.Z)();let n=this.downloads[e];if(n){const e=n.main;["cancel","addNotifyListener","notify","notifyAll"].forEach((t=>{e[t]&&(i[t]=e[t].bind(e))}))}else n=this.downloads[e]={main:i},i.cancel=()=>{const t=(0,h.Z)("DOWNLOAD_CANCELED");this.managers.apiFileManager.cancelDownload(e),i.reject(t),i.cancel=r.Z},i.catch((()=>{this.clearDownload(e,t)})).finally((()=>{delete this.progress[e]}));return"disc"===t&&i.catch(r.Z).finally((()=>{this.clearDownload(e,t)})),n[t]=i}getNewDeferredForUpload(e,t){const i=this.getNewDeferred(e);return t.then(i.resolve,i.reject),i.finally((()=>{this.clearDownload(e)})),i}clearDownload(e,t){const i=this.downloads[e];if(!i)return;delete i[t];const s=Object.keys(i).length;(!s||i.main&&1===s)&&delete this.downloads[e]}getUpload(e){let t=this.getDownload(e);return t||(t=this.getNewDeferred(e),this.managers.appMessagesManager.getUploadPromise(e).then(t.resolve,t.reject),t)}d(e,t,i){let s=this.getDownload(e,i);return s||(s=this.getNewDeferred(e,i),t().then(s.resolve,s.reject),s)}download(e){const t=(0,l.Z)(e);return this.d(t,(()=>this.managers.apiFileManager.download(e)),"blob")}downloadMedia(e,t="blob",i){const{downloadOptions:s,fileName:n}=(0,d.Z)(e);return this.d(n,(()=>{let s;return s="url"===t?this.managers.apiFileManager.downloadMediaURL:"void"===t?this.managers.apiFileManager.downloadMediaVoid:this.managers.apiFileManager.downloadMedia,i?i.then((()=>s(e))):s(e)}),t)}downloadMediaURL(e){return this.downloadMedia(e,"url")}downloadMediaVoid(e){return this.downloadMedia(e,"void")}upload(e,t,i){return t||(t=(0,n.Z)(e)),i||(i=this.managers.apiFileManager.upload({file:e,fileName:t})),this.getNewDeferredForUpload(t,i)}getDownload(e,t){const i=this.downloads[e];return i&&i[t]}downloadToDisc(e,t){const i=e.media,s="document"===i._;s||e.thumb||(e.thumb=i.sizes.slice().pop());const n=""+(2147483647*Math.random()|0),a=`download/${n}`;e.downloadId=n;const o=m.Z.pingServiceWorkerWithIframe(),d=this.downloadMedia(e,"disc",o);if(t)return d;const l=document.createElement("iframe");l.hidden=!0,o.then((()=>{l.src=a,document.body.append(l)}));let h,g=!1;const v=()=>{g||(g=!0,h=l,(0,c.Z)(d.listeners,v))};return d.addNotifyListener(v),d.then((t=>{if(!t)return;const n=URL.createObjectURL(t),a=s?(0,p.Z)(i):(0,f.Z)(i,e.thumb),o=e.media.file_name||(0,u.P)(a.location);!function(e,t,i){const s=document.createElement("a");s.href=e,s.download=t,s.target="_blank",s.style.position="absolute",s.style.top="1px",s.style.left="1px",document.body.append(s);try{const e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),s.dispatchEvent(e)}catch(t){console.error("Download click error",t);try{s.click()}catch(t){window.open(e,"_blank")}}setTimeout((()=>{s.remove(),i&&i()}),100)}(n,a.fileName||o,(()=>{URL.revokeObjectURL(n)}))})).catch(r.Z).finally((()=>{g||v(),setTimeout((()=>{null==h||h.remove()}),1e3)})),d}};o.GO&&(o.GO.appDownloadManager=g);const v=g},6219:(e,t,i)=>{"use strict";i.d(t,{oo:()=>hs,ZP:()=>ys});var s=i(5814),n=i(7856),a=i(4332),o=i(4755),r=i(5003),d=i(3512),l=i(3241),c=i(5729),h=i(4499),u=i(8843),p=i(6054),f=i(4762),m=i(9331),g=i(4494),v=i(2230),b=i(5322),y=i(3013),w=i(4561),S=i(1405),C=i(3910),L=i(2738),E=i(5953);const I="pinned-container";class M{constructor(e){this.floating=!1,(0,E.Z)(this,e);const{divAndCaption:t,className:i}=this;t.container.classList.add(I,"hide"),t.title.classList.add(I+"-title"),t.subtitle.classList.add(I+"-subtitle"),t.content.classList.add(I+"-content"),this.btnClose=document.createElement("button"),this.btnClose.classList.add(I+"-close",`pinned-${i}-close`,"btn-icon","tgico-close"),this.wrapper=document.createElement("div"),this.wrapper.classList.add(I+"-wrapper"),(0,S.Z)(this.wrapper),this.wrapperUtils=document.createElement("div"),this.wrapperUtils.classList.add(I+"-wrapper-utils"),this.wrapperUtils.append(this.btnClose),this.wrapper.append(...Array.from(t.container.children),this.wrapperUtils),t.container.append(this.wrapper),this.attachOnCloseEvent(this.btnClose)}attachOnCloseEvent(e){(0,L.fc)(e,(e=>{(0,C.Z)(e),((this.onClose?this.onClose():null)||Promise.resolve(!0)).then((e=>{e&&this.toggle(!0)}))}),{listenerSetter:this.listenerSetter})}toggle(e){const t=this.divAndCaption.container.classList.contains("hide");if(void 0===e)e=!t;else if(e===t)return;const i=(this.floating||o.Z.isMobile)&&!e;this.divAndCaption.container.classList.toggle("is-floating",i),this.divAndCaption.container.classList.toggle("hide",e),this.topbar.container.classList.toggle("is-pinned-floating",i),this.topbar.container.classList.toggle(`is-pinned-${this.className}-shown`,!e),this.topbar.setFloating(),this.topbar.setUtilsWidth()}isVisible(){return!this.divAndCaption.container.classList.contains("hide")}isFloating(){return this.divAndCaption.container.classList.contains("is-floating")}fill(e,t,i){this.divAndCaption.container.dataset.peerId=""+i.peerId,this.divAndCaption.container.dataset.mid=""+i.mid,this.divAndCaption.fill(e,t,i),this.topbar.setUtilsWidth()}}var Z=i(5565),P=i(8842),T=i(2325),k=i(632),x=i(7207),A=i(8427),_=i(8115);class F extends M{constructor(e,t,i){super({topbar:e,chat:t,listenerSetter:e.listenerSetter,className:"audio",divAndCaption:new w.Z("pinned-audio",((e,t)=>{(0,Z.Z)(this.divAndCaption.title,e),(0,Z.Z)(this.divAndCaption.subtitle,t)})),onClose:()=>{y.Z.stop(void 0,!0)},floating:!0}),this.topbar=e,this.chat=t,this.managers=i,this.onPlaybackParams=e=>{this.fasterEl.classList.toggle("active",e.playbackRate>1),this.repeatEl.classList.remove("tgico-audio_repeat","tgico-audio_repeat_single"),this.repeatEl.classList.add(e.loop?"tgico-audio_repeat_single":"tgico-audio_repeat"),this.repeatEl.classList.toggle("active",e.loop||e.round)},this.onPause=()=>{this.toggleEl.classList.remove("flip-icon")},this.onStop=()=>{this.toggle(!0)},this.onMediaPlay=({doc:e,message:t,media:i,playbackParams:s})=>{var n,a;let o,r;const d="voice"!==e.type&&"round"!==e.type;if(d){const t=e.attributes.find((e=>"documentAttributeAudio"===e._));o=(0,_.Z)(null!==(a=null==t?void 0:t.title)&&void 0!==a?a:e.file_name),r=(null==t?void 0:t.performer)?(0,_.Z)(t.performer):(0,T.ag)("AudioUnknownArtist")}else o=new P.Z({peerId:t.fromId,fromName:null===(n=t.fwd_from)||void 0===n?void 0:n.from_name}).element,r=(0,k.OD)(t.date);this.fasterEl.classList.toggle("hide",d),this.repeatEl.classList.toggle("hide",!d),this.onPlaybackParams(s),this.volumeSelector.setVolume(),this.progressLine.setMedia({media:i,duration:e.duration}),this.fill(o,r,t),this.toggleEl.classList.toggle("flip-icon",!i.paused),this.toggle(!1)},this.divAndCaption.border.remove();const s=(0,v.Z)("fast_rewind active",{noRipple:!0}),n=(0,v.Z)("fast_forward active",{noRipple:!0}),a=(e,t)=>{(0,L.fc)(e,(e=>{(0,C.Z)(e),t()}),{listenerSetter:this.topbar.listenerSetter})};a(s,(()=>{y.Z.previous()})),a(n,(()=>{y.Z.next()})),this.toggleEl=(0,v.Z)("",{noRipple:!0}),this.toggleEl.classList.add("active","pinned-audio-ico","tgico"),a(this.toggleEl,(()=>{y.Z.toggle()})),this.wrapper.prepend(this.wrapper.firstElementChild,s,this.toggleEl,n),this.volumeSelector=new A.Z(this.listenerSetter,!0);const o=document.createElement("div");o.classList.add("progress-line-container"),o.append(this.volumeSelector.container);const r=document.createElement("div");r.classList.add("pinned-audio-volume-tunnel"),this.volumeSelector.btn.classList.add("pinned-audio-volume","active"),this.volumeSelector.btn.prepend(r),this.volumeSelector.btn.append(o),this.repeatEl=(0,v.Z)("audio_repeat",{noRipple:!0}),a(this.repeatEl,(()=>{const e=y.Z.getPlaybackParams();e.round?e.loop?(y.Z.round=!1,y.Z.loop=!1):y.Z.loop=!y.Z.loop:y.Z.round=!0}));const d=this.fasterEl=(0,v.Z)("playback_2x",{noRipple:!0});a(d,(()=>{y.Z.playbackRate=d.classList.contains("active")?1:1.75})),this.wrapperUtils.prepend(this.volumeSelector.btn,d,this.repeatEl);const l=document.createElement("div");l.classList.add("pinned-audio-progress-wrapper"),this.progressLine=new x.Z({withTransition:!0,useTransform:!0}),this.progressLine.container.classList.add("pinned-audio-progress"),l.append(this.progressLine.container),this.wrapper.insertBefore(l,this.wrapperUtils),this.topbar.listenerSetter.add(y.Z)("play",this.onMediaPlay),this.topbar.listenerSetter.add(y.Z)("pause",this.onPause),this.topbar.listenerSetter.add(y.Z)("stop",this.onStop),this.topbar.listenerSetter.add(y.Z)("playbackParams",this.onPlaybackParams);const c=y.Z.getPlayingDetails();c&&(this.onMediaPlay(c),this.onPlaybackParams(c.playbackParams))}destroy(){this.progressLine&&this.progressLine.removeListeners()}}var D,R=i(684);!function(e){e[e.ONE=32]="ONE",e[e.TWO=15]="TWO",e[e.THREE=10]="THREE",e[e.FOUR=8]="FOUR",e[e.MORE=8]="MORE"}(D||(D={}));const B="pinned-message-border";class N{constructor(){this.drawRect=(e,t,i,s,n)=>`M${e},${t+n}a${n},${n},0,0,1,${i},0v${s-2*n}a${n},${n},0,0,1,${-i},0Z`,this.getClipPath=(e,t,i)=>{let s="";if(2===i)s=this.drawRect(0,0,2,t,1)+this.drawRect(0,t+2,2,t,1);else for(let e=0;e{let i;return e<=1?i=D.ONE:2===e?i=D.TWO:3===e?i=D.THREE:4===e?i=D.FOUR:e>3&&(i=D.MORE),i},this.getMarkHeight=(e,t)=>{let i;return e<=1?i=D.ONE:2===e?i=D.TWO:3===e?i=D.THREE:4===e?i=D.FOUR:e>3&&(i=D.MORE),i},this.getMarkTranslateY=(e,t,i)=>1===i?0:2===i?e?t+1:0:3===i?e?1===e?t+1:2*t+2+1:0:(t+1)*e,this.getTrackTranslateY=(e,t,i,s)=>t<=4||e<=1?0:e>=t-2?s-D.ONE-i:(e-2)*i+1*e,this.getTrackHeight=(e,t)=>e<=3?D.ONE:t*e+1*(e-1)}render(e,t){if(this.border||(this.border=document.createElement("div"),this.border.classList.add(B),this.wrapper=document.createElement("div"),this.border.append(this.wrapper)),1===e)return this.count!==e&&(this.wrapper.className=B+"-wrapper-1",this.border.classList.remove(B+"-mask"),this.wrapper.innerHTML=this.wrapper.style.cssText=""),this.border;const i=this.getBarHeight(e,t),s=this.getMarkHeight(e,t),n=this.getTrackHeight(e,i),a=`clipPath_${e}`,o=this.getClipPath(a,i,e),r=this.getMarkTranslateY(t,i,e),d=this.getTrackTranslateY(t,e,i,n);return this.border.classList.toggle(B+"-mask",e>4),t<=1?(this.border.classList.add("mask-bottom"),this.border.classList.remove("mask-top")):t>=e-2?(this.border.classList.add("mask-top"),this.border.classList.remove("mask-bottom")):this.border.classList.add("mask-top","mask-bottom"),this.wrapper.className=B+"-wrapper",this.wrapper.style.cssText=`clip-path: url(#${a}); width: 2px; height: ${n}px; transform: translateY(-${d}px);`,this.svg||(this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.setAttributeNS(null,"height","0"),this.svg.setAttributeNS(null,"width","0"),this.defs=document.createElementNS("http://www.w3.org/2000/svg","defs"),this.defs.append(o),this.svg.append(this.defs),this.mark=document.createElement("div"),this.mark.classList.add(B+"-mark")),this.svg.parentElement||this.wrapper.append(this.svg,this.mark),this.mark.style.cssText=`height: ${s}px; transform: translateY(${r}px);`,this.count=e,this.index=t,this.border}}var O=i(3484),U=i(3699),H=i(8594),z=i(5432),j=i(5701),G=i(6724),V=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class K{constructor(){this.rows={},this.container=document.createElement("div"),this.container.className=K.BASE_CLASS}getRow(e,t=!1){if(this.rows[e])return this.rows[e].element;const i=document.createElement("div"),s=!Object.keys(this.rows).length&&!t;return i.className=K.BASE_CLASS+"-row"+(s?"":" is-hiding hide"),this.rows[e]={element:i,new:!0},this.container.append(i),i}clearRow(e){this.rows[e]&&(this.rows[e].element.remove(),delete this.rows[e])}clearRows(e){this.clearTimeout&&clearTimeout(this.clearTimeout),this.clearTimeout=window.setTimeout((()=>{for(const t in this.rows)+t!==e&&this.clearRow(+t)}),K.DURATION)}setNewRow(e,t=!1){const i=this.rows[e];i.new&&(t?(i.element.classList.remove("hide"),i.element.offsetLeft):i.element.classList.remove("is-hiding","hide"),delete i.new),this.clearRows(e)}animate(e,t,i=e>t,s=!1){if(e===t)return this.setNewRow(e);const n=this.rows[e],a=this.rows[t];if(!a&&!s)return this.setNewRow(e);const o=["from-top","from-bottom"];i||o.reverse(),n.element.classList.add(o[0]),n.element.classList.remove(o[1]),a&&(a.element.classList.add(o[1]),a.element.classList.remove(o[0])),n.new&&this.setNewRow(e,!0),n.element.classList.toggle("is-hiding",!1),a&&a.element.classList.toggle("is-hiding",!0),this.clearRows(e)}}K.DURATION=200,K.BASE_CLASS="animated-super";class W{constructor(e=!1){this.reverse=e,this.decimals=[],this.previousNumber=0,this.container=document.createElement("div"),this.container.className=W.BASE_CLASS}getDecimal(e){if(this.decimals[e])return this.decimals[e];const t=document.createElement("div");t.className=W.BASE_CLASS+"-decimal";const i=document.createElement("div");i.className=W.BASE_CLASS+"-decimal-placeholder";const s=new K;return s.container.className=W.BASE_CLASS+"-decimal-wrapper",t.append(i,s.container),this.container.append(t),this.decimals[e]={container:t,placeholder:i,animatedSuper:s}}clear(e){this.clearTimeout&&clearTimeout(this.clearTimeout);const t=(""+e).length;t>=this.decimals.length||(this.clearTimeout=window.setTimeout((()=>{this.decimals.splice(t,this.decimals.length-t).forEach((e=>{e.container.remove()}))}),K.DURATION))}hideLeft(e){const t=(""+e).length;this.decimals.slice(t).forEach((t=>{const i=+t.placeholder.innerText||0;t.animatedSuper.getRow(W.EMPTY_INDEX,!0),t.animatedSuper.animate(W.EMPTY_INDEX,i,this.reverse?ethis.previousNumber,!0)})),this.clear(e)}setCount(e){const t=Array.from(""+this.previousNumber).map((e=>+e));Array.from(""+e).map((e=>+e)).forEach(((i,s)=>{var n;const a=this.getDecimal(s),o=a.animatedSuper.getRow(i,!0),r=null!==(n=t[s])&&void 0!==n?n:W.EMPTY_INDEX;o.innerText=a.placeholder.innerText=""+i,a.animatedSuper.animate(i,r,this.reverse?ethis.previousNumber,!0)})),this.hideLeft(e),this.previousNumber=e}}W.EMPTY_INDEX=-1,W.BASE_CLASS="animated-counter";class ${constructor(e,t,i){this.topbar=e,this.chat=t,this.managers=i,this.pinnedMaxMid=0,this.pinnedMid=0,this.pinnedIndex=-1,this.wasPinnedIndex=0,this.wasPinnedMediaIndex=0,this.locked=!1,this.waitForScrollBottom=!1,this.count=0,this.mids=[],this.offsetIndex=0,this.loading=!1,this.loadedBottom=!1,this.loadedTop=!1,this.scrollDownListenerSetter=null,this.hidden=!1,this.getCurrentIndexPromise=null,this.listenerSetter=new U.Z,this.log=(0,r.kg)("PM"),this.debug=!0,this.isStatic=!1;const s=new O.Z("pinned-message",t.animationGroup);this.pinnedMessageContainer=new M({topbar:e,chat:t,listenerSetter:this.listenerSetter,className:"message",divAndCaption:s,onClose:()=>V(this,void 0,void 0,(function*(){return(yield i.appPeersManager.canPinMessage(this.chat.peerId))?new R.Z(this.chat.peerId,this.pinnedMid,!0):new R.Z(this.chat.peerId,0,!0),!1}))}),this.pinnedMessageBorder=new N,s.border.replaceWith(this.pinnedMessageBorder.render(1,0)),this.animatedSubtitle=new K,s.subtitle.append(this.animatedSubtitle.container),this.animatedMedia=new K,this.animatedMedia.container.classList.add("pinned-message-media-container"),s.content.prepend(this.animatedMedia.container),this.animatedCounter=new W(!0),s.title.append((0,T.ag)("PinnedMessage")," ",this.animatedCounter.container);const n=this.pinnedMessageContainer.btnClose.cloneNode(!0);this.pinnedMessageContainer.attachOnCloseEvent(n),s.container.prepend(n),this.btnOpen=(0,v.Z)("pinlist pinned-container-close pinned-message-pinlist",{noRipple:!0}),this.pinnedMessageContainer.wrapperUtils.prepend(this.btnOpen),(0,L.fc)(this.btnOpen,(e=>{(0,C.Z)(e),this.topbar.openPinned(!0)}),{listenerSetter:this.listenerSetter}),this.listenerSetter.add(d.Z)("peer_pinned_messages",(({peerId:e})=>{e===this.chat.peerId&&(this.hidden&&this.pinnedMessageContainer.toggle(this.hidden=!1),this.loadedTop=this.loadedBottom=!1,this.pinnedIndex=-1,this.pinnedMid=0,this.count=0,this.mids=[],this.offsetIndex=0,this.pinnedMaxMid=0,this.setCorrectIndex(0))})),this.listenerSetter.add(d.Z)("peer_pinned_hidden",(({peerId:e})=>{e===this.chat.peerId&&this.pinnedMessageContainer.toggle(this.hidden=!0)})),this.setPinnedMessage=(0,j.Z)((()=>this._setPinnedMessage()),100,!0,!0),this.setCorrectIndexThrottled=(0,G.Z)(this.setCorrectIndex.bind(this),100,!1),this.isStatic=!this.chat.isPinnedMessagesNeeded()}destroy(){this.pinnedMessageContainer.divAndCaption.container.remove(),this.pinnedMessageContainer.toggle(!0),this.listenerSetter.removeAll(),this.unsetScrollDownListener(!1)}setCorrectIndex(e){if(this.isStatic)return;if(this.locked||this.hidden)return;if((this.loadedBottom||this.loadedTop)&&!this.count)return;const t=this.chat.bubbles.getBubbleByPoint("bottom");if(!t)return;const i=t.dataset.mid;t&&void 0!==i&&this.testMid(+i,e)}testMid(e,t){if(this.isStatic)return;if(this.hidden)return;let i=this.mids.findIndex((t=>t<=e));if(-1===i||this.isNeededMore(i)){if(!(this.loadedTop&&ei))return;this.pinnedIndex=i,this.pinnedMid=this.mids.find((t=>t<=e))||this.mids[this.mids.length-1],this.setPinnedMessage()}}isNeededMore(e){return this.count>$.LOAD_COUNT&&(!this.loadedBottom&&e<=$.LOAD_OFFSET||!this.loadedTop&&this.count-1-e<=$.LOAD_OFFSET)}getCurrentIndex(e,t=!0){return V(this,void 0,void 0,(function*(){if(!this.loading){this.loading=!0;try{const i=this.debug?this.log.bindPrefix("getCurrentIndex"):void 0;i&&i("start",e,t);let s=!1;const n=[this.managers.appMessagesManager.getSearch({peerId:this.chat.peerId,inputFilter:{_:"inputMessagesFilterPinned"},maxId:e,limit:$.LOAD_COUNT,backLimit:$.LOAD_COUNT,threadId:this.chat.threadId}).then((e=>(s=!0,e)))];if(!this.pinnedMaxMid){const e=this.managers.appMessagesManager.getPinnedMessage(this.chat.peerId,this.chat.threadId).then((e=>{e.maxId&&(this.pinnedMaxMid=e.maxId,!s&&t&&(this.mids=[this.pinnedMaxMid],this.count=e.count,this.pinnedIndex=0,this.pinnedMid=this.mids[0],this.setPinnedMessage()))}));n.push(e)}const a=(yield Promise.all(n))[0];let o=a.history.findIndex((t=>t.mid<=e));-1===o&&(o=a.history.length),this.offsetIndex=a.offset_id_offset?a.offset_id_offset-o:0,this.mids=a.history.map((e=>e.mid)).slice(),this.count=a.count,this.count||this.pinnedMessageContainer.toggle(!0),this.loadedTop=this.offsetIndex+this.mids.length===this.count,this.loadedBottom=!this.offsetIndex,i&&i("result",e,a,o,this.offsetIndex,this.loadedTop,this.loadedBottom)}catch(e){this.log.error("getCurrentIndex error",e)}this.loading=!1,this.locked?this.testMid(e):t&&this.setCorrectIndex(0),this.getCurrentIndexPromise=null}}))}setScrollDownListener(){this.waitForScrollBottom=!0,this.scrollDownListenerSetter||(this.scrollDownListenerSetter=new U.Z,function(e,t,i,s){if(z.Z){let t;const n={passive:!0};s.add(e)("touchstart",(i=>{i.touches.length>1?o():(t=i.touches[0].clientY,s.add(e)("touchmove",a,n),s.add(e)("touchend",o,n))}),n);const a=e=>{const s=e.touches[0].clientY,n=s{s.removeManual(e,"touchmove",a,n),s.removeManual(e,"touchend",o,n)}}else s.add(e)("wheel",(e=>{const t=e.deltaY>0;!t||i()}),{passive:!0})}(this.chat.bubbles.scrollable.container,0,(()=>{this.unsetScrollDownListener()}),this.scrollDownListenerSetter))}unsetScrollDownListener(e=!0){this.waitForScrollBottom=!1,this.scrollDownListenerSetter&&(this.scrollDownListenerSetter.removeAll(),this.scrollDownListenerSetter=null),e&&this.setCorrectIndex(0)}handleFollowingPinnedMessage(){return V(this,void 0,void 0,(function*(){this.locked=!0,this.debug&&this.log("handleFollowingPinnedMessage");try{this.setScrollDownListener();const e=this.chat.setPeerPromise;e instanceof Promise&&(yield e),yield(0,H.e9)(),this.getCurrentIndexPromise&&(yield this.getCurrentIndexPromise),this.debug&&this.log("handleFollowingPinnedMessage: unlock"),this.locked=!1}catch(e){this.log.error("handleFollowingPinnedMessage error:",e),this.locked=!1,this.waitForScrollBottom=!1,this.setCorrectIndex(0)}}))}followPinnedMessage(e){return V(this,void 0,void 0,(function*(){(yield this.chat.getMessage(e))&&(this.chat.setMessageId(e),(this.chat.setPeerPromise||Promise.resolve()).then((()=>{this.handleFollowingPinnedMessage(),this.testMid(this.pinnedIndex>=this.count-1?this.pinnedMaxMid:e-1)})))}))}_setPinnedMessage(){return V(this,void 0,void 0,(function*(){const e=this.count;if(e){const t=this.pinnedIndex,i=yield this.chat.getMessage(this.pinnedMid),s=0===t;this.animatedCounter.container.classList.toggle("is-last",s),s||this.animatedCounter.setCount(e-t),this.pinnedMessageContainer.toggle(!1);const n=t>this.wasPinnedIndex;this.debug&&this.log("setPinnedMessage: fromTop",n,t,this.wasPinnedIndex);const a=this.animatedSubtitle.getRow(t),o=this.animatedMedia.getRow(t);o.classList.add("pinned-message-media");const r=[],d=yield(0,O.o)({title:void 0,titleEl:null,subtitle:i.message,subtitleEl:a,message:i,mediaEl:o,loadPromises:r,animationGroup:this.chat.animationGroup});yield Promise.all(r),this.pinnedMessageContainer.divAndCaption.container.classList.toggle("is-media",d),this.animatedSubtitle.animate(t,this.wasPinnedIndex),d?(this.animatedMedia.animate(t,this.wasPinnedMediaIndex),this.wasPinnedMediaIndex=t):this.animatedMedia.clearRows(),this.pinnedMessageBorder.render(e,e-t-1),this.wasPinnedIndex=t,this.pinnedMessageContainer.divAndCaption.container.dataset.mid=""+i.mid}else this.pinnedMessageContainer.toggle(!0),this.wasPinnedIndex=0;this.pinnedMessageContainer.divAndCaption.container.classList.toggle("is-many",this.count>1)}))}}$.LOAD_COUNT=50,$.LOAD_OFFSET=5;var q=i(6194),Y=i(5824),Q=i(8497),X=i(8799),J=i(4668),ee=i(2796),te=i(2995),ie=i(8127),se=i(4240),ne=i(6818),ae=i(993),oe=i(3897),re=i(7120),de=i(7362),le=i(2059),ce=i(3855),he=i(9405),ue=i(1507),pe=i(2559),fe=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class me{constructor(e,t,i){this.chat=e,this.appSidebarRight=t,this.managers=i,this.verifyButtons=e=>{const t=!!e||!(!this.btnMore||!this.btnMore.classList.contains("menu-open"));e&&(0,C.Z)(e),(()=>{fe(this,void 0,void 0,(function*(){const e=this.buttonsToVerify.concat(t?this.menuButtons:[]);(yield Promise.all(e.map((e=>fe(this,void 0,void 0,(function*(){return{result:yield e.verify(),button:e}})))))).forEach((({button:e,result:t})=>{e.element.classList.toggle("hide",!t)}))}))})()},this.verifyVideoChatButton=e=>fe(this,void 0,void 0,(function*(){var t;if(!ne.Z||this.peerId.isUser()||"chat"!==this.chat.type||this.chat.threadId)return!1;const i=le.ZP.groupCall,s=this.peerId.toChatId();if((null==i?void 0:i.chatId)===s)return!1;if(e&&((yield this.managers.appPeersManager.isBroadcast(this.peerId))&&"group"===e||(yield this.managers.appPeersManager.isAnyGroup(this.peerId))&&"broadcast"===e))return!1;const n=yield this.managers.appChatsManager.getChat(s);return(null===(t=n.pFlags)||void 0===t?void 0:t.call_active)||(0,re.Z)(n,"manage_call")})),this.verifyCallButton=e=>fe(this,void 0,void 0,(function*(){if(!ae.Z||!this.peerId.isUser())return!1;const t=this.peerId.toUserId(),i=yield this.managers.appProfileManager.getCachedFullUser(t);return!!i&&!!("voice"===e?i.pFlags.phone_calls_available:i.pFlags.video_calls_available)})),this.onJoinGroupCallClick=()=>{this.chat.appImManager.joinGroupCall(this.peerId)},this.onMuteClick=()=>{new oe.Z(this.peerId)},this.onResize=()=>{this.setUtilsWidth(!0),this.setFloating()},this.onChangeScreen=(e,t)=>{this.container.classList.toggle("is-pinned-floating",o.Z.isMobile),this.pinnedMessage&&this.pinnedMessage.pinnedMessageContainer.divAndCaption.container.classList.toggle("is-floating",t===o._.mobile),this.onResize()},this.setUtilsWidth=(e=!1)=>{this.setUtilsRAF&&window.cancelAnimationFrame(this.setUtilsRAF),f.IS_SAFARI&&e&&this.chatUtils.classList.add("hide"),this.setUtilsRAF=window.requestAnimationFrame((()=>{f.IS_SAFARI&&e&&this.chatUtils.classList.remove("hide");const t=this.chatUtils.getBoundingClientRect().width;this.chat.log("utils width:",t),this.container.style.setProperty("--utils-width",t+"px"),this.setUtilsRAF=0}))},this.setFloating=()=>{var e;const t=[this.chatAudio,null===(e=this.pinnedMessage)||void 0===e?void 0:e.pinnedMessageContainer].filter(Boolean).reduce(((e,t)=>{const i=t.isFloating();return this.container.classList.toggle(`is-pinned-${t.className}-floating`,i),t.isVisible()?e+ +i:e}),0);this.container.dataset.floating=""+t},this.setPeerStatusManual=(e=!1)=>fe(this,void 0,void 0,(function*(){if(!this.subtitle||"chat"!==this.chat.type)return;if(this.chat.threadId){const e=yield(0,de.Z)({peerId:this.peerId,dialog:!0}),t=(0,T.ag)("TopicProfileStatus",[e]);return()=>(0,Z.Z)(this.subtitle,t)}const t=this.peerId;return this.chat.appImManager.setPeerStatus({peerId:t,element:this.subtitle,needClear:e,useWhitespace:!1,middleware:()=>t===this.peerId})})),this.setPeerStatus=e=>this.setPeerStatusManual(e).then((e=>{null==e||e()})),this.listenerSetter=new U.Z,this.menuButtons=[],this.buttonsToVerify=[]}construct(){this.container=document.createElement("div"),this.container.classList.add("sidebar-header","topbar","hide"),this.container.dataset.floating="0",this.btnBack=(0,v.Z)("left sidebar-close-button",{noRipple:!0}),this.btnBackBadge=document.createElement("span"),this.btnBackBadge.classList.add("badge","badge-20","badge-primary","back-unread-badge"),this.btnBack.append(this.btnBackBadge),this.chatInfoContainer=document.createElement("div"),this.chatInfoContainer.classList.add("chat-info-container"),this.chatInfo=document.createElement("div"),this.chatInfo.classList.add("chat-info");const e=this.person=document.createElement("div");e.classList.add("person");const t=document.createElement("div");t.classList.add("content");const i=document.createElement("div");i.classList.add("top"),this.title=document.createElement("div"),this.title.classList.add("user-title"),i.append(this.title);const s=document.createElement("div");s.classList.add("bottom"),this.subtitle&&s.append(this.subtitle),t.append(i,s),this.avatarElement&&e.append(this.avatarElement),e.append(t),this.chatInfo.append(e),this.chatUtils=document.createElement("div"),this.chatUtils.classList.add("chat-utils"),this.chatAudio=new F(this,this.chat,this.managers),this.menuButtons.length&&(this.btnMore=(0,b.Z)({listenerSetter:this.listenerSetter,direction:"bottom-left",buttons:this.menuButtons,onOpen:(e,t)=>fe(this,void 0,void 0,(function*(){const e=this.menuButtons[this.menuButtons.length-1];if(null==e?void 0:e.element){const t=yield this.managers.appPeersManager.getDeleteButtonText(this.peerId);e.element.lastChild.replaceWith((0,T.ag)(t))}}))})),this.chatUtils.append(...[this.pinnedMessage?this.pinnedMessage.pinnedMessageContainer.divAndCaption.container:null,this.btnJoin,this.btnPinned,this.btnCall,this.btnGroupCall,this.btnMute,this.btnSearch,this.btnMore].filter(Boolean)),this.pushButtonToVerify(this.btnCall,this.verifyCallButton.bind(this,"voice")),this.pushButtonToVerify(this.btnGroupCall,this.verifyVideoChatButton),this.chatInfoContainer.append(this.btnBack,this.chatInfo,this.chatUtils),this.container.append(this.chatInfoContainer),this.chatAudio&&this.container.append(this.chatAudio.divAndCaption.container),this.listenerSetter.add(window)("resize",this.onResize),this.listenerSetter.add(o.Z)("changeScreen",this.onChangeScreen),(0,L.fc)(this.container,(e=>{const t=(0,Q.Z)(e.target,"pinned-container");if((0,X.Z)(),t){if((0,C.Z)(e),(0,Q.Z)(e.target,"progress-line")||(0,Q.Z)(e.target,"pinned-container-wrapper-utils"))return;const i=+t.dataset.mid;if(t.classList.contains("pinned-message"))this.pinnedMessage.followPinnedMessage(i);else{const e=t.dataset.peerId.toPeerId(),s=y.Z.getSearchContext();this.chat.appImManager.setInnerPeer({peerId:e,lastMsgId:i,type:s.isScheduled?"scheduled":s.threadId?"discussion":void 0,threadId:s.threadId})}}else o.Z.activeScreen===o._.medium&&document.body.classList.contains(n.ir)?r():(0,J.Z)(e.target,"AVATAR-ELEMENT")?this.appSidebarRight.toggleSidebar(!document.body.classList.contains(a.HQ)):this.appSidebarRight.toggleSidebar(!0)}),{listenerSetter:this.listenerSetter});const r=e=>{if(e&&(0,C.Z)(e),o.Z.activeScreen===o._.medium&&document.body.classList.contains(n.ir))this.chat.appImManager.setPeer({peerId:this.peerId});else{const e=0===this.chat.appImManager.chats.indexOf(this.chat);Y.Z.back(e?"im":"chat")}};(0,L.fc)(this.btnBack,r,{listenerSetter:this.listenerSetter})}pushButtonToVerify(e,t){e&&this.buttonsToVerify.push({element:e,verify:t})}constructUtils(){this.menuButtons=[{icon:"search",text:"Search",onClick:()=>{this.chat.initSearch()},verify:()=>o.Z.isMobile},{icon:"mute",text:"ChatList.Context.Mute",onClick:this.onMuteClick,verify:()=>fe(this,void 0,void 0,(function*(){return"chat"===this.chat.type&&d.Z.myId!==this.peerId&&!(yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:this.peerId,respectType:!1,threadId:this.chat.threadId}))}))},{icon:"unmute",text:"ChatList.Context.Unmute",onClick:()=>{this.managers.appMessagesManager.togglePeerMute({peerId:this.peerId,threadId:this.chat.threadId})},verify:()=>fe(this,void 0,void 0,(function*(){return"chat"===this.chat.type&&d.Z.myId!==this.peerId&&(yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:this.peerId,respectType:!1,threadId:this.chat.threadId}))}))},{icon:"comments",text:"ViewDiscussion",onClick:()=>{const e=this.chat.bubbles.getMiddleware();Promise.resolve(this.managers.appProfileManager.getChannelFull(this.peerId.toChatId())).then((t=>{e()&&t.linked_chat_id&&this.chat.appImManager.setInnerPeer({peerId:t.linked_chat_id.toPeerId(!0)})}))},verify:()=>fe(this,void 0,void 0,(function*(){const e=yield this.managers.appProfileManager.getCachedFullChat(this.peerId.toChatId());return"chat"===this.chat.type&&!!(null==e?void 0:e.linked_chat_id)}))},{icon:"phone",text:"Call",onClick:this.onCallClick.bind(this,"voice"),verify:this.verifyCallButton.bind(this,"voice")},{icon:"videocamera",text:"VideoCall",onClick:this.onCallClick.bind(this,"video"),verify:this.verifyCallButton.bind(this,"video")},{icon:"videochat",text:"PeerInfo.Action.LiveStream",onClick:this.onJoinGroupCallClick,verify:this.verifyVideoChatButton.bind(this,"broadcast")},{icon:"videochat",text:"PeerInfo.Action.VoiceChat",onClick:this.onJoinGroupCallClick,verify:this.verifyVideoChatButton.bind(this,"group")},{icon:"select",text:"Chat.Menu.SelectMessages",onClick:()=>{const e=this.chat.selection;e.toggleSelection(!0,!0),ce.Z.getState().then((t=>{if(t.chatContextMenuHintWasShown)return;const i=e.toggleByElement.bind(e);e.toggleByElement=t=>fe(this,void 0,void 0,(function*(){this.managers.appStateManager.pushToState("chatContextMenuHintWasShown",!0),(0,ee.Am)((0,T.ag)("Chat.Menu.Hint")),e.toggleByElement=i,e.toggleByElement(t)}))}))},verify:()=>!this.chat.selection.isSelecting&&!!this.chat.bubbles.getRenderedLength()},{icon:"select",text:"Chat.Menu.ClearSelection",onClick:()=>{this.chat.selection.cancelSelection()},verify:()=>this.chat.selection.isSelecting},{icon:"adduser",text:"AddContact",onClick:()=>{if(!this.appSidebarRight.isTabExists(se.Z)){const e=this.appSidebarRight.createTab(se.Z);e.peerId=this.peerId,e.open(),this.appSidebarRight.toggleSidebar(!0)}},verify:()=>fe(this,void 0,void 0,(function*(){return this.peerId.isUser()&&!(yield this.managers.appPeersManager.isContact(this.peerId))}))},{icon:"forward",text:"ShareContact",onClick:()=>{const e=this.peerId;new te.Z({peerTypes:["dialogs","contacts"],onSelect:t=>new Promise(((i,s)=>{new ie.Z("",{titleLangKey:"SendMessageTitle",descriptionLangKey:"SendContactToGroupText",descriptionLangArgs:[new P.Z({peerId:t,dialog:!0}).element],buttons:[{langKey:"Send",callback:()=>{i(),this.managers.appMessagesManager.sendContact(t,e),this.chat.appImManager.setInnerPeer({peerId:t})}},{langKey:"Cancel",callback:()=>{s()},isCancel:!0}],peerId:t,overlayClosable:!0}).show()})),placeholder:"ShareModal.Search.Placeholder",chatRightsActions:["send_plain"],selfPresence:"ChatYourSelf"})},verify:()=>fe(this,void 0,void 0,(function*(){return d.Z.myId!==this.peerId&&this.peerId.isUser()&&(yield this.managers.appPeersManager.isContact(this.peerId))&&!!(yield this.managers.appUsersManager.getUser(this.peerId.toUserId())).phone}))},{icon:"bots",text:"Settings",onClick:()=>{this.managers.appMessagesManager.sendText(this.peerId,"/settings")},verify:()=>fe(this,void 0,void 0,(function*(){var e;try{const t=yield this.managers.appAttachMenuBotsManager.getAttachMenuBot(this.peerId.toUserId());return!!(null===(e=null==t?void 0:t.pFlags)||void 0===e?void 0:e.has_settings)}catch(e){return!1}}))},{icon:"lock",text:"BlockUser",onClick:()=>{new ie.Z("",{peerId:this.peerId,titleLangKey:"BlockUser",descriptionLangKey:"AreYouSureBlockContact2",descriptionLangArgs:[new P.Z({peerId:this.peerId}).element],buttons:[{langKey:"BlockUser",isDanger:!0,callback:()=>{this.managers.appUsersManager.toggleBlock(this.peerId,!0).then((e=>{e&&(0,ee.bC)({langPackKey:"UserBlocked"})}))}}]}).show()},verify:()=>fe(this,void 0,void 0,(function*(){var e;if(!this.peerId.isUser())return!1;const t=yield this.managers.appProfileManager.getCachedFullUser(this.peerId.toUserId());return this.peerId!==d.Z.myId&&t&&!(null===(e=t.pFlags)||void 0===e?void 0:e.blocked)}))},{icon:"lockoff",text:"Unblock",onClick:()=>{this.managers.appUsersManager.toggleBlock(this.peerId,!1).then((e=>{e&&(0,ee.bC)({langPackKey:"UserUnblocked"})}))},verify:()=>fe(this,void 0,void 0,(function*(){var e;const t=yield this.managers.appProfileManager.getCachedFullUser(this.peerId.toUserId());return!!(null===(e=null==t?void 0:t.pFlags)||void 0===e?void 0:e.blocked)}))},{icon:"delete danger",text:"Delete",onClick:()=>{new q.Z(this.peerId)},verify:()=>fe(this,void 0,void 0,(function*(){return"chat"===this.chat.type&&!!(yield this.managers.appMessagesManager.getDialogOnly(this.peerId))}))}],this.btnSearch=(0,v.Z)("search"),this.attachClickEvent(this.btnSearch,(e=>{this.chat.initSearch()}),!0)}attachClickEvent(e,t,i){(0,L.fc)(e,(e=>{(0,C.Z)(e),!i&&(0,X.Z)(),t(e)}),{listenerSetter:this.listenerSetter})}onCallClick(e){this.chat.appImManager.callUser(this.peerId.toUserId(),e)}constructAvatar(){const e=new m.Z;return e.isDialog=!0,e.classList.add("avatar-42","person-avatar"),e}get peerId(){return this.chat.peerId}constructPeerHelpers(){return this.avatarElement=this.constructAvatar(),this.subtitle=document.createElement("div"),this.subtitle.classList.add("info"),this.pinnedMessage=new $(this,this.chat,this.managers),this.btnJoin=(0,g.Z)("btn-primary btn-color-primary chat-join hide"),this.btnCall=(0,v.Z)("phone"),this.btnGroupCall=(0,v.Z)("videochat"),this.btnPinned=(0,v.Z)("pinlist"),this.btnMute=(0,v.Z)("mute"),this.attachClickEvent(this.btnCall,this.onCallClick.bind(this,"voice")),this.attachClickEvent(this.btnGroupCall,this.onJoinGroupCallClick),this.attachClickEvent(this.btnPinned,(()=>{this.openPinned(!0)})),this.attachClickEvent(this.btnMute,this.onMuteClick),this.attachClickEvent(this.btnJoin,(()=>fe(this,void 0,void 0,(function*(){const e=this.chat.bubbles.getMiddleware();this.btnJoin.setAttribute("disabled","true");const t=this.peerId.toChatId();let i;i=(yield this.managers.appChatsManager.isChannel(t))?this.managers.appChatsManager.joinChannel(t):this.managers.appChatsManager.addChatUser(t,d.Z.myId),i.finally((()=>{e()&&this.btnJoin.removeAttribute("disabled")}))})))),this.listenerSetter.add(d.Z)("folder_unread",(e=>{if(e.id!==ue.J$)return;const t=e.unreadUnmutedPeerIds.size;this.btnBackBadge.textContent=t?""+(0,pe.Z)(t,1):""})),this.listenerSetter.add(d.Z)("chat_update",(e=>fe(this,void 0,void 0,(function*(){var t;if(this.peerId===e.toPeerId(!0)){const i=yield this.managers.appChatsManager.getChat(e);this.btnJoin.classList.toggle("hide",!(null===(t=null==i?void 0:i.pFlags)||void 0===t?void 0:t.left)),this.setUtilsWidth(),this.verifyButtons()}})))),this.listenerSetter.add(d.Z)("dialog_notify_settings",(e=>{e.peerId===this.peerId&&this.setMutedState()})),this.listenerSetter.add(d.Z)("peer_typings",(({peerId:e})=>{this.peerId===e&&this.setPeerStatus()})),this.listenerSetter.add(d.Z)("user_update",(e=>{this.peerId===e.toPeerId()&&this.setPeerStatus()})),this.listenerSetter.add(d.Z)("peer_full_update",(e=>{this.peerId===e&&this.verifyButtons()})),this.chat.addEventListener("setPeer",((e,t)=>{const i=this.chat.bubbles.getMiddleware();ce.Z.getState().then((s=>{i()&&this.pinnedMessage&&(this.pinnedMessage.hidden=!!s.hiddenPinnedMessages[this.chat.peerId],t?(this.pinnedMessage.unsetScrollDownListener(),this.pinnedMessage.testMid(e,0)):this.pinnedMessage.locked||(this.pinnedMessage.handleFollowingPinnedMessage(),this.pinnedMessage.testMid(e)))}))})),this.listenerSetter.add(d.Z)("peer_pinned_messages",(({peerId:e,mids:t})=>{"pinned"===this.chat.type&&e===this.peerId&&t&&this.setTitle()})),this.setPeerStatusInterval=window.setInterval(this.setPeerStatus,6e4),this}openPinned(e){this.chat.appImManager.setInnerPeer({peerId:this.peerId,lastMsgId:e?+this.pinnedMessage.pinnedMessageContainer.divAndCaption.container.dataset.mid:0,type:"pinned"})}destroy(){var e,t;this.listenerSetter.removeAll(),window.clearInterval(this.setPeerStatusInterval),null===(e=this.pinnedMessage)||void 0===e||e.destroy(),null===(t=this.chatAudio)||void 0===t||t.destroy(),delete this.chatAudio,delete this.pinnedMessage}cleanup(){this.chat.peerId||this.container.classList.add("hide")}finishPeerChange(e){var t;return fe(this,void 0,void 0,(function*(){const{peerId:e,threadId:i}=this.chat;let s;"chat"===this.chat.type&&(s=(null===(t=this.avatarElement)||void 0===t?void 0:t.peerId)!==this.peerId||this.avatarElement.threadId!==this.chat.threadId?this.constructAvatar():this.avatarElement);const[n,a,o,r,d,l,c]=yield Promise.all([this.managers.appPeersManager.isBroadcast(e),this.managers.appPeersManager.isAnyChat(e),e.isAnyChat()?this.managers.appChatsManager.getChat(e.toChatId()):void 0,s?s.updateWithOptions({peerId:e,threadId:i,wrapOptions:{customEmojiSize:(0,he.C)(32,32)}}):void 0,this.setTitleManual(),this.setPeerStatusManual(!0),ce.Z.getState()]);return()=>{var t,i;const r=!("pinned"===this.chat.type||"scheduled"===this.chat.type);this.btnMute&&this.btnMute.classList.toggle("hide",!n||!r),this.btnJoin&&(a&&!this.chat.isRestricted&&r?((0,Z.Z)(this.btnJoin,(0,T.ag)(n?"Chat.Subscribe":"ChannelJoin")),this.btnJoin.classList.toggle("hide",!(null===(t=null==o?void 0:o.pFlags)||void 0===t?void 0:t.left))):this.btnJoin.classList.add("hide")),this.btnSearch&&this.btnSearch.classList.toggle("hide",!r),this.btnPinned&&this.btnPinned.classList.toggle("hide",!r),this.avatarElement!==s&&(s&&(this.avatarElement?this.avatarElement.replaceWith(s):this.person.prepend(s)),null===(i=this.avatarElement)||void 0===i||i.remove(),this.avatarElement=s),this.setUtilsWidth(),this.verifyButtons(),this.btnMore&&this.btnMore.classList.toggle("hide",!r);const h=this.chat.isPinnedMessagesNeeded();if(h||"discussion"===this.chat.type){if(this.chat.wasAlreadyUsed||!this.pinnedMessage){const e=new $(this,this.chat,this.managers);this.pinnedMessage?(this.pinnedMessage.pinnedMessageContainer.divAndCaption.container.replaceWith(e.pinnedMessageContainer.divAndCaption.container),this.pinnedMessage.destroy()):this.chatUtils.prepend(this.pinnedMessage.pinnedMessageContainer.divAndCaption.container),this.pinnedMessage=e}h?this.pinnedMessage.hidden=!!c.hiddenPinnedMessages[e]:"discussion"===this.chat.type&&(this.pinnedMessage.pinnedMid=this.chat.threadId,this.pinnedMessage.count=1,this.pinnedMessage.pinnedIndex=0,this.pinnedMessage._setPinnedMessage())}else this.pinnedMessage&&(this.pinnedMessage.destroy(),this.pinnedMessage=void 0);d(),null==l||l(),this.subtitle.classList.toggle("hide",!l),this.setMutedState(),this.container.classList.remove("hide")}}))}setTitleManual(e){return fe(this,void 0,void 0,(function*(){const{peerId:t,threadId:i}=this.chat,s=()=>this.chat.bubbles.getMiddleware();let n;if("pinned"===this.chat.type)n=void 0===e?(0,T.ag)("Loading"):(0,T.ag)("PinnedMessagesCount",[e]),void 0===e&&this.managers.appMessagesManager.getSearchCounters(t,[{_:"inputMessagesFilterPinned"}],!1).then((e=>{if(!s())return;const t=e[0].count;if(this.setTitle(t),!t){this.chat.appImManager.setPeer();const e=this.chat.appImManager.chat;e.topbar.pinnedMessage&&e.topbar.pinnedMessage.pinnedMessageContainer.toggle(!0)}}));else if("scheduled"===this.chat.type)n=(0,T.ag)(t===d.Z.myId?"Reminders":"ScheduledMessages");else if("discussion"===this.chat.type){if(void 0===e){const n=yield this.managers.acknowledged.appMessagesManager.getHistory(t,0,1,0,i);if(!s())return;if(n.cached){const t=yield n.result;if(!s())return;e=t.count}else n.result.then((e=>{s()&&this.setTitle(e.count)}))}n=void 0===e?(0,T.ag)("Loading"):(0,T.ag)("Chat.Title.Comments",[e])}else if("chat"===this.chat.type&&([n]=yield Promise.all([(0,de.Z)({peerId:t,dialog:!0,withIcons:!i,threadId:i})]),!s()))return;return()=>{(0,Z.Z)(this.title,n)}}))}setTitle(e){this.setTitleManual(e).then((e=>e()))}setMutedState(){return fe(this,void 0,void 0,(function*(){if(!this.btnMute)return;const e=this.peerId,t=yield this.managers.appNotificationsManager.isPeerLocalMuted({peerId:e,respectType:!1,threadId:this.chat.threadId});(yield this.managers.appPeersManager.isBroadcast(e))?(this.btnMute.classList.remove("tgico-mute","tgico-unmute"),this.btnMute.classList.add(t?"tgico-unmute":"tgico-mute"),this.btnMute.style.display=""):this.btnMute.style.display="none"}))}}var ge=i(9099),ve=i(5884),be=i(3607),ye=i(1168),we=i(2986),Se=i(3552);class Ce extends Se._{constructor(){super(...arguments),this.threadId=0,this.query=""}onOpenAfterTimeout(){this.appSearch.beginSearch(this.peerId,this.threadId,this.query)}init(e,t,i,s){this.container.id="search-private-container",this.container.classList.add("chatlist-container"),this.inputSearch=new be.Z("Search"),this.title.replaceWith(this.inputSearch.container),this.btnPickDate=(0,v.Z)("calendar sidebar-header-right"),this.header.append(this.btnPickDate);const n=document.createElement("div");n.classList.add("chatlist-container"),this.scrollable.container.replaceWith(n),this.appSearch=new ve.Z(n,this.inputSearch,{messages:new ve.z("Chat.Search.PrivateSearch","messages")}),this.peerId?this.appSearch.beginSearch(this.peerId,this.threadId,s):(this.query=s,this.peerId=e,this.threadId=t,this.onDatePick=i,this.btnPickDate.classList.toggle("hide",!this.onDatePick),this.onDatePick&&(0,L.fc)(this.btnPickDate,(()=>{ye.Z.createPopup(we.Z,new Date,this.onDatePick).show()})),s&&this.appSearch.searchInput.inputField.setValueSilently(s),a.ZP.toggleSidebar(!0))}}var Le=i(6740),Ee=i(2648),Ie=i(5005);class Me{constructor(e,t,i){this.topbar=e,this.chat=t,this.foundCount=0,this.selectedIndex=0,this.onDateClick=e=>{(0,C.Z)(e),ye.Z.createPopup(we.Z,new Date,this.chat.bubbles.onDatePick).show()},this.onResultsClick=e=>{const t=(0,J.Z)(e.target,Ie.DIALOG_LIST_ELEMENT_TAG);t&&this.selectResult(t)},this.onFooterClick=e=>{this.foundCount&&(this.chat.bubbles.container.classList.toggle("search-results-active"),this.results.classList.toggle("active"))},this.onUpClick=e=>{(0,C.Z)(e),this.selectResult(this.searchGroup.list.children[this.selectedIndex+1])},this.onDownClick=e=>{(0,C.Z)(e),this.selectResult(this.searchGroup.list.children[this.selectedIndex-1])},this.element=document.createElement("div"),this.element.classList.add("sidebar-header","chat-search","chatlist-container"),this.backBtn=document.createElement("button"),this.backBtn.classList.add("btn-icon","tgico-left","sidebar-close-button"),(0,S.Z)(this.backBtn);const s=this.listenerSetter=new U.Z,n=(e,t)=>{(0,L.fc)(e,t,{listenerSetter:s})};n(this.backBtn,(()=>{this.destroy()})),this.inputSearch=new be.Z("Search"),this.results=document.createElement("div"),this.results.classList.add("chat-search-results","chatlist-container"),this.searchGroup=new ve.z(!1,"messages",void 0,"",!1),n(this.searchGroup.list,this.onResultsClick),this.appSearch=new ve.Z(this.results,this.inputSearch,{messages:this.searchGroup},(e=>{this.foundCount=e,this.foundCount?this.selectResult(this.searchGroup.list.children[0]):((0,Z.Z)(this.foundCountEl,this.inputSearch.value?(0,T.ag)("NoResult"):""),this.results.classList.remove("active"),this.chat.bubbles.container.classList.remove("search-results-active"),this.upBtn.setAttribute("disabled","true"),this.downBtn.setAttribute("disabled","true"))})),this.appSearch.beginSearch(this.chat.peerId,this.chat.threadId),this.chat.bubbles.container.append(this.results),this.footer=document.createElement("div"),this.footer.classList.add("chat-search-footer"),n(this.footer,this.onFooterClick),(0,S.Z)(this.footer),this.foundCountEl=document.createElement("span"),this.foundCountEl.classList.add("chat-search-count"),this.dateBtn=document.createElement("button"),this.dateBtn.classList.add("btn-icon","tgico-calendar"),this.controls=document.createElement("div"),this.controls.classList.add("chat-search-controls"),this.upBtn=document.createElement("button"),this.upBtn.classList.add("btn-icon","tgico-up"),this.downBtn=document.createElement("button"),this.downBtn.classList.add("btn-icon","tgico-down"),this.upBtn.setAttribute("disabled","true"),this.downBtn.setAttribute("disabled","true"),n(this.dateBtn,this.onDateClick),n(this.upBtn,this.onUpClick),n(this.downBtn,this.onDownClick),this.controls.append(this.upBtn,this.downBtn),this.footer.append(this.foundCountEl,this.dateBtn,this.controls),this.topbar.container.parentElement.insertBefore(this.footer,t.input.chatInput),this.element.append(this.backBtn,this.inputSearch.container),this.topbar.container.classList.add("hide-pinned"),this.topbar.container.parentElement.append(this.element),this.inputSearch.input.focus(),i&&this.setQuery(i),f.IS_MOBILE_SAFARI||(this.navigationItem={type:"mobile-search",onPop:()=>{this.destroy()}},Y.Z.pushItem(this.navigationItem))}destroy(){this.topbar.container.classList.remove("hide-pinned"),this.element.remove(),this.inputSearch.remove(),this.results.remove(),this.footer.remove(),this.listenerSetter.removeAll(),this.chat.bubbles.container.classList.remove("search-results-active"),this.chat.search=void 0,Y.Z.removeItem(this.navigationItem)}setQuery(e){this.inputSearch.inputField.value=e}selectResult(e){if(this.setPeerPromise)return this.setPeerPromise;const t=e.dataset.peerId.toPeerId(),i=+e.dataset.mid||void 0,s=(0,Ee.Z)(e);s===this.foundCount-1?this.upBtn.setAttribute("disabled","true"):this.upBtn.removeAttribute("disabled"),s?this.downBtn.removeAttribute("disabled"):this.downBtn.setAttribute("disabled","true"),this.results.classList.remove("active"),this.chat.bubbles.container.classList.remove("search-results-active");const n=this.chat.setPeer({peerId:t,lastMsgId:i});this.setPeerPromise=(n instanceof Promise?n:Promise.resolve(n)).then((()=>{this.selectedIndex=s,(0,Z.Z)(this.foundCountEl,(0,T.ag)("Of",[s+1,this.foundCount]));const e=this.searchGroup.list.childElementCount;this.selectedIndex>=e-6&&this.appSearch.searchMore()})).finally((()=>{this.setPeerPromise=null}))}}var Ze=i(1571),Pe=i(1655),Te=i(6848),ke=i(241),xe=i(356);class Ae{constructor(){this.canvases=new Set}static getInstance(e){let t=this.INSTANCES.find((t=>(0,Te.Z)(t.options,e)));return t||(t=new Ae,t.init(e),this.INSTANCES.push(t)),t}init(e){this.options=e}renderToCanvas(e){return this.renderImageFromUrl(this.options.url).then((()=>this.fillCanvas(e)))}renderImageFromUrl(e){if(this.renderImageFromUrlPromise)return this.renderImageFromUrlPromise;const t=this.image=document.createElement("img");return t.crossOrigin="anonymous",this.renderImageFromUrlPromise=(0,Le.cj)(t,e,!1).then((()=>xe.Z?createImageBitmap(t,{resizeWidth:1440,resizeHeight:2960}).then((e=>(this.imageBitmap=e,t))):t))}cleanup(e){var t;this.canvases.delete(e),this.canvases.size||((0,Pe.Z)(Ae.INSTANCES,this),this.objectUrl&&(null===(t=this.imageBitmap)||void 0===t||t.close(),URL.revokeObjectURL(this.objectUrl)))}fillCanvas(e){const t=e.getContext("2d"),{width:i,height:s}=e,n=this.imageBitmap||this.image;let a=n.width,o=n.height;const r=(500+ke.Z.height/2.5)*e.dpr;a*=r/o,o=r,this.options.mask?(t.fillStyle="#000",t.fillRect(0,0,i,s),t.globalCompositeOperation="destination-out"):t.globalCompositeOperation="source-over";const d=e=>{for(let s=0;s0){let e=l;do{d(e-=o)}while(e>=0)}const c=s-1;for(let e=l+o;ei.resize(e,t))))}}Ae.INSTANCES=[];var _e=i(5418),Fe=i(252),De=i(6714),Re=i(319),Be=i(2064),Ne=i(5994),Oe=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class Ue extends l.Z{constructor(e,t){super(),this.appImManager=e,this.managers=t,this.type="chat",this.animationGroup=`chat-${Math.round(65535*Math.random())}`,this.container=document.createElement("div"),this.container.classList.add("chat","tabs-tab"),this.backgroundEl=document.createElement("div"),this.backgroundEl.classList.add("chat-background"),this.log=(0,r.kg)("CHAT",r.v9.Log|r.v9.Warn|r.v9.Debug|r.v9.Error),this.log.warn("constructor"),this.peerId=ue.NM,this.container.append(this.backgroundEl),this.appImManager.chatsContainer.append(this.container),this.backgroundTempId=0,this.sharedMediaTabs=[]}setBackground(e,t){var i;const s=De.Z.getTheme().settings.wallpaper,n=(0,Be.EM)(s);let a;if(n&&!s.slug&&!s.settings.intensity&&"grabbing"===document.documentElement.style.cursor&&this.gradientRenderer&&!this.patternRenderer)return this.gradientCanvas.dataset.colors=n,this.gradientRenderer.init(this.gradientCanvas),Promise.resolve();const o=++this.backgroundTempId,r=this.gradientRenderer,d=this.patternRenderer,l=(this.gradientCanvas,this.patternCanvas);this.gradientRenderer=this.patternRenderer=this.gradientCanvas=this.patternCanvas=void 0;const c=(null===(i=s.settings)||void 0===i?void 0:i.intensity)&&s.settings.intensity/100,h=!!c&&c<0;let u,p,f,m=null==a?void 0:a.firstElementChild;if(!a)if(a=document.createElement("div"),a.classList.add("chat-background-item"),e)if(c){a.classList.add("is-pattern");const t=this.appImManager.chatsContainer.getBoundingClientRect();u=this.patternRenderer=Ae.getInstance({url:e,width:t.width,height:t.height,mask:h}),m=this.patternCanvas=u.createCanvas(),m.classList.add("chat-background-item-canvas","chat-background-item-pattern-canvas"),h&&a.classList.add("is-dark")}else a.classList.add("is-image");else a.classList.add("is-color");if(n){const{canvas:e,gradientRenderer:t}=Ze.Z.create(n);f=this.gradientRenderer=t,p=this.gradientCanvas=e,p.classList.add("chat-background-item-canvas","chat-background-item-color-canvas"),Ne.Z.isAvailable("animations")&&f.scrollAnimate(!0)}if(u){const e=h?p:m;let t=Math.abs(c)*(h?.5:1);h&&(t=Math.max(.3,t)),e.style.setProperty("--opacity-max",""+t)}const g=new Promise((i=>{const s=()=>{if(this.backgroundTempId!==o)return u&&u.cleanup(m),void(f&&f.cleanup());const e=this.backgroundEl.lastElementChild;if(e===a)return void i();const s=[p,m].filter(Boolean);s.length&&a.append(...s),this.backgroundEl.append(a),(0,ge.Z)({element:a,className:"is-visible",forwards:!0,duration:t?0:200,onTransitionEnd:e?()=>{null==d||d.cleanup(l),null==r||r.cleanup(),e.remove()}:null,useRafs:2}),i()};u?u.renderToCanvas(m).then((()=>{this.backgroundTempId===o&&s()})):e?(0,Le.ZP)(a,e,s):s()}));return this.setBackgroundPromise=Promise.race([(0,_e.Z)(500),g])}setType(e){this.type=e}init(){this.topbar=new me(this,a.ZP,this.managers),this.bubbles=new c.ZP(this,this.managers),this.input=new u.Z(this,this.appImManager,this.managers),this.contextMenu=new h.Z(this,this.managers),this.selection=new p.Z(this,this.bubbles,this.input,this.managers),this.topbar.constructUtils(),this.topbar.constructPeerHelpers(),this.topbar.construct(),this.input.construct(),this.bubbles.constructPeerHelpers(),this.input.constructPeerHelpers(),z.Z||this.bubbles.setReactionsHoverListeners(),this.bubbles.attachContainerListeners(),this.container.append(this.topbar.container,this.bubbles.container,this.input.chatInput),this.bubbles.listenerSetter.add(d.Z)("dialog_migrate",(({migrateFrom:e,migrateTo:t})=>{this.peerId===e&&this.setPeer({peerId:t})})),this.bubbles.listenerSetter.add(d.Z)("dialog_drop",(e=>{e.peerId!==this.peerId||"dialog"!==e._&&this.threadId!==e.id||this.appImManager.setPeer()})),this.bubbles.listenerSetter.add(d.Z)("chat_update",(e=>Oe(this,void 0,void 0,(function*(){const{peerId:t}=this;if(t.isAnyChat()&&t.toChatId()===e){const e=yield this.managers.appMessagesManager.isAnonymousSending(t);t===this.peerId&&(this.isAnonymousSending=e)}}))));const e=e=>{const t=()=>{var t;null===(t=this.bubbles.observer)||void 0===t||t.toggleObservingNew(e),s.Z.toggleIntersectionGroup(this.animationGroup,e),e&&s.Z.checkAnimations(e,this.animationGroup)};e?t():setTimeout((()=>{t()}),400)};this.bubbles.listenerSetter.add(this.appImManager)("chat_changing",(({to:t})=>{e(t!==this)})),this.bubbles.listenerSetter.add(this.appImManager)("tab_changing",(t=>{e(this.appImManager.chat!==this||t!==hs.CHAT&&o.Z.activeScreen===o._.mobile)}))}beforeDestroy(){this.bubbles.cleanup()}cleanupBackground(){++this.backgroundTempId,this.patternRenderer&&(this.patternRenderer.cleanup(this.patternCanvas),this.patternRenderer=void 0),this.gradientRenderer&&(this.gradientRenderer.cleanup(),this.gradientRenderer=void 0)}destroy(){this.destroySharedMediaTab(),this.topbar.destroy(),this.bubbles.destroy(),this.input.destroy(),this.contextMenu&&this.contextMenu.destroy(),this.selection&&this.selection.attachListeners(void 0,void 0),this.cleanupBackground(),delete this.topbar,delete this.bubbles,delete this.input,delete this.selection,delete this.contextMenu,this.container.remove()}cleanup(e=!0){this.input.cleanup(e),this.topbar.cleanup(),this.selection.cleanup()}get isForumTopic(){return!(!this.isForum||!this.threadId)}onChangePeer(e,t){var i;return Oe(this,void 0,void 0,(function*(){const{peerId:s,threadId:n}=this,o=a.ZP.getTab(Ce);null==o||o.close();const[r,d,l,c,h,u,p,f,m,g]=yield t(Promise.all([this.managers.appPeersManager.noForwards(s),this.managers.appPeersManager.isPeerRestricted(s),this._isAnyGroup(s),this.setAutoDownloadMedia(),this.managers.appPeersManager.isMegagroup(s),this.managers.appPeersManager.isBroadcast(s),this.managers.appPeersManager.isChannel(s),this.managers.appPeersManager.isBot(s),this.managers.appPeersManager.isForum(s),this.managers.appMessagesManager.isAnonymousSending(s)]));m&&n&&(yield t(this.managers.dialogsStorage.getForumTopicOrReload(s,n))),this.noForwards=r,this.isRestricted=d,this.isAnyGroup=l,this.isMegagroup=h,this.isBroadcast=u,this.isChannel=p,this.isBot=f,this.isForum=m,this.isAllMessagesForum=m&&!n,this.isAnonymousSending=g,n&&!this.isForum&&(e.type="discussion");const v=null!==(i=e.type)&&void 0!==i?i:"chat";this.setType(v),this.messagesStorageKey=`${this.peerId}_${"scheduled"===this.type?"scheduled":"history"}`,this.container.classList.toggle("no-forwards",this.noForwards),this.sharedMediaTab=a.ZP.createSharedMediaTab(),this.sharedMediaTabs.push(this.sharedMediaTab),this.sharedMediaTab.setPeer(s,n),this.input.clearHelper(),this.selection.cleanup()}))}setPeer(e){const{peerId:t,threadId:i}=e;t?this.inited||(this.init&&(this.init(),this.init=null),this.inited=!0):this.inited=void 0;const s=this.appImManager.isSamePeer(this,e);if(s){if(this.setPeerPromise)return}else this.appImManager.dispatchEvent("peer_changing",this),this.peerId=t||ue.NM,this.threadId=i;if(!t)return a.ZP.toggleSidebar(!1),this.cleanup(!0),this.bubbles.setPeer({samePeer:!1,peerId:t}),this.peerId=0,this.appImManager.dispatchEvent("peer_changed",this),a.ZP.replaceSharedMediaTab(),this.destroySharedMediaTab(),void(this.sharedMediaTab=void 0);this.peerChanged=s;const n=this.bubbles.setPeer(Object.assign(Object.assign({},e),{samePeer:s})),o=this.setPeerPromise=n.then((e=>e.promise)).catch(Re.Z).finally((()=>{this.setPeerPromise===o&&(this.setPeerPromise=null)}));return n}destroySharedMediaTab(e=this.sharedMediaTab){e&&((0,Pe.Z)(this.sharedMediaTabs,e),e.destroy())}setAutoDownloadMedia(){return Oe(this,void 0,void 0,(function*(){this.autoDownload=yield function(e){return t=this,i=void 0,n=function*(){let t,i=0,s=0,n=0;const a=d.Z.settings,o=d.Z.managers.appPeersManager;return!a.autoDownloadNew.pFlags.disabled&&e&&(t=e.isUser()?(yield o.isContact(e))?"contacts":"private":(yield o.isBroadcast(e))?"channels":"groups",a.autoDownload.photo[t]&&(i=a.autoDownloadNew.photo_size_max),a.autoDownload.video[t]&&(s=a.autoDownloadNew.video_size_max),a.autoDownload.file[t]&&(n=a.autoDownloadNew.file_size_max)),{photo:i,video:s,file:n}},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n}(this.peerId)}))}setMessageId(e){return this.setPeer({peerId:this.peerId,threadId:this.threadId,lastMsgId:e})}finishPeerChange(e,t,i,s){return Oe(this,void 0,void 0,(function*(){if(this.peerChanged)return;const t=this.peerId;this.peerChanged=!0,this.wasAlreadyUsed=!0;const i=this.bubbles.getMiddleware();this.cleanup(!1);const n=this.sharedMediaTab,o=Promise.all([this.topbar.finishPeerChange(e),this.bubbles.finishPeerChange(),this.input.finishPeerChange(s),n.fillProfileElements()]),r=yield o;n.loadSidebarMedia(!0),i()&&(r.forEach((e=>{null==e||e()})),a.ZP.replaceSharedMediaTab(n),this.sharedMediaTabs.filter((e=>e!==n)).forEach((e=>this.destroySharedMediaTab(e))),this.container.dataset.type=this.type,this.log.setPrefix("CHAT-"+t+"-"+this.type),this.appImManager.dispatchEvent("peer_changed",this))}))}getMessage(e){return this.managers.appMessagesManager.getMessageFromStorage(this.messagesStorageKey,e)}getMidsByMid(e){return Oe(this,void 0,void 0,(function*(){return this.managers.appMessagesManager.getMidsByMessage(yield this.getMessage(e))}))}getHistoryStorage(e){return this.managers.appMessagesManager.getHistoryStorageTransferable(this.peerId,e?void 0:this.threadId).then((e=>Object.assign(Object.assign({},e),{history:Fe.Z.fromJSON(e.historySerialized)})))}getDialogOrTopic(){return this.isForum&&this.threadId?this.managers.dialogsStorage.getForumTopic(this.peerId,this.threadId):this.managers.dialogsStorage.getDialogOnly(this.peerId)}getHistoryMaxId(){return this.getHistoryStorage().then((e=>e.maxId))}_isAnyGroup(e){return Oe(this,void 0,void 0,(function*(){return e===d.Z.myId||e===ue.hj||(yield this.managers.appPeersManager.isAnyGroup(e))}))}initSearch(e){if(this.peerId)if(o.Z.isMobile)this.search?this.search.setQuery(e):this.search=new Me(this.topbar,this,e);else{let t=a.ZP.getTab(Ce);t||(t=a.ZP.createTab(Ce)),t.open(this.peerId,this.threadId,this.bubbles.onDatePick,e)}}canSend(e){return this.managers.appMessagesManager.canSendToPeer(this.peerId,this.threadId,e)}isStartButtonNeeded(){return Promise.all([this.managers.appPeersManager.isBot(this.peerId),this.managers.appMessagesManager.getDialogOnly(this.peerId),this.getHistoryStorage(!0)]).then((([e,t,i])=>e&&!t&&!i.history.length))}getMessageSendingParams(){return{threadId:this.threadId,replyToMsgId:this.input.replyToMsgId,scheduleDate:this.input.scheduleDate,silent:this.input.sendSilent,sendAsPeerId:this.input.sendAsPeerId,updateStickersetOrder:d.Z.settings.stickers.dynamicPackOrder}}isOurMessage(e){return e.fromId===d.Z.myId||!!e.pFlags.out&&this.isMegagroup}isOutMessage(e){const t=e.fwd_from;return!(!this.isOurMessage(e)||t&&this.peerId===d.Z.myId)}isAvatarNeeded(e){return this.isAnyGroup&&!this.isOutMessage(e)}isPinnedMessagesNeeded(){return"chat"===this.type||this.isForum}}var He=i(805),ze=i(1452),je=i(8204),Ge=i(3228),Ve=i(2342),Ke=i(6637),We=i(7545);class $e{constructor(e){this.appImManager=e,this.buttons={},this.addedListener=!1,this.waitingForMouseUp=!1,this.mouseUpCounter=0,this.onMouseUpSingle=e=>{if(this.waitingForMouseUp=!1,z.Z){if(e&&(0,C.Z)(e),0!=this.mouseUpCounter++)return void this.hide();this.resetSelection(this.savedRange)}this.show()}}init(){this.container=document.createElement("div"),this.container.classList.add("markup-tooltip","z-depth-1","hide"),this.wrapper=document.createElement("div"),this.wrapper.classList.add("markup-tooltip-wrapper");const e=document.createElement("div"),t=document.createElement("div");e.classList.add("markup-tooltip-tools"),t.classList.add("markup-tooltip-tools"),["bold","italic","underline","strikethrough","monospace","spoiler","link"].forEach((t=>{const i=(0,v.Z)(t,{noRipple:!0});e.append(this.buttons[t]=i),"link"!==t?i.addEventListener("mousedown",(e=>{(0,C.Z)(e),this.appImManager.chat.input.applyMarkdown(t),this.cancelClosening()})):(0,L.fc)(i,(e=>{(0,C.Z)(e),this.showLinkEditor(),this.cancelClosening()}))})),this.linkBackButton=(0,v.Z)("left",{noRipple:!0}),this.linkInput=document.createElement("input"),(0,T.$d)(this.linkInput,"MarkupTooltip.LinkPlaceholder",void 0,"placeholder"),this.linkInput.classList.add("input-clear"),this.linkInput.addEventListener("keydown",(e=>{const t=!this.linkInput.value.length||!!(0,Ve.Z)(this.linkInput.value);"Enter"===e.key&&(t?this.applyLink(e):(this.linkInput.classList.contains("error")&&(this.linkInput.classList.remove("error"),this.linkInput.offsetLeft),this.linkInput.classList.add("error")))})),this.linkInput.addEventListener("input",(e=>{const t=this.isLinkValid();this.linkInput.classList.toggle("is-valid",t),this.linkInput.classList.remove("error")})),this.linkBackButton.addEventListener("mousedown",(e=>{(0,C.Z)(e),this.container.classList.remove("is-link"),this.resetSelection(),this.setTooltipPosition(),this.cancelClosening()})),this.linkApplyButton=(0,v.Z)("check markup-tooltip-link-apply",{noRipple:!0}),this.linkApplyButton.addEventListener("mousedown",(e=>{this.applyLink(e)}));const i=document.createElement("div");i.classList.add("markup-tooltip-link-apply-container");const s=document.createElement("span"),n=document.createElement("span"),a=document.createElement("span");s.classList.add("markup-tooltip-delimiter"),n.classList.add("markup-tooltip-delimiter"),a.classList.add("markup-tooltip-delimiter"),e.insertBefore(s,this.buttons.link),i.append(a,this.linkApplyButton),t.append(this.linkBackButton,n,this.linkInput,i),this.wrapper.append(e,t),this.container.append(this.wrapper),document.body.append(this.container),window.addEventListener("resize",(()=>{this.hide()}))}showLinkEditor(){this.container&&this.container.classList.contains("is-visible")||this.show();const e=this.buttons.link;this.container.classList.add("is-link");const t=document.getSelection();if(this.savedRange=t.getRangeAt(0),e.classList.contains("active")){const e=this.savedRange.startContainer.parentElement;this.linkInput.value=e.href}else this.linkInput.value="";this.setTooltipPosition(!0),setTimeout((()=>{this.linkInput.focus()}),200),this.linkInput.classList.toggle("is-valid",this.isLinkValid())}applyLink(e){(0,C.Z)(e),this.resetSelection();let t=this.linkInput.value;t&&!(0,Ke.Z)(t)&&(t="https://"+t),this.appImManager.chat.input.applyMarkdown("link",t),setTimeout((()=>{this.hide()}),0)}isLinkValid(){return!this.linkInput.value.length||!!(0,Ve.Z)(this.linkInput.value)}resetSelection(e=this.savedRange){const t=window.getSelection();t.removeAllRanges(),t.addRange(e),this.appImManager.chat.input.messageInput.focus()}hide(){this.init||(this.container.classList.remove("is-visible"),document.removeEventListener("mouseup",this.onMouseUpSingle),this.waitingForMouseUp=!1,Y.Z.removeByType("markup"),this.hideTimeout&&clearTimeout(this.hideTimeout),this.hideTimeout=window.setTimeout((()=>{this.hideTimeout=void 0,this.container.classList.add("hide"),this.container.classList.remove("is-link")}),200))}getActiveMarkupButton(){const e=new Set,t=Object.keys(this.buttons),i=(0,We.Z)(t);return t.forEach((t=>{i[t]&&e.add(this.buttons[t])})),[...e]}setActiveMarkupButton(){const e=this.getActiveMarkupButton();for(const t in this.buttons){const i=this.buttons[t];i.classList.toggle("active",e.includes(i))}}setTooltipPosition(e=!1){const t=document.getSelection().getRangeAt(0),i=document.body.getBoundingClientRect(),s=t.getBoundingClientRect(),n=this.appImManager.chat.input.rowsWrapper.getBoundingClientRect();this.container.style.maxWidth=n.width+"px";const a=(0,je.Z)(void 0,this.appImManager.chat.input.messageInput,!1,s).rect.top+-1*i.top,o=(this.container.classList.contains("is-link")?this.wrapper.lastElementChild:this.wrapper.firstElementChild).getBoundingClientRect(),r=a-o.height-8,d=n.left,l=n.left+n.width-Math.min(n.width,o.width);let c;if(e){const e=this.container.getBoundingClientRect();c=(0,Ge.Z)(e.left,d,l)}else{const e=s.left+(s.width-o.width)/2;c=(0,Ge.Z)(e,d,l)}this.container.style.transform=`translate3d(${c}px, ${r}px, 0)`}show(){if(this.init&&(this.init(),this.init=null),(0,ze.Z)())return void this.hide();if(void 0!==this.hideTimeout&&clearTimeout(this.hideTimeout),this.container.classList.contains("is-visible"))return;this.setActiveMarkupButton(),this.container.classList.remove("is-link");const e=this.container.classList.contains("hide");e&&(this.container.classList.remove("hide"),this.container.classList.add("no-transition")),this.setTooltipPosition(),e&&(this.container.offsetLeft,this.container.classList.remove("no-transition")),this.container.classList.add("is-visible"),f.IS_MOBILE||Y.Z.pushItem({type:"markup",onPop:()=>{this.hide()}})}setMouseUpEvent(){this.waitingForMouseUp||(this.waitingForMouseUp=!0,document.addEventListener("mouseup",this.onMouseUpSingle,{once:!0}))}cancelClosening(){z.Z&&!f.IS_APPLE&&(document.removeEventListener("mouseup",this.onMouseUpSingle),document.addEventListener("mouseup",(e=>{(0,C.Z)(e),this.mouseUpCounter=1,this.waitingForMouseUp=!1,this.setMouseUpEvent()}),{once:!0}))}handleSelection(){this.addedListener||(this.addedListener=!0,document.addEventListener("selectionchange",(e=>{if(document.activeElement===this.linkInput)return;const t=this.appImManager.chat.input.messageInput;if(document.activeElement!==t)return void this.hide();const i=document.getSelection();if((0,ze.Z)(i))this.hide();else if(z.Z)if(f.IS_APPLE)this.show(),this.setTooltipPosition();else{if(2===this.mouseUpCounter)return void(this.mouseUpCounter=0);this.savedRange=i.getRangeAt(0),this.setMouseUpEvent()}else this.container&&this.container.classList.contains("is-visible")?(this.setActiveMarkupButton(),this.setTooltipPosition()):t.matches(":active")?this.setMouseUpEvent():this.show()})),document.addEventListener("beforeinput",(e=>{"historyRedo"!==e.inputType&&"historyUndo"!==e.inputType||e.target.addEventListener("input",(()=>this.setActiveMarkupButton()),{once:!0})})))}}var qe=i(9171);class Ye{constructor(e,t){let i;this.options=t,this.onDragOver=e=>{this.container.classList.add("is-dragover")},this.onDragLeave=e=>{this.container.classList.remove("is-dragover")},this.onDrop=e=>{this.options.onDrop(e)},this.container=document.createElement("div"),this.container.classList.add("drop","z-depth-1"),this.outlineWrapper=document.createElement("div"),this.outlineWrapper.classList.add("drop-outline-wrapper"),this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.classList.add("drop-outline"),this.path=document.createElementNS("http://www.w3.org/2000/svg","path"),this.path.classList.add("drop-outline-path"),t.icon&&(i=document.createElement("div"),i.classList.add("drop-icon","tgico-"+t.icon));const s=document.createElement("div");let n;s.classList.add("drop-header"),s.append((0,T.ag)(t.header,t.headerArgs)),t.subtitle&&(n=document.createElement("div"),n.classList.add("drop-subtitle"),n.append((0,T.ag)(t.subtitle))),this.svg.append(this.path),this.outlineWrapper.append(this.svg),this.container.append(...[this.outlineWrapper,i,s,n].filter(Boolean)),e.append(this.container),this.container.addEventListener("dragover",this.onDragOver),this.container.addEventListener("dragleave",this.onDragLeave),this.container.addEventListener("drop",this.onDrop)}destroy(){delete this.options,this.container.remove(),this.container.removeEventListener("dragover",this.onDragOver),this.container.removeEventListener("dragleave",this.onDragLeave),this.container.removeEventListener("drop",this.onDrop)}setPath(){const e=this.outlineWrapper.getBoundingClientRect();this.svg.setAttributeNS(null,"preserveAspectRatio","none"),this.svg.setAttributeNS(null,"viewBox",`0 0 ${e.width} ${e.height}`),this.svg.setAttributeNS(null,"width",`${e.width}`),this.svg.setAttributeNS(null,"height",`${e.height}`);const t=10,i=e.width-t,s=e.height-t,n=(0,qe.Z)(5,5,i,s,t,t,t,t);this.path.setAttributeNS(null,"d",n)}}var Qe=i(3035),Xe=i(7922),Je=i(410);function et(e){e.forEach((e=>e.classList.add("no-transition"))),(0,Qe.d1)().then((()=>{e.forEach((e=>e.classList.remove("no-transition")))}))}var tt=i(2398),it=i(490),st=i(9298),nt=i(1842),at=i(8737),ot=i(2341),rt=i(1174),dt=i(2831),lt=i(2207);class ct{constructor(e){this.maxRadius=10,this.minRadius=0,this.N=e,this.radius=new Array(e+1),this.radiusNext=new Array(e+1),this.progress=new Array(e+1),this.speed=new Array(e+1);for(let t=0;t<=e;t++)this.generateBlob(this.radius,t),this.generateBlob(this.radiusNext,t),this.progress[t]=0}generateBlob(e,t){const{maxRadius:i,minRadius:s,speed:n}=this,a=i-s;e[t]=s+Math.random()*a,n[t]=.017+.003*Math.random()}generateNextBlob(){const{radius:e,radiusNext:t,progress:i,N:s}=this;for(let n=0;n=1&&(s[r]=0,a[r]=o[r],this.generateBlob(o,r))}draw(e,t,i,s,n,a,o,r){if(n.getContext){const d=n.getContext("2d");d.beginPath(),d.moveTo(i,s),d.lineTo(e,s);const{radius:l,radiusNext:c,N:h}=this;for(let n=0;n<=h;n++)if(0===n){const i=this.progress[n],s=(t-(l[n]*(1-i)+c[n]*i))*r+o*(1-r);d.lineTo(e,s)}else{const a=this.progress[n-1],u=l[n-1]*(1-a)+c[n-1]*a,p=this.progress[n],f=(i-e)/h*(n-1),m=(i-e)/h*n,g=f+(m-f)/2,v=(t-u)*r+o*(1-r),b=(t-(l[n]*(1-p)+c[n]*p))*r+o*(1-r);d.bezierCurveTo(g,v,g,b,m,b),n===h&&d.lineTo(i,s)}a(d),d.fill(),d.closePath()}}}class ht{constructor(e){this.stateId=e,this.createGradient(e)}createGradient(e){this.shader=(t,i,s,n,a)=>{t.fillStyle=ht.getGradientFromType(t,e,i,s,n,a)}}static getGradientFromType(e,t,i,s,n,a){const o=e.createLinearGradient(i,s,n,a);return t===lt.Z.MUTED_BY_ADMIN?(o.addColorStop(0,"#F05459"),o.addColorStop(.4,"#766EE9"),o.addColorStop(1,"#57A4FE")):t===lt.Z.UNMUTED?(o.addColorStop(0,"#52CE5D"),o.addColorStop(1,"#00B1C0")):t===lt.Z.MUTED?(o.addColorStop(0,"#0976E3"),o.addColorStop(1,"#2BCEFF")):t===lt.Z.CONNECTING&&(o.addColorStop(0,"#8599aa"),o.addColorStop(1,"#8599aa")),o}update(e,t,i,s){}}class ut{constructor(){this.handleDevicePixelRatioChanged=e=>{this.setSize(),this.forceUpdate()},this.handleResize=()=>{this.resizeHandler&&(clearTimeout(this.resizeHandler),this.resizeHandler=null),this.resizing=!0,this.resizeCanvas(),this.resizeHandler=window.setTimeout((()=>{this.resizing=!1,this.invokeDraw()}),250)},this.handleFocus=()=>{this.focused=!0,this.invokeDraw()},this.handleBlur=()=>{this.focused=!1},this.invokeDraw=()=>{this.raf||this.draw()},this.draw=(e=!1)=>{if(this.raf=null,!this.mounted)return;const{lbd:t,lbd1:i,lbd2:s,scale:n,left:a,top:o,right:r,bottom:d,currentState:l,previousState:c,focused:h,resizing:u,canvas:p}=this;if(!h&&!u&&this.progressToState>=1)return;let f=Date.now()-this.lastUpdateTime;f>20&&(f=17),this.animateToAmplitude!==this.amplitude&&(this.amplitude+=this.animateAmplitudeDiff*f,this.animateAmplitudeDiff>0?this.amplitude>this.animateToAmplitude&&(this.amplitude=this.animateToAmplitude):this.amplitude0?this.amplitude2>this.animateToAmplitude&&(this.amplitude2=this.animateToAmplitude):this.amplitude21&&(this.progressToState=1,this.previousState=null));const{amplitude:m,amplitude2:g,progressToState:v}=this,b=6*g*n,y=6*g*n;p.getContext("2d").clearRect(0,0,p.width,p.height),t.minRadius=0,t.maxRadius=(2+2*m)*n,i.minRadius=0,i.maxRadius=(3+9*m)*n,s.minRadius=0,s.maxRadius=(3+9*m)*n,t.update(m,.3),i.update(m,.7),s.update(m,.7);for(let e=0;e<2;e++){if(0===e&&!c)continue;let n=1,h=null;0===e?(n=1-v,h=c):(n=c?v:1,l.update(d-o,r-a,f,m),h=l);const u=e=>{e.globalAlpha=.3*n,h.shader(e,a,o,r,d)},g=t=>{t.globalAlpha=0===e?1:n,h.shader(t,a,o,r,d)};i.draw(a,o-b,r,d,p,u,o,1),s.draw(a,o-y,r,d,p,u,o,1),t.draw(a,o,r,d,p,g,o,1)}e||(this.raf=requestAnimationFrame((()=>this.draw())))},this.setCurrentState=(e,t)=>{const{currentState:i,states:s}=this;(null==i?void 0:i.stateId)!==e&&(this.previousState=t?i:null,this.currentState=s.get(e),this.progressToState=this.previousState?0:1)},this.focused=!0,this.resizing=!1,this.lastUpdateTime=Date.now(),this.amplitude=0,this.amplitude2=0,this.states=new Map([[lt.Z.UNMUTED,new ht(lt.Z.UNMUTED)],[lt.Z.MUTED,new ht(lt.Z.MUTED)],[lt.Z.MUTED_BY_ADMIN,new ht(lt.Z.MUTED_BY_ADMIN)],[lt.Z.CONNECTING,new ht(lt.Z.CONNECTING)]]),this.previousState=null,this.currentState=this.states.get(lt.Z.CONNECTING),this.progressToState=1}componentDidMount(){this.mounted||(this.mounted=!0,window.addEventListener("resize",this.handleResize),this.media=window.matchMedia("screen and (min-resolution: 2dppx)"),this.media.addEventListener("change",this.handleDevicePixelRatioChanged),this.setSize(),this.forceUpdate(),this.lbd=new ct(3),this.lbd1=new ct(7),this.lbd2=new ct(8),this.setAmplitude(this.amplitude),this.draw())}componentWillUnmount(){this.mounted=!1,window.removeEventListener("resize",this.handleResize),this.media.addEventListener("change",this.handleDevicePixelRatioChanged);const{canvas:e}=this;e.getContext("2d").clearRect(0,0,e.width,e.height)}setSize(){this.scale=window.devicePixelRatio,this.top=20*this.scale,this.right=(this.mounted?this.container.offsetWidth:1261)*this.scale,this.bottom=(this.mounted?this.container.offsetHeight:68)*this.scale,this.left=0*this.scale,this.setCanvasSize()}setCanvasSize(){this.canvas.width=this.right,this.canvas.height=this.bottom}resizeCanvas(){this.scale=window.devicePixelRatio,this.right=this.container.offsetWidth*this.scale,this.forceUpdate(),this.invokeDraw()}setAmplitude(e){const{amplitude:t}=this;this.animateToAmplitude=e,this.animateAmplitudeDiff=(e-t)/250,this.animateAmplitudeDiff2=(e-t)/120}forceUpdate(){this.setCanvasSize()}render(e){const t=this.container=document.createElement("div");t.classList.add(e);const i=this.canvas=document.createElement("canvas");return i.classList.add(e+"-canvas"),t.append(i),t}}var pt=i(8222),ft=i(1447);class mt{constructor(e,t){this.item=e,(0,E.Z)(this,t)}play(e){return this.item.playPart(this,e)}}class gt{constructor(e,t){this.icon=e,this.autoplay=!1,(0,E.Z)(this,t),this.parts=this.parts.map((e=>this.createPart(e)))}load(){var e;let t=this.loadPromise;if(t)return t;const{container:i,canvas:s,width:n,height:a}=this.icon;return t=ft.Z.loadAnimationAsAsset({container:i,canvas:s,width:n,height:a,group:"none",loop:!1,autoplay:null!==(e=this.autoplay)&&void 0!==e&&e,initFrame:this.initFrame,skipFirstFrameRendering:void 0===this.initFrame,color:this.color,inverseColor:this.inverseColor},this.name).then((e=>ft.Z.waitForFirstFrame(e))).then((e=>{this.player=e,this.onLoadForColor&&(this.onLoadForColor(),this.onLoadForColor=void 0),this.onLoadForPart&&(this.onLoadForPart(),this.onLoadForPart=void 0)})),this.loadPromise=t,this.icon.loadPromises.set(this.name,t),t}createPart(e){return new mt(this,e)}getPart(e){return e instanceof mt?e:"string"==typeof e?this.parts.find((t=>t.name===e)):this.parts[e]}playPart(e,t){return this.icon.playPart(this,e,t)}}class vt{constructor(e){(0,E.Z)(this,e),this.container||(this.container=document.createElement("div")),this.container.classList.add("rlottie-icon");const{width:t,height:i}=this;this.container.style.width=t+"px",this.container.style.height=i+"px";const s=this.canvas=document.createElement("canvas");s.classList.add("rlottie"),s.width=t,s.height=i,this.items=new Map,this.loadPromises=new Map}get loadPromise(){return Promise.all([...this.loadPromises.values()]).then(Re.Z)}getItem(e){return e||1!==this.items.size?this.items.get(e):this.items.values().next().value}add(e){const t=new gt(this,e);return this.items.set(e.name,t),t}playPart(e,t,i){if(!e.player)return void(e.onLoadForPart=()=>{this.playPart(e,t,i)});const s=e.getPart(t);e.player.playPart({from:Ne.Z.isAvailable("animations")&&!this.skipAnimation?s.startFrame:s.endFrame,to:s.endFrame,callback:i})}static generateEqualParts(e,t){return new Array(e).fill(0).map(((e,i)=>{const s=i*t;return{startFrame:s,endFrame:s+t-1}}))}}class bt extends vt{constructor(e){super({width:e.width,height:e.height}),(0,E.Z)(this,e)}load(e,t){if(this.loaded)return this.loadPromise;this.loaded=!0,this.partState=e,this.colorState=t;const i=this.getPart(e),s=void 0!==t&&this.getColor&&this.getColor(t),n=i.item;n.initFrame=i.endFrame,n.color=s;const a=[...this.items.values()].map((e=>e.load()));return Promise.all(a).then(Re.Z)}setState(e,t,i){this.loaded||this.load(e,t);let s=!1,n=!1;return void 0!==e?s=this.setPartState(e,t,i):void 0!==t&&(n=this.setColorState(t)),s||n}setPartState(e,t,i){const{partState:s}=this;return s===e?void 0!==t&&this.setColorState(t):(void 0!==t&&this.setColorState(t,!1),this.partState=e,this.getPart(e,s).play(i),!0)}setColorState(e,t=!0){const{colorState:i}=this;if(i===e||!this.getColor)return!1;this.colorState=e;const s=this.getItem(),n=this.getColor(e,i),a=()=>{s.player.setColor(n,t)};return s.player?a():s.onLoadForColor=a,!0}destroy(){this.items.forEach((e=>{e.loadPromise.then((()=>{e.player.remove()}))}))}}class yt extends bt{constructor(){super({width:36,height:36,getPart:(e,t)=>{const i=oi;let s;switch(e){case i.HAND:s=t===i.MUTED?"muted-to-hand":"unmuted-to-hand";break;case i.MUTED:s=t===i.HAND?"hand-to-muted":"mute";break;case i.UNMUTED:s="unmute"}return this.getItem().getPart(s)}}),this.container.classList.add("group-call-microphone-icon-container"),this.add({name:"voip_filled",parts:[{startFrame:0,endFrame:35,name:"hand-to-muted"},{startFrame:36,endFrame:68,name:"unmute"},{startFrame:69,endFrame:98,name:"mute"},{startFrame:99,endFrame:135,name:"muted-to-hand"},{startFrame:136,endFrame:172,name:"unmuted-to-hand"},{startFrame:173,endFrame:201,name:"scheduled-crossing"},{startFrame:202,endFrame:236,name:"scheduled-to-muted"},{startFrame:237,endFrame:273,name:"scheduled-to-hand"},{startFrame:274,endFrame:310,name:"scheduled-crossed-to-hand"},{startFrame:311,endFrame:343,name:"scheduled-uncrossing"},{startFrame:344,endFrame:375,name:"scheduled-to-muted"},{startFrame:376,endFrame:403,name:"play-to-muted"}]})}}var wt=i(2353),St=i(3416),Ct=i(6976),Lt=i(6733),Et=i(1483),It=i(8936),Mt=i(2946),Zt=i(3003),Pt=i(5592),Tt=i(8805),kt=i(4484),xt=i(5345);class At extends bt{constructor(e){super({width:32,height:32,getPart:(e,t)=>{const i=ai;let s;switch(e){case i.HAND:s=3;break;case i.MUTED:s=t===i.HAND?0:2;break;case i.UNMUTED:s=1}return this.getItem().getPart(s)},getColor:e?(e,t)=>function(e){const t=ai;let i;switch(e){case t.HAND:i="blue";break;case t.MUTED:case t.MUTED_FOR_ME:case t.MUTED_BY_ADMIN:i=e===t.MUTED?"secondary":"red";break;case t.UNMUTED:i="green"}const s=pt.Z.getProperty("gc-"+i+"-text-color");return(0,Be.oo)(s)}(e):void 0}),this.colored=e,this.container.classList.add("group-call-participant-muted-icon-container");const t=vt.generateEqualParts(4,21);this.add({name:"voice_outlined2",parts:t})}setState(e){return super.setState(function(e){const t=ai;switch(e){case t.MUTED_BY_ADMIN:case t.MUTED_FOR_ME:return t.MUTED;default:return e}}(e),e)}}var _t=i(130);const Ft="group-call-participant-status";class Dt{constructor(e){this.withIcons=e,this.container=document.createElement("div"),this.container.classList.add(Ft+"-container")}setState(e,t){const i=ai,s=this.withIcons.filter((e=>!!t[e])).map((e=>{const t="tgico-"+("presentation"===e?"listscreenshare":"videocamera_filled"),i=document.createElement("i");return i.classList.add(Ft+"-icon",Ft+"-icon-"+e,t),i}));let n,a;if(e===i.MUTED_FOR_ME)n=(0,T.ag)("VoiceChat.Status.MutedForYou"),a="is-muted";else if(e===i.UNMUTED)n=(0,T.ag)("VoiceChat.Status.Speaking"),a="is-speaking";else if(e===i.HAND)n=(0,T.ag)("VoiceChat.Status.WantsSpeak"),a="is-waiting";else{if(t.about&&!s.length)return void(0,_t.Z)(this.container,(0,_.Z)(t.about));n=(0,T.ag)("VoiceChat.Status.Listening"),a="is-listening"}const o=document.createElement("span");o.classList.add(Ft,a),o.append(...s,n),(0,Z.Z)(this.container,o)}}var Rt=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class Bt extends xt.Z{constructor(e){super({getIndex:e=>Rt(this,void 0,void 0,(function*(){return(yield this.instance.getParticipantByPeerId(e.id)).date})),onDelete:e=>{e.dom.listEl.remove(),this.onElementDestroy(e)},onUpdate:e=>Rt(this,void 0,void 0,(function*(){const t=yield this.instance.getParticipantByPeerId(e.id),i=ri(t);e.mutedIcon.setState(i),e.status.setState(i,t)})),onSort:(e,t)=>{(0,kt.Z)(e.dom.listEl,this.list,t)},onElementCreate:e=>{const{dom:t}=Ie.default.addDialogNew({peerId:e.id,container:!1,avatarSize:this.avatarSize,autonomous:this.autonomous,meAsSaved:!1,rippleEnabled:this.rippleEnabled,wrapOptions:{lazyLoadQueue:this.lazyLoadQueue}});t.listEl.classList.add("group-call-participant");const i=new At(!0),s=new Dt(["presentation","video"]);return(0,Z.Z)(t.lastMessageSpan,s.container),t.listEl.append(i.container),e.mutedIcon=i,e.status=s,e.dom=t,e},updateElementWith:Qe.T2}),this.instance=e,this.avatarSize="abitbigger",this.rippleEnabled=!0,this.autonomous=!0,this.createChatListOptions={dialogSize:72},this.list=Ie.default.createChatList(this.createChatListOptions)}destroy(){this.elements.forEach((e=>{this.onElementDestroy(e)}))}onElementDestroy(e){e.mutedIcon.destroy()}}var Nt=i(7529),Ot=i(5296);function Ut(e){const t=document.createElement("canvas");t.classList.add("call-video-blur"),t.width=16,t.height=16;const i=t.getContext("2d",{alpha:!1});i.filter="blur(2px)";const s=()=>{i.drawImage(e,0,0,e.videoWidth,e.videoHeight,0,0,t.width,t.height)};return(0,Ot.jt)((()=>(s(),t.isConnected))),s(),t}const Ht="group-call-participant-video";class zt{constructor(e,t,i){this.managers=e,this.instance=t,this.source=i,this.container=document.createElement("div"),this.container.classList.add(Ht+"-container"),this.info=document.createElement("div"),this.info.classList.add(Ht+"-info"),this.left=document.createElement("div"),this.left.classList.add(Ht+"-info-left"),this.right=document.createElement("div"),this.right.classList.add(Ht+"-info-right"),this.info.append(this.left,this.right),this.container.append(this.info)}setPinned(e){if(!e)return void(this.header&&(this.header.remove(),this.header=void 0));if(this.header)return;this.header=document.createElement("div"),this.header.classList.add(Ht+"-header");const t=document.createElement("i");t.classList.add("group-call-pin-icon","tgico-pin"),this.header.append(t),this.container.append(this.header)}setParticipant(e,t,i){let s;e.pFlags.self?(s=(0,T.ag)("VoiceChat.Status.You"),s.classList.add("peer-title")):(this.peerTitle=new P.Z({peerId:(0,Mt.Z)(e.peer)}),s=this.peerTitle.element),this.groupCallParticipantMutedIcon=new At(!1),this.groupCallParticipantStatus=new Dt([t]),this.left.append(s,this.groupCallParticipantStatus.container),this.right.append(this.groupCallParticipantMutedIcon.container),i.classList.add(Ht,"call-video"),i.paused&&i.play();const n=Ut(i);n.classList.add(Ht+"-blur"),this.container.prepend(n,i),this.updateParticipant(e)}updateParticipant(e){const t=ri(e);this.groupCallParticipantMutedIcon.setState(t),this.groupCallParticipantStatus.setState(t,e)}destroy(){this.groupCallParticipantMutedIcon.destroy()}}class jt extends Nt.Z{constructor(e){super(),(0,E.Z)(this,e);const t=this.container=document.createElement("div");this.container.classList.add("group-call-participants-video-container"),e.appendTo.append(t),this.participantsElements=new Map,this.containers=new Map;const{listenerSetter:i}=this;i.add(d.Z)("group_call_participant",(({groupCallId:e,participant:t})=>{this.instance.id===e&&this.updateParticipant(t)})),i.add(this.instance)("pinned",(e=>{this.participantsElements.forEach((t=>{t.forEach((t=>{this.setElementDisplay(t,e)}))}))})),(0,L.fc)(this.container,(e=>{const t=(0,Q.Z)(e.target,"group-call-participant-video-container");if(!t)return;const i=this.containers.get(t);this.instance.pinnedSource!==i.source?this.instance.pinSource(i.source):this.instance.unpinAll()}),{listenerSetter:i}),this.setInstance(this.instance),this.setup({element:t,listenerSetter:i,showOnLeaveToClassName:"group-call-buttons"})}shouldDisplayElement(e,t){return this.displayPinned?!t||e.source===t:t&&e.source!==t}setElementDisplay(e,t){const i=this.shouldDisplayElement(e,t);e.container.classList.toggle("video-hidden",!i);const s=e.source===t;e.setPinned(s)}updateParticipant(e){const t=(0,Mt.Z)(e.peer),i=["video","presentation"],s=i.some((t=>!!e[t]));let n=this.participantsElements.get(t);(s||n)&&(n||this.participantsElements.set(t,n=new Map),i.forEach((i=>{let s=n.get(i);const a=e[i];if(!!a!=!!s){if(a){const t=this.instance.getVideoElementFromParticipantByType(e,i);if(!t)return;const{video:a,source:o}=t;s=new zt(this.managers,this.instance,o),this.containers.set(s.container,s),this.setElementDisplay(s,this.instance.pinnedSource),n.set(i,s),s.setParticipant(e,i,a),this.container.prepend(s.container)}else n.delete(i),s.container.remove(),n.size||(this.participantsElements.delete(t),this.containers.delete(s.container),s.destroy());this._onLengthChange()}else s&&s.updateParticipant(e)})))}_onLengthChange(){const e=this.container.childElementCount;this.container.dataset.length=""+e,this.container.dataset.layout=e<=2?"1":3===e?"3":"4",this.onLengthChange&&this.onLengthChange(e)}setInstance(e){return t=this,i=void 0,n=function*(){(yield e.participants).forEach((e=>{this.updateParticipant(e)}))},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n}destroy(){this.containers.forEach((e=>{e.destroy()}))}}var Gt=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class Vt{constructor(e){this.onOpenProfileClick=()=>{const e=ye.Z.getPopups(ci)[0];e&&e.hide(),ys.setInnerPeer({peerId:this.targetPeerId})},this.toggleParticipantMuted=e=>{this.instance.editParticipant(this.participant,{muted:e})},this.buttons=[{icon:"gc_microphoneoff",text:"VoiceChat.MutePeer",verify:()=>this.canManageCall&&this.participant.pFlags.can_self_unmute,onClick:()=>this.toggleParticipantMuted(!0)},{icon:"gc_microphone",text:"VoiceChat.UnmutePeer",verify:()=>this.canManageCall&&!this.participant.pFlags.can_self_unmute,onClick:()=>this.toggleParticipantMuted(!1)},{icon:"gc_microphoneoff",text:"VoiceChat.MuteForMe",verify:()=>!this.canManageCall&&!this.participant.pFlags.muted_by_you,onClick:()=>this.toggleParticipantMuted(!0)},{icon:"gc_microphone",text:"VoiceChat.UnmuteForMe",verify:()=>!this.canManageCall&&this.participant.pFlags.muted_by_you,onClick:()=>this.toggleParticipantMuted(!1)},{icon:"newprivate",text:"VoiceChat.OpenProfile",verify:()=>!0,onClick:this.onOpenProfileClick},{icon:"deleteuser danger",text:"VoiceChat.RemovePeer",verify:()=>this.managers.appChatsManager.hasRights(this.chatId,"ban_users"),onClick:()=>Gt(this,void 0,void 0,(function*(){(0,Pt.Z)({peerId:this.targetPeerId,title:new P.Z({peerId:this.targetPeerId}).element,descriptionLangKey:(yield this.managers.appChatsManager.isBroadcast(this.chatId))?"VoiceChat.RemovePeer.Confirm.Channel":"VoiceChat.RemovePeer.Confirm",descriptionLangArgs:[new P.Z({peerId:this.targetPeerId}).element],button:{langKey:"VoiceChat.RemovePeer.Confirm.OK",isDanger:!0}}).then((()=>{this.managers.appChatsManager.kickFromChat(this.chatId,this.targetPeerId)}),Re.Z)}))}];const{listenerSetter:t}=e;this.managers=e.managers,this.instance=e.instance,this.chatId=this.instance.chatId,this.element=(0,Zt.b)({buttons:this.buttons,listenerSetter:t}),this.element.classList.add("group-call-participant-menu","night"),(0,Ct.E)({element:e.onContextElement,callback:e=>Gt(this,void 0,void 0,(function*(){const t=(0,Q.Z)(e.target,"group-call-participant");if(!t)return;this.element.parentElement!==i&&i.append(this.element),(0,C.Z)(e);const s=this.targetPeerId=t.dataset.peerId.toPeerId();this.participant=yield this.instance.getParticipantByPeerId(s),this.participant.pFlags.self||(this.canManageCall=yield this.managers.appChatsManager.hasRights(this.chatId,"manage_call"),yield(0,wt.Z)(this.buttons,(e=>Gt(this,void 0,void 0,(function*(){const t=yield e.verify(s);return e.element.classList.toggle("hide",!t),t})))),(0,Et.Z)(e.touches?e.touches[0]:e,this.element,"right"),St.Z.openBtnMenu(this.element))})),listenerSetter:t}),t.add(d.Z)("group_call_participant",(({groupCallId:e,participant:t})=>{if(this.instance.id===e){const e=(0,Mt.Z)(t.peer);this.targetPeerId===e&&St.Z.close()}}));let i=document.body;(0,Lt.Ms)(document.body,(()=>{const e=(0,Lt.rB)();i=e?ye.Z.getPopups(ci)[0].getContainer():document.body,e||St.Z.close()}),t)}}class Kt{constructor(e){(0,E.Z)(this,e);const t="group-call-participants",i=new Tt.ZP(void 0);i.container.classList.add(t+"-scrollable");const s=this.container=document.createElement("div");s.classList.add(t);const n=this.sortedList=new Bt(this.instance),{instance:a,listenerSetter:o}=this;this.contextMenu=new Vt(Object.assign(Object.assign({},e),{onContextElement:n.list,listenerSetter:o,instance:a})),this.groupCallParticipantsVideo=new jt(Object.assign(Object.assign({},e),{appendTo:i.container,displayPinned:!1})),i.append(n.list),s.append(i.container),e.appendTo.append(s),o.add(d.Z)("group_call_participant",(({groupCallId:e,participant:t})=>{this.instance.id===e&&this.updateParticipant(t)})),new It.Z({scrollable:i,getPromise:()=>this.managers.appGroupCallsManager.getGroupCallParticipants(this.instance.id).then((({participants:e,isEnd:t})=>(e.forEach((e=>{this.updateParticipant(e)})),t)))}),this.setInstance(a)}updateParticipant(e){const t=(0,Mt.Z)(e.peer),i=this.sortedList.has(t);e.pFlags.left?i&&this.sortedList.delete(t):i?this.sortedList.update(t):this.sortedList.add(t)}setInstance(e){return Gt(this,void 0,void 0,(function*(){(yield e.participants).forEach((e=>{this.updateParticipant(e)}))}))}destroy(){this.sortedList.destroy(),this.groupCallParticipantsVideo.destroy()}}class Wt{constructor(e){this.appendTo=e,this.descriptionIntl=new T.ZP.IntlElement({key:"VoiceChat.Status.Connecting"}),this.descriptionIntl.element.classList.add("group-call-description")}detach(){this.descriptionIntl.element.remove()}update(e){const{state:t}=e;let i,s;t===lt.Z.CONNECTING?i="VoiceChat.Status.Connecting":(i="VoiceChat.Status.Members",s=[e.groupCall.participants_count]);const{descriptionIntl:n}=this;n.compareAndUpdate({key:i,args:s}),this.descriptionIntl.element.parentElement||this.appendTo.append(this.descriptionIntl.element)}}class $t{constructor(e){this.appendTo=e,this.peerTitle=new P.Z({peerId:0})}update(e){const{peerTitle:t,appendTo:i}=this,s=e.groupCall,n=e.chatId.toPeerId(!0);s.title?(0,_t.Z)(i,(0,_.Z)(s.title)):(t.options.peerId!==n&&(t.options.peerId=n,t.update()),t.element.parentElement!==i&&i.append(t.element))}}var qt=i(2820);function Yt(e,t,i){const s=e+"-button",n=document.createElement("div");n.classList.add(s,"call-button","rp-overflow"),i.icon&&n.classList.add("tgico-"+i.icon),i.noRipple||(0,S.Z)(n),i.isDanger&&n.classList.add(s+"-red"),i.isConfirm&&n.classList.add(s+"-green"),i.callback&&(0,L.fc)(n,i.callback,{listenerSetter:t});let a=n;if(i.text){const e=document.createElement("div");e.classList.add(s+"-container","call-button-container");const t="string"==typeof i.text?(0,T.ag)(i.text):i.text;t.classList.add(s+"-text","call-button-text"),e.append(n,t),a=e}return a}var Qt=i(3757);const Xt="movable-element",Jt=Xt+"-resize-handler";class ei extends l.Z{constructor(e){super(!0),this.onResize=()=>{this.fixDimensions(),this.fixPosition(),this.setPosition()},(0,E.Z)(this,e),this.top=this.left=this.width=this.height=0,this.element.classList.add(Xt),this.addResizeHandlers(),this.setSwipeHandler(),o.Z.addEventListener("resize",this.onResize)}destroyElements(){this.element.classList.remove(Xt),this.handlers&&this.handlers.forEach((e=>{e.remove()}))}destroy(){o.Z.removeEventListener("resize",this.onResize),this.swipeHandler.removeListeners()}addResizeHandlers(){this.handlers=["n","e","s","w","ne","se","sw","nw"].map((e=>{const t=document.createElement("div");return t.dataset.side=e,t.classList.add(Jt,Jt+"-side-"+e),this.element.append(t),t}))}setSwipeHandler(){let e,t,i,s,n;const a=this.swipeHandler=new Qt.Z({element:this.element,onSwipe:(a,o,r)=>{if(n){if(n.includes("e")||n.includes("w")){const e=n.includes("e")&&a>0||n.includes("w")&&a<0,s=Math.abs(a)*(e?1:-1),o=n.includes("e")?ke.Z.width-t:i+t;this.width=Math.min(o,i+s)}if(n.includes("n")||n.includes("s")){const t=n.includes("s")&&o>0||n.includes("n")&&o<0,i=Math.abs(o)*(t?1:-1),a=n.includes("s")?ke.Z.height-e:s+e;this.height=Math.min(a,s+i)}this.fixDimensions(),n.includes("w")&&(this.left=Math.min(t+i-this.minWidth,t+a)),n.includes("n")&&(this.top=Math.min(e+s-this.minHeight,e+o))}else this.top=e+o,this.left=t+a;this.fixPosition(),this.setPosition()},verifyTouchTarget:e=>{const t=e.target;if(this.verifyTouchTarget&&!this.verifyTouchTarget(e))return!1;const i=(0,Q.Z)(t,Jt);return i?(n=i.dataset.side,a.setCursor("")):(n=void 0,a.setCursor("grabbing")),!0},onFirstSwipe:()=>{e=this.top,t=this.left,i=this.width,s=this.height}})}setPositionToCenter(){this.top=ke.Z.height/2-this.height/2,this.left=ke.Z.width/2-this.width/2,this.setPosition()}fixDimensions(){this.width=(0,Ge.Z)(this.width,this.minWidth,ke.Z.width),this.height=(0,Ge.Z)(this.height,this.minHeight,ke.Z.height)}fixPosition(){this.top=(0,Ge.Z)(this.top,0,ke.Z.height-this.height),this.left=(0,Ge.Z)(this.left,0,ke.Z.width-this.width)}setPosition(){this.element.style.top=this.top+"px",this.element.style.left=this.left+"px",this.element.style.right="auto",this.element.style.bottom="auto",this.element.style.width=this.width+"px",this.element.style.height=this.height+"px",this.dispatchEvent("resize")}get width(){return this._width}get height(){return this._height}set width(e){this._width=e}set height(e){this._height=e}get state(){const{top:e,left:t,width:i,height:s}=this;return{top:e,left:t,width:i,height:s}}set state(e){const{top:t,left:i,width:s,height:n}=e;this.top=t,this.left=i,this.width=s,this.height=n,this.onResize()}}var ti,ii=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i};class si{constructor(e){ti.set(this,void 0),(0,E.Z)(this,e),this.toggleMovable(!z.Z),this.listenerSetter.add(o.Z)("changeScreen",((e,t)=>{t!==o._.mobile&&e!==o._.mobile||this.toggleMovable(!z.Z)}))}destroy(){const e=this.movable;e&&e.destroy()}get movable(){return function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)}(this,ti,"f")}get state(){return this.movable?this.movable.state:this.previousState}set state(e){this.previousState=e}toggleMovable(e){let{movable:t}=this;if(e){if(t)return;t=ii(this,ti,new ei(this.movableOptions),"f"),t.state=this.previousState,void 0===this.previousState.top&&t.setPositionToCenter(),this.onResize&&this.listenerSetter.add(t)("resize",this.onResize)}else{if(!t)return;this.previousState=t.state,t.destroyElements(),t.destroy(),ii(this,ti,void 0,"f")}}}function ni(e,t,i){return t.forEach((t=>{t.classList.toggle(e,i)})),()=>ni(e,t,!i)}ti=new WeakMap;var ai,oi;function ri(e){const t=ai;return e.pFlags.muted_by_you?t.MUTED_FOR_ME:void 0!==e.raise_hand_rating?t.HAND:e.pFlags.muted?e.pFlags.can_self_unmute?t.MUTED:t.MUTED_BY_ADMIN:t.UNMUTED}!function(e){e[e.UNMUTED=0]="UNMUTED",e[e.MUTED=1]="MUTED",e[e.MUTED_FOR_ME=2]="MUTED_FOR_ME",e[e.MUTED_BY_ADMIN=3]="MUTED_BY_ADMIN",e[e.HAND=4]="HAND"}(ai||(ai={})),function(e){e[e.HAND=0]="HAND",e[e.MUTED=1]="MUTED",e[e.UNMUTED=2]="UNMUTED"}(oi||(oi={}));let di={width:420,height:640};const li="group-call";class ci extends ye.Z{constructor(){super("popup-group-call",{body:!0,withoutOverlay:!0,closable:!0,title:!0}),this.onFullScreenClick=()=>{(0,Lt.Dj)(this.container)},this.onToggleControls=e=>{this.container.classList.toggle("show-controls",e),this.buttonsContainer.classList.toggle("show-controls",e)},this.toggleDisability=ni.bind(null,"btn-disabled"),this.onVideoClick=()=>{const e=this.toggleDisability([this.btnVideo],!0);this.instance.toggleVideoSharing().finally((()=>{e()}))},this.onScreenClick=()=>{const e=this.toggleDisability([this.btnScreen],!0);this.instance.toggleScreenSharing().finally((()=>{e()}))},this.onMuteClick=()=>{const e=this.instance.participant;e.pFlags.can_self_unmute?this.instance.toggleMuted():void 0===e.raise_hand_rating&&this.instance.changeRaiseHand(!0)},this.onLeaveClick=()=>{return e=this,t=void 0,s=function*(){const e=e=>{this.instance.hangUp(e)};(yield this.managers.appChatsManager.hasRights(this.instance.chatId,"manage_call"))?new ie.Z("popup-end-video-chat",{titleLangKey:"VoiceChat.End.Title",descriptionLangKey:"VoiceChat.End.Text",checkboxes:[{text:"VoiceChat.End.Third"}],buttons:[{langKey:"VoiceChat.End.OK",callback:t=>{e(!!t.size)},isDanger:!0}]}).show():e(!1)},new((i=void 0)||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}));var e,t,i,s},this.onFullScreenChange=()=>{this.toggleBigLayout();const e=(0,Lt.rB)(),{btnFullScreen:t,btnExitFullScreen:i}=this,n=this.container.classList.contains("is-full-screen");this.container.classList.toggle("is-full-screen",e),t&&t.classList.toggle("hide",e),i&&i.classList.toggle("hide",!e),this.btnClose.classList.toggle("hide",e),e!==n&&(s.Z.checkAnimations2(e),De.Z.setThemeColor(e?"#000000":void 0))},this.toggleBigLayout=()=>{var e;const t=(0,Lt.rB)(),i=null===(e=this.movablePanel)||void 0===e?void 0:e.movable,s=(t||!!(i&&i.width>=680))&&!!this.videosCount,n=this.container.classList.contains("is-big-layout");let a;s&&!n&&(a=Array.from(this.buttonsContainer.children),a.forEach((e=>{e.style.opacity="0"})),this.buttonsContainer.offsetLeft),this.container.classList.toggle("is-big-layout",s),this.btnInvite.classList.toggle("hide",s),this.btnShowColumn.classList.toggle("hide",!s),a&&a.forEach((e=>{e.style.opacity=""}))},this.toggleRightColumn=()=>{this.container.classList.toggle("is-right-column-shown")},this.videosCount=0,this.container.classList.add(li,"night");const e=this.instance=le.ZP.groupCall,{listenerSetter:t}=this;if(!f.IS_APPLE_MOBILE){const e=this.btnFullScreen=(0,v.Z)("fullscreen"),i=this.btnFullScreen2=(0,v.Z)("fullscreen "+li+"-cfs"),s=this.btnExitFullScreen=(0,v.Z)("smallscreen");(0,L.fc)(e,this.onFullScreenClick,{listenerSetter:t}),(0,L.fc)(i,this.onFullScreenClick,{listenerSetter:t}),(0,L.fc)(s,(()=>{(0,Lt.C8)()}),{listenerSetter:t}),(0,Lt.Ms)(this.container,this.onFullScreenChange,t)}this.btnInvite=(0,v.Z)("adduser");const i=this.btnShowColumn=(0,v.Z)("rightpanel "+li+"-only-big");(0,L.fc)(i,this.toggleRightColumn,{listenerSetter:t});const n=document.createElement("div");n.classList.add(li+"-header-info"),this.title.classList.add(li+"-header-title");const a=document.createElement("div");a.classList.add(li+"-header-subtitle"),n.append(this.title,a),this.header.classList.add(li+"-header"),this.header.append(...[this.btnExitFullScreen,n,this.btnFullScreen,i].filter(Boolean));const o=this.header.cloneNode(!1),r=n.cloneNode(!1),l=this.title.cloneNode(!1);r.append(l);const c=(0,v.Z)("rightpanel");o.append(...[c,r,this.btnFullScreen2].filter(Boolean)),(0,L.fc)(c,this.toggleRightColumn,{listenerSetter:t}),this.body.prepend(o);const h=new Tt.ZP(void 0);h.container.classList.add("group-call-big-video-container"),this.container.append(h.container),this.groupCallTitle=new $t(this.title),this.groupCallDescription=new Wt(a),this.groupCallBodyHeaderDescription=new Wt(l),this.constructButtons(),this.groupCallParticipantsVideo=new jt({appendTo:h.container,instance:e,listenerSetter:t,displayPinned:!0,onLengthChange:e=>{this.videosCount=e,this.toggleBigLayout()},managers:this.managers}),this.groupCallParticipants=new Kt({appendTo:this.body,instance:e,listenerSetter:t,managers:this.managers}),this.movablePanel=new si({listenerSetter:t,movableOptions:{minWidth:400,minHeight:480,element:this.element,verifyTouchTarget:e=>{const t=e.target;return!((0,Q.Z)(t,"chatlist")||(0,Q.Z)(t,"group-call-button")||(0,Q.Z)(t,"btn-icon")||(0,Q.Z)(t,"group-call-participants-video-container")||(0,Lt.rB)())}},onResize:()=>this.toggleBigLayout(),previousState:di}),t.add(e)("state",(()=>{this.updateInstance()})),t.add(d.Z)("group_call_update",(e=>{var t;(null===(t=this.instance)||void 0===t?void 0:t.id)===e.id&&this.updateInstance()})),t.add(e)("pinned",(()=>{this.setHasPinned()})),t.add(this.groupCallParticipantsVideo)("toggleControls",this.onToggleControls),this.addEventListener("close",(()=>{const{movablePanel:e}=this;di=e.state,this.groupCallParticipantsVideo.destroy(),this.groupCallParticipants.destroy(),this.groupCallMicrophoneIcon.destroy(),e.destroy()})),this.toggleRightColumn(),this.onFullScreenChange(),this.updateInstance()}constructButtons(){const e=this.buttonsContainer=document.createElement("div");e.classList.add(li+"-buttons");const t=Yt.bind(null,li,this.listenerSetter),i=this.btnVideo=t({callback:this.onVideoClick,icon:"videocamera_filled"}),s=this.btnScreen=t({callback:this.onScreenClick,icon:"sharescreen_filled"});s.classList.toggle("hide",!qt.Z);const n=t({noRipple:!0,callback:(0,G.Z)(this.onMuteClick,600,!0)});n.classList.add(li+"-microphone-button");const a=this.groupCallMicrophoneIcon=new yt;n.append(a.container);const o=t({icon:"settings_filled"});o.classList.add("btn-disabled"),o.classList.toggle("hide",!qt.Z);const r=t({isDanger:!0,callback:this.onLeaveClick,icon:"close"});e.append(i,s,n,o,r),this.container.append(e)}getContainer(){return this.container}setHasPinned(){this.container.classList.toggle("has-pinned",!!this.instance.pinnedSource)}updateInstance(){if(this.instance.state===lt.Z.CLOSED)return this.container.classList.contains("is-full-screen")&&(0,Lt.C8)(),void this.hide();const{participant:e,groupCall:t}=this.instance;if(!e)return;this.setTitle(),this.setDescription(),this.setHasPinned();const i=function(e,t){const i=oi;return t.pFlags.can_self_unmute?t.pFlags.muted?i.MUTED:i.UNMUTED:i.HAND}(0,e);this.container.dataset.micState=i===oi.HAND?"hand":i===oi.MUTED?"muted":"unmuted",this.groupCallMicrophoneIcon.setState(i)}setTitle(){this.groupCallTitle.update(this.instance)}setDescription(){this.groupCallDescription.update(this.instance),this.groupCallBodyHeaderDescription.update(this.instance)}}var hi=i(9078),ui=i(3335),pi=i(5157);class fi{constructor(e){this.appendTo=e,this.container=document.createElement("div"),this.container.classList.add("call-description")}detach(){void 0!==this.interval&&(clearInterval(this.interval),this.interval=void 0),this.container.remove(),this.state=void 0}update(e){const{connectionState:t}=e;if(this.state===t)return;let i;if(this.state=t,t===ui.Z.CONNECTED){i=document.createElement("span"),i.classList.add("call-description-duration");const t=()=>{i.innerText=(0,pi.Z)(e.duration,!0)};this.interval=window.setInterval(t,1e3),t()}else{let s;switch(t){case ui.Z.PENDING:s=e.isOutgoing?"Call.StatusRinging":"Call.StatusCalling";break;case ui.Z.REQUESTING:s="Call.StatusRequesting";break;case ui.Z.EXCHANGING_KEYS:s="VoipExchangingKeys";break;case ui.Z.CLOSED:s=void 0!==e.connectedAt?"Call.StatusEnded":"Call.StatusFailed";break;default:s="Call.StatusConnecting"}i=(0,T.ag)(s),void 0!==this.interval&&(clearInterval(this.interval),this.interval=void 0)}this.container.classList.toggle("has-duration",t===ui.Z.CONNECTED),(0,Z.Z)(this.container,i),this.container.parentElement||this.appendTo.append(this.container)}}var mi=i(925);class gi extends bt{constructor(e,t){super({width:36,height:36,getPart:e=>this.getItem().getPart(e?"unmute":"mute"),getColor:e?e=>e?[255,255,255]:[158,158,158]:void 0,skipAnimation:t}),this.add({name:"voice_mini",parts:[{startFrame:0,endFrame:35,name:"hand-to-muted"},{startFrame:36,endFrame:68,name:"unmute"},{startFrame:69,endFrame:98,name:"mute"},{startFrame:99,endFrame:135,name:"muted-to-hand"},{startFrame:136,endFrame:171,name:"unmuted-to-hand"}]})}}const vi="call",bi={width:400,height:580};let yi=Object.assign({},bi);class wi extends ye.Z{constructor(e){super("popup-call",{withoutOverlay:!0,closable:!0}),this.instance=e,this.onFullScreenClick=()=>{(0,Lt.Dj)(this.container)},this.onFullScreenChange=()=>{const e=(0,Lt.rB)(),{btnFullScreen:t,btnExitFullScreen:i}=this,n=this.container.classList.contains("is-full-screen");this.container.classList.toggle("is-full-screen",e),t&&t.classList.toggle("hide",e),i&&i.classList.toggle("hide",!e),this.btnClose.classList.toggle("hide",e),e!==n&&(s.Z.checkAnimations(e),De.Z.setThemeColor(e?"#000000":void 0),this.resizeVideoContainers())},this.videoContainers={};const{container:t,listenerSetter:i}=this;t.classList.add(vi,"night");const n=document.createElement("div");n.classList.add(vi+"-avatar");const a=this.peerId=this.instance.interlocutorUserId.toPeerId(),o=new m.Z;o.classList.add("avatar-full"),o.updateWithOptions({isBig:!0,peerId:a}),n.append(o);const r=new P.Z({peerId:a}).element;r.classList.add(vi+"-title");const d=document.createElement("div");d.classList.add(vi+"-subtitle"),this.description=new fi(d);const l=this.emojisSubtitle=document.createElement("div");l.classList.add(vi+"-emojis"),t.append(n,r,d),f.IS_MOBILE?this.header.append(l):(this.btnFullScreen=(0,v.Z)("fullscreen"),this.btnExitFullScreen=(0,v.Z)("smallscreen hide"),(0,L.fc)(this.btnFullScreen,this.onFullScreenClick,{listenerSetter:i}),(0,L.fc)(this.btnExitFullScreen,(()=>(0,Lt.C8)()),{listenerSetter:i}),(0,Lt.Ms)(this.container,this.onFullScreenChange,i),this.header.prepend(this.btnExitFullScreen),this.header.append(this.btnFullScreen),t.append(l)),this.partyStates=document.createElement("div"),this.partyStates.classList.add(vi+"-party-states"),this.partyMutedState=document.createElement("div"),this.partyMutedState.classList.add(vi+"-party-state");const c=(0,T.ag)("VoipUserMicrophoneIsOff",[new P.Z({peerId:a,onlyFirstName:!0,limitSymbols:18}).element]);c.classList.add(vi+"-party-state-text");const h=new gi(!1,!0);h.setState(!1,!1),this.partyMutedState.append(h.container,c),this.partyStates.append(this.partyMutedState),this.container.append(this.partyStates),this.makeButton=Yt.bind(null,vi,this.listenerSetter),this.constructFirstButtons(),this.constructSecondButtons(),i.add(e)("state",(()=>{this.updateInstance()})),i.add(e)("mediaState",(()=>{this.updateInstance()})),this.movablePanel=new si({listenerSetter:i,movableOptions:{minWidth:400,minHeight:580,element:this.element,verifyTouchTarget:e=>{const t=e.target;return!((0,Q.Z)(t,"call-button")||(0,Q.Z)(t,"btn-icon")||(0,Lt.rB)())}},previousState:this.instance.wasTryingToJoin||this.instance.isOutgoing?yi:Object.assign({},bi)});const u=this.movablePanel.movable;u&&this.listenerSetter.add(u)("resize",(()=>{this.resizeVideoContainers()}));const p=this.controlsHover=new Nt.Z;p.setup({element:this.container,listenerSetter:this.listenerSetter,showOnLeaveToClassName:"call-buttons"}),p.showControls(!1),this.addEventListener("close",(()=>{const{movablePanel:e}=this;yi=e.state,this.microphoneIcon.destroy(),e.destroy()})),this.updateInstance()}getCallInstance(){return this.instance}constructFirstButtons(){const e=this.firstButtonsRow=document.createElement("div");e.classList.add(vi+"-buttons","is-first");const t=ni.bind(null,"btn-disabled"),i=this.btnVideo=this.makeButton({text:"Call.Camera",icon:"videocamera_filled",callback:()=>{const e=t([i,s],!0);this.instance.toggleVideoSharing().finally(e)}}),s=this.btnScreen=this.makeButton({text:"Call.Screen",icon:"sharescreen_filled",callback:()=>{const e=t([i,s],!0);this.instance.toggleScreenSharing().finally(e)}});qt.Z||(s.classList.add("hide"),this.container.classList.add("no-screen")),this.muteI18nElement=new T.ZP.IntlElement({key:"Call.Mute"});const n=this.btnMute=this.makeButton({text:this.muteI18nElement.element,callback:()=>{this.instance.toggleMuted()}}),a=this.microphoneIcon=new gi(!0,!0);n.firstElementChild.append(a.container),e.append(i,s,n),this.container.append(e)}constructSecondButtons(){const e=this.secondButtonsRow=document.createElement("div");e.classList.add(vi+"-buttons","is-second"),this.declineI18nElement=new T.ZP.IntlElement({key:"Call.Decline"});const t=this.btnDecline=this.makeButton({text:this.declineI18nElement.element,icon:"endcall_filled",callback:()=>{this.instance.hangUp("phoneCallDiscardReasonHangup")},isDanger:!0}),i=this.btnAccept=this.makeButton({text:"Call.Accept",icon:"phone_filled",callback:()=>{this.instance.acceptCall()},isConfirm:!0});e.append(t,i),this.container.append(e)}createVideoContainer(e){const t=vi+"-video",i=document.createElement("div");i.classList.add(t+"-container"),e.classList.add(t),e.paused&&e.play(),(0,L.fc)(i,(()=>{if(!i.classList.contains("small"))return;const e=Object.values(this.videoContainers).find((e=>!e.classList.contains("small")));e.classList.add("small"),e.style.cssText=i.style.cssText,i.classList.remove("small"),i.style.cssText="",this.resizeVideoContainers()}));const s=Ut(e);return s.classList.add(t+"-blur"),i.append(s,e),i}updateInstance(){const{instance:e}=this,{connectionState:t}=e;if(t===ui.Z.CLOSED)return this.container.classList.contains("is-full-screen")&&(0,Lt.C8)(),this.btnVideo.classList.add("disabled"),void this.hide();const i=!e.isOutgoing&&t===ui.Z.PENDING;this.declineI18nElement.compareAndUpdate({key:t===ui.Z.PENDING?"Call.Decline":"Call.End"}),this.btnAccept.classList.toggle("disable",!i),this.btnAccept.classList.toggle("hide-me",!i),this.container.classList.toggle("two-button-rows",i);const s=e.isMuted,n=()=>{this.btnMute.firstElementChild.classList.toggle("active",s)},a=this.microphoneIcon.getItem().player;this.microphoneIcon.setState(!s,!s,n),a||n(),this.muteI18nElement.compareAndUpdate({key:s?"VoipUnmute":"Call.Mute"});const o=e.isSharingVideo;this.btnVideo.firstElementChild.classList.toggle("active",o);const r=e.isSharingScreen;this.btnScreen.firstElementChild.classList.toggle("active",r);const d=e.getMediaState("output");(0,ge.Z)({element:this.partyMutedState,className:"is-visible",forwards:!!(null==d?void 0:d.muted),duration:300});const l=this.videoContainers,c=Object.assign({},l);["input","output"].forEach((t=>{const i=e.getMediaState(t),s=e.getVideoElement(t),n=!!(s&&s.videoWidth&&s.videoHeight);!s||n||s.dataset.hasPromise||(s.dataset.hasPromise="1",(0,mi.Z)(s).then((()=>{delete s.dataset.hasPromise,this.updateInstance()})));const a=!!s&&n&&!(!i||"active"!==i.videoState&&"active"!==i.screencastState);let o=l[t];a&&s&&!o&&(o=l[t]=this.createVideoContainer(s),this.container.append(o)),!a&&o&&(o.remove(),delete l[t])}));{const e=l.input,t=l.output;Object.keys(c).length!==Object.keys(l).length&&e&&e.classList.toggle("small",!!t),t&&!e&&t.classList.remove("small")}this.resizeVideoContainers(),this.container.classList.toggle("no-video",!Object.keys(l).length),!this.emojisSubtitle.textContent&&t{(0,Z.Z)(this.emojisSubtitle,(0,_.Z)(e.join("")))})),this.setDescription()}resizeVideoContainers(){Object.values(this.videoContainers).forEach((e=>{if(e.classList.contains("small")){const t=e.querySelector("video"),i=this.movablePanel.state,s=240,n=240,a=t.videoHeight>t.videoWidth,o=a?n:s,r=1/3*((0,Lt.rB)()?65535:a?i.height:i.width),d=a?t.videoWidth/t.videoHeight:1,l=a?1:t.videoHeight/t.videoWidth;e.style.width=r*d+"px",e.style.height=r*l+"px",e.style.maxWidth=o*d+"px",e.style.maxHeight=o*l+"px"}else e.style.cssText=""}))}setDescription(){this.description.update(this.instance)}}var Si=i(2069),Ci=i(9585),Li=i(2493);const Ei="topbar-call";class Ii{constructor(e){this.managers=e,this.onState=()=>{this.updateInstance(this.instance)};const t=this.listenerSetter=new U.Z;t.add(Li.Z)("instance",(({instance:e})=>{this.instance||this.updateInstance(e)})),t.add(Li.Z)("accepting",(e=>{this.instance!==e&&this.updateInstance(e)})),t.add(le.ZP)("instance",(e=>{this.updateInstance(e)})),t.add(d.Z)("group_call_update",(e=>{const t=le.ZP.groupCall;(null==t?void 0:t.id)===e.id&&this.updateInstance(t)})),t.add(Ci.Z.ANALYSER_LISTENER)("amplitude",(({amplitudes:e,type:t})=>{const{weave:i}=this;if(!e.length||!i)return;let s=0;for(let t=0;ts?n:s}i.setAmplitude(s)}))}clearCurrentInstance(){this.instance&&(this.center.textContent="",this.currentDescription&&(this.currentDescription.detach(),this.currentDescription=void 0),this.instance=void 0,this.instanceListenerSetter.removeAll())}updateInstance(e){this.construct&&(this.construct(),this.construct=void 0);const t=this.instance!==e;t&&(this.clearCurrentInstance(),this.instance=e,this.instanceListenerSetter=new U.Z,this.instanceListenerSetter.add(e)("state",this.onState),e instanceof hi.Z?this.currentDescription=this.groupCallDescription:(this.currentDescription=this.callDescription,this.instanceListenerSetter.add(e)("muted",this.onState)),this.container.classList.toggle("is-call",!(e instanceof hi.Z)));const i=this.instance.isMuted,s=e instanceof hi.Z?e.state:function(e,t){switch(e){case ui.Z.CLOSING:case ui.Z.CLOSED:return lt.Z.CLOSED;case ui.Z.CONNECTED:return t?lt.Z.MUTED:lt.Z.UNMUTED;default:return lt.Z.CONNECTING}}(e.connectionState,i),{weave:n}=this;n.componentDidMount();const a=s===lt.Z.CLOSED;(!document.body.classList.contains("is-calling")||t||a)&&(a&&n.setAmplitude(0),(0,ge.Z)({element:document.body,className:"is-calling",forwards:!a,duration:250,onTransitionEnd:a?()=>{n.componentWillUnmount(),this.clearCurrentInstance()}:void 0})),a||(n.setCurrentState(s,!0),this.setTitle(e),this.setDescription(e),this.groupCallMicrophoneIconMini.setState(!i))}setDescription(e){return this.currentDescription.update(e)}setTitle(e){if(e instanceof hi.Z)return this.groupCallTitle.update(e);(0,Z.Z)(this.center,new P.Z({peerId:e.interlocutorUserId.toPeerId()}).element)}construct(){const{listenerSetter:e}=this,t=this.container=document.createElement("div");t.classList.add("sidebar-header",Ei+"-container");const i=document.createElement("div");i.classList.add(Ei+"-left");const s=this.groupCallMicrophoneIconMini=new gi,n=(0,v.Z)();n.append(s.container),i.append(n);const a=(0,G.Z)((()=>{this.instance.toggleMuted()}),600,!0);(0,L.fc)(n,(e=>{(0,C.Z)(e),a()}),{listenerSetter:e});const o=this.center=document.createElement("div");o.classList.add(Ei+"-center"),this.groupCallTitle=new $t(o),this.groupCallDescription=new Wt(i),this.callDescription=new fi(i);const r=document.createElement("div");r.classList.add(Ei+"-right");const d=(0,v.Z)("endcall_filled");r.append(d),(0,L.fc)(d,(e=>{(0,C.Z)(e);const{instance:t}=this;t&&(t instanceof hi.Z?t.hangUp():t.hangUp("phoneCallDiscardReasonHangup"))}),{listenerSetter:e}),(0,L.fc)(t,(()=>{if(this.instance instanceof hi.Z){if(ye.Z.getPopups(ci).length)return;(new ci).show()}else if(this.instance instanceof Si.Z){if(ye.Z.getPopups(wi).find((e=>e.getCallInstance()===this.instance)))return;new wi(this.instance).show()}}),{listenerSetter:e}),t.append(i,o,r);const l=this.weave=new ut,c=l.render(Ei+"-weave");t.prepend(c),document.getElementById("column-center").prepend(t),l.componentDidMount()}}var Mi=i(2614),Zi=i(8479),Pi=i(7401),Ti=i(2575),ki=i(6009),xi=i(493),Ai=i(496),_i=i(3189),Fi=i(2131),Di=i(3725),Ri=i(2890),Bi=i(2586),Ni=i(7298),Oi=i(6702),Ui=i(7746),Hi=i(3785),zi=i(2491),ji=i(1722),Gi=i(3781),Vi=i(4993),Ki=i(5990),Wi=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const $i=new class{constructor(){this.notificationsShown={},this.notificationIndex=0,this.notificationsCount=0,this.soundsPlayed={},this.vibrateSupport=Fi.Z,this.faviconElements=Array.from(document.head.querySelectorAll('link[rel="icon"], link[rel="alternate icon"]')),this.titleBackup=document.title,this.titleChanged=!1,this.stopped=!1,this.settings={},this.pushInited=!1,this.updateLocalSettings=()=>{const e=["notify_nodesktop","notify_volume","notify_novibrate","notify_nopreview","notify_nopush"].map((()=>{}));Promise.all(e).then((e=>{if(this.settings.nodesktop=e[0],this.settings.volume=void 0===e[1]?.5:e[1],this.settings.novibrate=e[2],this.settings.nopreview=e[3],this.settings.nopush=e[4],this.pushInited){const e=!this.settings.nopush&&!this.settings.nodesktop&&Oi.default.isAvailable||!1;e!==(!1!==this.registeredDevice)&&(e?Oi.default.subscribe():Oi.default.unsubscribe())}Oi.default.setSettings(this.settings)})),ce.Z.getState().then((e=>{this.settings.nosound=!e.settings.notifications.sound}))},this.requestPermission=()=>{Notification.requestPermission(),window.removeEventListener("click",this.requestPermission)}}construct(e){this.managers=e,this.log=(0,r.kg)("NOTIFICATIONS"),navigator.vibrate=navigator.vibrate||navigator.mozVibrate||navigator.webkitVibrate,this.setAppBadge=navigator.setAppBadge&&navigator.setAppBadge.bind(navigator),this.setAppBadge&&this.setAppBadge(0),this.notificationsUiSupport="Notification"in window||"mozNotification"in navigator,this.notifySoundEl=document.createElement("div"),this.notifySoundEl.id="notify-sound",document.body.append(this.notifySoundEl),this.topMessagesDeferred=(0,Di.Z)(),it.Z.addEventListener("deactivated",(()=>{this.stop()})),it.Z.addEventListener("activated",(()=>{this.stopped&&this.start()})),Bi.Z.addEventListener("change",(e=>{this.stopped||(e||this.clear(),this.toggleToggler())})),d.Z.addEventListener("notification_reset",(e=>{this.soundReset(e)})),d.Z.addEventListener("notification_cancel",(e=>{this.cancel(e)})),this.setAppBadge&&d.Z.addEventListener("folder_unread",(e=>{0===e.id&&this.setAppBadge(e.unreadUnmutedPeerIds.size)})),Oi.default.addEventListener("push_init",(e=>{this.pushInited=!0,this.settings.nodesktop||this.settings.nopush?this.unregisterDevice(e):e?this.registerDevice(e):Oi.default.subscribe()})),Oi.default.addEventListener("push_subscribe",(e=>{this.registerDevice(e)})),Oi.default.addEventListener("push_unsubscribe",(e=>{this.unregisterDevice(e)})),d.Z.addEventListener("dialogs_multiupdate",(()=>{this.topMessagesDeferred.resolve()}),{once:!0}),Oi.default.addEventListener("push_notification_click",(e=>{if("push_settings"===e.action)return;if("mute1d"===e.action)return void this.managers.apiManager.invokeApi("account.updateDeviceLocked",{period:86400}).then((()=>{}));const t=e.custom&&e.custom.peerId.toPeerId();console.log("click",e,t),t&&this.topMessagesDeferred.then((()=>Wi(this,void 0,void 0,(function*(){const i=t.isAnyChat()?t.toChatId():void 0;i&&!(yield this.managers.appChatsManager.hasChat(i))||t.isUser()&&!(yield this.managers.appUsersManager.hasUser(t.toUserId()))||ys.setInnerPeer({peerId:t,lastMsgId:(0,Gi.Z)(+e.custom.msg_id)})}))))}))}buildNotification({message:e,fwdCount:t,peerReaction:i,peerTypeNotifySettings:s}){return Wi(this,void 0,void 0,(function*(){const n=e.peerId,a=n.isAnyChat(),o={},[r,d=!1]=yield Promise.all([this.managers.appPeersManager.getPeerString(n),a&&this.managers.appPeersManager.isForum(n)]);let l,c=!1;if(s.show_previews)if("message"===e._&&e.fwd_from&&t>1)l=T.ZP.format("Notifications.Forwarded",!0,[t]);else{l=yield(0,Ai.Z)({message:e,plain:!0});const t=null==i?void 0:i.reaction;if("reactionEmoji"===(null==t?void 0:t._)){const e="Notification.Contact.Reacted",i=[(0,Ui.Z)(t.emoticon),l];l=T.ZP.format(e,!0,i)}else c=!0}else l=T.ZP.format("Notifications.New",!0);i&&(o.noIncrement=!0,o.silent=!0);const h={plainText:!0,managers:this.managers},u=d?(0,Vi.Z)(e,d):void 0,p=i?(0,Mt.Z)(i.peer_id):e.fromId,f=o.title=yield(0,xi.Z)(Object.assign(Object.assign({},h),{peerId:n,threadId:u}));if(d){const t=yield(0,xi.Z)(Object.assign(Object.assign({},h),{peerId:n}));o.title+=` (${t})`,c&&p!==e.peerId&&(l=(yield(0,xi.Z)(Object.assign(Object.assign({},h),{peerId:p})))+": "+l)}else a&&p!==e.peerId&&(o.title=(yield(0,xi.Z)(Object.assign(Object.assign({},h),{peerId:p})))+" @ "+o.title);o.title=(0,zi.Z)(o.title),o.onclick=()=>{ys.setInnerPeer({peerId:n,lastMsgId:e.mid,threadId:u})},o.message=l,o.key="msg"+e.mid,o.tag=r,o.silent=!0;const m=yield this.managers.appPeersManager.getPeerPhoto(n);if(m){const t=yield this.managers.appAvatarsManager.loadAvatar(n,m,"photo_small");if(!(i||(e=yield this.managers.appMessagesManager.getMessageByPeer(e.peerId,e.mid))&&e.pFlags.unread))return;o.image=t}else{let{avatarCanvas:e,avatarContext:t}=this;if(this.avatarCanvas)t.clearRect(0,0,e.width,e.height);else{e=this.avatarCanvas=document.createElement("canvas"),t=this.avatarContext=e.getContext("2d");const i=54,s=1;e.dpr=s,e.width=e.height=i*s,this.avatarGradients={}}const i=(0,Ki.Z)(n,!0);let s=this.avatarGradients[i];if(!s){s=this.avatarGradients[i]=t.createLinearGradient(e.width/2,0,e.width/2,e.height);const n=pt.Z.getProperty(`peer-avatar-${i}-top`),a=pt.Z.getProperty(`peer-avatar-${i}-bottom`);s.addColorStop(0,n),s.addColorStop(1,a)}t.fillStyle=s,(0,Ri.Z)(t,e.width/2,e.height/2,e.width/2),t.fill();const a=20*e.dpr,r=(0,Hi.Z)(f);t.font=`700 ${a}px ${_i.bt}`,t.textBaseline="middle",t.textAlign="center",t.fillStyle="white",t.fillText(r.text,e.width/2,e.height*(window.devicePixelRatio,.5625)),o.image=e.toDataURL()}const g={custom:{msg_id:""+e.mid,peerId:""+n},description:"",loc_key:"",loc_args:[],mute:"",random_id:0,title:""};(yield this.notify(o,g))&&this.registeredDevice&&Oi.default.ignorePushByMid(n,e.mid)}))}toggleToggler(e=Bi.Z.isIdle){if(f.IS_MOBILE)return;const t=e=>{this.titleChanged=!1,document.title=this.titleBackup,this.setFavicon()};window.clearInterval(this.titleInterval),this.titleInterval=0,e?this.titleInterval=window.setInterval((()=>{const e=this.notificationsCount;if(e)if(this.titleChanged)t();else{this.titleChanged=!0,document.title=T.ZP.format("Notifications.Count",!0,[e]);const t=document.createElement("canvas");t.width=32*window.devicePixelRatio,t.height=t.width;const i=t.getContext("2d");i.beginPath(),i.arc(t.width/2,t.height/2,t.width/2,0,2*Math.PI,!1),i.fillStyle="#3390ec",i.fill();let s=24,n=""+e;e<10?s=22:e<100?s=20:(n="99+",s=16),s*=window.devicePixelRatio,i.font=`700 ${s}px ${_i.bt}`,i.textBaseline="middle",i.textAlign="center",i.fillStyle="white",i.fillText(n,t.width/2,.5625*t.height),this.setFavicon(t.toDataURL())}else this.toggleToggler(!1)}),1e3):t()}setFavicon(e){this.prevFavicon!==e&&(this.prevFavicon=e,this.faviconElements.forEach(((t,i,s)=>{var n;const a=t.cloneNode();(n=a.dataset).href||(n.href=a.href),null!=e||(e=a.dataset.href),a.href=e,t.replaceWith(s[i]=a)})))}notify(e,t){var i;return Wi(this,void 0,void 0,(function*(){if(this.log("notify",e,Bi.Z.isIdle,this.notificationsUiSupport,this.stopped),this.stopped)return;e.image||(e.image="assets/img/logo_filled_rounded.png"),e.noIncrement||++this.notificationsCount,this.titleInterval||this.toggleToggler();const s=++this.notificationIndex,n=e.key||"k"+s;this.notificationsShown[n]=!0;const a=(0,Ni.Z)();if(this.settings.volume>0&&!this.settings.nosound&&(this.testSound(this.settings.volume),this.soundsPlayed[e.tag]=a),!this.notificationsUiSupport||"Notification"in window&&"granted"!==Notification.permission)return;if(this.settings.nodesktop)return this.vibrateSupport&&!this.settings.novibrate?void navigator.vibrate([200,100,200]):void 0;if(!("Notification"in window))return;let o;const r={badge:"assets/img/logo_plain.svg",icon:e.image||"",body:e.message||"",tag:e.tag||"",silent:e.silent||!1,data:t};try{if(e.tag)for(const t in this.notificationsShown){const i=this.notificationsShown[t];"boolean"!=typeof i&&i.tag===e.tag&&(i.hidden=!0)}o=new Notification(e.title,r)}catch(t){try{const t=yield navigator.serviceWorker.ready;yield t.showNotification(e.title,r);const i=yield t.getNotifications({tag:r.tag});o=i[i.length-1]}catch(t){this.log.error("creating push error",t,e,r)}if(!o)return this.notificationsUiSupport=!1,void Oi.default.setLocalNotificationsDisabled()}return o.onclick=()=>{var t;this.log("notification onclick"),o.close(),ji.Z.focus(),this.clear(),null===(t=e.onclick)||void 0===t||t.call(e)},o.onclose=()=>{this.log("notification onclose"),o.hidden||(delete this.notificationsShown[n],this.clear())},null===(i=o.show)||void 0===i||i.call(o),this.notificationsShown[n]=o,f.IS_MOBILE||setTimeout((()=>{this.hide(n)}),8e3),!0}))}getLocalSettings(){return this.settings}hide(e){const t=this.notificationsShown[e];t&&this.closeNotification(t)}soundReset(e){delete this.soundsPlayed[e]}testSound(e){const t=(0,Ni.Z)();if(this.nextSoundAt&&t\n \n `,this.notifySoundEl.append(s),s.addEventListener("ended",(()=>{s.remove()}),{once:!0})}cancel(e){const t=this.notificationsShown[e];this.log("cancel",e,t),t&&(this.notificationsCount>0&&--this.notificationsCount,this.closeNotification(t),delete this.notificationsShown[e])}closeNotification(e){try{"boolean"!=typeof e&&e.close&&(this.log("close notification",e),e.hidden=!0,e.close())}catch(e){}}clear(){this.log.warn("clear");for(const e in this.notificationsShown){const t=this.notificationsShown[e];this.closeNotification(t)}this.notificationsShown={},this.notificationsCount=0,Oi.default.hidePushNotifications()}start(){if(this.log("start"),this.updateLocalSettings(),d.Z.addEventListener("settings_updated",this.updateLocalSettings),Oi.default.start(),!this.notificationsUiSupport)return!1;"Notification"in window&&"granted"!==Notification.permission&&"denied"!==Notification.permission&&window.addEventListener("click",this.requestPermission);try{"onbeforeunload"in window&&window.addEventListener("beforeunload",this.clear)}catch(e){}}stop(){this.log("stop"),this.clear(),window.clearInterval(this.titleInterval),this.titleInterval=0,this.setFavicon(),this.stopped=!0}registerDevice(e){if(this.registeredDevice&&(0,Te.Z)(this.registeredDevice,e))return!1;this.managers.apiManager.invokeApi("account.registerDevice",{token_type:e.tokenType,token:e.tokenValue,other_uids:[],app_sandbox:!1,secret:new Uint8Array}).then((()=>{this.log("registered device"),this.registeredDevice=e}),(e=>{e.handled=!0}))}unregisterDevice(e){if(!this.registeredDevice)return!1;this.managers.apiManager.invokeApi("account.unregisterDevice",{token_type:e.tokenType,token:e.tokenValue,other_uids:[]}).then((()=>{this.registeredDevice=!1}),(e=>{e.handled=!0}))}};Je.GO&&(Je.GO.uiNotificationsManager=$i);const qi=$i;var Yi=i(2423),Qi=i(5400),Xi=i(3591),Ji=i(3061),es=i(177),ts=i(236),is=i(5936),ss=i(3815),ns=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function as(e,t=!1){return ns(this,void 0,void 0,(function*(){const i=[],s=(e,n)=>ns(this,void 0,void 0,(function*(){if(e.isDirectory){const t=e.createReader();yield new Promise(((e,i)=>{t.readEntries((t=>ns(this,void 0,void 0,(function*(){for(const e of t)yield s(e,n);e()}))))}))}else if(e)if(t)i.push(e.type);else{const t=n.getAsFile(),s=e instanceof File?e:e instanceof DataTransferItem?e.getAsFile():yield new Promise(((i,s)=>e.file(i,(e=>i(t)))));if(!s)return;i.push(s)}}));if(e instanceof DragEvent&&e.dataTransfer.files&&!e.dataTransfer.items)for(let s=0;s{!e.noCancelEvent&&(0,C.Z)(null);let i,s,n=t.href;const a=new URL(n),o=a.host.match(/(.+?)\.t(?:elegram)?\.me/);o&&!ue.BX.has(o[1])&&(a.pathname=o[1]+("/"===a.pathname?"":a.pathname),n=a.toString()),e.noPathnameParams||(i=new URL(n).pathname.split("/").slice(1)),e.noUriParams||(s=(0,ls.Z)(n));const r=e.callback({pathnameParams:i,uriParams:s},t);return void 0===r&&r}}var hs,us=i(4524),ps=i(9439),fs=i(54),ms=i(3772),gs=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};!function(e){e[e.CHATLIST=0]="CHATLIST",e[e.CHAT=1]="CHAT",e[e.PROFILE=2]="PROFILE"}(hs||(hs={}));class vs extends l.Z{constructor(){super(...arguments),this.columnEl=document.getElementById("column-center"),this.offline=!1,this.updateStatusInterval=0,this.setPeerPromise=null,this.chats=[],this.cacheStorage=new is.Z("cachedFiles"),this.onHashChange=e=>{try{this.onHashChangeUnsafe(e)}catch(e){this.log.error("hash change error",e)}},this.onHashChangeUnsafe=e=>{const t=location.hash;e||Y.Z.replaceState();const i=t.split("?"),s=(0,ls.Z)(t,i);if(this.log("hashchange",t,i[0],s),t)if(s.tgaddr)this.openUrl(s.tgaddr);else switch(i[0]){default:s.p=i[0].slice(1);case"#/im":{if(!Object.keys(s).length)break;const e=s.p,t=void 0!==s.post?(0,Gi.Z)(+s.post):void 0;"@"===e[0]?this.openUsername({userName:e,lastMsgId:t}):this.setInnerPeer({peerId:t?e.toPeerId(!0):e.toPeerId(),lastMsgId:t})}}},this.setSettings=()=>{const{messagesTextSize:e}=d.Z.settings;this.customEmojiSize=(0,he.C)(e+4,e+4),document.documentElement.style.setProperty("--messages-text-size",e+"px"),this.customEmojiSize&&(document.querySelectorAll("middle-ellipsis-element").forEach((t=>{t.disconnectedCallback(),t.dataset.fontSize=""+e,t.title&&(t.textContent=t.title),t.connectedCallback()})),document.querySelectorAll(".chat custom-emoji-renderer-element").forEach((e=>{e.forceRenderAfterSize=!0}))),document.body.classList.toggle("animation-level-0",!Ne.Z.isAvailable("animations")),document.body.classList.toggle("animation-level-1",!1),document.body.classList.toggle("animation-level-2",Ne.Z.isAvailable("animations")),this.chatsSelectTabDebounced=(0,j.Z)((()=>{var e;null===(e=this.chat.topbar.pinnedMessage)||void 0===e||e.setCorrectIndex(0),this.managers.apiFileManager.setQueueId(this.chat.bubbles.lazyLoadQueue.queueId)}),Ne.Z.isAvailable("animations")?250:0,!1,!0);const t=s.Z.setLoop(d.Z.settings.stickers.loop),i=!!["stickers_chat","stickers_panel"].filter((e=>s.Z.setAutoplay(Ne.Z.isAvailable(e),e))).length;(t||i)&&s.Z.checkAnimations2(!1);for(const e of this.chats)e.setAutoDownloadMedia();T.ZP.setTimeFormat(d.Z.settings.timeFormat),this.toggleChatGradientAnimation(this.chat)},this.onDocumentPaste=(e,t)=>gs(this,void 0,void 0,(function*(){const i=(0,He.Y)();if(e instanceof DragEvent){const t=e.dataTransfer.types;(t.contains?t.contains("Files"):t.indexOf("Files")>=0)&&(0,C.Z)(e)}const s=yield as(e);if(((yield this.canDrag())||i)&&s.length){if(i)return void i.addFiles(s);const e=this.chat.input;e.willAttachType=t||(ot.Z.has(s[0].type)?"media":"document"),ye.Z.createPopup(He.Z,this.chat,s,e.willAttachType)}}))}get myId(){return d.Z.myId}get chat(){return this.chats[this.chats.length-1]}construct(e){this.managers=e;const{apiUpdatesManager:t}=e;t.attach(T.ZP.lastRequestedLangCode),y.Z.construct(e),qi.construct(e),qi.start(),this.log=(0,r.kg)("IM",r.v9.Log|r.v9.Warn|r.v9.Debug|r.v9.Error),this.backgroundPromises={},ts.h.settings.themes.forEach((e=>{const t=e.settings;if(!t)return;const{wallpaper:i}=t,s=i.slug;if(!s)return;const n="assets/img/"+s+".svg"+(f.IS_FIREFOX?"?1":"");this.backgroundPromises[s]=Promise.resolve(n)})),this.selectTab(hs.CHATLIST),Bi.Z.addEventListener("change",(e=>{this.offline=e,this.updateStatus(),e?clearInterval(this.updateStatusInterval):this.updateStatusInterval=window.setInterval((()=>this.updateStatus()),5e4)})),this.chatsContainer=document.createElement("div"),this.chatsContainer.classList.add("chats-container","tabs-container"),this.chatsContainer.dataset.animation="navigation",this.emojiAnimationContainer=document.createElement("div"),this.emojiAnimationContainer.classList.add("emoji-animation-container"),this.appendEmojiAnimationContainer(o.Z.activeScreen),this.columnEl.append(this.chatsContainer),this.createNewChat(),this.chatsSelectTab(this.chat.container),Y.Z.onHashChange=this.onHashChange,this.setSettings(),d.Z.addEventListener("settings_updated",this.setSettings);const i=e=>{document.body.classList.toggle("is-premium",e)};d.Z.addEventListener("premium_toggle",i),i(d.Z.premium),this.managers.rootScope.getPremium().then(i),(0,H.ZP)((()=>{s.Z.setOnlyOnePlayableGroup("lock"),s.Z.checkAnimations2(!0)}),(()=>{s.Z.setOnlyOnePlayableGroup(),s.Z.checkAnimations2(!1)})),De.Z.AppBackgroundTab=ps.Z,f.IS_FIREFOX&&ce.Z.oldVersion&&-1===(0,ki.Z)(ce.Z.oldVersion,"1.4.3")?this.deleteFilesIterative((e=>"image/svg+xml"===e.headers.get("Content-Type"))).then((()=>{this.applyCurrentTheme()})):this.applyCurrentTheme(),o.Z.addEventListener("changeScreen",((e,t)=>{document.body.classList.contains(n.ir)&&document.body.classList.contains(a.HQ)&&a.ZP.toggleSidebar(!1),this.appendEmojiAnimationContainer(t)})),o.Z.addEventListener("resize",(()=>{const e=this.chatsContainer.getBoundingClientRect();Ae.resizeInstances(e.width,e.height).then((()=>{}))})),this.addEventListener("peer_changing",(e=>{this.saveChatPosition(e)})),d.Z.addEventListener("theme_change",(()=>{this.applyCurrentTheme()})),d.Z.addEventListener("choosing_sticker",(e=>{this.setChoosingStickerTyping(!e)})),d.Z.addEventListener("peer_title_edit",(({peerId:e,threadId:t})=>{var i;(null===(i=this.chat)||void 0===i?void 0:i.peerId)!==e||t||void 0===this.tabId||this.overrideHash(e)})),d.Z.addEventListener("peer_typings",(({peerId:e,typings:t})=>{var i;const s=this.chat;if(!s||s.peerId!==e||ss.Z.isOverlayActive||o.Z.activeScreen===o._.mobile&&this.tabId!==hs.CHAT)return;const n=t.find((e=>"sendMessageEmojiInteraction"===e.action._));if("sendMessageEmojiInteraction"===(null===(i=null==n?void 0:n.action)||void 0===i?void 0:i._)){const t=n.action,i=s.bubbles.bubbles[(0,Gi.Z)(n.action.msg_id)];if(i&&i.classList.contains("emoji-big")&&(0,je.Z)(i,s.bubbles.scrollable.container)){const s=i.querySelector(".media-sticker-wrapper:not(.bubble-hover-reaction-sticker):not(.reaction-sticker)");JSON.parse(t.interaction.data).a.forEach((e=>{setTimeout((()=>{(0,L.tH)(s)}),1e3*e.t)})),this.managers.appMessagesManager.setTyping(e,{_:"sendMessageEmojiInteractionSeen",emoticon:t.emoticon})}}}));const l=e=>{const t="version"===e,i=new ye.Z("popup-instance-deactivated",{overlayClosable:!0}),s=document.createElement("div");s.classList.add("instance-deactivated-container"),i.container.replaceWith(s);const n=document.createElement("div");n.classList.add("header"),n.append((0,T.ag)(t?"Deactivated.Version.Title":"Deactivated.Title"));const a=document.createElement("div");a.classList.add("subtitle"),a.append((0,T.ag)(t?"Deactivated.Version.Subtitle":"Deactivated.Subtitle")),s.append(n,a),document.body.classList.add("deactivated");const o=t?()=>{ji.Z.reload()}:()=>{document.body.classList.add("deactivated-backwards"),it.Z.activateInstance(),setTimeout((()=>{document.body.classList.remove("deactivated","deactivated-backwards")}),333)};i.addEventListener("close",o),i.show()};it.Z.addEventListener("deactivated",l),it.Z.deactivatedReason&&l(it.Z.deactivatedReason),this.addEventListener("chat_changing",(({to:e})=>{this.toggleChatGradientAnimation(e)})),d.Z.addEventListener("service_notification",(e=>{(0,Pt.Z)({button:{langKey:"OK",isCancel:!0},description:(0,Qi.ZP)(e.message)})})),d.Z.addEventListener("payment_sent",(({peerId:e,mid:t,receiptMessage:i})=>gs(this,void 0,void 0,(function*(){const s=yield this.managers.appMessagesManager.getMessageByPeer(e,t);if(!s)return;const n=i.action;(0,ee.bC)({langPackKey:"PaymentInfoHint",langPackArguments:[(0,os.Z)(n.total_amount,n.currency),(0,_.Z)(s.media.title)]})})))),window.onSpoilerClick=e=>{const t=(0,Q.Z)(e.target,"spoiler"),i=(0,Q.Z)(t,"spoilers-container")||t.parentElement,s="is-spoiler-visible",n=i.classList.contains(s);n||((0,C.Z)(e),"click"!==L.pf&&window.addEventListener("click",C.Z,{capture:!0,once:!0}));const a=n?0:2;a&&i.classList.add("will-change");const o=i.dataset.spoilerTimeout;null!==o&&(clearTimeout(+o),delete i.dataset.spoilerTimeout),(0,ge.Z)({element:i,className:s,forwards:!0,duration:200,onTransitionEnd:()=>{i.dataset.spoilerTimeout=""+window.setTimeout((()=>{(0,ge.Z)({element:i,className:s,forwards:!1,duration:200,onTransitionEnd:()=>{i.classList.remove("will-change"),delete i.dataset.spoilerTimeout}})}),5e3)},useRafs:a})},document.addEventListener("mousemove",(e=>{const t=(0,Q.Z)(e.target,"media-sticker-wrapper");if(!t||t.classList.contains("custom-emoji")||(0,Q.Z)(e.target,"emoji-big"))return;const i=s.Z.getAnimations(t);null==i||i.forEach((e=>{const{liteModeKey:t,animation:i}=e;t&&(null==i?void 0:i.paused)&&!Ne.Z.isAvailable(t)&&(i instanceof ms.Z?i.playOrRestart():i.play())}))})),d.Z.addEventListener("sticker_updated",(({type:e,faved:t})=>{"faved"===e?(0,ee.bC)({langPackKey:t?"AddedToFavorites":"RemovedFromFavorites"}):t||(0,ee.bC)({langPackKey:"RemovedFromRecent"})})),ce.Z.addEventListener("notificationBuild",(e=>gs(this,void 0,void 0,(function*(){const t=yield this.managers.appPeersManager.isForum(e.message.peerId),i=(0,Vi.Z)(e.message,t);(this.chat.peerId!==e.message.peerId||this.chat.threadId!==i||Bi.Z.isIdle)&&qi.buildNotification(e)})))),this.addEventListener("peer_changed",(({peerId:e})=>gs(this,void 0,void 0,(function*(){document.body.classList.toggle("has-chat",!!e),this.emojiAnimationContainer.textContent="",this.overrideHash(e),ce.Z.updateTabState("chatPeerIds",this.chats.map((e=>e.peerId)).filter(Boolean))})))),Xe.Z.setToCache("chatPositions",{}),(ae.Z||ne.Z)&&(this.topbarCall=new Ii(e)),ae.Z&&(Li.Z.addEventListener("instance",(({instance:e})=>{const t=new wi(e);e.addEventListener("acceptCallOverride",(()=>this.discardCurrentCall(e.interlocutorUserId.toPeerId(),void 0,e).then((()=>(Li.Z.dispatchEvent("accepting",e),!0))).catch((()=>!1)))),t.addEventListener("close",(()=>{const t=Li.Z.currentCall;t&&t!==e&&!e.wasTryingToJoin&&e.hangUp("phoneCallDiscardReasonBusy")}),{once:!0}),t.show()})),Li.Z.addEventListener("incompatible",(e=>gs(this,void 0,void 0,(function*(){(0,ee.bC)({langPackKey:"VoipPeerIncompatible",langPackArguments:[yield(0,de.Z)({peerId:e.toPeerId()})]})}))))),it.Z.activateInstance();const c=()=>{dt.default.setAuthorized(!0)};setInterval(c,k.s2),c(),cs({name:"showMaskedAlert",callback:(e,t)=>{const i=t.href,s=t.cloneNode(!0);s.className="anchor-url",s.innerText=i,s.removeAttribute("onclick"),new ie.Z("popup-masked-url",{titleLangKey:"OpenUrlTitle",descriptionLangKey:"OpenUrlAlert2",descriptionLangArgs:[s],buttons:[{langKey:"Open",callback:()=>{s.click()}}]}).show()}}),cs({name:"execBotCommand",callback:({uriParams:e})=>{const{command:t,bot:i}=e;this.managers.appMessagesManager.sendText(this.chat.peerId,"/"+t+(i?"@"+i:""))}}),cs({name:"searchByHashtag",callback:({uriParams:e})=>{const{hashtag:t}=e;t&&this.chat.initSearch("#"+t+" ")}}),cs({name:"setMediaTimestamp",callback:(e,t)=>{const i=+t.dataset.timestamp;(0,Q.Z)(t,"bubble")?this.chat.bubbles.playMediaWithTimestamp(t,i):(0,Q.Z)(t,"media-viewer-caption")&&window.appMediaViewer.setMediaTimestamp(i)}}),[["addstickers",at.z.STICKER_SET],["addemoji",at.z.EMOJI_SET]].forEach((([e,t])=>{cs({name:e,callback:({pathnameParams:e})=>{if(!e[1])return;const i={_:t,set:e[1]};this.processInternalLink(i)}}),cs({name:e,protocol:"tg",callback:({uriParams:e})=>{const i=this.makeLink(t,e);this.processInternalLink(i)}})})),cs({name:"invoice",callback:({pathnameParams:e})=>{const t={_:at.z.INVOICE,slug:e.length>1?e[1]:e[0].slice(1)};this.processInternalLink(t)}}),cs({name:"joinchat",callback:({pathnameParams:e})=>{const t={_:at.z.JOIN_CHAT,invite:e[1]||decodeURIComponent(e[0]).slice(1)};this.processInternalLink(t)}}),ne.Z&&cs({name:"voicechat",protocol:"tg",callback:({uriParams:e})=>{const t=this.makeLink(at.z.VOICE_CHAT,e);this.processInternalLink(t)}}),cs({name:"im",callback:({pathnameParams:e,uriParams:t},i)=>gs(this,void 0,void 0,(function*(){let s;if(Yi.kO.test(e[0]))s={_:at.z.USER_PHONE_NUMBER,phone:e[0].slice(1)};else if("c"===e[0]){e.shift();const n="thread"in t?t.thread:e[2]&&e[1];s={_:at.z.PRIVATE_POST,channel:e[0],post:e[2]||e[1],thread:n,comment:t.comment,stack:this.getStackFromElement(i),t:t.t}}else{const n="thread"in t?t.thread:e[2]&&e[1];s={_:at.z.MESSAGE,domain:e[0],post:e[2]||e[1],thread:n,comment:t.comment,start:"start"in t?t.start:void 0,stack:this.getStackFromElement(i),t:t.t}}this.processInternalLink(s)}))}),cs({name:"resolve",protocol:"tg",callback:({uriParams:e},t)=>{let i;e.phone?i=this.makeLink(at.z.USER_PHONE_NUMBER,e):"telegrampassport"===e.domain||(i=this.makeLink(at.z.MESSAGE,Object.assign(Object.assign({},e),{stack:this.getStackFromElement(t)}))),this.processInternalLink(i)}}),cs({name:"privatepost",protocol:"tg",callback:({uriParams:e})=>{const t=this.makeLink(at.z.PRIVATE_POST,e);this.processInternalLink(t)}}),cs({name:"invoice",protocol:"tg",callback:({uriParams:e})=>{const t=this.makeLink(at.z.INVOICE,e);this.processInternalLink(t)}}),["joinchat","join"].forEach((e=>{cs({name:e,protocol:"tg",callback:({uriParams:e})=>{const t=this.makeLink(at.z.JOIN_CHAT,e);this.processInternalLink(t)}})})),this.onHashChange(!0),this.attachKeydownListener(),this.handleAutologinDomains(),this.checkForShare()}checkForShare(){const e=ce.Z.share;e&&(ce.Z.share=void 0,new us.Z(void 0,(t=>gs(this,void 0,void 0,(function*(){var i;if(yield this.setPeer({peerId:t}),null===(i=e.files)||void 0===i?void 0:i.length){const t=e.files.some((e=>ot.Z.has(e.type)));new He.Z(this.chat,e.files,t?"media":"document")}else this.managers.appMessagesManager.sendText(t,e.text)})))))}handleUrlAuth(e){const{peerId:t,mid:i,buttonId:s,url:n}=e,a=e=>{window.open(e,"_blank")},o=e=>gs(this,void 0,void 0,(function*(){if("urlAuthResultRequest"===e._){const r=document.createElement("b");r.append(e.domain);const l=yield(0,de.Z)({peerId:d.Z.myId}),c=yield(0,de.Z)({peerId:e.bot.id.toPeerId()}),h={text:"OpenUrlOption1",textArgs:[r.cloneNode(!0),l],checked:!0},u=e.pFlags.request_write_access?{text:"OpenUrlOption2",textArgs:[c],checked:!0}:void 0,p=[h,u],f=(0,Pt.Z)({titleLangKey:"OpenUrlTitle",button:{langKey:"Open"},descriptionLangKey:"OpenUrlAlert2",descriptionLangArgs:[r],checkboxes:p.filter(Boolean)});u&&h.checkboxField.input.addEventListener("change",(()=>{const e=!h.checkboxField.checked;u.checkboxField.toggleDisability(e),e&&(u.checkboxField.checked=!1)}));const[m,g]=yield f;if(!m)return void a(n);const v=yield this.managers.appSeamlessLoginManager.acceptUrlAuth(n,t,i,s,g);return o(v)}"urlAuthResultAccepted"===e._?(e=>{a(e.url)})(e):a(n)}));return this.managers.appSeamlessLoginManager.requestUrlAuth(n,t,i,s).then((e=>{o(e)}))}handleAutologinDomains(){let e;d.Z.addEventListener("app_config",(t=>{e=t}));const t=t=>{var i,s;const n=new URL(t.href);if(e.url_auth_domains.includes(n.hostname))return this.handleUrlAuth({url:t.href}),void(0,C.Z)();if(!e.autologin_token||!e.autologin_domains)return;const a=null!==(i=(s=t.dataset).originalUrl)&&void 0!==i?i:s.originalUrl=t.href;e.autologin_domains.includes(n.hostname)&&(n.searchParams.set("autologin_token",e.autologin_token),t.href=n.toString(),setTimeout((()=>{t.href=a,delete t.dataset.originalUrl}),0))};document.addEventListener("click",(e=>{const i=(0,J.Z)(e.target,"A");(null==i?void 0:i.href)&&t(i)}))}getStackFromElement(e){const t=(0,Q.Z)(e,"bubble");return t?+t.dataset.mid:void 0}deleteFilesIterative(e){return this.cacheStorage.timeoutOperation((t=>{const i=performance.now();return t.keys().then((i=>{const s=i.map((i=>t.match(i).then((t=>e(t)))));return Promise.all(s).then((e=>(e.map(((e,s)=>{if(!e)return;const n=i[s];return t.delete(n)})),Promise.all(e.filter(Boolean)))))})).then((()=>{this.log("deleted files",performance.now()-i)}))}))}toggleChatGradientAnimation(e){this.chats.forEach((t=>{t.gradientRenderer&&t.gradientRenderer.scrollAnimate(Ne.Z.isAvailable("animations")&&t===e)}))}appendEmojiAnimationContainer(e){const t=e===o._.mobile?this.columnEl:document.body;this.emojiAnimationContainer.parentElement!==t&&t.append(this.emojiAnimationContainer)}attachKeydownListener(){const e=new Set(["PageUp","PageDown","Meta","Control"]);document.body.addEventListener("keydown",(t=>{var i;const s=t.key,n=document.getSelection().isCollapsed;if(ss.Z.isOverlayActive||e.has(s))return;const a=t.target,r="INPUT"===a.tagName&&!["checkbox","radio"].includes(a.type)||a.isContentEditable,d=this.chat;if((!(s.startsWith("Arrow")||t.shiftKey&&"Shift"===s)||n)&&("KeyC"!==t.code||!t.ctrlKey&&!t.metaKey||r)){if(!t.altKey||"ArrowUp"!==s&&"ArrowDown"!==s){if("ArrowUp"===s&&"scheduled"!==this.chat.type){if(d.input.editMsgId||!d.input.isInputEmpty())return;this.managers.appMessagesManager.getFirstMessageToEdit(d.peerId,d.threadId).then((e=>{e&&(d.input.initMessageEditing(e.mid),(0,C.Z)(t))}))}else if("ArrowDown"===s)return}else(0,C.Z)(t),this.managers.dialogsStorage.getNextDialog(this.chat.peerId,"ArrowDown"===s,Ie.default.filterId).then((e=>{e&&this.setPeer({peerId:e.peerId})}));if((null===(i=null==d?void 0:d.input)||void 0===i?void 0:i.messageInput)&&a!==d.input.messageInput&&!r&&!z.Z&&(!o.Z.isMobile||this.tabId===hs.CHAT)&&!d.selection.isSelecting&&!d.input.recording&&d.input.messageInput.isContentEditable){d.input.messageInput.focus(),(0,tt.Z)(d.input.messageInput);const e=new KeyboardEvent(t.type,t);d.input.messageInput.dispatchEvent(e)}}}))}makeLink(e,t){return Object.assign({_:e},t)}processInternalLink(e){return gs(this,void 0,void 0,(function*(){switch(null==e?void 0:e._){case at.z.MESSAGE:{const t=e.post?(0,Gi.Z)(+e.post):void 0,i=e.comment?(0,Gi.Z)(+e.comment):void 0,s=e.thread?(0,Gi.Z)(+e.thread):void 0;this.openUsername({userName:e.domain,lastMsgId:t,commentId:i,startParam:e.start,stack:e.stack,threadId:s,mediaTimestamp:e.t&&+e.t});break}case at.z.PRIVATE_POST:{const t=e.channel.toChatId(),i=(t.toPeerId(!0),yield this.managers.appChatsManager.getChat(t));if(!i)try{yield this.managers.appChatsManager.resolveChannel(t)}catch(e){throw(0,ee.bC)({langPackKey:"LinkNotFound"}),e}const s=(0,Gi.Z)(+e.post),n=e.thread?(0,Gi.Z)(+e.thread):void 0;this.op({peer:i,lastMsgId:s,threadId:n,stack:e.stack,mediaTimestamp:e.t&&+e.t});break}case at.z.EMOJI_SET:case at.z.STICKER_SET:new st.Z({id:e.set},e._===at.z.EMOJI_SET).show();break;case at.z.JOIN_CHAT:this.managers.appChatsManager.checkChatInvite(e.invite).then((t=>{t.chat&&this.managers.appChatsManager.saveApiChat(t.chat,!0),"chatInviteAlready"!==t._&&"chatInvitePeek"!==t._?new nt.Z(e.invite,t):this.setInnerPeer({peerId:t.chat.id.toPeerId(!0)})}),(e=>{"INVITE_HASH_EXPIRED"===e.type&&(0,ee.Am)((0,T.ag)("InviteExpired"))}));break;case at.z.VOICE_CHAT:ne.Z&&this.joinGroupCall(e.chat_id.toPeerId(!0),e.id);break;case at.z.USER_PHONE_NUMBER:this.managers.appUsersManager.resolvePhone(e.phone).then((e=>{this.setInnerPeer({peerId:e.id.toPeerId(!1)})})).catch((e=>{"PHONE_NOT_OCCUPIED"===e.type&&(0,ee.bC)({langPackKey:"Alert.UserDoesntExists"})}));break;case at.z.INVOICE:this.managers.appPaymentsManager.getInputInvoiceBySlug(e.slug).then((e=>{this.managers.appPaymentsManager.getPaymentForm(e).then((t=>{new rs.ZP(void 0,e,t)}))}));break;default:this.log.warn("Not supported internal link:",e)}}))}openUrl(e){const{url:t,onclick:i}=(0,Xi.Z)(e);if(!i)return;const s=document.createElement("a");s.href=t,window[i](s)}op(e){return gs(this,void 0,void 0,(function*(){let{peer:t,commentId:i,threadId:s,lastMsgId:n}=e;const a="user"===t._,o=t.id.toPeerId(!a),r="channel"===t._&&t.pFlags.forum;if(i||s||n||!r){if(r&&n&&!s){const t=yield this.managers.appMessagesManager.reloadMessages(o,n);t?s=e.threadId=(0,Vi.Z)(t,r):(s=e.threadId=n,n=e.lastMsgId=void 0)}return s?this.openThread(Object.assign(Object.assign({},e),{peerId:o})):i?this.openComment({peerId:o,msgId:n,commentId:i}):this.setInnerPeer(Object.assign(Object.assign({},e),{peerId:o}))}Ie.default.toggleForumTabByPeerId(o,!0)}))}openPremiumBot(){return this.managers.apiManager.getAppConfig().then((e=>this.openUsername({userName:e.premium_bot_username})))}openUsername(e){const{userName:t}=e;return this.managers.appUsersManager.resolveUsername(t).then((t=>this.op(Object.assign({peer:t},e))),(e=>{"USERNAME_NOT_OCCUPIED"===e.type?(0,ee.bC)({langPackKey:"NoUsernameFound"}):"USERNAME_INVALID"===e.type&&(0,ee.bC)({langPackKey:"Alert.UserDoesntExists"})}))}openThread(e){return gs(this,void 0,void 0,(function*(){return(yield this.managers.appChatsManager.isForum(e.peerId.toChatId()))?(yield this.managers.dialogsStorage.getForumTopicOrReload(e.peerId,e.threadId),this.setInnerPeer(e)):this.managers.appMessagesManager.reloadMessages(e.peerId,e.threadId).then((t=>(t?this.managers.appMessagesManager.generateThreadServiceStartMessage(t):e.lastMsgId=void 0,this.setInnerPeer(Object.assign(Object.assign({},e),{type:"discussion"})))))}))}openComment(e){return this.managers.appMessagesManager.getDiscussionMessage(e.peerId,e.msgId).then((t=>this.openThread({peerId:t.peerId,lastMsgId:e.commentId,threadId:t.mid})))}callUser(e,t){return gs(this,void 0,void 0,(function*(){Li.Z.getCallByUserId(e)||((yield this.managers.appProfileManager.getProfile(e)).pFlags.phone_calls_private?(0,de.Z)({peerId:e.toPeerId()}).then((e=>(0,Pt.Z)({descriptionLangKey:"Call.PrivacyErrorMessage",descriptionLangArgs:[e],button:{langKey:"OK",isCancel:!0}}))):(yield this.discardCurrentCall(e.toPeerId()),Li.Z.startCallInternal(e,"video"===t)))}))}discardCurrentCall(e,t,i){return le.ZP.groupCall&&le.ZP.groupCall!==t?this.discardGroupCallConfirmation(e):Li.Z.currentCall&&Li.Z.currentCall!==i?this.discardCallConfirmation(e):Promise.resolve()}discardCallConfirmation(e){return gs(this,void 0,void 0,(function*(){const t=Li.Z.currentCall;t&&(yield Promise.all([(0,de.Z)({peerId:t.interlocutorUserId.toPeerId(!1)}),(0,de.Z)({peerId:e})]).then((([t,i])=>(0,Pt.Z)({titleLangKey:"Call.Confirm.Discard.Call.Header",descriptionLangKey:e.isUser()?"Call.Confirm.Discard.Call.ToCall.Text":"Call.Confirm.Discard.Call.ToVoice.Text",descriptionLangArgs:[t,i],button:{langKey:"OK"}}))),t.isClosing||(yield t.hangUp("phoneCallDiscardReasonDisconnect")))}))}discardGroupCallConfirmation(e){return gs(this,void 0,void 0,(function*(){const t=le.ZP.groupCall;t&&(yield Promise.all([(0,de.Z)({peerId:t.chatId.toPeerId(!0)}),(0,de.Z)({peerId:e})]).then((([t,i])=>(0,Pt.Z)({titleLangKey:"Call.Confirm.Discard.Voice.Header",descriptionLangKey:e.isUser()?"Call.Confirm.Discard.Voice.ToCall.Text":"Call.Confirm.Discard.Voice.ToVoice.Text",descriptionLangArgs:[t,i],button:{langKey:"OK"}}))),le.ZP.groupCall===t&&(yield t.hangUp()))}))}joinGroupCall(e,t){return gs(this,void 0,void 0,(function*(){const i=e.toChatId(),s=this.managers.appChatsManager.hasRights(i,"manage_call");if(t&&"groupCallDiscarded"===(yield this.managers.appGroupCallsManager.getGroupCallFull(t))._){if(!s)return void(0,ee.bC)({langPackKey:"VoiceChat.Chat.Ended"});yield(0,Pt.Z)({descriptionLangKey:"VoiceChat.Chat.StartNew",button:{langKey:"VoiceChat.Chat.StartNew.OK"}})}(()=>{gs(this,void 0,void 0,(function*(){const e=yield this.managers.appProfileManager.getChatFull(i);let t;if(e.call)t=e.call;else{if(!s)return;t=yield this.managers.appGroupCallsManager.createGroupCall(i)}le.ZP.joinGroupCall(i,t.id,!0,!1)}))})()}))}setCurrentBackground(e=!1){var t,i;const s=De.Z.getTheme(),n=null===(i=null===(t=s.settings)||void 0===t?void 0:t.wallpaper)||void 0===i?void 0:i.slug;if(n){const t=ts.h.settings.themes.find((e=>e.name===s.name));return this.getBackground(n).then((t=>this.setBackground(t,e)),(()=>(s.settings=(0,Zi.Z)(t.settings),this.setCurrentBackground(!0))))}return this.setBackground("",e)}getBackground(e){return this.backgroundPromises[e]?this.backgroundPromises[e]:this.backgroundPromises[e]=this.cacheStorage.getFile("backgrounds/"+e).then((e=>URL.createObjectURL(e)))}setBackground(e,t=!0){this.lastBackgroundUrl=e;const i=this.chats.map((t=>t.setBackground(e)));return i[i.length-1].then((()=>{t&&d.Z.dispatchEvent("background_change")}))}saveChatPosition(e){if(!["chat","discussion"].includes(e.type)||!e.peerId)return;const t=e.bubbles,i=e.peerId+(e.threadId?"_"+e.threadId:""),s=Xe.Z.getFromCache("chatPositions");if(t.scrollable.getDistanceToEnd()<=16&&t.scrollable.loadedAll.bottom||!t.getRenderedLength())delete s[i],this.log("deleted chat position");else{t.sliceViewport(!0);const e=t.scrollable.scrollTop,n={mids:(0,Pi.Z)(t.bubbles,"desc").filter((e=>e>0&&!t.skippedMids.has(e))),top:e};s[i]=n,this.log("saved chat position:",n)}Xe.Z.set({chatPositions:s},!0)}getChatSavedPosition(e){if(!["chat","discussion"].includes(e.type)||!e.peerId)return;const t=e.peerId+(e.threadId?"_"+e.threadId:""),i=Xe.Z.getFromCache("chatPositions");return i&&i[t]}applyCurrentTheme(e,t,i){return t&&(this.backgroundPromises[e]=Promise.resolve(t)),De.Z.setTheme(),this.setCurrentBackground(void 0===i?!!e:i)}chatsSelectTab(e,t){if(this.prevTab!==e){if(!1===t&&this.prevTab&&et([e,this.prevTab].filter(Boolean)),this.prevTab){this.prevTab.classList.remove("active"),this.chatsSelectTabDebounced(),Ne.Z.isAvailable("animations")&&!1!==t&&(0,H.YW)((0,_e.Z)(400),400);const i=(0,Ee.Z)(this.prevTab);(0,Ee.Z)(e)>i&&Y.Z.pushItem({type:"chat",onPop:e=>{this.setPeer({},e),(0,X.Z)()}})}e.classList.add("active"),this.prevTab=e}}init(){document.addEventListener("paste",this.onDocumentPaste,!0),z.Z||this.attachDragAndDropListeners(),this.markupTooltip=new $e(this),this.markupTooltip.handleSelection()}attachDragAndDropListeners(){const e=[],t=[];let i=!1;const s=(r,d)=>gs(this,void 0,void 0,(function*(){if(d===i)return;const l=r.dataTransfer.types,c=l.contains?l.contains("Files"):l.indexOf("Files")>=0,h=(0,He.Y)(),u=yield as(r,!0);if(!c||!(yield this.canDrag())&&!h)return void(n=0);const p=yield He.Z.canSend(this.chat.peerId,!0),f=h?o:a,m=h?t:e;if(d&&!m.length){const e=c&&!u.length,[t,i]=(0,fs.Z)(u,(e=>ot.Z.has(e))),[n,a]=(0,fs.Z)(t,(e=>rt.Z.has(e)));if(p.send_docs?i.push(...t):i.length=0,p.send_photos||(n.forEach((e=>(0,Pe.Z)(t,e))),n.length=0),p.send_videos||(a.forEach((e=>(0,Pe.Z)(t,e))),a.length=0),this.log("drag files",u,t,i,n,a),h){h.appendDrops(f);const t=(p.send_docs?[i]:[n,a]).reduce(((e,t)=>e+t.length),0);(t||e)&&m.push(new Ye(f,{header:"Preview.Dragging.AddItems",headerArgs:[t],onDrop:e=>{s(e,!1),this.log("drop",e),this.onDocumentPaste(e,"document")}}))}else(i.length||e)&&m.push(new Ye(f,{icon:"dragfiles",header:"Chat.DropTitle",subtitle:"Chat.DropAsFilesDesc",onDrop:e=>{s(e,!1),this.log("drop",e),this.onDocumentPaste(e,"document")}})),(t.length||e)&&m.push(new Ye(f,{icon:"dragmedia",header:"Chat.DropTitle",subtitle:"Chat.DropQuickDesc",onDrop:e=>{s(e,!1),this.log("drop",e),this.onDocumentPaste(e,"media")}})),this.chat.container.append(f)}(0,ge.Z)({element:f,className:"is-visible",forwards:d,duration:200,onTransitionEnd:()=>{d||(m.forEach((e=>{e.destroy()})),m.length=0)}}),d?m.forEach((e=>{e.setPath()})):n=0,document.body.classList.toggle("is-dragging",d),i=d}));let n=0;document.body.addEventListener("dragenter",(e=>{n++})),document.body.addEventListener("dragover",(e=>{s(e,!0),(0,C.Z)(e)})),document.body.addEventListener("dragleave",(e=>{n--,0===n&&s(e,!1)}));const a=document.createElement("div");a.classList.add("drops-container");const o=a.cloneNode(!0)}canDrag(){return gs(this,void 0,void 0,(function*(){const e=this.chat;return!(!(null==e?void 0:e.peerId)||ss.Z.isOverlayActive||!(yield e.canSend("send_media")))}))}overrideHash(e){return gs(this,void 0,void 0,(function*(){let t;if(e){const i=yield this.managers.appPeersManager.getPeerUsername(e);t=i?"@"+i:""+e}Y.Z.overrideHash(t)}))}selectTab(e,t){var i;!1===t&&et([n.ZP.sidebarEl,this.columnEl,a.ZP.sidebarEl]),document.body.classList.toggle(n.ir,e===hs.CHATLIST);const s=this.tabId;void 0!==s&&(this.overrideHash(e>hs.CHATLIST?null===(i=this.chat)||void 0===i?void 0:i.peerId:void 0),this.dispatchEvent("tab_changing",e)),this.log("selectTab",e,s);let r=Ne.Z.isAvailable("animations")?(0,Qe.d1)():Promise.resolve();if(void 0!==s&&s!==e&&Ne.Z.isAvailable("animations")&&!1!==t){const e=100+(o.Z.isMobile?250:200);r=(0,_e.Z)(e),(0,H.YW)(r,e)}this.tabId=e,(0,X.Z)(),o.Z.isMobile&&s===hs.PROFILE&&es&&(e{this.setPeer({},e)}});const d=window.onImTabChange;return d&&d(e),r}updateStatus(){return this.managers.appUsersManager.updateMyOnlineStatus(this.offline)}createNewChat(){const e=new Ue(this,this.managers);return this.chats.length&&e.setBackground(this.lastBackgroundUrl,!0),this.chats.push(e),e}spliceChats(e,t=!0,i,s){if(e>=this.chats.length)return;const n=this.chat;this.chats.length>1&&t&&this.dispatchEvent("peer_changing",this.chat),s||(s=this.chats.splice(e,this.chats.length-e));const o=this.chat;this.dispatchEvent("chat_changing",{from:n,to:o});for(let e=0;e1&&s.slice(0,-1).forEach((e=>{e.container.remove()})),this.chatsSelectTab(o.container,i),t){this.dispatchEvent("peer_changed",o);const e=a.ZP.getTab(Ce);null==e||e.close(),a.ZP.replaceSharedMediaTab(o.sharedMediaTab)}s.forEach((e=>{e.beforeDestroy()})),setTimeout((()=>{s.forEach((e=>{e.destroy()}))}),350)}setPeer(e={},t){var i;return gs(this,void 0,void 0,(function*(){this.init&&(this.init(),this.init=null),null!==(i=e.peerId)&&void 0!==i||(e.peerId=ue.NM);const{peerId:s,lastMsgId:a,threadId:r}=e,d=this.chat,l=this.chats.indexOf(d),c=this.isSamePeer(d,e);if(s){if(l>0&&d.peerId&&!c){const t=this.chats.splice(1,this.chats.length-1);if(this.chat.peerId===s)return void this.spliceChats(0,!0,!0,t);{const i=this.setPeer(e);return this.spliceChats(0,!1,!1,t),i}}}else{if(l>0)return void this.spliceChats(l,void 0,t);if(o.Z.activeScreen===o._.medium)return void this.selectTab(+!this.tabId,t)}if(c&&o.Z.activeScreen<=o._.medium&&document.body.classList.contains(n.ir))return this.selectTab(hs.CHAT,t),!1;if(s||o.Z.activeScreen!==o._.mobile){const i=yield d.setPeer(e),n=(null==i?void 0:i.cached)?i.promise:Promise.resolve();s&&Promise.all([n,d.setBackgroundPromise]).then((()=>{setTimeout((()=>{setTimeout((()=>{this.chatsSelectTab(this.chat.container)}),0),this.selectTab(hs.CHAT,t)}),0)}))}return s?void 0:(this.selectTab(hs.CHATLIST,t),!1)}))}setInnerPeer(e){var t;return gs(this,void 0,void 0,(function*(){const{peerId:i}=e;if(i===ue.NM||!i)return;e.type||(e.threadId&&!(yield this.managers.appPeersManager.isForum(e.peerId))&&(e.type="discussion"),null!==(t=e.type)&&void 0!==t||(e.type="chat"));const s=this.chats.findIndex((t=>this.isSamePeer(t,e)||o.Z.activeScreen===o._.mobile&&0===this.tabId));if(-1!==s)return this.spliceChats(s+1),this.setPeer(e);const n=this.chat;let a=n;return n.inited&&(a=this.createNewChat()),this.dispatchEvent("chat_changing",{from:n,to:a}),this.setPeer(e)}))}openScheduled(e){this.setInnerPeer({peerId:e,type:"scheduled"})}getTypingElement(e){const t=document.createElement("span");let i="peer-typing";switch(t.classList.add(i),t.dataset.action=e._,e._){case"sendMessageTypingAction":i+="-text";for(let e=0;e<3;++e){const e=document.createElement("span");e.className=i+"-dot",t.append(e)}break;case"sendMessageUploadAudioAction":case"sendMessageUploadDocumentAction":case"sendMessageUploadRoundAction":case"sendMessageUploadVideoAction":case"sendMessageUploadPhotoAction":i+="-upload";break;case"sendMessageRecordAudioAction":case"sendMessageRecordRoundAction":case"sendMessageRecordVideoAction":i+="-record";break;case"sendMessageEmojiInteractionSeen":case"sendMessageChooseStickerAction":i+="-choosing-sticker";for(let e=0;e<2;++e){const e=document.createElement("div");e.className=i+"-eye",t.append(e)}}return t.classList.add(i),t}getPeerTyping(e,t,i){return gs(this,void 0,void 0,(function*(){const s=e.isUser();if(s&&(yield this.managers.appUsersManager.isBot(e)))return;const n=yield this.managers.appProfileManager.getPeerTypings(e,i);if(!(null==n?void 0:n.length))return;const a=n[0],o={private:{sendMessageTypingAction:"Peer.Activity.User.TypingText",sendMessageUploadAudioAction:"Peer.Activity.User.SendingFile",sendMessageUploadDocumentAction:"Peer.Activity.User.SendingFile",sendMessageUploadPhotoAction:"Peer.Activity.User.SendingPhoto",sendMessageUploadVideoAction:"Peer.Activity.User.SendingVideo",sendMessageUploadRoundAction:"Peer.Activity.User.SendingVideo",sendMessageRecordVideoAction:"Peer.Activity.User.RecordingVideo",sendMessageRecordAudioAction:"Peer.Activity.User.RecordingAudio",sendMessageRecordRoundAction:"Peer.Activity.User.RecordingVideo",sendMessageGamePlayAction:"Peer.Activity.User.PlayingGame",sendMessageChooseStickerAction:"Peer.Activity.User.ChoosingSticker",sendMessageEmojiInteractionSeen:"Peer.Activity.User.EnjoyingAnimations"},chat:{sendMessageTypingAction:"Peer.Activity.Chat.TypingText",sendMessageUploadAudioAction:"Peer.Activity.Chat.SendingFile",sendMessageUploadDocumentAction:"Peer.Activity.Chat.SendingFile",sendMessageUploadPhotoAction:"Peer.Activity.Chat.SendingPhoto",sendMessageUploadVideoAction:"Peer.Activity.Chat.SendingVideo",sendMessageUploadRoundAction:"Peer.Activity.Chat.SendingVideo",sendMessageRecordVideoAction:"Peer.Activity.Chat.RecordingVideo",sendMessageRecordAudioAction:"Peer.Activity.Chat.RecordingAudio",sendMessageRecordRoundAction:"Peer.Activity.Chat.RecordingVideo",sendMessageGamePlayAction:"Peer.Activity.Chat.PlayingGame",sendMessageChooseStickerAction:"Peer.Activity.Chat.ChoosingSticker",sendMessageEmojiInteractionSeen:"Peer.Activity.Chat.EnjoyingAnimations"},multi:{sendMessageTypingAction:"Peer.Activity.Chat.Multi.TypingText1",sendMessageUploadAudioAction:"Peer.Activity.Chat.Multi.SendingFile1",sendMessageUploadDocumentAction:"Peer.Activity.Chat.Multi.SendingFile1",sendMessageUploadPhotoAction:"Peer.Activity.Chat.Multi.SendingPhoto1",sendMessageUploadVideoAction:"Peer.Activity.Chat.Multi.SendingVideo1",sendMessageUploadRoundAction:"Peer.Activity.Chat.Multi.SendingVideo1",sendMessageRecordVideoAction:"Peer.Activity.Chat.Multi.RecordingVideo1",sendMessageRecordAudioAction:"Peer.Activity.Chat.Multi.RecordingAudio1",sendMessageRecordRoundAction:"Peer.Activity.Chat.Multi.RecordingVideo1",sendMessageGamePlayAction:"Peer.Activity.Chat.Multi.PlayingGame1",sendMessageChooseStickerAction:"Peer.Activity.Chat.Multi.ChoosingSticker1"}},r=s?o.private:n.length>1?o.multi:o.chat;let d=a.action;if(n.length>1){const e={};n.forEach((t=>{const i=t.action._;void 0===e[i]&&(e[i]=0),++e[i]})),Object.keys(e).length>1&&(d={_:"sendMessageTypingAction"})}const l=r[d._];if(!l)return;let c,h;if(e.isAnyChat()){const e=new P.Z;c=e.update({peerId:a.userId.toPeerId(!1),onlyFirstName:!0}),h=[e.element,n.length-1],yield c}t||(t=document.createElement("span")).classList.add("online","peer-typing-container"),t.classList.toggle("peer-typing-flex","sendMessageChooseStickerAction"===d._||"sendMessageEmojiInteractionSeen"===d._);let u=t.firstElementChild;if(u?u.dataset.action!==d._&&u.replaceWith(this.getTypingElement(d)):(u=this.getTypingElement(d),t.prepend(u)),"sendMessageEmojiInteractionSeen"===d._){h?h.pop():h=[];const e=(0,Mi.Z)((0,_.Z)(d.emoticon));h.push(e)}const p=(0,T.ag)(l,h);return p.classList.add("peer-typing-description"),t.childElementCount>1?t.lastElementChild.replaceWith(p):t.append(p),t}))}getChatStatus(e,t){return gs(this,void 0,void 0,(function*(){const i=t?void 0:yield this.getPeerTyping(e.toPeerId(!0));if(i)return{cached:!0,result:Promise.resolve(i)};const s=yield this.managers.acknowledged.appProfileManager.getChatFull(e),n=Promise.resolve(s.result).then((t=>gs(this,void 0,void 0,(function*(){var i,s;const n=t.participants_count||(null===(s=null===(i=t.participants)||void 0===i?void 0:i.participants)||void 0===s?void 0:s.length)||1;let a=yield(0,es.Z)(e);if(n<2)return a;const o=yield this.managers.appProfileManager.getOnlines(e);if(o>1){const e=document.createElement("span");e.append(...(0,T.v_)([a,(0,T.ag)("OnlineCount",[(0,Ti.Z)(o)])],!1)),a=e}return a}))));return{cached:s.cached,result:n}}))}getUserStatus(e,t){var i;return gs(this,void 0,void 0,(function*(){const s={cached:!0,result:Promise.resolve(void 0)},n=yield this.managers.appUsersManager.getUser(e);if(!n||n.pFlags.self&&!t)return s;const a=(0,Ji.Z)(n);if(!n.pFlags.bot&&!n.pFlags.support){let t=yield this.getPeerTyping(e.toPeerId());if(t||"userStatusOnline"!==(null===(i=n.status)||void 0===i?void 0:i._)||(t=document.createElement("span"),t.classList.add("online"),t.append(a)),t)return s.result=Promise.resolve(t),s}return s.result=Promise.resolve(a),s}))}getPeerStatus(e,t,i){return gs(this,void 0,void 0,(function*(){if(!e)return;let s;return s=e.isAnyChat()?this.getChatStatus(e.toChatId(),i):this.getUserStatus(e.toUserId(),t),s}))}setPeerStatus(e){return gs(this,void 0,void 0,(function*(){const{peerId:t,element:i,needClear:s,useWhitespace:n,middleware:a,ignoreSelf:o,noTyping:r}=e;if(!s){const e=i.querySelector(".peer-typing-container");if(e&&(yield this.getPeerTyping(t,e)))return}const d=yield this.getPeerStatus(t,o,r);if(!a())return;const l=()=>gs(this,void 0,void 0,(function*(){const e=d&&(yield d.result);if(a())return()=>(0,Z.Z)(i,e||c)})),c=n?ds.Z:"";return!d||d.cached||void 0===s?yield l():s?()=>(i.textContent=c,l().then((e=>null==e?void 0:e()))):void 0}))}setChoosingStickerTyping(e){this.managers.appMessagesManager.setTyping(this.chat.peerId,{_:e?"sendMessageCancelAction":"sendMessageChooseStickerAction"},void 0,this.chat.threadId)}isSamePeer(e,t){return e.peerId===t.peerId&&e.threadId===t.threadId&&(typeof e.type!=typeof t.type||e.type===t.type)}}const bs=new vs;Je.GO&&(Je.GO.appImManager=bs);const ys=bs},8737:(e,t,i)=>{"use strict";var s;i.d(t,{z:()=>s}),function(e){e[e.MESSAGE=0]="MESSAGE",e[e.PRIVATE_POST=1]="PRIVATE_POST",e[e.STICKER_SET=2]="STICKER_SET",e[e.JOIN_CHAT=3]="JOIN_CHAT",e[e.VOICE_CHAT=4]="VOICE_CHAT",e[e.USER_PHONE_NUMBER=5]="USER_PHONE_NUMBER",e[e.INVOICE=6]="INVOICE",e[e.EMOJI_SET=7]="EMOJI_SET"}(s||(s={}))},3709:(e,t,i)=>{"use strict";function s(e){var t;return e&&!e.pFlags.is_outgoing&&!e.pFlags.noforwards&&!(null===(t=e.media)||void 0===t?void 0:t.extended_media)}i.d(t,{Z:()=>s})},7530:(e,t,i)=>{"use strict";function s(e,t=!1){var i;if(!e)return;let s;if(e.action)s=e.action.photo;else if(e.media){let n=e.media;n.webpage?n=n.webpage:"messageExtendedMedia"===(null===(i=n.extended_media)||void 0===i?void 0:i._)&&(n=n.extended_media.media),s=n.document||n.photo||(t?void 0:n.game||n)}return s}i.d(t,{Z:()=>s})},2291:(e,t,i)=>{"use strict";function s(e){var t;return e.fromId?{peerId:e.fromId}:{fromName:null===(t=e.fwd_from)||void 0===t?void 0:t.from_name}}i.d(t,{Z:()=>s})},5381:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(677);function n(e){return!(!e.restriction_reason||!(0,s.X)(e.restriction_reason))}},5990:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});const s=["#fc5c51","#0fb297","#d09306","#3d72ed","#895dd5","#cd4073","#00c1a6","#fa790f"],n=["red","green","yellow","blue","violet","pink","cyan","orange"],a=[0,7,4,1,6,3,5];function o(e,t=!0){if(!e)return"";const i=a[Math.abs(+e)%7];return(t?n:s)[i]}},6082:(e,t,i)=>{"use strict";function s(e){if(e.username)return e.username;const t=e.usernames,i=null==t?void 0:t.find((e=>e.pFlags.editable));return null==i?void 0:i.username}i.d(t,{Z:()=>s})},2946:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(5880),n=i(1507);function a(e){if(void 0!==e&&e.isPeerId&&e.isPeerId())return e;if((0,s.Z)(e)){const t=e.user_id;if(void 0!==t)return t.toPeerId(!1);const i=e.channel_id||e.chat_id;return void 0!==i?i.toPeerId(!0):n.NM}if(!e)return n.NM;const t="u"===e.charAt(0),i=e.substr(1).split("_");return t?i[0].toPeerId():(i[0]||"").toPeerId(!0)}},7030:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(9897),n=i(1507);function a(e,t=0,i=0,a=!1,o=!1){window.devicePixelRatio>1&&(t*=2,i*=2);let r=e.sizes||e.thumbs,d={_:"photoSizeEmpty",type:n.Pt};if(o&&r&&"photo"!==e._&&(r=r.concat({_:"photoSize",w:e.w,h:e.h,size:e.size,type:n.Pt})),null==r?void 0:r.length){for(let e=0,n=r.length;e=t||a.height>=i)break}a&&"photoSizeEmpty"===d._&&"photoStrippedSize"===r[0]._&&(d=r[0])}return d}},3075:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(5953),n=i(5003),a=i(6752);class o{constructor(e){var t;(0,s.Z)(this,e),this.log||(this.log=(null===(t=this.connection)||void 0===t?void 0:t.log)||(0,n.kg)("CALL-CONNECTION-BASE")),this.sources={}}createPeerConnection(e){return this.connection||(this.connection=function(e,t){t||(t=(0,n.kg)("RTCPeerConnection")),t("constructor");const i=new RTCPeerConnection(e);return i.addEventListener("track",(e=>{t("ontrack",e)})),i.addEventListener("signalingstatechange",(()=>{t("onsignalingstatechange",i.signalingState)})),i.addEventListener("connectionstatechange",(()=>{t("onconnectionstatechange",i.connectionState)})),i.addEventListener("negotiationneeded",(()=>{t("onnegotiationneeded",i.signalingState)})),i.addEventListener("icecandidate",(e=>{t("onicecandidate",e)})),i.addEventListener("iceconnectionstatechange",(()=>{t("oniceconnectionstatechange",i.iceConnectionState)})),i.addEventListener("datachannel",(()=>{t("ondatachannel")})),i.log=t,{connection:i}}(e,this.log.bindPrefix("connection")).connection)}createDataChannel(e){return this.dataChannel||(this.dataChannel=function(e,t,i){i||(i=(0,n.kg)("RTCDataChannel"));const s=e.createDataChannel("data",t);return s.addEventListener("message",(e=>{i("onmessage",e)})),s.addEventListener("open",(()=>{i("onopen")})),s.addEventListener("close",(()=>{i("onclose")})),s.log=i,s}(this.connection,e,this.log.bindPrefix("data")))}createDescription(){return this.description||(this.description=new a.ZP(this.connection))}appendStreamToConference(){return this.streamManager.appendToConference(this.description)}closeConnection(){const{connection:e}=this;if(e)try{e.log("close"),e.close()}catch(e){this.log.error(e)}}closeConnectionAndStream(e){this.closeConnection(),e&&this.streamManager.stop()}negotiate(){return this.negotiating||(this.negotiating=this.negotiateInternal().finally((()=>{this.negotiating=void 0})))}sendDataChannelData(e){"open"===this.dataChannel.readyState&&this.dataChannel.send(JSON.stringify(e))}}},2069:(e,t,i)=>{"use strict";i.d(t,{Z:()=>N});var s=i(6761),n=i(4762),a=i(5953),o=i(5701),r=i(671),d=i(5003),l=i(3855),c=i(3075),h=i(3773);function u(e){const t=(0,h.Z)(e,e.media[0]),i={"@type":"InitialSetup",fingerprints:[t.fingerprint],ufrag:t.ufrag,pwd:t.pwd,audio:void 0,video:void 0,screencast:void 0},s=e=>""+e;for(const t of e.media){const n=t.mediaType;if("application"===n||!t.isSending)continue;const a=i["video"===n&&i.video?"screencast":n]={},o=(0,h.Z)(e,t);a.ssrc=s(o.source),o.sourceGroups&&(a.ssrcGroups=o.sourceGroups.map((e=>({semantics:e.semantics,ssrcs:e.sources.map(s)}))));const r=a.rtpExtensions=[];t.attributes.get("extmap").forEach((e=>{r.push({id:+e.key,uri:e.value})}));const d=new Map,l=e=>{let t=d.get(e);return t||d.set(e,t={id:e}),t};t.attributes.get("rtpmap").forEach((e=>{const t=+e.key,i=l(t),s=e.value.split("/"),[n,a,o]=s;i.name=n,i.clockrate=+a,i.channels=o?+o:0})),t.attributes.get("rtcp-fb").forEach((e=>{const t=+e.key;l(t).feedbackTypes=e.lines.map((e=>{const t=e.split(" "),[i,s]=t;return{type:i,subtype:s||""}}))})),t.attributes.get("fmtp").forEach((e=>{const t=+e.key,i=l(t).parameters={},s=e.value.split(";");for(const e of s){const[t,s]=e.split("=");i[t]=s}})),a.payloadTypes=Array.from(d.values())}return i}var p=i(9124);class f extends c.Z{constructor(e){super(e)}negotiateInternal(){return e=this,t=void 0,s=function*(){const{connection:e,call:t}=this;if(!e.localDescription&&!e.remoteDescription&&!t.isOutgoing)return;let i;if(t.offerReceived){t.offerReceived=!1;const s=i=yield e.createAnswer();this.log("[sdp] local",s.type,s.sdp),yield e.setLocalDescription(s),this.log("[InitialSetup] send 2")}else{const s=i=yield e.createOffer();this.log("[sdp] local",s.sdp),yield e.setLocalDescription(s),t.offerSent=!0,this.log("[InitialSetup] send 0")}const s=u((0,p.DV)(i.sdp));t.sendCallSignalingData(s)},new((i=void 0)||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}));var e,t,i,s}}var m=i(8500),g=i(2493),v=i(3335),b=i(1677),y=i(49),w=i(6752),S=i(4903);const C="undefined"!=typeof window&&"crypto"in window?window.crypto.subtle:self.crypto.subtle;var L=i(9818),E=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class I{constructor(e,t){this.isOutgoing=e,this.p2pKey=t,this.type="Signaling",this.counter=0,this.seqMap=new Map}concatSHA256(e){return t=(0,S.Z)(...e),C.digest("SHA-256",(0,L.Z)(t)).then((e=>new Uint8Array(e)));var t}encryptPrepared(e){return E(this,void 0,void 0,(function*(){const t={counter:0,bytes:new Uint8Array(16+e.length)},i=(this.isOutgoing?0:8)+("Signaling"===this.type?128:0),s=this.p2pKey,n=yield this.concatSHA256([s.subarray(i+88,i+88+32),e]),a=t.bytes;for(let e=0;e<16;++e)a[e]=n[e+8];const o=yield this.prepareAesKeyIv(s,a,i),r=yield this.aesProcessCtr(e,e.length,o,!0);return t.bytes=new Uint8Array([...t.bytes.subarray(0,16),...r]),t}))}encryptRawPacket(e){const t=++this.counter,i=new ArrayBuffer(4);new DataView(i).setUint32(0,t>>>0,!1);const s=new Uint8Array([...new Uint8Array(i),...e]);return this.encryptPrepared(s)}prepareAesKeyIv(e,t,i){return E(this,void 0,void 0,(function*(){const[s,n]=yield Promise.all([this.concatSHA256([t.subarray(0,16),e.subarray(i,i+36)]),this.concatSHA256([e.subarray(40+i,40+i+36),t.subarray(0,16)])]);return{key:new Uint8Array([...s.subarray(0,8),...n.subarray(8,24),...s.subarray(24,32)]),iv:new Uint8Array([...n.subarray(0,4),...s.subarray(8,16),...n.subarray(24,28)])}}))}aesProcessCtr(e,t,i,s=!0){return E(this,void 0,void 0,(function*(){const t=yield C.importKey("raw",i.key,{name:"AES-CTR"},!1,[s?"encrypt":"decrypt"]),n=yield C[s?"encrypt":"decrypt"]({name:"AES-CTR",counter:i.iv,length:8*i.iv.length},t,e);return new Uint8Array(n)}))}constTimeIsDifferent(e,t,i){let s=!0;for(let n=0;n134217728)return;const{isOutgoing:t,type:i}=this,s=(t?8:0)+("Signaling"===i?128:0),n=this.p2pKey,a=e.subarray(0,16),o=e.subarray(16),r=e.length-16,d=yield this.prepareAesKeyIv(n,a,s),l=yield this.aesProcessCtr(o,r,d,!1),c=yield this.concatSHA256([n.subarray(88+s,88+s+32),l]);if(this.constTimeIsDifferent(c.subarray(8),a,16))return;const h=new DataView(l.buffer).getUint32(0);return this.seqMap.has(h)?void 0:(this.seqMap.set(h,h),l.slice(4))}))}}var M=i(630);class Z{static generateOffer(e){const{fingerprints:t,ufrag:i,pwd:s,audio:n,video:a}=e;n.type="audio",a.type="video";const o=[n,a],r=new M.Z;r.add("v=0","o=- 1 2 IN IP4 127.0.0.1","s=-","t=0 0"),t&&t.forEach((e=>{const{hash:t,fingerprint:i,setup:s}=e;r.add(`a=fingerprint:${t} ${i}`,`a=setup:${s}`)})),i&&s&&r.add(`a=ice-ufrag:${i}`,`a=ice-pwd:${s}`),r.add("a=group:BUNDLE 0 1 2","a=extmap-allow-mixed","a=msid-semantic: WMS *");const d="stream"+o.map((e=>e.ssrc)).join("_");for(let e=0;ee.id)).join(" ")}`,"c=IN IP4 0.0.0.0","a=rtcp:9 IN IP4 0.0.0.0","a=ice-options:trickle",`a=mid:${e}`,"a=sendrecv",A(l)),s&&r.add(`a=msid:${d} audio${s}`),r.add("a=rtcp-mux",_(a),F(i,s,n,d));break;case"video":r.add(`m=video 61986 UDP/TLS/RTP/SAVPF ${a.map((e=>e.id)).join(" ")}`,"c=IN IP4 0.0.0.0","a=rtcp:9 IN IP4 0.0.0.0","a=ice-options:trickle",`a=mid:${e}`,"a=sendrecv",A(l)),s&&r.add(`a=msid:${d} video${s}`),r.add("a=rtcp-mux","a=rtcp-rsize",_(a),F(i,s,n,d))}}return r.add("m=application 9 UDP/DTLS/SCTP webrtc-datachannel\nc=IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:2\na=sctp-port:5000\na=max-message-size:262144"),r.finalize()}static generateAnswer(e){const{fingerprints:t,ufrag:i,pwd:s,audio:n,video:a}=e;n.type="audio",a.type="video";const o=[n,a],r=new M.Z;r.add("v=0","o=- 1 2 IN IP4 127.0.0.1","s=-","t=0 0"),t&&t.forEach((e=>{const{hash:t,fingerprint:i,setup:s}=e;r.add(`a=fingerprint:${t} ${i}`,`a=setup:${s}`)})),i&&s&&r.add(`a=ice-ufrag:${i}`,`a=ice-pwd:${s}`),r.add("a=group:BUNDLE 0 1 2","a=extmap-allow-mixed","a=msid-semantic: WMS *");const d="stream"+o.map((e=>e.ssrc)).join("_");for(let e=0;ee.id)).join(" ")}`,"c=IN IP4 0.0.0.0","a=rtcp:9 IN IP4 0.0.0.0","a=ice-options:trickle",`a=mid:${e}`,"a=sendrecv",A(l)),s&&r.add(`a=msid:${d} audio${s}`),r.add("a=rtcp-mux",_(a),F(i,s,n,d));break;case"video":r.add(`m=video 61986 UDP/TLS/RTP/SAVPF ${a.map((e=>e.id)).join(" ")}`,"c=IN IP4 0.0.0.0","a=rtcp:9 IN IP4 0.0.0.0","a=ice-options:trickle",`a=mid:${e}`,"a=sendrecv",A(l)),s&&r.add(`a=msid:${d} video${s}`),r.add("a=rtcp-mux","a=rtcp-rsize",_(a),F(i,s,n,d))}}return r.add("m=application 9 UDP/DTLS/SCTP webrtc-datachannel\nc=IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:2\na=sctp-port:5000\na=max-message-size:262144"),r.finalize()}}class P{static generateOffer(e){const{fingerprints:t,ufrag:i,pwd:s,audio:n,video:a}=e;n.type="audio",a.type="video";const o=[n,a];let r="v=0\no=- 1 0 IN IP4 0.0.0.0\ns=-\nt=0 0";t&&t.forEach((e=>{const{hash:t,fingerprint:i,setup:s}=e;r+=`\na=fingerprint:${t} ${i}\na=setup:${s}`})),i&&s&&(r+=`\na=ice-ufrag:${i}\na=ice-pwd:${s}`),r+="\na=group:BUNDLE 0 1 2\na=ice-options:trickle\na=msid-semantic:WMS *";const d="stream"+o.map((e=>e.ssrc)).join("_");for(let e=0;ee.id)).join(" ")}\nc=IN IP4 0.0.0.0\na=mid:${e}\na=sendrecv`,r+=A(l),r+="\na=rtcp-mux",r+=_(a),r+=F(i,s,n,d);break;case"video":r+=`\nm=video 9 UDP/TLS/RTP/SAVPF ${a.map((e=>e.id)).join(" ")}\nc=IN IP4 0.0.0.0\na=mid:${e}\na=sendrecv`,r+=A(l),r+="\na=rtcp-mux\na=rtcp-rsize",r+=_(a),r+=F(i,s,n,d)}}return r+="m=application 9 UDP/DTLS/SCTP webrtc-datachannel\nc=IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:2\na=sctp-port:5000\na=max-message-size:262144",r+="\n",r}static generateAnswer(e){const{fingerprints:t,ufrag:i,pwd:s,audio:n,video:a}=e;n.type="audio",a.type="video";const o=[n,a];let r="v=0\no=- 1 0 IN IP4 0.0.0.0\ns=-\nt=0 0";t&&t.forEach((e=>{const{hash:t,fingerprint:i,setup:s}=e;r+=`\na=fingerprint:${t} ${i}\na=setup:${s}`})),i&&s&&(r+=`\na=ice-ufrag:${i}\na=ice-pwd:${s}`),r+="\na=group:BUNDLE 0 1 2\na=ice-options:trickle\na=msid-semantic:WMS *";const d="stream"+o.map((e=>e.ssrc)).join("_");for(let e=0;ee.id)).join(" ")}\nc=IN IP4 0.0.0.0\na=mid:${e}\na=sendrecv`,r+=A(h),r+="\na=rtcp-mux",r+=_(l),r+=F(i,n,a,d);break;case"video":r+=`\nm=video 9 UDP/TLS/RTP/SAVPF ${l.map((e=>e.id)).join(" ")}\nc=IN IP4 0.0.0.0\na=mid:${e}\na=sendrecv`,r+=A(h),r+="\na=rtcp-mux\na=rtcp-rsize",r+=_(l),r+=F(i,n,a,d)}}return r+="m=application 9 UDP/DTLS/SCTP webrtc-datachannel\nc=IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:2\na=sctp-port:5000\na=max-message-size:262144",r+="\n",r}}class T{static generateOffer(e){const{fingerprints:t,ufrag:i,pwd:s,audio:n,video:a}=e;n.type="audio",a.type="video";const o=[n,a];if(!o.length)return"v=0\no=- 1 2 IN IP4 127.0.0.1\ns=-\nt=0 0\na=msid-semantic: WMS\n";let r="v=0\no=- 1 2 IN IP4 127.0.0.1\ns=-\nt=0 0";t&&t.forEach((e=>{const{hash:t,fingerprint:i,setup:s}=e;r+=`\na=fingerprint:${t} ${i}\na=setup:${s}`})),i&&s&&(r+=`\na=ice-ufrag:${i}\na=ice-pwd:${s}`),r+="\na=group:BUNDLE 0 1 2\na=extmap-allow-mixed\na=msid-semantic: WMS *";const d="stream"+o.map((e=>e.ssrc)).join("_");for(let e=0;ee.id)).join(" ")}\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:${e}\na=sendrecv`,r+=A(l),s&&(r+=`\na=msid:${d} audio${s}`),r+="\na=rtcp-mux",r+=_(a),r+=F(i,s,n,d);break;case"video":r+=`\nm=video 9 UDP/TLS/RTP/SAVPF ${a.map((e=>e.id)).join(" ")}\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:${e}\na=sendrecv`,r+=A(l),s&&(r+=`\na=msid:${d} video${s}`),r+="\na=rtcp-mux\na=rtcp-rsize",r+=_(a),r+=F(i,s,n,d)}}return r+="m=application 9 UDP/DTLS/SCTP webrtc-datachannel\nc=IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:2\na=sctp-port:5000\na=max-message-size:262144",r+="\n",r}static generateAnswer(e){const{fingerprints:t,ufrag:i,pwd:s,audio:n,video:a}=e;n.type="audio",a.type="video";const o=[n,a];if(!o.length)return"v=0\no=- 1 2 IN IP4 127.0.0.1\ns=-\nt=0 0\na=msid-semantic: WMS\n";let r="v=0\no=- 1 2 IN IP4 127.0.0.1\ns=-\nt=0 0";t&&t.forEach((e=>{const{hash:t,fingerprint:i,setup:s}=e;r+=`\na=fingerprint:${t} ${i}\na=setup:${s}`})),i&&s&&(r+=`\na=ice-ufrag:${i}\na=ice-pwd:${s}`),r+="\na=group:BUNDLE 0 1 2\na=extmap-allow-mixed\na=msid-semantic: WMS *";const d="stream"+o.map((e=>e.ssrc)).join("_");for(let e=0;ee.id)).join(" ")}\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:${e}\na=sendrecv`,r+=A(l),s&&(r+=`\na=msid:${d} audio${s}`),r+="\na=rtcp-mux",r+=_(a),r+=F(i,s,n,d);break;case"video":r+=`\nm=video 9 UDP/TLS/RTP/SAVPF ${a.map((e=>e.id)).join(" ")}\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:${e}\na=sendrecv`,r+=A(l),s&&(r+=`\na=msid:${d} video${s}`),r+="\na=rtcp-mux\na=rtcp-rsize",r+=_(a),r+=F(i,s,n,d)}}return r+="m=application 9 UDP/DTLS/SCTP webrtc-datachannel\nc=IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:2\na=sctp-port:5000\na=max-message-size:262144",r+="\n",r}}function k(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1}function x(){return navigator.userAgent.toLowerCase().indexOf("safari")>-1&&-1===navigator.userAgent.toLowerCase().indexOf("chrome")}function A(e){let t=[];for(let i=0;i{const{type:i,subtype:s}=e;t.push(`a=rtcp-fb:${n} ${[i,s].join(" ")}`)})),l){const e=[];Object.getOwnPropertyNames(l).forEach((t=>{e.push(`${t}=${l[t]}`)})),t.push(`a=fmtp:${n} ${e.join(";")}`)}}return t.join("\n")}function F(e,t,i,s){let n=[];return i&&i.length>0?i.forEach((t=>{t&&t.ssrcs.length>0&&(n.push(`a=ssrc-group:${t.semantics} ${t.ssrcs.join(" ")}`),t.ssrcs.forEach((t=>{n.push(`a=ssrc:${t} cname:stream${t}`,`a=ssrc:${t} msid:${s} ${e}${t}`,`a=ssrc:${t} mslabel:${e}${t}`,`a=ssrc:${t} label:${e}${t}`)})))})):t&&n.push(`a=ssrc:${t} cname:stream${t}`,`a=ssrc:${t} msid:${s} ${e}${t}`,`a=ssrc:${t} mslabel:${e}${t}`,`a=ssrc:${t} label:${e}${t}`),n.join("\n")}class D{static generateCandidate(e){if(!e)return null;const{sdpString:t,sdpMLineIndex:i,sdpMid:s,foundation:n,component:a,protocol:o,priority:r,address:d,type:l,relAddress:c,generation:h,tcpType:u,networkId:p,networkCost:f,username:m}=e;if(t)return{candidate:t,sdpMLineIndex:i,sdpMid:s};throw"no sdpString"}static generateOffer(e){return k()?P.generateOffer(e):x()?T.generateOffer(e):Z.generateOffer(e)}static generateAnswer(e){return k()?P.generateAnswer(e):x()?T.generateAnswer(e):Z.generateAnswer(e)}}var R=i(9585),B=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class N extends m.Z{constructor(e){super(),this.log=(0,d.kg)("CALL"),this.protocol||(this.protocol={_:"phoneCallProtocol",pFlags:{udp_p2p:!0,udp_reflector:!0},min_layer:92,max_layer:92,library_versions:["4.0.0"]}),(0,a.Z)(this,e),this.createdAt=Date.now(),this.offerReceived=!1,this.offerSent=!1,this.decryptQueue=[],this.candidates=[],this.addEventListener("state",(e=>{this.log("state",v.Z[e]),e===v.Z.CLOSED&&this.cleanup()}));const t=this.streamManager=new R.Z(b.iK);t.direction="sendrecv",t.types.push("screencast"),this.isOutgoing||(t.locked=!0,t.canCreateConferenceEntry=!1);let i={"@type":"MediaState",type:"input",lowBattery:!1,muted:!0,screencastState:"inactive",videoRotation:0,videoState:"inactive"};const s=this;i=new Proxy(i,{set:function(e,t,n){return e[t]=n,s.setMediaState(i),s.sendMediaState(),!0}}),this.mediaStates={input:i},this.sendMediaState=(0,o.Z)(this._sendMediaState.bind(this),0,!1,!0)}get connectionState(){const{_connectionState:e,connectionInstance:t}=this;if(void 0!==e)return e;if(t){const{iceConnectionState:e}=t.connection;return"closed"===e?v.Z.CLOSED:"connected"===e||n.IS_SAFARI&&"completed"===e?v.Z.CONNECTED:v.Z.CONNECTING}return v.Z.CONNECTING}get sortIndex(){const e=this.connectionState;let t=1e13*(v.Z.CLOSED-e+1);return t+=2147483647e3-(e===v.Z.PENDING&&this.isOutgoing?0:this.createdAt),t}getVideoElement(e){if("input"===e)return this.elements.get("main");{const e=this.getMediaState("output");if(!e)return;const t="active"===e.videoState?"video":"active"===e.screencastState?"screencast":void 0;if(!t)return;const i=this.description.findEntry((e=>e.type===t));if(!i)return;return this.elements.get(""+i.recvEntry.source)}}startScreenSharingInternal(){return B(this,void 0,void 0,(function*(){try{this.wasStartingScreen=!0,this.wasStartingVideo=!1,this.streamManager.types=["audio","screencast"],yield this.requestScreen()}catch(e){this.log.error("startScreenSharing error",e)}}))}toggleScreenSharing(){return B(this,void 0,void 0,(function*(){return this.isSharingVideo&&(yield this.stopVideoSharing()),this.isSharingScreen?this.stopVideoSharing():this.startScreenSharingInternal()}))}startVideoSharingInternal(){return B(this,void 0,void 0,(function*(){try{this.wasStartingScreen=!1,this.wasStartingVideo=!0,this.streamManager.types=["audio","video"],yield this.requestInputSource(!1,!0,!1)}catch(e){this.log.error("startVideoSharing error",e)}}))}stopVideoSharing(){return B(this,void 0,void 0,(function*(){const e=this.getMediaState("input");e.videoState=e.screencastState="inactive";const{streamManager:t,description:i}=this,s=t.inputStream.getVideoTracks()[0];s&&((0,y.Z)(s),t.appendToConference(i))}))}toggleVideoSharing(){return B(this,void 0,void 0,(function*(){return this.isSharingScreen&&(yield this.stopVideoSharing()),this.isSharingVideo?this.stopVideoSharing():this.startVideoSharingInternal()}))}getMediaState(e){return this.mediaStates[e]}setMediaState(e){this.mediaStates[e.type]=e,this.dispatchEvent("mediaState",e)}isSharingVideoType(e){try{return super.isSharingVideo&&!!(this.wasStartingScreen&&"screencast"===e||this.wasStartingVideo&&"video"===e)}catch(e){return!1}}get isSharingVideo(){return this.isSharingVideoType("video")}get isSharingScreen(){return this.isSharingVideoType("screencast")}get isMuted(){const e=this.streamManager.inputStream.getAudioTracks()[0];return!(null==e?void 0:e.enabled)}get isClosing(){const{connectionState:e}=this;return e===v.Z.CLOSING||e===v.Z.CLOSED}get description(){var e;return null===(e=this.connectionInstance)||void 0===e?void 0:e.description}setHangUpTimeout(e,t){this.clearHangUpTimeout(),this.hangUpTimeout=s.Z.setTimeout((()=>{this.hangUpTimeout=void 0,this.hangUp(t)}),e)}clearHangUpTimeout(){void 0!==this.hangUpTimeout&&(clearTimeout(this.hangUpTimeout),this.hangUpTimeout=void 0)}setPhoneCall(e){this.call=e;const{id:t}=e;if(this.id!==t){const e=this.id;this.id=t,this.dispatchEvent("id",t,e)}}acceptCall(){var e;return B(this,void 0,void 0,(function*(){const t=null===(e=(yield Promise.all(this.dispatchResultableEvent("acceptCallOverride")))[0])||void 0===e||e;if(this.isClosing||!t)return;this.overrideConnectionState(v.Z.EXCHANGING_KEYS);const i=this.call;this.requestInputSource(!0,!!i.pFlags.video,!1);const s=i.g_a_hash;this.managers.appCallsManager.generateDh().then((e=>B(this,void 0,void 0,(function*(){return this.dh={g_a_hash:s,b:e.a,g_b:e.g_a,g_b_hash:e.g_a_hash,p:e.p},this.managers.apiManager.invokeApi("phone.acceptCall",{peer:yield this.managers.appCallsManager.getCallInput(this.id),protocol:this.protocol,g_b:this.dh.g_b})})))).then((e=>B(this,void 0,void 0,(function*(){yield this.managers.appCallsManager.savePhonePhoneCall(e)})))).catch((e=>{this.log.error("accept call error",e),this.hangUp("phoneCallDiscardReasonHangup")}))}))}joinCall(){this.log("joinCall"),this.getEmojisFingerprint(),this.overrideConnectionState();const{isOutgoing:e,encryptionKey:t,streamManager:i}=this,s=function(e){const t=[];return e.connections.forEach((e=>{switch(e._){case"phoneConnectionWebrtc":{const{ip:i,ipv6:s,port:n,username:a,password:o}=e,r=[];e.pFlags.turn?(i&&r.push(`turn:${i}:${n}`),s&&r.push(`turn:[${s}]:${n}`)):e.pFlags.stun&&(i&&r.push(`stun:${i}:${n}`),s&&r.push(`stun:[${s}]:${n}`)),r.length>0&&t.push({urls:r,username:a,credential:o});break}}})),{iceServers:t,iceTransportPolicy:e.pFlags.p2p_allowed?"all":"relay"}}(this.call);if(this.log("joinCall configuration",s),!s)return;const n=this.connectionInstance=new f({call:this,streamManager:i,log:this.log.bindPrefix("connection")}),a=n.createPeerConnection(s);a.addEventListener("iceconnectionstatechange",(()=>{const e=this.connectionState;void 0===this.connectedAt&&e===v.Z.CONNECTED&&(this.connectedAt=Date.now()),this.dispatchEvent("state",e)})),a.addEventListener("negotiationneeded",(()=>{n.negotiate()})),a.addEventListener("icecandidate",(e=>{const{candidate:t}=e;a.log("onicecandidate",t),(null==t?void 0:t.candidate)&&this.sendIceCandidate(t)})),a.addEventListener("track",(e=>{const{track:t}=e;a.log("ontrack",t),this.onTrack(e)})),n.createDescription(),this.encryptor=new I(e,t),this.decryptor=new I(!e,t),this.log("currentCall",this),e&&n.appendStreamToConference(),this.createDataChannel(),this.processDecryptQueue()}createDataChannelEntry(){const e=this.description.createEntry("application");e.setDirection("sendrecv"),e.sendEntry=e.recvEntry=e}createDataChannel(){if(this.connectionInstance.dataChannel)return;const e=this.connectionInstance.createDataChannel({id:0,negotiated:!0});e.addEventListener("message",(e=>{this.applyDataChannelData(JSON.parse(e.data))})),e.addEventListener("open",(()=>{this.sendMediaState()}))}applyDataChannelData(e){"MediaState"===e["@type"]?(e.type="output",this.log("got output media state",e),this.setMediaState(e)):this.log.error("unknown data channel data:",e)}_sendMediaState(){const{connectionInstance:e}=this;if(!e)return;const t=Object.assign({},this.getMediaState("input"));delete t.type,this.log("sendMediaState",t),e.sendDataChannelData(t)}sendCallSignalingData(e){return B(this,void 0,void 0,(function*(){const t=JSON.stringify(e),i=(new TextEncoder).encode(t),{bytes:s}=yield this.encryptor.encryptRawPacket(i);this.log("sendCallSignalingData",this.id,t),yield this.managers.apiManager.invokeApi("phone.sendSignalingData",{peer:yield this.managers.appCallsManager.getCallInput(this.id),data:s})}))}sendIceCandidate(e){this.log("sendIceCandidate",e);const{candidate:t,sdpMLineIndex:i}=e;if(0!==i)return;const s=function(e){if(!e||!e.startsWith("candidate:"))return;const t=e;e=e.substr("candidate:".length);const[i,s,n,a,o,r,...d]=e.split(" "),l={sdpString:t,foundation:i,component:s,protocol:n,priority:a,address:{ip:o,port:r}};for(let e=0;e(this.getEmojisFingerprintPromise=void 0,this.emojisFingerprint=e.map((e=>(0,r.zu)(e))))))}unlockStreamManager(){this.connectionInstance.streamManager.locked=!1,this.connectionInstance.appendStreamToConference()}doTheMagic(){return B(this,void 0,void 0,(function*(){this.connectionInstance.appendStreamToConference();const e=this.connectionInstance.connection;let t=yield e.createAnswer();this.log("[sdp] local",t.type,t.sdp),yield e.setLocalDescription(t),e.getTransceivers().filter((e=>"recvonly"===e.direction)).forEach((e=>{const t=this.connectionInstance.description.getEntryByMid(e.mid);t.transceiver=t.recvEntry.transceiver=e,e.direction="sendrecv"}));const i=this.description,s=i.entries.map((e=>e.mid)),n={type:"offer",sdp:i.generateSdp({bundle:s,entries:i.entries.filter((e=>s.includes(e.mid))),isAnswer:!0})};yield e.setRemoteDescription(n),t=yield e.createAnswer(),yield e.setLocalDescription(t);const a=u((0,p.DV)(t.sdp));this.log("[InitialSetup] send 1"),this.sendCallSignalingData(a),this.unlockStreamManager()}))}overrideConnectionState(e){this._connectionState=e,this.dispatchEvent("state",this.connectionState)}get duration(){return void 0!==this.connectedAt?(Date.now()-this.connectedAt)/1e3|0:0}onInputStream(e){super.onInputStream(e);const t=e.getVideoTracks()[0];if(t){const e=this.getMediaState("input");this.wasStartingScreen||this.wasStartingVideo||(this.wasStartingVideo=!0),this.isSharingVideo?e.videoState="active":this.isSharingScreen&&(e.screencastState="active"),t.addEventListener("ended",(()=>{this.stopVideoSharing()}),{once:!0})}e.getAudioTracks().length&&this.onMutedChange()}onMutedChange(){const e=this.isMuted;this.dispatchEvent("muted",e),this.getMediaState("input").muted=e}toggleMuted(){return this.requestAudioSource(!0).then((()=>{this.setMuted(),this.onMutedChange()}))}hangUp(e,t){return B(this,void 0,void 0,(function*(){if(!this.isClosing&&(this.discardReason=e,this.log("hangUp",e),this.overrideConnectionState(v.Z.CLOSED),this.connectionInstance&&this.connectionInstance.closeConnectionAndStream(!0),e&&!t)){let t=!1;for(const e in this.mediaStates){const i=this.mediaStates[e];t="active"===i.videoState||"active"===i.screencastState||t}yield this.managers.appCallsManager.discardCall(this.id,this.duration,e,t)}}))}performCodec(e){const t=e.payloadTypes.map((e=>Object.assign(Object.assign({},e),{"rtcp-fbs":e.feedbackTypes})));return{"rtp-hdrexts":e.rtpExtensions,"payload-types":t}}setDataToDescription(e){this.description.setData({transport:{pwd:e.pwd,ufrag:e.ufrag,fingerprints:e.fingerprints,"rtcp-mux":!0},audio:this.performCodec(e.audio),video:e.video?this.performCodec(e.video):void 0,screencast:e.screencast?this.performCodec(e.screencast):void 0})}filterNotVP8(e){this.isOutgoing||[e.video,e.screencast].filter(Boolean).forEach((e=>{const t=e.payloadTypes,i=t.findIndex((e=>"VP8"===e.name)),s=t[i],n=t.findIndex((e=>{var t;return+(null===(t=e.parameters)||void 0===t?void 0:t.apt)===s.id}));e.payloadTypes=[t[i],t[n]]}))}applyCallSignalingData(e){return B(this,void 0,void 0,(function*(){this.log("applyCallSignalingData",this,e);const{connection:t,description:i}=this.connectionInstance;switch(e["@type"]){case"InitialSetup":{this.log("[sdp] InitialSetup",e),this.filterNotVP8(e),this.setDataToDescription(e);const s=e=>e.map((e=>({_:"groupCallParticipantVideoSourceGroup",semantics:e.semantics,sources:e.ssrcs.map((e=>+e))})));[(0,w.z_)("audio",+e.audio.ssrc),e.video?(0,w.z_)("video",s(e.video.ssrcGroups)):void 0,e.screencast?(0,w.z_)("screencast",s(e.screencast.ssrcGroups)):void 0].filter(Boolean).forEach((e=>{let t=i.getEntryBySource(e.source);if(t)return;const s=i.findFreeSendRecvEntry(e.type,!1);t=new w.Lp(s.mid,e.type),t.setDirection("sendrecv"),s.recvEntry=t,i.setEntrySource(t,e.sourceGroups||e.source)})),this.createDataChannelEntry();const n=this.offerSent;this.offerSent=!1;const a=i.entries.map((e=>e.mid)),o={type:n?"answer":"offer",sdp:i.generateSdp({bundle:a,entries:i.entries.filter((e=>a.includes(e.mid))),isAnswer:!n})};this.log("[sdp] remote",o.sdp),yield t.setRemoteDescription(o),yield this.tryToReleaseCandidates(),n||(yield this.doTheMagic());break}case"Candidates":for(const t of e.candidates){const e=D.generateCandidate(t);e.sdpMLineIndex=0;const i=new RTCIceCandidate(e);this.candidates.push(i)}yield this.tryToReleaseCandidates();break;default:this.log.error("unrecognized signaling data",e)}}))}tryToReleaseCandidates(){return B(this,void 0,void 0,(function*(){const{connectionInstance:e}=this;if(!e)return;const{connection:t}=e;if(t.remoteDescription){const e=this.candidates.map((e=>this.addIceCandidate(t,e)));this.candidates.length=0,yield Promise.all(e)}else this.log("[candidates] postpone")}))}addIceCandidate(e,t){return B(this,void 0,void 0,(function*(){this.log("[candidate] start",t);try{yield e.addIceCandidate(t),this.log("[candidate] add",t)}catch(e){this.log.error("[candidate] error",t,e)}}))}processDecryptQueue(){return B(this,void 0,void 0,(function*(){const{encryptor:e}=this;if(!e)return void this.log.warn("got encrypted signaling data before the encryption key");if(!this.decryptQueue.length)return;const t=this.decryptQueue.slice();this.decryptQueue.length=0;for(const i of t){const t=yield e.decryptRawPacket(i);if(!t)continue;const s=(new TextDecoder).decode(t);try{const e=JSON.parse(s);this.log("[update] updateNewCallSignalingData",e),this.applyCallSignalingData(e)}catch(e){this.log.error("wrong signaling data",s),this.hangUp("phoneCallDiscardReasonDisconnect"),g.Z.dispatchEvent("incompatible",this.interlocutorUserId)}}}))}onUpdatePhoneCallSignalingData(e){this.decryptQueue.push(e),this.processDecryptQueue()}}},8500:(e,t,i)=>{"use strict";i.d(t,{Z:()=>p});var s=i(3241),n=i(319),a=i(9125),o=i(9337),r=i(382),d=i(5424);function l(){const e={main:{},screen:{}};return t=>{return i=this,s=void 0,a=function*(){const{isScreen:i,constraints:s}=t,n=e[i?"screen":"main"];let a=n[s.audio?"audio":"video"];a||(a=(i?r.Z:d.Z)(s,t.muted),s.audio&&!n.audio&&(n.audio=a.finally((()=>n.audio=void 0))),s.video&&!n.video&&(n.video=a.finally((()=>n.video=void 0))));try{return yield a}catch(e){throw e}},new((n=void 0)||(n=Promise))((function(e,t){function o(e){try{d(a.next(e))}catch(e){t(e)}}function r(e){try{d(a.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(i,s||[])).next())}));var i,s,n,a}}window.getStreamCached=l;var c=i(312),h=i(49),u=i(9585);class p extends s.Z{constructor(){super(!1);const e=this.player=document.createElement("div");e.classList.add("call-player"),e.style.display="none",document.body.append(e),this.elements=new Map;const t=this.audio=new Audio;t.autoplay=!0,t.volume=1,this.player.append(t),this.elements.set("audio",t),this.fixSafariAudio(),this.getStream=l()}get isSharingAudio(){return!!this.streamManager.hasInputTrackKind("audio")}get isSharingVideo(){return!!this.streamManager.hasInputTrackKind("video")}fixSafariAudio(){this.audio.play().catch(n.Z)}requestAudioSource(e){return this.requestInputSource(!0,!1,e)}requestInputSource(e,t,i){const{streamManager:s}=this;if(s){const i=!e||this.isSharingAudio,s=!t||this.isSharingVideo;if(i&&s)return Promise.resolve()}const n={audio:e&&(0,a.Z)(),video:t&&(0,c.Z)()};return this.getStream({constraints:n,muted:i}).then((e=>{this.onInputStream(e)}))}requestScreen(){return this.getStream({isScreen:!0,constraints:(0,o.Z)(!0)}).then((e=>{this.onInputStream(e)}))}getElement(e){return this.elements.get(""+e)}cleanup(){this.player.textContent="",this.player.remove(),this.elements.clear(),this.streamManager.stop(),super.cleanup()}onTrack(e){this.tryAddTrack({stream:e.streams[0],track:e.track,type:"output"})}saveInputVideoStream(e,t){const i=e.getVideoTracks()[0];this.tryAddTrack({stream:e,track:i,type:"input",source:t||"main"})}tryAddTrack({stream:e,track:t,type:i,source:s}){s||(s=u.Z.getSource(e,i)),this.log("tryAddTrack",e,t,i,s);const a="output"===i,{player:o,elements:r,streamManager:d}=this,l=t.kind,c="video"===l,h=c?s:l;let p=r.get(h);c&&t.addEventListener("ended",(()=>{this.log("[track] onended"),r.delete(h)}),{once:!0}),a&&d.addTrack(e,t,i);const f=c?e:d.outputStream;if(p)p.paused&&p.play().catch(n.Z),p.srcObject=f;else{if(p=document.createElement(l),p.autoplay=!0,p.srcObject=f,p.volume=1,"undefined"!==p.sinkId){const{outputDeviceId:e}=this;e&&p.setSinkId(e)}c?(p.setAttribute("playsinline","true"),p.muted=!0):o.appendChild(p),r.set(h,p)}return s}setMuted(e){this.streamManager.inputStream.getAudioTracks().forEach((t=>{"audio"===(null==t?void 0:t.kind)&&(t.enabled=void 0===e?!t.enabled:!e)}))}onInputStream(e){if(this.isClosing)e.getTracks().forEach((e=>{(0,h.Z)(e)}));else{e.getVideoTracks().length&&this.saveInputVideoStream(e,"main");const{streamManager:t,description:i}=this;t.addStream(e,"input"),i&&t.appendToConference(i)}}}},3335:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>n}),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.EXCHANGING_KEYS=2]="EXCHANGING_KEYS",e[e.PENDING=3]="PENDING",e[e.REQUESTING=4]="REQUESTING",e[e.CLOSING=5]="CLOSING",e[e.CLOSED=6]="CLOSED"}(s||(s={}));const n=s},2493:(e,t,i)=>{"use strict";i.d(t,{Z:()=>C});var s=i(5916);let n;var a=i(410),o=i(993),r=i(1655),d=i(6519),l=i(9895),c=i(3241),h=i(7298),u=i(5003),p=i(3855),f=i(1507),m=i(3512),g=i(2069),v=i(3335),b=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};const y=45e3;class w extends c.Z{construct(e){this.managers=e,this.log=(0,u.kg)("CC"),o.Z&&(this.audioAsset=null!=n?n:n=new s.Z(["call_busy.mp3","call_connect.mp3","call_end.mp3","call_incoming.mp3","call_outgoing.mp3","voip_failed.mp3"]),this.tempId=0,this.instances=new Map,this.sortedInstances=[],m.Z.addEventListener("call_update",(e=>b(this,void 0,void 0,(function*(){var t;let i=this.instances.get(e.id);switch(i&&i.setPhoneCall(e),e._){case"phoneCallDiscarded":i&&i.hangUp(null===(t=e.reason)||void 0===t?void 0:t._,!0);break;case"phoneCallAccepted":i&&i.confirmCall();break;case"phoneCallRequested":i||(i=this.createCallInstance({isOutgoing:!1,interlocutorUserId:e.admin_id}),i.overrideConnectionState(v.Z.PENDING),i.setPhoneCall(e),i.setHangUpTimeout(y,"phoneCallDiscardReasonMissed"));break;case"phoneCall":{if(!i||i.encryptionKey)break;const t=i.dh.g_a=e.g_a_or_b,s=i.dh,n=yield p.Z.invokeCrypto("sha256",t);if(!(0,l.Z)(s.g_a_hash,n)){this.log.error("Incorrect g_a_hash",s.g_a_hash,n);break}const{key:a,key_fingerprint:o}=yield this.managers.appCallsManager.computeKey(t,s.b,s.p);if(e.key_fingerprint!==o){this.log.error("Incorrect key fingerprint",e.key_fingerprint,o,t,s),i.hangUp("phoneCallDiscardReasonDisconnect");break}i.encryptionKey=a,i.joinCall();break}}})))),m.Z.addEventListener("call_signaling",(({callId:e,data:t})=>{const i=this.instances.get(e);(null==i?void 0:i.id)===e&&i.onUpdatePhoneCallSignalingData(t)})))}get currentCall(){return this.sortedInstances[0]}getCallByUserId(e){for(const[t,i]of this.instances)if(i.interlocutorUserId===e)return i}createCallInstance(e){const t=new g.Z(Object.assign({managers:this.managers},e));return t.addEventListener("state",(e=>{const i=this.currentCall;e===v.Z.CLOSED?(this.instances.delete(t.id),(0,r.Z)(this.sortedInstances,t)):(0,d.Z)(this.sortedInstances,t,"sortIndex"),e===v.Z.EXCHANGING_KEYS&&(t.wasTryingToJoin=!0);const s=void 0!==t.connectedAt;e===v.Z.EXCHANGING_KEYS||e===v.Z.CONNECTING&&s?t.setHangUpTimeout(y,"phoneCallDiscardReasonDisconnect"):t.clearHangUpTimeout(),i!==t&&i||(e===v.Z.CLOSED?t.isOutgoing||t.wasTryingToJoin?t.wasTryingToJoin&&!s?this.audioAsset.playSound("voip_failed.mp3"):this.audioAsset.playSound("phoneCallDiscardReasonBusy"===t.discardReason?"call_busy.mp3":"call_end.mp3"):this.audioAsset.stopSound():e===v.Z.PENDING?this.audioAsset.playSound(t.isOutgoing?"call_outgoing.mp3":"call_incoming.mp3",!0):e===v.Z.EXCHANGING_KEYS?this.audioAsset.playSoundIfDifferent("call_connect.mp3"):e===v.Z.CONNECTING?t.duration&&this.audioAsset.playSound("voip_connecting.mp3",!0):this.audioAsset.stopSound())})),t.addEventListener("id",((e,i)=>{void 0!==i&&this.instances.delete(i);const s=!!this.currentCall;this.instances.set(e,t),void 0===i&&this.dispatchEvent("instance",{instance:t,hasCurrent:s})})),t}startCallInternal(e,t){return b(this,void 0,void 0,(function*(){this.log("p2pStartCallInternal",e,t);const i=yield this.managers.appProfileManager.getProfile(e);if(!i)return;const{video_calls_available:s}=i.pFlags,n=this.createCallInstance({isOutgoing:!0,interlocutorUserId:e});n.requestInputSource(!0,!(!t||!s),!1),n.overrideConnectionState(v.Z.REQUESTING),n.setPhoneCall({_:"phoneCallWaiting",access_hash:"",admin_id:f.NM,date:(0,h.Z)(!0),id:--this.tempId,participant_id:e,protocol:n.protocol,pFlags:{video:t||void 0}}),this.managers.appCallsManager.generateDh().then((i=>b(this,void 0,void 0,(function*(){return n.dh=i,this.managers.appCallsManager.requestCall(e,n.protocol,n.dh.g_a_hash,t&&s)})))).then((e=>{n.overrideConnectionState(v.Z.PENDING),n.setPhoneCall(e),n.setHangUpTimeout(y,"phoneCallDiscardReasonHangup")}))}))}}const S=new w;a.GO&&(a.GO.callsController=S);const C=S},1677:(e,t,i)=>{"use strict";i.d(t,{KM:()=>s,iK:()=>n});const s=50,n=100},9078:(e,t,i)=>{"use strict";i.d(t,{Z:()=>k});var s=i(4762),n=i(1655),a=i(5953),o=i(6724),r=i(5003),d=i(1507),l=i(3512),c=i(8500),h=i(7625),u=i(3075),p=i(8479),f=i(6752),m=i(9124),g=i(4373),v=i(3773),b=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class y extends u.Z{constructor(e){super(e),this.negotiateThrottled=(0,o.Z)(this.negotiate.bind(this),0,!1)}createPeerConnection(){return this.connection||super.createPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",iceCandidatePoolSize:0})}createDataChannel(){if(this.dataChannel)return this.dataChannel;const e=super.createDataChannel();return e.addEventListener("open",(()=>{this.maybeUpdateRemoteVideoConstraints()})),e.addEventListener("close",(()=>{this.updateConstraintsInterval&&(clearInterval(this.updateConstraintsInterval),this.updateConstraintsInterval=void 0)})),e}createDescription(){return this.description?this.description:super.createDescription()}appendStreamToConference(){super.appendStreamToConference()}invokeJoinGroupCall(e,t,i){return b(this,void 0,void 0,(function*(){const{groupCall:s,description:n}=this,a=s.id,o=t.map((t=>{const i=function(e,t){const i=(0,v.Z)(e,t),s=t.mediaType,n={source:i.source,sourceGroups:i.sourceGroups,type:s};i.fingerprint.setup="active";const a={fingerprints:[i.fingerprint],pwd:i.pwd,ssrc:i.source,"ssrc-groups":i.sourceGroups||[],ufrag:i.ufrag};return{params:{_:"dataJSON",data:JSON.stringify(a)},source:i.source,media:t,sourceGroups:i.sourceGroups,entry:n}}(e,t);return this.sources[i.entry.type]=i.entry,i})),r=o.find((e=>"audio"===e.media.mediaType)),d=o.find((e=>"video"===e.media.mediaType));let{source:c,params:u}=r||{};const p=d||r,f={audio:r,video:d};if(n.entries.forEach((e=>{if("sendonly"===e.direction){const t=f[e.type];if(!t)return;n.setEntrySource(e,t.sourceGroups||t.source),n.setEntryPeerId(e,l.Z.myId)}})),u!==p.params){const e=JSON.parse(p.params.data);c?e.ssrc=c:delete e.ssrc,u={_:"dataJSON",data:JSON.stringify(e)}}const m=yield this.managers.appGroupCallsManager.joinGroupCall(a,u,i),g=JSON.parse(m.params.data);return g.audio=g.audio||s.connections.main.description.audio,n.setData(g),function(e,t){["audio","video"].filter((e=>t[e])).map((e=>[t[e],e])).forEach((([t,i])=>{const s=e.find((e=>e.mediaType===i));if(!s)return;const n=(e=>{const t={};return e.attributes.get("extmap").forEach((e=>{const i=e.key.split("/",1)[0];t[i]=e.value})),t})(s);(0,h.Z)(t["rtp-hdrexts"],((e,t,s)=>{n[e.id]!==e.uri&&(s.splice(t,1),console.log("[sdp] filtered extmap:",e,t,i))}))}))}(t,g),g}))}negotiateInternal(){return b(this,void 0,void 0,(function*(){const{connection:e,description:t}=this,i="new"===e.iceConnectionState&&!t.getEntryByMid("0").source,s=this.log.bindPrefix("startNegotiation");s("start");const n=yield e.createOffer({iceRestart:!1});i&&this.dataChannel&&t.createEntry("application").setDirection("sendrecv");const{sdp:a,offer:o}=function(e){const{offer:t,data:i}=e,s=(0,m.DV)(t.sdp);let n=!1;if(e.skipAddingMulticast||(n=(0,m.e6)(s)||n),(0,h.Z)(s.media,((e,t,a)=>{if(e.isSending)return;if("application"===e.mediaType)return;const o=e.mediaLine,r=o.mediaLineParts,d=(r.ids,o.toString()),l=i[e.mediaType]["payload-types"].map((e=>""+e.id));if(d!==(0,g.Px)(e.mediaType,void 0,l)){const o=(0,v.Z)(s,e),d=Object.assign({},i);d.transport=(0,p.Z)(d.transport),d.transport.ufrag=o.ufrag,d.transport.pwd=o.pwd,d.transport.fingerprints=[o.fingerprint],d.transport.candidates=[];const l=new f.Lp(o.mid,r.type);l.setPort(r.port),o.source&&l.setSource(o.sourceGroups||o.source),l.setDirection(e.direction);const c=(new g.DY).addSsrcEntry(l,d).finalize(),h=(0,m.DV)(c).media[0];a[t]=h,n=!0}})),n){const e=s.toString();t.sdp=e}return{offer:t,sdp:s}}({offer:n,data:t});s("[sdp] setLocalDescription",o.sdp),yield e.setLocalDescription(o);const r=a.media.filter((e=>"application"!==e.mediaType&&e.isSending));if(i)try{yield this.invokeJoinGroupCall(a,r,this.options)}catch(e){this.log.error("[tdweb] joinGroupCall error",e)}const d=[],l=a.bundle;(0,h.Z)(l,((e,i,s)=>{const n=t.getEntryByMid(e);n.shouldBeSkipped(!0)&&(s.splice(i,1),d.push(n))}));const c=a.media.map((e=>{const i=e.mid;let s=t.getEntryByMid(i);return s||(s=new f.Lp(i,e.mediaType),s.setDirection("inactive")),s})),u={type:"answer",sdp:t.generateSdp({bundle:l,entries:c,isAnswer:!0})};d.forEach((e=>{t.deleteEntry(e)})),s(`[sdp] setRemoteDescription signaling=${e.signalingState} ice=${e.iceConnectionState} gathering=${e.iceGatheringState} connection=${e.connectionState}`,u.sdp),yield e.setRemoteDescription(u),s("end")}))}negotiate(){let e=this.negotiating;return e||(e=super.negotiate(),this.updateConstraints&&e.then((()=>{this.maybeUpdateRemoteVideoConstraints(),this.updateConstraints=!1})),"presentation"===this.options.type&&e.then((()=>{this.connection.getTransceivers().find((e=>{var t,i;"video"===(null===(i=null===(t=e.sender)||void 0===t?void 0:t.track)||void 0===i?void 0:i.kind)&&e.sender.setParameters(Object.assign(Object.assign({},e.sender.getParameters()),{degradationPreference:"maintain-resolution"}))}))})),e)}maybeUpdateRemoteVideoConstraints(){if("open"!==this.dataChannel.readyState)return;this.log("maybeUpdateRemoteVideoConstraints");const e={colibriClass:"ReceiverVideoConstraints",constraints:{},defaultConstraints:{maxHeight:0},onStageEndpoints:[]};for(const t of this.description.entries){if("recvonly"!==t.direction||"video"!==t.type)continue;const{endpoint:i}=t;e.onStageEndpoints.push(i),e.constraints[i]={minHeight:180,maxHeight:720}}this.sendDataChannelData(e),e.onStageEndpoints.length?this.updateConstraintsInterval||(this.updateConstraintsInterval=window.setInterval(this.maybeUpdateRemoteVideoConstraints.bind(this),5e3)):this.updateConstraintsInterval&&(clearInterval(this.updateConstraintsInterval),this.updateConstraintsInterval=void 0)}addInputVideoStream(e){this.groupCall.saveInputVideoStream(e,this.type),this.streamManager.addStream(e,"input"),this.appendStreamToConference()}}var w=i(2207),S=i(9337),C=i(382),L=i(5424),E=i(312),I=i(49),M=i(9585),Z=i(2946),P=i(2059),T=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};class k extends c.Z{constructor(e){super(),(0,a.Z)(this,e),this.log||(this.log=(0,r.kg)("GROUP-CALL")),this.connections||(this.connections={}),this.isSpeakingMap||(this.isSpeakingMap=new Map),this.pinnedSources=[],this.participantsSsrcs=new Map,this.hadAutoPinnedSources=new Set,this.dispatchPinnedThrottled=(0,o.Z)((()=>{this.dispatchEvent("pinned",this.pinnedSource)}),0,!1),this.addEventListener("state",(e=>{e===w.Z.CLOSED&&this.cleanup()}))}get connectionState(){return this.connections.main.connection.iceConnectionState}get state(){const{connectionState:e}=this;if("closed"===e)return w.Z.CLOSED;if("connected"===e||s.IS_SAFARI&&"completed"===e){const{participant:e}=this;return e.pFlags.can_self_unmute?e.pFlags.muted?w.Z.MUTED:w.Z.UNMUTED:w.Z.MUTED_BY_ADMIN}return w.Z.CONNECTING}get participants(){return this.managers.appGroupCallsManager.getCachedParticipants(this.id)}get isSharingScreen(){return!!this.connections.presentation}get pinnedSource(){return this.pinnedSources[this.pinnedSources.length-1]}get isMuted(){return this.state!==w.Z.UNMUTED}get isClosing(){const{state:e}=this;return e===w.Z.CLOSED}get streamManager(){return this.connections.main.streamManager}get description(){return this.connections.main.description}pinSource(e){(0,n.Z)(this.pinnedSources,e),this.pinnedSources.push(e),this.dispatchPinnedThrottled()}unpinSource(e){this.hadAutoPinnedSources.delete(e),(0,n.Z)(this.pinnedSources,e),this.dispatchPinnedThrottled()}unpinAll(){this.pinnedSources.length=0,this.dispatchPinnedThrottled()}getParticipantByPeerId(e){return T(this,void 0,void 0,(function*(){return d.NM===e?this.participant:(yield this.participants).get(e)}))}toggleMuted(){return this.requestAudioSource(!0).then((()=>this.changeUserMuted(d.NM)))}changeUserMuted(e,t){return T(this,void 0,void 0,(function*(){const i=yield this.getParticipantByPeerId(e);return d.NM===e&&i.pFlags.can_self_unmute&&(t=void 0===t?!i.pFlags.muted:t),this.editParticipant(i,{muted:t})}))}getElement(e){return super.getElement(e)}getVideoElementFromParticipantByType(e,t){let i;i=e.pFlags.self?"video"===t?"main":"presentation":e[t].source_groups[0].sources[0];const s=this.getElement(i);if(!s)return;const n=s.cloneNode();return n.srcObject=s.srcObject,{video:n,source:i}}createConnectionInstance(e){return this.connections[e.type]=new y(Object.assign({groupCall:this,log:this.log.bindPrefix(e.type),managers:this.managers},e))}changeRaiseHand(e){return this.editParticipant(this.participant,{raiseHand:e})}startScreenSharingInternal(){return T(this,void 0,void 0,(function*(){try{const e="presentation",t=yield(0,C.Z)((0,S.Z)()),i=new M.Z,s=this.createConnectionInstance({streamManager:i,type:e,options:{type:e}});s.createPeerConnection().addEventListener("negotiationneeded",(()=>{s.negotiate()})),t.getVideoTracks()[0].addEventListener("ended",(()=>{this.connections.presentation&&this.stopScreenSharing()}),{once:!0}),s.createDescription(),s.addInputVideoStream(t)}catch(e){this.log.error("start screen sharing error",e)}}))}startScreenSharing(){var e;return null!==(e=this.startScreenSharingPromise)&&void 0!==e?e:this.startScreenSharingPromise=this.startScreenSharingInternal().finally((()=>{this.startScreenSharingPromise=void 0}))}stopScreenSharing(){const e=this.connections.presentation;return e?(delete this.connections.presentation,this.unpinSource("presentation"),e.closeConnectionAndStream(!0),delete this.participant.presentation,this.managers.appGroupCallsManager.saveApiParticipant(this.id,this.participant),this.managers.appGroupCallsManager.leaveGroupCallPresentation(this.id)):Promise.resolve()}toggleScreenSharing(){return this.isSharingScreen?this.stopScreenSharing():this.startScreenSharing()}startVideoSharingInternal(){return T(this,void 0,void 0,(function*(){const e={video:(0,E.Z)()};try{const t=yield(0,L.Z)(e,!1);this.connections.main.addInputVideoStream(t),yield this.editParticipant(this.participant,{videoPaused:!1,videoStopped:!1})}catch(t){this.log.error("startVideoSharing error",t,e)}}))}startVideoSharing(){var e;return null!==(e=this.startVideoSharingPromise)&&void 0!==e?e:this.startVideoSharingPromise=this.startVideoSharingInternal().finally((()=>{this.startVideoSharingPromise=void 0}))}stopVideoSharing(){return T(this,void 0,void 0,(function*(){const e=this.connections.main,t=e.streamManager.inputStream.getVideoTracks()[0];t&&((0,I.Z)(t),e.streamManager.appendToConference(e.description),yield this.editParticipant(this.participant,{videoStopped:!0}))}))}toggleVideoSharing(){return this.isSharingVideo?this.stopVideoSharing():this.startVideoSharing()}hangUp(e=!1,t=!1,i=!1){return T(this,void 0,void 0,(function*(){for(const e in this.connections)this.connections[e].closeConnectionAndStream(!t);if(this.dispatchEvent("state",this.state),!i&&!t){const t=e||(this.joined?this.connections.main.sources.audio.source:void 0);this.managers.appGroupCallsManager.hangUp(this.id,t)}}))}tryAddTrack(e){const{description:t}=this,i=super.tryAddTrack(e);if("output"===e.type){const e=t.getEntryBySource(+i);this.getParticipantByPeerId(e.peerId).then((e=>{e&&l.Z.dispatchEvent("group_call_participant",{groupCallId:this.id,participant:e})}))}return i}editParticipant(e,t){return T(this,void 0,void 0,(function*(){if(Object.keys(t).length){if(e){const i=e.pFlags.self;if(i&&void 0!==t.muted&&!this.isSharingAudio&&(delete t.muted,!Object.keys(t).length))return;const s=t.muted;void 0!==s&&e.pFlags.self&&(s?e.pFlags.muted=!0:e.pFlags.can_self_unmute&&delete e.pFlags.muted),void 0!==t.raiseHand&&(t.raiseHand?e.raise_hand_rating="1":delete e.raise_hand_rating),i&&(void 0!==t.videoStopped&&(t.videoStopped?delete e.video:e.video=(0,P.KR)(this.connections.main.sources.video)),!e.pFlags.muted&&e.pFlags.can_self_unmute&&this.setMuted(!1),this.dispatchEvent("state",this.state))}return this.managers.appGroupCallsManager.editParticipant(this.id,e,t)}}))}onParticipantUpdate(e,t){const i=this.connections.main,{connection:s,description:n}=i,a=(0,Z.Z)(e.peer),o=!!e.pFlags.left,r=this.participantsSsrcs.get(a)||[];if(e.presentation&&!o){const{source:t}=(0,P._f)(e,"video",e.presentation.source_groups,e.presentation.endpoint);this.hadAutoPinnedSources.has(t)||(this.hadAutoPinnedSources.add(t),this.pinSource(e.pFlags.self?"presentation":t))}if(e.pFlags.self){this.participant=e,i.sources.audio.source!==e.source&&this.hangUp();let s=!1;return e.pFlags.can_self_unmute?e.pFlags.muted&&(s=!0):(this.stopScreenSharing(),this.stopVideoSharing(),s=!0),s&&this.setMuted(!0),void(t!==a&&this.dispatchEvent("state",this.state))}const d=o?[]:(0,P.s$)(e);o?this.participantsSsrcs.delete(a):this.participantsSsrcs.set(a,d);const l=new Set;r.forEach((e=>{const t=e.source;if(!d.find((e=>e.source===t))){this.unpinSource(t);const e=n.getEntryBySource(t);e&&"inactive"!==e.direction&&(e.setDirection("inactive"),l.add(e.type))}})),d.forEach((e=>{let t=n.getEntryBySource(e.source);t?"inactive"===t.direction&&(t.setDirection(t.originalDirection),l.add(t.type)):(t=n.createEntry(e.type),n.setEntrySource(t,e.sourceGroups||e.source),n.setEntryPeerId(t,a),"video"===e.type&&t.setEndpoint(e.endpoint),t.createTransceiver(s,{direction:"recvonly"}),l.add(t.type))})),l.size&&(l.has("video")&&(i.updateConstraints=!0),i.negotiateThrottled())}}},2207:(e,t,i)=>{"use strict";var s;i.d(t,{Z:()=>n}),function(e){e[e.UNMUTED=0]="UNMUTED",e[e.MUTED=1]="MUTED",e[e.MUTED_BY_ADMIN=2]="MUTED_BY_ADMIN",e[e.CONNECTING=3]="CONNECTING",e[e.CLOSED=4]="CLOSED"}(s||(s={}));const n=s},2059:(e,t,i)=>{"use strict";i.d(t,{ZP:()=>L,KR:()=>w,_f:()=>y,s$:()=>b});var s=i(5916);let n;var a=i(410),o=i(3241),r=i(5003),d=i(3512),l=i(9078),c=i(2207),h=i(1677),u=i(9585),p=i(9125),f=i(5424),m=i(312),g=i(6752),v=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,r)}d((s=s.apply(e,t||[])).next())}))};function b(e){var t,i;return[y(0,"audio",e.source),(null===(t=e.video)||void 0===t?void 0:t.audio_source)&&y(0,"audio",e.video.audio_source),e.video&&y(0,"video",e.video.source_groups,e.video.endpoint),(null===(i=e.presentation)||void 0===i?void 0:i.audio_source)&&y(0,"audio",e.presentation.audio_source),e.presentation&&y(0,"video",e.presentation.source_groups,e.presentation.endpoint)].filter(Boolean)}function y(e,t,i,s){return(0,g.z_)(t,i,s)}function w(e,t){return e&&{_:"groupCallParticipantVideo",pFlags:{},endpoint:"",source_groups:e.sourceGroups,audio_source:t}}class S extends o.Z{construct(e){this.managers=e,this.audioAsset=null!=n?n:n=new s.Z(["group_call_connect.mp3","group_call_end.mp3","group_call_start.mp3","voip_onallowtalk.mp3"]),this.log=(0,r.kg)("GCC"),d.Z.addEventListener("group_call_update",(e=>{const{currentGroupCall:t}=this;(null==t?void 0:t.id)===e.id&&(t.groupCall=e,"groupCallDiscarded"===e._&&t.hangUp(!1,!1,!0))})),d.Z.addEventListener("group_call_participant",(({groupCallId:e,participant:t})=>{const{currentGroupCall:i}=this;(null==i?void 0:i.id)===e&&i.onParticipantUpdate(t)}))}get groupCall(){return this.currentGroupCall}setCurrentGroupCall(e){this.currentGroupCall=e,e&&this.dispatchEvent("instance",e)}startConnectingSound(){this.stopConnectingSound(),this.audioAsset.playSoundWithTimeout("group_call_connect.mp3",!0,2500)}stopConnectingSound(){this.audioAsset.stopSound(),this.audioAsset.cancelDelayedPlay()}joinGroupCall(e,t,i=!0,s,n){return v(this,void 0,void 0,(function*(){let a;return this.audioAsset.createAudio(),this.log(`joinGroupCall chatId=${e} id=${t} muted=${i} rejoin=${s}`),a=s?this.currentGroupCall.connections.main.streamManager:yield function(e,t){return i=this,s=void 0,a=function*(){const i={audio:(0,p.Z)(),video:t&&(0,m.Z)()},s=new u.Z(h.iK);try{const t=yield(0,f.Z)(i,e);s.addStream(t,"input")}catch(e){console.error("joinGroupCall getStream error",e,i),s.inputStream=new MediaStream}return s},new((n=void 0)||(n=Promise))((function(e,t){function o(e){try{d(a.next(e))}catch(e){t(e)}}function r(e){try{d(a.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(i,s||[])).next())}));var i,s,n,a}(i,n),this.joinGroupCallInternal(e,t,a,i,s,n).then((()=>{const{currentGroupCall:e}=this;e.participants.then((t=>{this.currentGroupCall===e&&e.state!==c.Z.CLOSED&&t.forEach((t=>{t.pFlags.self||e.onParticipantUpdate(t)}))}))}))}))}joinGroupCallInternal(e,t,i,s,n=!1,a){return v(this,void 0,void 0,(function*(){const o=this.log.bindPrefix("joinGroupCallInternal");o("start",t);const r="main";let{currentGroupCall:h}=this;if(!h||!n){h=new l.Z({chatId:e,id:t,managers:this.managers}),h.fixSafariAudio(),h.addEventListener("state",(e=>{this.currentGroupCall===h&&e===c.Z.CLOSED&&(this.setCurrentGroupCall(null),this.stopConnectingSound(),this.audioAsset.playSound("group_call_end.mp3"),d.Z.dispatchEvent("chat_update",h.chatId))})),h.groupCall=yield this.managers.appGroupCallsManager.getGroupCallFull(t);const u=h.createConnectionInstance({streamManager:i,type:r,options:{type:r,isMuted:s,joinVideo:a,rejoin:n}}),p=u.createPeerConnection();return p.addEventListener("negotiationneeded",(()=>{u.negotiate()})),p.addEventListener("track",(e=>{o("ontrack",e),h.onTrack(e)})),p.addEventListener("iceconnectionstatechange",(()=>{h.dispatchEvent("state",h.state);const{iceConnectionState:e}=p;switch("disconnected"===e||"checking"===e||"new"===e?this.startConnectingSound():this.stopConnectingSound(),e){case"checking":case"completed":case"disconnected":case"new":break;case"closed":case"failed":h.hangUp();break;case"connected":h.joined||(h.joined=!0,this.audioAsset.playSound("group_call_start.mp3"),this.managers.appGroupCallsManager.getGroupCallParticipants(t))}})),u.createDescription(),u.createDataChannel(),u.appendStreamToConference(),this.setCurrentGroupCall(h),o("set currentGroupCall",t,h),this.startConnectingSound(),u.negotiate()}h.handleUpdateGroupCallParticipants=!1,h.updatingSdp=!1,o("update currentGroupCall",t,h)}))}}const C=new S;a.GO&&(a.GO.groupCallController=C);const L=C},9125:(e,t,i)=>{"use strict";function s(){const e={channelCount:2};return["noiseSuppression","echoCancellation","autoGainControl"].forEach((t=>{(function(e){var t;return(!!(null===(t=null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||void 0===t?void 0:t.getSupportedConstraints()))[e]})(t)&&(e[t]=!0)})),e}i.d(t,{Z:()=>s})},9337:(e,t,i)=>{"use strict";function s(e){const t={video:{width:{max:1920},height:{max:1080},frameRate:{max:30}}};return e||(t.audio=!0),t}i.d(t,{Z:()=>s})},382:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});function s(e){return t=this,i=void 0,n=function*(){const t=yield navigator.mediaDevices.getDisplayMedia(e);return t.getVideoTracks()[0].contentHint="text",t},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n}},5424:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});function s(e,t){return i=this,s=void 0,a=function*(){const i=yield navigator.mediaDevices.getUserMedia(e);return i.getTracks().forEach((e=>{e.enabled=!t})),i},new((n=void 0)||(n=Promise))((function(e,t){function o(e){try{d(a.next(e))}catch(e){t(e)}}function r(e){try{d(a.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(i,s||[])).next())}));var i,s,n,a}window.getStream=s},312:(e,t,i)=>{"use strict";function s(){return{width:{min:1280,max:1920},height:{min:720,max:1080},frameRate:{min:24,max:30}}}i.d(t,{Z:()=>s})},3773:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(8957);function n(e,t){const i=t.lookupAttributeKeys({"ice-ufrag":!0,"ice-pwd":!0,fingerprint:!0,setup:!0,ssrc:!0,mid:!0,"ssrc-group":!1});if(!i.fingerprint){const t=e.session.lines.find((e=>{var t;return"fingerprint"===(null===(t=e.parsed)||void 0===t?void 0:t.key)}));i.fingerprint=t.parsed.value}const n=function(e){const t=e.map((e=>{const[t,...i]=e.split(" ");return{_:"groupCallParticipantVideoSourceGroup",semantics:t,sources:i.map((e=>(0,s.Fk)(+e)))}}));return t.length?t:void 0}(i["ssrc-group"]),[a,o]=i.fingerprint.split(" ",2),r=i.ssrc&&(0,s.Fk)(+i.ssrc.split(" ",1)[0]);return{raw:i,ufrag:i["ice-ufrag"],pwd:i["ice-pwd"],fingerprint:{fingerprint:o,setup:i.setup,hash:a},source:r,sourceGroups:n,mid:i.mid}}},49:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(6669);function n(e){e.stop(),(0,s.Z)(e,"ended")}},6752:(e,t,i)=>{"use strict";i.d(t,{Lp:()=>o,ZP:()=>d,z_:()=>r});var s=i(1655),n=i(5953),a=i(4373);class o{constructor(e,t){this.mid=e,this.type=t,this.port=a._D}setDirection(e){return this.originalDirection||(this.originalDirection=e),this.direction=e}setPort(e){return this.port=e}setEndpoint(e){return this.endpoint=e}setPeerId(e){return this.peerId=e}createTransceiver(e,t){return(null==t?void 0:t.direction)&&this.setDirection(t.direction),this.transceiver=e.addTransceiver((0,a.pl)(this.type),t)}setSource(e){let t;if(Array.isArray(e)){if(!e[0])return;t=e,e=t[0].sources[0]}return this.sourceGroups=t,this.source=e}shouldBeSkipped(e){return e&&"inactive"===this.direction}}function r(e,t,i){let s;if(Array.isArray(t)){if(!t[0])return;s=t,t=s[0].sources[0]}return{endpoint:i,type:e,source:t,sourceGroups:s}}class d{constructor(e){this.connection=e,this.sessionId=""+Date.now(),this.maxSeenId=-1,this.entries=[],this.entriesByMid=new Map,this.entriesBySource=new Map,this.entriesByPeerId=new Map}setData(e){return(0,n.Z)(this,e)}createEntry(e){const t=""+ ++this.maxSeenId,i=new o(t,e);return this.entries.push(i),this.entriesByMid.set(t,i),i}deleteEntry(e){(0,s.Z)(this.entries,e),this.entriesByMid.delete(e.mid),this.entriesBySource.delete(e.source);const t=this.entriesByPeerId.get(e.peerId);t&&(t.delete(e),t.size||this.entriesByPeerId.delete(e.peerId))}setEntrySource(e,t){e.setSource(t),this.entriesBySource.set(e.source,e)}setEntryPeerId(e,t){e.setPeerId(t);let i=this.entriesByPeerId.get(t);i||this.entriesByPeerId.set(t,i=new Set),i.add(e)}findEntry(e){return this.entries.find(e)}findFreeSendRecvEntry(e,t){let i=this.entries.find((i=>"sendrecv"===i.direction&&i.type===e&&!(t?i.sendEntry:i.recvEntry)));return i||(i=this.createEntry(e),i.setDirection("sendrecv")),i}getEntryByMid(e){return this.entriesByMid.get(e)}getEntryBySource(e){return this.entriesBySource.get(e)}getEntriesByPeerId(e){return this.entriesByPeerId.get(e)}generateSdp(e){return a.DY.fromConference(Object.assign({conference:this},e))}}},9124:(e,t,i)=>{"use strict";i.d(t,{e6:()=>de,DV:()=>oe});var s,n,a=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},o=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class r{constructor(e,t){s.set(this,void 0),n.set(this,void 0),a(this,s,e,"f"),a(this,n,t,"f")}get session(){return o(this,s,"f")}get media(){return o(this,n,"f")}get bundle(){return this.session.lines.find((e=>{var t;return"group"===(null===(t=e.parsed)||void 0===t?void 0:t.key)})).value.split(" ").slice(1)}toString(){return this.session.lines.concat(...this.media.map((e=>e.lines))).map((e=>e.toString())).join("\r\n")+"\r\n"}}function d(e,t,i){const s=e.split(t),n=[];for(;i>0&&s.length;)n.push(s.shift()),--i;return s.length&&n.push(s.join(t)),n}s=new WeakMap,n=new WeakMap;var l,c,h,u=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},p=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class f{constructor(e,t){l.set(this,void 0),c.set(this,void 0),h.set(this,void 0),u(this,l,new Set,"f"),u(this,c,e,"f"),u(this,h,t,"f")}generate(){const e=p(this,c,"f"),t=p(this,h,"f"),i=p(this,l,"f"),s=t-e+1;let n=Math.floor(e+s*Math.random()),a=0;for(;i.has(n);)if(n=s)return null;return i.add(n),n}add(e){p(this,l,"f").add(e)}}l=new WeakMap,c=new WeakMap,h=new WeakMap;var m,g,v=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},b=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class y{constructor(e,t){m.set(this,void 0),g.set(this,void 0),v(this,m,e,"f"),v(this,g,t,"f")}get key(){return b(this,m,"f")}get value(){return b(this,g,"f")}}m=new WeakMap,g=new WeakMap;var w,S,C,L,E=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},I=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class M{constructor(e,t,i,s){w.set(this,void 0),S.set(this,void 0),C.set(this,void 0),L.set(this,void 0),E(this,w,e,"f"),E(this,S,t,"f"),E(this,C,i,"f"),E(this,L,s,"f")}get type(){return I(this,w,"f")}get port(){return I(this,S,"f")}get protocol(){return I(this,C,"f")}get ids(){return I(this,L,"f")}toString(){return this.type+" "+this.port+" "+this.protocol+" "+this.ids.join(" ")}}w=new WeakMap,S=new WeakMap,C=new WeakMap,L=new WeakMap;var Z,P,T,k,x=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},A=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class _{constructor(e,t){if(Z.set(this,void 0),P.set(this,void 0),T.set(this,void 0),k.set(this,void 0),x(this,Z,e,"f"),"string"==typeof t){if(x(this,P,t,"f"),"m"===e){const e=t.split(" ");x(this,T,new M(e[0],e[1],e[2],e.slice(3)),"f")}else if("a"===e){const e=d(t,":",1);t=e[0],x(this,k,1===e.length?new y(t,null):new y(t,e[1]),"f")}}else t instanceof M?(x(this,T,t,"f"),x(this,P,t.toString(),"f")):t instanceof y&&(x(this,k,t,"f"),x(this,P,t.value?`${t.key}:${t.value}`:t.key,"f"))}get key(){return A(this,Z,"f")}get value(){return A(this,P,"f")}get parsed(){return A(this,k,"f")}get mediaLineParts(){return A(this,T,"f")}toString(){return`${this.key}=${this.value}`}}Z=new WeakMap,P=new WeakMap,T=new WeakMap,k=new WeakMap;var F,D,R,B,N,O,U=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},H=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class z{constructor(e,t,i=":",s=!1){F.set(this,void 0),D.set(this,void 0),R.set(this,void 0),B.set(this,void 0),N.set(this,void 0),O.set(this,void 0),U(this,F,e,"f"),U(this,D,t,"f"),U(this,R,i,"f"),U(this,N,s,"f"),U(this,B,s?new Map:null,"f"),U(this,O,s?[]:null,"f")}get lines(){return H(this,D,"f")}get value(){return H(this,N,"f")||!this.lines.length?null:this.lines[0]}get exists(){return!H(this,N,"f")}get key(){return H(this,F,"f")}get keys(){return z.fill(this),H(this,O,"f")}forEach(e){z.fill(this),H(this,B,"f").forEach(e)}get(e){return z.fill(this),H(this,B,"f").get(e)||new z(e,[],":",!0)}static fill(e){if(null!==H(e,B,"f"))return;const t=new Map;e.lines.forEach((i=>{const[s,n]=d(i,H(e,R,"f"),1),a=t.get(s)||[];t.set(s,[...a,n||""])}));const i=U(e,B,z.makeAttributes(t),"f");U(e,O,Array.from(i.keys()),"f")}static makeAttributes(e){const t=new Map;return e.forEach(((e,i)=>{t.set(i,new z(i,e))})),t}}F=new WeakMap,D=new WeakMap,R=new WeakMap,B=new WeakMap,N=new WeakMap,O=new WeakMap;var j,G,V=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},K=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class W{constructor(e){j.set(this,void 0),G.set(this,void 0),V(this,j,e,"f"),V(this,G,new Map,"f"),W.fillAttributes(this)}get(e){return K(this,G,"f").get(e)||new z(e,[]," ",!0)}static fillAttributes(e){const t=new Map;K(e,j,"f").forEach((e=>{if("a"===e.key){const{key:i,value:s}=e.parsed;let n=t.get(i);n||(n=[],t.set(i,n)),n.push(s||"")}})),t.forEach(((t,i)=>{K(e,G,"f").set(i,new z(i,t," ",!1))}))}}j=new WeakMap,G=new WeakMap;var $,q,Y,Q,X=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},J=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class ee{constructor(e){$.set(this,void 0),q.set(this,void 0),Y.set(this,void 0),Q.set(this,void 0),X(this,$,e,"f"),X(this,q,e[0],"f"),X(this,Y,X(this,Q,null,"f"),"f")}get lines(){return J(this,$,"f")}get mediaLine(){return J(this,q,"f")}get mediaLineParts(){return J(this,q,"f").mediaLineParts}get mediaType(){return this.mediaLineParts.type}get direction(){if(!J(this,Q,"f")){const e=this.attributes;let t;t=e.get("sendonly").exists?"sendonly":e.get("recvonly").exists?"recvonly":e.get("inactive").exists?"inactive":"sendrecv",X(this,Q,t,"f")}return J(this,Q,"f")}get isSending(){return"sendrecv"===this.direction||"sendonly"===this.direction}get isReceiving(){return"sendrecv"===this.direction||"recvonly"===this.direction}get attributes(){return J(this,Y,"f")||X(this,Y,new W(this.lines),"f"),J(this,Y,"f")}get mid(){return this.attributes.get("mid").value}lookupAttributeKeys(e){const t={};for(const i in e){const s=this.attributes.get(i),n=!e[i];t[i]=s?n?s.lines:s.value:n?[]:void 0}return t}}$=new WeakMap,q=new WeakMap,Y=new WeakMap,Q=new WeakMap;var te,ie,se=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i},ne=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class ae{constructor(e){te.set(this,void 0),ie.set(this,void 0),se(this,te,e,"f"),se(this,ie,e.filter((e=>"o"===e.key)).map((e=>e.value.split(" ")[1]))[0],"f")}get lines(){return ne(this,te,"f")}get sessionId(){return ne(this,ie,"f")}}function oe(e){function t(){i?n.push(new ee(s)):i=new ae(s)}let i=null,s=[];const n=[];return e.split(/\r?\n/).forEach((e=>{if(!function(e){return/^[\s\xa0]*$/.test(e)}(e)){const i=re(e);"m"===i.key&&(t(),s=[]),s.push(i)}})),t(),new r(i,n)}function re(e){const t=d(e,"=",1);return new _(t[0],t[1])}function de(e){let t;return e.media.forEach(((i,s)=>{if("video"===i.mediaType&&i.isSending&&!i.attributes.get("ssrc-group").get("SIM").exists){t||(t=new f(2,4294967295));const n=i.attributes.get("ssrc-group").get("FID").value.split(" "),a=i.lines;n.forEach((e=>t.add(+e)));const o=[n[0],t.generate(),t.generate()],r=[n[1],t.generate(),t.generate()];a.push(re("a=ssrc-group:SIM "+o.join(" ")));const d=i.attributes.get("ssrc").get(n[0]).lines;o.forEach(((e,t)=>{const i=r[t];t>0&&(a.push(re("a=ssrc-group:FID "+e+" "+i)),d.forEach((t=>{a.push(re("a=ssrc:"+e+" "+t))})),d.forEach((e=>{a.push(re("a=ssrc:"+i+" "+e))})))})),e.media[s]=new ee(a)}})),!!t}te=new WeakMap,ie=new WeakMap},4373:(e,t,i)=>{"use strict";i.d(t,{DY:()=>c,Px:()=>l,_D:()=>o,pl:()=>r});var s=i(4762),n=i(630),a=i(8957);const o="9";function r(e){return"screencast"===e?"video":e}function d(e){return"application"===e?"DTLS/SCTP":"UDP/TLS/RTP/SAVPF"}function l(e,t=o,i){const s=d(e);return`m=${r(e)} ${t} ${s} ${i.join(" ")}`}class c extends n.Z{addCandidate(e){return this.add(function(e){const t=[];return t.push("a=candidate:"),t.push(`${e.foundation} ${e.component} ${e.protocol.toUpperCase()} ${e.priority} ${e.ip} ${e.port} typ ${e.type}`),void 0!==e["rel-addr"]&&t.push(` raddr ${e["rel-addr"]} rport ${e["rel-port"]}`),t.push(` generation ${e.generation}`),t.join("")}(e))}addHeader(e,t){const i=t.join(" ");return this.add("v=0",`o=- ${e} 2 IN IP4 0.0.0.0`,"s=-","t=0 0","a=extmap-allow-mixed",`a=group:BUNDLE ${i}`,"a=ice-options:trickle","a=msid-semantic:WMS *")}addTransport(e,t){this.add(`a=ice-ufrag:${e.ufrag}`,`a=ice-pwd:${e.pwd}`,"a=ice-options:trickle");for(const t of e.fingerprints)this.add(`a=fingerprint:${t.hash} ${t.fingerprint}`,`a=setup:${t.setup}`);if(!t&&e.candidates)for(const t of e.candidates)this.addCandidate(t);return this}addSsrc(e){let t="stream",{type:i,sourceGroups:s}=e;const n=(0,a.h)(e.source);t+=n,i+=n;const o=e=>{this.add(`a=ssrc:${e} cname:${t}`,`a=ssrc:${e} msid:${t} ${i}`,`a=ssrc:${e} mslabel:${t}`,`a=ssrc:${e} label:${i}`)};return(()=>{this.add(`a=msid:${t} ${i}`)})(),(null==s?void 0:s.length)?s.forEach((e=>{if(e.sources.length){const t=e.sources.map(a.h);this.add(`a=ssrc-group:${e.semantics} ${t.join(" ")}`),t.forEach(o)}})):o(n),this}addSsrcEntry(e,t,i){const s=(...e)=>this.add(...e),{type:n,mid:a,direction:o,port:c}=e,h=t.transport,u="application"===n,p=u?void 0:t[n],f="inactive"===o;if(e.shouldBeSkipped(i))return s(`m=${r(n)} 0 ${d(n)} 0`,"c=IN IP4 0.0.0.0","a=inactive",`a=mid:${a}`);const m=u?[{id:5e3}]:p["payload-types"],g=m.map((e=>e.id));s(l(n,c,g),"c=IN IP4 0.0.0.0",`a=rtcp:${c} IN IP4 0.0.0.0`),h["rtcp-mux"]&&s("a=rtcp-mux"),s(`a=mid:${a}`);let v=o;if("sendrecv"===o||!i||f||u||(v="sendonly"===o?"recvonly":"sendonly"),s(`a=${v}`),this.addTransport(h),u)s(`a=sctpmap:${m[0].id} webrtc-datachannel 256`);else{const e=p["rtp-hdrexts"];(null==e?void 0:e.length)&&e.forEach((e=>{s(`a=extmap:${e.id} ${e.uri}`)})),m.forEach((e=>{s(`a=rtpmap:${e.id} ${e.name}/${e.clockrate}${e.channels&&e.channels>1?`/${e.channels}`:""}`);const t=e.parameters;if(Array.isArray(t))t.length&&console.error("parameters is array???",t);else if(t&&Object.keys(t).length){const i=[];for(const e in t)i.push(`${e}=${t[e]}`);s(`a=fmtp:${e.id} ${i.join(";")}`)}const i=e["rtcp-fbs"];(null==i?void 0:i.length)&&i.forEach((t=>{s(`a=rtcp-fb:${e.id} ${t.type}${t.subtype?" "+t.subtype:""}`)}))}))}return!e.source||"sendonly"!==v&&"sendrecv"!==v||this.addSsrc(e),this}addConference(e){const{conference:t,entries:i,bundle:n,isAnswer:a}=e;this.addHeader(t.sessionId,n),s.IS_FIREFOX&&this.addTransport(t.transport);for(const e of i)this.addSsrcEntry((a?e.recvEntry||e.sendEntry:e.sendEntry||e.recvEntry)||e,t,a);return this}static fromConference(e){return(new c).addConference(e).finalize()}}},9585:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var s=i(3241),n=i(5003),a=i(1677),o=i(49),r=i(4373),d=i(8957);class l{constructor(e,t){const i=this.streamSource=e.createMediaStreamSource(t),s=this.analyser=e.createAnalyser();this.gain=e.createGain(),s.minDecibels=-100,s.maxDecibels=-30,s.smoothingTimeConstant=.05,s.fftSize=1024,i.connect(s)}}class c{constructor(e){this.interval=e,this.getAmplitude=e=>{const{streamAnalyser:t,stream:i,track:s,source:n,type:a}=e,o=t.analyser;if(!o)return;const r=new Uint8Array(o.frequencyBinCount);return o.getByteFrequencyData(r),{type:a,source:n,stream:i,track:s,value:(0,d.UN)(r)}},this.analyse=()=>{const e=this.counter%3==0,t=(e?this.items:this.items.filter((e=>"input"===e.type))).filter((e=>"audio"===e.kind)).slice(0,a.KM).map(this.getAmplitude);++this.counter>=1e3&&(this.counter=0),c.ANALYSER_LISTENER.dispatchEvent("amplitude",{amplitudes:t,type:e?"all":"input"})},this.context=new(window.AudioContext||window.webkitAudioContext),this.items=[],this.outputStream=new MediaStream,this.inputStream=new MediaStream,this.counter=0,this.log=(0,n.kg)("SM"),this.direction="sendonly",this.canCreateConferenceEntry=!0,this.types=["audio","video"]}addStream(e,t){e.getTracks().forEach((i=>{this.addTrack(e,i,t)}))}addTrack(e,t,i){this.log("addTrack",i,t,e);const{context:s,items:n,inputStream:a,outputStream:o}=this,r=t.kind,d=c.getSource(e,i);switch(i){case"input":a?a.addTrack(t):this.inputStream=e;break;case"output":for(let e=0;e{this.removeTrack(t)}),{once:!0}),this.items.push(e)}hasInputTrackKind(e){return this.items.find((t=>"input"===t.type&&t.kind===e))}static getSource(e,t){return"input"===t?e.source||e.id:""+(0,d.Fk)(+e.id.substring(6))}removeTrack(e){this.log("removeTrack",e);const{items:t}=this;let i=!1;for(let s=0,n=t.length;!i&&s[e,n])),o=t.getTracks();for(const[t,n]of a){let a=e.findEntry((e=>e.direction===i&&e.type===t));if(!a){if(!s)continue;a=e.createEntry(t)}let{transceiver:d}=a;d||(d=a.createTransceiver(e.connection,n)),a.direction!==d.direction&&(d.direction=a.direction);const l=(0,r.pl)(t),c=o.findIndex((e=>e.kind===l)),h=-1!==c?o.splice(c,1)[0]:void 0,u=d.sender;u.track!==h&&u.replaceTrack(h).catch((e=>{this.log.error(e)}))}}stop(){try{this.inputStream.getTracks().concat(this.outputStream.getTracks()).forEach((e=>{(0,o.Z)(e)}))}catch(e){this.log.error(e)}}}c.ANALYSER_LISTENER=new s.Z},630:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});class s{constructor(e="\r\n"){this.joiner=e,this.lines=[],this.newLine=[]}add(...e){return this.lines.push(...e),this}push(e){return this.newLine.push(e),this}addJoined(e=""){return this.add(this.newLine.join(e)),this.newLine=[],this}join(){return this.lines.join(this.joiner)}finalize(){return this.join()+this.joiner}}},8957:(e,t,i)=>{"use strict";function s(e){return e<<0}function n(e){return e>>>0}function a(e,t=3){if(!e)return 0;const{length:i}=e;let s=0;for(let t=0;ts,UN:()=>a,h:()=>n})},586:(e,t,i)=>{"use strict";i.d(t,{_:()=>s});const s=2147483646},3785:(e,t,i)=>{"use strict";i.d(t,{Z:()=>o});var s=i(7197),n=i(1229);const a=new RegExp(`(^${n.Z})`);function o(e,t=!1){const i=(e||"").trim().split(" ");if(!i[0])return{text:"",entities:[]};const n=[],o=i[0].match(a),r=(null==o?void 0:o[0])||i[0][0];o&&n.push((0,s.Z)(r));const d=i.length;if(t||1===d)return{text:r,entities:n};const l=i[d-1].match(a),c=(null==l?void 0:l[0])||i[d-1][0];return l&&n.push(Object.assign(Object.assign({},(0,s.Z)(c)),{offset:r.length})),{text:r+c,entities:n}}},7197:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(671);function n(e){return{_:"messageEntityEmoji",offset:0,length:e.length,unicode:(0,s.w1)(e).join("-").replace(/-?fe0f/g,"")}}},1171:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(2423);function n(e){return e?e.match(s.E):null}},2521:(e,t,i)=>{"use strict";function s(e){return e.target="_blank",e.rel="noopener noreferrer",e}i.d(t,{Z:()=>s})},5798:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(8115),n=i(3785);function a(e,t){const{text:i,entities:a}=(0,n.Z)(e,t);return(0,s.Z)(i,void 0,a)}},3066:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(3512),n=i(5400);function a(e,t={}){if(!e)return(0,n.ZP)("");let i=t.entities;return i&&!s.Z.premium&&t.wrappingForPeerId!==s.Z.myId&&(i=i.filter((e=>"messageEntityCustomEmoji"!==e._))),(0,n.ZP)(e,Object.assign(Object.assign({},t),{entities:i,noLinks:!0,wrappingDraft:!0,passEntities:{messageEntityTextUrl:!0,messageEntityMentionName:!0}}))}},8115:(e,t,i)=>{"use strict";i.d(t,{Z:()=>a});var s=i(6535),n=i(5400);function a(e,t=!1,i){return e?(null!=i||(i=(0,s.Z)(e).filter((e=>"messageEntityEmoji"===e._))),(0,n.ZP)(e,{entities:i,wrappingDraft:t})):(0,n.ZP)("")}},5400:(e,t,i)=>{"use strict";i.d(t,{LD:()=>_,KZ:()=>F,SZ:()=>G,ZP:()=>j,Cx:()=>K,Hc:()=>V});var s=i(2423),n=i(3447),a=i(9976),o=i(8479),r=i(4056),d=i(1379),l=i(6535),c=i(2521),h=i(3591);const u={};a.Z&&(u[""]=!0,[["14","🫱🏻"]].forEach((([e,t])=>{u[e]=function(e){const t=document.createElement("span");t.classList.add("emoji"),document.body.appendChild(t),t.innerText=e;const i=t.offsetWidth;t.innerText="❤️";const s=t.offsetWidth;return document.body.removeChild(t),Math.abs(i-s)<5}(t)})));const p=u;var f=i(2738),m=i(3512),g=i(4755),v=i(3541),b=i(3772),y=i(5814),w=i(2153),S=i(393),C=i(8938),L=i(319),E=i(8497),I=i(4881),M=i(3624),Z=i(5565),P=i(6854),T=i(645),k=i(4497);const x=new ResizeObserver((e=>{for(const t of e)t.target.parentElement.setDimensionsFromRect(t.contentRect)})),A=new w.Z;class _ extends HTMLElement{constructor(){super(),this.paused=!0,this.classList.add("custom-emoji")}get docId(){return this.dataset.docId}static create(e){const t=new _;return t.dataset.docId=""+e,t}get isConnected(){var e,t;return null!==(t=null===(e=this.placeholder)||void 0===e?void 0:e.isConnected)&&void 0!==t?t:super.isConnected}connectedCallback(){this.player&&y.Z.addAnimation({animation:this,group:this.renderer.animationGroup,controlled:!0})}disconnectedCallback(){var e;!this.isConnected&&(null===(e=this.renderer)||void 0===e?void 0:e.isSelectable)&&this.clear()}destroy(){this.clear()}clear(e=!0){var t;if(this.clean)return;this.clean=!0,this.pause();const{syncedPlayer:i}=this;if(i&&i.pausedElements.delete(this),null===(t=this.middlewareHelper)||void 0===t||t.clean(),this.renderer){const t=this.renderer.customEmojis.get(this.docId);(null==t?void 0:t.delete(this))&&!t.size&&(this.renderer.customEmojis.delete(this.docId),this.renderer.playersSynced.delete(t)),e&&(this.renderer.isSelectable?this.replaceChildren(G(!0)):this.replaceChildren())}this.player&&y.Z.removeAnimationByPlayer(this),A&&A.delete({div:this}),this.elements=this.renderer=this.player=this.syncedPlayer=void 0}pause(){this.paused||(this.paused=!0,this.player instanceof HTMLVideoElement&&!this.syncedPlayer&&(this.renderer.lastPausedVideo=this.player,this.player.pause()),this.syncedPlayer&&!this.syncedPlayer.pausedElements.has(this)&&(this.syncedPlayer.pausedElements.add(this),this.syncedPlayer.player&&this.syncedPlayer.pausedElements.size===this.syncedPlayer.middlewares.size&&this.syncedPlayer.player.pause()))}play(){var e,t;this.paused&&(this.paused=!1,this.player instanceof HTMLVideoElement&&(this.player.currentTime=null!==(t=null===(e=this.renderer.lastPausedVideo)||void 0===e?void 0:e.currentTime)&&void 0!==t?t:this.player.currentTime,this.player.play().catch(L.Z)),this.syncedPlayer&&this.syncedPlayer.pausedElements.has(this)&&(this.syncedPlayer.pausedElements.delete(this),this.syncedPlayer.pausedElements.size!==this.syncedPlayer.middlewares.size&&this.player.play()))}remove(){this.clear()}get autoplay(){return!0}get loop(){return!0}}class F extends HTMLElement{constructor(){super(),this.classList.add("custom-emoji-renderer"),this.canvas=document.createElement("canvas"),this.canvas.classList.add("custom-emoji-canvas"),this.context=this.canvas.getContext("2d"),this.append(this.canvas),this.playersSynced=new Map,this.clearedElements=new WeakSet,this.customEmojis=new Map,this.animationGroup="EMOJI",this.isCanvasClean=!1}connectedCallback(){B.has(this)||(x.observe(this.canvas),B.add(this),this.connectedCallback=void 0)}disconnectedCallback(){var e;!this.isConnected&&this.auto&&(null===(e=this.destroy)||void 0===e||e.call(this),this.disconnectedCallback=void 0)}destroy(){var e;x.unobserve(this.canvas),this.customEmojis.forEach((e=>{e.forEach((e=>{e.clear()}))})),B.delete(this),this.playersSynced.clear(),null===(e=this.middlewareHelper)||void 0===e||e.clean(),this.customEmojis.clear(),this.destroy=this.lastPausedVideo=void 0}getOffsets(e=new Map){if(!this.playersSynced.size)return e;const t=(0,E.Z)(this,"scrollable")||this.offsetParent;if(!t)return e;const i=t.getBoundingClientRect(),s=this.getBoundingClientRect();for(const n of this.playersSynced.keys()){const a=Array.from(n),o=this.isSelectable?a.map((e=>e.placeholder)):a,{visible:r}=(0,I.Z)({overflowElement:t,overflowRect:i,elements:o,extraSize:2.5*this.size.height}),d=r.map((({rect:e})=>({top:e.top-s.top,left:e.left-s.left,width:e.width})));d.length&&e.set(n,d)}return e}clearCanvas(){if(this.isCanvasClean)return;const{context:e,canvas:t}=this;e.clearRect(0,0,t.width,t.height),this.isCanvasClean=!0}render(e){const{context:t,canvas:i,isDimensionsSet:s}=this;s||this.setDimensionsFromRect(void 0,!1),this.isCanvasClean=!1;const{width:n,height:a,dpr:o}=i;for(const[i,s]of e){const e=this.playersSynced.get(i),a=O.get(e)||(e instanceof HTMLVideoElement?e:void 0);if(!a)continue;const r=a instanceof ImageData;let d,l;e instanceof HTMLVideoElement?(d=this.size.width*o,l=this.size.height*o):(d=a.width,l=a.height);const c=Math.round(s[0].width*o);c!==d&&(d=c,l=c);const h=n-d;this.clearedElements.has(i)||this.isSelectable||(this.isSelectable?i.forEach((e=>{var t;null!==(t=e.lastChildWas)&&void 0!==t||(e.lastChildWas=e.lastChild),(0,Z.Z)(e,e.firstChild)})):i.forEach((e=>{e.replaceChildren()})),this.clearedElements.add(i)),s.forEach((({top:e,left:i})=>{e=Math.round(e*o),(i=Math.round(i*o))<0||i>h||(r?t.putImageData(a,i,e):t.drawImage(a,i,e,d,l))}))}}checkForAnyFrame(){for(const e of this.playersSynced.values())if(O.has(e)||e instanceof HTMLVideoElement)return!0;return!1}remove(){super.remove()}setDimensionsFromRect(e=this.lastRect,t=!0){const{canvas:i}=this,{dpr:s}=i;if(this.lastRect!==e&&(this.lastRect=e),!e||!s||this.ignoreSettingDimensions)return;const{width:n,height:a}=e,o=Math.floor(Math.round(n*s)),r=Math.floor(Math.round(a*s));i.width===o&&i.height===r||(i.width=o,i.height=r,this.isDimensionsSet=!0,this.isCanvasClean=!0,(this.forceRenderAfterSize||this.isSelectable&&t)&&(this.forceRenderAfterSize=void 0,this.forceRender()))}forceRender(){this.isDimensionsSet&&(U(new Set([this]))||this.clearCanvas())}add(e,t,i,s){const n=this;if(e.forEach(((t,i)=>{let s=this.customEmojis.get(i);s?this.clearedElements.delete(s):this.customEmojis.set(i,s=new Set);for(const e of t)s.has(e)?t.delete(e):(e.clean=!1,e.renderer=n,e.elements=s,e.middlewareHelper=this.middlewareHelper.get().create(),s.add(e),e.lastChildWas&&!e.lastChildWas.parentNode&&e.append(e.lastChildWas));t.size||e.delete(i)})),!e.size)return;const a=!(t||!1===t||!A),o=Array.from(e.keys()),r=m.Z.managers,d=this.middlewareHelper.get(),l=this.size;return r.appEmojiManager.getCachedCustomEmojiDocuments(o).then((c=>{if(d&&!d())return;const h=[],u=(o,c)=>{const h=o.id,u=e.get(h),p=n.customEmojis.get(h),f=2===o.sticker,m="video/webm"===o.mime_type&&!S.Z,g=(f||3===o.sticker&&this.isSelectable)&&!i&&!m,w=[],E=Array.from(u),I=(0,v.ZP)({div:E,doc:o,width:l.width,height:l.height,loop:!0,play:D,managers:r,isCustomEmoji:!0,group:"none",loadPromises:w,middleware:d,exportLoad:a||!1===t?2:1,needFadeIn:!1,loadStickerMiddleware:g&&d?d.create().get((()=>!!Z.middlewares.size)):void 0,static:m,onlyThumb:i,withThumb:null!=s?s:!n.clearedElements.has(p)&&void 0,syncedVideo:this.isSelectable});c&&I.then((()=>c.push(...w)));const M={elements:u};if(1===o.sticker||i||m)return this.isSelectable&&(M.onRender=()=>Promise.all(w).then((()=>{d&&!d()||E.forEach((e=>{const{placeholder:t}=e;t.src=e.firstElementChild.src}))}))),I.then((e=>Object.assign(Object.assign({},e),M)));let Z;M.onRender=e=>Promise.all(w).then((()=>{var t;if(d&&!d()||!o.animated)return;const i=Array.isArray(e)?e:[e],s=Array.isArray(i)?i[0]:i;if((0,C.Z)(s),E.forEach(((e,t)=>{const s=i[t]||i[0];e.player=s,Z&&(e.syncedPlayer=Z,e.paused?e.syncedPlayer.pausedElements.add(e):s.paused&&s.play()),e.isConnected&&y.Z.addAnimation({animation:e,group:e.renderer.animationGroup,controlled:!0})})),(s instanceof b.Z||s instanceof HTMLVideoElement&&this.isSelectable)&&(Z.player=s,n.playersSynced.set(p,s)),s instanceof b.Z?(s.group=n.animationGroup,null!==(t=s.overrideRender)&&void 0!==t||(s.overrideRender=e=>{O.set(s,e)})):HTMLVideoElement,g){const e=(0,b.a)(this.size.width,this.size.height);n.canvas.dpr=e,H()}}));const P=[h,l.width,l.height].join("-");if(g){Z=N.get(P),Z||(Z={player:void 0,middlewares:new Set,pausedElements:new Set,key:P},N.set(P,Z));for(const e of u){const t=e.middlewareHelper.get();Z.middlewares.add(t),t.onClean((()=>{var i,s;if(Z.middlewares.delete(t),!Z.middlewares.size){if(Z.player){const t=O.get(Z.player);if(t&&(null===(s=(i=t).close)||void 0===s||s.call(i),O.delete(Z.player)),O.delete(Z.player),Z.player instanceof b.Z)Z.player.overrideRender=L.Z,Z.player.remove();else if(Z.player instanceof HTMLVideoElement){const t=T.Z.generateName(""+e.docId,0,0,void 0,void 0);delete v._i[t]}Z.player=void 0}N.get(Z.key)===Z&&N.delete(Z.key)&&!N.size&&z()}}))}}return I.then((e=>Object.assign(Object.assign({},e),M)))},p=[],f=c.map(((e,t)=>{if(e)return u(e,h);p.push(o[t])})).filter(Boolean),m=p.length?r.appEmojiManager.getCustomEmojiDocuments(p).then((e=>d&&!d()?[]:e.filter(Boolean).map((e=>u(e))))):Promise.resolve([]),g=e=>Promise.all(e).then((e=>{const t=e.map((({load:e,onRender:t,elements:i})=>{if(!e)return;const s=()=>e().then(t);if(!a)return s();i.forEach((e=>{A.push({div:e,load:()=>(i.forEach((e=>{A.delete({div:e})})),s())})}))}));return Promise.all(t)})),w=()=>{if(d&&!d())return;const e=g(f),t=m.then((e=>g(e)));return Promise.all([e,t])};return t?t.push({div:n.canvas,load:w}):w(),Promise.all(f).then((()=>Promise.all(h))).then((()=>{}))}))}static create(e){const t=new F;t.animationGroup=e.animationGroup,t.size=e.customEmojiSize||g.Z.active.customEmoji,t.isSelectable=e.isSelectable,e.wrappingDraft&&(t.contentEditable="false",t.style.height="inherit");let i=e.middleware;return i?(t.middlewareHelper=i.create(),i=t.middlewareHelper.get(),i.onDestroy((()=>{var e;null===(e=t.destroy)||void 0===e||e.call(t)}))):(t.auto=!0,t.middlewareHelper=(0,M.k)()),t}}const D=!0;let R;const B=new Set,N=new Map,O=new Map,U=(e=B)=>{const t=Array.from(e).filter((e=>e.isConnected&&e.checkForAnyFrame()&&!e.ignoreSettingDimensions));if(!t.length)return!1;const i=t.map((e=>{const t=[...e.playersSynced.values()].reduce(((e,t)=>e+ +!!t.paused),0);if(e.playersSynced.size===t)return;const i=e.getOffsets();return i.size?[e,i]:void 0})).filter(Boolean);for(const[e]of i)e.clearCanvas();for(const[e,t]of i)e.render(t);return!0},H=()=>{R||(R=window.setInterval(U,16.666666666666668),U())},z=()=>{R&&(clearInterval(R),R=void 0)};function j(e,t={}){var i,u,m,g,v,b,y,w;const S=document.createDocumentFragment();if(!e)return S;const C=null!==(i=t.nasty)&&void 0!==i?i:t.nasty={i:0,usedLength:0,text:e},L=(e,i)=>{const s=document.createElement("span");return t.wrappingDraft&&(s.contentEditable="false"),s.classList.add("input-something"),s.append(e),(D||S).append(s),e.classList.add("input-selectable"),!i&&e.append(G(!0)),I.add(s),s};t.isSelectable||(t.isSelectable=t.wrappingDraft);const E=null!==(u=t.customEmojis)&&void 0!==u?u:t.customEmojis=new Map,I=null!==(m=t.customWraps)&&void 0!==m?m:t.customWraps=new Set,M=null!==(g=t.entities)&&void 0!==g?g:t.entities=(0,l.Z)(C.text),Z=null!==(v=t.passEntities)&&void 0!==v?v:t.passEntities={},P=null!==(b=t.contextSite)&&void 0!==b?b:t.contextSite="Telegram",T="Telegram"!==P,x=C.text.length,A=M.length;let D;for(;C.i=x){if("messageEntityCaret"!==e._)continue}else e.offset+e.length>x&&(e=(0,o.Z)(e),e.length=x-e.offset);e.length&&(C.lastEntity=e);let i=M[C.i+1];const l=e.offset,u=l+e.length,m=Math.min(u,null!==(y=null==i?void 0:i.offset)&&void 0!==y?y:65535),g=C.text.slice(l,u);let v=C.text.slice(l,m);C.usedLengtht.maxMediaTimestamp)break;b=document.createElement("a"),b.classList.add("timestamp"),b.dataset.timestamp=""+e.time,b.href="#",b.setAttribute("onclick","setMediaTimestamp(this)")}for(!I&&v&&(b?b[w]=v:(b||S).append(v)),b&&!b.parentNode&&(D||S).append(b);i&&i.offsetv.length&&b?b:S,t.voodoo)return S}var R;if(C.lastEntity&&(C.usedLength=C.lastEntity.offset+C.lastEntity.length),C.usedLength{const t=document.createElement("span");return t.classList.add(e?"input-filler2":"input-filler"),t.textContent=P.Z,t};function V(e){var t;if((null==e?void 0:e.textContent)!==P.Z||"false"===(null===(t=null==e?void 0:e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable"))){if(!e||e.textContent!==P.Z||e.firstElementChild)return 2;if(e.nodeType===e.ELEMENT_NODE)return 1}return 0}function K(e){const t=(e,t,i)=>{const s=V(t);2===s?e[i](G()):1===s&&t.appendChild(document.createTextNode(P.Z))};for(const i of e){const{previousSibling:e,nextSibling:s}=i;t(i,e,"before"),t(i,s,"after")}}window.wrapRichText=j},4497:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var s=i(3591);function n(e){const{url:t,onclick:i}=(0,s.Z)(e),n=document.createElement("a");return n.href=t,i&&n.setAttribute("onclick",`${i}(this)`),n}},1447:(e,t,i)=>{"use strict";i.d(t,{Z:()=>v});var s=i(5814),n=i(410),a=i(5418),o=i(5003),r=i(3772),d=i(7328),l=i(3241);class c extends l.Z{constructor(e){super(),this.worker=e,this.worker.onerror=e=>{try{this.dispatchEvent("workerError",e),this.cleanup(),this.terminate()}catch(e){}},this.worker.onmessage=e=>{this.dispatchEvent(e.data.queryMethodListener,...e.data.queryMethodArguments)}}postMessage(e){this.worker.postMessage(e)}terminate(){this.worker.terminate()}sendQuery(e,t){this.worker.postMessage({queryMethod:e.shift(),queryMethodArguments:e},d.Z?t:void 0)}}var h=i(8975),u=i(3855);const p="undefined"!=typeof WebAssembly;var f=i(5471),m=i(4159);const g=new class{constructor(){this.loadPromise=p?void 0:Promise.reject(),this.loaded=!1,this.workersLimit=m.Z.threads,this.players={},this.playersByCacheName={},this.workers=[],this.curWorkerNum=0,this.log=(0,o.kg)("LOTTIE",o.v9.Error),this.onPlayerLoaded=(e,t,i)=>{const s=this.players[e];s?(this.log.debug("onPlayerLoaded"),s.onLoad(t,i)):this.log.warn("onPlayerLoaded on destroyed player:",e,t)},this.onFrame=(e,t,i)=>{const s=this.players[e];s?(void 0!==s.clamped&&i instanceof Uint8ClampedArray&&(s.clamped=i),s.renderFrame(i,t)):this.log.warn("onFrame on destroyed player:",e,t)},this.onPlayerError=(e,t)=>{const i=this.players[e];i&&s.Z.getAnimations(i.el[0]).forEach((e=>{s.Z.removeAnimation(e)}))}}getAnimation(e){for(const t in this.players)if(this.players[t].el.includes(e))return this.players[t];return null}loadLottieWorkers(){return this.loadPromise?this.loadPromise:this.loadPromise=new Promise(((e,t)=>{let s=this.workersLimit;for(let n=0;n{this.log("worker #"+n+" ready"),o.addEventListener("frame",this.onFrame),o.addEventListener("loaded",this.onPlayerLoaded),o.addEventListener("error",this.onPlayerError),--s,s||(this.log("workers ready"),e(),this.loaded=!0)}),{once:!0}),o.addEventListener("workerError",(e=>{t("rlottie load error: "+e.message),this.loaded=!1}),{once:!0})}}))}makeAssetUrl(e){return"assets/tgs/"+e+".json"}loadAnimationAsAsset(e,t){return this.loadAnimationFromURL(e,this.makeAssetUrl(t))}loadAnimationDataFromURL(e){return p?(this.loadLottieWorkers(),fetch(e).then((e=>e.headers&&"application/octet-stream"!==e.headers.get("content-type")?e.blob():e.arrayBuffer().then((e=>u.Z.invokeCrypto("gzipUncompress",e))).then((e=>(0,h.Z)(e,"")))))):this.loadPromise}loadAnimationFromURLManually(e){const t=this.makeAssetUrl(e);return this.loadAnimationDataFromURL(t).then((e=>i=>this.loadAnimationFromURLNext(e,i,t)))}loadAnimationFromURL(e,t){return this.loadAnimationDataFromURL(t).then((i=>this.loadAnimationFromURLNext(i,e,t)))}loadAnimationFromURLNext(e,t,i){const s=Object.assign(t,{animationData:e,needUpscale:!0});return s.name||(s.name=i),this.loadAnimationWorker(s)}waitForFirstFrame(e){return Promise.race([new Promise((t=>{e.addEventListener("firstFrame",t,{once:!0})})),(0,a.Z)(2500)]).then((()=>e))}loadAnimationWorker(e){return t=this,i=void 0,a=function*(){if(!p)return this.loadPromise;this.loaded||(yield this.loadLottieWorkers());const{middleware:t,group:i=""}=e;if(t&&!t())throw(0,f.Z)("MIDDLEWARE");if(e.sync){const t=r.Z.CACHE.generateName(e.name,e.width,e.height,e.color,e.toneIndex),i=this.playersByCacheName[t];if(null==i?void 0:i.size)return Promise.resolve(i.entries().next().value[0])}const n=Array.isArray(e.container)?e.container:[e.container];if(e.width&&e.height||(e.width=parseInt(n[0].style.width),e.height=parseInt(n[0].style.height)),!e.width||!e.height)throw new Error("No size for sticker!");e.group=i;const a=this.initPlayer(n,e);return s.Z.addAnimation({animation:a,group:i,controlled:t,liteModeKey:e.liteModeKey}),a},new((n=void 0)||(n=Promise))((function(e,s){function o(e){try{d(a.next(e))}catch(e){s(e)}}function r(e){try{d(a.throw(e))}catch(e){s(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(t,i||[])).next())}));var t,i,n,a}onDestroy(e){delete this.players[e]}destroyWorkers(){p&&(this.workers.forEach(((e,t)=>{e.terminate(),this.log("worker #"+t+" terminated")})),this.log("workers destroyed"),this.workers.length=0,this.curWorkerNum=0,this.loaded=!1,this.loadPromise=void 0)}initPlayer(e,t){var i,s;const n=new r.Z({el:e,worker:this.workers[this.curWorkerNum++],options:t}),{reqId:a,cacheName:o}=n;this.players[a]=n;const d=o?null!==(i=(s=this.playersByCacheName)[o])&&void 0!==i?i:s[o]=new Set:void 0;return o&&d.add(n),this.curWorkerNum>=this.workers.length&&(this.curWorkerNum=0),n.addEventListener("destroy",(()=>{this.onDestroy(a),d.delete(n)&&!d.size&&delete this.playersByCacheName[o]})),n.loadFromData(t.animationData),n}};n.GO.lottieLoader=g;const v=g},3772:(e,t,i)=>{"use strict";i.d(t,{Z:()=>u,a:()=>h});var s=i(7328),n=i(8189),a=i(4762),o=i(3241),r=i(4755),d=i(3228),l=i(356),c=i(645);function h(e,t,i){let s=(0,d.Z)(window.devicePixelRatio,1,2);return s>1&&!i&&(e>90&&t>90?!a.IS_APPLE&&r.Z.isMobile&&(s=1):(e>60&&t>60||a.IS_ANDROID)&&(s=Math.max(1.5,s-1.5))),s}class u extends o.Z{constructor({el:e,worker:t,options:i}){super(!0),this.reqId=0,this.width=0,this.height=0,this.paused=!0,this.direction=1,this.speed=1,this.autoplay=!0,this.loop=!0,this.group="",this.cachingDelta=0,this.playedTimes=0,this.reqId=++u.reqId,this.el=e,this.worker=t;for(const e in i)this.hasOwnProperty(e)&&(this[e]=i[e]);let o;this._loop=this.loop,this._autoplay=this.autoplay,this.initFrame=i.initFrame,this.color=i.color,this.inverseColor=i.inverseColor,this.name=i.name,this.skipFirstFrameRendering=i.skipFirstFrameRendering,this.toneIndex=i.toneIndex,this.raw=void 0!==this.color,this.liteModeKey=i.liteModeKey,this.name&&(this.cacheName=u.CACHE.generateName(this.name,this.width,this.height,this.color,this.toneIndex)),void 0!==i.skipRatio?o=i.skipRatio:(a.IS_ANDROID||a.IS_APPLE_MOBILE||a.IS_APPLE&&!a.IS_SAFARI&&!n.Z)&&this.width<100&&this.height<100&&!i.needUpscale&&(o=.5),this.skipDelta=void 0!==o?1/o|0:1;const r=h(this.width,this.height,i.needUpscale);this.width=Math.round(this.width*r),this.height=Math.round(this.height*r),i.noCache||(a.IS_APPLE&&this.width>100&&this.height>100?this.cachingDelta=2:this.width<100&&this.height<100?this.cachingDelta=1/0:this.cachingDelta=4),this.canvas||(this.canvas=this.el.map((()=>{const e=document.createElement("canvas");return e.classList.add("rlottie"),e.width=this.width,e.height=this.height,e.dpr=r,e}))),this.contexts=this.canvas.map((e=>e.getContext("2d"))),l.Z&&!this.raw||(this.imageData=new ImageData(this.width,this.height),s.Z&&(this.clamped=new Uint8ClampedArray(this.width*this.height*4))),this.name?this.cache=u.CACHE.getCache(this.cacheName):this.cache=c.M.createCache()}clearCache(){this.cachingDelta!==1/0&&(this.cacheName&&this.cache.counter>1||this.cache.clearCache())}sendQuery(e,t){this.worker.sendQuery([e.shift(),this.reqId,...e],t)}loadFromData(e){this.sendQuery(["loadFromData",e,this.width,this.height,this.toneIndex,void 0!==this.color])}play(){this.paused&&(this.paused=!1,this.setMainLoop())}pause(e=!0){this.paused||(this.paused=!0,e&&(clearTimeout(this.rafId),this.rafId=void 0))}resetCurrentFrame(){var e;return this.curFrame=null!==(e=this.initFrame)&&void 0!==e?e:1===this.direction?this.minFrame:this.maxFrame}stop(e=!0){this.pause();const t=this.resetCurrentFrame();e&&this.requestFrame(t)}restart(){this.stop(!1),this.play()}playOrRestart(){this.paused&&(this.curFrame===this.maxFrame?this.restart():this.play())}setSpeed(e){this.speed!==e&&(this.speed=e,this.paused||this.setMainLoop())}setDirection(e){this.direction!==e&&(this.direction=e,this.paused||this.setMainLoop())}remove(){this.pause(),this.sendQuery(["destroy"]),this.cacheName&&u.CACHE.releaseCache(this.cacheName),this.dispatchEvent("destroy"),this.cleanup()}applyColor(e){const[t,i,s]=this.color;for(let n=0,a=e.length;n{let n=this.cache.framesNew.get(t);if(e instanceof Uint8ClampedArray?s>0&&(n=this.canvas[0]):n=e,!n){const e=document.createElement("canvas");e.width=i.canvas.width,e.height=i.canvas.height,e.getContext("2d").putImageData(this.imageData,0,0),this.cache.framesNew.set(t,e),n=e}this.overrideRender&&this.renderedFirstFrame?this.overrideRender(n||this.imageData):n?(i.clearRect(0,0,n.width,n.height),i.drawImage(n,0,0)):i.putImageData(this.imageData,0,0),this.renderedFirstFrame||(this.renderedFirstFrame=!0)})),this.dispatchEvent("enterFrame",t)}catch(e){console.error("RLottiePlayer renderFrame error:",e,this.width,this.height),this.autoplay=!1,this.pause()}}renderFrame(e,t){if(this.cachingDelta&&(t%this.cachingDelta||!t)&&(e instanceof Uint8ClampedArray&&!this.cache.frames.has(t)?this.cache.frames.set(t,new Uint8ClampedArray(e)):l.Z&&e instanceof ImageBitmap&&!this.cache.framesNew.has(t)&&this.cache.framesNew.set(t,e)),this.frInterval){const i=Date.now()-this.frThen;if(i<0){const s=this.frInterval>-i?-i%this.frInterval:this.frInterval;return this.rafId&&clearTimeout(this.rafId),void(this.rafId=window.setTimeout((()=>{this.renderFrame2(e,t)}),s))}}this.renderFrame2(e,t)}requestFrame(e){const t=this.cache.frames.get(e),i=this.cache.framesNew.get(e);i?this.renderFrame(i,e):t?this.renderFrame(t,e):(this.clamped&&!this.clamped.length&&(this.clamped=new Uint8ClampedArray(this.width*this.height*4)),this.sendQuery(["renderFrame",e],this.clamped?[this.clamped.buffer]:void 0))}onLap(){return++this.playedTimes===this.loop&&(this.loop=!1),!!this.loop||(this.pause(!1),!1)}mainLoopForwards(){const{skipDelta:e,maxFrame:t}=this,i=this.curFrame+e>t?this.curFrame=this.loop?this.minFrame:this.maxFrame:this.curFrame+=e;return this.requestFrame(i),!(i+e>t)||this.onLap()}mainLoopBackwards(){const{skipDelta:e,minFrame:t}=this,i=this.curFrame-et?1:-1,callback:s})}playToFrame(e){this.pause();const{frame:t,speed:i,callback:s,direction:n}=e;this.setDirection(void 0===n?this.curFrame>t?-1:1:n),void 0!==i&&this.setSpeed(i);const a=[this.curFrame,t];-1===this.direction&&a.reverse(),this.loop=!1,this.setMinMax(a[0],a[1]),this.playToFrameOnFrameCallback&&this.removeEventListener("enterFrame",this.playToFrameOnFrameCallback),s&&(this.playToFrameOnFrameCallback=e=>{e===t&&(this.removeEventListener("enterFrame",this.playToFrameOnFrameCallback),s())},this.addEventListener("enterFrame",this.playToFrameOnFrameCallback)),this.play()}setColor(e,t){this.color=e,t&&this.paused&&this.renderFrame2(this.imageData.data,this.curFrame)}setInverseColor(e){this.inverseColor=e}setMinMax(e=0,t=this.frameCount-1){this.minFrame=e,this.maxFrame=t}onLoad(e,t){return i=this,s=void 0,a=function*(){this.frameCount=e,this.fps=t,this.setMinMax(),void 0!==this.initFrame&&(this.initFrame=(0,d.Z)(this.initFrame,this.minFrame,this.maxFrame));const i=this.resetCurrentFrame();if(this.fps<60&&1!==this.skipDelta){const e=60/t;this.skipDelta=this.skipDelta/e|0}this.frInterval=1e3/this.fps/this.speed*this.skipDelta,this.frThen=Date.now()-this.frInterval,!this.skipFirstFrameRendering&&this.requestFrame(i),this.dispatchEvent("ready"),this.addEventListener("enterFrame",(()=>{this.dispatchEvent("firstFrame"),this.canvas[0].parentNode||!this.el||this.overrideRender||this.el.forEach(((e,t)=>e.append(this.canvas[t]))),this.frameListener=()=>{if(this.paused||!this.currentMethod)return;const e=Date.now();this.frThen=e+this.frInterval,this.currentMethod()||this.loop||!this.autoplay||(this.autoplay=!1)},this.addEventListener("enterFrame",this.frameListener),"none"===this.group&&this.autoplay&&this.play()}),{once:!0})},new((n=void 0)||(n=Promise))((function(e,t){function o(e){try{d(a.next(e))}catch(e){t(e)}}function r(e){try{d(a.throw(e))}catch(e){t(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,r)}d((a=a.apply(i,s||[])).next())}));var i,s,n,a}}u.CACHE=c.Z,u.reqId=0},4874:(e,t,i)=>{"use strict";i.d(t,{Z:()=>c});var s=i(1447),n=i(6008),a=i(410),o=i(4789),r=i(2648);const d=new class{constructor(){this.pageId=-1,this.pagesDiv=document.getElementById("auth-pages"),this.scrollableDiv=this.pagesDiv.querySelector(".scrollable"),this.selectTab=(0,n.X)(null,this.scrollableDiv.querySelector(".tabs-container"),null,(()=>{var e;(null===(e=this.page)||void 0===e?void 0:e.onShown)&&this.page.onShown()}))}setPage(e){if(e.isAuthPage){this.pagesDiv.style.display="";const t=(0,r.Z)(e.pageEl);if(this.pageId===t)return;this.selectTab(t),-1!==this.pageId&&t>1&&s.Z.loadLottieWorkers(),this.pageId=t,this.scrollableDiv&&(0,o.Z)({container:this.scrollableDiv,element:this.scrollableDiv.firstElementChild,position:"start"})}else this.pagesDiv.style.display="none",e.pageEl.style.display="",this.pageId=-1;this.page=e}};a.GO.pagesManager=d;const l=d;class c{constructor(e,t,i,s,n){this.isAuthPage=t,this.onFirstMount=i,this.onMount=s,this.onShown=n,this.installed=!1,this.pageEl=document.body.querySelector("."+e)}mount(...e){return t=this,i=void 0,n=function*(){if(this.onMount){const t=this.onMount(...e);t instanceof Promise&&(yield t)}if(!this.installed){if(this.onFirstMount)try{const t=this.onFirstMount(...e);t instanceof Promise&&(yield t)}catch(e){console.error("PAGE MOUNT ERROR:",e)}this.installed=!0}l.setPage(this)},new((s=void 0)||(s=Promise))((function(e,a){function o(e){try{d(n.next(e))}catch(e){a(e)}}function r(e){try{d(n.throw(e))}catch(e){a(e)}}function d(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(o,r)}d((n=n.apply(t,i||[])).next())}));var t,i,s,n}}},671:(e,t,i)=>{"use strict";function s(e){return r(o(e)).join("-")}i.d(t,{Ml:()=>c,N0:()=>s,tB:()=>d,w1:()=>r,zu:()=>h});const n=/\uFE0F/g,a=String.fromCharCode(8205),o=e=>e.indexOf(a)<0?e.replace(n,""):e;function r(e){const t=[];let i=0,s=0,n=0;for(;n55296&&i<=56319?s=i:t.push(i.toString(16));return t.length&&2===t[0].length&&(t[0]="00"+t[0]),t}function d(e){const t=e.match(/[\uDFFB-\uDFFF]/);return t?5-(57343-t[0].charCodeAt(0)):0}const l=new Map([["FT","🏴‍☠"]]);function c(e){var t;return null!==(t=l.get(e))&&void 0!==t?t:String.fromCharCode(55356,56741+e.charCodeAt(0),55356,56741+e.charCodeAt(1))}function h(e){return e.split("-").reduce(((e,t)=>e+String.fromCodePoint(parseInt(t,16))),"")}},4329:function(e){"undefined"!=typeof self&&self,e.exports=function(e){var t={};function i(s){if(t[s])return t[s].exports;var n=t[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,s){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(s,n,function(t){return e[t]}.bind(null,n));return s},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){"use strict";(function(t){var i=t.AudioContext||t.webkitAudioContext,s=function(e){if(!s.isRecordingSupported())throw new Error("Recording is not supported in this browser");e||(e={}),this.state="inactive",this.config=Object.assign({bufferLength:4096,encoderApplication:2049,encoderFrameSize:20,encoderPath:"encoderWorker.min.js",encoderSampleRate:48e3,maxFramesPerPage:40,mediaTrackConstraints:!0,monitorGain:0,numberOfChannels:1,recordingGain:1,resampleQuality:3,streamPages:!1,reuseWorker:!1,wavBitDepth:16},e),this.encodedSamplePosition=0};s.isRecordingSupported=function(){return i&&t.navigator&&t.navigator.mediaDevices&&t.navigator.mediaDevices.getUserMedia&&t.WebAssembly},s.prototype.clearStream=function(){this.stream&&(this.stream.getTracks?this.stream.getTracks().forEach((function(e){e.stop()})):this.stream.stop(),delete this.stream),this.audioContext&&this.closeAudioContext&&(this.audioContext.close(),delete this.audioContext)},s.prototype.encodeBuffers=function(e){if("recording"===this.state){for(var t=[],i=0;i{this.encodeBuffers(e.inputBuffer)},this.monitorGainNode=this.audioContext.createGain(),this.setMonitorGain(this.config.monitorGain),this.monitorGainNode.connect(this.audioContext.destination),this.recordingGainNode=this.audioContext.createGain(),this.setRecordingGain(this.config.recordingGain),this.recordingGainNode.connect(this.scriptProcessorNode)},s.prototype.initSourceNode=function(e){return e&&e.context?t.Promise.resolve(e):t.navigator.mediaDevices.getUserMedia({audio:this.config.mediaTrackConstraints}).then((e=>(this.stream=e,this.audioContext.createMediaStreamSource(e))))},s.prototype.loadWorker=function(){this.encoder||(this.encoder=new t.Worker(this.config.encoderPath))},s.prototype.initWorker=function(){var e=(this.config.streamPages?this.streamPage:this.storePage).bind(this);return this.recordedPages=[],this.totalLength=0,this.loadWorker(),new Promise(((t,i)=>{var s=i=>{switch(i.data.message){case"ready":t();break;case"page":this.encodedSamplePosition=i.data.samplePosition,e(i.data.page);break;case"done":this.encoder.removeEventListener("message",s),this.finish()}};this.encoder.addEventListener("message",s),this.encoder.postMessage(Object.assign({command:"init",originalSampleRate:this.audioContext.sampleRate,wavSampleRate:this.audioContext.sampleRate},this.config))}))},s.prototype.pause=function(e){if("recording"===this.state){if(this.state="paused",e&&this.config.streamPages){var t=this.encoder;return new Promise(((e,i)=>{var s=i=>{"flushed"===i.data.message&&(t.removeEventListener("message",s),this.onpause(),e())};t.addEventListener("message",s),t.postMessage({command:"flush"})}))}return this.onpause(),Promise.resolve()}},s.prototype.resume=function(){"paused"===this.state&&(this.state="recording",this.onresume())},s.prototype.setRecordingGain=function(e){this.config.recordingGain=e,this.recordingGainNode&&this.audioContext&&this.recordingGainNode.gain.setTargetAtTime(e,this.audioContext.currentTime,.01)},s.prototype.setMonitorGain=function(e){this.config.monitorGain=e,this.monitorGainNode&&this.audioContext&&this.monitorGainNode.gain.setTargetAtTime(e,this.audioContext.currentTime,.01)},s.prototype.start=function(e){if("inactive"===this.state)return this.initAudioContext(e),this.initAudioGraph(),this.encodedSamplePosition=0,this.initWorker().then((()=>this.initSourceNode(e))).then((e=>{this.sourceNode=e,this.state="recording",this.onstart(),this.encoder.postMessage({command:"getHeaderPages"}),this.sourceNode.connect(this.monitorGainNode),this.sourceNode.connect(this.recordingGainNode)}))},s.prototype.stop=function(){if("inactive"!==this.state){this.state="inactive",this.monitorGainNode.disconnect(),this.scriptProcessorNode.disconnect(),this.recordingGainNode.disconnect(),this.sourceNode.disconnect(),this.clearStream();var e=this.encoder;return new Promise((t=>{var i=s=>{"done"===s.data.message&&(e.removeEventListener("message",i),t())};e.addEventListener("message",i),e.postMessage({command:"done"}),this.config.reuseWorker||e.postMessage({command:"close"})}))}return Promise.resolve()},s.prototype.destroyWorker=function(){"inactive"===this.state&&this.encoder&&(this.encoder.postMessage({command:"close"}),delete this.encoder)},s.prototype.storePage=function(e){this.recordedPages.push(e),this.totalLength+=e.length},s.prototype.streamPage=function(e){this.ondataavailable(e)},s.prototype.finish=function(){if(!this.config.streamPages){var e=new Uint8Array(this.totalLength);this.recordedPages.reduce((function(t,i){return e.set(i,t),t+i.length}),0),this.ondataavailable(e)}this.onstop(),this.config.reuseWorker||delete this.encoder},s.prototype.ondataavailable=function(){},s.prototype.onpause=function(){},s.prototype.onresume=function(){},s.prototype.onstart=function(){},s.prototype.onstop=function(){},e.exports=s}).call(this,i(1))},function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i}])},6802:e=>{var t=.1,i="function"==typeof Float32Array;function s(e,t){return 1-3*t+3*e}function n(e,t){return 3*t-6*e}function a(e){return 3*e}function o(e,t,i){return((s(t,i)*e+n(t,i))*e+a(t))*e}function r(e,t,i){return 3*s(t,i)*e*e+2*n(t,i)*e+a(t)}function d(e){return e}e.exports=function(e,s,n,a){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===s&&n===a)return d;for(var l=i?new Float32Array(11):new Array(11),c=0;c<11;++c)l[c]=o(c*t,e,n);return function(i){return 0===i||1===i?i:o(function(i){for(var s=0,a=1;10!==a&&l[a]<=i;++a)s+=t;--a;var d=s+(i-l[a])/(l[a+1]-l[a])*t,c=r(d,e,n);return c>=.001?function(e,t,i,s){for(var n=0;n<4;++n){var a=r(t,i,s);if(0===a)return t;t-=(o(t,i,s)-e)/a}return t}(i,d,e,n):0===c?d:function(e,t,i,s,n){var a,r,d=0;do{(a=o(r=t+(i-t)/2,s,n)-e)>0?i=r:t=r}while(Math.abs(a)>1e-7&&++d<10);return r}(i,s,s+t,e,n)}(i),s,a)}}}}]); -//# sourceMappingURL=742.4a4829b5ed21258b69e6.chunk.js.map \ No newline at end of file diff --git a/public/742.4a4829b5ed21258b69e6.chunk.js.map b/public/742.4a4829b5ed21258b69e6.chunk.js.map deleted file mode 100644 index b3f9ebd1..00000000 --- a/public/742.4a4829b5ed21258b69e6.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"742.4a4829b5ed21258b69e6.chunk.js","mappings":"6NAoXA,MAAMA,EAAuB,IA1UtB,MAaLC,cACEC,KAAKC,SAAW,IAAIC,sBAAsBC,IAGxC,IAAI,MAAMC,KAASD,EAAS,CAC1B,MAAME,EAASD,EAAMC,OA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IC,aAvD1B,IAuD2D,IAAI/5P,MAvD/D,IAwDZoP,EAAI,EAAGA,EAxDK,KAwDmBA,EACtCyrP,EAAazrP,GAAKirP,EAAWjrP,EAAIyqP,EAAiBY,EAAKE,GA2BzD,OAAO,SAAuBl3P,GAE5B,OAAU,IAANA,GAAiB,IAANA,EACNA,EAEF42P,EA7BT,SAAmBS,GAKjB,IAJA,IAAIC,EAAgB,EAChBC,EAAgB,EACHC,KAEVD,GAAgCH,EAAaG,IAAkBF,IAAME,EAC1ED,GAAiBlB,IAEjBmB,EAGF,IACIE,EAAYH,GADJD,EAAKD,EAAaG,KAAmBH,EAAaG,EAAgB,GAAKH,EAAaG,IACzDnB,EAEnCsB,EAAeZ,EAASW,EAAWT,EAAKE,GAC5C,OAAIQ,GA/Ee,KAiCvB,SAA+BL,EAAIM,EAASX,EAAKE,GAChD,IAAK,IAAIvrP,EAAI,EAAGA,EAnCO,IAmCkBA,EAAG,CAC1C,IAAIisP,EAAed,EAASa,EAASX,EAAKE,GAC1C,GAAqB,IAAjBU,EACF,OAAOD,EAGTA,IADef,EAAWe,EAASX,EAAKE,GAAOG,GACzBO,CACxB,CACA,OAAOD,CACR,CAqCaE,CAAqBR,EAAII,EAAWT,EAAKE,GACtB,IAAjBQ,EACFD,EA/Db,SAA0BJ,EAAIS,EAAIC,EAAIf,EAAKE,GACzC,IAAIc,EAAUC,EAAUtsP,EAAI,EAC5B,IAEEqsP,EAAWpB,EADXqB,EAAWH,GAAMC,EAAKD,GAAM,EACId,EAAKE,GAAOG,GAC7B,EACbU,EAAKE,EAELH,EAAKG,QAEAxuQ,KAAKsY,IAAIi2P,GA5BQ,QA4B+BrsP,EA3B1B,IA4B/B,OAAOssP,CACT,CAqDaC,CAAgBb,EAAIC,EAAeA,EAAgBlB,EAAiBY,EAAKE,EAEpF,CAOoBiB,CAASn4P,GAAIi3P,EAAKE,EACtC,CACF,C","sources":["webpack://tweb/./src/components/animationIntersector.ts","webpack://tweb/./src/components/appMediaPlaybackController.ts","webpack://tweb/./src/components/appMediaViewer.ts","webpack://tweb/./src/lib/mediaPlayer.ts","webpack://tweb/./src/helpers/number/isBetween.ts","webpack://tweb/./src/components/appMediaViewerBase.ts","webpack://tweb/./src/helpers/fillPropertyValue.ts","webpack://tweb/./src/components/appNavigationController.ts","webpack://tweb/./src/components/appSearch.ts","webpack://tweb/./src/components/appSearchSuper..ts","webpack://tweb/./src/helpers/dom/lockTouchScroll.ts","webpack://tweb/./src/components/appSelectPeers.ts","webpack://tweb/./src/components/audio.ts","webpack://tweb/./src/helpers/avatarListLoader.ts","webpack://tweb/./src/components/appMediaViewerAvatar.ts","webpack://tweb/./src/components/avatar.ts","webpack://tweb/./src/components/avatarEdit.ts","webpack://tweb/./src/components/button.ts","webpack://tweb/./src/components/buttonCorner.ts","webpack://tweb/./src/components/buttonIcon.ts","webpack://tweb/./src/components/buttonMenu.ts","webpack://tweb/./src/components/buttonMenuToggle.ts","webpack://tweb/./src/components/chat/bubbleGroups.ts","webpack://tweb/./src/components/chat/replies.ts","webpack://tweb/./src/components/chat/messageRender.ts","webpack://tweb/./src/helpers/dom/superIntersectionObserver.ts","webpack://tweb/./src/lib/appManagers/utils/messages/isMentionUnread.ts","webpack://tweb/./src/components/wrappers/album.ts","webpack://tweb/./src/lib/appManagers/utils/messages/getMediaDurationFromMessage.ts","webpack://tweb/./src/components/sidebarRight/tabs/pollResults.ts","webpack://tweb/./src/components/poll.ts","webpack://tweb/./src/helpers/string/isRTL.ts","webpack://tweb/./src/components/chat/bubbles.ts","webpack://tweb/./src/helpers/dom/copyFromElement.ts","webpack://tweb/./src/components/wrappers/groupedDocuments.ts","webpack://tweb/./src/components/wrappers/poll.ts","webpack://tweb/./src/components/popups/reportMessagesConfirm.ts","webpack://tweb/./src/components/popups/reportMessages.ts","webpack://tweb/./src/components/popups/sponsored.ts","webpack://tweb/./src/components/popups/reactedList.ts","webpack://tweb/./src/components/chat/reactionsMenu.ts","webpack://tweb/./src/components/chat/contextMenu.ts","webpack://tweb/./src/components/chat/gradientRenderer.ts","webpack://tweb/./src/helpers/easing/easeOutQuad.ts","webpack://tweb/./src/components/popups/createPoll.ts","webpack://tweb/./src/helpers/dom/attachListNavigation.ts","webpack://tweb/./src/components/chat/autocompleteHelper.ts","webpack://tweb/./src/components/chat/stickersHelper.ts","webpack://tweb/./src/components/popups/schedule.ts","webpack://tweb/./src/components/chat/emojiHelper.ts","webpack://tweb/./src/components/chat/autocompletePeerHelper.ts","webpack://tweb/./src/components/chat/commandsHelper.ts","webpack://tweb/./src/components/chat/autocompleteHelperController.ts","webpack://tweb/./src/components/chat/mentionsHelper.ts","webpack://tweb/./src/components/chat/replyKeyboard.ts","webpack://tweb/./src/components/chat/inlineHelper.ts","webpack://tweb/./src/components/chat/botCommands.ts","webpack://tweb/./src/helpers/modifyAckedResult.ts","webpack://tweb/./src/components/chat/sendAs.ts","webpack://tweb/./src/components/chat/input.ts","webpack://tweb/./src/components/wrappers/draft.ts","webpack://tweb/./src/components/chat/reaction.ts","webpack://tweb/./src/components/chat/reactions.ts","webpack://tweb/./src/components/chat/replyContainer.ts","webpack://tweb/./src/components/chat/selection.ts","webpack://tweb/./src/helpers/dom/getSelectedText.ts","webpack://tweb/./src/components/chat/sendContextMenu.ts","webpack://tweb/./src/components/checkboxField.ts","webpack://tweb/./src/components/checkboxFields.ts","webpack://tweb/./src/components/codeInputField.ts","webpack://tweb/./src/components/confirmationPopup.ts","webpack://tweb/./src/components/countryInputField.ts","webpack://tweb/./src/components/divAndCaption.ts","webpack://tweb/./src/components/dotRenderer.ts","webpack://tweb/./src/components/editPeer.ts","webpack://tweb/./src/components/emoticonsDropdown/tabs/gifs.ts","webpack://tweb/./src/components/sidebarRight/tabs/gifs.ts","webpack://tweb/./src/components/sidebarRight/tabs/stickers.ts","webpack://tweb/./src/components/emoticonsDropdown/index.ts","webpack://tweb/./src/components/emoticonsDropdown/tabs/emoji.ts","webpack://tweb/./src/lib/richTextProcessor/wrapSingleEmoji.ts","webpack://tweb/./src/components/lazyLoadQueueRepeat.ts","webpack://tweb/./src/components/emoticonsDropdown/tabs/stickers.ts","webpack://tweb/./src/components/generateDelimiter.ts","webpack://tweb/./src/components/generateFakeIcon.ts","webpack://tweb/./src/components/lazyLoadQueueRepeat2.ts","webpack://tweb/./src/components/gifsMasonry.ts","webpack://tweb/./src/components/horizontalMenu.ts","webpack://tweb/./src/components/inputField.ts","webpack://tweb/./src/helpers/dom/selectElementContents.ts","webpack://tweb/./src/components/inputFieldAnimated.ts","webpack://tweb/./src/components/inputSearch.ts","webpack://tweb/./src/components/lazyLoadQueue.ts","webpack://tweb/./src/components/lazyLoadQueueIntersector.ts","webpack://tweb/./src/components/mediaProgressLine.ts","webpack://tweb/./src/components/middleEllipsis.ts","webpack://tweb/./src/components/monkeys/password.ts","webpack://tweb/./src/components/monkeys/tracking.ts","webpack://tweb/./src/components/passwordInputField.ts","webpack://tweb/./src/components/peerProfileAvatars.ts","webpack://tweb/./src/components/peerProfile.ts","webpack://tweb/./src/components/generateTitleIcons.ts","webpack://tweb/./src/components/generateVerifiedIcon.ts","webpack://tweb/./src/components/generatePremiumIcon.ts","webpack://tweb/./src/components/peerTitle.ts","webpack://tweb/./src/components/popups/avatar.ts","webpack://tweb/./src/lib/cropper.ts","webpack://tweb/./src/components/popups/datePicker.ts","webpack://tweb/./src/components/popups/deleteDialog.ts","webpack://tweb/./src/components/popups/deleteMessages.ts","webpack://tweb/./src/components/popups/forward.ts","webpack://tweb/./src/components/popups/index.ts","webpack://tweb/./src/components/popups/joinChatInvite.ts","webpack://tweb/./src/components/popups/limit.ts","webpack://tweb/./src/components/popups/mute.ts","webpack://tweb/./src/helpers/createPoster.ts","webpack://tweb/./src/helpers/getGifDuration.ts","webpack://tweb/./src/environment/audioMimeTypeSupport.ts","webpack://tweb/./src/components/popups/newMedia.ts","webpack://tweb/./src/helpers/cacheCallback.ts","webpack://tweb/./src/helpers/string/replaceNonNumber.ts","webpack://tweb/./src/helpers/cards/cardBrands.ts","webpack://tweb/./src/helpers/array/createArray.ts","webpack://tweb/./src/helpers/string/buggedNumbers.ts","webpack://tweb/./src/helpers/cards/patternCharacters.ts","webpack://tweb/./src/helpers/cards/cardFormattingPatterns.ts","webpack://tweb/./src/helpers/cards/formatValueByPattern.ts","webpack://tweb/./src/helpers/cards/validateCard.ts","webpack://tweb/./src/components/popups/paymentVerification.ts","webpack://tweb/./src/components/popups/paymentCard.ts","webpack://tweb/./src/helpers/cards/formatInputValueByPattern.ts","webpack://tweb/./src/components/popups/paymentCardConfirmation.ts","webpack://tweb/./src/components/popups/paymentShipping.ts","webpack://tweb/./src/components/popups/paymentShippingMethods.ts","webpack://tweb/./src/components/popups/payment.ts","webpack://tweb/./src/components/popups/peer.ts","webpack://tweb/./src/components/popups/pickUser.ts","webpack://tweb/./src/components/popups/sendNow.ts","webpack://tweb/./src/components/popups/stickers.ts","webpack://tweb/./src/components/popups/unpinMessage.ts","webpack://tweb/./src/components/preloader.ts","webpack://tweb/./src/components/groupedLayout.ts","webpack://tweb/./src/components/prepareAlbum.ts","webpack://tweb/./src/components/putPhoto.ts","webpack://tweb/./src/components/wrappers/getPeerInitials.ts","webpack://tweb/./src/components/putPreloader.ts","webpack://tweb/./src/components/radioField.ts","webpack://tweb/./src/components/radioForm.ts","webpack://tweb/./src/components/rangeSelector.ts","webpack://tweb/./src/components/ripple.ts","webpack://tweb/./src/components/row.ts","webpack://tweb/./src/components/scrollable.ts","webpack://tweb/./src/components/settingSection.ts","webpack://tweb/./src/components/sidebarLeft/tabs/newGroup.ts","webpack://tweb/./src/lib/appManagers/utils/privacy/privacyType.ts","webpack://tweb/./src/lib/appManagers/utils/privacy/getPrivacyRulesDetails.ts","webpack://tweb/./src/components/privacySection.ts","webpack://tweb/./src/components/sidebarLeft/tabs/privacy/phoneNumber.ts","webpack://tweb/./src/components/sidebarLeft/tabs/2fa/passwordSet.ts","webpack://tweb/./src/helpers/dom/canFocus.ts","webpack://tweb/./src/components/sidebarLeft/tabs/2fa/emailConfirmation.ts","webpack://tweb/./src/components/sidebarLeft/tabs/2fa/email.ts","webpack://tweb/./src/components/sidebarLeft/tabs/2fa/hint.ts","webpack://tweb/./src/components/sidebarLeft/tabs/2fa/reEnterPassword.ts","webpack://tweb/./src/components/sidebarLeft/tabs/2fa/enterPassword.ts","webpack://tweb/./src/components/sidebarLeft/tabs/2fa/index.ts","webpack://tweb/./src/components/sidebarLeft/tabs/privacy/lastSeen.ts","webpack://tweb/./src/components/sidebarLeft/tabs/privacy/profilePhoto.ts","webpack://tweb/./src/components/sidebarLeft/tabs/privacy/forwardMessages.ts","webpack://tweb/./src/components/sidebarLeft/tabs/privacy/addToGroups.ts","webpack://tweb/./src/components/sidebarLeft/tabs/privacy/calls.ts","webpack://tweb/./src/components/sidebarLeft/tabs/activeSessions.ts","webpack://tweb/./src/components/sidebarLeft/tabs/blockedUsers.ts","webpack://tweb/./src/helpers/string/convertKeyToInputKey.ts","webpack://tweb/./src/components/sidebarLeft/tabs/privacy/voices.ts","webpack://tweb/./src/components/sidebarLeft/tabs/activeWebSessions.ts","webpack://tweb/./src/components/sidebarLeft/tabs/privacyAndSecurity.ts","webpack://tweb/./src/components/sidebarLeft/tabs/powerSaving.ts","webpack://tweb/./src/components/sidebarLeft/tabs/generalSettings.ts","webpack://tweb/./src/helpers/eachMinute.ts","webpack://tweb/./src/helpers/eachTimeout.ts","webpack://tweb/./src/components/sidebarLeft/tabs/chatFolders.ts","webpack://tweb/./src/components/sidebarLeft/tabs/notifications.ts","webpack://tweb/./src/components/sidebarLeft/tabs/language.ts","webpack://tweb/./src/components/sidebarLeft/tabs/autoDownload/photo.ts","webpack://tweb/./src/components/sidebarLeft/tabs/autoDownload/file.ts","webpack://tweb/./src/components/sidebarLeft/tabs/autoDownload/video.ts","webpack://tweb/./src/components/sidebarLeft/tabs/dataAndStorage.ts","webpack://tweb/./src/components/sidebarLeft/tabs/quickReaction.ts","webpack://tweb/./src/components/sidebarLeft/tabs/stickersAndEmoji.ts","webpack://tweb/./src/components/sidebarLeft/tabs/settings.ts","webpack://tweb/./src/components/sidebarLeft/tabs/newChannel.ts","webpack://tweb/./src/components/popups/createContact.ts","webpack://tweb/./src/components/sidebarLeft/tabs/contacts.ts","webpack://tweb/./src/components/sidebarLeft/tabs/archivedTab.ts","webpack://tweb/./src/components/sidebarLeft/tabs/peopleNearby.ts","webpack://tweb/./src/components/sidebarLeft/index.ts","webpack://tweb/./src/components/sidebarLeft/tabs/addMembers.ts","webpack://tweb/./src/helpers/averageColor.ts","webpack://tweb/./src/helpers/highlightningColor.ts","webpack://tweb/./src/components/colorPicker.ts","webpack://tweb/./src/components/sidebarLeft/tabs/backgroundColor.ts","webpack://tweb/./src/components/sidebarLeft/tabs/background.ts","webpack://tweb/./src/helpers/files/requestFile.ts","webpack://tweb/./src/components/sidebarLeft/tabs/includedChats.ts","webpack://tweb/./src/components/sidebarLeft/tabs/editFolder.ts","webpack://tweb/./src/components/sidebarLeft/tabs/editProfile.ts","webpack://tweb/./src/components/sidebarRight/index.ts","webpack://tweb/./src/components/sidebarRight/tabs/editContact.ts","webpack://tweb/./src/components/sidebarRight/tabs/editTopic.ts","webpack://tweb/./src/components/sidebarRight/tabs/chatType.ts","webpack://tweb/./src/components/sidebarRight/tabs/userPermissions.ts","webpack://tweb/./src/components/sidebarRight/tabs/groupPermissions.ts","webpack://tweb/./src/lib/appManagers/utils/chats/combineParticipantBannedRights.ts","webpack://tweb/./src/components/sidebarRight/tabs/chatReactions.ts","webpack://tweb/./src/components/sidebarRight/tabs/editChat.ts","webpack://tweb/./src/components/sidebarRight/tabs/sharedMedia.ts","webpack://tweb/./src/components/singleTransition.ts","webpack://tweb/./src/components/slider.ts","webpack://tweb/./src/components/sliderTab.ts","webpack://tweb/./src/components/sortedUserList.ts","webpack://tweb/./src/components/stackedAvatars.ts","webpack://tweb/./src/components/stickerViewer.ts","webpack://tweb/./src/components/stickyIntersector.ts","webpack://tweb/./src/components/swipeHandler.ts","webpack://tweb/./src/components/telInputField.ts","webpack://tweb/./src/components/telegramWebView.ts","webpack://tweb/./src/components/toast.ts","webpack://tweb/./src/components/transition.ts","webpack://tweb/./src/lib/richTextProcessor/isUsernameValid.ts","webpack://tweb/./src/components/usernameInputField.ts","webpack://tweb/./src/components/usernamesSection.ts","webpack://tweb/./src/components/visibilityIntersector.ts","webpack://tweb/./src/components/volumeSelector.ts","webpack://tweb/./src/components/wrappers/customEmoji.ts","webpack://tweb/./src/components/wrappers/document.ts","webpack://tweb/./src/components/wrappers/formatUserPhone.ts","webpack://tweb/./src/components/wrappers/getChatMembersString.ts","webpack://tweb/./src/components/wrappers/getPeerTitle.ts","webpack://tweb/./src/components/wrappers/getUserStatusString.ts","webpack://tweb/./src/components/wrappers/mediaSpoiler.ts","webpack://tweb/./src/components/wrappers/messageActionTextNew.ts","webpack://tweb/./src/components/topicAvatar.ts","webpack://tweb/./src/components/wrappers/joinVoiceChatAnchor.ts","webpack://tweb/./src/components/wrappers/messageActionTextNewUnsafe.ts","webpack://tweb/./src/components/wrappers/messageForReply.ts","webpack://tweb/./src/components/wrappers/peerTitle.ts","webpack://tweb/./src/components/wrappers/photo.ts","webpack://tweb/./src/components/wrappers/reply.ts","webpack://tweb/./src/components/wrappers/senderToPeer.ts","webpack://tweb/./src/components/wrappers/sentTime.ts","webpack://tweb/./src/components/wrappers/sticker.ts","webpack://tweb/./src/helpers/bytes/getPathFromBytes.ts","webpack://tweb/./src/helpers/computeLockColor.ts","webpack://tweb/./src/components/wrappers/stickerAnimation.ts","webpack://tweb/./src/components/wrappers/stickerEmoji.ts","webpack://tweb/./src/components/wrappers/stickerSetThumb.ts","webpack://tweb/./src/components/wrappers/stickerToRow.ts","webpack://tweb/./src/components/wrappers/topicNameButton.ts","webpack://tweb/./src/components/wrappers/video.ts","webpack://tweb/./src/components/wrappers/webPageDescription.ts","webpack://tweb/./src/components/wrappers/webPageTitle.ts","webpack://tweb/./src/config/currencies.ts","webpack://tweb/./src/config/emoji.ts","webpack://tweb/./src/config/font.ts","webpack://tweb/./src/environment/imageBitmapSupport.ts","webpack://tweb/./src/helpers/animation.ts","webpack://tweb/./src/helpers/array/accumulate.ts","webpack://tweb/./src/helpers/array/filterAsync.ts","webpack://tweb/./src/helpers/array/findAndSpliceAll.ts","webpack://tweb/./src/helpers/array/partition.ts","webpack://tweb/./src/helpers/audioAssetPlayer.ts","webpack://tweb/./src/helpers/blob/readBlobAsDataURL.ts","webpack://tweb/./src/helpers/heavyQueue.ts","webpack://tweb/./src/helpers/blur.ts","webpack://tweb/./src/helpers/bytes/getPreviewURLFromBytes.ts","webpack://tweb/./src/helpers/bytes/bytesToDataURL.ts","webpack://tweb/./src/helpers/calcImageInBox.ts","webpack://tweb/./src/helpers/canvas/drawCircle.ts","webpack://tweb/./src/helpers/canvas/getTextWidth.ts","webpack://tweb/./src/helpers/canvas/scaleMediaElement.ts","webpack://tweb/./src/helpers/cleanSearchText.ts","webpack://tweb/./src/helpers/clipboard.ts","webpack://tweb/./src/helpers/contextMenuController.ts","webpack://tweb/./src/helpers/date.ts","webpack://tweb/./src/helpers/dom/anchorCopy.ts","webpack://tweb/./src/helpers/dom/attachContextMenuListener.ts","webpack://tweb/./src/helpers/dom/attachGrabListeners.ts","webpack://tweb/./src/helpers/dom/cancelSelection.ts","webpack://tweb/./src/helpers/dom/clickEvent.ts","webpack://tweb/./src/helpers/dom/controlsHover.ts","webpack://tweb/./src/helpers/dom/createContextMenu.ts","webpack://tweb/./src/helpers/dom/createStickersContextMenu.ts","webpack://tweb/./src/helpers/dom/createVideo.ts","webpack://tweb/./src/helpers/dom/customProperties.ts","webpack://tweb/./src/helpers/dom/dispatchEvent.ts","webpack://tweb/./src/helpers/dom/documentFragmentToHTML.ts","webpack://tweb/./src/helpers/dom/findUpAsChild.ts","webpack://tweb/./src/helpers/dom/findUpAttribute.ts","webpack://tweb/./src/helpers/dom/findUpTag.ts","webpack://tweb/./src/helpers/dom/fullScreen.ts","webpack://tweb/./src/helpers/dom/getCaretPosNew.ts","webpack://tweb/./src/helpers/dom/getRichElementValue.ts","webpack://tweb/./src/helpers/dom/getRichValueWithCaret.ts","webpack://tweb/./src/helpers/dom/getViewportSlice.ts","webpack://tweb/./src/helpers/dom/getVisibleRect.ts","webpack://tweb/./src/helpers/dom/handleHorizontalSwipe.ts","webpack://tweb/./src/helpers/dom/handleTabSwipe.ts","webpack://tweb/./src/helpers/dom/hasMarkupInSelection.ts","webpack://tweb/./src/helpers/dom/htmlToDocumentFragment.ts","webpack://tweb/./src/helpers/dom/htmlToSpan.ts","webpack://tweb/./src/helpers/dom/isInDOM.ts","webpack://tweb/./src/helpers/dom/isInputEmpty.ts","webpack://tweb/./src/helpers/dom/isSelectionEmpty.ts","webpack://tweb/./src/helpers/dom/isSendShortcutPressed.ts","webpack://tweb/./src/helpers/dom/isSwipingBackSafari.ts","webpack://tweb/./src/helpers/dom/placeCaretAtEnd.ts","webpack://tweb/./src/helpers/dom/positionElementByIndex.ts","webpack://tweb/./src/helpers/dom/reflowScrollableElement.ts","webpack://tweb/./src/helpers/dom/renderImageFromUrl.ts","webpack://tweb/./src/helpers/dom/renderMediaWithFadeIn.ts","webpack://tweb/./src/helpers/dom/replaceContent.ts","webpack://tweb/./src/helpers/dom/compareNodes.ts","webpack://tweb/./src/helpers/dom/richInputHandler.ts","webpack://tweb/./src/helpers/dom/shake.ts","webpack://tweb/./src/helpers/dom/sortable.ts","webpack://tweb/./src/helpers/dom/toggleDisability.ts","webpack://tweb/./src/helpers/dom/whichChild.ts","webpack://tweb/./src/helpers/dropdownHover.ts","webpack://tweb/./src/helpers/fastSmoothScroll.ts","webpack://tweb/./src/helpers/fileName.ts","webpack://tweb/./src/helpers/filterChatPhotosMessages.ts","webpack://tweb/./src/helpers/formatBytes.ts","webpack://tweb/./src/helpers/formatCallDuration.ts","webpack://tweb/./src/helpers/formatDuration.ts","webpack://tweb/./src/helpers/formatPhoneNumber.ts","webpack://tweb/./src/helpers/framesCache.ts","webpack://tweb/./src/helpers/generatePathData.ts","webpack://tweb/./src/helpers/getImageFromStrippedThumb.ts","webpack://tweb/./src/helpers/getPreviewURLFromThumb.ts","webpack://tweb/./src/helpers/getStrippedThumbIfNeeded.ts","webpack://tweb/./src/helpers/listLoader.ts","webpack://tweb/./src/helpers/listenerSetter.ts","webpack://tweb/./src/helpers/liteMode.ts","webpack://tweb/./src/helpers/mediaSize.ts","webpack://tweb/./src/helpers/mediaSizes.ts","webpack://tweb/./src/helpers/middlewarePromise.ts","webpack://tweb/./src/helpers/number/formatNumber.ts","webpack://tweb/./src/helpers/number/numberThousandSplitter.ts","webpack://tweb/./src/helpers/onMediaLoad.ts","webpack://tweb/./src/helpers/overlayClickHandler.ts","webpack://tweb/./src/helpers/paymentsWrapCurrencyAmount.ts","webpack://tweb/./src/helpers/positionMenu.ts","webpack://tweb/./src/helpers/preloadAnimatedEmojiSticker.ts","webpack://tweb/./src/helpers/restrictions.ts","webpack://tweb/./src/helpers/saveLottiePreview.ts","webpack://tweb/./src/helpers/schedulers/throttleWithRaf.ts","webpack://tweb/./src/helpers/schedulers/throttleWith.ts","webpack://tweb/./src/helpers/scrollSaver.ts","webpack://tweb/./src/helpers/scrollableLoader.ts","webpack://tweb/./src/helpers/searchListLoader.ts","webpack://tweb/./src/lib/appManagers/utils/messageId/incrementMessageId.ts","webpack://tweb/./src/helpers/sequentialDom.ts","webpack://tweb/./src/helpers/setAttachmentSize.ts","webpack://tweb/./src/helpers/sortedList.ts","webpack://tweb/./src/helpers/string/bom.ts","webpack://tweb/./src/helpers/string/encodeEntities.ts","webpack://tweb/./src/helpers/string/escapeRegExp.ts","webpack://tweb/./src/helpers/string/limitSymbols.ts","webpack://tweb/./src/helpers/string/nbsp.ts","webpack://tweb/./src/helpers/string/toHHMMSS.ts","webpack://tweb/./src/helpers/textToSvgURL.ts","webpack://tweb/./src/helpers/windowSize.ts","webpack://tweb/./src/hooks/useHeavyAnimationCheck.ts","webpack://tweb/./src/components/dialogsContextMenu.ts","webpack://tweb/./src/components/connectionStatus.ts","webpack://tweb/./src/components/sendingStatus.ts","webpack://tweb/./src/helpers/easing/easeInOutSine.ts","webpack://tweb/./src/helpers/canvas/roundRect.ts","webpack://tweb/./src/components/groupCallActiveIcon.ts","webpack://tweb/./src/helpers/canvas/shimmer.ts","webpack://tweb/./src/helpers/dialogsPlaceholder.ts","webpack://tweb/./src/lib/appManagers/appDialogsManager.ts","webpack://tweb/./src/helpers/number/getUnsafeRandomInt.ts","webpack://tweb/./src/lib/appManagers/appDownloadManager.ts","webpack://tweb/./src/helpers/dom/createDownloadAnchor.ts","webpack://tweb/./src/components/chat/pinnedContainer.ts","webpack://tweb/./src/components/chat/audio.ts","webpack://tweb/./src/components/chat/pinnedMessageBorder.ts","webpack://tweb/./src/components/chat/pinnedMessage.ts","webpack://tweb/./src/helpers/dom/handleScrollSideEvent.ts","webpack://tweb/./src/components/chat/topbar.ts","webpack://tweb/./src/components/sidebarRight/tabs/search.ts","webpack://tweb/./src/components/chat/search.ts","webpack://tweb/./src/components/chat/patternRenderer.ts","webpack://tweb/./src/components/chat/chat.ts","webpack://tweb/./src/helpers/autoDownload.ts","webpack://tweb/./src/components/chat/markupTooltip.ts","webpack://tweb/./src/components/chat/dragAndDrop.ts","webpack://tweb/./src/helpers/dom/disableTransition.ts","webpack://tweb/./src/components/lineBlobDrawable.ts","webpack://tweb/./src/components/topbarWeave.ts","webpack://tweb/./src/lib/rlottie/rlottieIcon.ts","webpack://tweb/./src/components/superIcon.ts","webpack://tweb/./src/components/groupCall/microphoneIcon.ts","webpack://tweb/./src/components/groupCall/participantMutedIcon.ts","webpack://tweb/./src/components/groupCall/index.ts","webpack://tweb/./src/components/groupCall/participantStatus.ts","webpack://tweb/./src/components/groupCall/participantsList.ts","webpack://tweb/./src/components/call/videoCanvasBlur.ts","webpack://tweb/./src/components/groupCall/participantVideo.ts","webpack://tweb/./src/components/groupCall/participantVideos.ts","webpack://tweb/./src/components/groupCall/participants.ts","webpack://tweb/./src/components/groupCall/description.ts","webpack://tweb/./src/components/groupCall/title.ts","webpack://tweb/./src/components/call/button.ts","webpack://tweb/./src/components/movableElement.ts","webpack://tweb/./src/helpers/movablePanel.ts","webpack://tweb/./src/helpers/toggleClassName.ts","webpack://tweb/./src/components/call/description.ts","webpack://tweb/./src/components/groupCall/microphoneIconMini.ts","webpack://tweb/./src/components/call/index.ts","webpack://tweb/./src/components/topbarCall.ts","webpack://tweb/./src/lib/appManagers/uiNotificationsManager.ts","webpack://tweb/./src/config/notifications.ts","webpack://tweb/./src/helpers/files/getFilesFromEvent.ts","webpack://tweb/./src/helpers/addAnchorListener.ts","webpack://tweb/./src/lib/appManagers/appImManager.ts","webpack://tweb/./src/lib/appManagers/internalLink.ts","webpack://tweb/./src/lib/appManagers/utils/messages/canSaveMessageMedia.ts","webpack://tweb/./src/lib/appManagers/utils/messages/getMediaFromMessage.ts","webpack://tweb/./src/lib/appManagers/utils/messages/getMessageSenderPeerIdOrName.ts","webpack://tweb/./src/lib/appManagers/utils/messages/isMessageRestricted.ts","webpack://tweb/./src/lib/appManagers/utils/peers/getPeerColorById.ts","webpack://tweb/./src/lib/appManagers/utils/peers/getPeerEditableUsername.ts","webpack://tweb/./src/lib/appManagers/utils/peers/getPeerId.ts","webpack://tweb/./src/lib/appManagers/utils/photos/choosePhotoSize.ts","webpack://tweb/./src/lib/calls/callConnectionInstanceBase.ts","webpack://tweb/./src/lib/calls/helpers/createPeerConnection.ts","webpack://tweb/./src/lib/calls/helpers/createDataChannel.ts","webpack://tweb/./src/lib/calls/helpers/parseSignalingData.ts","webpack://tweb/./src/lib/calls/callConnectionInstance.ts","webpack://tweb/./src/lib/crypto/subtle.ts","webpack://tweb/./src/lib/calls/p2P/p2PEncryptor.ts","webpack://tweb/./src/lib/crypto/utils/sha256.ts","webpack://tweb/./src/lib/calls/p2P/chromeP2PSdpBuilder.ts","webpack://tweb/./src/lib/calls/p2P/p2PSdpBuilder.js","webpack://tweb/./src/lib/calls/p2P/firefoxP2PSdpBuilder.js","webpack://tweb/./src/lib/calls/p2P/safariP2PSdpBuilder.js","webpack://tweb/./src/lib/calls/callInstance.ts","webpack://tweb/./src/lib/calls/p2P/getCallProtocol.ts","webpack://tweb/./src/lib/calls/p2P/getRtcConfiguration.ts","webpack://tweb/./src/lib/calls/helpers/getStreamCached.ts","webpack://tweb/./src/lib/calls/callInstanceBase.ts","webpack://tweb/./src/lib/calls/callState.ts","webpack://tweb/./src/components/call/getAudioAsset.ts","webpack://tweb/./src/lib/calls/callsController.ts","webpack://tweb/./src/lib/calls/constants.ts","webpack://tweb/./src/lib/calls/groupCallConnectionInstance.ts","webpack://tweb/./src/lib/calls/helpers/processMediaSection.ts","webpack://tweb/./src/lib/calls/helpers/filterServerCodecs.ts","webpack://tweb/./src/lib/calls/helpers/fixLocalOffer.ts","webpack://tweb/./src/lib/calls/groupCallInstance.ts","webpack://tweb/./src/lib/calls/groupCallState.ts","webpack://tweb/./src/components/groupCall/getAudioAsset.ts","webpack://tweb/./src/lib/calls/groupCallsController.ts","webpack://tweb/./src/lib/calls/helpers/createMainStreamManager.ts","webpack://tweb/./src/lib/calls/helpers/getAudioConstraints.ts","webpack://tweb/./src/environment/constraintSupport.ts","webpack://tweb/./src/lib/calls/helpers/getScreenConstraints.ts","webpack://tweb/./src/lib/calls/helpers/getScreenStream.ts","webpack://tweb/./src/lib/calls/helpers/getStream.ts","webpack://tweb/./src/lib/calls/helpers/getVideoConstraints.ts","webpack://tweb/./src/lib/calls/helpers/parseMediaSectionInfo.ts","webpack://tweb/./src/lib/calls/helpers/parseSourceGroups.ts","webpack://tweb/./src/lib/calls/helpers/stopTrack.ts","webpack://tweb/./src/lib/calls/localConferenceDescription.ts","webpack://tweb/./src/lib/calls/sdp/index.ts","webpack://tweb/./src/helpers/string/splitStringByLimitWithRest.ts","webpack://tweb/./src/helpers/uniqueNumberGenerator.ts","webpack://tweb/./src/lib/calls/sdp/attributeSplitted.ts","webpack://tweb/./src/lib/calls/sdp/mediaLineParts.ts","webpack://tweb/./src/lib/calls/sdp/line.ts","webpack://tweb/./src/lib/calls/sdp/attributeInner.ts","webpack://tweb/./src/lib/calls/sdp/attributes.ts","webpack://tweb/./src/lib/calls/sdp/mediaSection.ts","webpack://tweb/./src/lib/calls/sdp/sessionSection.ts","webpack://tweb/./src/lib/calls/sdp/utils.ts","webpack://tweb/./src/lib/calls/sdpBuilder.ts","webpack://tweb/./src/lib/calls/streamManager.ts","webpack://tweb/./src/lib/calls/stringFromLineBuilder.ts","webpack://tweb/./src/lib/calls/utils.ts","webpack://tweb/./src/lib/mtproto/constants.ts","webpack://tweb/./src/lib/richTextProcessor/getAbbreviation.ts","webpack://tweb/./src/lib/richTextProcessor/getEmojiEntityFromEmoji.ts","webpack://tweb/./src/lib/richTextProcessor/matchEmail.ts","webpack://tweb/./src/lib/richTextProcessor/setBlankToAnchor.ts","webpack://tweb/./src/lib/richTextProcessor/wrapAbbreviation.ts","webpack://tweb/./src/lib/richTextProcessor/wrapDraftText.ts","webpack://tweb/./src/lib/richTextProcessor/wrapEmojiText.ts","webpack://tweb/./src/environment/emojiVersionsSupport.ts","webpack://tweb/./src/lib/richTextProcessor/wrapRichText.ts","webpack://tweb/./src/helpers/buildURLHash.ts","webpack://tweb/./src/lib/richTextProcessor/wrapTelegramUrlToAnchor.ts","webpack://tweb/./src/lib/rlottie/queryableWorker.ts","webpack://tweb/./src/environment/webAssemblySupport.ts","webpack://tweb/./src/lib/rlottie/lottieLoader.ts","webpack://tweb/./src/lib/rlottie/rlottiePlayer.ts","webpack://tweb/./src/pages/pagesManager.ts","webpack://tweb/./src/pages/page.ts","webpack://tweb/./src/vendor/emoji/index.ts","webpack://tweb/./public/recorder.min.js","webpack://tweb/./src/vendor/bezier-easing/index.js"],"sourcesContent":["/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {LiteModeKey} from '../helpers/liteMode';\nimport {CustomEmojiElement, CustomEmojiRendererElement} from '../lib/richTextProcessor/wrapRichText';\nimport rootScope from '../lib/rootScope';\nimport {IS_SAFARI} from '../environment/userAgent';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport isInDOM from '../helpers/dom/isInDOM';\nimport RLottiePlayer from '../lib/rlottie/rlottiePlayer';\nimport indexOfAndSplice from '../helpers/array/indexOfAndSplice';\nimport forEachReverse from '../helpers/array/forEachReverse';\nimport idleController from '../helpers/idleController';\nimport appMediaPlaybackController from './appMediaPlaybackController';\nimport {fastRaf} from '../helpers/schedulers';\nimport {Middleware} from '../helpers/middleware';\n\nexport type AnimationItemGroup = '' | 'none' | 'chat' | 'lock' |\n 'STICKERS-POPUP' | 'emoticons-dropdown' | 'STICKERS-SEARCH' | 'GIFS-SEARCH' |\n `CHAT-MENU-REACTIONS-${number}` | 'INLINE-HELPER' | 'GENERAL-SETTINGS' | 'STICKER-VIEWER' | 'EMOJI' |\n 'EMOJI-STATUS' | `chat-${number}`;\nexport interface AnimationItem {\n el: HTMLElement,\n group: AnimationItemGroup,\n animation: AnimationItemWrapper,\n liteModeKey?: LiteModeKey,\n controlled?: boolean | Middleware\n};\n\nexport interface AnimationItemWrapper {\n remove: () => void;\n paused: boolean;\n pause: () => any;\n play: () => any;\n autoplay: boolean;\n loop: boolean | number;\n // onVisibilityChange?: (visible: boolean) => boolean;\n};\n\nexport class AnimationIntersector {\n private observer: IntersectionObserver;\n private visible: Set;\n\n private overrideIdleGroups: Set;\n private byGroups: {[group in AnimationItemGroup]?: AnimationItem[]};\n private byPlayer: Map;\n private lockedGroups: {[group in AnimationItemGroup]?: true};\n private onlyOnePlayableGroup: AnimationItemGroup;\n\n private intersectionLockedGroups: {[group in AnimationItemGroup]?: true};\n private videosLocked: boolean;\n\n constructor() {\n this.observer = new IntersectionObserver((entries) => {\n // if(rootScope.idle.isIDLE) return;\n\n for(const entry of entries) {\n const target = entry.target;\n\n for(const group in this.byGroups) {\n if(this.intersectionLockedGroups[group as AnimationItemGroup]) {\n continue;\n }\n\n const animation = this.byGroups[group as AnimationItemGroup].find((p) => p.el === target);\n if(!animation) {\n continue;\n }\n\n if(entry.isIntersecting) {\n this.visible.add(animation);\n this.checkAnimation(animation, false);\n\n /* if(animation instanceof HTMLVideoElement && animation.dataset.src) {\n animation.src = animation.dataset.src;\n animation.load();\n } */\n } else {\n this.visible.delete(animation);\n this.checkAnimation(animation, true);\n\n const _animation = animation.animation;\n if(_animation instanceof RLottiePlayer/* && animation.cachingDelta === 2 */) {\n // console.warn('will clear cache', player);\n _animation.clearCache();\n }/* else if(animation instanceof HTMLVideoElement && animation.src) {\n animation.dataset.src = animation.src;\n animation.src = '';\n animation.load();\n } */\n }\n\n break;\n }\n }\n });\n\n this.visible = new Set();\n\n this.overrideIdleGroups = new Set();\n this.byGroups = {};\n this.byPlayer = new Map();\n this.lockedGroups = {};\n this.onlyOnePlayableGroup = '';\n\n this.intersectionLockedGroups = {};\n this.videosLocked = false;\n\n appMediaPlaybackController.addEventListener('play', ({doc}) => {\n if(doc.type === 'round') {\n this.videosLocked = true;\n this.checkAnimations2();\n }\n });\n\n appMediaPlaybackController.addEventListener('pause', () => {\n if(this.videosLocked) {\n this.videosLocked = false;\n this.checkAnimations2();\n }\n });\n\n idleController.addEventListener('change', (idle) => {\n this.checkAnimations2(idle);\n });\n }\n\n public setOverrideIdleGroup(group: string, override: boolean) {\n if(override) this.overrideIdleGroups.add(group);\n else this.overrideIdleGroups.delete(group);\n }\n\n public getAnimations(element: HTMLElement) {\n const found: AnimationItem[] = [];\n for(const group in this.byGroups) {\n for(const player of this.byGroups[group as AnimationItemGroup]) {\n if(player.el === element) {\n found.push(player);\n }\n }\n }\n\n return found;\n }\n\n public removeAnimation(player: AnimationItem) {\n const {el, animation} = player;\n if(!(animation instanceof HTMLVideoElement)) {\n animation.remove();\n }\n\n if(animation instanceof HTMLVideoElement && IS_SAFARI) {\n setTimeout(() => { // TODO: очистка по очереди, а не все вместе с этим таймаутом\n animation.src = '';\n animation.load();\n }, 1e3);\n }\n\n const group = this.byGroups[player.group];\n if(group) {\n indexOfAndSplice(group, player);\n if(!group.length) {\n delete this.byGroups[player.group];\n }\n }\n\n this.observer.unobserve(el);\n this.visible.delete(player);\n this.byPlayer.delete(animation);\n }\n\n public removeAnimationByPlayer(player: AnimationItemWrapper) {\n const item = this.byPlayer.get(player);\n if(item) {\n this.removeAnimation(item);\n }\n }\n\n public addAnimation(options: {\n animation: AnimationItem['animation'],\n group?: AnimationItemGroup,\n observeElement?: HTMLElement,\n controlled?: AnimationItem['controlled'],\n liteModeKey?: LiteModeKey\n }) {\n let {animation, group = '', observeElement, controlled, liteModeKey} = options;\n if(group === 'none' || this.byPlayer.has(animation)) {\n return;\n }\n\n if(!observeElement) {\n if(animation instanceof RLottiePlayer) {\n observeElement = animation.el[0];\n } else if(animation instanceof CustomEmojiRendererElement) {\n observeElement = animation.canvas;\n } else if(animation instanceof CustomEmojiElement) {\n observeElement = animation.placeholder ?? animation;\n } else if(animation instanceof HTMLElement) {\n observeElement = animation;\n }\n }\n\n const item: AnimationItem = {\n el: observeElement,\n animation: animation,\n group,\n controlled,\n liteModeKey\n };\n\n if(controlled && typeof(controlled) !== 'boolean') {\n controlled.onClean(() => {\n this.removeAnimationByPlayer(animation);\n });\n }\n\n if(animation instanceof RLottiePlayer) {\n if(!rootScope.settings.stickers.loop && animation.loop) {\n animation.loop = rootScope.settings.stickers.loop;\n }\n }\n\n (this.byGroups[group as AnimationItemGroup] ??= []).push(item);\n this.observer.observe(item.el);\n this.byPlayer.set(animation, item);\n }\n\n public checkAnimations(\n blurred?: boolean,\n group?: AnimationItemGroup,\n destroy?: boolean,\n imitateIntersection?: boolean\n ) {\n // if(rootScope.idle.isIDLE) return;\n\n if(group !== undefined && !this.byGroups[group]) {\n // console.warn('no animation group:', group);\n return;\n }\n\n const groups = group !== undefined /* && false */ ? [group] : Object.keys(this.byGroups) as AnimationItemGroup[];\n\n for(const group of groups) {\n if(imitateIntersection && this.intersectionLockedGroups[group]) {\n continue;\n }\n\n const animations = this.byGroups[group];\n\n forEachReverse(animations, (animation) => {\n this.checkAnimation(animation, blurred, destroy);\n });\n }\n }\n\n public checkAnimations2(blurred?: boolean) {\n this.checkAnimations(blurred, undefined, undefined, true);\n }\n\n public checkAnimation(player: AnimationItem, blurred?: boolean, destroy?: boolean) {\n const {el, animation, group} = player;\n // return;\n if(destroy || (!this.lockedGroups[group] && !isInDOM(el))) {\n if(!player.controlled || destroy) {\n this.removeAnimation(player);\n }\n\n return;\n }\n\n if(blurred ||\n (this.onlyOnePlayableGroup && this.onlyOnePlayableGroup !== group) ||\n (animation instanceof HTMLVideoElement && this.videosLocked)\n ) {\n if(!animation.paused) {\n // console.warn('pause animation:', animation);\n animation.pause();\n }\n } else if(animation.paused &&\n this.visible.has(player) &&\n animation.autoplay &&\n (!this.onlyOnePlayableGroup || this.onlyOnePlayableGroup === group) &&\n (!idleController.isIdle || this.overrideIdleGroups.has(player.group))\n ) {\n // console.warn('play animation:', animation);\n animation.play();\n }\n }\n\n public getOnlyOnePlayableGroup() {\n return this.onlyOnePlayableGroup;\n }\n\n public setOnlyOnePlayableGroup(group: AnimationItemGroup = '') {\n this.onlyOnePlayableGroup = group;\n }\n\n public lockGroup(group: AnimationItemGroup) {\n this.lockedGroups[group] = true;\n }\n\n public unlockGroup(group: AnimationItemGroup) {\n delete this.lockedGroups[group];\n this.checkAnimations(undefined, group);\n }\n\n public refreshGroup(group: AnimationItemGroup) {\n const animations = this.byGroups[group];\n if(!animations?.length) {\n return;\n }\n\n animations.forEach((animation) => {\n this.observer.unobserve(animation.el);\n });\n\n fastRaf(() => {\n animations.forEach((animation) => {\n this.observer.observe(animation.el);\n });\n });\n }\n\n public lockIntersectionGroup(group: AnimationItemGroup) {\n this.intersectionLockedGroups[group] = true;\n }\n\n public unlockIntersectionGroup(group: AnimationItemGroup) {\n delete this.intersectionLockedGroups[group];\n this.refreshGroup(group);\n }\n\n public toggleIntersectionGroup(group: AnimationItemGroup, lock: boolean) {\n if(lock) this.lockIntersectionGroup(group);\n else this.unlockIntersectionGroup(group);\n }\n\n public setAutoplay(play: boolean, liteModeKey: LiteModeKey) {\n let changed = false;\n this.byPlayer.forEach((animationItem, animation) => {\n if(animationItem.liteModeKey === liteModeKey) {\n changed = true;\n animation.autoplay = play ? !!+animationItem.el.dataset.stickerPlay : false;\n animation.loop = play ? !!+animationItem.el.dataset.stickerLoop && rootScope.settings.stickers.loop : false;\n }\n });\n\n return changed;\n }\n\n public setLoop(loop: boolean) {\n let changed = false;\n this.byPlayer.forEach((animationItem, animation) => {\n if(!!+animationItem.el.dataset.stickerLoop &&\n animation.loop !== loop &&\n (animation instanceof RLottiePlayer || animation instanceof HTMLVideoElement)) {\n changed = true;\n animation.loop = loop;\n\n // if(animation._autoplay && animation.autoplay !== animation._autoplay) {\n animation.autoplay = !!+animationItem.el.dataset.stickerPlay;\n // }\n }\n });\n\n return changed;\n }\n}\n\nconst animationIntersector = new AnimationIntersector();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.animationIntersector = animationIntersector);\nexport default animationIntersector;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../lib/rootScope';\nimport {MyDocument} from '../lib/appManagers/appDocsManager';\nimport deferredPromise, {CancellablePromise} from '../helpers/cancellablePromise';\nimport {IS_APPLE, IS_SAFARI} from '../environment/userAgent';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport simulateEvent from '../helpers/dom/dispatchEvent';\nimport type {SearchSuperContext} from './appSearchSuper.';\nimport {Document, DocumentAttribute, Message, PhotoSize} from '../layer';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport I18n from '../lib/langPack';\nimport SearchListLoader from '../helpers/searchListLoader';\nimport copy from '../helpers/object/copy';\nimport deepEqual from '../helpers/object/deepEqual';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport getMediaFromMessage from '../lib/appManagers/utils/messages/getMediaFromMessage';\nimport getPeerTitle from './wrappers/getPeerTitle';\nimport appDownloadManager from '../lib/appManagers/appDownloadManager';\nimport onMediaLoad from '../helpers/onMediaLoad';\nimport EventListenerBase from '../helpers/eventListenerBase';\n\n// TODO: Safari: проверить стрим, включить его и сразу попробовать включить видео или другую песню\n// TODO: Safari: попробовать замаскировать подгрузку последнего чанка\n// TODO: Safari: пофиксить момент, когда заканчивается песня и пытаешься включить её заново - прогресс сразу в конце\n\nexport type MediaItem = {mid: number, peerId: PeerId};\n\ntype HTMLMediaElement = HTMLAudioElement | HTMLVideoElement;\n\nconst SHOULD_USE_SAFARI_FIX = (() => {\n try {\n return IS_SAFARI && +navigator.userAgent.match(/ Version\\/(\\d+)/)[1] < 14;\n } catch(err) {\n return false;\n }\n})();\n\nconst SEEK_OFFSET = 10;\n\nexport type MediaSearchContext = SearchSuperContext & Partial<{\n isScheduled: boolean,\n useSearch: boolean\n}>;\n\ntype MediaDetails = {\n peerId: PeerId,\n mid: number,\n docId: DocId,\n doc: MyDocument,\n message: Message.message,\n clean?: boolean,\n isScheduled?: boolean,\n isSingle?: boolean\n};\n\nexport type PlaybackMediaType = 'voice' | 'video' | 'audio';\n\nexport class AppMediaPlaybackController extends EventListenerBase<{\n play: (details: ReturnType) => void,\n pause: () => void,\n playbackParams: (params: ReturnType) => void,\n stop: () => void,\n}> {\n private container: HTMLElement;\n private media: Map> = new Map();\n private scheduled: AppMediaPlaybackController['media'] = new Map();\n private mediaDetails: Map = new Map();\n private playingMedia: HTMLMediaElement;\n private playingMediaType: PlaybackMediaType;\n\n private waitingMediaForLoad: Map>> = new Map();\n private waitingScheduledMediaForLoad: AppMediaPlaybackController['waitingMediaForLoad'] = new Map();\n private waitingDocumentsForLoad: {[docId: string]: Set} = {};\n\n public willBePlayedMedia: HTMLMediaElement;\n private searchContext: MediaSearchContext;\n\n private listLoader: SearchListLoader;\n\n public volume: number;\n public muted: boolean;\n public playbackRate: number;\n public loop: boolean;\n public round: boolean;\n private _volume: number;\n private _muted: boolean;\n private _playbackRate: number;\n private _loop: boolean;\n private _round: boolean;\n private lockedSwitchers: boolean;\n private playbackRates: Record = {\n voice: 1,\n video: 1,\n audio: 1\n };\n\n private pip: HTMLVideoElement;\n private managers: AppManagers;\n private skipMediaPlayEvent: boolean;\n\n construct(managers: AppManagers) {\n this.managers = managers;\n this.container = document.createElement('div');\n // this.container.style.cssText = 'position: absolute; top: -10000px; left: -10000px;';\n this.container.style.cssText = 'display: none;';\n document.body.append(this.container);\n\n if(navigator.mediaSession) {\n const actions: {[action in MediaSessionAction]?: MediaSessionActionHandler} = {\n play: this.browserPlay,\n pause: this.browserPause,\n stop: this.browserStop,\n seekbackward: this.browserSeekBackward,\n seekforward: this.browserSeekForward,\n seekto: this.browserSeekTo,\n previoustrack: this.browserPrevious,\n nexttrack: this.browserNext\n };\n\n for(const action in actions) {\n try {\n navigator.mediaSession.setActionHandler(action as MediaSessionAction, actions[action as MediaSessionAction]);\n } catch(err) {\n console.warn('MediaSession action is not supported:', action);\n }\n }\n }\n\n rootScope.addEventListener('document_downloaded', (docId) => {\n const set = this.waitingDocumentsForLoad[docId];\n if(set) {\n for(const media of set) {\n this.onMediaDocumentLoad(media);\n }\n }\n });\n\n rootScope.addEventListener('media_play', () => {\n if(this.skipMediaPlayEvent) {\n this.skipMediaPlayEvent = false;\n return;\n }\n\n if(!this.pause() && this.pip) {\n this.pip.pause();\n }\n });\n\n const properties: {[key: PropertyKey]: PropertyDescriptor} = {};\n const keys = [\n 'volume' as const,\n 'muted' as const,\n 'playbackRate' as const,\n 'loop' as const,\n 'round' as const\n ];\n keys.forEach((key) => {\n const _key = ('_' + key) as `_${typeof key}`;\n properties[key] = {\n get: () => this[_key],\n set: (value: number | boolean) => {\n if(this[_key] === value) {\n return;\n }\n\n // @ts-ignore\n this[_key] = value;\n if(this.playingMedia && (key !== 'loop' || this.playingMediaType === 'audio') && key !== 'round') {\n // @ts-ignore\n this.playingMedia[key] = value;\n }\n\n if(key === 'playbackRate' && this.playingMediaType !== undefined) {\n this.playbackRates[this.playingMediaType] = value as number;\n }\n\n this.dispatchPlaybackParams();\n }\n };\n });\n Object.defineProperties(this, properties);\n }\n\n private dispatchPlaybackParams() {\n this.dispatchEvent('playbackParams', this.getPlaybackParams());\n }\n\n public getPlaybackParams() {\n const {volume, muted, playbackRate, playbackRates, loop, round} = this;\n return {\n volume,\n muted,\n playbackRate,\n playbackRates,\n loop,\n round\n };\n }\n\n public setPlaybackParams(params: ReturnType) {\n this.playbackRates = params.playbackRates;\n this._volume = params.volume;\n this._muted = params.muted;\n this._playbackRate = params.playbackRate;\n this._loop = params.loop;\n this._round = params.round;\n }\n\n public seekBackward = (details: MediaSessionActionDetails, media = this.playingMedia) => {\n if(media) {\n media.currentTime = Math.max(0, media.currentTime - (details.seekOffset || SEEK_OFFSET));\n }\n };\n\n public seekForward = (details: MediaSessionActionDetails, media = this.playingMedia) => {\n if(media) {\n media.currentTime = Math.min(media.duration, media.currentTime + (details.seekOffset || SEEK_OFFSET));\n }\n };\n\n public seekTo = (details: MediaSessionActionDetails, media = this.playingMedia) => {\n if(media) {\n media.currentTime = details.seekTime;\n }\n };\n\n public addMedia(message: Message.message, autoload: boolean, clean?: boolean): HTMLMediaElement {\n const {peerId, mid} = message;\n\n const isScheduled = !!message.pFlags.is_scheduled;\n const s = isScheduled ? this.scheduled : this.media;\n let storage = s.get(message.peerId);\n if(!storage) {\n s.set(message.peerId, storage = new Map());\n }\n\n let media = storage.get(mid);\n if(media) {\n return media;\n }\n\n const doc = getMediaFromMessage(message, true) as Document.document;\n storage.set(mid, media = document.createElement(doc.type === 'round' || doc.type === 'video' ? 'video' : 'audio'));\n // const source = document.createElement('source');\n // source.type = doc.type === 'voice' && !opusDecodeController.isPlaySupported() ? 'audio/wav' : doc.mime_type;\n\n if(doc.type === 'round') {\n media.setAttribute('playsinline', 'true');\n // media.muted = true;\n }\n\n const details: MediaDetails = {\n peerId,\n mid,\n docId: doc.id,\n doc,\n message,\n clean,\n isScheduled: message.pFlags.is_scheduled\n };\n\n this.mediaDetails.set(media, details);\n\n // media.autoplay = true;\n media.volume = 1;\n // media.append(source);\n\n this.container.append(media);\n\n media.addEventListener('play', this.onPlay);\n media.addEventListener('pause', this.onPause);\n media.addEventListener('ended', this.onEnded);\n\n if(doc.type !== 'audio' && message?.pFlags.media_unread && message.fromId !== rootScope.myId) {\n media.addEventListener('timeupdate', () => {\n this.managers.appMessagesManager.readMessages(peerId, [mid]);\n }, {once: true});\n }\n\n /* const onError = (e: Event) => {\n //console.log('appMediaPlaybackController: video onError', e);\n\n if(this.nextMid === mid) {\n this.loadSiblingsMedia(peerId, doc.type as MediaType, mid).then(() => {\n if(this.nextMid && storage[this.nextMid]) {\n storage[this.nextMid].play();\n }\n });\n }\n };\n\n media.addEventListener('error', onError); */\n\n const deferred = deferredPromise();\n if(autoload) {\n deferred.resolve();\n } else {\n const w = message.pFlags.is_scheduled ? this.waitingScheduledMediaForLoad : this.waitingMediaForLoad;\n let waitingStorage = w.get(peerId);\n if(!waitingStorage) {\n w.set(peerId, waitingStorage = new Map());\n }\n\n waitingStorage.set(mid, deferred);\n }\n\n deferred.then(async() => {\n // media.autoplay = true;\n // console.log('will set media url:', media, doc, doc.type, doc.url);\n\n if(doc.supportsStreaming || (await this.managers.thumbsStorage.getCacheContext(doc)).url) {\n this.onMediaDocumentLoad(media);\n } else {\n let set = this.waitingDocumentsForLoad[doc.id];\n if(!set) {\n set = this.waitingDocumentsForLoad[doc.id] = new Set();\n }\n\n set.add(media);\n appDownloadManager.downloadMediaURL({media: doc});\n }\n }/* , onError */);\n\n return media;\n }\n\n public getMedia(peerId: PeerId, mid: number, isScheduled?: boolean) {\n const s = (isScheduled ? this.scheduled : this.media).get(peerId);\n return s?.get(mid);\n }\n\n private onMediaDocumentLoad = async(media: HTMLMediaElement) => {\n const details = this.mediaDetails.get(media);\n const doc = await this.managers.appDocsManager.getDoc(details.docId);\n if(doc.type === 'audio' && doc.supportsStreaming && SHOULD_USE_SAFARI_FIX) {\n this.handleSafariStreamable(media);\n }\n\n // setTimeout(() => {\n const cacheContext = await this.managers.thumbsStorage.getCacheContext(doc);\n media.src = cacheContext.url;\n\n if(this.playingMedia === media) {\n media.playbackRate = this.playbackRate;\n\n if(doc.type === 'audio') {\n media.loop = this.loop;\n }\n }\n // }, doc.supportsStreaming ? 500e3 : 0);\n\n const set = this.waitingDocumentsForLoad[doc.id];\n if(set) {\n set.delete(media);\n\n if(!set.size) {\n delete this.waitingDocumentsForLoad[doc.id];\n }\n }\n };\n\n // safari подгрузит последний чанк и песня включится,\n // при этом этот чанк нельзя руками отдать из SW, потому что браузер тогда теряется\n private handleSafariStreamable(media: HTMLMediaElement) {\n media.addEventListener('play', () => {\n /* if(media.readyState === 4) { // https://developer.mozilla.org/ru/docs/Web/API/XMLHttpRequest/readyState\n return;\n } */\n\n // media.volume = 0;\n const currentTime = media.currentTime;\n // this.setSafariBuffering(media, true);\n\n media.addEventListener('progress', () => {\n media.currentTime = media.duration - 1;\n\n media.addEventListener('progress', () => {\n media.currentTime = currentTime;\n // media.volume = 1;\n // this.setSafariBuffering(media, false);\n\n if(!media.paused) {\n media.play()/* .catch(() => {}) */;\n }\n }, {once: true});\n }, {once: true});\n }/* , {once: true} */);\n }\n\n public resolveWaitingForLoadMedia(peerId: PeerId, mid: number, isScheduled?: boolean) {\n const w = isScheduled ? this.waitingScheduledMediaForLoad : this.waitingMediaForLoad;\n const storage = w.get(peerId);\n if(!storage) {\n return;\n }\n\n const promise = storage.get(mid);\n if(promise) {\n promise.resolve();\n storage.delete(mid);\n\n if(!storage.size) {\n w.delete(peerId);\n }\n }\n }\n\n /**\n * Only for audio\n */\n public isSafariBuffering(media: HTMLMediaElement) {\n // @ts-ignore\n return !!media.safariBuffering;\n }\n\n private setSafariBuffering(media: HTMLMediaElement, value: boolean) {\n // @ts-ignore\n media.safariBuffering = value;\n }\n\n private async setNewMediadata(message: Message.message, playingMedia = this.playingMedia) {\n if(document.pictureInPictureElement) {\n return;\n }\n\n await onMediaLoad(playingMedia, undefined, false); // have to wait for load, otherwise on macOS won't set\n\n const doc = getMediaFromMessage(message, true) as MyDocument;\n\n const artwork: MediaImage[] = [];\n\n const isVoice = doc.type === 'voice' || doc.type === 'round';\n let title = '', artist = '';\n\n if(doc.thumbs?.length) {\n const size = doc.thumbs[doc.thumbs.length - 1];\n if(!(size as PhotoSize.photoStrippedSize).bytes) {\n const cacheContext = await this.managers.thumbsStorage.getCacheContext(doc, size.type);\n\n if(cacheContext.url) {\n artwork.push({\n src: cacheContext.url,\n sizes: `${(size as PhotoSize.photoSize).w}x${(size as PhotoSize.photoSize).h}`,\n type: 'image/jpeg'\n });\n } else {\n const download = appDownloadManager.downloadMediaURL({media: doc, thumb: size});\n download.then(() => {\n if(this.playingMedia !== playingMedia || !cacheContext.url) {\n return;\n }\n\n this.setNewMediadata(message);\n });\n }\n }\n } else if(isVoice) {\n const peerId = message.fromId || message.peerId;\n const peerPhoto = await this.managers.appPeersManager.getPeerPhoto(peerId);\n if(peerPhoto) {\n // const result = this.managers.appAvatarsManager.loadAvatar(peerId, peerPhoto, 'photo_small');\n // if(result.cached) {\n // const url = await result.loadPromise;\n // artwork.push({\n // src: url,\n // sizes: '160x160',\n // type: 'image/jpeg'\n // });\n // } else {\n // result.loadPromise.then((url) => {\n // if(this.playingMedia !== playingMedia || !url) {\n // return;\n // }\n\n // this.setNewMediadata(message);\n // });\n // }\n }\n\n title = await getPeerTitle({peerId, plainText: true, onlyFirstName: false});\n artist = I18n.format(doc.type === 'voice' ? 'AttachAudio' : 'AttachRound', true);\n }\n\n if(!isVoice) {\n const attribute = doc.attributes.find((attribute) => attribute._ === 'documentAttributeAudio') as DocumentAttribute.documentAttributeAudio;\n title = attribute?.title ?? doc.file_name;\n artist = attribute?.performer;\n }\n\n if(!artwork.length) {\n if(IS_APPLE) {\n if(IS_TOUCH_SUPPORTED) {\n artwork.push({\n src: `assets/img/apple-touch-icon-precomposed.png`,\n sizes: '180x180',\n type: 'image/png'\n });\n } else {\n artwork.push({\n src: `assets/img/apple-touch-icon.png`,\n sizes: '180x180',\n type: 'image/png'\n });\n }\n } else {\n [72, 96, 144, 192, 256, 384, 512].forEach((size) => {\n const sizes = `${size}x${size}`;\n artwork.push({\n src: `assets/img/android-chrome-${sizes}.png`,\n sizes,\n type: 'image/png'\n });\n });\n }\n }\n\n const metadata = new MediaMetadata({\n title,\n artist,\n artwork\n });\n\n navigator.mediaSession.metadata = metadata;\n }\n\n public setCurrentMediadata() {\n const {playingMedia} = this;\n if(!playingMedia) return;\n const message = this.getMessageByMedia(playingMedia);\n this.setNewMediadata(message, playingMedia);\n }\n\n private getMessageByMedia(media: HTMLMediaElement): Message.message {\n const details = this.mediaDetails.get(media);\n return details.message;\n // const {peerId, mid} = details;\n // const message = details.isScheduled ?\n // this.managers.appMessagesManager.getScheduledMessageByPeer(peerId, mid) :\n // this.managers.appMessagesManager.getMessageByPeer(peerId, mid);\n // return message;\n }\n\n public getPlayingDetails() {\n const {playingMedia} = this;\n if(!playingMedia) {\n return;\n }\n\n const message = this.getMessageByMedia(playingMedia);\n return {\n doc: getMediaFromMessage(message, true) as MyDocument,\n message,\n media: playingMedia,\n playbackParams: this.getPlaybackParams()\n };\n }\n\n private onPlay = (e?: Event) => {\n const media = e.target as HTMLMediaElement;\n const details = this.mediaDetails.get(media);\n const {peerId, mid} = details;\n\n // console.log('appMediaPlaybackController: video playing', this.currentPeerId, this.playingMedia, media);\n\n const pip = this.pip;\n if(pip) {\n pip.pause();\n }\n\n const message = this.getMessageByMedia(media);\n\n const previousMedia = this.playingMedia;\n if(previousMedia !== media) {\n this.stop();\n this.setMedia(media, message);\n\n const verify = (element: MediaItem) => element.mid === mid && element.peerId === peerId;\n const listLoader = this.listLoader;\n const current = listLoader.getCurrent();\n if(!current || !verify(current)) {\n let jumpLength: number;\n\n for(const withOtherSide of [false, true]) {\n const previous = listLoader.getPrevious(withOtherSide);\n\n let idx = previous.findIndex(verify);\n if(idx !== -1) {\n jumpLength = -(previous.length - idx);\n } else {\n const next = listLoader.getNext(withOtherSide);\n idx = next.findIndex(verify);\n if(idx !== -1) {\n jumpLength = idx + 1;\n }\n }\n\n if(jumpLength !== undefined) {\n break;\n }\n }\n\n if(jumpLength) {\n this.go(jumpLength, false);\n } else {\n this.setTargets({peerId, mid});\n }\n }\n }\n\n // audio_pause не успеет сработать без таймаута\n setTimeout(() => {\n if(this.playingMedia !== media) {\n return;\n }\n\n this.dispatchEvent('play', this.getPlayingDetails());\n this.pauseMediaInOtherTabs();\n }, 0);\n };\n\n private onPause = (e?: Event) => {\n /* const target = e.target as HTMLMediaElement;\n if(!isInDOM(target)) {\n this.container.append(target);\n target.play();\n return;\n } */\n\n // if(this.pip) {\n // this.pip.play();\n // }\n\n this.dispatchEvent('pause');\n };\n\n private onEnded = (e?: Event) => {\n if(e && !e.isTrusted) {\n return;\n }\n\n this.onPause(e);\n\n // console.log('on media end');\n\n const listLoader = this.listLoader;\n if(this.lockedSwitchers ||\n (!this.round && listLoader.current && !listLoader.next.length) ||\n !listLoader.getNext(true).length ||\n !this.next()) {\n this.stop();\n this.dispatchEvent('stop');\n }\n };\n\n public pauseMediaInOtherTabs() {\n this.skipMediaPlayEvent = true;\n rootScope.dispatchEvent('media_play');\n }\n\n // public get pip() {\n // return document.pictureInPictureElement as HTMLVideoElement;\n // }\n\n public toggle(play?: boolean, media = this.playingMedia) {\n if(!media) {\n return false;\n }\n\n if(play === undefined) {\n play = media.paused;\n }\n\n if(media.paused !== play) {\n return false;\n }\n\n if(play) {\n media.play();\n } else {\n media.pause();\n }\n\n return true;\n }\n\n public play = () => {\n return this.toggle(true);\n };\n\n public pause = () => {\n return this.toggle(false);\n };\n\n public stop = (media = this.playingMedia, force?: boolean) => {\n if(!media) {\n return false;\n }\n\n if(!media.paused) {\n media.pause();\n }\n\n media.currentTime = 0;\n simulateEvent(media, 'ended'); // ! important, will be used to hide controls for audio element\n\n if(media === this.playingMedia) {\n const details = this.mediaDetails.get(media);\n if(details?.clean) {\n media.src = '';\n const peerId = details.peerId;\n const s = details.isScheduled ? this.scheduled : this.media;\n const storage = s.get(peerId);\n if(storage) {\n storage.delete(details.mid);\n\n if(!storage.size) {\n s.delete(peerId);\n }\n }\n\n media.remove();\n\n this.mediaDetails.delete(media);\n }\n\n this.playingMedia = undefined;\n this.playingMediaType = undefined;\n }\n\n if(force) {\n this.dispatchEvent('stop');\n }\n\n return true;\n };\n\n public playItem = (item: MediaItem) => {\n const {peerId, mid} = item;\n const isScheduled = this.searchContext.isScheduled;\n const media = this.getMedia(peerId, mid, isScheduled);\n\n /* if(isSafari) {\n media.autoplay = true;\n } */\n\n media.play();\n\n setTimeout(() => {\n this.resolveWaitingForLoadMedia(peerId, mid, isScheduled);\n }, 0);\n };\n\n public go = (length: number, dispatchJump?: boolean) => {\n const listLoader = this.listLoader;\n if(this.lockedSwitchers || !listLoader) {\n return;\n }\n\n if(this.playingMediaType === 'audio') {\n return listLoader.goRound(length, dispatchJump);\n } else {\n return listLoader.go(length, dispatchJump);\n }\n };\n\n private bindBrowserCallback(cb: (video: HTMLVideoElement, details: MediaSessionActionDetails) => void) {\n const handler: MediaSessionActionHandler = (details) => {\n cb(this.pip, details);\n };\n\n return handler;\n }\n\n public browserPlay = this.bindBrowserCallback((video) => this.toggle(true, video));\n public browserPause = this.bindBrowserCallback((video) => this.toggle(false, video));\n public browserStop = this.bindBrowserCallback((video) => this.stop(video));\n public browserSeekBackward = this.bindBrowserCallback((video, details) => this.seekBackward(details, video));\n public browserSeekForward = this.bindBrowserCallback((video, details) => this.seekForward(details, video));\n public browserSeekTo = this.bindBrowserCallback((video, details) => this.seekTo(details, video));\n public browserNext = this.bindBrowserCallback((video) => video || this.next());\n public browserPrevious = this.bindBrowserCallback((video) => video ? this.seekToStart(video) : this.previous());\n\n public next = () => {\n return this.go(1);\n };\n\n public previous = () => {\n if(this.seekToStart(this.playingMedia)) {\n return;\n }\n\n return this.go(-1);\n };\n\n public seekToStart(media: HTMLMediaElement) {\n if(media?.currentTime > 5) {\n media.currentTime = 0;\n this.toggle(true, media);\n return true;\n }\n\n return false;\n }\n\n public willBePlayed(media: HTMLMediaElement) {\n this.willBePlayedMedia = media;\n }\n\n public setSearchContext(context: MediaSearchContext) {\n if(deepEqual(this.searchContext, context)) {\n return false;\n }\n\n this.searchContext = copy(context); // {_: type === 'audio' ? 'inputMessagesFilterMusic' : 'inputMessagesFilterRoundVoice'}\n return true;\n }\n\n public getSearchContext() {\n return this.searchContext;\n }\n\n public setTargets(current: MediaItem, prev?: MediaItem[], next?: MediaItem[]) {\n let listLoader = this.listLoader;\n if(!listLoader) {\n listLoader = this.listLoader = new SearchListLoader({\n loadCount: 10,\n loadWhenLeft: 5,\n processItem: (message: Message.message) => {\n this.addMedia(message, false);\n return {peerId: message.peerId, mid: message.mid};\n },\n onJump: (item, older) => {\n this.playItem(item);\n },\n onEmptied: () => {\n this.dispatchEvent('stop');\n this.stop();\n }\n });\n } else {\n listLoader.reset();\n }\n\n const reverse = this.searchContext.folderId !== undefined ? false : true;\n if(prev) {\n listLoader.setTargets(prev, next, reverse);\n } else {\n listLoader.reverse = reverse;\n }\n\n listLoader.setSearchContext(this.searchContext);\n listLoader.current = current;\n\n listLoader.load(true);\n listLoader.load(false);\n }\n\n private getPlaybackMediaTypeFromMessage(message: Message.message) {\n const doc = getMediaFromMessage(message, true) as MyDocument;\n let mediaType: PlaybackMediaType = 'audio';\n if(doc?.type) {\n if(doc.type === 'voice' || doc.type === 'round') {\n mediaType = 'voice';\n } else if(doc.type === 'video') {\n mediaType = 'video';\n }\n }\n\n return mediaType;\n }\n\n public setMedia(media: HTMLMediaElement, message: Message.message) {\n const mediaType = this.getPlaybackMediaTypeFromMessage(message);\n\n this._playbackRate = this.playbackRates[mediaType];\n\n this.playingMedia = media;\n this.playingMediaType = mediaType;\n this.playingMedia.volume = this.volume;\n this.playingMedia.muted = this.muted;\n this.playingMedia.playbackRate = this.playbackRate;\n\n if(mediaType === 'audio') {\n this.playingMedia.loop = this.loop;\n }\n\n if('mediaSession' in navigator) {\n this.setNewMediadata(message);\n }\n }\n\n public setSingleMedia(media?: HTMLMediaElement, message?: Message.message) {\n const playingMedia = this.playingMedia;\n\n const wasPlaying = this.pause();\n\n let onPlay: () => void;\n if(media) {\n onPlay = () => {\n const pip = this.pip;\n if(pip) {\n pip.pause();\n }\n\n this.pauseMediaInOtherTabs();\n };\n\n if(!media.paused) {\n onPlay();\n }\n\n media.addEventListener('play', onPlay);\n } else { // maybe it's voice recording\n this.pauseMediaInOtherTabs();\n }\n\n this.willBePlayed(undefined);\n if(media) this.setMedia(media, message);\n else this.playingMedia = undefined;\n this.toggleSwitchers(false);\n\n return (playPaused = wasPlaying) => {\n this.toggleSwitchers(true);\n\n if(playingMedia) {\n if(this.mediaDetails.get(playingMedia)) {\n this.setMedia(playingMedia, this.getMessageByMedia(playingMedia));\n } else {\n this.next() || this.previous();\n }\n }\n\n // If it's still not cleaned\n if(this.playingMedia === media) {\n this.playingMedia = undefined;\n this.playingMediaType = undefined;\n }\n\n if(media) {\n media.removeEventListener('play', onPlay);\n }\n\n // I don't remember what it was for\n // if(media && this.playingMedia === media) {\n // this.stop();\n // }\n\n if(playPaused) {\n this.play();\n }\n };\n }\n\n public toggleSwitchers(enabled: boolean) {\n this.lockedSwitchers = !enabled;\n }\n\n public setPictureInPicture(video: HTMLVideoElement) {\n this.pip = video;\n\n // let wasPlaying = this.pause();\n\n const listenerSetter = new ListenerSetter();\n listenerSetter.add(video)('leavepictureinpicture', () => {\n if(this.pip !== video) {\n return;\n }\n\n this.pip = undefined;\n // if(wasPlaying) {\n // this.play();\n // }\n\n listenerSetter.removeAll();\n }, {once: true});\n\n listenerSetter.add(video)('play', (e) => {\n if(this.playingMedia !== video) {\n this.pause();\n }\n\n this.pauseMediaInOtherTabs();\n // if(this.pause()) {\n // listenerSetter.add(video)('pause', () => {\n // this.play();\n // }, {once: true});\n // }\n });\n }\n}\n\nconst appMediaPlaybackController = new AppMediaPlaybackController();\nMOUNT_CLASS_TO.appMediaPlaybackController = appMediaPlaybackController;\nexport default appMediaPlaybackController;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../lib/appManagers/appDocsManager';\nimport MEDIA_MIME_TYPES_SUPPORTED from '../environment/mediaMimeTypesSupport';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport findUpTag from '../helpers/dom/findUpTag';\nimport setInnerHTML from '../helpers/dom/setInnerHTML';\nimport mediaSizes from '../helpers/mediaSizes';\nimport SearchListLoader from '../helpers/searchListLoader';\nimport {Message} from '../layer';\nimport appDownloadManager from '../lib/appManagers/appDownloadManager';\nimport appImManager from '../lib/appManagers/appImManager';\nimport {MyMessage} from '../lib/appManagers/appMessagesManager';\nimport {MyPhoto} from '../lib/appManagers/appPhotosManager';\nimport canSaveMessageMedia from '../lib/appManagers/utils/messages/canSaveMessageMedia';\nimport getMediaFromMessage from '../lib/appManagers/utils/messages/getMediaFromMessage';\nimport wrapRichText from '../lib/richTextProcessor/wrapRichText';\nimport {MediaSearchContext} from './appMediaPlaybackController';\nimport AppMediaViewerBase, {MEDIA_VIEWER_CLASSNAME} from './appMediaViewerBase';\nimport {ButtonMenuItemOptionsVerifiable} from './buttonMenu';\nimport PopupDeleteMessages from './popups/deleteMessages';\nimport PopupForward from './popups/forward';\nimport Scrollable from './scrollable';\nimport appSidebarRight from './sidebarRight';\nimport AppSharedMediaTab from './sidebarRight/tabs/sharedMedia';\n\ntype AppMediaViewerTargetType = {\n element: HTMLElement,\n mid: number,\n peerId: PeerId,\n message?: MyMessage\n};\nexport default class AppMediaViewer extends AppMediaViewerBase<'caption', 'delete' | 'forward', AppMediaViewerTargetType> {\n protected listLoader: SearchListLoader;\n protected btnMenuForward: ButtonMenuItemOptionsVerifiable;\n protected btnMenuDownload: ButtonMenuItemOptionsVerifiable;\n protected btnMenuDelete: ButtonMenuItemOptionsVerifiable;\n\n get searchContext() {\n return this.listLoader.searchContext;\n }\n\n constructor() {\n super(new SearchListLoader({\n processItem: (item) => {\n const isForDocument = this.searchContext.inputFilter._ === 'inputMessagesFilterDocument';\n const {mid, peerId} = item;\n const media = getMediaFromMessage(item, true);\n\n if(!media) return;\n\n if(isForDocument && !AppMediaViewer.isMediaCompatibleForDocumentViewer(media)) {\n return;\n }\n\n return {element: null as HTMLElement, mid, peerId};\n }\n }), ['delete', 'forward']);\n\n this.listLoader.onEmptied = () => {\n this.close();\n };\n\n /* const stub = document.createElement('div');\n stub.classList.add(MEDIA_VIEWER_CLASSNAME + '-stub');\n this.content.main.prepend(stub); */\n\n this.content.caption = document.createElement('div');\n this.content.caption.classList.add(MEDIA_VIEWER_CLASSNAME + '-caption', 'spoilers-container'/* , 'media-viewer-stub' */);\n\n let captionTimeout: number;\n const setCaptionTimeout = () => {\n if(captionTimeout) {\n clearTimeout(captionTimeout);\n }\n\n captionTimeout = window.setTimeout(() => {\n captionTimeout = undefined;\n this.content.caption.classList.remove('is-focused');\n }, 800);\n };\n this.content.caption.addEventListener('touchstart', () => {\n if(!mediaSizes.isMobile) return;\n\n this.content.caption.classList.add('is-focused');\n\n if(captionTimeout) {\n clearTimeout(captionTimeout);\n captionTimeout = undefined;\n }\n\n document.addEventListener('touchend', setCaptionTimeout, {once: true});\n });\n\n const captionScrollable = new Scrollable(this.content.caption);\n captionScrollable.onAdditionalScroll = setCaptionTimeout;\n\n // this.content.main.append(this.content.caption);\n this.wholeDiv.append(this.content.caption);\n\n attachClickEvent(this.buttons.delete, this.onDeleteClick);\n\n const buttons: ButtonMenuItemOptionsVerifiable[] = [this.btnMenuForward = {\n icon: 'forward',\n text: 'Forward',\n onClick: this.onForwardClick\n }, this.btnMenuDownload = {\n icon: 'download',\n text: 'MediaViewer.Context.Download',\n onClick: this.onDownloadClick\n }, this.btnMenuDelete = {\n icon: 'delete danger',\n text: 'Delete',\n onClick: this.onDeleteClick\n }];\n\n this.setBtnMenuToggle(buttons);\n\n // * constructing html end\n\n this.setListeners();\n }\n\n protected setListeners() {\n super.setListeners();\n attachClickEvent(this.buttons.forward, this.onForwardClick);\n attachClickEvent(this.author.container, this.onAuthorClick);\n\n const onCaptionClick = (e: MouseEvent) => {\n const a = findUpTag(e.target, 'A');\n if(a.classList.contains('timestamp')) {\n return;\n }\n\n const spoiler = findUpClassName(e.target, 'spoiler');\n if(a instanceof HTMLAnchorElement && (!spoiler || this.content.caption.classList.contains('is-spoiler-visible'))) { // close viewer if it's t.me/ redirect\n const onclick = a.getAttribute('onclick');\n if(!onclick || onclick.includes('showMaskedAlert')) {\n return;\n }\n\n cancelEvent(e);\n\n this.close().then(() => {\n this.content.caption.removeEventListener('click', onCaptionClick, {capture: true});\n a.click();\n });\n\n return false;\n }\n };\n\n this.content.caption.addEventListener('click', onCaptionClick, {capture: true});\n }\n\n /* public close(e?: MouseEvent) {\n const good = !this.setMoverAnimationPromise;\n const promise = super.close(e);\n\n if(good) { // clear\n this.currentMessageId = 0;\n this.peerId = 0;\n }\n\n return promise;\n } */\n\n protected getMessageByPeer(peerId: PeerId, mid: number) {\n return this.searchContext.isScheduled ? this.managers.appMessagesManager.getScheduledMessageByPeer(peerId, mid) : this.managers.appMessagesManager.getMessageByPeer(peerId, mid);\n }\n\n onPrevClick = async(target: AppMediaViewerTargetType) => {\n this.openMedia({\n message: await this.getMessageByPeer(target.peerId, target.mid),\n target: target.element,\n fromRight: -1\n });\n };\n\n onNextClick = async(target: AppMediaViewerTargetType) => {\n this.openMedia({\n message: await this.getMessageByPeer(target.peerId, target.mid),\n target: target.element,\n fromRight: 1\n });\n };\n\n onDeleteClick = () => {\n const target = this.target;\n new PopupDeleteMessages(target.peerId, [target.mid], 'chat', () => {\n this.target = {element: this.content.media} as any;\n this.close();\n });\n };\n\n onForwardClick = () => {\n const target = this.target;\n if(target.mid) {\n // appSidebarRight.forwardTab.open([target.mid]);\n new PopupForward({\n [target.peerId]: [target.mid]\n }, () => {\n return this.close();\n });\n }\n };\n\n onAuthorClick = async(e: MouseEvent) => {\n const {mid, peerId} = this.target;\n if(mid && mid !== Number.MAX_SAFE_INTEGER) {\n const threadId = this.searchContext.threadId;\n const message = await this.getMessageByPeer(peerId, mid);\n this.close(e)\n // .then(() => mediaSizes.isMobile ? appSidebarRight.sharedMediaTab.closeBtn.click() : Promise.resolve())\n .then(async() => {\n if(mediaSizes.isMobile) {\n const tab = appSidebarRight.getTab(AppSharedMediaTab);\n if(tab) {\n tab.close();\n }\n }\n\n appImManager.setInnerPeer({\n peerId: message.peerId,\n lastMsgId: mid,\n type: threadId ? 'discussion' : undefined,\n threadId\n });\n });\n }\n };\n\n onDownloadClick = () => {\n const {message} = this.target;\n const media = getMediaFromMessage(message, true);\n if(!media) return;\n appDownloadManager.downloadToDisc({media, queueId: appImManager.chat.bubbles.lazyLoadQueue.queueId});\n };\n\n private setCaption(message: MyMessage) {\n const caption = (message as Message.message).message;\n let html: Parameters[1] = '';\n if(caption) {\n const media = getMediaFromMessage(message, true);\n\n html = wrapRichText(caption, {\n entities: (message as Message.message).totalEntities,\n maxMediaTimestamp: ((media as MyDocument)?.type === 'video' && (media as MyDocument).duration) || undefined\n });\n }\n\n // html = 'Dandelion are a family of flowering plants that grow in many parts of the world.';\n setInnerHTML(this.content.caption.firstElementChild, html);\n this.content.caption.classList.toggle('hide', !caption);\n // this.content.container.classList.toggle('with-caption', !!caption);\n }\n\n public setSearchContext(context: MediaSearchContext) {\n this.listLoader.setSearchContext(context);\n\n return this;\n }\n\n public async openMedia({\n message,\n target,\n fromRight = 0,\n reverse = false,\n prevTargets = [],\n nextTargets = [],\n mediaTimestamp\n }: {\n message: MyMessage,\n target?: HTMLElement,\n fromRight?: number,\n reverse?: boolean,\n prevTargets?: AppMediaViewerTargetType[],\n nextTargets?: AppMediaViewerTargetType[],\n mediaTimestamp?: number\n /* , needLoadMore = true */\n }) {\n if(this.setMoverPromise) return this.setMoverPromise;\n\n const mid = message.mid;\n const fromId = (message as Message.message).fwd_from && !message.fromId ? (message as Message.message).fwd_from.from_name : message.fromId;\n const media = getMediaFromMessage(message, true);\n\n const noForwards = await this.managers.appPeersManager.noForwards(message.peerId);\n const isServiceMessage = message._ === 'messageService';\n const cantForwardMessage = isServiceMessage || !(await this.managers.appMessagesManager.canForward(message));\n const cantDownloadMessage = (isServiceMessage ? noForwards : cantForwardMessage) || !canSaveMessageMedia(message);\n const a: [(HTMLElement | ButtonMenuItemOptionsVerifiable)[], boolean][] = [\n [[this.buttons.forward, this.btnMenuForward], cantForwardMessage],\n [[this.buttons.download, this.btnMenuDownload], cantDownloadMessage],\n [[this.buttons.delete, this.btnMenuDelete], !(await this.managers.appMessagesManager.canDeleteMessage(message))]\n ];\n\n a.forEach(([buttons, hide]) => {\n buttons.forEach((button) => {\n if(button instanceof HTMLElement) {\n button.classList.toggle('hide', hide);\n } else {\n button.verify = () => !hide;\n }\n });\n });\n\n this.wholeDiv.classList.toggle('no-forwards', cantDownloadMessage);\n\n this.setCaption(message);\n const promise = super._openMedia({\n media: media as MyPhoto | MyDocument,\n timestamp: message.date,\n fromId,\n fromRight,\n target,\n reverse,\n prevTargets,\n nextTargets,\n message,\n mediaTimestamp\n /* , needLoadMore */\n });\n this.target.mid = mid;\n this.target.peerId = message.peerId;\n this.target.message = message;\n\n return promise;\n }\n\n public static isMediaCompatibleForDocumentViewer(media: MyPhoto | MyDocument) {\n return media._ === 'photo' || MEDIA_MIME_TYPES_SUPPORTED.has(media.mime_type);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appMediaPlaybackController from '../components/appMediaPlaybackController';\nimport {IS_APPLE_MOBILE, IS_MOBILE} from '../environment/userAgent';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport ListenerSetter, {Listener} from '../helpers/listenerSetter';\nimport {ButtonMenuSync} from '../components/buttonMenu';\nimport {ButtonMenuToggleHandler} from '../components/buttonMenuToggle';\nimport ControlsHover from '../helpers/dom/controlsHover';\nimport {addFullScreenListener, cancelFullScreen, isFullScreen, requestFullScreen} from '../helpers/dom/fullScreen';\nimport toHHMMSS from '../helpers/string/toHHMMSS';\nimport MediaProgressLine from '../components/mediaProgressLine';\nimport VolumeSelector from '../components/volumeSelector';\nimport debounce from '../helpers/schedulers/debounce';\nimport overlayCounter from '../helpers/overlayCounter';\nimport onMediaLoad from '../helpers/onMediaLoad';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\n\nexport default class VideoPlayer extends ControlsHover {\n private static PLAYBACK_RATES = [0.5, 1, 1.5, 2];\n private static PLAYBACK_RATES_ICONS = ['playback_05', 'playback_1x', 'playback_15', 'playback_2x'];\n\n protected video: HTMLVideoElement;\n protected wrapper: HTMLDivElement;\n protected progress: MediaProgressLine;\n protected skin: 'default';\n\n protected listenerSetter: ListenerSetter;\n protected playbackRateButton: HTMLElement;\n protected pipButton: HTMLElement;\n\n /* protected videoParent: HTMLElement;\n protected videoWhichChild: number; */\n\n protected onPlaybackRackMenuToggle?: (open: boolean) => void;\n protected onPip?: (pip: boolean) => void;\n protected onPipClose?: () => void;\n\n constructor({\n video,\n play = false,\n streamable = false,\n duration,\n onPlaybackRackMenuToggle,\n onPip,\n onPipClose\n }: {\n video: HTMLVideoElement,\n play?: boolean,\n streamable?: boolean,\n duration?: number,\n onPlaybackRackMenuToggle?: VideoPlayer['onPlaybackRackMenuToggle'],\n onPip?: VideoPlayer['onPip'],\n onPipClose?: VideoPlayer['onPipClose']\n }) {\n super();\n\n this.video = video;\n this.wrapper = document.createElement('div');\n this.wrapper.classList.add('ckin__player');\n\n this.onPlaybackRackMenuToggle = onPlaybackRackMenuToggle;\n this.onPip = onPip;\n this.onPipClose = onPipClose;\n\n this.listenerSetter = new ListenerSetter();\n\n this.setup({\n element: this.wrapper,\n listenerSetter: this.listenerSetter,\n canHideControls: () => {\n return !this.video.paused && (!this.playbackRateButton || !this.playbackRateButton.classList.contains('menu-open'));\n },\n showOnLeaveToClassName: 'media-viewer-caption',\n ignoreClickClassName: 'ckin__controls'\n });\n\n video.parentNode.insertBefore(this.wrapper, video);\n this.wrapper.appendChild(video);\n\n this.skin = 'default';\n\n this.stylePlayer(duration);\n this.setBtnMenuToggle();\n\n if(this.skin === 'default') {\n const controls = this.wrapper.querySelector('.default__controls.ckin__controls') as HTMLDivElement;\n this.progress = new MediaProgressLine({\n onSeekStart: () => {\n this.wrapper.classList.add('is-seeking');\n },\n onSeekEnd: () => {\n this.wrapper.classList.remove('is-seeking');\n }\n });\n this.progress.setMedia({\n media: video,\n streamable,\n duration\n });\n controls.prepend(this.progress.container);\n }\n\n if(play/* && video.paused */) {\n const promise = video.play();\n promise.catch((err: Error) => {\n if(err.name === 'NotAllowedError') {\n video.muted = true;\n video.autoplay = true;\n video.play();\n }\n }).finally(() => { // due to autoplay, play will not call\n this.wrapper.classList.toggle('is-playing', !this.video.paused);\n });\n }\n }\n\n private stylePlayer(initDuration: number) {\n const {wrapper, video, skin, listenerSetter} = this;\n\n wrapper.classList.add(skin);\n\n const html = this.buildControls();\n wrapper.insertAdjacentHTML('beforeend', html);\n let timeDuration: HTMLElement;\n\n if(skin === 'default') {\n this.playbackRateButton = this.wrapper.querySelector('.playback-rate') as HTMLElement;\n this.pipButton = this.wrapper.querySelector('.pip') as HTMLElement;\n\n const toggle = wrapper.querySelectorAll('.toggle') as NodeListOf;\n const fullScreenButton = wrapper.querySelector('.fullscreen') as HTMLElement;\n const timeElapsed = wrapper.querySelector('#time-elapsed');\n timeDuration = wrapper.querySelector('#time-duration') as HTMLElement;\n timeDuration.textContent = toHHMMSS(video.duration | 0);\n\n const volumeSelector = new VolumeSelector(listenerSetter);\n\n const leftControls = wrapper.querySelector('.left-controls');\n volumeSelector.btn.classList.remove('btn-icon');\n leftControls.insertBefore(volumeSelector.btn, timeElapsed.parentElement);\n\n Array.from(toggle).forEach((button) => {\n attachClickEvent(button, () => {\n this.togglePlay();\n }, {listenerSetter: this.listenerSetter});\n });\n\n if(this.pipButton) {\n attachClickEvent(this.pipButton, () => {\n this.video.requestPictureInPicture();\n }, {listenerSetter: this.listenerSetter});\n\n const onPip = (pip: boolean) => {\n this.wrapper.style.visibility = pip ? 'hidden': '';\n if(this.onPip) {\n this.onPip(pip);\n }\n };\n\n const debounceTime = 20;\n const debouncedPip = debounce(onPip, debounceTime, false, true);\n\n listenerSetter.add(video)('enterpictureinpicture', () => {\n debouncedPip(true);\n\n listenerSetter.add(video)('leavepictureinpicture', () => {\n const onPause = () => {\n clearTimeout(timeout);\n if(this.onPipClose) {\n this.onPipClose();\n }\n };\n const listener = listenerSetter.add(video)('pause', onPause, {once: true}) as any as Listener;\n const timeout = setTimeout(() => {\n listenerSetter.remove(listener);\n }, debounceTime);\n }, {once: true});\n });\n\n listenerSetter.add(video)('leavepictureinpicture', () => {\n debouncedPip(false);\n });\n }\n\n if(!IS_TOUCH_SUPPORTED) {\n attachClickEvent(video, () => {\n this.togglePlay();\n }, {listenerSetter: this.listenerSetter});\n\n listenerSetter.add(document)('keydown', (e: KeyboardEvent) => {\n if(overlayCounter.overlaysActive > 1 || document.pictureInPictureElement === video) { // forward popup is active, etc\n return;\n }\n\n const {key, code} = e;\n\n let good = true;\n if(code === 'KeyF') {\n this.toggleFullScreen();\n } else if(code === 'KeyM') {\n appMediaPlaybackController.muted = !appMediaPlaybackController.muted;\n } else if(code === 'Space') {\n this.togglePlay();\n } else if(e.altKey && (code === 'Equal' || code === 'Minus')) {\n const add = code === 'Equal' ? 1 : -1;\n const playbackRate = appMediaPlaybackController.playbackRate;\n const idx = VideoPlayer.PLAYBACK_RATES.indexOf(playbackRate);\n const nextIdx = idx + add;\n if(nextIdx >= 0 && nextIdx < VideoPlayer.PLAYBACK_RATES.length) {\n appMediaPlaybackController.playbackRate = VideoPlayer.PLAYBACK_RATES[nextIdx];\n }\n } else if(wrapper.classList.contains('ckin__fullscreen') && (key === 'ArrowLeft' || key === 'ArrowRight')) {\n if(key === 'ArrowLeft') appMediaPlaybackController.seekBackward({action: 'seekbackward'});\n else appMediaPlaybackController.seekForward({action: 'seekforward'});\n } else {\n good = false;\n }\n\n if(good) {\n cancelEvent(e);\n return false;\n }\n });\n }\n\n listenerSetter.add(video)('dblclick', () => {\n if(!IS_TOUCH_SUPPORTED) {\n this.toggleFullScreen();\n }\n });\n\n attachClickEvent(fullScreenButton, () => {\n this.toggleFullScreen();\n }, {listenerSetter: this.listenerSetter});\n\n addFullScreenListener(wrapper, this.onFullScreen.bind(this, fullScreenButton), listenerSetter);\n\n listenerSetter.add(video)('timeupdate', () => {\n timeElapsed.textContent = toHHMMSS(video.currentTime | 0);\n });\n\n listenerSetter.add(video)('play', () => {\n wrapper.classList.add('played');\n\n if(!IS_TOUCH_SUPPORTED) {\n listenerSetter.add(video)('play', () => {\n this.hideControls(true);\n });\n }\n }, {once: true});\n\n listenerSetter.add(video)('pause', () => {\n this.showControls(false);\n });\n\n listenerSetter.add(appMediaPlaybackController)('playbackParams', () => {\n this.setPlaybackRateIcon();\n });\n }\n\n listenerSetter.add(video)('play', () => {\n wrapper.classList.add('is-playing');\n });\n\n listenerSetter.add(video)('pause', () => {\n wrapper.classList.remove('is-playing');\n });\n\n if(video.duration || initDuration) {\n timeDuration.textContent = toHHMMSS(Math.round(video.duration || initDuration));\n } else {\n onMediaLoad(video).then(() => {\n timeDuration.textContent = toHHMMSS(Math.round(video.duration));\n });\n }\n }\n\n protected togglePlay(isPaused = this.video.paused) {\n this.video[isPaused ? 'play' : 'pause']();\n }\n\n private buildControls() {\n const skin = this.skin;\n if(skin === 'default') {\n return `\n \n
\n
\n
\n
\n \n
\n \n / \n \n
\n
\n
\n \n ${!IS_MOBILE && document.pictureInPictureEnabled ? `` : ''}\n \n
\n
\n
`;\n }\n }\n\n protected setBtnMenuToggle() {\n const buttons: Parameters[0]['buttons'] = VideoPlayer.PLAYBACK_RATES.map((rate, idx) => {\n return {\n // icon: VideoPlayer.PLAYBACK_RATES_ICONS[idx],\n regularText: rate + 'x',\n onClick: () => {\n appMediaPlaybackController.playbackRate = rate;\n }\n };\n });\n const btnMenu = ButtonMenuSync({buttons});\n btnMenu.classList.add('top-left');\n ButtonMenuToggleHandler({\n el: this.playbackRateButton,\n onOpen: this.onPlaybackRackMenuToggle ? () => {\n this.onPlaybackRackMenuToggle(true);\n } : undefined,\n onClose: this.onPlaybackRackMenuToggle ? () => {\n this.onPlaybackRackMenuToggle(false);\n } : undefined\n });\n this.playbackRateButton.append(btnMenu);\n\n this.setPlaybackRateIcon();\n }\n\n protected setPlaybackRateIcon() {\n const playbackRateButton = this.playbackRateButton;\n VideoPlayer.PLAYBACK_RATES_ICONS.forEach((className) => {\n className = 'tgico-' + className;\n playbackRateButton.classList.remove(className);\n });\n\n let idx = VideoPlayer.PLAYBACK_RATES.indexOf(appMediaPlaybackController.playbackRate);\n if(idx === -1) idx = VideoPlayer.PLAYBACK_RATES.indexOf(1);\n\n playbackRateButton.classList.add('tgico-' + VideoPlayer.PLAYBACK_RATES_ICONS[idx]);\n }\n\n protected toggleFullScreen() {\n const player = this.wrapper;\n\n // * https://caniuse.com/#feat=fullscreen\n if(IS_APPLE_MOBILE) {\n const video = this.video as any;\n video.webkitEnterFullscreen();\n video.enterFullscreen();\n return;\n }\n\n if(!isFullScreen()) {\n /* const videoParent = this.video.parentElement;\n const videoWhichChild = whichChild(this.video);\n const needVideoRemount = videoParent !== player;\n\n if(needVideoRemount) {\n this.videoParent = videoParent;\n this.videoWhichChild = videoWhichChild;\n player.prepend(this.video);\n } */\n\n requestFullScreen(player);\n } else {\n /* if(this.videoParent) {\n const {videoWhichChild, videoParent} = this;\n if(!videoWhichChild) {\n videoParent.prepend(this.video);\n } else {\n videoParent.insertBefore(this.video, videoParent.children[videoWhichChild]);\n }\n\n this.videoParent = null;\n this.videoWhichChild = -1;\n } */\n\n cancelFullScreen();\n }\n }\n\n protected onFullScreen(fullScreenButton: HTMLElement) {\n const isFull = isFullScreen();\n this.wrapper.classList.toggle('ckin__fullscreen', isFull);\n if(!isFull) {\n fullScreenButton.classList.remove('tgico-smallscreen');\n fullScreenButton.classList.add('tgico-fullscreen');\n fullScreenButton.setAttribute('title', 'Full Screen');\n } else {\n fullScreenButton.classList.remove('tgico-fullscreen');\n fullScreenButton.classList.add('tgico-smallscreen');\n fullScreenButton.setAttribute('title', 'Exit Full Screen');\n }\n }\n\n public setTimestamp(timestamp: number) {\n this.video.currentTime = timestamp;\n this.togglePlay(true);\n }\n\n public cleanup() {\n super.cleanup();\n this.listenerSetter.removeAll();\n this.progress.removeListeners();\n this.onPlaybackRackMenuToggle = this.onPip = undefined;\n }\n}\n","export default function isBetween(num: number, min: number, max: number) {\n return num >= min && num <= max;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// * zoom part from WebZ\n// * https://github.com/Ajaxy/telegram-tt/blob/069f4f5b2f2c7c22529ccced876842e7f9cb81f4/src/components/mediaViewer/MediaViewerSlides.tsx\n\nimport type {MyDocument} from '../lib/appManagers/appDocsManager';\nimport type {MyPhoto} from '../lib/appManagers/appPhotosManager';\nimport deferredPromise from '../helpers/cancellablePromise';\nimport mediaSizes from '../helpers/mediaSizes';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport {IS_MOBILE, IS_MOBILE_SAFARI, IS_SAFARI} from '../environment/userAgent';\nimport {logger} from '../lib/logger';\nimport VideoPlayer from '../lib/mediaPlayer';\nimport rootScope from '../lib/rootScope';\nimport animationIntersector from './animationIntersector';\nimport appMediaPlaybackController, {AppMediaPlaybackController} from './appMediaPlaybackController';\nimport AvatarElement from './avatar';\nimport ButtonIcon from './buttonIcon';\nimport {ButtonMenuItemOptions} from './buttonMenu';\nimport ButtonMenuToggle from './buttonMenuToggle';\nimport ProgressivePreloader from './preloader';\nimport SwipeHandler, {ZoomDetails} from './swipeHandler';\nimport {formatFullSentTime} from '../helpers/date';\nimport appNavigationController, {NavigationItem} from './appNavigationController';\nimport {Message, PhotoSize} from '../layer';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport renderImageFromUrl, {renderImageFromUrlPromise} from '../helpers/dom/renderImageFromUrl';\nimport getVisibleRect from '../helpers/dom/getVisibleRect';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport fillPropertyValue from '../helpers/fillPropertyValue';\nimport generatePathData from '../helpers/generatePathData';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport {doubleRaf, fastRaf} from '../helpers/schedulers';\nimport RangeSelector from './rangeSelector';\nimport windowSize from '../helpers/windowSize';\nimport ListLoader from '../helpers/listLoader';\nimport EventListenerBase from '../helpers/eventListenerBase';\nimport {MyMessage} from '../lib/appManagers/appMessagesManager';\nimport {NULL_PEER_ID} from '../lib/mtproto/mtproto_config';\nimport {isFullScreen} from '../helpers/dom/fullScreen';\nimport {attachClickEvent, hasMouseMovedSinceDown} from '../helpers/dom/clickEvent';\nimport SearchListLoader from '../helpers/searchListLoader';\nimport createVideo from '../helpers/dom/createVideo';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport getStrippedThumbIfNeeded from '../helpers/getStrippedThumbIfNeeded';\nimport setAttachmentSize from '../helpers/setAttachmentSize';\nimport wrapEmojiText from '../lib/richTextProcessor/wrapEmojiText';\nimport LazyLoadQueueBase from './lazyLoadQueueBase';\nimport overlayCounter from '../helpers/overlayCounter';\nimport appDownloadManager from '../lib/appManagers/appDownloadManager';\nimport wrapPeerTitle from './wrappers/peerTitle';\nimport {toastNew} from './toast';\nimport clamp from '../helpers/number/clamp';\nimport debounce from '../helpers/schedulers/debounce';\nimport isBetween from '../helpers/number/isBetween';\nimport findUpAsChild from '../helpers/dom/findUpAsChild';\nimport liteMode from '../helpers/liteMode';\n\nconst ZOOM_STEP = 0.5;\nconst ZOOM_INITIAL_VALUE = 1;\nconst ZOOM_MIN_VALUE = 0.5;\nconst ZOOM_MAX_VALUE = 4;\n\nexport const MEDIA_VIEWER_CLASSNAME = 'media-viewer';\n\ntype Transform = {\n x: number;\n y: number;\n scale: number;\n};\n\nexport default class AppMediaViewerBase<\n ContentAdditionType extends string,\n ButtonsAdditionType extends string,\n TargetType extends {element: HTMLElement\n}> extends EventListenerBase<{\n setMoverBefore: () => void,\n setMoverAfter: () => void\n}> {\n protected wholeDiv: HTMLElement;\n protected overlaysDiv: HTMLElement;\n protected author: {[k in 'container' | 'avatarEl' | 'nameEl' | 'date']: HTMLElement} = {} as any;\n protected content: {[k in 'main' | 'container' | 'media' | 'mover' | ContentAdditionType]: HTMLElement} = {} as any;\n protected buttons: {[k in 'download' | 'close' | 'prev' | 'next' | 'mobile-close' | 'zoom' | ButtonsAdditionType]: HTMLElement} = {} as any;\n protected topbar: HTMLElement;\n protected moversContainer: HTMLElement;\n\n protected tempId = 0;\n protected preloader: ProgressivePreloader = null;\n protected preloaderStreamable: ProgressivePreloader = null;\n\n protected log: ReturnType;\n\n protected isFirstOpen = true;\n\n protected pageEl = document.getElementById('page-chats') as HTMLDivElement;\n\n protected setMoverPromise: Promise;\n protected setMoverAnimationPromise: Promise;\n\n protected lazyLoadQueue: LazyLoadQueueBase;\n\n protected highlightSwitchersTimeout: number;\n\n protected onDownloadClick: (e: MouseEvent) => void;\n protected onPrevClick: (target: TargetType) => void;\n protected onNextClick: (target: TargetType) => void;\n\n protected videoPlayer: VideoPlayer;\n\n protected zoomElements: {\n container: HTMLElement,\n btnOut: HTMLElement,\n btnIn: HTMLElement,\n rangeSelector: RangeSelector\n } = {} as any;\n protected transform: Transform = {x: 0, y: 0, scale: ZOOM_INITIAL_VALUE};\n protected isZooming: boolean;\n protected isGesturingNow: boolean;\n protected isZoomingNow: boolean;\n protected draggingType: 'wheel' | 'touchmove' | 'mousemove';\n protected initialContentRect: DOMRect;\n\n protected ctrlKeyDown: boolean;\n protected releaseSingleMedia: ReturnType;\n protected navigationItem: NavigationItem;\n\n protected managers: AppManagers;\n protected swipeHandler: SwipeHandler;\n protected closing: boolean;\n\n protected lastTransform: Transform = this.transform;\n protected lastZoomCenter: {x: number, y: number} = this.transform;\n protected lastDragOffset: {x: number, y: number} = this.transform;\n protected lastDragDelta: {x: number, y: number} = this.transform;\n protected lastGestureTime: number;\n protected clampZoomDebounced: ReturnType void>>;\n protected ignoreNextClick: boolean;\n\n get target() {\n return this.listLoader.current;\n }\n\n set target(value) {\n this.listLoader.current = value;\n }\n\n constructor(\n protected listLoader: ListLoader,\n topButtons: Array['buttons']>\n ) {\n super(false);\n\n this.managers = rootScope.managers;\n\n this.log = logger('AMV');\n this.preloader = new ProgressivePreloader();\n this.preloaderStreamable = new ProgressivePreloader({\n cancelable: false,\n streamable: true\n });\n this.preloader.construct();\n this.preloaderStreamable.construct();\n this.lazyLoadQueue = new LazyLoadQueueBase();\n\n this.wholeDiv = document.createElement('div');\n this.wholeDiv.classList.add(MEDIA_VIEWER_CLASSNAME + '-whole');\n\n this.overlaysDiv = document.createElement('div');\n this.overlaysDiv.classList.add('overlays');\n\n const mainDiv = document.createElement('div');\n mainDiv.classList.add(MEDIA_VIEWER_CLASSNAME);\n\n const topbar = this.topbar = document.createElement('div');\n topbar.classList.add(MEDIA_VIEWER_CLASSNAME + '-topbar', MEDIA_VIEWER_CLASSNAME + '-appear');\n\n const topbarLeft = document.createElement('div');\n topbarLeft.classList.add(MEDIA_VIEWER_CLASSNAME + '-topbar-left');\n\n this.buttons['mobile-close'] = ButtonIcon('close', {onlyMobile: true});\n\n // * author\n this.author.container = document.createElement('div');\n this.author.container.classList.add(MEDIA_VIEWER_CLASSNAME + '-author', 'no-select');\n const authorRight = document.createElement('div');\n\n this.author.avatarEl = new AvatarElement();\n this.author.avatarEl.classList.add(MEDIA_VIEWER_CLASSNAME + '-userpic', 'avatar-44');\n\n this.author.nameEl = document.createElement('div');\n this.author.nameEl.classList.add(MEDIA_VIEWER_CLASSNAME + '-name');\n\n this.author.date = document.createElement('div');\n this.author.date.classList.add(MEDIA_VIEWER_CLASSNAME + '-date');\n\n authorRight.append(this.author.nameEl, this.author.date);\n\n this.author.container.append(this.author.avatarEl, authorRight);\n\n // * buttons\n const buttonsDiv = document.createElement('div');\n buttonsDiv.classList.add(MEDIA_VIEWER_CLASSNAME + '-buttons');\n\n topButtons.concat(['download', 'zoom', 'close']).forEach((name) => {\n const button = ButtonIcon(name, {noRipple: true});\n this.buttons[name] = button;\n buttonsDiv.append(button);\n });\n\n this.buttons.zoom.classList.add('zoom-in');\n\n // * zoom\n this.zoomElements.container = document.createElement('div');\n this.zoomElements.container.classList.add('zoom-container');\n\n this.zoomElements.btnOut = ButtonIcon('zoomout', {noRipple: true});\n attachClickEvent(this.zoomElements.btnOut, () => this.addZoomStep(false));\n this.zoomElements.btnIn = ButtonIcon('zoomin', {noRipple: true});\n attachClickEvent(this.zoomElements.btnIn, () => this.addZoomStep(true));\n\n this.zoomElements.rangeSelector = new RangeSelector({\n step: 0.01,\n min: ZOOM_MIN_VALUE,\n max: ZOOM_MAX_VALUE,\n withTransition: true\n }, ZOOM_INITIAL_VALUE);\n this.zoomElements.rangeSelector.setListeners();\n this.zoomElements.rangeSelector.setHandlers({\n onScrub: (value) => {\n const add = value - this.transform.scale;\n this.addZoom(add);\n this.clampZoomDebounced?.clearTimeout();\n },\n onMouseDown: () => {\n this.onSwipeFirst();\n },\n onMouseUp: () => {\n this.onSwipeReset();\n }\n });\n\n this.zoomElements.container.append(this.zoomElements.btnOut, this.zoomElements.rangeSelector.container, this.zoomElements.btnIn);\n\n if(!IS_TOUCH_SUPPORTED) {\n this.wholeDiv.append(this.zoomElements.container);\n }\n\n // * content\n this.content.main = document.createElement('div');\n this.content.main.classList.add(MEDIA_VIEWER_CLASSNAME + '-content');\n\n this.content.container = document.createElement('div');\n this.content.container.classList.add(MEDIA_VIEWER_CLASSNAME + '-container');\n\n this.content.media = document.createElement('div');\n this.content.media.classList.add(MEDIA_VIEWER_CLASSNAME + '-media');\n\n this.content.container.append(this.content.media);\n\n this.content.main.append(this.content.container);\n mainDiv.append(this.content.main);\n this.overlaysDiv.append(mainDiv);\n // * overlays end\n\n topbarLeft.append(this.buttons['mobile-close'], this.author.container);\n topbar.append(topbarLeft, buttonsDiv);\n\n this.buttons.prev = document.createElement('div');\n this.buttons.prev.className = `${MEDIA_VIEWER_CLASSNAME}-switcher ${MEDIA_VIEWER_CLASSNAME}-switcher-left`;\n this.buttons.prev.innerHTML = ``;\n\n this.buttons.next = document.createElement('div');\n this.buttons.next.className = `${MEDIA_VIEWER_CLASSNAME}-switcher ${MEDIA_VIEWER_CLASSNAME}-switcher-right`;\n this.buttons.next.innerHTML = ``;\n\n this.moversContainer = document.createElement('div');\n this.moversContainer.classList.add(MEDIA_VIEWER_CLASSNAME + '-movers');\n\n this.moversContainer.append(this.buttons.prev, this.buttons.next);\n\n this.wholeDiv.append(this.overlaysDiv, /* this.buttons.prev, this.buttons.next, */ this.topbar, this.moversContainer);\n\n // * constructing html end\n\n this.listLoader.onLoadedMore = () => {\n this.buttons.prev.classList.toggle('hide', !this.listLoader.previous.length);\n this.buttons.next.classList.toggle('hide', !this.listLoader.next.length);\n };\n\n this.setNewMover();\n }\n\n protected setListeners() {\n attachClickEvent(this.buttons.download, this.onDownloadClick);\n [this.buttons.close, this.buttons['mobile-close'], this.preloaderStreamable.preloader].forEach((el) => {\n attachClickEvent(el, this.close.bind(this));\n });\n\n ([[-1, this.buttons.prev], [1, this.buttons.next]] as [number, HTMLElement][]).forEach(([moveLength, button]) => {\n // attachClickEvent(button, (e) => {\n button.addEventListener('click', (e) => {\n cancelEvent(e);\n if(this.setMoverPromise) return;\n\n this.listLoader.go(moveLength);\n });\n });\n\n attachClickEvent(this.buttons.zoom, () => {\n if(this.isZooming) this.resetZoom();\n else {\n this.addZoomStep(true);\n }\n });\n\n // ! cannot use the function because it'll cancel slide event on touch devices\n // attachClickEvent(this.wholeDiv, this.onClick);\n this.wholeDiv.addEventListener('click', this.onClick);\n\n this.listLoader.onJump = (item, older) => {\n if(older) this.onNextClick(item);\n else this.onPrevClick(item);\n };\n\n const adjustPosition = (xDiff: number, yDiff: number) => {\n const [x, y] = [xDiff - this.lastDragOffset.x, yDiff - this.lastDragOffset.y];\n const [transform, inBoundsX, inBoundsY] = this.calculateOffsetBoundaries({\n x: this.transform.x + x,\n y: this.transform.y + y,\n scale: this.transform.scale\n });\n\n this.lastDragDelta = {\n x,\n y\n };\n\n this.lastDragOffset = {\n x: xDiff,\n y: yDiff\n };\n\n this.setTransform(transform);\n\n return {inBoundsX, inBoundsY};\n };\n\n const setLastGestureTime = debounce(() => {\n this.lastGestureTime = Date.now();\n }, 500, false, true);\n\n this.clampZoomDebounced = debounce(() => {\n this.onSwipeReset();\n }, 300, false, true);\n\n this.swipeHandler = new SwipeHandler({\n element: this.wholeDiv,\n onReset: this.onSwipeReset,\n onFirstSwipe: this.onSwipeFirst as any,\n onSwipe: (xDiff, yDiff, e, cancelDrag) => {\n if(isFullScreen()) {\n return;\n }\n\n if(this.isZooming && !this.isZoomingNow) {\n setLastGestureTime();\n\n this.draggingType = e.type as any;\n const {inBoundsX, inBoundsY} = adjustPosition(xDiff, yDiff);\n cancelDrag?.(!inBoundsX, !inBoundsY);\n\n return;\n }\n\n if(this.isZoomingNow || !IS_TOUCH_SUPPORTED) {\n return;\n }\n\n const percents = Math.abs(xDiff) / windowSize.width;\n if(percents > .2 || Math.abs(xDiff) > 125) {\n if(xDiff > 0) {\n this.buttons.prev.click();\n } else {\n this.buttons.next.click();\n }\n\n return true;\n }\n\n const percentsY = Math.abs(yDiff) / windowSize.height;\n if(percentsY > .2 || Math.abs(yDiff) > 125) {\n this.close();\n return true;\n }\n\n return false;\n },\n onZoom: this.onZoom,\n onDoubleClick: ({centerX, centerY}) => {\n if(this.isZooming) {\n this.resetZoom();\n } else {\n const scale = ZOOM_INITIAL_VALUE + 2;\n this.changeZoomByPosition(centerX, centerY, scale);\n }\n },\n verifyTouchTarget: (e) => {\n // * Fix for seek input\n if(isFullScreen() ||\n findUpAsChild(e.target as HTMLElement, this.zoomElements.container) ||\n findUpClassName(e.target, 'ckin__controls') ||\n findUpClassName(e.target, 'media-viewer-caption') ||\n (findUpClassName(e.target, 'media-viewer-topbar') && e.type !== 'wheel')) {\n return false;\n }\n\n return true;\n },\n cursor: ''\n // cursor: 'move'\n });\n }\n\n protected onSwipeFirst = (e?: MouseEvent | TouchEvent | WheelEvent) => {\n this.lastDragOffset = this.lastDragDelta = {x: 0, y: 0};\n this.lastTransform = {...this.transform};\n if(e?.type !== 'wheel' || !this.ctrlKeyDown) { // keep transition for real mouse wheel\n this.moversContainer.classList.add('no-transition');\n this.zoomElements.rangeSelector.container.classList.remove('with-transition');\n }\n this.isGesturingNow = true;\n this.lastGestureTime = Date.now();\n this.clampZoomDebounced.clearTimeout();\n\n if(!this.lastTransform.x && !this.lastTransform.y && !this.isZooming) {\n this.initialContentRect = this.content.media.getBoundingClientRect();\n }\n };\n\n protected onSwipeReset = (e?: Event) => {\n // move\n this.moversContainer.classList.remove('no-transition');\n this.zoomElements.rangeSelector.container.classList.add('with-transition');\n this.clampZoomDebounced.clearTimeout();\n\n if(e?.type === 'mouseup' && this.draggingType === 'mousemove') {\n this.ignoreNextClick = true;\n }\n\n const {draggingType} = this;\n this.isZoomingNow = false;\n this.isGesturingNow = false;\n this.draggingType = undefined;\n\n if(this.closing) {\n return;\n }\n\n if(this.transform.scale > ZOOM_INITIAL_VALUE) {\n // Get current content boundaries\n const s1 = Math.min(this.transform.scale, ZOOM_MAX_VALUE);\n const scaleFactor = s1 / this.transform.scale;\n\n // Calculate new position based on the last zoom center to keep the zoom center\n // at the same position when bouncing back from max zoom\n let x1 = this.transform.x * scaleFactor + (this.lastZoomCenter.x - scaleFactor * this.lastZoomCenter.x);\n let y1 = this.transform.y * scaleFactor + (this.lastZoomCenter.y - scaleFactor * this.lastZoomCenter.y);\n\n // If scale didn't change, we need to add inertia to pan gesture\n if(draggingType && draggingType !== 'wheel' && this.lastTransform.scale === this.transform.scale) {\n // Arbitrary pan velocity coefficient\n const k = 0.1;\n\n // Calculate user gesture velocity\n const elapsedTime = Math.max(1, Date.now() - this.lastGestureTime);\n const Vx = Math.abs(this.lastDragOffset.x) / elapsedTime;\n const Vy = Math.abs(this.lastDragOffset.y) / elapsedTime;\n\n // Add extra distance based on gesture velocity and last pan delta\n x1 -= Math.abs(this.lastDragOffset.x) * Vx * k * -this.lastDragDelta.x;\n y1 -= Math.abs(this.lastDragOffset.y) * Vy * k * -this.lastDragDelta.y;\n }\n\n const [transform] = this.calculateOffsetBoundaries({x: x1, y: y1, scale: s1});\n this.lastTransform = transform;\n this.setTransform(transform);\n } else if(this.transform.scale < ZOOM_INITIAL_VALUE) {\n this.resetZoom();\n }\n };\n\n protected onZoom = ({\n initialCenterX,\n initialCenterY,\n zoom,\n zoomAdd,\n currentCenterX,\n currentCenterY,\n dragOffsetX,\n dragOffsetY,\n zoomFactor\n }: ZoomDetails) => {\n initialCenterX ||= windowSize.width / 2;\n initialCenterY ||= windowSize.height / 2;\n currentCenterX ||= windowSize.width / 2;\n currentCenterY ||= windowSize.height / 2;\n\n this.isZoomingNow = true;\n\n const zoomMaxBounceValue = ZOOM_MAX_VALUE * 3;\n const scale = zoomAdd !== undefined ? clamp(this.lastTransform.scale + zoomAdd, ZOOM_MIN_VALUE, zoomMaxBounceValue) : (zoom ?? clamp(this.lastTransform.scale * zoomFactor, ZOOM_MIN_VALUE, zoomMaxBounceValue));\n const scaleFactor = scale / this.lastTransform.scale;\n const offsetX = Math.abs(Math.min(this.lastTransform.x, 0));\n const offsetY = Math.abs(Math.min(this.lastTransform.y, 0));\n\n // Save last zoom center for bounce back effect\n this.lastZoomCenter = {\n x: currentCenterX,\n y: currentCenterY\n };\n\n // Calculate new center relative to the shifted image\n const scaledCenterX = offsetX + initialCenterX;\n const scaledCenterY = offsetY + initialCenterY;\n\n const {scaleOffsetX, scaleOffsetY} = this.calculateScaleOffset({x: scaledCenterX, y: scaledCenterY, scale: scaleFactor});\n\n const [transform] = this.calculateOffsetBoundaries({\n x: this.lastTransform.x + scaleOffsetX + dragOffsetX,\n y: this.lastTransform.y + scaleOffsetY + dragOffsetY,\n scale\n });\n\n this.setTransform(transform);\n };\n\n protected changeZoomByPosition(x: number, y: number, scale: number) {\n const {scaleOffsetX, scaleOffsetY} = this.calculateScaleOffset({x, y, scale});\n const transform = this.calculateOffsetBoundaries({\n x: scaleOffsetX,\n y: scaleOffsetY,\n scale\n })[0];\n\n this.setTransform(transform);\n }\n\n protected setTransform(transform: Transform) {\n this.transform = transform;\n this.changeZoom(transform.scale);\n }\n\n // Calculate how much we need to shift the image to keep the zoom center at the same position\n protected calculateScaleOffset({x, y, scale}: {\n x: number,\n y: number,\n scale: number\n }) {\n return {\n scaleOffsetX: x - scale * x,\n scaleOffsetY: y - scale * y\n };\n }\n\n protected toggleZoom(enable?: boolean) {\n const isVisible = this.isZooming;\n const auto = enable === undefined;\n if(this.zoomElements.rangeSelector.mousedown || this.ctrlKeyDown) {\n enable = true;\n }\n\n enable ??= !isVisible;\n\n if(isVisible === enable) {\n return;\n }\n\n this.buttons.zoom.classList.toggle('zoom-in', !enable);\n this.zoomElements.container.classList.toggle('is-visible', this.isZooming = enable);\n this.wholeDiv.classList.toggle('is-zooming', enable);\n\n if(auto || !enable) {\n const zoomValue = enable ? this.transform.scale : ZOOM_INITIAL_VALUE;\n this.setZoomValue(zoomValue);\n this.zoomElements.rangeSelector.setProgress(zoomValue);\n }\n\n if(this.videoPlayer) {\n this.videoPlayer.lockControls(enable ? false : undefined);\n }\n }\n\n protected addZoomStep(add: boolean) {\n this.addZoom(ZOOM_STEP * (add ? 1 : -1));\n }\n\n protected resetZoom() {\n this.setTransform({\n x: 0,\n y: 0,\n scale: ZOOM_INITIAL_VALUE\n });\n }\n\n protected changeZoom(value = this.transform.scale) {\n this.transform.scale = value;\n this.zoomElements.rangeSelector.setProgress(value);\n this.setZoomValue(value);\n }\n\n protected addZoom(value: number) {\n this.lastTransform = this.transform;\n this.onZoom({\n zoomAdd: value,\n currentCenterX: 0,\n currentCenterY: 0,\n initialCenterX: 0,\n initialCenterY: 0,\n dragOffsetX: 0,\n dragOffsetY: 0\n });\n this.lastTransform = this.transform;\n this.clampZoomDebounced();\n }\n\n protected getZoomBounce() {\n return this.isGesturingNow && IS_TOUCH_SUPPORTED ? 50 : 0;\n }\n\n protected calculateOffsetBoundaries = (\n {x, y, scale}: Transform,\n offsetTop = 0\n ): [Transform, boolean, boolean] => {\n if(!this.initialContentRect) return [{x, y, scale}, true, true];\n // Get current content boundaries\n let inBoundsX = true;\n let inBoundsY = true;\n\n const {minX, maxX, minY, maxY} = this.getZoomBoundaries(scale, offsetTop);\n\n inBoundsX = isBetween(x, maxX, minX);\n x = clamp(x, maxX, minX);\n\n inBoundsY = isBetween(y, maxY, minY);\n y = clamp(y, maxY, minY);\n\n return [{x, y, scale}, inBoundsX, inBoundsY];\n };\n\n protected getZoomBoundaries(scale = this.transform.scale, offsetTop = 0) {\n if(!this.initialContentRect) {\n return {minX: 0, maxX: 0, minY: 0, maxY: 0};\n }\n\n const centerX = (windowSize.width - windowSize.width * scale) / 2;\n const centerY = (windowSize.height - windowSize.height * scale) / 2;\n\n // If content is outside window we calculate offset boundaries\n // based on initial content rect and current scale\n const minX = Math.max(-this.initialContentRect.left * scale, centerX);\n const maxX = windowSize.width - this.initialContentRect.right * scale;\n\n const minY = Math.max(-this.initialContentRect.top * scale + offsetTop, centerY);\n const maxY = windowSize.height - this.initialContentRect.bottom * scale;\n\n return {minX, maxX, minY, maxY};\n }\n\n protected setZoomValue = (value = this.transform.scale) => {\n this.initialContentRect ??= this.content.media.getBoundingClientRect();\n\n // this.zoomValue = value;\n if(value === ZOOM_INITIAL_VALUE) {\n this.transform.x = 0;\n this.transform.y = 0;\n }\n\n this.moversContainer.style.transform = `translate3d(${this.transform.x.toFixed(3)}px, ${this.transform.y.toFixed(3)}px, 0px) scale(${value.toFixed(3)})`;\n\n this.zoomElements.btnOut.classList.toggle('inactive', value <= ZOOM_MIN_VALUE);\n this.zoomElements.btnIn.classList.toggle('inactive', value >= ZOOM_MAX_VALUE);\n\n this.toggleZoom(value !== ZOOM_INITIAL_VALUE);\n };\n\n protected setBtnMenuToggle(buttons: ButtonMenuItemOptions[]) {\n const btnMenuToggle = ButtonMenuToggle({buttonOptions: {onlyMobile: true}, direction: 'bottom-left', buttons});\n this.topbar.append(btnMenuToggle);\n }\n\n public close(e?: MouseEvent) {\n if(e) {\n cancelEvent(e);\n }\n\n if(this.setMoverAnimationPromise) return Promise.reject();\n\n this.closing = true;\n this.swipeHandler?.removeListeners();\n\n if(this.navigationItem) {\n appNavigationController.removeItem(this.navigationItem);\n }\n\n this.lazyLoadQueue.clear();\n\n const promise = this.setMoverToTarget(this.target?.element, true).then(({onAnimationEnd}) => onAnimationEnd);\n\n this.listLoader.reset();\n (this.listLoader as SearchListLoader).cleanup && (this.listLoader as SearchListLoader).cleanup();\n this.setMoverPromise = null;\n this.tempId = -1;\n if((window as any).appMediaViewer === this) {\n (window as any).appMediaViewer = undefined;\n }\n\n /* if(appSidebarRight.historyTabIDs.slice(-1)[0] === AppSidebarRight.SLIDERITEMSIDS.forward) {\n promise.then(() => {\n appSidebarRight.forwardTab.closeBtn.click();\n });\n } */\n\n this.removeGlobalListeners();\n\n promise.finally(() => {\n this.wholeDiv.remove();\n this.toggleOverlay(false);\n });\n\n return promise;\n }\n\n protected toggleOverlay(active: boolean) {\n overlayCounter.isOverlayActive = active;\n animationIntersector.checkAnimations2(active);\n }\n\n protected toggleGlobalListeners(active: boolean) {\n if(active) this.setGlobalListeners();\n else this.removeGlobalListeners();\n }\n\n protected removeGlobalListeners() {\n window.removeEventListener('keydown', this.onKeyDown);\n window.removeEventListener('keyup', this.onKeyUp);\n }\n\n protected setGlobalListeners() {\n window.addEventListener('keydown', this.onKeyDown);\n window.addEventListener('keyup', this.onKeyUp);\n }\n\n public setMediaTimestamp(timestamp: number) {\n this.videoPlayer?.setTimestamp(timestamp);\n }\n\n onClick = (e: MouseEvent) => {\n if(this.ignoreNextClick) {\n this.ignoreNextClick = undefined;\n return;\n }\n\n if(this.setMoverAnimationPromise) return;\n\n const target = e.target as HTMLElement;\n if(target.tagName === 'A') return;\n cancelEvent(e);\n\n if(IS_TOUCH_SUPPORTED) {\n if(this.highlightSwitchersTimeout) {\n clearTimeout(this.highlightSwitchersTimeout);\n } else {\n this.wholeDiv.classList.add('highlight-switchers');\n }\n\n this.highlightSwitchersTimeout = window.setTimeout(() => {\n this.wholeDiv.classList.remove('highlight-switchers');\n this.highlightSwitchersTimeout = 0;\n }, 3e3);\n\n return;\n }\n\n if(hasMouseMovedSinceDown(e)) {\n return;\n }\n\n const isZooming = this.isZooming && false;\n let mover: HTMLElement = null;\n const classNames = ['ckin__player', 'media-viewer-buttons', 'media-viewer-author', 'media-viewer-caption', 'zoom-container'];\n if(isZooming) {\n classNames.push('media-viewer-movers');\n }\n\n classNames.find((s) => {\n try {\n mover = findUpClassName(target, s);\n if(mover) return true;\n } catch(err) {return false;}\n });\n\n if(/* target === this.mediaViewerDiv */!mover || (!isZooming && (target.tagName === 'IMG' || target.tagName === 'image'))) {\n this.close();\n }\n };\n\n private onKeyDown = (e: KeyboardEvent) => {\n // this.log('onKeyDown', e);\n if(overlayCounter.overlaysActive > 1) {\n return;\n }\n\n const key = e.key;\n\n let good = true;\n if(key === 'ArrowRight') {\n !this.isZooming && this.buttons.next.click();\n } else if(key === 'ArrowLeft') {\n !this.isZooming && this.buttons.prev.click();\n } else if(key === '-' || key === '=') {\n if(this.ctrlKeyDown) {\n this.addZoomStep(key === '=');\n }\n } else {\n good = false;\n }\n\n if(e.ctrlKey || e.metaKey) {\n this.ctrlKeyDown = true;\n }\n\n if(good) {\n cancelEvent(e);\n }\n };\n\n private onKeyUp = (e: KeyboardEvent) => {\n if(overlayCounter.overlaysActive > 1) {\n return;\n }\n\n if(!(e.ctrlKey || e.metaKey)) {\n this.ctrlKeyDown = false;\n\n if(this.isZooming) {\n this.setZoomValue();\n }\n }\n };\n\n protected async setMoverToTarget(target: HTMLElement, closing = false, fromRight = 0) {\n this.dispatchEvent('setMoverBefore');\n\n const mover = this.content.mover;\n\n if(!closing) {\n mover.innerHTML = '';\n // mover.append(this.buttons.prev, this.buttons.next);\n }\n\n const zoomValue = this.isZooming && closing /* && false */ ? this.transform.scale : ZOOM_INITIAL_VALUE;\n /* if(!(zoomValue > 1 && closing)) */ this.removeCenterFromMover(mover);\n\n const wasActive = fromRight !== 0;\n\n const delay = liteMode.isAvailable('animations') ? (wasActive ? 350 : 200) : 0;\n // let delay = wasActive ? 350 : 10000;\n\n /* if(wasActive) {\n this.moveTheMover(mover);\n mover = this.setNewMover();\n } */\n\n /* if(DEBUG) {\n this.log('setMoverToTarget', target, closing, wasActive, fromRight);\n } */\n\n let realParent: HTMLElement;\n\n let rect: DOMRect;\n if(target) {\n if(target instanceof AvatarElement || target.classList.contains('grid-item')/* || target.classList.contains('document-ico') */) {\n realParent = target;\n rect = target.getBoundingClientRect();\n } else if(target instanceof SVGImageElement || target.parentElement instanceof SVGForeignObjectElement) {\n realParent = findUpClassName(target, 'attachment');\n rect = realParent.getBoundingClientRect();\n } else if(target.classList.contains('profile-avatars-avatar')) {\n realParent = findUpClassName(target, 'profile-avatars-container');\n rect = realParent.getBoundingClientRect();\n\n // * if not active avatar\n if(closing && target.getBoundingClientRect().left !== rect.left) {\n target = realParent = rect = undefined;\n }\n }\n }\n\n if(!target) {\n target = this.content.media;\n }\n\n if(!rect) {\n realParent = target.parentElement as HTMLElement;\n rect = target.getBoundingClientRect();\n }\n\n let needOpacity = false;\n if(target !== this.content.media && !target.classList.contains('profile-avatars-avatar')) {\n const overflowElement = findUpClassName(realParent, 'scrollable');\n const visibleRect = getVisibleRect(realParent, overflowElement, true);\n\n if(closing && (!visibleRect || visibleRect.overflow.vertical === 2 || visibleRect.overflow.horizontal === 2)) {\n target = this.content.media;\n realParent = target.parentElement as HTMLElement;\n rect = target.getBoundingClientRect();\n } else if(visibleRect && (visibleRect.overflow.vertical === 1 || visibleRect.overflow.horizontal === 1)) {\n needOpacity = true;\n }\n }\n\n const containerRect = this.content.media.getBoundingClientRect();\n\n let transform = '';\n let left: number;\n let top: number;\n\n if(wasActive) {\n left = fromRight === 1 ? windowSize.width : -containerRect.width;\n top = containerRect.top;\n } else {\n left = rect.left;\n top = rect.top;\n }\n\n /* if(zoomValue > 1) { // 33\n // const diffX = (rect.width * zoomValue - rect.width) / 4;\n const diffX = (rect.width * zoomValue - rect.width) / 2;\n const diffY = (rect.height * zoomValue - rect.height) / 4;\n // left -= diffX;\n // top += diffY;\n } */\n\n transform += `translate3d(${left}px,${top}px,0) `;\n\n /* if(wasActive) {\n left = fromRight === 1 ? appPhotosManager.windowW / 2 : -(containerRect.width + appPhotosManager.windowW / 2);\n transform += `translate(${left}px,-50%) `;\n } else {\n left = rect.left - (appPhotosManager.windowW / 2);\n top = rect.top - (appPhotosManager.windowH / 2);\n transform += `translate(${left}px,${top}px) `;\n } */\n\n let aspecter: HTMLDivElement;\n if(target instanceof HTMLImageElement || target instanceof HTMLVideoElement || target.tagName === 'DIV') {\n if(mover.firstElementChild && mover.firstElementChild.classList.contains('media-viewer-aspecter')) {\n aspecter = mover.firstElementChild as HTMLDivElement;\n\n const player = aspecter.querySelector('.ckin__player');\n if(player) {\n const video = player.firstElementChild as HTMLVideoElement;\n aspecter.append(video);\n player.remove();\n }\n\n if(!aspecter.style.cssText) { // всё из-за видео, элементы управления скейлятся, так бы можно было этого не делать\n mover.classList.remove('active');\n this.setFullAspect(aspecter, containerRect, rect);\n void mover.offsetLeft; // reflow\n mover.classList.add('active');\n }\n } else {\n aspecter = document.createElement('div');\n aspecter.classList.add('media-viewer-aspecter'/* , 'disable-hover' */);\n mover.prepend(aspecter);\n }\n\n aspecter.style.cssText = `width: ${rect.width}px; height: ${rect.height}px; transform: scale3d(${containerRect.width / rect.width}, ${containerRect.height / rect.height}, 1);`;\n }\n\n mover.style.width = containerRect.width + 'px';\n mover.style.height = containerRect.height + 'px';\n\n // const scaleX = rect.width / (containerRect.width * zoomValue);\n // const scaleY = rect.height / (containerRect.height * zoomValue);\n const scaleX = rect.width / containerRect.width;\n const scaleY = rect.height / containerRect.height;\n if(!wasActive) {\n transform += `scale3d(${scaleX},${scaleY},1) `;\n }\n\n let borderRadius = window.getComputedStyle(realParent).getPropertyValue('border-radius');\n const brSplitted = fillPropertyValue(borderRadius) as string[];\n borderRadius = brSplitted.map((r) => (parseInt(r) / scaleX) + 'px').join(' ');\n if(!wasActive) {\n mover.style.borderRadius = borderRadius;\n }\n // let borderRadius = '0px 0px 0px 0px';\n\n if(closing && zoomValue !== 1) {\n const left = rect.left - (windowSize.width * scaleX - rect.width) / 2;\n const top = rect.top - (windowSize.height * scaleY - rect.height) / 2;\n this.moversContainer.style.transform = `matrix(${scaleX}, 0, 0, ${scaleY}, ${left}, ${top})`;\n } else {\n mover.style.transform = transform;\n }\n\n needOpacity && (mover.style.opacity = '0'/* !closing ? '0' : '' */);\n\n /* if(wasActive) {\n this.log('setMoverToTarget', mover.style.transform);\n } */\n\n let path: SVGPathElement;\n const isOut = target.classList.contains('is-out');\n\n const deferred = this.setMoverAnimationPromise = deferredPromise();\n const ret = {onAnimationEnd: deferred};\n\n const timeout = setTimeout(() => {\n if(!deferred.isFulfilled && !deferred.isRejected) {\n deferred.resolve();\n }\n }, 1000);\n\n deferred.finally(() => {\n this.dispatchEvent('setMoverAfter');\n\n if(this.setMoverAnimationPromise === deferred) {\n this.setMoverAnimationPromise = null;\n }\n\n clearTimeout(timeout);\n });\n\n if(!closing) {\n let mediaElement: HTMLImageElement | HTMLVideoElement | HTMLCanvasElement;\n let src: string;\n\n // if(target instanceof HTMLVideoElement) {\n const selector = 'video, img, .canvas-thumbnail';\n const queryFrom = target.matches(selector) ? target.parentElement : target;\n const elements = Array.from(queryFrom.querySelectorAll(selector)) as HTMLImageElement[];\n if(elements.length) {\n target = elements.pop();\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n if(target instanceof HTMLImageElement) {\n canvas.width = target.naturalWidth;\n canvas.height = target.naturalHeight;\n } else if(target instanceof HTMLVideoElement) {\n canvas.width = target.videoWidth;\n canvas.height = target.videoHeight;\n } else if(target instanceof HTMLCanvasElement) {\n canvas.width = target.width;\n canvas.height = target.height;\n }\n\n canvas.className = 'canvas-thumbnail thumbnail media-photo';\n context.drawImage(target as HTMLImageElement | HTMLCanvasElement, 0, 0);\n target = canvas;\n }\n // }\n\n if(target.tagName === 'DIV' || target.tagName === 'AVATAR-ELEMENT') { // useContainerAsTarget\n const images = Array.from(target.querySelectorAll('img')) as HTMLImageElement[];\n const image = images.pop();\n if(image) {\n mediaElement = new Image();\n src = image.src;\n mover.append(mediaElement);\n }\n /* mediaElement = new Image();\n src = target.style.backgroundImage.slice(5, -2); */\n } else if(target instanceof HTMLImageElement) {\n mediaElement = new Image();\n src = target.src;\n } else if(target instanceof HTMLVideoElement) {\n mediaElement = createVideo();\n mediaElement.src = target.src;\n } else if(target instanceof SVGSVGElement) {\n const clipId = target.dataset.clipId;\n const newClipId = clipId + '-mv';\n\n const {width, height} = containerRect;\n\n const newSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n newSvg.setAttributeNS(null, 'width', '' + width);\n newSvg.setAttributeNS(null, 'height', '' + height);\n\n // нижние два свойства для масштабирования\n newSvg.setAttributeNS(null, 'viewBox', `0 0 ${width} ${height}`);\n newSvg.setAttributeNS(null, 'preserveAspectRatio', 'xMidYMid meet');\n\n newSvg.insertAdjacentHTML('beforeend', target.firstElementChild.outerHTML.replace(clipId, newClipId));\n newSvg.insertAdjacentHTML('beforeend', target.lastElementChild.outerHTML.replace(clipId, newClipId));\n\n // теперь надо выставить новую позицию для хвостика\n const defs = newSvg.firstElementChild;\n const use = defs.firstElementChild.firstElementChild as SVGUseElement;\n if(use instanceof SVGUseElement) {\n let transform = use.getAttributeNS(null, 'transform');\n transform = transform.replace(/translate\\((.+?), (.+?)\\) scale\\((.+?), (.+?)\\)/, (match, x, y, sX, sY) => {\n x = +x;\n if(x !== 2) {\n x = width - (2 / scaleX);\n } else {\n x = 2 / scaleX;\n }\n\n y = height;\n\n return `translate(${x}, ${y}) scale(${+sX / scaleX}, ${+sY / scaleY})`;\n });\n use.setAttributeNS(null, 'transform', transform);\n\n // и новый RECT\n path = defs.firstElementChild.lastElementChild as SVGPathElement;\n\n // код ниже нужен только чтобы скрыть моргание до момента как сработает таймаут\n let d: string;\n const br: [number, number, number, number] = borderRadius.split(' ').map((v) => parseInt(v)) as any;\n if(isOut) d = generatePathData(0, 0, width - 9 / scaleX, height, ...br);\n else d = generatePathData(9 / scaleX, 0, width - 9 / scaleX, height, ...br);\n path.setAttributeNS(null, 'd', d);\n }\n\n const foreignObject = newSvg.lastElementChild;\n foreignObject.setAttributeNS(null, 'width', '' + containerRect.width);\n foreignObject.setAttributeNS(null, 'height', '' + containerRect.height);\n\n mover.prepend(newSvg);\n } else if(target instanceof HTMLCanvasElement) {\n mediaElement = target;\n }\n\n if(aspecter) {\n aspecter.style.borderRadius = borderRadius;\n\n if(mediaElement) {\n aspecter.append(mediaElement);\n }\n }\n\n mediaElement = mover.querySelector('video, img');\n if(mediaElement instanceof HTMLImageElement) {\n mediaElement.classList.add('thumbnail');\n if(!aspecter) {\n mediaElement.style.width = containerRect.width + 'px';\n mediaElement.style.height = containerRect.height + 'px';\n }\n\n if(src) {\n await renderImageFromUrlPromise(mediaElement, src);\n }\n }/* else if(mediaElement instanceof HTMLVideoElement && mediaElement.firstElementChild && ((mediaElement.firstElementChild as HTMLSourceElement).src || src)) {\n await new Promise((resolve, reject) => {\n mediaElement.addEventListener('loadeddata', resolve);\n\n if(src) {\n (mediaElement.firstElementChild as HTMLSourceElement).src = src;\n }\n });\n } */\n\n mover.style.display = '';\n\n fastRaf(() => {\n mover.classList.add(wasActive ? 'moving' : 'active');\n });\n } else {\n /* if(mover.classList.contains('center')) {\n mover.classList.remove('center');\n void mover.offsetLeft; // reflow\n } */\n\n if(target instanceof SVGSVGElement) {\n path = mover.querySelector('path');\n\n if(path) {\n this.sizeTailPath(path, containerRect, scaleX, delay, false, isOut, borderRadius);\n }\n }\n\n if(target.classList.contains('media-viewer-media')) {\n mover.classList.add('hiding');\n }\n\n this.toggleWholeActive(false);\n\n // return ret;\n\n setTimeout(() => {\n mover.style.borderRadius = borderRadius;\n\n if(mover.firstElementChild) {\n (mover.firstElementChild as HTMLElement).style.borderRadius = borderRadius;\n }\n }, delay / 2);\n\n setTimeout(() => {\n mover.innerHTML = '';\n mover.classList.remove('moving', 'active', 'hiding');\n mover.style.cssText = 'display: none;';\n\n deferred.resolve();\n }, delay);\n\n mover.classList.remove('opening');\n\n return ret;\n }\n\n mover.classList.add('opening');\n\n // await new Promise((resolve) => setTimeout(resolve, 0));\n // await new Promise((resolve) => window.requestAnimationFrame(resolve));\n // * одного RAF'а недостаточно, иногда анимация с одним не срабатывает (преимущественно на мобильных)\n await doubleRaf();\n\n // чтобы проверить установленную позицию - раскомментировать\n // throw '';\n\n // await new Promise((resolve) => setTimeout(resolve, 5e3));\n\n mover.style.transform = `translate3d(${containerRect.left}px,${containerRect.top}px,0) scale3d(1,1,1)`;\n // mover.style.transform = `translate(-50%,-50%) scale(1,1)`;\n needOpacity && (mover.style.opacity = ''/* closing ? '0' : '' */);\n\n if(aspecter) {\n this.setFullAspect(aspecter, containerRect, rect);\n }\n\n // throw '';\n\n setTimeout(() => {\n mover.style.borderRadius = '';\n\n if(mover.firstElementChild) {\n (mover.firstElementChild as HTMLElement).style.borderRadius = '';\n }\n }, 0/* delay / 2 */);\n\n mover.dataset.timeout = '' + setTimeout(() => {\n mover.classList.remove('moving', 'opening');\n\n if(aspecter) { // всё из-за видео, элементы управления скейлятся, так бы можно было этого не делать\n if(mover.querySelector('video') || true) {\n mover.classList.remove('active');\n aspecter.style.cssText = '';\n void mover.offsetLeft; // reflow\n }\n\n // aspecter.classList.remove('disable-hover');\n }\n\n // эти строки нужны для установки центральной позиции, в случае ресайза это будет нужно\n mover.classList.add('center', 'no-transition');\n /* mover.style.left = mover.style.top = '50%';\n mover.style.transform = 'translate(-50%, -50%)';\n void mover.offsetLeft; // reflow */\n\n // это уже нужно для будущих анимаций\n mover.classList.add('active');\n delete mover.dataset.timeout;\n\n deferred.resolve();\n }, delay);\n\n if(path) {\n this.sizeTailPath(path, containerRect, scaleX, delay, true, isOut, borderRadius);\n }\n\n return ret;\n }\n\n protected toggleWholeActive(active: boolean) {\n if(active) {\n this.wholeDiv.classList.add('active');\n } else {\n this.wholeDiv.classList.add('backwards');\n setTimeout(() => {\n this.wholeDiv.classList.remove('active');\n }, 0);\n }\n }\n\n protected setFullAspect(aspecter: HTMLDivElement, containerRect: DOMRect, rect: DOMRect) {\n /* let media = aspecter.firstElementChild;\n let proportion: number;\n if(media instanceof HTMLImageElement) {\n proportion = media.naturalWidth / media.naturalHeight;\n } else if(media instanceof HTMLVideoElement) {\n proportion = media.videoWidth / media.videoHeight;\n } */\n const proportion = containerRect.width / containerRect.height;\n\n let {width, height} = rect;\n /* if(proportion === 1) {\n aspecter.style.cssText = '';\n } else { */\n if(proportion > 0) {\n width = height * proportion;\n } else {\n height = width * proportion;\n }\n\n // this.log('will set style aspecter:', `width: ${width}px; height: ${height}px; transform: scale(${containerRect.width / width}, ${containerRect.height / height});`);\n\n aspecter.style.cssText = `width: ${width}px; height: ${height}px; transform: scale3d(${containerRect.width / width}, ${containerRect.height / height}, 1);`;\n // }\n }\n\n protected sizeTailPath(path: SVGPathElement, rect: DOMRect, scaleX: number, delay: number, upscale: boolean, isOut: boolean, borderRadius: string) {\n const start = Date.now();\n const {width, height} = rect;\n delay = delay / 2;\n\n const br = borderRadius.split(' ').map((v) => parseInt(v));\n\n const step = () => {\n const diff = Date.now() - start;\n\n let progress = delay ? diff / delay : 1;\n if(progress > 1) progress = 1;\n if(upscale) progress = 1 - progress;\n\n const _br: [number, number, number, number] = br.map((v) => v * progress) as any;\n\n let d: string;\n if(isOut) d = generatePathData(0, 0, width - (9 / scaleX * progress), height, ..._br);\n else d = generatePathData(9 / scaleX * progress, 0, width/* width - (9 / scaleX * progress) */, height, ..._br);\n path.setAttributeNS(null, 'd', d);\n\n if(diff < delay) fastRaf(step);\n };\n\n // window.requestAnimationFrame(step);\n step();\n }\n\n protected removeCenterFromMover(mover: HTMLElement) {\n if(mover.classList.contains('center')) {\n // const rect = mover.getBoundingClientRect();\n const rect = this.content.media.getBoundingClientRect();\n mover.style.transform = `translate3d(${rect.left}px,${rect.top}px,0)`;\n mover.classList.remove('center');\n void mover.offsetLeft; // reflow\n mover.classList.remove('no-transition');\n }\n }\n\n protected moveTheMover(mover: HTMLElement, toLeft = true) {\n const windowW = windowSize.width;\n\n this.removeCenterFromMover(mover);\n\n // mover.classList.remove('active');\n mover.classList.add('moving');\n\n if(mover.dataset.timeout) { // и это тоже всё из-за скейла видео, так бы это не нужно было\n clearTimeout(+mover.dataset.timeout);\n }\n\n const rect = mover.getBoundingClientRect();\n\n const newTransform = mover.style.transform.replace(/translate3d\\((.+?),/, (match, p1) => {\n const x = toLeft ? -rect.width : windowW;\n // const x = toLeft ? -(rect.right + (rect.width / 2)) : windowW / 2;\n\n return match.replace(p1, x + 'px');\n });\n\n // //////this.log('set newTransform:', newTransform, mover.style.transform, toLeft);\n mover.style.transform = newTransform;\n\n setTimeout(() => {\n mover.remove();\n }, 350);\n }\n\n protected setNewMover() {\n const newMover = document.createElement('div');\n newMover.classList.add('media-viewer-mover');\n newMover.style.display = 'none';\n\n if(this.content.mover) {\n const oldMover = this.content.mover;\n oldMover.parentElement.append(newMover);\n } else {\n this.moversContainer.append(newMover);\n }\n\n return this.content.mover = newMover;\n }\n\n protected updateMediaSource(target: HTMLElement, url: string, tagName: 'video' | 'img') {\n // if(target instanceof SVGSVGElement) {\n const el = target.tagName.toLowerCase() === tagName ? target : target.querySelector(tagName) as HTMLElement;\n if(el && !findUpClassName(target, 'document')) {\n if(findUpClassName(target, 'attachment')) {\n // two parentElements because element can be contained in aspecter\n const preloader = target.parentElement.parentElement.querySelector('.preloader-container') as HTMLElement;\n if(preloader) {\n if(tagName === 'video') {\n if(preloader.classList.contains('manual')) {\n preloader.click();\n // return;\n }\n\n return;\n }\n\n preloader.remove();\n }\n }\n\n if((el as HTMLImageElement).src !== url) {\n renderImageFromUrl(el, url);\n }\n\n // ! костыль, но он тут даже и не нужен\n if(el.classList.contains('thumbnail') && el.parentElement.classList.contains('media-container-aspecter')) {\n el.classList.remove('thumbnail');\n }\n }\n /* } else {\n\n } */\n }\n\n protected setAuthorInfo(fromId: PeerId | string, timestamp: number) {\n const isPeerId = fromId.isPeerId();\n let wrapTitlePromise: Promise | HTMLElement;\n if(isPeerId) {\n wrapTitlePromise = wrapPeerTitle({\n peerId: fromId as PeerId,\n dialog: false,\n onlyFirstName: false,\n plainText: false\n })\n } else {\n const title = wrapTitlePromise = document.createElement('span');\n title.append(wrapEmojiText(fromId));\n title.classList.add('peer-title');\n }\n\n const oldAvatar = this.author.avatarEl;\n const newAvatar = this.author.avatarEl = (oldAvatar.cloneNode() as AvatarElement);\n\n return Promise.all([\n (this.author.avatarEl as AvatarElement).updateWithOptions({\n peerId: fromId as PeerId || NULL_PEER_ID,\n peerTitle: isPeerId ? undefined : '' + fromId\n }),\n\n wrapTitlePromise\n ]).then(([_, title]) => {\n if(this.author.avatarEl !== newAvatar) {\n return;\n }\n\n replaceContent(this.author.date, formatFullSentTime(timestamp));\n replaceContent(this.author.nameEl, title);\n oldAvatar.replaceWith(this.author.avatarEl);\n });\n }\n\n protected async _openMedia({\n media,\n timestamp,\n fromId,\n fromRight,\n target,\n reverse = false,\n prevTargets = [],\n nextTargets = [],\n message,\n mediaTimestamp\n }: {\n media: MyDocument | MyPhoto,\n timestamp: number,\n fromId: PeerId | string,\n fromRight: number,\n target?: HTMLElement,\n reverse?: boolean,\n prevTargets?: TargetType[],\n nextTargets?: TargetType[],\n message?: MyMessage,\n mediaTimestamp?: number\n /* , needLoadMore = true */\n }) {\n if(this.setMoverPromise) return this.setMoverPromise;\n\n /* if(DEBUG) {\n this.log('openMedia:', media, fromId, prevTargets, nextTargets);\n } */\n\n const setAuthorPromise = this.setAuthorInfo(fromId, timestamp);\n\n const isDocument = media._ === 'document';\n const isVideo = isDocument && media.mime_type && ((['video', 'gif'] as MyDocument['type'][]).includes(media.type) || media.mime_type.indexOf('video/') === 0);\n\n if(this.isFirstOpen) {\n // this.targetContainer = targetContainer;\n // this.needLoadMore = needLoadMore;\n this.isFirstOpen = false;\n this.listLoader.setTargets(prevTargets, nextTargets, reverse);\n (window as any).appMediaViewer = this;\n // this.loadMore = loadMore;\n\n /* if(appSidebarRight.historyTabIDs.slice(-1)[0] === AppSidebarRight.SLIDERITEMSIDS.forward) {\n appSidebarRight.forwardTab.closeBtn.click();\n await new Promise((resolve) => setTimeout(resolve, 200));\n } */\n }\n\n if(this.listLoader.next.length < 10) {\n setTimeout(() => {\n this.listLoader.load(true);\n }, 0);\n }\n\n // if(prevTarget && (!prevTarget.parentElement || !this.isElementVisible(this.targetContainer, prevTarget))) prevTarget = null;\n // if(nextTarget && (!nextTarget.parentElement || !this.isElementVisible(this.targetContainer, nextTarget))) nextTarget = null;\n\n this.buttons.prev.classList.toggle('hide', !this.listLoader.previous.length);\n this.buttons.next.classList.toggle('hide', !this.listLoader.next.length);\n\n const container = this.content.media;\n const useContainerAsTarget = !target || target === container;\n if(useContainerAsTarget) target = container;\n\n this.target = {element: target} as any;\n const tempId = ++this.tempId;\n\n if(container.firstElementChild) {\n container.replaceChildren();\n }\n\n // ok set\n\n const wasActive = fromRight !== 0;\n if(wasActive) {\n this.moveTheMover(this.content.mover, fromRight === 1);\n this.setNewMover();\n } else {\n this.navigationItem = {\n type: 'media',\n onPop: (canAnimate) => {\n if(this.setMoverAnimationPromise) {\n return false;\n }\n\n if(!canAnimate && IS_MOBILE_SAFARI) {\n this.wholeDiv.remove();\n }\n\n this.close();\n }\n };\n\n appNavigationController.pushItem(this.navigationItem);\n\n this.toggleOverlay(true);\n this.setGlobalListeners();\n await setAuthorPromise;\n\n if(!this.wholeDiv.parentElement) {\n this.pageEl.insertBefore(this.wholeDiv, document.getElementById('main-columns'));\n void this.wholeDiv.offsetLeft; // reflow\n }\n\n this.toggleWholeActive(true);\n }\n\n // //////this.log('wasActive:', wasActive);\n\n const mover = this.content.mover;\n\n const maxWidth = windowSize.width;\n // const maxWidth = this.pageEl.scrollWidth;\n // TODO: const maxHeight = mediaSizes.isMobile ? appPhotosManager.windowH : appPhotosManager.windowH - 100;\n let padding = 0;\n const windowH = windowSize.height;\n if(windowH < 1000000 && !mediaSizes.isMobile) {\n padding = 120;\n }\n const maxHeight = windowH - 120 - padding;\n let thumbPromise: Promise = Promise.resolve();\n const size = setAttachmentSize(media, container, maxWidth, maxHeight, mediaSizes.isMobile ? false : true, undefined, !!(isDocument && media.w && media.h)).photoSize;\n if(useContainerAsTarget) {\n const cacheContext = await this.managers.thumbsStorage.getCacheContext(media, size.type);\n let img: HTMLImageElement | HTMLCanvasElement;\n if(cacheContext.downloaded) {\n img = new Image();\n img.src = cacheContext.url;\n } else {\n const gotThumb = getStrippedThumbIfNeeded(media, cacheContext, true);\n if(gotThumb) {\n thumbPromise = gotThumb.loadPromise;\n img = gotThumb.image;\n }\n }\n\n if(img) {\n img.classList.add('thumbnail');\n container.append(img);\n }\n }\n\n // need after setAttachmentSize\n /* if(useContainerAsTarget) {\n target = target.querySelector('img, video') || target;\n } */\n\n const supportsStreaming: boolean = !!(isDocument && media.supportsStreaming);\n const preloader = supportsStreaming ? this.preloaderStreamable : this.preloader;\n\n const getCacheContext = (type = size?.type) => {\n return this.managers.thumbsStorage.getCacheContext(media, type);\n };\n\n let setMoverPromise: Promise;\n if(isVideo) {\n // //////this.log('will wrap video', media, size);\n\n // потому что для safari нужно создать элемент из event'а\n // const video = document.createElement('video');\n const useController = message && media.type !== 'gif';\n const video = /* useController ?\n appMediaPlaybackController.addMedia(message, false, true) as HTMLVideoElement :\n */createVideo({pip: useController});\n\n if(this.wholeDiv.classList.contains('no-forwards')) {\n video.addEventListener('contextmenu', cancelEvent);\n }\n\n const set = () => this.setMoverToTarget(target, false, fromRight).then(({onAnimationEnd}) => {\n // return; // set and don't move\n // if(wasActive) return;\n // return;\n\n const div = mover.firstElementChild && mover.firstElementChild.classList.contains('media-viewer-aspecter') ? mover.firstElementChild : mover;\n // const video = mover.querySelector('video') || document.createElement('video');\n\n const moverVideo = mover.querySelector('video');\n if(moverVideo) {\n moverVideo.remove();\n }\n\n // video.src = '';\n\n video.setAttribute('playsinline', 'true');\n\n // * fix for playing video if viewer is closed (https://contest.com/javascript-web-bonus/entry1425#issue11629)\n video.addEventListener('timeupdate', () => {\n if(this.tempId !== tempId) {\n video.pause();\n }\n });\n\n this.addEventListener('setMoverAfter', () => {\n video.src = '';\n video.load();\n }, {once: true});\n\n if(IS_SAFARI) {\n // test stream\n // video.controls = true;\n video.autoplay = true;\n }\n\n if(media.type === 'gif') {\n video.muted = true;\n video.autoplay = true;\n video.loop = true;\n } else if(media.duration < 60) {\n video.loop = true;\n }\n\n if(mediaTimestamp !== undefined) {\n video.currentTime = mediaTimestamp;\n }\n\n // if(!video.parentElement) {\n div.append(video);\n // }\n\n const canPlayThrough = new Promise((resolve) => {\n video.addEventListener('canplay', resolve, {once: true});\n });\n\n const createPlayer = () => {\n if(media.type !== 'gif') {\n video.dataset.ckin = 'default';\n video.dataset.overlay = '1';\n\n Promise.all([canPlayThrough, onAnimationEnd]).then(() => {\n if(this.tempId !== tempId) {\n return;\n }\n\n // const play = useController ? appMediaPlaybackController.willBePlayedMedia === video : true;\n const play = true;\n const player = this.videoPlayer = new VideoPlayer({\n video,\n play,\n streamable: supportsStreaming,\n onPlaybackRackMenuToggle: (open) => {\n this.wholeDiv.classList.toggle('hide-caption', !!open);\n },\n onPip: (pip) => {\n const otherMediaViewer = (window as any).appMediaViewer;\n if(!pip && otherMediaViewer && otherMediaViewer !== this) {\n this.releaseSingleMedia = undefined;\n this.close();\n return;\n }\n\n const mover = this.moversContainer.lastElementChild as HTMLElement;\n mover.classList.toggle('hiding', pip);\n this.toggleWholeActive(!pip);\n this.toggleOverlay(!pip);\n this.toggleGlobalListeners(!pip);\n\n if(this.navigationItem) {\n if(pip) appNavigationController.removeItem(this.navigationItem);\n else appNavigationController.pushItem(this.navigationItem);\n }\n\n if(useController) {\n if(pip) {\n // appMediaPlaybackController.toggleSwitchers(true);\n\n this.releaseSingleMedia(false);\n this.releaseSingleMedia = undefined;\n\n appMediaPlaybackController.setPictureInPicture(video);\n } else {\n this.releaseSingleMedia = appMediaPlaybackController.setSingleMedia(video, message as Message.message);\n }\n }\n },\n onPipClose: () => {\n // this.target = undefined;\n // this.toggleWholeActive(false);\n // this.toggleOverlay(false);\n this.close();\n }\n });\n player.addEventListener('toggleControls', (show) => {\n this.wholeDiv.classList.toggle('has-video-controls', show);\n });\n\n this.addEventListener('setMoverBefore', () => {\n this.wholeDiv.classList.remove('has-video-controls');\n this.videoPlayer.cleanup();\n this.videoPlayer = undefined;\n }, {once: true});\n\n if(this.isZooming) {\n this.videoPlayer.lockControls(false);\n }\n /* div.append(video);\n mover.append(player.wrapper); */\n });\n }\n };\n\n if(supportsStreaming) {\n onAnimationEnd.then(() => {\n if(video.readyState < video.HAVE_FUTURE_DATA) {\n // console.log('ppp 1');\n preloader.attach(mover, true);\n }\n\n /* canPlayThrough.then(() => {\n preloader.detach();\n }); */\n });\n\n const attachCanPlay = () => {\n video.addEventListener('canplay', () => {\n // console.log('ppp 2');\n preloader.detach();\n video.parentElement.classList.remove('is-buffering');\n }, {once: true});\n };\n\n video.addEventListener('waiting', () => {\n const loading = video.networkState === video.NETWORK_LOADING;\n const isntEnoughData = video.readyState < video.HAVE_FUTURE_DATA;\n\n // this.log('video waiting for progress', loading, isntEnoughData);\n if(loading && isntEnoughData) {\n attachCanPlay();\n\n // console.log('ppp 3');\n preloader.attach(mover, true);\n\n // поставлю класс для плеера, чтобы убрать большую иконку пока прелоадер на месте\n video.parentElement.classList.add('is-buffering');\n }\n });\n\n if(this.wholeDiv.classList.contains('no-forwards')) {\n video.addEventListener('contextmenu', (e) => {\n cancelEvent(e);\n });\n }\n\n attachCanPlay();\n }\n\n // if(!video.src || media.url !== video.src) {\n const load = async() => {\n /* if(useController) {\n appMediaPlaybackController.resolveWaitingForLoadMedia(message.peerId, message.mid, message.pFlags.is_scheduled);\n } */\n\n const promise: Promise = supportsStreaming ? Promise.resolve() : appDownloadManager.downloadMediaURL({media});\n\n if(!supportsStreaming) {\n onAnimationEnd.then(async() => {\n if(!(await getCacheContext()).url) {\n // console.log('ppp 4');\n preloader.attach(mover, true, promise);\n }\n });\n }\n\n Promise.all([promise, onAnimationEnd]).then(async() => {\n if(this.tempId !== tempId) {\n this.log.warn('media viewer changed video');\n return;\n }\n\n const url = (await getCacheContext()).url;\n\n video.addEventListener('error', () => {\n toastNew({\n langPackKey: IS_MOBILE ? 'Video.Unsupported.Mobile' : 'Video.Unsupported.Desktop'\n });\n\n if(video.error.code !== 4) {\n this.log.error('Error ' + video.error.code + '; details: ' + video.error.message);\n }\n\n preloader?.detach();\n }, {once: true});\n\n if(target instanceof SVGSVGElement/* && (video.parentElement || !isSafari) */) { // if video exists\n // if(!video.parentElement) {\n div.firstElementChild.lastElementChild.append(video);\n // }\n } else {\n renderImageFromUrl(video, url);\n }\n\n // * have to set options (especially playbackRate) after src\n // * https://github.com/videojs/video.js/issues/2516\n if(useController) {\n this.releaseSingleMedia = appMediaPlaybackController.setSingleMedia(video, message as Message.message);\n\n this.addEventListener('setMoverBefore', () => {\n if(this.releaseSingleMedia) {\n this.releaseSingleMedia();\n this.releaseSingleMedia = undefined;\n }\n }, {once: true});\n }\n\n this.updateMediaSource(target, url, 'video');\n\n createPlayer();\n });\n\n return promise;\n };\n\n this.lazyLoadQueue.unshift({load});\n // } else createPlayer();\n });\n\n setMoverPromise = thumbPromise.then(set);\n } else {\n const set = () => this.setMoverToTarget(target, false, fromRight).then(({onAnimationEnd}) => {\n // return; // set and don't move\n // if(wasActive) return;\n // return;\n\n const load = async() => {\n const cancellablePromise = isDocument ? appDownloadManager.downloadMediaURL({media}) : appDownloadManager.downloadMediaURL({media, thumb: size});\n\n const photoSizes = !isDocument && media.sizes.slice().filter((size) => (size as PhotoSize.photoSize).w) as PhotoSize.photoSize[];\n photoSizes && photoSizes.sort((a, b) => b.size - a.size);\n const fullPhotoSize = photoSizes?.[0];\n const cancellableFullPromise = !isDocument && fullPhotoSize !== size && appDownloadManager.downloadMediaURL({media, thumb: fullPhotoSize});\n\n onAnimationEnd.then(async() => {\n if(!(await getCacheContext()).url) {\n this.preloader.attachPromise(cancellablePromise);\n // this.preloader.attach(mover, true, cancellablePromise);\n }\n });\n\n Promise.all([onAnimationEnd, cancellablePromise]).then(async() => {\n if(this.tempId !== tempId) {\n this.log.warn('media viewer changed photo');\n return;\n }\n\n const url = (await getCacheContext()).url;\n if(target instanceof SVGSVGElement) {\n this.updateMediaSource(target, url, 'img');\n this.updateMediaSource(mover, url, 'img');\n\n if(mediaSizes.isMobile) {\n const imgs = mover.querySelectorAll('img');\n imgs.forEach((img) => {\n img.classList.remove('thumbnail'); // может здесь это вообще не нужно\n });\n }\n } else {\n const div = mover.firstElementChild && mover.firstElementChild.classList.contains('media-viewer-aspecter') ? mover.firstElementChild : mover;\n const haveImage = ['CANVAS', 'IMG'].includes(div.firstElementChild?.tagName) ? div.firstElementChild as HTMLElement : null;\n if((haveImage as HTMLImageElement)?.src !== url) {\n const image = new Image();\n image.classList.add('thumbnail');\n\n renderImageFromUrl(image, url, () => {\n fastRaf(() => {\n this.updateMediaSource(target, url, 'img');\n\n if(haveImage) {\n fastRaf(() => {\n haveImage.remove();\n });\n }\n\n div.append(image);\n });\n }, false);\n\n cancellableFullPromise && cancellableFullPromise.then((url) => {\n const fullImage = new Image();\n fullImage.classList.add('thumbnail');\n renderImageFromUrl(fullImage, url, () => {\n fastRaf(() => {\n image.replaceWith(fullImage);\n });\n }, false);\n });\n }\n }\n\n // this.preloader.detach();\n }).catch((err) => {\n this.log.error(err);\n this.preloader.attach(mover);\n this.preloader.setManual();\n });\n\n return cancellablePromise;\n };\n\n this.lazyLoadQueue.unshift({load});\n });\n\n setMoverPromise = thumbPromise.then(set);\n }\n\n return this.setMoverPromise = setMoverPromise.catch(() => {\n this.setMoverAnimationPromise = null;\n }).finally(() => {\n this.setMoverPromise = null;\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function fillPropertyValue(str: string) {\n const splitted = str.split(' ');\n if(splitted.length !== 4) {\n if(!splitted[0]) splitted[0] = '0px';\n for(let i = splitted.length; i < 4; ++i) {\n splitted[i] = splitted[i % 2] || splitted[0] || '0px';\n }\n }\n\n return splitted;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport {IS_MOBILE_SAFARI} from '../environment/userAgent';\nimport {logger} from '../lib/logger';\nimport blurActiveElement from '../helpers/dom/blurActiveElement';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport isSwipingBackSafari from '../helpers/dom/isSwipingBackSafari';\nimport indexOfAndSplice from '../helpers/array/indexOfAndSplice';\n\nexport type NavigationItem = {\n type: 'left' | 'right' | 'im' | 'chat' | 'popup' | 'media' | 'menu' |\n 'esg' | 'multiselect' | 'input-helper' | 'autocomplete-helper' | 'markup' |\n 'global-search' | 'voice' | 'mobile-search' | 'filters' | 'global-search-focus' |\n 'toast' | 'dropdown' | 'forum',\n onPop: (canAnimate: boolean) => boolean | void,\n onEscape?: () => boolean,\n noHistory?: boolean,\n noBlurOnPop?: boolean,\n};\n\nexport class AppNavigationController {\n private navigations: Array;\n private id: number;\n private manual: boolean;\n private log: ReturnType;\n private debug: boolean;\n private currentHash: string; // have to start with # if not empty\n private overriddenHash: string; // have to start with # if not empty\n private isPossibleSwipe: boolean;\n public onHashChange: () => void;\n\n constructor() {\n this.navigations = [];\n this.id = Date.now();\n this.manual = false;\n this.log = logger('NC');\n this.debug = true;\n this.currentHash = window.location.hash;\n this.overriddenHash = '';\n this.isPossibleSwipe = false;\n\n window.addEventListener('popstate', this.onPopState);\n window.addEventListener('keydown', this.onKeyDown, {capture: true, passive: false});\n\n if(IS_MOBILE_SAFARI) {\n const options = {passive: true};\n window.addEventListener('touchstart', this.onTouchStart, options);\n }\n\n history.scrollRestoration = 'manual';\n\n this.pushState(); // * push init state\n }\n\n private onPopState = (e: PopStateEvent) => {\n const hash = window.location.hash;\n const id: number = e.state;\n this.debug && this.log('popstate', e, this.isPossibleSwipe, hash);\n if(hash !== this.currentHash) {\n this.debug && this.log.warn(`hash changed, new=${hash}, current=${this.currentHash}, overridden=${this.overriddenHash}`);\n // fix for returning to wrong hash (e.g. chat -> archive -> chat -> 3x back)\n if(id === this.id && this.overriddenHash && this.overriddenHash !== hash) {\n this.overrideHash(this.overriddenHash);\n } else if(id/* === this.id */ && !this.overriddenHash && hash) {\n this.overrideHash();\n } else {\n this.currentHash = hash;\n this.onHashChange && this.onHashChange();\n // this.replaceState();\n return;\n }\n }\n\n if(id !== this.id/* && !this.navigations.length */) {\n this.pushState();\n\n if(!this.navigations.length) {\n return;\n }\n }\n\n const item = this.navigations.pop();\n if(!item) {\n this.pushState();\n return;\n }\n\n this.manual = !this.isPossibleSwipe;\n this.handleItem(item);\n // this.pushState(); // * prevent adding forward arrow\n };\n\n private onKeyDown = (e: KeyboardEvent) => {\n const item = this.navigations[this.navigations.length - 1];\n if(!item) return;\n if(e.key === 'Escape' && (item.onEscape ? item.onEscape() : true)) {\n cancelEvent(e);\n this.back(item.type);\n }\n };\n\n private onTouchStart = (e: TouchEvent) => {\n if(e.touches.length > 1) return;\n this.debug && this.log('touchstart');\n\n if(isSwipingBackSafari(e)) {\n this.isPossibleSwipe = true;\n\n window.addEventListener('touchend', () => {\n setTimeout(() => {\n this.isPossibleSwipe = false;\n }, 100);\n }, {passive: true, once: true});\n }\n\n /* const detach = () => {\n window.removeEventListener('touchend', onTouchEnd);\n window.removeEventListener('touchmove', onTouchMove);\n };\n\n let moved = false;\n const onTouchMove = (e: TouchEvent) => {\n this.debug && this.log('touchmove');\n if(e.touches.length > 1) {\n detach();\n return;\n }\n\n moved = true;\n };\n\n const onTouchEnd = (e: TouchEvent) => {\n this.debug && this.log('touchend');\n if(e.touches.length > 1 || !moved) {\n detach();\n return;\n }\n\n isPossibleSwipe = true;\n doubleRaf().then(() => {\n isPossibleSwipe = false;\n });\n\n detach();\n };\n\n window.addEventListener('touchend', onTouchEnd, options);\n window.addEventListener('touchmove', onTouchMove, options); */\n };\n\n public overrideHash(hash: string = '') {\n if(hash && hash[0] !== '#') hash = '#' + hash;\n else if(hash === '#') hash = '';\n\n if(this.currentHash === hash) {\n return;\n }\n\n this.overriddenHash = this.currentHash = hash;\n this.replaceState();\n this.pushState();\n }\n\n private handleItem(item: NavigationItem) {\n const good = item.onPop(!this.manual ? false : undefined);\n this.debug && this.log('popstate, navigation:', item, this.navigations);\n if(good === false) {\n this.pushItem(item);\n } else if(!item.noBlurOnPop) {\n blurActiveElement(); // no better place for it\n }\n\n this.manual = false;\n }\n\n public findItemByType(type: NavigationItem['type']) {\n for(let i = this.navigations.length - 1; i >= 0; --i) {\n const item = this.navigations[i];\n if(item.type === type) {\n return {item, index: i};\n }\n }\n }\n\n public back(type?: NavigationItem['type']) {\n if(type) {\n const ret = this.findItemByType(type);\n if(ret) {\n this.backByItem(ret.item, ret.index);\n return;\n }\n }\n\n history.back();\n }\n\n public backByItem(item: NavigationItem, index = this.navigations.indexOf(item)) {\n this.manual = true;\n // ! commented because 'popstate' event will be fired with delay\n // if(index !== (this.navigations.length - 1)) {\n this.navigations.splice(index, 1);\n this.handleItem(item);\n // }\n }\n\n private onItemAdded(item: NavigationItem) {\n this.debug && this.log('onItemAdded', item, this.navigations);\n\n if(!item.noHistory) {\n this.pushState();\n }\n }\n\n public pushItem(item: NavigationItem) {\n this.navigations.push(item);\n this.onItemAdded(item);\n }\n\n public unshiftItem(item: NavigationItem) {\n this.navigations.unshift(item);\n this.onItemAdded(item);\n }\n\n public spliceItems(index: number, length: number, ...items: NavigationItem[]) {\n this.navigations.splice(index, length, ...items);\n items.forEach((item) => {\n this.onItemAdded(item);\n });\n }\n\n private pushState() {\n this.debug && this.log('push');\n this.manual = false;\n history.pushState(this.id, '');\n }\n\n public replaceState() {\n this.debug && this.log.warn('replace');\n\n const url = location.origin + location.pathname + location.search + this.overriddenHash;\n history.replaceState(this.id, '', url);\n }\n\n public removeItem(item: NavigationItem) {\n if(!item) {\n return;\n }\n\n indexOfAndSplice(this.navigations, item);\n }\n\n public removeByType(type: NavigationItem['type'], single = false) {\n for(let i = this.navigations.length - 1; i >= 0; --i) {\n const item = this.navigations[i];\n if(item.type === type) {\n this.navigations.splice(i, 1);\n\n if(single) {\n break;\n }\n }\n }\n }\n}\n\nconst appNavigationController = new AppNavigationController();\nMOUNT_CLASS_TO.appNavigationController = appNavigationController;\nexport default appNavigationController;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appDialogsManager from '../lib/appManagers/appDialogsManager';\nimport Scrollable from './scrollable';\nimport InputSearch from './inputSearch';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport {i18n, LangPackKey} from '../lib/langPack';\nimport rootScope from '../lib/rootScope';\n\nexport class SearchGroup {\n container: HTMLDivElement;\n nameEl: HTMLDivElement;\n list: HTMLUListElement;\n\n constructor(\n public name: LangPackKey | boolean,\n public type: string,\n private clearable = true,\n className?: string,\n clickable = true,\n public autonomous = true,\n public onFound?: () => void,\n public noIcons?: boolean\n ) {\n this.list = appDialogsManager.createChatList();\n this.container = document.createElement('div');\n if(className) this.container.className = className;\n\n if(name) {\n this.nameEl = document.createElement('div');\n this.nameEl.classList.add('search-group__name');\n if(typeof(name) === 'string') {\n this.nameEl.append(i18n(name));\n }\n this.container.append(this.nameEl);\n }\n\n this.container.classList.add('search-group', 'search-group-' + type);\n this.container.append(this.list);\n this.container.style.display = 'none';\n\n if(clickable) {\n appDialogsManager.setListClickListener(this.list, onFound, undefined, autonomous);\n }\n }\n\n clear() {\n this.container.style.display = 'none';\n\n if(this.clearable) {\n this.list.innerHTML = '';\n }\n }\n\n setActive() {\n this.container.style.display = '';\n }\n\n toggle() {\n if(this.list.childElementCount) {\n this.setActive();\n } else {\n this.clear();\n }\n }\n}\n\nexport type SearchGroupType = 'contacts' | 'globalContacts' | 'messages' | string;\n\nexport default class AppSearch {\n private minMsgId = 0;\n private loadedCount = -1;\n private foundCount = -1;\n\n private searchPromise: Promise = null;\n private searchTimeout: number = 0;\n\n private query = '';\n\n private listsContainer: HTMLDivElement = null;\n\n private peerId: PeerId; // 0 - means global\n private threadId = 0;\n\n private scrollable: Scrollable;\n\n constructor(\n public container: HTMLElement,\n public searchInput: InputSearch,\n public searchGroups: {[group in SearchGroupType]: SearchGroup},\n public onSearch?: (count: number) => void,\n public noIcons?: boolean\n ) {\n this.scrollable = new Scrollable(this.container);\n this.listsContainer = this.scrollable.container as HTMLDivElement;\n for(const i in this.searchGroups) {\n this.listsContainer.append(this.searchGroups[i as SearchGroupType].container);\n }\n\n if(this.searchGroups.messages) {\n this.scrollable.setVirtualContainer(this.searchGroups.messages.list);\n }\n\n this.searchInput.onChange = (value) => {\n /* if(!value.trim()) {\n //this.peerId = 0;\n return;\n } */\n\n this.query = value;\n this.reset(false);\n this.searchMore();\n };\n\n this.scrollable.onScrolledBottom = () => {\n if(!this.query.trim()) return;\n\n if(!this.searchTimeout) {\n this.searchTimeout = window.setTimeout(() => {\n this.searchMore();\n this.searchTimeout = 0;\n }, 0);\n }\n };\n }\n\n public reset(all = true) {\n if(all) {\n this.searchInput.value = '';\n this.query = '';\n this.peerId = undefined;\n this.threadId = 0;\n }\n\n this.minMsgId = 0;\n this.loadedCount = -1;\n this.foundCount = -1;\n\n for(const i in this.searchGroups) {\n this.searchGroups[i as SearchGroupType].clear();\n }\n\n this.searchPromise = null;\n }\n\n public beginSearch(peerId?: PeerId, threadId = 0, query = '') {\n this.peerId = peerId;\n this.threadId = threadId;\n\n if(this.query !== query) {\n this.searchInput.inputField.value = query;\n }\n\n this.searchInput.input.focus();\n }\n\n public searchMore() {\n if(this.searchPromise) return this.searchPromise;\n\n const query = this.query;\n\n if(!query.trim()) {\n this.onSearch && this.onSearch(0);\n return;\n }\n\n if(this.foundCount !== -1 && this.loadedCount >= this.foundCount) {\n return Promise.resolve();\n }\n\n const maxId = this.minMsgId || 0;\n\n return this.searchPromise = rootScope.managers.appMessagesManager.getSearch({\n peerId: this.peerId,\n query,\n inputFilter: {_: 'inputMessagesFilterEmpty'},\n maxId,\n limit: 20,\n threadId: this.threadId\n }).then((res) => {\n this.searchPromise = null;\n\n if(this.searchInput.value !== query) {\n return;\n }\n\n // console.log('input search result:', this.peerId, query, null, maxId, 20, res);\n\n const {count, history} = res;\n\n if(history.length && history[0].mid === this.minMsgId) {\n history.shift();\n }\n\n const searchGroup = this.searchGroups.messages;\n\n history.forEach((message) => {\n try {\n const peerId = this.peerId ? message.fromId : message.peerId;\n appDialogsManager.addDialogAndSetLastMessage({\n peerId,\n container: this.scrollable/* searchGroup.list */,\n avatarSize: 'bigger',\n meAsSaved: false,\n message,\n query,\n noIcons: this.noIcons\n });\n } catch(err) {\n console.error('[appSearch] render search result', err);\n }\n });\n\n searchGroup.toggle();\n\n this.minMsgId = history.length && history[history.length - 1].mid;\n\n if(this.loadedCount === -1) {\n this.loadedCount = 0;\n }\n this.loadedCount += history.length;\n\n if(this.foundCount === -1) {\n this.foundCount = count;\n\n if(searchGroup.nameEl) {\n replaceContent(searchGroup.nameEl, i18n(count ? 'Chat.Search.MessagesFound' : 'Chat.Search.NoMessagesFound', [count]));\n }\n\n this.onSearch && this.onSearch(this.foundCount);\n }\n }).catch((err) => {\n console.error('search error', err);\n this.searchPromise = null;\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyInputMessagesFilter, MyMessage} from '../lib/appManagers/appMessagesManager';\nimport appDialogsManager, {DIALOG_LIST_ELEMENT_TAG} from '../lib/appManagers/appDialogsManager';\nimport {logger} from '../lib/logger';\nimport rootScope from '../lib/rootScope';\nimport {SearchGroup, SearchGroupType} from './appSearch';\nimport {horizontalMenu} from './horizontalMenu';\nimport LazyLoadQueue from './lazyLoadQueue';\nimport {putPreloader} from './putPreloader';\nimport ripple from './ripple';\nimport Scrollable, {ScrollableX} from './scrollable';\nimport useHeavyAnimationCheck, {getHeavyAnimationPromise} from '../hooks/useHeavyAnimationCheck';\nimport I18n, {LangPackKey, i18n} from '../lib/langPack';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport {getMiddleware, Middleware} from '../helpers/middleware';\nimport {ChannelParticipant, Chat, ChatFull, ChatParticipant, ChatParticipants, Document, Message, MessageMedia, Photo, User, WebPage} from '../layer';\nimport SortedUserList from './sortedUserList';\nimport findUpTag from '../helpers/dom/findUpTag';\nimport appSidebarRight from './sidebarRight';\nimport mediaSizes from '../helpers/mediaSizes';\nimport appImManager from '../lib/appManagers/appImManager';\nimport positionElementByIndex from '../helpers/dom/positionElementByIndex';\nimport cleanSearchText from '../helpers/cleanSearchText';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport handleTabSwipe from '../helpers/dom/handleTabSwipe';\nimport windowSize from '../helpers/windowSize';\nimport {formatPhoneNumber} from '../helpers/formatPhoneNumber';\nimport {ButtonMenuItemOptions, ButtonMenuSync} from './buttonMenu';\nimport PopupForward from './popups/forward';\nimport PopupDeleteMessages from './popups/deleteMessages';\nimport Row from './row';\nimport htmlToDocumentFragment from '../helpers/dom/htmlToDocumentFragment';\nimport {SearchSelection} from './chat/selection';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent, simulateClickEvent} from '../helpers/dom/clickEvent';\nimport {MyDocument} from '../lib/appManagers/appDocsManager';\nimport AppMediaViewer from './appMediaViewer';\nimport lockTouchScroll from '../helpers/dom/lockTouchScroll';\nimport copy from '../helpers/object/copy';\nimport getObjectKeysAndSort from '../helpers/object/getObjectKeysAndSort';\nimport safeAssign from '../helpers/object/safeAssign';\nimport escapeRegExp from '../helpers/string/escapeRegExp';\nimport findAndSplice from '../helpers/array/findAndSplice';\nimport {ScrollStartCallbackDimensions} from '../helpers/fastSmoothScroll';\nimport setInnerHTML from '../helpers/dom/setInnerHTML';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport choosePhotoSize from '../lib/appManagers/utils/photos/choosePhotoSize';\nimport wrapWebPageDescription from './wrappers/webPageDescription';\nimport wrapWebPageTitle from './wrappers/webPageTitle';\nimport wrapAbbreviation from '../lib/richTextProcessor/wrapAbbreviation';\nimport matchUrl from '../lib/richTextProcessor/matchUrl';\nimport wrapPlainText from '../lib/richTextProcessor/wrapPlainText';\nimport wrapRichText from '../lib/richTextProcessor/wrapRichText';\nimport wrapSenderToPeer from './wrappers/senderToPeer';\nimport wrapSentTime from './wrappers/sentTime';\nimport getMediaFromMessage from '../lib/appManagers/utils/messages/getMediaFromMessage';\nimport filterMessagesByInputFilter from '../lib/appManagers/utils/messages/filterMessagesByInputFilter';\nimport getChatMembersString from './wrappers/getChatMembersString';\nimport getUserStatusString from './wrappers/getUserStatusString';\nimport getParticipantPeerId from '../lib/appManagers/utils/chats/getParticipantPeerId';\nimport {Awaited} from '../types';\nimport {attachContextMenuListener} from '../helpers/dom/attachContextMenuListener';\nimport contextMenuController from '../helpers/contextMenuController';\nimport positionMenu from '../helpers/positionMenu';\nimport apiManagerProxy from '../lib/mtproto/mtprotoworker';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport SwipeHandler from './swipeHandler';\nimport wrapDocument from './wrappers/document';\nimport wrapPhoto from './wrappers/photo';\nimport wrapVideo from './wrappers/video';\nimport noop from '../helpers/noop';\nimport wrapMediaSpoiler, {onMediaSpoilerClick} from './wrappers/mediaSpoiler';\nimport filterAsync from '../helpers/array/filterAsync';\nimport ChatContextMenu from './chat/contextMenu';\n\n// const testScroll = false;\n\nexport type SearchSuperType = MyInputMessagesFilter/* | 'members' */;\nexport type SearchSuperContext = {\n peerId: PeerId,\n inputFilter: {_: MyInputMessagesFilter},\n query?: string,\n maxId?: number,\n folderId?: number,\n threadId?: number,\n date?: number,\n nextRate?: number,\n minDate?: number,\n maxDate?: number\n};\n\nexport type SearchSuperMediaType = 'members' | 'media' | 'files' | 'links' | 'music' | 'chats' | 'voice' | 'groups';\nexport type SearchSuperMediaTab = {\n inputFilter: SearchSuperType,\n name: LangPackKey,\n type: SearchSuperMediaType,\n contentTab?: HTMLElement,\n menuTab?: HTMLElement,\n scroll?: {scrollTop: number, scrollHeight: number}\n};\n\nclass SearchContextMenu {\n private buttons: (ButtonMenuItemOptions & {verify?: () => boolean | Promise, withSelection?: true})[];\n private element: HTMLElement;\n private target: HTMLElement;\n private peerId: PeerId;\n private mid: number;\n private isSelected: boolean;\n private managers: AppManagers;\n private noForwards: boolean;\n private message: MyMessage;\n private selectedMessages: MyMessage[];\n\n constructor(\n private attachTo: HTMLElement,\n private searchSuper: AppSearchSuper,\n private listenerSetter: ListenerSetter\n ) {\n this.managers = searchSuper.managers;\n\n const onContextMenu: Parameters[0]['callback'] = (e) => {\n if(this.init) {\n this.init();\n this.init = null;\n }\n\n let item: HTMLElement;\n try {\n item = findUpClassName(e.target, 'search-super-item');\n } catch(e) {}\n\n if(!item) return;\n\n if(e instanceof MouseEvent) e.preventDefault();\n if(this.element.classList.contains('active')) {\n return false;\n }\n if(e instanceof MouseEvent) e.cancelBubble = true;\n\n const r = async() => {\n this.target = item;\n this.peerId = item.dataset.peerId.toPeerId();\n this.mid = +item.dataset.mid;\n this.isSelected = searchSuper.selection.isMidSelected(this.peerId, this.mid);\n this.message = await this.managers.appMessagesManager.getMessageByPeer(this.peerId, this.mid);\n this.noForwards = searchSuper.selection.isSelecting ?\n this.searchSuper.selection.selectionForwardBtn.classList.contains('hide') :\n !(await this.managers.appMessagesManager.canForward(this.message));\n this.selectedMessages = searchSuper.selection.isSelecting ? await searchSuper.selection.getSelectedMessages() : undefined;\n\n await Promise.all(this.buttons.map(async(button) => {\n let good: boolean;\n\n if(this.searchSuper.selection.isSelecting && !button.withSelection) {\n good = false;\n } else {\n good = button.verify ? !!(await button.verify()) : true;\n }\n\n button.element.classList.toggle('hide', !good);\n }));\n\n item.classList.add('menu-open');\n\n positionMenu(e, this.element);\n contextMenuController.openBtnMenu(this.element, () => {\n item.classList.remove('menu-open');\n });\n };\n\n r();\n };\n\n if(IS_TOUCH_SUPPORTED) {\n\n } else {\n attachContextMenuListener({\n element: attachTo,\n callback: onContextMenu as any,\n listenerSetter\n });\n }\n }\n\n private init() {\n this.buttons = [{\n icon: 'forward',\n text: 'Forward',\n onClick: this.onForwardClick,\n verify: () => !this.noForwards\n }, {\n icon: 'forward',\n text: 'Message.Context.Selection.Forward',\n onClick: this.onForwardClick,\n verify: () => this.searchSuper.selection.isSelecting && !this.noForwards,\n withSelection: true\n }, {\n icon: 'download',\n text: 'MediaViewer.Context.Download',\n onClick: () => ChatContextMenu.onDownloadClick(this.message, this.noForwards),\n verify: () => !this.searchSuper.selection.isSelecting && ChatContextMenu.canDownload(this.message, undefined, this.noForwards)\n }, {\n icon: 'download',\n text: 'Message.Context.Selection.Download',\n onClick: () => ChatContextMenu.onDownloadClick(this.selectedMessages, this.noForwards),\n verify: () => this.searchSuper.selection.isSelecting && ChatContextMenu.canDownload(this.selectedMessages, undefined, this.noForwards),\n withSelection: true\n }, {\n icon: 'message',\n text: 'Message.Context.Goto',\n onClick: this.onGotoClick,\n withSelection: true\n }, {\n icon: 'select',\n text: 'Message.Context.Select',\n onClick: this.onSelectClick,\n verify: () => !this.isSelected,\n withSelection: true\n }, {\n icon: 'select',\n text: 'Message.Context.Selection.Clear',\n onClick: this.onClearSelectionClick,\n verify: () => this.isSelected,\n withSelection: true\n }, {\n icon: 'delete danger',\n text: 'Delete',\n onClick: this.onDeleteClick,\n verify: () => !this.searchSuper.selection.isSelecting && this.managers.appMessagesManager.canDeleteMessage(this.message)\n }, {\n icon: 'delete danger',\n text: 'Message.Context.Selection.Delete',\n onClick: this.onDeleteClick,\n verify: () => this.searchSuper.selection.isSelecting && !this.searchSuper.selection.selectionDeleteBtn.classList.contains('hide'),\n withSelection: true\n }];\n\n this.element = ButtonMenuSync({buttons: this.buttons, listenerSetter: this.listenerSetter});\n this.element.classList.add('search-contextmenu', 'contextmenu');\n document.getElementById('page-chats').append(this.element);\n }\n\n private onGotoClick = () => {\n appImManager.setInnerPeer({\n peerId: this.peerId,\n lastMsgId: this.mid,\n threadId: this.searchSuper.searchContext.threadId\n });\n };\n\n private onForwardClick = () => {\n if(this.searchSuper.selection.isSelecting) {\n simulateClickEvent(this.searchSuper.selection.selectionForwardBtn);\n } else {\n new PopupForward({\n [this.peerId]: [this.mid]\n });\n }\n };\n\n private onSelectClick = () => {\n this.searchSuper.selection.toggleByElement(this.target);\n };\n\n private onClearSelectionClick = () => {\n this.searchSuper.selection.cancelSelection();\n };\n\n private onDeleteClick = () => {\n if(this.searchSuper.selection.isSelecting) {\n simulateClickEvent(this.searchSuper.selection.selectionDeleteBtn);\n } else {\n new PopupDeleteMessages(this.peerId, [this.mid], 'chat');\n }\n };\n}\n\nexport type ProcessSearchSuperResult = {\n message: Message.message,\n middleware: Middleware,\n promises: Promise[],\n elemsToAppend: {element: HTMLElement, message: any}[],\n inputFilter: MyInputMessagesFilter,\n searchGroup?: SearchGroup\n};\n\nexport default class AppSearchSuper {\n public tabs: {[t in SearchSuperType]: HTMLDivElement} = {} as any;\n\n public mediaTab: SearchSuperMediaTab;\n\n public container: HTMLElement;\n public nav: HTMLElement;\n public navScrollableContainer: HTMLDivElement;\n public tabsContainer: HTMLElement;\n public navScrollable: ScrollableX;\n private tabsMenu: HTMLElement;\n private prevTabId = -1;\n\n private lazyLoadQueue = new LazyLoadQueue();\n public middleware = getMiddleware();\n\n public historyStorage: Partial<{[type in SearchSuperType]: {mid: number, peerId: PeerId}[]}> = {};\n public usedFromHistory: Partial<{[type in SearchSuperType]: number}> = {};\n\n public searchContext: SearchSuperContext;\n public loadMutex: Promise = Promise.resolve();\n\n private nextRates: Partial<{[type in SearchSuperType]: number}> = {};\n private loadPromises: Partial<{[type in SearchSuperType]: Promise}> = {};\n private loaded: Partial<{[type in SearchSuperType]: boolean}> = {};\n private loadedChats = false;\n private firstLoad = true;\n\n private log = logger('SEARCH-SUPER');\n public selectTab: ReturnType;\n\n private monthContainers: Partial<{\n [type in SearchSuperType]: {\n [timestamp: number]: {\n container: HTMLElement,\n items: HTMLElement\n }\n }\n }> = {};\n\n private searchGroupMedia: SearchGroup;\n\n public mediaTabsMap: Map = new Map();\n\n private membersList: SortedUserList;\n\n private skipScroll: boolean;\n\n // * arguments\n public mediaTabs: SearchSuperMediaTab[];\n public scrollable: Scrollable;\n public searchGroups?: {[group in SearchGroupType]: SearchGroup};\n public asChatList? = false;\n public groupByMonth? = true;\n public hideEmptyTabs? = true;\n public onChangeTab?: (mediaTab: SearchSuperMediaTab) => void;\n public showSender? = false;\n\n private searchContextMenu: SearchContextMenu;\n public selection: SearchSelection;\n\n public scrollStartCallback: (dimensions: ScrollStartCallbackDimensions) => void;\n\n public managers: AppManagers;\n private loadFirstTimePromise: Promise;\n\n private listenerSetter: ListenerSetter;\n private swipeHandler: SwipeHandler;\n\n constructor(options: Pick) {\n safeAssign(this, options);\n\n this.container = document.createElement('div');\n this.container.classList.add('search-super');\n\n this.listenerSetter = new ListenerSetter();\n this.searchContextMenu = new SearchContextMenu(this.container, this, this.listenerSetter);\n this.selection = new SearchSelection(this, this.managers, this.listenerSetter);\n\n const navScrollableContainer = this.navScrollableContainer = document.createElement('div');\n navScrollableContainer.classList.add('search-super-tabs-scrollable', 'menu-horizontal-scrollable', 'sticky');\n\n const navScrollable = this.navScrollable = new ScrollableX(navScrollableContainer);\n navScrollable.container.classList.add('search-super-nav-scrollable');\n\n const nav = this.nav = document.createElement('nav');\n nav.classList.add('search-super-tabs', 'menu-horizontal-div');\n this.tabsMenu = nav;\n\n navScrollable.container.append(nav);\n\n for(const mediaTab of this.mediaTabs) {\n const menuTab = document.createElement('div');\n menuTab.classList.add('menu-horizontal-div-item');\n const span = document.createElement('span');\n const i = document.createElement('i');\n\n span.append(i18n(mediaTab.name));\n span.append(i);\n\n menuTab.append(span);\n\n ripple(menuTab);\n\n this.tabsMenu.append(menuTab);\n\n this.mediaTabsMap.set(mediaTab.type, mediaTab);\n\n mediaTab.menuTab = menuTab;\n }\n\n this.tabsContainer = document.createElement('div');\n this.tabsContainer.classList.add('search-super-tabs-container', 'tabs-container');\n\n let unlockScroll: ReturnType;\n if(IS_TOUCH_SUPPORTED) {\n this.swipeHandler = handleTabSwipe({\n element: this.tabsContainer,\n onSwipe: (xDiff, yDiff, e) => {\n xDiff *= -1;\n yDiff *= -1;\n const prevId = this.selectTab.prevId();\n const children = Array.from(this.tabsMenu.children) as HTMLElement[];\n let idx: number;\n if(xDiff > 0) {\n for(let i = prevId + 1; i < children.length; ++i) {\n if(!children[i].classList.contains('hide')) {\n idx = i;\n break;\n }\n }\n } else {\n for(let i = prevId - 1; i >= 0; --i) {\n if(!children[i].classList.contains('hide')) {\n idx = i;\n break;\n }\n }\n }\n\n if(idx !== undefined) {\n unlockScroll = lockTouchScroll(this.tabsContainer);\n this.selectTab(idx);\n }\n },\n verifyTouchTarget: (e) => {\n return !findUpClassName(e.target, 'scrollable-x');\n }\n });\n }\n\n for(const mediaTab of this.mediaTabs) {\n const container = document.createElement('div');\n container.classList.add('search-super-container-' + mediaTab.type, 'tabs-tab');\n\n const content = document.createElement('div');\n content.classList.add('search-super-content-' + mediaTab.type);\n\n container.append(content);\n\n this.tabsContainer.append(container);\n\n this.tabs[mediaTab.inputFilter] = content;\n\n mediaTab.contentTab = content;\n }\n\n this.container.append(navScrollableContainer, this.tabsContainer);\n\n // * construct end\n\n this.searchGroupMedia = new SearchGroup(false, 'messages', true);\n\n this.scrollable.onScrolledBottom = () => {\n if(this.mediaTab.contentTab && this.canLoadMediaTab(this.mediaTab)/* && false */) {\n // this.log('onScrolledBottom will load media');\n this.load(true);\n }\n };\n // this.scroll.attachSentinels(undefined, 400);\n\n this.selectTab = horizontalMenu(this.tabsMenu, this.tabsContainer, (id, tabContent, animate) => {\n if(this.prevTabId === id && !this.skipScroll) {\n this.scrollable.scrollIntoViewNew({\n element: this.container,\n position: 'start',\n startCallback: this.scrollStartCallback\n });\n return;\n }\n\n const newMediaTab = this.mediaTabs[id];\n if(this.onChangeTab) {\n this.onChangeTab(newMediaTab);\n }\n\n const fromMediaTab = this.mediaTab;\n this.mediaTab = newMediaTab;\n\n if(this.prevTabId !== -1 && animate) {\n this.onTransitionStart();\n }\n\n if(this.skipScroll) {\n this.skipScroll = false;\n } else {\n const offsetTop = this.container.offsetTop;\n let scrollTop = this.scrollable.scrollTop;\n if(scrollTop < offsetTop) {\n this.scrollable.scrollIntoViewNew({\n element: this.container,\n position: 'start',\n startCallback: this.scrollStartCallback\n });\n scrollTop = offsetTop;\n }\n\n fromMediaTab.scroll = {scrollTop: scrollTop, scrollHeight: this.scrollable.scrollHeight};\n\n if(newMediaTab.scroll === undefined) {\n const rect = this.container.getBoundingClientRect();\n const rect2 = this.container.parentElement.getBoundingClientRect();\n const diff = rect.y - rect2.y;\n\n if(scrollTop > diff) {\n newMediaTab.scroll = {scrollTop: diff, scrollHeight: 0};\n }\n }\n\n if(newMediaTab.scroll) {\n const diff = fromMediaTab.scroll.scrollTop - newMediaTab.scroll.scrollTop;\n // console.log('what you gonna do', this.goingHard, diff);\n\n // this.scrollable.scrollTop = scrollTop;\n if(diff/* && diff < 0 */) {\n /* if(diff > -(fromMediaTab.contentTab.scrollHeight + this.nav.scrollHeight)) {\n fromMediaTab.contentTab.style.transform = `translateY(${diff}px)`;\n this.scrollable.scrollTop = scrollTop - diff;\n } else { */\n newMediaTab.contentTab.style.transform = `translateY(${diff}px)`;\n // }\n }\n }\n }\n\n /* if(this.prevTabId !== -1 && nav.offsetTop) {\n this.scrollable.scrollTop -= nav.offsetTop;\n } */\n\n /* this.log('setVirtualContainer', id, this.sharedMediaSelected, this.sharedMediaSelected.childElementCount);\n this.scroll.setVirtualContainer(this.sharedMediaSelected); */\n\n if(this.prevTabId !== -1 && !newMediaTab.contentTab.childElementCount) { // quick brown fix\n // this.contentContainer.classList.remove('loaded');\n this.load(true);\n }\n\n this.prevTabId = id;\n }, () => {\n this.scrollable.onScroll();\n\n // console.log('what y', this.tabSelected.style.transform);\n if(this.mediaTab.scroll !== undefined) {\n this.mediaTab.contentTab.style.transform = '';\n this.scrollable.scrollTop = this.mediaTab.scroll.scrollTop;\n }\n\n if(unlockScroll) {\n unlockScroll();\n unlockScroll = undefined;\n }\n\n this.onTransitionEnd();\n }, undefined, navScrollable, this.listenerSetter);\n\n attachClickEvent(this.tabsContainer, (e) => {\n if(this.selection.isSelecting) {\n cancelEvent(e);\n this.selection.toggleByElement(findUpClassName(e.target, 'search-super-item'));\n }\n }, {capture: true, passive: false, listenerSetter: this.listenerSetter});\n\n const onMediaClick = async(className: string, targetClassName: string, inputFilter: MyInputMessagesFilter, e: MouseEvent) => {\n const target = findUpClassName(e.target as HTMLDivElement, className);\n if(!target) return;\n\n const mid = +target.dataset.mid;\n if(!mid) {\n this.log.warn('no messageId by click on target:', target);\n return;\n }\n\n const mediaSpoiler: HTMLElement = target.querySelector('.media-spoiler-container');\n if(mediaSpoiler) {\n onMediaSpoilerClick({\n event: e,\n mediaSpoiler\n })\n return;\n }\n\n const peerId = target.dataset.peerId.toPeerId();\n\n const targets = (Array.from(this.tabs[inputFilter].querySelectorAll('.' + targetClassName)) as HTMLElement[]).map((el) => {\n const containerEl = findUpClassName(el, className);\n return {\n element: el,\n mid: +containerEl.dataset.mid,\n peerId: containerEl.dataset.peerId.toPeerId()\n };\n });\n\n // const ids = Object.keys(this.mediaDivsByIds).map((k) => +k).sort((a, b) => a - b);\n const idx = targets.findIndex((item) => item.mid === mid && item.peerId === peerId);\n\n const message = await this.managers.appMessagesManager.getMessageByPeer(peerId, mid);\n new AppMediaViewer()\n .setSearchContext(this.copySearchContext(inputFilter))\n .openMedia({\n message,\n target: targets[idx].element,\n fromRight: 0,\n reverse: false,\n prevTargets: targets.slice(0, idx),\n nextTargets: targets.slice(idx + 1)\n });\n };\n\n attachClickEvent(this.tabs.inputMessagesFilterPhotoVideo, onMediaClick.bind(null, 'grid-item', 'grid-item', 'inputMessagesFilterPhotoVideo'), {listenerSetter: this.listenerSetter});\n attachClickEvent(this.tabs.inputMessagesFilterDocument, onMediaClick.bind(null, 'document-with-thumb', 'media-container', 'inputMessagesFilterDocument'), {listenerSetter: this.listenerSetter});\n\n /* attachClickEvent(this.tabs.inputMessagesFilterUrl, (e) => {\n const target = e.target as HTMLElement;\n if(target.tagName === 'A') {\n return;\n }\n\n try {\n const a = findUpClassName(target, 'row').querySelector('.anchor-url:last-child') as HTMLAnchorElement;\n a.click();\n } catch(err) {}\n }); */\n\n this.mediaTab = this.mediaTabs[0];\n\n useHeavyAnimationCheck(() => {\n this.lazyLoadQueue.lock();\n }, () => {\n this.lazyLoadQueue.unlockAndRefresh(); // ! maybe not so efficient\n }, this.listenerSetter);\n }\n\n private onTransitionStart = () => {\n this.container.classList.add('sliding');\n };\n\n private onTransitionEnd = () => {\n this.container.classList.remove('sliding');\n };\n\n public filterMessagesByType(messages: any[], type: SearchSuperType): MyMessage[] {\n return filterMessagesByInputFilter(type, messages, messages.length);\n }\n\n private processEmptyFilter({message, searchGroup}: ProcessSearchSuperResult) {\n const loadPromises: Promise[] = [];\n const dialogElement = appDialogsManager.addDialogNew({\n peerId: message.peerId,\n container: searchGroup.list,\n avatarSize: 'bigger',\n loadPromises\n });\n\n const setLastMessagePromise = appDialogsManager.setLastMessageN({\n dialog: {\n _: 'dialog',\n peerId: message.peerId\n } as any,\n lastMessage: message,\n dialogElement,\n highlightWord: this.searchContext.query\n });\n\n loadPromises.push(setLastMessagePromise);\n return Promise.all(loadPromises).then(noop);\n }\n\n private async processPhotoVideoFilter({message, promises, middleware}: ProcessSearchSuperResult) {\n const media = getMediaFromMessage(message, true);\n\n const div = document.createElement('div');\n div.classList.add('grid-item');\n // this.log(message, photo);\n\n let wrapped: Awaited>;\n const size = choosePhotoSize(media, 200, 200);\n if(media._ !== 'photo') {\n wrapped = await (await wrapVideo({\n doc: media,\n message,\n container: div,\n boxWidth: 0,\n boxHeight: 0,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware,\n onlyPreview: true,\n withoutPreloader: true,\n noPlayButton: true,\n photoSize: size\n })).thumb;\n } else {\n wrapped = await wrapPhoto({\n photo: media,\n message,\n container: div,\n boxWidth: 0,\n boxHeight: 0,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware,\n withoutPreloader: true,\n noBlur: true,\n size\n });\n }\n\n if((message.media as MessageMedia.messageMediaPhoto).pFlags.spoiler) {\n const mediaSpoiler = await wrapMediaSpoiler({\n animationGroup: 'chat',\n media,\n middleware,\n width: 140,\n height: 140,\n multiply: 0.3\n });\n\n div.append(mediaSpoiler);\n }\n\n [\n wrapped.images.thumb,\n wrapped.images.full\n ].filter(Boolean).forEach((image) => {\n image.classList.add('grid-item-media');\n });\n\n promises.push(wrapped.loadPromises.thumb);\n\n return {element: div, message};\n }\n\n private async processDocumentFilter({message, inputFilter}: ProcessSearchSuperResult) {\n const document = getMediaFromMessage(message, true) as Document.document;\n const showSender = this.showSender || (['voice', 'round'] as MyDocument['type'][]).includes(document.type);\n\n const div = await wrapDocument({\n message,\n withTime: !showSender,\n fontWeight: 400,\n voiceAsMusic: true,\n showSender,\n searchContext: this.copySearchContext(inputFilter),\n lazyLoadQueue: this.lazyLoadQueue,\n autoDownloadSize: 0,\n getSize: () => 320\n });\n\n if((['audio', 'voice', 'round'] as MyDocument['type'][]).includes(document.type)) {\n div.classList.add('audio-48');\n }\n\n return {message, element: div};\n }\n\n private async processUrlFilter({message, promises, middleware}: ProcessSearchSuperResult) {\n let webPage = (message.media as MessageMedia.messageMediaWebPage)?.webpage as WebPage.webPage | WebPage.webPageEmpty;\n\n if(!webPage) {\n const entity = message.totalEntities ? message.totalEntities.find((e: any) => e._ === 'messageEntityUrl' || e._ === 'messageEntityTextUrl') : null;\n let url: string, display_url: string, sliced: string;\n\n if(!entity) {\n const match = matchUrl(message.message);\n if(!match) {\n return;\n }\n\n url = match[0];\n } else {\n sliced = message.message.slice(entity.offset, entity.offset + entity.length);\n }\n\n if(entity?._ === 'messageEntityTextUrl') {\n url = entity.url;\n // display_url = sliced;\n } else {\n url = url || sliced;\n }\n\n display_url = url;\n\n const same = message.message === url;\n if(!url.match(/^(ftp|http|https):\\/\\//)) {\n display_url = 'https://' + url;\n url = url.includes('@') ? url : 'https://' + url;\n }\n\n display_url = new URL(display_url).hostname;\n\n webPage = {\n _: 'webPage',\n url,\n display_url,\n id: '',\n hash: 0\n };\n\n if(!same) {\n webPage.description = message.message;\n }\n }\n\n if(webPage._ === 'webPageEmpty') {\n return;\n }\n\n const previewDiv = document.createElement('div');\n previewDiv.classList.add('preview');\n\n // this.log('wrapping webpage', webpage);\n\n if(webPage.photo) {\n const res = wrapPhoto({\n container: previewDiv,\n message: null,\n photo: webPage.photo as Photo.photo,\n boxWidth: 0,\n boxHeight: 0,\n withoutPreloader: true,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware,\n size: choosePhotoSize(webPage.photo as Photo.photo, 60, 60, false),\n loadPromises: promises,\n noBlur: true\n });\n } else {\n previewDiv.classList.add('empty');\n setInnerHTML(previewDiv, wrapAbbreviation(webPage.title || webPage.display_url || webPage.description || webPage.url, true));\n }\n\n const title = wrapWebPageTitle(webPage);\n\n const subtitleFragment = wrapWebPageDescription(webPage);\n const aFragment = htmlToDocumentFragment(wrapRichText(webPage.url || ''));\n const a = aFragment.firstElementChild;\n if(a instanceof HTMLAnchorElement) {\n try { // can have 'URIError: URI malformed'\n a.innerText = decodeURIComponent(a.href);\n } catch(err) {\n\n }\n }\n\n if(subtitleFragment.firstChild) {\n subtitleFragment.append('\\n');\n }\n\n subtitleFragment.append(a);\n\n if(this.showSender) {\n subtitleFragment.append('\\n', await wrapSenderToPeer(message));\n }\n\n if(!title.textContent) {\n // title = new URL(webpage.url).hostname;\n title.append(wrapPlainText(webPage.display_url.split('/', 1)[0]));\n }\n\n const row = new Row({\n title,\n titleRight: wrapSentTime(message),\n subtitle: subtitleFragment,\n havePadding: true,\n clickable: true,\n noRipple: true\n });\n\n row.applyMediaElement(previewDiv, 'big');\n\n if(row.container.innerText.trim().length) {\n return {message, element: row.container};\n }\n }\n\n public async performSearchResult(messages: any[], mediaTab: SearchSuperMediaTab, append = true) {\n const elemsToAppend: {element: HTMLElement, message: any}[] = [];\n const sharedMediaDiv: HTMLElement = mediaTab.contentTab;\n const promises: Promise[] = [];\n const middleware = this.middleware.get();\n let inputFilter = mediaTab.inputFilter;\n\n await getHeavyAnimationPromise();\n\n let searchGroup: SearchGroup;\n if(inputFilter === 'inputMessagesFilterPhotoVideo' && !!this.searchContext.query.trim()) {\n inputFilter = 'inputMessagesFilterEmpty';\n searchGroup = this.searchGroupMedia;\n sharedMediaDiv.append(searchGroup.container);\n } else if(inputFilter === 'inputMessagesFilterEmpty') {\n searchGroup = this.searchGroups.messages;\n }\n\n const options: ProcessSearchSuperResult = {\n elemsToAppend,\n inputFilter,\n message: undefined,\n middleware,\n promises,\n searchGroup\n };\n\n let processCallback: (options: ProcessSearchSuperResult) => any;\n\n // https://core.telegram.org/type/MessagesFilter\n switch(inputFilter) {\n case 'inputMessagesFilterEmpty': {\n processCallback = this.processEmptyFilter;\n break;\n }\n\n case 'inputMessagesFilterPhotoVideo': {\n processCallback = this.processPhotoVideoFilter;\n break;\n }\n\n case 'inputMessagesFilterVoice':\n case 'inputMessagesFilterRoundVoice':\n case 'inputMessagesFilterMusic':\n case 'inputMessagesFilterDocument': {\n processCallback = this.processDocumentFilter;\n break;\n }\n\n case 'inputMessagesFilterUrl': {\n processCallback = this.processUrlFilter;\n break;\n }\n\n default:\n // this.log.warn('death is my friend', messages);\n break;\n }\n\n if(processCallback) {\n processCallback = processCallback.bind(this);\n\n type K = {element: HTMLElement, message: Message.message | Message.messageService};\n const results: (Promise | K)[] = messages.map(async(message) => {\n try {\n options.message = message;\n return await processCallback(options);\n } catch(err) {\n this.log.error('error rendering filter', inputFilter, options, message, err);\n }\n });\n\n const awaited = (await Promise.all(results)).filter(Boolean);\n elemsToAppend.push(...awaited);\n }\n\n if(searchGroup && searchGroup.list.childElementCount) {\n searchGroup.setActive();\n }\n\n if(this.loadMutex) {\n promises.push(this.loadMutex);\n }\n\n if(promises.length) {\n await Promise.all(promises);\n if(!middleware()) {\n // this.log.warn('peer changed');\n return;\n }\n }\n\n if(elemsToAppend.length) {\n const method = append ? 'append' : 'prepend';\n elemsToAppend.forEach((details) => {\n const {element, message} = details;\n if(!message) {\n debugger;\n }\n\n const monthContainer = this.getMonthContainerByTimestamp(this.groupByMonth ? message.date : 0, inputFilter);\n element.classList.add('search-super-item');\n element.dataset.mid = '' + message.mid;\n element.dataset.peerId = '' + message.peerId;\n monthContainer.items[method](element);\n\n if(this.selection?.isSelecting) {\n this.selection.toggleElementCheckbox(element, true);\n }\n });\n }\n\n // if(type !== 'inputMessagesFilterEmpty') {\n this.afterPerforming(inputFilter === 'inputMessagesFilterEmpty' ? 1 : elemsToAppend.length, sharedMediaDiv);\n // }\n }\n\n private afterPerforming(length: number, contentTab: HTMLElement) {\n if(contentTab) {\n const parent = contentTab.parentElement;\n Array.from(parent.children).slice(1).forEach((child) => {\n child.remove();\n });\n\n // this.contentContainer.classList.add('loaded');\n\n if(!length && !contentTab.childElementCount) {\n const div = document.createElement('div');\n div.innerText = 'Nothing interesting here yet...';\n div.classList.add('position-center', 'text-center', 'content-empty', 'no-select');\n\n parent.append(div);\n }\n }\n }\n\n private loadChats() {\n const renderedPeerIds: Set = new Set();\n const middleware = this.middleware.get();\n\n for(const i in this.searchGroups) {\n const group = this.searchGroups[i as SearchGroupType];\n this.tabs.inputMessagesFilterEmpty.append(group.container);\n group.clear();\n }\n\n const query = this.searchContext.query;\n if(query) {\n const setResults = (results: PeerId[], group: SearchGroup, showMembersCount = false) => {\n results.map((peerId) => {\n if(renderedPeerIds.has(peerId)) {\n return;\n }\n\n renderedPeerIds.add(peerId);\n\n const {dom} = appDialogsManager.addDialogNew({\n peerId: peerId,\n container: group.list,\n avatarSize: 'abitbigger',\n autonomous: group.autonomous\n });\n\n return {dom, peerId};\n }).filter(Boolean).forEach(async({dom, peerId}) => {\n const peer = await this.managers.appPeersManager.getPeer(peerId);\n if(showMembersCount && ((peer as Chat.channel).participants_count || (peer as any).participants)) {\n const regExp = new RegExp(`(${escapeRegExp(query)}|${escapeRegExp(cleanSearchText(query))})`, 'gi');\n dom.titleSpan.innerHTML = dom.titleSpan.innerHTML.replace(regExp, '$1');\n dom.lastMessageSpan.append(await getChatMembersString(peerId.toChatId()));\n } else if(peerId === rootScope.myId) {\n dom.lastMessageSpan.append(i18n('Presence.YourChat'));\n } else {\n let username = await this.managers.appPeersManager.getPeerUsername(peerId);\n if(!username) {\n const user = await this.managers.appUsersManager.getUser(peerId);\n if(user && user.phone) {\n username = '+' + formatPhoneNumber(user.phone).formatted;\n }\n } else {\n username = '@' + username;\n }\n\n dom.lastMessageSpan.textContent = username;\n }\n });\n\n group.toggle();\n };\n\n const onLoad = (arg: T) => {\n if(!middleware()) {\n return;\n }\n\n // this.loadedContacts = true;\n\n return arg;\n };\n\n return Promise.all([\n this.managers.appUsersManager.getContactsPeerIds(query, true, undefined, 10)\n .then(onLoad)\n .then((contacts) => {\n if(contacts) {\n setResults(contacts, this.searchGroups.contacts, true);\n }\n }),\n\n this.managers.appUsersManager.searchContacts(query, 20)\n .then(onLoad)\n .then((contacts) => {\n if(contacts) {\n setResults(contacts.my_results, this.searchGroups.contacts, true);\n setResults(contacts.results/* .concat(contacts.results, contacts.results, contacts.results) */, this.searchGroups.globalContacts);\n\n this.searchGroups.globalContacts.container.classList.add('is-short');\n\n if(this.searchGroups.globalContacts.nameEl.lastElementChild !== this.searchGroups.globalContacts.nameEl.firstElementChild) {\n this.searchGroups.globalContacts.nameEl.lastElementChild.remove();\n }\n\n if(this.searchGroups.globalContacts.list.childElementCount > 3) {\n const showMore = document.createElement('div');\n showMore.classList.add('search-group__show-more');\n const intlElement = new I18n.IntlElement({\n key: 'Separator.ShowMore'\n });\n showMore.append(intlElement.element);\n this.searchGroups.globalContacts.nameEl.append(showMore);\n attachClickEvent(showMore, () => {\n const isShort = this.searchGroups.globalContacts.container.classList.toggle('is-short');\n intlElement.key = isShort ? 'Separator.ShowMore' : 'Separator.ShowLess';\n intlElement.update();\n });\n }\n }\n }),\n\n this.managers.dialogsStorage.getDialogs({query, offsetIndex: 0, limit: 20, filterId: 0})\n .then(onLoad)\n .then((value) => {\n if(value) {\n setResults(value.dialogs.map((d) => d.peerId), this.searchGroups.contacts, true);\n }\n })\n ]);\n } else if(!this.searchContext.peerId && !this.searchContext.minDate) {\n const renderRecentSearch = (setActive = true) => {\n return apiManagerProxy.getState().then((state) => {\n if(!middleware()) {\n return;\n }\n\n this.searchGroups.recent.list.replaceChildren();\n\n state.recentSearch.slice(0, 20).forEach(async(peerId) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: peerId,\n container: this.searchGroups.recent.list,\n meAsSaved: true,\n avatarSize: 'abitbigger',\n autonomous: true\n });\n\n dom.lastMessageSpan.append(await (peerId.isUser() ?\n getUserStatusString(await this.managers.appUsersManager.getUser(peerId.toUserId())) :\n getChatMembersString(peerId.toChatId())));\n });\n\n if(!state.recentSearch.length) {\n this.searchGroups.recent.clear();\n } else if(setActive) {\n this.searchGroups.recent.setActive();\n }\n });\n };\n\n return Promise.all([\n this.managers.appUsersManager.getTopPeers('correspondents').then((peers) => {\n if(!middleware()) return;\n\n const idx = peers.findIndex((peer) => peer.id === rootScope.myId);\n if(idx !== -1) {\n peers = peers.slice();\n peers.splice(idx, 1);\n }\n\n peers.forEach((peer) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: peer.id,\n container: this.searchGroups.people.list,\n onlyFirstName: true,\n avatarSize: 'bigger',\n autonomous: false,\n noIcons: this.searchGroups.people.noIcons\n });\n\n dom.subtitleEl.remove();\n });\n\n this.searchGroups.people.toggle();\n }),\n\n renderRecentSearch()\n ]);\n } else return Promise.resolve();\n }\n\n private async loadMembers(mediaTab: SearchSuperMediaTab) {\n const chatId = mediaTab.type === 'members' ? this.searchContext.peerId.toChatId() : undefined;\n const userId = mediaTab.type === 'groups' ? this.searchContext.peerId.toUserId() : undefined;\n const middleware = this.middleware.get();\n let promise: Promise;\n\n const renderParticipants = async(participants: (ChatParticipant | ChannelParticipant | Chat)[]) => {\n if(this.loadMutex) {\n await this.loadMutex;\n\n if(!middleware()) {\n return;\n }\n }\n\n let membersList = this.membersList;\n if(!membersList) {\n membersList = this.membersList = new SortedUserList({\n lazyLoadQueue: this.lazyLoadQueue,\n rippleEnabled: false,\n managers: this.managers\n });\n attachClickEvent(membersList.list, (e) => {\n const li = findUpTag(e.target, DIALOG_LIST_ELEMENT_TAG);\n if(!li) {\n return;\n }\n\n const peerId = li.dataset.peerId.toPeerId();\n let promise: Promise = Promise.resolve();\n if(mediaSizes.isMobile) {\n promise = appSidebarRight.toggleSidebar(false);\n }\n\n promise.then(() => {\n appImManager.setInnerPeer({peerId});\n });\n });\n mediaTab.contentTab.append(membersList.list);\n this.afterPerforming(1, mediaTab.contentTab);\n }\n\n const peerIds = participants.map((participant) => {\n const peerId = userId ? (participant as Chat.chat).id.toPeerId(true) : getParticipantPeerId(participant as ChannelParticipant);\n if(chatId ? peerId.isAnyChat() : peerId.isUser()) {\n return;\n }\n\n return peerId;\n }).filter(Boolean);\n\n const filtered = await filterAsync(peerIds, async(peerId) => {\n const peer: User | Chat = await this.managers.appPeersManager.getPeer(peerId);\n if(!middleware()) {\n return false;\n }\n\n if(!peer || (peer as User.user).pFlags.deleted) {\n return false;\n }\n\n return true;\n });\n\n for(const peerId of filtered) {\n membersList.add(peerId);\n }\n };\n\n if(userId) {\n const LOAD_COUNT = !this.membersList ? 50 : 200;\n promise = this.managers.appUsersManager.getCommonChats(userId, LOAD_COUNT, this.nextRates[mediaTab.inputFilter]).then((messagesChats) => {\n if(!middleware()) {\n return;\n }\n\n // const list = mediaTab.contentTab.firstElementChild as HTMLUListElement;\n const lastChat = messagesChats.chats[messagesChats.chats.length - 1];\n this.nextRates[mediaTab.inputFilter] = lastChat?.id as number;\n\n if(messagesChats.chats.length < LOAD_COUNT) {\n this.loaded[mediaTab.inputFilter] = true;\n }\n\n return renderParticipants(messagesChats.chats);\n });\n } else if(await this.managers.appChatsManager.isChannel(chatId)) {\n const LOAD_COUNT = !this.membersList ? 50 : 200;\n promise = this.managers.appProfileManager.getChannelParticipants(chatId, undefined, LOAD_COUNT, this.nextRates[mediaTab.inputFilter]).then((participants) => {\n if(!middleware()) {\n return;\n }\n\n const list = mediaTab.contentTab.firstElementChild as HTMLUListElement;\n this.nextRates[mediaTab.inputFilter] = (list ? list.childElementCount : 0) + participants.participants.length;\n\n if(participants.participants.length < LOAD_COUNT) {\n this.loaded[mediaTab.inputFilter] = true;\n }\n\n return renderParticipants(participants.participants);\n });\n } else {\n promise = this.managers.appProfileManager.getChatFull(chatId).then((chatFull) => {\n if(!middleware()) {\n return;\n }\n\n // console.log('anymore', chatFull);\n this.loaded[mediaTab.inputFilter] = true;\n const participants = (chatFull as ChatFull.chatFull).participants;\n if(participants._ === 'chatParticipantsForbidden') {\n return;\n }\n\n return renderParticipants(participants.participants);\n });\n }\n\n return this.loadPromises[mediaTab.inputFilter] = promise.finally(() => {\n if(!middleware()) {\n return;\n }\n\n this.loadPromises[mediaTab.inputFilter] = null;\n });\n }\n\n private loadType(mediaTab: SearchSuperMediaTab, justLoad: boolean, loadCount: number, middleware: () => boolean) {\n const type = mediaTab.inputFilter;\n\n if(this.loadPromises[type]) {\n return this.loadPromises[type];\n }\n\n if(mediaTab.type === 'members' || mediaTab.type === 'groups') {\n return this.loadMembers(mediaTab);\n }\n\n const history = this.historyStorage[type] ??= [];\n\n if(type === 'inputMessagesFilterEmpty' && !history.length) {\n if(!this.loadedChats) {\n this.loadChats();\n this.loadedChats = true;\n }\n\n if(!this.searchContext.query.trim() && !this.searchContext.peerId && !this.searchContext.minDate) {\n this.loaded[type] = true;\n return Promise.resolve();\n }\n }\n\n const promise = this.loadPromises[type] = Promise.resolve().then(async() => {\n // render from cache\n if(history.length && this.usedFromHistory[type] < history.length && !justLoad) {\n const messages: any[] = [];\n let used = Math.max(0, this.usedFromHistory[type]);\n let slicedLength = 0;\n\n do {\n const ids = history.slice(used, used + loadCount);\n used += ids.length;\n slicedLength += ids.length;\n\n const notFilteredMessages = await Promise.all(ids.map((m) => this.managers.appMessagesManager.getMessageByPeer(m.peerId, m.mid)));\n\n messages.push(...this.filterMessagesByType(notFilteredMessages, type));\n } while(slicedLength < loadCount && used < history.length);\n\n // если перебор\n /* if(slicedLength > loadCount) {\n let diff = messages.length - loadCount;\n messages = messages.slice(0, messages.length - diff);\n used -= diff;\n } */\n\n this.usedFromHistory[type] = used;\n // if(messages.length) {\n return this.performSearchResult(messages, mediaTab).finally(() => {\n setTimeout(() => {\n this.scrollable.checkForTriggers();\n }, 0);\n });\n // }\n }\n\n const maxId = history.length ? history[history.length - 1].mid : 0;\n\n const value = await this.managers.appMessagesManager.getSearch({\n ...this.searchContext,\n inputFilter: {_: type},\n maxId,\n limit: loadCount,\n nextRate: this.nextRates[type] ??= 0\n });\n\n history.push(...value.history.map((m) => ({mid: m.mid, peerId: m.peerId})));\n\n if(!middleware()) {\n // this.log.warn('peer changed');\n return;\n }\n\n // ! Фикс случая, когда не загружаются документы при открытой панели разработчиков (происходит из-за того, что не совпадают критерии отбора документов в getSearch)\n if(value.history.length < loadCount || (this.searchContext.folderId !== undefined && !value.next_rate) || value.history.length === value.count) {\n // if((value.count || history.length === value.count) && history.length >= value.count) {\n // this.log(logStr + 'loaded all media', value, loadCount);\n this.loaded[type] = true;\n }\n\n this.nextRates[type] = value.next_rate;\n\n if(justLoad) {\n return;\n }\n\n this.usedFromHistory[type] = history.length;\n\n if(!this.loaded[type]) {\n promise.then(() => {\n setTimeout(() => {\n if(!middleware()) return;\n // this.log('will preload more');\n if(this.mediaTab === mediaTab) {\n const promise = this.load(true, true);\n if(promise) {\n promise.then(() => {\n if(!middleware()) return;\n // this.log('preloaded more');\n setTimeout(() => {\n this.scrollable.checkForTriggers();\n }, 0);\n });\n }\n }\n }, 0);\n });\n }\n\n // if(value.history.length) {\n return this.performSearchResult(this.filterMessagesByType(value.history, type), mediaTab);\n // }\n }).catch((err) => {\n this.log.error('load error:', err);\n }).finally(() => {\n this.loadPromises[type] = null;\n });\n\n return promise;\n }\n\n private canLoadMediaTab(mediaTab: SearchSuperMediaTab) {\n const inputFilter = mediaTab.inputFilter;\n return !this.loaded[inputFilter] || (this.historyStorage[inputFilter] && this.usedFromHistory[inputFilter] < this.historyStorage[inputFilter].length);\n }\n\n private async loadFirstTime() {\n const middleware = this.middleware.get();\n const {peerId, threadId} = this.searchContext;\n if(!this.hideEmptyTabs) {\n return;\n }\n\n const mediaTabs = this.mediaTabs.filter((mediaTab) => mediaTab.inputFilter !== 'inputMessagesFilterEmpty');\n const filters = mediaTabs.map((mediaTab) => ({_: mediaTab.inputFilter}));\n\n const [counters, canViewMembers, canViewGroups] = await Promise.all([\n this.managers.appMessagesManager.getSearchCounters(peerId, filters, undefined, threadId),\n this.canViewMembers(),\n this.canViewGroups()\n ]);\n\n if(!middleware()) {\n return;\n }\n\n if(this.loadMutex) {\n await this.loadMutex;\n\n if(!middleware()) {\n return;\n }\n }\n\n let firstMediaTab: SearchSuperMediaTab;\n let count = 0;\n mediaTabs.forEach((mediaTab) => {\n const counter = counters.find((c) => c.filter._ === mediaTab.inputFilter);\n\n mediaTab.menuTab.classList.toggle('hide', !counter.count);\n mediaTab.menuTab.classList.remove('active');\n // mediaTab.contentTab.classList.toggle('hide', !counter.count);\n\n if(counter.count) {\n if(firstMediaTab === undefined) {\n firstMediaTab = mediaTab;\n }\n\n ++count;\n }\n });\n\n const membersTab = this.mediaTabsMap.get('members');\n\n const a: [SearchSuperMediaTab, boolean][] = [\n [membersTab, canViewMembers],\n [this.mediaTabsMap.get('groups'), canViewGroups]\n ];\n\n a.forEach(([tab, value]) => {\n if(!tab) {\n return;\n }\n\n tab.menuTab.classList.toggle('hide', !value);\n\n if(value) {\n ++count;\n }\n });\n\n if(canViewMembers) {\n firstMediaTab = membersTab;\n }\n\n this.container.classList.toggle('hide', !firstMediaTab);\n this.container.parentElement.classList.toggle('search-empty', !firstMediaTab);\n if(firstMediaTab) {\n this.skipScroll = true;\n this.selectTab(this.mediaTabs.indexOf(firstMediaTab), false);\n // firstMediaTab.menuTab.classList.add('active');\n\n this.navScrollableContainer.classList.toggle('hide', count <= 1);\n }\n }\n\n public async load(single = false, justLoad = false) {\n const peerId = this.searchContext.peerId;\n this.log('load', single, peerId, this.loadPromises);\n const middleware = this.middleware.get();\n\n if(this.firstLoad) {\n await (this.loadFirstTimePromise ??= this.loadFirstTime());\n if(!middleware()) {\n return;\n }\n\n this.loadFirstTimePromise = undefined;\n this.firstLoad = false;\n }\n\n let toLoad = single ? [this.mediaTab] : this.mediaTabs.filter((t) => t !== this.mediaTab);\n toLoad = toLoad.filter((mediaTab) => {\n return this.canLoadMediaTab(mediaTab);\n });\n\n if(peerId.isUser()) {\n findAndSplice(toLoad, (mediaTab) => mediaTab.type === 'members');\n } else {\n findAndSplice(toLoad, (mediaTab) => mediaTab.type === 'groups');\n }\n\n if(!toLoad.length) {\n return;\n }\n\n const loadCount = justLoad ? 50 : Math.round((windowSize.height / 130 | 0) * 3 * 1.25); // that's good for all types\n\n const promises: Promise[] = toLoad.map((mediaTab) => {\n return this.loadType(mediaTab, justLoad, loadCount, middleware);\n });\n\n return Promise.all(promises).catch((err) => {\n this.log.error('Load error all promises:', err);\n });\n }\n\n private getMonthContainerByTimestamp(timestamp: number, type: SearchSuperType) {\n const date = new Date(timestamp * 1000);\n date.setHours(0, 0, 0);\n date.setDate(1);\n const dateTimestamp = date.getTime();\n const containers = this.monthContainers[type] ?? (this.monthContainers[type] = {});\n if(!(dateTimestamp in containers)) {\n const container = document.createElement('div');\n container.className = 'search-super-month';\n\n const name = document.createElement('div');\n name.classList.add('search-super-month-name');\n\n const options: Intl.DateTimeFormatOptions = {\n month: 'long'\n };\n\n if(date.getFullYear() !== new Date().getFullYear()) {\n options.year = 'numeric';\n }\n\n const dateElement = new I18n.IntlDateElement({\n date,\n options\n }).element;\n name.append(dateElement);\n\n container.append(name);\n\n const items = document.createElement('div');\n items.classList.add('search-super-month-items');\n\n container.append(name, items);\n\n const haveTimestamps = getObjectKeysAndSort(containers, 'desc');\n let i = 0;\n for(; i < haveTimestamps.length; ++i) {\n const t = haveTimestamps[i];\n if(dateTimestamp > t) {\n break;\n }\n }\n\n containers[dateTimestamp] = {container, items};\n positionElementByIndex(container, this.tabs[type], i);\n }\n\n return containers[dateTimestamp];\n }\n\n public canViewMembers() {\n const {peerId} = this.searchContext;\n const isAnyChat = peerId.isAnyChat();\n if(!isAnyChat || !this.mediaTabsMap.has('members')) return Promise.resolve(false);\n const chatId = peerId.toChatId();\n return Promise.all([\n this.managers.appChatsManager.isBroadcast(chatId),\n this.managers.appChatsManager.hasRights(chatId, 'view_participants'),\n this.managers.appChatsManager.isForum(chatId)\n ]).then(([isBroadcast, hasRights, isForum]) => {\n return !isBroadcast && hasRights && (!this.searchContext.threadId || !isForum);\n });\n }\n\n public async canViewGroups() {\n const {peerId} = this.searchContext;\n if(!peerId.isUser() || !this.mediaTabsMap.has('groups')) return false;\n const userFull = await this.managers.appProfileManager.getProfile(peerId.toUserId());\n return !!userFull.common_chats_count;\n }\n\n public cleanup() {\n this.loadPromises = {};\n this.loaded = {};\n this.loadedChats = false;\n this.nextRates = {};\n this.firstLoad = true;\n this.prevTabId = -1;\n\n this.lazyLoadQueue.clear();\n\n this.mediaTabs.forEach((mediaTab) => {\n this.usedFromHistory[mediaTab.inputFilter] = -1;\n });\n\n if(this.selection?.isSelecting) {\n this.selection.cancelSelection();\n }\n\n // * must go to first tab (это костыль)\n /* const membersTab = this.mediaTabsMap.get('members');\n if(membersTab) {\n const tab = this.canViewMembers() ? membersTab : this.mediaTabs[this.mediaTabs.indexOf(membersTab) + 1];\n this.mediaTab = tab;\n } */\n\n this.middleware.clean();\n this.loadFirstTimePromise = undefined;\n this.cleanScrollPositions();\n this.membersList = undefined;\n }\n\n public cleanScrollPositions() {\n this.mediaTabs.forEach((mediaTab) => {\n mediaTab.scroll = undefined;\n });\n }\n\n public cleanupHTML(goFirst = false) {\n this.mediaTabs.forEach((tab) => {\n tab.contentTab.replaceChildren();\n\n if(this.hideEmptyTabs) {\n // tab.menuTab.classList.add('hide');\n this.container.classList.add('hide');\n this.container.parentElement.classList.add('search-empty');\n }\n\n if(tab.type === 'chats') {\n return;\n }\n\n if(!this.historyStorage[tab.inputFilter]) {\n const parent = tab.contentTab.parentElement;\n // if(!testScroll) {\n if(!parent.querySelector('.preloader')) {\n putPreloader(parent, true);\n }\n // }\n\n const empty = parent.querySelector('.content-empty');\n if(empty) {\n empty.remove();\n }\n }\n });\n\n /* if(goFirst) {\n const membersTab = this.mediaTabsMap.get('members');\n if(membersTab) {\n let idx = this.canViewMembers() ? 0 : 1;\n membersTab.menuTab.classList.toggle('hide', idx !== 0);\n\n this.selectTab(idx, false);\n } else {\n this.selectTab(0, false);\n }\n } */\n\n this.monthContainers = {};\n this.searchGroupMedia.clear();\n this.scrollable.scrollTop = 0;\n\n /* if(testScroll) {\n for(let i = 0; i < 1500; ++i) {\n let div = document.createElement('div');\n div.insertAdjacentHTML('beforeend', ``);\n div.classList.add('grid-item');\n div.dataset.id = '' + (i / 3 | 0);\n //div.innerText = '' + (i / 3 | 0);\n this.tabs.inputMessagesFilterPhotoVideo.append(div);\n }\n } */\n }\n\n private copySearchContext(newInputFilter: MyInputMessagesFilter) {\n const context = copy(this.searchContext);\n context.inputFilter = {_: newInputFilter};\n context.nextRate = this.nextRates[newInputFilter];\n return context;\n }\n\n public setQuery({peerId, query, threadId, historyStorage, folderId, minDate, maxDate}: {\n peerId: PeerId,\n query?: string,\n threadId?: number,\n historyStorage?: AppSearchSuper['historyStorage'],\n folderId?: number,\n minDate?: number,\n maxDate?: number\n }) {\n this.searchContext = {\n peerId,\n query: query || '',\n inputFilter: {_: this.mediaTab.inputFilter},\n threadId,\n folderId,\n minDate,\n maxDate\n };\n\n this.historyStorage = historyStorage ?? {};\n\n this.cleanup();\n }\n\n public destroy() {\n this.cleanup();\n this.listenerSetter.removeAll();\n this.scrollable.destroy();\n this.swipeHandler?.removeListeners();\n this.selection?.cleanup();\n\n this.scrollStartCallback = undefined;\n this.onChangeTab = undefined;\n this.selectTab = undefined;\n this.searchContextMenu = undefined;\n this.swipeHandler = undefined;\n this.selection = undefined;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cancelEvent from './cancelEvent';\n\nexport default function lockTouchScroll(container: HTMLElement) {\n const onTouchMove = (e: TouchEvent) => {\n cancelEvent(e);\n };\n\n let lockers = 2;\n const cb = () => {\n if(!--lockers) {\n container.removeEventListener('touchmove', onTouchMove, {capture: true});\n }\n };\n\n container.addEventListener('touchmove', onTouchMove, {capture: true, passive: false});\n container.addEventListener('touchend', cb, {once: true});\n\n return cb;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {ChatRights} from '../lib/appManagers/appChatsManager';\nimport type {Dialog} from '../lib/appManagers/appMessagesManager';\nimport appDialogsManager, {DialogElementSize as DialogElementSize} from '../lib/appManagers/appDialogsManager';\nimport rootScope from '../lib/rootScope';\nimport Scrollable from './scrollable';\nimport {FocusDirection} from '../helpers/fastSmoothScroll';\nimport CheckboxField from './checkboxField';\nimport {i18n, LangPackKey, _i18n} from '../lib/langPack';\nimport findUpAttribute from '../helpers/dom/findUpAttribute';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport PeerTitle from './peerTitle';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport debounce from '../helpers/schedulers/debounce';\nimport windowSize from '../helpers/windowSize';\nimport type {IsPeerType} from '../lib/appManagers/appPeersManager';\nimport {attachClickEvent, simulateClickEvent} from '../helpers/dom/clickEvent';\nimport filterUnique from '../helpers/array/filterUnique';\nimport indexOfAndSplice from '../helpers/array/indexOfAndSplice';\nimport safeAssign from '../helpers/object/safeAssign';\nimport findAndSplice from '../helpers/array/findAndSplice';\nimport AvatarElement from './avatar';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport filterAsync from '../helpers/array/filterAsync';\nimport getParticipantPeerId from '../lib/appManagers/utils/chats/getParticipantPeerId';\nimport getChatMembersString from './wrappers/getChatMembersString';\nimport getUserStatusString from './wrappers/getUserStatusString';\nimport {ChannelsChannelParticipants, Chat, User} from '../layer';\nimport canSendToUser from '../lib/appManagers/utils/users/canSendToUser';\nimport hasRights from '../lib/appManagers/utils/chats/hasRights';\nimport getDialogIndex from '../lib/appManagers/utils/dialogs/getDialogIndex';\nimport {generateDelimiter} from './generateDelimiter';\nimport SettingSection from './settingSection';\nimport liteMode from '../helpers/liteMode';\n\ntype SelectSearchPeerType = 'contacts' | 'dialogs' | 'channelParticipants';\n\n// TODO: правильная сортировка для addMembers, т.е. для peerType: 'contacts', потому что там идут сначала контакты - потом неконтакты, а должно всё сортироваться по имени\n\nexport default class AppSelectPeers {\n public container = document.createElement('div');\n public list = appDialogsManager.createChatList(/* {\n handheldsSize: 66,\n avatarSize: 48\n } */);\n private chatsContainer = document.createElement('div');\n public scrollable: Scrollable;\n private selectedScrollable: Scrollable;\n\n private selectedContainer: HTMLElement;\n public input: HTMLInputElement;\n\n // public selected: {[peerId: PeerId]: HTMLElement} = {};\n public selected = new Set();\n\n public freezed = false;\n\n private folderId = 0;\n private offsetIndex = 0;\n private promise: Promise;\n\n private query = '';\n private cachedContacts: PeerId[];\n\n private loadedWhat: Partial<{[k in 'dialogs' | 'archived' | 'contacts' | 'channelParticipants']: true}> = {};\n\n private renderedPeerIds: Set = new Set();\n\n private appendTo: HTMLElement;\n private onChange: (length: number) => void;\n private peerType: SelectSearchPeerType[] = ['dialogs'];\n private renderResultsFunc: (peerIds: PeerId[]) => void | Promise;\n private chatRightsActions: ChatRights[];\n private multiSelect = true;\n private rippleEnabled = true;\n private avatarSize: DialogElementSize = 'abitbigger';\n private exceptSelf = false;\n private filterPeerTypeBy: IsPeerType[];\n\n private tempIds: {[k in keyof AppSelectPeers['loadedWhat']]: number} = {};\n private peerId: PeerId;\n\n private placeholder: LangPackKey;\n\n private selfPresence: LangPackKey = 'Presence.YourChat';\n\n private needSwitchList = false;\n\n private sectionNameLangPackKey: LangPackKey;\n\n private managers: AppManagers;\n\n private design: 'round' | 'square' = 'round';\n\n constructor(options: {\n appendTo: AppSelectPeers['appendTo'],\n onChange?: AppSelectPeers['onChange'],\n peerType?: AppSelectPeers['peerType'],\n peerId?: AppSelectPeers['peerId'],\n onFirstRender?: () => void,\n renderResultsFunc?: AppSelectPeers['renderResultsFunc'],\n chatRightsActions?: AppSelectPeers['chatRightsActions'],\n multiSelect?: AppSelectPeers['multiSelect'],\n rippleEnabled?: AppSelectPeers['rippleEnabled'],\n avatarSize?: AppSelectPeers['avatarSize'],\n placeholder?: AppSelectPeers['placeholder'],\n selfPresence?: AppSelectPeers['selfPresence'],\n exceptSelf?: AppSelectPeers['exceptSelf'],\n filterPeerTypeBy?: AppSelectPeers['filterPeerTypeBy'],\n sectionNameLangPackKey?: AppSelectPeers['sectionNameLangPackKey'],\n managers: AppSelectPeers['managers'],\n design?: AppSelectPeers['design']\n }) {\n safeAssign(this, options);\n\n this.container.classList.add('selector', 'selector-' + this.design);\n\n const f = (this.renderResultsFunc || this.renderResults).bind(this);\n this.renderResultsFunc = async(peerIds) => {\n if(this.needSwitchList) {\n this.scrollable.splitUp.replaceWith(this.list);\n this.scrollable.setVirtualContainer(this.list);\n this.needSwitchList = false;\n }\n\n peerIds = peerIds.filter((peerId) => {\n const notRendered = !this.renderedPeerIds.has(peerId);\n if(notRendered) this.renderedPeerIds.add(peerId);\n return notRendered;\n });\n\n if(this.filterPeerTypeBy) {\n peerIds = await filterAsync(peerIds, async(peerId) => {\n if(peerId.isPeerId()) {\n const peer = await this.managers.appPeersManager.getPeer(peerId);\n if(peer) {\n for(const method of this.filterPeerTypeBy) {\n if(await this.managers.appPeersManager[method](peerId)) {\n return true;\n }\n }\n }\n }\n\n return true;\n });\n }\n\n return f(peerIds);\n };\n\n this.input = document.createElement('input');\n this.input.classList.add('selector-search-input');\n if(this.placeholder) {\n _i18n(this.input, this.placeholder, undefined, 'placeholder');\n } else {\n _i18n(this.input, 'SendMessageTo', undefined, 'placeholder');\n }\n\n this.input.type = 'text';\n\n if(this.multiSelect) {\n const section = new SettingSection({});\n section.innerContainer.classList.add('selector-search-section');\n const topContainer = document.createElement('div');\n topContainer.classList.add('selector-search-container');\n\n this.selectedContainer = document.createElement('div');\n this.selectedContainer.classList.add('selector-search');\n\n this.selectedContainer.append(this.input);\n topContainer.append(this.selectedContainer);\n this.selectedScrollable = new Scrollable(topContainer);\n\n // let delimiter = document.createElement('hr');\n\n attachClickEvent(this.selectedContainer, (e) => {\n if(this.freezed) return;\n let target = e.target as HTMLElement;\n target = findUpClassName(target, 'selector-user');\n\n if(!target) return;\n\n const peerId = target.dataset.key;\n const li = this.chatsContainer.querySelector('[data-peer-id=\"' + peerId + '\"]') as HTMLElement;\n if(!li) {\n this.remove(peerId.toPeerId());\n } else {\n simulateClickEvent(li);\n }\n });\n\n section.content.append(topContainer);\n this.container.append(section.container/* , delimiter */);\n }\n\n this.chatsContainer.classList.add('chatlist-container');\n // this.chatsContainer.append(this.list);\n const section = new SettingSection({\n name: this.sectionNameLangPackKey,\n noShadow: true\n });\n section.content.append(this.list);\n this.chatsContainer.append(section.container);\n this.scrollable = new Scrollable(this.chatsContainer);\n this.scrollable.setVirtualContainer(this.list);\n\n attachClickEvent(this.chatsContainer, (e) => {\n const target = findUpAttribute(e.target, 'data-peer-id') as HTMLElement;\n cancelEvent(e);\n\n if(!target) return;\n if(this.freezed) return;\n\n let key: PeerId | string = target.dataset.peerId;\n key = key.isPeerId() ? key.toPeerId() : key;\n\n if(!this.multiSelect) {\n this.add(key);\n return;\n }\n\n // target.classList.toggle('active');\n if(this.selected.has(key)) {\n this.remove(key);\n } else {\n this.add(key);\n }\n\n const checkbox = target.querySelector('input') as HTMLInputElement;\n checkbox.checked = !checkbox.checked;\n });\n\n const debouncedInput = debounce(this.onInput, 200, false, true);\n this.input.addEventListener('input', debouncedInput);\n\n this.scrollable.onScrolledBottom = () => {\n this.getMoreResults();\n };\n\n this.scrollable.container.prepend(generateDelimiter());\n\n this.container.append(this.chatsContainer);\n this.appendTo.append(this.container);\n\n // WARNING TIMEOUT\n setTimeout(() => {\n const getResultsPromise = this.getMoreResults() as Promise;\n if(options.onFirstRender) {\n getResultsPromise.then(() => {\n options.onFirstRender();\n });\n }\n }, 0);\n }\n\n private onInput = () => {\n const value = this.input.value;\n if(this.query !== value) {\n if(this.peerType.includes('contacts') || this.peerType.includes('dialogs')) {\n this.cachedContacts = undefined;\n }\n\n if(this.peerType.includes('dialogs')) {\n this.folderId = 0;\n this.offsetIndex = 0;\n }\n\n for(const i in this.tempIds) {\n // @ts-ignore\n ++this.tempIds[i];\n }\n\n this.list = appDialogsManager.createChatList();\n\n this.promise = undefined;\n this.loadedWhat = {};\n this.query = value;\n this.renderedPeerIds.clear();\n this.needSwitchList = true;\n\n // console.log('selectPeers input:', this.query);\n this.getMoreResults();\n }\n };\n\n private async renderSaved() {\n if(\n !this.exceptSelf &&\n !this.offsetIndex &&\n this.folderId === 0 &&\n this.peerType.includes('dialogs') &&\n (!this.query || await this.managers.appUsersManager.testSelfSearch(this.query))\n ) {\n await this.renderResultsFunc([rootScope.myId]);\n }\n }\n\n private getTempId(type: keyof AppSelectPeers['tempIds']) {\n this.tempIds[type] ??= 0;\n const tempId = ++this.tempIds[type];\n return {\n tempId,\n middleware: () => this.tempIds[type] === tempId\n };\n }\n\n private async getMoreDialogs(): Promise {\n if(this.loadedWhat.dialogs && this.loadedWhat.archived) {\n return;\n }\n\n // в десктопе - сначала без группы, потом архивные, потом контакты без сообщений\n const pageCount = windowSize.height / 56 * 1.25 | 0;\n\n const {middleware} = this.getTempId('dialogs');\n const promise = this.managers.dialogsStorage.getDialogs({\n query: this.query,\n offsetIndex: this.offsetIndex,\n limit: pageCount,\n filterId: this.folderId,\n skipMigrated: true\n });\n\n promise.catch(() => {\n if(!middleware()) {\n return;\n }\n\n this.loadedWhat[this.loadedWhat.dialogs ? 'archived' : 'dialogs'] = true;\n });\n\n const value = await promise;\n if(!middleware()) {\n return;\n }\n\n let dialogs = value.dialogs as Dialog[];\n if(dialogs.length) {\n const newOffsetIndex = getDialogIndex(dialogs[dialogs.length - 1]) || 0;\n\n dialogs = dialogs.slice();\n findAndSplice(dialogs, d => d.peerId === rootScope.myId); // no my account\n\n if(this.chatRightsActions) {\n dialogs = await filterAsync(dialogs, (d) => this.filterByRights(d.peerId));\n if(!middleware()) {\n return;\n }\n }\n\n await this.renderSaved();\n if(!middleware()) {\n return;\n }\n\n this.offsetIndex = newOffsetIndex;\n }\n\n this.renderResultsFunc(dialogs.map((dialog) => dialog.peerId));\n\n if(value.isEnd) {\n if(!this.loadedWhat.dialogs) {\n await this.renderSaved();\n if(!middleware()) {\n return;\n }\n\n this.loadedWhat.dialogs = true;\n this.offsetIndex = 0;\n this.folderId = 1;\n\n return this.getMoreDialogs();\n } else {\n this.loadedWhat.archived = true;\n\n if(!this.loadedWhat.contacts/* && this.peerType.includes('contacts') */) {\n return this.getMoreContacts();\n }\n }\n }\n }\n\n private async filterByRights(peerId: PeerId) {\n const peer: User | Chat = await this.managers.appPeersManager.getPeer(peerId);\n if(peerId.isUser()) {\n return this.chatRightsActions[0] !== 'send_plain' || canSendToUser(peer as User.user);\n } else if(this.chatRightsActions.every((action) => hasRights(peer as Chat.chat, action))) {\n return true;\n }\n }\n\n private async getMoreContacts() {\n if(this.loadedWhat.contacts) {\n return;\n }\n\n const isGlobalSearch = this.peerType.includes('contacts');\n\n if(!this.cachedContacts) {\n /* const promises: Promise[] = [appUsersManager.getContacts(this.query)];\n if(!this.peerType.includes('dialogs')) {\n promises.push(appMessagesManager.getConversationsAll());\n }\n\n this.promise = Promise.all(promises);\n this.cachedContacts = (await this.promise)[0].slice(); */\n const {middleware} = this.getTempId('contacts');\n const promise = Promise.all([\n isGlobalSearch ? this.managers.appUsersManager.getContactsPeerIds(this.query) : [],\n this.query ? this.managers.appUsersManager.searchContacts(this.query) : undefined\n ]);\n\n promise.catch(() => {\n if(!middleware()) {\n return;\n }\n\n this.loadedWhat.contacts = true;\n });\n\n const [cachedContacts, searchResult] = await promise;\n if(!middleware()) {\n return;\n }\n\n if(searchResult) {\n // do not add global result if only dialogs needed\n let resultPeerIds = isGlobalSearch ? searchResult.my_results.concat(searchResult.results) : searchResult.my_results;\n\n if(this.chatRightsActions) {\n resultPeerIds = await filterAsync(resultPeerIds, (peerId) => this.filterByRights(peerId));\n if(!middleware()) {\n return;\n }\n }\n\n if(!this.peerType.includes('dialogs')) {\n resultPeerIds = resultPeerIds.filter((peerId) => peerId.isUser());\n }\n\n this.cachedContacts = filterUnique(cachedContacts.concat(resultPeerIds));\n } else this.cachedContacts = cachedContacts.slice();\n\n indexOfAndSplice(this.cachedContacts, rootScope.myId); // no my account\n }\n\n // if(this.cachedContacts.length) {\n const pageCount = windowSize.height / 56 * 1.25 | 0;\n const arr = this.cachedContacts.splice(0, pageCount);\n this.renderResultsFunc(arr);\n // }\n\n if(!this.cachedContacts.length) {\n this.loadedWhat.contacts = true;\n\n // need to load non-contacts\n /* if(!this.peerType.includes('dialogs')) {\n return this.getMoreDialogs();\n } */\n }\n }\n\n private async getMoreChannelParticipants() {\n if(this.loadedWhat.channelParticipants) {\n return;\n }\n\n const pageCount = 50; // same as in group permissions to use cache\n\n const {middleware} = this.getTempId('channelParticipants');\n const promise = this.managers.appProfileManager.getParticipants(\n this.peerId.toChatId(),\n {\n _: 'channelParticipantsSearch',\n q: this.query\n },\n pageCount,\n this.list.childElementCount\n );\n\n promise.catch(() => {\n if(!middleware()) {\n return;\n }\n\n this.loadedWhat.channelParticipants = true;\n });\n\n const chatParticipants = await promise;\n if(!middleware()) {\n return;\n }\n\n const {participants} = chatParticipants;\n\n const peerIds = participants.map((participant) => getParticipantPeerId(participant));\n indexOfAndSplice(peerIds, rootScope.myId);\n this.renderResultsFunc(peerIds);\n\n const count = (chatParticipants as ChannelsChannelParticipants.channelsChannelParticipants).count ?? participants.length;\n\n if(this.list.childElementCount >= count || participants.length < pageCount) {\n this.loadedWhat.channelParticipants = true;\n }\n }\n\n checkForTriggers = () => {\n this.scrollable.checkForTriggers();\n };\n\n private getMoreResults() {\n if(this.promise) {\n return this.promise;\n }\n\n const get = () => {\n if((this.peerType.includes('dialogs')/* || this.loadedWhat.contacts */) && !this.loadedWhat.archived) { // to load non-contacts\n return this.getMoreSomething('dialogs');\n }\n\n if((this.peerType.includes('contacts') || this.peerType.includes('dialogs')) && !this.loadedWhat.contacts) {\n return this.getMoreSomething('contacts');\n }\n\n if(this.peerType.includes('channelParticipants') && !this.loadedWhat.channelParticipants) {\n return this.getMoreSomething('channelParticipants');\n }\n };\n\n const loadPromise = get();\n if(!loadPromise) {\n return Promise.resolve();\n }\n\n const promise = this.promise = loadPromise.catch((err) => {\n console.error('get more result error', err);\n }).finally(() => {\n if(this.promise === promise) {\n this.promise = undefined;\n }\n\n this.checkForTriggers();\n });\n\n return promise;\n }\n\n private getMoreSomething(peerType: SelectSearchPeerType) {\n const map: {[type in SelectSearchPeerType]: () => Promise} = {\n dialogs: this.getMoreDialogs,\n contacts: this.getMoreContacts,\n channelParticipants: this.getMoreChannelParticipants\n };\n\n const promise = map[peerType].call(this);\n return promise;\n }\n\n private async renderResults(peerIds: PeerId[]) {\n // console.log('will renderResults:', peerIds);\n\n // оставим только неконтакты с диалогов\n if(!this.peerType.includes('dialogs') && this.loadedWhat.contacts) {\n peerIds = await filterAsync(peerIds, (peerId) => {\n return this.managers.appUsersManager.isNonContactUser(peerId);\n });\n }\n\n peerIds.forEach(async(peerId) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: peerId,\n container: this.scrollable,\n rippleEnabled: this.rippleEnabled,\n avatarSize: this.avatarSize\n });\n\n if(this.multiSelect) {\n const selected = this.selected.has(peerId);\n const checkboxField = new CheckboxField();\n\n if(selected) {\n // dom.listEl.classList.add('active');\n checkboxField.input.checked = true;\n }\n\n dom.containerEl.prepend(checkboxField.label);\n }\n\n let subtitleEl: HTMLElement;\n if(peerId.isAnyChat()) {\n subtitleEl = await getChatMembersString(peerId.toChatId());\n } else if(peerId === rootScope.myId) {\n subtitleEl = i18n(this.selfPresence);\n } else {\n subtitleEl = getUserStatusString(await this.managers.appUsersManager.getUser(peerId.toUserId()));\n }\n\n dom.lastMessageSpan.append(subtitleEl);\n });\n }\n\n public add(key: PeerId | string, title?: string | HTMLElement, scroll = true) {\n // console.trace('add');\n this.selected.add(key);\n\n if(!this.multiSelect) {\n this.onChange(this.selected.size);\n return;\n }\n\n if(this.query.trim()) {\n this.input.value = '';\n this.onInput();\n }\n\n const div = document.createElement('div');\n div.classList.add('selector-user', 'scale-in');\n\n const avatarEl = new AvatarElement();\n avatarEl.classList.add('selector-user-avatar', 'tgico', 'avatar-32');\n avatarEl.isDialog = true;\n\n div.dataset.key = '' + key;\n if(key.isPeerId()) {\n if(title === undefined) {\n const peerTitle = new PeerTitle();\n peerTitle.update({peerId: key.toPeerId(), dialog: true});\n title = peerTitle.element;\n }\n\n avatarEl.updateWithOptions({\n peerId: key as PeerId\n });\n }\n\n if(title) {\n if(typeof(title) === 'string') {\n div.innerHTML = title;\n } else {\n replaceContent(div, title);\n div.append(title);\n }\n }\n\n div.insertAdjacentElement('afterbegin', avatarEl);\n\n this.selectedContainer.insertBefore(div, this.input);\n // this.selectedScrollable.scrollTop = this.selectedScrollable.scrollHeight;\n this.onChange?.(this.selected.size);\n\n if(scroll) {\n this.selectedScrollable.scrollIntoViewNew({\n element: this.input,\n position: 'center'\n });\n }\n\n return div;\n }\n\n public remove(key: PeerId | string) {\n if(!this.multiSelect) return;\n // const div = this.selected[peerId];\n const div = this.selectedContainer.querySelector(`[data-key=\"${key}\"]`) as HTMLElement;\n div.classList.remove('scale-in');\n void div.offsetWidth;\n div.classList.add('scale-out');\n\n const onAnimationEnd = () => {\n this.selected.delete(key);\n div.remove();\n this.onChange && this.onChange(this.selected.size);\n };\n\n if(liteMode.isAvailable('animations')) {\n div.addEventListener('animationend', onAnimationEnd, {once: true});\n } else {\n onAnimationEnd();\n }\n }\n\n public getSelected() {\n return [...this.selected];\n }\n\n public addInitial(values: any[]) {\n values.forEach((value) => {\n this.add(value, undefined, false);\n });\n\n window.requestAnimationFrame(() => { // ! not the best place for this raf though it works\n this.selectedScrollable.scrollIntoViewNew({\n element: this.input,\n position: 'center',\n forceDirection: FocusDirection.Static\n });\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../lib/appManagers/appDocsManager';\nimport ProgressivePreloader from './preloader';\nimport appMediaPlaybackController, {MediaItem, MediaSearchContext} from './appMediaPlaybackController';\nimport {DocumentAttribute, Message} from '../layer';\nimport mediaSizes from '../helpers/mediaSizes';\nimport {IS_SAFARI} from '../environment/userAgent';\nimport rootScope from '../lib/rootScope';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport LazyLoadQueue from './lazyLoadQueue';\nimport deferredPromise, {CancellablePromise} from '../helpers/cancellablePromise';\nimport ListenerSetter, {Listener} from '../helpers/listenerSetter';\nimport noop from '../helpers/noop';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport {joinElementsWith} from '../lib/langPack';\nimport {MiddleEllipsisElement} from './middleEllipsis';\nimport {formatFullSentTime} from '../helpers/date';\nimport throttleWithRaf from '../helpers/schedulers/throttleWithRaf';\nimport {NULL_PEER_ID} from '../lib/mtproto/mtproto_config';\nimport formatBytes from '../helpers/formatBytes';\nimport {animateSingle} from '../helpers/animation';\nimport clamp from '../helpers/number/clamp';\nimport toHHMMSS from '../helpers/string/toHHMMSS';\nimport MediaProgressLine from './mediaProgressLine';\nimport setInnerHTML from '../helpers/dom/setInnerHTML';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport wrapEmojiText from '../lib/richTextProcessor/wrapEmojiText';\nimport wrapSenderToPeer from './wrappers/senderToPeer';\nimport wrapSentTime from './wrappers/sentTime';\nimport getMediaFromMessage from '../lib/appManagers/utils/messages/getMediaFromMessage';\nimport appDownloadManager from '../lib/appManagers/appDownloadManager';\nimport wrapPhoto from './wrappers/photo';\nimport {doubleRaf} from '../helpers/schedulers';\n\nrootScope.addEventListener('messages_media_read', ({mids, peerId}) => {\n mids.forEach((mid) => {\n const attr = `[data-mid=\"${mid}\"][data-peer-id=\"${peerId}\"]`;\n (Array.from(document.querySelectorAll(`audio-element.is-unread${attr}, .media-round.is-unread${attr}`)) as AudioElement[]).forEach((elem) => {\n elem.classList.remove('is-unread');\n });\n });\n});\n\n// https://github.com/LonamiWebs/Telethon/blob/4393ec0b83d511b6a20d8a20334138730f084375/telethon/utils.py#L1285\nexport function decodeWaveform(waveform: Uint8Array | number[]) {\n if(!(waveform instanceof Uint8Array)) {\n waveform = new Uint8Array(waveform);\n }\n\n const bitCount = waveform.length * 8;\n const valueCount = bitCount / 5 | 0;\n if(!valueCount) {\n return new Uint8Array([]);\n }\n\n let result: Uint8Array;\n try {\n const dataView = new DataView(waveform.buffer);\n result = new Uint8Array(valueCount);\n for(let i = 0; i < valueCount; i++) {\n const byteIndex = i * 5 / 8 | 0;\n const bitShift = i * 5 % 8;\n const value = dataView.getUint16(byteIndex, true);\n result[i] = (value >> bitShift) & 0b00011111;\n }\n } catch(err) {\n result = new Uint8Array([]);\n }\n\n return result;\n}\n\nfunction createWaveformBars(waveform: Uint8Array, duration: number) {\n const barWidth = 2;\n const barMargin = 2;\n const barHeightMin = 4;\n const barHeightMax = mediaSizes.isMobile ? 16 : 23;\n\n const minW = mediaSizes.isMobile ? 152 : 190;\n const maxW = mediaSizes.isMobile ? 190 : 256;\n const availW = clamp(duration / 60 * maxW, minW, maxW);\n\n const normValue = Math.max(...waveform);\n const wfSize = waveform.length;\n const barCount = Math.min((availW / (barWidth + barMargin)) | 0, wfSize);\n\n let maxValue = 0;\n const maxDelta = barHeightMax - barHeightMin;\n\n let html = '';\n for(let i = 0, barX = 0, sumI = 0; i < wfSize; ++i) {\n const value = waveform[i] || 0;\n if((sumI + barCount) >= wfSize) { // draw bar\n sumI = sumI + barCount - wfSize;\n if(sumI < (barCount + 1) / 2) {\n if(maxValue < value) maxValue = value;\n }\n\n const bar_value = Math.max(((maxValue * maxDelta) + ((normValue + 1) / 2)) / (normValue + 1), barHeightMin);\n\n const h = ``;\n html += h;\n\n barX += barWidth + barMargin;\n\n if(sumI < (barCount + 1) / 2) {\n maxValue = 0;\n } else {\n maxValue = value;\n }\n } else {\n if(maxValue < value) maxValue = value;\n\n sumI += barCount;\n }\n }\n\n let container: HTMLElement, svg: SVGSVGElement;\n\n if(!html) {\n\n } else {\n container = document.createElement('div');\n container.classList.add('audio-waveform');\n\n svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.classList.add('audio-waveform-bars');\n svg.setAttributeNS(null, 'width', '' + availW);\n svg.setAttributeNS(null, 'height', '' + barHeightMax);\n svg.setAttributeNS(null, 'viewBox', `0 0 ${availW} ${barHeightMax}`);\n svg.insertAdjacentHTML('beforeend', html);\n\n container.append(svg);\n }\n\n return {svg, container, availW};\n}\n\nasync function wrapVoiceMessage(audioEl: AudioElement) {\n audioEl.classList.add('is-voice');\n\n const message = audioEl.message;\n const doc = getMediaFromMessage(message) as MyDocument;\n\n if(message.pFlags.out) {\n audioEl.classList.add('is-out');\n }\n\n let waveform = (doc.attributes.find((attribute) => attribute._ === 'documentAttributeAudio') as DocumentAttribute.documentAttributeAudio).waveform || new Uint8Array([]);\n waveform = decodeWaveform(waveform.slice(0, 63));\n\n const {svg, container: svgContainer, availW} = createWaveformBars(waveform, doc.duration);\n\n let fakeSvgContainer: HTMLElement;\n if(svgContainer) {\n fakeSvgContainer = svgContainer.cloneNode(true) as HTMLElement;\n fakeSvgContainer.classList.add('audio-waveform-fake');\n svgContainer.classList.add('audio-waveform-background');\n }\n\n const waveformContainer = document.createElement('div');\n waveformContainer.classList.add('audio-waveform-container');\n\n if(svgContainer) {\n waveformContainer.append(svgContainer, fakeSvgContainer);\n }\n\n const timeDiv = document.createElement('div');\n timeDiv.classList.add('audio-time');\n audioEl.append(waveformContainer, timeDiv);\n\n if(audioEl.transcriptionState !== undefined) {\n audioEl.classList.add('can-transcribe');\n const speechRecognitionDiv = document.createElement('div');\n speechRecognitionDiv.classList.add('audio-to-text-button');\n const speechRecognitionIcon = document.createElement('span');\n speechRecognitionIcon.classList.add('tgico-transcribe');\n const speechRecognitionLoader = document.createElement('div');\n speechRecognitionLoader.classList.add('loader');\n speechRecognitionLoader.innerHTML = ''\n speechRecognitionDiv.append(speechRecognitionIcon);\n\n speechRecognitionDiv.onclick = () => {\n const speechTextDiv = (findUpClassName(audioEl, 'document-wrapper') || findUpClassName(audioEl, 'quote-text')).querySelector('.audio-transcribed-text');\n if(audioEl.transcriptionState === 0) {\n if(speechTextDiv) {\n speechTextDiv.classList.remove('hide');\n speechRecognitionIcon.classList.remove('tgico-transcribe');\n speechRecognitionIcon.classList.add('tgico-up');\n // TODO: State to enum\n audioEl.transcriptionState = 2;\n } else {\n const message = audioEl.message;\n if(message.pFlags.is_outgoing) {\n return;\n }\n\n audioEl.transcriptionState = 1;\n !speechRecognitionLoader.parentElement && speechRecognitionDiv.append(speechRecognitionLoader);\n doubleRaf().then(() => {\n if(audioEl.transcriptionState === 1) {\n speechRecognitionLoader.classList.add('active');\n }\n });\n\n audioEl.managers.appMessagesManager.transcribeAudio(message).catch(noop);\n }\n } else if(audioEl.transcriptionState === 2) {\n // Hide transcription\n speechTextDiv.classList.add('hide');\n speechRecognitionIcon.classList.remove('tgico-up');\n speechRecognitionIcon.classList.add('tgico-transcribe');\n audioEl.transcriptionState = 0;\n }\n };\n\n audioEl.append(speechRecognitionDiv);\n }\n\n let progress = svg as any as HTMLElement, progressLine: MediaProgressLine;\n if(!progress) {\n progressLine = new MediaProgressLine();\n\n waveformContainer.append(progressLine.container);\n }\n\n const onLoad = () => {\n let audio = audioEl.audio;\n\n const setAnimation = () => {\n animateSingle(() => {\n if(!audio) return false;\n onTimeUpdate();\n return !audio.paused;\n }, audioEl);\n };\n\n const onTimeUpdate = () => {\n if(fakeSvgContainer) {\n fakeSvgContainer.style.width = (audio.currentTime / audio.duration * 100) + '%';\n }\n };\n\n if(!audio.paused || (audio.currentTime > 0 && audio.currentTime !== audio.duration)) {\n onTimeUpdate();\n }\n\n const throttledTimeUpdate = throttleWithRaf(onTimeUpdate);\n audioEl.addAudioListener('timeupdate', throttledTimeUpdate);\n audioEl.addAudioListener('ended', throttledTimeUpdate);\n audioEl.addAudioListener('play', setAnimation);\n\n progress && audioEl.readyPromise.then(() => {\n let mousedown = false, mousemove = false;\n progress.addEventListener('mouseleave', (e) => {\n if(mousedown) {\n audioEl.togglePlay(undefined, true);\n mousedown = false;\n }\n mousemove = false;\n });\n progress.addEventListener('mousemove', (e) => {\n mousemove = true;\n if(mousedown) scrub(e);\n });\n progress.addEventListener('mousedown', (e) => {\n e.preventDefault();\n if(e.button !== 0) return;\n if(!audio.paused) {\n audioEl.togglePlay(undefined, false);\n }\n\n scrub(e);\n mousedown = true;\n });\n progress.addEventListener('mouseup', (e) => {\n if(mousemove && mousedown) {\n audioEl.togglePlay(undefined, true);\n mousedown = false;\n }\n });\n attachClickEvent(progress, (e) => {\n cancelEvent(e);\n if(!audio.paused) scrub(e);\n });\n\n function scrub(e: MouseEvent | TouchEvent) {\n let offsetX: number;\n if(e instanceof MouseEvent) {\n offsetX = e.offsetX;\n } else { // touch\n const rect = (e.target as HTMLElement).getBoundingClientRect();\n offsetX = e.targetTouches[0].pageX - rect.left;\n }\n\n const scrubTime = offsetX / availW /* width */ * audio.duration;\n audio.currentTime = scrubTime;\n }\n }, noop);\n\n !progress && progressLine.setMedia({\n media: audio,\n streamable: doc.supportsStreaming,\n duration: doc.duration\n });\n\n return () => {\n progress?.remove();\n progress = null;\n audio = null;\n };\n };\n\n return onLoad;\n}\n\nasync function wrapAudio(audioEl: AudioElement) {\n const withTime = audioEl.withTime;\n\n const message = audioEl.message;\n const doc = getMediaFromMessage(message) as MyDocument;\n\n const isVoice = doc.type === 'voice' || doc.type === 'round';\n const descriptionEl = document.createElement('div');\n descriptionEl.classList.add('audio-description');\n\n const audioAttribute = doc.attributes.find((attr) => attr._ === 'documentAttributeAudio') as DocumentAttribute.documentAttributeAudio;\n\n if(!isVoice) {\n const parts: (Node | string)[] = [];\n if(audioAttribute?.performer) {\n parts.push(wrapEmojiText(audioAttribute.performer));\n }\n\n if(withTime) {\n parts.push(formatFullSentTime(message.date));\n } else if(!parts.length) {\n parts.push(formatBytes(doc.size));\n }\n\n if(audioEl.showSender) {\n parts.push(await wrapSenderToPeer(message));\n }\n\n descriptionEl.append(...joinElementsWith(parts, ' • '));\n }\n\n const html = `\n
\n
\n
\n
`;\n audioEl.insertAdjacentHTML('beforeend', html);\n\n const titleEl = audioEl.querySelector('.audio-title') as HTMLElement;\n\n const middleEllipsisEl = new MiddleEllipsisElement();\n middleEllipsisEl.dataset.fontWeight = audioEl.dataset.fontWeight;\n middleEllipsisEl.dataset.fontSize = audioEl.dataset.fontSize;\n middleEllipsisEl.dataset.sizeType = audioEl.dataset.sizeType;\n (middleEllipsisEl as any).getSize = (audioEl as any).getSize;\n if(isVoice) {\n middleEllipsisEl.append(await wrapSenderToPeer(message));\n } else {\n setInnerHTML(middleEllipsisEl, wrapEmojiText(audioAttribute?.title ?? doc.file_name));\n }\n\n titleEl.append(middleEllipsisEl);\n\n if(audioEl.showSender) {\n titleEl.append(wrapSentTime(message));\n }\n\n const subtitleDiv = audioEl.querySelector('.audio-subtitle') as HTMLDivElement;\n subtitleDiv.append(descriptionEl);\n\n const onLoad = () => {\n let launched = false;\n\n let progressLine = new MediaProgressLine();\n progressLine.setMedia({\n media: audioEl.audio,\n streamable: doc.supportsStreaming,\n duration: doc.duration\n });\n\n audioEl.addAudioListener('ended', () => {\n audioEl.classList.remove('audio-show-progress');\n // Reset subtitle\n subtitleDiv.lastChild.replaceWith(descriptionEl);\n launched = false;\n });\n\n const onPlay = () => {\n if(!launched) {\n audioEl.classList.add('audio-show-progress');\n launched = true;\n\n if(progressLine) {\n subtitleDiv.lastChild.replaceWith(progressLine.container);\n }\n }\n };\n\n audioEl.addAudioListener('play', onPlay);\n\n if(!audioEl.audio.paused || audioEl.audio.currentTime > 0) {\n onPlay();\n }\n\n return () => {\n progressLine.removeListeners();\n progressLine.container.remove();\n progressLine = null;\n };\n };\n\n return onLoad;\n}\n\nfunction constructDownloadPreloader(tryAgainOnFail = true) {\n const preloader = new ProgressivePreloader({cancelable: true, tryAgainOnFail});\n preloader.construct();\n\n if(!tryAgainOnFail) {\n preloader.circle.setAttributeNS(null, 'r', '23');\n preloader.totalLength = 143.58203125;\n }\n\n return preloader;\n}\n\nexport const findMediaTargets = (anchor: HTMLElement, anchorMid: number/* , useSearch: boolean */) => {\n let prev: MediaItem[], next: MediaItem[];\n // if(anchor.classList.contains('search-super-item') || !useSearch) {\n const isBubbles = !anchor.classList.contains('search-super-item');\n const container = findUpClassName(anchor, !isBubbles ? 'tabs-tab' : 'bubbles-inner');\n if(container) {\n const attr = `:not([data-is-outgoing=\"1\"])`;\n const justAudioSelector = `.audio:not(.is-voice)${attr}`;\n let selectors: string[];\n if(!anchor.matches(justAudioSelector)) {\n selectors = [`.audio.is-voice${attr}`, `.media-round${attr}`];\n } else {\n selectors = [justAudioSelector];\n }\n\n if(isBubbles) {\n const prefix = '.bubble:not(.webpage) ';\n selectors = selectors.map((s) => prefix + s);\n }\n\n const selector = selectors.join(', ');\n\n const elements = Array.from(container.querySelectorAll(selector)) as HTMLElement[];\n const idx = elements.indexOf(anchor);\n\n const mediaItems: MediaItem[] = elements.map((element) => ({peerId: element.dataset.peerId.toPeerId(), mid: +element.dataset.mid}));\n\n prev = mediaItems.slice(0, idx);\n next = mediaItems.slice(idx + 1);\n }\n // }\n\n if((next.length && next[0].mid < anchorMid) || (prev.length && prev[prev.length - 1].mid > anchorMid)) {\n [prev, next] = [next.reverse(), prev.reverse()];\n }\n\n // prev = next = undefined;\n\n return [prev, next];\n};\n\nexport default class AudioElement extends HTMLElement {\n public audio: HTMLAudioElement;\n public preloader: ProgressivePreloader;\n public message: Message.message;\n public withTime = false;\n public voiceAsMusic = false;\n public searchContext: MediaSearchContext;\n public showSender = false;\n public noAutoDownload: boolean;\n public lazyLoadQueue: LazyLoadQueue;\n public loadPromises: Promise[];\n public managers: AppManagers;\n public transcriptionState: number;\n\n private listenerSetter = new ListenerSetter();\n private onTypeDisconnect: () => void;\n public onLoad: (autoload?: boolean) => void;\n public readyPromise: CancellablePromise;\n public load: (shouldPlay: boolean, controlledAutoplay?: boolean) => void;\n\n public async render() {\n this.classList.add('audio');\n this.managers = rootScope.managers;\n\n this.dataset.mid = '' + this.message.mid;\n this.dataset.peerId = '' + this.message.peerId;\n\n const doc = getMediaFromMessage(this.message) as MyDocument;\n const isRealVoice = doc.type === 'voice';\n const isVoice = !this.voiceAsMusic && isRealVoice;\n const isOutgoing = this.message.pFlags.is_outgoing;\n const uploadingFileName = this.message?.uploadingFileName;\n\n const getDurationStr = () => {\n const duration = this.audio && this.audio.readyState >= this.audio.HAVE_CURRENT_DATA ? this.audio.duration : doc.duration;\n return toHHMMSS(duration | 0);\n };\n\n this.innerHTML = `\n
\n
\n
\n
\n
\n
`;\n\n const toggle = this.firstElementChild as HTMLElement;\n\n const downloadDiv = document.createElement('div');\n downloadDiv.classList.add('audio-download');\n\n const isUnread = doc.type !== 'audio' && this.message && this.message.pFlags.media_unread;\n if(isUnread) {\n this.classList.add('is-unread');\n }\n\n if(uploadingFileName) {\n this.classList.add('is-outgoing');\n this.append(downloadDiv);\n }\n\n const onTypeLoad = await (isVoice ? wrapVoiceMessage(this) : wrapAudio(this));\n\n const audioTimeDiv = this.querySelector('.audio-time') as HTMLDivElement;\n audioTimeDiv.textContent = getDurationStr();\n\n const onLoad = this.onLoad = (autoload: boolean) => {\n this.onLoad = undefined;\n\n const audio = this.audio = appMediaPlaybackController.addMedia(this.message, autoload);\n\n const readyPromise = this.readyPromise = deferredPromise();\n if(this.audio.readyState >= this.audio.HAVE_CURRENT_DATA) readyPromise.resolve();\n else {\n this.addAudioListener('canplay', () => readyPromise.resolve(), {once: true});\n }\n\n this.onTypeDisconnect = onTypeLoad();\n\n const getTimeStr = () => toHHMMSS(audio.currentTime | 0) + (isVoice ? (' / ' + getDurationStr()) : '');\n\n const onPlay = () => {\n audioTimeDiv.innerText = getTimeStr();\n toggle.classList.toggle('playing', !audio.paused);\n };\n\n if(!audio.paused || (audio.currentTime > 0 && audio.currentTime !== audio.duration)) {\n onPlay();\n }\n\n attachClickEvent(toggle, (e) => this.togglePlay(e), {listenerSetter: this.listenerSetter});\n\n this.addAudioListener('ended', () => {\n toggle.classList.remove('playing');\n audioTimeDiv.innerText = getDurationStr();\n });\n\n this.addAudioListener('timeupdate', () => {\n if((!audio.currentTime && audio.paused) || appMediaPlaybackController.isSafariBuffering(audio)) return;\n audioTimeDiv.innerText = getTimeStr();\n });\n\n this.addAudioListener('pause', () => {\n toggle.classList.remove('playing');\n });\n\n this.addAudioListener('play', onPlay);\n };\n\n if(doc.thumbs?.length) {\n const imgs: HTMLElement[] = [];\n const wrapped = await wrapPhoto({\n photo: doc,\n message: null,\n container: toggle,\n boxWidth: 48,\n boxHeight: 48,\n loadPromises: this.loadPromises,\n withoutPreloader: true,\n lazyLoadQueue: this.lazyLoadQueue\n });\n toggle.style.width = toggle.style.height = '';\n if(wrapped.images.thumb) imgs.push(wrapped.images.thumb);\n if(wrapped.images.full) imgs.push(wrapped.images.full);\n\n this.classList.add('audio-with-thumb');\n imgs.forEach((img) => img.classList.add('audio-thumb'));\n }\n\n if(!isOutgoing) {\n let preloader: ProgressivePreloader = this.preloader;\n\n const autoDownload = doc.type !== 'audio'/* || !this.noAutoDownload */;\n onLoad(autoDownload);\n\n const r = this.load = (shouldPlay: boolean, controlledAutoplay?: boolean) => {\n this.load = undefined;\n\n if(this.audio.src) {\n return;\n }\n\n appMediaPlaybackController.resolveWaitingForLoadMedia(this.message.peerId, this.message.mid, this.message.pFlags.is_scheduled);\n\n this.onDownloadInit(shouldPlay);\n\n if(!preloader) {\n if(doc.supportsStreaming) {\n this.classList.add('corner-download');\n\n let pauseListener: Listener;\n const onPlay = () => {\n const preloader = constructDownloadPreloader(false);\n const deferred = deferredPromise();\n deferred.notifyAll({done: 75, total: 100});\n deferred.catch(() => {\n this.audio.pause();\n appMediaPlaybackController.willBePlayed(undefined);\n });\n deferred.cancel = () => {\n deferred.cancel = noop;\n const err = new Error();\n (err as any).type = 'CANCELED';\n deferred.reject(err);\n };\n preloader.attach(downloadDiv, false, deferred);\n\n pauseListener = this.addAudioListener('pause', () => {\n deferred.cancel();\n }, {once: true}) as any;\n\n this.onDownloadInit(shouldPlay);\n };\n\n /* if(!this.audio.paused) {\n onPlay();\n } */\n\n const playListener: any = this.addAudioListener('play', onPlay);\n this.readyPromise.then(() => {\n this.listenerSetter.remove(playListener);\n pauseListener && this.listenerSetter.remove(pauseListener);\n });\n } else {\n preloader = constructDownloadPreloader();\n\n if(!shouldPlay) {\n this.readyPromise = deferredPromise();\n }\n\n const load = () => {\n this.onDownloadInit(shouldPlay);\n\n const download = appDownloadManager.downloadMediaURL({media: doc});\n\n if(!shouldPlay) {\n download.then(() => {\n this.readyPromise.resolve();\n });\n }\n\n preloader.attach(downloadDiv, false, download);\n return {download};\n };\n\n preloader.setDownloadFunction(load);\n load();\n }\n }\n\n if(this.classList.contains('corner-download')) {\n toggle.append(downloadDiv);\n } else {\n this.append(downloadDiv);\n }\n\n this.classList.add('downloading');\n\n this.readyPromise.then(() => {\n this.classList.remove('downloading');\n downloadDiv.classList.add('downloaded');\n setTimeout(() => {\n downloadDiv.remove();\n }, 200);\n\n // setTimeout(() => {\n // release loaded audio\n if(!controlledAutoplay && appMediaPlaybackController.willBePlayedMedia === this.audio) {\n this.audio.play();\n appMediaPlaybackController.willBePlayed(undefined);\n }\n // }, 10e3);\n });\n };\n\n if(!this.audio?.src) {\n if(autoDownload) {\n r(false);\n } else {\n attachClickEvent(toggle, () => {\n r(true);\n }, {once: true, capture: true, passive: false, listenerSetter: this.listenerSetter});\n }\n }\n } else if(uploadingFileName) {\n this.preloader = constructDownloadPreloader(false);\n this.preloader.attachPromise(appDownloadManager.getUpload(uploadingFileName));\n this.dataset.isOutgoing = '1';\n this.preloader.attach(downloadDiv, false);\n // onLoad();\n }\n }\n\n private onDownloadInit(shouldPlay: boolean) {\n if(shouldPlay) {\n appMediaPlaybackController.willBePlayed(this.audio); // prepare for loading audio\n\n if(IS_SAFARI && !this.audio.autoplay) {\n this.audio.autoplay = true;\n }\n }\n }\n\n public togglePlay(e?: Event, paused = this.audio.paused) {\n e && cancelEvent(e);\n\n if(paused) {\n this.setTargetsIfNeeded();\n this.audio.play().catch(() => {});\n } else {\n this.audio.pause();\n }\n }\n\n public setTargetsIfNeeded() {\n const hadSearchContext = !!this.searchContext;\n if(appMediaPlaybackController.setSearchContext(this.searchContext || {\n peerId: NULL_PEER_ID,\n inputFilter: {_: 'inputMessagesFilterEmpty'},\n useSearch: false\n })) {\n const [prev, next] = !hadSearchContext ? [] : findMediaTargets(this, this.message.mid/* , this.searchContext.useSearch */);\n appMediaPlaybackController.setTargets({peerId: this.message.peerId, mid: this.message.mid}, prev, next);\n }\n }\n\n public playWithTimestamp(timestamp: number) {\n this.load?.(true);\n this.audio.currentTime = timestamp;\n this.togglePlay(undefined, true);\n // appMediaPlaybackController.willBePlayed(this.audio); // prepare for loading audio\n // this.readyPromise.then(() => {\n // if(appMediaPlaybackController.willBePlayedMedia !== this.audio && this.audio.paused) {\n // return;\n // }\n\n // appMediaPlaybackController.willBePlayed(undefined);\n\n // this.audio.currentTime = timestamp;\n // this.togglePlay(undefined, true);\n // });\n }\n\n get addAudioListener() {\n return this.listenerSetter.add(this.audio);\n }\n\n disconnectedCallback() {\n setTimeout(() => {\n if(this.isConnected) {\n return;\n }\n\n if(this.onTypeDisconnect) {\n this.onTypeDisconnect();\n this.onTypeDisconnect = null;\n }\n\n if(this.readyPromise) {\n this.readyPromise.reject();\n }\n\n if(this.listenerSetter) {\n this.listenerSetter.removeAll();\n this.listenerSetter = null;\n }\n\n if(this.preloader) {\n this.preloader = null;\n }\n }, 100);\n }\n}\n\ncustomElements.define('audio-element', AudioElement);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Photo} from '../layer';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport ListLoader, {ListLoaderOptions} from './listLoader';\n\nexport default class AvatarListLoader extends ListLoader {\n private peerId: PeerId;\n private managers: AppManagers;\n\n constructor(options: Omit, 'loadMore'> & {peerId: PeerId, managers: AppManagers}) {\n super({\n ...options,\n loadMore: (anchor, older, loadCount) => {\n if(this.peerId.isAnyChat() || !older) return Promise.resolve({count: 0, items: []}); // ! это значит, что открыло аватар чата, но следующих фотографий нет.\n\n const maxId = anchor?.photoId;\n return this.managers.appPhotosManager.getUserPhotos(this.peerId, maxId, loadCount).then((value) => {\n const items = value.photos.map((photoId) => {\n return {element: null as HTMLElement, photoId} as any;\n });\n\n return {count: value.count, items};\n });\n }\n });\n\n this.loadedAllUp = true;\n this.peerId = options.peerId;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport AvatarListLoader from '../helpers/avatarListLoader';\nimport {Photo} from '../layer';\nimport appDownloadManager from '../lib/appManagers/appDownloadManager';\nimport appImManager from '../lib/appManagers/appImManager';\nimport rootScope from '../lib/rootScope';\nimport AppMediaViewerBase from './appMediaViewerBase';\n\ntype AppMediaViewerAvatarTargetType = {element: HTMLElement, photoId: Photo.photo['id'], photo?: Photo.photo};\nexport default class AppMediaViewerAvatar extends AppMediaViewerBase<'', 'delete', AppMediaViewerAvatarTargetType> {\n public peerId: PeerId;\n\n constructor(peerId: PeerId) {\n super(new AvatarListLoader({peerId, managers: rootScope.managers}), [/* 'delete' */]);\n\n this.peerId = peerId;\n\n this.setBtnMenuToggle([{\n icon: 'download',\n text: 'MediaViewer.Context.Download',\n onClick: this.onDownloadClick\n }/* , {\n icon: 'delete danger btn-disabled',\n text: 'Delete',\n onClick: () => {}\n } */]);\n\n // * constructing html end\n\n this.setListeners();\n }\n\n onPrevClick = (target: AppMediaViewerAvatarTargetType) => {\n this.openMedia({\n photoId: target.photoId,\n target: target.element,\n fromRight: -1\n });\n };\n\n onNextClick = (target: AppMediaViewerAvatarTargetType) => {\n this.openMedia({\n photoId: target.photoId,\n target: target.element,\n fromRight: 1\n });\n };\n\n onDownloadClick = () => {\n appDownloadManager.downloadToDisc({\n media: this.target.photo,\n queueId: appImManager.chat.bubbles.lazyLoadQueue.queueId\n });\n };\n\n public async openMedia({\n photoId,\n target,\n fromRight = 0,\n prevTargets,\n nextTargets\n }: {\n photoId: Photo.photo['id'],\n target?: HTMLElement,\n fromRight?: number,\n prevTargets?: AppMediaViewerAvatarTargetType[],\n nextTargets?: AppMediaViewerAvatarTargetType[]\n }) {\n if(this.setMoverPromise) return this.setMoverPromise;\n\n const photo = await this.managers.appPhotosManager.getPhoto(photoId);\n const ret = super._openMedia({\n media: photo,\n timestamp: photo.date,\n fromId: this.peerId,\n fromRight,\n target,\n reverse: false,\n prevTargets,\n nextTargets\n });\n this.target.photoId = photo.id;\n this.target.photo = photo;\n\n return ret;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../lib/rootScope';\nimport {Message, Photo} from '../layer';\nimport type LazyLoadQueue from './lazyLoadQueue';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport AppMediaViewer from './appMediaViewer';\nimport AppMediaViewerAvatar from './appMediaViewerAvatar';\nimport isObject from '../helpers/object/isObject';\nimport {ArgumentTypes} from '../types';\nimport putPhoto from './putPhoto';\nimport {recordPromise} from '../helpers/recordPromise';\nimport {getMiddleware, MiddlewareHelper} from '../helpers/middleware';\n\nconst onAvatarUpdate = ({peerId, threadId}: {peerId: PeerId, threadId?: number}) => {\n let query = 'avatar-element[data-peer-id=\"' + peerId + '\"]';\n if(threadId) {\n query += '[data-thread-id=\"' + threadId + '\"]';\n }\n\n (Array.from(document.querySelectorAll(query)) as AvatarElement[]).forEach((elem) => {\n // console.log('updating avatar:', elem);\n elem.update();\n });\n};\n\nrootScope.addEventListener('avatar_update', onAvatarUpdate);\nrootScope.addEventListener('peer_title_edit', async(data) => {\n if(!(await rootScope.managers.appAvatarsManager.isAvatarCached(data.peerId))) {\n onAvatarUpdate(data);\n }\n});\n\nexport async function openAvatarViewer(\n target: HTMLElement,\n peerId: PeerId,\n middleware: () => boolean,\n message?: any,\n prevTargets?: {element: HTMLElement, item: Photo.photo['id'] | Message.messageService}[],\n nextTargets?: typeof prevTargets\n) {\n let photo = await rootScope.managers.appProfileManager.getFullPhoto(peerId);\n if(!middleware() || !photo) {\n return;\n }\n\n const getTarget = () => {\n const good = Array.from(target.querySelectorAll('img')).find((img) => !img.classList.contains('emoji'));\n return good ? target : null;\n };\n\n if(peerId.isAnyChat()) {\n const hadMessage = !!message;\n const inputFilter = 'inputMessagesFilterChatPhotos';\n if(!message) {\n message = await rootScope.managers.appMessagesManager.getSearch({\n peerId,\n inputFilter: {_: inputFilter},\n maxId: 0,\n limit: 1\n }).then((value) => {\n // console.log(lol);\n // ! by descend\n return value.history[0];\n });\n\n if(!middleware()) {\n return;\n }\n }\n\n if(message) {\n // ! гений в деле, костылируем (но это гениально)\n const messagePhoto = message.action.photo;\n if(messagePhoto.id !== photo.id) {\n if(!hadMessage) {\n message = rootScope.managers.appMessagesManager.generateFakeAvatarMessage(peerId, photo);\n } else {\n\n }\n }\n\n const f = (arr: typeof prevTargets) => arr.map((el) => ({\n element: el.element,\n mid: (el.item as Message.messageService).mid,\n peerId: (el.item as Message.messageService).peerId\n }));\n\n new AppMediaViewer()\n .setSearchContext({\n peerId,\n inputFilter: {_: inputFilter}\n })\n .openMedia({\n message,\n target: getTarget(),\n prevTargets: prevTargets ? f(prevTargets) : undefined,\n nextTargets: nextTargets ? f(nextTargets) : undefined\n });\n\n return;\n }\n }\n\n if(photo) {\n if(!isObject(message) && message) {\n photo = await rootScope.managers.appPhotosManager.getPhoto(message);\n }\n\n const f = (arr: typeof prevTargets) => arr.map((el) => ({\n element: el.element,\n photoId: el.item as string\n }));\n\n new AppMediaViewerAvatar(peerId).openMedia({\n photoId: photo.id,\n target: getTarget(),\n prevTargets: prevTargets ? f(prevTargets) : undefined,\n nextTargets: nextTargets ? f(nextTargets) : undefined\n });\n }\n}\n\nconst believeMe: Map> = new Map();\nconst seen: Set = new Set();\n\nfunction getAvatarQueueKey(peerId: PeerId, threadId?: number) {\n return peerId + (threadId ? '_' + threadId : '');\n}\n\nexport default class AvatarElement extends HTMLElement {\n public peerId: PeerId;\n public isDialog: boolean;\n public peerTitle: string;\n public loadPromises: Promise[];\n public lazyLoadQueue: LazyLoadQueue;\n public isBig: boolean;\n public threadId: number;\n private addedToQueue = false;\n public wrapOptions: WrapSomethingOptions;\n\n public middlewareHelper: MiddlewareHelper;\n\n constructor() {\n super();\n this.classList.add('avatar-like');\n this.middlewareHelper = getMiddleware();\n }\n\n disconnectedCallback() {\n // браузер вызывает этот метод при удалении элемента из документа\n // (может вызываться много раз, если элемент многократно добавляется/удаляется)\n const key = getAvatarQueueKey(this.peerId, this.threadId);\n const set = believeMe.get(key);\n if(set?.has(this)) {\n set.delete(this);\n if(!set.size) {\n believeMe.delete(key);\n }\n }\n\n this.lazyLoadQueue?.delete({div: this});\n }\n\n public attachClickEvent() {\n let loading = false;\n attachClickEvent(this, async(e) => {\n cancelEvent(e);\n if(loading) return;\n const peerId = this.peerId;\n loading = true;\n await openAvatarViewer(this, this.peerId, () => this.peerId === peerId);\n loading = false;\n });\n }\n\n public updateOptions(options: Partial[0]>) {\n for(const i in options) {\n // @ts-ignore\n this[i] = options[i];\n }\n }\n\n public updateWithOptions(options: {\n peerId: PeerId,\n threadId?: number,\n isDialog?: boolean,\n isBig?: boolean,\n peerTitle?: string,\n lazyLoadQueue?: LazyLoadQueue | false,\n loadPromises?: Promise[],\n wrapOptions?: WrapSomethingOptions\n }) {\n const wasPeerId = this.peerId;\n const wasThreadId = this.threadId;\n this.updateOptions(options);\n const newPeerId = this.peerId;\n const threadId = this.threadId;\n\n if(wasPeerId === newPeerId && wasThreadId === threadId) {\n return;\n }\n\n this.dataset.peerId = '' + newPeerId;\n\n if(threadId) {\n this.dataset.threadId = '' + threadId;\n } else if(wasThreadId) {\n delete this.dataset.threadId;\n }\n\n if(wasPeerId) {\n const key = getAvatarQueueKey(wasPeerId, wasThreadId);\n const set = believeMe.get(key);\n if(set) {\n set.delete(this);\n if(!set.size) {\n believeMe.delete(key);\n }\n }\n }\n\n const middleware = options.wrapOptions?.middleware;\n this.middlewareHelper.destroy();\n if(middleware) {\n this.middlewareHelper = middleware.create();\n } else {\n this.middlewareHelper.destroy();\n }\n\n return this.update();\n }\n\n public remove() {\n this.middlewareHelper.destroy();\n super.remove();\n }\n\n private r(onlyThumb = false) {\n const promise = putPhoto({\n div: this,\n peerId: this.peerId,\n isDialog: this.isDialog,\n title: this.peerTitle,\n onlyThumb,\n isBig: this.isBig,\n threadId: this.threadId,\n wrapOptions: {\n middleware: this.middlewareHelper.get(),\n ...(this.wrapOptions || {})\n }\n });\n // recordPromise(promise, 'avatar putPhoto-' + this.peerId);\n\n if(this.loadPromises) {\n this.loadPromises.push(promise);\n\n promise.finally(() => {\n this.loadPromises = undefined;\n });\n }\n\n return promise;\n }\n\n public update() {\n if(this.lazyLoadQueue) {\n if(!seen.has(this.peerId)) {\n if(this.addedToQueue) return;\n this.addedToQueue = true;\n\n const key = getAvatarQueueKey(this.peerId, this.threadId);\n let set = believeMe.get(key);\n if(!set) {\n believeMe.set(key, set = new Set());\n }\n\n set.add(this);\n\n this.lazyLoadQueue.push({\n div: this,\n load: () => {\n seen.add(this.peerId);\n return this.update();\n }\n });\n\n return this.r(true);\n } else if(this.addedToQueue) {\n this.lazyLoadQueue.delete({div: this});\n }\n }\n\n seen.add(this.peerId);\n\n const promise = this.r();\n\n if(this.addedToQueue) {\n promise.finally(() => {\n this.addedToQueue = false;\n });\n }\n\n const key = getAvatarQueueKey(this.peerId, this.threadId);\n const set = believeMe.get(key);\n if(set) {\n set.delete(this);\n const arr = Array.from(set);\n believeMe.delete(key);\n\n for(let i = 0, length = arr.length; i < length; ++i) {\n arr[i].update();\n }\n }\n\n return promise;\n }\n}\n\ncustomElements.define('avatar-element', AvatarElement);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {CancellablePromise} from '../helpers/cancellablePromise';\nimport type {InputFile} from '../layer';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport PopupElement from './popups';\nimport PopupAvatar from './popups/avatar';\n\nexport default class AvatarEdit {\n public container: HTMLElement;\n private canvas: HTMLCanvasElement;\n private icon: HTMLSpanElement;\n\n constructor(onChange: (uploadAvatar: () => CancellablePromise) => void, options?: ConstructorParameters[0]) {\n this.container = document.createElement('div');\n this.container.classList.add('avatar-edit');\n\n this.canvas = document.createElement('canvas');\n this.canvas.classList.add('avatar-edit-canvas');\n\n this.icon = document.createElement('span');\n this.icon.classList.add('tgico', 'tgico-cameraadd');\n\n this.container.append(this.canvas, this.icon);\n\n attachClickEvent(this.container, () => {\n PopupElement.createPopup(PopupAvatar, options).open(this.canvas, onChange);\n });\n }\n\n public clear() {\n const ctx = this.canvas.getContext('2d');\n ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {i18n, LangPackKey} from '../lib/langPack';\nimport ripple from './ripple';\n\nexport type ButtonOptions = Partial<{\n noRipple: true,\n onlyMobile: true,\n icon: string,\n rippleSquare: true,\n text: LangPackKey,\n disabled: boolean,\n asDiv: boolean,\n asLink: boolean\n}>;\n\nexport default function Button(className: string, options: T = {} as T): T['asLink'] extends true ? HTMLAnchorElement : HTMLButtonElement {\n const button = document.createElement(options.asLink ? 'a' : (options.asDiv ? 'div' : 'button'));\n button.className = className + (options.icon ? ' tgico-' + options.icon : '');\n\n if(!options.noRipple) {\n if(options.rippleSquare) {\n button.classList.add('rp-square');\n }\n\n ripple(button);\n }\n\n if(options.onlyMobile) {\n button.classList.add('only-handhelds');\n }\n\n if(options.disabled) {\n button.setAttribute('disabled', 'true');\n }\n\n if(options.text) {\n button.append(i18n(options.text));\n }\n\n return button as any;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Button from './button';\n\nconst ButtonCorner = (options: Partial<{className: string, icon: string, noRipple: true, onlyMobile: true, asDiv: boolean}> = {}) => {\n const button = Button('btn-circle btn-corner z-depth-1' + (options.className ? ' ' + options.className : ''), options);\n return button;\n};\n\nexport default ButtonCorner;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Button from './button';\n\nconst ButtonIcon = (className?: string, options: Partial<{noRipple: true, onlyMobile: true, asDiv: boolean}> = {}) => {\n const button = Button('btn-icon', {\n icon: className || undefined,\n ...options\n });\n\n return button;\n};\n\nexport default ButtonIcon;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport flatten from '../helpers/array/flatten';\nimport contextMenuController from '../helpers/contextMenuController';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {AttachClickOptions, attachClickEvent} from '../helpers/dom/clickEvent';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport setInnerHTML from '../helpers/dom/setInnerHTML';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport {FormatterArguments, i18n, LangPackKey} from '../lib/langPack';\nimport CheckboxField from './checkboxField';\nimport {Document} from '../layer';\nimport wrapPhoto from './wrappers/photo';\nimport textToSvgURL from '../helpers/textToSvgURL';\nimport customProperties from '../helpers/dom/customProperties';\nimport {IS_MOBILE} from '../environment/userAgent';\nimport ripple from './ripple';\n\nexport type ButtonMenuItemOptions = {\n icon?: string,\n iconDoc?: Document.document,\n text?: LangPackKey,\n textArgs?: FormatterArguments,\n regularText?: Parameters[1],\n onClick: (e: MouseEvent | TouchEvent) => any,\n checkForClose?: () => boolean,\n element?: HTMLElement,\n textElement?: HTMLElement,\n options?: AttachClickOptions,\n checkboxField?: CheckboxField,\n noCheckboxClickListener?: boolean,\n keepOpen?: boolean,\n separator?: boolean | HTMLElement,\n multiline?: boolean,\n loadPromise?: Promise,\n waitForAnimation?: boolean\n /* , cancelEvent?: true */\n};\n\nexport type ButtonMenuItemOptionsVerifiable = ButtonMenuItemOptions & {\n verify?: () => boolean | Promise\n};\n\nfunction ButtonMenuItem(options: ButtonMenuItemOptions) {\n if(options.element) return [options.separator as HTMLElement, options.element].filter(Boolean);\n\n const {icon, iconDoc, text, onClick, checkboxField, noCheckboxClickListener} = options;\n const el = document.createElement('div');\n el.className = 'btn-menu-item rp-overflow' + (icon ? ' tgico-' + icon : '');\n\n if(IS_MOBILE) {\n ripple(el);\n }\n\n let textElement = options.textElement;\n if(!textElement) {\n textElement = options.textElement = text ? i18n(text, options.textArgs) : document.createElement('span');\n if(options.regularText) {\n setInnerHTML(textElement, options.regularText);\n }\n }\n\n if(iconDoc) {\n const iconElement = document.createElement('span');\n iconElement.classList.add('btn-menu-item-icon');\n el.append(iconElement);\n\n options.loadPromise = wrapPhoto({\n container: iconElement,\n photo: iconDoc,\n boxWidth: 24,\n boxHeight: 24,\n withoutPreloader: true,\n noFadeIn: true,\n noBlur: true,\n processUrl: (url) => {\n return fetch(url)\n .then((response) => response.text())\n .then((text) => {\n const color = customProperties.getProperty('primary-text-color');\n const doc = new DOMParser().parseFromString(text, 'image/svg+xml');\n const svg = doc.firstElementChild as HTMLElement;\n svg.querySelectorAll('path').forEach((path) => {\n path.setAttributeNS(null, 'fill', color);\n path.style.stroke = color;\n path.style.strokeWidth = '.25px';\n });\n return textToSvgURL(svg.outerHTML);\n });\n }\n }).then((ret) => ret.loadPromises.thumb);\n }\n\n textElement.classList.add('btn-menu-item-text');\n el.append(textElement);\n\n const keepOpen = !!checkboxField || !!options.keepOpen;\n\n // * cancel mobile keyboard close\n onClick && attachClickEvent(el, /* CLICK_EVENT_NAME !== 'click' || keepOpen ? */ /* async */(e) => {\n cancelEvent(e);\n\n const menu = findUpClassName(e.target, 'btn-menu');\n if(menu && !menu.classList.contains('active')) {\n return;\n }\n\n // let closed = false;\n // if(!keepOpen && !options.checkForClose) {\n // closed = true;\n // contextMenuController.close();\n // }\n\n // wait for closing animation\n // if(options.waitForAnimation && rootScope.settings.animationsEnabled && !options.checkForClose) {\n // await pause(125);\n // }\n\n onClick(e);\n if(options.checkForClose?.() === false) {\n return;\n }\n\n if(!keepOpen/* && !closed */) {\n contextMenuController.close();\n }\n\n if(checkboxField && !noCheckboxClickListener/* && result !== false */) {\n checkboxField.checked = checkboxField.input.type === 'radio' ? true : !checkboxField.checked;\n }\n }/* : onClick */, options.options);\n\n if(checkboxField) {\n el.append(checkboxField.label);\n }\n\n if(options.separator === true) {\n options.separator = document.createElement('hr');\n }\n\n if(options.multiline) {\n el.classList.add('is-multiline');\n }\n\n return [options.separator as HTMLElement, options.element = el].filter(Boolean);\n}\n\nexport function ButtonMenuSync({listenerSetter, buttons}: {\n buttons: ButtonMenuItemOptions[],\n listenerSetter?: ListenerSetter\n}) {\n const el: HTMLElement = document.createElement('div');\n el.classList.add('btn-menu');\n\n if(listenerSetter) {\n buttons.forEach((b) => {\n if(b.options) {\n b.options.listenerSetter = listenerSetter;\n } else {\n b.options = {listenerSetter};\n }\n });\n }\n\n const items = buttons.map(ButtonMenuItem);\n el.append(...flatten(items));\n\n return el;\n}\n\nexport default async function ButtonMenu(options: Parameters[0]) {\n const el = ButtonMenuSync(options);\n await Promise.all(options.buttons.map(({loadPromise}) => loadPromise));\n return el;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport contextMenuController from '../helpers/contextMenuController';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {AttachClickOptions, CLICK_EVENT_NAME, hasMouseMovedSinceDown} from '../helpers/dom/clickEvent';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport ButtonIcon from './buttonIcon';\nimport ButtonMenu, {ButtonMenuItemOptionsVerifiable} from './buttonMenu';\nimport filterAsync from '../helpers/array/filterAsync';\nimport {doubleRaf} from '../helpers/schedulers';\n\n// TODO: refactor for attachClickEvent, because if move finger after touchstart, it will start anyway\nexport function ButtonMenuToggleHandler({\n el,\n onOpen,\n options,\n onClose\n}: {\n el: HTMLElement,\n onOpen?: (e: Event) => any,\n options?: AttachClickOptions,\n onClose?: () => void\n}) {\n const add = options?.listenerSetter ? options.listenerSetter.add(el) : el.addEventListener.bind(el);\n\n add(CLICK_EVENT_NAME, (e: Event) => {\n if(!el.classList.contains('btn-menu-toggle') || hasMouseMovedSinceDown(e)) return false;\n\n cancelEvent(e);\n\n if(el.classList.contains('menu-open')) {\n contextMenuController.close();\n } else {\n const result = onOpen?.(e);\n const open = () => {\n const openedMenu = el.querySelector('.btn-menu') as HTMLDivElement;\n contextMenuController.openBtnMenu(openedMenu, onClose);\n };\n\n if(result instanceof Promise) {\n result.then(open);\n } else {\n open();\n }\n }\n });\n}\n\nexport default function ButtonMenuToggle({\n buttonOptions,\n listenerSetter: attachListenerSetter,\n container,\n direction,\n buttons,\n onOpenBefore,\n onOpen,\n onClose,\n onCloseAfter\n}: {\n buttonOptions?: Parameters[1],\n listenerSetter?: ListenerSetter,\n container?: HTMLElement\n direction: 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right',\n buttons: ButtonMenuItemOptionsVerifiable[],\n onOpenBefore?: (e: Event) => any,\n onOpen?: (e: Event, element: HTMLElement) => any,\n onClose?: () => void,\n onCloseAfter?: () => void\n}) {\n if(buttonOptions) {\n buttonOptions.asDiv = true;\n }\n\n const button = container ?? ButtonIcon('more', buttonOptions);\n button.classList.add('btn-menu-toggle');\n\n const listenerSetter = new ListenerSetter();\n\n let element: HTMLElement, closeTimeout: number;\n ButtonMenuToggleHandler({\n el: button,\n onOpen: async(e) => {\n await onOpenBefore?.(e);\n if(closeTimeout) {\n clearTimeout(closeTimeout);\n closeTimeout = undefined;\n return;\n }\n\n const f = (b: (typeof buttons[0])[]) => filterAsync(b, (button) => button?.verify?.() ?? true);\n\n const filteredButtons = await f(buttons);\n if(!filteredButtons.length) {\n return;\n }\n\n const _element = element = await ButtonMenu({\n buttons: filteredButtons,\n listenerSetter\n });\n _element.classList.add(direction);\n\n await onOpen?.(e, _element);\n\n button.append(_element);\n await doubleRaf();\n },\n options: {\n listenerSetter: attachListenerSetter\n },\n onClose: () => {\n onClose?.();\n\n closeTimeout = window.setTimeout(() => {\n onCloseAfter?.();\n closeTimeout = undefined;\n listenerSetter.removeAll();\n buttons.forEach((button) => button.element = undefined);\n element.remove();\n }, 300);\n }\n });\n\n return button;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../../lib/rootScope';\n// import { generatePathData } from \"../../helpers/dom\";\nimport {MyMessage} from '../../lib/appManagers/appMessagesManager';\nimport type Chat from './chat';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport insertInDescendSortedArray from '../../helpers/array/insertInDescendSortedArray';\nimport positionElementByIndex from '../../helpers/dom/positionElementByIndex';\nimport AvatarElement from '../avatar';\nimport {Message} from '../../layer';\nimport {NULL_PEER_ID, REPLIES_PEER_ID} from '../../lib/mtproto/mtproto_config';\nimport {SERVICE_AS_REGULAR, STICKY_OFFSET} from './bubbles';\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport partition from '../../helpers/array/partition';\nimport noop from '../../helpers/noop';\nimport getMessageThreadId from '../../lib/appManagers/utils/messages/getMessageThreadId';\n\ntype GroupItem = {\n bubble: HTMLElement,\n fromId: PeerId,\n mid: number,\n groupMid?: number,\n timestamp: number,\n dateTimestamp: number,\n mounted: boolean,\n single: boolean,\n group?: BubbleGroup,\n message: Message.message | Message.messageService // use it only to set avatar\n};\n\nclass BubbleGroup {\n container: HTMLElement;\n chat: Chat;\n groups: BubbleGroups;\n items: GroupItem[]; // descend sorted\n avatarContainer: HTMLElement;\n avatarLoadPromise: ReturnType;\n avatar: AvatarElement;\n mounted: boolean;\n dateTimestamp: number;\n offset: number;\n\n constructor(chat: Chat, groups: BubbleGroups, dateTimestamp: number) {\n this.container = document.createElement('div');\n this.container.classList.add('bubbles-group');\n this.chat = chat;\n this.groups = groups;\n this.items = [];\n this.dateTimestamp = dateTimestamp;\n this.offset = 0;\n }\n\n createAvatar(message: Message.message | Message.messageService) {\n if(this.avatarLoadPromise) {\n return this.avatarLoadPromise;\n } else if(message._ === 'messageService') {\n return;\n }\n\n this.avatarContainer = document.createElement('div');\n this.avatarContainer.classList.add('bubbles-group-avatar-container');\n ++this.offset;\n\n const fwdFrom = message.fwd_from;\n const fwdFromId = message.fwdFromId;\n const isForwardFromChannel = message.from_id && message.from_id._ === 'peerChannel' && message.fromId === fwdFromId;\n const currentPeerId = this.chat.peerId;\n const avatar = this.avatar = new AvatarElement();\n this.avatar.classList.add('bubbles-group-avatar', 'user-avatar', 'avatar-40'/* , 'can-zoom-fade' */);\n const peerId = ((fwdFrom && (currentPeerId === rootScope.myId || currentPeerId === REPLIES_PEER_ID)) || isForwardFromChannel ? fwdFromId : message.fromId) || NULL_PEER_ID;\n const avatarLoadPromise = this.avatar.updateWithOptions({\n lazyLoadQueue: this.chat.bubbles.lazyLoadQueue,\n peerId,\n peerTitle: !fwdFromId && fwdFrom && fwdFrom.from_name ? /* '🔥 FF 🔥' */fwdFrom.from_name : undefined\n });\n\n // this.avatarLoadPromise = Promise.all([\n // avatarLoadPromise,\n // peerId && peerId.isUser() ? this.chat.managers.appUsersManager.getUser(peerId.toUserId()) : undefined\n // ]).then(([result, user]) => {\n // if(user?.pFlags?.premium) {\n // avatar.classList.add('is-premium', 'tgico-star');\n // }\n\n // return result;\n // });\n this.avatarLoadPromise = avatarLoadPromise;\n\n this.avatarContainer.append(this.avatar);\n this.container.append(this.avatarContainer);\n\n return this.avatarLoadPromise;\n }\n\n get firstTimestamp() {\n return this.firstItem.timestamp;\n }\n\n get firstMid() {\n return this.firstItem.mid;\n }\n\n get firstItem() {\n return this.items[this.items.length - 1];\n }\n\n get lastTimestamp() {\n return this.lastItem.timestamp;\n }\n\n get lastMid() {\n return this.lastItem.mid;\n }\n\n get lastItem() {\n return this.items[0];\n }\n\n updateClassNames() {\n const items = this.items;\n const length = items.length;\n if(!length) {\n return;\n }\n\n // const elements = Array.from(this.container.children);\n // if(this.offset) elements.splice(0, this.offset);\n\n // const length = elements.length;\n // if(!length) {\n // return;\n // }\n\n const first = items[length - 1].bubble;\n\n if(items.length === 1) {\n first.classList.add('is-group-first', 'is-group-last');\n // this.setClipIfNeeded(first);\n return;\n } else {\n first.classList.remove('is-group-last');\n first.classList.add('is-group-first');\n // this.setClipIfNeeded(first, true);\n }\n\n for(let i = 1, _length = length - 1; i < _length; ++i) {\n const bubble = items[i].bubble;\n bubble.classList.remove('is-group-last', 'is-group-first');\n // this.setClipIfNeeded(bubble, true);\n }\n\n const last = items[0].bubble;\n last.classList.remove('is-group-first');\n last.classList.add('is-group-last');\n // this.setClipIfNeeded(last);\n }\n\n insertItem(item: GroupItem) {\n const {items} = this;\n insertInDescendSortedArray(items, item, this.groups.sortGroupItemsKey);\n\n item.group = this;\n if(items.length === 1) {\n this.groups.insertGroup(this);\n }\n }\n\n removeItem(item: GroupItem) {\n indexOfAndSplice(this.items, item);\n\n if(!this.items.length) {\n indexOfAndSplice(this.groups.groups, this);\n }\n\n item.group = undefined;\n }\n\n mount(updateClassNames?: boolean) {\n if(!this.groups.groups.includes(this) || !this.items.length) { // group can be already removed\n debugger;\n\n if(this.mounted) {\n this.onItemUnmount();\n }\n\n return;\n }\n\n const {offset, items} = this;\n const {length} = items;\n forEachReverse(items, (item, idx) => {\n this.mountItem(item, length - 1 - idx, offset);\n });\n\n if(updateClassNames) {\n this.updateClassNames();\n }\n\n this.onItemMount();\n }\n\n mountItem(item: GroupItem, idx = this.items.indexOf(item), offset = this.offset) {\n if(item.mounted) {\n return;\n }\n\n positionElementByIndex(item.bubble, this.container, offset + idx);\n item.mounted = true;\n }\n\n unmountItem(item: GroupItem) {\n if(!item.mounted) {\n return;\n }\n\n item.bubble.remove();\n item.mounted = false;\n this.onItemUnmount();\n }\n\n onItemMount() {\n if(this.mounted) {\n return;\n }\n\n const dateContainer = this.chat.bubbles.getDateContainerByTimestamp(this.dateTimestamp / 1000);\n // const idx = this.groups.indexOf(group);\n const dateGroups = this.groups.groups.filter((_group) => _group.dateTimestamp === this.dateTimestamp);\n const dateGroupsLength = dateGroups.length;\n const idx = dateGroups.indexOf(this);\n const unmountedLength = dateGroups.slice(idx + 1).reduce((acc, v) => acc + (v.mounted ? 0 : 1), 0);\n positionElementByIndex(this.container, dateContainer.container, STICKY_OFFSET + dateGroupsLength - 1 - idx - unmountedLength);\n this.mounted = true;\n }\n\n onItemUnmount() {\n if(!this.mounted) {\n return;\n }\n\n if(!this.items.length) {\n this.container.remove();\n this.chat.bubbles.deleteEmptyDateGroups();\n this.mounted = false;\n } else {\n this.updateClassNames();\n }\n }\n}\n\n// class BubbleGroupItem implements GroupItem {\n// bubble: HTMLElement;\n// fromId: PeerId;\n// mid: number;\n// timestamp: number;\n// dateTimestamp: number;\n// mounted: boolean;\n// single: boolean;\n// group: BubbleGroup;\n\n// constructor(details: GroupItem) {\n// Object.assign(this, details);\n// }\n// }\n\nexport default class BubbleGroups {\n public itemsArr: Array = []; // descend sorted\n private itemsMap: Map = new Map();\n public groups: Array = []; // descend sorted\n private newGroupDiff = 121; // * 121 in scheduled messages\n private sortItemsKey: Extract;\n private sortGroupsKey: Extract;\n public sortGroupItemsKey: Extract;\n\n constructor(private chat: Chat) {\n this.sortItemsKey = chat.type === 'scheduled' ? 'timestamp' : 'mid';\n this.sortGroupsKey = chat.type === 'scheduled' ? 'lastTimestamp' : 'lastMid';\n this.sortGroupItemsKey = /* chat.type === 'scheduled' ? 'timestamp' : */'groupMid';\n }\n\n removeItem(item: GroupItem) {\n item.group?.removeItem(item);\n this.removeItemFromCache(item);\n }\n\n removeAndUnmountBubble(bubble: HTMLElement) {\n const item = this.getItemByBubble(bubble);\n if(!item) {\n if(bubble.parentElement) {\n bubble.remove(); // * can be a placeholder\n }\n\n return false;\n }\n\n const items = this.itemsArr;\n const index = items.indexOf(item);\n const siblings = this.getSiblingsAtIndex(index, items);\n\n const group = item.group;\n this.removeItem(item);\n\n const modifiedGroups: Set = new Set();\n if(group) {\n group.unmountItem(item);\n modifiedGroups.add(group);\n }\n\n const [previousSibling, nextSibling] = siblings;\n if(\n previousSibling &&\n nextSibling &&\n this.canItemsBeGrouped(previousSibling, nextSibling) &&\n previousSibling.group !== nextSibling.group\n ) {\n const group = nextSibling.group;\n this.f(nextSibling.group.items);\n group.onItemUnmount();\n modifiedGroups.add(previousSibling.group);\n this.groupUngrouped();\n }\n\n this.mountUnmountGroups(Array.from(modifiedGroups));\n\n return true;\n }\n\n mountUnmountGroups(groups: BubbleGroup[]) {\n // groups.sort((a, b) => (b.lastItem?.mid ?? 0) - (a.lastItem?.mid ?? 0));\n\n const [toMount, toUnmount] = partition(groups, (group) => !!group.items.length);\n toUnmount.forEach((group) => {\n group.onItemUnmount();\n })\n\n toMount.forEach((group) => {\n group.mount(true);\n });\n\n // toMount.forEach((group) => {\n // group.updateClassNames();\n // });\n }\n\n f(items: GroupItem[], index: number = 0, length = items.length) {\n for(; index < length; ++index) {\n const item = items[index];\n item.mounted = false;\n item.group.removeItem(item);\n --length;\n --index;\n }\n }\n\n getItemByBubble(bubble: HTMLElement) {\n return this.itemsMap.get(bubble);\n }\n\n getLastGroup() {\n return this.groups[0];\n }\n\n changeBubbleMid(bubble: HTMLElement, mid: number) {\n const item = this.getItemByBubble(bubble);\n if(!item) {\n return;\n }\n\n item.mid = mid;\n\n // indexOfAndSplice(item.group.items, item);\n // // const canChangeGroupMid = !item.group.items.length || item.group.items.every((item) => item.groupMid === item.mid);\n // // if(canChangeGroupMid) item.groupMid = mid;\n // item.group.insertItem(item);\n\n indexOfAndSplice(this.itemsArr, item);\n this.insertItemToArray(item, this.itemsArr);\n }\n\n changeItemBubble(item: GroupItem, bubble: HTMLElement) {\n this.itemsMap.delete(item.bubble);\n item.bubble = bubble;\n this.itemsMap.set(bubble, item);\n }\n\n changeBubbleByBubble(from: HTMLElement, to: HTMLElement) {\n const item = this.getItemByBubble(from);\n if(!item) {\n return;\n }\n\n this.changeItemBubble(item, to);\n }\n\n canItemsBeGrouped(item1: GroupItem, item2: GroupItem) {\n return item2.fromId === item1.fromId &&\n Math.abs(item2.timestamp - item1.timestamp) <= this.newGroupDiff &&\n item1.dateTimestamp === item2.dateTimestamp &&\n !item1.single &&\n !item2.single &&\n item1.message.pFlags.out === item2.message.pFlags.out &&\n (!this.chat.isAllMessagesForum || getMessageThreadId(item1.message, true) === getMessageThreadId(item2.message, true)) &&\n (!item1.message.pFlags.out || item1.message.fromId === rootScope.myId);\n }\n\n getSiblingsAtIndex(itemIndex: number, items: GroupItem[]) {\n return [items[itemIndex - 1], items[itemIndex + 1]] as const;\n }\n\n // findGroupSiblingInSiblings(item: GroupItem, siblings: ReturnType) {\n // return siblings.find((sibling) => sibling && this.canItemsBeGrouped(item, sibling));\n // }\n\n findGroupSiblingByItem(item: GroupItem, items: GroupItem[]) {\n items = items.slice();\n const idx = this.insertItemToArray(item, items);\n // return this.findGroupSiblingInSiblings(item, this.getSiblingsAtIndex(idx, items));\n return this.findGroupSiblingInItems(item, items, idx);\n }\n\n findGroupSiblingInItems(item: GroupItem, items: GroupItem[], index = items.indexOf(item), length = items.length) {\n const previousItem = items[index - 1];\n let siblingGroupedItem: GroupItem;\n if(previousItem?.group && this.canItemsBeGrouped(item, previousItem)) {\n siblingGroupedItem = previousItem;\n } else {\n for(let k = index + 1; k < length; ++k) {\n const nextItem = items[k];\n if(this.canItemsBeGrouped(item, nextItem)) {\n if(nextItem.group) {\n siblingGroupedItem = nextItem;\n }\n } else {\n break;\n }\n }\n }\n\n return siblingGroupedItem;\n }\n\n addItemToGroup(item: GroupItem, group: BubbleGroup) {\n group.insertItem(item);\n this.addItemToCache(item);\n }\n\n insertItemToArray(item: GroupItem, array: GroupItem[]) {\n return insertInDescendSortedArray(array, item, this.sortItemsKey);\n }\n\n insertGroup(group: BubbleGroup) {\n return insertInDescendSortedArray(this.groups, group, this.sortGroupsKey);\n }\n\n addItemToCache(item: GroupItem) {\n this.insertItemToArray(item, this.itemsArr);\n this.itemsMap.set(item.bubble, item);\n }\n\n removeItemFromCache(item: GroupItem) {\n indexOfAndSplice(this.itemsArr, item);\n this.itemsMap.delete(item.bubble);\n }\n\n getMessageFromId(message: MyMessage) {\n let fromId = /* (this.chat.peerId.isAnyChat() && message.viaBotId) || */message.fromId;\n\n // fix for saved messages forward to self\n if(fromId === rootScope.myId && message.peerId === rootScope.myId && (message as Message.message).fwdFromId === fromId) {\n fromId = fromId.toPeerId(true);\n }\n\n return fromId;\n }\n\n createItem(bubble: HTMLElement, message: MyMessage) {\n const single = !(message._ === 'message' || (message.action && SERVICE_AS_REGULAR.has(message.action._)));\n const {mid, date: timestamp} = message;\n const {dateTimestamp} = this.chat.bubbles.getDateForDateContainer(timestamp);\n const item: GroupItem = {\n mid,\n groupMid: this.chat.type === 'scheduled' ? +`${(timestamp * 1000 - dateTimestamp) / 1000}.${mid}` : mid,\n fromId: this.getMessageFromId(message),\n bubble,\n // timestamp: this.chat.type === 'scheduled' ? +`${(timestamp * 1000 - dateTimestamp) / 1000}.${mid}` : timestamp,\n timestamp,\n dateTimestamp,\n mounted: false,\n single,\n message\n };\n\n return item;\n }\n\n splitSiblingsOnGrouping(siblings: ReturnType) {\n const [previousSibling, nextSibling] = siblings;\n const previousGroup = previousSibling?.group;\n const nextGroup = nextSibling?.group;\n\n if(!previousGroup) {\n return;\n }\n\n // will refresh group\n // if(previousGroup === nextGroup) {\n const items = previousGroup.items;\n const index = items.indexOf(previousSibling) + 1;\n const length = items.length;\n if(index === length) {\n return;\n }\n\n const modifiedGroups: BubbleGroup[] = [previousGroup];\n // if(previousGroup !== nextGroup && nextGroup) {\n // modifiedGroups.push(nextGroup);\n // }\n\n this.f(items, index, length);\n return modifiedGroups;\n // }\n }\n\n prepareForGrouping(bubble: HTMLElement, message: MyMessage) {\n const foundItem = this.getItemByBubble(bubble);\n if(foundItem) { // should happen only on edit\n // debugger;\n return;\n }\n\n const item = this.createItem(bubble, message);\n this.addItemToCache(item);\n }\n\n groupUngrouped() {\n const items = this.itemsArr;\n const length = items.length;\n const modifiedGroups: Set = new Set();\n // for(let i = length - 1; i >= 0; --i) {\n for(let i = 0; i < length; ++i) {\n const item = items[i];\n if(item.group) {\n continue;\n }\n\n let hadGroup = true;\n const siblings = this.getSiblingsAtIndex(i, items);\n const siblingGroupedItem = this.findGroupSiblingInItems(item, items, i, length);\n\n // const foundItem = this.findGroupSiblingInSiblings(item, siblings);\n const foundItem = siblingGroupedItem;\n const group = foundItem?.group ?? (hadGroup = false, new BubbleGroup(this.chat, this, item.dateTimestamp));\n\n modifiedGroups.add(group);\n group.insertItem(item);\n\n if(!hadGroup) {\n const splittedGroups = this.splitSiblingsOnGrouping(siblings);\n if(splittedGroups) {\n splittedGroups.forEach((group) => modifiedGroups.add(group));\n }\n }\n }\n\n return modifiedGroups;\n }\n\n // addBubble(bubble: HTMLElement, message: MyMessage, unmountIfFound?: boolean) {\n // const oldItem = this.getItemByBubble(bubble);\n // if(unmountIfFound) { // updating position\n // this.removeAndUnmountBubble(bubble);\n // } else if(oldItem) { // editing\n // const group = oldItem.group;\n // this.changeItemBubble(oldItem, bubble);\n // oldItem.mounted = false;\n\n // return {item: oldItem, group};\n // }\n\n // const item = this.createItem(bubble, message);\n\n // const foundItem = this.findSameGroupItem(item, this.itemsArr);\n\n // const group = foundItem?.group ?? new BubbleGroup(this.chat, this, item.dateTimestamp);\n // this.addItemToGroup(item, group);\n\n // return {item, group};\n // }\n\n /* setClipIfNeeded(bubble: HTMLDivElement, remove = false) {\n //console.log('setClipIfNeeded', bubble, remove);\n const className = bubble.className;\n if(className.includes('is-message-empty') && (className.includes('photo') || className.includes('video'))) {\n let container = bubble.querySelector('.bubble__media-container') as SVGSVGElement;\n //console.log('setClipIfNeeded', bubble, remove, container);\n if(!container) return;\n\n try {\n Array.from(container.children).forEach((object) => {\n if(object instanceof SVGDefsElement) return;\n\n if(remove) {\n object.removeAttributeNS(null, 'clip-path');\n } else {\n let clipId = container.dataset.clipId;\n let path = container.firstElementChild.firstElementChild.lastElementChild as SVGPathElement;\n let width = +object.getAttributeNS(null, 'width');\n let height = +object.getAttributeNS(null, 'height');\n let isOut = className.includes('is-out');\n let isReply = className.includes('is-reply');\n let d = '';\n\n //console.log('setClipIfNeeded', object, width, height, isOut);\n\n let tr: number, tl: number;\n if(className.includes('forwarded') || isReply) {\n tr = tl = 0;\n } else if(isOut) {\n tr = className.includes('is-group-first') ? 12 : 6;\n tl = 12;\n } else {\n tr = 12;\n tl = className.includes('is-group-first') ? 12 : 6;\n }\n\n if(isOut) {\n d = generatePathData(0, 0, width - 9, height, tl, tr, 0, 12);\n } else {\n d = generatePathData(9, 0, width - 9, height, tl, tr, 12, 0);\n }\n\n path.setAttributeNS(null, 'd', d);\n object.setAttributeNS(null, 'clip-path', 'url(#' + clipId + ')');\n }\n });\n } catch(err) {}\n }\n } */\n\n // updateGroupByMessageId(mid: number) {\n // const item = this.itemsArr.find((g) => g.mid === mid);\n // if(item) {\n // item.group.updateGroup();\n // }\n // }\n\n cleanup() {\n this.itemsArr = [];\n this.groups = [];\n this.itemsMap.clear();\n }\n\n // findIncorrentPositions() {\n // var bubbles = Array.from(this.chat.bubbles.chatInner.querySelectorAll('.bubbles-group .bubble')).reverse();\n // var items = this.itemsArr;\n // for(var i = 0, length = items.length; i < length; ++i) {\n // const item = items[i];\n // const foundBubble = bubbles[i];\n // if(item.bubble !== foundBubble) {\n // console.log('incorrect position', i, item, foundBubble);\n // // debugger;\n // // break;\n // }\n // }\n // }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Message} from '../../layer';\nimport rootScope from '../../lib/rootScope';\nimport ripple from '../ripple';\nimport I18n from '../../lib/langPack';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport StackedAvatars from '../stackedAvatars';\nimport formatNumber from '../../helpers/number/formatNumber';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport type LazyLoadQueue from '../lazyLoadQueue';\n\nconst TAG_NAME = 'replies-element';\n\nrootScope.addEventListener('replies_updated', (message) => {\n (Array.from(document.querySelectorAll(TAG_NAME + `[data-post-key=\"${message.peerId}_${message.mid}\"]`)) as RepliesElement[]).forEach((element) => {\n element.message = message;\n element.render();\n });\n});\n\nexport default class RepliesElement extends HTMLElement {\n public message: Message.message;\n public type: 'footer' | 'beside';\n public loadPromises: Promise[];\n public lazyLoadQueue: LazyLoadQueue;\n public stackedAvatars: StackedAvatars;\n public text: I18n.IntlElement;\n public managers: AppManagers;\n\n private updated = false;\n\n constructor() {\n super();\n this.managers = rootScope.managers;\n }\n\n public init() {\n this.render();\n this.dataset.postKey = this.message.peerId + '_' + this.message.mid;\n this.classList.add('replies', 'replies-' + this.type);\n }\n\n public render() {\n const replies = this.message.replies;\n\n /* if(this.firstChild) {\n this.innerHTML = '';\n } */\n\n if(this.type === 'footer') {\n let leftPart: HTMLElement;\n if(this.firstElementChild) {\n leftPart = this.firstElementChild as HTMLElement;\n }\n\n if(replies?.recent_repliers) {\n if(leftPart && !leftPart.classList.contains('replies-footer-avatars')) {\n this.innerHTML = '';\n leftPart = null;\n }\n\n if(!this.stackedAvatars) {\n this.stackedAvatars = new StackedAvatars({\n lazyLoadQueue: this.lazyLoadQueue,\n avatarSize: 30\n });\n\n this.stackedAvatars.container.classList.add('replies-footer-avatars');\n }\n\n leftPart = this.stackedAvatars.container;\n\n this.stackedAvatars.render(replies.recent_repliers.map((peer) => getPeerId(peer)), this.loadPromises);\n } else {\n if(leftPart && !leftPart.classList.contains('tgico-comments')) {\n leftPart.remove();\n leftPart = null;\n }\n\n if(!leftPart) {\n leftPart = document.createElement('span');\n leftPart.classList.add('tgico-comments');\n }\n }\n\n if(!leftPart.parentElement) {\n this.prepend(leftPart);\n }\n\n if(!this.text) {\n this.text = new I18n.IntlElement();\n }\n\n const text = this.text;\n if(replies) {\n if(replies.replies) {\n text.compareAndUpdate({key: 'Comments', args: [replies.replies]});\n } else {\n text.compareAndUpdate({key: 'LeaveAComment'});\n }\n } else {\n text.compareAndUpdate({key: 'ViewInChat'});\n }\n\n if(replies) {\n // const historyStorage = appMessagesManager.getHistoryStorage(replies.channel_id.toPeerId(true));\n let isUnread = false;\n if(replies.replies) {\n if(replies.read_max_id !== undefined && replies.max_id !== undefined) {\n isUnread = replies.read_max_id < replies.max_id;\n }/* else {\n isUnread = !historyStorage.readMaxId || historyStorage.readMaxId < (replies.max_id || 0);\n } */\n }\n this.classList.toggle('is-unread', isUnread);\n }\n\n let textSpan = this.children[1] as HTMLElement;\n if(!textSpan) {\n textSpan = document.createElement('span');\n textSpan.classList.add('replies-footer-text');\n\n const iconSpan = document.createElement('span');\n iconSpan.classList.add('tgico-next');\n\n const rippleContainer = document.createElement('div');\n ripple(rippleContainer);\n\n this.append(textSpan, iconSpan, rippleContainer);\n }\n\n replaceContent(textSpan, text.element);\n } else {\n this.classList.add('bubble-beside-button');\n this.innerHTML = `${replies?.replies ? formatNumber(replies.replies, 0) : ''}`;\n }\n\n if(replies && !this.updated && !this.message.pFlags.is_outgoing) {\n this.managers.appMessagesManager.subscribeRepliesThread(this.message.peerId, this.message.mid);\n this.managers.appMessagesManager.updateMessage(this.message.peerId, this.message.mid, 'replies_updated');\n this.updated = true;\n }\n\n if(this.loadPromises) {\n this.loadPromises = undefined;\n }\n }\n}\n\ncustomElements.define(TAG_NAME, RepliesElement);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {formatTime, getFullDate} from '../../helpers/date';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport formatNumber from '../../helpers/number/formatNumber';\nimport {Message} from '../../layer';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport {i18n, _i18n} from '../../lib/langPack';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport rootScope from '../../lib/rootScope';\nimport type LazyLoadQueue from '../lazyLoadQueue';\nimport PeerTitle from '../peerTitle';\nimport wrapReply from '../wrappers/reply';\nimport Chat, {ChatType} from './chat';\nimport RepliesElement from './replies';\n\nconst NBSP = ' ';\n\nconst makeEdited = () => {\n const edited = document.createElement('i');\n edited.classList.add('edited');\n _i18n(edited, 'EditedMessage');\n return edited;\n};\n\nconst makeSponsored = () => i18n('SponsoredMessage');\n\nexport namespace MessageRender {\n /* export const setText = () => {\n\n }; */\n\n export const setTime = (options: {\n chatType: ChatType,\n message: Message.message | Message.messageService,\n reactionsMessage?: Message.message\n }) => {\n const {chatType, message} = options;\n const date = new Date(message.date * 1000);\n const args: (HTMLElement | string)[] = [];\n\n let editedSpan: HTMLElement,\n sponsoredSpan: HTMLElement;\n // reactionsElement: ReactionsElement,\n // reactionsMessage: Message.message;\n\n const isSponsored = !!(message as Message.message).pFlags.sponsored;\n const isMessage = !('action' in message) && !isSponsored;\n // let hasReactions: boolean;\n\n const time: HTMLElement = isSponsored ? undefined : formatTime(date);\n if(isMessage) {\n if(message.views) {\n const postAuthor = message.post_author || message.fwd_from?.post_author;\n\n const postViewsSpan = document.createElement('span');\n postViewsSpan.classList.add('post-views');\n postViewsSpan.innerHTML = formatNumber(message.views, 1);\n\n const channelViews = document.createElement('i');\n channelViews.classList.add('tgico-channelviews', 'time-icon');\n\n args.push(postViewsSpan, channelViews);\n if(postAuthor) {\n const span = document.createElement('span');\n setInnerHTML(span, wrapEmojiText(postAuthor));\n span.insertAdjacentHTML('beforeend', ',' + NBSP)\n args.push(span);\n }\n }\n\n if(message.edit_date && chatType !== 'scheduled' && !message.pFlags.edit_hide) {\n args.unshift(editedSpan = makeEdited());\n }\n\n if(chatType !== 'pinned' && message.pFlags.pinned) {\n const i = document.createElement('i');\n i.classList.add('tgico-pinnedchat', 'time-icon');\n args.unshift(i);\n }\n\n // if(USER_REACTIONS_INLINE && message.peer_id._ === 'peerUser'/* && message.reactions?.results?.length */) {\n // hasReactions = true;\n\n // reactionsMessage = options.reactionsMessage;\n // reactionsElement = new ReactionsElement();\n // reactionsElement.init(reactionsMessage, 'inline', true);\n // reactionsElement.render();\n // args.unshift(reactionsElement);\n // }\n } else if(isSponsored) {\n args.push(sponsoredSpan = makeSponsored());\n }\n\n if(time) {\n args.push(time);\n }\n\n let title = isSponsored ? undefined : getFullDate(date);\n if(isMessage) {\n title += (message.edit_date && !message.pFlags.edit_hide ? `\\nEdited: ${getFullDate(new Date(message.edit_date * 1000))}` : '') +\n (message.fwd_from ? `\\nOriginal: ${getFullDate(new Date(message.fwd_from.date * 1000))}` : '');\n }\n\n const timeSpan = document.createElement('span');\n timeSpan.classList.add('time', 'tgico');\n // if(title) timeSpan.title = title;\n timeSpan.append(...args);\n\n const inner = document.createElement('div');\n inner.classList.add('inner', 'tgico');\n if(title) inner.title = title;\n\n let clonedArgs = args;\n if(editedSpan) {\n clonedArgs[clonedArgs.indexOf(editedSpan)] = makeEdited();\n }\n if(sponsoredSpan) {\n clonedArgs[clonedArgs.indexOf(sponsoredSpan)] = makeSponsored();\n }\n // if(reactionsElement) {\n // const _reactionsElement = clonedArgs[clonedArgs.indexOf(reactionsElement)] = new ReactionsElement();\n // _reactionsElement.init(reactionsMessage, 'inline');\n // _reactionsElement.render();\n // }\n clonedArgs = clonedArgs.map((a) => a instanceof HTMLElement && !a.classList.contains('i18n') && !a.classList.contains('reactions') ? a.cloneNode(true) as HTMLElement : a);\n if(time) {\n clonedArgs[clonedArgs.length - 1] = formatTime(date); // clone time\n }\n inner.append(...clonedArgs);\n\n timeSpan.append(inner);\n\n return timeSpan;\n };\n\n export const renderReplies = ({bubble, bubbleContainer, message, messageDiv, loadPromises, lazyLoadQueue}: {\n bubble: HTMLElement,\n bubbleContainer: HTMLElement,\n message: Message.message,\n messageDiv: HTMLElement,\n loadPromises?: Promise[],\n lazyLoadQueue?: LazyLoadQueue\n }) => {\n const isFooter = !bubble.classList.contains('sticker') && !bubble.classList.contains('emoji-big') && !bubble.classList.contains('round');\n const repliesFooter = new RepliesElement();\n repliesFooter.message = message;\n repliesFooter.type = isFooter ? 'footer' : 'beside';\n repliesFooter.loadPromises = loadPromises;\n repliesFooter.lazyLoadQueue = lazyLoadQueue;\n repliesFooter.init();\n bubbleContainer.prepend(repliesFooter);\n return isFooter;\n };\n\n export const setReply = async({chat, bubble, bubbleContainer, message}: {\n chat: Chat,\n bubble: HTMLElement,\n bubbleContainer?: HTMLElement,\n message: Message.message\n }) => {\n const isReplacing = !bubbleContainer;\n if(isReplacing) {\n bubbleContainer = bubble.querySelector('.bubble-content');\n }\n\n const currentReplyDiv = isReplacing ? bubbleContainer.querySelector('.reply') : null;\n if(!message.reply_to_mid) {\n currentReplyDiv?.remove();\n\n bubble.classList.remove('is-reply');\n return;\n }\n\n\n const replyToPeerId = message.reply_to.reply_to_peer_id ? getPeerId(message.reply_to.reply_to_peer_id) : chat.peerId;\n\n const originalMessage = await rootScope.managers.appMessagesManager.getMessageByPeer(replyToPeerId, message.reply_to_mid);\n let originalPeerTitle: string | HTMLElement;\n\n // ///////this.log('message to render reply', originalMessage, originalPeerTitle, bubble, message);\n\n let titlePeerId: PeerId;\n // need to download separately\n if(!originalMessage) {\n // ////////this.log('message to render reply empty, need download', message, message.reply_to_mid);\n rootScope.managers.appMessagesManager.fetchMessageReplyTo(message);\n chat.bubbles.needUpdate.push({replyToPeerId, replyMid: message.reply_to_mid, mid: message.mid});\n\n originalPeerTitle = i18n('Loading');\n } else {\n const originalMessageFwdFromId = (originalMessage as Message.message).fwdFromId;\n titlePeerId = message.fwdFromId && message.fwdFromId === originalMessageFwdFromId ? message.fwdFromId : originalMessage.fromId || originalMessageFwdFromId;\n originalPeerTitle = new PeerTitle({\n peerId: titlePeerId,\n dialog: false,\n onlyFirstName: false,\n plainText: false\n }).element;\n }\n\n const {container, fillPromise} = wrapReply(originalPeerTitle, undefined, chat.animationGroup, originalMessage, chat.isAnyGroup ? titlePeerId : undefined);\n await fillPromise;\n if(currentReplyDiv) {\n if(currentReplyDiv.classList.contains('floating-part')) {\n container.classList.add('floating-part');\n }\n currentReplyDiv.replaceWith(container);\n } else {\n bubbleContainer.append(container);\n }\n // bubbleContainer.insertBefore(, nameContainer);\n bubble.classList.add('is-reply');\n\n return container;\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport type IntersectionTarget = Element;\nexport type IntersectionCallback = (entry: IntersectionObserverEntry) => void;\n\nexport default class SuperIntersectionObserver {\n private observing: Map>;\n private observingQueue: SuperIntersectionObserver['observing'];\n private observer: IntersectionObserver;\n private freezedObservingNew: boolean;\n\n constructor(init?: IntersectionObserverInit) {\n this.observing = new Map();\n this.observingQueue = new Map();\n this.freezedObservingNew = false;\n\n this.observer = new IntersectionObserver((entries) => {\n const observing = this.observing;\n for(let i = 0, length = entries.length; i < length; ++i) {\n const entry = entries[i];\n const callbacks = observing.get(entry.target);\n if(!callbacks) {\n console.error('intersection process no callbacks:', entry);\n debugger;\n continue;\n }\n\n for(const callback of callbacks) {\n try {\n callback(entry);\n } catch(err) {\n console.error('intersection process callback error:', err);\n }\n }\n }\n }, init);\n }\n\n public disconnect() {\n this.observing.clear();\n this.observingQueue.clear();\n this.observer.disconnect();\n }\n\n public toggleObservingNew(value: boolean) {\n if(this.freezedObservingNew === value) {\n return;\n }\n\n this.freezedObservingNew = value;\n\n const queue = this.observingQueue;\n if(!value && queue.size) {\n for(const [target, callbacks] of queue) {\n for(const callback of callbacks) {\n this.observe(target, callback);\n }\n }\n\n queue.clear();\n }\n }\n\n public has(target: IntersectionTarget, callback: IntersectionCallback, observing = this.observing) {\n const callbacks = observing.get(target);\n return !!(callbacks && callbacks.has(callback));\n }\n\n public observe(target: IntersectionTarget, callback: IntersectionCallback) {\n if(this.freezedObservingNew && this.has(target, callback)) {\n return;\n }\n\n const observing = this.freezedObservingNew ? this.observingQueue : this.observing;\n let callbacks = observing.get(target);\n if(callbacks && callbacks.has(callback)) {\n return;\n }\n\n if(!callbacks) {\n callbacks = new Set();\n observing.set(target, callbacks);\n\n if(observing === this.observing) {\n this.observer.observe(target);\n }\n }\n\n callbacks.add(callback);\n }\n\n public unobserve(target: IntersectionTarget, callback: IntersectionCallback) {\n const observing = this.freezedObservingNew && !this.has(target, callback) ? this.observingQueue : this.observing;\n const callbacks = observing.get(target);\n if(!callbacks) {\n return;\n }\n\n callbacks.delete(callback);\n if(!callbacks.size) {\n observing.delete(target);\n this.observer.unobserve(target);\n }\n }\n}\n","import type {MyDocument} from '../../appDocsManager';\nimport type {MyMessage} from '../../appMessagesManager';\nimport {Message, MessageMedia} from '../../../../layer';\n\nexport default function isMentionUnread(message: MyMessage) {\n if(!message) {\n return false;\n }\n\n const doc = ((message as Message.message).media as MessageMedia.messageMediaDocument)?.document as MyDocument;\n return !!(\n message.pFlags.media_unread &&\n message.pFlags.mentioned &&\n (\n !doc ||\n !(['voice', 'round'] as MyDocument['type'][]).includes(doc.type)\n )\n );\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {ChatAutoDownloadSettings} from '../../helpers/autoDownload';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport {Middleware} from '../../helpers/middleware';\nimport {Document, Message, MessageMedia, Photo, PhotoSize} from '../../layer';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getMediaFromMessage from '../../lib/appManagers/utils/messages/getMediaFromMessage';\nimport choosePhotoSize from '../../lib/appManagers/utils/photos/choosePhotoSize';\nimport rootScope from '../../lib/rootScope';\nimport {AnimationItemGroup} from '../animationIntersector';\nimport Chat from '../chat/chat';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport prepareAlbum from '../prepareAlbum';\nimport wrapMediaSpoiler from './mediaSpoiler';\nimport wrapPhoto from './photo';\nimport wrapVideo from './video';\n\nexport default function wrapAlbum({messages, attachmentDiv, middleware, uploading, lazyLoadQueue, isOut, chat, loadPromises, autoDownload, managers = rootScope.managers, animationGroup}: {\n messages: Message.message[],\n attachmentDiv: HTMLElement,\n middleware?: Middleware,\n lazyLoadQueue?: LazyLoadQueue,\n uploading?: boolean,\n isOut: boolean,\n chat: Chat,\n loadPromises?: Promise[],\n autoDownload?: ChatAutoDownloadSettings,\n managers?: AppManagers,\n animationGroup?: AnimationItemGroup\n}) {\n const items: {size: PhotoSize.photoSize, media: Photo.photo | Document.document, message: Message.message}[] = [];\n\n // !lowest msgID will be the FIRST in album\n for(const message of messages) {\n const media = getMediaFromMessage(message, true);\n\n const size: any = media._ === 'photo' ? choosePhotoSize(media, 480, 480) : {w: media.w, h: media.h};\n items.push({size, media, message});\n }\n\n /* // * pending\n if(storage[0] < 0) {\n items.reverse();\n } */\n\n prepareAlbum({\n container: attachmentDiv,\n items: items.map((i) => ({w: i.size.w, h: i.size.h})),\n maxWidth: mediaSizes.active.album.width,\n minWidth: 100,\n spacing: 2,\n forMedia: true\n });\n\n const {width, height} = attachmentDiv.style;\n const containerWidth = parseInt(width);\n const containerHeight = parseInt(height);\n\n items.forEach((item, idx) => {\n const {size, media, message} = item;\n\n const messageMedia = message.media;\n const hasSpoiler = !!(messageMedia as MessageMedia.messageMediaPhoto | MessageMedia.messageMediaDocument).pFlags?.spoiler;\n\n const div = attachmentDiv.children[idx] as HTMLElement;\n div.dataset.mid = '' + message.mid;\n div.dataset.peerId = '' + message.peerId;\n const mediaDiv = div.firstElementChild as HTMLElement;\n const isPhoto = media._ === 'photo';\n let thumbPromise: Promise;\n if(isPhoto) {\n thumbPromise = wrapPhoto({\n photo: media,\n message,\n container: mediaDiv,\n boxWidth: 0,\n boxHeight: 0,\n isOut,\n lazyLoadQueue,\n middleware,\n size,\n loadPromises,\n autoDownloadSize: autoDownload.photo,\n managers\n });\n } else {\n thumbPromise = wrapVideo({\n doc: media,\n container: mediaDiv,\n message,\n boxWidth: 0,\n boxHeight: 0,\n withTail: false,\n isOut,\n lazyLoadQueue,\n middleware,\n loadPromises,\n autoDownload,\n managers,\n noAutoplayAttribute: hasSpoiler\n });\n }\n\n if(thumbPromise) {\n loadPromises?.push(thumbPromise);\n }\n\n if(hasSpoiler) {\n const promise = (thumbPromise || Promise.resolve()).then(async() => {\n if(!middleware()) {\n return;\n }\n\n const {width, height} = div.style;\n const itemWidth = +width.slice(0, -1) / 100 * containerWidth;\n const itemHeight = +height.slice(0, -1) / 100 * containerHeight;\n const container = await wrapMediaSpoiler({\n media,\n animationGroup,\n middleware,\n width: itemWidth,\n height: itemHeight\n });\n\n if(!middleware()) {\n return;\n }\n\n mediaDiv.append(container);\n });\n\n loadPromises?.push(promise);\n }\n });\n}\n","import {Document, Message, MessageMedia} from '../../../../layer';\n\nexport default function getMediaDurationFromMessage(message: Message.message) {\n const doc = (message.media as MessageMedia.messageMediaDocument)?.document as Document.document;\n const duration = ((['voice', 'audio', 'video'] as Document.document['type'][]).includes(doc?.type) && doc.duration) || undefined;\n return duration;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider';\nimport appSidebarRight from '..';\nimport {roundPercents} from '../../poll';\nimport appDialogsManager from '../../../lib/appManagers/appDialogsManager';\nimport {i18n} from '../../../lib/langPack';\nimport setInnerHTML from '../../../helpers/dom/setInnerHTML';\nimport wrapEmojiText from '../../../lib/richTextProcessor/wrapEmojiText';\nimport Button from '../../button';\nimport {Message, MessageMedia} from '../../../layer';\n\nexport default class AppPollResultsTab extends SliderSuperTab {\n private resultsDiv: HTMLElement;\n\n public async init(message: Message.message) {\n this.container.id = 'poll-results-container';\n this.container.classList.add('chatlist-container');\n\n this.resultsDiv = document.createElement('div');\n this.resultsDiv.classList.add('poll-results');\n this.scrollable.append(this.resultsDiv);\n\n const poll = await this.managers.appPollsManager.getPoll((message.media as MessageMedia.messageMediaPoll).poll.id);\n\n this.setTitle(poll.poll.pFlags.quiz ? 'PollResults.Title.Quiz' : 'PollResults.Title.Poll');\n\n const title = document.createElement('h3');\n setInnerHTML(title, wrapEmojiText(poll.poll.question));\n\n const percents = poll.results.results.map((v) => v.voters / poll.results.total_voters * 100);\n roundPercents(percents);\n\n const fragment = document.createDocumentFragment();\n poll.results.results.forEach((result, idx) => {\n if(!result.voters) return;\n\n const hr = document.createElement('hr');\n\n const answer = poll.poll.answers[idx];\n\n // Head\n const answerEl = document.createElement('div');\n answerEl.classList.add('poll-results-answer');\n\n const answerTitle = document.createElement('div');\n setInnerHTML(answerTitle, wrapEmojiText(answer.text));\n\n const answerPercents = document.createElement('div');\n answerPercents.innerText = Math.round(percents[idx]) + '%';\n\n answerEl.append(answerTitle, answerPercents);\n\n // Humans\n const list = appDialogsManager.createChatList();\n list.classList.add('poll-results-voters');\n\n appDialogsManager.setListClickListener(list, () => {\n appSidebarRight.onCloseBtnClick();\n }, undefined, true);\n\n list.style.minHeight = Math.min(result.voters, 4) * 48 + 'px';\n\n fragment.append(hr, answerEl, list);\n\n let offset: string, limit = 4, loading = false, left = Math.max(0, result.voters - 4);\n const load = () => {\n if(loading) return;\n loading = true;\n\n this.managers.appPollsManager.getVotes(message, answer.option, offset, limit).then((votesList) => {\n votesList.votes.forEach((vote) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: vote.user_id.toPeerId(false),\n container: list,\n rippleEnabled: false,\n meAsSaved: false,\n avatarSize: 'small'\n });\n dom.lastMessageSpan.parentElement.remove();\n });\n\n if(offset) {\n left = Math.max(0, left - votesList.votes.length);\n\n if(left) {\n (showMore.lastElementChild as HTMLElement).replaceWith(i18n('PollResults.LoadMore', [Math.min(20, left)]));\n }\n }\n\n offset = votesList.next_offset;\n limit = 20;\n\n if(!left || !votesList.votes.length) {\n showMore.remove();\n }\n }).finally(() => {\n loading = false;\n });\n };\n\n const showMore = Button('poll-results-more btn btn-primary btn-transparent', {icon: 'down'});\n showMore.addEventListener('click', load);\n showMore.append(i18n('PollResults.LoadMore', [Math.min(20, left)]));\n\n fragment.append(showMore);\n\n load();\n });\n\n this.resultsDiv.append(title, fragment);\n\n appSidebarRight.toggleSidebar(true).then(() => {\n /* appPollsManager.getVotes(mid).then((votes) => {\n console.log('gOt VotEs', votes);\n }); */\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport mediaSizes from '../helpers/mediaSizes';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport appImManager from '../lib/appManagers/appImManager';\nimport rootScope from '../lib/rootScope';\nimport ripple from './ripple';\nimport appSidebarRight from './sidebarRight';\nimport AppPollResultsTab from './sidebarRight/tabs/pollResults';\nimport {FormatterArguments, i18n, LangPackKey} from '../lib/langPack';\nimport {fastRaf} from '../helpers/schedulers';\nimport SetTransition from './singleTransition';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent, simulateClickEvent} from '../helpers/dom/clickEvent';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport windowSize from '../helpers/windowSize';\nimport {Message, MessageMedia, Poll, PollResults} from '../layer';\nimport toHHMMSS from '../helpers/string/toHHMMSS';\nimport StackedAvatars from './stackedAvatars';\nimport setInnerHTML from '../helpers/dom/setInnerHTML';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport wrapEmojiText from '../lib/richTextProcessor/wrapEmojiText';\nimport wrapRichText from '../lib/richTextProcessor/wrapRichText';\nimport liteMode from '../helpers/liteMode';\n\nlet lineTotalLength = 0;\nconst tailLength = 9;\nconst times = 10;\nconst fullTime = 340;\nconst oneTime = fullTime / times;\n\nexport const roundPercents = (percents: number[]) => {\n // console.log('roundPercents before percents:', percents);\n\n const sum = percents.reduce((acc, p) => acc + Math.round(p), 0);\n if(sum > 100) {\n const diff = sum - 100;\n const length = percents.length;\n for(let i = 0; i < diff; ++i) {\n let minIndex = -1, minRemainder = 1;\n for(let k = 0; k < length; ++k) {\n const remainder = percents[k] % 1;\n if(remainder >= 0.5 && remainder < minRemainder) {\n minRemainder = remainder;\n minIndex = k;\n }\n }\n\n if(minIndex === -1) {\n // throw new Error('lol chto');\n return;\n }\n\n percents[minIndex] -= minRemainder;\n }\n } else if(sum < 100) {\n const diff = 100 - sum;\n const length = percents.length;\n for(let i = 0; i < diff; ++i) {\n let minIndex = -1, maxRemainder = 0;\n for(let k = 0; k < length; ++k) {\n const remainder = percents[k] % 1;\n if(remainder < 0.5 && remainder > maxRemainder) {\n maxRemainder = remainder;\n minIndex = k;\n }\n }\n\n if(minIndex === -1) {\n // throw new Error('lol chto');\n return;\n }\n\n percents[minIndex] += 1 - maxRemainder;\n }\n }\n\n // console.log('roundPercents after percents:', percents);\n};\n\n/* const connectedPolls: {id: string, element: PollElement}[] = [];\nrootScope.on('poll_update', (e) => {\n const {poll, results} = e as {poll: Poll, results: PollResults};\n\n //console.log('poll_update', poll, results);\n for(const connected of connectedPolls) {\n if(connected.id === poll.id) {\n const pollElement = connected.element;\n pollElement.isClosed = !!poll.pFlags.closed;\n pollElement.performResults(results, poll.chosenIndexes);\n }\n }\n}); */\n\nrootScope.addEventListener('poll_update', ({poll, results}) => {\n const pollElements = Array.from(document.querySelectorAll(`poll-element[poll-id=\"${poll.id}\"]`)) as PollElement[];\n pollElements.forEach((pollElement) => {\n // console.log('poll_update', poll, results);\n pollElement.isClosed = !!poll.pFlags.closed;\n pollElement.performResults(results, poll.chosenIndexes);\n });\n});\n\nmediaSizes.addEventListener('resize', () => {\n PollElement.setMaxLength();\n PollElement.resizePolls();\n});\n\nmediaSizes.addEventListener('changeScreen', () => {\n PollElement.setMaxLength();\n});\n\nconst hideQuizHint = (element: HTMLElement, onHide: () => void, timeout: number) => {\n element.classList.remove('active');\n\n clearTimeout(timeout);\n setTimeout(() => {\n onHide();\n element.remove();\n\n if(prevQuizHint === element && prevQuizHintOnHide === onHide && prevQuizHintTimeout === timeout) {\n prevQuizHint = prevQuizHintOnHide = null;\n prevQuizHintTimeout = 0;\n }\n }, 200);\n};\n\nlet prevQuizHint: HTMLElement, prevQuizHintOnHide: () => void, prevQuizHintTimeout: number;\nlet isListenerSet = false;\nconst setQuizHint = (solution: string, solution_entities: any[], onHide: () => void) => {\n if(prevQuizHint) {\n hideQuizHint(prevQuizHint, prevQuizHintOnHide, prevQuizHintTimeout);\n }\n\n const element = document.createElement('div');\n element.classList.add('quiz-hint');\n\n const container = document.createElement('div');\n container.classList.add('container', 'tgico');\n\n const textEl = document.createElement('div');\n textEl.classList.add('text');\n\n container.append(textEl);\n element.append(container);\n\n setInnerHTML(textEl, wrapRichText(solution, {entities: solution_entities}));\n appImManager.chat.bubbles.container.append(element);\n\n void element.offsetLeft; // reflow\n element.classList.add('active');\n\n prevQuizHint = element;\n prevQuizHintOnHide = onHide;\n prevQuizHintTimeout = window.setTimeout(() => {\n hideQuizHint(element, onHide, prevQuizHintTimeout);\n }, IS_TOUCH_SUPPORTED ? 5000 : 7000);\n\n if(!isListenerSet) {\n isListenerSet = true;\n appImManager.addEventListener('peer_changed', () => {\n if(prevQuizHint) {\n hideQuizHint(prevQuizHint, prevQuizHintOnHide, prevQuizHintTimeout);\n }\n });\n }\n};\n\nexport default class PollElement extends HTMLElement {\n public static MAX_OFFSET = -46.5;\n public static MAX_LENGTH = 0;\n public svgLines: SVGSVGElement[];\n private numberDivs: HTMLDivElement[];\n private answerDivs: HTMLDivElement[];\n private descDiv: HTMLElement;\n private typeDiv: HTMLElement;\n private avatarsDiv: HTMLElement;\n private viewResults: HTMLElement;\n private votersCountDiv: HTMLDivElement;\n\n // private maxLength: number;\n // private maxLengths: number[];\n private maxPercents: number[];\n\n public isClosed = false;\n private isQuiz = false;\n private isRetracted = false;\n private isPublic = false;\n private isMultiple = false;\n private chosenIndexes: number[] = [];\n private percents: number[];\n\n public message: Message.message;\n public managers: AppManagers;\n\n private quizInterval: number;\n private quizTimer: SVGSVGElement;\n\n private sendVoteBtn: HTMLElement;\n private chosingIndexes: number[] = [];\n\n private sendVotePromise: Promise;\n private sentVote = false;\n\n private detachClickEvent: () => void;\n\n public static setMaxLength() {\n const width = windowSize.width <= 360 ? windowSize.width - 120 : mediaSizes.active.poll.width;\n this.MAX_LENGTH = width + tailLength + this.MAX_OFFSET + -13.7; // 13 - position left\n }\n\n public static resizePolls() {\n if(!this.MAX_LENGTH) return;\n const pollElements = Array.from(document.querySelectorAll('poll-element.is-voted')) as PollElement[];\n pollElements.forEach((pollElement) => {\n pollElement.svgLines.forEach((svg, idx) => {\n // void svg.getBoundingClientRect(); // reflow\n pollElement.setLineProgress(idx, 1);\n });\n });\n }\n\n public async render() {\n // браузер вызывает этот метод при добавлении элемента в документ\n // (может вызываться много раз, если элемент многократно добавляется/удаляется)\n\n if(!lineTotalLength) {\n lineTotalLength = (document.getElementById('poll-line') as any as SVGPathElement).getTotalLength();\n // console.log('line total length:', lineTotalLength);\n PollElement.setMaxLength();\n }\n\n // const {poll, results} = this.managers.appPollsManager.getPoll(pollId);\n const {poll, results} = this.message.media as MessageMedia.messageMediaPoll;\n\n /* const timestamp = Date.now() / 1000 | 0;\n if(timestamp < this.message.date) { */\n if(this.message.pFlags.is_scheduled) {\n this.classList.add('disable-hover');\n }\n\n // console.log('pollElement poll:', poll, results);\n\n let descKey: LangPackKey;\n if(poll.pFlags) {\n this.isPublic = !!poll.pFlags.public_voters;\n this.isQuiz = !!poll.pFlags.quiz;\n this.isClosed = !!poll.pFlags.closed;\n this.isMultiple = !!poll.pFlags.multiple_choice;\n\n if(this.isClosed) {\n descKey = 'Chat.Poll.Type.Closed';\n this.classList.add('is-closed');\n } else if(this.isQuiz) {\n descKey = this.isPublic ? 'Chat.Poll.Type.Quiz' : 'Chat.Poll.Type.AnonymousQuiz';\n } else {\n descKey = this.isPublic ? 'Chat.Poll.Type.Public' : 'Chat.Poll.Type.Anonymous';\n }\n }\n\n this.classList.toggle('is-multiple', this.isMultiple);\n\n const multipleSelect = this.isMultiple ? '' : '';\n const votes = poll.answers.map((answer, idx) => {\n return `\n
\n
\n
\n \n \n \n ${multipleSelect}\n
\n
\n
\n \n \n \n \n
\n `;\n }).join('');\n\n this.innerHTML = `\n
\n
\n
\n
\n
\n ${votes}`;\n\n setInnerHTML(this.firstElementChild, wrapEmojiText(poll.question));\n\n Array.from(this.querySelectorAll('.poll-answer-text')).forEach((el, idx) => {\n setInnerHTML(el, wrapEmojiText(poll.answers[idx].text));\n });\n\n this.descDiv = this.firstElementChild.nextElementSibling as HTMLElement;\n this.typeDiv = this.descDiv.firstElementChild as HTMLElement;\n this.avatarsDiv = this.descDiv.lastElementChild as HTMLElement;\n\n if(descKey) {\n this.typeDiv.append(i18n(descKey));\n }\n\n if(this.isQuiz) {\n this.classList.add('is-quiz');\n\n if(poll.close_period && poll.close_date) {\n const timeLeftDiv = document.createElement('div');\n timeLeftDiv.classList.add('poll-time');\n this.descDiv.append(timeLeftDiv);\n\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n // svg.setAttributeNS(null, 'viewBox', '0 0 15 15');\n svg.classList.add('poll-quiz-timer');\n\n this.quizTimer = svg;\n\n const strokeWidth = 2;\n const radius = 7;\n const circumference = 2 * Math.PI * radius;\n\n const circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');\n circle.classList.add('poll-quiz-timer-circle');\n circle.setAttributeNS(null, 'cx', '16');\n circle.setAttributeNS(null, 'cy', '16');\n circle.setAttributeNS(null, 'r', '' + radius);\n circle.setAttributeNS(null, 'stroke-width', '' + strokeWidth);\n\n svg.append(circle);\n this.descDiv.append(svg);\n\n const period = poll.close_period * 1000;\n const closeTime = (poll.close_date - await rootScope.managers.timeManager.getServerTimeOffset()) * 1000;\n\n // console.log('closeTime:', poll.close_date, serverTimeManager.serverTimeOffset, Date.now() / 1000 | 0);\n\n // let time = Date.now();\n // let percents = (closeTime - time) / period;\n\n // timeLeftDiv.innerHTML = String((closeTime - time) / 1000 + 1 | 0).toHHMMSS();\n\n // // @ts-ignore\n // circle.style.strokeDashoffset = circumference + percents * circumference;\n // circle.style.strokeDasharray = ${circumference} ${circumference};\n\n this.quizInterval = window.setInterval(() => {\n const time = Date.now();\n const percents = (closeTime - time) / period;\n const timeLeft = (closeTime - time) / 1000 + 1 | 0;\n timeLeftDiv.innerHTML = toHHMMSS(timeLeft);\n\n if(timeLeft <= 5) {\n timeLeftDiv.style.color = '#ee545c';\n circle.style.stroke = '#ee545c';\n }\n // timeLeftDiv.style.visibility = 'visible';\n\n // @ts-ignore\n circle.style.strokeDashoffset = circumference + percents * circumference;\n circle.style.strokeDasharray = `${circumference} ${circumference}`;\n\n if(time >= closeTime) {\n clearInterval(this.quizInterval);\n timeLeftDiv.innerHTML = '';\n // @ts-ignore\n circle.style.strokeDashoffset = circumference;\n this.quizInterval = 0;\n\n setTimeout(() => {\n // нужно запросить апдейт чтобы опрос обновился\n this.managers.appPollsManager.getResults(this.message);\n }, 3e3);\n }\n }, 1e3);\n }\n }\n\n this.answerDivs = Array.from(this.querySelectorAll('.poll-answer')) as HTMLDivElement[];\n this.svgLines = Array.from(this.querySelectorAll('.poll-line')) as SVGSVGElement[];\n this.numberDivs = Array.from(this.querySelectorAll('.poll-answer-percents')) as HTMLDivElement[];\n\n const footerDiv = document.createElement('div');\n footerDiv.classList.add('poll-footer');\n\n this.viewResults = document.createElement('div');\n this.viewResults.className = 'poll-footer-button poll-view-results hide';\n this.viewResults.append(i18n('Chat.Poll.ViewResults'));\n\n this.votersCountDiv = document.createElement('div');\n this.votersCountDiv.className = 'poll-votes-count';\n\n footerDiv.append(this.viewResults, this.votersCountDiv);\n this.append(footerDiv);\n\n this.viewResults.addEventListener('click', (e) => {\n cancelEvent(e);\n\n if(!appSidebarRight.isTabExists(AppPollResultsTab)) {\n appSidebarRight.createTab(AppPollResultsTab).open(this.message);\n }\n });\n ripple(this.viewResults);\n\n if(this.isMultiple) {\n this.sendVoteBtn = document.createElement('div');\n this.sendVoteBtn.classList.add('poll-footer-button', 'poll-send-vote');\n this.sendVoteBtn.append(i18n('Chat.Poll.SubmitVote'));\n ripple(this.sendVoteBtn);\n\n if(!poll.chosenIndexes.length) {\n this.votersCountDiv.classList.add('hide');\n }\n\n attachClickEvent(this.sendVoteBtn, (e) => {\n cancelEvent(e);\n /* const indexes = this.answerDivs.filter((el) => el.classList.contains('is-chosing')).map((el) => +el.dataset.index);\n if(indexes.length) {\n\n } */\n if(this.chosingIndexes.length) {\n this.sendVotes(this.chosingIndexes).then(() => {\n this.chosingIndexes.length = 0;\n this.answerDivs.forEach((el) => {\n el.classList.remove('is-chosing');\n });\n });\n }\n });\n\n footerDiv.append(this.sendVoteBtn);\n }\n\n // const width = this.getBoundingClientRect().width;\n // const width = mediaSizes.active.poll.width;\n // this.maxLength = width + tailLength + this.maxOffset + -13.7; // 13 - position left\n\n const canVote = !(poll.chosenIndexes.length || this.isClosed);\n if(!canVote || this.isPublic) {\n this.performResults(results, poll.chosenIndexes, false);\n }\n\n if(canVote) {\n this.setVotersCount(results);\n this.detachClickEvent = attachClickEvent(this, this.clickHandler);\n }\n }\n\n initQuizHint(results: PollResults) {\n if(results.solution && results.solution_entities) {\n const toggleHint = document.createElement('div');\n toggleHint.classList.add('tgico-tip', 'poll-hint');\n this.descDiv.append(toggleHint);\n\n // let active = false;\n attachClickEvent(toggleHint, (e) => {\n cancelEvent(e);\n\n // active = true;\n toggleHint.classList.add('active');\n setQuizHint(results.solution, results.solution_entities, () => {\n // active = false;\n toggleHint.classList.remove('active');\n });\n });\n\n if(this.sentVote) {\n const correctResult = results.results.find((r) => r.pFlags.correct);\n if(correctResult && !correctResult.pFlags.chosen) {\n simulateClickEvent(toggleHint);\n }\n }\n }\n }\n\n clickHandler = (e: Event) => {\n const target = findUpClassName(e.target, 'poll-answer') as HTMLElement;\n if(!target) {\n return;\n }\n\n cancelEvent(e);\n const answerIndex = +target.dataset.index;\n if(this.isMultiple) {\n target.classList.toggle('is-chosing');\n\n const foundIndex = this.chosingIndexes.indexOf(answerIndex);\n if(foundIndex !== -1) {\n this.chosingIndexes.splice(foundIndex, 1);\n } else {\n this.chosingIndexes.push(answerIndex);\n }\n } else {\n this.sendVotes([answerIndex]);\n }\n\n /* target.classList.add('is-voting');\n setTimeout(() => { // simulate\n this.setResults([100, 0], answerIndex);\n target.classList.remove('is-voting');\n }, 1000); */\n };\n\n sendVotes(indexes: number[]) {\n if(this.sendVotePromise) return this.sendVotePromise;\n\n const targets = this.answerDivs.filter((_, idx) => indexes.includes(idx));\n targets.forEach((target) => {\n target.classList.add('is-voting');\n });\n\n this.classList.add('disable-hover');\n this.sentVote = true;\n return this.sendVotePromise = this.managers.appPollsManager.sendVote(this.message, indexes).then(() => {\n targets.forEach((target) => {\n target.classList.remove('is-voting');\n });\n\n this.classList.remove('disable-hover');\n }).catch(() => {\n this.sentVote = false;\n }).finally(() => {\n this.sendVotePromise = null;\n });\n }\n\n performResults(results: PollResults, chosenIndexes: number[], animate = true) {\n if(!liteMode.isAvailable('animations')) {\n animate = false;\n }\n\n if(this.isQuiz && (results.results?.length || this.isClosed)) {\n this.answerDivs.forEach((el, idx) => {\n el.classList.toggle('is-correct', !!results.results[idx].pFlags.correct);\n });\n\n if(this.initQuizHint) {\n this.initQuizHint(results);\n this.initQuizHint = null;\n }\n\n if(this.quizInterval) {\n clearInterval(this.quizInterval);\n this.quizInterval = 0;\n }\n\n if(this.quizTimer?.parentElement) {\n this.quizTimer.remove();\n }\n\n const timeEl = this.descDiv.querySelector('.poll-time');\n if(timeEl) {\n timeEl.remove();\n }\n }\n\n if(this.isClosed) {\n this.classList.add('is-closed');\n replaceContent(this.typeDiv, i18n('Chat.Poll.Type.Closed'));\n }\n\n // set chosen\n if(this.chosenIndexes.length !== chosenIndexes.length || this.isClosed) { // if we voted\n this.isRetracted = this.chosenIndexes.length && !chosenIndexes.length;\n this.chosenIndexes = chosenIndexes.slice();\n\n if(this.isRetracted) {\n this.detachClickEvent = attachClickEvent(this, this.clickHandler);\n } else {\n this.detachClickEvent?.();\n this.detachClickEvent = undefined;\n }\n }\n\n // is need update\n if(this.chosenIndexes.length || this.isRetracted || this.isClosed) {\n const percents = results.results.map((v) => results.total_voters ? v.voters / results.total_voters * 100 : 0);\n\n this.classList.toggle('no-transition', !animate);\n if(animate) {\n SetTransition({\n element: this,\n className: '',\n forwards: !this.isRetracted,\n duration: 340\n });\n }\n\n fastRaf(() => {\n this.setResults(this.isRetracted ? this.percents : percents, this.chosenIndexes, animate);\n this.percents = percents;\n this.isRetracted = false;\n });\n }\n\n this.setVotersCount(results);\n\n if(this.isPublic) {\n if(!this.isMultiple) {\n this.viewResults.classList.toggle('hide', !results.total_voters || !this.chosenIndexes.length);\n this.votersCountDiv.classList.toggle('hide', !!this.chosenIndexes.length);\n }\n\n const peerIds = (results.recent_voters || []).map((userId) => userId.toPeerId());\n const stackedAvatars = new StackedAvatars({avatarSize: 16});\n stackedAvatars.render(peerIds);\n replaceContent(this.avatarsDiv, stackedAvatars.container);\n }\n\n if(this.isMultiple) {\n const isVoted = !!this.chosenIndexes.length;\n\n const hideSendVoteBtn = this.isClosed || isVoted;\n const hideViewResultsBtn = !this.isPublic || !results.total_voters || (!isVoted && !this.isClosed);\n this.sendVoteBtn.classList.toggle('hide', hideSendVoteBtn);\n this.viewResults.classList.toggle('hide', hideViewResultsBtn);\n this.votersCountDiv.classList.toggle('hide', !hideSendVoteBtn || !hideViewResultsBtn);\n }\n }\n\n setResults(percents: number[], chosenIndexes: number[], animate: boolean) {\n this.svgLines.forEach((svg) => svg.style.display = '');\n\n this.answerDivs.forEach((el, idx) => {\n el.classList.toggle('is-chosen', chosenIndexes.includes(idx));\n });\n\n const maxValue = Math.max(...percents);\n // this.maxLengths = percents.map((p) => p / maxValue * this.maxLength);\n this.maxPercents = percents.map((p) => p / maxValue);\n\n // line\n if(this.isRetracted) {\n this.svgLines.forEach((svg, idx) => {\n this.setLineProgress(idx, -1);\n });\n } else {\n const cb = () => {\n this.svgLines.forEach((svg, idx) => {\n // void svg.getBoundingClientRect(); // reflow\n this.setLineProgress(idx, 1);\n });\n };\n\n animate ? fastRaf(cb) : cb();\n }\n\n percents = percents.slice();\n roundPercents(percents);\n let getPercentValue: (percents: number, index: number) => number;\n const iterate = (i: number) => {\n percents.forEach((percents, idx) => {\n const value = getPercentValue(percents, i);\n this.numberDivs[idx].innerText = value + '%';\n });\n };\n // numbers\n if(this.isRetracted) {\n getPercentValue = (percents, index) => Math.round(percents / times * index);\n\n if(animate) {\n for(let i = (times - 1), k = 0; i >= 0; --i, ++k) {\n setTimeout(() => {\n iterate(i);\n }, oneTime * k);\n }\n } else {\n iterate(0);\n }\n } else {\n getPercentValue = (percents, index) => Math.round(percents / times * (index + 1));\n\n if(animate) {\n for(let i = 0; i < times; ++i) {\n setTimeout(() => {\n iterate(i);\n }, oneTime * i);\n }\n } else {\n iterate(times - 1);\n }\n }\n\n if(this.isRetracted) {\n if(animate) {\n this.classList.add('is-retracting');\n }\n\n this.classList.remove('is-voted');\n const cb = () => {\n this.svgLines.forEach((svg) => svg.style.display = 'none');\n };\n\n if(animate) {\n setTimeout(() => {\n this.classList.remove('is-retracting');\n cb();\n }, fullTime);\n } else {\n cb();\n }\n } else {\n this.classList.add('is-voted');\n }\n }\n\n setVotersCount(results: PollResults) {\n const votersCount = results.total_voters || 0;\n let key: LangPackKey;\n const args: FormatterArguments = [votersCount];\n if(this.isClosed) {\n if(this.isQuiz) key = votersCount ? 'Chat.Quiz.TotalVotes' : 'Chat.Quiz.TotalVotesResultEmpty';\n else key = votersCount ? 'Chat.Poll.TotalVotes1' : 'Chat.Poll.TotalVotesResultEmpty';\n } else {\n if(this.isQuiz) key = votersCount ? 'Chat.Quiz.TotalVotes' : 'Chat.Quiz.TotalVotesEmpty';\n else key = votersCount ? 'Chat.Poll.TotalVotes1' : 'Chat.Poll.TotalVotesEmpty';\n }\n\n replaceContent(this.votersCountDiv, i18n(key, args));\n }\n\n setLineProgress(index: number, multiplier: number) {\n const svg = this.svgLines[index];\n\n if(multiplier === -1) {\n svg.style.strokeDasharray = '';\n svg.style.strokeDashoffset = '';\n } else {\n // svg.style.strokeDasharray = (multiplier * this.maxLengths[index]) + ', 485.9';\n svg.style.strokeDasharray = (multiplier * this.maxPercents[index] * PollElement.MAX_LENGTH) + ', 485.9';\n // svg.style.strokeDasharray = (multiplier * this.maxPercents[index] * 100) + '%, 485.9';\n svg.style.strokeDashoffset = '' + multiplier * PollElement.MAX_OFFSET;\n }\n }\n\n // у элемента могут быть ещё другие методы и свойства\n}\n\ncustomElements.define('poll-element', PollElement);\n","// https://stackoverflow.com/a/14824756/6758968\nconst ltrChars = 'A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02B8\\u0300-\\u0590\\u0800-\\u1FFF'+'\\u2C00-\\uFB1C\\uFDFE-\\uFE6F\\uFEFD-\\uFFFF',\n rtlChars = '\\u0591-\\u07FF\\uFB1D-\\uFDFD\\uFE70-\\uFEFC',\n fullRtlDirCheck = new RegExp('^[^'+ltrChars+']*['+rtlChars+']'),\n justRtlDirCheck = new RegExp('['+rtlChars+']');\n\nexport default function isRTL(s: string, anyChar?: boolean) {\n return anyChar ? justRtlDirCheck.test(s) : fullRtlDirCheck.test(s);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AppImManager, ChatSavedPosition, ChatSetPeerOptions} from '../../lib/appManagers/appImManager';\nimport type {HistoryResult, MyMessage} from '../../lib/appManagers/appMessagesManager';\nimport type {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport type Chat from './chat';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport {logger} from '../../lib/logger';\nimport rootScope from '../../lib/rootScope';\nimport BubbleGroups from './bubbleGroups';\nimport PopupDatePicker from '../popups/datePicker';\nimport PopupForward from '../popups/forward';\nimport PopupStickers from '../popups/stickers';\nimport ProgressivePreloader from '../preloader';\nimport Scrollable, {SliceSides} from '../scrollable';\nimport StickyIntersector from '../stickyIntersector';\nimport animationIntersector from '../animationIntersector';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport {IS_ANDROID, IS_APPLE, IS_MOBILE, IS_SAFARI} from '../../environment/userAgent';\nimport I18n, {FormatterArguments, i18n, langPack, LangPackKey, UNSUPPORTED_LANG_PACK_KEY, _i18n} from '../../lib/langPack';\nimport AvatarElement from '../avatar';\nimport ripple from '../ripple';\nimport {MessageRender} from './messageRender';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport PollElement from '../poll';\nimport AudioElement from '../audio';\nimport {Chat as MTChat, ChatInvite, Document, Message, MessageEntity, MessageMedia, MessageReplyHeader, Photo, PhotoSize, ReactionCount, ReplyMarkup, SponsoredMessage, Update, UrlAuthResult, User, WebPage} from '../../layer';\nimport {BOT_START_PARAM, NULL_PEER_ID, REPLIES_PEER_ID} from '../../lib/mtproto/mtproto_config';\nimport {FocusDirection, ScrollStartCallbackDimensions} from '../../helpers/fastSmoothScroll';\nimport useHeavyAnimationCheck, {getHeavyAnimationPromise, dispatchHeavyAnimationEvent, interruptHeavyAnimation} from '../../hooks/useHeavyAnimationCheck';\nimport {fastRaf, fastRafPromise} from '../../helpers/schedulers';\nimport deferredPromise from '../../helpers/cancellablePromise';\nimport RepliesElement from './replies';\nimport DEBUG from '../../config/debug';\nimport {SliceEnd} from '../../helpers/slicedArray';\nimport PeerTitle from '../peerTitle';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport {toast, toastNew} from '../toast';\nimport {getMiddleware, Middleware} from '../../helpers/middleware';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent, simulateClickEvent} from '../../helpers/dom/clickEvent';\nimport htmlToDocumentFragment from '../../helpers/dom/htmlToDocumentFragment';\nimport reflowScrollableElement from '../../helpers/dom/reflowScrollableElement';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport whichChild from '../../helpers/dom/whichChild';\nimport {cancelAnimationByKey} from '../../helpers/animation';\nimport assumeType from '../../helpers/assumeType';\nimport debounce, {DebounceReturnType} from '../../helpers/schedulers/debounce';\nimport {SEND_WHEN_ONLINE_TIMESTAMP} from '../../lib/mtproto/constants';\nimport windowSize from '../../helpers/windowSize';\nimport {formatPhoneNumber} from '../../helpers/formatPhoneNumber';\nimport AppMediaViewer from '../appMediaViewer';\nimport SetTransition from '../singleTransition';\nimport handleHorizontalSwipe from '../../helpers/dom/handleHorizontalSwipe';\nimport findUpAttribute from '../../helpers/dom/findUpAttribute';\nimport findUpAsChild from '../../helpers/dom/findUpAsChild';\nimport formatCallDuration from '../../helpers/formatCallDuration';\nimport IS_CALL_SUPPORTED from '../../environment/callSupport';\nimport Button from '../button';\nimport {CallType} from '../../lib/calls/types';\nimport getVisibleRect from '../../helpers/dom/getVisibleRect';\nimport PopupJoinChatInvite from '../popups/joinChatInvite';\nimport {InternalLink, INTERNAL_LINK_TYPE} from '../../lib/appManagers/internalLink';\nimport ReactionsElement, {REACTIONS_ELEMENTS} from './reactions';\nimport type ReactionElement from './reaction';\nimport RLottiePlayer from '../../lib/rlottie/rlottiePlayer';\nimport pause from '../../helpers/schedulers/pause';\nimport ScrollSaver from '../../helpers/scrollSaver';\nimport getObjectKeysAndSort from '../../helpers/object/getObjectKeysAndSort';\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport formatNumber from '../../helpers/number/formatNumber';\nimport getViewportSlice from '../../helpers/dom/getViewportSlice';\nimport SuperIntersectionObserver from '../../helpers/dom/superIntersectionObserver';\nimport generateFakeIcon from '../generateFakeIcon';\nimport copyFromElement from '../../helpers/dom/copyFromElement';\nimport PopupElement from '../popups';\nimport setAttachmentSize from '../../helpers/setAttachmentSize';\nimport wrapWebPageDescription from '../wrappers/webPageDescription';\nimport wrapWebPageTitle from '../wrappers/webPageTitle';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\nimport wrapMessageActionTextNew from '../wrappers/messageActionTextNew';\nimport isMentionUnread from '../../lib/appManagers/utils/messages/isMentionUnread';\nimport getMediaFromMessage from '../../lib/appManagers/utils/messages/getMediaFromMessage';\nimport getPeerColorById from '../../lib/appManagers/utils/peers/getPeerColorById';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport getServerMessageId from '../../lib/appManagers/utils/messageId/getServerMessageId';\nimport generateMessageId from '../../lib/appManagers/utils/messageId/generateMessageId';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport {Awaited, SendMessageEmojiInteractionData} from '../../types';\nimport idleController from '../../helpers/idleController';\nimport overlayCounter from '../../helpers/overlayCounter';\nimport {cancelContextMenuOpening} from '../../helpers/dom/attachContextMenuListener';\nimport contextMenuController from '../../helpers/contextMenuController';\nimport {AckedResult} from '../../lib/mtproto/superMessagePort';\nimport middlewarePromise from '../../helpers/middlewarePromise';\nimport {EmoticonsDropdown} from '../emoticonsDropdown';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport noop from '../../helpers/noop';\nimport getAlbumText from '../../lib/appManagers/utils/messages/getAlbumText';\nimport paymentsWrapCurrencyAmount from '../../helpers/paymentsWrapCurrencyAmount';\nimport PopupPayment from '../popups/payment';\nimport isInDOM from '../../helpers/dom/isInDOM';\nimport getStickerEffectThumb from '../../lib/appManagers/utils/stickers/getStickerEffectThumb';\nimport attachStickerViewerListeners from '../stickerViewer';\nimport {makeMediaSize, MediaSize} from '../../helpers/mediaSize';\nimport wrapSticker, {onEmojiStickerClick} from '../wrappers/sticker';\nimport wrapAlbum from '../wrappers/album';\nimport wrapDocument from '../wrappers/document';\nimport wrapGroupedDocuments from '../wrappers/groupedDocuments';\nimport wrapPhoto from '../wrappers/photo';\nimport wrapPoll from '../wrappers/poll';\nimport wrapVideo from '../wrappers/video';\nimport isRTL from '../../helpers/string/isRTL';\nimport NBSP from '../../helpers/string/nbsp';\nimport DotRenderer from '../dotRenderer';\nimport toHHMMSS from '../../helpers/string/toHHMMSS';\nimport {BatchProcessor} from '../../helpers/sortedList';\nimport wrapUrl from '../../lib/richTextProcessor/wrapUrl';\nimport getMessageThreadId from '../../lib/appManagers/utils/messages/getMessageThreadId';\nimport wrapTopicNameButton from '../wrappers/topicNameButton';\nimport wrapMediaSpoiler, {onMediaSpoilerClick, toggleMediaSpoiler} from '../wrappers/mediaSpoiler';\nimport confirmationPopup from '../confirmationPopup';\nimport wrapPeerTitle from '../wrappers/peerTitle';\nimport {PopupPeerCheckboxOptions} from '../popups/peer';\nimport toggleDisability from '../../helpers/dom/toggleDisability';\nimport {copyTextToClipboard} from '../../helpers/clipboard';\nimport liteMode from '../../helpers/liteMode';\nimport getMediaDurationFromMessage from '../../lib/appManagers/utils/messages/getMediaDurationFromMessage';\n\nexport const USER_REACTIONS_INLINE = false;\nconst USE_MEDIA_TAILS = false;\ntype MESSAGE_ACTION_TYPE = Message.messageService['action']['_'];\ntype IGNORE_ACTION_KEY = MESSAGE_ACTION_TYPE;\ntype IGNORE_ACTION_VALUE = true | ((message: Message.messageService) => boolean);\nconst IGNORE_ACTIONS: Map = new Map([\n ['messageActionHistoryClear', true],\n ['messageActionChatCreate', (message) => message.pFlags.out]\n // 'messageActionChannelMigrateFrom'\n] as [IGNORE_ACTION_KEY, IGNORE_ACTION_VALUE][]);\n\nexport const SERVICE_AS_REGULAR: Set = new Set();\n\nif(IS_CALL_SUPPORTED) {\n SERVICE_AS_REGULAR.add('messageActionPhoneCall');\n}\n\nconst TEST_SCROLL_TIMES: number = undefined;\nlet TEST_SCROLL = TEST_SCROLL_TIMES;\n\nlet queueId = 0;\n\ntype GenerateLocalMessageType = IsService extends true ? Message.messageService : Message.message;\n\nconst SPONSORED_MESSAGE_ID_OFFSET = 1;\nexport const STICKY_OFFSET = 3;\nconst SCROLLED_DOWN_THRESHOLD = 300;\nconst PEER_CHANGED_ERROR = new Error('peer changed');\n\nconst DO_NOT_SLICE_VIEWPORT = false;\nconst DO_NOT_SLICE_VIEWPORT_ON_RENDER = false;\nconst DO_NOT_UPDATE_MESSAGE_VIEWS = false;\nconst DO_NOT_UPDATE_MESSAGE_REACTIONS = false;\nconst DO_NOT_UPDATE_MESSAGE_REPLY = false;\n\nconst BIG_EMOJI_SIZES: {[size: number]: number} = {\n 1: 96,\n 2: 90,\n 3: 84,\n 4: 72,\n 5: 60,\n 6: 48,\n 7: 36\n};\nconst BIG_EMOJI_SIZES_LENGTH = Object.keys(BIG_EMOJI_SIZES).length;\n\ntype Bubble = {\n bubble: HTMLElement,\n mids: Set,\n groupedId?: string\n};\n\ntype MyHistoryResult = HistoryResult | {history: number[]};\n\nfunction getMainMidForGrouped(mids: number[]) {\n return Math.max(...mids);\n}\n\nexport default class ChatBubbles {\n public container: HTMLDivElement;\n public chatInner: HTMLDivElement;\n public scrollable: Scrollable;\n\n private getHistoryTopPromise: Promise;\n private getHistoryBottomPromise: Promise;\n\n // public messagesCount: number = -1;\n\n private unreadOut = new Set();\n public needUpdate: {replyToPeerId: PeerId, replyMid: number, mid: number}[] = []; // if need wrapSingleMessage\n\n public bubbles: {[mid: string]: HTMLElement} = {};\n public skippedMids: Set = new Set();\n public bubblesNewByGroupedId: {[groupId: string]: Bubble} = {};\n public bubblesNew: {[mid: string]: Bubble} = {};\n private dateMessages: {[timestamp: number]: {\n div: HTMLElement,\n firstTimestamp: number,\n container: HTMLElement,\n timeout?: number\n }} = {};\n\n private scrolledDown = true;\n private isScrollingTimeout = 0;\n\n private stickyIntersector: StickyIntersector;\n\n private unreaded: Map = new Map();\n private unreadedSeen: Set = new Set();\n private readPromise: Promise;\n\n private bubbleGroups: BubbleGroups;\n\n private preloader: ProgressivePreloader = null;\n\n // private messagesQueueOnRender: () => void = null;\n private messagesQueueOnRenderAdditional: () => void = null;\n\n private firstUnreadBubble: HTMLElement = null;\n private attachedUnreadBubble: boolean;\n\n public lazyLoadQueue: LazyLoadQueue;\n\n private middlewareHelper = getMiddleware();\n\n private log: ReturnType;\n\n public listenerSetter: ListenerSetter;\n\n private followStack: number[] = [];\n\n private isHeavyAnimationInProgress = false;\n private scrollingToBubble: HTMLElement;\n\n private isFirstLoad = true;\n private needReflowScroll: boolean;\n\n private fetchNewPromise: Promise;\n\n private passEntities: Partial<{\n [_ in MessageEntity['_']]: boolean\n }> = {};\n\n private onAnimateLadder: () => Promise | void;\n // private ladderDeferred: CancellablePromise;\n private resolveLadderAnimation: () => Promise;\n private emptyPlaceholderBubble: HTMLElement;\n\n private viewsMids: Set = new Set();\n private sendViewCountersDebounced: () => Promise;\n\n private isTopPaddingSet = false;\n\n private getSponsoredMessagePromise: Promise;\n\n private previousStickyDate: HTMLElement;\n private sponsoredMessage: SponsoredMessage.sponsoredMessage;\n\n private hoverBubble: HTMLElement;\n private hoverReaction: HTMLElement;\n private sliceViewportDebounced: DebounceReturnType;\n private resizeObserver: ResizeObserver;\n private willScrollOnLoad: boolean;\n public observer: SuperIntersectionObserver;\n\n private renderingMessages: Set = new Set();\n private setPeerCached: boolean;\n private attachPlaceholderOnRender: () => void;\n\n private bubblesToEject: Set = new Set();\n private bubblesToReplace: Map = new Map(); // TO -> FROM\n private updatePlaceholderPosition: () => void;\n private setPeerOptions: {lastMsgId: number; topMessage: number; savedPosition: ChatSavedPosition};\n\n private setPeerTempId: number = 0;\n\n private renderNewPromises: Set> = new Set();\n private updateGradient: boolean;\n\n private extendedMediaMessages: Set = new Set();\n private pollExtendedMediaMessagesPromise: Promise;\n\n private batchProcessor: BatchProcessor>>;\n\n // private reactions: Map;\n\n constructor(\n private chat: Chat,\n private managers: AppManagers\n ) {\n this.log = this.chat.log;\n // this.chat.log.error('Bubbles construction');\n\n this.listenerSetter = new ListenerSetter();\n\n this.constructBubbles();\n\n // * constructor end\n\n this.batchProcessor = new BatchProcessor({\n log: this.log,\n process: this.processBatch,\n possibleError: PEER_CHANGED_ERROR\n });\n this.bubbleGroups = new BubbleGroups(this.chat);\n this.preloader = new ProgressivePreloader({\n cancelable: false\n });\n this.lazyLoadQueue = new LazyLoadQueue(undefined, true);\n this.lazyLoadQueue.queueId = ++queueId;\n\n // this.reactions = new Map();\n\n // * events\n\n // will call when sent for update pos\n this.listenerSetter.add(rootScope)('history_update', async({storageKey, sequential, message}) => {\n if(this.chat.messagesStorageKey !== storageKey || this.chat.type === 'scheduled') {\n return;\n }\n\n const {mid} = message;\n const log = false ? this.log.bindPrefix('history_update-' + mid) : undefined;\n log && log('start');\n\n const bubble = this.bubbles[mid];\n if(!bubble) return;\n\n if(this.renderNewPromises.size) {\n log && log.error('will await new messages render');\n await Promise.all(Array.from(this.renderNewPromises));\n }\n\n if(this.messagesQueuePromise) {\n log && log.error('messages render in process');\n await this.messagesQueuePromise;\n }\n\n if(this.bubbles[mid] !== bubble) return;\n\n // await getHeavyAnimationPromise();\n\n const item = this.bubbleGroups.getItemByBubble(bubble);\n if(!item) { // probably a group item\n log && log.error('no item by bubble', bubble);\n return;\n } else if(item.mid === mid) {\n log && log.warn('wow what', item, mid);\n return;\n }\n\n if(sequential) {\n const group = item.group;\n const newItem = this.bubbleGroups.createItem(bubble, message);\n // newItem.mid = item.mid;\n const _items = this.bubbleGroups.itemsArr.slice();\n indexOfAndSplice(_items, item);\n const foundItem = this.bubbleGroups.findGroupSiblingByItem(newItem, _items);\n if(\n group === foundItem?.group ||\n (group === this.bubbleGroups.getLastGroup() && group.items.length === 1 && newItem.dateTimestamp === item.dateTimestamp) ||\n (this.peerId === rootScope.myId && sequential && newItem.dateTimestamp === item.dateTimestamp)\n ) {\n log && log('item has correct position', item);\n this.bubbleGroups.changeBubbleMid(bubble, mid);\n return;\n }\n }\n\n // return;\n\n // await fastRafPromise();\n // if(this.bubbles[mid] !== bubble) return;\n\n // const groupIndex = this.bubbleGroups.groups.indexOf(group);\n this.bubbleGroups.removeAndUnmountBubble(bubble);\n // if(!group.items.length) { // group has collapsed, next message can have higher mid so have to reposition them too\n // log && log('group has collapsed', item);\n\n // const siblingGroups = this.bubbleGroups.groups.slice(0, groupIndex + 1);\n // for(let length = siblingGroups.length, i = length - 2; i >= 0; --i) {\n // const siblingGroup = siblingGroups[i];\n // const siblingItems = siblingGroup.items;\n // const nextGroup = siblingGroups[i + 1];\n // const nextItems = nextGroup.items;\n\n // let _break = false, moved = false;\n // for(let j = siblingItems.length - 1; j >= 0; --j) {\n // const siblingItem = siblingItems[j];\n // const foundItem = this.bubbleGroups.findGroupSiblingByItem(siblingItem, nextItems);\n // if(!foundItem) {\n // _break = true;\n // break;\n // }\n\n // log('will move item', siblingItem, nextGroup);\n // this.bubbleGroups.removeAndUnmountBubble(siblingItem.bubble);\n // this.bubbleGroups.addItemToGroup(siblingItem, nextGroup);\n // moved = true;\n // }\n\n // if(moved) {\n // nextGroup.mount();\n // }\n\n // if(_break) {\n // break;\n // }\n // }\n // }\n\n const {groups} = this.groupBubbles([{bubble, message}]);\n this.bubbleGroups.mountUnmountGroups(groups);\n\n if(this.scrollingToBubble) {\n this.scrollToEnd();\n }\n\n log && log('end');\n\n // this.bubbleGroups.findIncorrentPositions();\n });\n\n this.listenerSetter.add(rootScope)('dialog_flush', ({peerId}) => {\n if(this.peerId === peerId) {\n this.deleteMessagesByIds(Object.keys(this.bubbles).map((m) => +m));\n }\n });\n\n // Calls when message successfully sent and we have an id\n this.listenerSetter.add(rootScope)('message_sent', async(e) => {\n const {storageKey, tempId, tempMessage, mid, message} = e;\n\n // ! can't use peerId to validate here, because id can be the same in 'scheduled' and 'chat' types\n if(this.chat.messagesStorageKey !== storageKey) {\n return;\n }\n\n const bubbles = this.bubbles;\n const _bubble = bubbles[tempId];\n if(_bubble) {\n const bubble = bubbles[tempId];\n bubbles[mid] = bubble;\n bubble.dataset.mid = '' + mid;\n delete bubbles[tempId];\n\n fastRaf(() => {\n const mid = +bubble.dataset.mid;\n if(bubbles[mid] === bubble && bubble.classList.contains('is-outgoing')) {\n bubble.classList.remove('is-sending', 'is-outgoing');\n bubble.classList.add((this.peerId === rootScope.myId && this.chat.type !== 'scheduled') || !this.unreadOut.has(mid) ? 'is-read' : 'is-sent');\n }\n });\n }\n\n if(this.unreadOut.has(tempId)) {\n this.unreadOut.delete(tempId);\n this.unreadOut.add(mid);\n }\n\n // * check timing of scheduled message\n if(this.chat.type === 'scheduled') {\n const timestamp = Date.now() / 1000 | 0;\n const maxTimestamp = tempMessage.date - 10;\n if(timestamp >= maxTimestamp) {\n this.deleteMessagesByIds([mid]);\n }\n }\n\n if(!_bubble) {\n return;\n }\n\n let messages: (Message.message | Message.messageService)[], tempIds: number[];\n const groupedId = (message as Message.message).grouped_id;\n if(groupedId) {\n messages = await this.managers.appMessagesManager.getMessagesByAlbum(groupedId);\n const mids = messages.map(({mid}) => mid);\n if(!mids.length || getMainMidForGrouped(mids) !== mid || bubbles[mid] !== _bubble) {\n return;\n }\n\n if(bubbles[mid] !== _bubble) {\n return;\n }\n\n tempIds = (Array.from(_bubble.querySelectorAll('.grouped-item')) as HTMLElement[]).map((el) => +el.dataset.mid);\n } else {\n messages = [message];\n tempIds = [tempId];\n }\n\n const reactionsElements = Array.from(_bubble.querySelectorAll('reactions-element')) as ReactionsElement[];\n if(reactionsElements.length) {\n reactionsElements.forEach((reactionsElement) => {\n reactionsElement.changeMessage(message as Message.message);\n });\n }\n\n (messages as Message.message[]).forEach((message, idx) => {\n if(!message) {\n return;\n }\n\n const tempId = tempIds[idx];\n const mid = message.mid;\n const bubble: HTMLElement = _bubble.querySelector(`.document-container[data-mid=\"${mid}\"]`) || _bubble;\n\n if(message._ !== 'message') {\n return;\n }\n\n if(message.replies) {\n const repliesElement = _bubble.querySelector('replies-element') as RepliesElement;\n if(repliesElement) {\n repliesElement.message = message;\n repliesElement.init();\n }\n }\n\n const media = message.media ?? {} as MessageMedia.messageMediaEmpty;\n const doc = (media as MessageMedia.messageMediaDocument).document as Document.document;\n const poll = (media as MessageMedia.messageMediaPoll).poll;\n const webPage = (media as MessageMedia.messageMediaWebPage).webpage as WebPage.webPage;\n if(doc) {\n const div = bubble.querySelector(`.document-container[data-mid=\"${tempId}\"] .document`);\n if(div) {\n const container = findUpClassName(div, 'document-container');\n\n if(!tempMessage.media?.document?.thumbs?.length && doc.thumbs?.length) {\n getHeavyAnimationPromise().then(async() => {\n const timeSpan = div.querySelector('.time');\n const newDiv = await wrapDocument({message, fontSize: rootScope.settings.messagesTextSize});\n div.replaceWith(newDiv);\n\n if(timeSpan) {\n (newDiv.querySelector('.document') || newDiv).append(timeSpan);\n }\n });\n }\n\n if(container) {\n container.dataset.mid = '' + mid;\n }\n }\n\n const element = bubble.querySelector(`audio-element[data-mid=\"${tempId}\"], .document[data-doc-id=\"${tempId}\"], .media-round[data-mid=\"${tempId}\"]`) as HTMLElement;\n if(element) {\n if(element instanceof AudioElement || element.classList.contains('media-round')) {\n element.dataset.mid = '' + message.mid;\n delete element.dataset.isOutgoing;\n (element as AudioElement).message = message;\n (element as AudioElement).onLoad(true);\n } else {\n element.dataset.docId = '' + doc.id;\n (element as any).doc = doc;\n }\n }\n } else if(poll) {\n const pollElement = bubble.querySelector('poll-element') as PollElement;\n if(pollElement) {\n pollElement.message = message;\n pollElement.setAttribute('poll-id', '' + poll.id);\n pollElement.setAttribute('message-id', '' + mid);\n }\n } else if(webPage && !bubble.querySelector('.web')) {\n getHeavyAnimationPromise().then(() => {\n this.safeRenderMessage(message, true, bubble);\n this.scrollToBubbleIfLast(bubble);\n });\n }\n\n // set new mids to album items for mediaViewer\n if(groupedId) {\n const item = (bubble.querySelector(`.grouped-item[data-mid=\"${tempId}\"]`) as HTMLElement) || bubble; // * it can be .document-container\n if(item) {\n item.dataset.mid = '' + mid;\n }\n }\n });\n });\n\n this.listenerSetter.add(rootScope)('message_edit', async({storageKey, message}) => {\n if(storageKey !== this.chat.messagesStorageKey) return;\n\n const bubble = this.bubbles[message.mid];\n if(!bubble) return;\n\n await getHeavyAnimationPromise();\n if(this.bubbles[message.mid] !== bubble) return;\n\n this.safeRenderMessage(message, true, bubble);\n });\n\n this.listenerSetter.add(rootScope)('message_error', async({storageKey, tempId}) => {\n if(storageKey !== this.chat.messagesStorageKey) return;\n\n const bubble = this.bubbles[tempId];\n if(!bubble) return;\n\n await getHeavyAnimationPromise();\n if(this.bubbles[tempId] !== bubble) return;\n\n bubble.classList.remove('is-outgoing');\n bubble.classList.add('is-error');\n });\n\n this.listenerSetter.add(rootScope)('message_transcribed', ({peerId, mid, text, pending}) => {\n if(peerId !== this.peerId) return;\n\n const bubble = this.bubbles[mid];\n if(!bubble) return;\n\n // TODO: Move it to AudioElement method `finishVoiceTranscription`\n const audioElement = bubble.querySelector('audio-element') as AudioElement;\n if(!audioElement) {\n return;\n }\n\n // const scrollSaver = this.createScrollSaver(false);\n // scrollSaver.save();\n\n const speechTextDiv = bubble.querySelector('.document-wrapper, .quote-text.has-document') as HTMLElement;\n const speechRecognitionIcon = audioElement.querySelector('.audio-to-text-button span');\n const speechRecognitionLoader = audioElement.querySelector('.loader');\n if(speechTextDiv && speechRecognitionIcon) {\n let transcribedText = speechTextDiv.querySelector('.audio-transcribed-text');\n if(!transcribedText) {\n transcribedText = document.createElement('div');\n transcribedText.classList.add('audio-transcribed-text');\n transcribedText.append(document.createTextNode(''));\n\n if(speechTextDiv.classList.contains('document-wrapper')) {\n audioElement.before(transcribedText);\n } else {\n speechTextDiv.append(transcribedText);\n }\n\n if(pending) {\n const dots = document.createElement('span');\n dots.classList.add('audio-transcribing-dots');\n transcribedText.append(dots);\n }\n } else if(!pending) {\n const dots = transcribedText.querySelector('.audio-transcribing-dots');\n dots?.remove();\n }\n\n if(!text && !pending/* && !transcribedText.classList.contains('has-some-text') */) {\n transcribedText.replaceChildren(i18n('Chat.Voice.Transribe.Error'));\n transcribedText.classList.add('is-error');\n } else if(text) {\n // transcribedText.classList.add('has-some-text');\n transcribedText.firstChild.textContent = text;\n }\n\n speechRecognitionIcon.classList.remove('tgico-transcribe');\n speechRecognitionIcon.classList.add('tgico-up');\n\n if(!pending && speechRecognitionLoader) {\n speechRecognitionLoader.classList.remove('active');\n setTimeout(() => {\n speechRecognitionLoader.remove();\n }, 300);\n }\n\n audioElement.transcriptionState = 2;\n }\n\n // scrollSaver.restore();\n });\n\n this.listenerSetter.add(rootScope)('album_edit', ({peerId, messages, deletedMids}) => {\n if(peerId !== this.peerId) return;\n\n const mids = messages.map(({mid}) => mid);\n const oldMids = mids.concat(Array.from(deletedMids));\n const wasMainMid = getMainMidForGrouped(oldMids);\n const bubble = this.bubbles[wasMainMid];\n if(!bubble) {\n return;\n }\n\n const mainMid = getMainMidForGrouped(mids);\n const message = messages.find((message) => message.mid === mainMid);\n this.safeRenderMessage(message, true, bubble);\n });\n\n // this.listenerSetter.add(rootScope)('peer_title_edit', async(peerId) => {\n // if(peerId.isUser()) {\n // const middleware = this.getMiddleware();\n // const user = await this.managers.appUsersManager.getUser(peerId.toUserId());\n // if(!middleware()) return;\n\n // const isPremium = user?.pFlags?.premium;\n // const groups = this.bubbleGroups.groups.filter((group) => group.avatar?.peerId === peerId);\n // groups.forEach((group) => {\n // group.avatar.classList.toggle('is-premium', isPremium);\n // group.avatar.classList.toggle('tgico-star', isPremium);\n // });\n // }\n // });\n\n if(!DO_NOT_UPDATE_MESSAGE_REACTIONS/* && false */) {\n this.listenerSetter.add(rootScope)('messages_reactions', async(arr) => {\n if(this.chat.type === 'scheduled') {\n return;\n }\n\n let scrollSaver: ScrollSaver;\n\n const a = arr.map(async({message, changedResults}) => {\n if(this.peerId !== message.peerId) {\n return;\n }\n\n const result = await this.getMountedBubble(message.mid, message);\n if(!result) {\n return;\n }\n\n // can be .document-container\n return {bubble: findUpClassName(result.bubble, 'bubble'), message, changedResults};\n });\n\n let top: number;\n (await Promise.all(a)).filter(Boolean).forEach(({bubble, message, changedResults}) => {\n if(!scrollSaver) {\n scrollSaver = this.createScrollSaver(false);\n scrollSaver.save();\n }\n\n const key = message.peerId + '_' + message.mid;\n const set = REACTIONS_ELEMENTS.get(key);\n if(set) {\n for(const element of set) {\n element.update(message, changedResults);\n }\n } else if(!message.reactions || !message.reactions.results.length) {\n return;\n } else {\n this.appendReactionsElementToBubble(bubble, message, message, changedResults);\n }\n });\n\n if(scrollSaver) {\n scrollSaver.restore();\n }\n });\n }\n\n !DO_NOT_UPDATE_MESSAGE_REPLY && this.listenerSetter.add(rootScope)('messages_downloaded', async({peerId, mids}) => {\n const middleware = this.getMiddleware();\n await getHeavyAnimationPromise();\n if(!middleware()) return;\n\n (mids as number[]).forEach((mid) => {\n const needUpdate = this.needUpdate;\n const filtered: typeof needUpdate[0][] = [];\n forEachReverse(this.needUpdate, (obj, idx) => {\n if(obj.replyMid === mid && obj.replyToPeerId === peerId) {\n this.needUpdate.splice(idx, 1)[0];\n filtered.push(obj);\n }\n });\n\n filtered.forEach(async({mid, replyMid, replyToPeerId}) => {\n const bubble = this.bubbles[mid];\n if(!bubble) return;\n\n const message = (await this.chat.getMessage(mid)) as Message.message;\n\n MessageRender.setReply({\n chat: this.chat,\n bubble,\n message\n });\n });\n });\n });\n\n attachStickerViewerListeners({\n listenTo: this.scrollable.container,\n listenerSetter: this.listenerSetter,\n findTarget: (e) => {\n const target = e.target as HTMLElement;\n const found = target.closest('.attachment.media-sticker-wrapper') || (findUpClassName(target, 'attachment') && target.closest('.custom-emoji'));\n return found as HTMLElement;\n }\n });\n attachClickEvent(this.scrollable.container, this.onBubblesClick, {listenerSetter: this.listenerSetter});\n // this.listenerSetter.add(this.bubblesContainer)('click', this.onBubblesClick/* , {capture: true, passive: false} */);\n\n this.listenerSetter.add(this.scrollable.container)('mousedown', (e) => {\n if(e.button !== 0) return;\n\n const code: HTMLElement = findUpTag(e.target, 'CODE');\n if(code) {\n cancelEvent(e);\n copyFromElement(code);\n\n const onClick = (e: MouseEvent) => {\n cancelEvent(e);\n toastNew({\n langPackKey: 'TextCopied',\n onClose: () => {\n detach();\n }\n });\n };\n\n const detach = attachClickEvent(window, onClick, {listenerSetter: this.listenerSetter, once: true, capture: true});\n return;\n }\n });\n\n /* if(false) */this.stickyIntersector = new StickyIntersector(this.scrollable.container, (stuck, target) => {\n for(const timestamp in this.dateMessages) {\n const dateMessage = this.dateMessages[timestamp];\n if(dateMessage.container === target) {\n const dateBubble = dateMessage.div;\n\n // dateMessage.container.classList.add('has-sticky-dates');\n\n // SetTransition(dateBubble, 'kek', stuck, this.previousStickyDate ? 300 : 0);\n // if(this.previousStickyDate) {\n // dateBubble.classList.add('kek');\n // }\n\n dateBubble.classList.toggle('is-sticky', stuck);\n if(stuck) {\n this.previousStickyDate = dateBubble;\n }\n\n break;\n }\n }\n\n if(this.previousStickyDate) {\n // fastRaf(() => {\n // this.bubblesContainer.classList.add('has-sticky-dates');\n // });\n }\n });\n\n if(!IS_SAFARI) {\n this.sliceViewportDebounced = debounce(this.sliceViewport.bind(this), 3000, false, true);\n }\n\n let middleware: ReturnType;\n useHeavyAnimationCheck(() => {\n this.isHeavyAnimationInProgress = true;\n this.lazyLoadQueue.lock();\n middleware = this.getMiddleware();\n\n // if(this.sliceViewportDebounced) {\n // this.sliceViewportDebounced.clearTimeout();\n // }\n }, () => {\n this.isHeavyAnimationInProgress = false;\n\n if(middleware?.()) {\n this.lazyLoadQueue.unlockAndRefresh();\n\n // if(this.sliceViewportDebounced) {\n // this.sliceViewportDebounced();\n // }\n }\n\n middleware = null;\n }, this.listenerSetter);\n }\n\n private constructBubbles() {\n const container = this.container = document.createElement('div');\n container.classList.add('bubbles', 'scrolled-down');\n\n const chatInner = this.chatInner = document.createElement('div');\n chatInner.classList.add('bubbles-inner');\n\n this.setScroll();\n\n container.append(this.scrollable.container);\n }\n\n public attachContainerListeners() {\n const container = this.container;\n\n this.chat.contextMenu.attachTo(container);\n this.chat.selection.attachListeners(container, new ListenerSetter());\n\n if(DEBUG) {\n this.listenerSetter.add(container)('dblclick', async(e) => {\n const bubble = findUpClassName(e.target, 'grouped-item') || findUpClassName(e.target, 'bubble');\n if(bubble) {\n const mid = +bubble.dataset.mid\n this.log('debug message:', await this.chat.getMessage(mid));\n this.highlightBubble(bubble);\n }\n });\n }\n\n if(!IS_MOBILE) {\n this.listenerSetter.add(container)('dblclick', async(e) => {\n if(this.chat.type === 'pinned' ||\n this.chat.selection.isSelecting ||\n !(await this.chat.canSend())) {\n return;\n }\n\n const target = e.target as HTMLElement;\n const bubble = target.classList.contains('bubble') ?\n target :\n (target.classList.contains('document-selection') ? target.parentElement : null);\n if(bubble && !bubble.classList.contains('bubble-first')) {\n const mid = +bubble.dataset.mid;\n const message = await this.chat.getMessage(mid);\n if(message.pFlags.is_outgoing) {\n return;\n }\n\n this.chat.input.initMessageReply(mid);\n }\n });\n } else if(IS_TOUCH_SUPPORTED) {\n const className = 'is-gesturing-reply';\n const MAX = 64;\n const replyAfter = MAX * .75;\n let shouldReply = false;\n let target: HTMLElement;\n let icon: HTMLElement;\n let swipeAvatar: HTMLElement;\n handleHorizontalSwipe({\n element: container,\n verifyTouchTarget: async(e) => {\n if(this.chat.type === 'pinned' || this.chat.selection.isSelecting || !(await this.chat.canSend())) {\n return false;\n }\n\n // cancelEvent(e);\n target = findUpClassName(e.target, 'bubble');\n if(target) {\n try {\n const avatar = target.parentElement.querySelector('.bubbles-group-avatar') as HTMLElement\n if(avatar) {\n const visibleRect = getVisibleRect(avatar, target);\n if(visibleRect) {\n swipeAvatar = avatar;\n }\n }\n } catch(err) {}\n\n [target, swipeAvatar].filter(Boolean).forEach((element) => {\n SetTransition({\n element,\n className,\n forwards: true,\n duration: 250\n });\n void element.offsetLeft; // reflow\n });\n\n if(!icon) {\n icon = document.createElement('span');\n icon.classList.add('tgico-reply_filled', 'bubble-gesture-reply-icon');\n } else {\n icon.classList.remove('is-visible');\n icon.style.opacity = '';\n }\n\n target/* .querySelector('.bubble-content') */.append(icon);\n }\n\n return !!target;\n },\n onSwipe: (xDiff) => {\n shouldReply = xDiff >= replyAfter;\n\n if(shouldReply && !icon.classList.contains('is-visible')) {\n icon.classList.add('is-visible');\n }\n icon.style.opacity = '' + Math.min(1, xDiff / replyAfter);\n\n const x = -Math.max(0, Math.min(MAX, xDiff));\n const transform = `translateX(${x}px)`;\n target.style.transform = transform;\n if(swipeAvatar) {\n swipeAvatar.style.transform = transform;\n }\n cancelContextMenuOpening();\n },\n onReset: () => {\n const _target = target;\n const _swipeAvatar = swipeAvatar;\n target = swipeAvatar = undefined;\n\n const onTransitionEnd = () => {\n if(icon.parentElement === _target) {\n icon.classList.remove('is-visible');\n icon.remove();\n }\n };\n\n [_target, _swipeAvatar].filter(Boolean).forEach((element, idx) => {\n SetTransition({\n element,\n className,\n forwards: false,\n duration: 250,\n onTransitionEnd: idx === 0 ? onTransitionEnd : undefined\n });\n });\n\n fastRaf(() => {\n _target.style.transform = '';\n if(_swipeAvatar) {\n _swipeAvatar.style.transform = '';\n }\n\n if(shouldReply) {\n const {mid} = _target.dataset;\n this.chat.input.initMessageReply(+mid);\n shouldReply = false;\n }\n });\n },\n listenerOptions: {capture: true}\n });\n }\n }\n\n public constructPeerHelpers() {\n // will call when message is sent (only 1)\n this.listenerSetter.add(rootScope)('history_append', async({storageKey, message}) => {\n if(storageKey !== this.chat.messagesStorageKey || this.chat.type === 'scheduled') return;\n\n if(liteMode.isAvailable('chat_background')) {\n this.updateGradient = true;\n }\n\n if(!this.scrollable.loadedAll.bottom) {\n this.chat.setMessageId();\n } else {\n this.renderNewMessage(message, true);\n }\n });\n\n this.listenerSetter.add(rootScope)('history_multiappend', (message) => {\n if(this.peerId !== message.peerId || this.chat.type === 'scheduled') return;\n this.renderNewMessage(message);\n });\n\n this.listenerSetter.add(rootScope)('history_delete', ({peerId, msgs}) => {\n if(peerId !== this.peerId || this.chat.type === 'scheduled') {\n return;\n }\n\n this.deleteMessagesByIds(Array.from(msgs));\n });\n\n this.listenerSetter.add(rootScope)('dialog_unread', ({peerId}) => {\n if(peerId === this.peerId) {\n this.chat.input.setUnreadCount();\n\n getHeavyAnimationPromise().then(() => {\n this.updateUnreadByDialog();\n });\n }\n });\n\n this.listenerSetter.add(rootScope)('dialogs_multiupdate', (dialogs) => {\n if(!dialogs.has(this.peerId) || this.chat.type === 'scheduled') {\n return;\n }\n\n this.chat.input.setUnreadCount();\n });\n\n this.listenerSetter.add(rootScope)('dialog_notify_settings', (dialog) => {\n if(this.peerId !== dialog.peerId || this.chat.type === 'scheduled') {\n return;\n }\n\n this.chat.input.setUnreadCount();\n });\n\n this.listenerSetter.add(rootScope)('chat_update', async(chatId) => {\n const {peerId} = this;\n if(peerId !== chatId.toPeerId(true)) {\n return;\n }\n\n const chat = await this.managers.appChatsManager.getChat(chatId);\n const hadRights = this.chatInner.classList.contains('has-rights');\n const hadPlainRights = this.chat.input.canSendPlain();\n const [hasRights, hasPlainRights, canEmbedLinks] = await Promise.all([\n this.chat.canSend('send_messages'),\n this.chat.canSend('send_plain'),\n this.chat.canSend('embed_links')\n ]);\n\n if(hadRights !== hasRights || hadPlainRights !== hasPlainRights) {\n const callbacks = await Promise.all([\n this.finishPeerChange(),\n this.chat.input.finishPeerChange()\n ]);\n\n callbacks.forEach((callback) => callback());\n }\n\n // reset webpage\n if((canEmbedLinks && !this.chat.input.willSendWebPage) || (!canEmbedLinks && this.chat.input.willSendWebPage)) {\n this.chat.input.lastUrl = '';\n this.chat.input.onMessageInput();\n }\n\n if(!!(chat as MTChat.channel).pFlags.forum !== this.chat.isForum && this.chat.type === 'chat') {\n this.chat.peerId = 0;\n this.chat.appImManager.setPeer({peerId});\n }\n });\n\n this.listenerSetter.add(rootScope)('history_reload', (peerId) => {\n if(peerId !== this.peerId) {\n return;\n }\n\n const mids = getObjectKeysAndSort(this.bubbles, 'desc').filter((mid) => mid > 0);\n const middleware = this.getMiddleware();\n this.managers.appMessagesManager.reloadMessages(this.peerId, mids).then((messages) => {\n if(!middleware()) return;\n\n const toDelete: number[] = [];\n messages.forEach((message, idx) => {\n const mid = mids[idx];\n if(message) {\n const bubble = this.bubbles[message.mid];\n if(!bubble) return;\n\n this.safeRenderMessage(message, true, bubble);\n } else {\n toDelete.push(mid);\n }\n });\n\n this.deleteMessagesByIds(toDelete);\n\n this.setLoaded('top', false);\n this.setLoaded('bottom', false);\n this.scrollable.checkForTriggers();\n });\n });\n\n this.listenerSetter.add(rootScope)('settings_updated', async({key}) => {\n if(key === 'settings.emoji.big') {\n const middleware = this.getMiddleware();\n const mids = getObjectKeysAndSort(this.bubbles, 'desc');\n const m = mids.map(async(mid) => {\n const bubble = this.bubbles[mid];\n if(bubble.classList.contains('can-have-big-emoji')) {\n return {bubble, message: await this.chat.getMessage(mid)};\n }\n });\n\n const awaited = await Promise.all(m);\n if(!middleware()) {\n return;\n }\n\n awaited.filter(Boolean).forEach(({bubble, message}) => {\n if(this.bubbles[message.mid] !== bubble) {\n return;\n }\n\n this.safeRenderMessage(message, true, bubble);\n });\n }\n });\n\n !DO_NOT_UPDATE_MESSAGE_VIEWS && this.listenerSetter.add(rootScope)('messages_views', (arr) => {\n if(this.chat.type === 'scheduled') return;\n\n fastRaf(() => {\n let scrollSaver: ScrollSaver;\n for(const {peerId, views, mid} of arr) {\n if(this.peerId !== peerId) continue;\n\n const bubble = this.bubbles[mid];\n if(!bubble) continue;\n\n const postViewsElements = Array.from(bubble.querySelectorAll('.post-views')) as HTMLElement[];\n if(!postViewsElements.length) continue;\n\n const str = formatNumber(views, 1);\n let different = false;\n postViewsElements.forEach((postViews) => {\n if(different || postViews.textContent !== str) {\n if(!scrollSaver) {\n scrollSaver = this.createScrollSaver(true);\n scrollSaver.save();\n }\n\n different = true;\n postViews.textContent = str;\n }\n });\n }\n\n scrollSaver?.restore();\n });\n });\n\n this.observer = new SuperIntersectionObserver({root: this.scrollable.container});\n\n this.sendViewCountersDebounced = debounce(() => {\n const mids = [...this.viewsMids];\n this.viewsMids.clear();\n\n this.managers.appMessagesManager.incrementMessageViews(this.peerId, mids);\n }, 1000, false, true);\n\n // * pinned part start\n this.listenerSetter.add(rootScope)('peer_pinned_messages', ({peerId, mids, pinned}) => {\n if(this.chat.type !== 'pinned' || peerId !== this.peerId) {\n return;\n }\n\n if(mids) {\n if(!pinned) {\n this.deleteMessagesByIds(mids);\n }\n }\n });\n // * pinned part end\n\n // * scheduled part start\n const onUpdate = async() => {\n this.chat.topbar.setTitle((await this.managers.appMessagesManager.getScheduledMessagesStorage(this.peerId)).size);\n };\n\n this.listenerSetter.add(rootScope)('scheduled_new', (message) => {\n if(this.chat.type !== 'scheduled' || message.peerId !== this.peerId) return;\n\n this.renderNewMessage(message);\n onUpdate();\n });\n\n this.listenerSetter.add(rootScope)('scheduled_delete', ({peerId, mids}) => {\n if(this.chat.type !== 'scheduled' || peerId !== this.peerId) return;\n\n this.deleteMessagesByIds(mids);\n onUpdate();\n });\n // * scheduled part end\n }\n\n private get peerId() {\n return this.chat.peerId;\n }\n\n public get messagesQueuePromise() {\n return this.batchProcessor.queuePromise;\n }\n\n private createScrollSaver(reverse = true) {\n const scrollSaver = new ScrollSaver(this.scrollable, '.bubble:not(.is-date)', reverse);\n return scrollSaver;\n }\n\n private unreadedObserverCallback = (entry: IntersectionObserverEntry) => {\n if(entry.isIntersecting) {\n const target = entry.target as HTMLElement;\n const mid = this.unreaded.get(target as HTMLElement);\n this.onUnreadedInViewport(target, mid);\n }\n };\n\n private viewsObserverCallback = (entry: IntersectionObserverEntry) => {\n if(entry.isIntersecting) {\n const mid = +(entry.target as HTMLElement).dataset.mid;\n this.observer.unobserve(entry.target, this.viewsObserverCallback);\n\n if(mid) {\n this.viewsMids.add(mid);\n this.sendViewCountersDebounced();\n } else {\n const {sponsoredMessage} = this;\n const randomId = sponsoredMessage?.random_id;\n if(randomId) {\n this.managers.appChatsManager.viewSponsoredMessage(this.peerId.toChatId(), randomId);\n delete sponsoredMessage.random_id;\n }\n }\n }\n };\n\n private stickerEffectObserverCallback = (entry: IntersectionObserverEntry) => {\n if(entry.isIntersecting) {\n this.observer.unobserve(entry.target, this.stickerEffectObserverCallback);\n\n const attachmentDiv: HTMLElement = entry.target.querySelector('.attachment');\n getHeavyAnimationPromise().then(() => {\n if(isInDOM(attachmentDiv)) {\n simulateClickEvent(attachmentDiv);\n }\n });\n }\n };\n\n private createResizeObserver() {\n if(!('ResizeObserver' in window) || this.resizeObserver) {\n return;\n }\n\n const container = this.scrollable.container;\n let wasHeight = 0/* container.offsetHeight */;\n let resizing = false;\n let skip = false;\n let scrolled = 0;\n let part = 0;\n let rAF = 0;\n // let skipNext = true;\n\n const onResizeEnd = () => {\n const height = container.offsetHeight;\n const isScrolledDown = this.scrollable.isScrolledDown;\n if(height !== wasHeight && (!skip || !isScrolledDown)) { // * fix opening keyboard while ESG is active, offsetHeight will change right between 'start' and this first frame\n part += wasHeight - height;\n }\n\n /* if(DEBUG) {\n this.log('resize end', scrolled, part, this.scrollable.scrollTop, height, wasHeight, this.scrollable.isScrolledDown);\n } */\n\n if(part) {\n this.scrollable.setScrollTopSilently(this.scrollable.scrollTop + Math.round(part));\n }\n\n wasHeight = height;\n scrolled = 0;\n rAF = 0;\n part = 0;\n resizing = false;\n skip = false;\n };\n\n const setEndRAF = (single: boolean) => {\n if(rAF) window.cancelAnimationFrame(rAF);\n rAF = window.requestAnimationFrame(single ? onResizeEnd : () => {\n rAF = window.requestAnimationFrame(onResizeEnd);\n // this.log('resize after RAF', part);\n });\n };\n\n const processEntries: ResizeObserverCallback = (entries) => {\n /* if(skipNext) {\n skipNext = false;\n return;\n } */\n\n if(skip) {\n setEndRAF(false);\n return;\n }\n\n const entry = entries[0];\n const height = entry.contentRect.height;/* Math.ceil(entry.contentRect.height); */\n\n if(!wasHeight) {\n wasHeight = height;\n return;\n }\n\n const realDiff = wasHeight - height;\n let diff = realDiff + part;\n const _part = diff % 1;\n diff -= _part;\n\n if(!resizing) {\n resizing = true;\n\n /* if(DEBUG) {\n this.log('resize start', realDiff, this.scrollable.scrollTop, this.scrollable.container.offsetHeight, this.scrollable.isScrolledDown);\n } */\n\n if(realDiff < 0 && this.scrollable.isScrolledDown) {\n // if(isSafari) { // * fix opening keyboard while ESG is active\n part = -realDiff;\n // }\n\n skip = true;\n setEndRAF(false);\n return;\n }\n }\n\n scrolled += diff;\n\n /* if(DEBUG) {\n this.log('resize', wasHeight - height, diff, this.scrollable.container.offsetHeight, this.scrollable.isScrolledDown, height, wasHeight);\n } */\n\n if(diff) {\n const needScrollTop = this.scrollable.scrollTop + diff;\n this.scrollable.setScrollTopSilently(needScrollTop);\n }\n\n setEndRAF(false);\n\n part = _part;\n wasHeight = height;\n };\n\n const resizeObserver = this.resizeObserver = new ResizeObserver(processEntries);\n resizeObserver.observe(container);\n }\n\n private destroyResizeObserver() {\n const resizeObserver = this.resizeObserver;\n if(!resizeObserver) {\n return;\n }\n\n resizeObserver.disconnect();\n this.resizeObserver = undefined;\n }\n\n private onBubblesMouseMove = async(e: MouseEvent) => {\n const content = findUpClassName(e.target, 'bubble-content');\n if(\n this.chat.type !== 'scheduled' &&\n content &&\n !this.chat.selection.isSelecting &&\n !findUpClassName(e.target, 'service') &&\n !findUpClassName(e.target, 'bubble-beside-button')\n ) {\n const bubble = findUpClassName(content, 'bubble');\n if(!this.chat.selection.canSelectBubble(bubble)) {\n this.unhoverPrevious();\n return;\n }\n\n let {hoverBubble, hoverReaction} = this;\n if(bubble === hoverBubble) {\n return;\n }\n\n this.unhoverPrevious();\n\n hoverBubble = this.hoverBubble = bubble;\n hoverReaction = this.hoverReaction;\n // hoverReaction = contentWrapper.querySelector('.bubble-hover-reaction');\n if(!hoverReaction) {\n hoverReaction = this.hoverReaction = document.createElement('div');\n hoverReaction.classList.add('bubble-hover-reaction');\n\n const stickerWrapper = document.createElement('div');\n stickerWrapper.classList.add('bubble-hover-reaction-sticker');\n hoverReaction.append(stickerWrapper);\n\n content.append(hoverReaction);\n\n let message = await this.chat.getMessage(+bubble.dataset.mid);\n if(message?._ !== 'message') {\n this.unhoverPrevious();\n return;\n }\n\n message = await this.managers.appMessagesManager.getGroupsFirstMessage(message);\n\n const middleware = this.getMiddleware(() => this.hoverReaction === hoverReaction);\n Promise.all([\n this.managers.appReactionsManager.getAvailableReactionsByMessage(message),\n pause(400)\n ]).then(([availableReactions]) => {\n const availableReaction = availableReactions[0];\n if(!availableReaction) {\n hoverReaction.remove();\n return;\n }\n\n wrapSticker({\n div: stickerWrapper,\n doc: availableReaction.select_animation,\n width: 18,\n height: 18,\n needUpscale: true,\n middleware,\n group: this.chat.animationGroup,\n withThumb: false,\n needFadeIn: false\n }).then(({render}) => render).then((player) => {\n assumeType(player);\n\n player.addEventListener('firstFrame', () => {\n if(!middleware()) {\n // debugger;\n return;\n }\n\n hoverReaction.dataset.loaded = '1';\n this.setHoverVisible(hoverReaction, true);\n }, {once: true});\n\n attachClickEvent(hoverReaction, (e) => {\n cancelEvent(e); // cancel triggering selection\n\n this.managers.appReactionsManager.sendReaction(message as Message.message, availableReaction);\n this.unhoverPrevious();\n }, {listenerSetter: this.listenerSetter});\n }, noop);\n });\n } else if(hoverReaction.dataset.loaded) {\n this.setHoverVisible(hoverReaction, true);\n }\n } else {\n this.unhoverPrevious();\n }\n };\n\n public setReactionsHoverListeners() {\n this.listenerSetter.add(contextMenuController)('toggle', this.unhoverPrevious);\n this.listenerSetter.add(overlayCounter)('change', this.unhoverPrevious);\n this.listenerSetter.add(this.chat.selection)('toggle', this.unhoverPrevious);\n this.listenerSetter.add(this.container)('mousemove', this.onBubblesMouseMove);\n }\n\n private setHoverVisible(hoverReaction: HTMLElement, visible: boolean) {\n if(hoverReaction.parentElement) {\n hoverReaction.parentElement.classList.toggle('hover-reaction-visible', visible);\n }\n\n SetTransition({\n element: hoverReaction,\n className: 'is-visible',\n forwards: visible,\n duration: 200,\n onTransitionEnd: visible ? undefined : () => {\n hoverReaction.remove();\n },\n useRafs: 2\n });\n }\n\n private unhoverPrevious = () => {\n const {hoverBubble, hoverReaction} = this;\n if(hoverBubble) {\n this.setHoverVisible(hoverReaction, false);\n this.hoverBubble = undefined;\n this.hoverReaction = undefined;\n }\n };\n\n public setStickyDateManually() {\n return;\n\n const timestamps = Object.keys(this.dateMessages).map((k) => +k).sort((a, b) => b - a);\n let lastVisible: HTMLElement;\n\n // if(this.chatInner.classList.contains('is-scrolling')) {\n const {scrollTop} = this.scrollable.container;\n const isOverflown = scrollTop > 0;\n if(isOverflown) {\n for(const timestamp of timestamps) {\n const dateMessage = this.dateMessages[timestamp];\n const visibleRect = getVisibleRect(dateMessage.container, this.scrollable.container);\n if(visibleRect && visibleRect.overflow.top) {\n lastVisible = dateMessage.div;\n } else if(lastVisible) {\n break;\n }\n }\n }\n // }\n\n if(lastVisible === this.previousStickyDate) {\n return;\n }\n\n if(lastVisible) {\n const needReflow = /* !!this.chat.setPeerPromise || */!this.previousStickyDate;\n if(needReflow) {\n lastVisible.classList.add('no-transition');\n }\n\n lastVisible.classList.add('is-sticky');\n\n if(needReflow) {\n void lastVisible.offsetLeft; // reflow\n lastVisible.classList.remove('no-transition');\n }\n }\n\n if(this.previousStickyDate && this.previousStickyDate !== lastVisible) {\n this.previousStickyDate.classList.remove('is-sticky');\n }\n\n this.previousStickyDate = lastVisible;\n }\n\n public getRenderedLength() {\n return Object.keys(this.bubbles).length - this.skippedMids.size;\n }\n\n private onUnreadedInViewport(target: HTMLElement, mid: number) {\n this.unreadedSeen.add(mid);\n this.observer.unobserve(target, this.unreadedObserverCallback);\n this.unreaded.delete(target);\n this.readUnreaded();\n }\n\n private readUnreaded() {\n if(this.readPromise) return;\n\n const middleware = this.getMiddleware();\n this.readPromise = idleController.getFocusPromise().then(async() => {\n if(!middleware()) return;\n let maxId = Math.max(...Array.from(this.unreadedSeen));\n\n // ? if message with maxId is not rendered ?\n if(this.scrollable.loadedAll.bottom) {\n const bubblesMaxId = Math.max(...Object.keys(this.bubbles).map((i) => +i));\n if(maxId >= bubblesMaxId) {\n maxId = Math.max((await this.chat.getHistoryMaxId()) || 0, maxId);\n }\n }\n\n this.unreaded.forEach((mid, target) => {\n if(mid <= maxId) {\n this.onUnreadedInViewport(target, mid);\n }\n });\n\n const readContents: number[] = [];\n for(const mid of this.unreadedSeen) {\n const message: MyMessage = await this.chat.getMessage(mid);\n if(isMentionUnread(message)) {\n readContents.push(mid);\n }\n }\n\n this.managers.appMessagesManager.readMessages(this.peerId, readContents);\n\n this.unreadedSeen.clear();\n\n if(DEBUG) {\n this.log('will readHistory by maxId:', maxId);\n }\n\n // return;\n\n return this.managers.appMessagesManager.readHistory(this.peerId, maxId, this.chat.threadId).catch((err: any) => {\n this.log.error('readHistory err:', err);\n this.managers.appMessagesManager.readHistory(this.peerId, maxId, this.chat.threadId);\n }).finally(() => {\n if(!middleware()) return;\n this.readPromise = undefined;\n\n if(this.unreadedSeen.size) {\n this.readUnreaded();\n }\n });\n });\n }\n\n public onBubblesClick = async(e: Event) => {\n let target = e.target as HTMLElement;\n let bubble: HTMLElement = null;\n try {\n bubble = findUpClassName(target, 'bubble');\n } catch(err) {}\n\n if(!bubble && !this.chat.selection.isSelecting) {\n const avatar = findUpClassName(target, 'user-avatar');\n if(!avatar) {\n return;\n }\n\n const peerId = avatar.dataset.peerId.toPeerId();\n if(peerId !== NULL_PEER_ID) {\n this.chat.appImManager.setInnerPeer({peerId});\n } else {\n toast(I18n.format('HidAccount', true));\n }\n return;\n }\n\n if(bubble.classList.contains('is-date') && findUpClassName(target, 'bubble-content')) {\n if(bubble.classList.contains('is-fake')) {\n bubble = bubble.previousElementSibling as HTMLElement;\n }\n\n if(bubble.classList.contains('is-sticky') && !this.chatInner.classList.contains('is-scrolling')) {\n return;\n }\n\n for(const timestamp in this.dateMessages) {\n const d = this.dateMessages[timestamp];\n if(d.div === bubble) {\n PopupElement.createPopup(PopupDatePicker, new Date(+timestamp), this.onDatePick).show();\n break;\n }\n }\n\n return;\n }\n\n if(!IS_TOUCH_SUPPORTED && findUpClassName(target, 'time')) {\n this.chat.selection.toggleByElement(bubble);\n return;\n }\n\n // ! Trusted - due to audio autoclick\n if(this.chat.selection.isSelecting && e.isTrusted) {\n if(bubble.classList.contains('service') && bubble.dataset.mid === undefined) {\n return;\n }\n\n cancelEvent(e);\n // console.log('bubble click', e);\n\n if(IS_TOUCH_SUPPORTED && this.chat.selection.selectedText) {\n this.chat.selection.selectedText = undefined;\n return;\n }\n\n // this.chatSelection.toggleByBubble(bubble);\n this.chat.selection.toggleByElement(findUpClassName(target, 'grouped-item') || bubble);\n return;\n }\n\n const mediaSpoiler: HTMLElement = findUpClassName(target, 'media-spoiler-container');\n if(mediaSpoiler) {\n onMediaSpoilerClick({\n event: e,\n mediaSpoiler\n });\n return;\n }\n\n const contactDiv: HTMLElement = findUpClassName(target, 'contact');\n if(contactDiv) {\n const peerId = contactDiv.dataset.peerId.toPeerId();\n if(peerId) {\n this.chat.appImManager.setInnerPeer({\n peerId\n });\n } else {\n const phone = contactDiv.querySelector('.contact-number');\n copyTextToClipboard(phone.innerText.replace(/\\s/g, ''));\n toastNew({langPackKey: 'PhoneCopied'});\n cancelEvent(e);\n }\n\n return;\n }\n\n const callDiv: HTMLElement = findUpClassName(target, 'bubble-call');\n if(callDiv) {\n this.chat.appImManager.callUser(this.peerId.toUserId(), callDiv.dataset.type as any);\n return;\n }\n\n const buyButton: HTMLElement = findUpClassName(target, 'is-buy');\n if(buyButton) {\n cancelEvent(e);\n\n const message = await this.chat.getMessage(+bubble.dataset.mid);\n if(!message) {\n return;\n }\n\n new PopupPayment(\n message as Message.message,\n await this.managers.appPaymentsManager.getInputInvoiceByPeerId(message.peerId, message.mid)\n );\n return;\n }\n\n const reactionElement = findUpTag(target, 'REACTION-ELEMENT') as ReactionElement;\n if(reactionElement) {\n cancelEvent(e);\n if(reactionElement.classList.contains('is-inactive')) {\n return;\n }\n\n const reactionsElement = reactionElement.parentElement as ReactionsElement;\n const reactionCount = reactionsElement.getReactionCount(reactionElement);\n\n const message = reactionsElement.getMessage();\n this.managers.appReactionsManager.sendReaction(message, reactionCount.reaction);\n\n return;\n }\n\n const stickerEmojiEl = findUpAttribute(target, 'data-sticker-emoji');\n if(stickerEmojiEl && stickerEmojiEl.parentElement.querySelectorAll('[data-sticker-emoji]').length === 1 && bubble.classList.contains('emoji-big')) {\n onEmojiStickerClick({\n event: e,\n container: stickerEmojiEl,\n managers: this.managers,\n middleware: this.getMiddleware(),\n peerId: this.peerId\n });\n\n return;\n }\n\n const commentsDiv: HTMLElement = findUpClassName(target, 'replies');\n if(commentsDiv) {\n const bubbleMid = +bubble.dataset.mid;\n if(this.peerId === REPLIES_PEER_ID) {\n const message = await this.chat.getMessage(bubbleMid) as Message.message;\n const peerId = getPeerId(message.reply_to.reply_to_peer_id);\n const threadId = message.reply_to.reply_to_top_id;\n const lastMsgId = message.fwd_from.saved_from_msg_id;\n this.chat.appImManager.openThread({\n peerId,\n lastMsgId,\n threadId\n });\n } else {\n const message1 = await this.chat.getMessage(bubbleMid);\n const message = await this.managers.appMessagesManager.getMessageWithReplies(message1 as Message.message);\n const replies = message.replies;\n if(replies) {\n this.managers.appMessagesManager.getDiscussionMessage(this.peerId, message.mid).then((message) => {\n this.chat.appImManager.setInnerPeer({\n peerId: replies.channel_id.toPeerId(true),\n type: 'discussion',\n threadId: (message as MyMessage).mid\n });\n });\n }\n }\n\n return;\n }\n\n const via = findUpClassName(target, 'is-via');\n if(via) {\n const el = via.querySelector('.peer-title') as HTMLElement;\n if(target === el || findUpAsChild(target, el)) {\n const message = el.innerText + ' ';\n this.managers.appDraftsManager.setDraft(this.peerId, this.chat.threadId, message);\n cancelEvent(e);\n\n return;\n }\n }\n\n const nameDiv = findUpClassName(target, 'peer-title') || findUpTag(target, 'AVATAR-ELEMENT') || findUpAttribute(target, 'data-saved-from');\n if(nameDiv && nameDiv !== bubble) {\n target = nameDiv || target;\n const peerIdStr = target.dataset.peerId || target.getAttribute('peer') || (target as AvatarElement).peerId;\n const savedFrom = target.dataset.savedFrom;\n if(typeof(peerIdStr) === 'string' || savedFrom) {\n if(savedFrom) {\n const [peerId, mid] = savedFrom.split('_');\n if(target.classList.contains('is-receipt-link')) {\n const message = await this.managers.appMessagesManager.getMessageByPeer(peerId.toPeerId(), +mid);\n if(message) {\n const inputInvoice = await this.managers.appPaymentsManager.getInputInvoiceByPeerId(this.peerId, +bubble.dataset.mid);\n new PopupPayment(message as Message.message, inputInvoice, undefined, true);\n }\n } else {\n this.chat.appImManager.setInnerPeer({\n peerId: peerId.toPeerId(),\n lastMsgId: +mid\n });\n }\n } else {\n const peerId = peerIdStr.toPeerId();\n if(peerId !== NULL_PEER_ID) {\n this.chat.appImManager.setInnerPeer({peerId});\n } else {\n toast(I18n.format('HidAccount', true));\n }\n }\n }\n\n return;\n }\n\n // this.log('chatInner click:', target);\n // const isVideoComponentElement = target.tagName === 'SPAN' && findUpClassName(target, 'media-container');\n /* if(isVideoComponentElement) {\n const video = target.parentElement.querySelector('video') as HTMLElement;\n if(video) {\n video.click(); // hot-fix for time and play button\n return;\n }\n } */\n\n if(bubble.classList.contains('sticker') && target.parentElement.classList.contains('attachment')) {\n const messageId = +bubble.dataset.mid;\n const message = await this.chat.getMessage(messageId);\n\n const doc = ((message as Message.message).media as MessageMedia.messageMediaDocument)?.document as Document.document;\n\n if(doc?.stickerSetInput) {\n new PopupStickers(doc.stickerSetInput).show();\n }\n\n return;\n }\n\n if(await this.checkTargetForMediaViewer(target, e)) {\n return;\n }\n\n if(['IMG', 'DIV', 'SPAN'/* , 'A' */].indexOf(target.tagName) === -1) target = findUpTag(target, 'DIV');\n\n if(['DIV', 'SPAN'].indexOf(target.tagName) !== -1/* || target.tagName === 'A' */) {\n if(target.classList.contains('goto-original')) {\n const savedFrom = bubble.dataset.savedFrom;\n const [peerId, mid] = savedFrom.split('_');\n // //this.log('savedFrom', peerId, msgID);\n this.chat.appImManager.setInnerPeer({\n peerId: peerId.toPeerId(),\n lastMsgId: +mid\n });\n return;\n } else if(target.classList.contains('forward')) {\n const mid = +bubble.dataset.mid;\n const message = await this.managers.appMessagesManager.getMessageByPeer(this.peerId, mid);\n new PopupForward({\n [this.peerId]: await this.managers.appMessagesManager.getMidsByMessage(message)\n });\n // appSidebarRight.forwardTab.open([mid]);\n return;\n }\n\n let isReplyClick = false;\n\n try {\n isReplyClick = !!findUpClassName(e.target, 'reply');\n } catch(err) {}\n\n if(isReplyClick && bubble.classList.contains('is-reply')/* || bubble.classList.contains('forwarded') */) {\n const bubbleMid = +bubble.dataset.mid;\n this.followStack.push(bubbleMid);\n\n const message = (await this.chat.getMessage(bubbleMid)) as Message.message;\n\n const replyToPeerId = message.reply_to.reply_to_peer_id ? getPeerId(message.reply_to.reply_to_peer_id) : this.peerId;\n const replyToMid = message.reply_to.reply_to_msg_id;\n\n this.chat.appImManager.setInnerPeer({\n peerId: replyToPeerId,\n lastMsgId: replyToMid,\n type: this.chat.type,\n threadId: this.chat.threadId\n });\n\n /* if(this.chat.type === 'discussion') {\n this.chat.appImManager.setMessageId(, originalMessageId);\n } else {\n this.chat.appImManager.setInnerPeer(this.peerId, originalMessageId);\n } */\n // this.chat.setMessageId(, originalMessageId);\n }\n }\n\n // console.log('chatInner click', e);\n };\n\n public async checkTargetForMediaViewer(target: HTMLElement, e?: Event, mediaTimestamp?: number) {\n const bubble = findUpClassName(target, 'bubble');\n const documentDiv = findUpClassName(target, 'document-with-thumb');\n if((target.tagName === 'IMG' && !target.classList.contains('emoji') && !target.classList.contains('document-thumb')) ||\n target.classList.contains('album-item') ||\n // || isVideoComponentElement\n (target.tagName === 'VIDEO' && !bubble.classList.contains('round')) ||\n (documentDiv && !documentDiv.querySelector('.preloader-container')) ||\n target.classList.contains('canvas-thumbnail')) {\n const groupedItem = findUpClassName(target, 'album-item') || findUpClassName(target, 'document-container');\n const preloader = (groupedItem || bubble).querySelector('.preloader-container');\n if(preloader && e) {\n simulateClickEvent(preloader);\n cancelEvent(e);\n return;\n }\n\n cancelEvent(e);\n const messageId = +(groupedItem || bubble).dataset.mid;\n const message = await this.chat.getMessage(messageId);\n if(!message) {\n this.log.warn('no message by messageId:', messageId);\n return;\n }\n\n const SINGLE_MEDIA_CLASSNAME = 'webpage';\n const isSingleMedia = bubble.classList.contains(SINGLE_MEDIA_CLASSNAME);\n\n const f = documentDiv ? (media: any) => {\n return AppMediaViewer.isMediaCompatibleForDocumentViewer(media);\n } : (media: any) => {\n return media._ === 'photo' || ['video', 'gif'].includes(media.type);\n };\n\n const targets: {element: HTMLElement, mid: number, peerId: PeerId}[] = [];\n const ids = isSingleMedia ? [messageId] : (await Promise.all(Object.keys(this.bubbles).map((k) => +k).map(async(mid) => {\n /* if(isSingleMedia && !this.bubbles[id].classList.contains(SINGLE_MEDIA_CLASSNAME)) {\n return false;\n } */\n // if(!this.scrollable.visibleElements.find((e) => e.element === this.bubbles[id])) return false;\n\n const message = await this.chat.getMessage(mid);\n const media = getMediaFromMessage(message);\n\n return media && f(media) && mid;\n }))).filter(Boolean).sort((a, b) => a - b);\n\n ids.forEach((id) => {\n let selector: string;\n if(documentDiv) {\n selector = '.document-container';\n } else {\n const withTail = this.bubbles[id].classList.contains('with-media-tail');\n selector = '.album-item video, .album-item img, .preview video, .preview img, ';\n if(withTail) {\n selector += '.bubble__media-container';\n } else {\n selector += '.attachment video, .attachment img';\n }\n }\n\n const elements = Array.from(this.bubbles[id].querySelectorAll(selector)) as HTMLElement[];\n const parents: Set = new Set();\n if(documentDiv) {\n elements.forEach((element) => {\n targets.push({\n element: element.querySelector('.document-ico'),\n mid: +element.dataset.mid,\n peerId: this.peerId\n });\n });\n } else {\n const hasAspecter = !!this.bubbles[id].querySelector('.media-container-aspecter');\n elements.forEach((element) => {\n if(hasAspecter && !findUpClassName(element, 'media-container-aspecter')) return;\n const albumItem = findUpClassName(element, 'album-item');\n const parent = albumItem || element.parentElement;\n if(parents.has(parent)) return;\n parents.add(parent);\n targets.push({\n element,\n mid: albumItem ? +albumItem.dataset.mid : id,\n peerId: this.peerId\n });\n });\n }\n });\n\n targets.sort((a, b) => a.mid - b.mid);\n\n const idx = targets.findIndex((t) => t.mid === messageId);\n\n if(DEBUG) {\n this.log('open mediaViewer single with ids:', ids, idx, targets);\n }\n\n if(!targets[idx]) {\n this.log('no target for media viewer!', target);\n return;\n }\n\n new AppMediaViewer()\n .setSearchContext({\n threadId: this.chat.threadId,\n peerId: this.peerId,\n inputFilter: {_: documentDiv ? 'inputMessagesFilterDocument' : 'inputMessagesFilterPhotoVideo'},\n useSearch: this.chat.type !== 'scheduled' && !isSingleMedia,\n isScheduled: this.chat.type === 'scheduled'\n })\n .openMedia({\n message: message,\n target: targets[idx].element,\n fromRight: 0,\n reverse: true,\n prevTargets: targets.slice(0, idx),\n nextTargets: targets.slice(idx + 1),\n mediaTimestamp\n });\n return true;\n }\n }\n\n public async onGoDownClick() {\n if(!this.followStack.length) {\n // this.onScroll(true, undefined, true);\n this.chat.setMessageId(/* , dialog.top_message */);\n // const dialog = this.appMessagesManager.getDialogByPeerId(this.peerId)[0];\n\n // if(dialog) {\n // this.chat.setPeer(this.peerId/* , dialog.top_message */);\n // } else {\n // this.log('will scroll down 3');\n // this.scroll.scrollTop = this.scroll.scrollHeight;\n // }\n\n return;\n }\n\n const middleware = this.getMiddleware();\n const slice = this.followStack.slice();\n const messages = await Promise.all(slice.map((mid) => this.chat.getMessage(mid)));\n if(!middleware()) return;\n\n slice.forEach((mid, idx) => {\n const message = messages[idx];\n\n const bubble = this.bubbles[mid];\n let bad = true;\n if(bubble) {\n const rect = bubble.getBoundingClientRect();\n bad = (windowSize.height / 2) > rect.top;\n } else if(message) {\n bad = false;\n }\n\n if(bad) {\n this.followStack.splice(this.followStack.indexOf(mid), 1);\n }\n });\n\n this.followStack.sort((a, b) => b - a);\n\n const mid = this.followStack.pop();\n this.chat.setMessageId(mid);\n }\n\n public getBubbleByPoint(verticalSide: 'top' | 'bottom') {\n const slice = this.getViewportSlice();\n const item = slice.visible[verticalSide === 'top' ? 0 : slice.visible.length - 1];\n return item?.element;\n }\n\n public async getGroupedBubble(groupId: string) {\n const mids = await this.managers.appMessagesManager.getMidsByAlbum(groupId);\n for(const mid of mids) {\n if(this.bubbles[mid] && !this.skippedMids.has(mid)) {\n // const maxId = Math.max(...mids); // * because in scheduled album can be rendered by lowest mid during sending\n return {\n bubble: this.bubbles[mid],\n mid: mid\n // message: await this.chat.getMessage(maxId) as Message.message\n };\n }\n }\n }\n\n public getBubbleGroupedItems(bubble: HTMLElement) {\n return Array.from(bubble.querySelectorAll('.grouped-item')) as HTMLElement[];\n }\n\n public async getMountedBubble(mid: number, message?: Message.message | Message.messageService) {\n if(message === undefined) {\n message = await this.chat.getMessage(mid);\n }\n\n if(!message) {\n return;\n }\n\n const groupedId = (message as Message.message).grouped_id;\n if(groupedId) {\n const a = await this.getGroupedBubble(groupedId);\n if(a) {\n a.bubble = a.bubble.querySelector(`.document-container[data-mid=\"${mid}\"]`) || a.bubble;\n return a;\n }\n }\n\n const bubble = this.bubbles[mid];\n if(!bubble || this.skippedMids.has(mid)) return;\n\n return {bubble, mid};\n }\n\n private findNextMountedBubbleByMsgId(mid: number, prev?: boolean) {\n const mids = getObjectKeysAndSort(this.bubbles, prev ? 'desc' : 'asc');\n\n let filterCallback: (_mid: number) => boolean;\n if(prev) filterCallback = (_mid) => _mid < mid;\n else filterCallback = (_mid) => mid < _mid;\n\n const foundMid = mids.find((_mid) => {\n if(!filterCallback(_mid)) return false;\n return !!this.bubbles[_mid]?.parentElement;\n });\n\n return this.bubbles[foundMid];\n }\n\n public loadMoreHistory(top: boolean, justLoad = false) {\n // this.log('loadMoreHistory', top);\n if(\n !this.peerId ||\n /* TEST_SCROLL || */\n this.chat.setPeerPromise ||\n this.isHeavyAnimationInProgress ||\n (top && (this.getHistoryTopPromise || this.scrollable.loadedAll.top)) ||\n (!top && (this.getHistoryBottomPromise || this.scrollable.loadedAll.bottom))\n ) {\n return;\n }\n\n // warning, если иды только отрицательные то вниз не попадёт (хотя мб и так не попадёт)\n // some messages can have negative id (such as sponsored message)\n const history = Object.keys(this.bubbles)\n .map((id) => +id)\n .filter((id) => id > 0 && !this.skippedMids.has(id))\n .sort((a, b) => a - b);\n\n if(!history.length) {\n history.push(0);\n }\n\n if(top) {\n if(DEBUG) {\n this.log('Will load more (up) history by id:', history[0], 'maxId:', history[history.length - 1], justLoad/* , history */);\n }\n\n this.getHistory1(history[0], true, undefined, undefined, justLoad);\n } else {\n // let dialog = this.appMessagesManager.getDialogByPeerId(this.peerId)[0];\n // const historyMaxId = await this.chat.getHistoryMaxId();\n\n // // if scroll down after search\n // if(history.indexOf(historyMaxId) !== -1) {\n // this.setLoaded('bottom', true);\n // return;\n // }\n\n if(DEBUG) {\n this.log('Will load more (down) history by id:', history[history.length - 1], justLoad/* , history */);\n }\n\n this.getHistory1(history[history.length - 1], false, true, undefined, justLoad);\n }\n }\n\n public onScroll = (ignoreHeavyAnimation?: boolean, scrollDimensions?: ScrollStartCallbackDimensions, forceDown?: boolean) => {\n // return;\n\n if(this.isHeavyAnimationInProgress) {\n this.sliceViewportDebounced?.clearTimeout();\n\n // * В таком случае, кнопка не будет моргать если чат в самом низу, и правильно отработает случай написания нового сообщения и проскролла вниз\n if(this.scrolledDown && !ignoreHeavyAnimation) {\n return;\n }\n } else {\n this.chat.topbar.pinnedMessage?.setCorrectIndexThrottled(this.scrollable.lastScrollDirection);\n this.sliceViewportDebounced?.();\n this.setStickyDateManually();\n }\n\n // lottieLoader.checkAnimations(false, 'chat');\n\n if(scrollDimensions && scrollDimensions.distanceToEnd < SCROLLED_DOWN_THRESHOLD && this.scrolledDown) {\n return;\n }\n\n const distanceToEnd = forceDown ? 0 : scrollDimensions?.distanceToEnd ?? this.scrollable.getDistanceToEnd();\n if(/* !IS_TOUCH_SUPPORTED && */(this.scrollable.lastScrollDirection !== 0 && distanceToEnd > 0) || scrollDimensions || forceDown) {\n // if(/* !IS_TOUCH_SUPPORTED && */(this.scrollable.lastScrollDirection !== 0 || scrollDimensions) && distanceToEnd > 0) {\n if(this.isScrollingTimeout) {\n clearTimeout(this.isScrollingTimeout);\n } else if(!this.chatInner.classList.contains('is-scrolling')) {\n this.chatInner.classList.add('is-scrolling');\n }\n\n this.isScrollingTimeout = window.setTimeout(() => {\n this.chatInner.classList.remove('is-scrolling');\n this.isScrollingTimeout = 0;\n }, 1350 + (scrollDimensions?.duration ?? 0));\n }\n\n if(distanceToEnd < SCROLLED_DOWN_THRESHOLD && (forceDown || this.scrollable.loadedAll.bottom || this.chat.setPeerPromise || !this.peerId)) {\n this.container.classList.add('scrolled-down');\n this.scrolledDown = true;\n } else if(this.container.classList.contains('scrolled-down')) {\n this.container.classList.remove('scrolled-down');\n this.scrolledDown = false;\n }\n };\n\n public setScroll() {\n if(this.scrollable) {\n this.destroyScrollable();\n }\n\n this.scrollable = new Scrollable(null, 'IM', /* 10300 */300);\n this.setLoaded('top', false, false);\n this.setLoaded('bottom', false, false);\n\n this.scrollable.container.append(this.chatInner);\n\n /* const getScrollOffset = () => {\n //return Math.round(Math.max(300, appPhotosManager.windowH / 1.5));\n return 300;\n };\n\n window.addEventListener('resize', () => {\n this.scrollable.onScrollOffset = getScrollOffset();\n });\n\n this.scrollable = new Scrollable(this.bubblesContainer, 'y', 'IM', this.chatInner, getScrollOffset()); */\n\n this.scrollable.onAdditionalScroll = this.onScroll;\n this.scrollable.onScrolledTop = () => this.loadMoreHistory(true);\n this.scrollable.onScrolledBottom = () => this.loadMoreHistory(false);\n // this.scrollable.attachSentinels(undefined, 300);\n\n if(IS_TOUCH_SUPPORTED && false) {\n this.scrollable.container.addEventListener('touchmove', () => {\n if(this.isScrollingTimeout) {\n clearTimeout(this.isScrollingTimeout);\n } else if(!this.chatInner.classList.contains('is-scrolling')) {\n this.chatInner.classList.add('is-scrolling');\n }\n }, {passive: true});\n\n this.scrollable.container.addEventListener('touchend', () => {\n if(!this.chatInner.classList.contains('is-scrolling')) {\n return;\n }\n\n if(this.isScrollingTimeout) {\n clearTimeout(this.isScrollingTimeout);\n }\n\n this.isScrollingTimeout = window.setTimeout(() => {\n this.chatInner.classList.remove('is-scrolling');\n this.isScrollingTimeout = 0;\n }, 1350);\n }, {passive: true});\n }\n }\n\n public async updateUnreadByDialog() {\n const historyStorage = await this.chat.getHistoryStorage();\n const maxId = this.peerId === rootScope.myId ? historyStorage.readMaxId : historyStorage.readOutboxMaxId;\n\n // /////this.log('updateUnreadByDialog', maxId, dialog, this.unreadOut);\n\n for(const msgId of this.unreadOut) {\n if(msgId > 0 && msgId <= maxId) {\n const bubble = this.bubbles[msgId];\n if(bubble) {\n this.unreadOut.delete(msgId);\n\n if(bubble.classList.contains('is-outgoing') || bubble.classList.contains('is-error')) {\n continue;\n }\n\n bubble.classList.remove('is-sent', 'is-sending', 'is-outgoing'); // is-sending can be when there are bulk of updates (e.g. sending command to Stickers bot)\n bubble.classList.add('is-read');\n }\n }\n }\n }\n\n public destroyBubble(bubble: HTMLElement, mid = +bubble.dataset.mid) {\n // this.log.warn('destroy bubble', bubble, mid);\n bubble.middlewareHelper.destroy();\n\n /* const mounted = this.getMountedBubble(mid);\n if(!mounted) return; */\n\n if(this.bubbles[mid] === bubble) { // have to check because can clear bubble with same id later\n delete this.bubbles[mid];\n }\n\n this.skippedMids.delete(mid);\n\n if(this.firstUnreadBubble === bubble) {\n this.firstUnreadBubble = null;\n }\n\n this.bubbleGroups.removeAndUnmountBubble(bubble);\n if(this.observer) {\n this.observer.unobserve(bubble, this.unreadedObserverCallback);\n this.unreaded.delete(bubble);\n\n this.observer.unobserve(bubble, this.viewsObserverCallback);\n this.viewsMids.delete(mid);\n\n this.observer.unobserve(bubble, this.stickerEffectObserverCallback);\n }\n\n // this.reactions.delete(mid);\n }\n\n public deleteMessagesByIds(mids: number[], permanent = true, ignoreOnScroll?: boolean) {\n let deleted = false;\n mids.forEach((mid) => {\n const bubble = this.bubbles[mid];\n if(!bubble) return;\n\n this.destroyBubble(bubble, mid);\n\n deleted = true;\n });\n\n if(!deleted) {\n return;\n }\n\n this.scrollable.ignoreNextScrollEvent();\n if(permanent && this.chat.selection.isSelecting) {\n this.chat.selection.deleteSelectedMids(this.peerId, mids);\n }\n\n animationIntersector.checkAnimations(false, this.chat.animationGroup);\n this.deleteEmptyDateGroups();\n\n if(!ignoreOnScroll) {\n this.scrollable.onScroll();\n // this.onScroll();\n }\n }\n\n private pollExtendedMediaMessages() {\n const mids = Array.from(this.extendedMediaMessages);\n return this.managers.appMessagesManager.getExtendedMedia(this.peerId, mids);\n }\n\n private setExtendedMediaMessagesPollInterval() {\n if(this.pollExtendedMediaMessagesPromise || !this.extendedMediaMessages.size) {\n return;\n }\n\n this.pollExtendedMediaMessagesPromise = pause(30000)\n .then(() => this.pollExtendedMediaMessages())\n .then(() => this.setExtendedMediaMessagesPollInterval());\n }\n\n private setTopPadding(middleware = this.getMiddleware()) {\n let isPaddingNeeded = false;\n let setPaddingTo: HTMLElement;\n if(!this.isTopPaddingSet && this.chat.type !== 'scheduled') {\n const {clientHeight, scrollHeight} = this.scrollable.container;\n isPaddingNeeded = clientHeight === scrollHeight;\n /* const firstEl = this.chatInner.firstElementChild as HTMLElement;\n if(this.chatInner.firstElementChild) {\n const visibleRect = getVisibleRect(firstEl, this.scrollable.container);\n isPaddingNeeded = !visibleRect.overflow.top && (visibleRect.rect.top - firstEl.offsetTop) !== this.scrollable.container.getBoundingClientRect().top;\n } else {\n isPaddingNeeded = true;\n } */\n\n if(isPaddingNeeded) {\n /* const add = clientHeight - scrollHeight;\n this.chatInner.style.paddingTop = add + 'px';\n this.scrollable.scrollTop += add; */\n setPaddingTo = this.chatInner;\n setPaddingTo.style.paddingTop = clientHeight + 'px';\n this.scrollable.setScrollTopSilently(scrollHeight);\n this.isTopPaddingSet = true;\n }\n }\n\n return {\n isPaddingNeeded,\n unsetPadding: isPaddingNeeded ? () => {\n if(middleware() && isPaddingNeeded) {\n setPaddingTo.style.paddingTop = '';\n this.isTopPaddingSet = false;\n }\n } : undefined\n };\n }\n\n private renderNewMessage(message: MyMessage, scrolledDown?: boolean) {\n const promise = this._renderNewMessage(message, scrolledDown);\n this.renderNewPromises.add(promise);\n promise.catch(noop).finally(() => {\n this.renderNewPromises.delete(promise);\n });\n return promise;\n }\n\n private async _renderNewMessage(message: MyMessage, scrolledDown?: boolean) {\n if(!this.scrollable.loadedAll.bottom) { // seems search active or sliced\n // this.log('renderNewMessagesByIds: seems search is active, skipping render:', mids);\n const setPeerPromise = this.chat.setPeerPromise;\n if(setPeerPromise) {\n const middleware = this.getMiddleware();\n setPeerPromise.then(async() => {\n if(!middleware()) return;\n const newMessage = await this.chat.getMessage(message.mid);\n if(!middleware()) return;\n this.renderNewMessage(newMessage);\n });\n }\n\n return;\n }\n\n if(this.chat.threadId && getMessageThreadId(message, this.chat.isForum) !== this.chat.threadId) {\n return;\n }\n\n if(this.bubbles[message.mid]) {\n return;\n }\n // ! should scroll even without new messages\n /* if(!mids.length) {\n return;\n } */\n\n if(!scrolledDown) {\n scrolledDown = this.scrolledDown && (\n !this.scrollingToBubble ||\n this.scrollingToBubble === this.getLastBubble() ||\n this.scrollingToBubble === this.chatInner\n );\n }\n\n const middleware = this.getMiddleware();\n const {isPaddingNeeded, unsetPadding} = this.setTopPadding(middleware);\n\n const promise = this.performHistoryResult({history: [message]}, false);\n if(scrolledDown) {\n promise.then(() => {\n if(!middleware()) return;\n // this.log('renderNewMessagesByIDs: messagesQueuePromise after', this.scrollable.isScrolledDown);\n // this.scrollable.scrollTo(this.scrollable.scrollHeight, 'top', true, true, 5000);\n // const bubble = this.bubbles[Math.max(...mids)];\n\n let bubble: HTMLElement;\n if(this.chat.type === 'scheduled') {\n bubble = this.bubbles[message.mid];\n }\n\n const promise = bubble ? this.scrollToBubbleEnd(bubble) : this.scrollToEnd();\n if(isPaddingNeeded) {\n // it will be called only once even if was set multiple times (that won't happen)\n promise.then(unsetPadding);\n }\n\n // this.scrollable.scrollIntoViewNew(this.chatInner, 'end');\n\n /* setTimeout(() => {\n this.log('messagesQueuePromise afterafter:', this.chatInner.childElementCount, this.scrollable.scrollHeight);\n }, 10); */\n });\n }\n\n return promise;\n }\n\n public getLastBubble() {\n const group = this.bubbleGroups.getLastGroup();\n return group?.lastItem?.bubble;\n }\n\n public scrollToBubble(\n element: HTMLElement,\n position: ScrollLogicalPosition,\n forceDirection?: FocusDirection,\n forceDuration?: number\n ) {\n const bubble = findUpClassName(element, 'bubble');\n\n if(!element.parentElement) {\n this.log.error('element is not connected', bubble);\n }\n\n let fallbackToElementStartWhenCentering: HTMLElement;\n // * if it's a start, then scroll to start of the group\n if(bubble && position !== 'end') {\n const item = this.bubbleGroups.getItemByBubble(bubble);\n if(item && item.group.firstItem === item && whichChild(item.group.container) === (this.stickyIntersector ? STICKY_OFFSET : 1)) {\n const dateGroup = item.group.container.parentElement;\n // if(whichChild(dateGroup) === 0) {\n fallbackToElementStartWhenCentering = dateGroup;\n // position = 'start';\n // element = dateGroup;\n // }\n }\n }\n\n // const isLastBubble = this.getLastBubble() === bubble;\n /* if(isLastBubble) {\n element = this.getLastDateGroup();\n } */\n\n const margin = 4; // * 4 = .25rem\n /* if(isLastBubble && this.chat.type === 'chat' && this.bubblesContainer.classList.contains('is-chat-input-hidden')) {\n margin = 20;\n } */\n\n const isChangingHeight = (this.chat.input.messageInput && this.chat.input.messageInput.classList.contains('is-changing-height')) || this.chat.container.classList.contains('is-toggling-helper');\n const promise = this.scrollable.scrollIntoViewNew({\n element,\n position,\n margin,\n forceDirection,\n forceDuration,\n axis: 'y',\n getNormalSize: isChangingHeight ? ({rect}) => {\n // return rect.height;\n\n let height = windowSize.height;\n // height -= this.chat.topbar.container.getBoundingClientRect().height;\n height -= this.container.offsetTop;\n height -= mediaSizes.isMobile || windowSize.height < 570 ? 58 : 78;\n return height;\n\n /* const rowsWrapperHeight = this.chat.input.rowsWrapper.getBoundingClientRect().height;\n const diff = rowsWrapperHeight - 54;\n return rect.height + diff; */\n } : undefined,\n fallbackToElementStartWhenCentering,\n startCallback: (dimensions) => {\n // this.onScroll(true, this.scrolledDown && dimensions.distanceToEnd <= SCROLLED_DOWN_THRESHOLD ? undefined : dimensions);\n this.onScroll(true, dimensions);\n\n if(this.updateGradient) {\n const {gradientRenderer} = this.chat;\n gradientRenderer?.toNextPosition(dimensions.getProgress);\n this.updateGradient = undefined;\n }\n }\n });\n\n // fix flickering date when opening unread chat and focusing message\n if(forceDirection === FocusDirection.Static) {\n this.scrollable.lastScrollPosition = this.scrollable.scrollTop;\n }\n\n return promise;\n }\n\n public scrollToEnd() {\n return this.scrollToBubbleEnd(this.chatInner);\n }\n\n public async scrollToBubbleEnd(bubble: HTMLElement) {\n /* if(DEBUG) {\n this.log('scrollToNewLastBubble: will scroll into view:', bubble);\n } */\n\n if(bubble) {\n this.scrollingToBubble = bubble;\n const middleware = this.getMiddleware();\n await this.scrollToBubble(bubble, 'end', undefined, undefined);\n if(!middleware()) return;\n this.scrollingToBubble = undefined;\n }\n }\n\n // ! can't get it by chatInner.lastElementChild because placeholder can be the last...\n // private getLastDateGroup() {\n // let lastTime = 0, lastElem: HTMLElement;\n // for(const i in this.dateMessages) {\n // const dateMessage = this.dateMessages[i];\n // if(dateMessage.firstTimestamp > lastTime) {\n // lastElem = dateMessage.container;\n // lastTime = dateMessage.firstTimestamp;\n // }\n // }\n\n // return lastElem;\n // }\n\n public async scrollToBubbleIfLast(bubble: HTMLElement) {\n if(this.getLastBubble() === bubble) {\n // return this.scrollToBubbleEnd(bubble);\n return this.scrollToEnd();\n }\n }\n\n public highlightBubble(element: HTMLElement) {\n const datasetKey = 'highlightTimeout';\n if(element.dataset[datasetKey]) {\n clearTimeout(+element.dataset[datasetKey]);\n element.classList.remove('is-highlighted');\n void element.offsetWidth; // reflow\n }\n\n element.classList.add('is-highlighted');\n element.dataset[datasetKey] = '' + setTimeout(() => {\n element.classList.remove('is-highlighted');\n delete element.dataset[datasetKey];\n }, 2000);\n }\n\n private createDateBubble(timestamp: number, date: Date = new Date(timestamp * 1000)) {\n let dateElement: HTMLElement;\n\n const today = new Date();\n today.setHours(0, 0, 0, 0);\n\n const isScheduled = this.chat.type === 'scheduled';\n\n if(today.getTime() === date.getTime()) {\n dateElement = i18n(isScheduled ? 'Chat.Date.ScheduledForToday' : 'Date.Today');\n } else if(isScheduled && timestamp === SEND_WHEN_ONLINE_TIMESTAMP) {\n dateElement = i18n('MessageScheduledUntilOnline');\n } else {\n const options: Intl.DateTimeFormatOptions = {\n day: 'numeric',\n month: 'long'\n };\n\n if(date.getFullYear() !== today.getFullYear()) {\n options.year = 'numeric';\n }\n\n dateElement = new I18n.IntlDateElement({\n date,\n options\n }).element;\n\n if(isScheduled) {\n dateElement = i18n('Chat.Date.ScheduledFor', [dateElement]);\n }\n }\n\n const bubble = document.createElement('div');\n bubble.className = 'bubble service is-date';\n const bubbleContent = document.createElement('div');\n bubbleContent.classList.add('bubble-content');\n const serviceMsg = document.createElement('div');\n serviceMsg.classList.add('service-msg');\n\n serviceMsg.append(dateElement);\n\n bubbleContent.append(serviceMsg);\n bubble.append(bubbleContent);\n\n return bubble;\n }\n\n public getDateForDateContainer(timestamp: number) {\n const date = new Date(timestamp * 1000);\n date.setHours(0, 0, 0);\n return {date, dateTimestamp: date.getTime()};\n }\n\n public getDateContainerByTimestamp(timestamp: number) {\n const {date, dateTimestamp} = this.getDateForDateContainer(timestamp);\n let ret = this.dateMessages[dateTimestamp];\n if(ret) {\n return ret;\n }\n\n const bubble = this.createDateBubble(timestamp, date);\n // bubble.classList.add('is-sticky');\n const fakeBubble = this.createDateBubble(timestamp, date);\n fakeBubble.classList.add('is-fake');\n\n const container = document.createElement('section');\n container.className = 'bubbles-date-group';\n container.append(bubble, fakeBubble);\n\n ret = this.dateMessages[dateTimestamp] = {\n div: bubble,\n container,\n firstTimestamp: date.getTime()\n };\n\n const haveTimestamps = getObjectKeysAndSort(this.dateMessages, 'asc');\n const length = haveTimestamps.length;\n let i = 0, insertBefore: HTMLElement; // there can be 'first bubble' (e.g. bot description) so can't insert by index\n for(; i < haveTimestamps.length; ++i) {\n const t = haveTimestamps[i];\n insertBefore = this.dateMessages[t].container;\n if(dateTimestamp < t) {\n break;\n }\n }\n\n if(i === length && insertBefore) {\n insertBefore = insertBefore.nextElementSibling as HTMLElement;\n }\n\n if(!insertBefore) {\n this.chatInner.append(container);\n } else {\n this.chatInner.insertBefore(container, insertBefore);\n }\n\n this.stickyIntersector?.observeStickyHeaderChanges(container);\n\n if(this.chatInner.parentElement) {\n this.container.classList.add('has-groups');\n }\n\n return ret;\n }\n\n private destroyScrollable() {\n this.scrollable.destroy();\n }\n\n public destroy() {\n // this.chat.log.error('Bubbles destroying');\n\n this.destroyScrollable();\n\n this.listenerSetter.removeAll();\n\n this.lazyLoadQueue.clear();\n this.observer && this.observer.disconnect();\n this.stickyIntersector && this.stickyIntersector.disconnect();\n\n delete this.lazyLoadQueue;\n this.observer && delete this.observer;\n this.stickyIntersector && delete this.stickyIntersector;\n }\n\n public cleanup(bubblesToo = false) {\n this.log('cleanup');\n\n this.bubbles = {}; // clean it before so sponsored message won't be deleted faster on peer changing\n // //console.time('appImManager cleanup');\n this.setLoaded('top', false, false);\n this.setLoaded('bottom', false, false);\n\n // cancel scroll\n cancelAnimationByKey(this.scrollable.container);\n\n // do not wait ending of previous scale animation\n interruptHeavyAnimation();\n\n if(TEST_SCROLL !== undefined) {\n TEST_SCROLL = TEST_SCROLL_TIMES;\n }\n\n this.skippedMids.clear();\n this.dateMessages = {};\n this.bubbleGroups.cleanup();\n this.unreadOut.clear();\n this.needUpdate.length = 0;\n this.lazyLoadQueue.clear();\n this.renderNewPromises.clear();\n\n // clear messages\n if(bubblesToo) {\n this.scrollable.container.textContent = '';\n this.chatInner.textContent = '';\n this.cleanupPlaceholders();\n }\n\n this.firstUnreadBubble = null;\n this.attachedUnreadBubble = false;\n\n this.batchProcessor.clear();\n\n this.getHistoryTopPromise = this.getHistoryBottomPromise = undefined;\n this.fetchNewPromise = undefined;\n this.getSponsoredMessagePromise = undefined;\n this.updateGradient = undefined;\n\n if(this.stickyIntersector) {\n this.stickyIntersector.disconnect();\n }\n\n if(this.observer) {\n this.observer.disconnect();\n\n this.unreaded.clear();\n this.unreadedSeen.clear();\n this.readPromise = undefined;\n\n this.viewsMids.clear();\n }\n\n this.middlewareHelper.clean();\n\n this.onAnimateLadder = undefined;\n this.resolveLadderAnimation = undefined;\n this.attachPlaceholderOnRender = undefined;\n this.emptyPlaceholderBubble = undefined;\n this.sponsoredMessage = undefined;\n this.previousStickyDate = undefined;\n\n this.scrollingToBubble = undefined;\n // //console.timeEnd('appImManager cleanup');\n\n this.isTopPaddingSet = false;\n\n this.renderingMessages.clear();\n this.bubblesToEject.clear();\n this.bubblesToReplace.clear();\n\n // this.reactions.clear();\n\n if(this.isScrollingTimeout) {\n clearTimeout(this.isScrollingTimeout);\n this.isScrollingTimeout = 0;\n }\n\n this.container.classList.remove('has-sticky-dates');\n this.scrollable.cancelMeasure();\n }\n\n private cleanupPlaceholders(bubble = this.emptyPlaceholderBubble) {\n if(bubble) {\n this.destroyBubble(bubble);\n }\n }\n\n public async setPeer(options: ChatSetPeerOptions & {samePeer: boolean}): Promise<{cached?: boolean, promise: Chat['setPeerPromise']}> {\n const {samePeer, peerId, stack} = options;\n let {lastMsgId, startParam} = options;\n const tempId = ++this.setPeerTempId;\n\n if(!peerId) {\n this.cleanup(true);\n this.preloader.detach();\n return null;\n }\n\n const perf = performance.now();\n const log = this.log.bindPrefix('setPeer');\n log.warn('start');\n\n const middleware = () => {\n return this.setPeerTempId === tempId;\n };\n\n const m = middlewarePromise(middleware, PEER_CHANGED_ERROR);\n\n if(!samePeer) {\n await m(this.chat.onChangePeer(options, m));\n }\n\n /* if(samePeer && this.chat.setPeerPromise) {\n return {cached: true, promise: this.chat.setPeerPromise};\n } */\n\n const chatType = this.chat.type;\n\n if(chatType === 'scheduled' || this.chat.isRestricted) {\n lastMsgId = 0;\n }\n\n const historyStorage = await m(this.chat.getHistoryStorage());\n const topMessage = chatType === 'pinned' ? await m(this.managers.appMessagesManager.getPinnedMessagesMaxId(peerId, this.chat.threadId)) : historyStorage.maxId ?? 0;\n const isTarget = lastMsgId !== undefined;\n\n // * this one will fix topMessage for null message in history (e.g. channel comments with only 1 comment and it is a topMessage)\n /* if(chatType !== 'pinned' && topMessage && !historyStorage.history.slice.includes(topMessage)) {\n topMessage = 0;\n } */\n\n let followingUnread: boolean;\n let readMaxId = 0, savedPosition: ReturnType, overrideAdditionMsgId: number;\n if(!isTarget) {\n if(!samePeer) {\n savedPosition = this.chat.appImManager.getChatSavedPosition(this.chat);\n }\n\n if(savedPosition) {\n\n } else if(topMessage) {\n readMaxId = await m(this.managers.appMessagesManager.getReadMaxIdIfUnread(peerId, this.chat.threadId));\n const dialog = await m(this.chat.getDialogOrTopic());\n if(/* dialog.unread_count */readMaxId && !samePeer && (!dialog || dialog.unread_count !== 1)) {\n const foundSlice = historyStorage.history.findSliceOffset(readMaxId);\n if(foundSlice && foundSlice.slice.isEnd(SliceEnd.Bottom)) {\n overrideAdditionMsgId = foundSlice.slice[foundSlice.offset - 25] || foundSlice.slice[0] || readMaxId;\n }\n\n followingUnread = !isTarget;\n lastMsgId = readMaxId;\n } else {\n lastMsgId = topMessage;\n // lastMsgID = topMessage;\n }\n }\n }\n\n const isJump = lastMsgId !== topMessage/* && overrideAdditionMsgId === undefined */;\n\n if(startParam === undefined && await m(this.chat.isStartButtonNeeded())) {\n startParam = BOT_START_PARAM;\n }\n\n if(samePeer) {\n if(stack && lastMsgId) {\n this.followStack.push(stack);\n }\n\n const mounted = await m(this.getMountedBubble(lastMsgId));\n if(mounted) {\n if(isTarget) {\n this.scrollToBubble(mounted.bubble, 'center');\n this.highlightBubble(mounted.bubble);\n this.chat.dispatchEvent('setPeer', lastMsgId, false);\n } else if(topMessage && !isJump) {\n // log('will scroll down', this.scroll.scrollTop, this.scroll.scrollHeight);\n // scrollable.setScrollTopSilently(scrollable.scrollHeight);\n this.scrollToEnd();\n this.chat.dispatchEvent('setPeer', lastMsgId, true);\n }\n\n if(startParam !== undefined) {\n this.chat.input.setStartParam(startParam);\n }\n\n return null;\n }\n } else {\n if(this.peerId) { // * set new queue id if new peer (setting not from 0)\n this.lazyLoadQueue.queueId = ++queueId;\n this.managers.apiFileManager.setQueueId(this.chat.bubbles.lazyLoadQueue.queueId);\n }\n\n this.followStack.length = 0;\n\n this.passEntities = {\n messageEntityBotCommand: await m(this.managers.appPeersManager.isAnyGroup(peerId)) || this.chat.isBot\n };\n }\n\n if(DEBUG) {\n log('setPeer peerId:', peerId, historyStorage, lastMsgId, topMessage);\n }\n\n // add last message, bc in getHistory will load < max_id\n const additionMsgId = overrideAdditionMsgId ?? (isJump || chatType === 'scheduled' || this.chat.isRestricted ? 0 : topMessage);\n\n let maxBubbleId = 0;\n if(samePeer) {\n const el = this.getBubbleByPoint('bottom'); // ! this may not work if being called when chat is hidden\n // this.chat.log('[PM]: setCorrectIndex: get last element perf:', performance.now() - perf, el);\n if(el) {\n maxBubbleId = +el.dataset.mid;\n }\n\n if(maxBubbleId <= 0) {\n maxBubbleId = Math.max(...Object.keys(this.bubbles).map((mid) => +mid));\n }\n } else {\n this.isFirstLoad = true;\n this.destroyResizeObserver();\n }\n\n const oldChatInner = this.chatInner;\n const oldPlaceholderBubble = this.emptyPlaceholderBubble;\n this.cleanup();\n const chatInner = this.chatInner = document.createElement('div');\n if(samePeer) {\n chatInner.className = oldChatInner.className;\n chatInner.classList.remove('disable-hover', 'is-scrolling');\n } else {\n chatInner.classList.add('bubbles-inner');\n }\n\n this.lazyLoadQueue.lock();\n\n // const haveToScrollToBubble = (topMessage && (isJump || samePeer)) || isTarget;\n const haveToScrollToBubble = samePeer || (topMessage && isJump) || isTarget;\n const fromUp = maxBubbleId > 0 && (!lastMsgId || maxBubbleId < lastMsgId || lastMsgId < 0);\n const scrollFromDown = !fromUp && samePeer;\n const scrollFromUp = !scrollFromDown && fromUp/* && (samePeer || forwardingUnread) */;\n this.willScrollOnLoad = scrollFromDown || scrollFromUp;\n\n this.setPeerOptions = {\n lastMsgId,\n topMessage,\n savedPosition\n };\n\n let result: Awaited>;\n if(!savedPosition) {\n result = await m(this.getHistory1(lastMsgId, true, isJump, additionMsgId));\n } else {\n result = {\n promise: getHeavyAnimationPromise().then(() => {\n return this.performHistoryResult({history: savedPosition.mids}, true);\n }) as any,\n cached: true,\n waitPromise: Promise.resolve()\n };\n }\n\n this.setPeerCached = result.cached;\n\n log.warn('got history');// warning\n\n const {promise, cached} = result;\n\n if(!cached && !samePeer) {\n await m(this.chat.finishPeerChange(isTarget, isJump, lastMsgId, startParam));\n this.scrollable.container.textContent = '';\n // oldContainer.textContent = '';\n // oldChatInner.remove();\n this.preloader.attach(this.container);\n }\n\n /* this.ladderDeferred && this.ladderDeferred.resolve();\n this.ladderDeferred = deferredPromise(); */\n\n animationIntersector.lockGroup(this.chat.animationGroup);\n const setPeerPromise = m(promise).then(async() => {\n log.warn('promise fulfilled');\n\n const mountedByLastMsgId = haveToScrollToBubble ? await m(lastMsgId ? this.getMountedBubble(lastMsgId) : {bubble: this.getLastBubble()}) : undefined;\n if(cached && !samePeer) {\n log.warn('finishing peer change');\n await m(this.chat.finishPeerChange(isTarget, isJump, lastMsgId, startParam)); // * костыль\n log.warn('finished peer change');\n }\n\n this.preloader.detach();\n\n if(this.resolveLadderAnimation) {\n this.resolveLadderAnimation();\n this.resolveLadderAnimation = undefined;\n }\n\n this.setPeerCached = undefined;\n\n // this.ladderDeferred.resolve();\n\n const scrollable = this.scrollable;\n scrollable.lastScrollDirection = 0;\n scrollable.lastScrollPosition = 0;\n replaceContent(scrollable.container, chatInner);\n // this.chat.topbar.container.nextElementSibling.replaceWith(container);\n\n if(oldPlaceholderBubble) {\n this.cleanupPlaceholders(oldPlaceholderBubble);\n }\n\n if(this.attachPlaceholderOnRender) {\n this.attachPlaceholderOnRender();\n }\n\n if(!isTarget && this.chat.isPinnedMessagesNeeded()) {\n this.chat.topbar.pinnedMessage?.setCorrectIndex(0);\n }\n\n this.container.classList.toggle('has-groups', !!Object.keys(this.dateMessages).length);\n\n log.warn('mounted chat', this.chatInner === chatInner, this.chatInner.parentElement, performance.now() - perf);\n\n animationIntersector.unlockGroup(this.chat.animationGroup);\n animationIntersector.checkAnimations(false, this.chat.animationGroup/* , true */);\n\n // fastRaf(() => {\n this.lazyLoadQueue.unlock();\n // });\n\n // if(dialog && lastMsgID && lastMsgID !== topMessage && (this.bubbles[lastMsgID] || this.firstUnreadBubble)) {\n if(savedPosition) {\n scrollable.setScrollTopSilently(savedPosition.top);\n /* const mountedByLastMsgId = this.getMountedBubble(lastMsgId);\n let bubble: HTMLElement = mountedByLastMsgId?.bubble;\n if(!bubble?.parentElement) {\n bubble = this.findNextMountedBubbleByMsgId(lastMsgId);\n }\n\n if(bubble) {\n const top = bubble.getBoundingClientRect().top;\n const distance = savedPosition.top - top;\n scrollable.scrollTop += distance;\n } */\n } else if(haveToScrollToBubble) {\n let unsetPadding: () => void;\n if(scrollFromDown) {\n scrollable.setScrollTopSilently(99999);\n } else if(scrollFromUp) {\n const set = this.setTopPadding();\n if(set.isPaddingNeeded) {\n unsetPadding = set.unsetPadding;\n }\n\n scrollable.setScrollTopSilently(0);\n }\n\n // const mountedByLastMsgId = lastMsgId ? this.getMountedBubble(lastMsgId) : {bubble: this.getLastBubble()};\n let bubble: HTMLElement = (followingUnread && this.firstUnreadBubble) || mountedByLastMsgId?.bubble;\n if(!bubble?.parentElement) {\n bubble = this.findNextMountedBubbleByMsgId(lastMsgId, false) || this.findNextMountedBubbleByMsgId(lastMsgId, true);\n }\n\n let promise: Promise;\n // ! sometimes there can be no bubble\n if(bubble) {\n const lastBubble = this.getLastBubble();\n const position: ScrollLogicalPosition = followingUnread ? 'start' : (!isJump && !isTarget && lastBubble === bubble ? 'end' : 'center');\n\n if(position === 'end' && lastBubble === bubble && samePeer) {\n promise = this.scrollToEnd();\n } else {\n promise = this.scrollToBubble(bubble, position, !samePeer ? FocusDirection.Static : undefined);\n }\n\n if(!followingUnread && isTarget) {\n this.highlightBubble(bubble);\n }\n }\n\n if(unsetPadding) {\n (promise || Promise.resolve()).then(() => {\n unsetPadding();\n });\n }\n } else {\n scrollable.setScrollTopSilently(99999);\n }\n\n // if(!cached) {\n this.onRenderScrollSet();\n // }\n\n this.onScroll();\n\n const afterSetPromise = Promise.all([\n setPeerPromise,\n getHeavyAnimationPromise()\n ]);\n afterSetPromise.then(() => { // check whether list isn't full\n if(!middleware()) {\n return;\n }\n\n scrollable.checkForTriggers();\n\n if(options.mediaTimestamp !== undefined) {\n // ! :(\n const p = cached && !samePeer && liteMode.isAvailable('animations') && this.chat.appImManager.chats.length > 1 ?\n pause(400) :\n Promise.resolve();\n p.then(() => {\n return this.getMountedBubble(lastMsgId);\n }).then((mounted) => {\n if(!middleware() || !mounted) {\n return;\n }\n\n this.playMediaWithTimestamp(mounted.bubble, options.mediaTimestamp);\n });\n }\n\n // if(cached) {\n // this.onRenderScrollSet();\n // }\n });\n\n this.chat.dispatchEvent('setPeer', lastMsgId, !isJump);\n\n Promise.all([\n this.setFetchReactionsInterval(afterSetPromise),\n this.setFetchHistoryInterval({\n afterSetPromise,\n lastMsgId,\n samePeer,\n savedPosition,\n topMessage\n })\n ]).then(() => {\n log('scrolledAllDown:', scrollable.loadedAll.bottom);\n // if(!this.unreaded.length && dialog) { // lol\n if(scrollable.loadedAll.bottom && topMessage && !this.unreaded.size) { // lol\n this.onScrolledAllDown();\n }\n });\n\n if(chatType === 'chat' && !this.chat.isForumTopic) {\n const dialog = await m(this.managers.appMessagesManager.getDialogOnly(peerId));\n if(dialog?.pFlags.unread_mark) {\n this.managers.appMessagesManager.markDialogUnread(peerId, true);\n }\n }\n\n // this.chatInner.classList.remove('disable-hover', 'is-scrolling'); // warning, performance!\n }).catch((err) => {\n log.error('setPeer promise error:', err);\n if(!middleware()) {\n this.preloader.detach();\n }\n\n throw err;\n });\n\n return {cached, promise: setPeerPromise};\n }\n\n public playMediaWithTimestamp(element: HTMLElement, timestamp: number) {\n const bubble = findUpClassName(element, 'bubble');\n const groupedItem = findUpClassName(element, 'grouped-item');\n const albumItemMid = groupedItem ? +groupedItem.dataset.mid : +bubble.dataset.textMid;\n let attachment = bubble.querySelector('.attachment');\n if(attachment) {\n if(albumItemMid) {\n attachment = attachment.querySelector(`[data-mid=\"${albumItemMid}\"]`);\n }\n\n const media = attachment.querySelector('img, video, canvas');\n this.checkTargetForMediaViewer(media, undefined, timestamp);\n return;\n }\n\n const audio = (groupedItem || bubble).querySelector('.audio');\n if(audio) {\n audio.playWithTimestamp(timestamp);\n return;\n }\n }\n\n private async setFetchReactionsInterval(afterSetPromise: Promise) {\n const middleware = this.getMiddleware();\n const needReactionsInterval = this.chat.isChannel;\n if(needReactionsInterval) {\n const fetchReactions = async() => {\n if(!middleware()) return;\n\n const mids: number[] = [];\n for(const mid in this.bubbles) {\n let message = await this.chat.getMessage(+mid);\n if(message?._ !== 'message') {\n continue;\n }\n\n message = await this.managers.appMessagesManager.getGroupsFirstMessage(message);\n mids.push(message.mid);\n }\n\n const promise = mids.length ? this.managers.appReactionsManager.getMessagesReactions(this.peerId, mids) : Promise.resolve();\n promise.then(() => {\n setTimeout(fetchReactions, 10e3);\n });\n };\n\n Promise.all([afterSetPromise, getHeavyAnimationPromise(), pause(500)]).then(() => {\n fetchReactions();\n });\n }\n }\n\n private async setFetchHistoryInterval({\n lastMsgId,\n topMessage,\n afterSetPromise,\n savedPosition,\n samePeer\n }: {\n lastMsgId: number,\n topMessage: number,\n afterSetPromise: Promise,\n savedPosition: ChatSavedPosition,\n samePeer: boolean\n }) {\n const peerId = this.peerId;\n if(peerId.isUser()) {\n return;\n }\n\n const middleware = this.getMiddleware();\n const needFetchInterval = await this.managers.appMessagesManager.isFetchIntervalNeeded(peerId);\n const needFetchNew = savedPosition || needFetchInterval;\n if(!needFetchNew) {\n return;\n }\n\n await afterSetPromise;\n if(!middleware()) {\n return;\n }\n\n const chatId = peerId.toChatId();\n middleware.onClean(() => {\n this.managers.apiUpdatesManager.unsubscribeFromChannelUpdates(chatId);\n });\n\n this.managers.apiUpdatesManager.subscribeToChannelUpdates(chatId);\n return;\n\n this.setLoaded('bottom', false);\n this.scrollable.checkForTriggers();\n\n if(!needFetchInterval) {\n return;\n }\n\n const f = () => {\n this.fetchNewPromise = new Promise(async(resolve) => {\n if(!middleware() || !(await this.managers.appMessagesManager.isFetchIntervalNeeded(peerId))) {\n resolve();\n return;\n }\n\n this.managers.appMessagesManager.getNewHistory(peerId, this.chat.threadId).then((result) => {\n if(!middleware() || !result) {\n resolve();\n return;\n }\n\n const {isBottomEnd} = result;\n if(this.scrollable.loadedAll.bottom && this.scrollable.loadedAll.bottom !== isBottomEnd) {\n this.setLoaded('bottom', isBottomEnd);\n this.onScroll();\n }\n\n setTimeout(f, 30e3);\n resolve();\n });\n }).finally(() => {\n this.fetchNewPromise = undefined;\n });\n };\n\n if(samePeer) {\n setTimeout(f, 30e3);\n } else {\n f();\n }\n }\n\n public async onScrolledAllDown() {\n if(this.chat.type === 'chat' || this.chat.type === 'discussion') {\n const historyMaxId = await this.chat.getHistoryMaxId();\n this.managers.appMessagesManager.readHistory(this.peerId, historyMaxId, this.chat.threadId, true);\n }\n }\n\n public async finishPeerChange() {\n const [isChannel, canWrite, isAnyGroup] = await Promise.all([\n this.chat.isChannel,\n this.chat.canSend(),\n this.chat.isAnyGroup\n ]);\n\n return () => {\n this.chatInner.classList.toggle('has-rights', canWrite);\n this.container.classList.toggle('is-chat-input-hidden', !canWrite);\n\n this.chatInner.classList.toggle('is-chat', isAnyGroup);\n this.chatInner.classList.toggle('is-channel', isChannel);\n\n this.createResizeObserver();\n };\n }\n\n private processBatch = async(...args: Parameters) => {\n let [loadQueue, m, log] = args;\n\n const filterQueue = (queue: typeof loadQueue) => {\n return queue.filter((details) => {\n // message can be deleted during rendering\n return details && this.bubbles[details.bubble.dataset.mid] === details.bubble;\n });\n };\n\n loadQueue = filterQueue(loadQueue);\n\n log('messages rendered');\n\n const reverse = loadQueue[0]?.reverse;\n\n const {groups, avatarPromises} = this.groupBubbles(loadQueue.filter((details) => details.updatePosition));\n\n // if(groups.length > 2 && loadQueue.length === 1) {\n // debugger;\n // }\n\n const promises = loadQueue.reduce((acc, details) => {\n const perf = performance.now();\n\n const promises = details.promises.slice();\n const timePromises = promises.map(async(promise) => (await promise, performance.now() - perf));\n Promise.all(timePromises).then((times) => {\n log.groupCollapsed('media message time', performance.now() - perf, details, times);\n times.forEach((time, idx) => {\n log('media message time', time, idx, promises[idx]);\n });\n log.groupEnd();\n });\n\n // if(details.updatePosition) {\n // if(res) {\n // groups.add(res.group);\n // if(details.needAvatar) {\n // details.promises.push(res.group.createAvatar(details.message));\n // }\n // }\n // }\n\n acc.push(...details.promises);\n return acc;\n }, [] as Promise[]);\n\n promises.push(...avatarPromises);\n // promises.push(pause(200));\n\n // * это нужно для того, чтобы если захочет подгрузить reply или какое-либо сообщение, то скролл не прервался\n // * если добавить этот промис - в таком случае нужно сделать, чтобы скроллило к последнему сообщению после рендера\n // promises.push(getHeavyAnimationPromise());\n\n log('media promises to call', promises, loadQueue, this.isHeavyAnimationInProgress);\n await m(Promise.all([...promises, this.setUnreadDelimiter()]).catch(noop)); // не нашёл места лучше\n await m(fastRafPromise()); // have to be the last\n log('media promises end');\n\n loadQueue = filterQueue(loadQueue);\n\n const {restoreScroll, scrollSaver} = this.prepareToSaveScroll(reverse);\n // if(this.messagesQueueOnRender) {\n // this.messagesQueueOnRender();\n // }\n\n this.messagesQueueOnRenderAdditional?.();\n\n this.ejectBubbles();\n for(const [bubble, oldBubble] of this.bubblesToReplace) {\n if(scrollSaver) {\n scrollSaver.replaceSaved(oldBubble, bubble);\n }\n\n if(!loadQueue.find((details) => details.bubble === bubble)) {\n continue;\n }\n\n const item = this.bubbleGroups.getItemByBubble(bubble);\n if(!item) {\n this.log.error('NO ITEM BY BUBBLE', bubble);\n } else {\n item.mounted = false;\n if(!groups.includes(item.group)) {\n groups.push(item.group);\n }\n }\n\n this.bubblesToReplace.delete(bubble);\n }\n\n if(this.chat.selection.isSelecting) {\n loadQueue.forEach(({bubble}) => {\n this.chat.selection.toggleElementCheckbox(bubble, true);\n });\n }\n\n loadQueue.forEach(({message, bubble, updatePosition}) => {\n if(message.pFlags.local && updatePosition) {\n this.chatInner[(message as Message.message).pFlags.sponsored ? 'append' : 'prepend'](bubble);\n return;\n }\n });\n\n this.bubbleGroups.mountUnmountGroups(groups);\n // this.bubbleGroups.findIncorrentPositions();\n\n this.updatePlaceholderPosition?.();\n\n restoreScroll?.();\n\n pause(!this.chat.setPeerPromise ? 0 : 1000)\n .then(() => getHeavyAnimationPromise())\n .then(() => {\n this.lazyLoadQueue.setAllSeen();\n });\n\n // this.setStickyDateManually();\n };\n\n public renderMessagesQueue(options: ReturnType) {\n return this.batchProcessor.addToQueue(options);\n }\n\n private ejectBubbles() {\n for(const bubble of this.bubblesToEject) {\n bubble.remove();\n // this.bubbleGroups.removeAndUnmountBubble(bubble);\n }\n\n this.bubblesToEject.clear();\n }\n\n public groupBubbles(items: Array<{\n // Awaited> &\n bubble: HTMLElement,\n message: Message.message | Message.messageService\n }/* & {\n unmountIfFound?: boolean\n } */>) {\n let modifiedGroups: typeof groups;\n\n if(this.chat.type === 'scheduled') {\n modifiedGroups = new Set();\n items.forEach(({bubble, message}) => {\n const item = this.bubbleGroups.getItemByBubble(bubble);\n const group = item?.group;\n if(group && item.message.date !== message.date) {\n this.bubbleGroups.removeItem(item);\n modifiedGroups.add(group);\n }\n });\n }\n\n items.forEach(({bubble, message}) => {\n this.bubbleGroups.prepareForGrouping(bubble, message);\n });\n\n const groups = this.bubbleGroups.groupUngrouped();\n\n const avatarPromises = Array.from(groups).map((group) => {\n if(group.avatar) return;\n const firstItem = group.firstItem;\n if(firstItem && this.chat.isAvatarNeeded(firstItem.message)) {\n return group.createAvatar(firstItem.message);\n }\n }).filter(Boolean);\n\n if(modifiedGroups) {\n for(const group of modifiedGroups) {\n groups.add(group);\n }\n }\n\n return {\n groups: [...groups],\n avatarPromises\n };\n }\n\n public getMiddleware(additionalCallback?: () => boolean) {\n return this.middlewareHelper.get(additionalCallback);\n }\n\n private async wrapMediaSpoiler({\n media,\n promise,\n middleware,\n attachmentDiv\n }: {\n media: Photo.photo | MyDocument,\n promise: Promise,\n middleware: Middleware,\n attachmentDiv: HTMLElement\n }) {\n await promise;\n if(!middleware()) {\n return;\n }\n\n const {width, height} = attachmentDiv.style;\n const container = await wrapMediaSpoiler({\n media,\n width: parseInt(width),\n height: parseInt(height),\n middleware,\n animationGroup: this.chat.animationGroup\n });\n\n if(!middleware()) {\n return;\n }\n\n attachmentDiv.append(container);\n }\n\n private async safeRenderMessage(\n message: Message.message | Message.messageService,\n reverse?: boolean,\n bubble?: HTMLElement,\n updatePosition = true,\n processResult?: (result: ReturnType, bubble: HTMLElement) => typeof result\n ) {\n if(!message || this.renderingMessages.has(message.mid) || (this.bubbles[message.mid] && !bubble)) {\n return;\n }\n\n const middlewareHelper = this.getMiddleware().create();\n const middleware = middlewareHelper.get();\n\n let result: Awaited> & {updatePosition: typeof updatePosition};\n try {\n this.renderingMessages.add(message.mid);\n\n // const groupedId = (message as Message.message).grouped_id;\n const newBubble = document.createElement('div');\n newBubble.middlewareHelper = middlewareHelper;\n newBubble.dataset.mid = '' + message.mid;\n newBubble.dataset.peerId = '' + message.peerId;\n newBubble.dataset.timestamp = '' + message.date;\n\n // const bubbleNew: Bubble = this.bubblesNew[message.mid] ??= {\n // bubble: newBubble,\n // mids: new Set(),\n // groupedId\n // };\n\n // bubbleNew.mids.add(message.mid);\n\n if(bubble) {\n bubble.middlewareHelper.destroy();\n this.skippedMids.delete(message.mid);\n\n this.bubblesToEject.add(bubble);\n this.bubblesToReplace.delete(bubble);\n this.bubblesToReplace.set(newBubble, bubble);\n this.bubbleGroups.changeBubbleByBubble(bubble, newBubble);\n }\n\n bubble = this.bubbles[message.mid] = newBubble;\n let originalPromise = this.renderMessage(message, reverse, bubble, middleware);\n if(processResult) {\n originalPromise = processResult(originalPromise, bubble);\n }\n\n const promise = originalPromise.then((r) => ((r && middleware() ? {...r, updatePosition} : undefined) as typeof result));\n\n this.renderMessagesQueue(promise.catch(() => undefined));\n\n result = await promise;\n if(!middleware()) {\n return;\n }\n\n if(!result) {\n this.skippedMids.add(+message.mid);\n }\n } catch(err) {\n this.log.error('renderMessage error:', err);\n }\n\n if(!middleware()) {\n return;\n }\n\n this.renderingMessages.delete(message.mid);\n return result;\n }\n\n // reverse means top\n private async renderMessage(\n message: Message.message | Message.messageService,\n reverse = false,\n bubble: HTMLElement,\n middleware: Middleware\n ) {\n // if(DEBUG) {\n // this.log('message to render:', message);\n // }\n\n // if(!bubble && this.bubbles[message.mid]) {\n // return;\n // }\n\n // await pause(1000);\n\n const isMessage = message._ === 'message';\n const groupedId = isMessage && message.grouped_id;\n let albumMids: number[], reactionsMessage: Message.message;\n const albumMessages = groupedId ? await this.managers.appMessagesManager.getMessagesByAlbum(groupedId) : undefined;\n\n const albumMustBeRenderedFull = this.chat.type !== 'pinned';\n\n if(groupedId && albumMustBeRenderedFull) { // will render only last album's message\n albumMids = albumMessages.map((message) => message.mid);\n const mainMid = getMainMidForGrouped(albumMids);\n if(message.mid !== mainMid) {\n return;\n }\n }\n\n if(isMessage) {\n reactionsMessage = groupedId ? albumMessages[0] : message;\n }\n\n // * can't use 'message.pFlags.out' here because this check will be used to define side of message (left-right)\n const our = this.chat.isOurMessage(message);\n\n const messageDiv = document.createElement('div');\n messageDiv.classList.add('message', 'spoilers-container');\n\n const contentWrapper = document.createElement('div');\n contentWrapper.classList.add('bubble-content-wrapper');\n\n const bubbleContainer = document.createElement('div');\n bubbleContainer.classList.add('bubble-content');\n\n bubble.classList.add('bubble');\n contentWrapper.append(bubbleContainer);\n bubble.append(contentWrapper);\n\n let isInUnread = !our &&\n !message.pFlags.out &&\n (\n message.pFlags.unread ||\n isMentionUnread(message)\n );\n\n if(!isInUnread && this.chat.peerId.isAnyChat()) {\n const readMaxId = await this.managers.appMessagesManager.getReadMaxIdIfUnread(this.chat.peerId, this.chat.threadId);\n if(readMaxId !== undefined && readMaxId < message.mid) {\n isInUnread = true;\n }\n }\n\n if(isInUnread && this.observer) {\n // this.log('not our message', message, message.pFlags.unread);\n this.observer.observe(bubble, this.unreadedObserverCallback);\n this.unreaded.set(bubble, message.mid);\n }\n\n const loadPromises: Promise[] = [];\n const ret = {\n bubble,\n promises: loadPromises,\n message,\n reverse\n };\n\n const wrapOptions: WrapSomethingOptions = {\n lazyLoadQueue: this.lazyLoadQueue,\n middleware,\n customEmojiSize: this.chat.appImManager.customEmojiSize,\n animationGroup: this.chat.animationGroup\n };\n\n if(message._ === 'messageService' && (!message.action || !SERVICE_AS_REGULAR.has(message.action._))) {\n const action = message.action;\n if(action) {\n const _ = action._;\n\n const ignoreAction = IGNORE_ACTIONS.get(_);\n if(ignoreAction && (ignoreAction === true || ignoreAction(message))) {\n return;\n }\n\n if(langPack.hasOwnProperty(_) && !langPack[_]) {\n return;\n }\n }\n\n bubble.className = 'bubble service';\n\n bubbleContainer.innerHTML = '';\n const s = document.createElement('div');\n s.classList.add('service-msg');\n if(action) {\n let promise: Promise;\n if(action._ === 'messageActionChannelMigrateFrom') {\n const peerTitle = new PeerTitle();\n promise = peerTitle.update({peerId: action.chat_id.toPeerId(true), wrapOptions});\n s.append(i18n('ChatMigration.From', [peerTitle.element]));\n } else if(action._ === 'messageActionChatMigrateTo') {\n const peerTitle = new PeerTitle();\n promise = peerTitle.update({peerId: action.channel_id.toPeerId(true), wrapOptions});\n s.append(i18n('ChatMigration.To', [peerTitle.element]));\n } else {\n s.append(await wrapMessageActionTextNew({\n message,\n ...wrapOptions\n }));\n }\n }\n bubbleContainer.append(s);\n\n if(message.pFlags.is_single) { // * Ignore 'Discussion started'\n bubble.classList.add('is-group-last');\n }\n\n return ret;\n }\n\n let messageMedia: MessageMedia = isMessage && message.media;\n let needToSetHTML = true;\n let messageMessage: string, totalEntities: MessageEntity[], albumTextMessage: Message.message;\n if(isMessage) {\n if(groupedId && albumMustBeRenderedFull) {\n const t = albumTextMessage = getAlbumText(albumMessages);\n messageMessage = t?.message || '';\n // totalEntities = t.entities;\n totalEntities = t?.totalEntities || [];\n } else {\n messageMessage = message.message;\n // totalEntities = message.entities;\n totalEntities = message.totalEntities;\n }\n\n const document = (messageMedia as MessageMedia.messageMediaDocument)?.document as MyDocument;\n if(document) {\n if(document?.type === 'sticker') {\n messageMessage = totalEntities = undefined;\n } else if(!['video', 'gif'].includes(document.type)) {\n needToSetHTML = false;\n }\n }\n } else {\n if(message.action._ === 'messageActionPhoneCall') {\n messageMedia = {\n _: 'messageMediaCall',\n action: message.action\n };\n }\n }\n\n let bigEmojis = 0, customEmojiSize: MediaSize;\n if(totalEntities && !messageMedia) {\n const emojiEntities = totalEntities.filter((e) => e._ === 'messageEntityEmoji'/* || e._ === 'messageEntityCustomEmoji' */);\n const strLength = messageMessage.replace(/\\s/g, '').length;\n const emojiStrLength = emojiEntities.reduce((acc, curr) => acc + curr.length, 0);\n\n if(emojiStrLength === strLength /* && emojiEntities.length <= 3 *//* && totalEntities.length === emojiEntities.length */) {\n bigEmojis = Math.min(BIG_EMOJI_SIZES_LENGTH, emojiEntities.length);\n\n customEmojiSize = mediaSizes.active.customEmoji;\n\n const size = BIG_EMOJI_SIZES[bigEmojis];\n if(size) {\n customEmojiSize = makeMediaSize(size, size);\n bubble.style.setProperty('--emoji-size', size + 'px');\n }\n }\n }\n\n customEmojiSize ??= this.chat.appImManager.customEmojiSize;\n\n const maxMediaTimestamp = getMediaDurationFromMessage(albumTextMessage || message as Message.message);\n if(albumTextMessage && needToSetHTML) {\n bubble.dataset.textMid = '' + albumTextMessage.mid;\n }\n\n const richTextOptions: Parameters[1] = {\n entities: totalEntities,\n passEntities: this.passEntities,\n loadPromises,\n lazyLoadQueue: this.lazyLoadQueue,\n customEmojiSize,\n middleware,\n animationGroup: this.chat.animationGroup,\n maxMediaTimestamp\n };\n\n const richText = messageMessage ? wrapRichText(messageMessage, richTextOptions) : '';\n\n let canHaveTail = true;\n let isStandaloneMedia = false;\n let attachmentDiv: HTMLElement;\n if(bigEmojis) {\n if(rootScope.settings.emoji.big) {\n const sticker = bigEmojis === 1 &&\n !totalEntities.find((entity) => entity._ === 'messageEntityCustomEmoji') &&\n await this.managers.appStickersManager.getAnimatedEmojiSticker(messageMessage);\n if(bigEmojis === 1 && !messageMedia && sticker) {\n messageMedia = {\n _: 'messageMediaDocument',\n document: sticker,\n pFlags: {}\n };\n } else {\n attachmentDiv = document.createElement('div');\n attachmentDiv.classList.add('attachment', 'spoilers-container');\n\n setInnerHTML(attachmentDiv, richText);\n\n bubbleContainer.append(attachmentDiv);\n }\n\n bubble.classList.add('is-message-empty', 'emoji-big');\n isStandaloneMedia = true;\n canHaveTail = false;\n needToSetHTML = false;\n }\n\n bubble.classList.add('can-have-big-emoji');\n }\n\n if(needToSetHTML) {\n setInnerHTML(messageDiv, richText);\n }\n\n const haveRTLChar = isRTL(messageMessage, true);\n\n const timeSpan = MessageRender.setTime({\n chatType: this.chat.type,\n message,\n reactionsMessage\n });\n messageDiv.append(timeSpan);\n bubbleContainer.prepend(messageDiv);\n // bubble.prepend(timeSpan, messageDiv); // that's bad\n\n if(haveRTLChar) {\n timeSpan.classList.add('is-block');\n }\n\n let topicNameButtonContainer: HTMLElement;\n if(isMessage && this.chat.isAllMessagesForum) {\n const result = await wrapTopicNameButton({\n peerId: this.peerId,\n threadId: getMessageThreadId(message, this.chat.isForum),\n lastMsgId: message.mid,\n wrapOptions: {\n middleware\n },\n withIcons: true\n });\n\n const {element} = result;\n // if(isStandaloneMedia) {\n // element.classList.add('floating-part');\n // }\n\n topicNameButtonContainer = document.createElement('div');\n topicNameButtonContainer.classList.add(/* 'name', */'topic-name-button-container');\n topicNameButtonContainer.append(element);\n }\n\n if(isMessage && message.views) {\n bubble.classList.add('channel-post');\n\n if(!message.fwd_from?.saved_from_msg_id && this.chat.type !== 'pinned') {\n const forward = document.createElement('div');\n forward.classList.add('bubble-beside-button', 'forward', 'tgico-forward_filled');\n bubbleContainer.prepend(forward);\n bubble.classList.add('with-beside-button');\n }\n\n if(!message.pFlags.is_outgoing && this.observer) {\n this.observer.observe(bubble, this.viewsObserverCallback);\n }\n }\n\n const replyMarkup = isMessage && message.reply_markup;\n let replyMarkupRows = replyMarkup?._ === 'replyInlineMarkup' && replyMarkup.rows;\n if(replyMarkupRows) {\n replyMarkupRows = replyMarkupRows.filter((row) => row.buttons.length);\n }\n\n if(replyMarkupRows) {\n const containerDiv = document.createElement('div');\n containerDiv.classList.add('reply-markup');\n replyMarkupRows.forEach((row) => {\n const buttons = row.buttons;\n\n const rowDiv = document.createElement('div');\n rowDiv.classList.add('reply-markup-row');\n\n buttons.forEach((button) => {\n let text: DocumentFragment | HTMLElement | string = wrapRichText(button.text, {noLinks: true, noLinebreaks: true});\n\n let buttonEl: HTMLButtonElement | HTMLAnchorElement;\n\n switch(button._) {\n case 'keyboardButtonUrl': {\n const r = wrapRichText(' ', {\n entities: [{\n _: 'messageEntityTextUrl',\n length: 1,\n offset: 0,\n url: button.url\n }]\n });\n\n buttonEl = htmlToDocumentFragment(r).firstElementChild as HTMLAnchorElement;\n buttonEl.classList.add('is-link');\n\n break;\n }\n\n case 'keyboardButtonSwitchInline': {\n buttonEl = document.createElement('button');\n buttonEl.classList.add('is-switch-inline');\n attachClickEvent(buttonEl, (e) => {\n cancelEvent(e);\n\n const botId = message.viaBotId || message.fromId;\n let promise: Promise;\n if(button.pFlags.same_peer) promise = Promise.resolve(this.peerId);\n else promise = this.managers.appInlineBotsManager.checkSwitchReturn(botId).then((peerId) => {\n if(peerId) {\n return peerId;\n }\n\n return new Promise((resolve, reject) => {\n const popup = new PopupForward(undefined, (peerId) => {\n resolve(peerId);\n });\n\n popup.addEventListener('close', () => {\n reject();\n });\n });\n });\n\n promise.then((peerId) => {\n const threadId = this.peerId === peerId ? this.chat.threadId : undefined;\n this.chat.appImManager.setInnerPeer({peerId});\n this.managers.appInlineBotsManager.switchInlineQuery(peerId, threadId, botId, button.query);\n });\n });\n break;\n }\n\n case 'keyboardButtonBuy': {\n const mediaInvoice = messageMedia._ === 'messageMediaInvoice' ? messageMedia : undefined;\n if(mediaInvoice?.extended_media) {\n break;\n }\n\n buttonEl = document.createElement('button');\n buttonEl.classList.add('is-buy');\n\n if(mediaInvoice?.receipt_msg_id) {\n text = i18n('Message.ReplyActionButtonShowReceipt');\n }\n\n break;\n }\n\n case 'keyboardButtonUrlAuth': {\n buttonEl = document.createElement('button');\n buttonEl.classList.add('is-url-auth');\n\n const {peerId} = this;\n const {mid} = message;\n const {url, button_id} = button;\n\n attachClickEvent(buttonEl, () => {\n const toggle = toggleDisability([buttonEl], true);\n this.chat.appImManager.handleUrlAuth({\n peerId,\n mid,\n url,\n buttonId: button_id\n }).then(() => {\n toggle();\n });\n });\n break;\n }\n\n default: {\n buttonEl = document.createElement('button');\n break;\n }\n }\n\n if(!buttonEl) {\n return;\n }\n\n buttonEl.classList.add('reply-markup-button', 'rp', 'tgico');\n const t = document.createElement('span');\n t.classList.add('reply-markup-button-text');\n if(typeof(text) === 'string') {\n t.insertAdjacentHTML('beforeend', text);\n } else {\n t.append(text);\n }\n\n ripple(buttonEl);\n buttonEl.append(t);\n\n rowDiv.append(buttonEl);\n });\n\n if(!rowDiv.childElementCount) {\n return;\n }\n\n containerDiv.append(rowDiv);\n });\n\n const haveButtons = !!containerDiv.childElementCount;\n\n haveButtons && attachClickEvent(containerDiv, (e) => {\n let target = e.target as HTMLElement;\n\n if(!target.classList.contains('reply-markup-button')) target = findUpClassName(target, 'reply-markup-button');\n if(\n !target ||\n target.classList.contains('is-link') ||\n target.classList.contains('is-switch-inline') ||\n target.classList.contains('is-buy') ||\n target.classList.contains('is-url-auth')\n ) return;\n\n cancelEvent(e);\n\n const column = whichChild(target);\n const row = replyMarkupRows[whichChild(target.parentElement)];\n\n if(!row.buttons || !row.buttons[column]) {\n this.log.warn('no such button', row, column, message);\n return;\n }\n\n const button = row.buttons[column];\n this.managers.appInlineBotsManager.callbackButtonClick(this.peerId, message.mid, button).then((callbackAnswer) => {\n if(typeof callbackAnswer.message === 'string' && callbackAnswer.message.length) {\n toast(wrapRichText(callbackAnswer.message, {noLinks: true, noLinebreaks: true}));\n }\n\n // console.log('callbackButtonClick callbackAnswer:', callbackAnswer);\n });\n });\n\n if(haveButtons) {\n // canHaveTail = false;\n bubble.classList.add('with-reply-markup');\n contentWrapper.append(containerDiv);\n }\n }\n\n const isOutgoing = message.pFlags.is_outgoing/* && this.peerId !== rootScope.myId */;\n if(our) {\n if(message.pFlags.unread || isOutgoing) this.unreadOut.add(message.mid);\n let status = '';\n if(message.error) status = 'is-error';\n else if(isOutgoing) status = 'is-sending';\n else status = message.pFlags.unread || (message as Message.message).pFlags.is_scheduled ? 'is-sent' : 'is-read';\n bubble.classList.add(status);\n }\n\n if(isOutgoing && !message.error) {\n bubble.classList.add('is-outgoing');\n }\n\n const messageWithReplies = isMessage && await this.managers.appMessagesManager.getMessageWithCommentReplies(message);\n const withReplies = !!messageWithReplies && message.mid > 0;\n\n if(withReplies) {\n bubble.classList.add('with-replies');\n }\n\n const fwdFrom = isMessage && message.fwd_from;\n const fwdFromId = isMessage && message.fwdFromId;\n\n const isOut = this.chat.isOutMessage(message);\n let nameContainer: HTMLElement = bubbleContainer;\n\n const canHideNameIfMedia = !message.viaBotId && (message.fromId === rootScope.myId || !message.pFlags.out);\n\n const isMessageEmpty = !messageMessage/* && (!topicNameButtonContainer || isStandaloneMedia) */;\n\n let viewButton: HTMLAnchorElement;\n // media\n if(messageMedia/* && messageMedia._ === 'messageMediaPhoto' */) {\n attachmentDiv = document.createElement('div');\n attachmentDiv.classList.add('attachment');\n\n if(isMessageEmpty) {\n bubble.classList.add('is-message-empty');\n }\n\n let processingWebPage = false;\n\n /* if(isMessage) */switch(messageMedia._) {\n case 'messageMediaPhoto': {\n const photo = messageMedia.photo;\n // //////this.log('messageMediaPhoto', photo);\n\n if(isMessageEmpty) {\n canHaveTail = false;\n }\n\n if(canHideNameIfMedia) {\n bubble.classList.add('hide-name');\n }\n\n bubble.classList.add('photo');\n\n if(albumMustBeRenderedFull && groupedId && albumMids.length !== 1) {\n bubble.classList.add('is-album', 'is-grouped');\n wrapAlbum({\n messages: albumMessages,\n attachmentDiv,\n middleware: this.getMiddleware(),\n isOut: our,\n lazyLoadQueue: this.lazyLoadQueue,\n chat: this.chat,\n loadPromises,\n autoDownload: this.chat.autoDownload\n });\n\n break;\n }\n\n const withTail = !IS_ANDROID && canHaveTail && !withReplies && USE_MEDIA_TAILS;\n if(withTail) bubble.classList.add('with-media-tail');\n const p = wrapPhoto({\n photo: photo as Photo.photo,\n message,\n container: attachmentDiv,\n withTail,\n isOut,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware: this.getMiddleware(),\n loadPromises,\n autoDownloadSize: this.chat.autoDownload.photo\n });\n\n if(messageMedia.pFlags.spoiler) {\n loadPromises.push(this.wrapMediaSpoiler({\n media: photo as Photo.photo,\n promise: p,\n middleware,\n attachmentDiv\n }));\n }\n\n break;\n }\n\n case 'messageMediaWebPage': {\n processingWebPage = true;\n\n const webPage: WebPage = messageMedia.webpage;\n // //////this.log('messageMediaWebPage', webpage);\n if(webPage._ !== 'webPage') {\n break;\n }\n\n const wrapped = wrapUrl(webPage.url);\n if(wrapped?.onclick === 'im') {\n const map: {[type: string]: LangPackKey} = {\n telegram_channel: 'Chat.Message.ViewChannel',\n telegram_megagroup: 'OpenGroup',\n telegram_bot: 'Chat.Message.ViewBot'\n };\n\n const langPackKey = map[webPage.type] || 'OpenMessage';\n viewButton = this.makeViewButton({text: langPackKey, asLink: true});\n viewButton.href = wrapped.url;\n viewButton.setAttribute('onclick', `${wrapped.onclick}(this)`);\n }\n\n bubble.classList.add('webpage');\n\n const box = document.createElement('div');\n box.classList.add('web');\n\n const quote = document.createElement('div');\n quote.classList.add('quote');\n\n let previewResizer: HTMLDivElement, preview: HTMLDivElement;\n const photo: Photo.photo = webPage.photo as any;\n if(photo || webPage.document) {\n previewResizer = document.createElement('div');\n previewResizer.classList.add('preview-resizer');\n preview = document.createElement('div');\n preview.classList.add('preview');\n previewResizer.append(preview);\n }\n\n const quoteTextDiv = document.createElement('div');\n quoteTextDiv.classList.add('quote-text');\n\n const doc = webPage.document as MyDocument;\n if(doc) {\n if(doc.type === 'gif' || doc.type === 'video' || doc.type === 'round') {\n // if(doc.size <= 20e6) {\n const mediaSize = doc.type === 'round' ? mediaSizes.active.round : mediaSizes.active.webpage;\n if(doc.type === 'round') {\n bubble.classList.add('round');\n preview.classList.add('is-round');\n } else {\n bubble.classList.add('video');\n }\n wrapVideo({\n doc,\n container: preview,\n message: message as Message.message,\n boxWidth: mediaSize.width,\n boxHeight: mediaSize.height,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware: this.getMiddleware(),\n isOut,\n group: this.chat.animationGroup,\n loadPromises,\n autoDownload: this.chat.autoDownload,\n noInfo: message.mid < 0\n });\n // }\n } else {\n const docDiv = await wrapDocument({\n message: message as Message.message,\n autoDownloadSize: this.chat.autoDownload.file,\n lazyLoadQueue: this.lazyLoadQueue,\n loadPromises,\n sizeType: 'documentName',\n searchContext: {\n useSearch: false,\n peerId: this.peerId,\n inputFilter: {\n _: 'inputMessagesFilterEmpty'\n }\n },\n fontSize: rootScope.settings.messagesTextSize,\n canTranscribeVoice: true\n });\n preview.append(docDiv);\n preview.classList.add('preview-with-document');\n quoteTextDiv.classList.add('has-document');\n // messageDiv.classList.add((webpage.type || 'document') + '-message');\n // doc = null;\n }\n }\n\n if(previewResizer) {\n quoteTextDiv.append(previewResizer);\n }\n\n let t: HTMLElement;\n if(webPage.site_name) {\n const html = wrapRichText(webPage.url);\n const a: HTMLAnchorElement = htmlToDocumentFragment(html).firstElementChild as any;\n a.classList.add('webpage-name');\n const strong = document.createElement('strong');\n setInnerHTML(strong, wrapEmojiText(webPage.site_name));\n a.textContent = '';\n a.append(strong);\n quoteTextDiv.append(a);\n t = a;\n }\n\n const title = wrapWebPageTitle(webPage);\n if(title.textContent) {\n const titleDiv = document.createElement('div');\n titleDiv.classList.add('title');\n const strong = document.createElement('strong');\n setInnerHTML(strong, title);\n titleDiv.append(strong);\n quoteTextDiv.append(titleDiv);\n t = titleDiv;\n }\n\n const description = wrapWebPageDescription(webPage);\n if(description.textContent) {\n const textDiv = document.createElement('div');\n textDiv.classList.add('text');\n setInnerHTML(textDiv, description);\n quoteTextDiv.append(textDiv);\n t = textDiv;\n }\n\n /* if(t) {\n t.append(timeSpan);\n } else {\n box.classList.add('no-text');\n } */\n\n quote.append(quoteTextDiv);\n\n if(photo && !doc) {\n bubble.classList.add('photo');\n\n const size: PhotoSize.photoSize = photo.sizes[photo.sizes.length - 1] as any;\n let isSquare = false;\n if(size.w === size.h && t) {\n bubble.classList.add('is-square-photo');\n isSquare = true;\n setAttachmentSize(photo, preview, 48, 48, false);\n\n /* if(t) {\n t.append(timeSpan);\n } */\n } else if(size.h > size.w) {\n bubble.classList.add('is-vertical-photo');\n }\n\n wrapPhoto({\n photo,\n message,\n container: preview,\n boxWidth: isSquare ? 0 : mediaSizes.active.webpage.width,\n boxHeight: isSquare ? 0 : mediaSizes.active.webpage.height,\n isOut,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware: this.getMiddleware(),\n loadPromises,\n withoutPreloader: isSquare,\n autoDownloadSize: this.chat.autoDownload.photo\n });\n }\n\n box.append(quote);\n\n // bubble.prepend(box);\n // if(timeSpan.parentElement === messageDiv) {\n messageDiv.insertBefore(box, timeSpan);\n // } else {\n // messageDiv.append(box);\n // }\n\n // this.log('night running', bubble.scrollHeight);\n\n break;\n }\n\n case 'messageMediaDocument': {\n const doc = messageMedia.document as MyDocument;\n\n // this.log('messageMediaDocument', doc, bubble);\n\n if(doc.sticker/* && doc.size <= 1e6 */) {\n bubble.classList.add('sticker');\n canHaveTail = false;\n isStandaloneMedia = true;\n\n if(doc.animated) {\n bubble.classList.add('sticker-animated');\n }\n\n const sizes = mediaSizes.active;\n const isEmoji = bubble.classList.contains('emoji-big');\n const boxSize = isEmoji ? sizes.emojiSticker : (doc.animated ? sizes.animatedSticker : sizes.staticSticker);\n setAttachmentSize(doc, attachmentDiv, boxSize.width, boxSize.height);\n // let preloader = new ProgressivePreloader(attachmentDiv, false);\n bubbleContainer.style.minWidth = attachmentDiv.style.width;\n bubbleContainer.style.minHeight = attachmentDiv.style.height;\n // appPhotosManager.setAttachmentSize(doc, bubble);\n wrapSticker({\n doc,\n div: attachmentDiv,\n middleware,\n lazyLoadQueue: this.lazyLoadQueue,\n group: this.chat.animationGroup,\n // play: !!message.pending || !multipleRender,\n play: true,\n liteModeKey: 'stickers_chat',\n loop: true,\n emoji: isEmoji ? messageMessage : undefined,\n withThumb: true,\n loadPromises,\n isOut,\n noPremium: messageMedia?.pFlags?.nopremium\n });\n\n if((getStickerEffectThumb(doc) || isEmoji) && (isInUnread || isOutgoing)/* || true */) {\n this.observer.observe(bubble, this.stickerEffectObserverCallback);\n }\n } else if(doc.type === 'video' || doc.type === 'gif' || doc.type === 'round'/* && doc.size <= 20e6 */) {\n // this.log('never get free 2', doc);\n\n const isRound = doc.type === 'round';\n if(isRound) {\n isStandaloneMedia = true;\n }\n\n if(isRound || isMessageEmpty) {\n canHaveTail = false;\n }\n\n if(canHideNameIfMedia) {\n bubble.classList.add('hide-name');\n }\n\n bubble.classList.add(isRound ? 'round' : 'video');\n if(albumMustBeRenderedFull && groupedId && albumMids.length !== 1) {\n bubble.classList.add('is-album', 'is-grouped');\n\n wrapAlbum({\n messages: albumMessages,\n attachmentDiv,\n middleware,\n isOut: our,\n lazyLoadQueue: this.lazyLoadQueue,\n chat: this.chat,\n loadPromises,\n autoDownload: this.chat.autoDownload\n });\n } else {\n const withTail = !IS_ANDROID && !IS_APPLE && !isRound && canHaveTail && !withReplies && USE_MEDIA_TAILS;\n if(withTail) bubble.classList.add('with-media-tail');\n const p = wrapVideo({\n doc,\n container: attachmentDiv,\n message: message as Message.message,\n boxWidth: mediaSizes.active.regular.width,\n boxHeight: mediaSizes.active.regular.height,\n withTail,\n isOut,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware,\n group: this.chat.animationGroup,\n loadPromises,\n autoDownload: this.chat.autoDownload,\n searchContext: isRound ? {\n peerId: this.peerId,\n inputFilter: {_: 'inputMessagesFilterRoundVoice'},\n threadId: this.chat.threadId,\n useSearch: !(message as Message.message).pFlags.is_scheduled,\n isScheduled: (message as Message.message).pFlags.is_scheduled\n } : undefined,\n noInfo: message.mid < 0,\n noAutoplayAttribute: !!messageMedia.pFlags.spoiler\n });\n\n if(messageMedia.pFlags.spoiler) {\n loadPromises.push(this.wrapMediaSpoiler({\n media: doc,\n promise: p,\n middleware,\n attachmentDiv\n }));\n }\n }\n } else {\n const newNameContainer = await wrapGroupedDocuments({\n albumMustBeRenderedFull,\n message,\n bubble,\n messageDiv,\n chat: this.chat,\n loadPromises,\n autoDownloadSize: this.chat.autoDownload.file,\n lazyLoadQueue: this.lazyLoadQueue,\n searchContext: doc.type === 'voice' || doc.type === 'audio' ? {\n peerId: this.peerId,\n inputFilter: {_: doc.type === 'voice' ? 'inputMessagesFilterRoundVoice' : 'inputMessagesFilterMusic'},\n threadId: this.chat.threadId,\n useSearch: !(message as Message.message).pFlags.is_scheduled,\n isScheduled: (message as Message.message).pFlags.is_scheduled\n } : undefined,\n sizeType: 'documentName',\n fontSize: rootScope.settings.messagesTextSize,\n richTextFragment: typeof(richText) === 'string' ? undefined : richText,\n richTextOptions,\n canTranscribeVoice: true\n });\n\n if(newNameContainer) {\n nameContainer = newNameContainer;\n }\n\n const lastContainer = messageDiv.lastElementChild.querySelector('.document-message, .document, .audio');\n // lastContainer && lastContainer.append(timeSpan.cloneNode(true));\n lastContainer && lastContainer.append(timeSpan);\n\n bubble.classList.remove('is-message-empty');\n const addClassName = (!(['photo', 'pdf'] as MyDocument['type'][]).includes(doc.type) ? doc.type || 'document' : 'document') + '-message';\n messageDiv.classList.add(addClassName);\n\n if(doc.type === 'audio' || doc.type === 'voice') {\n bubble.classList.add('min-content');\n }\n\n processingWebPage = true;\n }\n\n break;\n }\n\n case 'messageMediaCall': {\n const action = messageMedia.action;\n const div = document.createElement('div');\n div.classList.add('bubble-call', action.pFlags.video ? 'tgico-videocamera' : 'tgico-phone');\n\n const type: CallType = action.pFlags.video ? 'video' : 'voice';\n div.dataset.type = type;\n\n const title = document.createElement('div');\n title.classList.add('bubble-call-title');\n\n _i18n(title, isOut ?\n (action.pFlags.video ? 'CallMessageVideoOutgoing' : 'CallMessageOutgoing') :\n (action.pFlags.video ? 'CallMessageVideoIncoming' : 'CallMessageIncoming'));\n\n const subtitle = document.createElement('div');\n subtitle.classList.add('bubble-call-subtitle');\n\n if(action.duration !== undefined) {\n subtitle.append(formatCallDuration(action.duration));\n } else {\n let langPackKey: LangPackKey;\n switch(action.reason._) {\n case 'phoneCallDiscardReasonBusy':\n langPackKey = 'Call.StatusBusy';\n break;\n case 'phoneCallDiscardReasonMissed':\n langPackKey = 'Chat.Service.Call.Missed';\n break;\n // case 'phoneCallDiscardReasonHangup':\n default:\n langPackKey = 'Chat.Service.Call.Cancelled';\n break;\n }\n\n subtitle.classList.add('is-reason');\n _i18n(subtitle, langPackKey);\n }\n\n subtitle.classList.add('tgico', 'arrow-' + (action.duration !== undefined ? 'green' : 'red'));\n\n div.append(title, subtitle);\n\n processingWebPage = true;\n\n bubble.classList.remove('is-message-empty');\n messageDiv.classList.add('call-message');\n messageDiv.append(div);\n\n break;\n }\n\n case 'messageMediaContact': {\n // this.log('wrapping contact', message);\n\n const contact = messageMedia;\n const contactDiv = document.createElement('div');\n contactDiv.classList.add('contact');\n contactDiv.dataset.peerId = '' + contact.user_id;\n\n processingWebPage = true;\n\n const contactDetails = document.createElement('div');\n contactDetails.className = 'contact-details';\n const contactNameDiv = document.createElement('div');\n contactNameDiv.className = 'contact-name';\n const fullName = [\n contact.first_name,\n contact.last_name\n ].filter(Boolean).join(' ');\n contactNameDiv.append(\n fullName.trim() ? wrapEmojiText(fullName) : i18n('AttachContact')\n );\n\n const contactNumberDiv = document.createElement('div');\n contactNumberDiv.className = 'contact-number';\n contactNumberDiv.textContent = contact.phone_number ? '+' + formatPhoneNumber(contact.phone_number).formatted : 'Unknown phone number';\n\n contactDiv.append(contactDetails);\n contactDetails.append(contactNameDiv, contactNumberDiv);\n\n const avatarElem = new AvatarElement();\n avatarElem.updateWithOptions({\n lazyLoadQueue: this.lazyLoadQueue,\n peerId: contact.user_id.toPeerId(),\n peerTitle: contact.user_id ? undefined : (fullName.trim() ? fullName : I18n.format('AttachContact', true)[0])\n });\n avatarElem.classList.add('contact-avatar', 'avatar-54');\n\n contactDiv.prepend(avatarElem);\n\n bubble.classList.remove('is-message-empty');\n messageDiv.classList.add('contact-message');\n messageDiv.append(contactDiv);\n\n break;\n }\n\n case 'messageMediaPoll': {\n bubble.classList.remove('is-message-empty');\n\n const pollElement = wrapPoll(message);\n messageDiv.prepend(pollElement);\n messageDiv.classList.add('poll-message');\n\n break;\n }\n\n case 'messageMediaInvoice': {\n const isTest = messageMedia.pFlags.test;\n const extendedMedia = messageMedia.extended_media;\n const isAlreadyPaid = extendedMedia?._ === 'messageExtendedMedia';\n const isNotPaid = extendedMedia?._ === 'messageExtendedMediaPreview';\n let innerMedia = isAlreadyPaid ?\n (extendedMedia.media as MessageMedia.messageMediaPhoto).photo as Photo.photo ||\n (extendedMedia.media as MessageMedia.messageMediaDocument).document as Document.document :\n messageMedia.photo;\n\n const wrappedPrice = paymentsWrapCurrencyAmount(messageMedia.total_amount, messageMedia.currency);\n let priceEl: HTMLElement;\n if(!extendedMedia) {\n priceEl = document.createElement(innerMedia ? 'span' : 'div');\n const f = document.createDocumentFragment();\n const l = i18n(messageMedia.receipt_msg_id ? 'PaymentReceipt' : (isTest ? 'PaymentTestInvoice' : 'PaymentInvoice'));\n l.classList.add('text-uppercase');\n const joiner = ' ' + NBSP;\n const p = document.createElement('span');\n p.classList.add('text-bold');\n p.textContent = wrappedPrice + joiner;\n f.append(p, l);\n if(isTest && messageMedia.receipt_msg_id) {\n const a = document.createElement('span');\n a.classList.add('text-uppercase', 'pre-wrap');\n a.append(joiner + '(Test)');\n f.append(a);\n }\n setInnerHTML(priceEl, f);\n } else if(isNotPaid) {\n priceEl = document.createElement('span');\n priceEl.classList.add('extended-media-buy', 'tgico-premium_lock');\n attachmentDiv.classList.add('is-buy');\n _i18n(priceEl, 'Checkout.PayPrice', [wrappedPrice]);\n\n if(extendedMedia.video_duration !== undefined) {\n const videoTime = document.createElement('span');\n videoTime.classList.add('video-time');\n videoTime.textContent = toHHMMSS(extendedMedia.video_duration, false);\n attachmentDiv.append(videoTime);\n }\n }\n\n if(isNotPaid) {\n (extendedMedia.thumb as PhotoSize.photoStrippedSize).w = extendedMedia.w;\n (extendedMedia.thumb as PhotoSize.photoStrippedSize).h = extendedMedia.h;\n innerMedia = {\n _: 'photo',\n access_hash: '',\n pFlags: {},\n date: 0,\n dc_id: 0,\n file_reference: [],\n id: 0,\n sizes: [extendedMedia.thumb]\n };\n }\n\n if(innerMedia) {\n const mediaSize = extendedMedia ? mediaSizes.active.extendedInvoice : mediaSizes.active.invoice;\n if(innerMedia._ === 'document') {\n wrapVideo({\n doc: innerMedia,\n container: attachmentDiv,\n withTail: false,\n isOut,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware,\n loadPromises,\n boxWidth: mediaSize.width,\n boxHeight: mediaSize.height,\n group: this.chat.animationGroup,\n message: message as Message.message\n });\n bubble.classList.add('video');\n } else {\n wrapPhoto({\n photo: innerMedia,\n container: attachmentDiv,\n withTail: false,\n isOut,\n lazyLoadQueue: this.lazyLoadQueue,\n middleware,\n loadPromises,\n boxWidth: mediaSize.width,\n boxHeight: mediaSize.height,\n message: isAlreadyPaid ? message : undefined\n });\n bubble.classList.add('photo');\n }\n\n if(priceEl) {\n if(!extendedMedia) {\n priceEl.classList.add('video-time');\n }\n\n attachmentDiv.append(priceEl);\n }\n } else {\n attachmentDiv = undefined;\n }\n\n if(isNotPaid) {\n const {mid} = message;\n this.extendedMediaMessages.add(mid);\n middleware.onClean(() => {\n this.extendedMediaMessages.delete(mid);\n });\n this.setExtendedMediaMessagesPollInterval();\n\n const {width, height} = attachmentDiv.style;\n const dotRenderer = DotRenderer.create({\n width: parseInt(width),\n height: parseInt(height),\n middleware,\n animationGroup: this.chat.animationGroup\n });\n attachmentDiv.append(dotRenderer.canvas);\n }\n\n let titleDiv: HTMLElement;\n if(!extendedMedia) {\n titleDiv = document.createElement('div');\n titleDiv.classList.add('bubble-primary-color');\n setInnerHTML(titleDiv, wrapEmojiText(messageMedia.title));\n }\n\n const richText = isAlreadyPaid ? undefined : wrapEmojiText(messageMedia.description);\n messageDiv.prepend(...[titleDiv, !innerMedia && priceEl, richText].filter(Boolean));\n\n if(!richText) canHaveTail = false;\n else bubble.classList.remove('is-message-empty');\n bubble.classList.add('is-invoice');\n\n break;\n }\n\n default:\n attachmentDiv = undefined;\n bubble.classList.remove('is-message-empty');\n messageDiv.append(i18n(UNSUPPORTED_LANG_PACK_KEY), timeSpan);\n this.log.warn('unrecognized media type:', messageMedia._, message);\n break;\n }\n\n if(!processingWebPage && attachmentDiv) {\n bubbleContainer.append(attachmentDiv);\n }\n\n /* if(bubble.classList.contains('is-message-empty') && (bubble.classList.contains('photo') || bubble.classList.contains('video'))) {\n bubble.classList.add('no-tail');\n\n if(!bubble.classList.contains('with-media-tail')) {\n bubble.classList.add('use-border-radius');\n }\n } */\n }\n\n if(isStandaloneMedia) {\n bubble.classList.add('just-media');\n }\n\n if(viewButton) {\n timeSpan.before(viewButton);\n // messageDiv.append(viewButton);\n }\n\n let savedFrom = '';\n\n // const needName = ((peerId.isAnyChat() && (peerId !== message.fromId || our)) && message.fromId !== rootScope.myId) || message.viaBotId;\n const needName = (message.fromId !== rootScope.myId && this.chat.isAnyGroup) || message.viaBotId || (message as Message.message).pFlags.sponsored;\n if(needName || fwdFrom || message.reply_to_mid || topicNameButtonContainer) { // chat\n let title: HTMLElement | DocumentFragment;\n let titleVia: typeof title;\n\n const isForwardFromChannel = message.from_id?._ === 'peerChannel' && message.fromId === fwdFromId;\n\n const mustHaveName = !!(message.viaBotId/* || topicNameButtonContainer */);\n const isHidden = fwdFrom && !fwdFrom.from_id;\n if(message.viaBotId) {\n titleVia = document.createElement('span');\n titleVia.innerText = '@' + (await this.managers.appPeersManager.getPeerUsername(message.viaBotId));\n titleVia.classList.add('peer-title');\n }\n\n if(mustHaveName) {\n bubble.classList.add('must-have-name');\n }\n\n const isForward = fwdFromId || fwdFrom;\n if(isHidden) {\n // /////this.log('message to render hidden', message);\n title = document.createElement('span');\n setInnerHTML(title, wrapEmojiText(fwdFrom.from_name));\n title.classList.add('peer-title');\n // title = fwdFrom.from_name;\n bubble.classList.add('hidden-profile');\n } else {\n title = new PeerTitle({peerId: fwdFromId || message.fromId, withPremiumIcon: !isForward, wrapOptions}).element;\n }\n\n let replyContainer: HTMLElement;\n if(\n isMessage &&\n message.reply_to_mid &&\n message.reply_to_mid !== this.chat.threadId &&\n (!this.chat.isAllMessagesForum || message.reply_to.reply_to_top_id)\n ) {\n replyContainer = await MessageRender.setReply({\n chat: this.chat,\n bubble,\n bubbleContainer,\n message\n });\n }\n\n // this.log(title);\n\n let nameDiv: HTMLElement;\n if(isForward) {\n if(this.peerId !== rootScope.myId && !isForwardFromChannel) {\n bubble.classList.add('forwarded');\n }\n\n if(message.savedFrom) {\n savedFrom = message.savedFrom;\n title.dataset.savedFrom = savedFrom;\n }\n\n nameDiv = document.createElement('div');\n title.dataset.peerId = '' + fwdFromId;\n\n if((this.peerId === rootScope.myId || this.peerId === REPLIES_PEER_ID || isForwardFromChannel) && !isStandaloneMedia) {\n nameDiv.style.color = getPeerColorById(fwdFromId, false);\n nameDiv.classList.add('colored-name');\n nameDiv.append(title);\n } else {\n /* const fromTitle = message.fromId === this.myID || appPeersManager.isBroadcast(fwdFromId || message.fromId) ? '' : `
${appPeersManager.getPeerTitle(message.fromId)}
`;\n nameDiv.innerHTML = fromTitle + 'Forwarded from ' + title; */\n const args: FormatterArguments = [title];\n if(isStandaloneMedia) {\n const br = document.createElement('br');\n br.classList.add('hide-ol');\n args.unshift(br);\n }\n nameDiv.append(i18n('ForwardedFrom', [args]));\n }\n } else if(!message.viaBotId) {\n if(!isStandaloneMedia && needName) {\n nameDiv = document.createElement('div');\n nameDiv.append(title);\n\n const peer = await this.managers.appPeersManager.getPeer(message.fromId);\n const pFlags = (peer as User.user)?.pFlags;\n if(pFlags && (pFlags.scam || pFlags.fake)) {\n nameDiv.append(generateFakeIcon(pFlags.scam));\n }\n\n if(!our) {\n nameDiv.style.color = getPeerColorById(message.fromId, false);\n nameDiv.classList.add('colored-name');\n }\n\n nameDiv.dataset.peerId = '' + message.fromId;\n } else /* if(!message.reply_to_mid) */ {\n bubble.classList.add('hide-name');\n }\n }\n\n if(message.viaBotId) {\n if(!nameDiv) {\n nameDiv = document.createElement('div');\n } else {\n nameDiv.append(' ');\n }\n\n const span = document.createElement('span');\n span.append(i18n('ViaBot'), ' ', titleVia);\n span.classList.add('is-via');\n\n nameDiv.append(span);\n }\n\n if(topicNameButtonContainer) {\n if(isStandaloneMedia) {\n topicNameButtonContainer.classList.add('floating-part');\n } else {\n if(!nameDiv) {\n nameDiv = document.createElement('div');\n }\n\n nameDiv.append(topicNameButtonContainer);\n\n bubble.classList.remove('hide-name');\n }\n }\n\n if(nameDiv) {\n nameDiv.classList.add('name');\n\n if(isStandaloneMedia) {\n nameContainer.append(nameContainer = document.createElement('div'));\n nameContainer.classList.add('name-with-reply', 'floating-part');\n } else {\n nameDiv.classList.add('floating-part');\n }\n\n nameContainer.append(nameDiv);\n\n if(isStandaloneMedia && replyContainer) {\n nameContainer.append(replyContainer);\n }\n } else if(isStandaloneMedia && replyContainer) {\n replyContainer.classList.add('floating-part');\n }\n\n if(topicNameButtonContainer && isStandaloneMedia) {\n if(!attachmentDiv) {\n this.log.error('no attachment div?', bubble, message);\n debugger;\n } else {\n attachmentDiv.after(topicNameButtonContainer);\n }\n }\n } else {\n bubble.classList.add('hide-name');\n }\n\n if(this.chat.type === 'pinned') {\n savedFrom = `${this.chat.peerId}_${message.mid}`;\n }\n\n const isThreadStarter = messageWithReplies && messageWithReplies.mid === this.chat.threadId;\n if(isThreadStarter) {\n bubble.classList.add('is-thread-starter', 'is-group-last');\n }\n\n if(savedFrom && (this.chat.type === 'pinned' || fwdFrom.saved_from_msg_id) && this.peerId !== REPLIES_PEER_ID) {\n const goto = document.createElement('div');\n goto.classList.add('bubble-beside-button', 'goto-original', 'tgico-arrow_next');\n bubbleContainer.append(goto);\n bubble.dataset.savedFrom = savedFrom;\n bubble.classList.add('with-beside-button');\n }\n\n bubble.classList.add(isOut ? 'is-out' : 'is-in');\n\n if(withReplies) {\n const isFooter = MessageRender.renderReplies({\n bubble,\n bubbleContainer,\n message: messageWithReplies,\n messageDiv,\n loadPromises,\n lazyLoadQueue: this.lazyLoadQueue\n });\n\n if(isFooter) {\n canHaveTail = true;\n } else {\n bubble.classList.add('with-beside-replies');\n }\n }\n\n if(isMessage) {\n this.appendReactionsElementToBubble(bubble, message, reactionsMessage);\n }\n\n /* if(isMessage) {\n const reactionHover = document.createElement('div');\n reactionHover.classList.add('bubble-reaction-hover');\n contentWrapper.append(reactionHover);\n } */\n\n if(canHaveTail) {\n bubble.classList.add('can-have-tail');\n\n bubbleContainer.append(generateTail());\n }\n\n return ret;\n }\n\n private appendReactionsElementToBubble(\n bubble: HTMLElement,\n message: Message.message,\n reactionsMessage: Message.message,\n changedResults?: ReactionCount[]\n ) {\n if(this.peerId.isUser() && USER_REACTIONS_INLINE/* || true */) {\n return;\n }\n\n if(!reactionsMessage?.reactions || !reactionsMessage.reactions.results.length) {\n return;\n }\n\n // message = this.appMessagesManager.getMessageWithReactions(message);\n\n const reactionsElement = new ReactionsElement();\n reactionsElement.init(reactionsMessage, 'block', bubble.middlewareHelper.get());\n reactionsElement.render(changedResults);\n\n if(bubble.classList.contains('is-message-empty')) {\n bubble.querySelector('.bubble-content-wrapper').append(reactionsElement);\n } else {\n const messageDiv = bubble.querySelector('.message');\n if(bubble.classList.contains('is-multiple-documents')) {\n const documentContainer = messageDiv.lastElementChild as HTMLElement;\n let documentMessageDiv = documentContainer.querySelector('.document-message');\n\n let timeSpan: HTMLElement = documentMessageDiv && documentMessageDiv.querySelector('.time');\n if(!timeSpan) {\n timeSpan = MessageRender.setTime({\n chatType: this.chat.type,\n message,\n reactionsMessage\n });\n }\n\n reactionsElement.append(timeSpan);\n\n if(!documentMessageDiv) {\n documentMessageDiv = document.createElement('div');\n documentMessageDiv.classList.add('document-message');\n documentContainer.querySelector('.document-wrapper').prepend(documentMessageDiv);\n }\n\n documentMessageDiv.append(reactionsElement);\n } else {\n const timeSpan = Array.from(bubble.querySelectorAll('.time')).pop();\n reactionsElement.append(timeSpan);\n\n messageDiv.append(reactionsElement);\n }\n }\n }\n\n private prepareToSaveScroll(reverse?: boolean) {\n const isMounted = !!this.chatInner.parentElement;\n if(!isMounted) {\n return {};\n }\n\n const log = this.log.bindPrefix('prepareToSaveScroll');\n log('save');\n const scrollSaver = this.createScrollSaver(reverse);\n scrollSaver.save(); // * let's save scroll position by point before the slicing, not after\n\n if(this.getRenderedLength() && !this.chat.setPeerPromise) {\n const viewportSlice = this.getViewportSlice();\n this.deleteViewportSlice(viewportSlice, true);\n }\n\n // scrollSaver.save(); // ! slicing will corrupt scroll position\n // const saved = scrollSaver.getSaved();\n // const hadScroll = saved.scrollHeight !== saved.clientHeight;\n\n return {\n restoreScroll: () => {\n log('restore');\n // scrollSaver.restore(_history.length === 1 && !reverse ? false : true);\n scrollSaver.restore(reverse);\n this.onRenderScrollSet(scrollSaver.getSaved());\n },\n scrollSaver\n };\n }\n\n public async performHistoryResult(\n historyResult: HistoryResult | {history: (Message.message | Message.messageService | number)[]},\n reverse: boolean\n ) {\n const log = false ? this.log.bindPrefix('perform-' + (Math.random() * 1000 | 0)) : undefined;\n log?.('start', this.chatInner.parentElement);\n\n let history = historyResult.history;\n history = history.slice(); // need\n\n if(this.needReflowScroll) {\n reflowScrollableElement(this.scrollable.container);\n this.needReflowScroll = false;\n }\n\n const cb = (message: Message.message | Message.messageService) => {\n if(!message) {\n return;\n } else if(message.pFlags.local) {\n return this.processLocalMessageRender(message);\n } else {\n return this.safeRenderMessage(message, reverse);\n }\n };\n\n const messages = await Promise.all(history.map((mid) => {\n return typeof(mid) === 'number' ? this.chat.getMessage(mid) : mid;\n }));\n\n const setLoadedPromises: Promise[] = [];\n if(!this.scrollable.loadedAll['bottom'] || !this.scrollable.loadedAll['top']) {\n let isEnd = (historyResult as HistoryResult).isEnd;\n if(!isEnd) {\n const historyStorage = await this.chat.getHistoryStorage();\n const firstSlice = historyStorage.history.first;\n const lastSlice = historyStorage.history.last;\n isEnd = {top: false, bottom: false, both: false};\n if(firstSlice.isEnd(SliceEnd.Bottom) && (!firstSlice.length || history.includes(firstSlice[0]))) {\n isEnd.bottom = true;\n }\n\n if(lastSlice.isEnd(SliceEnd.Top) && (!lastSlice.length || history.includes(lastSlice[lastSlice.length - 1]))) {\n isEnd.top = true;\n }\n }\n\n if(!isEnd.bottom && this.setPeerOptions) {\n const {lastMsgId, topMessage, savedPosition} = this.setPeerOptions;\n this.setPeerOptions = undefined;\n if((!lastMsgId && !savedPosition) || this.bubbles[topMessage] || lastMsgId === topMessage) {\n isEnd.bottom = true;\n }\n }\n\n if(isEnd.top) setLoadedPromises.push(this.setLoaded('top', true));\n if(isEnd.bottom) setLoadedPromises.push(this.setLoaded('bottom', true));\n }\n\n await Promise.all(setLoadedPromises);\n\n // ! it is important to insert bubbles to group reversed way\n // const length = history.length, promises: Promise[] = [];\n // if(reverse) for(let i = 0; i < length; ++i) promises.push(cb(messages[i]));\n // else for(let i = length - 1; i >= 0; --i) promises.push(cb(messages[i]));\n const promises = messages.map(cb);\n\n // cannot combine them into one promise\n await Promise.all(promises);\n await this.messagesQueuePromise;\n\n if(this.scrollable.loadedAll.top && this.messagesQueueOnRenderAdditional) {\n this.messagesQueueOnRenderAdditional();\n this.messagesQueueOnRenderAdditional?.(); // * can set it second time\n }\n\n log?.('performHistoryResult end');\n }\n\n private onRenderScrollSet(state?: {scrollHeight: number, clientHeight: number}) {\n const className = 'has-sticky-dates';\n if(!this.container.classList.contains(className)) {\n const isLoading = !this.preloader.detached;\n\n if(isLoading ||\n (\n state ??= {\n scrollHeight: this.scrollable.scrollHeight,\n clientHeight: this.scrollable.container.clientHeight\n },\n state.scrollHeight !== state.clientHeight\n )\n ) {\n /* for(const timestamp in this.dateMessages) {\n const dateMessage = this.dateMessages[timestamp];\n dateMessage.div.classList.add('is-sticky');\n } */\n\n const middleware = this.getMiddleware();\n const callback = () => {\n if(!middleware()) return;\n this.container.classList.add(className);\n };\n\n if(this.willScrollOnLoad) {\n callback();\n } else {\n setTimeout(callback, 600);\n }\n\n return;\n }\n }\n\n this.willScrollOnLoad = undefined;\n }\n\n public onDatePick = (timestamp: number) => {\n const peerId = this.peerId;\n this.managers.appMessagesManager.requestHistory(peerId, 0, 2, -1, timestamp, this.chat.threadId).then((history) => {\n if(!history?.messages?.length) {\n this.log.error('no history!');\n return;\n } else if(this.peerId !== peerId) {\n return;\n }\n\n this.chat.setMessageId((history.messages[0] as MyMessage).mid);\n // console.log('got history date:', history);\n });\n };\n\n public requestHistory(maxId: number, loadCount: number, backLimit: number) {\n // const middleware = this.getMiddleware();\n if(this.chat.type === 'chat' || this.chat.type === 'discussion') {\n return this.managers.acknowledged.appMessagesManager.getHistory(this.peerId, maxId, loadCount, backLimit, this.chat.threadId);\n } else if(this.chat.type === 'pinned') {\n return this.managers.acknowledged.appMessagesManager.getSearch({\n peerId: this.peerId,\n inputFilter: {_: 'inputMessagesFilterPinned'},\n maxId,\n limit: loadCount,\n backLimit\n }).then((ackedResult) => {\n return {\n cached: ackedResult.cached,\n result: Promise.resolve(ackedResult.result).then((value) => {\n return {history: value.history.map((m) => m.mid)};\n })\n };\n });\n } else if(this.chat.type === 'scheduled') {\n return this.managers.acknowledged.appMessagesManager.getScheduledMessages(this.peerId).then((ackedResult) => {\n // this.setLoaded('top', true);\n // this.setLoaded('bottom', true);\n return {\n cached: ackedResult.cached,\n result: Promise.resolve(ackedResult.result).then((mids) => ({history: mids.slice().reverse()}))\n };\n });\n }\n }\n\n private async animateAsLadder(additionMsgId: number, additionMsgIds: number[], isAdditionRender: boolean, backLimit: number, maxId: number) {\n /* const middleware = this.getMiddleware();\n await this.ladderDeferred; */\n\n const log = this.log.bindPrefix('ladder');\n if(this.chat.setPeerPromise && !this.resolveLadderAnimation) {\n log.warn('will be delayed');\n // @ts-ignore\n this.resolveLadderAnimation = this.animateAsLadder.bind(this, additionMsgId, additionMsgIds, isAdditionRender, backLimit, maxId);\n return;\n }\n\n /* if(!middleware()) {\n return;\n } */\n\n if(!Object.keys(this.bubbles).length) {\n log.warn('no bubbles');\n return;\n }\n\n let sortedMids = getObjectKeysAndSort(this.bubbles, 'desc');\n\n if(isAdditionRender && additionMsgIds.length) {\n sortedMids = sortedMids.filter((mid) => !additionMsgIds.includes(mid));\n }\n\n let targetMid: number;\n if(backLimit) {\n targetMid = maxId || Math.max(...sortedMids); // * on discussion enter\n } else {\n if(additionMsgId) {\n targetMid = additionMsgId;\n } else { // * if maxId === 0\n targetMid = Math.max(...sortedMids);\n }\n }\n\n const topIds = sortedMids.slice(sortedMids.findIndex((mid) => targetMid > mid));\n const middleIds = isAdditionRender ? [] : [targetMid];\n const bottomIds = isAdditionRender ? [] : sortedMids.slice(0, sortedMids.findIndex((mid) => targetMid >= mid)).reverse();\n\n if(DEBUG) {\n log('targeting mid:', targetMid, maxId, additionMsgId,\n topIds.map((m) => getServerMessageId(m)),\n bottomIds.map((m) => getServerMessageId(m)));\n }\n\n const setBubbles: HTMLElement[] = [];\n\n this.chatInner.classList.add('zoom-fading');\n const delay = isAdditionRender ? 10 : 40;\n const offsetIndex = isAdditionRender ? 0 : 1;\n const animateAsLadder = (mids: number[], offsetIndex = 0) => {\n const animationPromise = deferredPromise();\n let lastMsDelay = 0;\n mids.forEach((mid, idx) => {\n const bubble = this.bubbles[mid];\n if(!bubble || this.skippedMids.has(mid)) {\n log.warn('no bubble by mid:', mid);\n return;\n }\n\n lastMsDelay = ((idx + offsetIndex) || 0.1) * delay;\n // lastMsDelay = (idx + offsetIndex) * delay;\n // lastMsDelay = (idx || 0.1) * 1000;\n\n const contentWrapper = bubble.lastElementChild as HTMLElement;\n const elementsToAnimate: HTMLElement[] = [contentWrapper];\n const item = this.bubbleGroups.getItemByBubble(bubble);\n if(item && item.group.avatar && item.group.lastItem === item) {\n elementsToAnimate.push(item.group.avatar);\n }\n\n elementsToAnimate.forEach((element) => {\n element.classList.add('zoom-fade', 'can-zoom-fade');\n element.style.transitionDelay = lastMsDelay + 'ms';\n });\n\n if(idx === (mids.length - 1)) {\n const onTransitionEnd = (e: TransitionEvent) => {\n if(e.target !== contentWrapper) {\n return;\n }\n\n animationPromise.resolve();\n contentWrapper.removeEventListener('transitionend', onTransitionEnd);\n };\n\n contentWrapper.addEventListener('transitionend', onTransitionEnd);\n }\n\n setBubbles.push(...elementsToAnimate);\n });\n\n if(!mids.length) {\n animationPromise.resolve();\n }\n\n return {lastMsDelay, animationPromise};\n };\n\n const topRes = animateAsLadder(topIds, offsetIndex);\n const middleRes = animateAsLadder(middleIds);\n const bottomRes = animateAsLadder(bottomIds, offsetIndex);\n const promises = [topRes.animationPromise, middleRes.animationPromise, bottomRes.animationPromise];\n const delays: number[] = [topRes.lastMsDelay, middleRes.lastMsDelay, bottomRes.lastMsDelay];\n\n if(this.onAnimateLadder) {\n await this.onAnimateLadder();\n }\n\n fastRaf(() => {\n this.setStickyDateManually(); // ! maybe it's not efficient\n\n setBubbles.forEach((element) => {\n element.classList.remove('zoom-fade');\n });\n });\n\n let promise: Promise;\n if(topIds.length || middleIds.length || bottomIds.length) {\n promise = Promise.all(promises);\n\n dispatchHeavyAnimationEvent(promise, Math.max(...delays) + 200) // * 200 - transition time\n .then(() => {\n fastRaf(() => {\n setBubbles.forEach((element) => {\n element.style.transitionDelay = '';\n element.classList.remove('can-zoom-fade');\n });\n\n this.chatInner.classList.remove('zoom-fading');\n });\n\n // ! в хроме, каким-то образом из-за zoom-fade класса начинает прыгать скролл при подгрузке сообщений вверх,\n // ! т.е. скролл не ставится, так же, как в сафари при translateZ на блок выше scrollable\n // if(!IS_SAFARI) {\n // this.needReflowScroll = true;\n // }\n });\n }\n\n return promise;\n }\n\n private async renderEmptyPlaceholder(\n type: 'group' | 'saved' | 'noMessages' | 'noScheduledMessages' | 'greeting' | 'restricted',\n bubble: HTMLElement,\n message: any,\n elements: (Node | string)[]\n ) {\n const BASE_CLASS = 'empty-bubble-placeholder';\n bubble.classList.add(BASE_CLASS, BASE_CLASS + '-' + type);\n\n let title: HTMLElement;\n if(type === 'group') title = i18n('GroupEmptyTitle1');\n else if(type === 'saved') title = i18n('ChatYourSelfTitle');\n else if(type === 'noMessages' || type === 'greeting') title = i18n('NoMessages');\n else if(type === 'noScheduledMessages') title = i18n('NoScheduledMessages');\n else if(type === 'restricted') {\n title = document.createElement('span');\n title.innerText = await this.managers.appPeersManager.getRestrictionReasonText(this.peerId);\n }\n title.classList.add('center', BASE_CLASS + '-title');\n\n elements.push(title);\n\n let listElements: HTMLElement[];\n if(type === 'group') {\n elements.push(i18n('GroupEmptyTitle2'));\n listElements = [\n i18n('GroupDescription1'),\n i18n('GroupDescription2'),\n i18n('GroupDescription3'),\n i18n('GroupDescription4')\n ];\n } else if(type === 'saved') {\n listElements = [\n i18n('ChatYourSelfDescription1'),\n i18n('ChatYourSelfDescription2'),\n i18n('ChatYourSelfDescription3'),\n i18n('ChatYourSelfDescription4')\n ];\n } else if(type === 'greeting') {\n const subtitle = i18n('NoMessagesGreetingsDescription');\n subtitle.classList.add('center', BASE_CLASS + '-subtitle');\n\n // findAndSplice(this.messagesQueue, q => q.bubble === bubble);\n\n const stickerDiv = document.createElement('div');\n stickerDiv.classList.add(BASE_CLASS + '-sticker');\n\n const middleware = this.getMiddleware();\n\n await this.managers.appStickersManager.getGreetingSticker().then(async(doc) => {\n if(!middleware()) return;\n\n const loadPromises: Promise[] = [];\n await wrapSticker({\n doc,\n // doc: appDocsManager.getDoc(\"5431607541660389336\"), // cubigator mockup\n div: stickerDiv,\n middleware,\n lazyLoadQueue: this.lazyLoadQueue,\n group: this.chat.animationGroup,\n // play: !!message.pending || !multipleRender,\n play: true,\n loop: true,\n withThumb: true,\n loadPromises,\n liteModeKey: 'stickers_chat'\n });\n\n attachClickEvent(stickerDiv, (e) => {\n cancelEvent(e);\n EmoticonsDropdown.onMediaClick({target: e.target});\n });\n\n return Promise.all(loadPromises);\n });\n\n // this.renderMessagesQueue({\n // message,\n // bubble,\n // reverse: false,\n // promises: [loadPromise]\n // });\n\n elements.push(subtitle, stickerDiv);\n }\n\n if(listElements) {\n elements.push(\n ...listElements.map((elem) => {\n const span = document.createElement('span');\n span.classList.add(BASE_CLASS + '-list-item');\n span.append(elem);\n return span;\n })\n );\n\n if(type === 'group') {\n listElements.forEach((elem) => {\n const i = document.createElement('span');\n i.classList.add('tgico-check');\n elem.prepend(i);\n });\n } else if(type === 'saved') {\n listElements.forEach((elem) => {\n const i = document.createElement('span');\n i.classList.add(BASE_CLASS + '-list-bullet');\n i.innerText = '•';\n elem.prepend(i);\n });\n }\n }\n\n if(elements.length > 1) {\n bubble.classList.add('has-description');\n }\n\n elements.forEach((element: any) => element.classList.add(BASE_CLASS + '-line'));\n }\n\n private async processLocalMessageRender(\n message: Message.message | Message.messageService,\n animate?: boolean,\n middleware = this.getMiddleware()\n ) {\n const isSponsored = !!(message as Message.message).pFlags.sponsored;\n const m = middlewarePromise(middleware);\n\n const p: Parameters[4] = async(result) => {\n const {bubble} = await m(result);\n if(!bubble) {\n return result;\n }\n\n (bubble as any).message = message;\n\n bubble.classList.add('is-group-last', 'is-group-first');\n\n const updatePosition = () => {\n if(this.updatePlaceholderPosition === updatePosition) {\n this.updatePlaceholderPosition = undefined;\n }\n\n appendTo[method](bubble);\n };\n\n if(!isSponsored) {\n bubble.classList.add('bubble-first');\n bubble.classList.remove('can-have-tail', 'is-in');\n }\n\n const elements: (Node | string)[] = [];\n const isBot = this.chat.isBot;\n let renderPromise: Promise, appendTo = this.container, method: 'append' | 'prepend' = 'append';\n if(this.chat.isRestricted) {\n renderPromise = this.renderEmptyPlaceholder('restricted', bubble, message, elements);\n } else if(isSponsored) {\n let text: LangPackKey, mid: number, startParam: string, callback: () => void;\n\n bubble.classList.add('avoid-selection');\n bubble.style.order = '999999';\n\n const sponsoredMessage = this.sponsoredMessage = (message as Message.message).sponsoredMessage;\n const peerId = getPeerId(sponsoredMessage.from_id);\n // const peer = this.appPeersManager.getPeer(peerId);\n if(sponsoredMessage.channel_post) {\n text = 'OpenChannelPost';\n mid = generateMessageId(sponsoredMessage.channel_post);\n } else if(sponsoredMessage.start_param || isBot) {\n text = 'Chat.Message.ViewBot';\n startParam = sponsoredMessage.start_param;\n } else {\n text = await this.managers.appPeersManager.isAnyGroup(peerId) ? 'Chat.Message.ViewGroup' : 'Chat.Message.ViewChannel';\n }\n\n if(sponsoredMessage.chat_invite) {\n callback = () => {\n new PopupJoinChatInvite(sponsoredMessage.chat_invite_hash, sponsoredMessage.chat_invite as ChatInvite.chatInvite);\n };\n } else if(sponsoredMessage.chat_invite_hash) {\n callback = () => {\n const link: InternalLink = {\n _: INTERNAL_LINK_TYPE.JOIN_CHAT,\n invite: sponsoredMessage.chat_invite_hash\n };\n\n this.chat.appImManager.processInternalLink(link);\n };\n } else {\n callback = () => {\n this.chat.appImManager.setInnerPeer({\n peerId,\n lastMsgId: mid,\n startParam\n });\n };\n }\n\n const button = this.makeViewButton({text});\n\n this.observer.observe(button, this.viewsObserverCallback);\n\n if(callback) {\n attachClickEvent(button, callback);\n }\n\n bubble.querySelector('.bubble-content').prepend(button);\n\n appendTo = this.chatInner;\n method = 'append';\n animate = false;\n\n // return result;\n } else if(isBot && message._ === 'message') {\n const b = document.createElement('b');\n b.append(i18n('BotInfoTitle'));\n elements.push(b, '\\n\\n');\n appendTo = this.chatInner;\n method = 'prepend';\n } else if(this.chat.isAnyGroup && ((await m(this.managers.appPeersManager.getPeer(this.peerId))) as MTChat.chat).pFlags.creator) {\n renderPromise = this.renderEmptyPlaceholder('group', bubble, message, elements);\n } else if(this.chat.type === 'scheduled') {\n renderPromise = this.renderEmptyPlaceholder('noScheduledMessages', bubble, message, elements);\n } else if(rootScope.myId === this.peerId) {\n renderPromise = this.renderEmptyPlaceholder('saved', bubble, message, elements);\n } else if(this.peerId.isUser() && !isBot && await m(this.chat.canSend()) && this.chat.type === 'chat') {\n renderPromise = this.renderEmptyPlaceholder('greeting', bubble, message, elements);\n } else {\n renderPromise = this.renderEmptyPlaceholder('noMessages', bubble, message, elements);\n }\n\n if(renderPromise) {\n await renderPromise;\n }\n\n if(elements.length) {\n const messageDiv = bubble.querySelector('.message, .service-msg');\n messageDiv.prepend(...elements);\n }\n\n const isWaitingForAnimation = !!this.messagesQueueOnRenderAdditional;\n const noTransition = this.setPeerCached && !isWaitingForAnimation;\n if(noTransition) {\n const setOn = bubble.firstElementChild;\n setOn.classList.add('no-transition');\n\n if(this.chat.setPeerPromise) {\n this.chat.setPeerPromise.catch(noop).finally(() => {\n setOn.classList.remove('no-transition');\n });\n }\n }\n\n if(animate === undefined && !noTransition) {\n animate = true;\n }\n\n if(isWaitingForAnimation || animate) {\n this.updatePlaceholderPosition = updatePosition;\n\n this.onAnimateLadder = () => {\n // appendTo[method](bubble);\n this.onAnimateLadder = undefined;\n\n // need raf here because animation won't fire if this message is single\n if(!this.messagesQueuePromise) {\n return fastRafPromise();\n }\n };\n } else if(this.chat.setPeerPromise) {\n this.attachPlaceholderOnRender = () => {\n this.attachPlaceholderOnRender = undefined;\n updatePosition();\n // appendTo[method](bubble);\n };\n } else {\n this.updatePlaceholderPosition = updatePosition;\n // appendTo[method](bubble);\n }\n\n if(!isWaitingForAnimation && animate) {\n await m(getHeavyAnimationPromise());\n const additionMsgIds = getObjectKeysAndSort(this.bubbles);\n indexOfAndSplice(additionMsgIds, message.mid);\n this.animateAsLadder(message.mid, additionMsgIds, false, 0, 0);\n }\n\n bubble.middlewareHelper.onDestroy(() => {\n if(this.emptyPlaceholderBubble === bubble) {\n this.emptyPlaceholderBubble = undefined;\n }\n });\n\n this.emptyPlaceholderBubble = bubble;\n\n return result;\n };\n\n return this.safeRenderMessage(\n message,\n !isSponsored,\n undefined,\n false,\n p\n );\n }\n\n private makeViewButton[1]>(options: T) {\n return Button('btn-primary btn-primary-transparent bubble-view-button', options);\n }\n\n private generateLocalMessageId(addOffset = 0) {\n // const INCREMENT = 0x10;\n const offset = (this.chat.type === 'scheduled' ? -1 : 0) + addOffset;\n // offset = generateMessageId(offset);\n // id: -Math.abs(+this.peerId * INCREMENT + offset),\n const id = -Math.abs(offset);\n const mid = -Math.abs(generateMessageId(id));\n return {id, mid};\n }\n\n private async generateLocalFirstMessage(service?: T, fill?: (message: GenerateLocalMessageType) => void, addOffset = 0): Promise> {\n const {id, mid} = this.generateLocalMessageId(addOffset);\n let message: Omit & {message?: string} = {\n _: service ? 'messageService' : 'message',\n date: 0,\n id,\n mid,\n peer_id: await this.managers.appPeersManager.getOutputPeer(this.peerId),\n pFlags: {\n local: true\n }\n };\n\n if(!service) {\n message.message = '';\n }/* else {\n (message as Message.messageService).action = {} as any;\n } */\n\n assumeType>(message);\n\n fill && fill(message);\n\n const savedMessages = await this.managers.appMessagesManager.saveMessages([message], {storage: new Map() as any});\n message = savedMessages[0];\n message.mid = mid;\n return message as any;\n }\n\n public getViewportSlice() {\n // this.log.trace('viewport slice');\n return getViewportSlice({\n overflowElement: this.scrollable.container,\n selector: '.bubbles-date-group .bubble:not(.is-date)',\n extraSize: Math.max(700, windowSize.height) * 2\n });\n }\n\n public deleteViewportSlice(slice: ReturnType, ignoreScrollSaving?: boolean) {\n if(DO_NOT_SLICE_VIEWPORT_ON_RENDER) {\n return;\n }\n\n const {invisibleTop, invisibleBottom} = slice;\n const invisible = invisibleTop.concat(invisibleBottom);\n if(!invisible.length) {\n return;\n }\n\n if(invisibleTop.length) {\n this.setLoaded('top', false);\n this.getHistoryTopPromise = undefined;\n }\n\n if(invisibleBottom.length) {\n this.setLoaded('bottom', false);\n this.getHistoryBottomPromise = undefined;\n }\n\n const mids = invisible.map(({element}) => +element.dataset.mid);\n\n let scrollSaver: ScrollSaver;\n if(/* !!invisibleTop.length !== !!invisibleBottom.length && */!ignoreScrollSaving) {\n scrollSaver = this.createScrollSaver(!!invisibleTop.length);\n scrollSaver.save();\n }\n\n this.deleteMessagesByIds(mids, false, true);\n\n if(scrollSaver) {\n scrollSaver.restore();\n } else if(invisibleTop.length) {\n this.scrollable.lastScrollPosition = this.scrollable.scrollTop;\n }\n }\n\n public sliceViewport(ignoreHeavyAnimation?: boolean) {\n // Safari cannot reset the scroll.\n if(IS_SAFARI || (this.isHeavyAnimationInProgress && !ignoreHeavyAnimation) || DO_NOT_SLICE_VIEWPORT) {\n return;\n }\n\n // const scrollSaver = new ScrollSaver(this.scrollable, true);\n // scrollSaver.save();\n const slice = this.getViewportSlice();\n // if(IS_SAFARI) slice.invisibleTop = [];\n this.deleteViewportSlice(slice);\n // scrollSaver.restore();\n }\n\n private async setLoaded(side: SliceSides, value: boolean, checkPlaceholders = true) {\n const willChange = this.scrollable.loadedAll[side] !== value;\n if(!willChange) {\n return;\n }\n\n const log = this.log.bindPrefix('setLoaded');\n log('change', side, value);\n\n this.scrollable.loadedAll[side] = value;\n this.scrollable.onScroll(); // ! WARNING\n // return;\n\n if(!checkPlaceholders) {\n return;\n }\n\n if(!this.chat.isRestricted) {\n if(side === 'bottom' && this.chat.isBroadcast/* && false */) {\n this.toggleSponsoredMessage(value);\n }\n\n if(side === 'top' && value && this.chat.isBot) {\n return this.renderBotPlaceholder();\n }\n }\n\n return this.checkIfEmptyPlaceholderNeeded();\n }\n\n private async toggleSponsoredMessage(value: boolean) {\n const log = this.log.bindPrefix('sponsored');\n log('checking');\n const {mid} = this.generateLocalMessageId(SPONSORED_MESSAGE_ID_OFFSET);\n if(value) {\n const middleware = this.getMiddleware(() => {\n return this.scrollable.loadedAll.bottom && this.getSponsoredMessagePromise === promise;\n });\n\n const promise = this.getSponsoredMessagePromise = this.managers.appChatsManager.getSponsoredMessage(this.peerId.toChatId())\n .then(async(sponsoredMessages) => {\n if(!middleware() || sponsoredMessages._ === 'messages.sponsoredMessagesEmpty') {\n return;\n }\n\n const sponsoredMessage = sponsoredMessages.messages[0];\n if(!sponsoredMessage) {\n log('no message');\n return;\n }\n\n const messagePromise = this.generateLocalFirstMessage(false, (message) => {\n message.message = sponsoredMessage.message;\n message.from_id = sponsoredMessage.from_id;\n message.entities = sponsoredMessage.entities;\n message.pFlags.sponsored = true;\n message.sponsoredMessage = sponsoredMessage;\n }, SPONSORED_MESSAGE_ID_OFFSET);\n\n return Promise.all([\n messagePromise,\n this.getHistoryTopPromise, // wait for top load and execute rendering after or with it\n this.messagesQueuePromise\n ]).then(([message]) => {\n if(!middleware()) return;\n // this.processLocalMessageRender(message);\n log('rendering', message);\n return this.performHistoryResult({history: [message]}, false);\n });\n }).finally(() => {\n if(this.getSponsoredMessagePromise === promise) {\n this.getSponsoredMessagePromise = undefined;\n }\n });\n } else {\n log('clearing rendered', mid);\n this.getSponsoredMessagePromise = undefined;\n this.deleteMessagesByIds([mid]);\n }\n }\n\n private async renderBotPlaceholder() {\n const _log = this.log.bindPrefix('bot placeholder');\n\n const middleware = this.getMiddleware();\n const result = await this.managers.acknowledged.appProfileManager.getProfile(this.peerId.toUserId());\n _log('getting profile, cached:', result.cached);\n const processPromise = result.result.then(async(userFull) => {\n if(!middleware()) {\n return;\n }\n\n if(!userFull.bot_info?.description) {\n _log.warn('no description');\n return this.checkIfEmptyPlaceholderNeeded();\n }\n\n const message = await this.generateLocalFirstMessage(false, (message) => {\n const botInfo = userFull.bot_info;\n message.message = botInfo.description;\n if(botInfo.description_document) message.media = {_: 'messageMediaDocument', document: botInfo.description_document, pFlags: {}};\n if(botInfo.description_photo) message.media = {_: 'messageMediaPhoto', photo: botInfo.description_photo, pFlags: {}};\n });\n\n if(!middleware()) {\n return;\n }\n\n _log('rendering');\n const renderPromise = this.processLocalMessageRender(message, !result.cached).then(() => {\n _log('done');\n });\n\n return {renderPromise};\n });\n\n if(!result.cached) {\n return;\n }\n\n return processPromise;\n }\n\n public async checkIfEmptyPlaceholderNeeded() {\n if(this.scrollable.loadedAll.top &&\n this.scrollable.loadedAll.bottom &&\n this.emptyPlaceholderBubble === undefined &&\n (\n this.chat.isRestricted ||\n !(await this.chat.getHistoryStorage()).count ||\n (\n // !Object.keys(this.bubbles).length ||\n // ! WARNING ! ! ! ! ! ! REPLACE LINE ABOVE WITH THESE\n Object.keys(this.bubbles).length &&\n !this.getRenderedLength()\n ) ||\n (this.chat.type === 'scheduled' && !Object.keys(this.bubbles).length)\n )\n ) {\n this.log('inject empty peer placeholder');\n\n const message = await this.generateLocalFirstMessage(true);\n return {renderPromise: this.processLocalMessageRender(message)};\n }\n }\n\n public getHistory1(maxId?: number, reverse?: boolean, isBackLimit?: boolean, additionMsgId?: number, justLoad?: boolean) {\n const middleware = this.getMiddleware(justLoad ? undefined : () => {\n return (reverse ? this.getHistoryTopPromise : this.getHistoryBottomPromise) === waitPromise;\n });\n\n const result = this.getHistory(maxId, reverse, isBackLimit, additionMsgId, justLoad, middleware);\n const waitPromise = result.then((res) => res && (res.waitPromise || res.promise));\n\n (reverse ? this.getHistoryTopPromise = waitPromise : this.getHistoryBottomPromise = waitPromise);\n waitPromise.then(() => {\n if(!middleware()) {\n return;\n }\n\n (reverse ? this.getHistoryTopPromise = undefined : this.getHistoryBottomPromise = undefined);\n\n if(!justLoad) {\n // preload more\n // if(!isFirstMessageRender) {\n if(this.chat.type === 'chat'/* || this.chat.type === 'discussion' */) {\n /* const storage = this.appMessagesManager.getHistoryStorage(peerId, this.chat.threadId);\n const isMaxIdInHistory = storage.history.indexOf(maxId) !== -1;\n if(isMaxIdInHistory || true) { // * otherwise it is a search or jump */\n setTimeout(() => {\n if(reverse) {\n this.loadMoreHistory(true, true);\n } else {\n this.loadMoreHistory(false, true);\n }\n }, 0);\n // }\n }\n // }\n\n // this.scrollable.onScroll();\n }\n });\n\n return result;\n }\n\n /**\n * Load and render history\n * @param maxId max message id\n * @param reverse 'true' means up\n * @param isBackLimit is search\n * @param additionMsgId for the last message\n * @param justLoad do not render\n */\n public async getHistory(\n maxId = 0,\n reverse = false,\n isBackLimit = false,\n additionMsgId = 0,\n justLoad = false,\n middleware?: () => boolean\n ): Promise<{cached: boolean, promise: Promise, waitPromise: Promise}> {\n const peerId = this.peerId;\n\n const isBroadcast = this.chat.isBroadcast;\n // console.time('appImManager call getHistory');\n const pageCount = Math.min(30, windowSize.height / 40/* * 1.25 */ | 0);\n // const loadCount = Object.keys(this.bubbles).length > 0 ? 50 : pageCount;\n const realLoadCount = isBroadcast ? 20 : (Object.keys(this.bubbles).length > 0 ? Math.max(35, pageCount) : pageCount);\n // const realLoadCount = pageCount;//const realLoadCount = 50;\n let loadCount = realLoadCount;\n\n /* if(TEST_SCROLL) {\n //loadCount = 1;\n if(Object.keys(this.bubbles).length > 0)\n return {cached: false, promise: Promise.resolve(true)};\n } */\n if(TEST_SCROLL !== undefined) {\n if(TEST_SCROLL) {\n if(Object.keys(this.bubbles).length > 0) {\n --TEST_SCROLL;\n }\n } else {\n return {cached: false, promise: Promise.resolve(), waitPromise: Promise.resolve()};\n }\n }\n\n // //console.time('render history total');\n\n let backLimit = 0;\n if(isBackLimit) {\n backLimit = loadCount;\n\n if(!reverse) { // if not jump\n loadCount = 0;\n // maxId = this.appMessagesManager.incrementMessageId(maxId, 1);\n }\n }\n\n let additionMsgIds: number[];\n if(additionMsgId && !isBackLimit) {\n if(this.chat.type === 'pinned') {\n additionMsgIds = [additionMsgId];\n } else {\n const historyStorage = await this.chat.getHistoryStorage();\n const slice = historyStorage.history.slice;\n if(slice.length < loadCount && !slice.isEnd(SliceEnd.Both)) {\n additionMsgIds = slice.slice();\n\n // * filter last album, because we don't know is it the last item\n for(let i = additionMsgIds.length - 1; i >= 0; --i) {\n const message = await this.chat.getMessage(additionMsgIds[i]);\n if((message as Message.message)?.grouped_id) additionMsgIds.splice(i, 1);\n else break;\n }\n\n maxId = additionMsgIds[additionMsgIds.length - 1] || maxId;\n }\n }\n }\n\n /* const result = additionMsgID ?\n {history: [additionMsgID]} :\n appMessagesManager.getHistory(this.peerId, maxId, loadCount, backLimit); */\n let result: AckedResult = await this.requestHistory(maxId, loadCount, backLimit) as any;\n let resultPromise: typeof result['result'];\n\n this.log('i vin brehnya', result, maxId, loadCount, backLimit);\n\n // const isFirstMessageRender = !!additionMsgID && result.cached && !appMessagesManager.getMessage(additionMsgID).grouped_id;\n const isAdditionRender = additionMsgIds?.length && !result.cached;\n const isFirstMessageRender = (this.isFirstLoad && backLimit && !result.cached) || isAdditionRender;\n if(isAdditionRender) {\n resultPromise = result.result;\n\n result = {\n cached: true,\n result: Promise.resolve({history: additionMsgIds})\n };\n\n // additionMsgID = 0;\n }\n\n this.isFirstLoad = false;\n\n const processResult = async(historyResult: Awaited) => {\n if((historyResult as HistoryResult).isEnd?.top) {\n if(this.chat.type === 'discussion') { // * inject discussion start\n const serviceStartMessageId = await this.managers.appMessagesManager.getThreadServiceMessageId(this.peerId, this.chat.threadId);\n if(serviceStartMessageId) historyResult.history.push(serviceStartMessageId);\n const mids = await this.chat.getMidsByMid(this.chat.threadId);\n historyResult.history.push(...mids.reverse());\n }\n\n // synchronize bot placeholder appearance\n await this.managers.appProfileManager.getProfileByPeerId(peerId);\n\n // await this.setLoaded('top', true);\n }\n };\n\n const sup = (historyResult: Awaited) => {\n return getHeavyAnimationPromise().then(() => {\n return processResult(historyResult);\n }).then(() => {\n if(!isAdditionRender && additionMsgId) {\n historyResult.history.unshift(additionMsgId);\n }\n\n return this.performHistoryResult(historyResult, reverse);\n });\n };\n\n const processPromise = (_promise: typeof result['result']) => {\n const promise = Promise.resolve(_promise).then((result) => {\n if(middleware && !middleware()) {\n throw PEER_CHANGED_ERROR;\n }\n\n if(justLoad) {\n // нужно делать из-за ранней прогрузки\n this.scrollable.onScroll();\n // fastRaf(() => {\n // this.scrollable.checkForTriggers();\n // });\n return;\n }\n\n return sup(result);\n }, (err) => {\n this.log.error('getHistory error:', err);\n throw err;\n });\n\n return promise;\n };\n\n let promise: Promise, cached: boolean;\n if(!result.cached) {\n cached = false;\n promise = processPromise(result.result);\n } else if(justLoad) {\n // нужно делать из-за ранней прогрузки\n this.scrollable.onScroll();\n return null;\n } else {\n cached = true;\n promise = sup(await result.result);\n }\n\n const waitPromise = isAdditionRender ? processPromise(resultPromise) : promise;\n\n if(isFirstMessageRender && liteMode.isAvailable('animations')/* && false */) {\n let times = isAdditionRender ? 2 : 1;\n this.messagesQueueOnRenderAdditional = () => {\n this.log('messagesQueueOnRenderAdditional');\n\n if(--times) return;\n\n this.messagesQueueOnRenderAdditional = undefined;\n\n const promise = this.animateAsLadder(additionMsgId, additionMsgIds, isAdditionRender, backLimit, maxId);\n promise.then(() => {\n setTimeout(() => { // preload messages\n this.loadMoreHistory(reverse, true);\n }, 0);\n });\n };\n } else {\n this.messagesQueueOnRenderAdditional = undefined;\n }\n\n if(justLoad) {\n return null;\n }\n\n return {cached, promise, waitPromise};\n }\n\n public async setUnreadDelimiter() {\n if(!(this.chat.type === 'chat' || this.chat.type === 'discussion')) {\n return;\n }\n\n if(this.attachedUnreadBubble) {\n return;\n }\n\n const historyMaxId = await this.chat.getHistoryMaxId();\n let readMaxId = await this.managers.appMessagesManager.getReadMaxIdIfUnread(this.peerId, this.chat.threadId);\n if(!readMaxId) return;\n\n readMaxId = Object.keys(this.bubbles)\n .filter((mid) => !this.bubbles[mid].classList.contains('is-out'))\n .map((i) => +i)\n .sort((a, b) => a - b)\n .find((i) => i > readMaxId);\n\n if(readMaxId && this.bubbles[readMaxId]) {\n const bubble = this.bubbles[readMaxId];\n if(this.firstUnreadBubble && this.firstUnreadBubble !== bubble) {\n this.firstUnreadBubble.classList.remove('is-first-unread');\n this.firstUnreadBubble = null;\n }\n\n if(readMaxId !== historyMaxId) {\n bubble.classList.add('is-first-unread');\n }\n\n this.firstUnreadBubble = bubble;\n this.attachedUnreadBubble = true;\n }\n }\n\n public deleteEmptyDateGroups() {\n const mustBeCount = this.stickyIntersector ? STICKY_OFFSET : 1;\n let deleted = false;\n for(const i in this.dateMessages) {\n const dateMessage = this.dateMessages[i];\n\n if(dateMessage.container.childElementCount === mustBeCount) { // only date div + sentinel div\n dateMessage.container.remove();\n if(this.stickyIntersector) {\n this.stickyIntersector.unobserve(dateMessage.container, dateMessage.div);\n }\n delete this.dateMessages[i];\n deleted = true;\n\n // * no sense in it\n /* if(dateMessage.div === this.previousStickyDate) {\n this.previousStickyDate = undefined;\n } */\n }\n }\n\n if(!deleted) {\n return;\n }\n\n if(!Object.keys(this.dateMessages).length) {\n this.container.classList.remove('has-groups');\n }\n\n this.checkIfEmptyPlaceholderNeeded();\n this.setStickyDateManually();\n }\n}\n\nexport function generateTail() {\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttributeNS(null, 'viewBox', '0 0 11 20');\n svg.setAttributeNS(null, 'width', '11');\n svg.setAttributeNS(null, 'height', '20');\n svg.classList.add('bubble-tail');\n\n const use = document.createElementNS('http://www.w3.org/2000/svg', 'use');\n use.setAttributeNS(null, 'href', '#message-tail-filled');\n\n svg.append(use);\n\n return svg;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {copyTextToClipboard} from '../clipboard';\n// import SelectionSaver from \"../selectionSaver\";\n// import selectElementContents from \"./selectElementContents\";\n\nexport default function copyFromElement(element: HTMLElement) {\n copyTextToClipboard(element.textContent);\n // const saver = new SelectionSaver();\n // saver.save();\n // selectElementContents(element);\n // document.execCommand('copy');\n // saver.restore();\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport {MediaSizeType} from '../../helpers/mediaSizes';\nimport {Message} from '../../layer';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getMediaDurationFromMessage from '../../lib/appManagers/utils/messages/getMediaDurationFromMessage';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\nimport {MediaSearchContext} from '../appMediaPlaybackController';\nimport Chat from '../chat/chat';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport wrapDocument from './document';\n\nexport default async function wrapGroupedDocuments({\n albumMustBeRenderedFull,\n message,\n bubble,\n messageDiv,\n chat,\n loadPromises,\n autoDownloadSize,\n lazyLoadQueue,\n searchContext,\n useSearch,\n sizeType,\n managers,\n fontWeight,\n fontSize,\n richTextFragment,\n richTextOptions,\n canTranscribeVoice\n}: {\n albumMustBeRenderedFull: boolean,\n message: any,\n messageDiv: HTMLElement,\n bubble: HTMLElement,\n uploading?: boolean,\n chat: Chat,\n loadPromises?: Promise[],\n autoDownloadSize?: number,\n lazyLoadQueue?: LazyLoadQueue,\n searchContext?: MediaSearchContext,\n useSearch?: boolean,\n sizeType?: MediaSizeType,\n managers?: AppManagers,\n fontWeight?: number,\n fontSize?: number,\n richTextFragment?: DocumentFragment,\n richTextOptions?: Parameters[1]\n canTranscribeVoice?: boolean\n}) {\n let nameContainer: HTMLElement;\n const mids = albumMustBeRenderedFull ? await chat.getMidsByMid(message.mid) : [message.mid];\n /* if(isPending) {\n mids.reverse();\n } */\n\n const promises = mids.map(async(mid, idx) => {\n const message = (await chat.getMessage(mid)) as Message.message;\n const div = await wrapDocument({\n message,\n loadPromises,\n autoDownloadSize,\n lazyLoadQueue,\n searchContext,\n sizeType,\n managers,\n fontWeight,\n fontSize,\n canTranscribeVoice\n });\n\n const container = document.createElement('div');\n container.classList.add('document-container');\n container.dataset.mid = '' + mid;\n container.dataset.peerId = '' + message.peerId;\n\n const wrapper = document.createElement('div');\n wrapper.classList.add('document-wrapper');\n\n if(message.message) {\n const messageDiv = document.createElement('div');\n messageDiv.classList.add('document-message');\n\n let fragment = richTextFragment;\n if(!fragment) {\n fragment = wrapRichText(message.message, {\n ...richTextOptions,\n entities: message.totalEntities,\n maxMediaTimestamp: getMediaDurationFromMessage(message)\n });\n }\n\n setInnerHTML(messageDiv, fragment);\n\n wrapper.append(messageDiv);\n }\n\n if(mids.length > 1) {\n const selection = document.createElement('div');\n selection.classList.add('document-selection');\n container.append(selection);\n\n container.classList.add('grouped-item');\n\n if(idx === 0) {\n nameContainer = wrapper;\n }\n }\n\n wrapper.append(div);\n container.append(wrapper);\n return container;\n });\n\n const containers = await Promise.all(promises);\n messageDiv.append(...containers);\n\n if(mids.length > 1) {\n bubble.classList.add('is-multiple-documents', 'is-grouped');\n }\n\n return nameContainer;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport rootScope from '../../lib/rootScope';\nimport PollElement from '../poll';\n\nexport default function wrapPoll(message: any, managers: AppManagers = rootScope.managers) {\n const elem = new PollElement();\n elem.message = message;\n elem.managers = managers;\n elem.setAttribute('peer-id', '' + message.peerId);\n elem.setAttribute('poll-id', message.media.poll.id);\n elem.setAttribute('message-id', '' + message.mid);\n elem.render();\n return elem;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {ReportReason} from '../../layer';\nimport InputField from '../inputField';\nimport {toastNew} from '../toast';\nimport wrapStickerEmoji from '../wrappers/stickerEmoji';\nimport PopupPeer from './peer';\n\nexport default class PopupReportMessagesConfirm extends PopupPeer {\n public static STICKER_EMOJI = '👮‍♀️';\n constructor(peerId: PeerId, mids: number[], reason: ReportReason['_'], onConfirm?: () => void) {\n super('popup-report-messages-confirm', {\n noTitle: true,\n descriptionLangKey: 'ReportInfo',\n buttons: [{\n langKey: 'ReportChat',\n callback: () => {\n if(!inputField.isValid()) {\n return;\n }\n\n onConfirm && onConfirm();\n this.managers.appMessagesManager.reportMessages(peerId, mids, reason, inputField.value).then((bool) => {\n if(!bool) return;\n\n toastNew({\n langPackKey: 'ReportSentInfo'\n });\n });\n }\n }],\n body: true\n });\n\n const div = document.createElement('div');\n const size = 100;\n wrapStickerEmoji({\n div,\n emoji: PopupReportMessagesConfirm.STICKER_EMOJI,\n width: size,\n height: size\n }).then(({render}) => render).finally(() => {\n this.show();\n });\n\n this.header.replaceWith(div);\n\n const inputField = new InputField({\n label: 'ReportHint',\n maxLength: 512,\n placeholder: 'ReportChatDescription'\n });\n\n inputField.input.addEventListener('input', () => {\n this.buttons[0].element.toggleAttribute('disabled', !inputField.isValid());\n });\n\n this.body.append(inputField.container);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport whichChild from '../../helpers/dom/whichChild';\nimport preloadAnimatedEmojiSticker from '../../helpers/preloadAnimatedEmojiSticker';\nimport {ReportReason} from '../../layer';\nimport {LangPackKey} from '../../lib/langPack';\nimport Button from '../button';\nimport PopupPeer from './peer';\nimport PopupReportMessagesConfirm from './reportMessagesConfirm';\n\nexport default class PopupReportMessages extends PopupPeer {\n constructor(peerId: PeerId, mids: number[], onConfirm?: () => void) {\n super('popup-report-messages', {titleLangKey: 'ChatTitle.ReportMessages', buttons: [], body: true});\n\n mids = mids.slice();\n\n const buttons: [LangPackKey, ReportReason['_']][] = [\n ['ReportChatSpam', 'inputReportReasonSpam'],\n ['ReportChatViolence', 'inputReportReasonViolence'],\n ['ReportChatChild', 'inputReportReasonChildAbuse'],\n ['ReportChatPornography', 'inputReportReasonPornography'],\n ['ReportChatOther', 'inputReportReasonOther'],\n ['ReportChatPersonalDetails', 'inputReportReasonPersonalDetails'],\n ['ReportChatIllegalDrugs', 'inputReportReasonIllegalDrugs']\n ];\n\n const className = 'btn-primary btn-transparent';\n buttons.forEach((b) => {\n const button = Button(className, {/* icon: 'edit', */text: b[0]});\n this.body.append(button);\n });\n\n const preloadStickerPromise = preloadAnimatedEmojiSticker(PopupReportMessagesConfirm.STICKER_EMOJI);\n\n attachClickEvent(this.body, (e) => {\n const target = findUpClassName(e.target, 'btn-primary');\n const reason = buttons[whichChild(target)][1];\n\n preloadStickerPromise.then(() => {\n this.hide();\n\n new PopupReportMessagesConfirm(peerId, mids, reason, onConfirm);\n });\n }, {listenerSetter: this.listenerSetter});\n\n // this.body.style.margin = '0 -1rem';\n this.buttonsEl.style.marginTop = '.5rem';\n\n this.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport I18n, {i18n} from '../../lib/langPack';\nimport PopupPeer from './peer';\n\nexport default class PopupSponsored extends PopupPeer {\n constructor() {\n super('popup-sponsored', {\n titleLangKey: 'Chat.Message.Sponsored.What',\n descriptionLangKey: 'Chat.Message.Ad.Text',\n descriptionLangArgs: [i18n('Chat.Message.Sponsored.Link')],\n buttons: [{\n langKey: 'OK',\n isCancel: true\n }, {\n langKey: 'Chat.Message.Ad.ReadMore',\n callback: () => {\n window.open(I18n.format('Chat.Message.Sponsored.Link', true));\n },\n isCancel: true\n }],\n scrollable: true\n });\n\n this.scrollable.append(this.description);\n\n this.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport {Message, Reaction} from '../../layer';\nimport ReactionsElement from '../chat/reactions';\nimport {horizontalMenu} from '../horizontalMenu';\nimport Scrollable from '../scrollable';\nimport ScrollableLoader from '../../helpers/scrollableLoader';\nimport appDialogsManager from '../../lib/appManagers/appDialogsManager';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport wrapSticker from '../wrappers/sticker';\nimport ReactionElement from '../chat/reaction';\nimport getUserStatusString from '../wrappers/getUserStatusString';\nimport {makeMediaSize} from '../../helpers/mediaSize';\nimport wrapCustomEmoji from '../wrappers/customEmoji';\nimport SettingSection from '../settingSection';\n\nexport default class PopupReactedList extends PopupElement {\n constructor(\n private message: Message.message\n ) {\n super('popup-reacted-list', {closable: true, overlayClosable: true, body: true});\n\n this.init();\n }\n\n private async init() {\n const middleware = this.middlewareHelper.get();\n const message = await this.managers.appMessagesManager.getGroupsFirstMessage(this.message);\n if(!middleware()) return;\n const canViewReadParticipants = await this.managers.appMessagesManager.canViewMessageReadParticipants(message);\n if(!middleware()) return;\n // this.body.append(generateDelimiter());\n\n const reactionsElement = new ReactionsElement();\n const newMessage: Message.message = {\n ...message,\n mid: 0,\n id: 0,\n reactions: {\n _: 'messageReactions',\n results: [],\n\n ...message.reactions,\n\n pFlags: {},\n recent_reactions: []\n }\n };\n\n newMessage.reactions.results = newMessage.reactions.results.map((reactionCount) => {\n return {\n ...reactionCount,\n chosen_order: undefined,\n pFlags: {}\n };\n });\n\n reactionsElement.init(newMessage, 'block', this.middlewareHelper.get());\n reactionsElement.render();\n reactionsElement.classList.add('no-stripe');\n reactionsElement.classList.remove('has-no-reactions');\n\n reactionsElement.append(this.btnClose);\n\n this.header.append(reactionsElement);\n\n const tabsContainer = document.createElement('div');\n tabsContainer.classList.add('tabs-container');\n tabsContainer.dataset.animation = 'tabs';\n\n const loaders: Map = new Map();\n\n let hasAllReactions = false;\n if(newMessage.reactions.results.length) {\n const reaction = this.createFakeReaction('reactions', newMessage.reactions.results.reduce((acc, r) => acc + r.count, 0));\n\n reactionsElement.prepend(reaction);\n newMessage.reactions.results.unshift(reaction.reactionCount);\n hasAllReactions = true;\n }\n\n let hasReadParticipants = false;\n if(canViewReadParticipants) {\n try {\n const readUserIds = await this.managers.appMessagesManager.getMessageReadParticipants(message.peerId, message.mid);\n if(!middleware()) return;\n if(!readUserIds.length) {\n throw '';\n }\n\n const reaction = this.createFakeReaction('checks', readUserIds.length);\n\n reactionsElement.prepend(reaction);\n newMessage.reactions.results.unshift(reaction.reactionCount);\n hasReadParticipants = true;\n } catch(err) {\n\n }\n }\n\n newMessage.reactions.results.forEach((reactionCount) => {\n const scrollable = new Scrollable(undefined);\n scrollable.container.classList.add('tabs-tab');\n\n const section = new SettingSection({\n noShadow: true,\n noDelimiter: true\n });\n\n const chatlist = appDialogsManager.createChatList({\n dialogSize: 72\n });\n\n appDialogsManager.setListClickListener(chatlist, () => {\n this.hide();\n }, undefined, false, true);\n\n section.content.append(chatlist);\n scrollable.container.append(section.container);\n\n const skipReadParticipants = (reactionCount.reaction as any) !== 'checks';\n const skipReactionsList = (reactionCount.reaction as any) === 'checks';\n if(['checks', 'reactions'].includes(reactionCount.reaction as any)) {\n reactionCount.reaction = undefined;\n }\n\n const size = 24;\n const mediaSize = makeMediaSize(size, size);\n\n let nextOffset: string;\n const loader = new ScrollableLoader({\n scrollable,\n getPromise: async() => {\n const result = await this.managers.appMessagesManager.getMessageReactionsListAndReadParticipants(message, undefined, reactionCount.reaction, nextOffset, skipReadParticipants, skipReactionsList);\n nextOffset = result.nextOffset;\n\n await Promise.all(result.combined.map(async({peerId, reaction}) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: peerId,\n autonomous: true,\n container: chatlist,\n avatarSize: 'abitbigger',\n rippleEnabled: false,\n meAsSaved: false\n });\n\n if(reaction) {\n const stickerContainer = document.createElement('div');\n stickerContainer.classList.add('reacted-list-reaction-icon');\n\n if(reaction._ === 'reactionEmoji') {\n const availableReaction = await this.managers.appReactionsManager.getReactionCached(reaction.emoticon);\n\n wrapSticker({\n doc: availableReaction.static_icon,\n div: stickerContainer,\n width: 24,\n height: 24,\n middleware\n });\n } else if(reaction._ === 'reactionCustomEmoji') {\n stickerContainer.append(wrapCustomEmoji({\n docIds: [reaction.document_id],\n customEmojiSize: mediaSize,\n middleware\n }));\n }\n\n dom.listEl.append(stickerContainer);\n }\n\n replaceContent(dom.lastMessageSpan, getUserStatusString(await this.managers.appUsersManager.getUser(peerId.toUserId())));\n }));\n\n return !nextOffset;\n }\n });\n\n loaders.set(scrollable.container, loader);\n\n tabsContainer.append(scrollable.container);\n });\n\n this.body.append(tabsContainer);\n\n const selectTab = horizontalMenu(reactionsElement, tabsContainer, (id, tabContent) => {\n if(id === (reactionsElement.childElementCount - 1)) {\n return false;\n }\n\n const reaction = reactionsElement.children[id] as ReactionElement;\n const prevId = selectTab.prevId();\n if(prevId !== -1) {\n (reactionsElement.children[prevId] as ReactionElement).setIsChosen(false);\n }\n\n reaction.setIsChosen(true);\n\n const loader = loaders.get(tabContent);\n loader.load();\n }, undefined, undefined, undefined, this.listenerSetter);\n\n // selectTab(hasAllReactions && hasReadParticipants ? 1 : 0, false);\n selectTab(0, false);\n\n this.show();\n }\n\n private createFakeReaction(icon: string, count: number) {\n const reaction = new ReactionElement();\n reaction.init('block', this.middlewareHelper.get());\n reaction.reactionCount = {\n _: 'reactionCount',\n count: count,\n reaction: icon as any\n };\n reaction.setCanRenderAvatars(false);\n reaction.renderCounter();\n\n const allReactionsSticker = document.createElement('div');\n allReactionsSticker.classList.add('reaction-counter', 'reaction-sticker-icon', 'tgico-' + icon);\n reaction.prepend(allReactionsSticker);\n\n return reaction;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport {IS_MOBILE, IS_SAFARI} from '../../environment/userAgent';\nimport assumeType from '../../helpers/assumeType';\nimport callbackify from '../../helpers/callbackify';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport getVisibleRect from '../../helpers/dom/getVisibleRect';\nimport liteMode from '../../helpers/liteMode';\nimport {getMiddleware} from '../../helpers/middleware';\nimport noop from '../../helpers/noop';\nimport {fastRaf} from '../../helpers/schedulers';\nimport {Message, AvailableReaction, Reaction} from '../../layer';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport lottieLoader from '../../lib/rlottie/lottieLoader';\nimport RLottiePlayer from '../../lib/rlottie/rlottiePlayer';\nimport rootScope from '../../lib/rootScope';\nimport animationIntersector, {AnimationItemGroup} from '../animationIntersector';\nimport Scrollable, {ScrollableBase, ScrollableX} from '../scrollable';\nimport wrapSticker from '../wrappers/sticker';\n\nconst REACTIONS_CLASS_NAME = 'btn-menu-reactions';\nconst REACTION_CLASS_NAME = REACTIONS_CLASS_NAME + '-reaction';\n\nconst REACTION_SIZE = 26;\nconst PADDING = 4;\nexport const REACTION_CONTAINER_SIZE = REACTION_SIZE + PADDING * 2;\n\nconst CAN_USE_TRANSFORM = !IS_SAFARI;\n\ntype ChatReactionsMenuPlayers = {\n select?: RLottiePlayer,\n appear?: RLottiePlayer,\n selectWrapper: HTMLElement,\n appearWrapper: HTMLElement,\n reaction: Reaction\n};\nexport class ChatReactionsMenu {\n public widthContainer: HTMLElement;\n public container: HTMLElement;\n private reactionsMap: Map;\n public scrollable: ScrollableBase;\n private animationGroup: AnimationItemGroup;\n private middleware: ReturnType;\n private message: Message.message;\n\n constructor(\n private managers: AppManagers,\n private type: 'horizontal' | 'vertical',\n middleware: ChatReactionsMenu['middleware']\n ) {\n const widthContainer = this.widthContainer = document.createElement('div');\n widthContainer.classList.add(REACTIONS_CLASS_NAME + '-container');\n widthContainer.classList.add(REACTIONS_CLASS_NAME + '-container-' + type);\n\n const reactionsContainer = this.container = document.createElement('div');\n reactionsContainer.classList.add(REACTIONS_CLASS_NAME);\n\n const reactionsScrollable = this.scrollable = type === 'vertical' ? new Scrollable(undefined) : new ScrollableX(undefined);\n reactionsContainer.append(reactionsScrollable.container);\n reactionsScrollable.onAdditionalScroll = this.onScroll;\n reactionsScrollable.setListeners();\n\n reactionsScrollable.container.classList.add('no-scrollbar');\n\n // ['big'].forEach((type) => {\n // const bubble = document.createElement('div');\n // bubble.classList.add(REACTIONS_CLASS_NAME + '-bubble', REACTIONS_CLASS_NAME + '-bubble-' + type);\n // reactionsContainer.append(bubble);\n // });\n\n this.reactionsMap = new Map();\n this.animationGroup = `CHAT-MENU-REACTIONS-${Date.now()}`;\n animationIntersector.setOverrideIdleGroup(this.animationGroup, true);\n\n if(!IS_TOUCH_SUPPORTED) {\n reactionsContainer.addEventListener('mousemove', this.onMouseMove);\n }\n\n attachClickEvent(reactionsContainer, (e) => {\n const reactionDiv = findUpClassName(e.target, REACTION_CLASS_NAME);\n if(!reactionDiv) return;\n\n const players = this.reactionsMap.get(reactionDiv);\n if(!players) return;\n\n this.managers.appReactionsManager.sendReaction(this.message, players.reaction);\n });\n\n widthContainer.append(reactionsContainer);\n\n this.middleware = middleware ?? getMiddleware();\n }\n\n public init(message: Message.message) {\n this.message = message;\n\n const middleware = this.middleware.get();\n // const result = Promise.resolve(this.appReactionsManager.getAvailableReactionsForPeer(message.peerId)).then((res) => pause(1000).then(() => res));\n const result = this.managers.appReactionsManager.getAvailableReactionsByMessage(message);\n callbackify(result, (reactions) => {\n if(!middleware() || !reactions.length) return;\n reactions.forEach((reaction) => {\n if(reaction.pFlags.premium && !rootScope.premium) return;\n this.renderReaction(reaction);\n });\n\n const setVisible = () => {\n this.container.classList.add('is-visible');\n };\n\n if(result instanceof Promise) {\n fastRaf(setVisible);\n } else {\n setVisible();\n }\n });\n }\n\n public cleanup() {\n this.middleware.clean();\n this.scrollable.removeListeners();\n this.reactionsMap.clear();\n animationIntersector.setOverrideIdleGroup(this.animationGroup, false);\n animationIntersector.checkAnimations(true, this.animationGroup, true);\n }\n\n private onScroll = () => {\n this.reactionsMap.forEach((players, div) => {\n this.onScrollProcessItem(div, players);\n });\n };\n\n private canUseAnimations() {\n return liteMode.isAvailable('animations') && liteMode.isAvailable('stickers_chat') && !IS_MOBILE;\n }\n\n private renderReaction(reaction: AvailableReaction) {\n const reactionDiv = document.createElement('div');\n reactionDiv.classList.add(REACTION_CLASS_NAME);\n\n const scaleContainer = document.createElement('div');\n scaleContainer.classList.add(REACTION_CLASS_NAME + '-scale');\n\n const appearWrapper = document.createElement('div');\n let selectWrapper: HTMLElement;;\n appearWrapper.classList.add(REACTION_CLASS_NAME + '-appear');\n\n if(this.canUseAnimations()) {\n selectWrapper = document.createElement('div');\n selectWrapper.classList.add(REACTION_CLASS_NAME + '-select', 'hide');\n }\n\n const players: ChatReactionsMenuPlayers = {\n selectWrapper,\n appearWrapper,\n reaction: {_: 'reactionEmoji', emoticon: reaction.reaction}\n };\n this.reactionsMap.set(reactionDiv, players);\n\n const middleware = this.middleware.get();\n\n const hoverScale = IS_TOUCH_SUPPORTED ? 1 : 1.25;\n const size = REACTION_SIZE * hoverScale;\n\n const options = {\n width: size,\n height: size,\n skipRatio: 1,\n needFadeIn: false,\n withThumb: false,\n group: this.animationGroup,\n middleware\n };\n\n if(!this.canUseAnimations()) {\n delete options.needFadeIn;\n delete options.withThumb;\n\n wrapSticker({\n doc: reaction.static_icon,\n div: appearWrapper,\n liteModeKey: false,\n ...options\n });\n } else {\n let isFirst = true;\n wrapSticker({\n doc: reaction.appear_animation,\n div: appearWrapper,\n play: true,\n liteModeKey: false,\n ...options\n }).then(({render}) => render).then((player) => {\n assumeType(player);\n\n players.appear = player;\n\n player.addEventListener('enterFrame', (frameNo) => {\n if(player.maxFrame === frameNo) {\n selectLoadPromise.then((selectPlayer) => {\n assumeType(selectPlayer);\n appearWrapper.classList.add('hide');\n selectWrapper.classList.remove('hide');\n\n if(isFirst) {\n players.select = selectPlayer;\n isFirst = false;\n }\n }, noop);\n }\n });\n }, noop);\n\n const selectLoadPromise = wrapSticker({\n doc: reaction.select_animation,\n div: selectWrapper,\n liteModeKey: false,\n ...options\n }).then(({render}) => render).then((player) => {\n assumeType(player);\n\n return lottieLoader.waitForFirstFrame(player);\n }).catch(noop);\n }\n\n scaleContainer.append(appearWrapper);\n selectWrapper && scaleContainer.append(selectWrapper);\n reactionDiv.append(scaleContainer);\n this.scrollable.append(reactionDiv);\n }\n\n private onScrollProcessItem(div: HTMLElement, players: ChatReactionsMenuPlayers) {\n // return;\n\n const scaleContainer = div.firstElementChild as HTMLElement;\n const visibleRect = getVisibleRect(div, this.scrollable.container);\n let transform: string;\n if(!visibleRect) {\n if(!players.appearWrapper.classList.contains('hide') || !players.appear) {\n return;\n }\n\n if(players.select) {\n players.select.stop();\n }\n\n players.appear.stop();\n players.appear.autoplay = true;\n players.appearWrapper.classList.remove('hide');\n players.selectWrapper.classList.add('hide');\n\n transform = '';\n } else if(visibleRect.overflow.left || visibleRect.overflow.right) {\n const diff = Math.abs(visibleRect.rect.left - visibleRect.rect.right);\n const scale = Math.min(diff ** 2 / REACTION_CONTAINER_SIZE ** 2, 1);\n\n transform = 'scale(' + scale + ')';\n } else {\n transform = '';\n }\n\n if(CAN_USE_TRANSFORM) {\n scaleContainer.style.transform = transform;\n }\n }\n\n private onMouseMove = (e: MouseEvent) => {\n const reactionDiv = findUpClassName(e.target, REACTION_CLASS_NAME);\n if(!reactionDiv) {\n return;\n }\n\n const players = this.reactionsMap.get(reactionDiv);\n if(!players) {\n return;\n }\n\n // do not play select animation when appearing\n if(!players.appear?.paused) {\n return;\n }\n\n const player = players.select;\n if(!player) {\n return;\n }\n\n if(player.paused) {\n player.autoplay = true;\n player.restart();\n }\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport type Chat from './chat';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport ButtonMenu, {ButtonMenuItemOptions} from '../buttonMenu';\nimport PopupDeleteMessages from '../popups/deleteMessages';\nimport PopupForward from '../popups/forward';\nimport PopupPinMessage from '../popups/unpinMessage';\nimport {copyTextToClipboard} from '../../helpers/clipboard';\nimport PopupSendNow from '../popups/sendNow';\nimport {toast} from '../toast';\nimport I18n, {i18n, LangPackKey} from '../../lib/langPack';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent, simulateClickEvent} from '../../helpers/dom/clickEvent';\nimport isSelectionEmpty from '../../helpers/dom/isSelectionEmpty';\nimport {Message, Poll, Chat as MTChat, MessageMedia, AvailableReaction, MessageEntity, InputStickerSet, StickerSet, Document, Reaction, Photo} from '../../layer';\nimport PopupReportMessages from '../popups/reportMessages';\nimport assumeType from '../../helpers/assumeType';\nimport PopupSponsored from '../popups/sponsored';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport {getMiddleware} from '../../helpers/middleware';\nimport PeerTitle from '../peerTitle';\nimport StackedAvatars from '../stackedAvatars';\nimport {IS_APPLE} from '../../environment/userAgent';\nimport PopupReactedList from '../popups/reactedList';\nimport {ChatReactionsMenu, REACTION_CONTAINER_SIZE} from './reactionsMenu';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport getServerMessageId from '../../lib/appManagers/utils/messageId/getServerMessageId';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport positionMenu, {MenuPositionPadding} from '../../helpers/positionMenu';\nimport contextMenuController from '../../helpers/contextMenuController';\nimport {attachContextMenuListener} from '../../helpers/dom/attachContextMenuListener';\nimport filterAsync from '../../helpers/array/filterAsync';\nimport appDownloadManager, {DownloadBlob} from '../../lib/appManagers/appDownloadManager';\nimport {SERVICE_PEER_ID} from '../../lib/mtproto/mtproto_config';\nimport {MessagesStorageKey, MyMessage} from '../../lib/appManagers/appMessagesManager';\nimport filterUnique from '../../helpers/array/filterUnique';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport PopupStickers from '../popups/stickers';\nimport getMediaFromMessage from '../../lib/appManagers/utils/messages/getMediaFromMessage';\nimport canSaveMessageMedia from '../../lib/appManagers/utils/messages/canSaveMessageMedia';\nimport getAlbumText from '../../lib/appManagers/utils/messages/getAlbumText';\n\nexport default class ChatContextMenu {\n private buttons: (ButtonMenuItemOptions & {verify: () => boolean | Promise, notDirect?: () => boolean, withSelection?: true, isSponsored?: true, localName?: 'views' | 'emojis'})[];\n private element: HTMLElement;\n\n private isSelectable: boolean;\n private isSelected: boolean;\n private target: HTMLElement;\n private isTargetAGroupedItem: boolean;\n private isTextSelected: boolean;\n private isAnchorTarget: boolean;\n private isUsernameTarget: boolean;\n private isSponsored: boolean;\n private isOverBubble: boolean;\n private peerId: PeerId;\n private mid: number;\n private message: Message.message | Message.messageService;\n private noForwards: boolean;\n\n private reactionsMenu: ChatReactionsMenu;\n private listenerSetter: ListenerSetter;\n private attachListenerSetter: ListenerSetter;\n\n private viewerPeerId: PeerId;\n private middleware: ReturnType;\n private canOpenReactedList: boolean;\n\n private emojiInputsPromise: CancellablePromise;\n private albumMessages: Message.message[];\n private linkToMessage: Awaited>;\n private selectedMessagesText: string;\n private selectedMessages: MyMessage[];\n\n constructor(\n private chat: Chat,\n private managers: AppManagers\n ) {\n this.listenerSetter = new ListenerSetter();\n this.attachListenerSetter = new ListenerSetter();\n this.middleware = getMiddleware();\n }\n\n public attachTo(element: HTMLElement) {\n this.attachListenerSetter.removeAll();\n\n if(IS_TOUCH_SUPPORTED/* && false */) {\n attachClickEvent(element, (e) => {\n if(this.chat.selection.isSelecting) {\n return;\n }\n\n this.chat.log('touchend', e);\n\n const badSelectors = [\n '.name',\n '.peer-title',\n '.reply',\n '.document',\n 'audio-element',\n 'avatar-element',\n 'a',\n '.bubble-beside-button',\n 'replies-element',\n '[data-saved-from]:not(.bubble)',\n 'poll-element',\n '.attachment',\n '.reply-markup-button'\n ];\n const good = !(e.target as HTMLElement).closest(badSelectors.join(', '));\n if(good) {\n cancelEvent(e);\n // onContextMenu((e as TouchEvent).changedTouches[0]);\n // onContextMenu((e as TouchEvent).changedTouches ? (e as TouchEvent).changedTouches[0] : e as MouseEvent);\n this.onContextMenu(e);\n }\n }, {listenerSetter: this.attachListenerSetter});\n } else attachContextMenuListener({\n element,\n callback: this.onContextMenu,\n listenerSetter: this.attachListenerSetter\n });\n }\n\n private onContextMenu = (e: MouseEvent | Touch | TouchEvent) => {\n let bubble: HTMLElement, contentWrapper: HTMLElement;\n\n try {\n contentWrapper = findUpClassName(e.target, 'bubble-content-wrapper');\n bubble = contentWrapper ? contentWrapper.parentElement : findUpClassName(e.target, 'bubble');\n } catch(e) {}\n\n // ! context menu click by date bubble (there is no pointer-events)\n if(!bubble || bubble.classList.contains('bubble-first')) return;\n\n let element = this.element;\n if(e instanceof MouseEvent || e.hasOwnProperty('preventDefault')) (e as any).preventDefault();\n if(element && element.classList.contains('active')) {\n return false;\n }\n if(e instanceof MouseEvent || e.hasOwnProperty('cancelBubble')) (e as any).cancelBubble = true;\n\n let mid = +bubble.dataset.mid;\n if(!mid) return;\n\n const r = async() => {\n const isSponsored = this.isSponsored = mid < 0;\n this.isSelectable = this.chat.selection.canSelectBubble(bubble);\n this.peerId = this.chat.peerId;\n // this.msgID = msgID;\n this.target = e.target as HTMLElement;\n this.isTextSelected = !isSelectionEmpty();\n this.isAnchorTarget = this.target.tagName === 'A' && (\n (this.target as HTMLAnchorElement).target === '_blank' ||\n this.target.classList.contains('anchor-url')\n );\n this.isUsernameTarget = this.target.tagName === 'A' && this.target.classList.contains('mention');\n\n const mids = await this.chat.getMidsByMid(mid);\n // * если открыть контекстное меню для альбома не по бабблу, и последний элемент не выбран, чтобы показать остальные пункты\n if(this.chat.selection.isSelecting && !contentWrapper) {\n if(isSponsored) {\n return;\n }\n\n if(mids.length > 1) {\n const selectedMid = this.chat.selection.isMidSelected(this.peerId, mid) ?\n mid :\n mids.find((mid) => this.chat.selection.isMidSelected(this.peerId, mid));\n if(selectedMid) {\n mid = selectedMid;\n }\n }\n }\n\n this.isOverBubble = !!contentWrapper;\n\n const groupedItem = findUpClassName(this.target, 'grouped-item');\n this.isTargetAGroupedItem = !!groupedItem;\n if(groupedItem) {\n this.mid = +groupedItem.dataset.mid;\n } else {\n this.mid = mid;\n }\n\n this.isSelected = this.chat.selection.isMidSelected(this.peerId, this.mid);\n this.message = (bubble as any).message || await this.chat.getMessage(this.mid);\n this.albumMessages = (this.message as Message.message).grouped_id ? await this.managers.appMessagesManager.getMessagesByAlbum((this.message as Message.message).grouped_id) : undefined;\n this.noForwards = !isSponsored && !(await this.managers.appMessagesManager.canForward(this.message));\n this.viewerPeerId = undefined;\n this.canOpenReactedList = undefined;\n this.linkToMessage = await this.getUrlToMessage();\n this.selectedMessagesText = await this.getSelectedMessagesText();\n this.selectedMessages = this.chat.selection.isSelecting ? await this.chat.selection.getSelectedMessages() : undefined;\n\n const initResult = await this.init();\n if(!initResult) {\n return;\n }\n\n element = initResult.element;\n const {cleanup, destroy, menuPadding, reactionsMenu, reactionsMenuPosition} = initResult;\n let isReactionsMenuVisible = false;\n if(reactionsMenu) {\n const className = 'is-visible';\n isReactionsMenuVisible = reactionsMenu.container.classList.contains(className);\n if(isReactionsMenuVisible) reactionsMenu.container.classList.remove(className);\n\n if(reactionsMenuPosition === 'horizontal') {\n const offsetSize = element[/* reactionsMenuPosition === 'vertical' ? 'offsetHeight' : */'offsetWidth'];\n // if(reactionsMenu.scrollable.container.scrollWidth > offsetWidth) {\n const INNER_CONTAINER_PADDING = 8;\n const visibleLength = (offsetSize - INNER_CONTAINER_PADDING) / REACTION_CONTAINER_SIZE;\n const nextVisiblePart = visibleLength % 1;\n const MIN_NEXT_VISIBLE_PART = 0.65;\n if(nextVisiblePart < MIN_NEXT_VISIBLE_PART) {\n const minSize = (offsetSize + (MIN_NEXT_VISIBLE_PART - nextVisiblePart) * REACTION_CONTAINER_SIZE) | 0;\n element.style[/* reactionsMenuPosition === 'vertical' ? 'minHeight' : */'minWidth'] = minSize + 'px';\n }\n // }\n }\n }\n\n const side: 'left' | 'right' = bubble.classList.contains('is-in') ? 'left' : 'right';\n // bubble.parentElement.append(element);\n // appImManager.log('contextmenu', e, bubble, side);\n positionMenu((e as TouchEvent).touches ? (e as TouchEvent).touches[0] : e as MouseEvent, element, side, menuPadding);\n\n if(reactionsMenu) {\n reactionsMenu.widthContainer.style.top = element.style.top;\n reactionsMenu.widthContainer.style.left = element.style.left;\n reactionsMenu.widthContainer.style.setProperty('--menu-width', element[reactionsMenuPosition === 'vertical' ? 'offsetHeight' : 'offsetWidth'] + 'px');\n element.parentElement.append(reactionsMenu.widthContainer);\n if(isReactionsMenuVisible) void reactionsMenu.container.offsetLeft; // reflow\n }\n\n contextMenuController.openBtnMenu(element, () => {\n if(reactionsMenu) {\n reactionsMenu.container.classList.remove('is-visible');\n }\n\n this.mid = 0;\n this.peerId = undefined;\n this.target = null;\n this.viewerPeerId = undefined;\n this.canOpenReactedList = undefined;\n cleanup();\n\n setTimeout(() => {\n destroy();\n }, 300);\n });\n\n if(isReactionsMenuVisible) {\n reactionsMenu.container.classList.add('is-visible');\n }\n };\n\n r();\n };\n\n public cleanup() {\n this.listenerSetter.removeAll();\n this.reactionsMenu && this.reactionsMenu.cleanup();\n this.middleware.clean();\n }\n\n public destroy() {\n this.cleanup();\n this.attachListenerSetter.removeAll();\n }\n\n private async filterButtons(buttons: ChatContextMenu['buttons']) {\n if(this.isSponsored) {\n return buttons.filter((button) => {\n return button.isSponsored;\n });\n } else {\n return filterAsync(buttons, async(button) => {\n let good: boolean;\n\n // if((appImManager.chatSelection.isSelecting && !button.withSelection) || (button.withSelection && !appImManager.chatSelection.isSelecting)) {\n if(this.chat.selection.isSelecting && !button.withSelection) {\n good = false;\n } else {\n good = this.isOverBubble || IS_TOUCH_SUPPORTED || true ?\n await button.verify() :\n button.notDirect && await button.verify() && button.notDirect();\n }\n\n return !!good;\n });\n }\n }\n\n private setButtons() {\n const verifyFavoriteSticker = async(toAdd: boolean) => {\n const doc = ((this.message as Message.message).media as MessageMedia.messageMediaDocument)?.document;\n if(!(doc as MyDocument)?.sticker) {\n return false;\n }\n\n const favedStickers = await this.managers.acknowledged.appStickersManager.getFavedStickersStickers();\n if(!favedStickers.cached) {\n return false;\n }\n\n const found = (await favedStickers.result).some((_doc) => _doc.id === doc.id);\n return toAdd ? !found : found;\n };\n\n this.buttons = [{\n icon: 'send2',\n text: 'MessageScheduleSend',\n onClick: this.onSendScheduledClick,\n verify: () => this.chat.type === 'scheduled' && !this.message.pFlags.is_outgoing\n }, {\n icon: 'send2',\n text: 'Message.Context.Selection.SendNow',\n onClick: this.onSendScheduledClick,\n verify: () => this.chat.type === 'scheduled' && this.isSelected && !this.chat.selection.selectionSendNowBtn.hasAttribute('disabled'),\n notDirect: () => true,\n withSelection: true\n }, {\n icon: 'schedule',\n text: 'MessageScheduleEditTime',\n onClick: () => {\n this.chat.input.scheduleSending(() => {\n assumeType(this.message);\n this.managers.appMessagesManager.editMessage(this.message, this.message.message, {\n scheduleDate: this.chat.input.scheduleDate,\n entities: this.message.entities\n });\n\n this.chat.input.onMessageSent(false, false);\n }, new Date(this.message.date * 1000));\n },\n verify: () => this.chat.type === 'scheduled'\n }, {\n icon: 'reply',\n text: 'Reply',\n onClick: this.onReplyClick,\n verify: async() => await this.chat.canSend() &&\n !this.message.pFlags.is_outgoing &&\n !!this.chat.input.messageInput &&\n this.chat.type !== 'scheduled'/* ,\n cancelEvent: true */\n }, {\n icon: 'favourites',\n text: 'AddToFavorites',\n onClick: this.onFaveStickerClick.bind(this, false),\n verify: () => verifyFavoriteSticker(true)\n }, {\n icon: 'favourites',\n text: 'DeleteFromFavorites',\n onClick: this.onFaveStickerClick.bind(this, true),\n verify: () => verifyFavoriteSticker(false)\n }, {\n icon: 'edit',\n text: 'Edit',\n onClick: this.onEditClick,\n verify: async() => (await this.managers.appMessagesManager.canEditMessage(this.message, 'text')) && !!this.chat.input.messageInput\n }, {\n icon: 'copy',\n text: 'Copy',\n onClick: this.onCopyClick,\n verify: () => !this.noForwards && !!(this.message as Message.message).message && !this.isTextSelected && (!this.isAnchorTarget || (this.message as Message.message).message !== this.target.innerText)\n }, {\n icon: 'copy',\n text: 'Chat.CopySelectedText',\n onClick: this.onCopyClick,\n verify: () => !this.noForwards && !!(this.message as Message.message).message && this.isTextSelected\n }, {\n icon: 'copy',\n text: 'Message.Context.Selection.Copy',\n onClick: this.onCopyClick,\n verify: async() => {\n if(!this.isSelected || this.noForwards) {\n return false;\n }\n\n for(const [peerId, mids] of this.chat.selection.selectedMids) {\n const storageKey: MessagesStorageKey = `${peerId}_${this.chat.type === 'scheduled' ? 'scheduled' : 'history'}`;\n for(const mid of mids) {\n const message = (await this.managers.appMessagesManager.getMessageFromStorage(storageKey, mid)) as Message.message;\n if(!!message.message) {\n return true;\n }\n }\n }\n\n return false;\n },\n notDirect: () => true,\n withSelection: true\n }, {\n icon: 'copy',\n text: 'CopyLink',\n onClick: this.onCopyAnchorLinkClick,\n verify: () => this.isAnchorTarget,\n withSelection: true\n }, {\n icon: 'copy',\n text: 'Text.Context.Copy.Username',\n onClick: () => {\n copyTextToClipboard(this.target.innerHTML);\n },\n verify: () => this.isUsernameTarget,\n withSelection: true\n }, {\n icon: 'copy',\n text: 'Text.Context.Copy.Hashtag',\n onClick: () => {\n copyTextToClipboard(this.target.innerHTML);\n },\n verify: () => this.target.classList.contains('anchor-hashtag'),\n withSelection: true\n }, {\n icon: 'link',\n text: 'MessageContext.CopyMessageLink1',\n onClick: this.onCopyLinkClick,\n verify: async() => await this.managers.appPeersManager.isChannel(this.peerId) && !this.message.pFlags.is_outgoing\n }, {\n icon: 'pin',\n text: 'Message.Context.Pin',\n onClick: this.onPinClick,\n verify: async() => !this.message.pFlags.is_outgoing &&\n this.message._ !== 'messageService' &&\n !this.message.pFlags.pinned &&\n await this.managers.appPeersManager.canPinMessage(this.peerId) &&\n this.chat.type !== 'scheduled'\n }, {\n icon: 'unpin',\n text: 'Message.Context.Unpin',\n onClick: this.onUnpinClick,\n verify: async() => (this.message as Message.message).pFlags.pinned && await this.managers.appPeersManager.canPinMessage(this.peerId)\n }, {\n icon: 'download',\n text: 'MediaViewer.Context.Download',\n onClick: () => ChatContextMenu.onDownloadClick(this.message, this.noForwards),\n verify: () => ChatContextMenu.canDownload(this.message, this.target, this.noForwards)\n }, {\n icon: 'checkretract',\n text: 'Chat.Poll.Unvote',\n onClick: this.onRetractVote,\n verify: () => {\n const poll = (this.message as any).media?.poll as Poll;\n return poll && poll.chosenIndexes.length && !poll.pFlags.closed && !poll.pFlags.quiz;\n }/* ,\n cancelEvent: true */\n }, {\n icon: 'stop',\n text: 'Chat.Poll.Stop',\n onClick: this.onStopPoll,\n verify: async() => {\n const poll = (this.message as any).media?.poll;\n return await this.managers.appMessagesManager.canEditMessage(this.message, 'poll') && poll && !poll.pFlags.closed && !this.message.pFlags.is_outgoing;\n }/* ,\n cancelEvent: true */\n }, {\n icon: 'forward',\n text: 'Forward',\n onClick: this.onForwardClick, // let forward the message if it's outgoing but not ours (like a changelog)\n verify: () => !this.noForwards && this.chat.type !== 'scheduled' && (!this.message.pFlags.is_outgoing || this.message.fromId === SERVICE_PEER_ID) && this.message._ !== 'messageService'\n }, {\n icon: 'forward',\n text: 'Message.Context.Selection.Forward',\n onClick: this.onForwardClick,\n verify: () => this.chat.selection.selectionForwardBtn &&\n this.isSelected &&\n !this.chat.selection.selectionForwardBtn.hasAttribute('disabled'),\n notDirect: () => true,\n withSelection: true\n }, {\n icon: 'download',\n text: 'Message.Context.Selection.Download',\n onClick: () => ChatContextMenu.onDownloadClick(this.selectedMessages, this.noForwards),\n verify: () => this.selectedMessages && ChatContextMenu.canDownload(this.selectedMessages, undefined, this.noForwards),\n withSelection: true\n }, {\n icon: 'flag',\n text: 'ReportChat',\n onClick: () => {\n new PopupReportMessages(this.peerId, [this.mid]);\n },\n verify: async() => !this.message.pFlags.out && this.message._ === 'message' && !this.message.pFlags.is_outgoing && await this.managers.appPeersManager.isChannel(this.peerId),\n notDirect: () => true,\n withSelection: true\n }, {\n icon: 'select',\n text: 'Message.Context.Select',\n onClick: this.onSelectClick,\n verify: () => !(this.message as Message.messageService).action && !this.isSelected && this.isSelectable,\n notDirect: () => true,\n withSelection: true\n }, {\n icon: 'select',\n text: 'Message.Context.Selection.Clear',\n onClick: this.onClearSelectionClick,\n verify: () => this.isSelected,\n notDirect: () => true,\n withSelection: true\n }, {\n onClick: () => {\n if(this.viewerPeerId) {\n this.chat.appImManager.setInnerPeer({\n peerId: this.viewerPeerId\n });\n } else if(this.canOpenReactedList) {\n new PopupReactedList(this.message as Message.message);\n } else {\n return false;\n }\n },\n verify: async() => !this.peerId.isUser() && (!!(this.message as Message.message).reactions?.recent_reactions?.length || await this.managers.appMessagesManager.canViewMessageReadParticipants(this.message)),\n notDirect: () => true,\n localName: 'views'\n }, {\n icon: 'delete danger',\n text: 'Delete',\n onClick: this.onDeleteClick,\n verify: async() => this.managers.appMessagesManager.canDeleteMessage(this.message)\n }, {\n icon: 'delete danger',\n text: 'Message.Context.Selection.Delete',\n onClick: this.onDeleteClick,\n verify: () => this.isSelected && !this.chat.selection.selectionDeleteBtn.hasAttribute('disabled'),\n notDirect: () => true,\n withSelection: true\n }, {\n icon: 'info',\n text: 'Chat.Message.Sponsored.What',\n onClick: () => {\n new PopupSponsored();\n },\n verify: () => false,\n isSponsored: true\n }, {\n // icon: 'smile',\n text: 'Loading',\n onClick: () => {\n this.emojiInputsPromise.then((inputs) => {\n new PopupStickers(inputs, true).show();\n });\n },\n verify: () => !!this.getUniqueCustomEmojisFromMessage().length,\n notDirect: () => true,\n localName: 'emojis'\n }];\n }\n\n public static canDownload(message: MyMessage | MyMessage[], withTarget?: HTMLElement, noForwards?: boolean): boolean {\n if(Array.isArray(message)) {\n return message.some((message) => ChatContextMenu.canDownload(message, withTarget, noForwards));\n }\n\n if(!canSaveMessageMedia(message) || noForwards) {\n return false;\n }\n\n const isPhoto: boolean = !!((message as Message.message).media as MessageMedia.messageMediaPhoto)?.photo;\n let isGoodType = false\n\n if(isPhoto) {\n isGoodType = true;\n } else {\n const doc: MyDocument = ((message as Message.message).media as MessageMedia.messageMediaDocument)?.document as any;\n if(!doc) return false;\n // isGoodType = doc.type && (['gif', 'video', 'audio', 'voice', 'sticker'] as MyDocument['type'][]).includes(doc.type)\n isGoodType = true;\n }\n\n let hasTarget = !withTarget || !!IS_TOUCH_SUPPORTED;\n\n if(isGoodType && withTarget) {\n hasTarget ||= !!(findUpClassName(withTarget, 'document') ||\n findUpClassName(withTarget, 'audio') ||\n findUpClassName(withTarget, 'media-sticker-wrapper') ||\n findUpClassName(withTarget, 'media-photo') ||\n findUpClassName(withTarget, 'media-video'));\n }\n\n return isGoodType && hasTarget;\n }\n\n private getMessageWithText() {\n return (this.albumMessages && getAlbumText(this.albumMessages)) || this.message;\n }\n\n private getUniqueCustomEmojisFromMessage() {\n const docIds: DocId[] = [];\n\n const message = this.getMessageWithText();\n\n const entities = (message as Message.message).entities;\n if(entities) {\n const filtered = entities.filter((entity) => entity._ === 'messageEntityCustomEmoji') as MessageEntity.messageEntityCustomEmoji[];\n docIds.push(...filtered.map((entity) => entity.document_id));\n }\n\n const reactions = (message as Message.message).reactions;\n if(reactions) {\n const results = reactions.results.filter((reactionCount) => reactionCount.reaction._ === 'reactionCustomEmoji');\n docIds.push(...results.map((reactionCount) => (reactionCount.reaction as Reaction.reactionCustomEmoji).document_id));\n }\n\n return filterUnique(docIds);\n }\n\n private async init() {\n this.cleanup();\n this.setButtons();\n\n const filteredButtons = await this.filterButtons(this.buttons);\n if(!filteredButtons.length) {\n return;\n }\n\n const element = this.element = await ButtonMenu({\n buttons: filteredButtons,\n listenerSetter: this.listenerSetter\n });\n element.id = 'bubble-contextmenu';\n element.classList.add('contextmenu');\n\n const viewsButton = filteredButtons.find((button) => button.localName === 'views');\n if(viewsButton) {\n const reactions = (this.message as Message.message).reactions;\n const recentReactions = reactions?.recent_reactions;\n const isViewingReactions = !!recentReactions?.length;\n const participantsCount = await this.managers.appMessagesManager.canViewMessageReadParticipants(this.message) ?\n ((await this.managers.appPeersManager.getPeer(this.peerId)) as MTChat.chat).participants_count :\n undefined;\n const reactedLength = reactions ? reactions.results.reduce((acc, r) => acc + r.count, 0) : undefined;\n\n viewsButton.element.classList.add('tgico-' + (isViewingReactions ? 'reactions' : 'checks'));\n const i18nElem = new I18n.IntlElement({\n key: isViewingReactions ? (\n participantsCount === undefined ? 'Chat.Context.ReactedFast' : 'Chat.Context.Reacted'\n ) : 'NobodyViewed',\n args: isViewingReactions ? (\n participantsCount === undefined ? [reactedLength] : [participantsCount, participantsCount]\n ) : undefined,\n element: viewsButton.textElement\n });\n\n let fakeText: HTMLElement;\n if(isViewingReactions) {\n if(participantsCount === undefined) {\n fakeText = i18n('Chat.Context.ReactedFast', [reactedLength]);\n } else {\n fakeText = i18n(\n recentReactions.length === participantsCount ? 'Chat.Context.ReactedFast' : 'Chat.Context.Reacted',\n [recentReactions.length, participantsCount]\n );\n }\n } else {\n fakeText = i18n('Loading');\n }\n\n fakeText.classList.add('btn-menu-item-text-fake');\n viewsButton.element.append(fakeText);\n\n const AVATAR_SIZE = 22;\n const MAX_AVATARS = 3;\n const PADDING_PER_AVATAR = 1.125;\n i18nElem.element.style.visibility = 'hidden';\n i18nElem.element.style.paddingRight = isViewingReactions ? PADDING_PER_AVATAR * Math.min(MAX_AVATARS, recentReactions.length) + 'rem' : '1rem';\n const middleware = this.middleware.get();\n this.managers.appMessagesManager.getMessageReactionsListAndReadParticipants(this.message as Message.message).then((result) => {\n if(!middleware()) {\n return;\n }\n\n if(fakeText) {\n fakeText.remove();\n }\n\n const reactions = result.combined;\n const reactedLength = participantsCount === undefined ?\n result.reactionsCount :\n (\n isViewingReactions ?\n reactions.filter((reaction) => reaction.reaction).length :\n reactions.length\n );\n\n let fakeElem: HTMLElement;\n if(reactions.length === 1) {\n fakeElem = new PeerTitle({\n peerId: reactions[0].peerId,\n onlyFirstName: true,\n dialog: false\n }).element;\n\n if(!isViewingReactions || result.readParticipants.length <= 1) {\n this.viewerPeerId = reactions[0].peerId;\n }\n } else if(isViewingReactions) {\n const isFull = reactedLength === reactions.length || participantsCount === undefined;\n fakeElem = i18n(\n isFull ? 'Chat.Context.ReactedFast' : 'Chat.Context.Reacted',\n isFull ? [reactedLength] : [reactedLength, reactions.length]\n );\n } else {\n if(!reactions.length) {\n i18nElem.element.style.visibility = '';\n } else {\n fakeElem = i18n('MessageSeen', [reactions.length]);\n }\n }\n\n if(fakeElem) {\n fakeElem.style.paddingRight = PADDING_PER_AVATAR * Math.min(MAX_AVATARS, reactedLength) + 'rem';\n fakeElem.classList.add('btn-menu-item-text-fake');\n viewsButton.element.append(fakeElem);\n }\n\n if(reactions.length) {\n const avatars = new StackedAvatars({avatarSize: AVATAR_SIZE});\n avatars.render(recentReactions ? recentReactions.map((r) => getPeerId(r.peer_id)) : reactions.map((reaction) => reaction.peerId));\n viewsButton.element.append(avatars.container);\n\n // if(reactions.length > 1) {\n // if(isViewingReactions) {\n this.canOpenReactedList = true;\n // }\n }\n });\n }\n\n let menuPadding: MenuPositionPadding;\n let reactionsMenu: ChatReactionsMenu;\n let reactionsMenuPosition: 'horizontal' | 'vertical';\n if(\n this.message._ === 'message' &&\n !this.chat.selection.isSelecting &&\n !this.message.pFlags.is_outgoing &&\n !this.message.pFlags.is_scheduled &&\n !this.message.pFlags.local\n ) {\n reactionsMenuPosition = (IS_APPLE || IS_TOUCH_SUPPORTED)/* && false */ ? 'horizontal' : 'vertical';\n reactionsMenu = this.reactionsMenu = new ChatReactionsMenu(this.managers, reactionsMenuPosition, this.middleware);\n reactionsMenu.init(await this.managers.appMessagesManager.getGroupsFirstMessage(this.message));\n // element.prepend(reactionsMenu.widthContainer);\n\n const size = 36;\n const margin = 8;\n const totalSize = size + margin;\n const paddingLeft = 0, paddingRight = 0;\n if(reactionsMenuPosition === 'vertical') {\n menuPadding = {\n top: paddingLeft,\n // bottom: 36, // positionMenu will detect it itself somehow\n left: totalSize\n };\n } else {\n menuPadding = {\n top: totalSize,\n right: paddingRight,\n left: paddingLeft\n };\n }\n }\n\n const emojisButton = filteredButtons.find((button) => button.localName === 'emojis');\n if(emojisButton) {\n emojisButton.element.classList.add('is-multiline');\n emojisButton.element.parentElement.insertBefore(document.createElement('hr'), emojisButton.element);\n\n const setPadding = () => {\n menuPadding ??= {};\n menuPadding.bottom = 24;\n };\n\n const docIds = this.getUniqueCustomEmojisFromMessage();\n const inputsPromise = this.emojiInputsPromise = deferredPromise();\n\n await this.managers.appEmojiManager.getCachedCustomEmojiDocuments(docIds).then(async(docs) => {\n const p = async(docs: Document.document[]) => {\n const s: Map = new Map();\n docs.forEach((doc) => {\n if(!doc || s.has(doc.stickerSetInput.id)) {\n return;\n }\n\n s.set(doc.stickerSetInput.id, doc.stickerSetInput);\n });\n\n const inputs = [...s.values()];\n inputsPromise.resolve(inputs);\n if(s.size === 1) {\n const result = await this.managers.acknowledged.appStickersManager.getStickerSet(inputs[0]);\n const promise = result.result.then((set) => {\n const el = i18n('MessageContainsEmojiPack', [wrapEmojiText(set.set.title)]);\n replaceContent(emojisButton.textElement, el);\n });\n\n return result.cached ? promise : (setPadding(), undefined);\n }\n\n replaceContent(emojisButton.textElement, i18n('MessageContainsEmojiPacks', [s.size]));\n };\n\n if(docs.some((doc) => !doc)) {\n setPadding();\n this.managers.appEmojiManager.getCustomEmojiDocuments(docIds).then(p);\n } else {\n return p(docs);\n }\n });\n // emojisButton.element.append(i18n('Loading'));\n }\n\n this.chat.container.append(element);\n\n return {\n element,\n cleanup: () => {\n this.cleanup();\n reactionsMenu && reactionsMenu.cleanup();\n },\n destroy: () => {\n element.remove();\n reactionsMenu && reactionsMenu.widthContainer.remove();\n },\n menuPadding,\n reactionsMenu,\n reactionsMenuPosition\n };\n }\n\n private async getUrlToMessage() {\n if(this.peerId.isUser()) {\n return;\n }\n\n let threadMessage: Message.message;\n const {peerId, mid} = this;\n const threadId = this.chat.threadId;\n if(this.chat.type === 'discussion') {\n threadMessage = (await this.managers.appMessagesManager.getMessageByPeer(peerId, threadId)) as Message.message;\n }\n\n const username = await this.managers.appPeersManager.getPeerUsername(threadMessage ? threadMessage.fromId : peerId);\n const msgId = getServerMessageId(mid);\n let url = 'https://t.me/';\n if(username) {\n url += username;\n if(threadMessage) url += `/${getServerMessageId(threadMessage.fwd_from.channel_post)}?comment=${msgId}`;\n else if(threadId) url += `/${getServerMessageId(threadId)}/${msgId}`;\n else url += '/' + msgId;\n } else {\n url += 'c/' + peerId.toChatId();\n if(threadMessage) url += `/${msgId}?thread=${getServerMessageId(threadMessage.mid)}`;\n else if(threadId) url += `/${getServerMessageId(threadId)}/${msgId}`;\n else url += '/' + msgId;\n }\n\n return {url, isPrivate: !username};\n }\n\n private async getSelectedMessagesText() {\n if(!isSelectionEmpty()) {\n return '';\n }\n\n const mids = this.chat.selection.isSelecting ?\n [...this.chat.selection.selectedMids.get(this.peerId)].sort((a, b) => a - b) :\n [this.mid];\n\n const parts: string[] = await Promise.all(mids.map(async(mid) => {\n const message = (await this.chat.getMessage(mid)) as Message.message;\n return message?.message ? message.message + '\\n' : '';\n }));\n\n return parts.join('');\n }\n\n private onSendScheduledClick = async() => {\n if(this.chat.selection.isSelecting) {\n simulateClickEvent(this.chat.selection.selectionSendNowBtn);\n } else {\n new PopupSendNow(this.peerId, await this.chat.getMidsByMid(this.mid));\n }\n };\n\n private onReplyClick = () => {\n this.chat.input.initMessageReply(this.mid);\n };\n\n private onFaveStickerClick = (unfave?: boolean) => {\n const docId = ((this.message as Message.message).media as MessageMedia.messageMediaDocument).document.id;\n this.managers.appStickersManager.faveSticker(docId, unfave);\n };\n\n private onEditClick = () => {\n const message = this.getMessageWithText();\n this.chat.input.initMessageEditing(this.isTargetAGroupedItem ? this.mid : message.mid);\n };\n\n private onCopyClick = async() => {\n if(isSelectionEmpty()) {\n copyTextToClipboard(this.selectedMessagesText);\n } else {\n document.execCommand('copy');\n // cancelSelection();\n }\n };\n\n private onCopyAnchorLinkClick = () => {\n copyTextToClipboard((this.target as HTMLAnchorElement).href);\n };\n\n private onCopyLinkClick = () => {\n const {url, isPrivate} = this.linkToMessage;\n const key: LangPackKey = isPrivate ? 'LinkCopiedPrivateInfo' : 'LinkCopied';\n toast(I18n.format(key, true));\n copyTextToClipboard(url);\n };\n\n private onPinClick = () => {\n new PopupPinMessage(this.peerId, this.mid);\n };\n\n private onUnpinClick = () => {\n new PopupPinMessage(this.peerId, this.mid, true);\n };\n\n private onRetractVote = () => {\n this.managers.appPollsManager.sendVote(this.message as Message.message, []);\n };\n\n private onStopPoll = () => {\n this.managers.appPollsManager.stopPoll(this.message as Message.message);\n };\n\n private onForwardClick = async() => {\n if(this.chat.selection.isSelecting) {\n simulateClickEvent(this.chat.selection.selectionForwardBtn);\n } else {\n const peerId = this.peerId;\n const mids = this.isTargetAGroupedItem ? [this.mid] : await this.chat.getMidsByMid(this.mid);\n PopupForward.create({\n [peerId]: mids\n });\n }\n };\n\n private onSelectClick = () => {\n this.chat.selection.toggleByElement(findUpClassName(this.target, 'grouped-item') || findUpClassName(this.target, 'bubble'));\n };\n\n private onClearSelectionClick = () => {\n this.chat.selection.cancelSelection();\n };\n\n private onDeleteClick = async() => {\n if(this.chat.selection.isSelecting) {\n simulateClickEvent(this.chat.selection.selectionDeleteBtn);\n } else {\n new PopupDeleteMessages(this.peerId, this.isTargetAGroupedItem ? [this.mid] : await this.chat.getMidsByMid(this.mid), this.chat.type);\n }\n };\n\n public static onDownloadClick(messages: MyMessage | MyMessage[], noForwards?: boolean): DownloadBlob | DownloadBlob[] {\n if(Array.isArray(messages)) {\n return messages.map((message) => {\n return this.onDownloadClick(message) as any;\n });\n }\n\n if(!this.canDownload(messages, undefined, noForwards)) {\n return;\n }\n\n return appDownloadManager.downloadToDisc({media: getMediaFromMessage(messages, true)});\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko, Artem Kolnogorov and unknown creator of the script taken from http://useless.altervista.org/gradient.html\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {animateSingle} from '../../helpers/animation';\nimport {hexToRgb} from '../../helpers/color';\nimport {easeOutQuadApply} from '../../helpers/easing/easeOutQuad';\n\nconst WIDTH = 50;\nconst HEIGHT = WIDTH;\n\nexport default class ChatBackgroundGradientRenderer {\n private readonly _width = WIDTH;\n private readonly _height = HEIGHT;\n private _phase: number;\n private _tail: number;\n private readonly _tails = 90;\n private readonly _scrollTails = 50;\n private _frames: ImageData[];\n private _colors: {r: number, g: number, b: number}[];\n private readonly _curve = [\n 0, 0.25, 0.50, 0.75, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5, 6, 7, 8, 9, 10, 11, 12,\n 13, 14, 15, 16, 17, 18, 18.3, 18.6, 18.9, 19.2, 19.5, 19.8, 20.1, 20.4, 20.7,\n 21.0, 21.3, 21.6, 21.9, 22.2, 22.5, 22.8, 23.1, 23.4, 23.7, 24.0, 24.3, 24.6,\n 24.9, 25.2, 25.5, 25.8, 26.1, 26.3, 26.4, 26.5, 26.6, 26.7, 26.8, 26.9, 27\n ];\n private readonly _incrementalCurve: number[];\n private readonly _positions = [\n {x: 0.80, y: 0.10},\n {x: 0.60, y: 0.20},\n {x: 0.35, y: 0.25},\n {x: 0.25, y: 0.60},\n {x: 0.20, y: 0.90},\n {x: 0.40, y: 0.80},\n {x: 0.65, y: 0.75},\n {x: 0.75, y: 0.40}\n ];\n private readonly _phases = this._positions.length;\n private _onWheelRAF: number;\n private _scrollDelta: number;\n\n // private _ts = 0;\n // private _fps = 15;\n // private _frametime = 1000 / this._fps;\n // private _raf: number;\n\n private _canvas: HTMLCanvasElement;\n private _ctx: CanvasRenderingContext2D;\n private _hc: HTMLCanvasElement;\n private _hctx: CanvasRenderingContext2D;\n\n private _addedScrollListener: boolean;\n private _animatingToNextPosition: boolean;\n private _nextPositionTail: number;\n private _nextPositionTails: number;\n private _nextPositionLeft: number;\n\n constructor() {\n const diff = this._tails / this._curve[this._curve.length - 1];\n\n for(let i = 0, length = this._curve.length; i < length; ++i) {\n this._curve[i] = this._curve[i] * diff;\n }\n\n this._incrementalCurve = this._curve.map((v, i, arr) => {\n return v - (arr[i - 1] ?? 0);\n });\n }\n\n private hexToRgb(hex: string) {\n const result = hexToRgb(hex);\n return {r: result[0], g: result[1], b: result[2]};\n }\n\n private getPositions(shift: number) {\n const positions = this._positions.slice();\n positions.push(...positions.splice(0, shift));\n\n const result: typeof positions = [];\n for(let i = 0; i < positions.length; i += 2) {\n result.push(positions[i]);\n }\n return result;\n }\n\n private getNextPositions(phase: number, curveMax: number, curve: number[]) {\n const pos = this.getPositions(phase);\n if(!curve[0] && curve.length === 1) {\n return [pos];\n }\n\n const nextPos = this.getPositions(++phase % this._phases);\n const distances = nextPos.map((nextPos, idx) => {\n return {\n x: (nextPos.x - pos[idx].x) / curveMax,\n y: (nextPos.y - pos[idx].y) / curveMax\n };\n });\n\n const positions = curve.map((value) => {\n return distances.map((distance, idx) => {\n return {\n x: pos[idx].x + distance.x * value,\n y: pos[idx].y + distance.y * value\n };\n });\n });\n\n return positions;\n }\n\n private curPosition(phase: number, tail: number) {\n const positions = this.getNextPositions(phase, this._tails, [tail]);\n return positions[0];\n }\n\n private changeTail(diff: number) {\n this._tail += diff;\n\n while(this._tail >= this._tails) {\n this._tail -= this._tails;\n if(++this._phase >= this._phases) {\n this._phase -= this._phases;\n }\n }\n\n while(this._tail < 0) {\n this._tail += this._tails;\n if(--this._phase < 0) {\n this._phase += this._phases;\n }\n }\n }\n\n private onWheel = (e: {deltaY: number}) => {\n if(this._animatingToNextPosition) {\n return;\n }\n\n this._scrollDelta += e.deltaY;\n if(this._onWheelRAF === undefined) {\n this._onWheelRAF = requestAnimationFrame(this.drawOnWheel);\n }\n };\n\n private changeTailAndDraw(diff: number) {\n this.changeTail(diff);\n const curPos = this.curPosition(this._phase, this._tail);\n this.drawGradient(curPos);\n }\n\n private drawOnWheel = () => {\n const value = this._scrollDelta / this._scrollTails;\n this._scrollDelta %= this._scrollTails;\n const diff = value > 0 ? Math.floor(value) : Math.ceil(value);\n if(diff) {\n this.changeTailAndDraw(diff);\n }\n this._onWheelRAF = undefined;\n };\n\n private drawNextPositionAnimated = (getProgress?: () => number) => {\n let done: boolean, id: ImageData;\n if(getProgress) {\n const value = getProgress();\n done = value >= 1;\n const transitionValue = easeOutQuadApply(value, 1);\n const nextPositionTail = this._nextPositionTail ?? 0;\n const tail = this._nextPositionTail = this._nextPositionTails * transitionValue;\n const diff = tail - nextPositionTail;\n if(diff) {\n this._nextPositionLeft -= diff;\n this.changeTailAndDraw(diff);\n }\n } else {\n const frames = this._frames;\n id = frames.shift();\n done = !frames.length;\n }\n\n if(id) {\n this.drawImageData(id);\n }\n\n if(done) {\n this._nextPositionLeft = undefined;\n this._nextPositionTails = undefined;\n this._nextPositionTail = undefined;\n this._animatingToNextPosition = undefined;\n }\n\n return !done;\n };\n\n private getGradientImageData(positions: {x: number, y: number}[]) {\n const id = this._hctx.createImageData(this._width, this._height);\n const pixels = id.data;\n\n let offset = 0;\n for(let y = 0; y < this._height; ++y) {\n const directPixelY = y / this._height;\n const centerDistanceY = directPixelY - 0.5;\n const centerDistanceY2 = centerDistanceY * centerDistanceY;\n\n for(let x = 0; x < this._width; ++x) {\n const directPixelX = x / this._width;\n\n const centerDistanceX = directPixelX - 0.5;\n const centerDistance = Math.sqrt(centerDistanceX * centerDistanceX + centerDistanceY2);\n\n const swirlFactor = 0.35 * centerDistance;\n const theta = swirlFactor * swirlFactor * 0.8 * 8.0;\n const sinTheta = Math.sin(theta);\n const cosTheta = Math.cos(theta);\n\n const pixelX = Math.max(0.0, Math.min(1.0, 0.5 + centerDistanceX * cosTheta - centerDistanceY * sinTheta));\n const pixelY = Math.max(0.0, Math.min(1.0, 0.5 + centerDistanceX * sinTheta + centerDistanceY * cosTheta));\n\n let distanceSum = 0.0;\n\n let r = 0.0;\n let g = 0.0;\n let b = 0.0;\n\n for(let i = 0; i < this._colors.length; i++) {\n const colorX = positions[i].x;\n const colorY = positions[i].y;\n\n const distanceX = pixelX - colorX;\n const distanceY = pixelY - colorY;\n\n let distance = Math.max(0.0, 0.9 - Math.sqrt(distanceX * distanceX + distanceY * distanceY));\n distance = distance * distance * distance * distance;\n distanceSum += distance;\n\n r += distance * this._colors[i].r / 255;\n g += distance * this._colors[i].g / 255;\n b += distance * this._colors[i].b / 255;\n }\n\n pixels[offset++] = r / distanceSum * 255.0;\n pixels[offset++] = g / distanceSum * 255.0;\n pixels[offset++] = b / distanceSum * 255.0;\n pixels[offset++] = 0xFF;\n }\n }\n return id;\n }\n\n private drawImageData(id: ImageData) {\n this._hctx.putImageData(id, 0, 0);\n this._ctx.drawImage(this._hc, 0, 0, this._width, this._height);\n }\n\n private drawGradient(positions: {x: number, y: number}[]) {\n this.drawImageData(this.getGradientImageData(positions));\n }\n\n // private doAnimate = () => {\n // const now = +Date.now();\n // if(!document.hasFocus() || (now - this._ts) < this._frametime) {\n // this._raf = requestAnimationFrame(this.doAnimate);\n // return;\n // }\n\n // this._ts = now;\n // this.changeTail(1);\n // const cur_pos = this.curPosition(this._phase, this._tail);\n // this.drawGradient(cur_pos);\n // this._raf = requestAnimationFrame(this.doAnimate);\n // };\n\n // public animate(start?: boolean) {\n // if(!start) {\n // cancelAnimationFrame(this._raf);\n // return;\n // }\n // this.doAnimate();\n // }\n\n public init(el: HTMLCanvasElement) {\n this._frames = [];\n this._phase = 0;\n this._tail = 0;\n this._scrollDelta = 0;\n if(this._onWheelRAF !== undefined) {\n cancelAnimationFrame(this._onWheelRAF);\n this._onWheelRAF = undefined;\n }\n\n const colors = el.getAttribute('data-colors').split(',').reverse();\n this._colors = colors.map((color) => {\n return this.hexToRgb(color);\n });\n\n if(!this._hc) {\n this._hc = document.createElement('canvas');\n this._hc.width = this._width;\n this._hc.height = this._height;\n this._hctx = this._hc.getContext('2d', {alpha: false});\n }\n\n this._canvas = el;\n this._ctx = this._canvas.getContext('2d', {alpha: false});\n this.update();\n }\n\n private update() {\n if(this._colors.length < 2) {\n const color = this._colors[0];\n this._ctx.fillStyle = `rgb(${color.r}, ${color.g}, ${color.b})`;\n this._ctx.fillRect(0, 0, this._width, this._height);\n return;\n }\n\n const pos = this.curPosition(this._phase, this._tail);\n this.drawGradient(pos);\n }\n\n public toNextPosition(getProgress?: () => number) {\n if(this._colors.length < 2) {\n return;\n }\n\n if(getProgress) {\n this._nextPositionLeft = this._tails + (this._nextPositionLeft ?? 0);\n this._nextPositionTails = this._nextPositionLeft;\n this._nextPositionTail = undefined;\n this._animatingToNextPosition = true;\n animateSingle(this.drawNextPositionAnimated.bind(this, getProgress), this);\n return;\n }\n\n const tail = this._tail;\n const tails = this._tails;\n\n let nextPhaseOnIdx: number;\n\n const curve: number[] = [];\n for(let i = 0, length = this._incrementalCurve.length; i < length; ++i) {\n const inc = this._incrementalCurve[i];\n let value = (curve[i - 1] ?? tail) + inc;\n\n if(+value.toFixed(2) > tails && nextPhaseOnIdx === undefined) {\n nextPhaseOnIdx = i;\n value %= tails;\n }\n\n curve.push(value);\n }\n\n const currentPhaseCurve = curve.slice(0, nextPhaseOnIdx);\n const nextPhaseCurve = nextPhaseOnIdx !== undefined ? curve.slice(nextPhaseOnIdx) : [];\n\n [currentPhaseCurve, nextPhaseCurve].forEach((curve, idx, curves) => {\n const last = curve[curve.length - 1];\n if(last !== undefined && last > tails) {\n curve[curve.length - 1] = +last.toFixed(2);\n }\n\n this._tail = last ?? 0;\n\n if(!curve.length) {\n return;\n }\n\n const positions = this.getNextPositions(this._phase, tails, curve);\n if(idx !== (curves.length - 1)) {\n if(++this._phase >= this._phases) {\n this._phase -= this._phases;\n }\n }\n\n const ids = positions.map((pos) => {\n return this.getGradientImageData(pos);\n });\n\n this._frames.push(...ids);\n });\n\n this._animatingToNextPosition = true;\n animateSingle(this.drawNextPositionAnimated, this);\n }\n\n // public toNextPositionThrottled = throttle(this.toNextPosition.bind(this), 100, true);\n\n public scrollAnimate(start?: boolean) {\n return;\n\n if(this._colors.length < 2 && start) {\n return;\n }\n\n if(start && !this._addedScrollListener) {\n document.addEventListener('wheel', this.onWheel);\n this._addedScrollListener = true;\n } else if(!start && this._addedScrollListener) {\n document.removeEventListener('wheel', this.onWheel);\n this._addedScrollListener = false;\n }\n }\n\n public cleanup() {\n this.scrollAnimate(false);\n // this.animate(false);\n }\n\n public static createCanvas(colors?: string) {\n const canvas = document.createElement('canvas');\n canvas.width = WIDTH;\n canvas.height = HEIGHT;\n if(colors !== undefined) {\n canvas.dataset.colors = colors;\n }\n\n return canvas;\n }\n\n public static create(colors?: string) {\n const canvas = this.createCanvas(colors);\n const gradientRenderer = new ChatBackgroundGradientRenderer();\n gradientRenderer.init(canvas);\n\n return {gradientRenderer, canvas};\n }\n}\n","export default function easeOutQuad(t: number, b: number, c: number, d: number) {\n return t >= d ? b + c : easeOutQuadApply(t / d, c) + b;\n}\n\nexport function easeOutQuadApply(v: number, c: number) {\n return -c * v * (v - 2);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type Chat from '../chat/chat';\nimport PopupElement from '.';\nimport CheckboxField from '../checkboxField';\nimport InputField from '../inputField';\nimport RadioField from '../radioField';\nimport Scrollable from '../scrollable';\nimport SendContextMenu from '../chat/sendContextMenu';\nimport I18n, {_i18n} from '../../lib/langPack';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport isInputEmpty from '../../helpers/dom/isInputEmpty';\nimport whichChild from '../../helpers/dom/whichChild';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport {Poll} from '../../layer';\nimport getRichValueWithCaret from '../../helpers/dom/getRichValueWithCaret';\n\nconst MAX_LENGTH_QUESTION = 255;\nconst MAX_LENGTH_OPTION = 100;\nconst MAX_LENGTH_SOLUTION = 200;\n\nexport default class PopupCreatePoll extends PopupElement {\n private questionInputField: InputField;\n private questions: HTMLElement;\n protected scrollable: Scrollable;\n private tempId = 0;\n\n private anonymousCheckboxField: CheckboxField;\n private multipleCheckboxField: PopupCreatePoll['anonymousCheckboxField'];\n private quizCheckboxField: PopupCreatePoll['anonymousCheckboxField'];\n\n private correctAnswers: Uint8Array[];\n private quizSolutionField: InputField;\n private optionInputFields: InputField[];\n\n constructor(private chat: Chat) {\n super('popup-create-poll popup-new-media', {closable: true, withConfirm: 'Create', body: true, title: 'NewPoll'});\n this.construct();\n }\n\n private async construct() {\n this.questionInputField = new InputField({\n placeholder: 'AskAQuestion',\n label: 'AskAQuestion',\n name: 'question',\n maxLength: MAX_LENGTH_QUESTION\n });\n\n this.listenerSetter.add(this.questionInputField.input)('input', () => {\n this.handleChange();\n });\n\n this.optionInputFields = [];\n\n if(this.chat.type !== 'scheduled') {\n const sendMenu = new SendContextMenu({\n onSilentClick: () => {\n this.chat.input.sendSilent = true;\n this.send();\n },\n onScheduleClick: () => {\n this.chat.input.scheduleSending(() => {\n this.send();\n });\n },\n openSide: 'bottom-left',\n onContextElement: this.btnConfirm\n });\n\n sendMenu.setPeerId(this.chat.peerId);\n\n this.header.append(sendMenu.sendMenu);\n }\n\n this.header.append(this.questionInputField.container);\n\n const hr = document.createElement('hr');\n const d = document.createElement('div');\n d.classList.add('caption');\n _i18n(d, 'PollOptions');\n\n this.questions = document.createElement('form');\n this.questions.classList.add('poll-create-questions');\n\n const dd = document.createElement('div');\n dd.classList.add('poll-create-settings');\n\n const settingsCaption = document.createElement('div');\n settingsCaption.classList.add('caption');\n _i18n(settingsCaption, 'Settings');\n\n if(!(await this.chat.managers.appPeersManager.isBroadcast(this.chat.peerId))) {\n this.anonymousCheckboxField = new CheckboxField({\n text: 'NewPoll.Anonymous',\n name: 'anonymous'\n });\n this.anonymousCheckboxField.input.checked = true;\n dd.append(this.anonymousCheckboxField.label);\n }\n\n this.multipleCheckboxField = new CheckboxField({\n text: 'NewPoll.MultipleChoice',\n name: 'multiple'\n });\n this.quizCheckboxField = new CheckboxField({\n text: 'NewPoll.Quiz',\n name: 'quiz'\n });\n\n this.listenerSetter.add(this.multipleCheckboxField.input)('change', () => {\n const checked = this.multipleCheckboxField.input.checked;\n this.quizCheckboxField.input.toggleAttribute('disabled', checked);\n });\n\n this.listenerSetter.add(this.quizCheckboxField.input)('change', () => {\n const checked = this.quizCheckboxField.input.checked;\n\n (Array.from(this.questions.children) as HTMLElement[]).map((el) => {\n el.classList.toggle('radio-field', checked);\n });\n\n if(!checked) {\n this.correctAnswers = undefined;\n this.quizSolutionField.setValueSilently('');\n }\n\n quizElements.forEach((el) => el.classList.toggle('hide', !checked));\n\n this.multipleCheckboxField.input.toggleAttribute('disabled', checked);\n this.handleChange();\n });\n\n dd.append(this.multipleCheckboxField.label, this.quizCheckboxField.label);\n\n const quizElements: HTMLElement[] = [];\n\n const quizSolutionCaption = document.createElement('div');\n quizSolutionCaption.classList.add('caption');\n _i18n(quizSolutionCaption, 'AccDescrQuizExplanation');\n\n const quizHr = document.createElement('hr');\n\n const quizSolutionContainer = document.createElement('div');\n quizSolutionContainer.classList.add('poll-create-questions');\n\n this.quizSolutionField = new InputField({\n placeholder: 'NewPoll.Explanation.Placeholder',\n label: 'NewPoll.Explanation.Placeholder',\n name: 'solution',\n maxLength: MAX_LENGTH_SOLUTION\n });\n\n this.listenerSetter.add(this.questionInputField.input)('input', () => {\n this.handleChange();\n });\n\n const quizSolutionSubtitle = document.createElement('div');\n quizSolutionSubtitle.classList.add('subtitle');\n _i18n(quizSolutionSubtitle, 'AddAnExplanationInfo');\n\n quizSolutionContainer.append(this.quizSolutionField.container, quizSolutionSubtitle);\n\n quizElements.push(quizHr, quizSolutionCaption, quizSolutionContainer);\n quizElements.forEach((el) => el.classList.add('hide'));\n\n this.body.parentElement.insertBefore(hr, this.body);\n this.body.append(d, this.questions, document.createElement('hr'), settingsCaption, dd, ...quizElements);\n\n attachClickEvent(this.btnConfirm, this.onSubmitClick, {listenerSetter: this.listenerSetter});\n\n this.scrollable = new Scrollable(this.body);\n this.appendMoreField();\n\n this.onEscape = () => {\n return !this.getFilledAnswers().length;\n };\n\n this.handleChange();\n }\n\n private getFilledAnswers() {\n const answers = Array.from(this.questions.children).map((el, idx) => {\n const input = el.querySelector('.input-field-input') as HTMLElement;\n return input instanceof HTMLInputElement ? input.value : getRichValueWithCaret(input, false, false).value;\n }).filter((v) => !!v.trim());\n\n return answers;\n }\n\n private onSubmitClick = () => {\n this.send();\n };\n\n private validate() {\n const question = this.questionInputField.value;\n if(!question) {\n return false;\n }\n\n if(question.length > MAX_LENGTH_QUESTION) {\n return false;\n }\n\n if(this.quizCheckboxField.input.checked && !this.correctAnswers?.length) {\n return false;\n }\n\n const answers = this.getFilledAnswers();\n if(answers.length < 2) {\n return false;\n }\n\n const tooLongOption = answers.find((a) => a.length > MAX_LENGTH_OPTION);\n if(tooLongOption) {\n return false;\n }\n\n const {value: quizSolution} = getRichValueWithCaret(this.quizSolutionField.input, false, false);\n if(quizSolution.length > MAX_LENGTH_SOLUTION) {\n return false;\n }\n\n return true;\n }\n\n private handleChange() {\n const valid = this.validate();\n this.btnConfirm.toggleAttribute('disabled', !valid);\n }\n\n public async send(force = false) {\n const question = this.questionInputField.value;\n\n const answers = this.getFilledAnswers();\n\n const {value: quizSolution, entities: quizSolutionEntities} = getRichValueWithCaret(this.quizSolutionField.input, true, false);\n\n if(this.chat.type === 'scheduled' && !force) {\n this.chat.input.scheduleSending(() => {\n this.send(true);\n });\n\n return;\n }\n\n this.hide();\n\n // const randomID = [nextRandomInt(0xFFFFFFFF), nextRandomInt(0xFFFFFFFF)];\n // const randomIDS = bigint(randomID[0]).shiftLeft(32).add(bigint(randomID[1])).toString();\n\n const pFlags: Poll['pFlags'] = {};\n\n if(this.anonymousCheckboxField && !this.anonymousCheckboxField.input.checked) {\n pFlags.public_voters = true;\n }\n\n if(this.multipleCheckboxField.input.checked) {\n pFlags.multiple_choice = true;\n }\n\n if(this.quizCheckboxField.input.checked) {\n pFlags.quiz = true;\n }\n\n const poll: Poll = {\n _: 'poll',\n pFlags,\n question,\n answers: answers.map((value, idx) => {\n return {\n _: 'pollAnswer',\n text: value,\n option: new Uint8Array([idx])\n };\n }),\n id: undefined\n };\n // poll.id = randomIDS;\n\n const inputMediaPoll = await this.chat.managers.appPollsManager.getInputMediaPoll(poll, this.correctAnswers, quizSolution, quizSolutionEntities);\n\n // console.log('Will try to create poll:', inputMediaPoll);\n\n this.chat.managers.appMessagesManager.sendOther(this.chat.peerId, inputMediaPoll, {\n ...this.chat.getMessageSendingParams()\n });\n\n if(this.chat.input.helperType === 'reply') {\n this.chat.input.clearHelper();\n }\n\n this.chat.input.onMessageSent(false, false);\n }\n\n onInput = (e: Event) => {\n const target = e.target as HTMLInputElement;\n\n const radioLabel = findUpTag(target, 'LABEL');\n const isEmpty = isInputEmpty(target);\n if(!isEmpty) {\n target.parentElement.classList.add('is-filled');\n radioLabel.classList.remove('hidden-widget');\n radioLabel.firstElementChild.removeAttribute('disabled');\n }\n\n const isLast = !radioLabel.nextElementSibling;\n if(isLast && !isEmpty && this.questions.childElementCount < 10) {\n this.appendMoreField();\n }\n\n this.handleChange();\n };\n\n onDeleteClick = (e: MouseEvent) => {\n const target = e.target as HTMLSpanElement;\n const label = findUpTag(target, 'LABEL');\n const idx = whichChild(label);\n\n if(this.correctAnswers && this.correctAnswers[0][0] === idx) {\n this.correctAnswers = undefined;\n }\n\n label.remove();\n this.optionInputFields.splice(idx, 1);\n\n this.optionInputFields.forEach((inputField, idx) => {\n inputField.options.labelOptions.length = 0;\n inputField.options.labelOptions.push(idx + 1);\n const i18nElement = I18n.weakMap.get(inputField.label.firstElementChild as HTMLElement);\n i18nElement.update();\n });\n\n this.handleChange();\n };\n\n private appendMoreField() {\n const tempId = this.tempId++;\n const idx = this.questions.childElementCount + 1;\n const questionField = new InputField({\n placeholder: 'NewPoll.OptionsAddOption',\n label: 'NewPoll.OptionLabel',\n labelOptions: [idx],\n name: 'question-' + tempId,\n maxLength: MAX_LENGTH_OPTION\n });\n this.listenerSetter.add(questionField.input)('input', this.onInput);\n\n const radioField = new RadioField({\n text: '',\n name: 'question'\n });\n radioField.main.append(questionField.container);\n attachClickEvent(questionField.input, cancelEvent, {listenerSetter: this.listenerSetter});\n radioField.label.classList.add('hidden-widget');\n radioField.input.disabled = true;\n if(!this.quizCheckboxField.input.checked) {\n radioField.label.classList.remove('radio-field');\n }\n this.listenerSetter.add(radioField.input)('change', () => {\n const checked = radioField.input.checked;\n if(checked) {\n const idx = whichChild(radioField.label);\n this.correctAnswers = [new Uint8Array([idx])];\n this.handleChange();\n }\n });\n\n const deleteBtn = document.createElement('span');\n deleteBtn.classList.add('btn-icon', 'tgico-close');\n questionField.container.append(deleteBtn);\n\n attachClickEvent(deleteBtn, this.onDeleteClick, {listenerSetter: this.listenerSetter, once: true});\n\n this.questions.append(radioField.label);\n\n this.scrollable.scrollIntoViewNew({\n element: this.questions.lastElementChild as HTMLElement,\n position: 'center'\n });\n // this.scrollable.scrollTo(this.scrollable.scrollHeight, 'top', true, true);\n\n this.optionInputFields.push(questionField);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport fastSmoothScroll from '../fastSmoothScroll';\nimport cancelEvent from './cancelEvent';\nimport {attachClickEvent} from './clickEvent';\nimport findUpAsChild from './findUpAsChild';\nimport findUpClassName from './findUpClassName';\n\ntype ArrowKey = 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight';\nconst HANDLE_EVENT = 'keydown';\nconst ACTIVE_CLASS_NAME = 'active';\n\nconst AXIS_Y_KEYS: ArrowKey[] = ['ArrowUp', 'ArrowDown'];\nconst AXIS_X_KEYS: ArrowKey[] = ['ArrowLeft', 'ArrowRight'];\n\nexport type ListNavigationOptions = {\n list: HTMLElement,\n type: 'xy' | 'x' | 'y',\n onSelect: (target: Element) => void | boolean | Promise,\n once: boolean,\n waitForKey?: string[]\n};\n\nexport default function attachListNavigation({list, type, onSelect, once, waitForKey}: ListNavigationOptions) {\n let waitForKeySet = waitForKey?.length ? new Set(waitForKey) : undefined;\n const keyNames = new Set(type === 'xy' ? AXIS_Y_KEYS.concat(AXIS_X_KEYS) : (type === 'x' ? AXIS_X_KEYS : AXIS_Y_KEYS));\n\n let target: Element;\n const getCurrentTarget = () => {\n return target || list.querySelector('.' + ACTIVE_CLASS_NAME) || list.firstElementChild;\n };\n\n const setCurrentTarget = (_target: Element, scrollTo: boolean) => {\n if(target === _target) {\n return;\n }\n\n let hadTarget = false;\n if(target) {\n hadTarget = true;\n target.classList.remove(ACTIVE_CLASS_NAME);\n }\n\n target = _target;\n if(!target) return;\n target.classList.add(ACTIVE_CLASS_NAME);\n\n if(hadTarget && scrollable && scrollTo) {\n fastSmoothScroll({\n container: scrollable,\n element: target as HTMLElement,\n position: 'center',\n forceDuration: 100,\n axis: type === 'x' ? 'x' : 'y'\n });\n }\n };\n\n const getNextTargetX = (currentTarget: Element, isNext: boolean) => {\n let nextTarget: Element;\n if(isNext) nextTarget = currentTarget.nextElementSibling || list.firstElementChild;\n else nextTarget = currentTarget.previousElementSibling || list.lastElementChild;\n\n return nextTarget;\n };\n\n const getNextTargetY = (currentTarget: Element, isNext: boolean) => {\n const property = isNext ? 'nextElementSibling' : 'previousElementSibling';\n const endProperty = isNext ? 'firstElementChild' : 'lastElementChild';\n const currentRect = currentTarget.getBoundingClientRect();\n\n let nextTarget = currentTarget[property] || list[endProperty];\n while(nextTarget !== currentTarget) {\n const targetRect = nextTarget.getBoundingClientRect();\n if(targetRect.x === currentRect.x && targetRect.y !== currentRect.y) {\n break;\n }\n\n nextTarget = nextTarget[property] || list[endProperty];\n }\n\n return nextTarget;\n };\n\n let handleArrowKey: (currentTarget: Element, key: ArrowKey) => Element;\n if(type === 'xy') { // flex-direction: row; flex-wrap: wrap;\n handleArrowKey = (currentTarget, key) => {\n if(key === 'ArrowUp' || key === 'ArrowDown') return getNextTargetY(currentTarget, key === 'ArrowDown');\n else return getNextTargetX(currentTarget, key === 'ArrowRight');\n };\n } else { // flex-direction: row | column;\n handleArrowKey = (currentTarget, key) => getNextTargetX(currentTarget, key === 'ArrowRight' || key === 'ArrowDown');\n }\n\n let onKeyDown = (e: KeyboardEvent) => {\n const key = e.key;\n if(!keyNames.has(key as any)) {\n if(key === 'Enter' || (type !== 'xy' && key === 'Tab')) {\n cancelEvent(e);\n fireSelect(getCurrentTarget());\n }\n\n return;\n }\n\n cancelEvent(e);\n\n if(list.childElementCount > 1) {\n let currentTarget = getCurrentTarget();\n currentTarget = handleArrowKey(currentTarget, key as any);\n setCurrentTarget(currentTarget, true);\n }\n };\n\n const scrollable = findUpClassName(list, 'scrollable');\n list.classList.add('navigable-list');\n\n const onMouseMove = (e: MouseEvent) => {\n const target = findUpAsChild(e.target as HTMLElement, list) as HTMLElement;\n if(!target) {\n return;\n }\n\n setCurrentTarget(target, false);\n };\n\n const onClick = (e: Event) => {\n cancelEvent(e); // cancel keyboard closening\n\n const target = findUpAsChild(e.target as HTMLElement, list) as HTMLElement;\n if(!target) {\n return;\n }\n\n setCurrentTarget(target, false);\n fireSelect(getCurrentTarget());\n };\n\n const fireSelect = async(target: Element) => {\n const canContinue = await onSelect(target);\n if(canContinue !== undefined ? !canContinue : once) {\n detach();\n }\n };\n\n let attached = false, detachClickEvent: () => void;\n const attach = () => {\n if(attached) return;\n attached = true;\n // const input = document.activeElement as HTMLElement;\n // input.addEventListener(HANDLE_EVENT, onKeyDown, {capture: true, passive: false});\n document.addEventListener(HANDLE_EVENT, onKeyDown, {capture: true, passive: false});\n list.addEventListener('mousemove', onMouseMove, {passive: true});\n detachClickEvent = attachClickEvent(list, onClick);\n };\n\n const detach = () => {\n if(!attached) return;\n attached = false;\n // input.removeEventListener(HANDLE_EVENT, onKeyDown, {capture: true});\n document.removeEventListener(HANDLE_EVENT, onKeyDown, {capture: true});\n list.removeEventListener('mousemove', onMouseMove);\n detachClickEvent();\n detachClickEvent = undefined;\n };\n\n const resetTarget = () => {\n if(waitForKeySet) return;\n setCurrentTarget(list.firstElementChild, false);\n };\n\n if(waitForKeySet) {\n const _onKeyDown = onKeyDown;\n onKeyDown = (e) => {\n if(waitForKeySet.has(e.key)) {\n cancelEvent(e);\n\n document.removeEventListener(HANDLE_EVENT, onKeyDown, {capture: true});\n onKeyDown = _onKeyDown;\n document.addEventListener(HANDLE_EVENT, onKeyDown, {capture: true, passive: false});\n\n waitForKeySet = undefined;\n resetTarget();\n }\n };\n } else {\n resetTarget();\n }\n\n attach();\n\n return {\n attach,\n detach,\n resetTarget\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport attachListNavigation, {ListNavigationOptions} from '../../helpers/dom/attachListNavigation';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport {IS_MOBILE} from '../../environment/userAgent';\nimport rootScope from '../../lib/rootScope';\nimport appNavigationController, {NavigationItem} from '../appNavigationController';\nimport SetTransition from '../singleTransition';\nimport AutocompleteHelperController from './autocompleteHelperController';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport liteMode from '../../helpers/liteMode';\n\nexport default class AutocompleteHelper extends EventListenerBase<{\n hidden: () => void,\n visible: () => void,\n hiding: () => void\n}> {\n protected hidden = true;\n protected container: HTMLElement;\n protected list: HTMLElement;\n protected resetTarget: () => void;\n protected attach: () => void;\n protected detach: () => void;\n protected init?(): void;\n\n protected controller: AutocompleteHelperController;\n protected listType: 'xy' | 'x' | 'y';\n protected onSelect: ListNavigationOptions['onSelect'];\n protected waitForKey?: string[];\n\n protected navigationItem: NavigationItem;\n\n constructor(options: {\n appendTo: HTMLElement,\n controller?: AutocompleteHelper['controller'],\n listType: AutocompleteHelper['listType'],\n onSelect: AutocompleteHelper['onSelect'],\n waitForKey?: AutocompleteHelper['waitForKey']\n }) {\n super(false);\n\n safeAssign(this, options);\n\n this.container = document.createElement('div');\n this.container.classList.add('autocomplete-helper', 'z-depth-1');\n\n options.appendTo.append(this.container);\n\n this.attachNavigation();\n\n this.controller?.addHelper(this);\n }\n\n public toggleListNavigation(enabled: boolean) {\n if(enabled) {\n this.attach?.();\n } else {\n this.detach?.();\n }\n }\n\n protected onVisible = () => {\n this.detach?.(); // it can be so because 'visible' calls before animation's end\n\n const list = this.list;\n const {attach, detach, resetTarget} = attachListNavigation({\n list,\n type: this.listType,\n onSelect: this.onSelect,\n once: true,\n waitForKey: this.waitForKey\n });\n\n this.attach = attach;\n this.detach = detach;\n this.resetTarget = resetTarget;\n if(!IS_MOBILE && !this.navigationItem) {\n this.navigationItem = {\n type: 'autocomplete-helper',\n onPop: () => {\n this.navigationItem = undefined;\n this.toggle(true);\n },\n noBlurOnPop: true\n };\n\n appNavigationController.pushItem(this.navigationItem);\n }\n\n this.addEventListener('hidden', () => {\n this.resetTarget = undefined;\n this.attach = undefined;\n this.detach = undefined;\n\n list.innerHTML = '';\n detach();\n\n if(this.navigationItem) {\n appNavigationController.removeItem(this.navigationItem);\n this.navigationItem = undefined;\n }\n }, {once: true});\n };\n\n protected attachNavigation() {\n this.addEventListener('visible', this.onVisible);\n }\n\n public toggle(hide?: boolean, fromController = false, skipAnimation?: boolean) {\n if(this.init) {\n return;\n }\n\n if(hide === undefined) {\n hide = this.container.classList.contains('is-visible') && !this.container.classList.contains('backwards');\n }\n\n if(this.hidden === hide) {\n if(!hide) {\n this.dispatchEvent('visible'); // reset target and listener\n }\n\n return;\n }\n\n this.hidden = hide;\n\n if(!hide) {\n this.controller && this.controller.hideOtherHelpers(this);\n this.dispatchEvent('visible'); // fire it before so target will be set\n } else {\n if(this.navigationItem) {\n appNavigationController.removeItem(this.navigationItem);\n this.navigationItem = undefined;\n }\n\n if(!fromController && this.controller) {\n this.controller.hideOtherHelpers();\n }\n\n this.detach?.(); // force detach here\n }\n\n const useRafs = this.controller || hide ? 0 : 2;\n\n if(hide) {\n this.dispatchEvent('hiding');\n }\n\n SetTransition({\n element: this.container,\n className: 'is-visible',\n forwards: !hide,\n duration: liteMode.isAvailable('animations') && !skipAnimation ? 300 : 0,\n onTransitionEnd: () => {\n this.hidden && this.dispatchEvent('hidden');\n },\n useRafs\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type Chat from './chat';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport preloadAnimatedEmojiSticker from '../../helpers/preloadAnimatedEmojiSticker';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport rootScope from '../../lib/rootScope';\nimport {EmoticonsDropdown} from '../emoticonsDropdown';\nimport {SuperStickerRenderer} from '../emoticonsDropdown/tabs/stickers';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport Scrollable from '../scrollable';\nimport attachStickerViewerListeners from '../stickerViewer';\nimport AutocompleteHelper from './autocompleteHelper';\nimport AutocompleteHelperController from './autocompleteHelperController';\n\nexport default class StickersHelper extends AutocompleteHelper {\n private scrollable: Scrollable;\n private superStickerRenderer: SuperStickerRenderer;\n private lazyLoadQueue: LazyLoadQueue;\n private onChangeScreen: () => void;\n private listenerSetter: ListenerSetter;\n\n constructor(\n appendTo: HTMLElement,\n controller: AutocompleteHelperController,\n private chat: Chat,\n private managers: AppManagers\n ) {\n super({\n appendTo,\n controller,\n listType: 'xy',\n onSelect: async(target) => {\n return !(await EmoticonsDropdown.onMediaClick({target}, true));\n },\n waitForKey: ['ArrowUp', 'ArrowDown']\n });\n\n this.container.classList.add('stickers-helper');\n\n this.addEventListener('visible', () => {\n setTimeout(() => { // it is not rendered yet\n this.scrollable.container.scrollTop = 0;\n }, 0);\n\n rootScope.dispatchEvent('choosing_sticker', true);\n });\n\n this.addEventListener('hidden', () => {\n if(this.onChangeScreen) {\n mediaSizes.removeEventListener('changeScreen', this.onChangeScreen);\n this.onChangeScreen = undefined;\n\n this.listenerSetter.removeAll();\n this.listenerSetter = undefined;\n }\n\n rootScope.dispatchEvent('choosing_sticker', false);\n });\n }\n\n public checkEmoticon(emoticon: string) {\n const middleware = this.controller.getMiddleware();\n\n this.lazyLoadQueue?.clear();\n\n preloadAnimatedEmojiSticker(emoticon);\n this.managers.appStickersManager.getStickersByEmoticon(emoticon, true, rootScope.settings.stickers.suggest === 'all')\n .then((stickers) => {\n if(!middleware()) {\n return;\n }\n\n if(this.init) {\n this.init();\n this.init = null;\n }\n\n const container = this.list.cloneNode() as HTMLElement;\n\n let ready: Promise;\n\n this.lazyLoadQueue.clear();\n if(stickers.length) {\n ready = new Promise((resolve) => {\n const promises: Promise[] = [];\n stickers.forEach((sticker) => {\n container.append(this.superStickerRenderer.renderSticker(sticker as MyDocument, undefined, promises));\n });\n\n (Promise.all(promises) as Promise).finally(resolve);\n });\n } else {\n ready = Promise.resolve();\n }\n\n ready.then(() => {\n this.list.replaceWith(container);\n this.list = container;\n\n if(!this.onChangeScreen) {\n this.onChangeScreen = () => {\n const width = (this.list.childElementCount * mediaSizes.active.esgSticker.width) + (this.list.childElementCount - 1 * 1);\n this.list.style.width = width + 'px';\n };\n mediaSizes.addEventListener('changeScreen', this.onChangeScreen);\n\n this.listenerSetter = new ListenerSetter();\n attachStickerViewerListeners({listenTo: this.container, listenerSetter: this.listenerSetter});\n }\n\n this.onChangeScreen();\n\n this.toggle(!stickers.length);\n this.scrollable.scrollTop = 0;\n });\n });\n }\n\n public init() {\n this.list = document.createElement('div');\n this.list.classList.add('stickers-helper-stickers', 'super-stickers');\n\n this.container.append(this.list);\n\n this.scrollable = new Scrollable(this.container);\n this.lazyLoadQueue = new LazyLoadQueue();\n this.superStickerRenderer = new SuperStickerRenderer(this.lazyLoadQueue, this.chat.animationGroup, this.managers);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport {SEND_WHEN_ONLINE_TIMESTAMP} from '../../lib/mtproto/constants';\nimport Button from '../button';\nimport PopupDatePicker from './datePicker';\n\nconst getMinDate = () => {\n const date = new Date();\n // date.setDate(date.getDate() - 1);\n date.setHours(0, 0, 0, 0);\n return date;\n};\n\nconst getMaxDate = () => {\n const date = new Date();\n date.setFullYear(date.getFullYear() + 1);\n date.setDate(date.getDate() - 1);\n return date;\n};\n\nconst checkDate = (date: Date) => {\n return date.getTime() > getMaxDate().getTime() ? new Date() : date;\n};\n\nexport default class PopupSchedule extends PopupDatePicker {\n constructor(initDate: Date, onPick: (timestamp: number) => void, canSendWhenOnline: boolean) {\n super(checkDate(initDate), onPick, {\n noButtons: true,\n noTitle: true,\n closable: true,\n withConfirm: true,\n minDate: getMinDate(),\n maxDate: getMaxDate(),\n withTime: true,\n showOverflowMonths: true,\n confirmShortcutIsSendShortcut: true,\n title: true\n });\n\n this.element.classList.add('popup-schedule');\n this.header.append(this.controlsDiv);\n this.title.replaceWith(this.monthTitle);\n this.body.append(this.btnConfirm);\n\n if(canSendWhenOnline) {\n const btnSendWhenOnline = Button('btn-primary btn-secondary btn-primary-transparent primary', {text: 'Schedule.SendWhenOnline'});\n this.body.append(btnSendWhenOnline);\n\n attachClickEvent(btnSendWhenOnline, () => {\n onPick(SEND_WHEN_ONLINE_TIMESTAMP);\n this.hide();\n });\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ChatInput from './input';\nimport {appendEmoji, getEmojiFromElement} from '../emoticonsDropdown/tabs/emoji';\nimport {ScrollableX} from '../scrollable';\nimport AutocompleteHelper from './autocompleteHelper';\nimport AutocompleteHelperController from './autocompleteHelperController';\nimport {AppManagers} from '../../lib/appManagers/managers';\n\nexport default class EmojiHelper extends AutocompleteHelper {\n private scrollable: ScrollableX;\n\n constructor(\n appendTo: HTMLElement,\n controller: AutocompleteHelperController,\n chatInput: ChatInput,\n private managers: AppManagers\n ) {\n super({\n appendTo,\n controller,\n listType: 'x',\n onSelect: (target) => {\n chatInput.onEmojiSelected(getEmojiFromElement(target as any), true);\n }\n });\n\n this.container.classList.add('emoji-helper');\n }\n\n public init() {\n this.list = document.createElement('div');\n this.list.classList.add('emoji-helper-emojis', 'super-emojis');\n\n this.container.append(this.list);\n\n this.scrollable = new ScrollableX(this.container);\n\n this.addEventListener('visible', () => {\n setTimeout(() => { // it is not rendered yet\n this.scrollable.container.scrollLeft = 0;\n }, 0);\n });\n }\n\n public render(emojis: string[], waitForKey: boolean) {\n if(this.init) {\n if(!emojis.length) {\n return;\n }\n\n this.init();\n this.init = null;\n }\n\n emojis = emojis.slice(0, 80);\n\n if(emojis.length) {\n this.list.innerHTML = '';\n emojis.forEach((emoji) => {\n appendEmoji(emoji, this.list, false, true);\n });\n }\n\n this.waitForKey = waitForKey ? ['ArrowUp', 'ArrowDown'] : undefined;\n this.toggle(!emojis.length);\n\n /* window.requestAnimationFrame(() => {\n this.container.style.width = (3 * 2) + (emojis.length * 44) + 'px';\n }); */\n }\n\n public checkQuery(query: string, firstChar: string) {\n const middleware = this.controller.getMiddleware();\n this.managers.appEmojiManager.getBothEmojiKeywords().then(async() => {\n if(!middleware()) {\n return;\n }\n\n const q = query.replace(/^:/, '');\n const emojis = await this.managers.appEmojiManager.searchEmojis(q);\n if(!middleware()) {\n return;\n }\n\n this.render(emojis, firstChar !== ':');\n // console.log(emojis);\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport AvatarElement from '../avatar';\nimport PeerTitle from '../peerTitle';\nimport Scrollable from '../scrollable';\nimport AutocompleteHelper from './autocompleteHelper';\nimport AutocompleteHelperController from './autocompleteHelperController';\n\nexport default class AutocompletePeerHelper extends AutocompleteHelper {\n protected static BASE_CLASS = 'autocomplete-peer-helper';\n protected static BASE_CLASS_LIST_ELEMENT = AutocompletePeerHelper.BASE_CLASS + '-list-element';\n private scrollable: Scrollable;\n\n constructor(\n appendTo: HTMLElement,\n controller: AutocompleteHelperController,\n protected className: string,\n onSelect: (target: Element) => boolean | void\n ) {\n super({\n appendTo,\n controller,\n listType: 'y',\n onSelect\n });\n\n this.container.classList.add(AutocompletePeerHelper.BASE_CLASS, className);\n }\n\n public init() {\n this.list = document.createElement('div');\n this.list.classList.add(AutocompletePeerHelper.BASE_CLASS + '-list', this.className + '-list');\n\n this.container.append(this.list);\n\n this.scrollable = new Scrollable(this.container);\n\n this.addEventListener('visible', () => {\n setTimeout(() => { // it is not rendered yet\n this.scrollable.container.scrollTop = 0;\n }, 0);\n });\n }\n\n public render(data: {peerId: PeerId, name?: string, description?: string}[], doNotShow?: boolean) {\n if(this.init) {\n if(!data.length) {\n return;\n }\n\n this.init();\n this.init = null;\n }\n\n if(data.length) {\n this.list.innerHTML = '';\n data.forEach((d) => {\n const div = AutocompletePeerHelper.listElement({\n className: this.className,\n peerId: d.peerId,\n name: d.name,\n description: d.description\n });\n\n this.list.append(div);\n });\n }\n\n if(!doNotShow) {\n this.toggle(!data.length);\n }\n }\n\n public static listElement(options: {\n className: string,\n peerId: PeerId,\n name?: string,\n description?: string\n }) {\n const BASE = AutocompletePeerHelper.BASE_CLASS_LIST_ELEMENT;\n options.className += '-list-element';\n\n const div = document.createElement('div');\n div.classList.add(BASE, options.className);\n div.dataset.peerId = '' + options.peerId;\n\n const avatar = new AvatarElement();\n avatar.classList.add('avatar-30', BASE + '-avatar', options.className + '-avatar');\n avatar.updateWithOptions({\n isDialog: false,\n peerId: options.peerId\n });\n\n const name = document.createElement('div');\n name.classList.add(BASE + '-name', options.className + '-name');\n if(!options.name) {\n name.append(new PeerTitle({\n peerId: options.peerId,\n dialog: false,\n onlyFirstName: false,\n plainText: false\n }).element);\n } else {\n setInnerHTML(name, wrapEmojiText(options.name));\n }\n\n div.append(avatar, name);\n\n if(options.description) {\n const description = document.createElement('div');\n description.classList.add(BASE + '-description', options.className + '-description');\n setInnerHTML(description, wrapEmojiText(options.description));\n div.append(description);\n }\n\n return div;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ChatInput from './input';\nimport type {BotInfo, ChatFull, UserFull} from '../../layer';\nimport AutocompleteHelperController from './autocompleteHelperController';\nimport AutocompletePeerHelper from './autocompletePeerHelper';\nimport SearchIndex from '../../lib/searchIndex';\nimport {AppManagers} from '../../lib/appManagers/managers';\n\nexport function processPeerFullForCommands(peerId: PeerId, full: ChatFull.chatFull | ChatFull.channelFull | UserFull.userFull, query?: string) {\n const botInfos: BotInfo.botInfo[] = [].concat(full.bot_info);\n let index: SearchIndex;\n\n if(query !== undefined) {\n index = new SearchIndex({\n ignoreCase: true\n });\n }\n\n type T = {peerId: PeerId, name: string, description: string, index: number, command: string};\n const commands: Map = new Map();\n botInfos.forEach((botInfo) => {\n if(!botInfo.commands) {\n return;\n }\n\n botInfo.commands.forEach(({command, description}, idx) => {\n const c = '/' + command;\n commands.set(command, {\n peerId: botInfo.user_id ? botInfo.user_id.toPeerId(false) : peerId,\n command: command,\n name: c,\n description: description,\n index: idx\n });\n\n if(index) {\n index.indexObject(command, c);\n }\n });\n });\n\n let out: T[];\n if(!index) {\n out = [...commands.values()];\n } else {\n const found = index.search(query);\n out = Array.from(found).map((command) => commands.get(command));\n }\n\n out = out.sort((a, b) => commands.get(a.command).index - commands.get(b.command).index);\n\n return out;\n}\n\nexport default class CommandsHelper extends AutocompletePeerHelper {\n constructor(\n appendTo: HTMLElement,\n controller: AutocompleteHelperController,\n chatInput: ChatInput,\n private managers: AppManagers\n ) {\n super(appendTo,\n controller,\n 'commands-helper',\n (target) => {\n const innerHTML = target.querySelector(`.${AutocompletePeerHelper.BASE_CLASS_LIST_ELEMENT}-name`).innerHTML;\n return chatInput.getReadyToSend(() => {\n chatInput.messageInput.innerHTML = innerHTML;\n chatInput.sendMessage(true);\n });\n }\n );\n }\n\n public async checkQuery(query: string, peerId: PeerId) {\n if(!(await this.managers.appUsersManager.isBot(peerId))) {\n return false;\n }\n\n const middleware = this.controller.getMiddleware();\n this.managers.appProfileManager.getProfileByPeerId(peerId).then((full) => {\n if(!middleware()) {\n return;\n }\n\n const filtered = processPeerFullForCommands(peerId, full, query);\n this.render(filtered);\n // console.log('found commands', found, filtered);\n });\n\n return true;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {getMiddleware} from '../../helpers/middleware';\nimport AutocompleteHelper from './autocompleteHelper';\n\nexport default class AutocompleteHelperController {\n private helpers: Set = new Set();\n private middleware = getMiddleware();\n /* private tempId = 0;\n\n public incrementToggleCount() {\n return ++this.tempId;\n }\n\n public getToggleCount() {\n return this.tempId;\n } */\n\n public toggleListNavigation(enabled: boolean) {\n for(const helper of this.helpers) {\n helper.toggleListNavigation(enabled);\n }\n }\n\n public getMiddleware() {\n this.middleware.clean();\n return this.middleware.get();\n }\n\n public addHelper(helper: AutocompleteHelper) {\n this.helpers.add(helper);\n }\n\n public hideOtherHelpers(preserveHelper?: AutocompleteHelper) {\n this.helpers.forEach((helper) => {\n if(helper !== preserveHelper) {\n helper.toggle(true, true);\n }\n });\n\n if(!preserveHelper) {\n this.middleware.clean();\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ChatInput from './input';\nimport type {MessageEntity} from '../../layer';\nimport AutocompleteHelperController from './autocompleteHelperController';\nimport AutocompletePeerHelper from './autocompletePeerHelper';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getPeerActiveUsernames from '../../lib/appManagers/utils/peers/getPeerActiveUsernames';\nimport rootScope from '../../lib/rootScope';\n\nexport default class MentionsHelper extends AutocompletePeerHelper {\n constructor(\n appendTo: HTMLElement,\n controller: AutocompleteHelperController,\n chatInput: ChatInput,\n private managers: AppManagers\n ) {\n super(\n appendTo,\n controller,\n 'mentions-helper',\n (target) => {\n const userId = (target as HTMLElement).dataset.peerId.toUserId();\n const user = Promise.resolve(managers.appUsersManager.getUser(userId)).then((user) => {\n let str = '', entity: MessageEntity;\n const usernames = getPeerActiveUsernames(user);\n if(usernames[0]) {\n str = '@' + usernames[0];\n } else {\n str = user.first_name || user.last_name;\n entity = {\n _: 'messageEntityMentionName',\n length: str.length,\n offset: 0,\n user_id: user.id\n };\n }\n\n str += ' ';\n chatInput.insertAtCaret(str, entity);\n });\n }\n );\n }\n\n public checkQuery(query: string, peerId: PeerId, topMsgId: number) {\n const trimmed = query.trim(); // check that there is no whitespace\n if(query.length !== trimmed.length) return false;\n\n const middleware = this.controller.getMiddleware();\n this.managers.appProfileManager.getMentions(peerId && peerId.toChatId(), trimmed, topMsgId).then(async(peerIds) => {\n if(!middleware()) return;\n\n peerIds = peerIds.filter((peerId) => peerId !== rootScope.myId);\n\n // const username = trimmed.slice(1).toLowerCase();\n\n const p = peerIds.map(async(peerId) => {\n const user = await this.managers.appUsersManager.getUser(peerId);\n const usernames = getPeerActiveUsernames(user);\n // if(usernames.length && usernames.some((_username) => _username.toLowerCase() === username)) { // hide full matched suggestion\n // return;\n // }\n\n return {\n peerId,\n description: usernames[0] ? '@' + usernames[0] : undefined\n };\n });\n\n this.render((await Promise.all(p)).filter(Boolean));\n });\n\n return true;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ChatInput from './input';\nimport DropdownHover from '../../helpers/dropdownHover';\nimport {KeyboardButton, ReplyMarkup} from '../../layer';\nimport rootScope from '../../lib/rootScope';\nimport ListenerSetter, {Listener} from '../../helpers/listenerSetter';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport findUpAsChild from '../../helpers/dom/findUpAsChild';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {getHeavyAnimationPromise} from '../../hooks/useHeavyAnimationCheck';\nimport confirmationPopup from '../confirmationPopup';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport Scrollable from '../scrollable';\n\nexport default class ReplyKeyboard extends DropdownHover {\n private static BASE_CLASS = 'reply-keyboard';\n private appendTo: HTMLElement;\n private listenerSetter: ListenerSetter;\n private managers: AppManagers;\n private btnHover: HTMLElement;\n private peerId: PeerId;\n private touchListener: Listener;\n private chatInput: ChatInput;\n private scrollable: Scrollable;\n\n constructor(options: {\n listenerSetter: ListenerSetter,\n managers: AppManagers,\n appendTo: HTMLElement,\n btnHover: HTMLElement,\n chatInput: ChatInput\n }) {\n super({\n element: document.createElement('div')\n });\n\n safeAssign(this, options);\n\n this.element.classList.add(ReplyKeyboard.BASE_CLASS);\n this.element.style.display = 'none';\n\n this.scrollable = new Scrollable();\n this.element.append(this.scrollable.container);\n\n this.attachButtonListener(this.btnHover, this.listenerSetter);\n this.listenerSetter.add(rootScope)('history_reply_markup', async({peerId}) => {\n if(this.peerId === peerId) {\n if(this.checkAvailability() && this.isActive()) {\n await this.render();\n }\n\n getHeavyAnimationPromise().then(() => {\n this.checkForceReply();\n });\n }\n });\n }\n\n public init() {\n this.appendTo.append(this.element);\n\n this.listenerSetter.add(this)('open', async() => {\n await this.render();\n\n if(IS_TOUCH_SUPPORTED) {\n this.touchListener = this.listenerSetter.add(document.body)('touchstart', this.onBodyTouchStart, {passive: false, capture: true}) as any as Listener;\n this.listenerSetter.add(this)('close', () => {\n this.listenerSetter.remove(this.touchListener);\n }, {once: true});\n }\n });\n\n attachClickEvent(this.element, (e) => {\n const target = findUpClassName(e.target, 'btn');\n if(!target) {\n return;\n }\n\n const type = target.dataset.type as KeyboardButton['_'];\n const {peerId} = this;\n switch(type) {\n case 'keyboardButtonRequestPhone': {\n confirmationPopup({\n titleLangKey: 'ShareYouPhoneNumberTitle',\n button: {\n langKey: 'OK'\n },\n descriptionLangKey: 'AreYouSureShareMyContactInfoBot'\n }).then(() => {\n this.managers.appMessagesManager.sendContact(peerId, rootScope.myId);\n });\n break;\n }\n\n default: {\n this.managers.appMessagesManager.sendText(peerId, target.dataset.text);\n break;\n }\n }\n\n this.toggle(false);\n }, {listenerSetter: this.listenerSetter});\n\n return super.init();\n }\n\n private onBodyTouchStart = (e: TouchEvent) => {\n const target = e.touches[0].target as HTMLElement;\n if(!findUpAsChild(target, this.element) && target !== this.btnHover) {\n cancelEvent(e);\n this.toggle(false);\n }\n };\n\n public async checkForceReply() {\n const replyMarkup = await this.getReplyMarkup();\n if(replyMarkup._ === 'replyKeyboardForceReply' &&\n !replyMarkup.pFlags.hidden &&\n !replyMarkup.pFlags.used) {\n replyMarkup.pFlags.used = true;\n this.chatInput.initMessageReply(replyMarkup.mid);\n }\n }\n\n private async getReplyMarkup(): Promise {\n return (await this.managers.appMessagesManager.getHistoryStorageTransferable(this.peerId)).replyMarkup ?? {\n _: 'replyKeyboardHide',\n pFlags: {}\n };\n }\n\n public async render(replyMarkup?: ReplyMarkup.replyKeyboardMarkup) {\n if(replyMarkup === undefined) {\n replyMarkup = await this.getReplyMarkup() as any;\n }\n\n this.scrollable.container.replaceChildren();\n\n for(const row of replyMarkup.rows) {\n const div = document.createElement('div');\n div.classList.add(ReplyKeyboard.BASE_CLASS + '-row');\n\n for(const button of row.buttons) {\n const btn = document.createElement('button');\n btn.classList.add(ReplyKeyboard.BASE_CLASS + '-button', 'btn');\n setInnerHTML(btn, wrapEmojiText(button.text));\n btn.dataset.text = button.text;\n btn.dataset.type = button._;\n div.append(btn);\n }\n\n this.scrollable.container.append(div);\n }\n }\n\n public async checkAvailability(replyMarkup?: ReplyMarkup) {\n if(replyMarkup === undefined) {\n replyMarkup = await this.getReplyMarkup();\n }\n\n const hide = replyMarkup._ === 'replyKeyboardHide' || !(replyMarkup as ReplyMarkup.replyInlineMarkup).rows?.length;\n this.btnHover.classList.toggle('hide', hide);\n\n if(hide) {\n this.toggle(false);\n }\n\n return !hide;\n }\n\n public setPeer(peerId: PeerId) {\n this.peerId = peerId;\n\n this.checkAvailability();\n this.checkForceReply();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type Chat from './chat';\nimport debounce from '../../helpers/schedulers/debounce';\nimport {WebDocument} from '../../layer';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport Scrollable from '../scrollable';\nimport AutocompleteHelper from './autocompleteHelper';\nimport AutocompleteHelperController from './autocompleteHelperController';\nimport Button from '../button';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport {MyPhoto} from '../../lib/appManagers/appPhotosManager';\nimport assumeType from '../../helpers/assumeType';\nimport GifsMasonry from '../gifsMasonry';\nimport {SuperStickerRenderer} from '../emoticonsDropdown/tabs/stickers';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport readBlobAsDataURL from '../../helpers/blob/readBlobAsDataURL';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport renderMediaWithFadeIn from '../../helpers/dom/renderMediaWithFadeIn';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\nimport generateQId from '../../lib/appManagers/utils/inlineBots/generateQId';\nimport appDownloadManager from '../../lib/appManagers/appDownloadManager';\nimport {AnimationItemGroup} from '../animationIntersector';\nimport wrapPhoto from '../wrappers/photo';\nimport {i18n} from '../../lib/langPack';\nimport {POSTING_NOT_ALLOWED_MAP} from './input';\n\nconst ANIMATION_GROUP: AnimationItemGroup = 'INLINE-HELPER';\n// const GRID_ITEMS = 5;\n\nexport default class InlineHelper extends AutocompleteHelper {\n private scrollable: Scrollable;\n private lazyLoadQueue: LazyLoadQueue;\n private gifsMasonry: GifsMasonry;\n private superStickerRenderer: SuperStickerRenderer;\n private onChangeScreen: () => void;\n public checkQuery: ReturnType>;\n\n constructor(\n appendTo: HTMLElement,\n controller: AutocompleteHelperController,\n private chat: Chat,\n private managers: AppManagers\n ) {\n super({\n appendTo,\n controller,\n listType: 'xy',\n waitForKey: ['ArrowUp', 'ArrowDown'],\n onSelect: (target) => {\n if(!target) return false; // can happen when there is only button\n const {peerId, botId, queryId} = this.list.dataset;\n return this.chat.input.getReadyToSend(() => {\n const queryAndResultIds = generateQId(queryId, (target as HTMLElement).dataset.resultId);\n this.managers.appInlineBotsManager.sendInlineResult(peerId.toPeerId(), botId, queryAndResultIds, {\n ...this.chat.getMessageSendingParams(),\n clearDraft: true\n });\n\n this.chat.input.onMessageSent(true, true);\n });\n }\n });\n\n this.container.classList.add('inline-helper');\n\n this.addEventListener('visible', () => {\n setTimeout(() => { // it is not rendered yet\n this.scrollable.container.scrollTop = 0;\n }, 0);\n });\n\n this.checkQuery = debounce(this._checkQuery, 200, true, true);\n\n this.addEventListener('hidden', () => {\n if(this.onChangeScreen) {\n mediaSizes.removeEventListener('changeScreen', this.onChangeScreen);\n this.onChangeScreen = undefined;\n }\n });\n }\n\n public _checkQuery = async(peerId: PeerId, username: string, query: string, canSendInline: boolean) => {\n const middleware = this.controller.getMiddleware();\n\n const peer = await this.managers.appUsersManager.resolveUsername(username);\n if(!middleware()) {\n throw 'PEER_CHANGED';\n }\n\n if(peer._ !== 'user' || !peer.pFlags.bot) {\n throw 'NOT_A_BOT';\n }\n\n if(!canSendInline) {\n if(!middleware()) {\n throw 'PEER_CHANGED';\n }\n\n if(this.init) {\n this.init();\n this.init = null;\n }\n\n this.container.classList.add('cant-send');\n this.toggle(false);\n throw 'NO_INLINES';\n }\n\n const renderPromise = this.managers.appInlineBotsManager.getInlineResults(peerId, peer.id, query).then((botResults) => {\n if(!middleware()) {\n throw 'PEER_CHANGED';\n }\n\n if(this.init) {\n this.init();\n this.init = null;\n }\n\n const list = this.list.cloneNode() as HTMLElement;\n list.dataset.peerId = '' + peerId;\n list.dataset.botId = '' + peer.id;\n list.dataset.queryId = '' + botResults.query_id;\n\n const gifsMasonry = new GifsMasonry(null, ANIMATION_GROUP, this.scrollable, false);\n\n this.lazyLoadQueue.clear();\n this.superStickerRenderer.clear();\n\n const loadPromises: Promise[] = [];\n const isGallery = !!botResults.pFlags.gallery;\n // botResults.results.length = 3;\n for(const item of botResults.results) {\n const container = document.createElement('div');\n container.classList.add('inline-helper-result');\n container.dataset.resultId = item.id;\n\n const preview = isGallery ? undefined : document.createElement('div');\n if(preview) {\n preview.classList.add('inline-helper-result-preview');\n\n container.append(preview);\n }\n\n list.append(container);\n\n if(!isGallery) {\n preview.classList.add('empty');\n setInnerHTML(preview, wrapEmojiText([...item.title.trim()][0]));\n\n const title = document.createElement('div');\n title.classList.add('inline-helper-result-title');\n setInnerHTML(title, wrapEmojiText(item.title));\n\n const description = document.createElement('div');\n description.classList.add('inline-helper-result-description');\n setInnerHTML(description, wrapRichText(item.description, {\n noCommands: true,\n noLinks: true\n }));\n\n container.append(title, description);\n\n const separator = document.createElement('div');\n separator.classList.add('inline-helper-separator');\n\n list.append(separator);\n } else {\n container.classList.add('grid-item');\n }\n\n if(item._ === 'botInlineResult') {\n if(item.thumb && item.thumb.mime_type.indexOf('image/') === 0) {\n let mediaContainer: HTMLElement;\n if(preview) {\n mediaContainer = document.createElement('div');\n preview.append(mediaContainer);\n } else {\n mediaContainer = container;\n }\n\n mediaContainer.classList.add('media-container');\n isGallery && mediaContainer.classList.add('no-border-radius');\n\n this.lazyLoadQueue.push({\n div: container,\n load: () => {\n return appDownloadManager.download({\n dcId: 4,\n location: {\n _: 'inputWebFileLocation',\n access_hash: (item.thumb as WebDocument.webDocument).access_hash,\n url: item.thumb.url\n },\n size: item.thumb.size,\n mimeType: item.thumb.mime_type\n }).then((blob) => {\n const image = new Image();\n image.classList.add('media-photo');\n readBlobAsDataURL(blob).then((dataURL) => {\n renderMediaWithFadeIn(mediaContainer, image, dataURL, true);\n });\n });\n }\n });\n }\n } else {\n const media = item.document as MyDocument || item.photo as MyPhoto;\n if((['sticker', 'gif'] as MyDocument['type'][]).includes((media as MyDocument)?.type) && isGallery) {\n assumeType(media);\n\n if(media.type === 'gif') {\n gifsMasonry.add(media, container);\n } else if(media.type === 'sticker') {\n container.classList.add('super-sticker');\n this.superStickerRenderer.renderSticker(media, container, loadPromises);\n if(media.animated) {\n this.superStickerRenderer.observeAnimated(container);\n }\n }\n } else if(media) {\n const size = isGallery ? 48 : undefined;\n isGallery && container.classList.add('no-border-radius');\n wrapPhoto({\n photo: media,\n container: isGallery ? container : preview,\n boxWidth: size,\n boxHeight: size,\n middleware,\n lazyLoadQueue: this.lazyLoadQueue,\n loadPromises\n });\n }\n }\n }\n\n return Promise.all(loadPromises).then(() => {\n if(!middleware()) {\n gifsMasonry.clear();\n return;\n }\n\n list.classList.toggle('is-gallery', isGallery);\n list.classList.toggle('super-stickers', isGallery);\n this.container.classList.toggle('is-gallery', isGallery);\n\n /* if(isGallery) {\n list.style.gridTemplateColumns = `repeat(${Math.min(botResults.results.length, 4)}, 1fr)`;\n }\n\n this.container.style.setProperty('width', isGallery ? `${Math.min(botResults.results.length, 4) * 25}%` : '', 'important'); */\n\n const parent = this.list.parentElement;\n parent.textContent = '';\n if(botResults.switch_pm) {\n const btnSwitchToPM = Button('btn-primary btn-secondary btn-primary-transparent primary');\n setInnerHTML(btnSwitchToPM, wrapEmojiText(botResults.switch_pm.text));\n attachClickEvent(btnSwitchToPM, (e) => {\n this.chat.appImManager.setInnerPeer({peerId});\n this.managers.appInlineBotsManager.switchToPM(peerId, peer.id, botResults.switch_pm.start_param);\n });\n parent.append(btnSwitchToPM);\n }\n parent.append(this.list = list);\n this.container.classList.remove('cant-send');\n\n this.gifsMasonry?.detach();\n this.gifsMasonry = gifsMasonry;\n gifsMasonry.attach();\n\n if(!this.onChangeScreen) {\n this.onChangeScreen = () => {\n if(this.list.classList.contains('is-gallery')) {\n const width = (this.list.childElementCount * mediaSizes.active.popupSticker.width) + (this.list.childElementCount - 1 * 1);\n this.list.style.width = width + 'px';\n } else {\n this.list.style.width = '';\n }\n };\n mediaSizes.addEventListener('changeScreen', this.onChangeScreen);\n }\n\n this.onChangeScreen();\n\n this.toggle(!botResults.results.length && !botResults.switch_pm);\n this.scrollable.scrollTop = 0;\n });\n });\n\n return {user: peer, renderPromise};\n };\n\n public init() {\n this.list = document.createElement('div');\n this.list.classList.add('inline-helper-results');\n\n this.container.append(this.list);\n\n this.scrollable = new Scrollable(this.container);\n this.lazyLoadQueue = new LazyLoadQueue();\n this.superStickerRenderer = new SuperStickerRenderer(this.lazyLoadQueue, ANIMATION_GROUP, this.managers);\n\n const span = i18n(POSTING_NOT_ALLOWED_MAP['send_inline']);\n span.classList.add('inline-helper-cant-send');\n this.container.append(span);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ChatInput from './input';\nimport callbackify from '../../helpers/callbackify';\nimport AutocompletePeerHelper from './autocompletePeerHelper';\nimport {processPeerFullForCommands} from './commandsHelper';\nimport {AppManagers} from '../../lib/appManagers/managers';\n\nconst CLASS_NAME = 'bot-commands';\nexport default class ChatBotCommands extends AutocompletePeerHelper {\n private userId: UserId;\n\n constructor(\n appendTo: HTMLElement,\n chatInput: ChatInput,\n private managers: AppManagers\n ) {\n super(appendTo, undefined, CLASS_NAME, (target) => {\n const innerHTML = target.querySelector(`.${AutocompletePeerHelper.BASE_CLASS_LIST_ELEMENT}-name`).innerHTML;\n return chatInput.getReadyToSend(() => {\n chatInput.messageInput.innerHTML = innerHTML;\n chatInput.sendMessage(true);\n this.toggle(true);\n });\n });\n }\n\n public setUserId(userId: UserId, middleware: () => boolean) {\n if(this.userId === userId && this.list?.childElementCount) {\n this.toggle(false);\n return;\n }\n\n this.userId = userId;\n return callbackify(this.managers.appProfileManager.getProfile(userId), (full) => {\n if(!middleware()) return;\n const filtered = processPeerFullForCommands(userId.toPeerId(false), full);\n\n const PADDING_TOP = 8;\n // const PADDING_BOTTOM = 8;\n const PADDING_BOTTOM = 24;\n const height = filtered.length * 50 + PADDING_TOP + PADDING_BOTTOM;\n this.container.style.setProperty('--height', height + 'px');\n\n this.render(filtered);\n\n // this.container.style.top =\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AckedResult} from '../lib/mtproto/superMessagePort';\nimport {Modify} from '../types';\n\nexport default async function modifyAckedResult(acked: AckedResult): Promise, {result: T | Promise}>> {\n return {\n cached: acked.cached,\n result: acked.cached ? await acked.result : acked.result\n };\n}\n\nexport function modifyAckedPromise(promise: Promise>) {\n return promise.then(modifyAckedResult);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport callbackify from '../../helpers/callbackify';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport liteMode from '../../helpers/liteMode';\nimport {getMiddleware} from '../../helpers/middleware';\nimport {modifyAckedPromise} from '../../helpers/modifyAckedResult';\nimport {ChatFull} from '../../layer';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport {i18n} from '../../lib/langPack';\nimport {AckedResult} from '../../lib/mtproto/superMessagePort';\nimport rootScope from '../../lib/rootScope';\nimport AvatarElement from '../avatar';\nimport {ButtonMenuItemOptions, ButtonMenuSync} from '../buttonMenu';\nimport ButtonMenuToggle from '../buttonMenuToggle';\nimport PeerTitle from '../peerTitle';\nimport SetTransition from '../singleTransition';\nimport getChatMembersString from '../wrappers/getChatMembersString';\n\nconst SEND_AS_ANIMATION_DURATION = 300;\n\nexport default class ChatSendAs {\n private avatar: AvatarElement;\n private container: HTMLElement;\n private closeBtn: HTMLElement;\n private btnMenu: HTMLElement;\n private sendAsPeerIds: PeerId[];\n private sendAsPeerId: PeerId;\n private updatingPromise: ReturnType;\n private middleware: ReturnType;\n private listenerSetter: ListenerSetter;\n private peerId: PeerId;\n private addedListener: boolean;\n private buttons: ButtonMenuItemOptions[];\n\n constructor(\n private managers: AppManagers,\n private onReady: (container: HTMLElement, skipAnimation?: boolean) => void,\n private onChange: (sendAsPeerId: PeerId) => void\n ) {\n this.middleware = getMiddleware();\n this.listenerSetter = new ListenerSetter();\n this.construct();\n }\n\n private construct() {\n this.container = document.createElement('div');\n this.container.classList.add('new-message-send-as-container');\n\n this.closeBtn = document.createElement('div');\n this.closeBtn.classList.add('new-message-send-as-close', 'new-message-send-as-avatar', 'tgico-close');\n\n const sendAsButtons: ButtonMenuItemOptions[] = [{\n text: 'SendMessageAsTitle',\n onClick: undefined\n }];\n\n this.buttons = [];\n\n let previousAvatar: HTMLElement;\n const onSendAsMenuToggle = (visible: boolean) => {\n if(visible) {\n previousAvatar = this.avatar;\n }\n\n const isChanged = this.avatar !== previousAvatar;\n const useRafs = !visible && isChanged ? 2 : 0;\n\n SetTransition({\n element: this.closeBtn,\n className: 'is-visible',\n forwards: visible,\n duration: SEND_AS_ANIMATION_DURATION,\n useRafs\n });\n if(!isChanged) {\n SetTransition({\n element: previousAvatar,\n className: 'is-visible',\n forwards: !visible,\n duration: SEND_AS_ANIMATION_DURATION,\n useRafs\n });\n }\n };\n\n ButtonMenuToggle({\n buttonOptions: {noRipple: true},\n listenerSetter: this.listenerSetter,\n container: this.container,\n direction: 'top-right',\n buttons: sendAsButtons,\n onOpenBefore: () => {\n onSendAsMenuToggle(true);\n },\n onOpen: (e, btnMenu) => {\n sendAsButtons[0].element.classList.add('btn-menu-item-header');\n this.btnMenu = btnMenu as any;\n this.btnMenu.classList.add('scrollable', 'scrollable-y');\n this.btnMenu.append(...this.buttons.map((button) => button.element));\n },\n onClose: () => {\n onSendAsMenuToggle(false);\n },\n onCloseAfter: () => {\n this.btnMenu = undefined;\n }\n });\n\n this.container.append(this.closeBtn);\n }\n\n private async updateButtons(peerIds: PeerId[]) {\n const promises: Promise[] = peerIds.map(async(sendAsPeerId, idx) => {\n const textElement = document.createElement('div');\n\n const subtitle = document.createElement('div');\n subtitle.classList.add('btn-menu-item-subtitle');\n if(sendAsPeerId.isUser()) {\n subtitle.append(i18n('Chat.SendAs.PersonalAccount'));\n } else if(sendAsPeerId === this.peerId) {\n subtitle.append(i18n('VoiceChat.DiscussionGroup'));\n } else {\n subtitle.append(await getChatMembersString(sendAsPeerId.toChatId()));\n }\n\n textElement.append(\n new PeerTitle({peerId: sendAsPeerId}).element,\n subtitle\n );\n\n return {\n onClick: idx ? async() => {\n const currentPeerId = this.peerId;\n this.changeSendAsPeerId(sendAsPeerId);\n\n const middleware = this.middleware.get();\n const executeButtonsUpdate = () => {\n if(this.sendAsPeerId !== sendAsPeerId || !middleware()) return;\n const peerIds = this.sendAsPeerIds.slice();\n indexOfAndSplice(peerIds, sendAsPeerId);\n peerIds.unshift(sendAsPeerId);\n this.updateButtons(peerIds);\n };\n\n if(liteMode.isAvailable('animations')) {\n setTimeout(executeButtonsUpdate, 250);\n } else {\n executeButtonsUpdate();\n }\n\n // return;\n this.managers.appMessagesManager.saveDefaultSendAs(currentPeerId, sendAsPeerId);\n } : undefined,\n textElement\n };\n });\n\n const buttons = await Promise.all(promises);\n const btnMenu = ButtonMenuSync({buttons}/* , this.listenerSetter */);\n buttons.forEach((button, idx) => {\n const peerId = peerIds[idx];\n const avatar = new AvatarElement();\n avatar.classList.add('avatar-26', 'btn-menu-item-icon');\n avatar.updateWithOptions({peerId});\n\n if(!idx) {\n avatar.classList.add('active');\n }\n\n button.element.prepend(avatar);\n });\n\n this.buttons = buttons;\n\n // if already opened\n this.btnMenu?.append(...this.buttons.map((button) => button.element));\n }\n\n private async updateAvatar(sendAsPeerId: PeerId, skipAnimation?: boolean) {\n const previousAvatar = this.avatar;\n if(previousAvatar) {\n if(previousAvatar.peerId === sendAsPeerId) {\n return;\n }\n }\n\n if(!previousAvatar) {\n skipAnimation = true;\n }\n\n const useRafs = skipAnimation ? 0 : 2;\n const duration = skipAnimation ? 0 : SEND_AS_ANIMATION_DURATION;\n const avatar = this.avatar = new AvatarElement();\n avatar.classList.add('new-message-send-as-avatar', 'avatar-30');\n await avatar.updateWithOptions({\n isDialog: false,\n peerId: sendAsPeerId\n });\n\n SetTransition({\n element: avatar,\n className: 'is-visible',\n forwards: true,\n duration,\n useRafs\n });\n if(previousAvatar) {\n SetTransition({\n element: previousAvatar,\n className: 'is-visible',\n forwards: false,\n duration,\n onTransitionEnd: () => {\n previousAvatar.remove();\n },\n useRafs\n });\n }\n\n this.container.append(avatar);\n }\n\n private changeSendAsPeerId(sendAsPeerId: PeerId, skipAnimation?: boolean) {\n this.sendAsPeerId = sendAsPeerId;\n this.onChange(sendAsPeerId);\n return this.updateAvatar(sendAsPeerId, skipAnimation);\n }\n\n private getDefaultSendAs(): Promise> {\n // return rootScope.myId;\n return this.managers.acknowledged.appProfileManager.getChannelFull(this.peerId.toChatId()).then((acked) => {\n return {\n cached: acked.cached,\n result: acked.result.then((channelFull) => {\n return channelFull.default_send_as ? getPeerId(channelFull.default_send_as) : undefined\n })\n };\n });\n }\n\n public async updateManual(skipAnimation?: boolean): Promise<() => void> {\n const peerId = this.peerId;\n if(this.updatingPromise || !(await this.managers.appPeersManager.isChannel(peerId))) {\n return;\n }\n\n const middleware = this.middleware.get(() => {\n return !this.updatingPromise || this.updatingPromise === updatingPromise;\n });\n\n const {container} = this;\n const chatId = peerId.toChatId();\n const result = (await modifyAckedPromise(this.getDefaultSendAs())).result;\n // const result = Promise.resolve(this.getDefaultSendAs());\n\n const wasSkippingAnimation = skipAnimation;\n if(result instanceof Promise) {\n skipAnimation = undefined;\n }\n\n const auto = wasSkippingAnimation && !skipAnimation;\n\n const updatingPromise = this.updatingPromise = callbackify(result, async(sendAsPeerId) => {\n if(!middleware() || sendAsPeerId === undefined) return;\n\n await this.changeSendAsPeerId(sendAsPeerId, skipAnimation);\n if(!middleware()) return;\n\n this.managers.appChatsManager.getSendAs(chatId).then((sendAsPeers) => {\n if(!middleware()) return;\n\n const peers = sendAsPeers.filter((sendAsPeer) => !sendAsPeer.pFlags.premium_required).map((sendAsPeer) => sendAsPeer.peer);\n const peerIds = peers.map((peer) => getPeerId(peer));\n this.sendAsPeerIds = peerIds.slice();\n\n indexOfAndSplice(peerIds, sendAsPeerId);\n peerIds.unshift(sendAsPeerId);\n this.updateButtons(peerIds);\n });\n\n const callback = () => {\n this.onReady(container, skipAnimation);\n\n if(!this.addedListener) {\n this.listenerSetter.add(rootScope)('peer_full_update', (peerId) => {\n if(this.peerId === peerId) {\n this.update();\n }\n });\n\n this.addedListener = true;\n }\n };\n\n if(auto) {\n callback();\n return;\n }\n\n return callback;\n });\n\n updatingPromise.finally(() => {\n if(this.updatingPromise === updatingPromise) {\n this.updatingPromise = undefined;\n }\n });\n\n if(!auto) {\n return updatingPromise;\n }\n }\n\n public update(skipAnimation?: boolean) {\n return this.updateManual(skipAnimation).then((callback) => callback?.());\n }\n\n public setPeerId(peerId?: PeerId) {\n /* if(this.avatar) {\n this.avatar.remove();\n this.avatar = undefined;\n } */\n\n this.middleware.clean();\n this.updatingPromise = undefined;\n this.peerId = peerId;\n }\n\n public destroy() {\n this.container.remove();\n this.setPeerId();\n this.listenerSetter.removeAll();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport {AppImManager, APP_TABS} from '../../lib/appManagers/appImManager';\nimport type {MyDraftMessage} from '../../lib/appManagers/appDraftsManager';\nimport type Chat from './chat';\nimport Recorder from '../../../public/recorder.min';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\n// import Recorder from '../opus-recorder/dist/recorder.min';\nimport opusDecodeController from '../../lib/opusDecodeController';\nimport {ButtonMenuItemOptions, ButtonMenuItemOptionsVerifiable, ButtonMenuSync} from '../buttonMenu';\nimport emoticonsDropdown from '../emoticonsDropdown';\nimport PopupCreatePoll from '../popups/createPoll';\nimport PopupForward from '../popups/forward';\nimport PopupNewMedia from '../popups/newMedia';\nimport {toast, toastNew} from '../toast';\nimport {MessageEntity, DraftMessage, WebPage, Message, UserFull, AttachMenuPeerType} from '../../layer';\nimport StickersHelper from './stickersHelper';\nimport ButtonIcon from '../buttonIcon';\nimport ButtonMenuToggle from '../buttonMenuToggle';\nimport ListenerSetter, {Listener} from '../../helpers/listenerSetter';\nimport Button from '../button';\nimport PopupSchedule from '../popups/schedule';\nimport SendMenu from './sendContextMenu';\nimport rootScope from '../../lib/rootScope';\nimport PopupPinMessage from '../popups/unpinMessage';\nimport tsNow from '../../helpers/tsNow';\nimport appNavigationController, {NavigationItem} from '../appNavigationController';\nimport {IS_MOBILE, IS_MOBILE_SAFARI} from '../../environment/userAgent';\nimport I18n, {i18n, join, LangPackKey} from '../../lib/langPack';\nimport {generateTail} from './bubbles';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport ButtonCorner from '../buttonCorner';\nimport blurActiveElement from '../../helpers/dom/blurActiveElement';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport cancelSelection from '../../helpers/dom/cancelSelection';\nimport {attachClickEvent, simulateClickEvent} from '../../helpers/dom/clickEvent';\nimport isInputEmpty from '../../helpers/dom/isInputEmpty';\nimport isSendShortcutPressed from '../../helpers/dom/isSendShortcutPressed';\nimport placeCaretAtEnd from '../../helpers/dom/placeCaretAtEnd';\nimport {MarkdownType} from '../../helpers/dom/getRichElementValue';\nimport getRichValueWithCaret from '../../helpers/dom/getRichValueWithCaret';\nimport EmojiHelper from './emojiHelper';\nimport CommandsHelper from './commandsHelper';\nimport AutocompleteHelperController from './autocompleteHelperController';\nimport AutocompleteHelper from './autocompleteHelper';\nimport MentionsHelper from './mentionsHelper';\nimport fixSafariStickyInput from '../../helpers/dom/fixSafariStickyInput';\nimport ReplyKeyboard from './replyKeyboard';\nimport InlineHelper from './inlineHelper';\nimport debounce from '../../helpers/schedulers/debounce';\nimport noop from '../../helpers/noop';\nimport {putPreloader} from '../putPreloader';\nimport SetTransition from '../singleTransition';\nimport PeerTitle from '../peerTitle';\nimport {fastRaf} from '../../helpers/schedulers';\nimport PopupDeleteMessages from '../popups/deleteMessages';\nimport fixSafariStickyInputFocusing, {IS_STICKY_INPUT_BUGGED} from '../../helpers/dom/fixSafariStickyInputFocusing';\nimport PopupPeer from '../popups/peer';\nimport MEDIA_MIME_TYPES_SUPPORTED from '../../environment/mediaMimeTypesSupport';\nimport appMediaPlaybackController from '../appMediaPlaybackController';\nimport {BOT_START_PARAM, NULL_PEER_ID} from '../../lib/mtproto/mtproto_config';\nimport setCaretAt from '../../helpers/dom/setCaretAt';\nimport CheckboxField from '../checkboxField';\nimport DropdownHover from '../../helpers/dropdownHover';\nimport RadioForm from '../radioForm';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport toggleDisability from '../../helpers/dom/toggleDisability';\nimport callbackify from '../../helpers/callbackify';\nimport ChatBotCommands from './botCommands';\nimport copy from '../../helpers/object/copy';\nimport toHHMMSS from '../../helpers/string/toHHMMSS';\nimport documentFragmentToHTML from '../../helpers/dom/documentFragmentToHTML';\nimport PopupElement from '../popups';\nimport getEmojiEntityFromEmoji from '../../lib/richTextProcessor/getEmojiEntityFromEmoji';\nimport mergeEntities from '../../lib/richTextProcessor/mergeEntities';\nimport parseEntities from '../../lib/richTextProcessor/parseEntities';\nimport parseMarkdown from '../../lib/richTextProcessor/parseMarkdown';\nimport wrapDraftText from '../../lib/richTextProcessor/wrapDraftText';\nimport wrapDraft from '../wrappers/draft';\nimport wrapMessageForReply from '../wrappers/messageForReply';\nimport getServerMessageId from '../../lib/appManagers/utils/messageId/getServerMessageId';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport contextMenuController from '../../helpers/contextMenuController';\nimport {emojiFromCodePoints} from '../../vendor/emoji';\nimport {modifyAckedPromise} from '../../helpers/modifyAckedResult';\nimport ChatSendAs from './sendAs';\nimport filterAsync from '../../helpers/array/filterAsync';\nimport InputFieldAnimated from '../inputFieldAnimated';\nimport getStickerEffectThumb from '../../lib/appManagers/utils/stickers/getStickerEffectThumb';\nimport PopupStickers from '../popups/stickers';\nimport wrapPeerTitle from '../wrappers/peerTitle';\nimport wrapReply from '../wrappers/reply';\nimport {getEmojiFromElement} from '../emoticonsDropdown/tabs/emoji';\nimport hasMarkupInSelection from '../../helpers/dom/hasMarkupInSelection';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport RichInputHandler from '../../helpers/dom/richInputHandler';\nimport {insertRichTextAsHTML} from '../inputField';\nimport getCaretPosNew from '../../helpers/dom/getCaretPosNew';\nimport draftsAreEqual from '../../lib/appManagers/utils/drafts/draftsAreEqual';\nimport isSelectionEmpty from '../../helpers/dom/isSelectionEmpty';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport getAttachMenuBotIcon from '../../lib/appManagers/utils/attachMenuBots/getAttachMenuBotIcon';\nimport TelegramWebView from '../telegramWebView';\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport {MARKDOWN_ENTITIES} from '../../lib/richTextProcessor';\nimport IMAGE_MIME_TYPES_SUPPORTED from '../../environment/imageMimeTypesSupport';\nimport VIDEO_MIME_TYPES_SUPPORTED from '../../environment/videoMimeTypesSupport';\nimport {ChatRights} from '../../lib/appManagers/appChatsManager';\n\nconst RECORD_MIN_TIME = 500;\n\nexport const POSTING_NOT_ALLOWED_MAP: {[action in ChatRights]?: LangPackKey} = {\n send_voices: 'GlobalAttachVoiceRestricted',\n send_stickers: 'GlobalAttachStickersRestricted',\n send_gifs: 'GlobalAttachGifRestricted',\n send_media: 'GlobalAttachMediaRestricted',\n send_plain: 'GlobalSendMessageRestricted',\n send_polls: 'ErrorSendRestrictedPollsAll',\n send_inline: 'GlobalAttachInlineRestricted'\n};\n\ntype ChatInputHelperType = 'edit' | 'webpage' | 'forward' | 'reply';\n\nexport default class ChatInput {\n // private static AUTO_COMPLETE_REG_EXP = /(\\s|^)((?::|.)(?!.*[:@]).*|(?:[@\\/]\\S*))$/;\n private static AUTO_COMPLETE_REG_EXP = /(\\s|^)((?:(?:@|^\\/)\\S*)|(?::|^[^:@\\/])(?!.*[:@\\/]).*)$/;\n public messageInput: HTMLElement;\n public messageInputField: InputFieldAnimated;\n private fileInput: HTMLInputElement;\n private inputMessageContainer: HTMLDivElement;\n private btnSend: HTMLButtonElement;\n private btnCancelRecord: HTMLButtonElement;\n public lastUrl = '';\n private lastTimeType = 0;\n\n public chatInput: HTMLElement;\n public inputContainer: HTMLElement;\n public rowsWrapper: HTMLDivElement;\n private newMessageWrapper: HTMLDivElement;\n private btnToggleEmoticons: HTMLButtonElement;\n private btnToggleReplyMarkup: HTMLButtonElement;\n private btnSendContainer: HTMLDivElement;\n\n private replyKeyboard: ReplyKeyboard;\n\n private attachMenu: HTMLElement;\n private attachMenuButtons: ButtonMenuItemOptionsVerifiable[];\n\n private sendMenu: SendMenu;\n\n private replyElements: {\n container: HTMLElement,\n cancelBtn: HTMLButtonElement,\n iconBtn: HTMLButtonElement\n } = {} as any;\n\n private forwardElements: {\n changePeer: ButtonMenuItemOptions,\n showSender: ButtonMenuItemOptions,\n hideSender: ButtonMenuItemOptions,\n showCaption: ButtonMenuItemOptions,\n hideCaption: ButtonMenuItemOptions,\n container: HTMLElement,\n modifyArgs?: ButtonMenuItemOptions[]\n };\n private forwardHover: DropdownHover;\n private forwardWasDroppingAuthor: boolean;\n\n private getWebPagePromise: Promise;\n public willSendWebPage: WebPage = null;\n private forwarding: {[fromPeerId: PeerId]: number[]};\n public replyToMsgId: number;\n public editMsgId: number;\n public editMessage: Message.message;\n private noWebPage: true;\n public scheduleDate: number;\n public sendSilent: true;\n public startParam: string;\n\n private recorder: any;\n public recording = false;\n private recordCanceled = false;\n private recordTimeEl: HTMLElement;\n private recordRippleEl: HTMLElement;\n private recordStartTime = 0;\n private recordingOverlayListener: Listener;\n private recordingNavigationItem: NavigationItem;\n\n // private scrollTop = 0;\n // private scrollOffsetTop = 0;\n // private scrollDiff = 0;\n\n public helperType: Exclude;\n private helperFunc: () => void | Promise;\n private helperWaitingForward: boolean;\n\n public willAttachType: 'document' | 'media';\n\n private lockRedo = false;\n private canRedoFromHTML = '';\n private readonly undoHistory: string[] = [];\n private readonly executedHistory: string[] = [];\n private canUndoFromHTML = '';\n\n private autocompleteHelperController: AutocompleteHelperController;\n private stickersHelper: StickersHelper;\n private emojiHelper: EmojiHelper;\n private commandsHelper: CommandsHelper;\n private mentionsHelper: MentionsHelper;\n private inlineHelper: InlineHelper;\n private listenerSetter: ListenerSetter;\n\n private pinnedControlBtn: HTMLButtonElement;\n\n private goDownBtn: HTMLButtonElement;\n private goDownUnreadBadge: HTMLElement;\n private goMentionBtn: HTMLButtonElement;\n private goMentionUnreadBadge: HTMLSpanElement;\n private btnScheduled: HTMLButtonElement;\n\n private btnPreloader: HTMLButtonElement;\n\n private saveDraftDebounced: () => void;\n\n private fakeRowsWrapper: HTMLDivElement;\n\n private previousQuery: string;\n\n private releaseMediaPlayback: () => void;\n\n private botStartBtn: HTMLButtonElement;\n private rowsWrapperWrapper: HTMLDivElement;\n private controlContainer: HTMLElement;\n private fakeSelectionWrapper: HTMLDivElement;\n\n private fakeWrapperTo: HTMLElement;\n private toggleBotStartBtnDisability: () => void;\n\n private botCommandsToggle: HTMLElement;\n private botCommands: ChatBotCommands;\n private botCommandsIcon: HTMLDivElement;\n private hasBotCommands: boolean;\n\n // private activeContainer: HTMLElement;\n\n private sendAs: ChatSendAs;\n public sendAsPeerId: PeerId;\n\n private replyInTopicOverlay: HTMLDivElement;\n private restoreInputLock: () => void;\n\n constructor(\n private chat: Chat,\n private appImManager: AppImManager,\n private managers: AppManagers\n ) {\n this.listenerSetter = new ListenerSetter();\n }\n\n public construct() {\n this.chatInput = document.createElement('div');\n this.chatInput.classList.add('chat-input', 'hide');\n\n this.inputContainer = document.createElement('div');\n this.inputContainer.classList.add('chat-input-container');\n\n this.rowsWrapperWrapper = document.createElement('div');\n this.rowsWrapperWrapper.classList.add('rows-wrapper-wrapper');\n\n this.rowsWrapper = document.createElement('div');\n this.rowsWrapper.classList.add('rows-wrapper', 'chat-input-wrapper');\n\n this.rowsWrapperWrapper.append(this.rowsWrapper);\n\n const tail = generateTail();\n this.rowsWrapper.append(tail);\n\n const fakeRowsWrapper = this.fakeRowsWrapper = document.createElement('div');\n fakeRowsWrapper.classList.add('fake-wrapper', 'fake-rows-wrapper');\n\n const fakeSelectionWrapper = this.fakeSelectionWrapper = document.createElement('div');\n fakeSelectionWrapper.classList.add('fake-wrapper', 'fake-selection-wrapper');\n\n this.inputContainer.append(this.rowsWrapperWrapper, fakeRowsWrapper, fakeSelectionWrapper);\n this.chatInput.append(this.inputContainer);\n\n this.goDownBtn = ButtonCorner({icon: 'arrow_down', className: 'bubbles-corner-button chat-secondary-button bubbles-go-down hide'});\n this.inputContainer.append(this.goDownBtn);\n\n attachClickEvent(this.goDownBtn, (e) => {\n cancelEvent(e);\n this.chat.bubbles.onGoDownClick();\n }, {listenerSetter: this.listenerSetter});\n\n // * constructor end\n\n /* let setScrollTopTimeout: number;\n // @ts-ignore\n let height = window.visualViewport.height; */\n // @ts-ignore\n // this.listenerSetter.add(window.visualViewport)('resize', () => {\n // const scrollable = this.chat.bubbles.scrollable;\n // const wasScrolledDown = scrollable.isScrolledDown;\n\n // /* if(wasScrolledDown) {\n // this.saveScroll();\n // } */\n\n // // @ts-ignore\n // let newHeight = window.visualViewport.height;\n // const diff = height - newHeight;\n // const scrollTop = scrollable.scrollTop;\n // const needScrollTop = wasScrolledDown ? scrollable.scrollHeight : scrollTop + diff; // * wasScrolledDown это проверка для десктоп хрома, когда пропадает панель загрузок снизу\n\n // console.log('resize before', scrollable.scrollTop, scrollable.container.clientHeight, scrollable.scrollHeight, wasScrolledDown, scrollable.lastScrollTop, diff, needScrollTop);\n\n // scrollable.scrollTop = needScrollTop;\n\n // if(setScrollTopTimeout) clearTimeout(setScrollTopTimeout);\n // setScrollTopTimeout = window.setTimeout(() => {\n // const diff = height - newHeight;\n // const isScrolledDown = scrollable.scrollHeight - Math.round(scrollable.scrollTop + scrollable.container.offsetHeight + diff) <= 1;\n // height = newHeight;\n\n // scrollable.scrollTop = needScrollTop;\n\n // console.log('resize after', scrollable.scrollTop, scrollable.container.clientHeight, scrollable.scrollHeight, scrollable.isScrolledDown, scrollable.lastScrollTop, isScrolledDown);\n\n // /* if(isScrolledDown) {\n // scrollable.scrollTop = scrollable.scrollHeight;\n // } */\n\n // //scrollable.scrollTop += diff;\n // setScrollTopTimeout = 0;\n // }, 0);\n // });\n\n // ! Can't use it with resizeObserver\n /* this.listenerSetter.add(window.visualViewport)('resize', () => {\n const scrollable = this.chat.bubbles.scrollable;\n const wasScrolledDown = scrollable.isScrolledDown;\n\n // @ts-ignore\n let newHeight = window.visualViewport.height;\n const diff = height - newHeight;\n const needScrollTop = wasScrolledDown ? scrollable.scrollHeight : scrollable.scrollTop + diff; // * wasScrolledDown это проверка для десктоп хрома, когда пропадает панель загрузок снизу\n\n //console.log('resize before', scrollable.scrollTop, scrollable.container.clientHeight, scrollable.scrollHeight, wasScrolledDown, scrollable.lastScrollTop, diff, needScrollTop);\n\n scrollable.scrollTop = needScrollTop;\n height = newHeight;\n\n if(setScrollTopTimeout) clearTimeout(setScrollTopTimeout);\n setScrollTopTimeout = window.setTimeout(() => { // * try again for scrolled down Android Chrome\n scrollable.scrollTop = needScrollTop;\n\n //console.log('resize after', scrollable.scrollTop, scrollable.container.clientHeight, scrollable.scrollHeight, scrollable.isScrolledDown, scrollable.lastScrollTop, isScrolledDown);\n setScrollTopTimeout = 0;\n }, 0);\n }); */\n\n const c = this.controlContainer = document.createElement('div');\n c.classList.add('chat-input-control', 'chat-input-wrapper');\n this.inputContainer.append(c);\n }\n\n private createButtonIcon(...args: Parameters) {\n const button = ButtonIcon(...args);\n button.tabIndex = -1;\n return button;\n }\n\n public constructPeerHelpers() {\n this.replyElements.container = document.createElement('div');\n this.replyElements.container.classList.add('reply-wrapper');\n\n this.replyElements.iconBtn = this.createButtonIcon('');\n this.replyElements.cancelBtn = this.createButtonIcon('close reply-cancel', {noRipple: true});\n\n this.replyElements.container.append(this.replyElements.iconBtn, this.replyElements.cancelBtn);\n\n //\n\n const onHideAuthorClick = () => {\n isChangingAuthor = true;\n };\n\n const onHideCaptionClick = () => {\n isChangingAuthor = false;\n };\n\n const forwardElements: ChatInput['forwardElements'] = this.forwardElements = {} as any;\n let isChangingAuthor = false;\n const forwardButtons: ButtonMenuItemOptions[] = [\n forwardElements.showSender = {\n text: 'Chat.Alert.Forward.Action.Show1',\n onClick: onHideAuthorClick,\n checkForClose: () => this.canToggleHideAuthor(),\n checkboxField: new CheckboxField({checked: true})\n },\n forwardElements.hideSender = {\n text: 'Chat.Alert.Forward.Action.Hide1',\n onClick: onHideAuthorClick,\n checkForClose: () => this.canToggleHideAuthor(),\n checkboxField: new CheckboxField({checked: false})\n },\n forwardElements.showCaption = {\n text: 'Chat.Alert.Forward.Action.ShowCaption',\n onClick: onHideCaptionClick,\n checkboxField: new CheckboxField({checked: true})\n },\n forwardElements.hideCaption = {\n text: 'Chat.Alert.Forward.Action.HideCaption',\n onClick: onHideCaptionClick,\n checkboxField: new CheckboxField({checked: false})\n },\n forwardElements.changePeer = {\n text: 'Chat.Alert.Forward.Action.Another',\n onClick: () => {\n this.changeForwardRecipient();\n },\n icon: 'replace'\n }\n ];\n const forwardBtnMenu = forwardElements.container = ButtonMenuSync({\n buttons: forwardButtons,\n listenerSetter: this.listenerSetter\n });\n // forwardBtnMenu.classList.add('top-center');\n\n const children = Array.from(forwardBtnMenu.children) as HTMLElement[];\n const groups: {\n elements: HTMLElement[],\n onChange: (value: string, event: Event) => void\n }[] = [{\n elements: children.slice(0, 2),\n onChange: (value, e) => {\n const checked = !!+value;\n if(isChangingAuthor) {\n this.forwardWasDroppingAuthor = !checked;\n }\n\n const replyTitle = this.replyElements.container.querySelector('.reply-title');\n if(replyTitle) {\n const el = replyTitle.firstElementChild as HTMLElement;\n const i = I18n.weakMap.get(el) as I18n.IntlElement;\n const langPackKey: LangPackKey = forwardElements.showSender.checkboxField.checked ? 'Chat.Accessory.Forward' : 'Chat.Accessory.Hidden';\n i.key = langPackKey;\n i.update();\n }\n }\n }, {\n elements: children.slice(2, 4),\n onChange: (value) => {\n const checked = !!+value;\n let b: ButtonMenuItemOptions;\n if(checked && this.forwardWasDroppingAuthor !== undefined) {\n b = this.forwardWasDroppingAuthor ? forwardElements.hideSender : forwardElements.showSender;\n } else {\n b = checked ? forwardElements.showSender : forwardElements.hideSender;\n }\n\n b.checkboxField.checked = true;\n }\n }];\n groups.forEach((group) => {\n const container = RadioForm(group.elements.map((e) => {\n return {\n container: e,\n input: e.querySelector('input')\n };\n }), group.onChange);\n\n const hr = document.createElement('hr');\n container.append(hr);\n forwardBtnMenu.append(container);\n });\n\n forwardBtnMenu.append(forwardElements.changePeer.element);\n\n if(!IS_TOUCH_SUPPORTED) {\n const forwardHover = this.forwardHover = new DropdownHover({\n element: forwardBtnMenu\n });\n }\n\n forwardElements.modifyArgs = forwardButtons.slice(0, -1);\n this.replyElements.container.append(forwardBtnMenu);\n\n forwardElements.modifyArgs.forEach((b, idx) => {\n const {input} = b.checkboxField;\n input.type = 'radio';\n input.name = idx < 2 ? 'author' : 'caption';\n input.value = '' + +!(idx % 2);\n });\n\n //\n\n this.newMessageWrapper = document.createElement('div');\n this.newMessageWrapper.classList.add('new-message-wrapper');\n\n this.replyInTopicOverlay = document.createElement('div');\n this.replyInTopicOverlay.classList.add('reply-in-topic-overlay', 'hide');\n this.replyInTopicOverlay.append(i18n('Chat.Input.ReplyToAnswer'));\n\n this.btnToggleEmoticons = this.createButtonIcon('none toggle-emoticons', {noRipple: true});\n\n this.inputMessageContainer = document.createElement('div');\n this.inputMessageContainer.classList.add('input-message-container');\n\n this.goDownUnreadBadge = document.createElement('span');\n this.goDownUnreadBadge.classList.add('badge', 'badge-24', 'badge-primary');\n this.goDownBtn.append(this.goDownUnreadBadge);\n\n this.goMentionBtn = ButtonCorner({icon: 'mention', className: 'bubbles-corner-button chat-secondary-button bubbles-go-mention'});\n this.goMentionUnreadBadge = document.createElement('span');\n this.goMentionUnreadBadge.classList.add('badge', 'badge-24', 'badge-primary');\n this.goMentionBtn.append(this.goMentionUnreadBadge);\n this.inputContainer.append(this.goMentionBtn);\n\n attachClickEvent(this.goMentionBtn, (e) => {\n cancelEvent(e);\n const middleware = this.chat.bubbles.getMiddleware();\n this.managers.appMessagesManager.goToNextMention(this.chat.peerId, this.chat.threadId).then((mid) => {\n if(!middleware()) {\n return;\n }\n\n if(mid) {\n this.chat.setMessageId(mid);\n }\n });\n }, {listenerSetter: this.listenerSetter});\n\n this.btnScheduled = this.createButtonIcon('scheduled btn-scheduled float hide', {noRipple: true});\n\n attachClickEvent(this.btnScheduled, (e) => {\n this.appImManager.openScheduled(this.chat.peerId);\n }, {listenerSetter: this.listenerSetter});\n\n this.listenerSetter.add(rootScope)('scheduled_new', ({peerId}) => {\n if(this.chat.peerId !== peerId) {\n return;\n }\n\n this.btnScheduled.classList.remove('hide');\n });\n\n this.listenerSetter.add(rootScope)('scheduled_delete', ({peerId}) => {\n if(this.chat.peerId !== peerId) {\n return;\n }\n\n this.managers.appMessagesManager.getScheduledMessages(this.chat.peerId).then((value) => {\n this.btnScheduled.classList.toggle('hide', !value.length);\n });\n });\n\n this.btnToggleReplyMarkup = this.createButtonIcon('botcom toggle-reply-markup float hide', {noRipple: true});\n this.replyKeyboard = new ReplyKeyboard({\n appendTo: this.rowsWrapper,\n listenerSetter: this.listenerSetter,\n managers: this.managers,\n btnHover: this.btnToggleReplyMarkup,\n chatInput: this\n });\n this.listenerSetter.add(this.replyKeyboard)('open', () => this.btnToggleReplyMarkup.classList.add('active'));\n this.listenerSetter.add(this.replyKeyboard)('close', () => this.btnToggleReplyMarkup.classList.remove('active'));\n\n this.botCommands = new ChatBotCommands(this.rowsWrapper, this, this.managers);\n this.botCommandsToggle = document.createElement('div');\n this.botCommandsToggle.classList.add('new-message-bot-commands');\n\n const scaler = document.createElement('div');\n scaler.classList.add('new-message-bot-commands-icon-scale');\n\n const icon = this.botCommandsIcon = document.createElement('div');\n icon.classList.add('animated-menu-icon', 'animated-menu-close-icon');\n scaler.append(icon);\n this.botCommandsToggle.append(scaler);\n\n attachClickEvent(this.botCommandsToggle, (e) => {\n cancelEvent(e);\n const isShown = icon.classList.contains('state-back');\n if(isShown) {\n this.botCommands.toggle(true);\n icon.classList.remove('state-back');\n } else {\n this.botCommands.setUserId(this.chat.peerId.toUserId(), this.chat.bubbles.getMiddleware());\n icon.classList.add('state-back');\n }\n }, {listenerSetter: this.listenerSetter});\n\n this.botCommands.addEventListener('visible', () => {\n icon.classList.add('state-back');\n });\n\n this.botCommands.addEventListener('hiding', () => {\n icon.classList.remove('state-back');\n });\n\n // const getSendMediaRights = () => Promise.all([this.chat.canSend('send_photos'), this.chat.canSend('send_videos')]).then(([photos, videos]) => ({photos, videos}));\n\n const onAttachMediaClick = (photos: boolean, videos: boolean) => {\n this.fileInput.value = '';\n\n const accept = [\n ...(photos ? IMAGE_MIME_TYPES_SUPPORTED : []),\n ...(videos ? VIDEO_MIME_TYPES_SUPPORTED : [])\n ].join(', ');\n\n this.fileInput.setAttribute('accept', accept);\n this.willAttachType = 'media';\n this.fileInput.click();\n };\n\n this.attachMenuButtons = [{\n icon: 'image',\n text: 'Chat.Input.Attach.PhotoOrVideo',\n onClick: () => onAttachMediaClick(true, true)\n // verify: () => getSendMediaRights().then(({photos, videos}) => photos && videos)\n }, /* {\n icon: 'image',\n text: 'AttachPhoto',\n onClick: () => onAttachMediaClick(true, false),\n verify: () => getSendMediaRights().then(({photos, videos}) => photos && !videos)\n }, {\n icon: 'image',\n text: 'AttachVideo',\n onClick: () => onAttachMediaClick(false, true),\n verify: () => getSendMediaRights().then(({photos, videos}) => !photos && videos)\n }, */ {\n icon: 'document',\n text: 'Chat.Input.Attach.Document',\n onClick: () => {\n this.fileInput.value = '';\n this.fileInput.removeAttribute('accept');\n this.willAttachType = 'document';\n this.fileInput.click();\n }\n // verify: () => this.chat.canSend('send_docs')\n }, {\n icon: 'poll',\n text: 'Poll',\n onClick: async() => {\n const action: ChatRights = 'send_polls';\n if(!(await this.chat.canSend(action))) {\n toastNew({langPackKey: POSTING_NOT_ALLOWED_MAP[action]});\n return;\n }\n\n PopupElement.createPopup(PopupCreatePoll, this.chat).show();\n },\n verify: () => this.chat.peerId.isAnyChat() || this.chat.isBot\n }];\n\n // preload the bots\n this.managers.appAttachMenuBotsManager.getAttachMenuBots();\n\n const attachMenuButtons = this.attachMenuButtons.slice();\n this.attachMenu = ButtonMenuToggle({\n buttonOptions: {noRipple: true},\n listenerSetter: this.listenerSetter,\n direction: 'top-left',\n buttons: this.attachMenuButtons,\n onOpenBefore: async() => {\n const attachMenuBots = await this.managers.appAttachMenuBotsManager.getAttachMenuBots();\n const buttons = attachMenuButtons.slice();\n const attachMenuBotsButtons = attachMenuBots.filter((attachMenuBot) => {\n return !attachMenuBot.pFlags.inactive;\n }).map((attachMenuBot) => {\n const icon = getAttachMenuBotIcon(attachMenuBot);\n const button: typeof buttons[0] = {\n regularText: wrapEmojiText(attachMenuBot.short_name),\n onClick: () => {\n this.managers.appAttachMenuBotsManager.requestWebView({\n botId: attachMenuBot.bot_id,\n peerId: this.chat.peerId,\n ...this.chat.getMessageSendingParams()\n }).then((webViewResultUrl) => {\n const SANDBOX_ATTRIBUTES = [\n 'allow-scripts',\n 'allow-same-origin',\n 'allow-popups',\n 'allow-forms',\n 'allow-modals',\n 'allow-storage-access-by-user-activation'\n ].join(' ');\n\n class P extends PopupElement<{\n finish: () => void\n }> {\n private telegramWebView: TelegramWebView;\n\n constructor(private url: string) {\n super('popup-payment popup-payment-verification', {\n closable: true,\n overlayClosable: true,\n body: true,\n titleRaw: attachMenuBot.short_name\n });\n\n this.d();\n }\n\n protected destroy() {\n this.telegramWebView.destroy();\n return super.destroy();\n }\n\n private d() {\n const telegramWebView = this.telegramWebView = new TelegramWebView({\n url: this.url,\n sandbox: SANDBOX_ATTRIBUTES\n });\n\n telegramWebView.iframe.classList.add('payment-verification');\n\n this.body.append(telegramWebView.iframe);\n this.show();\n telegramWebView.onMount();\n }\n }\n\n new P(webViewResultUrl.url);\n });\n },\n iconDoc: icon?.icon as MyDocument,\n verify: async() => {\n let found = false;\n\n const verifyMap: {\n [type in AttachMenuPeerType['_']]: () => boolean | Promise\n } = {\n attachMenuPeerTypeSameBotPM: () => this.chat.peerId.toUserId() === attachMenuBot.bot_id,\n attachMenuPeerTypeBotPM: () => this.chat.isBot,\n attachMenuPeerTypePM: () => this.chat.peerId.isUser(),\n attachMenuPeerTypeChat: () => this.chat.isAnyGroup,\n attachMenuPeerTypeBroadcast: () => this.chat.isBroadcast\n };\n\n for(const peerType of attachMenuBot.peer_types) {\n const verify = verifyMap[peerType._];\n found = await verify();\n if(found) {\n break;\n }\n }\n\n return found;\n }\n };\n\n return button;\n });\n\n buttons.splice(buttons.length, 0, ...attachMenuBotsButtons);\n this.attachMenuButtons.splice(0, this.attachMenuButtons.length, ...buttons);\n }\n });\n this.attachMenu.classList.add('attach-file', 'tgico-attach');\n this.attachMenu.classList.remove('tgico-more');\n\n // this.inputContainer.append(this.sendMenu);\n\n this.recordTimeEl = document.createElement('div');\n this.recordTimeEl.classList.add('record-time');\n\n this.fileInput = document.createElement('input');\n this.fileInput.type = 'file';\n this.fileInput.multiple = true;\n this.fileInput.style.display = 'none';\n\n this.newMessageWrapper.append(...[this.botCommandsToggle, this.btnToggleEmoticons, this.inputMessageContainer, this.btnScheduled, this.btnToggleReplyMarkup, this.attachMenu, this.recordTimeEl, this.fileInput].filter(Boolean));\n\n this.rowsWrapper.append(this.replyElements.container);\n this.autocompleteHelperController = new AutocompleteHelperController();\n this.stickersHelper = new StickersHelper(this.rowsWrapper, this.autocompleteHelperController, this.chat, this.managers);\n this.emojiHelper = new EmojiHelper(this.rowsWrapper, this.autocompleteHelperController, this, this.managers);\n this.commandsHelper = new CommandsHelper(this.rowsWrapper, this.autocompleteHelperController, this, this.managers);\n this.mentionsHelper = new MentionsHelper(this.rowsWrapper, this.autocompleteHelperController, this, this.managers);\n this.inlineHelper = new InlineHelper(this.rowsWrapper, this.autocompleteHelperController, this.chat, this.managers);\n this.rowsWrapper.append(this.newMessageWrapper);\n\n this.btnCancelRecord = this.createButtonIcon('binfilled btn-circle btn-record-cancel chat-secondary-button');\n\n this.btnSendContainer = document.createElement('div');\n this.btnSendContainer.classList.add('btn-send-container');\n\n this.recordRippleEl = document.createElement('div');\n this.recordRippleEl.classList.add('record-ripple');\n\n this.btnSend = this.createButtonIcon('none btn-circle btn-send animated-button-icon');\n this.btnSend.insertAdjacentHTML('afterbegin', `\n \n \n \n \n `);\n\n this.btnSendContainer.append(this.recordRippleEl, this.btnSend);\n\n this.sendMenu = new SendMenu({\n onSilentClick: () => {\n this.sendSilent = true;\n this.sendMessage();\n },\n onScheduleClick: () => {\n this.scheduleSending(undefined);\n },\n listenerSetter: this.listenerSetter,\n openSide: 'top-left',\n onContextElement: this.btnSend,\n onOpen: () => {\n return this.chat.type !== 'scheduled' && (!this.isInputEmpty() || !!Object.keys(this.forwarding).length);\n }\n });\n\n this.btnSendContainer.append(this.sendMenu.sendMenu);\n\n this.inputContainer.append(this.btnCancelRecord, this.btnSendContainer);\n\n emoticonsDropdown.attachButtonListener(this.btnToggleEmoticons, this.listenerSetter);\n this.listenerSetter.add(emoticonsDropdown)('open', this.onEmoticonsOpen);\n this.listenerSetter.add(emoticonsDropdown)('close', this.onEmoticonsClose);\n\n this.attachMessageInputField();\n\n /* this.attachMenu.addEventListener('mousedown', (e) => {\n const hidden = this.attachMenu.querySelectorAll('.hide');\n if(hidden.length === this.attachMenuButtons.length) {\n toast(POSTING_MEDIA_NOT_ALLOWED);\n cancelEvent(e);\n return false;\n }\n }, {passive: false, capture: true}); */\n\n this.listenerSetter.add(rootScope)('settings_updated', () => {\n if(this.stickersHelper || this.emojiHelper) {\n // this.previousQuery = undefined;\n this.previousQuery = '';\n this.checkAutocomplete();\n /* if(!rootScope.settings.stickers.suggest) {\n this.stickersHelper.checkEmoticon('');\n } else {\n this.onMessageInput();\n } */\n }\n\n this.messageInputField?.onFakeInput();\n });\n\n this.listenerSetter.add(rootScope)('draft_updated', ({peerId, threadId, draft, force}) => {\n if(this.chat.threadId !== threadId || this.chat.peerId !== peerId || this.chat.type === 'scheduled') return;\n this.setDraft(draft, true, force);\n });\n\n this.listenerSetter.add(this.appImManager)('peer_changing', (chat) => {\n if(this.chat === chat && (this.chat.type === 'chat' || this.chat.type === 'discussion')) {\n this.saveDraft();\n }\n });\n\n this.listenerSetter.add(this.appImManager)('chat_changing', ({from, to}) => {\n if(this.chat === from) {\n this.autocompleteHelperController.toggleListNavigation(false);\n } else if(this.chat === to) {\n this.autocompleteHelperController.toggleListNavigation(true);\n }\n });\n\n this.listenerSetter.add(rootScope)('scheduled_delete', ({peerId, mids}) => {\n if(this.chat.type === 'scheduled' && this.chat.peerId === peerId && mids.includes(this.editMsgId)) {\n this.onMessageSent();\n }\n });\n\n this.listenerSetter.add(rootScope)('history_delete', ({peerId, msgs}) => {\n if(this.chat.peerId === peerId && this.chat.type !== 'scheduled') {\n if(msgs.has(this.editMsgId)) {\n this.onMessageSent();\n }\n\n if(this.replyToMsgId && msgs.has(this.replyToMsgId)) {\n this.clearHelper('reply');\n }\n\n /* if(this.chat.isStartButtonNeeded()) {\n this.setStartParam(BOT_START_PARAM);\n } */\n }\n });\n\n this.listenerSetter.add(rootScope)('dialogs_multiupdate', (dialogs) => {\n if(dialogs.has(this.chat.peerId) && (this.chat.type === 'chat' || this.chat.type === 'discussion')) {\n if(this.startParam === BOT_START_PARAM) {\n this.setStartParam();\n } else { // updateNewMessage comes earlier than dialog appers\n this.center(true);\n }\n }\n });\n\n try {\n this.recorder = new Recorder({\n // encoderBitRate: 32,\n // encoderPath: \"../dist/encoderWorker.min.js\",\n encoderSampleRate: 48000,\n monitorGain: 0,\n numberOfChannels: 1,\n recordingGain: 1,\n reuseWorker: true\n });\n } catch(err) {\n console.error('Recorder constructor error:', err);\n }\n\n this.updateSendBtn();\n\n this.listenerSetter.add(this.fileInput)('change', (e) => {\n const files = (e.target as HTMLInputElement & EventTarget).files;\n if(!files.length) {\n return;\n }\n\n PopupElement.createPopup(PopupNewMedia, this.chat, Array.from(files).slice(), this.willAttachType);\n this.fileInput.value = '';\n }, false);\n\n /* let time = Date.now();\n this.btnSend.addEventListener('touchstart', (e) => {\n time = Date.now();\n });\n\n let eventName1 = 'touchend';\n this.btnSend.addEventListener(eventName1, (e: Event) => {\n //cancelEvent(e);\n console.log(eventName1 + ', time: ' + (Date.now() - time));\n });\n\n let eventName = 'mousedown';\n this.btnSend.addEventListener(eventName, (e: Event) => {\n cancelEvent(e);\n console.log(eventName + ', time: ' + (Date.now() - time));\n }); */\n attachClickEvent(this.btnSend, this.onBtnSendClick, {listenerSetter: this.listenerSetter, touchMouseDown: true});\n\n if(this.recorder) {\n attachClickEvent(this.btnCancelRecord, this.onCancelRecordClick, {listenerSetter: this.listenerSetter});\n\n this.recorder.onstop = () => {\n this.setRecording(false);\n this.chatInput.classList.remove('is-locked');\n this.recordRippleEl.style.transform = '';\n };\n\n this.recorder.ondataavailable = (typedArray: Uint8Array) => {\n if(this.releaseMediaPlayback) {\n this.releaseMediaPlayback();\n this.releaseMediaPlayback = undefined;\n }\n\n if(this.recordingOverlayListener) {\n this.listenerSetter.remove(this.recordingOverlayListener);\n this.recordingOverlayListener = undefined;\n }\n\n if(this.recordingNavigationItem) {\n appNavigationController.removeItem(this.recordingNavigationItem);\n this.recordingNavigationItem = undefined;\n }\n\n if(this.recordCanceled) {\n return;\n }\n\n const {peerId, threadId} = this.chat;\n const replyToMsgId = this.replyToMsgId;\n\n const duration = (Date.now() - this.recordStartTime) / 1000 | 0;\n const dataBlob = new Blob([typedArray], {type: 'audio/ogg'});\n /* const fileName = new Date().toISOString() + \".opus\";\n console.log('Recorder data received', typedArray, dataBlob); */\n\n // let perf = performance.now();\n opusDecodeController.decode(typedArray, true).then((result) => {\n // console.log('WAVEFORM!:', /* waveform, */performance.now() - perf);\n\n opusDecodeController.setKeepAlive(false);\n\n // тут objectURL ставится уже с audio/wav\n this.managers.appMessagesManager.sendFile(peerId, {\n file: dataBlob,\n isVoiceMessage: true,\n isMedia: true,\n duration,\n waveform: result.waveform,\n objectURL: result.url,\n replyToMsgId,\n threadId,\n clearDraft: true\n });\n\n this.onMessageSent(false, true);\n });\n };\n }\n\n attachClickEvent(this.replyElements.cancelBtn, this.onHelperCancel, {listenerSetter: this.listenerSetter});\n attachClickEvent(this.replyElements.container, this.onHelperClick, {listenerSetter: this.listenerSetter});\n\n this.saveDraftDebounced = debounce(() => this.saveDraft(), 2500, false, true);\n\n this.botStartBtn = Button('btn-primary btn-transparent text-bold chat-input-control-button');\n this.botStartBtn.append(i18n('BotStart'));\n\n attachClickEvent(this.botStartBtn, () => {\n const {startParam} = this;\n if(startParam === undefined) {\n return;\n }\n\n const toggle = this.toggleBotStartBtnDisability = toggleDisability([this.botStartBtn], true);\n const peerId = this.chat.peerId;\n const middleware = this.chat.bubbles.getMiddleware(() => {\n return this.chat.peerId === peerId && this.startParam === startParam && this.toggleBotStartBtnDisability === toggle;\n });\n\n this.managers.appMessagesManager.startBot(peerId.toUserId(), undefined, startParam).then(() => {\n if(middleware()) {\n toggle();\n this.toggleBotStartBtnDisability = undefined;\n this.setStartParam();\n }\n });\n }, {listenerSetter: this.listenerSetter});\n\n this.controlContainer.append(this.botStartBtn, this.replyInTopicOverlay);\n\n // * pinned part start\n this.pinnedControlBtn = Button('btn-primary btn-transparent text-bold chat-input-control-button', {icon: 'unpin'});\n this.controlContainer.append(this.pinnedControlBtn);\n\n this.listenerSetter.add(this.pinnedControlBtn)('click', () => {\n const peerId = this.chat.peerId;\n\n new PopupPinMessage(peerId, 0, true, () => {\n this.chat.appImManager.setPeer(); // * close tab\n\n // ! костыль, это скроет закреплённые сообщения сразу, вместо того, чтобы ждать пока анимация перехода закончится\n const originalChat = this.chat.appImManager.chat;\n if(originalChat.topbar.pinnedMessage) {\n originalChat.topbar.pinnedMessage.pinnedMessageContainer.toggle(true);\n }\n });\n });\n // * pinned part end\n }\n\n public _center(neededFakeContainer: HTMLElement, animate?: boolean) {\n if(!neededFakeContainer && !this.inputContainer.classList.contains('is-centering')) {\n return;\n }\n\n if(neededFakeContainer === this.fakeWrapperTo) {\n return;\n }\n\n /* if(neededFakeContainer === this.botStartContainer && this.fakeWrapperTo === this.fakeSelectionWrapper) {\n this.inputContainer.classList.remove('is-centering');\n void this.rowsWrapper.offsetLeft; // reflow\n // this.inputContainer.classList.add('is-centering');\n // void this.rowsWrapper.offsetLeft; // reflow\n } */\n\n const fakeSelectionWrapper = neededFakeContainer || this.fakeWrapperTo;\n const forwards = !!neededFakeContainer;\n const oldFakeWrapperTo = this.fakeWrapperTo;\n let transform = '', borderRadius = '', needTranslateX: number;\n // if(forwards) {]\n const fakeSelectionRect = fakeSelectionWrapper.getBoundingClientRect();\n const fakeRowsRect = this.fakeRowsWrapper.getBoundingClientRect();\n const widthFrom = fakeRowsRect.width;\n const widthTo = fakeSelectionRect.width;\n\n if(widthFrom !== widthTo) {\n const scale = (widthTo/* - 8 */) / widthFrom;\n const initTranslateX = (widthFrom - widthTo) / 2;\n needTranslateX = fakeSelectionRect.left - fakeRowsRect.left - initTranslateX;\n\n if(forwards) {\n transform = `translateX(${needTranslateX}px) scaleX(${scale})`;\n // transform = `translateX(0px) scaleX(${scale})`;\n\n if(scale < 1) {\n const br = 16;\n borderRadius = '' + (br + br * (1 - scale)) + 'px';\n }\n }\n // scale = widthTo / widthFrom;\n }\n // }\n\n this.fakeWrapperTo = neededFakeContainer;\n\n const duration = animate ? 200 : 0;\n SetTransition({\n element: this.inputContainer,\n className: 'is-centering',\n forwards,\n duration\n });\n SetTransition({\n element: this.rowsWrapperWrapper,\n className: 'is-centering-to-control',\n forwards: !!(forwards && neededFakeContainer && neededFakeContainer.classList.contains('chat-input-control')),\n duration\n });\n this.rowsWrapper.style.transform = transform;\n this.rowsWrapper.style.borderRadius = borderRadius;\n\n return {\n transform,\n borderRadius,\n needTranslateX: oldFakeWrapperTo && (\n (\n neededFakeContainer &&\n neededFakeContainer.classList.contains('chat-input-control') &&\n oldFakeWrapperTo === this.fakeSelectionWrapper\n ) || oldFakeWrapperTo.classList.contains('chat-input-control')\n ) ? needTranslateX * -.5 : needTranslateX,\n widthFrom,\n widthTo\n };\n }\n\n public async center(animate = false) {\n return this._center(await this.getNeededFakeContainer(), animate);\n }\n\n public setStartParam(startParam?: string) {\n if(this.startParam === startParam) {\n return;\n }\n\n this.startParam = startParam;\n this.center(true);\n }\n\n public isReplyInTopicOverlayNeeded() {\n return this.chat.isForum &&\n !this.chat.isForumTopic &&\n !this.replyToMsgId &&\n this.chat.type === 'chat';\n }\n\n public async getNeededFakeContainer(startParam = this.startParam) {\n if(this.chat.selection.isSelecting) {\n return this.fakeSelectionWrapper;\n } else if(\n startParam !== undefined ||\n // !(await this.chat.canSend()) || // ! WARNING, TEMPORARILY COMMENTED\n this.chat.type === 'pinned' ||\n await this.chat.isStartButtonNeeded() ||\n this.isReplyInTopicOverlayNeeded()\n ) {\n return this.controlContainer;\n }\n }\n\n // public getActiveContainer() {\n // if(this.chat.selection.isSelecting) {\n // return this.chat\n // }\n // return this.startParam !== undefined ? this.botStartContainer : this.rowsWrapper;\n // }\n\n // public setActiveContainer() {\n // const container = this.activeContainer;\n // const newContainer = this.getActiveContainer();\n // if(newContainer === container) {\n // return;\n // }\n\n\n // }\n\n private onCancelRecordClick = (e?: Event) => {\n if(e) {\n cancelEvent(e);\n }\n\n this.recordCanceled = true;\n this.recorder.stop();\n opusDecodeController.setKeepAlive(false);\n };\n\n private onEmoticonsOpen = () => {\n const toggleClass = IS_TOUCH_SUPPORTED ? 'flip-icon' : 'active';\n this.btnToggleEmoticons.classList.toggle(toggleClass, true);\n };\n\n private onEmoticonsClose = () => {\n const toggleClass = IS_TOUCH_SUPPORTED ? 'flip-icon' : 'active';\n this.btnToggleEmoticons.classList.toggle(toggleClass, false);\n };\n\n public getReadyToSend(callback: () => void) {\n return this.chat.type === 'scheduled' ? (this.scheduleSending(callback), true) : (callback(), false);\n }\n\n public scheduleSending = async(callback: () => void = this.sendMessage.bind(this, true), initDate = new Date()) => {\n const {peerId} = this.chat;\n const middleware = this.chat.bubbles.getMiddleware();\n const canSendWhenOnline = rootScope.myId !== peerId && peerId.isUser() && await this.managers.appUsersManager.isUserOnlineVisible(peerId);\n\n new PopupSchedule(initDate, (timestamp) => {\n if(!middleware()) {\n return;\n }\n\n const minTimestamp = (Date.now() / 1000 | 0) + 10;\n if(timestamp <= minTimestamp) {\n timestamp = undefined;\n }\n\n this.scheduleDate = timestamp;\n callback();\n\n if(this.chat.type !== 'scheduled' && timestamp) {\n setTimeout(() => { // ! need timeout here because .forwardMessages will be called after timeout\n if(!middleware()) {\n return;\n }\n\n const popups = PopupElement.getPopups(PopupStickers);\n popups.forEach((popup) => popup.hide());\n\n this.appImManager.openScheduled(peerId);\n }, 0);\n }\n }, canSendWhenOnline).show();\n };\n\n public async setUnreadCount() {\n if(!this.goDownUnreadBadge) {\n return;\n }\n\n const dialog = await this.managers.dialogsStorage.getDialogOrTopic(this.chat.peerId, this.chat.type === 'discussion' ? undefined : this.chat.threadId);\n const count = dialog?.unread_count;\n this.goDownUnreadBadge.innerText = '' + (count || '');\n this.goDownUnreadBadge.classList.toggle('badge-gray', await this.managers.appNotificationsManager.isPeerLocalMuted({peerId: this.chat.peerId, respectType: true, threadId: this.chat.threadId}));\n\n if(this.goMentionUnreadBadge && this.chat.type === 'chat') {\n const hasMentions = !!(dialog?.unread_mentions_count && dialog.unread_count);\n this.goMentionUnreadBadge.innerText = hasMentions ? '' + (dialog.unread_mentions_count) : '';\n this.goMentionBtn.classList.toggle('is-visible', hasMentions);\n }\n }\n\n public getCurrentInputAsDraft(ignoreEmptyValue?: boolean) {\n const {value, entities} = getRichValueWithCaret(this.messageInputField.input, true, false);\n\n let draft: DraftMessage.draftMessage;\n if((value.length || ignoreEmptyValue) || this.replyToMsgId) {\n draft = {\n _: 'draftMessage',\n date: tsNow(true),\n message: value,\n entities: entities.length ? entities : undefined,\n pFlags: {\n no_webpage: this.noWebPage\n },\n reply_to_msg_id: this.replyToMsgId\n };\n }\n\n return draft;\n }\n\n public saveDraft() {\n if(!this.chat.peerId || this.editMsgId || this.chat.type === 'scheduled') return;\n const draft = this.getCurrentInputAsDraft();\n this.managers.appDraftsManager.syncDraft(this.chat.peerId, this.chat.threadId, draft);\n }\n\n public destroy() {\n // this.chat.log.error('Input destroying');\n\n this.listenerSetter.removeAll();\n }\n\n public cleanup(helperToo = true) {\n if(!this.chat.peerId) {\n this.chatInput.classList.add('hide');\n this.goDownBtn.classList.add('hide');\n }\n\n cancelSelection();\n\n this.lastTimeType = 0;\n this.startParam = undefined;\n\n if(this.toggleBotStartBtnDisability) {\n this.toggleBotStartBtnDisability();\n this.toggleBotStartBtnDisability = undefined;\n }\n\n if(this.messageInput) {\n this.clearInput();\n helperToo && this.clearHelper();\n }\n }\n\n public async setDraft(draft?: MyDraftMessage, fromUpdate = true, force = false) {\n if((!force && !isInputEmpty(this.messageInput)) || this.chat.type === 'scheduled') return false;\n\n if(!draft) {\n draft = await this.managers.appDraftsManager.getDraft(this.chat.peerId, this.chat.threadId);\n\n if(!draft) {\n if(force) { // this situation can only happen when sending message with clearDraft\n /* const height = this.chatInput.getBoundingClientRect().height;\n const willChangeHeight = 78 - height;\n this.willChangeHeight = willChangeHeight; */\n if(this.chat.container.classList.contains('is-helper-active')) {\n this.t();\n }\n\n this.messageInputField.inputFake.textContent = '';\n this.messageInputField.onFakeInput(false);\n\n ((this.chat.bubbles.messagesQueuePromise || Promise.resolve()) as Promise).then(() => {\n fastRaf(() => {\n this.onMessageSent();\n });\n });\n }\n\n return false;\n }\n }\n\n const wrappedDraft = wrapDraft(draft, this.chat.peerId);\n const currentDraft = this.getCurrentInputAsDraft();\n\n if(draftsAreEqual(draft, currentDraft) &&/* this.messageInputField.value === wrappedDraft && */this.replyToMsgId === draft.reply_to_msg_id) return false;\n\n if(fromUpdate) {\n this.clearHelper();\n }\n\n this.noWebPage = draft.pFlags.no_webpage;\n if(draft.reply_to_msg_id) {\n this.initMessageReply(draft.reply_to_msg_id);\n }\n\n this.setInputValue(wrappedDraft, fromUpdate, fromUpdate);\n return true;\n }\n\n private createSendAs() {\n this.sendAsPeerId = undefined;\n\n if(this.chat.type === 'chat' || this.chat.type === 'discussion') {\n let firstChange = true;\n this.sendAs = new ChatSendAs(\n this.managers,\n (container, skipAnimation) => {\n let useRafs = 0;\n if(!container.parentElement) {\n this.newMessageWrapper.prepend(container);\n useRafs = 2;\n }\n\n this.updateOffset('as', true, skipAnimation, useRafs);\n },\n (sendAsPeerId) => {\n this.sendAsPeerId = sendAsPeerId;\n\n // do not change placeholder earlier than finishPeerChange does\n if(firstChange) {\n firstChange = false;\n return;\n }\n\n this.getPlaceholderKey().then((key) => {\n this.updateMessageInputPlaceholder(key);\n });\n }\n );\n } else {\n this.sendAs = undefined;\n }\n\n return this.sendAs;\n }\n\n public async finishPeerChange(startParam?: string) {\n const peerId = this.chat.peerId;\n\n const {forwardElements, btnScheduled, replyKeyboard, sendMenu, goDownBtn, chatInput, botCommandsToggle} = this;\n\n const previousSendAs = this.sendAs;\n const sendAs = this.createSendAs();\n\n const [\n isBroadcast,\n canPinMessage,\n isBot,\n canSend,\n canSendPlain,\n neededFakeContainer,\n ackedPeerFull,\n ackedScheduledMids,\n setSendAsCallback,\n filteredAttachMenuButtons\n ] = await Promise.all([\n this.managers.appPeersManager.isBroadcast(peerId),\n this.managers.appPeersManager.canPinMessage(peerId),\n this.managers.appPeersManager.isBot(peerId),\n this.chat.canSend('send_messages'),\n this.chat.canSend('send_plain'),\n this.getNeededFakeContainer(startParam),\n modifyAckedPromise(this.managers.acknowledged.appProfileManager.getProfileByPeerId(peerId)),\n btnScheduled ? modifyAckedPromise(this.managers.acknowledged.appMessagesManager.getScheduledMessages(peerId)) : undefined,\n sendAs ? (sendAs.setPeerId(this.chat.peerId), sendAs.updateManual(true)) : undefined,\n this.filterAttachMenuButtons()\n ]);\n\n const placeholderKey = this.messageInput ? await this.getPlaceholderKey(canSendPlain) : undefined;\n\n return () => {\n // console.warn('[input] finishpeerchange start');\n\n chatInput.classList.remove('hide');\n goDownBtn.classList.toggle('is-broadcast', isBroadcast);\n goDownBtn.classList.remove('hide');\n\n\n if(this.goDownUnreadBadge) {\n this.setUnreadCount();\n }\n\n if(this.chat.type === 'pinned') {\n chatInput.classList.toggle('can-pin', canPinMessage);\n }/* else if(this.chat.type === 'chat') {\n } */\n\n if(forwardElements) {\n this.forwardWasDroppingAuthor = false;\n forwardElements.showCaption.checkboxField.setValueSilently(true);\n forwardElements.showSender.checkboxField.setValueSilently(true);\n }\n\n if(btnScheduled && ackedScheduledMids) {\n btnScheduled.classList.add('hide');\n const middleware = this.chat.bubbles.getMiddleware();\n callbackify(ackedScheduledMids.result, (mids) => {\n if(!middleware() || !mids) return;\n btnScheduled.classList.toggle('hide', !mids.length);\n });\n }\n\n if(this.newMessageWrapper) {\n this.updateOffset(null, false, true);\n }\n\n if(botCommandsToggle) {\n this.hasBotCommands = undefined;\n this.botCommands.toggle(true, undefined, true);\n this.updateBotCommandsToggle(true);\n botCommandsToggle.remove();\n if(isBot) {\n const middleware = this.chat.bubbles.getMiddleware();\n const result = ackedPeerFull.result;\n callbackify(result, (userFull) => {\n if(!middleware()) return;\n this.updateBotCommands(userFull as UserFull.userFull, !(result instanceof Promise));\n });\n }\n }\n\n previousSendAs?.destroy();\n setSendAsCallback?.();\n replyKeyboard?.setPeer(peerId);\n sendMenu?.setPeerId(peerId);\n\n if(this.messageInput) {\n this.updateMessageInput(canSend, canSendPlain, placeholderKey, filteredAttachMenuButtons);\n this.messageInput.dataset.peerId = '' + peerId;\n }\n\n this.messageInputField?.onFakeInput(undefined, true);\n\n let haveSomethingInControl = false;\n if(this.pinnedControlBtn) {\n const good = this.chat.type === 'pinned';\n haveSomethingInControl ||= good;\n this.pinnedControlBtn.classList.toggle('hide', !good);\n this.pinnedControlBtn.replaceChildren(i18n(canPinMessage ? 'Chat.Input.UnpinAll' : 'Chat.Pinned.DontShow'));\n }\n\n {\n const good = this.chat.isForum && !this.chat.isForumTopic && this.chat.type === 'chat';\n haveSomethingInControl ||= good;\n this.replyInTopicOverlay.classList.toggle('hide', !good);\n }\n\n this.botStartBtn.classList.toggle('hide', haveSomethingInControl);\n\n // * testing\n // this.startParam = this.appPeersManager.isBot(peerId) ? '123' : undefined;\n\n this.startParam = startParam;\n\n this._center(neededFakeContainer, false);\n\n // console.warn('[input] finishpeerchange ends');\n };\n }\n\n private updateOffset(type: 'commands' | 'as', forwards: boolean, skipAnimation?: boolean, useRafs?: number) {\n if(type) {\n this.newMessageWrapper.dataset.offset = type;\n } else {\n delete this.newMessageWrapper.dataset.offset;\n }\n\n SetTransition({\n element: this.newMessageWrapper,\n className: 'has-offset',\n forwards,\n duration: skipAnimation ? 0 : 300,\n useRafs\n });\n }\n\n private updateBotCommands(userFull: UserFull.userFull, skipAnimation?: boolean) {\n this.hasBotCommands = !!userFull.bot_info?.commands?.length;\n this.updateBotCommandsToggle(skipAnimation);\n }\n\n private updateBotCommandsToggle(skipAnimation?: boolean) {\n const {botCommandsToggle, hasBotCommands} = this;\n\n const show = !!hasBotCommands && this.isInputEmpty();\n if(!hasBotCommands) {\n if(!botCommandsToggle.parentElement) {\n return;\n }\n\n botCommandsToggle.remove();\n }\n\n const forwards = show;\n const useRafs = botCommandsToggle.parentElement ? 0 : 2;\n\n if(!botCommandsToggle.parentElement) {\n this.newMessageWrapper.prepend(botCommandsToggle);\n }\n\n this.updateOffset('commands', forwards, skipAnimation, useRafs);\n }\n\n private async getPlaceholderKey(canSend?: boolean) {\n canSend ??= await this.chat.canSend('send_plain');\n const {peerId, threadId, isForum} = this.chat;\n let key: LangPackKey;\n if(!canSend) {\n key = 'Channel.Persmission.MessageBlock';\n } else if(threadId && !isForum) {\n key = 'Comment';\n } else if(await this.managers.appPeersManager.isBroadcast(peerId)) {\n key = 'ChannelBroadcast';\n } else if(\n (this.sendAsPeerId !== undefined && this.sendAsPeerId !== rootScope.myId) ||\n await this.managers.appMessagesManager.isAnonymousSending(peerId)\n ) {\n key = 'SendAnonymously';\n } else {\n key = 'Message';\n }\n\n return key;\n }\n\n private updateMessageInputPlaceholder(key: LangPackKey) {\n // console.warn('[input] update placeholder');\n const i = I18n.weakMap.get(this.messageInput) as I18n.IntlElement;\n if(!i) {\n return;\n }\n\n const oldKey = i.key;\n i.compareAndUpdate({key});\n\n return {oldKey, newKey: key};\n }\n\n private filterAttachMenuButtons() {\n if(!this.attachMenuButtons) return;\n return filterAsync(this.attachMenuButtons, (button) => {\n return button.verify ? button.verify() : true;\n });\n }\n\n public updateMessageInput(\n canSend: boolean,\n canSendPlain: boolean,\n placeholderKey: LangPackKey,\n visible: ChatInput['attachMenuButtons']\n ) {\n const {chatInput, attachMenu, messageInput} = this;\n const isHidden = chatInput.classList.contains('is-hidden');\n const willBeHidden = !canSend;\n if(isHidden !== willBeHidden) {\n chatInput.classList.add('no-transition');\n chatInput.classList.toggle('is-hidden', !canSend);\n void chatInput.offsetLeft; // reflow\n chatInput.classList.remove('no-transition');\n }\n\n const isEditingAndLocked = canSend && !canSendPlain && this.restoreInputLock;\n\n !isEditingAndLocked && this.updateMessageInputPlaceholder(placeholderKey);\n\n if(isEditingAndLocked) {\n this.restoreInputLock = () => {\n this.updateMessageInputPlaceholder(placeholderKey);\n this.messageInput.contentEditable = 'false';\n };\n } else if(!canSend || !canSendPlain) {\n messageInput.contentEditable = 'false';\n\n if(!canSendPlain) {\n this.messageInputField.onFakeInput(undefined, true);\n }\n } else {\n this.restoreInputLock = undefined;\n messageInput.contentEditable = 'true';\n this.setDraft(undefined, false);\n\n if(!messageInput.innerHTML) {\n this.messageInputField.onFakeInput(undefined, true);\n }\n }\n\n if(attachMenu) {\n attachMenu.toggleAttribute('disabled', !visible.length);\n attachMenu.classList.toggle('btn-disabled', !visible.length);\n }\n\n this.updateSendBtn();\n }\n\n private attachMessageInputField() {\n const oldInputField = this.messageInputField;\n this.messageInputField = new InputFieldAnimated({\n placeholder: 'Message',\n name: 'message',\n withLinebreaks: true\n });\n\n this.messageInputField.input.tabIndex = -1;\n this.messageInputField.input.classList.replace('input-field-input', 'input-message-input');\n this.messageInputField.inputFake.classList.replace('input-field-input', 'input-message-input');\n this.messageInput = this.messageInputField.input;\n this.attachMessageInputListeners();\n\n if(IS_STICKY_INPUT_BUGGED) {\n fixSafariStickyInputFocusing(this.messageInput);\n }\n\n if(oldInputField) {\n oldInputField.input.replaceWith(this.messageInputField.input);\n oldInputField.inputFake.replaceWith(this.messageInputField.inputFake);\n } else {\n this.inputMessageContainer.append(this.messageInputField.input, this.messageInputField.inputFake);\n }\n }\n\n private attachMessageInputListeners() {\n this.listenerSetter.add(this.messageInput)('keydown', (e) => {\n const key = e.key;\n\n if(isSendShortcutPressed(e)) {\n cancelEvent(e);\n this.sendMessage();\n } else if(e.ctrlKey || e.metaKey) {\n this.handleMarkdownShortcut(e);\n } else if((key === 'PageUp' || key === 'PageDown') && !e.shiftKey) { // * fix pushing page to left (Chrome Windows)\n e.preventDefault();\n\n if(key === 'PageUp') {\n const range = document.createRange();\n const sel = window.getSelection();\n\n range.setStart(this.messageInput.childNodes[0] || this.messageInput, 0);\n range.collapse(true);\n\n sel.removeAllRanges();\n sel.addRange(range);\n } else {\n placeCaretAtEnd(this.messageInput);\n }\n }\n });\n\n attachClickEvent(this.messageInput, (e) => {\n if(!this.canSendPlain()) {\n toastNew({\n langPackKey: POSTING_NOT_ALLOWED_MAP['send_plain']\n });\n }\n }, {listenerSetter: this.listenerSetter});\n\n if(IS_TOUCH_SUPPORTED) {\n attachClickEvent(this.messageInput, (e) => {\n if(emoticonsDropdown.isActive()) {\n emoticonsDropdown.toggle(false);\n blurActiveElement();\n cancelEvent(e);\n // this.messageInput.focus();\n return;\n }\n\n this.appImManager.selectTab(APP_TABS.CHAT); // * set chat tab for album orientation\n // this.saveScroll();\n }, {listenerSetter: this.listenerSetter});\n\n /* this.listenerSetter.add(window)('resize', () => {\n this.restoreScroll();\n }); */\n\n /* if(isSafari) {\n this.listenerSetter.add(this.messageInput)('mousedown', () => {\n window.requestAnimationFrame(() => {\n window.requestAnimationFrame(() => {\n emoticonsDropdown.toggle(false);\n });\n });\n });\n } */\n }\n\n /* this.listenerSetter.add(this.messageInput)('beforeinput', (e: Event) => {\n // * validate due to manual formatting through browser's context menu\n const inputType = (e as InputEvent).inputType;\n //console.log('message beforeinput event', e);\n\n if(inputType.indexOf('format') === 0) {\n //console.log('message beforeinput format', e, inputType, this.messageInput.innerHTML);\n const markdownType = inputType.split('format')[1].toLowerCase() as MarkdownType;\n if(this.applyMarkdown(markdownType)) {\n cancelEvent(e); // * cancel legacy markdown event\n }\n }\n }); */\n this.listenerSetter.add(this.messageInput)('input', this.onMessageInput);\n this.listenerSetter.add(this.messageInput)('keyup', () => {\n this.checkAutocomplete();\n });\n\n this.listenerSetter.add(this.messageInput)('focusin', () => {\n if((this.chat.type === 'chat' || this.chat.type === 'discussion') &&\n this.chat.bubbles.scrollable.loadedAll.bottom) {\n this.managers.appMessagesManager.readAllHistory(this.chat.peerId, this.chat.threadId);\n }\n });\n }\n\n public canSendPlain() {\n return !(!this.messageInput.isContentEditable && !this.chatInput.classList.contains('is-hidden'));\n }\n\n private prepareDocumentExecute = () => {\n this.executedHistory.push(this.messageInput.innerHTML);\n return () => this.canUndoFromHTML = this.messageInput.innerHTML;\n };\n\n private undoRedo = (e: Event, type: 'undo' | 'redo', needHTML: string) => {\n cancelEvent(e); // cancel legacy event\n\n let html = this.messageInput.innerHTML;\n if(html && html !== needHTML) {\n this.lockRedo = true;\n\n let sameHTMLTimes = 0;\n do {\n document.execCommand(type, false, null);\n const currentHTML = this.messageInput.innerHTML;\n if(html === currentHTML) {\n if(++sameHTMLTimes > 2) { // * unlink, removeFormat (а может и нет, случай: заболдить подчёркнутый текст (выделить ровно его), попробовать отменить)\n break;\n }\n } else {\n sameHTMLTimes = 0;\n }\n\n html = currentHTML;\n } while(html !== needHTML);\n\n this.lockRedo = false;\n }\n };\n\n public applyMarkdown(type: MarkdownType, href?: string) {\n // const MONOSPACE_FONT = 'var(--font-monospace)';\n // const SPOILER_FONT = 'spoiler';\n const commandsMap: Partial<{[key in typeof type]: string | (() => void)}> = {\n // bold: 'Bold',\n // italic: 'Italic',\n // underline: 'Underline',\n // strikethrough: 'Strikethrough',\n // monospace: () => document.execCommand('fontName', false, MONOSPACE_FONT),\n link: href ? () => document.execCommand('createLink', false, href) : () => document.execCommand('unlink', false, null)\n // spoiler: () => document.execCommand('fontName', false, SPOILER_FONT)\n };\n\n const c = (type: MarkdownType) => {\n commandsMap[type] = () => {\n const k = (canCombine.includes(type) ? canCombine : [type]).filter((type) => hasMarkup[type]);\n if(!indexOfAndSplice(k, type)) {\n k.push(type);\n }\n\n if(!k.length) {\n return this.resetCurrentFontFormatting();\n } else {\n return document.execCommand('fontName', false, 'markup-' + k.join('-'));\n }\n };\n };\n\n const canCombine = ['bold', 'italic', 'underline', 'strikethrough', 'spoiler'] as (typeof type)[];\n canCombine.forEach((type) => {\n c(type);\n });\n\n c('monospace');\n\n if(!commandsMap[type]) {\n return false;\n }\n\n const command = commandsMap[type];\n\n // type = 'monospace';\n\n // const saveExecuted = this.prepareDocumentExecute();\n const executed: any[] = [];\n /**\n * * clear previous formatting, due to Telegram's inability to handle several entities\n */\n /* const checkForSingle = () => {\n const nodes = getSelectedNodes();\n //console.log('Using formatting:', commandsMap[type], nodes, this.executedHistory);\n\n const parents = [...new Set(nodes.map((node) => node.parentNode))];\n //const differentParents = !!nodes.find((node) => node.parentNode !== firstParent);\n const differentParents = parents.length > 1;\n\n let notSingle = false;\n if(differentParents) {\n notSingle = true;\n } else {\n const node = nodes[0];\n if(node && (node.parentNode as HTMLElement) !== this.messageInput && (node.parentNode.parentNode as HTMLElement) !== this.messageInput) {\n notSingle = true;\n }\n }\n\n if(notSingle) {\n //if(type === 'monospace') {\n executed.push(document.execCommand('styleWithCSS', false, 'true'));\n //}\n\n executed.push(document.execCommand('unlink', false, null));\n executed.push(document.execCommand('removeFormat', false, null));\n executed.push(typeof(command) === 'function' ? command() : document.execCommand(command, false, null));\n\n //if(type === 'monospace') {\n executed.push(document.execCommand('styleWithCSS', false, 'false'));\n //}\n }\n }; */\n\n // fix applying markdown when range starts from contenteditable=\"false\"\n let textNode: Text;\n // do {\n // // const {node, offset, selection} = getCaretPosNew(this.messageInput, true);\n // const selection = document.getSelection();\n // const range = selection.getRangeAt(0);\n // const {node, offset} = getCaretPosF(this.messageInput, range.startContainer, range.startOffset);\n // // const node = range.startContainer as ChildNode;\n // if(node?.textContent === BOM || (node as HTMLElement)?.isContentEditable === false) {\n // // selection.modify('extend', 'backward', 'character');\n // textNode = document.createTextNode(BOM);\n // (node.nodeType === node.ELEMENT_NODE ? node : node.parentElement).before(textNode);\n // range.setStart(textNode, 0);\n // }/* else {\n // break;\n // } */\n\n // break;\n // } while(true);\n\n const richInputHandler = RichInputHandler.getInstance();\n const restore = richInputHandler.prepareApplyingMarkdown();\n\n const listener = this.listenerSetter.add(this.messageInput)('input', cancelEvent, {capture: true, passive: false}) as any as Listener;\n\n executed.push(document.execCommand('styleWithCSS', false, 'true'));\n\n const hasMarkup = hasMarkupInSelection(Object.keys(commandsMap) as (typeof type)[]);\n\n // * monospace can't be combined with different types\n /* if(type === 'monospace' || type === 'spoiler') {\n // executed.push(document.execCommand('styleWithCSS', false, 'true'));\n\n const haveThisType = hasMarkup[type];\n // executed.push(document.execCommand('removeFormat', false, null));\n\n if(haveThisType) {\n executed.push(this.resetCurrentFontFormatting());\n } else {\n // if(type === 'monospace' || hasMarkup['monospace']) {\n // executed.push(this.resetCurrentFormatting());\n // }\n\n executed.push(typeof(command) === 'function' ? command() : document.execCommand(command, false, null));\n }\n } else */{\n if(hasMarkup['monospace'] && type === 'link') {\n executed.push(this.resetCurrentFormatting());\n }\n\n executed.push(typeof(command) === 'function' ? command() : document.execCommand(command, false, null));\n }\n\n executed.push(document.execCommand('styleWithCSS', false, 'false'));\n\n restore();\n\n // checkForSingle();\n // saveExecuted();\n this.appImManager.markupTooltip?.setActiveMarkupButton();\n\n if(textNode) {\n (textNode.parentElement === this.messageInput ? textNode : textNode.parentElement).remove();\n textNode.nodeValue = '';\n }\n\n this.listenerSetter.remove(listener);\n this.messageInputField.simulateInputEvent();\n\n return true;\n }\n\n private resetCurrentFormatting() {\n return document.execCommand('removeFormat', false, null);\n }\n\n private resetCurrentFontFormatting() {\n return document.execCommand('fontName', false, 'Roboto');\n }\n\n private handleMarkdownShortcut = (e: KeyboardEvent) => {\n // console.log('handleMarkdownShortcut', e);\n const formatKeys: {[key: string]: MarkdownType} = {\n 'KeyB': 'bold',\n 'KeyI': 'italic',\n 'KeyU': 'underline',\n 'KeyS': 'strikethrough',\n 'KeyM': 'monospace',\n 'KeyP': 'spoiler'\n };\n\n if(this.appImManager.markupTooltip) {\n formatKeys['KeyK'] = 'link';\n }\n\n const code = e.code;\n const applyMarkdown = formatKeys[code];\n\n const selection = document.getSelection();\n if(!isSelectionEmpty(selection) && applyMarkdown) {\n // * костыльчик\n if(code === 'KeyK') {\n this.appImManager.markupTooltip.showLinkEditor();\n } else {\n this.applyMarkdown(applyMarkdown);\n }\n\n cancelEvent(e); // cancel legacy event\n }\n\n // return;\n if(code === 'KeyZ') {\n let html = this.messageInput.innerHTML;\n\n if(e.shiftKey) {\n if(this.undoHistory.length) {\n this.executedHistory.push(html);\n html = this.undoHistory.pop();\n this.undoRedo(e, 'redo', html);\n html = this.messageInput.innerHTML;\n this.canRedoFromHTML = this.undoHistory.length ? html : '';\n this.canUndoFromHTML = html;\n }\n } else {\n // * подождём, когда пользователь сам восстановит поле до нужного состояния, которое стало сразу после saveExecuted\n if(this.executedHistory.length && (!this.canUndoFromHTML || html === this.canUndoFromHTML)) {\n this.undoHistory.push(html);\n html = this.executedHistory.pop();\n this.undoRedo(e, 'undo', html);\n\n // * поставим новое состояние чтобы снова подождать, если пользователь изменит что-то, и потом попробует откатить до предыдущего состояния\n this.canUndoFromHTML = this.canRedoFromHTML = this.messageInput.innerHTML;\n }\n }\n }\n };\n\n public onMessageInput = (e?: Event) => {\n // * validate due to manual formatting through browser's context menu\n /* const inputType = (e as InputEvent).inputType;\n console.log('message input event', e);\n if(inputType === 'formatBold') {\n console.log('message input format', this.messageInput.innerHTML);\n cancelEvent(e);\n }\n\n if(!isSelectionSingle()) {\n alert('not single');\n } */\n\n // console.log('messageInput input', this.messageInput.innerText);\n // const value = this.messageInput.innerText;\n const {value: richValue, entities: markdownEntities, caretPos} = getRichValueWithCaret(this.messageInputField.input);\n\n // const entities = parseEntities(value);\n const value = parseMarkdown(richValue, markdownEntities, true);\n const entities = mergeEntities(markdownEntities, parseEntities(value));\n\n // this.chat.log('messageInput entities', richValue, value, markdownEntities, caretPos);\n\n if(this.canRedoFromHTML && !this.lockRedo && this.messageInput.innerHTML !== this.canRedoFromHTML) {\n this.canRedoFromHTML = '';\n this.undoHistory.length = 0;\n }\n\n const urlEntities: Array = (!this.editMessage?.media || this.editMessage.media._ === 'messageMediaWebPage') && entities.filter((e) => e._ === 'messageEntityUrl' || e._ === 'messageEntityTextUrl') as any;\n if(urlEntities.length) {\n for(const entity of urlEntities) {\n let url: string;\n if(entity._ === 'messageEntityTextUrl') {\n url = entity.url;\n } else {\n url = richValue.slice(entity.offset, entity.offset + entity.length);\n\n if(!(url.includes('http://') || url.includes('https://'))) {\n continue;\n }\n }\n\n if(this.lastUrl !== url) {\n this.lastUrl = url;\n const promise = this.getWebPagePromise = Promise.all([\n this.managers.appWebPagesManager.getWebPage(url),\n this.chat.canSend('embed_links')\n ]).then(([webpage, canEmbedLinks]) => {\n if(this.getWebPagePromise === promise) this.getWebPagePromise = undefined;\n if(this.lastUrl !== url) return;\n if(webpage?._ === 'webPage' && canEmbedLinks) {\n this.setTopInfo('webpage', () => {}, webpage.site_name || webpage.title || 'Webpage', webpage.description || webpage.url || '');\n delete this.noWebPage;\n this.willSendWebPage = webpage;\n } else if(this.willSendWebPage) {\n this.onHelperCancel();\n }\n });\n }\n\n break;\n }\n } else if(this.lastUrl) {\n this.lastUrl = '';\n delete this.noWebPage;\n this.willSendWebPage = null;\n\n if(this.helperType) {\n this.helperFunc();\n } else {\n this.clearHelper();\n }\n }\n\n const isEmpty = !richValue.trim();\n if(isEmpty) {\n if(this.lastTimeType) {\n this.managers.appMessagesManager.setTyping(this.chat.peerId, {_: 'sendMessageCancelAction'}, undefined, this.chat.threadId);\n }\n\n this.appImManager.markupTooltip?.hide();\n\n // * Chrome has a bug - it will preserve the formatting if the input with monospace text is cleared\n // * so have to reset formatting\n if(document.activeElement === this.messageInput && !IS_MOBILE) {\n setTimeout(() => {\n if(document.activeElement === this.messageInput) {\n this.messageInput.textContent = '1';\n placeCaretAtEnd(this.messageInput);\n this.messageInput.textContent = '';\n }\n }, 0);\n }\n } else {\n const time = Date.now();\n if((time - this.lastTimeType) >= 6000 && e?.isTrusted) {\n this.lastTimeType = time;\n this.managers.appMessagesManager.setTyping(this.chat.peerId, {_: 'sendMessageTypingAction'}, undefined, this.chat.threadId);\n }\n\n this.botCommands?.toggle(true);\n }\n\n if(this.botCommands) {\n this.updateBotCommandsToggle();\n }\n\n if(!this.editMsgId) {\n this.saveDraftDebounced();\n }\n\n this.checkAutocomplete(richValue, caretPos, entities);\n\n this.updateSendBtn();\n };\n\n public insertAtCaret(insertText: string, insertEntity?: MessageEntity, isHelper = true) {\n if(!this.canSendPlain()) {\n toastNew({\n langPackKey: POSTING_NOT_ALLOWED_MAP['send_plain']\n });\n return;\n }\n\n RichInputHandler.getInstance().makeFocused(this.messageInput);\n\n const {value: fullValue, caretPos, entities} = getRichValueWithCaret(this.messageInput);\n const pos = caretPos >= 0 ? caretPos : fullValue.length;\n const prefix = fullValue.substr(0, pos);\n const suffix = fullValue.substr(pos);\n\n const matches = isHelper ? prefix.match(ChatInput.AUTO_COMPLETE_REG_EXP) : null;\n\n const matchIndex = matches ? matches.index + (matches[0].length - matches[2].length) : prefix.length;\n const newPrefix = prefix.slice(0, matchIndex);\n const newValue = newPrefix + insertText + suffix;\n\n if(isHelper && caretPos !== -1) {\n const match = matches[2];\n // const {node, selection} = getCaretPosNew(this.messageInput);\n\n const selection = document.getSelection();\n // const range = document.createRange();\n let counter = 0;\n while(selection.toString() !== match) {\n if(++counter >= 10000) {\n throw new Error('lolwhat');\n }\n\n // for(let i = 0; i < match.length; ++i) {\n selection.modify('extend', 'backward', 'character');\n }\n }\n\n {\n // const fragment = wrapDraftText(insertText, {entities: insertEntity ? [insertEntity] : undefined, wrappingForPeerId: this.chat.peerId});\n insertRichTextAsHTML(this.messageInput, insertText, insertEntity ? [insertEntity] : undefined, this.chat.peerId);\n // const {node, offset} = getCaretPos(this.messageInput);\n // const fragmentLastChild = fragment.lastChild;\n // if(node?.nodeType === node.TEXT_NODE) {\n // const prefix = node.nodeValue.slice(0, offset);\n // const suffix = node.nodeValue.slice(offset);\n\n // const suffixNode = document.createTextNode(suffix);\n\n // node.nodeValue = prefix;\n // node.parentNode.insertBefore(suffixNode, node.nextSibling);\n // node.parentNode.insertBefore(fragment, suffixNode);\n\n // setCaretAt(fragmentLastChild.nextSibling);\n\n // this.messageInputField.simulateInputEvent();\n // }\n }\n return;\n\n // merge emojis\n const hadEntities = parseEntities(fullValue);\n mergeEntities(entities, hadEntities);\n\n // max for additional whitespace\n const insertLength = insertEntity ? Math.max(insertEntity.length, insertText.length) : insertText.length;\n const addEntities: MessageEntity[] = [];\n if(insertEntity) {\n addEntities.push(insertEntity);\n insertEntity.offset = matchIndex;\n }\n\n // add offset to entities next to emoji\n const diff = matches ? insertLength - matches[2].length : insertLength;\n entities.forEach((entity) => {\n if(entity.offset >= matchIndex) {\n entity.offset += diff;\n }\n });\n\n mergeEntities(entities, addEntities);\n\n if(/* caretPos !== -1 && caretPos !== fullValue.length */true) {\n const caretEntity: MessageEntity.messageEntityCaret = {\n _: 'messageEntityCaret',\n offset: matchIndex + insertLength,\n length: 0\n };\n\n let insertCaretAtIndex = 0;\n for(let length = entities.length; insertCaretAtIndex < length; ++insertCaretAtIndex) {\n const entity = entities[insertCaretAtIndex];\n if(entity.offset > caretEntity.offset) {\n break;\n }\n }\n\n entities.splice(insertCaretAtIndex, 0, caretEntity);\n }\n\n // const saveExecuted = this.prepareDocumentExecute();\n // can't exec .value here because it will instantly check for autocomplete\n const value = documentFragmentToHTML(wrapDraftText(newValue, {entities}));\n this.messageInputField.setValueSilently(value);\n\n const caret = this.messageInput.querySelector('.composer-sel');\n if(caret) {\n setCaretAt(caret);\n caret.remove();\n }\n\n // but it's needed to be checked only here\n this.onMessageInput();\n\n // saveExecuted();\n\n // document.execCommand('insertHTML', true, wrapEmojiText(emoji));\n }\n\n public onEmojiSelected = (emoji: ReturnType, autocomplete: boolean) => {\n const entity: MessageEntity = emoji.docId ? {\n _: 'messageEntityCustomEmoji',\n document_id: emoji.docId,\n length: emoji.emoji.length,\n offset: 0\n } : getEmojiEntityFromEmoji(emoji.emoji);\n this.insertAtCaret(emoji.emoji, entity, autocomplete);\n };\n\n private async checkAutocomplete(value?: string, caretPos?: number, entities?: MessageEntity[]) {\n // return;\n\n const hadValue = value !== undefined;\n if(!hadValue) {\n const r = getRichValueWithCaret(this.messageInputField.input, true, true);\n value = r.value;\n caretPos = r.caretPos;\n entities = r.entities;\n }\n\n if(caretPos === -1) {\n caretPos = value.length;\n }\n\n if(entities === undefined || !hadValue) {\n const _value = parseMarkdown(value, entities, true);\n entities = mergeEntities(entities, parseEntities(_value));\n }\n\n value = value.slice(0, caretPos);\n\n if(this.previousQuery === value) {\n return;\n }\n\n this.previousQuery = value;\n\n const matches = value.match(ChatInput.AUTO_COMPLETE_REG_EXP);\n let foundHelper: AutocompleteHelper;\n if(matches) {\n const entity = entities[0];\n\n let query = matches[2];\n const firstChar = query[0];\n\n if(this.stickersHelper &&\n rootScope.settings.stickers.suggest !== 'none' &&\n await this.chat.canSend('send_stickers') &&\n entity?._ === 'messageEntityEmoji' && entity.length === value.length && !entity.offset) {\n foundHelper = this.stickersHelper;\n this.stickersHelper.checkEmoticon(value);\n } else if(firstChar === '@') { // mentions\n const topMsgId = this.chat.threadId ? getServerMessageId(this.chat.threadId) : undefined;\n if(await this.mentionsHelper.checkQuery(query, this.chat.peerId.isUser() ? NULL_PEER_ID : this.chat.peerId, topMsgId)) {\n foundHelper = this.mentionsHelper;\n }\n } else if(!matches[1] && firstChar === '/') { // commands\n if(await this.commandsHelper.checkQuery(query, this.chat.peerId)) {\n foundHelper = this.commandsHelper;\n }\n } else if(rootScope.settings.emoji.suggest) { // emoji\n query = query.replace(/^\\s*/, '');\n if(!value.match(/^\\s*:(.+):\\s*$/) && !value.match(/:[;!@#$%^&*()-=|]/) && query) {\n foundHelper = this.emojiHelper;\n this.emojiHelper.checkQuery(query, firstChar);\n }\n }\n }\n\n let canSendInline: boolean;\n if(!foundHelper) {\n canSendInline = await this.chat.canSend('send_inline');\n }\n\n foundHelper = this.checkInlineAutocomplete(value, canSendInline, foundHelper);\n\n this.autocompleteHelperController.hideOtherHelpers(foundHelper);\n }\n\n private checkInlineAutocomplete(value: string, canSendInline: boolean, foundHelper?: AutocompleteHelper): AutocompleteHelper {\n let needPlaceholder = false;\n\n const setPreloaderShow = (show: boolean) => {\n if(!this.btnPreloader) {\n return;\n }\n\n if(show && !canSendInline) {\n show = false;\n }\n\n SetTransition({\n element: this.btnPreloader,\n className: 'show',\n forwards: show,\n duration: 400\n });\n };\n\n if(!foundHelper) {\n const inlineMatch = value.match(/^@([a-zA-Z\\\\d_]{3,32})\\s/);\n if(inlineMatch) {\n const username = inlineMatch[1];\n const query = value.slice(inlineMatch[0].length);\n needPlaceholder = inlineMatch[0].length === value.length;\n\n foundHelper = this.inlineHelper;\n\n if(!this.btnPreloader) {\n this.btnPreloader = this.createButtonIcon('none btn-preloader float show disable-hover', {noRipple: true});\n putPreloader(this.btnPreloader, true);\n this.inputMessageContainer.parentElement.insertBefore(this.btnPreloader, this.inputMessageContainer.nextSibling);\n } else {\n setPreloaderShow(true);\n }\n\n this.inlineHelper.checkQuery(this.chat.peerId, username, query, canSendInline).then(({user, renderPromise}) => {\n if(needPlaceholder && user.bot_inline_placeholder) {\n this.messageInput.dataset.inlinePlaceholder = user.bot_inline_placeholder;\n }\n\n renderPromise.then(() => {\n setPreloaderShow(false);\n });\n }).catch((err: ApiError) => {\n setPreloaderShow(false);\n });\n }\n }\n\n if(!needPlaceholder) {\n delete this.messageInput.dataset.inlinePlaceholder;\n }\n\n if(foundHelper !== this.inlineHelper) {\n setPreloaderShow(false);\n }\n\n return foundHelper;\n }\n\n private setRecording(value: boolean) {\n if(this.recording === value) {\n return;\n }\n\n SetTransition({\n element: this.chatInput,\n className: 'is-recording',\n forwards: value,\n duration: 200\n });\n this.recording = value;\n this.updateSendBtn();\n }\n\n private onBtnSendClick = async(e: Event) => {\n cancelEvent(e);\n\n if(!this.recorder || this.recording || !this.isInputEmpty() || this.forwarding || this.editMsgId) {\n if(this.recording) {\n if((Date.now() - this.recordStartTime) < RECORD_MIN_TIME) {\n this.onCancelRecordClick();\n } else {\n this.recorder.stop();\n }\n } else {\n this.sendMessage();\n }\n } else {\n const isAnyChat = this.chat.peerId.isAnyChat();\n const flag: ChatRights = 'send_voices';\n if(isAnyChat && !(await this.chat.canSend(flag))) {\n toastNew({langPackKey: POSTING_NOT_ALLOWED_MAP[flag]});\n return;\n }\n\n this.chatInput.classList.add('is-locked');\n blurActiveElement();\n\n let restricted = false;\n if(!isAnyChat) {\n const userFull = await this.managers.appProfileManager.getProfile(this.chat.peerId.toUserId());\n if(userFull?.pFlags.voice_messages_forbidden) {\n toastNew({\n langPackKey: 'Chat.SendVoice.PrivacyError',\n langPackArguments: [await wrapPeerTitle({peerId: this.chat.peerId})]\n });\n restricted = true;\n }\n }\n\n if(restricted) {\n this.chatInput.classList.remove('is-locked');\n return;\n }\n\n this.recorder.start().then(() => {\n this.releaseMediaPlayback = appMediaPlaybackController.setSingleMedia();\n this.recordCanceled = false;\n\n this.setRecording(true);\n opusDecodeController.setKeepAlive(true);\n\n const showDiscardPopup = () => {\n new PopupPeer('popup-cancel-record', {\n titleLangKey: 'DiscardVoiceMessageTitle',\n descriptionLangKey: 'DiscardVoiceMessageDescription',\n buttons: [{\n langKey: 'DiscardVoiceMessageAction',\n callback: () => {\n simulateClickEvent(this.btnCancelRecord);\n }\n }, {\n langKey: 'Continue',\n isCancel: true\n }]\n }).show();\n };\n\n this.recordingOverlayListener = this.listenerSetter.add(document.body)('mousedown', (e) => {\n if(!findUpClassName(e.target, 'chat-input') && !findUpClassName(e.target, 'popup-cancel-record')) {\n cancelEvent(e);\n showDiscardPopup();\n }\n }, {capture: true, passive: false}) as any;\n\n appNavigationController.pushItem(this.recordingNavigationItem = {\n type: 'voice',\n onPop: () => {\n setTimeout(() => {\n showDiscardPopup();\n }, 0);\n\n return false;\n }\n });\n\n this.recordStartTime = Date.now();\n\n const sourceNode: MediaStreamAudioSourceNode = this.recorder.sourceNode;\n const context = sourceNode.context;\n\n const analyser = context.createAnalyser();\n sourceNode.connect(analyser);\n // analyser.connect(context.destination);\n analyser.fftSize = 32;\n\n const frequencyData = new Uint8Array(analyser.frequencyBinCount);\n const max = frequencyData.length * 255;\n const min = 54 / 150;\n const r = () => {\n if(!this.recording) return;\n\n analyser.getByteFrequencyData(frequencyData);\n\n let sum = 0;\n frequencyData.forEach((value) => {\n sum += value;\n });\n\n const percents = Math.min(1, (sum / max) + min);\n // console.log('frequencyData', frequencyData, percents);\n\n this.recordRippleEl.style.transform = `scale(${percents})`;\n\n const diff = Date.now() - this.recordStartTime;\n const ms = diff % 1000;\n\n const formatted = toHHMMSS(diff / 1000) + ',' + ('00' + Math.round(ms / 10)).slice(-2);\n\n this.recordTimeEl.innerText = formatted;\n\n fastRaf(r);\n };\n\n r();\n }).catch((e: Error) => {\n switch(e.name as string) {\n case 'NotAllowedError': {\n toast('Please allow access to your microphone');\n break;\n }\n\n case 'NotReadableError': {\n toast(e.message);\n break;\n }\n\n default:\n console.error('Recorder start error:', e, e.name, e.message);\n toast(e.message);\n break;\n }\n\n this.setRecording(false);\n this.chatInput.classList.remove('is-locked');\n });\n }\n };\n\n public onHelperCancel = async(e?: Event, force?: boolean) => {\n if(e) {\n cancelEvent(e);\n }\n\n if(this.willSendWebPage) {\n const lastUrl = this.lastUrl;\n let needReturn = false;\n if(this.helperType) {\n // if(this.helperFunc) {\n await this.helperFunc();\n // }\n\n needReturn = true;\n }\n\n // * restore values\n this.lastUrl = lastUrl;\n this.noWebPage = true;\n this.willSendWebPage = null;\n\n if(needReturn) return;\n }\n\n if(this.helperType === 'edit' && !force) {\n const message = this.editMessage;\n const draft = this.getCurrentInputAsDraft(true);\n if(draft) {\n delete draft.pFlags.no_webpage;\n }\n // const value = parseMarkdown(this.messageInputField.value, []);\n // if(message.message !== value) {\n const originalDraft = {...message, _: 'draftMessage'} as DraftMessage.draftMessage;\n if(originalDraft.entities?.length) {\n const canPassEntitiesTypes = new Set(Object.values(MARKDOWN_ENTITIES));\n originalDraft.entities = originalDraft.entities.slice();\n forEachReverse(originalDraft.entities, (entity, idx, arr) => {\n if(!canPassEntitiesTypes.has(entity._)) {\n arr.splice(idx, 1);\n }\n });\n\n if(!originalDraft.entities.length) {\n delete originalDraft.entities;\n }\n }\n\n if(!draftsAreEqual(draft, originalDraft)) {\n new PopupPeer('discard-editing', {\n buttons: [{\n langKey: 'Alert.Confirm.Discard',\n callback: () => {\n this.onHelperCancel(undefined, true);\n }\n }],\n descriptionLangKey: 'Chat.Edit.Cancel.Text'\n }).show();\n\n return;\n }\n }\n\n this.clearHelper();\n this.updateSendBtn();\n };\n\n private onHelperClick = (e: Event) => {\n cancelEvent(e);\n\n if(!findUpClassName(e.target, 'reply')) return;\n if(this.helperType === 'forward') {\n const {forwardElements} = this;\n if(forwardElements && IS_TOUCH_SUPPORTED && !forwardElements.container.classList.contains('active')) {\n contextMenuController.openBtnMenu(forwardElements.container);\n }\n } else if(this.helperType === 'reply') {\n this.chat.setMessageId(this.replyToMsgId);\n } else if(this.helperType === 'edit') {\n this.chat.setMessageId(this.editMsgId);\n }\n };\n\n private changeForwardRecipient() {\n if(this.helperWaitingForward) return;\n this.helperWaitingForward = true;\n\n const forwarding = copy(this.forwarding);\n const helperFunc = this.helperFunc;\n this.clearHelper();\n this.updateSendBtn();\n let selected = false;\n const popup = new PopupForward(forwarding, () => {\n selected = true;\n });\n\n popup.addEventListener('close', () => {\n this.helperWaitingForward = false;\n\n if(!selected) {\n helperFunc();\n }\n });\n }\n\n public async clearInput(canSetDraft = true, fireEvent = true, clearValue = '') {\n if(document.activeElement === this.messageInput && IS_MOBILE_SAFARI) { // fix first char uppercase\n const i = document.createElement('input');\n document.body.append(i);\n fixSafariStickyInput(i);\n this.messageInputField.setValueSilently(clearValue);\n fixSafariStickyInput(this.messageInput);\n i.remove();\n } else {\n this.messageInputField.setValueSilently(clearValue);\n }\n\n if(IS_TOUCH_SUPPORTED) {\n // this.messageInput.innerText = '';\n } else {\n // this.attachMessageInputField();\n // this.messageInput.innerText = '';\n\n // clear executions\n this.canRedoFromHTML = '';\n this.undoHistory.length = 0;\n this.executedHistory.length = 0;\n this.canUndoFromHTML = '';\n }\n\n let set = false;\n if(canSetDraft) {\n set = await this.setDraft(undefined, false);\n }\n\n if(!set && fireEvent) {\n this.onMessageInput();\n }\n }\n\n public isInputEmpty() {\n return isInputEmpty(this.messageInput);\n }\n\n public updateSendBtn() {\n let icon: 'send' | 'record' | 'edit' | 'schedule';\n\n const isInputEmpty = this.isInputEmpty();\n\n if(this.editMsgId) icon = 'edit';\n else if(!this.recorder || this.recording || !isInputEmpty || this.forwarding) icon = this.chat.type === 'scheduled' ? 'schedule' : 'send';\n else icon = 'record';\n\n ['send', 'record', 'edit', 'schedule'].forEach((i) => {\n this.btnSend.classList.toggle(i, icon === i);\n });\n\n if(this.btnScheduled) {\n this.btnScheduled.classList.toggle('show', isInputEmpty && this.chat.type !== 'scheduled');\n }\n\n if(this.btnToggleReplyMarkup) {\n this.btnToggleReplyMarkup.classList.toggle('show', isInputEmpty && this.chat.type !== 'scheduled');\n }\n }\n\n private getValueAndEntities(input: HTMLElement) {\n const {entities: apiEntities, value} = getRichValueWithCaret(input, true, false);\n const myEntities = parseEntities(value);\n const totalEntities = mergeEntities(apiEntities, myEntities);\n\n return {value, totalEntities};\n }\n\n public onMessageSent(clearInput = true, clearReply?: boolean) {\n if(this.chat.type !== 'scheduled') {\n this.managers.appMessagesManager.readAllHistory(this.chat.peerId, this.chat.threadId, true);\n }\n\n this.scheduleDate = undefined;\n this.sendSilent = undefined;\n\n const {totalEntities} = this.getValueAndEntities(this.messageInput);\n let nextOffset = 0;\n const emojiEntities: (MessageEntity.messageEntityEmoji | MessageEntity.messageEntityCustomEmoji)[] = totalEntities.filter((entity) => {\n if(entity._ === 'messageEntityEmoji' || entity._ === 'messageEntityCustomEmoji') {\n const endOffset = entity.offset + entity.length;\n return endOffset <= nextOffset ? false : (nextOffset = endOffset, true);\n }\n\n return false;\n }) as any;\n emojiEntities.forEach((entity) => {\n const emoji: AppEmoji = entity._ === 'messageEntityEmoji' ? {emoji: emojiFromCodePoints(entity.unicode)} : {docId: entity.document_id, emoji: ''};\n this.managers.appEmojiManager.pushRecentEmoji(emoji);\n });\n\n if(clearInput) {\n this.lastUrl = '';\n delete this.noWebPage;\n this.willSendWebPage = null;\n this.clearInput();\n }\n\n if(clearReply || clearInput) {\n this.clearHelper();\n }\n\n this.updateSendBtn();\n }\n\n public sendMessage(force = false) {\n const {editMsgId, chat} = this;\n if(chat.type === 'scheduled' && !force && !editMsgId) {\n this.scheduleSending();\n return;\n }\n\n const {peerId} = chat;\n const {noWebPage} = this;\n const sendingParams = this.chat.getMessageSendingParams();\n\n const {value, entities} = getRichValueWithCaret(this.messageInputField.input, true, false);\n\n // return;\n if(editMsgId) {\n const message = this.editMessage;\n if(value.trim() || message.media) {\n this.managers.appMessagesManager.editMessage(message, value, {\n entities,\n noWebPage: noWebPage\n });\n\n this.onMessageSent();\n } else {\n new PopupDeleteMessages(peerId, [editMsgId], chat.type);\n\n return;\n }\n } else if(value.trim()) {\n this.managers.appMessagesManager.sendText(peerId, value, {\n entities,\n ...sendingParams,\n noWebPage: noWebPage,\n webPage: this.getWebPagePromise ? undefined : this.willSendWebPage,\n clearDraft: true\n });\n\n if(this.chat.type === 'scheduled') {\n this.onMessageSent(true);\n } else {\n this.onMessageSent(false, false);\n }\n // this.onMessageSent();\n }\n\n // * wait for sendText set messageId for invokeAfterMsg\n if(this.forwarding) {\n const forwarding = copy(this.forwarding);\n // setTimeout(() => {\n for(const fromPeerId in forwarding) {\n this.managers.appMessagesManager.forwardMessages(peerId, fromPeerId.toPeerId(), forwarding[fromPeerId], {\n ...sendingParams,\n dropAuthor: this.forwardElements && this.forwardElements.hideSender.checkboxField.checked,\n dropCaptions: this.isDroppingCaptions()\n }).catch(async(err: ApiError) => {\n if(err.type === 'VOICE_MESSAGES_FORBIDDEN') {\n toastNew({\n langPackKey: 'Chat.SendVoice.PrivacyError',\n langPackArguments: [await wrapPeerTitle({peerId})]\n });\n }\n });\n }\n\n if(!value) {\n this.onMessageSent();\n }\n // }, 0);\n }\n\n // this.onMessageSent();\n }\n\n public async sendMessageWithDocument(\n document: MyDocument | DocId,\n force = false,\n clearDraft = false,\n silent = false\n ) {\n document = await this.managers.appDocsManager.getDoc(document);\n\n const flag = document.type === 'sticker' ? 'send_stickers' : (document.type === 'gif' ? 'send_gifs' : 'send_media');\n if(this.chat.peerId.isAnyChat() && !(await this.chat.canSend(flag))) {\n toastNew({langPackKey: POSTING_NOT_ALLOWED_MAP[flag]});\n return false;\n }\n\n if(this.chat.type === 'scheduled' && !force) {\n this.scheduleSending(() => this.sendMessageWithDocument(document, true, clearDraft, silent));\n return false;\n }\n\n if(!document) {\n return false;\n }\n\n if(document.sticker && getStickerEffectThumb(document) && !rootScope.premium) {\n return false;\n }\n\n this.managers.appMessagesManager.sendFile(this.chat.peerId, {\n ...this.chat.getMessageSendingParams(),\n file: document,\n isMedia: true,\n clearDraft,\n silent\n });\n this.onMessageSent(clearDraft, true);\n\n if(document.type === 'sticker') {\n this.managers.appStickersManager.saveRecentSticker(document.id);\n }\n\n return true;\n }\n\n private canToggleHideAuthor() {\n const {forwardElements} = this;\n if(!forwardElements) return false;\n const hideCaptionCheckboxField = forwardElements.hideCaption.checkboxField;\n return !hideCaptionCheckboxField.checked ||\n findUpTag(hideCaptionCheckboxField.label, 'FORM').classList.contains('hide');\n }\n\n private isDroppingCaptions() {\n return !this.canToggleHideAuthor();\n }\n\n /* public sendSomething(callback: () => void, force = false) {\n if(this.chat.type === 'scheduled' && !force) {\n this.scheduleSending(() => this.sendSomething(callback, true));\n return false;\n }\n\n callback();\n this.onMessageSent(false, true);\n\n return true;\n } */\n\n public async initMessageEditing(mid: number) {\n const message = (await this.chat.getMessage(mid)) as Message.message;\n\n let input = wrapDraftText(message.message, {entities: message.totalEntities, wrappingForPeerId: this.chat.peerId});\n const f = async() => {\n let restoreInputLock: () => void;\n if(!this.messageInput.isContentEditable) {\n const placeholderKey = await this.getPlaceholderKey(true);\n const {contentEditable} = this.messageInput;\n this.messageInput.contentEditable = 'true';\n const {oldKey} = this.updateMessageInputPlaceholder(placeholderKey);\n\n restoreInputLock = () => {\n this.messageInput.contentEditable = contentEditable;\n this.updateMessageInputPlaceholder(oldKey);\n };\n }\n\n const replyFragment = await wrapMessageForReply({message, usingMids: [message.mid]});\n this.setTopInfo('edit', f, i18n('AccDescrEditing'), replyFragment, input, message);\n\n this.editMsgId = mid;\n this.editMessage = message;\n input = undefined;\n\n this.restoreInputLock = restoreInputLock;\n };\n f();\n }\n\n public initMessagesForward(fromPeerIdsMids: {[fromPeerId: PeerId]: number[]}) {\n const f = async() => {\n // const peerTitles: string[]\n const fromPeerIds = Object.keys(fromPeerIdsMids).map((fromPeerId) => fromPeerId.toPeerId());\n const smth: Set = new Set();\n let length = 0, messagesWithCaptionsLength = 0;\n\n const p = fromPeerIds.map(async(fromPeerId) => {\n const mids = fromPeerIdsMids[fromPeerId];\n const promises = mids.map(async(mid) => {\n const message = (await this.managers.appMessagesManager.getMessageByPeer(fromPeerId, mid)) as Message.message;\n if(message.fwd_from?.from_name && !message.fromId && !message.fwdFromId) {\n smth.add('N' + message.fwd_from.from_name);\n } else {\n smth.add('P' + message.fromId);\n }\n\n if(message.media && message.message) {\n ++messagesWithCaptionsLength;\n }\n });\n\n await Promise.all(promises);\n\n length += mids.length;\n });\n\n await Promise.all(p);\n\n const onlyFirstName = smth.size > 2;\n const peerTitles = [...smth].map((smth) => {\n const type = smth[0];\n smth = smth.slice(1);\n if(type === 'P') {\n const peerId = smth.toPeerId();\n return peerId === rootScope.myId ? i18n('Chat.Accessory.Forward.You') : new PeerTitle({peerId, dialog: false, onlyFirstName}).element;\n } else {\n return onlyFirstName ? smth.split(' ')[0] : smth;\n }\n });\n\n const {forwardElements} = this;\n const form = findUpTag(forwardElements.showCaption.checkboxField.label, 'FORM');\n form.classList.toggle('hide', !messagesWithCaptionsLength);\n const hideCaption = forwardElements.hideCaption.checkboxField.checked;\n if(messagesWithCaptionsLength && hideCaption) {\n forwardElements.hideSender.checkboxField.setValueSilently(true);\n } else if(this.forwardWasDroppingAuthor !== undefined) {\n (this.forwardWasDroppingAuthor ? forwardElements.hideSender : forwardElements.showSender).checkboxField.setValueSilently(true);\n }\n\n const titleKey: LangPackKey = forwardElements.showSender.checkboxField.checked ? 'Chat.Accessory.Forward' : 'Chat.Accessory.Hidden';\n const title = i18n(titleKey, [length]);\n\n const senderTitles = document.createDocumentFragment();\n if(peerTitles.length < 3) {\n senderTitles.append(...join(peerTitles, false));\n } else {\n senderTitles.append(peerTitles[0], i18n('AndOther', [peerTitles.length - 1]));\n }\n\n let firstMessage: Message.message, usingFullAlbum: boolean;\n if(fromPeerIds.length === 1) {\n const fromPeerId = fromPeerIds[0];\n const mids = fromPeerIdsMids[fromPeerId];\n firstMessage = (await this.managers.appMessagesManager.getMessageByPeer(fromPeerId, mids[0])) as Message.message;\n\n usingFullAlbum = !!firstMessage.grouped_id;\n if(usingFullAlbum) {\n const albumMids = await this.managers.appMessagesManager.getMidsByMessage(firstMessage);\n if(albumMids.length !== length || albumMids.find((mid) => !mids.includes(mid))) {\n usingFullAlbum = false;\n }\n }\n }\n\n const subtitleFragment = document.createDocumentFragment();\n const delimiter = ': ';\n if(usingFullAlbum || length === 1) {\n const mids = fromPeerIdsMids[fromPeerIds[0]];\n const replyFragment = await wrapMessageForReply({message: firstMessage, usingMids: mids});\n subtitleFragment.append(\n senderTitles,\n delimiter,\n replyFragment\n );\n } else {\n subtitleFragment.append(\n i18n('Chat.Accessory.Forward.From'),\n delimiter,\n senderTitles\n );\n }\n\n const newReply = this.setTopInfo('forward', f, title, subtitleFragment);\n\n forwardElements.modifyArgs.forEach((b, idx) => {\n const text = b.textElement;\n const intl: I18n.IntlElement = I18n.weakMap.get(text) as any;\n intl.args = [idx < 2 ? fromPeerIds.length : messagesWithCaptionsLength];\n intl.update();\n });\n\n if(this.forwardHover) {\n this.forwardHover.attachButtonListener(newReply, this.listenerSetter);\n }\n\n this.forwarding = fromPeerIdsMids;\n };\n\n f();\n }\n\n public async initMessageReply(mid: number) {\n if(this.replyToMsgId === mid) {\n return;\n }\n\n let message = await this.chat.getMessage(mid);\n const f = () => {\n let peerTitleEl: HTMLElement;\n if(!message) { // load missing replying message\n peerTitleEl = i18n('Loading');\n\n this.managers.appMessagesManager.reloadMessages(this.chat.peerId, mid).then((_message) => {\n if(this.replyToMsgId !== mid) {\n return;\n }\n\n message = _message;\n if(!message) {\n this.clearHelper('reply');\n } else {\n f();\n }\n });\n } else {\n peerTitleEl = new PeerTitle({\n peerId: message.fromId,\n dialog: false\n }).element;\n }\n\n this.setTopInfo('reply', f, peerTitleEl, message && (message as Message.message).message, undefined, message);\n this.setReplyToMsgId(mid)\n };\n f();\n }\n\n public setReplyToMsgId(mid: number) {\n this.replyToMsgId = mid;\n this.center(true);\n }\n\n public clearHelper(type?: ChatInputHelperType) {\n if(this.helperType === 'edit' && type !== 'edit') {\n this.clearInput();\n }\n\n if(type) {\n this.lastUrl = '';\n delete this.noWebPage;\n this.willSendWebPage = null;\n }\n\n if(type !== 'reply') {\n this.setReplyToMsgId(undefined);\n this.forwarding = undefined;\n }\n\n this.editMsgId = this.editMessage = undefined;\n this.helperType = this.helperFunc = undefined;\n\n if(this.restoreInputLock) {\n this.restoreInputLock?.();\n this.restoreInputLock = undefined;\n }\n\n if(this.chat.container.classList.contains('is-helper-active')) {\n appNavigationController.removeByType('input-helper');\n this.chat.container.classList.remove('is-helper-active');\n this.t();\n }\n }\n\n private t() {\n const className = 'is-toggling-helper';\n SetTransition({\n element: this.chat.container,\n className,\n forwards: true,\n duration: 150,\n onTransitionEnd: () => {\n this.chat.container.classList.remove(className);\n }\n });\n }\n\n public setInputValue(value: Parameters[0], clear = true, focus = true) {\n if(!value) value = '';\n\n if(clear) this.clearInput(false, false, value as string);\n else this.messageInputField.setValueSilently(value);\n\n fastRaf(() => {\n focus && placeCaretAtEnd(this.messageInput);\n this.onMessageInput();\n this.messageInput.scrollTop = this.messageInput.scrollHeight;\n });\n }\n\n public setTopInfo(\n type: ChatInputHelperType,\n callerFunc: () => void,\n title: Parameters[0] = '',\n subtitle: Parameters[1] = '',\n input?: Parameters[0],\n message?: any\n ) {\n if(this.willSendWebPage && type === 'reply') {\n return;\n }\n\n if(type !== 'webpage') {\n this.clearHelper(type);\n this.helperType = type;\n this.helperFunc = callerFunc;\n }\n\n const replyParent = this.replyElements.container;\n const oldReply = replyParent.lastElementChild.previousElementSibling;\n const haveReply = oldReply.classList.contains('reply');\n\n this.replyElements.iconBtn.replaceWith(this.replyElements.iconBtn = this.createButtonIcon((type === 'webpage' ? 'link' : type) + ' active reply-icon', {noRipple: true}));\n const {container} = wrapReply(title, subtitle, this.chat.animationGroup, message);\n if(haveReply) {\n oldReply.replaceWith(container);\n } else {\n replyParent.insertBefore(container, replyParent.lastElementChild);\n }\n\n if(type === 'webpage') {\n container.style.cursor = 'default';\n }\n\n if(!this.chat.container.classList.contains('is-helper-active')) {\n this.chat.container.classList.add('is-helper-active');\n this.t();\n }\n\n /* const scroll = appImManager.scrollable;\n if(scroll.isScrolledDown && !scroll.scrollLocked && !appImManager.messagesQueuePromise && !appImManager.setPeerPromise) {\n scroll.scrollTo(scroll.scrollHeight, 'top', true, true, 200);\n } */\n\n if(!IS_MOBILE) {\n appNavigationController.pushItem({\n type: 'input-helper',\n onPop: () => {\n this.onHelperCancel();\n }\n });\n }\n\n if(input !== undefined) {\n this.setInputValue(input);\n }\n\n setTimeout(() => {\n this.updateSendBtn();\n }, 0);\n\n return container;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {DraftMessage} from '../../layer';\nimport mergeEntities from '../../lib/richTextProcessor/mergeEntities';\nimport parseEntities from '../../lib/richTextProcessor/parseEntities';\nimport wrapDraftText from '../../lib/richTextProcessor/wrapDraftText';\n\nexport default function wrapDraft(draft: DraftMessage.draftMessage, wrappingForPeerId: PeerId, loadPromises?: Promise[]) {\n const myEntities = parseEntities(draft.message);\n const apiEntities = draft.entities || [];\n const totalEntities = mergeEntities(apiEntities.slice(), myEntities); // ! only in this order, otherwise bold and emoji formatting won't work\n\n return wrapDraftText(draft.message, {entities: totalEntities, wrappingForPeerId, loadPromises});\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport callbackify from '../../helpers/callbackify';\nimport formatNumber from '../../helpers/number/formatNumber';\nimport {Document, MessagePeerReaction, ReactionCount} from '../../layer';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport rootScope from '../../lib/rootScope';\nimport SetTransition from '../singleTransition';\nimport StackedAvatars from '../stackedAvatars';\nimport {Awaited} from '../../types';\nimport wrapSticker from '../wrappers/sticker';\nimport wrapCustomEmoji from '../wrappers/customEmoji';\nimport wrapStickerAnimation from '../wrappers/stickerAnimation';\nimport {makeMediaSize} from '../../helpers/mediaSize';\nimport RLottiePlayer from '../../lib/rlottie/rlottiePlayer';\nimport {fastRaf} from '../../helpers/schedulers';\nimport noop from '../../helpers/noop';\nimport {Middleware} from '../../helpers/middleware';\nimport liteMode from '../../helpers/liteMode';\n\nconst CLASS_NAME = 'reaction';\nconst TAG_NAME = CLASS_NAME + '-element';\nconst REACTION_INLINE_SIZE = 14;\nconst REACTION_BLOCK_SIZE = 22;\n\nexport const REACTION_DISPLAY_INLINE_COUNTER_AT = 2;\nexport const REACTION_DISPLAY_BLOCK_COUNTER_AT = 4;\n\nexport type ReactionLayoutType = 'block' | 'inline';\n\nexport default class ReactionElement extends HTMLElement {\n private type: ReactionLayoutType;\n private counter: HTMLElement;\n private stickerContainer: HTMLElement;\n private stackedAvatars: StackedAvatars;\n private canRenderAvatars: boolean;\n private _reactionCount: ReactionCount;\n private wrapStickerPromise: Awaited>['render'];\n private managers: AppManagers;\n private middleware: Middleware;\n\n constructor() {\n super();\n this.classList.add(CLASS_NAME);\n this.managers = rootScope.managers;\n }\n\n public get reactionCount() {\n return this._reactionCount;\n }\n\n public set reactionCount(reactionCount: ReactionCount) {\n this._reactionCount = reactionCount;\n }\n\n public get count() {\n return this.reactionCount.count;\n }\n\n public init(type: ReactionLayoutType, middleware: Middleware) {\n this.type = type;\n this.classList.add(CLASS_NAME + '-' + type);\n this.middleware = middleware;\n }\n\n public setCanRenderAvatars(canRenderAvatars: boolean) {\n this.canRenderAvatars = canRenderAvatars;\n }\n\n public render(doNotRenderSticker?: boolean) {\n const hadStickerContainer = !!this.stickerContainer;\n if(!hadStickerContainer) {\n this.stickerContainer = document.createElement('div');\n this.stickerContainer.classList.add(CLASS_NAME + '-sticker');\n this.append(this.stickerContainer);\n }\n\n const reactionCount = this.reactionCount;\n if(!doNotRenderSticker && !hadStickerContainer) {\n const reaction = reactionCount.reaction;\n if(reaction._ === 'reactionEmoji') {\n const availableReaction = this.managers.appReactionsManager.getReaction(reaction.emoticon);\n callbackify(availableReaction, (availableReaction) => {\n if(!availableReaction.center_icon) {\n this.stickerContainer.classList.add('is-static');\n }\n\n if(availableReaction.pFlags.inactive) {\n this.classList.add('is-inactive');\n }\n\n this.renderDoc(availableReaction.center_icon ?? availableReaction.static_icon);\n });\n } else if(reaction._ === 'reactionCustomEmoji') {\n this.stickerContainer.classList.add('is-custom');\n const wrapped = wrapCustomEmoji({\n docIds: [reaction.document_id],\n customEmojiSize: makeMediaSize(REACTION_BLOCK_SIZE, REACTION_BLOCK_SIZE)\n });\n\n this.stickerContainer.append(wrapped);\n }\n }\n }\n\n private renderDoc(doc: Document.document) {\n const size = this.type === 'inline' ? REACTION_INLINE_SIZE : REACTION_BLOCK_SIZE;\n const wrapPromise = this.wrapStickerPromise = wrapSticker({\n div: this.stickerContainer,\n doc,\n width: size,\n height: size,\n static: true,\n managers: this.managers,\n middleware: this.middleware\n }).then(({render}) => render).finally(() => {\n if(this.wrapStickerPromise === wrapPromise) {\n this.wrapStickerPromise = undefined;\n }\n });\n }\n\n public renderCounter() {\n const reactionCount = this.reactionCount;\n const displayOn = this.type === 'inline' ? REACTION_DISPLAY_INLINE_COUNTER_AT : REACTION_DISPLAY_BLOCK_COUNTER_AT;\n if(reactionCount.count >= displayOn || (this.type === 'block' && !this.canRenderAvatars)) {\n if(!this.counter) {\n this.counter = document.createElement(this.type === 'inline' ? 'i' : 'span');\n this.counter.classList.add(CLASS_NAME + '-counter');\n }\n\n const formatted = formatNumber(reactionCount.count);\n if(this.counter.textContent !== formatted) {\n this.counter.textContent = formatted;\n }\n\n if(!this.counter.parentElement) {\n this.append(this.counter);\n }\n } else if(this.counter?.parentElement) {\n this.counter.remove();\n this.counter = undefined;\n }\n }\n\n public renderAvatars(recentReactions: MessagePeerReaction[]) {\n if(this.type === 'inline') {\n return;\n }\n\n if(this.reactionCount.count >= REACTION_DISPLAY_BLOCK_COUNTER_AT || !this.canRenderAvatars) {\n if(this.stackedAvatars) {\n this.stackedAvatars.container.remove();\n this.stackedAvatars = undefined;\n }\n\n return;\n }\n\n if(!this.stackedAvatars) {\n this.stackedAvatars = new StackedAvatars({\n avatarSize: 24\n });\n\n this.append(this.stackedAvatars.container);\n }\n\n this.stackedAvatars.render(recentReactions.map((reaction) => getPeerId(reaction.peer_id)));\n }\n\n public setIsChosen(isChosen = this.reactionCount.chosen_order !== undefined) {\n if(this.type === 'inline') return;\n const wasChosen = this.classList.contains('is-chosen') && !this.classList.contains('backwards');\n if(wasChosen !== isChosen) {\n SetTransition({\n element: this,\n className: 'is-chosen',\n forwards: isChosen,\n duration: this.isConnected ? 300 : 0\n });\n }\n }\n\n public fireAroundAnimation() {\n if(!liteMode.isAvailable('effects_reactions')) {\n return;\n }\n\n const reaction = this.reactionCount.reaction;\n if(reaction._ !== 'reactionEmoji') return;\n callbackify(this.managers.appReactionsManager.getReaction(reaction.emoticon), (availableReaction) => {\n const size = this.type === 'inline' ? REACTION_INLINE_SIZE + 14 : REACTION_BLOCK_SIZE + 18;\n const div = document.createElement('div');\n div.classList.add(CLASS_NAME + '-sticker-activate');\n\n Promise.all([\n wrapSticker({\n div: div,\n doc: availableReaction.center_icon,\n width: size,\n height: size,\n withThumb: false,\n needUpscale: true,\n play: false,\n skipRatio: 1,\n group: 'none',\n needFadeIn: false,\n managers: this.managers,\n middleware: this.middleware\n }).then(({render}) => render as Promise),\n\n wrapStickerAnimation({\n doc: availableReaction.around_animation,\n size: 80,\n target: this.stickerContainer,\n side: 'center',\n skipRatio: 1,\n play: false,\n managers: this.managers,\n middleware: this.middleware\n }).stickerPromise.catch(noop)\n ]).then(([iconPlayer, aroundPlayer]) => {\n const remove = () => {\n // if(!isInDOM(div)) return;\n iconPlayer.remove();\n div.remove();\n this.stickerContainer.classList.remove('has-animation');\n };\n\n if(!aroundPlayer) {\n remove();\n return;\n }\n\n const removeOnFrame = () => {\n // if(!isInDOM(div)) return;\n fastRaf(remove);\n };\n\n iconPlayer.addEventListener('enterFrame', (frameNo) => {\n if(frameNo === iconPlayer.maxFrame) {\n if(this.wrapStickerPromise) { // wait for fade in animation\n this.wrapStickerPromise.then(() => {\n setTimeout(removeOnFrame, 1e3);\n });\n } else {\n removeOnFrame();\n }\n }\n });\n\n iconPlayer.addEventListener('firstFrame', () => {\n this.stickerContainer.append(div);\n this.stickerContainer.classList.add('has-animation');\n iconPlayer.play();\n aroundPlayer.play();\n }, {once: true});\n });\n });\n }\n}\n\ncustomElements.define(TAG_NAME, ReactionElement);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport positionElementByIndex from '../../helpers/dom/positionElementByIndex';\nimport {Middleware, MiddlewareHelper} from '../../helpers/middleware';\nimport {Message, ReactionCount} from '../../layer';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport reactionsEqual from '../../lib/appManagers/utils/reactions/reactionsEqual';\nimport rootScope from '../../lib/rootScope';\nimport ReactionElement, {ReactionLayoutType, REACTION_DISPLAY_BLOCK_COUNTER_AT} from './reaction';\n\nconst CLASS_NAME = 'reactions';\nconst TAG_NAME = CLASS_NAME + '-element';\n\nconst REACTIONS_ELEMENTS: Map> = new Map();\nexport {REACTIONS_ELEMENTS};\n\nexport default class ReactionsElement extends HTMLElement {\n private message: Message.message;\n private key: string;\n private isPlaceholder: boolean;\n private type: ReactionLayoutType;\n private sorted: ReactionElement[];\n private onConnectCallback: () => void;\n private managers: AppManagers;\n private middleware: Middleware;\n private middlewareHelpers: Map;\n\n constructor() {\n super();\n this.classList.add(CLASS_NAME);\n this.sorted = [];\n this.middlewareHelpers = new Map();\n this.managers = rootScope.managers;\n }\n\n connectedCallback() {\n let set = REACTIONS_ELEMENTS.get(this.key);\n if(!set) {\n REACTIONS_ELEMENTS.set(this.key, set = new Set());\n }\n\n set.add(this);\n\n if(this.onConnectCallback && this.isConnected) {\n this.onConnectCallback();\n this.onConnectCallback = undefined;\n }\n }\n\n disconnectedCallback() {\n const set = REACTIONS_ELEMENTS.get(this.key);\n set.delete(this);\n if(!set.size) {\n REACTIONS_ELEMENTS.delete(this.key);\n }\n }\n\n public getReactionCount(reactionElement: ReactionElement) {\n return this.sorted[this.sorted.indexOf(reactionElement)].reactionCount;\n }\n\n public getMessage() {\n return this.message;\n }\n\n public init(\n message: Message.message,\n type: ReactionLayoutType,\n middleware: Middleware,\n isPlaceholder = this.isPlaceholder\n ) {\n if(this.key !== undefined) {\n this.disconnectedCallback();\n }\n\n if(this.middleware !== middleware) {\n middleware.onDestroy(() => {\n this.middlewareHelpers.clear();\n });\n }\n\n this.message = message;\n this.key = this.message.peerId + '_' + this.message.mid;\n this.middleware = middleware;\n this.isPlaceholder = isPlaceholder;\n\n if(this.type !== type) {\n this.type = type;\n this.classList.add(CLASS_NAME + '-' + type);\n }\n\n this.connectedCallback();\n }\n\n public changeMessage(message: Message.message) {\n return this.init(message, this.type, this.middleware);\n }\n\n public update(message: Message.message, changedResults?: ReactionCount[]) {\n this.message = message;\n this.render(changedResults);\n }\n\n public render(changedResults?: ReactionCount[]) {\n const reactions = this.message.reactions;\n const hasReactions = !!(reactions && reactions.results.length);\n this.classList.toggle('has-no-reactions', !hasReactions);\n if(!hasReactions && !this.sorted.length) return;\n\n const availableReactionsResult = this.managers.appReactionsManager.getAvailableReactions();\n // callbackify(availableReactionsResult, () => {\n const counts = hasReactions ? (\n reactions.results\n // availableReactionsResult instanceof Promise ?\n // reactions.results :\n // reactions.results.filter((reactionCount) => {\n // return this.managers.appReactionsManager.isReactionActive(reactionCount.reaction);\n // })\n ) : [];\n\n // if(this.message.peerId.isUser()) {\n // counts.sort((a, b) => (b.count - a.count) || ((b.chosen_order ?? 0) - (a.chosen_order ?? 0)));\n // } else {\n counts.sort((a, b) => (b.count - a.count) || ((a.chosen_order ?? 0) - (b.chosen_order ?? 0)));\n // }\n\n forEachReverse(this.sorted, (reactionElement, idx, arr) => {\n const reaction = reactionElement.reactionCount.reaction;\n const found = counts.some((reactionCount) => reactionsEqual(reactionCount.reaction, reaction));\n if(!found) {\n const middlewareHelper = this.middlewareHelpers.get(reactionElement);\n middlewareHelper.destroy();\n this.middlewareHelpers.delete(reactionElement);\n arr.splice(idx, 1);\n reactionElement.remove();\n }\n });\n\n const totalReactions = counts.reduce((acc, c) => acc + c.count, 0);\n const canRenderAvatars = reactions && (!!reactions.pFlags.can_see_list || this.message.peerId.isUser()) && totalReactions < REACTION_DISPLAY_BLOCK_COUNTER_AT;\n this.sorted = counts.map((reactionCount, idx) => {\n let reactionElement: ReactionElement = this.sorted.find((reactionElement) => reactionsEqual(reactionElement.reactionCount.reaction, reactionCount.reaction));\n if(!reactionElement) {\n const middlewareHelper = this.middleware.create();\n reactionElement = new ReactionElement();\n reactionElement.init(this.type, middlewareHelper.get());\n this.middlewareHelpers.set(reactionElement, middlewareHelper);\n }\n\n positionElementByIndex(reactionElement, this, idx);\n\n const recentReactions = reactions.recent_reactions ? reactions.recent_reactions.filter((reaction) => reactionsEqual(reaction.reaction, reactionCount.reaction)) : [];\n reactionElement.reactionCount = {...reactionCount};\n reactionElement.setCanRenderAvatars(canRenderAvatars);\n reactionElement.render(this.isPlaceholder);\n reactionElement.renderCounter();\n reactionElement.renderAvatars(recentReactions);\n reactionElement.setIsChosen();\n\n return reactionElement;\n });\n\n // this.sorted.forEach((reactionElement, idx) => {\n // /* if(this.type === 'block' && this.childElementCount !== this.sorted.length) { // because of appended time\n // idx += 1;\n // } */\n\n // positionElementByIndex(reactionElement, this, idx);\n // });\n\n if(!this.isPlaceholder && changedResults?.length) {\n if(this.isConnected) {\n this.handleChangedResults(changedResults);\n } else {\n this.onConnectCallback = () => {\n this.handleChangedResults(changedResults);\n };\n }\n }\n // });\n\n // ! тут вообще не должно быть этого кода, но пока он побудет тут\n if(!this.sorted.length && this.type === 'block') {\n const parentElement = this.parentElement;\n this.remove();\n\n if(parentElement.classList.contains('document-message') && !parentElement.childNodes.length) {\n parentElement.remove();\n return;\n }\n\n const timeSpan = this.querySelector('.time');\n if(timeSpan) {\n parentElement.append(timeSpan);\n }\n }\n }\n\n private handleChangedResults(changedResults: ReactionCount[]) {\n // ! temp\n if(this.message.peerId !== appImManager.chat.peerId) return;\n\n changedResults.forEach((reactionCount) => {\n const reactionElement = this.sorted.find((reactionElement) => reactionsEqual(reactionElement.reactionCount.reaction, reactionCount.reaction));\n reactionElement?.fireAroundAnimation();\n });\n }\n}\n\ncustomElements.define(TAG_NAME, ReactionsElement);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport {Middleware} from '../../helpers/middleware';\nimport limitSymbols from '../../helpers/string/limitSymbols';\nimport {Document, Message, MessageMedia, Photo, WebPage, VideoSize} from '../../layer';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport choosePhotoSize from '../../lib/appManagers/utils/photos/choosePhotoSize';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport DivAndCaption from '../divAndCaption';\nimport wrapMessageForReply from '../wrappers/messageForReply';\nimport wrapPhoto from '../wrappers/photo';\nimport wrapSticker from '../wrappers/sticker';\nimport wrapVideo from '../wrappers/video';\nimport {AnimationItemGroup} from '../animationIntersector';\n\nconst MEDIA_SIZE = 32;\n\nexport async function wrapReplyDivAndCaption(options: {\n title: string | HTMLElement | DocumentFragment,\n titleEl: HTMLElement,\n subtitle: string | HTMLElement | DocumentFragment,\n subtitleEl: HTMLElement,\n message: Message.message | Message.messageService,\n mediaEl: HTMLElement,\n loadPromises?: Promise[],\n animationGroup: AnimationItemGroup\n}) {\n let {title, titleEl, subtitle, subtitleEl, mediaEl, message, loadPromises, animationGroup} = options;\n if(title !== undefined) {\n if(typeof(title) === 'string') {\n title = limitSymbols(title, 140);\n title = wrapEmojiText(title);\n }\n\n replaceContent(titleEl, title);\n }\n\n if(!loadPromises) {\n loadPromises = [];\n }\n\n let messageMedia: MessageMedia | WebPage.webPage = (message as Message.message)?.media;\n let setMedia = false, isRound = false;\n const mediaChildren = mediaEl ? Array.from(mediaEl.children).slice() : [];\n let middleware: Middleware;\n if(messageMedia && mediaEl) {\n subtitleEl.textContent = '';\n subtitleEl.append(await wrapMessageForReply({message, animationGroup, withoutMediaType: true}));\n\n messageMedia = (messageMedia as MessageMedia.messageMediaWebPage).webpage as WebPage.webPage || messageMedia;\n const photo = (messageMedia as MessageMedia.messageMediaPhoto).photo as Photo.photo;\n const document = (messageMedia as MessageMedia.messageMediaDocument).document as Document.document;\n if(photo || (document && document.thumbs?.length)/* ['video', 'sticker', 'gif', 'round', 'photo', 'audio'].indexOf(document.type) !== -1) */) {\n middleware = appImManager.chat.bubbles.getMiddleware();\n const lazyLoadQueue = appImManager.chat.bubbles.lazyLoadQueue;\n\n if(document?.type === 'sticker') {\n await wrapSticker({\n doc: document,\n div: mediaEl,\n lazyLoadQueue,\n group: animationGroup,\n // onlyThumb: document.sticker === 2,\n width: MEDIA_SIZE,\n height: MEDIA_SIZE,\n middleware,\n loadPromises\n });\n setMedia = true;\n } else if(document?.type === 'gif' && document.video_thumbs) {\n setMedia = true;\n await wrapVideo({\n doc: document,\n container: mediaEl,\n boxWidth: MEDIA_SIZE,\n boxHeight: MEDIA_SIZE,\n lazyLoadQueue,\n noPlayButton: true,\n noInfo: true,\n middleware,\n loadPromises,\n withoutPreloader: true,\n videoSize: document.video_thumbs[0] as Extract,\n group: animationGroup\n });\n } else {\n const m = photo || document;\n isRound = document?.type === 'round';\n\n try {\n await wrapPhoto({\n photo: m,\n container: mediaEl,\n boxWidth: MEDIA_SIZE,\n boxHeight: MEDIA_SIZE,\n size: choosePhotoSize(m, MEDIA_SIZE, MEDIA_SIZE),\n middleware,\n lazyLoadQueue,\n noBlur: true,\n withoutPreloader: true,\n loadPromises\n });\n setMedia = true;\n } catch(err) {\n\n }\n }\n }\n } else {\n if(message) {\n subtitleEl.textContent = '';\n subtitleEl.append(await wrapMessageForReply({message}));\n } else {\n if(typeof(subtitle) === 'string') {\n subtitle = limitSymbols(subtitle, 140);\n subtitle = wrapEmojiText(subtitle);\n }\n\n replaceContent(subtitleEl, subtitle || '');\n }\n }\n\n Promise.all(loadPromises).then(() => {\n if(middleware && !middleware()) return;\n mediaChildren.forEach((child) => child.remove());\n\n if(mediaEl) {\n mediaEl.classList.toggle('is-round', isRound);\n }\n });\n\n return setMedia;\n}\n\nexport default class ReplyContainer extends DivAndCaption<(title: string | HTMLElement | DocumentFragment, subtitle: string | HTMLElement | DocumentFragment, message?: any) => Promise> {\n private mediaEl: HTMLElement;\n\n constructor(protected className: string, protected animationGroup: AnimationItemGroup) {\n super(className, async(title, subtitle = '', message?) => {\n if(!this.mediaEl) {\n this.mediaEl = document.createElement('div');\n this.mediaEl.classList.add(this.className + '-media');\n }\n\n const isMediaSet = await wrapReplyDivAndCaption({\n title,\n titleEl: this.title,\n subtitle,\n subtitleEl: this.subtitle,\n mediaEl: this.mediaEl,\n message,\n animationGroup\n });\n\n this.container.classList.toggle('is-media', isMediaSet);\n if(isMediaSet) {\n this.content.prepend(this.mediaEl);\n } else {\n this.mediaEl.remove();\n }\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AppMessagesManager, MessagesStorageKey} from '../../lib/appManagers/appMessagesManager';\nimport type ChatBubbles from './bubbles';\nimport type ChatInput from './input';\nimport type Chat from './chat';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport Button from '../button';\nimport ButtonIcon from '../buttonIcon';\nimport CheckboxField from '../checkboxField';\nimport PopupDeleteMessages from '../popups/deleteMessages';\nimport PopupForward from '../popups/forward';\nimport SetTransition from '../singleTransition';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport PopupSendNow from '../popups/sendNow';\nimport appNavigationController, {NavigationItem} from '../appNavigationController';\nimport {IS_MOBILE_SAFARI} from '../../environment/userAgent';\nimport I18n, {i18n, _i18n} from '../../lib/langPack';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport blurActiveElement from '../../helpers/dom/blurActiveElement';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport cancelSelection from '../../helpers/dom/cancelSelection';\nimport getSelectedText from '../../helpers/dom/getSelectedText';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport AppSearchSuper from '../appSearchSuper.';\nimport isInDOM from '../../helpers/dom/isInDOM';\nimport {randomLong} from '../../helpers/random';\nimport {attachClickEvent, AttachClickOptions} from '../../helpers/dom/clickEvent';\nimport findUpAsChild from '../../helpers/dom/findUpAsChild';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport {attachContextMenuListener} from '../../helpers/dom/attachContextMenuListener';\nimport filterUnique from '../../helpers/array/filterUnique';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {Message} from '../../layer';\n\nconst accumulateMapSet = (map: Map>) => {\n return [...map.values()].reduce((acc, v) => acc + v.size, 0);\n};\n\n// const MIN_CLICK_MOVE = 32; // minimum bubble height\n\nclass AppSelection extends EventListenerBase<{\n toggle: (isSelecting: boolean) => void\n}> {\n public selectedMids: Map> = new Map();\n public isSelecting = false;\n\n public selectedText: string;\n\n protected listenerSetter: ListenerSetter;\n protected isScheduled: boolean;\n protected listenElement: HTMLElement;\n\n protected onToggleSelection: (forwards: boolean, animate: boolean) => void | Promise;\n protected onUpdateContainer: (cantForward: boolean, cantDelete: boolean, cantSend: boolean) => void;\n protected onCancelSelection: () => void;\n protected toggleByMid: (peerId: PeerId, mid: number) => void;\n protected toggleByElement: (bubble: HTMLElement) => void;\n\n protected navigationType: NavigationItem['type'];\n\n protected getElementFromTarget: (target: HTMLElement) => HTMLElement;\n protected verifyTarget: (e: MouseEvent, target: HTMLElement) => boolean;\n protected verifyMouseMoveTarget: (e: MouseEvent, element: HTMLElement, selecting: boolean) => boolean;\n protected verifyTouchLongPress: () => boolean;\n protected targetLookupClassName: string;\n protected lookupBetweenParentClassName: string;\n protected lookupBetweenElementsQuery: string;\n\n protected doNotAnimate: boolean;\n protected managers: AppManagers;\n\n constructor(options: {\n managers: AppManagers,\n getElementFromTarget: AppSelection['getElementFromTarget'],\n verifyTarget?: AppSelection['verifyTarget'],\n verifyMouseMoveTarget?: AppSelection['verifyMouseMoveTarget'],\n verifyTouchLongPress?: AppSelection['verifyTouchLongPress'],\n targetLookupClassName: string,\n lookupBetweenParentClassName: string,\n lookupBetweenElementsQuery: string,\n isScheduled?: AppSelection['isScheduled']\n }) {\n super(false);\n\n safeAssign(this, options);\n\n this.navigationType = 'multiselect-' + randomLong() as any;\n }\n\n public attachListeners(listenElement: HTMLElement, listenerSetter: ListenerSetter) {\n if(this.listenElement) {\n this.listenerSetter.removeAll();\n }\n\n this.listenElement = listenElement;\n this.listenerSetter = listenerSetter;\n\n if(!listenElement) {\n return;\n }\n\n if(IS_TOUCH_SUPPORTED) {\n listenerSetter.add(listenElement)('touchend', () => {\n if(!this.isSelecting) return;\n this.selectedText = getSelectedText();\n });\n\n attachContextMenuListener({\n element: listenElement,\n callback: (e) => {\n if(this.isSelecting || (this.verifyTouchLongPress && !this.verifyTouchLongPress())) return;\n\n // * these two lines will fix instant text selection on iOS Safari\n document.body.classList.add('no-select'); // * need no-select on body because chat-input transforms in channels\n listenElement.addEventListener('touchend', (e) => {\n cancelEvent(e); // ! this one will fix propagation to document loader button, etc\n document.body.classList.remove('no-select');\n\n // this.chat.bubbles.onBubblesClick(e);\n }, {once: true, capture: true});\n\n cancelSelection();\n // cancelEvent(e as any);\n const element = this.getElementFromTarget(e.target as HTMLElement);\n if(element) {\n this.toggleByElement(element);\n }\n },\n listenerSetter\n });\n\n return;\n }\n\n listenerSetter.add(listenElement)('mousedown', this.onMouseDown);\n }\n\n private onMouseDown = (e: MouseEvent) => {\n // console.log('selection mousedown', e);\n const element = findUpClassName(e.target, this.targetLookupClassName);\n if(e.button !== 0) {\n return;\n }\n\n if(this.verifyTarget && !this.verifyTarget(e, element)) {\n return;\n }\n\n const seen: AppSelection['selectedMids'] = new Map();\n let selecting: boolean;\n\n /* let good = false;\n const {x, y} = e; */\n\n /* const bubbles = appImManager.bubbles;\n for(const mid in bubbles) {\n const bubble = bubbles[mid];\n bubble.addEventListener('mouseover', () => {\n console.log('mouseover');\n }, {once: true});\n } */\n\n let firstTarget = element;\n\n const processElement = (element: HTMLElement, checkBetween = true) => {\n const mid = +element.dataset.mid;\n if(!mid || !element.dataset.peerId) return;\n const peerId = element.dataset.peerId.toPeerId();\n\n if(!isInDOM(firstTarget)) {\n firstTarget = element;\n }\n\n let seenSet = seen.get(peerId);\n if(!seenSet) {\n seen.set(peerId, seenSet = new Set());\n }\n\n if(seenSet.has(mid)) {\n return;\n }\n\n const isSelected = this.isMidSelected(peerId, mid);\n if(selecting === undefined) {\n // bubblesContainer.classList.add('no-select');\n selecting = !isSelected;\n }\n\n seenSet.add(mid);\n\n if((selecting && !isSelected) || (!selecting && isSelected)) {\n const seenLength = accumulateMapSet(seen);\n if(this.toggleByElement && checkBetween) {\n if(seenLength < 2) {\n if(findUpAsChild(element, firstTarget)) {\n firstTarget = element;\n }\n }\n\n const elementsBetween = this.getElementsBetween(firstTarget, element);\n // console.log(elementsBetween);\n if(elementsBetween.length) {\n elementsBetween.forEach((element) => {\n processElement(element, false);\n });\n }\n }\n\n if(!this.selectedMids.size) {\n if(seenLength === 2 && this.toggleByMid) {\n for(const [peerId, mids] of seen) {\n for(const mid of mids) {\n this.toggleByMid(peerId, mid);\n }\n }\n }\n } else if(this.toggleByElement) {\n this.toggleByElement(element);\n }\n }\n };\n\n // const foundTargets: Map = new Map();\n let canceledSelection = false;\n const onMouseMove = (e: MouseEvent) => {\n if(!canceledSelection) {\n cancelSelection();\n canceledSelection = true;\n }\n /* if(!good) {\n if(Math.abs(e.x - x) > MIN_CLICK_MOVE || Math.abs(e.y - y) > MIN_CLICK_MOVE) {\n good = true;\n } else {\n return;\n }\n } */\n\n /* if(foundTargets.has(e.target as HTMLElement)) return;\n foundTargets.set(e.target as HTMLElement, true); */\n const element = this.getElementFromTarget(e.target as HTMLElement);\n if(!element) {\n // console.error('found no bubble', e);\n return;\n }\n\n if(this.verifyMouseMoveTarget && !this.verifyMouseMoveTarget(e, element, selecting)) {\n this.listenerSetter.removeManual(this.listenElement, 'mousemove', onMouseMove);\n this.listenerSetter.removeManual(document, 'mouseup', onMouseUp, documentListenerOptions);\n return;\n }\n\n processElement(element);\n };\n\n const onMouseUp = (e: MouseEvent) => {\n if(seen.size) {\n attachClickEvent(window, cancelEvent, {capture: true, once: true, passive: false});\n }\n\n this.listenerSetter.removeManual(this.listenElement, 'mousemove', onMouseMove);\n // bubblesContainer.classList.remove('no-select');\n\n // ! CANCEL USER SELECTION !\n cancelSelection();\n };\n\n const documentListenerOptions = {once: true};\n this.listenerSetter.add(this.listenElement)('mousemove', onMouseMove);\n this.listenerSetter.add(document)('mouseup', onMouseUp, documentListenerOptions);\n };\n\n private getElementsBetween = (first: HTMLElement, last: HTMLElement) => {\n if(first === last) {\n return [];\n }\n\n const firstRect = first.getBoundingClientRect();\n const lastRect = last.getBoundingClientRect();\n const difference = (firstRect.top - lastRect.top) || (firstRect.left - lastRect.left);\n const isHigher = difference < 0;\n\n const parent = findUpClassName(first, this.lookupBetweenParentClassName);\n if(!parent) {\n return [];\n }\n\n const elements = Array.from(parent.querySelectorAll(this.lookupBetweenElementsQuery)) as HTMLElement[];\n let firstIndex = elements.indexOf(first);\n let lastIndex = elements.indexOf(last);\n\n if(!isHigher) {\n [lastIndex, firstIndex] = [firstIndex, lastIndex];\n }\n\n const slice = elements.slice(firstIndex + 1, lastIndex);\n\n // console.log('getElementsBetween', first, last, slice, firstIndex, lastIndex, isHigher);\n\n return slice;\n };\n\n protected isElementShouldBeSelected(element: HTMLElement) {\n return this.isMidSelected(element.dataset.peerId.toPeerId(), +element.dataset.mid);\n }\n\n protected appendCheckbox(element: HTMLElement, checkboxField: CheckboxField) {\n element.prepend(checkboxField.label);\n }\n\n public toggleElementCheckbox(element: HTMLElement, show: boolean) {\n const hasCheckbox = !!this.getCheckboxInputFromElement(element);\n if(show) {\n if(hasCheckbox) {\n return false;\n }\n\n const checkboxField = new CheckboxField({\n name: element.dataset.mid,\n round: true\n });\n\n // * if it is a render of new message\n if(this.isSelecting) { // ! avoid breaking animation on start\n if(this.isElementShouldBeSelected(element)) {\n checkboxField.input.checked = true;\n element.classList.add('is-selected');\n }\n }\n\n this.appendCheckbox(element, checkboxField);\n } else if(hasCheckbox) {\n this.getCheckboxInputFromElement(element).parentElement.remove();\n SetTransition({\n element,\n className: 'is-selected',\n forwards: false,\n duration: 200\n });\n }\n\n return true;\n }\n\n protected getCheckboxInputFromElement(element: HTMLElement): HTMLInputElement {\n return element.firstElementChild?.tagName === 'LABEL' &&\n element.firstElementChild.firstElementChild as HTMLInputElement;\n }\n\n protected async updateContainer(forceSelection = false) {\n const size = this.selectedMids.size;\n if(!size && !forceSelection) return;\n\n let cantForward = !size,\n cantDelete = !size;\n const cantSend = !size;\n for(const [peerId, mids] of this.selectedMids) {\n const storageKey = this.getStorageKey(peerId);\n const r = await this.managers.appMessagesManager.cantForwardDeleteMids(storageKey, Array.from(mids));\n cantForward = r.cantForward;\n cantDelete = r.cantDelete;\n\n if(cantForward && cantDelete) break;\n }\n\n this.onUpdateContainer?.(cantForward, cantDelete, cantSend);\n }\n\n private getStorageKey(peerId: PeerId): MessagesStorageKey {\n return `${peerId}_${this.isScheduled ? 'scheduled' : 'history'}`;\n }\n\n public getSelectedMessages() {\n const selectedMessagesPromises: Promise[] = [];\n this.selectedMids.forEach((mids, peerId) => {\n const storageKey = this.getStorageKey(peerId);\n const p = Array.from(mids).map((mid) => this.managers.appMessagesManager.getMessageFromStorage(storageKey, mid));\n selectedMessagesPromises.push(...p);\n });\n return Promise.all(selectedMessagesPromises);\n }\n\n public toggleSelection(toggleCheckboxes = true, forceSelection = false) {\n const wasSelecting = this.isSelecting;\n const size = this.selectedMids.size;\n this.isSelecting = !!size || forceSelection;\n\n if(wasSelecting === this.isSelecting) return false;\n\n this.dispatchEvent('toggle', this.isSelecting);\n\n // const bubblesContainer = this.bubbles.bubblesContainer;\n // bubblesContainer.classList.toggle('is-selecting', !!size);\n\n /* if(bubblesContainer.classList.contains('is-chat-input-hidden')) {\n const scrollable = this.appImManager.scrollable;\n if(scrollable.isScrolledDown) {\n scrollable.scrollTo(scrollable.scrollHeight, 'top', true, true, 200);\n }\n } */\n\n if(!IS_TOUCH_SUPPORTED) {\n this.listenElement.classList.toggle('no-select', this.isSelecting);\n\n if(wasSelecting) {\n // ! CANCEL USER SELECTION !\n cancelSelection();\n }\n }/* else {\n if(!wasSelecting) {\n bubblesContainer.classList.add('no-select');\n setTimeout(() => {\n cancelSelection();\n bubblesContainer.classList.remove('no-select');\n cancelSelection();\n }, 100);\n }\n } */\n\n blurActiveElement();\n\n const forwards = !!size || forceSelection;\n const toggleResult = this.onToggleSelection?.(forwards, !this.doNotAnimate);\n\n if(!IS_MOBILE_SAFARI) {\n if(forwards) {\n appNavigationController.pushItem({\n type: this.navigationType,\n onPop: () => {\n this.cancelSelection();\n }\n });\n } else {\n appNavigationController.removeByType(this.navigationType);\n }\n }\n\n if(forceSelection) {\n (toggleResult || Promise.resolve()).then(() => this.updateContainer(forceSelection));\n }\n\n return true;\n }\n\n public cancelSelection = async(doNotAnimate?: boolean) => {\n if(doNotAnimate) this.doNotAnimate = true;\n this.onCancelSelection && await this.onCancelSelection();\n this.selectedMids.clear();\n this.toggleSelection();\n cancelSelection();\n if(doNotAnimate) this.doNotAnimate = undefined;\n };\n\n public cleanup() {\n this.doNotAnimate = true;\n this.selectedMids.clear();\n this.toggleSelection(false);\n this.doNotAnimate = undefined;\n }\n\n protected updateElementSelection(element: HTMLElement, isSelected: boolean) {\n this.toggleElementCheckbox(element, true);\n const input = this.getCheckboxInputFromElement(element);\n input.checked = isSelected;\n\n this.toggleSelection();\n this.updateContainer();\n SetTransition({\n element,\n className: 'is-selected',\n forwards: isSelected,\n duration: 200\n });\n }\n\n public isMidSelected(peerId: PeerId, mid: number) {\n const set = this.selectedMids.get(peerId);\n return !!set?.has(mid);\n }\n\n public length() {\n return accumulateMapSet(this.selectedMids);\n }\n\n protected toggleMid(peerId: PeerId, mid: number, unselect?: boolean) {\n let set = this.selectedMids.get(peerId);\n if(unselect || (unselect === undefined && set?.has(mid))) {\n if(set) {\n set.delete(mid);\n\n if(!set.size) {\n this.selectedMids.delete(peerId);\n }\n }\n } else {\n // const diff = rootScope.config.forwarded_count_max - this.length() - 1;\n // if(diff < 0) {\n // toast(I18n.format('Chat.Selection.LimitToast', true));\n // return false;\n // /* const it = this.selectedMids.values();\n // do {\n // const mid = it.next().value;\n // const mounted = this.appImManager.getMountedBubble(mid);\n // if(mounted) {\n // this.toggleByBubble(mounted.bubble);\n // } else {\n // const mids = this.appMessagesManager.getMidsByMid(mid);\n // for(const mid of mids) {\n // this.selectedMids.delete(mid);\n // }\n // }\n // } while(this.selectedMids.size > MAX_SELECTION_LENGTH); */\n // }\n\n if(!set) {\n set = new Set();\n this.selectedMids.set(peerId, set);\n }\n\n set.add(mid);\n }\n\n return true;\n }\n\n /**\n * ! Call this method only to handle deleted messages\n */\n public deleteSelectedMids(peerId: PeerId, mids: number[]) {\n const set = this.selectedMids.get(peerId);\n if(!set) {\n return;\n }\n\n mids.forEach((mid) => {\n set.delete(mid);\n });\n\n if(!set.size) {\n this.selectedMids.delete(peerId);\n }\n\n this.updateContainer();\n this.toggleSelection();\n }\n}\n\nexport class SearchSelection extends AppSelection {\n protected selectionContainer: HTMLElement;\n protected selectionCountEl: HTMLElement;\n public selectionForwardBtn: HTMLElement;\n public selectionDeleteBtn: HTMLElement;\n public selectionGotoBtn: HTMLElement;\n\n private isPrivate: boolean;\n\n constructor(private searchSuper: AppSearchSuper, managers: AppManagers, listenerSetter: ListenerSetter) {\n super({\n managers,\n verifyTarget: (e, target) => !!target && this.isSelecting,\n getElementFromTarget: (target) => findUpClassName(target, 'search-super-item'),\n targetLookupClassName: 'search-super-item',\n lookupBetweenParentClassName: 'tabs-tab',\n lookupBetweenElementsQuery: '.search-super-item'\n });\n\n this.isPrivate = !searchSuper.showSender;\n this.attachListeners(searchSuper.container, listenerSetter);\n }\n\n /* public appendCheckbox(element: HTMLElement, checkboxField: CheckboxField) {\n checkboxField.label.classList.add('bubble-select-checkbox');\n\n if(element.classList.contains('document') || element.tagName === 'AUDIO-ELEMENT') {\n element.querySelector('.document, audio-element').append(checkboxField.label);\n } else {\n super.appendCheckbox(bubble, checkboxField);\n }\n } */\n\n public toggleSelection(toggleCheckboxes = true, forceSelection = false) {\n const ret = super.toggleSelection(toggleCheckboxes, forceSelection);\n\n if(ret && toggleCheckboxes) {\n const elements = Array.from(this.searchSuper.tabsContainer.querySelectorAll('.search-super-item')) as HTMLElement[];\n elements.forEach((element) => {\n this.toggleElementCheckbox(element, this.isSelecting);\n });\n }\n\n return ret;\n }\n\n public toggleByElement = (element: HTMLElement) => {\n const mid = +element.dataset.mid;\n const peerId = element.dataset.peerId.toPeerId();\n\n if(!this.toggleMid(peerId, mid)) {\n return;\n }\n\n this.updateElementSelection(element, this.isMidSelected(peerId, mid));\n };\n\n public toggleByMid = (peerId: PeerId, mid: number) => {\n const element = this.searchSuper.mediaTab.contentTab.querySelector(`.search-super-item[data-peer-id=\"${peerId}\"][data-mid=\"${mid}\"]`) as HTMLElement;\n this.toggleByElement(element);\n };\n\n protected onUpdateContainer = (cantForward: boolean, cantDelete: boolean, cantSend: boolean) => {\n const length = this.length();\n replaceContent(this.selectionCountEl, i18n('messages', [length]));\n this.selectionGotoBtn.classList.toggle('hide', length !== 1);\n this.selectionForwardBtn.classList.toggle('hide', cantForward);\n this.selectionDeleteBtn && this.selectionDeleteBtn.classList.toggle('hide', cantDelete);\n };\n\n protected onToggleSelection = (forwards: boolean, animate: boolean) => {\n SetTransition({\n element: this.searchSuper.navScrollableContainer,\n className: 'is-selecting',\n forwards,\n duration: animate ? 200 : 0,\n onTransitionEnd: () => {\n if(!this.isSelecting) {\n this.selectionContainer.remove();\n this.selectionContainer =\n this.selectionForwardBtn =\n this.selectionDeleteBtn =\n null;\n this.selectedText = undefined;\n }\n }\n });\n\n SetTransition({\n element: this.searchSuper.container,\n className: 'is-selecting',\n forwards,\n duration: 200\n });\n\n if(this.isSelecting) {\n if(!this.selectionContainer) {\n const BASE_CLASS = 'search-super-selection';\n this.selectionContainer = document.createElement('div');\n this.selectionContainer.classList.add(BASE_CLASS + '-container');\n\n const btnCancel = ButtonIcon(`close ${BASE_CLASS}-cancel`, {noRipple: true});\n attachClickEvent(btnCancel, () => this.cancelSelection(), {listenerSetter: this.listenerSetter, once: true});\n\n this.selectionCountEl = document.createElement('div');\n this.selectionCountEl.classList.add(BASE_CLASS + '-count');\n\n this.selectionGotoBtn = ButtonIcon(`message ${BASE_CLASS}-goto`);\n\n const attachClickOptions: AttachClickOptions = {listenerSetter: this.listenerSetter};\n attachClickEvent(this.selectionGotoBtn, () => {\n const peerId = [...this.selectedMids.keys()][0];\n const mid = [...this.selectedMids.get(peerId)][0];\n this.cancelSelection();\n\n appImManager.setInnerPeer({peerId, lastMsgId: mid});\n }, attachClickOptions);\n\n this.selectionForwardBtn = ButtonIcon(`forward ${BASE_CLASS}-forward`);\n attachClickEvent(this.selectionForwardBtn, () => {\n const obj: {[fromPeerId: PeerId]: number[]} = {};\n for(const [fromPeerId, mids] of this.selectedMids) {\n obj[fromPeerId] = Array.from(mids).sort((a, b) => a - b);\n }\n\n new PopupForward(obj, () => {\n this.cancelSelection();\n });\n }, attachClickOptions);\n\n if(this.isPrivate) {\n this.selectionDeleteBtn = ButtonIcon(`delete danger ${BASE_CLASS}-delete`);\n attachClickEvent(this.selectionDeleteBtn, () => {\n const peerId = [...this.selectedMids.keys()][0];\n new PopupDeleteMessages(peerId, [...this.selectedMids.get(peerId)], 'chat', () => {\n this.cancelSelection();\n });\n }, attachClickOptions);\n }\n\n this.selectionContainer.append(...[\n btnCancel,\n this.selectionCountEl,\n this.selectionGotoBtn,\n this.selectionForwardBtn,\n this.selectionDeleteBtn\n ].filter(Boolean));\n\n const transitionElement = this.selectionContainer;\n transitionElement.style.opacity = '0';\n this.searchSuper.navScrollableContainer.append(transitionElement);\n\n void transitionElement.offsetLeft; // reflow\n transitionElement.style.opacity = '';\n }\n }\n };\n}\n\nexport default class ChatSelection extends AppSelection {\n protected selectionInputWrapper: HTMLElement;\n protected selectionContainer: HTMLElement;\n protected selectionCountEl: HTMLElement;\n public selectionSendNowBtn: HTMLElement;\n public selectionForwardBtn: HTMLElement;\n public selectionDeleteBtn: HTMLElement;\n private selectionLeft: HTMLDivElement;\n private selectionRight: HTMLDivElement;\n\n constructor(\n private chat: Chat,\n private bubbles: ChatBubbles,\n private input: ChatInput,\n managers: AppManagers\n ) {\n super({\n managers,\n getElementFromTarget: (target) => findUpClassName(target, 'grouped-item') || findUpClassName(target, 'bubble'),\n verifyTarget: (e, target) => {\n // LEFT BUTTON\n // проверка внизу нужна для того, чтобы не активировать селект если target потомок .bubble\n const bad = !this.selectedMids.size &&\n !(e.target as HTMLElement).classList.contains('bubble') &&\n !(e.target as HTMLElement).classList.contains('document-selection') &&\n target;\n\n return !bad;\n },\n verifyMouseMoveTarget: (e, element, selecting) => {\n const bad = e.target !== element &&\n !(e.target as HTMLElement).classList.contains('document-selection') &&\n selecting === undefined &&\n !this.selectedMids.size;\n return !bad;\n },\n verifyTouchLongPress: () => !this.chat.input.recording,\n targetLookupClassName: 'bubble',\n lookupBetweenParentClassName: 'bubbles-inner',\n lookupBetweenElementsQuery: '.bubble:not(.is-multiple-documents), .grouped-item',\n isScheduled: chat.type === 'scheduled'\n });\n }\n\n public appendCheckbox(bubble: HTMLElement, checkboxField: CheckboxField) {\n checkboxField.label.classList.add('bubble-select-checkbox');\n\n if(bubble.classList.contains('document-container')) {\n bubble.querySelector('.document, audio-element').append(checkboxField.label);\n } else {\n super.appendCheckbox(bubble, checkboxField);\n }\n }\n\n public toggleSelection(toggleCheckboxes = true, forceSelection = false) {\n const ret = super.toggleSelection(toggleCheckboxes, forceSelection);\n\n if(ret && toggleCheckboxes) {\n for(const mid in this.bubbles.bubbles) {\n if(this.bubbles.skippedMids.has(+mid)) {\n continue;\n }\n\n const bubble = this.bubbles.bubbles[mid];\n this.toggleElementCheckbox(bubble, this.isSelecting);\n }\n }\n\n return ret;\n }\n\n public toggleElementCheckbox(bubble: HTMLElement, show: boolean) {\n if(!this.canSelectBubble(bubble)) return;\n\n const ret = super.toggleElementCheckbox(bubble, show);\n if(ret) {\n const isGrouped = bubble.classList.contains('is-grouped');\n if(isGrouped) {\n this.bubbles.getBubbleGroupedItems(bubble).forEach((item) => this.toggleElementCheckbox(item, show));\n }\n }\n\n return ret;\n }\n\n public toggleByElement = (bubble: HTMLElement): Promise => {\n if(!this.canSelectBubble(bubble)) return;\n\n const mid = +bubble.dataset.mid;\n\n const isGrouped = bubble.classList.contains('is-grouped');\n if(isGrouped) {\n if(!this.isGroupedBubbleSelected(bubble)) {\n const set = this.selectedMids.get(this.chat.peerId);\n if(set) {\n // const mids = await this.chat.getMidsByMid(mid);\n const mids = this.getMidsFromGroupContainer(bubble);\n mids.forEach((mid) => set.delete(mid));\n }\n }\n\n /* const promises = */this.bubbles.getBubbleGroupedItems(bubble).map(this.toggleByElement);\n // await Promise.all(promises);\n return;\n }\n\n if(!this.toggleMid(this.chat.peerId, mid)) {\n return;\n }\n\n const isGroupedItem = bubble.classList.contains('grouped-item');\n if(isGroupedItem) {\n const groupContainer = findUpClassName(bubble, 'bubble');\n const isGroupedSelected = this.isGroupedBubbleSelected(groupContainer);\n const isGroupedMidsSelected = this.isGroupedMidsSelected(groupContainer);\n\n const willChange = isGroupedMidsSelected || isGroupedSelected;\n if(willChange) {\n this.updateElementSelection(groupContainer, isGroupedMidsSelected);\n }\n }\n\n this.updateElementSelection(bubble, this.isMidSelected(this.chat.peerId, mid));\n };\n\n protected toggleByMid = async(peerId: PeerId, mid: number) => {\n const mounted = await this.bubbles.getMountedBubble(mid);\n if(mounted) {\n this.toggleByElement(mounted.bubble);\n }\n };\n\n public isElementShouldBeSelected(element: HTMLElement) {\n const isGrouped = element.classList.contains('is-grouped');\n return super.isElementShouldBeSelected(element) && (!isGrouped || this.isGroupedMidsSelected(element));\n }\n\n protected isGroupedBubbleSelected(bubble: HTMLElement) {\n const groupedCheckboxInput = this.getCheckboxInputFromElement(bubble);\n return groupedCheckboxInput?.checked;\n }\n\n protected getMidsFromGroupContainer(groupContainer: HTMLElement) {\n const elements = this.chat.bubbles.getBubbleGroupedItems(groupContainer);\n if(!elements.length) {\n elements.push(groupContainer);\n }\n\n return elements.map((element) => +element.dataset.mid);\n }\n\n protected isGroupedMidsSelected(groupContainer: HTMLElement) {\n const mids = this.getMidsFromGroupContainer(groupContainer);\n const selectedMids = mids.filter((mid) => this.isMidSelected(this.chat.peerId, mid));\n return mids.length === selectedMids.length;\n }\n\n protected getCheckboxInputFromElement(bubble: HTMLElement) {\n /* let perf = performance.now();\n let checkbox = bubble.firstElementChild.tagName === 'LABEL' && bubble.firstElementChild.firstElementChild as HTMLInputElement;\n console.log('getCheckboxInputFromBubble firstElementChild time:', performance.now() - perf);\n\n perf = performance.now();\n checkbox = bubble.querySelector('label input');\n console.log('getCheckboxInputFromBubble querySelector time:', performance.now() - perf); */\n /* let perf = performance.now();\n let contains = bubble.classList.contains('document-container');\n console.log('getCheckboxInputFromBubble classList time:', performance.now() - perf);\n\n perf = performance.now();\n contains = bubble.className.includes('document-container');\n console.log('getCheckboxInputFromBubble className time:', performance.now() - perf); */\n\n return bubble.classList.contains('document-container') ?\n bubble.querySelector('label input') as HTMLInputElement :\n super.getCheckboxInputFromElement(bubble);\n }\n\n public canSelectBubble(bubble: HTMLElement) {\n return !bubble.classList.contains('service') &&\n !bubble.classList.contains('is-outgoing') &&\n !bubble.classList.contains('is-error') &&\n !bubble.classList.contains('bubble-first') &&\n !bubble.classList.contains('avoid-selection');\n }\n\n protected onToggleSelection = async(forwards: boolean, animate: boolean) => {\n const {needTranslateX, widthFrom, widthTo} = await this.chat.input.center(animate);\n\n SetTransition({\n element: this.listenElement,\n className: 'is-selecting',\n forwards,\n duration: animate ? 200 : 0,\n onTransitionEnd: () => {\n if(!this.isSelecting) {\n this.selectionInputWrapper.remove();\n this.selectionInputWrapper =\n this.selectionContainer =\n this.selectionSendNowBtn =\n this.selectionForwardBtn =\n this.selectionDeleteBtn =\n this.selectionLeft =\n this.selectionRight =\n null;\n this.selectedText = undefined;\n }\n\n /* fastRaf(() => {\n this.bubbles.onScroll();\n }); */\n }\n });\n\n // const chatInput = this.appImManager.chatInput;\n\n const translateButtonsX = widthFrom < widthTo ? undefined : needTranslateX * 2;\n if(this.isSelecting) {\n if(!this.selectionContainer) {\n this.selectionInputWrapper = document.createElement('div');\n this.selectionInputWrapper.classList.add('chat-input-wrapper', 'selection-wrapper');\n\n // const background = document.createElement('div');\n // background.classList.add('chat-input-wrapper-background');\n\n this.selectionContainer = document.createElement('div');\n this.selectionContainer.classList.add('selection-container');\n\n const attachClickOptions: AttachClickOptions = {listenerSetter: this.listenerSetter};\n const btnCancel = ButtonIcon('close', {noRipple: true});\n attachClickEvent(btnCancel, () => this.cancelSelection(), {once: true, listenerSetter: this.listenerSetter});\n\n this.selectionCountEl = document.createElement('div');\n this.selectionCountEl.classList.add('selection-container-count');\n\n if(this.chat.type === 'scheduled') {\n this.selectionSendNowBtn = Button('btn-primary btn-transparent btn-short text-bold selection-container-send', {icon: 'send2'});\n this.selectionSendNowBtn.append(i18n('MessageScheduleSend'));\n attachClickEvent(this.selectionSendNowBtn, () => {\n new PopupSendNow(this.chat.peerId, [...this.selectedMids.get(this.chat.peerId)], () => {\n this.cancelSelection();\n });\n }, attachClickOptions);\n } else {\n this.selectionForwardBtn = Button('btn-primary btn-transparent text-bold selection-container-forward', {icon: 'forward'});\n this.selectionForwardBtn.append(i18n('Forward'));\n attachClickEvent(this.selectionForwardBtn, () => {\n const obj: {[fromPeerId: PeerId]: number[]} = {};\n for(const [fromPeerId, mids] of this.selectedMids) {\n obj[fromPeerId] = Array.from(mids).sort((a, b) => a - b);\n }\n\n new PopupForward(obj, () => {\n this.cancelSelection();\n });\n }, attachClickOptions);\n }\n\n this.selectionDeleteBtn = Button('btn-primary btn-transparent danger text-bold selection-container-delete', {icon: 'delete'});\n this.selectionDeleteBtn.append(i18n('Delete'));\n attachClickEvent(this.selectionDeleteBtn, () => {\n new PopupDeleteMessages(this.chat.peerId, [...this.selectedMids.get(this.chat.peerId)], this.chat.type, () => {\n this.cancelSelection();\n });\n }, attachClickOptions);\n\n const left = this.selectionLeft = document.createElement('div');\n left.classList.add('selection-container-left');\n left.append(btnCancel, this.selectionCountEl);\n\n const right = this.selectionRight = document.createElement('div');\n right.classList.add('selection-container-right');\n right.append(...[\n this.selectionSendNowBtn,\n this.selectionForwardBtn,\n this.selectionDeleteBtn\n ].filter(Boolean))\n\n if(translateButtonsX !== undefined) {\n left.style.transform = `translateX(${-translateButtonsX}px)`;\n right.style.transform = `translateX(${translateButtonsX}px)`;\n }\n\n this.selectionContainer.append(left, right);\n\n // background.style.opacity = '0';\n this.selectionInputWrapper.style.opacity = '0';\n this.selectionInputWrapper.append(/* background, */this.selectionContainer);\n this.input.inputContainer.append(this.selectionInputWrapper);\n\n void this.selectionInputWrapper.offsetLeft; // reflow\n // background.style.opacity = '';\n this.selectionInputWrapper.style.opacity = '';\n }\n\n this.selectionLeft.style.transform = '';\n this.selectionRight.style.transform = '';\n } else if(this.selectionLeft && translateButtonsX !== undefined) {\n this.selectionLeft.style.transform = `translateX(-${translateButtonsX}px)`;\n this.selectionRight.style.transform = `translateX(${translateButtonsX}px)`;\n }\n };\n\n protected onUpdateContainer = (cantForward: boolean, cantDelete: boolean, cantSend: boolean) => {\n replaceContent(this.selectionCountEl, i18n('messages', [this.length()]));\n this.selectionSendNowBtn && this.selectionSendNowBtn.toggleAttribute('disabled', cantSend);\n this.selectionForwardBtn && this.selectionForwardBtn.toggleAttribute('disabled', cantForward);\n this.selectionDeleteBtn && this.selectionDeleteBtn.toggleAttribute('disabled', cantDelete);\n };\n\n protected onCancelSelection = async() => {\n return;\n const promises: Promise[] = [];\n for(const [peerId, mids] of this.selectedMids) {\n for(const mid of mids) {\n promises.push(this.bubbles.getMountedBubble(mid).then((m) => m?.bubble));\n }\n }\n\n const bubbles = filterUnique((await Promise.all(promises)).filter(Boolean));\n bubbles.forEach((bubble) => {\n this.toggleByElement(bubble);\n });\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function getSelectedText(): string {\n if(window.getSelection) {\n return window.getSelection().toString();\n // @ts-ignore\n } else if(document.selection) {\n // @ts-ignore\n return document.selection.createRange().text;\n }\n\n return '';\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport contextMenuController from '../../helpers/contextMenuController';\nimport {attachContextMenuListener} from '../../helpers/dom/attachContextMenuListener';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport rootScope from '../../lib/rootScope';\nimport {ButtonMenuItemOptions, ButtonMenuSync} from '../buttonMenu';\n\nexport default class SendMenu {\n public sendMenu: HTMLElement;\n private sendMenuButtons: (ButtonMenuItemOptions & {verify: () => boolean})[];\n private type: 'schedule' | 'reminder';\n\n constructor(options: {\n onSilentClick: () => void,\n onScheduleClick: () => void,\n listenerSetter?: ListenerSetter,\n openSide: string,\n onContextElement: HTMLElement,\n onOpen?: () => boolean\n }) {\n this.sendMenuButtons = [{\n icon: 'mute',\n text: 'Chat.Send.WithoutSound',\n onClick: options.onSilentClick,\n verify: () => this.type === 'schedule'\n }, {\n icon: 'schedule',\n text: 'Chat.Send.ScheduledMessage',\n onClick: options.onScheduleClick,\n verify: () => this.type === 'schedule'\n }, {\n icon: 'schedule',\n text: 'Chat.Send.SetReminder',\n onClick: options.onScheduleClick,\n verify: () => this.type === 'reminder'\n }];\n\n this.sendMenu = ButtonMenuSync({buttons: this.sendMenuButtons, listenerSetter: options.listenerSetter});\n this.sendMenu.classList.add('menu-send', options.openSide);\n\n attachContextMenuListener({\n element: options.onContextElement,\n callback: (e) => {\n if(options.onOpen && !options.onOpen()) {\n return;\n }\n\n this.sendMenuButtons.forEach((button) => {\n button.element.classList.toggle('hide', !button.verify());\n });\n\n cancelEvent(e);\n contextMenuController.openBtnMenu(this.sendMenu);\n },\n listenerSetter: options.listenerSetter\n });\n }\n\n public setPeerId(peerId: PeerId) {\n this.type = peerId === rootScope.myId ? 'reminder' : 'schedule';\n }\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ListenerSetter from '../helpers/listenerSetter';\nimport ripple from './ripple';\nimport {LangPackKey, _i18n} from '../lib/langPack';\nimport getDeepProperty from '../helpers/object/getDeepProperty';\nimport rootScope from '../lib/rootScope';\nimport apiManagerProxy from '../lib/mtproto/mtprotoworker';\nimport simulateEvent from '../helpers/dom/dispatchEvent';\n\nexport type CheckboxFieldOptions = {\n text?: LangPackKey,\n textArgs?: any[],\n name?: string,\n round?: boolean,\n toggle?: boolean,\n stateKey?: string,\n stateValues?: any[],\n stateValueReverse?: boolean,\n disabled?: boolean,\n checked?: boolean,\n restriction?: boolean,\n withRipple?: boolean,\n withHover?: boolean,\n listenerSetter?: ListenerSetter\n};\nexport default class CheckboxField {\n public input: HTMLInputElement;\n public label: HTMLLabelElement;\n public span: HTMLSpanElement;\n public listenerSetter: ListenerSetter;\n\n constructor(options: CheckboxFieldOptions = {}) {\n const label = this.label = document.createElement('label');\n label.classList.add('checkbox-field');\n\n if(options.restriction && !options.toggle) {\n label.classList.add('checkbox-field-restriction');\n }\n\n if(options.round) {\n label.classList.add('checkbox-field-round');\n }\n\n if(options.disabled) {\n this.toggleDisability(true);\n }\n\n this.listenerSetter = options.listenerSetter;\n\n const input = this.input = document.createElement('input');\n input.classList.add('checkbox-field-input');\n input.type = 'checkbox';\n if(options.name) {\n input.id = 'input-' + options.name;\n }\n\n if(options.checked) {\n input.checked = true;\n }\n\n if(options.stateKey) {\n let loaded = false;\n const onChange = () => {\n if(!loaded) {\n return;\n }\n\n let value: any;\n if(options.stateValues) {\n value = options.stateValues[input.checked ? 1 : 0];\n } else {\n value = input.checked;\n\n if(options.stateValueReverse) {\n value = !value;\n }\n }\n\n rootScope.managers.appStateManager.setByKey(options.stateKey, value);\n };\n\n options.checked === undefined && apiManagerProxy.getState().then((state) => {\n loaded = true;\n const stateValue = getDeepProperty(state, options.stateKey);\n let checked: boolean;\n if(options.stateValues) {\n checked = options.stateValues.indexOf(stateValue) === 1;\n } else {\n checked = stateValue;\n\n if(options.stateValueReverse) {\n checked = !checked;\n }\n }\n\n this.setValueSilently(checked);\n });\n\n if(options.listenerSetter) options.listenerSetter.add(input)('change', onChange);\n else input.addEventListener('change', onChange);\n }\n\n let span: HTMLSpanElement;\n if(options.text) {\n span = this.span = document.createElement('span');\n span.classList.add('checkbox-caption');\n _i18n(span, options.text, options.textArgs);\n } else {\n label.classList.add('checkbox-without-caption');\n }\n\n label.append(input);\n\n if(options.toggle) {\n label.classList.add('checkbox-field-toggle');\n\n if(options.restriction) {\n label.classList.add('checkbox-field-toggle-restriction');\n }\n\n const toggle = document.createElement('div');\n toggle.classList.add('checkbox-toggle');\n label.append(toggle);\n } else {\n const box = document.createElement('div');\n box.classList.add('checkbox-box');\n\n const checkSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n checkSvg.classList.add('checkbox-box-check');\n checkSvg.setAttributeNS(null, 'viewBox', '0 0 24 24');\n const use = document.createElementNS('http://www.w3.org/2000/svg', 'use');\n use.setAttributeNS(null, 'href', '#check');\n use.setAttributeNS(null, 'x', '-1');\n checkSvg.append(use);\n\n const bg = document.createElement('div');\n bg.classList.add('checkbox-box-background');\n\n const border = document.createElement('div');\n border.classList.add('checkbox-box-border');\n\n box.append(border, bg, checkSvg);\n\n label.append(box);\n }\n\n if(span) {\n label.append(span);\n }\n\n if(options.withRipple) {\n label.classList.add('checkbox-ripple', 'hover-effect');\n ripple(label, undefined, undefined, true);\n // label.prepend(input);\n } else if(options.withHover) {\n label.classList.add('hover-effect');\n }\n }\n\n get checked() {\n return this.input.checked;\n }\n\n set checked(checked: boolean) {\n /* if(this.checked === checked) {\n return;\n } */\n\n this.setValueSilently(checked);\n simulateEvent(this.input, 'change');\n }\n\n public setValueSilently(checked: boolean) {\n this.input.checked = checked;\n }\n\n public isDisabled() {\n return this.label.classList.contains('checkbox-disabled');\n }\n\n public toggleDisability(disable: boolean) {\n this.label.classList.toggle('checkbox-disabled', disable);\n this.input.disabled = disable;\n return () => this.toggleDisability(!disable);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport findUpAsChild from '../helpers/dom/findUpAsChild';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport safeAssign from '../helpers/object/safeAssign';\nimport I18n, {LangPackKey} from '../lib/langPack';\nimport CheckboxField from './checkboxField';\nimport Row from './row';\nimport {toast} from './toast';\n\nexport type CheckboxFieldsField = {\n text: LangPackKey,\n description?: LangPackKey,\n restrictionText?: LangPackKey,\n checkboxField?: CheckboxField,\n checked?: boolean,\n nested?: CheckboxFieldsField[],\n nestedTo?: CheckboxFieldsField,\n nestedCounter?: HTMLElement,\n setNestedCounter?: (count: number) => void,\n toggleWith?: {checked?: CheckboxFieldsField[], unchecked?: CheckboxFieldsField[]},\n name?: string,\n row?: Row\n};\n\nexport default class CheckboxFields {\n public fields: Array;\n protected listenerSetter: ListenerSetter;\n protected asRestrictions: boolean;\n\n constructor(options: {\n fields: Array,\n listenerSetter: ListenerSetter,\n asRestrictions?: boolean\n }) {\n safeAssign(this, options);\n }\n\n public createField(info: CheckboxFieldsField, isNested?: boolean) {\n if(info.nestedTo && !isNested) {\n return;\n }\n\n const row = info.row = new Row({\n titleLangKey: isNested ? undefined : info.text,\n checkboxField: info.checkboxField = new CheckboxField({\n text: isNested ? info.text : undefined,\n checked: info.nested ? false : info.checked,\n toggle: !isNested,\n listenerSetter: this.listenerSetter,\n restriction: this.asRestrictions && !isNested,\n name: info.name\n }),\n listenerSetter: this.listenerSetter,\n subtitleLangKey: info.description,\n clickable: info.nested ? (e) => {\n if(findUpAsChild(e.target as HTMLElement, row.checkboxField.label)) {\n return;\n }\n\n cancelEvent(e);\n row.container.classList.toggle('accordion-toggler-expanded');\n accordion.classList.toggle('is-expanded');\n } : undefined\n });\n\n if(info.restrictionText) {\n info.checkboxField.input.disabled = true;\n\n attachClickEvent(info.checkboxField.label, (e) => {\n toast(I18n.format(info.restrictionText, true));\n }, {listenerSetter: this.listenerSetter});\n }\n\n const nodes: HTMLElement[] = [row.container];\n let accordion: HTMLElement, nestedCounter: HTMLElement;\n if(info.nested) {\n const container = accordion = document.createElement('div');\n container.classList.add('accordion');\n container.style.setProperty('--max-height', info.nested.length * 48 + 'px');\n const _info = info;\n info.nested.forEach((info) => {\n info.nestedTo ??= _info;\n container.append(...this.createField(info, true).nodes);\n });\n nodes.push(container);\n\n const span = document.createElement('span');\n span.classList.add('tgico-down', 'accordion-icon');\n\n nestedCounter = info.nestedCounter = document.createElement('b');\n this.setNestedCounter(info);\n row.title.append(' ', nestedCounter, ' ', span);\n\n row.container.classList.add('accordion-toggler');\n row.titleRow.classList.add('with-delimiter');\n\n row.checkboxField.setValueSilently(this.getNestedCheckedLength(info) === info.nested.length);\n\n info.toggleWith ??= {checked: info.nested, unchecked: info.nested};\n }\n\n if(info.toggleWith || info.nestedTo) {\n const processToggleWith = info.toggleWith ? (info: CheckboxFieldsField) => {\n const {toggleWith, nested} = info;\n const value = info.checkboxField.checked;\n const arr = value ? toggleWith.checked : toggleWith.unchecked;\n if(!arr) {\n return;\n }\n\n const other = this.fields.filter((i) => arr.includes(i));\n other.forEach((info) => {\n info.checkboxField.setValueSilently(value);\n if(info.nestedTo && !nested) {\n this.setNestedCounter(info.nestedTo);\n }\n\n if(info.toggleWith) {\n processToggleWith(info);\n }\n });\n\n if(info.nested) {\n this.setNestedCounter(info);\n }\n } : undefined;\n\n const processNestedTo = info.nestedTo ? () => {\n const length = this.getNestedCheckedLength(info.nestedTo);\n info.nestedTo.checkboxField.setValueSilently(length === info.nestedTo.nested.length);\n this.setNestedCounter(info.nestedTo, length);\n } : undefined;\n\n this.listenerSetter.add(info.checkboxField.input)('change', () => {\n processToggleWith?.(info);\n processNestedTo?.();\n });\n }\n\n return {row, nodes};\n }\n\n protected getNestedCheckedLength(info: CheckboxFieldsField) {\n return info.nested.reduce((acc, v) => acc + +v.checkboxField.checked, 0);\n }\n\n public setNestedCounter(info: CheckboxFieldsField, count = this.getNestedCheckedLength(info)) {\n info.nestedCounter.textContent = `${count}/${info.nested.length}`;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport InputField, {InputFieldOptions} from './inputField';\n\nexport default class CodeInputField extends InputField {\n constructor(public options: InputFieldOptions & {\n length: number,\n onFill: (code: string) => void\n }) {\n super(Object.assign(options, {\n plainText: true\n }));\n\n const input = this.input as HTMLInputElement;\n input.type = 'tel';\n input.setAttribute('required', '');\n input.autocomplete = 'off';\n\n let lastLength = 0;\n this.input.addEventListener('input', (e) => {\n this.input.classList.remove('error');\n this.setLabel();\n\n const value = this.value.replace(/\\D/g, '').slice(0, options.length);\n this.setValueSilently(value);\n\n const length = this.value.length;\n if(length === options.length) { // submit code\n options.onFill(this.value);\n } else if(length === lastLength) {\n return;\n }\n\n lastLength = length;\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {addCancelButton} from './popups';\nimport PopupPeer, {PopupPeerCheckboxOptions, PopupPeerOptions} from './popups/peer';\n\n// type PopupConfirmationOptions = Pick;\nexport type PopupConfirmationOptions = PopupPeerOptions & {\n button: PopupPeerOptions['buttons'][0],\n checkbox?: PopupPeerOptions['checkboxes'][0]\n};\n\nexport default function confirmationPopup(\n options: T\n): Promise : (T['checkbox'] extends PopupPeerCheckboxOptions ? boolean : void)> {\n return new Promise((resolve, reject) => {\n const {button, checkbox} = options;\n button.callback = (set) => {\n if(checkbox || !set) {\n resolve(set ? !!set.size : undefined);\n } else {\n resolve(options.checkboxes.map((checkbox) => set.has(checkbox.text)));\n }\n };\n\n const buttons = addCancelButton(options.buttons || [button]);\n const cancelButton = buttons.find((button) => button.isCancel);\n cancelButton.callback = () => {\n reject();\n };\n\n options.buttons = buttons;\n options.checkboxes ??= checkbox && [checkbox];\n\n new PopupPeer('popup-confirmation', options).show();\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_EMOJI_SUPPORTED from '../environment/emojiSupport';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport findUpTag from '../helpers/dom/findUpTag';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport setInnerHTML from '../helpers/dom/setInnerHTML';\nimport fastSmoothScroll from '../helpers/fastSmoothScroll';\nimport {randomLong} from '../helpers/random';\nimport {HelpCountry, HelpCountryCode} from '../layer';\nimport I18n, {i18n} from '../lib/langPack';\nimport wrapEmojiText from '../lib/richTextProcessor/wrapEmojiText';\nimport rootScope from '../lib/rootScope';\nimport {getCountryEmoji} from '../vendor/emoji';\nimport InputField, {InputFieldOptions} from './inputField';\nimport Scrollable from './scrollable';\n\nlet countries: HelpCountry.helpCountry[];\nconst setCountries = () => {\n countries = I18n.countriesList\n .filter((country) => !country.pFlags?.hidden)\n .sort((a, b) => (a.name || a.default_name).localeCompare(b.name || b.default_name));\n};\n\nlet init = () => {\n setCountries();\n rootScope.addEventListener('language_change', () => {\n setCountries();\n });\n};\n\nconst VIRTUAL_COUNTRIES = new Set(['FT']);\n\nexport default class CountryInputField extends InputField {\n private lastCountrySelected: HelpCountry;\n private lastCountryCodeSelected: HelpCountryCode;\n\n private hideTimeout: number;\n private selectWrapper: HTMLElement;\n\n private liMap: Map;\n\n constructor(public options: InputFieldOptions & {\n onCountryChange?: (country: HelpCountry.helpCountry, code: HelpCountryCode.helpCountryCode) => void,\n noPhoneCodes?: boolean\n } = {}) {\n super({\n label: 'Country',\n name: randomLong(),\n ...options\n });\n\n if(init) {\n init();\n init = undefined;\n }\n\n this.liMap = new Map();\n\n this.container.classList.add('input-select');\n\n const selectWrapper = this.selectWrapper = document.createElement('div');\n selectWrapper.classList.add('select-wrapper', 'z-depth-3', 'hide');\n\n const arrowDown = document.createElement('span');\n arrowDown.classList.add('arrow', 'arrow-down');\n this.container.append(arrowDown);\n\n const selectList = document.createElement('ul');\n selectWrapper.appendChild(selectList);\n\n const scroll = new Scrollable(selectWrapper);\n\n let initSelect = () => {\n initSelect = null;\n\n countries.forEach((c) => {\n if(options.noPhoneCodes && VIRTUAL_COUNTRIES.has(c.iso2)) {\n return;\n }\n\n const emoji = getCountryEmoji(c.iso2);\n\n const liArr: Array = [];\n for(let i = 0, length = Math.min(c.country_codes.length, options.noPhoneCodes ? 1 : Infinity); i < length; ++i) {\n const countryCode = c.country_codes[i];\n const li = document.createElement('li');\n\n const wrapped = wrapEmojiText(emoji);\n if(IS_EMOJI_SUPPORTED) {\n const spanEmoji = document.createElement('span');\n setInnerHTML(spanEmoji, wrapped);\n li.append(spanEmoji);\n } else {\n setInnerHTML(li, wrapped);\n }\n\n const el = i18n(c.default_name as any);\n el.dataset.defaultName = c.default_name;\n li.append(el);\n\n if(!options.noPhoneCodes) {\n const span = document.createElement('span');\n span.classList.add('phone-code');\n span.innerText = '+' + countryCode.country_code;\n li.appendChild(span);\n }\n\n liArr.push(li);\n selectList.append(li);\n }\n\n this.liMap.set(c.iso2, liArr);\n });\n\n selectList.addEventListener('mousedown', (e) => {\n if(e.button !== 0) { // other buttons but left shall not pass\n return;\n }\n\n const target = findUpTag(e.target, 'LI')\n this.selectCountryByTarget(target);\n // console.log('clicked', e, countryName, phoneCode);\n });\n\n this.container.appendChild(selectWrapper);\n };\n\n initSelect();\n\n this.input.addEventListener('focus', (e) => {\n if(initSelect) {\n initSelect();\n } else {\n countries.forEach((c) => {\n const arr = this.liMap.get(c.iso2);\n if(!arr) return;\n arr.forEach((li) => li.style.display = '');\n });\n }\n\n clearTimeout(this.hideTimeout);\n this.hideTimeout = undefined;\n\n selectWrapper.classList.remove('hide');\n void selectWrapper.offsetWidth; // reflow\n selectWrapper.classList.add('active');\n\n this.select();\n\n fastSmoothScroll({\n // container: page.pageEl.parentElement.parentElement,\n container: findUpClassName(this.container, 'scrollable-y'),\n element: this.input,\n position: 'start',\n margin: 4\n });\n\n setTimeout(() => {\n if(!mouseDownHandlerAttached) {\n document.addEventListener('mousedown', onMouseDown, {capture: true});\n mouseDownHandlerAttached = true;\n }\n }, 0);\n });\n\n let mouseDownHandlerAttached = false;\n const onMouseDown = (e: MouseEvent) => {\n if(findUpClassName(e.target, 'input-select')) {\n return;\n }\n if(e.target === this.input) {\n return;\n }\n\n this.hidePicker();\n document.removeEventListener('mousedown', onMouseDown, {capture: true});\n mouseDownHandlerAttached = false;\n };\n\n /* false && this.input.addEventListener('blur', function(this: typeof this.input, e) {\n hidePicker();\n\n e.cancelBubble = true;\n }, {capture: true}); */\n\n const onKeyPress = (e: KeyboardEvent) => {\n const key = e.key;\n if(e.ctrlKey || key === 'Control') return false;\n\n // let i = new RegExp('^' + this.value, 'i');\n const _value = this.value.toLowerCase();\n const matches: HelpCountry[] = [];\n countries.forEach((c) => {\n const arr = this.liMap.get(c.iso2);\n if(!arr) {\n return;\n }\n\n const names = [\n c.name,\n c.default_name,\n c.iso2\n ];\n\n names.filter(Boolean).forEach((name) => {\n const abbr = name.split(' ').filter((word) => /\\w/.test(word)).map((word) => word[0]).join('');\n if(abbr.length > 1) {\n names.push(abbr);\n }\n });\n\n const good = !!names.filter(Boolean).find((str) => str.toLowerCase().indexOf(_value) !== -1)/* === 0 */;// i.test(c.name);\n\n arr.forEach((li) => li.style.display = good ? '' : 'none');\n if(good) matches.push(c);\n });\n\n // Код ниже автоматически выберет страну если она осталась одна при поиске\n /* if(matches.length === 1 && matches[0].li.length === 1) {\n if(matches[0].name === lastCountrySelected) return false;\n //console.log('clicking', matches[0]);\n\n var clickEvent = document.createEvent('MouseEvents');\n clickEvent.initEvent('mousedown', true, true);\n matches[0].li[0].dispatchEvent(clickEvent);\n return false;\n } else */if(matches.length === 0) {\n countries.forEach((c) => {\n const arr = this.liMap.get(c.iso2);\n if(!arr) {\n return;\n }\n\n arr.forEach((li) => li.style.display = '');\n });\n } else if(matches.length === 1 && key === 'Enter') {\n cancelEvent(e);\n this.selectCountryByTarget(this.liMap.get(matches[0].iso2)[0]);\n }\n };\n\n this.input.addEventListener('keyup', onKeyPress);\n this.input.addEventListener('keydown', (e) => {\n if(e.key === 'Enter') {\n onKeyPress(e);\n }\n });\n\n arrowDown.addEventListener('mousedown', (e) => {\n if(this.input.matches(':focus')) {\n this.hidePicker();\n this.input.blur();\n } else {\n e.cancelBubble = true;\n e.preventDefault();\n this.input.focus();\n }\n });\n }\n\n public getSelected() {\n return {country: this.lastCountrySelected, code: this.lastCountryCodeSelected};\n }\n\n public hidePicker = () => {\n if(this.hideTimeout !== undefined) return;\n this.selectWrapper.classList.remove('active');\n this.hideTimeout = window.setTimeout(() => {\n this.selectWrapper.classList.add('hide');\n this.hideTimeout = undefined;\n }, 200);\n }\n\n public selectCountryByTarget = (target: HTMLElement) => {\n const defaultName = target.querySelector('[data-default-name]').dataset.defaultName;\n const phoneCodeEl = target.querySelector('.phone-code');\n const phoneCode = phoneCodeEl?.innerText;\n const countryCode = phoneCode && phoneCode.replace(/\\D/g, '');\n\n replaceContent(this.input, i18n(defaultName as any));\n this.simulateInputEvent();\n this.lastCountrySelected = countries.find((c) => c.default_name === defaultName);\n this.lastCountryCodeSelected = countryCode && this.lastCountrySelected.country_codes.find((_countryCode) => _countryCode.country_code === countryCode);\n\n this.options.onCountryChange?.(this.lastCountrySelected, this.lastCountryCodeSelected);\n this.hidePicker();\n }\n\n public selectCountryByIso2(iso2: string) {\n this.selectCountryByTarget(this.liMap.get(iso2)[0]);\n }\n\n public override(country: HelpCountry, code: HelpCountryCode, countryName?: string) {\n replaceContent(this.input, country ? i18n(country.default_name as any) : countryName);\n this.lastCountrySelected = country;\n this.lastCountryCodeSelected = code;\n this.options.onCountryChange?.(this.lastCountrySelected, this.lastCountryCodeSelected);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {setDirection} from '../helpers/dom/setInnerHTML';\n\nexport default class DivAndCaption {\n public container: HTMLElement;\n public border: HTMLElement;\n public content: HTMLElement;\n public title: HTMLElement;\n public subtitle: HTMLElement;\n\n constructor(protected className: string, public fill?: T) {\n this.container = document.createElement('div');\n this.container.className = className;\n\n this.border = document.createElement('div');\n this.border.classList.add(className + '-border');\n\n this.content = document.createElement('div');\n this.content.classList.add(className + '-content');\n\n this.title = document.createElement('div');\n this.title.classList.add(className + '-title');\n setDirection(this.title);\n\n this.subtitle = document.createElement('div');\n this.subtitle.classList.add(className + '-subtitle');\n setDirection(this.subtitle);\n\n this.content.append(this.title, this.subtitle);\n this.container.append(this.border, this.content);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {IS_MOBILE} from '../environment/userAgent';\nimport {animate} from '../helpers/animation';\nimport liteMode from '../helpers/liteMode';\nimport {Middleware} from '../helpers/middleware';\nimport clamp from '../helpers/number/clamp';\nimport animationIntersector, {AnimationItemGroup, AnimationItemWrapper} from './animationIntersector';\n\ntype DotRendererDot = {\n x: number,\n y: number,\n opacity: number,\n radius: number\n mOpacity: number,\n adding: boolean,\n counter: number,\n path: Path2D\n};\nexport default class DotRenderer implements AnimationItemWrapper {\n public canvas: HTMLCanvasElement;\n private context: CanvasRenderingContext2D;\n private dots: DotRendererDot[];\n\n public paused: boolean;\n public autoplay: boolean;\n public tempId: number;\n\n private dpr: number;\n\n public loop: boolean = true;\n\n constructor(\n private width: number,\n private height: number,\n private multiply?: number\n ) {\n const canvas = this.canvas = document.createElement('canvas');\n const dpr = this.dpr = window.devicePixelRatio;\n canvas.width = width * dpr;\n canvas.height = height * dpr;\n canvas.classList.add('canvas-thumbnail', 'canvas-dots');\n\n this.paused = true;\n this.autoplay = true;\n this.tempId = 0;\n this.context = canvas.getContext('2d');\n }\n\n private prepare() {\n let count = Math.round(this.width * this.height / (35 * (IS_MOBILE ? 2 : 1)));\n count *= this.multiply || 1;\n count = Math.min(!liteMode.isAvailable('chat_spoilers') ? 400 : IS_MOBILE ? 1000 : 2200, count);\n count = Math.round(count);\n const dots: DotRendererDot[] = this.dots = new Array(count);\n\n for(let i = 0; i < count; ++i) {\n dots[i] = this.generateDot();\n }\n }\n\n private generateDot(adding?: boolean): DotRendererDot {\n const x = Math.floor(Math.random() * this.canvas.width);\n const y = Math.floor(Math.random() * this.canvas.height);\n const opacity = adding ? 0 : Math.random();\n const radius = (Math.random() >= .8 ? 1 : 0.5) * this.dpr;\n const path = new Path2D();\n path.arc(x, y, radius, 0, 2 * Math.PI, false);\n return {\n x,\n y,\n opacity,\n radius,\n mOpacity: opacity,\n adding: adding ?? Math.random() >= .5,\n counter: 0,\n path\n };\n }\n\n private draw() {\n const {context, canvas, dots} = this;\n context.clearRect(0, 0, canvas.width, canvas.height);\n context.fillStyle = '#fff';\n\n const add = 0.02;\n for(let i = 0, length = dots.length; i < length; ++i) {\n const dot = dots[i];\n const addOpacity = dot.adding ? add : -add;\n\n dot.mOpacity += addOpacity;\n // if(dot.mOpacity <= 0) dot.mOpacity = dot.opacity;\n\n // const easedOpacity = easing(dot.mOpacity);\n const easedOpacity = clamp(dot.mOpacity, 0, 1);\n context.globalAlpha = easedOpacity;\n context.fill(dot.path);\n\n if(dot.mOpacity <= 0) {\n dot.adding = true;\n\n if(++dot.counter >= 1) {\n dots[i] = this.generateDot(dot.adding);\n }\n } else if(dot.mOpacity >= 1) {\n dot.adding = false;\n }\n }\n }\n\n public remove() {\n this.pause();\n }\n\n public pause() {\n if(this.paused) {\n return;\n }\n\n this.paused = true;\n ++this.tempId;\n }\n\n public renderFirstFrame() {\n if(!this.dots) {\n this.prepare();\n }\n\n this.draw();\n }\n\n public play() {\n if(!this.paused) {\n return;\n }\n\n this.paused = false;\n const tempId = ++this.tempId;\n\n if(!this.dots) {\n this.prepare();\n }\n\n animate(() => {\n if(this.tempId !== tempId || this.paused) {\n return false;\n }\n\n this.draw();\n return true;\n });\n }\n\n public static create({\n width,\n height,\n middleware,\n animationGroup,\n multiply\n }: {\n width: number,\n height: number,\n middleware: Middleware,\n animationGroup: AnimationItemGroup,\n multiply?: number\n }) {\n const dotRenderer = new DotRenderer(width, height, multiply);\n dotRenderer.renderFirstFrame();\n\n animationIntersector.addAnimation({\n animation: dotRenderer,\n group: animationGroup,\n observeElement: dotRenderer.canvas,\n controlled: middleware\n });\n\n return dotRenderer;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {InputFile} from '../layer';\nimport AvatarEdit from './avatarEdit';\nimport AvatarElement from './avatar';\nimport InputField from './inputField';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport ButtonCorner from './buttonCorner';\nimport safeAssign from '../helpers/object/safeAssign';\nimport {NULL_PEER_ID} from '../lib/mtproto/mtproto_config';\n\nexport default class EditPeer {\n public nextBtn: HTMLButtonElement;\n\n public uploadAvatar: () => Promise;\n public avatarEdit: AvatarEdit;\n public avatarElem: AvatarElement;\n\n private inputFields: InputField[];\n private listenerSetter: ListenerSetter;\n\n private peerId: PeerId;\n\n private _disabled = false;\n private avatarSize = 120;\n\n constructor(options: {\n peerId?: EditPeer['peerId'],\n inputFields: EditPeer['inputFields'],\n listenerSetter: ListenerSetter,\n doNotEditAvatar?: boolean,\n withoutAvatar?: boolean,\n nextBtn?: HTMLButtonElement,\n avatarSize?: number,\n popupOptions?: ConstructorParameters[1]\n }) {\n safeAssign(this, options);\n\n this.peerId ||= NULL_PEER_ID;\n\n if(!this.nextBtn) {\n this.nextBtn = ButtonCorner({icon: 'check'});\n } else if(!this.nextBtn.classList.contains('btn-corner')) {\n this.handleChange = () => {\n this.nextBtn.toggleAttribute('disabled', !this.isChanged() || this.disabled);\n };\n }\n\n if(!options.withoutAvatar) {\n this.avatarElem = new AvatarElement();\n this.avatarElem.classList.add('avatar-placeholder', 'avatar-' + this.avatarSize);\n this.avatarElem.updateWithOptions({peerId: this.peerId});\n\n if(!options.doNotEditAvatar) {\n this.avatarEdit = new AvatarEdit((_upload) => {\n this.uploadAvatar = _upload;\n this.handleChange();\n this.avatarElem.remove();\n }, options.popupOptions);\n\n this.avatarEdit.container.append(this.avatarElem);\n }\n }\n\n this.inputFields.forEach((inputField) => {\n this.listenerSetter.add(inputField.input)('input', this.handleChange);\n });\n\n this.handleChange();\n }\n\n public get disabled() {\n return this._disabled;\n }\n\n public set disabled(value) {\n this._disabled = value;\n this.inputFields.forEach((inputField) => inputField.input.toggleAttribute('disabled', value));\n this.handleChange();\n }\n\n public lockWithPromise(promise: Promise, unlockOnSuccess = false) {\n this.disabled = true;\n promise.then(() => {\n if(unlockOnSuccess) {\n this.disabled = false;\n }\n }, () => {\n this.disabled = false;\n });\n }\n\n public isChanged = () => {\n if(this.uploadAvatar) {\n return true;\n }\n\n let changedLength = 0, requiredLength = 0, requiredValidLength = 0;\n this.inputFields.forEach((inputField) => {\n if(inputField.isValid()) {\n if(inputField.isChanged()) {\n ++changedLength;\n }\n\n if(inputField.required) {\n ++requiredValidLength;\n }\n }\n\n if(inputField.required) {\n ++requiredLength;\n }\n });\n\n return requiredLength === requiredValidLength && changedLength > 0;\n };\n\n public handleChange = () => {\n this.nextBtn.classList.toggle('is-visible', this.isChanged());\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport emoticonsDropdown, {EmoticonsDropdown, EmoticonsTab, EMOTICONSSTICKERGROUP} from '..';\nimport GifsMasonry from '../../gifsMasonry';\nimport Scrollable from '../../scrollable';\nimport {putPreloader} from '../../putPreloader';\nimport {AppManagers} from '../../../lib/appManagers/managers';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\n\nexport default class GifsTab implements EmoticonsTab {\n public content: HTMLElement;\n public scrollable: Scrollable;\n public tabId: number;\n\n constructor(private managers: AppManagers) {\n\n }\n\n init() {\n this.content = document.getElementById('content-gifs');\n const gifsContainer = this.content.firstElementChild as HTMLDivElement;\n attachClickEvent(gifsContainer, EmoticonsDropdown.onMediaClick);\n\n const scroll = this.scrollable = new Scrollable(this.content, 'GIFS');\n const masonry = new GifsMasonry(gifsContainer, EMOTICONSSTICKERGROUP, scroll);\n const preloader = putPreloader(this.content, true);\n\n this.managers.appDocsManager.getGifs().then((docs) => {\n docs.forEach((doc) => {\n masonry.add(doc);\n });\n\n preloader.remove();\n });\n\n emoticonsDropdown.addLazyLoadQueueRepeat(masonry.lazyLoadQueue, masonry.processInvisibleDiv);\n\n this.init = null;\n }\n\n onClose() {\n\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../../../lib/appManagers/appDocsManager';\nimport {SliderSuperTab} from '../../slider';\nimport InputSearch from '../../inputSearch';\nimport animationIntersector, {AnimationItemGroup} from '../../animationIntersector';\nimport appSidebarRight from '..';\nimport {AppInlineBotsManager} from '../../../lib/appManagers/appInlineBotsManager';\nimport GifsMasonry from '../../gifsMasonry';\nimport appImManager from '../../../lib/appManagers/appImManager';\nimport mediaSizes from '../../../helpers/mediaSizes';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport {NULL_PEER_ID} from '../../../lib/mtproto/mtproto_config';\n\nconst ANIMATIONGROUP: AnimationItemGroup = 'GIFS-SEARCH';\n\nexport default class AppGifsTab extends SliderSuperTab {\n private inputSearch: InputSearch;\n private gifsDiv: HTMLDivElement;\n\n private nextOffset = '';\n private loadedAll = false;\n\n private gifBotPeerId: PeerId;\n private masonry: GifsMasonry;\n\n private searchPromise: ReturnType;\n\n public init() {\n this.container.id = 'search-gifs-container';\n\n this.inputSearch = new InputSearch('SearchGifsTitle', (value) => {\n this.reset();\n this.search(value);\n });\n\n this.title.replaceWith(this.inputSearch.container);\n\n this.gifsDiv = document.createElement('div');\n this.gifsDiv.classList.add('gifs-masonry');\n attachClickEvent(this.gifsDiv, this.onGifsClick, {listenerSetter: this.listenerSetter});\n\n this.scrollable.append(this.gifsDiv);\n\n this.masonry = new GifsMasonry(this.gifsDiv, ANIMATIONGROUP, this.scrollable);\n // this.backBtn.parentElement.append(this.inputSearch.container);\n\n appSidebarRight.toggleSidebar(true).then(() => {\n this.search('', true);\n\n this.scrollable.onScrolledBottom = () => {\n this.search(this.inputSearch.value, false);\n };\n });\n }\n\n private onGifsClick = async(e: MouseEvent | TouchEvent) => {\n const target = findUpClassName(e.target, 'gif');\n if(!target) return;\n\n const fileId = target.dataset.docId;\n if(await appImManager.chat.input.sendMessageWithDocument(fileId)) {\n if(mediaSizes.isMobile) {\n appSidebarRight.onCloseBtnClick();\n }\n } else {\n console.warn('got no doc by id:', fileId);\n }\n };\n\n public onClose() {\n this.scrollable.onScrolledBottom = () => {};\n }\n\n public onCloseAfterTimeout() {\n this.reset();\n this.gifsDiv.innerHTML = '';\n animationIntersector.checkAnimations(undefined, ANIMATIONGROUP);\n this.inputSearch.remove();\n return super.onCloseAfterTimeout();\n }\n\n private reset() {\n this.searchPromise = null;\n this.nextOffset = '';\n this.loadedAll = false;\n this.masonry.clear();\n }\n\n public async search(query: string, newSearch = true) {\n if(this.searchPromise || this.loadedAll) return;\n\n if(!this.gifBotPeerId) {\n this.gifBotPeerId = (await this.managers.appUsersManager.resolveUsername('gif')).id.toPeerId(false);\n }\n\n try {\n this.searchPromise = this.managers.appInlineBotsManager.getInlineResults(NULL_PEER_ID, this.gifBotPeerId, query, this.nextOffset);\n const {results, next_offset} = await this.searchPromise;\n\n if(this.inputSearch.value !== query) {\n return;\n }\n\n this.searchPromise = null;\n this.nextOffset = next_offset;\n if(newSearch) {\n this.gifsDiv.innerHTML = '';\n }\n\n if(results.length) {\n results.forEach((result) => {\n if(result._ === 'botInlineMediaResult' && result.document) {\n this.masonry.add(result.document as MyDocument);\n }\n });\n } else {\n this.loadedAll = true;\n }\n\n this.scrollable.onScroll();\n } catch(err) {\n this.searchPromise = null;\n console.error('gifs loading error:', err);\n throw err;\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider';\nimport InputSearch from '../../inputSearch';\nimport LazyLoadQueue from '../../lazyLoadQueue';\nimport appImManager from '../../../lib/appManagers/appImManager';\nimport PopupStickers from '../../popups/stickers';\nimport animationIntersector from '../../animationIntersector';\nimport appSidebarRight from '..';\nimport {StickerSet, StickerSetCovered} from '../../../layer';\nimport {i18n} from '../../../lib/langPack';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport forEachReverse from '../../../helpers/array/forEachReverse';\nimport setInnerHTML from '../../../helpers/dom/setInnerHTML';\nimport wrapEmojiText from '../../../lib/richTextProcessor/wrapEmojiText';\nimport attachStickerViewerListeners from '../../stickerViewer';\nimport wrapSticker from '../../wrappers/sticker';\n\nexport default class AppStickersTab extends SliderSuperTab {\n private inputSearch: InputSearch;\n private setsDiv: HTMLDivElement;\n private lazyLoadQueue: LazyLoadQueue;\n\n public init() {\n this.container.id = 'stickers-container';\n this.container.classList.add('chatlist-container');\n\n this.lazyLoadQueue = new LazyLoadQueue();\n\n this.inputSearch = new InputSearch('StickersTab.SearchPlaceholder', (value) => {\n this.search(value);\n });\n\n this.title.replaceWith(this.inputSearch.container);\n\n this.setsDiv = document.createElement('div');\n this.setsDiv.classList.add('sticker-sets');\n this.scrollable.append(this.setsDiv);\n\n attachStickerViewerListeners({listenTo: this.setsDiv, listenerSetter: this.listenerSetter});\n\n attachClickEvent(this.setsDiv, (e) => {\n const sticker = findUpClassName(e.target, 'sticker-set-sticker');\n if(sticker) {\n const docId = sticker.dataset.docId;\n appImManager.chat.input.sendMessageWithDocument(docId);\n return;\n }\n\n const target = findUpClassName(e.target, 'sticker-set');\n if(!target) return;\n\n const id = target.dataset.stickerSet as string;\n const access_hash = target.dataset.access_hash as string;\n\n const button = findUpClassName(e.target, 'sticker-set-button') as HTMLElement;\n if(button) {\n e.preventDefault();\n e.cancelBubble = true;\n\n button.setAttribute('disabled', 'true');\n\n this.managers.appStickersManager.getStickerSet({id, access_hash}).then((full) => {\n this.managers.appStickersManager.toggleStickerSet(full.set).then((changed) => {\n if(changed) {\n button.textContent = '';\n button.append(i18n(full.set.installed_date ? 'Stickers.SearchAdded' : 'Stickers.SearchAdd'));\n button.classList.toggle('gray', !!full.set.installed_date);\n }\n }).finally(() => {\n // button.style.width = set.installed_date ? '68px' : '52px';\n button.removeAttribute('disabled');\n });\n });\n } else {\n this.managers.appStickersManager.getStickerSet({id, access_hash}).then((full) => {\n new PopupStickers(full.set).show();\n });\n }\n }, {listenerSetter: this.listenerSetter});\n\n appSidebarRight.toggleSidebar(true).then(() => {\n this.renderFeatured();\n });\n }\n\n public onCloseAfterTimeout() {\n this.setsDiv.innerHTML = '';\n animationIntersector.checkAnimations(undefined, 'STICKERS-SEARCH');\n return super.onCloseAfterTimeout();\n }\n\n public renderSet(set: StickerSet.stickerSet) {\n // console.log('renderSet:', set);\n const div = document.createElement('div');\n div.classList.add('sticker-set');\n\n const header = document.createElement('div');\n header.classList.add('sticker-set-header');\n\n const details = document.createElement('div');\n details.classList.add('sticker-set-details');\n details.innerHTML = `
`;\n\n setInnerHTML(details.firstElementChild, wrapEmojiText(set.title));\n\n const countDiv = document.createElement('div');\n countDiv.classList.add('sticker-set-count');\n countDiv.append(i18n('Stickers', [set.count]));\n details.append(countDiv);\n\n const button = document.createElement('button');\n button.classList.add('btn-primary', 'btn-color-primary', 'sticker-set-button');\n button.append(i18n(set.installed_date ? 'Stickers.SearchAdded' : 'Stickers.SearchAdd'));\n // button.style.width = set.installed_date ? '68px' : '52px';\n\n if(set.installed_date) {\n button.classList.add('gray');\n }\n\n // ripple(button);\n\n header.append(details, button);\n\n const stickersDiv = document.createElement('div');\n stickersDiv.classList.add('sticker-set-stickers');\n\n const count = Math.min(5, set.count);\n for(let i = 0; i < count; ++i) {\n const stickerDiv = document.createElement('div');\n stickerDiv.classList.add('sticker-set-sticker');\n\n stickersDiv.append(stickerDiv);\n }\n\n this.managers.appStickersManager.getStickerSet(set).then((set) => {\n // console.log('renderSet got set:', set);\n\n for(let i = 0; i < count; ++i) {\n const div = stickersDiv.children[i] as HTMLDivElement;\n const doc = set.documents[i];\n if(doc._ === 'documentEmpty') {\n continue;\n }\n\n wrapSticker({\n doc,\n div,\n lazyLoadQueue: this.lazyLoadQueue,\n group: 'STICKERS-SEARCH',\n /* play: false,\n loop: false, */\n play: true,\n loop: true,\n width: 68,\n height: 68,\n withLock: true\n });\n }\n });\n\n /* const onMouseOver = () => {\n const animations: AnimationItem['animation'][] = [];\n for(let i = 0; i < count; ++i) {\n const stickerDiv = stickersDiv.children[i] as HTMLElement;\n const animationItem = animationIntersector.getAnimation(stickerDiv);\n if(!animationItem) continue;\n\n const animation = animationItem.animation;\n\n animations.push(animation);\n animation.loop = true;\n animation.play();\n }\n\n div.addEventListener('mouseout', () => {\n animations.forEach((animation) => {\n animation.loop = false;\n });\n\n div.addEventListener('mouseover', onMouseOver, {once: true});\n }, {once: true});\n };\n\n div.addEventListener('mouseover', onMouseOver, {once: true}); */\n\n div.dataset.stickerSet = '' + set.id;\n div.dataset.access_hash = '' + set.access_hash;\n div.dataset.title = set.title;\n\n div.append(header, stickersDiv);\n\n this.setsDiv.append(div);\n }\n\n public renderFeatured() {\n return this.managers.appStickersManager.getFeaturedStickers().then((coveredSets) => {\n if(this.inputSearch.value) {\n return;\n }\n\n coveredSets = this.filterRendered('', coveredSets);\n coveredSets.forEach((set) => {\n this.renderSet(set.set);\n });\n });\n }\n\n private filterRendered(query: string, coveredSets: StickerSetCovered[]) {\n coveredSets = coveredSets.slice();\n\n const children = Array.from(this.setsDiv.children) as HTMLElement[];\n forEachReverse(children, el => {\n const id = el.dataset.stickerSet;\n const index = coveredSets.findIndex((covered) => covered.set.id === id);\n\n if(index !== -1) {\n coveredSets.splice(index, 1);\n } else if(!query || !el.dataset.title.toLowerCase().includes(query.toLowerCase())) {\n el.remove();\n }\n });\n\n animationIntersector.checkAnimations(undefined, 'STICKERS-SEARCH');\n\n return coveredSets;\n }\n\n public search(query: string) {\n if(!query) {\n return this.renderFeatured();\n }\n\n return this.managers.appStickersManager.searchStickerSets(query, false).then((coveredSets) => {\n if(this.inputSearch.value !== query) {\n return;\n }\n\n // console.log('search result:', coveredSets);\n\n coveredSets = this.filterRendered(query, coveredSets);\n coveredSets.forEach((set) => {\n this.renderSet(set.set);\n });\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport rootScope from '../../lib/rootScope';\nimport animationIntersector, {AnimationItemGroup} from '../animationIntersector';\nimport {horizontalMenu} from '../horizontalMenu';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport Scrollable, {ScrollableX} from '../scrollable';\nimport appSidebarRight from '../sidebarRight';\nimport StickyIntersector from '../stickyIntersector';\nimport EmojiTab from './tabs/emoji';\nimport GifsTab from './tabs/gifs';\nimport StickersTab, {EmoticonsTabC, StickersTabCategory} from './tabs/stickers';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport AppGifsTab from '../sidebarRight/tabs/gifs';\nimport AppStickersTab from '../sidebarRight/tabs/stickers';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport blurActiveElement from '../../helpers/dom/blurActiveElement';\nimport whichChild from '../../helpers/dom/whichChild';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport DropdownHover from '../../helpers/dropdownHover';\nimport pause from '../../helpers/schedulers/pause';\nimport {IS_APPLE_MOBILE} from '../../environment/userAgent';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport type LazyLoadQueueIntersector from '../lazyLoadQueueIntersector';\nimport {attachClickEvent, simulateClickEvent} from '../../helpers/dom/clickEvent';\nimport overlayCounter from '../../helpers/overlayCounter';\nimport noop from '../../helpers/noop';\nimport {FocusDirection, ScrollOptions} from '../../helpers/fastSmoothScroll';\nimport BezierEasing from '../../vendor/bezier-easing';\nimport RichInputHandler from '../../helpers/dom/richInputHandler';\nimport {getCaretPosF} from '../../helpers/dom/getCaretPosNew';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport {ChatRights} from '../../lib/appManagers/appChatsManager';\nimport {toastNew} from '../toast';\nimport {POSTING_NOT_ALLOWED_MAP} from '../chat/input';\n\nexport const EMOTICONSSTICKERGROUP: AnimationItemGroup = 'emoticons-dropdown';\n\nexport interface EmoticonsTab {\n content: HTMLElement;\n scrollable: Scrollable;\n menuScroll?: ScrollableX;\n tabId: number;\n init: () => void;\n onOpen?: () => void;\n onOpened?: () => void;\n onClose?: () => void;\n onClosed?: () => void;\n}\n\nconst easing = BezierEasing(0.42, 0.0, 0.58, 1.0);\nconst scrollOptions: Partial = {\n forceDuration: 200,\n transitionFunction: easing\n};\n\nexport class EmoticonsDropdown extends DropdownHover {\n public static lazyLoadQueue = new LazyLoadQueue(1);\n\n private emojiTab: EmojiTab;\n private stickersTab: StickersTab;\n private gifsTab: GifsTab;\n\n private container: HTMLElement;\n private tabsEl: HTMLElement;\n private tabId = -1;\n\n private tabs: {[id: number]: EmoticonsTab};\n\n private searchButton: HTMLElement;\n private deleteBtn: HTMLElement;\n\n private selectTab: ReturnType;\n\n private savedRange: Range;\n private managers: AppManagers;\n\n private rights: {[action in ChatRights]?: boolean};\n\n constructor() {\n super({\n element: document.getElementById('emoji-dropdown') as HTMLDivElement,\n ignoreOutClickClassName: 'input-message-input'\n });\n\n this.rights = {\n send_gifs: undefined,\n send_stickers: undefined\n };\n\n this.addEventListener('open', async() => {\n if(IS_TOUCH_SUPPORTED) {\n // appImManager.chat.input.saveScroll();\n if(blurActiveElement()) {\n await pause(100);\n }\n }\n\n if(this.element.parentElement !== appImManager.chat.input.chatInput) {\n appImManager.chat.input.chatInput.append(this.element);\n }\n\n this.savedRange = this.getGoodRange();\n\n EmoticonsDropdown.lazyLoadQueue.lock();\n // EmoticonsDropdown.lazyLoadQueue.unlock();\n animationIntersector.lockIntersectionGroup(EMOTICONSSTICKERGROUP);\n\n const tab = this.tab;\n tab.onOpen?.();\n });\n\n this.addEventListener('opened', () => {\n animationIntersector.unlockIntersectionGroup(EMOTICONSSTICKERGROUP);\n EmoticonsDropdown.lazyLoadQueue.unlockAndRefresh();\n\n // this.container.classList.remove('disable-hover');\n\n const tab = this.tab;\n tab.onOpened?.();\n });\n\n this.addEventListener('close', () => {\n EmoticonsDropdown.lazyLoadQueue.lock();\n // EmoticonsDropdown.lazyLoadQueue.lock();\n\n // нужно залочить группу и выключить стикеры\n animationIntersector.lockIntersectionGroup(EMOTICONSSTICKERGROUP);\n animationIntersector.checkAnimations(true, EMOTICONSSTICKERGROUP);\n\n const tab = this.tab;\n tab.onClose?.();\n });\n\n this.addEventListener('closed', () => {\n // теперь можно убрать visible, чтобы они не включились после фокуса\n animationIntersector.unlockIntersectionGroup(EMOTICONSSTICKERGROUP);\n EmoticonsDropdown.lazyLoadQueue.unlock();\n EmoticonsDropdown.lazyLoadQueue.refresh();\n\n // this.container.classList.remove('disable-hover');\n\n this.savedRange = undefined;\n\n const tab = this.tab;\n tab.onClosed?.();\n });\n }\n\n public get tab() {\n return this.tabs[this.tabId];\n }\n\n public init() {\n this.managers = rootScope.managers;\n this.emojiTab = new EmojiTab({managers: this.managers});\n this.stickersTab = new StickersTab(this.managers);\n this.gifsTab = new GifsTab(this.managers);\n\n this.tabs = {};\n [this.emojiTab, this.stickersTab, this.gifsTab].forEach((tab, idx) => {\n tab.tabId = idx;\n this.tabs[idx] = tab;\n });\n\n this.container = this.element.querySelector('.emoji-container .tabs-container') as HTMLDivElement;\n this.container.prepend(this.emojiTab.container, this.stickersTab.container);\n this.tabsEl = this.element.querySelector('.emoji-tabs') as HTMLUListElement;\n this.selectTab = horizontalMenu(this.tabsEl, this.container, this.onSelectTabClick, () => {\n const {tab} = this;\n tab.init?.();\n animationIntersector.checkAnimations(false, EMOTICONSSTICKERGROUP);\n });\n\n this.searchButton = this.element.querySelector('.emoji-tabs-search');\n this.searchButton.addEventListener('click', () => {\n if(this.tabId === this.stickersTab.tabId) {\n if(!appSidebarRight.isTabExists(AppStickersTab)) {\n appSidebarRight.createTab(AppStickersTab).open();\n }\n } else {\n if(!appSidebarRight.isTabExists(AppGifsTab)) {\n appSidebarRight.createTab(AppGifsTab).open();\n }\n }\n });\n\n this.deleteBtn = this.element.querySelector('.emoji-tabs-delete');\n attachClickEvent(this.deleteBtn, (e) => {\n cancelEvent(e);\n const input = appImManager.chat.input.messageInput;\n // RichInputHandler.getInstance().makeFocused(appImManager.chat.input.messageInput);\n let range = RichInputHandler.getInstance().getSavedRange(input);\n if(!range) {\n range = document.createRange();\n range.setStartAfter(input.lastChild);\n }\n\n const newRange = range.cloneRange();\n // if(range.endOffset === range.startOffset && range.endContainer === range.startContainer) {\n if(range.collapsed) {\n const {node, offset} = getCaretPosF(input, range.endContainer, range.endOffset);\n let newStartNode: Node;\n if(offset) {\n newStartNode = node;\n } else {\n newStartNode = node.previousSibling;\n if(!newStartNode) {\n return;\n }\n\n while(newStartNode.nodeType === newStartNode.TEXT_NODE && !newStartNode.nodeValue && (newStartNode = newStartNode.previousSibling)) {\n\n }\n\n if(newStartNode.nodeType === newStartNode.ELEMENT_NODE && !(newStartNode as HTMLElement).isContentEditable) {\n return;\n }\n }\n\n if(newStartNode.nodeType === newStartNode.ELEMENT_NODE && (newStartNode as any).tagName === 'IMG') {\n newRange.selectNode(newStartNode);\n } else {\n const text = [...newStartNode.textContent];\n let t: string;\n if(offset) {\n let length = 0;\n t = text.find((text) => (length += text.length, length >= offset));\n } else {\n t = text.pop() || '';\n }\n\n const newOffset = offset ? offset - t.length : newStartNode.textContent.length - t.length;\n newRange.setStart(newStartNode, newOffset);\n }\n }\n\n newRange.deleteContents();\n\n appImManager.chat.input.messageInputField.simulateInputEvent();\n // const selection = document.getSelection();\n // if(selection.isCollapsed) {\n // selection.modify('extend', 'backward', 'character');\n // }\n\n // selection.deleteFromDocument();\n // (document.activeElement as HTMLElement).blur();\n\n // document.execCommand('undo', false, null);\n // const input = appImManager.chat.input.messageInput;\n // if((input.lastChild as any)?.tagName) {\n // input.lastElementChild.remove();\n // } else if(input.lastChild) {\n // if(!input.lastChild.textContent.length) {\n // input.lastChild.remove();\n // } else {\n // input.lastChild.textContent = input.lastChild.textContent.slice(0, -1);\n // }\n // }\n\n // const event = new Event('input', {bubbles: true, cancelable: true});\n // appImManager.chat.input.messageInput.dispatchEvent(event);\n // // appSidebarRight.stickersTab.init();\n });\n\n const HIDE_EMOJI_TAB = IS_APPLE_MOBILE && false;\n\n const INIT_TAB_ID = HIDE_EMOJI_TAB ? this.stickersTab.tabId : this.emojiTab.tabId;\n\n if(HIDE_EMOJI_TAB) {\n (this.tabsEl.children[1] as HTMLElement).classList.add('hide');\n }\n\n simulateClickEvent(this.tabsEl.children[INIT_TAB_ID + 1] as HTMLElement);\n if(this.tabs[INIT_TAB_ID].init) {\n this.tabs[INIT_TAB_ID].init(); // onTransitionEnd не вызовется, т.к. это первая открытая вкладка\n }\n\n if(!IS_TOUCH_SUPPORTED) {\n let lastMouseMoveEvent: MouseEvent, mouseMoveEventAttached = false;\n const onMouseMove = (e: MouseEvent) => {\n lastMouseMoveEvent = e;\n };\n overlayCounter.addEventListener('change', (isActive) => {\n if(isActive) {\n if(!mouseMoveEventAttached) {\n document.body.addEventListener('mousemove', onMouseMove);\n mouseMoveEventAttached = true;\n }\n } else if(mouseMoveEventAttached) {\n document.body.removeEventListener('mousemove', onMouseMove);\n if(lastMouseMoveEvent) {\n this.onMouseOut(lastMouseMoveEvent);\n }\n }\n });\n }\n\n appImManager.addEventListener('peer_changing', () => {\n this.toggle(false);\n });\n appImManager.addEventListener('peer_changed', this.checkRights);\n this.checkRights();\n\n return super.init();\n }\n\n public getElement() {\n return this.element;\n }\n\n public scrollTo(tab: EmoticonsTab, element: HTMLElement) {\n tab.scrollable.scrollIntoViewNew({\n element: element as HTMLElement,\n axis: 'y',\n position: 'start',\n ...scrollOptions\n });\n }\n\n private onSelectTabClick = (id: number) => {\n if(this.tabId === id) {\n const {tab} = this;\n this.scrollTo(tab, tab.scrollable.container.firstElementChild as HTMLElement);\n return;\n }\n\n const rights: {[tabId: number]: ChatRights} = {\n [this.stickersTab.tabId]: 'send_stickers',\n [this.gifsTab.tabId]: 'send_gifs'\n };\n\n const action = rights[id];\n if(action && !this.rights[action]) {\n toastNew({langPackKey: POSTING_NOT_ALLOWED_MAP[action]});\n return false;\n }\n\n animationIntersector.checkAnimations(true, EMOTICONSSTICKERGROUP);\n\n this.tabId = id;\n this.searchButton.classList.toggle('hide', this.tabId === this.emojiTab.tabId);\n this.deleteBtn.classList.toggle('hide', this.tabId !== this.emojiTab.tabId);\n };\n\n private checkRights = async() => {\n const {peerId, threadId} = appImManager.chat;\n\n const actions = Object.keys(this.rights) as ChatRights[];\n\n const rights = await Promise.all(actions.map((action) => {\n return this.managers.appMessagesManager.canSendToPeer(peerId, threadId, action);\n }));\n\n actions.forEach((action, idx) => {\n this.rights[action] = rights[idx];\n });\n\n const active = this.tabsEl.querySelector('.active');\n if(active && whichChild(active) !== (this.emojiTab.tabId + 1) && (!this.rights['send_stickers'] || !this.rights['send_gifs'])) {\n this.selectTab(this.emojiTab.tabId, false);\n }\n };\n\n public static menuOnClick = (\n emoticons: EmoticonsTabC,\n menu: HTMLElement,\n scrollable: Scrollable,\n menuScroll?: ScrollableX,\n prevTab?: StickersTabCategory,\n listenerSetter?: ListenerSetter\n ) => {\n let jumpedTo = -1;\n\n const scrollToTab = (tab: typeof prevTab, f?: boolean) => {\n const m = tab.menuScroll || menuScroll;\n if(m) {\n m.scrollIntoViewNew({\n element: tab.elements.menuTab,\n position: 'center',\n axis: 'x',\n getElementPosition: f ? ({elementPosition}) => {\n return elementPosition - 106;\n } : undefined,\n ...scrollOptions\n });\n }\n };\n\n const setActive = (tab: typeof prevTab, scroll = true) => {\n if(tab === prevTab) {\n return false;\n }\n\n let f = false;\n if(prevTab) {\n prevTab.elements.menuTab.classList.remove('active');\n if(prevTab.menuScroll && prevTab.menuScroll !== tab.menuScroll) {\n f = true;\n // scroll to first\n prevTab.menuScroll.container.parentElement.classList.remove('active');\n prevTab.menuScroll.scrollIntoViewNew({\n element: prevTab.menuScroll.container.firstElementChild as HTMLElement,\n forceDirection: scroll ? undefined : FocusDirection.Static,\n position: 'center',\n axis: 'x',\n ...scrollOptions\n });\n }\n }\n\n tab.elements.menuTab.classList.add('active');\n\n if(tab.menuScroll) {\n tab.menuScroll.container.parentElement.classList.add('active');\n scroll && menuScroll.scrollIntoViewNew({\n element: tab.menuScroll.container.parentElement,\n position: 'center',\n axis: 'x',\n ...scrollOptions\n });\n }\n\n if(prevTab) {\n scrollToTab(tab, f);\n }\n\n prevTab = tab;\n\n return true;\n };\n\n const setActiveStatic = (tab: typeof prevTab) => {\n if(prevTab?.local) {\n return;\n }\n\n emoticons.scrollable.scrollTop = tab.elements.container.offsetTop + 1;\n const s = emoticons.menuScroll.container;\n const e = tab.elements.menuTab;\n s.scrollLeft = e.offsetLeft - s.clientWidth / 2 + e.offsetWidth / 2;\n setActive(tab, false);\n };\n\n let scrollingToContent = false;\n const stickyIntersector = new StickyIntersector(scrollable.container, (stuck, target) => {\n if(scrollingToContent) {\n return;\n }\n\n // console.log('sticky scrollTop', stuck, target, scrollable.container.scrollTop, jumpedTo);\n\n if(Math.abs(jumpedTo - scrollable.container.scrollTop) <= 1) {\n return;\n } else {\n jumpedTo = -1;\n }\n\n const tab = emoticons.getCategoryByContainer(target);\n const which = whichChild(target);\n if(!stuck && (which || tab.menuScroll)) {\n return;\n }\n\n setActive(tab);\n });\n\n attachClickEvent(menu, (e) => {\n let target = findUpClassName(e.target as HTMLElement, 'menu-horizontal-div-item');\n if(!target) {\n target = findUpClassName(e.target as HTMLElement, 'menu-horizontal-inner');\n if(!target || target.classList.contains('active')) {\n return;\n }\n\n target = target.firstElementChild.firstElementChild as HTMLElement;\n }\n\n const which = whichChild(target);\n\n const tab = emoticons.getCategoryByMenuTab(target);\n\n /* if(menuScroll) {\n menuScroll.scrollIntoView(target, false, 0);\n } */\n\n if(setActive(tab)) {\n // scrollToTab(tab);\n // return;\n }\n\n let offsetTop = 0, additionalOffset = 0;\n if(which > 0 || tab.menuScroll) {\n const element = tab.elements.container;\n additionalOffset = 1;\n offsetTop = element.offsetTop + additionalOffset; // * due to stickyIntersector\n }\n\n jumpedTo = offsetTop;\n\n scrollingToContent = true;\n scrollable.scrollIntoViewNew({\n element: offsetTop ? tab.elements.container : scrollable.container.firstElementChild,\n position: 'start',\n axis: 'y',\n getElementPosition: offsetTop ? ({elementPosition}) => elementPosition + additionalOffset : undefined,\n ...scrollOptions\n }).finally(() => {\n setActive(tab);\n scrollingToContent = false;\n });\n }, {listenerSetter});\n\n const a = scrollable.onAdditionalScroll ? scrollable.onAdditionalScroll.bind(scrollable) : noop;\n scrollable.onAdditionalScroll = () => {\n emoticons.content.parentElement.classList.toggle('scrolled-top', !scrollable.scrollTop);\n a();\n };\n\n return {stickyIntersector, setActive, setActiveStatic};\n };\n\n public static onMediaClick = async(e: {target: EventTarget | Element}, clearDraft = false, silent?: boolean) => {\n const target = findUpTag(e.target as HTMLElement, 'DIV');\n if(!target) return false;\n\n const docId = target.dataset.docId;\n if(!docId) return false;\n\n return this.sendDocId(docId, clearDraft, silent);\n };\n\n public static async sendDocId(docId: DocId, clearDraft?: boolean, silent?: boolean) {\n if(await appImManager.chat.input.sendMessageWithDocument(docId, undefined, clearDraft, silent)) {\n /* dropdown.classList.remove('active');\n toggleEl.classList.remove('active'); */\n if(emoticonsDropdown.container) {\n emoticonsDropdown.forceClose = true;\n // emoticonsDropdown.container.classList.add('disable-hover');\n emoticonsDropdown.toggle(false);\n }\n\n return true;\n } else {\n console.warn('got no doc by id:', docId);\n return false;\n }\n }\n\n public addLazyLoadQueueRepeat(lazyLoadQueue: LazyLoadQueueIntersector, processInvisibleDiv: (div: HTMLElement) => void) {\n this.addEventListener('close', () => {\n lazyLoadQueue.lock();\n });\n\n this.addEventListener('closed', () => {\n const divs = lazyLoadQueue.intersector.getVisible();\n\n for(const div of divs) {\n processInvisibleDiv(div);\n }\n\n lazyLoadQueue.intersector.clearVisible();\n });\n\n this.addEventListener('opened', () => {\n lazyLoadQueue.unlockAndRefresh();\n });\n }\n\n public getSavedRange() {\n return this.getGoodRange() || this.savedRange;\n }\n\n private getGoodRange() {\n const sel = document.getSelection();\n if(sel.rangeCount && document.activeElement === appImManager.chat.input.messageInput) {\n return sel.getRangeAt(0);\n }\n }\n}\n\nconst emoticonsDropdown = new EmoticonsDropdown();\nMOUNT_CLASS_TO.emoticonsDropdown = emoticonsDropdown;\nexport default emoticonsDropdown;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport emoticonsDropdown, {EmoticonsDropdown, EMOTICONSSTICKERGROUP} from '..';\nimport cancelEvent from '../../../helpers/dom/cancelEvent';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport {fastRaf} from '../../../helpers/schedulers';\nimport pause from '../../../helpers/schedulers/pause';\nimport appImManager from '../../../lib/appManagers/appImManager';\nimport {LangPackKey} from '../../../lib/langPack';\nimport rootScope from '../../../lib/rootScope';\nimport {emojiFromCodePoints} from '../../../vendor/emoji';\nimport {putPreloader} from '../../putPreloader';\nimport Scrollable, {ScrollableX} from '../../scrollable';\nimport IS_EMOJI_SUPPORTED from '../../../environment/emojiSupport';\nimport IS_TOUCH_SUPPORTED from '../../../environment/touchSupport';\nimport blurActiveElement from '../../../helpers/dom/blurActiveElement';\nimport Emoji from '../../../config/emoji';\nimport fixEmoji from '../../../lib/richTextProcessor/fixEmoji';\nimport wrapEmojiText from '../../../lib/richTextProcessor/wrapEmojiText';\nimport wrapSingleEmoji from '../../../lib/richTextProcessor/wrapSingleEmoji';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport {EmoticonsTabC, StickersTabCategory} from './stickers';\nimport {makeMediaSize} from '../../../helpers/mediaSize';\nimport {AppManagers} from '../../../lib/appManagers/managers';\nimport VisibilityIntersector, {OnVisibilityChangeItem} from '../../visibilityIntersector';\nimport mediaSizes from '../../../helpers/mediaSizes';\nimport wrapStickerSetThumb from '../../wrappers/stickerSetThumb';\nimport attachStickerViewerListeners from '../../stickerViewer';\nimport ListenerSetter from '../../../helpers/listenerSetter';\nimport {Document, StickerSet} from '../../../layer';\nimport {CustomEmojiElement, CustomEmojiRendererElement} from '../../../lib/richTextProcessor/wrapRichText';\nimport findAndSplice from '../../../helpers/array/findAndSplice';\nimport positionElementByIndex from '../../../helpers/dom/positionElementByIndex';\nimport PopupStickers from '../../popups/stickers';\nimport {hideToast, toastNew} from '../../toast';\nimport safeAssign from '../../../helpers/object/safeAssign';\nimport type {AppStickersManager} from '../../../lib/appManagers/appStickersManager';\nimport liteMode from '../../../helpers/liteMode';\n\nconst loadedURLs: Set = new Set();\nexport function appendEmoji(emoji: string, container?: HTMLElement, prepend = false, unify = false) {\n // const emoji = details.unified;\n // const emoji = (details.unified as string).split('-')\n // .reduce((prev, curr) => prev + String.fromCodePoint(parseInt(curr, 16)), '');\n\n const spanEmoji = document.createElement('span');\n spanEmoji.classList.add('super-emoji');\n\n let kek: DocumentFragment;\n if(unify && !IS_EMOJI_SUPPORTED) {\n kek = wrapSingleEmoji(emoji);\n } else {\n emoji = fixEmoji(emoji);\n kek = wrapEmojiText(emoji);\n }\n\n /* if(!kek.includes('emoji')) {\n console.log(emoji, kek, spanEmoji, emoji.length, new TextEncoder().encode(emoji), emojiUnicode(emoji));\n return;\n } */\n\n // console.log(kek);\n\n spanEmoji.append(kek);\n\n if(spanEmoji.children.length > 1) {\n const first = spanEmoji.firstElementChild;\n spanEmoji.innerHTML = '';\n spanEmoji.append(first);\n }\n\n if(spanEmoji.firstElementChild?.tagName === 'IMG') {\n const image = spanEmoji.firstElementChild as HTMLImageElement;\n\n const url = image.src;\n if(!loadedURLs.has(url)) {\n image.setAttribute('loading', 'lazy');\n const placeholder = document.createElement('span');\n placeholder.classList.add('emoji-placeholder');\n\n if(liteMode.isAvailable('animations')) {\n image.style.opacity = '0';\n placeholder.style.opacity = '1';\n }\n\n image.addEventListener('load', () => {\n fastRaf(() => {\n if(liteMode.isAvailable('animations')) {\n image.style.opacity = '';\n placeholder.style.opacity = '';\n }\n\n spanEmoji.classList.remove('empty');\n\n loadedURLs.add(url);\n });\n }, {once: true});\n\n spanEmoji.append(placeholder);\n }\n }\n\n // spanEmoji = spanEmoji.firstElementChild as HTMLSpanElement;\n // spanEmoji.setAttribute('emoji', emoji);\n if(container) {\n if(prepend) container.prepend(spanEmoji);\n else container.appendChild(spanEmoji);\n }\n\n return spanEmoji;\n}\n\nexport function getEmojiFromElement(element: HTMLElement): {docId?: DocId, emoji: string} {\n const superEmoji = findUpClassName(element, 'super-emoji');\n if(!superEmoji) return;\n\n const firstElementChild = superEmoji.firstElementChild as HTMLElement;\n if(firstElementChild && firstElementChild.classList.contains('custom-emoji')) {\n return {emoji: firstElementChild.dataset.stickerEmoji, docId: firstElementChild.dataset.docId} as const;\n } else {\n if(element.nodeType === element.TEXT_NODE) return {emoji: element.nodeValue};\n if(element.tagName === 'SPAN' && !element.classList.contains('emoji') && element.firstElementChild) {\n element = element.firstElementChild as HTMLElement;\n }\n\n return {emoji: element.getAttribute('alt') || element.innerText} as const;\n }\n}\n\nconst EMOJI_RECENT_ID: (typeof EMOJI_CATEGORIES)[0][0] = 'Emoji.Recent';\nconst EMOJI_RECENT_CATEGORY: (typeof EMOJI_CATEGORIES)[0] = [EMOJI_RECENT_ID, 'recent'];\nconst CUSTOM_EMOJI_RECENT_ID: (typeof EMOJI_CATEGORIES)[0][0] = '';\nconst CUSTOM_EMOJI_RECENT_CATEGORY: (typeof EMOJI_CATEGORIES)[0] = [CUSTOM_EMOJI_RECENT_ID, ''];\nconst EMOJI_CATEGORIES: [LangPackKey | '', string][] = [\n ['Emoji.SmilesAndPeople', 'smile'],\n ['Emoji.AnimalsAndNature', 'animals'],\n ['Emoji.FoodAndDrink', 'eats'],\n ['Emoji.TravelAndPlaces', 'car'],\n ['Emoji.ActivityAndSport', 'sport'],\n ['Emoji.Objects', 'lamp'],\n // ['Emoji.Symbols', 'info'],\n ['Emoji.Flags', 'flag'],\n ['Skin Tones' as any, '']\n];\n\nlet sorted: Map<(typeof EMOJI_CATEGORIES)[0], string[]>;\nfunction prepare() {\n if(sorted) {\n return sorted;\n }\n\n const a: Array<[(typeof EMOJI_CATEGORIES)[0], string[]]> = [\n [CUSTOM_EMOJI_RECENT_CATEGORY, []],\n [EMOJI_RECENT_CATEGORY, []]\n ];\n\n sorted = new Map(a);\n for(const emoji in Emoji) {\n const details = Emoji[emoji];\n const i = '' + details;\n const category = EMOJI_CATEGORIES[+i[0] - 1];\n if(!category) continue; // maybe it's skin tones\n\n let s = sorted.get(category);\n if(!s) {\n s = [];\n sorted.set(category, s);\n }\n\n s[+i.slice(1) || 0] = emoji;\n }\n\n sorted.delete(EMOJI_CATEGORIES.pop());\n EMOJI_CATEGORIES.unshift(CUSTOM_EMOJI_RECENT_CATEGORY, EMOJI_RECENT_CATEGORY);\n const order = EMOJI_CATEGORIES.map(([id]) => id);\n const entries = [...sorted.entries()].sort((a, b) => order.indexOf(a[0][0]) - order.indexOf(b[0][0]));\n sorted = new Map(entries);\n\n return sorted;\n}\n\nconst EMOJI_ELEMENT_SIZE = makeMediaSize(42, 42);\nconst RECENT_MAX_LENGTH = 32;\n\ntype EmojiTabItem = {element: HTMLElement} & ReturnType;\ntype EmojiTabCategory = StickersTabCategory;\nexport default class EmojiTab extends EmoticonsTabC {\n private closeScrollTop: number;\n private menuInnerScroll: ScrollableX;\n private isStandalone?: boolean;\n private noRegularEmoji?: boolean;\n private stickerSetId?: Parameters[0];\n private onClick: (emoji: EmojiTabItem) => void;\n private activeEmoji: ReturnType;\n private activeElements: EmojiTabItem[];\n\n constructor(options: {\n managers: AppManagers,\n isStandalone?: boolean,\n noRegularEmoji?: boolean,\n stickerSetId?: EmojiTab['stickerSetId'],\n onClick?: EmojiTab['onClick']\n }) {\n super(\n options.managers,\n 'super-emojis',\n () => EMOJI_ELEMENT_SIZE,\n 16,\n 4,\n 0\n );\n\n safeAssign(this, options);\n this.container.classList.add('emoji-padding');\n this.content.id = 'content-emoji';\n this.activeElements = [];\n }\n\n private onCategoryVisibility = ({target, visible}: Pick) => {\n const category = this.categoriesMap.get(target);\n // console.log(target, visible, category);\n // if(category.local) return;\n\n const renderer = category.elements.renderer;\n const newChildren: HTMLElement[] = [];\n if(renderer) {\n newChildren.push(renderer);\n const customEmojis: Parameters[0] = new Map();\n if(visible) {\n newChildren.push(...category.items.map(({docId, element}) => {\n if(!docId) {\n return element;\n }\n\n // return element;\n\n // if(element.firstElementChild) {\n // return element;\n // }\n\n const customEmojiElement = element.firstElementChild as CustomEmojiElement;\n customEmojiElement.clear(false);\n // const customEmojiElement = CustomEmojiElement.create(document.id);\n customEmojis.set(customEmojiElement.docId, new Set([customEmojiElement]));\n // element.append(customEmojiElement);\n return element;\n }));\n\n renderer.add(customEmojis/* , EmoticonsDropdown.lazyLoadQueue */, undefined, undefined, false);\n } else {\n renderer.clearCanvas();\n renderer.middlewareHelper.clean();\n }\n } else if(visible) {\n newChildren.push(...category.items.map(({element}) => element));\n }\n\n // if(visible)\n category.elements.items.replaceChildren(...newChildren);\n\n if(renderer && !visible) {\n const customEmojis: Parameters[0] = new Map();\n category.items.forEach(({docId, element}) => {\n if(!docId) {\n return;\n }\n\n const customEmojiElement = element.firstElementChild as CustomEmojiElement;\n customEmojiElement.clear();\n customEmojis.set(customEmojiElement.docId, new Set([customEmojiElement]));\n });\n\n /* const promise = */renderer.add(customEmojis/* , EmoticonsDropdown.lazyLoadQueue */, undefined, true);\n // promise.then(() => {\n // customEmojis.forEach((elements) => {\n // elements.forEach((element) => {\n // if(!element.innerHTML) {\n // console.log('no thumb', element);\n // // debugger;\n // }\n // });\n // });\n\n // const set = customEmojis.get('5766933926429854499');\n // console.log(`wrapped ${customEmojis.size} thumbs`, set && set.values().next().value.innerHTML);\n // });\n }\n\n // if(!visible) {\n // const customEmojis: Parameters[0] = {};\n // category.items.forEach((item) => {\n // const {element, document} = item;\n // if(!element.firstElementChild) {\n // return;\n // }\n\n // const customEmojiElement = CustomEmojiElement.create(document.id);\n // customEmojis[customEmojiElement.docId] = new Set([customEmojiElement]);\n // element.firstElementChild.replaceWith(customEmojiElement);\n // });\n\n // renderer.add(customEmojis, EmoticonsDropdown.lazyLoadQueue);\n // }\n };\n\n public destroy() {\n super.destroy();\n this.menuInnerScroll?.destroy();\n }\n\n public init() {\n super.init();\n this.init = undefined;\n\n const intersectionOptions: IntersectionObserverInit = {\n root: this.isStandalone ? this.content : emoticonsDropdown.getElement()\n };\n\n this.categoriesIntersector = new VisibilityIntersector(this.onCategoryVisibility, intersectionOptions);\n\n this.menuOnClickResult = EmoticonsDropdown.menuOnClick(this, this.menu, this.scrollable, this.menuScroll, undefined, this.listenerSetter);\n\n const preloader = putPreloader(this.content, true);\n\n let innerScrollWrapper: HTMLElement;\n\n if(!this.isStandalone) {\n const x = this.menuInnerScroll = new ScrollableX(undefined);\n x.container.classList.add('menu-horizontal-inner-scroll');\n\n innerScrollWrapper = document.createElement('div');\n innerScrollWrapper.classList.add('menu-horizontal-inner');\n innerScrollWrapper.append(x.container);\n }\n\n let preparedMap: ReturnType;\n prepare();\n if(!this.noRegularEmoji) {\n preparedMap = prepare();\n } else {\n preparedMap = new Map([\n [[CUSTOM_EMOJI_RECENT_CATEGORY[0], 'recent'], []]\n // [EMOJI_RECENT_CATEGORY, []]\n ]);\n }\n\n preparedMap.forEach((emojis, [titleLangPackKey, icon]) => {\n const category = this.createLocalCategory(titleLangPackKey, titleLangPackKey, icon, !icon);\n category.elements.container.classList.remove('hide');\n category.elements.items.classList.add(icon && !this.isStandalone ? 'is-local' : 'not-local');\n\n emojis.forEach((unified) => {\n /* if(emojiUnicode(emoji) === '1f481-200d-2642') {\n console.log('append emoji', emoji, emojiUnicode(emoji));\n } */\n\n const emoji = emojiFromCodePoints(unified);\n // if(emoji.includes('🕵')) {\n // console.log('toCodePoints', toCodePoints(emoji));\n // emoji = emoji.replace(/(\\u200d[\\u2640\\u2642\\u2695])(?!\\ufe0f)/, '\\ufe0f$1');\n // const zwjIndex = emoji.indexOf('\\u200d');\n // if(zwjIndex !== -1 && !emoji.includes('\\ufe0f')) {\n // /* if(zwjIndex !== (emoji.length - 1)) {\n // emoji = emoji.replace(/(\\u200d)/g, '\\ufe0f$1');\n // } */\n\n // emoji += '\\ufe0f';\n // //emoji += '\\ufe0f';\n // }\n\n // debugger;\n // }\n\n this.addEmojiToCategory({\n category,\n emoji: {emoji},\n batch: true\n });\n\n /* if(category === 'Smileys & Emotion') {\n console.log('appended emoji', emoji, itemsDiv.children[itemsDiv.childElementCount - 1].innerHTML, emojiUnicode(emoji));\n } */\n });\n });\n\n const promise = Promise.all([\n this.isStandalone ? undefined : pause(200),\n !this.noRegularEmoji && this.managers.appEmojiManager.getRecentEmojis('native'),\n !this.isStandalone && this.managers.appEmojiManager.getRecentEmojis('custom'),\n this.stickerSetId && this.managers.appStickersManager.getLocalStickerSet(this.stickerSetId),\n this.managers.appEmojiManager.getCustomEmojis()\n ]).then(([_, recent, recentCustom, mainSet, sets]) => {\n preloader.remove();\n\n if(mainSet) {\n recentCustom = mainSet.documents.map((doc) => doc.id);\n }\n\n const recentCategory = this.categories[EMOJI_RECENT_ID];\n const recentCustomCategory = this.categories[CUSTOM_EMOJI_RECENT_ID];\n\n if(!this.isStandalone) {\n const a = [\n recentCategory && [recentCategory, recent] as const,\n recentCustomCategory && [recentCustomCategory, recentCustom] as const\n ];\n\n a.filter(Boolean).forEach(([category, recent]) => {\n category.limit = RECENT_MAX_LENGTH;\n recent.splice(RECENT_MAX_LENGTH, recent.length - RECENT_MAX_LENGTH);\n });\n }\n\n if(recentCategory && recent) for(const emoji of recent) {\n this.addEmojiToCategory({\n category: recentCategory,\n emoji: {emoji},\n batch: true\n });\n }\n\n if(recentCustomCategory) {\n this.createRendererForCategory(recentCustomCategory);\n if(recentCustom) for(const docId of recentCustom) {\n this.addEmojiToCategory({\n category: recentCustomCategory,\n emoji: {emoji: '', docId},\n batch: true\n });\n }\n recentCustomCategory.elements.container.style.paddingTop = '.5rem';\n }\n\n EMOJI_CATEGORIES.forEach(([id]) => {\n const category = this.categories[id];\n if(!category) {\n return;\n }\n\n this.toggleLocalCategory(category, true);\n\n if(id !== EMOJI_RECENT_ID && id !== CUSTOM_EMOJI_RECENT_ID) {\n category.menuScroll = this.menuInnerScroll;\n this.menuInnerScroll.container.append(category.elements.menuTab);\n }\n });\n\n this.resizeCategories();\n\n recentCategory && innerScrollWrapper && recentCategory.elements.menuTab.after(innerScrollWrapper);\n\n sets.sets.forEach((set) => {\n this.renderStickerSet(set);\n });\n\n this.listenerSetter.add(rootScope)('premium_toggle', () => {\n this.toggleCustomCategory();\n });\n\n this.listenerSetter.add(rootScope)('stickers_top', this.postponedEvent((id) => {\n const category = this.categories[id];\n if(!category) {\n return;\n }\n\n this.positionCategory(category, true);\n\n this.listenerSetter.add(emoticonsDropdown)('openAfterLayout', () => {\n this.menuOnClickResult.setActiveStatic(category);\n }, {once: true});\n }));\n\n const toggleRenderers = (ignore: boolean) => {\n for(const id in this.categories) {\n const category = this.categories[id];\n const renderer = category.elements.renderer;\n if(renderer) {\n renderer.ignoreSettingDimensions = ignore;\n if(!ignore) {\n renderer.setDimensionsFromRect(undefined, true);\n }\n }\n }\n };\n\n !this.isStandalone && this.listenerSetter.add(emoticonsDropdown)('opened', () => {\n toggleRenderers(false);\n });\n\n !this.isStandalone && this.listenerSetter.add(emoticonsDropdown)('close', () => {\n toggleRenderers(true);\n });\n\n this.listenerSetter.add(rootScope)('stickers_installed', (set) => {\n if(!this.categories[set.id] && set.pFlags.emojis) {\n this.renderStickerSet(set, true);\n }\n });\n\n this.listenerSetter.add(rootScope)('stickers_deleted', (set) => {\n const category = this.categories[set.id];\n if(this.deleteCategory(category)) {\n const {renderer} = category.elements;\n if(renderer) {\n renderer.middlewareHelper.clean();\n }\n }\n });\n\n !this.isStandalone && this.listenerSetter.add(rootScope)('emoji_recent', this.postponedEvent((emoji) => {\n const category = this.categories[emoji.docId ? CUSTOM_EMOJI_RECENT_ID : EMOJI_RECENT_ID];\n if(!category) {\n return;\n }\n\n const verify: (item: EmojiTabItem) => boolean = emoji.docId ?\n (item) => item.docId === emoji.docId :\n (item) => item.emoji === emoji.emoji;\n const found = findAndSplice(category.items, verify);\n if(found) {\n category.items.unshift(found);\n if(this.isCategoryVisible(category)) {\n const {renderer} = category.elements;\n positionElementByIndex(found.element, category.elements.items, renderer ? 1 : 0, -1);\n renderer?.forceRender();\n }\n } else {\n this.addEmojiToCategory({\n category,\n emoji,\n batch: false,\n prepend: true\n });\n }\n\n if(this.closeScrollTop === 0) {\n this.menuOnClickResult.setActive(emoji.docId ? this.categories[EMOJI_RECENT_ID] : category);\n }\n }));\n\n !this.isStandalone && this.listenerSetter.add(appImManager)('peer_changed', () => {\n this.toggleCustomCategory();\n });\n\n this.toggleCustomCategory();\n\n this.menuOnClickResult.setActive(recentCategory ?? recentCustomCategory);\n });\n\n attachClickEvent(this.content, this.onContentClick, {listenerSetter: this.listenerSetter});\n attachStickerViewerListeners({listenTo: this.content, listenerSetter: this.listenerSetter});\n\n return promise;\n }\n\n private renderStickerSet(set: StickerSet.stickerSet, prepend?: boolean) {\n const category = this.createCategory(set, wrapEmojiText(set.title));\n this.positionCategory(category, prepend);\n const {container, menuTabPadding} = category.elements;\n category.elements.items.classList.add('not-local');\n category.elements.container.classList.add('is-premium-set');\n category.elements.title.classList.add('tgico');\n\n this.createRendererForCategory(category);\n\n const promise = this.managers.appStickersManager.getStickerSet(set);\n promise.then(({documents}) => {\n documents.forEach((document) => {\n this.addEmojiToCategory({\n category,\n emoji: {docId: document.id, emoji: (document as Document.document).stickerEmojiRaw},\n batch: true\n });\n });\n\n // if(this.isCategoryVisible(category)) {\n // category.elements.items.append(...category.items.map(({element}) => element));\n // }\n\n this.onCategoryVisibility({target: category.elements.container, visible: this.isCategoryVisible(category)});\n\n category.setCategoryItemsHeight();\n container.classList.remove('hide');\n });\n\n wrapStickerSetThumb({\n set,\n container: menuTabPadding,\n group: EMOTICONSSTICKERGROUP,\n lazyLoadQueue: EmoticonsDropdown.lazyLoadQueue,\n width: 32,\n height: 32,\n autoplay: false\n });\n }\n\n private get peerId() {\n return appImManager.chat.peerId;\n }\n\n public getCustomCategory() {\n return this.categories[CUSTOM_EMOJI_RECENT_ID];\n }\n\n private toggleCustomCategory() {\n const category = this.categories[CUSTOM_EMOJI_RECENT_ID];\n const hasPremium = rootScope.premium || this.peerId === rootScope.myId;\n const canSeeCustomCategory = hasPremium || this.isStandalone;\n super.toggleLocalCategory(category, !!category.items.length && canSeeCustomCategory);\n this.content.classList.toggle('has-premium', hasPremium);\n }\n\n protected toggleLocalCategory(category: EmojiTabCategory, visible: boolean) {\n if(category.id === CUSTOM_EMOJI_RECENT_ID) {\n this.toggleCustomCategory();\n return;\n }\n\n super.toggleLocalCategory(category, visible);\n }\n\n private createRendererForCategory(category: EmojiTabCategory) {\n const renderer = CustomEmojiRendererElement.create({\n animationGroup: EMOTICONSSTICKERGROUP,\n customEmojiSize: mediaSizes.active.esgCustomEmoji\n });\n\n category.elements.renderer = renderer;\n category.elements.items.append(renderer);\n }\n\n public addEmojiToCategory(options: {\n category: EmojiTabCategory,\n emoji?: ReturnType,\n element?: HTMLElement,\n batch?: boolean,\n prepend?: boolean,\n active?: boolean\n }) {\n const {category, emoji, batch, prepend} = options;\n let element = options.element;\n if(element) {\n const spanEmoji = document.createElement('span');\n spanEmoji.classList.add('super-emoji');\n spanEmoji.append(element);\n element = spanEmoji;\n } else if(emoji.docId) {\n const customEmojiElement = CustomEmojiElement.create(emoji.docId);\n const span = document.createElement('span');\n span.classList.add(/* 'emoji', */'super-emoji');\n span.append(customEmojiElement);\n element = span;\n } else {\n element = appendEmoji(emoji.emoji/* .replace(/[\\ufe0f\\u2640\\u2642\\u2695]/g, '') */, undefined, false/* , false */);\n }\n\n const item: typeof category['items'][0] = {\n ...(emoji || {emoji: undefined}),\n element\n };\n\n if(\n options.active || (\n this.activeEmoji && (\n item.docId ?\n this.activeEmoji.docId === item.docId :\n this.activeEmoji.emoji === item.emoji\n )\n )\n ) {\n this.activeEmoji === emoji;\n this.activeElements.push(item);\n element.classList.add('active');\n }\n\n category.items[prepend ? 'unshift' : 'push'](item);\n if(!batch && !this.spliceExceed(category)) {\n this.onLocalCategoryUpdate(category);\n }\n }\n\n // private addEmojisToCategory(category: EmojiTabCategory, emojis: string[], prepend?: boolean) {\n // emojis.forEach((emoji) => {\n // this.addEmojiToCategory(category, emoji, true, prepend);\n // });\n\n // this.onLocalCategoryUpdate(category);\n // }\n\n private onContentClick = (e: MouseEvent) => {\n cancelEvent(e);\n\n const {target} = e;\n\n const container = findUpClassName(target, 'emoji-category');\n const category = this.categoriesMap.get(container);\n if(findUpClassName(target, 'category-title')) {\n if(category.local) {\n return;\n }\n\n new PopupStickers({id: category.set.id, access_hash: category.set.access_hash}, true).show();\n return;\n }\n\n const emoji = getEmojiFromElement(target as HTMLElement);\n if(!emoji) {\n return;\n }\n\n if(\n emoji.docId &&\n !rootScope.premium && (\n this.isStandalone ? category.id !== CUSTOM_EMOJI_RECENT_ID : this.peerId !== rootScope.myId\n )\n ) {\n const a = document.createElement('a');\n a.onclick = () => {\n appImManager.openPremiumBot();\n hideToast();\n };\n toastNew({\n langPackKey: 'CustomEmoji.PremiumAlert',\n langPackArguments: [a]\n });\n return;\n }\n\n if(this.onClick) {\n this.onClick({\n ...emoji,\n element: findUpClassName(target, 'super-emoji').firstElementChild as HTMLElement\n });\n } else {\n appImManager.chat.input.onEmojiSelected(emoji, false);\n }\n\n if(IS_TOUCH_SUPPORTED) {\n blurActiveElement();\n }\n };\n\n public setActive(emoji: ReturnType) {\n if(\n emoji === this.activeEmoji ||\n emoji?.docId ? emoji.docId === this.activeEmoji?.docId : emoji?.emoji === this.activeEmoji?.emoji\n ) {\n return;\n }\n\n this.activeEmoji = emoji;\n\n this.activeElements.forEach((item) => {\n item.element.classList.remove('active');\n });\n\n this.activeElements.length = 0;\n\n this.categoriesMap.forEach((category) => {\n category.items.forEach((item) => {\n if(emoji.docId ? item.docId === emoji.docId : item.emoji === emoji.emoji) {\n item.element.classList.add('active');\n this.activeElements.push(item);\n }\n });\n });\n }\n\n public onClose() {\n this.closeScrollTop = this.scrollable.scrollTop;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport getEmojiEntityFromEmoji from './getEmojiEntityFromEmoji';\nimport wrapRichText from './wrapRichText';\n\nexport default function wrapSingleEmoji(emoji: string) {\n return wrapRichText(emoji, {\n entities: [getEmojiEntityFromEmoji(emoji)]\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport indexOfAndSplice from '../helpers/array/indexOfAndSplice';\nimport LazyLoadQueueIntersector, {LazyLoadElement} from './lazyLoadQueueIntersector';\nimport VisibilityIntersector, {OnVisibilityChange} from './visibilityIntersector';\n\nexport default class LazyLoadQueueRepeat extends LazyLoadQueueIntersector {\n private elementsMap: Map = new Map();\n\n constructor(\n parallelLimit?: number,\n protected onVisibilityChange?: OnVisibilityChange,\n options?: IntersectionObserverInit\n ) {\n super(parallelLimit);\n\n this.intersector = new VisibilityIntersector((item) => {\n const {target, visible} = item;\n\n const queueItem = this.elementsMap.get(target);\n queueItem.visible = visible;\n\n if(visible) {\n queueItem.wasSeen = true;\n if(!this.queue.includes(queueItem)) {\n this.queue.push(queueItem);\n }\n } else {\n indexOfAndSplice(this.queue, queueItem);\n }\n\n this.onVisibilityChange?.(item);\n this.setProcessQueueTimeout();\n }, options);\n }\n\n public clear() {\n super.clear();\n this.elementsMap.clear();\n }\n\n /* public async processItem(item: LazyLoadElement) {\n //await super.processItem(item);\n await LazyLoadQueueBase.prototype.processItem.call(this, item);\n\n if(this.lazyLoadMedia.length) {\n this.processQueue();\n }\n } */\n\n public observe(el: LazyLoadElement) {\n this.elementsMap.set(el.div, el);\n super.observe(el);\n }\n\n public unobserve(el: LazyLoadElement) {\n this.elementsMap.delete(el.div);\n super.unobserve(el);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport emoticonsDropdown, {EmoticonsDropdown, EMOTICONSSTICKERGROUP, EmoticonsTab} from '..';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport mediaSizes from '../../../helpers/mediaSizes';\nimport {Document, MessagesAllStickers, StickerSet} from '../../../layer';\nimport {MyDocument} from '../../../lib/appManagers/appDocsManager';\nimport {AppManagers} from '../../../lib/appManagers/managers';\nimport {i18n, LangPackKey} from '../../../lib/langPack';\nimport wrapEmojiText from '../../../lib/richTextProcessor/wrapEmojiText';\nimport rootScope from '../../../lib/rootScope';\nimport animationIntersector, {AnimationItemGroup} from '../../animationIntersector';\nimport LazyLoadQueue from '../../lazyLoadQueue';\nimport LazyLoadQueueRepeat from '../../lazyLoadQueueRepeat';\nimport {putPreloader} from '../../putPreloader';\nimport PopupStickers from '../../popups/stickers';\nimport Scrollable, {ScrollableX} from '../../scrollable';\nimport findAndSplice from '../../../helpers/array/findAndSplice';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport positionElementByIndex from '../../../helpers/dom/positionElementByIndex';\nimport noop from '../../../helpers/noop';\nimport ButtonIcon from '../../buttonIcon';\nimport confirmationPopup from '../../confirmationPopup';\nimport VisibilityIntersector, {OnVisibilityChangeItem} from '../../visibilityIntersector';\nimport createStickersContextMenu from '../../../helpers/dom/createStickersContextMenu';\nimport findUpAsChild from '../../../helpers/dom/findUpAsChild';\nimport forEachReverse from '../../../helpers/array/forEachReverse';\nimport attachStickerViewerListeners from '../../stickerViewer';\nimport ListenerSetter from '../../../helpers/listenerSetter';\nimport wrapSticker from '../../wrappers/sticker';\nimport wrapStickerSetThumb from '../../wrappers/stickerSetThumb';\nimport {MediaSize} from '../../../helpers/mediaSize';\nimport {AnyFunction} from '../../../types';\nimport {IgnoreMouseOutType} from '../../../helpers/dropdownHover';\nimport customProperties from '../../../helpers/dom/customProperties';\nimport windowSize from '../../../helpers/windowSize';\n\nexport class SuperStickerRenderer {\n public lazyLoadQueue: LazyLoadQueueRepeat;\n private animated: Set = new Set();\n\n constructor(\n private regularLazyLoadQueue: LazyLoadQueue,\n private group: AnimationItemGroup,\n private managers: AppManagers,\n private options?: IntersectionObserverInit\n ) {\n this.lazyLoadQueue = new LazyLoadQueueRepeat(undefined, ({target, visible}) => {\n if(!visible) {\n this.processInvisible(target);\n }\n }, options);\n }\n\n public clear() {\n this.lazyLoadQueue.clear();\n }\n\n public renderSticker(doc: MyDocument, element?: HTMLElement, loadPromises?: Promise[]) {\n if(!element) {\n element = document.createElement('div');\n element.classList.add('grid-item', 'super-sticker');\n element.dataset.docId = '' + doc.id;\n\n if(doc.animated) {\n this.observeAnimated(element);\n }\n }\n\n // * This will wrap only a thumb\n /* !doc.animated && */wrapSticker({\n doc,\n div: element,\n lazyLoadQueue: this.regularLazyLoadQueue,\n group: this.group,\n onlyThumb: doc.animated,\n loadPromises\n });\n\n return element;\n }\n\n public observeAnimated(element: HTMLElement) {\n this.animated.add(element);\n this.lazyLoadQueue.observe({\n div: element,\n load: this.processVisible\n });\n }\n\n public unobserveAnimated(element: HTMLElement) {\n this.animated.delete(element);\n this.lazyLoadQueue.delete({div: element});\n }\n\n private checkAnimationContainer = (element: HTMLElement, visible: boolean) => {\n // console.error('checkAnimationContainer', div, visible);\n const players = animationIntersector.getAnimations(element);\n players.forEach((player) => {\n if(!visible) {\n animationIntersector.removeAnimation(player);\n } else {\n animationIntersector.checkAnimation(player, false);\n }\n });\n };\n\n private processVisible = async(element: HTMLElement) => {\n const docId = element.dataset.docId;\n const doc = await this.managers.appDocsManager.getDoc(docId);\n\n const size = mediaSizes.active.esgSticker.width;\n\n // console.log('processVisibleDiv:', element);\n\n const promise = wrapSticker({\n doc,\n div: element,\n width: size,\n height: size,\n lazyLoadQueue: null,\n group: this.group,\n onlyThumb: false,\n play: true,\n loop: true,\n withLock: true\n }).then(({render}) => render);\n\n promise.then(() => {\n // clearTimeout(timeout);\n this.checkAnimationContainer(element, this.lazyLoadQueue.intersector.isVisible(element));\n });\n\n /* let timeout = window.setTimeout(() => {\n console.error('processVisibleDiv timeout', div, doc);\n }, 1e3); */\n\n return promise;\n };\n\n public processInvisible = async(element: HTMLElement) => {\n const docId = element.dataset.docId;\n const doc = await this.managers.appDocsManager.getDoc(docId);\n\n // console.log('STICKER INvisible:', /* div, */docId);\n\n this.checkAnimationContainer(element, false);\n\n element.textContent = '';\n this.renderSticker(doc, element as HTMLDivElement);\n };\n}\n\nexport type StickersTabCategoryItem = {element: HTMLElement};\n\nexport class StickersTabCategory = {}> {\n public elements: {\n container: HTMLElement,\n title: HTMLElement,\n items: HTMLElement,\n menuTab: HTMLElement,\n menuTabPadding: HTMLElement\n } & AdditionalElements;\n public items: Item[];\n public mounted: boolean;\n public id: string;\n public limit: number;\n\n public getContainerSize: () => {width: number, height: number};\n private getElementMediaSize: () => MediaSize;\n\n private gapX: number;\n private gapY: number;\n\n public set?: StickerSet;\n public local?: boolean;\n public menuScroll?: ScrollableX;\n\n constructor(options: {\n id: string,\n title: HTMLElement | DocumentFragment,\n overflowElement: HTMLElement,\n getContainerSize: StickersTabCategory['getContainerSize'],\n getElementMediaSize: StickersTabCategory['getElementMediaSize'],\n gapX: number,\n gapY: number,\n noMenuTab?: boolean\n }) {\n const container = document.createElement('div');\n container.classList.add('emoji-category');\n\n const items = document.createElement('div');\n items.classList.add('category-items');\n\n let title: HTMLElement;\n if(options.title) {\n title = document.createElement('div');\n title.classList.add('category-title');\n title.append(options.title);\n }\n\n let menuTab: HTMLElement, menuTabPadding: HTMLElement;\n if(!options.noMenuTab) {\n menuTab = ButtonIcon(undefined, {noRipple: true});\n menuTab.classList.add('menu-horizontal-div-item');\n\n menuTabPadding = document.createElement('div');\n menuTabPadding.classList.add('menu-horizontal-div-item-padding');\n\n menuTab.append(menuTabPadding);\n }\n\n if(title) container.append(title);\n container.append(items);\n\n this.elements = {\n container,\n title,\n items,\n menuTab,\n menuTabPadding\n } as any;\n this.id = options.id;\n this.items = [];\n\n this.getContainerSize = options.getContainerSize;\n this.getElementMediaSize = options.getElementMediaSize;\n this.gapX = options.gapX ?? 0;\n this.gapY = options.gapY ?? 0;\n }\n\n public setCategoryItemsHeight() {\n const {width: containerWidth} = this.getContainerSize();\n const elementSize = this.getElementMediaSize().width;\n\n let itemsPerRow = containerWidth / elementSize;\n if(this.gapX) itemsPerRow -= Math.floor(itemsPerRow - 1) * this.gapX / elementSize;\n itemsPerRow = Math.floor(itemsPerRow);\n\n const rows = Math.ceil(this.items.length / itemsPerRow);\n let height = rows * elementSize;\n if(this.gapY) height += (rows - 1) * this.gapY;\n\n this.elements.items.style.minHeight = height + 'px';\n }\n}\n\nexport class EmoticonsTabC> implements EmoticonsTab {\n public content: HTMLElement;\n public menuScroll: ScrollableX;\n public container: HTMLElement;\n public menuWrapper: HTMLElement;\n public menu: HTMLElement;\n\n protected categories: {[id: string]: Category};\n protected categoriesMap: Map;\n protected categoriesByMenuTabMap: Map;\n protected categoriesIntersector: VisibilityIntersector;\n protected localCategories: Category[];\n\n protected listenerSetter: ListenerSetter;\n\n public scrollable: Scrollable;\n protected mounted = false;\n protected menuOnClickResult: ReturnType;\n\n public tabId: number;\n\n protected postponedEvents: {cb: AnyFunction, args: any[]}[];\n\n public getContainerSize: Category['getContainerSize'];\n\n constructor(\n protected managers: AppManagers,\n protected categoryItemsClassName: string,\n protected getElementMediaSize: () => MediaSize,\n protected padding: number,\n protected gapX: number,\n protected gapY: number\n ) {\n this.categories = {};\n this.categoriesMap = new Map();\n this.categoriesByMenuTabMap = new Map();\n this.localCategories = [];\n this.postponedEvents = [];\n\n this.listenerSetter = new ListenerSetter();\n\n this.container = document.createElement('div');\n this.container.classList.add('tabs-tab', 'emoticons-container');\n\n this.menuWrapper = document.createElement('div');\n this.menuWrapper.classList.add('menu-wrapper', 'emoticons-menu-wrapper');\n\n this.menu = document.createElement('nav');\n this.menu.className = 'menu-horizontal-div no-stripe justify-start emoticons-menu';\n\n this.menuWrapper.append(this.menu);\n this.menuScroll = new ScrollableX(this.menuWrapper);\n\n this.content = document.createElement('div');\n this.content.classList.add('emoticons-content');\n\n this.container.append(this.menuWrapper, this.content);\n\n this.scrollable = new Scrollable(this.content, 'STICKERS');\n }\n\n public getCategoryByContainer(container: HTMLElement) {\n return this.categoriesMap.get(container);\n }\n\n public getCategoryByMenuTab(menuTab: HTMLElement) {\n return this.categoriesByMenuTabMap.get(menuTab);\n }\n\n protected createCategory(stickerSet: StickerSet, title: HTMLElement | DocumentFragment, isLocal?: boolean, noMenuTab?: boolean) {\n const category: Category = new StickersTabCategory({\n id: '' + stickerSet.id,\n title,\n overflowElement: this.content,\n getContainerSize: () => {\n let width: number, height: number;\n if(this.getContainerSize) {\n const size = this.getContainerSize();\n width = size.width;\n height = size.height;\n } else {\n const esgWidth = customProperties.getPropertyAsSize('esg-width');\n width = esgWidth === undefined ? windowSize.width : esgWidth;\n }\n\n return {width: width - this.padding, height};\n },\n getElementMediaSize: this.getElementMediaSize,\n gapX: this.gapX,\n gapY: this.gapY,\n noMenuTab\n }) as any;\n\n if(this.categoryItemsClassName) {\n category.elements.items.classList.add(this.categoryItemsClassName);\n }\n\n const container = category.elements.container;\n container.classList.add('hide');\n\n category.set = stickerSet;\n this.categories[stickerSet.id] = category;\n this.categoriesMap.set(container, category);\n !noMenuTab && this.categoriesByMenuTabMap.set(category.elements.menuTab, category);\n\n this.categoriesIntersector.observe(container);\n !noMenuTab && this.menuOnClickResult.stickyIntersector.observeStickyHeaderChanges(container);\n\n if(!isLocal) {\n !noMenuTab && category.elements.menuTab.classList.add('not-local');\n }\n\n return category;\n }\n\n protected positionCategory(category: Category, prepend?: boolean) {\n const {menuTab, container} = category.elements;\n const posItems = prepend ? this.localCategories.filter((category) => category.mounted).length : 0xFFFF;\n let foundMenuScroll = false;\n const posMenu = prepend ? this.localCategories.filter((category) => {\n if(category.menuScroll && !foundMenuScroll) {\n foundMenuScroll = true;\n return true;\n }\n\n return category.mounted && !category.menuScroll && category.elements.menuTab;\n }).length : 0xFFFF;\n positionElementByIndex(container, this.scrollable.container, posItems);\n positionElementByIndex(menuTab, this.menu, posMenu);\n }\n\n protected isCategoryVisible(category: Category) {\n return this.categoriesIntersector.getVisible().includes(category.elements.container);\n }\n\n protected toggleLocalCategory(category: Category, visible: boolean) {\n if(!visible) {\n category.elements.menuTab?.remove();\n category.elements.container.remove();\n } else {\n const idx = this.localCategories.indexOf(category);\n const sliced = this.localCategories.slice(0, idx);\n let notMountedItems = 0, notMountedMenus = 0;\n sliced.forEach((category) => {\n if(!category.mounted) {\n ++notMountedItems;\n ++notMountedMenus;\n } else if(!category.elements.menuTab || category.menuScroll) {\n ++notMountedMenus;\n }\n });\n const itemsIdx = idx - notMountedItems, menuIdx = idx - notMountedMenus;\n category.elements.menuTab && positionElementByIndex(category.elements.menuTab, this.menu, menuIdx);\n positionElementByIndex(category.elements.container, this.scrollable.container, itemsIdx);\n }\n\n category.mounted = visible;\n // category.elements.container.classList.toggle('hide', !visible);\n }\n\n protected createLocalCategory(id: string, title: LangPackKey | '', icon?: string, noMenuTab?: boolean) {\n const category = this.createCategory({id} as any, title && i18n(title), true, noMenuTab);\n category.local = true;\n this.localCategories.push(category);\n if(category.elements.title) {\n category.elements.title.classList.add('disable-hover');\n }\n\n if(!noMenuTab) {\n if(icon) {\n category.elements.menuTab.classList.add('tgico', 'tgico-' + icon);\n }\n\n category.elements.menuTabPadding.remove();\n }\n\n this.toggleLocalCategory(category, false);\n return category;\n }\n\n protected onLocalCategoryUpdate(category: Category) {\n category.setCategoryItemsHeight();\n this.toggleLocalCategory(category, !!category.items.length);\n }\n\n protected resizeCategories = () => {\n for(const [container, category] of this.categoriesMap) {\n category.setCategoryItemsHeight();\n }\n };\n\n protected deleteCategory(category: Category) {\n if(category) {\n category.elements.container.remove();\n category.elements.menuTab.remove();\n this.categoriesIntersector.unobserve(category.elements.container);\n delete this.categories[category.id];\n this.categoriesMap.delete(category.elements.container);\n this.categoriesByMenuTabMap.delete(category.elements.menuTab);\n\n return true;\n }\n\n return false;\n }\n\n protected spliceExceed(category: Category) {\n if(category.limit === undefined) {\n return false;\n }\n\n const {items, limit} = category;\n items.splice(limit, items.length - limit).forEach(({element}) => {\n element.remove();\n });\n\n this.onLocalCategoryUpdate(category);\n\n return true;\n }\n\n public init() {\n this.listenerSetter.add(emoticonsDropdown)('closed', () => {\n this.postponedEvents.forEach(({cb, args}) => {\n cb(...args);\n });\n\n this.postponedEvents.length = 0;\n });\n }\n\n public destroy() {\n this.getContainerSize = undefined;\n this.postponedEvents.length = 0;\n this.categoriesIntersector?.disconnect();\n this.listenerSetter.removeAll();\n this.scrollable.destroy();\n this.menuScroll?.destroy();\n this.menuOnClickResult?.stickyIntersector?.disconnect();\n }\n\n protected postponedEvent = (cb: (...args: K[]) => void) => {\n return (...args: K[]) => {\n if(emoticonsDropdown.isActive()) {\n this.postponedEvents.push({cb, args});\n } else {\n cb(...args);\n }\n };\n };\n}\n\ntype StickersTabItem = {element: HTMLElement, document: Document.document};\nexport default class StickersTab extends EmoticonsTabC> {\n private superStickerRenderer: SuperStickerRenderer;\n\n constructor(managers: AppManagers) {\n super(\n managers,\n 'super-stickers',\n () => mediaSizes.active.esgSticker,\n 3 * 2,\n 4,\n 4\n );\n\n this.container.classList.add('stickers-padding');\n this.content.id = 'content-stickers';\n }\n\n private setFavedLimit(limit: number) {\n const category = this.categories['faved'];\n category.limit = limit;\n }\n\n private categoryAppendStickers(\n category: StickersTabCategory,\n promise: Promise\n ) {\n const {container} = category.elements;\n\n promise.then((documents) => {\n const isVisible = this.isCategoryVisible(category);\n\n documents.forEach((document) => {\n const element = this.superStickerRenderer.renderSticker(document);\n category.items.push({document, element});\n\n if(isVisible) {\n category.elements.items.append(element);\n }\n });\n\n category.setCategoryItemsHeight();\n container.classList.remove('hide');\n });\n }\n\n private async renderStickerSet(set: StickerSet.stickerSet, prepend = false) {\n const category = this.createCategory(set, wrapEmojiText(set.title));\n const {menuTabPadding} = category.elements;\n\n const promise = this.managers.appStickersManager.getStickerSet(set);\n this.categoryAppendStickers(\n category,\n promise.then((stickerSet) => stickerSet.documents as MyDocument[])\n );\n\n this.positionCategory(category, prepend);\n\n wrapStickerSetThumb({\n set,\n container: menuTabPadding,\n group: EMOTICONSSTICKERGROUP,\n lazyLoadQueue: EmoticonsDropdown.lazyLoadQueue,\n width: 32,\n height: 32,\n autoplay: false\n });\n }\n\n private onCategoryVisibility = ({target, visible, entry}: OnVisibilityChangeItem) => {\n const category = this.categoriesMap.get(target);\n category.elements.items.replaceChildren(...(!visible ? [] : category.items.map(({element}) => element)));\n };\n\n public init() {\n super.init();\n\n this.scrollable.onAdditionalScroll = () => {\n this.setTyping();\n };\n\n /* stickersDiv.addEventListener('mouseover', (e) => {\n let target = e.target as HTMLElement;\n\n if(target.tagName === 'CANVAS') { // turn on sticker\n let animation = lottieLoader.getAnimation(target.parentElement, EMOTICONSSTICKERGROUP);\n\n if(animation) {\n // @ts-ignore\n if(animation.currentFrame === animation.totalFrames - 1) {\n animation.goToAndPlay(0, true);\n } else {\n animation.play();\n }\n }\n }\n }); */\n\n const intersectionOptions: IntersectionObserverInit = {root: emoticonsDropdown.getElement()};\n this.categoriesIntersector = new VisibilityIntersector(this.onCategoryVisibility, intersectionOptions);\n\n const clearCategoryItems = (category: StickersTabCategory) => {\n category.elements.items.replaceChildren();\n category.items.forEach(({element}) => this.superStickerRenderer.unobserveAnimated(element));\n category.items.length = 0;\n };\n\n this.scrollable.container.addEventListener('click', (e) => {\n const target = e.target as HTMLElement;\n if(findUpClassName(target, 'category-title')) {\n const container = findUpClassName(target, 'emoji-category');\n const category = this.categoriesMap.get(container);\n if(category.local) {\n return;\n }\n\n new PopupStickers({id: category.set.id, access_hash: category.set.access_hash}).show();\n return;\n }\n\n EmoticonsDropdown.onMediaClick(e);\n });\n\n this.menuOnClickResult = EmoticonsDropdown.menuOnClick(this, this.menu, this.scrollable, this.menuScroll);\n\n const preloader = putPreloader(this.content, true);\n\n const onCategoryStickers = (category: StickersTabCategory, stickers: MyDocument[]) => {\n // if(category.id === 'faved' && category.limit && category.limit < stickers.length) {\n // category.limit = stickers.length;\n // }\n\n if(category.limit) {\n stickers = stickers.slice(0, category.limit);\n }\n\n const ids = new Set(stickers.map((doc) => doc.id));\n forEachReverse(category.items, (item) => {\n if(!ids.has(item.document.id)) {\n this.deleteSticker(category, item.document, true);\n }\n });\n\n this.toggleLocalCategory(category, !!stickers.length);\n forEachReverse(stickers, (doc, idx) => {\n this.unshiftSticker(category, doc, true, idx);\n });\n this.spliceExceed(category);\n category.elements.container.classList.remove('hide');\n };\n\n const favedCategory = this.createLocalCategory('faved', 'FavoriteStickers', 'savedmessages');\n // favedCategory.elements.menuTab.classList.add('active');\n\n const recentCategory = this.createLocalCategory('recent', 'Stickers.Recent', 'recent');\n recentCategory.limit = 20;\n\n const clearButton = ButtonIcon('close', {noRipple: true});\n recentCategory.elements.title.append(clearButton);\n attachClickEvent(clearButton, () => {\n confirmationPopup({\n titleLangKey: 'ClearRecentStickersAlertTitle',\n descriptionLangKey: 'ClearRecentStickersAlertMessage',\n button: {\n langKey: 'Clear'\n }\n }).then(() => {\n this.managers.appStickersManager.clearRecentStickers();\n }, noop);\n });\n\n const premiumCategory = this.createLocalCategory('premium', 'PremiumStickersShort');\n const s = document.createElement('span');\n s.classList.add('tgico-star', 'color-premium');\n premiumCategory.elements.menuTab.append(s);\n\n const promises = [\n Promise.all([\n this.managers.apiManager.getLimit('favedStickers'),\n this.managers.appStickersManager.getFavedStickersStickers()\n ]).then(([limit, stickers]) => {\n this.setFavedLimit(limit);\n onCategoryStickers(favedCategory, stickers);\n }),\n\n this.managers.appStickersManager.getRecentStickersStickers().then((stickers) => {\n onCategoryStickers(recentCategory, stickers);\n }),\n\n this.managers.appStickersManager.getAllStickers().then((res) => {\n for(const set of (res as MessagesAllStickers.messagesAllStickers).sets) {\n this.renderStickerSet(set);\n }\n }),\n\n this.managers.appStickersManager.getPremiumStickers().then((stickers) => {\n const length = stickers.length;\n this.toggleLocalCategory(premiumCategory, rootScope.premium && !!length);\n this.categoryAppendStickers(premiumCategory, Promise.resolve(stickers));\n\n rootScope.addEventListener('premium_toggle', (isPremium) => {\n this.toggleLocalCategory(this.categories['premium'], isPremium && !!length);\n });\n })\n ];\n\n Promise.race(promises).finally(() => {\n preloader.remove();\n });\n\n Promise.all(promises).finally(() => {\n this.mounted = true;\n this.setTyping();\n\n const favedCategory = this.categories['faved'];\n const recentCategory = this.categories['recent'];\n this.menuOnClickResult.setActive(favedCategory.items.length ? favedCategory : recentCategory);\n\n rootScope.addEventListener('stickers_installed', (set) => {\n if(!this.categories[set.id]) {\n this.renderStickerSet(set, true);\n }\n });\n });\n\n this.superStickerRenderer = new SuperStickerRenderer(EmoticonsDropdown.lazyLoadQueue, EMOTICONSSTICKERGROUP, this.managers, intersectionOptions);\n\n const rendererLazyLoadQueue = this.superStickerRenderer.lazyLoadQueue;\n emoticonsDropdown.addLazyLoadQueueRepeat(rendererLazyLoadQueue, this.superStickerRenderer.processInvisible);\n\n // emoticonsDropdown.addEventListener('close', () => {\n // this.categoriesIntersector.lock();\n // });\n\n // emoticonsDropdown.addEventListener('closed', () => {\n // for(const [container] of this.categoriesMap) {\n // onCategoryVisibility(container, false);\n // }\n // });\n\n // emoticonsDropdown.addEventListener('opened', () => {\n // this.categoriesIntersector.unlockAndRefresh();\n // });\n\n // setInterval(() => {\n // // @ts-ignore\n // const players = Object.values(lottieLoader.players).filter((p) => p.width >= 80);\n\n // console.log(\n // 'STICKERS RENDERED IN PANEL:',\n // players.length,\n // players.filter((p) => !p.paused).length,\n // rendererLazyLoadQueue.intersector.getVisible().length\n // );\n // }, .25e3);\n\n rootScope.addEventListener('sticker_updated', ({type, document, faved}) => {\n // if(type === 'faved') {\n // return;\n // }\n\n const category = this.categories[type === 'faved' ? 'faved' : 'recent'];\n if(category) {\n if(faved) {\n this.unshiftSticker(category, document);\n } else {\n this.deleteSticker(category, document);\n }\n }\n });\n\n rootScope.addEventListener('stickers_deleted', ({id}) => {\n const category = this.categories[id];\n if(this.deleteCategory(category)) {\n clearCategoryItems(category);\n }\n });\n\n rootScope.addEventListener('stickers_top', this.postponedEvent((id) => {\n const category = this.categories[id];\n if(category) {\n this.positionCategory(category, true);\n emoticonsDropdown.addEventListener('openAfterLayout', () => {\n this.menuOnClickResult.setActiveStatic(category);\n }, {once: true});\n }\n }));\n\n rootScope.addEventListener('stickers_order', ({type, order}) => {\n if(type !== 'stickers') {\n return;\n }\n\n order.forEach((id) => {\n const category = this.categories[id];\n if(category) {\n this.positionCategory(category, false);\n }\n });\n });\n\n rootScope.addEventListener('stickers_updated', ({type, stickers}) => {\n const category = this.categories[type === 'faved' ? 'faved' : 'recent'];\n if(category) {\n onCategoryStickers(category, stickers);\n }\n });\n\n rootScope.addEventListener('app_config', () => {\n this.managers.apiManager.getLimit('favedStickers').then((limit) => {\n this.setFavedLimit(limit);\n });\n });\n\n mediaSizes.addEventListener('resize', this.resizeCategories);\n\n attachStickerViewerListeners({listenTo: this.content, listenerSetter: new ListenerSetter()});\n\n const type: IgnoreMouseOutType = 'menu';\n createStickersContextMenu({\n listenTo: this.content,\n verifyRecent: (target) => !!findUpAsChild(target, this.categories['recent'].elements.items),\n onOpen: () => {\n emoticonsDropdown.setIgnoreMouseOut(type, true);\n },\n onClose: () => {\n emoticonsDropdown.setIgnoreMouseOut(type, false);\n }\n });\n\n this.init = null;\n }\n\n public deleteSticker(category: StickersTabCategory, doc: MyDocument, batch?: boolean) {\n const item = findAndSplice(category.items, (item) => item.document.id === doc.id);\n if(item) {\n item.element.remove();\n\n if(!batch) {\n this.onLocalCategoryUpdate(category);\n }\n }\n }\n\n public unshiftSticker(category: StickersTabCategory, doc: MyDocument, batch?: boolean, idx?: number) {\n if(idx !== undefined) {\n const i = category.items[idx];\n if(i && i.document.id === doc.id) {\n return;\n }\n }\n\n let item = findAndSplice(category.items, (item) => item.document.id === doc.id);\n if(!item) {\n item = {\n element: this.superStickerRenderer.renderSticker(doc),\n document: doc\n };\n }\n\n category.items.unshift(item);\n category.elements.items.prepend(item.element);\n\n if(!batch) {\n this.spliceExceed(category);\n }\n }\n\n public unshiftRecentSticker(doc: MyDocument) {\n this.managers.appStickersManager.saveRecentSticker(doc.id);\n }\n\n public deleteRecentSticker(doc: MyDocument) {\n this.managers.appStickersManager.saveRecentSticker(doc.id, true);\n }\n\n public setTyping = (cancel = false) => {\n if(!cancel && (!emoticonsDropdown.isActive() || emoticonsDropdown.tab !== this)) {\n return;\n }\n\n rootScope.dispatchEvent('choosing_sticker', !cancel);\n };\n\n public onClosed() {\n this.setTyping(true);\n }\n\n public onOpened() {\n this.setTyping();\n this.resizeCategories();\n }\n}\n","export const generateDelimiter = () => {\n const delimiter = document.createElement('div');\n delimiter.classList.add('gradient-delimiter');\n return delimiter;\n};\n","import {_i18n} from '../lib/langPack';\n\nexport default function generateFakeIcon(isScam?: boolean) {\n const span = document.createElement('span');\n span.classList.add('badge-fake');\n _i18n(span, isScam ? 'ScamMessage' : 'FakeMessage');\n return span;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport findAndSpliceAll from '../helpers/array/findAndSpliceAll';\nimport LazyLoadQueueIntersector, {LazyLoadElement} from './lazyLoadQueueIntersector';\nimport VisibilityIntersector, {OnVisibilityChange} from './visibilityIntersector';\n\nexport default class LazyLoadQueueRepeat2 extends LazyLoadQueueIntersector {\n constructor(parallelLimit?: number, protected onVisibilityChange?: OnVisibilityChange) {\n super(parallelLimit);\n\n this.intersector = new VisibilityIntersector((item) => {\n const {target, visible} = item;\n const spliced = findAndSpliceAll(this.queue, (i) => i.div === target);\n if(visible && spliced.length) {\n spliced.forEach((item) => {\n this.queue.unshift(item);\n });\n }\n\n this.onVisibilityChange && this.onVisibilityChange(item);\n this.setProcessQueueTimeout();\n });\n }\n\n public observe(el: LazyLoadElement) {\n super.observe(el);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../lib/appManagers/appDocsManager';\nimport animationIntersector, {AnimationItemGroup} from './animationIntersector';\nimport Scrollable from './scrollable';\nimport deferredPromise, {CancellablePromise} from '../helpers/cancellablePromise';\nimport calcImageInBox from '../helpers/calcImageInBox';\nimport {doubleRaf} from '../helpers/schedulers';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport rootScope from '../lib/rootScope';\nimport LazyLoadQueueRepeat2 from './lazyLoadQueueRepeat2';\nimport wrapVideo from './wrappers/video';\nimport noop from '../helpers/noop';\n\nconst width = 400;\nconst maxSingleWidth = width - 100;\nconst height = 100;\n\nexport default class GifsMasonry {\n public lazyLoadQueue: LazyLoadQueueRepeat2;\n private scrollPromise: CancellablePromise = Promise.resolve();\n private timeout: number = 0;\n private managers: AppManagers;\n\n constructor(\n private element: HTMLElement,\n private group: AnimationItemGroup,\n private scrollable: Scrollable,\n attach = true\n ) {\n this.managers = rootScope.managers;\n\n this.lazyLoadQueue = new LazyLoadQueueRepeat2(undefined, ({target, visible}) => {\n if(visible) {\n this.processVisibleDiv(target);\n } else {\n this.processInvisibleDiv(target);\n }\n });\n\n /* setInterval(() => {\n // @ts-ignore\n const players = animationIntersector.byGroups[group];\n\n if(players) {\n console.log(`GIFS RENDERED IN ${group}:`, players.length, players.filter((p) => !p.animation.paused).length, this.lazyLoadQueue.intersector.getVisible().length);\n }\n }, .25e3); */\n\n if(attach) {\n this.attach();\n }\n }\n\n private onScroll = () => {\n if(this.timeout) {\n clearTimeout(this.timeout);\n } else {\n this.scrollPromise = deferredPromise();\n // animationIntersector.checkAnimations(true, group);\n }\n\n this.timeout = window.setTimeout(() => {\n this.timeout = 0;\n this.scrollPromise.resolve();\n // animationIntersector.checkAnimations(false, group);\n }, 150);\n };\n\n public attach() {\n this.scrollable.container.addEventListener('scroll', this.onScroll);\n }\n\n public detach() {\n this.clear();\n this.scrollable.container.removeEventListener('scroll', this.onScroll);\n }\n\n public clear() {\n this.lazyLoadQueue.clear();\n }\n\n private processVisibleDiv(div: HTMLElement) {\n const video = div.querySelector('video');\n if(video) {\n return;\n }\n\n const load = () => {\n const docId = div.dataset.docId;\n const promise = Promise.all([this.managers.appDocsManager.getDoc(docId), this.scrollPromise]).then(async([doc]) => {\n const res = await wrapVideo({\n doc,\n container: div as HTMLDivElement,\n lazyLoadQueue: null,\n // lazyLoadQueue: EmoticonsDropdown.lazyLoadQueue,\n group: this.group,\n noInfo: true,\n noPreview: true\n });\n\n const promise = res.loadPromise;\n promise.finally(() => {\n const video = div.querySelector('video');\n const thumb = div.querySelector('img, canvas');\n\n // div.style.opacity = '';\n thumb && thumb.classList.add('hide');\n\n if(video && !video.parentElement) {\n setTimeout(() => {\n video.src = '';\n video.load();\n const animations = animationIntersector.getAnimations(video);\n animations.forEach((item) => {\n animationIntersector.removeAnimation(item);\n });\n }, 0);\n }\n\n // clearTimeout(timeout);\n if(!this.lazyLoadQueue.intersector.isVisible(div)) {\n this.processInvisibleDiv(div);\n }\n });\n\n return promise;\n });\n\n /* let timeout = window.setTimeout(() => {\n console.error('processVisibleDiv timeout', div, doc);\n }, 1e3); */\n\n return promise;\n };\n\n // return load();\n\n this.lazyLoadQueue.push({div, load});\n }\n\n public processInvisibleDiv = (div: HTMLElement) => {\n return this.scrollPromise.then(async() => {\n // return;\n\n if(this.lazyLoadQueue.intersector.isVisible(div)) {\n return;\n }\n\n const video = div.querySelector('video');\n const thumb = div.querySelector('img, canvas');\n\n if(thumb) {\n thumb.classList.remove('hide');\n\n await doubleRaf();\n }\n\n if(this.lazyLoadQueue.intersector.isVisible(div)) {\n return;\n }\n\n if(video) {\n video.remove();\n video.src = '';\n video.load();\n const animations = animationIntersector.getAnimations(video);\n animations.forEach((item) => {\n animationIntersector.removeAnimation(item);\n });\n }\n });\n };\n\n public add(doc: MyDocument, appendTo = this.element) {\n // let gifWidth = doc.w;\n // let gifHeight = doc.h;\n // if(gifHeight < height) {\n // gifWidth = height / gifHeight * gifWidth;\n // gifHeight = height;\n // }\n\n // const willUseWidth = Math.min(maxSingleWidth, width, gifWidth);\n // const size = calcImageInBox(gifWidth, gifHeight, willUseWidth, height);\n\n const div = document.createElement('div');\n div.classList.add('gif', 'grid-item'/* , 'fade-in-transition' */);\n // div.style.width = size.width + 'px';\n // div.style.opacity = '0';\n // div.style.height = h + 'px';\n div.dataset.docId = '' + doc.id;\n\n appendTo.append(div);\n\n this.lazyLoadQueue.observe({div, load: noop as any});\n\n // let preloader = new ProgressivePreloader(div);\n\n wrapVideo({\n doc,\n container: div as HTMLDivElement,\n lazyLoadQueue: null,\n noInfo: true,\n onlyPreview: true\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport TransitionSlider from './transition';\nimport {ScrollableX} from './scrollable';\nimport rootScope from '../lib/rootScope';\nimport {fastRaf} from '../helpers/schedulers';\nimport {FocusDirection} from '../helpers/fastSmoothScroll';\nimport findUpAsChild from '../helpers/dom/findUpAsChild';\nimport whichChild from '../helpers/dom/whichChild';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport liteMode from '../helpers/liteMode';\n\nexport function horizontalMenu(\n tabs: HTMLElement,\n content: HTMLElement,\n onClick?: (id: number, tabContent: HTMLDivElement, animate: boolean) => void | boolean | Promise,\n onTransitionEnd?: () => void,\n transitionTime = 200,\n scrollableX?: ScrollableX,\n listenerSetter?: ListenerSetter\n) {\n const selectTab = TransitionSlider({\n content,\n type: tabs || content.dataset.animation === 'tabs' ? 'tabs' : 'navigation',\n transitionTime,\n onTransitionEnd,\n listenerSetter\n });\n\n if(!tabs) {\n return selectTab;\n }\n\n const proxy = new Proxy(selectTab, {\n apply: (target, that, args) => {\n const id = +args[0];\n const animate = args[1] !== undefined ? args[1] : true;\n\n const el = (tabs.querySelector(`[data-tab=\"${id}\"]`) || tabs.children[id]) as HTMLElement;\n selectTarget(el, id, animate);\n }\n });\n\n const selectTarget = async(target: HTMLElement, id: number, animate = true) => {\n const tabContent = content.children[id] as HTMLDivElement;\n\n if(onClick) {\n const result1 = onClick(id, tabContent, animate);\n const canChange = result1 instanceof Promise ? await result1 : result1;\n if(canChange !== undefined && !canChange) {\n return;\n }\n }\n\n if(scrollableX) {\n scrollableX.scrollIntoViewNew({\n element: target.parentElement.children[id] as HTMLElement,\n position: 'center',\n forceDirection: animate ? undefined : FocusDirection.Static,\n forceDuration: transitionTime,\n axis: 'x'\n });\n }\n\n if(!liteMode.isAvailable('animations')) {\n animate = false;\n }\n\n const prevId = selectTab.prevId();\n if(target.classList.contains('active') || id === prevId) {\n return false;\n }\n\n const mutateCallback = animate ? fastRaf : (cb: () => void) => cb();\n\n const prev = tabs.querySelector(tagName.toLowerCase() + '.active') as HTMLElement;\n if(prev) {\n mutateCallback(() => {\n prev.classList.remove('active');\n });\n }\n\n // a great stripe from Jolly Cobra\n if(useStripe && prevId !== -1 && animate) {\n mutateCallback(() => {\n const indicator = target.querySelector('i')!;\n const currentIndicator = target.parentElement.children[prevId].querySelector('i')!;\n\n currentIndicator.classList.remove('animate');\n indicator.classList.remove('animate');\n\n // We move and resize our indicator so it repeats the position and size of the previous one.\n const shiftLeft = currentIndicator.parentElement.parentElement.offsetLeft - indicator.parentElement.parentElement.offsetLeft;\n const scaleFactor = currentIndicator.clientWidth / indicator.clientWidth;\n indicator.style.transform = `translate3d(${shiftLeft}px, 0, 0) scale3d(${scaleFactor}, 1, 1)`;\n\n // console.log(`translate3d(${shiftLeft}px, 0, 0) scale3d(${scaleFactor}, 1, 1)`);\n\n fastRaf(() => {\n // Now we remove the transform to let it animate to its own position and size.\n indicator.classList.add('animate');\n indicator.style.transform = 'none';\n });\n });\n }\n\n mutateCallback(() => {\n target.classList.add('active');\n });\n\n selectTab(id, animate);\n };\n\n const useStripe = !tabs.classList.contains('no-stripe');\n\n // const tagName = tabs.classList.contains('menu-horizontal-div') ? 'BUTTON' : 'LI';\n const tagName = tabs.firstElementChild.tagName;\n attachClickEvent(tabs, (e) => {\n let target = e.target as HTMLElement;\n\n target = findUpAsChild(target, tabs);\n\n // console.log('tabs click:', target);\n\n if(!target) return false;\n\n let id: number;\n if(target.dataset.tab) {\n id = +target.dataset.tab;\n if(id === -1) {\n return false;\n }\n } else {\n id = whichChild(target);\n }\n\n selectTarget(target, id);\n }, {listenerSetter});\n\n return proxy;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport simulateEvent from '../helpers/dom/dispatchEvent';\nimport documentFragmentToHTML from '../helpers/dom/documentFragmentToHTML';\nimport findUpAttribute from '../helpers/dom/findUpAttribute';\nimport findUpTag from '../helpers/dom/findUpTag';\nimport getCaretPosNew from '../helpers/dom/getCaretPosNew';\nimport getRichValueWithCaret from '../helpers/dom/getRichValueWithCaret';\nimport isInputEmpty from '../helpers/dom/isInputEmpty';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport RichInputHandler, {USING_BOMS} from '../helpers/dom/richInputHandler';\nimport selectElementContents from '../helpers/dom/selectElementContents';\nimport setInnerHTML, {setDirection} from '../helpers/dom/setInnerHTML';\nimport {MessageEntity} from '../layer';\nimport {i18n, LangPackKey, _i18n} from '../lib/langPack';\nimport {NULL_PEER_ID} from '../lib/mtproto/mtproto_config';\nimport mergeEntities from '../lib/richTextProcessor/mergeEntities';\nimport parseEntities from '../lib/richTextProcessor/parseEntities';\nimport wrapDraftText from '../lib/richTextProcessor/wrapDraftText';\nimport {createCustomFiller, CustomEmojiElement, CustomEmojiRendererElement, insertCustomFillers, renderEmojis} from '../lib/richTextProcessor/wrapRichText';\n\nexport async function insertRichTextAsHTML(input: HTMLElement, text: string, entities: MessageEntity[], wrappingForPeerId: PeerId) {\n const loadPromises: Promise[] = [];\n const wrappingCustomEmoji = entities?.some((entity) => entity._ === 'messageEntityCustomEmoji');\n const renderer = wrappingCustomEmoji ? createCustomEmojiRendererForInput() : undefined;\n const fragment = wrapDraftText(text, {entities, wrappingForPeerId, loadPromises, customEmojiRenderer: renderer});\n const something = fragment.querySelectorAll('[contenteditable=\"false\"]');\n something.forEach((el) => {\n el.contentEditable = 'inherit';\n el.classList.add('pc');\n });\n\n loadPromises.length && await Promise.all(loadPromises);\n\n fragment.querySelectorAll('.input-selectable').forEach((el) => {\n el.prepend(createCustomFiller(true));\n });\n\n const richInputHandler = USING_BOMS ? RichInputHandler.getInstance() : undefined;\n // const restore = richInputHandler.prepareApplyingMarkdown();\n\n // fragment.querySelectorAll('.input-filler').forEach((el) => el.remove());\n\n // const fillers = Array.from(input.querySelectorAll('.input-filler')).map((el) => {\n // el.contentEditable = 'false';\n // return el;\n // });\n\n const customEmojiElements = Array.from(fragment.querySelectorAll('.custom-emoji-placeholder')).map((el) => {\n el.dataset.ces = '1';\n return (el as any).customEmojiElement as CustomEmojiElement;\n });\n\n const html = documentFragmentToHTML(fragment);\n renderer?.destroy();\n\n // console.log(html);\n\n const pre = getCaretPosNew(input);\n // console.log('pre', pre);\n let textNode: ChildNode, textNodeValue: string;\n if(pre.node) {\n // if(pre.node?.nodeValue === BOM && false) {\n // textNode = document.createTextNode(textNodeValue = BOM);\n // (pre.node.parentNode as any as ChildNode).after(textNode);\n // pre.selection.modify('extend', 'forward', 'character');\n // pre.selection.collapseToEnd();\n // }\n } else {\n const range = document.createRange();\n let node = input.lastChild;\n if(!node) {\n input.append(node /* = textNode */ = document.createTextNode(''));\n }\n\n range.setStartAfter(node);\n range.collapse(true);\n pre.selection.removeAllRanges();\n pre.selection.addRange(range);\n }\n\n // const fragmentLastChild = fragment.lastChild;\n\n // const s = document.createElement('span');\n // (node as ChildNode).replaceWith(s);\n // s.append(node);\n input.addEventListener('input', cancelEvent, {capture: true, once: true, passive: false});\n richInputHandler?.onBeforeInput({inputType: 'insertContent'});\n window.document.execCommand('insertHTML', false, html);\n Array.from(input.querySelectorAll('[data-ces]')).forEach((el, idx) => {\n delete el.dataset.ces;\n const customEmojiElement = customEmojiElements[idx];\n (el as any).customEmojiElement = customEmojiElement;\n customEmojiElement.placeholder = el;\n });\n // fillers.forEach((el) => {\n // el.contentEditable = 'inherit';\n // });\n input.querySelectorAll('.pc').forEach((el) => {\n el.contentEditable = 'false';\n });\n if(textNode) {\n const {nodeValue} = textNode;\n if(nodeValue === textNodeValue) {\n textNode.remove();\n } else {\n (textNode as CharacterData).replaceData(nodeValue.indexOf(textNodeValue), textNodeValue.length, '');\n }\n }\n // restore();\n richInputHandler?.removeExtraBOMs(input);\n simulateEvent(input, 'input');\n\n // if(textNode) {\n // const selection = document.getSelection();\n // const node = fragmentLastChild.nextSibling || fragmentLastChild;\n // const range = document.createRange();\n // range.setStartAfter(node);\n // range.collapse(true);\n // selection.removeAllRanges();\n // selection.addRange(range);\n // }\n\n // const after = getCaretPosNew(input);\n // console.log('after', after);\n // if(after.node?.nodeValue === BOM) {\n // const smth = findUpClassName(after.node.parentElement, 'input-something');\n // if(smth) {\n // const selection = document.getSelection();\n // const node = smth.nextSibling;\n // const range = document.createRange();\n // range.setStartAfter(node);\n // range.collapse(true);\n // selection.removeAllRanges();\n // selection.addRange(range);\n\n // // if(after.offset === 0) after.selection.modify('extend', 'forward', 'character');\n // // after.selection.modify('extend', 'forward', 'character');\n // // after.selection.collapseToEnd();\n // }\n // }\n\n // setCaretAt(fragmentLastChild.nextSibling);\n\n // console.log('ASD');\n}\n\nlet init = () => {\n document.addEventListener('paste', (e) => {\n const input = findUpAttribute(e.target, 'contenteditable=\"true\"');\n if(!input) {\n return;\n }\n\n const noLinebreaks = !!input.dataset.noLinebreaks;\n e.preventDefault();\n let text: string, entities: MessageEntity[];\n\n // @ts-ignore\n let plainText: string = (e.originalEvent || e).clipboardData.getData('text/plain');\n let usePlainText = true;\n\n // @ts-ignore\n let html: string = (e.originalEvent || e).clipboardData.getData('text/html');\n\n const filterEntity = (e: MessageEntity) => e._ === 'messageEntityEmoji' || (e._ === 'messageEntityLinebreak' && !noLinebreaks);\n if(noLinebreaks) {\n const regExp = /[\\r\\n]/g;\n plainText = plainText.replace(regExp, '');\n html = html.replace(regExp, '');\n }\n\n const peerId = (input.dataset.peerId || NULL_PEER_ID).toPeerId();\n if(html.trim()) {\n // console.log(html.replace(/ (style|class|id)=\".+?\"/g, ''));\n\n html = html.replace(//, '');\n html = html.replace(//, '');\n html = html.replace('
', '');\n\n const match = html.match(/([\\s\\S]*)<\\/body>/);\n if(match) {\n html = match[1].trim();\n }\n\n // const s = cleanHTML(html, true) as NodeList;\n // console.log(s);\n\n const parser = new DOMParser();\n const doc = parser.parseFromString(html, 'text/html');\n const span = doc.body || document.createElement('body');\n\n // const span: HTMLElement = document.createElement('span');\n // span.innerHTML = html;\n // span.append(...Array.from(s));\n\n let curChild = span.firstChild;\n while(curChild) { // * fix whitespace between elements like

asd

\\n

zxc

\n const nextSibling = curChild.nextSibling;\n if(curChild.nodeType === curChild.TEXT_NODE) {\n if(!curChild.nodeValue.trim()) {\n curChild.remove();\n }\n }\n\n curChild = nextSibling;\n }\n\n const richValue = getRichValueWithCaret(span, true, false);\n\n const canWrapCustomEmojis = !!peerId;\n if(!canWrapCustomEmojis) {\n richValue.entities = richValue.entities.filter((entity) => entity._ !== 'messageEntityCustomEmoji');\n }\n\n /* if(false) */ { // * fix extra new lines appearing from

(can have them from some sources, like macOS Terminal)\n const lines = richValue.value.split('\\n');\n let textLength = 0;\n for(let lineIndex = 0; lineIndex < lines.length; ++lineIndex) {\n const line = lines[lineIndex];\n textLength += line.length;\n\n const index = textLength;\n if(plainText[index] !== '\\n' && lineIndex !== (lines.length - 1)) {\n const nextLine = lines.splice(lineIndex + 1, 1)[0];\n lines[lineIndex] = line + nextLine;\n\n // fix entities\n richValue.entities.forEach((entity) => {\n if(entity.offset >= index) {\n entity.offset -= 1;\n }\n });\n\n textLength += nextLine.length;\n }\n\n textLength += 1;\n }\n\n const correctedText = lines.join('\\n');\n richValue.value = correctedText;\n }\n\n const richTextLength = richValue.value.replace(/\\s/g, '').length;\n const plainTextLength = plainText.replace(/\\s/g, '').length;\n if(richTextLength === plainTextLength ||\n richValue.entities.find((entity) => entity._ === 'messageEntityCustomEmoji')) {\n text = richValue.value;\n entities = richValue.entities;\n usePlainText = false;\n\n let entities2 = parseEntities(text);\n entities2 = entities2.filter(filterEntity);\n mergeEntities(entities, entities2);\n }\n\n // console.log('usePlainText', usePlainText);\n }\n\n if(usePlainText) {\n text = plainText;\n entities = parseEntities(text);\n entities = entities.filter(filterEntity);\n }\n\n insertRichTextAsHTML(input, text, entities, peerId);\n });\n\n init = null;\n};\n\n// ! it doesn't respect symbols other than strongs\n/* const checkAndSetRTL = (input: HTMLElement) => {\n //const isEmpty = isInputEmpty(input);\n //console.log('input', isEmpty);\n\n //const char = [...getRichValue(input)][0];\n const char = (input instanceof HTMLInputElement ? input.value : input.innerText)[0];\n let direction = 'ltr';\n if(char && checkRTL(char)) {\n direction = 'rtl';\n }\n\n //console.log('RTL', direction, char);\n\n input.style.direction = direction;\n}; */\n\nexport enum InputState {\n Neutral = 0,\n Valid = 1,\n Error = 2\n};\n\nexport type InputFieldOptions = {\n placeholder?: LangPackKey,\n label?: LangPackKey,\n labelOptions?: any[],\n labelText?: string | DocumentFragment,\n name?: string,\n maxLength?: number,\n showLengthOn?: number,\n plainText?: true,\n required?: boolean,\n canBeEdited?: boolean,\n validate?: () => boolean,\n inputMode?: 'tel' | 'numeric',\n withLinebreaks?: boolean,\n autocomplete?: string\n};\n\nfunction createCustomEmojiRendererForInput() {\n const renderer = CustomEmojiRendererElement.create({\n wrappingDraft: true,\n isSelectable: true\n });\n return renderer;\n}\n\nfunction processCustomEmojisInInput(input: HTMLElement) {\n const customEmojiElements = Array.from(input.querySelectorAll('.custom-emoji, .custom-emoji-placeholder'));\n let renderer = input.querySelector('.custom-emoji-renderer');\n if(!renderer && customEmojiElements.length) {\n renderer = createCustomEmojiRendererForInput();\n input.prepend(renderer);\n } else if(renderer && !customEmojiElements.length) {\n renderer.remove();\n return;\n }\n\n if(!renderer) {\n return;\n }\n\n const customEmojis: Parameters[0] = new Map();\n customEmojiElements.forEach((element) => {\n const customEmojiElement = element instanceof CustomEmojiElement ? element : (element as any).customEmojiElement as CustomEmojiElement;\n const {docId} = customEmojiElement;\n let set = customEmojis.get(docId);\n if(!set) {\n customEmojis.set(docId, set = new Set());\n }\n\n set.add(customEmojiElement);\n });\n\n for(const [docId, customEmojiElements] of customEmojis) {\n let hasSet = renderer.customEmojis.get(docId);\n if(hasSet) {\n for(const customEmojiElement of hasSet) {\n if(!customEmojiElements.has(customEmojiElement)) {\n customEmojiElement.destroy();\n }\n }\n } else {\n hasSet = new Set();\n }\n\n for(const customEmojiElement of customEmojiElements) {\n if(!hasSet.has(customEmojiElement)) {\n customEmojiElement.connectedCallback();\n }\n }\n }\n\n renderer.add(customEmojis, false);\n renderer.forceRender();\n}\n\nexport default class InputField {\n public container: HTMLElement;\n public input: HTMLElement;\n public label: HTMLLabelElement;\n\n public originalValue: string;\n\n public required: boolean;\n public validate: () => boolean;\n\n constructor(public options: InputFieldOptions = {}) {\n this.container = document.createElement('div');\n this.container.classList.add('input-field');\n\n this.required = options.required;\n this.validate = options.validate;\n\n if(options.maxLength !== undefined && options.showLengthOn === undefined) {\n options.showLengthOn = Math.min(40, Math.round(options.maxLength / 3));\n }\n\n const {placeholder, maxLength, showLengthOn, name, plainText, canBeEdited = true, autocomplete} = options;\n const label = options.label || options.labelText;\n\n const onInputCallbacks: Array<() => void> = [];\n let input: HTMLElement;\n if(!plainText) {\n if(init) {\n init();\n }\n\n this.container.innerHTML = `

`;\n\n input = this.container.firstElementChild as HTMLElement;\n input.contentEditable = '' + !!canBeEdited;\n // const observer = new MutationObserver(() => {\n // //checkAndSetRTL(input);\n\n // if(processInput) {\n // processInput();\n // }\n // });\n\n RichInputHandler.getInstance();\n\n input.addEventListener('mousedown', (e) => {\n const selection = document.getSelection();\n if(!selection.isCollapsed) {\n return;\n }\n\n const placeholder = findUpTag(e.target, 'IMG');\n if(!placeholder) {\n return;\n }\n\n const rect = placeholder.getBoundingClientRect();\n const centerX = rect.left + rect.width / 2;\n const focusOnNext = e.clientX >= centerX;\n\n const range = document.createRange();\n range.setStartAfter(focusOnNext ? placeholder : placeholder.previousSibling ?? placeholder);\n selection.removeAllRanges();\n selection.addRange(range);\n });\n\n onInputCallbacks.push(() => {\n // console.log('input');\n // return;\n // * because if delete all characters there will br left\n if(isInputEmpty(input)) {\n // const textNode = Array.from(input.childNodes).find((node) => node.nodeType === node.TEXT_NODE) || document.createTextNode('');\n input.replaceChildren();\n // input.append(document.createTextNode('')); // need first text node to support history stack\n }\n\n // const fillers = Array.from(input.querySelectorAll('.emoji-filler')) as HTMLElement[];\n // fillers.forEach((filler) => {\n // const textContent = filler.textContent;\n // if(textContent === BOM) {\n // return;\n // }\n\n // if(textContent) {\n\n // } else {\n // let curChild = filler.firstChild;\n // while(curChild) {\n // curChild = curChild.nextSibling;\n // }\n // }\n\n // filler.classList.remove('emoji-filler');\n // });\n\n // Array.from(input.querySelectorAll('br, span:empty')).forEach((el) => {\n // const parentElement = el.parentElement;\n // (parentElement === input ? el : parentElement).remove();\n // });\n USING_BOMS && Array.from(input.querySelectorAll('br:not(.br-not-br)')).forEach((el) => {\n // const parentElement = el.parentElement;\n el.remove();\n // if(!parentElement.children.length && !parentElement.textContent) {\n // parentElement.textContent = '';\n // }\n });\n\n insertCustomFillers(Array.from(input.querySelectorAll('.input-something')));\n\n processCustomEmojisInInput(input);\n\n // .forEach((el) => el.remove());\n });\n\n // ! childList for paste first symbol\n // observer.observe(input, {characterData: true, childList: true, subtree: true});\n } else {\n this.container.innerHTML = `\n \n `;\n\n input = this.container.firstElementChild as HTMLElement;\n // input.addEventListener('input', () => checkAndSetRTL(input));\n }\n\n setDirection(input);\n\n if(options.inputMode) {\n input.inputMode = options.inputMode;\n }\n\n if(placeholder) {\n _i18n(input, placeholder, undefined, 'placeholder');\n }\n\n if(label || placeholder) {\n const border = document.createElement('div');\n border.classList.add('input-field-border');\n this.container.append(border);\n }\n\n if(label) {\n this.label = document.createElement('label');\n this.setLabel();\n this.container.append(this.label);\n }\n\n if(maxLength) {\n const labelEl = this.container.lastElementChild as HTMLLabelElement;\n let showingLength = false;\n\n const onInput = () => {\n const wasError = input.classList.contains('error');\n // * https://stackoverflow.com/a/54369605 #2 to count emoji as 1 symbol\n const inputLength = plainText ? (input as HTMLInputElement).value.length : [...getRichValueWithCaret(input, false, false).value].length;\n const diff = maxLength - inputLength;\n const isError = diff < 0;\n input.classList.toggle('error', isError);\n\n // this.onLengthChange && this.onLengthChange(inputLength, isError);\n\n if(isError || diff <= showLengthOn) {\n this.setLabel();\n labelEl.append(` (${maxLength - inputLength})`);\n if(!showingLength) showingLength = true;\n } else if((wasError && !isError) || showingLength) {\n this.setLabel();\n showingLength = false;\n }\n };\n\n onInputCallbacks.push(onInput);\n }\n\n const noLinebreaks = !options.withLinebreaks;\n if(noLinebreaks && !plainText) {\n input.dataset.noLinebreaks = '1';\n input.addEventListener('keypress', (e) => {\n if(e.key === 'Enter') {\n e.preventDefault();\n return false;\n }\n });\n }\n\n if(onInputCallbacks.length) {\n input.addEventListener('input', () => {\n onInputCallbacks.forEach((callback) => callback());\n });\n }\n\n this.input = input;\n }\n\n public select() {\n if(!this.value) { // * avoid selecting whole empty field on iOS devices\n return;\n }\n\n if(this.options.plainText) {\n (this.input as HTMLInputElement).select(); // * select text\n } else {\n selectElementContents(this.input);\n }\n }\n\n public setLabel() {\n this.label.textContent = '';\n if(this.options.labelText) {\n setInnerHTML(this.label, this.options.labelText);\n } else {\n this.label.append(i18n(this.options.label, this.options.labelOptions));\n }\n }\n\n get value(): string {\n return this.options.plainText ? (this.input as HTMLInputElement).value : getRichValueWithCaret(this.input, false, false).value;\n // return getRichValue(this.input);\n }\n\n set value(value: Parameters[1]) {\n this.setValueSilently(value, true);\n this.simulateInputEvent();\n }\n\n public simulateInputEvent() {\n simulateEvent(this.input, 'input');\n }\n\n public setValueSilently(value: Parameters[1], fromSet?: boolean) {\n if(this.options.plainText) {\n (this.input as HTMLInputElement).value = value as string;\n } else {\n replaceContent(this.input, value);\n processCustomEmojisInInput(this.input);\n }\n }\n\n public isChanged() {\n return this.value !== this.originalValue;\n }\n\n public isValid() {\n return !this.input.classList.contains('error') &&\n (!this.validate || this.validate()) &&\n (!this.required || !isInputEmpty(this.input));\n }\n\n public isValidToChange() {\n return this.isValid() && this.isChanged();\n }\n\n public setDraftValue(value = '', silent?: boolean) {\n if(!this.options.plainText) {\n value = documentFragmentToHTML(wrapDraftText(value));\n }\n\n if(silent) {\n this.setValueSilently(value, false);\n } else {\n this.value = value;\n }\n }\n\n public setOriginalValue(value: InputField['originalValue'] = '', silent?: boolean) {\n this.originalValue = value;\n this.setDraftValue(value, silent);\n }\n\n public setState(state: InputState, label?: LangPackKey) {\n if(label) {\n this.label.textContent = '';\n this.label.append(i18n(label, this.options.labelOptions));\n } else {\n this.setLabel();\n }\n\n this.input.classList.toggle('error', !!(state & InputState.Error));\n this.input.classList.toggle('valid', !!(state & InputState.Valid));\n }\n\n public setError(label?: LangPackKey) {\n this.setState(InputState.Error, label);\n }\n}\n","// https://stackoverflow.com/a/6150060\nexport default function selectElementContents(el: HTMLElement) {\n const range = document.createRange();\n range.selectNodeContents(el);\n const sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {USING_BOMS} from '../helpers/dom/richInputHandler';\nimport BOM from '../helpers/string/bom';\nimport {_i18n} from '../lib/langPack';\nimport InputField, {InputFieldOptions} from './inputField';\nimport SetTransition from './singleTransition';\n\nconst USELESS_REG_EXP = new RegExp(`(${BOM})|()`, 'g');\n\nexport default class InputFieldAnimated extends InputField {\n public inputFake: HTMLElement;\n public onChangeHeight: (height: number) => void;\n\n // public onLengthChange: (length: number, isOverflow: boolean) => void;\n // protected wasInputFakeClientHeight: number;\n // protected showScrollDebounced: () => void;\n\n constructor(options?: InputFieldOptions) {\n super(options);\n\n this.input.addEventListener('input', () => {\n this.updateInnerHTML();\n this.onFakeInput();\n });\n\n if(options.placeholder) {\n _i18n(this.inputFake, options.placeholder, undefined, 'placeholder');\n }\n\n this.input.classList.add('scrollable', 'scrollable-y', 'no-scrollbar');\n // this.wasInputFakeClientHeight = 0;\n // this.showScrollDebounced = debounce(() => this.input.classList.remove('no-scrollbar'), 150, false, true);\n this.inputFake = document.createElement('div');\n // this.inputFake.contentEditable = 'true';\n this.inputFake.contentEditable = 'true';\n this.inputFake.tabIndex = -1;\n this.inputFake.className = this.input.className + ' input-field-input-fake';\n }\n\n public onFakeInput(setHeight = true, noAnimation?: boolean) {\n const {scrollHeight: newHeight/* , clientHeight */} = this.inputFake;\n /* if(this.wasInputFakeClientHeight && this.wasInputFakeClientHeight !== clientHeight) {\n this.input.classList.add('no-scrollbar'); // ! в сафари может вообще не появиться скролл после анимации, так как ему нужен полный reflow блока с overflow.\n this.showScrollDebounced();\n } */\n\n noAnimation ??= !this.input.isContentEditable;\n\n const currentHeight = +this.input.style.height.replace('px', '');\n if(currentHeight === newHeight) {\n return;\n }\n\n const TRANSITION_DURATION_FACTOR = 50;\n const transitionDuration = noAnimation ? 0 : Math.round(\n TRANSITION_DURATION_FACTOR * Math.log(Math.abs(newHeight - currentHeight))\n );\n\n // this.wasInputFakeClientHeight = clientHeight;\n this.input.style.transitionDuration = `${transitionDuration}ms`;\n\n if(setHeight) {\n this.onChangeHeight?.(newHeight);\n this.input.style.height = newHeight ? newHeight + 'px' : '';\n }\n\n const className = 'is-changing-height';\n SetTransition({\n element: this.input,\n className,\n forwards: true,\n duration: transitionDuration,\n onTransitionEnd: () => {\n this.input.classList.remove(className);\n }\n });\n }\n\n protected updateInnerHTML(innerHTML = this.input.innerHTML) {\n innerHTML = innerHTML.replace(//, '')\n .replace(/().+?\\/custom-emoji-element>/g, '$1')\n\n if(USING_BOMS) {\n innerHTML = innerHTML.replace(USELESS_REG_EXP, '');\n }\n\n this.inputFake.innerHTML = innerHTML;\n }\n\n public setValueSilently(value: Parameters[0], fromSet?: boolean) {\n super.setValueSilently(value, fromSet);\n\n this.updateInnerHTML();\n if(!fromSet) {\n this.onFakeInput();\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import { getRichValue } from \"../helpers/dom\";\nimport {LangPackKey} from '../lib/langPack';\nimport InputField from './inputField';\n\nexport default class InputSearch {\n public container: HTMLElement;\n public input: HTMLElement;\n public inputField: InputField;\n public clearBtn: HTMLElement;\n\n public prevValue = '';\n public timeout = 0;\n public onChange: (value: string) => void;\n public onClear: () => void;\n\n constructor(placeholder: LangPackKey, onChange?: (value: string) => void) {\n this.inputField = new InputField({\n placeholder,\n plainText: true\n });\n\n this.container = this.inputField.container;\n this.container.classList.remove('input-field');\n this.container.classList.add('input-search');\n\n this.onChange = onChange;\n\n this.input = this.inputField.input;\n this.input.classList.add('input-search-input');\n\n const searchIcon = document.createElement('i');\n searchIcon.classList.add('tgico', 'tgico-search');\n\n this.clearBtn = document.createElement('i');\n this.clearBtn.classList.add('tgico', 'btn-icon', 'tgico-close');\n\n this.input.addEventListener('input', this.onInput);\n this.clearBtn.addEventListener('click', this.onClearClick);\n\n this.container.append(searchIcon, this.clearBtn);\n }\n\n onInput = () => {\n if(!this.onChange) return;\n\n const value = this.value;\n\n // this.input.classList.toggle('is-empty', !value.trim());\n\n if(value !== this.prevValue) {\n this.prevValue = value;\n clearTimeout(this.timeout);\n this.timeout = window.setTimeout(() => {\n this.onChange(value);\n }, 200);\n }\n };\n\n onClearClick = () => {\n this.value = '';\n this.onChange && this.onChange('');\n this.onClear && this.onClear();\n };\n\n get value() {\n return this.inputField.value;\n }\n\n set value(value: string) {\n this.prevValue = value;\n clearTimeout(this.timeout);\n this.inputField.value = value;\n }\n\n public remove() {\n clearTimeout(this.timeout);\n this.input.removeEventListener('input', this.onInput);\n this.clearBtn.removeEventListener('click', this.onClearClick);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport VisibilityIntersector, {OnVisibilityChangeItem} from './visibilityIntersector';\nimport findAndSpliceAll from '../helpers/array/findAndSpliceAll';\nimport findAndSplice from '../helpers/array/findAndSplice';\nimport LazyLoadQueueIntersector, {LazyLoadElement} from './lazyLoadQueueIntersector';\nimport useHeavyAnimationCheck from '../hooks/useHeavyAnimationCheck';\n\nexport default class LazyLoadQueue extends LazyLoadQueueIntersector {\n constructor(parallelLimit?: number, ignoreHeavyAnimation?: boolean) {\n super(parallelLimit);\n\n this.intersector = new VisibilityIntersector(this.onVisibilityChange);\n\n !ignoreHeavyAnimation && useHeavyAnimationCheck(() => {\n this.lock();\n }, () => {\n this.unlockAndRefresh();\n });\n }\n\n private onVisibilityChange = ({target, visible}: OnVisibilityChangeItem) => {\n // if(DEBUG) {\n // this.log('isIntersecting', target, visible);\n // }\n\n // if visible - will move to the end of visible arary\n findAndSpliceAll(this.queue, (i) => i.div === target).forEach((item) => {\n if(visible) {\n item.wasSeen = true;\n }\n\n item.visible = visible;\n const index = this.queue.findIndex((item) => !item.visible);\n this.queue.splice(Math.max(0, index), 0, item);\n });\n\n this.setProcessQueueTimeout();\n };\n\n protected getItem() {\n return findAndSplice(this.queue, (item) => item.wasSeen);\n }\n\n public async processItem(item: LazyLoadElement) {\n await super.processItem(item);\n this.intersector.unobserve(item.div);\n }\n\n protected addElement(method: 'push' | 'unshift', el: LazyLoadElement) {\n const inserted = super.addElement(method, el);\n\n if(!inserted) return false;\n\n this.observe(el);\n /* if(el.wasSeen) {\n this.processQueue(el);\n } else */\n el.wasSeen ??= false;\n\n return true;\n }\n\n public setAllSeen() {\n this.queue.forEach((item) => {\n item.wasSeen = true;\n });\n\n this.setProcessQueueTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport findAndSpliceAll from '../helpers/array/findAndSpliceAll';\nimport LazyLoadQueueBase, {LazyLoadElementBase} from './lazyLoadQueueBase';\nimport VisibilityIntersector from './visibilityIntersector';\n\nexport type LazyLoadElement = Omit & {\n load: (target?: HTMLElement) => Promise,\n div: HTMLElement\n wasSeen?: boolean,\n visible?: boolean\n};\n\nexport default class LazyLoadQueueIntersector extends LazyLoadQueueBase {\n protected queue: Array = [];\n protected inProcess: Set = new Set();\n\n public intersector: VisibilityIntersector;\n protected intersectorTimeout: number;\n\n constructor(parallelLimit?: number) {\n super(parallelLimit);\n }\n\n public lock() {\n super.lock();\n this.intersector.lock();\n }\n\n public unlock() {\n super.unlock();\n this.intersector.unlock();\n }\n\n public unlockAndRefresh() {\n super.unlock();\n this.intersector.unlockAndRefresh();\n }\n\n public clear() {\n super.clear();\n this.intersector.disconnect();\n }\n\n public refresh() {\n this.intersector.refresh();\n }\n\n protected loadItem(item: LazyLoadElement) {\n return item.load(item.div);\n }\n\n protected addElement(method: 'push' | 'unshift', el: LazyLoadElement) {\n const item = this.queue.find((i) => i.div === el.div && i.load === el.load);\n if(item) {\n return false;\n } else {\n for(const item of this.inProcess) {\n if(item.div === el.div && item.load === el.load) {\n return false;\n }\n }\n }\n\n this.queue[method](el);\n return true;\n }\n\n protected setProcessQueueTimeout() {\n this.intersectorTimeout ??= window.setTimeout(() => {\n this.intersectorTimeout = undefined;\n this.processQueue();\n }, 0);\n }\n\n public push(el: LazyLoadElement) {\n super.push(el);\n }\n\n public unshift(el: LazyLoadElement) {\n super.unshift(el);\n }\n\n public delete(el: Omit) {\n findAndSpliceAll(this.queue, (i) => i.div === el.div);\n this.unobserve(el);\n }\n\n public observe(el: LazyLoadElement) {\n this.intersector.observe(el.div);\n }\n\n public unobserve(el: Omit) {\n this.intersector.unobserve(el.div);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {GrabEvent} from '../helpers/dom/attachGrabListeners';\nimport appMediaPlaybackController from './appMediaPlaybackController';\nimport RangeSelector from './rangeSelector';\n\nexport default class MediaProgressLine extends RangeSelector {\n protected filledLoad: HTMLDivElement;\n\n protected progressRAF: number;\n\n protected media: HTMLMediaElement;\n protected streamable: boolean;\n\n // protected lastOnPlayTime: number;\n // protected lastOnPlayCurrentTime: number;\n\n constructor(protected options: {\n withTransition?: boolean,\n useTransform?: boolean,\n onSeekStart?: () => void,\n onSeekEnd?: () => void\n } = {}) {\n super({\n step: 1000 / 60 / 1000,\n min: 0,\n max: 1,\n withTransition: options.withTransition,\n useTransform: options.useTransform\n }, 0);\n }\n\n public setMedia({\n media,\n streamable,\n duration\n }: {\n media: HTMLMediaElement,\n streamable?: boolean,\n duration?: number\n }) {\n if(this.media) {\n this.removeListeners();\n }\n\n if(streamable && !this.filledLoad) {\n this.filledLoad = document.createElement('div');\n this.filledLoad.classList.add('progress-line__filled', 'progress-line__loaded');\n this.container.prepend(this.filledLoad);\n // this.setLoadProgress();\n } else if(this.filledLoad) {\n this.filledLoad.classList.toggle('hide', !streamable);\n }\n\n this.media = media;\n this.streamable = streamable;\n if(!media.paused || media.currentTime > 0) {\n this.onPlay();\n }\n\n let wasPlaying = false;\n this.setSeekMax(duration);\n this.setListeners();\n this.setHandlers({\n onMouseDown: () => {\n wasPlaying = !this.media.paused;\n wasPlaying && this.media.pause();\n this.options?.onSeekStart?.();\n },\n\n onMouseUp: (e) => {\n // cancelEvent(e.event);\n wasPlaying && this.media.play();\n this.options?.onSeekEnd?.();\n }\n });\n }\n\n protected onLoadedData = () => {\n this.setSeekMax();\n };\n\n protected onEnded = () => {\n this.setProgress();\n };\n\n protected onPlay = () => {\n const r = () => {\n this.setProgress();\n\n this.progressRAF = this.media.paused ? undefined : window.requestAnimationFrame(r);\n };\n\n if(this.progressRAF) {\n window.cancelAnimationFrame(this.progressRAF);\n this.progressRAF = undefined;\n }\n\n if(this.streamable) {\n this.setLoadProgress();\n }\n\n // this.lastOnPlayTime = Date.now();\n // this.lastOnPlayCurrentTime = this.media.currentTime;\n r();\n // this.progressRAF = window.requestAnimationFrame(r);\n };\n\n protected onTimeUpdate = () => {\n if(this.media.paused) {\n this.setProgress();\n\n if(this.streamable) {\n this.setLoadProgress();\n }\n }\n };\n\n protected onProgress = (e: Event) => {\n this.setLoadProgress();\n };\n\n protected scrub(e: GrabEvent) {\n const scrubTime = super.scrub(e);\n this.media.currentTime = scrubTime;\n return scrubTime;\n }\n\n protected setLoadProgress() {\n if(appMediaPlaybackController.isSafariBuffering(this.media)) return;\n const buf = this.media.buffered;\n const numRanges = buf.length;\n\n const currentTime = this.media.currentTime;\n let nearestStart = 0, end = 0;\n for(let i = 0; i < numRanges; ++i) {\n const start = buf.start(i);\n if(currentTime >= start && start >= nearestStart) {\n nearestStart = start;\n end = buf.end(i);\n }\n\n // console.log('onProgress range:', i, buf.start(i), buf.end(i), this.media);\n }\n\n // console.log('onProgress correct range:', nearestStart, end, this.media);\n\n const percents = this.max ? end / this.max : 0;\n this.filledLoad.style.width = (percents * 100) + '%';\n // this.filledLoad.style.transform = 'scaleX(' + percents + ')';\n }\n\n protected setSeekMax(duration?: number) {\n const realDuration = this.media.duration || 0;\n if(duration === undefined || realDuration) duration = realDuration;\n if(this.max = duration) {\n this.seek.setAttribute('max', '' + this.max);\n } else {\n this.media.addEventListener('loadeddata', this.onLoadedData);\n }\n }\n\n public setProgress() {\n if(appMediaPlaybackController.isSafariBuffering(this.media)) return;\n\n // fix jumping progress on play\n // let currentTime: number;\n // const diff = (Date.now() - this.lastOnPlayTime) / 1000;\n // if(!this.media.paused && this.lastOnPlayTime && diff <= 1) {\n // currentTime = this.lastOnPlayCurrentTime + diff;\n // } else {\n // currentTime = this.media.currentTime;\n // }\n\n const currentTime = this.media.currentTime;\n super.setProgress(currentTime);\n }\n\n public setListeners() {\n super.setListeners();\n this.media.addEventListener('ended', this.onEnded);\n this.media.addEventListener('play', this.onPlay);\n this.media.addEventListener('pause', this.onTimeUpdate);\n this.media.addEventListener('timeupdate', this.onTimeUpdate);\n this.streamable && this.media.addEventListener('progress', this.onProgress);\n }\n\n public removeListeners() {\n super.removeListeners();\n\n if(this.media) {\n this.media.removeEventListener('loadeddata', this.onLoadedData);\n this.media.removeEventListener('ended', this.onEnded);\n this.media.removeEventListener('play', this.onPlay);\n this.media.removeEventListener('pause', this.onTimeUpdate);\n this.media.removeEventListener('timeupdate', this.onTimeUpdate);\n this.streamable && this.media.removeEventListener('progress', this.onProgress);\n }\n\n if(this.progressRAF) {\n window.cancelAnimationFrame(this.progressRAF);\n this.progressRAF = undefined;\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {FontFamily, FontSize, FontWeight} from '../config/font';\nimport getTextWidth from '../helpers/canvas/getTextWidth';\nimport mediaSizes from '../helpers/mediaSizes';\nimport clamp from '../helpers/number/clamp';\nimport {fastRaf} from '../helpers/schedulers';\n\n// Thanks to https://stackoverflow.com/a/49349813\n\n/**\n * Attibute modifier to create middle ellipsis\n * When the attribute value is left blank the ellipsis will be in the middle\n * When positive the attribute value will be used as a percentage\n * When negative the attribute value will be used as character index counted from the end\n * @example\n *
A Javascript solution to middle ellipsis
\n *
A Javascript solution to middle ellipsis
\n *
A Javascript solution to middle ellipsis
\n */\nconst ellipsis = '…';\nconst map: Map = new Map();\n\nconst testQueue: Set = new Set();\nconst fontSize = '16px';\nlet pendingTest = false;\n\nfunction setTestQueue() {\n if(pendingTest) {\n return;\n }\n\n pendingTest = true;\n fastRaf(() => {\n pendingTest = false;\n testQueueElements();\n });\n}\n\nfunction testQueueElements() {\n testQueue.forEach(testElement);\n testQueue.clear();\n}\n\nwindow.addEventListener('resize', () => {\n for(const [key] of map) {\n testQueue.add(key);\n }\n\n setTestQueue();\n}, {capture: true, passive: true});\n\nfunction getElementWidth(element: HTMLElement) {\n const getSize = (element as any).getSize;\n if(getSize) {\n return getSize();\n }\n\n const type = element.dataset.sizeType;\n if(type) {\n const mediaSize = mediaSizes.active;\n // @ts-ignore\n const size: MediaSize = mediaSize[type];\n return size.width;\n }\n\n return element.getBoundingClientRect().width;\n}\n\nfunction testElement(element: HTMLElement) {\n // const perf = performance.now();\n // do not recalculate variables a second time\n let mapped = map.get(element);\n const firstTime = !mapped;\n\n let {text, textLength, from, multiplier, font, textWidth, elementWidth} = mapped || {};\n // console.log('[MEE] testElement got mapped', mapped);\n\n if(firstTime) {\n text = element.textContent;\n textLength = text.length;\n from = /* parseFloat(element.getAttribute(attributeName)) || */50;\n multiplier = from > 0 && from / 100;\n\n let fontSize = element.dataset.fontSize;\n if(fontSize && +fontSize) fontSize += 'px';\n // const perf = performance.now();\n font = `${element.dataset.fontWeight || FontWeight} ${fontSize || FontSize} ${FontFamily}`;\n /* const computedStyle = window.getComputedStyle(elm, null);\n font = `${computedStyle.getPropertyValue('font-weight')} ${computedStyle.getPropertyValue('font-size')} ${computedStyle.getPropertyValue('font-family')}`; */\n // console.log('testMiddleEllipsis get computed style:', performance.now() - perf, font);\n\n textWidth = getTextWidth(text, font);\n // const perf = performance.now();\n elementWidth = getElementWidth(element);\n // console.log('testMiddleEllipsis get offsetWidth:', performance.now() - perf, font);\n mapped = {text, textLength, from, multiplier, font, textWidth, elementWidth};\n map.set(element, mapped);\n\n // console.log('[MEE] testElement map set', element);\n }\n\n const newElementWidth = getElementWidth(element);\n const widthChanged = firstTime || elementWidth !== newElementWidth;\n !firstTime && widthChanged && (mapped.elementWidth = elementWidth = newElementWidth);\n\n if(widthChanged) {\n if(textWidth > elementWidth) {\n element.setAttribute('title', text);\n let smallerText = text;\n let smallerWidth = elementWidth;\n while(smallerText.length > 3) {\n const smallerTextLength = smallerText.length;\n const half = multiplier &&\n clamp(multiplier * smallerTextLength << 0, 1, smallerTextLength - 2) ||\n Math.max(smallerTextLength + from - 1, 1);\n const half1 = smallerText.substr(0, half).replace(/\\s*$/, '');\n const half2 = smallerText.substr(half + 1).replace(/^\\s*/, '');\n smallerText = half1 + half2;\n smallerWidth = getTextWidth(smallerText + ellipsis, font);\n if(smallerWidth < elementWidth) {\n element.textContent = half1 + ellipsis + half2;\n break;\n }\n }\n\n // * set new width after cutting text\n mapped.elementWidth = getElementWidth(element);\n // mapped.textWidth = smallerWidth;\n } else {\n element.removeAttribute('title');\n }\n }\n\n // console.log('testMiddleEllipsis for element:', elm, performance.now() - perf);\n}\n\nexport class MiddleEllipsisElement extends HTMLElement {\n connectedCallback() {\n // console.log('[MEE]: connectedCallback before', map.has(this), testQueue.has(this), map.size, this.textContent, map);\n\n map.set(this, null);\n if(this.dataset.sizeType || (this as any).getSize) {\n testElement(this);\n } else {\n testQueue.add(this);\n setTestQueue();\n }\n // testElement(this);\n\n // console.log('[MEE]: connectedCallback after', map.has(this), map.size, testQueue.has(this), testQueue.size);\n }\n\n disconnectedCallback() {\n const deleted = map.delete(this);\n testQueue.delete(this);\n // console.log('[MEE]: disconnectedCallback', deleted, map.has(this), map.size, this.textContent, map);\n }\n}\n\ncustomElements.define('middle-ellipsis-element', MiddleEllipsisElement);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport lottieLoader, {LottieLoader} from '../../lib/rlottie/lottieLoader';\nimport RLottiePlayer from '../../lib/rlottie/rlottiePlayer';\nimport PasswordInputField from '../passwordInputField';\n\nexport default class PasswordMonkey {\n public container: HTMLElement;\n public animation: RLottiePlayer;\n public needFrame = 0;\n protected loadPromise: ReturnType;\n\n constructor(protected passwordInputField: PasswordInputField, protected size: number) {\n this.container = document.createElement('div');\n this.container.classList.add('media-sticker-wrapper');\n }\n\n public load() {\n if(this.loadPromise) return this.loadPromise;\n return this.loadPromise = lottieLoader.loadAnimationAsAsset({\n container: this.container,\n loop: false,\n autoplay: false,\n width: this.size,\n height: this.size,\n noCache: true\n // }, 'assets/img/TwoFactorSetupMonkeyClose.tgs').then((_animation) => {\n }, 'TwoFactorSetupMonkeyPeek').then((_animation) => {\n // return;\n this.animation = _animation;\n this.animation.addEventListener('enterFrame', currentFrame => {\n // console.log('enterFrame', currentFrame, this.needFrame);\n\n if((this.animation.direction === 1 && currentFrame >= this.needFrame) ||\n (this.animation.direction === -1 && currentFrame <= this.needFrame)) {\n this.animation.setSpeed(1);\n this.animation.pause();\n }\n });\n\n this.passwordInputField.helpers.onVisibilityClickAdditional = () => {\n if(this.passwordInputField.helpers.passwordVisible) {\n this.animation.setDirection(1);\n this.animation.curFrame = 0;\n this.needFrame = 16;\n this.animation.play();\n } else {\n this.animation.setDirection(-1);\n this.animation.curFrame = 16;\n this.needFrame = 0;\n this.animation.play();\n }\n };\n\n return lottieLoader.waitForFirstFrame(_animation);\n });\n }\n\n public remove() {\n if(this.animation) {\n this.animation.remove();\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport InputField from '../inputField';\nimport lottieLoader from '../../lib/rlottie/lottieLoader';\nimport RLottiePlayer from '../../lib/rlottie/rlottiePlayer';\n\nexport default class TrackingMonkey {\n public container: HTMLElement;\n\n protected max = 45;\n protected needFrame = 0;\n\n protected animation: RLottiePlayer;\n protected idleAnimation: RLottiePlayer;\n\n protected loadPromise: Promise;\n\n constructor(protected inputField: InputField, protected size: number) {\n this.container = document.createElement('div');\n this.container.classList.add('media-sticker-wrapper');\n\n const input = inputField.input;\n\n input.addEventListener('blur', () => {\n this.playAnimation(0);\n });\n\n input.addEventListener('input', (e) => {\n this.playAnimation(inputField.value.length);\n });\n\n /* codeInput.addEventListener('focus', () => {\n playAnimation(Math.max(codeInput.value.length, 1));\n }); */\n }\n\n // 1st symbol = frame 15\n // end symbol = frame 165\n public playAnimation(length: number) {\n if(!this.animation) return;\n\n length = Math.min(length, 30);\n let frame: number;\n if(length) {\n frame = Math.round(Math.min(this.max, length) * (165 / this.max) + 11.33);\n\n if(this.idleAnimation) {\n this.idleAnimation.stop(true);\n this.idleAnimation.canvas[0].style.display = 'none';\n }\n\n this.animation.canvas[0].style.display = '';\n } else {\n /* const cb = (frameNo: number) => {\n if(frameNo <= 1) { */\n /* idleAnimation.play();\n idleAnimation.canvas.style.display = '';\n animation.canvas.style.display = 'none'; */\n /* animation.removeListener('enterFrame', cb);\n }\n };\n animation.addListener('enterFrame', cb); */\n\n frame = 0;\n }\n // animation.playSegments([1, 2]);\n\n const direction = this.needFrame > frame ? -1 : 1;\n // console.log('keydown', length, frame, direction);\n\n this.animation.setDirection(direction);\n if(this.needFrame !== 0 && frame === 0) {\n this.animation.setSpeed(7);\n }\n /* let diff = Math.abs(needFrame - frame * direction);\n if((diff / 20) > 1) animation.setSpeed(diff / 20 | 0); */\n this.needFrame = frame;\n\n this.animation.play();\n\n /* animation.goToAndStop(15, true); */\n // animation.goToAndStop(length / max * );\n }\n\n public load() {\n if(this.loadPromise) return this.loadPromise;\n return this.loadPromise = Promise.all([\n lottieLoader.loadAnimationAsAsset({\n container: this.container,\n loop: true,\n autoplay: true,\n width: this.size,\n height: this.size\n }, 'TwoFactorSetupMonkeyIdle').then((animation) => {\n this.idleAnimation = animation;\n\n // ! animationIntersector will stop animation instantly\n if(!this.inputField.value.length) {\n animation.play();\n }\n\n return lottieLoader.waitForFirstFrame(animation);\n }),\n\n lottieLoader.loadAnimationAsAsset({\n container: this.container,\n loop: false,\n autoplay: false,\n width: this.size,\n height: this.size\n }, 'TwoFactorSetupMonkeyTracking').then((_animation) => {\n this.animation = _animation;\n\n if(!this.inputField.value.length) {\n this.animation.canvas[0].style.display = 'none';\n }\n\n this.animation.addEventListener('enterFrame', currentFrame => {\n // console.log('enterFrame', currentFrame, needFrame);\n // let currentFrame = Math.round(e.currentTime);\n\n if((this.animation.direction === 1 && currentFrame >= this.needFrame) ||\n (this.animation.direction === -1 && currentFrame <= this.needFrame)) {\n this.animation.setSpeed(1);\n this.animation.pause();\n }\n\n if(currentFrame === 0 && this.needFrame === 0) {\n // animation.curFrame = 0;\n\n if(this.idleAnimation) {\n this.idleAnimation.canvas[0].style.display = '';\n this.idleAnimation.play();\n this.animation.canvas[0].style.display = 'none';\n }\n }\n });\n // console.log(animation.getDuration(), animation.getDuration(true));\n\n return lottieLoader.waitForFirstFrame(_animation);\n })\n ]);\n }\n\n public remove() {\n if(this.animation) this.animation.remove();\n if(this.idleAnimation) this.idleAnimation.remove();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport InputField, {InputFieldOptions} from './inputField';\n\nexport class PasswordInputHelpers {\n public passwordVisible = false;\n public toggleVisible: HTMLElement;\n public onVisibilityClickAdditional: () => void;\n\n constructor(public container: HTMLElement, public input: HTMLInputElement) {\n input.type = 'password';\n input.setAttribute('required', '');\n input.name = 'notsearch_password';\n input.autocomplete = 'off';\n\n // * https://stackoverflow.com/a/35949954/6758968\n const stealthy = document.createElement('input');\n stealthy.classList.add('stealthy');\n stealthy.tabIndex = -1;\n stealthy.type = 'password';\n input.parentElement.prepend(stealthy);\n input.parentElement.insertBefore(stealthy.cloneNode(), input.nextSibling);\n\n /* if(IS_SAFARI && !IS_MOBILE_SAFARI) {\n input.setAttribute('readonly', '');\n input.addEventListener('focus', () => {\n input.removeAttribute('readonly');\n }, {once: true});\n } */\n\n const toggleVisible = this.toggleVisible = document.createElement('span');\n toggleVisible.classList.add('toggle-visible', 'tgico');\n\n container.classList.add('input-field-password');\n container.append(toggleVisible);\n\n toggleVisible.addEventListener('click', this.onVisibilityClick);\n toggleVisible.addEventListener('touchend', this.onVisibilityClick);\n }\n\n public onVisibilityClick = (e: Event) => {\n cancelEvent(e);\n this.passwordVisible = !this.passwordVisible;\n\n this.toggleVisible.classList.toggle('eye-hidden', this.passwordVisible);\n (this.input as HTMLInputElement).type = this.passwordVisible ? 'text' : 'password';\n this.onVisibilityClickAdditional && this.onVisibilityClickAdditional();\n };\n}\n\nexport default class PasswordInputField extends InputField {\n public helpers: PasswordInputHelpers;\n\n constructor(options: InputFieldOptions = {}) {\n super({\n plainText: true,\n ...options\n });\n\n this.helpers = new PasswordInputHelpers(this.container, this.input as HTMLInputElement);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_PARALLAX_SUPPORTED from '../environment/parallaxSupport';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport findAndSplice from '../helpers/array/findAndSplice';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport filterChatPhotosMessages from '../helpers/filterChatPhotosMessages';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport ListLoader from '../helpers/listLoader';\nimport {fastRaf} from '../helpers/schedulers';\nimport {Message, ChatFull, MessageAction, Photo} from '../layer';\nimport type {AppMessagesManager} from '../lib/appManagers/appMessagesManager';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport choosePhotoSize from '../lib/appManagers/utils/photos/choosePhotoSize';\nimport {openAvatarViewer} from './avatar';\nimport {putAvatar} from './putPhoto';\nimport Scrollable from './scrollable';\nimport SwipeHandler from './swipeHandler';\nimport wrapPhoto from './wrappers/photo';\n\nconst LOAD_NEAREST = 3;\n\nexport default class PeerProfileAvatars {\n private static BASE_CLASS = 'profile-avatars';\n private static SCALE = IS_PARALLAX_SUPPORTED ? 2 : 1;\n private static TRANSLATE_TEMPLATE = IS_PARALLAX_SUPPORTED ? `translate3d({x}, 0, -1px) scale(${PeerProfileAvatars.SCALE})` : 'translate({x}, 0)';\n public container: HTMLElement;\n public avatars: HTMLElement;\n public gradient: HTMLElement;\n public info: HTMLElement;\n public arrowPrevious: HTMLElement;\n public arrowNext: HTMLElement;\n private tabs: HTMLDivElement;\n private listLoader: ListLoader;\n private peerId: PeerId;\n private intersectionObserver: IntersectionObserver;\n private loadCallbacks: Map void>;\n private listenerSetter: ListenerSetter;\n private swipeHandler: SwipeHandler;\n\n constructor(\n public scrollable: Scrollable,\n private managers: AppManagers\n ) {\n this.container = document.createElement('div');\n this.container.classList.add(PeerProfileAvatars.BASE_CLASS + '-container');\n\n this.avatars = document.createElement('div');\n this.avatars.classList.add(PeerProfileAvatars.BASE_CLASS + '-avatars');\n\n this.gradient = document.createElement('div');\n this.gradient.classList.add(PeerProfileAvatars.BASE_CLASS + '-gradient');\n\n this.info = document.createElement('div');\n this.info.classList.add(PeerProfileAvatars.BASE_CLASS + '-info');\n\n this.tabs = document.createElement('div');\n this.tabs.classList.add(PeerProfileAvatars.BASE_CLASS + '-tabs');\n\n this.arrowPrevious = document.createElement('div');\n this.arrowPrevious.classList.add(PeerProfileAvatars.BASE_CLASS + '-arrow', 'tgico-avatarprevious');\n\n /* const previousIcon = document.createElement('i');\n previousIcon.classList.add(PeerProfileAvatars.BASE_CLASS + '-arrow-icon', 'tgico-previous');\n this.arrowBack.append(previousIcon); */\n\n this.arrowNext = document.createElement('div');\n this.arrowNext.classList.add(PeerProfileAvatars.BASE_CLASS + '-arrow', PeerProfileAvatars.BASE_CLASS + '-arrow-next', 'tgico-avatarnext');\n\n /* const nextIcon = document.createElement('i');\n nextIcon.classList.add(PeerProfileAvatars.BASE_CLASS + '-arrow-icon', 'tgico-next');\n this.arrowNext.append(nextIcon); */\n\n this.container.append(this.avatars, this.gradient, this.info, this.tabs, this.arrowPrevious, this.arrowNext);\n\n this.loadCallbacks = new Map();\n this.listenerSetter = new ListenerSetter();\n\n const checkScrollTop = () => {\n if(this.scrollable.scrollTop !== 0) {\n this.scrollable.scrollIntoViewNew({\n element: this.scrollable.container.firstElementChild as HTMLElement,\n position: 'start'\n });\n return false;\n }\n\n return true;\n };\n\n const SWITCH_ZONE = 1 / 3;\n let cancel = false;\n let freeze = false;\n attachClickEvent(this.container, async(_e) => {\n if(freeze) {\n cancelEvent(_e);\n return;\n }\n\n if(cancel) {\n cancel = false;\n return;\n }\n\n if(!checkScrollTop()) {\n return;\n }\n\n const rect = this.container.getBoundingClientRect();\n\n // const e = (_e as TouchEvent).touches ? (_e as TouchEvent).touches[0] : _e as MouseEvent;\n const e = _e;\n const x = e.pageX;\n\n const clickX = x - rect.left;\n if((!this.listLoader.previous.length && !this.listLoader.next.length) ||\n (clickX > (rect.width * SWITCH_ZONE) && clickX < (rect.width - rect.width * SWITCH_ZONE))) {\n const peerId = this.peerId;\n\n const targets: {element: HTMLElement, item: Photo.photo['id'] | Message.messageService}[] = [];\n this.listLoader.previous.concat(this.listLoader.current, this.listLoader.next).forEach((item, idx) => {\n targets.push({\n element: /* null */this.avatars.children[idx] as HTMLElement,\n item\n });\n });\n\n const prevTargets = targets.slice(0, this.listLoader.previous.length);\n const nextTargets = targets.slice(this.listLoader.previous.length + 1);\n\n const target = this.avatars.children[this.listLoader.previous.length] as HTMLElement;\n freeze = true;\n openAvatarViewer(target, peerId, () => peerId === this.peerId, this.listLoader.current, prevTargets, nextTargets);\n freeze = false;\n } else {\n const centerX = rect.right - (rect.width / 2);\n const toRight = x > centerX;\n\n // this.avatars.classList.remove('no-transition');\n // fastRaf(() => {\n this.avatars.classList.add('no-transition');\n void this.avatars.offsetLeft; // reflow\n\n let distance: number;\n if(this.listLoader.index === 0 && !toRight) distance = this.listLoader.count - 1;\n else if(this.listLoader.index === (this.listLoader.count - 1) && toRight) distance = -(this.listLoader.count - 1);\n else distance = toRight ? 1 : -1;\n this.listLoader.go(distance);\n\n fastRaf(() => {\n this.avatars.classList.remove('no-transition');\n });\n // });\n }\n }, {listenerSetter: this.listenerSetter});\n\n const cancelNextClick = () => {\n cancel = true;\n document.body.addEventListener(IS_TOUCH_SUPPORTED ? 'touchend' : 'click', (e) => {\n cancel = false;\n }, {once: true});\n };\n\n let width = 0, x = 0, lastDiffX = 0, /* lastIndex = 0, */ minX = 0;\n const swipeHandler = this.swipeHandler = new SwipeHandler({\n element: this.avatars,\n onSwipe: (xDiff, yDiff) => {\n xDiff *= -1;\n yDiff *= -1;\n\n lastDiffX = xDiff;\n let lastX = x + xDiff * -PeerProfileAvatars.SCALE;\n if(lastX > 0) lastX = 0;\n else if(lastX < minX) lastX = minX;\n\n this.avatars.style.transform = PeerProfileAvatars.TRANSLATE_TEMPLATE.replace('{x}', lastX + 'px');\n // console.log(xDiff, yDiff);\n return false;\n },\n verifyTouchTarget: (e) => {\n if(!checkScrollTop()) {\n cancelNextClick();\n cancelEvent(e as any as Event);\n return false;\n } else if(this.container.classList.contains('is-single') || freeze) {\n return false;\n }\n\n return true;\n },\n onFirstSwipe: () => {\n const rect = this.avatars.getBoundingClientRect();\n width = rect.width;\n minX = -width * (this.tabs.childElementCount - 1);\n\n /* lastIndex = whichChild(this.tabs.querySelector('.active'));\n x = -width * lastIndex; */\n x = rect.left - this.container.getBoundingClientRect().left;\n\n this.avatars.style.transform = PeerProfileAvatars.TRANSLATE_TEMPLATE.replace('{x}', x + 'px');\n\n this.container.classList.add('is-swiping');\n this.avatars.classList.add('no-transition');\n void this.avatars.offsetLeft; // reflow\n },\n onReset: () => {\n const addIndex = Math.ceil(Math.abs(lastDiffX) / (width / PeerProfileAvatars.SCALE)) * (lastDiffX >= 0 ? 1 : -1);\n cancelNextClick();\n\n // console.log(addIndex);\n\n this.avatars.classList.remove('no-transition');\n fastRaf(() => {\n this.listLoader.go(addIndex);\n this.container.classList.remove('is-swiping');\n });\n }\n });\n\n this.intersectionObserver = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n if(!entry.isIntersecting) {\n return;\n }\n\n this.loadNearestToTarget(entry.target);\n });\n });\n\n /* this.listenerSetter.add(rootScope)('avatar_update', (peerId) => {\n if(this.peerId === peerId) {\n const photo = appPeersManager.getPeerPhoto(peerId);\n if(photo) {\n const id = photo.photo_id;\n const previous = this.listLoader.previous;\n for(let i = 0; i < previous.length; ++i) {\n if(previous[i] === id)\n }\n this.listLoader.previous.forEach((_id, idx, arr) => {});\n }\n }\n }); */\n }\n\n public async setPeer(peerId: PeerId) {\n this.peerId = peerId;\n\n const photo = await this.managers.appPeersManager.getPeerPhoto(peerId);\n if(!photo) {\n return;\n }\n\n const listLoader: PeerProfileAvatars['listLoader'] = this.listLoader = new ListLoader({\n loadCount: 50,\n loadMore: (anchor, older, loadCount) => {\n if(!older) return Promise.resolve({count: undefined, items: []});\n\n if(peerId.isUser()) {\n const maxId: Photo.photo['id'] = anchor as any;\n return this.managers.appPhotosManager.getUserPhotos(peerId, maxId, loadCount).then((value) => {\n return {\n count: value.count,\n items: value.photos\n };\n });\n } else {\n const promises: [Promise | ChatFull, ReturnType] = [] as any;\n if(!listLoader.current) {\n promises.push(this.managers.appProfileManager.getChatFull(peerId.toChatId()));\n }\n\n promises.push(this.managers.appMessagesManager.getSearch({\n peerId,\n maxId: Number.MAX_SAFE_INTEGER,\n inputFilter: {\n _: 'inputMessagesFilterChatPhotos'\n },\n limit: loadCount,\n backLimit: 0\n }));\n\n return Promise.all(promises).then(async(result) => {\n const value = result.pop() as typeof result[1];\n\n filterChatPhotosMessages(value);\n\n if(!listLoader.current) {\n const chatFull = result[0];\n const message = findAndSplice(value.history, (message) => {\n return ((message as Message.messageService).action as MessageAction.messageActionChannelEditPhoto).photo.id === chatFull.chat_photo.id;\n }) as Message.messageService;\n\n listLoader.current = message || await this.managers.appMessagesManager.generateFakeAvatarMessage(this.peerId, chatFull.chat_photo);\n }\n\n // console.log('avatars loaded:', value);\n return {\n count: value.count,\n items: value.history\n };\n });\n }\n },\n processItem: this.processItem,\n onJump: (item, older) => {\n const id = this.listLoader.index;\n // const nextId = Math.max(0, id);\n const x = 100 * PeerProfileAvatars.SCALE * id;\n this.avatars.style.transform = PeerProfileAvatars.TRANSLATE_TEMPLATE.replace('{x}', `-${x}%`);\n\n const activeTab = this.tabs.querySelector('.active');\n if(activeTab) activeTab.classList.remove('active');\n\n const tab = this.tabs.children[id] as HTMLElement;\n tab.classList.add('active');\n\n this.loadNearestToTarget(this.avatars.children[id]);\n }\n });\n\n if(photo._ === 'userProfilePhoto') {\n listLoader.current = photo.photo_id;\n }\n\n await this.processItem(listLoader.current);\n\n // listLoader.loaded\n listLoader.load(true);\n }\n\n public addTab() {\n const tab = document.createElement('div');\n tab.classList.add(PeerProfileAvatars.BASE_CLASS + '-tab');\n this.tabs.append(tab);\n\n if(this.tabs.childElementCount === 1) {\n tab.classList.add('active');\n }\n\n this.container.classList.toggle('is-single', this.tabs.childElementCount <= 1);\n }\n\n public processItem = async(photoId: Photo.photo['id'] | Message.messageService) => {\n const avatar = document.createElement('div');\n avatar.classList.add(PeerProfileAvatars.BASE_CLASS + '-avatar', 'media-container', 'hide');\n\n this.avatars.append(avatar);\n\n let photo: Photo.photo;\n if(photoId) {\n photo = typeof(photoId) !== 'object' ?\n await this.managers.appPhotosManager.getPhoto(photoId) :\n (photoId.action as MessageAction.messageActionChannelEditPhoto).photo as Photo.photo;\n }\n\n const img = new Image();\n img.classList.add('avatar-photo');\n img.draggable = false;\n\n const loadCallback = async() => {\n if(photo) {\n const res = await wrapPhoto({\n container: avatar,\n photo,\n size: choosePhotoSize(photo, 420, 420, false),\n withoutPreloader: true\n });\n\n [res.images.thumb, res.images.full].filter(Boolean).forEach((img) => {\n img.classList.add('avatar-photo');\n });\n } else {\n const photo = await this.managers.appPeersManager.getPeerPhoto(this.peerId);\n await putAvatar(avatar, this.peerId, photo, 'photo_big', img);\n }\n\n avatar.classList.remove('hide');\n };\n\n if(this.avatars.childElementCount <= LOAD_NEAREST) {\n await loadCallback();\n } else {\n this.intersectionObserver.observe(avatar);\n this.loadCallbacks.set(avatar, loadCallback);\n }\n\n this.addTab();\n\n return photoId;\n };\n\n private loadNearestToTarget(target: Element) {\n const children = Array.from(target.parentElement.children);\n const idx = children.indexOf(target);\n const slice = children.slice(Math.max(0, idx - LOAD_NEAREST), Math.min(children.length, idx + LOAD_NEAREST));\n\n slice.forEach((target) => {\n const callback = this.loadCallbacks.get(target);\n if(callback) {\n callback();\n this.loadCallbacks.delete(target);\n this.intersectionObserver.unobserve(target);\n }\n });\n }\n\n public cleanup() {\n this.listenerSetter.removeAll();\n this.swipeHandler.removeListeners();\n this.intersectionObserver?.disconnect();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_PARALLAX_SUPPORTED from '../environment/parallaxSupport';\nimport deferredPromise from '../helpers/cancellablePromise';\nimport {copyTextToClipboard} from '../helpers/clipboard';\nimport anchorCopy from '../helpers/dom/anchorCopy';\nimport {simulateClickEvent} from '../helpers/dom/clickEvent';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport setInnerHTML from '../helpers/dom/setInnerHTML';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport makeError from '../helpers/makeError';\nimport {makeMediaSize} from '../helpers/mediaSize';\nimport {getMiddleware, MiddlewareHelper} from '../helpers/middleware';\nimport middlewarePromise from '../helpers/middlewarePromise';\nimport {Chat, ChatFull, User, UserFull} from '../layer';\nimport appImManager from '../lib/appManagers/appImManager';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport getServerMessageId from '../lib/appManagers/utils/messageId/getServerMessageId';\nimport getPeerActiveUsernames from '../lib/appManagers/utils/peers/getPeerActiveUsernames';\nimport I18n, {i18n, join} from '../lib/langPack';\nimport wrapRichText from '../lib/richTextProcessor/wrapRichText';\nimport rootScope from '../lib/rootScope';\nimport AvatarElement from './avatar';\nimport CheckboxField from './checkboxField';\nimport {generateDelimiter} from './generateDelimiter';\nimport PeerProfileAvatars from './peerProfileAvatars';\nimport Row from './row';\nimport Scrollable from './scrollable';\nimport SettingSection from './settingSection';\nimport {toast} from './toast';\nimport formatUserPhone from './wrappers/formatUserPhone';\nimport wrapPeerTitle from './wrappers/peerTitle';\nimport wrapTopicNameButton from './wrappers/topicNameButton';\n\nconst setText = (text: Parameters[1], row: Row) => {\n // fastRaf(() => {\n setInnerHTML(row.title, text || '');\n row.container.style.display = text ? '' : 'none';\n // });\n};\n\nexport default class PeerProfile {\n public element: HTMLElement;\n private avatars: PeerProfileAvatars;\n private avatar: AvatarElement;\n private section: SettingSection;\n private name: HTMLDivElement;\n private subtitle: HTMLDivElement;\n private bio: Row;\n private username: Row;\n private phone: Row;\n private notifications: Row;\n private location: Row;\n private link: Row;\n\n private cleaned: boolean;\n private setMoreDetailsTimeout: number;\n private setPeerStatusInterval: number;\n\n private peerId: PeerId;\n private threadId: number;\n\n private middlewareHelper: MiddlewareHelper;\n\n constructor(\n private managers: AppManagers,\n public scrollable: Scrollable,\n private listenerSetter?: ListenerSetter,\n private isDialog = true\n ) {\n if(!IS_PARALLAX_SUPPORTED) {\n this.scrollable.container.classList.add('no-parallax');\n }\n\n if(!listenerSetter) {\n this.listenerSetter = new ListenerSetter();\n }\n\n this.middlewareHelper = getMiddleware();\n }\n\n public init() {\n this.init = null;\n\n\n this.element = document.createElement('div');\n this.element.classList.add('profile-content');\n\n this.section = new SettingSection({\n noDelimiter: true\n });\n\n this.name = document.createElement('div');\n this.name.classList.add('profile-name');\n\n this.subtitle = document.createElement('div');\n this.subtitle.classList.add('profile-subtitle');\n\n this.bio = new Row({\n title: ' ',\n subtitle: true,\n icon: 'info',\n clickable: (e) => {\n if((e.target as HTMLElement).tagName === 'A') {\n return;\n }\n\n copyTextToClipboard(this.bio.title.textContent);\n toast(I18n.format('BioCopied', true));\n },\n listenerSetter: this.listenerSetter,\n contextMenu: {\n buttons: [{\n icon: 'copy',\n text: 'Text.CopyLabel_About',\n onClick: () => {\n simulateClickEvent(this.bio.container);\n },\n verify: () => !this.peerId.isUser()\n }, {\n icon: 'copy',\n text: 'Text.CopyLabel_Bio',\n onClick: () => {\n simulateClickEvent(this.bio.container);\n },\n verify: () => this.peerId.isUser()\n }]\n }\n });\n\n this.bio.title.classList.add('pre-wrap');\n\n this.username = new Row({\n title: ' ',\n subtitleLangKey: 'Username',\n icon: 'username',\n clickable: () => {\n // const username = await this.managers.appPeersManager.getPeerUsername(this.peerId);\n copyTextToClipboard('@' + this.username.title.textContent);\n toast(I18n.format('UsernameCopied', true));\n },\n listenerSetter: this.listenerSetter,\n contextMenu: {\n buttons: [{\n icon: 'copy',\n text: 'Text.CopyLabel_Username',\n onClick: () => {\n simulateClickEvent(this.username.container);\n }\n }]\n }\n });\n\n this.phone = new Row({\n title: ' ',\n subtitle: true,\n icon: 'phone',\n clickable: () => {\n copyTextToClipboard(this.phone.title.textContent.replace(/\\s/g, ''));\n toast(I18n.format('PhoneCopied', true));\n },\n listenerSetter: this.listenerSetter,\n contextMenu: {\n buttons: [{\n icon: 'copy',\n text: 'Text.CopyLabel_PhoneNumber',\n onClick: () => {\n simulateClickEvent(this.phone.container);\n }\n }, {\n icon: 'info',\n text: 'PeerInfo.Phone.AnonymousInfo',\n textArgs: [(() => {\n const a = document.createElement('a');\n return a;\n })()],\n onClick: () => {\n window.open('https://fragment.com/numbers', '_blank');\n },\n separator: true,\n multiline: true,\n verify: async() => {\n const {isAnonymous} = await this.managers.appUsersManager.getUserPhone(this.peerId.toUserId()) || {};\n return isAnonymous;\n }\n }]\n }\n });\n\n this.link = new Row({\n title: ' ',\n subtitleLangKey: 'SetUrlPlaceholder',\n icon: 'link',\n clickable: () => {\n const url = this.link.title.textContent;\n copyTextToClipboard(url);\n // Promise.resolve(appProfileManager.getChatFull(this.peerId.toChatId())).then((chatFull) => {\n // copyTextToClipboard(chatFull.exported_invite.link);\n const isPrivate = url.includes('/c/');\n toast(I18n.format(isPrivate ? 'LinkCopiedPrivateInfo' : 'LinkCopied', true));\n // });\n },\n listenerSetter: this.listenerSetter,\n contextMenu: {\n buttons: [{\n icon: 'copy',\n text: 'Text.CopyLabel_ShareLink',\n onClick: () => {\n simulateClickEvent(this.link.container);\n }\n }]\n }\n });\n\n this.location = new Row({\n title: ' ',\n subtitleLangKey: 'ChatLocation',\n icon: 'location'\n });\n\n this.section.content.append(\n this.phone.container,\n this.username.container,\n this.location.container,\n this.bio.container,\n this.link.container\n );\n\n const {listenerSetter} = this;\n if(this.isDialog) {\n this.notifications = new Row({\n checkboxField: new CheckboxField({toggle: true}),\n titleLangKey: 'Notifications',\n icon: 'unmute',\n listenerSetter: this.listenerSetter\n });\n\n listenerSetter.add(this.notifications.checkboxField.input)('change', (e) => {\n if(!e.isTrusted) {\n return;\n }\n\n // let checked = this.notificationsCheckbox.checked;\n this.managers.appMessagesManager.togglePeerMute({peerId: this.peerId, threadId: this.threadId});\n });\n\n listenerSetter.add(rootScope)('dialog_notify_settings', async(dialog) => {\n if(this.peerId === dialog.peerId) {\n const muted = await this.managers.appNotificationsManager.isPeerLocalMuted({peerId: this.peerId, respectType: false, threadId: this.threadId});\n this.notifications.checkboxField.checked = !muted;\n }\n });\n\n this.section.content.append(this.notifications.container);\n }\n\n this.element.append(this.section.container);\n\n if(IS_PARALLAX_SUPPORTED) {\n this.element.append(generateDelimiter());\n }\n\n listenerSetter.add(rootScope)('peer_typings', ({peerId}) => {\n if(this.peerId === peerId) {\n this.setPeerStatus();\n }\n });\n\n listenerSetter.add(rootScope)('peer_bio_edit', (peerId) => {\n if(peerId === this.peerId) {\n this.setMoreDetails(true);\n }\n });\n\n const n = async({peerId, threadId}: {peerId: PeerId, threadId?: number}) => {\n if(this.peerId !== peerId) {\n return false;\n }\n\n const isForum = await this.managers.appPeersManager.isForum(this.peerId);\n if(isForum && this.threadId ? this.threadId === threadId : true) {\n return true;\n }\n\n return false;\n };\n\n listenerSetter.add(rootScope)('peer_title_edit', async(data) => {\n if(await n(data)) {\n this.fillUsername();\n this.setMoreDetails(true);\n }\n });\n\n listenerSetter.add(rootScope)('user_update', (userId) => {\n if(this.peerId === userId.toPeerId()) {\n this.setPeerStatus();\n }\n });\n\n listenerSetter.add(rootScope)('contacts_update', async(userId) => {\n if(this.peerId === userId.toPeerId()) {\n const user = await this.managers.appUsersManager.getUser(userId);\n if(!user.pFlags.self || !this.isDialog) {\n this.fillUserPhone();\n }\n }\n });\n\n listenerSetter.add(rootScope)('avatar_update', async(data) => {\n if(await n(data)) {\n this.setAvatar();\n }\n });\n\n this.setPeerStatusInterval = window.setInterval(() => this.setPeerStatus(), 60e3);\n }\n\n private async setPeerStatus(\n needClear = false,\n manual?: T\n ): Promise void : void> {\n const peerId = this.peerId;\n\n const callbacks: Array<() => void> = [];\n callbacks.push(() => {\n this.element.classList.toggle('is-me', peerId === rootScope.myId);\n });\n\n let promise: Promise<(() => void) | void> = Promise.resolve();\n if(!(!peerId || (rootScope.myId === peerId && this.isDialog))) {\n const isForum = await this.managers.appPeersManager.isForum(this.peerId);\n const middleware = this.middlewareHelper.get();\n if(isForum && this.threadId) {\n promise = wrapTopicNameButton({\n peerId,\n wrapOptions: {\n middleware\n }\n }).then(({element}) => {\n this.subtitle.replaceChildren(element);\n });\n } else {\n promise = appImManager.setPeerStatus({\n peerId,\n element: this.subtitle,\n needClear,\n useWhitespace: true,\n middleware,\n ignoreSelf: !this.isDialog\n });\n }\n\n promise.then((callback) => callback && callbacks.push(callback));\n }\n\n const callback = () => callbacks.forEach((callback) => callback());\n\n return promise.then(() => {\n if(manual) {\n return callback;\n }\n\n callback();\n }) as any;\n }\n\n public cleanupHTML() {\n [\n this.bio,\n this.phone,\n this.username,\n this.location,\n this.link\n ].forEach((row) => {\n row.container.style.display = 'none';\n });\n\n if(this.notifications) {\n this.notifications.container.style.display = '';\n this.notifications.checkboxField.checked = true;\n }\n\n this.clearSetMoreDetailsTimeout();\n }\n\n private canBeDetailed() {\n return this.peerId !== rootScope.myId || !this.isDialog;\n }\n\n private createAvatar() {\n const avatar = new AvatarElement();\n avatar.classList.add('profile-avatar', 'avatar-120');\n avatar.isDialog = this.isDialog;\n avatar.attachClickEvent();\n return avatar;\n }\n\n private async _setAvatar() {\n const {peerId} = this;\n const isTopic = !!(this.threadId && await this.managers.appPeersManager.isForum(peerId));\n if(this.canBeDetailed() && !isTopic) {\n const photo = await this.managers.appPeersManager.getPeerPhoto(peerId);\n\n if(photo) {\n const oldAvatars = this.avatars;\n this.avatars = new PeerProfileAvatars(this.scrollable, this.managers);\n await this.avatars.setPeer(peerId);\n\n return () => {\n this.avatars.info.append(this.name, this.subtitle);\n\n this.avatar?.remove();\n this.avatar = undefined;\n\n if(oldAvatars) oldAvatars.container.replaceWith(this.avatars.container);\n else this.element.prepend(this.avatars.container);\n\n if(IS_PARALLAX_SUPPORTED) {\n this.scrollable.container.classList.add('parallax');\n }\n };\n }\n }\n\n const avatar = this.createAvatar();\n await avatar.updateWithOptions({\n peerId,\n threadId: isTopic ? this.threadId : undefined,\n wrapOptions: {\n customEmojiSize: makeMediaSize(120, 120),\n middleware: this.middlewareHelper.get()\n }\n });\n\n return () => {\n if(IS_PARALLAX_SUPPORTED) {\n this.scrollable.container.classList.remove('parallax');\n }\n\n if(this.avatars) {\n this.avatars.container.remove();\n this.avatars.cleanup();\n this.avatars = undefined;\n }\n\n this.avatar?.remove();\n this.avatar = avatar;\n\n this.section.content.prepend(this.avatar, this.name, this.subtitle);\n };\n }\n\n private setAvatar(manual?: T): T extends true ? Promise<() => void> : Promise {\n const promise = this._setAvatar();\n return manual ? promise : promise.then((callback) => callback()) as any;\n }\n\n private getUsernamesAlso(usernames: string[]) {\n const also = usernames.slice(1);\n if(also.length) {\n const a = also.map((username) => anchorCopy({username}));\n const i = i18n('UsernameAlso', [join(a, false)]);\n return i;\n }\n }\n\n private async fillUsername() {\n const {peerId} = this;\n if(peerId.isUser() && this.canBeDetailed()) {\n const usernames = await this.managers.appPeersManager.getPeerActiveUsernames(peerId);\n const also = this.getUsernamesAlso(usernames);\n\n return () => {\n this.username.subtitle.replaceChildren(also || i18n('Username'));\n setText(usernames[0], this.username);\n };\n }\n }\n\n private async fillUserPhone() {\n const {peerId} = this;\n if(peerId.isUser() && this.canBeDetailed()) {\n const {phone, isAnonymous} = await this.managers.appUsersManager.getUserPhone(peerId.toUserId()) || {};\n\n return () => {\n this.phone.subtitle.replaceChildren(i18n(isAnonymous ? 'AnonymousNumber' : 'Phone'));\n setText(phone ? formatUserPhone(phone) : undefined, this.phone);\n };\n }\n }\n\n private async fillNotifications() {\n const notificationsRow = this.notifications;\n if(!notificationsRow) {\n return;\n }\n\n if(this.canBeDetailed()) {\n const muted = await this.managers.appNotificationsManager.isPeerLocalMuted({peerId: this.peerId, respectType: false, threadId: this.threadId});\n return () => {\n notificationsRow.checkboxField.checked = !muted;\n };\n } else {\n return () => {\n // fastRaf(() => {\n notificationsRow.container.style.display = 'none';\n // });\n };\n }\n }\n\n private async fillName() {\n const {peerId} = this;\n const [element/* , icons */] = await Promise.all([\n wrapPeerTitle({\n peerId,\n dialog: this.isDialog,\n withIcons: !this.threadId,\n threadId: this.threadId\n })\n\n // generateTitleIcons(peerId)\n ]);\n\n return () => {\n replaceContent(this.name, element);\n // this.name.append(...icons);\n };\n }\n\n private async fillRows(manual: Promise) {\n return Promise.all([\n this.fillName(),\n this.fillUsername(),\n this.fillUserPhone(),\n this.fillNotifications(),\n this.setMoreDetails(undefined, manual),\n this.setPeerStatus(true, true)\n ]).then((callbacks) => {\n return () => {\n callbacks.forEach((callback) => callback?.());\n };\n });\n }\n\n public async fillProfileElements() {\n if(!this.cleaned) return;\n this.cleaned = false;\n\n this.cleanupHTML();\n const deferred = deferredPromise();\n const middleware = this.middlewareHelper.get();\n middleware.onClean(() => {\n deferred.reject();\n });\n\n const callbacks = await Promise.all([\n this.setAvatar(true),\n this.fillRows(deferred)\n ]);\n\n return () => {\n deferred.resolve();\n callbacks.forEach((callback) => callback?.());\n };\n }\n\n private async _setMoreDetails(peerId: PeerId, peerFull?: ChatFull | UserFull) {\n const m = this.getMiddlewarePromise();\n const isTopic = !!(this.threadId && await m(this.managers.appPeersManager.isForum(peerId)));\n if(isTopic) {\n let url = 'https://t.me/';\n const threadId = getServerMessageId(this.threadId);\n const username = await m(this.managers.appPeersManager.getPeerUsername(peerId));\n if(username) {\n url += `${username}/${threadId}`;\n } else {\n url += `c/${peerId.toChatId()}/${threadId}`;\n }\n\n return () => {\n setText(url, this.link);\n };\n }\n\n const callbacks: (() => void)[] = [];\n // if(peerFull.about) {\n callbacks.push(() => {\n this.bio.subtitle.replaceChildren(i18n(peerId.isUser() ? 'UserBio' : 'Info'));\n setText(peerFull.about ? wrapRichText(peerFull.about) : undefined, this.bio);\n });\n // }\n\n if(!peerId.isUser()) {\n const chat = await m(this.managers.appChatsManager.getChat(peerId.toChatId())) as Chat.channel;\n const usernames = getPeerActiveUsernames(chat);\n let also: HTMLElement;\n if(usernames.length) {\n also = this.getUsernamesAlso(usernames);\n callbacks.push(() => setText('https://t.me/' + usernames[0], this.link));\n } else {\n const exportedInvite = (peerFull as ChatFull.channelFull).exported_invite;\n if(exportedInvite?._ === 'chatInviteExported') {\n callbacks.push(() => setText(exportedInvite.link, this.link));\n }\n }\n\n callbacks.push(() => this.link.subtitle.replaceChildren(also || i18n('SetUrlPlaceholder')));\n }\n\n const location = (peerFull as ChatFull.channelFull).location;\n if(location?._ == 'channelLocation') {\n callbacks.push(() => setText(location.address, this.location));\n }\n\n this.setMoreDetailsTimeout = window.setTimeout(() => this.setMoreDetails(true), 60e3);\n\n return () => {\n callbacks.forEach((callback) => callback());\n };\n }\n\n private async setMoreDetails(override?: true, manual?: Promise) {\n this.clearSetMoreDetailsTimeout();\n\n const {peerId} = this;\n const m = this.getMiddlewarePromise();\n\n if(!peerId || !this.canBeDetailed() || await m(this.managers.appPeersManager.isPeerRestricted(peerId))) {\n return;\n }\n\n const result = await m(this.managers.acknowledged.appProfileManager.getProfileByPeerId(peerId, override));\n const setPromise = m(result.result).then(async(peerFull) => {\n if(await m(this.managers.appPeersManager.isPeerRestricted(peerId))) {\n // this.log.warn('peer changed');\n return;\n }\n\n return await m(this._setMoreDetails(peerId, peerFull));\n });\n\n if(result.cached && manual) {\n return setPromise;\n } else {\n (manual || Promise.resolve())\n .then(() => setPromise)\n .then((callback) => {\n callback?.();\n });\n }\n }\n\n private getMiddlewarePromise() {\n return middlewarePromise(this.middlewareHelper.get(), makeError('MIDDLEWARE'));\n }\n\n public setPeer(peerId: PeerId, threadId?: number) {\n if(this.peerId === peerId && this.threadId === threadId) return;\n\n this.init?.();\n\n this.peerId = peerId;\n this.threadId = threadId;\n\n this.middlewareHelper.clean();\n this.cleaned = true;\n }\n\n public clearSetMoreDetailsTimeout() {\n if(this.setMoreDetailsTimeout !== undefined) {\n clearTimeout(this.setMoreDetailsTimeout);\n this.setMoreDetailsTimeout = undefined;\n }\n }\n\n public destroy() {\n this.peerId = this.threadId = undefined;\n this.clearSetMoreDetailsTimeout();\n clearInterval(this.setPeerStatusInterval);\n this.avatars?.cleanup();\n this.middlewareHelper.destroy();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport mediaSizes from '../helpers/mediaSizes';\nimport {Middleware} from '../helpers/middleware';\nimport {Chat, Document, EmojiStatus, User} from '../layer';\nimport rootScope from '../lib/rootScope';\nimport generateFakeIcon from './generateFakeIcon';\nimport generatePremiumIcon from './generatePremiumIcon';\nimport generateVerifiedIcon from './generateVerifiedIcon';\nimport wrapSticker from './wrappers/sticker';\n\nexport default async function generateTitleIcons(\n peerId: PeerId,\n middleware?: Middleware,\n noVerifiedIcon?: boolean,\n noFakeIcon?: boolean,\n noPremiumIcon?: boolean\n) {\n const elements: HTMLElement[] = [];\n const peer: Chat | User = await rootScope.managers.appPeersManager.getPeer(peerId);\n if((peer as Chat.channel).pFlags.verified && !noVerifiedIcon) {\n elements.push(generateVerifiedIcon());\n }\n\n if(((peer as Chat.channel).pFlags.fake || (peer as User.user).pFlags.scam) && !noFakeIcon) {\n elements.push(generateFakeIcon((peer as User.user).pFlags.scam));\n }\n\n if((peer as User.user).pFlags.premium && !noPremiumIcon) {\n const emojiStatus = (peer as User.user).emoji_status;\n if(emojiStatus && emojiStatus._ !== 'emojiStatusEmpty' && false) {\n const container = document.createElement('span');\n container.classList.add('emoji-status');\n const result = await rootScope.managers.acknowledged.appEmojiManager.getCustomEmojiDocument((emojiStatus as EmojiStatus.emojiStatus).document_id);\n const wrap = async(doc: Document.document) => {\n const size = mediaSizes.active.emojiStatus\n const loadPromises: Promise[] = [];\n await wrapSticker({\n doc,\n div: container,\n width: size.width,\n height: size.height,\n loop: 2,\n play: true,\n group: 'EMOJI-STATUS',\n loadPromises,\n middleware\n // group: 'none'\n });\n\n await Promise.all(loadPromises);\n };\n\n const p = result.result.then(wrap);\n if(result.cached) {\n await p;\n }\n\n elements.push(container);\n } else {\n elements.push(generatePremiumIcon());\n }\n }\n\n return elements;\n}\n","export default function generateVerifiedIcon() {\n const span = document.createElement('span');\n span.classList.add('verified-icon', 'tgico');\n\n const size = 26; // 24\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttributeNS(null, 'viewBox', `0 0 ${size} ${size}`);\n svg.setAttributeNS(null, 'width', `${size}`);\n svg.setAttributeNS(null, 'height', `${size}`);\n svg.classList.add('verified-icon-svg');\n\n const use = document.createElementNS('http://www.w3.org/2000/svg', 'use');\n use.setAttributeNS(null, 'href', '#verified-icon-background');\n use.classList.add('verified-icon-background');\n\n const use2 = document.createElementNS('http://www.w3.org/2000/svg', 'use');\n use2.setAttributeNS(null, 'href', '#verified-icon-check');\n use2.classList.add('verified-icon-check');\n\n // svg.append(use, use2);\n svg.append(use2, use);\n\n span.append(svg);\n\n return span;\n // const span = document.createElement('span');\n // span.classList.add('verified-icon', 'tgico-verified_filled');\n // return span;\n}\n","export default function generatePremiumIcon() {\n const span = document.createElement('span');\n span.classList.add('premium-icon', 'tgico-star');\n return span;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../lib/rootScope';\nimport {i18n} from '../lib/langPack';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport {NULL_PEER_ID} from '../lib/mtproto/mtproto_config';\nimport limitSymbols from '../helpers/string/limitSymbols';\nimport setInnerHTML, {setDirection} from '../helpers/dom/setInnerHTML';\nimport safeAssign from '../helpers/object/safeAssign';\nimport wrapEmojiText from '../lib/richTextProcessor/wrapEmojiText';\nimport getPeerTitle from './wrappers/getPeerTitle';\nimport generateTitleIcons from './generateTitleIcons';\nimport {wrapTopicIcon} from './wrappers/messageActionTextNewUnsafe';\n\nexport type PeerTitleOptions = {\n peerId?: PeerId,\n fromName?: string,\n plainText?: boolean,\n onlyFirstName?: boolean,\n dialog?: boolean,\n limitSymbols?: number,\n withIcons?: boolean,\n withPremiumIcon?: boolean,\n threadId?: number,\n wrapOptions?: WrapSomethingOptions\n};\n\nconst weakMap: WeakMap = new WeakMap();\n\nrootScope.addEventListener('peer_title_edit', ({peerId, threadId}) => {\n let query = `.peer-title[data-peer-id=\"${peerId}\"]`;\n if(threadId) {\n query += `[data-thread-id=\"${threadId}\"]`;\n }\n\n const elements = Array.from(document.querySelectorAll(query)) as HTMLElement[];\n elements.forEach((element) => {\n const peerTitle = weakMap.get(element);\n peerTitle?.update();\n });\n});\n\nexport default class PeerTitle {\n public element: HTMLElement;\n public options: PeerTitleOptions;\n private hasInner: boolean;\n\n constructor(options?: PeerTitleOptions) {\n this.element = document.createElement('span');\n this.element.classList.add('peer-title');\n setDirection(this.element);\n\n this.options = {};\n\n if(options) {\n this.update(options);\n }\n\n weakMap.set(this.element, this);\n }\n\n public setOptions(options?: PeerTitleOptions) {\n if(!options) {\n return;\n }\n\n safeAssign(this.options, options);\n for(const i in options) {\n // @ts-ignore\n const value = options[i];\n\n if(typeof(value) !== 'object' && typeof(value) !== 'function') {\n // @ts-ignore\n this.element.dataset[i] = value ? '' + (typeof(value) === 'boolean' ? +value : value) : '0';\n }\n }\n }\n\n private setHasInner(hasInner: boolean) {\n if(this.hasInner !== hasInner) {\n this.hasInner = hasInner;\n this.element.classList.toggle('with-icons', hasInner);\n }\n }\n\n public async update(options?: PeerTitleOptions) {\n this.setOptions(options);\n\n let fromName = this.options.fromName;\n if(fromName !== undefined) {\n if(this.options.limitSymbols !== undefined) {\n fromName = limitSymbols(fromName, this.options.limitSymbols, this.options.limitSymbols);\n }\n\n setInnerHTML(this.element, wrapEmojiText(fromName));\n return;\n }\n\n this.options.peerId ??= NULL_PEER_ID;\n\n let hasInner: boolean;\n const {peerId, threadId} = this.options;\n if(peerId !== rootScope.myId || !this.options.dialog) {\n if(threadId) {\n const [topic, isForum] = await Promise.all([\n rootScope.managers.dialogsStorage.getForumTopic(peerId, threadId),\n rootScope.managers.appPeersManager.isForum(peerId)\n ]);\n\n if(!topic && isForum) {\n rootScope.managers.dialogsStorage.getForumTopicById(peerId, threadId).then((forumTopic) => {\n if(!forumTopic && this.options.threadId === threadId) {\n this.options.threadId = undefined;\n this.update({threadId: undefined});\n return;\n }\n\n this.update();\n }, () => {\n if(this.options.threadId === threadId) {\n this.options.threadId = undefined;\n this.update({threadId: undefined});\n }\n });\n\n setInnerHTML(this.element, i18n('Loading'));\n this.setHasInner(false);\n return;\n }\n }\n\n const getTopicIconPromise = threadId && this.options.withIcons ?\n rootScope.managers.dialogsStorage.getForumTopic(peerId, threadId).then((topic) => wrapTopicIcon({...(this.options.wrapOptions ?? {}), topic})) :\n undefined;\n\n const [title, icons, topicIcon] = await Promise.all([\n getPeerTitle(this.options as Required),\n (this.options.withIcons && generateTitleIcons(peerId, this.options.wrapOptions?.middleware)) || (this.options.withPremiumIcon && generateTitleIcons(peerId, this.options.wrapOptions?.middleware, true, true)),\n getTopicIconPromise\n ]);\n\n if(icons?.length || topicIcon) {\n const inner = document.createElement('span');\n inner.classList.add('peer-title-inner');\n hasInner = true;\n setInnerHTML(inner, title);\n\n const fragment = document.createDocumentFragment();\n fragment.append(...[topicIcon, inner, ...(icons ?? [])].filter(Boolean));\n setInnerHTML(this.element, fragment);\n } else {\n setInnerHTML(this.element, title);\n }\n } else {\n replaceContent(this.element, i18n(this.options.onlyFirstName ? 'Saved' : 'SavedMessages'));\n }\n\n this.setHasInner(hasInner);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AppDownloadManager} from '../../lib/appManagers/appDownloadManager';\nimport resizeableImage from '../../lib/cropper';\nimport PopupElement from '.';\nimport {_i18n} from '../../lib/langPack';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport readBlobAsDataURL from '../../helpers/blob/readBlobAsDataURL';\nimport rootScope from '../../lib/rootScope';\nimport appDownloadManager from '../../lib/appManagers/appDownloadManager';\n\nexport default class PopupAvatar extends PopupElement {\n private cropContainer: HTMLElement;\n private input: HTMLInputElement;\n private h6: HTMLElement;\n\n private image = new Image();\n\n private canvas: HTMLCanvasElement;\n private blob: Blob;\n private cropper = {\n crop: () => {},\n removeHandlers: () => {}\n };\n\n private onCrop: (upload: () => ReturnType) => void;\n\n constructor(options: Partial<{\n isForum: boolean\n }> = {}) {\n super('popup-avatar', {closable: true, withConfirm: true});\n\n this.h6 = document.createElement('h6');\n _i18n(this.h6, 'Popup.Avatar.Title');\n\n this.btnClose.classList.remove('btn-icon');\n\n this.header.append(this.h6);\n\n this.cropContainer = document.createElement('div');\n this.cropContainer.classList.add('crop');\n this.cropContainer.append(this.image);\n\n if(options.isForum) {\n this.cropContainer.classList.add('is-forum');\n }\n\n this.input = document.createElement('input');\n this.input.type = 'file';\n this.input.style.display = 'none';\n this.listenerSetter.add(this.input)('change', (e: any) => {\n const file = e.target.files[0];\n if(!file) {\n return;\n }\n\n readBlobAsDataURL(file).then((contents) => {\n this.image = new Image();\n this.cropContainer.append(this.image);\n this.image.src = contents;\n\n this.image.onload = () => {\n /* let {w, h} = calcImageInBox(this.image.naturalWidth, this.image.naturalHeight, 460, 554);\n cropContainer.style.width = w + 'px';\n cropContainer.style.height = h + 'px'; */\n this.show();\n\n this.cropper = resizeableImage(this.image, this.canvas);\n this.input.value = '';\n };\n });\n }, false);\n\n this.btnConfirm.className = 'btn-primary btn-color-primary btn-circle btn-crop btn-icon tgico-check z-depth-1';\n attachClickEvent(this.btnConfirm, () => {\n this.cropper.crop();\n this.hide();\n\n this.canvas.toBlob((blob) => {\n this.blob = blob; // save blob to send after reg\n this.darkenCanvas();\n this.resolve();\n }, 'image/jpeg', 1);\n }, {listenerSetter: this.listenerSetter});\n\n this.container.append(this.cropContainer, this.btnConfirm, this.input);\n\n this.addEventListener('closeAfterTimeout', () => {\n this.cropper.removeHandlers();\n if(this.image) {\n this.image.remove();\n }\n });\n }\n\n private resolve() {\n this.onCrop(() => {\n return appDownloadManager.upload(this.blob);\n });\n }\n\n public open(postCanvas: HTMLCanvasElement, onCrop: PopupAvatar['onCrop']) {\n this.canvas = postCanvas;\n this.onCrop = onCrop;\n\n this.input.click();\n }\n\n public darkenCanvas() {\n const ctx = this.canvas.getContext('2d');\n ctx.fillStyle = 'rgba(0, 0, 0, 0.3)';\n ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nfunction resizeableImage(originalImage: HTMLImageElement, canvas?: HTMLCanvasElement) {\n let cropComponent: HTMLDivElement,\n container: HTMLDivElement,\n cropImage: HTMLImageElement,\n event_state: Partial<{\n mouse_x: number,\n mouse_y: number,\n container_width: number,\n container_height: number,\n container_left: number,\n container_top: number\n }> = {},\n keyZoomValue = 4.0,\n MINWIDTH = 50,\n MINHEIGHT = 50,\n CROPWIDTH = 200,\n CROPHEIGHT = 200,\n cropLeft = 0,\n cropTop = 0,\n cropWidth = 0,\n cropHeight = 0,\n scaledRatio = 0;\n\n if(originalImage.complete) init();\n else originalImage.onload = init;\n\n function removeHandlers() {\n container.removeEventListener('mousedown', startMoving);\n container.removeEventListener('touchstart', startMoving);\n container.removeEventListener('wheel', resizing);\n\n document.removeEventListener('mouseup', endMoving);\n document.removeEventListener('touchend', endMoving);\n document.removeEventListener('mousemove', moving);\n document.removeEventListener('touchmove', moving);\n document.removeEventListener('keypress', keyHandler);\n\n cropComponent.remove();\n container.remove();\n cropImage.remove();\n }\n\n function addHandlers() {\n container.addEventListener('mousedown', startMoving, false);\n container.addEventListener('touchstart', startMoving, false);\n container.addEventListener('wheel', resizing, false);\n\n document.addEventListener('keypress', keyHandler, false);\n // document.querySelector('.btn-crop').addEventListener('click', openCropCanvasImg);\n }\n\n function init() {\n originalImage.classList.add('crop-blur');\n originalImage.draggable = false;\n\n cropImage = new Image();\n cropImage.src = originalImage.src;\n cropImage.draggable = false;\n cropImage.classList.add('crop-overlay-image');\n\n if(!canvas) {\n canvas = document.createElement('canvas');\n }\n\n cropComponent = document.createElement('div');\n cropComponent.classList.add('crop-component');\n\n container = document.createElement('div');\n container.classList.add('crop-overlay');\n\n const overlayColor = document.createElement('div');\n overlayColor.classList.add('crop-overlay-color');\n\n cropComponent.appendChild(container);\n const wrapper = originalImage.parentNode as HTMLElement;\n wrapper.appendChild(cropComponent);\n cropComponent.appendChild(cropImage);\n cropComponent.appendChild(originalImage);\n cropComponent.appendChild(overlayColor);\n container.appendChild(cropImage);\n\n cropImage.style.maxWidth = originalImage.width + 'px';\n\n scaledRatio = originalImage.naturalWidth / originalImage.offsetWidth;\n\n const left = originalImage.offsetWidth / 2 - CROPWIDTH / 2;\n const top = originalImage.offsetHeight / 2 - CROPHEIGHT / 2;\n\n updateCropSize(CROPWIDTH, CROPHEIGHT);\n updateCropImage(left, top);\n updateContainer(left, top);\n addHandlers();\n // crop();\n }\n\n function updateCropSize(width: number, height: number) {\n cropWidth = width * scaledRatio;\n cropHeight = height * scaledRatio;\n\n container.style.width = width + 'px';\n container.style.height = height + 'px';\n }\n\n function updateCropImage(left: number, top: number) {\n cropTop = top * scaledRatio;\n cropLeft = left * scaledRatio;\n\n cropImage.style.top = -top + 'px';\n cropImage.style.left = -left + 'px';\n }\n\n function updateContainer(left: number, top: number) {\n container.style.top = top + 'px';\n container.style.left = left + 'px';\n }\n\n // Save the initial event details and container state\n function saveEventState(e: any) {\n event_state.container_width = container.offsetWidth;\n event_state.container_height = container.offsetHeight;\n\n event_state.container_left = container.offsetLeft;\n event_state.container_top = container.offsetTop;\n\n event_state.mouse_x = (e.clientX || e.pageX || e.touches && e.touches[0].clientX) + window.scrollX;\n event_state.mouse_y = (e.clientY || e.pageY || e.touches && e.touches[0].clientY) + window.scrollY;\n }\n\n function imgZoom(zoom: number) {\n zoom = zoom * Math.PI * 2\n let newWidth = Math.floor(container.clientWidth + zoom),\n newHeight = Math.floor(container.clientHeight + zoom),\n w = cropImage.clientWidth,\n h = cropImage.clientHeight,\n left: number,\n top: number,\n right: number,\n bottom: number;\n\n if(newWidth < MINWIDTH) {\n return;\n } else if(newWidth > w) {\n return;\n }\n\n left = container.offsetLeft - (zoom / 2);\n top = container.offsetTop - (zoom / 2);\n right = left + newWidth;\n bottom = top + newHeight;\n\n if(left < 0) left = 0;\n if(top < 0) top = 0;\n\n if(right > w) return;\n if(bottom > h) return;\n\n updateCropSize(newWidth, newWidth);\n updateCropImage(left, top);\n updateContainer(left, top);\n // crop();\n }\n\n function keyHandler(e: KeyboardEvent) {\n e.preventDefault();\n\n switch(String.fromCharCode(e.charCode)) {\n case '+':\n imgZoom(keyZoomValue);\n break;\n case '-':\n imgZoom(-keyZoomValue);\n break;\n }\n }\n\n function resizing(e: any) {\n e.preventDefault();\n imgZoom(e.deltaY > 0 ? 1 : -1);\n }\n\n function startMoving(e: MouseEvent | TouchEvent) {\n e.preventDefault();\n e.stopPropagation();\n\n saveEventState(e);\n\n document.addEventListener('mousemove', moving);\n document.addEventListener('touchmove', moving);\n document.addEventListener('mouseup', endMoving);\n document.addEventListener('touchend', endMoving);\n }\n\n function endMoving(e: MouseEvent | TouchEvent) {\n e.preventDefault();\n\n document.removeEventListener('mouseup', endMoving);\n document.removeEventListener('touchend', endMoving);\n document.removeEventListener('mousemove', moving);\n document.removeEventListener('touchmove', moving);\n }\n\n function moving(e: any) {\n let currentTouch = {x: 0, y: 0},\n left: number,\n top: number,\n w: number,\n h: number;\n\n e.preventDefault();\n e.stopPropagation();\n\n currentTouch.x = e.pageX || e.touches && e.touches[0].pageX;\n currentTouch.y = e.pageY || e.touches && e.touches[0].pageY;\n\n left = currentTouch.x - (event_state.mouse_x - event_state.container_left);\n top = currentTouch.y - (event_state.mouse_y - event_state.container_top);\n w = container.offsetWidth;\n h = container.offsetHeight;\n\n if(left < 0) left = 0;\n else if(left > cropImage.offsetWidth - w) left = cropImage.offsetWidth - w;\n\n if(top < 0) top = 0;\n else if(top > cropImage.offsetHeight - h) top = cropImage.offsetHeight - h;\n\n updateCropImage(left, top);\n updateContainer(left, top);\n // crop();\n }\n\n function crop() {\n canvas.width = cropWidth;\n canvas.height = cropHeight;\n\n const ctx = canvas.getContext('2d');\n ctx.drawImage(originalImage,\n cropLeft, cropTop,\n cropWidth, cropHeight,\n 0, 0,\n cropWidth, cropHeight\n );\n }\n\n return {crop, removeHandlers};\n}\n\nexport default resizeableImage;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement, {PopupOptions} from '.';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport I18n, {FormatterArguments, i18n, LangPackKey} from '../../lib/langPack';\nimport InputField from '../inputField';\n\nexport default class PopupDatePicker extends PopupElement {\n protected controlsDiv: HTMLElement;\n protected monthTitle: HTMLElement;\n protected prevBtn: HTMLElement;\n protected nextBtn: HTMLElement;\n\n protected monthsContainer: HTMLElement;\n protected month: HTMLElement;\n\n protected minMonth: Date;\n protected maxMonth: Date;\n protected minDate: Date;\n protected maxDate: Date;\n protected selectedDate: Date;\n protected selectedMonth: Date;\n protected selectedEl: HTMLElement;\n\n protected timeDiv: HTMLDivElement;\n protected hoursInputField: InputField;\n protected minutesInputField: InputField;\n\n constructor(initDate: Date, public onPick: (timestamp: number) => void, protected options: Partial<{\n noButtons: true,\n noTitle: true,\n minDate: Date,\n maxDate: Date\n withTime: true,\n showOverflowMonths: true\n }> & PopupOptions = {}) {\n super('popup-date-picker', {\n body: true,\n overlayClosable: true,\n buttons: options.noButtons ? [] : [{\n langKey: 'JumpToDate',\n callback: () => {\n if(this.onPick) {\n this.onPick(this.selectedDate.getTime() / 1000 | 0);\n }\n }\n }, {\n langKey: 'Cancel',\n isCancel: true\n }],\n title: true,\n ...options\n });\n\n this.minDate = options.minDate || new Date('2013-08-01T00:00:00');\n\n if(initDate < this.minDate) {\n initDate.setFullYear(this.minDate.getFullYear(), this.minDate.getMonth(), this.minDate.getDate());\n }\n\n // Controls\n this.controlsDiv = document.createElement('div');\n this.controlsDiv.classList.add('date-picker-controls');\n\n this.prevBtn = document.createElement('button');\n this.prevBtn.classList.add('btn-icon', 'tgico-down', 'date-picker-prev');\n attachClickEvent(this.prevBtn, this.onPrevClick, {listenerSetter: this.listenerSetter});\n\n this.nextBtn = document.createElement('button');\n this.nextBtn.classList.add('btn-icon', 'tgico-down', 'date-picker-next');\n attachClickEvent(this.nextBtn, this.onNextClick, {listenerSetter: this.listenerSetter});\n\n this.monthTitle = document.createElement('div');\n this.monthTitle.classList.add('date-picker-month-title');\n\n this.controlsDiv.append(this.prevBtn, this.monthTitle, this.nextBtn);\n\n // Month\n this.monthsContainer = document.createElement('div');\n this.monthsContainer.classList.add('date-picker-months');\n attachClickEvent(this.monthsContainer, this.onDateClick, {listenerSetter: this.listenerSetter});\n\n this.body.append(this.controlsDiv, this.monthsContainer);\n\n // Time inputs\n if(options.withTime) {\n this.timeDiv = document.createElement('div');\n this.timeDiv.classList.add('date-picker-time');\n\n const delimiter = document.createElement('div');\n delimiter.classList.add('date-picker-time-delimiter');\n delimiter.append(':');\n\n const handleTimeInput = (max: number, inputField: InputField, onInput: (length: number) => void, onOverflow?: (number: number) => void) => {\n const maxString = '' + max;\n this.listenerSetter.add(inputField.input)('input', (e) => {\n let value = inputField.value.replace(/\\D/g, '');\n if(value.length > 2) {\n value = value.slice(0, 2);\n } else {\n if((value.length === 1 && +value[0] > +maxString[0]) || (value.length === 2 && +value > max)) {\n if(value.length === 2 && onOverflow) {\n onOverflow(+value[1]);\n }\n\n value = '0' + value[0];\n }\n }\n\n inputField.setValueSilently(value);\n onInput(value.length);\n });\n };\n\n this.hoursInputField = new InputField({plainText: true});\n this.minutesInputField = new InputField({plainText: true});\n\n handleTimeInput(23, this.hoursInputField, (length) => {\n if(length === 2) {\n this.minutesInputField.input.focus();\n }\n\n this.setTimeTitle();\n }, (number) => {\n this.minutesInputField.value = (number + this.minutesInputField.value).slice(0, 2);\n });\n handleTimeInput(59, this.minutesInputField, (length) => {\n if(!length) {\n this.hoursInputField.input.focus();\n }\n\n this.setTimeTitle();\n });\n\n this.selectedDate = initDate;\n\n initDate.setMinutes(initDate.getMinutes() + 10);\n\n this.hoursInputField.setValueSilently(('0' + initDate.getHours()).slice(-2));\n this.minutesInputField.setValueSilently(('0' + initDate.getMinutes()).slice(-2));\n\n initDate.setHours(0, 0, 0, 0);\n\n this.timeDiv.append(this.hoursInputField.container, delimiter, this.minutesInputField.container);\n\n attachClickEvent(this.btnConfirm, () => {\n if(this.onPick) {\n this.selectedDate.setHours(+this.hoursInputField.value || 0, +this.minutesInputField.value || 0, 0, 0);\n this.onPick(this.selectedDate.getTime() / 1000 | 0);\n }\n\n this.hide();\n }, {listenerSetter: this.listenerSetter});\n\n this.body.append(this.timeDiv);\n\n this.prevBtn.classList.add('primary');\n this.nextBtn.classList.add('primary');\n }\n\n const popupCenterer = document.createElement('div');\n popupCenterer.classList.add('popup-centerer');\n popupCenterer.append(this.container);\n this.element.append(popupCenterer);\n\n // const passed = (initDate.getTime() - (initDate.getTimezoneOffset() * 60000)) % 86400000;\n // this.selectedDate = this.maxDate = new Date(initDate.getTime() - passed);\n initDate.setHours(0, 0, 0, 0);\n this.selectedDate = initDate;\n\n this.maxDate = options.maxDate || new Date();\n this.maxDate.setHours(0, 0, 0, 0);\n\n this.selectedMonth = new Date(this.selectedDate);\n this.selectedMonth.setDate(1);\n\n this.maxMonth = new Date(this.maxDate);\n this.maxMonth.setDate(1);\n\n this.minMonth = new Date(this.minDate);\n this.minMonth.setHours(0, 0, 0, 0);\n this.minMonth.setDate(1);\n\n if(this.selectedMonth.getTime() === this.minMonth.getTime()) {\n this.prevBtn.setAttribute('disabled', 'true');\n }\n\n if(this.selectedMonth.getTime() === this.maxMonth.getTime()) {\n this.nextBtn.setAttribute('disabled', 'true');\n }\n\n if(options.noTitle) {\n this.setTitle = () => {};\n }\n\n this.setTimeTitle();\n this.setTitle();\n this.setMonth();\n }\n\n onPrevClick = (e: MouseEvent) => {\n this.selectedMonth.setMonth(this.selectedMonth.getMonth() - 1);\n this.setMonth();\n\n if(this.selectedMonth.getTime() === this.minMonth.getTime()) {\n this.prevBtn.setAttribute('disabled', 'true');\n }\n\n this.nextBtn.removeAttribute('disabled');\n };\n\n onNextClick = (e: MouseEvent) => {\n this.selectedMonth.setMonth(this.selectedMonth.getMonth() + 1);\n this.setMonth();\n\n if(this.selectedMonth.getTime() === this.maxMonth.getTime()) {\n this.nextBtn.setAttribute('disabled', 'true');\n }\n\n this.prevBtn.removeAttribute('disabled');\n };\n\n onDateClick = (e: MouseEvent) => {\n // cancelEvent(e);\n const target = e.target as HTMLElement;\n\n if(!target.dataset.timestamp) return;\n\n if(this.selectedEl) {\n if(this.selectedEl === target) return;\n this.selectedEl.classList.remove('active');\n }\n\n this.selectedEl = target;\n\n target.classList.add('active');\n const timestamp = +target.dataset.timestamp;\n\n this.selectedDate = new Date(timestamp);\n\n this.setTitle();\n this.setTimeTitle();\n };\n\n public setTimeTitle() {\n if(this.btnConfirm && this.selectedDate) {\n let key: LangPackKey;\n const args: FormatterArguments = [];\n const date = new Date();\n date.setHours(0, 0, 0, 0);\n\n const timeOptions: Intl.DateTimeFormatOptions = {\n minute: '2-digit',\n hour: '2-digit'\n };\n\n const sendDate = new Date(this.selectedDate.getTime());\n sendDate.setHours(+this.hoursInputField.value, +this.minutesInputField.value);\n\n if(this.selectedDate.getTime() === date.getTime()) {\n key = 'Schedule.SendToday';\n }/* else if(this.selectedDate.getTime() === (date.getTime() + 86400e3)) {\n dayStr = 'Tomorrow';\n } */ else {\n key = 'Schedule.SendDate';\n\n const dateOptions: Intl.DateTimeFormatOptions = {\n month: 'short',\n day: 'numeric'\n };\n\n if(sendDate.getFullYear() !== date.getFullYear()) {\n dateOptions.year = 'numeric';\n }\n\n args.push(new I18n.IntlDateElement({\n date: sendDate,\n options: dateOptions\n }).element);\n }\n\n args.push(new I18n.IntlDateElement({\n date: sendDate,\n options: timeOptions\n }).element);\n\n this.btnConfirm.firstChild.replaceWith(i18n(key, args));\n }\n }\n\n public setTitle() {\n // const splitted = this.selectedDate.toString().split(' ', 3);\n // this.title.innerText = splitted[0] + ', ' + splitted[1] + ' ' + splitted[2];\n this.title.textContent = '';\n this.title.append(new I18n.IntlDateElement({\n date: this.selectedDate,\n options: {\n day: 'numeric',\n month: 'long',\n weekday: 'short'\n }\n }).element);\n }\n\n private renderElement(disabled: boolean, innerText: string | HTMLElement = '') {\n const el = document.createElement('button');\n el.classList.add('btn-icon', 'date-picker-month-date');\n\n if(disabled) {\n el.setAttribute('disabled', 'true');\n }\n\n if(innerText) {\n el.append(innerText);\n }\n\n return el;\n }\n\n public setMonth() {\n const firstDate = new Date(this.selectedMonth);\n\n const options: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: this.timeDiv && mediaSizes.isMobile ? 'short' : 'long'\n };\n\n this.monthTitle.textContent = '';\n this.monthTitle.append(new I18n.IntlDateElement({date: firstDate, options}).element);\n // this.monthTitle.innerText = (this.timeDiv && mediaSizes.isMobile ? monthName.slice(0, 3) : monthName) + ' ' + this.selectedMonth.getFullYear();\n\n if(this.month) {\n this.month.remove();\n }\n\n this.month = document.createElement('div');\n this.month.classList.add('date-picker-month');\n\n const weekStartDate = new Date();\n const day = weekStartDate.getDay();\n if(day !== 1) {\n weekStartDate.setHours(-24 * (day - 1));\n }\n\n for(let i = 0; i < 7; ++i) {\n const el = this.renderElement(true, new I18n.IntlDateElement({date: weekStartDate, options: {weekday: 'narrow'}}).element);\n el.classList.remove('date-picker-month-date');\n el.classList.add('date-picker-month-day');\n this.month.append(el);\n weekStartDate.setDate(weekStartDate.getDate() + 1);\n }\n\n // 0 - sunday\n let dayIndex = firstDate.getDay() - 1;\n if(dayIndex === -1) dayIndex = 7 - 1;\n\n const clonedDate = new Date(firstDate.getTime());\n clonedDate.setDate(clonedDate.getDate() - dayIndex - 1);\n\n // Padding first week\n for(let i = 0; i < dayIndex; ++i) {\n if(this.options.showOverflowMonths) {\n clonedDate.setDate(clonedDate.getDate() + 1);\n this.month.append(this.renderElement(true, '' + clonedDate.getDate()));\n } else {\n this.month.append(this.renderElement(true));\n }\n }\n\n do {\n const date = firstDate.getDate();\n const el = this.renderElement(firstDate > this.maxDate || firstDate < this.minDate, '' + date);\n el.dataset.timestamp = '' + firstDate.getTime();\n\n if(firstDate.getTime() === this.selectedDate.getTime()) {\n this.selectedEl = el;\n el.classList.add('active');\n }\n\n this.month.append(el);\n\n firstDate.setDate(date + 1);\n } while(firstDate.getDate() !== 1);\n\n const remainder = this.month.childElementCount % 7;\n if(this.options.showOverflowMonths && remainder) {\n for(let i = remainder; i < 7; ++i) {\n this.month.append(this.renderElement(true, '' + firstDate.getDate()));\n firstDate.setDate(firstDate.getDate() + 1);\n }\n }\n\n const lines = Math.ceil(this.month.childElementCount / 7);\n this.container.dataset.lines = '' + lines;\n\n this.monthsContainer.append(this.month);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport type {PeerType} from '../../lib/appManagers/appPeersManager';\nimport {FormatterArguments, LangPackKey} from '../../lib/langPack';\nimport wrapPeerTitle from '../wrappers/peerTitle';\nimport PopupPeer, {PopupPeerButtonCallbackCheckboxes, PopupPeerOptions} from './peer';\n\nexport default class PopupDeleteDialog {\n constructor(\n private peerId: PeerId,\n // actionType: 'leave' | 'delete',\n private peerType?: PeerType,\n private onSelect?: (promise: Promise) => void,\n private threadId?: number\n ) {\n this.construct();\n }\n\n private async construct() {\n let {peerId, peerType, onSelect, threadId} = this;\n const peerTitleElement = await wrapPeerTitle({peerId, threadId: threadId});\n\n const managers = PopupElement.MANAGERS;\n if(peerType === undefined) {\n peerType = await managers.appPeersManager.getDialogType(peerId);\n }\n\n /* const callbackFlush = (checked: PopupPeerButtonCallbackCheckboxes) => {\n const promise = appMessagesManager.flushHistory(peerId, checkboxes ? !checked[checkboxes[0].text] : undefined);\n onSelect && onSelect(promise);\n }; */\n\n const callbackLeave = (checked: PopupPeerButtonCallbackCheckboxes, flush = checkboxes && !!checked.size) => {\n let promise = managers.appChatsManager.leave(peerId.toChatId());\n\n if(flush) {\n promise = promise.then(() => {\n return managers.appMessagesManager.flushHistory(peerId);\n }) as any;\n }\n\n onSelect?.(promise);\n };\n\n const callbackDelete = (checked: PopupPeerButtonCallbackCheckboxes) => {\n let promise: Promise;\n\n if(threadId) {\n promise = managers.appMessagesManager.flushHistory(peerId, false, true, threadId);\n } else if(peerId.isUser()) {\n promise = managers.appMessagesManager.flushHistory(peerId, false, checkboxes ? !!checked.size : undefined);\n } else {\n if(checked.size) {\n promise = managers.appChatsManager.delete(peerId.toChatId());\n } else {\n return callbackLeave(checked);\n }\n }\n\n onSelect?.(promise);\n };\n\n let title: LangPackKey,\n titleArgs: FormatterArguments,\n description: LangPackKey,\n descriptionArgs: FormatterArguments,\n buttons: PopupPeerOptions['buttons'],\n checkboxes: PopupPeerOptions['checkboxes'];\n switch(peerType) {\n case 'channel': {\n if(/* actionType === 'delete' && */await managers.appChatsManager.hasRights(peerId.toChatId(), 'delete_chat')) {\n title = 'ChannelDeleteMenu';\n description = 'AreYouSureDeleteAndExitChannel';\n buttons = [{\n langKey: 'ChannelDeleteMenu',\n isDanger: true,\n callback: callbackDelete\n }];\n\n checkboxes = [{\n text: 'DeleteChannelForAll'\n }];\n } else {\n title = 'LeaveChannelMenu';\n description = 'ChannelLeaveAlertWithName';\n descriptionArgs = [peerTitleElement];\n buttons = [{\n langKey: 'LeaveChannel',\n isDanger: true,\n callback: callbackLeave\n }];\n }\n\n break;\n }\n\n /* case 'megagroup': {\n title = 'Leave Group?';\n description = `Are you sure you want to leave this group?`;\n buttons = [{\n text: 'LEAVE ' + peerTitleElement,\n isDanger: true,\n callback: callbackLeave\n }];\n\n break;\n } */\n\n case 'chat': {\n title = 'DeleteChatUser';\n description = 'AreYouSureDeleteThisChatWithUser';\n descriptionArgs = [peerTitleElement];\n\n buttons = [{\n langKey: 'DeleteChatUser',\n isDanger: true,\n callback: callbackDelete\n }];\n\n checkboxes = [{\n text: 'DeleteMessagesOptionAlso',\n textArgs: [\n await wrapPeerTitle({peerId})\n ]\n }];\n\n break;\n }\n\n case 'saved': {\n title = 'DeleteChatUser';\n description = 'AreYouSureDeleteThisChatSavedMessages';\n buttons = [{\n langKey: 'DeleteChatUser',\n isDanger: true,\n callback: callbackDelete\n }];\n\n break;\n }\n\n case 'megagroup':\n case 'group': {\n if(threadId) {\n title = 'DeleteTopics';\n titleArgs = [1];\n description = 'DeleteSelectedTopic';\n descriptionArgs = [peerTitleElement];\n buttons = [{\n langKey: 'Delete',\n isDanger: true,\n callback: callbackDelete\n }];\n } else if(/* actionType === 'delete' && */await managers.appChatsManager.hasRights(peerId.toChatId(), 'delete_chat')) {\n title = 'DeleteMegaMenu';\n description = 'AreYouSureDeleteAndExit';\n buttons = [{\n langKey: 'DeleteMegaMenu',\n isDanger: true,\n callback: callbackDelete\n }];\n\n checkboxes = [{\n text: 'DeleteChat.DeleteGroupForAll'\n }];\n } else {\n title = 'LeaveMegaMenu';\n description = 'AreYouSureDeleteAndExitName';\n descriptionArgs = [peerTitleElement];\n buttons = [{\n langKey: 'DeleteChatUser',\n isDanger: true,\n callback: (checkboxes) => callbackLeave(checkboxes, true)\n }];\n }\n\n break;\n }\n }\n\n new PopupPeer('popup-delete-chat', {\n peerId,\n threadId,\n titleLangKey: title,\n titleLangArgs: titleArgs,\n descriptionLangKey: description,\n descriptionLangArgs: descriptionArgs,\n buttons,\n checkboxes\n }).show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../../lib/rootScope';\nimport PopupElement, {addCancelButton} from '.';\nimport PopupPeer, {PopupPeerButtonCallbackCheckboxes, PopupPeerOptions} from './peer';\nimport {ChatType} from '../chat/chat';\nimport {i18n, LangPackKey} from '../../lib/langPack';\nimport hasRights from '../../lib/appManagers/utils/chats/hasRights';\nimport filterAsync from '../../helpers/array/filterAsync';\nimport wrapPeerTitle from '../wrappers/peerTitle';\n\nexport default class PopupDeleteMessages {\n constructor(\n private peerId: PeerId,\n private mids: number[],\n private type: ChatType,\n private onConfirm?: () => void,\n private threadId?: number\n ) {\n this.construct();\n }\n\n private async construct() {\n let {peerId, mids, type, onConfirm, threadId} = this;\n\n const peerTitleElement = await wrapPeerTitle({peerId, threadId});\n\n const managers = PopupElement.MANAGERS;\n\n mids = mids.slice();\n const callback = (checked: PopupPeerButtonCallbackCheckboxes, revoke?: boolean) => {\n onConfirm && onConfirm();\n if(type === 'scheduled') {\n managers.appMessagesManager.deleteScheduledMessages(peerId, mids);\n } else {\n managers.appMessagesManager.deleteMessages(peerId, mids, !!checked.size || revoke);\n }\n };\n\n const buttons: PopupPeerOptions['buttons'] = [{\n langKey: 'Delete',\n isDanger: true,\n callback\n }];\n const checkboxes: PopupPeerOptions['checkboxes'] = [];\n let title: LangPackKey, titleArgs: any[], description: LangPackKey, descriptionArgs: any[];\n if(mids.length === 1) {\n title = 'DeleteSingleMessagesTitle';\n } else {\n title = 'DeleteMessagesTitle';\n titleArgs = [i18n('messages', [mids.length])];\n }\n\n if(await managers.appPeersManager.isMegagroup(peerId)) {\n description = mids.length === 1 ? 'AreYouSureDeleteSingleMessageMega' : 'AreYouSureDeleteFewMessagesMega';\n } else {\n description = mids.length === 1 ? 'AreYouSureDeleteSingleMessage' : 'AreYouSureDeleteFewMessages';\n }\n\n if(peerId === rootScope.myId || type === 'scheduled') {\n\n } else {\n if(peerId.isUser()) {\n checkboxes.push({\n text: 'DeleteMessagesOptionAlso',\n textArgs: [peerTitleElement]\n });\n } else {\n const chat = await managers.appChatsManager.getChat(peerId.toChatId());\n\n const _hasRights = hasRights(chat, 'delete_messages');\n if(chat._ === 'chat') {\n const canRevoke = _hasRights ? mids.slice() : await filterAsync(mids, async(mid) => {\n const message = await managers.appMessagesManager.getMessageByPeer(peerId, mid);\n return message.fromId === rootScope.myId;\n });\n\n if(canRevoke.length) {\n if(canRevoke.length === mids.length) {\n checkboxes.push({\n text: 'DeleteForAll'\n });\n } else {\n checkboxes.push({\n text: 'DeleteMessagesOption'\n });\n\n description = 'DeleteMessagesTextGroup';\n descriptionArgs = [i18n('messages', [canRevoke.length])];\n // description = `You can also delete the ${canRevoke.length} message${canRevoke.length > 1 ? 's' : ''} you sent from the inboxes of other group members by pressing \"${buttonText}\".`;\n }\n }\n } else {\n buttons[0].callback = (checked) => callback(checked, true);\n }\n }\n }\n\n addCancelButton(buttons);\n\n const popup = new PopupPeer('popup-delete-chat', {\n peerId,\n threadId,\n titleLangKey: title,\n titleLangArgs: titleArgs,\n descriptionLangKey: description,\n descriptionLangArgs: descriptionArgs,\n buttons,\n checkboxes\n });\n\n popup.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {ChatRights} from '../../lib/appManagers/appChatsManager';\nimport flatten from '../../helpers/array/flatten';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport rootScope from '../../lib/rootScope';\nimport {toastNew} from '../toast';\nimport PopupPickUser from './pickUser';\nimport getMediaFromMessage from '../../lib/appManagers/utils/messages/getMediaFromMessage';\n\nexport default class PopupForward extends PopupPickUser {\n constructor(\n peerIdMids?: {[fromPeerId: PeerId]: number[]},\n onSelect?: (peerId: PeerId) => Promise | void,\n chatRightsAction: ChatRights[] = ['send_plain']\n ) {\n super({\n peerTypes: ['dialogs', 'contacts'],\n onSelect: !peerIdMids && onSelect ? onSelect : async(peerId) => {\n if(onSelect) {\n const res = onSelect(peerId);\n if(res instanceof Promise) {\n await res;\n }\n }\n\n if(peerId === rootScope.myId) {\n let count = 0;\n for(const fromPeerId in peerIdMids) {\n const mids = peerIdMids[fromPeerId];\n count += mids.length;\n this.managers.appMessagesManager.forwardMessages(peerId, fromPeerId.toPeerId(), mids);\n }\n\n toastNew({\n langPackKey: count > 0 ? 'FwdMessagesToSavedMessages' : 'FwdMessageToSavedMessages'\n });\n\n return;\n }\n\n appImManager.setInnerPeer({peerId});\n appImManager.chat.input.initMessagesForward(peerIdMids);\n },\n placeholder: 'ShareModal.Search.ForwardPlaceholder',\n chatRightsActions: chatRightsAction,\n selfPresence: 'ChatYourSelf'\n });\n }\n\n public static async create(...args: ConstructorParameters) {\n const [peerIdMids] = args;\n const messagesPromises = Object.keys(peerIdMids).map((peerId) => {\n const mids = peerIdMids[peerId as any as number];\n return mids.map((mid) => {\n return rootScope.managers.appMessagesManager.getMessageByPeer(peerId.toPeerId(), mid);\n });\n });\n\n const messages = await Promise.all(flatten(messagesPromises));\n const actions: Set = new Set();\n messages.forEach((message) => {\n if(!message) {\n return;\n }\n\n const media = getMediaFromMessage(message);\n let action: ChatRights;\n if(!media) {\n if(message.viaBotId) {\n action = 'send_inline';\n } else {\n action = 'send_plain';\n }\n } else {\n if(media._ === 'webPage') {\n action = 'embed_links';\n } else if(media._ === 'photo') {\n action = 'send_photos';\n } else if(media._ === 'game') {\n action = 'send_games';\n } else {\n switch(media.type) {\n case 'audio':\n action = 'send_audios';\n break;\n case 'gif':\n action = 'send_gifs';\n break;\n case 'round':\n action = 'send_roundvideos';\n break;\n case 'sticker':\n action = 'send_stickers';\n break;\n case 'voice':\n action = 'send_voices';\n break;\n case 'video':\n action = 'send_videos';\n break;\n default:\n action = 'send_docs';\n break;\n }\n }\n }\n\n if(action) {\n actions.add(action);\n }\n });\n\n new PopupForward(args[0], args[1], Array.from(actions));\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ripple from '../ripple';\nimport animationIntersector from '../animationIntersector';\nimport appNavigationController, {NavigationItem} from '../appNavigationController';\nimport {i18n, LangPackKey, _i18n} from '../../lib/langPack';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport blurActiveElement from '../../helpers/dom/blurActiveElement';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport {attachClickEvent, simulateClickEvent} from '../../helpers/dom/clickEvent';\nimport isSendShortcutPressed from '../../helpers/dom/isSendShortcutPressed';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport EventListenerBase, {EventListenerListeners} from '../../helpers/eventListenerBase';\nimport {addFullScreenListener, getFullScreenElement} from '../../helpers/dom/fullScreen';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport overlayCounter from '../../helpers/overlayCounter';\nimport Scrollable from '../scrollable';\nimport {getMiddleware, MiddlewareHelper} from '../../helpers/middleware';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\n\nexport type PopupButton = {\n text?: string,\n callback?: () => void,\n langKey?: LangPackKey,\n langArgs?: any[],\n isDanger?: boolean,\n isCancel?: boolean,\n element?: HTMLButtonElement,\n noRipple?: boolean\n};\n\nexport type PopupOptions = Partial<{\n closable: boolean,\n overlayClosable: boolean,\n withConfirm: LangPackKey | boolean,\n body: boolean,\n confirmShortcutIsSendShortcut: boolean,\n withoutOverlay: boolean,\n scrollable: boolean,\n buttons: Array,\n title: boolean | LangPackKey,\n titleRaw: string\n}>;\n\nexport interface PopupElementConstructable {\n new(...args: any[]): T;\n}\n\nconst DEFAULT_APPEND_TO = document.body;\nlet appendPopupTo = DEFAULT_APPEND_TO;\n\nconst onFullScreenChange = () => {\n appendPopupTo = getFullScreenElement() || DEFAULT_APPEND_TO;\n PopupElement.reAppend();\n};\n\naddFullScreenListener(DEFAULT_APPEND_TO, onFullScreenChange);\n\ntype PopupListeners = {\n close: () => void,\n closeAfterTimeout: () => void\n};\n\nexport default class PopupElement extends EventListenerBase {\n private static POPUPS: PopupElement[] = [];\n public static MANAGERS: AppManagers;\n\n protected element = document.createElement('div');\n protected container = document.createElement('div');\n protected header = document.createElement('div');\n protected title = document.createElement('div');\n protected btnClose: HTMLElement;\n protected btnConfirm: HTMLButtonElement;\n protected body: HTMLElement;\n protected buttonsEl: HTMLElement;\n\n protected onEscape: () => boolean = () => true;\n\n protected navigationItem: NavigationItem;\n\n protected listenerSetter: ListenerSetter;\n\n protected confirmShortcutIsSendShortcut: boolean;\n protected btnConfirmOnEnter: HTMLElement;\n\n protected withoutOverlay: boolean;\n\n protected managers: AppManagers;\n\n protected scrollable: Scrollable;\n\n protected buttons: Array;\n\n protected middlewareHelper: MiddlewareHelper;\n\n constructor(className: string, options: PopupOptions = {}) {\n super(false);\n this.element.classList.add('popup');\n this.element.className = 'popup' + (className ? ' ' + className : '');\n this.container.classList.add('popup-container', 'z-depth-1');\n\n this.header.classList.add('popup-header');\n\n if(options.title || options.titleRaw) {\n this.title.classList.add('popup-title');\n if(typeof(options.title) === 'string') {\n _i18n(this.title, options.title);\n } else if(options.titleRaw) {\n this.title.append(wrapEmojiText(options.titleRaw));\n }\n\n this.header.append(this.title);\n }\n\n this.middlewareHelper = getMiddleware();\n this.listenerSetter = new ListenerSetter();\n this.managers = PopupElement.MANAGERS;\n\n this.confirmShortcutIsSendShortcut = options.confirmShortcutIsSendShortcut;\n\n if(options.closable) {\n this.btnClose = document.createElement('span');\n this.btnClose.classList.add('btn-icon', 'popup-close', 'tgico-close');\n // ripple(this.closeBtn);\n this.header.prepend(this.btnClose);\n\n attachClickEvent(this.btnClose, this.hide, {listenerSetter: this.listenerSetter, once: true});\n }\n\n this.withoutOverlay = options.withoutOverlay;\n if(this.withoutOverlay) {\n this.element.classList.add('no-overlay');\n }\n\n if(options.overlayClosable) {\n attachClickEvent(this.element, (e: MouseEvent) => {\n if(!findUpClassName(e.target, 'popup-container')) {\n this.hide();\n }\n }, {listenerSetter: this.listenerSetter});\n }\n\n if(options.withConfirm) {\n this.btnConfirm = document.createElement('button');\n this.btnConfirm.classList.add('btn-primary', 'btn-color-primary');\n if(options.withConfirm !== true) {\n this.btnConfirm.append(i18n(options.withConfirm));\n }\n this.header.append(this.btnConfirm);\n ripple(this.btnConfirm);\n }\n\n this.container.append(this.header);\n if(options.body) {\n this.body = document.createElement('div');\n this.body.classList.add('popup-body');\n this.container.append(this.body);\n }\n\n if(options.scrollable) {\n const scrollable = this.scrollable = new Scrollable(this.body);\n this.attachScrollableListeners();\n\n if(!this.body) {\n this.container.insertBefore(scrollable.container, this.header.nextSibling);\n }\n }\n\n let btnConfirmOnEnter = this.btnConfirm;\n const buttons = this.buttons = options.buttons;\n if(buttons?.length) {\n const buttonsDiv = this.buttonsEl = document.createElement('div');\n buttonsDiv.classList.add('popup-buttons');\n\n const buttonsElements = buttons.map((b) => {\n const button = document.createElement('button');\n button.className = 'btn' + (b.isDanger ? ' danger' : ' primary');\n\n if(!b.noRipple) {\n ripple(button);\n }\n\n if(b.text) {\n button.textContent = b.text;\n } else {\n button.append(i18n(b.langKey, b.langArgs));\n }\n\n attachClickEvent(button, () => {\n b.callback?.();\n this.destroy();\n }, {listenerSetter: this.listenerSetter, once: true});\n\n return b.element = button;\n });\n\n if(!btnConfirmOnEnter && buttons.length === 2) {\n const button = buttons.find((button) => !button.isCancel);\n if(button) {\n btnConfirmOnEnter = button.element;\n }\n }\n\n buttonsDiv.append(...buttonsElements);\n this.container.append(buttonsDiv);\n }\n\n this.btnConfirmOnEnter = btnConfirmOnEnter;\n\n this.element.append(this.container);\n\n PopupElement.POPUPS.push(this);\n }\n\n protected attachScrollableListeners(setClassOn?: HTMLElement) {\n return this.scrollable.attachBorderListeners(setClassOn);\n }\n\n protected onContentUpdate() {\n if(this.scrollable) {\n this.scrollable.onAdditionalScroll();\n }\n }\n\n public show() {\n this.navigationItem = {\n type: 'popup',\n onPop: () => this.destroy(),\n onEscape: this.onEscape\n };\n\n appNavigationController.pushItem(this.navigationItem);\n\n blurActiveElement(); // * hide mobile keyboard\n appendPopupTo.append(this.element);\n void this.element.offsetWidth; // reflow\n this.element.classList.add('active');\n\n this.onContentUpdate();\n\n if(!this.withoutOverlay) {\n overlayCounter.isOverlayActive = true;\n animationIntersector.checkAnimations2(true);\n }\n\n // cannot add event instantly because keydown propagation will fire it\n // if(this.btnConfirmOnEnter) {\n setTimeout(() => {\n if(!this.element.classList.contains('active')) {\n return;\n }\n\n this.listenerSetter.add(document.body)('keydown', (e) => {\n if(PopupElement.POPUPS[PopupElement.POPUPS.length - 1] !== this) {\n return;\n }\n\n if(this.confirmShortcutIsSendShortcut ? isSendShortcutPressed(e) : e.key === 'Enter') {\n simulateClickEvent(this.btnConfirmOnEnter);\n cancelEvent(e);\n }\n });\n }, 0);\n // }\n }\n\n public hide = () => {\n appNavigationController.backByItem(this.navigationItem);\n };\n\n protected destroy() {\n this.dispatchEvent('close');\n this.element.classList.add('hiding');\n this.element.classList.remove('active');\n this.listenerSetter.removeAll();\n this.middlewareHelper.destroy();\n\n if(!this.withoutOverlay) {\n overlayCounter.isOverlayActive = false;\n }\n\n appNavigationController.removeItem(this.navigationItem);\n this.navigationItem = undefined;\n\n indexOfAndSplice(PopupElement.POPUPS, this);\n\n // ! calm\n onFullScreenChange();\n\n setTimeout(() => {\n this.element.remove();\n this.dispatchEvent('closeAfterTimeout');\n this.cleanup();\n this.scrollable?.destroy();\n\n if(!this.withoutOverlay) {\n animationIntersector.checkAnimations2(false);\n }\n }, 150);\n }\n\n public static reAppend() {\n this.POPUPS.forEach((popup) => {\n const {element, container} = popup;\n const parentElement = element.parentElement;\n if(parentElement && parentElement !== appendPopupTo && appendPopupTo !== container) {\n appendPopupTo.append(element);\n }\n });\n }\n\n public static getPopups(popupConstructor: PopupElementConstructable) {\n return this.POPUPS.filter((element) => element instanceof popupConstructor) as T[];\n }\n\n public static createPopup>(ctor: {new(...args: A): T}, ...args: A) {\n const popup = new ctor(...args);\n return popup;\n }\n}\n\nexport const addCancelButton = (buttons: PopupButton[]) => {\n const button = buttons.find((b) => b.isCancel);\n if(!button) {\n buttons.push({\n langKey: 'Cancel',\n isCancel: true\n });\n }\n\n return buttons;\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement, {addCancelButton} from '.';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport numberThousandSplitter from '../../helpers/number/numberThousandSplitter';\nimport {ChatInvite} from '../../layer';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {i18n, _i18n} from '../../lib/langPack';\nimport {NULL_PEER_ID} from '../../lib/mtproto/mtproto_config';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport AvatarElement from '../avatar';\nimport putPhoto from '../putPhoto';\nimport {toastNew} from '../toast';\nimport wrapPhoto from '../wrappers/photo';\n\n// const FAKE_CHAT_ID = Number.MAX_SAFE_INTEGER - 0x1000;\n\nexport default class PopupJoinChatInvite extends PopupElement {\n constructor(\n private hash: string,\n private chatInvite: ChatInvite.chatInvite\n ) {\n super('popup-join-chat-invite', {\n closable: true,\n overlayClosable: true,\n body: true,\n buttons: addCancelButton([{\n langKey: chatInvite.pFlags.request_needed ? 'RequestJoin.Button' : (chatInvite.pFlags.broadcast ? 'JoinByPeekChannelTitle' : 'JoinByPeekGroupTitle'),\n callback: () => {\n this.managers.appChatsManager.importChatInvite(hash)\n .then((chatId) => {\n const peerId = chatId.toPeerId(true);\n appImManager.setInnerPeer({peerId});\n }, (error) => {\n if(error.type === 'INVITE_REQUEST_SENT') {\n toastNew({langPackKey: 'RequestToJoinSent'});\n }\n });\n }\n }])\n });\n\n this.construct();\n }\n\n private async construct() {\n this.header.remove();\n /* const fakeChat: Chat.channel | Chat.chat = {\n _: chatInvite.pFlags.channel ? 'channel' : 'chat',\n id: FAKE_CHAT_ID,\n title: chatInvite.title,\n photo: chatInvite.photo as any,\n date: Date.now() / 1000 | 0,\n version: 0,\n participants_count: chatInvite.participants_count,\n pFlags: chatInvite.pFlags as any\n };\n\n appChatsManager.saveApiChat(fakeChat); */\n\n const {chatInvite, managers, hash} = this;\n\n const avatarElem = new AvatarElement();\n avatarElem.classList.add('avatar-100');\n avatarElem.isDialog = false;\n if(chatInvite.photo._ === 'photo') {\n chatInvite.photo = await managers.appPhotosManager.savePhoto(chatInvite.photo);\n wrapPhoto({\n container: avatarElem,\n message: null,\n photo: chatInvite.photo,\n boxHeight: 100,\n boxWidth: 100,\n withoutPreloader: true\n });\n avatarElem.style.width = avatarElem.style.height = '';\n } else {\n putPhoto({\n div: avatarElem,\n peerId: NULL_PEER_ID,\n isDialog: false,\n title: chatInvite.title\n });\n }\n\n const title = document.createElement('div');\n title.classList.add('chat-title');\n setInnerHTML(title, wrapEmojiText(chatInvite.title));\n // avatarElem.setAttribute('peer', '' + -fakeChat.id);\n\n const isBroadcast = chatInvite.pFlags.broadcast;\n const peopleCount = i18n(isBroadcast ? 'Subscribers' : 'Members', [numberThousandSplitter(chatInvite.participants_count)]);\n peopleCount.classList.add('chat-participants-count');\n\n this.body.append(avatarElem, title, peopleCount);\n\n if(chatInvite.pFlags.request_needed) {\n const caption = document.createElement('div');\n _i18n(caption, isBroadcast ? 'RequestToJoinChannelDescription' : 'RequestToJoinGroupDescription');\n caption.classList.add('chat-participants-count', 'request-caption');\n\n this.body.append(caption);\n }\n\n this.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport liteMode from '../../helpers/liteMode';\nimport {doubleRaf} from '../../helpers/schedulers';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {LangPackKey, _i18n, i18n} from '../../lib/langPack';\nimport {ApiLimitType} from '../../lib/mtproto/api_methods';\nimport rootScope from '../../lib/rootScope';\nimport PopupPeer from './peer';\n\nconst a: {[type in ApiLimitType]?: {\n title: LangPackKey,\n description: LangPackKey,\n descriptionPremium: LangPackKey,\n descriptionLocked: LangPackKey,\n icon: string\n}} = {\n pin: {\n title: 'LimitReached',\n description: 'LimitReachedPinDialogs',\n descriptionPremium: 'LimitReachedPinDialogsPremium',\n descriptionLocked: 'LimitReachedPinDialogsLocked',\n icon: 'limit_pin'\n },\n folders: {\n title: 'LimitReached',\n description: 'LimitReachedFolders',\n descriptionPremium: 'LimitReachedFoldersPremium',\n descriptionLocked: 'LimitReachedFoldersLocked',\n icon: 'limit_folders'\n }\n};\n\nclass P extends PopupPeer {\n constructor(options: {\n isPremium: boolean,\n limit: number,\n limitPremium: number\n }, _a: typeof a[keyof typeof a]) {\n super('popup-limit', {\n buttons: options.isPremium === undefined ? [{\n langKey: 'LimitReached.Ok',\n isCancel: true\n }] : (options.isPremium ? [{\n langKey: 'OK',\n isCancel: true\n }] : [{\n langKey: 'IncreaseLimit',\n callback: () => {\n appImManager.openPremiumBot();\n },\n noRipple: true\n }, {\n langKey: 'Cancel',\n isCancel: true\n }]),\n descriptionLangKey: options.isPremium === undefined ? _a.descriptionLocked : (options.isPremium ? _a.descriptionPremium : _a.description),\n descriptionLangArgs: options.isPremium ? [options.limitPremium] : [options.limit, options.limitPremium],\n titleLangKey: _a.title\n });\n\n const isLocked = options.isPremium === undefined;\n if(isLocked) {\n this.element.classList.add('is-locked');\n } else if(options.isPremium) {\n this.element.classList.add('is-premium');\n } else {\n const button = this.buttons.find((b) => !b.isCancel);\n button.element.classList.add('popup-limit-button');\n const i = document.createElement('i');\n i.classList.add('popup-limit-button-icon', 'tgico-premium_double');\n button.element.append(i);\n }\n\n const limitContainer = document.createElement('div');\n limitContainer.classList.add('popup-limit-line');\n\n const hint = document.createElement('div');\n hint.classList.add('popup-limit-hint');\n const i = document.createElement('span');\n i.classList.add('popup-limit-hint-icon', 'tgico-' + _a.icon);\n hint.append(i, '' + (options.isPremium ? options.limitPremium : options.limit));\n\n limitContainer.append(hint);\n\n if(!isLocked) {\n const limit = document.createElement('div');\n limit.classList.add('limit-line');\n\n const free = document.createElement('div');\n free.classList.add('limit-line-free');\n\n const premium = document.createElement('div');\n premium.classList.add('limit-line-premium');\n\n limit.append(free, premium);\n\n _i18n(free, 'LimitFree');\n premium.append(i18n('LimitPremium'), '' + options.limitPremium);\n\n limitContainer.append(limit);\n }\n\n this.container.insertBefore(limitContainer, this.description);\n\n // if(options.isPremium === false) {\n // this.buttons.pop().element.remove();\n // }\n\n const setHintActive = () => {\n hint.classList.add('active');\n };\n\n if(liteMode.isAvailable('animations')) {\n doubleRaf().then(setHintActive);\n } else {\n setHintActive();\n }\n }\n}\n\nexport default async function showLimitPopup(type: keyof typeof a) {\n const _a = a[type];\n const [appConfig, limit, limitPremium] = await Promise.all([\n rootScope.managers.apiManager.getAppConfig(),\n ...[false, true].map((v) => rootScope.managers.apiManager.getLimit(type, v))\n ]);\n const isLocked = appConfig.premium_purchase_blocked;\n new P({\n isPremium: isLocked ? undefined : rootScope.premium,\n limit,\n limitPremium\n }, _a).show();\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport tsNow from '../../helpers/tsNow';\nimport {LangPackKey} from '../../lib/langPack';\nimport {MUTE_UNTIL} from '../../lib/mtproto/mtproto_config';\nimport {RadioFormFromValues} from '../row';\nimport PopupPeer from './peer';\n\nconst ONE_HOUR = 3600;\nconst times: {value: number | string, langPackKey: LangPackKey, checked?: boolean}[] = [{\n value: ONE_HOUR,\n langPackKey: 'ChatList.Mute.1Hour'\n}, {\n value: ONE_HOUR * 4,\n langPackKey: 'ChatList.Mute.4Hours'\n}, {\n value: ONE_HOUR * 8,\n langPackKey: 'ChatList.Mute.8Hours'\n}, {\n value: ONE_HOUR * 24,\n langPackKey: 'ChatList.Mute.1Day'\n}, {\n value: ONE_HOUR * 24 * 3,\n langPackKey: 'ChatList.Mute.3Days'\n}, {\n value: -1,\n langPackKey: 'ChatList.Mute.Forever',\n checked: true\n}];\n\nexport default class PopupMute extends PopupPeer {\n constructor(peerId: PeerId, threadId?: number) {\n super('popup-mute', {\n peerId,\n titleLangKey: 'Notifications',\n buttons: [{\n langKey: 'ChatList.Context.Mute',\n callback: () => {\n this.managers.appMessagesManager.mutePeer({peerId, muteUntil: time === -1 ? MUTE_UNTIL : tsNow(true) + time, threadId});\n }\n }],\n body: true\n });\n\n let time: number;\n const radioForm = RadioFormFromValues(times, (value) => {\n time = +value;\n });\n\n this.body.append(radioForm);\n\n this.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport pause from './schedulers/pause';\nimport {makeMediaSize} from './mediaSize';\nimport scaleMediaElement from './canvas/scaleMediaElement';\nimport preloadVideo from './preloadVideo';\n\nexport function createPosterFromMedia(media: HTMLVideoElement | HTMLImageElement) {\n let width: number, height: number;\n if(media instanceof HTMLVideoElement) {\n width = media.videoWidth;\n height = media.videoHeight;\n } else {\n width = media.naturalWidth;\n height = media.naturalHeight;\n }\n\n return scaleMediaElement({\n media,\n mediaSize: makeMediaSize(width, height),\n boxSize: makeMediaSize(320, 240),\n quality: .9\n });\n}\n\nexport function createPosterFromVideo(video: HTMLVideoElement): ReturnType {\n return new Promise((resolve, reject) => {\n video.onseeked = () => {\n video.onseeked = () => {\n createPosterFromMedia(video).then(resolve);\n\n video.onseeked = undefined;\n };\n\n video.currentTime = 0;\n };\n\n video.onerror = reject;\n video.currentTime = Math.min(video.duration, 1);\n });\n}\n\nexport async function createPosterForVideo(url: string) {\n const video = await preloadVideo(url);\n\n return Promise.race([\n pause(2000) as Promise,\n createPosterFromVideo(video)\n ]);\n}\n\n\n","/**\n * @returns duration in ms\n */\nexport default function getGifDuration(image: HTMLImageElement) {\n const src = image.src;\n\n return fetch(src)\n .then((response) => response.arrayBuffer())\n .then((arrayBuffer) => {\n const d = new Uint8Array(arrayBuffer);\n // Thanks to http://justinsomnia.org/2006/10/gif-animation-duration-calculation/\n // And http://www.w3.org/Graphics/GIF/spec-gif89a.txt\n let duration = 0;\n for(let i = 0, length = d.length; i < length; ++i) {\n // Find a Graphic Control Extension hex(21F904__ ____ __00)\n if(d[i] == 0x21 &&\n d[i + 1] == 0xF9 &&\n d[i + 2] == 0x04 &&\n d[i + 7] == 0x00) {\n // Swap 5th and 6th bytes to get the delay per frame\n const delay = (d[i + 5] << 8) | (d[i + 4] & 0xFF);\n\n // Should be aware browsers have a minimum frame delay\n // e.g. 6ms for IE, 2ms modern browsers (50fps)\n duration += delay < 2 ? 10 : delay;\n }\n }\n\n return duration / 1000;\n });\n}\n","export type AUDIO_MIME_TYPE = 'audio/mpeg' | 'audio/aac' | 'audio/wav';\nconst AUDIO_MIME_TYPES_SUPPORTED: Set = new Set([\n 'audio/mpeg',\n 'audio/aac',\n 'audio/wav'\n]);\n\nexport default AUDIO_MIME_TYPES_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type Chat from '../chat/chat';\nimport type {SendFileDetails} from '../../lib/appManagers/appMessagesManager';\nimport type {ChatRights} from '../../lib/appManagers/appChatsManager';\nimport PopupElement from '.';\nimport Scrollable from '../scrollable';\nimport {toast, toastNew} from '../toast';\nimport SendContextMenu from '../chat/sendContextMenu';\nimport {createPosterFromMedia, createPosterFromVideo} from '../../helpers/createPoster';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport I18n, {FormatterArguments, i18n, LangPackKey} from '../../lib/langPack';\nimport calcImageInBox from '../../helpers/calcImageInBox';\nimport placeCaretAtEnd from '../../helpers/dom/placeCaretAtEnd';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport MEDIA_MIME_TYPES_SUPPORTED from '../../environment/mediaMimeTypesSupport';\nimport getGifDuration from '../../helpers/getGifDuration';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport createVideo from '../../helpers/dom/createVideo';\nimport prepareAlbum from '../prepareAlbum';\nimport {makeMediaSize, MediaSize} from '../../helpers/mediaSize';\nimport {ThumbCache} from '../../lib/storages/thumbs';\nimport onMediaLoad from '../../helpers/onMediaLoad';\nimport apiManagerProxy from '../../lib/mtproto/mtprotoworker';\nimport {THUMB_TYPE_FULL} from '../../lib/mtproto/mtproto_config';\nimport wrapDocument from '../wrappers/document';\nimport createContextMenu from '../../helpers/dom/createContextMenu';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport wrapMediaSpoiler, {toggleMediaSpoiler} from '../wrappers/mediaSpoiler';\nimport {MiddlewareHelper} from '../../helpers/middleware';\nimport {AnimationItemGroup} from '../animationIntersector';\nimport scaleMediaElement from '../../helpers/canvas/scaleMediaElement';\nimport {doubleRaf} from '../../helpers/schedulers';\nimport defineNotNumerableProperties from '../../helpers/object/defineNotNumerableProperties';\nimport {DocumentAttribute, Photo, PhotoSize} from '../../layer';\nimport {getPreviewBytesFromURL} from '../../helpers/bytes/getPreviewURLFromBytes';\nimport {renderImageFromUrlPromise} from '../../helpers/dom/renderImageFromUrl';\nimport ButtonMenuToggle from '../buttonMenuToggle';\nimport partition from '../../helpers/array/partition';\nimport InputFieldAnimated from '../inputFieldAnimated';\nimport IMAGE_MIME_TYPES_SUPPORTED from '../../environment/imageMimeTypesSupport';\nimport VIDEO_MIME_TYPES_SUPPORTED from '../../environment/videoMimeTypesSupport';\nimport rootScope from '../../lib/rootScope';\nimport shake from '../../helpers/dom/shake';\nimport AUDIO_MIME_TYPES_SUPPORTED from '../../environment/audioMimeTypeSupport';\nimport liteMode from '../../helpers/liteMode';\n\ntype SendFileParams = SendFileDetails & {\n file?: File,\n scaledBlob?: Blob,\n noSound?: boolean,\n itemDiv: HTMLElement,\n mediaSpoiler?: HTMLElement,\n middlewareHelper: MiddlewareHelper\n // strippedBytes?: PhotoSize.photoStrippedSize['bytes']\n};\n\nlet currentPopup: PopupNewMedia;\n\nconst MAX_WIDTH = 400 - 16;\n\nexport function getCurrentNewMediaPopup() {\n return currentPopup;\n}\n\nexport default class PopupNewMedia extends PopupElement {\n private mediaContainer: HTMLElement;\n private wasInputValue: string;\n\n private willAttach: Partial<{\n type: 'media' | 'document',\n isMedia: true,\n group: boolean,\n sendFileDetails: SendFileParams[]\n }>;\n private messageInputField: InputFieldAnimated;\n private captionLengthMax: number;\n\n private animationGroup: AnimationItemGroup;\n private _scrollable: Scrollable;\n private inputContainer: HTMLDivElement;\n\n constructor(\n private chat: Chat,\n private files: File[],\n willAttachType: PopupNewMedia['willAttach']['type'],\n private ignoreInputValue?: boolean\n ) {\n super('popup-send-photo popup-new-media', {\n closable: true,\n withConfirm: 'Modal.Send',\n confirmShortcutIsSendShortcut: true,\n body: true,\n title: true,\n scrollable: true\n });\n\n this.animationGroup = '';\n this.construct(willAttachType);\n }\n\n public static async canSend(peerId: PeerId, onlyVisible?: boolean) {\n const actions: ChatRights[] = [\n 'send_photos',\n 'send_videos',\n 'send_docs',\n 'send_audios',\n 'send_gifs'\n ];\n\n const actionsPromises = actions.map((action) => {\n return peerId.isAnyChat() && !onlyVisible ? rootScope.managers.appChatsManager.hasRights(peerId.toChatId(), action) : true;\n });\n\n const out: {[action in ChatRights]?: boolean} = {};\n\n const results = await Promise.all(actionsPromises);\n actions.forEach((action, idx) => {\n out[action] = results[idx];\n })\n\n return out;\n }\n\n private async construct(willAttachType: PopupNewMedia['willAttach']['type']) {\n this.willAttach = {\n type: willAttachType,\n sendFileDetails: [],\n group: true\n };\n\n const captionMaxLength = await this.managers.apiManager.getLimit('caption');\n this.captionLengthMax = captionMaxLength;\n\n const canSend = await PopupNewMedia.canSend(this.chat.peerId, true);\n\n const canSendPhotos = canSend.send_photos;\n const canSendVideos = canSend.send_videos;\n const canSendDocs = canSend.send_docs;\n\n attachClickEvent(this.btnConfirm, () => this.send(), {listenerSetter: this.listenerSetter});\n\n const btnMenu = await ButtonMenuToggle({\n listenerSetter: this.listenerSetter,\n direction: 'bottom-left',\n buttons: [{\n icon: 'image',\n text: 'Popup.Attach.AsMedia',\n onClick: () => this.changeType('media'),\n verify: () => {\n if(!this.hasAnyMedia() || this.willAttach.type !== 'document') {\n return false;\n }\n\n if(!canSendPhotos && !canSendVideos) {\n return false;\n }\n\n if(!canSendPhotos || !canSendVideos) {\n const mimeTypes = canSendPhotos ? IMAGE_MIME_TYPES_SUPPORTED : VIDEO_MIME_TYPES_SUPPORTED;\n const {media, files} = this.partition(mimeTypes);\n if(files.length) {\n return false;\n }\n }\n\n return true;\n }\n }, {\n icon: 'document',\n text: 'SendAsFile',\n onClick: () => this.changeType('document'),\n verify: () => this.files.length === 1 && this.willAttach.type !== 'document' && canSendDocs\n }, {\n icon: 'document',\n text: 'SendAsFiles',\n onClick: () => this.changeType('document'),\n verify: () => this.files.length > 1 && this.willAttach.type !== 'document' && canSendDocs\n }, {\n icon: 'groupmedia',\n text: 'Popup.Attach.GroupMedia',\n onClick: () => this.changeGroup(true),\n verify: () => !this.willAttach.group && this.canGroupSomething()\n }, {\n icon: 'groupmediaoff',\n text: 'Popup.Attach.UngroupMedia',\n onClick: () => this.changeGroup(false),\n verify: () => this.willAttach.group && this.canGroupSomething()\n }, {\n icon: 'mediaspoiler',\n text: 'EnablePhotoSpoiler',\n onClick: () => this.changeSpoilers(true),\n verify: () => this.canToggleSpoilers(true, true)\n }, {\n icon: 'mediaspoiler',\n text: 'Popup.Attach.EnableSpoilers',\n onClick: () => this.changeSpoilers(true),\n verify: () => this.canToggleSpoilers(true, false)\n }, {\n icon: 'mediaspoileroff',\n text: 'DisablePhotoSpoiler',\n onClick: () => this.changeSpoilers(false),\n verify: () => this.canToggleSpoilers(false, true)\n }, {\n icon: 'mediaspoileroff',\n text: 'Popup.Attach.RemoveSpoilers',\n onClick: () => this.changeSpoilers(false),\n verify: () => this.canToggleSpoilers(false, false)\n }]\n });\n\n this.header.append(btnMenu);\n\n this.btnConfirm.remove();\n\n this.mediaContainer = document.createElement('div');\n this.mediaContainer.classList.add('popup-photo');\n this.scrollable.container.append(this.mediaContainer);\n\n const inputContainer = this.inputContainer = document.createElement('div');\n inputContainer.classList.add('popup-input-container');\n\n const c = document.createElement('div');\n c.classList.add('popup-input-inputs', 'input-message-container');\n\n this.messageInputField = new InputFieldAnimated({\n placeholder: 'PreviewSender.CaptionPlaceholder',\n name: 'message',\n withLinebreaks: true,\n maxLength: this.captionLengthMax\n });\n\n this.listenerSetter.add(this.scrollable.container)('scroll', this.onScroll);\n this.listenerSetter.add(this.messageInputField.input)('scroll', this.onScroll);\n\n this.messageInputField.input.classList.replace('input-field-input', 'input-message-input');\n this.messageInputField.inputFake.classList.replace('input-field-input', 'input-message-input');\n\n c.append(this.messageInputField.input, this.messageInputField.inputFake);\n inputContainer.append(c, this.btnConfirm);\n\n if(!this.ignoreInputValue) {\n this.messageInputField.value = this.wasInputValue = this.chat.input.messageInputField.input.innerHTML;\n this.chat.input.messageInputField.value = '';\n }\n\n this.container.append(inputContainer);\n\n this.attachFiles();\n\n this.addEventListener('close', () => {\n this.files.length = 0;\n this.willAttach.sendFileDetails.length = 0;\n\n if(currentPopup === this) {\n currentPopup = undefined;\n }\n });\n\n let target: HTMLElement, isMedia: boolean, item: SendFileParams;\n createContextMenu({\n buttons: [{\n icon: 'mediaspoiler',\n text: 'EnablePhotoSpoiler',\n onClick: () => {\n this.applyMediaSpoiler(item);\n },\n verify: () => isMedia && !item.mediaSpoiler\n }, {\n icon: 'mediaspoileroff',\n text: 'DisablePhotoSpoiler',\n onClick: () => {\n this.removeMediaSpoiler(item);\n },\n verify: () => !!(isMedia && item.mediaSpoiler)\n }],\n listenTo: this.mediaContainer,\n listenerSetter: this.listenerSetter,\n findElement: (e) => {\n target = findUpClassName(e.target, 'popup-item');\n isMedia = target.classList.contains('popup-item-media');\n item = this.willAttach.sendFileDetails.find((i) => i.itemDiv === target);\n return target;\n }\n });\n\n if(this.chat.type !== 'scheduled') {\n const sendMenu = new SendContextMenu({\n onSilentClick: () => {\n this.chat.input.sendSilent = true;\n this.send();\n },\n onScheduleClick: () => {\n this.chat.input.scheduleSending(() => {\n this.send();\n });\n },\n openSide: 'top-left',\n onContextElement: this.btnConfirm,\n listenerSetter: this.listenerSetter\n });\n\n sendMenu.setPeerId(this.chat.peerId);\n\n this.container.append(sendMenu.sendMenu);\n }\n\n currentPopup = this;\n }\n\n private onScroll = () => {\n const {input} = this.messageInputField;\n this.scrollable.onAdditionalScroll();\n if(input.scrollTop > 0 && input.scrollHeight > 130) {\n this.scrollable.container.classList.remove('scrolled-bottom');\n }\n };\n\n private async applyMediaSpoiler(item: SendFileParams, noAnimation?: boolean) {\n const middleware = item.middlewareHelper.get();\n const {width: widthStr, height: heightStr} = item.itemDiv.style;\n\n let width: number, height: number;\n if(item.itemDiv.classList.contains('album-item')) {\n const {width: containerWidthStr, height: containerHeightStr} = item.itemDiv.parentElement.style;\n const containerWidth = parseInt(containerWidthStr);\n const containerHeight = parseInt(containerHeightStr);\n\n width = +widthStr.slice(0, -1) / 100 * containerWidth;\n height = +heightStr.slice(0, -1) / 100 * containerHeight;\n } else {\n width = parseInt(widthStr);\n height = parseInt(heightStr);\n }\n\n const {url} = await scaleMediaElement({\n media: item.itemDiv.firstElementChild as HTMLImageElement,\n boxSize: makeMediaSize(40, 40),\n mediaSize: makeMediaSize(width, height),\n toDataURL: true,\n quality: 0.2\n });\n\n const strippedBytes = getPreviewBytesFromURL(url);\n const photoSize: PhotoSize.photoStrippedSize = {\n _: 'photoStrippedSize',\n bytes: strippedBytes,\n type: 'i'\n };\n\n item.strippedBytes = strippedBytes;\n\n const photo: Photo.photo = {\n _: 'photo',\n sizes: [\n photoSize\n ],\n id: 0,\n access_hash: 0,\n date: 0,\n dc_id: 0,\n file_reference: [],\n pFlags: {}\n };\n\n const mediaSpoiler = await wrapMediaSpoiler({\n middleware,\n width,\n height,\n animationGroup: this.animationGroup,\n media: photo\n });\n\n if(!middleware()) {\n return;\n }\n\n if(!noAnimation) {\n mediaSpoiler.classList.add('is-revealing');\n }\n\n item.mediaSpoiler = mediaSpoiler;\n item.itemDiv.append(mediaSpoiler);\n\n await doubleRaf();\n if(!middleware()) {\n return;\n }\n\n toggleMediaSpoiler({\n mediaSpoiler,\n reveal: false\n });\n }\n\n private removeMediaSpoiler(item: SendFileParams) {\n toggleMediaSpoiler({\n mediaSpoiler: item.mediaSpoiler,\n reveal: true,\n destroyAfter: true\n });\n\n item.mediaSpoiler = undefined;\n }\n\n public appendDrops(element: HTMLElement) {\n this.body.append(element);\n }\n\n get type() {\n return this.willAttach.type;\n }\n\n set type(type: PopupNewMedia['willAttach']['type']) {\n this.willAttach.type = type;\n }\n\n private partition(mimeTypes = MEDIA_MIME_TYPES_SUPPORTED) {\n const [media, files] = partition(this.willAttach.sendFileDetails, (d) => mimeTypes.has(d.file.type));\n return {\n media,\n files\n };\n }\n\n private mediaCount() {\n return this.partition().media.length;\n }\n\n private hasAnyMedia() {\n return this.mediaCount() > 0;\n }\n\n private canGroupSomething() {\n const {media, files} = this.partition();\n return media.length > 1 || files.length > 1;\n }\n\n private canToggleSpoilers(toggle: boolean, single: boolean) {\n let good = this.willAttach.type === 'media' && this.hasAnyMedia();\n if(single && good) {\n good = this.files.length === 1;\n }\n\n if(good) {\n const media = this.willAttach.sendFileDetails\n .filter((d) => MEDIA_MIME_TYPES_SUPPORTED.has(d.file.type))\n const mediaWithSpoilers = media.filter((d) => d.mediaSpoiler);\n\n good = single ? true : media.length > 1;\n\n if(good) {\n good = toggle ? media.length !== mediaWithSpoilers.length : media.length === mediaWithSpoilers.length;\n }\n }\n\n return good;\n }\n\n private changeType(type: PopupNewMedia['willAttach']['type']) {\n this.willAttach.type = type;\n this.attachFiles();\n }\n\n public changeGroup(group: boolean) {\n this.willAttach.group = group;\n this.attachFiles();\n }\n\n public changeSpoilers(toggle: boolean) {\n this.partition().media.forEach((item) => {\n if(toggle && !item.mediaSpoiler) {\n this.applyMediaSpoiler(item);\n } else if(!toggle && item.mediaSpoiler) {\n this.removeMediaSpoiler(item);\n }\n });\n }\n\n public addFiles(files: File[]) {\n const toPush = files.filter((file) => {\n const found = this.files.find((_file) => {\n return _file.lastModified === file.lastModified && _file.name === file.name && _file.size === file.size;\n });\n\n return !found;\n });\n\n if(toPush.length) {\n this.files.push(...toPush);\n this.attachFiles();\n }\n }\n\n private onKeyDown = (e: KeyboardEvent) => {\n const target = e.target as HTMLElement;\n const {input} = this.messageInputField;\n if(target !== input) {\n if(target.tagName === 'INPUT' || target.isContentEditable) {\n return;\n }\n\n input.focus();\n placeCaretAtEnd(input);\n }\n };\n\n private async send(force = false) {\n let caption = this.messageInputField.value;\n if(caption.length > this.captionLengthMax) {\n toast(I18n.format('Error.PreviewSender.CaptionTooLong', true));\n return;\n }\n\n const {peerId, input} = this.chat;\n\n const canSend = await PopupNewMedia.canSend(peerId);\n const willAttach = this.willAttach;\n willAttach.isMedia = willAttach.type === 'media' || undefined;\n const {sendFileDetails, isMedia} = willAttach;\n\n let foundBad = false;\n this.iterate((sendFileParams) => {\n if(foundBad) {\n return;\n }\n\n const isBad: (LangPackKey | boolean)[] = sendFileParams.map((params) => {\n const a: [Set | (() => boolean), LangPackKey, ChatRights][] = [\n [AUDIO_MIME_TYPES_SUPPORTED, 'GlobalAttachAudioRestricted', 'send_audios'],\n [() => !MEDIA_MIME_TYPES_SUPPORTED.has(params.file.type), 'GlobalAttachDocumentsRestricted', 'send_docs']\n ];\n\n if(isMedia) {\n a.unshift(\n [IMAGE_MIME_TYPES_SUPPORTED, 'GlobalAttachPhotoRestricted', 'send_photos'],\n [() => VIDEO_MIME_TYPES_SUPPORTED.has(params.file.type as any) && params.noSound, 'GlobalAttachGifRestricted', 'send_gifs'],\n [VIDEO_MIME_TYPES_SUPPORTED, 'GlobalAttachVideoRestricted', 'send_videos']\n );\n }\n\n const found = a.find(([verify]) => {\n return typeof(verify) === 'function' ? verify() : verify.has(params.file.type);\n });\n\n if(found) {\n return canSend[found[2]] ? undefined : found[1];\n }\n\n return (!isMedia && !canSend.send_docs && 'GlobalAttachDocumentsRestricted') || undefined;\n });\n\n const key = isBad.find((i) => typeof(i) === 'string') as LangPackKey;\n if(key) {\n toastNew({\n langPackKey: key\n });\n\n if(liteMode.isAvailable('animations')) {\n shake(this.body);\n }\n }\n\n foundBad ||= !!key;\n });\n\n if(foundBad) {\n return;\n }\n\n if(this.chat.type === 'scheduled' && !force) {\n this.chat.input.scheduleSending(() => {\n this.send(true);\n });\n\n return;\n }\n\n const {length} = sendFileDetails;\n const sendingParams = this.chat.getMessageSendingParams();\n this.iterate((sendFileParams) => {\n if(caption && sendFileParams.length !== length) {\n this.managers.appMessagesManager.sendText(peerId, caption, {\n ...sendingParams,\n clearDraft: true\n });\n\n caption = undefined;\n }\n\n const d: SendFileDetails[] = sendFileParams.map((params) => {\n return {\n ...params,\n file: params.scaledBlob || params.file,\n spoiler: !!params.mediaSpoiler\n };\n });\n\n const w = {\n ...willAttach,\n sendFileDetails: d\n };\n\n this.managers.appMessagesManager.sendAlbum(peerId, Object.assign({\n ...sendingParams,\n caption,\n isMedia,\n clearDraft: true\n }, w));\n\n caption = undefined;\n });\n\n input.replyToMsgId = this.chat.threadId;\n input.onMessageSent();\n this.wasInputValue = undefined;\n\n this.hide();\n }\n\n private modifyMimeTypeForTelegram(mimeType: string) {\n return mimeType === 'image/webp' ? 'image/jpeg' : mimeType;\n }\n\n private async scaleImageForTelegram(image: HTMLImageElement, mimeType: string, convertWebp?: boolean) {\n const PHOTO_SIDE_LIMIT = 2560;\n let url = image.src, scaledBlob: Blob;\n if(\n mimeType !== 'image/gif' &&\n (Math.max(image.naturalWidth, image.naturalHeight) > PHOTO_SIDE_LIMIT || (convertWebp && mimeType === 'image/webp'))\n ) {\n const {blob} = await scaleMediaElement({\n media: image,\n boxSize: makeMediaSize(PHOTO_SIDE_LIMIT, PHOTO_SIDE_LIMIT),\n mediaSize: makeMediaSize(image.naturalWidth, image.naturalHeight),\n mimeType: this.modifyMimeTypeForTelegram(mimeType) as any\n });\n\n scaledBlob = blob;\n URL.revokeObjectURL(url);\n url = await apiManagerProxy.invoke('createObjectURL', blob);\n await renderImageFromUrlPromise(image, url);\n }\n\n return scaledBlob && {url, blob: scaledBlob};\n }\n\n private async attachMedia(params: SendFileParams) {\n const {itemDiv} = params;\n itemDiv.classList.add('popup-item-media');\n\n const file = params.file;\n const isVideo = file.type.startsWith('video/');\n\n if(isVideo) {\n const video = createVideo();\n video.src = params.objectURL = await apiManagerProxy.invoke('createObjectURL', file);\n video.autoplay = true;\n video.controls = false;\n video.muted = true;\n\n video.addEventListener('timeupdate', () => {\n video.pause();\n }, {once: true});\n\n itemDiv.append(video);\n\n let error: Error;\n try {\n await onMediaLoad(video);\n } catch(err) {\n error = err as any;\n }\n\n params.width = video.videoWidth;\n params.height = video.videoHeight;\n params.duration = Math.floor(video.duration);\n\n if(error) {\n throw error;\n }\n\n const audioDecodedByteCount = (video as any).webkitAudioDecodedByteCount;\n if(audioDecodedByteCount !== undefined) {\n params.noSound = !audioDecodedByteCount;\n }\n\n const thumb = await createPosterFromVideo(video);\n params.thumb = {\n url: await apiManagerProxy.invoke('createObjectURL', thumb.blob),\n ...thumb\n };\n } else {\n const img = new Image();\n itemDiv.append(img);\n const url = params.objectURL = await apiManagerProxy.invoke('createObjectURL', file);\n\n await renderImageFromUrlPromise(img, url);\n const mimeType = params.file.type;\n const scaled = await this.scaleImageForTelegram(img, mimeType, true);\n if(scaled) {\n params.objectURL = scaled.url;\n params.scaledBlob = scaled.blob;\n }\n\n params.width = img.naturalWidth;\n params.height = img.naturalHeight;\n\n if(file.type === 'image/gif') {\n params.noSound = true;\n\n return Promise.all([\n getGifDuration(img).then((duration) => {\n params.duration = Math.ceil(duration);\n }),\n\n createPosterFromMedia(img).then(async(thumb) => {\n params.thumb = {\n url: await apiManagerProxy.invoke('createObjectURL', thumb.blob),\n ...thumb\n };\n })\n ]).then(() => {});\n }\n }\n }\n\n private async attachDocument(params: SendFileParams): ReturnType {\n const {itemDiv} = params;\n itemDiv.classList.add('popup-item-document');\n const file = params.file;\n\n const isPhoto = file.type.startsWith('image/');\n const isAudio = AUDIO_MIME_TYPES_SUPPORTED.has(file.type as any);\n if(isPhoto || isAudio || file.size < 20e6) {\n params.objectURL ||= await apiManagerProxy.invoke('createObjectURL', file);\n }\n\n const attributes: DocumentAttribute[] = [];\n\n let img: HTMLImageElement;\n if(isPhoto && params.objectURL) {\n img = new Image();\n await renderImageFromUrlPromise(img, params.objectURL);\n const scaled = await this.scaleImageForTelegram(img, params.file.type);\n if(scaled) {\n params.objectURL = scaled.url;\n }\n }\n\n if(isAudio && params.objectURL) {\n try {\n // * get audio duration\n const audio = new Audio();\n audio.src = params.objectURL;\n audio.muted = true;\n audio.autoplay = true;\n await onMediaLoad(audio);\n params.duration = audio.duration;\n attributes.push({\n _: 'documentAttributeAudio',\n duration: params.duration,\n pFlags: {}\n });\n } catch(err) {\n console.error('audio loading error', err);\n }\n }\n\n const doc: MyDocument = {\n _: 'document',\n file,\n file_name: file.name || '',\n size: file.size,\n type: isAudio ? 'audio' : (isPhoto ? 'photo' : undefined),\n access_hash: 0,\n attributes,\n date: 0,\n dc_id: 0,\n file_reference: [],\n id: 0,\n pFlags: {},\n duration: params.duration\n };\n\n let cacheContext: ThumbCache;\n if(params.objectURL) {\n cacheContext = {\n url: params.objectURL,\n downloaded: file.size,\n type: THUMB_TYPE_FULL\n };\n }\n\n const docDiv = await wrapDocument({\n message: {\n _: 'message',\n pFlags: {\n is_outgoing: true\n },\n mid: 0,\n peerId: 0,\n media: {\n _: 'messageMediaDocument',\n document: doc\n }\n } as any,\n cacheContext\n });\n\n if(isPhoto) {\n params.width = img.naturalWidth;\n params.height = img.naturalHeight;\n }\n\n itemDiv.append(docDiv);\n }\n\n private attachFile = (file: File) => {\n const willAttach = this.willAttach;\n const shouldCompress = this.shouldCompress(file.type);\n\n const itemDiv = document.createElement('div');\n itemDiv.classList.add('popup-item');\n\n const params: SendFileParams = {\n file\n } as any;\n\n // do not pass these properties to worker\n defineNotNumerableProperties(params, ['scaledBlob', 'middlewareHelper', 'itemDiv', 'mediaSpoiler']);\n\n params.middlewareHelper = this.middlewareHelper.get().create();\n params.itemDiv = itemDiv;\n\n const promise = shouldCompress ? this.attachMedia(params) : this.attachDocument(params);\n willAttach.sendFileDetails.push(params);\n return promise.catch((err) => {\n itemDiv.style.backgroundColor = '#000';\n console.error('error rendering file', err);\n });\n };\n\n private shouldCompress(mimeType: string) {\n return this.willAttach.type === 'media' && MEDIA_MIME_TYPES_SUPPORTED.has(mimeType);\n }\n\n private onRender() {\n // show now\n if(!this.element.classList.contains('active')) {\n this.listenerSetter.add(document.body)('keydown', this.onKeyDown);\n !this.ignoreInputValue && this.addEventListener('close', () => {\n if(this.wasInputValue) {\n this.chat.input.messageInputField.value = this.wasInputValue;\n }\n });\n this.show();\n }\n }\n\n private setTitle() {\n const {willAttach, title, files} = this;\n let key: LangPackKey;\n const args: FormatterArguments = [];\n if(willAttach.type === 'document') {\n key = 'PreviewSender.SendFile';\n args.push(files.length);\n } else {\n let foundPhotos = 0, foundVideos = 0, foundFiles = 0;\n files.forEach((file) => {\n if(file.type.startsWith('image/')) ++foundPhotos;\n else if(file.type.startsWith('video/')) ++foundVideos;\n else ++foundFiles;\n });\n\n if([foundPhotos, foundVideos, foundFiles].filter((n) => n > 0).length > 1) {\n key = 'PreviewSender.SendFile';\n args.push(files.length);\n } else\n\n /* const sum = foundPhotos + foundVideos;\n if(sum > 1 && willAttach.group) {\n key = 'PreviewSender.SendAlbum';\n const albumsLength = Math.ceil(sum / 10);\n args.push(albumsLength);\n } else */if(foundPhotos) {\n key = 'PreviewSender.SendPhoto';\n args.push(foundPhotos);\n } else if(foundVideos) {\n key = 'PreviewSender.SendVideo';\n args.push(foundVideos);\n }\n }\n\n replaceContent(title, i18n(key, args));\n }\n\n private appendMediaToContainer(params: SendFileParams) {\n if(this.shouldCompress(params.file.type)) {\n const size = calcImageInBox(params.width, params.height, MAX_WIDTH, 320);\n params.itemDiv.style.width = size.width + 'px';\n params.itemDiv.style.height = size.height + 'px';\n }\n\n this.mediaContainer.append(params.itemDiv);\n }\n\n private iterate(cb: (sendFileDetails: SendFileParams[]) => void) {\n const {sendFileDetails} = this.willAttach;\n if(!this.willAttach.group) {\n sendFileDetails.forEach((p) => cb([p]));\n return;\n }\n\n const length = sendFileDetails.length;\n for(let i = 0; i < length;) {\n const firstType = sendFileDetails[i].file.type;\n let k = 0;\n for(; k < 10 && i < length; ++i, ++k) {\n const type = sendFileDetails[i].file.type;\n if(this.shouldCompress(firstType) !== this.shouldCompress(type)) {\n break;\n }\n }\n\n cb(sendFileDetails.slice(i - k, i));\n }\n }\n\n private attachFiles() {\n const {files, willAttach, mediaContainer} = this;\n\n const oldSendFileDetails = willAttach.sendFileDetails.splice(0, willAttach.sendFileDetails.length);\n oldSendFileDetails.forEach((params) => {\n params.middlewareHelper.destroy();\n });\n\n const promises = files.map((file) => this.attachFile(file));\n\n Promise.all(promises).then(() => {\n mediaContainer.replaceChildren();\n\n if(!files.length) {\n return;\n }\n\n this.setTitle();\n\n this.iterate((sendFileDetails) => {\n const shouldCompress = this.shouldCompress(sendFileDetails[0].file.type);\n if(shouldCompress && sendFileDetails.length > 1) {\n const albumContainer = document.createElement('div');\n albumContainer.classList.add('popup-item-album', 'popup-item');\n albumContainer.append(...sendFileDetails.map((s) => s.itemDiv));\n\n prepareAlbum({\n container: albumContainer,\n items: sendFileDetails.map((o) => ({w: o.width, h: o.height})),\n maxWidth: MAX_WIDTH,\n minWidth: 100,\n spacing: 4\n });\n\n mediaContainer.append(albumContainer);\n } else {\n sendFileDetails.forEach((params) => {\n this.appendMediaToContainer(params);\n });\n }\n\n if(!shouldCompress) {\n return;\n }\n\n sendFileDetails.forEach((params) => {\n const oldParams = oldSendFileDetails.find((o) => o.file === params.file);\n if(!oldParams) {\n return;\n }\n\n if(oldParams.mediaSpoiler) {\n this.applyMediaSpoiler(params, true);\n }\n });\n });\n }).then(() => {\n this.onRender();\n this.onScroll();\n });\n }\n}\n\n(window as any).PopupNewMedia = PopupNewMedia;\n","function cacheCallback(callback: (str: A) => T) {\n const stringResults: any = {}, numberResults: any = {};\n return (value: A): T => {\n const key = '_' + value;\n return (typeof(value) === 'string' ? stringResults : numberResults)[key] ??= callback(value);\n };\n}\n\nexport default cacheCallback;\n","export default function replaceNonNumber(str: string) {\n return str.replace(/\\D/g, '');\n}\n","import cacheCallback from '../cacheCallback';\nimport replaceNonNumber from '../string/replaceNonNumber';\n\nconst CARD_BRAND_REGEXP: {[brand: string]: RegExp} = {\n visa: /^4/,\n mastercard: /^(51|52|53|54|55|222|23|24|25|26|27)/,\n amex: /^(34|37)/,\n discover: /^(60|64|65)/,\n diners: /^(30|38|39)/,\n diners14: /^(36)/,\n jcb: /^(35)/,\n unionpay: /^(62[0-6,8-9]|627[0-6,8-9]|6277[0-7,9]|62778[1-9]|81)/,\n elo: /^(5067|509|636368|627780)/,\n mir: /^(220[0-4])/\n};\n\n// * taken from Stripe\nexport const CARD_BRANDS: {[b: string]: {\n minLength: number,\n maxLength: number,\n cvcMaxLength: number,\n cvcMinLength: number | null\n}} = {\n visa: {\n minLength: 16,\n maxLength: 16,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n mastercard: {\n minLength: 16,\n maxLength: 16,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n amex: {\n minLength: 15,\n maxLength: 15,\n cvcMaxLength: 4,\n cvcMinLength: 3\n },\n unionpay: {\n minLength: 13,\n maxLength: 19,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n diners: {\n minLength: 16,\n maxLength: 16,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n diners14: {\n minLength: 14,\n maxLength: 14,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n discover: {\n minLength: 16,\n maxLength: 16,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n jcb: {\n minLength: 16,\n maxLength: 16,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n elo: {\n minLength: 16,\n maxLength: 16,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n mir: {\n minLength: 16,\n maxLength: 16,\n cvcMaxLength: 3,\n cvcMinLength: null\n },\n unknown: {\n minLength: 16,\n maxLength: 16,\n cvcMaxLength: 4,\n cvcMinLength: 3\n }\n};\n\nexport const detectCardBrand = cacheCallback((card: string = '') => {\n const keys = Object.keys(CARD_BRAND_REGEXP);\n const sanitizedCard = replaceNonNumber(card);\n let brand: string;\n let last = 0;\n keys.forEach((key) => {\n const regExp = CARD_BRAND_REGEXP[key];\n const match = sanitizedCard.match(regExp);\n if(match) {\n const result = match[0];\n if(result && result.length > last) {\n brand = key;\n last = result.length;\n }\n }\n });\n\n return brand || 'unknown';\n});\n\nexport function cardBrandToUnifiedBrand(brand: string) {\n return brand === 'diners14' ? 'diners' : brand;\n}\n\nexport function detectUnifiedCardBrand(card = '') {\n const brand = detectCardBrand(card);\n return cardBrandToUnifiedBrand(brand);\n}\n","export default function createArray(length: number, fill?: T1, map?: any): T1[] {\n const arr = new Array(length);\n arr.fill(fill);\n return map ? arr.map(map) : arr;\n}\n","const delta = '0'.charCodeAt(0) - '0'.charCodeAt(0);\nconst buggedRegExp = /[0-9]/g;\n\n// function hasBuggedNumbers(str: string) {\n// return !!str.match(a);\n// }\n\nfunction getDistanceFromBuggedToNormal(char: string) {\n return String.fromCharCode(char.charCodeAt(0) - delta);\n}\n\nexport function fixBuggedNumbers(str: string) {\n return str.replace(buggedRegExp, getDistanceFromBuggedToNormal);\n}\n","import {fixBuggedNumbers} from '../string/buggedNumbers';\nimport replaceNonNumber from '../string/replaceNonNumber';\n\nexport type PatternCharacter = {\n type: 'optional',\n result: string,\n consumed: number\n} | {\n type: 'required',\n result: string,\n consumed: number,\n partial?: boolean\n} | {\n type: 'formatting',\n result: string,\n consumed: number\n};\n\nexport type PatternFunction = (str: string) => ((str: string) => PatternCharacter)[];\n\nfunction makeOptionalCharacter(result: string, consumed: number): PatternCharacter {\n return {type: 'optional', result, consumed};\n}\n\nfunction makeRequiredCharacter(result: string, consumed: number, partial?: boolean): PatternCharacter {\n return {type: 'required', result, consumed, partial};\n}\n\nfunction makeFormattingCharacter(result: string, consumed: number): PatternCharacter {\n return {type: 'formatting', result, consumed};\n}\n\nfunction wrapCharacterRegExpFactory(regExp: RegExp, optional?: boolean) {\n return (str: string) => {\n const _regExp = new RegExp('^'.concat(regExp.source.replace(/^\\^/, '')));\n const match = str.match(_regExp);\n const makeCharacter = optional ? makeOptionalCharacter : makeRequiredCharacter;\n if(match) {\n const result = match[0];\n return makeCharacter(result, match.index + result.length);\n }\n\n return makeCharacter('', str.length);\n };\n}\n\nfunction makeCapitalPatternCharacter(str: string) {\n const char = wrapCharacterRegExpFactory(/\\w/)(str);\n return char.result ? makeRequiredCharacter(char.result.toUpperCase(), char.consumed) : char;\n}\n\nconst makeMonthDigitPatternCharacter = wrapCharacterRegExpFactory(/1[0-2]|0?[1-9]|0/);\n\nfunction digit(str: string) {\n return wrapCharacterRegExpFactory(/[0-9]/)(fixBuggedNumbers(str));\n}\n\nconst patternCharacters = {\n digit,\n capitalCharacter: makeCapitalPatternCharacter,\n month: (str: string) => {\n const char = makeMonthDigitPatternCharacter(fixBuggedNumbers(str));\n const cleanedResult = replaceNonNumber(char.result);\n const isPartial = ['0', '1'].includes(char.result) && str.length === 1;\n if(isPartial || (char.result === '0' && str.length >= 2)) {\n return makeRequiredCharacter(char.result, str.length, true);\n }\n\n return makeRequiredCharacter(cleanedResult.length === 1 ? '0' + cleanedResult : cleanedResult, char.consumed);\n },\n formattingCharacter: (str: string) => {\n return (str1: string) => {\n const consumed = str === str1[0] ? 1 : 0;\n return makeFormattingCharacter(str, consumed);\n }\n },\n optionalPattern: (regExp: RegExp) => {\n return (str: string) => {\n const char = wrapCharacterRegExpFactory(regExp, true)(str);\n return char.result ? char : makeOptionalCharacter('', 0);\n };\n }\n};\n\nexport default patternCharacters;\n","import {IS_ANDROID} from '../../environment/userAgent';\nimport createArray from '../array/createArray';\nimport cacheCallback from '../cacheCallback';\nimport replaceNonNumber from '../string/replaceNonNumber';\nimport {CARD_BRANDS, detectCardBrand} from './cardBrands';\nimport patternCharacters from './patternCharacters';\n\nconst digit = patternCharacters.digit;\nconst capitalCharacter = patternCharacters.capitalCharacter;\nconst spaceCharacter = patternCharacters.formattingCharacter(' ');\nconst yearOptionalPattern = patternCharacters.optionalPattern(/\\d\\d/);\nconst sixteenPattern = [digit, digit, digit, digit, spaceCharacter, digit, digit, digit, digit, digit, digit, spaceCharacter, digit, digit, digit, digit, digit];\nconst fifteenPattern = [digit, digit, digit, digit, spaceCharacter, digit, digit, digit, digit, digit, digit, spaceCharacter, digit, digit, digit, digit];\n\nconst requiredPostcodes = new Set(['DZ', 'AR', 'AM', 'AU', 'AT', 'AZ', 'PT', 'BD', 'BY', 'BE', 'BA', 'BR', 'BN', 'BG', 'CA', 'IC', 'CN', 'CO', 'HR', 'CY', 'CZ', 'DK', 'EC', 'GB', 'EE', 'FO', 'FI', 'FR', 'GE', 'DE', 'GR', 'GL', 'GU', 'GG', 'NL', 'HU', 'IN', 'ID', 'IL', 'IT', 'JP', 'JE', 'KZ', 'KR', 'FM', 'KG', 'LV', 'LI', 'LT', 'LU', 'MK', 'MG', 'PT', 'MY', 'MH', 'MQ', 'YT', 'MX', 'MN', 'ME', 'NL', 'NZ', 'GB', 'NO', 'PK', 'PH', 'PL', 'FM', 'PT', 'PR', 'RE', 'RU', 'SA', 'SF', 'RS', 'SG', 'SK', 'SI', 'ZA', 'ES', 'LK', 'SX', 'VI', 'VI', 'SE', 'CH', 'TW', 'TJ', 'TH', 'TU', 'TN', 'TR', 'TM', 'VI', 'UA', 'GB', 'US', 'UY', 'UZ', 'VA', 'VN', 'GB', 'FM']);\n\nconst generateFourPattern = cacheCallback((length: number) => {\n const out: Array = [];\n\n for(let i = 0, k = 0; i < length;) {\n if(k === 4) {\n out.push(spaceCharacter);\n k = 0;\n } else {\n out.push(digit);\n ++i;\n ++k;\n }\n }\n\n return out;\n});\n\nfunction generateCardNumberPattern(card: string) {\n const brand = detectCardBrand(card);\n if(brand === 'amex') return sixteenPattern;\n if(brand === 'diners14') return fifteenPattern;\n const {minLength, maxLength} = CARD_BRANDS[brand];\n const s = replaceNonNumber(card).length;\n const d = Math.min(Math.max(minLength, s), maxLength);\n return generateFourPattern(d);\n}\n\nconst cardFormattingPatterns = {\n cardNumber: generateCardNumberPattern,\n cardExpiry: () => [patternCharacters.month, patternCharacters.formattingCharacter('/'), digit, digit, yearOptionalPattern],\n cardCvc: (card?: string) => cardFormattingPatterns.cardCvcFromBrand(detectCardBrand(card)),\n cardCvcFromBrand: cacheCallback((brand: string) => {\n const info = CARD_BRANDS[brand];\n const {cvcMinLength, cvcMaxLength} = info;\n const pattern = createArray(cvcMinLength || cvcMaxLength, digit);\n if(cvcMinLength && cvcMinLength < cvcMaxLength) {\n const i = cvcMaxLength - cvcMinLength;\n const h = patternCharacters.optionalPattern(/\\d/);\n if(i) {\n pattern.push(...createArray(i, h));\n }\n }\n\n return pattern;\n }),\n postalCodeFromCountry: cacheCallback((iso2: string) => {\n switch(iso2) {\n case 'US':\n return createArray(5, digit);\n case 'CA':\n return IS_ANDROID ? null : [capitalCharacter, capitalCharacter, capitalCharacter, spaceCharacter, capitalCharacter, capitalCharacter, capitalCharacter];\n default:\n const optionalDigits = createArray(10, patternCharacters.optionalPattern(/\\d/));\n if(requiredPostcodes.has(iso2)) {\n optionalDigits[0] = digit;\n }\n return optionalDigits;\n }\n })\n};\n\nexport default cardFormattingPatterns;\n","import accumulate from '../array/accumulate';\nimport {PatternFunction} from './patternCharacters';\n\nfunction accumulateLengths(strs: string[]) {\n return accumulate(strs.map((str) => str.length), 0);\n}\n\nfunction formatValueByPattern(\n getPattern: PatternFunction,\n value: string,\n options: Partial<{\n selectionStart: number,\n selectionEnd: number\n }> = {},\n pushRest?: boolean\n) {\n const pattern = getPattern(value);\n\n if(!pattern) {\n return {\n value: value,\n selection: null as typeof options,\n autocorrectComplete: !!value\n };\n }\n\n const length = pattern.length;\n const c: string[] = [];\n const s: string[] = [];\n\n let l = 0;\n let i = 0;\n let f = options.selectionStart === 0 ? 0 : null;\n let d = options.selectionEnd === 0 ? 0 : null;\n const p = () => {\n if(f === null && (i + 1) >= options.selectionStart) f = accumulateLengths(c) + (pushRest ? s.length : 0);\n if(d === null && (i + 1) >= options.selectionEnd) d = accumulateLengths(c) + (pushRest ? s.length : 0);\n };\n const m = (e: number) => {\n if(e > 0) {\n p();\n i += e;\n }\n };\n\n for(; l < length;) {\n const getCharacter = pattern[l];\n const character = getCharacter(value.slice(i));\n const {type, result, consumed} = character;\n if(type === 'required') {\n if(result) {\n c.push(...s, result);\n s.length = 0;\n ++l;\n\n if(character.partial) {\n m(value.length - i);\n break;\n }\n\n m(consumed);\n } else {\n if(!consumed) {\n break;\n }\n\n m(1);\n }\n } else if(type === 'optional') {\n if(result) {\n c.push(...s, result);\n s.length = 0;\n m(consumed);\n }\n\n ++l;\n } else if(type === 'formatting') {\n if(!pushRest && i >= value.length) {\n break;\n }\n\n s.push(result);\n ++l;\n m(consumed);\n }\n }\n\n if(pushRest) {\n c.push(...s);\n }\n\n return {\n value: c.join(''),\n selection: {\n selectionStart: f === null || value.length && options.selectionStart === value.length ? accumulateLengths(c) : f,\n selectionEnd: d === null || value.length && options.selectionEnd === value.length ? accumulateLengths(c) : d\n },\n autocorrectComplete: l === length\n };\n}\n\nexport default formatValueByPattern;\n","import {CARD_BRANDS, detectCardBrand} from './cardBrands';\nimport formatInputValueByPattern from './formatInputValueByPattern';\nimport NBSP from '../string/nbsp';\nimport replaceNonNumber from '../string/replaceNonNumber';\n\nexport type PatternValidationOptions = Partial<{\n ignoreIncomplete: boolean\n}>;\n\nconst nbspRegExp = new RegExp(NBSP, 'g');\n\nfunction makeValidationError(code?: string) {\n return code ? {\n type: 'invalid',\n code\n } : null;\n}\n\n// Luhn algorithm\nfunction validateCompleteCardNumber(card: string) {\n const t = '0'.charCodeAt(0);\n const n = card.length % 2;\n let a = 0;\n for(let i = card.length - 1; i >= 0; --i) {\n const c = n === (i % 2);\n let o = card.charCodeAt(i) - t;\n if(c) o *= 2;\n if(o > 9) o -= 9;\n a += o;\n }\n return !(a % 10);\n}\n\nfunction validateExpiry(year: number, month: number, options?: PatternValidationOptions) {\n const date = new Date(Date.now());\n const _year = year < 100 ? date.getFullYear() % 100 : date.getFullYear();\n const nextMonth = date.getMonth() + 1;\n\n if(isNaN(year) || isNaN(month)) {\n return options?.ignoreIncomplete ? null : 'incomplete';\n }\n\n if((year - _year) < 0) {\n return 'invalid_expiry_year_past';\n }\n\n if((year - _year) > 50) {\n return 'invalid_expiry_year';\n }\n\n return !(year - _year) && month < nextMonth ? 'invalid_expiry_month_past' : null;\n}\n\nfunction getCardInfoByNumber(card: string) {\n const sanitized = replaceNonNumber(card);\n const brand = detectCardBrand(card);\n return {\n sanitized,\n brand,\n minLength: CARD_BRANDS[brand].minLength\n };\n}\n\nfunction makeCardNumberError(str: string, length: number, ignoreIncomplete: boolean) {\n if(str.length >= length) {\n return validateCompleteCardNumber(str) || detectCardBrand(str) === 'mir' ? null : makeValidationError('invalid');\n }\n\n return ignoreIncomplete ? null : makeValidationError('incomplete');\n}\n\nexport function validateCardNumber(str: string, options: PatternValidationOptions = {}) {\n const {sanitized, minLength} = getCardInfoByNumber(str);\n return makeCardNumberError(sanitized, minLength, options.ignoreIncomplete);\n}\n\nexport function validateCardExpiry(str: string, options: PatternValidationOptions = {}) {\n const sanitized = str.replace(nbspRegExp, '').split(/ ?\\/ ?/);\n const [monthStr, yearStr = ''] = sanitized;\n const [month, year] = [monthStr, yearStr].map((str) => +str);\n const s = yearStr.length === 2 ? year % 100 : year;\n return yearStr.length < 2 || yearStr.length === 3 ? (options.ignoreIncomplete ? null : makeValidationError('incomplete')) : makeValidationError(validateExpiry(s, month, options));\n}\n\nexport function validateAnyIncomplete(formatted: ReturnType, str: string, options: PatternValidationOptions = {}) {\n return formatted.meta.autocorrectComplete || options.ignoreIncomplete ? null : makeValidationError('incomplete');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport TelegramWebView from '../telegramWebView';\n\nexport function createVerificationIframe(options: ConstructorParameters[0]) {\n const result = new TelegramWebView({\n ...options,\n sandbox: 'allow-forms allow-scripts allow-same-origin allow-modals'\n });\n const {iframe} = result;\n iframe.allow = 'payment';\n iframe.classList.add('payment-verification');\n return result;\n}\n\nexport default class PopupPaymentVerification extends PopupElement<{\n finish: () => void\n}> {\n private telegramWebView: TelegramWebView;\n\n constructor(private url: string, private openPathAfter?: boolean) {\n super('popup-payment popup-payment-verification', {\n closable: true,\n overlayClosable: true,\n body: true,\n title: 'Checkout.WebConfirmation.Title'\n });\n\n this.d();\n }\n\n private d() {\n const telegramWebView = this.telegramWebView = createVerificationIframe({\n url: this.url\n });\n\n telegramWebView.addEventListener('web_app_open_tg_link', (e) => {\n this.dispatchEvent('finish');\n this.hide();\n if(this.openPathAfter) {\n appImManager.openUrl('https://t.me' + e.path_full);\n }\n });\n\n this.body.append(telegramWebView.iframe);\n this.show();\n telegramWebView.onMount();\n }\n\n protected destroy() {\n this.telegramWebView.destroy();\n return super.destroy();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport cardFormattingPatterns from '../../helpers/cards/cardFormattingPatterns';\nimport {detectUnifiedCardBrand} from '../../helpers/cards/cardBrands';\nimport formatInputValueByPattern from '../../helpers/cards/formatInputValueByPattern';\nimport {validateAnyIncomplete, validateCardExpiry, validateCardNumber} from '../../helpers/cards/validateCard';\nimport placeCaretAtEnd from '../../helpers/dom/placeCaretAtEnd';\nimport {renderImageFromUrlPromise} from '../../helpers/dom/renderImageFromUrl';\nimport noop from '../../helpers/noop';\nimport {PaymentsPaymentForm} from '../../layer';\nimport {LangPackKey, _i18n} from '../../lib/langPack';\nimport CheckboxField from '../checkboxField';\nimport confirmationPopup from '../confirmationPopup';\nimport CountryInputField from '../countryInputField';\nimport InputField, {InputFieldOptions, InputState} from '../inputField';\nimport Row from '../row';\nimport {getPaymentBrandIconPath, PaymentButton, PaymentsCredentialsToken} from './payment';\nimport {createVerificationIframe} from './paymentVerification';\nimport {PasswordInputHelpers} from '../passwordInputField';\nimport SettingSection from '../settingSection';\nimport TelegramWebView from '../telegramWebView';\n\nexport type PaymentCardDetails = {\n cardNumber: string;\n cardholderName: string;\n expiryFull: string;\n expiryMonth: string;\n expiryYear: string;\n cvc: string;\n country: string;\n zip: string;\n save?: boolean;\n};\n\nexport type PaymentCardDetailsShort = {\n title: string,\n save?: boolean;\n icon?: string;\n};\n\nexport type PaymentCardDetailsResult = PaymentCardDetails | PaymentCardDetailsShort;\n\nexport class InputFieldCorrected extends InputField {\n private lastKeyDown: string;\n private lastTransformed: ReturnType;\n\n constructor(public options: InputFieldOptions & {\n formatMethod: typeof cardFormattingPatterns['cardNumber'],\n validateMethod?: typeof validateCardNumber,\n errorKeys?: {[code: string]: LangPackKey},\n optional?: boolean,\n onChange?: (transformed: InputFieldCorrected['lastTransformed']) => void,\n onKeyDown?: (e: KeyboardEvent) => void\n }) {\n super(options);\n\n // const handleIncomplete = (t?: any) => {\n // if(\n // (!lastTransformed.value && t) ||\n // lastTransformed.meta.autocorrectComplete ||\n // lastTransformed.meta.error ||\n // optional\n // ) {\n // return;\n // }\n\n\n // };\n\n this.input.addEventListener('keydown', this.onKeyDown);\n this.input.addEventListener('input', this.onInput);\n this.input.addEventListener('blur', this.onBlur);\n }\n\n private onKeyDown = (e: KeyboardEvent) => {\n this.lastKeyDown = e.key;\n this.options.onKeyDown?.(e);\n };\n\n private onInput = () => {\n const value = this.value;\n const deleting = this.lastKeyDown === 'Backspace' && (((this.lastTransformed && this.lastTransformed.value.length) || 0) - value.length) === 1;\n const result = this.lastTransformed = formatInputValueByPattern({\n value: value,\n getPattern: this.options.formatMethod,\n deleting,\n input: this.input\n });\n\n const transformedValue = result.value;\n if(transformedValue !== value) {\n this.setValueSilently(transformedValue);\n\n if(result.selection) {\n (this.input as HTMLInputElement).selectionStart = result.selection.selectionStart;\n (this.input as HTMLInputElement).selectionEnd = result.selection.selectionEnd;\n }\n }\n\n this.validateNew(transformedValue, {ignoreIncomplete: true/* !result.meta.autocorrectComplete */});\n\n this.options.onChange?.(result);\n };\n\n private onBlur = () => {\n const value = this.lastTransformed?.value;\n if(value) {\n this.validateNew(value);\n }\n };\n\n public update() {\n this.onInput();\n }\n\n public validate = () => {\n return this.validateNew();\n };\n\n public validateNew(\n value = this.lastTransformed?.value ?? '',\n t: any = {},\n justReturn?: boolean\n ) {\n let result: ReturnType;\n if(this.options.validateMethod) {\n result = this.options.validateMethod?.(value, t);\n } else {\n result = validateAnyIncomplete(this.lastTransformed, value, t);\n }\n\n if(result?.code) {\n const langPackKey: LangPackKey = this.options.errorKeys?.[result.code];\n !justReturn && this.setState(InputState.Error, langPackKey);\n return false;\n }\n\n !justReturn && this.setState(InputState.Neutral);\n return true;\n }\n}\n\nexport function handleInputFieldsOnChange(inputFields: (CountryInputField | InputField | InputFieldCorrected)[], _onChange: (valid: boolean) => void) {\n const onChange = () => {\n const valid = inputFields.every((inputField) => {\n return 'validateNew' in inputField ? inputField.validateNew(undefined, undefined, true) : inputField.isValid();\n });\n\n _onChange(valid);\n };\n\n inputFields.forEach((inputField) => {\n if(inputField instanceof InputFieldCorrected) {\n const original = inputField.options.onChange;\n inputField.options.onChange = (...args: any[]) => {\n // @ts-ignore\n original?.(...args);\n onChange();\n };\n\n if('update' in inputField) {\n inputField.update();\n }\n } else {\n inputField.input.addEventListener('input', onChange);\n }\n });\n\n return {validate: onChange};\n}\n\nexport function createCountryZipFields(country?: boolean, zip?: boolean) {\n let countryInputField: CountryInputField, postcodeInputField: InputFieldCorrected;\n if(country || zip) {\n if(country) countryInputField = new CountryInputField({\n noPhoneCodes: true,\n onCountryChange: () => {\n postcodeInputField?.update();\n },\n required: true,\n autocomplete: 'country'\n });\n if(zip) postcodeInputField = new InputFieldCorrected({\n label: 'PaymentShippingZipPlaceholder',\n plainText: true,\n inputMode: 'numeric',\n autocomplete: 'postal-code',\n formatMethod: (/* ...args */) => {\n const {country} = countryInputField.getSelected();\n const iso2 = country?.iso2;\n return cardFormattingPatterns.postalCodeFromCountry(iso2 && iso2.toUpperCase());\n }\n });\n }\n\n return {countryInputField, postcodeInputField};\n}\n\nexport type PaymentsNativeProvider = 'stripe' | 'smartglocal';\nexport type PaymentsNativeParams = {\n need_country?: boolean,\n need_zip?: boolean,\n need_cardholder_name?: boolean,\n publishable_key?: string, // stripe\n public_token?: string, // smartglocal\n gpay_params: string,\n};\nconst SUPPORTED_NATIVE_PROVIDERS: Set = new Set(['stripe', 'smartglocal']);\n\nexport default class PopupPaymentCard extends PopupElement<{\n finish: (obj: {token: any, card: PaymentCardDetailsResult}) => void\n}> {\n protected telegramWebView: TelegramWebView;\n\n constructor(private paymentForm: PaymentsPaymentForm, private savedCard?: PaymentCardDetails) {\n super('popup-payment popup-payment-card', {\n closable: true,\n overlayClosable: true,\n body: true,\n scrollable: SUPPORTED_NATIVE_PROVIDERS.has(paymentForm.native_provider as PaymentsNativeProvider),\n title: 'PaymentCardInfo'\n });\n\n if(SUPPORTED_NATIVE_PROVIDERS.has(paymentForm.native_provider as PaymentsNativeProvider)) {\n this.d();\n } else {\n const telegramWebView = this.telegramWebView = createVerificationIframe({\n url: paymentForm.url\n });\n\n telegramWebView.addEventListener('payment_form_submit', (data) => {\n const cardOut = {title: data.title, save: false} as any as PaymentCardDetails;\n this.dispatchEvent('finish', {\n token: data.credentials,\n card: cardOut\n });\n\n this.hide();\n\n if(paymentForm.pFlags.can_save_credentials) {\n confirmationPopup({\n titleLangKey: 'PaymentCardSavePaymentInformation',\n descriptionLangKey: 'PaymentCardSavePaymentInformationInfoLine1',\n button: {\n langKey: 'Save'\n }\n }).then(() => {\n cardOut.save = true;\n }, noop);\n }\n });\n\n // putPreloader(this.body, true);\n this.body.append(telegramWebView.iframe);\n this.show();\n telegramWebView.onMount();\n }\n }\n\n protected destroy() {\n this.telegramWebView?.destroy();\n return super.destroy();\n }\n\n private d() {\n const savedCard = this.savedCard;\n const cardSection = new SettingSection({name: 'PaymentInfo.Card.Title', noDelimiter: true, noShadow: true});\n\n const nativeParams: PaymentsNativeParams = JSON.parse(this.paymentForm.native_params.data);\n\n let lastBrand: string, brandIconTempId = 0, lastBrandImg: HTMLImageElement;\n const setBrandIcon = (brand: string) => {\n if(lastBrand === brand) {\n return;\n }\n\n const tempId = ++brandIconTempId;\n lastBrand = brand;\n\n const path = getPaymentBrandIconPath(brand);\n if(!path) {\n if(lastBrandImg) {\n lastBrandImg.remove();\n lastBrandImg = undefined;\n }\n\n return;\n }\n\n const img = new Image();\n img.classList.add('input-field-icon');\n renderImageFromUrlPromise(img, path, false).then(() => {\n if(brandIconTempId !== tempId) {\n return;\n }\n\n if(lastBrandImg) {\n lastBrandImg.replaceWith(img);\n } else {\n cardInputField.container.append(img);\n }\n\n lastBrandImg = img;\n });\n };\n const cardInputField = new InputFieldCorrected({\n label: 'PaymentCardNumber',\n plainText: true,\n inputMode: 'numeric',\n autocomplete: 'cc-number',\n formatMethod: cardFormattingPatterns.cardNumber,\n validateMethod: validateCardNumber,\n errorKeys: {\n invalid: 'PaymentCard.Error.Invalid',\n incomplete: 'PaymentCard.Error.Incomplete'\n },\n onChange: (transformed) => {\n setBrandIcon(detectUnifiedCardBrand(transformed.value));\n cvcInputField.update(); // format cvc\n }\n });\n\n let nameInputField: InputField;\n if(nativeParams.need_cardholder_name) nameInputField = new InputField({\n label: 'Checkout.NewCard.CardholderNamePlaceholder',\n maxLength: 255,\n required: true,\n autocomplete: 'cc-name'\n });\n\n const expireInputField = new InputFieldCorrected({\n label: 'SecureId.Identity.Placeholder.ExpiryDate',\n plainText: true,\n inputMode: 'numeric',\n autocomplete: 'cc-exp',\n formatMethod: cardFormattingPatterns.cardExpiry,\n validateMethod: validateCardExpiry\n });\n\n // handle autocomplete: 01/2345 -> 01/45\n expireInputField.input.addEventListener('input', () => {\n let value = expireInputField.value;\n if(value.length < 5) {\n return;\n }\n\n const splitted = value.split('/');\n if(splitted[1].length !== 4) {\n return;\n }\n\n value = [splitted[0], splitted[1].slice(2)].join('/');\n expireInputField.setValueSilently(value);\n }, {capture: true});\n\n const cvcInputField = new InputFieldCorrected({\n labelText: 'CVC',\n plainText: true,\n inputMode: 'numeric',\n autocomplete: 'cc-csc',\n name: 'cvc',\n formatMethod: () => cardFormattingPatterns.cardCvc(cardInputField.value)\n // validateMethod: (...args) => _5AH3.a.cardCvc(cardInputField.value)(...args)\n });\n\n const passwordHelpers = new PasswordInputHelpers(cvcInputField.container, cvcInputField.input as HTMLInputElement);\n\n const switchFocusOrder: (InputFieldCorrected | InputField)[] = [\n cardInputField,\n expireInputField,\n cvcInputField,\n nameInputField\n ].filter(Boolean);\n switchFocusOrder.forEach((inputField) => {\n const onKeyDown = (e: KeyboardEvent) => {\n if(!inputField.value && e.key === 'Backspace') {\n const previousInputField = switchFocusOrder[switchFocusOrder.indexOf(inputField) - 1];\n if(previousInputField) {\n // previousInputField.value = previousInputField.value.slice(0, -1);\n placeCaretAtEnd(previousInputField.input, true);\n }\n }\n };\n\n if(inputField instanceof InputFieldCorrected) {\n inputField.options.onKeyDown = onKeyDown;\n\n const original = inputField.options.onChange;\n inputField.options.onChange = (transformed) => {\n original?.(transformed);\n\n if(document.activeElement === inputField.input && transformed.meta.autocorrectComplete) {\n for(let i = switchFocusOrder.indexOf(inputField), length = switchFocusOrder.length; i < length; ++i) {\n const nextInputField = switchFocusOrder[i];\n if(\n nextInputField instanceof InputFieldCorrected ?\n !nextInputField.validateNew(undefined, undefined, true) :\n !nextInputField.value\n ) {\n placeCaretAtEnd(nextInputField.input, true);\n break;\n }\n }\n }\n };\n } else {\n inputField.input.addEventListener('keydown', onKeyDown);\n }\n });\n\n const inputFieldsRow = document.createElement('div');\n inputFieldsRow.classList.add('input-fields-row');\n inputFieldsRow.append(expireInputField.container, cvcInputField.container);\n\n const form = document.createElement('form');\n form.append(...[\n cardInputField.container,\n inputFieldsRow,\n nameInputField?.container\n ].filter(Boolean))\n\n cardSection.content.append(form);\n\n let billingSection: SettingSection;\n // let saveCheckboxField: CheckboxField;\n const {countryInputField, postcodeInputField} = createCountryZipFields(nativeParams.need_country, nativeParams.need_zip);\n if(nativeParams.need_country || nativeParams.need_zip) {\n billingSection = new SettingSection({name: 'PaymentInfo.Billing.Title', noDelimiter: true, noShadow: true});\n\n // const inputFieldsRow2 = inputFieldsRow.cloneNode() as HTMLElement;\n // inputFieldsRow2.append(countryInputField.container, postcodeInputField.container);\n // billingSection.content.append(inputFieldsRow2);\n billingSection.content.append(...[countryInputField, postcodeInputField].filter(Boolean).map((i) => i.container));\n }\n\n const canSave = !!this.paymentForm.pFlags.can_save_credentials;\n const saveCheckboxField = new CheckboxField({\n text: 'PaymentCardSavePaymentInformation',\n checked: !!canSave\n });\n const saveRow = new Row({\n checkboxField: saveCheckboxField,\n subtitleLangKey: canSave ? 'PaymentCardSavePaymentInformationInfoLine1' : 'Checkout.2FA.Text'\n });\n\n if(!canSave) {\n saveRow.container.classList.add('is-disabled');\n }\n\n (billingSection || cardSection).content.append(saveRow.container);\n\n this.scrollable.append(...[cardSection, billingSection].filter(Boolean).map((s) => s.container));\n\n const payButton = PaymentButton({\n key: 'PaymentInfo.Done',\n onClick: async() => {\n const data: PaymentCardDetails = {\n cardNumber: cardInputField.value,\n expiryFull: expireInputField.value,\n expiryMonth: expireInputField.value.split('/')[0],\n expiryYear: expireInputField.value.split('/')[1],\n cvc: cvcInputField.value,\n\n cardholderName: nameInputField?.value,\n country: countryInputField?.value,\n zip: postcodeInputField?.value,\n\n save: saveCheckboxField?.checked\n };\n\n const nativeProvider: PaymentsNativeProvider = this.paymentForm.native_provider as any;\n let out: PaymentsCredentialsToken;\n if(nativeProvider === 'stripe') {\n const url = new URL('https://api.stripe.com/v1/tokens');\n url.search = new URLSearchParams({\n 'card[number]': data.cardNumber,\n 'card[exp_month]': data.expiryMonth,\n 'card[exp_year]': data.expiryYear,\n 'card[cvc]': data.cvc,\n 'card[address_zip]': data.zip,\n 'card[address_country]': data.country,\n 'card[name]': data.cardholderName\n }).toString();\n\n const response = await fetch(url.toString(), {\n method: 'POST',\n credentials: 'same-origin',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Authorization': `Bearer ${nativeParams.publishable_key}`\n }\n });\n\n out = await response.json();\n } else if(nativeProvider === 'smartglocal') {\n const params = {\n card: {\n number: data.cardNumber.replace(/[^\\d]+/g, ''),\n expiration_month: data.expiryMonth,\n expiration_year: data.expiryYear,\n security_code: data.cvc.replace(/[^\\d]+/g, '')\n }\n };\n\n const url = /* DEBUG_PAYMENT_SMART_GLOCAL */false ?\n 'https://tgb-playground.smart-glocal.com/cds/v1/tokenize/card' :\n 'https://tgb.smart-glocal.com/cds/v1/tokenize/card';\n\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'X-PUBLIC-TOKEN': nativeParams.public_token\n },\n body: JSON.stringify(params)\n });\n\n const json: { // smartglocal\n data: {\n info: {\n card_network: string,\n card_type: string,\n masked_card_number: string\n },\n token: string\n },\n status: 'ok'\n } = await response.json();\n\n out = {type: 'card', token: json.data.token}\n }\n\n this.dispatchEvent('finish', {token: out, card: data});\n this.hide();\n }\n });\n\n const inputFields = ([\n cardInputField,\n nameInputField,\n expireInputField,\n cvcInputField,\n countryInputField,\n postcodeInputField\n ] as const).filter(Boolean);\n handleInputFieldsOnChange(inputFields, (valid) => {\n payButton.disabled = !valid;\n // payButton.classList.toggle('btn-disabled', !valid);\n });\n\n if(savedCard) {\n cardInputField.value = savedCard.cardNumber;\n expireInputField.value = savedCard.expiryFull;\n cvcInputField.value = savedCard.cvc;\n nameInputField && (nameInputField.value = savedCard.cardholderName);\n countryInputField && (countryInputField.value = savedCard.country);\n postcodeInputField && (postcodeInputField.value = savedCard.zip);\n }\n\n this.body.append(this.btnConfirmOnEnter = payButton);\n\n this.show();\n\n if(!cardInputField.validateNew(undefined, undefined, true)) {\n placeCaretAtEnd(cardInputField.input);\n }\n }\n}\n","import formatValueByPattern from './formatValueByPattern';\n\nexport default function formatInputValueByPattern(options: {\n value: string,\n getPattern: Parameters[0],\n deleting?: boolean,\n input?: HTMLElement\n}) {\n const {value: originalValue, getPattern, deleting, input} = options;\n const pushRest = !deleting && !!originalValue.length;\n const result = formatValueByPattern(getPattern, originalValue, {\n selectionStart: input ? (input as HTMLInputElement).selectionStart : 0,\n selectionEnd: input ? (input as HTMLInputElement).selectionEnd : 0\n }, pushRest)\n const {value, selection} = result;\n\n return {\n value,\n meta: {\n autocorrectComplete: result.autocorrectComplete,\n empty: !value\n },\n selection\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport placeCaretAtEnd from '../../helpers/dom/placeCaretAtEnd';\nimport {AccountPassword, AccountTmpPassword} from '../../layer';\nimport {InputState} from '../inputField';\nimport PasswordInputField from '../passwordInputField';\nimport SettingSection from '../settingSection';\nimport {PaymentButton} from './payment';\n\nexport default class PopupPaymentCardConfirmation extends PopupElement<{\n finish: (tmpPassword: AccountTmpPassword) => void\n}> {\n constructor(card: string, passwordState: AccountPassword) {\n super('popup-payment popup-payment-card-confirmation', {\n closable: true,\n overlayClosable: true,\n body: true,\n scrollable: true,\n title: 'Checkout.PasswordEntry.Title'\n });\n\n const section = new SettingSection({noDelimiter: true, noShadow: true, caption: 'Checkout.PasswordEntry.Text', captionArgs: [card]});\n const passwordInputField = new PasswordInputField({labelText: passwordState.hint});\n section.content.append(passwordInputField.container);\n this.scrollable.append(section.container);\n\n const onInput = () => {\n payButton.disabled = !passwordInputField.value;\n passwordInputField.setState(InputState.Neutral);\n };\n\n passwordInputField.input.addEventListener('input', onInput);\n\n const payButton = PaymentButton({\n key: 'Checkout.PasswordEntry.Pay',\n onClick: async() => {\n try {\n const inputCheckPassword = await this.managers.passwordManager.getInputCheckPassword(passwordInputField.value, passwordState);\n const tmpPassword = await this.managers.apiManager.invokeApi('account.getTmpPassword', {\n password: inputCheckPassword,\n period: 60\n });\n\n this.dispatchEvent('finish', tmpPassword);\n this.hide();\n } catch(err) {\n if((err as ApiError).type === 'PASSWORD_HASH_INVALID') {\n (err as ApiError).handled = true;\n passwordInputField.setError('PASSWORD_HASH_INVALID');\n }\n\n throw err;\n }\n }\n });\n this.body.append(this.btnConfirmOnEnter = payButton);\n\n onInput();\n\n this.show();\n\n placeCaretAtEnd(passwordInputField.input);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport placeCaretAtEnd from '../../helpers/dom/placeCaretAtEnd';\nimport {InputInvoice, PaymentRequestedInfo, PaymentsPaymentForm, PaymentsValidatedRequestedInfo} from '../../layer';\nimport matchEmail from '../../lib/richTextProcessor/matchEmail';\nimport CheckboxField from '../checkboxField';\nimport CountryInputField from '../countryInputField';\nimport InputField from '../inputField';\nimport Row from '../row';\nimport SettingSection from '../settingSection';\nimport TelInputField from '../telInputField';\nimport {PaymentButton} from './payment';\nimport {createCountryZipFields, handleInputFieldsOnChange, InputFieldCorrected} from './paymentCard';\n\nexport type PaymentShippingAddress = PaymentRequestedInfo;\n\ntype ShippingFocusField = 'name' | 'email' | 'phone';\n\nexport default class PopupPaymentShipping extends PopupElement<{\n finish: (o: {shippingAddress: PaymentShippingAddress, requestedInfo: PaymentsValidatedRequestedInfo}) => void\n}> {\n constructor(\n private paymentForm: PaymentsPaymentForm,\n private inputInvoice: InputInvoice,\n private focus?: ShippingFocusField\n ) {\n super('popup-payment popup-payment-shipping', {\n closable: true,\n overlayClosable: true,\n body: true,\n scrollable: true,\n title: 'PaymentShippingInfo'\n });\n\n this.d();\n }\n\n private d() {\n const paymentForm = this.paymentForm;\n const invoice = paymentForm.invoice;\n const savedInfo = this.paymentForm.saved_info;\n\n let addressSection: SettingSection,\n address1InputField: InputField,\n address2InputField: InputField,\n cityInputField: InputField,\n stateInputField: InputField,\n countryInputField: CountryInputField,\n postcodeInputField: InputFieldCorrected;\n if(invoice.pFlags.shipping_address_requested) {\n addressSection = new SettingSection({name: 'PaymentShippingAddress', noDelimiter: true, noShadow: true});\n address1InputField = new InputField({label: 'PaymentShippingAddress1Placeholder', maxLength: 64, required: true});\n address2InputField = new InputField({label: 'PaymentShippingAddress2Placeholder', maxLength: 64});\n cityInputField = new InputField({label: 'PaymentShippingCityPlaceholder', maxLength: 64, required: true});\n stateInputField = new InputField({label: 'PaymentShippingStatePlaceholder', maxLength: 64});\n const res = createCountryZipFields(true, true);\n countryInputField = res.countryInputField;\n postcodeInputField = res.postcodeInputField;\n\n addressSection.content.append(...[\n address1InputField,\n address2InputField,\n cityInputField,\n stateInputField,\n countryInputField,\n postcodeInputField\n ].filter(Boolean).map((inputField) => inputField.container));\n }\n\n let receiverSection: SettingSection;\n let nameInputField: InputField, emailInputField: InputField, telInputField: TelInputField;\n if([invoice.pFlags.name_requested, invoice.pFlags.email_requested, invoice.pFlags.phone_requested].includes(true)) {\n receiverSection = new SettingSection({name: 'PaymentShippingReceiver', noDelimiter: true, noShadow: true});\n\n const validateEmail = () => {\n const value = emailInputField.value;\n const match = matchEmail(value);\n if(!match || match[0].length !== value.length) {\n return false;\n }\n\n return true;\n };\n\n const validatePhone = () => {\n return !!telInputField.value.match(/\\d/);\n };\n\n if(invoice.pFlags.name_requested) nameInputField = new InputField({label: 'PaymentShippingName', maxLength: 256, required: true});\n if(invoice.pFlags.email_requested) emailInputField = new InputField({label: 'PaymentShippingEmailPlaceholder', maxLength: 64, required: true, validate: validateEmail});\n if(invoice.pFlags.phone_requested) telInputField = new TelInputField({required: true, validate: validatePhone});\n\n receiverSection.content.append(...[\n nameInputField,\n emailInputField,\n telInputField\n ].filter(Boolean).map((inputField) => inputField.container));\n }\n\n const saveCheckboxField = new CheckboxField({\n text: 'PaymentShippingSave',\n checked: true\n });\n const saveRow = new Row({\n checkboxField: saveCheckboxField,\n subtitleLangKey: 'PaymentShippingSaveInfo'\n });\n\n (receiverSection || addressSection).content.append(saveRow.container);\n\n this.scrollable.append(...[addressSection, receiverSection].filter(Boolean).map((section) => section.container));\n\n const payButton = PaymentButton({\n key: 'PaymentInfo.Done',\n onClick: async() => {\n const selectedCountry = countryInputField && countryInputField.getSelected().country;\n const data: PaymentShippingAddress = {\n _: 'paymentRequestedInfo',\n shipping_address: selectedCountry && {\n _: 'postAddress',\n street_line1: address1InputField.value,\n street_line2: address2InputField.value,\n city: cityInputField.value,\n state: stateInputField.value,\n // country: countryInputField.value,\n country_iso2: selectedCountry?.iso2,\n post_code: postcodeInputField.value\n },\n name: nameInputField?.value,\n email: emailInputField?.value,\n phone: telInputField?.value\n };\n\n try {\n const requestedInfo = await this.managers.appPaymentsManager.validateRequestedInfo(this.inputInvoice, data, saveCheckboxField?.checked);\n\n this.dispatchEvent('finish', {\n shippingAddress: data,\n requestedInfo\n });\n\n this.hide();\n } catch(err: any) {\n const errorMap: {[err: string]: InputField} = {\n ADDRESS_STREET_LINE1_INVALID: address1InputField,\n ADDRESS_STREET_LINE2_INVALID: address2InputField,\n ADDRESS_COUNTRY_INVALID: countryInputField,\n ADDRESS_CITY_INVALID: cityInputField,\n ADDRESS_STATE_INVALID: stateInputField,\n ADDRESS_POSTCODE_INVALID: postcodeInputField,\n\n REQ_INFO_NAME_INVALID: nameInputField,\n REQ_INFO_EMAIL_INVALID: emailInputField,\n REQ_INFO_PHONE_INVALID: telInputField\n };\n\n const inputField = errorMap[(err as ApiError).type];\n if(inputField) {\n inputField.setError();\n (err as any).handled = true;\n }\n\n throw err;\n }\n }\n });\n this.body.append(this.btnConfirmOnEnter = payButton);\n\n if(savedInfo) {\n const shippingAddress = savedInfo.shipping_address;\n if(shippingAddress) {\n address1InputField.value = shippingAddress.street_line1;\n address2InputField.value = shippingAddress.street_line2;\n cityInputField.value = shippingAddress.city;\n stateInputField.value = shippingAddress.state;\n countryInputField.selectCountryByIso2(shippingAddress.country_iso2);\n postcodeInputField.value = shippingAddress.post_code;\n }\n\n savedInfo.name && nameInputField && (nameInputField.value = savedInfo.name);\n savedInfo.email && emailInputField && (emailInputField.value = savedInfo.email);\n savedInfo.phone && telInputField && (telInputField.value = savedInfo.phone);\n }\n\n const {validate} = handleInputFieldsOnChange([\n address1InputField,\n address2InputField,\n cityInputField,\n stateInputField,\n countryInputField,\n postcodeInputField,\n nameInputField,\n emailInputField,\n telInputField\n ].filter(Boolean), (valid) => {\n payButton.disabled = !valid;\n });\n\n validate();\n\n this.show();\n\n let focusField: InputField;\n if(this.focus) {\n const focusMap: {[field in ShippingFocusField]?: InputField} = {\n name: nameInputField,\n email: emailInputField,\n phone: telInputField\n };\n\n focusField = focusMap[this.focus];\n } else {\n focusField = address1InputField;\n }\n\n if(focusField) {\n placeCaretAtEnd(focusField.input);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport accumulate from '../../helpers/array/accumulate';\nimport paymentsWrapCurrencyAmount from '../../helpers/paymentsWrapCurrencyAmount';\nimport {PaymentsPaymentForm, PaymentsValidatedRequestedInfo, ShippingOption} from '../../layer';\nimport RadioField from '../radioField';\nimport Row, {RadioFormFromRows} from '../row';\nimport SettingSection from '../settingSection';\nimport {PaymentButton} from './payment';\n\nexport default class PopupPaymentShippingMethods extends PopupElement<{\n finish: (shippingOption: ShippingOption) => void\n}> {\n constructor(\n private paymentForm: PaymentsPaymentForm,\n private requestedInfo: PaymentsValidatedRequestedInfo,\n private shippingOption: ShippingOption\n ) {\n super('popup-payment popup-payment-shipping-methods', {\n closable: true,\n overlayClosable: true,\n body: true,\n scrollable: true,\n title: 'PaymentShippingMethod'\n });\n\n this.d();\n }\n\n private d() {\n const section = new SettingSection({name: 'PaymentCheckoutShippingMethod', noDelimiter: true, noShadow: true});\n\n const rows = this.requestedInfo.shipping_options.map((shippingOption) => {\n return new Row({\n radioField: new RadioField({\n text: shippingOption.title,\n name: 'shipping-method',\n value: shippingOption.id\n }),\n subtitle: paymentsWrapCurrencyAmount(\n accumulate(shippingOption.prices.map(({amount}) => +amount), 0),\n this.paymentForm.invoice.currency\n )\n });\n });\n\n let lastShippingId: string;\n const form = RadioFormFromRows(rows, (value) => {\n lastShippingId = value;\n });\n\n if(this.shippingOption) {\n rows.find((row) => row.radioField.input.value === this.shippingOption.id).radioField.checked = true;\n } else {\n rows[0].radioField.checked = true;\n }\n\n section.content.append(form);\n\n this.scrollable.append(section.container);\n\n const payButton = PaymentButton({\n key: 'PaymentInfo.Done',\n onClick: () => {\n this.dispatchEvent('finish', this.requestedInfo.shipping_options.find((option) => option.id === lastShippingId));\n this.hide();\n }\n });\n this.body.append(this.btnConfirmOnEnter = payButton);\n\n this.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '.';\nimport Currencies from '../../config/currencies';\nimport {FontFamily, FontSize} from '../../config/font';\nimport accumulate from '../../helpers/array/accumulate';\nimport getTextWidth from '../../helpers/canvas/getTextWidth';\nimport {detectUnifiedCardBrand} from '../../helpers/cards/cardBrands';\nimport {attachClickEvent, simulateClickEvent} from '../../helpers/dom/clickEvent';\nimport findUpAsChild from '../../helpers/dom/findUpAsChild';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport placeCaretAtEnd from '../../helpers/dom/placeCaretAtEnd';\nimport {renderImageFromUrlPromise} from '../../helpers/dom/renderImageFromUrl';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport toggleDisability from '../../helpers/dom/toggleDisability';\nimport {formatPhoneNumber} from '../../helpers/formatPhoneNumber';\nimport paymentsWrapCurrencyAmount from '../../helpers/paymentsWrapCurrencyAmount';\nimport ScrollSaver from '../../helpers/scrollSaver';\nimport tsNow from '../../helpers/tsNow';\nimport {AccountTmpPassword, InputInvoice, InputPaymentCredentials, LabeledPrice, Message, MessageMedia, PaymentRequestedInfo, PaymentSavedCredentials, PaymentsPaymentForm, PaymentsPaymentReceipt, PaymentsValidatedRequestedInfo, PostAddress, ShippingOption} from '../../layer';\nimport I18n, {i18n, LangPackKey, _i18n} from '../../lib/langPack';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\nimport rootScope from '../../lib/rootScope';\nimport AvatarElement from '../avatar';\nimport Button from '../button';\nimport CheckboxField from '../checkboxField';\nimport PeerTitle from '../peerTitle';\nimport {putPreloader} from '../putPreloader';\nimport Row from '../row';\nimport {toastNew} from '../toast';\nimport wrapPeerTitle from '../wrappers/peerTitle';\nimport wrapPhoto from '../wrappers/photo';\nimport PopupPaymentCard, {PaymentCardDetails, PaymentCardDetailsResult} from './paymentCard';\nimport PopupPaymentCardConfirmation from './paymentCardConfirmation';\nimport PopupPaymentShipping, {PaymentShippingAddress} from './paymentShipping';\nimport PopupPaymentShippingMethods from './paymentShippingMethods';\nimport PopupPaymentVerification from './paymentVerification';\n\nconst iconPath = 'assets/img/';\nconst icons = [\n 'amex',\n 'card',\n 'diners',\n 'discover',\n 'jcb',\n 'mastercard',\n 'visa',\n 'unionpay',\n 'mir',\n 'logo'\n];\n\nexport function getPaymentBrandIconPath(brand: string) {\n if(!icons.includes(brand)) {\n return;\n }\n\n return `${iconPath}${brand}.svg`;\n}\n\nexport function PaymentButton(options: {\n onClick: () => Promise | void,\n key?: LangPackKey,\n textEl?: I18n.IntlElement\n}) {\n const textEl = options.textEl ?? new I18n.IntlElement({key: options.key ?? 'PaymentInfo.Done'});\n const key = textEl.key;\n const payButton = Button('btn-primary btn-color-primary payment-item-pay');\n payButton.append(textEl.element);\n attachClickEvent(payButton, async() => {\n const result = options.onClick();\n if(!(result instanceof Promise)) {\n return;\n }\n\n const d = putPreloader(payButton);\n const toggle = toggleDisability([payButton], true);\n textEl.compareAndUpdate({key: 'PleaseWait'});\n try {\n await result;\n } catch(err) {\n if(!(err as any).handled) {\n console.error('payment button error', err);\n }\n\n toggle();\n textEl.compareAndUpdate({key});\n d.remove();\n }\n });\n return payButton;\n}\n\nexport type PaymentsCredentialsToken = {type: 'card', token?: string, id?: string};\n\nexport default class PopupPayment extends PopupElement {\n private tipButtonsMap: Map;\n\n constructor(\n private message: Message.message,\n private inputInvoice: InputInvoice,\n private paymentForm?: PaymentsPaymentForm | PaymentsPaymentReceipt,\n private isReceipt?: boolean\n ) {\n super('popup-payment', {\n closable: true,\n overlayClosable: true,\n body: true,\n scrollable: true,\n title: true\n });\n\n this.tipButtonsMap = new Map();\n this.d().catch((err) => {\n console.error('payment popup error', err);\n this.hide();\n });\n }\n\n private async d() {\n this.element.classList.add('is-loading');\n this.show();\n\n let confirmed = false;\n const onConfirmed = () => {\n if(confirmed) {\n return;\n }\n\n confirmed = true;\n if(popupPaymentVerification) {\n popupPaymentVerification.hide();\n }\n\n this.hide();\n };\n\n let {paymentForm, message} = this;\n\n if(message) {\n this.listenerSetter.add(rootScope)('payment_sent', ({peerId, mid}) => {\n if(message.peerId === peerId && message.mid === mid) {\n onConfirmed();\n }\n });\n }\n\n const mediaInvoice = message?.media as MessageMedia.messageMediaInvoice;\n const isReceipt = this.isReceipt ??\n (\n mediaInvoice ?\n !!mediaInvoice.receipt_msg_id || mediaInvoice.extended_media?._ === 'messageExtendedMedia' :\n paymentForm._ === 'payments.paymentReceipt'\n );\n const isTest = mediaInvoice ? mediaInvoice.pFlags.test : paymentForm.invoice.pFlags.test;\n\n const photo = mediaInvoice ? mediaInvoice.photo : paymentForm.photo;\n const title = mediaInvoice ? mediaInvoice.title : paymentForm.title;\n const description = mediaInvoice ? mediaInvoice.description : paymentForm.description;\n\n _i18n(this.title, isReceipt ? 'PaymentReceipt' : 'PaymentCheckout');\n if(isTest) {\n this.title.append(' (Test)');\n }\n\n const className = 'payment-item';\n\n const itemEl = document.createElement('div');\n itemEl.classList.add(className);\n\n const detailsClassName = className + '-details';\n const details = document.createElement('div');\n details.classList.add(detailsClassName);\n\n let photoEl: HTMLElement;\n if(photo) {\n photoEl = document.createElement('div');\n photoEl.classList.add(detailsClassName + '-photo', 'media-container-contain');\n wrapPhoto({\n photo: photo,\n container: photoEl,\n boxWidth: 100,\n boxHeight: 100,\n size: {_: 'photoSizeEmpty', type: ''}\n });\n details.append(photoEl);\n }\n\n const linesClassName = detailsClassName + '-lines';\n const linesEl = document.createElement('div');\n linesEl.classList.add(linesClassName);\n\n const titleEl = document.createElement('div');\n titleEl.classList.add(linesClassName + '-title');\n\n const descriptionEl = document.createElement('div');\n descriptionEl.classList.add(linesClassName + '-description');\n\n const botName = document.createElement('div');\n botName.classList.add(linesClassName + '-bot-name');\n\n linesEl.append(titleEl, descriptionEl, botName);\n\n setInnerHTML(titleEl, wrapEmojiText(title));\n setInnerHTML(descriptionEl, wrapEmojiText(description));\n\n const peerTitle = new PeerTitle();\n botName.append(peerTitle.element);\n\n details.append(linesEl);\n itemEl.append(details);\n this.scrollable.append(itemEl);\n\n const preloaderContainer = document.createElement('div');\n preloaderContainer.classList.add(className + '-preloader-container');\n const preloader = putPreloader(preloaderContainer, true);\n this.scrollable.container.append(preloaderContainer);\n\n const inputInvoice = this.inputInvoice;\n if(!paymentForm) {\n if(isReceipt) paymentForm = await this.managers.appPaymentsManager.getPaymentReceipt(message.peerId, mediaInvoice.receipt_msg_id || (inputInvoice as InputInvoice.inputInvoiceMessage).msg_id);\n else paymentForm = await this.managers.appPaymentsManager.getPaymentForm(inputInvoice);\n this.paymentForm = paymentForm;\n }\n\n let savedInfo = (paymentForm as PaymentsPaymentForm).saved_info || (paymentForm as PaymentsPaymentReceipt).info;\n const savedCredentials = (paymentForm as PaymentsPaymentForm).saved_credentials?.[0];\n let [lastRequestedInfo, passwordState, providerPeerTitle] = await Promise.all([\n !isReceipt && savedInfo && this.managers.appPaymentsManager.validateRequestedInfo(inputInvoice, savedInfo),\n savedCredentials && this.managers.passwordManager.getState(),\n wrapPeerTitle({peerId: paymentForm.provider_id.toPeerId()})\n ]);\n\n // console.log(paymentForm, lastRequestedInfo);\n\n await peerTitle.update({peerId: paymentForm.bot_id.toPeerId()});\n preloaderContainer.remove();\n this.element.classList.remove('is-loading');\n\n const wrapAmount = (amount: string | number, skipSymbol?: boolean) => {\n return paymentsWrapCurrencyAmount(amount, currency, skipSymbol);\n };\n\n const {invoice} = paymentForm;\n const currency = invoice.currency;\n\n const isRecurring = invoice.pFlags.recurring && !isReceipt;\n\n await peerTitle.update({peerId: paymentForm.bot_id.toPeerId()});\n const peerTitle2 = isRecurring ? await wrapPeerTitle({peerId: paymentForm.bot_id.toPeerId()}) : undefined;\n preloaderContainer.remove();\n this.element.classList.remove('is-loading');\n\n const makeLabel = () => {\n const labelEl = document.createElement('div');\n labelEl.classList.add(pricesClassName + '-price');\n\n const left = document.createElement('span');\n const right = document.createElement('span');\n labelEl.append(left, right);\n return {label: labelEl, left, right};\n };\n\n const pricesClassName = className + '-prices';\n const prices = document.createElement('div');\n prices.classList.add(pricesClassName);\n const makePricesElements = (prices: LabeledPrice[]) => {\n return prices.map((price) => {\n const {amount, label} = price;\n\n const _label = makeLabel();\n _label.left.textContent = label;\n\n const wrappedAmount = wrapAmount(amount);\n _label.right.textContent = wrappedAmount;\n\n return _label.label;\n });\n };\n\n const pricesElements = makePricesElements(invoice.prices);\n\n let getTipsAmount = (): number => 0;\n let shippingAmount = 0;\n\n const getTotalTotal = () => totalAmount + getTipsAmount() + shippingAmount;\n const setTotal = () => {\n const wrapped = wrapAmount(getTotalTotal());\n totalLabel.right.textContent = wrapped;\n payI18n.compareAndUpdate({\n key: 'PaymentCheckoutPay',\n args: [wrapped]\n });\n };\n\n const payI18n = new I18n.IntlElement();\n\n const totalLabel = makeLabel();\n totalLabel.label.classList.add('is-total');\n _i18n(totalLabel.left, 'PaymentTransactionTotal');\n const totalAmount = accumulate(invoice.prices.map(({amount}) => +amount), 0);\n\n const canTip = (invoice.max_tip_amount !== undefined && !isReceipt) || !!(paymentForm as PaymentsPaymentReceipt).tip_amount;\n if(canTip) {\n const tipsClassName = className + '-tips';\n\n const currencyData = Currencies[currency];\n\n getTipsAmount = () => +getInputValue().replace(/\\D/g, '');\n\n const getInputValue = () => {\n // return input.textContent;\n return input.value;\n };\n\n const setInputWidth = () => {\n const width = getTextWidth(getInputValue(), `500 ${FontSize} ${FontFamily}`);\n input.style.width = width + 'px';\n };\n\n const setInputValue = (amount: string | number) => {\n amount = Math.min(+amount, +invoice.max_tip_amount);\n const wrapped = wrapAmount(amount, true);\n\n input.value = wrapped;\n // input.textContent = wrapped;\n if(document.activeElement === input) {\n placeCaretAtEnd(input);\n }\n\n unsetActiveTip && unsetActiveTip();\n const tipEl = this.tipButtonsMap.get(amount);\n if(tipEl) {\n tipEl.classList.add('active');\n }\n\n setInputWidth();\n setTotal();\n };\n\n const tipsLabel = makeLabel();\n _i18n(tipsLabel.left, isReceipt ? 'PaymentTip' : 'PaymentTipOptional');\n const input = document.createElement('input');\n input.type = 'tel';\n // const input: HTMLElement = document.createElement('div');\n // input.contentEditable = 'true';\n input.classList.add('input-clear', tipsClassName + '-input');\n tipsLabel.right.append(input);\n\n if(!isReceipt) {\n tipsLabel.label.style.cursor = 'text';\n } else {\n tipsLabel.label.classList.add('disable-hover');\n }\n\n tipsLabel.label.addEventListener('mousedown', (e) => {\n if(!findUpAsChild(e.target as HTMLElement, input)) {\n placeCaretAtEnd(input);\n }\n });\n\n const haveToIgnoreEvents = input instanceof HTMLInputElement ? 1 : 2;\n const onSelectionChange = () => {\n if(ignoreNextSelectionChange) {\n --ignoreNextSelectionChange;\n return;\n }\n\n // setTimeout(() => {\n ignoreNextSelectionChange = haveToIgnoreEvents;\n placeCaretAtEnd(input);\n // }, 0);\n };\n\n const onFocus = () => {\n // cancelEvent(e);\n setTimeout(() => {\n ignoreNextSelectionChange = haveToIgnoreEvents;\n placeCaretAtEnd(input);\n document.addEventListener('selectionchange', onSelectionChange);\n }, 0);\n };\n\n const onFocusOut = () => {\n input.addEventListener('focus', onFocus, {once: true});\n document.removeEventListener('selectionchange', onSelectionChange);\n };\n\n let ignoreNextSelectionChange: number;\n input.addEventListener('focusout', onFocusOut);\n onFocusOut();\n\n input.addEventListener('input', () => {\n setInputValue(getTipsAmount());\n });\n\n const s = [currencyData.symbol, currencyData.space_between ? ' ' : ''];\n if(!currencyData.symbol_left) s.reverse();\n tipsLabel.right[currencyData.symbol_left ? 'prepend' : 'append'](s.join(''));\n\n pricesElements.push(tipsLabel.label);\n\n //\n let unsetActiveTip: () => void;\n if(!isReceipt) {\n const tipsEl = document.createElement('div');\n tipsEl.classList.add(tipsClassName);\n\n const tipClassName = tipsClassName + '-tip';\n const tipButtons = invoice.suggested_tip_amounts.map((tipAmount) => {\n const button = Button(tipClassName, {noRipple: true});\n button.textContent = wrapAmount(tipAmount);\n\n this.tipButtonsMap.set(+tipAmount, button);\n return button;\n });\n\n unsetActiveTip = () => {\n const prevTipEl = tipsEl.querySelector('.active');\n if(prevTipEl) {\n prevTipEl.classList.remove('active');\n }\n };\n\n attachClickEvent(tipsEl, (e) => {\n const tipEl = findUpClassName(e.target, tipClassName);\n if(!tipEl) {\n return;\n }\n\n let tipAmount = 0;\n if(tipEl.classList.contains('active')) {\n tipEl.classList.remove('active');\n } else {\n unsetActiveTip();\n tipEl.classList.add('active');\n\n for(const [amount, el] of this.tipButtonsMap) {\n if(el === tipEl) {\n tipAmount = amount;\n break;\n }\n }\n }\n\n setInputValue(tipAmount);\n });\n\n setInputValue(0);\n\n tipsEl.append(...tipButtons);\n pricesElements.push(tipsEl);\n } else {\n setInputValue((paymentForm as PaymentsPaymentReceipt).tip_amount);\n }\n } else {\n setTotal();\n }\n\n pricesElements.push(totalLabel.label);\n\n prices.append(...pricesElements);\n itemEl.append(prices);\n\n // /\n\n const setRowIcon = async(row: Row, icon?: string) => {\n const img = document.createElement('img');\n img.classList.add('media-photo');\n await renderImageFromUrlPromise(img, getPaymentBrandIconPath(icon));\n let container = row.media;\n if(!container) {\n container = row.createMedia('small');\n container.classList.add('media-container-cover');\n container.append(img);\n } else {\n replaceContent(container, img);\n }\n\n row.container.classList.remove('row-with-icon');\n };\n\n const createRow = (options: ConstructorParameters[0]) => {\n if(options.titleLangKey) {\n options.subtitleLangKey = options.titleLangKey;\n }\n\n options.noWrap = true;\n const row = new Row(options);\n row.container.classList.add(className + '-row');\n\n if(options.titleLangKey) {\n row.subtitle.classList.add('hide');\n }\n\n return row;\n };\n\n const setRowTitle = (row: Row, textContent: string) => {\n row.title.textContent = textContent;\n if(!textContent) {\n const e = I18n.weakMap.get(row.subtitle.firstElementChild as HTMLElement) as I18n.IntlElement;\n row.title.append(i18n(e.key));\n }\n\n row.subtitle.classList.toggle('hide', !textContent);\n };\n\n const setCardSubtitle = (card: PaymentCardDetailsResult) => {\n let brand: string;\n let str: string;\n let icon: string;\n if('title' in card) {\n brand = card.title.split(' ').shift();\n str = card.title;\n icon = card.icon;\n } else {\n brand = detectUnifiedCardBrand(card.cardNumber);\n str = brand + ' *' + card.cardNumber.split(' ').pop();\n }\n\n methodRow.title.classList.remove('tgico', 'tgico-card_outline');\n setRowIcon(methodRow, icon || brand.toLowerCase());\n setRowTitle(methodRow, str);\n };\n\n const onMethodClick = () => {\n new PopupPaymentCard(paymentForm as PaymentsPaymentForm, previousCardDetails as PaymentCardDetails).addEventListener('finish', ({token, card}) => {\n previousToken = token, previousCardDetails = card;\n\n setCardSubtitle(card);\n });\n };\n\n let previousCardDetails: PaymentCardDetailsResult, previousToken: PaymentsCredentialsToken;\n const methodRow = createRow({\n titleLangKey: 'PaymentCheckoutMethod',\n clickable: isReceipt ? undefined : onMethodClick,\n icon: 'card_outline'\n });\n\n methodRow.container.classList.add(className + '-method-row');\n\n if(savedCredentials) {\n setCardSubtitle(savedCredentials);\n } else if((paymentForm as PaymentsPaymentReceipt).credentials_title) {\n setCardSubtitle({title: (paymentForm as PaymentsPaymentReceipt).credentials_title});\n }\n\n const providerRow = createRow({\n title: providerPeerTitle,\n subtitleLangKey: 'PaymentCheckoutProvider'\n });\n\n const providerAvatar = new AvatarElement();\n providerAvatar.classList.add('avatar-32');\n providerRow.createMedia('small').append(providerAvatar);\n /* await */ providerAvatar.updateWithOptions({peerId: paymentForm.provider_id.toPeerId()});\n\n let shippingAddressRow: Row, shippingNameRow: Row, shippingEmailRow: Row, shippingPhoneRow: Row, shippingMethodRow: Row;\n let lastShippingOption: ShippingOption, onShippingAddressClick: (focus?: ConstructorParameters[2]) => void, onShippingMethodClick: () => void;\n const setShippingTitle = invoice.pFlags.shipping_address_requested ? (shippingAddress?: PaymentShippingAddress) => {\n if(!shippingAddress) {\n shippingMethodRow.subtitle.classList.add('hide');\n replaceContent(shippingMethodRow.title, i18n('PaymentShippingAddress'));\n return;\n }\n\n const postAddress = shippingAddress.shipping_address;\n setRowTitle(shippingAddressRow, [postAddress.city, postAddress.street_line1, postAddress.street_line2].filter(Boolean).join(', '));\n\n shippingMethodRow.container.classList.toggle('hide', !lastRequestedInfo && !isReceipt);\n } : undefined;\n\n const setShippingInfo = (info: PaymentRequestedInfo) => {\n setShippingTitle && setShippingTitle(info);\n shippingNameRow && setRowTitle(shippingNameRow, info.name);\n shippingEmailRow && setRowTitle(shippingEmailRow, info.email);\n shippingPhoneRow && setRowTitle(shippingPhoneRow, info.phone && ('+' + formatPhoneNumber(info.phone).formatted));\n };\n\n if(!isReceipt) {\n onShippingAddressClick = (focus) => {\n new PopupPaymentShipping(paymentForm as PaymentsPaymentForm, inputInvoice, focus).addEventListener('finish', ({shippingAddress, requestedInfo}) => {\n lastRequestedInfo = requestedInfo;\n savedInfo = (paymentForm as PaymentsPaymentForm).saved_info = shippingAddress;\n setShippingInfo(shippingAddress);\n });\n };\n }\n\n if(invoice.pFlags.shipping_address_requested) {\n const setShippingOption = (shippingOption?: ShippingOption) => {\n const scrollSaver = new ScrollSaver(this.scrollable, undefined, true);\n scrollSaver.save();\n if(lastShippingPricesElements) {\n lastShippingPricesElements.forEach((node) => node.remove());\n }\n\n if(!shippingOption) {\n shippingAmount = 0;\n\n setTotal();\n scrollSaver.restore();\n this.onContentUpdate();\n return;\n }\n\n lastShippingOption = shippingOption;\n setRowTitle(shippingMethodRow, shippingOption.title);\n\n shippingAmount = accumulate(shippingOption.prices.map(({amount}) => +amount), 0);\n lastShippingPricesElements = makePricesElements(shippingOption.prices);\n let l = totalLabel.label;\n if(canTip) {\n l = l.previousElementSibling as any;\n if(!isReceipt) {\n l = l.previousElementSibling as any;\n }\n }\n\n lastShippingPricesElements.forEach((element) => l.parentElement.insertBefore(element, l));\n\n setTotal();\n scrollSaver.restore();\n this.onContentUpdate();\n };\n\n shippingAddressRow = createRow({\n icon: 'location',\n titleLangKey: 'PaymentShippingAddress',\n clickable: !isReceipt && onShippingAddressClick.bind(null, undefined)\n });\n\n let lastShippingPricesElements: HTMLElement[];\n shippingMethodRow = createRow({\n icon: 'shipping',\n titleLangKey: 'PaymentCheckoutShippingMethod',\n clickable: !isReceipt && (onShippingMethodClick = () => {\n new PopupPaymentShippingMethods(paymentForm as PaymentsPaymentForm, lastRequestedInfo, lastShippingOption).addEventListener('finish', (shippingOption) => {\n setShippingOption(shippingOption);\n });\n })\n });\n\n shippingMethodRow.container.classList.add('hide');\n\n const shippingOption = (paymentForm as PaymentsPaymentReceipt).shipping;\n if(shippingOption) {\n setShippingOption(shippingOption);\n }\n }\n\n if(invoice.pFlags.name_requested) {\n shippingNameRow = createRow({\n icon: 'newprivate',\n titleLangKey: 'PaymentCheckoutName',\n clickable: !isReceipt && onShippingAddressClick.bind(null, 'name')\n });\n }\n\n if(invoice.pFlags.email_requested) {\n shippingEmailRow = createRow({\n icon: 'mention',\n titleLangKey: 'PaymentShippingEmailPlaceholder',\n clickable: !isReceipt && onShippingAddressClick.bind(null, 'email')\n });\n }\n\n if(invoice.pFlags.phone_requested) {\n shippingPhoneRow = createRow({\n icon: 'phone',\n titleLangKey: 'PaymentCheckoutPhoneNumber',\n clickable: !isReceipt && onShippingAddressClick.bind(null, 'phone')\n });\n }\n\n if(savedInfo) {\n setShippingInfo(savedInfo);\n }\n\n const rows = [\n methodRow,\n providerRow,\n shippingAddressRow,\n shippingMethodRow,\n shippingNameRow,\n shippingEmailRow,\n shippingPhoneRow\n ].filter(Boolean);\n\n const acceptTermsCheckboxField = isRecurring && new CheckboxField({\n text: 'Payments.Recurrent.Accept',\n textArgs: [wrapRichText(invoice.recurring_terms_url), peerTitle2]\n });\n\n const acceptTermsRow = isRecurring && createRow({\n checkboxField: acceptTermsCheckboxField\n });\n\n const recurringElements = isRecurring ? [document.createElement('hr'), acceptTermsRow.container] : [];\n\n this.scrollable.append(...[\n document.createElement('hr'),\n ...rows.map((row) => row.container),\n ...recurringElements\n ].filter(Boolean));\n\n // /\n let popupPaymentVerification: PopupPaymentVerification, lastTmpPasword: AccountTmpPassword;\n const onClick = () => {\n const missingInfo = invoice.pFlags.name_requested && !savedInfo?.name ? 'name' : (invoice.pFlags.email_requested && !savedInfo?.email ? 'email' : (invoice.pFlags.phone_requested && !savedInfo?.phone ? 'phone' : undefined));\n if(invoice.pFlags.shipping_address_requested) {\n if(!lastRequestedInfo) {\n onShippingAddressClick();\n return;\n } else if(!lastShippingOption) {\n onShippingMethodClick();\n return;\n }\n } else if(missingInfo) {\n onShippingAddressClick(missingInfo);\n return;\n }\n\n if(!previousCardDetails && !lastTmpPasword) {\n if(!savedCredentials) {\n onMethodClick();\n return;\n }\n\n Promise.resolve(passwordState ?? this.managers.passwordManager.getState()).then((_passwordState) => {\n new PopupPaymentCardConfirmation(savedCredentials.title, _passwordState).addEventListener('finish', (tmpPassword) => {\n passwordState = undefined;\n lastTmpPasword = tmpPassword;\n simulateClickEvent(payButton);\n\n // * reserve 5 seconds\n const diff = tmpPassword.valid_until - tsNow(true) - 5;\n setTimeout(() => {\n if(lastTmpPasword === tmpPassword) {\n lastTmpPasword = undefined;\n }\n }, diff * 1000);\n });\n });\n\n return;\n }\n\n return Promise.resolve().then(async() => {\n const credentials: InputPaymentCredentials = lastTmpPasword ? {\n _: 'inputPaymentCredentialsSaved',\n id: savedCredentials.id,\n tmp_password: lastTmpPasword.tmp_password\n } : {\n _: 'inputPaymentCredentials',\n data: {\n _: 'dataJSON',\n data: JSON.stringify(previousToken.token ? previousToken : {type: previousToken.type, id: previousToken.id})\n },\n pFlags: {\n save: previousCardDetails.save || undefined\n }\n };\n\n try {\n const paymentResult = await this.managers.appPaymentsManager.sendPaymentForm(\n inputInvoice,\n (paymentForm as PaymentsPaymentForm).form_id,\n lastRequestedInfo?.id,\n lastShippingOption?.id,\n credentials,\n getTipsAmount()\n );\n\n if(paymentResult._ === 'payments.paymentResult') {\n onConfirmed();\n } else {\n popupPaymentVerification = new PopupPaymentVerification(paymentResult.url, !mediaInvoice.extended_media);\n popupPaymentVerification.addEventListener('finish', () => {\n popupPaymentVerification = undefined;\n\n onConfirmed();\n });\n await new Promise((resolve, reject) => {\n popupPaymentVerification.addEventListener('close', () => {\n popupPaymentVerification = undefined;\n if(confirmed) {\n resolve();\n } else {\n const err = new Error('payment not finished');\n (err as ApiError).handled = true;\n reject(err);\n }\n });\n });\n }\n } catch(err) {\n if((err as ApiError).type === 'BOT_PRECHECKOUT_TIMEOUT') {\n toastNew({langPackKey: 'Error.AnError'});\n (err as ApiError).handled = true;\n } else if((err as ApiError).type === 'TMP_PASSWORD_INVALID') {\n passwordState = lastTmpPasword = undefined;\n simulateClickEvent(payButton);\n (err as ApiError).handled = true;\n }\n\n throw err;\n }\n });\n };\n\n const onChange = () => {\n payButton.disabled = !!(acceptTermsCheckboxField && !acceptTermsCheckboxField.checked);\n };\n\n let payButton: HTMLButtonElement;\n if(isReceipt) {\n payButton = PaymentButton({\n onClick: () => this.hide(),\n key: 'Done'\n });\n } else {\n payButton = PaymentButton({\n onClick: onClick,\n textEl: payI18n\n });\n }\n\n onChange();\n if(acceptTermsCheckboxField) {\n acceptTermsCheckboxField.input.addEventListener('change', onChange);\n }\n\n this.body.append(this.btnConfirmOnEnter = payButton);\n\n this.onContentUpdate();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport AvatarElement from '../avatar';\nimport PopupElement, {addCancelButton, PopupButton, PopupOptions} from '.';\nimport {i18n, LangPackKey} from '../../lib/langPack';\nimport CheckboxField, {CheckboxFieldOptions} from '../checkboxField';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\n\nexport type PopupPeerButton = Omit & Partial<{callback: PopupPeerButtonCallback}>;\nexport type PopupPeerButtonCallbackCheckboxes = Set;\nexport type PopupPeerButtonCallback = (checkboxes?: PopupPeerButtonCallbackCheckboxes) => void;\nexport type PopupPeerCheckboxOptions = CheckboxFieldOptions & {checkboxField?: CheckboxField};\n\nexport type PopupPeerOptions = Omit & Partial<{\n peerId: PeerId,\n threadId: number,\n title: string | HTMLElement,\n titleLangKey: LangPackKey,\n titleLangArgs: any[],\n noTitle: boolean,\n description: string | DocumentFragment,\n descriptionLangKey: LangPackKey,\n descriptionLangArgs: any[],\n buttons: Array,\n checkboxes: Array\n}>;\nexport default class PopupPeer extends PopupElement {\n protected description: HTMLParagraphElement;\n\n constructor(private className: string, options: PopupPeerOptions = {}) {\n super('popup-peer' + (className ? ' ' + className : ''), {\n overlayClosable: true,\n ...options,\n title: true,\n buttons: options.buttons && addCancelButton(options.buttons)\n });\n\n if(options.peerId) {\n const avatarEl = new AvatarElement();\n avatarEl.classList.add('avatar-32');\n avatarEl.updateWithOptions({\n isDialog: true,\n peerId: options.peerId,\n threadId: options.threadId,\n wrapOptions: {\n middleware: this.middlewareHelper.get()\n }\n });\n this.header.prepend(avatarEl);\n }\n\n if(!options.noTitle) {\n if(options.titleLangKey || !options.title) this.title.append(i18n(options.titleLangKey || 'AppName', options.titleLangArgs));\n else if(options.title instanceof HTMLElement) {\n this.title.append(options.title);\n } else this.title.innerText = options.title || '';\n }\n\n const fragment = document.createDocumentFragment();\n\n if(options.descriptionLangKey || options.description) {\n const p = this.description = document.createElement('p');\n p.classList.add('popup-description');\n if(options.descriptionLangKey) p.append(i18n(options.descriptionLangKey, options.descriptionLangArgs));\n else if(options.description) setInnerHTML(p, options.description);\n\n fragment.append(p);\n }\n\n if(options.checkboxes) {\n this.container.classList.add('have-checkbox');\n\n options.checkboxes.forEach((o) => {\n o.withRipple = true;\n const checkboxField = new CheckboxField(o);\n o.checkboxField = checkboxField;\n fragment.append(checkboxField.label);\n });\n\n options.buttons.forEach((button) => {\n if(button.callback) {\n const original = button.callback;\n button.callback = () => {\n const c: Set = new Set();\n options.checkboxes.forEach((o) => {\n if(o.checkboxField.checked) {\n c.add(o.text);\n }\n });\n original(c);\n };\n }\n });\n }\n\n this.container.insertBefore(fragment, this.header.nextElementSibling);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport AppSelectPeers from '../appSelectPeers';\nimport PopupElement from '.';\nimport {LangPackKey, _i18n} from '../../lib/langPack';\n\nexport default class PopupPickUser extends PopupElement {\n protected selector: AppSelectPeers;\n\n constructor(options: {\n peerTypes: AppSelectPeers['peerType'],\n onSelect?: (peerId: PeerId) => Promise | void,\n placeholder: LangPackKey,\n chatRightsActions?: AppSelectPeers['chatRightsActions'],\n peerId?: number,\n selfPresence?: LangPackKey\n }) {\n super('popup-forward', {closable: true, overlayClosable: true, body: true, title: true});\n\n this.selector = new AppSelectPeers({\n appendTo: this.body,\n onChange: async() => {\n const selected = this.selector.getSelected();\n const peerId = selected[selected.length - 1].toPeerId();\n\n if(options.onSelect) {\n const res = options.onSelect(peerId);\n if(res instanceof Promise) {\n try {\n await res;\n } catch(err) {\n return;\n }\n }\n }\n\n this.selector = null;\n this.hide();\n },\n peerType: options.peerTypes,\n onFirstRender: () => {\n this.show();\n this.selector.checkForTriggers(); // ! due to zero height before mounting\n\n if(!IS_TOUCH_SUPPORTED) {\n this.selector.input.focus();\n }\n },\n chatRightsActions: options.chatRightsActions,\n multiSelect: false,\n rippleEnabled: false,\n avatarSize: 'abitbigger',\n peerId: options.peerId,\n placeholder: options.placeholder,\n selfPresence: options.selfPresence,\n managers: this.managers\n });\n\n this.scrollable = this.selector.scrollable;\n this.attachScrollableListeners();\n\n // this.scrollable = new Scrollable(this.body);\n\n this.title.append(this.selector.input);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupPeer from './peer';\n\nexport default class PopupSendNow extends PopupPeer {\n constructor(peerId: PeerId, mids: number[], onConfirm?: () => void) {\n super('popup-delete-chat', {\n title: `Send Message${mids.length > 1 ? 's' : ''} Now`,\n description: mids.length > 1 ? 'Send ' + mids.length + ' messages now?' : 'Send message now?',\n buttons: [{\n langKey: 'Send',\n callback: () => {\n onConfirm && onConfirm();\n this.managers.appMessagesManager.sendScheduledMessages(peerId, mids);\n }\n }]\n });\n\n this.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AppStickersManager} from '../../lib/appManagers/appStickersManager';\nimport PopupElement from '.';\nimport wrapSticker from '../wrappers/sticker';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport {putPreloader} from '../putPreloader';\nimport animationIntersector, {AnimationItemGroup} from '../animationIntersector';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport {i18n} from '../../lib/langPack';\nimport Button from '../button';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport toggleDisability from '../../helpers/dom/toggleDisability';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport {toastNew} from '../toast';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport createStickersContextMenu from '../../helpers/dom/createStickersContextMenu';\nimport attachStickerViewerListeners from '../stickerViewer';\nimport {Document, StickerSet} from '../../layer';\nimport Row from '../row';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport rootScope from '../../lib/rootScope';\nimport wrapCustomEmoji from '../wrappers/customEmoji';\nimport emoticonsDropdown from '../emoticonsDropdown';\n\nconst ANIMATION_GROUP: AnimationItemGroup = 'STICKERS-POPUP';\n\nexport default class PopupStickers extends PopupElement {\n private stickersFooter: HTMLElement;\n private appendTo: HTMLElement;\n private updateAdded: {[setId: Long]: (added: boolean) => void};\n private sets: StickerSet.stickerSet[];\n private button: HTMLElement;\n\n constructor(\n private stickerSetInput: Parameters[0] | Parameters[0][],\n private isEmojis?: boolean\n ) {\n super('popup-stickers', {closable: true, overlayClosable: true, body: true, scrollable: true, title: true});\n\n this.title.append(i18n('Loading'));\n this.updateAdded = {};\n\n emoticonsDropdown.setIgnoreMouseOut('popup', true);\n this.addEventListener('close', () => {\n emoticonsDropdown.setIgnoreMouseOut('popup', false);\n animationIntersector.setOnlyOnePlayableGroup();\n });\n\n this.appendTo = this.scrollable.container;\n\n this.appendTo.classList.add('is-loading');\n putPreloader(this.appendTo, true);\n\n this.stickersFooter = document.createElement('div');\n this.stickersFooter.classList.add('sticker-set-footer');\n\n const btn = Button('btn-primary btn-primary-transparent disable-hover', {noRipple: true, text: 'Loading'});\n this.stickersFooter.append(btn);\n\n this.body.append(this.stickersFooter);\n\n attachStickerViewerListeners({listenTo: this.appendTo, listenerSetter: this.listenerSetter});\n\n const onStickerSetUpdate = (set: StickerSet.stickerSet) => {\n const idx = this.sets.findIndex((_set) => _set.id === set.id);\n if(idx === -1) {\n return;\n }\n\n this.sets[idx] = set;\n const updateAdded = this.updateAdded[set.id];\n updateAdded?.(!!set.installed_date);\n this.updateButton();\n };\n\n this.listenerSetter.add(rootScope)('stickers_installed', onStickerSetUpdate);\n this.listenerSetter.add(rootScope)('stickers_deleted', onStickerSetUpdate);\n\n this.loadStickerSet();\n }\n\n private createStickerSetElements(set?: StickerSet.stickerSet) {\n const container = document.createElement('div');\n container.classList.add('sticker-set');\n\n let headerRow: Row, updateAdded: (added: boolean) => void;\n if(set) {\n headerRow = new Row({\n title: wrapEmojiText(set.title),\n subtitle: i18n(set.pFlags.emojis ? 'EmojiCount' : 'Stickers', [set.count]),\n buttonRight: true\n });\n\n updateAdded = (added) => {\n replaceContent(headerRow.buttonRight, i18n(added ? 'Stickers.SearchAdded' : 'Stickers.SearchAdd'));\n headerRow.buttonRight.classList.toggle('active', added);\n };\n\n updateAdded(!!set.installed_date);\n\n container.append(headerRow.container);\n }\n\n const itemsContainer = document.createElement('div');\n itemsContainer.classList.add('sticker-set-stickers');\n\n container.append(itemsContainer);\n\n return {container, headerRow, updateAdded, itemsContainer};\n }\n\n private onStickersClick = async(e: MouseEvent) => {\n const target = findUpClassName(e.target, 'sticker-set-sticker');\n if(!target) return;\n\n const docId = target.dataset.docId;\n if(await appImManager.chat.input.sendMessageWithDocument(docId)) {\n this.hide();\n }\n };\n\n private async loadStickerSet() {\n const middleware = this.middlewareHelper.get();\n const inputs = Array.isArray(this.stickerSetInput) ? this.stickerSetInput : [this.stickerSetInput];\n const setsPromises = inputs.map((input) => this.managers.appStickersManager.getStickerSet(input));\n let sets = await Promise.all(setsPromises);\n if(!middleware()) return;\n let firstSet = sets[0];\n if(sets.length === 1 && !firstSet) {\n toastNew({langPackKey: this.isEmojis ? 'AddEmojiNotFound' : 'StickerSet.DontExist'});\n this.hide();\n return;\n }\n\n sets = sets.filter(Boolean);\n firstSet = sets[0];\n\n this.sets = sets.map((set) => set.set);\n\n const isEmojis = this.isEmojis ??= !!firstSet.set.pFlags.emojis;\n\n if(!isEmojis) {\n attachClickEvent(this.appendTo, this.onStickersClick, {listenerSetter: this.listenerSetter});\n\n const {destroy} = createStickersContextMenu({\n listenTo: this.appendTo,\n isStickerPack: true,\n onSend: () => this.hide()\n });\n\n this.addEventListener('close', destroy);\n }\n\n animationIntersector.setOnlyOnePlayableGroup(ANIMATION_GROUP);\n\n const lazyLoadQueue = new LazyLoadQueue();\n const loadPromises: Promise[] = [];\n\n const containersPromises = sets.map(async(set) => {\n const {container, itemsContainer, headerRow, updateAdded} = this.createStickerSetElements(sets.length > 1 ? set.set : undefined);\n\n if(headerRow) {\n attachClickEvent(headerRow.buttonRight, () => {\n this.managers.appStickersManager.toggleStickerSet(set.set);\n }, {listenerSetter: this.listenerSetter});\n }\n\n this.updateAdded[set.set.id] = updateAdded;\n\n let divs: (HTMLElement | DocumentFragment)[];\n\n const docs = set.documents.filter((doc) => doc?._ === 'document') as Document.document[];\n if(isEmojis) {\n const fragment = wrapCustomEmoji({\n docIds: docs.map((doc) => doc.id),\n loadPromises,\n animationGroup: ANIMATION_GROUP,\n customEmojiSize: mediaSizes.active.esgCustomEmoji,\n middleware\n // lazyLoadQueue\n });\n\n (Array.from(fragment.children) as HTMLElement[]).slice(1).forEach((element) => {\n const span = document.createElement('span');\n span.classList.add('super-emoji');\n element.replaceWith(span);\n span.append(element);\n });\n\n divs = [fragment];\n\n itemsContainer.classList.replace('sticker-set-stickers', 'super-emojis');\n itemsContainer.classList.add('is-emojis', 'not-local');\n } else {\n divs = await Promise.all(docs.map(async(doc) => {\n const div = document.createElement('div');\n div.classList.add('sticker-set-sticker');\n\n const size = mediaSizes.active.popupSticker.width;\n\n await wrapSticker({\n doc,\n div,\n lazyLoadQueue,\n group: ANIMATION_GROUP,\n play: true,\n loop: true,\n width: size,\n height: size,\n withLock: true,\n loadPromises,\n middleware\n });\n\n return div;\n }));\n }\n\n itemsContainer.append(...divs.filter(Boolean));\n\n return container;\n });\n\n const containers = await Promise.all(containersPromises);\n await Promise.all(loadPromises);\n\n const button = this.button = Button('', {noRipple: true});\n\n this.updateButton();\n\n attachClickEvent(button, () => {\n const toggle = toggleDisability([button], true);\n\n this.managers.appStickersManager.toggleStickerSets(sets.map((set) => set.set)).then(() => {\n this.hide();\n }).catch(() => {\n toggle();\n });\n }, {listenerSetter: this.listenerSetter});\n\n if(sets.length === 1) {\n setInnerHTML(this.title, wrapEmojiText(firstSet.set.title));\n } else {\n setInnerHTML(this.title, i18n('Emoji'));\n }\n\n this.stickersFooter.textContent = '';\n this.stickersFooter.append(button);\n\n this.appendTo.classList.remove('is-loading');\n this.appendTo.textContent = '';\n this.appendTo.append(...containers);\n\n this.scrollable.onAdditionalScroll();\n }\n\n private updateButton() {\n const {sets, isEmojis} = this;\n let isAdd: boolean, buttonAppend: HTMLElement;\n if(sets.length === 1) {\n const firstSet = sets[0];\n buttonAppend = i18n(isEmojis ? 'EmojiCount' : 'Stickers', [firstSet.count]);\n isAdd = !firstSet.installed_date;\n } else {\n const installed = sets.filter((set) => set.installed_date);\n let count: number;\n if(sets.length === installed.length) {\n isAdd = false;\n count = sets.length;\n } else {\n isAdd = true;\n count = sets.length - installed.length;\n }\n\n buttonAppend = i18n('EmojiPackCount', [count]);\n }\n\n this.button.className = isAdd ? 'btn-primary btn-color-primary' : 'btn-primary btn-primary-transparent danger';\n replaceContent(this.button, i18n(isAdd ? 'AddStickersCount' : 'RemoveStickersCount', [buttonAppend]));\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement, {addCancelButton} from '.';\nimport PopupPeer, {PopupPeerButtonCallbackCheckboxes, PopupPeerOptions} from './peer';\nimport rootScope from '../../lib/rootScope';\nimport {FormatterArguments, LangPackKey} from '../../lib/langPack';\nimport wrapPeerTitle from '../wrappers/peerTitle';\n\nexport default class PopupPinMessage {\n constructor(private peerId: PeerId, private mid: number, private unpin?: true, private onConfirm?: () => void) {\n this.construct();\n }\n\n private async construct() {\n const {peerId, mid, unpin, onConfirm} = this;\n let title: LangPackKey, description: LangPackKey, descriptionArgs: FormatterArguments;\n const buttons: PopupPeerOptions['buttons'] = [], checkboxes: PopupPeerOptions['checkboxes'] = [];\n\n const managers = PopupElement.MANAGERS;\n\n const canUnpin = await managers.appPeersManager.canPinMessage(peerId);\n\n const callback = (checked: PopupPeerButtonCallbackCheckboxes, oneSide?: boolean, silent?: boolean) => {\n setTimeout(() => { // * костыль, потому что document.elementFromPoint вернёт popup-peer пока он будет закрываться\n let promise: Promise;\n if(unpin && !mid) {\n if(canUnpin) {\n promise = managers.appMessagesManager.unpinAllMessages(peerId);\n } else {\n promise = managers.appMessagesManager.hidePinnedMessages(peerId);\n }\n } else {\n promise = managers.appMessagesManager.updatePinnedMessage(peerId, mid, unpin, silent, oneSide);\n }\n\n if(onConfirm) {\n promise.then(onConfirm);\n }\n }, 300);\n };\n\n if(unpin) {\n let buttonText: LangPackKey = 'UnpinMessage';\n if(!mid) {\n if(canUnpin) {\n title = 'Popup.Unpin.AllTitle';\n description = 'Chat.UnpinAllMessagesConfirmation';\n descriptionArgs = ['' + ((await managers.appMessagesManager.getPinnedMessagesCount(peerId)) || 1)];\n } else {\n title = 'Popup.Unpin.HideTitle';\n description = 'Popup.Unpin.HideDescription';\n buttonText = 'Popup.Unpin.Hide';\n }\n } else {\n title = 'UnpinMessageAlertTitle';\n description = 'Chat.Confirm.Unpin';\n }\n\n buttons.push({\n langKey: buttonText,\n isDanger: true,\n callback\n });\n } else {\n title = 'PinMessageAlertTitle';\n const pinButtonText: LangPackKey = 'PinMessage';\n\n if(peerId.isAnyChat()) {\n buttons.push({\n langKey: pinButtonText,\n callback: (checked) => callback(checked, false, !checked.size)\n });\n\n if(await managers.appChatsManager.isBroadcast(peerId.toChatId())) {\n description = 'PinMessageAlertChannel';\n } else {\n description = 'PinMessageAlert';\n\n checkboxes.push({\n text: 'PinNotify',\n checked: true\n });\n }\n } else {\n description = 'PinMessageAlertChat';\n\n if(peerId === rootScope.myId) {\n buttons.push({\n langKey: pinButtonText,\n callback\n });\n } else {\n buttons.push({\n langKey: pinButtonText,\n callback: (checked) => callback(checked, !checked.size)\n });\n\n checkboxes.push({\n text: 'PinAlsoFor',\n textArgs: [await wrapPeerTitle({peerId})],\n checked: true\n });\n }\n }\n }\n\n addCancelButton(buttons);\n\n const popup = new PopupPeer('popup-delete-chat', {\n peerId,\n titleLangKey: title,\n descriptionLangKey: description,\n descriptionLangArgs: descriptionArgs,\n buttons,\n checkboxes\n });\n\n popup.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {CancellablePromise} from '../helpers/cancellablePromise';\nimport SetTransition from './singleTransition';\nimport {fastRaf} from '../helpers/schedulers';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport isInDOM from '../helpers/dom/isInDOM';\nimport safeAssign from '../helpers/object/safeAssign';\n\nconst TRANSITION_TIME = 200;\n\nexport default class ProgressivePreloader {\n public preloader: HTMLDivElement;\n public circle: SVGCircleElement;\n private cancelSvg: SVGSVGElement;\n private downloadSvg: HTMLElement;\n\n private tempId = 0;\n public detached = true;\n\n public promise: CancellablePromise = null;\n\n public isUpload = false;\n private cancelable = true;\n private streamable = false;\n private tryAgainOnFail = true;\n private attachMethod: 'append' | 'prepend' = 'append';\n\n public loadFunc: (e?: Event) => any;\n\n public totalLength: number;\n\n constructor(options?: Partial<{\n isUpload: ProgressivePreloader['isUpload'],\n cancelable: ProgressivePreloader['cancelable'],\n streamable: ProgressivePreloader['streamable'],\n tryAgainOnFail: ProgressivePreloader['tryAgainOnFail'],\n attachMethod: ProgressivePreloader['attachMethod']\n }>) {\n if(options) {\n safeAssign(this, options);\n }\n\n if(this.isUpload) {\n this.tryAgainOnFail = false;\n }\n }\n\n public constructContainer(options: Partial<{\n color: 'transparent',\n bold: boolean\n }> = {}) {\n if(!this.preloader) {\n this.preloader = document.createElement('div');\n this.preloader.classList.add('preloader-container');\n\n if(options.color) {\n this.preloader.classList.add('preloader-' + options.color);\n }\n\n if(options.bold) {\n this.preloader.classList.add('preloader-bold');\n }\n\n if(this.streamable) {\n this.preloader.classList.add('preloader-streamable');\n }\n }\n }\n\n public constructDownloadIcon() {\n this.constructContainer();\n }\n\n public construct() {\n this.construct = null;\n\n this.constructContainer();\n\n this.preloader.innerHTML = `\n
\n \n \n \n
`;\n\n if(this.streamable) {\n this.totalLength = 118.61124420166016;\n } else {\n this.totalLength = 149.82473754882812;\n }\n\n if(this.cancelable) {\n this.preloader.innerHTML += `\n \n \n \n \n \n \n \n \n \n \n \n `;\n\n this.downloadSvg = this.preloader.lastElementChild as HTMLElement;\n this.cancelSvg = this.downloadSvg.previousElementSibling as any;\n } else {\n this.preloader.classList.add('preloader-swing');\n }\n\n this.circle = this.preloader.firstElementChild.firstElementChild.firstElementChild as SVGCircleElement;\n\n if(this.cancelable) {\n attachClickEvent(this.preloader, this.onClick);\n }\n }\n\n public onClick = (e?: Event) => {\n if(e) {\n cancelEvent(e);\n }\n\n if(this.preloader.classList.contains('manual')) {\n this.loadFunc?.(e);\n } else {\n this.promise?.cancel?.();\n }\n };\n\n public setDownloadFunction(func: ProgressivePreloader['loadFunc']) {\n this.loadFunc = func;\n }\n\n public setManual() {\n this.preloader.classList.add('manual');\n this.setProgress(0);\n }\n\n public attachPromise(promise: CancellablePromise) {\n if(this.isUpload && this.promise) return;\n\n this.promise = promise;\n\n const tempId = --this.tempId;\n const startTime = Date.now();\n\n const onEnd = (err: Error) => {\n promise.notify = promise.notifyAll = null;\n\n if(tempId !== this.tempId) {\n return;\n }\n\n const elapsedTime = Date.now() - startTime;\n\n // console.log('[PP]: end', this.detached, performance.now());\n\n if(!err && this.cancelable) {\n this.setProgress(100);\n\n const delay = TRANSITION_TIME * 0.75;\n\n if(elapsedTime < delay) {\n this.detach();\n } else {\n setTimeout(() => { // * wait for transition complete\n if(tempId === this.tempId) {\n this.detach();\n }\n }, delay);\n }\n } else {\n if(this.tryAgainOnFail) {\n this.attach(this.preloader.parentElement);\n fastRaf(() => {\n this.setManual();\n });\n } else {\n this.detach();\n }\n }\n\n this.promise = promise = null;\n };\n\n promise\n .then(() => onEnd(null))\n .catch((err) => onEnd(err));\n\n if(promise.addNotifyListener) {\n promise.addNotifyListener((details: {done: number, total: number}) => {\n /* if(details.done >= details.total) {\n onEnd();\n } */\n\n if(tempId !== this.tempId) return;\n\n // console.log('preloader download', promise, details);\n const percents = details.done / details.total * 100;\n this.setProgress(percents);\n });\n }\n }\n\n public attach(elem: Element, reset = false, promise?: CancellablePromise) {\n this.construct?.();\n\n if(this.preloader.parentElement) {\n this.preloader.classList.remove('manual');\n }\n\n this.detached = false;\n\n if(promise/* && false */) {\n this.attachPromise(promise);\n }\n\n let useRafs = 0;\n if(this.detached || this.preloader.parentElement !== elem) {\n useRafs = isInDOM(this.preloader) ? 1 : 2;\n if(this.preloader.parentElement !== elem) {\n elem[this.attachMethod](this.preloader);\n }\n }\n\n SetTransition({\n element: this.preloader,\n className: 'is-visible',\n forwards: true,\n duration: TRANSITION_TIME,\n useRafs\n });\n\n if(this.cancelable && reset) {\n this.setProgress(0);\n }\n }\n\n public detach() {\n if(this.detached) {\n return;\n }\n // return;\n\n this.detached = true;\n\n // return;\n\n if(this.preloader?.parentElement) {\n /* setTimeout(() => */// fastRaf(() => {\n /* if(!this.detached) return;\n this.detached = true; */\n\n // fastRaf(() => {\n // console.log('[PP]: detach after rAF', this.detached, performance.now());\n\n // if(!this.detached || !this.preloader.parentElement) {\n // return;\n // }\n\n SetTransition({\n element: this.preloader,\n className: 'is-visible',\n forwards: false,\n duration: TRANSITION_TIME,\n onTransitionEnd: () => {\n this.preloader.remove();\n },\n useRafs: 1\n });\n // });\n // })/* , 5e3) */;\n }\n }\n\n public setProgress(percents: number) {\n if(!this.totalLength && !isInDOM(this.circle)) {\n return;\n }\n\n if(percents === 0) {\n this.circle.style.strokeDasharray = '';\n return;\n }\n\n try {\n this.totalLength ||= this.circle.getTotalLength();\n\n // console.log('setProgress', (percents / 100 * totalLength));\n this.circle.style.strokeDasharray = '' + Math.max(5, percents / 100 * this.totalLength) + ', ' + this.totalLength;\n } catch(err) {}\n }\n}\n","/*\nThis file is part of Telegram Desktop,\nthe official desktop application for the Telegram messaging service.\nFor license and copyright information please follow this link:\nhttps://github.com/telegramdesktop/tdesktop/blob/master/LEGAL\n*/\n\nimport accumulate from '../helpers/array/accumulate';\nimport clamp from '../helpers/number/clamp';\n\ntype Size = {w: number, h: number};\nexport type GroupMediaLayout = {\n geometry: {\n x: number,\n y: number,\n width: number,\n height: number\n },\n sides: number\n};\ntype Attempt = {\n lineCounts: number[],\n heights: number[]\n};\nexport const RectPart = {\n None: 0,\n Top: 1,\n Right: 2,\n Bottom: 4,\n Left: 8\n};\n\n// https://github.com/telegramdesktop/tdesktop/blob/4669c07dc5335cbf4795bbbe5b0ab7c007b9aee2/Telegram/SourceFiles/ui/grouped_layout.cpp\nexport class Layouter {\n private count: number;\n private ratios: number[];\n private proportions: string;\n private averageRatio: number;\n private maxSizeRatio: number;\n\n constructor(private sizes: Size[], private maxWidth: number, private minWidth: number, private spacing: number, private maxHeight = maxWidth) {\n this.count = sizes.length;\n this.ratios = Layouter.countRatios(sizes);\n this.proportions = Layouter.countProportions(this.ratios);\n this.averageRatio = accumulate(this.ratios, 1) / this.count; // warn\n this.maxSizeRatio = maxWidth / this.maxHeight;\n }\n\n public layout(): GroupMediaLayout[] {\n if(!this.count) return [];\n // else if(this.count === 1) return this.layoutOne();\n\n if(this.count >= 5 || this.ratios.find((r) => r > 2)) {\n return new ComplexLayouter(this.ratios, this.averageRatio, this.maxWidth, this.minWidth, this.spacing).layout();\n }\n\n if(this.count === 2) return this.layoutTwo();\n else if(this.count === 3) return this.layoutThree();\n return this.layoutFour();\n }\n\n private layoutTwo(): ReturnType {\n if((this.proportions === 'ww') &&\n (this.averageRatio > 1.4 * this.maxSizeRatio) &&\n (this.ratios[1] - this.ratios[0] < 0.2)) {\n return this.layoutTwoTopBottom();\n } else if(this.proportions === 'ww' || this.proportions === 'qq') {\n return this.layoutTwoLeftRightEqual();\n }\n return this.layoutTwoLeftRight();\n }\n\n private layoutThree(): ReturnType {\n // console.log('layoutThree:', this);\n if(this.proportions[0] === 'n') {\n return this.layoutThreeLeftAndOther();\n }\n return this.layoutThreeTopAndOther();\n }\n\n private layoutFour(): ReturnType {\n if(this.proportions[0] === 'w') {\n return this.layoutFourTopAndOther();\n }\n return this.layoutFourLeftAndOther();\n }\n\n private layoutTwoTopBottom(): ReturnType {\n const width = this.maxWidth;\n const height = Math.round(Math.min(\n width / this.ratios[0],\n Math.min(\n width / this.ratios[1],\n (this.maxHeight - this.spacing) / 2)));\n\n return [\n {\n geometry: {x: 0, y: 0, width, height},\n sides: RectPart.Left | RectPart.Top | RectPart.Right\n },\n {\n geometry: {x: 0, y: height + this.spacing, width, height},\n sides: RectPart.Left | RectPart.Bottom | RectPart.Right\n }\n ];\n }\n\n private layoutTwoLeftRightEqual(): ReturnType {\n const width = (this.maxWidth - this.spacing) / 2;\n const height = Math.round(Math.min(\n width / this.ratios[0],\n Math.min(width / this.ratios[1], this.maxHeight * 1)));\n\n return [\n {\n geometry: {x: 0, y: 0, width, height},\n sides: RectPart.Top | RectPart.Left | RectPart.Bottom\n },\n {\n geometry: {x: width + this.spacing, y: 0, width, height},\n sides: RectPart.Top | RectPart.Right | RectPart.Bottom\n }\n ];\n }\n\n private layoutTwoLeftRight(): ReturnType {\n const minimalWidth = Math.round(this.minWidth * 1.5);\n const secondWidth = Math.min(\n Math.round(Math.max(\n 0.4 * (this.maxWidth - this.spacing),\n (this.maxWidth - this.spacing) / this.ratios[0] /\n (1 / this.ratios[0] + 1 / this.ratios[1]))),\n this.maxWidth - this.spacing - minimalWidth);\n const firstWidth = this.maxWidth -\n secondWidth -\n this.spacing;\n const height = Math.min(\n this.maxHeight,\n Math.round(Math.min(\n firstWidth / this.ratios[0],\n secondWidth / this.ratios[1])));\n\n return [\n {\n geometry: {x: 0, y: 0, width: firstWidth, height},\n sides: RectPart.Top | RectPart.Left | RectPart.Bottom\n },\n {\n geometry: {x: firstWidth + this.spacing, y: 0, width: secondWidth, height},\n sides: RectPart.Top | RectPart.Right | RectPart.Bottom\n }\n ];\n }\n\n private layoutThreeLeftAndOther(): ReturnType {\n const firstHeight = this.maxHeight;\n const thirdHeight = Math.round(Math.min(\n (this.maxHeight - this.spacing) / 2.,\n (this.ratios[1] * (this.maxWidth - this.spacing) /\n (this.ratios[2] + this.ratios[1]))));\n const secondHeight = firstHeight -\n thirdHeight -\n this.spacing;\n const rightWidth = Math.max(\n this.minWidth,\n Math.round(Math.min(\n (this.maxWidth - this.spacing) / 2.,\n Math.min(\n thirdHeight * this.ratios[2],\n secondHeight * this.ratios[1]))));\n const leftWidth = Math.min(\n Math.round(firstHeight * this.ratios[0]),\n this.maxWidth - this.spacing - rightWidth);\n\n return [\n {\n geometry: {x: 0, y: 0, width: leftWidth, height: firstHeight},\n sides: RectPart.Top | RectPart.Left | RectPart.Bottom\n },\n {\n geometry: {x: leftWidth + this.spacing, y: 0, width: rightWidth, height: secondHeight},\n sides: RectPart.Top | RectPart.Right\n },\n {\n geometry: {x: leftWidth + this.spacing, y: secondHeight + this.spacing, width: rightWidth, height: thirdHeight},\n sides: RectPart.Bottom | RectPart.Right\n }\n ];\n }\n\n private layoutThreeTopAndOther(): ReturnType {\n const firstWidth = this.maxWidth;\n const firstHeight = Math.round(Math.min(\n firstWidth / this.ratios[0],\n (this.maxHeight - this.spacing) * 0.66));\n const secondWidth = (this.maxWidth - this.spacing) / 2;\n const secondHeight = Math.min(\n this.maxHeight - firstHeight - this.spacing,\n Math.round(Math.min(\n secondWidth / this.ratios[1],\n secondWidth / this.ratios[2])));\n const thirdWidth = firstWidth - secondWidth - this.spacing;\n\n return [\n {\n geometry: {x: 0, y: 0, width: firstWidth, height: firstHeight},\n sides: RectPart.Left | RectPart.Top | RectPart.Right\n },\n {\n geometry: {x: 0, y: firstHeight + this.spacing, width: secondWidth, height: secondHeight},\n sides: RectPart.Bottom | RectPart.Left\n },\n {\n geometry: {x: secondWidth + this.spacing, y: firstHeight + this.spacing, width: thirdWidth, height: secondHeight},\n sides: RectPart.Bottom | RectPart.Right\n }\n ];\n }\n\n private layoutFourTopAndOther(): ReturnType {\n const w = this.maxWidth;\n const h0 = Math.round(Math.min(\n w / this.ratios[0],\n (this.maxHeight - this.spacing) * 0.66));\n const h = Math.round(\n (this.maxWidth - 2 * this.spacing) /\n (this.ratios[1] + this.ratios[2] + this.ratios[3]));\n const w0 = Math.max(\n this.minWidth,\n Math.round(Math.min(\n (this.maxWidth - 2 * this.spacing) * 0.4,\n h * this.ratios[1])));\n const w2 = Math.round(Math.max(\n Math.max(\n this.minWidth * 1.,\n (this.maxWidth - 2 * this.spacing) * 0.33),\n h * this.ratios[3]));\n const w1 = w - w0 - w2 - 2 * this.spacing;\n const h1 = Math.min(\n this.maxHeight - h0 - this.spacing,\n h);\n\n return [\n {\n geometry: {x: 0, y: 0, width: w, height: h0},\n sides: RectPart.Left | RectPart.Top | RectPart.Right\n },\n {\n geometry: {x: 0, y: h0 + this.spacing, width: w0, height: h1},\n sides: RectPart.Bottom | RectPart.Left\n },\n {\n geometry: {x: w0 + this.spacing, y: h0 + this.spacing, width: w1, height: h1},\n sides: RectPart.Bottom\n },\n {\n geometry: {x: w0 + this.spacing + w1 + this.spacing, y: h0 + this.spacing, width: w2, height: h1},\n sides: RectPart.Right | RectPart.Bottom\n }\n ];\n }\n\n private layoutFourLeftAndOther(): ReturnType {\n const h = this.maxHeight;\n const w0 = Math.round(Math.min(\n h * this.ratios[0],\n (this.maxWidth - this.spacing) * 0.6));\n\n const w = Math.round(\n (this.maxHeight - 2 * this.spacing) /\n (1. / this.ratios[1] + 1. / this.ratios[2] + 1. / this.ratios[3])\n );\n const h0 = Math.round(w / this.ratios[1]);\n const h1 = Math.round(w / this.ratios[2]);\n const h2 = h - h0 - h1 - 2 * this.spacing;\n const w1 = Math.max(\n this.minWidth,\n Math.min(this.maxWidth - w0 - this.spacing, w));\n\n return [\n {\n geometry: {x: 0, y: 0, width: w0, height: h},\n sides: RectPart.Top | RectPart.Left | RectPart.Bottom\n },\n {\n geometry: {x: w0 + this.spacing, y: 0, width: w1, height: h0},\n sides: RectPart.Top | RectPart.Right\n },\n {\n geometry: {x: w0 + this.spacing, y: h0 + this.spacing, width: w1, height: h1},\n sides: RectPart.Right\n },\n {\n geometry: {x: w0 + this.spacing, y: h0 + h1 + 2 * this.spacing, width: w1, height: h2},\n sides: RectPart.Bottom | RectPart.Right\n }\n ];\n }\n\n private static countRatios(sizes: Size[]) {\n return sizes.map((size) => size.w / size.h);\n }\n\n private static countProportions(ratios: number[]) {\n return ratios.map((ratio) => (ratio > 1.2) ? 'w' : (ratio < 0.8) ? 'n' : 'q').join('');\n }\n}\n\nclass ComplexLayouter {\n private ratios: number[];\n private count: number;\n\n constructor(ratios: number[], private averageRatio: number, private maxWidth: number, private minWidth: number, private spacing: number, private maxHeight = maxWidth * 4 / 3) {\n this.ratios = ComplexLayouter.cropRatios(ratios, averageRatio);\n this.count = ratios.length;\n }\n\n private static cropRatios(ratios: number[], averageRatio: number) {\n const kMaxRatio = 2.75;\n const kMinRatio = 0.6667;\n return ratios.map((ratio) => {\n return averageRatio > 1.1 ?\n clamp(ratio, 1., kMaxRatio) :\n clamp(ratio, kMinRatio, 1.);\n });\n }\n\n public layout(): GroupMediaLayout[] {\n const result = new Array(this.count);\n\n const attempts: Attempt[] = [];\n const multiHeight = (offset: number, count: number) => {\n const ratios = this.ratios.slice(offset, offset + count); // warn\n const sum = accumulate(ratios, 0);\n return (this.maxWidth - (count - 1) * this.spacing) / sum;\n };\n const pushAttempt = (lineCounts: number[]) => {\n const heights: number[] = [];\n let offset = 0;\n for(const count of lineCounts) {\n heights.push(multiHeight(offset, count));\n offset += count;\n }\n attempts.push({lineCounts, heights}); // warn\n };\n\n for(let first = 1; first !== this.count; ++first) {\n const second = this.count - first;\n if(first > 3 || second > 3) {\n continue;\n }\n pushAttempt([first, second]);\n }\n for(let first = 1; first !== this.count - 1; ++first) {\n for(let second = 1; second !== this.count - first; ++second) {\n const third = this.count - first - second;\n if((first > 3) ||\n (second > ((this.averageRatio < 0.85) ? 4 : 3)) ||\n (third > 3)) {\n continue;\n }\n pushAttempt([first, second, third]);\n }\n }\n for(let first = 1; first !== this.count - 1; ++first) {\n for(let second = 1; second !== this.count - first; ++second) {\n for(let third = 1; third !== this.count - first - second; ++third) {\n const fourth = this.count - first - second - third;\n if(first > 3 || second > 3 || third > 3 || fourth > 3) {\n continue;\n }\n pushAttempt([first, second, third, fourth]);\n }\n }\n }\n\n let optimalAttempt: Attempt = null;\n let optimalDiff = 0;\n for(const attempt of attempts) {\n const {heights, lineCounts: counts} = attempt;\n const lineCount = counts.length;\n const totalHeight = accumulate(heights, 0) +\n this.spacing * (lineCount - 1);\n const minLineHeight = Math.min(...heights);\n const maxLineHeight = Math.max(...heights);\n const bad1 = (minLineHeight < this.minWidth) ? 1.5 : 1;\n const bad2 = (() => {\n for(let line = 1; line !== lineCount; ++line) {\n if(counts[line - 1] > counts[line]) {\n return 1.5;\n }\n }\n return 1.;\n })();\n const diff = Math.abs(totalHeight - this.maxHeight) * bad1 * bad2;\n if(!optimalAttempt || diff < optimalDiff) {\n optimalAttempt = attempt;\n optimalDiff = diff;\n }\n }\n\n const optimalCounts = optimalAttempt.lineCounts;\n const optimalHeights = optimalAttempt.heights;\n const rowCount = optimalCounts.length;\n\n let index = 0;\n let y = 0;\n for(let row = 0; row !== rowCount; ++row) {\n const colCount = optimalCounts[row];\n const lineHeight = optimalHeights[row];\n const height = Math.round(lineHeight);\n\n let x = 0;\n for(let col = 0; col !== colCount; ++col) {\n const sides = RectPart.None |\n (row === 0 ? RectPart.Top : RectPart.None) |\n (row === rowCount - 1 ? RectPart.Bottom : RectPart.None) |\n (col === 0 ? RectPart.Left : RectPart.None) |\n (col === colCount - 1 ? RectPart.Right : RectPart.None);\n\n const ratio = this.ratios[index];\n const width = (col === colCount - 1) ?\n (this.maxWidth - x) :\n Math.round(ratio * lineHeight);\n result[index] = {\n geometry: {x, y, width, height},\n sides\n };\n\n x += width + this.spacing;\n ++index;\n }\n y += height + this.spacing;\n }\n\n return result;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Layouter, RectPart} from './groupedLayout';\n\nexport default function prepareAlbum(options: {\n container: HTMLElement,\n items: {w: number, h: number}[],\n maxWidth: number,\n minWidth: number,\n spacing: number,\n maxHeight?: number,\n forMedia?: true\n}) {\n const layouter = new Layouter(options.items, options.maxWidth, options.minWidth, options.spacing, options.maxHeight);\n const layout = layouter.layout();\n\n const widthItem = layout.find((item) => item.sides & RectPart.Right);\n const width = widthItem.geometry.width + widthItem.geometry.x;\n\n const heightItem = layout.find((item) => item.sides & RectPart.Bottom);\n const height = heightItem.geometry.height + heightItem.geometry.y;\n\n const container = options.container;\n container.style.width = width + 'px';\n container.style.height = height + 'px';\n const children = container.children;\n\n layout.forEach(({geometry, sides}, idx) => {\n let div: HTMLElement;\n div = children[idx] as HTMLElement;\n if(!div) {\n div = document.createElement('div');\n container.append(div);\n }\n\n div.classList.add('album-item', 'grouped-item');\n\n div.style.width = (geometry.width / width * 100) + '%';\n div.style.height = (geometry.height / height * 100) + '%';\n div.style.top = (geometry.y / height * 100) + '%';\n div.style.left = (geometry.x / width * 100) + '%';\n\n if(sides & RectPart.Left && sides & RectPart.Top) {\n div.style.borderTopLeftRadius = 'inherit';\n }\n\n if(sides & RectPart.Left && sides & RectPart.Bottom) {\n div.style.borderBottomLeftRadius = 'inherit';\n }\n\n if(sides & RectPart.Right && sides & RectPart.Top) {\n div.style.borderTopRightRadius = 'inherit';\n }\n\n if(sides & RectPart.Right && sides & RectPart.Bottom) {\n div.style.borderBottomRightRadius = 'inherit';\n }\n\n if(options.forMedia) {\n const mediaDiv = document.createElement('div');\n mediaDiv.classList.add('album-item-media');\n\n div.append(mediaDiv);\n }\n\n // @ts-ignore\n // div.style.backgroundColor = '#' + Math.floor(Math.random() * (2 ** 24 - 1)).toString(16).padStart(6, '0');\n });\n\n /* if(options.forMedia) {\n layout.forEach((_, i) => {\n const mediaDiv = document.createElement('div');\n mediaDiv.classList.add('album-item-media');\n\n options.container.children[i].append(mediaDiv);\n });\n } */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {PeerPhotoSize} from '../lib/appManagers/appAvatarsManager';\nimport getPreviewURLFromBytes from '../helpers/bytes/getPreviewURLFromBytes';\nimport {renderImageFromUrlPromise} from '../helpers/dom/renderImageFromUrl';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport setInnerHTML from '../helpers/dom/setInnerHTML';\nimport {recordPromise} from '../helpers/recordPromise';\nimport sequentialDom from '../helpers/sequentialDom';\nimport {UserProfilePhoto, ChatPhoto, User, Chat} from '../layer';\nimport getPeerColorById from '../lib/appManagers/utils/peers/getPeerColorById';\nimport getPeerPhoto from '../lib/appManagers/utils/peers/getPeerPhoto';\nimport {NULL_PEER_ID, REPLIES_PEER_ID} from '../lib/mtproto/mtproto_config';\nimport wrapAbbreviation from '../lib/richTextProcessor/wrapAbbreviation';\nimport rootScope from '../lib/rootScope';\nimport getPeerInitials from './wrappers/getPeerInitials';\nimport {wrapTopicIcon} from './wrappers/messageActionTextNewUnsafe';\nimport makeError from '../helpers/makeError';\nimport noop from '../helpers/noop';\nimport liteMode from '../helpers/liteMode';\n\nexport async function putAvatar(\n div: HTMLElement,\n peerId: PeerId,\n photo: UserProfilePhoto.userProfilePhoto | ChatPhoto.chatPhoto,\n size: PeerPhotoSize,\n img = new Image(),\n onlyThumb = false\n) {\n const r = await rootScope.managers.acknowledged.appAvatarsManager.loadAvatar(peerId, photo, size);\n const loadPromise = r.result;\n const cached = r.cached;\n\n img.classList.add('avatar-photo');\n\n let renderThumbPromise: Promise;\n let callback: () => void;\n let thumbImage: HTMLImageElement;\n if(cached) {\n // смотри в misc.ts: renderImageFromUrl\n callback = () => {\n replaceContent(div, img);\n div.dataset.color = '';\n };\n } else {\n const animate = liteMode.isAvailable('animations');\n if(animate) {\n img.classList.add('fade-in');\n }\n\n let isFullLoaded = false;\n if(size === 'photo_big') { // let's load small photo first\n const res = await putAvatar(div, peerId, photo, 'photo_small');\n renderThumbPromise = res.loadThumbPromise || res.loadPromise;\n thumbImage = res.thumbImage;\n } else if(photo.stripped_thumb) {\n thumbImage = new Image();\n div.classList.add('avatar-relative');\n thumbImage.classList.add('avatar-photo', 'avatar-photo-thumbnail');\n const url = getPreviewURLFromBytes(photo.stripped_thumb);\n renderThumbPromise = renderImageFromUrlPromise(thumbImage, url).then(() => {\n if(isFullLoaded) {\n return;\n }\n\n replaceContent(div, thumbImage);\n });\n }\n\n callback = () => {\n isFullLoaded = true;\n\n if(thumbImage) {\n div.append(img);\n } else {\n replaceContent(div, img);\n }\n\n setTimeout(() => {\n if(div.childElementCount) {\n sequentialDom.mutateElement(img, () => {\n div.dataset.color = '';\n\n if(animate) {\n img.classList.remove('fade-in');\n }\n\n thumbImage?.remove();\n });\n }\n }, animate ? 200 : 0);\n };\n }\n\n const renderPromise = loadPromise\n .then((url) => renderImageFromUrlPromise(img, url/* , !cached */))\n .then(callback);\n\n renderThumbPromise && await renderThumbPromise.catch(noop);\n\n return {\n cached,\n loadPromise: renderPromise,\n loadThumbPromise: cached ? renderPromise : renderThumbPromise || Promise.resolve(),\n thumbImage\n };\n}\n\nfunction set(\n div: HTMLElement,\n innerHTML: Parameters[1],\n color: string,\n icon?: string,\n isForum?: boolean,\n isTopic?: boolean\n) {\n setInnerHTML(div, innerHTML);\n div.dataset.color = color;\n div.classList.remove('tgico-saved', 'tgico-deletedaccount', 'tgico-reply_filled', 'is-forum', 'is-topic');\n icon && div.classList.add(icon);\n isForum && div.classList.add('is-forum');\n isTopic && div.classList.add('is-topic');\n}\n\n// peerId === peerId || title\nexport default async function putPhoto({\n div,\n peerId,\n isDialog = false,\n title = '',\n onlyThumb = false,\n isBig,\n threadId,\n wrapOptions = {}\n}: {\n div: HTMLElement,\n peerId: PeerId,\n isDialog?: boolean,\n title?: string,\n onlyThumb?: boolean,\n isBig?: boolean,\n threadId?: number,\n wrapOptions?: WrapSomethingOptions\n}) {\n const myId = rootScope.myId;\n\n if(peerId === myId && isDialog) {\n set(div, '', '', 'tgico-saved');\n return;\n }\n\n const managers = rootScope.managers;\n\n if(threadId) {\n const topic = await managers.dialogsStorage.getForumTopic(peerId, threadId);\n set(div, '', '', undefined, undefined, true);\n\n if(wrapOptions.customEmojiSize) {\n div.style.setProperty('--size', wrapOptions.customEmojiSize.width + 'px');\n }\n\n return wrapTopicIcon({\n ...wrapOptions,\n topic,\n lazyLoadQueue: false\n }).then((icon) => {\n div.replaceChildren(icon);\n });\n }\n\n const peer = await managers.appPeersManager.getPeer(peerId);\n if(peerId !== NULL_PEER_ID && peerId.isUser() && (peer as User.user)?.pFlags?.deleted) {\n set(div, '', getPeerColorById(peerId), 'tgico-deletedaccount');\n return;\n }\n\n const isForum = !!(peer as Chat.channel)?.pFlags?.forum;\n const size: PeerPhotoSize = isBig ? 'photo_big' : 'photo_small';\n const photo = getPeerPhoto(peer);\n const avatarAvailable = !!photo;\n const avatarRendered = !!div.firstElementChild && !(div.firstElementChild as HTMLElement).classList.contains('emoji');\n if(!avatarAvailable || !avatarRendered || !(await managers.appAvatarsManager.isAvatarCached(peerId, size))) {\n let color = '';\n if(peerId && (peerId !== myId || !isDialog)) {\n color = getPeerColorById(peerId);\n }\n\n if(peerId === REPLIES_PEER_ID) {\n set(div, '', color, 'tgico-reply_filled');\n return;\n }\n\n const abbr = title ? wrapAbbreviation(title) : getPeerInitials(peer);\n set(div, abbr, color, '', isForum);\n // return Promise.resolve(true);\n }\n\n if(avatarAvailable/* && false */) {\n const promise = putAvatar(div, peerId, photo, size, undefined, onlyThumb);\n // recordPromise(promise, 'putAvatar-' + peerId);\n return promise;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Chat, User} from '../../layer';\nimport wrapAbbreviation from '../../lib/richTextProcessor/wrapAbbreviation';\n\nexport default function getPeerInitials(peer: Chat | User) {\n let str = '';\n if(peer) {\n str = (peer as Chat.chat).title ?? [\n (peer as User.user).first_name,\n (peer as User.user).last_name\n ].filter(Boolean).join(' ');\n }\n\n return wrapAbbreviation(str);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\n\nexport function putPreloader(elem: Element, returnDiv = false): HTMLElement {\n const html = `\n \n \n `;\n\n if(returnDiv) {\n const div = document.createElement('div');\n div.classList.add('preloader');\n div.innerHTML = html;\n\n if(elem) {\n elem.appendChild(div);\n }\n\n return div;\n }\n\n elem.insertAdjacentHTML('beforeend', html);\n return elem.lastElementChild as HTMLElement;\n}\n\nMOUNT_CLASS_TO.putPreloader = putPreloader;\n\nexport function setButtonLoader(elem: HTMLButtonElement, icon = 'check') {\n elem.classList.remove('tgico-' + icon);\n elem.disabled = true;\n putPreloader(elem);\n\n return () => {\n elem.innerHTML = '';\n elem.classList.add('tgico-' + icon);\n elem.removeAttribute('disabled');\n };\n}\n\n/* export function parseMenuButtonsTo(to: {[name: string]: HTMLElement}, elements: HTMLCollection | NodeListOf) {\n Array.from(elements).forEach((el) => {\n const match = el.className.match(/(?:^|\\s)menu-(.+?)(?:$|\\s)/);\n if(!match) return;\n to[match[1]] = el as HTMLElement;\n });\n} */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport simulateEvent from '../helpers/dom/dispatchEvent';\nimport getDeepProperty from '../helpers/object/getDeepProperty';\nimport {LangPackKey, _i18n} from '../lib/langPack';\nimport apiManagerProxy from '../lib/mtproto/mtprotoworker';\nimport rootScope from '../lib/rootScope';\n\nexport default class RadioField {\n public input: HTMLInputElement;\n public label: HTMLLabelElement;\n public main: HTMLElement;\n\n constructor(options: {\n text?: string,\n langKey?: LangPackKey,\n name: string,\n value?: string,\n stateKey?: string,\n alignRight?: boolean\n }) {\n const label = this.label = document.createElement('label');\n label.classList.add('radio-field');\n\n if(options.alignRight) {\n label.classList.add('radio-field-right');\n }\n\n const input = this.input = document.createElement('input');\n input.type = 'radio';\n /* input.id = */input.name = 'input-radio-' + options.name;\n\n if(options.value) {\n input.value = options.value;\n\n if(options.stateKey) {\n apiManagerProxy.getState().then((state) => {\n input.checked = getDeepProperty(state, options.stateKey) === options.value;\n });\n\n input.addEventListener('change', () => {\n rootScope.managers.appStateManager.setByKey(options.stateKey, options.value);\n });\n }\n }\n\n const main = this.main = document.createElement('div');\n main.classList.add('radio-field-main');\n\n if(options.text) {\n main.innerHTML = options.text;\n /* const caption = document.createElement('div');\n caption.classList.add('radio-field-main-caption');\n caption.innerHTML = text;\n\n if(subtitle) {\n label.classList.add('radio-field-with-subtitle');\n caption.insertAdjacentHTML('beforeend', `
${subtitle}
`);\n }\n\n main.append(caption); */\n } else if(options.langKey) {\n _i18n(main, options.langKey);\n }\n\n label.append(input, main);\n }\n\n get checked() {\n return this.input.checked;\n }\n\n set checked(checked: boolean) {\n this.setValueSilently(checked);\n simulateEvent(this.input, 'change');\n }\n\n public setValueSilently(checked: boolean) {\n this.input.checked = checked;\n }\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function RadioForm(radios: {container: HTMLElement, input: HTMLInputElement}[], onChange: (value: string, event: Event) => void) {\n const form = document.createElement('form');\n\n radios.forEach((r) => {\n const {container, input} = r;\n form.append(container);\n input.addEventListener('change', (e) => {\n if(input.checked) {\n onChange(input.value, e);\n }\n });\n });\n\n return form;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport attachGrabListeners, {GrabEvent} from '../helpers/dom/attachGrabListeners';\nimport clamp from '../helpers/number/clamp';\nimport safeAssign from '../helpers/object/safeAssign';\n\nexport default class RangeSelector {\n public container: HTMLDivElement;\n protected filled: HTMLDivElement;\n protected seek: HTMLInputElement;\n\n public mousedown = false;\n protected rect: DOMRect;\n protected _removeListeners: () => void;\n\n private events: Partial<{\n // onMouseMove: ProgressLine['onMouseMove'],\n onMouseDown: RangeSelector['onMouseDown'],\n onMouseUp: RangeSelector['onMouseUp'],\n onScrub: (value: number) => void\n }> = {};\n\n protected decimals: number;\n\n protected step: number;\n protected min: number;\n protected max: number;\n protected withTransition = false;\n protected useTransform = false;\n protected vertical = false;\n\n constructor(\n options: {\n step: RangeSelector['step'],\n min: RangeSelector['min'],\n max: RangeSelector['max'],\n withTransition?: RangeSelector['withTransition'],\n useTransform?: RangeSelector['useTransform'],\n vertical?: RangeSelector['vertical']\n },\n value = 0\n ) {\n safeAssign(this, options);\n\n this.container = document.createElement('div');\n this.container.classList.add('progress-line');\n\n // there is no sense in using transition with transform, because it is updating every frame\n if(this.useTransform) {\n this.container.classList.add('use-transform');\n } else if(this.withTransition) {\n this.container.classList.add('with-transition');\n }\n\n this.filled = document.createElement('div');\n this.filled.classList.add('progress-line__filled');\n\n const seek = this.seek = document.createElement('input');\n seek.classList.add('progress-line__seek');\n // seek.setAttribute('max', '0');\n seek.type = 'range';\n seek.step = '' + this.step;\n seek.min = '' + this.min;\n seek.max = '' + this.max;\n seek.value = '' + value;\n\n if(value) {\n this.setProgress(value);\n }\n\n const stepStr = '' + this.step;\n const index = stepStr.indexOf('.');\n this.decimals = index === -1 ? 0 : stepStr.length - index - 1;\n\n // this.setListeners();\n\n this.container.append(this.filled, seek);\n }\n\n get value() {\n return +this.seek.value;\n }\n\n public setHandlers(events: RangeSelector['events']) {\n this.events = events;\n }\n\n protected onMouseMove = (event: GrabEvent) => {\n this.scrub(event);\n };\n\n protected onMouseDown = (event: GrabEvent) => {\n this.rect = this.container.getBoundingClientRect();\n this.mousedown = true;\n this.scrub(event);\n this.container.classList.add('is-focused');\n this.events?.onMouseDown && this.events.onMouseDown(event);\n };\n\n protected onMouseUp = (event: GrabEvent) => {\n this.mousedown = false;\n this.container.classList.remove('is-focused');\n this.events?.onMouseUp && this.events.onMouseUp(event);\n };\n\n public setListeners() {\n this.seek.addEventListener('input', this.onInput);\n this._removeListeners = attachGrabListeners(this.container, this.onMouseDown, this.onMouseMove, this.onMouseUp);\n }\n\n public onInput = () => {\n const value = +this.seek.value;\n this.setFilled(value);\n this.events?.onScrub && this.events.onScrub(value);\n };\n\n public setProgress(value: number) {\n this.seek.value = '' + value;\n this.setFilled(+this.seek.value); // clamp\n }\n\n public addProgress(value: number) {\n this.seek.value = '' + (+this.seek.value + value);\n this.setFilled(+this.seek.value); // clamp\n }\n\n public setFilled(value: number) {\n let percents = (value - this.min) / (this.max - this.min);\n percents = clamp(percents, 0, 1);\n\n // using scaleX and width even with vertical because it will be rotated\n if(this.useTransform) {\n this.filled.style.transform = `scaleX(${percents})`;\n } else {\n this.filled.style.width = (percents * 100) + '%';\n }\n }\n\n protected scrub(event: GrabEvent) {\n const rectMax = this.vertical ? this.rect.height : this.rect.width;\n const offsetAxisValue = clamp(this.vertical ? -(event.y - this.rect.bottom) : event.x - this.rect.left, 0, rectMax);\n\n let value = this.min + (offsetAxisValue / rectMax * (this.max - this.min));\n\n if((value - this.min) < ((this.max - this.min) / 2)) {\n value -= this.step / 10;\n }\n\n value = +value.toFixed(this.decimals);\n value = clamp(value, this.min, this.max);\n\n // this.seek.value = '' + value;\n // this.onInput();\n\n this.setProgress(value);\n this.events?.onScrub && this.events.onScrub(value);\n\n return value;\n }\n\n public removeListeners() {\n if(this._removeListeners) {\n this._removeListeners();\n this._removeListeners = null;\n }\n\n this.seek.removeEventListener('input', this.onInput);\n\n this.events = {};\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport sequentialDom from '../helpers/sequentialDom';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport rootScope from '../lib/rootScope';\nimport findUpAsChild from '../helpers/dom/findUpAsChild';\nimport {fastRaf} from '../helpers/schedulers';\nimport liteMode from '../helpers/liteMode';\n\nlet rippleClickId = 0;\nexport default function ripple(\n elem: HTMLElement,\n callback: (id: number) => Promise = () => Promise.resolve(),\n onEnd: (id: number) => void = null,\n prepend = false,\n attachListenerTo = elem\n) {\n // return;\n if(elem.querySelector('.c-ripple')) return;\n elem.classList.add('rp');\n\n const r = document.createElement('div');\n r.classList.add('c-ripple');\n\n const isSquare = elem.classList.contains('rp-square');\n if(isSquare) {\n r.classList.add('is-square');\n }\n\n elem[prepend ? 'prepend' : 'append'](r);\n\n let handler: () => void;\n // let animationEndPromise: Promise;\n const drawRipple = (clientX: number, clientY: number) => {\n const startTime = Date.now();\n const circle = document.createElement('div');\n\n const clickId = rippleClickId++;\n\n // console.log('ripple drawRipple');\n\n // const auto = elem.classList.contains('row-sortable') && !elem.classList.contains('cant-sort');\n const auto = false;\n const duration = (auto ? .3 : +window.getComputedStyle(r).getPropertyValue('--ripple-duration').replace('s', '')) * 1000;\n // console.log('ripple duration', duration);\n\n const _handler = handler = () => {\n // handler = () => animationEndPromise.then((duration) => {\n // console.log('ripple animation was:', duration);\n\n // const duration = isSquare || mediaSizes.isMobile ? 200 : 700;\n // return;\n const elapsedTime = Date.now() - startTime;\n const cb = () => {\n // console.log('ripple elapsedTime total pre-remove:', Date.now() - startTime);\n sequentialDom.mutate(() => {\n circle.remove();\n });\n\n onEnd?.(clickId);\n };\n if(elapsedTime < duration) {\n const delay = Math.max(duration - elapsedTime, duration / 2);\n setTimeout(() => circle.classList.add('hiding'), Math.max(delay - duration / 2, 0));\n\n setTimeout(cb, delay);\n } else {\n circle.classList.add('hiding');\n setTimeout(cb, duration / 2);\n }\n\n if(!IS_TOUCH_SUPPORTED) {\n window.removeEventListener('contextmenu', handler);\n window.removeEventListener('mousemove', handler);\n }\n\n handler = null;\n touchStartFired = false;\n };\n // });\n\n callback?.(clickId);\n\n /* callback().then((bad) => {\n if(bad) {\n span.remove();\n return;\n } */\n\n // console.log('ripple after promise', Date.now() - startTime);\n // console.log('ripple tooSlow:', tooSlow);\n /* if(tooSlow) {\n span.remove();\n return;\n } */\n\n fastRaf(() => {\n if(_handler !== handler) {\n return;\n }\n\n const rect = r.getBoundingClientRect();\n circle.classList.add('c-ripple__circle');\n\n const clickX = clientX - rect.left;\n const clickY = clientY - rect.top;\n\n const radius = Math.sqrt((Math.abs(clickY - rect.height / 2) + rect.height / 2) ** 2 + (Math.abs(clickX - rect.width / 2) + rect.width / 2) ** 2);\n const size = radius;\n\n // center of circle\n const x = clickX - size / 2;\n const y = clickY - size / 2;\n\n // console.log('ripple click', offsetFromCenter, size, clickX, clickY);\n\n circle.style.width = circle.style.height = size + 'px';\n circle.style.left = x + 'px';\n circle.style.top = y + 'px';\n\n // нижний код выполняется с задержкой\n /* animationEndPromise = new Promise((resolve) => {\n span.addEventListener('animationend', () => {\n // 713 -> 700\n resolve(((Date.now() - startTime) / 100 | 0) * 100);\n }, {once: true});\n }); */\n\n // нижний код не всегда включает анимацию ПРИ КЛИКЕ НА ТАЧПАД БЕЗ ТАПТИК ЭНЖИНА\n /* span.style.display = 'none';\n r.append(span);\n duration = +window.getComputedStyle(span).getPropertyValue('animation-duration').replace('s', '') * 1000;\n span.style.display = ''; */\n\n r.append(circle);\n\n if(auto) {\n // window.addEventListener('mousemove', handler, {once: true, passive: true});\n handler();\n }\n\n // r.classList.add('active');\n // handler();\n });\n // });\n };\n\n const isRippleUnneeded = (e: Event) => {\n return e.target !== elem && (\n ['BUTTON', 'A'].includes((e.target as HTMLElement).tagName) ||\n findUpClassName(e.target as HTMLElement, 'c-ripple') !== r\n ) && (\n attachListenerTo === elem ||\n !findUpAsChild(e.target as HTMLElement, attachListenerTo)\n ) && !findUpClassName(e.target, 'checkbox-field');\n };\n\n // TODO: rename this variable\n let touchStartFired = false;\n if(IS_TOUCH_SUPPORTED) {\n const touchEnd = () => {\n handler?.();\n };\n\n attachListenerTo.addEventListener('touchstart', (e) => {\n if(!liteMode.isAvailable('animations')) {\n return;\n }\n\n // console.log('ripple touchstart', e);\n if(e.touches.length > 1 || touchStartFired || isRippleUnneeded(e)) {\n return;\n }\n\n // console.log('touchstart', e);\n touchStartFired = true;\n\n const {clientX, clientY} = e.touches[0];\n drawRipple(clientX, clientY);\n attachListenerTo.addEventListener('touchend', touchEnd, {once: true});\n\n window.addEventListener('touchmove', (e) => {\n e.cancelBubble = true;\n e.stopPropagation();\n touchEnd();\n attachListenerTo.removeEventListener('touchend', touchEnd);\n }, {once: true});\n }, {passive: true});\n } else {\n attachListenerTo.addEventListener('mousedown', (e) => {\n if(![0, 2].includes(e.button)) { // only left and right buttons\n return;\n }\n\n if(!liteMode.isAvailable('animations')) {\n return;\n }\n // console.log('ripple mousedown', e, e.target, findUpClassName(e.target as HTMLElement, 'c-ripple') === r);\n\n if(attachListenerTo.dataset.ripple === '0' || isRippleUnneeded(e)) {\n return;\n } else if(touchStartFired) {\n touchStartFired = false;\n return;\n }\n\n const {clientX, clientY} = e;\n drawRipple(clientX, clientY);\n window.addEventListener('mouseup', handler, {once: true, passive: true});\n window.addEventListener('contextmenu', handler, {once: true, passive: true});\n }, {passive: true});\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport CheckboxField, {CheckboxFieldOptions} from './checkboxField';\nimport RadioField from './radioField';\nimport ripple from './ripple';\nimport {SliderSuperTab} from './slider';\nimport RadioForm from './radioForm';\nimport {i18n, LangPackKey} from '../lib/langPack';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport setInnerHTML, {setDirection} from '../helpers/dom/setInnerHTML';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport Button from './button';\nimport createContextMenu from '../helpers/dom/createContextMenu';\n\ntype K = string | HTMLElement | DocumentFragment | true;\n\nconst setContent = (element: HTMLElement, content: K) => {\n if(content === true) {\n\n } else if(typeof(content) === 'string') {\n setInnerHTML(element, content);\n } else {\n element.append(content);\n }\n};\n\nexport type RowMediaSizeType = 'small' | 'medium' | 'big' | 'abitbigger' | 'bigger';\n\nexport default class Row {\n public container: HTMLElement;\n public title: HTMLElement;\n public titleRow: HTMLElement;\n public titleRight: HTMLElement;\n public media: HTMLElement;\n\n public subtitleRow: HTMLElement;\n public subtitleRight: HTMLElement;\n\n public checkboxField: CheckboxField;\n public radioField: RadioField;\n\n public freezed = false;\n\n public buttonRight: HTMLElement;\n\n private _subtitle: HTMLElement;\n private _midtitle: HTMLElement;\n\n constructor(options: Partial<{\n icon: string,\n subtitle: K,\n subtitleLangKey: LangPackKey,\n subtitleLangArgs: any[],\n subtitleRight: K,\n radioField: Row['radioField'],\n checkboxField: Row['checkboxField'],\n checkboxFieldOptions: CheckboxFieldOptions,\n withCheckboxSubtitle: boolean,\n title: K,\n titleLangKey: LangPackKey,\n titleRight: K,\n titleRightSecondary: K,\n clickable: boolean | ((e: Event) => void),\n navigationTab: SliderSuperTab,\n havePadding: boolean,\n noRipple: boolean,\n noWrap: boolean,\n listenerSetter: ListenerSetter,\n buttonRight?: HTMLElement | boolean,\n buttonRightLangKey: LangPackKey,\n asLink: boolean,\n contextMenu: Omit[0], 'findElement' | 'listenTo' | 'listenerSetter'>\n }> = {}) {\n if(options.checkboxFieldOptions) {\n options.checkboxField = new CheckboxField({\n listenerSetter: options.listenerSetter,\n ...options.checkboxFieldOptions\n });\n }\n\n const tagName = options.asLink ? 'a' : (options.radioField || options.checkboxField ? 'label' : 'div');\n this.container = document.createElement(tagName);\n this.container.classList.add('row', 'no-subtitle');\n\n if(options.noWrap) {\n this.container.classList.add('no-wrap');\n }\n\n if(options.subtitle) {\n const subtitle = this.subtitle;\n setContent(subtitle, options.subtitle);\n\n if(options.noWrap) subtitle.classList.add('no-wrap');\n\n if(options.subtitleRight) {\n this.container.append(this.subtitleRow = this.createRow());\n this.subtitleRow.classList.add('row-subtitle-row');\n const subtitleRight = this.subtitleRight = document.createElement('div');\n subtitleRight.classList.add('row-subtitle', 'row-subtitle-right');\n\n setContent(subtitleRight, options.subtitleRight);\n this.subtitleRow.append(subtitle, subtitleRight);\n }\n } else if(options.subtitleLangKey) {\n this.subtitle.append(i18n(options.subtitleLangKey, options.subtitleLangArgs));\n }\n\n let havePadding = !!options.havePadding;\n if(options.radioField || options.checkboxField) {\n if(options.radioField) {\n this.radioField = options.radioField;\n this.container.append(this.radioField.label);\n havePadding = true;\n }\n\n if(options.checkboxField) {\n this.checkboxField = options.checkboxField;\n\n const isToggle = options.checkboxField.label.classList.contains('checkbox-field-toggle');\n if(isToggle) {\n this.container.classList.add('row-with-toggle');\n options.titleRight = this.checkboxField.label;\n } else {\n havePadding = true;\n this.container.append(this.checkboxField.label);\n }\n\n if(options.withCheckboxSubtitle && !isToggle) {\n const onChange = () => {\n replaceContent(this.subtitle, i18n(this.checkboxField.input.checked ? 'Checkbox.Enabled' : 'Checkbox.Disabled'));\n };\n\n if(options.listenerSetter) options.listenerSetter.add(this.checkboxField.input)('change', onChange);\n else this.checkboxField.input.addEventListener('change', onChange);\n }\n }\n\n const i = options.radioField || options.checkboxField;\n i.label.classList.add('disable-hover');\n }\n\n if(options.title || options.titleLangKey) {\n let c: HTMLElement;\n const titleRightContent = options.titleRight || options.titleRightSecondary;\n if(titleRightContent) {\n this.container.append(c = this.titleRow = this.createRow());\n this.titleRow.classList.add('row-title-row');\n } else {\n c = this.container;\n }\n\n this.title = this.createTitle();\n if(options.noWrap) this.title.classList.add('no-wrap');\n if(options.title) {\n setContent(this.title, options.title);\n } else if(options.titleLangKey) {\n this.title.append(i18n(options.titleLangKey));\n }\n\n c.append(this.title);\n\n if(titleRightContent) {\n const titleRight = this.titleRight = document.createElement('div');\n titleRight.classList.add('row-title', 'row-title-right');\n\n if(options.titleRightSecondary) {\n titleRight.classList.add('row-title-right-secondary');\n }\n\n setContent(titleRight, titleRightContent);\n c.append(titleRight);\n }\n }\n\n if(options.icon) {\n havePadding = true;\n // this.title.classList.add('tgico', 'tgico-' + options.icon);\n this.container.classList.add('tgico', 'tgico-' + options.icon);\n this.container.classList.add('row-with-icon');\n }\n\n if(havePadding) {\n this.container.classList.add('row-with-padding');\n }\n\n if(options.navigationTab) {\n options.clickable = () => options.navigationTab.open();\n }\n\n if(options.clickable || options.radioField || options.checkboxField) {\n if(typeof(options.clickable) === 'function') {\n attachClickEvent(this.container, (e) => {\n if(this.freezed) return;\n (options.clickable as any)(e);\n }, {listenerSetter: options.listenerSetter});\n }\n\n this.container.classList.add('row-clickable', 'hover-effect');\n\n if(!options.noRipple) {\n ripple(this.container, undefined, undefined, true);\n }\n\n /* if(options.radioField || options.checkboxField) {\n this.container.prepend(this.container.lastElementChild);\n } */\n }\n\n if(options.buttonRight || options.buttonRightLangKey) {\n this.buttonRight = options.buttonRight instanceof HTMLElement ?\n options.buttonRight :\n Button('btn-primary btn-color-primary', {text: options.buttonRightLangKey});\n this.container.append(this.buttonRight);\n }\n\n if(options.contextMenu) {\n createContextMenu({\n ...options.contextMenu,\n listenTo: this.container,\n listenerSetter: options.listenerSetter\n });\n }\n }\n\n public get subtitle() {\n return this._subtitle ??= this.createSubtitle();\n }\n\n public get midtitle() {\n return this._midtitle ??= this.createMidtitle();\n }\n\n private createRow() {\n const c = document.createElement('div');\n c.classList.add('row-row');\n return c;\n }\n\n private createTitle() {\n const title = document.createElement('div');\n title.classList.add('row-title');\n setDirection(title);\n return title;\n }\n\n private createSubtitle() {\n const subtitle = document.createElement('div');\n subtitle.classList.add('row-subtitle');\n setDirection(subtitle);\n if(this.title) this.title.after(subtitle);\n else this.container.prepend(subtitle);\n this.container.classList.remove('no-subtitle');\n return subtitle;\n }\n\n private createMidtitle() {\n const midtitle = document.createElement('div');\n midtitle.classList.add('row-midtitle');\n this.subtitle.parentElement.insertBefore(midtitle, this.subtitle);\n return midtitle;\n }\n\n public createMedia(size?: RowMediaSizeType) {\n const media = document.createElement('div');\n return this.applyMediaElement(media, size);\n }\n\n public applyMediaElement(media: HTMLElement, size?: RowMediaSizeType) {\n this.container.classList.add('row-with-padding');\n\n this.media = media;\n media.classList.add('row-media');\n\n if(size) {\n media.classList.add('row-media-' + size);\n }\n\n this.container.append(media);\n\n return media;\n }\n\n public isDisabled() {\n return this.container.classList.contains('is-disabled');\n }\n\n public toggleDisability(disable = !this.container.classList.contains('is-disabled')) {\n this.container.classList.toggle('is-disabled', disable);\n return () => this.toggleDisability(!disable);\n }\n\n public disableWithPromise(promise: Promise) {\n const toggle = this.toggleDisability(true);\n promise.finally(() => {\n toggle();\n });\n }\n\n public makeSortable() {\n const sortIcon = document.createElement('span');\n this.container.classList.add('row-sortable', 'tgico');\n sortIcon.classList.add('row-sortable-icon', 'tgico-menu');\n this.container.append(sortIcon);\n }\n\n public toggleSorting(enabled?: boolean) {\n this.container.classList.toggle('cant-sort', !enabled);\n }\n}\n\nexport const CreateRowFromCheckboxField = (checkboxField: CheckboxField) => {\n return new Row({checkboxField, listenerSetter: checkboxField.listenerSetter});\n};\n\nexport const RadioFormFromRows = (rows: Row[], onChange: (value: string) => void) => {\n return RadioForm(rows.map((r) => ({container: r.container, input: r.radioField.input})), onChange);\n};\n\nexport const RadioFormFromValues = (values: {langPackKey: LangPackKey, value: number | string, checked?: boolean}[], onChange: Parameters[1]) => {\n const name = 'name-' + (Math.random() * 0x7FFFFF | 0);\n let checkedRadioField: RadioField;\n const rows = values.map(({langPackKey, value, checked}) => {\n const row = new Row({\n radioField: new RadioField({\n langKey: langPackKey,\n name,\n value: '' + value\n })\n });\n\n if(checked) {\n checkedRadioField = row.radioField;\n }\n\n return row;\n });\n\n const form = RadioFormFromRows(rows, onChange);\n if(checkedRadioField) {\n checkedRadioField.checked = true;\n }\n return form;\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport {logger, LogTypes} from '../lib/logger';\nimport fastSmoothScroll, {ScrollOptions} from '../helpers/fastSmoothScroll';\nimport useHeavyAnimationCheck from '../hooks/useHeavyAnimationCheck';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {IS_ANDROID} from '../environment/userAgent';\n/*\nvar el = $0;\nvar height = 0;\nvar checkUp = false;\n\ndo {\n height += el.scrollHeight;\n} while(el = (checkUp ? el.previousElementSibling : el.nextElementSibling));\nconsole.log(height);\n*/\n\n/*\nArray.from($0.querySelectorAll('.bubble-content')).forEach((_el) => {\n //_el.style.display = '';\n //return;\n\n let el = _el.parentElement;\n let height = el.scrollHeight;\n let width = el.scrollWidth;\n el.style.width = width + 'px';\n el.style.height = height + 'px';\n _el.style.display = 'none';\n});\n*/\n\n/* const scrollables: Map = new Map();\nconst scrollsIntersector = new IntersectionObserver((entries) => {\n for(let entry of entries) {\n const scrollable = scrollables.get(entry.target as HTMLElement);\n\n if(entry.isIntersecting) {\n scrollable.isVisible = true;\n } else {\n scrollable.isVisible = false;\n\n if(!isInDOM(entry.target)) {\n scrollsIntersector.unobserve(scrollable.container);\n scrollables.delete(scrollable.container);\n }\n }\n }\n}); */\n\nconst SCROLL_THROTTLE = /* IS_ANDROID ? 200 : */24;\n\nexport class ScrollableBase {\n protected log: ReturnType;\n\n public splitUp: HTMLElement;\n public onScrollMeasure: number = 0;\n\n public lastScrollPosition: number = 0;\n public lastScrollDirection: number = 0;\n\n public onAdditionalScroll: () => void;\n public onScrolledTop: () => void;\n public onScrolledBottom: () => void;\n\n public isHeavyAnimationInProgress = false;\n protected needCheckAfterAnimation = false;\n\n public checkForTriggers?: () => void;\n\n public scrollProperty: 'scrollTop' | 'scrollLeft';\n\n protected removeHeavyAnimationListener: () => void;\n protected addedScrollListener: boolean;\n\n constructor(public el?: HTMLElement, logPrefix = '', public container: HTMLElement = document.createElement('div')) {\n this.container.classList.add('scrollable');\n\n this.log = logger('SCROLL' + (logPrefix ? '-' + logPrefix : ''), LogTypes.Error);\n\n if(el) {\n Array.from(el.children).forEach((c) => this.container.append(c));\n\n el.append(this.container);\n }\n // this.onScroll();\n }\n\n public addScrollListener() {\n if(this.addedScrollListener) {\n return;\n }\n\n this.addedScrollListener = true;\n this.container.addEventListener('scroll', this.onScroll, {passive: true, capture: true});\n }\n\n public removeScrollListener() {\n if(!this.addedScrollListener) {\n return;\n }\n\n this.addedScrollListener = false;\n this.container.removeEventListener('scroll', this.onScroll, {capture: true});\n }\n\n public setListeners() {\n if(this.removeHeavyAnimationListener) {\n return;\n }\n\n window.addEventListener('resize', this.onScroll, {passive: true});\n this.addScrollListener();\n\n this.removeHeavyAnimationListener = useHeavyAnimationCheck(() => {\n this.isHeavyAnimationInProgress = true;\n\n if(this.onScrollMeasure) {\n this.cancelMeasure();\n this.needCheckAfterAnimation = true;\n }\n }, () => {\n this.isHeavyAnimationInProgress = false;\n\n if(this.needCheckAfterAnimation) {\n this.onScroll();\n this.needCheckAfterAnimation = false;\n }\n });\n }\n\n public removeListeners() {\n if(!this.removeHeavyAnimationListener) {\n return;\n }\n\n window.removeEventListener('resize', this.onScroll);\n this.removeScrollListener();\n\n this.removeHeavyAnimationListener();\n this.removeHeavyAnimationListener = undefined;\n }\n\n public destroy() {\n this.removeListeners();\n this.onAdditionalScroll = undefined;\n this.onScrolledTop = undefined;\n this.onScrolledBottom = undefined;\n }\n\n public append(...args: Parameters) {\n this.container.append(...args);\n }\n\n public scrollIntoViewNew(options: Omit) {\n // return Promise.resolve();\n // this.removeListeners();\n return fastSmoothScroll({\n ...options,\n container: this.container\n });/* .finally(() => {\n this.setListeners();\n }); */\n }\n\n public onScroll = () => {\n // if(this.debug) {\n // this.log('onScroll call', this.onScrollMeasure);\n // }\n\n // return;\n\n if(this.isHeavyAnimationInProgress) {\n this.cancelMeasure();\n this.needCheckAfterAnimation = true;\n return;\n }\n\n // if(this.onScrollMeasure || ((this.scrollLocked || (!this.onScrolledTop && !this.onScrolledBottom)) && !this.splitUp && !this.onAdditionalScroll)) return;\n if((!this.onScrolledTop && !this.onScrolledBottom) && !this.splitUp && !this.onAdditionalScroll) return;\n if(this.onScrollMeasure) return;\n // if(this.onScrollMeasure) window.cancelAnimationFrame(this.onScrollMeasure);\n // this.onScrollMeasure = window.requestAnimationFrame(() => {\n this.onScrollMeasure = window.setTimeout(() => {\n this.onScrollMeasure = 0;\n\n const scrollPosition = this.container[this.scrollProperty];\n this.lastScrollDirection = this.lastScrollPosition === scrollPosition ? 0 : (this.lastScrollPosition < scrollPosition ? 1 : -1); // * 1 - bottom, -1 - top\n this.lastScrollPosition = scrollPosition;\n\n // lastScrollDirection check is useless here, every callback should decide on its own\n if(this.onAdditionalScroll/* && this.lastScrollDirection !== 0 */) {\n this.onAdditionalScroll();\n }\n\n if(this.checkForTriggers) {\n this.checkForTriggers();\n }\n // });\n }, SCROLL_THROTTLE);\n };\n\n public cancelMeasure() {\n if(this.onScrollMeasure) {\n // window.cancelAnimationFrame(this.onScrollMeasure);\n clearTimeout(this.onScrollMeasure);\n this.onScrollMeasure = 0;\n }\n }\n}\n\nexport type SliceSides = 'top' | 'bottom';\nexport type SliceSidesContainer = {[k in SliceSides]: boolean};\n\nexport default class Scrollable extends ScrollableBase {\n public padding: HTMLElement;\n\n public loadedAll: SliceSidesContainer = {top: true, bottom: false};\n\n constructor(el?: HTMLElement, logPrefix = '', public onScrollOffset = 300, withPaddingContainer?: boolean) {\n super(el, logPrefix);\n\n /* if(withPaddingContainer) {\n this.padding = document.createElement('div');\n this.padding.classList.add('scrollable-padding');\n Array.from(this.container.children).forEach((c) => this.padding.append(c));\n this.container.append(this.padding);\n } */\n\n this.container.classList.add('scrollable-y');\n this.setListeners();\n this.scrollProperty = 'scrollTop';\n }\n\n public attachBorderListeners(setClassOn = this.container) {\n const cb = this.onAdditionalScroll;\n this.onAdditionalScroll = () => {\n cb?.();\n setClassOn.classList.toggle('scrolled-top', !this.scrollTop);\n setClassOn.classList.toggle('scrolled-bottom', this.isScrolledDown);\n };\n\n setClassOn.classList.add('scrolled-top', 'scrolled-bottom', 'scrollable-y-bordered');\n }\n\n public setVirtualContainer(el?: HTMLElement) {\n this.splitUp = el;\n this.log('setVirtualContainer:', el, this);\n }\n\n public checkForTriggers = () => {\n if((!this.onScrolledTop && !this.onScrolledBottom)) return;\n\n if(this.isHeavyAnimationInProgress) {\n this.onScroll();\n return;\n }\n\n const scrollHeight = this.container.scrollHeight;\n if(!scrollHeight) { // незачем вызывать триггеры если блок пустой или не виден\n return;\n }\n\n const clientHeight = this.container.clientHeight;\n const maxScrollTop = scrollHeight - clientHeight;\n const scrollTop = this.lastScrollPosition;\n\n // this.log('checkForTriggers:', scrollTop, maxScrollTop);\n\n if(this.onScrolledTop && scrollTop <= this.onScrollOffset && this.lastScrollDirection <= 0/* && direction === -1 */) {\n this.onScrolledTop();\n }\n\n if(this.onScrolledBottom && (maxScrollTop - scrollTop) <= this.onScrollOffset && this.lastScrollDirection >= 0/* && direction === 1 */) {\n this.onScrolledBottom();\n }\n };\n\n public prepend(...elements: (HTMLElement | DocumentFragment)[]) {\n (this.splitUp || this.padding || this.container).prepend(...elements);\n }\n\n public append(...elements: (HTMLElement | DocumentFragment)[]) {\n (this.splitUp || this.padding || this.container).append(...elements);\n }\n\n public getDistanceToEnd() {\n return this.scrollHeight - Math.round(this.scrollTop + this.container.offsetHeight);\n }\n\n get isScrolledDown() {\n return this.getDistanceToEnd() <= 1;\n }\n\n set scrollTop(y: number) {\n this.container.scrollTop = y;\n }\n\n get scrollTop() {\n // this.log.trace('get scrollTop');\n return this.container.scrollTop;\n }\n\n public setScrollTopSilently(value: number) {\n this.lastScrollPosition = value;\n this.ignoreNextScrollEvent();\n\n this.scrollTop = value;\n }\n\n public ignoreNextScrollEvent() {\n if(this.removeHeavyAnimationListener) {\n this.removeScrollListener();\n this.container.addEventListener('scroll', (e) => {\n cancelEvent(e);\n this.addScrollListener();\n }, {capture: true, passive: false, once: true});\n }\n }\n\n get scrollHeight() {\n return this.container.scrollHeight;\n }\n}\n\nexport class ScrollableX extends ScrollableBase {\n constructor(el: HTMLElement, logPrefix = '', public onScrollOffset = 300, public splitCount = 15, public container: HTMLElement = document.createElement('div')) {\n super(el, logPrefix, container);\n\n this.container.classList.add('scrollable-x');\n\n if(!IS_TOUCH_SUPPORTED) {\n const scrollHorizontally = (e: any) => {\n if(!e.deltaX && this.container.scrollWidth > this.container.clientWidth) {\n this.container.scrollLeft += e.deltaY / 4;\n cancelEvent(e);\n }\n };\n\n this.container.addEventListener('wheel', scrollHorizontally, {passive: false});\n }\n\n this.scrollProperty = 'scrollLeft';\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {LangPackKey, FormatterArguments, i18n_} from '../lib/langPack';\nimport {generateDelimiter} from './generateDelimiter';\nimport Scrollable from './scrollable';\n\nexport type SettingSectionOptions = {\n name?: LangPackKey,\n nameArgs?: FormatterArguments,\n caption?: LangPackKey | true,\n captionArgs?: FormatterArguments,\n captionOld?: SettingSectionOptions['caption'],\n noDelimiter?: boolean,\n fakeGradientDelimiter?: boolean,\n noShadow?: boolean,\n // fullWidth?: boolean,\n // noPaddingTop?: boolean\n};\n\nconst className = 'sidebar-left-section';\nexport default class SettingSection {\n public container: HTMLElement;\n public innerContainer: HTMLElement;\n public content: HTMLElement;\n public title: HTMLElement;\n public caption: HTMLElement;\n\n private fullWidth: boolean;\n\n constructor(options: SettingSectionOptions = {}) {\n const container = this.container = document.createElement('div');\n container.classList.add(className + '-container');\n\n const innerContainer = this.innerContainer = document.createElement('div');\n innerContainer.classList.add(className);\n\n if(options.noShadow) {\n innerContainer.classList.add('no-shadow');\n }\n\n if(options.fakeGradientDelimiter) {\n innerContainer.append(generateDelimiter());\n innerContainer.classList.add('with-fake-delimiter');\n } else if(!options.noDelimiter) {\n const hr = document.createElement('hr');\n innerContainer.append(hr);\n } else {\n innerContainer.classList.add('no-delimiter');\n }\n\n // if(options.fullWidth) {\n // this.fullWidth = true;\n // }\n\n // if(options.noPaddingTop) {\n // innerContainer.classList.add('no-padding-top');\n // }\n\n const content = this.content = this.generateContentElement();\n\n if(options.name) {\n const title = this.title = document.createElement('div');\n title.classList.add('sidebar-left-h2', className + '-name');\n i18n_({element: title, key: options.name, args: options.nameArgs});\n content.append(title);\n }\n\n container.append(innerContainer);\n\n const caption = options.caption ?? options.captionOld;\n if(caption) {\n const el = this.caption = this.generateContentElement();\n el.classList.add(className + '-caption');\n\n if(!options.captionOld) {\n container.append(el);\n }\n\n if(caption !== true) {\n i18n_({element: el, key: caption, args: options.captionArgs});\n }\n }\n }\n\n public generateContentElement() {\n const content = document.createElement('div');\n content.classList.add(className + '-content');\n\n // if(this.fullWidth) {\n // content.classList.add('full-width');\n // }\n\n this.innerContainer.append(content);\n return content;\n }\n}\n\nexport const generateSection = (appendTo: Scrollable, name?: LangPackKey, caption?: LangPackKey) => {\n const section = new SettingSection({name, caption});\n appendTo.append(section.container);\n return section.content;\n};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {InputFile} from '../../../layer';\nimport appDialogsManager from '../../../lib/appManagers/appDialogsManager';\nimport InputField from '../../inputField';\nimport {SliderSuperTab} from '../../slider';\nimport AvatarEdit from '../../avatarEdit';\nimport I18n, {joinElementsWith} from '../../../lib/langPack';\nimport ButtonCorner from '../../buttonCorner';\nimport getUserStatusString from '../../wrappers/getUserStatusString';\nimport appImManager from '../../../lib/appManagers/appImManager';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport SettingSection from '../../settingSection';\n\ninterface OpenStreetMapInterface {\n place_id?: number;\n license?: string;\n osm_type?: string;\n osm_id?: number;\n lat?: string;\n lon?: string;\n display_name: string;\n address?: object;\n boundingbox?: object;\n}\n\nexport default class AppNewGroupTab extends SliderSuperTab {\n private avatarEdit: AvatarEdit;\n private uploadAvatar: () => Promise = null;\n private peerIds: PeerId[];\n private isGeoChat: boolean = false;\n private nextBtn: HTMLButtonElement;\n private groupNameInputField: InputField;\n private list: HTMLUListElement;\n private groupLocationInputField: InputField;\n private userLocationCoords: {lat: number, long: number};\n private userLocationAddress: string;\n\n public init(\n peerIds: PeerId[],\n isGeoChat: boolean = false\n ) {\n this.isGeoChat = isGeoChat;\n this.peerIds = peerIds;\n\n this.container.classList.add('new-group-container');\n this.setTitle('NewGroup');\n\n this.avatarEdit = new AvatarEdit((_upload) => {\n this.uploadAvatar = _upload;\n });\n\n const section = new SettingSection({});\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n this.groupNameInputField = new InputField({\n label: 'CreateGroup.NameHolder',\n maxLength: 128\n });\n\n this.groupLocationInputField = new InputField({\n label: 'ChatLocation',\n name: 'location',\n canBeEdited: false\n });\n\n inputWrapper.append(\n this.groupNameInputField.container,\n this.groupLocationInputField.container\n );\n\n this.listenerSetter.add(this.groupNameInputField.input)('input', () => {\n const value = this.groupNameInputField.value;\n let valueCheck = !!value.length && !this.groupNameInputField.input.classList.contains('error');\n if(this.isGeoChat) valueCheck = valueCheck && !!this.userLocationCoords && !!this.userLocationAddress;\n this.nextBtn.classList.toggle('is-visible', !!valueCheck);\n });\n\n this.nextBtn = ButtonCorner({icon: 'arrow_next'});\n\n attachClickEvent(this.nextBtn, () => {\n const title = this.groupNameInputField.value;\n\n let promise: Promise;\n if(this.isGeoChat) {\n if(!this.userLocationAddress || !this.userLocationCoords) return;\n promise = this.managers.appChatsManager.createChannel({\n title,\n about: '',\n geo_point: {\n _: 'inputGeoPoint',\n ...this.userLocationCoords\n },\n address: this.userLocationAddress,\n megagroup: true\n }).then((chatId) => {\n if(this.uploadAvatar) {\n this.uploadAvatar().then((inputFile) => {\n this.managers.appChatsManager.editPhoto(chatId, inputFile);\n });\n }\n\n if(this.peerIds.length) {\n this.managers.appChatsManager.inviteToChannel(chatId, this.peerIds);\n }\n\n return chatId;\n });\n } else {\n this.nextBtn.disabled = true;\n promise = this.managers.appChatsManager.createChat(title, this.peerIds.map((peerId) => peerId.toUserId())).then((chatId) => {\n if(this.uploadAvatar) {\n this.uploadAvatar().then((inputFile) => {\n this.managers.appChatsManager.editPhoto(chatId, inputFile);\n });\n }\n\n return chatId;\n });\n }\n\n if(!promise) {\n return;\n }\n\n promise.then((chatId) => {\n this.close();\n\n appImManager.setInnerPeer({peerId: chatId.toPeerId(true)});\n });\n }, {listenerSetter: this.listenerSetter});\n\n const chatsSection = new SettingSection({\n name: 'Members',\n nameArgs: [this.peerIds.length]\n });\n\n if(!this.peerIds.length) {\n chatsSection.container.classList.add('hide');\n }\n\n const list = this.list = appDialogsManager.createChatList({\n new: true\n });\n\n chatsSection.content.append(list);\n\n section.content.append(this.avatarEdit.container, inputWrapper);\n\n this.content.append(this.nextBtn);\n this.scrollable.append(section.container, chatsSection.container);\n\n if(isGeoChat) {\n this.setTitle('NearbyCreateGroup');\n this.groupLocationInputField.container.classList.remove('hide');\n this.groupLocationInputField.setValueSilently(I18n.format('Loading', true));\n this.startLocating();\n } else {\n this.groupLocationInputField.container.classList.add('hide');\n }\n\n const usersPromise = Promise.all(this.peerIds.map((peerId) => this.managers.appUsersManager.getUser(peerId.toUserId())));\n const myUserPromise = this.managers.appUsersManager.getSelf();\n\n const a = usersPromise.then((users) => {\n return users.map((user) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: user.id.toPeerId(false),\n container: this.list,\n rippleEnabled: false,\n avatarSize: 'abitbigger'\n });\n\n dom.lastMessageSpan.append(getUserStatusString(user));\n })\n });\n\n const setTitlePromise = this.peerIds.length > 0 && this.peerIds.length < 5 ? Promise.all([usersPromise, myUserPromise]).then(([users, myUser]) => {\n const names = users.map((user) => [user.first_name, user.last_name].filter(Boolean).join(' '));\n names.unshift(myUser.first_name);\n\n const joined = joinElementsWith(names, (isLast) => isLast ? ', ' : ' & ').join('');\n this.groupNameInputField.setDraftValue(joined);\n }) : Promise.resolve();\n\n return Promise.all([\n a,\n setTitlePromise\n ]);\n }\n\n public onCloseAfterTimeout() {\n this.avatarEdit.clear();\n this.uploadAvatar = null;\n this.groupNameInputField.value = '';\n this.groupLocationInputField.container.classList.add('hide');\n this.nextBtn.disabled = false;\n }\n\n private startLocating() {\n navigator.geolocation.getCurrentPosition((location) => {\n this.userLocationCoords = {\n lat: location.coords.latitude,\n long: location.coords.longitude\n };\n\n let uri = 'https://nominatim.openstreetmap.org/reverse';\n uri += '?lat='+location.coords.latitude;\n uri += '&lon='+location.coords.longitude;\n uri += '&format=json';\n uri += '&addressdetails=1';\n uri += '&accept-language=en';\n fetch(uri)\n .then((response) => response.json())\n .then((response: OpenStreetMapInterface) => {\n this.userLocationAddress = response.display_name;\n this.groupLocationInputField.setValueSilently(response.display_name);\n });\n }, (error) => {\n if(error instanceof GeolocationPositionError) {\n this.groupLocationInputField.setValueSilently('Location permission denied. Please retry later.');\n } else {\n this.groupLocationInputField.setValueSilently('An error has occurred. Please retry later.');\n }\n });\n }\n}\n","enum PrivacyType {\n Everybody = 2,\n Contacts = 1,\n Nobody = 0\n}\n\nexport default PrivacyType;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {PrivacyRule} from '../../../../layer';\nimport PrivacyType from './privacyType';\n\nexport default function getPrivacyRulesDetails(rules: PrivacyRule[]) {\n const types: PrivacyType[] = [];\n\n type peers = {users: UserId[], chats: ChatId[]};\n const allowPeers: peers = {users: [], chats: []}, disallowPeers: peers = {users: [], chats: []};\n rules.forEach((rule) => {\n switch(rule._) {\n case 'privacyValueAllowAll':\n types.push(2);\n break;\n case 'privacyValueDisallowAll':\n types.push(0);\n break;\n case 'privacyValueAllowContacts':\n types.push(1);\n break;\n /* case 'privacyValueDisallowContacts':\n types.push('Except My Contacts');\n break; */\n case 'privacyValueAllowChatParticipants':\n allowPeers.chats.push(...rule.chats);\n break;\n case 'privacyValueAllowUsers':\n allowPeers.users.push(...rule.users);\n break;\n case 'privacyValueDisallowChatParticipants':\n disallowPeers.chats.push(...rule.chats);\n break;\n case 'privacyValueDisallowUsers':\n disallowPeers.users.push(...rule.users);\n break;\n }\n });\n\n return {type: types[0], disallowPeers, allowPeers};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport replaceContent from '../helpers/dom/replaceContent';\nimport {randomLong} from '../helpers/random';\nimport {InputPrivacyKey, InputPrivacyRule} from '../layer';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport getPrivacyRulesDetails from '../lib/appManagers/utils/privacy/getPrivacyRulesDetails';\nimport PrivacyType from '../lib/appManagers/utils/privacy/privacyType';\nimport {i18n, join, LangPackKey, _i18n} from '../lib/langPack';\nimport RadioField from './radioField';\nimport Row, {RadioFormFromRows} from './row';\nimport Scrollable from './scrollable';\nimport SettingSection, {generateSection} from './settingSection';\nimport AppAddMembersTab from './sidebarLeft/tabs/addMembers';\nimport {SliderSuperTabEventable} from './sliderTab';\n\nexport type PrivacySectionStr = LangPackKey | '' | HTMLElement;\nexport default class PrivacySection {\n public radioRows: Map;\n public radioSection: SettingSection;\n public exceptions: Map;\n public peerIds: {\n disallow?: PeerId[],\n allow?: PeerId[]\n };\n public type: PrivacyType;\n\n constructor(public options: {\n tab: SliderSuperTabEventable,\n title: LangPackKey,\n inputKey: InputPrivacyKey['_'],\n captions?: [PrivacySectionStr, PrivacySectionStr, PrivacySectionStr],\n appendTo?: Scrollable,\n noExceptions?: boolean,\n onRadioChange?: (value: number) => any,\n skipTypes?: PrivacyType[],\n exceptionTexts?: [LangPackKey, LangPackKey],\n managers: AppManagers\n }) {\n if(options.captions) {\n options.captions.reverse();\n }\n\n const managers = options.managers;\n\n this.radioSection = new SettingSection({name: options.title, caption: true});\n\n this.radioRows = new Map();\n\n let r: Array<{type: PrivacyType, langKey: LangPackKey}> = [{\n type: PrivacyType.Everybody,\n langKey: 'PrivacySettingsController.Everbody'\n }, {\n type: PrivacyType.Contacts,\n langKey: 'PrivacySettingsController.MyContacts'\n }, {\n type: PrivacyType.Nobody,\n langKey: 'PrivacySettingsController.Nobody'\n }];\n\n if(options.skipTypes) {\n r = r.filter((r) => !options.skipTypes.includes(r.type));\n }\n\n const random = randomLong();\n r.forEach(({type, langKey}) => {\n const row = new Row({\n radioField: new RadioField({\n langKey,\n name: random,\n value: '' + type\n })\n });\n\n this.radioRows.set(type, row);\n });\n\n const form = RadioFormFromRows([...this.radioRows.values()], this.onRadioChange);\n\n this.radioSection.content.append(form);\n if(options.appendTo) {\n options.appendTo.append(this.radioSection.container);\n }\n\n if(!options.noExceptions) {\n const container = generateSection(options.appendTo, 'PrivacyExceptions', 'PrivacySettingsController.PeerInfo');\n\n this.exceptions = new Map([[\n 'disallow',\n {\n titleLangKey: options.exceptionTexts[0],\n key: 'disallow',\n row: null,\n icon: 'deleteuser',\n subtitleLangKey: 'PrivacySettingsController.AddUsers',\n clickable: true\n }\n ], [\n 'allow',\n {\n titleLangKey: options.exceptionTexts[1],\n key: 'allow',\n row: null,\n icon: 'adduser',\n subtitleLangKey: 'PrivacySettingsController.AddUsers',\n clickable: true\n }\n ]]);\n\n this.exceptions.forEach((exception) => {\n exception.row = new Row(exception);\n\n exception.row.container.addEventListener('click', () => {\n promise.then(() => {\n const _peerIds = this.peerIds[exception.key];\n options.tab.slider.createTab(AppAddMembersTab).open({\n type: 'privacy',\n skippable: true,\n title: exception.titleLangKey,\n placeholder: 'PrivacyModal.Search.Placeholder',\n takeOut: (newPeerIds) => {\n _peerIds.length = 0;\n _peerIds.push(...newPeerIds);\n exception.row.subtitle.innerHTML = '';\n exception.row.subtitle.append(...this.generateStr(this.splitPeersByType(newPeerIds)));\n },\n selectedPeerIds: _peerIds\n });\n });\n });\n\n container.append(exception.row.container);\n });\n }\n\n /* setTimeout(() => {\n this.setRadio(PrivacyType.Contacts);\n }, 0); */\n\n const promise = managers.appPrivacyManager.getPrivacy(options.inputKey).then((rules) => {\n const details = getPrivacyRulesDetails(rules);\n this.setRadio(details.type);\n\n if(this.exceptions) {\n this.peerIds = {};\n ['allow' as const, 'disallow' as const].forEach((k) => {\n const arr = [];\n const from = k === 'allow' ? details.allowPeers : details.disallowPeers;\n arr.push(...from.users.map((id) => id.toPeerId()));\n arr.push(...from.chats.map((id) => id.toPeerId(true)));\n this.peerIds[k] = arr;\n const s = this.exceptions.get(k).row.subtitle;\n s.innerHTML = '';\n s.append(...this.generateStr(from));\n });\n }\n\n options.tab.eventListener.addEventListener('destroy', async() => {\n const rules: InputPrivacyRule[] = [];\n\n switch(this.type) {\n case PrivacyType.Everybody:\n rules.push({_: 'inputPrivacyValueAllowAll'});\n break;\n case PrivacyType.Contacts:\n rules.push({_: 'inputPrivacyValueAllowContacts'});\n break;\n case PrivacyType.Nobody:\n rules.push({_: 'inputPrivacyValueDisallowAll'});\n break;\n }\n\n if(this.exceptions) {\n const a = ([\n ['allow', 'inputPrivacyValueAllowChatParticipants', 'inputPrivacyValueAllowUsers'],\n ['disallow', 'inputPrivacyValueDisallowChatParticipants', 'inputPrivacyValueDisallowUsers']\n ] as Array<[\n 'allow' | 'disallow',\n 'inputPrivacyValueAllowChatParticipants' | 'inputPrivacyValueDisallowChatParticipants',\n 'inputPrivacyValueAllowUsers' | 'inputPrivacyValueDisallowUsers'\n ]>);\n for(const [k, chatKey, usersKey] of a) {\n if(this.exceptions.get(k).row.container.classList.contains('hide')) {\n continue;\n }\n\n const _peerIds = this.peerIds[k];\n if(_peerIds) {\n const splitted = this.splitPeersByType(_peerIds);\n if(splitted.chats.length) {\n rules.push({_: chatKey, chats: splitted.chats});\n }\n\n if(splitted.users.length) {\n rules.push({\n _: usersKey,\n users: await Promise.all(splitted.users.map((id) => managers.appUsersManager.getUserInput(id)))\n });\n }\n }\n }\n }\n\n managers.appPrivacyManager.setPrivacy(options.inputKey, rules);\n }, {once: true});\n });\n }\n\n private onRadioChange = (value: string | PrivacySection['type']) => {\n value = +value as PrivacySection['type'];\n this.type = value;\n\n const caption = this.options.captions[this.type];\n const captionElement = this.radioSection.caption;\n if(!caption) {\n captionElement.innerHTML = '';\n } else if(caption instanceof HTMLElement) {\n replaceContent(captionElement, caption);\n } else {\n _i18n(captionElement, caption);\n }\n captionElement.classList.toggle('hide', !caption);\n\n if(this.exceptions) {\n this.exceptions.get('allow').row.container.classList.toggle('hide', this.type === PrivacyType.Everybody);\n this.exceptions.get('disallow').row.container.classList.toggle('hide', this.type === PrivacyType.Nobody);\n }\n\n this.options.onRadioChange && this.options.onRadioChange(value);\n };\n\n public setRadio(type: PrivacySection['type']) {\n const row = this.radioRows.get(type);\n this.onRadioChange(type);\n row.radioField.input.checked = true;\n }\n\n private splitPeersByType(peerIds: PeerId[]) {\n const peers = {users: [] as UserId[], chats: [] as ChatId[]};\n peerIds.forEach((peerId) => {\n peers[peerId.isAnyChat() ? 'chats' : 'users'].push(peerId.isAnyChat() ? peerId.toChatId() : peerId);\n });\n\n return peers;\n }\n\n private generateStr(peers: {users: UserId[], chats: ChatId[]}) {\n if(!peers.users.length && !peers.chats.length) {\n return [i18n('PrivacySettingsController.AddUsers')];\n }\n\n return join([\n peers.users.length ? i18n('Users', [peers.users.length]) : null,\n peers.chats.length ? i18n('Chats', [peers.chats.length]) : null\n ].filter(Boolean), false);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport PrivacySection from '../../../privacySection';\nimport {i18n, LangPackKey} from '../../../../lib/langPack';\nimport anchorCopy from '../../../../helpers/dom/anchorCopy';\nimport PrivacyType from '../../../../lib/appManagers/utils/privacy/privacyType';\n\nexport default class AppPrivacyPhoneNumberTab extends SliderSuperTabEventable {\n public async init() {\n this.container.classList.add('privacy-tab', 'privacy-phone-number');\n this.setTitle('PrivacyPhone');\n\n const formatted = '+' + (await this.managers.appUsersManager.getSelf()).phone;\n const captionEl = document.createElement('div');\n captionEl.append(\n i18n('PrivacyPhoneInfo'),\n document.createElement('br'),\n document.createElement('br'),\n i18n('PrivacyPhoneInfo4'),\n document.createElement('br'),\n anchorCopy({\n mePath: formatted\n })\n );\n\n const phoneSection = new PrivacySection({\n tab: this,\n title: 'PrivacyPhoneTitle',\n inputKey: 'inputPrivacyKeyPhoneNumber',\n captions: [captionEl, captionEl, ''],\n exceptionTexts: ['PrivacySettingsController.NeverShare', 'PrivacySettingsController.AlwaysShare'],\n appendTo: this.scrollable,\n onRadioChange: (type) => {\n s.setRadio(PrivacyType.Everybody);\n s.radioSection.container.classList.toggle('hide', type !== PrivacyType.Nobody);\n },\n managers: this.managers\n });\n\n const sCaption: LangPackKey = 'PrivacyPhoneInfo3';\n const s = new PrivacySection({\n tab: this,\n title: 'PrivacyPhoneTitle2',\n inputKey: 'inputPrivacyKeyAddedByPhone',\n captions: [sCaption, sCaption, ''],\n noExceptions: true,\n skipTypes: [PrivacyType.Nobody],\n managers: this.managers\n });\n\n this.scrollable.container.insertBefore(s.radioSection.container, phoneSection.radioSection.container.nextSibling);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from '../../../../helpers/dom/clickEvent';\nimport Button from '../../../button';\nimport SettingSection from '../../../settingSection';\nimport {SliderSuperTab} from '../../../slider';\nimport wrapStickerEmoji from '../../../wrappers/stickerEmoji';\nimport AppSettingsTab from '../settings';\n\nexport default class AppTwoStepVerificationSetTab extends SliderSuperTab {\n public init() {\n this.container.classList.add('two-step-verification', 'two-step-verification-set');\n this.setTitle('TwoStepVerificationPasswordSet');\n\n const section = new SettingSection({\n captionOld: 'TwoStepVerificationPasswordSetInfo',\n noDelimiter: true\n });\n\n const emoji = '🥳';\n const stickerContainer = document.createElement('div');\n\n wrapStickerEmoji({\n emoji,\n div: stickerContainer,\n width: 160,\n height: 160\n });\n\n section.content.append(stickerContainer);\n\n const inputContent = section.generateContentElement();\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const btnReturn = Button('btn-primary btn-color-primary', {text: 'TwoStepVerificationPasswordReturnSettings'});\n\n attachClickEvent(btnReturn, (e) => {\n this.close();\n });\n\n this.slider.sliceTabsUntilTab(AppSettingsTab, this);\n\n inputWrapper.append(btnReturn);\n\n inputContent.append(inputWrapper);\n\n this.scrollable.container.append(section.container);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {IS_MOBILE_SAFARI} from '../../environment/userAgent';\n\nexport function canFocus(isFirstInput: boolean) {\n return !IS_MOBILE_SAFARI || !isFirstInput;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AccountPassword} from '../../../../layer';\nimport Button from '../../../button';\nimport {SliderSuperTab} from '../../../slider';\nimport AppTwoStepVerificationSetTab from './passwordSet';\nimport CodeInputField from '../../../codeInputField';\nimport AppTwoStepVerificationEmailTab from './email';\nimport {putPreloader} from '../../../putPreloader';\nimport {i18n, _i18n} from '../../../../lib/langPack';\nimport {canFocus} from '../../../../helpers/dom/canFocus';\nimport {attachClickEvent} from '../../../../helpers/dom/clickEvent';\nimport replaceContent from '../../../../helpers/dom/replaceContent';\nimport toggleDisability from '../../../../helpers/dom/toggleDisability';\nimport wrapStickerEmoji from '../../../wrappers/stickerEmoji';\nimport SettingSection from '../../../settingSection';\n\nexport default class AppTwoStepVerificationEmailConfirmationTab extends SliderSuperTab {\n public codeInputField: CodeInputField;\n public state: AccountPassword;\n public email: string;\n public length: number;\n public isFirst = false;\n\n public init() {\n this.container.classList.add('two-step-verification', 'two-step-verification-email-confirmation');\n this.setTitle('TwoStepAuth.RecoveryTitle');\n\n const section = new SettingSection({\n captionOld: true,\n noDelimiter: true\n });\n\n _i18n(section.caption, 'TwoStepAuth.ConfirmEmailCodeDesc', [this.email]);\n\n const emoji = '📬';\n const stickerContainer = document.createElement('div');\n\n wrapStickerEmoji({\n div: stickerContainer,\n width: 160,\n height: 160,\n emoji\n });\n\n section.content.append(stickerContainer);\n\n const inputContent = section.generateContentElement();\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const inputField = this.codeInputField = new CodeInputField({\n name: 'recovery-email-code',\n label: 'TwoStepAuth.RecoveryCode',\n length: this.length,\n onFill: (code) => {\n freeze(true);\n\n this.managers.passwordManager.confirmPasswordEmail('' + code)\n .then((value) => {\n if(!value) {\n\n }\n\n goNext();\n })\n .catch((err) => {\n switch(err.type) {\n case 'CODE_INVALID':\n inputField.input.classList.add('error');\n replaceContent(inputField.label, i18n('TwoStepAuth.RecoveryCodeInvalid'));\n break;\n\n case 'EMAIL_HASH_EXPIRED':\n inputField.input.classList.add('error');\n replaceContent(inputField.label, i18n('TwoStepAuth.RecoveryCodeExpired'));\n break;\n\n default:\n console.error('confirm error', err);\n break;\n }\n\n freeze(false);\n });\n }\n });\n\n const btnChange = Button('btn-primary btn-primary-transparent primary', {text: 'TwoStepAuth.EmailCodeChangeEmail'});\n const btnResend = Button('btn-primary btn-secondary btn-primary-transparent primary', {text: 'ResendCode'});\n\n const goNext = () => {\n this.slider.createTab(AppTwoStepVerificationSetTab).open();\n };\n\n const freeze = (disable: boolean) => {\n toggleDisability([inputField.input, btnChange, btnResend], disable);\n };\n\n attachClickEvent(btnChange, (e) => {\n freeze(true);\n this.managers.passwordManager.cancelPasswordEmail().then((value) => {\n this.slider.sliceTabsUntilTab(AppTwoStepVerificationEmailTab, this);\n this.close();\n }, () => {\n freeze(false);\n });\n });\n\n attachClickEvent(btnResend, (e) => {\n freeze(true);\n const d = putPreloader(btnResend);\n this.managers.passwordManager.resendPasswordEmail().then((value) => {\n d.remove();\n freeze(false);\n });\n });\n\n inputWrapper.append(inputField.container, btnChange, btnResend);\n\n inputContent.append(inputWrapper);\n\n this.scrollable.container.append(section.container);\n }\n\n onOpenAfterTimeout() {\n if(!canFocus(this.isFirst)) return;\n this.codeInputField.input.focus();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AccountPassword} from '../../../../layer';\nimport Button from '../../../button';\nimport {SliderSuperTab} from '../../../slider';\nimport InputField from '../../../inputField';\nimport {putPreloader} from '../../../putPreloader';\nimport AppTwoStepVerificationSetTab from './passwordSet';\nimport AppTwoStepVerificationEmailConfirmationTab from './emailConfirmation';\nimport PopupPeer from '../../../popups/peer';\nimport cancelEvent from '../../../../helpers/dom/cancelEvent';\nimport {canFocus} from '../../../../helpers/dom/canFocus';\nimport {attachClickEvent} from '../../../../helpers/dom/clickEvent';\nimport matchEmail from '../../../../lib/richTextProcessor/matchEmail';\nimport wrapStickerEmoji from '../../../wrappers/stickerEmoji';\nimport SettingSection from '../../../settingSection';\n\nexport default class AppTwoStepVerificationEmailTab extends SliderSuperTab {\n public inputField: InputField;\n public state: AccountPassword;\n public plainPassword: string;\n public newPassword: string;\n public hint: string;\n public isFirst = false;\n\n public init() {\n this.container.classList.add('two-step-verification', 'two-step-verification-email');\n this.setTitle('RecoveryEmailTitle');\n\n const section = new SettingSection({\n captionOld: true,\n noDelimiter: true\n });\n\n const emoji = '💌';\n const stickerContainer = document.createElement('div');\n\n wrapStickerEmoji({\n div: stickerContainer,\n width: 160,\n height: 160,\n emoji\n });\n\n section.content.append(stickerContainer);\n\n const inputContent = section.generateContentElement();\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const inputField = this.inputField = new InputField({\n name: 'recovery-email',\n label: 'RecoveryEmail',\n plainText: true\n });\n\n inputField.input.addEventListener('keypress', (e) => {\n if(e.key === 'Enter') {\n cancelEvent(e);\n return onContinueClick();\n }\n });\n\n inputField.input.addEventListener('input', (e) => {\n inputField.input.classList.remove('error');\n });\n\n const btnContinue = Button('btn-primary btn-color-primary', {text: 'Continue'});\n const btnSkip = Button('btn-primary btn-secondary btn-primary-transparent primary', {text: 'YourEmailSkip'});\n\n const goNext = () => {\n this.slider.createTab(AppTwoStepVerificationSetTab).open();\n };\n\n const onContinueClick = () => {\n const email = inputField.value.trim();\n const match = matchEmail(email);\n if(!match || match[0].length !== email.length) {\n inputField.input.classList.add('error');\n return;\n }\n\n toggleButtons(true);\n const d = putPreloader(btnContinue);\n\n this.managers.passwordManager.updateSettings({\n hint: this.hint,\n currentPassword: this.plainPassword,\n newPassword: this.newPassword,\n email\n }).then((value) => {\n goNext();\n }, (err) => {\n if(err.type.includes('EMAIL_UNCONFIRMED')) {\n const symbols = +err.type.match(/^EMAIL_UNCONFIRMED_(\\d+)/)[1];\n\n const tab = this.slider.createTab(AppTwoStepVerificationEmailConfirmationTab);\n tab.state = this.state;\n tab.email = email;\n tab.length = symbols;\n tab.open();\n } else {\n console.log('password set error', err);\n }\n\n toggleButtons(false);\n d.remove();\n });\n };\n attachClickEvent(btnContinue, onContinueClick);\n\n const toggleButtons = (freeze: boolean) => {\n if(freeze) {\n btnContinue.setAttribute('disabled', 'true');\n btnSkip.setAttribute('disabled', 'true');\n } else {\n btnContinue.removeAttribute('disabled');\n btnSkip.removeAttribute('disabled');\n }\n };\n\n attachClickEvent(btnSkip, (e) => {\n const popup = new PopupPeer('popup-skip-email', {\n buttons: [{\n langKey: 'Cancel',\n isCancel: true\n }, {\n langKey: 'YourEmailSkip',\n callback: () => {\n // inputContent.classList.add('sidebar-left-section-disabled');\n toggleButtons(true);\n putPreloader(btnSkip);\n this.managers.passwordManager.updateSettings({\n hint: this.hint,\n currentPassword: this.plainPassword,\n newPassword: this.newPassword,\n email: ''\n }).then(() => {\n goNext();\n }, (err) => {\n toggleButtons(false);\n });\n },\n isDanger: true\n }],\n titleLangKey: 'YourEmailSkipWarning',\n descriptionLangKey: 'YourEmailSkipWarningText'\n });\n\n popup.show();\n });\n\n inputWrapper.append(inputField.container, btnContinue, btnSkip);\n\n inputContent.append(inputWrapper);\n\n this.scrollable.container.append(section.container);\n }\n\n onOpenAfterTimeout() {\n if(!canFocus(this.isFirst)) return;\n this.inputField.input.focus();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AccountPassword} from '../../../../layer';\nimport Button from '../../../button';\nimport {SliderSuperTab} from '../../../slider';\nimport InputField from '../../../inputField';\nimport AppTwoStepVerificationEmailTab from './email';\nimport {toast} from '../../../toast';\nimport I18n from '../../../../lib/langPack';\nimport cancelEvent from '../../../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../../../helpers/dom/clickEvent';\nimport wrapStickerEmoji from '../../../wrappers/stickerEmoji';\nimport SettingSection from '../../../settingSection';\n\nexport default class AppTwoStepVerificationHintTab extends SliderSuperTab {\n public inputField: InputField;\n public state: AccountPassword;\n public plainPassword: string;\n public newPassword: string;\n\n public init() {\n this.container.classList.add('two-step-verification', 'two-step-verification-hint');\n this.setTitle('TwoStepAuth.SetupHintTitle');\n\n const section = new SettingSection({\n noDelimiter: true\n });\n\n const emoji = '💡';\n const stickerContainer = document.createElement('div');\n wrapStickerEmoji({\n div: stickerContainer,\n width: 160,\n height: 160,\n emoji\n });\n\n section.content.append(stickerContainer);\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const inputField = this.inputField = new InputField({\n name: 'hint',\n label: 'TwoStepAuth.SetupHintPlaceholder'\n });\n\n inputField.input.addEventListener('keypress', (e) => {\n if(e.key === 'Enter') {\n cancelEvent(e);\n return inputField.value ? onContinueClick() : onSkipClick();\n }\n });\n\n const goNext = (e?: Event, saveHint?: boolean) => {\n if(e) {\n cancelEvent(e);\n }\n\n const hint = saveHint ? inputField.value : undefined;\n if(hint && this.newPassword === hint) {\n toast(I18n.format('PasswordAsHintError', true));\n return;\n }\n\n const tab = this.slider.createTab(AppTwoStepVerificationEmailTab);\n tab.state = this.state;\n tab.plainPassword = this.plainPassword;\n tab.newPassword = this.newPassword;\n tab.hint = hint;\n\n tab.open();\n };\n\n const btnContinue = Button('btn-primary btn-color-primary', {text: 'Continue'});\n const btnSkip = Button('btn-primary btn-secondary btn-primary-transparent primary', {text: 'YourEmailSkip'});\n\n const onContinueClick = (e?: Event) => goNext(e, true);\n const onSkipClick = (e?: Event) => goNext(e, false);\n attachClickEvent(btnContinue, onContinueClick);\n attachClickEvent(btnSkip, onSkipClick);\n\n inputWrapper.append(inputField.container, btnContinue, btnSkip);\n\n section.content.append(inputWrapper);\n\n this.scrollable.container.append(section.container);\n }\n\n onOpenAfterTimeout() {\n this.inputField.input.focus();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AccountPassword} from '../../../../layer';\nimport Button from '../../../button';\nimport PasswordInputField from '../../../passwordInputField';\nimport {SliderSuperTab} from '../../../slider';\nimport TrackingMonkey from '../../../monkeys/tracking';\nimport AppTwoStepVerificationHintTab from './hint';\nimport {InputState} from '../../../inputField';\nimport cancelEvent from '../../../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../../../helpers/dom/clickEvent';\nimport SettingSection from '../../../settingSection';\n\nexport default class AppTwoStepVerificationReEnterPasswordTab extends SliderSuperTab {\n public state: AccountPassword;\n public passwordInputField: PasswordInputField;\n public plainPassword: string;\n public newPassword: string;\n\n public init() {\n this.container.classList.add('two-step-verification', 'two-step-verification-enter-password', 'two-step-verification-re-enter-password');\n this.setTitle('PleaseReEnterPassword');\n\n const section = new SettingSection({\n noDelimiter: true\n });\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const passwordInputField = this.passwordInputField = new PasswordInputField({\n name: 're-enter-password',\n label: 'PleaseReEnterPassword'\n });\n\n const monkey = new TrackingMonkey(passwordInputField, 157);\n\n const btnContinue = Button('btn-primary btn-color-primary', {text: 'Continue'});\n\n inputWrapper.append(passwordInputField.container, btnContinue);\n section.content.append(monkey.container, inputWrapper);\n\n this.scrollable.container.append(section.container);\n\n passwordInputField.input.addEventListener('keypress', (e) => {\n if(passwordInputField.input.classList.contains('error')) {\n passwordInputField.setState(InputState.Neutral);\n }\n\n if(e.key === 'Enter') {\n return onContinueClick();\n }\n });\n\n const verifyInput = () => {\n if(this.newPassword !== passwordInputField.value) {\n passwordInputField.setError();\n return false;\n }\n\n return true;\n };\n\n const onContinueClick = (e?: Event) => {\n if(e) {\n cancelEvent(e);\n }\n\n if(!verifyInput()) return;\n\n const tab = this.slider.createTab(AppTwoStepVerificationHintTab);\n tab.state = this.state;\n tab.plainPassword = this.plainPassword;\n tab.newPassword = this.newPassword;\n tab.open();\n };\n attachClickEvent(btnContinue, onContinueClick);\n\n return monkey.load();\n }\n\n onOpenAfterTimeout() {\n this.passwordInputField.input.focus();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport AppTwoStepVerificationTab from '.';\nimport cancelEvent from '../../../../helpers/dom/cancelEvent';\nimport {canFocus} from '../../../../helpers/dom/canFocus';\nimport {attachClickEvent} from '../../../../helpers/dom/clickEvent';\nimport replaceContent from '../../../../helpers/dom/replaceContent';\nimport setInnerHTML from '../../../../helpers/dom/setInnerHTML';\nimport {AccountPassword} from '../../../../layer';\nimport I18n, {i18n} from '../../../../lib/langPack';\nimport wrapEmojiText from '../../../../lib/richTextProcessor/wrapEmojiText';\nimport Button from '../../../button';\nimport {putPreloader} from '../../../putPreloader';\nimport PasswordMonkey from '../../../monkeys/password';\nimport PasswordInputField from '../../../passwordInputField';\nimport {SliderSuperTab} from '../../../slider';\nimport AppTwoStepVerificationReEnterPasswordTab from './reEnterPassword';\nimport SettingSection from '../../../settingSection';\n\nexport default class AppTwoStepVerificationEnterPasswordTab extends SliderSuperTab {\n public state: AccountPassword;\n public passwordInputField: PasswordInputField;\n public plainPassword: string;\n public isFirst = true;\n\n public init() {\n const isNew = !this.state.pFlags.has_password || this.plainPassword;\n this.container.classList.add('two-step-verification', 'two-step-verification-enter-password');\n this.setTitle(isNew ? 'PleaseEnterFirstPassword' : 'PleaseEnterCurrentPassword');\n\n const section = new SettingSection({\n noDelimiter: true\n });\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const passwordInputField = this.passwordInputField = new PasswordInputField({\n name: 'enter-password',\n label: isNew ? 'PleaseEnterFirstPassword' : (this.state.hint ? undefined : 'LoginPassword'),\n labelText: !isNew && this.state.hint ? wrapEmojiText(this.state.hint) : undefined\n });\n\n const monkey = new PasswordMonkey(passwordInputField, 157);\n\n const btnContinue = Button('btn-primary btn-color-primary');\n const textEl = new I18n.IntlElement({key: 'Continue'});\n\n btnContinue.append(textEl.element);\n\n inputWrapper.append(passwordInputField.container, btnContinue);\n section.content.append(monkey.container, inputWrapper);\n\n this.scrollable.container.append(section.container);\n\n passwordInputField.input.addEventListener('keypress', (e) => {\n if(passwordInputField.input.classList.contains('error')) {\n passwordInputField.input.classList.remove('error');\n textEl.key = 'Continue';\n textEl.update();\n }\n\n if(e.key === 'Enter') {\n return onContinueClick();\n }\n });\n\n const verifyInput = () => {\n if(!passwordInputField.value.length) {\n passwordInputField.input.classList.add('error');\n return false;\n }\n\n return true;\n };\n\n let onContinueClick: (e?: Event) => void;\n if(!isNew) {\n let getStateInterval: number;\n\n const getState = () => {\n // * just to check session relevance\n if(!getStateInterval) {\n getStateInterval = window.setInterval(getState, 10e3);\n }\n\n return this.managers.passwordManager.getState().then((_state) => {\n this.state = _state;\n\n if(this.state.hint) {\n setInnerHTML(passwordInputField.label, wrapEmojiText(this.state.hint));\n } else {\n replaceContent(passwordInputField.label, i18n('LoginPassword'));\n }\n });\n };\n\n const submit = (e?: Event) => {\n if(!verifyInput()) {\n cancelEvent(e);\n return;\n }\n\n btnContinue.setAttribute('disabled', 'true');\n textEl.key = 'PleaseWait';\n textEl.update();\n const preloader = putPreloader(btnContinue);\n\n const plainPassword = passwordInputField.value;\n this.managers.passwordManager.check(passwordInputField.value, this.state).then((auth) => {\n console.log(auth);\n\n if(auth._ === 'auth.authorization') {\n clearInterval(getStateInterval);\n if(monkey) monkey.remove();\n const tab = this.slider.createTab(AppTwoStepVerificationTab);\n tab.state = this.state;\n tab.plainPassword = plainPassword;\n tab.open();\n this.slider.removeTabFromHistory(this);\n }\n }, (err) => {\n btnContinue.removeAttribute('disabled');\n passwordInputField.input.classList.add('error');\n\n switch(err.type) {\n default:\n // btnContinue.innerText = err.type;\n textEl.key = 'PASSWORD_HASH_INVALID';\n textEl.update();\n preloader.remove();\n passwordInputField.select();\n break;\n }\n\n getState();\n });\n };\n\n onContinueClick = submit;\n\n getState();\n } else {\n onContinueClick = (e) => {\n if(e) {\n cancelEvent(e);\n }\n\n if(!verifyInput()) return;\n\n const tab = this.slider.createTab(AppTwoStepVerificationReEnterPasswordTab);\n tab.state = this.state;\n tab.newPassword = passwordInputField.value;\n tab.plainPassword = this.plainPassword;\n tab.open();\n };\n }\n\n attachClickEvent(btnContinue, onContinueClick);\n\n return monkey.load();\n }\n\n onOpenAfterTimeout() {\n if(!canFocus(this.isFirst)) return;\n this.passwordInputField.input.focus();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from '../../../../helpers/dom/clickEvent';\nimport {AccountPassword} from '../../../../layer';\nimport {_i18n} from '../../../../lib/langPack';\nimport Button from '../../../button';\nimport PopupPeer from '../../../popups/peer';\nimport SettingSection from '../../../settingSection';\nimport {SliderSuperTab} from '../../../slider';\nimport wrapStickerEmoji from '../../../wrappers/stickerEmoji';\nimport AppSettingsTab from '../settings';\nimport AppTwoStepVerificationEmailTab from './email';\nimport AppTwoStepVerificationEnterPasswordTab from './enterPassword';\n\nexport default class AppTwoStepVerificationTab extends SliderSuperTab {\n public state: AccountPassword;\n public plainPassword: string;\n\n public init() {\n this.container.classList.add('two-step-verification', 'two-step-verification-main');\n this.setTitle('TwoStepVerificationTitle');\n\n const section = new SettingSection({\n captionOld: true,\n noDelimiter: true\n });\n\n const emoji = '🔐';\n const stickerContainer = document.createElement('div');\n\n wrapStickerEmoji({\n div: stickerContainer,\n width: 168,\n height: 168,\n emoji\n });\n\n section.content.append(stickerContainer);\n\n const c = section.generateContentElement();\n if(this.state.pFlags.has_password) {\n _i18n(section.caption, 'TwoStepAuth.GenericHelp');\n\n const btnChangePassword = Button('btn-primary btn-transparent', {icon: 'edit', text: 'TwoStepAuth.ChangePassword'});\n const btnDisablePassword = Button('btn-primary btn-transparent', {icon: 'passwordoff', text: 'TwoStepAuth.RemovePassword'});\n const btnSetRecoveryEmail = Button('btn-primary btn-transparent', {icon: 'email', text: this.state.pFlags.has_recovery ? 'TwoStepAuth.ChangeEmail' : 'TwoStepAuth.SetupEmail'});\n\n attachClickEvent(btnChangePassword, () => {\n const tab = this.slider.createTab(AppTwoStepVerificationEnterPasswordTab);\n tab.state = this.state;\n tab.plainPassword = this.plainPassword;\n tab.open();\n });\n\n attachClickEvent(btnDisablePassword, () => {\n const popup = new PopupPeer('popup-disable-password', {\n buttons: [{\n langKey: 'Disable',\n callback: () => {\n this.managers.passwordManager.updateSettings({currentPassword: this.plainPassword}).then(() => {\n this.slider.sliceTabsUntilTab(AppSettingsTab, this);\n this.close();\n });\n },\n isDanger: true\n }],\n titleLangKey: 'TurnPasswordOffQuestionTitle',\n descriptionLangKey: 'TurnPasswordOffQuestion'\n });\n\n popup.show();\n });\n\n attachClickEvent(btnSetRecoveryEmail, () => {\n const tab = this.slider.createTab(AppTwoStepVerificationEmailTab);\n tab.state = this.state;\n tab.hint = this.state.hint;\n tab.plainPassword = this.plainPassword;\n tab.newPassword = this.plainPassword;\n tab.isFirst = true;\n tab.open();\n });\n\n c.append(btnChangePassword, btnDisablePassword, btnSetRecoveryEmail);\n } else {\n _i18n(section.caption, 'TwoStepAuth.SetPasswordHelp');\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const btnSetPassword = Button('btn-primary btn-color-primary', {text: 'TwoStepVerificationSetPassword'});\n\n inputWrapper.append(btnSetPassword);\n c.append(inputWrapper);\n\n attachClickEvent(btnSetPassword, (e) => {\n const tab = this.slider.createTab(AppTwoStepVerificationEnterPasswordTab);\n tab.state = this.state;\n tab.open();\n });\n }\n\n this.scrollable.container.append(section.container);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport PrivacySection from '../../../privacySection';\nimport {LangPackKey} from '../../../../lib/langPack';\n\nexport default class AppPrivacyLastSeenTab extends SliderSuperTabEventable {\n public init() {\n this.container.classList.add('privacy-tab', 'privacy-last-seen');\n this.setTitle('PrivacyLastSeen');\n\n const caption: LangPackKey = 'PrivacySettingsController.LastSeenDescription';\n new PrivacySection({\n tab: this,\n title: 'LastSeenTitle',\n inputKey: 'inputPrivacyKeyStatusTimestamp',\n captions: [caption, caption, caption],\n exceptionTexts: ['PrivacySettingsController.NeverShare', 'PrivacySettingsController.AlwaysShare'],\n appendTo: this.scrollable,\n managers: this.managers\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport PrivacySection from '../../../privacySection';\nimport {LangPackKey} from '../../../../lib/langPack';\nimport PrivacyType from '../../../../lib/appManagers/utils/privacy/privacyType';\n\nexport default class AppPrivacyProfilePhotoTab extends SliderSuperTabEventable {\n public init() {\n this.container.classList.add('privacy-tab', 'privacy-profile-photo');\n this.setTitle('PrivacyProfilePhoto');\n\n const caption: LangPackKey = 'PrivacySettingsController.ProfilePhoto.CustomHelp';\n new PrivacySection({\n tab: this,\n title: 'PrivacyProfilePhotoTitle',\n inputKey: 'inputPrivacyKeyProfilePhoto',\n captions: [caption, caption, caption],\n exceptionTexts: ['PrivacySettingsController.NeverShare', 'PrivacySettingsController.AlwaysShare'],\n appendTo: this.scrollable,\n skipTypes: [PrivacyType.Nobody],\n managers: this.managers\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport PrivacySection from '../../../privacySection';\nimport {LangPackKey} from '../../../../lib/langPack';\n\nexport default class AppPrivacyForwardMessagesTab extends SliderSuperTabEventable {\n public init() {\n this.container.classList.add('privacy-tab', 'privacy-forward-messages');\n this.setTitle('PrivacySettings.Forwards');\n\n const caption: LangPackKey = 'PrivacySettingsController.Forwards.CustomHelp';\n new PrivacySection({\n tab: this,\n title: 'PrivacyForwardsTitle',\n inputKey: 'inputPrivacyKeyForwards',\n captions: [caption, caption, caption],\n exceptionTexts: ['PrivacySettingsController.NeverAllow', 'PrivacySettingsController.AlwaysAllow'],\n appendTo: this.scrollable,\n managers: this.managers\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport PrivacySection from '../../../privacySection';\nimport {LangPackKey} from '../../../../lib/langPack';\nimport PrivacyType from '../../../../lib/appManagers/utils/privacy/privacyType';\n\nexport default class AppPrivacyAddToGroupsTab extends SliderSuperTabEventable {\n public init() {\n this.container.classList.add('privacy-tab', 'privacy-add-to-groups');\n this.setTitle('PrivacySettings.Groups');\n\n const caption: LangPackKey = 'PrivacySettingsController.GroupDescription';\n new PrivacySection({\n tab: this,\n title: 'WhoCanAddMe',\n inputKey: 'inputPrivacyKeyChatInvite',\n captions: [caption, caption, caption],\n exceptionTexts: ['PrivacySettingsController.NeverAllow', 'PrivacySettingsController.AlwaysAllow'],\n appendTo: this.scrollable,\n skipTypes: [PrivacyType.Nobody],\n managers: this.managers\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport PrivacySection from '../../../privacySection';\nimport {LangPackKey} from '../../../../lib/langPack';\n\nexport default class AppPrivacyCallsTab extends SliderSuperTabEventable {\n public init() {\n this.container.classList.add('privacy-tab', 'privacy-calls');\n this.setTitle('PrivacySettings.VoiceCalls');\n\n const caption: LangPackKey = 'PrivacySettingsController.PhoneCallDescription';\n new PrivacySection({\n tab: this,\n title: 'WhoCanCallMe',\n inputKey: 'inputPrivacyKeyPhoneCall',\n captions: [caption, caption, caption],\n exceptionTexts: ['PrivacySettingsController.NeverAllow', 'PrivacySettingsController.AlwaysAllow'],\n appendTo: this.scrollable,\n managers: this.managers\n });\n\n {\n const caption: LangPackKey = 'PrivacySettingsController.P2p.Desc';\n new PrivacySection({\n tab: this,\n title: 'PrivacyP2PHeader',\n inputKey: 'inputPrivacyKeyPhoneP2P',\n captions: [caption, caption, caption],\n exceptionTexts: ['PrivacySettingsController.NeverAllow', 'PrivacySettingsController.AlwaysAllow'],\n appendTo: this.scrollable,\n managers: this.managers\n });\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Button from '../../button';\nimport Row from '../../row';\nimport {Authorization} from '../../../layer';\nimport {formatDateAccordingToTodayNew} from '../../../helpers/date';\nimport {ButtonMenuSync} from '../../buttonMenu';\nimport {toast} from '../../toast';\nimport I18n from '../../../lib/langPack';\nimport PopupPeer from '../../popups/peer';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport {SliderSuperTabEventable} from '../../sliderTab';\nimport findAndSplice from '../../../helpers/array/findAndSplice';\nimport {attachContextMenuListener} from '../../../helpers/dom/attachContextMenuListener';\nimport positionMenu from '../../../helpers/positionMenu';\nimport contextMenuController from '../../../helpers/contextMenuController';\nimport SettingSection from '../../settingSection';\n\nexport default class AppActiveSessionsTab extends SliderSuperTabEventable {\n public authorizations: Authorization.authorization[];\n private menuElement: HTMLElement;\n\n public init() {\n this.container.classList.add('active-sessions-container');\n this.setTitle('SessionsTitle');\n\n const Session = (auth: Authorization.authorization) => {\n const row = new Row({\n title: [auth.app_name, auth.app_version].join(' '),\n subtitle: [auth.ip, auth.country].join(' - '),\n clickable: true,\n titleRight: auth.pFlags.current ? undefined : formatDateAccordingToTodayNew(new Date(Math.max(auth.date_active, auth.date_created) * 1000))\n });\n\n row.container.dataset.hash = '' + auth.hash;\n\n row.midtitle.textContent = [auth.device_model, auth.system_version || auth.platform].filter(Boolean).join(', ');\n\n return row;\n };\n\n const authorizations = this.authorizations.slice();\n\n {\n const section = new SettingSection({\n name: 'CurrentSession',\n caption: 'ClearOtherSessionsHelp'\n });\n\n const auth = findAndSplice(authorizations, auth => auth.pFlags.current);\n const session = Session(auth);\n\n section.content.append(session.container);\n\n if(authorizations.length) {\n const btnTerminate = Button('btn-primary btn-transparent danger', {icon: 'stop', text: 'TerminateAllSessions'});\n attachClickEvent(btnTerminate, (e) => {\n new PopupPeer('revoke-session', {\n buttons: [{\n langKey: 'Terminate',\n isDanger: true,\n callback: () => {\n const toggle = toggleDisability([btnTerminate], true);\n this.managers.apiManager.invokeApi('auth.resetAuthorizations').then((value) => {\n // toggleDisability([btnTerminate], false);\n btnTerminate.remove();\n otherSection.container.remove();\n }, onError).finally(() => {\n toggle();\n });\n }\n }],\n titleLangKey: 'AreYouSureSessionsTitle',\n descriptionLangKey: 'AreYouSureSessions'\n }).show();\n }, {listenerSetter: this.listenerSetter});\n\n section.content.append(btnTerminate);\n }\n\n this.scrollable.append(section.container);\n }\n\n if(!authorizations.length) {\n return;\n }\n\n const otherSection = new SettingSection({\n name: 'OtherSessions',\n caption: 'SessionsListInfo'\n });\n\n authorizations.forEach((auth) => {\n otherSection.content.append(Session(auth).container);\n });\n\n this.scrollable.append(otherSection.container);\n\n const onError = (err: any) => {\n if(err.type === 'FRESH_RESET_AUTHORISATION_FORBIDDEN') {\n toast(I18n.format('RecentSessions.Error.FreshReset', true));\n }\n };\n\n let target: HTMLElement;\n const onTerminateClick = () => {\n const hash = target.dataset.hash;\n\n new PopupPeer('revoke-session', {\n buttons: [{\n langKey: 'Terminate',\n isDanger: true,\n callback: () => {\n this.managers.apiManager.invokeApi('account.resetAuthorization', {hash})\n .then((value) => {\n if(value) {\n target.remove();\n }\n }, onError);\n }\n }],\n titleLangKey: 'AreYouSureSessionTitle',\n descriptionLangKey: 'TerminateSessionText'\n }).show();\n };\n\n const element = this.menuElement = ButtonMenuSync({\n buttons: [{\n icon: 'stop',\n text: 'Terminate',\n onClick: onTerminateClick\n }]\n });\n element.id = 'active-sessions-contextmenu';\n element.classList.add('contextmenu');\n\n document.getElementById('page-chats').append(element);\n\n attachContextMenuListener({\n element: this.scrollable.container,\n callback: (e) => {\n target = findUpClassName(e.target, 'row');\n if(!target || target.dataset.hash === '0') {\n return;\n }\n\n if(e instanceof MouseEvent) e.preventDefault();\n // smth\n if(e instanceof MouseEvent) e.cancelBubble = true;\n\n positionMenu(e, element);\n contextMenuController.openBtnMenu(element);\n },\n listenerSetter: this.listenerSetter\n });\n\n attachClickEvent(this.scrollable.container, (e) => {\n target = findUpClassName(e.target, 'row');\n if(!target || target.dataset.hash === '0') {\n return;\n }\n\n onTerminateClick();\n }, {listenerSetter: this.listenerSetter});\n }\n\n onCloseAfterTimeout() {\n this.menuElement?.remove();\n return super.onCloseAfterTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider';\nimport {ButtonMenuSync} from '../../buttonMenu';\nimport appDialogsManager, {DIALOG_LIST_ELEMENT_TAG} from '../../../lib/appManagers/appDialogsManager';\nimport PopupPickUser from '../../popups/pickUser';\nimport rootScope from '../../../lib/rootScope';\nimport findUpTag from '../../../helpers/dom/findUpTag';\nimport ButtonCorner from '../../buttonCorner';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport formatUserPhone from '../../wrappers/formatUserPhone';\nimport getUserStatusString from '../../wrappers/getUserStatusString';\nimport {attachContextMenuListener} from '../../../helpers/dom/attachContextMenuListener';\nimport positionMenu from '../../../helpers/positionMenu';\nimport contextMenuController from '../../../helpers/contextMenuController';\nimport getPeerActiveUsernames from '../../../lib/appManagers/utils/peers/getPeerActiveUsernames';\nimport SettingSection from '../../settingSection';\n\nexport default class AppBlockedUsersTab extends SliderSuperTab {\n public peerIds: PeerId[];\n private menuElement: HTMLElement;\n\n public init() {\n this.container.classList.add('blocked-users-container');\n this.setTitle('BlockedUsers');\n\n const section = new SettingSection({\n caption: 'BlockedUsersInfo'\n });\n\n section.caption.parentElement.prepend(section.caption);\n\n this.scrollable.append(section.container);\n\n const btnAdd = ButtonCorner({icon: 'add', className: 'is-visible'});\n this.content.append(btnAdd);\n\n attachClickEvent(btnAdd, (e) => {\n new PopupPickUser({\n peerTypes: ['contacts'],\n placeholder: 'BlockModal.Search.Placeholder',\n onSelect: (peerId) => {\n // console.log('block', peerId);\n this.managers.appUsersManager.toggleBlock(peerId, true);\n }\n });\n }, {listenerSetter: this.listenerSetter});\n\n const list = appDialogsManager.createChatList();\n this.scrollable.container.classList.add('chatlist-container');\n section.content.append(list);\n\n const add = async(peerId: PeerId, append: boolean) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: peerId,\n container: list,\n rippleEnabled: true,\n avatarSize: 'abitbigger',\n append\n });\n\n const user = await this.managers.appUsersManager.getUser(peerId.toUserId());\n if(!user) {\n return;\n }\n\n const usernames = getPeerActiveUsernames(user);\n const username = usernames[0];\n if(user.pFlags.bot) {\n dom.lastMessageSpan.append('@' + username);\n } else {\n if(user.phone) dom.lastMessageSpan.innerHTML = formatUserPhone(user.phone);\n else dom.lastMessageSpan.append(username ? '@' + username : getUserStatusString(user));\n }\n\n // dom.titleSpan.innerHTML = 'Raaid El Syed';\n // dom.lastMessageSpan.innerHTML = '+1 234 567891';\n };\n\n for(const peerId of this.peerIds) {\n add(peerId, true);\n }\n\n let target: HTMLElement;\n const onUnblock = () => {\n const peerId = target.dataset.peerId.toPeerId();\n this.managers.appUsersManager.toggleBlock(peerId, false);\n };\n\n const element = this.menuElement = ButtonMenuSync({\n buttons: [{\n icon: 'lockoff',\n text: 'Unblock',\n onClick: onUnblock,\n options: {listenerSetter: this.listenerSetter}\n }]\n });\n element.id = 'blocked-users-contextmenu';\n element.classList.add('contextmenu');\n\n document.getElementById('page-chats').append(element);\n\n attachContextMenuListener({\n element: this.scrollable.container,\n callback: (e) => {\n target = findUpTag(e.target, DIALOG_LIST_ELEMENT_TAG);\n if(!target) {\n return;\n }\n\n if(e instanceof MouseEvent) e.preventDefault();\n // smth\n if(e instanceof MouseEvent) e.cancelBubble = true;\n\n positionMenu(e, element);\n contextMenuController.openBtnMenu(element);\n },\n listenerSetter: this.listenerSetter\n });\n\n this.listenerSetter.add(rootScope)('peer_block', (update) => {\n const {peerId, blocked} = update;\n const li = list.querySelector(`[data-peer-id=\"${peerId}\"]`);\n if(blocked) {\n if(!li) {\n add(peerId, false);\n }\n } else {\n if(li) {\n li.remove();\n }\n }\n });\n\n const LOAD_COUNT = 50;\n let loading = false;\n this.scrollable.onScrolledBottom = () => {\n if(loading) {\n return;\n }\n\n loading = true;\n this.managers.appUsersManager.getBlocked(list.childElementCount, LOAD_COUNT).then((res) => {\n for(const peerId of res.peerIds) {\n add(peerId, true);\n }\n\n if(res.peerIds.length < LOAD_COUNT || list.childElementCount === res.count) {\n this.scrollable.onScrolledBottom = null;\n }\n\n this.scrollable.checkForTriggers();\n }).finally(() => {\n loading = false;\n });\n };\n }\n\n onOpenAfterTimeout() {\n this.scrollable.onScroll();\n }\n\n onCloseAfterTimeout() {\n if(this.menuElement) {\n this.menuElement.remove();\n }\n\n return super.onCloseAfterTimeout();\n }\n}\n","export default function convertKeyToInputKey(key: string) {\n key = key[0].toUpperCase() + key.slice(1);\n key = 'input' + key;\n return key;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport PrivacySection from '../../../privacySection';\nimport {LangPackKey} from '../../../../lib/langPack';\n\nexport default class AppPrivacyVoicesTab extends SliderSuperTabEventable {\n public init() {\n this.container.classList.add('privacy-tab', 'privacy-voices');\n this.setTitle('PrivacyVoiceMessages');\n\n const caption: LangPackKey = 'PrivacyVoiceMessagesInfo';\n new PrivacySection({\n tab: this,\n title: 'PrivacyVoiceMessagesTitle',\n inputKey: 'inputPrivacyKeyVoiceMessages',\n captions: [caption, caption, caption],\n exceptionTexts: ['PrivacySettingsController.NeverAllow', 'PrivacySettingsController.AlwaysAllow'],\n appendTo: this.scrollable,\n managers: this.managers\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {formatDateAccordingToTodayNew} from '../../../helpers/date';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport {WebAuthorization} from '../../../layer';\nimport AvatarElement from '../../avatar';\nimport Button from '../../button';\nimport confirmationPopup from '../../confirmationPopup';\nimport Row from '../../row';\nimport SettingSection from '../../settingSection';\nimport {SliderSuperTabEventable} from '../../sliderTab';\nimport wrapPeerTitle from '../../wrappers/peerTitle';\n\nexport default class AppActiveWebSessionsTab extends SliderSuperTabEventable {\n public async init(sessions: WebAuthorization[]) {\n this.container.classList.add('active-sessions-container');\n this.setTitle('WebSessionsTitle');\n\n const Session = async(auth: WebAuthorization) => {\n const peerId = auth.bot_id.toPeerId();\n const row = new Row({\n title: await wrapPeerTitle({peerId}),\n subtitle: [auth.ip, auth.region].join(' - '),\n clickable: true,\n titleRight: formatDateAccordingToTodayNew(new Date(Math.max(auth.date_active, auth.date_created) * 1000))\n });\n\n const media = row.createMedia('big');\n const avatar = new AvatarElement();\n avatar.classList.add('avatar-48');\n await avatar.updateWithOptions({peerId});\n media.append(avatar);\n\n row.container.dataset.hash = '' + auth.hash;\n row.container.dataset.peerId = '' + peerId;\n\n row.midtitle.textContent = [auth.domain, auth.browser, auth.platform].filter(Boolean).join(', ');\n\n return row;\n };\n\n {\n const section = new SettingSection({\n caption: 'ClearOtherWebSessionsHelp'\n });\n\n const btnTerminate = Button('btn-primary btn-transparent danger', {icon: 'stop', text: 'TerminateAllWebSessions'});\n\n attachClickEvent(btnTerminate, async() => {\n await confirmationPopup({\n descriptionLangKey: 'AreYouSureWebSessions',\n button: {\n langKey: 'Disconnect',\n isDanger: true\n }\n });\n\n const toggle = toggleDisability([btnTerminate], true);\n this.managers.appSeamlessLoginManager.resetWebAuthorizations().then(() => {\n this.close();\n });\n }, {listenerSetter: this.listenerSetter});\n\n section.content.append(btnTerminate);\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({\n name: 'OtherWebSessions',\n caption: 'TerminateWebSessionInfo'\n });\n\n const rows = await Promise.all(sessions.map(Session));\n section.content.append(...rows.map((row) => row.container));\n\n let leftLength = rows.length;\n attachClickEvent(section.content, async(e) => {\n const row = findUpClassName(e.target, 'row');\n if(!row) {\n return;\n }\n\n await confirmationPopup({\n descriptionLangKey: 'TerminateWebSessionText',\n descriptionLangArgs: [await wrapPeerTitle({peerId: row.dataset.peerId.toPeerId()})],\n button: {\n langKey: 'Disconnect',\n isDanger: true\n }\n });\n\n const hash = row.dataset.hash;\n row.classList.add('is-disabled');\n this.managers.appSeamlessLoginManager.resetWebAuthorization(hash).then(() => {\n if(!--leftLength) {\n this.close();\n } else {\n row.remove();\n }\n });\n }, {listenerSetter: this.listenerSetter});\n\n this.scrollable.append(section.container);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport SliderSuperTab, {SliderSuperTabEventable} from '../../sliderTab';\nimport Row from '../../row';\nimport {AccountPassword, Authorization, InputPrivacyKey, Updates, WebAuthorization} from '../../../layer';\nimport AppPrivacyPhoneNumberTab from './privacy/phoneNumber';\nimport AppTwoStepVerificationTab from './2fa';\nimport AppTwoStepVerificationEnterPasswordTab from './2fa/enterPassword';\nimport AppTwoStepVerificationEmailConfirmationTab from './2fa/emailConfirmation';\nimport AppPrivacyLastSeenTab from './privacy/lastSeen';\nimport AppPrivacyProfilePhotoTab from './privacy/profilePhoto';\nimport AppPrivacyForwardMessagesTab from './privacy/forwardMessages';\nimport AppPrivacyAddToGroupsTab from './privacy/addToGroups';\nimport AppPrivacyCallsTab from './privacy/calls';\nimport AppActiveSessionsTab from './activeSessions';\nimport AppBlockedUsersTab from './blockedUsers';\nimport rootScope from '../../../lib/rootScope';\nimport {i18n, LangPackKey, _i18n} from '../../../lib/langPack';\nimport replaceContent from '../../../helpers/dom/replaceContent';\nimport CheckboxField from '../../checkboxField';\nimport PopupPeer from '../../popups/peer';\nimport Button from '../../button';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport convertKeyToInputKey from '../../../helpers/string/convertKeyToInputKey';\nimport getPrivacyRulesDetails from '../../../lib/appManagers/utils/privacy/getPrivacyRulesDetails';\nimport PrivacyType from '../../../lib/appManagers/utils/privacy/privacyType';\nimport confirmationPopup, {PopupConfirmationOptions} from '../../confirmationPopup';\nimport noop from '../../../helpers/noop';\nimport {toastNew} from '../../toast';\nimport AppPrivacyVoicesTab from './privacy/voices';\nimport SettingSection from '../../settingSection';\nimport AppActiveWebSessionsTab from './activeWebSessions';\n\nexport default class AppPrivacyAndSecurityTab extends SliderSuperTabEventable {\n private activeSessionsRow: Row;\n private authorizations: Authorization.authorization[];\n\n private websitesRow: Row;\n private websites: WebAuthorization[];\n\n public static getInitArgs(fromTab: SliderSuperTab) {\n return {\n appConfig: fromTab.managers.apiManager.getAppConfig(),\n globalPrivacy: fromTab.managers.appPrivacyManager.getGlobalPrivacySettings(),\n contentSettings: fromTab.managers.apiManager.invokeApi('account.getContentSettings'),\n webAuthorizations: fromTab.managers.appSeamlessLoginManager.getWebAuthorizations()\n };\n }\n\n public init(p: ReturnType) {\n this.container.classList.add('dont-u-dare-block-me');\n this.setTitle('PrivacySettings');\n\n const SUBTITLE: LangPackKey = 'Loading';\n const promises: Promise[] = [];\n\n {\n const section = new SettingSection({noDelimiter: true, caption: 'SessionsInfo'});\n\n let blockedPeerIds: PeerId[];\n const blockedUsersRow = new Row({\n icon: 'deleteuser',\n titleLangKey: 'BlockedUsers',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n const tab = this.slider.createTab(AppBlockedUsersTab);\n tab.peerIds = blockedPeerIds;\n tab.open();\n },\n listenerSetter: this.listenerSetter\n });\n blockedUsersRow.freezed = true;\n\n let passwordState: AccountPassword;\n const twoFactorRowOptions = {\n icon: 'lock',\n titleLangKey: 'TwoStepVerification' as LangPackKey,\n subtitleLangKey: SUBTITLE,\n clickable: (e: Event) => {\n let tab: AppTwoStepVerificationTab | AppTwoStepVerificationEnterPasswordTab | AppTwoStepVerificationEmailConfirmationTab;\n if(passwordState.pFlags.has_password) {\n tab = this.slider.createTab(AppTwoStepVerificationEnterPasswordTab);\n } else if(passwordState.email_unconfirmed_pattern) {\n tab = this.slider.createTab(AppTwoStepVerificationEmailConfirmationTab);\n tab.email = passwordState.email_unconfirmed_pattern;\n tab.length = 6;\n tab.isFirst = true;\n this.managers.passwordManager.resendPasswordEmail();\n } else {\n tab = this.slider.createTab(AppTwoStepVerificationTab);\n }\n\n tab.state = passwordState;\n tab.open();\n },\n listenerSetter: this.listenerSetter\n };\n\n const twoFactorRow = new Row(twoFactorRowOptions);\n twoFactorRow.freezed = true;\n\n const activeSessionsRow = this.activeSessionsRow = new Row({\n icon: 'activesessions',\n titleLangKey: 'SessionsTitle',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n const tab = this.slider.createTab(AppActiveSessionsTab);\n tab.authorizations = this.authorizations;\n tab.eventListener.addEventListener('destroy', () => {\n this.updateActiveSessions();\n }, {once: true});\n tab.open();\n },\n listenerSetter: this.listenerSetter\n });\n activeSessionsRow.freezed = true;\n\n const websitesRow = this.websitesRow = new Row({\n icon: 'mention',\n titleLangKey: 'OtherWebSessions',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n const tab = this.slider.createTab(AppActiveWebSessionsTab);\n tab.eventListener.addEventListener('destroy', () => {\n this.updateActiveWebsites();\n });\n tab.open(this.websites);\n },\n listenerSetter: this.listenerSetter\n });\n websitesRow.freezed = true;\n\n section.content.append(blockedUsersRow.container, twoFactorRow.container, activeSessionsRow.container, websitesRow.container);\n this.scrollable.append(section.container);\n\n const setBlockedCount = (count: number) => {\n if(count) {\n replaceContent(blockedUsersRow.subtitle, i18n('PrivacySettingsController.UserCount', [count]));\n } else {\n replaceContent(blockedUsersRow.subtitle, i18n('BlockedEmpty', [count]));\n }\n };\n\n this.listenerSetter.add(rootScope)('peer_block', () => {\n /* const {blocked, peerId} = update;\n if(!blocked) blockedPeerIds.findAndSplice((p) => p === peerId);\n else blockedPeerIds.unshift(peerId);\n blockedCount += blocked ? 1 : -1;\n setBlockedCount(blockedCount); */\n updateBlocked();\n });\n\n const updateBlocked = () => {\n this.managers.appUsersManager.getBlocked().then((res) => {\n blockedUsersRow.freezed = false;\n setBlockedCount(res.count);\n blockedPeerIds = res.peerIds;\n });\n };\n\n updateBlocked();\n\n this.managers.passwordManager.getState().then((state) => {\n passwordState = state;\n replaceContent(twoFactorRow.subtitle, i18n(state.pFlags.has_password ? 'PrivacyAndSecurity.Item.On' : 'PrivacyAndSecurity.Item.Off'));\n twoFactorRow.freezed = false;\n\n // console.log('password state', state);\n });\n\n this.updateActiveSessions();\n promises.push(this.updateActiveWebsites(p.webAuthorizations));\n }\n\n {\n const section = new SettingSection({name: 'PrivacyTitle', caption: 'GroupsAndChannelsHelp'});\n\n section.content.classList.add('privacy-navigation-container');\n\n const rowsByKeys: Partial<{\n [key in InputPrivacyKey['_']]: Row\n }> = {};\n\n const numberVisibilityRow = rowsByKeys['inputPrivacyKeyPhoneNumber'] = new Row({\n titleLangKey: 'PrivacyPhoneTitle',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n this.slider.createTab(AppPrivacyPhoneNumberTab).open();\n },\n listenerSetter: this.listenerSetter\n });\n\n const lastSeenTimeRow = rowsByKeys['inputPrivacyKeyStatusTimestamp'] = new Row({\n titleLangKey: 'LastSeenTitle',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n this.slider.createTab(AppPrivacyLastSeenTab).open();\n },\n listenerSetter: this.listenerSetter\n });\n\n const photoVisibilityRow = rowsByKeys['inputPrivacyKeyProfilePhoto'] = new Row({\n titleLangKey: 'PrivacyProfilePhotoTitle',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n this.slider.createTab(AppPrivacyProfilePhotoTab).open();\n },\n listenerSetter: this.listenerSetter\n });\n\n const callRow = rowsByKeys['inputPrivacyKeyPhoneCall'] = new Row({\n titleLangKey: 'WhoCanCallMe',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n this.slider.createTab(AppPrivacyCallsTab).open();\n },\n listenerSetter: this.listenerSetter\n });\n\n const linkAccountRow = rowsByKeys['inputPrivacyKeyForwards'] = new Row({\n titleLangKey: 'PrivacyForwardsTitle',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n this.slider.createTab(AppPrivacyForwardMessagesTab).open();\n },\n listenerSetter: this.listenerSetter\n });\n\n const groupChatsAddRow = rowsByKeys['inputPrivacyKeyChatInvite'] = new Row({\n titleLangKey: 'WhoCanAddMe',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n this.slider.createTab(AppPrivacyAddToGroupsTab).open();\n },\n listenerSetter: this.listenerSetter\n });\n\n const voicesRow = rowsByKeys['inputPrivacyKeyVoiceMessages'] = new Row({\n titleLangKey: 'PrivacyVoiceMessagesTitle',\n subtitleLangKey: SUBTITLE,\n clickable: () => {\n if(!rootScope.premium) {\n toastNew({langPackKey: 'PrivacyVoiceMessagesPremiumOnly'});\n } else {\n this.slider.createTab(AppPrivacyVoicesTab).open();\n }\n },\n listenerSetter: this.listenerSetter\n });\n\n const updatePrivacyRow = (key: InputPrivacyKey['_']) => {\n const row = rowsByKeys[key];\n if(!row) {\n return;\n }\n\n this.managers.appPrivacyManager.getPrivacy(key).then((rules) => {\n const details = getPrivacyRulesDetails(rules);\n const langKey = details.type === PrivacyType.Everybody ? 'PrivacySettingsController.Everbody' : (details.type === PrivacyType.Contacts ? 'PrivacySettingsController.MyContacts' : 'PrivacySettingsController.Nobody');\n const disallowLength = details.disallowPeers.users.length + details.disallowPeers.chats.length;\n const allowLength = details.allowPeers.users.length + details.allowPeers.chats.length;\n\n row.subtitle.innerHTML = '';\n const s = i18n(langKey);\n row.subtitle.append(s);\n if(disallowLength || allowLength) {\n row.subtitle.append(` (${[-disallowLength, allowLength ? '+' + allowLength : 0].filter(Boolean).join(', ')})`);\n }\n });\n };\n\n section.content.append(\n numberVisibilityRow.container,\n lastSeenTimeRow.container,\n photoVisibilityRow.container,\n callRow.container,\n linkAccountRow.container,\n groupChatsAddRow.container,\n voicesRow.container\n );\n this.scrollable.append(section.container);\n\n for(const key in rowsByKeys) {\n updatePrivacyRow(key as keyof typeof rowsByKeys);\n }\n\n rootScope.addEventListener('privacy_update', (update) => {\n updatePrivacyRow(convertKeyToInputKey(update.key._) as any);\n });\n }\n\n {\n const section = new SettingSection({name: 'NewChatsFromNonContacts', caption: 'ArchiveAndMuteInfo'});\n\n const checkboxField = new CheckboxField({text: 'ArchiveAndMute'});\n const row = new Row({\n checkboxField\n });\n\n section.content.append(row.container);\n\n let enabled: boolean, destroyed: boolean;\n this.eventListener.addEventListener('destroy', () => {\n destroyed = true;\n if(enabled === undefined || enabled === checkboxField.checked) return;\n return this.managers.appPrivacyManager.setGlobalPrivacySettings({\n _: 'globalPrivacySettings',\n archive_and_mute_new_noncontact_peers: checkboxField.checked\n });\n }, {once: true});\n\n const promise = Promise.all([\n p.appConfig,\n p.globalPrivacy\n ]).then(([appConfig, settings]) => {\n if(destroyed) {\n return;\n }\n\n const onPremiumToggle = (isPremium: boolean) => {\n section.container.classList.toggle('hide', !isPremium && !appConfig.autoarchive_setting_available);\n };\n\n this.listenerSetter.add(rootScope)('premium_toggle', onPremiumToggle);\n onPremiumToggle(rootScope.premium);\n\n enabled = !!settings.archive_and_mute_new_noncontact_peers;\n\n checkboxField.setValueSilently(enabled);\n });\n\n promises.push(promise);\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({name: 'Privacy.SensitiveContent', caption: 'PrivacyAndSecurity.SensitiveDesc'});\n section.container.classList.add('hide');\n\n const checkboxField = new CheckboxField({text: 'PrivacyAndSecurity.SensitiveText'});\n const row = new Row({\n checkboxField\n });\n\n section.content.append(row.container);\n\n let enabled: boolean;\n this.eventListener.addEventListener('destroy', () => {\n if(enabled === undefined) return;\n const _enabled = row.checkboxField.checked;\n const isChanged = _enabled !== enabled;\n if(!isChanged) {\n return;\n }\n\n return this.managers.apiManager.invokeApi('account.setContentSettings', {\n sensitive_enabled: _enabled\n });\n }, {once: true});\n\n const promise = p.contentSettings.then((settings) => {\n if(!settings.pFlags.sensitive_can_change) {\n return;\n }\n\n enabled = !!settings.pFlags.sensitive_enabled;\n checkboxField.setValueSilently(enabled);\n section.container.classList.remove('hide');\n });\n\n promises.push(promise);\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({name: 'PrivacyPayments', caption: 'PrivacyPaymentsClearInfo'});\n\n const onClearClick = () => {\n const options: PopupConfirmationOptions = {\n titleLangKey: 'PrivacyPaymentsClearAlertTitle',\n descriptionLangKey: 'PrivacyPaymentsClearAlertText',\n button: {\n langKey: 'Clear'\n },\n checkboxes: [{\n text: 'PrivacyClearShipping',\n checked: true\n }, {\n text: 'PrivacyClearPayment',\n checked: true\n }]\n };\n\n confirmationPopup(options).then(() => {\n const [info, payment] = options.checkboxes.map((c) => c.checkboxField.checked);\n const toggle = toggleDisability([clearButton], true);\n this.managers.appPaymentsManager.clearSavedInfo(info, payment).then(() => {\n if(!info && !payment) {\n return;\n }\n\n toggle();\n toastNew({\n langPackKey: info && payment ? 'PrivacyPaymentsPaymentShippingCleared' : (info ? 'PrivacyPaymentsShippingInfoCleared' : 'PrivacyPaymentsPaymentInfoCleared')\n });\n });\n }, noop);\n };\n\n const clearButton = Button('btn-primary btn-transparent', {icon: 'delete', text: 'PrivacyPaymentsClear'});\n this.listenerSetter.add(clearButton)('click', onClearClick);\n section.content.append(clearButton);\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({name: 'FilterChats'});\n\n const onDeleteClick = () => {\n const popup = new PopupPeer('popup-delete-drafts', {\n buttons: [{\n langKey: 'Delete',\n callback: () => {\n const toggle = toggleDisability([deleteButton], true);\n this.managers.appDraftsManager.clearAllDrafts().then(() => {\n toggle();\n });\n },\n isDanger: true\n }],\n titleLangKey: 'AreYouSureClearDraftsTitle',\n descriptionLangKey: 'AreYouSureClearDrafts'\n });\n\n popup.show();\n };\n\n const deleteButton = Button('btn-primary btn-transparent', {icon: 'delete', text: 'PrivacyDeleteCloudDrafts'});\n this.listenerSetter.add(deleteButton)('click', onDeleteClick);\n section.content.append(deleteButton);\n\n /* promises.push(apiManager.invokeApi('messages.getAllDrafts').then((drafts) => {\n const draftsRow = new Row({\n titleLangKey: 'PrivacyDeleteCloudDrafts',\n subtitleLangKey: 'Drafts',\n subtitleLangArgs: [(drafts as Updates.updates).updates.length],\n icon: 'delete',\n clickable: onDeleteClick\n });\n\n section.content.append(draftsRow.container);\n })); */\n\n this.scrollable.append(section.container);\n }\n\n // {\n // const section = new SettingSection({\n // name: 'OtherWebSessions'\n // });\n\n // const row = new Row({\n\n // });\n\n // this.scrollable.append(section.container);\n // }\n\n return Promise.all(promises);\n }\n\n public updateActiveSessions() {\n return this.managers.apiManager.invokeApi('account.getAuthorizations').then((auths) => {\n this.activeSessionsRow.freezed = false;\n this.authorizations = auths.authorizations;\n _i18n(this.activeSessionsRow.subtitle, 'Privacy.Devices', [this.authorizations.length]);\n });\n }\n\n public updateActiveWebsites(promise = this.managers.appSeamlessLoginManager.getWebAuthorizations()) {\n return promise.then((authorizations) => {\n this.websitesRow.freezed = false;\n this.websites = authorizations;\n _i18n(this.websitesRow.subtitle, 'Privacy.Websites', [this.websites.length]);\n this.websitesRow.container.classList.toggle('hide', !this.websites.length);\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {State} from '../../../config/state';\nimport flatten from '../../../helpers/array/flatten';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport {LiteModeKey} from '../../../helpers/liteMode';\nimport pause from '../../../helpers/schedulers/pause';\nimport rootScope from '../../../lib/rootScope';\nimport CheckboxFields, {CheckboxFieldsField} from '../../checkboxFields';\nimport SettingSection from '../../settingSection';\nimport SliderSuperTab from '../../sliderTab';\nimport {toastNew} from '../../toast';\n\ntype PowerSavingCheckboxFieldsField = CheckboxFieldsField & {\n key: LiteModeKey\n};\n\nexport default class AppPowerSavingTab extends SliderSuperTab {\n public init() {\n this.container.classList.add('power-saving-container');\n this.setTitle('LiteMode.Title');\n\n const form = document.createElement('form');\n\n let infoSection: SettingSection;\n {\n const section = infoSection = new SettingSection({\n caption: 'LiteMode.Info'\n });\n\n form.append(section.container);\n }\n\n const keys: Array = [\n 'all',\n 'video',\n 'gif',\n ['stickers', ['stickers_panel', 'stickers_chat']],\n // ['emoji', ['emoji_panel', 'emoji_messages']],\n ['effects', ['effects_reactions', 'effects_premiumstickers', 'effects_emoji']],\n ['chat', ['chat_background', 'chat_spoilers']],\n 'animations'\n ];\n\n let fields: PowerSavingCheckboxFieldsField[], checkboxFields: CheckboxFields;\n {\n const section = new SettingSection({});\n\n const wrap = (key: typeof keys[0]): PowerSavingCheckboxFieldsField[] => {\n const isArray = Array.isArray(key);\n const mainKey = isArray ? key[0] : key;\n const nested = isArray ? flatten(key[1].map(wrap)) : undefined;\n const value = rootScope.settings.liteMode[mainKey];\n return [{\n key: mainKey,\n text: mainKey === 'all' ? 'LiteMode.EnableText' : `LiteMode.Key.${mainKey}.Title`,\n checked: mainKey === 'all' ? value : !value,\n nested: nested,\n name: 'power-saving-' + mainKey\n }, ...(nested || [])];\n };\n\n fields = flatten(keys.map(wrap));\n\n checkboxFields = new CheckboxFields({\n fields: fields,\n listenerSetter: this.listenerSetter\n });\n\n fields.forEach((field, idx) => {\n const created = checkboxFields.createField(field);\n if(!created) {\n return;\n }\n\n const {row, nodes} = created;\n (idx === 0 ? infoSection : section).content.append(...nodes);\n });\n\n attachClickEvent(section.content, () => {\n if(rootScope.settings.liteMode.all) {\n toastNew({langPackKey: 'LiteMode.DisableAlert'});\n }\n }, {listenerSetter: this.listenerSetter});\n\n form.append(section.container);\n }\n\n const onAllChange = (disable: boolean) => {\n fields.forEach((field) => {\n if(field.key === 'all') {\n return;\n }\n\n if(field.nested) {\n checkboxFields.setNestedCounter(field, disable ? 0 : undefined);\n }\n\n field.checkboxField.input.classList.toggle('is-fake-disabled', disable);\n field.row.toggleDisability(disable);\n });\n };\n\n this.listenerSetter.add(form)('change', async() => {\n const liteMode: State['settings']['liteMode'] = {} as any;\n fields.forEach((field) => {\n const checked = field.checkboxField.checked;\n liteMode[field.key] = field.key === 'all' ? checked : !checked;\n });\n\n const wasAll = rootScope.settings.liteMode.all;\n if(wasAll !== liteMode.all) {\n onAllChange(!wasAll);\n\n if(liteMode.all) {\n await pause(200);\n }\n }\n\n await this.managers.appStateManager.setByKey('settings.liteMode', rootScope.settings.liteMode = liteMode);\n });\n\n onAllChange(rootScope.settings.liteMode.all);\n\n this.scrollable.append(form);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport RangeSelector from '../../rangeSelector';\nimport Button from '../../button';\nimport CheckboxField from '../../checkboxField';\nimport RadioField from '../../radioField';\nimport rootScope from '../../../lib/rootScope';\nimport {IS_APPLE, IS_SAFARI} from '../../../environment/userAgent';\nimport Row, {CreateRowFromCheckboxField} from '../../row';\nimport AppBackgroundTab from './background';\nimport I18n, {i18n, LangPackKey, _i18n} from '../../../lib/langPack';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport assumeType from '../../../helpers/assumeType';\nimport {BaseTheme, MessagesAllStickers, StickerSet} from '../../../layer';\nimport LazyLoadQueue from '../../lazyLoadQueue';\nimport PopupStickers from '../../popups/stickers';\nimport eachMinute from '../../../helpers/eachMinute';\nimport {SliderSuperTabEventable} from '../../sliderTab';\nimport IS_GEOLOCATION_SUPPORTED from '../../../environment/geolocationSupport';\nimport AppQuickReactionTab from './quickReaction';\nimport wrapEmojiText from '../../../lib/richTextProcessor/wrapEmojiText';\nimport {DEFAULT_THEME, State} from '../../../config/state';\nimport wrapStickerSetThumb from '../../wrappers/stickerSetThumb';\nimport wrapStickerToRow from '../../wrappers/stickerToRow';\nimport SettingSection, {generateSection} from '../../settingSection';\nimport {ScrollableX} from '../../scrollable';\nimport wrapStickerEmoji from '../../wrappers/stickerEmoji';\nimport {Theme} from '../../../layer';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport RLottiePlayer from '../../../lib/rlottie/rlottiePlayer';\nimport themeController from '../../../helpers/themeController';\nimport liteMode from '../../../helpers/liteMode';\nimport AppPowerSavingTab from './powerSaving';\nimport {toastNew} from '../../toast';\n\nexport class RangeSettingSelector {\n public container: HTMLDivElement;\n public valueContainer: HTMLElement;\n private range: RangeSelector;\n\n public onChange: (value: number) => void;\n\n constructor(\n name: LangPackKey,\n step: number,\n initialValue: number,\n minValue: number,\n maxValue: number,\n writeValue = true\n ) {\n const BASE_CLASS = 'range-setting-selector';\n this.container = document.createElement('div');\n this.container.classList.add(BASE_CLASS);\n\n const details = document.createElement('div');\n details.classList.add(BASE_CLASS + '-details');\n\n const nameDiv = document.createElement('div');\n nameDiv.classList.add(BASE_CLASS + '-name');\n _i18n(nameDiv, name);\n\n const valueDiv = this.valueContainer = document.createElement('div');\n valueDiv.classList.add(BASE_CLASS + '-value');\n\n if(writeValue) {\n valueDiv.innerHTML = '' + initialValue;\n }\n\n details.append(nameDiv, valueDiv);\n\n this.range = new RangeSelector({\n step,\n min: minValue,\n max: maxValue\n }, initialValue);\n this.range.setListeners();\n this.range.setHandlers({\n onScrub: value => {\n if(this.onChange) {\n this.onChange(value);\n }\n\n if(writeValue) {\n // console.log('font size scrub:', value);\n valueDiv.innerText = '' + value;\n }\n }\n });\n\n this.container.append(details, this.range.container);\n }\n}\n\nexport default class AppGeneralSettingsTab extends SliderSuperTabEventable {\n public static getInitArgs() {\n return {\n themes: rootScope.managers.appThemesManager.getThemes()\n };\n }\n\n public init(p: ReturnType) {\n this.container.classList.add('general-settings-container');\n this.setTitle('General');\n\n const section = generateSection.bind(null, this.scrollable);\n const promises: Promise[] = [];\n\n {\n const container = section('Settings');\n\n const range = new RangeSettingSelector('TextSize', 1, rootScope.settings.messagesTextSize, 12, 20);\n range.onChange = (value) => {\n rootScope.managers.appStateManager.setByKey('settings.messagesTextSize', value);\n };\n\n const chatBackgroundButton = Button('btn-primary btn-transparent', {icon: 'image', text: 'ChatBackground'});\n\n const initArgs = AppBackgroundTab.getInitArgs();\n attachClickEvent(chatBackgroundButton, () => {\n this.slider.createTab(AppBackgroundTab).open(initArgs);\n });\n\n const getLiteModeStatus = (): LangPackKey => rootScope.settings.liteMode.all ? 'Checkbox.Enabled' : 'Checkbox.Disabled';\n const i = new I18n.IntlElement();\n\n const onUpdate = () => {\n i.compareAndUpdate({key: getLiteModeStatus()});\n animationsCheckboxField.setValueSilently(liteMode.isAvailable('animations'));\n animationsCheckboxField.toggleDisability(liteMode.isEnabled());\n };\n\n const animationsCheckboxField = new CheckboxField({\n text: 'EnableAnimations',\n name: 'animations',\n stateKey: 'settings.liteMode.animations',\n stateValueReverse: true,\n checked: false,\n listenerSetter: this.listenerSetter\n });\n\n const animationsRow = new Row({\n checkboxField: animationsCheckboxField,\n clickable: () => {\n if(animationsCheckboxField.isDisabled()) {\n toastNew({langPackKey: 'LiteMode.DisableAlert'});\n }\n },\n listenerSetter: this.listenerSetter\n });\n\n const liteModeRow = new Row({\n icon: 'animations',\n titleLangKey: 'LiteMode.EnableText',\n titleRightSecondary: i.element,\n clickable: () => {\n this.slider.createTab(AppPowerSavingTab).open();\n },\n listenerSetter: this.listenerSetter\n });\n\n onUpdate();\n\n this.listenerSetter.add(rootScope)('settings_updated', onUpdate);\n\n container.append(\n range.container,\n chatBackgroundButton,\n animationsRow.container,\n liteModeRow.container\n );\n }\n\n {\n const container = section('ColorTheme');\n\n const scrollable = new ScrollableX(null);\n const themesContainer = scrollable.container;\n themesContainer.classList.add('themes-container');\n\n type K = {\n container: HTMLElement,\n theme: Theme,\n player?: RLottiePlayer,\n wallPaperContainers?: {[key in BaseTheme['_']]?: HTMLElement}\n };\n const themesMap = new Map();\n let currentTheme = themeController.getTheme();\n let isNight = themeController.isNight();\n\n const applyThemeOnItem = (item: K) => {\n themeController.applyTheme(item.theme, item.container);\n\n const previous = item.container.querySelector('.background-item');\n previous?.remove();\n\n const wallPaperContainer = item.wallPaperContainers[isNight ? 'baseThemeNight' : 'baseThemeClassic']\n if(wallPaperContainer) {\n item.container.prepend(wallPaperContainer);\n }\n };\n\n let lastOnFrameNo: (frameNo: number) => void;\n\n attachClickEvent(themesContainer, async(e) => {\n const container = findUpClassName(e.target, 'theme-container');\n if(!container) {\n return;\n }\n\n const lastActive = themesContainer.querySelector('.active');\n if(lastActive) {\n lastActive.classList.remove('active');\n }\n\n const item = themesMap.get(container);\n container.classList.add('active');\n\n await themeController.applyNewTheme(item.theme);\n\n lastOnFrameNo?.(-1);\n\n if(item.player && liteMode.isAvailable('animations')) {\n if(IS_SAFARI) {\n if(item.player.paused) {\n item.player.restart();\n }\n } else {\n if(item.player.paused) {\n item.player.stop(true);\n }\n\n item.player.el[0].style.transform = 'scale(2)';\n\n const onFrameNo = lastOnFrameNo = (frameNo) => {\n if(item.player.maxFrame === frameNo || frameNo === -1) {\n item.player.el[0].style.transform = '';\n item.player.removeEventListener('enterFrame', onFrameNo);\n\n if(lastOnFrameNo === onFrameNo) {\n lastOnFrameNo = undefined;\n }\n }\n };\n\n setTimeout(() => {\n if(lastOnFrameNo !== onFrameNo) {\n return;\n }\n\n item.player.play();\n item.player.addEventListener('enterFrame', onFrameNo);\n }, 250);\n }\n }\n }, {listenerSetter: this.listenerSetter});\n\n const availableBaseThemes: Set = new Set(['baseThemeClassic', 'baseThemeNight']);\n\n const promise = p.themes.then(async(themes) => {\n const defaultThemes = themes.filter((theme) => theme.pFlags.default/* && theme.settings[0].message_colors.length === 1 */);\n defaultThemes.unshift(DEFAULT_THEME);\n\n const promises = defaultThemes.map(async(theme) => {\n const container = document.createElement('div');\n const k: K = {\n container,\n theme,\n wallPaperContainers: {}\n };\n\n const results = theme.settings\n .filter((themeSettings) => availableBaseThemes.has(themeSettings.base_theme._))\n .map((themeSettings) => {\n const wallPaper = themeSettings.wallpaper;\n const result = AppBackgroundTab.addWallPaper(wallPaper);\n k.wallPaperContainers[themeSettings.base_theme._] = result.container;\n return result;\n });\n\n themesMap.set(container, k);\n\n applyThemeOnItem(k);\n\n if(theme.id === currentTheme.id) {\n container.classList.add('active');\n }\n\n const emoticon = theme.emoticon;\n const loadPromises: Promise[] = [];\n let emoticonContainer: HTMLElement;\n if(emoticon) {\n emoticonContainer = document.createElement('div');\n emoticonContainer.classList.add('theme-emoticon');\n const size = 28 * 1.75;\n wrapStickerEmoji({\n div: emoticonContainer,\n width: size,\n height: size,\n emoji: theme.emoticon,\n managers: this.managers,\n loadPromises,\n middleware: this.middlewareHelper.get(),\n play: false\n }).then(({render}) => render).then((player) => {\n k.player = player as RLottiePlayer;\n });\n }\n\n const bubble = document.createElement('div');\n bubble.classList.add('theme-bubble');\n\n const bubbleIn = bubble.cloneNode() as HTMLElement;\n\n bubbleIn.classList.add('is-in');\n bubble.classList.add('is-out');\n\n loadPromises.push(...results.map((result) => result.loadPromise));\n\n container.classList.add('theme-container');\n\n await Promise.all(loadPromises);\n\n if(emoticonContainer) {\n container.append(emoticonContainer);\n }\n\n container.append(bubbleIn, bubble);\n\n return container;\n });\n\n const containers = await Promise.all(promises);\n\n scrollable.append(...containers);\n });\n\n promises.push(promise);\n\n const form = document.createElement('form');\n form.style.marginTop = '.5rem';\n\n const name = 'theme';\n const stateKey = 'settings.theme';\n\n const dayRow = new Row({\n radioField: new RadioField({\n langKey: 'ThemeDay',\n name,\n value: 'day',\n stateKey\n })\n });\n\n const nightRow = new Row({\n radioField: new RadioField({\n langKey: 'ThemeNight',\n name,\n value: 'night',\n stateKey\n })\n });\n\n const systemRow = new Row({\n radioField: new RadioField({\n langKey: 'AutoNightSystemDefault',\n name,\n value: 'system',\n stateKey\n })\n });\n\n this.listenerSetter.add(rootScope)('settings_updated', ({key, value, settings}) => {\n if(key === stateKey) {\n rootScope.dispatchEvent('theme_change');\n }\n });\n\n this.listenerSetter.add(rootScope)('theme_change', () => {\n currentTheme = themeController.getTheme();\n const newIsNight = themeController.isNight();\n if(isNight === newIsNight) {\n return;\n }\n\n isNight = newIsNight;\n\n const lastActive = themesContainer.querySelector('.active');\n if(lastActive) {\n lastActive.classList.remove('active');\n }\n\n let active: HTMLElement;\n themesMap.forEach((item) => {\n applyThemeOnItem(item);\n\n if(item.theme.id === currentTheme.id) {\n item.container.classList.add('active');\n active = item.container;\n }\n });\n\n if(active) {\n scrollable.scrollIntoViewNew({\n element: active,\n position: 'center',\n axis: 'x'\n });\n }\n });\n\n form.append(dayRow.container, nightRow.container, systemRow.container);\n\n container.append(\n themesContainer,\n form\n );\n }\n\n {\n const container = section('General.Keyboard');\n\n const form = document.createElement('form');\n\n const name = 'send-shortcut';\n const stateKey = 'settings.sendShortcut';\n\n const enterRow = new Row({\n radioField: new RadioField({\n langKey: 'General.SendShortcut.Enter',\n name,\n value: 'enter',\n stateKey\n }),\n subtitleLangKey: 'General.SendShortcut.NewLine.ShiftEnter'\n });\n\n const ctrlEnterRow = new Row({\n radioField: new RadioField({\n name,\n value: 'ctrlEnter',\n stateKey\n }),\n subtitleLangKey: 'General.SendShortcut.NewLine.Enter'\n });\n _i18n(ctrlEnterRow.radioField.main, 'General.SendShortcut.CtrlEnter', [IS_APPLE ? '⌘' : 'Ctrl']);\n\n form.append(enterRow.container, ctrlEnterRow.container);\n container.append(form);\n }\n\n if(IS_GEOLOCATION_SUPPORTED) {\n const container = section('DistanceUnitsTitle');\n\n const form = document.createElement('form');\n\n const name = 'distance-unit';\n const stateKey = 'settings.distanceUnit';\n\n const kilometersRow = new Row({\n radioField: new RadioField({\n langKey: 'DistanceUnitsKilometers',\n name,\n value: 'kilometers',\n stateKey\n })\n });\n\n const milesRow = new Row({\n radioField: new RadioField({\n langKey: 'DistanceUnitsMiles',\n name,\n value: 'miles',\n stateKey\n })\n });\n\n form.append(kilometersRow.container, milesRow.container);\n container.append(form);\n }\n\n {\n const container = section('General.TimeFormat');\n\n const form = document.createElement('form');\n\n const name = 'time-format';\n const stateKey = 'settings.timeFormat';\n\n const formats: [State['settings']['timeFormat'], LangPackKey][] = [\n ['h12', 'General.TimeFormat.h12'],\n ['h23', 'General.TimeFormat.h23']\n ];\n\n const rows = formats.map(([format, langPackKey]) => {\n const row = new Row({\n radioField: new RadioField({\n langKey: langPackKey,\n name,\n value: format,\n stateKey\n })\n });\n\n return row;\n });\n\n const cancel = eachMinute(() => {\n const date = new Date();\n\n formats.forEach(([format], idx) => {\n const str = date.toLocaleTimeString('en-us-u-hc-' + format, {\n hour: '2-digit',\n minute: '2-digit'\n });\n\n rows[idx].subtitle.textContent = str;\n });\n });\n\n this.eventListener.addEventListener('destroy', cancel);\n\n form.append(...rows.map((row) => row.container));\n container.append(form);\n }\n\n return Promise.all(promises);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport eachTimeout from './eachTimeout';\n\n// It's better to use timeout instead of interval, because interval can be corrupted\nexport default function eachMinute(callback: () => any, runFirst = true) {\n return eachTimeout(callback, () => (60 - new Date().getSeconds()) * 1000, runFirst);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ctx from '../environment/ctx';\nimport noop from './noop';\n\n// It's better to use timeout instead of interval, because interval can be corrupted\nexport default function eachTimeout(callback: () => any, getNextTimeout: () => number, runFirst = true) {\n const cancel = () => {\n clearTimeout(timeout);\n };\n\n // replace callback to run noop and restore after\n const _callback = callback;\n if(!runFirst) {\n callback = noop;\n }\n\n let timeout: number;\n (function run() {\n callback();\n timeout = ctx.setTimeout(run, getNextTimeout());\n })();\n\n callback = _callback;\n\n return cancel;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDialogFilter} from '../../../lib/storages/filters';\nimport type {DialogFilterSuggested} from '../../../layer';\nimport type _rootScope from '../../../lib/rootScope';\nimport {SliderSuperTab} from '../../slider';\nimport lottieLoader, {LottieLoader} from '../../../lib/rlottie/lottieLoader';\nimport Button from '../../button';\nimport rootScope from '../../../lib/rootScope';\nimport AppEditFolderTab from './editFolder';\nimport Row from '../../row';\nimport {i18n, i18n_, LangPackKey, join} from '../../../lib/langPack';\nimport cancelEvent from '../../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport positionElementByIndex from '../../../helpers/dom/positionElementByIndex';\nimport RLottiePlayer from '../../../lib/rlottie/rlottiePlayer';\nimport wrapEmojiText from '../../../lib/richTextProcessor/wrapEmojiText';\nimport {FOLDER_ID_ALL, FOLDER_ID_ARCHIVE, REAL_FOLDERS} from '../../../lib/mtproto/mtproto_config';\nimport replaceContent from '../../../helpers/dom/replaceContent';\nimport SettingSection from '../../settingSection';\nimport Sortable from '../../../helpers/dom/sortable';\nimport whichChild from '../../../helpers/dom/whichChild';\nimport indexOfAndSplice from '../../../helpers/array/indexOfAndSplice';\nimport showLimitPopup from '../../popups/limit';\n\nexport default class AppChatFoldersTab extends SliderSuperTab {\n private createFolderBtn: HTMLElement;\n private foldersSection: SettingSection;\n private suggestedSection: SettingSection;\n private stickerContainer: HTMLElement;\n private animation: RLottiePlayer;\n private list: HTMLElement;\n\n private filtersRendered: {[filterId: number]: Row} = {};\n private loadAnimationPromise: ReturnType;\n\n public static getInitArgs() {\n return {\n animationData: lottieLoader.loadAnimationFromURLManually('Folders_1'),\n filters: rootScope.managers.filtersStorage.getDialogFilters()\n };\n }\n\n private async renderFolder(\n dialogFilter: DialogFilterSuggested | MyDialogFilter,\n container?: HTMLElement,\n row?: Row,\n append?: boolean\n ) {\n let filter: MyDialogFilter;\n let description = '';\n const d: HTMLElement[] = [];\n if(dialogFilter._ === 'dialogFilterSuggested') {\n filter = dialogFilter.filter as MyDialogFilter;\n description = dialogFilter.description;\n } else {\n filter = dialogFilter;\n\n const enabledFilters = Object.keys(filter.pFlags).length;\n /* (['include_peers', 'exclude_peers'] as ['include_peers', 'exclude_peers']).forEach((key) => {\n enabledFilters += +!!filter[key].length;\n }); */\n\n if(enabledFilters === 1) {\n const pFlags = filter.pFlags;\n let k: LangPackKey;\n if(pFlags.contacts) k = 'FilterAllContacts';\n else if(pFlags.non_contacts) k = 'FilterAllNonContacts';\n else if(pFlags.groups) k = 'FilterAllGroups';\n else if(pFlags.broadcasts) k = 'FilterAllChannels';\n else if(pFlags.bots) k = 'FilterAllBots';\n\n if(k) {\n d.push(i18n(k));\n }\n }\n\n if(!d.length) {\n const folder = await this.managers.dialogsStorage.getFolderDialogs(filter.id);\n let chats = 0, channels = 0, groups = 0;\n await Promise.all(folder.map(async(dialog) => {\n if(await this.managers.appPeersManager.isAnyGroup(dialog.peerId)) groups++;\n else if(await this.managers.appPeersManager.isBroadcast(dialog.peerId)) channels++;\n else chats++;\n }));\n\n if(chats) d.push(i18n('Chats', [chats]));\n if(channels) d.push(i18n('Channels', [channels]));\n if(groups) d.push(i18n('Groups', [groups]));\n }\n }\n\n if(!row) {\n row = new Row({\n title: filter.id === FOLDER_ID_ALL ? i18n('FilterAllChats') : wrapEmojiText(filter.title),\n subtitle: description,\n clickable: true,\n buttonRightLangKey: dialogFilter._ === 'dialogFilterSuggested' ? 'Add' : undefined\n });\n\n if(d.length) {\n row.subtitle.append(...join(d));\n }\n\n if(dialogFilter._ === 'dialogFilter') {\n const filterId = filter.id;\n if(!this.filtersRendered[filter.id] && filter.id !== FOLDER_ID_ALL) {\n const initArgs = AppEditFolderTab.getInitArgs();\n attachClickEvent(row.container, async() => {\n const filter = await this.managers.filtersStorage.getFilter(filterId);\n const tab = this.slider.createTab(AppEditFolderTab);\n tab.setInitFilter(filter);\n tab.open(initArgs);\n }, {listenerSetter: this.listenerSetter});\n }\n\n this.filtersRendered[filter.id] = row;\n\n row.makeSortable();\n }\n } else {\n if(filter.id !== FOLDER_ID_ALL) {\n replaceContent(row.title, wrapEmojiText(filter.title));\n }\n\n row.subtitle.textContent = '';\n row.subtitle.append(...join(d));\n }\n\n const div = row.container;\n\n if(append) {\n const localId = (filter as MyDialogFilter).localId;\n if(localId !== undefined) {\n // ! header will be at 0 index\n positionElementByIndex(div, div.parentElement || container, localId);\n } else if(container) {\n container.append(div);\n }\n }\n\n return row;\n }\n\n public init(p: ReturnType = AppChatFoldersTab.getInitArgs()) {\n this.container.classList.add('chat-folders-container');\n this.setTitle('ChatList.Filter.List.Title');\n\n this.scrollable.container.classList.add('chat-folders');\n\n this.stickerContainer = document.createElement('div');\n this.stickerContainer.classList.add('sticker-container');\n\n const caption = document.createElement('div');\n caption.classList.add('caption');\n i18n_({element: caption, key: 'ChatList.Filter.Header'});\n\n this.createFolderBtn = Button('btn-primary btn-color-primary btn-control tgico', {\n text: 'ChatList.Filter.NewTitle',\n icon: 'add'\n });\n\n this.foldersSection = new SettingSection({\n name: 'Filters'\n });\n this.foldersSection.container.classList.add('hide');\n\n this.list = document.createElement('div');\n this.foldersSection.content.append(this.list);\n\n this.suggestedSection = new SettingSection({\n name: 'FilterRecommended'\n });\n this.suggestedSection.container.classList.add('hide');\n\n this.scrollable.append(\n this.stickerContainer,\n caption,\n this.createFolderBtn,\n this.foldersSection.container,\n this.suggestedSection.container\n );\n\n attachClickEvent(this.createFolderBtn, async() => {\n if(!(await this.canCreateFolder())) {\n showLimitPopup('folders');\n } else {\n this.slider.createTab(AppEditFolderTab).open();\n }\n }, {listenerSetter: this.listenerSetter});\n\n const onFiltersContainerUpdate = () => {\n this.foldersSection.container.classList.toggle('hide', !Object.keys(this.filtersRendered).length);\n };\n\n const loadPromises: Promise[] = [];\n const renderFiltersPromise = p.filters.then(async(filters) => {\n for(const filter of filters) {\n if(filter.id === FOLDER_ID_ARCHIVE) {\n continue;\n }\n\n await this.renderFolder(filter, this.list, undefined, true);\n }\n\n this.toggleAllChats();\n\n onFiltersContainerUpdate();\n });\n\n loadPromises.push(renderFiltersPromise);\n\n this.listenerSetter.add(rootScope)('filter_update', async(filter) => {\n const filterRendered = this.filtersRendered[filter.id];\n if(filterRendered) {\n await this.renderFolder(filter, null, filterRendered);\n } else if(filter.id !== FOLDER_ID_ARCHIVE) {\n await this.renderFolder(filter, this.list, undefined, true);\n }\n\n onFiltersContainerUpdate();\n\n this.getSuggestedFilters();\n });\n\n this.listenerSetter.add(rootScope)('filter_delete', (filter) => {\n const filterRendered = this.filtersRendered[filter.id];\n if(filterRendered) {\n /* for(const suggested of this.suggestedFilters) {\n if(deepEqual(suggested.filter, filter)) {\n\n }\n } */\n this.getSuggestedFilters();\n\n filterRendered.container.remove();\n delete this.filtersRendered[filter.id];\n }\n\n onFiltersContainerUpdate();\n });\n\n this.listenerSetter.add(rootScope)('filter_order', (order) => {\n order.filter((filterId) => !!this.filtersRendered[filterId]).forEach((filterId, idx) => {\n const filterRendered = this.filtersRendered[filterId];\n const container = filterRendered.container;\n positionElementByIndex(container, container.parentElement, idx + 1); // ! + 1 due to header\n });\n });\n\n this.listenerSetter.add(rootScope)('premium_toggle', () => {\n this.toggleAllChats();\n });\n\n this.loadAnimationPromise = p.animationData.then(async(cb) => {\n const player = await cb({\n container: this.stickerContainer,\n loop: false,\n autoplay: false,\n width: 86,\n height: 86\n });\n\n this.animation = player;\n\n return lottieLoader.waitForFirstFrame(player);\n });\n\n loadPromises.push(this.loadAnimationPromise);\n\n new Sortable({\n list: this.list,\n middleware: this.middlewareHelper.get(),\n onSort: (prevIdx, newIdx) => {\n let order: number[] = [];\n for(const filterId in this.filtersRendered) {\n const row = this.filtersRendered[filterId];\n const idx = whichChild(row.container);\n order[idx] = +filterId;\n }\n\n order = order.filter((filterId) => filterId !== undefined);\n if(!rootScope.premium) {\n indexOfAndSplice(order, FOLDER_ID_ALL);\n // order.unshift(FOLDER_ID_ALL);\n }\n\n this.managers.filtersStorage.updateDialogFiltersOrder(order);\n },\n scrollable: this.scrollable\n });\n\n this.getSuggestedFilters();\n\n /* return Promise.all([\n this.loadAnimationPromise\n ]); */\n return Promise.all(loadPromises);\n }\n\n onOpenAfterTimeout() {\n this.loadAnimationPromise.then(() => {\n this.animation.autoplay = true;\n this.animation.play();\n });\n\n return super.onOpenAfterTimeout();\n }\n\n private toggleAllChats() {\n const filterRendered = this.filtersRendered[FOLDER_ID_ALL];\n filterRendered.container.classList.toggle('hide', !rootScope.premium);\n }\n\n private async canCreateFolder() {\n const [limit, filters] = await Promise.all([\n this.managers.apiManager.getLimit('folders'),\n this.managers.filtersStorage.getDialogFilters()\n ]);\n\n const filtersLength = filters.filter((filter) => !REAL_FOLDERS.has(filter.id)).length;\n return filtersLength < limit;\n }\n\n private getSuggestedFilters() {\n return this.managers.filtersStorage.getSuggestedDialogsFilters().then(async(suggestedFilters) => {\n this.suggestedSection.container.classList.toggle('hide', !suggestedFilters.length);\n Array.from(this.suggestedSection.content.children).slice(1).forEach((el) => el.remove());\n\n for(const filter of suggestedFilters) {\n const row = await this.renderFolder(filter);\n this.suggestedSection.content.append(row.container);\n\n const button = row.buttonRight;\n attachClickEvent(button, async(e) => {\n cancelEvent(e);\n\n if(!(await this.canCreateFolder())) {\n showLimitPopup('folders');\n return;\n }\n\n button.setAttribute('disabled', 'true');\n\n const f = filter.filter as MyDialogFilter;\n f.includePeerIds = [];\n f.excludePeerIds = [];\n f.pinnedPeerIds = [];\n\n this.managers.filtersStorage.createDialogFilter(f, true).then(() => {\n row.container.remove();\n this.suggestedSection.container.classList.toggle('hide', this.suggestedSection.content.childElementCount === 1);\n }).finally(() => {\n button.removeAttribute('disabled');\n });\n }, {listenerSetter: this.listenerSetter});\n }\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Row from '../../row';\nimport CheckboxField from '../../checkboxField';\nimport {InputNotifyPeer, InputPeerNotifySettings, Update} from '../../../layer';\nimport {SliderSuperTabEventable} from '../../sliderTab';\nimport rootScope from '../../../lib/rootScope';\nimport {LangPackKey} from '../../../lib/langPack';\nimport copy from '../../../helpers/object/copy';\nimport convertKeyToInputKey from '../../../helpers/string/convertKeyToInputKey';\nimport {MUTE_UNTIL} from '../../../lib/mtproto/mtproto_config';\nimport apiManagerProxy from '../../../lib/mtproto/mtprotoworker';\nimport SettingSection from '../../settingSection';\n\ntype InputNotifyKey = Exclude;\n\nexport default class AppNotificationsTab extends SliderSuperTabEventable {\n public init() {\n this.container.classList.add('notifications-container');\n this.setTitle('Telegram.NotificationSettingsViewController');\n\n const NotifySection = (options: {\n name: LangPackKey,\n typeText: LangPackKey,\n inputKey: InputNotifyKey,\n }) => {\n const section = new SettingSection({\n name: options.name\n });\n\n const enabledRow = new Row({\n checkboxField: new CheckboxField({text: options.typeText, checked: true}),\n subtitleLangKey: 'Loading',\n listenerSetter: this.listenerSetter,\n withCheckboxSubtitle: true\n });\n\n const previewEnabledRow = new Row({\n checkboxField: new CheckboxField({text: 'MessagePreview', checked: true}),\n subtitleLangKey: 'Loading',\n listenerSetter: this.listenerSetter,\n withCheckboxSubtitle: true\n });\n\n section.content.append(enabledRow.container, previewEnabledRow.container);\n\n this.scrollable.append(section.container);\n\n const inputNotifyPeer = {_: options.inputKey};\n const ret = this.managers.appNotificationsManager.getNotifySettings(inputNotifyPeer);\n (ret instanceof Promise ? ret : Promise.resolve(ret)).then((notifySettings) => {\n const applySettings = async() => {\n const muted = await this.managers.appNotificationsManager.isMuted(notifySettings);\n enabledRow.checkboxField.checked = !muted;\n previewEnabledRow.checkboxField.checked = notifySettings.show_previews;\n\n return muted;\n };\n\n applySettings();\n\n this.eventListener.addEventListener('destroy', async() => {\n const mute = !enabledRow.checkboxField.checked;\n const showPreviews = previewEnabledRow.checkboxField.checked;\n\n if(mute === (await this.managers.appNotificationsManager.isMuted(notifySettings)) && showPreviews === notifySettings.show_previews) {\n return;\n }\n\n const inputSettings: InputPeerNotifySettings = copy(notifySettings) as any;\n inputSettings._ = 'inputPeerNotifySettings';\n inputSettings.mute_until = mute ? MUTE_UNTIL : 0;\n inputSettings.show_previews = showPreviews;\n delete inputSettings.flags;\n\n this.managers.appNotificationsManager.updateNotifySettings(inputNotifyPeer, inputSettings);\n }, {once: true});\n\n this.listenerSetter.add(rootScope)('notify_settings', (update: Update.updateNotifySettings) => {\n const inputKey = convertKeyToInputKey(update.peer._) as any;\n if(options.inputKey === inputKey) {\n notifySettings = update.notify_settings;\n applySettings();\n }\n });\n });\n };\n\n NotifySection({\n name: 'NotificationsPrivateChats',\n typeText: 'NotificationsForPrivateChats',\n inputKey: 'inputNotifyUsers'\n });\n\n NotifySection({\n name: 'NotificationsGroups',\n typeText: 'NotificationsForGroups',\n inputKey: 'inputNotifyChats'\n });\n\n NotifySection({\n name: 'NotificationsChannels',\n typeText: 'NotificationsForChannels',\n inputKey: 'inputNotifyBroadcasts'\n });\n\n {\n const section = new SettingSection({\n name: 'NotificationsOther'\n });\n\n const contactsSignUpRow = new Row({\n checkboxField: new CheckboxField({text: 'ContactJoined', checked: true}),\n subtitleLangKey: 'Loading',\n listenerSetter: this.listenerSetter,\n withCheckboxSubtitle: true\n });\n\n const soundRow = new Row({\n checkboxField: new CheckboxField({text: 'Notifications.Sound', checked: true, stateKey: 'settings.notifications.sound', listenerSetter: this.listenerSetter}),\n subtitleLangKey: 'Loading',\n listenerSetter: this.listenerSetter,\n withCheckboxSubtitle: true\n });\n\n apiManagerProxy.getState().then((state) => {\n soundRow.checkboxField.checked = state.settings.notifications.sound;\n });\n\n section.content.append(contactsSignUpRow.container, soundRow.container);\n\n this.scrollable.append(section.container);\n\n this.managers.appNotificationsManager.getContactSignUpNotification().then((enabled) => {\n contactsSignUpRow.checkboxField.checked = enabled;\n\n this.eventListener.addEventListener('destroy', () => {\n const _enabled = contactsSignUpRow.checkboxField.checked;\n if(enabled !== _enabled) {\n this.managers.appNotificationsManager.setContactSignUpNotification(!_enabled);\n }\n }, {once: true});\n });\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {randomLong} from '../../../helpers/random';\nimport {LangPackLanguage} from '../../../layer';\nimport I18n from '../../../lib/langPack';\nimport rootScope from '../../../lib/rootScope';\nimport RadioField from '../../radioField';\nimport Row, {RadioFormFromRows} from '../../row';\nimport SettingSection from '../../settingSection';\nimport {SliderSuperTab} from '../../slider'\n\nexport default class AppLanguageTab extends SliderSuperTab {\n public static getInitArgs() {\n return {\n languages1: rootScope.managers.apiManager.invokeApiCacheable('langpack.getLanguages', {\n lang_pack: 'web'\n }),\n // languages2: rootScope.managers.apiManager.invokeApiCacheable('langpack.getLanguages', {\n // lang_pack: 'macos'\n // })\n languages2: Promise.resolve([] as LangPackLanguage[])\n };\n }\n\n public init(p: ReturnType) {\n this.header.classList.add('with-border');\n this.container.classList.add('language-container');\n this.setTitle('Telegram.LanguageViewController');\n\n const section = new SettingSection({});\n\n const radioRows: Map = new Map();\n\n const promise = Promise.all([\n p.languages1,\n p.languages2\n ]).then(([languages1, languages2]) => {\n const rendered: Set = new Set();\n const webLangCodes = languages1.map((language) => language.lang_code);\n\n const random = randomLong();\n languages1.concat(languages2).forEach((language) => {\n if(rendered.has(language.lang_code)) return;\n rendered.add(language.lang_code);\n\n const row = new Row({\n radioField: new RadioField({\n text: language.name,\n name: random,\n value: language.lang_code\n }),\n subtitle: language.native_name\n });\n\n radioRows.set(language.lang_code, row);\n });\n\n const form = RadioFormFromRows([...radioRows.values()], (value) => {\n I18n.getLangPack(value, webLangCodes.includes(value));\n });\n\n I18n.getCacheLangPack().then((langPack) => {\n const row = radioRows.get(langPack.lang_code);\n if(!row) {\n console.error('no row', row, langPack);\n return;\n }\n\n row.radioField.setValueSilently(true);\n });\n\n section.content.append(form);\n });\n\n this.scrollable.append(section.container);\n\n return promise;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ListenerSetter from '../../../../helpers/listenerSetter';\nimport {LangPackKey} from '../../../../lib/langPack';\nimport CheckboxField from '../../../checkboxField';\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport Row, {CreateRowFromCheckboxField} from '../../../row';\nimport SettingSection from '../../../settingSection';\n\nexport function autoDownloadPeerTypeSection(type: 'photo' | 'video' | 'file', title: LangPackKey, listenerSetter: ListenerSetter) {\n const section = new SettingSection({name: title});\n\n const key = 'settings.autoDownload.' + type + '.';\n const contactsCheckboxField = new CheckboxField({\n text: 'AutodownloadContacts',\n name: 'contacts',\n stateKey: key + 'contacts',\n listenerSetter\n });\n const privateCheckboxField = new CheckboxField({\n text: 'AutodownloadPrivateChats',\n name: 'private',\n stateKey: key + 'private',\n listenerSetter\n });\n const groupsCheckboxField = new CheckboxField({\n text: 'AutodownloadGroupChats',\n name: 'groups',\n stateKey: key + 'groups',\n listenerSetter\n });\n const channelsCheckboxField = new CheckboxField({\n text: 'AutodownloadChannels',\n name: 'channels',\n stateKey: key + 'channels',\n listenerSetter\n });\n\n section.content.append(\n CreateRowFromCheckboxField(contactsCheckboxField).container,\n CreateRowFromCheckboxField(privateCheckboxField).container,\n CreateRowFromCheckboxField(groupsCheckboxField).container,\n CreateRowFromCheckboxField(channelsCheckboxField).container\n );\n\n return section;\n}\n\nexport default class AppAutoDownloadPhotoTab extends SliderSuperTabEventable {\n public init() {\n this.setTitle('AutoDownloadPhotos');\n\n const section = autoDownloadPeerTypeSection('photo', 'AutoDownloadPhotosTitle', this.listenerSetter);\n this.scrollable.append(section.container);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport formatBytes from '../../../../helpers/formatBytes';\nimport debounce from '../../../../helpers/schedulers/debounce';\nimport I18n from '../../../../lib/langPack';\nimport rootScope from '../../../../lib/rootScope';\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport {RangeSettingSelector} from '../generalSettings';\nimport {autoDownloadPeerTypeSection} from './photo';\n\nexport default class AppAutoDownloadFileTab extends SliderSuperTabEventable {\n public init() {\n this.setTitle('AutoDownloadFiles');\n\n const debouncedSave = debounce((sizeMax: number) => {\n this.managers.appStateManager.setByKey('settings.autoDownloadNew.file_size_max', sizeMax);\n }, 200, false, true);\n\n const section = autoDownloadPeerTypeSection('file', 'AutoDownloadFilesTitle', this.listenerSetter);\n\n const MIN = 512 * 1024;\n // const MAX = 2 * 1024 * 1024 * 1024;\n const MAX = 20 * 1024 * 1024;\n const MAX_RANGE = MAX - MIN;\n\n const sizeMax = rootScope.settings.autoDownloadNew.file_size_max;\n const value = Math.sqrt(Math.sqrt((sizeMax - MIN) / MAX_RANGE));\n const upTo = new I18n.IntlElement({\n key: 'AutodownloadSizeLimitUpTo',\n args: [formatBytes(sizeMax)]\n });\n const range = new RangeSettingSelector('AutoDownloadMaxFileSize', 0.01, value, 0, 1, false);\n range.onChange = (value) => {\n const sizeMax = (value ** 4 * MAX_RANGE + MIN) | 0;\n\n upTo.compareAndUpdate({args: [formatBytes(sizeMax)]});\n\n debouncedSave(sizeMax);\n };\n\n range.valueContainer.append(upTo.element);\n\n section.content.append(range.container);\n\n this.scrollable.append(section.container);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTabEventable} from '../../../sliderTab';\nimport {autoDownloadPeerTypeSection} from './photo';\n\nexport default class AppAutoDownloadVideoTab extends SliderSuperTabEventable {\n public init() {\n this.setTitle('AutoDownloadVideos');\n\n const section = autoDownloadPeerTypeSection('video', 'AutoDownloadVideosTitle', this.listenerSetter);\n this.scrollable.append(section.container);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AutoDownloadPeerTypeSettings, STATE_INIT} from '../../../config/state';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport replaceContent from '../../../helpers/dom/replaceContent';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport formatBytes from '../../../helpers/formatBytes';\nimport copy from '../../../helpers/object/copy';\nimport deepEqual from '../../../helpers/object/deepEqual';\nimport {FormatterArguments, i18n, join, LangPackKey} from '../../../lib/langPack';\nimport rootScope from '../../../lib/rootScope';\nimport Button from '../../button';\nimport CheckboxField from '../../checkboxField';\nimport confirmationPopup from '../../confirmationPopup';\nimport Row from '../../row';\nimport {SliderSuperTabEventable, SliderSuperTabEventableConstructable} from '../../sliderTab';\nimport AppAutoDownloadFileTab from './autoDownload/file';\nimport AppAutoDownloadPhotoTab from './autoDownload/photo';\nimport AppAutoDownloadVideoTab from './autoDownload/video';\nimport SettingSection from '../../settingSection';\n\nconst AUTO_DOWNLOAD_FOR_KEYS: {[k in keyof AutoDownloadPeerTypeSettings]: LangPackKey} = {\n contacts: 'AutoDownloadContacts',\n private: 'AutoDownloadPm',\n groups: 'AutoDownloadGroups',\n channels: 'AutoDownloadChannels'\n};\n\nexport default class AppDataAndStorageTab extends SliderSuperTabEventable {\n public init() {\n this.setTitle('DataSettings');\n\n {\n const section = new SettingSection({name: 'AutomaticMediaDownload', caption: 'AutoDownloadAudioInfo'});\n\n const autoCheckboxField = new CheckboxField({\n text: 'AutoDownloadMedia',\n name: 'auto',\n checked: !rootScope.settings.autoDownloadNew.pFlags.disabled,\n listenerSetter: this.listenerSetter\n });\n\n const autoRow = new Row({\n checkboxField: autoCheckboxField,\n listenerSetter: this.listenerSetter\n });\n\n const onChange = () => {\n toggleDisability([resetButton],\n deepEqual(rootScope.settings.autoDownload, STATE_INIT.settings.autoDownload) &&\n deepEqual(rootScope.settings.autoDownloadNew, STATE_INIT.settings.autoDownloadNew));\n };\n\n const setSubtitles = () => {\n this.setAutoDownloadSubtitle(photoRow, rootScope.settings.autoDownload.photo /* state.settings.autoDownloadNew.photo_size_max */);\n this.setAutoDownloadSubtitle(videoRow, rootScope.settings.autoDownload.video/* , state.settings.autoDownloadNew.video_size_max */);\n this.setAutoDownloadSubtitle(fileRow, rootScope.settings.autoDownload.file, rootScope.settings.autoDownloadNew.file_size_max);\n };\n\n const openTab = (tabConstructor: SliderSuperTabEventableConstructable) => {\n const tab = this.slider.createTab(tabConstructor);\n tab.open();\n\n this.listenerSetter.add(tab.eventListener)('destroy', () => {\n setSubtitles();\n onChange();\n }, {once: true});\n };\n\n const photoRow = new Row({\n titleLangKey: 'AutoDownloadPhotos',\n subtitle: '',\n clickable: () => {\n openTab(AppAutoDownloadPhotoTab);\n },\n listenerSetter: this.listenerSetter\n });\n\n const videoRow = new Row({\n titleLangKey: 'AutoDownloadVideos',\n subtitle: '',\n clickable: () => {\n openTab(AppAutoDownloadVideoTab);\n },\n listenerSetter: this.listenerSetter\n });\n\n const fileRow = new Row({\n titleLangKey: 'AutoDownloadFiles',\n subtitle: '',\n clickable: () => {\n openTab(AppAutoDownloadFileTab);\n },\n listenerSetter: this.listenerSetter\n });\n\n const resetButton = Button('btn-primary btn-transparent primary', {icon: 'delete', text: 'ResetAutomaticMediaDownload'});\n attachClickEvent(resetButton, () => {\n confirmationPopup({\n titleLangKey: 'ResetAutomaticMediaDownloadAlertTitle',\n descriptionLangKey: 'ResetAutomaticMediaDownloadAlert',\n button: {\n langKey: 'Reset'\n }\n }).then(() => {\n const settings = rootScope.settings;\n settings.autoDownloadNew = copy(STATE_INIT.settings.autoDownloadNew);\n settings.autoDownload = copy(STATE_INIT.settings.autoDownload);\n rootScope.settings = settings;\n this.managers.appStateManager.setByKey('settings', settings);\n\n setSubtitles();\n autoCheckboxField.checked = !rootScope.settings.autoDownloadNew.pFlags.disabled;\n });\n });\n\n const onDisabledChange = () => {\n const disabled = !autoCheckboxField.checked;\n\n const autoDownloadNew = rootScope.settings.autoDownloadNew;\n if(disabled) {\n autoDownloadNew.pFlags.disabled = true;\n } else {\n delete autoDownloadNew.pFlags.disabled;\n }\n\n [photoRow, videoRow, fileRow].forEach((row) => {\n row.container.classList.toggle('is-disabled', disabled);\n });\n\n this.managers.appStateManager.setByKey('settings.autoDownloadNew', autoDownloadNew);\n\n onChange();\n };\n\n autoCheckboxField.input.addEventListener('change', onDisabledChange);\n onDisabledChange();\n setSubtitles();\n\n section.content.append(\n autoRow.container,\n photoRow.container,\n videoRow.container,\n fileRow.container,\n resetButton\n );\n\n this.scrollable.append(section.container);\n }\n }\n\n private setAutoDownloadSubtitle(row: Row, settings: AutoDownloadPeerTypeSettings, sizeMax?: number) {\n let key: LangPackKey;\n const args: FormatterArguments = [];\n\n const peerKeys = Object.keys(settings) as (keyof typeof AUTO_DOWNLOAD_FOR_KEYS)[];\n const enabledKeys = peerKeys.map((key) => settings[key] ? AUTO_DOWNLOAD_FOR_KEYS[key] : undefined).filter(Boolean);\n if(!enabledKeys.length || sizeMax === 0) {\n key = 'AutoDownloadOff';\n } else {\n const isAll = enabledKeys.length === peerKeys.length;\n if(sizeMax !== undefined) {\n key = isAll ? 'AutoDownloadUpToOnAllChats' : 'AutoDownloadOnUpToFor';\n args.push(formatBytes(sizeMax));\n } else {\n key = isAll ? 'AutoDownloadOnAllChats' : 'AutoDownloadOnFor';\n }\n\n if(!isAll) {\n const fragment = document.createElement('span');\n fragment.append(...join(enabledKeys.map((key) => i18n(key)), true, false));\n args.push(fragment);\n }\n }\n\n replaceContent(row.subtitle, i18n(key, args));\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AvailableReaction} from '../../../layer';\nimport RadioField from '../../radioField';\nimport Row, {RadioFormFromRows} from '../../row';\nimport SettingSection from '../../settingSection';\nimport SliderSuperTab from '../../sliderTab';\nimport wrapStickerToRow from '../../wrappers/stickerToRow';\n\nexport default class AppQuickReactionTab extends SliderSuperTab {\n public init() {\n this.setTitle('DoubleTapSetting');\n this.container.classList.add('quick-reaction-container');\n\n return Promise.all([\n this.managers.appReactionsManager.getQuickReaction(),\n this.managers.appReactionsManager.getAvailableReactions()\n ]).then(([quickReaction, availableReactions]) => {\n availableReactions = availableReactions.filter((reaction) => !reaction.pFlags.inactive);\n\n const section = new SettingSection();\n\n const name = 'quick-reaction';\n const rows = availableReactions.map((availableReaction) => {\n const radioField = new RadioField({\n name,\n text: availableReaction.title,\n value: availableReaction.reaction,\n alignRight: true\n });\n\n const row = new Row({\n radioField,\n havePadding: true\n });\n\n radioField.main.classList.add('quick-reaction-title');\n\n wrapStickerToRow({\n row,\n doc: availableReaction.static_icon,\n size: 'small'\n });\n\n if(availableReaction.reaction === (quickReaction as AvailableReaction).reaction) {\n radioField.setValueSilently(true);\n }\n\n return row;\n });\n\n const form = RadioFormFromRows(rows, (value) => {\n this.managers.appReactionsManager.setDefaultReaction({_: 'reactionEmoji', emoticon: value});\n });\n\n section.content.append(form);\n this.scrollable.append(section.container);\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport forEachReverse from '../../../helpers/array/forEachReverse';\nimport assumeType from '../../../helpers/assumeType';\nimport createContextMenu from '../../../helpers/dom/createContextMenu';\nimport positionElementByIndex from '../../../helpers/dom/positionElementByIndex';\nimport Sortable from '../../../helpers/dom/sortable';\nimport {StickerSet, MessagesAllStickers} from '../../../layer';\nimport {i18n, LangPackKey} from '../../../lib/langPack';\nimport wrapEmojiText from '../../../lib/richTextProcessor/wrapEmojiText';\nimport rootScope from '../../../lib/rootScope';\nimport CheckboxField from '../../checkboxField';\nimport LazyLoadQueue from '../../lazyLoadQueue';\nimport PopupStickers from '../../popups/stickers';\nimport Row, {CreateRowFromCheckboxField} from '../../row';\nimport SettingSection from '../../settingSection';\nimport SliderSuperTab from '../../sliderTab';\nimport wrapStickerSetThumb from '../../wrappers/stickerSetThumb';\nimport wrapStickerToRow from '../../wrappers/stickerToRow';\nimport AppQuickReactionTab from './quickReaction';\n\nexport default class AppStickersAndEmojiTab extends SliderSuperTab {\n public static getInitArgs() {\n return {\n allStickers: rootScope.managers.appStickersManager.getAllStickers(),\n quickReaction: rootScope.managers.appReactionsManager.getQuickReaction()\n };\n }\n\n public init(p: ReturnType) {\n this.container.classList.add('stickers-emoji-container');\n this.setTitle('StickersName');\n\n const promises: Promise[] = [];\n\n {\n const section = new SettingSection({caption: 'LoopAnimatedStickersInfo'});\n\n const suggestStickersRow = new Row({\n icon: 'lamp',\n titleLangKey: 'Stickers.SuggestStickers',\n clickable: true,\n listenerSetter: this.listenerSetter,\n titleRightSecondary: true\n });\n\n const map: {[k in typeof rootScope.settings.stickers.suggest]: LangPackKey} = {\n all: 'SuggestStickersAll',\n installed: 'SuggestStickersInstalled',\n none: 'SuggestStickersNone'\n };\n\n const setStickersSuggestDescription = () => {\n suggestStickersRow.titleRight.replaceChildren(i18n(map[rootScope.settings.stickers.suggest]));\n };\n\n setStickersSuggestDescription();\n\n const setStickersSuggest = (value: typeof rootScope.settings.stickers.suggest) => {\n if(rootScope.settings.stickers.suggest === value) return;\n rootScope.settings.stickers.suggest = value;\n setStickersSuggestDescription();\n return this.managers.appStateManager.setByKey('settings.stickers.suggest', value);\n };\n\n createContextMenu({\n buttons: [{\n icon: 'stickers_face',\n text: 'SuggestStickersAll',\n onClick: setStickersSuggest.bind(this, 'all')\n }, {\n icon: 'newprivate',\n text: 'SuggestStickersInstalled',\n onClick: setStickersSuggest.bind(this, 'installed')\n }, {\n icon: 'stop',\n text: 'SuggestStickersNone',\n onClick: setStickersSuggest.bind(this, 'none')\n }],\n listenTo: suggestStickersRow.container,\n middleware: this.middlewareHelper.get(),\n listenForClick: true\n });\n\n const reactionsRow = new Row({\n titleLangKey: 'DoubleTapSetting',\n havePadding: true,\n clickable: () => {\n this.slider.createTab(AppQuickReactionTab).open();\n },\n listenerSetter: this.listenerSetter\n });\n\n const renderQuickReaction = () => {\n p.quickReaction.then((reaction) => {\n if(reaction._ === 'availableReaction') {\n return reaction.static_icon;\n } else {\n return this.managers.appEmojiManager.getCustomEmojiDocument(reaction.document_id);\n }\n }).then((doc) => {\n wrapStickerToRow({\n row: reactionsRow,\n doc,\n size: 'small'\n });\n });\n };\n\n renderQuickReaction();\n\n this.listenerSetter.add(rootScope)('quick_reaction', () => {\n p = AppStickersAndEmojiTab.getInitArgs();\n renderQuickReaction();\n });\n\n const loopStickersRow = new Row({\n icon: 'flip',\n titleLangKey: 'InstalledStickers.LoopAnimated',\n checkboxField: new CheckboxField({\n name: 'loop',\n stateKey: 'settings.stickers.loop',\n listenerSetter: this.listenerSetter,\n toggle: true\n }),\n listenerSetter: this.listenerSetter\n });\n\n section.content.append(\n reactionsRow.container,\n suggestStickersRow.container,\n loopStickersRow.container\n );\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({name: 'Emoji'});\n\n const suggestEmojiRow = new Row({\n icon: 'lamp',\n titleLangKey: 'GeneralSettings.EmojiPrediction',\n checkboxField: new CheckboxField({\n name: 'suggest-emoji',\n stateKey: 'settings.emoji.suggest',\n listenerSetter: this.listenerSetter,\n toggle: true\n }),\n listenerSetter: this.listenerSetter\n });\n const bigEmojiRow = new Row({\n icon: 'smile',\n titleLangKey: 'GeneralSettings.BigEmoji',\n checkboxField: new CheckboxField({\n name: 'emoji-big',\n stateKey: 'settings.emoji.big',\n listenerSetter: this.listenerSetter,\n toggle: true\n }),\n listenerSetter: this.listenerSetter\n });\n\n section.content.append(\n suggestEmojiRow.container,\n bigEmojiRow.container\n );\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({name: 'DynamicPackOrder', caption: 'DynamicPackOrderInfo'});\n\n const dynamicPackOrderRow = new Row({\n titleLangKey: 'DynamicPackOrder',\n checkboxField: new CheckboxField({\n name: 'dynamic-pack-order',\n stateKey: 'settings.stickers.dynamicPackOrder',\n listenerSetter: this.listenerSetter,\n toggle: true\n }),\n listenerSetter: this.listenerSetter\n });\n\n section.content.append(\n dynamicPackOrderRow.container\n );\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({name: 'Telegram.InstalledStickerPacksController', caption: 'StickersBotInfo'});\n\n const stickerSets: {[id: string]: Row} = {};\n\n const stickersContent = section.generateContentElement();\n\n const lazyLoadQueue = new LazyLoadQueue();\n const renderStickerSet = (stickerSet: StickerSet.stickerSet, method: 'append' | 'prepend' = 'append') => {\n const row = new Row({\n title: wrapEmojiText(stickerSet.title),\n subtitleLangKey: 'Stickers',\n subtitleLangArgs: [stickerSet.count],\n havePadding: true,\n clickable: () => {\n new PopupStickers({id: stickerSet.id, access_hash: stickerSet.access_hash}).show();\n },\n listenerSetter: this.listenerSetter\n });\n\n row.container.dataset.id = '' + stickerSet.id;\n\n row.makeSortable();\n\n stickerSets[stickerSet.id] = row;\n\n const div = document.createElement('div');\n div.classList.add('row-media');\n\n wrapStickerSetThumb({\n set: stickerSet,\n container: div,\n group: 'GENERAL-SETTINGS',\n lazyLoadQueue,\n width: 36,\n height: 36,\n autoplay: true,\n middleware: this.middlewareHelper.get()\n });\n\n row.container.append(div);\n\n stickersContent[method](row.container);\n };\n\n const promise = p.allStickers.then((allStickers) => {\n assumeType(allStickers);\n const promises = allStickers.sets.map((stickerSet) => renderStickerSet(stickerSet));\n return Promise.all(promises);\n });\n\n promises.push(promise);\n\n this.listenerSetter.add(rootScope)('stickers_installed', (set) => {\n if(!stickerSets[set.id]) {\n renderStickerSet(set, 'prepend');\n }\n });\n\n this.listenerSetter.add(rootScope)('stickers_deleted', (set) => {\n if(stickerSets[set.id]) {\n stickerSets[set.id].container.remove();\n delete stickerSets[set.id];\n }\n });\n\n this.listenerSetter.add(rootScope)('stickers_order', ({type, order}) => {\n if(type !== 'stickers') {\n return;\n }\n\n order.forEach((id, idx) => {\n const row = stickerSets[id];\n if(!row) {\n return;\n }\n\n positionElementByIndex(row.container, stickersContent, idx)\n });\n });\n\n this.listenerSetter.add(rootScope)('stickers_top', (id) => {\n const row = stickerSets[id];\n if(!row) {\n return;\n }\n\n positionElementByIndex(row.container, stickersContent, 0);\n });\n\n new Sortable({\n list: stickersContent,\n middleware: this.middlewareHelper.get(),\n onSort: (idx, newIdx) => {\n const order = Array.from(stickersContent.children).map((el) => (el as HTMLElement).dataset.id);\n this.managers.appStickersManager.reorderStickerSets(order);\n }\n });\n\n this.scrollable.append(section.container);\n }\n\n return Promise.all(promises);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider';\nimport ButtonMenuToggle from '../../buttonMenuToggle';\nimport Button from '../../button';\nimport AppPrivacyAndSecurityTab from './privacyAndSecurity';\nimport AppGeneralSettingsTab from './generalSettings';\nimport AppEditProfileTab from './editProfile';\nimport AppChatFoldersTab from './chatFolders';\nimport AppNotificationsTab from './notifications';\nimport AppLanguageTab from './language';\nimport lottieLoader from '../../../lib/rlottie/lottieLoader';\nimport PopupPeer from '../../popups/peer';\nimport AppDataAndStorageTab from './dataAndStorage';\nimport ButtonIcon from '../../buttonIcon';\nimport PeerProfile from '../../peerProfile';\nimport rootScope from '../../../lib/rootScope';\nimport Row from '../../row';\nimport AppActiveSessionsTab from './activeSessions';\nimport {i18n, LangPackKey} from '../../../lib/langPack';\nimport {SliderSuperTabConstructable, SliderSuperTabEventable} from '../../sliderTab';\nimport PopupAvatar from '../../popups/avatar';\nimport {AccountAuthorizations, Authorization} from '../../../layer';\nimport PopupElement from '../../popups';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport SettingSection from '../../settingSection';\nimport AppStickersAndEmojiTab from './stickersAndEmoji';\n\nexport default class AppSettingsTab extends SliderSuperTab {\n private buttons: {\n edit: HTMLButtonElement,\n folders: HTMLButtonElement,\n general: HTMLButtonElement,\n notifications: HTMLButtonElement,\n storage: HTMLButtonElement,\n privacy: HTMLButtonElement,\n } = {} as any;\n private profile: PeerProfile;\n\n private languageRow: Row;\n private devicesRow: Row;\n\n private authorizations: Authorization.authorization[];\n private getAuthorizationsPromise: Promise;\n\n public async init() {\n this.container.classList.add('settings-container');\n this.setTitle('Settings');\n\n const btnMenu = ButtonMenuToggle({\n listenerSetter: this.listenerSetter,\n direction: 'bottom-left',\n buttons: [{\n icon: 'logout',\n text: 'EditAccount.Logout',\n onClick: () => {\n new PopupPeer('logout', {\n titleLangKey: 'LogOut',\n descriptionLangKey: 'LogOut.Description',\n buttons: [{\n langKey: 'LogOut',\n callback: () => {\n this.managers.apiManager.logOut();\n },\n isDanger: true\n }]\n }).show();\n }\n }]\n });\n\n this.buttons.edit = ButtonIcon('edit');\n\n this.header.append(this.buttons.edit, btnMenu);\n\n this.profile = new PeerProfile(this.managers, this.scrollable, this.listenerSetter, false);\n this.profile.init();\n this.profile.setPeer(rootScope.myId);\n const fillPromise = this.profile.fillProfileElements();\n\n const changeAvatarBtn = Button('btn-circle btn-corner z-depth-1 profile-change-avatar', {icon: 'cameraadd'});\n attachClickEvent(changeAvatarBtn, () => {\n const canvas = document.createElement('canvas');\n PopupElement.createPopup(PopupAvatar).open(canvas, (upload) => {\n upload().then((inputFile) => {\n return this.managers.appProfileManager.uploadProfilePhoto(inputFile);\n });\n });\n }, {listenerSetter: this.listenerSetter});\n this.profile.element.lastElementChild.firstElementChild.append(changeAvatarBtn);\n\n const updateChangeAvatarBtn = async() => {\n const user = await this.managers.appUsersManager.getSelf();\n changeAvatarBtn.classList.toggle('hide', user.photo?._ !== 'userProfilePhoto');\n };\n\n updateChangeAvatarBtn();\n this.listenerSetter.add(rootScope)('avatar_update', ({peerId}) => {\n if(rootScope.myId === peerId) {\n updateChangeAvatarBtn();\n }\n });\n\n /* const div = document.createElement('div');\n //div.style.cssText = 'border-radius: 8px; overflow: hidden; width: 396px; height: 264px; flex: 0 0 auto; position: relative; margin: 10rem 0 10rem auto;';\n //div.style.width = '135px';\n //div.style.height = '100px';\n div.style.cssText = 'border-radius: 8px; overflow: hidden; width: 396px; height: 264px; flex: 0 0 auto; position: relative; margin: 10rem auto 10rem 0;';\n div.style.width = '135px';\n div.style.height = '100px';\n\n const img = document.createElement('img');\n img.src = 'assets/img/pepe.jpg';\n img.classList.add('media-photo');\n img.style.cssText = 'max-width: 100%;max-height: 100%;';\n\n div.append(img);\n\n div.addEventListener('click', () => {\n new AppMediaViewer().setSearchContext({peerId: 61004386, inputFilter: 'inputMessagesFilterPhotos'}).openMedia({\n _: 'message',\n mid: 1,\n peerId: 61004386,\n fromId: 61004386,\n message: '',\n media: {\n _: 'messageMediaPhoto',\n photo: {\n _: 'photo',\n url: img.src,\n downloaded: 111,\n sizes: [{\n _: 'photoSize',\n type: 'x',\n w: 618,\n h: 412\n }]\n }\n },\n date: Date.now() / 1000 | 0\n }, img);\n });\n\n this.scrollable.append(div); */\n\n const buttonsDiv = document.createElement('div');\n buttonsDiv.classList.add('profile-buttons');\n\n type ConstructorP = T extends {\n new (...args: any[]): infer U;\n } ? U : never;\n\n const m = (\n icon: string,\n text: LangPackKey,\n c: T,\n getInitArgs?: () => Promise['init']>>\n ): {\n icon: string,\n text: LangPackKey,\n tabConstructor: T,\n getInitArgs?: typeof getInitArgs,\n // args?: ReturnType\n args?: any\n } => {\n if(!getInitArgs) {\n const g = (c as any as typeof SliderSuperTab).getInitArgs;\n if(g) {\n // @ts-ignore\n getInitArgs = () => [g(this)];\n }\n }\n\n return {\n icon,\n text,\n tabConstructor: c,\n getInitArgs,\n args: getInitArgs?.()\n };\n };\n\n // const k = (c: T): () => [ReturnType['getInitArgs']>] => {\n // return () => (c as any).getInitArgs(this);\n // };\n\n const b = [\n m('unmute', 'AccountSettings.Notifications', AppNotificationsTab),\n m('data', 'DataSettings', AppDataAndStorageTab),\n m('lock', 'AccountSettings.PrivacyAndSecurity', AppPrivacyAndSecurityTab),\n m('settings', 'Telegram.GeneralSettingsViewController', AppGeneralSettingsTab),\n m('folder', 'AccountSettings.Filters', AppChatFoldersTab),\n m('stickers_face', 'StickersName', AppStickersAndEmojiTab)\n ];\n\n const rows = b.map((item) => {\n const {icon, text: langPackKey, tabConstructor, getInitArgs} = item;\n return new Row({\n titleLangKey: langPackKey,\n icon,\n clickable: async() => {\n const args = item.args ? await item.args : [];\n const tab = this.slider.createTab(tabConstructor as any);\n tab.open(...args);\n\n if(tab instanceof SliderSuperTabEventable && getInitArgs) {\n tab.eventListener.addEventListener('destroyAfter', (promise) => {\n item.args = promise.then(() => getInitArgs() as any);\n });\n }\n },\n listenerSetter: this.listenerSetter\n });\n });\n\n const languageArgs = AppLanguageTab.getInitArgs();\n rows.push(\n this.devicesRow = new Row({\n titleLangKey: 'Devices',\n titleRightSecondary: ' ',\n icon: 'activesessions',\n clickable: async() => {\n if(!this.authorizations) {\n await this.updateActiveSessions();\n }\n\n const tab = this.slider.createTab(AppActiveSessionsTab);\n tab.authorizations = this.authorizations;\n tab.eventListener.addEventListener('destroy', () => {\n this.authorizations = undefined;\n this.updateActiveSessions(true);\n }, {once: true});\n tab.open();\n },\n listenerSetter: this.listenerSetter\n }),\n\n this.languageRow = new Row({\n titleLangKey: 'AccountSettings.Language',\n titleRightSecondary: i18n('LanguageName'),\n icon: 'language',\n clickable: () => {\n this.slider.createTab(AppLanguageTab).open(languageArgs);\n },\n listenerSetter: this.listenerSetter\n })\n );\n\n buttonsDiv.append(...rows.map((row) => row.container));\n\n // const profileSection = new SettingSection({fullWidth: true, noPaddingTop: true});\n // profileSection.content.append(this.profile.element);\n\n const buttonsSection = new SettingSection();\n buttonsSection.content.append(buttonsDiv);\n\n this.scrollable.append(this.profile.element/* profileSection.container */, buttonsSection.container);\n\n const getEditProfileArgs = () => {\n editProfileArgs = AppEditProfileTab.getInitArgs();\n };\n let editProfileArgs: ReturnType;\n attachClickEvent(this.buttons.edit, () => {\n const tab = this.slider.createTab(AppEditProfileTab);\n tab.open(editProfileArgs);\n }, {listenerSetter: this.listenerSetter});\n getEditProfileArgs();\n // this.listenerSetter.add(rootScope)('user_full_update', (userId) => {\n // if(rootScope.myId.toUserId() === userId) {\n // getEditProfileArgs();\n // }\n // });\n this.listenerSetter.add(rootScope)('user_update', (userId) => {\n if(rootScope.myId.toUserId() === userId) {\n getEditProfileArgs();\n }\n });\n\n lottieLoader.loadLottieWorkers();\n\n this.updateActiveSessions();\n\n (await fillPromise)();\n }\n\n private getAuthorizations(overwrite?: boolean) {\n if(this.getAuthorizationsPromise && !overwrite) return this.getAuthorizationsPromise;\n\n const promise = this.getAuthorizationsPromise = this.managers.apiManager.invokeApi('account.getAuthorizations')\n .finally(() => {\n if(this.getAuthorizationsPromise === promise) {\n this.getAuthorizationsPromise = undefined;\n }\n });\n\n return promise;\n }\n\n public updateActiveSessions(overwrite?: boolean) {\n return this.getAuthorizations(overwrite).then((auths) => {\n this.authorizations = auths.authorizations;\n this.devicesRow.titleRight.textContent = '' + this.authorizations.length;\n });\n }\n\n public onCloseAfterTimeout() {\n this.profile.destroy();\n return super.onCloseAfterTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appSidebarLeft from '..';\nimport {InputFile} from '../../../layer';\nimport InputField from '../../inputField';\nimport {SliderSuperTab} from '../../slider';\nimport AvatarEdit from '../../avatarEdit';\nimport AppAddMembersTab from './addMembers';\nimport {_i18n} from '../../../lib/langPack';\nimport ButtonCorner from '../../buttonCorner';\nimport appImManager from '../../../lib/appManagers/appImManager';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport SettingSection from '../../settingSection';\n\nexport default class AppNewChannelTab extends SliderSuperTab {\n private uploadAvatar: () => Promise = null;\n\n private channelNameInputField: InputField;\n private channelDescriptionInputField: InputField;\n private nextBtn: HTMLButtonElement;\n private avatarEdit: AvatarEdit;\n\n public init() {\n this.container.classList.add('new-channel-container');\n this.setTitle('NewChannel');\n\n this.avatarEdit = new AvatarEdit((_upload) => {\n this.uploadAvatar = _upload;\n });\n\n const section = new SettingSection({\n caption: 'Channel.DescriptionHolderDescrpiton'\n });\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n this.channelNameInputField = new InputField({\n label: 'EnterChannelName',\n maxLength: 128\n });\n\n this.channelDescriptionInputField = new InputField({\n label: 'DescriptionOptionalPlaceholder',\n maxLength: 255\n });\n\n inputWrapper.append(this.channelNameInputField.container, this.channelDescriptionInputField.container);\n\n const onLengthChange = () => {\n this.nextBtn.classList.toggle('is-visible', !!this.channelNameInputField.value.length &&\n !this.channelNameInputField.input.classList.contains('error') &&\n !this.channelDescriptionInputField.input.classList.contains('error'));\n };\n\n this.channelNameInputField.input.addEventListener('input', onLengthChange);\n this.channelDescriptionInputField.input.addEventListener('input', onLengthChange);\n\n this.nextBtn = ButtonCorner({icon: 'arrow_next'});\n\n attachClickEvent(this.nextBtn, () => {\n const title = this.channelNameInputField.value;\n const about = this.channelDescriptionInputField.value;\n\n this.nextBtn.disabled = true;\n this.managers.appChatsManager.createChannel({\n title,\n about,\n broadcast: true\n }).then((channelId) => {\n if(this.uploadAvatar) {\n this.uploadAvatar().then((inputFile) => {\n this.managers.appChatsManager.editPhoto(channelId, inputFile);\n });\n }\n\n appImManager.setInnerPeer({peerId: channelId.toPeerId(true)});\n\n appSidebarLeft.removeTabFromHistory(this);\n this.slider.createTab(AppAddMembersTab).open({\n type: 'channel',\n skippable: true,\n title: 'GroupAddMembers',\n placeholder: 'SendMessageTo',\n takeOut: (peerIds) => {\n return this.managers.appChatsManager.inviteToChannel(channelId, peerIds);\n }\n });\n });\n }, {listenerSetter: this.listenerSetter});\n\n this.content.append(this.nextBtn);\n section.content.append(this.avatarEdit.container, inputWrapper);\n this.scrollable.append(section.container);\n }\n\n public onCloseAfterTimeout() {\n this.avatarEdit.clear();\n this.uploadAvatar = null;\n this.channelNameInputField.value = '';\n this.channelDescriptionInputField.value = '';\n this.nextBtn.disabled = false;\n return super.onCloseAfterTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport InputField from '../inputField';\nimport PopupElement from '.';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport EditPeer from '../editPeer';\nimport {_i18n} from '../../lib/langPack';\nimport TelInputField from '../telInputField';\nimport {formatPhoneNumber} from '../../helpers/formatPhoneNumber';\nimport {toastNew} from '../toast';\n\nexport default class PopupCreateContact extends PopupElement {\n constructor() {\n super('popup-create-contact popup-send-photo popup-new-media', {closable: true, withConfirm: 'Add', title: 'AddContactTitle'});\n this.construct();\n }\n\n private async construct() {\n attachClickEvent(this.btnConfirm, () => {\n const promise = this.managers.appUsersManager.importContact(nameInputField.value, lastNameInputField.value, telInputField.value);\n\n promise.then(() => {\n this.hide();\n }, (err) => {\n if(err.type === 'NO_USER') {\n toastNew({langPackKey: 'Contacts.PhoneNumber.NotRegistred'});\n editPeer.disabled = false;\n }\n });\n\n editPeer.lockWithPromise(promise);\n }, {listenerSetter: this.listenerSetter});\n\n const inputFields: InputField[] = [];\n const div = document.createElement('div');\n div.classList.add('name-fields');\n const nameInputField = new InputField({\n label: 'FirstName',\n name: 'create-contact-name',\n maxLength: 70,\n required: true\n });\n const lastNameInputField = new InputField({\n label: 'LastName',\n name: 'create-contact-lastname',\n maxLength: 70\n });\n const telInputField = new TelInputField({required: true});\n inputFields.push(nameInputField, lastNameInputField, telInputField);\n\n const onInput = () => {\n const name = nameInputField.value + ' ' + lastNameInputField.value;\n // const abbr = getAbbreviation(name);\n editPeer.avatarElem.peerTitle = name;\n editPeer.avatarElem.update();\n };\n\n this.listenerSetter.add(nameInputField.input)('input', onInput);\n this.listenerSetter.add(lastNameInputField.input)('input', onInput);\n\n telInputField.validate = () => {\n return !!telInputField.value.match(/\\d/);\n };\n\n const user = await this.managers.appUsersManager.getSelf();\n const formatted = formatPhoneNumber(user.phone);\n if(formatted.code) {\n telInputField.value = '+' + formatted.code.country_code;\n }\n\n const editPeer = new EditPeer({\n inputFields,\n listenerSetter: this.listenerSetter,\n doNotEditAvatar: true,\n nextBtn: this.btnConfirm,\n avatarSize: 100\n });\n\n div.append(nameInputField.container, lastNameInputField.container, editPeer.avatarElem);\n this.container.append(div, telInputField.container);\n\n this.show();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider';\nimport appDialogsManager from '../../../lib/appManagers/appDialogsManager';\nimport InputSearch from '../../inputSearch';\nimport {IS_MOBILE} from '../../../environment/userAgent';\nimport {canFocus} from '../../../helpers/dom/canFocus';\nimport windowSize from '../../../helpers/windowSize';\nimport ButtonCorner from '../../buttonCorner';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport PopupCreateContact from '../../popups/createContact';\nimport SortedUserList from '../../sortedUserList';\nimport {getMiddleware} from '../../../helpers/middleware';\nimport replaceContent from '../../../helpers/dom/replaceContent';\nimport rootScope from '../../../lib/rootScope';\nimport PopupElement from '../../popups';\n\n// TODO: поиск по людям глобальный, если не нашло в контактах никого\n\nexport default class AppContactsTab extends SliderSuperTab {\n private inputSearch: InputSearch;\n private middleware: ReturnType;\n private sortedUserList: SortedUserList;\n\n public init() {\n this.container.id = 'contacts-container';\n\n // this.list = appDialogsManager.createChatList(/* {avatarSize: 48, handheldsSize: 66} */);\n\n const btnAdd = ButtonCorner({icon: 'add', className: 'is-visible'});\n this.content.append(btnAdd);\n\n attachClickEvent(btnAdd, () => {\n PopupElement.createPopup(PopupCreateContact);\n }, {listenerSetter: this.listenerSetter});\n\n this.inputSearch = new InputSearch('Search', (value) => {\n this.openContacts(value);\n });\n\n this.listenerSetter.add(rootScope)('contacts_update', async(userId) => {\n const isContact = await this.managers.appUsersManager.isContact(userId);\n const peerId = userId.toPeerId();\n if(isContact) this.sortedUserList.add(peerId);\n else this.sortedUserList.delete(peerId);\n });\n\n this.title.replaceWith(this.inputSearch.container);\n\n this.middleware = getMiddleware();\n\n this.openContacts();\n\n // preload contacts\n // appUsersManager.getContacts();\n }\n\n protected createList() {\n const sortedUserList = new SortedUserList({\n managers: this.managers\n });\n const list = sortedUserList.list;\n list.id = 'contacts';\n list.classList.add('contacts-container');\n appDialogsManager.setListClickListener(list, () => {\n this.close();\n }, undefined, true);\n return sortedUserList;\n }\n\n protected onClose() {\n this.middleware.clean();\n /* // need to clear, and left 1 page for smooth slide\n let pageCount = appPhotosManager.windowH / 56 * 1.25 | 0;\n (Array.from(this.list.children) as HTMLElement[]).slice(pageCount).forEach((el) => el.remove()); */\n }\n\n protected onOpenAfterTimeout() {\n if(IS_MOBILE || !canFocus(true)) return;\n this.inputSearch.input.focus();\n }\n\n public openContacts(query?: string) {\n this.middleware.clean();\n const middleware = this.middleware.get();\n this.scrollable.onScrolledBottom = null;\n this.scrollable.container.textContent = '';\n\n this.managers.appUsersManager.getContactsPeerIds(query, undefined, 'online').then((contacts) => {\n if(!middleware()) {\n return;\n }\n\n const sortedUserList = this.sortedUserList = this.createList();\n\n let renderPage = () => {\n const pageCount = windowSize.height / 56 * 1.25 | 0;\n const arr = contacts.splice(0, pageCount); // надо splice!\n\n arr.forEach((peerId) => {\n sortedUserList.add(peerId);\n });\n\n if(!contacts.length) {\n renderPage = undefined;\n this.scrollable.onScrolledBottom = null;\n }\n };\n\n renderPage();\n this.scrollable.onScrolledBottom = () => {\n if(renderPage) {\n renderPage();\n } else {\n this.scrollable.onScrolledBottom = null;\n }\n };\n\n replaceContent(this.scrollable.container, sortedUserList.list);\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appDialogsManager from '../../../lib/appManagers/appDialogsManager';\nimport {SliderSuperTab} from '../../slider';\nimport {FOLDER_ID_ARCHIVE, REAL_FOLDER_ID} from '../../../lib/mtproto/mtproto_config';\n\nexport default class AppArchivedTab extends SliderSuperTab {\n private static filterId: REAL_FOLDER_ID = FOLDER_ID_ARCHIVE;\n private wasFilterId: number;\n\n public init() {\n this.wasFilterId = appDialogsManager.filterId;\n\n this.container.id = 'chats-archived-container';\n this.setTitle('ArchivedChats');\n\n this.header.classList.add('can-have-forum');\n this.content.classList.add('can-have-forum');\n\n if(!appDialogsManager.xds[AppArchivedTab.filterId]) {\n const {ul, scrollable} = appDialogsManager.l({\n title: undefined,\n id: AppArchivedTab.filterId,\n localId: FOLDER_ID_ARCHIVE\n });\n scrollable.container.append(ul);\n }\n\n const scrollable = appDialogsManager.xds[AppArchivedTab.filterId].scrollable;\n this.scrollable.container.replaceWith(scrollable.container);\n scrollable.attachBorderListeners(this.container);\n // ! DO NOT UNCOMMENT NEXT LINE - chats will stop loading on scroll after closing the tab\n // this.scrollable = scrollable;\n return appDialogsManager.setFilterIdAndChangeTab(AppArchivedTab.filterId).then(({cached, renderPromise}) => {\n if(cached) {\n return renderPromise;\n }\n });\n }\n\n // вообще, так делать нельзя, но нет времени чтобы переделать главный чатлист на слайд...\n onOpenAfterTimeout() {\n appDialogsManager.xds[this.wasFilterId].clear();\n }\n\n onClose() {\n this.scrollable.onAdditionalScroll = undefined;\n appDialogsManager.setFilterIdAndChangeTab(this.wasFilterId);\n }\n\n onCloseAfterTimeout() {\n appDialogsManager.xds[AppArchivedTab.filterId].clear();\n return super.onCloseAfterTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider';\nimport ButtonCorner from '../../buttonCorner';\nimport AppNewGroupTab from './newGroup';\nimport {toast} from '../../toast';\nimport {ButtonMenuItemOptions} from '../../buttonMenu';\nimport {i18n, join, _i18n} from '../../../lib/langPack';\nimport rootScope from '../../../lib/rootScope';\nimport wrapSticker from '../../wrappers/sticker';\nimport SortedUserList from '../../sortedUserList';\nimport {PeerLocated, Update, Updates} from '../../../layer';\nimport {SettingChatListSection} from '..';\nimport appDialogsManager from '../../../lib/appManagers/appDialogsManager';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport confirmationPopup from '../../confirmationPopup';\nimport getPeerId from '../../../lib/appManagers/utils/peers/getPeerId';\nimport type LazyLoadQueue from '../../lazyLoadQueue';\n\nexport default class AppPeopleNearbyTab extends SliderSuperTab {\n private latestLocationSaved: {latitude: number, longitude: number, accuracy: number};\n private isLocationWatched: boolean = false;\n private errorCategory: HTMLElement;\n private retryBtn: HTMLButtonElement;\n private btnOptions: HTMLButtonElement;\n private menuButtons: (ButtonMenuItemOptions & {verify?: () => boolean})[];\n\n protected lazyLoadQueue: LazyLoadQueue;\n protected peopleSection: SettingChatListSection;\n protected chatsSection: SettingChatListSection;\n\n protected locatedPeers: Map;\n\n // public async init() {\n // this.container.classList.add('people-nearby-container');\n // this.setTitle('PeopleNearby');\n\n // this.errorCategory = document.createElement('div');\n // this.errorCategory.classList.add('text', 'hide', 'nearby-error');\n\n // this.retryBtn = ButtonCorner({icon: 'check'});\n\n // const emoji = '🧭';\n // const doc = await this.managers.appStickersManager.getAnimatedEmojiSticker(emoji);\n // const stickerContainer = document.createElement('div');\n // stickerContainer.classList.add('sticker-container');\n\n // if(doc) {\n // wrapSticker({\n // doc,\n // div: stickerContainer,\n // loop: false,\n // play: true,\n // width: 86,\n // height: 86,\n // emoji,\n // needUpscale: true\n // }).then(() => {\n // // this.animation = player;\n // });\n // } else {\n // stickerContainer.classList.add('media-sticker-wrapper');\n // }\n\n // const caption = document.createElement('div');\n // caption.classList.add('caption');\n // _i18n(caption, 'PeopleNearbyInfo2');\n\n // this.locatedPeers = new Map();\n\n // const m = () => {\n // const sortedUserList = new SortedUserList({\n // avatarSize: 42,\n // createChatListOptions: {\n // dialogSize: 48,\n // new: true\n // },\n // autonomous: false,\n // onUpdate: (element) => {\n // const peer = this.locatedPeers.get(element.id);\n // const elements: HTMLElement[] = [\n // this.parseDistance(peer.distance)\n // ];\n\n // if(!element.id.isUser()) {\n // elements.push(this.managers.appProfileManager.getChatMembersString(element.id.toChatId()));\n // }\n\n // element.dom.lastMessageSpan.textContent = '';\n // element.dom.lastMessageSpan.append(...join(elements, false));\n // },\n // getIndex: (element) => {\n // const peer = this.locatedPeers.get(element.id);\n // return 0x7FFFFFFF - peer.distance;\n // },\n // appUsersManager: this.managers.appUsersManager\n // });\n\n // appDialogsManager.setListClickListener(sortedUserList.list, undefined, undefined, false);\n\n // return sortedUserList;\n // };\n\n // const peopleSection = this.peopleSection = new SettingChatListSection({\n // name: 'PeopleNearbyHeader',\n // sortedList: m()\n // });\n\n // const chatsSection = this.chatsSection = new SettingChatListSection({\n // name: 'ChatsNearbyHeader',\n // sortedList: m()\n // });\n\n // const btnMakeVisible = peopleSection.makeButton({\n // text: 'MakeMyselfVisible',\n // icon: 'location'\n // });\n\n // const btnMakeInvisible = peopleSection.makeButton({\n // text: 'StopShowingMe',\n // icon: 'location'\n // });\n\n // const btnCreateGroup = chatsSection.makeButton({\n // text: 'NearbyCreateGroup',\n // icon: 'newgroup'\n // });\n\n // attachClickEvent(btnMakeVisible, () => {\n // confirmationPopup({\n // titleLangKey: 'MakeMyselfVisibleTitle',\n // descriptionLangKey: 'MakeMyselfVisibleInfo',\n // button: {\n // langKey: 'OK'\n // }\n // }).then(() => {\n // this.startWatching();\n // });\n // }, {listenerSetter: this.listenerSetter});\n\n // attachClickEvent(btnMakeInvisible, () => {\n // this.stopWatching();\n // }, {listenerSetter: this.listenerSetter});\n\n // attachClickEvent(btnCreateGroup, () => {\n // this.slider.createTab(AppNewGroupTab).open([], true);\n // }, {listenerSetter: this.listenerSetter});\n\n // btnMakeVisible.classList.add('primary');\n // btnMakeInvisible.classList.add('danger');\n // btnCreateGroup.classList.add('primary');\n\n // this.content.append(this.retryBtn);\n // this.scrollable.append(\n // stickerContainer,\n // caption,\n // peopleSection.container,\n // chatsSection.container,\n // this.errorCategory\n // );\n // }\n\n private parseDistance(distance: number) {\n if(rootScope.settings.distanceUnit === 'miles') {\n if(distance > 1609.34) {\n return i18n('MilesAway', [Math.round(distance / 1609)]);\n } else {\n return i18n('FootsAway', [Math.round(distance * 3.281)]);\n }\n } else {\n if(distance >= 1000) {\n return i18n('KMetersAway2', [distance / 1000]);\n } else {\n return i18n('MetersAway2', [distance]);\n }\n }\n }\n\n // public open() {\n // const result = super.open();\n // result.then(() => {\n // this.retryBtn.classList.remove('is-visible');\n // navigator.geolocation.getCurrentPosition((location) => {\n // this.latestLocationSaved = {\n // latitude: location.coords.latitude,\n // longitude: location.coords.longitude,\n // accuracy: location.coords.accuracy\n // };\n\n // console.log(this.latestLocationSaved);\n\n // this.managers.appUsersManager.getLocated(\n // location.coords.latitude,\n // location.coords.longitude,\n // location.coords.accuracy\n // ).then((response) => {\n // const update = (response as Updates.updates).updates[0] as Update.updatePeerLocated;\n // const peers = update.peers as PeerLocated.peerLocated[];\n // const orderedPeers = peers.sort((a, b) => a.distance - b.distance);\n // const groupsCounter = peers.filter((e) => e.peer._ == 'peerChannel').length;\n // const usersCounter = peers.filter((e) => e.peer._ != 'peerChannel').length;\n // orderedPeers?.forEach((peer) => {\n // const peerId = getPeerId(peer.peer);\n // const section = peerId.isUser() ? this.peopleSection : this.chatsSection;\n // this.locatedPeers.set(peerId, peer);\n // section.sortedList.add(peerId);\n // });\n\n // this.errorCategory.classList.toggle('hide', !!(usersCounter || groupsCounter));\n // this.errorCategory.innerHTML = 'No groups or channels found around you.';\n // });\n // }, (error) => {\n // this.errorCategory.classList.remove('hide');\n // this.retryBtn.classList.add('is-visible');\n // this.retryBtn.addEventListener('click', this.open);\n // if(error instanceof GeolocationPositionError) {\n // this.errorCategory.innerHTML = 'Location permission denied. Click below to retry.';\n // } else {\n // this.errorCategory.innerHTML = 'An error has occurred. Please retry later clicking the button below.';\n // }\n // });\n // });\n\n // return result;\n // }\n\n private startWatching() {\n if(!this.latestLocationSaved || this.isLocationWatched) return;\n this.isLocationWatched = true;\n\n toast('Your position is now being shared. Do not close the page or it will be suspended.');\n\n this.managers.appUsersManager.getLocated(\n this.latestLocationSaved.latitude,\n this.latestLocationSaved.longitude,\n this.latestLocationSaved.accuracy,\n true, // background parameter\n 0x7fffffff // self_expires parameter\n );\n\n navigator.geolocation.watchPosition((result) => {\n const isLongitudeDifferent = result.coords.longitude !== this.latestLocationSaved.longitude;\n const isLatitudeDifferent = result.coords.latitude !== this.latestLocationSaved.latitude;\n const distanceCheck = this.calculateDistance(\n result.coords.latitude, result.coords.longitude,\n this.latestLocationSaved.latitude, this.latestLocationSaved.longitude\n ) > 100;\n\n if((isLatitudeDifferent || isLongitudeDifferent) && distanceCheck) {\n this.managers.appUsersManager.getLocated(\n result.coords.latitude,\n result.coords.longitude,\n result.coords.accuracy,\n true, // background parameter\n 0x7fffffff // self_expires parameter\n );\n this.latestLocationSaved = {\n latitude: result.coords.latitude,\n longitude: result.coords.longitude,\n accuracy: result.coords.accuracy\n }\n }\n });\n }\n\n private stopWatching() {\n if(!this.isLocationWatched) return;\n this.isLocationWatched = false;\n toast('The sharing of your position has been stopped. You will no longer be visible to other users.');\n this.managers.appUsersManager.getLocated(\n 0, // latitude parameter\n 0, // longitude parameter\n 0, // accuracy parameter\n false, // background parameter\n 0 // self_expires parameter\n );\n }\n\n private calculateDistance(lat1: number, long1: number, lat2: number, long2: number) {\n const p = 0.017453292519943295; // Math.PI/180\n return (\n 12742 * Math.asin(\n Math.sqrt(\n (0.5 - Math.cos((lat2 - lat1) * p)) +\n (\n Math.cos(lat1 * p) * Math.cos(lat2 * p) *\n (1 - Math.cos((long2 - long1) * p)/2)\n )\n )\n )\n );\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appImManager from '../../lib/appManagers/appImManager';\nimport rootScope from '../../lib/rootScope';\nimport {SearchGroup} from '../appSearch';\nimport '../avatar';\nimport Scrollable, {ScrollableX} from '../scrollable';\nimport InputSearch from '../inputSearch';\nimport SidebarSlider from '../slider';\nimport TransitionSlider from '../transition';\nimport AppNewGroupTab from './tabs/newGroup';\nimport AppSearchSuper from '../appSearchSuper.';\nimport {DateData, fillTipDates} from '../../helpers/date';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport AppSettingsTab from './tabs/settings';\nimport AppNewChannelTab from './tabs/newChannel';\nimport AppContactsTab from './tabs/contacts';\nimport AppArchivedTab from './tabs/archivedTab';\nimport AppAddMembersTab from './tabs/addMembers';\nimport I18n, {FormatterArguments, i18n, i18n_, LangPackKey} from '../../lib/langPack';\nimport AppPeopleNearbyTab from './tabs/peopleNearby';\nimport {ButtonMenuItemOptions} from '../buttonMenu';\nimport CheckboxField from '../checkboxField';\nimport {IS_MOBILE_SAFARI} from '../../environment/userAgent';\nimport appNavigationController, {NavigationItem} from '../appNavigationController';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport PeerTitle from '../peerTitle';\nimport App from '../../config/app';\nimport ButtonMenuToggle from '../buttonMenuToggle';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport sessionStorage from '../../lib/sessionStorage';\nimport {attachClickEvent, CLICK_EVENT_NAME, simulateClickEvent} from '../../helpers/dom/clickEvent';\nimport ButtonIcon from '../buttonIcon';\nimport confirmationPopup from '../confirmationPopup';\nimport IS_GEOLOCATION_SUPPORTED from '../../environment/geolocationSupport';\nimport type SortedUserList from '../sortedUserList';\nimport Button, {ButtonOptions} from '../button';\nimport noop from '../../helpers/noop';\nimport ripple from '../ripple';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport formatNumber from '../../helpers/number/formatNumber';\nimport AvatarElement from '../avatar';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport themeController from '../../helpers/themeController';\nimport contextMenuController from '../../helpers/contextMenuController';\nimport {DIALOG_LIST_ELEMENT_TAG} from '../../lib/appManagers/appDialogsManager';\nimport apiManagerProxy from '../../lib/mtproto/mtprotoworker';\nimport SettingSection, {SettingSectionOptions} from '../settingSection';\nimport {FOLDER_ID_ARCHIVE} from '../../lib/mtproto/mtproto_config';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport {fastRaf} from '../../helpers/schedulers';\nimport {getInstallPrompt} from '../../helpers/dom/installPrompt';\nimport liteMode from '../../helpers/liteMode';\nimport AppPowerSavingTab from './tabs/powerSaving';\n\nexport const LEFT_COLUMN_ACTIVE_CLASSNAME = 'is-left-column-shown';\n\nexport class AppSidebarLeft extends SidebarSlider {\n private toolsBtn: HTMLElement;\n private backBtn: HTMLButtonElement;\n // private searchInput = document.getElementById('global-search') as HTMLInputElement;\n private inputSearch: InputSearch;\n\n public archivedCount: HTMLSpanElement;\n public rect: DOMRect;\n\n private newBtnMenu: HTMLElement;\n\n // private log = logger('SL');\n\n private searchGroups: {[k in 'contacts' | 'globalContacts' | 'messages' | 'people' | 'recent']: SearchGroup} = {} as any;\n private searchSuper: AppSearchSuper;\n\n private updateBtn: HTMLElement;\n private hasUpdate: boolean;\n\n constructor() {\n super({\n sidebarEl: document.getElementById('column-left') as HTMLDivElement,\n navigationType: 'left'\n });\n }\n\n construct(managers: AppManagers) {\n this.managers = managers;\n // this._selectTab(0); // make first tab as default\n\n this.inputSearch = new InputSearch('Search');\n const sidebarHeader = this.sidebarEl.querySelector('.item-main .sidebar-header');\n sidebarHeader.append(this.inputSearch.container);\n\n const onNewGroupClick = () => {\n this.createTab(AppAddMembersTab).open({\n type: 'chat',\n skippable: true,\n takeOut: (peerIds) => this.createTab(AppNewGroupTab).open(peerIds),\n title: 'GroupAddMembers',\n placeholder: 'SendMessageTo'\n });\n };\n\n const onContactsClick = () => {\n this.createTab(AppContactsTab).open();\n };\n\n // this.toolsBtn = this.sidebarEl.querySelector('.sidebar-tools-button') as HTMLButtonElement;\n this.backBtn = this.sidebarEl.querySelector('.sidebar-back-button') as HTMLButtonElement;\n\n const btnArchive: typeof menuButtons[0] = {\n icon: 'archive',\n text: 'ArchivedChats',\n onClick: () => {\n this.createTab(AppArchivedTab).open();\n },\n verify: async() => {\n const folder = await this.managers.dialogsStorage.getFolderDialogs(FOLDER_ID_ARCHIVE, false);\n return !!folder.length || !(await this.managers.dialogsStorage.isDialogsLoaded(FOLDER_ID_ARCHIVE));\n }\n };\n\n const themeCheckboxField = new CheckboxField({\n toggle: true,\n checked: themeController.getTheme().name === 'night'\n });\n themeCheckboxField.input.addEventListener('change', async() => {\n themeController.switchTheme(themeCheckboxField.input.checked ? 'night' : 'day');\n });\n\n rootScope.addEventListener('theme_change', () => {\n themeCheckboxField.setValueSilently(themeController.getTheme().name === 'night');\n });\n\n const menuButtons: (ButtonMenuItemOptions & {verify?: () => boolean | Promise})[] = [{\n icon: 'savedmessages',\n text: 'SavedMessages',\n onClick: () => {\n setTimeout(() => { // menu doesn't close if no timeout (lol)\n appImManager.setPeer({\n peerId: appImManager.myId\n });\n }, 0);\n }\n }, btnArchive, {\n icon: 'user',\n text: 'Contacts',\n onClick: onContactsClick\n }, IS_GEOLOCATION_SUPPORTED ? {\n icon: 'group',\n text: 'PeopleNearby',\n onClick: () => {\n this.createTab(AppPeopleNearbyTab).open();\n }\n } : undefined, {\n icon: 'settings',\n text: 'Settings',\n onClick: () => {\n this.createTab(AppSettingsTab).open();\n }\n }, {\n icon: 'darkmode',\n text: 'DarkMode',\n onClick: () => {\n\n },\n checkboxField: themeCheckboxField\n }, {\n icon: 'animations',\n text: 'Animations',\n onClick: () => {\n\n },\n checkboxField: new CheckboxField({\n toggle: true,\n checked: true,\n stateKey: 'settings.liteMode.animations',\n stateValueReverse: true\n }),\n verify: () => !liteMode.isEnabled()\n }, {\n icon: 'animations',\n text: 'LiteMode.Title',\n onClick: () => {\n this.createTab(AppPowerSavingTab).open();\n },\n verify: () => liteMode.isEnabled()\n }, {\n icon: 'help',\n text: 'TelegramFeatures',\n onClick: () => {\n const url = I18n.format('TelegramFeaturesUrl', true);\n appImManager.openUrl(url);\n }\n }, {\n icon: 'bug',\n text: 'ReportBug',\n onClick: () => {\n const a = document.createElement('a');\n a.target = '_blank';\n a.href = 'https://bugs.telegram.org/?tag_ids=40&sort=time';\n document.body.append(a);\n a.click();\n setTimeout(() => {\n a.remove();\n }, 0);\n }\n }, {\n icon: 'char z',\n text: 'ChatList.Menu.SwitchTo.Z',\n onClick: () => {\n Promise.all([\n sessionStorage.set({kz_version: 'Z'}),\n sessionStorage.delete('tgme_sync')\n ]).then(() => {\n location.href = 'https://web.telegram.org/z/';\n });\n },\n verify: () => App.isMainDomain\n }, /* {\n icon: 'char w',\n text: 'ChatList.Menu.SwitchTo.Webogram',\n onClick: () => {\n sessionStorage.delete('tgme_sync').then(() => {\n location.href = 'https://web.telegram.org/?legacy=1';\n });\n },\n verify: () => App.isMainDomain\n }, */ {\n icon: 'download',\n text: 'PWA.Install',\n onClick: () => {\n const installPrompt = getInstallPrompt();\n installPrompt?.();\n },\n verify: () => !!getInstallPrompt()\n }];\n\n const filteredButtons = menuButtons.filter(Boolean);\n\n this.toolsBtn = ButtonMenuToggle({\n direction: 'bottom-right',\n buttons: filteredButtons,\n onOpen: (e, btnMenu) => {\n const btnMenuFooter = document.createElement('a');\n btnMenuFooter.href = 'https://github.com/morethanwords/tweb/blob/master/CHANGELOG.md';\n btnMenuFooter.target = '_blank';\n btnMenuFooter.rel = 'noopener noreferrer';\n btnMenuFooter.classList.add('btn-menu-footer');\n btnMenuFooter.addEventListener(CLICK_EVENT_NAME, (e) => {\n e.stopPropagation();\n contextMenuController.close();\n });\n const t = document.createElement('span');\n t.classList.add('btn-menu-footer-text');\n t.innerHTML = 'Telegram Web' + App.suffix + ' '/* ' alpha ' */ + App.versionFull;\n btnMenuFooter.append(t);\n btnMenu.classList.add('has-footer');\n btnMenu.append(btnMenuFooter);\n\n btnArchive.element?.append(this.archivedCount);\n }\n });\n this.toolsBtn.classList.remove('tgico-more');\n this.toolsBtn.classList.add('sidebar-tools-button', 'is-visible');\n\n this.backBtn.parentElement.insertBefore(this.toolsBtn, this.backBtn);\n\n this.newBtnMenu = ButtonMenuToggle({\n direction: 'top-left',\n buttons: [{\n icon: 'newchannel',\n text: 'NewChannel',\n onClick: () => {\n this.createTab(AppNewChannelTab).open();\n }\n }, {\n icon: 'newgroup',\n text: 'NewGroup',\n onClick: onNewGroupClick\n }, {\n icon: 'newprivate',\n text: 'NewPrivateChat',\n onClick: onContactsClick\n }]\n });\n this.newBtnMenu.className = 'btn-circle rp btn-corner z-depth-1 btn-menu-toggle animated-button-icon';\n this.newBtnMenu.insertAdjacentHTML('afterbegin', `\n \n \n `);\n this.newBtnMenu.id = 'new-menu';\n sidebarHeader.nextElementSibling.append(this.newBtnMenu);\n\n this.updateBtn = document.createElement('div');\n this.updateBtn.className = 'btn-circle rp btn-corner z-depth-1 btn-update is-hidden';\n ripple(this.updateBtn);\n this.updateBtn.append(i18n('Update'));\n\n attachClickEvent(this.updateBtn, () => {\n if(this.updateBtn.classList.contains('is-hidden')) {\n return;\n }\n\n location.reload();\n });\n\n sidebarHeader.nextElementSibling.append(this.updateBtn);\n\n this.inputSearch.input.addEventListener('focus', () => this.initSearch(), {once: true});\n\n this.archivedCount = document.createElement('span');\n this.archivedCount.className = 'archived-count badge badge-24 badge-gray';\n\n rootScope.addEventListener('folder_unread', (folder) => {\n if(folder.id === FOLDER_ID_ARCHIVE) {\n // const count = folder.unreadMessagesCount;\n const count = folder.unreadPeerIds.size;\n this.archivedCount.textContent = '' + formatNumber(count, 1);\n this.archivedCount.classList.toggle('hide', !count);\n }\n });\n\n this.managers.appUsersManager.getTopPeers('correspondents');\n\n // Focus search input by pressing Escape\n const navigationItem: NavigationItem = {\n type: 'global-search-focus',\n onPop: () => {\n setTimeout(() => {\n this.inputSearch.input.focus();\n }, 0);\n\n return false;\n },\n noHistory: true\n };\n appNavigationController.pushItem(navigationItem);\n\n apiManagerProxy.getState().then(() => {\n const CHECK_UPDATE_INTERVAL = 1800e3;\n const checkUpdateInterval = setInterval(() => {\n fetch('version', {cache: 'no-cache'})\n .then((res) => (res.status === 200 && res.ok && res.text()) || Promise.reject())\n .then((text) => {\n if(text !== App.versionFull) {\n this.hasUpdate = true;\n clearInterval(checkUpdateInterval);\n\n if(!this.newBtnMenu.classList.contains('is-hidden')) {\n this.updateBtn.classList.remove('is-hidden');\n }\n }\n })\n .catch(noop);\n }, CHECK_UPDATE_INTERVAL);\n });\n\n const onResize = () => {\n const rect = this.rect = this.tabsContainer.getBoundingClientRect();\n document.documentElement.style.setProperty('--left-column-width', rect.width + 'px');\n };\n\n fastRaf(onResize);\n mediaSizes.addEventListener('resize', onResize);\n }\n\n private initSearch() {\n const searchContainer = this.sidebarEl.querySelector('#search-container') as HTMLDivElement;\n\n const scrollable = new Scrollable(searchContainer);\n\n const close = () => {\n // setTimeout(() => {\n simulateClickEvent(this.backBtn);\n // }, 0);\n };\n\n this.searchGroups = {\n contacts: new SearchGroup('SearchAllChatsShort', 'contacts', undefined, undefined, undefined, undefined, close),\n globalContacts: new SearchGroup('GlobalSearch', 'contacts', undefined, undefined, undefined, undefined, close),\n messages: new SearchGroup('SearchMessages', 'messages'),\n people: new SearchGroup(false, 'contacts', true, 'search-group-people', true, false, close, true),\n recent: new SearchGroup('Recent', 'contacts', true, 'search-group-recent', true, true, close)\n };\n\n const searchSuper = this.searchSuper = new AppSearchSuper({\n mediaTabs: [{\n inputFilter: 'inputMessagesFilterEmpty',\n name: 'FilterChats',\n type: 'chats'\n }, {\n inputFilter: 'inputMessagesFilterPhotoVideo',\n name: 'SharedMediaTab2',\n type: 'media'\n }, {\n inputFilter: 'inputMessagesFilterUrl',\n name: 'SharedLinksTab2',\n type: 'links'\n }, {\n inputFilter: 'inputMessagesFilterDocument',\n name: 'SharedFilesTab2',\n type: 'files'\n }, {\n inputFilter: 'inputMessagesFilterMusic',\n name: 'SharedMusicTab2',\n type: 'music'\n }, {\n inputFilter: 'inputMessagesFilterRoundVoice',\n name: 'SharedVoiceTab2',\n type: 'voice'\n }],\n scrollable,\n searchGroups: this.searchGroups,\n asChatList: true,\n hideEmptyTabs: false,\n showSender: true,\n managers: this.managers\n });\n\n searchContainer.prepend(searchSuper.nav.parentElement.parentElement);\n scrollable.container.append(searchSuper.container);\n\n const resetSearch = () => {\n searchSuper.setQuery({\n peerId: ''.toPeerId(),\n folderId: 0\n });\n searchSuper.selectTab(0);\n searchSuper.load(true);\n };\n\n resetSearch();\n\n const pickedElements: HTMLElement[] = [];\n let selectedPeerId: PeerId = ''.toPeerId();\n let selectedMinDate = 0;\n let selectedMaxDate = 0;\n const updatePicked = () => {\n // (this.inputSearch.input as HTMLInputElement).placeholder = pickedElements.length ? 'Search' : 'Telegram Search';\n this.inputSearch.container.classList.toggle('is-picked-twice', pickedElements.length === 2);\n this.inputSearch.container.classList.toggle('is-picked', !!pickedElements.length);\n\n if(pickedElements.length) {\n this.inputSearch.input.style.setProperty('--paddingLeft', (pickedElements[pickedElements.length - 1].getBoundingClientRect().right - this.inputSearch.input.getBoundingClientRect().left) + 'px');\n } else {\n this.inputSearch.input.style.removeProperty('--paddingLeft');\n }\n };\n\n const helper = document.createElement('div');\n helper.classList.add('search-helper');\n helper.addEventListener('click', (e) => {\n const target = findUpClassName(e.target, 'selector-user');\n if(!target) {\n return;\n }\n\n const key = target.dataset.key;\n if(key.indexOf('date_') === 0) {\n const [_, minDate, maxDate] = key.split('_');\n selectedMinDate = +minDate;\n selectedMaxDate = +maxDate;\n } else {\n selectedPeerId = key.toPeerId();\n }\n\n target.addEventListener('click', () => {\n unselectEntity(target);\n });\n\n this.inputSearch.container.append(target);\n this.inputSearch.onChange(this.inputSearch.value = '');\n pickedElements.push(target);\n updatePicked();\n });\n\n searchSuper.nav.parentElement.append(helper);\n\n const renderEntity = (key: PeerId | string, title?: string | HTMLElement) => {\n const div = document.createElement('div');\n div.classList.add('selector-user'/* , 'scale-in' */);\n\n const avatarEl = new AvatarElement();\n avatarEl.classList.add('selector-user-avatar', 'tgico', 'avatar-32');\n avatarEl.isDialog = true;\n\n div.dataset.key = '' + key;\n if(key.isPeerId()) {\n if(title === undefined) {\n title = new PeerTitle({peerId: key.toPeerId()}).element;\n }\n\n avatarEl.updateWithOptions({peerId: key as PeerId});\n } else {\n avatarEl.classList.add('tgico-calendarfilter');\n }\n\n if(title) {\n if(typeof(title) === 'string') {\n div.innerHTML = title;\n } else {\n replaceContent(div, title);\n div.append(title);\n }\n }\n\n div.insertAdjacentElement('afterbegin', avatarEl);\n\n return div;\n };\n\n const unselectEntity = (target: HTMLElement) => {\n const key = target.dataset.key;\n if(key.indexOf('date_') === 0) {\n selectedMinDate = selectedMaxDate = 0;\n } else {\n selectedPeerId = ''.toPeerId();\n }\n\n target.remove();\n indexOfAndSplice(pickedElements, target);\n\n setTimeout(() => {\n updatePicked();\n this.inputSearch.onChange(this.inputSearch.value);\n }, 0);\n };\n\n this.inputSearch.onClear = () => {\n pickedElements.forEach((el) => {\n unselectEntity(el);\n });\n };\n\n this.inputSearch.onChange = (value) => {\n searchSuper.cleanupHTML();\n searchSuper.setQuery({\n peerId: selectedPeerId,\n folderId: selectedPeerId ? undefined : 0,\n query: value,\n minDate: selectedMinDate,\n maxDate: selectedMaxDate\n });\n searchSuper.load(true);\n\n helper.innerHTML = '';\n searchSuper.nav.classList.remove('hide');\n if(!value) {\n }\n\n if(!selectedPeerId && value.trim()) {\n const middleware = searchSuper.middleware.get();\n Promise.all([\n // appMessagesManager.getConversationsAll(value).then((dialogs) => dialogs.map((d) => d.peerId)),\n this.managers.dialogsStorage.getDialogs({query: value}).then(({dialogs}) => dialogs.map((d) => d.peerId)),\n this.managers.appUsersManager.getContactsPeerIds(value, true)\n ]).then((results) => {\n if(!middleware()) return;\n const peerIds = new Set(results[0].concat(results[1]));\n\n peerIds.forEach((peerId) => {\n helper.append(renderEntity(peerId));\n });\n\n searchSuper.nav.classList.toggle('hide', !!helper.innerHTML);\n // console.log('got peerIds by value:', value, [...peerIds]);\n });\n }\n\n if(!selectedMinDate && value.trim()) {\n const dates: DateData[] = [];\n fillTipDates(value, dates);\n dates.forEach((dateData) => {\n helper.append(renderEntity('date_' + dateData.minDate + '_' + dateData.maxDate, dateData.title));\n });\n\n searchSuper.nav.classList.toggle('hide', !!helper.innerHTML);\n }\n };\n\n searchSuper.tabs.inputMessagesFilterEmpty.addEventListener('mousedown', (e) => {\n const target = findUpTag(e.target, DIALOG_LIST_ELEMENT_TAG) as HTMLElement;\n if(!target) {\n return;\n }\n\n const searchGroup = findUpClassName(target, 'search-group');\n if(!searchGroup || searchGroup.classList.contains('search-group-recent') || searchGroup.classList.contains('search-group-people')) {\n return;\n }\n\n const peerId = target.getAttribute('data-peer-id').toPeerId();\n this.managers.appUsersManager.pushRecentSearch(peerId);\n }, {capture: true});\n\n const peopleContainer = document.createElement('div');\n peopleContainer.classList.add('search-group-scrollable');\n peopleContainer.append(this.searchGroups.people.list);\n this.searchGroups.people.container.append(peopleContainer);\n const peopleScrollable = new ScrollableX(peopleContainer);\n\n let first = true;\n let hideNewBtnMenuTimeout: number;\n // const transition = Transition.bind(null, searchContainer.parentElement, 150);\n const transition = TransitionSlider({\n content: searchContainer.parentElement,\n type: 'zoom-fade',\n transitionTime: 150,\n onTransitionEnd: (id) => {\n if(hideNewBtnMenuTimeout) clearTimeout(hideNewBtnMenuTimeout);\n\n if(id === 0 && !first) {\n searchSuper.selectTab(0, false);\n this.inputSearch.onClearClick();\n hideNewBtnMenuTimeout = window.setTimeout(() => {\n hideNewBtnMenuTimeout = 0;\n this.newBtnMenu.classList.remove('is-hidden');\n this.hasUpdate && this.updateBtn.classList.remove('is-hidden');\n }, 150);\n }\n\n first = false;\n }\n });\n\n transition(0);\n\n const activeClassName = 'is-visible';\n const onFocus = () => {\n this.toolsBtn.classList.remove(activeClassName);\n this.backBtn.classList.add(activeClassName);\n this.newBtnMenu.classList.add('is-hidden');\n this.updateBtn.classList.add('is-hidden');\n this.toolsBtn.parentElement.firstElementChild.classList.toggle('state-back', true);\n\n const navigationType: NavigationItem['type'] = 'global-search';\n if(!IS_MOBILE_SAFARI && !appNavigationController.findItemByType(navigationType)) {\n appNavigationController.pushItem({\n onPop: () => {\n close();\n },\n type: navigationType\n });\n }\n\n transition(1);\n };\n\n this.inputSearch.input.addEventListener('focus', onFocus);\n onFocus();\n\n attachClickEvent(this.backBtn, (e) => {\n this.toolsBtn.classList.add(activeClassName);\n this.backBtn.classList.remove(activeClassName);\n this.toolsBtn.parentElement.firstElementChild.classList.toggle('state-back', false);\n\n appNavigationController.removeByType('global-search');\n\n transition(0);\n });\n\n const clearRecentSearchBtn = ButtonIcon('close');\n this.searchGroups.recent.nameEl.append(clearRecentSearchBtn);\n clearRecentSearchBtn.addEventListener('click', () => {\n confirmationPopup({\n descriptionLangKey: 'Search.Confirm.ClearHistory',\n button: {\n langKey: 'ClearButton',\n isDanger: true\n }\n }).then(() => {\n return this.managers.appUsersManager.clearRecentSearch().then(() => {\n this.searchGroups.recent.clear();\n });\n });\n });\n }\n}\n\nexport class SettingChatListSection extends SettingSection {\n public sortedList: SortedUserList;\n\n constructor(options: SettingSectionOptions & {sortedList: SortedUserList}) {\n super(options);\n\n this.sortedList = options.sortedList;\n\n this.content.append(this.sortedList.list);\n }\n\n public makeButton(options: ButtonOptions) {\n const button = Button('folder-category-button btn btn-primary btn-transparent', options);\n if(this.title) this.content.insertBefore(button, this.title.nextSibling);\n else this.content.prepend(button);\n return button;\n }\n}\n\nconst appSidebarLeft = new AppSidebarLeft();\nMOUNT_CLASS_TO.appSidebarLeft = appSidebarLeft;\nexport default appSidebarLeft;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider';\nimport AppSelectPeers from '../../appSelectPeers';\nimport {setButtonLoader} from '../../putPreloader';\nimport {LangPackKey, _i18n} from '../../../lib/langPack';\nimport ButtonCorner from '../../buttonCorner';\n\nexport default class AppAddMembersTab extends SliderSuperTab {\n private nextBtn: HTMLButtonElement;\n private selector: AppSelectPeers;\n private peerType: 'channel' | 'chat' | 'privacy';\n private takeOut: (peerIds: PeerId[]) => Promise | false | void;\n private skippable: boolean;\n\n public init(options: {\n title: LangPackKey,\n placeholder: LangPackKey,\n type: AppAddMembersTab['peerType'],\n takeOut?: AppAddMembersTab['takeOut'],\n skippable: boolean,\n selectedPeerIds?: PeerId[]\n }) {\n this.container.classList.add('add-members-container');\n this.nextBtn = ButtonCorner({icon: 'arrow_next'});\n this.content.append(this.nextBtn);\n this.scrollable.container.remove();\n\n this.nextBtn.addEventListener('click', () => {\n const peerIds = this.selector.getSelected().map((sel) => sel.toPeerId());\n const result = this.takeOut(peerIds);\n\n if(this.skippable && !(result instanceof Promise)) {\n this.close();\n } else if(result instanceof Promise) {\n this.attachToPromise(result);\n } else if(result === undefined) {\n this.close();\n }\n });\n\n //\n this.setTitle(options.title);\n this.peerType = options.type;\n this.takeOut = options.takeOut;\n this.skippable = options.skippable;\n\n const isPrivacy = this.peerType === 'privacy';\n this.selector = new AppSelectPeers({\n appendTo: this.content,\n onChange: this.skippable ? null : (length) => {\n this.nextBtn.classList.toggle('is-visible', !!length);\n },\n peerType: [isPrivacy ? 'dialogs' : 'contacts'],\n placeholder: options.placeholder,\n exceptSelf: isPrivacy,\n filterPeerTypeBy: isPrivacy ? ['isAnyGroup', 'isUser'] : undefined,\n managers: this.managers,\n design: 'square'\n });\n\n if(options.selectedPeerIds) {\n this.selector.addInitial(options.selectedPeerIds);\n }\n\n this.nextBtn.classList.add('tgico-arrow_next');\n this.nextBtn.innerHTML = '';\n this.nextBtn.disabled = false;\n this.nextBtn.classList.toggle('is-visible', this.skippable);\n }\n\n public attachToPromise(promise: Promise) {\n const removeLoader = setButtonLoader(this.nextBtn, 'arrow_next');\n\n promise.then(() => {\n this.close();\n }, () => {\n removeLoader();\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {renderImageFromUrlPromise} from './dom/renderImageFromUrl';\n\nexport function averageColorFromCanvas(canvas: HTMLCanvasElement) {\n const context = canvas.getContext('2d');\n\n const pixel = new Array(4).fill(0);\n const pixels = context.getImageData(0, 0, canvas.width, canvas.height).data;\n const pixelsLength = pixels.length / 4;\n for(let i = 0; i < pixels.length; i += 4) {\n // const alphaPixel = pixels[i + 3];\n pixel[0] += pixels[i]/* * (alphaPixel / 255) */;\n pixel[1] += pixels[i + 1]/* * (alphaPixel / 255) */;\n pixel[2] += pixels[i + 2]/* * (alphaPixel / 255) */;\n pixel[3] += pixels[i + 3];\n }\n\n const outPixel = new Uint8ClampedArray(4);\n outPixel[0] = pixel[0] / pixelsLength;\n outPixel[1] = pixel[1] / pixelsLength;\n outPixel[2] = pixel[2] / pixelsLength;\n outPixel[3] = pixel[3] / pixelsLength;\n // outPixel[3] = 255;\n return outPixel;\n}\n\nexport function averageColorFromImageSource(imageSource: CanvasImageSource, width: number, height: number) {\n const canvas = document.createElement('canvas');\n const ratio = width / height;\n const DIMENSIONS = 50;\n if(ratio === 1) {\n canvas.width = DIMENSIONS;\n canvas.height = canvas.width / ratio;\n } else if(ratio > 1) {\n canvas.height = DIMENSIONS;\n canvas.width = canvas.height / ratio;\n } else {\n canvas.width = canvas.height = DIMENSIONS;\n }\n\n const context = canvas.getContext('2d');\n context.drawImage(imageSource, 0, 0, width, height, 0, 0, canvas.width, canvas.height);\n return averageColorFromCanvas(canvas);\n}\n\nexport function averageColor(imageUrl: string) {\n const img = document.createElement('img');\n return renderImageFromUrlPromise(img, imageUrl, false).then(() => {\n return averageColorFromImageSource(img, img.naturalWidth, img.naturalHeight);\n });\n};\n","import {rgbaToHsla} from './color';\n\n// * https://github.com/TelegramMessenger/Telegram-iOS/blob/3d062fff78cc6b287c74e6171f855a3500c0156d/submodules/TelegramPresentationData/Sources/PresentationData.swift#L453\nexport default function highlightningColor(rgba: [number, number, number, number?]) {\n let {h, s, l} = rgbaToHsla(rgba[0], rgba[1], rgba[2]);\n if(s > 0) {\n s = Math.min(100, s + 5 + 0.1 * (100 - s));\n }\n l = Math.max(0, l * .65);\n\n const hsla = `hsla(${h}, ${s}%, ${l}%, .4)`;\n return hsla;\n}\n","import {ColorHsla, ColorRgba, hexaToHsla, hslaToRgba, rgbaToHexa as rgbaToHexa, rgbaToHsla} from '../helpers/color';\nimport attachGrabListeners from '../helpers/dom/attachGrabListeners';\nimport clamp from '../helpers/number/clamp';\nimport InputField, {InputState} from './inputField';\n\nexport type ColorPickerColor = {\n hsl: string;\n rgb: string;\n hex: string;\n hsla: string;\n rgba: string;\n hexa: string;\n rgbaArray: ColorRgba;\n};\n\nexport default class ColorPicker {\n private static BASE_CLASS = 'color-picker';\n public container: HTMLElement;\n\n private boxRect: DOMRect;\n // private boxDraggerRect: DOMRect;\n private hueRect: DOMRect;\n // private hueDraggerRect: DOMRect;\n\n private hue = 0;\n private saturation = 100;\n private lightness = 50;\n private alpha = 1;\n private elements: {\n box: SVGSVGElement,\n boxDragger: SVGSVGElement,\n sliders: HTMLElement,\n hue: SVGSVGElement,\n hueDragger: SVGSVGElement,\n saturation: SVGLinearGradientElement,\n } = {} as any;\n private hexInputField: InputField;\n private rgbInputField: InputField;\n public onChange: (color: ReturnType) => void;\n\n constructor() {\n this.container = document.createElement('div');\n this.container.classList.add(ColorPicker.BASE_CLASS);\n\n const html = `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n `;\n\n this.container.innerHTML = html;\n\n this.elements.box = this.container.firstElementChild as any;\n this.elements.boxDragger = this.elements.box.lastElementChild as any;\n this.elements.saturation = this.elements.box.firstElementChild.firstElementChild as any;\n\n this.elements.sliders = this.elements.box.nextElementSibling as any;\n\n this.elements.hue = this.elements.sliders.firstElementChild as any;\n this.elements.hueDragger = this.elements.hue.lastElementChild as any;\n\n this.hexInputField = new InputField({plainText: true, label: 'Appearance.Color.Hex'});\n this.rgbInputField = new InputField({plainText: true, label: 'Appearance.Color.RGB'});\n\n const inputs = document.createElement('div');\n inputs.className = ColorPicker.BASE_CLASS + '-inputs';\n inputs.append(this.hexInputField.container, this.rgbInputField.container);\n this.container.append(inputs);\n\n this.hexInputField.input.addEventListener('input', () => {\n let value = this.hexInputField.value.replace(/#/g, '').slice(0, 6);\n\n const match = value.match(/([a-fA-F\\d]+)/);\n const valid = match && match[0].length === value.length && [/* 3, 4, */6].includes(value.length);\n this.hexInputField.setState(valid ? InputState.Neutral : InputState.Error);\n\n value = '#' + value;\n this.hexInputField.setValueSilently(value);\n\n if(valid) {\n this.setColor(value, false, true);\n }\n });\n\n // patched https://stackoverflow.com/a/34029238/6758968\n const rgbRegExp = /^(?:rgb)?\\(?([01]?\\d\\d?|2[0-4]\\d|25[0-5])(?:\\W+)([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\W+(?:([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\)?)$/;\n this.rgbInputField.input.addEventListener('input', () => {\n const match = this.rgbInputField.value.match(rgbRegExp);\n this.rgbInputField.setState(match ? InputState.Neutral : InputState.Error);\n\n if(match) {\n this.setColor(rgbaToHsla(+match[1], +match[2], +match[3]), true, false);\n }\n });\n\n this.attachBoxListeners();\n this.attachHueListeners();\n }\n\n private onGrabStart = () => {\n document.documentElement.style.cursor = this.elements.boxDragger.style.cursor = 'grabbing';\n };\n\n private onGrabEnd = () => {\n document.documentElement.style.cursor = this.elements.boxDragger.style.cursor = '';\n };\n\n private attachBoxListeners() {\n attachGrabListeners(this.elements.box as any, () => {\n this.onGrabStart();\n this.boxRect = this.elements.box.getBoundingClientRect();\n // this.boxDraggerRect = this.elements.boxDragger.getBoundingClientRect();\n }, (pos) => {\n this.saturationHandler(pos.x, pos.y);\n }, () => {\n this.onGrabEnd();\n });\n }\n\n private attachHueListeners() {\n attachGrabListeners(this.elements.hue as any, () => {\n this.onGrabStart();\n this.hueRect = this.elements.hue.getBoundingClientRect();\n // this.hueDraggerRect = this.elements.hueDragger.getBoundingClientRect();\n }, (pos) => {\n this.hueHandler(pos.x);\n }, () => {\n this.onGrabEnd();\n });\n }\n\n public setColor(color: ColorHsla | string, updateHexInput = true, updateRgbInput = true) {\n if(color === undefined) { // * set to red\n color = {\n h: 0,\n s: 100,\n l: 50,\n a: 1\n };\n } else if(typeof(color) === 'string') {\n if(color[0] === '#') {\n color = hexaToHsla(color);\n } else {\n const rgb = color.match(/[.?\\d]+/g);\n color = rgbaToHsla(+rgb[0], +rgb[1], +rgb[2], rgb[3] === undefined ? 1 : +rgb[3]);\n }\n }\n\n // Set box\n this.boxRect = this.elements.box.getBoundingClientRect();\n\n const boxX = this.boxRect.width / 100 * color.s;\n const percentY = 100 - (color.l / (100 - color.s / 2)) * 100;\n const boxY = this.boxRect.height / 100 * percentY;\n\n this.saturationHandler(this.boxRect.left + boxX, this.boxRect.top + boxY, false);\n\n // Set hue\n this.hueRect = this.elements.hue.getBoundingClientRect();\n\n const percentHue = color.h / 360;\n const hueX = this.hueRect.left + this.hueRect.width * percentHue;\n\n this.hueHandler(hueX, false);\n\n // Set values\n this.hue = color.h;\n this.saturation = color.s;\n this.lightness = color.l;\n this.alpha = color.a;\n\n this.updatePicker(updateHexInput, updateRgbInput);\n };\n\n public getCurrentColor(): ColorPickerColor {\n const rgbaArray = hslaToRgba(this.hue, this.saturation, this.lightness, this.alpha);\n const hexa = rgbaToHexa(rgbaArray);\n const hex = hexa.slice(0, -2);\n\n return {\n hsl: `hsl(${this.hue}, ${this.saturation}%, ${this.lightness}%)`,\n rgb: `rgb(${rgbaArray[0]}, ${rgbaArray[1]}, ${rgbaArray[2]})`,\n hex: hex,\n hsla: `hsla(${this.hue}, ${this.saturation}%, ${this.lightness}%, ${this.alpha})`,\n rgba: `rgba(${rgbaArray[0]}, ${rgbaArray[1]}, ${rgbaArray[2]}, ${rgbaArray[3]})`,\n hexa: hexa,\n rgbaArray: rgbaArray\n };\n }\n\n public updatePicker(updateHexInput = true, updateRgbInput = true) {\n const color = this.getCurrentColor();\n this.elements.boxDragger.setAttributeNS(null, 'fill', color.hex);\n\n if(updateHexInput) {\n this.hexInputField.setValueSilently(color.hex);\n this.hexInputField.setState(InputState.Neutral);\n }\n\n if(updateRgbInput) {\n this.rgbInputField.setValueSilently(color.rgbaArray.slice(0, -1).join(', '));\n this.rgbInputField.setState(InputState.Neutral);\n }\n\n if(this.onChange) {\n this.onChange(color);\n }\n }\n\n private hueHandler(pageX: number, update = true) {\n const eventX = clamp(pageX - this.hueRect.left, 0, this.hueRect.width);\n\n const percents = eventX / this.hueRect.width;\n this.hue = Math.round(360 * percents);\n\n const hsla = `hsla(${this.hue}, 100%, 50%, ${this.alpha})`;\n\n this.elements.hueDragger.setAttributeNS(null, 'x', (percents * 100) + '%');\n this.elements.hueDragger.setAttributeNS(null, 'fill', hsla);\n\n this.elements.saturation.lastElementChild.setAttributeNS(null, 'stop-color', hsla);\n\n if(update) {\n this.updatePicker();\n }\n }\n\n private saturationHandler(pageX: number, pageY: number, update = true) {\n const maxX = this.boxRect.width;\n const maxY = this.boxRect.height;\n\n const eventX = clamp(pageX - this.boxRect.left, 0, maxX);\n const eventY = clamp(pageY - this.boxRect.top, 0, maxY);\n\n const posX = eventX / maxX * 100;\n const posY = eventY / maxY * 100;\n\n const boxDragger = this.elements.boxDragger;\n boxDragger.setAttributeNS(null, 'x', posX + '%');\n boxDragger.setAttributeNS(null, 'y', posY + '%');\n\n const saturation = clamp(posX, 0, 100);\n\n const lightnessX = 100 - saturation / 2;\n const lightnessY = 100 - clamp(posY, 0, 100);\n\n const lightness = clamp(lightnessY / 100 * lightnessX, 0, 100);\n\n this.saturation = saturation;\n this.lightness = lightness;\n\n if(update) {\n this.updatePicker();\n }\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AppTheme} from '../../../config/state';\nimport {hexaToRgba} from '../../../helpers/color';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport highlightningColor from '../../../helpers/highlightningColor';\nimport throttle from '../../../helpers/schedulers/throttle';\nimport themeController from '../../../helpers/themeController';\nimport appImManager from '../../../lib/appManagers/appImManager';\nimport rootScope from '../../../lib/rootScope';\nimport ColorPicker, {ColorPickerColor} from '../../colorPicker';\nimport SettingSection from '../../settingSection';\nimport {SliderSuperTab} from '../../slider';\nimport {WallPaper} from '../../../layer';\n\nexport default class AppBackgroundColorTab extends SliderSuperTab {\n private colorPicker: ColorPicker;\n private grid: HTMLElement;\n private applyColor: (hex: string, updateColorPicker?: boolean) => void;\n private theme: AppTheme;\n\n init() {\n this.container.classList.add('background-container', 'background-color-container');\n this.setTitle('SetColor');\n\n this.theme = themeController.getTheme();\n\n const section = new SettingSection({});\n this.colorPicker = new ColorPicker();\n\n section.content.append(this.colorPicker.container);\n\n this.scrollable.append(section.container);\n\n const gridSection = new SettingSection({});\n\n const grid = this.grid = document.createElement('div');\n grid.classList.add('grid');\n\n const colors = [\n '#E6EBEE',\n '#B2CEE1',\n '#008DD0',\n '#C6E7CB',\n '#C4E1A6',\n '#60B16E',\n '#CCD0AF',\n '#A6A997',\n '#7A7072',\n '#FDD7AF',\n '#FDB76E',\n '#DD8851'\n ];\n\n colors.forEach((color) => {\n const item = document.createElement('div');\n item.classList.add('grid-item');\n item.dataset.color = color.toLowerCase();\n\n // * need for transform scale\n const media = document.createElement('div');\n media.classList.add('grid-item-media');\n media.style.backgroundColor = color;\n\n item.append(media);\n grid.append(item);\n });\n\n attachClickEvent(grid, (e) => {\n const target = findUpClassName(e.target, 'grid-item');\n if(!target || target.classList.contains('active')) {\n return;\n }\n\n const color = target.dataset.color;\n if(!color) {\n return;\n }\n\n this.applyColor(color);\n }, {listenerSetter: this.listenerSetter});\n\n gridSection.content.append(grid);\n this.scrollable.append(gridSection.container);\n\n this.applyColor = throttle(this._applyColor, 16, true);\n }\n\n private setActive() {\n const active = this.grid.querySelector('.active');\n const background = this.theme.settings;\n const wallPaper = background.wallpaper;\n const color = wallPaper.settings.background_color;\n const target = color ? this.grid.querySelector(`.grid-item[data-color=\"${color}\"]`) : null;\n if(active === target) {\n return;\n }\n\n if(active) {\n active.classList.remove('active');\n }\n\n if(target) {\n target.classList.add('active');\n }\n }\n\n private _applyColor = (hex: string, updateColorPicker = true) => {\n if(updateColorPicker) {\n this.colorPicker.setColor(hex);\n } else {\n const rgba = hexaToRgba(hex);\n const settings = this.theme.settings;\n const hsla = highlightningColor(rgba);\n\n const wallPaper: WallPaper.wallPaperNoFile = {\n _: 'wallPaperNoFile',\n id: 0,\n pFlags: {},\n settings: {\n _: 'wallPaperSettings',\n background_color: parseInt(hex.slice(1), 16),\n pFlags: {}\n }\n };\n\n settings.wallpaper = wallPaper;\n settings.highlightningColor = hsla;\n\n this.managers.appStateManager.pushToState('settings', rootScope.settings);\n\n appImManager.applyCurrentTheme(undefined, undefined, true);\n this.setActive();\n }\n };\n\n private onColorChange = (color: ColorPickerColor) => {\n this.applyColor(color.hex, false);\n };\n\n onOpen() {\n setTimeout(() => {\n const settings = this.theme.settings;\n const color = settings?.wallpaper?.settings?.background_color;\n\n const isColored = !!color && settings.wallpaper._ === 'wallPaperNoFile';\n\n // * set active if type is color\n if(isColored) {\n this.colorPicker.onChange = this.onColorChange;\n }\n\n this.colorPicker.setColor((color && '#' + color.toString(16)) || '#cccccc');\n\n if(!isColored) {\n this.colorPicker.onChange = this.onColorChange;\n }\n }, 0);\n }\n\n onCloseAfterTimeout() {\n this.colorPicker.onChange = undefined;\n this.colorPicker = undefined;\n\n return super.onCloseAfterTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {averageColor, averageColorFromCanvas} from '../../../helpers/averageColor';\nimport blur from '../../../helpers/blur';\nimport deferredPromise, {CancellablePromise} from '../../../helpers/cancellablePromise';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport findUpClassName from '../../../helpers/dom/findUpClassName';\nimport highlightningColor from '../../../helpers/highlightningColor';\nimport copy from '../../../helpers/object/copy';\nimport sequentialDom from '../../../helpers/sequentialDom';\nimport ChatBackgroundGradientRenderer from '../../chat/gradientRenderer';\nimport {Document, PhotoSize, WallPaper, WebDocument} from '../../../layer';\nimport {MyDocument} from '../../../lib/appManagers/appDocsManager';\nimport appDownloadManager, {AppDownloadManager, DownloadBlob} from '../../../lib/appManagers/appDownloadManager';\nimport appImManager from '../../../lib/appManagers/appImManager';\nimport rootScope from '../../../lib/rootScope';\nimport Button from '../../button';\nimport CheckboxField from '../../checkboxField';\nimport ProgressivePreloader from '../../preloader';\nimport {SliderSuperTab} from '../../slider';\nimport AppBackgroundColorTab from './backgroundColor';\nimport choosePhotoSize from '../../../lib/appManagers/utils/photos/choosePhotoSize';\nimport {STATE_INIT, AppTheme} from '../../../config/state';\nimport themeController from '../../../helpers/themeController';\nimport requestFile from '../../../helpers/files/requestFile';\nimport {renderImageFromUrlPromise} from '../../../helpers/dom/renderImageFromUrl';\nimport scaleMediaElement from '../../../helpers/canvas/scaleMediaElement';\nimport {MediaSize} from '../../../helpers/mediaSize';\nimport wrapPhoto from '../../wrappers/photo';\nimport {CreateRowFromCheckboxField} from '../../row';\nimport {generateSection} from '../../settingSection';\nimport {getColorsFromWallPaper} from '../../../helpers/color';\n\nexport default class AppBackgroundTab extends SliderSuperTab {\n public static tempId = 0;\n private grid: HTMLElement;\n private clicked: Set = new Set();\n private blurCheckboxField: CheckboxField;\n\n private wallPapersByElement: Map = new Map();\n private elementsByKey: Map = new Map();\n\n public static getInitArgs() {\n return {\n backgrounds: rootScope.managers.appThemesManager.getWallPapers()\n };\n }\n\n private get theme() {\n return themeController.getTheme();\n }\n\n public init(p: ReturnType = AppBackgroundTab.getInitArgs()) {\n this.container.classList.add('background-container', 'background-image-container');\n this.setTitle('ChatBackground');\n\n {\n const container = generateSection(this.scrollable);\n\n const uploadButton = Button('btn-primary btn-transparent', {icon: 'cameraadd', text: 'ChatBackground.UploadWallpaper'});\n const colorButton = Button('btn-primary btn-transparent', {icon: 'colorize', text: 'SetColor'});\n const resetButton = Button('btn-primary btn-transparent', {icon: 'favourites', text: 'Appearance.Reset'});\n\n attachClickEvent(uploadButton, this.onUploadClick, {listenerSetter: this.listenerSetter});\n\n attachClickEvent(colorButton, () => {\n this.slider.createTab(AppBackgroundColorTab).open();\n }, {listenerSetter: this.listenerSetter});\n\n attachClickEvent(resetButton, this.onResetClick, {listenerSetter: this.listenerSetter});\n\n const wallPaper = this.theme.settings?.wallpaper;\n const blurCheckboxField = this.blurCheckboxField = new CheckboxField({\n text: 'ChatBackground.Blur',\n name: 'blur',\n checked: (wallPaper as WallPaper.wallPaper)?.settings?.pFlags?.blur\n });\n\n this.listenerSetter.add(blurCheckboxField.input)('change', async() => {\n this.theme.settings.wallpaper.settings.pFlags.blur = blurCheckboxField.input.checked || undefined;\n await this.managers.appStateManager.pushToState('settings', rootScope.settings);\n\n // * wait for animation end\n setTimeout(() => {\n const active = grid.querySelector('.active') as HTMLElement;\n if(!active) return;\n\n const wallpaper = this.wallPapersByElement.get(active);\n if((wallpaper as WallPaper.wallPaper).pFlags.pattern || wallpaper._ === 'wallPaperNoFile') {\n return;\n }\n\n AppBackgroundTab.setBackgroundDocument(wallpaper);\n }, 100);\n });\n\n container.append(\n uploadButton,\n colorButton,\n resetButton,\n CreateRowFromCheckboxField(blurCheckboxField).container\n );\n }\n\n rootScope.addEventListener('background_change', this.setActive);\n\n const promise = p.backgrounds.then((wallPapers) => {\n const promises = wallPapers.map((wallPaper) => {\n return this.addWallPaper(wallPaper);\n });\n\n return Promise.all(promises);\n });\n\n const gridContainer = generateSection(this.scrollable);\n const grid = this.grid = document.createElement('div');\n grid.classList.add('grid');\n attachClickEvent(grid, this.onGridClick, {listenerSetter: this.listenerSetter});\n gridContainer.append(grid);\n\n return promise;\n }\n\n private onUploadClick = () => {\n requestFile('image/x-png,image/png,image/jpeg').then(async(file) => {\n if(file.name.endsWith('.png')) {\n const img = document.createElement('img');\n const url = URL.createObjectURL(file);\n await renderImageFromUrlPromise(img, url, false);\n const mimeType = 'image/jpeg';\n const {blob} = await scaleMediaElement({media: img, size: new MediaSize(img.naturalWidth, img.naturalHeight), mimeType});\n file = new File([blob], file.name.replace(/\\.png$/, '.jpg'), {type: mimeType});\n }\n\n const wallPaper = await this.managers.appDocsManager.prepareWallPaperUpload(file);\n const uploadPromise = this.managers.appDocsManager.uploadWallPaper(wallPaper.id);\n const uploadDeferred: CancellablePromise = appDownloadManager.getNewDeferredForUpload(file.name, uploadPromise);\n\n const deferred = deferredPromise();\n deferred.addNotifyListener = uploadDeferred.addNotifyListener;\n deferred.cancel = uploadDeferred.cancel;\n\n uploadDeferred.then((wallPaper) => {\n this.clicked.delete(key);\n this.elementsByKey.delete(key);\n this.wallPapersByElement.set(container, wallPaper);\n const newKey = this.getWallPaperKey(wallPaper);\n this.elementsByKey.set(newKey, container);\n\n AppBackgroundTab.setBackgroundDocument(wallPaper).then(deferred.resolve, deferred.reject);\n }, deferred.reject);\n\n const key = this.getWallPaperKey(wallPaper);\n deferred.catch(() => {\n container.remove();\n });\n\n const preloader = new ProgressivePreloader({\n isUpload: true,\n cancelable: true,\n tryAgainOnFail: false\n });\n\n const {container} = await this.addWallPaper(wallPaper, false);\n this.clicked.add(key);\n\n preloader.attach(container, false, deferred);\n });\n };\n\n private onResetClick = () => {\n const defaultTheme = STATE_INIT.settings.themes.find((t) => t.name === this.theme.name);\n if(defaultTheme) {\n ++AppBackgroundTab.tempId;\n this.theme.settings = copy(defaultTheme.settings);\n this.managers.appStateManager.pushToState('settings', rootScope.settings);\n appImManager.applyCurrentTheme(undefined, undefined, true);\n this.blurCheckboxField.setValueSilently(this.theme.settings?.wallpaper?.settings?.pFlags?.blur);\n }\n };\n\n private getWallPaperKey(wallPaper: WallPaper) {\n return '' + wallPaper.id;\n }\n\n private getWallPaperKeyFromTheme(theme: AppTheme) {\n return '' + (this.getWallPaperKey(theme.settings?.wallpaper) || '');\n }\n\n public static addWallPaper(\n wallPaper: WallPaper,\n container = document.createElement('div')\n ) {\n const colors = getColorsFromWallPaper(wallPaper);\n const hasFile = wallPaper._ === 'wallPaper';\n if((hasFile && wallPaper.pFlags.pattern && !colors)/* ||\n (wallpaper.document as MyDocument).mime_type.indexOf('application/') === 0 */) {\n return;\n }\n\n const isDark = !!wallPaper.pFlags.dark;\n\n let doc: WebDocument.webDocumentNoProxy | Document.document = hasFile ? wallPaper.document as Document.document : undefined;\n if(hasFile && !doc) {\n doc = {\n _: 'webDocumentNoProxy',\n attributes: [],\n size: 100000,\n url: 'assets/img/pattern.svg',\n w: 1440,\n h: 2960,\n mime_type: 'image/svg+xml'\n };\n }\n\n container.classList.add('background-item');\n container.dataset.id = '' + wallPaper.id;\n\n const media = document.createElement('div');\n media.classList.add('background-item-media');\n\n const loadPromises: Promise[] = [];\n let wrapped: ReturnType, size: ReturnType;\n if(hasFile) {\n size = choosePhotoSize(doc, 200, 200);\n wrapped = wrapPhoto({\n photo: doc,\n message: null,\n container: media,\n withoutPreloader: true,\n size,\n noFadeIn: wallPaper.pFlags.pattern\n });\n\n if(wallPaper.pFlags.pattern) {\n media.classList.add('is-pattern');\n }\n\n const promise = wrapped.then(async({loadPromises, images}) => {\n await loadPromises.thumb || loadPromises.full;\n return images;\n }).then((images) => {\n if(wallPaper.pFlags.pattern) {\n if(isDark) {\n images.full.style.display = 'none';\n if(images.thumb) {\n images.thumb.style.display = 'none';\n }\n } else if(wallPaper.settings?.intensity) {\n images.full.style.opacity = '' + Math.abs(wallPaper.settings.intensity) / 100;\n }\n }\n\n return sequentialDom.mutate(() => {\n container.append(media);\n });\n });\n\n loadPromises.push(promise);\n } else {\n container.append(media);\n }\n\n if(wallPaper.settings?.background_color) {\n const {canvas} = ChatBackgroundGradientRenderer.create(colors);\n canvas.classList.add('background-colors-canvas');\n\n if(isDark && hasFile) {\n const promise = wrapped.then(({loadPromises}) => {\n return loadPromises.full.then(async() => {\n const cacheContext = await rootScope.managers.thumbsStorage.getCacheContext(doc, size.type);\n canvas.style.webkitMaskImage = `url(${cacheContext.url})`;\n canvas.style.opacity = '' + (wallPaper.pFlags.dark ? 100 + wallPaper.settings.intensity : wallPaper.settings.intensity) / 100;\n media.append(canvas);\n });\n });\n\n loadPromises.push(promise);\n } else {\n media.append(canvas);\n }\n }\n\n return {\n container,\n media,\n loadPromise: Promise.all(loadPromises)\n };\n }\n\n private addWallPaper(wallPaper: WallPaper, append = true) {\n const result = AppBackgroundTab.addWallPaper(wallPaper);\n if(result) {\n const {container, media} = result;\n container.classList.add('grid-item');\n media.classList.add('grid-item-media');\n\n const key = this.getWallPaperKey(wallPaper);\n this.wallPapersByElement.set(container, wallPaper);\n this.elementsByKey.set(key, container);\n\n if(this.getWallPaperKeyFromTheme(this.theme) === key) {\n container.classList.add('active');\n }\n\n this.grid[append ? 'append' : 'prepend'](container);\n }\n\n return result && result.loadPromise.then(() => result);\n }\n\n private onGridClick = (e: MouseEvent | TouchEvent) => {\n const target = findUpClassName(e.target, 'grid-item') as HTMLElement;\n if(!target) return;\n\n const wallpaper = this.wallPapersByElement.get(target);\n if(wallpaper._ === 'wallPaperNoFile') {\n AppBackgroundTab.setBackgroundDocument(wallpaper);\n return;\n }\n\n const key = this.getWallPaperKey(wallpaper);\n if(this.clicked.has(key)) return;\n this.clicked.add(key);\n\n const doc = wallpaper.document as MyDocument;\n const preloader = new ProgressivePreloader({\n cancelable: true,\n tryAgainOnFail: false\n });\n\n const load = async() => {\n const promise = AppBackgroundTab.setBackgroundDocument(wallpaper);\n const cacheContext = await this.managers.thumbsStorage.getCacheContext(doc);\n if(!cacheContext.url || this.theme.settings?.wallpaper?.settings?.pFlags?.blur) {\n preloader.attach(target, true, promise);\n }\n };\n\n preloader.construct();\n\n attachClickEvent(target, (e) => {\n if(preloader.preloader.parentElement) {\n preloader.onClick(e);\n preloader.detach();\n } else {\n load();\n }\n }, {listenerSetter: this.listenerSetter});\n\n load();\n\n // console.log(doc);\n };\n\n public static setBackgroundDocument = (wallPaper: WallPaper, themeSettings?: AppTheme['settings']) => {\n const _tempId = ++this.tempId;\n const middleware = () => _tempId === this.tempId;\n\n const doc = (wallPaper as WallPaper.wallPaper).document as MyDocument;\n const deferred = deferredPromise();\n let download: Promise | ReturnType;\n if(doc) {\n download = appDownloadManager.downloadMediaURL({\n media: doc,\n queueId: appImManager.chat.bubbles ? appImManager.chat.bubbles.lazyLoadQueue.queueId : 0\n });\n deferred.addNotifyListener = download.addNotifyListener;\n deferred.cancel = download.cancel;\n } else {\n download = Promise.resolve();\n }\n\n const saveToCache = (slug: string, url: string) => {\n fetch(url).then((response) => {\n appImManager.cacheStorage.save('backgrounds/' + slug, response);\n });\n };\n\n download.then(async() => {\n if(!middleware()) {\n deferred.resolve();\n return;\n }\n\n const hadSettings = !!themeSettings;\n themeSettings ??= themeController.getTheme().settings;\n const onReady = (url?: string) => {\n let getPixelPromise: Promise;\n const backgroundColor = getColorsFromWallPaper(wallPaper);\n if(url && !backgroundColor) {\n getPixelPromise = averageColor(url);\n } else {\n const {canvas} = ChatBackgroundGradientRenderer.create(backgroundColor);\n getPixelPromise = Promise.resolve(averageColorFromCanvas(canvas));\n }\n\n const slug = (wallPaper as WallPaper.wallPaper).slug ?? '';\n Promise.all([\n getPixelPromise,\n slug && saveToCache(slug, url)\n ]).then(([pixel]) => {\n if(!middleware()) {\n deferred.resolve();\n return;\n }\n\n const hsla = highlightningColor(Array.from(pixel) as any);\n\n themeSettings.wallpaper = wallPaper;\n themeSettings.highlightningColor = hsla;\n\n if(!hadSettings) {\n rootScope.managers.appStateManager.pushToState('settings', rootScope.settings);\n }\n\n appImManager.applyCurrentTheme(slug, url, true).then(deferred.resolve);\n });\n };\n\n if(!doc) {\n onReady();\n return;\n }\n\n const cacheContext = await rootScope.managers.thumbsStorage.getCacheContext(doc);\n if(themeSettings.wallpaper?.settings?.pFlags?.blur) {\n setTimeout(() => {\n const {canvas, promise} = blur(cacheContext.url, 12, 4);\n promise.then(() => {\n if(!middleware()) {\n deferred.resolve();\n return;\n }\n\n onReady(canvas.toDataURL());\n });\n }, 200);\n } else if(middleware()) {\n onReady(cacheContext.url);\n }\n });\n\n return deferred;\n };\n\n private setActive = () => {\n const active = this.grid.querySelector('.active');\n const target = this.elementsByKey.get(this.getWallPaperKeyFromTheme(this.theme));\n if(active === target) {\n return;\n }\n\n if(active) {\n active.classList.remove('active');\n }\n\n if(target) {\n target.classList.add('active');\n }\n };\n}\n","export default function requestFile(accept?: string) {\n const input = document.createElement('input');\n input.type = 'file';\n input.style.display = 'none';\n\n if(accept) {\n input.accept = accept;\n }\n\n document.body.append(input);\n\n const promise = new Promise((resolve, reject) => {\n input.addEventListener('change', (e: any) => {\n const file: File = e.target.files[0];\n if(!file) {\n reject('NO_FILE_SELECTED');\n return;\n }\n\n resolve(file);\n }, {once: true});\n }).finally(() => {\n input.remove();\n });\n\n input.click();\n\n return promise;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider';\nimport AppSelectPeers from '../../appSelectPeers';\nimport appDialogsManager from '../../../lib/appManagers/appDialogsManager';\nimport {MyDialogFilter as DialogFilter} from '../../../lib/storages/filters';\nimport ButtonIcon from '../../buttonIcon';\nimport CheckboxField from '../../checkboxField';\nimport Button from '../../button';\nimport AppEditFolderTab from './editFolder';\nimport I18n, {i18n, LangPackKey, _i18n, join} from '../../../lib/langPack';\nimport {toast} from '../../toast';\nimport copy from '../../../helpers/object/copy';\nimport forEachReverse from '../../../helpers/array/forEachReverse';\nimport setInnerHTML from '../../../helpers/dom/setInnerHTML';\nimport wrapEmojiText from '../../../lib/richTextProcessor/wrapEmojiText';\nimport {REAL_FOLDERS} from '../../../lib/mtproto/mtproto_config';\nimport rootScope from '../../../lib/rootScope';\nimport {MTAppConfig} from '../../../lib/mtproto/appConfig';\nimport {attachClickEvent, simulateClickEvent} from '../../../helpers/dom/clickEvent';\nimport SettingSection from '../../settingSection';\n\nexport default class AppIncludedChatsTab extends SliderSuperTab {\n private editFolderTab: AppEditFolderTab;\n private confirmBtn: HTMLElement;\n\n private selector: AppSelectPeers;\n private type: 'included' | 'excluded';\n private filter: DialogFilter;\n private originalFilter: DialogFilter;\n\n private dialogsByFilters: Map>;\n private limit: number;\n\n public init(\n filter: DialogFilter,\n type: 'included' | 'excluded',\n editFolderTab: AppIncludedChatsTab['editFolderTab']\n ) {\n this.originalFilter = filter;\n this.filter = copy(this.originalFilter);\n this.type = type;\n this.editFolderTab = editFolderTab;\n\n this.content.remove();\n this.container.classList.add('included-chatlist-container');\n this.confirmBtn = ButtonIcon('check btn-confirm blue', {noRipple: true});\n this.confirmBtn.style.display = 'none';\n\n this.header.append(this.confirmBtn);\n\n attachClickEvent(this.confirmBtn, async() => {\n const selected = this.selector.getSelected();\n\n // this.filter.pFlags = {};\n\n if(this.type === 'included') {\n for(const key in this.filter.pFlags) {\n if(key.indexOf('exclude_') === 0) {\n continue;\n }\n\n // @ts-ignore\n delete this.filter.pFlags[key];\n }\n } else {\n for(const key in this.filter.pFlags) {\n if(key.indexOf('exclude_') !== 0) {\n continue;\n }\n\n // @ts-ignore\n delete this.filter.pFlags[key];\n }\n }\n\n const peerIds: PeerId[] = [];\n for(const key of selected) {\n if(key.isPeerId()) {\n peerIds.push(key.toPeerId());\n } else {\n // @ts-ignore\n this.filter.pFlags[key] = true;\n }\n }\n\n let cmp: (peerId: PeerId) => boolean;\n if(this.type === 'included') {\n cmp = (peerId) => peerIds.includes(peerId);\n } else {\n cmp = (peerId) => !peerIds.includes(peerId);\n }\n\n forEachReverse(this.filter.pinnedPeerIds, (peerId, idx) => {\n if(!cmp(peerId)) {\n this.filter.pinnedPeerIds.splice(idx, 1);\n this.filter.pinned_peers.splice(idx, 1);\n }\n });\n\n const other = this.type === 'included' ? 'excludePeerIds' : 'includePeerIds';\n const otherLegacy = this.type === 'included' ? 'exclude_peers' : 'include_peers';\n forEachReverse(this.filter[other], (peerId, idx) => {\n if(peerIds.includes(peerId)) {\n this.filter[other].splice(idx, 1);\n this.filter[otherLegacy].splice(idx, 1);\n }\n });\n\n this.filter[this.type === 'included' ? 'includePeerIds' : 'excludePeerIds'] = peerIds;\n this.filter[this.type === 'included' ? 'include_peers' : 'exclude_peers'] = await Promise.all(peerIds.map((peerId) => this.managers.appPeersManager.getInputPeerById(peerId)));\n // this.filter.pinned_peers = this.filter.pinned_peers.filter((peerId) => this.filter.include_peers.includes(peerId));\n\n this.editFolderTab.setFilter(this.filter, false);\n this.close();\n }, {listenerSetter: this.listenerSetter});\n\n const onAppConfig = (appConfig: MTAppConfig) => {\n this.limit = rootScope.premium ? appConfig.dialog_filters_chats_limit_premium : appConfig.dialog_filters_chats_limit_default;\n };\n\n this.listenerSetter.add(rootScope)('app_config', onAppConfig);\n\n this.dialogsByFilters = new Map();\n return Promise.all([\n this.managers.filtersStorage.getDialogFilters().then(async(filters) => {\n await Promise.all(filters.filter((filter) => !REAL_FOLDERS.has(filter.id)).map(async(filter) => {\n const dialogs = await this.managers.dialogsStorage.getFolderDialogs(filter.id);\n const peerIds = dialogs.map((d) => d.peerId);\n this.dialogsByFilters.set(filter, new Set(peerIds));\n }));\n }),\n\n this.managers.apiManager.getAppConfig().then((appConfig) => {\n onAppConfig(appConfig);\n })\n ]);\n }\n\n checkbox(selected?: boolean) {\n const checkboxField = new CheckboxField({\n round: true\n });\n if(selected) {\n checkboxField.input.checked = selected;\n }\n\n return checkboxField.label;\n }\n\n renderResults = async(peerIds: PeerId[]) => {\n // const other = this.type === 'included' ? this.filter.exclude_peers : this.filter.include_peers;\n\n await this.managers.appUsersManager.getContacts();\n peerIds.forEach((peerId) => {\n // if(other.includes(peerId)) return;\n\n const {dom} = appDialogsManager.addDialogNew({\n peerId: peerId,\n container: this.selector.scrollable,\n rippleEnabled: true,\n avatarSize: 'abitbigger'\n });\n\n const selected = this.selector.selected.has(peerId);\n dom.containerEl.append(this.checkbox(selected));\n // if(selected) dom.listEl.classList.add('active');\n\n const foundInFilters: HTMLElement[] = [];\n this.dialogsByFilters.forEach((dialogs, filter) => {\n if(dialogs.has(peerId)) {\n const span = document.createElement('span');\n setInnerHTML(span, wrapEmojiText(filter.title));\n foundInFilters.push(span);\n }\n });\n\n const joined = join(foundInFilters, false);\n joined.forEach((el) => {\n dom.lastMessageSpan.append(el);\n });\n });\n };\n\n onOpen() {\n this.confirmBtn.style.display = this.type === 'excluded' ? '' : 'none';\n this.setTitle(this.type === 'included' ? 'FilterAlwaysShow' : 'FilterNeverShow');\n\n const filter = this.filter;\n\n const categoriesSection = new SettingSection({\n noDelimiter: true,\n name: 'FilterChatTypes'\n });\n\n categoriesSection.container.classList.add('folder-categories');\n\n let details: {[flag: string]: {ico: string, text: LangPackKey}};\n if(this.type === 'excluded') {\n details = {\n exclude_muted: {ico: 'mute', text: 'ChatList.Filter.MutedChats'},\n exclude_archived: {ico: 'archive', text: 'ChatList.Filter.Archive'},\n exclude_read: {ico: 'readchats', text: 'ChatList.Filter.ReadChats'}\n };\n } else {\n details = {\n contacts: {ico: 'newprivate', text: 'ChatList.Filter.Contacts'},\n non_contacts: {ico: 'noncontacts', text: 'ChatList.Filter.NonContacts'},\n groups: {ico: 'group', text: 'ChatList.Filter.Groups'},\n broadcasts: {ico: 'newchannel', text: 'ChatList.Filter.Channels'},\n bots: {ico: 'bots', text: 'ChatList.Filter.Bots'}\n };\n }\n\n const f = document.createDocumentFragment();\n for(const key in details) {\n const button = Button('btn-primary btn-transparent folder-category-button', {icon: details[key].ico, text: details[key].text});\n button.dataset.peerId = key;\n button.append(this.checkbox());\n f.append(button);\n }\n categoriesSection.content.append(f);\n\n // ///////////////\n\n const selectedPeers = (this.type === 'included' ? filter.includePeerIds : filter.excludePeerIds).slice();\n\n this.selector = new AppSelectPeers({\n appendTo: this.container,\n onChange: this.onSelectChange,\n peerType: ['dialogs'],\n renderResultsFunc: this.renderResults,\n placeholder: 'Search',\n sectionNameLangPackKey: 'FilterChats',\n managers: this.managers\n });\n this.selector.selected = new Set(selectedPeers);\n\n let addedInitial = false;\n const _add = this.selector.add.bind(this.selector);\n this.selector.add = (peerId, title, scroll) => {\n if(this.selector.selected.size >= this.limit && addedInitial && !details[peerId]) {\n const el: HTMLInputElement = this.selector.list.querySelector(`[data-peer-id=\"${peerId}\"] [type=\"checkbox\"]`);\n if(el) {\n setTimeout(() => {\n el.checked = false;\n }, 0);\n }\n\n const str = I18n.format(this.type === 'excluded' ? 'ChatList.Filter.Exclude.LimitReached': 'ChatList.Filter.Include.LimitReached', true);\n toast(str);\n return;\n }\n\n const div = _add(peerId, details[peerId] ? i18n(details[peerId].text) : undefined, scroll);\n if(details[peerId]) {\n div.querySelector('avatar-element').classList.add('tgico-' + details[peerId].ico);\n }\n return div;\n };\n\n this.selector.scrollable.container.append(categoriesSection.container, this.selector.scrollable.container.lastElementChild);\n\n this.selector.addInitial(selectedPeers);\n addedInitial = true;\n\n for(const flag in filter.pFlags) {\n // @ts-ignore\n if(details.hasOwnProperty(flag) && !!filter.pFlags[flag]) {\n simulateClickEvent(categoriesSection.content.querySelector(`[data-peer-id=\"${flag}\"]`) as HTMLElement);\n }\n }\n }\n\n onSelectChange = (length: number) => {\n // const changed = !deepEqual(this.filter, this.originalFilter);\n if(this.type === 'included') {\n this.confirmBtn.style.display = length ? '' : 'none';\n }\n };\n\n onCloseAfterTimeout() {\n if(this.selector) {\n this.selector.container.remove();\n this.selector = null;\n }\n\n return super.onCloseAfterTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appDialogsManager from '../../../lib/appManagers/appDialogsManager';\nimport {MyDialogFilter as DialogFilter} from '../../../lib/storages/filters';\nimport lottieLoader, {LottieLoader} from '../../../lib/rlottie/lottieLoader';\nimport {SliderSuperTab} from '../../slider';\nimport {toast} from '../../toast';\nimport InputField from '../../inputField';\nimport ButtonIcon from '../../buttonIcon';\nimport ButtonMenuToggle from '../../buttonMenuToggle';\nimport {ButtonMenuItemOptions} from '../../buttonMenu';\nimport Button from '../../button';\nimport AppIncludedChatsTab from './includedChats';\nimport {i18n, LangPackKey} from '../../../lib/langPack';\nimport PopupPeer from '../../popups/peer';\nimport RLottiePlayer from '../../../lib/rlottie/rlottiePlayer';\nimport copy from '../../../helpers/object/copy';\nimport deepEqual from '../../../helpers/object/deepEqual';\nimport wrapDraftText from '../../../lib/richTextProcessor/wrapDraftText';\nimport filterAsync from '../../../helpers/array/filterAsync';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport SettingSection from '../../settingSection';\n\nconst MAX_FOLDER_NAME_LENGTH = 12;\n\nexport default class AppEditFolderTab extends SliderSuperTab {\n private caption: HTMLElement;\n private stickerContainer: HTMLElement;\n\n private confirmBtn: HTMLElement;\n private menuBtn: HTMLElement;\n private nameInputField: InputField;\n\n private includePeerIds: SettingSection;\n private excludePeerIds: SettingSection;\n private flags: {[k in 'contacts' | 'non_contacts' | 'groups' | 'broadcasts' | 'bots' | 'exclude_muted' | 'exclude_archived' | 'exclude_read']: HTMLElement} = {} as any;\n\n private animation: RLottiePlayer;\n private filter: DialogFilter;\n private originalFilter: DialogFilter;\n\n private type: 'edit' | 'create';\n private loadAnimationPromise: ReturnType;\n\n public static getInitArgs() {\n return {\n animationData: lottieLoader.loadAnimationFromURLManually('Folders_2')\n };\n }\n\n public init(p: ReturnType = AppEditFolderTab.getInitArgs()) {\n this.container.classList.add('edit-folder-container');\n this.caption = document.createElement('div');\n this.caption.classList.add('caption');\n this.caption.append(i18n('FilterIncludeExcludeInfo'));\n this.stickerContainer = document.createElement('div');\n this.stickerContainer.classList.add('sticker-container');\n\n this.confirmBtn = ButtonIcon('check btn-confirm hide blue');\n let deleting = false;\n const deleteFolderButton: ButtonMenuItemOptions = {\n icon: 'delete danger',\n text: 'FilterMenuDelete',\n onClick: () => {\n new PopupPeer('filter-delete', {\n titleLangKey: 'ChatList.Filter.Confirm.Remove.Header',\n descriptionLangKey: 'ChatList.Filter.Confirm.Remove.Text',\n buttons: [{\n langKey: 'Delete',\n callback: () => {\n if(deleting) {\n return;\n }\n\n deleting = true;\n\n this.managers.filtersStorage.updateDialogFilter(this.filter, true).then((bool) => {\n this.close();\n }).finally(() => {\n deleting = false;\n });\n },\n isDanger: true\n }]\n }).show();\n }\n };\n this.menuBtn = ButtonMenuToggle({\n listenerSetter: this.listenerSetter,\n direction: 'bottom-left',\n buttons: [deleteFolderButton]\n });\n this.menuBtn.classList.add('hide');\n\n this.header.append(this.confirmBtn, this.menuBtn);\n\n const inputSection = new SettingSection({});\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n this.nameInputField = new InputField({\n label: 'FilterNameHint',\n maxLength: MAX_FOLDER_NAME_LENGTH\n });\n\n inputWrapper.append(this.nameInputField.container);\n inputSection.content.append(inputWrapper);\n\n const generateList = (className: string, h2Text: LangPackKey, buttons: {icon: string, name?: string, withRipple?: true, text: LangPackKey}[], to: any) => {\n const section = new SettingSection({\n name: h2Text,\n noDelimiter: true\n });\n\n section.container.classList.add('folder-list', className);\n\n const categories = section.generateContentElement();\n categories.classList.add('folder-categories');\n\n buttons.forEach((o) => {\n const button = Button('folder-category-button btn btn-primary btn-transparent', {\n icon: o.icon,\n text: o.text,\n noRipple: o.withRipple ? undefined : true\n });\n\n if(o.name) {\n to[o.name] = button;\n }\n\n categories.append(button);\n });\n\n return section;\n };\n\n this.includePeerIds = generateList('folder-list-included', 'FilterInclude', [{\n icon: 'add primary',\n text: 'ChatList.Filter.Include.AddChat',\n withRipple: true\n }, {\n text: 'ChatList.Filter.Contacts',\n icon: 'newprivate',\n name: 'contacts'\n }, {\n text: 'ChatList.Filter.NonContacts',\n icon: 'noncontacts',\n name: 'non_contacts'\n }, {\n text: 'ChatList.Filter.Groups',\n icon: 'group',\n name: 'groups'\n }, {\n text: 'ChatList.Filter.Channels',\n icon: 'channel',\n name: 'broadcasts'\n }, {\n text: 'ChatList.Filter.Bots',\n icon: 'bots',\n name: 'bots'\n }], this.flags);\n\n this.excludePeerIds = generateList('folder-list-excluded', 'FilterExclude', [{\n icon: 'minus primary',\n text: 'ChatList.Filter.Exclude.AddChat',\n withRipple: true\n }, {\n text: 'ChatList.Filter.MutedChats',\n icon: 'mute',\n name: 'exclude_muted'\n }, {\n text: 'ChatList.Filter.Archive',\n icon: 'archive',\n name: 'exclude_archived'\n }, {\n text: 'ChatList.Filter.ReadChats',\n icon: 'readchats',\n name: 'exclude_read'\n }], this.flags);\n\n this.scrollable.append(this.stickerContainer, this.caption, inputSection.container, this.includePeerIds.container, this.excludePeerIds.container);\n\n const includedFlagsContainer = this.includePeerIds.container.querySelector('.folder-categories');\n const excludedFlagsContainer = this.excludePeerIds.container.querySelector('.folder-categories');\n\n attachClickEvent(includedFlagsContainer.querySelector('.btn') as HTMLElement, () => {\n this.slider.createTab(AppIncludedChatsTab).open(this.filter, 'included', this);\n }, {listenerSetter: this.listenerSetter});\n\n attachClickEvent(excludedFlagsContainer.querySelector('.btn') as HTMLElement, () => {\n this.slider.createTab(AppIncludedChatsTab).open(this.filter, 'excluded', this);\n }, {listenerSetter: this.listenerSetter});\n\n attachClickEvent(this.confirmBtn, () => {\n if(this.nameInputField.input.classList.contains('error')) {\n return;\n }\n\n if(!this.nameInputField.value.trim()) {\n this.nameInputField.input.classList.add('error');\n return;\n }\n\n let include = (Array.from(includedFlagsContainer.children) as HTMLElement[]).slice(1).reduce((acc, el) => acc + +!el.style.display, 0);\n include += this.filter.include_peers.length;\n\n if(!include) {\n toast('Please choose at least one chat for this folder.');\n return;\n }\n\n this.confirmBtn.setAttribute('disabled', 'true');\n\n let promise: Promise;\n if(!this.filter.id) {\n promise = this.managers.filtersStorage.createDialogFilter(this.filter);\n } else {\n promise = this.managers.filtersStorage.updateDialogFilter(this.filter);\n }\n\n promise.then((bool) => {\n this.close();\n }).catch((err) => {\n if(err.type === 'DIALOG_FILTERS_TOO_MUCH') {\n toast('Sorry, you can\\'t create more folders.');\n } else {\n console.error('updateDialogFilter error:', err);\n }\n }).finally(() => {\n this.confirmBtn.removeAttribute('disabled');\n });\n }, {listenerSetter: this.listenerSetter});\n\n this.listenerSetter.add(this.nameInputField.input)('input', () => {\n this.filter.title = this.nameInputField.value;\n this.editCheckForChange();\n });\n\n const reloadMissingPromises: Promise[] = this.type === 'edit' ? [\n this.managers.filtersStorage.reloadMissingPeerIds(this.filter.id, 'pinned_peers'),\n this.managers.filtersStorage.reloadMissingPeerIds(this.filter.id, 'include_peers'),\n this.managers.filtersStorage.reloadMissingPeerIds(this.filter.id, 'exclude_peers')\n ] : [];\n\n return Promise.all([\n this.loadAnimationPromise = p.animationData.then(async(cb) => {\n const player = await cb({\n container: this.stickerContainer,\n loop: false,\n autoplay: false,\n width: 86,\n height: 86\n });\n\n this.animation = player;\n\n return lottieLoader.waitForFirstFrame(player);\n }),\n\n ...reloadMissingPromises\n ]).then(() => {\n if(this.type === 'edit') {\n this.setFilter(this.originalFilter, true);\n this.onEditOpen();\n } else {\n this.setInitFilter();\n this.onCreateOpen();\n }\n });\n }\n\n onOpenAfterTimeout() {\n this.loadAnimationPromise.then(() => {\n this.animation.autoplay = true;\n this.animation.play();\n });\n }\n\n private onCreateOpen() {\n // this.caption.style.display = '';\n this.setTitle('FilterNew');\n this.menuBtn.classList.add('hide');\n this.confirmBtn.classList.remove('hide');\n\n for(const flag in this.flags) {\n // @ts-ignore\n this.flags[flag].style.display = 'none';\n }\n }\n\n private onEditOpen() {\n // this.caption.style.display = 'none';\n this.setTitle(this.type === 'create' ? 'FilterNew' : 'FilterHeaderEdit');\n\n if(this.type === 'edit') {\n this.menuBtn.classList.remove('hide');\n this.confirmBtn.classList.add('hide');\n }\n\n const filter = this.filter;\n this.nameInputField.value = wrapDraftText(filter.title);\n\n for(const flag in this.flags) {\n this.flags[flag as keyof AppEditFolderTab['flags']].style.display = !!filter.pFlags[flag as keyof AppEditFolderTab['flags']] ? '' : 'none';\n }\n\n (['includePeerIds' as const, 'excludePeerIds' as const]).forEach(async(key) => {\n const section = this[key];\n const ul = appDialogsManager.createChatList({ignoreClick: true});\n\n let peers = filter[key];\n\n // filter peers where we're kicked\n const hasPeer = async(peerId: PeerId) => {\n return !!(await this.managers.appMessagesManager.getDialogOnly(peerId)) || (peerId.isUser() ? (await this.managers.appUsersManager.getUser(peerId.toUserId()))._ === 'user' : false);\n };\n\n const filtered = await filterAsync(peers, (peerId) => hasPeer(peerId));\n peers.length = 0;\n peers.push(...filtered);\n\n peers = peers.slice();\n\n const renderMore = async(_length: number) => {\n for(let i = 0, length = Math.min(peers.length, _length); i < length; ++i) {\n const peerId = peers.shift();\n if(peerId.isUser() ? false : !(await this.managers.appMessagesManager.getDialogOnly(peerId))) {\n continue;\n }\n\n const {dom} = appDialogsManager.addDialogNew({\n peerId: peerId,\n container: ul,\n rippleEnabled: false,\n meAsSaved: true,\n avatarSize: 'small'\n });\n dom.lastMessageSpan.parentElement.remove();\n }\n\n if(peers.length) {\n showMore.lastElementChild.replaceWith(i18n('FilterShowMoreChats', [peers.length]));\n } else if(showMore) {\n showMore.remove();\n }\n };\n\n section.generateContentElement().append(ul);\n\n let showMore: HTMLElement;\n if(peers.length) {\n const content = section.generateContentElement();\n showMore = Button('folder-category-button btn btn-primary btn-transparent', {icon: 'down'});\n showMore.classList.add('load-more', 'rp-overflow');\n attachClickEvent(showMore, () => renderMore(20), {listenerSetter: this.listenerSetter});\n showMore.append(i18n('FilterShowMoreChats', [peers.length]));\n\n content.append(showMore);\n }\n\n renderMore(4);\n });\n }\n\n editCheckForChange() {\n if(this.type === 'edit') {\n const changed = !deepEqual(this.originalFilter, this.filter);\n this.confirmBtn.classList.toggle('hide', !changed);\n this.menuBtn.classList.toggle('hide', changed);\n }\n };\n\n setFilter(filter: DialogFilter, firstTime: boolean) {\n if(this.container) {\n // cleanup\n Array.from(this.container.querySelectorAll('ul, .load-more')).forEach((el) => el.remove());\n }\n\n if(firstTime) {\n this.originalFilter = filter;\n this.filter = copy(filter);\n } else {\n this.filter = filter;\n this.onEditOpen();\n this.editCheckForChange();\n }\n }\n\n public setInitFilter(filter?: DialogFilter) {\n if(filter === undefined) {\n this.setFilter({\n _: 'dialogFilter',\n id: 0,\n title: '',\n pFlags: {},\n pinned_peers: [],\n include_peers: [],\n exclude_peers: [],\n pinnedPeerIds: [],\n includePeerIds: [],\n excludePeerIds: []\n }, true);\n this.type = 'create';\n } else {\n this.setFilter(filter, true);\n this.type = 'edit';\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport InputField from '../../inputField';\nimport {SliderSuperTab} from '../../slider';\nimport EditPeer from '../../editPeer';\nimport {UsernameInputField} from '../../usernameInputField';\nimport {i18n, i18n_, LangPackKey} from '../../../lib/langPack';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport rootScope from '../../../lib/rootScope';\nimport setBlankToAnchor from '../../../lib/richTextProcessor/setBlankToAnchor';\nimport getPeerEditableUsername from '../../../lib/appManagers/utils/peers/getPeerEditableUsername';\nimport SettingSection, {generateSection} from '../../settingSection';\nimport UsernamesSection from '../../usernamesSection';\n\n// TODO: аватарка не поменяется в этой вкладке после изменения почему-то (если поставить в другом клиенте, и потом тут проверить, для этого ещё вышел в чатлист)\n\nexport function purchaseUsernameCaption() {\n const p = document.createElement('div');\n const FRAGMENT_USERNAME_URL = 'https://fragment.com/username/';\n const a = setBlankToAnchor(document.createElement('a'));\n const purchaseText = i18n('Username.Purchase', [a]);\n purchaseText.classList.add('username-purchase-help');\n p.append(\n purchaseText,\n document.createElement('br'),\n document.createElement('br')\n );\n p.classList.add('hide');\n\n return {\n element: p,\n setUsername: (username: string) => {\n if(username) {\n a.href = FRAGMENT_USERNAME_URL + username;\n }\n\n p.classList.toggle('hide', !username);\n }\n };\n}\n\nexport default class AppEditProfileTab extends SliderSuperTab {\n private firstNameInputField: InputField;\n private lastNameInputField: InputField;\n private bioInputField: InputField;\n private usernameInputField: UsernameInputField;\n\n private profileUrlContainer: HTMLDivElement;\n private profileUrlAnchor: HTMLAnchorElement;\n\n private editPeer: EditPeer;\n\n public static getInitArgs() {\n return {\n bioMaxLength: rootScope.managers.apiManager.getLimit('bio'),\n user: rootScope.managers.appUsersManager.getSelf(),\n userFull: rootScope.managers.appProfileManager.getProfile(rootScope.myId.toUserId())\n };\n }\n\n public async init(p: ReturnType) {\n this.container.classList.add('edit-profile-container');\n this.setTitle('EditAccount.Title');\n\n const inputFields: InputField[] = [];\n\n const [bioMaxLength, user, userFull] = await Promise.all([p.bioMaxLength, p.user, p.userFull]);\n\n {\n const section = generateSection(this.scrollable, undefined, 'Bio.Description');\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n this.firstNameInputField = new InputField({\n label: 'EditProfile.FirstNameLabel',\n name: 'first-name',\n maxLength: 70\n });\n this.lastNameInputField = new InputField({\n label: 'Login.Register.LastName.Placeholder',\n name: 'last-name',\n maxLength: 64\n });\n this.bioInputField = new InputField({\n label: 'EditProfile.BioLabel',\n name: 'bio',\n maxLength: bioMaxLength\n });\n\n inputWrapper.append(this.firstNameInputField.container, this.lastNameInputField.container, this.bioInputField.container);\n\n const caption = document.createElement('div');\n caption.classList.add('caption');\n i18n_({element: caption, key: 'Bio.Description'});\n\n inputFields.push(this.firstNameInputField, this.lastNameInputField, this.bioInputField);\n\n this.editPeer = new EditPeer({\n peerId: rootScope.myId,\n inputFields,\n listenerSetter: this.listenerSetter\n });\n\n this.content.append(this.editPeer.nextBtn);\n\n section.append(this.editPeer.avatarEdit.container, inputWrapper);\n }\n\n {\n const section = new SettingSection({\n name: 'EditAccount.Username',\n caption: true\n });\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n this.usernameInputField = new UsernameInputField({\n label: 'EditProfile.Username.Label',\n name: 'username',\n plainText: true,\n listenerSetter: this.listenerSetter,\n onChange: () => {\n this.editPeer.handleChange();\n // this.setProfileUrl();\n\n const {error} = this.usernameInputField;\n const isPurchase = error?.type === 'USERNAME_PURCHASE_AVAILABLE';\n setUsername(isPurchase ? this.usernameInputField.value : undefined);\n },\n availableText: 'EditProfile.Username.Available',\n takenText: 'EditProfile.Username.Taken',\n invalidText: 'EditProfile.Username.Invalid'\n }, this.managers);\n\n inputWrapper.append(this.usernameInputField.container);\n\n const caption = section.caption;\n\n const {setUsername, element: p} = purchaseUsernameCaption();\n\n caption.append(\n p,\n i18n('UsernameHelp')\n // document.createElement('br'),\n // document.createElement('br')\n );\n\n // const profileUrlContainer = this.profileUrlContainer = document.createElement('div');\n // profileUrlContainer.classList.add('profile-url-container');\n // const profileUrlAnchor = this.profileUrlAnchor = anchorCopy();\n // profileUrlContainer.append(i18n('UsernameHelpLink', [profileUrlAnchor]));\n // caption.append(profileUrlContainer);\n\n inputFields.push(this.usernameInputField);\n section.content.append(inputWrapper);\n this.scrollable.append(section.container);\n }\n\n {\n const section = new UsernamesSection({\n peerId: rootScope.myId,\n peer: user,\n listenerSetter: this.listenerSetter,\n usernameInputField: this.usernameInputField,\n middleware: this.middlewareHelper.get()\n });\n\n this.scrollable.append(section.container);\n }\n\n attachClickEvent(this.editPeer.nextBtn, () => {\n this.editPeer.nextBtn.disabled = true;\n\n const promises: Promise[] = [];\n\n const profilePromise = this.managers.appProfileManager.updateProfile(\n this.firstNameInputField.value,\n this.lastNameInputField.value,\n this.bioInputField.value\n );\n promises.push(profilePromise.then(() => {\n this.close();\n }, (err) => {\n console.error('updateProfile error:', err);\n }));\n\n if(this.editPeer.uploadAvatar) {\n promises.push(this.editPeer.uploadAvatar().then((inputFile) => {\n return this.managers.appProfileManager.uploadProfilePhoto(inputFile);\n }));\n }\n\n if(this.usernameInputField.isValidToChange()) {\n promises.push(this.managers.appUsersManager.updateUsername(this.usernameInputField.value));\n }\n\n Promise.race(promises).finally(() => {\n this.editPeer.nextBtn.removeAttribute('disabled');\n });\n }, {listenerSetter: this.listenerSetter});\n\n this.firstNameInputField.setOriginalValue(user.first_name, true);\n this.lastNameInputField.setOriginalValue(user.last_name, true);\n this.bioInputField.setOriginalValue(userFull.about, true);\n this.usernameInputField.setOriginalValue(getPeerEditableUsername(user), true);\n\n // this.setProfileUrl();\n this.editPeer.handleChange();\n }\n\n // private setProfileUrl() {\n // if(this.usernameInputField.input.classList.contains('error') || !this.usernameInputField.value.length) {\n // this.profileUrlContainer.style.display = 'none';\n // } else {\n // this.profileUrlContainer.style.display = '';\n // this.profileUrlAnchor.replaceWith(this.profileUrlAnchor = anchorCopy({mePath: this.usernameInputField.value}));\n // }\n // }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appImManager, {APP_TABS} from '../../lib/appManagers/appImManager';\nimport SidebarSlider from '../slider';\nimport mediaSizes, {ScreenSize} from '../../helpers/mediaSizes';\nimport AppSharedMediaTab from './tabs/sharedMedia';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport {AppManagers} from '../../lib/appManagers/managers';\n\nexport const RIGHT_COLUMN_ACTIVE_CLASSNAME = 'is-right-column-shown';\n\nexport class AppSidebarRight extends SidebarSlider {\n private isColumnProportionSet = false;\n private sharedMediaTab: AppSharedMediaTab;\n // public rect: DOMRect;\n\n constructor() {\n super({\n sidebarEl: document.getElementById('column-right') as HTMLElement,\n canHideFirst: true,\n navigationType: 'right'\n });\n }\n\n construct(managers: AppManagers) {\n this.managers = managers;\n\n mediaSizes.addEventListener('changeScreen', (from, to) => {\n if(to === ScreenSize.medium && from !== ScreenSize.mobile) {\n this.toggleSidebar(false);\n }\n });\n\n mediaSizes.addEventListener('resize', () => {\n this.setColumnProportion();\n });\n }\n\n public createSharedMediaTab() {\n const tab = this.createTab(AppSharedMediaTab, false, true);\n tab.slider = this;\n // this.tabsContainer.prepend(tab.container);\n return tab;\n }\n\n public replaceSharedMediaTab(tab?: AppSharedMediaTab) {\n const previousTab = this.sharedMediaTab;\n if(previousTab) {\n const idx = this.historyTabIds.indexOf(previousTab);\n\n if(this._selectTab.getFrom() === previousTab.container) {\n this._selectTab.setFrom(tab?.container);\n }\n\n if(tab) {\n if(idx !== -1) {\n this.historyTabIds[idx] = tab;\n }\n\n const wasActive = previousTab.container.classList.contains('active');\n if(wasActive) {\n tab.container.classList.add('active');\n }\n\n previousTab.container.replaceWith(tab.container);\n } else {\n if(idx !== -1) {\n this.historyTabIds.splice(idx, 1);\n }\n\n previousTab.container.remove();\n }\n } else {\n this.tabsContainer.prepend(tab.container);\n }\n\n this.sharedMediaTab = tab;\n }\n\n public onCloseTab(id: number, animate: boolean, isNavigation?: boolean) {\n if(!this.historyTabIds.length) {\n this.toggleSidebar(false, animate);\n }\n\n super.onCloseTab(id, animate, isNavigation);\n }\n\n private setColumnProportion() {\n const proportion = this.sidebarEl.scrollWidth / this.sidebarEl.previousElementSibling.scrollWidth;\n document.documentElement.style.setProperty('--right-column-proportion', '' + proportion);\n // this.rect = this.sidebarEl.getBoundingClientRect();\n }\n\n public toggleSidebar(enable?: boolean, animate?: boolean) {\n const active = document.body.classList.contains(RIGHT_COLUMN_ACTIVE_CLASSNAME);\n let willChange: boolean;\n if(enable !== undefined) {\n if(enable) {\n if(!active) {\n willChange = true;\n }\n } else if(active) {\n willChange = true;\n }\n } else {\n willChange = true;\n }\n\n if(!willChange) return Promise.resolve();\n\n if(!active && !this.historyTabIds.length) {\n this.sharedMediaTab.open();\n }\n\n if(!this.isColumnProportionSet) {\n this.setColumnProportion();\n this.isColumnProportionSet = true;\n }\n\n const animationPromise = appImManager.selectTab(active ? APP_TABS.CHAT : APP_TABS.PROFILE, animate);\n document.body.classList.toggle(RIGHT_COLUMN_ACTIVE_CLASSNAME, enable);\n return animationPromise;\n\n /* return new Promise((resolve, reject) => {\n const hidden: {element: HTMLDivElement, height: number}[] = [];\n const observer = new IntersectionObserver((entries) => {\n for(const entry of entries) {\n const bubble = entry.target as HTMLDivElement;\n if(!entry.isIntersecting) {\n hidden.push({element: bubble, height: bubble.scrollHeight});\n }\n }\n\n for(const item of hidden) {\n item.element.style.minHeight = item.height + 'px';\n (item.element.firstElementChild as HTMLElement).style.display = 'none';\n item.element.style.width = '1px';\n }\n\n //console.log('hidden', hidden);\n observer.disconnect();\n\n set();\n\n setTimeout(() => {\n for(const item of hidden) {\n item.element.style.minHeight = '';\n item.element.style.width = '';\n (item.element.firstElementChild as HTMLElement).style.display = '';\n }\n\n resolve();\n }, 200);\n });\n\n const length = Object.keys(appImManager.bubbles).length;\n if(length) {\n for(const i in appImManager.bubbles) {\n observer.observe(appImManager.bubbles[i]);\n }\n } else {\n set();\n setTimeout(resolve, 200);\n }\n }); */\n }\n}\n\nconst appSidebarRight = new AppSidebarRight();\nMOUNT_CLASS_TO.appSidebarRight = appSidebarRight;\nexport default appSidebarRight;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider'\nimport InputField from '../../inputField';\nimport EditPeer from '../../editPeer';\nimport Row, {CreateRowFromCheckboxField} from '../../row';\nimport CheckboxField from '../../checkboxField';\nimport Button from '../../button';\nimport PeerTitle from '../../peerTitle';\nimport rootScope from '../../../lib/rootScope';\nimport PopupPeer from '../../popups/peer';\nimport {addCancelButton} from '../../popups';\nimport {i18n} from '../../../lib/langPack';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport getPeerId from '../../../lib/appManagers/utils/peers/getPeerId';\nimport formatUserPhone from '../../wrappers/formatUserPhone';\nimport SettingSection from '../../settingSection';\nimport wrapPeerTitle from '../../wrappers/peerTitle';\n\nexport default class AppEditContactTab extends SliderSuperTab {\n private nameInputField: InputField;\n private lastNameInputField: InputField;\n private editPeer: EditPeer;\n private sharePhoneCheckboxField: CheckboxField;\n public peerId: PeerId;\n\n public async init() {\n const {peerId} = this;\n const userId = peerId.toUserId();\n this.container.classList.add('edit-peer-container', 'edit-contact-container');\n const [isContact, privacy] = await Promise.all([\n this.managers.appUsersManager.isContact(userId),\n this.managers.appPrivacyManager.getPrivacy('inputPrivacyKeyPhoneNumber')\n ]);\n const isNew = !isContact;\n this.setTitle(isNew ? 'AddContactTitle' : 'Edit');\n\n {\n const section = new SettingSection({noDelimiter: true});\n const inputFields: InputField[] = [];\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n this.nameInputField = new InputField({\n label: 'FirstName',\n name: 'contact-name',\n maxLength: 70,\n required: true\n });\n this.lastNameInputField = new InputField({\n label: 'LastName',\n name: 'contact-lastname',\n maxLength: 70\n });\n\n if(userId) {\n const user = await this.managers.appUsersManager.getUser(userId);\n\n if(isNew) {\n this.nameInputField.setDraftValue(user.first_name);\n this.lastNameInputField.setDraftValue(user.last_name);\n } else {\n this.nameInputField.setOriginalValue(user.first_name);\n this.lastNameInputField.setOriginalValue(user.last_name);\n }\n }\n\n inputWrapper.append(this.nameInputField.container, this.lastNameInputField.container);\n inputFields.push(this.nameInputField, this.lastNameInputField);\n\n this.editPeer = new EditPeer({\n peerId: peerId,\n inputFields,\n listenerSetter: this.listenerSetter,\n doNotEditAvatar: true\n });\n this.content.append(this.editPeer.nextBtn);\n\n if(peerId) {\n const div = document.createElement('div');\n div.classList.add('avatar-edit');\n div.append(this.editPeer.avatarElem);\n\n const notificationsCheckboxField = new CheckboxField({\n text: 'Notifications'\n });\n\n notificationsCheckboxField.input.addEventListener('change', (e) => {\n if(!e.isTrusted) {\n return;\n }\n\n this.managers.appMessagesManager.togglePeerMute({peerId});\n });\n\n this.listenerSetter.add(rootScope)('notify_settings', async(update) => {\n if(update.peer._ !== 'notifyPeer') return;\n const peerId = getPeerId(update.peer.peer);\n if(peerId === peerId) {\n const enabled = !(await this.managers.appNotificationsManager.isMuted(update.notify_settings));\n if(enabled !== notificationsCheckboxField.checked) {\n notificationsCheckboxField.checked = enabled;\n }\n }\n });\n\n const profileNameDiv = document.createElement('div');\n profileNameDiv.classList.add('profile-name');\n profileNameDiv.append(new PeerTitle({\n peerId: peerId\n }).element);\n // profileNameDiv.innerHTML = 'Karen Stanford';\n\n const profileSubtitleDiv = document.createElement('div');\n profileSubtitleDiv.classList.add('profile-subtitle');\n profileSubtitleDiv.append(i18n('EditContact.OriginalName'));\n\n section.content.append(div, profileNameDiv, profileSubtitleDiv, inputWrapper);\n\n if(!isNew) {\n const notificationsRow = new Row({\n checkboxField: notificationsCheckboxField,\n withCheckboxSubtitle: true,\n listenerSetter: this.listenerSetter\n });\n\n const enabled = !(await this.managers.appNotificationsManager.isPeerLocalMuted({peerId, respectType: false}));\n notificationsCheckboxField.checked = enabled;\n\n section.content.append(notificationsRow.container);\n } else {\n const user = await this.managers.appUsersManager.getUser(userId);\n\n const phoneRow = new Row({\n icon: 'phone',\n titleLangKey: user.phone ? undefined : 'MobileHidden',\n title: user.phone ? formatUserPhone(user.phone) : undefined,\n subtitleLangKey: user.phone ? 'Phone' : 'MobileHiddenExceptionInfo',\n subtitleLangArgs: user.phone ? undefined : [new PeerTitle({peerId: peerId}).element]\n });\n\n section.content.append(phoneRow.container);\n }\n } else {\n section.content.append(inputWrapper);\n }\n\n this.scrollable.append(section.container);\n }\n\n if(!isNew) {\n const section = new SettingSection();\n\n const btnDelete = Button('btn-primary btn-transparent danger', {icon: 'delete', text: 'PeerInfo.DeleteContact'});\n\n attachClickEvent(btnDelete, () => {\n new PopupPeer('popup-delete-contact', {\n peerId: peerId,\n titleLangKey: 'DeleteContact',\n descriptionLangKey: 'AreYouSureDeleteContact',\n buttons: addCancelButton([{\n langKey: 'Delete',\n callback: () => {\n const toggle = toggleDisability([btnDelete], true);\n\n this.managers.appUsersManager.deleteContacts([userId]).then(() => {\n this.close();\n }, () => {\n toggle();\n });\n },\n isDanger: true\n }])\n }).show();\n }, {listenerSetter: this.listenerSetter});\n\n section.content.append(btnDelete);\n\n this.scrollable.append(section.container);\n } else if(\n privacy.some((privacyRule) => privacyRule._ === 'privacyValueDisallowAll') &&\n !privacy.some((privacyRule) => privacyRule._ === 'privacyValueAllowUsers' && privacyRule.users.includes(userId))\n ) {\n const section = new SettingSection({\n caption: 'NewContact.Exception.ShareMyPhoneNumber.Desc',\n captionArgs: [await wrapPeerTitle({peerId: this.peerId})]\n });\n const checkboxField = this.sharePhoneCheckboxField = new CheckboxField({\n text: 'NewContact.Exception.ShareMyPhoneNumber',\n checked: true\n });\n const row = CreateRowFromCheckboxField(checkboxField);\n\n section.content.append(row.container);\n\n this.scrollable.append(section.container);\n }\n\n attachClickEvent(this.editPeer.nextBtn, async() => {\n this.editPeer.nextBtn.disabled = true;\n\n this.managers.appUsersManager.addContact(\n userId,\n this.nameInputField.value,\n this.lastNameInputField.value,\n (await this.managers.appUsersManager.getUser(userId)).phone,\n this.sharePhoneCheckboxField?.checked\n ).finally(() => {\n this.editPeer.nextBtn.removeAttribute('disabled');\n this.close();\n });\n }, {listenerSetter: this.listenerSetter});\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport {makeMediaSize} from '../../../helpers/mediaSize';\nimport copy from '../../../helpers/object/copy';\nimport deepEqual from '../../../helpers/object/deepEqual';\nimport {ForumTopic} from '../../../layer';\nimport appImManager from '../../../lib/appManagers/appImManager';\nimport {GENERAL_TOPIC_ID, TOPIC_COLORS} from '../../../lib/mtproto/mtproto_config';\nimport getAbbreviation from '../../../lib/richTextProcessor/getAbbreviation';\nimport ButtonIcon from '../../buttonIcon';\nimport CheckboxField from '../../checkboxField';\nimport EmojiTab from '../../emoticonsDropdown/tabs/emoji';\nimport InputField from '../../inputField';\nimport Row from '../../row';\nimport SettingSection from '../../settingSection';\nimport appSidebarLeft from '../../sidebarLeft';\nimport SliderSuperTab from '../../sliderTab';\nimport {wrapTopicIcon} from '../../wrappers/messageActionTextNewUnsafe';\n\nconst size = 64;\nconst mediaSize = makeMediaSize(size, size);\n\nexport default class AppEditTopicTab extends SliderSuperTab {\n private iconDiv: HTMLElement;\n private colorIndex: number;\n private nameInputField: InputField;\n private topic: Parameters[0]['topic'];\n private emojiElement: HTMLElement;\n private confirmBtn: HTMLButtonElement;\n private originalTopic: ForumTopic.forumTopic;\n\n public async init(peerId: PeerId, threadId?: number) {\n this.colorIndex = 0;\n const isNew = !threadId;\n const isGeneral = threadId === GENERAL_TOPIC_ID;\n this.container.classList.add('edit-topic-container');\n this.setTitle(isNew ? 'NewTopic' : 'ForumTopic.Title.Edit');\n const chatId = peerId.toChatId();\n\n if(threadId) {\n this.topic = this.originalTopic = copy(await this.managers.dialogsStorage.getForumTopic(peerId, threadId));\n }\n\n {\n const section = new SettingSection({\n name: isGeneral ? 'CreateGeneralTopicTitle' : 'CreateTopicTitle'\n });\n\n const iconDiv = this.iconDiv = document.createElement('div');\n iconDiv.classList.add('edit-topic-icon-container');\n\n !threadId && attachClickEvent(iconDiv, () => {\n if(this.topic.icon_emoji_id) {\n return;\n }\n\n this.colorIndex = (this.colorIndex + 1) % TOPIC_COLORS.length;\n this.setIcon();\n }, {listenerSetter: this.listenerSetter});\n\n if(threadId) {\n iconDiv.classList.add('disable-hover');\n }\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const nameInputField = this.nameInputField = new InputField({\n label: 'ForumTopic.Name.Placeholder',\n withLinebreaks: false,\n name: 'topic-name',\n maxLength: 70,\n required: true\n });\n\n if(this.topic) {\n nameInputField.setOriginalValue(this.topic.title, true);\n }\n\n const confirmBtn = this.confirmBtn = ButtonIcon('check btn-confirm blue hide', {noRipple: true});\n this.header.append(confirmBtn);\n\n attachClickEvent(confirmBtn, () => {\n const toggle = toggleDisability([confirmBtn], true);\n if(threadId) {\n this.managers.appChatsManager.editForumTopic({\n chatId,\n topicId: threadId,\n title: nameInputField.value,\n iconEmojiId: this.topic.icon_emoji_id || 0\n }).then(() => {\n this.close();\n }).catch((err) => {\n console.error('edit topic error', err);\n toggle();\n });\n } else {\n this.managers.appChatsManager.createForumTopic({\n chatId,\n iconColor: TOPIC_COLORS[this.colorIndex],\n iconEmojiId: this.topic.icon_emoji_id,\n title: nameInputField.value\n }).then((threadId) => {\n this.close();\n appImManager.setInnerPeer({\n peerId,\n threadId\n });\n }).catch((err) => {\n console.error('create topic error', err);\n toggle();\n });\n }\n }, {listenerSetter: this.listenerSetter});\n\n this.listenerSetter.add(nameInputField.input)('input', () => {\n this.validate();\n this.setIcon(this.topic?.icon_emoji_id);\n });\n\n inputWrapper.append(nameInputField.container);\n\n section.content.append(iconDiv, inputWrapper);\n\n this.scrollable.append(section.container);\n }\n\n const promises: Promise[] = [];\n\n if(!isGeneral) {\n const section = new SettingSection({});\n section.container.classList.add('edit-topic-emoticons-container');\n const emojiTab = new EmojiTab({\n managers: this.managers,\n isStandalone: true,\n noRegularEmoji: true,\n stickerSetId: 'inputStickerSetEmojiDefaultTopicIcons',\n onClick: (emoji) => {\n emojiTab.setActive(!emoji.docId ? {emoji: undefined, docId: undefined} : emoji);\n this.setIcon(emoji.docId);\n }\n });\n emojiTab.getContainerSize = () => ({\n width: appSidebarLeft.rect.width,\n height: 400\n });\n\n this.middlewareHelper.onDestroy(() => {\n emojiTab.destroy();\n });\n\n emojiTab.container.classList.remove('tabs-tab');\n\n this.emojiElement = document.createElement('span');\n this.emojiElement.classList.add('super-emoji-topic-icon');\n\n const promise = emojiTab.init().then(async() => {\n const category = emojiTab.getCustomCategory();\n\n const iconEmojiId = this.topic?.icon_emoji_id;\n emojiTab.addEmojiToCategory({\n category,\n element: this.emojiElement,\n batch: false,\n prepend: true,\n active: !iconEmojiId\n });\n\n if(iconEmojiId) {\n emojiTab.setActive({docId: iconEmojiId, emoji: ''});\n }\n });\n\n promises.push(promise);\n\n section.content.replaceWith(emojiTab.container);\n this.scrollable.append(section.container);\n } else {\n const section = new SettingSection({caption: 'EditTopicHideInfo'});\n\n const checkboxField = new CheckboxField({\n // toggle: true,\n checked: !(this.topic as ForumTopic.forumTopic).pFlags.hidden,\n text: 'EditTopicHide'\n });\n\n this.listenerSetter.add(checkboxField.input)('change', () => {\n const promise = this.managers.appChatsManager.editForumTopic({\n chatId,\n topicId: threadId,\n hidden: !checkboxField.checked\n });\n\n row.disableWithPromise(promise);\n });\n\n const row = new Row({\n checkboxField\n });\n\n section.content.append(row.container);\n\n this.scrollable.append(section.container);\n }\n\n return Promise.all(promises).then(() => {\n return this.s();\n });\n }\n\n private validate() {\n let isChanged = this.nameInputField.isValidToChange();\n if(!isChanged && this.originalTopic) {\n isChanged = this.topic.icon_emoji_id !== this.originalTopic.icon_emoji_id;\n }\n\n this.confirmBtn.classList.toggle('hide', !isChanged);\n }\n\n private s() {\n if(this.topic?.icon_color) {\n this.colorIndex = TOPIC_COLORS.indexOf(this.topic.icon_color);\n }\n\n return this.setIcon(this.topic?.icon_emoji_id, undefined, true);\n }\n\n private async setIcon(iconEmojiId?: Long, appendTo = this.iconDiv, force?: boolean) {\n const title = this.nameInputField.value;\n\n const isMainIcon = appendTo === this.iconDiv;\n\n if(isMainIcon) {\n const newTopic: AppEditTopicTab['topic'] = {\n id: this.topic?.id,\n icon_color: TOPIC_COLORS[this.colorIndex],\n title: getAbbreviation(title, true).text || 'A',\n icon_emoji_id: iconEmojiId\n };\n\n const oldTopic = this.topic;\n this.topic = newTopic;\n\n if(\n force ||\n !oldTopic ||\n oldTopic.icon_color !== newTopic.icon_color ||\n oldTopic.title !== newTopic.title\n ) {\n this.setIcon(undefined, this.emojiElement);\n }\n\n if(deepEqual(oldTopic, newTopic) && !force) {\n return;\n }\n\n this.validate();\n }\n\n const el = await wrapTopicIcon({\n topic: isMainIcon ? this.topic : {...this.topic, icon_emoji_id: undefined},\n customEmojiSize: mediaSize,\n middleware: this.middlewareHelper.get()\n });\n\n const span = document.createElement('div');\n span.classList.add('edit-topic-icon');\n span.append(el);\n\n const oldEl = appendTo.lastElementChild as HTMLElement;\n appendTo.append(span);\n\n const applyFadeAnimation = (el: HTMLElement, fadeIn: boolean) => {\n const frames: Keyframe[] = [\n {opacity: '0', transform: 'scale(0.8)'},\n {opacity: '1', transform: 'scale(1)'}\n ];\n\n const animation = el.animate(frames, {\n duration: 200,\n iterations: 1,\n easing: 'ease-in-out',\n fill: 'forwards',\n direction: fadeIn ? 'normal' : 'reverse'\n });\n\n return new Promise((resolve) => {\n animation.addEventListener('finish', () => {\n resolve();\n }, {once: true});\n });\n };\n\n if(oldEl) {\n applyFadeAnimation(oldEl, false).then(() => oldEl.remove());\n }\n\n applyFadeAnimation(span, true);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {copyTextToClipboard} from '../../../helpers/clipboard';\nimport {randomLong} from '../../../helpers/random';\nimport {Chat, ChatFull, ExportedChatInvite} from '../../../layer';\nimport Button from '../../button';\nimport {setButtonLoader} from '../../putPreloader';\nimport RadioField from '../../radioField';\nimport Row, {RadioFormFromRows} from '../../row';\nimport {toast} from '../../toast';\nimport {UsernameInputField} from '../../usernameInputField';\nimport {SliderSuperTabEventable} from '../../sliderTab';\nimport I18n, {i18n} from '../../../lib/langPack';\nimport PopupPeer from '../../popups/peer';\nimport ButtonCorner from '../../buttonCorner';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport CheckboxField from '../../checkboxField';\nimport rootScope from '../../../lib/rootScope';\nimport SettingSection from '../../settingSection';\nimport UsernamesSection from '../../usernamesSection';\nimport getPeerEditableUsername from '../../../lib/appManagers/utils/peers/getPeerEditableUsername';\nimport getPeerActiveUsernames from '../../../lib/appManagers/utils/peers/getPeerActiveUsernames';\nimport {purchaseUsernameCaption} from '../../sidebarLeft/tabs/editProfile';\nimport confirmationPopup from '../../confirmationPopup';\n\nexport default class AppChatTypeTab extends SliderSuperTabEventable {\n public chatId: ChatId;\n public chatFull: ChatFull;\n\n public async init() {\n this.container.classList.add('edit-peer-container', 'group-type-container');\n\n const isBroadcast = await this.managers.appChatsManager.isBroadcast(this.chatId);\n\n this.setTitle(isBroadcast ? 'ChannelType' : 'GroupType');\n\n const section = new SettingSection({\n name: isBroadcast ? 'ChannelType' : 'GroupType'\n });\n\n const random = randomLong();\n const privateRow = new Row({\n radioField: new RadioField({\n langKey: isBroadcast ? 'ChannelPrivate' : 'MegaPrivate',\n name: random,\n value: 'private'\n }),\n subtitleLangKey: isBroadcast ? 'ChannelPrivateInfo' : 'MegaPrivateInfo'\n });\n const publicRow = new Row({\n radioField: new RadioField({\n langKey: isBroadcast ? 'ChannelPublic' : 'MegaPublic',\n name: random,\n value: 'public'\n }),\n subtitleLangKey: isBroadcast ? 'ChannelPublicInfo' : 'MegaPublicInfo'\n });\n const form = RadioFormFromRows([privateRow, publicRow], (value) => {\n const a: HTMLElement[][] = [[privateSection.container], [publicContainer]];\n if(value === 'public') a.reverse();\n\n a[0].forEach((container) => container.classList.remove('hide'));\n a[1].forEach((container) => container.classList.add('hide'));\n\n onChange();\n });\n\n let chat: Chat = await this.managers.appChatsManager.getChat(this.chatId);\n\n const chatUpdateListeners: {[type in 'basic']: (() => void)[]} = {basic: []};\n const addChatUpdateListener = (callback: () => void, type: 'basic' = 'basic') => {\n chatUpdateListeners[type].push(callback);\n };\n\n this.listenerSetter.add(rootScope)('chat_update', async(chatId) => {\n if(this.chatId === chatId) {\n chat = await this.managers.appChatsManager.getChat(this.chatId) as typeof chat;\n chatUpdateListeners['basic'].forEach((callback) => callback());\n }\n });\n\n section.content.append(form);\n\n const privateSection = new SettingSection({});\n\n // let revoked = false;\n const linkRow = new Row({\n title: (this.chatFull.exported_invite as ExportedChatInvite.chatInviteExported).link,\n subtitleLangKey: isBroadcast ? 'ChannelPrivateLinkHelp' : 'MegaPrivateLinkHelp',\n clickable: () => {\n copyTextToClipboard((this.chatFull.exported_invite as ExportedChatInvite.chatInviteExported).link);\n toast(I18n.format('LinkCopied', true));\n },\n listenerSetter: this.listenerSetter\n });\n\n const btnRevoke = Button('btn-primary btn-transparent danger', {icon: 'delete', text: 'RevokeLink'});\n\n attachClickEvent(btnRevoke, () => {\n new PopupPeer('revoke-link', {\n buttons: [{\n langKey: 'RevokeButton',\n callback: () => {\n const toggle = toggleDisability([btnRevoke], true);\n\n this.managers.appProfileManager.getChatInviteLink(this.chatId, true).then((link) => {\n toggle();\n linkRow.title.innerHTML = link;\n // revoked = true;\n // onChange();\n });\n }\n }],\n titleLangKey: 'RevokeLink',\n descriptionLangKey: 'RevokeAlert'\n }).show();\n }, {listenerSetter: this.listenerSetter});\n\n privateSection.content.append(linkRow.container, btnRevoke);\n\n const publicSection = new SettingSection({\n caption: true,\n noDelimiter: true\n });\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n const placeholder = 't.me/';\n\n const onChange = () => {\n const changed = (privateRow.radioField.checked && (originalValue !== placeholder/* || revoked */)) ||\n (linkInputField.isValidToChange() && linkInputField.input.classList.contains('valid'));\n applyBtn.classList.toggle('is-visible', changed);\n\n const {error} = linkInputField;\n const isPurchase = error?.type === 'USERNAME_PURCHASE_AVAILABLE';\n setUsername(isPurchase ? linkInputField.getValue() : undefined);\n };\n\n const linkInputField = new UsernameInputField({\n label: 'SetUrlPlaceholder',\n name: 'group-public-link',\n plainText: true,\n listenerSetter: this.listenerSetter,\n availableText: 'Link.Available',\n invalidText: 'Link.Invalid',\n takenText: 'Link.Taken',\n onChange: onChange,\n peerId: this.chatId.toPeerId(true),\n head: placeholder\n }, this.managers);\n\n const {setUsername, element: p} = purchaseUsernameCaption();\n\n publicSection.caption.append(\n p,\n i18n(isBroadcast ? 'Channel.UsernameAboutChannel' : 'Channel.UsernameAboutGroup')\n );\n\n const usernamesSection = new UsernamesSection({\n peerId: this.chatId.toPeerId(true),\n peer: chat as Chat.channel,\n listenerSetter: this.listenerSetter,\n usernameInputField: linkInputField,\n middleware: this.middlewareHelper.get()\n });\n\n const publicContainer = document.createElement('div');\n publicContainer.append(publicSection.container, usernamesSection.container);\n\n const originalValue = placeholder + (getPeerEditableUsername(chat as Chat.channel) || '');\n\n inputWrapper.append(linkInputField.container)\n publicSection.content.append(inputWrapper);\n\n const applyBtn = ButtonCorner({icon: 'check', className: 'is-visible'});\n this.content.append(applyBtn);\n\n attachClickEvent(applyBtn, async() => {\n const username = publicRow.radioField.checked ? linkInputField.getValue() : '';\n if(!username) {\n const chat = await this.managers.appChatsManager.getChat(this.chatId);\n const wasUsername = getPeerEditableUsername(chat as Chat.channel);\n if(wasUsername) {\n await confirmationPopup({\n descriptionLangKey: isBroadcast ? 'ChannelVisibility.Confirm.MakePrivate.Channel' : 'ChannelVisibility.Confirm.MakePrivate.Group',\n descriptionLangArgs: [wasUsername],\n button: {\n langKey: 'OK'\n }\n });\n }\n }\n\n /* const unsetLoader = */setButtonLoader(applyBtn);\n this.managers.appChatsManager.migrateChat(this.chatId).then((channelId) => {\n if(!username) {\n return this.managers.appChatsManager.makeChannelPrivate(channelId);\n } else {\n return this.managers.appChatsManager.updateUsername(channelId, username);\n }\n }).then(() => {\n // unsetLoader();\n this.close();\n });\n }, {listenerSetter: this.listenerSetter});\n\n (originalValue !== placeholder || getPeerActiveUsernames(chat as Chat.channel).length ? publicRow : privateRow).radioField.checked = true;\n linkInputField.setOriginalValue(originalValue, true);\n\n this.scrollable.append(section.container, privateSection.container, publicContainer);\n\n {\n const section = new SettingSection({\n name: 'SavingContentTitle',\n caption: isBroadcast ? 'RestrictSavingContentInfoChannel' : 'RestrictSavingContentInfoGroup'\n });\n\n const checkboxField = new CheckboxField({\n text: 'RestrictSavingContent',\n withRipple: true\n });\n\n this.listenerSetter.add(checkboxField.input)('change', () => {\n const toggle = checkboxField.toggleDisability(true);\n this.managers.appChatsManager.toggleNoForwards(this.chatId, checkboxField.checked).then(() => {\n toggle();\n });\n });\n\n const onChatUpdate = () => {\n checkboxField.setValueSilently(!!(chat as Chat.channel).pFlags.noforwards);\n };\n\n addChatUpdateListener(onChatUpdate);\n\n onChatUpdate();\n\n section.content.append(checkboxField.label);\n\n this.scrollable.append(section.container);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport deepEqual from '../../../helpers/object/deepEqual';\nimport {ChannelParticipant, ChatParticipant} from '../../../layer';\nimport appDialogsManager from '../../../lib/appManagers/appDialogsManager';\nimport Button from '../../button';\nimport confirmationPopup from '../../confirmationPopup';\nimport SettingSection from '../../settingSection';\nimport {SliderSuperTabEventable} from '../../sliderTab';\nimport getUserStatusString from '../../wrappers/getUserStatusString';\nimport wrapPeerTitle from '../../wrappers/peerTitle';\nimport {ChatPermissions} from './groupPermissions';\n\nexport default class AppUserPermissionsTab extends SliderSuperTabEventable {\n public participant: ChannelParticipant | ChatParticipant;\n public chatId: ChatId;\n public userId: UserId;\n\n public async init() {\n this.container.classList.add('edit-peer-container', 'user-permissions-container');\n this.setTitle('UserRestrictions');\n\n let destroyListener: () => void;\n\n const isChannel = await this.managers.appChatsManager.isChannel(this.chatId);\n\n {\n const section = new SettingSection({\n name: 'UserRestrictionsCanDo'\n });\n\n const div = document.createElement('div');\n div.classList.add('chatlist-container');\n section.content.insertBefore(div, section.title);\n\n const list = appDialogsManager.createChatList({new: true});\n div.append(list);\n\n const {dom} = appDialogsManager.addDialogNew({\n peerId: this.userId.toPeerId(false),\n container: list,\n rippleEnabled: true,\n avatarSize: 'abitbigger'\n });\n\n dom.lastMessageSpan.append(getUserStatusString(await this.managers.appUsersManager.getUser(this.userId)));\n\n const p = new ChatPermissions({\n chatId: this.chatId,\n listenerSetter: this.listenerSetter,\n appendTo: section.content,\n participant: this.participant._ === 'channelParticipantBanned' ? this.participant : undefined\n }, this.managers);\n\n destroyListener = () => {\n const rights = p.takeOut();\n if(this.participant._ === 'channelParticipantBanned' && deepEqual(this.participant.banned_rights.pFlags, rights.pFlags)) {\n return;\n }\n\n this.managers.appChatsManager.editBanned(this.chatId, this.participant, rights);\n };\n\n this.eventListener.addEventListener('destroy', destroyListener, {once: true});\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({});\n\n if(this.participant._ === 'channelParticipantBanned') {\n const btnDeleteException = Button('btn-primary btn-transparent danger', {icon: 'delete', text: 'GroupPermission.Delete'});\n\n attachClickEvent(btnDeleteException, () => {\n const toggle = toggleDisability([btnDeleteException], true);\n this.managers.appChatsManager.clearChannelParticipantBannedRights(\n this.chatId,\n this.participant as ChannelParticipant.channelParticipantBanned\n ).then(() => {\n this.eventListener.removeEventListener('destroy', destroyListener);\n this.close();\n }, () => {\n toggle();\n });\n }, {listenerSetter: this.listenerSetter});\n\n section.content.append(btnDeleteException);\n }\n\n const btnDelete = Button('btn-primary btn-transparent danger', {icon: 'deleteuser', text: 'UserRestrictionsBlock'});\n\n attachClickEvent(btnDelete, async() => {\n const toggle = toggleDisability([btnDelete], true);\n\n try {\n const peerId = this.userId.toPeerId();\n await confirmationPopup({\n peerId: this.chatId.toPeerId(true),\n descriptionLangKey: 'Permissions.RemoveFromGroup',\n descriptionLangArgs: [await wrapPeerTitle({peerId: peerId})],\n titleLangKey: 'ChannelBlockUser',\n button: {\n langKey: 'Remove',\n isDanger: true\n }\n });\n\n if(!isChannel) {\n await this.managers.appChatsManager.kickFromChat(this.chatId, this.participant);\n } else {\n await this.managers.appChatsManager.kickFromChannel(this.chatId, this.participant as ChannelParticipant);\n }\n } catch(err) {\n toggle();\n return;\n }\n\n this.eventListener.removeEventListener('destroy', destroyListener);\n this.close();\n }, {listenerSetter: this.listenerSetter});\n\n section.content.append(btnDelete);\n\n this.scrollable.append(section.container);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {ChatRights} from '../../../lib/appManagers/appChatsManager';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport findUpTag from '../../../helpers/dom/findUpTag';\nimport replaceContent from '../../../helpers/dom/replaceContent';\nimport ListenerSetter from '../../../helpers/listenerSetter';\nimport ScrollableLoader from '../../../helpers/scrollableLoader';\nimport {ChannelParticipant, Chat, ChatBannedRights} from '../../../layer';\nimport appDialogsManager, {DialogDom, DIALOG_LIST_ELEMENT_TAG} from '../../../lib/appManagers/appDialogsManager';\nimport {AppManagers} from '../../../lib/appManagers/managers';\nimport combineParticipantBannedRights from '../../../lib/appManagers/utils/chats/combineParticipantBannedRights';\nimport hasRights from '../../../lib/appManagers/utils/chats/hasRights';\nimport getPeerActiveUsernames from '../../../lib/appManagers/utils/peers/getPeerActiveUsernames';\nimport getPeerId from '../../../lib/appManagers/utils/peers/getPeerId';\nimport {i18n, join, LangPackKey} from '../../../lib/langPack';\nimport rootScope from '../../../lib/rootScope';\nimport PopupPickUser from '../../popups/pickUser';\nimport Row from '../../row';\nimport SettingSection from '../../settingSection';\nimport {SliderSuperTabEventable} from '../../sliderTab';\nimport {toast} from '../../toast';\nimport AppUserPermissionsTab from './userPermissions';\nimport CheckboxFields, {CheckboxFieldsField} from '../../checkboxFields';\n\ntype PermissionsCheckboxFieldsField = CheckboxFieldsField & {\n flags: ChatRights[],\n exceptionText: LangPackKey\n};\n\nexport class ChatPermissions extends CheckboxFields {\n protected chat: Chat.chat | Chat.channel;\n protected rights: ChatBannedRights.chatBannedRights;\n protected defaultBannedRights: ChatBannedRights.chatBannedRights;\n protected restrictionText: LangPackKey;\n\n constructor(private options: {\n chatId: ChatId,\n listenerSetter: ListenerSetter,\n appendTo: HTMLElement,\n participant?: ChannelParticipant.channelParticipantBanned\n }, private managers: AppManagers) {\n super({\n listenerSetter: options.listenerSetter,\n fields: [],\n asRestrictions: true\n });\n\n this.construct();\n }\n\n public async construct() {\n const options = this.options;\n const chat = this.chat = await this.managers.appChatsManager.getChat(options.chatId) as Chat.chat | Chat.channel;\n const defaultBannedRights = this.defaultBannedRights = chat.default_banned_rights;\n const rights = this.rights = options.participant ? combineParticipantBannedRights(chat as Chat.channel, options.participant.banned_rights) : defaultBannedRights;\n\n const mediaNested: PermissionsCheckboxFieldsField[] = [\n {flags: ['send_photos'], text: 'UserRestrictionsSendPhotos', exceptionText: 'UserRestrictionsNoSendPhotos'},\n {flags: ['send_videos'], text: 'UserRestrictionsSendVideos', exceptionText: 'UserRestrictionsNoSendVideos'},\n {flags: ['send_stickers', 'send_gifs'], text: 'UserRestrictionsSendStickers', exceptionText: 'UserRestrictionsNoSendStickers'},\n {flags: ['send_audios'], text: 'UserRestrictionsSendMusic', exceptionText: 'UserRestrictionsNoSendMusic'},\n {flags: ['send_docs'], text: 'UserRestrictionsSendFiles', exceptionText: 'UserRestrictionsNoSendDocs'},\n {flags: ['send_voices'], text: 'UserRestrictionsSendVoices', exceptionText: 'UserRestrictionsNoSendVoice'},\n {flags: ['send_roundvideos'], text: 'UserRestrictionsSendRound', exceptionText: 'UserRestrictionsNoSendRound'},\n {flags: ['embed_links'], text: 'UserRestrictionsEmbedLinks', exceptionText: 'UserRestrictionsNoEmbedLinks'},\n {flags: ['send_polls'], text: 'UserRestrictionsSendPolls', exceptionText: 'UserRestrictionsNoSendPolls'}\n ];\n\n const mediaToggleWith = mediaNested;\n const v: PermissionsCheckboxFieldsField[] = [\n {flags: ['send_plain'], text: 'UserRestrictionsSend', exceptionText: 'UserRestrictionsNoSend'},\n {flags: ['send_media'], text: 'UserRestrictionsSendMedia', exceptionText: 'UserRestrictionsNoSendMedia', nested: mediaNested},\n {flags: ['invite_users'], text: 'UserRestrictionsInviteUsers', exceptionText: 'UserRestrictionsNoInviteUsers'},\n {flags: ['pin_messages'], text: 'UserRestrictionsPinMessages', exceptionText: 'UserRestrictionsNoPinMessages'},\n {flags: ['change_info'], text: 'UserRestrictionsChangeInfo', exceptionText: 'UserRestrictionsNoChangeInfo'}\n ];\n\n\n const map: {[action in ChatRights]?: PermissionsCheckboxFieldsField} = {};\n v.push(...mediaNested);\n v.forEach((info) => {\n const mainFlag = info.flags[0];\n map[mainFlag] = info;\n info.checked = hasRights(chat, mainFlag, rights)\n });\n\n mediaNested.forEach((info) => info.nestedTo = map.send_media);\n map.send_media.toggleWith = {unchecked: mediaToggleWith, checked: mediaToggleWith};\n map.embed_links.toggleWith = {checked: [map.send_plain]};\n map.send_plain.toggleWith = {unchecked: [map.embed_links]};\n\n this.fields = v;\n\n for(const info of this.fields) {\n if((\n this.options.participant &&\n defaultBannedRights.pFlags[info.flags[0] as keyof typeof defaultBannedRights['pFlags']]\n ) || (\n getPeerActiveUsernames(chat as Chat.channel)[0] &&\n (\n info.flags.includes('pin_messages') ||\n info.flags.includes('change_info')\n )\n )\n ) {\n info.restrictionText = this.restrictionText;\n }\n\n if(info.nestedTo) {\n continue;\n }\n\n const {nodes} = this.createField(info);\n options.appendTo.append(...nodes);\n }\n }\n\n public takeOut() {\n const rights: ChatBannedRights = {\n _: 'chatBannedRights',\n until_date: 0x7FFFFFFF,\n pFlags: {}\n };\n\n const IGNORE_FLAGS: Set = new Set([\n 'send_media'\n ]);\n for(const info of this.fields) {\n const banned = !info.checkboxField.checked;\n if(!banned) {\n continue;\n }\n\n info.flags.forEach((flag) => {\n if(IGNORE_FLAGS.has(flag)) {\n return;\n }\n\n // @ts-ignore\n rights.pFlags[flag] = true;\n });\n }\n\n return rights;\n }\n}\n\nexport default class AppGroupPermissionsTab extends SliderSuperTabEventable {\n public chatId: ChatId;\n\n public async init() {\n this.container.classList.add('edit-peer-container', 'group-permissions-container');\n this.setTitle('ChannelPermissions');\n\n let chatPermissions: ChatPermissions;\n {\n const section = new SettingSection({\n name: 'ChannelPermissionsHeader'\n });\n\n chatPermissions = new ChatPermissions({\n chatId: this.chatId,\n listenerSetter: this.listenerSetter,\n appendTo: section.content\n }, this.managers);\n\n this.eventListener.addEventListener('destroy', () => {\n this.managers.appChatsManager.editChatDefaultBannedRights(this.chatId, chatPermissions.takeOut());\n }, {once: true});\n\n this.scrollable.append(section.container);\n }\n\n {\n const section = new SettingSection({\n name: 'PrivacyExceptions'\n });\n\n const addExceptionRow = new Row({\n titleLangKey: 'ChannelAddException',\n subtitleLangKey: 'Loading',\n icon: 'adduser',\n clickable: () => {\n new PopupPickUser({\n peerTypes: ['channelParticipants'],\n onSelect: (peerId) => {\n setTimeout(() => {\n openPermissions(peerId);\n }, 0);\n },\n placeholder: 'ExceptionModal.Search.Placeholder',\n peerId: -this.chatId\n });\n },\n listenerSetter: this.listenerSetter\n });\n\n const openPermissions = async(peerId: PeerId) => {\n let participant: AppUserPermissionsTab['participant'];\n try {\n participant = await this.managers.appProfileManager.getParticipant(this.chatId, peerId);\n } catch(err) {\n toast('User is no longer participant');\n return;\n }\n\n const tab = this.slider.createTab(AppUserPermissionsTab);\n tab.participant = participant;\n tab.chatId = this.chatId;\n tab.userId = peerId;\n tab.open();\n };\n\n section.content.append(addExceptionRow.container);\n\n /* const removedUsersRow = new Row({\n titleLangKey: 'ChannelBlockedUsers',\n subtitleLangKey: 'NoBlockedUsers',\n icon: 'deleteuser',\n clickable: true\n });\n\n section.content.append(removedUsersRow.container); */\n\n const c = section.generateContentElement();\n c.classList.add('chatlist-container');\n\n const list = appDialogsManager.createChatList({new: true});\n c.append(list);\n\n attachClickEvent(list, (e) => {\n const target = findUpTag(e.target, DIALOG_LIST_ELEMENT_TAG);\n if(!target) return;\n\n const peerId = target.dataset.peerId.toPeerId();\n openPermissions(peerId);\n }, {listenerSetter: this.listenerSetter});\n\n const setSubtitle = async(dom: DialogDom, participant: ChannelParticipant.channelParticipantBanned) => {\n const bannedRights = participant.banned_rights;// appChatsManager.combineParticipantBannedRights(this.chatId, participant.banned_rights);\n const defaultBannedRights = ((await this.managers.appChatsManager.getChat(this.chatId)) as Chat.channel).default_banned_rights;\n // const combinedRights = appChatsManager.combineParticipantBannedRights(this.chatId, bannedRights);\n\n const cantWhat: LangPackKey[] = []/* , canWhat: LangPackKey[] = [] */;\n chatPermissions.fields.forEach((info) => {\n const mainFlag = info.flags[0];\n // @ts-ignore\n if(bannedRights.pFlags[mainFlag] && !defaultBannedRights.pFlags[mainFlag]) {\n cantWhat.push(info.exceptionText);\n // @ts-ignore\n }/* else if(!combinedRights.pFlags[mainFlag]) {\n canWhat.push(info.exceptionText);\n } */\n });\n\n const el = dom.lastMessageSpan as HTMLElement;\n\n if(cantWhat.length) {\n el.replaceChildren(...join(cantWhat.map((t) => i18n(t)), false));\n }/* else if(canWhat.length) {\n str = 'Can ' + canWhat.join(canWhat.length === 2 ? ' and ' : ', ');\n } */\n\n el.classList.toggle('hide', !cantWhat.length);\n };\n\n const add = (participant: ChannelParticipant.channelParticipantBanned, append: boolean) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: getPeerId(participant.peer),\n container: list,\n rippleEnabled: true,\n avatarSize: 'abitbigger',\n append\n });\n\n (dom.listEl as any).dialogDom = dom;\n\n setSubtitle(dom, participant);\n };\n\n this.listenerSetter.add(rootScope)('chat_participant', (update) => {\n const needAdd = update.new_participant?._ === 'channelParticipantBanned' &&\n !update.new_participant.banned_rights.pFlags.view_messages;\n const li = list.querySelector(`[data-peer-id=\"${update.user_id}\"]`);\n if(needAdd) {\n if(!li) {\n add(update.new_participant as ChannelParticipant.channelParticipantBanned, false);\n } else {\n setSubtitle((li as any).dialogDom, update.new_participant as ChannelParticipant.channelParticipantBanned);\n }\n\n if(update.prev_participant?._ !== 'channelParticipantBanned') {\n ++exceptionsCount;\n }\n } else {\n li?.remove();\n\n if(update.prev_participant?._ === 'channelParticipantBanned') {\n --exceptionsCount;\n }\n }\n\n setLength();\n });\n\n const setLength = () => {\n replaceContent(addExceptionRow.subtitle, i18n(exceptionsCount ? 'Permissions.ExceptionsCount' : 'Permissions.NoExceptions', [exceptionsCount]));\n };\n\n let exceptionsCount = 0;\n let loader: ScrollableLoader;\n const setLoader = () => {\n const LOAD_COUNT = 50;\n loader = new ScrollableLoader({\n scrollable: this.scrollable,\n getPromise: () => {\n return this.managers.appProfileManager.getChannelParticipants(this.chatId, {_: 'channelParticipantsBanned', q: ''}, LOAD_COUNT, list.childElementCount).then((res) => {\n for(const participant of res.participants) {\n add(participant as ChannelParticipant.channelParticipantBanned, true);\n }\n\n exceptionsCount = res.count;\n setLength();\n\n return res.participants.length < LOAD_COUNT || res.count === list.childElementCount;\n });\n }\n });\n\n return loader.load();\n };\n\n this.scrollable.append(section.container);\n\n if(await this.managers.appChatsManager.isChannel(this.chatId)) {\n await setLoader();\n } else {\n setLength();\n\n this.listenerSetter.add(rootScope)('dialog_migrate', ({migrateFrom, migrateTo}) => {\n if(this.chatId === migrateFrom) {\n this.chatId = migrateTo;\n setLoader();\n }\n });\n }\n }\n }\n\n onOpenAfterTimeout() {\n this.scrollable.onScroll();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport copy from '../../../../helpers/object/copy';\nimport {ChatBannedRights, Chat} from '../../../../layer';\n\nexport default function combineParticipantBannedRights(chat: Chat.channel, rights: ChatBannedRights) {\n if(chat.default_banned_rights) {\n rights = copy(rights);\n const defaultRights = chat.default_banned_rights.pFlags;\n for(const i in defaultRights) {\n // @ts-ignore\n rights.pFlags[i] = defaultRights[i];\n }\n }\n\n return rights;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport replaceContent from '../../../helpers/dom/replaceContent';\nimport debounce from '../../../helpers/schedulers/debounce';\nimport {ChatReactions, Reaction} from '../../../layer';\nimport {i18n, LangPackKey} from '../../../lib/langPack';\nimport CheckboxField from '../../checkboxField';\nimport Row, {RadioFormFromValues} from '../../row';\nimport SettingSection from '../../settingSection';\nimport {SliderSuperTabEventable} from '../../sliderTab';\nimport wrapStickerToRow from '../../wrappers/stickerToRow';\n\nexport default class AppChatReactionsTab extends SliderSuperTabEventable {\n public chatId: ChatId;\n\n public async init() {\n this.setTitle('Reactions');\n\n const availableReactions = await this.managers.appReactionsManager.getActiveAvailableReactions();\n const chatFull = await this.managers.appProfileManager.getChatFull(this.chatId);\n const isBroadcast = await this.managers.appChatsManager.isBroadcast(this.chatId);\n\n let _chatReactions = chatFull.available_reactions ?? {_: 'chatReactionsNone'};\n let chatReactions = _chatReactions;\n let emoticons = new Set(_chatReactions._ === 'chatReactionsSome' ? _chatReactions.reactions.map((reaction) => (reaction as Reaction.reactionEmoji).emoticon) : []);\n\n const makeReactionFromEmoticons = (emoticons: Array): Reaction[] => emoticons.map((emoticon) => ({_: 'reactionEmoji', emoticon}));\n\n const getCaptionLangPackKey = (): LangPackKey => {\n if(isBroadcast) {\n return 'EnableReactionsChannelInfo';\n }\n\n return chatReactions._ === 'chatReactionsAll' ? 'EnableAllReactionsInfo' : (chatReactions._ === 'chatReactionsNone' ? 'DisableReactionsInfo' : 'EnableSomeReactionsInfo');\n };\n\n const toggleSection = new SettingSection({\n name: isBroadcast ? undefined : 'AvailableReactions',\n caption: getCaptionLangPackKey()\n });\n\n const reactionsSection = new SettingSection({\n name: 'OnlyAllowThisReactions'\n });\n\n const toggleCheckboxFieldsByEmoticons = () => {\n const r: Reaction.reactionEmoji[] = (chatReactions as ChatReactions.chatReactionsSome).reactions as any ?? [];\n emoticons = new Set(r.map(({emoticon}) => emoticon));\n checkboxFieldsByEmoticon.forEach((checkboxField, emoticon) => {\n checkboxField.setValueSilently(emoticons.has(emoticon));\n });\n };\n\n let toggleCheckboxField: CheckboxField;\n if(isBroadcast) {\n toggleCheckboxField = new CheckboxField({toggle: true, checked: _chatReactions._ === 'chatReactionsSome'});\n const toggleRow = new Row({\n checkboxField: toggleCheckboxField,\n titleLangKey: 'EnableReactions',\n listenerSetter: this.listenerSetter\n });\n\n toggleSection.content.append(toggleRow.container);\n\n this.listenerSetter.add(toggleCheckboxField.input)('change', () => {\n let save = true;\n if(!toggleCheckboxField.checked) {\n chatReactions = {_: 'chatReactionsNone'};\n } else if(checkboxFields.every((checkboxField) => !checkboxField.checked)) {\n chatReactions = {_: 'chatReactionsSome', reactions: makeReactionFromEmoticons(availableReactions.map(({reaction}) => reaction))};\n } else if(chatReactions._ !== 'chatReactionsSome') {\n chatReactions = {_: 'chatReactionsSome', reactions: makeReactionFromEmoticons(Array.from(emoticons))};\n } else {\n save = false;\n }\n\n if(save) {\n toggleCheckboxFieldsByEmoticons();\n saveReactionsDebounced();\n }\n });\n } else {\n const a: [ChatReactions['_'], LangPackKey][] = [\n ['chatReactionsAll', 'AllReactions'],\n ['chatReactionsSome', 'SomeReactions'],\n ['chatReactionsNone', 'NoReactions']\n ];\n\n const onChange = () => {\n reactionsSection.container.classList.toggle('hide', chatReactions._ !== 'chatReactionsSome');\n };\n\n let value = _chatReactions._;\n const form = RadioFormFromValues(a.map(([value, langPackKey]) => {\n return {\n langPackKey,\n value,\n checked: _chatReactions._ === value\n };\n }), (_value) => {\n value = _value as any;\n\n if(value === 'chatReactionsAll') {\n chatReactions = {\n _: value,\n pFlags: {\n allow_custom: true\n }\n };\n } else if(value === 'chatReactionsNone') {\n chatReactions = {\n _: value\n };\n } else {\n chatReactions = {\n _: value,\n reactions: makeReactionFromEmoticons(['👍', '👎'])\n };\n }\n\n replaceContent(toggleSection.caption, i18n(getCaptionLangPackKey()));\n toggleCheckboxFieldsByEmoticons();\n saveReactionsDebounced();\n onChange();\n });\n\n toggleSection.content.append(form);\n onChange();\n }\n\n const checkboxFieldsByEmoticon: Map = new Map();\n const checkboxFields = availableReactions.map((availableReaction) => {\n const emoticon = availableReaction.reaction;\n const checkboxField = new CheckboxField({\n toggle: true,\n checked: emoticons.has(emoticon)\n });\n\n checkboxFieldsByEmoticon.set(emoticon, checkboxField);\n\n this.listenerSetter.add(checkboxField.input)('change', () => {\n if(checkboxField.checked) {\n emoticons.add(emoticon);\n\n if(toggleCheckboxField && !toggleCheckboxField.checked) {\n toggleCheckboxField.checked = true;\n }\n } else {\n emoticons.delete(emoticon);\n\n if(toggleCheckboxField?.checked && !emoticons.size) {\n toggleCheckboxField.checked = false;\n }\n }\n\n saveReactionsDebounced();\n });\n\n const row = new Row({\n checkboxField,\n title: availableReaction.title,\n havePadding: true,\n listenerSetter: this.listenerSetter\n });\n\n wrapStickerToRow({\n row,\n doc: availableReaction.static_icon,\n size: 'small'\n });\n\n reactionsSection.content.append(row.container);\n\n return checkboxField;\n });\n\n const saveReactions = async() => {\n saveReactionsDebounced.clearTimeout();\n // const newReactions = Array.from(enabledReactions);\n // if([...newReactions].sort().join() === [...originalReactions].sort().join()) {\n // return;\n // }\n\n if(chatReactions._ === 'chatReactionsSome') {\n chatReactions.reactions = makeReactionFromEmoticons(Array.from(emoticons));\n }\n\n // const r = (chatReactions as ChatReactions.chatReactionsSome).reactions;\n // if(r?.length === availableReactions.length) {\n // chatReactions = {_: 'chatReactionsAll'};\n // }\n\n this.managers.appChatsManager.setChatAvailableReactions(this.chatId, chatReactions);\n _chatReactions = chatReactions;\n };\n\n const saveReactionsDebounced = debounce(saveReactions, 3000, false, true);\n\n this.eventListener.addEventListener('destroy', () => {\n if(saveReactionsDebounced.isDebounced()) {\n saveReactions();\n }\n }, {once: true});\n\n this.scrollable.append(toggleSection.container, reactionsSection.container);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SliderSuperTab} from '../../slider'\nimport InputField from '../../inputField';\nimport EditPeer from '../../editPeer';\nimport Row, {CreateRowFromCheckboxField} from '../../row';\nimport Button from '../../button';\nimport {ChatRights} from '../../../lib/appManagers/appChatsManager';\nimport {Chat, ChatFull} from '../../../layer';\nimport AppChatTypeTab from './chatType';\nimport rootScope from '../../../lib/rootScope';\nimport AppGroupPermissionsTab from './groupPermissions';\nimport {i18n, LangPackKey} from '../../../lib/langPack';\nimport PopupDeleteDialog from '../../popups/deleteDialog';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport toggleDisability from '../../../helpers/dom/toggleDisability';\nimport CheckboxField from '../../checkboxField';\nimport AppChatReactionsTab from './chatReactions';\nimport hasRights from '../../../lib/appManagers/utils/chats/hasRights';\nimport replaceContent from '../../../helpers/dom/replaceContent';\nimport SettingSection from '../../settingSection';\nimport getPeerActiveUsernames from '../../../lib/appManagers/utils/peers/getPeerActiveUsernames';\n\nexport default class AppEditChatTab extends SliderSuperTab {\n private chatNameInputField: InputField;\n private descriptionInputField: InputField;\n private editPeer: EditPeer;\n public chatId: ChatId;\n\n protected async _init() {\n // * cleanup prev\n this.listenerSetter.removeAll();\n this.scrollable.container.replaceChildren();\n\n this.container.classList.add('edit-peer-container', 'edit-group-container');\n this.setTitle('Edit');\n\n let [\n chatFull,\n chat,\n isBroadcast,\n isChannel,\n canChangeType,\n canChangePermissions,\n canManageTopics,\n appConfig\n ] = await Promise.all([\n this.managers.appProfileManager.getChatFull(this.chatId, true),\n this.managers.appChatsManager.getChat(this.chatId) as Promise,\n this.managers.appChatsManager.isBroadcast(this.chatId),\n this.managers.appChatsManager.isChannel(this.chatId),\n this.managers.appChatsManager.hasRights(this.chatId, 'change_type'),\n this.managers.appChatsManager.hasRights(this.chatId, 'change_permissions'),\n this.managers.appChatsManager.hasRights(this.chatId, 'manage_topics'),\n this.managers.apiManager.getAppConfig()\n ]);\n\n const chatUpdateListeners: {[type in 'full' | 'basic']: (() => void)[]} = {full: [], basic: []};\n const addChatUpdateListener = (callback: () => void, type: 'full' | 'basic' = 'basic') => {\n chatUpdateListeners[type].push(callback);\n };\n\n this.listenerSetter.add(rootScope)('chat_update', async(chatId) => {\n if(this.chatId === chatId) {\n chat = await this.managers.appChatsManager.getChat(this.chatId) as typeof chat;\n chatUpdateListeners['basic'].forEach((callback) => callback());\n }\n });\n\n this.listenerSetter.add(rootScope)('chat_full_update', async(chatId) => {\n if(this.chatId === chatId) {\n chatFull = await this.managers.appProfileManager.getCachedFullChat(chatId) || chatFull;\n chatUpdateListeners['full'].forEach((callback) => callback());\n }\n });\n\n const peerId = this.chatId.toPeerId(true);\n\n {\n const section = new SettingSection({noDelimiter: true, caption: true});\n const inputFields: InputField[] = [];\n\n const inputWrapper = document.createElement('div');\n inputWrapper.classList.add('input-wrapper');\n\n this.chatNameInputField = new InputField({\n label: isBroadcast ? 'EnterChannelName' : 'CreateGroup.NameHolder',\n name: 'chat-name',\n maxLength: 255,\n required: true\n });\n this.descriptionInputField = new InputField({\n label: 'DescriptionPlaceholder',\n name: 'chat-description',\n maxLength: 255\n });\n\n this.chatNameInputField.setOriginalValue(chat.title);\n this.descriptionInputField.setOriginalValue(chatFull.about);\n\n inputWrapper.append(this.chatNameInputField.container, this.descriptionInputField.container);\n\n inputFields.push(this.chatNameInputField, this.descriptionInputField);\n\n this.editPeer = new EditPeer({\n peerId,\n inputFields,\n listenerSetter: this.listenerSetter,\n popupOptions: {isForum: (chat as Chat.channel).pFlags.forum}\n });\n this.content.append(this.editPeer.nextBtn);\n\n section.content.append(this.editPeer.avatarEdit.container, inputWrapper);\n\n if(canChangeType) {\n const chatTypeRow = new Row({\n titleLangKey: isBroadcast ? 'ChannelType' : 'GroupType',\n clickable: () => {\n const tab = this.slider.createTab(AppChatTypeTab);\n tab.chatId = this.chatId;\n tab.chatFull = chatFull;\n tab.open();\n },\n icon: 'lock',\n listenerSetter: this.listenerSetter\n });\n\n const setChatTypeSubtitle = () => {\n let key: LangPackKey;\n const username = getPeerActiveUsernames(chat as Chat.channel)[0];\n if(isBroadcast) {\n key = username ? 'TypePublic' : 'TypePrivate';\n } else {\n key = username ? 'TypePublicGroup' : 'TypePrivateGroup';\n }\n\n chatTypeRow.subtitle.replaceChildren(i18n(key));\n };\n\n setChatTypeSubtitle();\n addChatUpdateListener(setChatTypeSubtitle);\n section.content.append(chatTypeRow.container);\n }\n\n if(canChangeType || canChangePermissions) {\n const reactionsRow = new Row({\n titleLangKey: 'Reactions',\n icon: 'reactions',\n clickable: () => {\n const tab = this.slider.createTab(AppChatReactionsTab);\n tab.chatId = this.chatId;\n tab.open();\n },\n listenerSetter: this.listenerSetter\n });\n\n const availableReactions = await this.managers.appReactionsManager.getAvailableReactions();\n const availableReactionsLength = availableReactions.filter((availableReaction) => !availableReaction.pFlags.inactive).length;\n const setReactionsLength = () => {\n const chatAvailableReactions = chatFull.available_reactions ?? {_: 'chatReactionsNone'};\n if(chatAvailableReactions._ === 'chatReactionsSome') {\n const length = chatAvailableReactions.reactions.length;\n if(length === availableReactionsLength) {\n replaceContent(reactionsRow.subtitle, i18n('ReactionsAll'));\n } else {\n reactionsRow.subtitle.textContent = length + '/' + availableReactionsLength;\n }\n } else {\n replaceContent(reactionsRow.subtitle, i18n(chatAvailableReactions._ === 'chatReactionsAll' ? 'ReactionsAll' : 'Checkbox.Disabled'));\n }\n };\n\n setReactionsLength();\n addChatUpdateListener(setReactionsLength, 'full');\n section.content.append(reactionsRow.container);\n }\n\n if(canChangePermissions && !isBroadcast) {\n const flags = [\n 'send_stickers',\n 'send_polls',\n 'send_photos',\n 'send_videos',\n 'send_roundvideos',\n 'send_audios',\n 'send_voices',\n 'send_docs',\n 'send_plain',\n 'embed_links',\n 'invite_users',\n 'pin_messages',\n 'change_info'\n ] as ChatRights[];\n\n const permissionsRow = new Row({\n titleLangKey: 'ChannelPermissions',\n clickable: () => {\n const tab = this.slider.createTab(AppGroupPermissionsTab);\n tab.chatId = this.chatId;\n tab.open();\n },\n icon: 'permissions',\n listenerSetter: this.listenerSetter\n });\n\n const setPermissionsLength = () => {\n permissionsRow.subtitle.textContent = flags.reduce((acc, f) => acc + +hasRights(chat, f, (chat as Chat.chat).default_banned_rights), 0) + '/' + flags.length;\n };\n\n setPermissionsLength();\n addChatUpdateListener(setPermissionsLength);\n section.content.append(permissionsRow.container);\n }\n\n if(canManageTopics && (chat.participants_count >= appConfig.forum_upgrade_participants_min || (chat as Chat.channel).pFlags.forum) && !isBroadcast) {\n const topicsRow = new Row({\n checkboxField: new CheckboxField({toggle: true}),\n titleLangKey: 'Topics',\n clickable: () => {},\n icon: 'topics',\n listenerSetter: this.listenerSetter\n });\n\n const setTopics = () => {\n const isForum = !!(chat as Chat.channel).pFlags.forum;\n this.editPeer.avatarElem.parentElement.classList.toggle('is-forum', isForum);\n topicsRow.checkboxField.setValueSilently(isForum);\n };\n\n this.listenerSetter.add(topicsRow.checkboxField.input)('change', (e) => {\n if(!e.isTrusted) {\n return;\n }\n\n const promise = this.managers.appChatsManager.toggleForum(this.chatId, topicsRow.checkboxField.checked);\n topicsRow.disableWithPromise(promise);\n });\n\n setTopics();\n addChatUpdateListener(setTopics);\n\n section.caption.replaceChildren(i18n('ForumToggleDescription'));\n section.content.append(topicsRow.container);\n }\n\n section.caption.classList.toggle('hide', !section.caption.childElementCount);\n\n /* const administratorsRow = new Row({\n titleLangKey: 'PeerInfo.Administrators',\n subtitle: '' + ((chatFull as ChatFull.channelFull).admins_count || 1),\n icon: 'admin',\n clickable: true\n });\n\n section.content.append(administratorsRow.container); */\n\n this.scrollable.append(section.container);\n\n attachClickEvent(this.editPeer.nextBtn, () => {\n this.editPeer.nextBtn.disabled = true;\n\n const promises: Promise[] = [];\n\n const id = this.chatId;\n if(this.chatNameInputField.isValidToChange()) {\n promises.push(this.managers.appChatsManager.editTitle(id, this.chatNameInputField.value));\n }\n\n if(this.descriptionInputField.isValidToChange()) {\n promises.push(this.managers.appChatsManager.editAbout(id, this.descriptionInputField.value));\n }\n\n if(this.editPeer.uploadAvatar) {\n promises.push(this.editPeer.uploadAvatar().then((inputFile) => {\n return this.managers.appChatsManager.editPhoto(id, inputFile);\n }));\n }\n\n Promise.race(promises).finally(() => {\n this.editPeer.nextBtn.removeAttribute('disabled');\n this.close();\n });\n }, {listenerSetter: this.listenerSetter});\n\n\n /* if(appChatsManager.hasRights(-this.peerId, 'change_info')) {\n const discussionRow = new Row({\n titleLangKey: 'PeerInfo.Discussion',\n subtitleLangKey: 'PeerInfo.Discussion.Add',\n clickable: true,\n icon: 'message'\n });\n\n section.content.append(discussionRow.container);\n }\n\n const administratorsRow = new Row({\n titleLangKey: 'PeerInfo.Administrators',\n subtitle: '' + chatFull.admins_count,\n icon: 'admin',\n clickable: true\n });\n\n section.content.append(administratorsRow.container); */\n\n if(isBroadcast && await this.managers.appChatsManager.hasRights(this.chatId, 'change_info')) {\n const signMessagesCheckboxField = new CheckboxField({\n text: 'ChannelSignMessages',\n checked: !!(chat as Chat.channel).pFlags.signatures\n });\n\n this.listenerSetter.add(signMessagesCheckboxField.input)('change', () => {\n const toggle = signMessagesCheckboxField.toggleDisability(true);\n this.managers.appChatsManager.toggleSignatures(this.chatId, signMessagesCheckboxField.checked).then(() => {\n toggle();\n });\n });\n\n addChatUpdateListener(() => {\n signMessagesCheckboxField.setValueSilently(!!(chat as Chat.channel).pFlags.signatures);\n });\n\n section.content.append(CreateRowFromCheckboxField(signMessagesCheckboxField).container);\n }\n }\n\n if(!isBroadcast) {\n const section = new SettingSection({\n\n });\n\n /* const membersRow = new Row({\n titleLangKey: isBroadcast ? 'PeerInfo.Subscribers' : 'GroupMembers',\n icon: 'newgroup',\n clickable: true\n });\n\n membersRow.subtitle.append(i18n('Subscribers', [numberThousandSplitter(335356)]));\n\n section.content.append(membersRow.container); */\n\n if(!isBroadcast && canChangeType) {\n const showChatHistoryCheckboxField = new CheckboxField({\n text: 'ChatHistory'\n });\n\n this.listenerSetter.add(showChatHistoryCheckboxField.input)('change', () => {\n const toggle = showChatHistoryCheckboxField.toggleDisability(true);\n this.managers.appChatsManager.togglePreHistoryHidden(this.chatId, !showChatHistoryCheckboxField.checked).then(() => {\n toggle();\n });\n });\n\n // ! it won't be updated because chatFull will be old\n const onChatUpdate = () => {\n showChatHistoryCheckboxField.setValueSilently(isChannel && !(chatFull as ChatFull.channelFull).pFlags.hidden_prehistory);\n };\n\n onChatUpdate();\n addChatUpdateListener(onChatUpdate);\n\n section.content.append(CreateRowFromCheckboxField(showChatHistoryCheckboxField).container);\n }\n\n if(section.content.childElementCount) {\n this.scrollable.append(section.container);\n }\n }\n\n if(await this.managers.appChatsManager.hasRights(this.chatId, 'delete_chat')) {\n const section = new SettingSection({});\n\n const btnDelete = Button('btn-primary btn-transparent danger', {icon: 'delete', text: isBroadcast ? 'PeerInfo.DeleteChannel' : 'DeleteAndExitButton'});\n\n attachClickEvent(btnDelete, () => {\n new PopupDeleteDialog(peerId/* , 'delete' */, undefined, (promise) => {\n const toggle = toggleDisability([btnDelete], true);\n promise.then(() => {\n this.close();\n }, () => {\n toggle();\n });\n });\n }, {listenerSetter: this.listenerSetter});\n\n section.content.append(btnDelete);\n\n this.scrollable.append(section.container);\n }\n\n if(!isChannel) {\n // ! this one will fire earlier than tab's closeAfterTimeout (destroy) event and listeners will be erased, so destroy won't fire\n this.listenerSetter.add(rootScope)('dialog_migrate', ({migrateFrom, migrateTo}) => {\n if(peerId === migrateFrom) {\n this.chatId = migrateTo.toChatId();\n this._init();\n }\n });\n }\n }\n\n public init() {\n return this._init();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../../../lib/rootScope';\nimport AppSearchSuper, {SearchSuperType} from '../../appSearchSuper.';\nimport SidebarSlider, {SliderSuperTab} from '../../slider';\nimport TransitionSlider from '../../transition';\nimport AppEditChatTab from './editChat';\nimport PeerTitle from '../../peerTitle';\nimport AppEditContactTab from './editContact';\nimport Button from '../../button';\nimport ButtonIcon from '../../buttonIcon';\nimport I18n, {i18n, LangPackKey} from '../../../lib/langPack';\nimport {toastNew} from '../../toast';\nimport AppAddMembersTab from '../../sidebarLeft/tabs/addMembers';\nimport PopupPickUser from '../../popups/pickUser';\nimport PopupPeer, {PopupPeerButtonCallbackCheckboxes, PopupPeerCheckboxOptions} from '../../popups/peer';\nimport ButtonCorner from '../../buttonCorner';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport PeerProfile from '../../peerProfile';\nimport {Message} from '../../../layer';\nimport getMessageThreadId from '../../../lib/appManagers/utils/messages/getMessageThreadId';\nimport AppEditTopicTab from './editTopic';\nimport liteMode from '../../../helpers/liteMode';\n\ntype SharedMediaHistoryStorage = Partial<{\n [type in SearchSuperType]: {mid: number, peerId: PeerId}[]\n}>;\n\nconst historiesStorage: {\n [peerId: PeerId]: {\n [threadId: number]: SharedMediaHistoryStorage\n }\n} = {};\n\n// TODO: отредактированное сообщение не изменится\nexport default class AppSharedMediaTab extends SliderSuperTab {\n private editBtn: HTMLElement;\n\n private peerId: PeerId;\n private threadId: number;\n\n private searchSuper: AppSearchSuper;\n\n private profile: PeerProfile;\n private peerChanged: boolean;\n\n private titleI18n: I18n.IntlElement;\n\n public isFirst: boolean;\n\n public init() {\n // const perf = performance.now();\n\n this.container.classList.add('shared-media-container', 'profile-container');\n\n // * header\n const newCloseBtn = Button('btn-icon sidebar-close-button', {noRipple: true});\n this.closeBtn.replaceWith(newCloseBtn);\n this.closeBtn = newCloseBtn;\n\n const animatedCloseIcon = document.createElement('div');\n animatedCloseIcon.classList.add('animated-close-icon');\n newCloseBtn.append(animatedCloseIcon);\n\n if(this.isFirst) {\n animatedCloseIcon.classList.add('state-back');\n }\n\n const transitionContainer = document.createElement('div');\n transitionContainer.className = 'transition slide-fade';\n\n const transitionFirstItem = document.createElement('div');\n transitionFirstItem.classList.add('transition-item');\n\n this.titleI18n = new I18n.IntlElement();\n this.title.append(this.titleI18n.element);\n this.editBtn = ButtonIcon('edit');\n // const moreBtn = ButtonIcon('more');\n\n transitionFirstItem.append(this.title, this.editBtn/* , moreBtn */);\n\n const transitionLastItem = document.createElement('div');\n transitionLastItem.classList.add('transition-item');\n\n const secondTitle: HTMLElement = this.title.cloneNode() as any;\n secondTitle.append(i18n('PeerInfo.SharedMedia'));\n\n transitionLastItem.append(secondTitle);\n\n transitionContainer.append(transitionFirstItem, transitionLastItem);\n\n this.header.append(transitionContainer);\n\n // * body\n\n this.profile = new PeerProfile(this.managers, this.scrollable, this.listenerSetter);\n this.profile.init();\n\n this.scrollable.append(this.profile.element);\n\n const HEADER_HEIGHT = 56;\n this.scrollable.onAdditionalScroll = () => {\n const rect = this.searchSuper.nav.getBoundingClientRect();\n if(!rect.width) return;\n\n const top = rect.top - 1;\n setIsSharedMedia(top <= HEADER_HEIGHT);\n };\n\n const setIsSharedMedia = (isSharedMedia: boolean) => {\n animatedCloseIcon.classList.toggle('state-back', this.isFirst || isSharedMedia);\n this.searchSuper.container.classList.toggle('is-full-viewport', isSharedMedia);\n transition(+isSharedMedia);\n\n if(!isSharedMedia) {\n this.searchSuper.cleanScrollPositions();\n }\n };\n\n const transition = TransitionSlider({\n content: transitionContainer,\n type: 'slide-fade',\n transitionTime: 400,\n isHeavy: false\n });\n\n transition(0);\n\n attachClickEvent(this.closeBtn, (e) => {\n if(transition.prevId()) {\n this.scrollable.scrollIntoViewNew({\n element: this.scrollable.container.firstElementChild as HTMLElement,\n position: 'start'\n });\n transition(0);\n\n if(!this.isFirst) {\n animatedCloseIcon.classList.remove('state-back');\n }\n } else if(!this.scrollable.isHeavyAnimationInProgress) {\n this.slider.onCloseBtnClick();\n }\n }, {listenerSetter: this.listenerSetter});\n\n attachClickEvent(this.editBtn, async() => {\n let tab: AppEditChatTab | AppEditContactTab | AppEditTopicTab;\n const {peerId, threadId} = this;\n if(threadId && await this.managers.appPeersManager.isForum(peerId)) {\n tab = this.slider.createTab(AppEditTopicTab)\n } else if(peerId.isAnyChat()) {\n tab = this.slider.createTab(AppEditChatTab);\n } else {\n tab = this.slider.createTab(AppEditContactTab);\n }\n\n if(tab) {\n if(tab instanceof AppEditTopicTab) {\n tab.open(peerId, this.threadId);\n } else {\n if(tab instanceof AppEditChatTab) {\n tab.chatId = peerId.toChatId();\n } else {\n tab.peerId = peerId;\n }\n\n tab.open();\n }\n }\n }, {listenerSetter: this.listenerSetter});\n\n this.listenerSetter.add(rootScope)('contacts_update', (userId) => {\n if(this.peerId === userId) {\n this.toggleEditBtn();\n }\n });\n\n this.listenerSetter.add(rootScope)('chat_update', (chatId) => {\n if(this.peerId === chatId.toPeerId(true)) {\n this.toggleEditBtn();\n }\n });\n\n this.listenerSetter.add(rootScope)('history_multiappend', (message) => {\n this.renderNewMessage(message);\n });\n\n this.listenerSetter.add(rootScope)('history_delete', ({peerId, msgs}) => {\n this.deleteDeletedMessages(peerId, Array.from(msgs));\n });\n\n // Calls when message successfully sent and we have an id\n this.listenerSetter.add(rootScope)('message_sent', ({message}) => {\n this.renderNewMessage(message);\n });\n\n // this.container.prepend(this.closeBtn.parentElement);\n\n this.searchSuper = new AppSearchSuper({\n mediaTabs: [{\n inputFilter: 'inputMessagesFilterEmpty',\n name: 'PeerMedia.Members',\n type: 'members'\n }, {\n inputFilter: 'inputMessagesFilterPhotoVideo',\n name: 'SharedMediaTab2',\n type: 'media'\n }, {\n inputFilter: 'inputMessagesFilterDocument',\n name: 'SharedFilesTab2',\n type: 'files'\n }, {\n inputFilter: 'inputMessagesFilterUrl',\n name: 'SharedLinksTab2',\n type: 'links'\n }, {\n inputFilter: 'inputMessagesFilterMusic',\n name: 'SharedMusicTab2',\n type: 'music'\n }, {\n inputFilter: 'inputMessagesFilterRoundVoice',\n name: 'SharedVoiceTab2',\n type: 'voice'\n }, {\n inputFilter: 'inputMessagesFilterEmpty',\n name: 'ChatList.Filter.Groups',\n type: 'groups'\n }],\n scrollable: this.scrollable,\n onChangeTab: (mediaTab) => {\n const timeout = mediaTab.type === 'members' && liteMode.isAvailable('animations') ? 250 : 0;\n setTimeout(() => {\n btnAddMembers.classList.toggle('is-hidden', mediaTab.type !== 'members');\n }, timeout);\n },\n managers: this.managers\n });\n\n this.searchSuper.scrollStartCallback = () => {\n setIsSharedMedia(true);\n };\n\n this.profile.element.append(this.searchSuper.container);\n\n const btnAddMembers = ButtonCorner({icon: 'addmember_filled'});\n this.content.append(btnAddMembers);\n\n attachClickEvent(btnAddMembers, async() => {\n const peerId = this.peerId;\n const id = this.peerId.toChatId();\n const isChannel = await this.managers.appChatsManager.isChannel(id);\n\n const showConfirmation = (peerIds: PeerId[], callback: (checked: PopupPeerButtonCallbackCheckboxes) => void) => {\n let titleLangKey: LangPackKey, titleLangArgs: any[],\n descriptionLangKey: LangPackKey, descriptionLangArgs: any[],\n checkboxes: PopupPeerCheckboxOptions[];\n\n if(peerIds.length > 1) {\n titleLangKey = 'AddMembersAlertTitle';\n titleLangArgs = [i18n('Members', [peerIds.length])];\n descriptionLangKey = 'AddMembersAlertCountText';\n descriptionLangArgs = peerIds.map((peerId) => {\n const b = document.createElement('b');\n b.append(new PeerTitle({peerId}).element);\n return b;\n });\n\n if(!isChannel) {\n checkboxes = [{\n text: 'AddMembersForwardMessages',\n checked: true\n }];\n }\n } else {\n titleLangKey = 'AddOneMemberAlertTitle';\n descriptionLangKey = 'AddMembersAlertNamesText';\n const b = document.createElement('b');\n b.append(new PeerTitle({\n peerId: peerIds[0]\n }).element);\n descriptionLangArgs = [b];\n\n if(!isChannel) {\n checkboxes = [{\n text: 'AddOneMemberForwardMessages',\n textArgs: [new PeerTitle({peerId: peerIds[0]}).element],\n checked: true\n }];\n }\n }\n\n descriptionLangArgs.push(new PeerTitle({\n peerId\n }).element);\n\n new PopupPeer('popup-add-members', {\n peerId,\n titleLangKey,\n descriptionLangKey,\n descriptionLangArgs,\n buttons: [{\n langKey: 'Add',\n callback\n }],\n checkboxes\n }).show();\n };\n\n const onError = (err: any) => {\n if(err.type === 'USER_PRIVACY_RESTRICTED') {\n toastNew({langPackKey: 'InviteToGroupError'});\n }\n };\n\n if(isChannel) {\n const tab = this.slider.createTab(AppAddMembersTab);\n tab.open({\n type: 'channel',\n skippable: false,\n takeOut: (peerIds) => {\n showConfirmation(peerIds, () => {\n const promise = this.managers.appChatsManager.inviteToChannel(id, peerIds);\n promise.catch(onError);\n tab.attachToPromise(promise);\n });\n\n return false;\n },\n title: 'GroupAddMembers',\n placeholder: 'SendMessageTo'\n });\n } else {\n new PopupPickUser({\n peerTypes: ['contacts'],\n placeholder: 'Search',\n onSelect: (peerId) => {\n setTimeout(() => {\n showConfirmation([peerId], (checked) => {\n this.managers.appChatsManager.addChatUser(id, peerId, checked.size ? undefined : 0)\n .catch(onError);\n });\n }, 0);\n }\n });\n }\n }, {listenerSetter: this.listenerSetter});\n\n // console.log('construct shared media time:', performance.now() - perf);\n }\n\n private _renderNewMessage(message: Message.message | Message.messageService, threadId?: number) {\n const historyStorage = historiesStorage[message.peerId]?.[threadId];\n if(!historyStorage) return;\n\n for(const mediaTab of this.searchSuper.mediaTabs) {\n const inputFilter = mediaTab.inputFilter;\n const history = historyStorage[inputFilter];\n if(!history) {\n continue;\n }\n\n const filtered = this.searchSuper.filterMessagesByType([message], inputFilter)\n .filter((message) => !history.find((m) => m.mid === message.mid && m.peerId === message.peerId));\n if(filtered.length) {\n history.unshift(...filtered.map((message) => ({mid: message.mid, peerId: message.peerId})));\n\n if(this.peerId === message.peerId && this.searchSuper.usedFromHistory[inputFilter] !== -1) {\n this.searchSuper.usedFromHistory[inputFilter] += filtered.length;\n this.searchSuper.performSearchResult(filtered, mediaTab, false);\n }\n }\n }\n }\n\n private async renderNewMessage(message: Message.message | Message.messageService) {\n if(this.init) return; // * not inited yet\n\n const {peerId} = message;\n const isForum = await this.managers.appPeersManager.isForum(peerId);\n const threadId = getMessageThreadId(message, isForum);\n\n this._renderNewMessage(message);\n if(threadId) {\n this._renderNewMessage(message, threadId);\n }\n }\n\n public _deleteDeletedMessages(historyStorage: SharedMediaHistoryStorage, peerId: PeerId, mids: number[]) {\n for(const mid of mids) {\n for(const type of this.searchSuper.mediaTabs) {\n const inputFilter = type.inputFilter;\n\n const history = historyStorage[inputFilter];\n if(!history) continue;\n\n const idx = history.findIndex((m) => m.mid === mid);\n if(idx === -1) {\n continue;\n }\n\n history.splice(idx, 1);\n\n if(this.peerId === peerId) {\n const container = this.searchSuper.tabs[inputFilter];\n const div = container.querySelector(`[data-mid=\"${mid}\"][data-peer-id=\"${peerId}\"]`) as HTMLElement;\n if(div) {\n if(this.searchSuper.selection.isSelecting) {\n this.searchSuper.selection.toggleByElement(div);\n }\n\n div.remove();\n }\n\n if(this.searchSuper.usedFromHistory[inputFilter] >= (idx + 1)) {\n --this.searchSuper.usedFromHistory[inputFilter];\n }\n }\n\n // can have element in different tabs somehow\n // break;\n }\n }\n }\n\n public deleteDeletedMessages(peerId: PeerId, mids: number[]) {\n if(this.init) return; // * not inited yet\n\n const h = historiesStorage[peerId];\n if(!h) return;\n\n for(const threadId in h) {\n this._deleteDeletedMessages(h[threadId], peerId, mids);\n }\n\n this.scrollable.onScroll();\n }\n\n private async cleanupHTML() {\n // const perf = performance.now();\n const isAnyChat = this.peerId.isAnyChat();\n const [canViewMembers, hasRights] = await Promise.all([\n isAnyChat ? this.searchSuper.canViewMembers() : false,\n isAnyChat ? this.managers.appChatsManager.hasRights(this.peerId.toChatId(), 'invite_users') : false\n ]);\n\n return () => {\n this.profile.cleanupHTML();\n this.editBtn.classList.add('hide');\n this.searchSuper.cleanupHTML(true);\n this.container.classList.toggle('can-add-members', canViewMembers && hasRights);\n };\n // console.log('cleanupHTML shared media time:', performance.now() - perf);\n }\n\n public setLoadMutex(promise: Promise) {\n this.searchSuper.loadMutex = promise;\n }\n\n public setPeer(peerId: PeerId, threadId?: number) {\n if(this.peerId === peerId && this.threadId === threadId) return false;\n\n this.peerId = peerId;\n this.threadId = threadId;\n this.peerChanged = true;\n\n if(this.init) {\n this.init();\n this.init = null;\n }\n\n this.searchSuper.setQuery({\n peerId,\n threadId,\n historyStorage: (historiesStorage[peerId] ??= {})[threadId] ??= {}\n });\n\n this.profile.setPeer(peerId, threadId);\n\n return true;\n }\n\n private async changeTitleKey() {\n const isForum = this.managers.appPeersManager.isForum(this.peerId);\n\n return () => {\n this.titleI18n.compareAndUpdate({key: this.threadId && isForum ? 'AccDescrTopic' : 'Profile'});\n };\n }\n\n public async fillProfileElements() {\n if(!this.peerChanged) {\n return;\n }\n\n this.peerChanged = false;\n const callbacks = await Promise.all([\n this.cleanupHTML(),\n this.toggleEditBtn(true),\n this.profile.fillProfileElements(),\n this.changeTitleKey()\n ]);\n\n return () => {\n callbacks.forEach((callback) => {\n callback?.();\n });\n };\n }\n\n private async toggleEditBtn(manual?: T): Promise void : void> {\n let show: boolean;\n if(this.peerId.isUser()) {\n show = this.peerId !== rootScope.myId && await this.managers.appUsersManager.isContact(this.peerId.toUserId());\n } else {\n const chatId = this.peerId.toChatId();\n const isTopic = this.threadId && await this.managers.appChatsManager.isForum(chatId);\n show = await this.managers.appChatsManager.hasRights(chatId, isTopic ? 'manage_topics' : 'change_info');\n }\n\n const callback = () => {\n this.editBtn.classList.toggle('hide', !show);\n };\n\n return manual ? callback : callback() as any;\n }\n\n public loadSidebarMedia(single: boolean, justLoad?: boolean) {\n this.searchSuper.load(single, justLoad);\n }\n\n onOpenAfterTimeout() {\n super.onOpenAfterTimeout();\n\n this.scrollable.onScroll();\n }\n\n onCloseAfterTimeout() {\n super.onCloseAfterTimeout();\n\n if(this.destroyable) {\n this.profile.destroy();\n this.searchSuper.destroy();\n }\n }\n\n public destroy() {\n this.destroyable = true;\n this.onCloseAfterTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport liteMode from '../helpers/liteMode';\nimport rootScope from '../lib/rootScope';\n\ntype SetTransitionOptions = {\n element: HTMLElement,\n className: string,\n forwards: boolean,\n duration: number,\n onTransitionEnd?: () => void,\n useRafs?: number,\n onTransitionStart?: () => void\n};\nconst SetTransition = (options: SetTransitionOptions) => {\n const {element, className, forwards, duration, onTransitionEnd, onTransitionStart, useRafs} = options;\n const {timeout, raf} = element.dataset;\n if(timeout !== undefined) {\n clearTimeout(+timeout);\n }\n\n // useRafs = undefined;\n // duration = 0;\n\n if(raf !== undefined) {\n window.cancelAnimationFrame(+raf);\n if(!useRafs) {\n delete element.dataset.raf;\n }\n }\n\n // if(forwards && className && element.classList.contains(className) && !element.classList.contains('animating')) {\n // return;\n // }\n\n if(useRafs && liteMode.isAvailable('animations') && duration) {\n element.dataset.raf = '' + window.requestAnimationFrame(() => {\n delete element.dataset.raf;\n SetTransition({\n ...options,\n useRafs: useRafs - 1\n });\n });\n\n return;\n }\n\n if(forwards && className) {\n element.classList.add(className);\n }\n\n const afterTimeout = () => {\n delete element.dataset.timeout;\n if(!forwards && className) {\n element.classList.remove('backwards', className);\n }\n\n element.classList.remove('animating');\n\n onTransitionEnd?.();\n };\n\n onTransitionStart?.();\n if(!liteMode.isAvailable('animations') || !duration) {\n element.classList.remove('animating', 'backwards');\n afterTimeout();\n return;\n }\n\n element.classList.add('animating');\n\n element.classList.toggle('backwards', !forwards);\n element.dataset.timeout = '' + setTimeout(afterTimeout, duration);\n};\n\nexport default SetTransition;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {horizontalMenu} from './horizontalMenu';\nimport TransitionSlider from './transition';\nimport appNavigationController, {NavigationItem} from './appNavigationController';\nimport SliderSuperTab, {SliderSuperTabConstructable} from './sliderTab';\nimport indexOfAndSplice from '../helpers/array/indexOfAndSplice';\nimport safeAssign from '../helpers/object/safeAssign';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport {getMiddleware, MiddlewareHelper} from '../helpers/middleware';\nimport {MaybePromise} from '../types';\n\nconst TRANSITION_TIME = 250;\n\nexport {SliderSuperTab};\n\nexport default class SidebarSlider {\n protected _selectTab: ReturnType;\n protected historyTabIds: (number | SliderSuperTab)[] = []; // * key is any, since right sidebar is ugly nowz\n protected tabsContainer: HTMLElement;\n public sidebarEl: HTMLElement;\n protected tabs: Map; // * key is any, since right sidebar is ugly now\n private canHideFirst = false;\n private navigationType: NavigationItem['type'];\n protected managers: AppManagers;\n protected middlewareHelper: MiddlewareHelper;\n public onOpenTab: () => MaybePromise;\n\n constructor(options: {\n sidebarEl: SidebarSlider['sidebarEl'],\n tabs?: SidebarSlider['tabs'],\n canHideFirst?: SidebarSlider['canHideFirst'],\n navigationType: SidebarSlider['navigationType']\n }) {\n safeAssign(this, options);\n\n this.tabs ??= new Map();\n\n this.tabsContainer = this.sidebarEl.querySelector('.sidebar-slider');\n this._selectTab = TransitionSlider({\n content: this.tabsContainer,\n type: 'navigation',\n transitionTime: TRANSITION_TIME\n });\n if(!this.canHideFirst) {\n this._selectTab(0);\n }\n\n this.middlewareHelper = getMiddleware();\n\n // Array.from(this.sidebarEl.querySelectorAll('.sidebar-close-button') as any as HTMLElement[]).forEach((el) => {\n // attachClickEvent(el, this.onCloseBtnClick);\n // });\n }\n\n public getMiddleware() {\n return this.middlewareHelper.get();\n }\n\n public onCloseBtnClick = () => {\n const item = appNavigationController.findItemByType(this.navigationType);\n if(item) {\n appNavigationController.back(this.navigationType);\n } else if(this.historyTabIds.length) {\n this.closeTab(this.historyTabIds[this.historyTabIds.length - 1]);\n }\n // this.closeTab();\n };\n\n public closeTab = (id?: number | SliderSuperTab, animate?: boolean, isNavigation?: boolean) => {\n if(id !== undefined && this.historyTabIds[this.historyTabIds.length - 1] !== id) {\n this.removeTabFromHistory(id);\n return false;\n }\n\n // console.log('sidebar-close-button click:', this.historyTabIDs);\n const closingId = this.historyTabIds.pop(); // pop current\n this.onCloseTab(closingId, animate, isNavigation);\n\n const tab = this.historyTabIds[this.historyTabIds.length - 1];\n this._selectTab(tab !== undefined ? (tab instanceof SliderSuperTab ? tab.container : tab) : (this.canHideFirst ? -1 : 0), animate);\n return true;\n };\n\n public async selectTab(id: number | SliderSuperTab) {\n /* if(id instanceof SliderSuperTab) {\n id = id.id;\n } */\n\n if(this.historyTabIds[this.historyTabIds.length - 1] === id) {\n return false;\n }\n\n const tab: SliderSuperTab = id instanceof SliderSuperTab ? id : this.tabs.get(id);\n this.onOpenTab && await this.onOpenTab();\n\n if(tab) {\n // @ts-ignore\n tab.onOpen?.();\n\n // @ts-ignore\n if(tab.onOpenAfterTimeout) {\n setTimeout(() => {\n // @ts-ignore\n tab.onOpenAfterTimeout();\n }, TRANSITION_TIME);\n }\n }\n\n // if(!this.canHideFirst || this.historyTabIds.length) {\n appNavigationController.pushItem({\n type: this.navigationType,\n onPop: (canAnimate) => {\n this.closeTab(undefined, canAnimate, true);\n return true;\n }\n });\n // }\n\n this.historyTabIds.push(id);\n this._selectTab(id instanceof SliderSuperTab ? id.container : id);\n return true;\n }\n\n public removeTabFromHistory(id: number | SliderSuperTab) {\n indexOfAndSplice(this.historyTabIds, id);\n this.onCloseTab(id, undefined);\n }\n\n public sliceTabsUntilTab(tabConstructor: SliderSuperTabConstructable, preserveTab: SliderSuperTab) {\n for(let i = this.historyTabIds.length - 1; i >= 0; --i) {\n const tab = this.historyTabIds[i];\n if(tab === preserveTab) continue;\n else if(tab instanceof tabConstructor) {\n break;\n }\n\n this.removeTabFromHistory(tab);\n // appNavigationController.removeByType(this.navigationType, true);\n }\n }\n\n public getTab(tabConstructor: SliderSuperTabConstructable) {\n return this.historyTabIds.find((t) => t instanceof tabConstructor) as T;\n }\n\n public getHistory() {\n return this.historyTabIds;\n }\n\n public isTabExists(tabConstructor: SliderSuperTabConstructable) {\n return !!this.getTab(tabConstructor);\n }\n\n protected onCloseTab(id: number | SliderSuperTab, animate: boolean, isNavigation?: boolean) {\n if(!isNavigation) {\n appNavigationController.removeByType(this.navigationType, true);\n }\n\n const tab: SliderSuperTab = id instanceof SliderSuperTab ? id : this.tabs.get(id);\n if(tab) {\n try {\n // @ts-ignore\n tab.onClose?.();\n } catch(err) {\n console.error('tab onClose error', tab);\n }\n\n // @ts-ignore\n if(tab.onCloseAfterTimeout) {\n setTimeout(() => {\n // @ts-ignore\n tab.onCloseAfterTimeout();\n }, TRANSITION_TIME + 30);\n }\n }\n }\n\n public addTab(tab: SliderSuperTab) {\n if(!tab.container.parentElement) {\n this.tabsContainer.append(tab.container);\n\n if(tab.closeBtn) {\n tab.closeBtn.addEventListener('click', this.onCloseBtnClick);\n }\n }\n }\n\n public deleteTab(tab: SliderSuperTab) {\n this.tabs.delete(tab);\n }\n\n public createTab(\n ctor: SliderSuperTabConstructable,\n destroyable = true,\n doNotAppend?: boolean\n ) {\n const tab = new ctor(doNotAppend ? undefined : this, destroyable);\n tab.managers = this.managers;\n return tab;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport EventListenerBase from '../helpers/eventListenerBase';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport {getMiddleware, MiddlewareHelper} from '../helpers/middleware';\nimport noop from '../helpers/noop';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport {i18n, LangPackKey} from '../lib/langPack';\nimport ButtonIcon from './buttonIcon';\nimport Scrollable from './scrollable';\nimport SidebarSlider from './slider';\n\nexport interface SliderSuperTabConstructable {\n new(slider: SidebarSlider, destroyable: boolean): T;\n}\n\nexport interface SliderSuperTabEventableConstructable {\n new(slider: SidebarSlider, destroyable: boolean): SliderSuperTabEventable;\n}\n\nexport default class SliderSuperTab {\n public static getInitArgs?(fromTab: SliderSuperTab): any;\n\n public container: HTMLElement;\n\n public header: HTMLElement;\n public closeBtn: HTMLElement;\n public title: HTMLElement;\n\n public content: HTMLElement;\n public scrollable: Scrollable;\n\n public slider: SidebarSlider;\n public destroyable: boolean;\n public listenerSetter: ListenerSetter;\n\n public managers: AppManagers;\n public middlewareHelper: MiddlewareHelper;\n\n constructor(slider: SidebarSlider, destroyable?: boolean) {\n this._constructor(slider, destroyable);\n }\n\n public _constructor(slider: SidebarSlider, destroyable = true): any {\n this.slider = slider;\n this.middlewareHelper = slider ? slider.getMiddleware().create() : getMiddleware();\n this.destroyable = destroyable;\n\n this.container = document.createElement('div');\n this.container.classList.add('tabs-tab', 'sidebar-slider-item');\n\n // * Header\n this.header = document.createElement('div');\n this.header.classList.add('sidebar-header');\n\n this.closeBtn = ButtonIcon('left sidebar-close-button', {noRipple: true});\n this.title = document.createElement('div');\n this.title.classList.add('sidebar-header__title');\n this.header.append(this.closeBtn, this.title);\n\n // * Content\n this.content = document.createElement('div');\n this.content.classList.add('sidebar-content');\n\n this.scrollable = new Scrollable(this.content, undefined, undefined, true);\n this.scrollable.attachBorderListeners(this.container);\n\n this.container.append(this.header, this.content);\n\n this.slider?.addTab(this);\n\n this.listenerSetter = new ListenerSetter();\n }\n\n public close() {\n return this.slider.closeTab(this);\n }\n\n public async open(...args: Parameters) {\n if(this.init) {\n try {\n const result = this.init(...args);\n this.init = null;\n\n if(result instanceof Promise) {\n await result;\n }\n } catch(err) {\n console.error('open tab error', err);\n }\n }\n\n this.slider.selectTab(this);\n }\n\n public init(...args: any[]): Promise | any {\n\n }\n\n protected onOpen() {}\n protected onOpenAfterTimeout() {}\n protected onClose() {}\n\n protected onCloseAfterTimeout() {\n if(this.destroyable) { // ! WARNING, пока что это будет работать только с самой последней внутренней вкладкой !\n this.slider?.deleteTab(this);\n this.container.remove();\n this.scrollable.destroy();\n this.listenerSetter?.removeAll();\n this.middlewareHelper?.destroy();\n }\n }\n\n protected setTitle(key: LangPackKey) {\n this.title.replaceChildren(i18n(key));\n }\n}\n\nexport class SliderSuperTabEventable extends SliderSuperTab {\n public eventListener: EventListenerBase<{\n destroy: () => void | Promise,\n destroyAfter: (promise: Promise) => void,\n close: () => void\n }>;\n\n constructor(slider: SidebarSlider) {\n super(slider);\n this.eventListener = new EventListenerBase();\n }\n\n onClose() {\n this.eventListener.dispatchEvent('close');\n }\n\n onCloseAfterTimeout() {\n const results = this.eventListener.dispatchResultableEvent('destroy');\n this.eventListener.dispatchEvent('destroyAfter', Promise.all(results).then(noop, noop));\n this.eventListener.cleanup();\n return super.onCloseAfterTimeout();\n }\n}\n\n/* // @ts-ignore\ninterface SliderSuperEventsTab extends SliderSuperTab, EventListenerBase<{}> {\n superConstructor: (...args: any[]) => any;\n}\nclass SliderSuperEventsTab implements SliderSuperEventsTab {\n constructor(slider: SidebarSlider) {\n this.superConstructor([slider, true]);\n }\n}\napplyMixins(SliderSuperEventsTab, [SliderSuperTab, EventListenerBase]);\n\n(window as any).lol = SliderSuperEventsTab\n\nexport {SliderSuperEventsTab}; */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appDialogsManager, {AppDialogsManager, DialogDom, DialogElementSize} from '../lib/appManagers/appDialogsManager';\nimport {getHeavyAnimationPromise} from '../hooks/useHeavyAnimationCheck';\nimport isInDOM from '../helpers/dom/isInDOM';\nimport positionElementByIndex from '../helpers/dom/positionElementByIndex';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport {fastRaf} from '../helpers/schedulers';\nimport SortedList, {SortedElementBase} from '../helpers/sortedList';\nimport safeAssign from '../helpers/object/safeAssign';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport getUserStatusString from './wrappers/getUserStatusString';\nimport type LazyLoadQueue from './lazyLoadQueue';\nimport getChatMembersString from './wrappers/getChatMembersString';\n\ninterface SortedUser extends SortedElementBase {\n dom: DialogDom\n}\n\nexport default class SortedUserList extends SortedList {\n protected static SORT_INTERVAL = 30e3;\n public list: HTMLUListElement;\n\n protected lazyLoadQueue: LazyLoadQueue;\n protected avatarSize: DialogElementSize = 'abitbigger';\n protected rippleEnabled = true;\n protected autonomous = true;\n protected createChatListOptions: Parameters[0];\n protected onListLengthChange: () => void;\n protected getIndex: (element: SortedUser) => number;\n protected onUpdate: (element: SortedUser) => void;\n protected managers: AppManagers;\n\n constructor(options: Partial<{\n lazyLoadQueue: SortedUserList['lazyLoadQueue'],\n avatarSize: SortedUserList['avatarSize'],\n rippleEnabled: SortedUserList['rippleEnabled'],\n createChatListOptions: SortedUserList['createChatListOptions'],\n autonomous: SortedUserList['autonomous'],\n onListLengthChange: SortedUserList['onListLengthChange'],\n getIndex: SortedUserList['getIndex'],\n onUpdate: SortedUserList['onUpdate']\n }> & {\n managers: SortedUserList['managers']\n }) {\n super({\n getIndex: options.getIndex || ((element) => element.id.isAnyChat() ? 0 : this.managers.appUsersManager.getUserStatusForSort(element.id)),\n onDelete: (element) => {\n element.dom.listEl.remove();\n this.onListLengthChange && this.onListLengthChange();\n },\n onUpdate: options.onUpdate || (async(element) => {\n if(element.id.isAnyChat()) {\n const status = await getChatMembersString(element.id.toChatId(), this.managers);\n replaceContent(element.dom.lastMessageSpan, status);\n } else {\n const status = getUserStatusString(await this.managers.appUsersManager.getUser(element.id));\n replaceContent(element.dom.lastMessageSpan, status);\n }\n }),\n onSort: (element, idx) => {\n const willChangeLength = element.dom.listEl.parentElement !== this.list;\n positionElementByIndex(element.dom.listEl, this.list, idx);\n\n if(willChangeLength && this.onListLengthChange) {\n this.onListLengthChange();\n }\n },\n onElementCreate: (base) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: base.id,\n container: false,\n avatarSize: this.avatarSize,\n autonomous: this.autonomous,\n meAsSaved: false,\n rippleEnabled: this.rippleEnabled,\n wrapOptions: {\n lazyLoadQueue: this.lazyLoadQueue\n }\n });\n\n (base as SortedUser).dom = dom;\n return base as SortedUser;\n },\n updateElementWith: fastRaf,\n updateListWith: async(callback) => {\n if(!Array.from(this.elements.values()).some((element) => element.id.isUser())) {\n return callback(false);\n }\n\n if(!isInDOM(this.list)) {\n return callback(false);\n }\n\n await getHeavyAnimationPromise();\n\n if(!isInDOM(this.list)) {\n return callback(false);\n }\n\n callback(true);\n }\n });\n\n safeAssign(this, options);\n\n this.list = appDialogsManager.createChatList(this.createChatListOptions);\n\n let timeout: number;\n const doTimeout = () => {\n timeout = window.setTimeout(() => {\n this.updateList((good) => {\n if(good) {\n doTimeout();\n }\n });\n }, SortedUserList.SORT_INTERVAL);\n };\n\n doTimeout();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport AvatarElement from './avatar';\nimport type LazyLoadQueue from './lazyLoadQueue';\n\nconst CLASS_NAME = 'stacked-avatars';\nconst AVATAR_CLASS_NAME = CLASS_NAME + '-avatar';\nconst AVATAR_CONTAINER_CLASS_NAME = AVATAR_CLASS_NAME + '-container';\n\nexport default class StackedAvatars {\n public container: HTMLElement;\n private lazyLoadQueue: LazyLoadQueue;\n private avatarSize: number;\n\n constructor(options: {\n lazyLoadQueue?: StackedAvatars['lazyLoadQueue'],\n avatarSize: StackedAvatars['avatarSize']\n }) {\n this.lazyLoadQueue = options.lazyLoadQueue;\n this.avatarSize = options.avatarSize;\n\n this.container = document.createElement('div');\n this.container.classList.add(CLASS_NAME);\n\n this.container.style.setProperty('--avatar-size', options.avatarSize + 'px');\n }\n /**\n * MACOS, ANDROID - без реверса\n * WINDOWS DESKTOP - реверс\n * все приложения накладывают аватарку первую на вторую, а в макете зато вторая на первую, ЛОЛ!\n */\n public render(peerIds: PeerId[], loadPromises?: Promise[]) {\n const children = this.container.children;\n peerIds = peerIds.slice().reverse();\n if(peerIds.length > 3) {\n peerIds = peerIds.slice(-3);\n }\n\n peerIds.forEach((peerId, idx) => {\n let avatarContainer = children[idx] as HTMLElement;\n if(!avatarContainer) {\n avatarContainer = document.createElement('div');\n avatarContainer.classList.add(AVATAR_CONTAINER_CLASS_NAME);\n }\n\n let avatarElem = avatarContainer.firstElementChild as AvatarElement;\n if(!avatarElem) {\n avatarElem = new AvatarElement();\n avatarElem.classList.add('avatar-' + this.avatarSize, AVATAR_CLASS_NAME);\n avatarElem.updateOptions({\n isDialog: false,\n loadPromises\n });\n }\n\n avatarElem.updateWithOptions({\n lazyLoadQueue: this.lazyLoadQueue,\n peerId: peerId\n });\n\n if(!avatarElem.parentNode) {\n avatarContainer.append(avatarElem);\n }\n\n if(!avatarContainer.parentNode) {\n this.container.append(avatarContainer);\n }\n });\n\n // if were 3 and became 2\n (Array.from(children) as HTMLElement[]).slice(peerIds.length).forEach((el) => el.remove());\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {simulateClickEvent, attachClickEvent} from '../helpers/dom/clickEvent';\nimport findUpAsChild from '../helpers/dom/findUpAsChild';\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport getVisibleRect from '../helpers/dom/getVisibleRect';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport {makeMediaSize} from '../helpers/mediaSize';\nimport {getMiddleware, Middleware} from '../helpers/middleware';\nimport {doubleRaf} from '../helpers/schedulers';\nimport pause from '../helpers/schedulers/pause';\nimport windowSize from '../helpers/windowSize';\nimport {MyDocument} from '../lib/appManagers/appDocsManager';\nimport getStickerEffectThumb from '../lib/appManagers/utils/stickers/getStickerEffectThumb';\nimport wrapEmojiText from '../lib/richTextProcessor/wrapEmojiText';\nimport {CustomEmojiElement} from '../lib/richTextProcessor/wrapRichText';\nimport lottieLoader from '../lib/rlottie/lottieLoader';\nimport RLottiePlayer from '../lib/rlottie/rlottiePlayer';\nimport rootScope from '../lib/rootScope';\nimport animationIntersector, {AnimationItemGroup} from './animationIntersector';\nimport SetTransition from './singleTransition';\nimport wrapSticker from './wrappers/sticker';\nimport {STICKER_EFFECT_MULTIPLIER} from './wrappers/sticker';\n\nlet hasViewer = false;\nexport default function attachStickerViewerListeners({listenTo, listenerSetter, selector, findTarget: originalFindTarget}: {\n listenerSetter: ListenerSetter,\n listenTo: HTMLElement,\n selector?: string,\n findTarget?: (e: MouseEvent) => HTMLElement\n}) {\n if(IS_TOUCH_SUPPORTED) {\n return;\n }\n\n const findTarget = (e: MouseEvent, checkForParent?: boolean) => {\n let el: HTMLElement;\n if(originalFindTarget) el = originalFindTarget(e);\n else {\n const s = selector || `.media-sticker-wrapper`;\n el = (e.target as HTMLElement).closest(s) as HTMLElement;\n }\n\n return el && (!checkForParent || findUpAsChild(el, listenTo)) ? el : undefined;\n };\n\n const managers = rootScope.managers;\n\n listenerSetter.add(listenTo)('mousedown', (e) => {\n if(hasViewer || e.buttons > 1 || e.button !== 0) return;\n let mediaContainer = findTarget(e);\n if(!mediaContainer) {\n return;\n }\n\n // const img: HTMLImageElement = mediaContainer.querySelector('img.media-sticker');\n\n const docId = mediaContainer.dataset.docId;\n if(!docId) {\n return;\n }\n\n const className = 'sticker-viewer';\n const group: AnimationItemGroup = 'STICKER-VIEWER';\n const openDuration = 200;\n const switchDuration = 200;\n const previousGroup = animationIntersector.getOnlyOnePlayableGroup();\n const _middleware = getMiddleware();\n let container: HTMLElement, previousTransformer: HTMLElement;\n\n const doThatSticker = async({mediaContainer, doc, middleware, lockGroups, isSwitching}: {\n mediaContainer: HTMLElement,\n doc: MyDocument,\n middleware: Middleware,\n lockGroups?: boolean,\n isSwitching?: boolean\n }) => {\n const effectThumb = getStickerEffectThumb(doc);\n const mediaRect: DOMRect = mediaContainer.getBoundingClientRect();\n const s = makeMediaSize(doc.w, doc.h);\n const size = effectThumb ? 280 : 360;\n const boxSize = makeMediaSize(size, size);\n const fitted = mediaRect.width === mediaRect.height ? boxSize : s.aspectFitted(boxSize);\n\n const bubble = findUpClassName(mediaContainer, 'bubble');\n const isOut = bubble ? bubble.classList.contains('is-out') : true;\n\n const transformer = document.createElement('div');\n transformer.classList.add(className + '-transformer');\n\n const stickerContainer = document.createElement('div');\n stickerContainer.classList.add(className + '-sticker');\n /* transformer.style.width = */stickerContainer.style.width = fitted.width + 'px';\n /* transformer.style.height = */stickerContainer.style.height = fitted.height + 'px';\n\n const stickerEmoji = document.createElement('div');\n stickerEmoji.classList.add(className + '-emoji');\n stickerEmoji.append(wrapEmojiText(doc.stickerEmojiRaw));\n\n if(effectThumb) {\n const margin = (size * STICKER_EFFECT_MULTIPLIER - size) / 3 * (isOut ? 1 : -1);\n transformer.classList.add('has-effect');\n // const property = `--margin-${isOut ? 'right' : 'left'}`;\n // stickerContainer.style.setProperty(property, `${margin * 2}px`);\n transformer.style.setProperty('--translateX', `${margin}px`);\n stickerEmoji.style.setProperty('--translateX', `${-margin}px`);\n }\n\n const overflowElement = findUpClassName(mediaContainer, 'scrollable');\n const visibleRect = getVisibleRect(mediaContainer, overflowElement, true, mediaRect);\n if(visibleRect.overflow.vertical || visibleRect.overflow.horizontal) {\n stickerContainer.classList.add('is-overflow');\n }\n\n // if(img) {\n // const ratio = img.naturalWidth / img.naturalHeight;\n // if((mediaRect.width / mediaRect.height).toFixed(1) !== ratio.toFixed(1)) {\n\n // mediaRect = mediaRect.toJSON();\n // }\n // }\n\n const rect = mediaContainer.getBoundingClientRect();\n const scaleX = rect.width / fitted.width;\n const scaleY = rect.height / fitted.height;\n const transformX = rect.left - (windowSize.width - rect.width) / 2;\n const transformY = rect.top - (windowSize.height - rect.height) / 2;\n transformer.style.transform = `translate(${transformX}px, ${transformY}px) scale(${scaleX}, ${scaleY})`;\n if(isSwitching) transformer.classList.add('is-switching');\n transformer.append(stickerContainer, stickerEmoji);\n container.append(transformer);\n\n const o = await wrapSticker({\n doc,\n div: stickerContainer,\n group,\n width: fitted.width,\n height: fitted.height,\n play: false,\n loop: true,\n middleware,\n managers,\n needFadeIn: false,\n isOut,\n withThumb: false,\n relativeEffect: true,\n loopEffect: true\n }).then(({render}) => render);\n if(!middleware()) return;\n\n if(!container.parentElement) {\n document.body.append(container);\n }\n\n const player = Array.isArray(o) ? o[0] : o;\n\n const firstFramePromise = player instanceof RLottiePlayer ?\n new Promise((resolve) => player.addEventListener('firstFrame', resolve, {once: true})) :\n Promise.resolve();\n await Promise.all([firstFramePromise, doubleRaf()]);\n await pause(0); // ! need it because firstFrame will be called just from the loop\n if(!middleware()) return;\n\n if(lockGroups) {\n animationIntersector.setOnlyOnePlayableGroup(group);\n animationIntersector.checkAnimations2(true);\n }\n\n if(player instanceof RLottiePlayer) {\n const prevPlayer = mediaContainer instanceof CustomEmojiElement ?\n mediaContainer.player as RLottiePlayer :\n lottieLoader.getAnimation(mediaContainer);\n if(prevPlayer) {\n player.curFrame = prevPlayer.curFrame;\n player.play();\n await new Promise((resolve) => {\n let i = 0;\n const c = () => {\n if(++i === 2) {\n resolve();\n player.removeEventListener('enterFrame', c);\n }\n };\n\n player.addEventListener('enterFrame', c);\n });\n if(!middleware()) return;\n player.pause();\n }\n } else if(player instanceof HTMLVideoElement) {\n const prevPlayer = mediaContainer.querySelector('video');\n if(prevPlayer) {\n player.currentTime = prevPlayer.currentTime;\n }\n }\n\n return {\n ready: () => {\n if(player instanceof RLottiePlayer || player instanceof HTMLVideoElement) {\n player.play();\n }\n\n if(effectThumb) {\n simulateClickEvent(stickerContainer);\n }\n },\n transformer\n };\n };\n\n const timeout = window.setTimeout(async() => {\n document.removeEventListener('mousemove', onMousePreMove);\n\n container = document.createElement('div');\n container.classList.add(className);\n hasViewer = true;\n\n const middleware = _middleware.get();\n const doc = await managers.appDocsManager.getDoc(docId);\n if(!middleware()) return;\n\n let result: Awaited>;\n try {\n result = await doThatSticker({\n doc,\n mediaContainer,\n middleware,\n lockGroups: true\n });\n if(!result) return;\n } catch(err) {\n return;\n }\n\n const {ready, transformer} = result;\n\n previousTransformer = transformer;\n\n SetTransition({\n element: container,\n className: 'is-visible',\n forwards: true,\n duration: openDuration,\n onTransitionEnd: () => {\n if(!middleware()) return;\n ready();\n }\n });\n\n document.addEventListener('mousemove', onMouseMove);\n }, 125);\n\n const onMouseMove = async(e: MouseEvent) => {\n const newMediaContainer = findTarget(e, true);\n if(!newMediaContainer || mediaContainer === newMediaContainer) {\n return;\n }\n\n const docId = newMediaContainer.dataset.docId;\n if(!docId) {\n return;\n }\n\n mediaContainer = newMediaContainer;\n _middleware.clean();\n const middleware = _middleware.get();\n\n const doc = await managers.appDocsManager.getDoc(docId);\n if(!middleware()) return;\n\n let r: Awaited>;\n try {\n r = await doThatSticker({\n doc,\n mediaContainer,\n middleware,\n isSwitching: true\n });\n if(!r) return;\n } catch(err) {\n console.error('sticker viewer error', err);\n return;\n }\n\n const {ready, transformer} = r;\n\n const _previousTransformer = previousTransformer;\n SetTransition({\n element: _previousTransformer,\n className: 'is-switching',\n forwards: true,\n duration: switchDuration,\n onTransitionEnd: () => {\n _previousTransformer.remove();\n }\n });\n\n previousTransformer = transformer;\n\n SetTransition({\n element: transformer,\n className: 'is-switching',\n forwards: false,\n duration: switchDuration,\n onTransitionEnd: () => {\n if(!middleware()) return;\n ready();\n }\n });\n };\n\n const onMousePreMove = (e: MouseEvent) => {\n if(!findUpAsChild(e.target as HTMLElement, mediaContainer)) {\n onMouseUp();\n }\n };\n\n const onMouseUp = () => {\n clearTimeout(timeout);\n _middleware.clean();\n\n if(container) {\n SetTransition({\n element: container,\n className: 'is-visible',\n forwards: false,\n duration: openDuration,\n onTransitionEnd: () => {\n container.remove();\n animationIntersector.setOnlyOnePlayableGroup(previousGroup);\n animationIntersector.checkAnimations2(false);\n hasViewer = false;\n }\n });\n\n attachClickEvent(document.body, cancelEvent, {capture: true, once: true});\n }\n\n document.removeEventListener('mousemove', onMousePreMove);\n document.removeEventListener('mousemove', onMouseMove);\n document.removeEventListener('mouseup', onMouseUp, {capture: true});\n };\n\n document.addEventListener('mousemove', onMousePreMove);\n document.addEventListener('mouseup', onMouseUp, {once: true, capture: true});\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default class StickyIntersector {\n private headersObserver: IntersectionObserver;\n private elementsObserver: IntersectionObserver;\n\n constructor(private container: HTMLElement, private handler: (stuck: boolean, target: HTMLElement) => void) {\n this.observeHeaders();\n this.observeElements();\n }\n\n /**\n * Sets up an intersection observer to notify when elements with the class\n * `.sticky_sentinel--top` become visible/invisible at the top of the container.\n * @param {!Element} container\n */\n private observeHeaders() {\n this.headersObserver = new IntersectionObserver((entries) => {\n for(const entry of entries) {\n const targetInfo = entry.boundingClientRect;\n const stickyTarget = entry.target.parentElement;\n const rootBoundsInfo = entry.rootBounds;\n\n // Started sticking.\n if(targetInfo.bottom < rootBoundsInfo.top) {\n this.handler(true, stickyTarget);\n }\n\n // Stopped sticking.\n if(targetInfo.bottom >= rootBoundsInfo.top &&\n targetInfo.bottom < rootBoundsInfo.bottom) {\n this.handler(false, stickyTarget);\n }\n }\n }, {threshold: 0, root: this.container});\n }\n\n private observeElements() {\n this.elementsObserver = new IntersectionObserver((entries) => {\n const entry = entries\n .filter((entry) => entry.boundingClientRect.top < entry.rootBounds.top)\n .sort((a, b) => a.boundingClientRect.top - b.boundingClientRect.top)[0];\n if(!entry) return;\n\n const container = entry.isIntersecting ? entry.target : entry.target.nextElementSibling;\n this.handler(true, container as HTMLElement);\n }, {root: this.container});\n }\n\n /**\n * @param {!Element} container\n * @param {string} className\n */\n private addSentinel(container: HTMLElement, className: string) {\n const sentinel = document.createElement('div');\n sentinel.classList.add('sticky_sentinel', className);\n return container.appendChild(sentinel);\n }\n\n /**\n * Notifies when elements w/ the `sticky` class begin to stick or stop sticking.\n * Note: the elements should be children of `container`.\n * @param {!Element} container\n */\n public observeStickyHeaderChanges(element: HTMLElement) {\n const headerSentinel = this.addSentinel(element, 'sticky_sentinel--top');\n this.headersObserver.observe(headerSentinel);\n\n this.elementsObserver.observe(element);\n }\n\n public disconnect() {\n this.headersObserver.disconnect();\n this.elementsObserver.disconnect();\n }\n\n public unobserve(element: HTMLElement, headerSentinel: HTMLElement) {\n this.elementsObserver.unobserve(element);\n this.headersObserver.unobserve(headerSentinel);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// * zoom part from WebZ\n// * https://github.com/Ajaxy/telegram-tt/blob/069f4f5b2f2c7c22529ccced876842e7f9cb81f4/src/util/captureEvents.ts\n\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport safeAssign from '../helpers/object/safeAssign';\nimport contextMenuController from '../helpers/contextMenuController';\nimport {Middleware} from '../helpers/middleware';\nimport ListenerSetter, {Listener, ListenerOptions} from '../helpers/listenerSetter';\nimport {attachContextMenuListener} from '../helpers/dom/attachContextMenuListener';\nimport pause from '../helpers/schedulers/pause';\nimport deferredPromise from '../helpers/cancellablePromise';\nimport clamp from '../helpers/number/clamp';\nimport debounce from '../helpers/schedulers/debounce';\nimport {logger} from '../lib/logger';\nimport isSwipingBackSafari from '../helpers/dom/isSwipingBackSafari';\nimport windowSize from '../helpers/windowSize';\n\ntype E = {\n clientX: number,\n clientY: number,\n target: EventTarget,\n button?: number,\n type?: string\n};\n\ntype EE = E | (Exclude & {\n touches: E[]\n});\n\nconst getEvent = (e: EE) => {\n return 'touches' in e ? e.touches[0] : e;\n};\n\nfunction getDistance(a: Touch, b?: Touch) {\n if(!b) return 0;\n return Math.hypot((b.pageX - a.pageX), (b.pageY - a.pageY));\n}\n\nfunction getTouchCenter(a: Touch, b: Touch) {\n return {\n x: (a.pageX + b.pageX) / 2,\n y: (a.pageY + b.pageY) / 2\n };\n}\n\nconst attachGlobalListenerTo = document;\n\nlet RESET_GLOBAL = false;\ncontextMenuController.addEventListener('toggle', (visible) => {\n RESET_GLOBAL = visible;\n});\n\nexport type SwipeHandlerOptions = {\n element: SwipeHandler['element'],\n onSwipe: SwipeHandler['onSwipe'],\n verifyTouchTarget?: SwipeHandler['verifyTouchTarget'],\n onFirstSwipe?: SwipeHandler['onFirstSwipe'],\n onReset?: SwipeHandler['onReset'],\n onStart?: SwipeHandler['onStart'],\n onZoom?: SwipeHandler['onZoom'],\n onDrag?: SwipeHandler['onDrag'],\n onDoubleClick?: SwipeHandler['onDoubleClick'],\n cursor?: SwipeHandler['cursor'],\n cancelEvent?: SwipeHandler['cancelEvent'],\n listenerOptions?: SwipeHandler['listenerOptions'],\n setCursorTo?: HTMLElement,\n middleware?: Middleware,\n withDelay?: boolean,\n minZoom?: number,\n maxZoom?: number\n};\n\nconst TOUCH_MOVE_OPTIONS: ListenerOptions = {passive: false};\nconst MOUSE_MOVE_OPTIONS: ListenerOptions = false as any;\nconst WHEEL_OPTIONS: ListenerOptions = {capture: true, passive: false};\n\nexport type ZoomDetails = {\n zoom?: number;\n zoomFactor?: number;\n zoomAdd?: number;\n initialCenterX: number;\n initialCenterY: number;\n dragOffsetX: number;\n dragOffsetY: number;\n currentCenterX: number;\n currentCenterY: number;\n};\n\nexport default class SwipeHandler {\n private element: HTMLElement;\n private onSwipe: (xDiff: number, yDiff: number, e: EE, cancelDrag?: (x: boolean, y: boolean) => void) => boolean | void;\n private verifyTouchTarget: (evt: EE) => boolean | Promise;\n private onFirstSwipe: (e: EE) => void;\n private onReset: (e?: Event) => void;\n private onStart: () => void;\n private onZoom: (details: ZoomDetails) => void;\n private onDrag: (e: EE, captureEvent: E, details: {dragOffsetX: number, dragOffsetY: number}, cancelDrag: (x: boolean, y: boolean) => void) => void;\n private onDoubleClick: (details: {centerX: number, centerY: number}) => void;\n private cursor: 'grabbing' | 'move' | 'row-resize' | 'col-resize' | 'nesw-resize' | 'nwse-resize' | 'ne-resize' | 'se-resize' | 'sw-resize' | 'nw-resize' | 'n-resize' | 'e-resize' | 's-resize' | 'w-resize' | '';\n private cancelEvent: boolean;\n private listenerOptions: ListenerOptions;\n private setCursorTo: HTMLElement;\n\n private isMouseDown: boolean;\n private tempId: number;\n\n private hadMove: boolean;\n private eventUp: E;\n private xDown: number;\n private yDown: number;\n private xAdded: number;\n private yAdded: number;\n\n private withDelay: boolean;\n private listenerSetter: ListenerSetter;\n\n private initialDistance: number;\n private initialTouchCenter: ReturnType;\n private initialDragOffset: {x: number, y: number};\n private isDragCanceled: {x: boolean, y: boolean};\n private wheelZoom: number;\n private releaseWheelDrag: ReturnType void>>;\n private releaseWheelZoom: ReturnType void>>;\n\n private log: ReturnType;\n\n constructor(options: SwipeHandlerOptions) {\n safeAssign(this, options);\n\n this.log = logger('SWIPE-HANDLER');\n this.cursor ??= 'grabbing';\n this.cancelEvent ??= true;\n // this.listenerOptions ??= false as any;\n this.listenerOptions ??= TOUCH_MOVE_OPTIONS;\n\n this.setCursorTo ??= this.element;\n this.listenerSetter = new ListenerSetter();\n this.setListeners();\n\n this.resetValues();\n this.tempId = 0;\n\n options.middleware?.onDestroy(() => {\n this.reset();\n this.removeListeners();\n });\n\n this.releaseWheelDrag = debounce(this.reset, 150, false);\n this.releaseWheelZoom = debounce(this.reset, 150, false);\n }\n\n public setListeners() {\n if(!IS_TOUCH_SUPPORTED) {\n // @ts-ignore\n this.listenerSetter.add(this.element)('mousedown', this.handleStart, this.listenerOptions);\n this.listenerSetter.add(attachGlobalListenerTo)('mouseup', this.reset);\n\n if(this.onZoom || this.onDoubleClick) {\n this.listenerSetter.add(this.element)('wheel', this.handleWheel, WHEEL_OPTIONS);\n }\n } else {\n if(this.withDelay) {\n attachContextMenuListener({\n element: this.element,\n callback: (e) => {\n cancelEvent(e);\n // @ts-ignore\n this.handleStart(e);\n },\n listenerSetter: this.listenerSetter,\n listenerOptions: this.listenerOptions\n });\n } else {\n // @ts-ignore\n this.listenerSetter.add(this.element)('touchstart', this.handleStart, this.listenerOptions);\n }\n\n if(this.onDoubleClick) {\n this.listenerSetter.add(this.element)('dblclick', (e) => {\n this.onDoubleClick({centerX: e.pageX, centerY: e.pageY});\n });\n }\n\n this.listenerSetter.add(attachGlobalListenerTo)('touchend', this.reset);\n }\n }\n\n public removeListeners() {\n this.log('remove listeners');\n this.reset();\n this.listenerSetter.removeAll();\n }\n\n public setCursor(cursor: SwipeHandler['cursor'] = '') {\n this.cursor = cursor;\n\n if(!IS_TOUCH_SUPPORTED && this.hadMove) {\n this.setCursorTo.style.setProperty('cursor', this.cursor, 'important');\n }\n }\n\n public add(x: number, y: number) {\n this.xAdded = x;\n this.yAdded = y;\n this.handleMove({\n clientX: this.eventUp.clientX,\n clientY: this.eventUp.clientY,\n target: this.eventUp.target\n });\n }\n\n protected resetValues() {\n ++this.tempId;\n this.hadMove = false;\n this.xAdded = this.yAdded = 0;\n this.xDown =\n this.yDown =\n this.eventUp =\n this.isMouseDown =\n undefined;\n\n if(this.onZoom) {\n this.initialDistance = 0;\n this.initialTouchCenter = {\n x: windowSize.width / 2,\n y: windowSize.height / 2\n };\n this.initialDragOffset = {x: 0, y: 0};\n this.isDragCanceled = {x: false, y: false};\n this.wheelZoom = 1;\n }\n }\n\n protected reset = (e?: Event) => {\n this.log('reset');\n /* if(e) {\n cancelEvent(e);\n } */\n\n if(IS_TOUCH_SUPPORTED) {\n this.listenerSetter.removeManual(attachGlobalListenerTo, 'touchmove', this.handleMove, TOUCH_MOVE_OPTIONS);\n } else {\n this.listenerSetter.removeManual(attachGlobalListenerTo, 'mousemove', this.handleMove, MOUSE_MOVE_OPTIONS);\n this.setCursorTo.style.cursor = '';\n }\n\n if(this.hadMove) {\n this.onReset?.(e);\n }\n\n this.releaseWheelDrag?.clearTimeout();\n this.releaseWheelZoom?.clearTimeout();\n\n this.resetValues();\n };\n\n protected setHadMove(_e: EE) {\n if(!this.hadMove) {\n this.log('had move');\n this.hadMove = true;\n this.setCursorTo.style.setProperty('cursor', this.cursor, 'important');\n this.onFirstSwipe?.(_e);\n }\n }\n\n protected dispatchOnSwipe(...args: Parameters) {\n const onSwipeResult = this.onSwipe(...args);\n if(onSwipeResult !== undefined && onSwipeResult) {\n this.reset();\n }\n }\n\n protected handleStart = async(_e: EE) => {\n this.log('start');\n\n if(this.isMouseDown) {\n const touches = (_e as any as TouchEvent).touches;\n if(touches?.length === 2) {\n this.initialDistance = getDistance(touches[0], touches[1]);\n this.initialTouchCenter = getTouchCenter(touches[0], touches[1]);\n }\n\n return;\n }\n\n const e = getEvent(_e);\n if(![0, 1].includes(Math.max(0, e.button ?? 0))) {\n return;\n }\n\n if(e.button === 1) {\n cancelEvent(_e as any);\n }\n\n if(isSwipingBackSafari(_e as any)) {\n return;\n }\n\n const tempId = ++this.tempId;\n\n const verifyResult = this.verifyTouchTarget?.(_e);\n if(verifyResult !== undefined) {\n let result: any;\n if(verifyResult instanceof Promise) {\n // const tempId = this.tempId;\n result = await verifyResult;\n\n if(this.tempId !== tempId) {\n return;\n }\n } else {\n result = verifyResult;\n }\n\n if(!result) {\n return this.reset();\n }\n }\n\n this.isMouseDown = true;\n\n if(this.withDelay && !IS_TOUCH_SUPPORTED) {\n const options = {...MOUSE_MOVE_OPTIONS, once: true};\n const deferred = deferredPromise();\n const cb = () => deferred.resolve();\n const listener = this.listenerSetter.add(attachGlobalListenerTo)('mousemove', cb, options) as any as Listener;\n\n await Promise.race([\n pause(300),\n deferred\n ]);\n\n deferred.resolve();\n this.listenerSetter.remove(listener);\n\n if(this.tempId !== tempId) {\n return;\n }\n }\n\n this.xDown = e.clientX;\n this.yDown = e.clientY;\n this.eventUp = e;\n\n if(IS_TOUCH_SUPPORTED) {\n // @ts-ignore\n this.listenerSetter.add(attachGlobalListenerTo)('touchmove', this.handleMove, TOUCH_MOVE_OPTIONS);\n } else {\n // @ts-ignore\n this.listenerSetter.add(attachGlobalListenerTo)('mousemove', this.handleMove, MOUSE_MOVE_OPTIONS);\n }\n\n if(this.onStart) {\n this.onStart();\n\n // have to initiate move instantly\n this.hadMove = true;\n this.handleMove(e);\n }\n };\n\n protected handleMove = (_e: EE) => {\n if(this.xDown === undefined || this.yDown === undefined || RESET_GLOBAL) {\n this.reset();\n return;\n }\n\n if(this.cancelEvent) {\n cancelEvent(_e as any);\n }\n\n if(this.releaseWheelDrag?.isDebounced() || this.releaseWheelZoom?.isDebounced()) {\n return;\n }\n\n this.log('move');\n\n const e = this.eventUp = getEvent(_e);\n const xUp = e.clientX;\n const yUp = e.clientY;\n\n const xDiff = xUp - this.xDown + this.xAdded;\n const yDiff = yUp - this.yDown + this.yAdded;\n\n if(!this.hadMove) {\n if(!xDiff && !yDiff) {\n return;\n }\n\n this.setHadMove(_e);\n }\n\n const touches = (_e as any as TouchEvent).touches;\n if(this.onZoom && this.initialDistance > 0 && touches.length === 2) {\n const endDistance = getDistance(touches[0], touches[1]);\n const touchCenter = getTouchCenter(touches[0], touches[1]);\n const dragOffsetX = touchCenter.x - this.initialTouchCenter.x;\n const dragOffsetY = touchCenter.y - this.initialTouchCenter.y;\n const zoomFactor = endDistance / this.initialDistance;\n const details: ZoomDetails = {\n zoomFactor,\n initialCenterX: this.initialTouchCenter.x,\n initialCenterY: this.initialTouchCenter.y,\n dragOffsetX,\n dragOffsetY,\n currentCenterX: touchCenter.x,\n currentCenterY: touchCenter.y\n };\n\n this.onZoom(details);\n }\n\n this.dispatchOnSwipe(xDiff, yDiff, _e);\n };\n\n protected handleWheel = (e: WheelEvent) => {\n if(!this.hadMove && this.verifyTouchTarget) {\n const result = this.verifyTouchTarget(e);\n if(result !== undefined && !result) {\n this.reset(e);\n return;\n }\n }\n\n cancelEvent(e);\n\n this.log('wheel');\n\n if(this.onDoubleClick && Object.is(e.deltaX, -0) && Object.is(e.deltaY, -0) && e.ctrlKey) {\n this.onWheelCapture(e);\n this.onDoubleClick({centerX: e.pageX, centerY: e.pageY});\n this.reset();\n return;\n }\n\n const metaKeyPressed = e.metaKey || e.ctrlKey || e.shiftKey;\n if(metaKeyPressed) {\n // * fix zooming while dragging is in inertia\n if(this.releaseWheelDrag?.isDebounced()) {\n this.reset();\n }\n\n this.onWheelZoom(e);\n } else {\n this.handleWheelDrag(e);\n }\n };\n\n protected handleWheelDrag = (e: WheelEvent) => {\n this.log('wheel drag');\n\n this.onWheelCapture(e);\n // Ignore wheel inertia if drag is canceled in this direction\n if(!this.isDragCanceled.x || Math.sign(this.initialDragOffset.x) === Math.sign(e.deltaX)) {\n this.initialDragOffset.x -= e.deltaX;\n }\n if(!this.isDragCanceled.y || Math.sign(this.initialDragOffset.y) === Math.sign(e.deltaY)) {\n this.initialDragOffset.y -= e.deltaY;\n }\n const {x, y} = this.initialDragOffset;\n this.releaseWheelDrag(e);\n this.dispatchOnSwipe(x, y, e, (dx, dy) => {\n this.isDragCanceled = {x: dx, y: dy};\n });\n };\n\n protected onWheelCapture = (e: WheelEvent) => {\n if(this.hadMove) return;\n this.log('wheel capture');\n this.handleStart(e);\n this.setHadMove(e);\n this.initialTouchCenter = {x: e.x, y: e.y};\n };\n\n protected onWheelZoom = (e: WheelEvent) => {\n if(!this.onZoom) return;\n this.log('wheel zoom');\n this.onWheelCapture(e);\n const dragOffsetX = e.x - this.initialTouchCenter.x;\n const dragOffsetY = e.y - this.initialTouchCenter.y;\n const delta = clamp(e.deltaY, -25, 25);\n this.wheelZoom -= delta * 0.01;\n const details: ZoomDetails = {\n zoomAdd: this.wheelZoom - 1,\n initialCenterX: this.initialTouchCenter.x,\n initialCenterY: this.initialTouchCenter.y,\n dragOffsetX,\n dragOffsetY,\n currentCenterX: e.x,\n currentCenterY: e.y\n };\n this.onZoom(details);\n this.releaseWheelZoom(e);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport placeCaretAtEnd from '../helpers/dom/placeCaretAtEnd';\nimport {formatPhoneNumber} from '../helpers/formatPhoneNumber';\nimport {IS_APPLE, IS_ANDROID, IS_APPLE_MOBILE} from '../environment/userAgent';\nimport {HelpCountry, HelpCountryCode} from '../layer';\nimport InputField, {InputFieldOptions} from './inputField';\n\nexport default class TelInputField extends InputField {\n private pasted = false;\n public lastValue = '';\n\n constructor(options: InputFieldOptions & {\n onInput?: (formatted: ReturnType) => void\n } = {}) {\n super({\n label: 'Contacts.PhoneNumber.Placeholder',\n // plainText: true,\n name: 'phone',\n ...options\n });\n\n this.container.classList.add('input-field-phone');\n\n const telEl = this.input;\n if(telEl instanceof HTMLInputElement) {\n telEl.type = 'tel';\n telEl.autocomplete = 'rr55RandomRR55';\n } else {\n telEl.inputMode = 'decimal';\n\n const pixelRatio = window.devicePixelRatio;\n if(pixelRatio > 1) {\n let letterSpacing: number;\n if(IS_APPLE) {\n letterSpacing = pixelRatio * -.16;\n } else if(IS_ANDROID) {\n letterSpacing = 0;\n }\n\n telEl.style.setProperty('--letter-spacing', letterSpacing + 'px');\n }\n\n const originalFunc = this.setValueSilently.bind(this);\n this.setValueSilently = (value) => {\n originalFunc(value);\n placeCaretAtEnd(this.input, true);\n };\n }\n\n telEl.addEventListener('input', () => {\n // console.log('input', this.value);\n telEl.classList.remove('error');\n\n const value = this.value;\n const diff = Math.abs(value.length - this.lastValue.length);\n if(diff > 1 && !this.pasted && IS_APPLE_MOBILE) {\n this.setValueSilently(this.lastValue + value);\n }\n\n this.pasted = false;\n\n this.setLabel();\n\n let formattedPhoneNumber: ReturnType;\n let formatted: string, country: HelpCountry, countryCode: HelpCountryCode, leftPattern = '';\n if(this.value.replace(/\\++/, '+') === '+') {\n this.setValueSilently('+');\n } else {\n formattedPhoneNumber = formatPhoneNumber(this.value);\n formatted = formattedPhoneNumber.formatted;\n country = formattedPhoneNumber.country;\n leftPattern = formattedPhoneNumber.leftPattern;\n countryCode = formattedPhoneNumber.code;\n this.setValueSilently(this.lastValue = formatted ? '+' + formatted : '');\n }\n\n telEl.dataset.leftPattern = leftPattern/* .replace(/X/g, '0') */;\n\n // console.log(formatted, country);\n\n options.onInput && options.onInput(formattedPhoneNumber);\n });\n\n telEl.addEventListener('paste', () => {\n this.pasted = true;\n // console.log('paste', telEl.value);\n });\n\n /* telEl.addEventListener('change', (e) => {\n console.log('change', telEl.value);\n }); */\n\n telEl.addEventListener('keypress', (e) => {\n // console.log('keypress', this.value);\n const key = e.key;\n if(/\\D/.test(key) && !(e.metaKey || e.ctrlKey) && key !== 'Backspace' && !(key === '+' && e.shiftKey/* && !this.value */)) {\n e.preventDefault();\n return false;\n }\n });\n\n /* telEl.addEventListener('focus', function(this: typeof telEl, e) {\n this.removeAttribute('readonly'); // fix autocomplete\n });*/\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport EventListenerBase from '../helpers/eventListenerBase';\nimport {TelegramWebViewEvent, TelegramWebViewEventCallback, TelegramWebViewEventMap} from '../types';\n\nconst weakMap: WeakMap = new WeakMap();\nwindow.addEventListener('message', (e) => {\n const callback = weakMap.get(e.source as Window);\n if(!callback) {\n return;\n }\n\n callback(JSON.parse(e.data));\n});\n\nexport default class TelegramWebView extends EventListenerBase<{\n [type in keyof TelegramWebViewEventMap]: (data: TelegramWebViewEventMap[type]) => void\n}> {\n public iframe: HTMLIFrameElement;\n\n constructor({url, sandbox}: {\n url: string,\n sandbox?: string\n }) {\n super(false);\n\n const iframe = this.iframe = document.createElement('iframe');\n iframe.src = url;\n if(sandbox) iframe.setAttribute('sandbox', sandbox);\n }\n\n public onMount() {\n weakMap.set(this.iframe.contentWindow, this.onTelegramWebViewEvent);\n }\n\n public destroy() {\n this.cleanup();\n weakMap.delete(this.iframe.contentWindow);\n }\n\n private onTelegramWebViewEvent = ({eventType, eventData}: TelegramWebViewEvent) => {\n if((eventData as any) === '') {\n eventData = undefined;\n }\n\n console.log('onTelegramWebViewEvent', eventType, eventData);\n this.dispatchEvent(eventType, eventData as any);\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport replaceContent from '../helpers/dom/replaceContent';\nimport OverlayClickHandler from '../helpers/overlayClickHandler';\nimport {FormatterArguments, i18n, LangPackKey} from '../lib/langPack';\n\nconst toastEl = document.createElement('div');\ntoastEl.classList.add('toast');\nlet timeout: number;\n\nconst x = new OverlayClickHandler('toast');\nx.addEventListener('toggle', (open) => {\n if(!open) {\n hideToast();\n }\n});\n\nexport function hideToast() {\n x.close();\n\n toastEl.classList.remove('is-visible');\n timeout && clearTimeout(+timeout);\n\n timeout = window.setTimeout(() => {\n toastEl.remove();\n timeout = undefined;\n }, 200);\n}\n\nexport function toast(content: string | Node, onClose?: () => void) {\n x.close();\n\n replaceContent(toastEl, content);\n\n if(!toastEl.parentElement) {\n document.body.append(toastEl);\n void toastEl.offsetLeft; // reflow\n }\n\n toastEl.classList.add('is-visible');\n\n timeout && clearTimeout(+timeout);\n x.open(toastEl);\n\n timeout = window.setTimeout(hideToast, 3000);\n\n if(onClose) {\n x.addEventListener('toggle', onClose, {once: true});\n }\n}\n\nexport function toastNew(options: Partial<{\n langPackKey: LangPackKey,\n langPackArguments: FormatterArguments,\n onClose: () => void\n}>) {\n toast(i18n(options.langPackKey, options.langPackArguments), options.onClose);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../lib/rootScope';\nimport deferredPromise, {CancellablePromise} from '../helpers/cancellablePromise';\nimport {dispatchHeavyAnimationEvent} from '../hooks/useHeavyAnimationCheck';\nimport whichChild from '../helpers/dom/whichChild';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport liteMode from '../helpers/liteMode';\n\nfunction makeTransitionFunction(options: TransitionFunction) {\n return options;\n}\n\nconst slideNavigation = makeTransitionFunction({\n callback: (tabContent, prevTabContent, toRight) => {\n const width = prevTabContent.getBoundingClientRect().width;\n const elements = [tabContent, prevTabContent];\n if(toRight) elements.reverse();\n elements[0].style.filter = `brightness(80%)`;\n elements[0].style.transform = `translate3d(${-width * .25}px, 0, 0)`;\n elements[1].style.transform = `translate3d(${width}px, 0, 0)`;\n\n tabContent.classList.add('active');\n void tabContent.offsetWidth; // reflow\n\n tabContent.style.transform = '';\n tabContent.style.filter = '';\n\n return () => {\n prevTabContent.style.transform = prevTabContent.style.filter = '';\n };\n },\n animateFirst: false\n});\n\nconst slideTabs = makeTransitionFunction({\n callback: (tabContent, prevTabContent, toRight) => {\n // Jolly Cobra's // Workaround for scrollable content flickering during animation.\n // const scrollableContainer = findUpClassName(tabContent, 'scrollable-y');\n // if(scrollableContainer && scrollableContainer.style.overflowY !== 'hidden') {\n // // const scrollBarWidth = scrollableContainer.offsetWidth - scrollableContainer.clientWidth;\n // scrollableContainer.style.overflowY = 'hidden';\n // // scrollableContainer.style.paddingRight = `${scrollBarWidth}px`;\n // // this.container.classList.add('sliding');\n // }\n\n // window.requestAnimationFrame(() => {\n const width = prevTabContent.getBoundingClientRect().width;\n /* tabContent.style.setProperty('--width', width + 'px');\n prevTabContent.style.setProperty('--width', width + 'px');\n\n tabContent.classList.add('active'); */\n // void tabContent.offsetWidth; // reflow\n const elements = [tabContent, prevTabContent];\n if(toRight) elements.reverse();\n elements[0].style.transform = `translate3d(${-width}px, 0, 0)`;\n elements[1].style.transform = `translate3d(${width}px, 0, 0)`;\n\n tabContent.classList.add('active');\n void tabContent.offsetWidth; // reflow\n\n tabContent.style.transform = '';\n // });\n\n return () => {\n prevTabContent.style.transform = '';\n\n // if(scrollableContainer) {\n // // Jolly Cobra's // Workaround for scrollable content flickering during animation.\n // if(isSafari) { // ! safari doesn't respect sticky header, so it flicks when overflow is changing\n // scrollableContainer.style.display = 'none';\n // }\n\n // scrollableContainer.style.overflowY = '';\n\n // if(isSafari) {\n // void scrollableContainer.offsetLeft; // reflow\n // scrollableContainer.style.display = '';\n // }\n\n // // scrollableContainer.style.paddingRight = '0';\n // // this.container.classList.remove('sliding');\n // }\n };\n },\n animateFirst: false\n});\n\nconst slideTopics = makeTransitionFunction({\n callback: (tabContent, prevTabContent) => {\n const rect = tabContent.getBoundingClientRect();\n const offsetX = rect.width - 80;\n\n tabContent.style.transform = `transformX(${offsetX}px)`;\n\n tabContent.classList.add('active');\n void tabContent.offsetWidth; // reflow\n\n tabContent.style.transform = '';\n\n return () => {};\n },\n animateFirst: true\n});\n\nconst transitions: {[type in TransitionSliderType]?: TransitionFunction} = {\n navigation: slideNavigation,\n tabs: slideTabs\n // topics: slideTopics\n};\n\ntype TransitionSliderType = 'tabs' | 'navigation' | 'zoom-fade' | 'slide-fade' | 'topics' | 'none'/* | 'counter' */;\n\ntype TransitionSliderOptions = {\n content: HTMLElement,\n type: TransitionSliderType,\n transitionTime: number,\n onTransitionEnd?: (id: number) => void,\n isHeavy?: boolean,\n once?: boolean,\n withAnimationListener?: boolean,\n listenerSetter?: ListenerSetter,\n animateFirst?: boolean\n};\n\ntype TransitionFunction = {\n callback: (tabContent: HTMLElement, prevTabContent: HTMLElement, toRight: boolean) => () => void,\n animateFirst: boolean\n};\n\nconst TransitionSlider = (options: TransitionSliderOptions) => {\n let {\n content,\n type,\n transitionTime,\n onTransitionEnd,\n isHeavy = true,\n once = false,\n withAnimationListener = true,\n listenerSetter,\n animateFirst = false\n } = options;\n\n const {callback: animationFunction, animateFirst: _animateFirst} = transitions[type] || {};\n content.dataset.animation = type;\n\n if(_animateFirst !== undefined) {\n animateFirst = _animateFirst;\n }\n\n const onTransitionEndCallbacks: Map = new Map();\n let animationDeferred: CancellablePromise;\n // let animationStarted = 0;\n let from: HTMLElement = null;\n\n if(withAnimationListener) {\n const listenerName = animationFunction ? 'transitionend' : 'animationend';\n\n const onEndEvent = (e: TransitionEvent | AnimationEvent) => {\n cancelEvent(e);\n\n if((e.target as HTMLElement).parentElement !== content) {\n return;\n }\n\n // console.log('Transition: transitionend', /* content, */ e, selectTab.prevId, performance.now() - animationStarted);\n\n const callback = onTransitionEndCallbacks.get(e.target as HTMLElement);\n callback?.();\n\n if(e.target !== from) {\n return;\n }\n\n if(!animationDeferred && isHeavy) return;\n\n if(animationDeferred) {\n animationDeferred.resolve();\n animationDeferred = undefined;\n }\n\n onTransitionEnd?.(selectTab.prevId());\n\n content.classList.remove('animating', 'backwards', 'disable-hover');\n\n if(once) {\n if(listenerSetter) listenerSetter.removeManual(content, listenerName, onEndEvent);\n else content.removeEventListener(listenerName, onEndEvent/* , {capture: false} */);\n from = animationDeferred = undefined;\n onTransitionEndCallbacks.clear();\n }\n };\n\n // TODO: check for transition type (transform, etc) using by animationFunction\n if(listenerSetter) listenerSetter.add(content)(listenerName, onEndEvent);\n else content.addEventListener(listenerName, onEndEvent/* , {passive: true, capture: false} */);\n }\n\n function selectTab(id: number | HTMLElement, animate = true, overrideFrom?: typeof from) {\n if(overrideFrom) {\n from = overrideFrom;\n }\n\n if(id instanceof HTMLElement) {\n id = whichChild(id);\n }\n\n const prevId = selectTab.prevId();\n if(id === prevId) return false;\n\n // console.log('selectTab id:', id);\n\n const to = content.children[id] as HTMLElement;\n\n if(!liteMode.isAvailable('animations') || (prevId === -1 && !animateFirst)) {\n animate = false;\n }\n\n if(!withAnimationListener) {\n const timeout = content.dataset.timeout;\n if(timeout !== undefined) {\n clearTimeout(+timeout);\n }\n\n delete content.dataset.timeout;\n }\n\n if(!animate) {\n if(from) from.classList.remove('active', 'to', 'from');\n else if(to) { // fix instant opening back from closed slider (e.g. instant closening and opening right sidebar)\n const callback = onTransitionEndCallbacks.get(to);\n callback?.();\n }\n\n if(to) {\n to.classList.remove('to', 'from');\n to.classList.add('active');\n }\n\n content.classList.remove('animating', 'backwards', 'disable-hover');\n\n from = to;\n\n onTransitionEnd?.(id);\n return;\n }\n\n if(!withAnimationListener) {\n content.dataset.timeout = '' + window.setTimeout(() => {\n to.classList.remove('to');\n from && from.classList.remove('from');\n content.classList.remove('animating', 'backwards', 'disable-hover');\n delete content.dataset.timeout;\n }, transitionTime);\n }\n\n if(from) {\n from.classList.remove('to');\n from.classList.add('from');\n }\n\n content.classList.add('animating'/* , 'disable-hover' */);\n const toRight = prevId < id;\n content.classList.toggle('backwards', !toRight);\n\n let onTransitionEndCallback: ReturnType;\n if(!to) {\n // prevTabContent.classList.remove('active');\n } else {\n if(animationFunction) {\n onTransitionEndCallback = animationFunction(to, from, toRight);\n } else {\n to.classList.add('active');\n }\n\n to.classList.remove('from');\n to.classList.add('to');\n }\n\n if(to) {\n const transitionTimeout = to.dataset.transitionTimeout;\n if(transitionTimeout) {\n clearTimeout(+transitionTimeout);\n }\n\n onTransitionEndCallbacks.set(to, () => {\n to.classList.remove('to');\n onTransitionEndCallbacks.delete(to);\n });\n }\n\n if(from/* && false */) {\n let timeout: number;\n const _from = from;\n const callback = () => {\n clearTimeout(timeout);\n _from.classList.remove('active', 'from');\n\n onTransitionEndCallback?.();\n\n onTransitionEndCallbacks.delete(_from);\n };\n\n if(to) {\n timeout = window.setTimeout(callback, transitionTime + 100); // something happened to container\n onTransitionEndCallbacks.set(_from, callback);\n } else {\n timeout = window.setTimeout(callback, transitionTime);\n onTransitionEndCallbacks.set(_from, () => {\n clearTimeout(timeout);\n onTransitionEndCallbacks.delete(_from);\n });\n }\n\n _from.dataset.transitionTimeout = '' + timeout;\n\n if(isHeavy) {\n if(!animationDeferred) {\n animationDeferred = deferredPromise();\n // animationStarted = performance.now();\n }\n\n dispatchHeavyAnimationEvent(animationDeferred, transitionTime * 2);\n }\n }\n\n from = to;\n }\n\n // selectTab.prevId = -1;\n selectTab.prevId = () => from ? whichChild(from) : -1;\n selectTab.getFrom = () => from;\n selectTab.setFrom = (_from: HTMLElement) => from = _from;\n\n return selectTab;\n};\n\nexport default TransitionSlider;\n","export default function isUsernameValid(username: string) {\n return ((username.length >= 3 && username.length <= 32) || !username.length) && /^[a-zA-Z0-9_]*$/.test(username);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ListenerSetter from '../helpers/listenerSetter';\nimport debounce from '../helpers/schedulers/debounce';\nimport {LangPackKey} from '../lib/langPack';\nimport InputField, {InputFieldOptions, InputState} from './inputField';\nimport isUsernameValid from '../lib/richTextProcessor/isUsernameValid';\nimport {AppManagers} from '../lib/appManagers/managers';\n\nexport class UsernameInputField extends InputField {\n private checkUsernamePromise: Promise;\n private checkUsernameDebounced: (username: string) => void;\n public options: InputFieldOptions & {\n peerId?: PeerId,\n listenerSetter: ListenerSetter,\n onChange?: () => void,\n invalidText: LangPackKey,\n takenText: LangPackKey,\n availableText: LangPackKey,\n head?: string\n };\n public error: ApiError;\n\n constructor(\n options: UsernameInputField['options'],\n private managers: AppManagers\n ) {\n super(options);\n\n this.checkUsernameDebounced = debounce(this.checkUsername.bind(this), 150, false, true);\n\n options.listenerSetter.add(this.input)('input', () => {\n const value = this.getValue();\n\n this.error = undefined;\n if(value === this.originalValue || !value.length) {\n this.setState(InputState.Neutral);\n this.options.onChange?.();\n return;\n } else if(!isUsernameValid(value)) { // does not check the last underscore\n this.setError(this.options.invalidText);\n } else {\n this.setState(InputState.Neutral);\n }\n\n if(this.input.classList.contains('error')) {\n this.options.onChange?.();\n return;\n }\n\n this.checkUsernameDebounced(value);\n });\n }\n\n public getValue() {\n let value = this.value;\n if(this.options.head) {\n value = value.slice(this.options.head.length);\n this.setValueSilently(this.options.head + value);\n }\n\n return value;\n }\n\n private checkUsername(username: string) {\n if(this.checkUsernamePromise) return;\n\n this.error = undefined;\n let checkPromise: Promise\n if(this.options.peerId) {\n checkPromise = this.managers.appChatsManager.checkUsername(this.options.peerId.toChatId(), username);\n } else {\n checkPromise = this.managers.appUsersManager.checkUsername(username);\n }\n\n const promise = this.checkUsernamePromise = checkPromise.then((available) => {\n if(this.getValue() !== username) return;\n\n if(available) {\n this.setState(InputState.Valid, this.options.availableText);\n } else {\n this.setError(this.options.takenText);\n }\n }, (err) => {\n if(this.getValue() !== username) return;\n\n this.error = err;\n switch((err as ApiError).type) {\n case 'USERNAME_PURCHASE_AVAILABLE': {\n this.setError(this.options.takenText);\n break;\n }\n\n case 'USERNAME_INVALID':\n default: {\n this.setError(this.options.invalidText);\n break;\n }\n }\n }).then(() => {\n if(this.checkUsernamePromise === promise) {\n this.checkUsernamePromise = undefined;\n }\n\n this.options.onChange?.();\n\n const value = this.getValue();\n if(value !== username && this.isValidToChange() && isUsernameValid(value)) {\n this.checkUsername(value);\n }\n });\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport findUpAsChild from '../helpers/dom/findUpAsChild';\nimport placeCaretAtEnd from '../helpers/dom/placeCaretAtEnd';\nimport positionElementByIndex from '../helpers/dom/positionElementByIndex';\nimport Sortable from '../helpers/dom/sortable';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport {Middleware} from '../helpers/middleware';\nimport noop from '../helpers/noop';\nimport SortedList, {SortedElementBase} from '../helpers/sortedList';\nimport {Chat, User, Username} from '../layer';\nimport {i18n, LangPackKey} from '../lib/langPack';\nimport rootScope from '../lib/rootScope';\nimport confirmationPopup from './confirmationPopup';\nimport Row from './row';\nimport SettingSection from './settingSection';\nimport {UsernameInputField} from './usernameInputField';\n\nexport default class UsernamesSection extends SettingSection {\n // public section: SettingSection;\n\n constructor(options: {\n peerId: PeerId,\n peer: Chat.channel | User.user,\n listenerSetter: ListenerSetter,\n usernameInputField: UsernameInputField,\n middleware: Middleware\n }) {\n /* const section = this.section = new SettingSection */super({\n name: 'UsernamesProfileHeader',\n caption: !options.peerId.isUser() ? 'UsernamesChannelHelp' : 'UsernamesProfileHelp'\n });\n\n const {peerId, peer, usernameInputField, listenerSetter, middleware} = options;\n const managers = rootScope.managers;\n const channelId = peerId.isUser() ? undefined : peerId.toChatId();\n\n const section = this;\n\n const CLASS_NAME = 'usernames';\n const list = document.createElement('div');\n list.classList.add(CLASS_NAME);\n\n let _usernames: Username[];\n\n interface SortedUsername extends SortedElementBase {\n row: Row\n }\n\n const sortedList = new SortedList({\n getIndex: (element) => _usernames.length - _usernames.findIndex((username) => username.username === element.id),\n onDelete: (element) => {\n element.row.container.remove();\n },\n onSort: (element, idx) => {\n positionElementByIndex(element.row.container, list, idx);\n },\n onElementCreate: (base) => {\n const username = _usernames.find((username) => username.username === base.id);\n const row = new Row({\n title: '@' + username.username,\n subtitle: true,\n clickable: true\n });\n\n const editable = !!username.pFlags.editable;\n const active = !!username.pFlags.active;\n\n if(editable) row.container.dataset.editable = '1';\n row.container.dataset.username = username.username;\n row.container.classList.add(CLASS_NAME + '-username');\n row.subtitle.classList.add(CLASS_NAME + '-username-status');\n const media = row.createMedia('medium');\n media.classList.add(CLASS_NAME + '-username-icon', 'tgico');\n\n row.makeSortable();\n\n changeActive(row, active);\n\n (base as SortedUsername).row = row;\n\n return base as SortedUsername;\n }\n });\n\n const changeActive = (row: Row, active: boolean) => {\n row.subtitle.replaceChildren(i18n(row.container.dataset.editable ? 'UsernameLinkEditable' : (active ? 'UsernameLinkActive' : 'UsernameLinkInactive')));\n row.container.classList.toggle('active', active);\n row.toggleSorting(active);\n };\n\n const applyUsernames = (usernames: Username[] = []) => {\n _usernames = usernames;\n\n sortedList.getAll().forEach((element) => {\n if(!usernames.some((username) => username.username === element.id)) {\n sortedList.delete(element.id);\n }\n });\n\n usernames.forEach((username) => {\n if(!sortedList.has(username.username)) {\n sortedList.add(username.username);\n } else {\n const element = sortedList.get(username.username);\n sortedList.update(username.username, element);\n changeActive(element.row, !!username.pFlags.active);\n }\n });\n\n section.container.classList.toggle('hide', !sortedList.getAll().size);\n };\n\n applyUsernames(peer.usernames);\n\n listenerSetter.add(rootScope)('peer_title_edit', async({peerId: _peerId}) => {\n if(_peerId !== peerId) {\n return;\n }\n\n const peer = await managers.appPeersManager.getPeer(peerId);\n applyUsernames((peer as User.user).usernames);\n });\n\n let cancelClick = false;\n attachClickEvent(list, async(e) => {\n if(cancelClick) {\n cancelClick = false;\n return;\n }\n\n const container = findUpAsChild(e.target as HTMLElement, list);\n if(!container) {\n return;\n }\n\n if(container.dataset.editable) {\n placeCaretAtEnd(usernameInputField.input, true, true);\n return;\n }\n\n const username = container.dataset.username;\n\n const active = container.classList.contains('active');\n let titleLangKey: LangPackKey, descriptionLangKey: LangPackKey;\n if(active) {\n titleLangKey = 'UsernameDeactivateLink';\n descriptionLangKey = channelId ? 'UsernameDeactivateLinkChannelMessage' : 'UsernameDeactivateLinkProfileMessage';\n } else {\n titleLangKey = 'UsernameActivateLink';\n descriptionLangKey = channelId ? 'UsernameActivateLinkChannelMessage' : 'UsernameActivateLinkProfileMessage';\n }\n\n try {\n await confirmationPopup({\n titleLangKey,\n descriptionLangKey,\n button: {\n langKey: active ? 'Hide' : 'Show'\n }\n });\n } catch(err) {\n return;\n }\n\n const newActive = !active;\n let promise: Promise;\n if(channelId) {\n promise = managers.appChatsManager.toggleUsername(channelId, username, newActive);\n } else {\n promise = managers.appUsersManager.toggleUsername(username, newActive);\n }\n\n promise.catch((err: ApiError) => {\n if(err.type === 'USERNAMES_ACTIVE_TOO_MUCH') {\n confirmationPopup({\n titleLangKey: 'UsernameActivateErrorTitle',\n descriptionLangKey: 'UsernameActivateErrorMessage',\n button: {langKey: 'OK', isCancel: true}\n }).catch(noop);\n } else {\n console.error('turn username error', err);\n }\n });\n });\n\n new Sortable({\n list,\n middleware,\n onSort: (idx, newIdx) => {\n const username = _usernames.splice(idx, 1)[0];\n _usernames.splice(newIdx, 0, username);\n sortedList.updateList();\n // can't just update particular element, have to change indexes\n // sortedList.update(username.username);\n\n const usernames = _usernames.filter((username) => username.pFlags.active).map((username) => username.username);\n if(channelId) {\n managers.appChatsManager.reorderUsernames(channelId, usernames);\n } else {\n managers.appUsersManager.reorderUsernames(usernames);\n }\n }\n });\n\n section.content.append(list);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\ntype TargetType = HTMLElement;\nexport type OnVisibilityChangeItem = {target: TargetType, visible: boolean, entry: IntersectionObserverEntry, index: number};\nexport type OnVisibilityChange = (item: OnVisibilityChangeItem) => void;\n\nexport default class VisibilityIntersector {\n private observer: IntersectionObserver;\n private items: Map = new Map();\n private locked = false;\n\n constructor(onVisibilityChange: OnVisibilityChange, options?: IntersectionObserverInit) {\n this.observer = new IntersectionObserver((entries) => {\n if(this.locked) {\n return;\n }\n\n const changed: OnVisibilityChangeItem[] = [];\n\n entries.forEach((entry, index) => {\n const target = entry.target as TargetType;\n\n if(this.items.get(target) === entry.isIntersecting) {\n return;\n } else {\n this.items.set(target, entry.isIntersecting);\n }\n\n /* if(entry.isIntersecting) {\n console.log('ooo', entry);\n } */\n\n /* if(this.locked) {\n return;\n } */\n\n const change: typeof changed[0] = {target, visible: entry.isIntersecting, entry, index};\n\n // ! order will be incorrect so can't use it\n // changed[entry.isIntersecting ? 'unshift' : 'push'](change);\n changed.push(change);\n\n // onVisibilityChange(target, entry.isIntersecting);\n });\n\n changed.forEach((item) => {\n onVisibilityChange(item);\n });\n }, options);\n }\n\n public getVisible() {\n const items: TargetType[] = [];\n this.items.forEach((value, key) => {\n if(value) {\n items.push(key);\n }\n });\n\n return items;\n }\n\n public clearVisible() {\n const visible = this.getVisible();\n for(const target of visible) {\n this.items.set(target, false);\n }\n }\n\n public isVisible(target: TargetType) {\n return this.items.get(target);\n }\n\n public disconnect() {\n this.observer.disconnect();\n this.items.clear();\n }\n\n public refresh() {\n this.observer.disconnect();\n\n // window.requestAnimationFrame(() => {\n const targets = [...this.items.keys()];\n for(const target of targets) {\n // this.items.set(target, false);\n this.observer.observe(target);\n }\n // });\n }\n\n public refreshVisible() {\n const visible = this.getVisible();\n for(const target of visible) {\n this.observer.unobserve(target);\n }\n\n for(const target of visible) {\n this.observer.observe(target);\n }\n }\n\n public observe(target: TargetType) {\n this.items.set(target, false);\n this.observer.observe(target);\n }\n\n public unobserve(target: TargetType) {\n this.observer.unobserve(target);\n this.items.delete(target);\n }\n\n public unlock() {\n this.locked = false;\n }\n\n public unlockAndRefresh() {\n this.unlock();\n this.refresh();\n }\n\n public lock() {\n this.locked = true;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport rootScope from '../lib/rootScope';\nimport appMediaPlaybackController from './appMediaPlaybackController';\nimport RangeSelector from './rangeSelector';\n\nexport default class VolumeSelector extends RangeSelector {\n private static ICONS = ['volume_off', 'volume_mute', 'volume_down', 'volume_up'];\n public btn: HTMLElement;\n protected icon: HTMLSpanElement;\n\n constructor(protected listenerSetter: ListenerSetter, protected vertical = false) {\n super({\n step: 0.01,\n min: 0,\n max: 1,\n vertical\n }, 1);\n\n this.setListeners();\n this.setHandlers({\n onScrub: currentTime => {\n const value = Math.max(Math.min(currentTime, 1), 0);\n\n // console.log('volume scrub:', currentTime, value);\n\n appMediaPlaybackController.muted = false;\n appMediaPlaybackController.volume = value;\n }\n\n /* onMouseUp: (e) => {\n cancelEvent(e.event);\n } */\n });\n\n const className = 'player-volume';\n const btn = this.btn = document.createElement('div');\n btn.classList.add('btn-icon', className);\n const icon = this.icon = document.createElement('span');\n icon.classList.add(className + '__icon');\n\n btn.append(icon, this.container);\n\n attachClickEvent(icon, this.onMuteClick, {listenerSetter: this.listenerSetter});\n this.listenerSetter.add(appMediaPlaybackController)('playbackParams', this.setVolume);\n\n this.setVolume();\n }\n\n private onMuteClick = (e?: Event) => {\n e && cancelEvent(e);\n appMediaPlaybackController.muted = !appMediaPlaybackController.muted;\n };\n\n public setVolume = () => {\n // const volume = video.volume;\n const {volume, muted} = appMediaPlaybackController;\n let d: string;\n let iconIndex: number;\n if(!volume || muted) {\n iconIndex = 0;\n } else if(volume > .5) {\n iconIndex = 3;\n } else if(volume > 0 && volume < .25) {\n iconIndex = 1;\n } else {\n iconIndex = 2;\n }\n\n VolumeSelector.ICONS.forEach((icon) => this.icon.classList.remove('tgico-' + icon));\n this.icon.classList.add('tgico-' + VolumeSelector.ICONS[iconIndex]);\n\n if(!this.mousedown) {\n this.setProgress(muted ? 0 : volume);\n }\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\n\nexport default function wrapCustomEmoji({\n docIds,\n loadPromises,\n middleware,\n lazyLoadQueue,\n customEmojiSize,\n animationGroup\n}: {\n docIds: DocId[],\n loadPromises?: Promise[]\n} & WrapSomethingOptions) {\n const text = ' '.repeat(docIds.length);\n const entities: MessageEntity[] = [];\n docIds.forEach((docId, idx) => {\n entities.push({\n _: 'messageEntityCustomEmoji',\n offset: idx,\n length: 1,\n document_id: docId\n });\n });\n\n const wrapped = wrapRichText(text, {\n entities,\n loadPromises,\n animationGroup,\n customEmojiSize,\n middleware,\n lazyLoadQueue\n });\n\n return wrapped;\n}\n\nexport function wrapCustomEmojiAwaited(options: Parameters[0]) {\n const loadPromises: Promise[] = options.loadPromises ??= [];\n const wrapped = wrapCustomEmoji(options);\n return Promise.all(loadPromises).then(() => wrapped);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport MEDIA_MIME_TYPES_SUPPORTED from '../../environment/mediaMimeTypesSupport';\nimport {CancellablePromise} from '../../helpers/cancellablePromise';\nimport {clearBadCharsAndTrim} from '../../helpers/cleanSearchText';\nimport {formatFullSentTime} from '../../helpers/date';\nimport {simulateClickEvent, attachClickEvent} from '../../helpers/dom/clickEvent';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport formatBytes from '../../helpers/formatBytes';\nimport liteMode from '../../helpers/liteMode';\nimport {MediaSizeType} from '../../helpers/mediaSizes';\nimport noop from '../../helpers/noop';\nimport {Message, MessageMedia, WebPage} from '../../layer';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport appDownloadManager, {Progress} from '../../lib/appManagers/appDownloadManager';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getDownloadMediaDetails from '../../lib/appManagers/utils/download/getDownloadMediaDetails';\nimport choosePhotoSize from '../../lib/appManagers/utils/photos/choosePhotoSize';\nimport {joinElementsWith} from '../../lib/langPack';\nimport {MAX_FILE_SAVE_SIZE} from '../../lib/mtproto/mtproto_config';\nimport wrapPlainText from '../../lib/richTextProcessor/wrapPlainText';\nimport rootScope from '../../lib/rootScope';\nimport type {ThumbCache} from '../../lib/storages/thumbs';\nimport {MediaSearchContext} from '../appMediaPlaybackController';\nimport AudioElement from '../audio';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport {MiddleEllipsisElement} from '../middleEllipsis';\nimport ProgressivePreloader from '../preloader';\nimport wrapPhoto from './photo';\nimport wrapSenderToPeer from './senderToPeer';\nimport wrapSentTime from './sentTime';\n\nrootScope.addEventListener('document_downloading', (docId) => {\n const elements = Array.from(document.querySelectorAll(`.document[data-doc-id=\"${docId}\"]`)) as HTMLElement[];\n elements.forEach((element) => {\n if(element.querySelector('.preloader-container.manual')) {\n simulateClickEvent(element);\n }\n });\n});\n\nexport default async function wrapDocument({message, withTime, fontWeight, voiceAsMusic, showSender, searchContext, loadPromises, autoDownloadSize, lazyLoadQueue, sizeType, managers = rootScope.managers, cacheContext, fontSize, getSize, canTranscribeVoice}: {\n message: Message.message,\n withTime?: boolean,\n fontWeight?: number,\n voiceAsMusic?: boolean,\n showSender?: boolean,\n searchContext?: MediaSearchContext,\n loadPromises?: Promise[],\n autoDownloadSize?: number,\n lazyLoadQueue?: LazyLoadQueue,\n sizeType?: MediaSizeType,\n managers?: AppManagers,\n cacheContext?: ThumbCache,\n fontSize?: number,\n getSize?: () => number,\n canTranscribeVoice?: boolean\n}): Promise {\n fontWeight ??= 500;\n sizeType ??= '' as any;\n fontSize ??= 16;\n const noAutoDownload = autoDownloadSize === 0;\n\n const doc = ((message.media as MessageMedia.messageMediaDocument).document || ((message.media as MessageMedia.messageMediaWebPage).webpage as WebPage.webPage).document) as MyDocument;\n const uploadFileName = message?.uploadingFileName;\n if(doc.type === 'audio' || doc.type === 'voice' || doc.type === 'round') {\n const audioElement = new AudioElement();\n audioElement.withTime = withTime;\n audioElement.message = message;\n audioElement.noAutoDownload = noAutoDownload;\n audioElement.lazyLoadQueue = lazyLoadQueue;\n audioElement.loadPromises = loadPromises;\n if(canTranscribeVoice && doc.type === 'voice') audioElement.transcriptionState = 0;\n (audioElement as any).getSize = getSize;\n\n if(voiceAsMusic) audioElement.voiceAsMusic = voiceAsMusic;\n if(searchContext) audioElement.searchContext = searchContext;\n if(showSender) audioElement.showSender = showSender;\n\n audioElement.dataset.fontWeight = '' + fontWeight;\n audioElement.dataset.fontSize = '' + fontSize;\n audioElement.dataset.sizeType = sizeType;\n await audioElement.render();\n return audioElement;\n }\n\n const extSplitted = doc.file_name ? doc.file_name.split('.') : '';\n let ext = '';\n ext = extSplitted.length > 1 && Array.isArray(extSplitted) ?\n clearBadCharsAndTrim(extSplitted.pop().split(' ', 1)[0].toLowerCase()) :\n 'file';\n\n const docDiv = document.createElement('div');\n docDiv.classList.add('document', `ext-${ext}`);\n docDiv.dataset.docId = '' + doc.id;\n (docDiv as any).doc = doc;\n\n // return docDiv;\n\n const icoDiv = document.createElement('div');\n icoDiv.classList.add('document-ico');\n let icoTextEl: HTMLElement;\n\n const hadContext = !!cacheContext;\n const getCacheContext = () => {\n return hadContext ? cacheContext : managers.thumbsStorage.getCacheContext(doc);\n };\n\n cacheContext = await getCacheContext();\n let hasThumb = false;\n if((doc.thumbs?.length || (message.pFlags.is_outgoing && cacheContext.url && doc.type === 'photo'))/* && doc.mime_type !== 'image/gif' */) {\n docDiv.classList.add('document-with-thumb');\n hasThumb = true;\n\n const imgs: (HTMLImageElement | HTMLCanvasElement | HTMLVideoElement)[] = [];\n // ! WARNING, use thumbs for check when thumb will be generated for media\n if(message.pFlags.is_outgoing && ['photo', 'video'].includes(doc.type) && cacheContext.url) {\n icoDiv.innerHTML = ``;\n imgs.push(icoDiv.firstElementChild as HTMLImageElement);\n } else {\n const perf = performance.now();\n const wrapped = await wrapPhoto({\n photo: doc,\n message: null,\n container: icoDiv,\n boxWidth: 54,\n boxHeight: 54,\n loadPromises,\n withoutPreloader: true,\n lazyLoadQueue,\n size: choosePhotoSize(doc, 54, 54, true),\n managers\n });\n // console.log('was wrapping photo', performance.now() - perf);\n icoDiv.style.width = icoDiv.style.height = '';\n if(wrapped.images.thumb) imgs.push(wrapped.images.thumb);\n if(wrapped.images.full) imgs.push(wrapped.images.full);\n }\n\n imgs.forEach((img) => img.classList.add('document-thumb'));\n } else {\n icoTextEl = document.createElement('span');\n icoTextEl.classList.add('document-ico-text');\n icoTextEl.innerText = ext;\n icoDiv.append(icoTextEl);\n }\n\n // let fileName = stringMiddleOverflow(doc.file_name || 'Unknown.file', 26);\n const fileName = doc.file_name ? wrapPlainText(doc.file_name) : 'Unknown.file';\n const descriptionEl = document.createElement('div');\n descriptionEl.classList.add('document-description');\n const bytesContainer = document.createElement('span');\n const bytesEl = formatBytes(doc.size);\n const bytesJoiner = ' / ';\n\n const descriptionParts: (HTMLElement | string | DocumentFragment)[] = [bytesEl];\n\n if(withTime) {\n descriptionParts.push(formatFullSentTime(message.date));\n }\n\n if(showSender) {\n descriptionParts.push(await wrapSenderToPeer(message));\n }\n\n if(!withTime && !showSender) {\n const b = document.createElement('span');\n const bytesMaxEl = formatBytes(doc.size);\n b.append(bytesJoiner, bytesMaxEl);\n b.style.visibility = 'hidden';\n descriptionParts.push(b);\n }\n\n docDiv.innerHTML = `\n ${(cacheContext.downloaded && !uploadFileName) || !message.mid || !hasThumb ? '' : `
`}\n
\n
\n `;\n\n const nameDiv = docDiv.querySelector('.document-name') as HTMLElement;\n const middleEllipsisEl = new MiddleEllipsisElement();\n middleEllipsisEl.dataset.fontWeight = '' + fontWeight;\n middleEllipsisEl.dataset.fontSize = '' + fontSize;\n middleEllipsisEl.dataset.sizeType = sizeType;\n (middleEllipsisEl as any).getSize = getSize;\n middleEllipsisEl.textContent = fileName;\n // setInnerHTML(middleEllipsisEl, fileName);\n\n // * new media popup\n if(!message.mid) {\n docDiv.classList.add('downloaded');\n }\n\n nameDiv.append(middleEllipsisEl);\n\n if(showSender) {\n nameDiv.append(wrapSentTime(message));\n }\n\n const sizeDiv = docDiv.querySelector('.document-size') as HTMLElement;\n bytesContainer.append(...joinElementsWith(descriptionParts, ' · '));\n sizeDiv.append(bytesContainer);\n\n docDiv.prepend(icoDiv);\n\n if(!uploadFileName && message.pFlags.is_outgoing && !message.mid) {\n return docDiv;\n }\n\n let downloadDiv: HTMLElement, preloader: ProgressivePreloader = null;\n const onLoad = () => {\n docDiv.classList.remove('downloading');\n\n if(/* !hasThumb || */(doc.size > MAX_FILE_SAVE_SIZE && !uploadFileName)) {\n preloader.setManual();\n preloader.attach(downloadDiv);\n preloader.preloader.classList.add('manual');\n preloader.setDownloadFunction(load);\n return;\n }\n\n if(doc.size <= MAX_FILE_SAVE_SIZE) {\n docDiv.classList.add('downloaded');\n }\n\n if(downloadDiv) {\n if(downloadDiv !== icoDiv) {\n const _downloadDiv = downloadDiv;\n setTimeout(() => {\n _downloadDiv.remove();\n }, 200);\n }\n\n downloadDiv = null;\n }\n\n if(preloader) {\n preloader = null;\n }\n };\n\n const addByteProgress = (promise: CancellablePromise) => {\n docDiv.classList.add('downloading');\n\n const sizeContainer = document.createElement('span');\n const _bytesContainer = formatBytes(doc.size);\n sizeContainer.style.position = 'absolute';\n sizeContainer.style.left = '0';\n promise.then(onLoad, noop).finally(() => {\n // sizeContainer.replaceWith(bytesContainer);\n bytesContainer.style.visibility = '';\n sizeContainer.remove();\n // b && b.classList.remove('hide');\n });\n\n // b && b.classList.add('hide');\n\n const format = (bytes: number) => formatBytes(bytes);\n let d = format(0);\n bytesContainer.style.visibility = 'hidden';\n // bytesContainer.replaceWith(sizeContainer);\n sizeContainer.append(d, bytesJoiner, _bytesContainer);\n bytesContainer.parentElement.append(sizeContainer);\n promise.addNotifyListener((progress: Progress) => {\n const _d = format(progress.done);\n d.replaceWith(_d);\n d = _d;\n });\n };\n\n // ! DO NOT USE ASYNC/AWAIT HERE ! SAFARI WON'T LET DOWNLOAD THE FILE BECAUSE OF ASYNC\n const load = (e?: Event) => {\n const save = !e || e.isTrusted;\n const doc = (docDiv as any).doc;\n // const doc = await managers.appDocsManager.getDoc(docDiv.dataset.docId);\n let download: CancellablePromise;\n const queueId = appImManager.chat.bubbles ? appImManager.chat.bubbles.lazyLoadQueue.queueId : undefined;\n if(!save) {\n download = appDownloadManager.downloadToDisc({media: doc, queueId}, true);\n } else if(doc.type === 'pdf') {\n const canOpenAfter = /* managers.appDocsManager.downloading.has(doc.id) || */!preloader || preloader.detached;\n download = appDownloadManager.downloadMediaURL({media: doc, queueId});\n if(canOpenAfter) {\n download.then(() => {\n setTimeout(async() => { // wait for preloader animation end\n const url = (await getCacheContext()).url;\n window.open(url);\n }, liteMode.isAvailable('animations') ? 250 : 0);\n });\n }\n } else if(MEDIA_MIME_TYPES_SUPPORTED.has(doc.mime_type) && doc.thumbs?.length) {\n download = appDownloadManager.downloadMediaURL({media: doc, queueId});\n } else {\n download = appDownloadManager.downloadToDisc({media: doc, queueId});\n }\n\n download.catch(() => {\n docDiv.classList.remove('downloading');\n });\n\n if(downloadDiv) {\n preloader.attach(downloadDiv, true, download);\n addByteProgress(download);\n }\n };\n\n const {fileName: downloadFileName} = getDownloadMediaDetails({media: doc, downloadId: '1'});\n if(await managers.apiFileManager.isDownloading(downloadFileName)) {\n downloadDiv = docDiv.querySelector('.document-download') || icoDiv;\n const promise = appDownloadManager.downloadToDisc({media: doc}, true);\n\n preloader = new ProgressivePreloader();\n preloader.attach(downloadDiv, false, promise);\n preloader.setDownloadFunction(load);\n addByteProgress(promise);\n } else if(!cacheContext.downloaded || uploadFileName) {\n downloadDiv = docDiv.querySelector('.document-download') || icoDiv;\n preloader = new ProgressivePreloader({\n isUpload: !!uploadFileName\n });\n\n if(!uploadFileName) {\n preloader.construct();\n preloader.setManual();\n preloader.attach(downloadDiv);\n preloader.setDownloadFunction(load);\n\n if(autoDownloadSize !== undefined && autoDownloadSize >= doc.size) {\n simulateClickEvent(preloader.preloader);\n }\n } else {\n const uploadPromise = appDownloadManager.getUpload(uploadFileName);\n preloader.attachPromise(uploadPromise);\n preloader.attach(downloadDiv);\n addByteProgress(uploadPromise);\n }\n }\n\n attachClickEvent(docDiv, (e) => {\n if(findUpClassName(e.target, 'time')) { // prevent downloading by clicking on time\n return;\n }\n\n if(preloader) {\n preloader.onClick(e);\n } else {\n load(e);\n }\n });\n\n return docDiv;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {formatPhoneNumber} from '../../helpers/formatPhoneNumber';\n\nexport default function formatUserPhone(phone: string) {\n return '+' + formatPhoneNumber(phone).formatted;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport numberThousandSplitter from '../../helpers/number/numberThousandSplitter';\nimport {Chat, ChatParticipants} from '../../layer';\nimport {i18n, LangPackKey} from '../../lib/langPack';\nimport rootScope from '../../lib/rootScope';\n\nexport default async function getChatMembersString(chatId: ChatId, managers = rootScope.managers) {\n const chat: Chat = await managers.appChatsManager.getChat(chatId);\n if(chat._ === 'chatForbidden') {\n return i18n('YouWereKicked');\n }\n\n const chatFull = await managers.appProfileManager.getCachedFullChat(chatId);\n let count: number;\n if(chatFull) {\n if(chatFull._ === 'channelFull') {\n count = chatFull.participants_count;\n } else {\n count = (chatFull.participants as ChatParticipants.chatParticipants).participants?.length;\n }\n } else {\n count = (chat as Chat.chat).participants_count || (chat as any).participants?.participants.length;\n }\n\n const isBroadcast = (chat as Chat.channel).pFlags.broadcast;\n count = count || 1;\n\n const key: LangPackKey = isBroadcast ? 'Peer.Status.Subscribers' : 'Peer.Status.Member';\n return i18n(key, [numberThousandSplitter(count)]);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport _limitSymbols from '../../helpers/string/limitSymbols';\nimport {Chat} from '../../layer';\nimport getPeerActiveUsernames from '../../lib/appManagers/utils/peers/getPeerActiveUsernames';\nimport I18n from '../../lib/langPack';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport rootScope from '../../lib/rootScope';\n\ntype GetPeerTitleOptions = {\n peerId: PeerId,\n plainText?: boolean,\n onlyFirstName?: boolean,\n limitSymbols?: number,\n threadId?: number\n} & Pick;\n\nexport default async function getPeerTitle(\n options: T\n): Promise {\n const {\n peerId = rootScope.myId,\n plainText,\n onlyFirstName,\n limitSymbols,\n managers = rootScope.managers,\n threadId\n } = options;\n\n let title = '';\n if(peerId.isUser()) {\n const user = await managers.appUsersManager.getUser(peerId.toUserId());\n if(user) {\n if(user.first_name) title += user.first_name;\n if(user.last_name && (!onlyFirstName || !title)) title += ' ' + user.last_name;\n }\n\n if(!title) title = !user || user.pFlags.deleted ? I18n.format(onlyFirstName ? 'Deleted' : 'HiddenName', true) : getPeerActiveUsernames(user)[0] || '';\n else title = title.trim();\n } else {\n if(threadId) {\n const topic = await managers.dialogsStorage.getForumTopic(peerId, threadId);\n title = topic?.title || '';\n }\n\n if(!title) {\n const chat = await managers.appChatsManager.getChat(peerId.toChatId()) as Chat.chat;\n title = chat?.title || '';\n }\n\n if(onlyFirstName) {\n title = title.split(' ')[0];\n }\n }\n\n if(limitSymbols !== undefined) {\n title = _limitSymbols(title, limitSymbols, limitSymbols);\n }\n\n return plainText ? title : wrapEmojiText(title) as any;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {formatFullSentTimeRaw} from '../../helpers/date';\nimport {User} from '../../layer';\nimport {LangPackKey, i18n} from '../../lib/langPack';\nimport {REPLIES_PEER_ID, SERVICE_PEER_ID} from '../../lib/mtproto/mtproto_config';\n\nexport default function getUserStatusString(user: User.user): HTMLElement {\n if(!user) {\n return document.createElement('span');\n }\n\n let key: LangPackKey;\n let args: any[];\n\n switch(user.id) {\n case REPLIES_PEER_ID.toUserId():\n key = 'Peer.RepliesNotifications';\n break;\n case SERVICE_PEER_ID.toUserId():\n key = 'Peer.ServiceNotifications';\n break;\n default: {\n if(user.pFlags.bot) {\n key = 'Bot';\n break;\n }\n\n if(user.pFlags.support) {\n key = 'SupportStatus';\n break;\n }\n\n switch(user.status?._) {\n case 'userStatusRecently': {\n key = 'Lately';\n break;\n }\n\n case 'userStatusLastWeek': {\n key = 'WithinAWeek';\n break;\n }\n\n case 'userStatusLastMonth': {\n key = 'WithinAMonth';\n break;\n }\n\n case 'userStatusOffline': {\n const date = user.status.was_online;\n const today = new Date();\n const now = today.getTime() / 1000 | 0;\n\n const diff = now - date;\n if(diff < 60) {\n key = 'Peer.Status.justNow';\n } else if(diff < 3600) {\n key = 'Peer.Status.minAgo';\n const c = diff / 60 | 0;\n args = [c];\n } else if(diff < 86400 && today.getDate() === new Date(date * 1000).getDate()) {\n key = 'LastSeen.HoursAgo';\n const c = diff / 3600 | 0;\n args = [c];\n } else {\n key = 'Peer.Status.LastSeenAt';\n const {dateEl, timeEl} = formatFullSentTimeRaw(date);\n args = [dateEl, timeEl];\n }\n\n break;\n }\n\n case 'userStatusOnline': {\n key = 'Online';\n break;\n }\n\n default: {\n key = 'ALongTimeAgo';\n break;\n }\n }\n\n break;\n }\n }\n\n return i18n(key, args);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport getImageFromStrippedThumb from '../../helpers/getImageFromStrippedThumb';\nimport noop from '../../helpers/noop';\nimport {Document, Photo, PhotoSize} from '../../layer';\nimport DotRenderer from '../dotRenderer';\nimport SetTransition from '../singleTransition';\n\nexport function toggleMediaSpoiler(options: {\n mediaSpoiler: HTMLElement,\n reveal: boolean,\n destroyAfter?: boolean\n}) {\n const {mediaSpoiler, reveal, destroyAfter} = options;\n SetTransition({\n element: mediaSpoiler,\n forwards: reveal,\n className: 'is-revealing',\n duration: 250,\n onTransitionEnd: () => {\n if(reveal && destroyAfter) {\n mediaSpoiler.remove();\n mediaSpoiler.middlewareHelper.destroy();\n }\n }\n });\n}\n\nexport function onMediaSpoilerClick(options: {\n mediaSpoiler: HTMLElement,\n event: Event\n}) {\n const {mediaSpoiler, event} = options;\n cancelEvent(event);\n\n if(mediaSpoiler.classList.contains('is-revealing')) {\n return;\n }\n\n const video = mediaSpoiler.parentElement.querySelector('video');\n if(video && !mediaSpoiler.parentElement.querySelector('.video-play')) {\n video.autoplay = true;\n video.play().catch(noop);\n }\n\n toggleMediaSpoiler({\n mediaSpoiler,\n reveal: true,\n destroyAfter: true\n });\n}\n\nexport function wrapMediaSpoilerWithImage(options: {\n image: Awaited>['image']\n} & Parameters[0]) {\n const {middleware, image} = options;\n if(!middleware()) {\n return;\n }\n\n image.classList.add('media-spoiler-thumbnail');\n\n const container = document.createElement('div');\n container.classList.add('media-spoiler-container');\n container.middlewareHelper = middleware.create();\n\n const dotRenderer = DotRenderer.create({\n ...options,\n middleware: container.middlewareHelper.get()\n });\n\n container.append(image, dotRenderer.canvas);\n\n return container;\n}\n\nexport default async function wrapMediaSpoiler(\n options: Omit[0], 'image'> & {\n media: Document.document | Photo.photo\n }\n) {\n const {media} = options;\n const sizes = (media as Photo.photo).sizes || (media as Document.document).thumbs;\n const thumb = sizes.find((size) => size._ === 'photoStrippedSize') as PhotoSize.photoStrippedSize;\n if(!thumb) {\n return;\n }\n\n const {image, loadPromise} = getImageFromStrippedThumb(media, thumb, true);\n await loadPromise;\n\n return wrapMediaSpoilerWithImage({\n ...options,\n image\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyMessage} from '../../lib/appManagers/appMessagesManager';\nimport wrapMessageActionTextNewUnsafe from './messageActionTextNewUnsafe';\n\nexport type WrapMessageActionTextOptions = {\n message: MyMessage,\n plain?: boolean,\n noLinks?: boolean\n} & WrapSomethingOptions;\n\nexport default async function wrapMessageActionTextNew(\n options: T\n): Promise {\n try {\n return await wrapMessageActionTextNewUnsafe(options) as any;\n } catch(err) {\n console.error('wrapMessageActionTextNewUnsafe error:', err);\n return options.plain ? '' : document.createElement('span') as any;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {hexaToHsla} from '../helpers/color';\nimport {TOPIC_COLORS} from '../lib/mtproto/mtproto_config';\nimport wrapAbbreviation from '../lib/richTextProcessor/wrapAbbreviation';\n\nlet svg: SVGSVGElement, span: HTMLElement, defs: HTMLElement;\nconst hadColors: Map = new Map();\nexport default function topicAvatar(color: number, content: string) {\n if(!svg) {\n defs = document.getElementById('svg-defs') as HTMLElement;\n\n const ns = 'http://www.w3.org/2000/svg';\n\n svg = document.createElementNS(ns, 'svg');\n svg.setAttributeNS(null, 'width', '26');\n svg.setAttributeNS(null, 'height', '26');\n svg.setAttributeNS(null, 'viewBox', '0 0 26 26');\n svg.classList.add('topic-icon-svg');\n\n const use = document.createElementNS(ns, 'use');\n use.setAttributeNS(null, 'href', '#topic-icon');\n svg.append(use);\n\n span = document.createElement('span');\n span.classList.add('topic-icon', 'avatar-like');\n\n const contentSpan = document.createElement('span');\n contentSpan.classList.add('topic-icon-content');\n span.append(svg, contentSpan);\n }\n\n if(!color) {\n console.error('NO TOPIC ICON COLOR!');\n color = TOPIC_COLORS[0];\n }\n\n if(!content) {\n console.error('NO TOPIC NAME!');\n content = '';\n }\n\n const hex = color.toString(16);\n\n const gradientId = `topic-icon-gradient-${color}`;\n let strokeColor = hadColors.get(color);\n if(!strokeColor) {\n const {h, s, l, a} = hexaToHsla('#' + hex);\n defs.insertAdjacentHTML('beforeend', `\n \n \n \n \n `);\n\n hadColors.set(color, strokeColor = `hsla(${h}, ${s}%, ${Math.max(0, l - 40)}%, ${a})`);\n }\n\n const clone = span.cloneNode(true) as typeof span;\n (clone.firstElementChild as HTMLElement).style.fill = `url(#${gradientId})`;\n // (clone.firstElementChild as HTMLElement).style.stroke = `var(--peer-avatar-${color}-filled)`;\n (clone.firstElementChild as HTMLElement).style.stroke = strokeColor;\n clone.lastElementChild.append(wrapAbbreviation(content, true));\n return clone;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Message, MessageAction} from '../../layer';\nimport wrapUrl from '../../lib/richTextProcessor/wrapUrl';\n\nexport default function wrapJoinVoiceChatAnchor(message: Message.messageService) {\n const action = message.action as MessageAction.messageActionInviteToGroupCall;\n const {onclick, url} = wrapUrl(`tg://voicechat?chat_id=${message.peerId.toChatId()}&id=${action.call.id}&access_hash=${action.call.access_hash}`);\n if(!onclick) {\n return document.createElement('span');\n }\n\n const a = document.createElement('a');\n a.href = url;\n a.setAttribute('onclick', onclick + '(this)');\n\n return a;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport {formatTime, ONE_DAY} from '../../helpers/date';\nimport htmlToSpan from '../../helpers/dom/htmlToSpan';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport formatCallDuration from '../../helpers/formatCallDuration';\nimport paymentsWrapCurrencyAmount from '../../helpers/paymentsWrapCurrencyAmount';\nimport {ForumTopic, Message, MessageAction} from '../../layer';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport I18n, {FormatterArgument, FormatterArguments, i18n, join, langPack, LangPackKey, _i18n} from '../../lib/langPack';\nimport {GENERAL_TOPIC_ID} from '../../lib/mtproto/mtproto_config';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport wrapPlainText from '../../lib/richTextProcessor/wrapPlainText';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\nimport rootScope from '../../lib/rootScope';\nimport topicAvatar from '../topicAvatar';\nimport {wrapCustomEmojiAwaited} from './customEmoji';\nimport getPeerTitle from './getPeerTitle';\nimport wrapJoinVoiceChatAnchor from './joinVoiceChatAnchor';\nimport {WrapMessageActionTextOptions} from './messageActionTextNew';\nimport wrapMessageForReply, {WrapMessageForReplyOptions} from './messageForReply';\nimport wrapPeerTitle from './peerTitle';\n\nasync function wrapLinkToMessage(options: WrapMessageForReplyOptions) {\n const wrapped = await wrapMessageForReply(options);\n\n if(options.plain) {\n return wrapped;\n }\n\n const a = document.createElement('i');\n a.dataset.savedFrom = (options.message as Message.message).peerId + '_' + (options.message as Message.message).mid;\n a.dir = 'auto';\n a.append(wrapped);\n return a;\n}\n\nfunction wrapSomeText(text: string, plain?: boolean) {\n return plain ? text : htmlToSpan(wrapEmojiText(text));\n}\n\ntype WrapTopicIconOptions = {\n topic: Pick,\n plain?: boolean\n} & WrapSomethingOptions;\nexport async function wrapTopicIcon(options: T): Promise {\n const topic = options.topic;\n\n let iconEmojiId = topic?.icon_emoji_id;\n if(topic?.id === GENERAL_TOPIC_ID) {\n iconEmojiId = '5390854796011906616';\n }\n\n if(!iconEmojiId) {\n if(options.plain) return '' as any;\n\n // if(topic?.id === GENERAL_TOPIC_ID) {\n // const span = document.createElement('span');\n // span.innerHTML = `\n // \n // \n // \n // `;\n\n // span.classList.add('topic-icon');\n\n // return span as any;\n // }\n\n return topicAvatar(topic?.icon_color, topic?.title) as any;\n }\n\n return options.plain ?\n rootScope.managers.appEmojiManager.getCustomEmojiDocument(iconEmojiId).then((doc) => doc.stickerEmojiRaw) :\n wrapCustomEmojiAwaited({\n ...options,\n docIds: [iconEmojiId]\n }).then((fragment) => {\n fragment.lastElementChild.classList.add('topic-icon');\n return fragment;\n }) as any;\n}\n\nfunction wrapMessageActionTopicIcon(options: WrapMessageActionTextOptions) {\n const action = ((options.message as Message.messageService).action as MessageAction.messageActionTopicCreate);\n return wrapTopicIcon({\n ...options,\n topic: action as any as ForumTopic.forumTopic\n });\n}\n\nasync function wrapMessageActionTopicIconAndName(options: WrapMessageActionTextOptions) {\n const action = ((options.message as Message.messageService).action as MessageAction.messageActionTopicCreate);\n const span = document.createElement('span');\n span.classList.add('topic-name');\n span.append(await wrapMessageActionTopicIcon(options), wrapSomeText(action.title, options.plain));\n return span;\n}\n\nexport default async function wrapMessageActionTextNewUnsafe(options: WrapMessageActionTextOptions) {\n const {plain, message, noLinks} = options;\n const element: HTMLElement = plain ? undefined : document.createElement('span');\n const action = 'action' in message && message.action;\n\n // this.log('message action:', action);\n\n if((action as MessageAction.messageActionCustomAction).message) {\n const unsafeMessage = (action as MessageAction.messageActionCustomAction).message;\n if(plain) {\n return wrapPlainText(unsafeMessage);\n } else {\n setInnerHTML(element, wrapRichText(unsafeMessage, {noLinebreaks: true}));\n return element;\n }\n } else {\n let _ = action._;\n // let suffix = '';\n let langPackKey: LangPackKey;\n let args: Array>;\n\n const managers = rootScope.managers;\n\n const getNameDivHTML = (peerId: PeerId, plain: boolean) => {\n return plain ? getPeerTitle({peerId, plainText: plain}) : wrapPeerTitle({peerId});\n };\n\n switch(action._) {\n case 'messageActionPhoneCall': {\n _ += '.' + (action as any).type;\n\n args = [formatCallDuration(action.duration, plain)];\n break;\n }\n\n case 'messageActionGroupCall': {\n _ += '.' + (action as any).type;\n\n args = [];\n if(!_.endsWith('You') && !message.pFlags.post) {\n args.push(getNameDivHTML(message.fromId, plain));\n }\n\n if(action.duration !== undefined) {\n args.push(formatCallDuration(action.duration, plain));\n } else if(noLinks) {\n args.push('');\n } else {\n args.push(wrapJoinVoiceChatAnchor(message as any));\n }\n\n break;\n }\n\n case 'messageActionInviteToGroupCall': {\n const peerIds = [message.fromId, action.users[0].toPeerId()];\n let a = 'Chat.Service.VoiceChatInvitation';\n const myId = rootScope.myId;\n if(peerIds[0] === myId) a += 'ByYou';\n else if(peerIds[1] === myId) a += 'ForYou';\n indexOfAndSplice(peerIds, myId);\n\n langPackKey = a as LangPackKey;\n args = peerIds.map((peerId) => getNameDivHTML(peerId, plain));\n args.push(noLinks ? '' : wrapJoinVoiceChatAnchor(message as any));\n break;\n }\n\n case 'messageActionGroupCallScheduled': {\n const today = new Date();\n const date = new Date(action.schedule_date * 1000);\n const daysToStart = (date.getTime() - today.getTime()) / 86400e3;\n const tomorrowDate = new Date(today);\n tomorrowDate.setDate(tomorrowDate.getDate() + 1);\n\n const isBroadcast = await managers.appPeersManager.isBroadcast(message.peerId);\n langPackKey = isBroadcast ? 'ChatList.Service.VoiceChatScheduled.Channel' : 'ChatList.Service.VoiceChatScheduled';\n args = [];\n const myId = rootScope.myId;\n if(message.fromId === myId) {\n langPackKey += 'You';\n } else if(!isBroadcast) {\n args.push(getNameDivHTML(message.fromId, plain));\n }\n\n let k: LangPackKey;\n const _args: FormatterArguments = [];\n if(daysToStart < 1 && date.getDate() === today.getDate()) {\n k = 'TodayAtFormattedWithToday';\n } else if(daysToStart < 2 && date.getDate() === tomorrowDate.getDate()) {\n k = 'Time.TomorrowAt';\n } else {\n k = 'formatDateAtTime';\n _args.push(new I18n.IntlDateElement({\n date,\n options: {\n day: '2-digit',\n month: '2-digit',\n year: '2-digit'\n }\n }).element);\n }\n\n _args.push(formatTime(date));\n const t = i18n(k, _args);\n args.push(t);\n\n break;\n }\n\n case 'messageActionChatCreate': {\n const myId = rootScope.myId;\n if(message.fromId === myId) {\n _ += 'You';\n } else {\n args = [getNameDivHTML(message.fromId, plain)];\n }\n\n break;\n }\n\n case 'messageActionPinMessage': {\n const peerId = message.peerId;\n const pinnedMessage = await managers.appMessagesManager.getMessageByPeer(peerId, message.reply_to_mid);\n\n args = [\n getNameDivHTML(message.fromId, plain)\n ];\n\n if(!pinnedMessage/* || true */) {\n langPackKey = 'ActionPinnedNoText';\n\n if(message.reply_to_mid) { // refresh original message\n managers.appMessagesManager.fetchMessageReplyTo(message);\n }\n } else {\n args.push(wrapLinkToMessage({\n ...options,\n message: pinnedMessage\n }));\n }\n\n break;\n }\n\n case 'messageActionChatJoinedByRequest': {\n const isBroadcast = await managers.appPeersManager.isBroadcast(message.peerId);\n if(message.pFlags.out) {\n langPackKey = isBroadcast ? 'RequestToJoinChannelApproved' : 'RequestToJoinGroupApproved';\n } else {\n langPackKey = isBroadcast ? 'ChatService.UserJoinedChannelByRequest' : 'ChatService.UserJoinedGroupByRequest';\n args = [getNameDivHTML(message.fromId, plain)];\n }\n break;\n }\n\n case 'messageActionContactSignUp':\n case 'messageActionChatReturn':\n case 'messageActionChatLeave':\n case 'messageActionChatJoined':\n case 'messageActionChatEditPhoto':\n case 'messageActionChatDeletePhoto':\n case 'messageActionChatEditVideo':\n case 'messageActionChatJoinedByLink':\n case 'messageActionChannelEditVideo':\n case 'messageActionChannelDeletePhoto': {\n args = [getNameDivHTML(message.fromId, plain)];\n break;\n }\n\n case 'messageActionChannelEditTitle':\n case 'messageActionChatEditTitle': {\n args = [];\n if(action._ === 'messageActionChatEditTitle') {\n args.push(getNameDivHTML(message.fromId, plain));\n }\n\n args.push(wrapSomeText(action.title));\n break;\n }\n\n case 'messageActionChatDeleteUser':\n case 'messageActionChatAddUsers':\n case 'messageActionChatAddUser': {\n const users = (action as MessageAction.messageActionChatAddUser).users ||\n [(action as MessageAction.messageActionChatDeleteUser).user_id];\n\n args = [getNameDivHTML(message.fromId, plain)];\n\n if(users.length > 1) {\n const joined = join(\n await Promise.all(users.map((userId: UserId) => getNameDivHTML(userId.toPeerId(), plain))),\n false,\n plain\n );\n\n if(plain) {\n args.push(...joined);\n } else {\n const fragment = document.createElement('span');\n fragment.append(...joined);\n args.push(fragment);\n }\n } else {\n args.push(getNameDivHTML(users[0].toPeerId(), plain));\n }\n\n break;\n }\n\n case 'messageActionBotAllowed': {\n const anchorHTML = wrapRichText(action.domain, {\n entities: [{\n _: 'messageEntityUrl',\n length: action.domain.length,\n offset: 0\n }],\n noLinks\n });\n\n const node = htmlToSpan(anchorHTML);\n\n args = [node];\n break;\n }\n\n case 'messageActionPaymentSent': {\n const isRecurringInit = action.pFlags.recurring_init;\n const isRecurringUsed = action.pFlags.recurring_used;\n langPackKey = isRecurringUsed ? 'Chat.Service.PaymentSentRecurringUsedNoTitle' : (isRecurringInit ? 'Chat.Service.PaymentSentRecurringInitNoTitle' : 'Chat.Service.PaymentSent1NoTitle');\n const price = paymentsWrapCurrencyAmount(action.total_amount, action.currency);\n args = [price, getNameDivHTML(message.peerId, plain)];\n\n if(message.reply_to_mid) {\n const invoiceMessage = await managers.appMessagesManager.getMessageByPeer(\n message.reply_to?.reply_to_peer_id ? getPeerId(message.reply_to.reply_to_peer_id) : message.peerId,\n message.reply_to_mid\n );\n\n if(!invoiceMessage) {\n managers.appMessagesManager.fetchMessageReplyTo(message);\n } else {\n langPackKey = isRecurringUsed ? 'Chat.Service.PaymentSentRecurringUsed' : (isRecurringInit ? 'Chat.Service.PaymentSentRecurringInit' : 'Chat.Service.PaymentSent1');\n args.push(wrapLinkToMessage({\n ...options,\n message: invoiceMessage\n }).then((el) => {\n if(el instanceof HTMLElement) {\n el.classList.add('is-receipt-link');\n }\n\n return el;\n }));\n }\n }\n\n break;\n }\n\n case 'messageActionSetMessagesTTL': {\n args = [];\n\n const isBroadcast = await managers.appPeersManager.isBroadcast(message.peerId);\n if(action.period) {\n if(isBroadcast) {\n langPackKey = 'ActionTTLChannelChanged';\n } else if(message.fromId === rootScope.myId) {\n langPackKey = 'ActionTTLYouChanged';\n } else {\n langPackKey = 'ActionTTLChanged';\n args.push(getNameDivHTML(message.fromId, plain));\n }\n\n let duration: ReturnType;\n if(action.period > 1814400) {\n let key: LangPackKey;\n const args: FormatterArguments = [];\n const year = 31536000;\n if(action.period >= year) {\n key = 'Years';\n args.push(action.period / year | 0);\n } else {\n key = 'Months';\n args.push(action.period / (ONE_DAY * 30) | 0);\n }\n\n duration = plain ? I18n.format(key, true, args) : i18n(key, args);\n } else {\n duration = formatCallDuration(action.period, plain);\n }\n\n args.push(duration);\n } else {\n if(isBroadcast) {\n langPackKey = 'ActionTTLChannelDisabled';\n } else if(message.fromId === rootScope.myId) {\n langPackKey = 'ActionTTLYouDisabled';\n } else {\n langPackKey = 'ActionTTLDisabled';\n args.push(getNameDivHTML(message.fromId, plain));\n }\n }\n break;\n }\n\n case 'messageActionTopicEdit': {\n let iconElement: (typeof args)[0];\n let titleElement: typeof iconElement;\n let authorElement: ReturnType;\n const isMe = !!message.pFlags.out;\n const isIconChanged = action.icon_emoji_id !== undefined;\n const isIconRemoved = isIconChanged && !+action.icon_emoji_id;\n const isTitleChanged = action.title !== undefined;\n const isHiddenChanged = action.hidden !== undefined;\n\n if(!isMe) {\n authorElement = getNameDivHTML(message.fromId, plain);\n }\n\n if(isTitleChanged) {\n titleElement = wrapSomeText(action.title);\n }\n\n if(isIconChanged && !isIconRemoved) {\n iconElement = wrapMessageActionTopicIcon(options);\n }\n\n args = authorElement ? [authorElement] : [];\n\n if(action.closed) {\n langPackKey = isMe ? 'Chat.Service.Group.TopicEdited.You.Paused' : 'Chat.Service.Group.TopicEdited.Paused';\n } else if(action.closed === false) {\n langPackKey = isMe ? 'Chat.Service.Group.TopicEdited.You.Resumed' : 'Chat.Service.Group.TopicEdited.Resumed';\n } else if(isIconRemoved && isTitleChanged) {\n langPackKey = isMe ? 'Chat.Service.TopicEdited.You.Mixed.IconRemoved' : 'Chat.Service.TopicEdited.Mixed.IconRemoved';\n args.push(titleElement);\n } else if(isIconChanged && isTitleChanged) {\n langPackKey = isMe ? 'Chat.Service.TopicEdited.You.Mixed' : 'Chat.Service.TopicEdited.Mixed';\n args.push(wrapMessageActionTopicIconAndName(options));\n } else if(isIconRemoved) {\n langPackKey = isMe ? 'Chat.Service.Group.TopicEdited.You.Icon.Removed' : 'Chat.Service.Group.TopicEdited.Icon.Removed';\n } else if(isTitleChanged) {\n langPackKey = isMe ? 'Chat.Service.Group.TopicEdited.You.Title' : 'Chat.Service.Group.TopicEdited.Title';\n args.push(titleElement);\n } else if(isIconChanged) {\n langPackKey = isMe ? 'Chat.Service.Group.TopicEdited.You.Icon' : 'Chat.Service.Group.TopicEdited.Icon';\n args.push(iconElement);\n } else if(isHiddenChanged) {\n langPackKey = isMe ?\n (action.hidden ? 'Chat.Service.Group.TopicEdited.You.Hided' : 'Chat.Service.Group.TopicEdited.You.Unhided') :\n (action.hidden ? 'Chat.Service.Group.TopicEdited.Hided' : 'Chat.Service.Group.TopicEdited.Unhided');\n }\n\n break;\n }\n\n case 'messageActionTopicCreate': {\n args = [wrapMessageActionTopicIconAndName(options)];\n langPackKey = 'TopicWasCreatedAction';\n break;\n }\n\n case 'messageActionSetChatTheme': {\n const isMe = !!message.pFlags.out;\n let authorElement: ReturnType;\n if(!isMe) {\n authorElement = getNameDivHTML(message.fromId, plain);\n }\n\n args = authorElement ? [authorElement] : [];\n\n if(action.emoticon) {\n args.push(wrapEmojiText(action.emoticon));\n langPackKey = isMe ? 'ChatThemeChangedYou' : 'ChatThemeChangedTo';\n } else {\n langPackKey = isMe ? 'ChatThemeDisabledYou' : 'ChatThemeDisabled';\n }\n break;\n }\n\n default:\n langPackKey = (langPack[_] || `[${action._}]`) as any;\n break;\n }\n\n if(!langPackKey) {\n langPackKey = langPack[_];\n if(langPackKey === undefined) {\n langPackKey = '[' + _ + ']' as any;\n }\n }\n\n const waited = args && await Promise.all(args);\n\n if(plain) {\n return I18n.format(langPackKey, true, waited);\n } else {\n // if(waited && noLinks) {\n // waited = waited.map((arg) => arg instanceof HTMLAnchorElement ? arg.textContent : arg);\n // }\n\n return _i18n(element, langPackKey, waited);\n }\n\n // str = !langPackKey || langPackKey[0].toUpperCase() === langPackKey[0] ? langPackKey : getNameDivHTML(message.fromId) + langPackKey + (suffix ? ' ' : '');\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport assumeType from '../../helpers/assumeType';\nimport htmlToDocumentFragment from '../../helpers/dom/htmlToDocumentFragment';\nimport {getRestrictionReason} from '../../helpers/restrictions';\nimport escapeRegExp from '../../helpers/string/escapeRegExp';\nimport limitSymbols from '../../helpers/string/limitSymbols';\nimport {Message, DocumentAttribute, DraftMessage} from '../../layer';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport {MyDraftMessage} from '../../lib/appManagers/appDraftsManager';\nimport {MyMessage} from '../../lib/appManagers/appMessagesManager';\nimport isMessageRestricted from '../../lib/appManagers/utils/messages/isMessageRestricted';\nimport I18n, {LangPackKey, i18n, UNSUPPORTED_LANG_PACK_KEY} from '../../lib/langPack';\nimport parseEntities from '../../lib/richTextProcessor/parseEntities';\nimport sortEntities from '../../lib/richTextProcessor/sortEntities';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport wrapPlainText from '../../lib/richTextProcessor/wrapPlainText';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\nimport rootScope from '../../lib/rootScope';\nimport {Modify} from '../../types';\nimport wrapMessageActionTextNew, {WrapMessageActionTextOptions} from './messageActionTextNew';\n\nexport type WrapMessageForReplyOptions = Modify & {\n text?: string,\n usingMids?: number[],\n highlightWord?: string,\n withoutMediaType?: boolean\n};\n\n// export default async function wrapMessageForReply(message: MyMessage | MyDraftMessage, text: string, usingMids: number[], plain: true, highlightWord?: string, withoutMediaType?: boolean): Promise;\n// export default async function wrapMessageForReply(message: MyMessage | MyDraftMessage, text?: string, usingMids?: number[], plain?: false, highlightWord?: string, withoutMediaType?: boolean): Promise;\n// export default async function wrapMessageForReply(message: MyMessage | MyDraftMessage, text: string = (message as Message.message).message, usingMids?: number[], plain?: boolean, highlightWord?: string, withoutMediaType?: boolean): Promise {\nexport default async function wrapMessageForReply(\n options: T\n): Promise {\n let {message, text, usingMids, plain, highlightWord, withoutMediaType} = options;\n text ??= (message as Message.message).message;\n\n const parts: (Node | string)[] = [];\n\n let hasAlbumKey = false;\n const addPart = (langKey: LangPackKey, part?: string | HTMLElement | DocumentFragment) => {\n if(langKey) {\n if(part === undefined && hasAlbumKey) {\n return;\n }\n\n part = plain ? I18n.format(langKey, true) : i18n(langKey);\n }\n\n if(plain) {\n parts.push(part);\n } else {\n const el = document.createElement('span');\n if(typeof(part) === 'string') el.innerHTML = part;\n else el.append(part);\n parts.push(el);\n }\n };\n\n const managers = rootScope.managers;\n const appMessagesManager = managers.appMessagesManager;\n\n const isRestricted = isMessageRestricted(message as any);\n\n let entities = (message as Message.message).totalEntities ?? (message as DraftMessage.draftMessage).entities;\n if((message as Message.message).media && !isRestricted) {\n assumeType(message);\n let usingFullAlbum = true;\n if(message.grouped_id) {\n if(usingMids) {\n const mids = await appMessagesManager.getMidsByMessage(message);\n if(usingMids.length === mids.length) {\n for(const mid of mids) {\n if(!usingMids.includes(mid)) {\n usingFullAlbum = false;\n break;\n }\n }\n } else {\n usingFullAlbum = false;\n }\n }\n\n if(usingFullAlbum) {\n const albumText = await appMessagesManager.getAlbumText(message.grouped_id);\n text = albumText?.message || '';\n entities = albumText?.totalEntities || [];\n\n if(!withoutMediaType) {\n addPart('AttachAlbum');\n hasAlbumKey = true;\n }\n }\n } else {\n usingFullAlbum = false;\n }\n\n if((!usingFullAlbum && !withoutMediaType) || !text) {\n const media = message.media;\n switch(media._) {\n case 'messageMediaPhoto':\n addPart('AttachPhoto');\n break;\n case 'messageMediaDice':\n addPart(undefined, plain ? media.emoticon : wrapEmojiText(media.emoticon));\n break;\n case 'messageMediaVenue': {\n text = media.title;\n addPart('AttachLocation');\n break;\n }\n case 'messageMediaGeo':\n addPart('AttachLocation');\n break;\n case 'messageMediaGeoLive':\n addPart('AttachLiveLocation');\n break;\n case 'messageMediaPoll':\n const f = '📊' + ' ' + (media.poll.question || 'poll');\n addPart(undefined, plain ? f : wrapEmojiText(f));\n break;\n case 'messageMediaContact':\n addPart('AttachContact');\n break;\n case 'messageMediaGame': {\n const f = '🎮' + ' ' + media.game.title;\n addPart(undefined, plain ? f : wrapEmojiText(f));\n break;\n }\n case 'messageMediaDocument': {\n const document = media.document as MyDocument;\n\n if(document.type === 'video') {\n addPart('AttachVideo');\n } else if(document.type === 'voice') {\n addPart('AttachAudio');\n } else if(document.type === 'gif') {\n addPart('AttachGif');\n } else if(document.type === 'round') {\n addPart('AttachRound');\n } else if(document.type === 'sticker') {\n const i = parts.length;\n if(document.stickerEmojiRaw) {\n const f = document.stickerEmojiRaw + ' ';\n addPart(undefined, plain ? f : wrapEmojiText(f));\n }\n\n addPart('AttachSticker');\n\n // will combine two parts into one\n const p = parts.splice(i, 2);\n if(plain) parts.push((p[0] as string) + (p[1] ? p[1] as string : ''));\n else {\n const span = window.document.createElement('span');\n span.append(...p);\n parts.push(span);\n }\n\n text = '';\n } else if(document.type === 'audio') {\n const attribute = document.attributes.find((attribute) => attribute._ === 'documentAttributeAudio' && (attribute.title || attribute.performer)) as DocumentAttribute.documentAttributeAudio;\n const f = '🎵' + ' ' + (attribute ? [attribute.title, attribute.performer].filter(Boolean).join(' - ') : document.file_name);\n addPart(undefined, plain ? f : wrapEmojiText(f));\n } else {\n addPart(undefined, plain ? document.file_name : wrapEmojiText(document.file_name));\n }\n\n break;\n }\n\n case 'messageMediaInvoice': {\n if(media.extended_media?._ === 'messageExtendedMediaPreview') {\n addPart(undefined, plain ? media.description : wrapEmojiText(media.description));\n } else {\n addPart(undefined, plain ? media.title : wrapEmojiText(media.title));\n }\n\n break;\n }\n\n case 'messageMediaUnsupported': {\n addPart(UNSUPPORTED_LANG_PACK_KEY);\n break;\n }\n\n default:\n // messageText += media._;\n // /////appMessagesManager.log.warn('Got unknown media type!', message);\n break;\n }\n }\n\n const length = parts.length;\n for(let i = 1; i < length; i += 2) {\n parts.splice(i, 0, ', ');\n }\n\n if(text && length) {\n parts.push(', ');\n }\n }\n\n if((message as Message.messageService).action) {\n const actionWrapped = await wrapMessageActionTextNew({\n message: (message as Message.messageService),\n plain,\n noLinks: true\n });\n\n if(actionWrapped) {\n addPart(undefined, actionWrapped);\n }\n }\n\n if(isRestricted) {\n text = getRestrictionReason((message as Message.message).restriction_reason).text;\n entities = [];\n }\n\n if(text) {\n text = limitSymbols(text, 100);\n\n entities ??= parseEntities(text);\n\n if(plain) {\n parts.push(wrapPlainText(text, entities));\n } else {\n // let entities = parseEntities(text.replace(/\\n/g, ' '));\n\n if(highlightWord) {\n highlightWord = highlightWord.trim();\n let found = false;\n let match: any;\n const regExp = new RegExp(escapeRegExp(highlightWord), 'gi');\n entities = entities.slice(); // fix leaving highlight entity\n while((match = regExp.exec(text)) !== null) {\n entities.push({_: 'messageEntityHighlight', length: highlightWord.length, offset: match.index});\n found = true;\n }\n\n if(found) {\n sortEntities(entities);\n }\n }\n\n const messageWrapped = wrapRichText(text, {\n noLinebreaks: true,\n entities,\n noLinks: true,\n noTextFormat: true\n });\n\n parts.push(htmlToDocumentFragment(messageWrapped));\n }\n }\n\n if(plain) {\n return parts.join('') as any;\n } else {\n const fragment = document.createDocumentFragment();\n fragment.append(...parts);\n return fragment as any;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PeerTitle, {PeerTitleOptions} from '../peerTitle';\n\nexport default async function wrapPeerTitle(options: PeerTitleOptions) {\n const peerTitle = new PeerTitle();\n await peerTitle.update(options);\n return peerTitle.element;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport renderMediaWithFadeIn from '../../helpers/dom/renderMediaWithFadeIn';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport {Message, PhotoSize, VideoSize, WebDocument} from '../../layer';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport {MyPhoto} from '../../lib/appManagers/appPhotosManager';\nimport rootScope from '../../lib/rootScope';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport ProgressivePreloader from '../preloader';\nimport blur from '../../helpers/blur';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getStrippedThumbIfNeeded from '../../helpers/getStrippedThumbIfNeeded';\nimport setAttachmentSize from '../../helpers/setAttachmentSize';\nimport choosePhotoSize from '../../lib/appManagers/utils/photos/choosePhotoSize';\nimport type {ThumbCache} from '../../lib/storages/thumbs';\nimport appDownloadManager from '../../lib/appManagers/appDownloadManager';\nimport isWebDocument from '../../lib/appManagers/utils/webDocs/isWebDocument';\nimport createVideo from '../../helpers/dom/createVideo';\nimport noop from '../../helpers/noop';\nimport {THUMB_TYPE_FULL} from '../../lib/mtproto/mtproto_config';\nimport {Middleware} from '../../helpers/middleware';\nimport liteMode from '../../helpers/liteMode';\n\nexport default async function wrapPhoto({photo, message, container, boxWidth, boxHeight, withTail, isOut, lazyLoadQueue, middleware, size, withoutPreloader, loadPromises, autoDownloadSize, noBlur, noThumb, noFadeIn, blurAfter, managers = rootScope.managers, processUrl}: {\n photo: MyPhoto | MyDocument | WebDocument,\n message?: Message.message | Message.messageService,\n container: HTMLElement,\n boxWidth?: number,\n boxHeight?: number,\n withTail?: boolean,\n isOut?: boolean,\n lazyLoadQueue?: LazyLoadQueue,\n middleware?: Middleware,\n size?: PhotoSize | Extract,\n withoutPreloader?: boolean,\n loadPromises?: Promise[],\n autoDownloadSize?: number,\n noBlur?: boolean,\n noThumb?: boolean,\n noFadeIn?: boolean,\n blurAfter?: boolean,\n managers?: AppManagers,\n processUrl?: (url: string) => Promise\n}) {\n const ret = {\n loadPromises: {\n thumb: Promise.resolve() as Promise,\n full: Promise.resolve() as Promise\n },\n images: {\n thumb: null as HTMLImageElement | HTMLCanvasElement,\n full: null as HTMLVideoElement | HTMLImageElement\n },\n preloader: null as ProgressivePreloader,\n aspecter: null as HTMLElement\n };\n\n const isDocument = photo._ === 'document';\n const isImageFromDocument = isDocument && photo.mime_type.startsWith('image/') && !size;\n const isWebDoc = isWebDocument(photo);\n if(!((photo as MyPhoto).sizes || (photo as MyDocument).thumbs) && !isWebDoc && !isImageFromDocument) {\n if(boxWidth && boxHeight && !size && isDocument) {\n setAttachmentSize(photo, container, boxWidth, boxHeight, undefined, message);\n }\n\n return ret;\n }\n\n let noAutoDownload = autoDownloadSize === 0;\n\n if(!size) {\n if(boxWidth === undefined) boxWidth = mediaSizes.active.regular.width;\n if(boxHeight === undefined) boxHeight = mediaSizes.active.regular.height;\n }\n\n container.classList.add('media-container');\n let aspecter = container;\n\n let isFit = true;\n let loadThumbPromise: Promise = Promise.resolve();\n let thumbImage: HTMLImageElement | HTMLCanvasElement;\n // let image: HTMLImageElement;\n let cacheContext: ThumbCache;\n // if(withTail) {\n // image = wrapMediaWithTail(photo, message, container, boxWidth, boxHeight, isOut);\n // } else {\n\n if(boxWidth && boxHeight && !size) { // !album\n const set = setAttachmentSize(\n photo,\n container,\n boxWidth,\n boxHeight,\n undefined,\n message,\n undefined,\n isImageFromDocument ? {\n _: 'photoSize',\n w: photo.w,\n h: photo.h,\n size: photo.size,\n type: THUMB_TYPE_FULL\n } : undefined\n );\n size = set.photoSize;\n isFit = set.isFit;\n cacheContext = await managers.thumbsStorage.getCacheContext(photo, size.type);\n\n if(!isFit && !isWebDoc) {\n aspecter = document.createElement('div');\n aspecter.classList.add('media-container-aspecter');\n aspecter.style.width = set.size.width + 'px';\n aspecter.style.height = set.size.height + 'px';\n\n const gotThumb = getStrippedThumbIfNeeded(photo, cacheContext, !noBlur, true);\n if(gotThumb) {\n loadThumbPromise = gotThumb.loadPromise;\n const thumbImage = gotThumb.image; // local scope\n thumbImage.classList.add('media-photo');\n container.append(thumbImage);\n } else {\n const res = await wrapPhoto({\n container,\n message,\n photo,\n boxWidth: 0,\n boxHeight: 0,\n size,\n lazyLoadQueue,\n isOut,\n loadPromises,\n middleware,\n withoutPreloader,\n withTail,\n autoDownloadSize,\n noBlur,\n noThumb: true,\n blurAfter: true,\n managers\n // noFadeIn: true\n });\n const thumbImage = res.images.full;\n thumbImage.classList.add('media-photo', 'thumbnail');\n // container.append(thumbImage);\n }\n\n container.classList.add('media-container-fitted');\n container.append(aspecter);\n }\n } else {\n if(!size) {\n size = choosePhotoSize(photo, boxWidth, boxHeight, true);\n }\n\n cacheContext = await managers.thumbsStorage.getCacheContext(photo, size?.type);\n }\n\n if(!noThumb && !isWebDoc) {\n const gotThumb = getStrippedThumbIfNeeded(photo, cacheContext, !noBlur);\n if(gotThumb) {\n loadThumbPromise = Promise.all([loadThumbPromise, gotThumb.loadPromise]);\n ret.loadPromises.thumb = ret.loadPromises.full = loadThumbPromise;\n thumbImage = ret.images.thumb = gotThumb.image;\n thumbImage.classList.add('media-photo');\n aspecter.append(thumbImage);\n }\n }\n // }\n\n ret.aspecter = aspecter;\n\n if((size?._ === 'photoSizeEmpty' && isDocument) || (size as PhotoSize.photoStrippedSize)?.bytes) {\n return ret;\n }\n\n let media: HTMLVideoElement | HTMLImageElement;\n if(size?._ === 'videoSize') {\n media = ret.images.full = createVideo();\n media.autoplay = true;\n media.loop = true;\n media.muted = true;\n media.classList.add('media-photo');\n } else {\n media = ret.images.full = new Image();\n media.classList.add('media-photo');\n }\n\n // console.log('wrapPhoto downloaded:', photo, photo.downloaded, container);\n\n const needFadeIn = (thumbImage || !cacheContext.downloaded) && liteMode.isAvailable('animations') && !noFadeIn;\n\n let preloader: ProgressivePreloader;\n const uploadingFileName = (message as Message.message)?.uploadingFileName;\n if(!withoutPreloader) {\n if(!cacheContext.downloaded || uploadingFileName) {\n preloader = new ProgressivePreloader({\n attachMethod: 'prepend',\n isUpload: !!uploadingFileName\n });\n }\n\n if(uploadingFileName) { // means upload\n preloader.attachPromise(appDownloadManager.getUpload(uploadingFileName));\n preloader.attach(container);\n noAutoDownload = undefined;\n }\n }\n\n\n const getDownloadPromise = () => {\n // const promise = isGif && !size ?\n // managers.appDocsManager.downloadDoc(photo, /* undefined, */lazyLoadQueue?.queueId) :\n // managers.appPhotosManager.preloadPhoto(photo, size, lazyLoadQueue?.queueId, noAutoDownload);\n const haveToDownload = isImageFromDocument && !size;\n const promise = appDownloadManager.downloadMediaURL({\n media: photo,\n thumb: size,\n queueId: lazyLoadQueue?.queueId,\n onlyCache: haveToDownload ? undefined : noAutoDownload\n });\n\n return promise;\n };\n\n const renderOnLoad = (url: string) => {\n return renderMediaWithFadeIn(container, media, url, needFadeIn, aspecter, thumbImage);\n };\n\n const onLoad = async(url: string) => {\n if(middleware && !middleware()) return;\n\n if(processUrl) {\n url = await processUrl(url);\n }\n\n if(blurAfter) {\n const result = blur(url, 12);\n return result.promise.then(() => {\n // image = result.canvas;\n return renderOnLoad(result.canvas.toDataURL());\n });\n }\n\n return renderOnLoad(url);\n };\n\n let loadPromise: Promise;\n const canAttachPreloader = (\n (size as PhotoSize.photoSize).w >= 150 &&\n (size as PhotoSize.photoSize).h >= 150\n ) || noAutoDownload;\n const load = async() => {\n if(noAutoDownload && !withoutPreloader && preloader) {\n preloader.construct();\n preloader.setManual();\n }\n\n const promise = getDownloadPromise();\n const cacheContext = await managers.thumbsStorage.getCacheContext(photo, size?.type);\n if(\n preloader &&\n !cacheContext.downloaded &&\n !withoutPreloader &&\n canAttachPreloader\n ) {\n preloader.attach(container, false, promise);\n }\n\n noAutoDownload = undefined;\n\n const renderPromise = promise.then(onLoad);\n renderPromise.catch(noop);\n return {download: promise, render: renderPromise};\n };\n\n if(preloader) {\n preloader.setDownloadFunction(load);\n }\n\n if(cacheContext.downloaded) {\n loadThumbPromise = loadPromise = (await load()).render;\n } else {\n if(!lazyLoadQueue) loadPromise = (await load()).render;\n /* else if(noAutoDownload) {\n preloader.construct();\n preloader.setManual();\n preloader.attach(container);\n } */ else lazyLoadQueue.push({div: container, load: () => load().then(({download}) => download)});\n }\n\n if(loadPromises && loadThumbPromise) {\n loadPromises.push(loadThumbPromise);\n }\n\n // const perf = performance.now();\n await loadThumbPromise;\n ret.loadPromises.thumb = loadThumbPromise;\n ret.loadPromises.full = loadPromise || Promise.resolve();\n ret.preloader = preloader;\n\n // const elapsedTime = performance.now() - perf;\n // if(elapsedTime > 4) {\n // console.log('wrapping photo thumb time', elapsedTime, photo, size);\n // }\n\n return ret;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {hexToRgb} from '../../helpers/color';\nimport {Message} from '../../layer';\nimport getPeerColorById from '../../lib/appManagers/utils/peers/getPeerColorById';\nimport {AnimationItemGroup} from '../animationIntersector';\nimport ReplyContainer from '../chat/replyContainer';\n\nexport default function wrapReply(\n title: Parameters[0],\n subtitle: Parameters[1],\n animationGroup: AnimationItemGroup,\n message?: Message.message | Message.messageService,\n setColorPeerId?: PeerId\n) {\n const replyContainer = new ReplyContainer('reply', animationGroup);\n const fillPromise = replyContainer.fill(title, subtitle, message);\n\n if(setColorPeerId) {\n const hex = getPeerColorById(setColorPeerId, false);\n const [r, g, b] = hexToRgb(hex);\n replyContainer.container.style.setProperty('--override-color', `${r}, ${g}, ${b}`);\n replyContainer.container.classList.add('is-overriding-color');\n // replyContainer.border.style.backgroundColor = hex;\n // replyContainer.title.style.color = hex;\n }\n\n return {container: replyContainer.container, fillPromise};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MyMessage} from '../../lib/appManagers/appMessagesManager';\nimport getMessageSenderPeerIdOrName from '../../lib/appManagers/utils/messages/getMessageSenderPeerIdOrName';\nimport {i18n} from '../../lib/langPack';\nimport rootScope from '../../lib/rootScope';\nimport wrapPeerTitle from './peerTitle';\n\nexport default async function wrapSenderToPeer(message: MyMessage) {\n const senderTitle: HTMLElement = document.createElement('span');\n senderTitle.classList.add('sender-title');\n\n const fromMe = message.fromId === rootScope.myId && message.peerId !== rootScope.myId;\n senderTitle.append(\n fromMe ?\n i18n('FromYou') :\n await wrapPeerTitle({\n ...getMessageSenderPeerIdOrName(message),\n dialog: message.peerId === rootScope.myId\n })\n );\n\n if(await rootScope.managers.appPeersManager.isAnyGroup(message.peerId) || fromMe) {\n const peerTitle = await wrapPeerTitle({peerId: message.peerId});\n senderTitle.append(' ➝ ', peerTitle);\n }\n\n return senderTitle;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {formatDateAccordingToTodayNew} from '../../helpers/date';\nimport {MyMessage} from '../../lib/appManagers/appMessagesManager';\n\nexport default function wrapSentTime(message: MyMessage) {\n const el: HTMLElement = document.createElement('span');\n el.classList.add('sent-time');\n el.append(formatDateAccordingToTodayNew(new Date(message.date * 1000)));\n\n return el;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_WEBP_SUPPORTED from '../../environment/webpSupport';\nimport assumeType from '../../helpers/assumeType';\nimport getPathFromBytes from '../../helpers/bytes/getPathFromBytes';\nimport deferredPromise from '../../helpers/cancellablePromise';\nimport computeLockColor from '../../helpers/computeLockColor';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport createVideo from '../../helpers/dom/createVideo';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport renderImageFromUrl, {renderImageFromUrlPromise} from '../../helpers/dom/renderImageFromUrl';\nimport getImageFromStrippedThumb from '../../helpers/getImageFromStrippedThumb';\nimport getPreviewURLFromThumb from '../../helpers/getPreviewURLFromThumb';\nimport makeError from '../../helpers/makeError';\nimport {makeMediaSize} from '../../helpers/mediaSize';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport {Middleware} from '../../helpers/middleware';\nimport onMediaLoad from '../../helpers/onMediaLoad';\nimport {isSavingLottiePreview, saveLottiePreview} from '../../helpers/saveLottiePreview';\nimport throttle from '../../helpers/schedulers/throttle';\nimport sequentialDom from '../../helpers/sequentialDom';\nimport {PhotoSize, VideoSize} from '../../layer';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport appDownloadManager from '../../lib/appManagers/appDownloadManager';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getServerMessageId from '../../lib/appManagers/utils/messageId/getServerMessageId';\nimport choosePhotoSize from '../../lib/appManagers/utils/photos/choosePhotoSize';\nimport getStickerEffectThumb from '../../lib/appManagers/utils/stickers/getStickerEffectThumb';\nimport lottieLoader from '../../lib/rlottie/lottieLoader';\nimport type RLottiePlayer from '../../lib/rlottie/rlottiePlayer';\nimport rootScope from '../../lib/rootScope';\nimport type {ThumbCache} from '../../lib/storages/thumbs';\nimport webpWorkerController from '../../lib/webp/webpWorkerController';\nimport {Awaited, SendMessageEmojiInteractionData} from '../../types';\nimport {getEmojiToneIndex} from '../../vendor/emoji';\nimport animationIntersector, {AnimationItemGroup} from '../animationIntersector';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport PopupStickers from '../popups/stickers';\nimport {hideToast, toastNew} from '../toast';\nimport wrapStickerAnimation from './stickerAnimation';\nimport framesCache from '../../helpers/framesCache';\nimport {IS_MOBILE} from '../../environment/userAgent';\nimport liteMode, {LiteModeKey} from '../../helpers/liteMode';\n\n// https://github.com/telegramdesktop/tdesktop/blob/master/Telegram/SourceFiles/history/view/media/history_view_sticker.cpp#L40\nexport const STICKER_EFFECT_MULTIPLIER = 1 + 0.245 * 2;\nconst EMOJI_EFFECT_MULTIPLIER = 3;\n\nconst locksUrls: {[docId: string]: string} = {};\n\nexport const videosCache: {[key: string]: Promise} = {};\n\nconst onAnimationEnd = (element: HTMLElement, onAnimationEnd: () => void, timeout: number) => {\n const onEnd = () => {\n element.removeEventListener('animationend', onEnd);\n onAnimationEnd();\n clearTimeout(_timeout);\n };\n element.addEventListener('animationend', onEnd);\n const _timeout = setTimeout(onEnd, timeout);\n};\n\nexport default async function wrapSticker({doc, div, middleware, loadStickerMiddleware, lazyLoadQueue, exportLoad, group, play, onlyThumb, emoji, width, height, withThumb, loop, loadPromises, needFadeIn, needUpscale, skipRatio, static: asStatic, managers = rootScope.managers, fullThumb, isOut, noPremium, withLock, relativeEffect, loopEffect, isCustomEmoji, syncedVideo, liteModeKey, isEffect}: {\n doc: MyDocument,\n div: HTMLElement | HTMLElement[],\n middleware?: Middleware,\n loadStickerMiddleware?: Middleware,\n lazyLoadQueue?: LazyLoadQueue,\n exportLoad?: number,\n group?: AnimationItemGroup,\n play?: boolean,\n onlyThumb?: boolean,\n emoji?: string,\n width?: number,\n height?: number,\n withThumb?: boolean,\n loop?: RLottiePlayer['loop'],\n loadPromises?: Promise[],\n needFadeIn?: boolean,\n needUpscale?: boolean,\n skipRatio?: number,\n static?: boolean,\n managers?: AppManagers,\n fullThumb?: PhotoSize | Extract,\n isOut?: boolean,\n noPremium?: boolean,\n withLock?: boolean,\n relativeEffect?: boolean,\n loopEffect?: boolean,\n isCustomEmoji?: boolean,\n syncedVideo?: boolean,\n liteModeKey?: LiteModeKey | false,\n isEffect?: boolean\n}) {\n div = Array.isArray(div) ? div : [div];\n\n liteModeKey ??= 'stickers_panel';\n\n if(isCustomEmoji) {\n emoji = doc.stickerEmojiRaw;\n }\n\n const stickerType = doc.sticker;\n if(stickerType === 1) {\n asStatic = true;\n }\n\n if(!width && !height) {\n const sizes = mediaSizes.active;\n const boxSize = emoji ? sizes.emojiSticker : (doc.animated ? sizes.animatedSticker : sizes.staticSticker);\n const size = makeMediaSize(doc.w, doc.h).aspectFitted(boxSize);\n width = size.width;\n height = size.height;\n }\n\n if(stickerType === 2) {\n // LottieLoader.loadLottie();\n lottieLoader.loadLottieWorkers();\n }\n\n loop = !!(!emoji || isCustomEmoji) && loop;\n\n div.forEach((div) => {\n div.dataset.docId = '' + doc.id;\n if(emoji) {\n div.dataset.stickerEmoji = emoji;\n }\n\n div.dataset.stickerPlay = '' + +(play || false);\n div.dataset.stickerLoop = '' + +(loop || false);\n\n div.classList.add('media-sticker-wrapper');\n });\n\n if(play && !liteMode.isAvailable(liteModeKey) && !isCustomEmoji && !isEffect) {\n play = false;\n loop = false;\n }\n\n /* if(stickerType === 3) {\n const videoRes = wrapVideo({\n doc,\n boxWidth: width,\n boxHeight: height,\n container: div,\n group,\n lazyLoadQueue,\n middleware,\n withoutPreloader: true,\n loadPromises,\n noPlayButton: true,\n noInfo: true\n });\n\n if(videoRes.thumb) {\n if(videoRes.thumb.images.thumb) {\n videoRes.thumb.images.thumb.classList.add('media-sticker', 'thumbnail');\n }\n\n if(videoRes.thumb.images.full) {\n videoRes.thumb.images.full.classList.add('media-sticker');\n }\n }\n\n return videoRes.loadPromise;\n } */\n\n // console.log('wrap sticker', doc, div, onlyThumb);\n\n let cacheContext: ThumbCache;\n const getCacheContext = async(type: string = cacheContext?.type) => {\n return cacheContext = await managers.thumbsStorage.getCacheContext(doc, type);\n };\n\n const isAnimated = !asStatic && (stickerType === 2 || stickerType === 3);\n\n const effectThumb = getStickerEffectThumb(doc);\n if(isOut !== undefined && effectThumb && !isOut) {\n div.forEach((div) => div.classList.add('reflect-x'));\n }\n\n const willHaveLock = effectThumb && withLock;\n if(willHaveLock) {\n const lockUrl = locksUrls[doc.id];\n div.forEach((div) => {\n div.classList.add('is-premium-sticker', 'tgico-premium_lock');\n lockUrl && div.style.setProperty('--lock-url', `url(${lockUrl})`);\n });\n }\n\n if(asStatic && stickerType !== 1) {\n const thumb = choosePhotoSize(doc, width, height, false) as PhotoSize.photoSize;\n await getCacheContext(thumb.type);\n } else {\n await getCacheContext(fullThumb?.type);\n }\n\n const toneIndex = emoji && !isCustomEmoji ? getEmojiToneIndex(emoji) : -1;\n const downloaded = cacheContext.downloaded && !needFadeIn;\n\n const isThumbNeededForType = isAnimated;\n const lottieCachedThumb = stickerType === 2 || stickerType === 3 ? await managers.appDocsManager.getLottieCachedThumb(doc.id, toneIndex) : undefined;\n\n const ret = {render: undefined as typeof loadPromise, load: undefined as typeof load};\n let loadThumbPromise = deferredPromise();\n let haveThumbCached = false;\n if((\n doc.thumbs?.length ||\n lottieCachedThumb\n ) &&\n !div[0].firstElementChild && (\n !downloaded ||\n isThumbNeededForType ||\n onlyThumb\n ) && withThumb !== false/* && doc.thumbs[0]._ !== 'photoSizeEmpty' */\n ) {\n let thumb = lottieCachedThumb || doc.thumbs[0];\n\n // console.log('wrap sticker', thumb, div);\n\n const afterRender = (div: HTMLElement, thumbImage: HTMLElement) => {\n if(!div.childElementCount) {\n sequentialDom.mutateElement(div, () => {\n if(!div.childElementCount) {\n thumbImage.classList.add('media-sticker', 'thumbnail');\n div.append(thumbImage);\n }\n\n loadThumbPromise.resolve();\n });\n } else {\n loadThumbPromise.resolve();\n }\n };\n\n if('url' in thumb) {\n haveThumbCached = true;\n div.forEach((div) => {\n const thumbImage = new Image();\n renderImageFromUrl(thumbImage, (thumb as any).url, () => afterRender(div, thumbImage));\n });\n } else if('bytes' in thumb) {\n if(thumb._ === 'photoPathSize') {\n if(!thumb.bytes.length) {\n thumb = doc.thumbs.find((t) => (t as PhotoSize.photoStrippedSize).bytes?.length) || thumb;\n }\n\n const d = getPathFromBytes((thumb as PhotoSize.photoStrippedSize).bytes);\n const ns = 'http://www.w3.org/2000/svg';\n const svg = document.createElementNS(ns, 'svg');\n svg.classList.add('rlottie-vector', 'media-sticker', 'thumbnail');\n svg.setAttributeNS(null, 'viewBox', `0 0 ${doc.w || 512} ${doc.h || 512}`);\n\n // const defs = document.createElementNS(ns, 'defs');\n // const linearGradient = document.createElementNS(ns, 'linearGradient');\n // linearGradient.setAttributeNS(null, 'id', 'g');\n // linearGradient.setAttributeNS(null, 'x1', '-300%');\n // linearGradient.setAttributeNS(null, 'x2', '-200%');\n // linearGradient.setAttributeNS(null, 'y1', '0');\n // linearGradient.setAttributeNS(null, 'y2', '0');\n // const stops = [\n // ['-10%', '.1'],\n // ['30%', '.07'],\n // ['70%', '.07'],\n // ['110%', '.1']\n // ].map(([offset, stopOpacity]) => {\n // const stop = document.createElementNS(ns, 'stop');\n // stop.setAttributeNS(null, 'offset', offset);\n // stop.setAttributeNS(null, 'stop-opacity', stopOpacity);\n // return stop;\n // });\n // const animates = [\n // ['-300%', '1200%'],\n // ['-200%', '1300%']\n // ].map(([from, to], idx) => {\n // const animate = document.createElementNS(ns, 'animate');\n // animate.setAttributeNS(null, 'attributeName', 'x' + (idx + 1));\n // animate.setAttributeNS(null, 'from', from);\n // animate.setAttributeNS(null, 'to', to);\n // animate.setAttributeNS(null, 'dur', '3s');\n // animate.setAttributeNS(null, 'repeatCount', 'indefinite');\n // return animate;\n // });\n // linearGradient.append(...stops, ...animates);\n // defs.append(linearGradient);\n // svg.append(defs);\n\n const path = document.createElementNS(ns, 'path');\n path.setAttributeNS(null, 'd', d);\n if(liteMode.isAvailable('animations') && !isCustomEmoji) path.setAttributeNS(null, 'fill', 'url(#g)');\n svg.append(path);\n div.forEach((div, idx) => div.append(idx > 0 ? svg.cloneNode(true) : svg));\n haveThumbCached = true;\n loadThumbPromise.resolve();\n } else if(toneIndex <= 0) {\n const r = () => {\n (div as HTMLElement[]).forEach((div) => {\n const thumbImage = new Image();\n const url = getPreviewURLFromThumb(doc, thumb as PhotoSize.photoStrippedSize, true);\n renderImageFromUrl(thumbImage, url, () => afterRender(div, thumbImage));\n });\n };\n\n if((IS_WEBP_SUPPORTED || doc.pFlags.stickerThumbConverted || cacheContext.url)/* && false */) {\n haveThumbCached = true;\n r();\n } else {\n haveThumbCached = true;\n webpWorkerController.convert('main-' + doc.id, thumb.bytes).then((bytes) => {\n managers.appDocsManager.saveWebPConvertedStrippedThumb(doc.id, bytes);\n (thumb as PhotoSize.photoStrippedSize).bytes = bytes;\n doc.pFlags.stickerThumbConverted = true;\n\n if((middleware && !middleware()) || (div as HTMLElement[])[0].childElementCount) {\n loadThumbPromise.resolve();\n return;\n }\n\n r();\n }).catch(() => loadThumbPromise.resolve());\n }\n }\n } else if(((stickerType === 2 && toneIndex <= 0) || stickerType === 3) && (withThumb || onlyThumb)) {\n const load = async() => {\n if((div as HTMLElement[])[0].childElementCount || (middleware && !middleware())) {\n loadThumbPromise.resolve();\n return;\n }\n\n const r = (div: HTMLElement, thumbImage: HTMLElement, url: string) => {\n if(div.childElementCount || (middleware && !middleware())) {\n loadThumbPromise.resolve();\n return;\n }\n\n if(!url) afterRender(div, thumbImage);\n else renderImageFromUrl(thumbImage, url, () => afterRender(div, thumbImage));\n };\n\n await getCacheContext();\n (div as HTMLElement[]).forEach((div) => {\n if(cacheContext.url) {\n r(div, new Image(), cacheContext.url);\n } else if('bytes' in thumb) {\n const res = getImageFromStrippedThumb(doc, thumb as PhotoSize.photoStrippedSize, true);\n res.loadPromise.then(() => r(div, res.image, ''));\n\n // return managers.appDocsManager.getThumbURL(doc, thumb as PhotoSize.photoStrippedSize).promise.then(r);\n } else {\n appDownloadManager.downloadMediaURL({\n media: doc,\n thumb: thumb as PhotoSize\n }).then(async(url) => {\n return r(div, new Image(), url);\n });\n }\n });\n };\n\n if(lazyLoadQueue && onlyThumb) {\n lazyLoadQueue.push({div: div[0], load});\n loadThumbPromise.resolve();\n return ret;\n } else {\n load();\n\n if((thumb as any).url) {\n haveThumbCached = true;\n }\n }\n }\n }\n\n if(loadPromises && haveThumbCached) {\n loadPromises.push(loadThumbPromise);\n }\n\n if(onlyThumb/* || true */) { // for sticker panel\n return ret;\n }\n\n const middlewareError = makeError('MIDDLEWARE');\n const load = async() => {\n if(middleware && !middleware()) {\n throw middlewareError;\n }\n\n if(stickerType === 2 && !asStatic) {\n const blob = await appDownloadManager.downloadMedia({media: doc, queueId: lazyLoadQueue?.queueId, thumb: fullThumb});\n if(middleware && !middleware()) {\n throw middlewareError;\n }\n\n const animation = await lottieLoader.loadAnimationWorker({\n container: (div as HTMLElement[])[0],\n loop,\n autoplay: play,\n animationData: blob,\n width,\n height,\n name: 'doc' + doc.id,\n needUpscale,\n skipRatio,\n toneIndex,\n sync: isCustomEmoji,\n middleware: loadStickerMiddleware ?? middleware,\n group,\n liteModeKey: liteModeKey || undefined\n });\n\n // const deferred = deferredPromise();\n\n const setLockColor = willHaveLock ? () => {\n const lockUrl = locksUrls[doc.id] ??= computeLockColor(animation.canvas[0]);\n (div as HTMLElement[]).forEach((div) => div.style.setProperty('--lock-url', `url(${lockUrl})`));\n } : undefined;\n\n const onFirstFrame = (container: HTMLElement, canvas: HTMLCanvasElement) => {\n const element = container.firstElementChild !== canvas && container.firstElementChild as HTMLElement;\n if(needFadeIn !== false) {\n needFadeIn = (needFadeIn || !element || element.tagName === 'svg') && liteMode.isAvailable('animations');\n }\n\n const cb = () => {\n if(element && element !== canvas && element.tagName !== 'DIV') {\n element.remove();\n }\n };\n\n if(!needFadeIn) {\n if(element) {\n sequentialDom.mutate(cb);\n }\n } else {\n sequentialDom.mutate(() => {\n canvas && canvas.classList.add('fade-in');\n if(element) {\n element.classList.add('fade-out');\n }\n\n onAnimationEnd(canvas || element, () => {\n sequentialDom.mutate(() => {\n canvas && canvas.classList.remove('fade-in');\n cb();\n });\n }, 400);\n });\n }\n };\n\n animation.addEventListener('firstFrame', () => {\n const canvas = animation.canvas[0];\n if(withThumb !== false || isCustomEmoji) {\n saveLottiePreview(doc, canvas, toneIndex);\n }\n\n if(willHaveLock) {\n setLockColor();\n }\n\n if(!isCustomEmoji) {\n (div as HTMLElement[]).forEach((container, idx) => {\n onFirstFrame(container, animation.canvas[idx]);\n });\n }\n }, {once: true});\n\n if(emoji) {\n managers.appStickersManager.preloadAnimatedEmojiStickerAnimation(emoji);\n }\n\n return animation;\n\n // return deferred;\n // await new Promise((resolve) => setTimeout(resolve, 5e3));\n } else if(asStatic || stickerType === 3) {\n const isSingleVideo = isAnimated && syncedVideo;\n const cacheName = isSingleVideo ? framesCache.generateName('' + doc.id, 0, 0, undefined, undefined) : undefined;\n\n const cachePromise = videosCache[cacheName];\n if(cachePromise) {\n return cachePromise as typeof promise;\n }\n\n const d = isSingleVideo ? (div as HTMLElement[]).slice(0, 1) : div as HTMLElement[];\n const media: HTMLElement[] = d.map(() => {\n let media: HTMLElement;\n if(asStatic) {\n media = new Image();\n } else {\n const video = media = createVideo();\n video.muted = true;\n if(play) video.autoplay = true;\n if(loop) video.loop = true;\n\n if(loop && typeof(loop) === 'number') {\n let previousTime = 0, playedTimes = 0;\n function onTimeupdate(this: HTMLVideoElement) {\n if(previousTime > this.currentTime && ++playedTimes === loop as number) {\n this.autoplay = false;\n this.loop = false;\n this.pause();\n video.removeEventListener('timeupdate', onTimeupdate);\n }\n\n previousTime = this.currentTime;\n }\n\n video.addEventListener('timeupdate', onTimeupdate);\n }\n }\n\n media.classList.add('media-sticker');\n return media;\n });\n\n const thumbImage = (div as HTMLElement[]).map((div, idx) => (div.firstElementChild as HTMLElement) !== media[idx] && div.firstElementChild) as HTMLElement[];\n if(needFadeIn !== false) {\n needFadeIn = (needFadeIn || !downloaded || (asStatic ? thumbImage[0] : (!thumbImage[0] || thumbImage[0].tagName === 'svg'))) && liteMode.isAvailable('animations');\n }\n\n if(needFadeIn) {\n media.forEach((media) => media.classList.add('fade-in'));\n }\n\n const promise = new Promise(async(resolve, reject) => {\n const r = async() => {\n if(middleware && !middleware()) {\n reject(middlewareError);\n return;\n }\n\n const mediaLength = media.length;\n const loaded: HTMLElement[] = [];\n const onLoad = (div: HTMLElement, media: HTMLElement, thumbImage: HTMLElement) => {\n sequentialDom.mutateElement(div, () => {\n if(middleware && !middleware()) {\n reject(middlewareError);\n return;\n }\n\n if(!media) {\n if(!isSingleVideo || !isAnimated) {\n thumbImage?.remove();\n }\n\n return;\n }\n\n if(media as HTMLVideoElement) {\n const w = width * window.devicePixelRatio;\n const h = height * window.devicePixelRatio;\n if(!isSavingLottiePreview(doc, toneIndex, w, h)) {\n // const perf = performance.now();\n const canvas = document.createElement('canvas');\n canvas.width = w;\n canvas.height = h;\n const ctx = canvas.getContext('2d');\n ctx.drawImage(media as HTMLVideoElement, 0, 0, canvas.width, canvas.height);\n saveLottiePreview(doc, canvas, toneIndex);\n // console.log('perf', performance.now() - perf);\n }\n }\n\n if(isSingleVideo) {\n resolve(media as any);\n return;\n }\n\n div.append(media);\n\n if(needFadeIn) {\n thumbImage && thumbImage.classList.add('fade-out');\n onAnimationEnd(media, () => {\n media.classList.remove('fade-in');\n thumbImage?.remove();\n }, 400);\n } else {\n thumbImage?.remove();\n }\n\n if(isAnimated) {\n animationIntersector.addAnimation({\n animation: media as HTMLVideoElement,\n observeElement: div,\n group,\n controlled: middleware,\n liteModeKey: liteModeKey || undefined\n });\n }\n\n if(loaded.push(media) === mediaLength) {\n resolve(loaded as any);\n }\n });\n };\n\n await getCacheContext();\n let lastPromise: Promise;\n (div as HTMLElement[]).forEach((div, idx) => {\n const _media = media[idx];\n const cb = () => onLoad(div, _media, thumbImage[idx]);\n if(_media) lastPromise = renderImageFromUrlPromise(_media, cacheContext.url);\n lastPromise.then(cb);\n });\n };\n\n await getCacheContext();\n if(cacheContext.url) r();\n else {\n let promise: Promise;\n if(stickerType !== 1 && asStatic) {\n const thumb = choosePhotoSize(doc, width, height, false) as PhotoSize.photoSize;\n // promise = managers.appDocsManager.getThumbURL(doc, thumb).promise\n promise = appDownloadManager.downloadMediaURL({media: doc, thumb, queueId: lazyLoadQueue?.queueId});\n } else {\n promise = appDownloadManager.downloadMediaURL({media: doc, queueId: lazyLoadQueue?.queueId});\n }\n\n promise.then(r, reject);\n }\n });\n\n if(cacheName) {\n videosCache[cacheName] = promise as any;\n loadStickerMiddleware && promise.finally(() => {\n if(!loadStickerMiddleware()) {\n delete videosCache[cacheName];\n }\n });\n }\n\n return promise;\n }\n };\n\n if(exportLoad && ((exportLoad === 1 && (!downloaded || isAnimated)) || exportLoad === 2)) {\n ret.load = load;\n return ret;\n }\n\n const loadPromise: Promise> | void> = lazyLoadQueue && (!downloaded || isAnimated) ?\n (lazyLoadQueue.push({div: div[0], load}), Promise.resolve()) :\n load();\n\n if(downloaded && (asStatic/* || stickerType === 3 */)) {\n loadThumbPromise = loadPromise as any;\n if(loadPromises) {\n loadPromises.push(loadThumbPromise);\n }\n }\n\n if(stickerType === 2 && effectThumb && isOut !== undefined && !noPremium) {\n attachStickerEffectHandler({\n container: div[0],\n doc,\n managers,\n middleware,\n isOut,\n width,\n loadPromise,\n relativeEffect,\n loopEffect\n });\n }\n\n ret.render = loadPromise as any;\n return ret;\n}\n\nfunction attachStickerEffectHandler({container, doc, managers, middleware, isOut, width, loadPromise, relativeEffect, loopEffect}: {\n container: HTMLElement,\n doc: MyDocument,\n managers: AppManagers,\n middleware: Middleware,\n isOut: boolean,\n width: number,\n loadPromise: Promise,\n relativeEffect?: boolean,\n loopEffect?: boolean\n}) {\n managers.appStickersManager.preloadSticker(doc.id, true);\n\n let playing = false;\n attachClickEvent(container, async(e) => {\n const isAvailable = liteMode.isAvailable('effects_premiumstickers') || relativeEffect;\n cancelEvent(e);\n if(!e.isTrusted && !isAvailable) {\n return;\n }\n\n if(playing || !isAvailable) {\n const a = document.createElement('a');\n a.onclick = () => {\n hideToast();\n new PopupStickers(doc.stickerSetInput).show();\n };\n\n toastNew({\n langPackKey: 'Sticker.Premium.Click.Info',\n langPackArguments: [a]\n });\n\n return;\n }\n\n playing = true;\n\n await loadPromise;\n const {animationDiv, stickerPromise} = wrapStickerAnimation({\n doc,\n middleware,\n side: isOut ? 'right' : 'left',\n size: width * STICKER_EFFECT_MULTIPLIER,\n target: container,\n play: true,\n fullThumb: getStickerEffectThumb(doc),\n relativeEffect,\n loopEffect\n });\n\n if(isOut !== undefined && !isOut/* && !relativeEffect */) {\n animationDiv.classList.add('reflect-x');\n }\n\n stickerPromise.then((player) => {\n player.addEventListener('destroy', () => {\n playing = false;\n });\n });\n });\n}\n\nexport async function onEmojiStickerClick({event, container, managers, peerId, middleware}: {\n event: Event,\n container: HTMLElement,\n managers: AppManagers,\n peerId: PeerId,\n middleware: Middleware\n}) {\n cancelEvent(event);\n\n const bubble = findUpClassName(container, 'bubble');\n const emoji = container.dataset.stickerEmoji;\n\n const animation = !container.classList.contains('custom-emoji') ? lottieLoader.getAnimation(container) : undefined;\n if(animation?.paused) {\n const doc = await managers.appStickersManager.getAnimatedEmojiSoundDocument(emoji);\n if(doc) {\n const audio = document.createElement('audio');\n audio.style.display = 'none';\n container.parentElement.append(audio);\n\n try {\n const url = await appDownloadManager.downloadMediaURL({media: doc});\n\n audio.src = url;\n audio.play();\n await onMediaLoad(audio, undefined, true);\n\n audio.addEventListener('ended', () => {\n audio.src = '';\n audio.remove();\n }, {once: true});\n } catch(err) {\n\n }\n }\n\n animation.autoplay = true;\n animation.restart();\n }\n\n if(!peerId.isUser() || !liteMode.isAvailable('effects_emoji')) {\n return;\n }\n\n const activeAnimations: Set<{}> = (container as any).activeAnimations ??= new Set();\n if(activeAnimations.size >= (IS_MOBILE ? 3 : 5)) {\n return;\n }\n\n const doc = await managers.appStickersManager.getAnimatedEmojiSticker(emoji, true);\n if(!doc) {\n return;\n }\n\n const data: SendMessageEmojiInteractionData = (container as any).emojiData ??= {\n a: [],\n v: 1\n };\n\n const sendInteractionThrottled: () => void = (container as any).sendInteractionThrottled ??= throttle(() => {\n const length = data.a.length;\n if(!length) {\n return;\n }\n\n const firstTime = data.a[0].t;\n\n data.a.forEach((a) => {\n a.t = (a.t - firstTime) / 1000;\n });\n\n const bubble = findUpClassName(container, 'bubble');\n managers.appMessagesManager.setTyping(appImManager.chat.peerId, {\n _: 'sendMessageEmojiInteraction',\n msg_id: getServerMessageId(+bubble.dataset.mid),\n emoticon: emoji,\n interaction: {\n _: 'dataJSON',\n data: JSON.stringify(data)\n }\n }, true, appImManager.chat.threadId);\n\n data.a.length = 0;\n }, 1000, false);\n\n const o = {};\n activeAnimations.add(o);\n\n const isOut = bubble ? bubble.classList.contains('is-out') : undefined;\n const {animationDiv} = wrapStickerAnimation({\n doc,\n middleware,\n side: isOut ? 'right' : 'left',\n size: 360,\n target: container,\n play: true,\n withRandomOffset: true,\n onUnmount: () => {\n activeAnimations.delete(o);\n }\n });\n\n if(isOut !== undefined && !isOut) {\n animationDiv.classList.add('reflect-x');\n }\n\n // using a trick here: simulated event from interlocutor's interaction won't fire ours\n if(event.isTrusted) {\n data.a.push({\n i: 1,\n t: Date.now()\n });\n\n sendInteractionThrottled();\n }\n // });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n/**\n * https://core.telegram.org/api/files#vector-thumbnails\n */\nexport default function getPathFromBytes(bytes: Uint8Array) {\n const lookup = 'AACAAAAHAAALMAAAQASTAVAAAZaacaaaahaaalmaaaqastava.az0123456789-,';\n\n let path = 'M';\n for(let i = 0, length = bytes.length; i < length; ++i) {\n const num = bytes[i];\n\n if(num >= (128 + 64)) {\n path += lookup[num - 128 - 64];\n } else {\n if(num >= 128) {\n path += ',';\n } else if(num >= 64) {\n path += '-';\n }\n path += '' + (num & 63);\n }\n }\n path += 'z';\n\n return path;\n}\n","// https://github.com/telegramdesktop/tdesktop/blob/543bfab24a76402992421063f1e6444f347d31fe/Telegram/SourceFiles/boxes/sticker_set_box.cpp#L75\nexport default function computeLockColor(canvas: HTMLCanvasElement) {\n const context = canvas.getContext('2d');\n const size = 20 * (canvas.dpr ?? 1);\n const width = size;\n const height = size;\n const skipx = (canvas.width - width) / 2;\n const margin = 0/* * (canvas.dpr ?? 1) */;\n const skipy = canvas.height - height - margin;\n const imageData = context.getImageData(skipx, skipy, width, height).data;\n let sr = 0, sg = 0, sb = 0, sa = 0;\n for(let i = 0; i < imageData.length; i += 4) {\n sr += imageData[i];\n sg += imageData[i + 1];\n sb += imageData[i + 2];\n sa += imageData[i + 3];\n }\n\n const outCanvas = document.createElement('canvas');\n outCanvas.width = size;\n outCanvas.height = size;\n const outContext = outCanvas.getContext('2d');\n const color = new Uint8ClampedArray([sr * 255 / sa, sg * 255 / sa, sb * 255 / sa, 255]);\n const rgba = `rgba(${color[0]}, ${color[1]}, ${color[2]}, ${color[3]})`;\n outContext.fillStyle = rgba;\n outContext.fillRect(0, 0, outCanvas.width, outCanvas.height);\n outContext.fillStyle = `rgba(112, 117, 121, 0.3)`;\n outContext.fillRect(0, 0, outCanvas.width, outCanvas.height);\n // document.querySelector('.popup-title').append(c);\n return outCanvas.toDataURL('image/jpeg');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_VIBRATE_SUPPORTED from '../../environment/vibrateSupport';\nimport assumeType from '../../helpers/assumeType';\nimport isInDOM from '../../helpers/dom/isInDOM';\nimport makeError from '../../helpers/makeError';\nimport {getMiddleware, Middleware} from '../../helpers/middleware';\nimport throttleWithRaf from '../../helpers/schedulers/throttleWithRaf';\nimport windowSize from '../../helpers/windowSize';\nimport {PhotoSize, VideoSize} from '../../layer';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport RLottiePlayer from '../../lib/rlottie/rlottiePlayer';\nimport wrapSticker from './sticker';\n\nexport default function wrapStickerAnimation({\n size,\n doc,\n middleware,\n target,\n side,\n skipRatio,\n play,\n managers,\n fullThumb,\n withRandomOffset,\n relativeEffect,\n loopEffect,\n onUnmount\n}: {\n size: number,\n doc: MyDocument,\n middleware?: Middleware,\n target: HTMLElement,\n side: 'left' | 'center' | 'right',\n skipRatio?: number,\n play: boolean,\n managers?: AppManagers,\n fullThumb?: PhotoSize | Extract,\n withRandomOffset?: boolean,\n relativeEffect?: boolean,\n loopEffect?: boolean,\n onUnmount?: () => void\n}) {\n const animationDiv = document.createElement('div');\n animationDiv.classList.add('emoji-animation');\n\n // const size = 280;\n animationDiv.style.width = size + 'px';\n animationDiv.style.height = size + 'px';\n\n let animation: RLottiePlayer;\n const unmountAnimation = () => {\n middlewareHelper.clean();\n animation?.remove();\n animationDiv.remove();\n appImManager.chat.bubbles.scrollable.container.removeEventListener('scroll', onScroll);\n onUnmount?.();\n };\n\n const middlewareHelper = middleware?.create() ?? getMiddleware();\n middleware = middlewareHelper.get();\n\n const stickerPromise = wrapSticker({\n div: animationDiv,\n doc,\n middleware,\n withThumb: false,\n needFadeIn: false,\n loop: !!loopEffect,\n width: size,\n height: size,\n play,\n group: 'none',\n skipRatio,\n managers,\n fullThumb,\n isEffect: true\n }).then(({render}) => render).then((_animation) => {\n assumeType(_animation);\n if(!middleware()) {\n _animation.remove();\n throw makeError('MIDDLEWARE');\n }\n\n animation = _animation;\n animation.addEventListener('enterFrame', (frameNo) => {\n if((!loopEffect && frameNo === animation.maxFrame) || !isInDOM(target)) {\n unmountAnimation();\n }\n });\n\n if(IS_VIBRATE_SUPPORTED) {\n animation.addEventListener('firstFrame', () => {\n navigator.vibrate(100);\n }, {once: true});\n }\n\n return animation;\n });\n\n const generateRandomSigned = (max: number) => {\n const r = Math.random() * max * 2;\n return r > max ? -r % max : r;\n };\n\n const randomOffsetX = withRandomOffset ? generateRandomSigned(16) : 0;\n const randomOffsetY = withRandomOffset ? generateRandomSigned(4) : 0;\n const setPosition = () => {\n if(!isInDOM(target)) {\n unmountAnimation();\n return;\n }\n\n const rect = target.getBoundingClientRect();\n\n const factor = rect.width / 200;\n const stableOffsetX = side === 'center' ? 0 : 16 * (side === 'right' ? 1 : -1) * factor;\n // const stableOffsetY = side === 'center' ? 0 : -50 * factor;\n const stableOffsetY = side === 'center' ? 0 : 0 * factor;\n\n const rectX = side === 'right' ? rect.right : rect.left;\n const rectY = rect.top;\n\n const addOffsetX = (side === 'center' ? (rect.width - size) / 2 : (side === 'right' ? -size : 0)) + stableOffsetX + randomOffsetX;\n const addOffsetY = (side === 'center' || true ? (rect.height - size) / 2 : 0) + stableOffsetY + randomOffsetY;\n const x = rectX + addOffsetX;\n const y = rectY + addOffsetY;\n\n if(y <= -size || y >= windowSize.height) {\n unmountAnimation();\n return;\n }\n\n if(relativeEffect) {\n if(side !== 'center') animationDiv.style[side] = Math.abs(stableOffsetX) * -1 + 'px';\n else animationDiv.style.left = addOffsetX + 'px';\n animationDiv.style.top = addOffsetY + 'px';\n } else {\n animationDiv.style.top = y + 'px';\n animationDiv.style.left = x + 'px';\n }\n };\n\n const onScroll = throttleWithRaf(setPosition);\n appImManager.chat.bubbles.scrollable.container.addEventListener('scroll', onScroll);\n\n setPosition();\n\n if(relativeEffect) {\n animationDiv.classList.add('is-relative');\n target.parentElement.append(animationDiv);\n } else {\n appImManager.emojiAnimationContainer.append(animationDiv);\n }\n\n return {animationDiv, stickerPromise};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../../lib/rootScope';\nimport wrapSticker from './sticker'\nimport {Modify} from '../../types';\n\nexport default async function wrapStickerEmoji(options: Modify[0], {\n div: HTMLElement,\n doc?: never,\n loop?: never\n}>) {\n const {\n emoji,\n div,\n managers = rootScope.managers\n } = options;\n const doc = await managers.appStickersManager.getAnimatedEmojiSticker(emoji);\n if(!doc) {\n div.classList.add('media-sticker-wrapper');\n throw new Error('no sticker');\n }\n\n return wrapSticker({\n doc,\n play: true,\n loop: false,\n ...options\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport createVideo from '../../helpers/dom/createVideo';\nimport renderImageFromUrl from '../../helpers/dom/renderImageFromUrl';\nimport {Document, StickerSet} from '../../layer';\nimport appDownloadManager from '../../lib/appManagers/appDownloadManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport lottieLoader from '../../lib/rlottie/lottieLoader';\nimport rootScope from '../../lib/rootScope';\nimport animationIntersector, {AnimationItemGroup} from '../animationIntersector';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport wrapSticker from './sticker';\nimport {Middleware} from '../../helpers/middleware';\n\nexport default async function wrapStickerSetThumb({set, lazyLoadQueue, container, group, autoplay, width, height, managers = rootScope.managers, middleware}: {\n set: StickerSet.stickerSet,\n lazyLoadQueue: LazyLoadQueue,\n container: HTMLElement,\n group: AnimationItemGroup,\n autoplay: boolean,\n width: number,\n height: number,\n managers?: AppManagers\n middleware?: Middleware\n}) {\n if(set.thumbs?.length) {\n container.classList.add('media-sticker-wrapper');\n lazyLoadQueue.push({\n div: container,\n load: async() => {\n const downloadOptions = await managers.appStickersManager.getStickerSetThumbDownloadOptions(set);\n const promise = appDownloadManager.download(downloadOptions);\n\n if(set.pFlags.animated && !set.pFlags.videos) {\n return promise\n .then((blob) => {\n lottieLoader.loadAnimationWorker({\n container,\n loop: true,\n autoplay,\n animationData: blob,\n width,\n height,\n needUpscale: true,\n name: 'setThumb' + set.id,\n group,\n middleware\n });\n });\n } else {\n let media: HTMLElement;\n if(set.pFlags.videos) {\n media = createVideo();\n (media as HTMLVideoElement).autoplay = true;\n (media as HTMLVideoElement).muted = true;\n (media as HTMLVideoElement).loop = true;\n } else {\n media = new Image();\n }\n\n media.classList.add('media-sticker');\n\n return promise.then((blob) => {\n renderImageFromUrl(media, URL.createObjectURL(blob), () => {\n container.append(media);\n\n if(set.pFlags.videos) {\n animationIntersector.addAnimation({\n animation: media as HTMLVideoElement,\n group\n });\n }\n });\n });\n }\n }\n });\n\n return;\n }\n\n let getDocPromise: Promise;\n\n if(set.thumb_document_id) {\n getDocPromise = managers.appEmojiManager.getCustomEmojiDocument(set.thumb_document_id);\n } else {\n getDocPromise = managers.appStickersManager.getStickerSet(set).then((stickerSet) => stickerSet.documents[0]);\n }\n\n const doc = await getDocPromise;\n if(doc._ !== 'documentEmpty') { // as thumb will be used first sticker\n wrapSticker({\n doc,\n div: container,\n group: group,\n lazyLoadQueue,\n managers,\n width,\n height,\n middleware\n }); // kostil\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport Row from '../row';\nimport wrapSticker from './sticker';\n\nexport default function wrapStickerToRow({doc, row, size, managers}: {\n doc: MyDocument,\n row: Row,\n size?: 'small' | 'large',\n managers?: AppManagers\n}) {\n const previousMedia = row.media;\n const media = row.createMedia('small');\n\n if(previousMedia) {\n media.classList.add('hide');\n }\n\n const loadPromises: Promise[] = previousMedia ? [] : undefined;\n\n const _size = size === 'small' ? 32 : 48;\n const result = wrapSticker({\n div: media,\n doc: doc,\n width: _size,\n height: _size,\n loadPromises,\n managers\n }).then(({render}) => render);\n\n loadPromises && Promise.all(loadPromises).then(() => {\n media.classList.remove('hide');\n previousMedia.remove();\n });\n\n return result;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport getServerMessageId from '../../lib/appManagers/utils/messageId/getServerMessageId';\nimport {i18n} from '../../lib/langPack';\nimport wrapTelegramUrlToAnchor from '../../lib/richTextProcessor/wrapTelegramUrlToAnchor';\nimport rootScope from '../../lib/rootScope';\nimport wrapPeerTitle from './peerTitle';\n\nexport default async function wrapTopicNameButton(\n options: {\n lastMsgId?: number\n } & Pick[0], 'peerId' | 'threadId' | 'wrapOptions' | 'withIcons'>\n) {\n const {peerId, threadId, lastMsgId} = options;\n\n const loadPromise: Promise = Promise.resolve();\n const a = wrapTelegramUrlToAnchor('t.me/c/' + peerId.toChatId() + (threadId ? '/' + getServerMessageId(threadId) : '') + (lastMsgId ? '/' + getServerMessageId(lastMsgId) : ''));\n a.classList.add('topic-name', 'topic-name-button');\n // if(threadId) {\n // const topic = await rootScope.managers.dialogsStorage.getForumTopic(peerId, threadId);\n // if(!topic) {\n // a.append(i18n('Loading'));\n // loadPromise = rootScope.managers.dialogsStorage.getForumTopicById(peerId, threadId)\n // }\n // } else {\n a.append(await wrapPeerTitle(options));\n // }\n\n return {\n cached: true,\n element: a,\n loadPromise\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {IS_SAFARI} from '../../environment/userAgent';\nimport {animateSingle} from '../../helpers/animation';\nimport {ChatAutoDownloadSettings} from '../../helpers/autoDownload';\nimport deferredPromise from '../../helpers/cancellablePromise';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport createVideo from '../../helpers/dom/createVideo';\nimport isInDOM from '../../helpers/dom/isInDOM';\nimport renderImageFromUrl from '../../helpers/dom/renderImageFromUrl';\nimport getStrippedThumbIfNeeded from '../../helpers/getStrippedThumbIfNeeded';\nimport liteMode from '../../helpers/liteMode';\nimport makeError from '../../helpers/makeError';\nimport mediaSizes, {ScreenSize} from '../../helpers/mediaSizes';\nimport {Middleware} from '../../helpers/middleware';\nimport noop from '../../helpers/noop';\nimport onMediaLoad from '../../helpers/onMediaLoad';\nimport {fastRaf} from '../../helpers/schedulers';\nimport throttle from '../../helpers/schedulers/throttle';\nimport sequentialDom from '../../helpers/sequentialDom';\nimport toHHMMSS from '../../helpers/string/toHHMMSS';\nimport {Message, PhotoSize, VideoSize} from '../../layer';\nimport {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport appDownloadManager from '../../lib/appManagers/appDownloadManager';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport {NULL_PEER_ID} from '../../lib/mtproto/mtproto_config';\nimport rootScope from '../../lib/rootScope';\nimport {ThumbCache} from '../../lib/storages/thumbs';\nimport animationIntersector, {AnimationItemGroup} from '../animationIntersector';\nimport appMediaPlaybackController, {MediaSearchContext} from '../appMediaPlaybackController';\nimport AudioElement, {findMediaTargets} from '../audio';\nimport LazyLoadQueue from '../lazyLoadQueue';\nimport ProgressivePreloader from '../preloader';\nimport wrapPhoto from './photo';\n\nconst MAX_VIDEO_AUTOPLAY_SIZE = 50 * 1024 * 1024; // 50 MB\n\nlet roundVideoCircumference = 0;\nmediaSizes.addEventListener('changeScreen', (from, to) => {\n if(to === ScreenSize.mobile || from === ScreenSize.mobile) {\n const elements = Array.from(document.querySelectorAll('.media-round .progress-ring')) as SVGSVGElement[];\n const width = mediaSizes.active.round.width;\n const halfSize = width / 2;\n const radius = halfSize - 7;\n roundVideoCircumference = 2 * Math.PI * radius;\n elements.forEach((element) => {\n element.setAttributeNS(null, 'width', '' + width);\n element.setAttributeNS(null, 'height', '' + width);\n\n const circle = element.firstElementChild as SVGCircleElement;\n circle.setAttributeNS(null, 'cx', '' + halfSize);\n circle.setAttributeNS(null, 'cy', '' + halfSize);\n circle.setAttributeNS(null, 'r', '' + radius);\n\n circle.style.strokeDasharray = roundVideoCircumference + ' ' + roundVideoCircumference;\n circle.style.strokeDashoffset = '' + roundVideoCircumference;\n });\n }\n});\n\nexport default async function wrapVideo({doc, container, message, boxWidth, boxHeight, withTail, isOut, middleware, lazyLoadQueue, noInfo, group, onlyPreview, noPreview, withoutPreloader, loadPromises, noPlayButton, photoSize, videoSize, searchContext, autoDownload, managers = rootScope.managers, noAutoplayAttribute}: {\n doc: MyDocument,\n container?: HTMLElement,\n message?: Message.message,\n boxWidth?: number,\n boxHeight?: number,\n withTail?: boolean,\n isOut?: boolean,\n middleware?: Middleware,\n lazyLoadQueue?: LazyLoadQueue,\n noInfo?: boolean,\n noPlayButton?: boolean,\n group?: AnimationItemGroup,\n onlyPreview?: boolean,\n noPreview?: boolean,\n withoutPreloader?: boolean,\n loadPromises?: Promise[],\n autoDownload?: ChatAutoDownloadSettings,\n photoSize?: PhotoSize,\n videoSize?: Extract,\n searchContext?: MediaSearchContext,\n managers?: AppManagers,\n noAutoplayAttribute?: boolean\n}) {\n const autoDownloadSize = autoDownload?.video;\n let noAutoDownload = autoDownloadSize === 0;\n const isAlbumItem = !(boxWidth && boxHeight);\n const canAutoplay = /* doc.sticker || */(\n (\n doc.type !== 'video' || (\n doc.size <= MAX_VIDEO_AUTOPLAY_SIZE &&\n !isAlbumItem\n )\n ) && (doc.type === 'gif' ? liteMode.isAvailable('gif') : liteMode.isAvailable('video'))\n );\n let spanTime: HTMLElement, spanPlay: HTMLElement;\n\n if(!noInfo) {\n spanTime = document.createElement('span');\n spanTime.classList.add('video-time');\n container.append(spanTime);\n\n let needPlayButton = false;\n if(doc.type !== 'gif') {\n spanTime.innerText = toHHMMSS(doc.duration, false);\n\n if(!noPlayButton && doc.type !== 'round') {\n if(canAutoplay && !noAutoDownload) {\n spanTime.classList.add('tgico', 'can-autoplay');\n } else {\n needPlayButton = true;\n }\n }\n } else {\n spanTime.innerText = 'GIF';\n\n if(!canAutoplay && !noPlayButton) {\n needPlayButton = true;\n noAutoDownload = undefined;\n }\n }\n\n if(needPlayButton) {\n spanPlay = document.createElement('span');\n spanPlay.classList.add('video-play', 'tgico-largeplay', 'btn-circle', 'position-center');\n container.append(spanPlay);\n }\n }\n\n const res: {\n thumb?: typeof photoRes,\n loadPromise: Promise\n } = {} as any;\n\n if(doc.mime_type === 'image/gif') {\n const photoRes = await wrapPhoto({\n photo: doc,\n message,\n container,\n boxWidth,\n boxHeight,\n withTail,\n isOut,\n lazyLoadQueue,\n middleware,\n withoutPreloader,\n loadPromises,\n autoDownloadSize,\n size: photoSize,\n managers\n });\n\n res.thumb = photoRes;\n res.loadPromise = photoRes.loadPromises.full;\n return res;\n }\n\n /* const video = doc.type === 'round' ? appMediaPlaybackController.addMedia(doc, message.mid) as HTMLVideoElement : document.createElement('video');\n if(video.parentElement) {\n video.remove();\n } */\n\n let preloader: ProgressivePreloader; // it must be here, otherwise will get error before initialization in round onPlay\n\n const video = createVideo();\n video.classList.add('media-video');\n video.muted = true;\n if(doc.type === 'round') {\n const divRound = document.createElement('div');\n divRound.classList.add('media-round', 'z-depth-1');\n divRound.dataset.mid = '' + message.mid;\n divRound.dataset.peerId = '' + message.peerId;\n (divRound as any).message = message;\n\n const size = mediaSizes.active.round;\n const halfSize = size.width / 2;\n const strokeWidth = 3.5;\n const radius = halfSize - (strokeWidth * 2);\n divRound.innerHTML = `\n \n `;\n\n const circle = divRound.firstElementChild.firstElementChild as SVGCircleElement;\n if(!roundVideoCircumference) {\n roundVideoCircumference = 2 * Math.PI * radius;\n }\n circle.style.strokeDasharray = roundVideoCircumference + ' ' + roundVideoCircumference;\n circle.style.strokeDashoffset = '' + roundVideoCircumference;\n\n spanTime.classList.add('tgico');\n\n const isUnread = message.pFlags.media_unread;\n if(isUnread) {\n divRound.classList.add('is-unread');\n }\n\n const canvas = document.createElement('canvas');\n canvas.width = canvas.height = doc.w/* * window.devicePixelRatio */;\n\n divRound.prepend(canvas, spanTime);\n divRound.append(video);\n container.append(divRound);\n\n const ctx = canvas.getContext('2d');\n /* ctx.beginPath();\n ctx.arc(canvas.width / 2, canvas.height / 2, canvas.width / 2, 0, Math.PI * 2);\n ctx.clip(); */\n\n const onLoad = () => {\n const message: Message.message = (divRound as any).message;\n const globalVideo = appMediaPlaybackController.addMedia(message, !noAutoDownload) as HTMLVideoElement;\n const clear = () => {\n (appImManager.chat.setPeerPromise || Promise.resolve()).finally(() => {\n if(isInDOM(globalVideo)) {\n return;\n }\n\n globalVideo.removeEventListener('play', onPlay);\n globalVideo.removeEventListener('timeupdate', throttledTimeUpdate);\n globalVideo.removeEventListener('pause', onPaused);\n globalVideo.removeEventListener('ended', onEnded);\n });\n };\n\n const onFrame = () => {\n ctx.drawImage(globalVideo, 0, 0);\n\n const offset = roundVideoCircumference - globalVideo.currentTime / globalVideo.duration * roundVideoCircumference;\n circle.style.strokeDashoffset = '' + offset;\n\n return !globalVideo.paused;\n };\n\n const onTimeUpdate = () => {\n if(!globalVideo.duration) {\n return;\n }\n\n if(!isInDOM(globalVideo)) {\n clear();\n return;\n }\n\n if(globalVideo.paused) {\n onFrame();\n }\n\n spanTime.innerText = toHHMMSS(globalVideo.duration - globalVideo.currentTime, false);\n };\n\n const throttledTimeUpdate = throttle(() => {\n fastRaf(onTimeUpdate);\n }, 1000, false);\n\n const onPlay = () => {\n video.classList.add('hide');\n divRound.classList.remove('is-paused');\n animateSingle(onFrame, canvas);\n\n if(preloader && preloader.preloader && preloader.preloader.classList.contains('manual')) {\n preloader.onClick();\n }\n };\n\n const onPaused = () => {\n if(!isInDOM(globalVideo)) {\n clear();\n return;\n }\n\n divRound.classList.add('is-paused');\n };\n\n const onEnded = () => {\n video.classList.remove('hide');\n divRound.classList.add('is-paused');\n\n video.currentTime = 0;\n spanTime.innerText = toHHMMSS(globalVideo.duration, false);\n\n if(globalVideo.currentTime) {\n globalVideo.currentTime = 0;\n }\n };\n\n globalVideo.addEventListener('play', onPlay);\n globalVideo.addEventListener('timeupdate', throttledTimeUpdate);\n globalVideo.addEventListener('pause', onPaused);\n globalVideo.addEventListener('ended', onEnded);\n\n attachClickEvent(canvas, (e) => {\n cancelEvent(e);\n\n // ! костыль\n if(preloader && !preloader.detached) {\n preloader.onClick();\n }\n\n // ! can't use it here. on Safari iOS video won't start.\n /* if(globalVideo.readyState < 2) {\n return;\n } */\n\n if(globalVideo.paused) {\n const hadSearchContext = !!searchContext;\n if(appMediaPlaybackController.setSearchContext(searchContext || {\n peerId: NULL_PEER_ID,\n inputFilter: {_: 'inputMessagesFilterEmpty'},\n useSearch: false\n })) {\n const [prev, next] = !hadSearchContext ? [] : findMediaTargets(divRound, message.mid/* , searchContext.useSearch */);\n appMediaPlaybackController.setTargets({peerId: message.peerId, mid: message.mid}, prev, next);\n }\n\n globalVideo.play();\n } else {\n globalVideo.pause();\n }\n });\n\n if(globalVideo.paused) {\n if(globalVideo.duration && globalVideo.currentTime !== globalVideo.duration && globalVideo.currentTime > 0) {\n onFrame();\n onTimeUpdate();\n video.classList.add('hide');\n } else {\n onPaused();\n }\n } else {\n onPlay();\n }\n };\n\n if(message.pFlags.is_outgoing) {\n // ! WARNING ! just to type-check\n (divRound as any as AudioElement).onLoad = onLoad;\n divRound.dataset.isOutgoing = '1';\n } else {\n onLoad();\n }\n } else if(!noAutoplayAttribute) {\n video.autoplay = true; // для safari\n }\n\n let photoRes: Awaited>;\n if(message) {\n photoRes = await wrapPhoto({\n photo: doc,\n message,\n container,\n boxWidth,\n boxHeight,\n withTail,\n isOut,\n lazyLoadQueue,\n middleware,\n withoutPreloader: true,\n loadPromises,\n autoDownloadSize: autoDownload?.photo,\n size: photoSize,\n managers\n });\n\n res.thumb = photoRes;\n\n if((!canAutoplay && doc.type !== 'gif') || onlyPreview) {\n res.loadPromise = photoRes.loadPromises.full;\n return res;\n }\n\n if(withTail) {\n const foreignObject = (photoRes.images.thumb || photoRes.images.full).parentElement;\n video.width = +foreignObject.getAttributeNS(null, 'width');\n video.height = +foreignObject.getAttributeNS(null, 'height');\n foreignObject.append(video);\n }\n } else if(!noPreview) { // * gifs masonry\n const gotThumb = getStrippedThumbIfNeeded(doc, {} as ThumbCache, true);\n if(gotThumb) {\n const thumbImage = gotThumb.image;\n thumbImage.classList.add('media-poster');\n container.append(thumbImage);\n res.thumb = {\n loadPromises: {\n thumb: gotThumb.loadPromise,\n full: Promise.resolve()\n },\n images: {\n thumb: thumbImage,\n full: null\n },\n preloader: null,\n aspecter: null\n };\n\n loadPromises?.push(gotThumb.loadPromise);\n res.loadPromise = gotThumb.loadPromise;\n }\n }\n\n if(onlyPreview) {\n return res;\n }\n\n if(!video.parentElement && container) {\n (photoRes?.aspecter || container).append(video);\n }\n\n let cacheContext: ThumbCache;\n const getCacheContext = async() => {\n return cacheContext = await managers.thumbsStorage.getCacheContext(doc, videoSize?.type);\n };\n\n await getCacheContext();\n\n const uploadFileName = message?.uploadingFileName;\n if(uploadFileName) { // means upload\n preloader = new ProgressivePreloader({\n attachMethod: 'prepend',\n isUpload: true\n });\n preloader.attachPromise(appDownloadManager.getUpload(uploadFileName));\n preloader.attach(container, false);\n noAutoDownload = undefined;\n } else if(!cacheContext.downloaded && !doc.supportsStreaming && !withoutPreloader) {\n preloader = new ProgressivePreloader({\n attachMethod: 'prepend'\n });\n } else if(doc.supportsStreaming) {\n preloader = new ProgressivePreloader({\n cancelable: false,\n attachMethod: 'prepend'\n });\n }\n\n const renderDeferred = deferredPromise();\n video.addEventListener('error', (e) => {\n if(video.error.code !== 4) {\n console.error('Error ' + video.error.code + '; details: ' + video.error.message);\n }\n\n if(preloader && !uploadFileName) {\n preloader.detach();\n }\n\n if(!renderDeferred.isFulfilled) {\n renderDeferred.resolve();\n }\n }, {once: true});\n\n if(doc.type === 'video') {\n const onTimeUpdate = () => {\n if(!video.duration) {\n return;\n }\n\n spanTime.innerText = toHHMMSS(video.duration - video.currentTime, false);\n };\n\n const throttledTimeUpdate = throttle(() => {\n fastRaf(onTimeUpdate);\n }, 1e3, false);\n\n video.addEventListener('timeupdate', throttledTimeUpdate);\n\n if(spanPlay) {\n video.addEventListener('timeupdate', () => {\n sequentialDom.mutateElement(spanPlay, () => {\n spanPlay.remove();\n });\n }, {once: true});\n }\n }\n\n video.muted = true;\n video.loop = true;\n // video.play();\n if(!noAutoplayAttribute) {\n video.autoplay = true;\n }\n\n let loadPhotoThumbFunc = noAutoDownload && photoRes?.preloader?.loadFunc;\n const load = async() => {\n if(preloader && noAutoDownload && !withoutPreloader) {\n preloader.construct();\n preloader.setManual();\n }\n\n await getCacheContext();\n let loadPromise: Promise = Promise.resolve();\n if((preloader && !uploadFileName) || withoutPreloader) {\n if(!cacheContext.downloaded && !doc.supportsStreaming) {\n const promise = loadPromise = appDownloadManager.downloadMediaURL({\n media: doc,\n queueId: lazyLoadQueue?.queueId,\n onlyCache: noAutoDownload,\n thumb: videoSize\n });\n\n if(preloader) {\n preloader.attach(container, false, promise);\n }\n } else if(doc.supportsStreaming) {\n if(noAutoDownload) {\n loadPromise = Promise.reject(makeError('NO_AUTO_DOWNLOAD'));\n } else if(!cacheContext.downloaded && preloader) { // * check for uploading video\n preloader.attach(container, false, null);\n video.addEventListener(IS_SAFARI ? 'timeupdate' : 'canplay', () => {\n preloader.detach();\n }, {once: true});\n }\n }\n }\n\n if(!noAutoDownload && loadPhotoThumbFunc) {\n loadPhotoThumbFunc();\n loadPhotoThumbFunc = null;\n }\n\n noAutoDownload = undefined;\n\n loadPromise.then(async() => {\n if(middleware && !middleware()) {\n renderDeferred.resolve();\n return;\n }\n\n if(doc.type === 'round') {\n appMediaPlaybackController.resolveWaitingForLoadMedia(message.peerId, message.mid, message.pFlags.is_scheduled);\n }\n\n await getCacheContext();\n\n onMediaLoad(video).then(() => {\n if(group) {\n animationIntersector.addAnimation({\n animation: video,\n group\n });\n }\n\n if(preloader && !uploadFileName) {\n preloader.detach();\n }\n\n renderDeferred.resolve();\n }, (err) => {\n console.error('video load error', err);\n if(spanTime) {\n spanTime.classList.add('is-error');\n }\n renderDeferred.reject(err);\n });\n\n renderImageFromUrl(video, cacheContext.url);\n }, noop);\n\n return {download: loadPromise, render: Promise.all([loadPromise, renderDeferred])};\n };\n\n if(preloader && !uploadFileName) {\n preloader.setDownloadFunction(load);\n }\n\n (container as any).preloader = preloader;\n\n /* if(doc.size >= 20e6 && !doc.downloaded) {\n let downloadDiv = document.createElement('div');\n downloadDiv.classList.add('download');\n\n let span = document.createElement('span');\n span.classList.add('btn-circle', 'tgico-download');\n downloadDiv.append(span);\n\n downloadDiv.addEventListener('click', () => {\n downloadDiv.remove();\n loadVideo();\n });\n\n container.prepend(downloadDiv);\n\n return;\n } */\n\n if(doc.type === 'gif' && !canAutoplay) {\n attachClickEvent(container, (e) => {\n cancelEvent(e);\n spanPlay.remove();\n load();\n }, {capture: true, once: true});\n } else {\n res.loadPromise = !lazyLoadQueue ?\n (await load()).render :\n (lazyLoadQueue.push({div: container, load: () => load().then(({render}) => render)}), Promise.resolve());\n }\n\n if(res.thumb) {\n await res.thumb.loadPromises.thumb;\n }\n\n return res;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport limitSymbols from '../../helpers/string/limitSymbols';\nimport {WebPage} from '../../layer';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\n\nexport default function wrapWebPageDescription(webPage: WebPage.webPage) {\n const shortDescriptionText = limitSymbols(webPage.description || '', 150, 180);\n // const siteName = webPage.site_name;\n // let contextHashtag = '';\n // if(siteName === 'GitHub') {\n // const matches = apiWebPage.url.match(/(https?:\\/\\/github\\.com\\/[^\\/]+\\/[^\\/]+)/);\n // if(matches) {\n // contextHashtag = matches[0] + '/issues/{1}';\n // }\n // }\n return wrapRichText(shortDescriptionText/* , {\n contextSite: siteName || 'external',\n contextHashtag: contextHashtag\n } */);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport limitSymbols from '../../helpers/string/limitSymbols';\nimport {WebPage} from '../../layer';\nimport wrapRichText from '../../lib/richTextProcessor/wrapRichText';\n\nexport default function wrapWebPageTitle(webPage: WebPage.webPage) {\n let shortTitle = webPage.title || webPage.author || webPage.site_name || '';\n shortTitle = limitSymbols(shortTitle, 80, 100);\n return wrapRichText(shortTitle, {noLinks: true, noLinebreaks: true});\n}\n","// Taken from https://core.telegram.org/bots/payments/currencies.json\nexport type Currency = {\n code: string,\n title: string,\n symbol: string,\n native: string,\n thousands_sep: string,\n decimal_sep: string,\n symbol_left: boolean,\n space_between: boolean,\n exp: number,\n min_amount: string | number,\n max_amount: string | number\n};\n\n// eslint-disable-next-line quotes, comma-spacing\nconst Currencies: {[currency: string]: Currency} = {\"AED\":{\"code\":\"AED\",\"title\":\"United Arab Emirates Dirham\",\"symbol\":\"AED\",\"native\":\"د.إ.‏\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"367\",\"max_amount\":\"3673030\"},\"AFN\":{\"code\":\"AFN\",\"title\":\"Afghan Afghani\",\"symbol\":\"AFN\",\"native\":\"؋\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"8729\",\"max_amount\":\"87299487\"},\"ALL\":{\"code\":\"ALL\",\"title\":\"Albanian Lek\",\"symbol\":\"ALL\",\"native\":\"Lek\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":false,\"exp\":2,\"min_amount\":\"11842\",\"max_amount\":\"118421187\"},\"AMD\":{\"code\":\"AMD\",\"title\":\"Armenian Dram\",\"symbol\":\"AMD\",\"native\":\"դր.\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"40943\",\"max_amount\":\"409436718\"},\"ARS\":{\"code\":\"ARS\",\"title\":\"Argentine Peso\",\"symbol\":\"ARS\",\"native\":\"$\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"14705\",\"max_amount\":\"147059002\"},\"AUD\":{\"code\":\"AUD\",\"title\":\"Australian Dollar\",\"symbol\":\"AU$\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"153\",\"max_amount\":\"1536825\"},\"AZN\":{\"code\":\"AZN\",\"title\":\"Azerbaijani Manat\",\"symbol\":\"AZN\",\"native\":\"ман.\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"169\",\"max_amount\":\"1699858\"},\"BAM\":{\"code\":\"BAM\",\"title\":\"Bosnia & Herzegovina Convertible Mark\",\"symbol\":\"BAM\",\"native\":\"KM\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"199\",\"max_amount\":\"1990677\"},\"BDT\":{\"code\":\"BDT\",\"title\":\"Bangladeshi Taka\",\"symbol\":\"BDT\",\"native\":\"৳\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"10009\",\"max_amount\":\"100094046\"},\"BGN\":{\"code\":\"BGN\",\"title\":\"Bulgarian Lev\",\"symbol\":\"BGN\",\"native\":\"лв.\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"199\",\"max_amount\":\"1993315\"},\"BND\":{\"code\":\"BND\",\"title\":\"Brunei Dollar\",\"symbol\":\"BND\",\"native\":\"$\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"142\",\"max_amount\":\"1421883\"},\"BOB\":{\"code\":\"BOB\",\"title\":\"Bolivian Boliviano\",\"symbol\":\"BOB\",\"native\":\"Bs\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"683\",\"max_amount\":\"6832607\"},\"BRL\":{\"code\":\"BRL\",\"title\":\"Brazilian Real\",\"symbol\":\"R$\",\"native\":\"R$\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"539\",\"max_amount\":\"5397799\"},\"BYN\":{\"code\":\"BYN\",\"title\":\"Belarusian ruble\",\"symbol\":\"BYN\",\"native\":\"BYN\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"249\",\"max_amount\":\"2495801\"},\"CAD\":{\"code\":\"CAD\",\"title\":\"Canadian Dollar\",\"symbol\":\"CA$\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"136\",\"max_amount\":\"1366860\"},\"CHF\":{\"code\":\"CHF\",\"title\":\"Swiss Franc\",\"symbol\":\"CHF\",\"native\":\"CHF\",\"thousands_sep\":\"'\",\"decimal_sep\":\".\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"97\",\"max_amount\":\"976705\"},\"CLP\":{\"code\":\"CLP\",\"title\":\"Chilean Peso\",\"symbol\":\"CLP\",\"native\":\"$\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":true,\"exp\":0,\"min_amount\":\"963\",\"max_amount\":\"9637495\"},\"CNY\":{\"code\":\"CNY\",\"title\":\"Chinese Renminbi Yuan\",\"symbol\":\"CN¥\",\"native\":\"CN¥\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"709\",\"max_amount\":\"7094102\"},\"COP\":{\"code\":\"COP\",\"title\":\"Colombian Peso\",\"symbol\":\"COP\",\"native\":\"$\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"452870\",\"max_amount\":\"4528700000\"},\"CRC\":{\"code\":\"CRC\",\"title\":\"Costa Rican Colón\",\"symbol\":\"CRC\",\"native\":\"₡\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"62506\",\"max_amount\":\"625061070\"},\"CZK\":{\"code\":\"CZK\",\"title\":\"Czech Koruna\",\"symbol\":\"CZK\",\"native\":\"Kč\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"2497\",\"max_amount\":\"24975029\"},\"DKK\":{\"code\":\"DKK\",\"title\":\"Danish Krone\",\"symbol\":\"DKK\",\"native\":\"kr\",\"thousands_sep\":\"\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"755\",\"max_amount\":\"7555990\"},\"DOP\":{\"code\":\"DOP\",\"title\":\"Dominican Peso\",\"symbol\":\"DOP\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"5275\",\"max_amount\":\"52757308\"},\"DZD\":{\"code\":\"DZD\",\"title\":\"Algerian Dinar\",\"symbol\":\"DZD\",\"native\":\"د.ج.‏\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"14035\",\"max_amount\":\"140353307\"},\"EGP\":{\"code\":\"EGP\",\"title\":\"Egyptian Pound\",\"symbol\":\"EGP\",\"native\":\"ج.م.‏\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"1953\",\"max_amount\":\"19537405\"},\"ETB\":{\"code\":\"ETB\",\"title\":\"Ethiopian Birr\",\"symbol\":\"ETB\",\"native\":\"ብር\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"5224\",\"max_amount\":\"52247069\"},\"EUR\":{\"code\":\"EUR\",\"title\":\"Euro\",\"symbol\":\"€\",\"native\":\"€\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"101\",\"max_amount\":\"1016045\"},\"GBP\":{\"code\":\"GBP\",\"title\":\"British Pound\",\"symbol\":\"£\",\"native\":\"£\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"89\",\"max_amount\":\"894445\"},\"GEL\":{\"code\":\"GEL\",\"title\":\"Georgian Lari\",\"symbol\":\"GEL\",\"native\":\"GEL\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"283\",\"max_amount\":\"2830234\"},\"GTQ\":{\"code\":\"GTQ\",\"title\":\"Guatemalan Quetzal\",\"symbol\":\"GTQ\",\"native\":\"Q\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"778\",\"max_amount\":\"7781323\"},\"HKD\":{\"code\":\"HKD\",\"title\":\"Hong Kong Dollar\",\"symbol\":\"HK$\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"784\",\"max_amount\":\"7849750\"},\"HNL\":{\"code\":\"HNL\",\"title\":\"Honduran Lempira\",\"symbol\":\"HNL\",\"native\":\"L\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"2441\",\"max_amount\":\"24413729\"},\"HRK\":{\"code\":\"HRK\",\"title\":\"Croatian Kuna\",\"symbol\":\"HRK\",\"native\":\"kn\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"764\",\"max_amount\":\"7648805\"},\"HUF\":{\"code\":\"HUF\",\"title\":\"Hungarian Forint\",\"symbol\":\"HUF\",\"native\":\"Ft\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"42685\",\"max_amount\":\"426850229\"},\"IDR\":{\"code\":\"IDR\",\"title\":\"Indonesian Rupiah\",\"symbol\":\"IDR\",\"native\":\"Rp\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"1523370\",\"max_amount\":\"15233700000\"},\"ILS\":{\"code\":\"ILS\",\"title\":\"Israeli New Sheqel\",\"symbol\":\"₪\",\"native\":\"₪\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"354\",\"max_amount\":\"3543350\"},\"INR\":{\"code\":\"INR\",\"title\":\"Indian Rupee\",\"symbol\":\"₹\",\"native\":\"₹\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"8155\",\"max_amount\":\"81555550\"},\"ISK\":{\"code\":\"ISK\",\"title\":\"Icelandic Króna\",\"symbol\":\"ISK\",\"native\":\"kr\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":0,\"min_amount\":\"142\",\"max_amount\":\"1425603\"},\"JMD\":{\"code\":\"JMD\",\"title\":\"Jamaican Dollar\",\"symbol\":\"JMD\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"15013\",\"max_amount\":\"150131044\"},\"JPY\":{\"code\":\"JPY\",\"title\":\"Japanese Yen\",\"symbol\":\"¥\",\"native\":\"¥\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":0,\"min_amount\":\"144\",\"max_amount\":\"1443065\"},\"KES\":{\"code\":\"KES\",\"title\":\"Kenyan Shilling\",\"symbol\":\"KES\",\"native\":\"Ksh\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"12075\",\"max_amount\":\"120750271\"},\"KGS\":{\"code\":\"KGS\",\"title\":\"Kyrgyzstani Som\",\"symbol\":\"KGS\",\"native\":\"KGS\",\"thousands_sep\":\" \",\"decimal_sep\":\"-\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"8018\",\"max_amount\":\"80182898\"},\"KRW\":{\"code\":\"KRW\",\"title\":\"South Korean Won\",\"symbol\":\"₩\",\"native\":\"₩\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":0,\"min_amount\":\"1431\",\"max_amount\":\"14315201\"},\"KZT\":{\"code\":\"KZT\",\"title\":\"Kazakhstani Tenge\",\"symbol\":\"KZT\",\"native\":\"₸\",\"thousands_sep\":\" \",\"decimal_sep\":\"-\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"47186\",\"max_amount\":\"471867112\"},\"LBP\":{\"code\":\"LBP\",\"title\":\"Lebanese Pound\",\"symbol\":\"LBP\",\"native\":\"ل.ل.‏\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"150999\",\"max_amount\":\"1509998778\"},\"LKR\":{\"code\":\"LKR\",\"title\":\"Sri Lankan Rupee\",\"symbol\":\"LKR\",\"native\":\"රු.\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"35546\",\"max_amount\":\"355469651\"},\"MAD\":{\"code\":\"MAD\",\"title\":\"Moroccan Dirham\",\"symbol\":\"MAD\",\"native\":\"د.م.‏\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"1093\",\"max_amount\":\"10938136\"},\"MDL\":{\"code\":\"MDL\",\"title\":\"Moldovan Leu\",\"symbol\":\"MDL\",\"native\":\"MDL\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"1926\",\"max_amount\":\"19264439\"},\"MNT\":{\"code\":\"MNT\",\"title\":\"Mongolian Tögrög\",\"symbol\":\"MNT\",\"native\":\"MNT\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"322444\",\"max_amount\":\"3224442056\"},\"MUR\":{\"code\":\"MUR\",\"title\":\"Mauritian Rupee\",\"symbol\":\"MUR\",\"native\":\"MUR\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"4453\",\"max_amount\":\"44535174\"},\"MVR\":{\"code\":\"MVR\",\"title\":\"Maldivian Rufiyaa\",\"symbol\":\"MVR\",\"native\":\"MVR\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"1546\",\"max_amount\":\"15460397\"},\"MXN\":{\"code\":\"MXN\",\"title\":\"Mexican Peso\",\"symbol\":\"MX$\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"2012\",\"max_amount\":\"20122860\"},\"MYR\":{\"code\":\"MYR\",\"title\":\"Malaysian Ringgit\",\"symbol\":\"MYR\",\"native\":\"RM\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"463\",\"max_amount\":\"4632502\"},\"MZN\":{\"code\":\"MZN\",\"title\":\"Mozambican Metical\",\"symbol\":\"MZN\",\"native\":\"MTn\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"6382\",\"max_amount\":\"63829729\"},\"NGN\":{\"code\":\"NGN\",\"title\":\"Nigerian Naira\",\"symbol\":\"NGN\",\"native\":\"₦\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"43203\",\"max_amount\":\"432039828\"},\"NIO\":{\"code\":\"NIO\",\"title\":\"Nicaraguan Córdoba\",\"symbol\":\"NIO\",\"native\":\"C$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"3556\",\"max_amount\":\"35566412\"},\"NOK\":{\"code\":\"NOK\",\"title\":\"Norwegian Krone\",\"symbol\":\"NOK\",\"native\":\"kr\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"1069\",\"max_amount\":\"10690975\"},\"NPR\":{\"code\":\"NPR\",\"title\":\"Nepalese Rupee\",\"symbol\":\"NPR\",\"native\":\"नेरू\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"12954\",\"max_amount\":\"129546657\"},\"NZD\":{\"code\":\"NZD\",\"title\":\"New Zealand Dollar\",\"symbol\":\"NZ$\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"174\",\"max_amount\":\"1746220\"},\"PAB\":{\"code\":\"PAB\",\"title\":\"Panamanian Balboa\",\"symbol\":\"PAB\",\"native\":\"B\\/.\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"98\",\"max_amount\":\"988722\"},\"PEN\":{\"code\":\"PEN\",\"title\":\"Peruvian Nuevo Sol\",\"symbol\":\"PEN\",\"native\":\"S\\/.\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"390\",\"max_amount\":\"3902208\"},\"PHP\":{\"code\":\"PHP\",\"title\":\"Philippine Peso\",\"symbol\":\"PHP\",\"native\":\"₱\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"5862\",\"max_amount\":\"58627496\"},\"PKR\":{\"code\":\"PKR\",\"title\":\"Pakistani Rupee\",\"symbol\":\"PKR\",\"native\":\"₨\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"22642\",\"max_amount\":\"226426805\"},\"PLN\":{\"code\":\"PLN\",\"title\":\"Polish Złoty\",\"symbol\":\"PLN\",\"native\":\"zł\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"493\",\"max_amount\":\"4932350\"},\"PYG\":{\"code\":\"PYG\",\"title\":\"Paraguayan Guaraní\",\"symbol\":\"PYG\",\"native\":\"₲\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":true,\"exp\":0,\"min_amount\":\"6977\",\"max_amount\":\"69772317\"},\"QAR\":{\"code\":\"QAR\",\"title\":\"Qatari Riyal\",\"symbol\":\"QAR\",\"native\":\"ر.ق.‏\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"364\",\"max_amount\":\"3640989\"},\"RON\":{\"code\":\"RON\",\"title\":\"Romanian Leu\",\"symbol\":\"RON\",\"native\":\"RON\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"502\",\"max_amount\":\"5028645\"},\"RSD\":{\"code\":\"RSD\",\"title\":\"Serbian Dinar\",\"symbol\":\"RSD\",\"native\":\"дин.\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"11918\",\"max_amount\":\"119184990\"},\"RUB\":{\"code\":\"RUB\",\"title\":\"Russian Ruble\",\"symbol\":\"RUB\",\"native\":\"₽\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"7128\",\"max_amount\":\"71281218\"},\"SAR\":{\"code\":\"SAR\",\"title\":\"Saudi Riyal\",\"symbol\":\"SAR\",\"native\":\"ر.س.‏\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"375\",\"max_amount\":\"3756546\"},\"SEK\":{\"code\":\"SEK\",\"title\":\"Swedish Krona\",\"symbol\":\"SEK\",\"native\":\"kr\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"1109\",\"max_amount\":\"11094972\"},\"SGD\":{\"code\":\"SGD\",\"title\":\"Singapore Dollar\",\"symbol\":\"SGD\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"143\",\"max_amount\":\"1430495\"},\"THB\":{\"code\":\"THB\",\"title\":\"Thai Baht\",\"symbol\":\"฿\",\"native\":\"฿\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"3780\",\"max_amount\":\"37800497\"},\"TJS\":{\"code\":\"TJS\",\"title\":\"Tajikistani Somoni\",\"symbol\":\"TJS\",\"native\":\"TJS\",\"thousands_sep\":\" \",\"decimal_sep\":\";\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"975\",\"max_amount\":\"9753854\"},\"TRY\":{\"code\":\"TRY\",\"title\":\"Turkish Lira\",\"symbol\":\"TRY\",\"native\":\"TL\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"1854\",\"max_amount\":\"18543598\"},\"TTD\":{\"code\":\"TTD\",\"title\":\"Trinidad and Tobago Dollar\",\"symbol\":\"TTD\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"672\",\"max_amount\":\"6722681\"},\"TWD\":{\"code\":\"TWD\",\"title\":\"New Taiwan Dollar\",\"symbol\":\"NT$\",\"native\":\"NT$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"3173\",\"max_amount\":\"31738502\"},\"TZS\":{\"code\":\"TZS\",\"title\":\"Tanzanian Shilling\",\"symbol\":\"TZS\",\"native\":\"TSh\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"233199\",\"max_amount\":\"2331999890\"},\"UAH\":{\"code\":\"UAH\",\"title\":\"Ukrainian Hryvnia\",\"symbol\":\"UAH\",\"native\":\"₴\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":false,\"exp\":2,\"min_amount\":\"3633\",\"max_amount\":\"36338830\"},\"UGX\":{\"code\":\"UGX\",\"title\":\"Ugandan Shilling\",\"symbol\":\"UGX\",\"native\":\"USh\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":0,\"min_amount\":\"3816\",\"max_amount\":\"38166726\"},\"USD\":{\"code\":\"USD\",\"title\":\"United States Dollar\",\"symbol\":\"$\",\"native\":\"$\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":false,\"exp\":2,\"min_amount\":\"100\",\"max_amount\":1000000},\"UYU\":{\"code\":\"UYU\",\"title\":\"Uruguayan Peso\",\"symbol\":\"UYU\",\"native\":\"$\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"4080\",\"max_amount\":\"40801205\"},\"UZS\":{\"code\":\"UZS\",\"title\":\"Uzbekistani Som\",\"symbol\":\"UZS\",\"native\":\"UZS\",\"thousands_sep\":\" \",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":2,\"min_amount\":\"1089058\",\"max_amount\":\"10890583014\"},\"VND\":{\"code\":\"VND\",\"title\":\"Vietnamese Đồng\",\"symbol\":\"₫\",\"native\":\"₫\",\"thousands_sep\":\".\",\"decimal_sep\":\",\",\"symbol_left\":false,\"space_between\":true,\"exp\":0,\"min_amount\":\"23862\",\"max_amount\":\"238625000\"},\"YER\":{\"code\":\"YER\",\"title\":\"Yemeni Rial\",\"symbol\":\"YER\",\"native\":\"ر.ي.‏\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"25030\",\"max_amount\":\"250300677\"},\"ZAR\":{\"code\":\"ZAR\",\"title\":\"South African Rand\",\"symbol\":\"ZAR\",\"native\":\"R\",\"thousands_sep\":\",\",\"decimal_sep\":\".\",\"symbol_left\":true,\"space_between\":true,\"exp\":2,\"min_amount\":\"1789\",\"max_amount\":\"17894299\"}};\n\nexport default Currencies;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {EMOJI_VERSION} from '../environment/emojiVersionsSupport';\n\nexport const EmojiVersions: {[version in EMOJI_VERSION]: {[emoji: string]: number}} = {'14':{'1f6dd':4867, '1f6de':4916, '1f6df':4923, '1f7f0':62832, '1f979':183, '1f9cc':1557, '1fa7b':61332, '1fa7c':61330, '1faa9':51093, '1faaa':61364, '1faab':61189, '1faac':51085, '1fab7':2651, '1fab8':2631, '1fab9':2672, '1faba':2673, '1fac3':1520, '1fac4':1521, '1fac5':1505, '1fad7':3793, '1fad8':3707, '1fad9':3804, '1fae0':111, '1fae1':136, '1fae2':132, '1fae3':133, '1fae4':174, '1fae5':142, '1fae6':1385, '1fae7':61353, '1faf0':1341, '1faf1':1332, '1faf2':1333, '1faf3':1334, '1faf4':1335, '1faf5':1351, '1faf6':1360, '1faf1-1f3fb-200d-1faf2-1f3fc':0, '1faf1-1f3fb-200d-1faf2-1f3fd':0, '1faf1-1f3fb-200d-1faf2-1f3fe':0, '1faf1-1f3fb-200d-1faf2-1f3ff':0, '1faf1-1f3fc-200d-1faf2-1f3fb':0, '1faf1-1f3fc-200d-1faf2-1f3fd':0, '1faf1-1f3fc-200d-1faf2-1f3fe':0, '1faf1-1f3fc-200d-1faf2-1f3ff':0, '1faf1-1f3fd-200d-1faf2-1f3fb':0, '1faf1-1f3fd-200d-1faf2-1f3fc':0, '1faf1-1f3fd-200d-1faf2-1f3fe':0, '1faf1-1f3fd-200d-1faf2-1f3ff':0, '1faf1-1f3fe-200d-1faf2-1f3fb':0, '1faf1-1f3fe-200d-1faf2-1f3fc':0, '1faf1-1f3fe-200d-1faf2-1f3fd':0, '1faf1-1f3fe-200d-1faf2-1f3ff':0, '1faf1-1f3ff-200d-1faf2-1f3fb':0, '1faf1-1f3ff-200d-1faf2-1f3fc':0, '1faf1-1f3ff-200d-1faf2-1f3fd':0, '1faf1-1f3ff-200d-1faf2-1f3fe':0, '1fac3-1f3fb':0, '1fac3-1f3fc':0, '1fac3-1f3fd':0, '1fac3-1f3fe':0, '1fac3-1f3ff':0, '1fac4-1f3fb':0, '1fac4-1f3fc':0, '1fac4-1f3fd':0, '1fac4-1f3fe':0, '1fac4-1f3ff':0, '1fac5-1f3fb':0, '1fac5-1f3fc':0, '1fac5-1f3fd':0, '1fac5-1f3fe':0, '1fac5-1f3ff':0, '1faf0-1f3fb':0, '1faf0-1f3fc':0, '1faf0-1f3fd':0, '1faf0-1f3fe':0, '1faf0-1f3ff':0, '1faf1-1f3fb':0, '1faf1-1f3fc':0, '1faf1-1f3fd':0, '1faf1-1f3fe':0, '1faf1-1f3ff':0, '1faf2-1f3fb':0, '1faf2-1f3fc':0, '1faf2-1f3fd':0, '1faf2-1f3fe':0, '1faf2-1f3ff':0, '1faf3-1f3fb':0, '1faf3-1f3fc':0, '1faf3-1f3fd':0, '1faf3-1f3fe':0, '1faf3-1f3ff':0, '1faf4-1f3fb':0, '1faf4-1f3fc':0, '1faf4-1f3fd':0, '1faf4-1f3fe':0, '1faf4-1f3ff':0, '1faf5-1f3fb':0, '1faf5-1f3fc':0, '1faf5-1f3fd':0, '1faf5-1f3fe':0, '1faf5-1f3ff':0, '1faf6-1f3fb':0, '1faf6-1f3fc':0, '1faf6-1f3fd':0, '1faf6-1f3fe':0, '1faf6-1f3ff':0}, '':{'2049':62835, '2122':62863, '2139':62888, '2194':62764, '2195':62763, '2196':62762, '2197':62756, '2198':62758, '2199':62760, '2328':61194, '2600':4990, '2601':4998, '2602':41013, '2603':41018, '2604':41020, '2611':62851, '2614':41014, '2615':3781, '2618':2667, '2620':1106, '2622':62753, '2623':62754, '2626':62783, '2638':62780, '2639':177, '2648':62788, '2649':62789, '2650':62796, '2651':62797, '2652':62798, '2653':62799, '2660':51095, '2663':51098, '2665':51096, '2666':51097, '2668':4865, '2692':61297, '2693':4922, '2694':61300, '2696':61311, '2697':61319, '2699':61309, '2702':61284, '2705':62850, '2708':4931, '2709':61245, '2712':61259, '2714':62852, '2716':62828, '2721':62779, '2728':51029, '2733':62858, '2734':62859, '2744':41017, '2747':62860, '2753':62836, '2754':62837, '2755':62838, '2757':62839, '2763':1137, '2764':1141, '2795':62829, '2796':62830, '2797':62831, '2934':62767, '2935':62768, '3030':62840, '3297':62912, '3299':62913, '0023-20e3':62864, '002a-20e3':62865, '0030-20e3':62866, '0031-20e3':62867, '0032-20e3':62868, '0033-20e3':62869, '0034-20e3':62870, '0035-20e3':62871, '0036-20e3':62872, '0037-20e3':62873, '0038-20e3':62874, '0039-20e3':62875, '00a9':62861, '00ae':62862, '1f004':51101, '1f0cf':51100, '1f170':62882, '1f171':62884, '1f17e':62893, '1f17f':62895, '1f18e':62883, '1f191':62885, '1f192':62886, '1f193':62887, '1f194':62889, '1f195':62891, '1f196':62892, '1f197':62894, '1f198':62896, '1f199':62897, '1f19a':62898, '1f1e6-1f1e8':71594, '1f1e6-1f1e9':71595, '1f1e6-1f1ea':71596, '1f1e6-1f1eb':71597, '1f1e6-1f1ec':71598, '1f1e6-1f1ee':71599, '1f1e6-1f1f1':71600, '1f1e6-1f1f2':71601, '1f1e6-1f1f4':71602, '1f1e6-1f1f6':71603, '1f1e6-1f1f7':71604, '1f1e6-1f1f8':71605, '1f1e6-1f1f9':71606, '1f1e6-1f1fa':71607, '1f1e6-1f1fc':71608, '1f1e6-1f1fd':71609, '1f1e6-1f1ff':71610, '1f1e7-1f1e6':71611, '1f1e7-1f1e7':71612, '1f1e7-1f1e9':71613, '1f1e7-1f1ea':71614, '1f1e7-1f1eb':71615, '1f1e7-1f1ec':71616, '1f1e7-1f1ed':71617, '1f1e7-1f1ee':71618, '1f1e7-1f1ef':71619, '1f1e7-1f1f1':71620, '1f1e7-1f1f2':71621, '1f1e7-1f1f3':71622, '1f1e7-1f1f4':71623, '1f1e7-1f1f6':71624, '1f1e7-1f1f7':71625, '1f1e7-1f1f8':71626, '1f1e7-1f1f9':71627, '1f1e7-1f1fb':71628, '1f1e7-1f1fc':71629, '1f1e7-1f1fe':71630, '1f1e7-1f1ff':71631, '1f1e8-1f1e6':71632, '1f1e8-1f1e8':71633, '1f1e8-1f1e9':71634, '1f1e8-1f1eb':71635, '1f1e8-1f1ec':71636, '1f1e8-1f1ed':71637, '1f1e8-1f1ee':71638, '1f1e8-1f1f0':71639, '1f1e8-1f1f1':71640, '1f1e8-1f1f2':71641, '1f1e8-1f1f3':71642, '1f1e8-1f1f4':71643, '1f1e8-1f1f5':71644, '1f1e8-1f1f7':71645, '1f1e8-1f1fa':71646, '1f1e8-1f1fb':71647, '1f1e8-1f1fc':71648, '1f1e8-1f1fd':71649, '1f1e8-1f1fe':71650, '1f1e8-1f1ff':71651, '1f1e9-1f1ea':71652, '1f1e9-1f1ec':71653, '1f1e9-1f1ef':71654, '1f1e9-1f1f0':71655, '1f1e9-1f1f2':71656, '1f1e9-1f1f4':71657, '1f1e9-1f1ff':71658, '1f1ea-1f1e6':71659, '1f1ea-1f1e8':71660, '1f1ea-1f1ea':71661, '1f1ea-1f1ec':71662, '1f1ea-1f1ed':71663, '1f1ea-1f1f7':71664, '1f1ea-1f1f8':71665, '1f1ea-1f1f9':71666, '1f1ea-1f1fa':71667, '1f1eb-1f1ee':71668, '1f1eb-1f1ef':71669, '1f1eb-1f1f0':71670, '1f1eb-1f1f2':71671, '1f1eb-1f1f4':71672, '1f1eb-1f1f7':71673, '1f1ec-1f1e6':71674, '1f1ec-1f1e7':71675, '1f1ec-1f1e9':71676, '1f1ec-1f1ea':71677, '1f1ec-1f1eb':71678, '1f1ec-1f1ec':71679, '1f1ec-1f1ed':71680, '1f1ec-1f1ee':71681, '1f1ec-1f1f1':71682, '1f1ec-1f1f2':71683, '1f1ec-1f1f3':71684, '1f1ec-1f1f5':71685, '1f1ec-1f1f6':71686, '1f1ec-1f1f7':71687, '1f1ec-1f1f8':71688, '1f1ec-1f1f9':71689, '1f1ec-1f1fa':71690, '1f1ec-1f1fc':71691, '1f1ec-1f1fe':71692, '1f1ed-1f1f0':71693, '1f1ed-1f1f2':71694, '1f1ed-1f1f3':71695, '1f1ed-1f1f7':71696, '1f1ed-1f1f9':71697, '1f1ed-1f1fa':71698, '1f1ee-1f1e8':71699, '1f1ee-1f1e9':71700, '1f1ee-1f1ea':71701, '1f1ee-1f1f1':71702, '1f1ee-1f1f2':71703, '1f1ee-1f1f3':71704, '1f1ee-1f1f4':71705, '1f1ee-1f1f6':71706, '1f1ee-1f1f7':71707, '1f1ee-1f1f8':71708, '1f1ee-1f1f9':71709, '1f1ef-1f1ea':71710, '1f1ef-1f1f2':71711, '1f1ef-1f1f4':71712, '1f1ef-1f1f5':71713, '1f1f0-1f1ea':71714, '1f1f0-1f1ec':71715, '1f1f0-1f1ed':71716, '1f1f0-1f1ee':71717, '1f1f0-1f1f2':71718, '1f1f0-1f1f3':71719, '1f1f0-1f1f5':71720, '1f1f0-1f1f7':71721, '1f1f0-1f1fc':71722, '1f1f0-1f1fe':71723, '1f1f0-1f1ff':71724, '1f1f1-1f1e6':71725, '1f1f1-1f1e7':71726, '1f1f1-1f1e8':71727, '1f1f1-1f1ee':71728, '1f1f1-1f1f0':71729, '1f1f1-1f1f7':71730, '1f1f1-1f1f8':71731, '1f1f1-1f1f9':71732, '1f1f1-1f1fa':71733, '1f1f1-1f1fb':71734, '1f1f1-1f1fe':71735, '1f1f2-1f1e6':71736, '1f1f2-1f1e8':71737, '1f1f2-1f1e9':71738, '1f1f2-1f1ea':71739, '1f1f2-1f1eb':71740, '1f1f2-1f1ec':71741, '1f1f2-1f1ed':71742, '1f1f2-1f1f0':71743, '1f1f2-1f1f1':71744, '1f1f2-1f1f2':71745, '1f1f2-1f1f3':71746, '1f1f2-1f1f4':71747, '1f1f2-1f1f5':71748, '1f1f2-1f1f6':71749, '1f1f2-1f1f7':71750, '1f1f2-1f1f8':71751, '1f1f2-1f1f9':71752, '1f1f2-1f1fa':71753, '1f1f2-1f1fb':71754, '1f1f2-1f1fc':71755, '1f1f2-1f1fd':71756, '1f1f2-1f1fe':71757, '1f1f2-1f1ff':71758, '1f1f3-1f1e6':71759, '1f1f3-1f1e8':71760, '1f1f3-1f1ea':71761, '1f1f3-1f1eb':71762, '1f1f3-1f1ec':71763, '1f1f3-1f1ee':71764, '1f1f3-1f1f1':71765, '1f1f3-1f1f4':71766, '1f1f3-1f1f5':71767, '1f1f3-1f1f7':71768, '1f1f3-1f1fa':71769, '1f1f3-1f1ff':71770, '1f1f4-1f1f2':71771, '1f1f5-1f1e6':71772, '1f1f5-1f1ea':71773, '1f1f5-1f1eb':71774, '1f1f5-1f1ec':71775, '1f1f5-1f1ed':71776, '1f1f5-1f1f0':71777, '1f1f5-1f1f1':71778, '1f1f5-1f1f2':71779, '1f1f5-1f1f3':71780, '1f1f5-1f1f7':71781, '1f1f5-1f1f8':71782, '1f1f5-1f1f9':71783, '1f1f5-1f1fc':71784, '1f1f5-1f1fe':71785, '1f1f6-1f1e6':71786, '1f1f7-1f1ea':71787, '1f1f7-1f1f4':71788, '1f1f7-1f1f8':71789, '1f1f7-1f1fa':71790, '1f1f7-1f1fc':71791, '1f1f8-1f1e6':71792, '1f1f8-1f1e7':71793, '1f1f8-1f1e8':71794, '1f1f8-1f1e9':71795, '1f1f8-1f1ea':71796, '1f1f8-1f1ec':71797, '1f1f8-1f1ed':71798, '1f1f8-1f1ee':71799, '1f1f8-1f1ef':71800, '1f1f8-1f1f0':71801, '1f1f8-1f1f1':71802, '1f1f8-1f1f2':71803, '1f1f8-1f1f3':71804, '1f1f8-1f1f4':71805, '1f1f8-1f1f7':71806, '1f1f8-1f1f8':71807, '1f1f8-1f1f9':71808, '1f1f8-1f1fb':71809, '1f1f8-1f1fd':71810, '1f1f8-1f1fe':71811, '1f1f8-1f1ff':71812, '1f1f9-1f1e6':71813, '1f1f9-1f1e8':71814, '1f1f9-1f1e9':71815, '1f1f9-1f1eb':71816, '1f1f9-1f1ec':71817, '1f1f9-1f1ed':71818, '1f1f9-1f1ef':71819, '1f1f9-1f1f0':71820, '1f1f9-1f1f1':71821, '1f1f9-1f1f2':71822, '1f1f9-1f1f3':71823, '1f1f9-1f1f4':71824, '1f1f9-1f1f7':71825, '1f1f9-1f1f9':71826, '1f1f9-1f1fb':71827, '1f1f9-1f1fc':71828, '1f1f9-1f1ff':71829, '1f1fa-1f1e6':71830, '1f1fa-1f1ec':71831, '1f1fa-1f1f2':71832, '1f1fa-1f1f3':71833, '1f1fa-1f1f8':71834, '1f1fa-1f1fe':71835, '1f1fa-1f1ff':71836, '1f1fb-1f1e6':71837, '1f1fb-1f1e8':71838, '1f1fb-1f1ea':71839, '1f1fb-1f1ec':71840, '1f1fb-1f1ee':71841, '1f1fb-1f1f3':71842, '1f1fb-1f1fa':71843, '1f1fc-1f1eb':71844, '1f1fc-1f1f8':71845, '1f1fd-1f1f0':71846, '1f1fe-1f1ea':71847, '1f1fe-1f1f9':71848, '1f1ff-1f1e6':71849, '1f1ff-1f1f2':71850, '1f1ff-1f1fc':71851, '1f201':62899, '1f202':62900, '1f21a':62906, '1f22f':62903, '1f232':62907, '1f233':62911, '1f234':62910, '1f235':62915, '1f236':62902, '1f237':62901, '1f238':62909, '1f239':62905, '1f23a':62914, '1f250':62904, '1f251':62908, '1f300':41010, '1f301':4857, '1f302':41012, '1f303':4858, '1f304':4860, '1f305':4861, '1f306':4862, '1f307':4863, '1f308':41011, '1f309':4864, '1f30a':41023, '1f30b':4815, '1f30c':4997, '1f30d':4806, '1f30e':4807, '1f30f':4808, '1f310':4809, '1f311':4977, '1f312':4978, '1f313':4979, '1f314':4980, '1f315':4981, '1f316':4982, '1f317':4983, '1f318':4984, '1f319':4985, '1f31a':4986, '1f31b':4987, '1f31c':4988, '1f31d':4991, '1f31e':4992, '1f31f':4995, '1f320':4996, '1f321':4989, '1f324':41001, '1f325':41002, '1f326':41003, '1f327':41004, '1f328':41005, '1f329':41006, '1f32a':41007, '1f32b':41008, '1f32c':41009, '1f32d':3725, '1f32e':3727, '1f32f':3728, '1f330':3708, '1f331':2659, '1f332':2661, '1f333':2662, '1f334':2663, '1f335':2664, '1f336':3698, '1f337':2658, '1f338':2649, '1f339':2653, '1f33a':2655, '1f33b':2656, '1f33c':2657, '1f33d':3697, '1f33e':2665, '1f33f':2666, '1f340':2668, '1f341':2669, '1f342':2670, '1f343':2671, '1f344':3705, '1f345':3690, '1f346':3694, '1f347':3674, '1f348':3675, '1f349':3676, '1f34a':3677, '1f34b':3678, '1f34c':3679, '1f34d':3680, '1f34e':3682, '1f34f':3683, '1f350':3684, '1f351':3685, '1f352':3686, '1f353':3687, '1f354':3722, '1f355':3724, '1f356':3718, '1f357':3719, '1f358':3744, '1f359':3745, '1f35a':3746, '1f35b':3747, '1f35c':3748, '1f35d':3749, '1f35e':3709, '1f35f':3723, '1f360':3750, '1f361':3756, '1f362':3751, '1f363':3752, '1f364':3753, '1f365':3754, '1f366':3765, '1f367':3766, '1f368':3767, '1f369':3768, '1f36a':3769, '1f36b':3774, '1f36c':3775, '1f36d':3776, '1f36e':3777, '1f36f':3778, '1f370':3771, '1f371':3743, '1f372':3735, '1f373':3733, '1f374':3801, '1f375':3783, '1f376':3784, '1f377':3786, '1f378':3787, '1f379':3788, '1f37a':3789, '1f37b':3790, '1f37c':3779, '1f37d':3800, '1f37e':3785, '1f37f':3739, '1f380':51040, '1f381':51041, '1f382':3770, '1f383':51024, '1f384':51025, '1f385':1527, '1f386':51026, '1f387':51027, '1f388':51030, '1f389':51031, '1f38a':51032, '1f38b':51033, '1f38c':71588, '1f38d':51034, '1f38e':51035, '1f38f':51036, '1f390':51037, '1f391':51038, '1f392':61134, '1f393':61147, '1f396':51045, '1f397':51042, '1f399':61167, '1f39a':61168, '1f39b':61169, '1f39e':61203, '1f39f':51043, '1f3a0':4866, '1f3a1':4868, '1f3a2':4869, '1f3a3':51072, '1f3a4':61170, '1f3a5':61202, '1f3a6':62819, '1f3a7':61171, '1f3a8':51105, '1f3a9':61146, '1f3aa':4871, '1f3ab':51044, '1f3ac':61205, '1f3ad':51103, '1f3ae':51086, '1f3af':51078, '1f3b0':51088, '1f3b1':51081, '1f3b2':51089, '1f3b3':51060, '1f3b4':51102, '1f3b5':61165, '1f3b6':61166, '1f3b7':61173, '1f3b8':61175, '1f3b9':61176, '1f3ba':61177, '1f3bb':61178, '1f3bc':61164, '1f3bd':51074, '1f3be':51058, '1f3bf':51075, '1f3c0':51054, '1f3c1':71586, '1f3c2':1600, '1f3c3-200d-2640':1584, '1f3c3-200d-2642':1583, '1f3c3':1582, '1f3c4-200d-2640':1606, '1f3c4-200d-2642':1605, '1f3c4':1604, '1f3c5':51047, '1f3c6':51046, '1f3c7':1598, '1f3c8':51056, '1f3c9':51057, '1f3ca-200d-2640':1612, '1f3ca-200d-2642':1611, '1f3ca':1610, '1f3cb-200d-2640':1618, '1f3cb-200d-2642':1617, '1f3cb':1616, '1f3cc-200d-2640':1603, '1f3cc-200d-2642':1602, '1f3cc':1601, '1f3cd':4902, '1f3ce':4901, '1f3cf':51061, '1f3d0':51055, '1f3d1':51062, '1f3d2':51063, '1f3d3':51065, '1f3d4':4813, '1f3d5':4817, '1f3d6':4818, '1f3d7':4824, '1f3d8':4829, '1f3d9':4859, '1f3da':4830, '1f3db':4823, '1f3dc':4819, '1f3dd':4820, '1f3de':4821, '1f3df':4822, '1f3e0':4831, '1f3e1':4832, '1f3e2':4833, '1f3e3':4834, '1f3e4':4835, '1f3e5':4836, '1f3e6':4837, '1f3e7':62729, '1f3e8':4838, '1f3e9':4839, '1f3ea':4840, '1f3eb':4841, '1f3ec':4842, '1f3ed':4843, '1f3ee':61216, '1f3ef':4844, '1f3f0':4845, '1f3f3-200d-1f308':71591, '1f3f3-200d-26a7':71592, '1f3f3':71590, '1f3f4-200d-2620':71593, '1f3f4-e0067-e0062-e0065-e006e-e0067-e007f':71852, '1f3f4-e0067-e0062-e0073-e0063-e0074-e007f':71853, '1f3f4-e0067-e0062-e0077-e006c-e0073-e007f':71854, '1f3f4':71589, '1f3f5':2652, '1f3f7':61234, '1f3f8':51066, '1f3f9':61303, '1f3fa':3805, '1f3fb':9525, '1f3fc':9526, '1f3fd':9527, '1f3fe':9528, '1f3ff':9529, '1f400':2576, '1f401':2575, '1f402':2556, '1f403':2557, '1f404':2558, '1f405':2547, '1f406':2548, '1f407':2579, '1f408-200d-2b1b':2544, '1f408':2543, '1f409':2618, '1f40a':2613, '1f40b':2622, '1f40c':2632, '1f40d':2616, '1f40e':2550, '1f40f':2563, '1f410':2565, '1f411':2564, '1f412':2531, '1f413':2596, '1f414':2595, '1f415-200d-1f9ba':2537, '1f415':2535, '1f416':2560, '1f417':2561, '1f418':2570, '1f419':2629, '1f41a':2630, '1f41b':2634, '1f41c':2635, '1f41d':2636, '1f41e':2638, '1f41f':2625, '1f420':2626, '1f421':2627, '1f422':2614, '1f423':2597, '1f424':2598, '1f425':2599, '1f426':2600, '1f427':2601, '1f428':2586, '1f429':2538, '1f42a':2566, '1f42b':2567, '1f42c':2623, '1f42d':2574, '1f42e':2555, '1f42f':2546, '1f430':2578, '1f431':2542, '1f432':2617, '1f433':2621, '1f434':2549, '1f435':2530, '1f436':2534, '1f437':2559, '1f438':2612, '1f439':2577, '1f43a':2539, '1f43b-200d-2744':2585, '1f43b':2584, '1f43c':2587, '1f43d':2562, '1f43e':2593, '1f43f':2580, '1f440':1381, '1f441-200d-1f5e8':1159, '1f441':1382, '1f442':1373, '1f443':1375, '1f444':1384, '1f445':1383, '1f446':1347, '1f447':1349, '1f448':1345, '1f449':1346, '1f44a':1355, '1f44b':1327, '1f44c':1336, '1f44d':1352, '1f44e':1353, '1f44f':1358, '1f450':1361, '1f451':61144, '1f452':61145, '1f453':61110, '1f454':61115, '1f455':61116, '1f456':61117, '1f457':61122, '1f458':61123, '1f459':61128, '1f45a':61129, '1f45b':61130, '1f45c':61131, '1f45d':61132, '1f45e':61136, '1f45f':61137, '1f460':61140, '1f461':61141, '1f462':61143, '1f463':1687, '1f464':1684, '1f465':1685, '1f466':1388, '1f467':1389, '1f468-200d-1f33e':1457, '1f468-200d-1f373':1460, '1f468-200d-1f37c':1524, '1f468-200d-1f393':1448, '1f468-200d-1f3a4':1478, '1f468-200d-1f3a8':1481, '1f468-200d-1f3eb':1451, '1f468-200d-1f3ed':1466, '1f468-200d-1f466-200d-1f466':1674, '1f468-200d-1f466':1673, '1f468-200d-1f467-200d-1f466':1676, '1f468-200d-1f467-200d-1f467':1677, '1f468-200d-1f467':1675, '1f468-200d-1f468-200d-1f466':1663, '1f468-200d-1f468-200d-1f466-200d-1f466':1666, '1f468-200d-1f468-200d-1f467':1664, '1f468-200d-1f468-200d-1f467-200d-1f466':1665, '1f468-200d-1f468-200d-1f467-200d-1f467':1667, '1f468-200d-1f469-200d-1f466':1658, '1f468-200d-1f469-200d-1f466-200d-1f466':1661, '1f468-200d-1f469-200d-1f467':1659, '1f468-200d-1f469-200d-1f467-200d-1f466':1660, '1f468-200d-1f469-200d-1f467-200d-1f467':1662, '1f468-200d-1f4bb':1475, '1f468-200d-1f4bc':1469, '1f468-200d-1f527':1463, '1f468-200d-1f52c':1472, '1f468-200d-1f680':1487, '1f468-200d-1f692':1490, '1f468-200d-1f9af':1574, '1f468-200d-1f9b0':1396, '1f468-200d-1f9b1':1397, '1f468-200d-1f9b2':1399, '1f468-200d-1f9b3':1398, '1f468-200d-1f9bc':1577, '1f468-200d-1f9bd':1580, '1f468-200d-2695':1445, '1f468-200d-2696':1454, '1f468-200d-2708':1484, '1f468-200d-2764-200d-1f468':1655, '1f468-200d-2764-200d-1f48b-200d-1f468':1651, '1f468':1392, '1f469-200d-1f33e':1458, '1f469-200d-1f373':1461, '1f469-200d-1f37c':1523, '1f469-200d-1f393':1449, '1f469-200d-1f3a4':1479, '1f469-200d-1f3a8':1482, '1f469-200d-1f3eb':1452, '1f469-200d-1f3ed':1467, '1f469-200d-1f466-200d-1f466':1679, '1f469-200d-1f466':1678, '1f469-200d-1f467-200d-1f466':1681, '1f469-200d-1f467-200d-1f467':1682, '1f469-200d-1f467':1680, '1f469-200d-1f469-200d-1f466':1668, '1f469-200d-1f469-200d-1f466-200d-1f466':1671, '1f469-200d-1f469-200d-1f467':1669, '1f469-200d-1f469-200d-1f467-200d-1f466':1670, '1f469-200d-1f469-200d-1f467-200d-1f467':1672, '1f469-200d-1f4bb':1476, '1f469-200d-1f4bc':1470, '1f469-200d-1f527':1464, '1f469-200d-1f52c':1473, '1f469-200d-1f680':1488, '1f469-200d-1f692':1491, '1f469-200d-1f9af':1575, '1f469-200d-1f9b0':1401, '1f469-200d-1f9b1':1403, '1f469-200d-1f9b2':1407, '1f469-200d-1f9b3':1405, '1f469-200d-1f9bc':1578, '1f469-200d-1f9bd':1581, '1f469-200d-2695':1446, '1f469-200d-2696':1455, '1f469-200d-2708':1485, '1f469-200d-2764-200d-1f468':1654, '1f469-200d-2764-200d-1f469':1656, '1f469-200d-2764-200d-1f48b-200d-1f468':1650, '1f469-200d-2764-200d-1f48b-200d-1f469':1652, '1f469':1400, '1f46a':1657, '1f46b':1647, '1f46c':1648, '1f46d':1646, '1f46e-200d-2640':1494, '1f46e-200d-2642':1493, '1f46e':1492, '1f46f-200d-2640':1590, '1f46f-200d-2642':1589, '1f46f':1588, '1f470-200d-2640':1518, '1f470-200d-2642':1517, '1f470':1516, '1f471-200d-2640':1409, '1f471-200d-2642':1410, '1f471':1391, '1f472':1511, '1f473-200d-2640':1510, '1f473-200d-2642':1509, '1f473':1508, '1f474':1412, '1f475':1413, '1f476':1386, '1f477-200d-2640':1504, '1f477-200d-2642':1503, '1f477':1502, '1f478':1507, '1f479':1109, '1f47a':1110, '1f47b':1111, '1f47c':1526, '1f47d':1112, '1f47e':1113, '1f47f':1104, '1f480':1105, '1f481-200d-2640':1428, '1f481-200d-2642':1427, '1f481':1426, '1f482-200d-2640':1500, '1f482-200d-2642':1499, '1f482':1498, '1f483':1585, '1f484':61152, '1f485':1366, '1f486-200d-2640':1560, '1f486-200d-2642':1559, '1f486':1558, '1f487-200d-2640':1563, '1f487-200d-2642':1562, '1f487':1561, '1f488':4870, '1f489':61326, '1f48a':61328, '1f48b':1127, '1f48c':1128, '1f48d':61153, '1f48e':61154, '1f48f':1649, '1f490':2648, '1f491':1653, '1f492':4846, '1f493':1133, '1f494':1138, '1f495':1135, '1f496':1131, '1f497':1132, '1f498':1129, '1f499':1145, '1f49a':1144, '1f49b':1143, '1f49c':1146, '1f49d':1130, '1f49e':1134, '1f49f':1136, '1f4a0':62946, '1f4a1':61214, '1f4a2':1151, '1f4a3':1157, '1f4a4':1163, '1f4a5':1152, '1f4a6':1154, '1f4a7':41022, '1f4a8':1155, '1f4a9':1107, '1f4aa':1368, '1f4ab':1153, '1f4ac':1158, '1f4ad':1162, '1f4ae':2650, '1f4af':1150, '1f4b0':61235, '1f4b1':62841, '1f4b2':62842, '1f4b3':61242, '1f4b4':61237, '1f4b5':61238, '1f4b6':61239, '1f4b7':61240, '1f4b8':61241, '1f4b9':61244, '1f4ba':4936, '1f4bb':61191, '1f4bc':61265, '1f4bd':61197, '1f4be':61198, '1f4bf':61199, '1f4c0':61200, '1f4c1':61266, '1f4c2':61267, '1f4c3':61227, '1f4c4':61229, '1f4c5':61269, '1f4c6':61270, '1f4c7':61273, '1f4c8':61274, '1f4c9':61275, '1f4ca':61276, '1f4cb':61277, '1f4cc':61278, '1f4cd':61279, '1f4ce':61280, '1f4cf':61282, '1f4d0':61283, '1f4d1':61232, '1f4d2':61226, '1f4d3':61225, '1f4d4':61218, '1f4d5':61219, '1f4d6':61220, '1f4d7':61221, '1f4d8':61222, '1f4d9':61223, '1f4da':61224, '1f4db':62847, '1f4dc':61228, '1f4dd':61264, '1f4de':61185, '1f4df':61186, '1f4e0':61187, '1f4e1':61325, '1f4e2':61159, '1f4e3':61160, '1f4e4':61249, '1f4e5':61250, '1f4e6':61251, '1f4e7':61246, '1f4e8':61247, '1f4e9':61248, '1f4ea':61253, '1f4eb':61252, '1f4ec':61254, '1f4ed':61255, '1f4ee':61256, '1f4ef':61161, '1f4f0':61230, '1f4f1':61182, '1f4f2':61183, '1f4f3':62823, '1f4f4':62824, '1f4f5':62751, '1f4f6':62822, '1f4f7':61207, '1f4f8':61208, '1f4f9':61209, '1f4fa':61206, '1f4fb':61172, '1f4fc':61210, '1f4fd':61204, '1f4ff':61151, '1f500':62801, '1f501':62802, '1f502':62803, '1f503':62769, '1f504':62770, '1f505':62820, '1f506':62821, '1f507':61155, '1f508':61156, '1f509':61157, '1f50a':61158, '1f50b':61188, '1f50c':61190, '1f50d':61211, '1f50e':61212, '1f50f':61290, '1f510':61291, '1f511':61292, '1f512':61288, '1f513':61289, '1f514':61162, '1f515':61163, '1f516':61233, '1f517':61313, '1f518':62947, '1f519':62771, '1f51a':62772, '1f51b':62773, '1f51c':62774, '1f51d':62775, '1f51e':62752, '1f51f':62876, '1f520':62877, '1f521':62878, '1f522':62879, '1f523':62880, '1f524':62881, '1f525':41021, '1f526':61215, '1f527':61306, '1f528':61294, '1f529':61308, '1f52a':3803, '1f52b':61301, '1f52c':61323, '1f52d':61324, '1f52e':51082, '1f52f':62787, '1f530':62848, '1f531':62846, '1f532':62949, '1f533':62948, '1f534':62916, '1f535':62920, '1f536':62940, '1f537':62941, '1f538':62942, '1f539':62943, '1f53a':62944, '1f53b':62945, '1f53c':62811, '1f53d':62813, '1f549':62778, '1f54a':2602, '1f54b':4854, '1f54c':4850, '1f54d':4852, '1f54e':62786, '1f550':4955, '1f551':4957, '1f552':4959, '1f553':4961, '1f554':4963, '1f555':4965, '1f556':4967, '1f557':4969, '1f558':4971, '1f559':4973, '1f55a':4975, '1f55b':4953, '1f55c':4956, '1f55d':4958, '1f55e':4960, '1f55f':4962, '1f560':4964, '1f561':4966, '1f562':4968, '1f563':4970, '1f564':4972, '1f565':4974, '1f566':4976, '1f567':4954, '1f56f':61213, '1f570':4952, '1f573':1156, '1f574':1587, '1f575-200d-2640':1497, '1f575-200d-2642':1496, '1f575':1495, '1f576':61111, '1f577':2641, '1f578':2642, '1f579':51087, '1f57a':1586, '1f587':61281, '1f58a':61261, '1f58b':61260, '1f58c':61262, '1f58d':61263, '1f590':1329, '1f595':1348, '1f596':1331, '1f5a4':1148, '1f5a5':61192, '1f5a8':61193, '1f5b1':61195, '1f5b2':61196, '1f5bc':51104, '1f5c2':61268, '1f5c3':61285, '1f5c4':61286, '1f5d1':61287, '1f5d2':61271, '1f5d3':61272, '1f5dc':61310, '1f5dd':61293, '1f5de':61231, '1f5e1':61299, '1f5e3':1683, '1f5e8':1160, '1f5ef':1161, '1f5f3':61257, '1f5fa':4810, '1f5fb':4816, '1f5fc':4847, '1f5fd':4848, '1f5fe':4811, '1f5ff':61362, '1f600':11, '1f601':14, '1f602':18, '1f603':12, '1f604':13, '1f605':16, '1f606':15, '1f607':114, '1f608':1103, '1f609':112, '1f60a':113, '1f60b':124, '1f60c':150, '1f60d':116, '1f60e':170, '1f60f':144, '1f610':139, '1f611':140, '1f612':145, '1f613':195, '1f614':151, '1f615':173, '1f616':192, '1f617':119, '1f618':118, '1f619':122, '1f61a':121, '1f61b':125, '1f61c':126, '1f61d':128, '1f61e':194, '1f61f':175, '1f620':1101, '1f621':1100, '1f622':189, '1f623':193, '1f624':199, '1f625':188, '1f626':184, '1f627':185, '1f628':186, '1f629':196, '1f62a':152, '1f62b':197, '1f62c':147, '1f62d':190, '1f62e-200d-1f4a8':148, '1f62e':178, '1f62f':179, '1f630':187, '1f631':191, '1f632':180, '1f633':181, '1f634':154, '1f635-200d-1f4ab':165, '1f635':164, '1f636-200d-1f32b':143, '1f636':141, '1f637':155, '1f638':1116, '1f639':1117, '1f63a':1115, '1f63b':1118, '1f63c':1119, '1f63d':1120, '1f63e':1123, '1f63f':1122, '1f640':1121, '1f641':176, '1f642':19, '1f643':110, '1f644':146, '1f645-200d-2640':1422, '1f645-200d-2642':1421, '1f645':1420, '1f646-200d-2640':1425, '1f646-200d-2642':1424, '1f646':1423, '1f647-200d-2640':1437, '1f647-200d-2642':1436, '1f647':1435, '1f648':1124, '1f649':1125, '1f64a':1126, '1f64b-200d-2640':1431, '1f64b-200d-2642':1430, '1f64b':1429, '1f64c':1359, '1f64d-200d-2640':1416, '1f64d-200d-2642':1415, '1f64d':1414, '1f64e-200d-2640':1419, '1f64e-200d-2642':1418, '1f64e':1417, '1f64f':1364, '1f680':4942, '1f681':4937, '1f682':4872, '1f683':4873, '1f684':4874, '1f685':4875, '1f686':4876, '1f687':4877, '1f688':4878, '1f689':4879, '1f68a':4880, '1f68b':4883, '1f68c':4884, '1f68d':4885, '1f68e':4886, '1f68f':4911, '1f690':4887, '1f691':4888, '1f692':4889, '1f693':4890, '1f694':4891, '1f695':4892, '1f696':4893, '1f697':4894, '1f698':4895, '1f699':4896, '1f69a':4898, '1f69b':4899, '1f69c':4900, '1f69d':4881, '1f69e':4882, '1f69f':4938, '1f6a0':4939, '1f6a1':4940, '1f6a2':4930, '1f6a3-200d-2640':1609, '1f6a3-200d-2642':1608, '1f6a3':1607, '1f6a4':4926, '1f6a5':4918, '1f6a6':4919, '1f6a7':4921, '1f6a8':4917, '1f6a9':71587, '1f6aa':61333, '1f6ab':62745, '1f6ac':61358, '1f6ad':62747, '1f6ae':62730, '1f6af':62748, '1f6b0':62731, '1f6b1':62749, '1f6b2':4907, '1f6b3':62746, '1f6b4-200d-2640':1621, '1f6b4-200d-2642':1620, '1f6b4':1619, '1f6b5-200d-2640':1624, '1f6b5-200d-2642':1623, '1f6b5':1622, '1f6b6-200d-2640':1566, '1f6b6-200d-2642':1565, '1f6b6':1564, '1f6b7':62750, '1f6b8':62743, '1f6b9':62733, '1f6ba':62734, '1f6bb':62735, '1f6bc':62736, '1f6bd':61340, '1f6be':62737, '1f6bf':61342, '1f6c0':1643, '1f6c1':61343, '1f6c2':62738, '1f6c3':62739, '1f6c4':62740, '1f6c5':62741, '1f6cb':61338, '1f6cc':1644, '1f6cd':61133, '1f6ce':4944, '1f6cf':61337, '1f6d0':62776, '1f6d1':4920, '1f6d2':61357, '1f6d5':4851, '1f6d6':4828, '1f6d7':61334, '1f6e0':61298, '1f6e1':61304, '1f6e2':4914, '1f6e3':4912, '1f6e4':4913, '1f6e5':4929, '1f6e9':4932, '1f6eb':4933, '1f6ec':4934, '1f6f0':4941, '1f6f3':4927, '1f6f4':4908, '1f6f5':4903, '1f6f6':4925, '1f6f7':51076, '1f6f8':4943, '1f6f9':4909, '1f6fa':4906, '1f6fb':4897, '1f6fc':4910, '1f7e0':62917, '1f7e1':62918, '1f7e2':62919, '1f7e3':62921, '1f7e4':62922, '1f7e5':62925, '1f7e6':62929, '1f7e7':62926, '1f7e8':62927, '1f7e9':62928, '1f7ea':62930, '1f7eb':62931, '1f90c':1337, '1f90d':1149, '1f90e':1147, '1f90f':1338, '1f910':137, '1f911':129, '1f912':156, '1f913':171, '1f914':135, '1f915':157, '1f916':1114, '1f917':130, '1f918':1343, '1f919':1344, '1f91a':1328, '1f91b':1356, '1f91c':1357, '1f91d':1363, '1f91e':1340, '1f91f':1342, '1f920':167, '1f921':1108, '1f922':158, '1f923':17, '1f924':153, '1f925':149, '1f926-200d-2640':1440, '1f926-200d-2642':1439, '1f926':1438, '1f927':160, '1f928':138, '1f929':117, '1f92a':127, '1f92b':134, '1f92c':1102, '1f92d':131, '1f92e':159, '1f92f':166, '1f930':1519, '1f931':1522, '1f932':1362, '1f933':1367, '1f934':1506, '1f935-200d-2640':1515, '1f935-200d-2642':1514, '1f935':1513, '1f936':1528, '1f937-200d-2640':1443, '1f937-200d-2642':1442, '1f937':1441, '1f938-200d-2640':1627, '1f938-200d-2642':1626, '1f938':1625, '1f939-200d-2640':1639, '1f939-200d-2642':1638, '1f939':1637, '1f93a':1597, '1f93c-200d-2640':1630, '1f93c-200d-2642':1629, '1f93c':1628, '1f93d-200d-2640':1633, '1f93d-200d-2642':1632, '1f93d':1631, '1f93e-200d-2640':1636, '1f93e-200d-2642':1635, '1f93e':1634, '1f93f':51073, '1f940':2654, '1f941':61180, '1f942':3791, '1f943':3792, '1f944':3802, '1f945':51069, '1f947':51048, '1f948':51049, '1f949':51050, '1f94a':51067, '1f94b':51068, '1f94c':51077, '1f94d':51064, '1f94e':51053, '1f94f':51059, '1f950':3710, '1f951':3693, '1f952':3700, '1f953':3721, '1f954':3695, '1f955':3696, '1f956':3711, '1f957':3738, '1f958':3734, '1f959':3730, '1f95a':3732, '1f95b':3780, '1f95c':3706, '1f95d':3689, '1f95e':3715, '1f95f':3757, '1f960':3758, '1f961':3759, '1f962':3799, '1f963':3737, '1f964':3794, '1f965':3692, '1f966':3702, '1f967':3773, '1f968':3713, '1f969':3720, '1f96a':3726, '1f96b':3742, '1f96c':3701, '1f96d':3681, '1f96e':3755, '1f96f':3714, '1f970':115, '1f971':198, '1f972':123, '1f973':168, '1f974':163, '1f975':161, '1f976':162, '1f977':1501, '1f978':169, '1f97a':182, '1f97b':61124, '1f97c':61113, '1f97d':61112, '1f97e':61138, '1f97f':61139, '1f980':3760, '1f981':2545, '1f982':2643, '1f983':2594, '1f984':2551, '1f985':2603, '1f986':2604, '1f987':2583, '1f988':2628, '1f989':2606, '1f98a':2540, '1f98b':2633, '1f98c':2553, '1f98d':2532, '1f98e':2615, '1f98f':2572, '1f990':3762, '1f991':3763, '1f992':2569, '1f993':2552, '1f994':2582, '1f995':2619, '1f996':2620, '1f997':2639, '1f998':2591, '1f999':2568, '1f99a':2610, '1f99b':2573, '1f99c':2611, '1f99d':2541, '1f99e':3761, '1f99f':2644, '1f9a0':2647, '1f9a1':2592, '1f9a2':2605, '1f9a3':2571, '1f9a4':2607, '1f9a5':2588, '1f9a6':2589, '1f9a7':2533, '1f9a8':2590, '1f9a9':2609, '1f9aa':3764, '1f9ab':2581, '1f9ac':2554, '1f9ad':2624, '1f9ae':2536, '1f9af':61312, '1f9b4':1380, '1f9b5':1371, '1f9b6':1372, '1f9b7':1379, '1f9b8-200d-2640':1532, '1f9b8-200d-2642':1531, '1f9b8':1530, '1f9b9-200d-2640':1535, '1f9b9-200d-2642':1534, '1f9b9':1533, '1f9ba':61114, '1f9bb':1374, '1f9bc':4905, '1f9bd':4904, '1f9be':1369, '1f9bf':1370, '1f9c0':3717, '1f9c1':3772, '1f9c2':3741, '1f9c3':3796, '1f9c4':3703, '1f9c5':3704, '1f9c6':3731, '1f9c7':3716, '1f9c8':3740, '1f9c9':3797, '1f9ca':3798, '1f9cb':3795, '1f9cd-200d-2640':1569, '1f9cd-200d-2642':1568, '1f9cd':1567, '1f9ce-200d-2640':1572, '1f9ce-200d-2642':1571, '1f9ce':1570, '1f9cf-200d-2640':1434, '1f9cf-200d-2642':1433, '1f9cf':1432, '1f9d0':172, '1f9d1-200d-1f33e':1456, '1f9d1-200d-1f373':1459, '1f9d1-200d-1f37c':1525, '1f9d1-200d-1f384':1529, '1f9d1-200d-1f393':1447, '1f9d1-200d-1f3a4':1477, '1f9d1-200d-1f3a8':1480, '1f9d1-200d-1f3eb':1450, '1f9d1-200d-1f3ed':1465, '1f9d1-200d-1f4bb':1474, '1f9d1-200d-1f4bc':1468, '1f9d1-200d-1f527':1462, '1f9d1-200d-1f52c':1471, '1f9d1-200d-1f680':1486, '1f9d1-200d-1f692':1489, '1f9d1-200d-1f91d-200d-1f9d1':1645, '1f9d1-200d-1f9af':1573, '1f9d1-200d-1f9b0':1402, '1f9d1-200d-1f9b1':1404, '1f9d1-200d-1f9b2':1408, '1f9d1-200d-1f9b3':1406, '1f9d1-200d-1f9bc':1576, '1f9d1-200d-1f9bd':1579, '1f9d1-200d-2695':1444, '1f9d1-200d-2696':1453, '1f9d1-200d-2708':1483, '1f9d1':1390, '1f9d2':1387, '1f9d3':1411, '1f9d4-200d-2640':1395, '1f9d4-200d-2642':1394, '1f9d4':1393, '1f9d5':1512, '1f9d6-200d-2640':1593, '1f9d6-200d-2642':1592, '1f9d6':1591, '1f9d7-200d-2640':1596, '1f9d7-200d-2642':1595, '1f9d7':1594, '1f9d8-200d-2640':1642, '1f9d8-200d-2642':1641, '1f9d8':1640, '1f9d9-200d-2640':1538, '1f9d9-200d-2642':1537, '1f9d9':1536, '1f9da-200d-2640':1541, '1f9da-200d-2642':1540, '1f9da':1539, '1f9db-200d-2640':1544, '1f9db-200d-2642':1543, '1f9db':1542, '1f9dc-200d-2640':1547, '1f9dc-200d-2642':1546, '1f9dc':1545, '1f9dd-200d-2640':1550, '1f9dd-200d-2642':1549, '1f9dd':1548, '1f9de-200d-2640':1553, '1f9de-200d-2642':1552, '1f9de':1551, '1f9df-200d-2640':1556, '1f9df-200d-2642':1555, '1f9df':1554, '1f9e0':1376, '1f9e1':1142, '1f9e2':61148, '1f9e3':61118, '1f9e4':61119, '1f9e5':61120, '1f9e6':61121, '1f9e7':51039, '1f9e8':51028, '1f9e9':51090, '1f9ea':61320, '1f9eb':61321, '1f9ec':61322, '1f9ed':4812, '1f9ee':61201, '1f9ef':61356, '1f9f0':61316, '1f9f1':4825, '1f9f2':61317, '1f9f3':4945, '1f9f4':61346, '1f9f5':51106, '1f9f6':51108, '1f9f7':61347, '1f9f8':51091, '1f9f9':61348, '1f9fa':61349, '1f9fb':61350, '1f9fc':61352, '1f9fd':61355, '1f9fe':61243, '1f9ff':51084, '1fa70':61142, '1fa71':61125, '1fa72':61126, '1fa73':61127, '1fa74':61135, '1fa78':61327, '1fa79':61329, '1fa7a':61331, '1fa80':51079, '1fa81':51080, '1fa82':4935, '1fa83':61302, '1fa84':51083, '1fa85':51092, '1fa86':51094, '1fa90':4993, '1fa91':61339, '1fa92':61345, '1fa93':61295, '1fa94':61217, '1fa95':61179, '1fa96':61149, '1fa97':61174, '1fa98':61181, '1fa99':61236, '1fa9a':61305, '1fa9b':61307, '1fa9c':61318, '1fa9d':61315, '1fa9e':61335, '1fa9f':61336, '1faa0':61341, '1faa1':51107, '1faa2':51109, '1faa3':61351, '1faa4':61344, '1faa5':61354, '1faa6':61360, '1faa7':61363, '1faa8':4826, '1fab0':2645, '1fab1':2646, '1fab2':2637, '1fab3':2640, '1fab4':2660, '1fab5':4827, '1fab6':2608, '1fac0':1377, '1fac1':1378, '1fac2':1686, '1fad0':3688, '1fad1':3699, '1fad2':3691, '1fad3':3712, '1fad4':3729, '1fad5':3736, '1fad6':3782, '203c':62834, '21a9':62765, '21aa':62766, '231a':4948, '231b':4946, '23cf':62818, '23e9':62805, '23ea':62809, '23eb':62812, '23ec':62814, '23ed':62806, '23ee':62810, '23ef':62807, '23f0':4949, '23f1':4950, '23f2':4951, '23f3':4947, '23f8':62815, '23f9':62816, '23fa':62817, '24c2':62890, '25aa':62938, '25ab':62939, '25b6':62804, '25c0':62808, '25fb':62935, '25fc':62934, '25fd':62937, '25fe':62936, '260e':61184, '261d':1350, '262a':62784, '262e':62785, '262f':62781, '263a':120, '264a':62790, '264b':62791, '264c':62792, '264d':62793, '264e':62794, '264f':62795, '265f':51099, '267b':62844, '267e':62833, '267f':62732, '269b':62777, '269c':62845, '26a0':62742, '26a1':41016, '26a7':62827, '26aa':62924, '26ab':62923, '26b0':61359, '26b1':61361, '26bd':51051, '26be':51052, '26c4':41019, '26c5':4999, '26c8':41000, '26ce':62800, '26cf':61296, '26d1':61150, '26d3':61314, '26d4':62744, '26e9':4853, '26ea':4849, '26f0':4814, '26f1':41015, '26f2':4855, '26f3':51070, '26f4':4928, '26f5':4924, '26f7':1599, '26f8':51071, '26f9-200d-2640':1615, '26f9-200d-2642':1614, '26f9':1613, '26fa':4856, '26fd':4915, '270a':1354, '270b':1330, '270c':1339, '270d':1365, '270f':61258, '271d':62782, '274c':62853, '274e':62854, '2764-200d-1f525':1139, '2764-200d-1fa79':1140, '27a1':62757, '27b0':62855, '27bf':62856, '2b05':62761, '2b06':62755, '2b07':62759, '2b1b':62932, '2b1c':62933, '2b50':4994, '2b55':62849, '303d':62857, '1f385-1f3fb':0, '1f385-1f3fc':0, '1f385-1f3fd':0, '1f385-1f3fe':0, '1f385-1f3ff':0, '1f3c2-1f3fb':0, '1f3c2-1f3fc':0, '1f3c2-1f3fd':0, '1f3c2-1f3fe':0, '1f3c2-1f3ff':0, '1f3c3-1f3fb-200d-2640':0, '1f3c3-1f3fc-200d-2640':0, '1f3c3-1f3fd-200d-2640':0, '1f3c3-1f3fe-200d-2640':0, '1f3c3-1f3ff-200d-2640':0, '1f3c3-1f3fb-200d-2642':0, '1f3c3-1f3fc-200d-2642':0, '1f3c3-1f3fd-200d-2642':0, '1f3c3-1f3fe-200d-2642':0, '1f3c3-1f3ff-200d-2642':0, '1f3c3-1f3fb':0, '1f3c3-1f3fc':0, '1f3c3-1f3fd':0, '1f3c3-1f3fe':0, '1f3c3-1f3ff':0, '1f3c4-1f3fb-200d-2640':0, '1f3c4-1f3fc-200d-2640':0, '1f3c4-1f3fd-200d-2640':0, '1f3c4-1f3fe-200d-2640':0, '1f3c4-1f3ff-200d-2640':0, '1f3c4-1f3fb-200d-2642':0, '1f3c4-1f3fc-200d-2642':0, '1f3c4-1f3fd-200d-2642':0, '1f3c4-1f3fe-200d-2642':0, '1f3c4-1f3ff-200d-2642':0, '1f3c4-1f3fb':0, '1f3c4-1f3fc':0, '1f3c4-1f3fd':0, '1f3c4-1f3fe':0, '1f3c4-1f3ff':0, '1f3c7-1f3fb':0, '1f3c7-1f3fc':0, '1f3c7-1f3fd':0, '1f3c7-1f3fe':0, '1f3c7-1f3ff':0, '1f3ca-1f3fb-200d-2640':0, '1f3ca-1f3fc-200d-2640':0, '1f3ca-1f3fd-200d-2640':0, '1f3ca-1f3fe-200d-2640':0, '1f3ca-1f3ff-200d-2640':0, '1f3ca-1f3fb-200d-2642':0, '1f3ca-1f3fc-200d-2642':0, '1f3ca-1f3fd-200d-2642':0, '1f3ca-1f3fe-200d-2642':0, '1f3ca-1f3ff-200d-2642':0, '1f3ca-1f3fb':0, '1f3ca-1f3fc':0, '1f3ca-1f3fd':0, '1f3ca-1f3fe':0, '1f3ca-1f3ff':0, '1f3cb-1f3fb-200d-2640':0, '1f3cb-1f3fc-200d-2640':0, '1f3cb-1f3fd-200d-2640':0, '1f3cb-1f3fe-200d-2640':0, '1f3cb-1f3ff-200d-2640':0, '1f3cb-1f3fb-200d-2642':0, '1f3cb-1f3fc-200d-2642':0, '1f3cb-1f3fd-200d-2642':0, '1f3cb-1f3fe-200d-2642':0, '1f3cb-1f3ff-200d-2642':0, '1f3cb-1f3fb':0, '1f3cb-1f3fc':0, '1f3cb-1f3fd':0, '1f3cb-1f3fe':0, '1f3cb-1f3ff':0, '1f3cc-1f3fb-200d-2640':0, '1f3cc-1f3fc-200d-2640':0, '1f3cc-1f3fd-200d-2640':0, '1f3cc-1f3fe-200d-2640':0, '1f3cc-1f3ff-200d-2640':0, '1f3cc-1f3fb-200d-2642':0, '1f3cc-1f3fc-200d-2642':0, '1f3cc-1f3fd-200d-2642':0, '1f3cc-1f3fe-200d-2642':0, '1f3cc-1f3ff-200d-2642':0, '1f3cc-1f3fb':0, '1f3cc-1f3fc':0, '1f3cc-1f3fd':0, '1f3cc-1f3fe':0, '1f3cc-1f3ff':0, '1f442-1f3fb':0, '1f442-1f3fc':0, '1f442-1f3fd':0, '1f442-1f3fe':0, '1f442-1f3ff':0, '1f443-1f3fb':0, '1f443-1f3fc':0, '1f443-1f3fd':0, '1f443-1f3fe':0, '1f443-1f3ff':0, '1f446-1f3fb':0, '1f446-1f3fc':0, '1f446-1f3fd':0, '1f446-1f3fe':0, '1f446-1f3ff':0, '1f447-1f3fb':0, '1f447-1f3fc':0, '1f447-1f3fd':0, '1f447-1f3fe':0, '1f447-1f3ff':0, '1f448-1f3fb':0, '1f448-1f3fc':0, '1f448-1f3fd':0, '1f448-1f3fe':0, '1f448-1f3ff':0, '1f449-1f3fb':0, '1f449-1f3fc':0, '1f449-1f3fd':0, '1f449-1f3fe':0, '1f449-1f3ff':0, '1f44a-1f3fb':0, '1f44a-1f3fc':0, '1f44a-1f3fd':0, '1f44a-1f3fe':0, '1f44a-1f3ff':0, '1f44b-1f3fb':0, '1f44b-1f3fc':0, '1f44b-1f3fd':0, '1f44b-1f3fe':0, '1f44b-1f3ff':0, '1f44c-1f3fb':0, '1f44c-1f3fc':0, '1f44c-1f3fd':0, '1f44c-1f3fe':0, '1f44c-1f3ff':0, '1f44d-1f3fb':0, '1f44d-1f3fc':0, '1f44d-1f3fd':0, '1f44d-1f3fe':0, '1f44d-1f3ff':0, '1f44e-1f3fb':0, '1f44e-1f3fc':0, '1f44e-1f3fd':0, '1f44e-1f3fe':0, '1f44e-1f3ff':0, '1f44f-1f3fb':0, '1f44f-1f3fc':0, '1f44f-1f3fd':0, '1f44f-1f3fe':0, '1f44f-1f3ff':0, '1f450-1f3fb':0, '1f450-1f3fc':0, '1f450-1f3fd':0, '1f450-1f3fe':0, '1f450-1f3ff':0, '1f466-1f3fb':0, '1f466-1f3fc':0, '1f466-1f3fd':0, '1f466-1f3fe':0, '1f466-1f3ff':0, '1f467-1f3fb':0, '1f467-1f3fc':0, '1f467-1f3fd':0, '1f467-1f3fe':0, '1f467-1f3ff':0, '1f468-1f3fb-200d-1f33e':0, '1f468-1f3fc-200d-1f33e':0, '1f468-1f3fd-200d-1f33e':0, '1f468-1f3fe-200d-1f33e':0, '1f468-1f3ff-200d-1f33e':0, '1f468-1f3fb-200d-1f373':0, '1f468-1f3fc-200d-1f373':0, '1f468-1f3fd-200d-1f373':0, '1f468-1f3fe-200d-1f373':0, '1f468-1f3ff-200d-1f373':0, '1f468-1f3fb-200d-1f37c':0, '1f468-1f3fc-200d-1f37c':0, '1f468-1f3fd-200d-1f37c':0, '1f468-1f3fe-200d-1f37c':0, '1f468-1f3ff-200d-1f37c':0, '1f468-1f3fb-200d-1f393':0, '1f468-1f3fc-200d-1f393':0, '1f468-1f3fd-200d-1f393':0, '1f468-1f3fe-200d-1f393':0, '1f468-1f3ff-200d-1f393':0, '1f468-1f3fb-200d-1f3a4':0, '1f468-1f3fc-200d-1f3a4':0, '1f468-1f3fd-200d-1f3a4':0, '1f468-1f3fe-200d-1f3a4':0, '1f468-1f3ff-200d-1f3a4':0, '1f468-1f3fb-200d-1f3a8':0, '1f468-1f3fc-200d-1f3a8':0, '1f468-1f3fd-200d-1f3a8':0, '1f468-1f3fe-200d-1f3a8':0, '1f468-1f3ff-200d-1f3a8':0, '1f468-1f3fb-200d-1f3eb':0, '1f468-1f3fc-200d-1f3eb':0, '1f468-1f3fd-200d-1f3eb':0, '1f468-1f3fe-200d-1f3eb':0, '1f468-1f3ff-200d-1f3eb':0, '1f468-1f3fb-200d-1f3ed':0, '1f468-1f3fc-200d-1f3ed':0, '1f468-1f3fd-200d-1f3ed':0, '1f468-1f3fe-200d-1f3ed':0, '1f468-1f3ff-200d-1f3ed':0, '1f468-1f3fb-200d-1f4bb':0, '1f468-1f3fc-200d-1f4bb':0, '1f468-1f3fd-200d-1f4bb':0, '1f468-1f3fe-200d-1f4bb':0, '1f468-1f3ff-200d-1f4bb':0, '1f468-1f3fb-200d-1f4bc':0, '1f468-1f3fc-200d-1f4bc':0, '1f468-1f3fd-200d-1f4bc':0, '1f468-1f3fe-200d-1f4bc':0, '1f468-1f3ff-200d-1f4bc':0, '1f468-1f3fb-200d-1f527':0, '1f468-1f3fc-200d-1f527':0, '1f468-1f3fd-200d-1f527':0, '1f468-1f3fe-200d-1f527':0, '1f468-1f3ff-200d-1f527':0, '1f468-1f3fb-200d-1f52c':0, '1f468-1f3fc-200d-1f52c':0, '1f468-1f3fd-200d-1f52c':0, '1f468-1f3fe-200d-1f52c':0, '1f468-1f3ff-200d-1f52c':0, '1f468-1f3fb-200d-1f680':0, '1f468-1f3fc-200d-1f680':0, '1f468-1f3fd-200d-1f680':0, '1f468-1f3fe-200d-1f680':0, '1f468-1f3ff-200d-1f680':0, '1f468-1f3fb-200d-1f692':0, '1f468-1f3fc-200d-1f692':0, '1f468-1f3fd-200d-1f692':0, '1f468-1f3fe-200d-1f692':0, '1f468-1f3ff-200d-1f692':0, '1f468-1f3fb-200d-1f9af':0, '1f468-1f3fc-200d-1f9af':0, '1f468-1f3fd-200d-1f9af':0, '1f468-1f3fe-200d-1f9af':0, '1f468-1f3ff-200d-1f9af':0, '1f468-1f3fb-200d-1f9b0':0, '1f468-1f3fc-200d-1f9b0':0, '1f468-1f3fd-200d-1f9b0':0, '1f468-1f3fe-200d-1f9b0':0, '1f468-1f3ff-200d-1f9b0':0, '1f468-1f3fb-200d-1f9b1':0, '1f468-1f3fc-200d-1f9b1':0, '1f468-1f3fd-200d-1f9b1':0, '1f468-1f3fe-200d-1f9b1':0, '1f468-1f3ff-200d-1f9b1':0, '1f468-1f3fb-200d-1f9b2':0, '1f468-1f3fc-200d-1f9b2':0, '1f468-1f3fd-200d-1f9b2':0, '1f468-1f3fe-200d-1f9b2':0, '1f468-1f3ff-200d-1f9b2':0, '1f468-1f3fb-200d-1f9b3':0, '1f468-1f3fc-200d-1f9b3':0, '1f468-1f3fd-200d-1f9b3':0, '1f468-1f3fe-200d-1f9b3':0, '1f468-1f3ff-200d-1f9b3':0, '1f468-1f3fb-200d-1f9bc':0, '1f468-1f3fc-200d-1f9bc':0, '1f468-1f3fd-200d-1f9bc':0, '1f468-1f3fe-200d-1f9bc':0, '1f468-1f3ff-200d-1f9bc':0, '1f468-1f3fb-200d-1f9bd':0, '1f468-1f3fc-200d-1f9bd':0, '1f468-1f3fd-200d-1f9bd':0, '1f468-1f3fe-200d-1f9bd':0, '1f468-1f3ff-200d-1f9bd':0, '1f468-1f3fb-200d-2695':0, '1f468-1f3fc-200d-2695':0, '1f468-1f3fd-200d-2695':0, '1f468-1f3fe-200d-2695':0, '1f468-1f3ff-200d-2695':0, '1f468-1f3fb-200d-2696':0, '1f468-1f3fc-200d-2696':0, '1f468-1f3fd-200d-2696':0, '1f468-1f3fe-200d-2696':0, '1f468-1f3ff-200d-2696':0, '1f468-1f3fb-200d-2708':0, '1f468-1f3fc-200d-2708':0, '1f468-1f3fd-200d-2708':0, '1f468-1f3fe-200d-2708':0, '1f468-1f3ff-200d-2708':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3fb':0, '1f468-1f3fc':0, '1f468-1f3fd':0, '1f468-1f3fe':0, '1f468-1f3ff':0, '1f469-1f3fb-200d-1f33e':0, '1f469-1f3fc-200d-1f33e':0, '1f469-1f3fd-200d-1f33e':0, '1f469-1f3fe-200d-1f33e':0, '1f469-1f3ff-200d-1f33e':0, '1f469-1f3fb-200d-1f373':0, '1f469-1f3fc-200d-1f373':0, '1f469-1f3fd-200d-1f373':0, '1f469-1f3fe-200d-1f373':0, '1f469-1f3ff-200d-1f373':0, '1f469-1f3fb-200d-1f37c':0, '1f469-1f3fc-200d-1f37c':0, '1f469-1f3fd-200d-1f37c':0, '1f469-1f3fe-200d-1f37c':0, '1f469-1f3ff-200d-1f37c':0, '1f469-1f3fb-200d-1f393':0, '1f469-1f3fc-200d-1f393':0, '1f469-1f3fd-200d-1f393':0, '1f469-1f3fe-200d-1f393':0, '1f469-1f3ff-200d-1f393':0, '1f469-1f3fb-200d-1f3a4':0, '1f469-1f3fc-200d-1f3a4':0, '1f469-1f3fd-200d-1f3a4':0, '1f469-1f3fe-200d-1f3a4':0, '1f469-1f3ff-200d-1f3a4':0, '1f469-1f3fb-200d-1f3a8':0, '1f469-1f3fc-200d-1f3a8':0, '1f469-1f3fd-200d-1f3a8':0, '1f469-1f3fe-200d-1f3a8':0, '1f469-1f3ff-200d-1f3a8':0, '1f469-1f3fb-200d-1f3eb':0, '1f469-1f3fc-200d-1f3eb':0, '1f469-1f3fd-200d-1f3eb':0, '1f469-1f3fe-200d-1f3eb':0, '1f469-1f3ff-200d-1f3eb':0, '1f469-1f3fb-200d-1f3ed':0, '1f469-1f3fc-200d-1f3ed':0, '1f469-1f3fd-200d-1f3ed':0, '1f469-1f3fe-200d-1f3ed':0, '1f469-1f3ff-200d-1f3ed':0, '1f469-1f3fb-200d-1f4bb':0, '1f469-1f3fc-200d-1f4bb':0, '1f469-1f3fd-200d-1f4bb':0, '1f469-1f3fe-200d-1f4bb':0, '1f469-1f3ff-200d-1f4bb':0, '1f469-1f3fb-200d-1f4bc':0, '1f469-1f3fc-200d-1f4bc':0, '1f469-1f3fd-200d-1f4bc':0, '1f469-1f3fe-200d-1f4bc':0, '1f469-1f3ff-200d-1f4bc':0, '1f469-1f3fb-200d-1f527':0, '1f469-1f3fc-200d-1f527':0, '1f469-1f3fd-200d-1f527':0, '1f469-1f3fe-200d-1f527':0, '1f469-1f3ff-200d-1f527':0, '1f469-1f3fb-200d-1f52c':0, '1f469-1f3fc-200d-1f52c':0, '1f469-1f3fd-200d-1f52c':0, '1f469-1f3fe-200d-1f52c':0, '1f469-1f3ff-200d-1f52c':0, '1f469-1f3fb-200d-1f680':0, '1f469-1f3fc-200d-1f680':0, '1f469-1f3fd-200d-1f680':0, '1f469-1f3fe-200d-1f680':0, '1f469-1f3ff-200d-1f680':0, '1f469-1f3fb-200d-1f692':0, '1f469-1f3fc-200d-1f692':0, '1f469-1f3fd-200d-1f692':0, '1f469-1f3fe-200d-1f692':0, '1f469-1f3ff-200d-1f692':0, '1f469-1f3fb-200d-1f9af':0, '1f469-1f3fc-200d-1f9af':0, '1f469-1f3fd-200d-1f9af':0, '1f469-1f3fe-200d-1f9af':0, '1f469-1f3ff-200d-1f9af':0, '1f469-1f3fb-200d-1f9b0':0, '1f469-1f3fc-200d-1f9b0':0, '1f469-1f3fd-200d-1f9b0':0, '1f469-1f3fe-200d-1f9b0':0, '1f469-1f3ff-200d-1f9b0':0, '1f469-1f3fb-200d-1f9b1':0, '1f469-1f3fc-200d-1f9b1':0, '1f469-1f3fd-200d-1f9b1':0, '1f469-1f3fe-200d-1f9b1':0, '1f469-1f3ff-200d-1f9b1':0, '1f469-1f3fb-200d-1f9b2':0, '1f469-1f3fc-200d-1f9b2':0, '1f469-1f3fd-200d-1f9b2':0, '1f469-1f3fe-200d-1f9b2':0, '1f469-1f3ff-200d-1f9b2':0, '1f469-1f3fb-200d-1f9b3':0, '1f469-1f3fc-200d-1f9b3':0, '1f469-1f3fd-200d-1f9b3':0, '1f469-1f3fe-200d-1f9b3':0, '1f469-1f3ff-200d-1f9b3':0, '1f469-1f3fb-200d-1f9bc':0, '1f469-1f3fc-200d-1f9bc':0, '1f469-1f3fd-200d-1f9bc':0, '1f469-1f3fe-200d-1f9bc':0, '1f469-1f3ff-200d-1f9bc':0, '1f469-1f3fb-200d-1f9bd':0, '1f469-1f3fc-200d-1f9bd':0, '1f469-1f3fd-200d-1f9bd':0, '1f469-1f3fe-200d-1f9bd':0, '1f469-1f3ff-200d-1f9bd':0, '1f469-1f3fb-200d-2695':0, '1f469-1f3fc-200d-2695':0, '1f469-1f3fd-200d-2695':0, '1f469-1f3fe-200d-2695':0, '1f469-1f3ff-200d-2695':0, '1f469-1f3fb-200d-2696':0, '1f469-1f3fc-200d-2696':0, '1f469-1f3fd-200d-2696':0, '1f469-1f3fe-200d-2696':0, '1f469-1f3ff-200d-2696':0, '1f469-1f3fb-200d-2708':0, '1f469-1f3fc-200d-2708':0, '1f469-1f3fd-200d-2708':0, '1f469-1f3fe-200d-2708':0, '1f469-1f3ff-200d-2708':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3fb':0, '1f469-1f3fc':0, '1f469-1f3fd':0, '1f469-1f3fe':0, '1f469-1f3ff':0, '1f46b-1f3fb':0, '1f46b-1f3fc':0, '1f46b-1f3fd':0, '1f46b-1f3fe':0, '1f46b-1f3ff':0, '1f469-1f3fb-200d-1f91d-200d-1f468-1f3fc':0, '1f469-1f3fb-200d-1f91d-200d-1f468-1f3fd':0, '1f469-1f3fb-200d-1f91d-200d-1f468-1f3fe':0, '1f469-1f3fb-200d-1f91d-200d-1f468-1f3ff':0, '1f469-1f3fc-200d-1f91d-200d-1f468-1f3fb':0, '1f469-1f3fc-200d-1f91d-200d-1f468-1f3fd':0, '1f469-1f3fc-200d-1f91d-200d-1f468-1f3fe':0, '1f469-1f3fc-200d-1f91d-200d-1f468-1f3ff':0, '1f469-1f3fd-200d-1f91d-200d-1f468-1f3fb':0, '1f469-1f3fd-200d-1f91d-200d-1f468-1f3fc':0, '1f469-1f3fd-200d-1f91d-200d-1f468-1f3fe':0, '1f469-1f3fd-200d-1f91d-200d-1f468-1f3ff':0, '1f469-1f3fe-200d-1f91d-200d-1f468-1f3fb':0, '1f469-1f3fe-200d-1f91d-200d-1f468-1f3fc':0, '1f469-1f3fe-200d-1f91d-200d-1f468-1f3fd':0, '1f469-1f3fe-200d-1f91d-200d-1f468-1f3ff':0, '1f469-1f3ff-200d-1f91d-200d-1f468-1f3fb':0, '1f469-1f3ff-200d-1f91d-200d-1f468-1f3fc':0, '1f469-1f3ff-200d-1f91d-200d-1f468-1f3fd':0, '1f469-1f3ff-200d-1f91d-200d-1f468-1f3fe':0, '1f46c-1f3fb':0, '1f46c-1f3fc':0, '1f46c-1f3fd':0, '1f46c-1f3fe':0, '1f46c-1f3ff':0, '1f468-1f3fb-200d-1f91d-200d-1f468-1f3fc':0, '1f468-1f3fb-200d-1f91d-200d-1f468-1f3fd':0, '1f468-1f3fb-200d-1f91d-200d-1f468-1f3fe':0, '1f468-1f3fb-200d-1f91d-200d-1f468-1f3ff':0, '1f468-1f3fc-200d-1f91d-200d-1f468-1f3fb':0, '1f468-1f3fc-200d-1f91d-200d-1f468-1f3fd':0, '1f468-1f3fc-200d-1f91d-200d-1f468-1f3fe':0, '1f468-1f3fc-200d-1f91d-200d-1f468-1f3ff':0, '1f468-1f3fd-200d-1f91d-200d-1f468-1f3fb':0, '1f468-1f3fd-200d-1f91d-200d-1f468-1f3fc':0, '1f468-1f3fd-200d-1f91d-200d-1f468-1f3fe':0, '1f468-1f3fd-200d-1f91d-200d-1f468-1f3ff':0, '1f468-1f3fe-200d-1f91d-200d-1f468-1f3fb':0, '1f468-1f3fe-200d-1f91d-200d-1f468-1f3fc':0, '1f468-1f3fe-200d-1f91d-200d-1f468-1f3fd':0, '1f468-1f3fe-200d-1f91d-200d-1f468-1f3ff':0, '1f468-1f3ff-200d-1f91d-200d-1f468-1f3fb':0, '1f468-1f3ff-200d-1f91d-200d-1f468-1f3fc':0, '1f468-1f3ff-200d-1f91d-200d-1f468-1f3fd':0, '1f468-1f3ff-200d-1f91d-200d-1f468-1f3fe':0, '1f46d-1f3fb':0, '1f46d-1f3fc':0, '1f46d-1f3fd':0, '1f46d-1f3fe':0, '1f46d-1f3ff':0, '1f469-1f3fb-200d-1f91d-200d-1f469-1f3fc':0, '1f469-1f3fb-200d-1f91d-200d-1f469-1f3fd':0, '1f469-1f3fb-200d-1f91d-200d-1f469-1f3fe':0, '1f469-1f3fb-200d-1f91d-200d-1f469-1f3ff':0, '1f469-1f3fc-200d-1f91d-200d-1f469-1f3fb':0, '1f469-1f3fc-200d-1f91d-200d-1f469-1f3fd':0, '1f469-1f3fc-200d-1f91d-200d-1f469-1f3fe':0, '1f469-1f3fc-200d-1f91d-200d-1f469-1f3ff':0, '1f469-1f3fd-200d-1f91d-200d-1f469-1f3fb':0, '1f469-1f3fd-200d-1f91d-200d-1f469-1f3fc':0, '1f469-1f3fd-200d-1f91d-200d-1f469-1f3fe':0, '1f469-1f3fd-200d-1f91d-200d-1f469-1f3ff':0, '1f469-1f3fe-200d-1f91d-200d-1f469-1f3fb':0, '1f469-1f3fe-200d-1f91d-200d-1f469-1f3fc':0, '1f469-1f3fe-200d-1f91d-200d-1f469-1f3fd':0, '1f469-1f3fe-200d-1f91d-200d-1f469-1f3ff':0, '1f469-1f3ff-200d-1f91d-200d-1f469-1f3fb':0, '1f469-1f3ff-200d-1f91d-200d-1f469-1f3fc':0, '1f469-1f3ff-200d-1f91d-200d-1f469-1f3fd':0, '1f469-1f3ff-200d-1f91d-200d-1f469-1f3fe':0, '1f46e-1f3fb-200d-2640':0, '1f46e-1f3fc-200d-2640':0, '1f46e-1f3fd-200d-2640':0, '1f46e-1f3fe-200d-2640':0, '1f46e-1f3ff-200d-2640':0, '1f46e-1f3fb-200d-2642':0, '1f46e-1f3fc-200d-2642':0, '1f46e-1f3fd-200d-2642':0, '1f46e-1f3fe-200d-2642':0, '1f46e-1f3ff-200d-2642':0, '1f46e-1f3fb':0, '1f46e-1f3fc':0, '1f46e-1f3fd':0, '1f46e-1f3fe':0, '1f46e-1f3ff':0, '1f470-1f3fb-200d-2640':0, '1f470-1f3fc-200d-2640':0, '1f470-1f3fd-200d-2640':0, '1f470-1f3fe-200d-2640':0, '1f470-1f3ff-200d-2640':0, '1f470-1f3fb-200d-2642':0, '1f470-1f3fc-200d-2642':0, '1f470-1f3fd-200d-2642':0, '1f470-1f3fe-200d-2642':0, '1f470-1f3ff-200d-2642':0, '1f470-1f3fb':0, '1f470-1f3fc':0, '1f470-1f3fd':0, '1f470-1f3fe':0, '1f470-1f3ff':0, '1f471-1f3fb-200d-2640':0, '1f471-1f3fc-200d-2640':0, '1f471-1f3fd-200d-2640':0, '1f471-1f3fe-200d-2640':0, '1f471-1f3ff-200d-2640':0, '1f471-1f3fb-200d-2642':0, '1f471-1f3fc-200d-2642':0, '1f471-1f3fd-200d-2642':0, '1f471-1f3fe-200d-2642':0, '1f471-1f3ff-200d-2642':0, '1f471-1f3fb':0, '1f471-1f3fc':0, '1f471-1f3fd':0, '1f471-1f3fe':0, '1f471-1f3ff':0, '1f472-1f3fb':0, '1f472-1f3fc':0, '1f472-1f3fd':0, '1f472-1f3fe':0, '1f472-1f3ff':0, '1f473-1f3fb-200d-2640':0, '1f473-1f3fc-200d-2640':0, '1f473-1f3fd-200d-2640':0, '1f473-1f3fe-200d-2640':0, '1f473-1f3ff-200d-2640':0, '1f473-1f3fb-200d-2642':0, '1f473-1f3fc-200d-2642':0, '1f473-1f3fd-200d-2642':0, '1f473-1f3fe-200d-2642':0, '1f473-1f3ff-200d-2642':0, '1f473-1f3fb':0, '1f473-1f3fc':0, '1f473-1f3fd':0, '1f473-1f3fe':0, '1f473-1f3ff':0, '1f474-1f3fb':0, '1f474-1f3fc':0, '1f474-1f3fd':0, '1f474-1f3fe':0, '1f474-1f3ff':0, '1f475-1f3fb':0, '1f475-1f3fc':0, '1f475-1f3fd':0, '1f475-1f3fe':0, '1f475-1f3ff':0, '1f476-1f3fb':0, '1f476-1f3fc':0, '1f476-1f3fd':0, '1f476-1f3fe':0, '1f476-1f3ff':0, '1f477-1f3fb-200d-2640':0, '1f477-1f3fc-200d-2640':0, '1f477-1f3fd-200d-2640':0, '1f477-1f3fe-200d-2640':0, '1f477-1f3ff-200d-2640':0, '1f477-1f3fb-200d-2642':0, '1f477-1f3fc-200d-2642':0, '1f477-1f3fd-200d-2642':0, '1f477-1f3fe-200d-2642':0, '1f477-1f3ff-200d-2642':0, '1f477-1f3fb':0, '1f477-1f3fc':0, '1f477-1f3fd':0, '1f477-1f3fe':0, '1f477-1f3ff':0, '1f478-1f3fb':0, '1f478-1f3fc':0, '1f478-1f3fd':0, '1f478-1f3fe':0, '1f478-1f3ff':0, '1f47c-1f3fb':0, '1f47c-1f3fc':0, '1f47c-1f3fd':0, '1f47c-1f3fe':0, '1f47c-1f3ff':0, '1f481-1f3fb-200d-2640':0, '1f481-1f3fc-200d-2640':0, '1f481-1f3fd-200d-2640':0, '1f481-1f3fe-200d-2640':0, '1f481-1f3ff-200d-2640':0, '1f481-1f3fb-200d-2642':0, '1f481-1f3fc-200d-2642':0, '1f481-1f3fd-200d-2642':0, '1f481-1f3fe-200d-2642':0, '1f481-1f3ff-200d-2642':0, '1f481-1f3fb':0, '1f481-1f3fc':0, '1f481-1f3fd':0, '1f481-1f3fe':0, '1f481-1f3ff':0, '1f482-1f3fb-200d-2640':0, '1f482-1f3fc-200d-2640':0, '1f482-1f3fd-200d-2640':0, '1f482-1f3fe-200d-2640':0, '1f482-1f3ff-200d-2640':0, '1f482-1f3fb-200d-2642':0, '1f482-1f3fc-200d-2642':0, '1f482-1f3fd-200d-2642':0, '1f482-1f3fe-200d-2642':0, '1f482-1f3ff-200d-2642':0, '1f482-1f3fb':0, '1f482-1f3fc':0, '1f482-1f3fd':0, '1f482-1f3fe':0, '1f482-1f3ff':0, '1f483-1f3fb':0, '1f483-1f3fc':0, '1f483-1f3fd':0, '1f483-1f3fe':0, '1f483-1f3ff':0, '1f485-1f3fb':0, '1f485-1f3fc':0, '1f485-1f3fd':0, '1f485-1f3fe':0, '1f485-1f3ff':0, '1f486-1f3fb-200d-2640':0, '1f486-1f3fc-200d-2640':0, '1f486-1f3fd-200d-2640':0, '1f486-1f3fe-200d-2640':0, '1f486-1f3ff-200d-2640':0, '1f486-1f3fb-200d-2642':0, '1f486-1f3fc-200d-2642':0, '1f486-1f3fd-200d-2642':0, '1f486-1f3fe-200d-2642':0, '1f486-1f3ff-200d-2642':0, '1f486-1f3fb':0, '1f486-1f3fc':0, '1f486-1f3fd':0, '1f486-1f3fe':0, '1f486-1f3ff':0, '1f487-1f3fb-200d-2640':0, '1f487-1f3fc-200d-2640':0, '1f487-1f3fd-200d-2640':0, '1f487-1f3fe-200d-2640':0, '1f487-1f3ff-200d-2640':0, '1f487-1f3fb-200d-2642':0, '1f487-1f3fc-200d-2642':0, '1f487-1f3fd-200d-2642':0, '1f487-1f3fe-200d-2642':0, '1f487-1f3ff-200d-2642':0, '1f487-1f3fb':0, '1f487-1f3fc':0, '1f487-1f3fd':0, '1f487-1f3fe':0, '1f487-1f3ff':0, '1f48f-1f3fb':0, '1f48f-1f3fc':0, '1f48f-1f3fd':0, '1f48f-1f3fe':0, '1f48f-1f3ff':0, '1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fc':0, '1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fd':0, '1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fe':0, '1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3ff':0, '1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fb':0, '1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fd':0, '1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fe':0, '1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3ff':0, '1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fb':0, '1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fc':0, '1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fe':0, '1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3ff':0, '1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fb':0, '1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fc':0, '1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fd':0, '1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3ff':0, '1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fb':0, '1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fc':0, '1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fd':0, '1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fe':0, '1f491-1f3fb':0, '1f491-1f3fc':0, '1f491-1f3fd':0, '1f491-1f3fe':0, '1f491-1f3ff':0, '1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fc':0, '1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fd':0, '1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fe':0, '1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3ff':0, '1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fb':0, '1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fd':0, '1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fe':0, '1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3ff':0, '1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fb':0, '1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fc':0, '1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fe':0, '1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3ff':0, '1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fb':0, '1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fc':0, '1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fd':0, '1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3ff':0, '1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fb':0, '1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fc':0, '1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fd':0, '1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fe':0, '1f4aa-1f3fb':0, '1f4aa-1f3fc':0, '1f4aa-1f3fd':0, '1f4aa-1f3fe':0, '1f4aa-1f3ff':0, '1f574-1f3fb':0, '1f574-1f3fc':0, '1f574-1f3fd':0, '1f574-1f3fe':0, '1f574-1f3ff':0, '1f575-1f3fb-200d-2640':0, '1f575-1f3fc-200d-2640':0, '1f575-1f3fd-200d-2640':0, '1f575-1f3fe-200d-2640':0, '1f575-1f3ff-200d-2640':0, '1f575-1f3fb-200d-2642':0, '1f575-1f3fc-200d-2642':0, '1f575-1f3fd-200d-2642':0, '1f575-1f3fe-200d-2642':0, '1f575-1f3ff-200d-2642':0, '1f575-1f3fb':0, '1f575-1f3fc':0, '1f575-1f3fd':0, '1f575-1f3fe':0, '1f575-1f3ff':0, '1f57a-1f3fb':0, '1f57a-1f3fc':0, '1f57a-1f3fd':0, '1f57a-1f3fe':0, '1f57a-1f3ff':0, '1f590-1f3fb':0, '1f590-1f3fc':0, '1f590-1f3fd':0, '1f590-1f3fe':0, '1f590-1f3ff':0, '1f595-1f3fb':0, '1f595-1f3fc':0, '1f595-1f3fd':0, '1f595-1f3fe':0, '1f595-1f3ff':0, '1f596-1f3fb':0, '1f596-1f3fc':0, '1f596-1f3fd':0, '1f596-1f3fe':0, '1f596-1f3ff':0, '1f645-1f3fb-200d-2640':0, '1f645-1f3fc-200d-2640':0, '1f645-1f3fd-200d-2640':0, '1f645-1f3fe-200d-2640':0, '1f645-1f3ff-200d-2640':0, '1f645-1f3fb-200d-2642':0, '1f645-1f3fc-200d-2642':0, '1f645-1f3fd-200d-2642':0, '1f645-1f3fe-200d-2642':0, '1f645-1f3ff-200d-2642':0, '1f645-1f3fb':0, '1f645-1f3fc':0, '1f645-1f3fd':0, '1f645-1f3fe':0, '1f645-1f3ff':0, '1f646-1f3fb-200d-2640':0, '1f646-1f3fc-200d-2640':0, '1f646-1f3fd-200d-2640':0, '1f646-1f3fe-200d-2640':0, '1f646-1f3ff-200d-2640':0, '1f646-1f3fb-200d-2642':0, '1f646-1f3fc-200d-2642':0, '1f646-1f3fd-200d-2642':0, '1f646-1f3fe-200d-2642':0, '1f646-1f3ff-200d-2642':0, '1f646-1f3fb':0, '1f646-1f3fc':0, '1f646-1f3fd':0, '1f646-1f3fe':0, '1f646-1f3ff':0, '1f647-1f3fb-200d-2640':0, '1f647-1f3fc-200d-2640':0, '1f647-1f3fd-200d-2640':0, '1f647-1f3fe-200d-2640':0, '1f647-1f3ff-200d-2640':0, '1f647-1f3fb-200d-2642':0, '1f647-1f3fc-200d-2642':0, '1f647-1f3fd-200d-2642':0, '1f647-1f3fe-200d-2642':0, '1f647-1f3ff-200d-2642':0, '1f647-1f3fb':0, '1f647-1f3fc':0, '1f647-1f3fd':0, '1f647-1f3fe':0, '1f647-1f3ff':0, '1f64b-1f3fb-200d-2640':0, '1f64b-1f3fc-200d-2640':0, '1f64b-1f3fd-200d-2640':0, '1f64b-1f3fe-200d-2640':0, '1f64b-1f3ff-200d-2640':0, '1f64b-1f3fb-200d-2642':0, '1f64b-1f3fc-200d-2642':0, '1f64b-1f3fd-200d-2642':0, '1f64b-1f3fe-200d-2642':0, '1f64b-1f3ff-200d-2642':0, '1f64b-1f3fb':0, '1f64b-1f3fc':0, '1f64b-1f3fd':0, '1f64b-1f3fe':0, '1f64b-1f3ff':0, '1f64c-1f3fb':0, '1f64c-1f3fc':0, '1f64c-1f3fd':0, '1f64c-1f3fe':0, '1f64c-1f3ff':0, '1f64d-1f3fb-200d-2640':0, '1f64d-1f3fc-200d-2640':0, '1f64d-1f3fd-200d-2640':0, '1f64d-1f3fe-200d-2640':0, '1f64d-1f3ff-200d-2640':0, '1f64d-1f3fb-200d-2642':0, '1f64d-1f3fc-200d-2642':0, '1f64d-1f3fd-200d-2642':0, '1f64d-1f3fe-200d-2642':0, '1f64d-1f3ff-200d-2642':0, '1f64d-1f3fb':0, '1f64d-1f3fc':0, '1f64d-1f3fd':0, '1f64d-1f3fe':0, '1f64d-1f3ff':0, '1f64e-1f3fb-200d-2640':0, '1f64e-1f3fc-200d-2640':0, '1f64e-1f3fd-200d-2640':0, '1f64e-1f3fe-200d-2640':0, '1f64e-1f3ff-200d-2640':0, '1f64e-1f3fb-200d-2642':0, '1f64e-1f3fc-200d-2642':0, '1f64e-1f3fd-200d-2642':0, '1f64e-1f3fe-200d-2642':0, '1f64e-1f3ff-200d-2642':0, '1f64e-1f3fb':0, '1f64e-1f3fc':0, '1f64e-1f3fd':0, '1f64e-1f3fe':0, '1f64e-1f3ff':0, '1f64f-1f3fb':0, '1f64f-1f3fc':0, '1f64f-1f3fd':0, '1f64f-1f3fe':0, '1f64f-1f3ff':0, '1f6a3-1f3fb-200d-2640':0, '1f6a3-1f3fc-200d-2640':0, '1f6a3-1f3fd-200d-2640':0, '1f6a3-1f3fe-200d-2640':0, '1f6a3-1f3ff-200d-2640':0, '1f6a3-1f3fb-200d-2642':0, '1f6a3-1f3fc-200d-2642':0, '1f6a3-1f3fd-200d-2642':0, '1f6a3-1f3fe-200d-2642':0, '1f6a3-1f3ff-200d-2642':0, '1f6a3-1f3fb':0, '1f6a3-1f3fc':0, '1f6a3-1f3fd':0, '1f6a3-1f3fe':0, '1f6a3-1f3ff':0, '1f6b4-1f3fb-200d-2640':0, '1f6b4-1f3fc-200d-2640':0, '1f6b4-1f3fd-200d-2640':0, '1f6b4-1f3fe-200d-2640':0, '1f6b4-1f3ff-200d-2640':0, '1f6b4-1f3fb-200d-2642':0, '1f6b4-1f3fc-200d-2642':0, '1f6b4-1f3fd-200d-2642':0, '1f6b4-1f3fe-200d-2642':0, '1f6b4-1f3ff-200d-2642':0, '1f6b4-1f3fb':0, '1f6b4-1f3fc':0, '1f6b4-1f3fd':0, '1f6b4-1f3fe':0, '1f6b4-1f3ff':0, '1f6b5-1f3fb-200d-2640':0, '1f6b5-1f3fc-200d-2640':0, '1f6b5-1f3fd-200d-2640':0, '1f6b5-1f3fe-200d-2640':0, '1f6b5-1f3ff-200d-2640':0, '1f6b5-1f3fb-200d-2642':0, '1f6b5-1f3fc-200d-2642':0, '1f6b5-1f3fd-200d-2642':0, '1f6b5-1f3fe-200d-2642':0, '1f6b5-1f3ff-200d-2642':0, '1f6b5-1f3fb':0, '1f6b5-1f3fc':0, '1f6b5-1f3fd':0, '1f6b5-1f3fe':0, '1f6b5-1f3ff':0, '1f6b6-1f3fb-200d-2640':0, '1f6b6-1f3fc-200d-2640':0, '1f6b6-1f3fd-200d-2640':0, '1f6b6-1f3fe-200d-2640':0, '1f6b6-1f3ff-200d-2640':0, '1f6b6-1f3fb-200d-2642':0, '1f6b6-1f3fc-200d-2642':0, '1f6b6-1f3fd-200d-2642':0, '1f6b6-1f3fe-200d-2642':0, '1f6b6-1f3ff-200d-2642':0, '1f6b6-1f3fb':0, '1f6b6-1f3fc':0, '1f6b6-1f3fd':0, '1f6b6-1f3fe':0, '1f6b6-1f3ff':0, '1f6c0-1f3fb':0, '1f6c0-1f3fc':0, '1f6c0-1f3fd':0, '1f6c0-1f3fe':0, '1f6c0-1f3ff':0, '1f6cc-1f3fb':0, '1f6cc-1f3fc':0, '1f6cc-1f3fd':0, '1f6cc-1f3fe':0, '1f6cc-1f3ff':0, '1f90c-1f3fb':0, '1f90c-1f3fc':0, '1f90c-1f3fd':0, '1f90c-1f3fe':0, '1f90c-1f3ff':0, '1f90f-1f3fb':0, '1f90f-1f3fc':0, '1f90f-1f3fd':0, '1f90f-1f3fe':0, '1f90f-1f3ff':0, '1f918-1f3fb':0, '1f918-1f3fc':0, '1f918-1f3fd':0, '1f918-1f3fe':0, '1f918-1f3ff':0, '1f919-1f3fb':0, '1f919-1f3fc':0, '1f919-1f3fd':0, '1f919-1f3fe':0, '1f919-1f3ff':0, '1f91a-1f3fb':0, '1f91a-1f3fc':0, '1f91a-1f3fd':0, '1f91a-1f3fe':0, '1f91a-1f3ff':0, '1f91b-1f3fb':0, '1f91b-1f3fc':0, '1f91b-1f3fd':0, '1f91b-1f3fe':0, '1f91b-1f3ff':0, '1f91c-1f3fb':0, '1f91c-1f3fc':0, '1f91c-1f3fd':0, '1f91c-1f3fe':0, '1f91c-1f3ff':0, '1f91d-1f3fb':0, '1f91d-1f3fc':0, '1f91d-1f3fd':0, '1f91d-1f3fe':0, '1f91d-1f3ff':0, '1f91e-1f3fb':0, '1f91e-1f3fc':0, '1f91e-1f3fd':0, '1f91e-1f3fe':0, '1f91e-1f3ff':0, '1f91f-1f3fb':0, '1f91f-1f3fc':0, '1f91f-1f3fd':0, '1f91f-1f3fe':0, '1f91f-1f3ff':0, '1f926-1f3fb-200d-2640':0, '1f926-1f3fc-200d-2640':0, '1f926-1f3fd-200d-2640':0, '1f926-1f3fe-200d-2640':0, '1f926-1f3ff-200d-2640':0, '1f926-1f3fb-200d-2642':0, '1f926-1f3fc-200d-2642':0, '1f926-1f3fd-200d-2642':0, '1f926-1f3fe-200d-2642':0, '1f926-1f3ff-200d-2642':0, '1f926-1f3fb':0, '1f926-1f3fc':0, '1f926-1f3fd':0, '1f926-1f3fe':0, '1f926-1f3ff':0, '1f930-1f3fb':0, '1f930-1f3fc':0, '1f930-1f3fd':0, '1f930-1f3fe':0, '1f930-1f3ff':0, '1f931-1f3fb':0, '1f931-1f3fc':0, '1f931-1f3fd':0, '1f931-1f3fe':0, '1f931-1f3ff':0, '1f932-1f3fb':0, '1f932-1f3fc':0, '1f932-1f3fd':0, '1f932-1f3fe':0, '1f932-1f3ff':0, '1f933-1f3fb':0, '1f933-1f3fc':0, '1f933-1f3fd':0, '1f933-1f3fe':0, '1f933-1f3ff':0, '1f934-1f3fb':0, '1f934-1f3fc':0, '1f934-1f3fd':0, '1f934-1f3fe':0, '1f934-1f3ff':0, '1f935-1f3fb-200d-2640':0, '1f935-1f3fc-200d-2640':0, '1f935-1f3fd-200d-2640':0, '1f935-1f3fe-200d-2640':0, '1f935-1f3ff-200d-2640':0, '1f935-1f3fb-200d-2642':0, '1f935-1f3fc-200d-2642':0, '1f935-1f3fd-200d-2642':0, '1f935-1f3fe-200d-2642':0, '1f935-1f3ff-200d-2642':0, '1f935-1f3fb':0, '1f935-1f3fc':0, '1f935-1f3fd':0, '1f935-1f3fe':0, '1f935-1f3ff':0, '1f936-1f3fb':0, '1f936-1f3fc':0, '1f936-1f3fd':0, '1f936-1f3fe':0, '1f936-1f3ff':0, '1f937-1f3fb-200d-2640':0, '1f937-1f3fc-200d-2640':0, '1f937-1f3fd-200d-2640':0, '1f937-1f3fe-200d-2640':0, '1f937-1f3ff-200d-2640':0, '1f937-1f3fb-200d-2642':0, '1f937-1f3fc-200d-2642':0, '1f937-1f3fd-200d-2642':0, '1f937-1f3fe-200d-2642':0, '1f937-1f3ff-200d-2642':0, '1f937-1f3fb':0, '1f937-1f3fc':0, '1f937-1f3fd':0, '1f937-1f3fe':0, '1f937-1f3ff':0, '1f938-1f3fb-200d-2640':0, '1f938-1f3fc-200d-2640':0, '1f938-1f3fd-200d-2640':0, '1f938-1f3fe-200d-2640':0, '1f938-1f3ff-200d-2640':0, '1f938-1f3fb-200d-2642':0, '1f938-1f3fc-200d-2642':0, '1f938-1f3fd-200d-2642':0, '1f938-1f3fe-200d-2642':0, '1f938-1f3ff-200d-2642':0, '1f938-1f3fb':0, '1f938-1f3fc':0, '1f938-1f3fd':0, '1f938-1f3fe':0, '1f938-1f3ff':0, '1f939-1f3fb-200d-2640':0, '1f939-1f3fc-200d-2640':0, '1f939-1f3fd-200d-2640':0, '1f939-1f3fe-200d-2640':0, '1f939-1f3ff-200d-2640':0, '1f939-1f3fb-200d-2642':0, '1f939-1f3fc-200d-2642':0, '1f939-1f3fd-200d-2642':0, '1f939-1f3fe-200d-2642':0, '1f939-1f3ff-200d-2642':0, '1f939-1f3fb':0, '1f939-1f3fc':0, '1f939-1f3fd':0, '1f939-1f3fe':0, '1f939-1f3ff':0, '1f93d-1f3fb-200d-2640':0, '1f93d-1f3fc-200d-2640':0, '1f93d-1f3fd-200d-2640':0, '1f93d-1f3fe-200d-2640':0, '1f93d-1f3ff-200d-2640':0, '1f93d-1f3fb-200d-2642':0, '1f93d-1f3fc-200d-2642':0, '1f93d-1f3fd-200d-2642':0, '1f93d-1f3fe-200d-2642':0, '1f93d-1f3ff-200d-2642':0, '1f93d-1f3fb':0, '1f93d-1f3fc':0, '1f93d-1f3fd':0, '1f93d-1f3fe':0, '1f93d-1f3ff':0, '1f93e-1f3fb-200d-2640':0, '1f93e-1f3fc-200d-2640':0, '1f93e-1f3fd-200d-2640':0, '1f93e-1f3fe-200d-2640':0, '1f93e-1f3ff-200d-2640':0, '1f93e-1f3fb-200d-2642':0, '1f93e-1f3fc-200d-2642':0, '1f93e-1f3fd-200d-2642':0, '1f93e-1f3fe-200d-2642':0, '1f93e-1f3ff-200d-2642':0, '1f93e-1f3fb':0, '1f93e-1f3fc':0, '1f93e-1f3fd':0, '1f93e-1f3fe':0, '1f93e-1f3ff':0, '1f977-1f3fb':0, '1f977-1f3fc':0, '1f977-1f3fd':0, '1f977-1f3fe':0, '1f977-1f3ff':0, '1f9b5-1f3fb':0, '1f9b5-1f3fc':0, '1f9b5-1f3fd':0, '1f9b5-1f3fe':0, '1f9b5-1f3ff':0, '1f9b6-1f3fb':0, '1f9b6-1f3fc':0, '1f9b6-1f3fd':0, '1f9b6-1f3fe':0, '1f9b6-1f3ff':0, '1f9b8-1f3fb-200d-2640':0, '1f9b8-1f3fc-200d-2640':0, '1f9b8-1f3fd-200d-2640':0, '1f9b8-1f3fe-200d-2640':0, '1f9b8-1f3ff-200d-2640':0, '1f9b8-1f3fb-200d-2642':0, '1f9b8-1f3fc-200d-2642':0, '1f9b8-1f3fd-200d-2642':0, '1f9b8-1f3fe-200d-2642':0, '1f9b8-1f3ff-200d-2642':0, '1f9b8-1f3fb':0, '1f9b8-1f3fc':0, '1f9b8-1f3fd':0, '1f9b8-1f3fe':0, '1f9b8-1f3ff':0, '1f9b9-1f3fb-200d-2640':0, '1f9b9-1f3fc-200d-2640':0, '1f9b9-1f3fd-200d-2640':0, '1f9b9-1f3fe-200d-2640':0, '1f9b9-1f3ff-200d-2640':0, '1f9b9-1f3fb-200d-2642':0, '1f9b9-1f3fc-200d-2642':0, '1f9b9-1f3fd-200d-2642':0, '1f9b9-1f3fe-200d-2642':0, '1f9b9-1f3ff-200d-2642':0, '1f9b9-1f3fb':0, '1f9b9-1f3fc':0, '1f9b9-1f3fd':0, '1f9b9-1f3fe':0, '1f9b9-1f3ff':0, '1f9bb-1f3fb':0, '1f9bb-1f3fc':0, '1f9bb-1f3fd':0, '1f9bb-1f3fe':0, '1f9bb-1f3ff':0, '1f9cd-1f3fb-200d-2640':0, '1f9cd-1f3fc-200d-2640':0, '1f9cd-1f3fd-200d-2640':0, '1f9cd-1f3fe-200d-2640':0, '1f9cd-1f3ff-200d-2640':0, '1f9cd-1f3fb-200d-2642':0, '1f9cd-1f3fc-200d-2642':0, '1f9cd-1f3fd-200d-2642':0, '1f9cd-1f3fe-200d-2642':0, '1f9cd-1f3ff-200d-2642':0, '1f9cd-1f3fb':0, '1f9cd-1f3fc':0, '1f9cd-1f3fd':0, '1f9cd-1f3fe':0, '1f9cd-1f3ff':0, '1f9ce-1f3fb-200d-2640':0, '1f9ce-1f3fc-200d-2640':0, '1f9ce-1f3fd-200d-2640':0, '1f9ce-1f3fe-200d-2640':0, '1f9ce-1f3ff-200d-2640':0, '1f9ce-1f3fb-200d-2642':0, '1f9ce-1f3fc-200d-2642':0, '1f9ce-1f3fd-200d-2642':0, '1f9ce-1f3fe-200d-2642':0, '1f9ce-1f3ff-200d-2642':0, '1f9ce-1f3fb':0, '1f9ce-1f3fc':0, '1f9ce-1f3fd':0, '1f9ce-1f3fe':0, '1f9ce-1f3ff':0, '1f9cf-1f3fb-200d-2640':0, '1f9cf-1f3fc-200d-2640':0, '1f9cf-1f3fd-200d-2640':0, '1f9cf-1f3fe-200d-2640':0, '1f9cf-1f3ff-200d-2640':0, '1f9cf-1f3fb-200d-2642':0, '1f9cf-1f3fc-200d-2642':0, '1f9cf-1f3fd-200d-2642':0, '1f9cf-1f3fe-200d-2642':0, '1f9cf-1f3ff-200d-2642':0, '1f9cf-1f3fb':0, '1f9cf-1f3fc':0, '1f9cf-1f3fd':0, '1f9cf-1f3fe':0, '1f9cf-1f3ff':0, '1f9d1-1f3fb-200d-1f33e':0, '1f9d1-1f3fc-200d-1f33e':0, '1f9d1-1f3fd-200d-1f33e':0, '1f9d1-1f3fe-200d-1f33e':0, '1f9d1-1f3ff-200d-1f33e':0, '1f9d1-1f3fb-200d-1f373':0, '1f9d1-1f3fc-200d-1f373':0, '1f9d1-1f3fd-200d-1f373':0, '1f9d1-1f3fe-200d-1f373':0, '1f9d1-1f3ff-200d-1f373':0, '1f9d1-1f3fb-200d-1f37c':0, '1f9d1-1f3fc-200d-1f37c':0, '1f9d1-1f3fd-200d-1f37c':0, '1f9d1-1f3fe-200d-1f37c':0, '1f9d1-1f3ff-200d-1f37c':0, '1f9d1-1f3fb-200d-1f384':0, '1f9d1-1f3fc-200d-1f384':0, '1f9d1-1f3fd-200d-1f384':0, '1f9d1-1f3fe-200d-1f384':0, '1f9d1-1f3ff-200d-1f384':0, '1f9d1-1f3fb-200d-1f393':0, '1f9d1-1f3fc-200d-1f393':0, '1f9d1-1f3fd-200d-1f393':0, '1f9d1-1f3fe-200d-1f393':0, '1f9d1-1f3ff-200d-1f393':0, '1f9d1-1f3fb-200d-1f3a4':0, '1f9d1-1f3fc-200d-1f3a4':0, '1f9d1-1f3fd-200d-1f3a4':0, '1f9d1-1f3fe-200d-1f3a4':0, '1f9d1-1f3ff-200d-1f3a4':0, '1f9d1-1f3fb-200d-1f3a8':0, '1f9d1-1f3fc-200d-1f3a8':0, '1f9d1-1f3fd-200d-1f3a8':0, '1f9d1-1f3fe-200d-1f3a8':0, '1f9d1-1f3ff-200d-1f3a8':0, '1f9d1-1f3fb-200d-1f3eb':0, '1f9d1-1f3fc-200d-1f3eb':0, '1f9d1-1f3fd-200d-1f3eb':0, '1f9d1-1f3fe-200d-1f3eb':0, '1f9d1-1f3ff-200d-1f3eb':0, '1f9d1-1f3fb-200d-1f3ed':0, '1f9d1-1f3fc-200d-1f3ed':0, '1f9d1-1f3fd-200d-1f3ed':0, '1f9d1-1f3fe-200d-1f3ed':0, '1f9d1-1f3ff-200d-1f3ed':0, '1f9d1-1f3fb-200d-1f4bb':0, '1f9d1-1f3fc-200d-1f4bb':0, '1f9d1-1f3fd-200d-1f4bb':0, '1f9d1-1f3fe-200d-1f4bb':0, '1f9d1-1f3ff-200d-1f4bb':0, '1f9d1-1f3fb-200d-1f4bc':0, '1f9d1-1f3fc-200d-1f4bc':0, '1f9d1-1f3fd-200d-1f4bc':0, '1f9d1-1f3fe-200d-1f4bc':0, '1f9d1-1f3ff-200d-1f4bc':0, '1f9d1-1f3fb-200d-1f527':0, '1f9d1-1f3fc-200d-1f527':0, '1f9d1-1f3fd-200d-1f527':0, '1f9d1-1f3fe-200d-1f527':0, '1f9d1-1f3ff-200d-1f527':0, '1f9d1-1f3fb-200d-1f52c':0, '1f9d1-1f3fc-200d-1f52c':0, '1f9d1-1f3fd-200d-1f52c':0, '1f9d1-1f3fe-200d-1f52c':0, '1f9d1-1f3ff-200d-1f52c':0, '1f9d1-1f3fb-200d-1f680':0, '1f9d1-1f3fc-200d-1f680':0, '1f9d1-1f3fd-200d-1f680':0, '1f9d1-1f3fe-200d-1f680':0, '1f9d1-1f3ff-200d-1f680':0, '1f9d1-1f3fb-200d-1f692':0, '1f9d1-1f3fc-200d-1f692':0, '1f9d1-1f3fd-200d-1f692':0, '1f9d1-1f3fe-200d-1f692':0, '1f9d1-1f3ff-200d-1f692':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3fb-200d-1f9af':0, '1f9d1-1f3fc-200d-1f9af':0, '1f9d1-1f3fd-200d-1f9af':0, '1f9d1-1f3fe-200d-1f9af':0, '1f9d1-1f3ff-200d-1f9af':0, '1f9d1-1f3fb-200d-1f9b0':0, '1f9d1-1f3fc-200d-1f9b0':0, '1f9d1-1f3fd-200d-1f9b0':0, '1f9d1-1f3fe-200d-1f9b0':0, '1f9d1-1f3ff-200d-1f9b0':0, '1f9d1-1f3fb-200d-1f9b1':0, '1f9d1-1f3fc-200d-1f9b1':0, '1f9d1-1f3fd-200d-1f9b1':0, '1f9d1-1f3fe-200d-1f9b1':0, '1f9d1-1f3ff-200d-1f9b1':0, '1f9d1-1f3fb-200d-1f9b2':0, '1f9d1-1f3fc-200d-1f9b2':0, '1f9d1-1f3fd-200d-1f9b2':0, '1f9d1-1f3fe-200d-1f9b2':0, '1f9d1-1f3ff-200d-1f9b2':0, '1f9d1-1f3fb-200d-1f9b3':0, '1f9d1-1f3fc-200d-1f9b3':0, '1f9d1-1f3fd-200d-1f9b3':0, '1f9d1-1f3fe-200d-1f9b3':0, '1f9d1-1f3ff-200d-1f9b3':0, '1f9d1-1f3fb-200d-1f9bc':0, '1f9d1-1f3fc-200d-1f9bc':0, '1f9d1-1f3fd-200d-1f9bc':0, '1f9d1-1f3fe-200d-1f9bc':0, '1f9d1-1f3ff-200d-1f9bc':0, '1f9d1-1f3fb-200d-1f9bd':0, '1f9d1-1f3fc-200d-1f9bd':0, '1f9d1-1f3fd-200d-1f9bd':0, '1f9d1-1f3fe-200d-1f9bd':0, '1f9d1-1f3ff-200d-1f9bd':0, '1f9d1-1f3fb-200d-2695':0, '1f9d1-1f3fc-200d-2695':0, '1f9d1-1f3fd-200d-2695':0, '1f9d1-1f3fe-200d-2695':0, '1f9d1-1f3ff-200d-2695':0, '1f9d1-1f3fb-200d-2696':0, '1f9d1-1f3fc-200d-2696':0, '1f9d1-1f3fd-200d-2696':0, '1f9d1-1f3fe-200d-2696':0, '1f9d1-1f3ff-200d-2696':0, '1f9d1-1f3fb-200d-2708':0, '1f9d1-1f3fc-200d-2708':0, '1f9d1-1f3fd-200d-2708':0, '1f9d1-1f3fe-200d-2708':0, '1f9d1-1f3ff-200d-2708':0, '1f9d1-1f3fb':0, '1f9d1-1f3fc':0, '1f9d1-1f3fd':0, '1f9d1-1f3fe':0, '1f9d1-1f3ff':0, '1f9d2-1f3fb':0, '1f9d2-1f3fc':0, '1f9d2-1f3fd':0, '1f9d2-1f3fe':0, '1f9d2-1f3ff':0, '1f9d3-1f3fb':0, '1f9d3-1f3fc':0, '1f9d3-1f3fd':0, '1f9d3-1f3fe':0, '1f9d3-1f3ff':0, '1f9d4-1f3fb-200d-2640':0, '1f9d4-1f3fc-200d-2640':0, '1f9d4-1f3fd-200d-2640':0, '1f9d4-1f3fe-200d-2640':0, '1f9d4-1f3ff-200d-2640':0, '1f9d4-1f3fb-200d-2642':0, '1f9d4-1f3fc-200d-2642':0, '1f9d4-1f3fd-200d-2642':0, '1f9d4-1f3fe-200d-2642':0, '1f9d4-1f3ff-200d-2642':0, '1f9d4-1f3fb':0, '1f9d4-1f3fc':0, '1f9d4-1f3fd':0, '1f9d4-1f3fe':0, '1f9d4-1f3ff':0, '1f9d5-1f3fb':0, '1f9d5-1f3fc':0, '1f9d5-1f3fd':0, '1f9d5-1f3fe':0, '1f9d5-1f3ff':0, '1f9d6-1f3fb-200d-2640':0, '1f9d6-1f3fc-200d-2640':0, '1f9d6-1f3fd-200d-2640':0, '1f9d6-1f3fe-200d-2640':0, '1f9d6-1f3ff-200d-2640':0, '1f9d6-1f3fb-200d-2642':0, '1f9d6-1f3fc-200d-2642':0, '1f9d6-1f3fd-200d-2642':0, '1f9d6-1f3fe-200d-2642':0, '1f9d6-1f3ff-200d-2642':0, '1f9d6-1f3fb':0, '1f9d6-1f3fc':0, '1f9d6-1f3fd':0, '1f9d6-1f3fe':0, '1f9d6-1f3ff':0, '1f9d7-1f3fb-200d-2640':0, '1f9d7-1f3fc-200d-2640':0, '1f9d7-1f3fd-200d-2640':0, '1f9d7-1f3fe-200d-2640':0, '1f9d7-1f3ff-200d-2640':0, '1f9d7-1f3fb-200d-2642':0, '1f9d7-1f3fc-200d-2642':0, '1f9d7-1f3fd-200d-2642':0, '1f9d7-1f3fe-200d-2642':0, '1f9d7-1f3ff-200d-2642':0, '1f9d7-1f3fb':0, '1f9d7-1f3fc':0, '1f9d7-1f3fd':0, '1f9d7-1f3fe':0, '1f9d7-1f3ff':0, '1f9d8-1f3fb-200d-2640':0, '1f9d8-1f3fc-200d-2640':0, '1f9d8-1f3fd-200d-2640':0, '1f9d8-1f3fe-200d-2640':0, '1f9d8-1f3ff-200d-2640':0, '1f9d8-1f3fb-200d-2642':0, '1f9d8-1f3fc-200d-2642':0, '1f9d8-1f3fd-200d-2642':0, '1f9d8-1f3fe-200d-2642':0, '1f9d8-1f3ff-200d-2642':0, '1f9d8-1f3fb':0, '1f9d8-1f3fc':0, '1f9d8-1f3fd':0, '1f9d8-1f3fe':0, '1f9d8-1f3ff':0, '1f9d9-1f3fb-200d-2640':0, '1f9d9-1f3fc-200d-2640':0, '1f9d9-1f3fd-200d-2640':0, '1f9d9-1f3fe-200d-2640':0, '1f9d9-1f3ff-200d-2640':0, '1f9d9-1f3fb-200d-2642':0, '1f9d9-1f3fc-200d-2642':0, '1f9d9-1f3fd-200d-2642':0, '1f9d9-1f3fe-200d-2642':0, '1f9d9-1f3ff-200d-2642':0, '1f9d9-1f3fb':0, '1f9d9-1f3fc':0, '1f9d9-1f3fd':0, '1f9d9-1f3fe':0, '1f9d9-1f3ff':0, '1f9da-1f3fb-200d-2640':0, '1f9da-1f3fc-200d-2640':0, '1f9da-1f3fd-200d-2640':0, '1f9da-1f3fe-200d-2640':0, '1f9da-1f3ff-200d-2640':0, '1f9da-1f3fb-200d-2642':0, '1f9da-1f3fc-200d-2642':0, '1f9da-1f3fd-200d-2642':0, '1f9da-1f3fe-200d-2642':0, '1f9da-1f3ff-200d-2642':0, '1f9da-1f3fb':0, '1f9da-1f3fc':0, '1f9da-1f3fd':0, '1f9da-1f3fe':0, '1f9da-1f3ff':0, '1f9db-1f3fb-200d-2640':0, '1f9db-1f3fc-200d-2640':0, '1f9db-1f3fd-200d-2640':0, '1f9db-1f3fe-200d-2640':0, '1f9db-1f3ff-200d-2640':0, '1f9db-1f3fb-200d-2642':0, '1f9db-1f3fc-200d-2642':0, '1f9db-1f3fd-200d-2642':0, '1f9db-1f3fe-200d-2642':0, '1f9db-1f3ff-200d-2642':0, '1f9db-1f3fb':0, '1f9db-1f3fc':0, '1f9db-1f3fd':0, '1f9db-1f3fe':0, '1f9db-1f3ff':0, '1f9dc-1f3fb-200d-2640':0, '1f9dc-1f3fc-200d-2640':0, '1f9dc-1f3fd-200d-2640':0, '1f9dc-1f3fe-200d-2640':0, '1f9dc-1f3ff-200d-2640':0, '1f9dc-1f3fb-200d-2642':0, '1f9dc-1f3fc-200d-2642':0, '1f9dc-1f3fd-200d-2642':0, '1f9dc-1f3fe-200d-2642':0, '1f9dc-1f3ff-200d-2642':0, '1f9dc-1f3fb':0, '1f9dc-1f3fc':0, '1f9dc-1f3fd':0, '1f9dc-1f3fe':0, '1f9dc-1f3ff':0, '1f9dd-1f3fb-200d-2640':0, '1f9dd-1f3fc-200d-2640':0, '1f9dd-1f3fd-200d-2640':0, '1f9dd-1f3fe-200d-2640':0, '1f9dd-1f3ff-200d-2640':0, '1f9dd-1f3fb-200d-2642':0, '1f9dd-1f3fc-200d-2642':0, '1f9dd-1f3fd-200d-2642':0, '1f9dd-1f3fe-200d-2642':0, '1f9dd-1f3ff-200d-2642':0, '1f9dd-1f3fb':0, '1f9dd-1f3fc':0, '1f9dd-1f3fd':0, '1f9dd-1f3fe':0, '1f9dd-1f3ff':0, '261d-1f3fb':0, '261d-1f3fc':0, '261d-1f3fd':0, '261d-1f3fe':0, '261d-1f3ff':0, '26f9-1f3fb-200d-2640':0, '26f9-1f3fc-200d-2640':0, '26f9-1f3fd-200d-2640':0, '26f9-1f3fe-200d-2640':0, '26f9-1f3ff-200d-2640':0, '26f9-1f3fb-200d-2642':0, '26f9-1f3fc-200d-2642':0, '26f9-1f3fd-200d-2642':0, '26f9-1f3fe-200d-2642':0, '26f9-1f3ff-200d-2642':0, '26f9-1f3fb':0, '26f9-1f3fc':0, '26f9-1f3fd':0, '26f9-1f3fe':0, '26f9-1f3ff':0, '270a-1f3fb':0, '270a-1f3fc':0, '270a-1f3fd':0, '270a-1f3fe':0, '270a-1f3ff':0, '270b-1f3fb':0, '270b-1f3fc':0, '270b-1f3fd':0, '270b-1f3fe':0, '270b-1f3ff':0, '270c-1f3fb':0, '270c-1f3fc':0, '270c-1f3fd':0, '270c-1f3fe':0, '270c-1f3ff':0, '270d-1f3fb':0, '270d-1f3fc':0, '270d-1f3fd':0, '270d-1f3fe':0, '270d-1f3ff':0}};\n\nconst Emoji: {[emoji: string]: number} = EmojiVersions[''];\nfor(const version in EmojiVersions) {\n if(version) {\n Object.assign(Emoji, EmojiVersions[version as EMOJI_VERSION]);\n }\n}\n\nexport default Emoji;\n\n/* Emoji[\"00a9-fe0f\"] = 6362;\nEmoji[\"00ae-fe0f\"] = 6363;\nEmoji[\"2122-fe0f\"] = 6364; */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport const FontFamily = 'Roboto, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif';\nexport const FontSize = '16px';\nexport const FontWeight = '400';\n","const IS_IMAGE_BITMAP_SUPPORTED = typeof(ImageBitmap) !== 'undefined';\n\nexport default IS_IMAGE_BITMAP_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// * Jolly Cobra's animation.ts\n\nimport {fastRaf} from './schedulers';\nimport deferredPromise, {CancellablePromise} from './cancellablePromise';\n\ninterface AnimationInstance {\n isCancelled: boolean;\n deferred: CancellablePromise\n}\n\ntype AnimationInstanceKey = any;\nconst instances: Map = new Map();\n\nexport function createAnimationInstance(key: AnimationInstanceKey) {\n cancelAnimationByKey(key);\n\n const instance: AnimationInstance = {\n isCancelled: false,\n deferred: deferredPromise()\n };\n\n instances.set(key, instance);\n instance.deferred.then(() => {\n if(getAnimationInstance(key) === instance) {\n instances.delete(key);\n }\n });\n\n return instance;\n}\n\nexport function getAnimationInstance(key: AnimationInstanceKey) {\n return instances.get(key);\n}\n\nexport function cancelAnimationByKey(key: AnimationInstanceKey) {\n const instance = getAnimationInstance(key);\n if(instance) {\n instance.isCancelled = true;\n instance.deferred.resolve();\n }\n}\n\nexport function animateSingle(tick: Function, key: AnimationInstanceKey, instance?: AnimationInstance) {\n if(!instance) {\n instance = createAnimationInstance(key);\n }\n\n fastRaf(() => {\n if(instance.isCancelled) {\n return;\n }\n\n if(tick()) {\n animateSingle(tick, key, instance);\n } else {\n instance.deferred.resolve();\n }\n });\n\n return instance.deferred;\n}\n\nexport function animate(tick: Function) {\n fastRaf(() => {\n if(tick()) {\n animate(tick);\n }\n });\n}\n","export default function accumulate(arr: number[], initialValue: number) {\n return arr.reduce((acc, value) => acc + value, initialValue);\n}\n","type K = boolean;\nexport default async function filterAsync(arr: T[], callback: (item: T, idx: number, arr: T[]) => Promise | K) {\n const promises = arr.map(async(item, idx, arr) => {\n if(await callback(item, idx, arr)) {\n return item;\n }\n });\n\n return (await Promise.all(promises)).filter(Boolean);\n}\n","export default function findAndSpliceAll(array: Array, verify: (value: T, index: number, arr: typeof array) => boolean) {\n const out: typeof array = [];\n let idx = -1;\n while((idx = array.findIndex(verify)) !== -1) {\n out.push(array.splice(idx, 1)[0]);\n }\n\n return out;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function partition(arr: T[], callback: (item: T, idx: number, arr: T[]) => boolean) {\n const good: T[] = [], bad: T[] = [];\n for(let i = 0, length = arr.length; i < length; ++i) {\n const item = arr[i];\n (callback(item, i, arr) ? good : bad).push(item);\n }\n\n return [good, bad];\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nconst ASSETS_PATH = 'assets/audio/';\n\nexport default class AudioAssetPlayer {\n private audio: HTMLAudioElement;\n private tempId: number;\n private assetName: AssetName;\n\n constructor(private assets: AssetName[]) {\n this.tempId = 0;\n }\n\n public playSound(name: AssetName, loop = false) {\n ++this.tempId;\n this.assetName = name;\n\n try {\n const audio = this.createAudio();\n audio.autoplay = true;\n audio.src = ASSETS_PATH + name;\n audio.loop = loop;\n audio.play();\n } catch(e) {\n console.error('playSound', name, e);\n }\n }\n\n public playSoundIfDifferent(name: AssetName, loop?: boolean) {\n if(this.assetName !== name) {\n this.playSound(name, loop);\n }\n }\n\n public createAudio() {\n let {audio} = this;\n if(audio) {\n return audio;\n }\n\n audio = this.audio = new Audio();\n audio.play();\n return audio;\n }\n\n public stopSound() {\n if(!this.audio) {\n return;\n }\n\n this.audio.pause();\n }\n\n public cancelDelayedPlay() {\n ++this.tempId;\n }\n\n public playSoundWithTimeout(name: AssetName, loop: boolean, timeout: number) {\n // timeout = 0;\n const tempId = ++this.tempId;\n setTimeout(() => {\n if(this.tempId !== tempId) {\n return;\n }\n\n this.playSound(name, loop);\n }, timeout);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport readBlobAs from './readBlobAs';\n\nexport default function readBlobAsDataURL(blob: Blob) {\n return readBlobAs(blob, 'readAsDataURL');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport deferredPromise, {CancellablePromise} from './cancellablePromise';\nimport {getHeavyAnimationPromise} from '../hooks/useHeavyAnimationCheck';\nimport {fastRaf} from './schedulers';\nimport {ArgumentTypes} from '../types';\n\ntype HeavyQueue> = {\n items: ArgumentTypes[],\n process: (...args: any[]) => ReturnType,\n context: any,\n promise?: CancellablePromise[]>\n};\nconst heavyQueue: HeavyQueue[] = [];\nlet processingQueue = false;\n\nexport default function addHeavyTask>(queue: T, method: 'push' | 'unshift' = 'push') {\n if(!queue.items.length) {\n return Promise.resolve([]) as typeof promise;\n }\n\n const promise = queue.promise = deferredPromise();\n heavyQueue[method](queue);\n processHeavyQueue();\n\n return promise;\n}\n\nfunction processHeavyQueue() {\n if(!processingQueue) {\n const queue = heavyQueue.shift();\n timedChunk(queue).finally(() => {\n processingQueue = false;\n if(heavyQueue.length) {\n processHeavyQueue();\n }\n });\n }\n}\n\nfunction timedChunk>(queue: HeavyQueue) {\n if(!queue.items.length) {\n queue.promise.resolve([] as any);\n return Promise.resolve([]);\n }\n\n const todo = queue.items.slice();\n const results: ReturnType[] = [];\n\n return new Promise((resolve, reject) => {\n const f = async() => {\n const start = performance.now();\n\n do {\n await getHeavyAnimationPromise();\n const possiblePromise = queue.process.apply(queue.context, todo.shift());\n let realResult: typeof results[0];\n // @ts-ignore\n if(possiblePromise instanceof Promise) {\n try {\n realResult = await possiblePromise;\n } catch(err) {\n reject(err);\n return;\n }\n } else {\n realResult = possiblePromise;\n }\n\n results.push(realResult);\n } while(todo.length > 0 && (performance.now() - start) < 6);\n\n if(todo.length > 0) {\n fastRaf(f);\n // setTimeout(f, 25);\n } else {\n resolve(results);\n }\n };\n\n fastRaf(f);\n // setTimeout(f, 25);\n }).then(queue.promise.resolve, queue.promise.reject);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type fastBlur from '../vendor/fastBlur';\nimport addHeavyTask from './heavyQueue';\nimport IS_CANVAS_FILTER_SUPPORTED from '../environment/canvasFilterSupport';\n\nconst RADIUS = 2;\nconst ITERATIONS = 2;\n\nlet requireBlurPromise: Promise;\nlet fastBlurFunc: typeof fastBlur;\nif(!IS_CANVAS_FILTER_SUPPORTED) {\n requireBlurPromise = import('../vendor/fastBlur').then((m) => {\n fastBlurFunc = m.default;\n });\n} else {\n requireBlurPromise = Promise.resolve();\n}\n\nfunction processBlurNext(\n img: HTMLImageElement,\n radius: number,\n iterations: number,\n canvas: HTMLCanvasElement = document.createElement('canvas')\n) {\n canvas.width = img.width;\n canvas.height = img.height;\n\n const ctx = canvas.getContext('2d', {alpha: false});\n if(IS_CANVAS_FILTER_SUPPORTED) {\n ctx.filter = `blur(${radius}px)`;\n ctx.drawImage(img, -radius * 2, -radius * 2, canvas.width + radius * 4, canvas.height + radius * 4);\n } else {\n ctx.drawImage(img, 0, 0);\n fastBlurFunc(ctx, 0, 0, canvas.width, canvas.height, radius, iterations);\n }\n\n return canvas;\n}\n\ntype CacheValue = {canvas: HTMLCanvasElement, promise: Promise};\nconst cache: Map = new Map();\nconst CACHE_SIZE = 150;\n\nexport default function blur(dataUri: string, radius: number = RADIUS, iterations: number = ITERATIONS) {\n if(!dataUri) {\n throw 'no dataUri for blur: ' + dataUri;\n }\n\n if(cache.size > CACHE_SIZE) {\n cache.clear();\n }\n\n const canvas = document.createElement('canvas');\n canvas.className = 'canvas-thumbnail';\n\n let cached = cache.get(dataUri);\n if(!cached) {\n const promise: CacheValue['promise'] = new Promise((resolve) => {\n // return resolve(dataUri);\n requireBlurPromise.then(() => {\n const img = new Image();\n img.onload = () => {\n // if(IS_CANVAS_FILTER_SUPPORTED) {\n // resolve(processBlurNext(img, radius, iterations));\n // } else {\n const promise = addHeavyTask({\n items: [[img, radius, iterations, canvas]],\n context: null,\n process: processBlurNext\n }, 'unshift');\n\n promise.then(() => {\n resolve();\n });\n // }\n };\n img.src = dataUri;\n });\n });\n\n cache.set(dataUri, cached = {\n canvas,\n promise\n });\n } else {\n canvas.width = cached.canvas.width;\n canvas.height = cached.canvas.height;\n cached.promise.then(() => {\n canvas.getContext('2d').drawImage(cached.canvas, 0, 0, canvas.width, canvas.height);\n });\n }\n\n return {\n ...cached,\n canvas\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {IS_SAFARI} from '../../environment/userAgent';\nimport bytesFromHex from './bytesFromHex';\nimport bytesToDataURL from './bytesToDataURL';\nimport convertToUint8Array from './convertToUint8Array';\n\nconst JPEG_HEADER_HEX = 'ffd8ffe000104a46494600010100000100010000ffdb004300281c1e231e19282321232d2b28303c64413c37373c7b585d4964918099968f808c8aa0b4e6c3a0aadaad8a8cc8ffcbdaeef5ffffff9bc1fffffffaffe6fdfff8ffdb0043012b2d2d3c353c76414176f8a58ca5f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8ffc00011080000000003012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00';\n\nconst JPEG_HEADER = bytesFromHex(JPEG_HEADER_HEX);\nconst JPEG_TAIL = bytesFromHex('ffd9');\n\nexport function getPreviewBytesFromURL(url: string) {\n const needle = 'base64,';\n const sliced = url.slice(url.indexOf(needle) + needle.length);\n const jpegBytes = [...atob(sliced)].map((char) => char.charCodeAt(0));\n\n return new Uint8Array(jpegBytes);\n // console.log('getPreviewBytesFromURL', bytesToHex(jpegBytes));\n\n // const n = JPEG_HEADER_HEX.slice(-10);\n // const one = jpegBytes[164];\n // const two = jpegBytes[166];\n\n // const body = jpegBytes.slice(bytesToHex(jpegBytes).indexOf(n) / 2 + n.length / 2/* JPEG_HEADER.length */, jpegBytes.length - JPEG_TAIL.length);\n // const original = new Uint8Array([\n // 0xFF,\n // one,\n // two,\n // ...body\n // ]);\n\n // console.log(bytesToHex(body));\n\n // return original;\n}\n\nexport default function getPreviewURLFromBytes(bytes: Uint8Array | number[], isSticker = false) {\n let arr: Uint8Array;\n if(!isSticker && bytes[0] === 0x1) {\n arr = new Uint8Array(JPEG_HEADER.concat(Array.from(bytes.slice(3)), JPEG_TAIL));\n arr[164] = bytes[1];\n arr[166] = bytes[2];\n } else {\n arr = convertToUint8Array(bytes);\n }\n\n let mimeType: string;\n if(isSticker) {\n mimeType = IS_SAFARI ? 'image/png' : 'image/webp';\n } else {\n mimeType = 'image/jpeg';\n }\n\n const dataURL = bytesToDataURL(arr, mimeType);\n return dataURL;\n}\n","export default function bytesToDataURL(bytes: Uint8Array, mimeType: string = 'image/jpeg') {\n return `data:${mimeType};base64,${btoa(String.fromCharCode(...bytes))}`;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport {makeMediaSize} from './mediaSize';\n\nexport default function calcImageInBox(imageW: number, imageH: number, boxW: number, boxH: number, noZoom = true) {\n if(imageW < boxW && imageH < boxH && noZoom) {\n return makeMediaSize(imageW, imageH);\n }\n\n let boxedImageW = boxW;\n let boxedImageH = boxH;\n\n if((imageW / imageH) > (boxW / boxH)) {\n boxedImageH = (imageH * boxW / imageW) | 0;\n } else {\n boxedImageW = (imageW * boxH / imageH) | 0;\n if(boxedImageW > boxW) {\n boxedImageH = (boxedImageH * boxW / boxedImageW) | 0;\n boxedImageW = boxW;\n }\n }\n\n // if (Config.Navigator.retina) {\n // imageW = Math.floor(imageW / 2)\n // imageH = Math.floor(imageH / 2)\n // }\n\n if(noZoom && boxedImageW >= imageW && boxedImageH >= imageH) {\n boxedImageW = imageW;\n boxedImageH = imageH;\n }\n\n return makeMediaSize(boxedImageW, boxedImageH);\n}\n\nMOUNT_CLASS_TO.calcImageInBox = calcImageInBox;\n","export default function drawCircle(ctx: CanvasRenderingContext2D, x: number, y: number, radius: number, fill?: boolean, stroke?: boolean) {\n const dpr = ctx.canvas.dpr;\n if(dpr) {\n x *= dpr;\n y *= dpr;\n radius *= dpr;\n }\n\n ctx.beginPath();\n ctx.arc(x, y, radius, 0, 2 * Math.PI, false);\n ctx.closePath();\n\n if(fill) {\n ctx.fill();\n }\n\n if(stroke) {\n ctx.stroke();\n }\n}\n\nexport function drawCircleFromStart(ctx: CanvasRenderingContext2D, x: number, y: number, radius: number, fill?: boolean, stroke?: boolean) {\n return drawCircle(ctx, x + radius, y + radius, radius, fill, stroke);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import { MOUNT_CLASS_TO } from \"../../config/debug\";\n\nlet context: CanvasRenderingContext2D;\n/**\n * Get the text width\n * @param {string} text\n * @param {string} font\n */\nexport default function getTextWidth(text: string, font: string) {\n // const perf = performance.now();\n if(!context) {\n const canvas = document.createElement('canvas');\n context = canvas.getContext('2d', {alpha: false});\n }\n\n if(context.font !== font) {\n context.font = font;\n }\n\n // context.font = font;\n const metrics = context.measureText(text);\n // console.log('getTextWidth perf:', performance.now() - perf);\n return metrics.width;\n // return Math.round(metrics.width);\n}\n\n// MOUNT_CLASS_TO && (MOUNT_CLASS_TO.getTextWidth = getTextWidth);\n","import type {MediaSize} from '../mediaSize';\nimport IS_IMAGE_BITMAP_SUPPORTED from '../../environment/imageBitmapSupport';\n\nexport default function scaleMediaElement(options: T): Promise {\n return new Promise(async(resolve) => {\n const canvas = document.createElement('canvas');\n const size = options.size ?? options.mediaSize.aspectFitted(options.boxSize);\n const dpr = window.devicePixelRatio && 1;\n canvas.width = size.width * dpr;\n canvas.height = size.height * dpr;\n const ctx = canvas.getContext('2d');\n\n let source: CanvasImageSource;\n if(IS_IMAGE_BITMAP_SUPPORTED) {\n source = await createImageBitmap(options.media, {resizeWidth: size.width, resizeHeight: size.height});\n } else {\n source = options.media;\n }\n\n ctx.drawImage(source, 0, 0, canvas.width, canvas.height);\n\n if(IS_IMAGE_BITMAP_SUPPORTED) {\n (source as ImageBitmap)?.close();\n }\n\n const mimeType = options.mimeType ?? 'image/jpeg';\n const quality = options.quality ?? 1;\n if(options.toDataURL) {\n const url = canvas.toDataURL(mimeType, quality);\n resolve({url, size} as any);\n } else {\n canvas.toBlob((blob) => {\n resolve({blob, size} as any);\n }, mimeType, quality);\n }\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport LatinizeMap from '../config/latinizeMap';\n\nexport const badCharsRe = /[`~!@#$%^&*()\\-_=+\\[\\]\\\\|{}'\";:\\/?.>,<]+/g;\nconst trimRe = /^\\s+|\\s$/g;\n\nconst C2L: {[k: string]: string} = {\n 'й': 'q',\n 'ц': 'w',\n 'у': 'e',\n 'к': 'r',\n 'е': 't',\n 'н': 'y',\n 'г': 'u',\n 'ш': 'i',\n 'щ': 'o',\n 'з': 'p',\n 'х': '[',\n 'ъ': ']',\n 'ф': 'a',\n 'ы': 's',\n 'в': 'd',\n 'а': 'f',\n 'п': 'g',\n 'р': 'h',\n 'о': 'j',\n 'л': 'k',\n 'д': 'l',\n 'ж': ';',\n 'э': '\\'',\n 'я': 'z',\n 'ч': 'x',\n 'с': 'c',\n 'м': 'v',\n 'и': 'b',\n 'т': 'n',\n 'ь': 'm',\n 'б': ',',\n 'ю': '.',\n '.': '/'\n};\n\nexport function clearBadCharsAndTrim(text: string) {\n return text.replace(badCharsRe, '').replace(trimRe, '');\n}\n\nexport function fixCyrillic(text: string) {\n return text.toLowerCase().replace(/[\\wа-я]/g, (ch) => {\n const latinizeCh = C2L[ch];\n return latinizeCh ?? ch;\n });\n}\n\nexport function latinizeString(text: string) {\n return text.replace(/[^A-Za-z0-9]/g, (ch) => {\n const latinizeCh = LatinizeMap[ch];\n return latinizeCh ?? ch;\n });\n}\n\nexport default function cleanSearchText(text: string, latinize = true) {\n return processSearchText(text, {\n clearBadChars: true,\n latinize,\n ignoreCase: true\n });\n}\n\nexport type ProcessSearchTextOptions = Partial<{\n clearBadChars: boolean,\n latinize: boolean,\n ignoreCase: boolean,\n includeTag: boolean\n}>;\n\nexport function processSearchText(text: string, options: ProcessSearchTextOptions = {}) {\n const hasTag = options.includeTag && text.charAt(0) === '%';\n const originalText = text;\n if(options.clearBadChars) text = clearBadCharsAndTrim(text);\n if(options.latinize) text = latinizeString(text);\n if(options.ignoreCase) text = text.toLowerCase();\n if(hasTag) text = '%' + text;\n if(options.latinize) text += '\\x01' + fixCyrillic(originalText);\n return text;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// https://stackoverflow.com/a/30810322\nfunction fallbackCopyTextToClipboard(text: string) {\n var textArea = document.createElement('textarea');\n textArea.value = text;\n\n // Avoid scrolling to bottom\n textArea.style.top = '0';\n textArea.style.left = '0';\n textArea.style.position = 'fixed';\n\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n\n try {\n document.execCommand('copy');\n // const successful = document.execCommand('copy');\n // const msg = successful ? 'successful' : 'unsuccessful';\n // console.log('Fallback: Copying text command was ' + msg);\n } catch(err) {\n // console.error('Fallback: Oops, unable to copy', err);\n }\n\n document.body.removeChild(textArea);\n}\n\nexport function copyTextToClipboard(text: string) {\n if(!navigator.clipboard) {\n fallbackCopyTextToClipboard(text);\n return;\n }\n\n navigator.clipboard.writeText(text).catch((err) => {\n console.error('clipboard error', err);\n fallbackCopyTextToClipboard(text);\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport mediaSizes from './mediaSizes';\nimport OverlayClickHandler from './overlayClickHandler';\n\nclass ContextMenuController extends OverlayClickHandler {\n constructor() {\n super('menu', true);\n\n mediaSizes.addEventListener('resize', () => {\n if(this.element) {\n this.close();\n }\n\n /* if(openedMenu && (openedMenu.style.top || openedMenu.style.left)) {\n const rect = openedMenu.getBoundingClientRect();\n const {innerWidth, innerHeight} = window;\n\n console.log(innerWidth, innerHeight, rect);\n } */\n });\n }\n\n public isOpened() {\n return !!this.element;\n }\n\n private onMouseMove = (e: MouseEvent) => {\n const rect = this.element.getBoundingClientRect();\n const {clientX, clientY} = e;\n\n const diffX = clientX >= rect.right ? clientX - rect.right : rect.left - clientX;\n const diffY = clientY >= rect.bottom ? clientY - rect.bottom : rect.top - clientY;\n\n if(diffX >= 100 || diffY >= 100) {\n this.close();\n // openedMenu.parentElement.click();\n }\n // console.log('mousemove', diffX, diffY);\n };\n\n public close() {\n if(this.element) {\n this.element.classList.remove('active');\n this.element.parentElement.classList.remove('menu-open');\n }\n\n super.close();\n\n if(!IS_TOUCH_SUPPORTED) {\n window.removeEventListener('mousemove', this.onMouseMove);\n }\n }\n\n public openBtnMenu(element: HTMLElement, onClose?: () => void) {\n super.open(element);\n\n this.element.classList.add('active', 'was-open');\n this.element.parentElement.classList.add('menu-open');\n\n if(onClose) {\n this.addEventListener('toggle', onClose, {once: true});\n }\n\n if(!IS_TOUCH_SUPPORTED) {\n window.addEventListener('mousemove', this.onMouseMove);\n }\n }\n}\n\nconst contextMenuController = new ContextMenuController();\nexport default contextMenuController;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport I18n, {i18n} from '../lib/langPack';\n\nexport const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\nexport const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n\nexport const ONE_DAY = 86400;\n\n// https://stackoverflow.com/a/6117889\nexport const getWeekNumber = (date: Date) => {\n const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));\n const dayNum = d.getUTCDay() || 7;\n d.setUTCDate(d.getUTCDate() + 4 - dayNum);\n const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));\n return Math.ceil((((d.getTime() - yearStart.getTime()) / ONE_DAY) + 1) / 7);\n};\n\nexport function formatDateAccordingToTodayNew(time: Date) {\n const today = new Date();\n const now = today.getTime() / 1000 | 0;\n const timestamp = time.getTime() / 1000 | 0;\n\n const options: Intl.DateTimeFormatOptions = {};\n if((now - timestamp) < ONE_DAY && today.getDate() === time.getDate()) { // if the same day\n options.hour = options.minute = '2-digit';\n } else if(today.getFullYear() !== time.getFullYear()) { // different year\n options.year = options.day = 'numeric';\n options.month = '2-digit';\n } else if((now - timestamp) < (ONE_DAY * 7) && getWeekNumber(today) === getWeekNumber(time)) { // current week\n options.weekday = 'short';\n } else { // same year\n options.month = 'short';\n options.day = 'numeric';\n }\n\n return new I18n.IntlDateElement({\n date: time,\n options\n }).element;\n}\n\nexport function formatFullSentTimeRaw(timestamp: number, options: {\n capitalize?: boolean\n} = {}) {\n const date = new Date();\n const time = new Date(timestamp * 1000);\n const now = date.getTime() / 1000;\n\n const timeEl = formatTime(time);\n\n let dateEl: Node | string;\n if((now - timestamp) < ONE_DAY && date.getDate() === time.getDate()) { // if the same day\n dateEl = i18n(options.capitalize ? 'Date.Today' : 'Peer.Status.Today');\n } else if((now - timestamp) < (ONE_DAY * 2) && (date.getDate() - 1) === time.getDate()) { // yesterday\n dateEl = i18n(options.capitalize ? 'Yesterday' : 'Peer.Status.Yesterday');\n\n if(options.capitalize) {\n (dateEl as HTMLElement).style.textTransform = 'capitalize';\n }\n } else if(date.getFullYear() !== time.getFullYear()) { // different year\n dateEl = new I18n.IntlDateElement({\n date: time,\n options: {\n month: 'short',\n day: 'numeric',\n year: 'numeric'\n }\n }).element;\n // dateStr = months[time.getMonth()].slice(0, 3) + ' ' + time.getDate() + ', ' + time.getFullYear();\n } else {\n dateEl = new I18n.IntlDateElement({\n date: time,\n options: {\n month: 'short',\n day: 'numeric'\n }\n }).element;\n // dateStr = months[time.getMonth()].slice(0, 3) + ' ' + time.getDate();\n }\n\n return {dateEl, timeEl};\n}\n\nexport function formatFullSentTime(timestamp: number) {\n const {dateEl, timeEl} = formatFullSentTimeRaw(timestamp, {\n capitalize: true\n });\n\n const fragment = document.createDocumentFragment();\n fragment.append(dateEl, ' ', i18n('ScheduleController.at'), ' ', timeEl);\n return fragment;\n}\n\nexport function formatTime(date: Date) {\n return new I18n.IntlDateElement({\n date,\n options: {\n hour: '2-digit',\n minute: '2-digit'\n }\n }).element;\n}\n\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.formatDateAccordingToTodayNew = formatDateAccordingToTodayNew);\n\nexport const getFullDate = (date: Date, options: Partial<{\n noTime: true,\n noSeconds: true,\n monthAsNumber: true,\n leadingZero: true\n}> = {}) => {\n const joiner = options.monthAsNumber ? '.' : ' ';\n const time = ('0' + date.getHours()).slice(-2) + ':' + ('0' + date.getMinutes()).slice(-2) + (options.noSeconds ? '' : ':' + ('0' + date.getSeconds()).slice(-2));\n\n return (options.leadingZero ? ('0' + date.getDate()).slice(-2) : date.getDate()) +\n joiner + (options.monthAsNumber ? ('0' + (date.getMonth() + 1)).slice(-2) : months[date.getMonth()]) +\n joiner + date.getFullYear() +\n (options.noTime ? '' : ', ' + time);\n};\n\n// https://github.com/DrKLO/Telegram/blob/d52b2c921abd3c1e8d6368858313ad0cb0468c07/TMessagesProj/src/main/java/org/telegram/ui/Adapters/FiltersView.java\nconst minYear = 2013;\nconst yearPattern = new RegExp('20[0-9]{1,2}');\nconst monthYearOrDayPattern = new RegExp('(\\\\w{3,}) ([0-9]{0,4})', 'i');\nconst yearOrDayAndMonthPattern = new RegExp('([0-9]{0,4}) (\\\\w{2,})', 'i');\nconst shortDate = new RegExp('^([0-9]{1,4})(\\\\.| |/|\\\\-)([0-9]{1,4})$', 'i');\nconst longDate = new RegExp('^([0-9]{1,2})(\\\\.| |/|\\\\-)([0-9]{1,2})(\\\\.| |/|\\\\-)([0-9]{1,4})$', 'i');\nconst numberOfDaysEachMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nexport type DateData = {\n title: string,\n minDate: number,\n maxDate: number,\n};\nexport function fillTipDates(query: string, dates: DateData[]) {\n const q = query.trim().toLowerCase();\n\n if(q.length < 3) {\n return;\n }\n\n if('today'.indexOf(q) === 0) {\n const date = new Date();\n const year = date.getFullYear();\n const month = date.getMonth();\n const day = date.getDate();\n date.setFullYear(year, month, day);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: 'Today',\n minDate,\n maxDate\n });\n return;\n }\n\n if('yesterday'.indexOf(q) === 0) {\n const date = new Date();\n const year = date.getFullYear();\n const month = date.getMonth();\n const day = date.getDate();\n date.setFullYear(year, month, day);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime() - 86400000;\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 86400001;\n dates.push({\n title: 'Yesterday',\n minDate,\n maxDate\n });\n return;\n }\n\n const dayOfWeek = getDayOfWeek(q);\n if(dayOfWeek >= 0) {\n const date = new Date();\n const now = date.getTime();\n const currentDay = date.getDay();\n const distance = dayOfWeek - currentDay;\n date.setDate(date.getDate() + distance);\n if(date.getTime() > now) {\n date.setTime(date.getTime() - 604800000);\n }\n const year = date.getFullYear()\n const month = date.getMonth();\n const day = date.getDate();\n date.setFullYear(year, month, day);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: formatWeekLong(minDate),\n minDate,\n maxDate\n });\n return;\n }\n\n let matches: any[];\n if((matches = shortDate.exec(q)) !== null) {\n const g1 = matches[1];\n const g2 = matches[3];\n const k = parseInt(g1);\n const k1 = parseInt(g2);\n if(k > 0 && k <= 31) {\n if(k1 >= minYear && k <= 12) {\n const selectedYear = k1;\n const month = k - 1;\n createForMonthYear(dates, month, selectedYear);\n return;\n } else if(k1 <= 12) {\n const day = k - 1;\n const month = k1 - 1;\n createForDayMonth(dates, day, month);\n }\n } else if(k >= minYear && k1 <= 12) {\n const selectedYear = k;\n const month = k1 - 1;\n createForMonthYear(dates, month, selectedYear);\n }\n\n return;\n }\n\n if((matches = longDate.exec(q)) !== null) {\n const g1 = matches[1];\n const g2 = matches[3];\n const g3 = matches[5];\n if(!matches[2] === matches[4]) {\n return;\n }\n\n const day = parseInt(g1);\n const month = parseInt(g2) - 1;\n let year = parseInt(g3);\n if(year >= 10 && year <= 99) {\n year += 2000;\n }\n\n const currentYear = new Date().getFullYear();\n if(validDateForMonth(day - 1, month) && year >= minYear && year <= currentYear) {\n const date = new Date();\n date.setFullYear(year, month, day);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: formatterYearMax(minDate),\n minDate,\n maxDate\n });\n return;\n }\n\n return;\n }\n\n if((matches = yearPattern.exec(q)) !== null) {\n let selectedYear = +q;\n const currentYear = new Date().getFullYear();\n if(selectedYear < minYear) {\n selectedYear = minYear;\n for(let i = currentYear; i >= selectedYear; i--) {\n const date = new Date();\n date.setFullYear(i, 0, 1);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(i + 1, 0, 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: '' + i,\n minDate,\n maxDate\n });\n }\n } else if(selectedYear <= currentYear) {\n const date = new Date();\n date.setFullYear(selectedYear, 0, 1);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(selectedYear + 1, 0, 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: '' + selectedYear,\n minDate,\n maxDate\n });\n }\n\n return;\n }\n\n if((matches = monthYearOrDayPattern.exec(q)) !== null) {\n const g1 = matches[1];\n const g2 = matches[2];\n const month = getMonth(g1);\n if(month >= 0) {\n const k = +g2;\n if(k > 0 && k <= 31) {\n const day = k - 1;\n createForDayMonth(dates, day, month);\n return;\n } else if(k >= minYear) {\n const selectedYear = k;\n createForMonthYear(dates, month, selectedYear);\n return;\n }\n }\n }\n\n if((matches = yearOrDayAndMonthPattern.exec(q)) !== null) {\n const g1 = matches[1];\n const g2 = matches[2];\n const month = getMonth(g2);\n if(month >= 0) {\n const k = +g1;\n if(k > 0 && k <= 31) {\n const day = k - 1;\n createForDayMonth(dates, day, month);\n return;\n } else if(k >= minYear) {\n const selectedYear = k;\n createForMonthYear(dates, month, selectedYear);\n }\n }\n }\n}\n\nfunction createForMonthYear(dates: DateData[], month: number, selectedYear: number) {\n const currentYear = new Date().getFullYear();\n const today = Date.now();\n if(selectedYear >= minYear && selectedYear <= currentYear) {\n const date = new Date();\n date.setFullYear(selectedYear, month, 1);\n date.setHours(0, 0, 0);\n const minDate = date.getTime();\n if(minDate > today) {\n return;\n }\n date.setMonth(date.getMonth() + 1);\n const maxDate = date.getTime() - 1;\n\n dates.push({\n title: formatterMonthYear(minDate),\n minDate,\n maxDate\n });\n }\n}\n\nfunction createForDayMonth(dates: DateData[], day: number, month: number) {\n if(validDateForMonth(day, month)) {\n const currentYear = new Date().getFullYear();\n const today = Date.now();\n\n for(let i = currentYear; i >= minYear; i--) {\n if(month === 1 && day === 28 && !isLeapYear(i)) {\n continue;\n }\n\n const date = new Date();\n date.setFullYear(i, month, day + 1);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n if(minDate > today) {\n continue;\n }\n\n date.setFullYear(i, month, day + 2);\n date.setHours(0, 0, 0);\n const maxDate = date.getTime() - 1;\n if(i === currentYear) {\n dates.push({\n title: formatterDayMonth(minDate),\n minDate,\n maxDate\n });\n } else {\n dates.push({\n title: formatterYearMax(minDate),\n minDate,\n maxDate\n });\n }\n }\n }\n}\n\nfunction formatterMonthYear(timestamp: number) {\n const date = new Date(timestamp);\n return months[date.getMonth()].slice(0, 3) + ' ' + date.getFullYear();\n}\n\nfunction formatterDayMonth(timestamp: number) {\n const date = new Date(timestamp);\n return months[date.getMonth()].slice(0, 3) + ' ' + date.getDate();\n}\n\nfunction formatterYearMax(timestamp: number) {\n const date = new Date(timestamp);\n return ('0' + date.getDate()).slice(-2) + '.' + ('0' + (date.getMonth() + 1)).slice(-2) + '.' + date.getFullYear();\n}\n\nfunction formatWeekLong(timestamp: number) {\n const date = new Date(timestamp);\n return days[date.getDay()];\n}\n\nfunction validDateForMonth(day: number, month: number) {\n if(month >= 0 && month < 12) {\n if(day >= 0 && day < numberOfDaysEachMonth[month]) {\n return true;\n }\n }\n return false;\n}\n\nfunction isLeapYear(year: number) {\n return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0);\n}\n\nfunction getMonth(q: string) {\n /* String[] months = new String[]{\n LocaleController.getString(\"January\", R.string.January).toLowerCase(),\n LocaleController.getString(\"February\", R.string.February).toLowerCase(),\n LocaleController.getString(\"March\", R.string.March).toLowerCase(),\n LocaleController.getString(\"April\", R.string.April).toLowerCase(),\n LocaleController.getString(\"May\", R.string.May).toLowerCase(),\n LocaleController.getString(\"June\", R.string.June).toLowerCase(),\n LocaleController.getString(\"July\", R.string.July).toLowerCase(),\n LocaleController.getString(\"August\", R.string.August).toLowerCase(),\n LocaleController.getString(\"September\", R.string.September).toLowerCase(),\n LocaleController.getString(\"October\", R.string.October).toLowerCase(),\n LocaleController.getString(\"November\", R.string.November).toLowerCase(),\n LocaleController.getString(\"December\", R.string.December).toLowerCase()\n }; */\n\n /* String[] monthsEng = new String[12];\n Calendar c = Calendar.getInstance();\n for (int i = 1; i <= 12; i++) {\n c.set(0, 0, 0, 0, 0, 0);\n c.set(Calendar.MONTH, i);\n monthsEng[i - 1] = c.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.ENGLISH).toLowerCase();\n } */\n\n q = q.toLowerCase();\n for(let i = 0; i < 12; i++) {\n const month = months[i].toLowerCase();\n if(month.indexOf(q) === 0) {\n return i;\n }\n }\n return -1;\n}\n\nfunction getDayOfWeek(q: string) {\n const c = new Date();\n if(q.length <= 3) {\n return -1;\n }\n\n for(let i = 0; i < 7; i++) {\n c.setDate(c.getDate() + 1);\n\n if(formatWeekLong(c.getTime()).toLowerCase().indexOf(q) === 0) {\n return c.getDay();\n }\n }\n return -1;\n}\n\nMOUNT_CLASS_TO.fillTipDates = fillTipDates;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {toastNew} from '../../components/toast';\nimport {LangPackKey} from '../../lib/langPack';\nimport {copyTextToClipboard} from '../clipboard';\nimport cancelEvent from './cancelEvent';\nimport {attachClickEvent} from './clickEvent';\n\nconst T_ME = 'https://t.me/';\nexport default function anchorCopy(options: Partial<{\n // href: string,\n mePath: string,\n username: string\n}> = {}) {\n const anchor = document.createElement('a');\n anchor.classList.add('anchor-copy');\n\n let copyWhat: string, copyText: LangPackKey = 'LinkCopied';\n if(options.mePath) {\n const href = T_ME + options.mePath;\n copyWhat = anchor.href = anchor.innerText = href;\n }\n\n if(options.username) {\n const href = T_ME + options.username;\n anchor.href = href;\n copyWhat = anchor.innerText = '@' + options.username;\n copyText = 'UsernameCopied';\n }\n\n attachClickEvent(anchor, (e) => {\n cancelEvent(e);\n copyTextToClipboard(copyWhat ?? anchor.href);\n toastNew({langPackKey: copyText});\n });\n\n return anchor;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport {IS_APPLE} from '../../environment/userAgent';\nimport contextMenuController from '../contextMenuController';\nimport ListenerSetter, {ListenerOptions} from '../listenerSetter';\nimport cancelEvent from './cancelEvent';\n\nlet _cancelContextMenuOpening = false, _cancelContextMenuOpeningTimeout = 0;\nexport function cancelContextMenuOpening() {\n if(_cancelContextMenuOpeningTimeout) {\n clearTimeout(_cancelContextMenuOpeningTimeout);\n }\n\n _cancelContextMenuOpeningTimeout = window.setTimeout(() => {\n _cancelContextMenuOpeningTimeout = 0;\n _cancelContextMenuOpening = false;\n }, .4e3);\n\n _cancelContextMenuOpening = true;\n}\n\nexport function attachContextMenuListener({\n element,\n callback,\n listenerSetter,\n listenerOptions\n}: {\n element: HTMLElement,\n callback: (e: TouchEvent | MouseEvent) => void,\n listenerSetter?: ListenerSetter,\n listenerOptions?: ListenerOptions\n}) {\n const add = listenerSetter ? listenerSetter.add(element) : element.addEventListener.bind(element);\n const remove = listenerSetter ? listenerSetter.removeManual.bind(listenerSetter, element) : element.removeEventListener.bind(element);\n\n // can't cancel further events coming after 'contextmenu' event\n if((IS_APPLE && IS_TOUCH_SUPPORTED) || listenerOptions) {\n let timeout: number;\n\n const options: EventListenerOptions = {\n ...(listenerOptions || {}),\n capture: true\n };\n\n const onCancel = () => {\n clearTimeout(timeout);\n // @ts-ignore\n remove('touchmove', onCancel, options);\n // @ts-ignore\n remove('touchend', onCancel, options);\n // @ts-ignore\n remove('touchcancel', onCancel, options);\n };\n\n add('touchstart', (e: TouchEvent) => {\n if(e.touches.length > 1) {\n onCancel();\n return;\n }\n\n add('touchmove', onCancel, options);\n add('touchend', onCancel, options);\n add('touchcancel', onCancel, options);\n\n timeout = window.setTimeout(() => {\n if(_cancelContextMenuOpening) {\n onCancel();\n return;\n }\n\n callback(e);\n onCancel();\n\n if(contextMenuController.isOpened()) {\n add('touchend', cancelEvent, {once: true}); // * fix instant closing\n }\n }, .4e3);\n }, listenerOptions);\n\n /* if(!isSafari) {\n add('contextmenu', (e: any) => {\n cancelEvent(e);\n }, {passive: false, capture: true});\n } */\n } else {\n add('contextmenu', IS_TOUCH_SUPPORTED ? (e: any) => {\n callback(e);\n\n if(contextMenuController.isOpened()) {\n add('touchend', cancelEvent, {once: true}); // * fix instant closing\n }\n } : callback, listenerOptions);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport type GrabEvent = {x: number, y: number, isTouch?: boolean, event: TouchEvent | MouseEvent};\n\nexport default function attachGrabListeners(element: HTMLElement,\n onStart: (position: GrabEvent) => void,\n onMove: (position: GrabEvent) => void,\n onEnd?: (position: GrabEvent) => void) {\n // * Mouse\n const onMouseMove = (event: MouseEvent) => {\n onMove({x: event.pageX, y: event.pageY, event});\n };\n\n const onMouseUp = (event: MouseEvent) => {\n document.removeEventListener('mousemove', onMouseMove);\n element.addEventListener('mousedown', onMouseDown, {once: true});\n onEnd?.({x: event.pageX, y: event.pageY, event});\n };\n\n const onMouseDown = (event: MouseEvent) => {\n if(event.button !== 0) {\n element.addEventListener('mousedown', onMouseDown, {once: true});\n return;\n }\n\n onStart({x: event.pageX, y: event.pageY, event});\n onMouseMove(event);\n\n document.addEventListener('mousemove', onMouseMove);\n document.addEventListener('mouseup', onMouseUp, {once: true});\n };\n\n element.addEventListener('mousedown', onMouseDown, {once: true});\n\n // * Touch\n const onTouchMove = (event: TouchEvent) => {\n event.preventDefault();\n onMove({x: event.touches[0].clientX, y: event.touches[0].clientY, isTouch: true, event});\n };\n\n const onTouchEnd = (event: TouchEvent) => {\n document.removeEventListener('touchmove', onTouchMove);\n element.addEventListener('touchstart', onTouchStart, {passive: false, once: true});\n const touch = event.touches[0] || event.changedTouches[0];\n onEnd?.({x: touch.clientX, y: touch.clientY, isTouch: true, event});\n };\n\n const onTouchStart = (event: TouchEvent) => {\n onStart({x: event.touches[0].clientX, y: event.touches[0].clientY, isTouch: true, event});\n onTouchMove(event);\n\n document.addEventListener('touchmove', onTouchMove, {passive: false});\n document.addEventListener('touchend', onTouchEnd, {passive: false, once: true});\n };\n\n element.addEventListener('touchstart', onTouchStart, {passive: false, once: true});\n\n return () => {\n element.removeEventListener('mousedown', onMouseDown);\n document.removeEventListener('mousemove', onMouseMove);\n document.removeEventListener('mouseup', onMouseUp);\n\n element.removeEventListener('touchstart', onTouchStart);\n document.removeEventListener('touchmove', onTouchMove);\n document.removeEventListener('touchend', onTouchEnd);\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function cancelSelection() {\n if(window.getSelection) {\n if(window.getSelection().empty) { // Chrome\n window.getSelection().empty();\n } else if(window.getSelection().removeAllRanges) { // Firefox\n window.getSelection().removeAllRanges();\n }\n // @ts-ignore\n } else if(document.selection) { // IE?\n // @ts-ignore\n document.selection.empty();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ListenerSetter from '../listenerSetter';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport simulateEvent from './dispatchEvent';\n\nlet lastMouseDownElement: HTMLElement;\ndocument.addEventListener('mousedown', (e) => {\n lastMouseDownElement = e.target as HTMLElement;\n});\n\nexport function hasMouseMovedSinceDown(e: Event) {\n if(e.isTrusted && e.type === 'click' && e.target !== lastMouseDownElement) {\n return true;\n }\n}\n\nexport const CLICK_EVENT_NAME: 'mousedown' /* | 'touchend' */ | 'click' = (IS_TOUCH_SUPPORTED ? 'mousedown' : 'click') as any;\nexport type AttachClickOptions = AddEventListenerOptions & Partial<{listenerSetter: ListenerSetter, touchMouseDown: true}>;\nexport function attachClickEvent(elem: HTMLElement | Window, callback: (e: /* TouchEvent | */MouseEvent) => void, options: AttachClickOptions = {}) {\n const add = options.listenerSetter ? options.listenerSetter.add(elem) : elem.addEventListener.bind(elem);\n const remove = options.listenerSetter ? options.listenerSetter.removeManual.bind(options.listenerSetter, elem) : elem.removeEventListener.bind(elem);\n\n options.touchMouseDown = true;\n /* if(options.touchMouseDown && CLICK_EVENT_NAME === 'touchend') {\n add('mousedown', callback, options);\n } else if(CLICK_EVENT_NAME === 'touchend') {\n const o = {...options, once: true};\n\n const onTouchStart = (e: TouchEvent) => {\n const onTouchMove = (e: TouchEvent) => {\n remove('touchmove', onTouchMove, o);\n remove('touchend', onTouchEnd, o);\n };\n\n const onTouchEnd = (e: TouchEvent) => {\n remove('touchmove', onTouchMove, o);\n callback(e);\n if(options.once) {\n remove('touchstart', onTouchStart);\n }\n };\n\n add('touchend', onTouchEnd, o);\n add('touchmove', onTouchMove, o);\n };\n\n add('touchstart', onTouchStart);\n } else {\n add(CLICK_EVENT_NAME, callback, options);\n } */\n\n if(CLICK_EVENT_NAME === 'click') {\n const cb = callback;\n callback = (e) => {\n if(hasMouseMovedSinceDown(e)) {\n return;\n }\n\n cb(e);\n };\n }\n\n add(CLICK_EVENT_NAME, callback, options);\n\n // @ts-ignore\n return () => remove(CLICK_EVENT_NAME, callback, options);\n}\n\n// export function detachClickEvent(elem: HTMLElement | Window, callback: (e: /* TouchEvent | */MouseEvent) => void, options?: AddEventListenerOptions) {\n// // if(CLICK_EVENT_NAME === 'touchend') {\n// // elem.removeEventListener('touchstart', callback, options);\n// // } else {\n// elem.removeEventListener(CLICK_EVENT_NAME, callback as any, options);\n// // }\n// }\n\nexport function simulateClickEvent(elem: HTMLElement) {\n simulateEvent(elem, CLICK_EVENT_NAME);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport EventListenerBase from '../eventListenerBase';\nimport ListenerSetter from '../listenerSetter';\nimport safeAssign from '../object/safeAssign';\nimport findUpClassName from './findUpClassName';\n\nexport default class ControlsHover extends EventListenerBase<{\n toggleControls: (show: boolean) => void\n}> {\n protected hideControlsTimeout: number;\n protected controlsLocked: boolean;\n\n protected canHideControls: () => boolean;\n protected element: HTMLElement;\n protected listenerSetter: ListenerSetter;\n protected showOnLeaveToClassName: string;\n protected ignoreClickClassName: string;\n\n constructor() {\n super(false);\n this.hideControlsTimeout = 0;\n }\n\n public setup(options: {\n element: HTMLElement,\n listenerSetter: ListenerSetter,\n canHideControls?: () => boolean,\n showOnLeaveToClassName?: string,\n ignoreClickClassName?: string\n }) {\n safeAssign(this, options);\n\n const {listenerSetter, element} = this;\n\n if(IS_TOUCH_SUPPORTED) {\n listenerSetter.add(element)('click', (e) => {\n if(this.ignoreClickClassName && findUpClassName(e.target, this.ignoreClickClassName)) {\n return;\n }\n\n this.toggleControls();\n });\n\n /* listenerSetter.add(player)('touchstart', () => {\n showControls(false);\n });\n\n listenerSetter.add(player)('touchend', () => {\n if(player.classList.contains('is-playing')) {\n showControls();\n }\n }); */\n } else {\n listenerSetter.add(element)('mousemove', () => {\n this.showControls();\n });\n\n listenerSetter.add(element)('mouseenter', () => {\n this.showControls(false);\n });\n\n listenerSetter.add(element)('mouseleave', (e) => {\n if(e.relatedTarget && this.showOnLeaveToClassName && findUpClassName(e.relatedTarget, this.showOnLeaveToClassName)) {\n this.showControls(false);\n return;\n }\n\n this.hideControls();\n });\n }\n }\n\n public hideControls = (setHideTimeout = false) => {\n if(setHideTimeout) {\n if(!this.hideControlsTimeout) {\n this.hideControlsTimeout = window.setTimeout(this.hideControls, 3e3);\n }\n\n return;\n }\n\n clearTimeout(this.hideControlsTimeout);\n this.hideControlsTimeout = 0;\n\n const isShown = this.element.classList.contains('show-controls');\n if(this.controlsLocked !== false) {\n if((this.canHideControls ? !this.canHideControls() : false) || !isShown || this.controlsLocked) {\n return;\n }\n } else if(!isShown) {\n return;\n }\n\n this.dispatchEvent('toggleControls', false);\n this.element.classList.remove('show-controls');\n };\n\n public showControls = (setHideTimeout = true) => {\n if(this.hideControlsTimeout) {\n clearTimeout(this.hideControlsTimeout);\n this.hideControlsTimeout = 0;\n } else if(!this.element.classList.contains('show-controls') && this.controlsLocked !== false) {\n this.dispatchEvent('toggleControls', true);\n this.element.classList.add('show-controls');\n }\n\n if(!setHideTimeout || this.controlsLocked) {\n return;\n }\n\n this.hideControlsTimeout = window.setTimeout(this.hideControls, 3e3);\n };\n\n public toggleControls = (show?: boolean) => {\n const isShown = this.element.classList.contains('show-controls');\n\n if(show === undefined) {\n if(isShown) this.hideControls();\n else this.showControls();\n } else if(show === isShown) return;\n else if(show === false) this.hideControls();\n else this.showControls();\n };\n\n public lockControls(visible: boolean) {\n this.controlsLocked = visible;\n\n this.element.classList.toggle('disable-hover', visible === false);\n this.toggleControls(visible);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ButtonMenu, {ButtonMenuItemOptionsVerifiable} from '../../components/buttonMenu';\nimport filterAsync from '../array/filterAsync';\nimport callbackify from '../callbackify';\nimport contextMenuController from '../contextMenuController';\nimport ListenerSetter from '../listenerSetter';\nimport {getMiddleware, Middleware} from '../middleware';\nimport positionMenu from '../positionMenu';\nimport {attachContextMenuListener} from './attachContextMenuListener';\nimport {attachClickEvent} from './clickEvent';\n\nexport default function createContextMenu({\n buttons,\n findElement,\n listenTo,\n appendTo,\n filterButtons,\n onOpen,\n onClose,\n onBeforeOpen,\n listenerSetter: attachListenerSetter,\n middleware,\n listenForClick\n}: {\n buttons: T[],\n findElement?: (e: MouseEvent | TouchEvent) => HTMLElement,\n listenTo: HTMLElement,\n appendTo?: HTMLElement,\n filterButtons?: (buttons: T[]) => Promise,\n onOpen?: (target: HTMLElement) => any,\n onClose?: () => any,\n onBeforeOpen?: () => any,\n listenerSetter?: ListenerSetter,\n middleware?: Middleware,\n listenForClick?: boolean\n}) {\n appendTo ??= document.body;\n\n attachListenerSetter ??= new ListenerSetter();\n const listenerSetter = new ListenerSetter();\n const middlewareHelper = middleware ? middleware.create() : getMiddleware();\n let element: HTMLElement;\n\n const open = (e: MouseEvent | TouchEvent) => {\n const target = findElement ? findElement(e as any) : listenTo;\n if(!target) {\n return;\n }\n\n let _element = element;\n if(e instanceof MouseEvent || e.hasOwnProperty('preventDefault')) (e as any).preventDefault();\n if(_element && _element.classList.contains('active')) {\n return false;\n }\n if(e instanceof MouseEvent || e.hasOwnProperty('cancelBubble')) (e as any).cancelBubble = true;\n\n const r = async() => {\n await onOpen?.(target);\n\n const initResult = await init();\n if(!initResult) {\n return;\n }\n\n _element = initResult.element;\n const {cleanup, destroy} = initResult;\n\n positionMenu(e, _element);\n contextMenuController.openBtnMenu(_element, () => {\n onClose?.();\n cleanup();\n\n setTimeout(() => {\n destroy();\n }, 300);\n });\n };\n\n r();\n };\n\n attachContextMenuListener({\n element: listenTo,\n callback: open,\n listenerSetter: attachListenerSetter\n });\n\n const cleanup = () => {\n listenerSetter.removeAll();\n middlewareHelper.clean();\n };\n\n const destroy = () => {\n cleanup();\n attachListenerSetter.removeAll();\n };\n\n const init = async() => {\n cleanup();\n\n buttons.forEach((button) => button.element = undefined);\n const f = filterButtons || ((buttons: T[]) => filterAsync(buttons, (button) => {\n return button?.verify ? callbackify(button.verify(), (result) => result ?? false) : true;\n }));\n\n const filteredButtons = await f(buttons);\n if(!filteredButtons.length) {\n return;\n }\n\n const _element = element = await ButtonMenu({\n buttons: filteredButtons,\n listenerSetter\n });\n _element.classList.add('contextmenu');\n\n await onBeforeOpen?.();\n\n appendTo.append(_element);\n\n return {\n element: _element,\n cleanup,\n destroy: () => {\n _element.remove();\n }\n };\n };\n\n if(middleware) {\n middleware.onDestroy(() => {\n destroy();\n });\n }\n\n if(listenForClick) {\n attachClickEvent(listenTo, open, {listenerSetter: attachListenerSetter});\n }\n\n return {element, destroy, open};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../../lib/appManagers/appDocsManager';\nimport PopupStickers from '../../components/popups/stickers';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport rootScope from '../../lib/rootScope';\nimport createContextMenu from './createContextMenu';\nimport findUpClassName from './findUpClassName';\nimport emoticonsDropdown, {EmoticonsDropdown} from '../../components/emoticonsDropdown';\n\nexport default function createStickersContextMenu(options: {\n listenTo: HTMLElement,\n isStickerPack?: boolean,\n verifyRecent?: (target: HTMLElement) => boolean,\n appendTo?: HTMLElement,\n onOpen?: () => any,\n onClose?: () => any,\n onSend?: () => any\n}) {\n const {listenTo, isStickerPack, verifyRecent, appendTo, onOpen, onClose, onSend} = options;\n let target: HTMLElement, doc: MyDocument;\n const verifyFavoriteSticker = async(toAdd: boolean) => {\n const favedStickers = await rootScope.managers.acknowledged.appStickersManager.getFavedStickersStickers();\n if(!favedStickers.cached) {\n return false;\n }\n\n const found = (await favedStickers.result).some((_doc) => _doc.id === doc.id);\n return toAdd ? !found : found;\n };\n\n return createContextMenu({\n listenTo: listenTo,\n appendTo,\n findElement: (e) => target = findUpClassName(e.target, 'media-sticker-wrapper'),\n onOpen: async() => {\n doc = await rootScope.managers.appDocsManager.getDoc(target.dataset.docId);\n return onOpen?.();\n },\n onClose,\n buttons: [{\n icon: 'stickers',\n text: 'Context.ViewStickerSet',\n onClick: () => new PopupStickers(doc.stickerSetInput).show(),\n verify: () => !isStickerPack\n }, {\n icon: 'favourites',\n text: 'AddToFavorites',\n onClick: () => rootScope.managers.appStickersManager.faveSticker(doc.id, false),\n verify: () => verifyFavoriteSticker(true)\n }, {\n icon: 'favourites',\n text: 'DeleteFromFavorites',\n onClick: () => rootScope.managers.appStickersManager.faveSticker(doc.id, true),\n verify: () => verifyFavoriteSticker(false)\n }, {\n icon: 'delete',\n text: 'DeleteFromRecent',\n onClick: () => rootScope.managers.appStickersManager.saveRecentSticker(doc.id, true),\n verify: () => verifyRecent?.(target) ?? false\n }, {\n icon: 'mute',\n text: 'Chat.Send.WithoutSound',\n onClick: () => {\n onSend?.();\n return EmoticonsDropdown.sendDocId(doc.id, false, true);\n },\n verify: () => !!(appImManager.chat.peerId && appImManager.chat.peerId !== rootScope.myId)\n }, {\n icon: 'schedule',\n text: 'Chat.Send.ScheduledMessage',\n onClick: () => appImManager.chat.input.scheduleSending(() => appImManager.chat.input.sendMessageWithDocument(doc)),\n verify: () => !!appImManager.chat.peerId\n }]\n });\n}\n","export default function createVideo(options: {\n pip?: boolean\n} = {}) {\n const video = document.createElement('video');\n if(!options.pip) video.disablePictureInPicture = true;\n video.setAttribute('playsinline', 'true');\n return video;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport rootScope from '../../lib/rootScope';\nimport mediaSizes from '../mediaSizes';\n\nexport type CustomProperty = string;\n\nexport class CustomProperties {\n private cache: {[k in CustomProperty]?: string};\n private computedStyle: CSSStyleDeclaration;\n\n constructor() {\n this.cache = {};\n\n rootScope.addEventListener('theme_change', this.resetCache);\n mediaSizes.addEventListener('resize', this.resetCache);\n }\n\n protected resetCache = () => {\n this.computedStyle = undefined;\n const cache = this.cache;\n this.cache = {};\n\n for(const i in cache) {\n this.getProperty(i);\n }\n };\n\n public getProperty(name: CustomProperty) {\n let value = this.cache[name];\n if(value) {\n return value;\n }\n\n if(!this.computedStyle) {\n this.computedStyle = window.getComputedStyle(document.documentElement);\n }\n\n value = this.computedStyle.getPropertyValue('--' + name).trim();\n return this.cache[name] = value;\n }\n\n public getPropertyAsSize(name: CustomProperty) {\n const value = this.getProperty(name);\n let size: number;\n\n if(value[value.length - 1] === '%') {\n\n } else if(value.indexOf('rem')) {\n size = +value.replace('rem', '') * 16;\n } else {\n size = +value.replace('px', '');\n }\n\n return size;\n }\n}\n\nconst customProperties = new CustomProperties();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.customProperties = customProperties);\nexport default customProperties;\n","export default function simulateEvent(elem: EventTarget, name: string) {\n const event = new Event(name, {bubbles: true, cancelable: true});\n elem.dispatchEvent(event);\n}\n","import encodeEntities from '../string/encodeEntities';\n\nexport default function documentFragmentToHTML(fragment: DocumentFragment) {\n return Array.from(fragment.childNodes).map((node) => {\n return node.nodeType === node.TEXT_NODE ? encodeEntities(node.textContent) : (node as Element).outerHTML;\n }).join('');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function findUpAsChild(el: T, parent: HTMLElement): T {\n if(!el) return null;\n if(el.parentElement === parent) return el;\n\n while(el.parentElement) {\n el = el.parentElement as any;\n if(el.parentElement === parent) {\n return el;\n }\n }\n\n return null;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function findUpAttribute(el: any, attribute: string): HTMLElement {\n return el.closest(`[${attribute}]`);\n /* if(el.getAttribute(attribute) !== null) return el; // 03.02.2020\n\n while(el.parentElement) {\n el = el.parentElement;\n if(el.getAttribute(attribute) !== null)\n return el;\n }\n return null; */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function findUpTag(el: any, tag: string): HTMLElement {\n return el.closest(tag);\n /* if(el.tagName === tag) return el; // 03.02.2020\n\n while(el.parentElement) {\n el = el.parentElement;\n if(el.tagName === tag)\n return el;\n }\n return null; */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ListenerSetter from '../listenerSetter';\n\nexport function requestFullScreen(element: HTMLElement) {\n if(element.requestFullscreen) {\n element.requestFullscreen();\n // @ts-ignore\n } else if(element.mozRequestFullScreen) {\n // @ts-ignore\n element.mozRequestFullScreen(); // Firefox\n // @ts-ignore\n } else if(element.webkitRequestFullscreen) {\n // @ts-ignore\n element.webkitRequestFullscreen(); // Chrome and Safari\n // @ts-ignore\n } else if(element.msRequestFullscreen) {\n // @ts-ignore\n element.msRequestFullscreen();\n }\n}\n\nexport function cancelFullScreen() {\n // @ts-ignore\n if(document.cancelFullScreen) {\n // @ts-ignore\n document.cancelFullScreen();\n // @ts-ignore\n } else if(document.mozCancelFullScreen) {\n // @ts-ignore\n document.mozCancelFullScreen();\n // @ts-ignore\n } else if(document.webkitCancelFullScreen) {\n // @ts-ignore\n document.webkitCancelFullScreen();\n // @ts-ignore\n } else if(document.msExitFullscreen) {\n // @ts-ignore\n document.msExitFullscreen();\n }\n}\n\nexport function addFullScreenListener(element: HTMLElement, callback: (e: Event) => any, listenerSetter?: ListenerSetter) {\n const addListener = listenerSetter ? listenerSetter.add(element) : element.addEventListener.bind(element);\n 'webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange'.split(' ').forEach((eventName) => {\n addListener(eventName, callback, false);\n });\n}\n\nexport function getFullScreenElement(): HTMLElement {\n // @ts-ignore\n return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement;\n}\n\nexport function isFullScreen() {\n return !!getFullScreenElement();\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport findUpAsChild from './findUpAsChild';\n\nexport default function getCaretPosNew(input: HTMLElement, anchor?: boolean): ReturnType & {selection: Selection} {\n const selection = document.getSelection();\n // let {focusNode: node, focusOffset: offset} = selection;\n const node = selection[anchor ? 'anchorNode' : 'focusNode'];\n const offset = selection[anchor ? 'anchorOffset' : 'focusOffset'];\n if(!findUpAsChild(node, input) && node !== input) {\n return {selection} as any;\n }\n\n return {...getCaretPosF(input, node, offset), selection};\n}\n\nexport function getCaretPosF(input: HTMLElement, node: Node, offset: number) {\n if(node === input) {\n const childNodes = input.childNodes;\n const childNodesLength = childNodes.length;\n if(childNodesLength && offset >= childNodesLength) {\n node = childNodes[childNodesLength - 1];\n offset = (node.textContent || (node as HTMLImageElement).alt || '').length;\n } else {\n node = childNodes[offset];\n offset = 0;\n }\n }\n\n return {node: node as ChildNode, offset};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\nimport BOM from '../string/bom';\n\nexport type MarkdownType = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'monospace' | 'link' | 'mentionName' | 'spoiler'/* | 'customEmoji' */;\nexport type MarkdownTag = {\n match: string,\n entityName: Extract;\n};\n\n// https://core.telegram.org/bots/api#html-style\nexport const markdownTags: {[type in MarkdownType]: MarkdownTag} = {\n bold: {\n match: '[style*=\"bold\"], [style*=\"font-weight: 700\"], [style*=\"font-weight: 600\"], [style*=\"font-weight:700\"], [style*=\"font-weight:600\"], b, strong',\n entityName: 'messageEntityBold'\n },\n underline: {\n match: '[style*=\"underline\"], u, ins',\n entityName: 'messageEntityUnderline'\n },\n italic: {\n match: '[style*=\"italic\"], i, em',\n entityName: 'messageEntityItalic'\n },\n monospace: {\n match: '[style*=\"monospace\"], [face*=\"monospace\"], pre',\n entityName: 'messageEntityCode'\n },\n strikethrough: {\n match: '[style*=\"line-through\"], [style*=\"strikethrough\"], strike, del, s',\n entityName: 'messageEntityStrike'\n },\n link: {\n match: 'A:not(.follow)',\n entityName: 'messageEntityTextUrl'\n },\n mentionName: {\n match: 'A.follow',\n entityName: 'messageEntityMentionName'\n },\n spoiler: {\n match: '[style*=\"spoiler\"]',\n entityName: 'messageEntitySpoiler'\n }\n // customEmoji: {\n // match: '.custom-emoji',\n // entityName: 'messageEntityCustomEmoji'\n // }\n};\n\nconst tabulationMatch = '[style*=\"table-cell\"], th, td';\n\n/* export function getDepth(child: Node, container?: Node) {\n let depth = 0;\n\n do {\n if(child === container) {\n return depth;\n }\n\n ++depth;\n } while((child = child.parentNode) !== null);\n\n return depth;\n} */\n\nconst BLOCK_TAGS = new Set([\n 'DIV',\n 'P',\n 'BR',\n 'LI',\n 'SECTION',\n 'H6',\n 'H5',\n 'H4',\n 'H3',\n 'H2',\n 'H1',\n 'TR',\n 'OL',\n 'UL'\n]);\n\n// const INSERT_NEW_LINE_TAGS = new Set([\n// 'OL',\n// 'UL'\n// ]);\n\nconst BOM_REG_EXP = new RegExp(BOM, 'g');\nexport const SELECTION_SEPARATOR = '\\x01';\n\nfunction checkNodeForEntity(node: Node, value: string, entities: MessageEntity[], offset: {offset: number}) {\n const parentElement = node.parentElement;\n\n // let closestTag: MarkdownTag, closestElementByTag: Element, closestDepth = Infinity;\n for(const type in markdownTags) {\n const tag = markdownTags[type as MarkdownType];\n const closest: HTMLElement = parentElement.closest(tag.match + ', [contenteditable=\"true\"]');\n if(closest?.getAttribute('contenteditable') !== null) {\n /* const depth = getDepth(closest, parentElement.closest('[contenteditable]'));\n if(closestDepth > depth) {\n closestDepth = depth;\n closestTag = tag;\n closestElementByTag = closest;\n } */\n continue;\n }\n\n if(tag.entityName === 'messageEntityTextUrl') {\n entities.push({\n _: tag.entityName,\n url: (closest as HTMLAnchorElement).href,\n offset: offset.offset,\n length: value.length\n });\n } else if(tag.entityName === 'messageEntityMentionName') {\n entities.push({\n _: tag.entityName,\n offset: offset.offset,\n length: value.length,\n user_id: (closest as HTMLElement).dataset.follow.toUserId()\n });\n }/* else if(tag.entityName === 'messageEntityCustomEmoji') {\n entities.push({\n _: tag.entityName,\n document_id: (closest as HTMLElement).dataset.docId,\n offset: offset.offset,\n length: emoji.length\n });\n } */ else {\n entities.push({\n _: tag.entityName,\n offset: offset.offset,\n length: value.length\n });\n }\n }\n}\n\nfunction isLineEmpty(line: string[]) {\n const {length} = line;\n if(!length) {\n return true;\n }\n\n if(line[length - 1] === SELECTION_SEPARATOR && length === SELECTION_SEPARATOR.length) {\n return true;\n }\n\n return false;\n}\n\nexport default function getRichElementValue(\n node: HTMLElement,\n lines: string[],\n line: string[],\n selNode?: Node,\n selOffset?: number,\n entities?: MessageEntity[],\n offset = {offset: 0}\n) {\n if(node.nodeType === node.TEXT_NODE) { // TEXT\n let nodeValue = node.nodeValue;\n // if(nodeValue[0] === BOM) {\n nodeValue = nodeValue.replace(BOM_REG_EXP, '');\n // }\n\n /* const tabulation = node.parentElement?.closest(tabulationMatch + ', [contenteditable]');\n if(tabulation?.getAttribute('contenteditable') === null) {\n nodeValue += ' ';\n // line.push('\\t');\n // ++offset.offset;\n } */\n\n if(nodeValue) {\n if(selNode === node) {\n line.push(nodeValue.substr(0, selOffset) + SELECTION_SEPARATOR + nodeValue.substr(selOffset));\n } else {\n line.push(nodeValue);\n }\n } else if(selNode === node) {\n line.push(SELECTION_SEPARATOR);\n }\n\n if(entities && nodeValue.length && node.parentNode) {\n checkNodeForEntity(node, nodeValue, entities, offset);\n }\n\n offset.offset += nodeValue.length;\n return;\n }\n\n if(node.nodeType !== node.ELEMENT_NODE) { // NON-ELEMENT\n return;\n }\n\n const pushLine = () => {\n lines.push(line.join(''));\n line.length = 0;\n ++offset.offset;\n };\n\n const isSelected = selNode === node;\n const isBlock = BLOCK_TAGS.has(node.tagName);\n if(isBlock && (line.length || node.tagName === 'BR'/* || (BLOCK_TAGS.has(node.tagName) && lines.length) */)) {\n pushLine();\n } else {\n const alt = node.dataset.stickerEmoji || (node as HTMLImageElement).alt;\n const stickerEmoji = node.dataset.stickerEmoji;\n\n if(alt && entities) {\n checkNodeForEntity(node, alt, entities, offset);\n }\n\n if(stickerEmoji && entities) {\n entities.push({\n _: 'messageEntityCustomEmoji',\n document_id: node.dataset.docId,\n offset: offset.offset,\n length: alt.length\n });\n }\n\n if(alt) {\n line.push(alt);\n offset.offset += alt.length;\n }\n }\n\n if(isSelected && !selOffset) {\n line.push(SELECTION_SEPARATOR);\n }\n\n const isTableCell = node.matches(tabulationMatch);\n const wasEntitiesLength = entities?.length;\n const wasLinesLength = lines.length;\n let wasNodeEmpty = true;\n\n let curChild = node.firstChild as HTMLElement;\n while(curChild) {\n getRichElementValue(curChild, lines, line, selNode, selOffset, entities, offset);\n curChild = curChild.nextSibling as any;\n\n if(!isLineEmpty(line)) {\n wasNodeEmpty = false;\n }\n }\n\n // can test on text with list (https://www.who.int/initiatives/sports-and-health)\n if(wasNodeEmpty && node.textContent?.replace(/[\\r\\n]/g, '')) {\n wasNodeEmpty = false;\n }\n\n if(isSelected && selOffset) {\n line.push(SELECTION_SEPARATOR);\n }\n\n if(isTableCell && node.nextSibling && !isLineEmpty(line)) {\n line.push(' ');\n ++offset.offset;\n\n // * combine entities such as url after adding space\n if(wasEntitiesLength !== undefined) {\n for(let i = wasEntitiesLength, length = entities.length; i < length; ++i) {\n ++entities[i].length;\n }\n }\n }\n\n if(isBlock && !wasNodeEmpty) {\n pushLine();\n }\n\n if(!wasNodeEmpty && node.tagName === 'P' && node.nextSibling) {\n lines.push('');\n ++offset.offset;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport {MessageEntity} from '../../layer';\nimport combineSameEntities from '../../lib/richTextProcessor/combineSameEntities';\nimport sortEntities from '../../lib/richTextProcessor/sortEntities';\nimport getRichElementValue, {SELECTION_SEPARATOR} from './getRichElementValue';\n\nexport function getCaretPos(field: HTMLElement) {\n const sel = window.getSelection();\n let selNode: Node;\n let selOffset: number;\n if(sel?.rangeCount) {\n const range = sel.getRangeAt(0);\n const startOffset = range.startOffset;\n if(\n range.startContainer &&\n range.startContainer == range.endContainer &&\n startOffset == range.endOffset\n ) {\n // * if focused on img, or caret has been set via placeCaretAtEnd\n const possibleChildrenFocusOffset = startOffset - 1;\n const childNodes = field.childNodes;\n if(range.startContainer === field && childNodes[possibleChildrenFocusOffset]) {\n selNode = childNodes[possibleChildrenFocusOffset];\n selOffset = 0;\n\n for(let i = 0; i < range.endOffset; ++i) {\n const node = childNodes[i];\n const value = node.nodeValue || (node as HTMLImageElement).alt;\n\n if(value) {\n selOffset += value.length;\n }\n }\n } else {\n selNode = range.startContainer;\n selOffset = startOffset;\n }\n }\n }\n\n return {node: selNode, offset: selOffset};\n}\n\nexport default function getRichValueWithCaret(\n field: HTMLElement | DocumentFragment,\n withEntities = true,\n withCaret = true\n) {\n const lines: string[] = [];\n const line: string[] = [];\n\n const {node: selNode, offset: selOffset} = !(field instanceof DocumentFragment) && withCaret && getCaretPos(field);\n\n const entities: MessageEntity[] = withEntities ? [] : undefined;\n const offset = {offset: 0};\n if(field instanceof DocumentFragment) {\n let curChild = field.firstChild as HTMLElement;\n while(curChild) {\n getRichElementValue(curChild, lines, line, selNode, selOffset, entities, offset);\n curChild = curChild.nextSibling as any;\n }\n } else {\n getRichElementValue(field, lines, line, selNode, selOffset, entities, offset);\n }\n\n if(line.length) {\n lines.push(line.join(''));\n }\n\n let value = lines.join('\\n');\n const caretPos = value.indexOf(SELECTION_SEPARATOR);\n if(caretPos !== -1) {\n value = value.substr(0, caretPos) + value.substr(caretPos + 1);\n }\n value = value.replace(/\\u00A0/g, ' ');\n\n if(entities?.length) {\n // ! cannot do that here because have the same check before the sending in RichTextProcessor.parseMarkdown\n /* const entity = entities[entities.length - 1];\n const length = value.length;\n const trimmedLength = value.trimRight().length;\n if(length !== trimmedLength) {\n entity.length -= length - trimmedLength;\n } */\n\n combineSameEntities(entities);\n sortEntities(entities);\n }\n\n return {value, entities, caretPos};\n}\n\nMOUNT_CLASS_TO.getRichValueWithCaret = getRichValueWithCaret;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport getVisibleRect from './getVisibleRect';\n\nexport type ViewportSlicePart = {element: HTMLElement, rect: DOMRect, visibleRect: ReturnType}[];\n\nexport default function getViewportSlice({overflowElement, overflowRect, selector, extraSize, elements}: {\n overflowElement: HTMLElement,\n overflowRect?: DOMRectMinified,\n extraSize?: number,\n selector?: string,\n elements?: HTMLElement[]\n}) {\n // const perf = performance.now();\n overflowRect ??= overflowElement.getBoundingClientRect();\n elements ??= Array.from(overflowElement.querySelectorAll(selector));\n\n if(extraSize) {\n overflowRect = {\n top: overflowRect.top - extraSize,\n right: overflowRect.right + extraSize,\n bottom: overflowRect.bottom + extraSize,\n left: overflowRect.left - extraSize\n };\n }\n\n const invisibleTop: ViewportSlicePart = [],\n visible: typeof invisibleTop = [],\n invisibleBottom: typeof invisibleTop = [];\n let foundVisible = false;\n for(const element of elements) {\n const rect = element.getBoundingClientRect();\n const visibleRect = getVisibleRect(element, overflowElement, false, rect, overflowRect);\n\n const isVisible = !!visibleRect;\n let array: typeof invisibleTop;\n if(isVisible) {\n foundVisible = true;\n array = visible;\n } else if(foundVisible) {\n array = invisibleBottom;\n } else {\n array = invisibleTop;\n }\n\n array.push({\n element,\n rect,\n visibleRect\n });\n }\n\n // if(extraSize && visible.length) {\n // const maxTop = visible[0].rect.top;\n // const minTop = maxTop - extraSize;\n // const minBottom = visible[visible.length - 1].rect.bottom;\n // const maxBottom = minBottom + extraSize;\n\n // for(let length = invisibleTop.length, i = length - 1; i >= 0; --i) {\n // const element = invisibleTop[i];\n // if(element.rect.top >= minTop) {\n // invisibleTop.splice(i, 1);\n // visible.unshift(element);\n // }\n // }\n\n // for(let i = 0, length = invisibleBottom.length; i < length; ++i) {\n // const element = invisibleBottom[i];\n // if(element.rect.bottom <= maxBottom) {\n // invisibleBottom.splice(i--, 1);\n // --length;\n // visible.push(element);\n // }\n // }\n // }\n\n // console.log('getViewportSlice time:', performance.now() - perf);\n\n return {invisibleTop, visible, invisibleBottom};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport windowSize from '../windowSize';\n\nexport default function getVisibleRect(\n element: HTMLElement,\n overflowElement: HTMLElement,\n lookForSticky?: boolean,\n rect: DOMRectMinified = element.getBoundingClientRect(),\n overflowRect: DOMRectMinified = overflowElement.getBoundingClientRect()\n) {\n let {top: overflowTop, right: overflowRight, bottom: overflowBottom, left: overflowLeft} = overflowRect;\n\n // * respect sticky headers\n if(lookForSticky) {\n const sticky = overflowElement.querySelector('.sticky');\n if(sticky) {\n const stickyRect = sticky.getBoundingClientRect();\n overflowTop = stickyRect.bottom;\n }\n }\n\n if(rect.top >= overflowBottom ||\n rect.bottom <= overflowTop ||\n rect.right <= overflowLeft ||\n rect.left >= overflowRight) {\n return null;\n }\n\n const overflow = {\n top: false,\n right: false,\n bottom: false,\n left: false,\n vertical: 0 as 0 | 1 | 2,\n horizontal: 0 as 0 | 1 | 2\n };\n\n const windowWidth = windowSize.width;\n const windowHeight = windowSize.height;\n\n return {\n rect: {\n top: rect.top < overflowTop && overflowTop !== 0 ? (overflow.top = true, ++overflow.vertical, overflowTop) : rect.top,\n right: rect.right > overflowRight && overflowRight !== windowWidth ? (overflow.right = true, ++overflow.horizontal, overflowRight) : rect.right,\n bottom: rect.bottom > overflowBottom && overflowBottom !== windowHeight ? (overflow.bottom = true, ++overflow.vertical, overflowBottom) : rect.bottom,\n left: rect.left < overflowLeft && overflowLeft !== 0 ? (overflow.left = true, ++overflow.horizontal, overflowLeft) : rect.left\n },\n overflow\n };\n}\n\n(window as any).getVisibleRect = getVisibleRect;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport SwipeHandler, {SwipeHandlerOptions} from '../../components/swipeHandler';\nimport cancelEvent from './cancelEvent';\nimport findUpClassName from './findUpClassName';\nimport isSwipingBackSafari from './isSwipingBackSafari';\n\nexport type SwipeHandlerHorizontalOptions = SwipeHandlerOptions & {\n // xThreshold?: number\n};\n\nexport default function handleHorizontalSwipe(options: SwipeHandlerHorizontalOptions) {\n let cancelY = false;\n return new SwipeHandler({\n ...options,\n verifyTouchTarget: (e) => {\n return !findUpClassName(e.target, 'progress-line') &&\n !isSwipingBackSafari(e as any as TouchEvent) &&\n (options.verifyTouchTarget ? options.verifyTouchTarget(e) : true);\n },\n onSwipe: (xDiff, yDiff, e) => {\n xDiff *= -1;\n yDiff *= -1;\n\n if(!cancelY && Math.abs(yDiff) > 20) {\n return true;\n }\n\n if(Math.abs(xDiff) > Math.abs(yDiff)) {\n cancelEvent(e as any as Event);\n cancelY = true;\n } else if(!cancelY && Math.abs(yDiff) > Math.abs(xDiff)/* || Math.abs(yDiff) > 20 */) {\n return true;\n }\n\n /* if(!cancelY && options.xThreshold !== undefined && xDiff >= options.xThreshold) {\n cancelY = true;\n } */\n\n return options.onSwipe(xDiff, yDiff, e);\n },\n onReset: () => {\n cancelY = false;\n options.onReset && options.onReset();\n },\n cancelEvent: false // cannot use cancelEvent on Safari iOS because scroll will be canceled too\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {cancelContextMenuOpening} from './attachContextMenuListener';\nimport handleHorizontalSwipe, {SwipeHandlerHorizontalOptions} from './handleHorizontalSwipe';\n\nexport default function handleTabSwipe(options: SwipeHandlerHorizontalOptions) {\n return handleHorizontalSwipe({\n ...options,\n onSwipe: (xDiff, yDiff, e) => {\n xDiff *= -1;\n yDiff *= -1;\n\n if(Math.abs(xDiff) > 50) {\n options.onSwipe(xDiff, yDiff, e);\n cancelContextMenuOpening();\n\n return true;\n }\n }\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {markdownTags, MarkdownType} from './getRichElementValue';\n\nexport default function hasMarkupInSelection(types: T[], onlyFull?: boolean) {\n const result: Record = {} as any;\n types.forEach((tag) => result[tag] = 0);\n const selection = window.getSelection();\n let nodes = -1;\n if(!selection.isCollapsed) {\n const range = selection.getRangeAt(0);\n const commonAncestor = range.commonAncestorContainer;\n const root = commonAncestor.nodeType === commonAncestor.ELEMENT_NODE ?\n commonAncestor as HTMLElement :\n (commonAncestor as ChildNode).parentElement;\n const treeWalker = document.createTreeWalker(\n root.closest('[contenteditable=\"true\"]'),\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT,\n {acceptNode: (node) => range.intersectsNode(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT}\n );\n\n nodes = 0;\n let node: Node;\n while(node = treeWalker.nextNode()) {\n ++nodes;\n for(const type of types) {\n const tag = markdownTags[type];\n const matches = (node.nodeType === node.ELEMENT_NODE ? node as HTMLElement : node.parentElement).closest(tag.match);\n if(matches) {\n ++result[type];\n }\n }\n }\n }\n\n const resultBoolean: Record = {} as any;\n for(const type of types) {\n resultBoolean[type] = result[type] >= (onlyFull ? nodes : 1);\n }\n\n return resultBoolean;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function htmlToDocumentFragment(html: string | DocumentFragment) {\n if(html instanceof DocumentFragment) return html;\n const template = document.createElement('template');\n html = html.trim(); // Never return a text node of whitespace as the result\n template.innerHTML = html;\n return template.content;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function htmlToSpan(html: string | DocumentFragment) {\n const span = document.createElement('span');\n if(typeof(html) === 'string') span.innerHTML = html;\n else span.append(html);\n return span;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\n/* export function isInDOM(element: Element, parentNode?: HTMLElement): boolean {\n if(!element) {\n return false;\n }\n\n parentNode = parentNode || document.body;\n if(element === parentNode) {\n return true;\n }\n return isInDOM(element.parentNode as HTMLElement, parentNode);\n} */\nexport default function isInDOM(element: Element): boolean {\n return element?.isConnected;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function isInputEmpty(element: HTMLElement) {\n if(element.isContentEditable || element.tagName !== 'INPUT') {\n /* const value = element.innerText;\n\n return !value.trim() && !serializeNodes(Array.from(element.childNodes)).trim(); */\n // return !getRichValueWithCaret(element, false, false).value.trim();\n return !element.textContent.trim() && !element.querySelector('.emoji, .custom-emoji, .custom-emoji-placeholder');\n } else {\n return !(element as HTMLInputElement).value.trim();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function isSelectionEmpty(selection = window.getSelection()) {\n if(!selection?.rangeCount) {\n return true;\n }\n\n const selectionRange = selection.getRangeAt(0);\n if(selectionRange.collapsed || !selectionRange.START_TO_END) {\n return true;\n }\n\n return false;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../../lib/rootScope';\nimport {IS_MOBILE, IS_APPLE} from '../../environment/userAgent';\n\nexport default function isSendShortcutPressed(e: KeyboardEvent) {\n if(e.key === 'Enter' && !IS_MOBILE && !e.isComposing) {\n /* if(e.ctrlKey || e.metaKey) {\n this.messageInput.innerHTML += '
';\n placeCaretAtEnd(this.message)\n return;\n } */\n\n if(rootScope.settings.sendShortcut === 'enter') {\n if(e.shiftKey || e.ctrlKey || e.metaKey) {\n return;\n }\n\n return true;\n } else {\n const secondaryKey = IS_APPLE ? e.metaKey : e.ctrlKey;\n if(e.shiftKey || (IS_APPLE ? e.ctrlKey : e.metaKey)) {\n return;\n }\n\n if(secondaryKey) {\n return true;\n }\n }\n }\n\n return false;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {IS_MOBILE_SAFARI} from '../../environment/userAgent';\n\nexport default function isSwipingBackSafari(e: TouchEvent | MouseEvent) {\n return IS_MOBILE_SAFARI && e instanceof TouchEvent && e.touches[0].clientX < 30;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\n\nexport default function placeCaretAtEnd(el: HTMLElement, ignoreTouchCheck = false, focus = true) {\n if(IS_TOUCH_SUPPORTED && (!ignoreTouchCheck || (document.activeElement.tagName !== 'INPUT' && !(document.activeElement as HTMLElement).isContentEditable))) {\n return;\n }\n\n focus && el.focus();\n if(el instanceof HTMLInputElement) {\n const length = el.value.length;\n el.selectionStart = length;\n el.selectionEnd = length;\n } else {\n const range = document.createRange();\n range.selectNodeContents(el);\n range.collapse(false);\n const sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n }\n}\n\n(window as any).placeCaretAtEnd = placeCaretAtEnd;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport whichChild from './whichChild';\n\nexport default function positionElementByIndex(element: HTMLElement, container: HTMLElement, pos: number, prevPos?: number) {\n if(prevPos === undefined) {\n prevPos = element.parentElement === container ? whichChild(element) : -1;\n }\n\n if(prevPos === pos) {\n return false;\n } else if(prevPos !== -1 && prevPos < pos) { // was higher\n pos += 1;\n }\n\n if(!pos) {\n container.prepend(element);\n } else if(container.childElementCount > pos) {\n container.insertBefore(element, container.children[pos]);\n } else {\n container.append(element);\n }\n\n return true;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function reflowScrollableElement(element: HTMLElement) {\n element.style.display = 'none';\n void element.offsetLeft; // reflow\n element.style.display = '';\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport onMediaLoad from '../onMediaLoad';\n\n// import { getHeavyAnimationPromise } from \"../../hooks/useHeavyAnimationCheck\";\n\nexport const loadedURLs: {[url: string]: boolean} = {};\nconst set = (elem: HTMLElement | HTMLImageElement | SVGImageElement | HTMLVideoElement, url: string) => {\n if(elem instanceof HTMLImageElement || elem instanceof HTMLVideoElement) elem.src = url;\n else if(elem instanceof SVGImageElement) elem.setAttributeNS(null, 'href', url);\n else elem.style.backgroundImage = 'url(' + url + ')';\n};\n\n// проблема функции в том, что она не подходит для ссылок, пригодна только для blob'ов, потому что обычным ссылкам нужен 'load' каждый раз.\nexport default function renderImageFromUrl(\n elem: HTMLElement | HTMLImageElement | SVGImageElement | HTMLVideoElement,\n url: string,\n callback?: () => void,\n useCache = true\n) {\n if(!url) {\n console.error('renderImageFromUrl: no url?', elem, url);\n callback?.();\n return;\n }\n\n const isVideo = elem instanceof HTMLVideoElement;\n if(((loadedURLs[url]/* && false */) && useCache) || isVideo) {\n if(elem) {\n set(elem, url);\n }\n\n if(callback) {\n if(isVideo) {\n onMediaLoad(elem).then(callback);\n } else {\n callback?.();\n }\n // callback && getHeavyAnimationPromise().then(() => callback());\n }\n } else {\n const isImage = elem instanceof HTMLImageElement;\n const loader = isImage ? elem as HTMLImageElement : new Image();\n // const loader = new Image();\n loader.src = url;\n // let perf = performance.now();\n\n const onLoad = () => {\n if(!isImage && elem) {\n set(elem, url);\n }\n\n loadedURLs[url] = true;\n // console.log('onload:', url, performance.now() - perf);\n // TODO: переделать прогрузки аватаров до начала анимации, иначе с этим ожиданием они неприятно появляются\n // callback && getHeavyAnimationPromise().then(() => callback());\n callback?.();\n\n loader.removeEventListener('error', onError);\n };\n\n const onError = (err: ErrorEvent) => {\n console.error('Render image from url failed:', err, url, loader);\n loader.removeEventListener('load', onLoad);\n callback?.();\n };\n\n loader.addEventListener('load', onLoad, {once: true});\n loader.addEventListener('error', onError, {once: true});\n }\n}\n\nexport function renderImageFromUrlPromise(elem: Parameters[0], url: string, useCache?: boolean) {\n return new Promise((resolve) => {\n renderImageFromUrl(elem, url, resolve, useCache);\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport sequentialDom from '../sequentialDom';\nimport {renderImageFromUrlPromise} from './renderImageFromUrl';\n\nexport default function renderMediaWithFadeIn(\n container: HTMLElement,\n media: Parameters[0],\n url: string,\n needFadeIn: boolean,\n aspecter = container,\n thumbImage?: HTMLElement\n) {\n if(needFadeIn) {\n media.classList.add('fade-in');\n }\n\n const promise = renderImageFromUrlPromise(media, url).then(() => {\n return sequentialDom.mutateElement(container, () => {\n aspecter.append(media);\n\n if(needFadeIn) {\n media.addEventListener('animationend', () => {\n sequentialDom.mutate(() => {\n media.classList.remove('fade-in');\n thumbImage?.remove();\n });\n }, {once: true});\n } else {\n thumbImage?.remove();\n }\n });\n });\n\n // recordPromise(promise, 'renderImageWithFadeIn');\n\n return promise;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function replaceContent(elem: HTMLElement, node: string | Node) {\n if(typeof(node) === 'string') {\n elem.innerHTML = node;\n return;\n }\n\n // * children.length doesn't count text nodes\n const firstChild = elem.firstChild;\n if(firstChild) {\n if(elem.lastChild === firstChild) {\n firstChild.replaceWith(node);\n } else {\n elem.textContent = '';\n elem.append(node);\n }\n } else {\n elem.append(node);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport clamp from '../number/clamp';\nimport findUpAsChild from './findUpAsChild';\nimport whichChild from './whichChild';\n\nexport default function compareNodes(node1: ChildNode, node1Offset: number, node2: ChildNode, node2Offset: number) {\n let diff: number;\n if(node1 === node2) {\n diff = node1Offset - node2Offset;\n } else if(node1.parentElement === node2.parentElement) {\n diff = whichChild(node1, true) - whichChild(node2, true);\n } else {\n const parents: HTMLElement[] = [];\n let parentElement = node1.parentElement;\n do {\n parents.push(parentElement);\n } while(parentElement = parentElement.parentElement);\n\n parentElement = node2.parentElement;\n do {\n if(parents.includes(parentElement)) {\n break;\n }\n } while(parentElement = parentElement.parentElement);\n\n const commonAncestorContainer = parentElement;\n // const range = document.createRange();\n // range.setStart(node1, 0);\n // range.setEnd(node2, node2.textContent.length);\n // const {commonAncestorContainer} = range;\n node1 = findUpAsChild(node1 as HTMLElement, commonAncestorContainer as HTMLElement);\n node2 = findUpAsChild(node2 as HTMLElement, commonAncestorContainer as HTMLElement);\n diff = whichChild(node1, true) - whichChild(node2, true);\n }\n\n return clamp(diff, -1, 1);\n}\n\n(window as any).compareNodes = compareNodes;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {IS_FIREFOX} from '../../environment/userAgent';\nimport {logger} from '../../lib/logger';\nimport {isCustomFillerNeededBySiblingNode} from '../../lib/richTextProcessor/wrapRichText';\nimport ListenerSetter from '../listenerSetter';\nimport BOM from '../string/bom';\nimport compareNodes from './compareNodes';\nimport getCaretPosNew from './getCaretPosNew';\nimport placeCaretAtEnd from './placeCaretAtEnd';\nimport whichChild from './whichChild';\n\nconst NOT_ONLY_BOMS_REG_EXP = new RegExp(`[^${BOM}]`);\n\nexport const USING_BOMS = false;\n\nexport default class RichInputHandler {\n private static INSTANCE: RichInputHandler;\n\n private listenerSetter: ListenerSetter;\n\n private lastNode: Node;\n private lastOffset: number;\n private savedRanges: WeakMap;\n\n private log: ReturnType;\n\n private inputCaptureCallbacks: Function[];\n\n constructor() {\n this.log = logger('RICH-INPUT');\n this.listenerSetter = new ListenerSetter();\n this.savedRanges = new WeakMap();\n\n this.listenerSetter.add(document)('selectionchange', this.saveSelectionOnChange);\n if(USING_BOMS) {\n this.listenerSetter.add(document)('focusout', this.onFocusOut);\n this.listenerSetter.add(document)('selectionchange', this.onSelectionChange);\n this.listenerSetter.add(document)('beforeinput', this.onBeforeInput);\n this.listenerSetter.add(document)('keydown', this.onKeyDown, {capture: true});\n\n if(IS_FIREFOX) {\n this.inputCaptureCallbacks = [];\n this.listenerSetter.add(document)('input', () => {\n this.inputCaptureCallbacks.forEach((callback) => callback());\n this.inputCaptureCallbacks.length = 0;\n }, {capture: true});\n }\n }\n }\n\n private get input() {\n const selection = document.getSelection();\n const {anchorNode: node} = selection;\n if(!node) return;\n return ((node as HTMLElement).closest ? node as HTMLElement : node.parentElement).closest('[contenteditable=\"true\"]');\n }\n\n private saveRangeForElement(element: HTMLElement) {\n if(element && (element.isContentEditable || element.tagName === 'INPUT')) {\n const selection = document.getSelection();\n if(selection.rangeCount) {\n this.savedRanges.set(element as HTMLElement, document.getSelection().getRangeAt(0));\n }\n }\n }\n\n private saveSelectionOnChange = (e: Event) => {\n const element = document.activeElement as HTMLElement; // e.target as HTMLElement;\n this.saveRangeForElement(element);\n };\n\n private onFocusOut = (e: FocusEvent) => {\n this.lastNode = this.lastOffset = undefined;\n };\n\n private findPreviousSmthIndex(input: HTMLElement, node: ChildNode, something?: NodeListOf) {\n // node = this.getFiller(node);\n // const childNodes = Array.from(node.parentElement.childNodes);\n // fillerIndex = childNodes.indexOf(node);\n // let smthIndex = -1;\n // for(let i = fillerIndex; i >= 0; --i) {\n // const node = childNodes[i];\n // if((node as HTMLElement)?.classList?.contains('input-something')) {\n // smthIndex = i;\n // break;\n // }\n // }\n // return smthIndex;\n\n const elements = Array.from(something ?? input.querySelectorAll('.input-something'));\n const index = elements.findIndex((element) => compareNodes(element, 0, node, 0) >= 0);\n return index === -1 ? elements.length - 1 : Math.max(0, index - 1);\n }\n\n private superMove(\n input: HTMLElement,\n caret: ReturnType,\n toLeft: boolean,\n fromSelectionChange: boolean\n ) {\n const {node, offset, move} = caret;\n const something = input.querySelectorAll('.input-something');\n const smthIndex = this.findPreviousSmthIndex(input, node, something);\n const r = document.createRange();\n r[toLeft ? 'setEnd' : 'setStart'](node, offset);\n\n if(fromSelectionChange) {\n move(toLeft);\n }\n\n const c = this.getCaretPosN();\n if(c.node?.nodeValue === BOM && (!fromSelectionChange || node === this.lastNode)) {\n const idx = this.findPreviousSmthIndex(input, c.node, something);\n\n let moved = !fromSelectionChange;\n\n do {\n const c = this.getCaretPosN();\n const idxidx = this.findPreviousSmthIndex(input, c.node, something);\n r[toLeft ? 'setStart' : 'setEnd'](c.node, c.offset);\n const rangeString = r.toString();\n const onlyBOMs = !NOT_ONLY_BOMS_REG_EXP.test(rangeString);\n this.log('test cursor', rangeString, onlyBOMs, idx, idxidx);\n if(\n onlyBOMs &&\n c.node?.nodeValue === BOM &&\n idxidx === idx &&\n // (idxidx > 1 || c.offset) &&\n // (idxidx < (getFiller(c.node).parentElement.childNodes.length - 2) || c.offset < BOM.length)\n (idxidx || c.offset) &&\n (idxidx < (something.length - 1) || c.offset < BOM.length)\n ) {\n move(toLeft);\n moved = true;\n } else if(!moved) {\n break;\n } else {\n if((!this.getFiller(node as HTMLElement).classList.contains('input-filler-text') && idx !== smthIndex) || c.offset === BOM.length) {\n move(!toLeft);\n }\n\n break;\n }\n } while(true);\n }\n }\n\n private onSelectionChange = (e: Event) => {\n const {input} = this;\n if(!input) {\n this.setSelectionClassName(document.getSelection());\n return;\n }\n\n // return;\n\n // this.log('selectionchange', document.getSelection(), document.getSelection().rangeCount && document.getSelection().getRangeAt(0), getCaretPosN());\n // let {node, offset} = getCaretPos(this.messageInput);\n\n let caret = this.getCaretPosN();\n do {\n const {node, offset, selection, move} = caret;\n\n const nodeValue = node?.nodeValue;\n // if(!nodeValue?.includes(BOM)) {\n if(nodeValue !== BOM || !this.lastNode) {\n break;\n }\n\n // node = getFiller(node);\n\n // const childIndex = whichChild(getFiller(node), true);\n // let toLeft: boolean;\n // // if(node === lastNode) toLeft = lastOffset >= offset;\n // if(node === lastNode) toLeft = lastOffset > offset;\n // else {\n // // toLeft = whichChild(getFiller(lastNode)) > childIndex;\n // toLeft = (lastNode.nodeValue === BOM ? whichChild(getFiller(lastNode), true) : whichChild(findUpAsChild(lastNode as any, getFiller(node).parentElement), true)) > childIndex;\n // }\n\n const toLeft = compareNodes(node, offset, this.lastNode as ChildNode, this.lastOffset) < 0;\n\n // const childNodes = Array.from(node.parentElement.childNodes);\n // if(toLeft) {\n // for(let i = childIndex; i >= 0; --i) {\n // const sibling = childNodes[i];\n // const {textContent} = sibling;\n // for()\n // }\n // }\n\n // {\n // if(toLeft === undefined) {\n // return;\n // }\n\n // const selection = window.getSelection();\n // selection.modify(selection.isCollapsed ? 'move' : 'extend', toLeft ? 'backward' : 'forward', 'character');\n // return;\n // }\n\n // const parent = getFiller(node);\n if(toLeft !== undefined) {\n // let newNode = toLeft ? parent.previousSibling : parent.nextSibling;\n if(selection.isCollapsed) {\n this.superMove(input, caret, toLeft, true);\n\n // if(offset === BOM.length) {\n // newNode = toLeft ? newNode.nextSibling.nextSibling : parent.previousSibling.previousSibling;\n // }\n\n // setCaretAt(newNode);\n } else {\n selection.modify(selection.isCollapsed ? 'move' : 'extend', toLeft ? 'backward' : 'forward', 'character');\n // const range = selection.getRangeAt(0);\n\n // if(toLeft) {\n // newNode = parent.previousSibling.previousSibling.firstChild;\n // const value = newNode.nodeValue;\n // range.setStart(newNode, value?.length);\n // } else {\n // newNode = parent.nextSibling.nextSibling.firstChild;\n // range.setEnd(newNode, 0);\n // }\n }\n }\n\n this.log('selectionchange',\n node,\n offset,\n this.lastNode,\n this.lastOffset,\n node === this.lastNode,\n whichChild(this.getFiller(node)),\n whichChild(this.getFiller(this.lastNode)),\n toLeft,\n selection,\n document.getSelection(),\n document.getSelection().getRangeAt(0),\n node?.parentNode,\n this.lastNode?.parentNode\n );\n\n caret = this.getCaretPosN();\n this.lastNode = node;\n this.lastOffset = offset;\n\n break;\n\n // if(findPreviousSmthIndex(caret.node) !== smthIndex) {\n // break;\n // }\n } while(true);\n\n this.lastNode = this.lastOffset = undefined;\n\n // if(offset === BOM.length) {\n // setCaretAt(parent);\n // } else {\n // setCaretAt(parent.nextSibling);\n // }\n\n this.setSelectionClassName(caret.selection, input);\n };\n\n public restoreSavedRange(input: HTMLElement) {\n const range = this.getSavedRange(input);\n if(!range) {\n return false;\n }\n\n const selection = window.getSelection();\n selection.removeAllRanges();\n selection.addRange(range);\n\n return true;\n }\n\n public getSavedRange(input: HTMLElement) {\n return this.savedRanges.get(input);\n }\n\n public makeFocused(input: HTMLElement) {\n if(document.activeElement !== input && !this.restoreSavedRange(input)) {\n placeCaretAtEnd(input, false, false);\n }\n }\n\n private fixInsertedLineBreaks(input: HTMLElement) {\n input.querySelectorAll('br').forEach((br) => {\n br.classList.add('br-not-br');\n });\n }\n\n private fixBuggedCaret() {\n const selection = document.getSelection();\n const range = selection.getRangeAt(0);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n\n public onBeforeInput = (e: Pick) => {\n const {input, log} = this;\n if(!input) {\n return;\n }\n\n const addInputCallback = this.addInputCallback.bind(this, input);\n\n const caretPos = this.getCaretPosN();\n let {node, offset, selection, move} = caretPos;\n log('beforeinput', e, node, offset, selection, caretPos);\n this.lastNode = this.lastOffset = undefined;\n\n if(e.inputType.startsWith('delete')) { // delete current BOM\n addInputCallback(() => {\n this.processEmptiedFillers(input);\n this.removeExtraBOMs(input);\n this.fixInsertedLineBreaks(input);\n });\n\n if(node?.nodeValue === BOM && selection.isCollapsed && e.inputType.includes('deleteContent')) {\n const toLeft = e.inputType.includes('Backward');\n const moveFirst = (offset === BOM.length && toLeft) || (!offset && !toLeft);\n this.superMove(input, caretPos, toLeft, moveFirst);\n // if((offset === BOM.length && toLeft) || (!offset && !toLeft)) {\n // move(toLeft);\n // }\n\n // addInputCallback(() => {\n // removePossibleBOMSiblingsByNode(getFiller(node));\n // });\n\n // if(node.parentNode.childNodes.length === 1) {\n // (node.parentNode as HTMLElement).remove();\n // move(e.inputType.includes('Backward') ? false : true);\n // } else {\n // move(e.inputType.includes('Backward') ? true : false);\n // addInputCallback(() => {\n // move(e.inputType.includes('Backward') ? false : true);\n // });\n // }\n\n // for(let i = 0, length = BOM.length + (direction === 'backward' ? offset : BOM.length - offset); i < length; ++i) {\n // selection.modify('extend', direction, 'character');\n // }\n\n // selection.modify('extend', direction, 'character');\n // selection.modify('extend', direction, 'character');\n\n // selection.deleteFromDocument();\n // e.preventDefault();\n } else {\n // const filler = getFiller(node);\n // if(filler?.classList?.contains('input-filler-text')) {\n // const {previousSibling, nextSibling} = filler;\n // addInputCallback(() => {\n // if(!filler.isConnected) {\n // removePossibleBOMSiblings(previousSibling, nextSibling);\n // }\n // // removeExtraBOMs();\n // // processEmptiedFillers();\n // });\n // }\n // addInputCallback(() => {\n // this.fixInsertedLineBreaks(input);\n // });\n }\n } else if(e.inputType.startsWith('insert')) { // clear current BOM\n if((node as HTMLElement)?.classList?.contains('input-something')/* || (node.textContent === BOM && offset === BOM.length) */) {\n node = node.previousSibling.firstChild;\n const range = selection.getRangeAt(0);\n range.setStart(node, 0);\n range.setEnd(node, 0);\n range.collapse(true);\n // selection.modify('move', 'backward', 'character');\n\n const c = this.getCaretPosN();\n node = c.node;\n selection = c.selection;\n offset = c.offset;\n }\n if(node && node.textContent === BOM && offset === BOM.length) {\n // const range = selection.getRangeAt(0);\n // range.setStart(node, 0);\n // range.setEnd(node, 0);\n // range.collapse(true);\n selection.modify('move', 'backward', 'character');\n\n const c = this.getCaretPosN();\n node = c.node;\n selection = c.selection;\n offset = c.offset;\n }\n // if(node && node.textContent === BOM && offset === 0) {\n // selection.modify('move', 'forward', 'character');\n // offset = BOM.length;\n // }\n\n if(e.inputType === 'insertLineBreak' || true) {\n // const appendix = 'X';\n // const textNode = document.createTextNode(appendix);\n // if(node.parentElement !== this.messageInput) node.parentElement.after(textNode);\n // else node.after(textNode);\n // selection.modify('move', 'forward', 'character');\n // selection.modify('move', 'forward', 'character');\n // addInputCallback(() => {\n // textNode.remove();\n // });\n\n /* if(node?.nodeValue === BOM) */ {\n // const parent = node.parentElement;\n // parent.contentEditable = 'false';\n // addInputCallback(() => {\n // parent.contentEditable = 'inherit';\n // });\n // node.parentElement.remove();\n\n // const textNode = document.createTextNode(appendix);\n // if(node.parentElement !== this.messageInput) node.parentElement.after(textNode);\n // else node.after(textNode);\n // // selection.modify('move', 'forward', 'character');\n // // selection.modify('move', 'forward', 'character');\n // addInputCallback(() => {\n // textNode.remove();\n // });\n\n // fix case when focused somehow on span instead of text node\n if(node && node.nodeType === node.ELEMENT_NODE) {\n node = node.firstChild;\n log.warn('fixing focus on span');\n }\n\n const isBOM = node?.nodeValue === BOM;\n log('inserting line break', isBOM, node, `\"${node?.nodeValue}\"`, node?.parentElement ? Array.from(node.parentElement.childNodes).slice() : []);\n if(isBOM) {\n // (node as ChildNode).replaceWith(this.messageInput.querySelector('.lol'));\n\n const parentElement = node.parentElement;\n parentElement.classList.replace('input-filler', 'input-filler-text');\n const childNodesLength = parentElement.childNodes.length;\n addInputCallback(() => {\n const newChildNodesLength = parentElement.childNodes.length;\n if(newChildNodesLength > 1/* && newChildNodesLength !== childNodesLength */) {\n log('inserting line break, remove');\n node = Array.from(parentElement.childNodes).find((node) => node.nodeValue === BOM);\n (parentElement as any).t = node;\n // node?.remove();\n\n // const n = parentElement.firstChild;\n // const range = selection.getRangeAt(0);\n // range.setStart(n, n.nodeValue.length);\n // range.setEnd(n, n.nodeValue.length);\n } else if(node.nodeValue !== BOM) {\n log('inserting line break, deleteData');\n (node as CharacterData).deleteData(node.nodeValue.indexOf(BOM), BOM.length);\n // node = document.createTextNode(BOM);\n }\n\n this.fixInsertedLineBreaks(input);\n // (parentElement as any).t = node;\n // node.remove();\n });\n // addInputCallback(() => {\n // node.parentElement.classList.replace('input-filler', 'input-filler3');\n // const s = document.createElement('span');\n // s.style.display = 'none';\n // node.replaceWith(s);\n // s.prepend(node);\n // });\n } else if(e.inputType === 'insertLineBreak') {\n addInputCallback(() => {\n this.fixInsertedLineBreaks(input);\n });\n // const range = selection.getRangeAt(0);\n // this.messageInput.querySelectorAll('.input-something').forEach((el) => {\n // el.contentEditable = 'inherit';\n // });\n\n // addInputCallback(() => {\n // this.messageInput.querySelectorAll('.input-something').forEach((el) => {\n // el.contentEditable = 'false';\n // });\n\n // selection.removeAllRanges();\n // selection.addRange(range);\n // }, false);\n }/* else if(node &&\n node.nodeType === node.TEXT_NODE &&\n node.nodeValue.length === offset) {\n\n } */\n\n // if(e.inputType === 'insertLineBreak') {\n // e.preventDefault();\n // document.execCommand('insertHTML', false, '\\n');\n\n // this.messageInputField.simulateInputEvent();\n // }\n\n // node.parentElement.replaceWith(node);\n // selection.removeAllRanges();\n // const range = new Range();\n // range.setStart(node, 0);\n // range.setEnd(node, node.nodeValue.length);\n // selection.addRange(range);\n // node.parentElement.classList.remove('input-filler');\n // node.parentElement\n }\n\n // document.execCommand('insertHTML', false, '\\n');\n // e.preventDefault();\n // (node as CharacterData).deleteData(node.nodeValue.indexOf(BOM), BOM.length);\n // if(node?.nodeValue === BOM) {\n // addInputCallback(() => {\n // node.remove();\n // });\n // }\n // this.messageInputField.simulateInputEvent();\n\n // this.messageInput.querySelectorAll('.input-something').forEach((el) => {\n // el.contentEditable = 'inherit';\n // });\n // addInputCallback(() => {\n // this.messageInput.querySelectorAll('.input-something').forEach((el) => {\n // el.contentEditable = 'false';\n // });\n // });\n return;\n }\n\n if(node?.nodeValue === BOM) {\n // node.nodeValue = ''; // ! will move cursor forward\n // addInputCallback(() => {\n // (node as CharacterData).deleteData(node.nodeValue.indexOf(BOM), BOM.length);\n // });\n\n if(e.inputType === 'insertLineBreak') {\n if(offset === BOM.length) {\n selection.modify('move', 'backward', 'character');\n }\n\n // if(offset !== BOM.length) {\n // selection.modify('move', 'forward', 'character');\n // }\n\n addInputCallback(() => {\n node.remove();\n // (node as CharacterData).deleteData(node.nodeValue.indexOf(BOM), BOM.length);\n // selection.modify('move', 'forward', 'character');\n\n setTimeout(() => {\n selection.modify('move', 'forward', 'character');\n }, 0);\n });\n }\n\n // node.parentElement.replaceWith(node);\n\n // node.parentElement.replaceWith(node);\n if(e.inputType === 'insertLineBreak') {\n // const previousParentSibling = node.parentNode.previousSibling;\n // addInputCallback(() => {\n // if(previousParentSibling.nextSibling.nodeValue === '\\n') {\n // previousParentSibling.nextSibling.remove();\n\n // setTimeout(() => {\n // // selection.modify('move', 'forward', 'character');\n // // selection.modify('move', 'forward', 'character');\n // }, 0);\n // } else {\n // previousParentSibling.nextSibling.nodeValue = previousParentSibling.nextSibling.nodeValue.replace('\\n\\n', '\\n');\n // }\n // });\n } else {\n // if(node.parentElement !== this.messageInput) {\n // node.parentElement.replaceWith(node);\n // }\n\n // setTimeout(() => {\n // this.log(JSON.stringify(node.parentElement.innerHTML));\n // node.nodeValue = node.nodeValue.replace(BOM, '');\n // // (node as CharacterData).deleteData(node.nodeValue.indexOf(BOM), BOM.length);\n // this.log(JSON.stringify(node.parentElement.innerHTML));\n // }, 1000);\n\n addInputCallback(() => {\n (node as CharacterData).deleteData(node.nodeValue.indexOf(BOM), BOM.length);\n if(!node.nodeValue) {\n node.remove();\n }\n\n // selection.modify('move', 'forward', 'character');\n });\n }\n\n if(selection.isCollapsed && false) {\n node.parentElement.replaceWith(node);\n // const textNode = document.createTextNode(BOM);\n // (node.parentNode as any as ChildNode).after(textNode);\n // setCaretAt(textNode.nextSibling);\n // selection.modify('move', 'forward', 'character');\n node.remove();\n // (node as CharacterData).deleteData(node.nodeValue.indexOf(BOM), BOM.length);\n // selection.modify('move', 'forward', 'character');\n // selection.collapseToEnd();\n\n // addInputCallback(() => {\n // (textNode as CharacterData).deleteData(textNode.nodeValue.indexOf(BOM), BOM.length);\n // node.parentElement.remove();\n // });\n }\n } else if(e.inputType === 'insertLineBreak' &&\n node &&\n node.nodeType === node.TEXT_NODE &&\n node.nodeValue.length === offset) {\n log('inserting line break');\n // const appendix = '\\x01';\n\n input.querySelectorAll('.input-something').forEach((el) => {\n el.contentEditable = 'inherit';\n });\n addInputCallback(() => {\n input.querySelectorAll('.input-something').forEach((el) => {\n el.contentEditable = 'false';\n });\n });\n\n // const textNode = document.createTextNode(appendix);\n // if(node.parentElement !== this.messageInput) node.parentElement.after(textNode);\n // else node.after(textNode);\n // // selection.modify('move', 'forward', 'character');\n // addInputCallback(() => {\n // textNode.remove();\n // });\n\n // const offset = node.nodeValue.length;\n // (node as CharacterData).insertData(offset, appendix);\n // addInputCallback(() => {\n // selection.modify('move', 'forward', 'character');\n // (node as CharacterData).deleteData(node.nodeValue.indexOf(appendix), appendix.length);\n // if(!node.nodeValue) {\n // node.remove();\n // }\n // });\n }\n } else if(e.inputType === 'historyUndo') { // have to remove extra BOMs\n addInputCallback(() => {\n this.processFilledFillers(input);\n this.processEmptiedFillers(input);\n this.removeExtraBOMs(input);\n this.removeEmptyTextNodes(input);\n\n // ! lol what, caret will be at the wrong position, have to set it to the same\n this.fixBuggedCaret();\n\n // lol\n // this.messageInput.querySelectorAll('.has-text').forEach((el) => {\n // if(el.textContent === BOM) {\n // el.firstElementChild.replaceWith(el.firstElementChild.firstChild);\n // el.classList.replace('input-filler3', 'input-filler');\n // }\n // });\n });\n } else if(e.inputType === 'historyRedo') {\n // if(node?.nodeValue === BOM && offset === BOM.length) {\n // selection.modify('move', 'backward', 'character');\n // }\n\n addInputCallback(() => {\n this.processFilledFillers(input);\n this.processEmptiedFillers(input);\n\n // fix contenteditable attribute\n input.querySelectorAll('.input-something:not([contenteditable])').forEach((el) => {\n el.contentEditable = 'false';\n });\n\n this.removeExtraBOMs(input);\n\n // ! lol what, caret will be at the wrong position, have to set it to the same\n this.fixBuggedCaret();\n });\n }\n };\n\n private onKeyDown = (e: KeyboardEvent) => {\n const key = e.key;\n\n // // have to ignore line up and down\n if(key === 'ArrowDown' || key === 'ArrowUp') {\n this.lastNode = this.lastOffset = undefined;\n } else {\n const {node, offset} = this.getCaretPosN();\n this.lastNode = node/* getFiller(node) */, this.lastOffset = offset;\n if(this.lastNode === this.input) {\n this.lastNode = this.lastOffset = undefined;\n }\n }\n\n this.log('keydown', this.lastNode, this.lastNode?.parentNode, this.lastOffset, this.getCaretPosN(), e);\n };\n\n private addInputCallback(input: HTMLElement, callback: () => void, capture = true) {\n const newCallback = () => {\n this.log('input modify callback');\n callback();\n };\n\n if(capture && IS_FIREFOX) this.inputCaptureCallbacks.push(newCallback);\n else this.listenerSetter.add(input)('input', newCallback, {once: true, capture});\n }\n\n public removeExtraBOMs(input: HTMLElement) {\n const c = (sibling: ChildNode) => {\n return (sibling as HTMLElement)?.classList?.contains('input-something');\n };\n\n input.querySelectorAll('.input-filler').forEach((el) => {\n const {previousSibling, nextSibling} = el;\n let needed = false;\n\n // if(!(previousSibling as HTMLElement)?.classList?.contains('input-filler') && isCustomFillerNeededBySiblingNode(previousSibling)) {\n if(!(nextSibling as HTMLElement)?.classList?.contains('input-filler') && isCustomFillerNeededBySiblingNode(nextSibling)) {\n needed = c(previousSibling) || c(nextSibling);\n }\n\n if(!needed) {\n this.log.warn('removing empty bom node', el);\n el.remove();\n }\n });\n }\n\n private getFiller(node: Node) {\n return node && node.nodeType === node.TEXT_NODE && node.parentElement !== this.input ? node.parentElement : node as HTMLElement;\n }\n\n private getCaretPosN() {\n const ret = getCaretPosNew(this.input);\n // const {node} = ret;\n // if((node as HTMLElement)?.classList?.contains('input-something')) {\n // ret.node = node.previousSibling;\n // ret.offset = ret.node.textContent.length;\n // }\n\n return {...ret, move: this.move.bind(this, ret.selection)};\n }\n\n private removeEmptyTextNodes(input: HTMLElement) {\n const {log} = this;\n // let i = -1;\n // remove empty text nodes\n const treeWalker = document.createTreeWalker(\n input,\n NodeFilter.SHOW_TEXT,\n {acceptNode: (node) => node.parentElement === input && !node.nodeValue/* && !++i */ ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT}\n );\n\n let textNode: Text;\n while(textNode = treeWalker.nextNode() as Text) {\n log.warn('removing empty text node', textNode);\n textNode.remove();\n }\n }\n\n private removePossibleBOMSiblings(previousSibling: ChildNode, nextSibling: ChildNode) {\n [previousSibling, nextSibling].forEach((sibling) => {\n if((sibling as HTMLElement)?.classList?.contains('input-filler')) {\n sibling.remove();\n }\n });\n }\n\n private removePossibleBOMSiblingsByNode(node: ChildNode) {\n const {previousSibling, nextSibling} = node;\n this.removePossibleBOMSiblings(previousSibling, nextSibling);\n };\n\n private processEmptiedFillers(input: HTMLElement) {\n input.querySelectorAll('.input-filler-text').forEach((el) => {\n this.removeExtraBOMs(el);\n\n let cleanSiblings = true;\n if(!el.textContent) {\n el.classList.replace('input-filler-text', 'input-filler');\n\n const textNode = Array.from(el.childNodes).find((node) => node.nodeType === node.TEXT_NODE);\n if(textNode) {\n (textNode as CharacterData).insertData(0, BOM);\n } else if(((el as any).t as ChildNode)?.nodeValue) {\n el.append((el as any).t);\n } else {\n el.append(document.createTextNode(BOM));\n }\n } else if(!NOT_ONLY_BOMS_REG_EXP.test(el.textContent) && !el.querySelector('.input-something')) {\n el.classList.replace('input-filler-text', 'input-filler');\n } else {\n cleanSiblings = false;\n }\n\n if(cleanSiblings) {\n this.removePossibleBOMSiblingsByNode(el);\n }\n });\n }\n\n private processFilledFillers(input: HTMLElement) {\n // remove the BOM when changing to text\n input.querySelectorAll('.input-filler').forEach((el) => {\n if(el.textContent !== BOM) {\n el.classList.replace('input-filler', 'input-filler-text');\n const t = (el as any).t as ChildNode;\n const bomNode = Array.from(el.childNodes).find((node) => node.nodeType === node.TEXT_NODE && node.nodeValue.includes(BOM));\n if(bomNode && !t?.nodeValue) {\n const idx = bomNode.nodeValue.indexOf(BOM);\n if(idx !== -1) {\n (bomNode as CharacterData).deleteData(idx, BOM.length);\n }\n }\n\n // t?.remove();\n }\n });\n }\n\n private setSelectionClassName(selection: Selection, input?: HTMLElement) {\n // Array.from(this.messageInput.querySelectorAll('.selection')).forEach((element) => {\n // element.classList.remove('selection');\n // });\n\n if(selection.rangeCount) {\n const range = selection.getRangeAt(0);\n\n if(input) {\n Array.from(input.querySelectorAll('.input-selectable')).forEach((element) => {\n element.classList.toggle('selection', !range.collapsed && range.intersectsNode(element));\n });\n } else {\n Array.from(document.querySelectorAll('.input-selectable.selection')).forEach((element) => element.classList.remove('selection'));\n }\n }\n }\n\n private move(selection: Selection, left: boolean) {\n const {focusNode: focusNodeBefore, focusOffset: focusOffsetBefore} = selection;\n selection.modify('extend', left ? 'backward' : 'forward', 'character');\n // if(offset === nodeValue.length) {\n // selection.modify('extend', !left ? 'backward' : 'forward', 'character');\n // }\n if(left) selection.collapseToStart();\n else selection.collapseToEnd();\n const {focusNode: focusNodeAfter, focusOffset: focusOffsetAfter} = selection;\n this.log(\n 'moving cursor',\n left,\n focusNodeBefore,\n focusNodeBefore.nodeType === focusNodeBefore.ELEMENT_NODE ? focusNodeBefore : focusNodeBefore.parentElement,\n focusOffsetBefore,\n focusNodeAfter,\n focusNodeAfter.nodeType === focusNodeAfter.ELEMENT_NODE ? focusNodeAfter : focusNodeAfter.parentElement,\n focusOffsetAfter\n );\n }\n\n public prepareApplyingMarkdown() {\n const {input} = this;\n\n // do not wrap fillers into spans\n const fillers = input.querySelectorAll('.input-filler');\n // fillers.forEach((el) => {\n // el.contentEditable = 'false';\n // });\n\n const smths = input.querySelectorAll('.input-something');\n smths.forEach((el) => {\n el.contentEditable = 'inherit';\n });\n\n return () => {\n fillers.forEach((el) => {\n el.contentEditable = 'inherit';\n });\n\n smths.forEach((el) => {\n el.contentEditable = 'false';\n });\n\n this.removeExtraBOMs(input);\n };\n }\n\n public static getInstance() {\n return this.INSTANCE ??= new RichInputHandler();\n }\n}\n","import rootScope from '../../lib/rootScope';\nimport liteMode from '../liteMode';\n\nexport default function shake(element: HTMLElement) {\n if(!liteMode.isAvailable('animations')) {\n return;\n }\n\n const keyframes: Keyframe[] = [\n {transform: 'translateX(0)'},\n {transform: 'translateX(.25rem)'},\n {transform: 'translateX(-.25rem)'},\n {transform: 'translateX(0)'}\n ];\n\n element.animate([...keyframes, ...keyframes, ...keyframes], {\n duration: 300,\n iterations: 1,\n easing: 'ease-in-out'\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {ScrollableBase} from '../../components/scrollable';\nimport SwipeHandler from '../../components/swipeHandler';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport rootScope from '../../lib/rootScope';\nimport liteMode from '../liteMode';\nimport {Middleware} from '../middleware';\nimport clamp from '../number/clamp';\nimport safeAssign from '../object/safeAssign';\nimport pause from '../schedulers/pause';\nimport cancelEvent from './cancelEvent';\nimport {attachClickEvent} from './clickEvent';\nimport findUpAsChild from './findUpAsChild';\nimport positionElementByIndex from './positionElementByIndex';\nimport whichChild from './whichChild';\n\nexport default class Sortable {\n private element: HTMLElement;\n private elementRect: DOMRect;\n private containerRect: DOMRect;\n private scrollableRect: DOMRect;\n private minY: number;\n private maxY: number;\n private siblings: HTMLElement[];\n private swipeHandler: SwipeHandler;\n private startScrollPos: number;\n private addScrollPos: number;\n\n private list: HTMLElement;\n private middleware: Middleware;\n private onSort: (prevIdx: number, newIdx: number) => void;\n private scrollable: ScrollableBase;\n\n constructor(options: {\n list: HTMLElement,\n middleware: Middleware,\n onSort: Sortable['onSort'],\n scrollable?: Sortable['scrollable']\n }) {\n safeAssign(this, options);\n\n this.swipeHandler = new SwipeHandler({\n element: this.list,\n onSwipe: this.onSwipe,\n verifyTouchTarget: this.verifyTouchTarget,\n onStart: this.onStart,\n onReset: this.onReset,\n setCursorTo: document.body,\n middleware: this.middleware,\n withDelay: true\n });\n }\n\n private onSwipe = (xDiff: number, yDiff: number) => {\n yDiff = clamp(yDiff, this.minY, this.maxY);\n this.element.style.transform = `translateY(${yDiff}px)`;\n const count = Math.round(Math.abs(yDiff) / this.elementRect.height);\n const lastSiblings = this.siblings;\n this.siblings = [];\n const property = yDiff < 0 ? 'previousElementSibling' : 'nextElementSibling';\n let sibling = this.element[property] as HTMLElement;\n for(let i = 0; i < count; ++i) {\n if(this.getSortableTarget(sibling)) {\n this.siblings.push(sibling);\n sibling = sibling[property] as HTMLElement;\n } else {\n break;\n }\n }\n\n (lastSiblings || []).forEach((sibling) => {\n if(!this.siblings.includes(sibling)) {\n sibling.style.transform = '';\n }\n });\n\n this.siblings.forEach((sibling) => {\n const y = this.elementRect.height * (yDiff < 0 ? 1 : -1);\n sibling.style.transform = `translateY(${y}px)`;\n });\n\n if(this.scrollableRect) {\n const diff = yDiff;\n const toEnd = diff > 0;\n const elementEndPos = toEnd ? this.elementRect.bottom : this.elementRect.top;\n const clientY = elementEndPos + diff - this.addScrollPos;\n // console.log(clientY, this.scrollableRect.top, elementEndPos, diff, this.addScrollPos, toEnd);\n let change = 2;\n if((clientY + (toEnd ? 0 : this.elementRect.height)) >= this.scrollableRect.bottom/* && diff < this.maxY */) {\n\n } else if((clientY - (toEnd ? this.elementRect.height : 0)) <= this.scrollableRect.top/* && diff > this.minY */) {\n change *= -1;\n } else {\n change = undefined;\n }\n\n if(change !== undefined) {\n this.scrollable.container[this.scrollable.scrollProperty] += change;\n }\n }\n };\n\n private verifyTouchTarget = (e: {target: EventTarget}) => {\n if(this.list.classList.contains('is-reordering')) {\n return false;\n }\n\n this.element = this.getSortableTarget(e.target as HTMLElement);\n return !!this.element/* && pause(150).then(() => true) */;\n };\n\n private onScroll = () => {\n const scrollPos = this.scrollable.container[this.scrollable.scrollProperty];\n const diff = this.addScrollPos = scrollPos - this.startScrollPos;\n const isVertical = this.scrollable.scrollProperty === 'scrollTop';\n this.swipeHandler.add(isVertical ? 0 : diff, isVertical ? diff : 0);\n };\n\n private onStart = () => {\n this.list.classList.add('is-reordering');\n this.element.classList.add('is-dragging', 'no-transition');\n this.swipeHandler.setCursor('grabbing');\n this.elementRect = this.element.getBoundingClientRect();\n this.containerRect = this.list.getBoundingClientRect();\n\n this.minY = this.containerRect.top - this.elementRect.top;\n this.maxY = this.containerRect.bottom - this.elementRect.bottom;\n this.addScrollPos = 0;\n\n if(this.scrollable) {\n this.startScrollPos = this.scrollable.container[this.scrollable.scrollProperty];\n this.scrollableRect = this.scrollable.container.getBoundingClientRect();\n this.scrollable.container.addEventListener('scroll', this.onScroll);\n }\n };\n\n private onReset = async() => {\n const length = this.siblings.length;\n const move = length && length * (this.siblings[0].previousElementSibling === this.element ? 1 : -1);\n const idx = whichChild(this.element);\n const newIdx = idx + move;\n\n this.element.classList.remove('no-transition');\n this.element.style.transform = move ? `translateY(${move * this.elementRect.height}px)` : '';\n this.swipeHandler.setCursor('');\n\n if(this.scrollable) {\n this.scrollable.container.removeEventListener('scroll', this.onScroll);\n }\n\n if(!IS_TOUCH_SUPPORTED) {\n attachClickEvent(document.body, cancelEvent, {capture: true, once: true});\n }\n\n if(liteMode.isAvailable('animations')) {\n await pause(250);\n }\n\n this.list.classList.remove('is-reordering');\n this.element.classList.remove('is-dragging');\n positionElementByIndex(this.element, this.list, newIdx, idx);\n [this.element, ...this.siblings].forEach((element) => {\n element.style.transform = '';\n });\n\n this.element =\n this.siblings =\n this.elementRect =\n this.containerRect =\n this.minY =\n this.maxY =\n this.startScrollPos =\n this.addScrollPos =\n undefined;\n\n // cancelClick = true;\n\n if(!move) {\n return;\n }\n\n this.onSort(idx, newIdx);\n };\n\n private getSortableTarget(target: HTMLElement) {\n if(!target) {\n return;\n }\n\n let child = findUpAsChild(target as HTMLElement, this.list);\n if(child && child.classList.contains('cant-sort')) {\n child = undefined;\n }\n\n return child;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function toggleDisability(elements: HTMLElement[], disable: boolean): () => void {\n if(disable) {\n elements.forEach((el) => el.setAttribute('disabled', 'true'));\n } else {\n elements.forEach((el) => el.removeAttribute('disabled'));\n }\n\n return () => toggleDisability(elements, !disable);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function whichChild(elem: Node, countNonElements?: boolean) {\n if(!elem.parentNode) {\n return -1;\n }\n\n if(countNonElements) {\n return Array.from(elem.parentNode.childNodes).indexOf(elem as ChildNode);\n }\n\n let i = 0;\n // @ts-ignore\n while((elem = elem.previousElementSibling) !== null) ++i;\n return i;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from './dom/clickEvent';\nimport findUpAsChild from './dom/findUpAsChild';\nimport EventListenerBase from './eventListenerBase';\nimport ListenerSetter from './listenerSetter';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport safeAssign from './object/safeAssign';\nimport appNavigationController, {NavigationItem} from '../components/appNavigationController';\nimport findUpClassName from './dom/findUpClassName';\nimport rootScope from '../lib/rootScope';\nimport liteMode from './liteMode';\n\nconst KEEP_OPEN = false;\nconst TOGGLE_TIMEOUT = 200;\nconst ANIMATION_DURATION = 200;\n\nexport type IgnoreMouseOutType = 'click' | 'menu' | 'popup';\ntype DropdownHoverTimeoutType = 'toggle' | 'done';\n\nexport default class DropdownHover extends EventListenerBase<{\n open: () => Promise | void,\n openAfterLayout: () => void,\n opened: () => any,\n close: () => any,\n closed: () => any\n}> {\n protected element: HTMLElement;\n protected forceClose: boolean;\n protected inited: boolean;\n protected ignoreMouseOut: Set;\n protected ignoreButtons: Set;\n protected navigationItem: NavigationItem;\n protected ignoreOutClickClassName: string;\n protected timeouts: {[type in DropdownHoverTimeoutType]?: number};\n protected detachClickEvent: () => void;\n\n constructor(options: {\n element: DropdownHover['element'],\n ignoreOutClickClassName?: string\n }) {\n super(false);\n safeAssign(this, options);\n this.forceClose = false;\n this.inited = false;\n this.ignoreMouseOut = new Set();\n this.ignoreButtons = new Set();\n this.timeouts = {};\n }\n\n public attachButtonListener(\n button: HTMLElement,\n listenerSetter: ListenerSetter\n ) {\n let firstTime = true;\n if(IS_TOUCH_SUPPORTED) {\n attachClickEvent(button, () => {\n if(firstTime) {\n firstTime = false;\n this.toggle(true);\n } else {\n this.toggle();\n }\n }, {listenerSetter});\n } else {\n listenerSetter.add(button)('mouseover', (e) => {\n if(firstTime) {\n listenerSetter.add(button)('mouseout', (e) => {\n this.clearTimeout('toggle');\n this.onMouseOut(e);\n });\n firstTime = false;\n }\n\n this.setTimeout('toggle', () => {\n this.toggle(true);\n }, TOGGLE_TIMEOUT);\n });\n\n attachClickEvent(button, () => {\n const type: IgnoreMouseOutType = 'click';\n const ignore = !this.ignoreMouseOut.has(type);\n\n if(ignore && !this.ignoreMouseOut.size) {\n this.ignoreButtons.add(button);\n setTimeout(() => {\n this.detachClickEvent = attachClickEvent(window, this.onClickOut, {capture: true});\n }, 0);\n }\n\n this.setIgnoreMouseOut(type, ignore);\n this.toggle(ignore);\n }, {listenerSetter});\n }\n }\n\n protected onClickOut = (e: MouseEvent) => {\n const target = e.target as HTMLElement;\n if(\n !findUpAsChild(target, this.element) &&\n !Array.from(this.ignoreButtons).some((button) => findUpAsChild(target, button) || target === button) &&\n this.ignoreMouseOut.size <= 1 &&\n (!this.ignoreOutClickClassName || !findUpClassName(target, this.ignoreOutClickClassName))\n ) {\n this.toggle(false);\n }\n };\n\n protected onMouseOut = (e: MouseEvent) => {\n if(KEEP_OPEN || !this.isActive()) return;\n this.clearTimeout('toggle');\n\n if(this.ignoreMouseOut.size) {\n return;\n }\n\n const toElement = (e as any).toElement as HTMLElement;\n if(toElement && findUpAsChild(toElement, this.element)) {\n return;\n }\n\n this.setTimeout('toggle', () => {\n this.toggle(false);\n }, TOGGLE_TIMEOUT);\n };\n\n protected clearTimeout(type: DropdownHoverTimeoutType) {\n if(this.timeouts[type] !== undefined) {\n clearTimeout(this.timeouts[type]);\n delete this.timeouts[type];\n }\n }\n\n protected setTimeout(type: DropdownHoverTimeoutType, cb: () => void, timeout: number) {\n this.clearTimeout(type);\n this.timeouts[type] = window.setTimeout(() => {\n this.clearTimeout(type);\n cb();\n }, timeout);\n }\n\n public init() {\n if(!IS_TOUCH_SUPPORTED) {\n this.element.onmouseout = this.onMouseOut;\n this.element.onmouseover = (e) => {\n if(this.forceClose) {\n return;\n }\n\n // console.log('onmouseover element');\n this.clearTimeout('toggle');\n };\n }\n }\n\n public toggle = async(enable?: boolean) => {\n // if(!this.element) return;\n const willBeActive = (!!this.element.style.display && enable === undefined) || enable;\n if(this.init) {\n if(willBeActive) {\n this.init();\n this.init = null;\n } else {\n return;\n }\n }\n\n if(willBeActive === this.isActive()) {\n return;\n }\n\n const delay = IS_TOUCH_SUPPORTED || !liteMode.isAvailable('animations') ? 0 : ANIMATION_DURATION;\n if((this.element.style.display && enable === undefined) || enable) {\n const res = this.dispatchResultableEvent('open');\n await Promise.all(res);\n\n this.element.style.display = '';\n void this.element.offsetLeft; // reflow\n this.element.classList.add('active');\n\n this.dispatchEvent('openAfterLayout');\n\n appNavigationController.pushItem(this.navigationItem = {\n type: 'dropdown',\n onPop: () => {\n this.toggle(false);\n }\n });\n\n this.clearTimeout('toggle');\n this.setTimeout('done', () => {\n this.forceClose = false;\n this.dispatchEvent('opened');\n }, delay);\n\n // ! can't use together with resizeObserver\n /* if(isTouchSupported) {\n const height = this.element.scrollHeight + appImManager.chat.input.inputContainer.scrollHeight - 10;\n console.log('[ESG]: toggle: enable height', height);\n appImManager.chat.bubbles.scrollable.scrollTop += height;\n } */\n\n /* if(touchSupport) {\n this.restoreScroll();\n } */\n } else {\n this.dispatchEvent('close');\n this.ignoreMouseOut.clear();\n this.ignoreButtons.clear();\n\n this.element.classList.remove('active');\n\n appNavigationController.removeItem(this.navigationItem);\n this.detachClickEvent?.();\n this.detachClickEvent = undefined;\n\n this.clearTimeout('toggle');\n this.setTimeout('done', () => {\n this.element.style.display = 'none';\n this.forceClose = false;\n this.dispatchEvent('closed');\n }, delay);\n\n /* if(isTouchSupported) {\n const scrollHeight = this.container.scrollHeight;\n if(scrollHeight) {\n const height = this.container.scrollHeight + appImManager.chat.input.inputContainer.scrollHeight - 10;\n appImManager.chat.bubbles.scrollable.scrollTop -= height;\n }\n } */\n\n /* if(touchSupport) {\n this.restoreScroll();\n } */\n }\n\n // animationIntersector.checkAnimations(false, EMOTICONSSTICKERGROUP);\n };\n\n public isActive() {\n return this.element.classList.contains('active');\n }\n\n public setIgnoreMouseOut(type: IgnoreMouseOutType, ignore: boolean) {\n ignore ? this.ignoreMouseOut.add(type) : this.ignoreMouseOut.delete(type);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// * Jolly Cobra's fastSmoothScroll slightly patched\n\nimport {dispatchHeavyAnimationEvent} from '../hooks/useHeavyAnimationCheck';\nimport {fastRafPromise} from './schedulers';\nimport {animateSingle, cancelAnimationByKey} from './animation';\nimport rootScope from '../lib/rootScope';\nimport isInDOM from './dom/isInDOM';\nimport liteMode from './liteMode';\n\nconst MIN_JS_DURATION = 250;\nconst MAX_JS_DURATION = 600;\nconst LONG_TRANSITION_MAX_DISTANCE = 1500;\nconst SHORT_TRANSITION_MAX_DISTANCE = 500;\n\nexport enum FocusDirection {\n Up,\n Down,\n Static,\n};\n\nexport type ScrollGetNormalSizeCallback = (options: {rect: DOMRect}) => number;\nexport type ScrollGetElementPositionCallback = (options: {elementRect: DOMRect, containerRect: DOMRect, elementPosition: number}) => number;\nexport type ScrollStartCallbackDimensions = {\n scrollSize: number,\n scrollPosition: number,\n distanceToEnd: number,\n path: number,\n duration: number,\n containerRect: DOMRect,\n elementRect: DOMRect,\n getProgress: () => number\n};\n\nexport type ScrollOptions = {\n container: HTMLElement,\n element: HTMLElement,\n position: ScrollLogicalPosition,\n margin?: number,\n maxDistance?: number,\n forceDirection?: FocusDirection,\n forceDuration?: number,\n axis?: 'x' | 'y',\n getNormalSize?: ScrollGetNormalSizeCallback,\n getElementPosition?: ScrollGetElementPositionCallback,\n fallbackToElementStartWhenCentering?: HTMLElement,\n startCallback?: (dimensions: ScrollStartCallbackDimensions) => void,\n transitionFunction?: (value: number) => number\n};\n\nexport default function fastSmoothScroll(options: ScrollOptions) {\n options.margin ??= 0;\n options.maxDistance ??= LONG_TRANSITION_MAX_DISTANCE;\n options.axis ??= 'y';\n // return;\n\n if(!liteMode.isAvailable('animations') || options.forceDuration === 0) {\n options.forceDirection = FocusDirection.Static;\n }\n\n if(options.forceDirection === FocusDirection.Static) {\n options.forceDuration = 0;\n return scrollWithJs(options);\n /* return Promise.resolve();\n\n element.scrollIntoView({ block: position });\n\n cancelAnimationByKey(container);\n return Promise.resolve(); */\n }\n\n const promise = fastRafPromise().then(() => scrollWithJs(options));\n\n return options.axis === 'y' ? dispatchHeavyAnimationEvent(promise) : promise;\n}\n\nfunction scrollWithJs(options: ScrollOptions): Promise {\n const {element, container, getNormalSize, getElementPosition, transitionFunction, axis, margin, position, forceDirection, maxDistance, forceDuration} = options;\n if(!isInDOM(element)) {\n cancelAnimationByKey(container);\n return Promise.resolve();\n }\n\n const rectStartKey = axis === 'y' ? 'top' : 'left';\n const rectEndKey = axis === 'y' ? 'bottom' : 'right';\n const sizeKey = axis === 'y' ? 'height' : 'width';\n const scrollSizeKey = axis === 'y' ? 'scrollHeight' : 'scrollWidth';\n const elementScrollSizeKey = axis === 'y' ? 'scrollHeight' : 'offsetWidth'; // can use offsetWidth for X, since it's almost same as scrollWidth\n const scrollPositionKey = axis === 'y' ? 'scrollTop' : 'scrollLeft';\n\n // const { offsetTop: elementTop, offsetHeight: elementHeight } = element;\n const elementRect = element.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect ? container.getBoundingClientRect() : document.body.getBoundingClientRect();\n\n // const transformable = container.firstElementChild as HTMLElement;\n\n const possibleElementPosition = elementRect[rectStartKey] - containerRect[rectStartKey];\n const elementPosition = getElementPosition ? getElementPosition({elementRect, containerRect, elementPosition: possibleElementPosition}) : possibleElementPosition;\n const elementSize = element[elementScrollSizeKey]; // margin is exclusive in DOMRect\n\n const containerSize = getNormalSize ? getNormalSize({rect: containerRect}) : containerRect[sizeKey];\n\n let scrollPosition = container[scrollPositionKey];\n const scrollSize = container[scrollSizeKey];\n /* const elementPosition = element.offsetTop;\n const elementSize = element.offsetHeight;\n\n const scrollPosition = container[scrollPositionKey];\n const scrollSize = container[scrollSizeKey];\n const containerSize = container.offsetHeight; */\n\n let path!: number;\n\n switch(position) {\n case 'start':\n path = elementPosition - margin;\n break;\n case 'end':\n path = elementRect[rectEndKey] /* + (elementSize - elementRect[sizeKey]) */ - containerRect[rectEndKey] + margin;\n break;\n // 'nearest' is not supported yet\n case 'nearest':\n case 'center':\n if(elementSize < containerSize) {\n path = (elementPosition + elementSize / 2) - (containerSize / 2);\n } else {\n if(options.fallbackToElementStartWhenCentering && options.fallbackToElementStartWhenCentering !== element) {\n options.element = options.fallbackToElementStartWhenCentering;\n options.position = 'start';\n return scrollWithJs(options);\n }\n\n path = elementPosition - margin;\n }\n\n break;\n }\n /* switch (position) {\n case 'start':\n path = (elementPosition - margin) - scrollPosition;\n break;\n case 'end':\n path = (elementPosition + elementSize + margin) - (scrollPosition + containerSize);\n break;\n // 'nearest' is not supported yet\n case 'nearest':\n case 'center':\n path = elementSize < containerSize\n ? (elementPosition + elementSize / 2) - (scrollPosition + containerSize / 2)\n : (elementPosition - margin) - scrollPosition;\n break;\n } */\n\n if(Math.abs(path - (margin || 0)) < 1) {\n cancelAnimationByKey(container);\n return Promise.resolve();\n }\n\n if(axis === 'y') {\n if(forceDirection === undefined) {\n if(path > maxDistance) {\n scrollPosition = container.scrollTop += path - maxDistance;\n path = maxDistance;\n } else if(path < -maxDistance) {\n scrollPosition = container.scrollTop += path + maxDistance;\n path = -maxDistance;\n }\n }/* else if(forceDirection === FocusDirection.Up) { // * not tested yet\n container.scrollTop = offsetTop + container.scrollTop + maxDistance;\n } else if(forceDirection === FocusDirection.Down) { // * not tested yet\n container.scrollTop = Math.max(0, offsetTop + container.scrollTop - maxDistance);\n } */\n }\n\n // console.log('scrollWithJs: will scroll path:', path, element);\n\n /* let existsTransform = 0;\n const currentTransform = transformable.style.transform;\n if(currentTransform) {\n existsTransform = parseInt(currentTransform.match(/\\((.+?), (.+?), .+\\)/)[2]);\n //path += existsTransform;\n } */\n\n if(path < 0) {\n const remainingPath = -scrollPosition;\n path = Math.max(path, remainingPath);\n } else if(path > 0) {\n const remainingPath = scrollSize - (scrollPosition + containerSize);\n path = Math.min(path, remainingPath);\n }\n\n const target = container[scrollPositionKey] + path;\n const absPath = Math.abs(path);\n const duration = forceDuration ?? (\n MIN_JS_DURATION + (absPath / LONG_TRANSITION_MAX_DISTANCE) * (MAX_JS_DURATION - MIN_JS_DURATION)\n );\n const startAt = Date.now();\n\n /* transformable.classList.add('no-transition');\n\n const tickTransform = () => {\n const t = duration ? Math.min((Date.now() - startAt) / duration, 1) : 1;\n const currentPath = path * transition(t);\n\n transformable.style.transform = `translate3d(0, ${-currentPath}px, 0)`;\n container.dataset.translate = '' + -currentPath;\n\n const willContinue = t < 1;\n if(!willContinue) {\n fastRaf(() => {\n delete container.dataset.transform;\n container.dataset.transform = '';\n transformable.style.transform = '';\n void transformable.offsetLeft; // reflow\n transformable.classList.remove('no-transition');\n void transformable.offsetLeft; // reflow\n container[scrollPositionKey] = Math.round(target);\n });\n }\n\n return willContinue;\n };\n\n return animateSingle(tickTransform, container); */\n\n /* return new Promise((resolve) => {\n fastRaf(() => {\n transformable.style.transform = '';\n transformable.style.transition = '';\n\n setTimeout(resolve, duration);\n });\n });\n\n const transformableHeight = transformable.scrollHeight;\n //transformable.style.minHeight = `${transformableHeight}px`;\n */\n\n const transition = transitionFunction ?? (absPath < SHORT_TRANSITION_MAX_DISTANCE ? shortTransition : longTransition);\n const getProgress = () => duration ? Math.min((Date.now() - startAt) / duration, 1) : 1;\n const tick = () => {\n const t = getProgress();\n const value = transition(t);\n const currentPath = path * (1 - value);\n container[scrollPositionKey] = Math.round(target - currentPath);\n\n return t < 1;\n };\n\n if(!duration || !path) {\n cancelAnimationByKey(container);\n tick();\n return Promise.resolve();\n }\n\n /* return new Promise((resolve) => {\n setTimeout(resolve, duration);\n }).then(() => {\n transformable.classList.add('no-transition');\n void transformable.offsetLeft; // reflow\n transformable.style.transform = '';\n transformable.style.transition = '';\n void transformable.offsetLeft; // reflow\n transformable.classList.remove('no-transition');\n void transformable.offsetLeft; // reflow\n fastRaf(() => {\n\n container[scrollPositionKey] = Math.round(target);\n //transformable.style.minHeight = ``;\n });\n\n }); */\n\n if(options.startCallback) {\n const distanceToEnd = scrollSize - Math.round(target + container[axis === 'y' ? 'offsetHeight' : 'offsetWidth']);\n options.startCallback({\n scrollSize,\n scrollPosition,\n distanceToEnd,\n path,\n duration,\n containerRect,\n elementRect,\n getProgress\n });\n }\n\n return animateSingle(tick, container);\n}\n\nfunction longTransition(t: number) {\n return 1 - ((1 - t) ** 5);\n}\n\nfunction shortTransition(t: number) {\n return 1 - ((1 - t) ** 3.5);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {InputFileLocation, InputStickerSet, InputWebFileLocation} from '../layer';\nimport type {DownloadOptions} from '../lib/mtproto/apiFileManager';\n\nconst FILENAME_JOINER = '_';\n\nexport function getFileNameByLocation(location: InputFileLocation | InputWebFileLocation, options?: Partial<{\n fileName: string,\n downloadId: string\n}>) {\n const fileName = '';// (options?.fileName || '').split('.');\n const ext = fileName[fileName.length - 1] || '';\n\n let str: string;\n switch(location._) {\n case 'inputPhotoFileLocation': {\n str = ['photo', fileName[0], location.id, location.thumb_size].filter(Boolean).join(FILENAME_JOINER);\n break;\n }\n\n case 'inputDocumentFileLocation': {\n str = ['document', fileName[0], location.id, location.thumb_size].filter(Boolean).join(FILENAME_JOINER);\n break;\n }\n\n case 'inputPeerPhotoFileLocation':\n str = ['peerPhoto', location.photo_id, location.pFlags.big ? 'big' : 'small'].join(FILENAME_JOINER);\n break;\n\n case 'inputStickerSetThumb': {\n const id = (location.stickerset as InputStickerSet.inputStickerSetID).id ||\n (location.stickerset as InputStickerSet.inputStickerSetShortName).short_name ||\n (location.stickerset as InputStickerSet.inputStickerSetDice).emoticon ||\n location.stickerset._;\n str = ['stickerSetThumb', id, location.thumb_version].join(FILENAME_JOINER);\n break;\n }\n\n case 'inputFileLocation': {\n str = [location.volume_id, location.local_id].join(FILENAME_JOINER);\n break;\n }\n\n case 'inputWebFileLocation': {\n str = ['webFile', location.url].join(FILENAME_JOINER);\n break;\n }\n\n default: {\n console.error('Unrecognized location:', location);\n str = '';\n break;\n }\n }\n\n return str + (options?.downloadId ? '_download' : '') + (ext ? '.' + ext : ext);\n}\n\nexport type FileURLType = 'photo' | 'thumb' | 'document' | 'stream' | 'download';\nexport function getFileURL(type: FileURLType, options: DownloadOptions) {\n // console.log('getFileURL', location);\n // const perf = performance.now();\n const encoded = encodeURIComponent(JSON.stringify(options));\n // console.log('getFileURL encode:', performance.now() - perf, encoded);\n\n return /* '/' + */type + '/' + encoded;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Message, MessageAction} from '../layer';\nimport type {MyMessage} from '../lib/appManagers/appMessagesManager';\nimport forEachReverse from './array/forEachReverse';\n\nexport default function filterChatPhotosMessages(value: {\n count: number;\n next_rate: number;\n offset_id_offset: number;\n history: MyMessage[];\n}) {\n forEachReverse(value.history, (message, idx, arr) => {\n if(!((message as Message.messageService).action as MessageAction.messageActionChatEditPhoto).photo) {\n arr.splice(idx, 1);\n if(value.count !== undefined) {\n --value.count;\n }\n }\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {i18n, LangPackKey} from '../lib/langPack';\n\nexport default function formatBytes(bytes: number, decimals: number | 'auto' = 'auto') {\n if(bytes === 0) return i18n('FileSize.B', [0]);\n\n const strictDecimals = decimals === 'auto';\n\n const k = 1024;\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n const _decimals = decimals === 'auto' ? Math.max(0, i - 1) : decimals;\n\n const dm = Math.max(0, _decimals);\n const sizes: LangPackKey[] = ['FileSize.B', 'FileSize.KB', 'FileSize.MB', 'FileSize.GB'];\n\n const fixed = (bytes / Math.pow(k, i)).toFixed(dm);\n return i18n(sizes[i], [strictDecimals ? fixed : parseFloat(fixed)]);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport I18n, {i18n, join, LangPackKey} from '../lib/langPack';\nimport formatDuration, {DurationType} from './formatDuration';\n\nconst CALL_DURATION_LANG_KEYS: {[type in DurationType]: LangPackKey} = {\n s: 'Seconds',\n m: 'Minutes',\n h: 'Hours',\n d: 'Days',\n w: 'Weeks',\n mm: 'Months',\n y: 'Years'\n};\nexport default function formatCallDuration(duration: number, plain?: boolean) {\n const a = formatDuration(duration, 2);\n if(plain) {\n const strings = a.map((d) => I18n.format(CALL_DURATION_LANG_KEYS[d.type], true, [d.duration]));\n return join(strings, false, plain);\n }\n\n const elements = a.map((d) => i18n(CALL_DURATION_LANG_KEYS[d.type], [d.duration]));\n\n const fragment = document.createElement('span');\n fragment.append(...join(elements, false));\n\n return fragment;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport type DurationType = 's' | 'm' | 'h' | 'd' | 'w' | 'mm' | 'y';\nexport default function formatDuration(duration: number, showLast = 2) {\n if(!duration) {\n duration = 1;\n }\n\n const d: {duration: number, type: DurationType}[] = [];\n const p = [\n {m: 1, t: 's'},\n {m: 60, t: 'm'},\n {m: 60, t: 'h'},\n {m: 24, t: 'd'},\n {m: 7, t: 'w'}\n ] as Array<{m?: number, t: DurationType}>\n const s = 1;\n let t = s;\n p.forEach((o, idx) => {\n t = Math.round(t * o.m);\n\n if(duration < t) {\n return;\n }\n\n let dd = duration / t;\n if(idx !== (p.length - 1)) {\n const modulus = p[idx === (p.length - 1) ? idx : idx + 1].m;\n dd %= modulus;\n }\n\n d.push({\n duration: dd | 0,\n type: o.t\n });\n });\n\n const out = d.slice(-showLast).reverse();\n for(let i = out.length - 1; i >= 0; --i) {\n if(out[i].duration === 0) {\n out.splice(i, 1);\n }\n }\n\n return out;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {HelpCountry, HelpCountryCode} from '../layer';\nimport I18n from '../lib/langPack';\n\nlet sortedCountries: HelpCountry[];\ntype PrefixCountry = {country: HelpCountry, code: HelpCountryCode};\nconst prefixes: Map = new Map();\nlet maxPrefixLength = 0;\nconst setPrefix = (country: HelpCountry, code: HelpCountryCode, prefix: string = '') => {\n prefix = code.country_code + prefix;\n /* if(prefixes.has(prefix)) {\n console.error('asdasdasd', prefixes.get(prefix), country, code);\n } */\n maxPrefixLength = Math.max(maxPrefixLength, prefix.length);\n prefixes.set(prefix, {country, code});\n};\n\nexport function formatPhoneNumber(originalStr: string): {\n formatted: string,\n country: HelpCountry,\n code: HelpCountryCode,\n leftPattern: string\n} {\n originalStr = originalStr || '';\n\n if(!prefixes.size) {\n I18n.countriesList.forEach((country) => {\n country.country_codes.forEach((code) => {\n if(code.prefixes) {\n code.prefixes.forEach((prefix) => {\n setPrefix(country, code, prefix);\n });\n } else {\n setPrefix(country, code);\n }\n });\n });\n }\n\n // return {formatted: originalStr, country: undefined as any, leftPattern: ''};\n let str = originalStr.replace(/\\D/g, '');\n const phoneCode = str.slice(0, maxPrefixLength);\n\n // //console.log('str', str, phoneCode);\n // if(!sortedCountries) {\n // sortedCountries = I18n.countriesList.slice().sort((a, b) => b.country_codes[0].country_code.length - a.country_codes[0].country_code.length);\n // }\n\n // let country = sortedCountries.find((c) => {\n // return c.country_codes.find((c) => phoneCode.indexOf(c.replace(/\\D/g, '')) === 0);\n // });\n\n let prefixCountry: PrefixCountry;\n for(let i = phoneCode.length - 1; i >= 0; --i) { // lookup for country by prefix\n prefixCountry = prefixes.get(phoneCode.slice(0, i + 1));\n if(prefixCountry) {\n break;\n }\n }\n\n if(!prefixCountry) {\n return {\n formatted: str,\n country: undefined,\n code: undefined,\n leftPattern: ''\n };\n }\n\n // country = /* PhoneCodesMain[country.phoneCode] || */country;\n const country = prefixCountry.country;\n\n const patterns = prefixCountry.code.patterns || [];\n const searchForPattern = str.slice(prefixCountry.code.country_code.length); // splice country code\n let pattern = '', mostMatchedPatternMatches = 0, mostMatchedPattern = '';\n for(let i = patterns.length - 1; i >= 0; --i) {\n pattern = patterns[i];\n\n const _pattern = pattern.replace(/ /g, '');\n let patternMatches = 0;\n for(let k = 0, length = Math.min(searchForPattern.length, _pattern.length); k < length; ++k) {\n if(searchForPattern[k] === _pattern[k]) {\n patternMatches += 1.01;\n } else if(_pattern[k] === 'X') {\n ++patternMatches;\n } else {\n patternMatches = 0;\n break;\n }\n }\n\n if(patternMatches > mostMatchedPatternMatches) {\n mostMatchedPatternMatches = patternMatches;\n mostMatchedPattern = pattern;\n }\n }\n\n pattern = mostMatchedPattern || pattern;\n pattern = pattern.replace(/\\d/g, 'X');\n\n pattern = prefixCountry.code.country_code + ' ' + pattern;\n // let pattern = country.pattern || country.phoneCode;\n pattern.split('').forEach((symbol, idx) => {\n if(symbol === ' ' && str[idx] !== ' ' && str.length > idx) {\n str = str.slice(0, idx) + ' ' + str.slice(idx);\n }\n });\n\n /* if(country.pattern) {\n str = str.slice(0, country.pattern.length);\n } */\n\n let leftPattern = pattern && pattern.length > str.length ? pattern.slice(str.length) : '';\n if(leftPattern) {\n /* const length = str.length;\n leftPattern = leftPattern.split('').map((_, idx) => (length + idx).toString().slice(-1)).join(''); */\n leftPattern = leftPattern.replace(/X/g, '‒');\n // leftPattern = leftPattern.replace(/X/g, '0');\n }\n\n return {formatted: str, country, code: prefixCountry.code, leftPattern};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {RLottieColor} from '../lib/rlottie/rlottiePlayer';\n\nexport type FramesCacheMap = Map;\nexport type FramesCacheMapNew = Map;\nexport type FramesCacheMapURLs = Map;\nexport type FramesCacheItem = {\n frames: FramesCacheMap,\n framesNew: FramesCacheMapNew,\n framesURLs: FramesCacheMapURLs,\n clearCache: () => void,\n counter: number\n};\n\nexport class FramesCache {\n private cache: Map;\n\n constructor() {\n this.cache = new Map();\n }\n\n public static createCache(): FramesCacheItem {\n const cache: FramesCacheItem = {\n frames: new Map(),\n framesNew: new Map(),\n framesURLs: new Map(),\n clearCache: () => {\n cache.framesNew.forEach((value) => {\n (value as ImageBitmap).close?.();\n });\n\n cache.frames.clear();\n cache.framesNew.clear();\n cache.framesURLs.clear();\n },\n counter: 0\n };\n\n return cache;\n }\n\n public getCache(name: string) {\n let cache = this.cache.get(name);\n if(!cache) {\n this.cache.set(name, cache = FramesCache.createCache());\n } else {\n // console.warn('[RLottieCache] cache will be reused', cache);\n }\n\n ++cache.counter;\n return cache;\n }\n\n public releaseCache(name: string) {\n const cache = this.cache.get(name);\n if(cache && !--cache.counter) {\n this.cache.delete(name);\n // console.warn('[RLottieCache] released cache', cache);\n }\n }\n\n public getCacheCounter(name: string) {\n const cache = this.cache.get(name);\n return cache?.counter;\n }\n\n public generateName(name: string, width: number, height: number, color: RLottieColor, toneIndex: number) {\n return [\n name,\n width,\n height,\n // color ? rgbaToHexa(color) : ''\n color ? 'colored' : '',\n toneIndex || ''\n ].filter(Boolean).join('-');\n }\n}\n\nconst framesCache = new FramesCache();\n\nexport default framesCache;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// generate a path's arc data parameter\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\n\n// http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands\nfunction arcParameter(rx: number, ry: number, xAxisRotation: number, largeArcFlag: number, sweepFlag: number, x: number, y: number) {\n return [rx, ',', ry, ' ',\n xAxisRotation, ' ',\n largeArcFlag, ',',\n sweepFlag, ' ',\n x, ',', y].join('');\n}\n\nexport default function generatePathData(x: number, y: number, width: number, height: number, tl: number, tr: number, br: number, bl: number) {\n const data: string[] = [];\n\n // start point in top-middle of the rectangle\n data.push('M' + (x + width / 2) + ',' + y);\n\n // next we go to the right\n data.push('H' + (x + width - tr));\n\n if(tr > 0) {\n // now we draw the arc in the top-right corner\n data.push('A' + arcParameter(tr, tr, 0, 0, 1, (x + width), (y + tr)));\n }\n\n // next we go down\n data.push('V' + (y + height - br));\n\n if(br > 0) {\n // now we draw the arc in the lower-right corner\n data.push('A' + arcParameter(br, br, 0, 0, 1, (x + width - br), (y + height)));\n }\n\n // now we go to the left\n data.push('H' + (x + bl));\n\n if(bl > 0) {\n // now we draw the arc in the lower-left corner\n data.push('A' + arcParameter(bl, bl, 0, 0, 1, (x + 0), (y + height - bl)));\n }\n\n // next we go up\n data.push('V' + (y + tl));\n\n if(tl > 0) {\n // now we draw the arc in the top-left corner\n data.push('A' + arcParameter(tl, tl, 0, 0, 1, (x + tl), (y + 0)));\n }\n\n // and we close the path\n data.push('Z');\n\n return data.join(' ');\n}\n\nMOUNT_CLASS_TO.generatePathData = generatePathData;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {PhotoSize} from '../layer';\nimport {MyDocument} from '../lib/appManagers/appDocsManager';\nimport {MyPhoto} from '../lib/appManagers/appPhotosManager';\nimport {renderImageFromUrlPromise} from './dom/renderImageFromUrl';\nimport getPreviewURLFromThumb from './getPreviewURLFromThumb';\nimport blur from './blur';\n\nexport default function getImageFromStrippedThumb(\n photo: MyPhoto | MyDocument,\n thumb: PhotoSize.photoCachedSize | PhotoSize.photoStrippedSize,\n useBlur: boolean\n) {\n const url = getPreviewURLFromThumb(photo, thumb, false);\n\n let element: HTMLImageElement | HTMLCanvasElement, loadPromise: Promise;\n if(!useBlur) {\n element = new Image();\n loadPromise = renderImageFromUrlPromise(element, url);\n } else {\n const result = blur(url);\n element = result.canvas;\n loadPromise = result.promise;\n }\n\n element.classList.add('thumbnail');\n\n return {image: element, loadPromise};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../lib/appManagers/appDocsManager';\nimport type {MyPhoto} from '../lib/appManagers/appPhotosManager';\nimport {PhotoSize} from '../layer';\n// import appDownloadManager from \"../lib/appManagers/appDownloadManager\";\nimport getPreviewURLFromBytes from './bytes/getPreviewURLFromBytes';\n\nexport default function getPreviewURLFromThumb(photo: MyPhoto | MyDocument, thumb: PhotoSize.photoCachedSize | PhotoSize.photoStrippedSize, isSticker = false) {\n // const cacheContext = appDownloadManager.getCacheContext(photo, thumb.type);\n // return cacheContext.url || (cacheContext.url = getPreviewURLFromBytes(thumb.bytes, isSticker));\n return getPreviewURLFromBytes(thumb.bytes, isSticker);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../lib/appManagers/appDocsManager';\nimport type {MyPhoto} from '../lib/appManagers/appPhotosManager';\nimport {THUMB_TYPE_FULL} from '../lib/mtproto/mtproto_config';\nimport type {ThumbCache} from '../lib/storages/thumbs';\nimport getImageFromStrippedThumb from './getImageFromStrippedThumb';\n\nexport default function getStrippedThumbIfNeeded(photo: MyPhoto | MyDocument, cacheContext: ThumbCache, useBlur: boolean, ignoreCache = false) {\n const isVideo = (['video', 'gif'] as MyDocument['type'][]).includes((photo as MyDocument).type);\n if(!cacheContext.downloaded || isVideo || ignoreCache) {\n if(\n photo._ === 'document' &&\n cacheContext.downloaded &&\n !ignoreCache &&\n (!isVideo || cacheContext.type !== THUMB_TYPE_FULL)\n ) {\n return null;\n }\n\n const sizes = (photo as MyPhoto).sizes || (photo as MyDocument).thumbs;\n const thumb = sizes?.length ? sizes.find((size) => size._ === 'photoStrippedSize') : null;\n if(thumb && ('bytes' in thumb)) {\n return getImageFromStrippedThumb(photo, thumb as any, useBlur);\n }\n }\n\n return null;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport forEachReverse from './array/forEachReverse';\nimport safeAssign from './object/safeAssign';\n\nexport type ListLoaderOptions = {\n loadMore: ListLoader['loadMore'],\n loadCount?: ListLoader['loadCount'],\n loadWhenLeft?: ListLoader['loadWhenLeft'],\n processItem?: ListLoader['processItem'],\n onJump?: ListLoader['onJump'],\n onLoadedMore?: ListLoader['onLoadedMore']\n};\n\nexport type ListLoaderResult = {count: number, items: any[]};\nexport default class ListLoader {\n public current: T;\n public previous: T[] = [];\n public next: T[] = [];\n public count: number;\n public reverse = false; // reverse means next = higher msgid\n\n protected loadMore: (anchor: T, older: boolean, loadCount: number) => Promise>;\n protected processItem: (item: P) => T | Promise;\n protected loadCount = 50;\n protected loadWhenLeft = 20;\n\n public onJump: (item: T, older: boolean) => void;\n public onLoadedMore: () => void;\n\n protected loadedAllUp = false;\n protected loadedAllDown = false;\n protected loadPromiseUp: Promise;\n protected loadPromiseDown: Promise;\n\n constructor(options: ListLoaderOptions) {\n safeAssign(this, options);\n }\n\n public setTargets(previous: T[], next: T[], reverse: boolean) {\n this.previous = previous;\n this.next = next;\n this.reverse = reverse;\n }\n\n public get index() {\n return this.count !== undefined ? this.previous.length : -1;\n }\n\n /* public filter(callback: (item: T, idx: number, arr: T[]) => boolean) {\n const filter = (item: T, idx: number, arr: T[]) => {\n if(!callback(item, idx, arr)) {\n arr.splice(idx, 1);\n }\n };\n\n forEachReverse(this.previous, filter);\n forEachReverse(this.next, filter);\n } */\n\n public reset(loadedAll = false) {\n this.current = undefined;\n this.previous = [];\n this.next = [];\n this.setLoaded(true, loadedAll);\n this.setLoaded(false, loadedAll);\n }\n\n public go(length: number, dispatchJump = true) {\n let items: T[], item: T;\n if(length > 0) {\n items = this.next.splice(0, length);\n item = items.pop();\n if(!item) {\n return;\n }\n\n if(this.current !== undefined) items.unshift(this.current);\n this.previous.push(...items);\n } else {\n items = this.previous.splice(Math.max(0, this.previous.length + length), -length);\n item = items.shift();\n if(!item) {\n return;\n }\n\n if(this.current !== undefined) items.push(this.current);\n this.next.unshift(...items);\n }\n\n if(this.next.length < this.loadWhenLeft) {\n this.load(!this.reverse);\n }\n\n if(this.previous.length < this.loadWhenLeft) {\n this.load(this.reverse);\n }\n\n this.current = item;\n dispatchJump && this.onJump && this.onJump(item, length > 0);\n return this.current;\n }\n\n protected unsetCurrent(toPrevious: boolean) {\n if(toPrevious) this.previous.push(this.current);\n else this.next.unshift(this.current);\n\n this.current = undefined;\n }\n\n public goUnsafe(length: number, dispatchJump?: boolean) {\n const leftLength = length > 0 ? Math.max(0, length - this.next.length) : Math.min(0, length + this.previous.length);\n const item = this.go(length, leftLength ? false : dispatchJump);\n\n /* if(length > 0 ? this.loadedAllUp : this.loadedAllDown) {\n this.unsetCurrent(length > 0);\n } */\n\n return {\n item: !leftLength ? item : undefined,\n leftLength\n };\n }\n\n protected setLoaded(down: boolean, value: boolean) {\n const isChanged = (down ? this.loadedAllDown : this.loadedAllUp) !== value;\n if(!isChanged) {\n return false;\n }\n\n if(down) this.loadedAllDown = value;\n else this.loadedAllUp = value;\n\n if(!value) {\n if(down) this.loadPromiseDown = null;\n else this.loadPromiseUp = null;\n }\n\n return true;\n }\n\n // нет смысла делать проверку для reverse и loadMediaPromise\n public load(older: boolean) {\n if(older ? this.loadedAllDown : this.loadedAllUp) return Promise.resolve();\n\n let promise = older ? this.loadPromiseDown : this.loadPromiseUp;\n if(promise) return promise;\n\n let anchor: T;\n if(older) {\n anchor = this.reverse ? this.previous[0] : this.next[this.next.length - 1];\n } else {\n anchor = this.reverse ? this.next[this.next.length - 1] : this.previous[0];\n }\n\n anchor ??= this.current;\n promise = this.loadMore(anchor, older, this.loadCount).then(async(result) => {\n if((older ? this.loadPromiseDown : this.loadPromiseUp) !== promise) {\n return;\n }\n\n if(result.items.length < this.loadCount) {\n this.setLoaded(older, true);\n }\n\n if(this.count === undefined) {\n this.count = result.count || result.items.length;\n }\n\n const processedArr: (Promise | any)[] = [];\n const method = older ? result.items.forEach.bind(result.items) : forEachReverse.bind(null, result.items);\n method((item: any) => {\n const processed = this.processItem ? this.processItem(item) : item;\n\n if(!processed) return;\n processedArr.push(processed);\n });\n\n const results = await Promise.all(processedArr);\n if(older) {\n if(this.reverse) this.previous.unshift(...results);\n else this.next.push(...results);\n } else {\n if(this.reverse) this.next.push(...results);\n else this.previous.unshift(...results);\n }\n\n this.onLoadedMore && this.onLoadedMore();\n }, () => {}).then(() => {\n if(older) this.loadPromiseDown = null;\n else this.loadPromiseUp = null;\n });\n\n if(older) this.loadPromiseDown = promise;\n else this.loadPromiseUp = promise;\n\n return promise;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type EventListenerBase from './eventListenerBase';\n\nexport type Listener = {\n element: ListenerElement,\n event: ListenerEvent,\n callback: ListenerCallback,\n options?: ListenerOptions,\n\n onceFired?: true, // will be set only when options.once is set\n onceCallback?: () => void,\n};\n\nexport type ListenerElement = Window | Document | HTMLElement | Element | EventListenerBase;\nexport type ListenerEvent = string;\nexport type ListenerCallback = Function;\nexport type ListenerOptions = AddEventListenerOptions;\n\n/* const originalAddEventListener = HTMLElement.prototype.addEventListener;\nHTMLElement.prototype.addEventListener = function(this, name: string, callback: EventListenerOrEventListenerObject, options: AddEventListenerOptions) {\n console.log('nu zdarova', name);\n originalAddEventListener.call(this, name, callback, options);\n\n if(options?.ls) {\n return options.ls.addFromElement(this, name, callback as any, options);\n }\n}; */\n\nexport default class ListenerSetter {\n private listeners: Set = new Set();\n\n public add(element: T): T['addEventListener'] {\n return ((event: string, callback: Function, options: ListenerOptions) => {\n const listener: Listener = {element, event, callback, options};\n this.addManual(listener);\n return listener;\n }) as any;\n }\n\n /* public addFromElement(element: T, event: ListenerEvent, callback: ListenerCallback, options: ListenerOptions) {\n const listener: Listener = {element, event, callback, options};\n this.addManual(listener);\n return listener;\n } */\n\n public addManual(listener: Listener) {\n // @ts-ignore\n listener.element.addEventListener(listener.event, listener.callback, listener.options);\n\n if(listener.options?.once) { // remove listener when its called\n listener.onceCallback = () => {\n this.remove(listener);\n listener.onceFired = true;\n };\n\n // @ts-ignore\n listener.element.addEventListener(listener.event, listener.onceCallback, listener.options);\n }\n\n this.listeners.add(listener);\n }\n\n public remove(listener: Listener) {\n if(!listener.onceFired) {\n // @ts-ignore\n listener.element.removeEventListener(listener.event, listener.callback, listener.options);\n\n if(listener.onceCallback) {\n // @ts-ignore\n listener.element.removeEventListener(listener.event, listener.onceCallback, listener.options);\n }\n }\n\n this.listeners.delete(listener);\n }\n\n public removeManual(\n element: T,\n event: ListenerEvent,\n callback: ListenerCallback,\n options?: ListenerOptions\n ) {\n let listener: Listener;\n for(const _listener of this.listeners) {\n if(_listener.element === element &&\n _listener.event === event &&\n _listener.callback === callback &&\n _listener.options === options) {\n listener = _listener;\n break;\n }\n }\n\n if(listener) {\n this.remove(listener);\n }\n }\n\n public removeAll() {\n this.listeners.forEach((listener) => {\n this.remove(listener);\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport rootScope from '../lib/rootScope';\n\nexport type LiteModeKey = 'all' | 'gif' | 'video' |\n 'emoji' | 'emoji_panel' | 'emoji_messages' |\n 'effects' | 'effects_reactions' | 'effects_premiumstickers' | 'effects_emoji' |\n 'stickers' | 'stickers_panel' | 'stickers_chat' |\n 'chat' | 'chat_background' | 'chat_spoilers' | 'animations';\n\nexport class LiteMode {\n public isEnabled() {\n return rootScope.settings.liteMode.all;\n }\n\n public isAvailable(key: LiteModeKey) {\n return !rootScope.settings.liteMode.all && !rootScope.settings.liteMode[key];\n }\n}\n\nconst liteMode = new LiteMode();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.liteMode = liteMode);\nexport default liteMode;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport calcImageInBox from './calcImageInBox';\n\nexport class MediaSize {\n constructor(public width = 0, public height = width) {\n\n }\n\n public aspect(boxSize: MediaSize, fitted: boolean) {\n return calcImageInBox(this.width, this.height, boxSize.width, boxSize.height, fitted);\n }\n\n public aspectFitted(boxSize: MediaSize) {\n return this.aspect(boxSize, true);\n }\n\n public aspectCovered(boxSize: MediaSize) {\n return this.aspect(boxSize, false);\n }\n}\n\nexport function makeMediaSize(width?: number, height?: number): MediaSize {\n return new MediaSize(width, height);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport EventListenerBase from './eventListenerBase';\nimport {makeMediaSize, MediaSize} from './mediaSize';\n\ntype MediaTypeSizes = {\n regular: MediaSize,\n webpage: MediaSize,\n album: MediaSize,\n esgSticker: MediaSize,\n animatedSticker: MediaSize,\n staticSticker: MediaSize,\n emojiSticker: MediaSize,\n poll: MediaSize,\n round: MediaSize,\n documentName: MediaSize,\n invoice: MediaSize,\n extendedInvoice: MediaSize,\n customEmoji: MediaSize,\n esgCustomEmoji: MediaSize,\n emojiStatus: MediaSize,\n popupSticker: MediaSize\n};\n\nexport type MediaSizeType = keyof MediaTypeSizes;\n\nexport enum ScreenSize {\n mobile,\n medium,\n large\n}\n\nconst MOBILE_SIZE = 600;\nconst MEDIUM_SIZE = 1275;\nconst LARGE_SIZE = 1680;\n\nconst CUSTOM_EMOJI_SIZE = makeMediaSize(20, 20);\nconst ESG_CUSTOM_EMOJI_SIZE = makeMediaSize(36, 36);\nconst EMOJI_STATUS_SIZE = makeMediaSize(18, 18);\n\nclass MediaSizes extends EventListenerBase<{\n changeScreen: (from: ScreenSize, to: ScreenSize) => void,\n resize: () => void\n}> {\n private screenSizes: {key: ScreenSize, value: number}[] = [\n {key: ScreenSize.mobile, value: MOBILE_SIZE},\n {key: ScreenSize.medium, value: MEDIUM_SIZE},\n {key: ScreenSize.large, value: LARGE_SIZE}\n ];\n\n private sizes: {[k in 'desktop' | 'handhelds']: MediaTypeSizes} = {\n handhelds: {\n regular: makeMediaSize(270, 270),\n webpage: makeMediaSize(270, 200),\n album: makeMediaSize(270, 0),\n esgSticker: makeMediaSize(68, 68),\n animatedSticker: makeMediaSize(180, 180),\n staticSticker: makeMediaSize(180, 180),\n emojiSticker: makeMediaSize(112, 112),\n poll: makeMediaSize(240, 0),\n round: makeMediaSize(200, 200),\n documentName: makeMediaSize(200, 0),\n invoice: makeMediaSize(270, 270),\n extendedInvoice: makeMediaSize(270, 270),\n customEmoji: CUSTOM_EMOJI_SIZE,\n esgCustomEmoji: ESG_CUSTOM_EMOJI_SIZE,\n emojiStatus: EMOJI_STATUS_SIZE,\n popupSticker: makeMediaSize(68, 68)\n },\n desktop: {\n regular: makeMediaSize(420, 340),\n webpage: makeMediaSize(420, 340),\n album: makeMediaSize(420, 0),\n esgSticker: makeMediaSize(72, 72),\n animatedSticker: makeMediaSize(200, 200),\n staticSticker: makeMediaSize(200, 200),\n emojiSticker: makeMediaSize(112, 112),\n poll: makeMediaSize(330, 0),\n round: makeMediaSize(280, 280),\n documentName: makeMediaSize(240, 0),\n invoice: makeMediaSize(320, 320),\n extendedInvoice: makeMediaSize(420, 340),\n customEmoji: CUSTOM_EMOJI_SIZE,\n esgCustomEmoji: ESG_CUSTOM_EMOJI_SIZE,\n emojiStatus: EMOJI_STATUS_SIZE,\n popupSticker: makeMediaSize(80, 80)\n }\n };\n\n public isMobile = false;\n public active: MediaTypeSizes;\n public activeScreen: ScreenSize;\n private rAF: number;\n\n constructor() {\n super();\n\n window.addEventListener('resize', () => {\n if(this.rAF) window.cancelAnimationFrame(this.rAF);\n this.rAF = window.requestAnimationFrame(() => {\n this.handleResize();\n this.rAF = 0;\n });\n });\n this.handleResize();\n }\n\n private handleResize = () => {\n const innerWidth = window.innerWidth;\n // this.isMobile = innerWidth <= 720;\n\n let activeScreen = this.screenSizes[0].key;\n for(let i = this.screenSizes.length - 1; i >= 0; --i) {\n if(this.screenSizes[i].value < innerWidth) {\n activeScreen = (this.screenSizes[i + 1] || this.screenSizes[i]).key;\n break;\n }\n }\n\n const wasScreen = this.activeScreen;\n this.activeScreen = activeScreen;\n this.isMobile = this.activeScreen === ScreenSize.mobile;\n this.active = this.isMobile ? this.sizes.handhelds : this.sizes.desktop;\n\n // console.time('esg');\n // const computedStyle = window.getComputedStyle(document.documentElement);\n // this.active.esgSticker.width = parseFloat(computedStyle.getPropertyValue('--esg-sticker-size'));\n // console.timeEnd('esg');\n\n if(wasScreen !== activeScreen) {\n // console.log('changeScreen', this.activeScreen, activeScreen);\n\n if(wasScreen !== undefined) {\n this.dispatchEvent('changeScreen', wasScreen, activeScreen);\n }\n }\n\n if(wasScreen !== undefined) {\n this.dispatchEvent('resize');\n }\n\n /* if(this.isMobile) {\n for(let i in this.active) {\n // @ts-ignore\n let size = this.active[i];\n size.width = innerWidth\n }\n } */\n };\n}\n\nconst mediaSizes = new MediaSizes();\nMOUNT_CLASS_TO.mediaSizes = mediaSizes;\nexport default mediaSizes;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport makeError from './makeError';\n\nconst error = makeError('MIDDLEWARE');\nexport default function middlewarePromise(middleware: () => boolean, throwWhat: any = error) {\n return (promise: T): T => {\n if(!(promise instanceof Promise)) {\n if(promise instanceof Error) {\n throw promise;\n } else {\n return promise;\n }\n }\n\n return (promise as any as Promise).then((result) => {\n if(!middleware()) {\n throw throwWhat;\n }\n\n return result;\n }) as any;\n };\n}\n","export default function formatNumber(bytes: number, decimals = 2) {\n if(bytes === 0) return '0';\n\n const k = 1000;\n const dm = decimals < 0 ? 0 : decimals;\n const sizes = ['', 'K', 'M', 'B', 'T'];\n\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + sizes[i];\n}\n","export default function numberThousandSplitter(x: number, joiner = ' ') {\n const parts = x.toString().split('.');\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, joiner);\n return parts.join('.');\n}\n","import {IS_APPLE_MOBILE} from '../environment/userAgent';\n\nexport default function onMediaLoad(media: HTMLMediaElement, readyState = media.HAVE_METADATA, useCanplayOnIos?: boolean) {\n return new Promise((resolve, reject) => {\n if(media.readyState >= readyState) {\n resolve();\n return;\n }\n\n const loadEventName = IS_APPLE_MOBILE && !useCanplayOnIos ? 'loadeddata' : 'canplay';\n const errorEventName = 'error';\n const onLoad = () => {\n media.removeEventListener(errorEventName, onError);\n resolve();\n };\n const onError = (e: ErrorEvent) => {\n media.removeEventListener(loadEventName, onLoad);\n reject(media.error);\n };\n media.addEventListener(loadEventName, onLoad, {once: true});\n media.addEventListener(errorEventName, onError, {once: true});\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appNavigationController, {NavigationItem} from '../components/appNavigationController';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport {IS_MOBILE_SAFARI} from '../environment/userAgent';\nimport cancelEvent from './dom/cancelEvent';\nimport {CLICK_EVENT_NAME, hasMouseMovedSinceDown} from './dom/clickEvent';\nimport findUpAsChild from './dom/findUpAsChild';\nimport EventListenerBase from './eventListenerBase';\n\nexport default class OverlayClickHandler extends EventListenerBase<{\n toggle: (open: boolean) => void\n}> {\n protected element: HTMLElement;\n protected overlay: HTMLElement;\n protected listenerOptions: AddEventListenerOptions;\n\n constructor(\n protected navigationType: NavigationItem['type'],\n protected withOverlay?: boolean\n ) {\n super(false);\n this.listenerOptions = withOverlay ? {} : {capture: true};\n }\n\n protected onClick = (e: MouseEvent | TouchEvent) => {\n if(hasMouseMovedSinceDown(e)) {\n return;\n }\n\n if(this.element && findUpAsChild(e.target as HTMLElement, this.element)) {\n return;\n }\n\n if(this.listenerOptions?.capture) {\n cancelEvent(e);\n }\n\n this.close();\n };\n\n public close() {\n if(this.element) {\n this.overlay?.remove();\n this.element = undefined;\n this.dispatchEvent('toggle', false);\n }\n\n if(!IS_TOUCH_SUPPORTED) {\n // window.removeEventListener('keydown', onKeyDown, {capture: true});\n window.removeEventListener('contextmenu', this.onClick, this.listenerOptions);\n }\n\n document.removeEventListener(CLICK_EVENT_NAME, this.onClick, this.listenerOptions);\n\n if(!IS_MOBILE_SAFARI) {\n appNavigationController.removeByType(this.navigationType);\n }\n }\n\n public open(element: HTMLElement) {\n this.close();\n\n if(!IS_MOBILE_SAFARI) {\n appNavigationController.pushItem({\n type: this.navigationType,\n onPop: (canAnimate) => {\n this.close();\n }\n });\n }\n\n this.element = element;\n\n if(!this.overlay && this.withOverlay) {\n this.overlay = document.createElement('div');\n this.overlay.classList.add('btn-menu-overlay');\n\n // ! because this event must be canceled, and can't cancel on menu click (below)\n this.overlay.addEventListener(CLICK_EVENT_NAME, (e) => {\n cancelEvent(e);\n this.onClick(e);\n });\n }\n\n this.overlay && this.element.parentElement.insertBefore(this.overlay, this.element);\n\n // document.body.classList.add('disable-hover');\n\n if(!IS_TOUCH_SUPPORTED) {\n // window.addEventListener('keydown', onKeyDown, {capture: true});\n window.addEventListener('contextmenu', this.onClick, {...this.listenerOptions, once: true});\n }\n\n /* // ! because this event must be canceled, and can't cancel on menu click (below)\n overlay.addEventListener(CLICK_EVENT_NAME, (e) => {\n cancelEvent(e);\n onClick(e);\n }); */\n\n // ! safari iOS doesn't handle window click event on overlay, idk why\n document.addEventListener(CLICK_EVENT_NAME, this.onClick, this.listenerOptions);\n\n this.dispatchEvent('toggle', true);\n }\n}\n","import Currencies from '../config/currencies';\n\n// https://stackoverflow.com/a/34141813\nfunction number_format(number: any, decimals: any, dec_point: any, thousands_sep: any): string {\n // Strip all characters but numerical ones.\n number = (number + '').replace(/[^0-9+\\-Ee.]/g, '');\n var n = !isFinite(+number) ? 0 : +number,\n prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),\n sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,\n dec = (typeof dec_point === 'undefined') ? '.' : dec_point,\n s: any = '',\n toFixedFix = function(n: number, prec: number) {\n var k = Math.pow(10, prec);\n return '' + Math.round(n * k) / k;\n };\n // Fix for IE parseFloat(0.55).toFixed(0) = 0;\n s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');\n if(s[0].length > 3) {\n s[0] = s[0].replace(/\\B(?=(?:\\d{3})+(?!\\d))/g, sep);\n }\n if((s[1] || '').length < prec) {\n s[1] = s[1] || '';\n s[1] += new Array(prec - s[1].length + 1).join('0');\n }\n return s.join(dec);\n}\n\nexport default function paymentsWrapCurrencyAmount(amount: number | string, currency: string, skipSymbol?: boolean) {\n amount = +amount;\n\n const isNegative = amount < 0;\n\n const currencyData = Currencies[currency];\n if(!currencyData) {\n throw new Error('CURRENCY_WRAP_INVALID');\n }\n\n const amountExp = amount / Math.pow(10, currencyData.exp);\n\n let decimals = currencyData.exp;\n if(currency == 'IRR' && Math.floor(amountExp) == amountExp) {\n decimals = 0; // у иранцев копейки почти всегда = 0 и не показываются в UI\n }\n\n let formatted = number_format(amountExp, decimals, currencyData.decimal_sep, currencyData.thousands_sep);\n if(skipSymbol) {\n return formatted;\n }\n\n let symbol = currencyData.symbol;\n if(isNegative && !currencyData.space_between && currencyData.symbol_left) {\n symbol = '-' + symbol;\n formatted = formatted.replace('-', '');\n }\n\n let out: string;\n const splitter = currencyData.space_between ? ' ' : '';\n if(currencyData.symbol_left) {\n out = symbol + splitter + formatted;\n } else {\n out = formatted + splitter + symbol;\n }\n return out;\n}\n\n(window as any).p = paymentsWrapCurrencyAmount;\n\n// function paymentsGetCurrencyExp($currency: string) {\n// if($currency == 'CLF') {\n// return 4;\n// }\n// if(['BHD','IQD','JOD','KWD','LYD','OMR','TND'].includes($currency)) {\n// return 3;\n// }\n// if(['BIF','BYR','CLP','CVE','DJF','GNF','ISK','JPY','KMF','KRW','MGA', 'PYG','RWF','UGX','UYI','VND','VUV','XAF','XOF','XPF'].includes($currency)) {\n// return 0;\n// }\n// if($currency == 'MRO') {\n// return 1;\n// }\n// return 2;\n// }\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport mediaSizes from './mediaSizes';\n\nexport type MenuPositionPadding = {\n top?: number,\n right?: number,\n bottom?: number,\n left?: number\n};\n\nconst PADDING_TOP = 8;\nconst PADDING_BOTTOM = PADDING_TOP;\nconst PADDING_LEFT = 8;\nconst PADDING_RIGHT = PADDING_LEFT;\nexport default function positionMenu(e: MouseEvent | Touch | TouchEvent, elem: HTMLElement, side?: 'left' | 'right' | 'center', additionalPadding?: MenuPositionPadding) {\n if((e as TouchEvent).touches) {\n e = (e as TouchEvent).touches[0];\n }\n\n const {pageX, pageY} = e as Touch;\n // let {clientX, clientY} = e;\n\n // * side mean the OPEN side\n\n const getScrollWidthFromElement = (Array.from(elem.children) as HTMLElement[]).find((element) => element.classList.contains('btn-menu-item') && !element.classList.contains('hide')) || elem;\n\n let {scrollWidth: menuWidth} = getScrollWidthFromElement;\n const {scrollHeight: menuHeight} = elem;\n // let {innerWidth: windowWidth, innerHeight: windowHeight} = window;\n const rect = document.body.getBoundingClientRect();\n const windowWidth = rect.width;\n const windowHeight = rect.height;\n\n menuWidth += getScrollWidthFromElement.offsetLeft * 2;\n\n let paddingTop = PADDING_TOP, paddingRight = PADDING_RIGHT, paddingBottom = PADDING_BOTTOM, paddingLeft = PADDING_LEFT;\n if(additionalPadding) {\n if(additionalPadding.top) paddingTop += additionalPadding.top;\n if(additionalPadding.right) paddingRight += additionalPadding.right;\n if(additionalPadding.bottom) paddingBottom += additionalPadding.bottom;\n if(additionalPadding.left) paddingLeft += additionalPadding.left;\n }\n\n side = mediaSizes.isMobile ? 'right' : 'left';\n let verticalSide: 'top' /* | 'bottom' */ | 'center' = 'top';\n\n const maxTop = windowHeight - menuHeight - paddingBottom;\n const maxLeft = windowWidth - menuWidth - paddingRight;\n const minTop = paddingTop;\n const minLeft = paddingLeft;\n\n const getSides = () => {\n return {\n x: {\n left: pageX,\n right: Math.min(maxLeft, pageX - menuWidth)\n },\n intermediateX: side === 'right' ? minLeft : maxLeft,\n // intermediateX: clientX < windowWidth / 2 ? PADDING_LEFT : windowWidth - menuWidth - PADDING_LEFT,\n y: {\n top: pageY,\n bottom: pageY - menuHeight\n },\n // intermediateY: verticalSide === 'top' ? paddingTop : windowHeight - menuHeight - paddingTop,\n // intermediateY: pageY < (windowHeight / 2) ? paddingTop : windowHeight - menuHeight - paddingBottom,\n intermediateY: maxTop\n };\n };\n\n const sides = getSides();\n\n const possibleSides = {\n x: {\n left: (sides.x.left + menuWidth + paddingRight) <= windowWidth,\n right: sides.x.right >= paddingLeft\n },\n y: {\n top: (sides.y.top + menuHeight + paddingBottom) <= windowHeight,\n bottom: (sides.y.bottom - paddingBottom) >= paddingBottom\n }\n };\n\n /* if(side === undefined) {\n if((clientX + menuWidth + PADDING_LEFT) > windowWidth) {\n side = 'right';\n }\n } */\n\n {\n /* const x = sides.x;\n\n const s = Object.keys(x) as (keyof typeof possibleSides.x)[];\n if(side) {\n s.findAndSplice((s) => s === side);\n s.unshift(side);\n }\n\n const possibleSide = s.find((s) => possibleSides.x[s]); */\n // let left: number;\n /* if(possibleSide) {\n left = x[possibleSide];\n side = possibleSide;\n } else {\n left = sides.intermediateX;\n side = undefined;\n } */\n const left = possibleSides.x[side] ? sides.x[side] : (side = 'center', sides.intermediateX);\n\n elem.style.left = left + 'px';\n }\n\n /* if((clientY + menuHeight + PADDING_TOP) > windowHeight) {\n elem.style.top = clamp(clientY - menuHeight, PADDING_TOP, windowHeight - menuHeight - PADDING_TOP) + 'px';\n // elem.style.top = (innerHeight - scrollHeight - PADDING_TOP) + 'px';\n verticalSide = 'bottom';\n } else {\n elem.style.top = Math.max(PADDING_TOP, clientY) + 'px';\n verticalSide = 'top';\n } */\n\n {\n const top = possibleSides.y[verticalSide] ? sides.y[verticalSide] : (verticalSide = 'center', sides.intermediateY);\n\n elem.style.top = top + 'px';\n }\n\n elem.className = elem.className.replace(/(top|center|bottom)-(left|center|right)/g, '');\n elem.classList.add(\n // (verticalSide === 'center' ? verticalSide : (verticalSide === 'bottom' ? 'top' : 'bottom')) +\n (verticalSide === 'center' ? verticalSide : 'bottom') +\n '-' +\n (side === 'center' ? side : (side === 'left' ? 'right' : 'left')));\n\n return {\n width: menuWidth,\n height: menuHeight\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appDownloadManager from '../lib/appManagers/appDownloadManager';\nimport lottieLoader from '../lib/rlottie/lottieLoader';\nimport rootScope from '../lib/rootScope';\nimport {getEmojiToneIndex} from '../vendor/emoji';\nimport mediaSizes from './mediaSizes';\nimport {saveLottiePreview} from './saveLottiePreview';\n\nexport default function preloadAnimatedEmojiSticker(emoji: string, width?: number, height?: number) {\n return rootScope.managers.appStickersManager.preloadAnimatedEmojiSticker(emoji).then(({doc}) => {\n if(!doc) {\n return;\n }\n\n return appDownloadManager.downloadMedia({media: doc})\n .then(async(blob) => {\n const mediaSize = mediaSizes.active.emojiSticker;\n const toneIndex = getEmojiToneIndex(emoji);\n const animation = await lottieLoader.loadAnimationWorker({\n container: undefined,\n animationData: blob,\n width: width ?? mediaSize.width,\n height: height ?? mediaSize.height,\n name: 'doc' + doc.id,\n autoplay: false,\n loop: false,\n toneIndex,\n group: 'none'\n });\n\n animation.addEventListener('firstFrame', () => {\n saveLottiePreview(doc, animation.canvas[0], toneIndex);\n animation.remove();\n }, {once: true});\n });\n });\n}\n","import {RestrictionReason} from '../layer';\n\nconst platforms = new Set([\n 'all',\n 'web',\n 'webk'\n]);\n\nconst ignore = new Set();\n\nexport function getRestrictionReason(reasons: RestrictionReason[]) {\n // return reasons[0];\n return reasons.find((reason) => platforms.has(reason.platform) && !ignore.has(reason.reason));\n}\n\nexport function isRestricted(reasons: RestrictionReason[]) {\n return !!getRestrictionReason(reasons);\n}\n\nexport function ignoreRestrictionReasons(reasons: string[]) {\n ignore.clear();\n reasons.forEach((reason) => {\n ignore.add(reason);\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../lib/appManagers/appDocsManager';\nimport rootScope from '../lib/rootScope';\n\nconst savingLottiePreview: {[docId: DocId]: {width: number, height: number}} = {};\n\nexport function isSavingLottiePreview(doc: MyDocument, toneIndex: number, width: number, height: number) {\n const key = doc.id + '-' + toneIndex;\n const saving = savingLottiePreview[key];\n return saving && saving.width >= width && saving.height >= height;\n}\n\nexport async function saveLottiePreview(doc: MyDocument, canvas: HTMLCanvasElement, toneIndex: number) {\n const key = doc.id + '-' + toneIndex;\n const {width, height} = canvas;\n if(isSavingLottiePreview(doc, toneIndex, width, height)) {\n return;\n }\n\n const saving = savingLottiePreview[key] = {\n width,\n height\n };\n\n const thumb = await rootScope.managers.appDocsManager.getLottieCachedThumb(doc.id, toneIndex);\n if(savingLottiePreview[key] !== saving) {\n return;\n }\n\n if(thumb && thumb.w >= width && thumb.h >= height) {\n return;\n }\n\n const promise = new Promise((resolve) => {\n canvas.toBlob((blob) => resolve(blob));\n });\n\n const blob = await promise;\n if(savingLottiePreview[key] !== saving) {\n return;\n }\n\n // console.log('got lottie preview', doc, blob, URL.createObjectURL(blob));\n\n rootScope.managers.appDocsManager.saveLottiePreview(doc.id, blob, width, height, toneIndex);\n\n // delete savingLottiePreview[key];\n\n /* const reader = new FileReader();\n reader.onloadend = (e) => {\n const uint8 = new Uint8Array(e.target.result as ArrayBuffer);\n const thumb: PhotoSize.photoStrippedSize = {\n _: 'photoStrippedSize',\n bytes: uint8,\n type: 'i'\n };\n\n doc.stickerSavedThumbWidth = canvas.width;\n doc.stickerSavedThumbHeight = canvas.width;\n\n defineNotNumerableProperties(thumb, ['url']);\n thumb.url = URL.createObjectURL(blob);\n doc.thumbs.findAndSplice((t) => t._ === thumb._);\n doc.thumbs.unshift(thumb);\n\n if(!webpWorkerController.isWebpSupported()) {\n doc.pFlags.stickerThumbConverted = true;\n }\n\n delete this.savingLottiePreview[doc.id];\n };\n reader.readAsArrayBuffer(blob); */\n}\n","// * Jolly Cobra's schedulers\n\nimport {AnyToVoidFunction} from '../../types';\nimport {fastRaf} from '../schedulers';\nimport throttleWith from './throttleWith';\n\nexport default function throttleWithRaf(fn: F) {\n return throttleWith(fastRaf, fn);\n}\n","// * Jolly Cobra's schedulers\n\nimport {AnyToVoidFunction} from '../../types';\n\nexport default function throttleWith(schedulerFn: AnyToVoidFunction, fn: F) {\n let waiting = false;\n let args: Parameters;\n\n return (..._args: Parameters) => {\n args = _args;\n\n if(!waiting) {\n waiting = true;\n\n schedulerFn(() => {\n waiting = false;\n // @ts-ignore\n fn(...args);\n });\n }\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Scrollable from '../components/scrollable';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport {IS_SAFARI} from '../environment/userAgent';\nimport getVisibleRect from './dom/getVisibleRect';\nimport reflowScrollableElement from './dom/reflowScrollableElement';\n\nexport default class ScrollSaver {\n private scrollHeight: number;\n private scrollHeightMinusTop: number;\n private scrollTop: number;\n private clientHeight: number;\n private elements: {element: HTMLElement, rect: DOMRect}[];\n\n /**\n *\n * @param scrollable to reset scroll position and direction\n * @param reverse true means top\n */\n constructor(\n private scrollable: Scrollable,\n private query: string,\n private reverse: boolean\n ) {\n\n }\n\n private get container() {\n return this.scrollable.container;\n }\n\n public getSaved() {\n return {\n scrollHeight: this.scrollHeight,\n scrollTop: this.scrollTop,\n clientHeight: this.clientHeight\n };\n }\n\n public findElements() {\n if(!this.query) return [];\n\n const {container} = this;\n const containerRect = container.getBoundingClientRect();\n const bubbles = Array.from(container.querySelectorAll(this.query)) as HTMLElement[];\n const elements: ScrollSaver['elements'] = [];\n for(const bubble of bubbles) {\n const elementRect = bubble.getBoundingClientRect();\n const visibleRect = getVisibleRect(bubble, container, undefined, elementRect, containerRect);\n if(visibleRect) {\n elements.push({element: bubble, rect: elementRect});\n // break; // find first\n } else if(elements.length) { // find last\n break;\n }\n }\n\n if(!elements.length) {\n const bubble = bubbles[0];\n if(bubble) {\n elements.push({element: bubble, rect: bubble.getBoundingClientRect()});\n }\n }\n\n return elements;\n }\n\n public replaceSaved(from: HTMLElement, to: HTMLElement) {\n if(!this.elements) {\n return;\n }\n\n const idx = this.elements.findIndex(({element}) => from === element);\n if(idx !== -1) {\n this.elements[idx].element = to;\n }\n }\n\n public findAndSetElements() {\n this.elements = this.findElements();\n }\n\n public save() {\n this.findAndSetElements();\n // console.warn('scroll save', this.elements);\n this._save();\n }\n\n public _save() {\n const {scrollTop, scrollHeight, clientHeight} = this.container;\n\n // previousScrollHeight = scrollHeight;\n // previousScrollHeight = scrollHeight + padding;\n this.scrollHeight = scrollHeight;\n this.scrollTop = scrollTop;\n this.clientHeight = clientHeight;\n this.scrollHeightMinusTop = this.reverse ? scrollHeight - scrollTop : scrollTop;\n\n // this.chatInner.style.paddingTop = padding + 'px';\n /* if(reverse) {\n previousScrollHeightMinusTop = this.scrollable.scrollHeight - scrollTop;\n } else {\n previousScrollHeightMinusTop = scrollTop;\n } */\n }\n\n private onRestore(useReflow?: boolean) {\n if(IS_SAFARI && useReflow/* && !isAppleMobile */) { // * fix blinking and jumping\n reflowScrollableElement(this.container);\n }\n }\n\n private setScrollTop(newScrollTop: number, useReflow?: boolean) {\n // touchSupport for safari iOS\n // isTouchSupported && isApple && (container.container.style.overflow = 'hidden');\n this.scrollable.setScrollTopSilently(this.scrollTop = newScrollTop);\n // container.scrollTop = scrollHeight;\n // isTouchSupported && isApple && (container.container.style.overflow = '');\n\n this.onRestore(useReflow);\n }\n\n public restore(useReflow?: boolean) {\n const {scrollTop, scrollHeight} = this.scrollable;\n this.scrollHeight = scrollHeight;\n\n if(!this.elements.length) { // maybe all messages have been deleted\n this._restore(useReflow);\n return;\n }\n\n let anchor: ScrollSaver['elements'][0];\n // for(let i = this.elements.length - 1; i >= 0; --i) {\n // const _anchor = this.elements[i];\n // if(_anchor.element.parentElement) {\n // anchor = _anchor;\n // break;\n // }\n // }\n anchor = this.elements[this.elements.length - 1];\n\n if(!anchor?.element?.parentElement) { // try to find new anchor\n this.findAndSetElements();\n anchor = this.elements[this.elements.length - 1];\n\n if(!anchor) { // fallback to old method if smth is really strange\n this._restore(useReflow);\n return;\n }\n }\n\n const {element, rect} = anchor;\n const newRect = element.getBoundingClientRect();\n const diff = newRect.bottom - rect.bottom;\n this.setScrollTop(scrollTop + diff, useReflow);\n // if(diff) debugger;\n // console.warn('scroll restore', rect, diff, newRect);\n }\n\n public _restore(useReflow?: boolean) {\n const {scrollHeightMinusTop: previousScrollHeightMinusTop, scrollable} = this;\n // if(previousScrollHeightMinusTop === undefined) {\n // throw new Error('scroll was not saved');\n // }\n\n // const scrollHeight = container.scrollHeight;\n const scrollHeight = this.scrollHeight;\n // if(scrollHeight === this.scrollHeight) {\n // return;\n // }\n\n // this.scrollHeight = scrollHeight;\n\n /* const scrollHeight = container.scrollHeight;\n const addedHeight = scrollHeight - previousScrollHeight;\n\n this.chatInner.style.paddingTop = (10000 - addedHeight) + 'px'; */\n /* const scrollHeight = scrollHeight;\n const addedHeight = scrollHeight - previousScrollHeight;\n\n this.chatInner.style.paddingTop = (padding - addedHeight) + 'px';\n\n //const newScrollTop = reverse ? scrollHeight - previousScrollHeightMinusTop : previousScrollHeightMinusTop;\n const newScrollTop = reverse ? scrollHeight - addedHeight - previousScrollHeightMinusTop : previousScrollHeightMinusTop;\n this.log('performHistoryResult: will set scrollTop',\n previousScrollHeightMinusTop, scrollHeight,\n newScrollTop, container.container.clientHeight); */\n // const newScrollTop = reverse ? scrollHeight - previousScrollHeightMinusTop : previousScrollHeightMinusTop;\n const newScrollTop = this.reverse ? scrollHeight - previousScrollHeightMinusTop : previousScrollHeightMinusTop;\n\n /* if(DEBUG) {\n this.log('performHistoryResult: will set up scrollTop:', newScrollTop, this.isHeavyAnimationInProgress);\n } */\n\n this.setScrollTop(newScrollTop, useReflow);\n\n /* if(DEBUG) {\n this.log('performHistoryResult: have set up scrollTop:', newScrollTop, container.scrollTop, container.scrollHeight, this.isHeavyAnimationInProgress);\n } */\n }\n}\n\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.ScrollSaver = ScrollSaver);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Scrollable from '../components/scrollable';\nimport safeAssign from './object/safeAssign';\n\nexport default class ScrollableLoader {\n public loading = false;\n private scrollable: Scrollable;\n private getPromise: () => Promise;\n private promise: Promise;\n private loaded = false;\n\n constructor(options: {\n scrollable: ScrollableLoader['scrollable'],\n getPromise: ScrollableLoader['getPromise']\n }) {\n safeAssign(this, options);\n\n options.scrollable.onScrolledBottom = () => {\n this.load();\n };\n }\n\n public load() {\n if(this.loaded) {\n return Promise.resolve();\n }\n\n if(this.loading) {\n return this.promise;\n }\n\n this.loading = true;\n this.promise = this.getPromise().then((done) => {\n this.loading = false;\n this.promise = undefined;\n\n if(done) {\n this.loaded = true;\n this.scrollable.onScrolledBottom = null;\n } else {\n this.scrollable.checkForTriggers();\n }\n }, () => {\n this.promise = undefined;\n this.loading = false;\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MediaSearchContext} from '../components/appMediaPlaybackController';\nimport type {SearchSuperContext} from '../components/appSearchSuper.';\nimport type {Message} from '../layer';\nimport type {MessagesStorageKey, MyMessage} from '../lib/appManagers/appMessagesManager';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport incrementMessageId from '../lib/appManagers/utils/messageId/incrementMessageId';\nimport rootScope from '../lib/rootScope';\nimport forEachReverse from './array/forEachReverse';\nimport filterChatPhotosMessages from './filterChatPhotosMessages';\nimport ListLoader, {ListLoaderOptions} from './listLoader';\n\nexport default class SearchListLoader extends ListLoader {\n public searchContext: MediaSearchContext;\n public onEmptied: () => void;\n\n private otherSideLoader: SearchListLoader;\n private managers: AppManagers;\n\n constructor(options: Omit, 'loadMore'> & {\n onEmptied?: () => void,\n isInner?: boolean,\n managers?: AppManagers\n } = {}) {\n super({\n ...options,\n loadMore: (anchor, older, loadCount) => {\n const backLimit = older ? 0 : loadCount;\n let maxId = anchor?.mid;\n\n if(maxId === undefined) maxId = this.searchContext.maxId;\n if(!older) maxId = incrementMessageId(maxId, 1);\n\n return this.managers.appMessagesManager.getSearch({\n ...this.searchContext,\n peerId: this.searchContext.peerId || anchor?.peerId,\n maxId,\n limit: backLimit ? 0 : loadCount,\n backLimit\n }).then((value) => {\n /* if(DEBUG) {\n this.log('loaded more media by maxId:', maxId, value, older, this.reverse);\n } */\n\n if(this.searchContext.inputFilter._ === 'inputMessagesFilterChatPhotos') {\n filterChatPhotosMessages(value);\n }\n\n if(value.next_rate) {\n this.searchContext.nextRate = value.next_rate;\n }\n\n return {count: value.count, items: value.history};\n });\n },\n processItem: async(message) => {\n const filtered = await this.filterMids([message.mid]);\n if(!filtered.length) {\n return;\n }\n\n return options.processItem(message);\n }\n });\n\n this.managers ??= rootScope.managers;\n rootScope.addEventListener('history_delete', this.onHistoryDelete);\n rootScope.addEventListener('history_multiappend', this.onHistoryMultiappend);\n rootScope.addEventListener('message_sent', this.onMessageSent);\n\n if(!options.isInner) {\n this.otherSideLoader = new SearchListLoader({\n ...options,\n isInner: true\n });\n\n // this.otherSideLoader.onLoadedMore = () => {\n\n // };\n }\n }\n\n protected async filterMids(mids: number[]) {\n const storageKey: MessagesStorageKey = `${this.searchContext.peerId}_${this.searchContext.isScheduled ? 'scheduled' : 'history'}`;\n const filtered = (await this.managers.appMessagesManager.filterMessagesByInputFilterFromStorage(this.searchContext.inputFilter._, mids, storageKey, mids.length)) as Message.message[];\n return filtered;\n }\n\n protected onHistoryDelete = ({peerId, msgs}: {peerId: PeerId, msgs: Set}) => {\n const shouldBeDeleted = (item: Item) => item.peerId === peerId && msgs.has(item.mid);\n const filter = (item: Item, idx: number, arr: Item[]) => {\n if(shouldBeDeleted(item)) {\n arr.splice(idx, 1);\n }\n };\n\n forEachReverse(this.previous, filter);\n forEachReverse(this.next, filter);\n\n if(this.current && shouldBeDeleted(this.current)) {\n this.current = undefined;\n /* if(this.go(1)) {\n this.previous.splice(this.previous.length - 1, 1);\n } else if(this.go(-1)) {\n this.next.splice(0, 1);\n } else */if(this.onEmptied) {\n this.onEmptied();\n }\n }\n };\n\n protected onHistoryMultiappend = async(message: Message.message | Message.messageService) => {\n if(this.searchContext.folderId !== undefined) {\n return;\n }\n\n // because it's reversed\n if(!this.loadedAllUp || this.loadPromiseUp) {\n return;\n }\n\n if(message.peerId !== this.searchContext.peerId) {\n return;\n }\n\n const filtered = await this.filterMids([message.mid]);\n const targets = (await Promise.all(filtered.map((message) => this.processItem(message)))).filter(Boolean);\n if(targets.length) {\n /* const {previous, current, next} = this;\n const targets = previous.concat(current, next);\n const currentIdx = targets.length;\n const mid = targets[0].mid;\n let i = 0, length = targets.length;\n for(; i < length; ++i) {\n const target = targets[i];\n if(!target || mid < target.mid) {\n break;\n }\n }\n\n if(i < currentIdx) previous.push(...targets);\n else next. */\n\n if(!this.current) {\n this.previous.push(...targets);\n } else {\n this.next.push(...targets);\n }\n }\n };\n\n protected onMessageSent = ({message}: {message: MyMessage}) => {\n this.onHistoryMultiappend(message);\n };\n\n public setSearchContext(context: SearchSuperContext) {\n this.searchContext = context;\n\n if(this.searchContext.folderId !== undefined) {\n this.loadedAllUp = true;\n\n if(this.searchContext.nextRate === undefined) {\n this.loadedAllDown = true;\n }\n }\n\n if(this.searchContext.inputFilter._ === 'inputMessagesFilterChatPhotos') {\n this.loadedAllUp = true;\n }\n\n if(this.searchContext.useSearch === false) {\n this.loadedAllDown = this.loadedAllUp = true;\n }\n\n if(this.otherSideLoader) {\n this.otherSideLoader.setSearchContext(context);\n }\n }\n\n public reset() {\n super.reset();\n this.searchContext = undefined;\n\n if(this.otherSideLoader) {\n this.otherSideLoader.reset();\n }\n }\n\n public getPrevious(withOtherSide?: boolean) {\n let previous = this.previous;\n\n if(this.otherSideLoader && withOtherSide) {\n previous = previous.concat(this.otherSideLoader.previous);\n }\n\n return previous;\n }\n\n public getNext(withOtherSide?: boolean) {\n let next = this.next;\n\n if(this.otherSideLoader && withOtherSide) {\n next = next.concat(this.otherSideLoader.next);\n }\n\n return next;\n }\n\n public getCurrent() {\n return this.current || this.otherSideLoader?.current;\n }\n\n private goToOtherEnd(length: number) {\n if(length > 0) return this.go(-this.previous.length);\n else return this.go(this.next.length);\n }\n\n public goRound(length: number, dispatchJump?: boolean) {\n let ret: ReturnType['goUnsafe']>;\n\n if(this.otherSideLoader?.current) {\n ret = this.otherSideLoader.goUnsafe(length, dispatchJump);\n if(ret.item) {\n return ret.item;\n }\n\n length = ret.leftLength;\n if(!(length > 0 ? this.otherSideLoader.next : this.otherSideLoader.previous).length) {\n const loaded = length > 0 ? this.otherSideLoader.loadedAllUp : this.otherSideLoader.loadedAllDown;\n if(!loaded) { // do not reset anything until it's loaded\n return;\n }\n\n // if other side is loaded too will start from its begin\n if((length > 0 && (this.otherSideLoader.searchContext.maxId === 1 || this.otherSideLoader.loadedAllDown)) ||\n (length < 0 && (this.otherSideLoader.searchContext.maxId === 0 || this.otherSideLoader.loadedAllUp))) {\n return this.otherSideLoader.goToOtherEnd(length);\n }\n\n this.otherSideLoader.unsetCurrent(length > 0);\n }\n }\n\n ret = this.goUnsafe(length, dispatchJump);\n if(!ret.item) {\n if(this.loadedAllUp && this.loadedAllDown) { // just use the same loader if the list is too short\n return this.goToOtherEnd(length);\n } else if(this.otherSideLoader) {\n length = ret.leftLength;\n ret = this.otherSideLoader.goUnsafe(length, dispatchJump);\n\n if(ret.item) {\n this.unsetCurrent(length > 0);\n }\n }\n }\n\n return ret?.item;\n }\n\n // public setTargets(previous: Item[], next: Item[], reverse: boolean) {\n // super.setTargets(previous, next, reverse);\n // }\n\n protected setLoaded(down: boolean, value: boolean) {\n const changed = super.setLoaded(down, value);\n\n if(changed &&\n this.otherSideLoader &&\n value &&\n this.searchContext?.useSearch !== false/* &&\n (this.reverse ? this.loadedAllUp : this.loadedAllDown) */) {\n const reverse = this.loadedAllUp;\n this.otherSideLoader.setSearchContext({\n ...this.searchContext,\n maxId: reverse ? 1 : 0\n });\n\n // these 'reverse' are different, not a mistake here.\n this.otherSideLoader.reverse = this.reverse;\n this.otherSideLoader.setLoaded(reverse, true);\n this.otherSideLoader.load(!reverse);\n }\n\n return changed;\n }\n\n public cleanup() {\n this.reset();\n rootScope.removeEventListener('history_delete', this.onHistoryDelete);\n rootScope.removeEventListener('history_multiappend', this.onHistoryMultiappend);\n rootScope.removeEventListener('message_sent', this.onMessageSent);\n this.onEmptied = undefined;\n\n if(this.otherSideLoader) {\n this.otherSideLoader.cleanup();\n this.otherSideLoader = undefined;\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport generateMessageId from './generateMessageId';\nimport getServerMessageId from './getServerMessageId';\n\nexport default function incrementMessageId(messageId: number, increment: number) {\n return generateMessageId(getServerMessageId(messageId) + increment);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {fastRaf} from './schedulers';\nimport deferredPromise, {CancellablePromise} from './cancellablePromise';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport isInDOM from './dom/isInDOM';\n\nclass SequentialDom {\n private promises: Partial<{\n read: CancellablePromise,\n write: CancellablePromise\n }> = {};\n private raf = fastRaf.bind(null);\n private scheduled = false;\n\n private do(kind: keyof SequentialDom['promises'], callback?: VoidFunction) {\n let promise = this.promises[kind];\n if(!promise) {\n this.scheduleFlush();\n promise = this.promises[kind] = deferredPromise();\n }\n\n if(callback !== undefined) {\n promise.then(() => callback());\n }\n\n return promise;\n }\n\n public measure(callback?: VoidFunction) {\n return this.do('read', callback);\n }\n\n public mutate(callback?: VoidFunction) {\n return this.do('write', callback);\n }\n\n /**\n * Will fire instantly if element is not connected\n * @param element\n * @param callback\n */\n public mutateElement(element: HTMLElement, callback?: VoidFunction) {\n const isConnected = isInDOM(element);\n const promise = isConnected ? this.mutate() : Promise.resolve();\n\n if(callback !== undefined) {\n if(!isConnected) {\n callback();\n } else {\n promise.then(() => callback());\n }\n }\n\n return promise;\n }\n\n private scheduleFlush() {\n if(!this.scheduled) {\n this.scheduled = true;\n\n this.raf(() => {\n this.promises.read && this.promises.read.resolve();\n this.promises.write && this.promises.write.resolve();\n\n this.scheduled = false;\n this.promises = {};\n });\n }\n }\n}\n\nconst sequentialDom = new SequentialDom();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.sequentialDom = sequentialDom);\nexport default sequentialDom;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {PhotoSize, WebDocument} from '../layer';\nimport {REPLIES_HIDDEN_CHANNEL_ID} from '../lib/mtproto/mtproto_config';\nimport {MyDocument} from '../lib/appManagers/appDocsManager';\nimport {MyPhoto} from '../lib/appManagers/appPhotosManager';\nimport choosePhotoSize from '../lib/appManagers/utils/photos/choosePhotoSize';\nimport {MediaSize, makeMediaSize} from './mediaSize';\nimport isWebDocument from '../lib/appManagers/utils/webDocs/isWebDocument';\n\nexport default function setAttachmentSize(\n photo: MyPhoto | MyDocument | WebDocument,\n element: HTMLElement | SVGForeignObjectElement,\n boxWidth: number,\n boxHeight: number,\n noZoom = true,\n message?: any,\n pushDocumentSize?: boolean,\n photoSize?: ReturnType\n) {\n const _isWebDocument = isWebDocument(photo);\n // if(_isWebDocument && pushDocumentSize === undefined) {\n // pushDocumentSize = true;\n // }\n\n if(!photoSize) {\n photoSize = choosePhotoSize(photo, boxWidth, boxHeight, undefined, pushDocumentSize);\n }\n // console.log('setAttachmentSize', photo, photo.sizes[0].bytes, div);\n\n let size: MediaSize;\n const isDocument = photo._ === 'document';\n if(isDocument || _isWebDocument) {\n size = makeMediaSize(photo.w || (photoSize as PhotoSize.photoSize).w || 512, photo.h || (photoSize as PhotoSize.photoSize).h || 512);\n } else {\n size = makeMediaSize((photoSize as PhotoSize.photoSize).w || 100, (photoSize as PhotoSize.photoSize).h || 100);\n }\n\n let boxSize = makeMediaSize(boxWidth, boxHeight);\n\n boxSize = size = size.aspect(boxSize, noZoom);\n\n let isFit = true;\n\n if(!isDocument || ['video', 'gif'].includes(photo.type) || _isWebDocument) {\n if(boxSize.width < 200 && boxSize.height < 200) { // make at least one side this big\n boxSize = size = size.aspectCovered(makeMediaSize(200, 200));\n }\n\n if(message &&\n (message.message ||\n message.reply_to_mid ||\n message.media.webpage ||\n (message.replies && message.replies.pFlags.comments && message.replies.channel_id.toChatId() !== REPLIES_HIDDEN_CHANNEL_ID)\n )\n ) { // make sure that bubble block is human-readable\n if(boxSize.width < 320) {\n boxSize = makeMediaSize(320, boxSize.height);\n isFit = false;\n }\n }\n\n if(isFit && boxSize.width < 120 && message) { // if image is too narrow\n boxSize = makeMediaSize(120, boxSize.height);\n isFit = false;\n }\n }\n\n // if(element instanceof SVGForeignObjectElement) {\n // element.setAttributeNS(null, 'width', '' + w);\n // element.setAttributeNS(null, 'height', '' + h);\n\n // //console.log('set dimensions to svg element:', element, w, h);\n // } else {\n element.style.width = boxSize.width + 'px';\n element.style.height = boxSize.height + 'px';\n // }\n\n return {photoSize, size, isFit};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {logger} from '../lib/logger';\nimport insertInDescendSortedArray from './array/insertInDescendSortedArray';\nimport {getMiddleware, MiddlewareHelper} from './middleware';\nimport middlewarePromise from './middlewarePromise';\nimport safeAssign from './object/safeAssign';\nimport pause from './schedulers/pause';\n\nexport type SortedElementBase = {\n id: T,\n index: number\n};\n\nlet id = 0;\n\nexport class BatchProcessor {\n protected queue: Promise[];\n protected promise: Promise;\n\n protected middlewareHelper: MiddlewareHelper;\n protected log: ReturnType;\n\n protected process: (batch: Item[], m: ReturnType, log: BatchProcessor['log']) => Promise;\n protected possibleError: any;\n\n constructor(options: {\n log?: BatchProcessor['log'],\n // middleware: MiddlewareHelper,\n process: BatchProcessor['process'],\n possibleError?: BatchProcessor['possibleError']\n }) {\n safeAssign(this, options);\n\n this.queue = [];\n this.middlewareHelper ??= getMiddleware();\n\n const prefix = 'BATCH-PROCESSOR-' + ++id;\n if(this.log) {\n this.log = this.log.bindPrefix(prefix);\n } else {\n this.log = logger(prefix);\n }\n }\n\n public get queuePromise() {\n return this.promise;\n }\n\n public clear() {\n this.log('clear');\n this.queue.length = 0;\n this.promise = undefined;\n this.middlewareHelper.clean();\n }\n\n public addToQueue(item: BatchProcessor['queue'][0]) {\n this.queue.push(item);\n return this.setQueue();\n }\n\n protected setQueue() {\n if(!this.queue.length) {\n return Promise.resolve();\n }\n\n if(this.promise) {\n return this.promise;\n }\n\n const middleware = this.middlewareHelper.get();\n const log = this.log.bindPrefix('queue');\n const m = middlewarePromise(middleware, this.possibleError);\n\n const processQueue = async(): Promise => {\n log('start', this.queue.length);\n\n const queue = this.queue.splice(0, this.queue.length);\n\n const perf = performance.now();\n const promises = queue.map((promise) => {\n promise.then((details) => {\n log('render item time', performance.now() - perf, details);\n });\n\n return promise;\n });\n\n const renderedQueue = await m(Promise.all(promises));\n await m(this.process(renderedQueue, m, log));\n\n log('queue rendered');\n\n if(this.queue.length) {\n log('have new items to render');\n return processQueue();\n } else {\n log('end');\n }\n };\n\n log('setting pause');\n const promise = this.promise = m(pause(0))\n .then(\n () => processQueue().catch((err: ApiError) => {\n if(err !== this.possibleError) {\n log.error('process queue error', err);\n }\n\n throw err;\n }),\n (err) => {\n log('pause has been cleared');\n throw err;\n }\n )\n .finally(() => {\n if(this.promise === promise) {\n this.promise = undefined;\n }\n });\n\n return promise;\n }\n}\n\nexport default class SortedList {\n protected elements: Map;\n protected sorted: Array;\n\n protected getIndex: (element: SortedElement) => PromiseLike | number;\n protected onDelete: (element: SortedElement) => void;\n protected onUpdate: (element: SortedElement) => void;\n protected onSort: (element: SortedElement, idx: number) => void;\n protected onElementCreate: (base: SortedElementBase) => PromiseLike | SortedElement;\n\n protected updateElementWith = (callback: () => void) => callback();\n protected updateListWith = (callback: (canUpdate: boolean | undefined) => void) => callback(true);\n\n protected middleware: MiddlewareHelper;\n\n protected batchProcessor: BatchProcessor;\n\n protected log: ReturnType;\n\n constructor(options: {\n getIndex: SortedList['getIndex'],\n onDelete?: SortedList['onDelete'],\n onUpdate?: SortedList['onUpdate'],\n onSort?: SortedList['onSort'],\n onElementCreate: SortedList['onElementCreate'],\n\n updateElementWith?: SortedList['updateElementWith'],\n updateListWith?: SortedList['updateListWith'],\n\n log?: SortedList['log']\n }) {\n safeAssign(this, options);\n\n this.elements = new Map();\n this.sorted = [];\n this.middleware = getMiddleware();\n\n this.batchProcessor = new BatchProcessor({\n log: this.log,\n process: async(batch, m, log) => {\n // const elements = await Promise.all(batch.map((element) => this.onElementCreate(element)));\n const elements = batch;\n const promises = elements.map((element) => this.update(element.id, element));\n await m(Promise.all(promises));\n }\n });\n }\n\n public clear() {\n this.batchProcessor.clear();\n this.middleware.clean();\n this.elements.clear();\n this.sorted.length = 0;\n }\n\n protected _updateList() {\n this.elements.forEach((element) => {\n this.update(element.id);\n });\n\n if(this.onSort) {\n this.sorted.forEach((element, idx) => {\n this.onSort(element, idx);\n });\n }\n }\n\n public updateList(callback?: (updated: boolean) => void) {\n const middleware = this.middleware.get();\n this.updateListWith((canUpdate) => {\n if(!middleware() || (canUpdate !== undefined && !canUpdate)) {\n callback?.(false);\n return;\n }\n\n this._updateList();\n\n callback?.(true);\n });\n }\n\n public has(id: SortedElementId) {\n return this.elements.has(id);\n }\n\n public get(id: SortedElementId) {\n return this.elements.get(id);\n }\n\n public getAll() {\n return this.elements;\n }\n\n public async add(id: SortedElementId) {\n const element = this.get(id);\n if(element) {\n return;\n // return element;\n }\n\n const base: SortedElementBase = {\n id,\n index: 0\n };\n\n this.elements.set(id, base as SortedElement);\n const createPromise = Promise.resolve(this.onElementCreate(base));\n return this.batchProcessor.addToQueue(createPromise);\n\n // return element;\n }\n\n public delete(id: SortedElementId, noScheduler?: boolean) {\n const element = this.elements.get(id);\n if(!element) {\n return false;\n }\n\n this.elements.delete(id);\n\n const idx = this.sorted.indexOf(element);\n if(idx !== -1) {\n this.sorted.splice(idx, 1);\n }\n\n if(this.onDelete) {\n if(noScheduler) {\n this.onDelete(element);\n } else {\n const middleware = this.middleware.get();\n this.updateElementWith(() => {\n if(!middleware()) {\n return;\n }\n\n this.onDelete(element);\n });\n }\n }\n\n return true;\n }\n\n public async update(id: SortedElementId, element = this.get(id)) {\n if(!element) {\n return;\n }\n\n element.index = await this.getIndex(element);\n if(this.get(id) !== element) {\n return;\n }\n\n this.onUpdate?.(element);\n\n const idx = insertInDescendSortedArray(this.sorted, element, 'index');\n this.onSort(element, idx);\n }\n}\n","const BOM = '';\n// const BOM = 'K';\nexport default BOM;\n","export default function encodeEntities(value: string) {\n return value.replace(/&/g, '&').replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, (value) => {\n const hi = value.charCodeAt(0);\n const low = value.charCodeAt(1);\n return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';\n }).replace(/([^\\#-~| |!])/g, (value) => { // non-alphanumeric\n return '&#' + value.charCodeAt(0) + ';';\n }).replace(//g, '>');\n}\n","// credits to https://github.com/sindresorhus/escape-string-regexp/blob/master/index.js\nexport default function escapeRegExp(str: string) {\n return str\n .replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n .replace(/-/g, '\\\\x2d');\n}\n","export default function limitSymbols(str: string, length: number, limitFrom = length + 10) {\n str = str.trim();\n if(str.length > limitFrom) {\n str = str.slice(0, length)/* .replace(/\\s*$/, '') */ + '...';\n }\n\n return str;\n}\n","const NBSP = '‎';\nexport default NBSP;\n","export default function toHHMMSS(str: string | number, leadZero = false) {\n const sec_num = parseInt(str + '', 10);\n const hours = Math.floor(sec_num / 3600);\n let minutes: any = Math.floor((sec_num - (hours * 3600)) / 60);\n let seconds: any = sec_num - (hours * 3600) - (minutes * 60);\n\n if(hours) leadZero = true;\n if(minutes < 10) minutes = leadZero ? '0' + minutes : minutes;\n if(seconds < 10) seconds = '0' + seconds;\n return (hours ? /* ('0' + hours).slice(-2) */hours + ':' : '') + minutes + ':' + seconds;\n}\n","export default function textToSvgURL(text: string) {\n const blob = new Blob([text], {type: 'image/svg+xml;charset=utf-8'});\n\n // * because iOS Safari doesn't want to eat objectURL\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.onload = (e) => {\n resolve(e.target.result as string);\n };\n reader.readAsDataURL(blob);\n });\n // return URL.createObjectURL(blob);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport {IS_WORKER} from './context';\n\nexport class WindowSize {\n public width: number;\n public height: number;\n\n constructor() {\n if(IS_WORKER) {\n return;\n }\n\n const w = 'visualViewport' in window ? window.visualViewport : window;\n const set = () => {\n this.width = w.width || (w as any as Window).innerWidth;\n this.height = w.height || (w as any as Window).innerHeight;\n };\n w.addEventListener('resize', set);\n set();\n }\n}\n\nconst windowSize = new WindowSize();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.windowSize = windowSize);\nexport default windowSize;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// * Jolly Cobra's useHeavyAnimationCheck.ts, patched\n\nimport {AnyToVoidFunction} from '../types';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport deferredPromise, {CancellablePromise} from '../helpers/cancellablePromise';\nimport DEBUG from '../config/debug';\nimport pause from '../helpers/schedulers/pause';\nimport EventListenerBase from '../helpers/eventListenerBase';\n\nconst eventListener = new EventListenerBase<{\n start: () => void,\n end: () => void\n}>();\nconst ANIMATION_START_EVENT = 'start';\nconst ANIMATION_END_EVENT = 'end';\n\nlet isAnimating = false;\nlet heavyAnimationPromise: CancellablePromise = deferredPromise();\nlet promisesInQueue = 0;\n\nheavyAnimationPromise.resolve();\n\nconst log = console.log.bind(console.log, '[HEAVY-ANIMATION]:');\n\nexport function dispatchHeavyAnimationEvent(promise: Promise, timeout?: number) {\n if(!isAnimating) {\n heavyAnimationPromise = deferredPromise();\n eventListener.dispatchEvent(ANIMATION_START_EVENT);\n isAnimating = true;\n DEBUG && log('start');\n }\n\n ++promisesInQueue;\n DEBUG && log('attach promise, length:', promisesInQueue, timeout);\n\n const promises = [\n timeout !== undefined ? pause(timeout) : undefined,\n promise.finally(() => {})\n ].filter(Boolean);\n\n const perf = performance.now();\n const _heavyAnimationPromise = heavyAnimationPromise;\n Promise.race(promises).then(() => {\n if(heavyAnimationPromise !== _heavyAnimationPromise || heavyAnimationPromise.isFulfilled) { // interrupted\n return;\n }\n\n --promisesInQueue;\n DEBUG && log('promise end, length:', promisesInQueue, performance.now() - perf);\n if(promisesInQueue <= 0) {\n onHeavyAnimationEnd();\n }\n });\n\n return heavyAnimationPromise;\n}\n\n(window as any).dispatchHeavyAnimationEvent = dispatchHeavyAnimationEvent;\n\nfunction onHeavyAnimationEnd() {\n if(heavyAnimationPromise.isFulfilled) {\n return;\n }\n\n isAnimating = false;\n promisesInQueue = 0;\n eventListener.dispatchEvent(ANIMATION_END_EVENT);\n heavyAnimationPromise.resolve();\n\n DEBUG && log('end');\n}\n\nexport function interruptHeavyAnimation() {\n onHeavyAnimationEnd();\n}\n\nexport function getHeavyAnimationPromise() {\n return heavyAnimationPromise;\n}\n\nexport default function(\n handleAnimationStart: AnyToVoidFunction,\n handleAnimationEnd: AnyToVoidFunction,\n listenerSetter?: ListenerSetter\n) {\n // useEffect(() => {\n if(isAnimating) {\n handleAnimationStart();\n }\n\n const add = listenerSetter ? listenerSetter.add(eventListener) : eventListener.addEventListener.bind(eventListener);\n const remove = listenerSetter ? listenerSetter.removeManual.bind(listenerSetter, eventListener) : eventListener.removeEventListener.bind(eventListener);\n add(ANIMATION_START_EVENT, handleAnimationStart);\n add(ANIMATION_END_EVENT, handleAnimationEnd);\n\n return () => {\n remove(ANIMATION_END_EVENT, handleAnimationEnd);\n remove(ANIMATION_START_EVENT, handleAnimationStart);\n };\n // }, [handleAnimationEnd, handleAnimationStart]);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Dialog} from '../lib/appManagers/appMessagesManager';\nimport type {ForumTopic} from '../layer';\nimport appDialogsManager, {DIALOG_LIST_ELEMENT_TAG} from '../lib/appManagers/appDialogsManager';\nimport rootScope from '../lib/rootScope';\nimport {ButtonMenuItemOptionsVerifiable, ButtonMenuSync} from './buttonMenu';\nimport PopupDeleteDialog from './popups/deleteDialog';\nimport {i18n, LangPackKey, _i18n} from '../lib/langPack';\nimport findUpTag from '../helpers/dom/findUpTag';\nimport {toastNew} from './toast';\nimport PopupMute from './popups/mute';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport {GENERAL_TOPIC_ID} from '../lib/mtproto/mtproto_config';\nimport showLimitPopup from './popups/limit';\nimport createContextMenu from '../helpers/dom/createContextMenu';\n\nexport default class DialogsContextMenu {\n private buttons: ButtonMenuItemOptionsVerifiable[];\n\n private peerId: PeerId;\n private filterId: number;\n private threadId: number;\n private dialog: Dialog | ForumTopic.forumTopic;\n private canManageTopics: boolean;\n private li: HTMLElement;\n\n constructor(private managers: AppManagers) {\n\n }\n\n public attach(element: HTMLElement) {\n createContextMenu({\n listenTo: element,\n buttons: this.getButtons(),\n appendTo: document.getElementById('page-chats'),\n onOpen: async(li) => {\n this.li = li;\n li.classList.add('menu-open');\n this.peerId = li.dataset.peerId.toPeerId();\n this.threadId = +li.dataset.threadId || undefined;\n this.dialog = await this.managers.dialogsStorage.getDialogOrTopic(this.peerId, this.threadId);\n this.filterId = this.threadId ? undefined : appDialogsManager.filterId;\n this.canManageTopics = this.threadId ? await this.managers.appChatsManager.hasRights(this.peerId.toChatId(), 'manage_topics') : undefined;\n },\n onBeforeOpen: async() => {\n // delete button\n const langPackKey: LangPackKey = this.threadId ? 'Delete' : await this.managers.appPeersManager.getDeleteButtonText(this.peerId);\n const lastButton = this.buttons[this.buttons.length - 1];\n if(lastButton?.element) {\n lastButton.element.lastChild.replaceWith(i18n(langPackKey));\n }\n },\n onClose: () => {\n this.li.classList.remove('menu-open');\n this.li = this.peerId = this.dialog = this.filterId = this.threadId = this.canManageTopics = undefined;\n },\n findElement: (e) => {\n return findUpTag(e.target, DIALOG_LIST_ELEMENT_TAG);\n }\n });\n }\n\n private getButtons() {\n return this.buttons ??= [{\n icon: 'unread',\n text: 'MarkAsUnread',\n onClick: this.onUnreadClick,\n verify: async() => !this.threadId && !(await this.managers.appMessagesManager.isDialogUnread(this.dialog))\n }, {\n icon: 'readchats',\n text: 'MarkAsRead',\n onClick: this.onUnreadClick,\n verify: () => this.managers.appMessagesManager.isDialogUnread(this.dialog)\n }, {\n icon: 'pin',\n text: 'ChatList.Context.Pin',\n onClick: this.onPinClick,\n verify: async() => {\n if(this.threadId && !this.canManageTopics) {\n return false;\n }\n\n const isPinned = this.filterId !== undefined && this.filterId > 1 ?\n (await this.managers.appMessagesManager.getFilter(this.filterId)).pinnedPeerIds.includes(this.dialog.peerId) :\n !!this.dialog.pFlags?.pinned;\n return !isPinned;\n }\n }, {\n icon: 'unpin',\n text: 'ChatList.Context.Unpin',\n onClick: this.onPinClick,\n verify: async() => {\n if(this.threadId && !this.canManageTopics) {\n return false;\n }\n\n const isPinned = this.filterId !== undefined && this.filterId > 1 ?\n (await this.managers.appMessagesManager.getFilter(this.filterId)).pinnedPeerIds.includes(this.dialog.peerId) :\n !!this.dialog.pFlags?.pinned;\n return isPinned;\n }\n }, {\n icon: 'mute',\n text: 'ChatList.Context.Mute',\n onClick: this.onMuteClick,\n verify: async() => {\n return this.peerId !== rootScope.myId && !(await this.managers.appNotificationsManager.isPeerLocalMuted({peerId: this.dialog.peerId, threadId: this.threadId}));\n }\n }, {\n icon: 'unmute',\n text: 'ChatList.Context.Unmute',\n onClick: this.onUnmuteClick,\n verify: async() => {\n return this.peerId !== rootScope.myId && (await this.managers.appNotificationsManager.isPeerLocalMuted({peerId: this.dialog.peerId, threadId: this.threadId}));\n }\n }, {\n icon: 'archive',\n text: 'Archive',\n onClick: this.onArchiveClick,\n verify: () => this.filterId === 0 && this.peerId !== rootScope.myId\n }, {\n icon: 'unarchive',\n text: 'Unarchive',\n onClick: this.onArchiveClick,\n verify: () => this.filterId === 1 && this.peerId !== rootScope.myId\n }, {\n icon: 'hide',\n text: 'Hide',\n onClick: this.onHideTopicClick,\n verify: () => {\n return this.canManageTopics && (this.dialog as ForumTopic.forumTopic).id === GENERAL_TOPIC_ID;\n }\n }, {\n icon: 'lock',\n text: 'CloseTopic',\n onClick: this.onToggleTopicClick,\n verify: () => {\n return this.canManageTopics && !(this.dialog as ForumTopic.forumTopic).pFlags.closed;\n }\n }, {\n icon: 'lockoff',\n text: 'RestartTopic',\n onClick: this.onToggleTopicClick,\n verify: () => {\n return this.canManageTopics && !!(this.dialog as ForumTopic.forumTopic).pFlags.closed;\n }\n }, {\n icon: 'delete danger',\n text: 'Delete',\n onClick: this.onDeleteClick,\n verify: () => {\n if(this.threadId) {\n if(!this.canManageTopics) {\n return false;\n }\n\n return (this.dialog as ForumTopic.forumTopic).id !== GENERAL_TOPIC_ID;\n }\n\n return true;\n }\n }];\n }\n\n private onArchiveClick = async() => {\n const dialog = await this.managers.appMessagesManager.getDialogOnly(this.peerId);\n if(dialog) {\n this.managers.appMessagesManager.editPeerFolders([dialog.peerId], +!dialog.folder_id);\n }\n };\n\n private onHideTopicClick = () => {\n this.managers.appChatsManager.editForumTopic({\n chatId: this.peerId.toChatId(),\n topicId: this.threadId,\n hidden: true\n });\n };\n\n private onToggleTopicClick = () => {\n this.managers.appChatsManager.editForumTopic({\n chatId: this.peerId.toChatId(),\n topicId: this.threadId,\n closed: !(this.dialog as ForumTopic.forumTopic).pFlags.closed\n });\n };\n\n private onPinClick = () => {\n const {peerId, filterId, threadId} = this;\n this.managers.appMessagesManager.toggleDialogPin({\n peerId,\n filterId,\n topicId: threadId\n }).catch(async(err: ApiError) => {\n if(err.type === 'PINNED_DIALOGS_TOO_MUCH' || err.type === 'PINNED_TOO_MUCH') {\n if(threadId) {\n this.managers.apiManager.getLimit('topicPin').then((limit) => {\n toastNew({langPackKey: 'LimitReachedPinnedTopics', langPackArguments: [limit]});\n });\n } else if(filterId >= 1) {\n toastNew({langPackKey: 'PinFolderLimitReached'});\n } else {\n showLimitPopup('pin');\n }\n }\n });\n };\n\n private onUnmuteClick = () => {\n this.managers.appMessagesManager.togglePeerMute({peerId: this.peerId, mute: false, threadId: this.threadId});\n };\n\n private onMuteClick = () => {\n new PopupMute(this.peerId, this.threadId);\n };\n\n private onUnreadClick = async() => {\n const {peerId, dialog} = this;\n if(dialog.unread_count) {\n this.managers.appMessagesManager.readHistory(peerId, dialog.top_message, this.threadId);\n\n if(!this.threadId) {\n this.managers.appMessagesManager.markDialogUnread(peerId, true);\n }\n } else if(!this.threadId) {\n this.managers.appMessagesManager.markDialogUnread(peerId);\n }\n };\n\n private onDeleteClick = () => {\n new PopupDeleteDialog(this.peerId, undefined, undefined, this.threadId);\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport App from '../config/app';\nimport DEBUG from '../config/debug';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport {LangPackKey, i18n} from '../lib/langPack';\nimport {logger} from '../lib/logger';\nimport rootScope from '../lib/rootScope';\nimport Button from './button';\nimport ProgressivePreloader from './preloader';\nimport SetTransition from './singleTransition';\nimport sessionStorage from '../lib/sessionStorage';\nimport {ConnectionStatus} from '../lib/mtproto/connectionStatus';\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport singleInstance from '../lib/mtproto/singleInstance';\n\nexport default class ConnectionStatusComponent {\n public static CHANGE_STATE_DELAY = 1000;\n\n private statusContainer: HTMLElement;\n private statusEl: HTMLElement;\n private statusPreloader: ProgressivePreloader;\n\n private currentLangPackKey: LangPackKey;\n\n private hadConnect = false;\n private retryAt: number;\n private connecting = false;\n private timedOut = false;\n private updating = false;\n\n private log: ReturnType;\n\n private setFirstConnectionTimeout: number;\n private setStateTimeout: number;\n\n constructor(private managers: AppManagers, chatsContainer: HTMLElement) {\n this.log = logger('CS', undefined, undefined);\n\n this.statusContainer = document.createElement('div');\n this.statusContainer.classList.add('connection-status'/* , 'hide' */);\n\n this.statusEl = Button('btn-primary bg-warning connection-status-button', {noRipple: true});\n this.statusPreloader = new ProgressivePreloader({cancelable: false});\n this.statusPreloader.constructContainer({color: 'transparent', bold: true});\n this.statusContainer.append(this.statusEl);\n\n chatsContainer.prepend(this.statusContainer);\n\n rootScope.addEventListener('connection_status_change', (status) => {\n // console.log(status);\n\n this.setConnectionStatus();\n });\n\n rootScope.addEventListener('state_synchronizing', (channelId) => {\n if(!channelId) {\n this.updating = true;\n DEBUG && this.log('updating', this.updating);\n this.setState();\n }\n });\n\n rootScope.addEventListener('state_synchronized', (channelId) => {\n DEBUG && this.log('state_synchronized', channelId);\n if(!channelId) {\n this.updating = false;\n DEBUG && this.log('updating', this.updating);\n this.setState();\n }\n });\n\n this.setFirstConnectionTimeout = window.setTimeout(this.setConnectionStatus, ConnectionStatusComponent.CHANGE_STATE_DELAY + 1e3);\n\n // let bool = true;\n // document.addEventListener('dblclick', () => {\n // this.setConnectionStatus(bool ? (bool = false, ConnectionStatus.Closed) : (bool = true, ConnectionStatus.Connected));\n // });\n }\n\n private setConnectionStatus = (overrideStatus?: ConnectionStatus) => {\n Promise.all([\n sessionStorage.get('dc'),\n rootScope.managers.rootScope.getConnectionStatus()\n ]).then(([baseDcId, connectionStatus]) => {\n if(!baseDcId) {\n baseDcId = App.baseDcId;\n }\n\n if(this.setFirstConnectionTimeout) {\n clearTimeout(this.setFirstConnectionTimeout);\n this.setFirstConnectionTimeout = 0;\n }\n\n const status = connectionStatus['NET-' + baseDcId];\n const online = status && (overrideStatus || status.status) === ConnectionStatus.Connected;\n\n if(this.connecting && online) {\n this.managers.apiUpdatesManager.forceGetDifference();\n }\n\n if(online && !this.hadConnect) {\n this.hadConnect = true;\n }\n\n this.timedOut = status && (overrideStatus || status.status) === ConnectionStatus.TimedOut;\n this.connecting = !online;\n this.retryAt = status && status.retryAt;\n DEBUG && this.log('connecting', this.connecting);\n this.setState();\n });\n };\n\n private setStatusText = (langPackKey: LangPackKey, args?: any[]) => {\n if(this.currentLangPackKey === langPackKey) return;\n this.currentLangPackKey = langPackKey;\n replaceContent(this.statusEl, i18n(langPackKey, args));\n this.statusPreloader.attach(this.statusEl);\n };\n\n private getA(langPackKey: LangPackKey, callback: () => void) {\n const a = document.createElement('a');\n a.classList.add('force-reconnect');\n a.append(i18n(langPackKey));\n attachClickEvent(a, (e) => {\n cancelEvent(e);\n callback();\n });\n\n return a;\n }\n\n private setState = () => {\n if(singleInstance.deactivatedReason) {\n return;\n }\n\n const timeout = ConnectionStatusComponent.CHANGE_STATE_DELAY;\n if(this.connecting) {\n if(this.timedOut) {\n const a = this.getA('ConnectionStatus.ForceReconnect', () => this.managers.networkerFactory.forceReconnect());\n this.setStatusText('ConnectionStatus.TimedOut', [a]);\n } else if(this.hadConnect) {\n if(this.retryAt !== undefined) {\n const timerSpan = document.createElement('span');\n const retryAt = this.retryAt;\n const setTime = () => {\n const now = Date.now();\n timerSpan.innerText = '' + Math.max(0, Math.round((retryAt - now) / 1000));\n if(now > retryAt) {\n clearInterval(interval);\n }\n };\n const interval = setInterval(setTime, 1e3);\n setTime();\n\n const a = this.getA('ConnectionStatus.Reconnect', () => this.managers.networkerFactory.forceReconnectTimeout());\n this.setStatusText('ConnectionStatus.ReconnectIn', [timerSpan, a]);\n } else {\n this.setStatusText('ConnectionStatus.Reconnecting');\n }\n } else {\n this.setStatusText('ConnectionStatus.Waiting');\n }\n } else if(this.updating) {\n this.setStatusText('Updating');\n }\n\n DEBUG && this.log('setState', this.connecting || this.updating);\n window.requestAnimationFrame(() => {\n if(this.setStateTimeout) clearTimeout(this.setStateTimeout);\n\n const cb = () => {\n SetTransition({\n element: this.statusContainer,\n className: 'is-shown',\n forwards: this.connecting || this.updating,\n duration: 200\n });\n this.setStateTimeout = 0;\n DEBUG && this.log('setState: isShown:', this.connecting || this.updating);\n };\n\n this.setStateTimeout = window.setTimeout(cb, timeout);\n // cb();\n /* if(timeout) this.setStateTimeout = window.setTimeout(cb, timeout);\n else cb(); */\n });\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Message} from '../layer';\n/* import findUpClassName from \"../helpers/dom/findUpClassName\";\nimport rootScope from \"../lib/rootScope\";\nimport Transition from \"./transition\"; */\n\nexport enum SENDING_STATUS {\n Error = -1,\n Pending,\n Sent,\n Read\n}\n\nexport function getSendingStatus(message: Message.message | Message.messageService) {\n return message.pFlags.is_outgoing ?\n SENDING_STATUS.Pending : (\n message.pFlags.unread ?\n SENDING_STATUS.Sent :\n SENDING_STATUS.Read\n );\n}\n\ntype C = 'check' | 'checks' | 'sending' | 'sendingerror' | 'premium_lock';\nexport function setSendingStatus(\n container: HTMLElement,\n message?: C | Message.message | Message.messageService,\n disableAnimationIfRippleFound?: boolean\n) {\n let className: C;\n if(typeof(message) === 'string') {\n className = message;\n } else if(message?.pFlags.out) {\n if(message.error) {\n className = 'sendingerror';\n } else if(message.pFlags.is_outgoing) {\n className = 'sending';\n } else if(message.pFlags.unread) {\n className = 'check';\n } else {\n className = 'checks';\n }\n }\n\n if(!className) {\n container.textContent = '';\n return;\n }\n\n const iconClassName = 'tgico-' + className;\n const lastElement = container.lastElementChild as HTMLElement;\n if(lastElement && lastElement.classList.contains(iconClassName)) {\n return;\n }\n\n const element = document.createElement('i');\n element.classList.add('sending-status-icon', /* 'transition-item', */ iconClassName);\n container.append(element);\n\n if(lastElement) {\n lastElement.remove();\n }\n\n /* if(!lastElement) {\n element.classList.add('active');\n return;\n }\n\n const select = Transition(container, undefined, 350, () => {\n lastElement.remove();\n }, false, true, false);\n\n let animate = rootScope.settings.animationsEnabled && className !== 'sending' && !lastElement.classList.contains('tgico-sending');\n if(disableAnimationIfRippleFound && animate) {\n const parent = findUpClassName(container, 'rp');\n if(parent.querySelector('.c-ripple__circle') || parent.matches(':hover')) {\n animate = false;\n }\n }\n\n select(element, animate, lastElement); */\n\n /* SetTransition(lastElement, 'is-visible', false, 350, () => {\n // lastElement.remove();\n }, 2);\n SetTransition(element, 'is-visible', true, 350, undefined, 2); */\n}\n","// https://spicyyoghurt.com/tools/easing-functions\nexport default function easeInOutSine(t: number, b: number, c: number, d: number) {\n return t >= d ? b + c : easeInOutSineApply(t / d, c) + b;\n}\n\nexport function easeInOutSineApply(v: number, c: number) {\n return -c / 2 * (Math.cos(Math.PI * v) - 1);\n}\n","export default function roundRect(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n width: number,\n height: number,\n radius: {[k in 'tl' | 'tr' | 'br' | 'bl']?: number} | number,\n fill?: boolean,\n stroke?: boolean\n) {\n const dpr = ctx.canvas.dpr;\n if(dpr) {\n x *= dpr;\n y *= dpr;\n width *= dpr;\n height *= dpr;\n }\n\n if(typeof(radius) === 'number') {\n if(dpr) radius *= dpr;\n radius = {tl: radius, tr: radius, br: radius, bl: radius};\n } else {\n const defaultRadius = {tl: 0, tr: 0, br: 0, bl: 0};\n for(const side in defaultRadius) {\n // @ts-ignore\n radius[side] = radius[side] ? (dpr ? radius[side] * dpr : radius[side]) : defaultRadius[side];\n }\n }\n\n ctx.beginPath();\n ctx.moveTo(x + radius.tl, y);\n ctx.lineTo(x + width - radius.tr, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + radius.tr);\n ctx.lineTo(x + width, y + height - radius.br);\n ctx.quadraticCurveTo(x + width, y + height, x + width - radius.br, y + height);\n ctx.lineTo(x + radius.bl, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - radius.bl);\n ctx.lineTo(x, y + radius.tl);\n ctx.quadraticCurveTo(x, y, x + radius.tl, y);\n ctx.closePath();\n\n if(fill) {\n ctx.fill();\n }\n\n if(stroke) {\n ctx.stroke();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {animate} from '../helpers/animation';\nimport customProperties from '../helpers/dom/customProperties';\nimport easeInOutSine from '../helpers/easing/easeInOutSine';\nimport mediaSizes from '../helpers/mediaSizes';\nimport roundRect from '../helpers/canvas/roundRect';\n\nconst DPR = window.devicePixelRatio;\nconst SIZE = 20 * DPR;\nconst MARGIN = 2.5 * DPR;\nconst WIDTH = 2 * DPR;\nconst RADIUS = 1 * DPR;\nconst LENGTH = 3;\n\nconst MIN_HEIGHT = 4;\nconst MAX_HEIGHT = 12;\nconst DURATION = 1000;\n\nexport default function groupCallActiveIcon(isActive = false) {\n const canvas = document.createElement('canvas');\n canvas.width = canvas.height = SIZE;\n const context = canvas.getContext('2d');\n\n const TOTAL_WIDTH = LENGTH * WIDTH + (LENGTH - 1) * MARGIN;\n const START_X = (SIZE - TOTAL_WIDTH) / 2;\n\n const startTime = Date.now();\n let wasMounted = false;\n // let hadRound = false;\n const renderFrame = () => {\n if(!canvas.isConnected) {\n if(wasMounted) {\n return false;\n }\n } else if(!wasMounted) {\n wasMounted = canvas.isConnected;\n }\n\n const time = Date.now();\n // if(((time - startTime) / DURATION) >= 1) {\n // hadRound = true;\n // }\n\n const progress = easeInOutSine((time - startTime) % DURATION, 0, 1, DURATION);\n\n context.clearRect(0, 0, SIZE, SIZE);\n context.fillStyle = isActive && !mediaSizes.isMobile ? customProperties.getProperty('primary-color') : '#fff';\n\n for(let i = 0; i < LENGTH; ++i) {\n const x = START_X + (i * WIDTH) + (i * MARGIN);\n\n let itemProgress: number;\n if(progress >= .5) {\n itemProgress = i % 2 ? 2 - progress * 2 : (progress - .5) * 2;\n } else {\n itemProgress = i % 2 ? progress * 2 : 1 - progress * 2;\n }\n\n let height = MIN_HEIGHT + (itemProgress * (MAX_HEIGHT - MIN_HEIGHT));\n /* if(!hadRound && i === 1) {\n console.log('call status animation', itemProgress, height, progress, progress >= .5);\n } */\n\n height *= DPR;\n const y = (SIZE - height) / 2;\n\n roundRect(context, x, y, WIDTH, height, RADIUS, true);\n }\n\n return true;\n };\n\n return {\n canvas,\n startAnimation: () => {\n animate(renderFrame);\n renderFrame();\n },\n setActive: (active: boolean) => {\n isActive = active;\n renderFrame();\n }\n };\n}\n","import customProperties from '../dom/customProperties';\nimport clamp from '../number/clamp';\n\nexport default class Shimmer {\n private canvas: HTMLCanvasElement;\n private ctx: CanvasRenderingContext2D;\n private font = '30pt Helvetica';\n private currTime = Date.now();\n private diffTime = 0;\n private spread = 0;\n private paused = false;\n private pausedTime = 0;\n private pauseInterval = 850;\n private lightSource = 0;\n private inc = 0.032;\n private lightSpread = 0.55;\n private animations = ['slide', 'slide', 'slide', 'slide'];\n private currentAnimationIndex = 0;\n private text: string;\n private fillStyle: CanvasRenderingContext2D['fillStyle'];\n\n private keepTime() {\n this.diffTime = Date.now() - this.currTime;\n this.currTime = Date.now();\n }\n\n private cycleAnimation() {\n ++this.currentAnimationIndex;\n if(this.currentAnimationIndex >= this.animations.length) {\n this.currentAnimationIndex = 0;\n }\n }\n\n private animate() {\n const currentAnimation = this.animations[this.currentAnimationIndex];\n if(currentAnimation === 'glow') {\n return this.animateGlow(); // return glow style\n } else if(currentAnimation === 'slide') {\n return this.animateSlide(); // return slide gradient\n } else {\n console.log('unknown animation type: ' + String(currentAnimation));\n }\n }\n\n private animateGlow() {\n var glowEnd = 255,\n rgbStart = 68,\n r = rgbStart,\n g = r,\n b = r,\n increment = 10,\n interval = 800;\n\n return () => {\n var smartInc = increment * (this.diffTime / (1000 / 60));\n if(this.paused) {\n if((Date.now() - this.pausedTime) > interval) {\n r = rgbStart;\n this.cycleAnimation()\n this.paused = false;\n }\n } else {\n r = parseInt('' + (r + smartInc));\n if(r >= glowEnd) {\n this.paused = true;\n this.pausedTime = Date.now()\n }\n }\n return 'rgb('+ r + ',' + r + ',' + r + ')';\n };\n }\n\n private animateSlide(): CanvasGradient {\n var gradient = this.ctx.createLinearGradient(0, 0, this.canvas.width, 0),\n smartInc = this.inc * (this.diffTime / (1000 / 60)),\n lightLeft,\n lightRight,\n lightCenter;\n if(this.paused) {\n if((Date.now() - this.pausedTime) > this.pauseInterval) {\n this.lightSource = -0.6;\n this.cycleAnimation()\n this.paused = false;\n return this.animateSlide();\n }\n } else {\n this.lightSource += smartInc;\n if(this.lightSource > (1 + this.lightSpread)) {\n this.paused = true;\n this.pausedTime = Date.now();\n }\n }\n // lighting positions:\n lightCenter = clamp(this.lightSource, 0, 1);\n lightLeft = clamp(this.lightSource - this.lightSpread, 0, 1);\n lightRight = clamp(this.lightSource + this.lightSpread, 0, 1);\n\n const backgroundColor = customProperties.getProperty('background-color-true');\n const shimmerColor = customProperties.getProperty('surface-color');\n gradient.addColorStop(lightLeft, backgroundColor);\n gradient.addColorStop(lightCenter, shimmerColor);\n gradient.addColorStop(lightRight, backgroundColor);\n\n return gradient;\n }\n\n public settings(dict: Partial<{\n canvas: Shimmer['canvas'],\n fillStyle: Shimmer['fillStyle'],\n font: Shimmer['font'],\n lightSpread: Shimmer['lightSpread'],\n inc: Shimmer['inc'],\n animations: Shimmer['animations'],\n text: Shimmer['text']\n }> = {}) {\n this.canvas = dict.canvas ?? document.createElement('canvas');\n this.ctx = this.canvas.getContext('2d');\n this.font = dict.font ?? this.font;\n this.lightSpread = dict.lightSpread ?? this.lightSpread;\n this.inc = dict.inc ?? this.inc;\n this.animations = dict.animations ?? this.animations;\n this.text = dict.text ?? this.text;\n this.fillStyle = dict.fillStyle;\n\n this.canvas.classList.add('shimmer-canvas');\n }\n\n public on() {\n const {width, height} = this.canvas;\n // record the time we ran:\n this.keepTime();\n // clear and fill the canvas:\n this.ctx.clearRect(0, 0, width, height);\n\n if(this.font) {\n this.ctx.font = this.font;\n }\n\n this.ctx.fillStyle = this.animate() as any;\n this.ctx.fillRect(0, 0, width, height);\n\n if(this.fillStyle) {\n this.ctx.fillStyle = this.fillStyle;\n this.ctx.fillRect(0, 0, width, height);\n }\n\n if(this.text) {\n this.ctx.fillText(this.text, 50, 50);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Scrollable from '../components/scrollable';\nimport rootScope from '../lib/rootScope';\nimport {animate} from './animation';\nimport {drawCircleFromStart} from './canvas/drawCircle';\nimport roundRect from './canvas/roundRect';\nimport Shimmer from './canvas/shimmer';\nimport customProperties from './dom/customProperties';\nimport easeInOutSine from './easing/easeInOutSine';\nimport liteMode from './liteMode';\nimport mediaSizes from './mediaSizes';\n\nexport default class DialogsPlaceholder {\n private canvas: HTMLCanvasElement;\n private ctx: CanvasRenderingContext2D;\n private shimmer: Shimmer;\n private tempId: number;\n private detachTime: number;\n\n private length: number;\n private dialogHeight: number;\n private availableLength: number;\n\n private avatarSize: number;\n private marginVertical: number;\n private totalHeight: number;\n private lineHeight: number;\n private lineBorderRadius: number;\n private lineMarginVertical: number;\n private statusWidth: number;\n private generatedValues: {\n firstLineWidth: number,\n secondLineWidth: number,\n statusWidth: number\n }[];\n\n private getRectFrom: () => DOMRectEditable;\n private onRemove: () => void;\n private blockScrollable: Scrollable;\n\n constructor(sizes: Partial<{\n avatarSize: number,\n marginVertical: number,\n totalHeight: number\n }> = {}) {\n this.shimmer = new Shimmer();\n this.tempId = 0;\n this.canvas = document.createElement('canvas');\n this.canvas.classList.add('dialogs-placeholder-canvas');\n this.ctx = this.canvas.getContext('2d');\n\n this.generatedValues = [];\n this.avatarSize = sizes.avatarSize ?? 54;\n this.marginVertical = sizes.marginVertical ?? 9;\n this.totalHeight = sizes.totalHeight ?? (this.avatarSize + this.marginVertical * 2);\n this.lineHeight = 10;\n this.lineBorderRadius = 6;\n this.lineMarginVertical = 8;\n this.statusWidth = 24;\n }\n\n public attach({container, rect, getRectFrom, onRemove, blockScrollable}: {\n container: HTMLElement,\n rect?: ReturnType,\n getRectFrom?: HTMLElement | DialogsPlaceholder['getRectFrom'],\n onRemove?: DialogsPlaceholder['onRemove'],\n blockScrollable?: DialogsPlaceholder['blockScrollable']\n }) {\n const {canvas} = this;\n\n this.onRemove = onRemove;\n this.getRectFrom = typeof(getRectFrom) === 'function' ? getRectFrom : (getRectFrom || container).getBoundingClientRect.bind(getRectFrom || container);\n if(this.blockScrollable = blockScrollable) {\n blockScrollable.container.style.overflowY = 'hidden';\n }\n\n this.updateCanvasSize(rect);\n this.startAnimation();\n container.append(canvas);\n }\n\n public detach(availableLength: number) {\n if(this.detachTime) {\n return;\n }\n\n this.availableLength = availableLength;\n this.detachTime = Date.now();\n\n if(!liteMode.isAvailable('animations')) {\n this.remove();\n }\n }\n\n public remove() {\n this.stopAnimation();\n\n if(this.canvas.parentElement) {\n this.canvas.remove();\n\n if(this.blockScrollable) {\n this.blockScrollable.container.style.overflowY = '';\n this.blockScrollable = undefined;\n }\n }\n\n this.onRemove?.();\n this.onRemove = undefined;\n }\n\n private updateCanvasSize(rect = this.getRectFrom()) {\n const {canvas} = this;\n const dpr = canvas.dpr = window.devicePixelRatio;\n canvas.width = rect.width * dpr;\n canvas.height = rect.height * dpr;\n canvas.style.width = rect.width + 'px';\n canvas.style.height = rect.height + 'px';\n }\n\n private renderDetachAnimationFrame() {\n const {\n canvas,\n ctx,\n detachTime,\n length,\n availableLength\n } = this;\n\n if(!detachTime) {\n return;\n } else if(!liteMode.isAvailable('animations')) {\n this.remove();\n return;\n }\n\n const {width} = canvas;\n\n ctx.globalCompositeOperation = 'destination-out';\n\n // ctx.fillStyle = 'rgba(0, 0, 0, 0)';\n // ctx.fillRect(0, 0, width, height);\n\n // const DURATION = 500;\n // const DELAY = DURATION;\n const DURATION = 150;\n const DELAY = 15;\n const elapsedTime = Date.now() - detachTime;\n let completed = true;\n for(let i = 0; i < length; ++i) {\n const delay = availableLength < length && i >= availableLength ? DELAY * (availableLength - 1) : DELAY * i;\n const elapsedRowTime = elapsedTime - delay;\n if(elapsedRowTime <= 0) {\n completed = false;\n continue;\n }\n\n const progress = easeInOutSine(elapsedRowTime, 0, 1, DURATION);\n\n ctx.beginPath();\n ctx.rect(0, this.dialogHeight * i, width, this.dialogHeight);\n ctx.fillStyle = `rgba(0, 0, 0, ${progress})`;\n ctx.fill();\n\n if(progress < 1) {\n completed = false;\n }\n }\n\n // const totalRadius = Math.sqrt(width ** 2 + height ** 2);\n // const gradient = ctx.createRadialGradient(\n // 0, 0, 0,\n // 0, 0, totalRadius);\n // gradient.addColorStop(0, 'rgba(0, 0, 0, 1)');\n // gradient.addColorStop(progress, 'rgba(0, 0, 0, 0)');\n // gradient.addColorStop(1, 'rgba(0, 0, 0, 0)');\n\n // const gradient = ctx.createLinearGradient(0, 0, 0, height);\n // gradient.addColorStop(0, 'rgba(0, 0, 0, 1)');\n // gradient.addColorStop(progress, 'rgba(0, 0, 0, 0)');\n // gradient.addColorStop(1, 'rgba(0, 0, 0, 0)');\n\n // ctx.fillStyle = gradient;\n // ctx.fillRect(0, 0, width, height);\n\n ctx.globalCompositeOperation = 'source-over';\n\n if(completed) {\n this.remove();\n }\n }\n\n private renderFrame() {\n this.shimmer.on();\n this.renderDetachAnimationFrame();\n }\n\n private startAnimation() {\n const {canvas, shimmer} = this;\n const tempId = ++this.tempId;\n const pattern = this.createPattern();\n\n shimmer.settings({\n canvas,\n fillStyle: pattern\n });\n\n const middleware = () => {\n return this.tempId === tempId;\n };\n\n this.renderFrame();\n animate(() => {\n if(!middleware()) {\n return false;\n }\n\n // ! should've removed the loop if animations are disabled\n if(liteMode.isAvailable('animations')) {\n this.renderFrame();\n }\n\n // ! tempId can be changed during renderFrame\n return middleware();\n });\n\n rootScope.addEventListener('theme_change', this.onThemeChange);\n mediaSizes.addEventListener('resize', this.onResize);\n }\n\n private stopAnimation() {\n ++this.tempId;\n rootScope.removeEventListener('theme_change', this.onThemeChange);\n mediaSizes.removeEventListener('resize', this.onResize);\n }\n\n private onThemeChange = () => {\n this.stopAnimation();\n this.startAnimation();\n };\n\n private onResize = () => {\n const {canvas} = this;\n const {width, height, dpr} = canvas;\n this.updateCanvasSize();\n if(canvas.width === width && canvas.height === height && canvas.dpr === dpr) {\n return;\n }\n\n this.stopAnimation();\n this.startAnimation();\n };\n\n private createPattern() {\n const {canvas, ctx} = this;\n\n const patternCanvas = document.createElement('canvas');\n const patternContext = patternCanvas.getContext('2d');\n const dpr = canvas.dpr;\n patternCanvas.dpr = dpr;\n patternCanvas.width = canvas.width;\n patternCanvas.height = canvas.height;\n\n patternContext.fillStyle = customProperties.getProperty('surface-color');\n patternContext.fillRect(0, 0, patternCanvas.width, patternCanvas.height);\n\n patternContext.fillStyle = '#000';\n patternContext.globalCompositeOperation = 'destination-out';\n\n const dialogHeight = this.dialogHeight = this.totalHeight * dpr;\n const length = this.length = Math.ceil(canvas.height / dialogHeight);\n for(let i = 0; i < length; ++i) {\n this.drawChat(patternContext, i, i * dialogHeight);\n }\n\n return ctx.createPattern(patternCanvas, 'no-repeat');\n }\n\n private drawChat(ctx: CanvasRenderingContext2D, i: number, y: number) {\n let generatedValues = this.generatedValues[i];\n if(!generatedValues) {\n generatedValues = this.generatedValues[i] = {\n firstLineWidth: 40 + Math.random() * 100, // 120\n secondLineWidth: 120 + Math.random() * 130, // 240\n statusWidth: 24 + Math.random() * 16\n };\n }\n\n const {\n firstLineWidth,\n secondLineWidth,\n statusWidth\n } = generatedValues;\n\n const {canvas} = ctx;\n const {dpr} = canvas;\n y /= dpr;\n\n const {\n avatarSize,\n marginVertical,\n lineHeight,\n lineBorderRadius,\n lineMarginVertical\n } = this;\n\n let marginLeft = 17;\n\n if(avatarSize) {\n drawCircleFromStart(ctx, marginLeft, y + marginVertical, avatarSize / 2, true);\n marginLeft += avatarSize + 10;\n }\n\n // 9 + 54 - 10 - 8 = 45 ........ 72 - 9 - 10 - 8\n roundRect(ctx, marginLeft, y + marginVertical + lineMarginVertical, firstLineWidth, lineHeight, lineBorderRadius, true);\n // roundRect(ctx, marginLeft, y + marginVertical + avatarSize - lineHeight - lineMarginVertical, secondLineWidth, lineHeight, lineBorderRadius, true);\n roundRect(ctx, marginLeft, y + this.totalHeight - marginVertical - lineHeight - lineMarginVertical, secondLineWidth, lineHeight, lineBorderRadius, true);\n\n roundRect(ctx, canvas.width / dpr - 24 - statusWidth, y + marginVertical + lineMarginVertical, statusWidth, lineHeight, lineBorderRadius, true);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDialogFilter as DialogFilter, MyDialogFilter} from '../storages/filters';\nimport type LazyLoadQueue from '../../components/lazyLoadQueue';\nimport type {Dialog, ForumTopic, MyMessage} from './appMessagesManager';\nimport type {MyPhoto} from './appPhotosManager';\nimport type {MyDocument} from './appDocsManager';\nimport type {State} from '../../config/state';\nimport AvatarElement from '../../components/avatar';\nimport DialogsContextMenu from '../../components/dialogsContextMenu';\nimport {horizontalMenu} from '../../components/horizontalMenu';\nimport ripple from '../../components/ripple';\nimport Scrollable, {ScrollableX, SliceSides} from '../../components/scrollable';\nimport {formatDateAccordingToTodayNew} from '../../helpers/date';\nimport {IS_MOBILE_SAFARI, IS_SAFARI} from '../../environment/userAgent';\nimport {logger, LogTypes} from '../logger';\nimport rootScope from '../rootScope';\nimport appImManager, {AppImManager, APP_TABS} from './appImManager';\nimport Button from '../../components/button';\nimport SetTransition from '../../components/singleTransition';\nimport {MyDraftMessage} from './appDraftsManager';\nimport DEBUG, {MOUNT_CLASS_TO} from '../../config/debug';\nimport PeerTitle from '../../components/peerTitle';\nimport I18n, {FormatterArguments, i18n, LangPackKey, _i18n} from '../langPack';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport lottieLoader from '../rlottie/lottieLoader';\nimport wrapPhoto from '../../components/wrappers/photo';\nimport AppEditFolderTab from '../../components/sidebarLeft/tabs/editFolder';\nimport appSidebarLeft from '../../components/sidebarLeft';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport positionElementByIndex from '../../helpers/dom/positionElementByIndex';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport ConnectionStatusComponent from '../../components/connectionStatus';\nimport {renderImageFromUrlPromise} from '../../helpers/dom/renderImageFromUrl';\nimport {fastRafConventional, fastRafPromise} from '../../helpers/schedulers';\nimport SortedUserList from '../../components/sortedUserList';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport handleTabSwipe from '../../helpers/dom/handleTabSwipe';\nimport windowSize from '../../helpers/windowSize';\nimport isInDOM from '../../helpers/dom/isInDOM';\nimport {setSendingStatus} from '../../components/sendingStatus';\nimport SortedList, {SortedElementBase} from '../../helpers/sortedList';\nimport debounce from '../../helpers/schedulers/debounce';\nimport {FOLDER_ID_ALL, FOLDER_ID_ARCHIVE, NULL_PEER_ID, REAL_FOLDERS, REAL_FOLDER_ID} from '../mtproto/mtproto_config';\nimport groupCallActiveIcon from '../../components/groupCallActiveIcon';\nimport {Chat, Message, NotifyPeer} from '../../layer';\nimport IS_GROUP_CALL_SUPPORTED from '../../environment/groupCallSupport';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport appNavigationController, {NavigationItem} from '../../components/appNavigationController';\nimport appMediaPlaybackController from '../../components/appMediaPlaybackController';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport {AppManagers} from './managers';\nimport appSidebarRight from '../../components/sidebarRight';\nimport PopupElement from '../../components/popups';\nimport choosePhotoSize from './utils/photos/choosePhotoSize';\nimport wrapEmojiText from '../richTextProcessor/wrapEmojiText';\nimport wrapMessageForReply from '../../components/wrappers/messageForReply';\nimport isMessageRestricted from './utils/messages/isMessageRestricted';\nimport getMediaFromMessage from './utils/messages/getMediaFromMessage';\nimport getMessageSenderPeerIdOrName from './utils/messages/getMessageSenderPeerIdOrName';\nimport wrapStickerEmoji from '../../components/wrappers/stickerEmoji';\nimport getDialogIndexKey from './utils/dialogs/getDialogIndexKey';\nimport getProxiedManagers from './getProxiedManagers';\nimport getDialogIndex from './utils/dialogs/getDialogIndex';\nimport {attachContextMenuListener} from '../../helpers/dom/attachContextMenuListener';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport wrapPeerTitle from '../../components/wrappers/peerTitle';\nimport middlewarePromise from '../../helpers/middlewarePromise';\nimport appDownloadManager from './appDownloadManager';\nimport groupCallsController from '../calls/groupCallsController';\nimport callsController from '../calls/callsController';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport noop from '../../helpers/noop';\nimport DialogsPlaceholder from '../../helpers/dialogsPlaceholder';\nimport pause from '../../helpers/schedulers/pause';\nimport apiManagerProxy from '../mtproto/mtprotoworker';\nimport filterAsync from '../../helpers/array/filterAsync';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport whichChild from '../../helpers/dom/whichChild';\nimport {getMiddleware, MiddlewareHelper} from '../../helpers/middleware';\nimport makeError from '../../helpers/makeError';\nimport getUnsafeRandomInt from '../../helpers/number/getUnsafeRandomInt';\nimport Row, {RowMediaSizeType} from '../../components/row'\nimport SettingSection from '../../components/settingSection';\nimport {SliderSuperTabEventable} from '../../components/sliderTab';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport {AckedResult} from '../mtproto/superMessagePort';\nimport ButtonMenuToggle from '../../components/buttonMenuToggle';\nimport getMessageThreadId from './utils/messages/getMessageThreadId';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport formatNumber from '../../helpers/number/formatNumber';\nimport AppSharedMediaTab from '../../components/sidebarRight/tabs/sharedMedia';\nimport {dispatchHeavyAnimationEvent} from '../../hooks/useHeavyAnimationCheck';\nimport AppArchivedTab from '../../components/sidebarLeft/tabs/archivedTab';\nimport shake from '../../helpers/dom/shake';\nimport AppEditTopicTab from '../../components/sidebarRight/tabs/editTopic';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\n\nexport const DIALOG_LIST_ELEMENT_TAG = 'A';\n\nexport type DialogDom = {\n avatarEl: AvatarElement,\n captionDiv: HTMLElement,\n titleSpan: HTMLSpanElement,\n titleSpanContainer: HTMLSpanElement,\n statusSpan: HTMLSpanElement,\n lastTimeSpan: HTMLSpanElement,\n unreadBadge?: HTMLElement,\n unreadAvatarBadge?: HTMLElement,\n callIcon?: ReturnType,\n mentionsBadge?: HTMLElement,\n lastMessageSpan: HTMLSpanElement,\n containerEl: HTMLElement,\n listEl: HTMLElement,\n subtitleEl: HTMLElement,\n\n setLastMessagePromise?: CancellablePromise,\n setUnreadMessagePromise?: CancellablePromise\n};\n\ninterface SortedDialog extends SortedElementBase {\n dom: DialogDom,\n dialogElement: DialogElement\n}\n\nfunction setPromiseMiddleware}, K extends keyof T>(obj: T, key: K) {\n const oldPromise: CancellablePromise = obj[key] as any;\n oldPromise?.reject();\n\n // @ts-ignore\n const deferred = obj[key] = deferredPromise();\n deferred.catch(() => {}).finally(() => {\n if((obj[key] as any) === deferred) {\n delete obj[key];\n }\n });\n\n const middleware = middlewarePromise(() => (obj[key] as any) === deferred);\n return {deferred, middleware};\n}\n\nconst BADGE_SIZE = 22;\nconst BADGE_TRANSITION_TIME = 250;\n\nclass SortedDialogList extends SortedList {\n public managers: AppManagers;\n public log: ReturnType;\n public list: HTMLElement;\n public indexKey: ReturnType;\n public onListLengthChange: () => void;\n public forumPeerId: PeerId;\n\n constructor(options: {\n managers: SortedDialogList['managers'],\n log?: SortedDialogList['log'],\n list: SortedDialogList['list'],\n indexKey: SortedDialogList['indexKey'],\n onListLengthChange?: SortedDialogList['onListLengthChange'],\n forumPeerId?: SortedDialogList['forumPeerId']\n }) {\n super({\n getIndex: (element) => this.managers.dialogsStorage.getDialogIndex(this.forumPeerId ?? element.id, this.indexKey, this.forumPeerId ? element.id : undefined),\n onDelete: (element) => {\n element.dom.listEl.remove();\n this.onListLengthChange?.();\n },\n onSort: (element, idx) => {\n const willChangeLength = element.dom.listEl.parentElement !== this.list;\n positionElementByIndex(element.dom.listEl, this.list, idx);\n\n if(willChangeLength) {\n this.onListLengthChange?.();\n }\n },\n onElementCreate: async(base) => {\n const loadPromises: Promise[] = [];\n\n const dialogElement = appDialogsManager.addListDialog({\n peerId: this.forumPeerId ?? base.id,\n loadPromises,\n isBatch: true,\n threadId: this.forumPeerId ? base.id : undefined,\n isMainList: this.indexKey === 'index_0'\n });\n (base as SortedDialog).dom = dialogElement.dom;\n (base as SortedDialog).dialogElement = dialogElement;\n\n await Promise.all(loadPromises);\n return base as SortedDialog;\n },\n updateElementWith: fastRafConventional,\n log: options.log\n });\n\n safeAssign(this, options);\n }\n\n public clear() {\n this.list.replaceChildren();\n super.clear();\n }\n}\n\nexport type DialogElementSize = RowMediaSizeType;\ntype DialogElementOptions = {\n peerId: PeerId,\n rippleEnabled?: boolean,\n onlyFirstName?: boolean,\n meAsSaved?: boolean,\n avatarSize?: RowMediaSizeType,\n autonomous?: boolean,\n loadPromises?: Promise[],\n fromName?: string,\n noIcons?: boolean,\n threadId?: number,\n wrapOptions?: WrapSomethingOptions,\n isMainList?: boolean\n};\nexport class DialogElement extends Row {\n public dom: DialogDom;\n\n constructor({\n peerId,\n rippleEnabled = true,\n onlyFirstName = false,\n meAsSaved = true,\n avatarSize = 'bigger',\n autonomous,\n loadPromises,\n fromName,\n noIcons,\n threadId,\n wrapOptions = {},\n isMainList\n }: DialogElementOptions) {\n super({\n clickable: true,\n noRipple: !rippleEnabled,\n havePadding: !threadId,\n title: true,\n titleRightSecondary: true,\n subtitle: true,\n subtitleRight: true,\n noWrap: true,\n asLink: true\n });\n\n this.subtitleRight.remove();\n\n const avatarEl = threadId ? undefined : new AvatarElement();\n if(avatarEl) {\n const avatarSizeMap: {[k in DialogElementSize]?: number} = {\n bigger: 54,\n abitbigger: 42,\n small: 32\n };\n const s = avatarSizeMap[avatarSize];\n avatarEl.classList.add('dialog-avatar', 'avatar-' + s);\n avatarEl.updateWithOptions({\n loadPromises,\n lazyLoadQueue: wrapOptions.lazyLoadQueue,\n isDialog: !!meAsSaved,\n peerId,\n peerTitle: fromName\n });\n\n this.applyMediaElement(avatarEl, avatarSize);\n }\n\n const captionDiv = this.container;\n\n const titleSpanContainer = this.title;\n titleSpanContainer.classList.add('user-title');\n\n this.titleRow.classList.add('dialog-title');\n\n const peerTitle = new PeerTitle();\n const peerTitlePromise = peerTitle.update({\n peerId,\n fromName,\n dialog: meAsSaved,\n onlyFirstName,\n withIcons: !noIcons,\n threadId: threadId\n });\n\n loadPromises?.push(peerTitlePromise);\n titleSpanContainer.append(peerTitle.element);\n\n // for muted icon\n titleSpanContainer.classList.add('tgico'); // * эта строка будет актуальна только для !container, но ладно\n\n // const titleIconsPromise = generateTitleIcons(peerId).then((elements) => {\n // titleSpanContainer.append(...elements);\n // });\n\n // if(loadPromises) {\n // loadPromises.push(titleIconsPromise);\n // }\n // }\n\n const span = this.subtitle;\n // span.classList.add('user-last-message');\n\n const li = this.container;\n li.classList.add('chatlist-chat', 'chatlist-chat-' + avatarSize);\n if(!autonomous) {\n (li as HTMLAnchorElement).href = '#' + peerId;\n }\n // if(rippleEnabled) {\n // ripple(li);\n // }\n\n if(avatarSize === 'bigger') {\n this.container.classList.add('row-big');\n } else if(avatarSize === 'small') {\n this.container.classList.add('row-small');\n }\n\n li.dataset.peerId = '' + peerId;\n if(threadId) {\n li.dataset.threadId = '' + threadId;\n }\n\n const statusSpan = document.createElement('span');\n statusSpan.classList.add('message-status', 'sending-status'/* , 'transition', 'reveal' */);\n\n const lastTimeSpan = document.createElement('span');\n lastTimeSpan.classList.add('message-time');\n\n const rightSpan = this.titleRight;\n rightSpan.classList.add('dialog-title-details');\n rightSpan.append(statusSpan, lastTimeSpan);\n\n this.subtitleRow.classList.add('dialog-subtitle');\n\n const dom: DialogDom = this.dom = {\n avatarEl,\n captionDiv,\n titleSpan: peerTitle.element,\n titleSpanContainer,\n statusSpan,\n lastTimeSpan,\n lastMessageSpan: span,\n containerEl: li,\n listEl: li,\n subtitleEl: this.subtitleRow\n };\n\n if(!autonomous) {\n (li as any).dialogDom = dom;\n\n const chat = appImManager.chat;\n if(chat && appImManager.isSamePeer(chat, {peerId, threadId: threadId, type: 'chat'})) {\n appDialogsManager.setDialogActive(li, true);\n }\n\n if(isMainList && appDialogsManager.forumTab?.peerId === peerId && !threadId) {\n li.classList.add('is-forum-open');\n }\n }\n }\n\n public createUnreadBadge() {\n if(this.dom.unreadBadge) return;\n const badge = this.dom.unreadBadge = document.createElement('div');\n badge.className = `dialog-subtitle-badge badge badge-${BADGE_SIZE}`;\n this.dom.subtitleEl.append(badge);\n }\n\n public createUnreadAvatarBadge() {\n if(this.dom.unreadAvatarBadge) return;\n const badge = this.dom.unreadAvatarBadge = document.createElement('div');\n badge.className = `dialog-subtitle-badge badge badge-${BADGE_SIZE} avatar-badge`;\n this.dom.listEl.append(badge);\n }\n\n public createMentionsBadge() {\n if(this.dom.mentionsBadge) return;\n const badge = this.dom.mentionsBadge = document.createElement('div');\n badge.className = `dialog-subtitle-badge badge badge-${BADGE_SIZE} mention mention-badge`;\n badge.innerText = '@';\n this.dom.lastMessageSpan.after(badge);\n }\n\n public toggleBadgeByKey(\n key: Extract,\n hasBadge: boolean,\n justCreated: boolean,\n batch?: boolean\n ) {\n SetTransition({\n element: this.dom[key],\n className: 'is-visible',\n forwards: hasBadge,\n duration: batch ? 0 : BADGE_TRANSITION_TIME,\n onTransitionEnd: hasBadge ? undefined : () => {\n this.dom[key].remove();\n delete this.dom[key];\n },\n useRafs: !justCreated || !isInDOM(this.dom[key]) ? 2 : 0\n });\n }\n}\n\nclass ForumTab extends SliderSuperTabEventable {\n private rows: HTMLElement;\n private subtitle: HTMLElement;\n\n public peerId: PeerId;\n private firstTime: boolean;\n\n private log: ReturnType;\n\n private xd: Some3;\n\n public async toggle(value: boolean) {\n if(this.init2) {\n await this.init2();\n }\n\n SetTransition({\n element: this.container,\n className: 'is-visible',\n forwards: value,\n duration: 300,\n onTransitionEnd: !value ? () => {\n this.onCloseAfterTimeout();\n } : undefined,\n useRafs: this.firstTime ? (this.firstTime = undefined, 2) : undefined\n });\n }\n\n public init(options: {\n peerId: PeerId,\n managers: AppManagers\n }) {\n safeAssign(this, options);\n\n this.log = logger('FORUM');\n this.firstTime = true;\n this.container.classList.add('topics-container');\n\n const isFloating = !this.slider;\n if(isFloating) {\n this.closeBtn.classList.replace('tgico-left', 'tgico-close');\n this.container.classList.add('active', 'is-floating');\n\n attachClickEvent(this.closeBtn, () => {\n appDialogsManager.toggleForumTab(undefined, this);\n }, {listenerSetter: this.listenerSetter});\n }\n\n this.rows = document.createElement('div');\n this.rows.classList.add('sidebar-header__rows');\n\n this.subtitle = document.createElement('div');\n this.subtitle.classList.add('sidebar-header__subtitle');\n\n this.title.replaceWith(this.rows);\n this.rows.append(this.title, this.subtitle);\n\n const list = appDialogsManager.createChatList();\n appDialogsManager.setListClickListener(list, null, true);\n this.scrollable.append(list);\n\n this.xd = new Some3(this.peerId, isFloating ? 80 : 0);\n this.xd.scrollable = this.scrollable;\n this.xd.sortedList = new SortedDialogList({\n managers: this.managers,\n log: this.log,\n list,\n indexKey: 'index_0',\n forumPeerId: this.peerId\n });\n this.xd.bindScrollable();\n\n const getOptionsForMessages = (): Parameters[0] => {\n return {\n peerId: this.peerId,\n type: 'chat'\n };\n };\n\n const btnMenu = ButtonMenuToggle({\n listenerSetter: this.listenerSetter,\n direction: 'bottom-left',\n buttons: [{\n icon: 'info',\n text: 'ForumTopic.Context.Info',\n onClick: async() => {\n const tab = appSidebarLeft.createTab(AppSharedMediaTab, true);\n tab.isFirst = true;\n tab.setPeer(this.peerId);\n (await tab.fillProfileElements())();\n tab.loadSidebarMedia(true);\n tab.open();\n }\n }, {\n icon: 'message',\n text: 'ForumTopic.Context.ShowAsMessages',\n onClick: () => {\n const chat = appImManager.chat;\n appImManager[chat?.peerId === this.peerId ? 'setPeer' : 'setInnerPeer'](getOptionsForMessages());\n },\n verify: () => {\n const chat = appImManager.chat;\n return !chat || !appImManager.isSamePeer(chat, getOptionsForMessages());\n }\n }, {\n icon: 'adduser',\n text: 'ForumTopic.Context.AddMember',\n onClick: () => {},\n verify: () => false && this.managers.appChatsManager.hasRights(this.peerId.toChatId(), 'invite_users')\n }, {\n icon: 'add',\n text: 'ForumTopic.Context.New',\n onClick: () => {\n appSidebarLeft.createTab(AppEditTopicTab).open(this.peerId);\n },\n separator: true,\n verify: () => this.managers.appChatsManager.hasRights(this.peerId.toChatId(), 'manage_topics')\n }]\n });\n\n this.listenerSetter.add(rootScope)('history_reload', (peerId) => {\n if(this.peerId !== peerId) {\n return;\n }\n\n this.xd.fullReset();\n });\n\n this.listenerSetter.add(rootScope)('chat_update', async(chatId) => {\n if(this.peerId !== chatId.toPeerId(true)) {\n return;\n }\n\n const chat = await this.managers.appChatsManager.getChat(chatId);\n if(!(chat as Chat.channel).pFlags.forum) {\n appDialogsManager.toggleForumTab(undefined, this);\n }\n });\n\n if(IS_TOUCH_SUPPORTED) {\n handleTabSwipe({\n element: this.container,\n onSwipe: () => {\n appDialogsManager.toggleForumTab(undefined, this);\n },\n middleware: this.middlewareHelper.get()\n });\n }\n\n this.header.append(btnMenu);\n\n if(!isFloating) {\n return this.init2();\n }\n }\n\n public async init2() {\n this.init2 = undefined;\n\n const middleware = this.middlewareHelper.get();\n const peerId = this.peerId;\n\n this.managers.apiUpdatesManager.subscribeToChannelUpdates(this.peerId.toChatId());\n middleware.onDestroy(() => {\n this.managers.apiUpdatesManager.unsubscribeFromChannelUpdates(this.peerId.toChatId());\n });\n\n const peerTitlePromise = wrapPeerTitle({\n peerId,\n dialog: true,\n wrapOptions: {middleware}\n });\n\n const setStatusPromise = appImManager.setPeerStatus({\n peerId,\n element: this.subtitle,\n needClear: true,\n useWhitespace: false,\n middleware,\n noTyping: true\n });\n\n // this.managers.dialogsStorage.getForumTopics(this.peerId).then((messagesForumTopics) => {\n // console.log(messagesForumTopics);\n\n // const promises = messagesForumTopics.topics.map((forumTopic) => {\n // return this.sortedDialogList.add(forumTopic.id);\n // });\n\n // return Promise.all(promises);\n // }).then(() => {\n // this.dialogsPlaceholder.detach(this.sortedDialogList.getAll().size);\n // });\n\n return Promise.all([\n peerTitlePromise,\n setStatusPromise,\n this.xd.onChatsScroll().then((loadResult) => {\n return loadResult.cached ? loadResult.renderPromise : undefined\n })\n ]).then(([\n peerTitle,\n setStatus,\n _\n ]) => {\n if(!middleware()) {\n return;\n }\n\n this.title.append(peerTitle);\n setStatus?.();\n });\n }\n\n public onCloseAfterTimeout() {\n super.onCloseAfterTimeout();\n this.xd.destroy();\n }\n}\n\nconst NOT_IMPLEMENTED_ERROR = new Error('not implemented');\n\ntype DialogKey = Parameters[0];\nclass Some {\n public sortedList: SortedDialogList;\n public scrollable: Scrollable;\n public loadedDialogsAtLeastOnce: boolean;\n public needPlaceholderAtFirstTime: boolean;\n protected offsets: {top: number, bottom: number};\n protected indexKey: ReturnType;\n protected sliceTimeout: number;\n protected managers: AppManagers;\n protected listenerSetter: ListenerSetter;\n protected loadDialogsPromise: Promise<{cached: boolean, renderPromise: Some2['loadDialogsRenderPromise']}>;\n protected loadDialogsRenderPromise: Promise;\n protected placeholder: DialogsPlaceholder;\n protected log: ReturnType;\n protected placeholderOptions: ConstructorParameters[0];\n\n constructor() {\n this.log = logger('CL');\n this.offsets = {top: 0, bottom: 0};\n this.managers = rootScope.managers;\n this.listenerSetter = new ListenerSetter();\n }\n\n public getOffsetIndex(side: 'top' | 'bottom') {\n return {index: this.scrollable.loadedAll[side] ? 0 : this.offsets[side]};\n }\n\n protected isDialogMustBeInViewport(dialog: T) {\n // return true;\n const topOffset = this.getOffsetIndex('top');\n const bottomOffset = this.getOffsetIndex('bottom');\n\n if(!topOffset.index && !bottomOffset.index) {\n return true;\n }\n\n const index = getDialogIndex(dialog, this.indexKey);\n return (!topOffset.index || index <= topOffset.index) &&\n (!bottomOffset.index || index >= bottomOffset.index);\n }\n\n public setIndexKey(indexKey: Some['indexKey']) {\n this.indexKey = indexKey;\n this.sortedList.indexKey = indexKey;\n }\n\n protected deleteDialogByKey(key: DialogKey) {\n this.sortedList.delete(key);\n }\n\n public deleteDialog(dialog: T) {\n return this.deleteDialogByKey(this.getDialogKey(dialog));\n }\n\n public updateDialog(dialog: T) {\n const key = this.getDialogKey(dialog);\n if(this.isDialogMustBeInViewport(dialog)) {\n if(!this.sortedList.has(key) && this.loadedDialogsAtLeastOnce) {\n this.sortedList.add(key);\n return;\n }\n } else {\n this.deleteDialog(dialog);\n return;\n }\n\n const dialogElement = this.getDialogElement(key);\n if(dialogElement) {\n appDialogsManager.setLastMessageN({\n dialog,\n dialogElement,\n setUnread: true\n });\n this.sortedList.update(key);\n }\n }\n\n public onChatsRegularScroll = () => {\n // return;\n\n if(this.sliceTimeout) clearTimeout(this.sliceTimeout);\n this.sliceTimeout = window.setTimeout(() => {\n this.sliceTimeout = undefined;\n\n if(!this.sortedList.list.childElementCount || appDialogsManager.processContact) {\n return;\n }\n\n /* const observer = new IntersectionObserver((entries) => {\n const\n });\n\n Array.from(this.chatList.children).forEach((el) => {\n observer.observe(el);\n }); */\n\n fastRafConventional(() => {\n const perf = performance.now();\n\n const scrollTopWas = this.scrollable.scrollTop;\n\n const firstElementChild = this.sortedList.list.firstElementChild;\n const rectContainer = this.scrollable.container.getBoundingClientRect();\n const rectTarget = firstElementChild.getBoundingClientRect();\n const children = Array.from(this.scrollable.splitUp.children) as HTMLElement[];\n\n // const padding = 8;\n // const offsetTop = this.folders.container.offsetTop;\n let offsetTop = this.scrollable.splitUp.offsetTop;\n if(offsetTop && scrollTopWas < offsetTop) offsetTop -= scrollTopWas;\n // const offsetTop = scrollTopWas < padding ? padding - scrollTopWas : 0;\n const firstY = rectContainer.y + offsetTop;\n const lastY = rectContainer.y/* - 8 */; // 8px - .chatlist padding-bottom\n\n const firstElement = findUpTag(document.elementFromPoint(Math.ceil(rectTarget.x), Math.ceil(firstY + 1)), firstElementChild.tagName) as HTMLElement;\n const lastElement = findUpTag(document.elementFromPoint(Math.ceil(rectTarget.x), Math.floor(lastY + rectContainer.height - 1)), firstElementChild.tagName) as HTMLElement;\n\n // alert('got element:' + rect.y);\n\n if(!firstElement || !lastElement) {\n return;\n }\n\n // alert('got element:' + !!firstElement);\n\n const firstElementRect = firstElement.getBoundingClientRect();\n const elementOverflow = firstElementRect.y - firstY;\n\n const sliced: HTMLElement[] = [];\n const firstIndex = children.indexOf(firstElement);\n const lastIndex = children.indexOf(lastElement);\n\n const saveLength = 10;\n\n const sliceFromStart = IS_SAFARI ? [] : children.slice(0, Math.max(0, firstIndex - saveLength));\n const sliceFromEnd = children.slice(lastIndex + saveLength);\n\n /* if(sliceFromStart.length !== sliceFromEnd.length) {\n console.log('not equal', sliceFromStart.length, sliceFromEnd.length);\n }\n\n if(sliceFromStart.length > sliceFromEnd.length) {\n const diff = sliceFromStart.length - sliceFromEnd.length;\n sliceFromStart.splice(0, diff);\n } else if(sliceFromEnd.length > sliceFromStart.length) {\n const diff = sliceFromEnd.length - sliceFromStart.length;\n sliceFromEnd.splice(sliceFromEnd.length - diff, diff);\n } */\n\n if(sliceFromStart.length) {\n this.scrollable.loadedAll.top = false;\n }\n\n if(sliceFromEnd.length) {\n this.scrollable.loadedAll.bottom = false;\n }\n\n sliced.push(...sliceFromStart);\n sliced.push(...sliceFromEnd);\n\n sliced.forEach((el) => {\n this.deleteDialogByKey(this.getDialogKeyFromElement(el));\n });\n\n this.setOffsets();\n\n // this.log('[slicer] elements', firstElement, lastElement, rect, sliced, sliceFromStart.length, sliceFromEnd.length);\n\n // this.log('[slicer] reset scrollTop', this.scroll.scrollTop, firstElement.offsetTop, firstElementRect.y, rect.y, elementOverflow);\n\n // alert('left length:' + children.length);\n\n const scrollTop = firstElement.offsetTop - elementOverflow;\n this.scrollable.scrollTop = this.scrollable.lastScrollPosition = scrollTop;\n\n this.log('slice time', performance.now() - perf, this.indexKey, scrollTop);\n /* const firstElementRect = firstElement.getBoundingClientRect();\n const scrollTop = */\n\n // this.scroll.scrollIntoView(firstElement, false);\n });\n }, 200);\n };\n\n public onChatsScrollTop() {\n return this.onChatsScroll('top');\n };\n\n public onChatsScroll(side: SliceSides = 'bottom') {\n return this.loadDialogs(side);\n };\n\n public createPlaceholder(): DialogsPlaceholder {\n const placeholder = this.placeholder = new DialogsPlaceholder(this.placeholderOptions);\n const getRectFrom = this.getRectFromForPlaceholder();\n placeholder.attach({\n container: this.sortedList.list.parentElement,\n getRectFrom,\n onRemove: () => {\n if(this.placeholder === placeholder) {\n this.placeholder = undefined;\n }\n },\n blockScrollable: this.scrollable\n });\n\n return placeholder;\n }\n\n public loadDialogs(side: SliceSides) {\n /* if(testScroll) {\n return;\n } */\n\n const log = this.log.bindPrefix('load-' + getUnsafeRandomInt(1000, 9999));\n log('try', side);\n\n if(this.loadDialogsPromise || this.loadDialogsRenderPromise/* || 1 === 1 */) return this.loadDialogsPromise;\n else if(this.scrollable.loadedAll[side]) {\n return Promise.resolve({\n cached: true,\n renderPromise: Promise.resolve()\n });\n }\n\n log.warn('start', side);\n const middlewareError = makeError('MIDDLEWARE');\n\n const cachedInfoPromise = deferredPromise();\n const renderPromise = new Promise(async(resolve, reject) => {\n const chatList = this.sortedList.list;\n\n let placeholder = this.placeholder;\n try {\n const getConversationsResult = this.loadDialogsInner(side);\n const a = await getConversationsResult;\n\n if(\n !chatList.childElementCount &&\n !placeholder &&\n (\n (!this.loadedDialogsAtLeastOnce && this.needPlaceholderAtFirstTime) ||\n !a.cached\n )\n ) {\n if(this.loadDialogsRenderPromise !== renderPromise) {\n throw middlewareError;\n }\n\n placeholder = this.createPlaceholder();\n\n cachedInfoPromise.resolve(false);\n }\n\n const result = await a.result;\n // await pause(5000);\n if(this.loadDialogsRenderPromise !== renderPromise) {\n throw middlewareError;\n }\n\n cachedInfoPromise.resolve(a.cached);\n\n // console.timeEnd('getDialogs time');\n\n // * loaded all\n // if(!result.dialogs.length || chatList.childElementCount === result.count) {\n // !result.dialogs.length не подходит, так как при супердревном диалоге getConversations его не выдаст.\n // if(chatList.childElementCount === result.count) {\n if(side === 'bottom') {\n if(result.isEnd) {\n this.scrollable.loadedAll[side] = true;\n }\n } else if(result.isTopEnd) {\n this.scrollable.loadedAll[side] = true;\n }\n\n const length = result.dialogs.length;\n log(`will render ${length} dialogs`);\n if(length) {\n const dialogs = side === 'top' ? result.dialogs.slice().reverse() : result.dialogs;\n\n const loadPromises = dialogs.map((dialog) => {\n return this.sortedList.add(this.getDialogKey(dialog as T));\n });\n\n await Promise.all(loadPromises).catch();\n if(this.loadDialogsRenderPromise !== renderPromise) {\n throw middlewareError;\n }\n }\n\n const offsetDialog = result.dialogs[side === 'top' ? 0 : length - 1];\n if(offsetDialog) {\n this.offsets[side] = getDialogIndex(offsetDialog, this.indexKey);\n }\n\n // don't set it before - no need to fire length change with every dialog\n this.loadedDialogsAtLeastOnce = true;\n appDialogsManager.onListLengthChange();\n\n log('getDialogs', result, chatList.childElementCount);\n\n setTimeout(() => {\n this.scrollable.onScroll();\n }, 0);\n\n if(placeholder) {\n // await pause(500);\n placeholder.detach(chatList.childElementCount);\n }\n } catch(err) {\n if((err as ApiError)?.type !== 'MIDDLEWARE') {\n log.error(err);\n }\n\n reject(err);\n cachedInfoPromise.reject(err);\n return;\n }\n\n resolve();\n }).finally(() => {\n if(this.loadDialogsRenderPromise === renderPromise) {\n log('end');\n this.loadDialogsRenderPromise = undefined;\n } else {\n log('has been cleared');\n }\n });\n\n this.loadDialogsRenderPromise = renderPromise;\n const loadDialogsPromise = this.loadDialogsPromise = cachedInfoPromise.then((cached) => {\n return {\n cached,\n renderPromise\n };\n }).finally(() => {\n if(this.loadDialogsPromise === loadDialogsPromise) {\n this.loadDialogsPromise = undefined;\n }\n });\n\n return loadDialogsPromise;\n }\n\n public async setOffsets() {\n const chatList = this.sortedList.list;\n const [firstDialog, lastDialog] = await Promise.all([\n this.getDialogFromElement(chatList.firstElementChild as HTMLElement),\n this.getDialogFromElement(chatList.lastElementChild as HTMLElement)\n ]);\n\n const {indexKey} = this;\n this.offsets.top = getDialogIndex(firstDialog, indexKey);\n this.offsets.bottom = getDialogIndex(lastDialog, indexKey);\n }\n\n public getDialogKey(dialog: T): DialogKey {\n throw NOT_IMPLEMENTED_ERROR;\n }\n\n public getDialogKeyFromElement(element: HTMLElement): DialogKey {\n throw NOT_IMPLEMENTED_ERROR;\n }\n\n public getRectFromForPlaceholder(): Parameters[0]['getRectFrom'] {\n throw NOT_IMPLEMENTED_ERROR;\n }\n\n public getDialogFromElement(element: HTMLElement): Promise {\n throw NOT_IMPLEMENTED_ERROR;\n }\n\n public loadDialogsInner(side: SliceSides): ReturnType {\n throw NOT_IMPLEMENTED_ERROR;\n }\n\n public async setTyping(dialog: T) {\n const key = this.getDialogKey(dialog);\n const dom = this.getDialogDom(key);\n if(!dom) {\n return;\n }\n\n const oldTypingElement = dom.lastMessageSpan.querySelector('.peer-typing-container') as HTMLElement;\n const newTypingElement = await appImManager.getPeerTyping(\n dialog.peerId,\n oldTypingElement,\n dialog._ === 'forumTopic' ? dialog.id : undefined\n );\n if(!oldTypingElement && newTypingElement) {\n replaceContent(dom.lastMessageSpan, newTypingElement);\n dom.lastMessageSpan.classList.add('user-typing');\n }\n }\n\n public unsetTyping(dialog: T) {\n const key = this.getDialogKey(dialog);\n const dialogElement = this.getDialogElement(key);\n if(!dialogElement) {\n return;\n }\n\n dialogElement.dom.lastMessageSpan.classList.remove('user-typing');\n appDialogsManager.setLastMessageN({\n dialog,\n lastMessage: null,\n dialogElement,\n setUnread: null\n });\n }\n\n public getDialogDom(key: DialogKey) {\n // return this.doms[peerId];\n const element = this.sortedList.get(key);\n return element?.dom;\n }\n\n public getDialogElement(key: DialogKey) {\n const element = this.sortedList.get(key);\n return element?.dialogElement;\n }\n\n public bindScrollable() {\n this.scrollable.container.addEventListener('scroll', this.onChatsRegularScroll);\n this.scrollable.onScrolledTop = this.onChatsScrollTop.bind(this);\n this.scrollable.onScrolledBottom = this.onChatsScroll.bind(this);\n this.scrollable.setVirtualContainer(this.sortedList.list);\n }\n\n public clear() {\n this.sortedList.clear();\n this.placeholder?.remove();\n }\n\n public reset() {\n this.scrollable.loadedAll.top = true;\n this.scrollable.loadedAll.bottom = false;\n this.offsets.top = this.offsets.bottom = 0;\n this.loadDialogsRenderPromise = undefined;\n this.loadDialogsPromise = undefined;\n }\n\n public fullReset() {\n this.reset();\n this.clear();\n return this.onChatsScroll();\n }\n\n public destroy() {\n this.clear();\n this.scrollable.destroy();\n this.listenerSetter.removeAll();\n }\n}\n\nclass Some3 extends Some {\n constructor(public peerId: PeerId, public paddingX: number) {\n super();\n\n this.placeholderOptions = {\n avatarSize: 0,\n marginVertical: 5,\n totalHeight: 64\n };\n\n this.listenerSetter.add(rootScope)('peer_typings', async({peerId, threadId, typings}) => {\n if(!threadId || this.peerId !== peerId) {\n return;\n }\n\n const dialog = await this.managers.dialogsStorage.getForumTopic(peerId, threadId);\n\n if(!dialog) return;\n\n if(typings.length) {\n this.setTyping(dialog);\n } else {\n this.unsetTyping(dialog);\n }\n });\n\n this.listenerSetter.add(rootScope)('dialogs_multiupdate', (dialogs) => {\n for(const [peerId, {dialog, topics}] of dialogs) {\n if(peerId !== this.peerId || !topics?.size) {\n continue;\n }\n\n topics.forEach((forumTopic) => {\n this.updateDialog(forumTopic);\n });\n }\n });\n\n this.listenerSetter.add(rootScope)('dialog_unread', ({dialog}) => {\n if(dialog?._ !== 'forumTopic' || dialog.peerId !== this.peerId) {\n return;\n }\n\n appDialogsManager.setUnreadMessagesN({dialog, dialogElement: this.getDialogElement(this.getDialogKey(dialog))});\n });\n\n this.listenerSetter.add(rootScope)('dialog_notify_settings', async(dialog) => {\n if(dialog.peerId !== this.peerId) {\n return;\n }\n\n if(dialog._ === 'dialog') {\n const all = this.sortedList.getAll();\n const entries = [...all.entries()];\n const promises = entries.map(([id]) => this.managers.dialogsStorage.getForumTopic(this.peerId, id));\n const topics = await Promise.all(promises);\n entries.forEach(([id, element], idx) => {\n appDialogsManager.setUnreadMessagesN({dialog: topics[idx], dialogElement: element.dialogElement}); // возможно это не нужно, но нужно менять is-muted\n });\n\n return;\n }\n\n appDialogsManager.setUnreadMessagesN({dialog, dialogElement: this.getDialogElement(this.getDialogKey(dialog))}); // возможно это не нужно, но нужно менять is-muted\n });\n\n this.listenerSetter.add(rootScope)('dialog_drop', (dialog) => {\n if(dialog._ !== 'forumTopic' || dialog.peerId !== this.peerId) {\n return;\n }\n\n this.deleteDialogByKey(this.getDialogKey(dialog));\n });\n\n this.listenerSetter.add(rootScope)('dialog_draft', ({dialog, drop, peerId}) => {\n if(dialog._ !== 'forumTopic' || dialog.peerId !== this.peerId) {\n return;\n }\n\n if(drop) {\n this.deleteDialog(dialog);\n } else {\n this.updateDialog(dialog);\n }\n });\n }\n\n protected isDialogMustBeInViewport(dialog: ForumTopic) {\n if(dialog.pFlags.hidden) return false;\n return super.isDialogMustBeInViewport(dialog);\n }\n\n public getDialogKey(dialog: ForumTopic) {\n return dialog.id;\n }\n\n public getDialogKeyFromElement(element: HTMLElement) {\n return +element.dataset.threadId;\n }\n\n public getRectFromForPlaceholder() {\n return (): DOMRectEditable => {\n const sidebarRect = appSidebarLeft.rect;\n const paddingY = 56;\n return {\n top: paddingY,\n right: sidebarRect.right,\n bottom: 0,\n left: this.paddingX,\n width: sidebarRect.width - this.paddingX,\n height: sidebarRect.height - paddingY\n };\n };\n }\n\n public getDialogFromElement(element: HTMLElement) {\n return this.managers.dialogsStorage.getForumTopic(+element.dataset.peerId, +element.dataset.threadId);\n }\n\n public async loadDialogsInner(side: SliceSides) {\n const {indexKey} = this;\n let loadCount = windowSize.height / 64 * 1.25 | 0;\n let offsetIndex = 0;\n\n const filterId = this.peerId;\n const {index: currentOffsetIndex} = this.getOffsetIndex(side);\n offsetIndex = currentOffsetIndex;\n if(currentOffsetIndex) {\n if(side === 'top') {\n const storage = await this.managers.dialogsStorage.getFolderDialogs(filterId, true);\n const index = storage.findIndex((dialog) => getDialogIndex(dialog, indexKey) <= currentOffsetIndex);\n const needIndex = Math.max(0, index - loadCount);\n loadCount = index - needIndex;\n offsetIndex = getDialogIndex(storage[needIndex], indexKey) + 1;\n } else {\n offsetIndex = currentOffsetIndex;\n }\n }\n\n return this.managers.acknowledged.dialogsStorage.getDialogs({\n offsetIndex,\n limit: loadCount,\n filterId,\n skipMigrated: true\n });\n }\n}\n\nclass Some2 extends Some {\n constructor(protected filterId: number) {\n super();\n\n this.needPlaceholderAtFirstTime = true;\n\n this.listenerSetter.add(rootScope)('peer_typings', async({peerId, typings}) => {\n const [dialog, isForum] = await Promise.all([\n this.managers.appMessagesManager.getDialogOnly(peerId),\n this.managers.appPeersManager.isForum(peerId)\n ]);\n\n if(!dialog || isForum) return;\n\n if(typings.length) {\n this.setTyping(dialog);\n } else {\n this.unsetTyping(dialog);\n }\n });\n\n this.listenerSetter.add(rootScope)('user_update', async(userId) => {\n if(!this.isActive) {\n return;\n }\n\n const peerId = userId.toPeerId();\n const dom = this.getDialogDom(peerId);\n if(!dom) {\n return;\n }\n\n const status = await this.managers.appUsersManager.getUserStatus(userId);\n const online = status?._ === 'userStatusOnline';\n this.setOnlineStatus(dom.avatarEl, online);\n });\n\n this.listenerSetter.add(rootScope)('chat_update', async(chatId) => {\n const peerId = chatId.toPeerId(true);\n this.processDialogForCallStatus(peerId);\n });\n\n this.listenerSetter.add(rootScope)('dialog_flush', ({dialog}) => {\n if(!this.isActive || !dialog) {\n return;\n }\n\n appDialogsManager.setLastMessageN({\n dialog,\n setUnread: true\n });\n this.validateDialogForFilter(dialog);\n });\n\n this.listenerSetter.add(rootScope)('dialogs_multiupdate', (dialogs) => {\n if(!this.isActive) {\n return;\n }\n\n for(const [peerId, {dialog, topics}] of dialogs) {\n if(dialog?._ !== 'dialog') {\n continue;\n }\n\n this.updateDialog(dialog);\n\n appDialogsManager.processContact?.(peerId.toPeerId());\n\n this.validateDialogForFilter(dialog);\n }\n });\n\n this.listenerSetter.add(rootScope)('dialog_drop', (dialog) => {\n if(!this.isActive || dialog._ !== 'dialog') {\n return;\n }\n\n this.deleteDialogByKey(dialog.peerId);\n appDialogsManager.processContact?.(dialog.peerId);\n });\n\n this.listenerSetter.add(rootScope)('dialog_unread', ({dialog}) => {\n if(!this.isActive || dialog?._ !== 'dialog') {\n return;\n }\n\n appDialogsManager.setUnreadMessagesN({dialog, dialogElement: this.getDialogElement(this.getDialogKey(dialog))});\n this.validateDialogForFilter(dialog);\n });\n\n this.listenerSetter.add(rootScope)('dialog_notify_settings', (dialog) => {\n if(!this.isActive || dialog._ === 'forumTopic') {\n return;\n }\n\n this.validateDialogForFilter(dialog);\n appDialogsManager.setUnreadMessagesN({dialog, dialogElement: this.getDialogElement(this.getDialogKey(dialog))}); // возможно это не нужно, но нужно менять is-muted\n });\n\n this.listenerSetter.add(rootScope)('dialog_draft', ({dialog, drop, peerId}) => {\n if(!this.isActive || dialog._ === 'forumTopic') {\n return;\n }\n\n if(drop) {\n this.deleteDialog(dialog);\n } else {\n this.updateDialog(dialog);\n }\n\n appDialogsManager.processContact?.(peerId);\n });\n\n this.listenerSetter.add(rootScope)('filter_update', async(filter) => {\n if(this.isActive && filter.id === this.filterId && !REAL_FOLDERS.has(filter.id)) {\n const dialogs = await this.managers.dialogsStorage.getCachedDialogs(true);\n await this.validateListForFilter();\n for(let i = 0, length = dialogs.length; i < length; ++i) {\n const dialog = dialogs[i];\n this.updateDialog(dialog);\n }\n }\n });\n }\n\n private get isActive() {\n return appDialogsManager.xd === this;\n }\n\n public getRectFromForPlaceholder() {\n return this.filterId === FOLDER_ID_ARCHIVE ? appDialogsManager.chatsContainer : appDialogsManager.folders.container;\n }\n\n public async loadDialogsInner(side: SliceSides) {\n const {filterId, indexKey} = this;\n let loadCount = windowSize.height / 72 * 1.25 | 0;\n let offsetIndex = 0;\n\n const doNotRenderChatList = appDialogsManager.doNotRenderChatList; // cache before awaits\n\n const {index: currentOffsetIndex} = this.getOffsetIndex(side);\n if(currentOffsetIndex) {\n if(side === 'top') {\n const storage = await this.managers.dialogsStorage.getFolderDialogs(filterId, true);\n const index = storage.findIndex((dialog) => getDialogIndex(dialog, indexKey) <= currentOffsetIndex);\n const needIndex = Math.max(0, index - loadCount);\n loadCount = index - needIndex;\n offsetIndex = getDialogIndex(storage[needIndex], indexKey) + 1;\n } else {\n offsetIndex = currentOffsetIndex;\n }\n }\n\n const promise = this.managers.acknowledged.dialogsStorage.getDialogs({\n offsetIndex,\n limit: loadCount,\n filterId,\n skipMigrated: true\n });\n\n const a = await promise;\n if(doNotRenderChatList) {\n a.result = Promise.reject(makeError('MIDDLEWARE'));\n }\n\n return a;\n }\n\n public setOnlineStatus(element: HTMLElement, online: boolean) {\n const className = 'is-online';\n const hasClassName = element.classList.contains(className);\n !hasClassName && online && element.classList.add(className);\n SetTransition({\n element: element,\n className: 'is-visible',\n forwards: online,\n duration: 250,\n onTransitionEnd: online ? undefined : () => {\n element.classList.remove(className);\n },\n useRafs: online && !hasClassName ? 2 : 0\n });\n }\n\n public generateScrollable(list: HTMLUListElement, filter: Parameters[0]) {\n const filterId = filter.id;\n const scrollable = new Scrollable(null, 'CL', 500);\n scrollable.container.dataset.filterId = '' + filterId;\n\n const indexKey = getDialogIndexKey(filter.localId);\n const sortedDialogList = new SortedDialogList({\n managers: rootScope.managers,\n log: this.log,\n list: list,\n indexKey,\n onListLengthChange: appDialogsManager.onListLengthChange\n });\n\n this.scrollable = scrollable;\n this.sortedList = sortedDialogList;\n this.setIndexKey(indexKey);\n this.bindScrollable();\n\n // list.classList.add('hide');\n // scrollable.container.style.backgroundColor = '#' + (Math.random() * (16 ** 6 - 1) | 0).toString(16);\n\n return scrollable;\n }\n\n public testDialogForFilter(dialog: Dialog) {\n if(!REAL_FOLDERS.has(this.filterId) ? getDialogIndex(dialog, this.indexKey) === undefined : this.filterId !== dialog.folder_id) {\n return false;\n }\n\n return true;\n }\n\n protected isDialogMustBeInViewport(dialog: Dialog) {\n if(dialog.migratedTo !== undefined || !this.testDialogForFilter(dialog)) return false;\n return super.isDialogMustBeInViewport(dialog);\n }\n\n /**\n * Удалит неподходящие чаты из списка, но не добавит их(!)\n */\n public async validateListForFilter() {\n this.sortedList.getAll().forEach(async(element) => {\n const dialog = await rootScope.managers.appMessagesManager.getDialogOnly(element.id);\n if(!this.testDialogForFilter(dialog)) {\n this.deleteDialog(dialog);\n }\n });\n }\n\n /**\n * Удалит неподходящий чат из списка, но не добавит его(!)\n */\n public validateDialogForFilter(dialog: Dialog) {\n if(!this.getDialogElement(dialog.peerId)) {\n return;\n }\n\n if(!this.testDialogForFilter(dialog)) {\n this.deleteDialog(dialog);\n }\n }\n\n public setCallStatus(dom: DialogDom, visible: boolean) {\n let {callIcon, listEl} = dom;\n if(!callIcon && visible) {\n const {canvas, startAnimation} = dom.callIcon = callIcon = groupCallActiveIcon(listEl.classList.contains('active'));\n canvas.classList.add('dialog-group-call-icon');\n listEl.append(canvas);\n startAnimation();\n }\n\n if(!callIcon) {\n return;\n }\n\n SetTransition({\n element: dom.callIcon.canvas,\n className: 'is-visible',\n forwards: visible,\n duration: BADGE_TRANSITION_TIME,\n onTransitionEnd: visible ? undefined : () => {\n dom.callIcon.canvas.remove();\n dom.callIcon = undefined;\n },\n useRafs: visible ? 2 : 0\n });\n }\n\n public async processDialogForCallStatus(peerId: PeerId, dom?: DialogDom) {\n if(!IS_GROUP_CALL_SUPPORTED) {\n return;\n }\n\n if(!dom) dom = this.getDialogDom(peerId);\n if(!dom) return;\n\n const chat = await rootScope.managers.appChatsManager.getChat(peerId.toChatId()) as Chat.chat | Chat.channel;\n this.setCallStatus(dom, !!(chat.pFlags.call_active && chat.pFlags.call_not_empty));\n }\n\n public onChatsScroll(side: SliceSides = 'bottom') {\n if(this.scrollable.loadedAll[side]) {\n appDialogsManager.loadContacts?.();\n }\n\n this.log('onChatsScroll', side);\n return super.onChatsScroll(side);\n }\n\n public toggleAvatarUnreadBadges(value: boolean, useRafs: number) {\n if(!value) {\n this.sortedList.getAll().forEach((sortedDialog) => {\n const {dom, dialogElement} = sortedDialog;\n if(!dom.unreadAvatarBadge) {\n return;\n }\n\n dialogElement.toggleBadgeByKey('unreadAvatarBadge', false, false, false);\n });\n\n return;\n }\n\n const reuseClassNames = ['unread', 'mention'];\n this.sortedList.getAll().forEach((sortedDialog) => {\n const {dom, dialogElement} = sortedDialog;\n const unreadContent = dom.unreadBadge?.textContent;\n if(!unreadContent || dom.unreadBadge.classList.contains('backwards')) {\n return;\n }\n\n const isUnreadAvatarBadgeMounted = !!dom.unreadAvatarBadge;\n dialogElement.createUnreadAvatarBadge();\n dialogElement.toggleBadgeByKey('unreadAvatarBadge', true, isUnreadAvatarBadgeMounted);\n dom.unreadAvatarBadge.textContent = unreadContent;\n const unreadAvatarBadgeClassList = dom.unreadAvatarBadge.classList;\n const unreadBadgeClassList = dom.unreadBadge.classList;\n reuseClassNames.forEach((className) => {\n unreadAvatarBadgeClassList.toggle(className, unreadBadgeClassList.contains(className));\n });\n });\n }\n\n public getDialogKey(dialog: Dialog) {\n return dialog.peerId;\n }\n\n public getDialogKeyFromElement(element: HTMLElement) {\n return +element.dataset.peerId;\n }\n\n public getDialogFromElement(element: HTMLElement) {\n return rootScope.managers.appMessagesManager.getDialogOnly(element.dataset.peerId.toPeerId());\n }\n}\n\n// const testScroll = false;\n// let testTopSlice = 1;\n\nexport class AppDialogsManager {\n public chatsContainer = document.getElementById('chatlist-container') as HTMLDivElement;\n\n private log = logger('DIALOGS', LogTypes.Log | LogTypes.Error | LogTypes.Warn | LogTypes.Debug);\n\n private contextMenu: DialogsContextMenu;\n\n public filterId: number;\n public folders: {[k in 'menu' | 'container' | 'menuScrollContainer']: HTMLElement} = {\n menu: document.getElementById('folders-tabs'),\n menuScrollContainer: null,\n container: document.getElementById('folders-container')\n };\n private filtersRendered: {\n [filterId: string]: {\n menu: HTMLElement,\n container: HTMLElement,\n unread: HTMLElement,\n title: HTMLElement\n }\n } = {};\n private showFiltersPromise: Promise;\n\n private lastActiveElements: Set = new Set();\n\n public loadContacts: () => void;\n public processContact: (peerId: PeerId) => void;\n\n private initedListeners = false;\n\n public onListLengthChange: () => Promise;\n private allChatsIntlElement: I18n.IntlElement;\n\n private emptyDialogsPlaceholderSubtitle: I18n.IntlElement;\n private updateContactsLengthPromise: Promise;\n\n private filtersNavigationItem: NavigationItem;\n\n private managers: AppManagers;\n private selectTab: ReturnType;\n\n public doNotRenderChatList: boolean;\n\n private stateMiddlewareHelper: MiddlewareHelper;\n\n private forumsTabs: Map;\n private forumsSlider: HTMLElement;\n public forumTab: ForumTab;\n private forumNavigationItem: NavigationItem;\n\n public xd: Some2;\n public xds: {[filterId: number]: Some2} = {};\n\n public start() {\n const managers = this.managers = getProxiedManagers();\n\n this.contextMenu = new DialogsContextMenu(managers);\n this.stateMiddlewareHelper = getMiddleware();\n\n this.folders.menuScrollContainer = this.folders.menu.parentElement;\n\n this.onListLengthChange = debounce(this._onListLengthChange, 100, false, true);\n\n const bottomPart = document.createElement('div');\n bottomPart.classList.add('connection-status-bottom');\n bottomPart.append(this.folders.container);\n\n this.forumsTabs = new Map();\n this.forumsSlider = document.createElement('div');\n this.forumsSlider.classList.add('topics-slider');\n this.chatsContainer.parentElement.parentElement.append(this.forumsSlider);\n // findUpClassName(this.chatsContainer, 'chatlist-container').append(this.forumsSlider);\n\n // appSidebarLeft.onOpenTab = () => {\n // return this.toggleForumTab();\n // };\n\n /* if(isTouchSupported && isSafari) {\n let allowUp: boolean, allowDown: boolean, slideBeginY: number;\n const container = this.scroll.container;\n container.addEventListener('touchstart', (event) => {\n allowUp = container.scrollTop > 0;\n allowDown = (container.scrollTop < container.scrollHeight - container.clientHeight);\n // @ts-ignore\n slideBeginY = event.pageY;\n });\n\n container.addEventListener('touchmove', (event: any) => {\n var up = (event.pageY > slideBeginY);\n var down = (event.pageY < slideBeginY);\n slideBeginY = event.pageY;\n if((up && allowUp) || (down && allowDown)) {\n event.stopPropagation();\n } else if(up || down) {\n event.preventDefault();\n }\n });\n } */\n\n if(IS_TOUCH_SUPPORTED) {\n handleTabSwipe({\n element: this.folders.container,\n onSwipe: (xDiff) => {\n const prevId = selectTab.prevId();\n selectTab(xDiff < 0 ? prevId + 1 : prevId - 1);\n },\n verifyTouchTarget: () => {\n return !this.forumTab;\n }\n });\n }\n\n this.allChatsIntlElement = new I18n.IntlElement({\n key: 'FilterAllChatsShort'\n });\n\n rootScope.addEventListener('premium_toggle', async(isPremium) => {\n if(isPremium) {\n return;\n }\n\n const isFolderAvailable = await this.managers.filtersStorage.isFilterIdAvailable(this.filterId);\n if(!isFolderAvailable) {\n selectTab(whichChild(this.filtersRendered[FOLDER_ID_ALL].menu), false);\n }\n });\n\n rootScope.addEventListener('state_cleared', () => {\n const clearCurrent = REAL_FOLDERS.has(this.filterId);\n // setTimeout(() =>\n apiManagerProxy.getState().then(async(state) => {\n this.xd.loadedDialogsAtLeastOnce = false;\n this.showFiltersPromise = undefined;\n\n /* const clearPromises: Promise[] = [];\n for(const name in this.managers.appStateManager.storagesResults) {\n const results = this.managers.appStateManager.storagesResults[name as keyof AppStateManager['storages']];\n const storage = this.managers.appStateManager.storages[name as keyof AppStateManager['storages']];\n results.length = 0;\n clearPromises.push(storage.clear());\n } */\n\n if(clearCurrent) {\n this.xd.clear();\n this.onTabChange();\n }\n\n this.onStateLoaded(state);\n })// , 5000);\n });\n\n this.setFilterId(FOLDER_ID_ALL, FOLDER_ID_ALL);\n this.addFilter({\n id: FOLDER_ID_ALL,\n title: '',\n localId: FOLDER_ID_ALL\n });\n\n const foldersScrollable = new ScrollableX(this.folders.menuScrollContainer);\n bottomPart.prepend(this.folders.menuScrollContainer);\n const selectTab = this.selectTab = horizontalMenu(this.folders.menu, this.folders.container, async(id, tabContent) => {\n /* if(id !== 0) {\n id += 1;\n } */\n\n const _id = id;\n id = +tabContent.dataset.filterId || FOLDER_ID_ALL;\n\n const isFilterAvailable = this.filterId === -1 || REAL_FOLDERS.has(id) || await this.managers.filtersStorage.isFilterIdAvailable(id);\n if(!isFilterAvailable) {\n return false;\n }\n\n const wasFilterId = this.filterId;\n if(!IS_MOBILE_SAFARI) {\n if(_id) {\n if(!this.filtersNavigationItem) {\n this.filtersNavigationItem = {\n type: 'filters',\n onPop: () => {\n selectTab(0);\n this.filtersNavigationItem = undefined;\n }\n };\n\n appNavigationController.spliceItems(1, 0, this.filtersNavigationItem);\n }\n } else if(this.filtersNavigationItem) {\n appNavigationController.removeItem(this.filtersNavigationItem);\n this.filtersNavigationItem = undefined;\n }\n }\n\n if(wasFilterId === id) return;\n\n this.xds[id].clear();\n const promise = this.setFilterIdAndChangeTab(id).then(({cached, renderPromise}) => {\n if(cached) {\n return renderPromise;\n }\n });\n\n if(wasFilterId !== -1) {\n return promise;\n }\n }, () => {\n for(const folderId in this.xds) {\n if(+folderId !== this.filterId) {\n this.xds[folderId].clear();\n }\n }\n }, undefined, foldersScrollable);\n\n apiManagerProxy.getState().then((state) => {\n // * it should've had a better place :(\n appMediaPlaybackController.setPlaybackParams(state.playbackParams);\n appMediaPlaybackController.addEventListener('playbackParams', (params) => {\n this.managers.appStateManager.pushToState('playbackParams', params);\n });\n\n return this.onStateLoaded(state);\n })/* .then(() => {\n const isLoadedMain = this.managers.appMessagesManager.dialogsStorage.isDialogsLoaded(0);\n const isLoadedArchive = this.managers.appMessagesManager.dialogsStorage.isDialogsLoaded(1);\n const wasLoaded = isLoadedMain || isLoadedArchive;\n const a: Promise = isLoadedMain ? Promise.resolve() : this.managers.appMessagesManager.getConversationsAll('', 0);\n const b: Promise = isLoadedArchive ? Promise.resolve() : this.managers.appMessagesManager.getConversationsAll('', 1);\n a.finally(() => {\n b.then(() => {\n if(wasLoaded) {\n (apiUpdatesManager.updatesState.syncLoading || Promise.resolve()).then(() => {\n this.managers.appMessagesManager.refreshConversations();\n });\n }\n });\n });\n }) */;\n\n mediaSizes.addEventListener('resize', () => {\n this.changeFiltersAllChatsKey();\n });\n\n new ConnectionStatusComponent(this.managers, this.chatsContainer);\n this.chatsContainer.append(bottomPart);\n\n setTimeout(() => {\n lottieLoader.loadLottieWorkers();\n }, 200);\n\n PopupElement.MANAGERS = rootScope.managers = managers;\n appDownloadManager.construct(managers);\n appSidebarLeft.construct(managers);\n appSidebarRight.construct(managers);\n groupCallsController.construct(managers);\n callsController.construct(managers);\n appImManager.construct(managers);\n\n // start\n\n this.xd = this.xds[this.filterId];\n\n // selectTab(0, false);\n }\n\n public get chatList() {\n return this.xd.sortedList.list;\n }\n\n public setFilterId(filterId: number, localId: MyDialogFilter['localId']) {\n this.filterId = filterId;\n }\n\n public async setFilterIdAndChangeTab(filterId: number) {\n this.filterId = filterId;\n return this.onTabChange();\n }\n\n private initListeners() {\n rootScope.addEventListener('dialog_flush', ({dialog}) => {\n if(!dialog) {\n return;\n }\n\n this.setFiltersUnreadCount();\n });\n\n rootScope.addEventListener('folder_unread', async(folder) => {\n if(folder.id < 0) {\n const dialogElement = this.xd.getDialogElement(folder.id);\n if(!dialogElement) {\n return;\n }\n\n this.setUnreadMessagesN({\n dialog: await this.managers.dialogsStorage.getDialogOnly(folder.id),\n dialogElement\n });\n } else {\n this.setFilterUnreadCount(folder.id);\n }\n });\n\n rootScope.addEventListener('contacts_update', (userId) => {\n this.processContact?.(userId.toPeerId());\n });\n\n appImManager.addEventListener('peer_changed', ({peerId, threadId, isForum}) => {\n const options: Parameters[0] = {peerId, threadId: isForum ? threadId : undefined};\n // const perf = performance.now();\n for(const element of this.lastActiveElements) {\n const elementThreadId = +element.dataset.threadId || undefined;\n const elementPeerId = element.dataset.peerId.toPeerId();\n if(!appImManager.isSamePeer({peerId: elementPeerId, threadId: elementThreadId}, options)) {\n this.setDialogActive(element, false);\n }\n }\n\n const elements = Array.from(document.querySelectorAll(`[data-autonomous=\"0\"] .chatlist-chat[data-peer-id=\"${peerId}\"]`)) as HTMLElement[];\n elements.forEach((element) => {\n const elementThreadId = +element.dataset.threadId || undefined;\n if(appImManager.isSamePeer({peerId, threadId: elementThreadId}, options)) {\n this.setDialogActive(element, true);\n }\n });\n // this.log('peer_changed total time:', performance.now() - perf);\n });\n\n rootScope.addEventListener('filter_update', async(filter) => {\n if(REAL_FOLDERS.has(filter.id)) {\n return;\n }\n\n if(!this.filtersRendered[filter.id]) {\n this.addFilter(filter);\n return;\n }\n\n const elements = this.filtersRendered[filter.id];\n setInnerHTML(elements.title, wrapEmojiText(filter.title));\n });\n\n rootScope.addEventListener('filter_delete', (filter) => {\n const elements = this.filtersRendered[filter.id];\n if(!elements) return;\n\n // set tab\n // (this.folders.menu.firstElementChild.children[Math.max(0, filter.id - 2)] as HTMLElement).click();\n elements.container.remove();\n elements.menu.remove();\n\n this.xds[filter.id].destroy();\n delete this.xds[filter.id];\n delete this.filtersRendered[filter.id];\n\n this.onFiltersLengthChange();\n\n if(this.filterId === filter.id) {\n this.selectTab(0, false);\n }\n });\n\n rootScope.addEventListener('filter_order', async(order) => {\n order = order.slice();\n indexOfAndSplice(order, FOLDER_ID_ARCHIVE);\n\n const containerToAppend = this.folders.menu as HTMLElement;\n const r = await Promise.all(order.map(async(filterId) => {\n const [indexKey, filter] = await Promise.all([\n this.managers.dialogsStorage.getDialogIndexKeyByFilterId(filterId),\n this.managers.filtersStorage.getFilter(filterId)\n ]);\n\n return {indexKey, filter};\n }));\n\n order.forEach((filterId, idx) => {\n const {indexKey, filter} = r[idx];\n const renderedFilter = this.filtersRendered[filterId];\n\n this.xds[filterId].setIndexKey(indexKey);\n\n positionElementByIndex(renderedFilter.menu, containerToAppend, filter.localId);\n positionElementByIndex(renderedFilter.container, this.folders.container, filter.localId);\n });\n\n /* if(this.filterId) {\n const tabIndex = order.indexOf(this.filterId) + 1;\n selectTab.prevId = tabIndex;\n } */\n });\n }\n\n public setDialogActive(listEl: HTMLElement, active: boolean) {\n const dom = (listEl as any).dialogDom as DialogDom;\n listEl.classList.toggle('active', active);\n listEl.classList.toggle('is-forum-open', this.forumTab?.peerId === listEl.dataset.peerId.toPeerId() && !listEl.dataset.threadId);\n if(active) {\n this.lastActiveElements.add(listEl);\n } else {\n this.lastActiveElements.delete(listEl);\n }\n\n if(dom?.callIcon) {\n dom.callIcon.setActive(active);\n }\n }\n\n private async onStateLoaded(state: State) {\n this.stateMiddlewareHelper.clean();\n const middleware = this.stateMiddlewareHelper.get();\n const filtersArr = state.filtersArr;\n const haveFilters = filtersArr.length > REAL_FOLDERS.size;\n // const filter = filtersArr.find((filter) => filter.id !== FOLDER_ID_ARCHIVE);\n\n const addFilters = (filters: MyDialogFilter[]) => {\n for(const filter of filters) {\n this.addFilter(filter);\n }\n };\n\n let addFiltersPromise: Promise;\n if(haveFilters) {\n addFilters(filtersArr);\n } else {\n addFiltersPromise = this.managers.filtersStorage.getDialogFilters().then(addFilters);\n }\n\n this.doNotRenderChatList = true;\n const loadDialogsPromise = this.xd.onChatsScroll();\n const m = middlewarePromise(middleware);\n try {\n await m(loadDialogsPromise);\n } catch(err) {\n\n }\n\n // show the placeholder before the filters, and then will reset to the default tab again\n if(!haveFilters) {\n this.selectTab(0, false);\n }\n\n addFiltersPromise && await m(addFiltersPromise);\n // this.folders.menu.children[0].classList.add('active');\n\n this.doNotRenderChatList = undefined;\n\n this.filterId = -1;\n this.selectTab(0, false);\n\n if(!this.initedListeners) {\n this.initListeners();\n this.initedListeners = true;\n }\n\n haveFilters && this.showFiltersPromise && await m(this.showFiltersPromise);\n\n this.managers.appNotificationsManager.getNotifyPeerTypeSettings();\n\n await (await m(loadDialogsPromise)).renderPromise.catch(noop);\n this.managers.appMessagesManager.fillConversations();\n }\n\n /* private getOffset(side: 'top' | 'bottom'): {index: number, pos: number} {\n if(!this.scroll.loadedAll[side]) {\n const element = (side === 'top' ? this.chatList.firstElementChild : this.chatList.lastElementChild) as HTMLElement;\n if(element) {\n const peerId = element.dataset.peerId;\n const dialog = this.managers.appMessagesManager.getDialogByPeerId(peerId);\n return {index: dialog[0].index, pos: dialog[1]};\n }\n }\n\n return {index: 0, pos: -1};\n } */\n\n public onTabChange = () => {\n this.xd = this.xds[this.filterId];\n this.xd.reset();\n return this.xd.onChatsScroll();\n };\n\n private async setFilterUnreadCount(filterId: number) {\n // if(filterId === FOLDER_ID_ALL) {\n // return;\n // }\n\n const unreadSpan = this.filtersRendered[filterId]?.unread;\n if(!unreadSpan) {\n return;\n }\n\n const {unreadUnmutedCount, unreadCount} = await this.managers.dialogsStorage.getFolderUnreadCount(filterId);\n\n unreadSpan.classList.toggle('badge-gray', !unreadUnmutedCount);\n const count = filterId === FOLDER_ID_ALL ? unreadUnmutedCount : unreadCount;\n unreadSpan.innerText = count ? '' + count : '';\n }\n\n private setFiltersUnreadCount() {\n for(const filterId in this.filtersRendered) {\n this.setFilterUnreadCount(+filterId);\n }\n }\n\n public l(filter: Parameters[0]) {\n const ul = this.createChatList();\n const xd = this.xds[filter.id] = new Some2(filter.id);\n const scrollable = xd.generateScrollable(ul, filter);\n this.setListClickListener(ul, null, true);\n\n return {ul, xd, scrollable};\n }\n\n private addFilter(filter: Pick) {\n if(filter.id === FOLDER_ID_ARCHIVE) {\n return;\n }\n\n const containerToAppend = this.folders.menu as HTMLElement;\n const renderedFilter = this.filtersRendered[filter.id];\n if(renderedFilter) {\n positionElementByIndex(renderedFilter.menu, containerToAppend, filter.localId);\n positionElementByIndex(renderedFilter.container, this.folders.container, filter.localId);\n return;\n }\n\n const menuTab = document.createElement('div');\n menuTab.classList.add('menu-horizontal-div-item');\n const span = document.createElement('span');\n const titleSpan = document.createElement('span');\n titleSpan.classList.add('text-super');\n if(filter.id === FOLDER_ID_ALL) titleSpan.append(this.allChatsIntlElement.element);\n else setInnerHTML(titleSpan, wrapEmojiText(filter.title));\n const unreadSpan = document.createElement('div');\n unreadSpan.classList.add('badge', 'badge-20', 'badge-primary');\n const i = document.createElement('i');\n span.append(titleSpan, unreadSpan, i);\n ripple(menuTab);\n menuTab.append(span);\n\n menuTab.dataset.filterId = '' + filter.id;\n\n positionElementByIndex(menuTab, containerToAppend, filter.localId);\n // containerToAppend.append(li);\n\n const {ul, scrollable} = this.l(filter);\n scrollable.container.classList.add('tabs-tab', 'chatlist-parts');\n\n /* const parts = document.createElement('div');\n parts.classList.add('chatlist-parts'); */\n\n const top = document.createElement('div');\n top.classList.add('chatlist-top');\n\n const bottom = document.createElement('div');\n bottom.classList.add('chatlist-bottom');\n\n top.append(ul);\n scrollable.container.append(top, bottom);\n /* parts.append(top, bottom);\n scrollable.container.append(parts); */\n\n const div = scrollable.container;\n // this.folders.container.append(div);\n positionElementByIndex(scrollable.container, this.folders.container, filter.localId);\n\n this.filtersRendered[filter.id] = {\n menu: menuTab,\n container: div,\n unread: unreadSpan,\n title: titleSpan\n };\n\n this.onFiltersLengthChange();\n }\n\n private changeFiltersAllChatsKey() {\n const scrollable = this.folders.menuScrollContainer.firstElementChild;\n const key: LangPackKey = scrollable.scrollWidth > scrollable.clientWidth ? 'FilterAllChatsShort' : 'FilterAllChats';\n this.allChatsIntlElement.compareAndUpdate({key});\n }\n\n private onFiltersLengthChange() {\n let promise = this.showFiltersPromise;\n return promise ??= this.showFiltersPromise = pause(0).then(() => {\n if(this.showFiltersPromise !== promise) {\n return;\n }\n\n const length = Object.keys(this.filtersRendered).length;\n const show = length > 1;\n const wasShowing = !this.folders.menuScrollContainer.classList.contains('hide');\n\n if(show !== wasShowing) {\n this.folders.menuScrollContainer.classList.toggle('hide', !show);\n if(show && !wasShowing) {\n this.setFiltersUnreadCount();\n }\n\n this.chatsContainer.classList.toggle('has-filters', show);\n }\n\n this.changeFiltersAllChatsKey();\n\n this.showFiltersPromise = undefined;\n });\n }\n\n private generateEmptyPlaceholder(options: {\n title: LangPackKey,\n subtitle?: LangPackKey,\n subtitleArgs?: FormatterArguments,\n classNameType: string\n }) {\n const BASE_CLASS = 'empty-placeholder';\n const container = document.createElement('div');\n container.classList.add(BASE_CLASS, BASE_CLASS + '-' + options.classNameType);\n\n const header = document.createElement('div');\n header.classList.add(BASE_CLASS + '-header');\n _i18n(header, options.title);\n\n const subtitle = document.createElement('div');\n subtitle.classList.add(BASE_CLASS + '-subtitle');\n if(options.subtitle) {\n _i18n(subtitle, options.subtitle, options.subtitleArgs);\n }\n\n container.append(header, subtitle);\n\n return {container, header, subtitle};\n }\n\n private checkIfPlaceholderNeeded() {\n if(this.filterId === FOLDER_ID_ARCHIVE) {\n return;\n }\n\n const chatList = this.chatList;\n const part = chatList.parentElement as HTMLElement;\n let placeholderContainer = (Array.from(part.children) as HTMLElement[]).find((el) => el.matches('.empty-placeholder'));\n const needPlaceholder = this.xd.scrollable.loadedAll.bottom && !chatList.childElementCount/* || true */;\n // chatList.style.display = 'none';\n\n if(needPlaceholder && placeholderContainer) {\n return;\n } else if(!needPlaceholder) {\n if(placeholderContainer) {\n part.classList.remove('with-placeholder');\n placeholderContainer.remove();\n }\n\n return;\n }\n\n let placeholder: ReturnType, type: 'dialogs' | 'folder';\n if(!this.filterId) {\n placeholder = this.generateEmptyPlaceholder({\n title: 'ChatList.Main.EmptyPlaceholder.Title',\n classNameType: type = 'dialogs'\n });\n\n placeholderContainer = placeholder.container;\n\n const img = document.createElement('img');\n img.classList.add('empty-placeholder-dialogs-icon');\n\n this.emptyDialogsPlaceholderSubtitle = new I18n.IntlElement({\n element: placeholder.subtitle\n });\n\n Promise.all([\n this.updateContactsLength(false),\n renderImageFromUrlPromise(img, 'assets/img/EmptyChats.svg'),\n fastRafPromise()\n ]).then(([usersLength]) => {\n placeholderContainer.classList.add('visible');\n part.classList.toggle('has-contacts', !!usersLength);\n });\n\n placeholderContainer.prepend(img);\n } else {\n placeholder = this.generateEmptyPlaceholder({\n title: 'FilterNoChatsToDisplay',\n subtitle: 'FilterNoChatsToDisplayInfo',\n classNameType: type = 'folder'\n });\n\n placeholderContainer = placeholder.container;\n\n const div = document.createElement('div');\n const emoji = '📂';\n const size = 128;\n wrapStickerEmoji({\n div,\n emoji: emoji,\n width: size,\n height: size\n });\n\n placeholderContainer.prepend(div);\n\n const button = Button('btn-primary btn-color-primary btn-control tgico', {\n text: 'FilterHeaderEdit',\n icon: 'settings'\n });\n\n attachClickEvent(button, async() => {\n const tab = appSidebarLeft.createTab(AppEditFolderTab);\n tab.setInitFilter(await this.managers.filtersStorage.getFilter(this.filterId));\n tab.open();\n });\n\n placeholderContainer.append(button);\n }\n\n part.append(placeholderContainer);\n part.classList.add('with-placeholder');\n part.dataset.placeholderType = type;\n }\n\n private updateContactsLength(updatePartClassName: boolean) {\n return this.updateContactsLengthPromise ??= this.managers.appUsersManager.getContacts().then((users) => {\n const subtitle = this.emptyDialogsPlaceholderSubtitle;\n if(subtitle) {\n let key: LangPackKey, args: FormatterArguments;\n\n if(users.length/* && false */) {\n key = 'ChatList.Main.EmptyPlaceholder.Subtitle';\n args = [i18n('Contacts.Count', [users.length])];\n } else {\n key = 'ChatList.Main.EmptyPlaceholder.SubtitleNoContacts';\n args = [];\n }\n\n subtitle.compareAndUpdate({\n key,\n args\n });\n }\n\n if(updatePartClassName) {\n const chatList = this.chatList;\n const part = chatList.parentElement as HTMLElement;\n part.classList.toggle('has-contacts', !!users.length);\n }\n\n this.updateContactsLengthPromise = undefined;\n\n return users.length;\n });\n }\n\n private removeContactsPlaceholder() {\n const chatList = this.chatList;\n const parts = chatList.parentElement.parentElement;\n const bottom = chatList.parentElement.nextElementSibling as HTMLElement;\n parts.classList.remove('with-contacts');\n bottom.replaceChildren();\n this.loadContacts = undefined;\n this.processContact = undefined;\n }\n\n private _onListLengthChange = () => {\n if(!this.xd.loadedDialogsAtLeastOnce) {\n return;\n }\n\n this.checkIfPlaceholderNeeded();\n\n if(this.filterId !== FOLDER_ID_ALL) return;\n\n const chatList = this.chatList;\n const count = chatList.childElementCount;\n\n const parts = chatList.parentElement.parentElement;\n const bottom = chatList.parentElement.nextElementSibling as HTMLElement;\n const hasContacts = !!bottom.childElementCount;\n if(count >= 10) {\n if(hasContacts) {\n this.removeContactsPlaceholder();\n }\n\n return;\n } else if(hasContacts) return;\n\n parts.classList.add('with-contacts');\n\n const section = new SettingSection({\n name: 'Contacts',\n noDelimiter: true,\n fakeGradientDelimiter: true\n });\n\n section.container.classList.add('hide');\n\n this.managers.appUsersManager.getContactsPeerIds(undefined, undefined, 'online').then((contacts) => {\n let ready = false;\n const onListLengthChange = () => {\n if(ready) {\n section.container.classList.toggle('hide', !sortedUserList.list.childElementCount);\n }\n\n this.updateContactsLength(true);\n };\n\n const sortedUserList = new SortedUserList({\n avatarSize: 'abitbigger',\n createChatListOptions: {\n dialogSize: 48,\n new: true\n },\n autonomous: false,\n onListLengthChange,\n managers: this.managers\n });\n\n this.loadContacts = () => {\n const pageCount = windowSize.height / 60 | 0;\n const promise = filterAsync(contacts.splice(0, pageCount), this.verifyPeerIdForContacts);\n\n promise.then((arr) => {\n arr.forEach((peerId) => {\n sortedUserList.add(peerId);\n });\n });\n\n if(!contacts.length) {\n this.loadContacts = undefined;\n }\n };\n\n this.loadContacts();\n\n this.processContact = async(peerId) => {\n if(peerId.isAnyChat()) {\n return;\n }\n\n const good = await this.verifyPeerIdForContacts(peerId);\n const added = sortedUserList.has(peerId);\n if(!added && good) sortedUserList.add(peerId);\n else if(added && !good) sortedUserList.delete(peerId);\n };\n\n const list = sortedUserList.list;\n list.classList.add('chatlist-new');\n this.setListClickListener(list);\n section.content.append(list);\n\n ready = true;\n onListLengthChange();\n });\n\n bottom.append(section.container);\n };\n\n private verifyPeerIdForContacts = async(peerId: PeerId) => {\n const [isContact, dialog] = await Promise.all([\n this.managers.appPeersManager.isContact(peerId),\n this.managers.appMessagesManager.getDialogOnly(peerId)\n ]);\n\n return isContact && !dialog;\n };\n\n public async toggleForumTab(newTab?: ForumTab, hideTab = this.forumTab) {\n if(!hideTab && !newTab) {\n return;\n }\n\n if(hideTab) {\n const dialogElement = this.xd.getDialogElement(hideTab.peerId);\n if(dialogElement) {\n dialogElement.dom.listEl.classList.remove('is-forum-open');\n }\n }\n\n if(hideTab === newTab) {\n newTab = undefined;\n }\n\n hideTab?.toggle(false);\n const promise = newTab?.toggle(true);\n if(hideTab === this.forumTab) {\n this.forumTab = newTab;\n }\n\n if(newTab) {\n const dialogElement = this.xd.getDialogElement(newTab.peerId);\n if(dialogElement) {\n dialogElement.dom.listEl.classList.add('is-forum-open');\n }\n\n appImManager.selectTab(APP_TABS.CHATLIST);\n }\n\n if(promise) {\n await promise;\n }\n\n if(newTab && !this.forumNavigationItem) {\n this.forumNavigationItem = {\n type: 'forum',\n onPop: () => {\n this.forumNavigationItem = undefined;\n this.toggleForumTab();\n }\n };\n\n appNavigationController.pushItem(this.forumNavigationItem);\n } else if(!newTab && this.forumNavigationItem) {\n appNavigationController.removeItem(this.forumNavigationItem);\n this.forumNavigationItem = undefined;\n }\n\n const forwards = !!newTab;\n const useRafs = promise ? 2 : undefined;\n this.xd.toggleAvatarUnreadBadges(forwards, useRafs);\n\n const deferred = deferredPromise();\n const duration = 300;\n SetTransition({\n element: this.forumsSlider.parentElement,\n className: 'is-forum-visible',\n duration,\n forwards,\n useRafs,\n onTransitionEnd: () => {\n deferred.resolve();\n }\n });\n\n dispatchHeavyAnimationEvent(deferred, duration).then(() => deferred.resolve());\n }\n\n public toggleForumTabByPeerId(peerId: PeerId, show?: boolean) {\n const {managers} = this;\n const history = appSidebarLeft.getHistory();\n const lastTab = history[history.length - 1];\n let forumTab: ForumTab;\n if(lastTab/* && !(lastTab instanceof AppArchivedTab) */) {\n if(lastTab instanceof ForumTab && lastTab.peerId === peerId && show) {\n shake(lastTab.container);\n return;\n }\n\n forumTab = appSidebarLeft.createTab(ForumTab);\n forumTab.open({peerId, managers});\n return;\n }\n\n forumTab = this.forumsTabs.get(peerId);\n const isSameTab = this.forumTab && this.forumTab === forumTab;\n show ??= !isSameTab;\n if(show === isSameTab) {\n if(show) {\n shake(forumTab.container);\n }\n\n return;\n }\n\n if(show && !forumTab) {\n forumTab = new ForumTab(undefined);\n forumTab.init({peerId, managers});\n\n this.forumsTabs.set(peerId, forumTab);\n this.forumsSlider.append(forumTab.container);\n\n forumTab.managers = this.managers;\n forumTab.eventListener.addEventListener('destroy', () => {\n this.forumsTabs.delete(peerId);\n });\n }\n\n return this.toggleForumTab(forumTab);\n }\n\n public setListClickListener(\n list: HTMLUListElement,\n onFound?: () => void,\n withContext = false,\n autonomous = false,\n openInner = false\n ) {\n let lastActiveListElement: HTMLElement;\n\n const setPeerFunc = (openInner ? appImManager.setInnerPeer : appImManager.setPeer).bind(appImManager);\n\n list.dataset.autonomous = '' + +autonomous;\n list.addEventListener('mousedown', (e) => {\n if(e.button !== 0) return;\n\n this.log('dialogs click list');\n const target = e.target as HTMLElement;\n const elem = findUpTag(target, DIALOG_LIST_ELEMENT_TAG);\n\n if(!elem) {\n return;\n }\n\n const peerId = elem.dataset.peerId.toPeerId();\n const lastMsgId = +elem.dataset.mid || undefined;\n const threadId = +elem.dataset.threadId || undefined;\n\n onFound?.();\n\n const isForum = !!elem.querySelector('.is-forum');\n if(isForum && !e.shiftKey && !lastMsgId) {\n this.toggleForumTabByPeerId(peerId);\n return;\n }\n\n if(e.ctrlKey || e.metaKey) {\n window.open((elem as HTMLAnchorElement).href || ('#' + peerId), '_blank');\n cancelEvent(e);\n return;\n }\n\n if(autonomous) {\n const sameElement = lastActiveListElement === elem;\n if(lastActiveListElement && !sameElement) {\n lastActiveListElement.classList.remove('active');\n }\n\n if(elem) {\n elem.classList.add('active');\n lastActiveListElement = elem;\n this.lastActiveElements.add(elem);\n }\n }\n\n if(\n (!threadId || lastMsgId) &&\n this.xd.sortedList.list === list &&\n this.xd !== this.xds[FOLDER_ID_ARCHIVE]\n ) {\n this.toggleForumTab();\n }\n\n setPeerFunc({\n peerId,\n lastMsgId,\n threadId: threadId\n });\n }, {capture: true});\n\n // cancel link click\n // ! do not change it to attachClickEvent\n list.addEventListener('click', (e) => {\n if(e.button === 0) {\n cancelEvent(e);\n }\n }, {capture: true});\n\n if(withContext) {\n this.contextMenu.attach(list);\n }\n }\n\n public createChatList(options: {\n // avatarSize?: number,\n // handheldsSize?: number,\n // size?: number,\n new?: boolean,\n dialogSize?: number,\n ignoreClick?: boolean\n } = {}) {\n const list = document.createElement('ul');\n list.classList.add('chatlist'/* ,\n 'chatlist-avatar-' + (options.avatarSize || 54) *//* , 'chatlist-' + (options.size || 72) */);\n\n if(options.new) {\n list.classList.add('chatlist-new');\n }\n\n if(options.dialogSize) {\n list.classList.add('chatlist-' + options.dialogSize);\n }\n\n // if(options.ignoreClick) {\n // list.classList.add('disable-hover');\n // }\n\n /* if(options.handheldsSize) {\n list.classList.add('chatlist-handhelds-' + options.handheldsSize);\n } */\n\n return list;\n }\n\n public setLastMessageN(options: Parameters[0]) {\n const promise = this.setLastMessage(options);\n return promise.catch((err: ApiError) => {\n if(err?.type !== 'MIDDLEWARE') {\n this.log.error('set last message error', err);\n }\n });\n }\n\n private async setLastMessage({\n dialog,\n lastMessage,\n dialogElement,\n highlightWord,\n isBatch = false,\n setUnread = false\n }: {\n dialog: Dialog | ForumTopic,\n lastMessage?: Message.message | Message.messageService,\n dialogElement?: DialogElement,\n highlightWord?: string,\n isBatch?: boolean,\n setUnread?: boolean\n }) {\n if(!dialogElement) {\n dialogElement = this.xd.getDialogElement(dialog.peerId);\n\n if(!dialogElement) {\n return;\n }\n }\n\n const {dom} = dialogElement;\n const {peerId} = dialog;\n\n const {deferred: promise, middleware} = setPromiseMiddleware(dom, 'setLastMessagePromise');\n\n let draftMessage: MyDraftMessage;\n if(!lastMessage) {\n if(\n dialog.draft?._ === 'draftMessage' && (\n !peerId.isAnyChat() ||\n dialog._ === 'forumTopic' ||\n !(await this.managers.appPeersManager.isForum(peerId))\n )\n ) {\n draftMessage = dialog.draft;\n }\n\n lastMessage = (dialog as Dialog).topMessage;\n if(lastMessage?.mid !== dialog.top_message) {\n const promise = this.managers.appMessagesManager.getMessageByPeer(peerId, dialog.top_message);\n lastMessage = await middleware(promise);\n }\n }\n\n const isSearch = setUnread !== null && !setUnread;\n // * do not uncomment `setUnread` - unsetTyping right after this call will interrupt setting unread badges\n if(/* setUnread */!isSearch) {\n this.setUnreadMessagesN({dialog, dialogElement, isBatch, setLastMessagePromise: promise});\n }\n\n if(!lastMessage/* || (lastMessage._ === 'messageService' && !lastMessage.rReply) */) {\n dom.lastMessageSpan.replaceChildren();\n dom.lastTimeSpan.replaceChildren();\n delete dom.listEl.dataset.mid;\n\n promise.resolve();\n return;\n }\n\n const isRestricted = lastMessage && isMessageRestricted(lastMessage as Message.message);\n\n /* if(!dom.lastMessageSpan.classList.contains('user-typing')) */ {\n let mediaContainer: HTMLElement;\n const willPrepend: (Promise | HTMLElement)[] = [];\n if(lastMessage && !draftMessage && !isRestricted) {\n const media = getMediaFromMessage(lastMessage, true);\n const videoTypes: Set = new Set(['video', 'gif', 'round']);\n if(media && (media._ === 'photo' || videoTypes.has(media.type))) {\n const size = choosePhotoSize(media, 20, 20);\n\n if(size._ !== 'photoSizeEmpty') {\n mediaContainer = document.createElement('div');\n mediaContainer.classList.add('dialog-subtitle-media');\n\n if((media as MyDocument).type === 'round') {\n mediaContainer.classList.add('is-round');\n }\n\n willPrepend.push(wrapPhoto({\n photo: media,\n message: lastMessage,\n container: mediaContainer,\n withoutPreloader: true,\n size\n }).then(() => mediaContainer));\n\n if(videoTypes.has((media as MyDocument).type)) {\n const playIcon = document.createElement('span');\n playIcon.classList.add('tgico-play');\n\n mediaContainer.append(playIcon);\n }\n }\n }\n }\n\n /* if(lastMessage.from_id === auth.id) { // You: */\n if(draftMessage) {\n const span = document.createElement('span');\n span.classList.add('danger');\n span.append(i18n('Draft'), ': ');\n willPrepend.unshift(span);\n } else if(peerId.isAnyChat() && peerId !== lastMessage.fromId && !(lastMessage as Message.messageService).action) {\n const span = document.createElement('span');\n span.classList.add('primary-text');\n\n if(lastMessage.fromId === rootScope.myId) {\n span.append(i18n('FromYou'));\n willPrepend.unshift(span);\n } else {\n // str = sender.first_name || sender.last_name || sender.username;\n const p = middleware(wrapPeerTitle({\n peerId: lastMessage.fromId,\n onlyFirstName: true\n })).then((element) => {\n span.prepend(element);\n return span;\n }, noop);\n\n willPrepend.unshift(p);\n }\n\n span.append(': ');\n // console.log(sender, senderBold.innerText);\n }\n\n const withoutMediaType = !!mediaContainer && !!(lastMessage as Message.message)?.message;\n\n let fragment: DocumentFragment;\n if(highlightWord && (lastMessage as Message.message).message) {\n fragment = await middleware(wrapMessageForReply({message: lastMessage, highlightWord, withoutMediaType}));\n } else if(draftMessage) {\n fragment = await middleware(wrapMessageForReply({message: draftMessage}));\n } else if(lastMessage) {\n fragment = await middleware(wrapMessageForReply({message: lastMessage, withoutMediaType}));\n } else { // rare case\n fragment = document.createDocumentFragment();\n }\n\n if(willPrepend.length) {\n const elements = await middleware(Promise.all(willPrepend));\n fragment.prepend(...elements);\n }\n\n replaceContent(dom.lastMessageSpan, fragment);\n }\n\n if(lastMessage || draftMessage/* && lastMessage._ !== 'draftMessage' */) {\n const date = draftMessage ? Math.max(draftMessage.date, lastMessage.date || 0) : lastMessage.date;\n replaceContent(dom.lastTimeSpan, formatDateAccordingToTodayNew(new Date(date * 1000)));\n } else dom.lastTimeSpan.textContent = '';\n\n if(isSearch) {\n dom.listEl.dataset.mid = '' + lastMessage.mid;\n\n const replyTo = lastMessage.reply_to;\n if(replyTo?.pFlags?.forum_topic) {\n dom.listEl.dataset.threadId = '' + getMessageThreadId(lastMessage);\n }\n }\n\n promise.resolve();\n }\n\n public setUnreadMessagesN(options: Parameters[0]) {\n return this.setUnreadMessages(options).catch(() => {});\n }\n\n private async setUnreadMessages({\n dialog,\n dialogElement,\n isBatch = false,\n setLastMessagePromise\n }: {\n dialog: Dialog | ForumTopic,\n dialogElement: DialogElement,\n isBatch?: boolean,\n setLastMessagePromise?: Promise\n }) {\n const {dom} = dialogElement;\n if(!dom) {\n // this.log.error('setUnreadMessages no dom!', dialog);\n return;\n }\n\n const isTopic = dialog._ === 'forumTopic';\n\n const {deferred, middleware} = setPromiseMiddleware(dom, 'setUnreadMessagePromise');\n\n const {peerId} = dialog;\n const promises = Promise.all([\n this.managers.appNotificationsManager.isPeerLocalMuted({peerId: peerId, respectType: true, threadId: isTopic ? dialog.id : undefined}),\n dialog.draft?._ !== 'draftMessage' ? this.managers.appMessagesManager.getMessageByPeer(peerId, dialog.top_message) : undefined,\n isTopic ? !!dialog.pFlags.pinned : this.managers.dialogsStorage.isDialogPinned(peerId, this.filterId),\n this.managers.appMessagesManager.isDialogUnread(dialog),\n peerId.isAnyChat() && !isTopic ? this.managers.acknowledged.dialogsStorage.getForumUnreadCount(peerId).then((result) => {\n if(result.cached) {\n return result.result;\n } else {\n result.result.then(() => {\n this.setUnreadMessagesN({dialog, dialogElement});\n });\n\n return {count: 0, hasUnmuted: false};\n }\n }).catch(() => undefined as {count: number, hasUnmuted: boolean}) : undefined\n ]);\n\n let [isMuted, lastMessage, isPinned, isDialogUnread, forumUnreadCount] = await middleware(promises);\n const wasMuted = dom.listEl.classList.contains('is-muted');\n\n const {count: unreadTopicsCount, hasUnmuted: hasUnmutedTopic} = forumUnreadCount || {};\n\n let setStatusMessage: MyMessage;\n if(lastMessage && lastMessage.pFlags.out && lastMessage.peerId !== rootScope.myId) {\n setStatusMessage = lastMessage;\n }\n\n const unreadCount = unreadTopicsCount ?? dialog.unread_count;\n if(unreadTopicsCount !== undefined) {\n isDialogUnread = !!unreadCount;\n }\n\n if(isTopic && !isDialogUnread) {\n isDialogUnread = !getServerMessageId(dialog.read_inbox_max_id);\n }\n\n const hasUnreadBadge = isPinned || isDialogUnread;\n const hasUnreadAvatarBadge = this.xd !== this.xds[FOLDER_ID_ARCHIVE] && !isTopic && !!this.forumTab && this.xd.getDialogElement(peerId) === dialogElement && isDialogUnread;\n // dom.messageEl.classList.toggle('has-badge', hasBadge);\n\n // * have to await all promises before modifying something\n\n if(setLastMessagePromise) {\n try {\n await middleware(setLastMessagePromise);\n } catch(err) {\n return;\n }\n }\n\n const transitionDuration = isBatch ? 0 : BADGE_TRANSITION_TIME;\n\n dom.listEl.classList.toggle('no-unmuted-topic', !isMuted && hasUnmutedTopic !== undefined && !hasUnmutedTopic);\n\n if(isMuted !== wasMuted) {\n SetTransition({\n element: dom.listEl,\n className: 'is-muted',\n forwards: isMuted,\n duration: transitionDuration\n });\n }\n\n setSendingStatus(dom.statusSpan, isTopic && dialog.pFlags.closed ? 'premium_lock' : setStatusMessage, true);\n\n // if(isTopic) {\n // dom.statusSpan.parentElement.classList.toggle('is-closed', !!dialog.pFlags.closed);\n // }\n\n const isUnreadBadgeMounted = !!dom.unreadBadge;\n if(hasUnreadBadge) {\n dialogElement.createUnreadBadge();\n }\n\n const isUnreadAvatarBadgeMounted = !!dom.unreadAvatarBadge;\n if(hasUnreadAvatarBadge) {\n dialogElement.createUnreadAvatarBadge();\n }\n\n const hasMentionsBadge = dialog.unread_mentions_count && (dialog.unread_mentions_count > 1 || dialog.unread_count > 1);\n const isMentionsBadgeMounted = !!dom.mentionsBadge;\n if(hasMentionsBadge) {\n dialogElement.createMentionsBadge();\n }\n\n const a: [Parameters[0], boolean, boolean][] = [\n ['unreadBadge', hasUnreadBadge, isUnreadBadgeMounted],\n ['unreadAvatarBadge', hasUnreadAvatarBadge, isUnreadAvatarBadgeMounted],\n ['mentionsBadge', hasMentionsBadge, isMentionsBadgeMounted]\n ];\n\n a.forEach(([key, hasBadge, isBadgeMounted]) => {\n const badge = dom[key];\n if(!badge) {\n return;\n }\n\n dialogElement.toggleBadgeByKey(key, hasBadge, isBadgeMounted, isBatch);\n });\n\n if(!hasUnreadBadge) {\n deferred.resolve();\n return;\n }\n\n if(isPinned) {\n dom.unreadBadge.classList.add('tgico-chatspinned', 'tgico');\n } else if(dom.unreadBadge) {\n dom.unreadBadge.classList.remove('tgico-chatspinned', 'tgico');\n }\n\n let isUnread = true, isMention = false, unreadBadgeText: string;\n if(dialog.unread_mentions_count && unreadCount === 1) {\n unreadBadgeText = '@';\n isMention = true;\n // dom.unreadBadge.classList.add('tgico-mention', 'tgico');\n } else if(isDialogUnread) {\n // dom.unreadMessagesSpan.innerText = '' + (unreadCount ? formatNumber(unreadCount, 1) : ' ');\n unreadBadgeText = '' + (unreadCount ? formatNumber(unreadCount, 1) : ' ');\n } else {\n unreadBadgeText = '';\n isUnread = false;\n }\n\n if(isTopic) {\n const notVisited = isDialogUnread && unreadBadgeText === ' ';\n dom.unreadBadge.classList.toggle('not-visited', notVisited);\n }\n\n const b: Array<[HTMLElement, string]> = [\n [dom.unreadBadge, unreadBadgeText],\n [dom.unreadAvatarBadge, unreadBadgeText || undefined]\n ];\n\n b.filter(Boolean).forEach(([badge, text]) => {\n if(text !== undefined) {\n badge.innerText = unreadBadgeText;\n }\n\n badge.classList.toggle('unread', isUnread);\n badge.classList.toggle('mention', isMention);\n });\n\n deferred.resolve();\n }\n\n private async getDialog(dialog: Dialog | ForumTopic | PeerId, threadId?: number) {\n if(typeof(dialog) !== 'object') {\n let originalDialog: Dialog | ForumTopic;\n if(threadId) {\n originalDialog = await this.managers.dialogsStorage.getForumTopic(dialog, threadId);\n if(!originalDialog) {\n const peerId = dialog || NULL_PEER_ID;\n return {\n peerId,\n pFlags: {}\n } as any as ForumTopic;\n }\n } else {\n originalDialog = await this.managers.appMessagesManager.getDialogOnly(dialog);\n if(!originalDialog) {\n const peerId = dialog || NULL_PEER_ID;\n return {\n peerId,\n peer: await this.managers.appPeersManager.getOutputPeer(peerId),\n pFlags: {}\n } as any as Dialog;\n }\n }\n\n return originalDialog;\n }\n\n return dialog as Dialog | ForumTopic;\n }\n\n public addListDialog(options: Parameters[0] & {isBatch?: boolean}) {\n options.autonomous = false;\n\n const ret = this.addDialogNew(options);\n\n if(ret) {\n const {peerId} = options;\n const getDialogPromise = this.getDialog(peerId, options.threadId);\n const promise = getDialogPromise.then((dialog) => {\n const promises: Promise[] = [];\n const isUser = peerId.isUser();\n if(!isUser && dialog._ === 'dialog') {\n promises.push(this.xd.processDialogForCallStatus(peerId, ret.dom));\n }\n\n if(peerId !== rootScope.myId && isUser) {\n promises.push(this.managers.appUsersManager.getUserStatus(peerId.toUserId()).then((status) => {\n if(status?._ === 'userStatusOnline') {\n this.xd.setOnlineStatus(ret.dom.avatarEl, true);\n }\n }));\n }\n\n promises.push(this.setLastMessageN({\n dialog,\n dialogElement: ret,\n isBatch: options.isBatch,\n setUnread: true\n }));\n\n return Promise.all(promises);\n });\n\n options.loadPromises?.push(promise);\n }\n\n return ret;\n }\n\n /**\n * use for rendering search result\n */\n public addDialogAndSetLastMessage(options: Omit[0], 'dialog'> & {\n message: MyMessage,\n peerId: PeerId,\n query?: string\n }) {\n const {peerId, message, query} = options;\n const ret = this.addDialogNew({\n ...options,\n ...getMessageSenderPeerIdOrName(message),\n peerId\n });\n\n this.setLastMessageN({\n dialog: {_: 'dialog', peerId} as any,\n lastMessage: message,\n dialogElement: ret,\n highlightWord: query\n });\n\n if(message.peerId !== peerId) {\n ret.dom.listEl.dataset.peerId = '' + message.peerId;\n }\n\n return ret;\n }\n\n public addDialogNew(options: DialogElementOptions & {container?: HTMLElement | Scrollable | false, append?: boolean}) {\n const d = new DialogElement({\n autonomous: !!options.container,\n avatarSize: 'bigger',\n ...options\n // avatarSize: !options.avatarSize || options.avatarSize >= 54 ? 'bigger' : 'abitbigger',\n });\n\n if(options.container) {\n const method = !options.append ? 'append' : 'prepend';\n options.container[method](d.container);\n }\n\n return d;\n // return this.addDialog(options.peerId, options.container, options.rippleEnabled, options.onlyFirstName, options.meAsSaved, options.append, options.avatarSize, options.autonomous, options.lazyLoadQueue, options.loadPromises, options.fromName, options.noIcons);\n }\n}\n\nconst appDialogsManager = new AppDialogsManager();\nMOUNT_CLASS_TO.appDialogsManager = appDialogsManager;\nexport default appDialogsManager;\n","export default function getUnsafeRandomInt(min: number, max: number) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {DownloadMediaOptions, DownloadOptions} from '../mtproto/apiFileManager';\nimport type {AppMessagesManager} from './appMessagesManager';\nimport type {MyDocument} from './appDocsManager';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport {InputFile, Photo, PhotoSize} from '../../layer';\nimport getFileNameForUpload from '../../helpers/getFileNameForUpload';\nimport {AppManagers} from './managers';\nimport rootScope from '../rootScope';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport noop from '../../helpers/noop';\nimport getDownloadMediaDetails from './utils/download/getDownloadMediaDetails';\nimport getDownloadFileNameFromOptions from './utils/download/getDownloadFileNameFromOptions';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport makeError from '../../helpers/makeError';\nimport createDownloadAnchor from '../../helpers/dom/createDownloadAnchor';\nimport {getFileNameByLocation} from '../../helpers/fileName';\nimport getDocumentDownloadOptions from './utils/docs/getDocumentDownloadOptions';\nimport getPhotoDownloadOptions from './utils/photos/getPhotoDownloadOptions';\nimport apiManagerProxy from '../mtproto/mtprotoworker';\n\nexport type ResponseMethodBlob = 'blob';\nexport type ResponseMethodJson = 'json';\nexport type ResponseMethod = ResponseMethodBlob | ResponseMethodJson;\n\n/* export type DownloadBlob = {promise: Promise, controller: AbortController};\nexport type DownloadJson = {promise: Promise, controller: AbortController}; */\nexport type DownloadBlob = CancellablePromise;\nexport type DownloadUrl = CancellablePromise;\nexport type DownloadJson = CancellablePromise;\n// export type Download = DownloadBlob/* | DownloadJson */;\nexport type Download = DownloadBlob | DownloadUrl/* | DownloadJson */;\n\nexport type Progress = {done: number, fileName: string, total: number, offset: number};\nexport type ProgressCallback = (details: Progress) => void;\n\ntype DownloadType = 'url' | 'blob' | 'void' | 'disc';\n\nexport class AppDownloadManager {\n private downloads: {[fileName: string]: {main: Download} & {[type in DownloadType]?: Download}} = {};\n // private downloadsToDisc: {[fileName: string]: Download} = {};\n private progress: {[fileName: string]: Progress} = {};\n // private progressCallbacks: {[fileName: string]: Array} = {};\n private managers: AppManagers;\n\n public construct(managers: AppManagers) {\n this.managers = managers;\n rootScope.addEventListener('download_progress', (details) => {\n // const callbacks = this.progressCallbacks[details.fileName];\n // if(callbacks) {\n // callbacks.forEach((callback) => callback(details));\n // }\n\n const download = this.downloads[details.fileName];\n if(download?.main?.notifyAll) {\n this.progress[details.fileName] = details;\n download.main.notifyAll(details);\n }\n });\n }\n\n private getNewDeferred(fileName: string, type?: DownloadType) {\n const deferred = deferredPromise();\n\n let download = this.downloads[fileName];\n if(!download) {\n download = this.downloads[fileName] = {\n main: deferred as any\n };\n\n deferred.cancel = () => {\n const error = makeError('DOWNLOAD_CANCELED');\n\n this.managers.apiFileManager.cancelDownload(fileName);\n\n deferred.reject(error);\n deferred.cancel = noop;\n };\n\n deferred.catch(() => {\n this.clearDownload(fileName, type);\n }).finally(() => {\n delete this.progress[fileName];\n // delete this.progressCallbacks[fileName];\n });\n } else {\n const main = download.main;\n (['cancel', 'addNotifyListener', 'notify', 'notifyAll'] as (keyof CancellablePromise)[]).forEach((key) => {\n if(!main[key]) {\n return;\n }\n\n // @ts-ignore\n deferred[key] = main[key].bind(main);\n });\n }\n\n const haveToClear = type === 'disc';\n if(haveToClear) {\n deferred.catch(noop).finally(() => {\n this.clearDownload(fileName, type);\n });\n }\n\n return download[type] = deferred as any;\n }\n\n public getNewDeferredForUpload>(fileName: string, promise: T) {\n const deferred = this.getNewDeferred(fileName);\n promise.then(deferred.resolve, deferred.reject);\n\n deferred.finally(() => {\n this.clearDownload(fileName);\n });\n\n return deferred as CancellablePromise>;\n }\n\n private clearDownload(fileName: string, type?: DownloadType) {\n const downloads = this.downloads[fileName];\n if(!downloads) {\n return;\n }\n\n delete downloads[type];\n\n const length = Object.keys(downloads).length;\n if(!length || (downloads.main && length === 1)) {\n delete this.downloads[fileName];\n }\n }\n\n public getUpload(fileName: string): ReturnType['promise'] {\n let deferred: CancellablePromise = this.getDownload(fileName);\n if(deferred) {\n return deferred;\n }\n\n deferred = this.getNewDeferred(fileName);\n this.managers.appMessagesManager.getUploadPromise(fileName).then(deferred.resolve, deferred.reject);\n return deferred;\n }\n\n /* public fakeDownload(fileName: string, value: Blob | string) {\n const deferred = this.getNewDeferred(fileName);\n if(typeof(value) === 'string') {\n fetch(value)\n .then((response) => response.blob())\n .then((blob) => deferred.resolve(blob));\n } else {\n deferred.resolve(value);\n }\n\n return deferred;\n } */\n\n private d(fileName: string, getPromise: () => Promise, type?: DownloadType) {\n let deferred = this.getDownload(fileName, type);\n if(deferred) return deferred;\n\n deferred = this.getNewDeferred(fileName, type);\n getPromise().then(deferred.resolve, deferred.reject);\n return deferred;\n }\n\n public download(options: DownloadOptions): DownloadBlob {\n const fileName = getDownloadFileNameFromOptions(options);\n return this.d(fileName, () => this.managers.apiFileManager.download(options), 'blob') as any;\n }\n\n public downloadMedia(options: DownloadMediaOptions, type: DownloadType = 'blob', promiseBefore?: Promise): DownloadBlob {\n const {downloadOptions, fileName} = getDownloadMediaDetails(options);\n\n return this.d(fileName, () => {\n let cb: any;\n if(type === 'url') {\n cb = this.managers.apiFileManager.downloadMediaURL;\n } else if(type === 'void'/* || type === 'disc' */) {\n cb = this.managers.apiFileManager.downloadMediaVoid;\n } else /* if(type === 'blob') */ {\n cb = this.managers.apiFileManager.downloadMedia;\n }\n\n if(promiseBefore) {\n return promiseBefore.then(() => cb(options));\n }\n\n return cb(options);\n }, type) as any;\n }\n\n public downloadMediaURL(options: DownloadMediaOptions): DownloadUrl {\n return this.downloadMedia(options, 'url') as any;\n }\n\n public downloadMediaVoid(options: DownloadMediaOptions): DownloadBlob {\n return this.downloadMedia(options, 'void');\n }\n\n public upload(file: File | Blob, fileName?: string, promise?: Promise) {\n if(!fileName) {\n fileName = getFileNameForUpload(file);\n }\n\n if(!promise) {\n promise = this.managers.apiFileManager.upload({file, fileName});\n }\n\n const deferred = this.getNewDeferredForUpload(fileName, promise);\n return deferred as any as CancellablePromise;\n }\n\n public getDownload(fileName: string, type?: DownloadType) {\n const d = this.downloads[fileName];\n return d && d[type];\n }\n\n // public addProgressCallback(fileName: string, callback: ProgressCallback) {\n // const progress = this.progress[fileName];\n // (this.progressCallbacks[fileName] ?? (this.progressCallbacks[fileName] = [])).push(callback);\n\n // if(progress) {\n // callback(progress);\n // }\n // }\n\n public downloadToDisc(options: DownloadMediaOptions, justAttach?: boolean) {\n const media = options.media;\n const isDocument = media._ === 'document';\n if(!isDocument && !options.thumb) {\n options.thumb = (media as Photo.photo).sizes.slice().pop() as PhotoSize.photoSize;\n }\n\n // const {fileName: cacheFileName} = getDownloadMediaDetails(options);\n // if(justAttach) {\n // const promise = this.downloadsToDisc[cacheFileName];\n // if(promise) {\n // return promise;\n // }\n // }\n\n // const {downloadOptions, fileName} = getDownloadMediaDetails(options);\n // if(downloadOptions.size && downloadOptions.size > MAX_FILE_SAVE_SIZE) {\n const id = '' + (Math.random() * 0x7FFFFFFF | 0);\n // const id = 'test';\n const url = `download/${id}`;\n options.downloadId = id;\n\n const pingPromise = apiManagerProxy.pingServiceWorkerWithIframe();\n\n const promise = this.downloadMedia(options, 'disc', pingPromise);\n // this.downloadsToDisc[cacheFileName] = promise;\n\n if(justAttach) {\n return promise;\n }\n\n const iframe = document.createElement('iframe');\n iframe.hidden = true;\n\n pingPromise.then(() => {\n iframe.src = url;\n document.body.append(iframe);\n });\n\n // createDownloadAnchor(url, 'asd.txt');\n\n // const events = [\n // 'emptied',\n // 'abort',\n // 'suspend',\n // 'reset',\n // 'error',\n // 'ended',\n // 'load'\n // ].forEach((event) => {\n // iframe.addEventListener(event, () => alert(event));\n // iframe.contentWindow.addEventListener(event, () => alert(event));\n // });\n\n let element: HTMLElement, hadProgress = false;\n const onProgress = () => {\n if(hadProgress) {\n return;\n }\n\n hadProgress = true;\n element = iframe;\n\n indexOfAndSplice(promise.listeners, onProgress);\n };\n\n promise.addNotifyListener(onProgress);\n promise.then((blob) => {\n if(!blob) {\n return;\n }\n\n const url = URL.createObjectURL(blob);\n const downloadOptions = isDocument ?\n getDocumentDownloadOptions(media) :\n getPhotoDownloadOptions(media as any, options.thumb as PhotoSize.photoSize);\n const fileName = (options.media as MyDocument).file_name || getFileNameByLocation(downloadOptions.location);\n createDownloadAnchor(url, downloadOptions.fileName || fileName, () => {\n URL.revokeObjectURL(url);\n });\n }).catch(noop).finally(() => {\n if(!hadProgress) {\n onProgress();\n }\n\n setTimeout(() => {\n element?.remove();\n }, 1000);\n\n // if(this.downloadsToDisc[cacheFileName] === promise) {\n // delete this.downloadsToDisc[cacheFileName];\n // }\n });\n\n return promise;\n }\n}\n\nconst appDownloadManager = new AppDownloadManager();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.appDownloadManager = appDownloadManager);\nexport default appDownloadManager;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function createDownloadAnchor(url: string, fileName: string, onRemove?: () => void) {\n const a = document.createElement('a');\n a.href = url;\n a.download = fileName;\n a.target = '_blank';\n\n a.style.position = 'absolute';\n a.style.top = '1px';\n a.style.left = '1px';\n\n document.body.append(a);\n\n try {\n const clickEvent = document.createEvent('MouseEvents');\n clickEvent.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n a.dispatchEvent(clickEvent);\n } catch(e) {\n console.error('Download click error', e);\n try {\n a.click();\n } catch(e) {\n window.open(url as string, '_blank');\n }\n }\n\n setTimeout(() => {\n a.remove();\n onRemove && onRemove();\n }, 100);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type Chat from './chat';\nimport type ChatTopbar from './topbar';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport DivAndCaption from '../divAndCaption';\nimport ripple from '../ripple';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport {Message} from '../../layer';\nimport safeAssign from '../../helpers/object/safeAssign';\n\nconst classNames: string[] = ['is-pinned-message-shown', 'is-pinned-audio-shown'];\nconst CLASSNAME_BASE = 'pinned-container';\nconst HEIGHT = 52;\n\nexport default class PinnedContainer {\n public wrapperUtils: HTMLElement;\n public btnClose: HTMLElement;\n protected wrapper: HTMLElement;\n\n protected topbar: ChatTopbar;\n protected chat: Chat;\n protected listenerSetter: ListenerSetter;\n public className: string;\n public divAndCaption: DivAndCaption<(title: string | HTMLElement | DocumentFragment, subtitle: string | HTMLElement | DocumentFragment, message?: any) => void>;\n\n protected floating = false;\n\n public onClose?: () => void | Promise;\n\n constructor(options: {\n topbar: PinnedContainer['topbar'],\n chat: PinnedContainer['chat'],\n listenerSetter: PinnedContainer['listenerSetter'],\n className: PinnedContainer['className'],\n divAndCaption: PinnedContainer['divAndCaption'],\n onClose?: PinnedContainer['onClose'],\n floating?: PinnedContainer['floating']\n }) {\n safeAssign(this, options);\n\n const {divAndCaption, className} = this;\n divAndCaption.container.classList.add(CLASSNAME_BASE, 'hide');\n divAndCaption.title.classList.add(CLASSNAME_BASE + '-title');\n divAndCaption.subtitle.classList.add(CLASSNAME_BASE + '-subtitle');\n divAndCaption.content.classList.add(CLASSNAME_BASE + '-content');\n\n this.btnClose = document.createElement('button');\n this.btnClose.classList.add(CLASSNAME_BASE + '-close', `pinned-${className}-close`, 'btn-icon', 'tgico-close');\n\n this.wrapper = document.createElement('div');\n this.wrapper.classList.add(CLASSNAME_BASE + '-wrapper');\n ripple(this.wrapper);\n\n this.wrapperUtils = document.createElement('div');\n this.wrapperUtils.classList.add(CLASSNAME_BASE + '-wrapper-utils');\n this.wrapperUtils.append(this.btnClose);\n\n this.wrapper.append(...Array.from(divAndCaption.container.children), this.wrapperUtils);\n\n divAndCaption.container.append(this.wrapper/* , this.close */);\n\n this.attachOnCloseEvent(this.btnClose);\n }\n\n public attachOnCloseEvent(elem: HTMLElement) {\n attachClickEvent(elem, (e) => {\n cancelEvent(e);\n\n ((this.onClose ? this.onClose() : null) || Promise.resolve(true)).then((needClose) => {\n if(needClose) {\n this.toggle(true);\n }\n });\n }, {listenerSetter: this.listenerSetter});\n }\n\n public toggle(hide?: boolean) {\n const isHidden = this.divAndCaption.container.classList.contains('hide');\n if(hide === undefined) {\n hide = !isHidden;\n } else if(hide === isHidden) {\n return;\n }\n\n // const scrollable = this.chat.bubbles.scrollable;\n\n const isFloating = (this.floating || mediaSizes.isMobile) && !hide;\n // const scrollTop = isFloating || this.divAndCaption.container.classList.contains('is-floating') ? scrollable.scrollTop : undefined;\n\n this.divAndCaption.container.classList.toggle('is-floating', isFloating);\n this.divAndCaption.container.classList.toggle('hide', hide);\n\n this.topbar.container.classList.toggle('is-pinned-floating', isFloating);\n this.topbar.container.classList.toggle(`is-pinned-${this.className}-shown`, !hide);\n\n // const active = classNames.filter((className) => this.topbar.container.classList.contains(className));\n // const maxActive = hide ? 0 : 1;\n\n // * not sure when it became unneeded\n // if(scrollTop !== undefined && active.length <= maxActive/* && !scrollable.isScrolledDown */) {\n // scrollable.scrollTop = scrollTop + ((hide ? -1 : 1) * HEIGHT);\n // }\n\n this.topbar.setFloating();\n this.topbar.setUtilsWidth();\n }\n\n public isVisible() {\n return !this.divAndCaption.container.classList.contains('hide');\n }\n\n public isFloating() {\n return this.divAndCaption.container.classList.contains('is-floating');\n }\n\n public fill(title: string | HTMLElement | DocumentFragment, subtitle: string | HTMLElement | DocumentFragment, message: Message.message) {\n this.divAndCaption.container.dataset.peerId = '' + message.peerId;\n this.divAndCaption.container.dataset.mid = '' + message.mid;\n this.divAndCaption.fill(title, subtitle, message);\n this.topbar.setUtilsWidth();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AppMessagesManager} from '../../lib/appManagers/appMessagesManager';\nimport type ChatTopbar from './topbar';\nimport rootScope from '../../lib/rootScope';\nimport appMediaPlaybackController, {AppMediaPlaybackController} from '../appMediaPlaybackController';\nimport DivAndCaption from '../divAndCaption';\nimport PinnedContainer from './pinnedContainer';\nimport Chat from './chat';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport PeerTitle from '../peerTitle';\nimport {i18n} from '../../lib/langPack';\nimport {formatFullSentTime} from '../../helpers/date';\nimport ButtonIcon from '../buttonIcon';\nimport {DocumentAttribute} from '../../layer';\nimport MediaProgressLine from '../mediaProgressLine';\nimport VolumeSelector from '../volumeSelector';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport {AppManagers} from '../../lib/appManagers/managers';\n\nexport default class ChatAudio extends PinnedContainer {\n private toggleEl: HTMLElement;\n private progressLine: MediaProgressLine;\n private volumeSelector: VolumeSelector;\n private fasterEl: HTMLElement;\n private repeatEl: HTMLButtonElement;\n\n constructor(protected topbar: ChatTopbar, protected chat: Chat, protected managers: AppManagers) {\n super({\n topbar,\n chat,\n listenerSetter: topbar.listenerSetter,\n className: 'audio',\n divAndCaption: new DivAndCaption(\n 'pinned-audio',\n (title: string | HTMLElement | DocumentFragment, subtitle: string | HTMLElement | DocumentFragment) => {\n replaceContent(this.divAndCaption.title, title);\n replaceContent(this.divAndCaption.subtitle, subtitle);\n }\n ),\n onClose: () => {\n appMediaPlaybackController.stop(undefined, true);\n },\n floating: true\n });\n\n this.divAndCaption.border.remove();\n\n const prevEl = ButtonIcon('fast_rewind active', {noRipple: true});\n const nextEl = ButtonIcon('fast_forward active', {noRipple: true});\n\n const attachClick = (elem: HTMLElement, callback: () => void) => {\n attachClickEvent(elem, (e) => {\n cancelEvent(e);\n callback();\n }, {listenerSetter: this.topbar.listenerSetter});\n };\n\n attachClick(prevEl, () => {\n appMediaPlaybackController.previous();\n });\n\n attachClick(nextEl, () => {\n appMediaPlaybackController.next();\n });\n\n this.toggleEl = ButtonIcon('', {noRipple: true});\n this.toggleEl.classList.add('active', 'pinned-audio-ico', 'tgico');\n attachClick(this.toggleEl, () => {\n appMediaPlaybackController.toggle();\n });\n this.wrapper.prepend(this.wrapper.firstElementChild, prevEl, this.toggleEl, nextEl);\n\n this.volumeSelector = new VolumeSelector(this.listenerSetter, true);\n const volumeProgressLineContainer = document.createElement('div');\n volumeProgressLineContainer.classList.add('progress-line-container');\n volumeProgressLineContainer.append(this.volumeSelector.container);\n const tunnel = document.createElement('div');\n tunnel.classList.add('pinned-audio-volume-tunnel');\n this.volumeSelector.btn.classList.add('pinned-audio-volume', 'active');\n this.volumeSelector.btn.prepend(tunnel);\n this.volumeSelector.btn.append(volumeProgressLineContainer);\n\n this.repeatEl = ButtonIcon('audio_repeat', {noRipple: true});\n attachClick(this.repeatEl, () => {\n const params = appMediaPlaybackController.getPlaybackParams();\n if(!params.round) {\n appMediaPlaybackController.round = true;\n } else if(params.loop) {\n appMediaPlaybackController.round = false;\n appMediaPlaybackController.loop = false;\n } else {\n appMediaPlaybackController.loop = !appMediaPlaybackController.loop;\n }\n });\n\n const fasterEl = this.fasterEl = ButtonIcon('playback_2x', {noRipple: true});\n attachClick(fasterEl, () => {\n appMediaPlaybackController.playbackRate = fasterEl.classList.contains('active') ? 1 : 1.75;\n });\n\n this.wrapperUtils.prepend(this.volumeSelector.btn, fasterEl, this.repeatEl);\n\n const progressWrapper = document.createElement('div');\n progressWrapper.classList.add('pinned-audio-progress-wrapper');\n\n this.progressLine = new MediaProgressLine({\n withTransition: true,\n useTransform: true\n });\n this.progressLine.container.classList.add('pinned-audio-progress');\n progressWrapper.append(this.progressLine.container);\n this.wrapper.insertBefore(progressWrapper, this.wrapperUtils);\n\n this.topbar.listenerSetter.add(appMediaPlaybackController)('play', this.onMediaPlay);\n this.topbar.listenerSetter.add(appMediaPlaybackController)('pause', this.onPause);\n this.topbar.listenerSetter.add(appMediaPlaybackController)('stop', this.onStop);\n this.topbar.listenerSetter.add(appMediaPlaybackController)('playbackParams', this.onPlaybackParams);\n\n const playingDetails = appMediaPlaybackController.getPlayingDetails();\n if(playingDetails) {\n this.onMediaPlay(playingDetails);\n this.onPlaybackParams(playingDetails.playbackParams);\n }\n }\n\n public destroy() {\n if(this.progressLine) {\n this.progressLine.removeListeners();\n }\n }\n\n private onPlaybackParams = (playbackParams: ReturnType) => {\n this.fasterEl.classList.toggle('active', playbackParams.playbackRate > 1);\n\n this.repeatEl.classList.remove('tgico-audio_repeat', 'tgico-audio_repeat_single');\n this.repeatEl.classList.add(playbackParams.loop ? 'tgico-audio_repeat_single' : 'tgico-audio_repeat');\n this.repeatEl.classList.toggle('active', playbackParams.loop || playbackParams.round);\n };\n\n private onPause = () => {\n this.toggleEl.classList.remove('flip-icon');\n };\n\n private onStop = () => {\n this.toggle(true);\n };\n\n private onMediaPlay = ({doc, message, media, playbackParams}: ReturnType) => {\n let title: string | HTMLElement | DocumentFragment, subtitle: string | HTMLElement | DocumentFragment;\n const isMusic = doc.type !== 'voice' && doc.type !== 'round';\n if(!isMusic) {\n title = new PeerTitle({peerId: message.fromId, fromName: message.fwd_from?.from_name}).element;\n\n // subtitle = 'Voice message';\n subtitle = formatFullSentTime(message.date);\n } else {\n const audioAttribute = doc.attributes.find((attr) => attr._ === 'documentAttributeAudio') as DocumentAttribute.documentAttributeAudio;\n title = wrapEmojiText(audioAttribute?.title ?? doc.file_name);\n subtitle = audioAttribute?.performer ? wrapEmojiText(audioAttribute.performer) : i18n('AudioUnknownArtist');\n }\n\n this.fasterEl.classList.toggle('hide', isMusic);\n this.repeatEl.classList.toggle('hide', !isMusic);\n\n this.onPlaybackParams(playbackParams);\n this.volumeSelector.setVolume();\n\n this.progressLine.setMedia({\n media,\n duration: doc.duration\n });\n\n this.fill(title, subtitle, message);\n // this.toggleEl.classList.add('flip-icon');\n this.toggleEl.classList.toggle('flip-icon', !media.paused);\n this.toggle(false);\n };\n}\n","// https://github.com/evgeny-nadymov/telegram-react/blob/master/src/Components/ColumnMiddle/PinnedMessageBorder.js\n\nenum BAR_HEIGHTS {\n ONE = 32,\n TWO = 15,\n THREE = 10,\n FOUR = 8,\n MORE = 8\n};\n\nconst GAP = 1;\nconst WIDTH = 2;\nconst BASE_CLASS = 'pinned-message-border';\n\nexport default class PinnedMessageBorder {\n private border: HTMLElement;\n private wrapper: HTMLElement;\n private svg: SVGSVGElement;\n private defs: SVGDefsElement;\n private clipPath: SVGClipPathElement;\n private path: SVGPathElement;\n private mark: HTMLElement;\n\n private count: number;\n private index: number;\n\n private drawRect = (x: number, y: number, width: number, height: number, radius: number) => {\n return `M${x},${y + radius}a${radius},${radius},0,0,1,${width},0v${height - 2 * radius}a${radius},${radius},0,0,1,${-width},0Z`;\n };\n\n private getClipPath = (id: string, barHeight: number, count: number) => {\n const radius = 1;\n\n let d = '';\n /* if(count === 3) {\n d = this.drawRect(0, 0, WIDTH, barHeight, radius)\n + this.drawRect(0, barHeight + GAP, WIDTH, barHeight + 1, radius)\n + this.drawRect(0, barHeight * 2 + GAP * 2 + 1, WIDTH, barHeight, radius);\n } */if(count === 2) {\n d = this.drawRect(0, 0, WIDTH, barHeight, radius) + this.drawRect(0, barHeight + GAP * 2, WIDTH, barHeight, radius);\n } else {\n for(let i = 0; i < count; ++i) {\n d += this.drawRect(0, (barHeight + GAP) * i, WIDTH, barHeight, radius);\n }\n }\n\n if(!this.clipPath) {\n this.clipPath = document.createElementNS('http://www.w3.org/2000/svg', 'clipPath');\n this.path = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n\n this.clipPath.append(this.path);\n }\n\n this.clipPath.id = id;\n this.path.setAttributeNS(null, 'd', d);\n\n return this.clipPath;\n };\n\n private getBarHeight = (count: number, index: number) => {\n let barHeight: number;\n if(count <= 1) {\n barHeight = BAR_HEIGHTS.ONE;\n } else if(count === 2) {\n barHeight = BAR_HEIGHTS.TWO;\n } else if(count === 3) {\n barHeight = BAR_HEIGHTS.THREE;\n } else if(count === 4) {\n barHeight = BAR_HEIGHTS.FOUR;\n } else if(count > 3) {\n barHeight = BAR_HEIGHTS.MORE;\n }\n\n return barHeight;\n };\n\n private getMarkHeight = (count: number, index: number) => {\n let markHeight: number;\n if(count <= 1) {\n markHeight = BAR_HEIGHTS.ONE;\n } else if(count === 2) {\n markHeight = BAR_HEIGHTS.TWO;\n } else if(count === 3) {\n markHeight = BAR_HEIGHTS.THREE;\n } else if(count === 4) {\n markHeight = BAR_HEIGHTS.FOUR;\n } else if(count > 3) {\n markHeight = BAR_HEIGHTS.MORE;\n }\n\n return markHeight;\n };\n\n private getMarkTranslateY = (index: number, barHeight: number, count: number) => {\n if(count === 1) {\n return 0;\n } else if(count === 2) {\n return !index ? 0 : barHeight + GAP;\n }\n\n if(count === 3) {\n if(!index) {\n return 0;\n } else if(index === 1) {\n return barHeight + GAP;\n }\n\n return barHeight * 2 + GAP * 2 + 1;\n } else {\n return (barHeight + GAP) * index;\n }\n };\n\n private getTrackTranslateY = (index: number, count: number, barHeight: number, trackHeight: number) => {\n if(count <= 4) {\n return 0;\n }\n\n if(index <= 1) {\n return 0;\n } else if(index >= (count - 2)) {\n return trackHeight - BAR_HEIGHTS.ONE - barHeight;\n }\n\n // return (index + 1) * barHeight + index * GAP;\n return (index - 2) * barHeight + index * GAP;\n // return (barHeight + GAP * 2) / 2 + (index - 2) * (barHeight + GAP);\n };\n\n private getTrackHeight = (count: number, barHeight: number) => {\n return count <= 3 ? BAR_HEIGHTS.ONE : barHeight * count + GAP * (count - 1);\n };\n\n public render(count: number, index: number) {\n if(!this.border) {\n this.border = document.createElement('div');\n this.border.classList.add(BASE_CLASS);\n\n this.wrapper = document.createElement('div');\n this.border.append(this.wrapper);\n }\n\n if(count === 1) {\n if(this.count !== count) {\n this.wrapper.className = BASE_CLASS + '-wrapper-1';\n this.border.classList.remove(BASE_CLASS + '-mask');\n this.wrapper.innerHTML = this.wrapper.style.cssText = '';\n }\n\n return this.border;\n }\n\n const barHeight = this.getBarHeight(count, index);\n const markHeight = this.getMarkHeight(count, index);\n const trackHeight = this.getTrackHeight(count, barHeight);\n\n const clipPathId = `clipPath_${count}`;\n const clipPath = this.getClipPath(clipPathId, barHeight, count);\n\n const markTranslateY = this.getMarkTranslateY(index, barHeight, count);\n const trackTranslateY = this.getTrackTranslateY(index, count, barHeight, trackHeight);\n\n this.border.classList.toggle(BASE_CLASS + '-mask', count > 4);\n\n if(index <= 1) {\n this.border.classList.add('mask-bottom');\n this.border.classList.remove('mask-top');\n } else if(index >= (count - 2)) {\n this.border.classList.add('mask-top');\n this.border.classList.remove('mask-bottom');\n } else {\n this.border.classList.add('mask-top', 'mask-bottom');\n }\n\n this.wrapper.className = BASE_CLASS + '-wrapper';\n this.wrapper.style.cssText = `clip-path: url(#${clipPathId}); width: 2px; height: ${trackHeight}px; transform: translateY(-${trackTranslateY}px);`;\n\n if(!this.svg) {\n this.svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n this.svg.setAttributeNS(null, 'height', '0');\n this.svg.setAttributeNS(null, 'width', '0');\n\n this.defs = document.createElementNS('http://www.w3.org/2000/svg', 'defs');\n this.defs.append(clipPath);\n\n this.svg.append(this.defs);\n\n this.mark = document.createElement('div');\n this.mark.classList.add(BASE_CLASS + '-mark');\n }\n\n if(!this.svg.parentElement) {\n this.wrapper.append(this.svg, this.mark);\n }\n\n this.mark.style.cssText = `height: ${markHeight}px; transform: translateY(${markTranslateY}px);`;\n\n this.count = count;\n this.index = index;\n\n return this.border;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ChatTopbar from './topbar';\nimport PopupPinMessage from '../popups/unpinMessage';\nimport PinnedContainer from './pinnedContainer';\nimport PinnedMessageBorder from './pinnedMessageBorder';\nimport ReplyContainer, {wrapReplyDivAndCaption} from './replyContainer';\nimport rootScope from '../../lib/rootScope';\nimport Chat from './chat';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport ButtonIcon from '../buttonIcon';\nimport {getHeavyAnimationPromise} from '../../hooks/useHeavyAnimationCheck';\nimport {i18n} from '../../lib/langPack';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport handleScrollSideEvent from '../../helpers/dom/handleScrollSideEvent';\nimport debounce from '../../helpers/schedulers/debounce';\nimport throttle from '../../helpers/schedulers/throttle';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport {Message} from '../../layer';\nimport {logger} from '../../lib/logger';\n\nclass AnimatedSuper {\n static DURATION = 200;\n static BASE_CLASS = 'animated-super';\n container: HTMLDivElement;\n rows: {[index: string]: {element: HTMLElement, timeout?: number, new?: true}} = {};\n clearTimeout: number;\n\n constructor() {\n this.container = document.createElement('div');\n this.container.className = AnimatedSuper.BASE_CLASS;\n }\n\n public getRow(index: number, animateFirst = false) {\n if(this.rows[index]) return this.rows[index].element;\n const row = document.createElement('div');\n const isFirst = !Object.keys(this.rows).length && !animateFirst;\n row.className = AnimatedSuper.BASE_CLASS + '-row' + (isFirst ? '' : ' is-hiding hide');\n this.rows[index] = {element: row, new: true};\n this.container.append(row);\n return row;\n }\n\n public clearRow(index: number) {\n if(!this.rows[index]) return;\n this.rows[index].element.remove();\n delete this.rows[index];\n }\n\n public clearRows(currentIndex?: number) {\n if(this.clearTimeout) clearTimeout(this.clearTimeout);\n this.clearTimeout = window.setTimeout(() => {\n for(const i in this.rows) {\n if(+i === currentIndex) continue;\n this.clearRow(+i);\n }\n }, AnimatedSuper.DURATION);\n }\n\n public setNewRow(index: number, reflow = false) {\n const row = this.rows[index];\n if(row.new) {\n if(reflow) {\n row.element.classList.remove('hide');\n void row.element.offsetLeft; // reflow\n } else {\n row.element.classList.remove('is-hiding', 'hide');\n }\n\n delete row.new;\n }\n\n this.clearRows(index);\n }\n\n public animate(index: number, previousIndex: number, fromTop = index > previousIndex, ignorePrevious = false) {\n if(index === previousIndex) { // * handle if set index 0 and previousIndex 0\n return this.setNewRow(index);\n }\n\n const row = this.rows[index];\n const previousRow = this.rows[previousIndex];\n if(!previousRow && !ignorePrevious) {\n return this.setNewRow(index);\n }\n\n const sides = ['from-top', 'from-bottom'];\n if(!fromTop) sides.reverse();\n\n row.element.classList.add(sides[0]);\n row.element.classList.remove(sides[1]);\n if(previousRow) {\n previousRow.element.classList.add(sides[1]);\n previousRow.element.classList.remove(sides[0]);\n }\n\n if(row.new) {\n this.setNewRow(index, true);\n }\n\n row.element.classList.toggle('is-hiding', false);\n previousRow && previousRow.element.classList.toggle('is-hiding', true);\n\n /* const height = row.element.getBoundingClientRect().height;\n row.element.style.transform = `translateY(${fromTop ? height * -1 : height}px)`;\n if(previousRow) {\n previousRow.element.style.transform = `translateY(${fromTop ? height : height * -1}px)`;\n } */\n\n /* row.element.style.setProperty('--height', row.element.getBoundingClientRect().height + 'px');\n if(previousRow) {\n previousRow.element.style.setProperty('--height', previousRow.element.getBoundingClientRect().height + 'px');\n } */\n\n this.clearRows(index);\n }\n}\n\nclass AnimatedCounter {\n static EMPTY_INDEX = -1;\n static BASE_CLASS = 'animated-counter';\n container: HTMLElement;\n decimals: {\n container: HTMLElement,\n placeholder: HTMLElement,\n animatedSuper: AnimatedSuper\n }[] = [];\n previousNumber = 0;\n clearTimeout: number;\n\n constructor(private reverse = false) {\n this.container = document.createElement('div');\n this.container.className = AnimatedCounter.BASE_CLASS;\n }\n\n getDecimal(index: number) {\n if(this.decimals[index]) return this.decimals[index];\n const item = document.createElement('div');\n item.className = AnimatedCounter.BASE_CLASS + '-decimal';\n\n const placeholder = document.createElement('div');\n placeholder.className = AnimatedCounter.BASE_CLASS + '-decimal-placeholder';\n\n const animatedSuper = new AnimatedSuper();\n animatedSuper.container.className = AnimatedCounter.BASE_CLASS + '-decimal-wrapper';\n\n item.append(placeholder, animatedSuper.container);\n\n this.container.append(item);\n\n return this.decimals[index] = {container: item, placeholder, animatedSuper};\n }\n\n clear(number: number) {\n if(this.clearTimeout) clearTimeout(this.clearTimeout);\n\n const decimals = ('' + number).length;\n if(decimals >= this.decimals.length) {\n return;\n }\n\n this.clearTimeout = window.setTimeout(() => {\n const byDecimal = this.decimals.splice(decimals, this.decimals.length - decimals);\n byDecimal.forEach((decimal) => {\n decimal.container.remove();\n });\n }, AnimatedSuper.DURATION);\n }\n\n /* prepareNumber(number: number) {\n const decimals = ('' + number).length;\n if(this.decimals.length < decimals) {\n for(let i = this.decimals.length; i < decimals; ++i) {\n this.getDecimal(i);\n }\n }\n } */\n\n hideLeft(number: number) {\n const decimals = ('' + number).length;\n const byDecimal = this.decimals.slice(decimals);// this.decimals.splice(deleteCount, this.decimals.length - deleteCount);\n byDecimal.forEach((decimal) => {\n const previousDecimalNumber = +decimal.placeholder.innerText || 0;\n const row = decimal.animatedSuper.getRow(AnimatedCounter.EMPTY_INDEX, true);\n decimal.animatedSuper.animate(AnimatedCounter.EMPTY_INDEX, previousDecimalNumber, this.reverse ? number < this.previousNumber : number > this.previousNumber, true);\n });\n\n this.clear(number);\n }\n\n setCount(number: number) {\n // this.prepareNumber(number);\n\n const previousByDecimal = Array.from('' + this.previousNumber).map((n) => +n);\n const byDecimal = Array.from('' + number).map((n) => +n);\n byDecimal.forEach((decimalNumber, idx) => {\n const decimal = this.getDecimal(idx);\n // const row = decimal.animatedSuper.getRow(number, true);\n const row = decimal.animatedSuper.getRow(decimalNumber, true);\n const previousDecimalNumber = previousByDecimal[idx] ?? AnimatedCounter.EMPTY_INDEX;\n row.innerText = decimal.placeholder.innerText = '' + decimalNumber;\n // decimal.animatedSuper.animate(number, this.previousNumber, this.reverse ? number < this.previousNumber : number > this.previousNumber, true);\n decimal.animatedSuper.animate(decimalNumber, previousDecimalNumber, this.reverse ? number < this.previousNumber : number > this.previousNumber, true);\n });\n\n this.hideLeft(number);\n // this.clear(number);\n this.previousNumber = number;\n }\n}\n\nexport default class ChatPinnedMessage {\n private static LOAD_COUNT = 50;\n private static LOAD_OFFSET = 5;\n\n public pinnedMessageContainer: PinnedContainer;\n private pinnedMessageBorder: PinnedMessageBorder;\n\n private pinnedMaxMid = 0;\n public pinnedMid = 0;\n public pinnedIndex = -1;\n private wasPinnedIndex = 0;\n private wasPinnedMediaIndex = 0;\n\n public locked = false;\n private waitForScrollBottom = false;\n\n public count = 0;\n private mids: number[] = [];\n private offsetIndex = 0;\n\n private loading = false;\n private loadedBottom = false;\n private loadedTop = false;\n\n private animatedSubtitle: AnimatedSuper;\n private animatedMedia: AnimatedSuper;\n private animatedCounter: AnimatedCounter;\n\n private listenerSetter: ListenerSetter;\n private scrollDownListenerSetter: ListenerSetter = null;\n\n public hidden = false;\n\n private getCurrentIndexPromise: Promise = null;\n private btnOpen: HTMLButtonElement;\n\n private setPinnedMessage: () => void;\n\n private isStatic: boolean;\n\n private debug: boolean;\n\n public setCorrectIndexThrottled: (lastScrollDirection?: number) => void;\n\n private log: ReturnType;\n\n constructor(private topbar: ChatTopbar, private chat: Chat, private managers: AppManagers) {\n this.listenerSetter = new ListenerSetter();\n this.log = logger('PM');\n this.debug = true;\n this.isStatic = false;\n\n const dAC = new ReplyContainer('pinned-message', chat.animationGroup);\n this.pinnedMessageContainer = new PinnedContainer({\n topbar,\n chat,\n listenerSetter: this.listenerSetter,\n className: 'message',\n divAndCaption: dAC,\n onClose: async() => {\n if(await managers.appPeersManager.canPinMessage(this.chat.peerId)) {\n new PopupPinMessage(this.chat.peerId, this.pinnedMid, true);\n } else {\n new PopupPinMessage(this.chat.peerId, 0, true);\n }\n\n return false;\n }\n });\n\n this.pinnedMessageBorder = new PinnedMessageBorder();\n dAC.border.replaceWith(this.pinnedMessageBorder.render(1, 0));\n\n this.animatedSubtitle = new AnimatedSuper();\n dAC.subtitle.append(this.animatedSubtitle.container);\n\n this.animatedMedia = new AnimatedSuper();\n this.animatedMedia.container.classList.add('pinned-message-media-container');\n dAC.content.prepend(this.animatedMedia.container);\n\n this.animatedCounter = new AnimatedCounter(true);\n dAC.title.append(i18n('PinnedMessage'), ' ', this.animatedCounter.container);\n\n const btnClose = this.pinnedMessageContainer.btnClose.cloneNode(true) as HTMLElement;\n this.pinnedMessageContainer.attachOnCloseEvent(btnClose);\n dAC.container.prepend(btnClose);\n\n this.btnOpen = ButtonIcon('pinlist pinned-container-close pinned-message-pinlist', {noRipple: true});\n\n this.pinnedMessageContainer.wrapperUtils.prepend(this.btnOpen);\n\n attachClickEvent(this.btnOpen, (e) => {\n cancelEvent(e);\n this.topbar.openPinned(true);\n }, {listenerSetter: this.listenerSetter});\n\n this.listenerSetter.add(rootScope)('peer_pinned_messages', ({peerId}) => {\n if(peerId === this.chat.peerId) {\n // this.wasPinnedIndex = 0;\n // setTimeout(() => {\n if(this.hidden) {\n this.pinnedMessageContainer.toggle(this.hidden = false);\n }\n\n this.loadedTop = this.loadedBottom = false;\n this.pinnedIndex = -1;\n this.pinnedMid = 0;\n this.count = 0;\n this.mids = [];\n this.offsetIndex = 0;\n this.pinnedMaxMid = 0;\n this.setCorrectIndex(0);\n // }, 300);\n }\n });\n\n this.listenerSetter.add(rootScope)('peer_pinned_hidden', ({peerId}) => {\n if(peerId === this.chat.peerId) {\n this.pinnedMessageContainer.toggle(this.hidden = true);\n }\n });\n\n // * 200 - no lags\n // * 100 - need test\n this.setPinnedMessage = debounce(() => this._setPinnedMessage(), 100, true, true);\n this.setCorrectIndexThrottled = throttle(this.setCorrectIndex.bind(this), 100, false);\n\n this.isStatic = !this.chat.isPinnedMessagesNeeded();\n }\n\n public destroy() {\n this.pinnedMessageContainer.divAndCaption.container.remove();\n this.pinnedMessageContainer.toggle(true);\n this.listenerSetter.removeAll();\n this.unsetScrollDownListener(false);\n }\n\n public setCorrectIndex(lastScrollDirection?: number) {\n if(this.isStatic) return;\n // return;\n\n if(this.locked || this.hidden/* || this.chat.setPeerPromise || this.chat.bubbles.messagesQueuePromise */) {\n return;\n }\n\n if((this.loadedBottom || this.loadedTop) && !this.count) {\n return;\n }\n\n // const perf = performance.now();\n const el = this.chat.bubbles.getBubbleByPoint('bottom');\n // this.log('setCorrectIndex: get last element perf:', performance.now() - perf, el);\n if(!el) return;\n\n // return;\n\n const mid = el.dataset.mid;\n if(el && mid !== undefined) {\n // this.log('setCorrectIndex will test mid:', mid);\n this.testMid(+mid, lastScrollDirection);\n }\n }\n\n public testMid(mid: number, lastScrollDirection?: number) {\n if(this.isStatic) return;\n\n // if(lastScrollDirection !== undefined) return;\n if(this.hidden) return;\n\n // this.log('testMid', mid);\n\n let currentIndex: number = this.mids.findIndex((_mid) => _mid <= mid);\n if(currentIndex !== -1 && !this.isNeededMore(currentIndex)) {\n currentIndex += this.offsetIndex;\n } else if(this.loadedTop && mid < this.mids[this.mids.length - 1]) {\n // currentIndex = 0;\n currentIndex = this.mids.length - 1 + this.offsetIndex;\n } else {\n if(!this.getCurrentIndexPromise) {\n this.getCurrentIndexPromise = this.getCurrentIndex(mid, lastScrollDirection !== undefined);\n }\n\n return;\n }\n\n // const idx = Math.max(0, this.mids.indexOf(mid));\n\n /* if(currentIndex === this.count) {\n currentIndex = 0;\n } */\n\n // this.log('testMid: pinned currentIndex', currentIndex, mid);\n\n const changed = this.pinnedIndex !== currentIndex;\n if(changed) {\n if(this.waitForScrollBottom && lastScrollDirection !== undefined) {\n if(this.pinnedIndex === 0 || this.pinnedIndex > currentIndex) { // если не скроллил вниз и пытается поставить нижний пиннед - выйти\n return;\n }\n }\n\n this.pinnedIndex = currentIndex;\n this.pinnedMid = this.mids.find((_mid) => _mid <= mid) || this.mids[this.mids.length - 1];\n this.setPinnedMessage();\n }\n }\n\n private isNeededMore(currentIndex: number) {\n return (this.count > ChatPinnedMessage.LOAD_COUNT &&\n (\n (!this.loadedBottom && currentIndex <= ChatPinnedMessage.LOAD_OFFSET) ||\n (!this.loadedTop && (this.count - 1 - currentIndex) <= ChatPinnedMessage.LOAD_OFFSET)\n )\n );\n }\n\n private async getCurrentIndex(mid: number, correctAfter = true) {\n if(this.loading) return;\n this.loading = true;\n\n try {\n const log = this.debug ? this.log.bindPrefix('getCurrentIndex') : undefined;\n log && log('start', mid, correctAfter);\n\n let gotRest = false;\n const promises = [\n this.managers.appMessagesManager.getSearch({\n peerId: this.chat.peerId,\n inputFilter: {_: 'inputMessagesFilterPinned'},\n maxId: mid,\n limit: ChatPinnedMessage.LOAD_COUNT,\n backLimit: ChatPinnedMessage.LOAD_COUNT,\n threadId: this.chat.threadId\n })\n .then((r) => {\n gotRest = true;\n return r;\n })\n ];\n\n if(!this.pinnedMaxMid) {\n const promise = this.managers.appMessagesManager.getPinnedMessage(this.chat.peerId, this.chat.threadId).then((p) => {\n if(!p.maxId) return;\n this.pinnedMaxMid = p.maxId;\n\n if(!gotRest && correctAfter) {\n this.mids = [this.pinnedMaxMid];\n this.count = p.count;\n this.pinnedIndex = 0;\n this.pinnedMid = this.mids[0];\n this.setPinnedMessage();\n // this.pinnedMessageContainer.toggle(false);\n }\n });\n\n promises.push(promise as any);\n }\n\n const result = (await Promise.all(promises))[0];\n\n let backLimited = result.history.findIndex((message) => message.mid <= mid);\n if(backLimited === -1) {\n backLimited = result.history.length;\n }/* else {\n backLimited -= 1;\n } */\n\n this.offsetIndex = result.offset_id_offset ? result.offset_id_offset - backLimited : 0;\n this.mids = result.history.map((message) => message.mid).slice();\n this.count = result.count;\n\n if(!this.count) {\n this.pinnedMessageContainer.toggle(true);\n }\n\n this.loadedTop = (this.offsetIndex + this.mids.length) === this.count;\n this.loadedBottom = !this.offsetIndex;\n\n log && log('result', mid, result, backLimited, this.offsetIndex, this.loadedTop, this.loadedBottom);\n } catch(err) {\n this.log.error('getCurrentIndex error', err);\n }\n\n this.loading = false;\n\n if(this.locked) {\n this.testMid(mid);\n } else if(correctAfter) {\n this.setCorrectIndex(0);\n }\n\n this.getCurrentIndexPromise = null;\n // return result.offset_id_offset || 0;\n }\n\n public setScrollDownListener() {\n this.waitForScrollBottom = true;\n\n if(!this.scrollDownListenerSetter) {\n this.scrollDownListenerSetter = new ListenerSetter();\n handleScrollSideEvent(this.chat.bubbles.scrollable.container, 'bottom', () => {\n this.unsetScrollDownListener();\n }, this.scrollDownListenerSetter);\n }\n }\n\n public unsetScrollDownListener(refreshPosition = true) {\n this.waitForScrollBottom = false;\n\n if(this.scrollDownListenerSetter) {\n this.scrollDownListenerSetter.removeAll();\n this.scrollDownListenerSetter = null;\n }\n\n if(refreshPosition) {\n this.setCorrectIndex(0);\n }\n }\n\n public async handleFollowingPinnedMessage() {\n this.locked = true;\n\n this.debug && this.log('handleFollowingPinnedMessage');\n try {\n this.setScrollDownListener();\n\n const setPeerPromise = this.chat.setPeerPromise;\n if(setPeerPromise instanceof Promise) {\n await setPeerPromise;\n }\n\n // await this.chat.bubbles.scrollable.scrollLockedPromise;\n await getHeavyAnimationPromise();\n\n if(this.getCurrentIndexPromise) {\n await this.getCurrentIndexPromise;\n }\n\n this.debug && this.log('handleFollowingPinnedMessage: unlock');\n this.locked = false;\n\n /* // подождём, пока скролл остановится\n setTimeout(() => {\n this.log('handleFollowingPinnedMessage: unlock');\n this.locked = false;\n }, 50); */\n } catch(err) {\n this.log.error('handleFollowingPinnedMessage error:', err);\n\n this.locked = false;\n this.waitForScrollBottom = false;\n this.setCorrectIndex(0);\n }\n }\n\n public async followPinnedMessage(mid: number) {\n const message = await this.chat.getMessage(mid);\n if(!message) {\n return;\n }\n\n this.chat.setMessageId(mid);\n (this.chat.setPeerPromise || Promise.resolve()).then(() => { // * debounce fast clicker\n this.handleFollowingPinnedMessage();\n this.testMid(this.pinnedIndex >= (this.count - 1) ? this.pinnedMaxMid : mid - 1);\n });\n }\n\n public async _setPinnedMessage() {\n // ///this.log('setting pinned message', message);\n // return;\n /* const promise: Promise = this.chat.setPeerPromise || this.chat.bubbles.messagesQueuePromise || Promise.resolve();\n Promise.all([\n promise\n ]).then(() => { */\n // const mids = results[0];\n const count = this.count;\n if(count) {\n const pinnedIndex = this.pinnedIndex;\n const message = await this.chat.getMessage(this.pinnedMid);\n\n // this.animatedCounter.prepareNumber(count);\n\n // setTimeout(() => {\n const isLast = pinnedIndex === 0;\n this.animatedCounter.container.classList.toggle('is-last', isLast);\n // SetTransition(this.animatedCounter.container, 'is-last', isLast, AnimatedSuper.DURATION);\n if(!isLast) {\n this.animatedCounter.setCount(count - pinnedIndex);\n }\n // }, 100);\n\n // this.pinnedMessageContainer.fill(undefined, message.message, message);\n this.pinnedMessageContainer.toggle(false);\n\n const fromTop = pinnedIndex > this.wasPinnedIndex;\n\n this.debug && this.log('setPinnedMessage: fromTop', fromTop, pinnedIndex, this.wasPinnedIndex);\n\n const writeTo = this.animatedSubtitle.getRow(pinnedIndex);\n const writeMediaTo = this.animatedMedia.getRow(pinnedIndex);\n writeMediaTo.classList.add('pinned-message-media');\n // writeMediaTo.innerHTML = writeMediaTo.style.cssText = writeMediaTo.dataset.docId = '';\n const loadPromises: Promise[] = [];\n const isMediaSet = await wrapReplyDivAndCaption({\n title: undefined,\n titleEl: null,\n subtitle: (message as Message.message).message,\n subtitleEl: writeTo,\n message,\n mediaEl: writeMediaTo,\n loadPromises,\n animationGroup: this.chat.animationGroup\n });\n\n await Promise.all(loadPromises);\n\n this.pinnedMessageContainer.divAndCaption.container.classList.toggle('is-media', isMediaSet);\n\n // if(this.wasPinnedIndex !== this.pinnedIndex) {\n this.animatedSubtitle.animate(pinnedIndex, this.wasPinnedIndex);\n if(isMediaSet) {\n this.animatedMedia.animate(pinnedIndex, this.wasPinnedMediaIndex); // * wasPinnedMediaIndex из-за того, что блок меняется с другим алгоритмом\n this.wasPinnedMediaIndex = pinnedIndex;\n } else {\n this.animatedMedia.clearRows();\n }\n // }\n\n this.pinnedMessageBorder.render(count, count - pinnedIndex - 1);\n this.wasPinnedIndex = pinnedIndex;\n this.pinnedMessageContainer.divAndCaption.container.dataset.mid = '' + message.mid;\n } else {\n this.pinnedMessageContainer.toggle(true);\n this.wasPinnedIndex = 0;\n }\n\n this.pinnedMessageContainer.divAndCaption.container.classList.toggle('is-many', this.count > 1);\n // });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ListenerSetter from '../listenerSetter';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\n\nexport default function handleScrollSideEvent(elem: HTMLElement, side: 'top' | 'bottom', callback: () => void, listenerSetter: ListenerSetter) {\n if(IS_TOUCH_SUPPORTED) {\n let lastY: number;\n const options = {passive: true};\n listenerSetter.add(elem)('touchstart', (e) => {\n if(e.touches.length > 1) {\n onTouchEnd();\n return;\n }\n\n lastY = e.touches[0].clientY;\n\n listenerSetter.add(elem)('touchmove', onTouchMove, options);\n listenerSetter.add(elem)('touchend', onTouchEnd, options);\n }, options);\n\n const onTouchMove = (e: TouchEvent) => {\n const clientY = e.touches[0].clientY;\n\n const isDown = clientY < lastY;\n if(side === 'bottom' && isDown) callback();\n else if(side === 'top' && !isDown) callback();\n lastY = clientY;\n // alert('isDown: ' + !!isDown);\n };\n\n const onTouchEnd = () => {\n listenerSetter.removeManual(elem, 'touchmove', onTouchMove, options);\n listenerSetter.removeManual(elem, 'touchend', onTouchEnd, options);\n };\n } else {\n listenerSetter.add(elem)('wheel', (e) => {\n const isDown = e.deltaY > 0;\n // this.log('wheel', e, isDown);\n if(side === 'bottom' && isDown) callback();\n else if(side === 'top' && !isDown) callback();\n }, {passive: true});\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Channel} from '../../lib/appManagers/appChatsManager';\nimport type {AppSidebarRight} from '../sidebarRight';\nimport type Chat from './chat';\nimport {RIGHT_COLUMN_ACTIVE_CLASSNAME} from '../sidebarRight';\nimport mediaSizes, {ScreenSize} from '../../helpers/mediaSizes';\nimport {IS_SAFARI} from '../../environment/userAgent';\nimport rootScope from '../../lib/rootScope';\nimport AvatarElement from '../avatar';\nimport Button from '../button';\nimport ButtonIcon from '../buttonIcon';\nimport ButtonMenuToggle from '../buttonMenuToggle';\nimport ChatAudio from './audio';\nimport ChatPinnedMessage from './pinnedMessage';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport PopupDeleteDialog from '../popups/deleteDialog';\nimport appNavigationController from '../appNavigationController';\nimport {LEFT_COLUMN_ACTIVE_CLASSNAME} from '../sidebarLeft';\nimport PeerTitle from '../peerTitle';\nimport {i18n} from '../../lib/langPack';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport blurActiveElement from '../../helpers/dom/blurActiveElement';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport {toast, toastNew} from '../toast';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport {ChatFull, Chat as MTChat, GroupCall} from '../../layer';\nimport PopupPickUser from '../popups/pickUser';\nimport PopupPeer from '../popups/peer';\nimport AppEditContactTab from '../sidebarRight/tabs/editContact';\nimport appMediaPlaybackController from '../appMediaPlaybackController';\nimport IS_GROUP_CALL_SUPPORTED from '../../environment/groupCallSupport';\nimport IS_CALL_SUPPORTED from '../../environment/callSupport';\nimport {CallType} from '../../lib/calls/types';\nimport PopupMute from '../popups/mute';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport hasRights from '../../lib/appManagers/utils/chats/hasRights';\nimport wrapPeerTitle from '../wrappers/peerTitle';\nimport groupCallsController from '../../lib/calls/groupCallsController';\nimport apiManagerProxy from '../../lib/mtproto/mtprotoworker';\nimport {makeMediaSize} from '../../helpers/mediaSize';\nimport {FOLDER_ID_ALL} from '../../lib/mtproto/mtproto_config';\nimport formatNumber from '../../helpers/number/formatNumber';\n\ntype ButtonToVerify = {element?: HTMLElement, verify: () => boolean | Promise};\n\nexport default class ChatTopbar {\n public container: HTMLDivElement;\n private btnBack: HTMLButtonElement;\n private btnBackBadge: HTMLElement;\n private chatInfo: HTMLDivElement;\n private avatarElement: AvatarElement;\n private title: HTMLDivElement;\n private subtitle: HTMLDivElement;\n private chatUtils: HTMLDivElement;\n private btnJoin: HTMLButtonElement;\n private btnPinned: HTMLButtonElement;\n private btnCall: HTMLButtonElement;\n private btnGroupCall: HTMLButtonElement;\n private btnMute: HTMLButtonElement;\n private btnSearch: HTMLButtonElement;\n private btnMore: HTMLElement;\n\n private chatAudio: ChatAudio;\n public pinnedMessage: ChatPinnedMessage;\n\n private setUtilsRAF: number;\n private setPeerStatusInterval: number;\n\n public listenerSetter: ListenerSetter;\n\n private menuButtons: Parameters[0]['buttons'];\n private buttonsToVerify: ButtonToVerify[];\n private chatInfoContainer: HTMLDivElement;\n private person: HTMLDivElement;\n\n constructor(\n private chat: Chat,\n private appSidebarRight: AppSidebarRight,\n private managers: AppManagers\n ) {\n this.listenerSetter = new ListenerSetter();\n\n this.menuButtons = [];\n this.buttonsToVerify = [];\n }\n\n public construct() {\n // this.chat.log.error('Topbar construction');\n\n this.container = document.createElement('div');\n this.container.classList.add('sidebar-header', 'topbar', 'hide');\n this.container.dataset.floating = '0';\n\n this.btnBack = ButtonIcon('left sidebar-close-button', {noRipple: true});\n this.btnBackBadge = document.createElement('span');\n this.btnBackBadge.classList.add('badge', 'badge-20', 'badge-primary', 'back-unread-badge');\n this.btnBack.append(this.btnBackBadge);\n\n // * chat info section\n this.chatInfoContainer = document.createElement('div');\n this.chatInfoContainer.classList.add('chat-info-container');\n\n this.chatInfo = document.createElement('div');\n this.chatInfo.classList.add('chat-info');\n\n const person = this.person = document.createElement('div');\n person.classList.add('person');\n\n const content = document.createElement('div');\n content.classList.add('content');\n\n const top = document.createElement('div');\n top.classList.add('top');\n\n this.title = document.createElement('div');\n this.title.classList.add('user-title');\n\n top.append(this.title);\n\n const bottom = document.createElement('div');\n bottom.classList.add('bottom');\n\n if(this.subtitle) {\n bottom.append(this.subtitle);\n }\n\n content.append(top, bottom);\n if(this.avatarElement) {\n person.append(this.avatarElement);\n }\n\n person.append(content);\n this.chatInfo.append(person);\n\n // * chat utils section\n this.chatUtils = document.createElement('div');\n this.chatUtils.classList.add('chat-utils');\n\n this.chatAudio = new ChatAudio(this, this.chat, this.managers);\n\n if(this.menuButtons.length) {\n this.btnMore = ButtonMenuToggle({\n listenerSetter: this.listenerSetter,\n direction: 'bottom-left',\n buttons: this.menuButtons,\n onOpen: async(e, element) => {\n const deleteButton = this.menuButtons[this.menuButtons.length - 1];\n if(deleteButton?.element) {\n const deleteButtonText = await this.managers.appPeersManager.getDeleteButtonText(this.peerId);\n deleteButton.element.lastChild.replaceWith(i18n(deleteButtonText));\n }\n }\n });\n }\n\n this.chatUtils.append(...[\n // this.chatAudio ? this.chatAudio.divAndCaption.container : null,\n this.pinnedMessage ? this.pinnedMessage.pinnedMessageContainer.divAndCaption.container : null,\n this.btnJoin,\n this.btnPinned,\n this.btnCall,\n this.btnGroupCall,\n this.btnMute,\n this.btnSearch,\n this.btnMore\n ].filter(Boolean));\n\n this.pushButtonToVerify(this.btnCall, this.verifyCallButton.bind(this, 'voice'));\n this.pushButtonToVerify(this.btnGroupCall, this.verifyVideoChatButton);\n\n this.chatInfoContainer.append(this.btnBack, this.chatInfo, this.chatUtils);\n this.container.append(this.chatInfoContainer);\n\n if(this.chatAudio) {\n // this.container.append(this.chatAudio.divAndCaption.container, this.chatUtils);\n this.container.append(this.chatAudio.divAndCaption.container);\n }\n\n // * construction end\n\n // * fix topbar overflow section\n\n this.listenerSetter.add(window)('resize', this.onResize);\n this.listenerSetter.add(mediaSizes)('changeScreen', this.onChangeScreen);\n\n attachClickEvent(this.container, (e) => {\n const container = findUpClassName(e.target, 'pinned-container');\n blurActiveElement();\n if(container) {\n cancelEvent(e);\n\n if(findUpClassName(e.target, 'progress-line') || findUpClassName(e.target, 'pinned-container-wrapper-utils')) {\n return;\n }\n\n const mid = +container.dataset.mid;\n if(container.classList.contains('pinned-message')) {\n // if(!this.pinnedMessage.locked) {\n this.pinnedMessage.followPinnedMessage(mid);\n // }\n } else {\n const peerId = container.dataset.peerId.toPeerId();\n const searchContext = appMediaPlaybackController.getSearchContext();\n this.chat.appImManager.setInnerPeer({\n peerId,\n lastMsgId: mid,\n type: searchContext.isScheduled ? 'scheduled' : (searchContext.threadId ? 'discussion' : undefined),\n threadId: searchContext.threadId\n });\n }\n } else {\n if(mediaSizes.activeScreen === ScreenSize.medium && document.body.classList.contains(LEFT_COLUMN_ACTIVE_CLASSNAME)) {\n onBtnBackClick();\n } else if(findUpTag(e.target, 'AVATAR-ELEMENT')) {\n this.appSidebarRight.toggleSidebar(!document.body.classList.contains(RIGHT_COLUMN_ACTIVE_CLASSNAME));\n } else {\n this.appSidebarRight.toggleSidebar(true);\n }\n }\n }, {listenerSetter: this.listenerSetter});\n\n const onBtnBackClick = (e?: Event) => {\n if(e) {\n cancelEvent(e);\n }\n\n // const item = appNavigationController.findItemByType('chat');\n // * return manually to chat by arrow, since can't get back to\n if(mediaSizes.activeScreen === ScreenSize.medium && document.body.classList.contains(LEFT_COLUMN_ACTIVE_CLASSNAME)) {\n this.chat.appImManager.setPeer({peerId: this.peerId});\n } else {\n const isFirstChat = this.chat.appImManager.chats.indexOf(this.chat) === 0;\n appNavigationController.back(isFirstChat ? 'im' : 'chat');\n /* return;\n\n if(mediaSizes.activeScreen === ScreenSize.medium && !appNavigationController.findItemByType('chat')) {\n this.chat.appImManager.setPeer(0);\n blurActiveElement();\n } else {\n appNavigationController.back('chat');\n } */\n }\n };\n\n attachClickEvent(this.btnBack, onBtnBackClick, {listenerSetter: this.listenerSetter});\n }\n\n private pushButtonToVerify(element: HTMLElement, verify: ButtonToVerify['verify']) {\n if(!element) {\n return;\n }\n\n this.buttonsToVerify.push({element, verify});\n }\n\n private verifyButtons = (e?: Event) => {\n const isMenuOpen = !!e || !!(this.btnMore && this.btnMore.classList.contains('menu-open'));\n\n e && cancelEvent(e);\n\n const r = async() => {\n const buttons = this.buttonsToVerify.concat(isMenuOpen ? this.menuButtons as any : []);\n const results = await Promise.all(buttons.map(async(button) => {\n return {\n result: await button.verify(),\n button\n }\n }));\n\n results.forEach(({button, result}) => {\n button.element.classList.toggle('hide', !result);\n });\n };\n\n r();\n };\n\n private verifyVideoChatButton = async(type?: 'group' | 'broadcast') => {\n if(!IS_GROUP_CALL_SUPPORTED || this.peerId.isUser() || this.chat.type !== 'chat' || this.chat.threadId) return false;\n\n const currentGroupCall = groupCallsController.groupCall;\n const chatId = this.peerId.toChatId();\n if(currentGroupCall?.chatId === chatId) {\n return false;\n }\n\n if(type) {\n if(((await this.managers.appPeersManager.isBroadcast(this.peerId)) && type === 'group') ||\n ((await this.managers.appPeersManager.isAnyGroup(this.peerId)) && type === 'broadcast')) {\n return false;\n }\n }\n\n const chat = await this.managers.appChatsManager.getChat(chatId);\n return (chat as MTChat.chat).pFlags?.call_active || hasRights(chat, 'manage_call');\n };\n\n private verifyCallButton = async(type?: CallType) => {\n if(!IS_CALL_SUPPORTED || !this.peerId.isUser()) return false;\n const userId = this.peerId.toUserId();\n const userFull = await this.managers.appProfileManager.getCachedFullUser(userId);\n\n return !!userFull && !!(type === 'voice' ? userFull.pFlags.phone_calls_available : userFull.pFlags.video_calls_available);\n };\n\n public constructUtils() {\n this.menuButtons = [{\n icon: 'search',\n text: 'Search',\n onClick: () => {\n this.chat.initSearch();\n },\n verify: () => mediaSizes.isMobile\n }, /* {\n icon: 'pinlist',\n text: 'Pinned Messages',\n onClick: () => this.openPinned(false),\n verify: () => mediaSizes.isMobile\n }, */{\n icon: 'mute',\n text: 'ChatList.Context.Mute',\n onClick: this.onMuteClick,\n verify: async() => this.chat.type === 'chat' && rootScope.myId !== this.peerId && !(await this.managers.appNotificationsManager.isPeerLocalMuted({peerId: this.peerId, respectType: false, threadId: this.chat.threadId}))\n }, {\n icon: 'unmute',\n text: 'ChatList.Context.Unmute',\n onClick: () => {\n this.managers.appMessagesManager.togglePeerMute({peerId: this.peerId, threadId: this.chat.threadId});\n },\n verify: async() => this.chat.type === 'chat' && rootScope.myId !== this.peerId && (await this.managers.appNotificationsManager.isPeerLocalMuted({peerId: this.peerId, respectType: false, threadId: this.chat.threadId}))\n }, {\n icon: 'comments',\n text: 'ViewDiscussion',\n onClick: () => {\n const middleware = this.chat.bubbles.getMiddleware();\n Promise.resolve(this.managers.appProfileManager.getChannelFull(this.peerId.toChatId())).then((channelFull) => {\n if(middleware() && channelFull.linked_chat_id) {\n this.chat.appImManager.setInnerPeer({\n peerId: channelFull.linked_chat_id.toPeerId(true)\n });\n }\n });\n },\n verify: async() => {\n const chatFull = await this.managers.appProfileManager.getCachedFullChat(this.peerId.toChatId());\n return this.chat.type === 'chat' && !!(chatFull as ChatFull.channelFull)?.linked_chat_id;\n }\n }, {\n icon: 'phone',\n text: 'Call',\n onClick: this.onCallClick.bind(this, 'voice'),\n verify: this.verifyCallButton.bind(this, 'voice')\n }, {\n icon: 'videocamera',\n text: 'VideoCall',\n onClick: this.onCallClick.bind(this, 'video'),\n verify: this.verifyCallButton.bind(this, 'video')\n }, {\n icon: 'videochat',\n text: 'PeerInfo.Action.LiveStream',\n onClick: this.onJoinGroupCallClick,\n verify: this.verifyVideoChatButton.bind(this, 'broadcast')\n }, {\n icon: 'videochat',\n text: 'PeerInfo.Action.VoiceChat',\n onClick: this.onJoinGroupCallClick,\n verify: this.verifyVideoChatButton.bind(this, 'group')\n }, {\n icon: 'select',\n text: 'Chat.Menu.SelectMessages',\n onClick: () => {\n const selection = this.chat.selection;\n selection.toggleSelection(true, true);\n apiManagerProxy.getState().then((state) => {\n if(state.chatContextMenuHintWasShown) {\n return;\n }\n\n const original = selection.toggleByElement.bind(selection);\n selection.toggleByElement = async(bubble) => {\n this.managers.appStateManager.pushToState('chatContextMenuHintWasShown', true);\n toast(i18n('Chat.Menu.Hint'));\n\n selection.toggleByElement = original;\n selection.toggleByElement(bubble);\n };\n });\n },\n verify: () => !this.chat.selection.isSelecting && !!this.chat.bubbles.getRenderedLength()\n }, {\n icon: 'select',\n text: 'Chat.Menu.ClearSelection',\n onClick: () => {\n this.chat.selection.cancelSelection();\n },\n verify: () => this.chat.selection.isSelecting\n }, {\n icon: 'adduser',\n text: 'AddContact',\n onClick: () => {\n if(!this.appSidebarRight.isTabExists(AppEditContactTab)) {\n const tab = this.appSidebarRight.createTab(AppEditContactTab);\n tab.peerId = this.peerId;\n tab.open();\n\n this.appSidebarRight.toggleSidebar(true);\n }\n },\n verify: async() => this.peerId.isUser() && !(await this.managers.appPeersManager.isContact(this.peerId))\n }, {\n icon: 'forward',\n text: 'ShareContact',\n onClick: () => {\n const contactPeerId = this.peerId;\n new PopupPickUser({\n peerTypes: ['dialogs', 'contacts'],\n onSelect: (peerId) => {\n return new Promise((resolve, reject) => {\n new PopupPeer('', {\n titleLangKey: 'SendMessageTitle',\n descriptionLangKey: 'SendContactToGroupText',\n descriptionLangArgs: [new PeerTitle({peerId, dialog: true}).element],\n buttons: [{\n langKey: 'Send',\n callback: () => {\n resolve();\n\n this.managers.appMessagesManager.sendContact(peerId, contactPeerId);\n this.chat.appImManager.setInnerPeer({peerId});\n }\n }, {\n langKey: 'Cancel',\n callback: () => {\n reject();\n },\n isCancel: true\n }],\n peerId,\n overlayClosable: true\n }).show();\n });\n },\n placeholder: 'ShareModal.Search.Placeholder',\n chatRightsActions: ['send_plain'],\n selfPresence: 'ChatYourSelf'\n });\n },\n verify: async() => rootScope.myId !== this.peerId && this.peerId.isUser() && (await this.managers.appPeersManager.isContact(this.peerId)) && !!(await this.managers.appUsersManager.getUser(this.peerId.toUserId())).phone\n }, {\n icon: 'bots',\n text: 'Settings',\n onClick: () => {\n this.managers.appMessagesManager.sendText(this.peerId, '/settings');\n },\n verify: async() => {\n try {\n const attachMenuBot = await this.managers.appAttachMenuBotsManager.getAttachMenuBot(this.peerId.toUserId());\n return !!attachMenuBot?.pFlags?.has_settings;\n } catch(err) {\n return false;\n }\n }\n }, {\n icon: 'lock',\n text: 'BlockUser',\n onClick: () => {\n new PopupPeer('', {\n peerId: this.peerId,\n titleLangKey: 'BlockUser',\n descriptionLangKey: 'AreYouSureBlockContact2',\n descriptionLangArgs: [new PeerTitle({peerId: this.peerId}).element],\n buttons: [{\n langKey: 'BlockUser',\n isDanger: true,\n callback: () => {\n this.managers.appUsersManager.toggleBlock(this.peerId, true).then((value) => {\n if(value) {\n toastNew({langPackKey: 'UserBlocked'});\n }\n });\n }\n }]\n }).show();\n },\n verify: async() => {\n if(!this.peerId.isUser()) return false;\n const userFull = await this.managers.appProfileManager.getCachedFullUser(this.peerId.toUserId());\n return this.peerId !== rootScope.myId && userFull && !userFull.pFlags?.blocked;\n }\n }, {\n icon: 'lockoff',\n text: 'Unblock',\n onClick: () => {\n this.managers.appUsersManager.toggleBlock(this.peerId, false).then((value) => {\n if(value) {\n toastNew({langPackKey: 'UserUnblocked'});\n }\n });\n },\n verify: async() => {\n const userFull = await this.managers.appProfileManager.getCachedFullUser(this.peerId.toUserId());\n return !!userFull?.pFlags?.blocked;\n }\n }, {\n icon: 'delete danger',\n text: 'Delete',\n onClick: () => {\n new PopupDeleteDialog(this.peerId/* , 'leave' */);\n },\n verify: async() => this.chat.type === 'chat' && !!(await this.managers.appMessagesManager.getDialogOnly(this.peerId))\n }];\n\n this.btnSearch = ButtonIcon('search');\n this.attachClickEvent(this.btnSearch, (e) => {\n this.chat.initSearch();\n }, true);\n }\n\n public attachClickEvent(el: HTMLElement, cb: (e: MouseEvent) => void, noBlur?: boolean) {\n attachClickEvent(el, (e) => {\n cancelEvent(e);\n !noBlur && blurActiveElement();\n cb(e);\n }, {listenerSetter: this.listenerSetter});\n }\n\n private onCallClick(type: CallType) {\n this.chat.appImManager.callUser(this.peerId.toUserId(), type);\n }\n\n private onJoinGroupCallClick = () => {\n this.chat.appImManager.joinGroupCall(this.peerId);\n };\n\n private constructAvatar() {\n const avatarElement = new AvatarElement();\n avatarElement.isDialog = true;\n avatarElement.classList.add('avatar-42', 'person-avatar');\n return avatarElement;\n }\n\n private get peerId() {\n return this.chat.peerId;\n }\n\n public constructPeerHelpers() {\n this.avatarElement = this.constructAvatar();\n\n this.subtitle = document.createElement('div');\n this.subtitle.classList.add('info');\n\n this.pinnedMessage = new ChatPinnedMessage(this, this.chat, this.managers);\n\n this.btnJoin = Button('btn-primary btn-color-primary chat-join hide');\n this.btnCall = ButtonIcon('phone');\n this.btnGroupCall = ButtonIcon('videochat');\n this.btnPinned = ButtonIcon('pinlist');\n this.btnMute = ButtonIcon('mute');\n\n this.attachClickEvent(this.btnCall, this.onCallClick.bind(this, 'voice'));\n this.attachClickEvent(this.btnGroupCall, this.onJoinGroupCallClick);\n\n this.attachClickEvent(this.btnPinned, () => {\n this.openPinned(true);\n });\n\n this.attachClickEvent(this.btnMute, this.onMuteClick);\n\n this.attachClickEvent(this.btnJoin, async() => {\n const middleware = this.chat.bubbles.getMiddleware();\n this.btnJoin.setAttribute('disabled', 'true');\n\n const chatId = this.peerId.toChatId();\n let promise: Promise;\n if(await this.managers.appChatsManager.isChannel(chatId)) {\n promise = this.managers.appChatsManager.joinChannel(chatId);\n } else {\n promise = this.managers.appChatsManager.addChatUser(chatId, rootScope.myId);\n }\n\n promise.finally(() => {\n if(!middleware()) {\n return;\n }\n\n this.btnJoin.removeAttribute('disabled');\n });\n });\n\n this.listenerSetter.add(rootScope)('folder_unread', (folder) => {\n if(folder.id !== FOLDER_ID_ALL) {\n return;\n }\n\n const size = folder.unreadUnmutedPeerIds.size;\n this.btnBackBadge.textContent = size ? '' + formatNumber(size, 1) : '';\n // this.btnBack.classList.remove('tgico-left', 'tgico-previous');\n // this.btnBack.classList.add(size ? 'tgico-previous' : 'tgico-left');\n });\n\n this.listenerSetter.add(rootScope)('chat_update', async(chatId) => {\n if(this.peerId === chatId.toPeerId(true)) {\n const chat = await this.managers.appChatsManager.getChat(chatId) as Channel/* | Chat */;\n\n this.btnJoin.classList.toggle('hide', !(chat as Channel)?.pFlags?.left);\n this.setUtilsWidth();\n this.verifyButtons();\n }\n });\n\n this.listenerSetter.add(rootScope)('dialog_notify_settings', (dialog) => {\n if(dialog.peerId === this.peerId) {\n this.setMutedState();\n }\n });\n\n this.listenerSetter.add(rootScope)('peer_typings', ({peerId}) => {\n if(this.peerId === peerId) {\n this.setPeerStatus();\n }\n });\n\n this.listenerSetter.add(rootScope)('user_update', (userId) => {\n if(this.peerId === userId.toPeerId()) {\n this.setPeerStatus();\n }\n });\n\n this.listenerSetter.add(rootScope)('peer_full_update', (peerId) => {\n if(this.peerId === peerId) {\n this.verifyButtons();\n }\n });\n\n this.chat.addEventListener('setPeer', (mid, isTopMessage) => {\n const middleware = this.chat.bubbles.getMiddleware();\n apiManagerProxy.getState().then((state) => {\n if(!middleware() || !this.pinnedMessage) return;\n\n this.pinnedMessage.hidden = !!state.hiddenPinnedMessages[this.chat.peerId];\n\n if(isTopMessage) {\n this.pinnedMessage.unsetScrollDownListener();\n this.pinnedMessage.testMid(mid, 0); // * because slider will not let get bubble by document.elementFromPoint\n } else if(!this.pinnedMessage.locked) {\n this.pinnedMessage.handleFollowingPinnedMessage();\n this.pinnedMessage.testMid(mid);\n }\n });\n });\n\n this.listenerSetter.add(rootScope)('peer_pinned_messages', ({peerId, mids}) => {\n if(this.chat.type !== 'pinned' || peerId !== this.peerId) {\n return;\n }\n\n if(mids) {\n this.setTitle();\n }\n });\n\n this.setPeerStatusInterval = window.setInterval(this.setPeerStatus, 60e3);\n\n return this;\n }\n\n public openPinned(byCurrent: boolean) {\n this.chat.appImManager.setInnerPeer({\n peerId: this.peerId,\n lastMsgId: byCurrent ? +this.pinnedMessage.pinnedMessageContainer.divAndCaption.container.dataset.mid : 0,\n type: 'pinned'\n });\n }\n\n private onMuteClick = () => {\n new PopupMute(this.peerId);\n };\n\n private onResize = () => {\n this.setUtilsWidth(true);\n this.setFloating();\n };\n\n private onChangeScreen = (from: ScreenSize, to: ScreenSize) => {\n this.container.classList.toggle('is-pinned-floating', mediaSizes.isMobile);\n // this.chatAudio && this.chatAudio.divAndCaption.container.classList.toggle('is-floating', to === ScreenSize.mobile);\n this.pinnedMessage && this.pinnedMessage.pinnedMessageContainer.divAndCaption.container.classList.toggle('is-floating', to === ScreenSize.mobile);\n this.onResize();\n };\n\n public destroy() {\n // this.chat.log.error('Topbar destroying');\n this.listenerSetter.removeAll();\n window.clearInterval(this.setPeerStatusInterval);\n\n this.pinnedMessage?.destroy(); // * возможно это можно не делать\n this.chatAudio?.destroy();\n\n delete this.chatAudio;\n delete this.pinnedMessage;\n }\n\n public cleanup() {\n if(!this.chat.peerId) {\n this.container.classList.add('hide');\n }\n }\n\n public async finishPeerChange(isTarget: boolean) {\n const {peerId, threadId} = this.chat;\n\n let newAvatar: AvatarElement;\n if(this.chat.type === 'chat') {\n if(this.avatarElement?.peerId !== this.peerId || this.avatarElement.threadId !== this.chat.threadId) {\n newAvatar = this.constructAvatar();\n } else {\n newAvatar = this.avatarElement;\n }\n }\n\n const [isBroadcast, isAnyChat, chat, _, setTitleCallback, setStatusCallback, state] = await Promise.all([\n this.managers.appPeersManager.isBroadcast(peerId),\n this.managers.appPeersManager.isAnyChat(peerId),\n peerId.isAnyChat() ? this.managers.appChatsManager.getChat(peerId.toChatId()) : undefined,\n newAvatar ? newAvatar.updateWithOptions({peerId, threadId, wrapOptions: {customEmojiSize: makeMediaSize(32, 32)}}) : undefined,\n this.setTitleManual(),\n this.setPeerStatusManual(true),\n apiManagerProxy.getState()\n ]);\n\n return () => {\n const canHaveSomeButtons = !(this.chat.type === 'pinned' || this.chat.type === 'scheduled');\n this.btnMute && this.btnMute.classList.toggle('hide', !isBroadcast || !canHaveSomeButtons);\n if(this.btnJoin) {\n if(isAnyChat && !this.chat.isRestricted && canHaveSomeButtons) {\n replaceContent(this.btnJoin, i18n(isBroadcast ? 'Chat.Subscribe' : 'ChannelJoin'));\n this.btnJoin.classList.toggle('hide', !(chat as MTChat.chat)?.pFlags?.left);\n } else {\n this.btnJoin.classList.add('hide');\n }\n }\n\n if(this.btnSearch) {\n this.btnSearch.classList.toggle('hide', !canHaveSomeButtons);\n }\n\n if(this.btnPinned) {\n this.btnPinned.classList.toggle('hide', !canHaveSomeButtons);\n }\n\n if(this.avatarElement !== newAvatar) {\n if(newAvatar) {\n if(this.avatarElement) {\n this.avatarElement.replaceWith(newAvatar);\n } else {\n this.person.prepend(newAvatar);\n }\n }\n\n this.avatarElement?.remove();\n this.avatarElement = newAvatar;\n }\n\n this.setUtilsWidth();\n\n this.verifyButtons();\n\n if(this.btnMore) {\n this.btnMore.classList.toggle('hide', !canHaveSomeButtons);\n }\n\n const isPinnedMessagesNeeded = this.chat.isPinnedMessagesNeeded();\n if(isPinnedMessagesNeeded || this.chat.type === 'discussion') {\n if(this.chat.wasAlreadyUsed || !this.pinnedMessage) { // * change\n const newPinnedMessage = new ChatPinnedMessage(this, this.chat, this.managers);\n if(this.pinnedMessage) {\n this.pinnedMessage.pinnedMessageContainer.divAndCaption.container.replaceWith(newPinnedMessage.pinnedMessageContainer.divAndCaption.container);\n this.pinnedMessage.destroy();\n // this.pinnedMessage.pinnedMessageContainer.toggle(true);\n } else {\n this.chatUtils.prepend(this.pinnedMessage.pinnedMessageContainer.divAndCaption.container);\n }\n\n this.pinnedMessage = newPinnedMessage;\n }\n\n if(isPinnedMessagesNeeded) {\n this.pinnedMessage.hidden = !!state.hiddenPinnedMessages[peerId];\n } else if(this.chat.type === 'discussion') {\n this.pinnedMessage.pinnedMid = this.chat.threadId;\n this.pinnedMessage.count = 1;\n this.pinnedMessage.pinnedIndex = 0;\n this.pinnedMessage._setPinnedMessage();\n }\n } else if(this.pinnedMessage) {\n this.pinnedMessage.destroy();\n this.pinnedMessage = undefined;\n }\n\n setTitleCallback();\n setStatusCallback?.();\n this.subtitle.classList.toggle('hide', !setStatusCallback);\n this.setMutedState();\n\n this.container.classList.remove('hide');\n };\n }\n\n public async setTitleManual(count?: number) {\n const {peerId, threadId} = this.chat;\n const middleware = () => this.chat.bubbles.getMiddleware();\n let titleEl: HTMLElement, icons: Element[];\n if(this.chat.type === 'pinned') {\n if(count === undefined) titleEl = i18n('Loading');\n else titleEl = i18n('PinnedMessagesCount', [count]);\n\n if(count === undefined) {\n this.managers.appMessagesManager.getSearchCounters(peerId, [{_: 'inputMessagesFilterPinned'}], false).then((result) => {\n if(!middleware()) return;\n const count = result[0].count;\n this.setTitle(count);\n\n // ! костыль х2, это нужно делать в другом месте\n if(!count) {\n this.chat.appImManager.setPeer(); // * close tab\n\n // ! костыль, это скроет закреплённые сообщения сразу, вместо того, чтобы ждать пока анимация перехода закончится\n const originalChat = this.chat.appImManager.chat;\n if(originalChat.topbar.pinnedMessage) {\n originalChat.topbar.pinnedMessage.pinnedMessageContainer.toggle(true);\n }\n }\n });\n }\n } else if(this.chat.type === 'scheduled') {\n titleEl = i18n(peerId === rootScope.myId ? 'Reminders' : 'ScheduledMessages');\n } else if(this.chat.type === 'discussion') {\n if(count === undefined) {\n const result = await this.managers.acknowledged.appMessagesManager.getHistory(peerId, 0, 1, 0, threadId);\n if(!middleware()) return;\n if(result.cached) {\n const historyResult = await result.result;\n if(!middleware()) return;\n count = historyResult.count;\n } else result.result.then((historyResult) => {\n if(!middleware()) return;\n this.setTitle(historyResult.count);\n });\n }\n\n if(count === undefined) titleEl = i18n('Loading');\n else titleEl = i18n('Chat.Title.Comments', [count]);\n } else if(this.chat.type === 'chat') {\n [titleEl/* , icons */] = await Promise.all([\n wrapPeerTitle({\n peerId,\n dialog: true,\n withIcons: !threadId,\n threadId: threadId\n })\n // generateTitleIcons(peerId)\n ]);\n\n if(!middleware()) {\n return;\n }\n }\n\n return () => {\n replaceContent(this.title, titleEl);\n // if(icons) {\n // this.title.append(...icons);\n // }\n };\n }\n\n public setTitle(count?: number) {\n this.setTitleManual(count).then((setTitleCallback) => setTitleCallback());\n }\n\n public async setMutedState() {\n if(!this.btnMute) return;\n\n const peerId = this.peerId;\n const muted = await this.managers.appNotificationsManager.isPeerLocalMuted({peerId, respectType: false, threadId: this.chat.threadId});\n if(await this.managers.appPeersManager.isBroadcast(peerId)) { // not human\n this.btnMute.classList.remove('tgico-mute', 'tgico-unmute');\n this.btnMute.classList.add(muted ? 'tgico-unmute' : 'tgico-mute');\n this.btnMute.style.display = '';\n } else {\n this.btnMute.style.display = 'none';\n }\n }\n\n // ! У МЕНЯ ПРОСТО СГОРЕЛО, САФАРИ КОНЧЕННЫЙ БРАУЗЕР - ЕСЛИ НЕ СКРЫВАТЬ БЛОК, ТО ПРИ ПЕРЕВОРОТЕ ЭКРАНА НА АЙФОНЕ БЛОК БУДЕТ НЕПРАВИЛЬНО ШИРИНЫ, ДАЖЕ БЕЗ ЭТОЙ ФУНКЦИИ!\n public setUtilsWidth = (resize = false) => {\n // return;\n if(this.setUtilsRAF) window.cancelAnimationFrame(this.setUtilsRAF);\n\n if(IS_SAFARI && resize) {\n this.chatUtils.classList.add('hide');\n }\n\n // mutationObserver.disconnect();\n this.setUtilsRAF = window.requestAnimationFrame(() => {\n // mutationRAF = window.requestAnimationFrame(() => {\n\n // setTimeout(() => {\n if(IS_SAFARI && resize) {\n this.chatUtils.classList.remove('hide');\n }\n /* this.chatInfo.style.removeProperty('--utils-width');\n void this.chatInfo.offsetLeft; // reflow */\n const width = /* chatUtils.scrollWidth */this.chatUtils.getBoundingClientRect().width;\n this.chat.log('utils width:', width);\n this.container.style.setProperty('--utils-width', width + 'px');\n // this.chatInfo.classList.toggle('have-utils-width', !!width);\n // }, 0);\n\n this.setUtilsRAF = 0;\n\n // mutationObserver.observe(chatUtils, observeOptions);\n // });\n });\n };\n\n public setFloating = () => {\n const containers = [this.chatAudio, this.pinnedMessage?.pinnedMessageContainer].filter(Boolean);\n const count = containers.reduce((acc, container) => {\n const isFloating = container.isFloating();\n this.container.classList.toggle(`is-pinned-${container.className}-floating`, isFloating);\n\n if(!container.isVisible()) {\n return acc;\n }\n\n return acc + +isFloating;\n }, 0);\n this.container.dataset.floating = '' + count;\n };\n\n public setPeerStatusManual = async(needClear = false) => {\n if(!this.subtitle || this.chat.type !== 'chat') return;\n\n if(this.chat.threadId) {\n const title = await wrapPeerTitle({peerId: this.peerId, dialog: true});\n const span = i18n('TopicProfileStatus', [title]);\n return () => replaceContent(this.subtitle, span);\n }\n\n const peerId = this.peerId;\n return this.chat.appImManager.setPeerStatus({\n peerId,\n element: this.subtitle,\n needClear,\n useWhitespace: false,\n middleware: () => peerId === this.peerId\n });\n };\n\n public setPeerStatus = (needClear?: boolean) => {\n return this.setPeerStatusManual(needClear).then((callback) => {\n callback?.();\n });\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport appSidebarRight from '..';\nimport {attachClickEvent} from '../../../helpers/dom/clickEvent';\nimport AppSearch, {SearchGroup} from '../../appSearch';\nimport ButtonIcon from '../../buttonIcon';\nimport InputSearch from '../../inputSearch';\nimport PopupElement from '../../popups';\nimport PopupDatePicker from '../../popups/datePicker';\nimport {SliderSuperTab} from '../../slider';\n\nexport default class AppPrivateSearchTab extends SliderSuperTab {\n private inputSearch: InputSearch;\n private appSearch: AppSearch;\n private btnPickDate: HTMLElement;\n\n private peerId: PeerId;\n private threadId = 0;\n private query = '';\n private onDatePick: (timestamp: number) => void;\n\n onOpenAfterTimeout() {\n this.appSearch.beginSearch(this.peerId, this.threadId, this.query);\n }\n\n public init(\n peerId: PeerId,\n threadId?: number,\n onDatePick?: AppPrivateSearchTab['onDatePick'],\n query?: string\n ) {\n this.container.id = 'search-private-container';\n this.container.classList.add('chatlist-container');\n this.inputSearch = new InputSearch('Search');\n this.title.replaceWith(this.inputSearch.container);\n\n this.btnPickDate = ButtonIcon('calendar sidebar-header-right');\n this.header.append(this.btnPickDate);\n\n const c = document.createElement('div');\n c.classList.add('chatlist-container');\n this.scrollable.container.replaceWith(c);\n this.appSearch = new AppSearch(c, this.inputSearch, {\n messages: new SearchGroup('Chat.Search.PrivateSearch', 'messages')\n });\n\n if(!this.peerId) {\n this.query = query;\n this.peerId = peerId;\n this.threadId = threadId;\n this.onDatePick = onDatePick;\n\n this.btnPickDate.classList.toggle('hide', !this.onDatePick);\n if(this.onDatePick) {\n attachClickEvent(this.btnPickDate, () => {\n PopupElement.createPopup(PopupDatePicker, new Date(), this.onDatePick).show();\n });\n }\n\n query && this.appSearch.searchInput.inputField.setValueSilently(query);\n\n appSidebarRight.toggleSidebar(true);\n } else {\n this.appSearch.beginSearch(this.peerId, this.threadId, query);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type ChatTopbar from './topbar';\nimport AppSearch, {SearchGroup} from '../appSearch';\nimport PopupDatePicker from '../popups/datePicker';\nimport ripple from '../ripple';\nimport InputSearch from '../inputSearch';\nimport type Chat from './chat';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport whichChild from '../../helpers/dom/whichChild';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport {i18n} from '../../lib/langPack';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport appNavigationController, {NavigationItem} from '../appNavigationController';\nimport {IS_MOBILE_SAFARI} from '../../environment/userAgent';\nimport PopupElement from '../popups';\nimport {DIALOG_LIST_ELEMENT_TAG} from '../../lib/appManagers/appDialogsManager';\n\nexport default class ChatSearch {\n private element: HTMLElement;\n private backBtn: HTMLElement;\n private inputSearch: InputSearch;\n\n private results: HTMLElement;\n\n private footer: HTMLElement;\n private dateBtn: HTMLElement;\n private foundCountEl: HTMLElement;\n private controls: HTMLElement;\n private downBtn: HTMLElement;\n private upBtn: HTMLElement;\n\n private appSearch: AppSearch;\n private searchGroup: SearchGroup;\n\n private foundCount = 0;\n private selectedIndex = 0;\n private setPeerPromise: Promise;\n private listenerSetter: ListenerSetter;\n private navigationItem: NavigationItem;\n\n constructor(private topbar: ChatTopbar, private chat: Chat, query?: string) {\n this.element = document.createElement('div');\n this.element.classList.add('sidebar-header', 'chat-search', 'chatlist-container');\n\n this.backBtn = document.createElement('button');\n this.backBtn.classList.add('btn-icon', 'tgico-left', 'sidebar-close-button');\n ripple(this.backBtn);\n\n const listenerSetter = this.listenerSetter = new ListenerSetter();\n\n const attachClick = (element: HTMLElement, callback: (e: MouseEvent) => void) => {\n attachClickEvent(element, callback, {listenerSetter});\n };\n\n attachClick(this.backBtn, () => {\n this.destroy();\n });\n\n this.inputSearch = new InputSearch('Search');\n\n // Results\n this.results = document.createElement('div');\n this.results.classList.add('chat-search-results', 'chatlist-container');\n\n this.searchGroup = new SearchGroup(false, 'messages', undefined, '', false);\n attachClick(this.searchGroup.list, this.onResultsClick);\n\n this.appSearch = new AppSearch(this.results, this.inputSearch, {\n messages: this.searchGroup\n }, (count) => {\n this.foundCount = count;\n\n if(!this.foundCount) {\n replaceContent(this.foundCountEl, this.inputSearch.value ? i18n('NoResult') : '');\n this.results.classList.remove('active');\n this.chat.bubbles.container.classList.remove('search-results-active');\n this.upBtn.setAttribute('disabled', 'true');\n this.downBtn.setAttribute('disabled', 'true');\n } else {\n this.selectResult(this.searchGroup.list.children[0] as HTMLElement);\n }\n });\n this.appSearch.beginSearch(this.chat.peerId, this.chat.threadId);\n\n // appImManager.topbar.parentElement.insertBefore(this.results, appImManager.bubblesContainer);\n this.chat.bubbles.container.append(this.results);\n\n // Footer\n this.footer = document.createElement('div');\n this.footer.classList.add('chat-search-footer');\n\n attachClick(this.footer, this.onFooterClick);\n ripple(this.footer);\n\n this.foundCountEl = document.createElement('span');\n this.foundCountEl.classList.add('chat-search-count');\n\n this.dateBtn = document.createElement('button');\n this.dateBtn.classList.add('btn-icon', 'tgico-calendar');\n\n this.controls = document.createElement('div');\n this.controls.classList.add('chat-search-controls');\n\n this.upBtn = document.createElement('button');\n this.upBtn.classList.add('btn-icon', 'tgico-up');\n this.downBtn = document.createElement('button');\n this.downBtn.classList.add('btn-icon', 'tgico-down');\n\n this.upBtn.setAttribute('disabled', 'true');\n this.downBtn.setAttribute('disabled', 'true');\n\n attachClick(this.dateBtn, this.onDateClick);\n attachClick(this.upBtn, this.onUpClick);\n attachClick(this.downBtn, this.onDownClick);\n this.controls.append(this.upBtn, this.downBtn);\n\n this.footer.append(this.foundCountEl, this.dateBtn, this.controls);\n\n this.topbar.container.parentElement.insertBefore(this.footer, chat.input.chatInput);\n\n // Append container\n this.element.append(this.backBtn, this.inputSearch.container);\n\n this.topbar.container.classList.add('hide-pinned');\n this.topbar.container.parentElement.append(this.element);\n\n this.inputSearch.input.focus();\n\n if(query) {\n this.setQuery(query);\n }\n\n if(!IS_MOBILE_SAFARI) {\n this.navigationItem = {\n type: 'mobile-search',\n onPop: () => {\n this.destroy();\n }\n };\n\n appNavigationController.pushItem(this.navigationItem);\n }\n }\n\n public destroy() {\n this.topbar.container.classList.remove('hide-pinned');\n this.element.remove();\n this.inputSearch.remove();\n this.results.remove();\n this.footer.remove();\n this.listenerSetter.removeAll();\n this.chat.bubbles.container.classList.remove('search-results-active');\n this.chat.search = undefined;\n appNavigationController.removeItem(this.navigationItem);\n }\n\n public setQuery(query: string) {\n this.inputSearch.inputField.value = query;\n }\n\n private onDateClick = (e: MouseEvent) => {\n cancelEvent(e);\n PopupElement.createPopup(PopupDatePicker, new Date(), this.chat.bubbles.onDatePick).show();\n };\n\n private selectResult(elem: HTMLElement) {\n if(this.setPeerPromise) return this.setPeerPromise;\n\n const peerId = elem.dataset.peerId.toPeerId();\n const lastMsgId = +elem.dataset.mid || undefined;\n\n const index = whichChild(elem);\n\n if(index === (this.foundCount - 1)) {\n this.upBtn.setAttribute('disabled', 'true');\n } else {\n this.upBtn.removeAttribute('disabled');\n }\n\n if(!index) {\n this.downBtn.setAttribute('disabled', 'true');\n } else {\n this.downBtn.removeAttribute('disabled');\n }\n\n this.results.classList.remove('active');\n this.chat.bubbles.container.classList.remove('search-results-active');\n\n const res = this.chat.setPeer({peerId, lastMsgId});\n this.setPeerPromise = ((res instanceof Promise ? res : Promise.resolve(res)) as Promise).then(() => {\n this.selectedIndex = index;\n replaceContent(this.foundCountEl, i18n('Of', [index + 1, this.foundCount]));\n\n const renderedCount = this.searchGroup.list.childElementCount;\n if(this.selectedIndex >= (renderedCount - 6)) {\n this.appSearch.searchMore();\n }\n }).finally(() => {\n this.setPeerPromise = null;\n });\n }\n\n private onResultsClick = (e: MouseEvent) => {\n const target = findUpTag(e.target, DIALOG_LIST_ELEMENT_TAG);\n if(target) {\n this.selectResult(target);\n }\n };\n\n private onFooterClick = (e: MouseEvent) => {\n if(this.foundCount) {\n this.chat.bubbles.container.classList.toggle('search-results-active');\n this.results.classList.toggle('active');\n }\n };\n\n private onUpClick = (e: MouseEvent) => {\n cancelEvent(e);\n this.selectResult(this.searchGroup.list.children[this.selectedIndex + 1] as HTMLElement);\n };\n\n private onDownClick = (e: MouseEvent) => {\n cancelEvent(e);\n this.selectResult(this.searchGroup.list.children[this.selectedIndex - 1] as HTMLElement);\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport deepEqual from '../../helpers/object/deepEqual';\nimport {renderImageFromUrlPromise} from '../../helpers/dom/renderImageFromUrl';\nimport mediaSizes, {ScreenSize} from '../../helpers/mediaSizes';\nimport windowSize from '../../helpers/windowSize';\nimport IS_IMAGE_BITMAP_SUPPORTED from '../../environment/imageBitmapSupport';\n\ntype ChatBackgroundPatternRendererInitOptions = {\n url: string,\n width: number,\n height: number,\n mask?: boolean\n};\n\nexport default class ChatBackgroundPatternRenderer {\n private static INSTANCES: ChatBackgroundPatternRenderer[] = [];\n\n // private pattern: CanvasPattern;\n private objectUrl: string;\n private options: ChatBackgroundPatternRendererInitOptions;\n private canvases: Set;\n // private createCanvasPatternPromise: Promise;\n // private exportCanvasPatternToImagePromise: Promise;\n private renderImageFromUrlPromise: Promise;\n private image: HTMLImageElement;\n private imageBitmap: ImageBitmap;\n\n constructor() {\n this.canvases = new Set();\n }\n\n public static getInstance(options: ChatBackgroundPatternRendererInitOptions) {\n let instance = this.INSTANCES.find((instance) => {\n return deepEqual(instance.options, options);\n });\n\n if(!instance) {\n instance = new ChatBackgroundPatternRenderer();\n instance.init(options);\n this.INSTANCES.push(instance);\n }\n\n return instance;\n }\n\n public init(options: ChatBackgroundPatternRendererInitOptions) {\n // if(this.options) {\n // if(this.options.width !== options.width || this.options.height !== options.height) {\n // this.createCanvasPatternPromise =\n // this.pattern =\n // this.exportCanvasPatternToImagePromise =\n // undefined;\n // }\n // }\n\n this.options = options;\n }\n\n public renderToCanvas(canvas: HTMLCanvasElement) {\n // return this.createCanvasPattern(canvas).then(() => {\n // return this.fillCanvas(canvas);\n // });\n\n return this.renderImageFromUrl(this.options.url).then(() => {\n return this.fillCanvas(canvas);\n });\n }\n\n private renderImageFromUrl(url: string) {\n if(this.renderImageFromUrlPromise) return this.renderImageFromUrlPromise;\n const img = this.image = document.createElement('img');\n img.crossOrigin = 'anonymous';\n return this.renderImageFromUrlPromise = renderImageFromUrlPromise(img, url, false).then(() => {\n if(!IS_IMAGE_BITMAP_SUPPORTED) {\n return img;\n }\n\n return createImageBitmap(img, {\n resizeWidth: 1440,\n resizeHeight: 2960\n }).then((imageBitmap) => {\n this.imageBitmap = imageBitmap;\n return img;\n });\n });\n }\n\n /* private createCanvasPattern(canvas: HTMLCanvasElement) {\n if(this.createCanvasPatternPromise) return this.createCanvasPatternPromise;\n return this.createCanvasPatternPromise = this.renderImageFromUrl(this.options.url).then((img) => {\n let createPatternFrom: HTMLImageElement | HTMLCanvasElement;\n if(IS_SAFARI) {\n const canvas = createPatternFrom = document.createElement('canvas');\n canvas.width = img.naturalWidth;\n canvas.height = img.naturalHeight;\n const ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n } else {\n createPatternFrom = img;\n }\n\n const perf = performance.now();\n this.pattern = canvas.getContext('2d').createPattern(createPatternFrom, 'repeat-x');\n console.warn('creating pattern time:', performance.now() - perf);\n\n return this.pattern;\n });\n }\n\n public exportCanvasPatternToImage(canvas: HTMLCanvasElement) {\n if(this.exportCanvasPatternToImagePromise) return this.exportCanvasPatternToImagePromise;\n return this.exportCanvasPatternToImagePromise = new Promise((resolve) => {\n canvas.toBlob((blob) => {\n const newUrl = this.objectUrl = URL.createObjectURL(blob);\n resolve(newUrl);\n }, 'image/png');\n });\n } */\n\n public cleanup(canvas: HTMLCanvasElement) {\n this.canvases.delete(canvas);\n\n if(!this.canvases.size) {\n indexOfAndSplice(ChatBackgroundPatternRenderer.INSTANCES, this);\n\n if(this.objectUrl) {\n this.imageBitmap?.close();\n URL.revokeObjectURL(this.objectUrl);\n }\n }\n }\n\n public fillCanvas(canvas: HTMLCanvasElement) {\n const context = canvas.getContext('2d');\n const {width, height} = canvas;\n // const perf = performance.now();\n // if(context.fillStyle instanceof CanvasPattern) {\n // context.clearRect(0, 0, width, height);\n // }\n\n const source = this.imageBitmap || this.image;\n\n let imageWidth = source.width, imageHeight = source.height;\n // let patternHeight = 1480 * canvas.dpr;\n // if(+canvas.dataset.originalHeight !== height) patternHeight *= .6875;\n const patternHeight = (500 + (windowSize.height / 2.5)) * canvas.dpr;\n const ratio = patternHeight / imageHeight;\n imageWidth *= ratio;\n imageHeight = patternHeight;\n\n if(this.options.mask) {\n context.fillStyle = '#000';\n context.fillRect(0, 0, width, height);\n context.globalCompositeOperation = 'destination-out';\n } else {\n context.globalCompositeOperation = 'source-over';\n }\n\n const d = (y: number) => {\n for(let x = 0; x < width; x += imageWidth) {\n context.drawImage(source, x, y, imageWidth, imageHeight);\n }\n };\n\n const centerY = (height - imageHeight) / 2;\n d(centerY);\n\n if(centerY > 0) {\n let topY = centerY;\n do {\n d(topY -= imageHeight);\n } while(topY >= 0);\n }\n\n const endY = height - 1;\n for(let bottomY = centerY + imageHeight; bottomY < endY; bottomY += imageHeight) {\n d(bottomY);\n }\n\n // for(let x = 0; x < width; x += imageWidth) {\n // for(let y = 0; y < height; y += imageHeight) {\n // context.drawImage(img, x, y, imageWidth, imageHeight);\n // }\n // }\n // context.fillStyle = this.pattern;\n // context.fillRect(0, 0, width, height);\n // console.warn('fill canvas time', performance.now() - perf);\n }\n\n public setCanvasDimensions(canvas: HTMLCanvasElement) {\n const devicePixelRatio = Math.min(2, window.devicePixelRatio);\n const width = this.options.width * devicePixelRatio;\n let height = this.options.height * devicePixelRatio;\n\n canvas.dpr = devicePixelRatio;\n canvas.dataset.originalHeight = '' + height;\n if(mediaSizes.activeScreen === ScreenSize.large) height *= 1.5;\n canvas.width = width;\n canvas.height = height;\n }\n\n public createCanvas() {\n const canvas = document.createElement('canvas');\n this.canvases.add(canvas);\n this.setCanvasDimensions(canvas);\n return canvas;\n }\n\n public resize(width: number, height: number) {\n this.init({\n ...this.options,\n width,\n height\n });\n\n const promises: Promise[] = [];\n for(const canvas of this.canvases) {\n this.setCanvasDimensions(canvas);\n promises.push(this.renderToCanvas(canvas));\n }\n\n return Promise.all(promises);\n }\n\n public static resizeInstances(width: number, height: number) {\n return Promise.all(this.INSTANCES.map((instance) => instance.resize(width, height)));\n }\n\n /* public setResizeMode(resizing: boolean) {\n const canvases = Array.from(this.canvases);\n const canvas = canvases[canvases.length - 1];\n canvas.style.display = resizing ? 'none' : '';\n const img = this.img;\n img.style.display = resizing ? '' : 'none';\n\n return {img, canvas};\n } */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {ChatRights} from '../../lib/appManagers/appChatsManager';\nimport {AppImManager, APP_TABS, ChatSetPeerOptions} from '../../lib/appManagers/appImManager';\nimport type {MessageSendingParams, MessagesStorageKey} from '../../lib/appManagers/appMessagesManager';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport {logger, LogTypes} from '../../lib/logger';\nimport rootScope from '../../lib/rootScope';\nimport appSidebarRight from '../sidebarRight';\nimport ChatBubbles from './bubbles';\nimport ChatContextMenu from './contextMenu';\nimport ChatInput from './input';\nimport ChatSelection from './selection';\nimport ChatTopbar from './topbar';\nimport {NULL_PEER_ID, REPLIES_PEER_ID} from '../../lib/mtproto/mtproto_config';\nimport SetTransition from '../singleTransition';\nimport AppPrivateSearchTab from '../sidebarRight/tabs/search';\nimport renderImageFromUrl from '../../helpers/dom/renderImageFromUrl';\nimport mediaSizes, {ScreenSize} from '../../helpers/mediaSizes';\nimport ChatSearch from './search';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport getAutoDownloadSettingsByPeerId, {ChatAutoDownloadSettings} from '../../helpers/autoDownload';\nimport ChatBackgroundGradientRenderer from './gradientRenderer';\nimport ChatBackgroundPatternRenderer from './patternRenderer';\nimport pause from '../../helpers/schedulers/pause';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport SlicedArray from '../../helpers/slicedArray';\nimport themeController from '../../helpers/themeController';\nimport AppSharedMediaTab from '../sidebarRight/tabs/sharedMedia';\nimport noop from '../../helpers/noop';\nimport middlewarePromise from '../../helpers/middlewarePromise';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport {Message, WallPaper} from '../../layer';\nimport animationIntersector, {AnimationItemGroup} from '../animationIntersector';\nimport {getColorsFromWallPaper} from '../../helpers/color';\nimport liteMode from '../../helpers/liteMode';\n\nexport type ChatType = 'chat' | 'pinned' | 'discussion' | 'scheduled';\n\nexport default class Chat extends EventListenerBase<{\n setPeer: (mid: number, isTopMessage: boolean) => void\n}> {\n public container: HTMLElement;\n public backgroundEl: HTMLElement;\n\n public topbar: ChatTopbar;\n public bubbles: ChatBubbles;\n public input: ChatInput;\n public selection: ChatSelection;\n public contextMenu: ChatContextMenu;\n public search: ChatSearch;\n\n public wasAlreadyUsed: boolean;\n // public initPeerId = 0;\n public peerId: PeerId;\n public threadId: number;\n public setPeerPromise: Promise;\n public peerChanged: boolean;\n\n public log: ReturnType;\n\n public type: ChatType;\n public messagesStorageKey: MessagesStorageKey;\n\n public noForwards: boolean;\n\n public inited: boolean;\n\n public isRestricted: boolean;\n public autoDownload: ChatAutoDownloadSettings;\n\n public gradientRenderer: ChatBackgroundGradientRenderer;\n public patternRenderer: ChatBackgroundPatternRenderer;\n public gradientCanvas: HTMLCanvasElement;\n public patternCanvas: HTMLCanvasElement;\n public backgroundTempId: number;\n public setBackgroundPromise: Promise;\n public sharedMediaTab: AppSharedMediaTab;\n public sharedMediaTabs: AppSharedMediaTab[];\n // public renderDarkPattern: () => Promise;\n\n public isBot: boolean;\n public isChannel: boolean;\n public isBroadcast: boolean;\n public isAnyGroup: boolean;\n public isMegagroup: boolean;\n public isForum: boolean;\n public isAllMessagesForum: boolean;\n public isAnonymousSending: boolean;\n\n public animationGroup: AnimationItemGroup;\n\n constructor(\n public appImManager: AppImManager,\n public managers: AppManagers\n ) {\n super();\n\n this.type = 'chat';\n this.animationGroup = `chat-${Math.round(Math.random() * 65535)}`;\n\n this.container = document.createElement('div');\n this.container.classList.add('chat', 'tabs-tab');\n\n this.backgroundEl = document.createElement('div');\n this.backgroundEl.classList.add('chat-background');\n\n // * constructor end\n\n this.log = logger('CHAT', LogTypes.Log | LogTypes.Warn | LogTypes.Debug | LogTypes.Error);\n this.log.warn('constructor');\n\n this.peerId = NULL_PEER_ID;\n\n this.container.append(this.backgroundEl);\n this.appImManager.chatsContainer.append(this.container);\n\n this.backgroundTempId = 0;\n this.sharedMediaTabs = [];\n }\n\n public setBackground(url: string, skipAnimation?: boolean): Promise {\n const theme = themeController.getTheme();\n const themeSettings = theme.settings;\n const wallPaper = themeSettings.wallpaper;\n const colors = getColorsFromWallPaper(wallPaper);\n\n let item: HTMLElement;\n const isColorBackground = !!colors && !(wallPaper as WallPaper.wallPaper).slug && !wallPaper.settings.intensity;\n if(\n isColorBackground &&\n document.documentElement.style.cursor === 'grabbing' &&\n this.gradientRenderer &&\n !this.patternRenderer\n ) {\n this.gradientCanvas.dataset.colors = colors;\n this.gradientRenderer.init(this.gradientCanvas);\n return Promise.resolve();\n }\n\n const tempId = ++this.backgroundTempId;\n\n const previousGradientRenderer = this.gradientRenderer;\n const previousPatternRenderer = this.patternRenderer;\n const previousGradientCanvas = this.gradientCanvas;\n const previousPatternCanvas = this.patternCanvas;\n\n this.gradientRenderer =\n this.patternRenderer =\n this.gradientCanvas =\n this.patternCanvas =\n // this.renderDarkPattern =\n undefined;\n\n const intensity = wallPaper.settings?.intensity && wallPaper.settings.intensity / 100;\n const isDarkPattern = !!intensity && intensity < 0;\n\n let patternRenderer: ChatBackgroundPatternRenderer;\n let patternCanvas = item?.firstElementChild as HTMLCanvasElement;\n let gradientCanvas: HTMLCanvasElement;\n if(!item) {\n item = document.createElement('div');\n item.classList.add('chat-background-item');\n\n if(url) {\n if(intensity) {\n item.classList.add('is-pattern');\n\n const rect = this.appImManager.chatsContainer.getBoundingClientRect();\n patternRenderer = this.patternRenderer = ChatBackgroundPatternRenderer.getInstance({\n url,\n width: rect.width,\n height: rect.height,\n mask: isDarkPattern\n });\n\n patternCanvas = this.patternCanvas = patternRenderer.createCanvas();\n patternCanvas.classList.add('chat-background-item-canvas', 'chat-background-item-pattern-canvas');\n\n if(isDarkPattern) {\n item.classList.add('is-dark');\n }\n\n // if(isDarkPattern) {\n // this.renderDarkPattern = () => {\n // return patternRenderer.exportCanvasPatternToImage(patternCanvas).then((url) => {\n // if(this.backgroundTempId !== tempId) {\n // return;\n // }\n\n // gradientCanvas.style.webkitMaskImage = `url(${url})`;\n // });\n // };\n // }\n } else {\n item.classList.add('is-image');\n }\n } else {\n item.classList.add('is-color');\n }\n }\n\n let gradientRenderer: ChatBackgroundGradientRenderer;\n if(colors) {\n // if(color.includes(',')) {\n const {canvas, gradientRenderer: _gradientRenderer} = ChatBackgroundGradientRenderer.create(colors);\n gradientRenderer = this.gradientRenderer = _gradientRenderer;\n gradientCanvas = this.gradientCanvas = canvas;\n gradientCanvas.classList.add('chat-background-item-canvas', 'chat-background-item-color-canvas');\n\n if(liteMode.isAvailable('animations')) {\n gradientRenderer.scrollAnimate(true);\n }\n // } else {\n // item.style.backgroundColor = color;\n // item.style.backgroundImage = 'none';\n // }\n }\n\n if(patternRenderer) {\n const setOpacityTo = isDarkPattern ? gradientCanvas : patternCanvas;\n let opacityMax = Math.abs(intensity) * (isDarkPattern ? .5 : 1);\n if(isDarkPattern) {\n opacityMax = Math.max(0.3, opacityMax);\n }\n setOpacityTo.style.setProperty('--opacity-max', '' + opacityMax);\n }\n\n const promise = new Promise((resolve) => {\n const cb = () => {\n if(this.backgroundTempId !== tempId) {\n if(patternRenderer) {\n patternRenderer.cleanup(patternCanvas);\n }\n\n if(gradientRenderer) {\n gradientRenderer.cleanup();\n }\n\n return;\n }\n\n const prev = this.backgroundEl.lastElementChild as HTMLElement;\n\n if(prev === item) {\n resolve();\n return;\n }\n\n const append = [\n gradientCanvas,\n // isDarkPattern && this.renderDarkPattern ? undefined : patternCanvas\n patternCanvas\n ].filter(Boolean);\n if(append.length) {\n item.append(...append);\n }\n\n this.backgroundEl.append(item);\n\n SetTransition({\n element: item,\n className: 'is-visible',\n forwards: true,\n duration: !skipAnimation ? 200 : 0,\n onTransitionEnd: prev ? () => {\n previousPatternRenderer?.cleanup(previousPatternCanvas);\n previousGradientRenderer?.cleanup();\n\n prev.remove();\n } : null,\n useRafs: 2\n });\n\n resolve();\n };\n\n if(patternRenderer) {\n const renderPatternPromise = patternRenderer.renderToCanvas(patternCanvas);\n renderPatternPromise.then(() => {\n if(this.backgroundTempId !== tempId) {\n return;\n }\n\n // let promise: Promise;\n // if(isDarkPattern && this.renderDarkPattern) {\n // promise = this.renderDarkPattern();\n // } else {\n // const promise = Promise.resolve();\n // }\n\n // promise.then(cb);\n cb();\n });\n } else if(url) {\n renderImageFromUrl(item, url, cb);\n } else {\n cb();\n }\n });\n\n return this.setBackgroundPromise = Promise.race([\n pause(500),\n promise\n ]);\n }\n\n public setType(type: ChatType) {\n this.type = type;\n }\n\n public init(/* peerId: PeerId */) {\n // this.initPeerId = peerId;\n\n this.topbar = new ChatTopbar(this, appSidebarRight, this.managers);\n this.bubbles = new ChatBubbles(this, this.managers);\n this.input = new ChatInput(this, this.appImManager, this.managers);\n this.contextMenu = new ChatContextMenu(this, this.managers);\n this.selection = new ChatSelection(this, this.bubbles, this.input, this.managers);\n\n this.topbar.constructUtils();\n this.topbar.constructPeerHelpers();\n\n this.topbar.construct();\n this.input.construct();\n\n this.bubbles.constructPeerHelpers();\n this.input.constructPeerHelpers();\n\n if(!IS_TOUCH_SUPPORTED) {\n this.bubbles.setReactionsHoverListeners();\n }\n\n this.bubbles.attachContainerListeners();\n\n this.container.append(this.topbar.container, this.bubbles.container, this.input.chatInput);\n\n this.bubbles.listenerSetter.add(rootScope)('dialog_migrate', ({migrateFrom, migrateTo}) => {\n if(this.peerId === migrateFrom) {\n this.setPeer({peerId: migrateTo});\n }\n });\n\n this.bubbles.listenerSetter.add(rootScope)('dialog_drop', (dialog) => {\n if(dialog.peerId === this.peerId && (dialog._ === 'dialog' || this.threadId === dialog.id)) {\n this.appImManager.setPeer();\n }\n });\n\n this.bubbles.listenerSetter.add(rootScope)('chat_update', async(chatId) => {\n const {peerId} = this;\n if(peerId.isAnyChat() && peerId.toChatId() === chatId) {\n const isAnonymousSending = await this.managers.appMessagesManager.isAnonymousSending(peerId);\n if(peerId === this.peerId) {\n this.isAnonymousSending = isAnonymousSending;\n }\n }\n });\n\n const freezeObservers = (freeze: boolean) => {\n const cb = () => {\n this.bubbles.observer?.toggleObservingNew(freeze);\n animationIntersector.toggleIntersectionGroup(this.animationGroup, freeze);\n if(freeze) {\n animationIntersector.checkAnimations(freeze, this.animationGroup);\n }\n };\n\n if(!freeze) {\n setTimeout(() => {\n cb();\n }, 400);\n } else {\n cb();\n }\n };\n\n this.bubbles.listenerSetter.add(this.appImManager)('chat_changing', ({to}) => {\n freezeObservers(to !== this);\n });\n\n this.bubbles.listenerSetter.add(this.appImManager)('tab_changing', (tabId) => {\n freezeObservers(this.appImManager.chat !== this || (tabId !== APP_TABS.CHAT && mediaSizes.activeScreen === ScreenSize.mobile));\n });\n }\n\n public beforeDestroy() {\n this.bubbles.cleanup();\n }\n\n private cleanupBackground() {\n ++this.backgroundTempId;\n if(this.patternRenderer) {\n this.patternRenderer.cleanup(this.patternCanvas);\n this.patternRenderer = undefined;\n }\n\n if(this.gradientRenderer) {\n this.gradientRenderer.cleanup();\n this.gradientRenderer = undefined;\n }\n }\n\n public destroy() {\n // const perf = performance.now();\n\n this.destroySharedMediaTab();\n this.topbar.destroy();\n this.bubbles.destroy();\n this.input.destroy();\n this.contextMenu && this.contextMenu.destroy();\n this.selection && this.selection.attachListeners(undefined, undefined);\n\n this.cleanupBackground();\n\n delete this.topbar;\n delete this.bubbles;\n delete this.input;\n delete this.selection;\n delete this.contextMenu;\n\n this.container.remove();\n\n // this.log.error('Chat destroy time:', performance.now() - perf);\n }\n\n public cleanup(helperToo = true) {\n this.input.cleanup(helperToo);\n this.topbar.cleanup();\n this.selection.cleanup();\n }\n\n public get isForumTopic() {\n return !!(this.isForum && this.threadId);\n }\n\n public async onChangePeer(options: ChatSetPeerOptions, m: ReturnType) {\n const {peerId, threadId} = this;\n\n const searchTab = appSidebarRight.getTab(AppPrivateSearchTab);\n searchTab?.close();\n\n const [\n noForwards,\n isRestricted,\n isAnyGroup,\n _,\n isMegagroup,\n isBroadcast,\n isChannel,\n isBot,\n isForum,\n isAnonymousSending\n ] = await m(Promise.all([\n this.managers.appPeersManager.noForwards(peerId),\n this.managers.appPeersManager.isPeerRestricted(peerId),\n this._isAnyGroup(peerId),\n this.setAutoDownloadMedia(),\n this.managers.appPeersManager.isMegagroup(peerId),\n this.managers.appPeersManager.isBroadcast(peerId),\n this.managers.appPeersManager.isChannel(peerId),\n this.managers.appPeersManager.isBot(peerId),\n this.managers.appPeersManager.isForum(peerId),\n this.managers.appMessagesManager.isAnonymousSending(peerId)\n ]));\n\n // ! WARNING: TEMPORARY, HAVE TO GET TOPIC\n if(isForum && threadId) {\n await m(this.managers.dialogsStorage.getForumTopicOrReload(peerId, threadId));\n }\n\n this.noForwards = noForwards;\n this.isRestricted = isRestricted;\n this.isAnyGroup = isAnyGroup;\n this.isMegagroup = isMegagroup;\n this.isBroadcast = isBroadcast;\n this.isChannel = isChannel;\n this.isBot = isBot;\n this.isForum = isForum;\n this.isAllMessagesForum = isForum && !threadId;\n this.isAnonymousSending = isAnonymousSending;\n\n if(threadId && !this.isForum) {\n options.type = 'discussion';\n }\n\n const type = options.type ?? 'chat';\n this.setType(type);\n\n this.messagesStorageKey = `${this.peerId}_${this.type === 'scheduled' ? 'scheduled' : 'history'}`;\n\n this.container.classList.toggle('no-forwards', this.noForwards);\n\n this.sharedMediaTab = appSidebarRight.createSharedMediaTab();\n this.sharedMediaTabs.push(this.sharedMediaTab);\n\n this.sharedMediaTab.setPeer(peerId, threadId);\n this.input.clearHelper(); // костыль\n this.selection.cleanup(); // TODO: REFACTOR !!!!!!\n }\n\n public setPeer(options: ChatSetPeerOptions) {\n const {peerId, threadId} = options;\n if(!peerId) {\n this.inited = undefined;\n } else if(!this.inited) {\n if(this.init) {\n this.init(/* peerId */);\n this.init = null;\n }\n\n this.inited = true;\n }\n\n // const appMediaViewer = (window as any).appMediaViewer as AppMediaViewerBase;\n // if(appMediaViewer) {\n // appMediaViewer.close();\n // }\n\n const samePeer = this.appImManager.isSamePeer(this, options);\n if(!samePeer) {\n this.appImManager.dispatchEvent('peer_changing', this);\n this.peerId = peerId || NULL_PEER_ID;\n this.threadId = threadId;\n } else if(this.setPeerPromise) {\n return;\n }\n\n if(!peerId) {\n appSidebarRight.toggleSidebar(false);\n this.cleanup(true);\n this.bubbles.setPeer({samePeer: false, peerId});\n this.peerId = 0;\n this.appImManager.dispatchEvent('peer_changed', this);\n\n appSidebarRight.replaceSharedMediaTab();\n this.destroySharedMediaTab();\n this.sharedMediaTab = undefined;\n\n return;\n }\n\n this.peerChanged = samePeer;\n\n const bubblesSetPeerPromise = this.bubbles.setPeer({...options, samePeer});\n const setPeerPromise = this.setPeerPromise = bubblesSetPeerPromise.then((result) => {\n return result.promise;\n }).catch(noop).finally(() => {\n if(this.setPeerPromise === setPeerPromise) {\n this.setPeerPromise = null;\n }\n });\n\n return bubblesSetPeerPromise;\n }\n\n public destroySharedMediaTab(tab = this.sharedMediaTab) {\n if(!tab) {\n return;\n }\n\n indexOfAndSplice(this.sharedMediaTabs, tab);\n tab.destroy();\n }\n\n public async setAutoDownloadMedia() {\n this.autoDownload = await getAutoDownloadSettingsByPeerId(this.peerId);\n }\n\n public setMessageId(messageId?: number) {\n return this.setPeer({\n peerId: this.peerId,\n threadId: this.threadId,\n lastMsgId: messageId\n });\n }\n\n public async finishPeerChange(isTarget: boolean, isJump: boolean, lastMsgId: number, startParam?: string) {\n if(this.peerChanged) return;\n\n const peerId = this.peerId;\n this.peerChanged = true;\n this.wasAlreadyUsed = true;\n\n const middleware = this.bubbles.getMiddleware();\n\n this.cleanup(false);\n\n const sharedMediaTab = this.sharedMediaTab;\n\n const callbacksPromise = Promise.all([\n this.topbar.finishPeerChange(isTarget),\n this.bubbles.finishPeerChange(),\n this.input.finishPeerChange(startParam),\n sharedMediaTab.fillProfileElements()\n ]);\n\n const callbacks = await callbacksPromise;\n sharedMediaTab.loadSidebarMedia(true);\n\n if(!middleware()) {\n return;\n }\n\n callbacks.forEach((callback) => {\n callback?.();\n });\n\n appSidebarRight.replaceSharedMediaTab(sharedMediaTab);\n\n this.sharedMediaTabs.filter((tab) => tab !== sharedMediaTab).forEach((tab) => this.destroySharedMediaTab(tab));\n\n this.container.dataset.type = this.type;\n this.log.setPrefix('CHAT-' + peerId + '-' + this.type);\n\n this.appImManager.dispatchEvent('peer_changed', this);\n }\n\n public getMessage(mid: number) {\n return this.managers.appMessagesManager.getMessageFromStorage(this.messagesStorageKey, mid);\n }\n\n public async getMidsByMid(mid: number) {\n return this.managers.appMessagesManager.getMidsByMessage(await this.getMessage(mid));\n }\n\n public getHistoryStorage(ignoreThreadId?: boolean) {\n return this.managers.appMessagesManager.getHistoryStorageTransferable(this.peerId, ignoreThreadId ? undefined : this.threadId)\n .then((historyStorageTransferable) => {\n return {\n ...historyStorageTransferable,\n history: SlicedArray.fromJSON(historyStorageTransferable.historySerialized)\n }\n });\n }\n\n public getDialogOrTopic() {\n return this.isForum && this.threadId ? this.managers.dialogsStorage.getForumTopic(this.peerId, this.threadId) : this.managers.dialogsStorage.getDialogOnly(this.peerId);\n }\n\n public getHistoryMaxId() {\n return this.getHistoryStorage().then((historyStorage) => historyStorage.maxId);\n }\n\n public async _isAnyGroup(peerId: PeerId) {\n return peerId === rootScope.myId || peerId === REPLIES_PEER_ID || (await this.managers.appPeersManager.isAnyGroup(peerId));\n }\n\n public initSearch(query?: string) {\n if(!this.peerId) return;\n\n if(mediaSizes.isMobile) {\n if(!this.search) {\n this.search = new ChatSearch(this.topbar, this, query);\n } else {\n this.search.setQuery(query);\n }\n } else {\n let tab = appSidebarRight.getTab(AppPrivateSearchTab);\n if(!tab) {\n tab = appSidebarRight.createTab(AppPrivateSearchTab);\n }\n\n tab.open(this.peerId, this.threadId, this.bubbles.onDatePick, query);\n }\n }\n\n public canSend(action?: ChatRights) {\n return this.managers.appMessagesManager.canSendToPeer(this.peerId, this.threadId, action);\n }\n\n public isStartButtonNeeded() {\n return Promise.all([\n this.managers.appPeersManager.isBot(this.peerId),\n this.managers.appMessagesManager.getDialogOnly(this.peerId),\n this.getHistoryStorage(true)\n ]).then(([isBot, dialog, historyStorage]) => {\n return isBot && !dialog && !historyStorage.history.length;\n });\n }\n\n public getMessageSendingParams(): MessageSendingParams {\n return {\n threadId: this.threadId,\n replyToMsgId: this.input.replyToMsgId,\n scheduleDate: this.input.scheduleDate,\n silent: this.input.sendSilent,\n sendAsPeerId: this.input.sendAsPeerId,\n updateStickersetOrder: rootScope.settings.stickers.dynamicPackOrder\n };\n }\n\n public isOurMessage(message: Message.message | Message.messageService) {\n return message.fromId === rootScope.myId || (!!message.pFlags.out && this.isMegagroup);\n }\n\n public isOutMessage(message: Message.message | Message.messageService) {\n const fwdFrom = (message as Message.message).fwd_from;\n const isOut = this.isOurMessage(message) && (!fwdFrom || this.peerId !== rootScope.myId);\n return !!isOut;\n }\n\n public isAvatarNeeded(message: Message.message | Message.messageService) {\n return this.isAnyGroup && !this.isOutMessage(message);\n }\n\n public isPinnedMessagesNeeded() {\n return this.type === 'chat' || this.isForum;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {State} from '../config/state';\nimport rootScope from '../lib/rootScope';\n\nexport type ChatAutoDownloadSettings = {\n photo: number,\n video: number,\n file: number\n};\n\nexport default async function getAutoDownloadSettingsByPeerId(peerId: PeerId): Promise {\n let type: keyof State['settings']['autoDownload'];\n\n let photoSizeMax = 0, videoSizeMax = 0, fileSizeMax = 0;\n const settings = rootScope.settings;\n const appPeersManager = rootScope.managers.appPeersManager;\n if(!settings.autoDownloadNew.pFlags.disabled && peerId) {\n if(peerId.isUser()) {\n if(await appPeersManager.isContact(peerId)) {\n type = 'contacts';\n } else {\n type = 'private';\n }\n } else if(await appPeersManager.isBroadcast(peerId)) {\n type = 'channels';\n } else {\n type = 'groups';\n }\n\n if(settings.autoDownload.photo[type]) photoSizeMax = settings.autoDownloadNew.photo_size_max;\n if(settings.autoDownload.video[type]) videoSizeMax = settings.autoDownloadNew.video_size_max;\n if(settings.autoDownload.file[type]) fileSizeMax = settings.autoDownloadNew.file_size_max;\n }\n\n return {\n photo: photoSizeMax,\n video: videoSizeMax,\n file: fileSizeMax\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AppImManager} from '../../lib/appManagers/appImManager';\nimport ButtonIcon from '../buttonIcon';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport {IS_APPLE, IS_MOBILE} from '../../environment/userAgent';\nimport appNavigationController from '../appNavigationController';\nimport {_i18n} from '../../lib/langPack';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport isSelectionEmpty from '../../helpers/dom/isSelectionEmpty';\nimport {MarkdownType} from '../../helpers/dom/getRichElementValue';\nimport getVisibleRect from '../../helpers/dom/getVisibleRect';\nimport clamp from '../../helpers/number/clamp';\nimport matchUrl from '../../lib/richTextProcessor/matchUrl';\nimport matchUrlProtocol from '../../lib/richTextProcessor/matchUrlProtocol';\nimport hasMarkupInSelection from '../../helpers/dom/hasMarkupInSelection';\n\nexport default class MarkupTooltip {\n public container: HTMLElement;\n private wrapper: HTMLElement;\n private buttons: {[type in MarkdownType]: HTMLElement} = {} as any;\n private linkBackButton: HTMLElement;\n private linkApplyButton: HTMLButtonElement;\n private hideTimeout: number;\n private addedListener = false;\n private waitingForMouseUp = false;\n private linkInput: HTMLInputElement;\n private savedRange: Range;\n private mouseUpCounter: number = 0;\n // private log: ReturnType;\n\n constructor(private appImManager: AppImManager) {\n // this.log = logger('MARKUP');\n }\n\n private init() {\n this.container = document.createElement('div');\n this.container.classList.add('markup-tooltip', 'z-depth-1', 'hide');\n\n this.wrapper = document.createElement('div');\n this.wrapper.classList.add('markup-tooltip-wrapper');\n\n const tools1 = document.createElement('div');\n const tools2 = document.createElement('div');\n tools1.classList.add('markup-tooltip-tools');\n tools2.classList.add('markup-tooltip-tools');\n\n const arr = ['bold', 'italic', 'underline', 'strikethrough', 'monospace', 'spoiler', 'link'] as (keyof MarkupTooltip['buttons'])[];\n arr.forEach((c) => {\n const button = ButtonIcon(c, {noRipple: true});\n tools1.append(this.buttons[c] = button);\n\n if(c !== 'link') {\n button.addEventListener('mousedown', (e) => {\n cancelEvent(e);\n this.appImManager.chat.input.applyMarkdown(c);\n this.cancelClosening();\n\n /* this.mouseUpCounter = 0;\n this.setMouseUpEvent(); */\n // this.hide();\n });\n } else {\n attachClickEvent(button, (e) => {\n cancelEvent(e);\n this.showLinkEditor();\n this.cancelClosening();\n });\n }\n });\n\n this.linkBackButton = ButtonIcon('left', {noRipple: true});\n this.linkInput = document.createElement('input');\n _i18n(this.linkInput, 'MarkupTooltip.LinkPlaceholder', undefined, 'placeholder');\n this.linkInput.classList.add('input-clear');\n this.linkInput.addEventListener('keydown', (e) => {\n const valid = !this.linkInput.value.length || !!matchUrl(this.linkInput.value);// /^(http)|(https):\\/\\//i.test(this.linkInput.value);\n\n if(e.key === 'Enter') {\n if(!valid) {\n if(this.linkInput.classList.contains('error')) {\n this.linkInput.classList.remove('error');\n void this.linkInput.offsetLeft; // reflow\n }\n\n this.linkInput.classList.add('error');\n } else {\n this.applyLink(e);\n }\n }\n });\n\n this.linkInput.addEventListener('input', (e) => {\n const valid = this.isLinkValid();\n\n this.linkInput.classList.toggle('is-valid', valid);\n this.linkInput.classList.remove('error');\n });\n\n this.linkBackButton.addEventListener('mousedown', (e) => {\n // this.log('linkBackButton click');\n cancelEvent(e);\n this.container.classList.remove('is-link');\n // input.value = '';\n this.resetSelection();\n this.setTooltipPosition();\n this.cancelClosening();\n });\n\n this.linkApplyButton = ButtonIcon('check markup-tooltip-link-apply', {noRipple: true});\n this.linkApplyButton.addEventListener('mousedown', (e) => {\n // this.log('linkApplyButton click');\n this.applyLink(e);\n });\n\n const applyDiv = document.createElement('div');\n applyDiv.classList.add('markup-tooltip-link-apply-container');\n\n const delimiter1 = document.createElement('span');\n const delimiter2 = document.createElement('span');\n const delimiter3 = document.createElement('span');\n delimiter1.classList.add('markup-tooltip-delimiter');\n delimiter2.classList.add('markup-tooltip-delimiter');\n delimiter3.classList.add('markup-tooltip-delimiter');\n tools1.insertBefore(delimiter1, this.buttons.link);\n applyDiv.append(delimiter3, this.linkApplyButton);\n tools2.append(this.linkBackButton, delimiter2, this.linkInput, applyDiv);\n // tools1.insertBefore(delimiter2, this.buttons.link.nextSibling);\n\n this.wrapper.append(tools1, tools2);\n this.container.append(this.wrapper);\n document.body.append(this.container);\n\n window.addEventListener('resize', () => {\n this.hide();\n });\n }\n\n public showLinkEditor() {\n if(!this.container || !this.container.classList.contains('is-visible')) { // * if not inited yet (Ctrl+A + Ctrl+K)\n this.show();\n }\n\n const button = this.buttons.link;\n this.container.classList.add('is-link');\n\n const selection = document.getSelection();\n this.savedRange = selection.getRangeAt(0);\n\n if(button.classList.contains('active')) {\n const startContainer = this.savedRange.startContainer;\n const anchor = startContainer.parentElement as HTMLAnchorElement;\n this.linkInput.value = anchor.href;\n } else {\n this.linkInput.value = '';\n }\n\n this.setTooltipPosition(true);\n\n setTimeout(() => {\n this.linkInput.focus(); // !!! instant focus will break animation\n }, 200);\n this.linkInput.classList.toggle('is-valid', this.isLinkValid());\n }\n\n private applyLink(e: Event) {\n cancelEvent(e);\n this.resetSelection();\n let url = this.linkInput.value;\n if(url && !matchUrlProtocol(url)) {\n url = 'https://' + url;\n }\n this.appImManager.chat.input.applyMarkdown('link', url);\n setTimeout(() => {\n this.hide();\n }, 0);\n }\n\n private isLinkValid() {\n return !this.linkInput.value.length || !!matchUrl(this.linkInput.value);\n }\n\n private resetSelection(range: Range = this.savedRange) {\n const selection = window.getSelection();\n selection.removeAllRanges();\n selection.addRange(range);\n this.appImManager.chat.input.messageInput.focus();\n }\n\n public hide() {\n // return;\n\n if(this.init) return;\n\n this.container.classList.remove('is-visible');\n // document.removeEventListener('mouseup', this.onMouseUp);\n document.removeEventListener('mouseup', this.onMouseUpSingle);\n this.waitingForMouseUp = false;\n\n appNavigationController.removeByType('markup');\n\n if(this.hideTimeout) clearTimeout(this.hideTimeout);\n this.hideTimeout = window.setTimeout(() => {\n this.hideTimeout = undefined;\n this.container.classList.add('hide');\n this.container.classList.remove('is-link');\n }, 200);\n }\n\n public getActiveMarkupButton() {\n const currentMarkups: Set = new Set();\n\n // const nodes = getSelectedNodes();\n // const parents = [...new Set(nodes.map((node) => node.parentNode))];\n // // if(parents.length > 1 && parents) return [];\n\n // (parents as HTMLElement[]).forEach((node) => {\n // for(const type in markdownTags) {\n // const tag = markdownTags[type as MarkdownType];\n // const closest = node.closest(tag.match + ', [contenteditable=\"true\"]');\n // if(closest !== this.appImManager.chat.input.messageInput) {\n // currentMarkups.add(this.buttons[type as MarkdownType]);\n // }\n // }\n // });\n\n const types = Object.keys(this.buttons) as MarkdownType[];\n const markup = hasMarkupInSelection(types);\n types.forEach((type) => {\n if(markup[type]) {\n currentMarkups.add(this.buttons[type as MarkdownType]);\n }\n });\n\n return [...currentMarkups];\n }\n\n public setActiveMarkupButton() {\n const activeButtons = this.getActiveMarkupButton();\n\n for(const i in this.buttons) {\n // @ts-ignore\n const button = this.buttons[i];\n button.classList.toggle('active', activeButtons.includes(button));\n }\n }\n\n private setTooltipPosition(isLinkToggle = false) {\n const selection = document.getSelection();\n const range = selection.getRangeAt(0);\n\n const bodyRect = document.body.getBoundingClientRect();\n const selectionRect = range.getBoundingClientRect();\n const inputRect = this.appImManager.chat.input.rowsWrapper.getBoundingClientRect();\n\n this.container.style.maxWidth = inputRect.width + 'px';\n\n const visibleRect = getVisibleRect(undefined, this.appImManager.chat.input.messageInput, false, selectionRect);\n\n const selectionTop = visibleRect.rect.top/* selectionRect.top */ + (bodyRect.top * -1);\n\n const currentTools = this.container.classList.contains('is-link') ? this.wrapper.lastElementChild : this.wrapper.firstElementChild;\n\n const sizesRect = currentTools.getBoundingClientRect();\n const top = selectionTop - sizesRect.height - 8;\n\n const minX = inputRect.left;\n const maxX = (inputRect.left + inputRect.width) - Math.min(inputRect.width, sizesRect.width);\n let left: number;\n if(isLinkToggle) {\n const containerRect = this.container.getBoundingClientRect();\n left = clamp(containerRect.left, minX, maxX);\n } else {\n const x = selectionRect.left + (selectionRect.width - sizesRect.width) / 2;\n left = clamp(x, minX, maxX);\n }\n\n /* const isClamped = x !== minX && x !== maxX && (left === minX || left === maxX || this.container.getBoundingClientRect().left >= maxX);\n\n if(isLinkToggle && this.container.classList.contains('is-link') && !isClamped) return; */\n\n this.container.style.transform = `translate3d(${left}px, ${top}px, 0)`;\n }\n\n public show() {\n if(this.init) {\n this.init();\n this.init = null;\n }\n\n if(isSelectionEmpty()) {\n this.hide();\n return;\n }\n\n if(this.hideTimeout !== undefined) {\n clearTimeout(this.hideTimeout);\n }\n\n if(this.container.classList.contains('is-visible')) {\n return;\n }\n\n this.setActiveMarkupButton();\n\n this.container.classList.remove('is-link');\n const isFirstShow = this.container.classList.contains('hide');\n if(isFirstShow) {\n this.container.classList.remove('hide');\n this.container.classList.add('no-transition');\n }\n\n this.setTooltipPosition();\n\n if(isFirstShow) {\n void this.container.offsetLeft; // reflow\n this.container.classList.remove('no-transition');\n }\n\n this.container.classList.add('is-visible');\n\n if(!IS_MOBILE) {\n appNavigationController.pushItem({\n type: 'markup',\n onPop: () => {\n this.hide();\n }\n });\n }\n\n // this.log('selection', selectionRect, activeButton);\n }\n\n /* private onMouseUp = (e: Event) => {\n this.log('onMouseUp');\n if(findUpClassName(e.target, 'markup-tooltip')) return;\n\n this.hide();\n //document.removeEventListener('mouseup', this.onMouseUp);\n }; */\n\n private onMouseUpSingle = (e?: Event) => {\n // this.log('onMouseUpSingle');\n this.waitingForMouseUp = false;\n\n if(IS_TOUCH_SUPPORTED) {\n e && cancelEvent(e);\n if(this.mouseUpCounter++ === 0) {\n this.resetSelection(this.savedRange);\n } else {\n this.hide();\n return;\n }\n }\n\n this.show();\n\n /* !isTouchSupported && document.addEventListener('mouseup', this.onMouseUp); */\n };\n\n public setMouseUpEvent() {\n if(this.waitingForMouseUp) return;\n this.waitingForMouseUp = true;\n\n // this.log('setMouseUpEvent');\n\n document.addEventListener('mouseup', this.onMouseUpSingle, {once: true});\n }\n\n public cancelClosening() {\n if(IS_TOUCH_SUPPORTED && !IS_APPLE) {\n document.removeEventListener('mouseup', this.onMouseUpSingle);\n document.addEventListener('mouseup', (e) => {\n cancelEvent(e);\n this.mouseUpCounter = 1;\n this.waitingForMouseUp = false;\n this.setMouseUpEvent();\n }, {once: true});\n }\n }\n\n public handleSelection() {\n if(this.addedListener) return;\n this.addedListener = true;\n document.addEventListener('selectionchange', (e) => {\n // this.log('selectionchange');\n\n if(document.activeElement === this.linkInput) {\n return;\n }\n\n const messageInput = this.appImManager.chat.input.messageInput;\n if(document.activeElement !== messageInput) {\n this.hide();\n return;\n }\n\n const selection = document.getSelection();\n if(isSelectionEmpty(selection)) {\n this.hide();\n return;\n }\n\n if(IS_TOUCH_SUPPORTED) {\n if(IS_APPLE) {\n this.show();\n this.setTooltipPosition(); // * because can skip this in .show();\n } else {\n if(this.mouseUpCounter === 2) {\n this.mouseUpCounter = 0;\n return;\n }\n\n this.savedRange = selection.getRangeAt(0);\n this.setMouseUpEvent();\n /* document.addEventListener('touchend', (e) => {\n cancelEvent(e);\n this.resetSelection(range);\n this.show();\n }, {once: true, passive: false}); */\n }\n } else if(this.container && this.container.classList.contains('is-visible')) {\n this.setActiveMarkupButton();\n this.setTooltipPosition();\n } else if(messageInput.matches(':active')) {\n this.setMouseUpEvent();\n } else {\n this.show();\n }\n });\n\n document.addEventListener('beforeinput', (e) => {\n if(e.inputType === 'historyRedo' || e.inputType === 'historyUndo') {\n e.target.addEventListener('input', () => this.setActiveMarkupButton(), {once: true});\n }\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport generatePathData from '../../helpers/generatePathData';\nimport {FormatterArguments, i18n, LangPackKey} from '../../lib/langPack';\n\nexport default class ChatDragAndDrop {\n container: HTMLDivElement;\n svg: SVGSVGElement;\n outlineWrapper: HTMLDivElement;\n path: SVGPathElement;\n\n constructor(appendTo: HTMLElement, private options: {\n icon?: string,\n header: LangPackKey,\n headerArgs?: FormatterArguments,\n subtitle?: LangPackKey,\n onDrop: (e: DragEvent) => void\n }) {\n this.container = document.createElement('div');\n this.container.classList.add('drop', 'z-depth-1');\n\n this.outlineWrapper = document.createElement('div');\n this.outlineWrapper.classList.add('drop-outline-wrapper');\n\n this.svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n this.svg.classList.add('drop-outline');\n\n this.path = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n this.path.classList.add('drop-outline-path');\n\n let dropIcon: HTMLElement;\n if(options.icon) {\n dropIcon = document.createElement('div');\n dropIcon.classList.add('drop-icon', 'tgico-' + options.icon);\n }\n\n const dropHeader = document.createElement('div');\n dropHeader.classList.add('drop-header');\n dropHeader.append(i18n(options.header, options.headerArgs));\n\n let dropSubtitle: HTMLElement;\n if(options.subtitle) {\n dropSubtitle = document.createElement('div');\n dropSubtitle.classList.add('drop-subtitle');\n dropSubtitle.append(i18n(options.subtitle));\n }\n\n this.svg.append(this.path);\n this.outlineWrapper.append(this.svg);\n\n this.container.append(...[this.outlineWrapper, dropIcon, dropHeader, dropSubtitle].filter(Boolean));\n appendTo.append(this.container);\n\n this.container.addEventListener('dragover', this.onDragOver);\n this.container.addEventListener('dragleave', this.onDragLeave);\n this.container.addEventListener('drop', this.onDrop);\n }\n\n onDragOver = (e: DragEvent) => {\n this.container.classList.add('is-dragover');\n // SetTransition(this.container, 'is-dragover', true, 500);\n };\n\n onDragLeave = (e: DragEvent) => {\n this.container.classList.remove('is-dragover');\n // SetTransition(this.container, 'is-dragover', false, 500);\n };\n\n onDrop = (e: DragEvent) => {\n this.options.onDrop(e);\n };\n\n destroy() {\n delete this.options;\n this.container.remove();\n this.container.removeEventListener('dragover', this.onDragOver);\n this.container.removeEventListener('dragleave', this.onDragLeave);\n this.container.removeEventListener('drop', this.onDrop);\n }\n\n setPath() {\n const rect = this.outlineWrapper.getBoundingClientRect();\n this.svg.setAttributeNS(null, 'preserveAspectRatio', 'none');\n this.svg.setAttributeNS(null, 'viewBox', `0 0 ${rect.width} ${rect.height}`);\n this.svg.setAttributeNS(null, 'width', `${rect.width}`);\n this.svg.setAttributeNS(null, 'height', `${rect.height}`);\n\n const radius = 10;\n // const strokeWidth = 2;\n const sizeX = rect.width - radius;\n const sizeY = rect.height - radius;\n const pos = radius / 2;\n const d = generatePathData(pos, pos, sizeX, sizeY, radius, radius, radius, radius);\n this.path.setAttributeNS(null, 'd', d);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {doubleRaf} from '../schedulers';\n\nexport default function disableTransition(elements: HTMLElement[]) {\n elements.forEach((el) => el.classList.add('no-transition'));\n\n doubleRaf().then(() => {\n elements.forEach((el) => el.classList.remove('no-transition'));\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nexport const MAX_SPEED = 8.2;\nexport const MIN_SPEED = 0.8;\n\n// import { MIN_SPEED, MAX_SPEED } from './BlobDrawable';\n\ntype Radius = number[];\n\nexport default class LineBlobDrawable {\n public maxRadius: number;\n public minRadius: number;\n private N: number;\n private radius: Radius;\n private radiusNext: Radius;\n private progress: number[];\n private speed: number[];\n\n constructor(n: number) {\n this.maxRadius = 10;\n this.minRadius = 0;\n\n this.N = n;\n this.radius = new Array(n + 1);\n\n this.radiusNext = new Array(n + 1);\n this.progress = new Array(n + 1);\n this.speed = new Array(n + 1);\n\n for(let i = 0; i <= n; i++) {\n this.generateBlob(this.radius, i);\n this.generateBlob(this.radiusNext, i);\n this.progress[i] = 0;\n }\n }\n\n private generateBlob(radius: Radius, i: number) {\n const {maxRadius, minRadius, speed} = this;\n\n const radDif = maxRadius - minRadius;\n radius[i] = minRadius + Math.random() * radDif;\n speed[i] = 0.017 + 0.003 * Math.random();\n }\n\n private generateNextBlob() {\n const {radius, radiusNext, progress, N} = this;\n for(let i = 0; i < N; i++) {\n this.generateBlob(radius, i);\n this.generateBlob(radiusNext, i);\n progress[i] = 0.0;\n }\n }\n\n public update(amplitude: number, speedScale: number) {\n const {N, progress, speed, radius, radiusNext} = this;\n for(let i = 0; i <= N; i++) {\n progress[i] += (speed[i] * MIN_SPEED) + amplitude * speed[i] * MAX_SPEED * speedScale;\n if(progress[i] >= 1.0) {\n progress[i] = 0.0;\n radius[i] = radiusNext[i];\n this.generateBlob(radiusNext, i);\n }\n }\n }\n\n public draw(left: number, top: number, right: number, bottom: number, canvas: HTMLCanvasElement, paint: (ctx: CanvasRenderingContext2D) => void, pinnedTop: number, progressToPinned: number) {\n if(canvas.getContext) {\n const ctx = canvas.getContext('2d');\n // ctx.globalAlpha = 0.5;\n // ctx.lineWidth = 1;\n\n ctx.beginPath();\n ctx.moveTo(right, bottom);\n ctx.lineTo(left, bottom);\n\n const {radius, radiusNext, N} = this;\n for(let i = 0; i <= N; i++) {\n if(i === 0) {\n const progress = this.progress[i];\n const r1 = radius[i] * (1.0 - progress) + radiusNext[i] * progress;\n const y = (top - r1) * progressToPinned + pinnedTop * (1.0 - progressToPinned);\n ctx.lineTo(left, y);\n } else {\n const progress = this.progress[i - 1];\n const r1 = radius[i - 1] * (1.0 - progress) + radiusNext[i - 1] * progress;\n const progressNext = this.progress[i];\n const r2 = radius[i] * (1.0 - progressNext) + radiusNext[i] * progressNext;\n const x1 = (right - left) / N * (i - 1);\n const x2 = (right - left) / N * i;\n const cx = x1 + (x2 - x1) / 2;\n\n const y1 = (top - r1) * progressToPinned + pinnedTop * (1.0 - progressToPinned);\n const y2 = (top - r2) * progressToPinned + pinnedTop * (1.0 - progressToPinned);\n ctx.bezierCurveTo(cx, y1, cx, y2, x2, y2);\n if(i === N) {\n ctx.lineTo(right, bottom);\n }\n }\n }\n\n // ctx.scale(1.0, 1.0);\n paint(ctx);\n ctx.fill();\n ctx.closePath();\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport GROUP_CALL_STATE from '../lib/calls/groupCallState';\nimport LineBlobDrawable from './lineBlobDrawable';\n\nexport class WeavingState {\n public shader: (ctx: CanvasRenderingContext2D, left: number, top: number, right: number, bottom: number) => void;\n\n constructor(public stateId: GROUP_CALL_STATE) {\n this.createGradient(stateId);\n }\n\n public createGradient(stateId: GROUP_CALL_STATE) {\n this.shader = (ctx, left, top, right, bottom) => {\n ctx.fillStyle = WeavingState.getGradientFromType(ctx, stateId, left, top, right, bottom);\n };\n }\n\n // Android colors\n static getGradientFromType(ctx: CanvasRenderingContext2D, type: GROUP_CALL_STATE, x0: number, y0: number, x1: number, y1: number) {\n const gradient = ctx.createLinearGradient(x0, y0, x1, y1);\n if(type === GROUP_CALL_STATE.MUTED_BY_ADMIN) {\n gradient.addColorStop(0, '#F05459');\n gradient.addColorStop(.4, '#766EE9');\n gradient.addColorStop(1, '#57A4FE');\n } else if(type === GROUP_CALL_STATE.UNMUTED) {\n gradient.addColorStop(0, '#52CE5D');\n gradient.addColorStop(1, '#00B1C0');\n } else if(type === GROUP_CALL_STATE.MUTED) {\n gradient.addColorStop(0, '#0976E3');\n gradient.addColorStop(1, '#2BCEFF');\n } else if(type === GROUP_CALL_STATE.CONNECTING) {\n gradient.addColorStop(0, '#8599aa');\n gradient.addColorStop(1, '#8599aa');\n }\n\n return gradient;\n }\n\n update(height: number, width: number, dt: number, amplitude: number) {\n // TODO: move gradient here\n }\n}\n\nexport default class TopbarWeave {\n private focused: boolean;\n private resizing: boolean;\n private lastUpdateTime: number;\n private amplitude: number;\n private amplitude2: number;\n\n private states: Map;\n private previousState: WeavingState;\n private currentState: WeavingState;\n private progressToState: number;\n\n private scale: number;\n private left: number;\n private top: number;\n private right: number;\n private bottom: number;\n\n private mounted: boolean;\n private media: MediaQueryList;\n\n private container: HTMLDivElement;\n private canvas: HTMLCanvasElement;\n\n private resizeHandler: number;\n private raf: number;\n\n private lbd: LineBlobDrawable;\n private lbd1: LineBlobDrawable;\n private lbd2: LineBlobDrawable;\n\n private animateToAmplitude: number;\n private animateAmplitudeDiff: number;\n private animateAmplitudeDiff2: number;\n\n constructor() {\n this.focused = true;\n this.resizing = false;\n this.lastUpdateTime = Date.now();\n this.amplitude = 0.0;\n this.amplitude2 = 0.0;\n\n this.states = new Map([\n [GROUP_CALL_STATE.UNMUTED, new WeavingState(GROUP_CALL_STATE.UNMUTED)],\n [GROUP_CALL_STATE.MUTED, new WeavingState(GROUP_CALL_STATE.MUTED)],\n [GROUP_CALL_STATE.MUTED_BY_ADMIN, new WeavingState(GROUP_CALL_STATE.MUTED_BY_ADMIN)],\n [GROUP_CALL_STATE.CONNECTING, new WeavingState(GROUP_CALL_STATE.CONNECTING)]\n ]);\n this.previousState = null;\n this.currentState = this.states.get(GROUP_CALL_STATE.CONNECTING);\n this.progressToState = 1.0;\n }\n\n public componentDidMount() {\n if(this.mounted) {\n return;\n }\n\n this.mounted = true;\n // window.addEventListener('blur', this.handleBlur);\n // window.addEventListener('focus', this.handleFocus);\n window.addEventListener('resize', this.handleResize);\n this.media = window.matchMedia('screen and (min-resolution: 2dppx)');\n this.media.addEventListener('change', this.handleDevicePixelRatioChanged);\n\n this.setSize();\n this.forceUpdate();\n\n this.lbd = new LineBlobDrawable(3);\n this.lbd1 = new LineBlobDrawable(7);\n this.lbd2 = new LineBlobDrawable(8);\n this.setAmplitude(this.amplitude);\n\n this.draw();\n }\n\n public componentWillUnmount() {\n this.mounted = false;\n // window.removeEventListener('blur', this.handleBlur);\n // window.removeEventListener('focus', this.handleFocus);\n window.removeEventListener('resize', this.handleResize);\n this.media.addEventListener('change', this.handleDevicePixelRatioChanged);\n\n const {canvas} = this;\n const ctx = canvas.getContext('2d');\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n }\n\n private setSize() {\n this.scale = window.devicePixelRatio;\n this.top = 20 * this.scale;\n this.right = (this.mounted ? this.container.offsetWidth : 1261) * this.scale;\n this.bottom = (this.mounted ? this.container.offsetHeight : 68) * this.scale;\n this.left = 0 * this.scale;\n this.setCanvasSize();\n }\n\n private setCanvasSize() {\n this.canvas.width = this.right;\n this.canvas.height = this.bottom;\n }\n\n private handleDevicePixelRatioChanged = (e: Event) => {\n this.setSize();\n this.forceUpdate();\n }\n\n private handleResize = () => {\n if(this.resizeHandler) {\n clearTimeout(this.resizeHandler);\n this.resizeHandler = null;\n }\n\n this.resizing = true;\n this.resizeCanvas();\n this.resizeHandler = window.setTimeout(() => {\n this.resizing = false;\n this.invokeDraw();\n }, 250);\n }\n\n private resizeCanvas() {\n this.scale = window.devicePixelRatio;\n this.right = this.container.offsetWidth * this.scale;\n\n this.forceUpdate();\n this.invokeDraw();\n }\n\n public handleFocus = () => {\n this.focused = true;\n this.invokeDraw();\n }\n\n public handleBlur = () => {\n this.focused = false;\n }\n\n private invokeDraw = () => {\n if(this.raf) return;\n\n this.draw();\n }\n\n private draw = (force = false) => {\n this.raf = null;\n if(!this.mounted) {\n return;\n }\n const {lbd, lbd1, lbd2, scale, left, top, right, bottom, currentState, previousState, focused, resizing, canvas} = this;\n if(!focused && !resizing && this.progressToState >= 1.0) {\n return;\n }\n\n // console.log('[top] draw', [focused, resizing, this.mounted]);\n\n const newTime = Date.now();\n let dt = (newTime - this.lastUpdateTime);\n if(dt > 20) {\n dt = 17;\n }\n\n // console.log('draw start', this.amplitude, this.animateToAmplitude);\n if(this.animateToAmplitude !== this.amplitude) {\n this.amplitude += this.animateAmplitudeDiff * dt;\n if(this.animateAmplitudeDiff > 0) {\n if(this.amplitude > this.animateToAmplitude) {\n this.amplitude = this.animateToAmplitude;\n }\n } else {\n if(this.amplitude < this.animateToAmplitude) {\n this.amplitude = this.animateToAmplitude;\n }\n }\n }\n\n if(this.animateToAmplitude !== this.amplitude2) {\n this.amplitude2 += this.animateAmplitudeDiff2 * dt;\n if(this.animateAmplitudeDiff2 > 0) {\n if(this.amplitude2 > this.animateToAmplitude) {\n this.amplitude2 = this.animateToAmplitude;\n }\n } else {\n if(this.amplitude2 < this.animateToAmplitude) {\n this.amplitude2 = this.animateToAmplitude;\n }\n }\n }\n\n if(previousState) {\n this.progressToState += dt / 250;\n if(this.progressToState > 1) {\n this.progressToState = 1;\n this.previousState = null;\n }\n }\n\n const {amplitude, amplitude2, progressToState} = this;\n\n const top1 = 6 * amplitude2 * scale;\n const top2 = 6 * amplitude2 * scale;\n\n const ctx = canvas.getContext('2d');\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n lbd.minRadius = 0;\n lbd.maxRadius = (2 + 2 * amplitude) * scale;\n lbd1.minRadius = 0;\n lbd1.maxRadius = (3 + 9 * amplitude) * scale;\n lbd2.minRadius = 0;\n lbd2.maxRadius = (3 + 9 * amplitude) * scale;\n\n lbd.update(amplitude, 0.3);\n lbd1.update(amplitude, 0.7);\n lbd2.update(amplitude, 0.7);\n\n for(let i = 0; i < 2; i++) {\n if(i === 0 && !previousState) {\n continue;\n }\n\n let alpha = 1;\n let state: WeavingState = null;\n if(i === 0) {\n alpha = 1 - progressToState;\n state = previousState;\n // previousState.setToPaint(paint);\n } else {\n alpha = previousState ? progressToState : 1;\n currentState.update(bottom - top, right - left, dt, amplitude);\n state = currentState;\n // currentState.setToPaint(paint);\n }\n\n const paint1 = (ctx: CanvasRenderingContext2D) => {\n ctx.globalAlpha = 0.3 * alpha;\n state.shader(ctx, left, top, right, bottom);\n };\n const paint = (ctx: CanvasRenderingContext2D) => {\n ctx.globalAlpha = i === 0 ? 1 : alpha;\n state.shader(ctx, left, top, right, bottom);\n };\n\n lbd1.draw(left, top - top1, right, bottom, canvas, paint1, top, 1.0);\n lbd2.draw(left, top - top2, right, bottom, canvas, paint1, top, 1.0);\n lbd.draw(left, top, right, bottom, canvas, paint, top, 1.0);\n }\n\n if(!force) {\n this.raf = requestAnimationFrame(() => this.draw());\n }\n };\n\n public setCurrentState = (stateId: GROUP_CALL_STATE, animated: boolean) => {\n const {currentState, states} = this;\n\n if(currentState?.stateId === stateId) {\n return;\n }\n\n this.previousState = animated ? currentState : null;\n this.currentState = states.get(stateId);\n this.progressToState = this.previousState ? 0.0 : 1.0;\n };\n\n public setAmplitude(value: number) {\n const {amplitude} = this;\n this.animateToAmplitude = value;\n this.animateAmplitudeDiff = (value - amplitude) / 250;\n this.animateAmplitudeDiff2 = (value - amplitude) / 120;\n }\n\n private forceUpdate() {\n this.setCanvasSize();\n }\n\n public render(className: string) {\n const container = this.container = document.createElement('div');\n container.classList.add(className);\n\n const canvas = this.canvas = document.createElement('canvas');\n canvas.classList.add(className + '-canvas');\n\n container.append(canvas);\n\n return container;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport liteMode from '../../helpers/liteMode';\nimport noop from '../../helpers/noop';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport rootScope from '../rootScope';\nimport lottieLoader, {LottieAssetName} from './lottieLoader';\nimport type RLottiePlayer from './rlottiePlayer';\nimport {RLottieColor} from './rlottiePlayer';\n\nexport type RLottieIconOptions = {\n width: number,\n height: number,\n container?: HTMLElement,\n skipAnimation?: boolean\n};\n\nexport type RLottieIconItemPartOptions = {\n startFrame: number,\n endFrame: number,\n name?: string\n};\n\nexport type RLottieIconItemOptions = {\n name: LottieAssetName,\n parts: RLottieIconItemPartOptions[],\n initFrame?: number,\n player?: RLottiePlayer,\n autoplay?: boolean,\n color?: RLottieColor,\n inverseColor?: RLottieColor,\n};\n\nexport class RLottieIconItemPart implements RLottieIconItemPartOptions {\n public startFrame: number;\n public endFrame: number;\n public name?: string;\n\n constructor(public item: RLottieIconItem, options: RLottieIconItemPartOptions) {\n safeAssign(this, options);\n }\n\n public play(callback?: () => void) {\n return this.item.playPart(this, callback);\n }\n}\n\n// export type RLottieIconItemPart = RLottieIconItemPartOptions;\n\nexport class RLottieIconItem implements RLottieIconItemOptions {\n public name: LottieAssetName;\n public parts: RLottieIconItemPart[];\n public player: RLottiePlayer;\n public initFrame: number;\n public autoplay: boolean;\n public color: RLottieColor;\n public inverseColor: RLottieColor;\n public loadPromise: Promise;\n public onLoadForPart: () => void;\n public onLoadForColor: () => void;\n\n constructor(public icon: RLottieIcon, options: RLottieIconItemOptions) {\n this.autoplay = false;\n\n safeAssign(this, options);\n\n this.parts = this.parts.map((options) => this.createPart(options));\n }\n\n public load() {\n let loadPromise = this.loadPromise;\n if(loadPromise) {\n return loadPromise;\n }\n\n const {container, canvas, width, height} = this.icon;\n loadPromise = lottieLoader.loadAnimationAsAsset({\n container,\n canvas,\n width,\n height,\n group: 'none',\n loop: false,\n autoplay: this.autoplay ?? false,\n initFrame: this.initFrame,\n skipFirstFrameRendering: this.initFrame === undefined,\n color: this.color,\n inverseColor: this.inverseColor\n }, this.name).then((player) => {\n return lottieLoader.waitForFirstFrame(player);\n }).then((player) => {\n this.player = player;\n\n if(this.onLoadForColor) {\n this.onLoadForColor();\n this.onLoadForColor = undefined;\n }\n\n if(this.onLoadForPart) {\n this.onLoadForPart();\n this.onLoadForPart = undefined;\n }\n });\n\n this.loadPromise = loadPromise;\n this.icon.loadPromises.set(this.name, loadPromise);\n return loadPromise;\n }\n\n public createPart(options: RLottieIconItemPartOptions) {\n return new RLottieIconItemPart(this, options);\n }\n\n public getPart(index: string | number | RLottieIconItemPart) {\n if(index instanceof RLottieIconItemPart) return index;\n else if(typeof(index) === 'string') return this.parts.find((part) => part.name === index);\n else return this.parts[index];\n }\n\n public playPart(part: RLottieIconItemPart, callback?: () => void) {\n return this.icon.playPart(this, part, callback);\n }\n}\n\nexport default class RLottieIcon {\n public container: HTMLElement;\n public canvas: HTMLCanvasElement;\n public width: number;\n public height: number;\n\n protected items: Map;\n public loadPromises: Map>;\n\n protected skipAnimation: boolean;\n\n constructor(options: RLottieIconOptions) {\n safeAssign(this, options);\n\n if(!this.container) this.container = document.createElement('div');\n this.container.classList.add('rlottie-icon');\n\n const {width, height} = this;\n this.container.style.width = width + 'px';\n this.container.style.height = height + 'px';\n\n const canvas = this.canvas = document.createElement('canvas');\n canvas.classList.add('rlottie');\n canvas.width = width;\n canvas.height = height;\n\n this.items = new Map();\n this.loadPromises = new Map();\n }\n\n public get loadPromise() {\n return Promise.all([...this.loadPromises.values()]).then(noop);\n }\n\n public getItem(name?: LottieAssetName): RLottieIconItem {\n return !name && this.items.size === 1 ? this.items.values().next().value : this.items.get(name);\n }\n\n public add(options: Omit) {\n const item = new RLottieIconItem(this, options);\n this.items.set(options.name, item);\n\n return item;\n }\n\n public playPart(item: RLottieIconItem, index: Parameters[0], callback?: () => void) {\n if(!item.player) {\n item.onLoadForPart = () => {\n this.playPart(item, index, callback);\n };\n\n return;\n }\n\n const part = item.getPart(index);\n item.player.playPart({\n from: liteMode.isAvailable('animations') && !this.skipAnimation ? part.startFrame : part.endFrame,\n to: part.endFrame,\n callback\n });\n }\n\n /* public playToPart(item: RLottieIconItem, index: Parameters[0], toEnd: boolean) {\n if(!item.player) return;\n const part = item.getPart(index);\n const toFrame = toEnd ? part.endFrame : part.startFrame;\n item.player.playToFrame({\n frame: toFrame\n });\n } */\n\n public static generateEqualParts(length: number, frameCount: number): RLottieIconItemPartOptions[] {\n return new Array(length).fill(0).map((_, idx) => {\n const startFrame = idx * frameCount;\n return {startFrame, endFrame: startFrame + frameCount - 1};\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport noop from '../helpers/noop';\nimport safeAssign from '../helpers/object/safeAssign';\nimport {LottieAssetName} from '../lib/rlottie/lottieLoader';\nimport RLottieIcon, {RLottieIconItemPartOptions, RLottieIconItemPart} from '../lib/rlottie/rlottieIcon';\nimport {RLottieColor} from '../lib/rlottie/rlottiePlayer';\n\nexport type SuperRLottieIconAddItemOptions = {name: LottieAssetName, parts: RLottieIconItemPartOptions};\nexport type SuperRLottieIconGetInfoResult = RLottieIconItemPart;\nexport class SuperRLottieIcon extends RLottieIcon {\n protected getPart: (state: Options['PartState'], prevState?: Options['PartState']) => SuperRLottieIconGetInfoResult;\n protected getColor?: (state: Options['ColorState'], prevState?: Options['ColorState']) => RLottieColor;\n\n protected partState: Options['PartState'];\n protected colorState: Options['ColorState'];\n protected loaded: boolean;\n\n constructor(options: {\n width: number,\n height: number,\n skipAnimation?: boolean,\n getPart: (state: Options['PartState'], prevState?: Options['PartState']) => SuperRLottieIconGetInfoResult,\n getColor?: (state: Options['ColorState'], prevState?: Options['ColorState']) => RLottieColor,\n }) {\n super({\n width: options.width,\n height: options.height\n });\n\n safeAssign(this, options);\n\n // hook the first call\n /* const originalFunction = this.setState.bind(this);\n this.setState = (partState, colorState) => {\n this.setState = originalFunction;\n this.load(partState, colorState);\n return originalFunction(partState, colorState);\n }; */\n }\n\n public load(partState: Options['PartState'], colorState?: Options['ColorState']) {\n if(this.loaded) {\n return this.loadPromise;\n }\n\n this.loaded = true;\n this.partState = partState;\n this.colorState = colorState;\n\n const part = this.getPart(partState);\n const color = colorState !== undefined && this.getColor && this.getColor(colorState);\n\n const item = part.item;\n item.initFrame = part.endFrame;\n item.color = color;\n\n const promises = [...this.items.values()].map((item) => item.load());\n return Promise.all(promises).then(noop);\n }\n\n /**\n * Will redirect setting color state to part callback to synchronize the rendering\n */\n public setState(partState: Options['PartState'], colorState?: Options['ColorState'], partCallback?: () => void) {\n if(!this.loaded) this.load(partState, colorState);\n\n let changedPartState = false, changedColorState = false;\n if(partState !== undefined) changedPartState = this.setPartState(partState, colorState, partCallback);\n else if(colorState !== undefined) changedColorState = this.setColorState(colorState);\n\n return changedPartState || changedColorState;\n }\n\n public setPartState(state: Options['PartState'], colorState?: Options['ColorState'], callback?: () => void) {\n const {partState: prevState} = this;\n if(prevState === state) {\n return colorState !== undefined ? this.setColorState(colorState) : false;\n }\n\n if(colorState !== undefined) {\n this.setColorState(colorState, false);\n }\n\n this.partState = state;\n\n const part = this.getPart(state, prevState);\n part.play(callback);\n\n return true;\n }\n\n public setColorState(state: Options['ColorState'], renderIfPaused = true) {\n const {colorState: prevState} = this;\n if(prevState === state || !this.getColor) {\n return false;\n }\n\n this.colorState = state;\n\n const item = this.getItem();\n const color = this.getColor(state, prevState);\n const invoke = () => {\n item.player.setColor(color, renderIfPaused);\n };\n\n if(item.player) {\n invoke();\n } else {\n item.onLoadForColor = invoke;\n }\n\n return true;\n }\n\n public destroy() {\n this.items.forEach((item) => {\n item.loadPromise.then(() => {\n item.player.remove();\n });\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {RLottieIconItemPartOptions} from '../../lib/rlottie/rlottieIcon';\nimport {GROUP_CALL_MICROPHONE_BUTTON_STATE} from '.';\nimport {SuperRLottieIcon} from '../superIcon';\n\nexport default class GroupCallMicrophoneIcon extends SuperRLottieIcon<{\n PartState: GROUP_CALL_MICROPHONE_BUTTON_STATE\n}> {\n constructor() {\n super({\n width: 36,\n height: 36,\n getPart: (state, prevState) => {\n const states = GROUP_CALL_MICROPHONE_BUTTON_STATE;\n let partName: string;\n switch(state) {\n case states.HAND:\n partName = prevState === states.MUTED ? 'muted-to-hand' : 'unmuted-to-hand';\n break;\n case states.MUTED:\n partName = prevState === states.HAND ? 'hand-to-muted' : 'mute';\n break;\n case states.UNMUTED:\n partName = 'unmute';\n break;\n }\n\n return this.getItem().getPart(partName);\n }\n });\n\n const className = 'group-call-microphone-icon';\n this.container.classList.add(className + '-container');\n\n const parts: RLottieIconItemPartOptions[] = [{\n startFrame: 0,\n endFrame: 35,\n name: 'hand-to-muted'\n }, {\n startFrame: 36,\n endFrame: 68,\n name: 'unmute'\n }, {\n startFrame: 69,\n endFrame: 98,\n name: 'mute'\n }, {\n startFrame: 99,\n endFrame: 135,\n name: 'muted-to-hand'\n }, {\n startFrame: 136,\n endFrame: 172,\n name: 'unmuted-to-hand'\n }, {\n startFrame: 173,\n endFrame: 201,\n name: 'scheduled-crossing'\n }, {\n startFrame: 202,\n endFrame: 236,\n name: 'scheduled-to-muted'\n }, {\n startFrame: 237,\n endFrame: 273,\n name: 'scheduled-to-hand'\n }, {\n startFrame: 274,\n endFrame: 310,\n name: 'scheduled-crossed-to-hand'\n }, {\n startFrame: 311,\n endFrame: 343,\n name: 'scheduled-uncrossing'\n }, {\n startFrame: 344,\n endFrame: 375,\n name: 'scheduled-to-muted'\n }, {\n startFrame: 376,\n endFrame: 403,\n name: 'play-to-muted'\n }];\n\n this.add({\n name: 'voip_filled',\n parts\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport RLottieIcon from '../../lib/rlottie/rlottieIcon';\nimport {GROUP_CALL_PARTICIPANT_CLEARED_MUTED_STATE, GROUP_CALL_PARTICIPANT_MUTED_STATE, getColorByMutedState, clearMutedStateModifier} from '.';\nimport {SuperRLottieIcon} from '../superIcon';\n\nexport default class GroupCallParticipantMutedIcon extends SuperRLottieIcon<{\n PartState: GROUP_CALL_PARTICIPANT_CLEARED_MUTED_STATE,\n ColorState: GROUP_CALL_PARTICIPANT_MUTED_STATE\n}> {\n constructor(private colored: boolean) {\n super({\n width: 32,\n height: 32,\n getPart: (state, prevState) => {\n const states = GROUP_CALL_PARTICIPANT_MUTED_STATE;\n\n let index: number;\n switch(state) {\n case states.HAND:\n index = 3;\n break;\n case states.MUTED:\n index = prevState === states.HAND ? 0 : 2;\n break;\n case states.UNMUTED:\n index = 1;\n break;\n }\n\n return this.getItem().getPart(index);\n },\n getColor: colored ? (state, prevState) => {\n return getColorByMutedState(state);\n } : undefined\n });\n\n const className = 'group-call-participant-muted-icon';\n this.container.classList.add(className + '-container');\n\n const parts = RLottieIcon.generateEqualParts(4, 21);\n this.add({\n name: 'voice_outlined2',\n parts\n });\n }\n\n public setState(state: GROUP_CALL_PARTICIPANT_MUTED_STATE) {\n return super.setState(clearMutedStateModifier(state), state);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupElement from '../popups';\nimport {hexToRgb} from '../../helpers/color';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport customProperties from '../../helpers/dom/customProperties';\nimport {GroupCall, GroupCallParticipant} from '../../layer';\nimport type {AppChatsManager} from '../../lib/appManagers/appChatsManager';\nimport type {AppGroupCallsManager} from '../../lib/appManagers/appGroupCallsManager';\nimport type {AppPeersManager} from '../../lib/appManagers/appPeersManager';\nimport GROUP_CALL_STATE from '../../lib/calls/groupCallState';\nimport {RLottieColor} from '../../lib/rlottie/rlottiePlayer';\nimport rootScope from '../../lib/rootScope';\nimport ButtonIcon from '../buttonIcon';\nimport GroupCallMicrophoneIcon from './microphoneIcon';\nimport GroupCallParticipantsElement from './participants';\nimport GroupCallParticipantsVideoElement from './participantVideos';\nimport PopupPeer from '../popups/peer';\nimport GroupCallDescriptionElement from './description';\nimport GroupCallTitleElement from './title';\nimport {addFullScreenListener, cancelFullScreen, isFullScreen, requestFullScreen} from '../../helpers/dom/fullScreen';\nimport Scrollable from '../scrollable';\nimport {MovableState} from '../movableElement';\nimport animationIntersector from '../animationIntersector';\nimport {IS_APPLE_MOBILE} from '../../environment/userAgent';\nimport throttle from '../../helpers/schedulers/throttle';\nimport IS_SCREEN_SHARING_SUPPORTED from '../../environment/screenSharingSupport';\nimport GroupCallInstance from '../../lib/calls/groupCallInstance';\nimport makeButton from '../call/button';\nimport MovablePanel from '../../helpers/movablePanel';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport toggleClassName from '../../helpers/toggleClassName';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport themeController from '../../helpers/themeController';\nimport groupCallsController from '../../lib/calls/groupCallsController';\n\nexport enum GROUP_CALL_PARTICIPANT_MUTED_STATE {\n UNMUTED,\n MUTED,\n MUTED_FOR_ME,\n MUTED_BY_ADMIN,\n HAND\n}\n\nexport type GROUP_CALL_PARTICIPANT_CLEARED_MUTED_STATE = Exclude;\n\nexport function getGroupCallParticipantMutedState(participant: GroupCallParticipant) {\n const states = GROUP_CALL_PARTICIPANT_MUTED_STATE;\n if(participant.pFlags.muted_by_you) {\n return states.MUTED_FOR_ME;\n } else if(participant.raise_hand_rating !== undefined) {\n return states.HAND;\n } else if(participant.pFlags.muted) {\n return participant.pFlags.can_self_unmute ? states.MUTED : states.MUTED_BY_ADMIN;\n } else {\n return states.UNMUTED;\n }\n}\n\nexport function clearMutedStateModifier(state: GROUP_CALL_PARTICIPANT_MUTED_STATE): GROUP_CALL_PARTICIPANT_CLEARED_MUTED_STATE {\n const states = GROUP_CALL_PARTICIPANT_MUTED_STATE;\n switch(state) {\n case states.MUTED_BY_ADMIN:\n case states.MUTED_FOR_ME:\n return states.MUTED;\n default:\n return state;\n }\n}\n\nexport function getColorByMutedState(state: GROUP_CALL_PARTICIPANT_MUTED_STATE) {\n const states = GROUP_CALL_PARTICIPANT_MUTED_STATE;\n let colorStr: 'blue' | 'green' | 'secondary' | 'red';\n switch(state) {\n case states.HAND:\n colorStr = 'blue';\n break;\n case states.MUTED:\n case states.MUTED_FOR_ME:\n case states.MUTED_BY_ADMIN:\n colorStr = state === states.MUTED ? 'secondary' : 'red';\n break;\n case states.UNMUTED:\n colorStr = 'green';\n break;\n }\n\n const propertyValue = customProperties.getProperty('gc-' + colorStr + '-text-color');\n const color: RLottieColor = hexToRgb(propertyValue);\n\n return color;\n}\n\nexport enum GROUP_CALL_MICROPHONE_BUTTON_STATE {\n HAND,\n MUTED,\n UNMUTED,\n}\n\nexport function getGroupCallMicrophoneButtonState(groupCall: GroupCall.groupCall, participant: GroupCallParticipant) {\n const states = GROUP_CALL_MICROPHONE_BUTTON_STATE;\n if(!participant.pFlags.can_self_unmute) {\n return states.HAND;\n } else if(participant.pFlags.muted) {\n return states.MUTED\n } else {\n return states.UNMUTED;\n }\n}\n\nlet previousState: MovableState = {\n width: 420,\n height: 640\n};\n\nconst className = 'group-call';\n\nexport default class PopupGroupCall extends PopupElement {\n private instance: GroupCallInstance;\n private groupCallTitle: GroupCallTitleElement;\n private groupCallDescription: GroupCallDescriptionElement;\n private groupCallBodyHeaderDescription: GroupCallDescriptionElement;\n private groupCallParticipants: GroupCallParticipantsElement;\n private groupCallParticipantsVideo: GroupCallParticipantsVideoElement;\n private groupCallMicrophoneIcon: GroupCallMicrophoneIcon;\n private videosCount: number;\n private btnFullScreen: HTMLButtonElement;\n private btnExitFullScreen: HTMLButtonElement;\n private btnInvite: HTMLButtonElement;\n private btnShowColumn: HTMLButtonElement;\n private movablePanel: MovablePanel;\n private buttonsContainer: HTMLDivElement;\n private btnFullScreen2: HTMLButtonElement;\n private btnVideo: HTMLDivElement;\n private btnScreen: HTMLDivElement;\n\n constructor() {\n super('popup-group-call', {\n body: true,\n withoutOverlay: true,\n closable: true,\n title: true\n });\n\n this.videosCount = 0;\n this.container.classList.add(className, 'night');\n\n const instance = this.instance = groupCallsController.groupCall;\n const {listenerSetter} = this;\n\n if(!IS_APPLE_MOBILE) {\n const btnFullScreen = this.btnFullScreen = ButtonIcon('fullscreen');\n const btnFullScreen2 = this.btnFullScreen2 = ButtonIcon('fullscreen ' + className + '-cfs');\n const btnExitFullScreen = this.btnExitFullScreen = ButtonIcon('smallscreen');\n\n attachClickEvent(btnFullScreen, this.onFullScreenClick, {listenerSetter});\n attachClickEvent(btnFullScreen2, this.onFullScreenClick, {listenerSetter});\n\n attachClickEvent(btnExitFullScreen, () => {\n cancelFullScreen();\n }, {listenerSetter});\n\n addFullScreenListener(this.container, this.onFullScreenChange, listenerSetter);\n }\n\n const btnInvite = this.btnInvite = ButtonIcon('adduser');\n const btnShowColumn = this.btnShowColumn = ButtonIcon('rightpanel ' + className + '-only-big');\n\n attachClickEvent(btnShowColumn, this.toggleRightColumn, {listenerSetter});\n\n const headerInfo = document.createElement('div');\n headerInfo.classList.add(className + '-header-info');\n\n this.title.classList.add(className + '-header-title');\n\n const subtitle = document.createElement('div');\n subtitle.classList.add(className + '-header-subtitle');\n\n headerInfo.append(this.title, subtitle);\n\n this.header.classList.add(className + '-header');\n this.header.append(...[this.btnExitFullScreen, headerInfo/* , btnInvite */, this.btnFullScreen, btnShowColumn].filter(Boolean));\n\n const newHeader = this.header.cloneNode(false) as HTMLElement;\n const newHeaderInfo = headerInfo.cloneNode(false) as HTMLElement;\n const newHeaderTitle = this.title.cloneNode(false) as HTMLElement;\n\n newHeaderInfo.append(newHeaderTitle);\n\n const btnHideColumn = ButtonIcon('rightpanel');\n newHeader.append(...[btnHideColumn, newHeaderInfo, this.btnFullScreen2].filter(Boolean));\n\n attachClickEvent(btnHideColumn, this.toggleRightColumn, {listenerSetter});\n\n this.body.prepend(newHeader);\n\n const videosScrollable = new Scrollable(undefined);\n videosScrollable.container.classList.add('group-call-big-video-container');\n this.container.append(videosScrollable.container);\n\n this.groupCallTitle = new GroupCallTitleElement(this.title);\n this.groupCallDescription = new GroupCallDescriptionElement(subtitle);\n this.groupCallBodyHeaderDescription = new GroupCallDescriptionElement(newHeaderTitle);\n this.constructButtons();\n\n this.groupCallParticipantsVideo = new GroupCallParticipantsVideoElement({\n appendTo: videosScrollable.container,\n instance,\n listenerSetter,\n displayPinned: true,\n onLengthChange: (length) => {\n this.videosCount = length;\n this.toggleBigLayout();\n },\n managers: this.managers\n });\n this.groupCallParticipants = new GroupCallParticipantsElement({\n appendTo: this.body,\n instance,\n listenerSetter,\n managers: this.managers\n });\n\n this.movablePanel = new MovablePanel({\n listenerSetter,\n movableOptions: {\n minWidth: 400,\n minHeight: 480,\n element: this.element,\n verifyTouchTarget: (e) => {\n const target = e.target;\n if(findUpClassName(target, 'chatlist') ||\n findUpClassName(target, 'group-call-button') ||\n findUpClassName(target, 'btn-icon') ||\n findUpClassName(target, 'group-call-participants-video-container') ||\n isFullScreen()) {\n return false;\n }\n\n return true;\n }\n },\n onResize: () => this.toggleBigLayout(),\n previousState\n });\n\n listenerSetter.add(instance)('state', () => {\n this.updateInstance();\n });\n\n listenerSetter.add(rootScope)('group_call_update', (groupCall) => {\n if(this.instance?.id === groupCall.id) {\n this.updateInstance();\n }\n });\n\n listenerSetter.add(instance)('pinned', () => {\n this.setHasPinned();\n });\n\n listenerSetter.add(this.groupCallParticipantsVideo)('toggleControls', this.onToggleControls);\n\n this.addEventListener('close', () => {\n const {movablePanel} = this;\n previousState = movablePanel.state;\n\n this.groupCallParticipantsVideo.destroy();\n this.groupCallParticipants.destroy();\n this.groupCallMicrophoneIcon.destroy();\n\n movablePanel.destroy();\n });\n\n this.toggleRightColumn();\n this.onFullScreenChange();\n\n this.updateInstance();\n }\n\n private constructButtons() {\n const buttons = this.buttonsContainer = document.createElement('div');\n buttons.classList.add(className + '-buttons');\n\n const _makeButton = makeButton.bind(null, className, this.listenerSetter);\n\n const btnVideo = this.btnVideo = _makeButton({\n // text: 'VoiceChat.Video.Stream.Video',\n callback: this.onVideoClick,\n icon: 'videocamera_filled'\n });\n\n const btnScreen = this.btnScreen = _makeButton({\n // text: 'VoiceChat.Video.Stream.Screencast',\n callback: this.onScreenClick,\n icon: 'sharescreen_filled'\n });\n\n btnScreen.classList.toggle('hide', !IS_SCREEN_SHARING_SUPPORTED);\n\n const btnMute = _makeButton({\n noRipple: true,\n callback: throttle(this.onMuteClick, 600, true)\n });\n btnMute.classList.add(className + '-microphone-button');\n\n const microphoneIcon = this.groupCallMicrophoneIcon = new GroupCallMicrophoneIcon();\n btnMute.append(microphoneIcon.container);\n\n const btnMore = _makeButton({\n // text: 'VoiceChat.Video.Stream.More'\n icon: 'settings_filled'\n });\n\n btnMore.classList.add('btn-disabled');\n btnMore.classList.toggle('hide', !IS_SCREEN_SHARING_SUPPORTED);\n\n const btnLeave = _makeButton({\n // text: 'VoiceChat.Leave',\n isDanger: true,\n callback: this.onLeaveClick,\n icon: 'close'\n });\n\n buttons.append(btnVideo, btnScreen, btnMute, btnMore, btnLeave);\n\n this.container.append(buttons);\n }\n\n private onFullScreenClick = () => {\n requestFullScreen(this.container);\n };\n\n private onToggleControls = (show: boolean) => {\n this.container.classList.toggle('show-controls', show);\n this.buttonsContainer.classList.toggle('show-controls', show);\n };\n\n private toggleDisability = toggleClassName.bind(null, 'btn-disabled');\n\n private onVideoClick = () => {\n const toggle = this.toggleDisability([this.btnVideo], true);\n this.instance.toggleVideoSharing().finally(() => {\n toggle();\n });\n };\n\n private onScreenClick = () => {\n const toggle = this.toggleDisability([this.btnScreen], true);\n this.instance.toggleScreenSharing().finally(() => {\n toggle();\n });\n };\n\n private onMuteClick = () => {\n const participant = this.instance.participant;\n if(!participant.pFlags.can_self_unmute) {\n if(participant.raise_hand_rating === undefined) {\n this.instance.changeRaiseHand(true);\n }\n } else {\n this.instance.toggleMuted();\n }\n };\n\n private onLeaveClick = async() => {\n const hangUp = (discard: boolean) => {\n this.instance.hangUp(discard);\n };\n\n if(await this.managers.appChatsManager.hasRights(this.instance.chatId, 'manage_call')) {\n new PopupPeer('popup-end-video-chat', {\n titleLangKey: 'VoiceChat.End.Title',\n descriptionLangKey: 'VoiceChat.End.Text',\n checkboxes: [{\n text: 'VoiceChat.End.Third'\n }],\n buttons: [{\n langKey: 'VoiceChat.End.OK',\n callback: (checkboxes) => {\n hangUp(!!checkboxes.size);\n },\n isDanger: true\n }]\n }).show();\n } else {\n hangUp(false);\n }\n };\n\n public getContainer() {\n return this.container;\n }\n\n private onFullScreenChange = () => {\n this.toggleBigLayout();\n const isFull = isFullScreen();\n\n const {btnFullScreen, btnExitFullScreen} = this;\n\n const wasFullScreen = this.container.classList.contains('is-full-screen');\n this.container.classList.toggle('is-full-screen', isFull);\n btnFullScreen && btnFullScreen.classList.toggle('hide', isFull);\n btnExitFullScreen && btnExitFullScreen.classList.toggle('hide', !isFull);\n this.btnClose.classList.toggle('hide', isFull);\n\n if(isFull !== wasFullScreen) {\n animationIntersector.checkAnimations2(isFull);\n\n themeController.setThemeColor(isFull ? '#000000' : undefined);\n }\n };\n\n private toggleBigLayout = () => {\n const isFull = isFullScreen();\n const movable = this.movablePanel?.movable;\n const isBig = (isFull || !!(movable && movable.width >= 680)) && !!this.videosCount;\n\n /* if(!isBig && isFull) {\n cancelFullScreen();\n return;\n } */\n\n const wasBig = this.container.classList.contains('is-big-layout');\n let buttons: HTMLElement[];\n if(isBig && !wasBig) { // fix buttons transition to 0 opacity\n buttons = Array.from(this.buttonsContainer.children) as HTMLElement[];\n buttons.forEach((element) => {\n element.style.opacity = '0';\n });\n\n void this.buttonsContainer.offsetLeft;\n }\n\n this.container.classList.toggle('is-big-layout', isBig);\n this.btnInvite.classList.toggle('hide', isBig);\n this.btnShowColumn.classList.toggle('hide', !isBig);\n\n if(buttons) {\n // window.requestAnimationFrame(() => {\n buttons.forEach((element) => {\n element.style.opacity = '';\n });\n // });\n }\n };\n\n private toggleRightColumn = () => {\n this.container.classList.toggle('is-right-column-shown');\n };\n\n private setHasPinned() {\n this.container.classList.toggle('has-pinned', !!this.instance.pinnedSource);\n }\n\n private updateInstance() {\n if(this.instance.state === GROUP_CALL_STATE.CLOSED) {\n if(this.container.classList.contains('is-full-screen')) {\n cancelFullScreen();\n }\n\n this.hide();\n return;\n }\n\n const {participant, groupCall} = this.instance;\n if(!participant) {\n return;\n }\n\n this.setTitle();\n this.setDescription();\n this.setHasPinned();\n\n const microphoneButtonState = getGroupCallMicrophoneButtonState(groupCall as any, participant);\n this.container.dataset.micState = microphoneButtonState === GROUP_CALL_MICROPHONE_BUTTON_STATE.HAND ? 'hand' : (microphoneButtonState === GROUP_CALL_MICROPHONE_BUTTON_STATE.MUTED ? 'muted' : 'unmuted');\n this.groupCallMicrophoneIcon.setState(microphoneButtonState);\n }\n\n private setTitle() {\n this.groupCallTitle.update(this.instance);\n }\n\n private setDescription() {\n this.groupCallDescription.update(this.instance);\n this.groupCallBodyHeaderDescription.update(this.instance);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport {GroupCallParticipant} from '../../layer';\nimport {i18n} from '../../lib/langPack';\nimport {GROUP_CALL_PARTICIPANT_MUTED_STATE} from '.';\nimport {GroupCallParticipantVideoType} from './participantVideo';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\n\nconst className = 'group-call-participant-status';\nexport default class GroupCallParticipantStatusElement {\n public container: HTMLElement;\n\n constructor(private withIcons: GroupCallParticipantVideoType[]) {\n this.container = document.createElement('div');\n this.container.classList.add(className + '-container');\n }\n\n public setState(state: GROUP_CALL_PARTICIPANT_MUTED_STATE, participant: GroupCallParticipant) {\n const states = GROUP_CALL_PARTICIPANT_MUTED_STATE;\n const icons = this.withIcons.filter((type) => !!participant[type]).map((type) => {\n const iconClassName = `tgico-${type === 'presentation' ? 'listscreenshare' : 'videocamera_filled'}`;\n const i = document.createElement('i');\n i.classList.add(className + '-icon', className + '-icon-' + type, iconClassName);\n return i;\n });\n\n let element2: HTMLElement, actionClassName: string;\n if(state === states.MUTED_FOR_ME) {\n element2 = i18n('VoiceChat.Status.MutedForYou');\n actionClassName = 'is-muted';\n } else if(state === states.UNMUTED) {\n element2 = i18n('VoiceChat.Status.Speaking');\n actionClassName = 'is-speaking';\n } else if(state === states.HAND) {\n element2 = i18n('VoiceChat.Status.WantsSpeak');\n actionClassName = 'is-waiting';\n } else if(participant.about && !icons.length) {\n setInnerHTML(this.container, wrapEmojiText(participant.about));\n return;\n } else {\n element2 = i18n('VoiceChat.Status.Listening');\n actionClassName = 'is-listening';\n }\n\n const span = document.createElement('span');\n span.classList.add(className, actionClassName);\n span.append(...icons, element2);\n\n replaceContent(this.container, span);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport positionElementByIndex from '../../helpers/dom/positionElementByIndex';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport {fastRaf} from '../../helpers/schedulers';\nimport SortedList, {SortedElementBase} from '../../helpers/sortedList';\nimport appDialogsManager, {DialogDom, AppDialogsManager, DialogElementSize} from '../../lib/appManagers/appDialogsManager';\nimport {getGroupCallParticipantMutedState} from '.';\nimport GroupCallParticipantMutedIcon from './participantMutedIcon';\nimport GroupCallParticipantStatusElement from './participantStatus';\nimport type GroupCallInstance from '../../lib/calls/groupCallInstance';\nimport type LazyLoadQueue from '../lazyLoadQueue';\n\ninterface SortedParticipant extends SortedElementBase {\n dom: DialogDom,\n mutedIcon: GroupCallParticipantMutedIcon,\n status: GroupCallParticipantStatusElement\n}\n\nexport default class GroupCallParticipantsList extends SortedList {\n public list: HTMLUListElement;\n\n protected lazyLoadQueue: LazyLoadQueue;\n protected avatarSize: DialogElementSize = 'abitbigger';\n protected rippleEnabled = true;\n protected autonomous = true;\n protected createChatListOptions: Parameters[0] = {/* new: true, */dialogSize: 72};\n\n constructor(private instance: GroupCallInstance) {\n super({\n getIndex: async(element) => (await this.instance.getParticipantByPeerId(element.id)).date,\n onDelete: (element) => {\n element.dom.listEl.remove();\n this.onElementDestroy(element);\n },\n onUpdate: async(element) => {\n const participant = await this.instance.getParticipantByPeerId(element.id);\n const state = getGroupCallParticipantMutedState(participant);\n\n element.mutedIcon.setState(state);\n element.status.setState(state, participant);\n },\n onSort: (element, idx) => {\n positionElementByIndex(element.dom.listEl, this.list, idx);\n },\n onElementCreate: (base) => {\n const {dom} = appDialogsManager.addDialogNew({\n peerId: base.id,\n container: false,\n avatarSize: this.avatarSize,\n autonomous: this.autonomous,\n meAsSaved: false,\n rippleEnabled: this.rippleEnabled,\n wrapOptions: {\n lazyLoadQueue: this.lazyLoadQueue\n }\n });\n\n const className = 'group-call-participant';\n dom.listEl.classList.add(className);\n\n const mutedIcon = new GroupCallParticipantMutedIcon(true);\n const status = new GroupCallParticipantStatusElement(['presentation', 'video']);\n replaceContent(dom.lastMessageSpan, status.container);\n dom.listEl.append(mutedIcon.container);\n (base as SortedParticipant).mutedIcon = mutedIcon;\n (base as SortedParticipant).status = status;\n\n /* instance.getParticipantByPeerId(base.id).then((participant) => {\n const mutedState = getGroupCallParticipantMutedState(participant);\n\n mutedIcon.setState(mutedState);\n status.setState(mutedState, participant);\n }); */\n\n (base as SortedParticipant).dom = dom;\n\n return base as SortedParticipant;\n },\n updateElementWith: fastRaf\n });\n\n this.list = appDialogsManager.createChatList(this.createChatListOptions);\n }\n\n public destroy() {\n this.elements.forEach((element) => {\n this.onElementDestroy(element);\n });\n }\n\n protected onElementDestroy(element: SortedParticipant) {\n element.mutedIcon.destroy();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {animate} from '../../helpers/animation';\n\nexport default function callVideoCanvasBlur(video: HTMLVideoElement) {\n const canvas = document.createElement('canvas');\n canvas.classList.add('call-video-blur');\n const size = 16;\n canvas.width = size;\n canvas.height = size;\n\n const ctx = canvas.getContext('2d', {alpha: false});\n ctx.filter = 'blur(2px)';\n const renderFrame = () => {\n ctx.drawImage(video, 0, 0, video.videoWidth, video.videoHeight, 0, 0, canvas.width, canvas.height);\n };\n\n animate(() => {\n renderFrame();\n return canvas.isConnected;\n });\n\n renderFrame();\n\n return canvas;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {GroupCallParticipant} from '../../layer';\nimport type {GroupCallOutputSource} from '../../lib/appManagers/appGroupCallsManager';\nimport {i18n} from '../../lib/langPack';\nimport PeerTitle from '../peerTitle';\nimport {getGroupCallParticipantMutedState} from '.';\nimport GroupCallParticipantMutedIcon from './participantMutedIcon';\nimport GroupCallParticipantStatusElement from './participantStatus';\nimport GroupCallInstance from '../../lib/calls/groupCallInstance';\nimport callVideoCanvasBlur from '../call/videoCanvasBlur';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport {AppManagers} from '../../lib/appManagers/managers';\n\nconst className = 'group-call-participant-video';\n\nexport type GroupCallParticipantVideoType = 'video' | 'presentation';\nexport default class GroupCallParticipantVideoElement {\n public container: HTMLElement;\n private peerTitle: PeerTitle;\n private subtitle: HTMLElement;\n private info: HTMLElement;\n private left: HTMLElement;\n private right: HTMLElement;\n private header: HTMLElement;\n private groupCallParticipantMutedIcon: GroupCallParticipantMutedIcon;\n private groupCallParticipantStatus: GroupCallParticipantStatusElement;\n\n constructor(private managers: AppManagers, private instance: GroupCallInstance, public source: GroupCallOutputSource) {\n this.container = document.createElement('div');\n this.container.classList.add(className + '-container');\n\n this.info = document.createElement('div');\n this.info.classList.add(className + '-info');\n\n this.left = document.createElement('div');\n this.left.classList.add(className + '-info-left');\n\n this.right = document.createElement('div');\n this.right.classList.add(className + '-info-right');\n\n this.info.append(this.left, this.right);\n\n this.container.append(this.info);\n }\n\n public setPinned(value: boolean) {\n if(!value) {\n if(this.header) {\n this.header.remove();\n this.header = undefined;\n }\n\n return;\n } else if(this.header) {\n return;\n }\n\n // if(!this.header) {\n this.header = document.createElement('div');\n this.header.classList.add(className + '-header');\n\n const icon = document.createElement('i');\n icon.classList.add('group-call-pin-icon', 'tgico-pin');\n this.header.append(icon);\n\n this.container.append(this.header);\n // }\n\n // this.container.classList.toggle('is-pinned', value);\n }\n\n public setParticipant(participant: GroupCallParticipant, type: GroupCallParticipantVideoType, video: HTMLVideoElement) {\n let peerTitleElement: HTMLElement;\n if(participant.pFlags.self) {\n peerTitleElement = i18n('VoiceChat.Status.You');\n peerTitleElement.classList.add('peer-title');\n } else {\n this.peerTitle = new PeerTitle({\n peerId: getPeerId(participant.peer)\n });\n\n peerTitleElement = this.peerTitle.element;\n }\n\n this.groupCallParticipantMutedIcon = new GroupCallParticipantMutedIcon(false);\n this.groupCallParticipantStatus = new GroupCallParticipantStatusElement([type]);\n\n this.left.append(peerTitleElement, this.groupCallParticipantStatus.container);\n\n this.right.append(this.groupCallParticipantMutedIcon.container);\n\n video.classList.add(className, 'call-video');\n\n if(video.paused) {\n video.play();\n }\n\n const canvas = callVideoCanvasBlur(video);\n canvas.classList.add(className + '-blur');\n\n this.container.prepend(canvas, video);\n\n this.updateParticipant(participant);\n }\n\n public updateParticipant(participant: GroupCallParticipant) {\n const state = getGroupCallParticipantMutedState(participant);\n\n this.groupCallParticipantMutedIcon.setState(state);\n this.groupCallParticipantStatus.setState(state, participant);\n }\n\n public destroy() {\n this.groupCallParticipantMutedIcon.destroy();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport ControlsHover from '../../helpers/dom/controlsHover';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport {GroupCallParticipant} from '../../layer';\nimport {GroupCallOutputSource} from '../../lib/appManagers/appGroupCallsManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport GroupCallInstance from '../../lib/calls/groupCallInstance';\nimport rootScope from '../../lib/rootScope';\nimport GroupCallParticipantVideoElement, {GroupCallParticipantVideoType} from './participantVideo';\n\nexport default class GroupCallParticipantsVideoElement extends ControlsHover {\n private container: HTMLDivElement;\n private instance: GroupCallInstance;\n private participantsElements: Map>;\n private displayPinned: boolean;\n private containers: Map;\n private onLengthChange: (length: number) => void;\n private managers: AppManagers;\n\n constructor(options: {\n appendTo: HTMLElement,\n instance: GroupCallInstance,\n listenerSetter: ListenerSetter,\n displayPinned: boolean,\n onLengthChange?: GroupCallParticipantsVideoElement['onLengthChange'],\n managers: AppManagers\n }) {\n super();\n safeAssign(this, options);\n\n const className = 'group-call-participants-video';\n const container = this.container = document.createElement('div');\n this.container.classList.add(className + '-container');\n\n options.appendTo.append(container);\n\n this.participantsElements = new Map();\n this.containers = new Map();\n\n const {listenerSetter} = this;\n\n listenerSetter.add(rootScope)('group_call_participant', ({groupCallId, participant}) => {\n if(this.instance.id === groupCallId) {\n this.updateParticipant(participant);\n }\n });\n\n listenerSetter.add(this.instance)('pinned', (source) => {\n this.participantsElements.forEach((map) => {\n map.forEach((element) => {\n this.setElementDisplay(element, source);\n });\n });\n });\n\n attachClickEvent(this.container, (e) => {\n const container = findUpClassName(e.target, 'group-call-participant-video-container');\n if(!container) {\n return;\n }\n\n const element = this.containers.get(container);\n if(this.instance.pinnedSource === element.source) {\n this.instance.unpinAll();\n return;\n }\n\n this.instance.pinSource(element.source);\n }, {listenerSetter});\n\n this.setInstance(this.instance);\n\n this.setup({\n element: container,\n listenerSetter: listenerSetter,\n showOnLeaveToClassName: 'group-call-buttons'\n });\n }\n\n private shouldDisplayElement(element: GroupCallParticipantVideoElement, pinnedSource: GroupCallOutputSource) {\n return this.displayPinned ? !pinnedSource || element.source === pinnedSource : pinnedSource && element.source !== pinnedSource;\n }\n\n private setElementDisplay(element: GroupCallParticipantVideoElement, pinnedSource: GroupCallOutputSource) {\n const shouldDisplay = this.shouldDisplayElement(element, pinnedSource);\n element.container.classList.toggle('video-hidden', !shouldDisplay);\n\n const isPinned = element.source === pinnedSource;\n element.setPinned(isPinned);\n }\n\n private updateParticipant(participant: GroupCallParticipant) {\n const peerId = getPeerId(participant.peer);\n const types: GroupCallParticipantVideoType[] = ['video', 'presentation'];\n const hasAnyVideo = types.some((type) => !!participant[type]);\n let participantElements = this.participantsElements.get(peerId);\n if(!hasAnyVideo && !participantElements) {\n return;\n }\n\n if(!participantElements) {\n this.participantsElements.set(peerId, participantElements = new Map());\n }\n\n types.forEach((type) => {\n let element = participantElements.get(type);\n const participantVideo = participant[type];\n if(!!participantVideo === !!element) {\n if(element) {\n element.updateParticipant(participant);\n }\n\n return;\n }\n\n if(participantVideo) {\n const result = this.instance.getVideoElementFromParticipantByType(participant, type);\n if(!result) {\n return;\n }\n\n const {video, source} = result;\n\n element = new GroupCallParticipantVideoElement(this.managers, this.instance, source);\n\n this.containers.set(element.container, element);\n\n this.setElementDisplay(element, this.instance.pinnedSource);\n participantElements.set(type, element);\n element.setParticipant(participant, type, video);\n\n this.container.prepend(element.container);\n } else {\n participantElements.delete(type);\n element.container.remove();\n\n if(!participantElements.size) {\n this.participantsElements.delete(peerId);\n this.containers.delete(element.container);\n element.destroy();\n }\n }\n\n this._onLengthChange();\n });\n }\n\n private _onLengthChange() {\n const length = this.container.childElementCount;\n this.container.dataset.length = '' + length;\n this.container.dataset.layout = length <= 2 ? '1' : (length === 3 ? '3' : '4');\n\n this.onLengthChange && this.onLengthChange(length);\n }\n\n public async setInstance(instance: GroupCallInstance) {\n (await instance.participants).forEach((participant) => {\n this.updateParticipant(participant);\n });\n }\n\n public destroy() {\n this.containers.forEach((element) => {\n element.destroy();\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport PopupGroupCall from '.';\nimport filterAsync from '../../helpers/array/filterAsync';\nimport contextMenuController from '../../helpers/contextMenuController';\nimport {attachContextMenuListener} from '../../helpers/dom/attachContextMenuListener';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport {addFullScreenListener, isFullScreen} from '../../helpers/dom/fullScreen';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport noop from '../../helpers/noop';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport positionMenu from '../../helpers/positionMenu';\nimport ScrollableLoader from '../../helpers/scrollableLoader';\nimport {GroupCallParticipant} from '../../layer';\nimport appImManager from '../../lib/appManagers/appImManager';\nimport {AppManagers} from '../../lib/appManagers/managers';\nimport getPeerId from '../../lib/appManagers/utils/peers/getPeerId';\nimport GroupCallInstance from '../../lib/calls/groupCallInstance';\nimport rootScope from '../../lib/rootScope';\nimport {ButtonMenuItemOptions, ButtonMenuSync} from '../buttonMenu';\nimport confirmationPopup from '../confirmationPopup';\nimport PeerTitle from '../peerTitle';\nimport PopupElement from '../popups';\nimport Scrollable from '../scrollable';\nimport GroupCallParticipantsList from './participantsList';\nimport GroupCallParticipantsVideoElement from './participantVideos';\n\nexport class GroupCallParticipantContextMenu {\n private buttons: (ButtonMenuItemOptions & {verify: (peerId: PeerId) => boolean | Promise})[];\n private element: HTMLElement;\n private chatId: ChatId;\n private targetPeerId: PeerId;\n private participant: GroupCallParticipant;\n private instance: GroupCallInstance;\n private canManageCall: boolean;\n private managers: AppManagers;\n\n constructor(options: {\n listenerSetter: ListenerSetter,\n onContextElement: HTMLElement,\n managers: AppManagers,\n instance: GroupCallInstance,\n }) {\n this.buttons = [{\n icon: 'gc_microphoneoff',\n text: 'VoiceChat.MutePeer',\n verify: () => this.canManageCall && this.participant.pFlags.can_self_unmute,\n onClick: () => this.toggleParticipantMuted(true)\n }, {\n icon: 'gc_microphone',\n text: 'VoiceChat.UnmutePeer',\n verify: () => this.canManageCall && !this.participant.pFlags.can_self_unmute,\n onClick: () => this.toggleParticipantMuted(false)\n }, {\n icon: 'gc_microphoneoff',\n text: 'VoiceChat.MuteForMe',\n verify: () => !this.canManageCall && !this.participant.pFlags.muted_by_you,\n onClick: () => this.toggleParticipantMuted(true)\n }, {\n icon: 'gc_microphone',\n text: 'VoiceChat.UnmuteForMe',\n verify: () => !this.canManageCall && this.participant.pFlags.muted_by_you,\n onClick: () => this.toggleParticipantMuted(false)\n }, {\n icon: 'newprivate',\n text: 'VoiceChat.OpenProfile',\n verify: () => true,\n onClick: this.onOpenProfileClick\n }, {\n icon: 'deleteuser danger',\n text: 'VoiceChat.RemovePeer',\n verify: () => this.managers.appChatsManager.hasRights(this.chatId, 'ban_users'),\n onClick: async() => {\n confirmationPopup({\n peerId: this.targetPeerId,\n title: new PeerTitle({peerId: this.targetPeerId}).element,\n descriptionLangKey: await this.managers.appChatsManager.isBroadcast(this.chatId) ? 'VoiceChat.RemovePeer.Confirm.Channel' : 'VoiceChat.RemovePeer.Confirm',\n descriptionLangArgs: [new PeerTitle({peerId: this.targetPeerId}).element],\n button: {\n langKey: 'VoiceChat.RemovePeer.Confirm.OK',\n isDanger: true\n }\n }).then(() => {\n this.managers.appChatsManager.kickFromChat(this.chatId, this.targetPeerId);\n }, noop);\n }\n }];\n\n const {listenerSetter} = options;\n this.managers = options.managers;\n this.instance = options.instance;\n this.chatId = this.instance.chatId;\n\n this.element = ButtonMenuSync({buttons: this.buttons, listenerSetter});\n this.element.classList.add('group-call-participant-menu', 'night');\n\n attachContextMenuListener({\n element: options.onContextElement,\n callback: async(e) => {\n const li = findUpClassName(e.target, 'group-call-participant');\n if(!li) {\n return;\n }\n\n if(this.element.parentElement !== appendTo) {\n appendTo.append(this.element);\n }\n\n cancelEvent(e);\n\n const peerId = this.targetPeerId = li.dataset.peerId.toPeerId();\n this.participant = await this.instance.getParticipantByPeerId(peerId);\n if(this.participant.pFlags.self) {\n return;\n }\n\n this.canManageCall = await this.managers.appChatsManager.hasRights(this.chatId, 'manage_call');\n\n await filterAsync(this.buttons, async(button) => {\n const good = await button.verify(peerId);\n button.element.classList.toggle('hide', !good);\n return good;\n });\n\n positionMenu((e as TouchEvent).touches ? (e as TouchEvent).touches[0] : e as MouseEvent, this.element, 'right');\n contextMenuController.openBtnMenu(this.element);\n },\n listenerSetter\n });\n\n listenerSetter.add(rootScope)('group_call_participant', ({groupCallId, participant}) => {\n if(this.instance.id === groupCallId) {\n const peerId = getPeerId(participant.peer);\n if(this.targetPeerId === peerId) {\n contextMenuController.close();\n }\n }\n });\n\n let appendTo: HTMLElement = document.body;\n addFullScreenListener(document.body, () => {\n const isFull = isFullScreen();\n appendTo = isFull ? PopupElement.getPopups(PopupGroupCall)[0].getContainer(): document.body;\n\n if(!isFull) {\n contextMenuController.close();\n }\n }, listenerSetter);\n }\n\n private onOpenProfileClick = () => {\n const popup = PopupElement.getPopups(PopupGroupCall)[0];\n if(popup) {\n popup.hide();\n }\n\n appImManager.setInnerPeer({peerId: this.targetPeerId});\n };\n\n private toggleParticipantMuted = (muted: boolean) => {\n this.instance.editParticipant(this.participant, {\n muted\n });\n };\n};\n\nexport default class GroupCallParticipantsElement {\n private container: HTMLDivElement;\n private sortedList: GroupCallParticipantsList;\n private instance: GroupCallInstance;\n private listenerSetter: ListenerSetter;\n private groupCallParticipantsVideo: GroupCallParticipantsVideoElement;\n private contextMenu: GroupCallParticipantContextMenu;\n private managers: AppManagers;\n\n constructor(options: {\n appendTo: HTMLElement,\n instance: GroupCallInstance,\n listenerSetter: ListenerSetter,\n managers: AppManagers\n }) {\n safeAssign(this, options);\n\n const className = 'group-call-participants';\n\n const scrollable = new Scrollable(undefined);\n scrollable.container.classList.add(className + '-scrollable');\n\n const container = this.container = document.createElement('div');\n container.classList.add(className);\n\n // const invite = Button(`btn-primary btn-transparent ${className}-invite`, {icon: 'adduser', text: 'VoiceChat.Invite.InviteMembers'});\n\n const sortedList = this.sortedList = new GroupCallParticipantsList(this.instance);\n\n const {instance, listenerSetter} = this;\n this.contextMenu = new GroupCallParticipantContextMenu({\n ...options,\n onContextElement: sortedList.list,\n listenerSetter,\n instance\n });\n\n this.groupCallParticipantsVideo = new GroupCallParticipantsVideoElement({\n ...options,\n appendTo: scrollable.container,\n displayPinned: false\n });\n\n scrollable.append(/* invite, */sortedList.list);\n container.append(scrollable.container);\n\n options.appendTo.append(container);\n\n listenerSetter.add(rootScope)('group_call_participant', ({groupCallId, participant}) => {\n if(this.instance.id === groupCallId) {\n this.updateParticipant(participant);\n }\n });\n\n const scrollableLoader = new ScrollableLoader({\n scrollable,\n getPromise: () => {\n return this.managers.appGroupCallsManager.getGroupCallParticipants(this.instance.id).then(({participants, isEnd}) => {\n participants.forEach((participant) => {\n this.updateParticipant(participant);\n });\n\n return isEnd;\n });\n }\n });\n\n this.setInstance(instance);\n }\n\n private updateParticipant(participant: GroupCallParticipant) {\n const peerId = getPeerId(participant.peer);\n const has = this.sortedList.has(peerId);\n if(participant.pFlags.left) {\n if(has) {\n this.sortedList.delete(peerId);\n }\n\n return;\n }\n\n if(!has) {\n this.sortedList.add(peerId);\n return;\n }\n\n this.sortedList.update(peerId);\n }\n\n public async setInstance(instance: GroupCallInstance) {\n // @ts-ignore\n /* const users = appUsersManager.users;\n for(const userId in users) {\n const participant: GroupCallParticipant = {\n _: 'groupCallParticipant',\n date: 0,\n peer: {_: 'peerUser', user_id: userId.toPeerId()},\n pFlags: {\n muted: true\n },\n source: 1\n };\n\n instance.participants.set(userId.toPeerId(), participant);\n this.updateParticipant(participant);\n } */\n const participants = await instance.participants;\n participants.forEach((participant) => {\n this.updateParticipant(participant);\n });\n }\n\n public destroy() {\n this.sortedList.destroy();\n this.groupCallParticipantsVideo.destroy();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {GroupCall} from '../../layer';\nimport GroupCallInstance from '../../lib/calls/groupCallInstance';\nimport GROUP_CALL_STATE from '../../lib/calls/groupCallState';\nimport I18n, {LangPackKey, FormatterArguments} from '../../lib/langPack';\n\nexport default class GroupCallDescriptionElement {\n private descriptionIntl: I18n.IntlElement;\n\n constructor(private appendTo: HTMLElement) {\n this.descriptionIntl = new I18n.IntlElement({\n key: 'VoiceChat.Status.Connecting'\n });\n\n this.descriptionIntl.element.classList.add('group-call-description');\n }\n\n public detach() {\n this.descriptionIntl.element.remove();\n }\n\n public update(instance: GroupCallInstance) {\n const {state} = instance;\n\n let key: LangPackKey, args: FormatterArguments;\n if(state === GROUP_CALL_STATE.CONNECTING) {\n key = 'VoiceChat.Status.Connecting';\n } else {\n key = 'VoiceChat.Status.Members';\n args = [(instance.groupCall as GroupCall.groupCall).participants_count];\n }\n\n const {descriptionIntl} = this;\n descriptionIntl.compareAndUpdate({\n key,\n args\n });\n\n if(!this.descriptionIntl.element.parentElement) {\n this.appendTo.append(this.descriptionIntl.element);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport setInnerHTML from '../../helpers/dom/setInnerHTML';\nimport {GroupCall} from '../../layer';\nimport GroupCallInstance from '../../lib/calls/groupCallInstance';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport PeerTitle from '../peerTitle';\n\nexport default class GroupCallTitleElement {\n private peerTitle: PeerTitle;\n\n constructor(private appendTo: HTMLElement) {\n this.peerTitle = new PeerTitle({peerId: 0});\n }\n\n public update(instance: GroupCallInstance) {\n const {peerTitle, appendTo} = this;\n const groupCall = instance.groupCall as GroupCall.groupCall;\n const peerId = instance.chatId.toPeerId(true);\n if(groupCall.title) {\n setInnerHTML(appendTo, wrapEmojiText(groupCall.title));\n } else {\n if(peerTitle.options.peerId !== peerId) {\n peerTitle.options.peerId = peerId;\n peerTitle.update();\n }\n\n if(peerTitle.element.parentElement !== appendTo) {\n appendTo.append(peerTitle.element);\n }\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport ListenerSetter from '../../helpers/listenerSetter';\nimport {i18n, LangPackKey} from '../../lib/langPack';\nimport ripple from '../ripple';\n\nexport default function makeButton(className: string, listenerSetter: ListenerSetter, options: {\n text?: LangPackKey | HTMLElement,\n isDanger?: boolean,\n noRipple?: boolean,\n callback?: () => void,\n icon?: string,\n isConfirm?: boolean,\n}) {\n const _className = className + '-button';\n const buttonDiv = document.createElement('div');\n buttonDiv.classList.add(_className, 'call-button', 'rp-overflow');\n\n if(options.icon) {\n buttonDiv.classList.add('tgico-' + options.icon);\n }\n\n if(!options.noRipple) {\n ripple(buttonDiv);\n }\n\n if(options.isDanger) {\n buttonDiv.classList.add(_className + '-red');\n }\n\n if(options.isConfirm) {\n buttonDiv.classList.add(_className + '-green');\n }\n\n if(options.callback) {\n attachClickEvent(buttonDiv, options.callback, {listenerSetter});\n }\n\n let ret = buttonDiv;\n if(options.text) {\n const div = document.createElement('div');\n div.classList.add(_className + '-container', 'call-button-container');\n\n const textEl = typeof(options.text) === 'string' ? i18n(options.text) : options.text;\n textEl.classList.add(_className + '-text', 'call-button-text');\n\n div.append(buttonDiv, textEl);\n\n ret = div;\n }\n\n return ret;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport findUpClassName from '../helpers/dom/findUpClassName';\nimport EventListenerBase from '../helpers/eventListenerBase';\nimport mediaSizes from '../helpers/mediaSizes';\nimport clamp from '../helpers/number/clamp';\nimport safeAssign from '../helpers/object/safeAssign';\nimport windowSize from '../helpers/windowSize';\nimport SwipeHandler from './swipeHandler';\n\ntype ResizeSide = 'n' | 'e' | 's' | 'w' | 'ne' | 'se' | 'sw' | 'nw';\nexport type MovableState = {\n top?: number;\n left?: number;\n width: number;\n height: number;\n};\n\nconst className = 'movable-element';\nconst resizeHandlerClassName = className + '-resize-handler';\n\nexport type MovableElementOptions = {\n minWidth: MovableElement['minWidth'],\n minHeight: MovableElement['minHeight'],\n element: MovableElement['element'],\n verifyTouchTarget?: MovableElement['verifyTouchTarget']\n};\n\nexport default class MovableElement extends EventListenerBase<{\n resize: () => void\n}> {\n private minWidth: number;\n private minHeight: number;\n private element: HTMLElement;\n private verifyTouchTarget: SwipeHandler['verifyTouchTarget'];\n\n private top: number;\n private left: number;\n private _width: number;\n private _height: number;\n\n private swipeHandler: SwipeHandler;\n private handlers: HTMLElement[];\n\n constructor(options: MovableElementOptions) {\n super(true);\n safeAssign(this, options);\n\n this.top = this.left = this.width = this.height = 0;\n this.element.classList.add(className);\n\n this.addResizeHandlers();\n this.setSwipeHandler();\n\n mediaSizes.addEventListener('resize', this.onResize);\n }\n\n private onResize = () => {\n this.fixDimensions();\n this.fixPosition();\n this.setPosition();\n };\n\n public destroyElements() {\n this.element.classList.remove(className);\n\n if(this.handlers) {\n this.handlers.forEach((handler) => {\n handler.remove();\n });\n }\n }\n\n public destroy() {\n mediaSizes.removeEventListener('resize', this.onResize);\n this.swipeHandler.removeListeners();\n }\n\n private addResizeHandlers() {\n const sides: ResizeSide[] = ['n', 'e', 's', 'w', 'ne', 'se', 'sw', 'nw'];\n this.handlers = sides.map((side) => {\n const div = document.createElement('div');\n div.dataset.side = side;\n div.classList.add(resizeHandlerClassName, resizeHandlerClassName + '-side-' + side);\n this.element.append(div);\n return div;\n });\n }\n\n private setSwipeHandler() {\n let startTop: number, startLeft: number, startWidth: number, startHeight: number, resizingSide: ResizeSide;\n const swipeHandler = this.swipeHandler = new SwipeHandler({\n element: this.element,\n onSwipe: (xDiff, yDiff, e) => {\n // console.log(xDiff, yDiff, e);\n\n if(resizingSide) {\n if(resizingSide.includes('e') || resizingSide.includes('w')) {\n const isEnlarging = resizingSide.includes('e') && xDiff > 0 || resizingSide.includes('w') && xDiff < 0;\n const resizeDiff = Math.abs(xDiff) * (isEnlarging ? 1 : -1);\n\n const maxPossible = resizingSide.includes('e') ? windowSize.width - startLeft : startWidth + startLeft;\n this.width = Math.min(maxPossible, startWidth + resizeDiff);\n }\n\n if(resizingSide.includes('n') || resizingSide.includes('s')) {\n const isEnlarging = resizingSide.includes('s') && yDiff > 0 || resizingSide.includes('n') && yDiff < 0;\n const resizeDiff = Math.abs(yDiff) * (isEnlarging ? 1 : -1);\n\n const maxPossible = resizingSide.includes('s') ? windowSize.height - startTop : startHeight + startTop;\n this.height = Math.min(maxPossible, startHeight + resizeDiff);\n }\n\n this.fixDimensions();\n\n if(resizingSide.includes('w')) {\n this.left = Math.min(startLeft + startWidth - this.minWidth, startLeft + xDiff);\n }\n\n if(resizingSide.includes('n')) {\n this.top = Math.min(startTop + startHeight - this.minHeight, startTop + yDiff);\n }\n } else {\n this.top = startTop + yDiff;\n this.left = startLeft + xDiff;\n }\n\n this.fixPosition();\n this.setPosition();\n },\n verifyTouchTarget: (e) => {\n const target = e.target;\n if(this.verifyTouchTarget && !this.verifyTouchTarget(e)) {\n return false;\n }\n\n const resizeHandler = findUpClassName(target, resizeHandlerClassName);\n if(resizeHandler) {\n resizingSide = resizeHandler.dataset.side as ResizeSide;\n swipeHandler.setCursor('');\n } else {\n resizingSide = undefined;\n swipeHandler.setCursor('grabbing');\n }\n\n return true;\n },\n onFirstSwipe: () => {\n startTop = this.top;\n startLeft = this.left;\n startWidth = this.width;\n startHeight = this.height;\n }\n });\n }\n\n public setPositionToCenter() {\n this.top = (windowSize.height / 2) - (this.height / 2);\n this.left = (windowSize.width / 2) - (this.width / 2);\n this.setPosition();\n }\n\n private fixDimensions() {\n this.width = clamp(this.width, this.minWidth, windowSize.width);\n this.height = clamp(this.height, this.minHeight, windowSize.height);\n }\n\n private fixPosition() {\n this.top = clamp(this.top, 0, windowSize.height - this.height);\n this.left = clamp(this.left, 0, windowSize.width - this.width);\n }\n\n private setPosition() {\n this.element.style.top = this.top + 'px';\n this.element.style.left = this.left + 'px';\n this.element.style.right = 'auto';\n this.element.style.bottom = 'auto';\n this.element.style.width = this.width + 'px';\n this.element.style.height = this.height + 'px';\n\n this.dispatchEvent('resize');\n }\n\n public get width() {\n return this._width;\n }\n\n public get height() {\n return this._height;\n }\n\n private set width(value: number) {\n this._width = value;\n }\n\n private set height(value: number) {\n this._height = value;\n }\n\n public get state(): MovableState {\n const {top, left, width, height} = this;\n return {\n top,\n left,\n width,\n height\n };\n }\n\n public set state(state: MovableState) {\n const {top, left, width, height} = state;\n this.top = top;\n this.left = left;\n this.width = width;\n this.height = height;\n this.onResize();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport MovableElement, {MovableElementOptions, MovableState} from '../components/movableElement';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport ListenerSetter from './listenerSetter';\nimport mediaSizes, {ScreenSize} from './mediaSizes';\nimport safeAssign from './object/safeAssign';\n\nexport default class MovablePanel {\n #movable: MovableElement;\n private listenerSetter: ListenerSetter;\n private previousState: MovableState;\n private onResize: () => void;\n private movableOptions: MovableElementOptions;\n\n constructor(options: {\n listenerSetter: ListenerSetter,\n previousState: MovableState,\n onResize?: () => void,\n movableOptions: MovableElementOptions\n }) {\n safeAssign(this, options);\n\n this.toggleMovable(!IS_TOUCH_SUPPORTED);\n\n this.listenerSetter.add(mediaSizes)('changeScreen', (from, to) => {\n if(to === ScreenSize.mobile || from === ScreenSize.mobile) {\n this.toggleMovable(!IS_TOUCH_SUPPORTED);\n }\n });\n }\n\n public destroy() {\n const movable = this.movable;\n if(movable) {\n movable.destroy();\n }\n }\n\n public get movable() {\n return this.#movable;\n }\n\n public get state() {\n return this.movable ? this.movable.state : this.previousState;\n }\n\n public set state(state: MovableState) {\n this.previousState = state;\n }\n\n private toggleMovable(enabled: boolean) {\n let {movable} = this;\n if(enabled) {\n if(movable) {\n return;\n }\n\n movable = this.#movable = new MovableElement(this.movableOptions);\n\n movable.state = this.previousState;\n if(this.previousState.top === undefined) {\n movable.setPositionToCenter();\n }\n\n if(this.onResize) {\n this.listenerSetter.add(movable)('resize', this.onResize);\n }\n } else {\n if(!movable) {\n return;\n }\n\n this.previousState = movable.state;\n movable.destroyElements();\n movable.destroy();\n this.#movable = undefined;\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function toggleClassName(className: string, elements: HTMLElement[], disable: boolean) {\n elements.forEach((element) => {\n element.classList.toggle(className, disable);\n });\n\n return () => toggleClassName(className, elements, !disable);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport toHHMMSS from '../../helpers/string/toHHMMSS';\nimport CALL_STATE from '../../lib/calls/callState';\nimport {i18n, LangPackKey} from '../../lib/langPack';\n\nexport default class CallDescriptionElement {\n private container: HTMLElement;\n private state: CALL_STATE;\n private interval: number;\n\n constructor(private appendTo: HTMLElement) {\n this.container = document.createElement('div');\n this.container.classList.add('call-description');\n }\n\n public detach() {\n if(this.interval !== undefined) {\n clearInterval(this.interval);\n this.interval = undefined;\n }\n\n this.container.remove();\n this.state = undefined;\n }\n\n public update(instance: any) {\n const {connectionState} = instance;\n\n if(this.state === connectionState) {\n return;\n }\n\n this.state = connectionState;\n\n let element: HTMLElement;\n if(connectionState === CALL_STATE.CONNECTED) {\n element = document.createElement('span');\n element.classList.add('call-description-duration');\n\n const setTime = () => {\n element.innerText = toHHMMSS(instance.duration, true);\n };\n\n this.interval = window.setInterval(setTime, 1000);\n setTime();\n } else {\n let langPackKey: LangPackKey;\n switch(connectionState) {\n case CALL_STATE.PENDING:\n langPackKey = instance.isOutgoing ? 'Call.StatusRinging' : 'Call.StatusCalling';\n break;\n case CALL_STATE.REQUESTING:\n langPackKey = 'Call.StatusRequesting';\n break;\n case CALL_STATE.EXCHANGING_KEYS:\n langPackKey = 'VoipExchangingKeys';\n break;\n case CALL_STATE.CLOSED:\n langPackKey = instance.connectedAt !== undefined ? 'Call.StatusEnded' : 'Call.StatusFailed';\n break;\n default:\n langPackKey = 'Call.StatusConnecting';\n break;\n }\n\n element = i18n(langPackKey);\n if(this.interval !== undefined) {\n clearInterval(this.interval);\n this.interval = undefined;\n }\n }\n\n this.container.classList.toggle('has-duration', connectionState === CALL_STATE.CONNECTED);\n replaceContent(this.container, element);\n\n if(!this.container.parentElement) {\n this.appendTo.append(this.container);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {SuperRLottieIcon} from '../superIcon';\n\nexport default class GroupCallMicrophoneIconMini extends SuperRLottieIcon<{\n PartState: boolean,\n ColorState: boolean,\n Items: {\n name: 'voice_mini'\n }[]\n}> {\n constructor(colored?: boolean, skipAnimation?: boolean) {\n super({\n width: 36,\n height: 36,\n getPart: (state) => {\n return this.getItem().getPart(state ? 'unmute' : 'mute');\n },\n getColor: colored ? (state) => {\n return state ? [255, 255, 255] : [158, 158, 158];\n } : undefined,\n skipAnimation\n });\n\n this.add({\n name: 'voice_mini',\n parts: [{\n startFrame: 0,\n endFrame: 35,\n name: 'hand-to-muted'\n }, {\n startFrame: 36,\n endFrame: 68,\n name: 'unmute'\n }, {\n startFrame: 69,\n endFrame: 98,\n name: 'mute'\n }, {\n startFrame: 99,\n endFrame: 135,\n name: 'muted-to-hand'\n }, {\n startFrame: 136,\n endFrame: 171,\n name: 'unmuted-to-hand'\n }]\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_SCREEN_SHARING_SUPPORTED from '../../environment/screenSharingSupport';\nimport {IS_MOBILE} from '../../environment/userAgent';\nimport {attachClickEvent} from '../../helpers/dom/clickEvent';\nimport ControlsHover from '../../helpers/dom/controlsHover';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport {addFullScreenListener, cancelFullScreen, isFullScreen, requestFullScreen} from '../../helpers/dom/fullScreen';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport MovablePanel from '../../helpers/movablePanel';\nimport onMediaLoad from '../../helpers/onMediaLoad';\nimport themeController from '../../helpers/themeController';\nimport toggleClassName from '../../helpers/toggleClassName';\nimport CallInstance from '../../lib/calls/callInstance';\nimport CALL_STATE from '../../lib/calls/callState';\nimport I18n, {i18n} from '../../lib/langPack';\nimport wrapEmojiText from '../../lib/richTextProcessor/wrapEmojiText';\nimport animationIntersector from '../animationIntersector';\nimport AvatarElement from '../avatar';\nimport ButtonIcon from '../buttonIcon';\nimport GroupCallMicrophoneIconMini from '../groupCall/microphoneIconMini';\nimport {MovableState} from '../movableElement';\nimport PeerTitle from '../peerTitle';\nimport PopupElement from '../popups';\nimport SetTransition from '../singleTransition';\nimport makeButton from './button';\nimport CallDescriptionElement from './description';\nimport callVideoCanvasBlur from './videoCanvasBlur';\n\nconst className = 'call';\n\nconst MIN_WIDTH = 400;\nconst MIN_HEIGHT = 580;\n\nconst INIT_STATE: MovableState = {\n width: MIN_WIDTH,\n height: MIN_HEIGHT\n};\n\nlet previousState: MovableState = {...INIT_STATE};\n\nexport default class PopupCall extends PopupElement {\n private peerId: PeerId;\n\n private description: CallDescriptionElement;\n private emojisSubtitle: HTMLElement;\n\n private partyStates: HTMLElement;\n private partyMutedState: HTMLElement;\n\n private firstButtonsRow: HTMLElement;\n private secondButtonsRow: HTMLElement;\n\n private declineI18nElement: I18n.IntlElement;\n\n private makeButton: (options: Parameters[2]) => HTMLElement;\n private btnAccept: HTMLElement;\n private btnDecline: HTMLElement;\n private btnVideo: HTMLElement;\n private btnScreen: HTMLElement;\n private btnMute: HTMLElement;\n private btnFullScreen: HTMLButtonElement;\n private btnExitFullScreen: HTMLButtonElement;\n\n private movablePanel: MovablePanel;\n private microphoneIcon: GroupCallMicrophoneIconMini;\n private muteI18nElement: I18n.IntlElement;\n\n private videoContainers: {\n input?: HTMLElement,\n output?: HTMLElement\n };\n\n private controlsHover: ControlsHover;\n\n constructor(private instance: CallInstance) {\n super('popup-call', {\n withoutOverlay: true,\n closable: true\n });\n\n this.videoContainers = {};\n\n const {container, listenerSetter} = this;\n container.classList.add(className, 'night');\n\n const avatarContainer = document.createElement('div');\n avatarContainer.classList.add(className + '-avatar');\n\n const peerId = this.peerId = this.instance.interlocutorUserId.toPeerId();\n const avatar = new AvatarElement();\n avatar.classList.add('avatar-full');\n avatar.updateWithOptions({\n isBig: true,\n peerId: peerId\n });\n avatarContainer.append(avatar);\n\n const title = new PeerTitle({\n peerId\n }).element;\n\n title.classList.add(className + '-title');\n\n const subtitle = document.createElement('div');\n subtitle.classList.add(className + '-subtitle');\n\n const description = this.description = new CallDescriptionElement(subtitle);\n\n const emojisSubtitle = this.emojisSubtitle = document.createElement('div');\n emojisSubtitle.classList.add(className + '-emojis');\n\n container.append(avatarContainer, title, subtitle);\n\n if(!IS_MOBILE) {\n this.btnFullScreen = ButtonIcon('fullscreen');\n this.btnExitFullScreen = ButtonIcon('smallscreen hide');\n attachClickEvent(this.btnFullScreen, this.onFullScreenClick, {listenerSetter});\n attachClickEvent(this.btnExitFullScreen, () => cancelFullScreen(), {listenerSetter});\n addFullScreenListener(this.container, this.onFullScreenChange, listenerSetter);\n this.header.prepend(this.btnExitFullScreen);\n this.header.append(this.btnFullScreen);\n\n container.append(emojisSubtitle);\n } else {\n this.header.append(emojisSubtitle);\n }\n\n this.partyStates = document.createElement('div');\n this.partyStates.classList.add(className + '-party-states');\n\n this.partyMutedState = document.createElement('div');\n this.partyMutedState.classList.add(className + '-party-state');\n const stateText = i18n('VoipUserMicrophoneIsOff', [new PeerTitle({peerId, onlyFirstName: true, limitSymbols: 18}).element]);\n stateText.classList.add(className + '-party-state-text');\n const mutedIcon = new GroupCallMicrophoneIconMini(false, true);\n mutedIcon.setState(false, false);\n this.partyMutedState.append(\n mutedIcon.container,\n stateText\n );\n\n this.partyStates.append(this.partyMutedState);\n this.container.append(this.partyStates);\n\n this.makeButton = makeButton.bind(null, className, this.listenerSetter);\n this.constructFirstButtons();\n this.constructSecondButtons();\n\n listenerSetter.add(instance)('state', () => {\n this.updateInstance();\n });\n\n listenerSetter.add(instance)('mediaState', () => {\n this.updateInstance();\n });\n\n this.movablePanel = new MovablePanel({\n listenerSetter,\n movableOptions: {\n minWidth: MIN_WIDTH,\n minHeight: MIN_HEIGHT,\n element: this.element,\n verifyTouchTarget: (e) => {\n const target = e.target;\n if(findUpClassName(target, 'call-button') ||\n findUpClassName(target, 'btn-icon') ||\n isFullScreen()) {\n return false;\n }\n\n return true;\n }\n },\n // onResize: () => this.toggleBigLayout(),\n previousState: !this.instance.wasTryingToJoin && !this.instance.isOutgoing ? {...INIT_STATE} : previousState\n });\n\n const movableElement = this.movablePanel.movable;\n if(movableElement) {\n this.listenerSetter.add(movableElement)('resize', () => {\n this.resizeVideoContainers();\n });\n }\n\n const controlsHover = this.controlsHover = new ControlsHover();\n controlsHover.setup({\n element: this.container,\n listenerSetter: this.listenerSetter,\n showOnLeaveToClassName: 'call-buttons'\n });\n controlsHover.showControls(false);\n\n this.addEventListener('close', () => {\n const {movablePanel} = this;\n previousState = movablePanel.state;\n\n this.microphoneIcon.destroy();\n\n movablePanel.destroy();\n });\n\n this.updateInstance();\n }\n\n public getCallInstance() {\n return this.instance;\n }\n\n private constructFirstButtons() {\n const buttons = this.firstButtonsRow = document.createElement('div');\n buttons.classList.add(className + '-buttons', 'is-first');\n\n const toggleDisability = toggleClassName.bind(null, 'btn-disabled');\n\n const btnVideo = this.btnVideo = this.makeButton({\n text: 'Call.Camera',\n icon: 'videocamera_filled',\n callback: () => {\n const toggle = toggleDisability([btnVideo, btnScreen], true);\n this.instance.toggleVideoSharing().finally(toggle);\n }\n });\n\n const btnScreen = this.btnScreen = this.makeButton({\n text: 'Call.Screen',\n icon: 'sharescreen_filled',\n callback: () => {\n const toggle = toggleDisability([btnVideo, btnScreen], true);\n this.instance.toggleScreenSharing().finally(toggle);\n }\n });\n\n if(!IS_SCREEN_SHARING_SUPPORTED) {\n btnScreen.classList.add('hide');\n this.container.classList.add('no-screen');\n }\n\n this.muteI18nElement = new I18n.IntlElement({\n key: 'Call.Mute'\n });\n const btnMute = this.btnMute = this.makeButton({\n text: this.muteI18nElement.element,\n callback: () => {\n this.instance.toggleMuted();\n }\n });\n\n const microphoneIcon = this.microphoneIcon = new GroupCallMicrophoneIconMini(true, true);\n btnMute.firstElementChild.append(microphoneIcon.container);\n\n // btnVideo.classList.add('disabled');\n // btnScreen.classList.add('disabled');\n\n buttons.append(btnVideo, btnScreen, btnMute);\n this.container.append(buttons);\n }\n\n private constructSecondButtons() {\n const buttons = this.secondButtonsRow = document.createElement('div');\n buttons.classList.add(className + '-buttons', 'is-second');\n\n this.declineI18nElement = new I18n.IntlElement({\n key: 'Call.Decline'\n });\n const btnDecline = this.btnDecline = this.makeButton({\n text: this.declineI18nElement.element,\n icon: 'endcall_filled',\n callback: () => {\n this.instance.hangUp('phoneCallDiscardReasonHangup');\n },\n isDanger: true\n });\n\n const btnAccept = this.btnAccept = this.makeButton({\n text: 'Call.Accept',\n icon: 'phone_filled',\n callback: () => {\n this.instance.acceptCall();\n },\n isConfirm: true\n });\n\n buttons.append(btnDecline, btnAccept);\n this.container.append(buttons);\n }\n\n private onFullScreenClick = () => {\n requestFullScreen(this.container);\n };\n\n private onFullScreenChange = () => {\n const isFull = isFullScreen();\n\n const {btnFullScreen, btnExitFullScreen} = this;\n\n const wasFullScreen = this.container.classList.contains('is-full-screen');\n this.container.classList.toggle('is-full-screen', isFull);\n btnFullScreen && btnFullScreen.classList.toggle('hide', isFull);\n btnExitFullScreen && btnExitFullScreen.classList.toggle('hide', !isFull);\n this.btnClose.classList.toggle('hide', isFull);\n\n if(isFull !== wasFullScreen) {\n animationIntersector.checkAnimations(isFull);\n\n themeController.setThemeColor(isFull ? '#000000' : undefined);\n\n this.resizeVideoContainers();\n }\n };\n\n private createVideoContainer(video: HTMLVideoElement) {\n const _className = className + '-video';\n const container = document.createElement('div');\n container.classList.add(_className + '-container');\n\n video.classList.add(_className);\n if(video.paused) {\n video.play();\n }\n\n attachClickEvent(container, () => {\n if(!container.classList.contains('small')) {\n return;\n }\n\n const big = Object.values(this.videoContainers).find((container) => !container.classList.contains('small'));\n big.classList.add('small');\n big.style.cssText = container.style.cssText;\n container.classList.remove('small');\n container.style.cssText = '';\n\n this.resizeVideoContainers();\n });\n\n const canvas = callVideoCanvasBlur(video);\n canvas.classList.add(_className + '-blur');\n\n container.append(canvas, video);\n\n return container;\n }\n\n private updateInstance() {\n const {instance} = this;\n const {connectionState} = instance;\n if(connectionState === CALL_STATE.CLOSED) {\n if(this.container.classList.contains('is-full-screen')) {\n cancelFullScreen();\n }\n\n this.btnVideo.classList.add('disabled');\n\n this.hide();\n return;\n }\n\n const isPendingIncoming = !instance.isOutgoing && connectionState === CALL_STATE.PENDING;\n this.declineI18nElement.compareAndUpdate({\n key: connectionState === CALL_STATE.PENDING ? 'Call.Decline' : 'Call.End'\n });\n this.btnAccept.classList.toggle('disable', !isPendingIncoming);\n this.btnAccept.classList.toggle('hide-me', !isPendingIncoming);\n this.container.classList.toggle('two-button-rows', isPendingIncoming);\n\n const isMuted = instance.isMuted;\n const onFrame = () => {\n this.btnMute.firstElementChild.classList.toggle('active', isMuted);\n };\n\n const player = this.microphoneIcon.getItem().player;\n this.microphoneIcon.setState(!isMuted, !isMuted, onFrame);\n if(!player) {\n onFrame();\n }\n\n this.muteI18nElement.compareAndUpdate({\n key: isMuted ? 'VoipUnmute' : 'Call.Mute'\n });\n\n const isSharingVideo = instance.isSharingVideo;\n this.btnVideo.firstElementChild.classList.toggle('active', isSharingVideo);\n\n const isSharingScreen = instance.isSharingScreen;\n this.btnScreen.firstElementChild.classList.toggle('active', isSharingScreen);\n\n const outputState = instance.getMediaState('output');\n\n SetTransition({\n element: this.partyMutedState,\n className: 'is-visible',\n forwards: !!outputState?.muted,\n duration: 300\n });\n\n const containers = this.videoContainers;\n const oldContainers = {...containers};\n ['input' as const, 'output' as const].forEach((type) => {\n const mediaState = instance.getMediaState(type);\n const video = instance.getVideoElement(type) as HTMLVideoElement;\n\n const hasFrame = !!(video && video.videoWidth && video.videoHeight);\n if(video && !hasFrame && !video.dataset.hasPromise) {\n video.dataset.hasPromise = '1';\n // container.classList.add('hide');\n onMediaLoad(video).then(() => {\n delete video.dataset.hasPromise;\n this.updateInstance();\n // this.resizeVideoContainers();\n // container.classList.remove('hide');\n });\n }\n\n const isActive = !!video && hasFrame && !!(mediaState && (mediaState.videoState === 'active' || mediaState.screencastState === 'active'));\n let videoContainer = containers[type];\n\n if(isActive && video && !videoContainer) {\n videoContainer = containers[type] = this.createVideoContainer(video);\n this.container.append(videoContainer);\n }\n\n if(!isActive && videoContainer) {\n videoContainer.remove();\n delete containers[type];\n }\n });\n\n {\n const input = containers.input;\n const output = containers.output;\n if(Object.keys(oldContainers).length !== Object.keys(containers).length && input) {\n input.classList.toggle('small', !!output);\n }\n\n if(output && !input) {\n output.classList.remove('small');\n }\n }\n\n this.resizeVideoContainers();\n\n this.container.classList.toggle('no-video', !Object.keys(containers).length);\n\n if(!this.emojisSubtitle.textContent && connectionState < CALL_STATE.EXCHANGING_KEYS) {\n Promise.resolve(instance.getEmojisFingerprint()).then((emojis) => {\n replaceContent(this.emojisSubtitle, wrapEmojiText(emojis.join('')));\n });\n }\n\n this.setDescription();\n }\n\n private resizeVideoContainers() {\n Object.values(this.videoContainers).forEach((container) => {\n const isSmall = container.classList.contains('small');\n if(isSmall) {\n const video = container.querySelector('video');\n const popupWidth = this.movablePanel.state;\n const MAX_WIDTH_PX = 240;\n const MAX_HEIGHT_PX = 240;\n\n const isVertical = video.videoHeight > video.videoWidth;\n const MAX_SIZE = isVertical ? MAX_HEIGHT_PX : MAX_WIDTH_PX;\n\n const biggestSideSize = 1 / 3 * (isFullScreen() ? 0xFFFF : (isVertical ? popupWidth.height : popupWidth.width));\n const widthRatio = isVertical ? video.videoWidth / video.videoHeight : 1;\n const heightRatio = isVertical ? 1 : video.videoHeight / video.videoWidth;\n container.style.width = biggestSideSize * widthRatio + 'px';\n container.style.height = biggestSideSize * heightRatio + 'px';\n container.style.maxWidth = MAX_SIZE * widthRatio + 'px';\n container.style.maxHeight = MAX_SIZE * heightRatio + 'px';\n } else {\n container.style.cssText = '';\n }\n });\n }\n\n private setDescription() {\n this.description.update(this.instance);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cancelEvent from '../helpers/dom/cancelEvent';\nimport {attachClickEvent} from '../helpers/dom/clickEvent';\nimport ListenerSetter from '../helpers/listenerSetter';\nimport GROUP_CALL_STATE from '../lib/calls/groupCallState';\nimport rootScope from '../lib/rootScope';\nimport ButtonIcon from './buttonIcon';\nimport TopbarWeave from './topbarWeave';\nimport SetTransition from './singleTransition';\nimport PopupGroupCall from './groupCall';\nimport GroupCallDescriptionElement from './groupCall/description';\nimport GroupCallTitleElement from './groupCall/title';\nimport PopupElement from './popups';\nimport throttle from '../helpers/schedulers/throttle';\nimport GroupCallInstance from '../lib/calls/groupCallInstance';\nimport CALL_STATE from '../lib/calls/callState';\nimport replaceContent from '../helpers/dom/replaceContent';\nimport PeerTitle from './peerTitle';\nimport CallDescriptionElement from './call/description';\nimport PopupCall from './call';\nimport GroupCallMicrophoneIconMini from './groupCall/microphoneIconMini';\nimport CallInstance from '../lib/calls/callInstance';\nimport {AppManagers} from '../lib/appManagers/managers';\nimport groupCallsController from '../lib/calls/groupCallsController';\nimport StreamManager from '../lib/calls/streamManager';\nimport callsController from '../lib/calls/callsController';\n\nfunction convertCallStateToGroupState(state: CALL_STATE, isMuted: boolean) {\n switch(state) {\n case CALL_STATE.CLOSING:\n case CALL_STATE.CLOSED:\n return GROUP_CALL_STATE.CLOSED;\n case CALL_STATE.CONNECTED:\n return isMuted ? GROUP_CALL_STATE.MUTED : GROUP_CALL_STATE.UNMUTED;\n default:\n return GROUP_CALL_STATE.CONNECTING;\n }\n}\n\nconst CLASS_NAME = 'topbar-call';\n\nexport default class TopbarCall {\n public container: HTMLElement;\n private listenerSetter: ListenerSetter;\n private weave: TopbarWeave;\n private center: HTMLDivElement;\n private groupCallTitle: GroupCallTitleElement;\n private groupCallDescription: GroupCallDescriptionElement;\n private groupCallMicrophoneIconMini: GroupCallMicrophoneIconMini;\n private callDescription: CallDescriptionElement;\n\n private currentDescription: GroupCallDescriptionElement | CallDescriptionElement;\n\n private instance: GroupCallInstance | any/* CallInstance */;\n private instanceListenerSetter: ListenerSetter;\n\n constructor(\n private managers: AppManagers\n ) {\n const listenerSetter = this.listenerSetter = new ListenerSetter();\n\n listenerSetter.add(callsController)('instance', ({instance}) => {\n if(!this.instance) {\n this.updateInstance(instance);\n }\n });\n\n listenerSetter.add(callsController)('accepting', (instance) => {\n if(this.instance !== instance) {\n this.updateInstance(instance);\n }\n });\n\n listenerSetter.add(groupCallsController)('instance', (instance) => {\n this.updateInstance(instance);\n });\n\n listenerSetter.add(rootScope)('group_call_update', (groupCall) => {\n const instance = groupCallsController.groupCall;\n if(instance?.id === groupCall.id) {\n this.updateInstance(instance);\n }\n });\n\n listenerSetter.add(StreamManager.ANALYSER_LISTENER)('amplitude', ({amplitudes, type}) => {\n const {weave} = this;\n if(!amplitudes.length || !weave/* || type !== 'input' */) return;\n\n let max = 0;\n for(let i = 0; i < amplitudes.length; ++i) {\n const {type, value} = amplitudes[i];\n max = value > max ? value : max;\n }\n\n weave.setAmplitude(max);\n });\n }\n\n private onState = () => {\n this.updateInstance(this.instance);\n };\n\n private clearCurrentInstance() {\n if(!this.instance) return;\n this.center.textContent = '';\n\n if(this.currentDescription) {\n this.currentDescription.detach();\n this.currentDescription = undefined;\n }\n\n this.instance = undefined;\n this.instanceListenerSetter.removeAll();\n }\n\n private updateInstance(instance: TopbarCall['instance']) {\n if(this.construct) {\n this.construct();\n this.construct = undefined;\n }\n\n const isChangingInstance = this.instance !== instance;\n if(isChangingInstance) {\n this.clearCurrentInstance();\n\n this.instance = instance;\n this.instanceListenerSetter = new ListenerSetter();\n\n this.instanceListenerSetter.add(instance as GroupCallInstance)('state', this.onState);\n\n if(instance instanceof GroupCallInstance) {\n this.currentDescription = this.groupCallDescription;\n } else {\n this.currentDescription = this.callDescription;\n this.instanceListenerSetter.add(instance)('muted', this.onState);\n }\n\n this.container.classList.toggle('is-call', !(instance instanceof GroupCallInstance));\n }\n\n const isMuted = this.instance.isMuted;\n const state = instance instanceof GroupCallInstance ? instance.state : convertCallStateToGroupState(instance.connectionState, isMuted);\n\n const {weave} = this;\n\n weave.componentDidMount();\n\n const isClosed = state === GROUP_CALL_STATE.CLOSED;\n if((!document.body.classList.contains('is-calling') || isChangingInstance) || isClosed) {\n if(isClosed) {\n weave.setAmplitude(0);\n }\n\n SetTransition({\n element: document.body,\n className: 'is-calling',\n forwards: !isClosed,\n duration: 250,\n onTransitionEnd: isClosed ? () => {\n weave.componentWillUnmount();\n\n this.clearCurrentInstance();\n } : undefined\n });\n }\n\n if(isClosed) {\n return;\n }\n\n weave.setCurrentState(state, true);\n // if(state === GROUP_CALL_STATE.CONNECTING) {\n // weave.setCurrentState(state, true);\n // } else {\n // /* var a = 0;\n // animate(() => {\n // a += 0.1;\n // if(a > 1) a = 0;\n // weave.setAmplitude(a);\n // return true;\n // });\n // weave.setAmplitude(1); */\n // weave.setCurrentState(state, true);\n // }\n\n this.setTitle(instance);\n this.setDescription(instance);\n this.groupCallMicrophoneIconMini.setState(!isMuted);\n }\n\n private setDescription(instance: TopbarCall['instance']) {\n return this.currentDescription.update(instance as any);\n }\n\n private setTitle(instance: TopbarCall['instance']) {\n if(instance instanceof GroupCallInstance) {\n return this.groupCallTitle.update(instance);\n } else {\n replaceContent(this.center, new PeerTitle({peerId: instance.interlocutorUserId.toPeerId()}).element);\n }\n }\n\n private construct() {\n const {listenerSetter} = this;\n const container = this.container = document.createElement('div');\n container.classList.add('sidebar-header', CLASS_NAME + '-container');\n\n const left = document.createElement('div');\n left.classList.add(CLASS_NAME + '-left');\n\n const groupCallMicrophoneIconMini = this.groupCallMicrophoneIconMini = new GroupCallMicrophoneIconMini();\n\n const mute = ButtonIcon();\n mute.append(groupCallMicrophoneIconMini.container);\n left.append(mute);\n\n const throttledMuteClick = throttle(() => {\n this.instance.toggleMuted();\n }, 600, true);\n\n attachClickEvent(mute, (e) => {\n cancelEvent(e);\n throttledMuteClick();\n }, {listenerSetter});\n\n const center = this.center = document.createElement('div');\n center.classList.add(CLASS_NAME + '-center');\n\n this.groupCallTitle = new GroupCallTitleElement(center);\n this.groupCallDescription = new GroupCallDescriptionElement(left);\n\n this.callDescription = new CallDescriptionElement(left);\n\n const right = document.createElement('div');\n right.classList.add(CLASS_NAME + '-right');\n\n const end = ButtonIcon('endcall_filled');\n right.append(end);\n\n attachClickEvent(end, (e) => {\n cancelEvent(e);\n\n const {instance} = this;\n if(!instance) {\n return;\n }\n\n if(instance instanceof GroupCallInstance) {\n instance.hangUp();\n } else {\n instance.hangUp('phoneCallDiscardReasonHangup');\n }\n }, {listenerSetter});\n\n attachClickEvent(container, () => {\n if(this.instance instanceof GroupCallInstance) {\n if(PopupElement.getPopups(PopupGroupCall).length) {\n return;\n }\n\n new PopupGroupCall().show();\n } else if(this.instance instanceof CallInstance) {\n const popups = PopupElement.getPopups(PopupCall);\n if(popups.find((popup) => popup.getCallInstance() === this.instance)) {\n return;\n }\n\n new PopupCall(this.instance).show();\n }\n }, {listenerSetter});\n\n container.append(left, center, right);\n\n const weave = this.weave = new TopbarWeave();\n const weaveContainer = weave.render(CLASS_NAME + '-weave');\n container.prepend(weaveContainer);\n\n document.getElementById('column-center').prepend(container);\n weave.componentDidMount();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {PushNotificationObject} from '../serviceWorker/push';\nimport getPeerTitle from '../../components/wrappers/getPeerTitle';\nimport wrapMessageForReply from '../../components/wrappers/messageForReply';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport {FontFamily} from '../../config/font';\nimport {NOTIFICATION_BADGE_PATH, NOTIFICATION_ICON_PATH} from '../../config/notifications';\nimport {IS_MOBILE} from '../../environment/userAgent';\nimport IS_VIBRATE_SUPPORTED from '../../environment/vibrateSupport';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport drawCircle from '../../helpers/canvas/drawCircle';\nimport customProperties from '../../helpers/dom/customProperties';\nimport idleController from '../../helpers/idleController';\nimport deepEqual from '../../helpers/object/deepEqual';\nimport tsNow from '../../helpers/tsNow';\nimport {Message, MessagePeerReaction, PeerNotifySettings} from '../../layer';\nimport I18n, {FormatterArguments, LangPackKey} from '../langPack';\nimport apiManagerProxy from '../mtproto/mtprotoworker';\nimport singleInstance from '../mtproto/singleInstance';\nimport webPushApiManager, {PushSubscriptionNotify} from '../mtproto/webPushApiManager';\nimport fixEmoji from '../richTextProcessor/fixEmoji';\nimport getAbbreviation from '../richTextProcessor/getAbbreviation';\nimport wrapPlainText from '../richTextProcessor/wrapPlainText';\nimport rootScope from '../rootScope';\nimport appImManager from './appImManager';\nimport appRuntimeManager from './appRuntimeManager';\nimport {AppManagers} from './managers';\nimport generateMessageId from './utils/messageId/generateMessageId';\nimport getMessageThreadId from './utils/messages/getMessageThreadId';\nimport getPeerColorById from './utils/peers/getPeerColorById';\nimport getPeerId from './utils/peers/getPeerId';\nimport {logger} from '../logger';\n\ntype MyNotification = Notification & {\n hidden?: boolean,\n show?: () => void,\n};\n\nexport type NotifyOptions = Partial<{\n tag: string;\n image: string;\n key: string;\n title: string;\n message: string;\n silent: boolean;\n onclick: () => void;\n noIncrement: boolean;\n}>;\n\nexport type NotificationSettings = {\n nodesktop: boolean,\n volume: number,\n novibrate: boolean,\n nopreview: boolean,\n nopush: boolean,\n nosound: boolean\n};\n\nexport class UiNotificationsManager {\n private notificationsUiSupport: boolean;\n private notificationsShown: {[key: string]: MyNotification | true} = {};\n private notificationIndex = 0;\n private notificationsCount = 0;\n private soundsPlayed: {[tag: string]: number} = {};\n private vibrateSupport = IS_VIBRATE_SUPPORTED;\n private nextSoundAt: number;\n private prevSoundVolume: number;\n\n private faviconElements = Array.from(document.head.querySelectorAll('link[rel=\"icon\"], link[rel=\"alternate icon\"]'));\n\n private titleBackup = document.title;\n private titleChanged = false;\n private titleInterval: number;\n private prevFavicon: string;\n\n private notifySoundEl: HTMLElement;\n\n private stopped = false;\n\n private topMessagesDeferred: CancellablePromise;\n\n private settings: NotificationSettings = {} as any;\n\n private registeredDevice: any;\n private pushInited = false;\n\n private managers: AppManagers;\n private setAppBadge: (contents?: any) => Promise;\n\n private avatarCanvas: HTMLCanvasElement;\n private avatarContext: CanvasRenderingContext2D;\n private avatarGradients: {[color: string]: CanvasGradient};\n\n private log: ReturnType;\n\n construct(managers: AppManagers) {\n this.managers = managers;\n\n this.log = logger('NOTIFICATIONS');\n\n navigator.vibrate = navigator.vibrate || (navigator as any).mozVibrate || (navigator as any).webkitVibrate;\n this.setAppBadge = (navigator as any).setAppBadge && (navigator as any).setAppBadge.bind(navigator);\n this.setAppBadge && this.setAppBadge(0);\n\n this.notificationsUiSupport = ('Notification' in window) || ('mozNotification' in navigator);\n\n this.notifySoundEl = document.createElement('div');\n this.notifySoundEl.id = 'notify-sound';\n document.body.append(this.notifySoundEl);\n\n this.topMessagesDeferred = deferredPromise();\n\n singleInstance.addEventListener('deactivated', () => {\n this.stop();\n });\n\n singleInstance.addEventListener('activated', () => {\n if(this.stopped) {\n this.start();\n }\n });\n\n idleController.addEventListener('change', (idle) => {\n if(this.stopped) {\n return;\n }\n\n if(!idle) {\n this.clear();\n }\n\n this.toggleToggler();\n });\n\n rootScope.addEventListener('notification_reset', (peerString) => {\n this.soundReset(peerString);\n });\n\n rootScope.addEventListener('notification_cancel', (str) => {\n this.cancel(str);\n });\n\n if(this.setAppBadge) {\n rootScope.addEventListener('folder_unread', (folder) => {\n if(folder.id === 0) {\n this.setAppBadge(folder.unreadUnmutedPeerIds.size);\n }\n });\n }\n\n webPushApiManager.addEventListener('push_init', (tokenData) => {\n this.pushInited = true;\n if(!this.settings.nodesktop && !this.settings.nopush) {\n if(tokenData) {\n this.registerDevice(tokenData);\n } else {\n webPushApiManager.subscribe();\n }\n } else {\n this.unregisterDevice(tokenData);\n }\n });\n webPushApiManager.addEventListener('push_subscribe', (tokenData) => {\n this.registerDevice(tokenData);\n });\n webPushApiManager.addEventListener('push_unsubscribe', (tokenData) => {\n this.unregisterDevice(tokenData);\n });\n\n rootScope.addEventListener('dialogs_multiupdate', () => {\n // unregisterTopMsgs()\n this.topMessagesDeferred.resolve();\n }, {once: true});\n\n webPushApiManager.addEventListener('push_notification_click', (notificationData) => {\n if(notificationData.action === 'push_settings') {\n /* this.topMessagesDeferred.then(() => {\n $modal.open({\n templateUrl: templateUrl('settings_modal'),\n controller: 'SettingsModalController',\n windowClass: 'settings_modal_window mobile_modal',\n backdrop: 'single'\n })\n }); */\n return;\n }\n\n if(notificationData.action === 'mute1d') {\n this.managers.apiManager.invokeApi('account.updateDeviceLocked', {\n period: 86400\n }).then(() => {\n // var toastData = toaster.pop({\n // type: 'info',\n // body: _('push_action_mute1d_success'),\n // bodyOutputType: 'trustedHtml',\n // clickHandler: () => {\n // toaster.clear(toastData)\n // },\n // showCloseButton: false\n // })\n });\n\n return;\n }\n\n const peerId = notificationData.custom && notificationData.custom.peerId.toPeerId();\n console.log('click', notificationData, peerId);\n if(peerId) {\n this.topMessagesDeferred.then(async() => {\n const chatId = peerId.isAnyChat() ? peerId.toChatId() : undefined;\n if(chatId && !(await this.managers.appChatsManager.hasChat(chatId))) {\n return;\n }\n\n if(peerId.isUser() && !(await this.managers.appUsersManager.hasUser(peerId.toUserId()))) {\n return;\n }\n\n appImManager.setInnerPeer({\n peerId,\n lastMsgId: generateMessageId(+notificationData.custom.msg_id)\n });\n });\n }\n });\n }\n\n public async buildNotification({\n message,\n fwdCount,\n peerReaction,\n peerTypeNotifySettings\n }: {\n message: Message.message | Message.messageService,\n fwdCount?: number,\n peerReaction?: MessagePeerReaction,\n peerTypeNotifySettings?: PeerNotifySettings\n }) {\n const peerId = message.peerId;\n const isAnyChat = peerId.isAnyChat();\n const notification: NotifyOptions = {};\n const [peerString, isForum = false] = await Promise.all([\n this.managers.appPeersManager.getPeerString(peerId),\n isAnyChat && this.managers.appPeersManager.isForum(peerId)\n ]);\n let notificationMessage: string;\n let wrappedMessage = false;\n\n if(peerTypeNotifySettings.show_previews) {\n if(message._ === 'message' && message.fwd_from && fwdCount > 1) {\n notificationMessage = I18n.format('Notifications.Forwarded', true, [fwdCount]);\n } else {\n notificationMessage = await wrapMessageForReply({message, plain: true});\n\n const reaction = peerReaction?.reaction;\n if(reaction?._ === 'reactionEmoji') {\n const langPackKey: LangPackKey = /* isAnyChat ? 'Notification.Group.Reacted' : */'Notification.Contact.Reacted';\n const args: FormatterArguments = [\n fixEmoji(reaction.emoticon), // can be plain heart\n notificationMessage\n ];\n\n /* if(isAnyChat) {\n args.unshift(appPeersManager.getPeerTitle(message.fromId, true));\n } */\n\n notificationMessage = I18n.format(langPackKey, true, args);\n } else {\n wrappedMessage = true;\n }\n }\n } else {\n notificationMessage = I18n.format('Notifications.New', true);\n }\n\n if(peerReaction) {\n notification.noIncrement = true;\n notification.silent = true;\n }\n\n const peerTitleOptions/* : Partial[0]> */ = {\n plainText: true as const,\n managers: this.managers\n };\n\n const threadId = isForum ? getMessageThreadId(message, isForum) : undefined;\n const notificationFromPeerId = peerReaction ? getPeerId(peerReaction.peer_id) : message.fromId;\n const peerTitle = notification.title = await getPeerTitle({...peerTitleOptions, peerId, threadId: threadId});\n if(isForum) {\n const peerTitle = await getPeerTitle({...peerTitleOptions, peerId});\n notification.title += ` (${peerTitle})`;\n\n if(wrappedMessage && notificationFromPeerId !== message.peerId) {\n notificationMessage = await getPeerTitle({...peerTitleOptions, peerId: notificationFromPeerId}) +\n ': ' + notificationMessage;\n }\n } else if(isAnyChat && notificationFromPeerId !== message.peerId) {\n notification.title = await getPeerTitle({...peerTitleOptions, peerId: notificationFromPeerId}) +\n ' @ ' +\n notification.title;\n }\n\n notification.title = wrapPlainText(notification.title);\n\n notification.onclick = () => {\n appImManager.setInnerPeer({peerId, lastMsgId: message.mid, threadId});\n };\n\n notification.message = notificationMessage;\n notification.key = 'msg' + message.mid;\n notification.tag = peerString;\n notification.silent = true;// message.pFlags.silent || false;\n\n const peerPhoto = await this.managers.appPeersManager.getPeerPhoto(peerId);\n if(peerPhoto) {\n const url = await this.managers.appAvatarsManager.loadAvatar(peerId, peerPhoto, 'photo_small');\n\n if(!peerReaction) { // ! WARNING, message can be already read\n message = await this.managers.appMessagesManager.getMessageByPeer(message.peerId, message.mid);\n if(!message || !message.pFlags.unread) return;\n }\n\n notification.image = url;\n } else {\n let {avatarCanvas, avatarContext} = this;\n if(!this.avatarCanvas) {\n avatarCanvas = this.avatarCanvas = document.createElement('canvas');\n avatarContext = this.avatarContext = avatarCanvas.getContext('2d');\n\n const SIZE = 54;\n const dpr = 1;\n avatarCanvas.dpr = dpr;\n avatarCanvas.width = avatarCanvas.height = SIZE * dpr;\n\n this.avatarGradients = {};\n } else {\n avatarContext.clearRect(0, 0, avatarCanvas.width, avatarCanvas.height);\n }\n\n const color = getPeerColorById(peerId, true);\n let gradient = this.avatarGradients[color];\n if(!gradient) {\n gradient = this.avatarGradients[color] = avatarContext.createLinearGradient(avatarCanvas.width / 2, 0, avatarCanvas.width / 2, avatarCanvas.height);\n\n const colorTop = customProperties.getProperty(`peer-avatar-${color}-top`);\n const colorBottom = customProperties.getProperty(`peer-avatar-${color}-bottom`);\n gradient.addColorStop(0, colorTop);\n gradient.addColorStop(1, colorBottom);\n }\n\n avatarContext.fillStyle = gradient;\n\n drawCircle(avatarContext, avatarCanvas.width / 2, avatarCanvas.height / 2, avatarCanvas.width / 2);\n avatarContext.fill();\n\n const fontSize = 20 * avatarCanvas.dpr;\n const abbreviation = getAbbreviation(peerTitle);\n\n avatarContext.font = `700 ${fontSize}px ${FontFamily}`;\n avatarContext.textBaseline = 'middle';\n avatarContext.textAlign = 'center';\n avatarContext.fillStyle = 'white';\n avatarContext.fillText(abbreviation.text, avatarCanvas.width / 2, avatarCanvas.height * (window.devicePixelRatio > 1 || true ? .5625 : .5));\n\n notification.image = avatarCanvas.toDataURL();\n }\n\n const pushData: PushNotificationObject = {\n custom: {\n msg_id: '' + message.mid,\n peerId: '' + peerId\n },\n description: '',\n loc_key: '',\n loc_args: [],\n mute: '',\n random_id: 0,\n title: ''\n };\n\n const result = await this.notify(notification, pushData);\n if(result && this.registeredDevice) {\n webPushApiManager.ignorePushByMid(peerId, message.mid);\n }\n }\n\n private toggleToggler(enable = idleController.isIdle) {\n if(IS_MOBILE) return;\n\n const resetTitle = (isBlink?: boolean) => {\n this.titleChanged = false;\n document.title = this.titleBackup;\n this.setFavicon();\n };\n\n window.clearInterval(this.titleInterval);\n this.titleInterval = 0;\n\n if(!enable) {\n resetTitle();\n } else {\n this.titleInterval = window.setInterval(() => {\n const count = this.notificationsCount;\n if(!count) {\n this.toggleToggler(false);\n } else if(this.titleChanged) {\n resetTitle(true);\n } else {\n this.titleChanged = true;\n document.title = I18n.format('Notifications.Count', true, [count]);\n // this.setFavicon('assets/img/favicon_unread.ico');\n\n // fetch('assets/img/favicon.ico')\n // .then((res) => res.blob())\n // .then((blob) => {\n // const img = document.createElement('img');\n // img.src = URL.createObjectURL(blob);\n\n const canvas = document.createElement('canvas');\n canvas.width = 32 * window.devicePixelRatio;\n canvas.height = canvas.width;\n\n const ctx = canvas.getContext('2d');\n ctx.beginPath();\n ctx.arc(canvas.width / 2, canvas.height / 2, canvas.width / 2, 0, 2 * Math.PI, false);\n ctx.fillStyle = '#3390ec';\n ctx.fill();\n\n let fontSize = 24;\n let str = '' + count;\n if(count < 10) {\n fontSize = 22;\n } else if(count < 100) {\n fontSize = 20;\n } else {\n str = '99+';\n fontSize = 16;\n }\n\n fontSize *= window.devicePixelRatio;\n\n ctx.font = `700 ${fontSize}px ${FontFamily}`;\n ctx.textBaseline = 'middle';\n ctx.textAlign = 'center';\n ctx.fillStyle = 'white';\n ctx.fillText(str, canvas.width / 2, canvas.height * .5625);\n\n /* const ctx = canvas.getContext('2d');\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height); */\n\n this.setFavicon(canvas.toDataURL());\n // });\n }\n }, 1000);\n }\n }\n\n private setFavicon(href?: string) {\n if(this.prevFavicon === href) {\n return;\n }\n\n this.prevFavicon = href;\n this.faviconElements.forEach((element, idx, arr) => {\n const link = element.cloneNode() as HTMLLinkElement;\n\n link.dataset.href ||= link.href;\n\n href ??= link.dataset.href;\n link.href = href;\n element.replaceWith(arr[idx] = link);\n });\n }\n\n public async notify(data: NotifyOptions, pushData: PushNotificationObject) {\n this.log('notify', data, idleController.isIdle, this.notificationsUiSupport, this.stopped);\n\n if(this.stopped) {\n return;\n }\n\n data.image ||= NOTIFICATION_ICON_PATH;\n\n if(!data.noIncrement) {\n ++this.notificationsCount;\n }\n\n if(!this.titleInterval) {\n this.toggleToggler();\n }\n\n const idx = ++this.notificationIndex;\n const key = data.key || 'k' + idx;\n this.notificationsShown[key] = true;\n\n const now = tsNow();\n if(this.settings.volume > 0 && !this.settings.nosound/* &&\n (\n !data.tag ||\n !this.soundsPlayed[data.tag] ||\n now > this.soundsPlayed[data.tag] + 60000\n ) */\n ) {\n this.testSound(this.settings.volume);\n this.soundsPlayed[data.tag] = now;\n }\n\n if(!this.notificationsUiSupport ||\n 'Notification' in window && Notification.permission !== 'granted') {\n return;\n }\n\n if(this.settings.nodesktop) {\n if(this.vibrateSupport && !this.settings.novibrate) {\n navigator.vibrate([200, 100, 200]);\n return;\n }\n\n return;\n }\n\n if(!('Notification' in window)) {\n return;\n }\n\n let notification: MyNotification;\n\n const notificationOptions: NotificationOptions = {\n badge: NOTIFICATION_BADGE_PATH,\n icon: data.image || '',\n body: data.message || '',\n tag: data.tag || '',\n silent: data.silent || false,\n data: pushData\n };\n\n try {\n if(data.tag) {\n for(const i in this.notificationsShown) {\n const notification = this.notificationsShown[i];\n if(typeof(notification) !== 'boolean' && notification.tag === data.tag) {\n notification.hidden = true;\n }\n }\n }\n\n // throw new Error('test');\n notification = new Notification(data.title, notificationOptions);\n } catch(e) {\n try {\n const registration = await navigator.serviceWorker.ready;\n await registration.showNotification(data.title, notificationOptions);\n const notifications = await registration.getNotifications({tag: notificationOptions.tag});\n notification = notifications[notifications.length - 1];\n } catch(err) {\n this.log.error('creating push error', err, data, notificationOptions);\n }\n\n if(!notification) {\n this.notificationsUiSupport = false;\n webPushApiManager.setLocalNotificationsDisabled();\n return;\n }\n }\n\n notification.onclick = () => {\n this.log('notification onclick');\n notification.close();\n appRuntimeManager.focus();\n this.clear();\n data.onclick?.();\n };\n\n notification.onclose = () => {\n this.log('notification onclose');\n if(!notification.hidden) {\n delete this.notificationsShown[key];\n this.clear();\n }\n };\n\n notification.show?.();\n this.notificationsShown[key] = notification;\n\n if(!IS_MOBILE) {\n setTimeout(() => {\n this.hide(key);\n }, 8000);\n }\n\n return true;\n }\n\n public updateLocalSettings = () => {\n const keys = ['notify_nodesktop', 'notify_volume', 'notify_novibrate', 'notify_nopreview', 'notify_nopush'];\n const promises = keys.map(() => undefined);\n // const promises = keys.map((k) => stateStorage.get(k as any));\n Promise.all(promises)\n .then((updSettings) => {\n this.settings.nodesktop = updSettings[0];\n this.settings.volume = updSettings[1] === undefined ? 0.5 : updSettings[1];\n this.settings.novibrate = updSettings[2];\n this.settings.nopreview = updSettings[3];\n this.settings.nopush = updSettings[4];\n\n if(this.pushInited) {\n const needPush = !this.settings.nopush && !this.settings.nodesktop && webPushApiManager.isAvailable || false;\n const hasPush = this.registeredDevice !== false;\n if(needPush !== hasPush) {\n if(needPush) {\n webPushApiManager.subscribe();\n } else {\n webPushApiManager.unsubscribe();\n }\n }\n }\n\n webPushApiManager.setSettings(this.settings);\n });\n\n apiManagerProxy.getState().then((state) => {\n this.settings.nosound = !state.settings.notifications.sound;\n });\n }\n\n public getLocalSettings() {\n return this.settings;\n }\n\n private hide(key: string) {\n const notification = this.notificationsShown[key];\n if(notification) {\n this.closeNotification(notification);\n }\n }\n\n public soundReset(tag: string) {\n delete this.soundsPlayed[tag];\n }\n\n private requestPermission = () => {\n Notification.requestPermission();\n window.removeEventListener('click', this.requestPermission);\n };\n\n public testSound(volume: number) {\n const now = tsNow();\n if(this.nextSoundAt && now < this.nextSoundAt && this.prevSoundVolume === volume) {\n return;\n }\n\n this.nextSoundAt = now + 1000;\n this.prevSoundVolume = volume;\n const filename = 'assets/audio/notification.mp3';\n const audio = document.createElement('audio');\n audio.autoplay = true;\n audio.setAttribute('mozaudiochannel', 'notification');\n audio.volume = volume;\n audio.innerHTML = `\n \n \n `;\n this.notifySoundEl.append(audio);\n\n audio.addEventListener('ended', () => {\n audio.remove();\n }, {once: true});\n }\n\n public cancel(key: string) {\n const notification = this.notificationsShown[key];\n this.log('cancel', key, notification);\n if(notification) {\n if(this.notificationsCount > 0) {\n --this.notificationsCount;\n }\n\n this.closeNotification(notification);\n delete this.notificationsShown[key];\n }\n }\n\n private closeNotification(notification: boolean | MyNotification) {\n try {\n if(typeof(notification) !== 'boolean' && notification.close) {\n this.log('close notification', notification);\n notification.hidden = true;\n notification.close();\n }\n } catch(e) {}\n }\n\n public clear() {\n this.log.warn('clear');\n\n for(const i in this.notificationsShown) {\n const notification = this.notificationsShown[i];\n this.closeNotification(notification);\n }\n\n this.notificationsShown = {};\n this.notificationsCount = 0;\n\n webPushApiManager.hidePushNotifications();\n }\n\n public start() {\n this.log('start');\n\n this.updateLocalSettings();\n rootScope.addEventListener('settings_updated', this.updateLocalSettings);\n webPushApiManager.start();\n\n if(!this.notificationsUiSupport) {\n return false;\n }\n\n if('Notification' in window && Notification.permission !== 'granted' && Notification.permission !== 'denied') {\n window.addEventListener('click', this.requestPermission);\n }\n\n try {\n if('onbeforeunload' in window) {\n window.addEventListener('beforeunload', this.clear);\n }\n } catch(e) {}\n }\n\n private stop() {\n this.log('stop');\n\n this.clear();\n window.clearInterval(this.titleInterval);\n this.titleInterval = 0;\n this.setFavicon();\n this.stopped = true;\n }\n\n private registerDevice(tokenData: PushSubscriptionNotify) {\n if(this.registeredDevice && deepEqual(this.registeredDevice, tokenData)) {\n return false;\n }\n\n this.managers.apiManager.invokeApi('account.registerDevice', {\n token_type: tokenData.tokenType,\n token: tokenData.tokenValue,\n other_uids: [],\n app_sandbox: false,\n secret: new Uint8Array()\n }).then(() => {\n this.log('registered device');\n this.registeredDevice = tokenData;\n }, (error) => {\n error.handled = true;\n });\n }\n\n private unregisterDevice(tokenData: PushSubscriptionNotify) {\n if(!this.registeredDevice) {\n return false;\n }\n\n this.managers.apiManager.invokeApi('account.unregisterDevice', {\n token_type: tokenData.tokenType,\n token: tokenData.tokenValue,\n other_uids: []\n }).then(() => {\n this.registeredDevice = false;\n }, (error) => {\n error.handled = true;\n });\n }\n}\n\nconst uiNotificationsManager = new UiNotificationsManager();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.uiNotificationsManager = uiNotificationsManager);\nexport default uiNotificationsManager;\n","export const NOTIFICATION_ICON_PATH = 'assets/img/logo_filled_rounded.png';\nexport const NOTIFICATION_BADGE_PATH = 'assets/img/logo_plain.svg'; // masked\n","export default async function getFilesFromEvent(e: ClipboardEvent | DragEvent, onlyTypes = false): Promise {\n const files: any[] = [];\n\n const scanFiles = async(entry: any, item: DataTransferItem) => {\n if(entry.isDirectory) {\n const directoryReader = entry.createReader();\n await new Promise((resolve, reject) => {\n directoryReader.readEntries(async(entries: any) => {\n for(const entry of entries) {\n await scanFiles(entry, item);\n }\n\n resolve();\n });\n });\n } else if(entry) {\n if(onlyTypes) {\n files.push(entry.type);\n } else {\n const itemFile = item.getAsFile(); // * Safari can't handle entry.file with pasting\n const file = entry instanceof File ?\n entry :\n (\n entry instanceof DataTransferItem ?\n entry.getAsFile() :\n await new Promise((resolve, reject) => entry.file(resolve, (err: any) => resolve(itemFile)))\n );\n\n /* if(!onlyTypes) {\n console.log('getFilesFromEvent: got file', item, file);\n } */\n\n if(!file) return;\n files.push(file);\n }\n }\n };\n\n if(e instanceof DragEvent && e.dataTransfer.files && !e.dataTransfer.items) {\n for(let i = 0; i < e.dataTransfer.files.length; i++) {\n const file = e.dataTransfer.files[i];\n files.push(onlyTypes ? file.type : file);\n }\n } else {\n // @ts-ignore\n const items = (e.dataTransfer || e.clipboardData || e.originalEvent.clipboardData).items;\n\n const promises: Promise[] = [];\n for(let i = 0; i < items.length; ++i) {\n const item: DataTransferItem = items[i];\n if(item.kind === 'file') {\n const entry = (onlyTypes ? item : item.webkitGetAsEntry()) || item.getAsFile();\n promises.push(scanFiles(entry, item));\n }\n }\n\n await Promise.all(promises);\n }\n\n /* if(!onlyTypes) {\n console.log('getFilesFromEvent: got files:', e, files);\n } */\n\n return files;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {T_ME_PREFIXES} from '../lib/mtproto/mtproto_config';\nimport cancelEvent from './dom/cancelEvent';\nimport parseUriParams from './string/parseUriParams';\n\nexport default function addAnchorListener(options: {\n name: 'showMaskedAlert' | 'execBotCommand' | 'searchByHashtag' | 'addstickers' | 'im' |\n 'resolve' | 'privatepost' | 'addstickers' | 'voicechat' | 'joinchat' | 'join' | 'invoice' |\n 'addemoji' | 'setMediaTimestamp',\n protocol?: 'tg',\n callback: (params: Params, element?: HTMLAnchorElement) => boolean | any,\n noPathnameParams?: boolean,\n noUriParams?: boolean,\n noCancelEvent?: boolean\n}) {\n (window as any)[(options.protocol ? options.protocol + '_' : '') + options.name] = (element?: HTMLAnchorElement/* , e: Event */) => {\n !options.noCancelEvent && cancelEvent(null);\n\n let href = element.href;\n let pathnameParams: any[];\n let uriParams: any;\n\n const u = new URL(href);\n const match = u.host.match(/(.+?)\\.t(?:elegram)?\\.me/);\n if(match && !T_ME_PREFIXES.has(match[1])) {\n u.pathname = match[1] + (u.pathname === '/' ? '' : u.pathname);\n href = u.toString();\n }\n\n if(!options.noPathnameParams) pathnameParams = new URL(href).pathname.split('/').slice(1);\n if(!options.noUriParams) uriParams = parseUriParams(href);\n\n const res = options.callback({pathnameParams, uriParams} as Params, element);\n return res === undefined ? res : false;\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {GroupCallId, MyGroupCall} from './appGroupCallsManager';\nimport type GroupCallInstance from '../calls/groupCallInstance';\nimport type CallInstance from '../calls/callInstance';\nimport animationIntersector, {AnimationItemGroup} from '../../components/animationIntersector';\nimport appSidebarLeft, {LEFT_COLUMN_ACTIVE_CLASSNAME} from '../../components/sidebarLeft';\nimport appSidebarRight, {RIGHT_COLUMN_ACTIVE_CLASSNAME} from '../../components/sidebarRight';\nimport mediaSizes, {ScreenSize} from '../../helpers/mediaSizes';\nimport {logger, LogTypes} from '../logger';\nimport rootScope from '../rootScope';\nimport Chat, {ChatType} from '../../components/chat/chat';\nimport PopupNewMedia, {getCurrentNewMediaPopup} from '../../components/popups/newMedia';\nimport MarkupTooltip from '../../components/chat/markupTooltip';\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport SetTransition from '../../components/singleTransition';\nimport ChatDragAndDrop from '../../components/chat/dragAndDrop';\nimport {doubleRaf} from '../../helpers/schedulers';\nimport lottieLoader from '../rlottie/lottieLoader';\nimport useHeavyAnimationCheck, {dispatchHeavyAnimationEvent} from '../../hooks/useHeavyAnimationCheck';\nimport stateStorage from '../stateStorage';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport appNavigationController from '../../components/appNavigationController';\nimport AppPrivateSearchTab from '../../components/sidebarRight/tabs/search';\nimport I18n, {i18n, join, LangPackKey} from '../langPack';\nimport {ChatFull, ChatInvite, ChatParticipant, ChatParticipants, Message, MessageAction, MessageMedia, SendMessageAction, User, Chat as MTChat, UrlAuthResult, WallPaper} from '../../layer';\nimport PeerTitle from '../../components/peerTitle';\nimport PopupPeer, {PopupPeerCheckboxOptions} from '../../components/popups/peer';\nimport blurActiveElement from '../../helpers/dom/blurActiveElement';\nimport cancelEvent from '../../helpers/dom/cancelEvent';\nimport disableTransition from '../../helpers/dom/disableTransition';\nimport placeCaretAtEnd from '../../helpers/dom/placeCaretAtEnd';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport whichChild from '../../helpers/dom/whichChild';\nimport PopupElement from '../../components/popups';\nimport singleInstance, {InstanceDeactivateReason, SingleInstance} from '../mtproto/singleInstance';\nimport PopupStickers from '../../components/popups/stickers';\nimport PopupJoinChatInvite from '../../components/popups/joinChatInvite';\nimport {toast, toastNew} from '../../components/toast';\nimport debounce from '../../helpers/schedulers/debounce';\nimport pause from '../../helpers/schedulers/pause';\nimport {InternalLink, InternalLinkTypeMap, INTERNAL_LINK_TYPE} from './internalLink';\nimport MEDIA_MIME_TYPES_SUPPORTED from '../../environment/mediaMimeTypesSupport';\nimport IMAGE_MIME_TYPES_SUPPORTED from '../../environment/imageMimeTypesSupport';\nimport {NULL_PEER_ID} from '../mtproto/mtproto_config';\nimport telegramMeWebManager from '../mtproto/telegramMeWebManager';\nimport {ONE_DAY} from '../../helpers/date';\nimport TopbarCall from '../../components/topbarCall';\nimport confirmationPopup from '../../components/confirmationPopup';\nimport IS_GROUP_CALL_SUPPORTED from '../../environment/groupCallSupport';\nimport IS_CALL_SUPPORTED from '../../environment/callSupport';\nimport {CallType} from '../calls/types';\nimport {Modify, SendMessageEmojiInteractionData} from '../../types';\nimport htmlToSpan from '../../helpers/dom/htmlToSpan';\nimport getVisibleRect from '../../helpers/dom/getVisibleRect';\nimport {simulateClickEvent} from '../../helpers/dom/clickEvent';\nimport PopupCall from '../../components/call';\nimport copy from '../../helpers/object/copy';\nimport getObjectKeysAndSort from '../../helpers/object/getObjectKeysAndSort';\nimport numberThousandSplitter from '../../helpers/number/numberThousandSplitter';\nimport ChatBackgroundPatternRenderer from '../../components/chat/patternRenderer';\nimport {IS_FIREFOX} from '../../environment/userAgent';\nimport compareVersion from '../../helpers/compareVersion';\nimport {AppManagers} from './managers';\nimport uiNotificationsManager from './uiNotificationsManager';\nimport appMediaPlaybackController from '../../components/appMediaPlaybackController';\nimport {PHONE_NUMBER_REG_EXP} from '../richTextProcessor';\nimport wrapEmojiText from '../richTextProcessor/wrapEmojiText';\nimport wrapRichText, {CustomEmojiRendererElement, renderEmojis} from '../richTextProcessor/wrapRichText';\nimport wrapUrl from '../richTextProcessor/wrapUrl';\nimport generateMessageId from './utils/messageId/generateMessageId';\nimport getUserStatusString from '../../components/wrappers/getUserStatusString';\nimport getChatMembersString from '../../components/wrappers/getChatMembersString';\nimport {STATE_INIT} from '../../config/state';\nimport CacheStorageController from '../files/cacheStorage';\nimport themeController from '../../helpers/themeController';\nimport overlayCounter from '../../helpers/overlayCounter';\nimport appDialogsManager from './appDialogsManager';\nimport idleController from '../../helpers/idleController';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport {AckedResult} from '../mtproto/superMessagePort';\nimport groupCallsController from '../calls/groupCallsController';\nimport callsController from '../calls/callsController';\nimport getFilesFromEvent from '../../helpers/files/getFilesFromEvent';\nimport apiManagerProxy from '../mtproto/mtprotoworker';\nimport appRuntimeManager from './appRuntimeManager';\nimport paymentsWrapCurrencyAmount from '../../helpers/paymentsWrapCurrencyAmount';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport {CLICK_EVENT_NAME} from '../../helpers/dom/clickEvent';\nimport PopupPayment from '../../components/popups/payment';\nimport wrapPeerTitle from '../../components/wrappers/peerTitle';\nimport NBSP from '../../helpers/string/nbsp';\nimport {makeMediaSize, MediaSize} from '../../helpers/mediaSize';\nimport {MiddleEllipsisElement} from '../../components/middleEllipsis';\nimport addAnchorListener from '../../helpers/addAnchorListener';\nimport parseUriParams from '../../helpers/string/parseUriParams';\nimport getMessageThreadId from './utils/messages/getMessageThreadId';\nimport findUpTag from '../../helpers/dom/findUpTag';\nimport {MTAppConfig} from '../mtproto/appConfig';\nimport PopupForward from '../../components/popups/forward';\nimport AppBackgroundTab from '../../components/sidebarLeft/tabs/background';\nimport partition from '../../helpers/array/partition';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport liteMode, {LiteModeKey} from '../../helpers/liteMode';\nimport RLottiePlayer from '../rlottie/rlottiePlayer';\n\nexport type ChatSavedPosition = {\n mids: number[],\n top: number\n};\n\nexport type ChatSetPeerOptions = {\n peerId: PeerId,\n lastMsgId?: number,\n threadId?: number,\n startParam?: string,\n stack?: number,\n commentId?: number,\n type?: ChatType,\n mediaTimestamp?: number\n};\n\nexport type ChatSetInnerPeerOptions = Modify;\n\nexport enum APP_TABS {\n CHATLIST,\n CHAT,\n PROFILE\n}\n\nexport class AppImManager extends EventListenerBase<{\n chat_changing: (details: {from: Chat, to: Chat}) => void,\n peer_changed: (chat: Chat) => void,\n peer_changing: (chat: Chat) => void,\n tab_changing: (tabId: number) => void\n}> {\n public columnEl = document.getElementById('column-center') as HTMLDivElement;\n public chatsContainer: HTMLElement;\n\n public offline = false;\n public updateStatusInterval = 0;\n\n public log: ReturnType;\n\n public setPeerPromise: Promise = null;\n\n private tabId: APP_TABS;\n\n public chats: Chat[] = [];\n private prevTab: HTMLElement;\n private chatsSelectTabDebounced: () => void;\n\n public markupTooltip: MarkupTooltip;\n private backgroundPromises: {[slug: string]: Promise};\n\n private topbarCall: TopbarCall;\n public emojiAnimationContainer: HTMLDivElement;\n\n private lastBackgroundUrl: string;\n\n public managers: AppManagers;\n\n public cacheStorage = new CacheStorageController('cachedFiles');\n public customEmojiSize: MediaSize;\n\n get myId() {\n return rootScope.myId;\n }\n\n get chat(): Chat {\n return this.chats[this.chats.length - 1];\n }\n\n public construct(managers: AppManagers) {\n this.managers = managers;\n\n const {\n apiUpdatesManager\n } = managers;\n apiUpdatesManager.attach(I18n.lastRequestedLangCode);\n\n appMediaPlaybackController.construct(managers);\n uiNotificationsManager.construct(managers);\n uiNotificationsManager.start();\n\n this.log = logger('IM', LogTypes.Log | LogTypes.Warn | LogTypes.Debug | LogTypes.Error);\n\n this.backgroundPromises = {};\n STATE_INIT.settings.themes.forEach((theme) => {\n const themeSettings = theme.settings;\n if(!themeSettings) {\n return;\n }\n\n const {wallpaper} = themeSettings;\n const slug = (wallpaper as WallPaper.wallPaper).slug;\n if(!slug) {\n return;\n }\n\n const url = 'assets/img/' + slug + '.svg' + (IS_FIREFOX ? '?1' : '');\n this.backgroundPromises[slug] = Promise.resolve(url);\n });\n\n this.selectTab(APP_TABS.CHATLIST);\n\n idleController.addEventListener('change', (idle) => {\n this.offline = idle;\n this.updateStatus();\n if(idle) {\n clearInterval(this.updateStatusInterval);\n } else {\n this.updateStatusInterval = window.setInterval(() => this.updateStatus(), 50e3);\n }\n });\n\n this.chatsContainer = document.createElement('div');\n this.chatsContainer.classList.add('chats-container', 'tabs-container');\n this.chatsContainer.dataset.animation = 'navigation';\n\n this.emojiAnimationContainer = document.createElement('div');\n this.emojiAnimationContainer.classList.add('emoji-animation-container');\n this.appendEmojiAnimationContainer(mediaSizes.activeScreen);\n\n this.columnEl.append(this.chatsContainer);\n\n this.createNewChat();\n this.chatsSelectTab(this.chat.container);\n\n appNavigationController.onHashChange = this.onHashChange;\n // window.addEventListener('hashchange', this.onHashChange);\n\n this.setSettings();\n rootScope.addEventListener('settings_updated', this.setSettings);\n\n const onPremiumToggle = (isPremium: boolean) => {\n document.body.classList.toggle('is-premium', isPremium);\n };\n rootScope.addEventListener('premium_toggle', onPremiumToggle);\n onPremiumToggle(rootScope.premium);\n this.managers.rootScope.getPremium().then(onPremiumToggle);\n\n useHeavyAnimationCheck(() => {\n animationIntersector.setOnlyOnePlayableGroup('lock');\n animationIntersector.checkAnimations2(true);\n }, () => {\n animationIntersector.setOnlyOnePlayableGroup();\n animationIntersector.checkAnimations2(false);\n });\n\n themeController.AppBackgroundTab = AppBackgroundTab;\n\n if(IS_FIREFOX && apiManagerProxy.oldVersion && compareVersion(apiManagerProxy.oldVersion, '1.4.3') === -1) {\n this.deleteFilesIterative((response) => {\n return response.headers.get('Content-Type') === 'image/svg+xml';\n }).then(() => {\n this.applyCurrentTheme();\n });\n } else {\n this.applyCurrentTheme();\n }\n\n // * fix simultaneous opened both sidebars, can happen when floating sidebar is opened with left sidebar\n mediaSizes.addEventListener('changeScreen', (from, to) => {\n if(document.body.classList.contains(LEFT_COLUMN_ACTIVE_CLASSNAME) &&\n document.body.classList.contains(RIGHT_COLUMN_ACTIVE_CLASSNAME)) {\n appSidebarRight.toggleSidebar(false);\n }\n\n this.appendEmojiAnimationContainer(to);\n });\n\n mediaSizes.addEventListener('resize', () => {\n // const perf = performance.now();\n const rect = this.chatsContainer.getBoundingClientRect();\n ChatBackgroundPatternRenderer.resizeInstances(rect.width, rect.height).then(() => {\n // this.log.warn('resize bg time:', performance.now() - perf);\n // for(const chat of this.chats) {\n // if(chat.renderDarkPattern) {\n // chat.renderDarkPattern();\n // }\n // }\n });\n });\n\n this.addEventListener('peer_changing', (chat) => {\n this.saveChatPosition(chat);\n });\n\n rootScope.addEventListener('theme_change', () => {\n this.applyCurrentTheme();\n });\n\n rootScope.addEventListener('choosing_sticker', (choosing) => {\n this.setChoosingStickerTyping(!choosing);\n });\n\n rootScope.addEventListener('peer_title_edit', ({peerId, threadId}) => {\n if(this.chat?.peerId === peerId && !threadId && this.tabId !== undefined) {\n this.overrideHash(peerId);\n }\n });\n\n rootScope.addEventListener('peer_typings', ({peerId, typings}) => {\n const chat = this.chat;\n if(\n !chat ||\n chat.peerId !== peerId ||\n overlayCounter.isOverlayActive || (\n mediaSizes.activeScreen === ScreenSize.mobile &&\n this.tabId !== APP_TABS.CHAT\n )\n ) {\n return;\n }\n\n const typing = typings.find((typing) => typing.action._ === 'sendMessageEmojiInteraction');\n if(typing?.action?._ === 'sendMessageEmojiInteraction') {\n const action = typing.action;\n const bubble = chat.bubbles.bubbles[generateMessageId(typing.action.msg_id)];\n if(bubble && bubble.classList.contains('emoji-big') && getVisibleRect(bubble, chat.bubbles.scrollable.container)) {\n const stickerWrapper: HTMLElement = bubble.querySelector('.media-sticker-wrapper:not(.bubble-hover-reaction-sticker):not(.reaction-sticker)');\n\n const data: SendMessageEmojiInteractionData = JSON.parse(action.interaction.data);\n data.a.forEach((a) => {\n setTimeout(() => {\n simulateClickEvent(stickerWrapper);\n }, a.t * 1000);\n });\n\n this.managers.appMessagesManager.setTyping(peerId, {\n _: 'sendMessageEmojiInteractionSeen',\n emoticon: action.emoticon\n });\n }\n }\n });\n\n const onInstanceDeactivated = (reason: InstanceDeactivateReason) => {\n const isUpdated = reason === 'version';\n const popup = new PopupElement('popup-instance-deactivated', {overlayClosable: true});\n const c = document.createElement('div');\n c.classList.add('instance-deactivated-container');\n (popup as any).container.replaceWith(c);\n\n const header = document.createElement('div');\n header.classList.add('header');\n header.append(i18n(isUpdated ? 'Deactivated.Version.Title' : 'Deactivated.Title'));\n\n const subtitle = document.createElement('div');\n subtitle.classList.add('subtitle');\n subtitle.append(i18n(isUpdated ? 'Deactivated.Version.Subtitle' : 'Deactivated.Subtitle'));\n\n c.append(header, subtitle);\n\n document.body.classList.add('deactivated');\n\n const onClose = isUpdated ? () => {\n appRuntimeManager.reload();\n } : () => {\n document.body.classList.add('deactivated-backwards');\n\n singleInstance.activateInstance();\n\n setTimeout(() => {\n document.body.classList.remove('deactivated', 'deactivated-backwards');\n }, 333);\n };\n\n popup.addEventListener('close', onClose);\n popup.show();\n };\n\n singleInstance.addEventListener('deactivated', onInstanceDeactivated);\n if(singleInstance.deactivatedReason) {\n onInstanceDeactivated(singleInstance.deactivatedReason);\n }\n\n // remove scroll listener when setting chat to tray\n this.addEventListener('chat_changing', ({to}) => {\n this.toggleChatGradientAnimation(to);\n });\n\n rootScope.addEventListener('service_notification', (update) => {\n confirmationPopup({\n button: {langKey: 'OK', isCancel: true},\n description: wrapRichText(update.message)\n });\n });\n\n rootScope.addEventListener('payment_sent', async({peerId, mid, receiptMessage}) => {\n const message = await this.managers.appMessagesManager.getMessageByPeer(peerId, mid);\n if(!message) {\n return;\n }\n\n const action = receiptMessage.action as MessageAction.messageActionPaymentSent;\n toastNew({\n langPackKey: 'PaymentInfoHint',\n langPackArguments: [\n paymentsWrapCurrencyAmount(action.total_amount, action.currency),\n wrapEmojiText(((message as Message.message).media as MessageMedia.messageMediaInvoice).title)\n ]\n });\n });\n\n (window as any).onSpoilerClick = (e: MouseEvent) => {\n const spoiler = findUpClassName(e.target, 'spoiler');\n const parentElement = findUpClassName(spoiler, 'spoilers-container') || spoiler.parentElement;\n\n const className = 'is-spoiler-visible';\n const isVisible = parentElement.classList.contains(className);\n if(!isVisible) {\n cancelEvent(e);\n\n if(CLICK_EVENT_NAME !== 'click') {\n window.addEventListener('click', cancelEvent, {capture: true, once: true});\n }\n }\n\n const duration = 400 / 2;\n const showDuration = 5000;\n const useRafs = !isVisible ? 2 : 0;\n if(useRafs) {\n parentElement.classList.add('will-change');\n }\n\n const spoilerTimeout = parentElement.dataset.spoilerTimeout;\n if(spoilerTimeout !== null) {\n clearTimeout(+spoilerTimeout);\n delete parentElement.dataset.spoilerTimeout;\n }\n\n SetTransition({\n element: parentElement,\n className,\n forwards: true,\n duration,\n onTransitionEnd: () => {\n parentElement.dataset.spoilerTimeout = '' + window.setTimeout(() => {\n SetTransition({\n element: parentElement,\n className,\n forwards: false,\n duration,\n onTransitionEnd: () => {\n parentElement.classList.remove('will-change');\n delete parentElement.dataset.spoilerTimeout;\n }\n });\n }, showDuration);\n },\n useRafs\n });\n };\n\n document.addEventListener('mousemove', (e) => {\n const mediaStickerWrapper = findUpClassName(e.target, 'media-sticker-wrapper');\n if(!mediaStickerWrapper ||\n mediaStickerWrapper.classList.contains('custom-emoji') ||\n findUpClassName(e.target, 'emoji-big')) {\n return;\n }\n\n const animations = animationIntersector.getAnimations(mediaStickerWrapper);\n animations?.forEach((animationItem) => {\n const {liteModeKey, animation} = animationItem;\n if(!liteModeKey || !animation?.paused || liteMode.isAvailable(liteModeKey)) {\n return;\n }\n\n if(animation instanceof RLottiePlayer) {\n animation.playOrRestart();\n } else {\n animation.play();\n }\n });\n });\n\n rootScope.addEventListener('sticker_updated', ({type, faved}) => {\n if(type === 'faved') {\n toastNew({\n langPackKey: faved ? 'AddedToFavorites' : 'RemovedFromFavorites'\n });\n } else if(!faved) {\n toastNew({\n langPackKey: 'RemovedFromRecent'\n });\n }\n });\n\n apiManagerProxy.addEventListener('notificationBuild', async(options) => {\n const isForum = await this.managers.appPeersManager.isForum(options.message.peerId);\n const threadId = getMessageThreadId(options.message, isForum);\n if(this.chat.peerId === options.message.peerId && this.chat.threadId === threadId && !idleController.isIdle) {\n return;\n }\n\n uiNotificationsManager.buildNotification(options);\n });\n\n this.addEventListener('peer_changed', async({peerId}) => {\n document.body.classList.toggle('has-chat', !!peerId);\n\n this.emojiAnimationContainer.textContent = '';\n\n this.overrideHash(peerId);\n\n apiManagerProxy.updateTabState('chatPeerIds', this.chats.map((chat) => chat.peerId).filter(Boolean));\n });\n\n // stateStorage.get('chatPositions').then((c) => {\n stateStorage.setToCache('chatPositions', /* c || */{});\n // });\n\n if(IS_CALL_SUPPORTED || IS_GROUP_CALL_SUPPORTED) {\n this.topbarCall = new TopbarCall(managers);\n }\n\n if(IS_CALL_SUPPORTED) {\n callsController.addEventListener('instance', ({instance/* , hasCurrent */}) => {\n // if(hasCurrent) {\n // return;\n // }\n\n const popup = new PopupCall(instance);\n\n instance.addEventListener('acceptCallOverride', () => {\n return this.discardCurrentCall(instance.interlocutorUserId.toPeerId(), undefined, instance)\n .then(() => {\n callsController.dispatchEvent('accepting', instance);\n return true;\n })\n .catch(() => false);\n });\n\n popup.addEventListener('close', () => {\n const currentCall = callsController.currentCall;\n if(currentCall && currentCall !== instance && !instance.wasTryingToJoin) {\n instance.hangUp('phoneCallDiscardReasonBusy');\n }\n }, {once: true});\n\n popup.show();\n });\n\n callsController.addEventListener('incompatible', async(userId) => {\n toastNew({\n langPackKey: 'VoipPeerIncompatible',\n langPackArguments: [\n await wrapPeerTitle({peerId: userId.toPeerId()})\n ]\n });\n });\n }\n\n // ! do not remove this line\n // ! instance can be deactivated before the UI starts, because it waits in background for RAF that is delayed\n singleInstance.activateInstance();\n\n const setAuthorized = () => {\n telegramMeWebManager.setAuthorized(true);\n };\n\n setInterval(setAuthorized, ONE_DAY);\n setAuthorized();\n\n addAnchorListener<{}>({\n name: 'showMaskedAlert',\n callback: (params, element) => {\n const href = element.href;\n\n const a = element.cloneNode(true) as HTMLAnchorElement;\n a.className = 'anchor-url';\n a.innerText = href;\n a.removeAttribute('onclick');\n\n new PopupPeer('popup-masked-url', {\n titleLangKey: 'OpenUrlTitle',\n descriptionLangKey: 'OpenUrlAlert2',\n descriptionLangArgs: [a],\n buttons: [{\n langKey: 'Open',\n callback: () => {\n a.click();\n }\n }]\n }).show();\n }\n });\n\n addAnchorListener<{uriParams: {command: string, bot: string}}>({\n name: 'execBotCommand',\n callback: ({uriParams}) => {\n const {command, bot} = uriParams;\n\n /* const promise = bot ? this.openUsername(bot).then(() => this.chat.peerId) : Promise.resolve(this.chat.peerId);\n promise.then((peerId) => {\n this.managers.appMessagesManager.sendText(peerId, '/' + command);\n }); */\n\n this.managers.appMessagesManager.sendText(this.chat.peerId, '/' + command + (bot ? '@' + bot : ''));\n\n // console.log(command, bot);\n }\n });\n\n addAnchorListener<{uriParams: {hashtag: string}}>({\n name: 'searchByHashtag',\n callback: ({uriParams}) => {\n const {hashtag} = uriParams;\n if(!hashtag) {\n return;\n }\n\n this.chat.initSearch('#' + hashtag + ' ');\n }\n });\n\n addAnchorListener<{}>({\n name: 'setMediaTimestamp',\n callback: (_, element) => {\n const timestamp = +element.dataset.timestamp;\n const bubble = findUpClassName(element, 'bubble');\n if(bubble) {\n this.chat.bubbles.playMediaWithTimestamp(element, timestamp);\n return;\n }\n\n if(findUpClassName(element, 'media-viewer-caption')) {\n const appMediaViewer = (window as any).appMediaViewer;\n appMediaViewer.setMediaTimestamp(timestamp);\n }\n }\n });\n\n ([\n ['addstickers', INTERNAL_LINK_TYPE.STICKER_SET],\n ['addemoji', INTERNAL_LINK_TYPE.EMOJI_SET]\n ] as [\n 'addstickers' | 'addemoji',\n INTERNAL_LINK_TYPE.STICKER_SET | INTERNAL_LINK_TYPE.EMOJI_SET\n ][]).forEach(([name, type]) => {\n addAnchorListener<{pathnameParams: [typeof name, string]}>({\n name,\n callback: ({pathnameParams}) => {\n if(!pathnameParams[1]) {\n return;\n }\n\n const link: InternalLink = {\n _: type,\n set: pathnameParams[1]\n };\n\n this.processInternalLink(link);\n }\n });\n\n addAnchorListener<{\n uriParams: {\n set: string\n }\n }>({\n name,\n protocol: 'tg',\n callback: ({uriParams}) => {\n const link = this.makeLink(type, uriParams);\n this.processInternalLink(link);\n }\n });\n });\n\n // * t.me/invoice/asdasdad\n // * t.me/$asdasdad\n addAnchorListener<{pathnameParams: ['invoice', string] | string}>({\n name: 'invoice',\n callback: ({pathnameParams}) => {\n const link: InternalLink = {\n _: INTERNAL_LINK_TYPE.INVOICE,\n slug: pathnameParams.length > 1 ? pathnameParams[1] : pathnameParams[0].slice(1)\n };\n\n this.processInternalLink(link);\n }\n });\n\n // Support old t.me/joinchat/asd and new t.me/+asd\n addAnchorListener<{pathnameParams: ['joinchat', string]}>({\n name: 'joinchat',\n callback: ({pathnameParams}) => {\n const link: InternalLink = {\n _: INTERNAL_LINK_TYPE.JOIN_CHAT,\n invite: pathnameParams[1] || decodeURIComponent(pathnameParams[0]).slice(1)\n };\n\n this.processInternalLink(link);\n }\n });\n\n if(IS_GROUP_CALL_SUPPORTED) {\n addAnchorListener<{\n uriParams: Omit\n }>({\n name: 'voicechat',\n protocol: 'tg',\n callback: ({uriParams}) => {\n const link = this.makeLink(INTERNAL_LINK_TYPE.VOICE_CHAT, uriParams);\n this.processInternalLink(link);\n }\n });\n }\n\n addAnchorListener<{\n // pathnameParams: ['c', string, string],\n // uriParams: {thread?: number}\n // } | {\n // pathnameParams: [string, string?],\n // uriParams: {comment?: number}\n pathnameParams: ['c', string, string] | [string, string?],\n uriParams: {thread?: string, comment?: string, t?: string} | {comment?: string, start?: string, t?: string}\n }>({\n name: 'im',\n callback: async({pathnameParams, uriParams}, element) => {\n let link: InternalLink;\n if(PHONE_NUMBER_REG_EXP.test(pathnameParams[0])) {\n link = {\n _: INTERNAL_LINK_TYPE.USER_PHONE_NUMBER,\n phone: pathnameParams[0].slice(1)\n };\n } else if(pathnameParams[0] === 'c') {\n pathnameParams.shift();\n const thread = 'thread' in uriParams ? uriParams.thread : pathnameParams[2] && pathnameParams[1];\n link = {\n _: INTERNAL_LINK_TYPE.PRIVATE_POST,\n channel: pathnameParams[0],\n post: pathnameParams[2] || pathnameParams[1],\n thread,\n comment: uriParams.comment,\n stack: this.getStackFromElement(element),\n t: uriParams.t\n };\n } else {\n const thread = 'thread' in uriParams ? uriParams.thread : pathnameParams[2] && pathnameParams[1];\n link = {\n _: INTERNAL_LINK_TYPE.MESSAGE,\n domain: pathnameParams[0],\n post: pathnameParams[2] || pathnameParams[1],\n thread,\n comment: uriParams.comment,\n start: 'start' in uriParams ? uriParams.start : undefined,\n stack: this.getStackFromElement(element),\n t: uriParams.t\n };\n }\n\n this.processInternalLink(link);\n }\n });\n\n addAnchorListener<{\n uriParams: {\n domain: string,\n\n // telegrampassport\n scope?: string,\n nonce?: string,\n payload?: string,\n bot_id?: string,\n public_key?: string,\n callback_url?: string,\n\n // regular\n start?: string,\n startgroup?: string,\n game?: string,\n voicechat?: string,\n post?: string,\n thread?: string,\n comment?: string,\n phone?: string,\n t?: string\n }\n }>({\n name: 'resolve',\n protocol: 'tg',\n callback: ({uriParams}, element) => {\n let link: InternalLink;\n if(uriParams.phone) {\n link = this.makeLink(INTERNAL_LINK_TYPE.USER_PHONE_NUMBER, uriParams as Required);\n } else if(uriParams.domain === 'telegrampassport') {\n\n } else {\n link = this.makeLink(INTERNAL_LINK_TYPE.MESSAGE, {\n ...uriParams,\n stack: this.getStackFromElement(element)\n });\n }\n\n this.processInternalLink(link);\n }\n });\n\n addAnchorListener<{\n uriParams: {\n channel: string,\n post: string,\n thread?: string,\n comment?: string\n }\n }>({\n name: 'privatepost',\n protocol: 'tg',\n callback: ({uriParams}) => {\n const link = this.makeLink(INTERNAL_LINK_TYPE.PRIVATE_POST, uriParams);\n this.processInternalLink(link);\n }\n });\n\n addAnchorListener<{\n uriParams: {\n slug: string\n }\n }>({\n name: 'invoice',\n protocol: 'tg',\n callback: ({uriParams}) => {\n const link = this.makeLink(INTERNAL_LINK_TYPE.INVOICE, uriParams);\n this.processInternalLink(link);\n }\n });\n\n ['joinchat' as const, 'join' as const].forEach((name) => {\n addAnchorListener<{\n uriParams: {\n invite: string\n }\n }>({\n name,\n protocol: 'tg',\n callback: ({uriParams}) => {\n const link = this.makeLink(INTERNAL_LINK_TYPE.JOIN_CHAT, uriParams);\n this.processInternalLink(link);\n }\n });\n });\n\n this.onHashChange(true);\n this.attachKeydownListener();\n this.handleAutologinDomains();\n this.checkForShare();\n }\n\n private checkForShare() {\n const share = apiManagerProxy.share;\n if(share) {\n apiManagerProxy.share = undefined;\n new PopupForward(undefined, async(peerId) => {\n await this.setPeer({peerId});\n if(share.files?.length) {\n const foundMedia = share.files.some((file) => MEDIA_MIME_TYPES_SUPPORTED.has(file.type));\n new PopupNewMedia(this.chat, share.files, foundMedia ? 'media' : 'document');\n } else {\n this.managers.appMessagesManager.sendText(peerId, share.text);\n }\n });\n }\n }\n\n public handleUrlAuth(options: {\n peerId?: PeerId,\n mid?: number,\n buttonId?: number,\n url: string\n }) {\n const {peerId, mid, buttonId, url} = options;\n\n const openWindow = (url: string) => {\n window.open(url, '_blank');\n };\n\n const onUrlAuthResultAccepted = (urlAuthResult: UrlAuthResult.urlAuthResultAccepted) => {\n openWindow(urlAuthResult.url);\n };\n\n const onUrlAuthResult = async(urlAuthResult: UrlAuthResult): Promise => {\n if(urlAuthResult._ === 'urlAuthResultRequest') {\n const b = document.createElement('b');\n b.append(urlAuthResult.domain);\n const peerTitle = await wrapPeerTitle({peerId: rootScope.myId});\n const botPeerTitle = await wrapPeerTitle({peerId: urlAuthResult.bot.id.toPeerId()});\n\n const logInCheckbox: PopupPeerCheckboxOptions = {\n text: 'OpenUrlOption1',\n textArgs: [b.cloneNode(true), peerTitle],\n checked: true\n };\n\n const allowMessagesCheckbox: PopupPeerCheckboxOptions = urlAuthResult.pFlags.request_write_access ? {\n text: 'OpenUrlOption2',\n textArgs: [botPeerTitle],\n checked: true\n } : undefined;\n\n const checkboxes: PopupPeerCheckboxOptions[] = [\n logInCheckbox,\n allowMessagesCheckbox\n ];\n\n const confirmationPromise = confirmationPopup({\n titleLangKey: 'OpenUrlTitle',\n button: {\n langKey: 'Open'\n },\n descriptionLangKey: 'OpenUrlAlert2',\n descriptionLangArgs: [b],\n checkboxes: checkboxes.filter(Boolean)\n });\n\n if(allowMessagesCheckbox) {\n logInCheckbox.checkboxField.input.addEventListener('change', () => {\n const disabled = !logInCheckbox.checkboxField.checked;\n allowMessagesCheckbox.checkboxField.toggleDisability(disabled);\n\n if(disabled) {\n allowMessagesCheckbox.checkboxField.checked = false;\n }\n });\n }\n\n const [logInChecked, allowMessagesChecked] = await confirmationPromise;\n\n if(!logInChecked) {\n openWindow(url);\n return;\n }\n\n const result = await this.managers.appSeamlessLoginManager.acceptUrlAuth(\n url,\n peerId,\n mid,\n buttonId,\n allowMessagesChecked\n );\n\n return onUrlAuthResult(result);\n } else if(urlAuthResult._ === 'urlAuthResultAccepted') {\n onUrlAuthResultAccepted(urlAuthResult);\n } else {\n openWindow(url);\n }\n };\n\n return this.managers.appSeamlessLoginManager.requestUrlAuth(\n url,\n peerId,\n mid,\n buttonId\n ).then((urlAuthResult) => {\n onUrlAuthResult(urlAuthResult);\n });\n }\n\n private handleAutologinDomains() {\n let appConfig: MTAppConfig;\n rootScope.addEventListener('app_config', (_appConfig) => {\n appConfig = _appConfig;\n });\n\n const onAnchorClick = (element: HTMLAnchorElement) => {\n const url = new URL(element.href);\n if(appConfig.url_auth_domains.includes(url.hostname)) {\n this.handleUrlAuth({url: element.href});\n cancelEvent();\n return;\n }\n\n if(!appConfig.autologin_token || !appConfig.autologin_domains) {\n return;\n }\n\n const originalUrl = element.dataset.originalUrl ??= element.href;\n if(appConfig.autologin_domains.includes(url.hostname)) {\n url.searchParams.set('autologin_token', appConfig.autologin_token);\n element.href = url.toString();\n\n setTimeout(() => {\n element.href = originalUrl;\n delete element.dataset.originalUrl;\n }, 0);\n }\n };\n\n document.addEventListener('click', (e) => {\n const anchor = findUpTag(e.target as HTMLElement, 'A') as HTMLAnchorElement;\n if(anchor?.href) {\n onAnchorClick(anchor);\n }\n });\n\n // addAnchorListener({\n // name: 'handleUrlClick',\n // callback: (_, element) => {\n // onAnchorClick(element);\n // },\n // noCancelEvent: true,\n // noPathnameParams: true,\n // noUriParams: true\n // });\n }\n\n private getStackFromElement(element: HTMLElement) {\n const possibleBubble = findUpClassName(element, 'bubble');\n return possibleBubble ? +possibleBubble.dataset.mid : undefined;\n }\n\n private deleteFilesIterative(callback: (response: Response) => boolean) {\n return this.cacheStorage.timeoutOperation((cache) => {\n const perf = performance.now();\n return cache.keys().then((requests) => {\n const promises = requests.map((request) => {\n return cache.match(request).then((response) => {\n return callback(response);\n });\n });\n\n return Promise.all(promises).then((values) => {\n values.map((isBad, idx) => {\n if(!isBad) {\n return;\n }\n\n const request = requests[idx];\n return cache.delete(request);\n });\n\n return Promise.all(values.filter(Boolean));\n });\n }).then(() => {\n this.log('deleted files', performance.now() - perf);\n });\n });\n }\n\n private toggleChatGradientAnimation(activatingChat: Chat) {\n this.chats.forEach((chat) => {\n if(chat.gradientRenderer) {\n chat.gradientRenderer.scrollAnimate(liteMode.isAvailable('animations') && chat === activatingChat);\n }\n });\n }\n\n private appendEmojiAnimationContainer(screen: ScreenSize) {\n const appendTo = screen === ScreenSize.mobile ? this.columnEl : document.body;\n if(this.emojiAnimationContainer.parentElement !== appendTo) {\n appendTo.append(this.emojiAnimationContainer)\n }\n }\n\n private attachKeydownListener() {\n const IGNORE_KEYS = new Set(['PageUp', 'PageDown', 'Meta', 'Control']);\n const onKeyDown = (e: KeyboardEvent) => {\n const key = e.key;\n const isSelectionCollapsed = document.getSelection().isCollapsed;\n if(overlayCounter.isOverlayActive || IGNORE_KEYS.has(key)) return;\n\n const target = e.target as HTMLElement;\n\n const isTargetAnInput = (target.tagName === 'INPUT' && !['checkbox', 'radio'].includes((target as HTMLInputElement).type)) || target.isContentEditable;\n\n // if(target.tagName === 'INPUT') return;\n\n // this.log('onkeydown', e, document.activeElement);\n\n const chat = this.chat;\n\n if((key.startsWith('Arrow') || (e.shiftKey && key === 'Shift')) && !isSelectionCollapsed) {\n return;\n } else if(e.code === 'KeyC' && (e.ctrlKey || e.metaKey) && !isTargetAnInput) {\n return;\n } else if(e.altKey && (key === 'ArrowUp' || key === 'ArrowDown')) {\n cancelEvent(e);\n this.managers.dialogsStorage.getNextDialog(this.chat.peerId, key === 'ArrowDown', appDialogsManager.filterId).then((dialog) => {\n if(dialog) {\n this.setPeer({peerId: dialog.peerId});\n }\n });\n } else if(key === 'ArrowUp' && this.chat.type !== 'scheduled') {\n if(!chat.input.editMsgId && chat.input.isInputEmpty()) {\n this.managers.appMessagesManager.getFirstMessageToEdit(chat.peerId, chat.threadId).then((message) => {\n if(message) {\n chat.input.initMessageEditing(message.mid);\n cancelEvent(e); // * prevent from scrolling\n }\n });\n } else {\n return;\n }\n } else if(key === 'ArrowDown') {\n return;\n }\n\n if(\n chat?.input?.messageInput &&\n target !== chat.input.messageInput &&\n !isTargetAnInput &&\n !IS_TOUCH_SUPPORTED &&\n (!mediaSizes.isMobile || this.tabId === APP_TABS.CHAT) &&\n !chat.selection.isSelecting &&\n !chat.input.recording &&\n chat.input.messageInput.isContentEditable\n ) {\n chat.input.messageInput.focus();\n placeCaretAtEnd(chat.input.messageInput);\n\n // clone and dispatch same event to new input. it is needed for sending message if input was blurred\n const newEvent = new KeyboardEvent(e.type, e);\n chat.input.messageInput.dispatchEvent(newEvent);\n }\n };\n\n document.body.addEventListener('keydown', onKeyDown);\n }\n\n private makeLink(type: T, uriParams: Omit) {\n return {\n _: type,\n ...uriParams\n } as any as InternalLinkTypeMap[T];\n }\n\n public async processInternalLink(link: InternalLink) {\n switch(link?._) {\n case INTERNAL_LINK_TYPE.MESSAGE: {\n const postId = link.post ? generateMessageId(+link.post) : undefined;\n const commentId = link.comment ? generateMessageId(+link.comment) : undefined;\n const threadId = link.thread ? generateMessageId(+link.thread) : undefined;\n\n this.openUsername({\n userName: link.domain,\n lastMsgId: postId,\n commentId,\n startParam: link.start,\n stack: link.stack,\n threadId,\n mediaTimestamp: link.t && +link.t\n });\n break;\n }\n\n case INTERNAL_LINK_TYPE.PRIVATE_POST: {\n const chatId = link.channel.toChatId();\n const peerId = chatId.toPeerId(true);\n\n const chat = await this.managers.appChatsManager.getChat(chatId);\n if(!chat) {\n try {\n await this.managers.appChatsManager.resolveChannel(chatId);\n } catch(err) {\n toastNew({langPackKey: 'LinkNotFound'});\n throw err;\n }\n }\n\n const postId = generateMessageId(+link.post);\n const threadId = link.thread ? generateMessageId(+link.thread) : undefined;\n\n this.op({\n peer: chat,\n lastMsgId: postId,\n threadId,\n stack: link.stack,\n mediaTimestamp: link.t && +link.t\n });\n break;\n }\n\n case INTERNAL_LINK_TYPE.EMOJI_SET:\n case INTERNAL_LINK_TYPE.STICKER_SET: {\n new PopupStickers({id: link.set}, link._ === INTERNAL_LINK_TYPE.EMOJI_SET).show();\n break;\n }\n\n case INTERNAL_LINK_TYPE.JOIN_CHAT: {\n this.managers.appChatsManager.checkChatInvite(link.invite).then((chatInvite) => {\n if((chatInvite as ChatInvite.chatInvitePeek).chat) {\n this.managers.appChatsManager.saveApiChat((chatInvite as ChatInvite.chatInvitePeek).chat, true);\n }\n\n // console.log(chatInvite);\n\n if(chatInvite._ === 'chatInviteAlready' ||\n chatInvite._ === 'chatInvitePeek'/* && chatInvite.expires > tsNow(true) */) {\n this.setInnerPeer({\n peerId: chatInvite.chat.id.toPeerId(true)\n });\n return;\n }\n\n new PopupJoinChatInvite(link.invite, chatInvite);\n }, (err) => {\n if(err.type === 'INVITE_HASH_EXPIRED') {\n toast(i18n('InviteExpired'));\n }\n });\n break;\n }\n\n case INTERNAL_LINK_TYPE.VOICE_CHAT: {\n if(IS_GROUP_CALL_SUPPORTED) {\n this.joinGroupCall(link.chat_id.toPeerId(true), link.id);\n }\n\n break;\n }\n\n case INTERNAL_LINK_TYPE.USER_PHONE_NUMBER: {\n this.managers.appUsersManager.resolvePhone(link.phone).then((user) => {\n this.setInnerPeer({\n peerId: user.id.toPeerId(false)\n });\n }).catch((err) => {\n if(err.type === 'PHONE_NOT_OCCUPIED') {\n toastNew({langPackKey: 'Alert.UserDoesntExists'});\n }\n });\n\n break;\n }\n\n case INTERNAL_LINK_TYPE.INVOICE: {\n this.managers.appPaymentsManager.getInputInvoiceBySlug(link.slug).then((inputInvoice) => {\n this.managers.appPaymentsManager.getPaymentForm(inputInvoice).then((paymentForm) => {\n // const message: Message.message = {\n // _: 'message',\n // date: 0,\n // id: 0,\n // peerId: 0,\n // peer_id: undefined,\n // message: '',\n // media: {\n // _: 'messageMediaInvoice',\n // currency: paymentForm.invoice.currency,\n // description: paymentForm.description,\n\n // }\n // };\n new PopupPayment(undefined, inputInvoice, paymentForm);\n });\n });\n break;\n }\n\n default: {\n this.log.warn('Not supported internal link:', link);\n break;\n }\n }\n }\n\n public openUrl(url: string) {\n const {url: wrappedUrl, onclick} = wrapUrl(url);\n if(!onclick) {\n return;\n }\n\n const a = document.createElement('a');\n a.href = wrappedUrl;\n (window as any)[onclick](a);\n }\n\n private onHashChange = (saveState?: boolean) => {\n try {\n this.onHashChangeUnsafe(saveState);\n } catch(err) {\n this.log.error('hash change error', err);\n }\n };\n\n private onHashChangeUnsafe = (saveState?: boolean) => {\n const hash = location.hash;\n if(!saveState) {\n appNavigationController.replaceState();\n }\n\n const splitted = hash.split('?');\n const params = parseUriParams(hash, splitted);\n this.log('hashchange', hash, splitted[0], params);\n if(!hash) {\n return;\n }\n\n if(params.tgaddr) {\n this.openUrl(params.tgaddr);\n return;\n }\n\n switch(splitted[0]) {\n default: {\n params.p = splitted[0].slice(1);\n }\n\n case '#/im': {\n if(!Object.keys(params).length) {\n break;\n }\n\n const p: string = params.p;\n const postId = params.post !== undefined ? generateMessageId(+params.post) : undefined;\n\n switch(p[0]) {\n case '@': {\n this.openUsername({\n userName: p,\n lastMsgId: postId\n });\n break;\n }\n\n default: { // peerId\n this.setInnerPeer({\n peerId: postId ? p.toPeerId(true) : p.toPeerId(),\n lastMsgId: postId\n });\n break;\n }\n }\n }\n }\n\n // appNavigationController.replaceState();\n // location.hash = '';\n };\n\n private async op(options: {\n peer: User.user | MTChat\n } & Omit) {\n let {peer, commentId, threadId, lastMsgId} = options;\n const isUser = peer._ === 'user';\n const peerId = peer.id.toPeerId(!isUser);\n\n const isForum = peer._ === 'channel' && peer.pFlags.forum;\n // open forum tab\n if(!commentId && !threadId && !lastMsgId && isForum) {\n appDialogsManager.toggleForumTabByPeerId(peerId, true);\n return;\n }\n\n // handle t.me/username/thread or t.me/username/messageId\n if(isForum && lastMsgId && !threadId) {\n const message = await this.managers.appMessagesManager.reloadMessages(peerId, lastMsgId);\n if(message) {\n threadId = options.threadId = getMessageThreadId(message, isForum);\n } else {\n threadId = options.threadId = lastMsgId;\n lastMsgId = options.lastMsgId = undefined;\n }\n }\n\n if(threadId) {\n return this.openThread({\n ...(options as any as Parameters[0]),\n peerId\n });\n } else if(commentId) {\n return this.openComment({\n peerId,\n msgId: lastMsgId,\n commentId\n });\n }\n\n return this.setInnerPeer({\n ...options,\n peerId\n });\n }\n\n public openPremiumBot() {\n return this.managers.apiManager.getAppConfig().then((appConfig) => {\n return this.openUsername({userName: appConfig.premium_bot_username});\n });\n }\n\n public openUsername(options: {\n userName: string\n } & Omit) {\n const {userName} = options;\n return this.managers.appUsersManager.resolveUsername(userName).then((peer) => {\n return this.op({\n peer,\n ...options\n });\n }, (err: ApiError) => {\n if(err.type === 'USERNAME_NOT_OCCUPIED') {\n toastNew({langPackKey: 'NoUsernameFound'});\n } else if(err.type === 'USERNAME_INVALID') {\n toastNew({langPackKey: 'Alert.UserDoesntExists'});\n }\n });\n }\n\n /**\n * Opens thread when peerId of discussion group is known\n */\n public async openThread(options: {\n peerId: PeerId,\n lastMsgId: number,\n threadId: number,\n stack?: number\n }) {\n if(await this.managers.appChatsManager.isForum(options.peerId.toChatId())) {\n await this.managers.dialogsStorage.getForumTopicOrReload(options.peerId, options.threadId);\n return this.setInnerPeer(options);\n }\n\n return this.managers.appMessagesManager.reloadMessages(options.peerId, options.threadId).then((message) => {\n if(!message) {\n options.lastMsgId = undefined;\n } else {\n this.managers.appMessagesManager.generateThreadServiceStartMessage(message);\n }\n\n return this.setInnerPeer({\n ...options,\n type: 'discussion'\n });\n });\n }\n\n /**\n * Opens comment directly from original channel\n */\n public openComment(options: {\n peerId: PeerId,\n msgId: number,\n commentId: number\n }) {\n return this.managers.appMessagesManager.getDiscussionMessage(options.peerId, options.msgId).then((message) => {\n return this.openThread({\n peerId: message.peerId,\n lastMsgId: options.commentId,\n threadId: message.mid\n });\n });\n }\n\n public async callUser(userId: UserId, type: CallType) {\n const call = callsController.getCallByUserId(userId);\n if(call) {\n return;\n }\n\n const userFull = await this.managers.appProfileManager.getProfile(userId);\n if(userFull.pFlags.phone_calls_private) {\n wrapPeerTitle({peerId: userId.toPeerId()}).then((element) => {\n return confirmationPopup({\n descriptionLangKey: 'Call.PrivacyErrorMessage',\n descriptionLangArgs: [element],\n button: {\n langKey: 'OK',\n isCancel: true\n }\n });\n });\n\n return;\n }\n\n await this.discardCurrentCall(userId.toPeerId());\n\n callsController.startCallInternal(userId, type === 'video');\n }\n\n private discardCurrentCall(toPeerId: PeerId, ignoreGroupCall?: GroupCallInstance, ignoreCall?: CallInstance) {\n if(groupCallsController.groupCall && groupCallsController.groupCall !== ignoreGroupCall) return this.discardGroupCallConfirmation(toPeerId);\n else if(callsController.currentCall && callsController.currentCall !== ignoreCall) return this.discardCallConfirmation(toPeerId);\n else return Promise.resolve();\n }\n\n private async discardCallConfirmation(toPeerId: PeerId) {\n const currentCall = callsController.currentCall;\n if(currentCall) {\n await Promise.all([\n wrapPeerTitle({peerId: currentCall.interlocutorUserId.toPeerId(false)}),\n wrapPeerTitle({peerId: toPeerId})\n ]).then(([title1, title2]) => {\n return confirmationPopup({\n titleLangKey: 'Call.Confirm.Discard.Call.Header',\n descriptionLangKey: toPeerId.isUser() ? 'Call.Confirm.Discard.Call.ToCall.Text' : 'Call.Confirm.Discard.Call.ToVoice.Text',\n descriptionLangArgs: [title1, title2],\n button: {\n langKey: 'OK'\n }\n });\n });\n\n if(!currentCall.isClosing) {\n await currentCall.hangUp('phoneCallDiscardReasonDisconnect');\n }\n }\n }\n\n private async discardGroupCallConfirmation(toPeerId: PeerId) {\n const currentGroupCall = groupCallsController.groupCall;\n if(currentGroupCall) {\n await Promise.all([\n wrapPeerTitle({peerId: currentGroupCall.chatId.toPeerId(true)}),\n wrapPeerTitle({peerId: toPeerId})\n ]).then(([title1, title2]) => {\n return confirmationPopup({\n titleLangKey: 'Call.Confirm.Discard.Voice.Header',\n descriptionLangKey: toPeerId.isUser() ? 'Call.Confirm.Discard.Voice.ToCall.Text' : 'Call.Confirm.Discard.Voice.ToVoice.Text',\n descriptionLangArgs: [title1, title2],\n button: {\n langKey: 'OK'\n }\n });\n });\n\n if(groupCallsController.groupCall === currentGroupCall) {\n await currentGroupCall.hangUp();\n }\n }\n }\n\n public async joinGroupCall(peerId: PeerId, groupCallId?: GroupCallId) {\n const chatId = peerId.toChatId();\n const hasRights = this.managers.appChatsManager.hasRights(chatId, 'manage_call');\n const next = async() => {\n const chatFull = await this.managers.appProfileManager.getChatFull(chatId);\n let call: MyGroupCall;\n if(!chatFull.call) {\n if(!hasRights) {\n return;\n }\n\n call = await this.managers.appGroupCallsManager.createGroupCall(chatId);\n } else {\n call = chatFull.call;\n }\n\n groupCallsController.joinGroupCall(chatId, call.id, true, false);\n };\n\n if(groupCallId) {\n const groupCall = await this.managers.appGroupCallsManager.getGroupCallFull(groupCallId);\n if(groupCall._ === 'groupCallDiscarded') {\n if(!hasRights) {\n toastNew({\n langPackKey: 'VoiceChat.Chat.Ended'\n });\n\n return;\n }\n\n await confirmationPopup({\n descriptionLangKey: 'VoiceChat.Chat.StartNew',\n button: {\n langKey: 'VoiceChat.Chat.StartNew.OK'\n }\n });\n }\n }\n\n // await this.discardCurrentCall(peerId);\n\n next();\n };\n\n public setCurrentBackground(broadcastEvent = false): ReturnType {\n const theme = themeController.getTheme();\n\n const slug = (theme.settings?.wallpaper as WallPaper.wallPaper)?.slug;\n if(slug) {\n const defaultTheme = STATE_INIT.settings.themes.find((t) => t.name === theme.name);\n // const isDefaultBackground = theme.background.blur === defaultTheme.background.blur &&\n // slug === defaultslug;\n\n // if(!isDefaultBackground) {\n return this.getBackground(slug).then((url) => {\n return this.setBackground(url, broadcastEvent);\n }, () => { // * if NO_ENTRY_FOUND\n theme.settings = copy(defaultTheme.settings); // * reset background\n return this.setCurrentBackground(true);\n });\n // }\n }\n\n return this.setBackground('', broadcastEvent);\n }\n\n private getBackground(slug: string) {\n if(this.backgroundPromises[slug]) return this.backgroundPromises[slug];\n return this.backgroundPromises[slug] = this.cacheStorage.getFile('backgrounds/' + slug).then((blob) => {\n return URL.createObjectURL(blob);\n });\n }\n\n public setBackground(url: string, broadcastEvent = true): Promise {\n this.lastBackgroundUrl = url;\n const promises = this.chats.map((chat) => chat.setBackground(url));\n return promises[promises.length - 1].then(() => {\n if(broadcastEvent) {\n rootScope.dispatchEvent('background_change');\n }\n });\n }\n\n public saveChatPosition(chat: Chat) {\n if(!(['chat', 'discussion'] as ChatType[]).includes(chat.type) || !chat.peerId) {\n return;\n }\n\n // const bubble = chat.bubbles.getBubbleByPoint('top');\n // if(bubble) {\n // const top = bubble.getBoundingClientRect().top;\n const chatBubbles = chat.bubbles;\n const key = chat.peerId + (chat.threadId ? '_' + chat.threadId : '');\n const chatPositions = stateStorage.getFromCache('chatPositions');\n if(!(chatBubbles.scrollable.getDistanceToEnd() <= 16 && chatBubbles.scrollable.loadedAll.bottom) && chatBubbles.getRenderedLength()) {\n chatBubbles.sliceViewport(true);\n const top = chatBubbles.scrollable.scrollTop;\n\n const position = {\n mids: getObjectKeysAndSort(chatBubbles.bubbles, 'desc').filter((mid) => mid > 0 && !chatBubbles.skippedMids.has(mid)),\n top\n };\n\n chatPositions[key] = position;\n\n this.log('saved chat position:', position);\n } else {\n delete chatPositions[key];\n\n this.log('deleted chat position');\n }\n\n stateStorage.set({chatPositions}, true);\n // }\n }\n\n public getChatSavedPosition(chat: Chat): ChatSavedPosition {\n if(!(['chat', 'discussion'] as ChatType[]).includes(chat.type) || !chat.peerId) {\n return;\n }\n\n const key = chat.peerId + (chat.threadId ? '_' + chat.threadId : '');\n const cache = stateStorage.getFromCache('chatPositions');\n return cache && cache[key];\n }\n\n public applyCurrentTheme(slug?: string, backgroundUrl?: string, broadcastEvent?: boolean) {\n if(backgroundUrl) {\n this.backgroundPromises[slug] = Promise.resolve(backgroundUrl);\n }\n\n themeController.setTheme();\n\n return this.setCurrentBackground(broadcastEvent === undefined ? !!slug : broadcastEvent);\n }\n\n private setSettings = () => {\n const {messagesTextSize} = rootScope.settings;\n\n this.customEmojiSize = makeMediaSize(messagesTextSize + 4, messagesTextSize + 4);\n document.documentElement.style.setProperty('--messages-text-size', messagesTextSize + 'px');\n\n const firstTime = !this.customEmojiSize;\n if(!firstTime) {\n const ellipsisElements = document.querySelectorAll('middle-ellipsis-element');\n ellipsisElements.forEach((element) => {\n element.disconnectedCallback();\n element.dataset.fontSize = '' + messagesTextSize;\n if(element.title) element.textContent = element.title;\n element.connectedCallback();\n });\n\n const renderers = document.querySelectorAll('.chat custom-emoji-renderer-element');\n renderers.forEach((renderer) => {\n renderer.forceRenderAfterSize = true;\n });\n }\n\n document.body.classList.toggle('animation-level-0', !liteMode.isAvailable('animations'));\n document.body.classList.toggle('animation-level-1', false);\n document.body.classList.toggle('animation-level-2', liteMode.isAvailable('animations'));\n\n this.chatsSelectTabDebounced = debounce(() => {\n const topbar = this.chat.topbar;\n topbar.pinnedMessage?.setCorrectIndex(0); // * буду молиться богам, чтобы это ничего не сломало, но это исправляет получение пиннеда после анимации\n\n this.managers.apiFileManager.setQueueId(this.chat.bubbles.lazyLoadQueue.queueId);\n }, liteMode.isAvailable('animations') ? 250 : 0, false, true);\n\n const c: LiteModeKey[] = ['stickers_chat', 'stickers_panel'];\n const changedLoop = animationIntersector.setLoop(rootScope.settings.stickers.loop);\n const changedAutoplay = !!c.filter((key) => animationIntersector.setAutoplay(liteMode.isAvailable(key), key)).length;\n if(changedLoop || changedAutoplay) {\n animationIntersector.checkAnimations2(false);\n }\n\n for(const chat of this.chats) {\n chat.setAutoDownloadMedia();\n }\n\n I18n.setTimeFormat(rootScope.settings.timeFormat);\n\n this.toggleChatGradientAnimation(this.chat);\n };\n\n // * не могу использовать тут TransitionSlider, так как мне нужен отрисованный блок рядом\n // * (или под текущим чатом) чтобы правильно отрендерить чат (напр. scrollTop)\n private chatsSelectTab(tab: HTMLElement, animate?: boolean) {\n if(this.prevTab === tab) {\n return;\n }\n\n if(animate === false && this.prevTab) { // * will be used for Safari iOS history swipe\n disableTransition([tab, this.prevTab].filter(Boolean));\n }\n\n if(this.prevTab) {\n this.prevTab.classList.remove('active');\n this.chatsSelectTabDebounced();\n\n // ! нужно переделать на animation, так как при лаге анимация будет длиться не 250мс\n if(liteMode.isAvailable('animations') && animate !== false) {\n dispatchHeavyAnimationEvent(pause(250 + 150), 250 + 150);\n }\n\n const prevIdx = whichChild(this.prevTab);\n const idx = whichChild(tab);\n if(idx > prevIdx) {\n appNavigationController.pushItem({\n type: 'chat',\n onPop: (canAnimate) => {\n this.setPeer({}, canAnimate);\n blurActiveElement();\n }\n });\n }\n }\n\n tab.classList.add('active');\n this.prevTab = tab;\n }\n\n private init() {\n document.addEventListener('paste', this.onDocumentPaste, true);\n\n if(!IS_TOUCH_SUPPORTED) {\n this.attachDragAndDropListeners();\n }\n\n // if(!isTouchSupported) {\n this.markupTooltip = new MarkupTooltip(this);\n this.markupTooltip.handleSelection();\n // }\n }\n\n private attachDragAndDropListeners() {\n const drops: ChatDragAndDrop[] = [];\n const mediaDrops: ChatDragAndDrop[] = [];\n let mounted = false;\n const toggle = async(e: DragEvent, mount: boolean) => {\n if(mount === mounted) return;\n\n const _types = e.dataTransfer.types;\n // @ts-ignore\n const isFiles = _types.contains ? _types.contains('Files') : _types.indexOf('Files') >= 0;\n\n const newMediaPopup = getCurrentNewMediaPopup();\n const types: string[] = await getFilesFromEvent(e, true);\n if(!isFiles || (!(await this.canDrag()) && !newMediaPopup)) { // * skip dragging text case\n counter = 0;\n return;\n }\n\n const rights = await PopupNewMedia.canSend(this.chat.peerId, true);\n\n const _dropsContainer = newMediaPopup ? mediaDropsContainer : dropsContainer;\n const _drops = newMediaPopup ? mediaDrops : drops;\n\n if(mount && !_drops.length) {\n const force = isFiles && !types.length; // * can't get file items not from 'drop' on Safari\n\n const [foundMedia, foundDocuments] = partition(types, (t) => MEDIA_MIME_TYPES_SUPPORTED.has(t));\n const [foundPhotos, foundVideos] = partition(foundMedia, (t) => IMAGE_MIME_TYPES_SUPPORTED.has(t));\n\n if(!rights.send_docs) {\n foundDocuments.length = 0;\n } else {\n foundDocuments.push(...foundMedia);\n }\n\n if(!rights.send_photos) {\n foundPhotos.forEach((mimeType) => indexOfAndSplice(foundMedia, mimeType));\n foundPhotos.length = 0;\n }\n\n if(!rights.send_videos) {\n foundVideos.forEach((mimeType) => indexOfAndSplice(foundMedia, mimeType));\n foundVideos.length = 0;\n }\n\n this.log('drag files', types, foundMedia, foundDocuments, foundPhotos, foundVideos);\n\n if(newMediaPopup) {\n newMediaPopup.appendDrops(_dropsContainer);\n\n const length = (rights.send_docs ? [foundDocuments] : [foundPhotos, foundVideos]).reduce((acc, v) => acc + v.length, 0);\n if(length || force) {\n _drops.push(new ChatDragAndDrop(_dropsContainer, {\n header: 'Preview.Dragging.AddItems',\n headerArgs: [length],\n onDrop: (e: DragEvent) => {\n toggle(e, false);\n this.log('drop', e);\n this.onDocumentPaste(e, 'document');\n }\n }));\n }\n } else {\n if(foundDocuments.length || force) {\n _drops.push(new ChatDragAndDrop(_dropsContainer, {\n icon: 'dragfiles',\n header: 'Chat.DropTitle',\n subtitle: 'Chat.DropAsFilesDesc',\n onDrop: (e: DragEvent) => {\n toggle(e, false);\n this.log('drop', e);\n this.onDocumentPaste(e, 'document');\n }\n }));\n }\n\n if(foundMedia.length || force) {\n _drops.push(new ChatDragAndDrop(_dropsContainer, {\n icon: 'dragmedia',\n header: 'Chat.DropTitle',\n subtitle: 'Chat.DropQuickDesc',\n onDrop: (e: DragEvent) => {\n toggle(e, false);\n this.log('drop', e);\n this.onDocumentPaste(e, 'media');\n }\n }));\n }\n\n this.chat.container.append(_dropsContainer);\n }\n }\n\n // if(!mount) return;\n\n SetTransition({\n element: _dropsContainer,\n className: 'is-visible',\n forwards: mount,\n duration: 200,\n onTransitionEnd: () => {\n if(!mount) {\n _drops.forEach((drop) => {\n drop.destroy();\n });\n\n _drops.length = 0;\n }\n }\n });\n\n if(mount) {\n _drops.forEach((drop) => {\n drop.setPath();\n });\n } else {\n counter = 0;\n }\n\n document.body.classList.toggle('is-dragging', mount);\n mounted = mount;\n };\n\n /* document.body.addEventListener('dragover', (e) => {\n cancelEvent(e);\n }); */\n\n let counter = 0;\n document.body.addEventListener('dragenter', (e) => {\n counter++;\n });\n\n document.body.addEventListener('dragover', (e) => {\n // this.log('dragover', e/* , e.dataTransfer.types[0] */);\n toggle(e, true);\n cancelEvent(e);\n });\n\n document.body.addEventListener('dragleave', (e) => {\n // this.log('dragleave', e, counter);\n // if((e.pageX <= 0 || e.pageX >= this.managers.appPhotosManager.windowW) || (e.pageY <= 0 || e.pageY >= this.managers.appPhotosManager.windowH)) {\n counter--;\n if(counter === 0) {\n // if(!findUpClassName(e.target, 'drops-container')) {\n toggle(e, false);\n }\n });\n\n const dropsContainer = document.createElement('div');\n dropsContainer.classList.add('drops-container');\n\n const mediaDropsContainer = dropsContainer.cloneNode(true) as HTMLElement;\n }\n\n private async canDrag() {\n const chat = this.chat;\n const peerId = chat?.peerId;\n return !(!peerId || overlayCounter.isOverlayActive || !(await chat.canSend('send_media')));\n }\n\n private onDocumentPaste = async(e: ClipboardEvent | DragEvent, attachType?: 'media' | 'document') => {\n const newMediaPopup = getCurrentNewMediaPopup();\n\n // console.log('document paste');\n // console.log('item', event.clipboardData.getData());\n\n if(e instanceof DragEvent) {\n const _types = e.dataTransfer.types;\n // @ts-ignore\n const isFiles = _types.contains ? _types.contains('Files') : _types.indexOf('Files') >= 0;\n if(isFiles) {\n cancelEvent(e);\n }\n }\n\n const files = await getFilesFromEvent(e);\n if(!(await this.canDrag()) && !newMediaPopup) return;\n if(files.length) {\n if(newMediaPopup) {\n newMediaPopup.addFiles(files);\n return;\n }\n\n const chatInput = this.chat.input;\n chatInput.willAttachType = attachType || (MEDIA_MIME_TYPES_SUPPORTED.has(files[0].type) ? 'media' : 'document');\n PopupElement.createPopup(PopupNewMedia, this.chat, files, chatInput.willAttachType);\n }\n };\n\n private async overrideHash(peerId?: PeerId) {\n let str: string;\n if(peerId) {\n const username = await this.managers.appPeersManager.getPeerUsername(peerId);\n str = username ? '@' + username : '' + peerId;\n }\n\n appNavigationController.overrideHash(str);\n }\n\n public selectTab(id: APP_TABS, animate?: boolean) {\n if(animate === false) { // * will be used for Safari iOS history swipe\n disableTransition([appSidebarLeft.sidebarEl, this.columnEl, appSidebarRight.sidebarEl]);\n }\n\n document.body.classList.toggle(LEFT_COLUMN_ACTIVE_CLASSNAME, id === APP_TABS.CHATLIST);\n\n const prevTabId = this.tabId;\n if(prevTabId !== undefined) {\n this.overrideHash(id > APP_TABS.CHATLIST ? this.chat?.peerId : undefined);\n this.dispatchEvent('tab_changing', id);\n }\n\n this.log('selectTab', id, prevTabId);\n\n let animationPromise: Promise = liteMode.isAvailable('animations') ? doubleRaf() : Promise.resolve();\n if(\n prevTabId !== undefined &&\n prevTabId !== id &&\n liteMode.isAvailable('animations') &&\n animate !== false/* &&\n mediaSizes.activeScreen !== ScreenSize.large */\n ) {\n const transitionTime = (mediaSizes.isMobile ? 250 : 200) + 100; // * cause transition time could be > 250ms\n animationPromise = pause(transitionTime);\n dispatchHeavyAnimationEvent(animationPromise, transitionTime);\n\n // ! it's very heavy operation. will blink in firefox\n /* this.columnEl.classList.add('disable-hover');\n animationPromise.finally(() => {\n this.columnEl.classList.remove('disable-hover');\n }); */\n }\n\n this.tabId = id;\n blurActiveElement();\n if(mediaSizes.isMobile && prevTabId === APP_TABS.PROFILE && id < APP_TABS.PROFILE) {\n document.body.classList.remove(RIGHT_COLUMN_ACTIVE_CLASSNAME);\n }\n\n if(prevTabId !== undefined && id > prevTabId) {\n if(id < APP_TABS.PROFILE || !appNavigationController.findItemByType('im')) {\n appNavigationController.pushItem({\n type: 'im',\n onPop: (canAnimate) => {\n // this.selectTab(prevTabId, !isSafari);\n this.setPeer({}, canAnimate);\n }\n });\n }\n }\n\n const onImTabChange = (window as any).onImTabChange;\n onImTabChange && onImTabChange(id);\n\n // this._selectTab(id, mediaSizes.isMobile);\n // document.body.classList.toggle(RIGHT_COLUMN_ACTIVE_CLASSNAME, id === 2);\n\n return animationPromise;\n }\n\n public updateStatus() {\n return this.managers.appUsersManager.updateMyOnlineStatus(this.offline);\n }\n\n private createNewChat() {\n const chat = new Chat(\n this,\n this.managers\n );\n\n if(this.chats.length) {\n chat.setBackground(this.lastBackgroundUrl, true);\n }\n\n this.chats.push(chat);\n\n return chat;\n }\n\n private spliceChats(fromIndex: number, justReturn = true, animate?: boolean, spliced?: Chat[]) {\n if(fromIndex >= this.chats.length) return;\n\n const chatFrom = this.chat;\n if(this.chats.length > 1 && justReturn) {\n this.dispatchEvent('peer_changing', this.chat);\n }\n\n if(!spliced) {\n spliced = this.chats.splice(fromIndex, this.chats.length - fromIndex);\n }\n\n const chatTo = this.chat;\n this.dispatchEvent('chat_changing', {from: chatFrom, to: chatTo});\n\n // * -1 because one item is being sliced when closing the chat by calling .removeByType\n for(let i = 0; i < spliced.length - 1; ++i) {\n appNavigationController.removeByType('chat', true);\n }\n\n // * fix middle chat z-index on animation\n if(spliced.length > 1) {\n spliced.slice(0, -1).forEach((chat) => {\n chat.container.remove();\n });\n }\n\n this.chatsSelectTab(chatTo.container, animate);\n\n if(justReturn) {\n this.dispatchEvent('peer_changed', chatTo);\n\n const searchTab = appSidebarRight.getTab(AppPrivateSearchTab);\n searchTab?.close();\n\n appSidebarRight.replaceSharedMediaTab(chatTo.sharedMediaTab);\n }\n\n spliced.forEach((chat) => {\n chat.beforeDestroy();\n });\n\n setTimeout(() => {\n // chat.setPeer(0);\n spliced.forEach((chat) => {\n chat.destroy();\n });\n }, 250 + 100);\n }\n\n public async setPeer(options: Partial = {}, animate?: boolean): Promise {\n if(this.init) {\n this.init();\n this.init = null;\n }\n\n options.peerId ??= NULL_PEER_ID;\n\n const {peerId, lastMsgId, threadId} = options;\n\n const chat = this.chat;\n const chatIndex = this.chats.indexOf(chat);\n const isSamePeer = this.isSamePeer(chat, options as any);\n if(!peerId) {\n if(chatIndex > 0) {\n this.spliceChats(chatIndex, undefined, animate);\n return;\n } else if(mediaSizes.activeScreen === ScreenSize.medium) { // * floating sidebar case\n this.selectTab(+!this.tabId, animate);\n return;\n }\n } else if(chatIndex > 0 && chat.peerId && !isSamePeer) {\n // const firstChat = this.chats[0];\n // if(firstChat.peerId !== chat.peerId) {\n /* // * slice idx > 0, set background and slice first, so new one will be the first\n const spliced = this.chats.splice(1, this.chats.length - 1);\n this.createNewChat();\n this.chats.splice(0, 1); */\n const spliced = this.chats.splice(1, this.chats.length - 1);\n if(this.chat.peerId === peerId) {\n this.spliceChats(0, true, true, spliced);\n return;\n } else {\n const ret = this.setPeer(options);\n this.spliceChats(0, false, false, spliced);\n return ret;\n }\n // } else {\n // this.spliceChats(1, false, animate);\n // }\n\n // return ret;\n }\n\n // * don't reset peer if returning\n if(isSamePeer && mediaSizes.activeScreen <= ScreenSize.medium && document.body.classList.contains(LEFT_COLUMN_ACTIVE_CLASSNAME)) {\n this.selectTab(APP_TABS.CHAT, animate);\n return false;\n }\n\n if(peerId || mediaSizes.activeScreen !== ScreenSize.mobile) {\n const result = await chat.setPeer(options as any as Parameters[0]);\n\n // * wait for cached render\n const promise = result?.cached ? result.promise : Promise.resolve();\n if(peerId) {\n Promise.all([\n promise,\n chat.setBackgroundPromise\n ]).then(() => {\n // window.requestAnimationFrame(() => {\n setTimeout(() => { // * setTimeout is better here\n setTimeout(() => {\n this.chatsSelectTab(this.chat.container);\n }, 0);\n this.selectTab(APP_TABS.CHAT, animate);\n }, 0);\n });\n }\n }\n\n if(!peerId) {\n this.selectTab(APP_TABS.CHATLIST, animate);\n return false;\n }\n }\n\n public async setInnerPeer(options: ChatSetInnerPeerOptions) {\n const {peerId} = options;\n if(peerId === NULL_PEER_ID || !peerId) {\n return;\n }\n\n if(!options.type) {\n if(options.threadId && !(await this.managers.appPeersManager.isForum(options.peerId))) {\n options.type = 'discussion';\n }\n\n options.type ??= 'chat';\n }\n\n // * reuse current chat\n const existingIndex = this.chats.findIndex((chat) => this.isSamePeer(chat, options) || (mediaSizes.activeScreen === ScreenSize.mobile && this.tabId === 0));\n if(existingIndex !== -1) {\n this.spliceChats(existingIndex + 1);\n return this.setPeer(options);\n }\n\n const oldChat = this.chat;\n let chat = oldChat;\n if(oldChat.inited) { // * use first not inited chat\n chat = this.createNewChat();\n }\n\n this.dispatchEvent('chat_changing', {from: oldChat, to: chat});\n\n // this.chatsSelectTab(chat.container);\n\n return this.setPeer(options);\n }\n\n public openScheduled(peerId: PeerId) {\n this.setInnerPeer({\n peerId,\n type: 'scheduled'\n });\n }\n\n private getTypingElement(action: SendMessageAction) {\n const el = document.createElement('span');\n let c = 'peer-typing';\n el.classList.add(c);\n el.dataset.action = action._;\n switch(action._) {\n case 'sendMessageTypingAction': {\n // default: {\n c += '-text';\n for(let i = 0; i < 3; ++i) {\n const dot = document.createElement('span');\n dot.className = c + '-dot';\n el.append(dot);\n }\n break;\n }\n\n case 'sendMessageUploadAudioAction':\n case 'sendMessageUploadDocumentAction':\n case 'sendMessageUploadRoundAction':\n case 'sendMessageUploadVideoAction':\n case 'sendMessageUploadPhotoAction': {\n c += '-upload';\n /* const trail = document.createElement('span');\n trail.className = c + '-trail';\n el.append(trail); */\n break;\n }\n\n case 'sendMessageRecordAudioAction':\n case 'sendMessageRecordRoundAction':\n case 'sendMessageRecordVideoAction': {\n c += '-record';\n break;\n }\n\n case 'sendMessageEmojiInteractionSeen':\n case 'sendMessageChooseStickerAction': {\n c += '-choosing-sticker';\n for(let i = 0; i < 2; ++i) {\n const eye = document.createElement('div');\n eye.className = c + '-eye';\n el.append(eye);\n }\n break;\n }\n }\n\n el.classList.add(c);\n\n return el;\n }\n\n public async getPeerTyping(peerId: PeerId, container?: HTMLElement, threadId?: number) {\n // const log = this.log.bindPrefix('getPeerTyping-' + peerId);\n // log('getting peer typing');\n\n const isUser = peerId.isUser();\n if(isUser && await this.managers.appUsersManager.isBot(peerId)) {\n // log('a bot');\n return;\n }\n\n const typings = await this.managers.appProfileManager.getPeerTypings(peerId, threadId);\n if(!typings?.length) {\n // log('have no typing');\n return;\n }\n\n const typing = typings[0];\n\n const langPackKeys: {\n [peerType in 'private' | 'chat' | 'multi']?: Partial<{[action in SendMessageAction['_']]: LangPackKey}>\n } = {\n private: {\n 'sendMessageTypingAction': 'Peer.Activity.User.TypingText',\n 'sendMessageUploadAudioAction': 'Peer.Activity.User.SendingFile',\n 'sendMessageUploadDocumentAction': 'Peer.Activity.User.SendingFile',\n 'sendMessageUploadPhotoAction': 'Peer.Activity.User.SendingPhoto',\n 'sendMessageUploadVideoAction': 'Peer.Activity.User.SendingVideo',\n 'sendMessageUploadRoundAction': 'Peer.Activity.User.SendingVideo',\n 'sendMessageRecordVideoAction': 'Peer.Activity.User.RecordingVideo',\n 'sendMessageRecordAudioAction': 'Peer.Activity.User.RecordingAudio',\n 'sendMessageRecordRoundAction': 'Peer.Activity.User.RecordingVideo',\n 'sendMessageGamePlayAction': 'Peer.Activity.User.PlayingGame',\n 'sendMessageChooseStickerAction': 'Peer.Activity.User.ChoosingSticker',\n 'sendMessageEmojiInteractionSeen': 'Peer.Activity.User.EnjoyingAnimations'\n },\n chat: {\n 'sendMessageTypingAction': 'Peer.Activity.Chat.TypingText',\n 'sendMessageUploadAudioAction': 'Peer.Activity.Chat.SendingFile',\n 'sendMessageUploadDocumentAction': 'Peer.Activity.Chat.SendingFile',\n 'sendMessageUploadPhotoAction': 'Peer.Activity.Chat.SendingPhoto',\n 'sendMessageUploadVideoAction': 'Peer.Activity.Chat.SendingVideo',\n 'sendMessageUploadRoundAction': 'Peer.Activity.Chat.SendingVideo',\n 'sendMessageRecordVideoAction': 'Peer.Activity.Chat.RecordingVideo',\n 'sendMessageRecordAudioAction': 'Peer.Activity.Chat.RecordingAudio',\n 'sendMessageRecordRoundAction': 'Peer.Activity.Chat.RecordingVideo',\n 'sendMessageGamePlayAction': 'Peer.Activity.Chat.PlayingGame',\n 'sendMessageChooseStickerAction': 'Peer.Activity.Chat.ChoosingSticker',\n 'sendMessageEmojiInteractionSeen': 'Peer.Activity.Chat.EnjoyingAnimations'\n },\n multi: {\n 'sendMessageTypingAction': 'Peer.Activity.Chat.Multi.TypingText1',\n 'sendMessageUploadAudioAction': 'Peer.Activity.Chat.Multi.SendingFile1',\n 'sendMessageUploadDocumentAction': 'Peer.Activity.Chat.Multi.SendingFile1',\n 'sendMessageUploadPhotoAction': 'Peer.Activity.Chat.Multi.SendingPhoto1',\n 'sendMessageUploadVideoAction': 'Peer.Activity.Chat.Multi.SendingVideo1',\n 'sendMessageUploadRoundAction': 'Peer.Activity.Chat.Multi.SendingVideo1',\n 'sendMessageRecordVideoAction': 'Peer.Activity.Chat.Multi.RecordingVideo1',\n 'sendMessageRecordAudioAction': 'Peer.Activity.Chat.Multi.RecordingAudio1',\n 'sendMessageRecordRoundAction': 'Peer.Activity.Chat.Multi.RecordingVideo1',\n 'sendMessageGamePlayAction': 'Peer.Activity.Chat.Multi.PlayingGame1',\n 'sendMessageChooseStickerAction': 'Peer.Activity.Chat.Multi.ChoosingSticker1'\n }\n };\n\n const mapa = isUser ? langPackKeys.private : (typings.length > 1 ? langPackKeys.multi : langPackKeys.chat);\n let action = typing.action;\n\n if(typings.length > 1) {\n const s: any = {};\n typings.forEach((typing) => {\n const type = typing.action._;\n if(s[type] === undefined) s[type] = 0;\n ++s[type];\n });\n\n if(Object.keys(s).length > 1) {\n action = {\n _: 'sendMessageTypingAction'\n };\n }\n }\n\n const langPackKey = mapa[action._];\n if(!langPackKey) {\n // log('no langPackKey');\n return;\n }\n\n let peerTitlePromise: Promise;\n let args: any[];\n if(peerId.isAnyChat()) {\n const peerTitle = new PeerTitle();\n peerTitlePromise = peerTitle.update({peerId: typing.userId.toPeerId(false), onlyFirstName: true});\n args = [\n peerTitle.element,\n typings.length - 1\n ];\n\n await peerTitlePromise;\n }\n\n if(!container) {\n container = document.createElement('span');\n container.classList.add('online', 'peer-typing-container');\n }\n\n container.classList.toggle('peer-typing-flex', action._ === 'sendMessageChooseStickerAction' || action._ === 'sendMessageEmojiInteractionSeen');\n\n let typingElement = container.firstElementChild as HTMLElement;\n if(!typingElement) {\n typingElement = this.getTypingElement(action);\n container.prepend(typingElement);\n } else {\n if(typingElement.dataset.action !== action._) {\n typingElement.replaceWith(this.getTypingElement(action));\n }\n }\n\n if(action._ === 'sendMessageEmojiInteractionSeen') {\n if(args) {\n args.pop();\n } else {\n args = [];\n }\n\n const span = htmlToSpan(wrapEmojiText(action.emoticon));\n args.push(span);\n }\n\n const descriptionElement = i18n(langPackKey, args);\n descriptionElement.classList.add('peer-typing-description');\n\n if(container.childElementCount > 1) container.lastElementChild.replaceWith(descriptionElement);\n else container.append(descriptionElement);\n\n // log('returning typing');\n return container;\n }\n\n private async getChatStatus(chatId: ChatId, noTyping?: boolean): Promise> {\n const typingEl = noTyping ? undefined : await this.getPeerTyping(chatId.toPeerId(true));\n if(typingEl) {\n return {cached: true, result: Promise.resolve(typingEl)};\n }\n\n const result = await this.managers.acknowledged.appProfileManager.getChatFull(chatId);\n const dooo = async(chatInfo: ChatFull) => {\n // this.chat.log('chatInfo res:', chatInfo);\n\n const participants_count = (chatInfo as ChatFull.channelFull).participants_count ||\n ((chatInfo as ChatFull.chatFull).participants as ChatParticipants.chatParticipants)?.participants?.length ||\n 1;\n // if(participants_count) {\n let subtitle = await getChatMembersString(chatId);\n\n if(participants_count < 2) {\n return subtitle;\n }\n\n const onlines = await this.managers.appProfileManager.getOnlines(chatId);\n if(onlines > 1) {\n const span = document.createElement('span');\n\n span.append(...join([subtitle, i18n('OnlineCount', [numberThousandSplitter(onlines)])], false));\n subtitle = span;\n }\n\n return subtitle;\n // }\n };\n\n const promise = Promise.resolve(result.result).then(dooo);\n return {\n cached: result.cached,\n result: promise\n };\n }\n\n private async getUserStatus(userId: UserId, ignoreSelf?: boolean) {\n const result: AckedResult = {\n cached: true,\n result: Promise.resolve(undefined as HTMLElement)\n };\n\n const user = await this.managers.appUsersManager.getUser(userId);\n if(!user || (user.pFlags.self && !ignoreSelf)) {\n return result;\n }\n\n const subtitle = getUserStatusString(user);\n\n if(!user.pFlags.bot && !user.pFlags.support) {\n let typingEl = await this.getPeerTyping(userId.toPeerId());\n if(!typingEl && user.status?._ === 'userStatusOnline') {\n typingEl = document.createElement('span');\n typingEl.classList.add('online');\n typingEl.append(subtitle);\n }\n\n if(typingEl) {\n result.result = Promise.resolve(typingEl);\n return result;\n }\n }\n\n result.result = Promise.resolve(subtitle);\n return result;\n }\n\n private async getPeerStatus(peerId: PeerId, ignoreSelf?: boolean, noTyping?: boolean) {\n if(!peerId) return;\n let promise: Promise>;\n if(peerId.isAnyChat()) {\n promise = this.getChatStatus(peerId.toChatId(), noTyping);\n } else {\n promise = this.getUserStatus(peerId.toUserId(), ignoreSelf);\n }\n\n return promise;\n }\n\n public async setPeerStatus(options: {\n peerId: PeerId,\n element: HTMLElement,\n needClear: boolean,\n useWhitespace: boolean,\n middleware: () => boolean,\n ignoreSelf?: boolean,\n noTyping?: boolean\n }) {\n // const log = this.log.bindPrefix('status-' + peerId);\n // log('setting status', element);\n\n const {peerId, element, needClear, useWhitespace, middleware, ignoreSelf, noTyping} = options;\n\n if(!needClear) {\n // * good good good\n const typingContainer = element.querySelector('.peer-typing-container') as HTMLElement;\n if(typingContainer && await this.getPeerTyping(peerId, typingContainer)) {\n // log('already have a status');\n return;\n }\n }\n\n const result = await this.getPeerStatus(peerId, ignoreSelf, noTyping);\n // log('getPeerStatus result', result);\n if(!middleware()) {\n // log.warn('middleware');\n return;\n }\n\n const set = async() => {\n const subtitle = result && await result.result;\n if(!middleware()) {\n return;\n }\n\n return () => replaceContent(element, subtitle || placeholder);\n };\n\n const placeholder = useWhitespace ? NBSP : ''; // ! HERE U CAN FIND WHITESPACE\n if(!result || result.cached || needClear === undefined) {\n return await set();\n } else if(needClear) {\n return () => {\n element.textContent = placeholder;\n return set().then((callback) => callback?.());\n };\n }\n }\n\n public setChoosingStickerTyping(cancel: boolean) {\n this.managers.appMessagesManager.setTyping(this.chat.peerId, {_: cancel ? 'sendMessageCancelAction' : 'sendMessageChooseStickerAction'}, undefined, this.chat.threadId);\n }\n\n public isSamePeer(options1: {peerId: PeerId, threadId?: number, type?: ChatType}, options2: typeof options1) {\n return options1.peerId === options2.peerId &&\n options1.threadId === options2.threadId &&\n (typeof(options1.type) !== typeof(options2.type) || options1.type === options2.type);\n }\n}\n\nconst appImManager = new AppImManager();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.appImManager = appImManager);\nexport default appImManager;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport enum INTERNAL_LINK_TYPE {\n MESSAGE,\n PRIVATE_POST,\n STICKER_SET,\n JOIN_CHAT,\n VOICE_CHAT,\n USER_PHONE_NUMBER,\n INVOICE,\n EMOJI_SET\n};\n\nexport type InternalLink = InternalLink.InternalLinkMessage | InternalLink.InternalLinkPrivatePost | InternalLink.InternalLinkStickerSet | InternalLink.InternalLinkJoinChat | InternalLink.InternalLinkVoiceChat | InternalLink.InternalLinkUserPhoneNumber | InternalLink.InternalLinkInvoice | InternalLink.InternalLinkEmojiSet;\n\nexport namespace InternalLink {\n export interface InternalLinkMessage {\n _: INTERNAL_LINK_TYPE.MESSAGE,\n domain: string,\n post?: string,\n comment?: string,\n thread?: string,\n start?: string,\n t?: string, // media timestamp\n stack?: number // local\n }\n\n export interface InternalLinkPrivatePost {\n _: INTERNAL_LINK_TYPE.PRIVATE_POST,\n channel: string,\n post: string,\n thread?: string,\n comment?: string,\n t?: string // media timestamp\n stack?: number // local\n }\n\n export interface InternalLinkStickerSet {\n _: INTERNAL_LINK_TYPE.STICKER_SET,\n set: string\n }\n\n export interface InternalLinkJoinChat {\n _: INTERNAL_LINK_TYPE.JOIN_CHAT,\n invite: string\n }\n\n /**\n * LOCAL LINK\n */\n export interface InternalLinkVoiceChat {\n _: INTERNAL_LINK_TYPE.VOICE_CHAT,\n id: string,\n access_hash: string,\n chat_id: string\n }\n\n export interface InternalLinkUserPhoneNumber {\n _: INTERNAL_LINK_TYPE.USER_PHONE_NUMBER,\n phone: string\n }\n\n export interface InternalLinkInvoice {\n _: INTERNAL_LINK_TYPE.INVOICE,\n slug: string\n }\n\n export interface InternalLinkEmojiSet {\n _: INTERNAL_LINK_TYPE.EMOJI_SET,\n set: string\n }\n}\n\nexport type InternalLinkTypeMap = {\n [INTERNAL_LINK_TYPE.MESSAGE]: InternalLink.InternalLinkMessage,\n [INTERNAL_LINK_TYPE.PRIVATE_POST]: InternalLink.InternalLinkPrivatePost,\n [INTERNAL_LINK_TYPE.STICKER_SET]: InternalLink.InternalLinkStickerSet,\n [INTERNAL_LINK_TYPE.JOIN_CHAT]: InternalLink.InternalLinkJoinChat,\n [INTERNAL_LINK_TYPE.VOICE_CHAT]: InternalLink.InternalLinkVoiceChat,\n [INTERNAL_LINK_TYPE.USER_PHONE_NUMBER]: InternalLink.InternalLinkUserPhoneNumber,\n [INTERNAL_LINK_TYPE.INVOICE]: InternalLink.InternalLinkInvoice,\n [INTERNAL_LINK_TYPE.EMOJI_SET]: InternalLink.InternalLinkEmojiSet\n};\n","import {Message, MessageMedia} from '../../../../layer';\n\nexport default function canSaveMessageMedia(message: Message.message | Message.messageService) {\n return message &&\n !message.pFlags.is_outgoing &&\n !(message as Message.message).pFlags.noforwards &&\n !((message as Message.message).media as MessageMedia.messageMediaInvoice)?.extended_media\n}\n","import {Document, Game, Message, MessageAction, MessageExtendedMedia, MessageMedia, Photo, WebPage} from '../../../../layer';\n\nexport default function getMediaFromMessage(message: Message, onlyInner: true): Photo.photo | Document.document;\nexport default function getMediaFromMessage(message: Message, onlyInner?: false): Photo.photo | Document.document | Game.game | WebPage.webPage;\nexport default function getMediaFromMessage(message: Message, onlyInner = false): Photo.photo | Document.document | Game.game | WebPage.webPage {\n if(!message) return;\n\n let media: any;\n if((message as Message.messageService).action) {\n media = ((message as Message.messageService).action as MessageAction.messageActionChannelEditPhoto).photo;\n } else if((message as Message.message).media) {\n let messageMedia = (message as Message.message).media;\n if((messageMedia as MessageMedia.messageMediaWebPage).webpage) {\n messageMedia = (messageMedia as MessageMedia.messageMediaWebPage).webpage as any as MessageMedia;\n } else if((messageMedia as MessageMedia.messageMediaInvoice).extended_media?._ === 'messageExtendedMedia') {\n messageMedia = ((messageMedia as MessageMedia.messageMediaInvoice).extended_media as MessageExtendedMedia.messageExtendedMedia).media;\n }\n\n media = (messageMedia as MessageMedia.messageMediaDocument).document ||\n (messageMedia as MessageMedia.messageMediaPhoto).photo ||\n (onlyInner ? undefined : (messageMedia as MessageMedia.messageMediaGame).game || messageMedia);\n }\n\n return media as any;\n}\n","import {Message} from '../../../../layer';\nimport type {MyMessage} from '../../appMessagesManager';\n\nexport default function getMessageSenderPeerIdOrName(message: MyMessage) {\n if(message.fromId) {\n return {\n peerId: message.fromId\n };\n } else {\n return {\n fromName: (message as Message.message).fwd_from?.from_name\n };\n }\n}\n","import {isRestricted} from '../../../../helpers/restrictions';\nimport {Message} from '../../../../layer';\n\nexport default function isMessageRestricted(message: Message.message) {\n return !!(message.restriction_reason && isRestricted(message.restriction_reason));\n}\n","// https://github.com/eelcohn/Telegram-API/wiki/Calculating-color-for-a-Telegram-user-on-IRC\n/*\n HTML-color IRC-color Description\n #c03d33 4 red\n #4fad2d 3 green\n #d09306 7 yellow\n #168acd 10 blue\n #8544d6 6 purple\n #cd4073 13 pink\n #2996ad 11 sea\n #ce671b 5 orange\n*/\nconst DialogColorsFg = ['#fc5c51', '#0fb297', '#d09306', '#3d72ed', '#895dd5', '#cd4073', '#00c1a6', '#fa790f'];\nconst DialogColors = ['red', 'green', 'yellow', 'blue', 'violet', 'pink', 'cyan', 'orange'];\nconst DialogColorsMap = [0, 7, 4, 1, 6, 3, 5];\n\nexport default function getPeerColorById(peerId: PeerId, pic = true) {\n if(!peerId) return '';\n\n const idx = DialogColorsMap[Math.abs(+peerId) % 7];\n const color = (pic ? DialogColors : DialogColorsFg)[idx];\n return color;\n}\n","import {Chat, User} from '../../../../layer';\n\nexport default function getPeerEditableUsername(peer: User.user | Chat.channel) {\n if(peer.username) {\n return peer.username;\n }\n\n const usernames = peer.usernames;\n const username = usernames?.find((username) => username.pFlags.editable);\n return username?.username;\n}\n","import isObject from '../../../../helpers/object/isObject';\nimport {InputChannel, InputPeer, Peer} from '../../../../layer';\nimport {NULL_PEER_ID} from '../../../mtproto/mtproto_config';\n\nexport default function getPeerId(peerId: {user_id: UserId} | {channel_id: ChatId} | {chat_id: ChatId} | InputPeer | InputChannel | PeerId | string): PeerId {\n if(peerId !== undefined && ((peerId as string).isPeerId ? (peerId as string).isPeerId() : false)) return peerId as PeerId;\n // if(typeof(peerId) === 'string' && /^[uc]/.test(peerId)) return peerId as PeerId;\n // if(typeof(peerId) === 'number') return peerId;\n else if(isObject(peerId)) {\n const userId = (peerId as Peer.peerUser).user_id;\n if(userId !== undefined) {\n return userId.toPeerId(false);\n }\n\n const chatId = (peerId as Peer.peerChannel).channel_id || (peerId as Peer.peerChat).chat_id;\n if(chatId !== undefined) {\n return chatId.toPeerId(true);\n }\n\n return NULL_PEER_ID; // maybe it is an inputPeerSelf\n // } else if(!peerId) return 'u0';\n } else if(!peerId) return NULL_PEER_ID;\n\n const isUser = (peerId as string).charAt(0) === 'u';\n const peerParams = (peerId as string).substr(1).split('_');\n\n return isUser ? peerParams[0].toPeerId() : (peerParams[0] || '').toPeerId(true);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from '../../appDocsManager';\nimport type {MyPhoto} from '../../appPhotosManager';\nimport type {PhotoSize, VideoSize, WebDocument} from '../../../../layer';\nimport calcImageInBox from '../../../../helpers/calcImageInBox';\nimport {THUMB_TYPE_FULL} from '../../../mtproto/mtproto_config';\n\nexport default function choosePhotoSize(\n photo: MyPhoto | MyDocument | WebDocument,\n boxWidth = 0,\n boxHeight = 0,\n useBytes = false,\n pushDocumentSize = false\n) {\n if(window.devicePixelRatio > 1) {\n boxWidth *= 2;\n boxHeight *= 2;\n }\n\n /*\n s box 100x100\n m box 320x320\n x box 800x800\n y box 1280x1280\n w box 2560x2560\n a crop 160x160\n b crop 320x320\n c crop 640x640\n d crop 1280x1280 */\n\n let sizes: PhotoSize[] = (photo as MyPhoto).sizes || (photo as MyDocument).thumbs as PhotoSize[];\n let bestPhotoSize: typeof sizes[0] = {_: 'photoSizeEmpty', type: THUMB_TYPE_FULL};\n if(pushDocumentSize && sizes && photo._ !== 'photo') {\n sizes = sizes.concat({\n _: 'photoSize',\n w: photo.w,\n h: photo.h,\n size: photo.size,\n type: THUMB_TYPE_FULL\n });\n }\n\n if(sizes?.length) {\n for(let i = 0, length = sizes.length; i < length; ++i) {\n const photoSize = sizes[i];\n if(!('w' in photoSize) && !('h' in photoSize)) continue;\n\n bestPhotoSize = photoSize;\n\n const size = calcImageInBox(photoSize.w, photoSize.h, boxWidth, boxHeight);\n if(size.width >= boxWidth || size.height >= boxHeight) {\n break;\n }\n }\n\n if(useBytes && bestPhotoSize._ === 'photoSizeEmpty' && sizes[0]._ === 'photoStrippedSize') {\n bestPhotoSize = sizes[0];\n }\n }\n\n return bestPhotoSize;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport safeAssign from '../../helpers/object/safeAssign';\nimport {logger} from '../logger';\nimport createDataChannel from './helpers/createDataChannel';\nimport createPeerConnection from './helpers/createPeerConnection';\nimport LocalConferenceDescription from './localConferenceDescription';\nimport StreamManager from './streamManager';\nimport {Ssrc} from './types';\n\nexport type CallConnectionInstanceOptions = {\n streamManager: StreamManager,\n connection?: RTCPeerConnection,\n log?: ReturnType\n};\n\nexport default abstract class CallConnectionInstanceBase {\n public connection: RTCPeerConnection;\n public streamManager: StreamManager;\n public dataChannel: RTCDataChannel;\n public description: LocalConferenceDescription;\n public sources: {\n audio: Ssrc,\n video?: Ssrc,\n };\n protected negotiating: Promise;\n protected log: ReturnType;\n\n constructor(options: CallConnectionInstanceOptions) {\n safeAssign(this, options);\n\n if(!this.log) {\n this.log = this.connection?.log || logger('CALL-CONNECTION-BASE');\n }\n\n this.sources = {} as any;\n }\n\n public createPeerConnection(config?: RTCConfiguration) {\n return this.connection || (this.connection = createPeerConnection(config, this.log.bindPrefix('connection')).connection);\n }\n\n public createDataChannel(dict?: RTCDataChannelInit) {\n return this.dataChannel || (this.dataChannel = createDataChannel(this.connection, dict, this.log.bindPrefix('data')));\n }\n\n public createDescription() {\n return this.description || (this.description = new LocalConferenceDescription(this.connection));\n }\n\n public appendStreamToConference() {\n return this.streamManager.appendToConference(this.description);\n }\n\n public closeConnection() {\n const {connection} = this;\n if(!connection) {\n return;\n }\n\n try {\n connection.log('close');\n connection.close();\n } catch(e) {\n this.log.error(e);\n }\n }\n\n public closeConnectionAndStream(stopStream: boolean) {\n this.closeConnection();\n stopStream && this.streamManager.stop();\n }\n\n protected abstract negotiateInternal(): CallConnectionInstanceBase['negotiating'];\n\n public negotiate() {\n const promise = this.negotiating;\n if(promise) {\n return promise;\n }\n\n return this.negotiating = this.negotiateInternal().finally(() => {\n this.negotiating = undefined;\n });\n }\n\n public sendDataChannelData(data: any) {\n if(this.dataChannel.readyState !== 'open') {\n return;\n }\n\n this.dataChannel.send(JSON.stringify(data));\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Logger, logger} from '../../logger';\n\nexport default function createPeerConnection(config: RTCConfiguration, log?: Logger) {\n if(!log) {\n log = logger('RTCPeerConnection');\n }\n\n log('constructor');\n\n // @ts-ignore\n const connection = new RTCPeerConnection(config);\n connection.addEventListener('track', (event) => {\n log('ontrack', event);\n });\n connection.addEventListener('signalingstatechange', () => {\n log('onsignalingstatechange', connection.signalingState);\n });\n connection.addEventListener('connectionstatechange', () => {\n log('onconnectionstatechange', connection.connectionState);\n });\n connection.addEventListener('negotiationneeded', () => { // * will be fired every time input device changes\n log('onnegotiationneeded', connection.signalingState);\n });\n connection.addEventListener('icecandidate', (event) => {\n log('onicecandidate', event);\n });\n connection.addEventListener('iceconnectionstatechange', () => {\n log('oniceconnectionstatechange', connection.iceConnectionState);\n });\n connection.addEventListener('datachannel', () => {\n log('ondatachannel');\n });\n\n connection.log = log;\n\n return {connection};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Logger, logger} from '../../logger';\n\nexport default function createDataChannel(connection: RTCPeerConnection, dict?: RTCDataChannelInit, log?: Logger) {\n // return;\n\n if(!log) {\n log = logger('RTCDataChannel');\n }\n\n const channel = connection.createDataChannel('data', dict);\n\n channel.addEventListener('message', (e) => {\n log('onmessage', e);\n });\n channel.addEventListener('open', () => {\n log('onopen');\n });\n channel.addEventListener('close', () => {\n log('onclose');\n });\n\n channel.log = log;\n\n return channel;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport SDP from '../sdp';\nimport {CallSignalingData, P2PVideoCodec} from '../types';\nimport parseMediaSectionInfo from './parseMediaSectionInfo';\n\nexport default function parseSignalingData(sdp: SDP) {\n const info = parseMediaSectionInfo(sdp, sdp.media[0]);\n\n const data: CallSignalingData.initialSetup = {\n '@type': 'InitialSetup',\n 'fingerprints': [info.fingerprint],\n 'ufrag': info.ufrag,\n 'pwd': info.pwd,\n 'audio': undefined,\n 'video': undefined,\n 'screencast': undefined\n };\n\n const convertNumber = (number: number) => '' + number;\n\n for(const section of sdp.media) {\n const mediaType = section.mediaType;\n if(mediaType === 'application' || !section.isSending) {\n continue;\n }\n\n const codec: P2PVideoCodec = data[mediaType === 'video' && data['video'] ? 'screencast' : mediaType] = {} as any;\n const info = parseMediaSectionInfo(sdp, section);\n codec.ssrc = convertNumber(info.source);\n\n if(info.sourceGroups) {\n codec.ssrcGroups = info.sourceGroups.map((sourceGroup) => ({semantics: sourceGroup.semantics, ssrcs: sourceGroup.sources.map(convertNumber)}));\n }\n\n const rtpExtensions: P2PVideoCodec['rtpExtensions'] = codec.rtpExtensions = [];\n section.attributes.get('extmap').forEach((attribute) => {\n rtpExtensions.push({\n id: +attribute.key,\n uri: attribute.value\n });\n });\n\n const payloadTypesMap: Map = new Map();\n\n const getPayloadType = (id: number) => {\n let payloadType = payloadTypesMap.get(id);\n if(!payloadType) {\n payloadTypesMap.set(id, payloadType = {\n id\n } as any);\n }\n\n return payloadType;\n };\n\n section.attributes.get('rtpmap').forEach((attribute) => {\n const id = +attribute.key;\n const payloadType = getPayloadType(id);\n const splitted = attribute.value.split('/');\n const [name, clockrate, channels] = splitted;\n payloadType.name = name;\n payloadType.clockrate = +clockrate;\n payloadType.channels = channels ? +channels : 0;\n });\n\n section.attributes.get('rtcp-fb').forEach((attribute) => {\n const id = +attribute.key;\n const payloadType = getPayloadType(id);\n payloadType.feedbackTypes = attribute.lines.map((line) => {\n const splitted = line.split(' ');\n const [type, subtype] = splitted;\n return {\n type,\n subtype: subtype || ''\n };\n });\n });\n\n section.attributes.get('fmtp').forEach((attribute) => {\n const id = +attribute.key;\n const payloadType = getPayloadType(id);\n const parameters: P2PVideoCodec['payloadTypes'][0]['parameters'] = payloadType.parameters = {};\n const splitted = attribute.value.split(';');\n for(const str of splitted) {\n const [key, value] = str.split('=');\n parameters[key] = value;\n }\n });\n\n codec.payloadTypes = Array.from(payloadTypesMap.values());\n\n /* if(codec.payloadTypes.length > 5) {\n codec.payloadTypes.length = Math.min(codec.payloadTypes.length, 5);\n } */\n }\n\n return data;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport CallConnectionInstanceBase, {CallConnectionInstanceOptions} from './callConnectionInstanceBase';\nimport CallInstance from './callInstance';\nimport parseSignalingData from './helpers/parseSignalingData';\nimport {parseSdp} from './sdp/utils';\n\nexport default class CallConnectionInstance extends CallConnectionInstanceBase {\n private call: CallInstance;\n\n constructor(options: CallConnectionInstanceOptions & {\n call: CallConnectionInstance['call']\n }) {\n super(options);\n }\n\n protected async negotiateInternal() {\n const {connection, call} = this;\n\n if(!connection.localDescription && !connection.remoteDescription && !call.isOutgoing) {\n return;\n }\n\n let descriptionInit: RTCSessionDescriptionInit;\n if(call.offerReceived) {\n call.offerReceived = false;\n\n const answer = descriptionInit = await connection.createAnswer();\n\n this.log('[sdp] local', answer.type, answer.sdp);\n await connection.setLocalDescription(answer);\n\n this.log('[InitialSetup] send 2');\n } else {\n const offer = descriptionInit = await connection.createOffer();\n\n this.log('[sdp] local', offer.sdp);\n await connection.setLocalDescription(offer);\n\n call.offerSent = true;\n\n this.log('[InitialSetup] send 0');\n }\n\n const initialSetup = parseSignalingData(parseSdp(descriptionInit.sdp));\n call.sendCallSignalingData(initialSetup);\n }\n}\n","const subtle = typeof(window) !== 'undefined' && 'crypto' in window ? window.crypto.subtle : self.crypto.subtle;\n\nexport default subtle;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport bufferConcats from '../../../helpers/bytes/bufferConcats';\nimport subtle from '../../crypto/subtle';\nimport sha256 from '../../crypto/utils/sha256';\n\nconst kMaxIncomingPacketSize = 128 * 1024 * 1024;\n\nexport default class P2PEncryptor {\n private type: 'Signaling';\n private counter: number;\n private seqMap: Map;\n\n constructor(private isOutgoing: boolean, private p2pKey: Uint8Array) {\n this.type = 'Signaling';\n this.counter = 0;\n this.seqMap = new Map();\n }\n\n private concatSHA256(parts: Uint8Array[]) {\n return sha256(bufferConcats(...parts));\n }\n\n private async encryptPrepared(buffer: Uint8Array) {\n const result = {\n counter: 0, // this.counterFromSeq(this.readSeq(buffer)),\n bytes: new Uint8Array(16 + buffer.length)\n };\n\n const x = (this.isOutgoing ? 0 : 8) + (this.type === 'Signaling' ? 128 : 0);\n const key = this.p2pKey;\n\n const msgKeyLarge = await this.concatSHA256([key.subarray(x + 88, x + 88 + 32), buffer]);\n const msgKey = result.bytes;\n for(let i = 0; i < 16; ++i) {\n msgKey[i] = msgKeyLarge[i + 8];\n }\n\n const aesKeyIv = await this.prepareAesKeyIv(key, msgKey, x);\n\n const bytes = await this.aesProcessCtr(buffer, buffer.length, aesKeyIv, true);\n\n result.bytes = new Uint8Array([...result.bytes.subarray(0, 16), ...bytes]);\n\n return result;\n }\n\n public encryptRawPacket(buffer: Uint8Array) {\n const seq = ++this.counter;\n const arr = new ArrayBuffer(4);\n const view = new DataView(arr);\n view.setUint32(0, seq >>> 0, false); // byteOffset = 0; litteEndian = false\n\n const result = new Uint8Array([...new Uint8Array(arr), ...buffer]);\n\n return this.encryptPrepared(result);\n }\n\n private async prepareAesKeyIv(key: Uint8Array, msgKey: Uint8Array, x: number) {\n const [sha256a, sha256b] = await Promise.all([\n this.concatSHA256([\n msgKey.subarray(0, 16),\n key.subarray(x, x + 36)\n ]),\n\n this.concatSHA256([\n key.subarray(40 + x, 40 + x + 36),\n msgKey.subarray(0, 16)\n ])\n ]);\n\n return {\n key: new Uint8Array([\n ...sha256a.subarray(0, 8),\n ...sha256b.subarray(8, 8 + 16),\n ...sha256a.subarray(24, 24 + 8)\n ]),\n iv: new Uint8Array([\n ...sha256b.subarray(0, 4),\n ...sha256a.subarray(8, 8 + 8),\n ...sha256b.subarray(24, 24 + 4)\n ])\n };\n }\n\n private async aesProcessCtr(encryptedData: Uint8Array, dataSize: number, aesKeyIv: {key: Uint8Array, iv: Uint8Array}, encrypt = true) {\n const cryptoKey = await subtle.importKey(\n 'raw',\n aesKeyIv.key,\n {name: 'AES-CTR'},\n false,\n [encrypt ? 'encrypt' : 'decrypt']\n );\n\n const buffer: ArrayBuffer = await subtle[encrypt ? 'encrypt' : 'decrypt']({\n name: 'AES-CTR',\n counter: aesKeyIv.iv,\n length: aesKeyIv.iv.length * 8\n },\n cryptoKey,\n encryptedData\n );\n\n return new Uint8Array(buffer);\n }\n\n private constTimeIsDifferent(a: Uint8Array, b: Uint8Array, count: number) {\n let msgKeyEquals = true;\n for(let i = 0; i < count; ++i) {\n if(a[i] !== b[i]) {\n msgKeyEquals = false;\n }\n }\n\n return !msgKeyEquals;\n }\n\n public async decryptRawPacket(buffer: Uint8Array) {\n if(buffer.length < 21 || buffer.length > kMaxIncomingPacketSize) {\n return;\n }\n\n const {isOutgoing, type} = this;\n\n const x = (isOutgoing ? 8 : 0) + (type === 'Signaling' ? 128 : 0);\n const key = this.p2pKey;\n\n const msgKey = buffer.subarray(0, 16);\n const encryptedData = buffer.subarray(16);\n const encryptedDataSize = buffer.length - 16;\n\n const aesKeyIv = await this.prepareAesKeyIv(key, msgKey, x);\n\n const decryptionBuffer = await this.aesProcessCtr(encryptedData, encryptedDataSize, aesKeyIv, false);\n\n const msgKeyLarge = await this.concatSHA256([\n key.subarray(88 + x, 88 + x + 32),\n decryptionBuffer\n ]);\n\n if(this.constTimeIsDifferent(msgKeyLarge.subarray(8), msgKey, 16)) {\n return;\n }\n\n const dataView = new DataView(decryptionBuffer.buffer);\n const seq = dataView.getUint32(0);\n if(this.seqMap.has(seq)) {\n return;\n }\n this.seqMap.set(seq, seq);\n\n return decryptionBuffer.slice(4);\n }\n}\n","import convertToUint8Array from '../../../helpers/bytes/convertToUint8Array';\nimport subtle from '../subtle';\n// import sha256 from '@cryptography/sha256';\n\nexport default function sha256(bytes: Parameters[0]) {\n return subtle.digest('SHA-256', convertToUint8Array(bytes)).then((b) => {\n // console.log('legacy', performance.now() - perfS);\n return new Uint8Array(b);\n });\n /* //console.log('SHA-256 hash start');\n\n let perfS = performance.now();\n\n\n let perfD = performance.now();\n let words = typeof(bytes) === 'string' ? bytes : bytesToWordss(bytes as any);\n let hash = sha256(words);\n console.log('darutkin', performance.now() - perfD);\n\n //console.log('SHA-256 hash finish', hash, sha256(words, 'hex'));\n\n return bytesFromWordss(hash); */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport StringFromLineBuilder from '../stringFromLineBuilder';\nimport {addDataChannel, addExtmap, addPayloadTypes, addSsrc} from './p2PSdpBuilder';\n\nexport default class ChromeP2PSdpBuilder {\n static generateOffer(info: any) {\n const {fingerprints, ufrag, pwd, audio, video} = info;\n audio.type = 'audio';\n video.type = 'video';\n const media = [audio, video];\n\n const stringBuilder = new StringFromLineBuilder();\n stringBuilder.add(\n 'v=0',\n 'o=- 1 2 IN IP4 127.0.0.1',\n 's=-',\n 't=0 0'\n );\n\n if(fingerprints) {\n fingerprints.forEach((x: any) => {\n const {hash, fingerprint, setup} = x;\n stringBuilder.add(\n `a=fingerprint:${hash} ${fingerprint}`,\n `a=setup:${setup}`\n );\n });\n }\n if(ufrag && pwd) {\n stringBuilder.add(\n `a=ice-ufrag:${ufrag}`,\n `a=ice-pwd:${pwd}`\n );\n }\n\n stringBuilder.add(\n 'a=group:BUNDLE 0 1 2',\n 'a=extmap-allow-mixed',\n 'a=msid-semantic: WMS *'\n );\n const streamName = 'stream' + media.map((x) => x.ssrc).join('_');\n for(let i = 0; i < media.length; i++) {\n const m = media[i];\n const {type, ssrc, ssrcGroups, payloadTypes, rtpExtensions} = m;\n switch(type) {\n case 'audio': {\n stringBuilder.add(\n `m=audio 56930 UDP/TLS/RTP/SAVPF ${payloadTypes.map((x: any) => x.id).join(' ')}`,\n 'c=IN IP4 0.0.0.0',\n 'a=rtcp:9 IN IP4 0.0.0.0',\n 'a=ice-options:trickle',\n `a=mid:${i}`,\n 'a=sendrecv',\n addExtmap(rtpExtensions)\n );\n if(ssrc) {\n stringBuilder.add(`a=msid:${streamName} audio${ssrc}`);\n }\n stringBuilder.add(\n 'a=rtcp-mux',\n addPayloadTypes(payloadTypes),\n addSsrc(type, ssrc, ssrcGroups, streamName)\n );\n\n break;\n }\n\n case 'video': {\n stringBuilder.add(\n `m=video 61986 UDP/TLS/RTP/SAVPF ${payloadTypes.map((x: any) => x.id).join(' ')}`,\n 'c=IN IP4 0.0.0.0',\n 'a=rtcp:9 IN IP4 0.0.0.0',\n 'a=ice-options:trickle',\n `a=mid:${i}`,\n 'a=sendrecv',\n addExtmap(rtpExtensions)\n );\n if(ssrc) {\n stringBuilder.add(`a=msid:${streamName} video${ssrc}`);\n }\n stringBuilder.add(\n 'a=rtcp-mux',\n 'a=rtcp-rsize',\n addPayloadTypes(payloadTypes),\n addSsrc(type, ssrc, ssrcGroups, streamName)\n );\n break;\n }\n }\n }\n stringBuilder.add(addDataChannel(2));\n return stringBuilder.finalize();\n }\n\n static generateAnswer(info: any) {\n const {fingerprints, ufrag, pwd, audio, video} = info;\n audio.type = 'audio';\n video.type = 'video';\n const media = [audio, video];\n\n const stringBuilder = new StringFromLineBuilder();\n stringBuilder.add(\n 'v=0',\n 'o=- 1 2 IN IP4 127.0.0.1',\n 's=-',\n 't=0 0'\n );\n\n if(fingerprints) {\n fingerprints.forEach((x: any) => {\n const {hash, fingerprint, setup} = x;\n stringBuilder.add(\n `a=fingerprint:${hash} ${fingerprint}`,\n `a=setup:${setup}`\n );\n });\n }\n if(ufrag && pwd) {\n stringBuilder.add(\n `a=ice-ufrag:${ufrag}`,\n `a=ice-pwd:${pwd}`\n );\n }\n\n stringBuilder.add(\n 'a=group:BUNDLE 0 1 2',\n 'a=extmap-allow-mixed',\n 'a=msid-semantic: WMS *'\n );\n const streamName = 'stream' + media.map((x) => x.ssrc).join('_');\n for(let i = 0; i < media.length; i++) {\n const m = media[i];\n const {type, ssrc, ssrcGroups, payloadTypes, rtpExtensions} = m;\n switch(type) {\n case 'audio': {\n stringBuilder.add(\n `m=audio 56930 UDP/TLS/RTP/SAVPF ${payloadTypes.map((x: any) => x.id).join(' ')}`,\n 'c=IN IP4 0.0.0.0',\n 'a=rtcp:9 IN IP4 0.0.0.0',\n 'a=ice-options:trickle',\n `a=mid:${i}`,\n 'a=sendrecv',\n addExtmap(rtpExtensions)\n );\n if(ssrc) {\n stringBuilder.add(`a=msid:${streamName} audio${ssrc}`);\n }\n stringBuilder.add(\n 'a=rtcp-mux',\n addPayloadTypes(payloadTypes),\n addSsrc(type, ssrc, ssrcGroups, streamName)\n );\n break;\n }\n\n case 'video': {\n stringBuilder.add(\n `m=video 61986 UDP/TLS/RTP/SAVPF ${payloadTypes.map((x: any) => x.id).join(' ')}`,\n 'c=IN IP4 0.0.0.0',\n 'a=rtcp:9 IN IP4 0.0.0.0',\n 'a=ice-options:trickle',\n `a=mid:${i}`,\n 'a=sendrecv',\n addExtmap(rtpExtensions)\n );\n if(ssrc) {\n stringBuilder.add(`a=msid:${streamName} video${ssrc}`);\n }\n\n stringBuilder.add(\n 'a=rtcp-mux',\n 'a=rtcp-rsize',\n addPayloadTypes(payloadTypes),\n addSsrc(type, ssrc, ssrcGroups, streamName)\n );\n break;\n }\n }\n }\n stringBuilder.add(addDataChannel(2));\n return stringBuilder.finalize();\n }\n}\n","/*\n* Copyright (c) 2018-present, Evgeny Nadymov\n*\n* This source code is licensed under the GPL v.3.0 license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport ChromeP2PSdpBuilder from './chromeP2PSdpBuilder';\nimport { FirefoxP2PSdpBuilder } from './firefoxP2PSdpBuilder';\nimport { SafariP2PSdpBuilder } from './safariP2PSdpBuilder';\n// import { TG_CALLS_SDP_STRING } from '../../Stores/CallStore';\n\nexport function p2pParseCandidate(candidate) {\n if(!candidate || !candidate.startsWith('candidate:')) {\n return;\n }\n \n const sdpString = candidate;\n candidate = candidate.substr('candidate:'.length);\n \n const [foundation, component, protocol, priority, ip, port, ...other] = candidate.split(' ');\n const c = {\n sdpString,\n foundation,\n component,\n protocol,\n priority,\n address: { ip, port }\n };\n \n for(let i = 0; i < other.length; i += 2) {\n switch(other[i]) {\n case 'typ': {\n c.type = other[i + 1];\n break;\n }\n case 'raddr': {\n if(!c.relAddress) {\n c.relAddress = {};\n }\n \n c.relAddress.ip = other[i + 1];\n break;\n }\n case 'rport': {\n if(!c.relAddress) {\n c.relAddress = {};\n }\n \n c.relAddress.port = other[i + 1];\n break;\n }\n case 'generation': {\n c.generation = other[i + 1];\n break;\n }\n case 'tcptype': {\n c.tcpType = other[i + 1];\n break;\n }\n case 'network-id': {\n c.networkId = other[i + 1];\n break;\n }\n case 'network-cost': {\n c.networkCost = other[i + 1];\n break;\n }\n case 'ufrag': {\n c.username = other[i + 1];\n break;\n }\n }\n }\n \n return c;\n}\n\nexport function p2pParseSdp(sdp) {\n const lines = sdp.split('\\r\\n');\n const lookup = (prefix, force = true, lineFrom = 0, lineTo = Number.MAX_VALUE) => {\n if (lineTo === -1) {\n lineTo = Number.MAX_VALUE;\n }\n for (let i = lineFrom; i < lines.length && i < lineTo; i++) {\n const line = lines[i];\n if (line.startsWith(prefix)) {\n return line.substr(prefix.length);\n }\n }\n \n if (force) {\n console.error(\"Can't find prefix\", prefix);\n }\n \n return null;\n };\n const findIndex = (prefix, lineFrom = 0, lineTo = Number.MAX_VALUE) => {\n if (lineTo === -1) {\n lineTo = Number.MAX_VALUE;\n }\n for (let i = lineFrom; i < lines.length && i < lineTo; i++) {\n const line = lines[i];\n if (line.startsWith(prefix)) {\n return i;\n }\n }\n \n return -1;\n };\n \n const pwdIndex = findIndex('a=ice-pwd:');\n const ufragIndex = findIndex('a=ice-ufrag:');\n if (pwdIndex === -1 && ufragIndex === -1) {\n return {\n // sessionId: lookup('o=').split(' ')[1],\n ufrag: null,\n pwd: null,\n fingerprints: []\n };\n }\n \n const info = {\n // sessionId: lookup('o=').split(' ')[1],\n ufrag: null,\n pwd: null,\n fingerprints: []\n };\n \n let mediaIndex = findIndex('m=');\n const fingerprint = lookup('a=fingerprint:', false);\n const setup = lookup('a=setup:', false);\n if (fingerprint && setup) {\n info.fingerprints.push({\n hash: fingerprint.split(' ')[0],\n fingerprint: fingerprint.split(' ')[1],\n setup\n });\n }\n \n const ufrag = lookup('a=ice-ufrag:', false);\n const pwd = lookup('a=ice-pwd:', false);\n if (ufrag && pwd) {\n info.ufrag = ufrag;\n info.pwd = pwd;\n }\n \n while (mediaIndex !== -1) {\n let nextMediaIndex = findIndex('m=', mediaIndex + 1);\n \n const extmap = [];\n const types = [];\n const mediaType = lookup('m=', true, mediaIndex, nextMediaIndex).split(' ')[0];\n const media = {\n // type: lookup('m=', true, mediaIndex, nextMediaIndex).split(' ')[0],\n // mid: lookup('a=mid:', true, mediaIndex, nextMediaIndex),\n // dir: findDirection(mediaIndex, nextMediaIndex),\n rtpExtensions: extmap,\n payloadTypes: types\n }\n \n const lineTo = nextMediaIndex === -1 ? lines.length : nextMediaIndex;\n const fmtp = new Map();\n const rtcpFb = new Map();\n for (let i = mediaIndex; i < lineTo; i++) {\n const line = lines[i];\n if (line.startsWith('a=extmap:')) {\n const [ id, uri ] = line.substr('a=extmap:'.length).split(' ');\n extmap.push({ id: parseInt(id), uri });\n } else if (line.startsWith('a=fmtp:')) {\n const [ id, str ] = line.substr('a=fmtp:'.length).split(' ');\n const obj = { };\n const arr = str.split(';').map(x => {\n const [ key, value ] = x.split('=');\n obj[key] = value;\n return { [key]: value };\n });\n fmtp.set(parseInt(id), obj);\n } else if (line.startsWith('a=rtcp-fb:')) {\n const [ id, type = '', subtype = '' ] = line.substr('a=rtcp-fb:'.length).split(' ');\n if (rtcpFb.has(parseInt(id))) {\n rtcpFb.get(parseInt(id)).push({ type, subtype });\n } else {\n rtcpFb.set(parseInt(id), [{ type, subtype }])\n }\n } else if (line.startsWith('a=rtpmap')) {\n const [ id, str ] = line.substr('a=rtpmap:'.length).split(' ');\n const [ name, clockrate, channels = '0' ] = str.split('/');\n const obj = { id: parseInt(id), name, clockrate: parseInt(clockrate), channels: parseInt(channels) };\n \n types.push(obj);\n }\n }\n \n for (let i = 0; i < types.length; i++) {\n const { id } = types[i];\n if (rtcpFb.has(id)) {\n types[i].feedbackTypes = rtcpFb.get(id);\n }\n if (fmtp.has(id)) {\n types[i].parameters = fmtp.get(id);\n }\n }\n \n const ssrc = lookup('a=ssrc:', false, mediaIndex, nextMediaIndex);\n if (ssrc) {\n media.ssrc = ssrc.split(' ')[0];\n }\n \n const ssrcGroup = lookup('a=ssrc-group:', false, mediaIndex, nextMediaIndex);\n if (ssrcGroup) {\n const [ semantics, ...ssrcs ] = ssrcGroup.split(' ');\n media.ssrcGroups = [{\n semantics,\n ssrcs\n }]\n }\n \n switch (mediaType) {\n case 'audio': {\n info.audio = media;\n break;\n }\n case 'video': {\n info.video = media;\n break;\n }\n }\n \n mediaIndex = nextMediaIndex;\n }\n\n if(!info.video.ssrcGroups) {\n info.video.ssrcGroups = [];\n }\n\n info['@type'] = 'InitialSetup';\n \n // console.log('[p2pParseSdp]', sdp, info);\n return info;\n}\n\nexport function isFirefox() {\n return navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n}\n\nfunction isSafari() {\n return navigator.userAgent.toLowerCase().indexOf('safari') > -1 && navigator.userAgent.toLowerCase().indexOf('chrome') === -1;\n}\n\nexport function addExtmap(extmap) {\n let sdp = [];\n // return sdp;\n for (let j = 0; j < extmap.length; j++) {\n const ext = extmap[j];\n const { id, uri } = ext;\n // if (isFirefox() && uri.indexOf(''))\n console.log('[extmap] add', id, uri);\n sdp.push(`a=extmap:${id} ${uri}`);\n }\n \n return sdp.join('\\n');\n}\n\nexport function addPayloadTypes(types) {\n let sdp = [];\n console.log('[SDP] addPayloadTypes', types);\n for (let i = 0; i < types.length; i++) {\n const type = types[i];\n const { id, name, clockrate, channels, feedbackTypes, parameters } = type;\n sdp.push(`a=rtpmap:${id} ${name}/${clockrate}${channels ? '/' + channels : ''}`);\n if (feedbackTypes) {\n feedbackTypes.forEach(x => {\n const { type, subtype } = x;\n sdp.push(`a=rtcp-fb:${id} ${[type, subtype].join(' ')}`);\n });\n }\n if (parameters) {\n const fmtp = [];\n Object.getOwnPropertyNames(parameters).forEach(pName => {\n fmtp.push(`${pName}=${parameters[pName]}`);\n });\n \n sdp.push(`a=fmtp:${id} ${fmtp.join(';')}`);\n }\n }\n \n return sdp.join('\\n');\n}\n\nexport function addSsrc(type, ssrc, ssrcGroups, streamName) {\n let sdp = [];\n \n if (ssrcGroups && ssrcGroups.length > 0) {\n ssrcGroups.forEach(ssrcGroup => {\n if (ssrcGroup && ssrcGroup.ssrcs.length > 0) {\n sdp.push(`a=ssrc-group:${ssrcGroup.semantics} ${ssrcGroup.ssrcs.join(' ')}`);\n ssrcGroup.ssrcs.forEach(ssrc => {\n sdp.push(\n `a=ssrc:${ssrc} cname:stream${ssrc}`,\n `a=ssrc:${ssrc} msid:${streamName} ${type}${ssrc}`,\n `a=ssrc:${ssrc} mslabel:${type}${ssrc}`,\n `a=ssrc:${ssrc} label:${type}${ssrc}`\n );\n });\n }\n });\n } else if (ssrc) {\n sdp.push(\n `a=ssrc:${ssrc} cname:stream${ssrc}`,\n `a=ssrc:${ssrc} msid:${streamName} ${type}${ssrc}`,\n `a=ssrc:${ssrc} mslabel:${type}${ssrc}`,\n `a=ssrc:${ssrc} label:${type}${ssrc}`\n );\n }\n \n return sdp.join('\\n');\n}\n\nexport function addDataChannel(mid) {\n return `m=application 9 UDP/DTLS/SCTP webrtc-datachannel\nc=IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:2\na=sctp-port:5000\na=max-message-size:262144`;\n}\n\nexport class P2PSdpBuilder {\n static generateCandidate(info) {\n if (!info) return null;\n \n const { sdpString, sdpMLineIndex, sdpMid, foundation, component, protocol, priority, address, type, relAddress, generation, tcpType, networkId, networkCost, username } = info;\n if (/* TG_CALLS_SDP_STRING */true) {\n if (sdpString) {\n return {\n candidate: sdpString,\n sdpMLineIndex,\n sdpMid\n };\n }\n }\n throw 'no sdpString';\n \n let candidate = `candidate:${foundation} ${component} ${protocol} ${priority} ${address.ip} ${address.port}`;\n const attrs = []\n if (type) {\n attrs.push(`typ ${type}`);\n }\n if (relAddress) {\n attrs.push(`raddr ${relAddress.ip}`);\n attrs.push(`rport ${relAddress.port}`);\n }\n if (tcpType) {\n attrs.push(`tcptype ${tcpType}`);\n }\n if (generation) {\n attrs.push(`generation ${generation}`);\n }\n if (username) {\n attrs.push(`ufrag ${username}`);\n }\n if (networkId) {\n attrs.push(`network-id ${networkId}`);\n }\n if (networkCost) {\n attrs.push(`network-cost ${networkCost}`);\n }\n if (attrs.length > 0) {\n candidate += ` ${attrs.join(' ')}`;\n }\n \n return { candidate, sdpMid, sdpMLineIndex };\n }\n \n static generateOffer(info) {\n if (isFirefox()) {\n return FirefoxP2PSdpBuilder.generateOffer(info);\n } else if (isSafari()) {\n return SafariP2PSdpBuilder.generateOffer(info);\n }\n \n return ChromeP2PSdpBuilder.generateOffer(info);\n }\n \n static generateAnswer(info) {\n if (isFirefox()) {\n return FirefoxP2PSdpBuilder.generateAnswer(info);\n } else if (isSafari()) {\n return SafariP2PSdpBuilder.generateAnswer(info);\n }\n \n return ChromeP2PSdpBuilder.generateAnswer(info);\n }\n}","/*\n * Copyright (c) 2018-present, Evgeny Nadymov\n *\n * This source code is licensed under the GPL v.3.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { addDataChannel, addExtmap, addPayloadTypes, addSsrc } from './p2PSdpBuilder';\n\nexport class FirefoxP2PSdpBuilder {\n static generateOffer(info) {\n const { fingerprints, ufrag, pwd, audio, video } = info;\n audio.type = 'audio';\n video.type = 'video';\n const media = [audio, video];\n\n let sdp = `v=0\no=- 1 0 IN IP4 0.0.0.0\ns=-\nt=0 0`;\n if (fingerprints) {\n fingerprints.forEach(x => {\n const { hash, fingerprint, setup } = x;\n sdp += `\na=fingerprint:${hash} ${fingerprint}\na=setup:${setup}`;\n });\n }\n if (ufrag && pwd) {\n sdp += `\na=ice-ufrag:${ufrag}\na=ice-pwd:${pwd}`;\n }\n\n sdp += `\na=group:BUNDLE 0 1 2\na=ice-options:trickle\na=msid-semantic:WMS *`;\n const streamName = 'stream' + media.map(x => x.ssrc).join('_');\n for (let i = 0; i < media.length; i++) {\n const m = media[i];\n const { type, ssrc, ssrcGroups, payloadTypes, rtpExtensions } = m;\n switch (type) {\n case 'audio': {\n sdp += `\nm=audio 9 UDP/TLS/RTP/SAVPF ${payloadTypes.map(x => x.id).join(' ')}\nc=IN IP4 0.0.0.0\na=mid:${i}\na=sendrecv`;\n sdp += addExtmap(rtpExtensions);\n sdp += `\na=rtcp-mux`;\n sdp += addPayloadTypes(payloadTypes);\n sdp += addSsrc(type, ssrc, ssrcGroups, streamName);\n\n break;\n }\n case 'video': {\n sdp += `\nm=video 9 UDP/TLS/RTP/SAVPF ${payloadTypes.map(x => x.id).join(' ')}\nc=IN IP4 0.0.0.0\na=mid:${i}\na=sendrecv`;\n sdp += addExtmap(rtpExtensions);\n sdp += `\na=rtcp-mux\na=rtcp-rsize`;\n sdp += addPayloadTypes(payloadTypes);\n sdp += addSsrc(type, ssrc, ssrcGroups, streamName);\n\n break;\n }\n }\n }\n sdp += addDataChannel(2);\n sdp += `\n`;\n\n return sdp;\n }\n\n static generateAnswer(info) {\n const { fingerprints, ufrag, pwd, audio, video } = info;\n audio.type = 'audio';\n video.type = 'video';\n const media = [audio, video];\n\n let sdp = `v=0\no=- 1 0 IN IP4 0.0.0.0\ns=-\nt=0 0`;\n if (fingerprints) {\n fingerprints.forEach(x => {\n const { hash, fingerprint, setup } = x;\n sdp += `\na=fingerprint:${hash} ${fingerprint}\na=setup:${setup}`;\n });\n }\n if (ufrag && pwd) {\n sdp += `\na=ice-ufrag:${ufrag}\na=ice-pwd:${pwd}`;\n }\n\n sdp += `\na=group:BUNDLE 0 1 2\na=ice-options:trickle\na=msid-semantic:WMS *`;\n const streamName = 'stream' + media.map(x => x.ssrc).join('_');\n for (let i = 0; i < media.length; i++) {\n const m = media[i];\n const { type, mid, ssrc, ssrcGroups, payloadTypes, dir, rtpExtensions } = m;\n switch (type) {\n case 'audio': {\n sdp += `\nm=audio 9 UDP/TLS/RTP/SAVPF ${payloadTypes.map(x => x.id).join(' ')}\nc=IN IP4 0.0.0.0\na=mid:${i}\na=sendrecv`;\n sdp += addExtmap(rtpExtensions);\n sdp += `\na=rtcp-mux`;\n sdp += addPayloadTypes(payloadTypes);\n sdp += addSsrc(type, ssrc, ssrcGroups, streamName);\n\n break;\n }\n case 'video': {\n sdp += `\nm=video 9 UDP/TLS/RTP/SAVPF ${payloadTypes.map(x => x.id).join(' ')}\nc=IN IP4 0.0.0.0\na=mid:${i}\na=sendrecv`;\n sdp += addExtmap(rtpExtensions);\n sdp += `\na=rtcp-mux\na=rtcp-rsize`;\n sdp += addPayloadTypes(payloadTypes);\n sdp += addSsrc(type, ssrc, ssrcGroups, streamName);\n break;\n }\n }\n }\n sdp += addDataChannel(2);\n sdp += `\n`;\n\n return sdp;\n }\n}","/*\n * Copyright (c) 2018-present, Evgeny Nadymov\n *\n * This source code is licensed under the GPL v.3.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { addDataChannel, addExtmap, addPayloadTypes, addSsrc } from './p2PSdpBuilder';\n\nexport class SafariP2PSdpBuilder {\n static generateOffer(info) {\n const { fingerprints, ufrag, pwd, audio, video } = info;\n audio.type = 'audio';\n video.type = 'video';\n const media = [audio, video];\n\n if (!media.length) {\n return `v=0\no=- 1 2 IN IP4 127.0.0.1\ns=-\nt=0 0\na=msid-semantic: WMS\n`;\n }\n\n let sdp = `v=0\no=- 1 2 IN IP4 127.0.0.1\ns=-\nt=0 0`;\n if (fingerprints) {\n fingerprints.forEach(x => {\n const { hash, fingerprint, setup } = x;\n sdp += `\na=fingerprint:${hash} ${fingerprint}\na=setup:${setup}`;\n });\n }\n if (ufrag && pwd) {\n sdp += `\na=ice-ufrag:${ufrag}\na=ice-pwd:${pwd}`;\n }\n\n sdp += `\na=group:BUNDLE 0 1 2\na=extmap-allow-mixed\na=msid-semantic: WMS *`;\n const streamName = 'stream' + media.map(x => x.ssrc).join('_');\n for (let i = 0; i < media.length; i++) {\n const m = media[i];\n const { type, ssrc, ssrcGroups, payloadTypes, rtpExtensions } = m;\n switch (type) {\n case 'audio': {\n sdp += `\nm=audio 9 UDP/TLS/RTP/SAVPF ${payloadTypes.map(x => x.id).join(' ')}\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:${i}\na=sendrecv`;\n sdp += addExtmap(rtpExtensions);\n if (ssrc) {\n sdp += `\na=msid:${streamName} audio${ssrc}`;\n }\n sdp += `\na=rtcp-mux`;\n sdp += addPayloadTypes(payloadTypes);\n sdp += addSsrc(type, ssrc, ssrcGroups, streamName);\n\n break;\n }\n case 'video': {\n sdp += `\nm=video 9 UDP/TLS/RTP/SAVPF ${payloadTypes.map(x => x.id).join(' ')}\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:${i}\na=sendrecv`;\n sdp += addExtmap(rtpExtensions);\n if (ssrc) {\n sdp += `\na=msid:${streamName} video${ssrc}`;\n }\n sdp += `\na=rtcp-mux\na=rtcp-rsize`;\n sdp += addPayloadTypes(payloadTypes);\n sdp += addSsrc(type, ssrc, ssrcGroups, streamName);\n break;\n }\n }\n }\n sdp += addDataChannel(2);\n sdp += `\n`;\n\n return sdp;\n }\n\n static generateAnswer(info) {\n const { fingerprints, ufrag, pwd, audio, video } = info;\n audio.type = 'audio';\n video.type = 'video';\n const media = [audio, video];\n\n if (!media.length) {\n return `v=0\no=- 1 2 IN IP4 127.0.0.1\ns=-\nt=0 0\na=msid-semantic: WMS\n`;\n }\n\n let sdp = `v=0\no=- 1 2 IN IP4 127.0.0.1\ns=-\nt=0 0`;\n if (fingerprints) {\n fingerprints.forEach(x => {\n const { hash, fingerprint, setup } = x;\n sdp += `\na=fingerprint:${hash} ${fingerprint}\na=setup:${setup}`;\n });\n }\n if (ufrag && pwd) {\n sdp += `\na=ice-ufrag:${ufrag}\na=ice-pwd:${pwd}`;\n }\n\n sdp += `\na=group:BUNDLE 0 1 2\na=extmap-allow-mixed\na=msid-semantic: WMS *`;\n const streamName = 'stream' + media.map(x => x.ssrc).join('_');\n for (let i = 0; i < media.length; i++) {\n const m = media[i];\n const { type, ssrc, ssrcGroups, payloadTypes, rtpExtensions } = m;\n switch (type) {\n case 'audio': {\n sdp += `\nm=audio 9 UDP/TLS/RTP/SAVPF ${payloadTypes.map(x => x.id).join(' ')}\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:${i}\na=sendrecv`;\n sdp += addExtmap(rtpExtensions);\n if (ssrc) {\n sdp += `\na=msid:${streamName} audio${ssrc}`;\n }\n sdp += `\na=rtcp-mux`;\n sdp += addPayloadTypes(payloadTypes);\n sdp += addSsrc(type, ssrc, ssrcGroups, streamName);\n\n break;\n }\n case 'video': {\n sdp += `\nm=video 9 UDP/TLS/RTP/SAVPF ${payloadTypes.map(x => x.id).join(' ')}\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 0.0.0.0\na=ice-options:trickle\na=mid:${i}\na=sendrecv`;\n sdp += addExtmap(rtpExtensions);\n if (ssrc) {\n sdp += `\na=msid:${streamName} video${ssrc}`;\n }\n sdp += `\na=rtcp-mux\na=rtcp-rsize`;\n sdp += addPayloadTypes(payloadTypes);\n sdp += addSsrc(type, ssrc, ssrcGroups, streamName);\n break;\n }\n }\n }\n sdp += addDataChannel(2);\n sdp += `\n`;\n\n return sdp;\n }\n}","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ctx from '../../environment/ctx';\nimport {IS_SAFARI} from '../../environment/userAgent';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport debounce from '../../helpers/schedulers/debounce';\nimport {GroupCallParticipantVideoSourceGroup, PhoneCall, PhoneCallDiscardReason, PhoneCallProtocol, Update} from '../../layer';\nimport {emojiFromCodePoints} from '../../vendor/emoji';\nimport type {CallId} from '../appManagers/appCallsManager';\nimport type {AppManagers} from '../appManagers/managers';\nimport {logger} from '../logger';\nimport apiManagerProxy from '../mtproto/mtprotoworker';\nimport CallConnectionInstance from './callConnectionInstance';\nimport CallInstanceBase from './callInstanceBase';\nimport callsController from './callsController';\nimport CALL_STATE from './callState';\nimport {GROUP_CALL_AMPLITUDE_ANALYSE_INTERVAL_MS} from './constants';\nimport parseSignalingData from './helpers/parseSignalingData';\nimport stopTrack from './helpers/stopTrack';\nimport localConferenceDescription, {ConferenceEntry, generateSsrc} from './localConferenceDescription';\nimport getCallProtocol from './p2P/getCallProtocol';\nimport getRtcConfiguration from './p2P/getRtcConfiguration';\nimport P2PEncryptor from './p2P/p2PEncryptor';\nimport {p2pParseCandidate, P2PSdpBuilder} from './p2P/p2PSdpBuilder';\nimport {parseSdp} from './sdp/utils';\nimport {WebRTCLineType} from './sdpBuilder';\nimport StreamManager from './streamManager';\nimport {AudioCodec, CallMediaState, CallSignalingData, DiffieHellmanInfo, P2PAudioCodec, P2PVideoCodec, VideoCodec} from './types';\n\nexport default class CallInstance extends CallInstanceBase<{\n state: (state: CALL_STATE) => void,\n id: (id: CallId, prevId: CallId) => void,\n muted: (muted: boolean) => void,\n mediaState: (mediaState: CallMediaState) => void,\n acceptCallOverride: () => Promise,\n}> {\n public dh: Partial;\n public id: CallId;\n public call: PhoneCall;\n public interlocutorUserId: UserId;\n public protocol: PhoneCallProtocol;\n public isOutgoing: boolean;\n public encryptionKey: Uint8Array;\n public connectionInstance: CallConnectionInstance;\n public encryptor: P2PEncryptor;\n public decryptor: P2PEncryptor;\n public candidates: RTCIceCandidate[];\n\n public offerReceived: boolean;\n public offerSent: boolean;\n\n public createdParticipantEntries: boolean;\n public release: () => Promise;\n public _connectionState: CALL_STATE;\n\n public createdAt: number;\n public connectedAt: number;\n public discardReason: string;\n\n private managers: AppManagers;\n\n private hangUpTimeout: number;\n\n private mediaStates: {\n input: CallMediaState,\n output?: CallMediaState\n };\n\n private sendMediaState: () => Promise;\n\n private decryptQueue: Uint8Array[];\n\n private getEmojisFingerprintPromise: Promise;\n private emojisFingerprint: [string, string, string, string];\n\n private wasStartingScreen: boolean;\n private wasStartingVideo: boolean;\n public wasTryingToJoin: boolean;\n\n public streamManager: StreamManager;\n\n constructor(options: {\n isOutgoing: boolean,\n interlocutorUserId: UserId,\n managers: CallInstance['managers'],\n protocol?: PhoneCallProtocol\n }) {\n super();\n\n this.log = logger('CALL');\n\n if(!this.protocol) {\n this.protocol = getCallProtocol();\n }\n\n safeAssign(this, options);\n\n this.createdAt = Date.now();\n this.offerReceived = false;\n this.offerSent = false;\n this.decryptQueue = [];\n this.candidates = [];\n\n this.addEventListener('state', (state) => {\n this.log('state', CALL_STATE[state]);\n\n if(state === CALL_STATE.CLOSED) {\n this.cleanup();\n }\n });\n\n const streamManager = this.streamManager = new StreamManager(GROUP_CALL_AMPLITUDE_ANALYSE_INTERVAL_MS);\n streamManager.direction = 'sendrecv';\n streamManager.types.push('screencast');\n if(!this.isOutgoing) {\n streamManager.locked = true;\n streamManager.canCreateConferenceEntry = false;\n }\n\n let mediaState: CallMediaState = {\n '@type': 'MediaState',\n 'type': 'input',\n 'lowBattery': false,\n 'muted': true,\n 'screencastState': 'inactive',\n 'videoRotation': 0,\n 'videoState': 'inactive'\n };\n\n const self = this;\n mediaState = new Proxy(mediaState, {\n set: function(target, key, value) {\n // @ts-ignore\n target[key] = value;\n self.setMediaState(mediaState);\n self.sendMediaState();\n return true;\n }\n });\n\n this.mediaStates = {\n input: mediaState\n };\n\n this.sendMediaState = debounce(this._sendMediaState.bind(this), 0, false, true);\n }\n\n get connectionState() {\n const {_connectionState, connectionInstance} = this;\n if(_connectionState !== undefined) {\n return _connectionState;\n } else if(!connectionInstance) {\n return CALL_STATE.CONNECTING;\n } else {\n const {iceConnectionState} = connectionInstance.connection;\n if(iceConnectionState === 'closed') {\n return CALL_STATE.CLOSED;\n } else if(iceConnectionState !== 'connected' && (!IS_SAFARI || iceConnectionState !== 'completed')) {\n return CALL_STATE.CONNECTING;\n } else {\n return CALL_STATE.CONNECTED;\n }\n }\n }\n\n get sortIndex() {\n const connectionState = this.connectionState;\n const state = CALL_STATE.CLOSED - connectionState + 1;\n let index = state * 10000000000000;\n index += 2147483647000 - (connectionState === CALL_STATE.PENDING && this.isOutgoing ? 0 : this.createdAt);\n return index;\n }\n\n public getVideoElement(type: CallMediaState['type']) {\n if(type === 'input') return this.elements.get('main');\n else {\n const mediaState = this.getMediaState('output');\n if(!mediaState) {\n return;\n }\n\n const type: WebRTCLineType = mediaState.videoState === 'active' ? 'video' : (mediaState.screencastState === 'active' ? 'screencast' : undefined);\n if(!type) {\n return;\n }\n\n const entry = this.description.findEntry((entry) => entry.type === type);\n if(!entry) {\n return;\n }\n\n return this.elements.get('' + entry.recvEntry.source);\n }\n }\n\n public async startScreenSharingInternal() {\n try {\n this.wasStartingScreen = true;\n this.wasStartingVideo = false;\n this.streamManager.types = ['audio', 'screencast'];\n await this.requestScreen();\n } catch(err) {\n this.log.error('startScreenSharing error', err);\n }\n }\n\n public async toggleScreenSharing() {\n if(this.isSharingVideo) {\n await this.stopVideoSharing();\n }\n\n if(this.isSharingScreen) {\n return this.stopVideoSharing();\n } else {\n return this.startScreenSharingInternal();\n }\n }\n\n public async startVideoSharingInternal() {\n try {\n this.wasStartingScreen = false;\n this.wasStartingVideo = true;\n this.streamManager.types = ['audio', 'video'];\n await this.requestInputSource(false, true, false);\n } catch(err) {\n this.log.error('startVideoSharing error', err);\n }\n }\n\n public async stopVideoSharing() {\n const mediaState = this.getMediaState('input');\n mediaState.videoState = mediaState.screencastState = 'inactive';\n\n const {streamManager, description} = this;\n const track = streamManager.inputStream.getVideoTracks()[0];\n if(track) {\n stopTrack(track);\n streamManager.appendToConference(description); // clear sender track\n }\n }\n\n public async toggleVideoSharing() {\n if(this.isSharingScreen) {\n await this.stopVideoSharing();\n }\n\n if(this.isSharingVideo) {\n return this.stopVideoSharing();\n } else {\n return this.startVideoSharingInternal();\n }\n }\n\n public getMediaState(type: CallMediaState['type']) {\n return this.mediaStates[type];\n }\n\n public setMediaState(mediaState: CallMediaState) {\n this.mediaStates[mediaState.type] = mediaState;\n this.dispatchEvent('mediaState', mediaState);\n }\n\n public isSharingVideoType(type: 'video' | 'screencast') {\n try {\n const hasVideoTrack = super.isSharingVideo;\n return hasVideoTrack && !!((this.wasStartingScreen && type === 'screencast') || (this.wasStartingVideo && type === 'video'));\n\n // ! it will be used before the track appears\n // return !!this.description.entries.find((entry) => entry.type === type && entry.transceiver.sender.track.enabled);\n } catch(err) {\n return false;\n }\n }\n\n public get isSharingVideo() {\n return this.isSharingVideoType('video');\n }\n\n public get isSharingScreen() {\n return this.isSharingVideoType('screencast');\n }\n\n public get isMuted() {\n const audioTrack = this.streamManager.inputStream.getAudioTracks()[0];\n return !audioTrack?.enabled;\n }\n\n public get isClosing() {\n const {connectionState} = this;\n return connectionState === CALL_STATE.CLOSING || connectionState === CALL_STATE.CLOSED;\n }\n\n public get description(): localConferenceDescription {\n return this.connectionInstance?.description;\n }\n\n public setHangUpTimeout(timeout: number, reason: PhoneCallDiscardReason['_']) {\n this.clearHangUpTimeout();\n this.hangUpTimeout = ctx.setTimeout(() => {\n this.hangUpTimeout = undefined;\n this.hangUp(reason);\n }, timeout);\n }\n\n public clearHangUpTimeout() {\n if(this.hangUpTimeout !== undefined) {\n clearTimeout(this.hangUpTimeout);\n this.hangUpTimeout = undefined;\n }\n }\n\n public setPhoneCall(phoneCall: PhoneCall) {\n this.call = phoneCall;\n\n const {id} = phoneCall;\n if(this.id !== id) {\n const prevId = this.id;\n this.id = id;\n this.dispatchEvent('id', id, prevId);\n }\n }\n\n public async acceptCall() {\n const canAccept = (await Promise.all(this.dispatchResultableEvent('acceptCallOverride')))[0] ?? true;\n if(this.isClosing || !canAccept) {\n return;\n }\n\n // this.clearHangUpTimeout();\n this.overrideConnectionState(CALL_STATE.EXCHANGING_KEYS);\n\n const call = this.call as PhoneCall.phoneCallRequested;\n this.requestInputSource(true, !!call.pFlags.video, false);\n\n const g_a_hash = call.g_a_hash;\n this.managers.appCallsManager.generateDh().then(async(dh) => {\n this.dh = { // ! it is correct\n g_a_hash,\n b: dh.a,\n g_b: dh.g_a,\n g_b_hash: dh.g_a_hash,\n p: dh.p\n };\n\n return this.managers.apiManager.invokeApi('phone.acceptCall', {\n peer: await this.managers.appCallsManager.getCallInput(this.id),\n protocol: this.protocol,\n g_b: this.dh.g_b\n });\n }).then(async(phonePhoneCall) => {\n await this.managers.appCallsManager.savePhonePhoneCall(phonePhoneCall);\n }).catch((err) => {\n this.log.error('accept call error', err);\n // if(err.type === 'CALL_PROTOCOL_COMPAT_LAYER_INVALID') {\n\n // }\n\n this.hangUp('phoneCallDiscardReasonHangup');\n });\n }\n\n public joinCall() {\n this.log('joinCall');\n\n this.getEmojisFingerprint();\n\n this.overrideConnectionState();\n\n const {isOutgoing, encryptionKey, streamManager} = this;\n\n const configuration = getRtcConfiguration(this.call as PhoneCall.phoneCall);\n this.log('joinCall configuration', configuration);\n if(!configuration) return;\n\n const connectionInstance = this.connectionInstance = new CallConnectionInstance({\n call: this,\n streamManager,\n log: this.log.bindPrefix('connection')\n });\n\n const connection = connectionInstance.createPeerConnection(configuration);\n connection.addEventListener('iceconnectionstatechange', () => {\n const state = this.connectionState;\n if(this.connectedAt === undefined && state === CALL_STATE.CONNECTED) {\n this.connectedAt = Date.now();\n }\n\n this.dispatchEvent('state', state);\n });\n connection.addEventListener('negotiationneeded', () => {\n connectionInstance.negotiate();\n });\n connection.addEventListener('icecandidate', (event) => {\n const {candidate} = event;\n connection.log('onicecandidate', candidate);\n if(candidate?.candidate) {\n this.sendIceCandidate(candidate);\n }\n });\n connection.addEventListener('track', (event) => {\n const {track} = event;\n connection.log('ontrack', track);\n this.onTrack(event);\n });\n\n const description = connectionInstance.createDescription();\n\n this.encryptor = new P2PEncryptor(isOutgoing, encryptionKey);\n this.decryptor = new P2PEncryptor(!isOutgoing, encryptionKey);\n\n this.log('currentCall', this);\n\n if(isOutgoing) {\n connectionInstance.appendStreamToConference();\n }\n\n this.createDataChannel();\n\n this.processDecryptQueue();\n }\n\n private createDataChannelEntry() {\n const dataChannelEntry = this.description.createEntry('application');\n dataChannelEntry.setDirection('sendrecv');\n dataChannelEntry.sendEntry = dataChannelEntry.recvEntry = dataChannelEntry;\n }\n\n private createDataChannel() {\n if(this.connectionInstance.dataChannel) {\n return;\n }\n\n const channel = this.connectionInstance.createDataChannel({\n id: 0,\n negotiated: true\n });\n channel.addEventListener('message', (e) => {\n this.applyDataChannelData(JSON.parse(e.data));\n });\n channel.addEventListener('open', () => {\n this.sendMediaState();\n });\n }\n\n private applyDataChannelData(data: CallMediaState) {\n switch(data['@type']) {\n case 'MediaState': {\n data.type = 'output';\n this.log('got output media state', data);\n this.setMediaState(data);\n break;\n }\n\n default:\n this.log.error('unknown data channel data:', data);\n break;\n }\n }\n\n private _sendMediaState() {\n const {connectionInstance} = this;\n if(!connectionInstance) return;\n\n const mediaState = {...this.getMediaState('input')};\n // mediaState.videoRotation = 90;\n delete mediaState.type;\n this.log('sendMediaState', mediaState);\n\n connectionInstance.sendDataChannelData(mediaState);\n }\n\n public async sendCallSignalingData(data: CallSignalingData) {\n /* if(data['@type'] === 'InitialSetup') {\n this.filterNotVP8(data);\n } */\n\n const json = JSON.stringify(data);\n const arr = new TextEncoder().encode(json);\n const {bytes} = await this.encryptor.encryptRawPacket(arr);\n\n this.log('sendCallSignalingData', this.id, json);\n await this.managers.apiManager.invokeApi('phone.sendSignalingData', {\n peer: await this.managers.appCallsManager.getCallInput(this.id),\n data: bytes\n });\n }\n\n public sendIceCandidate(iceCandidate: RTCIceCandidate) {\n this.log('sendIceCandidate', iceCandidate);\n const {candidate, sdpMLineIndex} = iceCandidate;\n if(sdpMLineIndex !== 0) {\n return;\n }\n\n const parsed = p2pParseCandidate(candidate);\n // const parsed = {sdpString: candidate};\n /* if(parsed.address.ip !== '') {\n return;\n } */\n\n this.sendCallSignalingData({\n '@type': 'Candidates',\n 'candidates': [parsed]\n });\n }\n\n public async confirmCall() {\n const {protocol, id, call} = this;\n const dh = this.dh as DiffieHellmanInfo.a;\n\n // this.clearHangUpTimeout();\n this.overrideConnectionState(CALL_STATE.EXCHANGING_KEYS);\n const {key, key_fingerprint} = await this.managers.appCallsManager.computeKey((call as PhoneCall.phoneCallAccepted).g_b, dh.a, dh.p);\n\n const phonePhoneCall = await this.managers.apiManager.invokeApi('phone.confirmCall', {\n peer: await this.managers.appCallsManager.getCallInput(id),\n protocol: protocol,\n g_a: dh.g_a,\n key_fingerprint: key_fingerprint\n });\n\n this.encryptionKey = key;\n await this.managers.appCallsManager.savePhonePhoneCall(phonePhoneCall);\n this.joinCall();\n }\n\n public getEmojisFingerprint() {\n if(this.emojisFingerprint) return this.emojisFingerprint;\n if(this.getEmojisFingerprintPromise) return this.getEmojisFingerprintPromise;\n return this.getEmojisFingerprintPromise = apiManagerProxy.invokeCrypto('get-emojis-fingerprint', this.encryptionKey, this.dh.g_a).then((codePoints) => {\n this.getEmojisFingerprintPromise = undefined;\n return this.emojisFingerprint = codePoints.map((codePoints) => emojiFromCodePoints(codePoints)) as [string, string, string, string];\n });\n }\n\n private unlockStreamManager() {\n this.connectionInstance.streamManager.locked = false;\n this.connectionInstance.appendStreamToConference();\n }\n\n private async doTheMagic() {\n this.connectionInstance.appendStreamToConference();\n\n const connection = this.connectionInstance.connection;\n\n let answer = await connection.createAnswer();\n\n this.log('[sdp] local', answer.type, answer.sdp);\n await connection.setLocalDescription(answer);\n\n connection.getTransceivers().filter((transceiver) => transceiver.direction === 'recvonly').forEach((transceiver) => {\n const entry = this.connectionInstance.description.getEntryByMid(transceiver.mid);\n entry.transceiver = entry.recvEntry.transceiver = transceiver;\n transceiver.direction = 'sendrecv';\n });\n\n const isAnswer = false;\n\n const description = this.description;\n const bundle = description.entries.map((entry) => entry.mid);\n const sdpDescription: RTCSessionDescriptionInit = {\n type: isAnswer ? 'answer' : 'offer',\n sdp: description.generateSdp({\n bundle,\n entries: description.entries.filter((entry) => bundle.includes(entry.mid)),\n // isAnswer: isAnswer\n isAnswer: !isAnswer\n })\n };\n\n await connection.setRemoteDescription(sdpDescription);\n\n answer = await connection.createAnswer();\n\n await connection.setLocalDescription(answer);\n\n const initialSetup = parseSignalingData(parseSdp(answer.sdp));\n this.log('[InitialSetup] send 1');\n this.sendCallSignalingData(initialSetup);\n\n this.unlockStreamManager();\n }\n\n public overrideConnectionState(state?: CALL_STATE) {\n this._connectionState = state;\n this.dispatchEvent('state', this.connectionState);\n }\n\n public get duration() {\n return this.connectedAt !== undefined ? (Date.now() - this.connectedAt) / 1000 | 0 : 0;\n }\n\n protected onInputStream(stream: MediaStream): void {\n super.onInputStream(stream);\n\n const videoTrack = stream.getVideoTracks()[0];\n if(videoTrack) {\n const state = this.getMediaState('input');\n\n // handle starting camera\n if(!this.wasStartingScreen && !this.wasStartingVideo) {\n this.wasStartingVideo = true;\n }\n\n if(this.isSharingVideo) {\n state.videoState = 'active';\n } else if(this.isSharingScreen) {\n state.screencastState = 'active';\n }\n\n videoTrack.addEventListener('ended', () => {\n this.stopVideoSharing();\n }, {once: true});\n }\n\n if(stream.getAudioTracks().length) {\n this.onMutedChange();\n }\n }\n\n private onMutedChange() {\n const isMuted = this.isMuted;\n this.dispatchEvent('muted', isMuted);\n\n const state = this.getMediaState('input');\n state.muted = isMuted;\n }\n\n public toggleMuted(): Promise {\n return this.requestAudioSource(true).then(() => {\n this.setMuted();\n this.onMutedChange();\n });\n }\n\n public async hangUp(discardReason?: PhoneCallDiscardReason['_'], discardedByOtherParty?: boolean) {\n if(this.isClosing) {\n return;\n }\n\n this.discardReason = discardReason;\n this.log('hangUp', discardReason);\n this.overrideConnectionState(CALL_STATE.CLOSED);\n\n if(this.connectionInstance) {\n this.connectionInstance.closeConnectionAndStream(true);\n }\n\n if(discardReason && !discardedByOtherParty) {\n let hasVideo = false;\n for(const type in this.mediaStates) {\n const mediaState = this.mediaStates[type as 'input' | 'output'];\n hasVideo = mediaState.videoState === 'active' || mediaState.screencastState === 'active' || hasVideo;\n }\n\n await this.managers.appCallsManager.discardCall(this.id, this.duration, discardReason, hasVideo);\n }\n }\n\n private performCodec(_codec: P2PAudioCodec | P2PVideoCodec) {\n const payloadTypes: AudioCodec['payload-types'] = _codec.payloadTypes.map((payloadType) => {\n return {\n ...payloadType,\n 'rtcp-fbs': payloadType.feedbackTypes\n }\n });\n\n const codec: AudioCodec = {\n 'rtp-hdrexts': _codec.rtpExtensions,\n 'payload-types': payloadTypes\n };\n\n return codec;\n }\n\n private setDataToDescription(data: CallSignalingData.initialSetup) {\n this.description.setData({\n transport: {\n 'pwd': data.pwd,\n 'ufrag': data.ufrag,\n 'fingerprints': data.fingerprints,\n 'rtcp-mux': true\n },\n audio: this.performCodec(data.audio),\n video: data.video ? this.performCodec(data.video) as VideoCodec : undefined,\n screencast: data.screencast ? this.performCodec(data.screencast) as VideoCodec : undefined\n });\n }\n\n private filterNotVP8(initialSetup: CallSignalingData.initialSetup) {\n if(!this.isOutgoing) { // only VP8 works now\n [initialSetup.video, initialSetup.screencast].filter(Boolean).forEach((codec) => {\n const payloadTypes = codec.payloadTypes;\n const idx = payloadTypes.findIndex((payloadType) => payloadType.name === 'VP8');\n const vp8PayloadType = payloadTypes[idx];\n const rtxIdx = payloadTypes.findIndex((payloadType) => +payloadType.parameters?.apt === vp8PayloadType.id);\n codec.payloadTypes = [payloadTypes[idx], payloadTypes[rtxIdx]];\n });\n }\n }\n\n public async applyCallSignalingData(data: CallSignalingData) {\n this.log('applyCallSignalingData', this, data);\n\n const {connection, description} = this.connectionInstance;\n\n switch(data['@type']) {\n case 'InitialSetup': {\n this.log('[sdp] InitialSetup', data);\n\n this.filterNotVP8(data);\n this.setDataToDescription(data);\n\n const performSsrcGroups = (ssrcGroups: P2PVideoCodec['ssrcGroups']): GroupCallParticipantVideoSourceGroup[] => {\n return ssrcGroups.map((ssrcGroup) => {\n return {\n _: 'groupCallParticipantVideoSourceGroup',\n semantics: ssrcGroup.semantics,\n sources: ssrcGroup.ssrcs.map((source) => +source)\n };\n });\n };\n\n const ssrcs = [\n generateSsrc('audio', +data.audio.ssrc),\n data.video ? generateSsrc('video', performSsrcGroups(data.video.ssrcGroups)) : undefined,\n data.screencast ? generateSsrc('screencast', performSsrcGroups(data.screencast.ssrcGroups)) : undefined\n ].filter(Boolean);\n\n ssrcs.forEach((ssrc) => {\n let entry = description.getEntryBySource(ssrc.source);\n if(entry) {\n return;\n }\n\n const sendRecvEntry = description.findFreeSendRecvEntry(ssrc.type, false);\n entry = new ConferenceEntry(sendRecvEntry.mid, ssrc.type);\n entry.setDirection('sendrecv');\n sendRecvEntry.recvEntry = entry;\n\n description.setEntrySource(entry, ssrc.sourceGroups || ssrc.source);\n });\n\n this.createDataChannelEntry();\n\n const isAnswer = this.offerSent;\n this.offerSent = false;\n\n const bundle = description.entries.map((entry) => entry.mid);\n const sdpDescription: RTCSessionDescriptionInit = {\n type: isAnswer ? 'answer' : 'offer',\n sdp: description.generateSdp({\n bundle,\n entries: description.entries.filter((entry) => bundle.includes(entry.mid)),\n // isAnswer: isAnswer\n isAnswer: !isAnswer\n })\n };\n\n this.log('[sdp] remote', sdpDescription.sdp);\n\n await connection.setRemoteDescription(sdpDescription);\n\n await this.tryToReleaseCandidates();\n\n if(!isAnswer) {\n await this.doTheMagic();\n }\n\n break;\n }\n\n case 'Candidates': {\n for(const candidate of data.candidates) {\n const init: RTCIceCandidateInit = P2PSdpBuilder.generateCandidate(candidate);\n init.sdpMLineIndex = 0;\n const iceCandidate = new RTCIceCandidate(init);\n this.candidates.push(iceCandidate);\n }\n\n await this.tryToReleaseCandidates();\n break;\n }\n\n default: {\n this.log.error('unrecognized signaling data', data);\n }\n }\n }\n\n public async tryToReleaseCandidates() {\n const {connectionInstance} = this;\n if(!connectionInstance) {\n return;\n }\n\n const {connection} = connectionInstance;\n if(connection.remoteDescription) {\n const promises: Promise[] = this.candidates.map((candidate) => this.addIceCandidate(connection, candidate));\n this.candidates.length = 0;\n\n await Promise.all(promises);\n } else {\n this.log('[candidates] postpone');\n }\n }\n\n private async addIceCandidate(connection: RTCPeerConnection, candidate: RTCIceCandidate) {\n this.log('[candidate] start', candidate);\n try {\n // if(!candidate.address) return;\n await connection.addIceCandidate(candidate);\n this.log('[candidate] add', candidate);\n } catch(e) {\n this.log.error('[candidate] error', candidate, e);\n }\n }\n\n private async processDecryptQueue() {\n const {encryptor} = this;\n if(!encryptor) {\n this.log.warn('got encrypted signaling data before the encryption key');\n return;\n }\n\n const length = this.decryptQueue.length;\n if(!length) {\n return;\n }\n\n const queue = this.decryptQueue.slice();\n this.decryptQueue.length = 0;\n\n for(const data of queue) {\n const decryptedData = await encryptor.decryptRawPacket(data);\n if(!decryptedData) {\n continue;\n }\n\n // this.log('[update] updateNewCallSignalingData', update, decryptedData);\n\n const str = new TextDecoder().decode(decryptedData);\n try {\n const signalingData: CallSignalingData = JSON.parse(str);\n this.log('[update] updateNewCallSignalingData', signalingData);\n this.applyCallSignalingData(signalingData);\n } catch(err) {\n this.log.error('wrong signaling data', str);\n this.hangUp('phoneCallDiscardReasonDisconnect');\n callsController.dispatchEvent('incompatible', this.interlocutorUserId);\n }\n }\n }\n\n public onUpdatePhoneCallSignalingData(data: Uint8Array) {\n this.decryptQueue.push(data);\n this.processDecryptQueue();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport {PhoneCallProtocol} from '../../../layer';\n\nexport default function getCallProtocol(): PhoneCallProtocol {\n return {\n _: 'phoneCallProtocol',\n pFlags: {\n udp_p2p: true,\n udp_reflector: true\n },\n min_layer: 92,\n max_layer: 92,\n library_versions: ['4.0.0']\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport {PhoneCall} from '../../../layer';\n\nexport default function getRtcConfiguration(call: PhoneCall.phoneCall): RTCConfiguration {\n const iceServers: RTCIceServer[] = [];\n call.connections.forEach((connection) => {\n switch(connection._) {\n /* case 'callServerTypeTelegramReflector': {\n break;\n } */\n case 'phoneConnectionWebrtc': {\n const {ip, ipv6, port, username, password} = connection;\n const urls: string[] = [];\n if(connection.pFlags.turn) {\n if(ip) {\n urls.push(`turn:${ip}:${port}`);\n }\n if(ipv6) {\n urls.push(`turn:[${ipv6}]:${port}`);\n }\n } else if(connection.pFlags.stun) {\n if(ip) {\n urls.push(`stun:${ip}:${port}`);\n }\n if(ipv6) {\n urls.push(`stun:[${ipv6}]:${port}`);\n }\n }\n\n if(urls.length > 0) {\n iceServers.push({\n urls,\n username,\n credential: password\n });\n }\n break;\n }\n }\n });\n\n return {\n iceServers,\n iceTransportPolicy: call.pFlags.p2p_allowed ? 'all' : 'relay'\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport getScreenStream from './getScreenStream';\nimport getStream from './getStream';\n\n/**\n * ! Use multiple constraints together only with first invoke\n */\nexport default function getStreamCached() {\n const _cache: {\n main: Partial<{\n audio: Promise,\n video: Promise\n }>,\n screen: Partial<{\n audio: Promise,\n video: Promise\n }>\n } = {\n main: {},\n screen: {}\n };\n\n return async(options: {\n isScreen: true,\n constraints: DisplayMediaStreamOptions,\n } | {\n isScreen?: false,\n constraints: MediaStreamConstraints,\n muted: boolean\n }) => {\n const {isScreen, constraints} = options;\n const cache = _cache[isScreen ? 'screen' : 'main'];\n let promise: Promise = cache[constraints.audio ? 'audio' : 'video'];\n\n if(!promise) {\n promise = (isScreen ? getScreenStream : getStream)(constraints, (options as any).muted);\n if(constraints.audio && !cache.audio) cache.audio = promise.finally(() => cache.audio = undefined);\n if(constraints.video && !cache.video) cache.video = promise.finally(() => cache.video = undefined);\n }\n\n try {\n return await promise;\n /* let out: Partial<{\n audio: MediaStream,\n video: MediaStream\n }> = {};\n\n await Promise.all([\n constraints.audio && cache.audio.then((stream) => out.audio = stream),\n constraints.video && cache.video.then((stream) => out.video = stream)\n ].filter(Boolean));\n\n return out; */\n } catch(err) {\n throw err;\n }\n };\n}\n\n(window as any).getStreamCached = getStreamCached;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport EventListenerBase, {EventListenerListeners} from '../../helpers/eventListenerBase';\nimport noop from '../../helpers/noop';\nimport {logger} from '../logger';\nimport getAudioConstraints from './helpers/getAudioConstraints';\nimport getScreenConstraints from './helpers/getScreenConstraints';\nimport getStreamCached from './helpers/getStreamCached';\nimport getVideoConstraints from './helpers/getVideoConstraints';\nimport stopTrack from './helpers/stopTrack';\nimport LocalConferenceDescription from './localConferenceDescription';\nimport StreamManager, {StreamItem} from './streamManager';\n\nexport type TryAddTrackOptions = {\n stream: MediaStream,\n track: MediaStreamTrack,\n type: StreamItem['type'],\n source?: string\n};\n\nexport default abstract class CallInstanceBase extends EventListenerBase {\n protected log: ReturnType;\n protected outputDeviceId: string;\n\n protected player: HTMLElement;\n protected elements: Map;\n\n protected audio: HTMLAudioElement;\n // protected fixedSafariAudio: boolean;\n\n protected getStream: ReturnType;\n\n constructor() {\n super(false);\n\n const player = this.player = document.createElement('div');\n player.classList.add('call-player');\n player.style.display = 'none';\n document.body.append(player);\n\n this.elements = new Map();\n\n // possible Safari fix\n const audio = this.audio = new Audio();\n audio.autoplay = true;\n audio.volume = 1.0;\n this.player.append(audio);\n this.elements.set('audio', audio);\n\n this.fixSafariAudio();\n\n this.getStream = getStreamCached();\n }\n\n public get isSharingAudio() {\n return !!this.streamManager.hasInputTrackKind('audio');\n }\n\n public get isSharingVideo() {\n return !!this.streamManager.hasInputTrackKind('video');\n }\n\n public abstract get isMuted(): boolean;\n public abstract get isClosing(): boolean;\n\n public fixSafariAudio() {\n // if(this.fixedSafariAudio) return;\n this.audio.play().catch(noop);\n // this.fixedSafariAudio = true;\n }\n\n public requestAudioSource(muted: boolean) {\n return this.requestInputSource(true, false, muted);\n }\n\n public requestInputSource(audio: boolean, video: boolean, muted: boolean) {\n const {streamManager} = this;\n if(streamManager) {\n const isAudioGood = !audio || this.isSharingAudio;\n const isVideoGood = !video || this.isSharingVideo;\n if(isAudioGood && isVideoGood) {\n return Promise.resolve();\n }\n }\n\n const constraints: MediaStreamConstraints = {\n audio: audio && getAudioConstraints(),\n video: video && getVideoConstraints()\n };\n\n return this.getStream({\n constraints,\n muted\n }).then((stream) => {\n this.onInputStream(stream);\n });\n }\n\n public requestScreen() {\n return this.getStream({\n isScreen: true,\n constraints: getScreenConstraints(true)\n }).then((stream) => {\n this.onInputStream(stream);\n });\n }\n\n public getElement(endpoint: number | string) {\n return this.elements.get('' + endpoint);\n }\n\n public abstract get streamManager(): StreamManager;\n public abstract get description(): LocalConferenceDescription;\n public abstract toggleMuted(): Promise;\n\n public cleanup() {\n this.player.textContent = '';\n this.player.remove();\n this.elements.clear();\n\n // can have no connectionInstance but streamManager with input stream\n this.streamManager.stop();\n\n super.cleanup();\n }\n\n public onTrack(event: RTCTrackEvent) {\n this.tryAddTrack({\n stream: event.streams[0],\n track: event.track,\n type: 'output'\n });\n }\n\n public saveInputVideoStream(stream: MediaStream, type?: string) {\n const track = stream.getVideoTracks()[0];\n this.tryAddTrack({\n stream,\n track,\n type: 'input',\n source: type || 'main'\n });\n }\n\n public tryAddTrack({stream, track, type, source}: TryAddTrackOptions) {\n if(!source) {\n source = StreamManager.getSource(stream, type);\n }\n\n this.log('tryAddTrack', stream, track, type, source);\n\n const isOutput = type === 'output';\n\n const {player, elements, streamManager} = this;\n\n const tagName = track.kind as StreamItem['kind'];\n const isVideo = tagName === 'video';\n\n const elementEndpoint = isVideo ? source : tagName;\n let element = elements.get(elementEndpoint);\n\n if(isVideo) {\n track.addEventListener('ended', () => {\n this.log('[track] onended');\n elements.delete(elementEndpoint);\n // element.remove();\n }, {once: true});\n }\n\n if(isOutput) {\n streamManager.addTrack(stream, track, type);\n }\n\n const useStream = isVideo ? stream : streamManager.outputStream;\n if(!element) {\n element = document.createElement(tagName);\n element.autoplay = true;\n element.srcObject = useStream;\n element.volume = 1.0;\n\n if((element as any).sinkId !== 'undefined') {\n const {outputDeviceId} = this;\n if(outputDeviceId) {\n (element as any).setSinkId(outputDeviceId);\n }\n }\n\n if(!isVideo) {\n player.appendChild(element);\n } else {\n element.setAttribute('playsinline', 'true');\n element.muted = true;\n }\n // audio.play();\n\n elements.set(elementEndpoint, element);\n } else {\n if(element.paused) {\n element.play().catch(noop);\n }\n\n // ! EVEN IF MEDIASTREAM IS THE SAME NEW TRACK WON'T PLAY WITHOUT REPLACING IT WHEN NEW PARTICIPANT IS ENTERING !\n // if(element.srcObject !== useStream) {\n element.srcObject = useStream;\n // }\n }\n\n return source;\n }\n\n public setMuted(muted?: boolean) {\n this.streamManager.inputStream.getAudioTracks().forEach((track) => {\n if(track?.kind === 'audio') {\n track.enabled = muted === undefined ? !track.enabled : !muted;\n }\n });\n }\n\n protected onInputStream(stream: MediaStream): void {\n if(!this.isClosing) {\n const videoTracks = stream.getVideoTracks();\n if(videoTracks.length) {\n this.saveInputVideoStream(stream, 'main');\n }\n\n const {streamManager, description} = this;\n streamManager.addStream(stream, 'input');\n\n if(description) {\n streamManager.appendToConference(description);\n }\n } else { // if call is declined earlier than stream appears\n stream.getTracks().forEach((track) => {\n stopTrack(track);\n });\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nenum CALL_STATE {\n CONNECTED,\n CONNECTING,\n EXCHANGING_KEYS,\n PENDING,\n REQUESTING,\n CLOSING,\n CLOSED\n}\n\nexport default CALL_STATE;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport AudioAssetPlayer from '../../helpers/audioAssetPlayer';\n\nexport type CallAudioAssetName = 'call_busy.mp3' | 'call_connect.mp3' | 'call_end.mp3' | 'call_incoming.mp3' | 'call_outgoing.mp3' | 'voip_failed.mp3' | 'voip_connecting.mp3';\n\nlet audioAsset: AudioAssetPlayer;\nexport default function getCallAudioAsset() {\n return audioAsset ??= new AudioAssetPlayer([\n 'call_busy.mp3',\n 'call_connect.mp3',\n 'call_end.mp3',\n 'call_incoming.mp3',\n 'call_outgoing.mp3',\n 'voip_failed.mp3'\n ]);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport getCallAudioAsset, {CallAudioAssetName} from '../../components/call/getAudioAsset';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport IS_CALL_SUPPORTED from '../../environment/callSupport';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport insertInDescendSortedArray from '../../helpers/array/insertInDescendSortedArray';\nimport AudioAssetPlayer from '../../helpers/audioAssetPlayer';\nimport bytesCmp from '../../helpers/bytes/bytesCmp';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport tsNow from '../../helpers/tsNow';\nimport {PhoneCallProtocol} from '../../layer';\nimport {CallId} from '../appManagers/appCallsManager';\nimport {AppManagers} from '../appManagers/managers';\nimport {logger} from '../logger';\nimport apiManagerProxy from '../mtproto/mtprotoworker';\nimport {NULL_PEER_ID} from '../mtproto/mtproto_config';\nimport rootScope from '../rootScope';\nimport CallInstance from './callInstance';\nimport CALL_STATE from './callState';\n\nconst CALL_REQUEST_TIMEOUT = 45e3;\n\nexport class CallsController extends EventListenerBase<{\n instance: (details: {hasCurrent: boolean, instance: CallInstance}) => void,\n accepting: (instance: CallInstance) => void, // это костыль. используется при параллельном вызове, чтобы заменить звонок в topbarCall\n incompatible: (userId: UserId) => void,\n}> {\n private log: ReturnType;\n private managers: AppManagers;\n private audioAsset: AudioAssetPlayer;\n private instances: Map;\n private sortedInstances: Array;\n private tempId: number;\n\n public construct(managers: AppManagers) {\n this.managers = managers;\n this.log = logger('CC');\n\n if(!IS_CALL_SUPPORTED) {\n return;\n }\n\n this.audioAsset = getCallAudioAsset();\n this.tempId = 0;\n this.instances = new Map();\n this.sortedInstances = [];\n\n rootScope.addEventListener('call_update', async(call) => {\n let instance = this.instances.get(call.id);\n\n if(instance) {\n instance.setPhoneCall(call);\n }\n\n switch(call._) {\n case 'phoneCallDiscarded': {\n if(instance) {\n instance.hangUp(call.reason?._, true);\n }\n\n break;\n }\n\n case 'phoneCallAccepted': {\n if(instance) {\n /* if(!this.verifyProtocolCompatibility(call.protocol)) {\n instance.hangUp('phoneCallDiscardReasonDisconnect');\n rootScope.dispatchEvent('call_incompatible', instance.interlocutorUserId);\n break;\n } */\n\n instance.confirmCall();\n }\n\n break;\n }\n\n case 'phoneCallRequested': {\n if(!instance) {\n /* if(!this.verifyProtocolCompatibility(call.protocol)) {\n rootScope.dispatchEvent('call_incompatible', call.admin_id);\n break;\n } */\n\n instance = this.createCallInstance({\n isOutgoing: false,\n interlocutorUserId: call.admin_id\n });\n\n instance.overrideConnectionState(CALL_STATE.PENDING);\n instance.setPhoneCall(call);\n instance.setHangUpTimeout(CALL_REQUEST_TIMEOUT, 'phoneCallDiscardReasonMissed');\n }\n\n break;\n }\n\n case 'phoneCall': {\n if(!instance || instance.encryptionKey) {\n break;\n }\n\n const g_a = instance.dh.g_a = call.g_a_or_b;\n const dh = instance.dh;\n const g_a_hash = await apiManagerProxy.invokeCrypto('sha256', g_a);\n if(!bytesCmp(dh.g_a_hash, g_a_hash)) {\n this.log.error('Incorrect g_a_hash', dh.g_a_hash, g_a_hash);\n break;\n }\n\n const {key, key_fingerprint} = await this.managers.appCallsManager.computeKey(g_a, dh.b, dh.p);\n if(call.key_fingerprint !== key_fingerprint) {\n this.log.error('Incorrect key fingerprint', call.key_fingerprint, key_fingerprint, g_a, dh);\n instance.hangUp('phoneCallDiscardReasonDisconnect');\n break;\n }\n\n instance.encryptionKey = key;\n instance.joinCall();\n\n break;\n }\n }\n });\n\n rootScope.addEventListener('call_signaling', ({callId, data}) => {\n const instance = this.instances.get(callId);\n if(instance?.id !== callId) {\n return;\n }\n\n instance.onUpdatePhoneCallSignalingData(data);\n });\n }\n\n public get currentCall() {\n return this.sortedInstances[0];\n }\n\n public getCallByUserId(userId: UserId) {\n for(const [callId, instance] of this.instances) {\n if(instance.interlocutorUserId === userId) {\n return instance;\n }\n }\n }\n\n private createCallInstance(options: {\n isOutgoing: boolean,\n interlocutorUserId: UserId,\n protocol?: PhoneCallProtocol\n }) {\n const call = new CallInstance({\n managers: this.managers,\n ...options\n });\n\n call.addEventListener('state', (state) => {\n const currentCall = this.currentCall;\n if(state === CALL_STATE.CLOSED) {\n this.instances.delete(call.id);\n indexOfAndSplice(this.sortedInstances, call);\n } else {\n insertInDescendSortedArray(this.sortedInstances, call, 'sortIndex');\n }\n\n if(state === CALL_STATE.EXCHANGING_KEYS) {\n call.wasTryingToJoin = true;\n }\n\n const hasConnected = call.connectedAt !== undefined;\n if(state === CALL_STATE.EXCHANGING_KEYS || (state === CALL_STATE.CONNECTING && hasConnected)) {\n call.setHangUpTimeout(CALL_REQUEST_TIMEOUT, 'phoneCallDiscardReasonDisconnect');\n } else {\n call.clearHangUpTimeout();\n }\n\n if(currentCall === call || !currentCall) {\n if(state === CALL_STATE.CLOSED) {\n if(!call.isOutgoing && !call.wasTryingToJoin) { // incoming call has been accepted on other device or ended\n this.audioAsset.stopSound();\n } else if(call.wasTryingToJoin && !hasConnected) { // something has happened during the key exchanging\n this.audioAsset.playSound('voip_failed.mp3');\n } else {\n this.audioAsset.playSound(call.discardReason === 'phoneCallDiscardReasonBusy' ? 'call_busy.mp3' : 'call_end.mp3');\n }\n } else if(state === CALL_STATE.PENDING) {\n this.audioAsset.playSound(call.isOutgoing ? 'call_outgoing.mp3' : 'call_incoming.mp3', true);\n } else if(state === CALL_STATE.EXCHANGING_KEYS) {\n this.audioAsset.playSoundIfDifferent('call_connect.mp3');\n } else if(state === CALL_STATE.CONNECTING) {\n if(call.duration) {\n this.audioAsset.playSound('voip_connecting.mp3', true);\n }\n } else {\n this.audioAsset.stopSound();\n }\n }\n });\n\n call.addEventListener('id', (id, prevId) => {\n if(prevId !== undefined) {\n this.instances.delete(prevId);\n }\n\n const hasCurrent = !!this.currentCall;\n this.instances.set(id, call);\n\n if(prevId === undefined) {\n this.dispatchEvent('instance', {instance: call, hasCurrent: hasCurrent});\n }\n });\n\n return call;\n }\n\n public async startCallInternal(userId: UserId, isVideo: boolean) {\n this.log('p2pStartCallInternal', userId, isVideo);\n\n const fullInfo = await this.managers.appProfileManager.getProfile(userId);\n if(!fullInfo) return;\n\n const {video_calls_available} = fullInfo.pFlags;\n\n const call = this.createCallInstance({\n isOutgoing: true,\n interlocutorUserId: userId\n });\n\n call.requestInputSource(true, !!(isVideo && video_calls_available), false);\n\n call.overrideConnectionState(CALL_STATE.REQUESTING);\n call.setPhoneCall({\n _: 'phoneCallWaiting',\n access_hash: '',\n admin_id: NULL_PEER_ID,\n date: tsNow(true),\n id: --this.tempId,\n participant_id: userId,\n protocol: call.protocol,\n pFlags: {\n video: isVideo || undefined\n }\n });\n\n // return;\n this.managers.appCallsManager.generateDh().then(async(dh) => {\n call.dh = dh;\n\n return this.managers.appCallsManager.requestCall(userId, call.protocol, call.dh.g_a_hash, isVideo && video_calls_available);\n }).then((phoneCall) => {\n call.overrideConnectionState(CALL_STATE.PENDING);\n call.setPhoneCall(phoneCall);\n call.setHangUpTimeout(CALL_REQUEST_TIMEOUT, 'phoneCallDiscardReasonHangup');\n });\n }\n}\n\nconst callsController = new CallsController();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.callsController = callsController);\nexport default callsController;\n","export const GROUP_CALL_AMPLITUDE_ANALYSE_COUNT_MAX = 50;\nexport const GROUP_CALL_AMPLITUDE_ANALYSE_INTERVAL_MS = 100;\nexport const GROUP_CALL_PARTICIPANTS_LOAD_LIMIT = 100;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport throttle from '../../helpers/schedulers/throttle';\nimport {GroupCallConnectionType, JoinGroupCallJsonPayload} from '../appManagers/appGroupCallsManager';\nimport {AppManagers} from '../appManagers/managers';\nimport rootScope from '../rootScope';\nimport CallConnectionInstanceBase, {CallConnectionInstanceOptions} from './callConnectionInstanceBase';\nimport GroupCallInstance from './groupCallInstance';\nimport filterServerCodecs from './helpers/filterServerCodecs';\nimport fixLocalOffer from './helpers/fixLocalOffer';\nimport processMediaSection from './helpers/processMediaSection';\nimport {ConferenceEntry} from './localConferenceDescription';\nimport SDP from './sdp';\nimport SDPMediaSection from './sdp/mediaSection';\nimport {WebRTCLineType} from './sdpBuilder';\nimport {UpdateGroupCallConnectionData} from './types';\n\nexport default class GroupCallConnectionInstance extends CallConnectionInstanceBase {\n private groupCall: GroupCallInstance;\n public updateConstraints?: boolean;\n private type: GroupCallConnectionType;\n private options: {\n type: Extract,\n isMuted?: boolean,\n joinVideo?: boolean,\n rejoin?: boolean\n } | {\n type: Extract,\n };\n\n private updateConstraintsInterval: number;\n public negotiateThrottled: () => void;\n\n private managers: AppManagers;\n\n constructor(options: CallConnectionInstanceOptions & {\n groupCall: GroupCallConnectionInstance['groupCall'],\n type: GroupCallConnectionInstance['type'],\n options: GroupCallConnectionInstance['options'],\n managers: AppManagers\n }) {\n super(options);\n\n this.negotiateThrottled = throttle(this.negotiate.bind(this), 0, false);\n }\n\n public createPeerConnection() {\n return this.connection || super.createPeerConnection({\n iceServers: [],\n iceTransportPolicy: 'all',\n bundlePolicy: 'max-bundle',\n rtcpMuxPolicy: 'require',\n iceCandidatePoolSize: 0\n // sdpSemantics: \"unified-plan\",\n // extmapAllowMixed: true,\n });\n }\n\n public createDataChannel() {\n if(this.dataChannel) {\n return this.dataChannel;\n }\n\n const dataChannel = super.createDataChannel();\n\n dataChannel.addEventListener('open', () => {\n this.maybeUpdateRemoteVideoConstraints();\n });\n\n dataChannel.addEventListener('close', () => {\n if(this.updateConstraintsInterval) {\n clearInterval(this.updateConstraintsInterval);\n this.updateConstraintsInterval = undefined;\n }\n });\n\n return dataChannel;\n }\n\n public createDescription() {\n if(this.description) {\n return this.description;\n }\n\n const description = super.createDescription();\n\n /* const perType = 0;\n const types = ['audio' as const, 'video' as const];\n const count = types.length * perType;\n const init: RTCRtpTransceiverInit = {direction: 'recvonly'};\n types.forEach((type) => {\n for(let i = 0; i < perType; ++i) {\n description.createEntry(type).createTransceiver(connection, init);\n }\n }); */\n\n return description;\n }\n\n public appendStreamToConference() {\n super.appendStreamToConference();/* .then(() => {\n currentGroupCall.connections.main.negotiating = false;\n this.startNegotiation({\n type: type,\n isMuted: muted,\n rejoin\n });\n }); */\n }\n\n private async invokeJoinGroupCall(localSdp: SDP, mainChannels: SDPMediaSection[], options: GroupCallConnectionInstance['options']) {\n const {groupCall, description} = this;\n const groupCallId = groupCall.id;\n\n const processedChannels = mainChannels.map((section) => {\n const processed = processMediaSection(localSdp, section);\n\n this.sources[processed.entry.type as 'video' | 'audio'] = processed.entry;\n\n return processed;\n });\n\n const audioChannel = processedChannels.find((channel) => channel.media.mediaType === 'audio');\n const videoChannel = processedChannels.find((channel) => channel.media.mediaType === 'video');\n let {source, params} = audioChannel || {};\n const useChannel = videoChannel || audioChannel;\n\n const channels: {[type in WebRTCLineType]?: typeof audioChannel} = {\n audio: audioChannel,\n video: videoChannel\n };\n\n description.entries.forEach((entry) => {\n if(entry.direction === 'sendonly') {\n const channel = channels[entry.type];\n if(!channel) return;\n\n description.setEntrySource(entry, channel.sourceGroups || channel.source);\n description.setEntryPeerId(entry, rootScope.myId);\n }\n });\n\n // overwrite ssrc with audio in video params\n if(params !== useChannel.params) {\n const data: JoinGroupCallJsonPayload = JSON.parse(useChannel.params.data);\n // data.ssrc = source || data.ssrc - 1; // audio channel can be missed in screensharing\n if(source) data.ssrc = source;\n else delete data.ssrc;\n params = {\n _: 'dataJSON',\n data: JSON.stringify(data)\n };\n }\n\n const update = await this.managers.appGroupCallsManager.joinGroupCall(groupCallId, params, options);\n\n const data: UpdateGroupCallConnectionData = JSON.parse(update.params.data);\n\n data.audio = data.audio || groupCall.connections.main.description.audio;\n description.setData(data);\n filterServerCodecs(mainChannels, data);\n\n return data;\n }\n\n protected async negotiateInternal() {\n const {connection, description} = this;\n const isNewConnection = connection.iceConnectionState === 'new' && !description.getEntryByMid('0').source;\n const log = this.log.bindPrefix('startNegotiation');\n log('start');\n\n const originalOffer = await connection.createOffer({iceRestart: false});\n\n if(isNewConnection && this.dataChannel) {\n const dataChannelEntry = description.createEntry('application');\n dataChannelEntry.setDirection('sendrecv');\n }\n\n const {sdp: localSdp, offer} = fixLocalOffer({\n offer: originalOffer,\n data: description\n });\n\n log('[sdp] setLocalDescription', offer.sdp);\n await connection.setLocalDescription(offer);\n\n const mainChannels = localSdp.media.filter((media) => {\n return media.mediaType !== 'application' && media.isSending;\n });\n\n if(isNewConnection) {\n try {\n await this.invokeJoinGroupCall(localSdp, mainChannels, this.options);\n } catch(e) {\n this.log.error('[tdweb] joinGroupCall error', e);\n }\n }\n\n /* if(!data) {\n log('abort 0');\n this.closeConnectionAndStream(connection, streamManager);\n return;\n } */\n\n /* if(connection.iceConnectionState !== 'new') {\n log(`abort 1 connectionState=${connection.iceConnectionState}`);\n this.closeConnectionAndStream(connection, streamManager);\n return;\n } */\n /* if(this.currentGroupCall !== currentGroupCall || connectionHandler.connection !== connection) {\n log('abort', this.currentGroupCall, currentGroupCall);\n this.closeConnectionAndStream(connection, streamManager);\n return;\n } */\n\n const isAnswer = true;\n // const _bundleMids = bundleMids.slice();\n const entriesToDelete: ConferenceEntry[] = [];\n const bundle = localSdp.bundle;\n forEachReverse(bundle, (mid, idx, arr) => {\n const entry = description.getEntryByMid(mid);\n if(entry.shouldBeSkipped(isAnswer)) {\n arr.splice(idx, 1);\n entriesToDelete.push(entry);\n }\n });\n\n /* forEachReverse(description.entries, (entry, idx, arr) => {\n const mediaSection = _parsedSdp.media.find((section) => section.oa.get('mid').oa === entry.mid);\n const deleted = !mediaSection;\n // const deleted = !_bundleMids.includes(entry.mid); // ! can't use it because certain mid can be missed in bundle\n if(deleted) {\n arr.splice(idx, 1);\n }\n }); */\n\n const entries = localSdp.media.map((section) => {\n const mid = section.mid;\n let entry = description.getEntryByMid(mid);\n if(!entry) {\n entry = new ConferenceEntry(mid, section.mediaType);\n entry.setDirection('inactive');\n }\n\n return entry;\n });\n\n const answerDescription: RTCSessionDescriptionInit = {\n type: 'answer',\n sdp: description.generateSdp({\n bundle,\n entries,\n isAnswer\n })\n };\n\n entriesToDelete.forEach((entry) => {\n description.deleteEntry(entry);\n });\n\n log(`[sdp] setRemoteDescription signaling=${connection.signalingState} ice=${connection.iceConnectionState} gathering=${connection.iceGatheringState} connection=${connection.connectionState}`, answerDescription.sdp);\n await connection.setRemoteDescription(answerDescription);\n\n log('end');\n }\n\n public negotiate() {\n let promise = this.negotiating;\n if(promise) {\n return promise;\n }\n\n promise = super.negotiate();\n\n if(this.updateConstraints) {\n promise.then(() => {\n this.maybeUpdateRemoteVideoConstraints();\n this.updateConstraints = false;\n });\n }\n\n if(this.options.type === 'presentation') {\n promise.then(() => {\n this.connection.getTransceivers().find((transceiver) => {\n if(transceiver.sender?.track?.kind === 'video') {\n transceiver.sender.setParameters({\n ...transceiver.sender.getParameters(),\n degradationPreference: 'maintain-resolution'\n });\n }\n });\n });\n }\n\n return promise;\n }\n\n public maybeUpdateRemoteVideoConstraints() {\n if(this.dataChannel.readyState !== 'open') {\n return;\n }\n\n this.log('maybeUpdateRemoteVideoConstraints');\n\n // * https://github.com/TelegramMessenger/tgcalls/blob/6f2746e04c9b040f8c8dfc64d916a1853d09c4ce/tgcalls/group/GroupInstanceCustomImpl.cpp#L2549\n type VideoConstraints = {minHeight?: number, maxHeight: number};\n const obj: {\n colibriClass: 'ReceiverVideoConstraints',\n constraints: {[endpoint: string]: VideoConstraints},\n defaultConstraints: VideoConstraints,\n onStageEndpoints: string[]\n } = {\n colibriClass: 'ReceiverVideoConstraints',\n constraints: {},\n defaultConstraints: {maxHeight: 0},\n onStageEndpoints: []\n };\n\n for(const entry of this.description.entries) {\n if(entry.direction !== 'recvonly' || entry.type !== 'video') {\n continue;\n }\n\n const {endpoint} = entry;\n obj.onStageEndpoints.push(endpoint);\n obj.constraints[endpoint] = {\n minHeight: 180,\n maxHeight: 720\n };\n }\n\n this.sendDataChannelData(obj);\n\n if(!obj.onStageEndpoints.length) {\n if(this.updateConstraintsInterval) {\n clearInterval(this.updateConstraintsInterval);\n this.updateConstraintsInterval = undefined;\n }\n } else if(!this.updateConstraintsInterval) {\n this.updateConstraintsInterval = window.setInterval(this.maybeUpdateRemoteVideoConstraints.bind(this), 5000);\n }\n }\n\n public addInputVideoStream(stream: MediaStream) {\n // const {sources} = this;\n // if(sources?.video) {\n // const source = this.sources.video.source;\n // stream.source = '' + source;\n this.groupCall.saveInputVideoStream(stream, this.type);\n // }\n\n this.streamManager.addStream(stream, 'input');\n this.appendStreamToConference(); // replace sender track\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {DataJSON} from '../../../layer';\nimport {JoinGroupCallJsonPayload} from '../../appManagers/appGroupCallsManager';\nimport SDP from '../sdp';\nimport {Ssrc} from '../types';\nimport parseMediaSectionInfo from './parseMediaSectionInfo';\n\nexport default function processMediaSection(sdp: SDP, media: SDP['media'][0]) {\n const sectionInfo = parseMediaSectionInfo(sdp, media);\n\n const mediaType: Exclude = media.mediaType as any;\n const entry: Ssrc = {\n source: sectionInfo.source,\n sourceGroups: sectionInfo.sourceGroups,\n type: mediaType\n };\n\n // do not change this value, otherwise onconnectionstatechange won't fire\n sectionInfo.fingerprint.setup = 'active';\n const payload: JoinGroupCallJsonPayload = {\n 'fingerprints': [sectionInfo.fingerprint],\n 'pwd': sectionInfo.pwd,\n 'ssrc': sectionInfo.source,\n 'ssrc-groups': sectionInfo.sourceGroups || [],\n 'ufrag': sectionInfo.ufrag\n };\n const paramsDataJson = JSON.stringify(payload);\n\n const params: DataJSON = {\n _: 'dataJSON',\n data: paramsDataJson\n };\n\n return {\n params,\n source: sectionInfo.source,\n media,\n sourceGroups: sectionInfo.sourceGroups,\n entry\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport forEachReverse from '../../../helpers/array/forEachReverse';\nimport SDPMediaSection from '../sdp/mediaSection';\nimport {UpdateGroupCallConnectionData, Codec} from '../types';\n\nexport default function filterServerCodecs(mainChannels: SDPMediaSection[], data: UpdateGroupCallConnectionData) {\n // ! Need to filter server's extmap for Firefox\n const performExtmap = (channel: typeof mainChannels[0]) => {\n const out: {[id: string]: string} = {};\n const extmap = channel.attributes.get('extmap');\n extmap.forEach((extmap) => {\n const id = extmap.key.split('/', 1)[0];\n out[id] = extmap.value;\n });\n\n return out;\n };\n\n const codecsToPerform: [Codec, 'audio' | 'video'][] = /* flatten([data, dataPresentation].filter(Boolean).map((data) => {\n return */['audio' as const, 'video' as const].filter((type) => data[type]).map((type) => ([data[type], type]));\n // }));\n\n codecsToPerform.forEach(([codec, type]) => {\n const channel = mainChannels.find((line) => line.mediaType === type);\n if(!channel) {\n return;\n }\n\n const extmap = performExtmap(channel);\n forEachReverse(codec['rtp-hdrexts'], (value, index, arr) => {\n if(extmap[value.id] !== value.uri) {\n arr.splice(index, 1);\n console.log(`[sdp] filtered extmap:`, value, index, type);\n }\n });\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport forEachReverse from '../../../helpers/array/forEachReverse';\nimport copy from '../../../helpers/object/copy';\nimport {ConferenceEntry} from '../localConferenceDescription';\nimport {parseSdp, addSimulcast} from '../sdp/utils';\nimport {generateMediaFirstLine, SDPBuilder} from '../sdpBuilder';\nimport {UpdateGroupCallConnectionData} from '../types';\nimport parseMediaSectionInfo from './parseMediaSectionInfo';\n\nexport default function fixLocalOffer(options: {\n offer: RTCSessionDescriptionInit,\n data: UpdateGroupCallConnectionData,\n skipAddingMulticast?: boolean\n // mids?: string[]\n}) {\n const {offer, data} = options;\n const sdp = parseSdp(offer.sdp);\n let hasMunged = false;\n\n if(!options.skipAddingMulticast) {\n hasMunged = addSimulcast(sdp) || hasMunged;\n }\n\n // const bundleLine = parsedSdp.session.lines.find((line) => line.Ha?.key === 'group');\n // const bundleMids = bundleLine.value.split(' ').slice(1);\n\n forEachReverse(sdp.media, (section, idx, arr) => {\n // const mid = section.oa.get('mid').oa;\n\n // это может случиться при выключении и включении видео. почему-то появится секция уже удалённая\n // ! нельзя тут модифицировать локальное описание, будет критовать\n /* if(mids && !mids.includes(mid) && !bundleMids.includes(mid)) {\n console.error('wtf');\n hasMunged = true;\n arr.splice(idx, 1);\n return;\n } */\n\n if(/* section.mediaType !== 'video' || */section.isSending) {\n return;\n }\n\n if(section.mediaType === 'application') {\n return;\n }\n\n const mediaLine = section.mediaLine;\n const mediaLineParts = mediaLine.mediaLineParts;\n const mediaCodecIds = mediaLineParts.ids;\n const localMLine = mediaLine.toString();\n\n const codec = data[section.mediaType];\n const payloadTypes = codec['payload-types'];\n\n /* forEachReverse(payloadTypes, (payloadType, idx, arr) => {\n if(!mediaCodecIds.includes('' + payloadType.id) && section.mediaType === 'video') {\n // if(payloadType.name === 'H265') {\n console.warn('[sdp] filtered unsupported codec', payloadType, mediaCodecIds, section.mediaType);\n arr.splice(idx, 1);\n }\n }); */\n\n const codecIds = payloadTypes.map((payload) => '' + payload.id);\n const correctMLine = generateMediaFirstLine(section.mediaType, undefined, codecIds);\n\n if(localMLine !== correctMLine) {\n const sectionInfo = parseMediaSectionInfo(sdp, section);\n\n const newData = {...data};\n newData.transport = copy(newData.transport);\n newData.transport.ufrag = sectionInfo.ufrag;\n newData.transport.pwd = sectionInfo.pwd;\n newData.transport.fingerprints = [sectionInfo.fingerprint];\n newData.transport.candidates = [];\n\n const entry = new ConferenceEntry(sectionInfo.mid, mediaLineParts.type);\n entry.setPort(mediaLineParts.port);\n sectionInfo.source && entry.setSource(sectionInfo.sourceGroups || sectionInfo.source);\n entry.setDirection(section.direction);\n\n const newSdp = new SDPBuilder().addSsrcEntry(entry, newData).finalize();\n\n const newChannel = parseSdp(newSdp).media[0];\n arr[idx] = newChannel;\n\n hasMunged = true;\n }\n });\n\n if(hasMunged) {\n const mungedSdp = sdp.toString();\n offer.sdp = mungedSdp;\n }\n\n return {offer, sdp/* , bundleMids */};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {GroupCallConnectionType, GroupCallId, GroupCallOutputSource} from '../appManagers/appGroupCallsManager';\nimport {IS_SAFARI} from '../../environment/userAgent';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport throttle from '../../helpers/schedulers/throttle';\nimport {GroupCall, GroupCallParticipant} from '../../layer';\nimport {logger} from '../logger';\nimport {NULL_PEER_ID} from '../mtproto/mtproto_config';\nimport rootScope from '../rootScope';\nimport CallInstanceBase, {TryAddTrackOptions} from './callInstanceBase';\nimport GroupCallConnectionInstance from './groupCallConnectionInstance';\nimport GROUP_CALL_STATE from './groupCallState';\nimport getScreenConstraints from './helpers/getScreenConstraints';\nimport getScreenStream from './helpers/getScreenStream';\nimport getStream from './helpers/getStream';\nimport getVideoConstraints from './helpers/getVideoConstraints';\nimport stopTrack from './helpers/stopTrack';\nimport localConferenceDescription from './localConferenceDescription';\nimport {WebRTCLineType} from './sdpBuilder';\nimport StreamManager from './streamManager';\nimport {Ssrc} from './types';\nimport getPeerId from '../appManagers/utils/peers/getPeerId';\nimport {AppManagers} from '../appManagers/managers';\nimport {generateSelfVideo, makeSsrcFromParticipant, makeSsrcsFromParticipant} from './groupCallsController';\n\nexport default class GroupCallInstance extends CallInstanceBase<{\n state: (state: GROUP_CALL_STATE) => void,\n pinned: (source?: GroupCallOutputSource) => void,\n}> {\n public id: GroupCallId;\n public chatId: ChatId;\n public handleUpdateGroupCallParticipants: boolean;\n public updatingSdp: boolean;\n public isSpeakingMap: Map;\n public connections: {[k in GroupCallConnectionType]?: GroupCallConnectionInstance};\n public groupCall: GroupCall;\n public participant: GroupCallParticipant;\n\n // will be set with negotiation\n public joined: boolean;\n\n private pinnedSources: Array;\n private participantsSsrcs: Map;\n private hadAutoPinnedSources: Set;\n private dispatchPinnedThrottled: () => void;\n private startVideoSharingPromise: Promise;\n private startScreenSharingPromise: Promise;\n\n private managers: AppManagers;\n\n constructor(options: {\n id: GroupCallInstance['id'],\n chatId: GroupCallInstance['chatId'],\n isSpeakingMap?: GroupCallInstance['isSpeakingMap'],\n connections?: GroupCallInstance['connections'],\n managers: AppManagers\n }) {\n super();\n\n safeAssign(this, options);\n\n if(!this.log) {\n this.log = logger('GROUP-CALL');\n }\n\n if(!this.connections) {\n this.connections = {};\n }\n\n if(!this.isSpeakingMap) {\n this.isSpeakingMap = new Map();\n }\n\n this.pinnedSources = [];\n this.participantsSsrcs = new Map();\n this.hadAutoPinnedSources = new Set();\n this.dispatchPinnedThrottled = throttle(() => {\n this.dispatchEvent('pinned', this.pinnedSource);\n }, 0, false);\n\n this.addEventListener('state', (state) => {\n if(state === GROUP_CALL_STATE.CLOSED) {\n this.cleanup();\n }\n });\n }\n\n get connectionState() {\n return this.connections.main.connection.iceConnectionState;\n }\n\n get state() {\n const {connectionState} = this;\n if(connectionState === 'closed') {\n return GROUP_CALL_STATE.CLOSED;\n } else if(connectionState !== 'connected' && (!IS_SAFARI || connectionState !== 'completed')) {\n return GROUP_CALL_STATE.CONNECTING;\n } else {\n const {participant} = this;\n if(!participant.pFlags.can_self_unmute) {\n return GROUP_CALL_STATE.MUTED_BY_ADMIN;\n } else if(participant.pFlags.muted) {\n return GROUP_CALL_STATE.MUTED;\n } else {\n return GROUP_CALL_STATE.UNMUTED;\n }\n }\n }\n\n get participants() {\n return this.managers.appGroupCallsManager.getCachedParticipants(this.id);\n }\n\n get isSharingScreen() {\n return !!this.connections.presentation;\n }\n\n get pinnedSource() {\n return this.pinnedSources[this.pinnedSources.length - 1];\n }\n\n public get isMuted() {\n return this.state !== GROUP_CALL_STATE.UNMUTED;\n }\n\n public get isClosing() {\n const {state} = this;\n return state === GROUP_CALL_STATE.CLOSED;\n }\n\n public get streamManager(): StreamManager {\n return this.connections.main.streamManager;\n }\n\n public get description(): localConferenceDescription {\n return this.connections.main.description;\n }\n\n public pinSource(source: GroupCallOutputSource) {\n indexOfAndSplice(this.pinnedSources, source);\n this.pinnedSources.push(source);\n this.dispatchPinnedThrottled();\n }\n\n public unpinSource(source: GroupCallOutputSource) {\n this.hadAutoPinnedSources.delete(source);\n indexOfAndSplice(this.pinnedSources, source);\n this.dispatchPinnedThrottled();\n }\n\n public unpinAll() {\n this.pinnedSources.length = 0;\n this.dispatchPinnedThrottled();\n }\n\n public async getParticipantByPeerId(peerId: PeerId) {\n return NULL_PEER_ID === peerId ? this.participant : (await this.participants).get(peerId);\n }\n\n public toggleMuted() {\n return this.requestAudioSource(true).then(() => this.changeUserMuted(NULL_PEER_ID));\n }\n\n public async changeUserMuted(peerId: PeerId, muted?: boolean) {\n const participant = await this.getParticipantByPeerId(peerId);\n if(NULL_PEER_ID === peerId && participant.pFlags.can_self_unmute) {\n muted = muted === undefined ? !participant.pFlags.muted : muted;\n }\n\n return this.editParticipant(participant, {muted});\n }\n\n public getElement(endpoint: GroupCallOutputSource) {\n return super.getElement(endpoint);\n }\n\n public getVideoElementFromParticipantByType(participant: GroupCallParticipant, type: 'video' | 'presentation') {\n let source: GroupCallOutputSource;\n if(participant.pFlags.self) {\n const connectionType: GroupCallConnectionType = type === 'video' ? 'main' : 'presentation';\n source = connectionType;\n } else {\n const codec = participant[type];\n source = codec.source_groups[0].sources[0];\n }\n\n const element = this.getElement(source) as HTMLVideoElement;\n if(!element) return;\n\n const clone = element.cloneNode() as typeof element;\n clone.srcObject = element.srcObject;\n return {video: clone, source};\n }\n\n public createConnectionInstance(options: {\n streamManager: StreamManager,\n type: GroupCallConnectionType,\n options: GroupCallConnectionInstance['options'],\n }) {\n return this.connections[options.type] = new GroupCallConnectionInstance({\n groupCall: this,\n log: this.log.bindPrefix(options.type),\n managers: this.managers,\n ...options\n });\n }\n\n public changeRaiseHand(raise: boolean) {\n return this.editParticipant(this.participant, {raiseHand: raise});\n }\n\n public async startScreenSharingInternal() {\n try {\n const type: GroupCallConnectionType = 'presentation';\n\n const stream = await getScreenStream(getScreenConstraints());\n const streamManager = new StreamManager();\n\n const connectionInstance = this.createConnectionInstance({\n streamManager,\n type,\n options: {\n type\n }\n });\n\n const connection = connectionInstance.createPeerConnection();\n connection.addEventListener('negotiationneeded', () => {\n connectionInstance.negotiate();\n });\n\n stream.getVideoTracks()[0].addEventListener('ended', () => {\n if(this.connections.presentation) { // maybe user has stopped screensharing through browser's ui\n this.stopScreenSharing();\n }\n }, {once: true});\n\n connectionInstance.createDescription();\n connectionInstance.addInputVideoStream(stream);\n } catch(err) {\n this.log.error('start screen sharing error', err);\n }\n }\n\n public startScreenSharing() {\n return this.startScreenSharingPromise ??= this.startScreenSharingInternal().finally(() => {\n this.startScreenSharingPromise = undefined;\n });\n }\n\n public stopScreenSharing() {\n const connectionInstance = this.connections.presentation;\n if(!connectionInstance) {\n return Promise.resolve();\n }\n\n delete this.connections.presentation;\n this.unpinSource('presentation');\n connectionInstance.closeConnectionAndStream(true);\n\n delete this.participant.presentation;\n this.managers.appGroupCallsManager.saveApiParticipant(this.id, this.participant);\n\n return this.managers.appGroupCallsManager.leaveGroupCallPresentation(this.id);\n }\n\n public toggleScreenSharing() {\n if(this.isSharingScreen) {\n return this.stopScreenSharing();\n } else {\n return this.startScreenSharing();\n }\n }\n\n public async startVideoSharingInternal() {\n const constraints: MediaStreamConstraints = {\n video: getVideoConstraints()\n };\n\n try {\n const stream = await getStream(constraints, false);\n const connectionInstance = this.connections.main;\n connectionInstance.addInputVideoStream(stream);\n\n await this.editParticipant(this.participant, {\n videoPaused: false,\n videoStopped: false\n });\n } catch(err) {\n this.log.error('startVideoSharing error', err, constraints);\n }\n }\n\n public startVideoSharing() {\n return this.startVideoSharingPromise ??= this.startVideoSharingInternal().finally(() => {\n this.startVideoSharingPromise = undefined;\n });\n }\n\n public async stopVideoSharing() {\n const connectionInstance = this.connections.main;\n const track = connectionInstance.streamManager.inputStream.getVideoTracks()[0];\n if(!track) {\n return;\n }\n\n stopTrack(track);\n connectionInstance.streamManager.appendToConference(connectionInstance.description); // clear sender track\n\n await this.editParticipant(this.participant, {\n videoStopped: true\n });\n }\n\n public toggleVideoSharing() {\n if(this.isSharingVideo) {\n return this.stopVideoSharing();\n } else {\n return this.startVideoSharing();\n }\n }\n\n public async hangUp(discard = false, rejoin = false, isDiscarded = false) {\n for(const type in this.connections) {\n const connection = this.connections[type as GroupCallConnectionType];\n connection.closeConnectionAndStream(!rejoin);\n }\n\n this.dispatchEvent('state', this.state);\n\n if(isDiscarded) {\n return;\n }\n\n if(!rejoin) {\n const d = discard || (this.joined ? this.connections.main.sources.audio.source : undefined);\n this.managers.appGroupCallsManager.hangUp(this.id, d);\n }\n }\n\n public tryAddTrack(options: Omit) {\n const {description} = this;\n const source = super.tryAddTrack(options);\n\n if(options.type === 'output') {\n const entry = description.getEntryBySource(+source);\n this.getParticipantByPeerId(entry.peerId).then((participant) => {\n if(participant) {\n rootScope.dispatchEvent('group_call_participant', {groupCallId: this.id, participant});\n }\n });\n }\n\n return source;\n }\n\n public async editParticipant(participant: GroupCallParticipant, options: Partial<{\n muted: boolean,\n volume: number,\n raiseHand: boolean,\n videoStopped: boolean,\n videoPaused: boolean,\n presentationPaused: boolean\n }>) {\n if(!Object.keys(options).length) {\n return;\n }\n\n // let processUpdate = true;\n if(participant) {\n // const {currentGroupCall} = this;\n // const isCurrentCall = currentGroupCall?.id === groupCallId;\n const isCurrentCall = true;\n const isUpdatingMeInCurrentCall = isCurrentCall && participant.pFlags.self;\n\n if(isUpdatingMeInCurrentCall) {\n if(options.muted !== undefined && !this.isSharingAudio) {\n delete options.muted;\n\n if(!Object.keys(options).length) {\n return;\n }\n }\n }\n\n // if(isCurrentCall) {\n const muted = options.muted;\n if(muted !== undefined) {\n /* const isAdmin = appChatsManager.hasRights(currentGroupCall.chatId, 'manage_call');\n if(isAdmin) {\n if(muted) {\n participant.pFlags.muted = true;\n delete participant.pFlags.can_self_unmute;\n } else {\n participant.pFlags.can_self_unmute = true;\n }\n } else */if(participant.pFlags.self) {\n if(muted) {\n participant.pFlags.muted = true;\n } else if(participant.pFlags.can_self_unmute) {\n delete participant.pFlags.muted;\n }\n }/* else {\n if(muted) {\n participant.pFlags.muted_by_you = true;\n } else {\n delete participant.pFlags.muted_by_you;\n }\n } */\n }\n // }\n\n /* const a: [keyof GroupCallParticipant['pFlags'], keyof typeof options][] = [\n ['muted', 'muted']\n ];\n\n a.forEach(([key, optionKey]) => {\n const value = options[optionKey];\n if(value === undefined) {\n return;\n }\n\n if(value) {\n participant.pFlags[key] = true;\n } else {\n delete participant.pFlags[key];\n }\n }); */\n\n if(options.raiseHand !== undefined) {\n if(options.raiseHand) participant.raise_hand_rating = '1';\n else delete participant.raise_hand_rating;\n }\n\n if(isUpdatingMeInCurrentCall) {\n if(options.videoStopped !== undefined) {\n if(options.videoStopped) delete participant.video;\n else participant.video = generateSelfVideo(this.connections.main.sources.video);\n }\n\n if(!participant.pFlags.muted && participant.pFlags.can_self_unmute) {\n this.setMuted(false);\n }\n\n this.dispatchEvent('state', this.state);\n }\n\n // rootScope.dispatchEvent('group_call_participant', {groupCallId, participant});\n\n /* if(participant.pFlags.self) {\n processUpdate = false;\n } */\n }\n\n return this.managers.appGroupCallsManager.editParticipant(this.id, participant, options);\n }\n\n public onParticipantUpdate(participant: GroupCallParticipant, doNotDispatchParticipantUpdate?: PeerId) {\n const connectionInstance = this.connections.main;\n const {connection, description} = connectionInstance;\n\n const peerId = getPeerId(participant.peer);\n const hasLeft = !!participant.pFlags.left;\n const oldSsrcs = this.participantsSsrcs.get(peerId) || [];\n\n if(participant.presentation && !hasLeft) {\n const {source} = makeSsrcFromParticipant(participant, 'video', participant.presentation.source_groups, participant.presentation.endpoint);\n if(!this.hadAutoPinnedSources.has(source)) {\n this.hadAutoPinnedSources.add(source);\n this.pinSource(participant.pFlags.self ? 'presentation' : source);\n }\n }\n\n if(participant.pFlags.self) {\n this.participant = participant;\n\n if(connectionInstance.sources.audio.source !== participant.source) {\n this.hangUp();\n }\n\n let mute = false;\n if(!participant.pFlags.can_self_unmute) {\n this.stopScreenSharing();\n this.stopVideoSharing();\n mute = true;\n } else if(participant.pFlags.muted) {\n mute = true;\n }\n\n if(mute) {\n this.setMuted(true);\n }\n\n if(doNotDispatchParticipantUpdate !== peerId) {\n this.dispatchEvent('state', this.state);\n }\n\n return;\n }\n\n const ssrcs = hasLeft ? [] : makeSsrcsFromParticipant(participant);\n\n if(!hasLeft) {\n this.participantsSsrcs.set(peerId, ssrcs);\n } else {\n this.participantsSsrcs.delete(peerId);\n }\n\n // const TEST_OLD = false;\n\n const modifiedTypes: Set = new Set();\n oldSsrcs.forEach((oldSsrc) => {\n const oldSource = oldSsrc.source;\n const newSsrc = ssrcs.find((ssrc) => ssrc.source === oldSource);\n if(!newSsrc) {\n this.unpinSource(oldSource);\n\n const oldEntry = description.getEntryBySource(oldSource);\n if(oldEntry && oldEntry.direction !== 'inactive') {\n oldEntry.setDirection('inactive');\n modifiedTypes.add(oldEntry.type);\n }\n }\n });\n\n ssrcs.forEach((ssrc) => {\n let entry = description.getEntryBySource(ssrc.source);\n if(entry) {\n if(entry.direction === 'inactive') {\n entry.setDirection(entry.originalDirection);\n modifiedTypes.add(entry.type);\n }\n\n return;\n }\n\n entry = description.createEntry(ssrc.type);\n description.setEntrySource(entry, ssrc.sourceGroups || ssrc.source);\n description.setEntryPeerId(entry, peerId);\n\n // if(TEST_OLD) {\n // description.bundleMids.push(entry.mid);\n // entry.setDirection('recvonly');\n // } else {\n ssrc.type === 'video' && entry.setEndpoint(ssrc.endpoint);\n entry.createTransceiver(connection, {direction: 'recvonly'});\n // }\n\n modifiedTypes.add(entry.type);\n });\n\n /* if(TEST_OLD) {\n this.setRemoteOffer({\n connection,\n description,\n ssrcs\n });\n } else */if(modifiedTypes.size) {\n if(modifiedTypes.has('video')) {\n connectionInstance.updateConstraints = true;\n }\n\n connectionInstance.negotiateThrottled();\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nenum GROUP_CALL_STATE {\n UNMUTED,\n MUTED,\n MUTED_BY_ADMIN,\n CONNECTING,\n CLOSED\n}\n\nexport default GROUP_CALL_STATE;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport AudioAssetPlayer from '../../helpers/audioAssetPlayer';\n\nexport type GroupCallAudioAssetName = 'group_call_connect.mp3' | 'group_call_end.mp3' | 'group_call_start.mp3' | 'voip_onallowtalk.mp3';\n\nlet audioAsset: AudioAssetPlayer;\nexport default function getGroupCallAudioAsset() {\n return audioAsset ??= new AudioAssetPlayer([\n 'group_call_connect.mp3',\n 'group_call_end.mp3',\n 'group_call_start.mp3',\n 'voip_onallowtalk.mp3'\n ]);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport getGroupCallAudioAsset from '../../components/groupCall/getAudioAsset';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport {GroupCallParticipant, GroupCallParticipantVideo, GroupCallParticipantVideoSourceGroup} from '../../layer';\nimport {GroupCallId, GroupCallConnectionType} from '../appManagers/appGroupCallsManager';\nimport {AppManagers} from '../appManagers/managers';\nimport {logger} from '../logger';\nimport rootScope from '../rootScope';\nimport GroupCallInstance from './groupCallInstance';\nimport GROUP_CALL_STATE from './groupCallState';\nimport createMainStreamManager from './helpers/createMainStreamManager';\nimport {generateSsrc} from './localConferenceDescription';\nimport {WebRTCLineType} from './sdpBuilder';\nimport StreamManager from './streamManager';\nimport {Ssrc} from './types';\n\nconst IS_MUTED = true;\n\nexport function makeSsrcsFromParticipant(participant: GroupCallParticipant) {\n return [\n makeSsrcFromParticipant(participant, 'audio', participant.source),\n participant.video?.audio_source && makeSsrcFromParticipant(participant, 'audio', participant.video.audio_source),\n participant.video && makeSsrcFromParticipant(participant, 'video', participant.video.source_groups, participant.video.endpoint),\n participant.presentation?.audio_source && makeSsrcFromParticipant(participant, 'audio', participant.presentation.audio_source),\n participant.presentation && makeSsrcFromParticipant(participant, 'video', participant.presentation.source_groups, participant.presentation.endpoint)\n ].filter(Boolean);\n};\n\nexport function makeSsrcFromParticipant(participant: GroupCallParticipant, type: WebRTCLineType, source?: number | GroupCallParticipantVideoSourceGroup[], endpoint?: string): Ssrc {\n return generateSsrc(type, source, endpoint);\n}\n\nexport function generateSelfVideo(source: Ssrc, audioSource?: number): GroupCallParticipantVideo {\n return source && {\n _: 'groupCallParticipantVideo',\n pFlags: {},\n endpoint: '',\n source_groups: source.sourceGroups,\n audio_source: audioSource\n };\n}\n\nexport class GroupCallsController extends EventListenerBase<{\n instance: (instance: GroupCallInstance) => void\n}> {\n private audioAsset: ReturnType;\n private log: ReturnType;\n private currentGroupCall: GroupCallInstance;\n private managers: AppManagers;\n\n public construct(managers: AppManagers) {\n this.managers = managers;\n this.audioAsset = getGroupCallAudioAsset();\n this.log = logger('GCC');\n\n rootScope.addEventListener('group_call_update', (groupCall) => {\n const {currentGroupCall} = this;\n if(currentGroupCall?.id === groupCall.id) {\n currentGroupCall.groupCall = groupCall;\n\n if(groupCall._ === 'groupCallDiscarded') {\n currentGroupCall.hangUp(false, false, true);\n }\n }\n });\n\n rootScope.addEventListener('group_call_participant', ({groupCallId, participant}) => {\n const {currentGroupCall} = this;\n if(currentGroupCall?.id === groupCallId) {\n currentGroupCall.onParticipantUpdate(participant/* , this.doNotDispatchParticipantUpdate */);\n }\n });\n }\n\n get groupCall() {\n return this.currentGroupCall;\n }\n\n public setCurrentGroupCall(groupCall: GroupCallInstance) {\n this.currentGroupCall = groupCall;\n\n if(groupCall) {\n this.dispatchEvent('instance', groupCall);\n }\n }\n\n public startConnectingSound() {\n this.stopConnectingSound();\n this.audioAsset.playSoundWithTimeout('group_call_connect.mp3', true, 2500);\n }\n\n public stopConnectingSound() {\n this.audioAsset.stopSound();\n this.audioAsset.cancelDelayedPlay();\n }\n\n public async joinGroupCall(chatId: ChatId, groupCallId: GroupCallId, muted = IS_MUTED, rejoin?: boolean, joinVideo?: boolean) {\n this.audioAsset.createAudio();\n\n this.log(`joinGroupCall chatId=${chatId} id=${groupCallId} muted=${muted} rejoin=${rejoin}`);\n\n let streamManager: StreamManager;\n if(rejoin) {\n streamManager = this.currentGroupCall.connections.main.streamManager;\n } else {\n streamManager = await createMainStreamManager(muted, joinVideo);\n }\n\n return this.joinGroupCallInternal(chatId, groupCallId, streamManager, muted, rejoin, joinVideo)\n .then(() => {\n // have to refresh participants because of the new connection\n const {currentGroupCall} = this;\n currentGroupCall.participants.then((participants) => {\n if(this.currentGroupCall !== currentGroupCall || currentGroupCall.state === GROUP_CALL_STATE.CLOSED) {\n return;\n }\n\n participants.forEach((participant) => {\n if(!participant.pFlags.self) {\n currentGroupCall.onParticipantUpdate(participant);\n }\n });\n });\n });\n }\n\n private async joinGroupCallInternal(chatId: ChatId, groupCallId: GroupCallId, streamManager: StreamManager, muted: boolean, rejoin = false, joinVideo?: boolean) {\n const log = this.log.bindPrefix('joinGroupCallInternal');\n log('start', groupCallId);\n\n const type: GroupCallConnectionType = 'main';\n\n let {currentGroupCall} = this;\n if(currentGroupCall && rejoin) {\n // currentGroupCall.connections.main.connection = connection;\n currentGroupCall.handleUpdateGroupCallParticipants = false;\n currentGroupCall.updatingSdp = false;\n log('update currentGroupCall', groupCallId, currentGroupCall);\n } else {\n currentGroupCall = new GroupCallInstance({\n chatId,\n id: groupCallId,\n managers: this.managers\n });\n\n currentGroupCall.fixSafariAudio();\n\n currentGroupCall.addEventListener('state', (state) => {\n if(this.currentGroupCall === currentGroupCall && state === GROUP_CALL_STATE.CLOSED) {\n this.setCurrentGroupCall(null);\n this.stopConnectingSound();\n this.audioAsset.playSound('group_call_end.mp3');\n rootScope.dispatchEvent('chat_update', currentGroupCall.chatId);\n }\n });\n\n currentGroupCall.groupCall = await this.managers.appGroupCallsManager.getGroupCallFull(groupCallId);\n\n const connectionInstance = currentGroupCall.createConnectionInstance({\n streamManager,\n type,\n options: {\n type,\n isMuted: muted,\n joinVideo,\n rejoin\n }\n });\n\n const connection = connectionInstance.createPeerConnection();\n connection.addEventListener('negotiationneeded', () => {\n connectionInstance.negotiate();\n });\n\n connection.addEventListener('track', (event) => {\n log('ontrack', event);\n currentGroupCall.onTrack(event);\n });\n\n connection.addEventListener('iceconnectionstatechange', () => {\n currentGroupCall.dispatchEvent('state', currentGroupCall.state);\n\n const {iceConnectionState} = connection;\n if(iceConnectionState === 'disconnected' || iceConnectionState === 'checking' || iceConnectionState === 'new') {\n this.startConnectingSound();\n } else {\n this.stopConnectingSound();\n }\n\n switch(iceConnectionState) {\n case 'checking': {\n break;\n }\n\n case 'closed': {\n currentGroupCall.hangUp();\n break;\n }\n\n case 'completed': {\n break;\n }\n\n case 'connected': {\n if(!currentGroupCall.joined) {\n currentGroupCall.joined = true;\n this.audioAsset.playSound('group_call_start.mp3');\n this.managers.appGroupCallsManager.getGroupCallParticipants(groupCallId);\n }\n\n break;\n }\n\n case 'disconnected': {\n break;\n }\n\n case 'failed': {\n // TODO: replace with ICE restart\n currentGroupCall.hangUp();\n // connection.restartIce();\n break;\n }\n\n case 'new': {\n break;\n }\n }\n });\n\n connectionInstance.createDescription();\n connectionInstance.createDataChannel();\n\n connectionInstance.appendStreamToConference();\n\n this.setCurrentGroupCall(currentGroupCall);\n log('set currentGroupCall', groupCallId, currentGroupCall);\n\n this.startConnectingSound();\n\n return connectionInstance.negotiate();\n }\n }\n}\n\nconst groupCallsController = new GroupCallsController();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.groupCallController = groupCallsController);\nexport default groupCallsController;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {GROUP_CALL_AMPLITUDE_ANALYSE_INTERVAL_MS} from '../constants';\nimport StreamManager from '../streamManager';\nimport getAudioConstraints from './getAudioConstraints';\nimport getStream from './getStream';\nimport getVideoConstraints from './getVideoConstraints';\n\nexport default async function createMainStreamManager(muted?: boolean, joinVideo?: boolean) {\n const constraints: MediaStreamConstraints = {\n audio: getAudioConstraints(),\n video: joinVideo && getVideoConstraints()\n };\n\n const streamManager = new StreamManager(GROUP_CALL_AMPLITUDE_ANALYSE_INTERVAL_MS);\n\n try {\n const stream = await getStream(constraints, muted);\n streamManager.addStream(stream, 'input');\n } catch(err) {\n console.error('joinGroupCall getStream error', err, constraints);\n streamManager.inputStream = new MediaStream();\n }\n\n return streamManager;\n}\n","import constraintSupported, {MyMediaTrackSupportedConstraints} from '../../../environment/constraintSupport';\n\nexport default function getAudioConstraints(): MediaTrackConstraints {\n const constraints: MediaTrackConstraints = {\n channelCount: 2\n };\n\n const desirable: (keyof MyMediaTrackSupportedConstraints)[] = [\n 'noiseSuppression',\n 'echoCancellation',\n 'autoGainControl'\n ];\n\n desirable.forEach((constraint) => {\n if(constraintSupported(constraint)) {\n // @ts-ignore\n constraints[constraint] = true;\n }\n });\n\n return constraints;\n}\n","export type MyMediaTrackSupportedConstraints = MediaTrackSupportedConstraints & {\n noiseSuppression?: boolean,\n autoGainControl?: boolean\n};\n\nexport default function constraintSupported(constraint: keyof MyMediaTrackSupportedConstraints) {\n return (!!navigator?.mediaDevices?.getSupportedConstraints() as any as MyMediaTrackSupportedConstraints)[constraint];\n}\n","export default function getScreenConstraints(skipAudio?: boolean) {\n const constraints: DisplayMediaStreamOptions = {\n video: {\n // @ts-ignore\n // cursor: 'always',\n width: {max: 1920},\n height: {max: 1080},\n frameRate: {max: 30}\n }\n };\n\n if(!skipAudio) {\n constraints.audio = true;\n }\n\n return constraints;\n}\n","export default async function getScreenStream(constraints: DisplayMediaStreamOptions) {\n const screenStream = await navigator.mediaDevices.getDisplayMedia(constraints);\n const track = screenStream.getVideoTracks()[0];\n track.contentHint = 'text';\n return screenStream;\n}\n","export default async function getStream(constraints: MediaStreamConstraints, muted: boolean) {\n // console.log('getStream', constraints);\n\n const stream = await navigator.mediaDevices.getUserMedia(constraints);\n stream.getTracks().forEach((x) => {\n x.enabled = !muted;\n });\n\n // console.log('getStream result', stream);\n return stream;\n}\n\n(window as any).getStream = getStream;\n","export default function getVideoConstraints(): MediaTrackConstraints {\n return {\n width: {min: 1280, max: 1920/* , ideal: 1920 */},\n height: {min: 720, max: 1080/* , ideal: 1080 */},\n frameRate: {min: 24, max: 30}\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport SDP from '../sdp';\nimport SDPMediaSection from '../sdp/mediaSection';\nimport {toTelegramSource} from '../utils';\nimport {parseSourceGroups} from './parseSourceGroups';\n\nexport default function parseMediaSectionInfo(sdp: SDP, channel: SDPMediaSection) {\n const clientInfo = channel.lookupAttributeKeys({\n 'ice-ufrag': true,\n 'ice-pwd': true,\n 'fingerprint': true,\n 'setup': true,\n 'ssrc': true,\n 'mid': true,\n 'ssrc-group': false\n });\n\n if(!clientInfo.fingerprint) { // support Firefox\n const line = sdp.session.lines.find((line) => line.parsed?.key === 'fingerprint');\n clientInfo.fingerprint = line.parsed.value;\n }\n\n const telegramSourceGroups = parseSourceGroups(clientInfo['ssrc-group']);\n const [hash, fingerprint] = clientInfo.fingerprint.split(' ', 2);\n const ssrc = clientInfo.ssrc && toTelegramSource(+clientInfo.ssrc.split(' ', 1)[0]);\n // ssrc = telegramSourceGroups ? telegramSourceGroups[0].sources[0] : ssrc;\n\n return {\n raw: clientInfo,\n ufrag: clientInfo['ice-ufrag'],\n pwd: clientInfo['ice-pwd'],\n fingerprint: {\n fingerprint,\n setup: clientInfo.setup,\n hash\n },\n source: ssrc,\n sourceGroups: telegramSourceGroups,\n mid: clientInfo.mid\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {GroupCallParticipantVideoSourceGroup} from '../../../layer';\nimport {toTelegramSource} from '../utils';\n\nexport function parseSourceGroups(sdpLines: string[]) {\n const telegramSourceGroups = sdpLines.map((str) => {\n const [semantics, ...rest] = str.split(' ');\n\n const sourceGroup: GroupCallParticipantVideoSourceGroup = {\n _: 'groupCallParticipantVideoSourceGroup',\n semantics,\n // sources: rest.map((ssrc) => +ssrc)\n sources: rest.map((ssrc) => toTelegramSource(+ssrc))\n };\n\n return sourceGroup;\n });\n\n /* const simIndex = telegramSourceGroups.findIndex((g) => g.semantics === 'SIM');\n if(simIndex !== -1) {\n const sourceGroup = telegramSourceGroups.splice(simIndex, 1)[0];\n telegramSourceGroups.unshift(sourceGroup);\n } */\n\n return telegramSourceGroups.length ? telegramSourceGroups : undefined;\n}\n","import simulateEvent from '../../../helpers/dom/dispatchEvent';\n\nexport default function stopTrack(track: MediaStreamTrack) {\n track.stop();\n simulateEvent(track, 'ended');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport {GroupCallParticipantVideoSourceGroup} from '../../layer';\nimport {fixMediaLineType, SDPBuilder, WebRTCLineType, WEBRTC_MEDIA_PORT} from './sdpBuilder';\nimport {AudioCodec, GroupCallConnectionTransport, Ssrc, UpdateGroupCallConnectionData, VideoCodec} from './types';\n\nexport class ConferenceEntry {\n public source: number;\n public sourceGroups: GroupCallParticipantVideoSourceGroup[];\n public transceiver: RTCRtpTransceiver;\n public originalDirection: RTCRtpTransceiverDirection;\n public direction: RTCRtpTransceiverDirection;\n public port: string;\n public endpoint: string;\n public peerId: PeerId;\n\n public sendEntry: ConferenceEntry;\n public recvEntry: ConferenceEntry;\n\n constructor(public mid: string, public type: WebRTCLineType) {\n this.port = WEBRTC_MEDIA_PORT;\n }\n\n public setDirection(direction: RTCRtpTransceiverDirection) {\n if(!this.originalDirection) {\n this.originalDirection = direction;\n }\n\n return this.direction = direction;\n }\n\n public setPort(port: string) {\n return this.port = port;\n }\n\n public setEndpoint(endpoint: string) {\n return this.endpoint = endpoint;\n }\n\n public setPeerId(peerId: PeerId) {\n return this.peerId = peerId;\n }\n\n public createTransceiver(connection: RTCPeerConnection, init?: RTCRtpTransceiverInit) {\n if(init?.direction) {\n this.setDirection(init.direction);\n }\n\n return this.transceiver = connection.addTransceiver(fixMediaLineType(this.type), init);\n }\n\n public setSource(source: number | GroupCallParticipantVideoSourceGroup[]) {\n let sourceGroups: GroupCallParticipantVideoSourceGroup[];\n if(Array.isArray(source)) {\n if(!source[0]) return;\n sourceGroups = source;\n source = sourceGroups[0].sources[0];\n }\n\n this.sourceGroups = sourceGroups;\n return this.source = source;\n }\n\n public shouldBeSkipped(isAnswer?: boolean) {\n return isAnswer && this.direction === 'inactive';\n }\n}\n\nexport function generateSsrc(type: WebRTCLineType, source: number | GroupCallParticipantVideoSourceGroup[], endpoint?: string): Ssrc {\n let sourceGroups: GroupCallParticipantVideoSourceGroup[];\n if(Array.isArray(source)) {\n if(!source[0]) return;\n sourceGroups = source;\n source = sourceGroups[0].sources[0];\n }\n\n return {\n endpoint,\n type,\n source,\n sourceGroups\n };\n}\n\nexport default class LocalConferenceDescription implements UpdateGroupCallConnectionData {\n public readonly sessionId: string;\n // public ssrcs: Ssrc[];\n public readonly transport: GroupCallConnectionTransport;\n public readonly audio?: AudioCodec;\n public readonly video: VideoCodec;\n public readonly screencast?: VideoCodec;\n\n private maxSeenId: number;\n public readonly entries: ConferenceEntry[];\n private entriesByMid: Map;\n private entriesBySource: Map;\n private entriesByPeerId: Map>;\n\n constructor(public connection: RTCPeerConnection) {\n this.sessionId = '' + Date.now();\n // this.ssrcs = [];\n this.maxSeenId = -1;\n this.entries = [];\n this.entriesByMid = new Map();\n this.entriesBySource = new Map();\n this.entriesByPeerId = new Map();\n }\n\n public setData(data: UpdateGroupCallConnectionData) {\n return safeAssign(this, data);\n }\n\n public createEntry(type: WebRTCLineType) {\n const mid = '' + ++this.maxSeenId;\n const entry = new ConferenceEntry(mid, type);\n this.entries.push(entry);\n this.entriesByMid.set(mid, entry);\n return entry;\n }\n\n public deleteEntry(entry: ConferenceEntry) {\n indexOfAndSplice(this.entries, entry);\n this.entriesByMid.delete(entry.mid);\n this.entriesBySource.delete(entry.source);\n\n const set = this.entriesByPeerId.get(entry.peerId);\n if(set) {\n set.delete(entry);\n if(!set.size) {\n this.entriesByPeerId.delete(entry.peerId);\n }\n }\n }\n\n public setEntrySource(entry: ConferenceEntry, source: Parameters[0]) {\n entry.setSource(source);\n this.entriesBySource.set(entry.source, entry);\n }\n\n public setEntryPeerId(entry: ConferenceEntry, peerId: ConferenceEntry['peerId']) {\n entry.setPeerId(peerId);\n let set = this.entriesByPeerId.get(peerId);\n if(!set) {\n this.entriesByPeerId.set(peerId, set = new Set());\n }\n\n set.add(entry);\n }\n\n public findEntry(verify: Parameters[0]) {\n return this.entries.find(verify);\n }\n\n public findFreeSendRecvEntry(type: WebRTCLineType, isSending: boolean) {\n let entry = this.entries.find((entry) => {\n return entry.direction === 'sendrecv' && entry.type === type && !(isSending ? entry.sendEntry : entry.recvEntry);\n });\n\n if(!entry) {\n entry = this.createEntry(type);\n entry.setDirection('sendrecv');\n }\n\n return entry;\n }\n\n public getEntryByMid(mid: ConferenceEntry['mid']) {\n return this.entriesByMid.get(mid);\n }\n\n public getEntryBySource(source: ConferenceEntry['source']) {\n return this.entriesBySource.get(source);\n }\n\n public getEntriesByPeerId(peerId: ConferenceEntry['peerId']) {\n return this.entriesByPeerId.get(peerId);\n }\n\n public generateSdp(options: Omit[0], 'conference'>) {\n return SDPBuilder.fromConference({\n conference: this,\n ...options\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport SDPMediaSection from './mediaSection';\nimport SDPSessionSection from './sessionSection';\n\nexport type AttributeKey = 'group' | 'rtcp' | 'ice-ufrag' |\n 'ice-pwd' | 'ice-options' | 'fingerprint' | 'setup' |\n 'mid' | 'extmap' | 'sendonly' | 'msid' | 'rtcp-mux' |\n 'rtpmap' | 'rtcp-fb' | 'fmtp' | 'ssrc' | 'ssrc-group' |\n 'extmap-allow-mixed' | 'msid-semantic';\n\nexport type AttributeMap = {[k in AttributeKey]?: boolean};\n\nexport default class SDP {\n #session: SDPSessionSection;\n #media: SDPMediaSection[];\n\n constructor(session: SDP['session'], mediaSections: SDP['media']) {\n this.#session = session;\n this.#media = mediaSections;\n }\n\n public get session() {\n return this.#session;\n }\n\n public get media() {\n return this.#media;\n }\n\n public get bundle() {\n const bundleLine = this.session.lines.find((line) => line.parsed?.key === 'group');\n return bundleLine.value.split(' ').slice(1);\n }\n\n toString() {\n return this.session.lines\n .concat(...this.media.map((section) => section.lines))\n .map((line) => line.toString()).join('\\r\\n') + '\\r\\n';\n }\n\n /* get buggedMedia() {\n const bundle = this.bundle;\n type A = {\n mid: SDPMediaSection['mid'],\n mediaType: SDPMediaSection['mediaType'],\n direction: SDPMediaSection['direction']\n };\n const out: A[] = [];\n for(let i = 0, length = this.media.length; i < length; ++i) {\n const section = this.media[i];\n const mid = section.mid;\n if(!bundle.includes(mid)) {\n out.push(section);\n }\n }\n\n return out;\n } */\n\n /* get mediaTypes() {\n return this.media.map((section) => {\n return {mid: section.oa.get('mid').oa, type: section.mediaType, direction: section.direction};\n });\n } */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function splitStringByLimitWithRest(str: string, separator: string, limit: number) {\n const splitted = str.split(separator);\n const out: string[] = [];\n\n while(limit > 0 && splitted.length) {\n out.push(splitted.shift());\n --limit;\n }\n\n if(splitted.length) {\n out.push(splitted.join(separator));\n }\n\n return out;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default class UniqueNumberGenerator {\n #set: Set;\n #min: number;\n #max: number;\n\n constructor(min: number, max: number) {\n this.#set = new Set();\n this.#min = min;\n this.#max = max;\n }\n\n public generate() {\n const min = this.#min;\n const max = this.#max;\n const set = this.#set;\n\n const maxTries = max - min + 1;\n let value = Math.floor(min + maxTries * Math.random()), _try = 0;\n while(set.has(value)) {\n if(value < max) {\n ++value;\n } else {\n value = min;\n }\n\n if(++_try >= maxTries) {\n return null;\n }\n }\n\n set.add(value);\n return value;\n }\n\n public add(value: number) {\n this.#set.add(value);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AttributeKey} from '.';\n\nexport default class SDPAttributeSplitted {\n #key: AttributeKey;\n #value: string;\n\n // key = 'ssrc-group', value = 'SIM 1 2 3'\n constructor(key: AttributeKey, value: string) {\n this.#key = key;\n this.#value = value;\n }\n\n public get key() {\n return this.#key;\n }\n\n public get value() {\n return this.#value;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default class SDPMediaLineParts {\n #type: 'audio' | 'video' | 'application';\n #port: string;\n #protocol: string;\n #ids: string[];\n\n constructor(\n type: SDPMediaLineParts['type'],\n port: SDPMediaLineParts['port'],\n protocol: SDPMediaLineParts['protocol'],\n ids: SDPMediaLineParts['ids']\n ) {\n this.#type = type;\n this.#port = port;\n this.#protocol = protocol;\n this.#ids = ids;\n }\n\n public get type() {\n return this.#type;\n }\n\n public get port() {\n return this.#port;\n }\n\n public get protocol() {\n return this.#protocol;\n }\n\n public get ids() {\n return this.#ids;\n }\n\n toString() {\n return this.type + ' ' + this.port + ' ' + this.protocol + ' ' + this.ids.join(' ');\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport splitStringByLimitWithRest from '../../../helpers/string/splitStringByLimitWithRest';\nimport SDPAttributeSplitted from './attributeSplitted';\nimport SDPMediaLineParts from './mediaLineParts';\n\nexport default class SDPLine {\n #key: 'm' | 'a' | 'o' | 'v' | 's' | 't' | 'c';\n #value: string;\n #mediaLineParts: SDPMediaLineParts;\n #parsed?: SDPAttributeSplitted;\n\n // key = 'a', value = 'ssrc-group:SIM 1 2 3'\n constructor(key: SDPLine['key'], value: string | SDPMediaLineParts | SDPAttributeSplitted) {\n this.#key = key;\n\n if(typeof(value) === 'string') {\n this.#value = value;\n\n if(key === 'm') {\n const splitted = value.split(' ');\n this.#mediaLineParts = new SDPMediaLineParts(splitted[0] as any, splitted[1], splitted[2], splitted.slice(3));\n } else {\n if(key === 'a') {\n const result = splitStringByLimitWithRest(value, ':', 1);\n value = result[0];\n this.#parsed = result.length === 1 ? new SDPAttributeSplitted(value as any, null) : new SDPAttributeSplitted(value as any, result[1]);\n }\n }\n } else {\n if(value instanceof SDPMediaLineParts) {\n this.#mediaLineParts = value;\n this.#value = value.toString();\n } else if(value instanceof SDPAttributeSplitted) {\n this.#parsed = value;\n this.#value = value.value ? `${value.key}:${value.value}` : value.key;\n }\n }\n }\n\n public get key() {\n return this.#key;\n }\n\n public get value() {\n return this.#value;\n }\n\n public get parsed() {\n return this.#parsed;\n }\n\n public get mediaLineParts() {\n return this.#mediaLineParts;\n }\n\n toString() {\n return `${this.key}=${this.value}`;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport splitStringByLimitWithRest from '../../../helpers/string/splitStringByLimitWithRest';\n\nexport default class SDPAttributeInner {\n #key: string;\n #lines: Array;\n #prefix: string;\n #nestedMap: Map;\n #missed: boolean;\n #keys: Array;\n\n constructor(key: SDPAttributeInner['key'], lines: SDPAttributeInner['lines'], prefix: string = ':', missed = false) {\n this.#key = key;\n this.#lines = lines;\n this.#prefix = prefix;\n this.#missed = missed;\n this.#nestedMap = missed ? new Map() : null;\n this.#keys = missed ? [] : null;\n }\n\n public get lines() {\n return this.#lines;\n }\n\n public get value() {\n return this.#missed || !this.lines.length ? null : this.lines[0];\n }\n\n public get exists() {\n return !this.#missed;\n }\n\n public get key() {\n return this.#key;\n }\n\n public get keys() {\n SDPAttributeInner.fill(this);\n return this.#keys;\n }\n\n public forEach(callback: Parameters['forEach']>[0]) {\n SDPAttributeInner.fill(this);\n this.#nestedMap.forEach(callback);\n }\n\n public get(key: string) {\n SDPAttributeInner.fill(this);\n return this.#nestedMap.get(key) || new SDPAttributeInner(key, [], ':', true);\n }\n\n private static fill(attribute: SDPAttributeInner) {\n if(attribute.#nestedMap !== null) {\n return;\n }\n\n const map: Map> = new Map();\n attribute.lines.forEach((str) => {\n const [key, rest] = splitStringByLimitWithRest(str, attribute.#prefix, 1);\n const values = map.get(key) || [];\n map.set(key, [...values, rest || '']);\n });\n\n const nestedMap = attribute.#nestedMap = SDPAttributeInner.makeAttributes(map);\n attribute.#keys = Array.from(nestedMap.keys());\n }\n\n private static makeAttributes(innerParts: Map>) {\n const out: Map = new Map();\n\n innerParts.forEach((lines, key) => {\n out.set(key, new SDPAttributeInner(key, lines));\n });\n\n return out;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport SDPAttributeInner from './attributeInner';\nimport SDPLine from './line';\n\nexport default class SDPAttributes {\n #lines: SDPLine[];\n #attributes: Map;\n\n constructor(lines: SDPLine[]) {\n this.#lines = lines;\n this.#attributes = new Map();\n SDPAttributes.fillAttributes(this);\n }\n\n public get(key: string) {\n return this.#attributes.get(key) || new SDPAttributeInner(key, [], ' ', true);\n }\n\n private static fillAttributes(attributes: SDPAttributes) {\n const attributesMap: Map> = new Map();\n attributes.#lines.forEach((line) => {\n if(line.key === 'a') {\n const {key, value} = line.parsed;\n\n let linesArray = attributesMap.get(key);\n if(!linesArray) {\n linesArray = [];\n attributesMap.set(key, linesArray);\n }\n\n linesArray.push(value || '');\n }\n });\n\n attributesMap.forEach((linesArray, key) => {\n attributes.#attributes.set(key, new SDPAttributeInner(key, linesArray, ' ', false));\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {AttributeMap} from '.';\nimport {NoExtraProperties} from '../../../types';\nimport SDPAttributes from './attributes';\nimport SDPLine from './line';\n\nexport type SDPMediaDirection = 'sendonly' | 'recvonly' | 'inactive' | 'sendrecv';\nexport default class SDPMediaSection {\n #lines: Array;\n #mediaLine: SDPLine;\n #attributes: SDPAttributes;\n #direction: SDPMediaDirection;\n\n constructor(lines: Array) {\n this.#lines = lines;\n this.#mediaLine = lines[0];\n this.#attributes = this.#direction = null;\n }\n\n public get lines() {\n return this.#lines;\n }\n\n public get mediaLine() {\n return this.#mediaLine;\n }\n\n public get mediaLineParts() {\n return this.#mediaLine.mediaLineParts;\n }\n\n public get mediaType() {\n return this.mediaLineParts.type;\n }\n\n public get direction() {\n if(!this.#direction) {\n const attributes = this.attributes;\n\n let direction: SDPMediaDirection;\n if(attributes.get('sendonly').exists) direction = 'sendonly';\n else if(attributes.get('recvonly').exists) direction = 'recvonly';\n else if(attributes.get('inactive').exists) direction = 'inactive';\n else direction = 'sendrecv';\n\n this.#direction = direction;\n }\n\n return this.#direction;\n }\n\n public get isSending() {\n return this.direction === 'sendrecv' || this.direction === 'sendonly';\n }\n\n public get isReceiving() {\n return this.direction === 'sendrecv' || this.direction === 'recvonly';\n }\n\n public get attributes() {\n this.#attributes || (this.#attributes = new SDPAttributes(this.lines));\n return this.#attributes;\n }\n\n public get mid() {\n return this.attributes.get('mid').value;\n }\n\n public lookupAttributeKeys(keys: NoExtraProperties): {[k in keyof T]: T[k] extends true ? string : string[]} {\n const out: any = {};\n\n for(const key in keys) {\n const result = this.attributes.get(key);\n // @ts-ignore\n const resultShouldBeArray = !keys[key];\n if(!result) {\n out[key] = resultShouldBeArray ? [] : undefined;\n } else {\n out[key] = resultShouldBeArray ? result.lines : result.value;\n }\n }\n\n return out;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport SDPLine from './line';\n\nexport default class SDPSessionSection {\n #lines: SDPLine[];\n #sessionId: string;\n\n constructor(lines: SDPLine[]) {\n this.#lines = lines;\n this.#sessionId = lines.filter((line) => line.key === 'o').map((line) => line.value.split(' ')[1])[0];\n }\n\n public get lines() {\n return this.#lines;\n }\n\n public get sessionId() {\n return this.#sessionId;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport SDP from '.';\nimport splitStringByLimitWithRest from '../../../helpers/string/splitStringByLimitWithRest';\nimport UniqueNumberGenerator from '../../../helpers/uniqueNumberGenerator';\nimport SDPLine from './line';\nimport SDPMediaSection from './mediaSection';\nimport SDPSessionSection from './sessionSection';\n\nexport function parseSdp(str: string) {\n function createSection() {\n if(sessionSection) {\n mediaSections.push(new SDPMediaSection(lines));\n } else {\n sessionSection = new SDPSessionSection(lines);\n }\n }\n\n let sessionSection: SDPSessionSection = null, lines: SDPLine[] = [];\n const mediaSections: SDPMediaSection[] = [];\n str.split(/\\r?\\n/).forEach((lineStr) => {\n if(!isIncorrectSdpLine(lineStr)) {\n const line = parseSdpLine(lineStr);\n if(line.key === 'm') {\n createSection();\n lines = [];\n }\n\n lines.push(line);\n }\n });\n\n createSection();\n return new SDP(sessionSection, mediaSections);\n}\n\nexport function isIncorrectSdpLine(str: string) {\n return /^[\\s\\xa0]*$/.test(str);\n}\n\nexport function parseSdpLine(str: string) {\n const splitted = splitStringByLimitWithRest(str, '=', 1);\n return new SDPLine(splitted[0] as any, splitted[1]);\n}\n\nexport function addSimulcast(sdp: SDP) {\n let generator: UniqueNumberGenerator;\n sdp.media.forEach((section, idx) => {\n if(section.mediaType === 'video' && section.isSending && !section.attributes.get('ssrc-group').get('SIM').exists) {\n if(!generator) {\n generator = new UniqueNumberGenerator(2, 4294967295);\n }\n\n const originalSsrcs = section.attributes.get('ssrc-group').get('FID').value.split(' ');\n const lines = section.lines;\n originalSsrcs.forEach((ssrc) => generator.add(+ssrc)); // fix possible duplicates\n const ssrcs = [originalSsrcs[0], generator.generate(), generator.generate()];\n const ssrcs2 = [originalSsrcs[1], generator.generate(), generator.generate()];\n\n lines.push(parseSdpLine('a=ssrc-group:SIM ' + ssrcs.join(' ')));\n\n const ssrcsStrLines = section.attributes.get('ssrc').get(originalSsrcs[0]).lines;\n\n ssrcs.forEach((ssrc, idx) => {\n const ssrc2 = ssrcs2[idx];\n if(idx > 0) {\n lines.push(parseSdpLine('a=ssrc-group:FID ' + ssrc + ' ' + ssrc2));\n\n ssrcsStrLines.forEach((v) => {\n lines.push(parseSdpLine('a=ssrc:' + ssrc + ' ' + v));\n });\n\n ssrcsStrLines.forEach((v) => {\n lines.push(parseSdpLine('a=ssrc:' + ssrc2 + ' ' + v));\n });\n }\n });\n\n sdp.media[idx] = new SDPMediaSection(lines);\n }\n });\n\n return !!generator;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport {IS_FIREFOX} from '../../environment/userAgent';\nimport LocalConferenceDescription, {ConferenceEntry} from './localConferenceDescription';\nimport StringFromLineBuilder from './stringFromLineBuilder';\nimport {GroupCallConnectionTransport, PayloadType, UpdateGroupCallConnectionData} from './types';\nimport {fromTelegramSource} from './utils';\n\n// screencast is for Peer-to-Peer only\nexport type WebRTCLineTypeTrue = 'video' | 'audio' | 'application';\nexport type WebRTCLineType = WebRTCLineTypeTrue | 'screencast';\n\nexport const WEBRTC_MEDIA_PORT = '9';\n\nexport function fixMediaLineType(mediaType: WebRTCLineType) {\n return mediaType === 'screencast' ? 'video' : mediaType;\n}\n\nexport function performCandidate(c: GroupCallConnectionTransport['candidates'][0]) {\n const arr: string[] = [];\n arr.push('a=candidate:');\n arr.push(`${c.foundation} ${c.component} ${c.protocol.toUpperCase()} ${c.priority} ${c.ip} ${c.port} typ ${c.type}`);\n if(c['rel-addr'] !== undefined) {\n arr.push(` raddr ${c['rel-addr']} rport ${c['rel-port']}`);\n }\n arr.push(` generation ${c.generation}`);\n return arr.join('');\n}\n\nexport function getConnectionTypeForMediaType(mediaType: WebRTCLineType) {\n // return mediaType === 'application' ? 'DTLS/SCTP' : 'RTP/SAVPF';\n return mediaType === 'application' ? 'DTLS/SCTP' : 'UDP/TLS/RTP/SAVPF';\n}\n\nexport function generateMediaFirstLine(mediaType: WebRTCLineType, port = WEBRTC_MEDIA_PORT, payloadIds: (string | number)[]) {\n const connectionType = getConnectionTypeForMediaType(mediaType);\n return `m=${fixMediaLineType(mediaType)} ${port} ${connectionType} ${payloadIds.join(' ')}`;\n}\n\ntype ConferenceData = UpdateGroupCallConnectionData | LocalConferenceDescription;\n\n// https://tools.ietf.org/id/draft-ietf-rtcweb-sdp-08.html\n// https://datatracker.ietf.org/doc/html/draft-roach-mmusic-unified-plan-00\nexport class SDPBuilder extends StringFromLineBuilder {\n public addCandidate(c: GroupCallConnectionTransport['candidates'][0]) {\n return this.add(performCandidate(c));\n }\n\n /* public addDataChannel(mid: string, transport: GroupCallConnectionTransport, isAnswer?: boolean) {\n this.add(\n 'm=application 9 UDP/DTLS/SCTP webrtc-datachannel',\n 'c=IN IP4 0.0.0.0',\n 'a=ice-options:trickle',\n `a=mid:${mid}`\n );\n\n // if(!isAnswer) {\n this.add('a=sendrecv');\n // }\n\n this.addTransport(transport, isAnswer);\n\n return this.add(\n 'a=sctp-port:5000',\n 'a=max-message-size:262144'\n );\n } */\n\n public addHeader(sId: string, bundleMids: string[]) {\n const bundle = bundleMids.join(' ');\n return this.add(\n 'v=0', // version\n `o=- ${sId} 2 IN IP4 0.0.0.0`, // sessionId, 2=sessionVersion\n 's=-', // name of the session\n 't=0 0', // time when session is valid\n 'a=extmap-allow-mixed',\n `a=group:BUNDLE ${bundle}`,\n 'a=ice-options:trickle',\n // 'a=ice-lite', // ice-lite: is a minimal version of the ICE specification, intended for servers running on a public IP address.\n 'a=msid-semantic:WMS *'\n );\n }\n\n public addTransport(transport: GroupCallConnectionTransport, skipCandidates?: boolean) {\n this.add(\n `a=ice-ufrag:${transport.ufrag}`,\n `a=ice-pwd:${transport.pwd}`,\n 'a=ice-options:trickle' // ! test\n );\n\n for(const fingerprint of transport.fingerprints) {\n this.add(\n `a=fingerprint:${fingerprint.hash} ${fingerprint.fingerprint}`,\n `a=setup:${fingerprint.setup}`\n );\n }\n\n if(!skipCandidates && transport.candidates) {\n for(const candidate of transport.candidates) {\n this.addCandidate(candidate);\n }\n }\n\n return this;\n }\n\n public addSsrc(entry: ConferenceEntry) {\n let streamName = 'stream';\n let {type, sourceGroups} = entry;\n\n // let source = ssrc.source ?? ssrc.sourceGroups[0].sources[0];\n // source = fromTelegramSource(source);\n const source = fromTelegramSource(entry.source);\n\n streamName += source;\n type += source as any;\n\n // streamName += mid;\n // type += mid as any;\n\n // streamName = type = entry.transceiver.receiver.track.id as any;\n\n const addMsid = () => {\n this.add(`a=msid:${streamName} ${type}`);\n };\n\n const addSource = (ssrc: number) => {\n this.add(\n `a=ssrc:${ssrc} cname:${streamName}`,\n `a=ssrc:${ssrc} msid:${streamName} ${type}`,\n `a=ssrc:${ssrc} mslabel:${streamName}`,\n `a=ssrc:${ssrc} label:${type}`\n );\n };\n\n addMsid();\n if(sourceGroups?.length) {\n sourceGroups.forEach((ssrcGroup) => {\n if(ssrcGroup.sources.length) {\n const sources = ssrcGroup.sources.map(fromTelegramSource);\n this.add(`a=ssrc-group:${ssrcGroup.semantics} ${sources.join(' ')}`);\n sources.forEach(addSource);\n }\n });\n } else {\n addSource(source);\n }\n\n return this;\n }\n\n public addSsrcEntry(entry: ConferenceEntry, data: ConferenceData, isAnswer?: boolean) {\n const add = (...x: string[]) => this.add(...x);\n\n const {type, mid, direction, port} = entry;\n const transport = data.transport;\n\n /* if(type === 'application') {\n return this.addDataChannel(mid, transport, isAnswer);\n } */\n\n const isApplication = type === 'application';\n const codec = isApplication ? undefined : data[type];\n\n const isInactive = direction === 'inactive';\n if(entry.shouldBeSkipped(isAnswer)) {\n return add(\n `m=${fixMediaLineType(type)} 0 ${getConnectionTypeForMediaType(type)} 0`,\n `c=IN IP4 0.0.0.0`,\n `a=inactive`,\n `a=mid:${mid}`\n );\n }\n\n const payloadTypes = !isApplication ? codec['payload-types'] : [{id: 5000} as PayloadType];\n const ids = payloadTypes.map((type) => type.id);\n add(\n generateMediaFirstLine(type, port, ids),\n 'c=IN IP4 0.0.0.0',\n `a=rtcp:${port} IN IP4 0.0.0.0`\n );\n\n if(transport['rtcp-mux']) {\n add('a=rtcp-mux');\n }\n\n add(`a=mid:${mid}`);\n /* if(type === 'video') {\n add('b=AS:2500');\n } */\n\n let setDirection = direction;\n if(direction !== 'sendrecv' && isAnswer && !(isInactive || isApplication)) {\n setDirection = direction === 'sendonly' ? 'recvonly' : 'sendonly';\n }\n\n // a=bundle-only\n add(`a=${setDirection}`);\n\n // this.addTransport(transport, isAnswer);\n this.addTransport(transport);\n\n if(!isApplication) {\n const hdrexts = codec['rtp-hdrexts'];\n if(hdrexts?.length) {\n hdrexts.forEach((hdrext) => {\n add(`a=extmap:${hdrext.id} ${hdrext.uri}`);\n });\n }\n\n payloadTypes.forEach((type) => {\n add(`a=rtpmap:${type.id} ${type.name}/${type.clockrate}${type.channels && type.channels > 1 ? `/${type.channels}` : ''}`);\n\n const parameters = type.parameters;\n if(Array.isArray(parameters)) {\n if(parameters.length) {\n console.error('parameters is array???', parameters);\n }\n } else if(parameters && Object.keys(parameters).length) {\n const p: string[] = [];\n for(const i in parameters) {\n p.push(`${i}=${parameters[i]}`);\n }\n add(`a=fmtp:${type.id} ${p.join(';')}`);\n }\n\n const fbs = type['rtcp-fbs'];\n if(fbs?.length) {\n fbs.forEach((fb) => {\n add(`a=rtcp-fb:${type.id} ${fb.type}${fb.subtype ? ' ' + fb.subtype : ''}`);\n });\n }\n });\n } else {\n add(`a=sctpmap:${payloadTypes[0].id} webrtc-datachannel 256`);\n }\n\n if(entry.source && (setDirection === 'sendonly' || setDirection === 'sendrecv')) {\n this.addSsrc(entry);\n }\n\n return this;\n }\n\n public addConference(options: {\n conference: LocalConferenceDescription,\n bundle: string[],\n entries: ConferenceEntry[],\n isAnswer?: boolean,\n }) {\n const {conference, entries, bundle, isAnswer} = options;\n this.addHeader(conference.sessionId, bundle);\n\n if(IS_FIREFOX) {\n this.addTransport(conference.transport); // support Firefox\n }\n\n for(const entry of entries) {\n // this.addSsrcEntry(entry, conference, isAnswer);\n this.addSsrcEntry((isAnswer ? entry.recvEntry || entry.sendEntry : entry.sendEntry || entry.recvEntry) || entry, conference, isAnswer);\n }\n\n return this;\n }\n\n public static fromConference(options: Parameters[0]) {\n return new SDPBuilder().addConference(options).finalize();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport {logger} from '../logger';\nimport rootScope from '../rootScope';\nimport {GROUP_CALL_AMPLITUDE_ANALYSE_COUNT_MAX} from './constants';\nimport stopTrack from './helpers/stopTrack';\nimport LocalConferenceDescription from './localConferenceDescription';\nimport {fixMediaLineType, WebRTCLineType} from './sdpBuilder';\nimport {getAmplitude, toTelegramSource} from './utils';\n\nexport type StreamItemBase = {\n type: 'input' | 'output',\n track: MediaStreamTrack,\n source: string,\n stream: MediaStream\n};\n\nexport type StreamItem = StreamAudioItem | StreamVideoItem;\n\nexport type StreamAudioItem = StreamItemBase & {kind: 'audio', streamAnalyser: AudioStreamAnalyser};\nexport type StreamVideoItem = StreamItemBase & {kind: 'video'};\n\nexport type StreamAmplitude = {\n type: 'input' | 'output';\n source: string;\n stream: MediaStream;\n track: MediaStreamTrack;\n value: number;\n};\n\nclass AudioStreamAnalyser {\n public analyser: AnalyserNode;\n public gain: GainNode;\n public streamSource: MediaStreamAudioSourceNode;\n\n constructor(context: AudioContext, stream: MediaStream) {\n const streamSource = this.streamSource = context.createMediaStreamSource(stream);\n const analyser = this.analyser = context.createAnalyser();\n const gain = this.gain = context.createGain();\n // const streamDestination = context.createMediaStreamDestination();\n\n analyser.minDecibels = -100;\n analyser.maxDecibels = -30;\n analyser.smoothingTimeConstant = 0.05;\n analyser.fftSize = 1024;\n\n // connect Web Audio API\n streamSource.connect(analyser);\n // analyser.connect(context.destination);\n }\n}\n\nexport default class StreamManager {\n public static ANALYSER_LISTENER = new EventListenerBase<{amplitude: (details: {amplitudes: StreamAmplitude[], type: 'all' | 'input'}) => void}>();\n private context: AudioContext;\n public outputStream: MediaStream;\n public inputStream: MediaStream;\n\n private timer: number;\n private counter: number;\n\n private items: StreamItem[];\n\n private log: ReturnType;\n\n public direction: RTCRtpTransceiver['direction'];\n public canCreateConferenceEntry: boolean;\n public locked: boolean;\n public types: WebRTCLineType[];\n\n constructor(private interval?: number) {\n this.context = new (window.AudioContext || (window as any).webkitAudioContext)();\n this.items = [];\n this.outputStream = new MediaStream();\n this.inputStream = new MediaStream();\n this.counter = 0;\n this.log = logger('SM');\n this.direction = 'sendonly';\n this.canCreateConferenceEntry = true;\n // this.lol = true;\n this.types = ['audio', 'video'];\n }\n\n public addStream(stream: MediaStream, type: StreamItem['type']) {\n stream.getTracks().forEach((track) => {\n this.addTrack(stream, track, type);\n });\n }\n\n public addTrack(stream: MediaStream, track: MediaStreamTrack, type: StreamItem['type']) {\n this.log('addTrack', type, track, stream);\n\n const {context, items, inputStream, outputStream} = this;\n const kind: StreamItem['kind'] = track.kind as any;\n const source = StreamManager.getSource(stream, type);\n\n // this.removeTrack(track);\n switch(type) {\n case 'input': {\n if(!inputStream) {\n this.inputStream = stream;\n } else {\n inputStream.addTrack(track);\n }\n\n break;\n }\n\n case 'output': {\n for(let i = 0; i < items.length; ++i) {\n const {track: t, type, source: itemSource} = items[i];\n if(itemSource === source && type === 'input') {\n items.splice(i, 1);\n outputStream.removeTrack(t);\n break;\n }\n }\n\n if(kind !== 'video') {\n outputStream.addTrack(track);\n }\n\n break;\n }\n }\n\n this.finalizeAddingTrack({\n type,\n source,\n stream,\n track,\n kind,\n streamAnalyser: kind === 'audio' ? new AudioStreamAnalyser(context, stream) : undefined\n });\n\n if(kind === 'audio' && this.interval) {\n this.changeTimer();\n }\n }\n\n private finalizeAddingTrack(item: StreamItem) {\n const {track} = item;\n track.addEventListener('ended', () => {\n this.removeTrack(track);\n }, {once: true});\n\n this.items.push(item);\n }\n\n public hasInputTrackKind(kind: StreamItem['kind']) {\n return this.items.find((item) => item.type === 'input' && item.kind === kind);\n }\n\n public static getSource(stream: MediaStream, type: StreamItem['type']) {\n return type === 'input' ? (stream.source || stream.id) : '' + toTelegramSource(+stream.id.substring(6));\n }\n\n public removeTrack(track: MediaStreamTrack) {\n this.log('removeTrack', track);\n\n const {items} = this;\n\n let handled = false;\n for(let i = 0, length = items.length; !handled && i < length; ++i) {\n const {track: t, type} = items[i];\n switch(type) {\n case 'output': {\n if(t === track) {\n items.splice(i, 1);\n this.outputStream.removeTrack(track);\n handled = true;\n }\n\n break;\n }\n\n case 'input': {\n if(t === track) {\n items.splice(i, 1);\n this.inputStream.removeTrack(track);\n handled = true;\n }\n\n break;\n }\n }\n }\n\n if(track.kind === 'audio' && this.interval) {\n this.changeTimer();\n }\n }\n\n public replaceInputAudio(stream: MediaStream, oldTrack: MediaStreamTrack) {\n this.removeTrack(oldTrack);\n this.addStream(stream, 'input');\n }\n\n private changeTimer() {\n if(this.timer !== undefined) {\n clearInterval(this.timer);\n }\n\n if(this.items.length) {\n this.timer = window.setInterval(this.analyse, this.interval);\n }\n }\n\n public getAmplitude = (item: StreamAudioItem): StreamAmplitude => {\n const {streamAnalyser, stream, track, source, type} = item;\n const analyser = streamAnalyser.analyser;\n if(!analyser) return;\n\n const array = new Uint8Array(analyser.frequencyBinCount);\n analyser.getByteFrequencyData(array);\n const value = getAmplitude(array);\n\n return {\n type,\n source,\n stream,\n track,\n value\n };\n };\n\n public analyse = () => {\n const all = this.counter % 3 === 0;\n const filteredItems = all ? this.items : this.items.filter((x) => x.type === 'input');\n const audioItems = filteredItems.filter((x) => x.kind === 'audio') as StreamAudioItem[];\n const amplitudes = audioItems.slice(0, GROUP_CALL_AMPLITUDE_ANALYSE_COUNT_MAX).map(this.getAmplitude);\n if(++this.counter >= 1000) {\n this.counter = 0;\n }\n\n StreamManager.ANALYSER_LISTENER.dispatchEvent('amplitude', {\n amplitudes,\n type: all ? 'all' : 'input'\n });\n };\n\n /* public appendToConnection(connection: RTCPeerConnection) {\n if(this.inputStream) {\n this.inputStream.getTracks().forEach((track) => {\n connection.log('addTrack', track);\n connection.addTrack(track, this.inputStream);\n\n if(track.kind === 'video') {\n track.enabled = true;\n }\n });\n }\n } */\n\n public appendToConference(conference: LocalConferenceDescription) {\n if(this.locked) {\n return;\n }\n\n const {inputStream, direction, canCreateConferenceEntry} = this;\n const transceiverInit: RTCRtpTransceiverInit = {direction, streams: [inputStream]};\n const types = this.types.map((type) => {\n return [\n type,\n /* type === 'video' || type === 'screencast' ?\n {sendEncodings: [{maxBitrate: 2500000}], ...transceiverInit} : */\n transceiverInit\n ] as const;\n });\n\n const tracks = inputStream.getTracks();\n // const transceivers = conference.connection.getTransceivers();\n for(const [type, transceiverInit] of types) {\n let entry = conference.findEntry((entry) => entry.direction === direction && entry.type === type);\n if(!entry) {\n if(!canCreateConferenceEntry) {\n continue;\n }\n\n entry = conference.createEntry(type);\n }\n /* const entry = conference.findFreeSendRecvEntry(type, true);\n if(!entry.transceiver) {\n entry.transceiver = transceivers.find((transceiver) => transceiver.mid === entry.mid);\n } */\n\n let {transceiver} = entry;\n if(!transceiver) {\n transceiver = entry.createTransceiver(conference.connection, transceiverInit);\n\n /* if(this.isScreenSharingManager) {\n transceiver.sender.setParameters({\n ...transceiver.sender.getParameters(),\n degradationPreference: 'maintain-resolution'\n });\n } */\n }\n\n if(entry.direction !== transceiver.direction) {\n transceiver.direction = entry.direction;\n }\n\n const mediaTrackType = fixMediaLineType(type);\n const trackIdx = tracks.findIndex((track) => track.kind === mediaTrackType);\n const track = trackIdx !== -1 ? tracks.splice(trackIdx, 1)[0] : undefined;\n const sender = transceiver.sender;\n if(sender.track === track) {\n continue;\n }\n\n // try { // ! don't use await here. it will wait for adding track and fake one won't be visible in startNegotiation.\n /* await */sender.replaceTrack(track).catch((err) => {\n this.log.error(err);\n });\n // } catch(err) {\n\n // }\n }\n }\n\n public stop() {\n try {\n const tracks = this.inputStream.getTracks().concat(this.outputStream.getTracks());\n tracks.forEach((track) => {\n stopTrack(track);\n });\n } catch(e) {\n this.log.error(e);\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nexport default class StringFromLineBuilder {\n private lines: string[];\n private newLine: string[];\n\n constructor(private joiner = '\\r\\n') {\n this.lines = [];\n this.newLine = [];\n }\n\n public add(...strs: string[]) {\n this.lines.push(...strs);\n return this;\n }\n\n public push(word: string) {\n this.newLine.push(word);\n return this;\n }\n\n public addJoined(separator = '') {\n this.add(this.newLine.join(separator));\n this.newLine = [];\n return this;\n }\n\n public join() {\n return this.lines.join(this.joiner);\n }\n\n public finalize() {\n return this.join() + this.joiner;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\n// NOTE: telegram returns sign source, while webrtc uses unsign source internally\n// unsign => sign\nexport function toTelegramSource(source: number) {\n return source << 0;\n}\n\n// NOTE: telegram returns sign source, while webrtc uses unsign source internally\n// sign => unsign\nexport function fromTelegramSource(source: number) {\n return source >>> 0;\n}\n\nexport function getAmplitude(array: Uint8Array, scale = 3) {\n if(!array) return 0;\n\n const {length} = array;\n let total = 0;\n for(let i = 0; i < length; ++i) {\n total += array[i] * array[i];\n }\n const rms = Math.sqrt(total / length) / 255;\n\n return Math.min(1, rms * scale);\n}\n","export const SEND_WHEN_ONLINE_TIMESTAMP = 0x7FFFFFFE;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\nimport getEmojiEntityFromEmoji from './getEmojiEntityFromEmoji';\nimport emojiRegExp from '../../vendor/emoji/regex';\n\nconst EMOJI_REG_EXP = new RegExp(`(^${emojiRegExp})`);\n\nexport default function getAbbreviation(str: string, onlyFirst = false): {\n text: string,\n entities: MessageEntity[]\n} {\n const splitted = (str || '').trim().split(' ');\n if(!splitted[0]) return {text: '', entities: []};\n\n const entities: MessageEntity.messageEntityEmoji[] = [];\n\n const firstEmojiMatch = splitted[0].match(EMOJI_REG_EXP);\n const first = firstEmojiMatch?.[0] || splitted[0][0];\n if(firstEmojiMatch) {\n entities.push(getEmojiEntityFromEmoji(first));\n }\n\n const length = splitted.length;\n if(onlyFirst || length === 1) return {text: first, entities};\n\n const lastEmojiMatch = splitted[length - 1].match(EMOJI_REG_EXP);\n const last = lastEmojiMatch?.[0] || splitted[length - 1][0];\n if(lastEmojiMatch) {\n entities.push({\n ...getEmojiEntityFromEmoji(last),\n offset: first.length\n });\n }\n\n return {text: first + last, entities};\n}\n","import {MessageEntity} from '../../layer';\nimport {toCodePoints} from '../../vendor/emoji';\n\nexport default function getEmojiEntityFromEmoji(emoji: string): MessageEntity.messageEntityEmoji {\n return {\n _: 'messageEntityEmoji',\n offset: 0,\n length: emoji.length,\n unicode: toCodePoints(emoji).join('-').replace(/-?fe0f/g, '')\n };\n}\n","import {EMAIL_REG_EXP} from '.';\n\nexport default function matchEmail(text: string) {\n return !text ? null : text.match(EMAIL_REG_EXP);\n}\n","export default function setBlankToAnchor(anchor: HTMLAnchorElement) {\n anchor.target = '_blank';\n anchor.rel = 'noopener noreferrer';\n return anchor;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport wrapEmojiText from './wrapEmojiText';\nimport getAbbreviation from './getAbbreviation';\n\nexport default function wrapAbbreviation(str: string, onlyFirst?: boolean) {\n const {text, entities} = getAbbreviation(str, onlyFirst);\n return wrapEmojiText(text, undefined, entities);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport rootScope from '../rootScope';\nimport wrapRichText from './wrapRichText';\n\nexport default function wrapDraftText(text: string, options: Partial<{\n wrappingForPeerId: PeerId\n}> & Parameters[1] = {}) {\n if(!text) {\n return wrapRichText('');\n }\n\n let entities = options.entities;\n if(entities && !rootScope.premium && options.wrappingForPeerId !== rootScope.myId) {\n entities = entities.filter((entity) => entity._ !== 'messageEntityCustomEmoji');\n }\n\n const fragment = wrapRichText(text, {\n ...options,\n entities,\n noLinks: true,\n wrappingDraft: true,\n passEntities: {\n messageEntityTextUrl: true,\n messageEntityMentionName: true\n }\n });\n\n return fragment;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MessageEntity} from '../../layer';\nimport parseEntities from './parseEntities';\nimport wrapRichText from './wrapRichText';\n\nexport default function wrapEmojiText(text: string, isDraft = false, entities?: MessageEntity[]) {\n if(!text) return wrapRichText('');\n\n entities ??= parseEntities(text).filter((e) => e._ === 'messageEntityEmoji');\n return wrapRichText(text, {entities, wrappingDraft: isDraft});\n}\n","import IS_EMOJI_SUPPORTED from './emojiSupport';\n\nexport type EMOJI_VERSION = '' | '14';\n\nconst EMOJI_VERSIONS_SUPPORTED: {\n [v in EMOJI_VERSION]: boolean\n} = {} as any;\n\n// Thanks to WebZ for the detect\nfunction isEmojiSupported(emoji: string) {\n const ALLOWABLE_CALCULATION_ERROR_SIZE = 5;\n const inlineEl = document.createElement('span');\n inlineEl.classList.add('emoji');\n document.body.appendChild(inlineEl);\n\n inlineEl.innerText = emoji; // Emoji from 14.0 version\n const newEmojiWidth = inlineEl.offsetWidth;\n inlineEl.innerText = '❤️'; // Emoji from 1.0 version\n const legacyEmojiWidth = inlineEl.offsetWidth;\n\n document.body.removeChild(inlineEl);\n\n return Math.abs(newEmojiWidth - legacyEmojiWidth) < ALLOWABLE_CALCULATION_ERROR_SIZE;\n}\n\nif(IS_EMOJI_SUPPORTED) {\n EMOJI_VERSIONS_SUPPORTED[''] = true;\n\n const a: [keyof typeof EMOJI_VERSIONS_SUPPORTED, string][] = [\n ['14', '🫱🏻']\n ];\n\n a.forEach(([version, emoji]) => {\n EMOJI_VERSIONS_SUPPORTED[version] = isEmojiSupported(emoji);\n });\n}\n\nexport default EMOJI_VERSIONS_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {EMOJI_VERSION} from '../../environment/emojiVersionsSupport';\nimport {SITE_HASHTAGS} from '.';\nimport {EmojiVersions} from '../../config/emoji';\nimport IS_EMOJI_SUPPORTED from '../../environment/emojiSupport';\nimport buildURLHash from '../../helpers/buildURLHash';\nimport copy from '../../helpers/object/copy';\nimport encodeEntities from '../../helpers/string/encodeEntities';\nimport {MessageEntity} from '../../layer';\nimport encodeSpoiler from './encodeSpoiler';\nimport parseEntities from './parseEntities';\nimport setBlankToAnchor from './setBlankToAnchor';\nimport wrapUrl from './wrapUrl';\nimport EMOJI_VERSIONS_SUPPORTED from '../../environment/emojiVersionsSupport';\nimport {CLICK_EVENT_NAME} from '../../helpers/dom/clickEvent';\nimport IS_CUSTOM_EMOJI_SUPPORTED from '../../environment/customEmojiSupport';\nimport rootScope from '../rootScope';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport wrapSticker, {videosCache} from '../../components/wrappers/sticker';\nimport RLottiePlayer, {getLottiePixelRatio} from '../rlottie/rlottiePlayer';\nimport animationIntersector, {AnimationItemGroup} from '../../components/animationIntersector';\nimport type {MyDocument} from '../appManagers/appDocsManager';\nimport LazyLoadQueue from '../../components/lazyLoadQueue';\nimport {Awaited} from '../../types';\nimport {MediaSize} from '../../helpers/mediaSize';\nimport IS_WEBM_SUPPORTED from '../../environment/webmSupport';\nimport assumeType from '../../helpers/assumeType';\nimport noop from '../../helpers/noop';\nimport findUpClassName from '../../helpers/dom/findUpClassName';\nimport getViewportSlice from '../../helpers/dom/getViewportSlice';\nimport {getMiddleware, Middleware, MiddlewareHelper} from '../../helpers/middleware';\nimport replaceContent from '../../helpers/dom/replaceContent';\nimport BOM from '../../helpers/string/bom';\nimport framesCache from '../../helpers/framesCache';\nimport wrapTelegramUrlToAnchor from './wrapTelegramUrlToAnchor';\n\nconst resizeObserver = new ResizeObserver((entries) => {\n for(const entry of entries) {\n const renderer = entry.target.parentElement as CustomEmojiRendererElement;\n renderer.setDimensionsFromRect(entry.contentRect);\n }\n});\n\nconst globalLazyLoadQueue = new LazyLoadQueue();\n\nexport class CustomEmojiElement extends HTMLElement {\n public elements: CustomEmojiElements;\n public renderer: CustomEmojiRendererElement;\n public player: RLottiePlayer | HTMLVideoElement;\n public paused: boolean;\n public syncedPlayer: SyncedPlayer;\n public clean: boolean;\n public lastChildWas: Node;\n // public docId: DocId;\n public placeholder: HTMLImageElement;\n public middlewareHelper: MiddlewareHelper;\n\n constructor() {\n super();\n this.paused = true;\n this.classList.add('custom-emoji');\n }\n\n public get docId() {\n return this.dataset.docId;\n }\n\n public static create(docId: DocId) {\n const element = new CustomEmojiElement();\n // element.docId = docId;\n element.dataset.docId = '' + docId;\n return element;\n }\n\n public get isConnected() {\n return this.placeholder?.isConnected ?? super.isConnected;\n }\n\n public connectedCallback() {\n // if(this.isConnected) {\n // return;\n // }\n\n if(this.player) {\n animationIntersector.addAnimation({\n animation: this,\n group: this.renderer.animationGroup,\n controlled: true\n });\n }\n\n // this.connectedCallback = undefined;\n }\n\n public disconnectedCallback() {\n if(this.isConnected || !this.renderer?.isSelectable) { // prepend on sibling can invoke disconnectedCallback\n return;\n }\n\n this.clear();\n }\n\n public destroy() {\n this.clear();\n }\n\n public clear(replaceChildren = true) {\n if(this.clean) {\n return;\n }\n\n // if(this.docId === '5399836826758290421') {\n // console.log('clear', this, this.isConnected);\n // }\n\n this.clean = true;\n this.pause();\n\n const {syncedPlayer} = this;\n if(syncedPlayer) {\n syncedPlayer.pausedElements.delete(this);\n }\n\n this.middlewareHelper?.clean();\n\n if(this.renderer) {\n const elements = this.renderer.customEmojis.get(this.docId);\n if(elements?.delete(this) && !elements.size) {\n this.renderer.customEmojis.delete(this.docId);\n this.renderer.playersSynced.delete(elements);\n }\n\n if(replaceChildren) {\n if(this.renderer.isSelectable) {\n this.replaceChildren(createCustomFiller(true));\n } else {\n // otherwise https://bugs.chromium.org/p/chromium/issues/detail?id=1144736#c27 will happen\n this.replaceChildren();\n }\n }\n }\n\n if(this.player) {\n animationIntersector.removeAnimationByPlayer(this);\n }\n\n if(globalLazyLoadQueue) {\n globalLazyLoadQueue.delete({div: this});\n }\n\n /* this.disconnectedCallback = */this.elements =\n this.renderer =\n this.player =\n this.syncedPlayer =\n undefined;\n }\n\n public pause() {\n if(this.paused) {\n return;\n }\n\n this.paused = true;\n\n if(this.player instanceof HTMLVideoElement && !this.syncedPlayer) {\n this.renderer.lastPausedVideo = this.player;\n this.player.pause();\n }\n\n if(this.syncedPlayer && !this.syncedPlayer.pausedElements.has(this)) {\n this.syncedPlayer.pausedElements.add(this);\n\n if(this.syncedPlayer.player && this.syncedPlayer.pausedElements.size === this.syncedPlayer.middlewares.size) {\n this.syncedPlayer.player.pause();\n }\n }\n }\n\n public play() {\n if(!this.paused) {\n return;\n }\n\n this.paused = false;\n\n if(this.player instanceof HTMLVideoElement) {\n this.player.currentTime = this.renderer.lastPausedVideo?.currentTime ?? this.player.currentTime;\n this.player.play().catch(noop);\n }\n\n if(this.syncedPlayer && this.syncedPlayer.pausedElements.has(this)) {\n this.syncedPlayer.pausedElements.delete(this);\n\n if(this.syncedPlayer.pausedElements.size !== this.syncedPlayer.middlewares.size) {\n this.player.play();\n }\n }\n }\n\n public remove() {\n this.clear();\n // this.elements = this.renderer = this.player = undefined;\n }\n\n public get autoplay() {\n return true;\n }\n\n public get loop() {\n return true;\n }\n}\n\ntype CustomEmojiElements = Set;\n\nexport class CustomEmojiRendererElement extends HTMLElement {\n public canvas: HTMLCanvasElement;\n public context: CanvasRenderingContext2D;\n\n public playersSynced: Map;\n public clearedElements: WeakSet;\n public customEmojis: Parameters[1]['customEmojis'];\n public lastPausedVideo: HTMLVideoElement;\n\n public lastRect: DOMRect;\n public isDimensionsSet: boolean;\n\n public animationGroup: AnimationItemGroup;\n public size: MediaSize;\n\n public isSelectable: boolean;\n public isCanvasClean: boolean;\n\n public ignoreSettingDimensions: boolean;\n\n public forceRenderAfterSize: boolean;\n\n public middlewareHelper: MiddlewareHelper;\n\n public auto: boolean;\n\n constructor() {\n super();\n\n this.classList.add('custom-emoji-renderer');\n this.canvas = document.createElement('canvas');\n this.canvas.classList.add('custom-emoji-canvas');\n this.context = this.canvas.getContext('2d');\n this.append(this.canvas);\n\n this.playersSynced = new Map();\n this.clearedElements = new WeakSet();\n this.customEmojis = new Map();\n\n this.animationGroup = 'EMOJI';\n this.isCanvasClean = false;\n }\n\n public connectedCallback() {\n if(emojiRenderers.has(this)) {\n return;\n }\n\n // this.setDimensions();\n // animationIntersector.addAnimation(this, this.animationGroup);\n resizeObserver.observe(this.canvas);\n emojiRenderers.add(this);\n\n this.connectedCallback = undefined;\n }\n\n public disconnectedCallback() {\n if(this.isConnected || !this.auto) {\n return;\n }\n\n this.destroy?.();\n\n this.disconnectedCallback = undefined;\n }\n\n public destroy() {\n // if(this.isConnected) {\n // return;\n // }\n\n resizeObserver.unobserve(this.canvas);\n\n this.customEmojis.forEach((elements) => {\n elements.forEach((element) => {\n element.clear();\n });\n });\n\n emojiRenderers.delete(this);\n this.playersSynced.clear();\n this.middlewareHelper?.clean();\n this.customEmojis.clear();\n\n this.destroy =\n this.lastPausedVideo =\n undefined;\n }\n\n public getOffsets(offsetsMap: Map = new Map()) {\n if(!this.playersSynced.size) {\n return offsetsMap;\n }\n\n const overflowElement = findUpClassName(this, 'scrollable') || this.offsetParent as HTMLElement;\n if(!overflowElement) {\n return offsetsMap;\n }\n\n const overflowRect = overflowElement.getBoundingClientRect();\n const rect = this.getBoundingClientRect();\n\n for(const elements of this.playersSynced.keys()) {\n const elementsArr = Array.from(elements);\n const placeholders = this.isSelectable ? elementsArr.map((element) => element.placeholder) : elementsArr;\n const {visible} = getViewportSlice({\n overflowElement,\n overflowRect,\n elements: placeholders,\n extraSize: this.size.height * 2.5 // let's add some margin\n });\n\n const offsets = visible.map(({rect: elementRect}) => {\n const top = elementRect.top - rect.top;\n const left = elementRect.left - rect.left;\n return {top, left, width: elementRect.width};\n });\n\n if(offsets.length) {\n offsetsMap.set(elements, offsets);\n }\n }\n\n // const rect = this.getBoundingClientRect();\n // const visibleRect = getVisibleRect(this, overflowElement, undefined, rect);\n // const minTop = visibleRect ? visibleRect.rect.top - this.size.height : 0;\n // const maxTop = Infinity;\n // for(const elements of this.playersSynced.keys()) {\n // const offsets = elements.map((element) => {\n // const elementRect = element.getBoundingClientRect();\n // const top = elementRect.top - rect.top;\n // const left = elementRect.left - rect.left;\n // return top >= minTop && (top + elementRect.height) <= maxTop ? {top, left} : undefined;\n // }).filter(Boolean);\n\n // if(offsets.length) {\n // offsetsMap.set(elements, offsets);\n // }\n // }\n\n return offsetsMap;\n }\n\n public clearCanvas() {\n if(this.isCanvasClean) {\n return;\n }\n\n const {context, canvas} = this;\n context.clearRect(0, 0, canvas.width, canvas.height);\n this.isCanvasClean = true;\n }\n\n public render(offsetsMap: ReturnType) {\n const {context, canvas, isDimensionsSet} = this;\n if(!isDimensionsSet) {\n this.setDimensionsFromRect(undefined, false);\n }\n\n this.isCanvasClean = false;\n\n const {width, height, dpr} = canvas;\n for(const [elements, offsets] of offsetsMap) {\n const player = this.playersSynced.get(elements);\n const frame = syncedPlayersFrames.get(player) || (player instanceof HTMLVideoElement ? player : undefined);\n if(!frame) {\n continue;\n }\n\n const isImageData = frame instanceof ImageData;\n let frameWidth: number, frameHeight: number;\n if(player instanceof HTMLVideoElement) {\n frameWidth = this.size.width * dpr;\n frameHeight = this.size.height * dpr;\n } else {\n frameWidth = frame.width;\n frameHeight = frame.height;\n }\n\n // ! check performance of scaling\n const elementWidth = Math.round(offsets[0].width * dpr);\n if(elementWidth !== frameWidth) {\n // if(this.size.width === 36) {\n // console.warn('different width', elementWidth, frameWidth, this);\n // }\n\n frameWidth = elementWidth;\n frameHeight = elementWidth;\n }\n\n const maxTop = height - frameHeight;\n const maxLeft = width - frameWidth;\n\n if(!this.clearedElements.has(elements) && !this.isSelectable) {\n if(this.isSelectable/* && false */) {\n elements.forEach((element) => {\n element.lastChildWas ??= element.lastChild;\n replaceContent(element, element.firstChild);\n });\n } else {\n elements.forEach((element) => {\n element.replaceChildren();\n });\n }\n\n this.clearedElements.add(elements);\n }\n\n offsets.forEach(({top, left}) => {\n top = Math.round(top * dpr), left = Math.round(left * dpr);\n if(left < 0 ||/* top > maxTop || */left > maxLeft) {\n return;\n }\n\n if(isImageData) {\n context.putImageData(frame, left, top);\n } else {\n // context.clearRect(left, top, width, height);\n context.drawImage(frame, left, top, frameWidth, frameHeight);\n }\n });\n }\n }\n\n public checkForAnyFrame() {\n for(const player of this.playersSynced.values()) {\n if(syncedPlayersFrames.has(player) || player instanceof HTMLVideoElement) {\n return true;\n }\n }\n\n return false;\n }\n\n public remove() {\n super.remove();\n // this.canvas.remove();\n }\n\n // public setDimensions() {\n // const {canvas} = this;\n // sequentialDom.mutateElement(canvas, () => {\n // const rect = canvas.getBoundingClientRect();\n // this.setDimensionsFromRect(rect);\n // });\n // }\n\n public setDimensionsFromRect(rect: DOMRect = this.lastRect, forceRenderAfter = true) {\n const {canvas} = this;\n const {dpr} = canvas;\n\n if(this.lastRect !== rect) {\n this.lastRect = rect;\n }\n\n if(!rect || !dpr || this.ignoreSettingDimensions) {\n return;\n }\n\n const {width, height} = rect;\n // if(this.isSelectable) {\n // height = this.parentElement.scrollHeight || height;\n\n // this.style.width = width + 'px';\n // this.style.height = height + 'px';\n // }\n\n const newWidth = Math.floor(Math.round(width * dpr));\n const newHeight = Math.floor(Math.round(height * dpr));\n if(canvas.width === newWidth && canvas.height === newHeight) {\n return;\n }\n\n canvas.width = newWidth;\n canvas.height = newHeight;\n this.isDimensionsSet = true;\n this.isCanvasClean = true;\n\n if(this.forceRenderAfterSize || (this.isSelectable && forceRenderAfter)) {\n this.forceRenderAfterSize = undefined;\n this.forceRender();\n }\n }\n\n public forceRender() {\n if(!this.isDimensionsSet) {\n return;\n }\n\n if(!renderEmojis(new Set([this]))) {\n this.clearCanvas();\n }\n }\n\n public add(\n addCustomEmojis: Parameters[1]['customEmojis'],\n lazyLoadQueue?: LazyLoadQueue | false,\n onlyThumb?: boolean,\n withThumb?: boolean\n ) {\n const renderer = this;\n\n addCustomEmojis.forEach((addElements, docId) => { // prevent adding old elements\n let elements = this.customEmojis.get(docId);\n if(!elements) this.customEmojis.set(docId, elements = new Set());\n else this.clearedElements.delete(elements);\n\n for(const el of addElements) {\n if(elements.has(el)) {\n addElements.delete(el);\n } else {\n el.clean = false;\n el.renderer = renderer;\n el.elements = elements;\n el.middlewareHelper = this.middlewareHelper.get().create();\n elements.add(el);\n\n if(el.lastChildWas && !el.lastChildWas.parentNode) {\n el.append(el.lastChildWas);\n }\n }\n }\n\n if(!addElements.size) {\n addCustomEmojis.delete(docId);\n }\n });\n\n if(!addCustomEmojis.size) {\n return;\n }\n\n const usingOwnQueue = !!(!lazyLoadQueue && lazyLoadQueue !== false && globalLazyLoadQueue);\n\n const docIds = Array.from(addCustomEmojis.keys());\n\n const managers = rootScope.managers;\n const middleware = this.middlewareHelper.get();\n const size = this.size;\n\n const loadPromise = managers.appEmojiManager.getCachedCustomEmojiDocuments(docIds).then((docs) => {\n if(middleware && !middleware()) return;\n\n const loadPromises: Promise[] = [];\n const wrap = (doc: MyDocument, _loadPromises?: Promise[]) => {\n const docId = doc.id;\n const newElements = addCustomEmojis.get(docId);\n const customEmojis = renderer.customEmojis.get(docId);\n const isLottie = doc.sticker === 2;\n const isStatic = doc.mime_type === 'video/webm' && !IS_WEBM_SUPPORTED;\n const willHaveSyncedPlayer = (isLottie || (doc.sticker === 3 && this.isSelectable)) && !onlyThumb && !isStatic;\n\n const loadPromises: Promise[] = [];\n const newElementsArray = Array.from(newElements);\n const promise = wrapSticker({\n div: newElementsArray,\n doc,\n width: size.width,\n height: size.height,\n loop: true,\n play: CUSTOM_EMOJI_INSTANT_PLAY,\n managers,\n isCustomEmoji: true,\n group: 'none',\n loadPromises,\n middleware,\n exportLoad: usingOwnQueue || lazyLoadQueue === false ? 2 : 1, // 2 - export load always, 1 - do not export load if cached static\n needFadeIn: false,\n loadStickerMiddleware: willHaveSyncedPlayer && middleware ? middleware.create().get(() => {\n // if(syncedPlayers.get(key) !== syncedPlayer) {\n // return false;\n // }\n\n // let good = false;\n // for(const middleware of syncedPlayer.middlewares) {\n // if(middleware()) {\n // good = true;\n // break;\n // }\n // }\n\n // return good;\n return !!syncedPlayer.middlewares.size;\n }) : undefined,\n static: isStatic,\n onlyThumb,\n withThumb: withThumb ?? (renderer.clearedElements.has(customEmojis) ? false : undefined),\n syncedVideo: this.isSelectable\n });\n\n if(_loadPromises) {\n promise.then(() => _loadPromises.push(...loadPromises));\n }\n\n const addition: {\n onRender?: (_p: Awaited['render']>) => Promise,\n elements: typeof newElements\n } = {\n elements: newElements\n };\n\n if(doc.sticker === 1 || onlyThumb || isStatic) {\n if(this.isSelectable) {\n addition.onRender = () => Promise.all(loadPromises).then(() => {\n if(middleware && !middleware()) return;\n newElementsArray.forEach((element) => {\n const {placeholder} = element;\n placeholder.src = (element.firstElementChild as HTMLImageElement).src;\n });\n });\n }\n\n return promise.then((res) => ({...res, ...addition}));\n }\n\n // eslint-disable-next-line prefer-const\n addition.onRender = (_p) => Promise.all(loadPromises).then(() => {\n if((middleware && !middleware()) || !doc.animated) {\n return;\n }\n\n const players = Array.isArray(_p) ? _p as HTMLVideoElement[] : [_p as RLottiePlayer];\n const player = Array.isArray(players) ? players[0] : players;\n assumeType(player);\n newElementsArray.forEach((element, idx) => {\n const player = players[idx] || players[0];\n element.player = player;\n\n if(syncedPlayer) {\n element.syncedPlayer = syncedPlayer;\n if(element.paused) {\n element.syncedPlayer.pausedElements.add(element);\n } else if(player.paused) {\n player.play();\n }\n }\n\n if(element.isConnected) {\n animationIntersector.addAnimation({\n animation: element,\n group: element.renderer.animationGroup,\n controlled: true\n });\n }\n });\n\n if(player instanceof RLottiePlayer || (player instanceof HTMLVideoElement && this.isSelectable)) {\n syncedPlayer.player = player;\n renderer.playersSynced.set(customEmojis, player);\n }\n\n if(player instanceof RLottiePlayer) {\n player.group = renderer.animationGroup;\n\n player.overrideRender ??= (frame) => {\n syncedPlayersFrames.set(player, frame);\n // frames.set(containers, frame);\n };\n } else if(player instanceof HTMLVideoElement) {\n // player.play();\n\n // const cache = framesCache.getCache(key);\n // let {width, height} = renderer.size;\n // width *= dpr;\n // height *= dpr;\n\n // const onFrame = (frame: ImageBitmap | HTMLCanvasElement) => {\n // topFrames.set(player, frame);\n // player.requestVideoFrameCallback(callback);\n // };\n\n // let frameNo = -1, lastTime = 0;\n // const callback: VideoFrameRequestCallback = (now, metadata) => {\n // const time = player.currentTime;\n // if(lastTime > time) {\n // frameNo = -1;\n // }\n\n // const _frameNo = ++frameNo;\n // lastTime = time;\n // // const frameNo = Math.floor(player.currentTime * 1000 / CUSTOM_EMOJI_FRAME_INTERVAL);\n // // const frameNo = metadata.presentedFrames;\n // const imageBitmap = cache.framesNew.get(_frameNo);\n\n // if(imageBitmap) {\n // onFrame(imageBitmap);\n // } else if(IS_IMAGE_BITMAP_SUPPORTED) {\n // createImageBitmap(player, {resizeWidth: width, resizeHeight: height}).then((imageBitmap) => {\n // cache.framesNew.set(_frameNo, imageBitmap);\n // if(frameNo === _frameNo) onFrame(imageBitmap);\n // });\n // } else {\n // const canvas = document.createElement('canvas');\n // const context = canvas.getContext('2d');\n // canvas.width = width;\n // canvas.height = height;\n // context.drawImage(player, 0, 0);\n // cache.framesNew.set(_frameNo, canvas);\n // onFrame(canvas);\n // }\n // };\n\n // // player.requestVideoFrameCallback(callback);\n // // setInterval(callback, CUSTOM_EMOJI_FRAME_INTERVAL);\n }\n\n if(willHaveSyncedPlayer) {\n const dpr = getLottiePixelRatio(this.size.width, this.size.height);\n renderer.canvas.dpr = dpr;\n setRenderInterval();\n }\n });\n\n let syncedPlayer: SyncedPlayer;\n const key = [docId, size.width, size.height].join('-');\n if(willHaveSyncedPlayer) {\n syncedPlayer = syncedPlayers.get(key);\n if(!syncedPlayer) {\n syncedPlayer = {\n player: undefined,\n middlewares: new Set(),\n pausedElements: new Set(),\n key\n };\n\n syncedPlayers.set(key, syncedPlayer);\n }\n\n for(const element of newElements) {\n const middleware = element.middlewareHelper.get();\n syncedPlayer.middlewares.add(middleware);\n middleware.onClean(() => {\n syncedPlayer.middlewares.delete(middleware);\n\n if(!syncedPlayer.middlewares.size) {\n if(syncedPlayer.player) {\n const frame = syncedPlayersFrames.get(syncedPlayer.player);\n if(frame) {\n (frame as ImageBitmap).close?.();\n syncedPlayersFrames.delete(syncedPlayer.player);\n }\n\n syncedPlayersFrames.delete(syncedPlayer.player);\n if(syncedPlayer.player instanceof RLottiePlayer) {\n syncedPlayer.player.overrideRender = noop;\n syncedPlayer.player.remove();\n } else if(syncedPlayer.player instanceof HTMLVideoElement) {\n const cacheName = framesCache.generateName('' + element.docId, 0, 0, undefined, undefined);\n delete videosCache[cacheName];\n }\n\n syncedPlayer.player = undefined;\n }\n\n if(syncedPlayers.get(syncedPlayer.key) === syncedPlayer && syncedPlayers.delete(syncedPlayer.key) && !syncedPlayers.size) {\n clearRenderInterval();\n }\n }\n });\n }\n }\n\n return promise.then((res) => ({...res, ...addition}));\n };\n\n const missing: DocId[] = [];\n const cachedPromises = docs.map((doc, idx) => {\n if(!doc) {\n missing.push(docIds[idx]);\n return;\n }\n\n return wrap(doc, loadPromises);\n }).filter(Boolean);\n\n const uncachedPromisesPromise = !missing.length ?\n Promise.resolve([] as typeof cachedPromises) :\n managers.appEmojiManager.getCustomEmojiDocuments(missing).then((docs) => {\n if(middleware && !middleware()) return [];\n return docs.filter(Boolean).map((doc) => wrap(doc));\n });\n\n const loadFromPromises = (promises: typeof cachedPromises) => {\n return Promise.all(promises).then((arr) => {\n const promises = arr.map(({load, onRender, elements}) => {\n if(!load) {\n return;\n }\n\n const l = () => load().then(onRender);\n\n if(usingOwnQueue) {\n elements.forEach((element) => {\n globalLazyLoadQueue.push({\n div: element,\n load: () => {\n elements.forEach((element) => {\n globalLazyLoadQueue.delete({div: element});\n });\n\n return l();\n }\n });\n });\n } else {\n return l();\n }\n });\n\n return Promise.all(promises);\n });\n };\n\n const load = () => {\n if(middleware && !middleware()) return;\n const cached = loadFromPromises(cachedPromises);\n const uncached = uncachedPromisesPromise.then((promises) => loadFromPromises(promises));\n return Promise.all([cached, uncached]);\n };\n\n if(lazyLoadQueue) {\n lazyLoadQueue.push({\n div: renderer.canvas,\n load\n });\n } else {\n load();\n }\n\n return Promise.all(cachedPromises).then(() => Promise.all(loadPromises)).then(() => {});\n });\n\n // recordPromise(loadPromise, 'render emojis: ' + docIds.length);\n\n return loadPromise;\n }\n\n public static create(options: CustomEmojiRendererElementOptions) {\n const renderer = new CustomEmojiRendererElement();\n renderer.animationGroup = options.animationGroup;\n renderer.size = options.customEmojiSize || mediaSizes.active.customEmoji;\n renderer.isSelectable = options.isSelectable;\n if(options.wrappingDraft) {\n renderer.contentEditable = 'false';\n renderer.style.height = 'inherit';\n }\n // const middleware = () => !!renderer.disconnectedCallback && (!options.middleware || options.middleware());\n let middleware = options.middleware;\n if(middleware) {\n renderer.middlewareHelper = middleware.create();\n middleware = renderer.middlewareHelper.get();\n middleware.onDestroy(() => {\n renderer.destroy?.();\n });\n } else {\n // console.error('no middleware', this, options);\n renderer.auto = true;\n renderer.middlewareHelper = getMiddleware();\n }\n\n return renderer;\n }\n}\n\ntype CustomEmojiRenderer = CustomEmojiRendererElement;\ntype SyncedPlayer = {\n player: RLottiePlayer | HTMLVideoElement,\n middlewares: Set,\n pausedElements: Set,\n key: string\n};\ntype CustomEmojiFrame = Parameters[0] | HTMLVideoElement;\n\nconst CUSTOM_EMOJI_INSTANT_PLAY = true; // do not wait for animationIntersector\nlet emojiRenderInterval: number;\nconst emojiRenderers: Set = new Set();\nconst syncedPlayers: Map = new Map();\nconst syncedPlayersFrames: Map = new Map();\nexport const renderEmojis = (renderers = emojiRenderers) => {\n const r = Array.from(renderers);\n const t = r.filter((r) => r.isConnected && r.checkForAnyFrame() && !r.ignoreSettingDimensions);\n if(!t.length) {\n return false;\n }\n\n const o = t.map((renderer) => {\n const paused = [...renderer.playersSynced.values()].reduce((acc, v) => acc + +!!v.paused, 0);\n if(renderer.playersSynced.size === paused) {\n return;\n }\n\n const offsets = renderer.getOffsets();\n if(offsets.size) {\n return [renderer, offsets] as const;\n }\n }).filter(Boolean);\n\n for(const [renderer] of o) {\n renderer.clearCanvas();\n }\n\n for(const [renderer, offsets] of o) {\n renderer.render(offsets);\n }\n\n return true;\n};\nconst CUSTOM_EMOJI_FPS = 60;\nconst CUSTOM_EMOJI_FRAME_INTERVAL = 1000 / CUSTOM_EMOJI_FPS;\nconst setRenderInterval = () => {\n if(emojiRenderInterval) {\n return;\n }\n\n emojiRenderInterval = window.setInterval(renderEmojis, CUSTOM_EMOJI_FRAME_INTERVAL);\n renderEmojis();\n};\nconst clearRenderInterval = () => {\n if(!emojiRenderInterval) {\n return;\n }\n\n clearInterval(emojiRenderInterval);\n emojiRenderInterval = undefined;\n};\n\n(window as any).syncedPlayers = syncedPlayers;\n(window as any).emojiRenderers = emojiRenderers;\n\ncustomElements.define('custom-emoji-element', CustomEmojiElement);\ncustomElements.define('custom-emoji-renderer-element', CustomEmojiRendererElement);\n\ntype CustomEmojiRendererElementOptions = Partial<{\n loadPromises: Promise[],\n customEmojiRenderer: CustomEmojiRendererElement,\n\n isSelectable: boolean,\n wrappingDraft: boolean\n}> & WrapSomethingOptions;\n\n/**\n * * Expecting correctly sorted nested entities (RichTextProcessor.sortEntities)\n */\nexport default function wrapRichText(text: string, options: Partial<{\n entities: MessageEntity[],\n contextSite: string,\n highlightUsername: string,\n noLinks: boolean,\n noLinebreaks: boolean,\n noCommands: boolean,\n wrappingDraft: boolean,\n // mustWrapEmoji: boolean,\n fromBot: boolean,\n noTextFormat: boolean,\n passEntities: Partial<{\n [_ in MessageEntity['_']]: boolean\n }>,\n maxMediaTimestamp: number,\n noEncoding: boolean,\n isSelectable: boolean,\n\n contextHashtag?: string,\n\n // ! recursive, do not provide\n nasty?: {\n i: number,\n usedLength: number,\n text: string,\n lastEntity?: MessageEntity\n },\n voodoo?: boolean,\n customEmojis?: Map,\n customWraps?: Set,\n}> & CustomEmojiRendererElementOptions = {}) {\n const fragment = document.createDocumentFragment();\n if(!text) {\n return fragment;\n }\n\n const nasty = options.nasty ??= {\n i: 0,\n usedLength: 0,\n text\n };\n\n const wrapSomething = (wrapElement: HTMLElement, noFiller?: boolean) => {\n const element = document.createElement('span');\n // element.append(BOM, a, BOM);\n if(options.wrappingDraft) {\n element.contentEditable = 'false';\n }\n // element.style.display = 'inline-block';\n element.classList.add('input-something');\n element.append(/* BOM, */wrapElement);\n\n (lastElement || fragment).append(element);\n\n wrapElement.classList.add('input-selectable');\n // if(wrapElement instanceof HTMLImageElement) {\n // element.prepend(f());\n // } else {\n !noFiller && wrapElement.append(createCustomFiller(true));\n // }\n\n customWraps.add(element);\n\n return element;\n };\n\n options.isSelectable ||= options.wrappingDraft;\n\n const customEmojis = options.customEmojis ??= new Map() as Map;\n const customWraps = options.customWraps ??= new Set();\n\n const entities = options.entities ??= parseEntities(nasty.text);\n\n const passEntities = options.passEntities ??= {};\n const contextSite = options.contextSite ??= 'Telegram';\n const contextExternal = contextSite !== 'Telegram';\n\n const textLength = nasty.text.length;\n const length = entities.length;\n let lastElement: HTMLElement | DocumentFragment;\n for(; nasty.i < length; ++nasty.i) {\n let entity = entities[nasty.i];\n\n // * check whether text was sliced\n // TODO: consider about moving it to other function\n if(entity.offset >= textLength) {\n if(entity._ !== 'messageEntityCaret') { // * can set caret to the end\n continue;\n }\n } else if((entity.offset + entity.length) > textLength) {\n entity = copy(entity);\n // entity.length = entity.offset + entity.length - textLength;\n entity.length = textLength - entity.offset;\n }\n\n if(entity.length) {\n nasty.lastEntity = entity;\n }\n\n let nextEntity = entities[nasty.i + 1];\n\n const startOffset = entity.offset;\n const endOffset = startOffset + entity.length;\n const endPartOffset = Math.min(endOffset, nextEntity?.offset ?? 0xFFFF);\n const fullEntityText = nasty.text.slice(startOffset, endOffset);\n const sliced = nasty.text.slice(startOffset, endPartOffset);\n let partText = sliced;\n\n if(nasty.usedLength < startOffset) {\n (lastElement || fragment).append(nasty.text.slice(nasty.usedLength, startOffset));\n }\n\n if(lastElement) {\n lastElement = fragment;\n }\n\n nasty.usedLength = endPartOffset;\n\n let element: HTMLElement,\n property: 'textContent' | 'alt' = 'textContent',\n usedText = false;\n switch(entity._) {\n case 'messageEntityBold': {\n if(!options.noTextFormat) {\n if(options.wrappingDraft) {\n element = document.createElement('span');\n // element.style.fontWeight = 'bold';\n element.style.fontFamily = 'markup-bold';\n } else {\n element = document.createElement('strong');\n }\n }\n\n break;\n }\n\n case 'messageEntityItalic': {\n if(!options.noTextFormat) {\n if(options.wrappingDraft) {\n element = document.createElement('span');\n // element.style.fontStyle = 'italic';\n element.style.fontFamily = 'markup-italic';\n } else {\n element = document.createElement('em');\n }\n }\n\n break;\n }\n\n case 'messageEntityStrike': {\n if(options.wrappingDraft) {\n element = document.createElement('span');\n // const styleName = IS_SAFARI ? 'text-decoration' : 'text-decoration-line';\n // element.style.cssText = `${styleName}: line-through;`;\n element.style.fontFamily = 'markup-strikethrough';\n } else/* if(!options.noTextFormat) */ {\n element = document.createElement('del');\n }\n\n break;\n }\n\n case 'messageEntityUnderline': {\n if(options.wrappingDraft) {\n element = document.createElement('span');\n // const styleName = IS_SAFARI ? 'text-decoration' : 'text-decoration-line';\n // element.style.cssText = `${styleName}: underline;`;\n element.style.fontFamily = 'markup-underline';\n } else if(!options.noTextFormat) {\n element = document.createElement('u');\n }\n\n break;\n }\n\n case 'messageEntityPre':\n case 'messageEntityCode': {\n if(options.wrappingDraft) {\n element = document.createElement('span');\n // element.style.fontFamily = 'var(--font-monospace)';\n element.style.fontFamily = 'markup-monospace';\n } else if(!options.noTextFormat) {\n element = document.createElement('code');\n }\n\n break;\n }\n\n // case 'messageEntityPre': {\n // if(options.wrappingDraft) {\n // element = document.createElement('span');\n // element.style.fontFamily = 'var(--font-monospace)';\n // } else if(!options.noTextFormat) {\n // element = document.createElement('pre');\n // const inner = document.createElement('code');\n // if(entity.language) {\n // inner.className = 'language-' + entity.language;\n // inner.textContent = entityText;\n // usedText = true;\n // }\n // }\n\n // break;\n // }\n\n case 'messageEntityHighlight': {\n element = document.createElement('i');\n element.className = 'text-highlight';\n break;\n }\n\n case 'messageEntityBotCommand': {\n // if(!(options.noLinks || options.noCommands || contextExternal)/* && !entity.unsafe */) {\n if(!options.noLinks && passEntities[entity._]) {\n let command = fullEntityText.slice(1);\n let bot: string | boolean;\n let atPos: number;\n if((atPos = command.indexOf('@')) !== -1) {\n bot = command.slice(atPos + 1);\n command = command.slice(0, atPos);\n } else {\n bot = options.fromBot;\n }\n\n element = document.createElement('a');\n (element as HTMLAnchorElement).href = encodeEntities('tg://bot_command?command=' + encodeURIComponent(command) + (bot ? '&bot=' + encodeURIComponent(bot) : ''));\n if(!contextExternal) {\n element.setAttribute('onclick', 'execBotCommand(this)');\n }\n }\n\n break;\n }\n\n case 'messageEntityCustomEmoji': {\n if(!IS_CUSTOM_EMOJI_SUPPORTED) {\n break;\n }\n\n while(nextEntity?._ === 'messageEntityEmoji' && nextEntity.offset < endOffset) {\n ++nasty.i;\n nasty.lastEntity = nextEntity;\n nasty.usedLength += nextEntity.length;\n nextEntity = entities[nasty.i + 1];\n }\n\n const customEmojiElement = element = CustomEmojiElement.create(entity.document_id);\n const {docId} = customEmojiElement;\n let set = customEmojis.get(docId);\n if(!set) customEmojis.set(docId, set = new Set());\n set.add(customEmojiElement);\n customEmojiElement.dataset.stickerEmoji = fullEntityText;\n\n if(options.wrappingDraft) {\n element = document.createElement('img');\n (element as HTMLImageElement).alt = fullEntityText;\n for(const i in customEmojiElement.dataset) {\n element.dataset[i] = customEmojiElement.dataset[i];\n }\n (element as any).customEmojiElement = customEmojiElement;\n customEmojiElement.placeholder = element as HTMLImageElement;\n element.classList.add('custom-emoji-placeholder');\n (element as HTMLImageElement).src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAtJREFUGFdjYAACAAAFAAGq1chRAAAAAElFTkSuQmCC';\n property = 'alt';\n break;\n }\n\n if(options.isSelectable) {\n // const s = document.createElement('span');\n // s.append(fullEntityText);\n // element.append(s);\n // element.textContent = fullEntityText;\n // element.textContent = 'a';\n // element.contentEditable = 'false';\n\n // const x = f();\n // x.style.display = 'inline-block';\n // x.contentEditable = 'false';\n // (lastElement || fragment).append(BOM);\n // (lastElement || fragment).append(x);\n\n element = wrapSomething(element, !!options.customEmojiRenderer);\n\n // const a = element;\n // element = document.createElement('span');\n // element.append(BOM, a, BOM);\n // element.contentEditable = 'false';\n }\n\n property = 'alt';\n break;\n }\n\n case 'messageEntityEmoji': {\n let isSupported = IS_EMOJI_SUPPORTED;\n if(isSupported) {\n for(const version in EmojiVersions) {\n if(version) {\n const emojiData = EmojiVersions[version as EMOJI_VERSION];\n if(emojiData.hasOwnProperty(entity.unicode) && !EMOJI_VERSIONS_SUPPORTED[version as EMOJI_VERSION]) {\n isSupported = false;\n break;\n }\n }\n }\n }\n\n // if(!(options.wrappingDraft && isSupported)) { // * fix safari emoji\n if(!isSupported) { // no wrapping needed\n // if(isSupported) { // ! contenteditable=\"false\" нужен для поля ввода, иначе там будет меняться шрифт в Safari, или же рендерить смайлик напрямую, без контейнера\n // insertPart(entity, '', '');\n // } else {\n element = document.createElement('img');\n (element as HTMLImageElement).src = `assets/img/emoji/${entity.unicode}.png`;\n property = 'alt';\n element.className = 'emoji';\n\n // if(options.isSelectable) {\n // usedText = true;\n // (element as HTMLImageElement).alt = partText;\n // element = wrapSomething(element);\n // }\n\n // const a = element;\n // a.contentEditable = 'false';\n // element = document.createElement('span');\n // element.append(a);\n // element.contentEditable = 'false';\n // }\n // } else if(options.mustWrapEmoji) {\n } else if(!options.wrappingDraft) {\n element = document.createElement('span');\n element.className = 'emoji';\n }/* else if(!IS_SAFARI) {\n insertPart(entity, '', '');\n } */\n /* if(!isSupported) {\n insertPart(entity, `\"`,`);\n } */\n\n break;\n }\n\n case 'messageEntityCaret': {\n element = document.createElement('span');\n element.className = 'composer-sel';\n break;\n }\n\n // case 'messageEntityLinebreak': {\n // if(options.noLinebreaks) {\n // insertPart(entity, ' ');\n // } else {\n // insertPart(entity, '
');\n // }\n\n // break;\n // }\n\n case 'messageEntityUrl':\n case 'messageEntityTextUrl': {\n if(!(options.noLinks && !passEntities[entity._])) {\n // let inner: string;\n let url: string = (entity as MessageEntity.messageEntityTextUrl).url || fullEntityText;\n let masked = false;\n let onclick: string;\n\n const wrapped = wrapUrl(url, true);\n url = wrapped.url;\n onclick = wrapped.onclick;\n\n if(entity._ === 'messageEntityTextUrl') {\n if(nextEntity?._ === 'messageEntityUrl' &&\n nextEntity.length === entity.length &&\n nextEntity.offset === entity.offset) {\n nasty.lastEntity = nextEntity;\n ++nasty.i;\n }\n\n if(url !== fullEntityText) {\n masked = true;\n }\n } else {\n // inner = encodeEntities(replaceUrlEncodings(entityText));\n }\n\n const currentContext = !!onclick;\n if(!onclick && masked && !currentContext) {\n onclick = 'showMaskedAlert';\n }\n\n if(options.wrappingDraft) {\n onclick = undefined;\n }\n\n const href = (currentContext || typeof electronHelpers === 'undefined') ?\n url :\n `javascript:electronHelpers.openExternal('${url}');`;\n\n element = document.createElement('a');\n element.className = 'anchor-url';\n (element as HTMLAnchorElement).href = href;\n\n if(!(currentContext || typeof electronHelpers !== 'undefined')) {\n setBlankToAnchor(element as HTMLAnchorElement);\n }\n\n if(onclick) {\n element.setAttribute('onclick', onclick + '(this)');\n }\n }\n\n break;\n }\n\n case 'messageEntityEmail': {\n if(!options.noLinks) {\n element = document.createElement('a');\n (element as HTMLAnchorElement).href = encodeEntities('mailto:' + fullEntityText);\n setBlankToAnchor(element as HTMLAnchorElement);\n }\n\n break;\n }\n\n case 'messageEntityHashtag': {\n const contextUrl = !options.noLinks && SITE_HASHTAGS[contextSite];\n if(contextUrl) {\n const hashtag = fullEntityText.slice(1);\n element = document.createElement('a');\n element.className = 'anchor-hashtag';\n (element as HTMLAnchorElement).href = contextUrl.replace('{1}', encodeURIComponent(hashtag));\n if(contextExternal) {\n setBlankToAnchor(element as HTMLAnchorElement);\n } else {\n element.setAttribute('onclick', 'searchByHashtag(this)');\n }\n }\n\n break;\n }\n\n case 'messageEntityMentionName': {\n if(!(options.noLinks && !passEntities[entity._])) {\n element = document.createElement('a');\n (element as HTMLAnchorElement).href = buildURLHash('' + entity.user_id);\n element.className = 'follow';\n element.dataset.follow = '' + entity.user_id;\n }\n\n break;\n }\n\n case 'messageEntityMention': {\n // const contextUrl = !options.noLinks && siteMentions[contextSite];\n if(!options.noLinks) {\n const username = fullEntityText.slice(1);\n\n element = wrapTelegramUrlToAnchor('t.me/' + username);\n element.className = 'mention';\n\n // insertPart(entity, ``, '');\n }\n\n break;\n }\n\n case 'messageEntitySpoiler': {\n if(options.noTextFormat) {\n const encoded = encodeSpoiler(nasty.text, entity);\n nasty.text = encoded.text;\n partText = encoded.entityText;\n if(endPartOffset !== endOffset) {\n nasty.usedLength += endOffset - endPartOffset;\n }\n let n: MessageEntity;\n for(; n = entities[nasty.i + 1], n && n.offset < endOffset;) {\n // nasty.usedLength += n.length;\n ++nasty.i;\n nasty.lastEntity = n;\n nextEntity = entities[nasty.i + 1];\n }\n } else if(options.wrappingDraft) {\n element = document.createElement('span');\n // element.style.fontFamily = 'spoiler';\n element.style.fontFamily = 'markup-spoiler';\n } else {\n const container = document.createElement('span');\n container.className = 'spoiler';\n element = document.createElement('span');\n element.className = 'spoiler-text';\n element.textContent = partText;\n usedText = true;\n container.append(element);\n fragment.append(container);\n\n container[`on${CLICK_EVENT_NAME}`] = (window as any).onSpoilerClick;\n }\n\n break;\n }\n\n case 'messageEntityTimestamp': {\n if(!options.maxMediaTimestamp || entity.time > options.maxMediaTimestamp) {\n break;\n }\n\n element = document.createElement('a');\n element.classList.add('timestamp');\n element.dataset.timestamp = '' + entity.time;\n (element as HTMLAnchorElement).href = '#';\n element.setAttribute('onclick', 'setMediaTimestamp(this)');\n\n break;\n }\n }\n\n if(!usedText && partText) {\n if(element) {\n // @ts-ignore\n element[property] = partText;\n } else {\n (element || fragment).append(partText);\n }\n }\n\n if(element && !element.parentNode) {\n (lastElement || fragment).append(element);\n }\n\n while(nextEntity && nextEntity.offset < endOffset) {\n ++nasty.i;\n\n (element || fragment).append(wrapRichText(nasty.text, {\n ...options,\n voodoo: true\n }));\n\n nextEntity = entities[nasty.i + 1];\n }\n\n // if(!element?.parentNode) {\n // (lastElement || fragment).append(element ?? partText);\n // }\n\n if(nasty.usedLength <= endOffset) {\n if(nasty.usedLength < endOffset) {\n (element || fragment).append(nasty.text.slice(nasty.usedLength, endOffset));\n nasty.usedLength = endOffset;\n }\n\n lastElement = fragment;\n nasty.lastEntity = undefined;\n } else if(entity.length > partText.length && element) {\n lastElement = element;\n } else {\n lastElement = fragment;\n }\n\n if(options.voodoo) {\n return fragment;\n }\n }\n\n if(nasty.lastEntity) {\n nasty.usedLength = nasty.lastEntity.offset + nasty.lastEntity.length;\n }\n\n if(nasty.usedLength < textLength) {\n (lastElement || fragment).append(nasty.text.slice(nasty.usedLength));\n }\n\n if((!options.wrappingDraft || options.customEmojiRenderer) && customEmojis.size) {\n let renderer = options.customEmojiRenderer;\n if(!renderer) {\n renderer = CustomEmojiRendererElement.create(options);\n fragment.prepend(renderer);\n }\n\n const loadPromise = renderer.add(customEmojis, options.lazyLoadQueue, options.wrappingDraft);\n options.loadPromises?.push(loadPromise);\n // recordPromise(loadPromise, 'render emojis: ' + docIds.length);\n }\n\n if(customWraps.size) {\n insertCustomFillers(customWraps);\n }\n\n return fragment;\n}\n\nexport const createCustomFiller = (notFiller?: boolean) => {\n const x = document.createElement('span');\n x.classList.add(notFiller ? 'input-filler2' : 'input-filler');\n x.textContent = BOM;\n return x;\n};\n\nexport function isCustomFillerNeededBySiblingNode(node: ChildNode) {\n if(\n // !node?.textContent ||\n // node.textContent.endsWith('\\n') ||\n node?.textContent !== BOM ||\n (node as HTMLElement)?.getAttribute?.('contenteditable') === 'false'\n ) {\n // if(!node || (node as HTMLElement).firstElementChild || node.textContent.endsWith('\\n')) {\n if(!node || node.textContent !== BOM || (node as HTMLElement).firstElementChild) {\n return 2;\n } else if(node.nodeType === node.ELEMENT_NODE) {\n return 1;\n }/* else if(node.nodeType === node.TEXT_NODE && !node.nodeValue) {\n (node as CharacterData).insertData(0, BOM);\n } */\n }\n\n return 0;\n}\n\nexport function insertCustomFillers(elements: Iterable) {\n const check = (element: HTMLElement, node: ChildNode, method: 'before' | 'after') => {\n const needed = isCustomFillerNeededBySiblingNode(node);\n if(needed === 2) {\n element[method](createCustomFiller());\n } else if(needed === 1) {\n node.appendChild(document.createTextNode(BOM));\n }\n };\n\n for(const element of elements) {\n const {previousSibling, nextSibling} = element;\n check(element, previousSibling, 'before');\n check(element, nextSibling, 'after');\n }\n}\n\n(window as any).wrapRichText = wrapRichText;\n","// just for the future\nexport default function buildURLHash(str: string) {\n return '#' + encodeURIComponent(str);\n}\n","import wrapUrl from './wrapUrl';\n\nexport default function wrapTelegramUrlToAnchor(url1: string) {\n const {url, onclick} = wrapUrl(url1);\n const element = document.createElement('a');\n (element as HTMLAnchorElement).href = url;\n if(onclick) {\n element.setAttribute('onclick', `${onclick}(this)`);\n }\n\n return element;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport CAN_USE_TRANSFERABLES from '../../environment/canUseTransferables';\nimport EventListenerBase from '../../helpers/eventListenerBase';\n\nexport default class QueryableWorker extends EventListenerBase<{\n ready: () => void,\n frame: (reqId: number, frameNo: number, frame: Uint8ClampedArray | ImageBitmap) => void,\n loaded: (reqId: number, frameCount: number, fps: number) => void,\n error: (reqId: number, error: Error) => void,\n workerError: (error: ErrorEvent) => void\n}> {\n constructor(private worker: Worker) {\n super();\n\n this.worker.onerror = (error) => {\n try {\n this.dispatchEvent('workerError', error);\n this.cleanup();\n this.terminate();\n } catch(err) {\n\n }\n };\n\n this.worker.onmessage = (event) => {\n this.dispatchEvent(event.data.queryMethodListener, ...event.data.queryMethodArguments);\n };\n }\n\n public postMessage(message: any) {\n this.worker.postMessage(message);\n }\n\n public terminate() {\n this.worker.terminate();\n }\n\n public sendQuery(args: any[], transfer?: Transferable[]) {\n this.worker.postMessage({\n queryMethod: args.shift(),\n queryMethodArguments: args\n }, CAN_USE_TRANSFERABLES ? transfer: undefined);\n }\n}\n","const IS_WEB_ASSEMBLY_SUPPORTED = typeof(WebAssembly) !== 'undefined';\n\nexport default IS_WEB_ASSEMBLY_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {LiteModeKey} from '../../helpers/liteMode';\nimport animationIntersector, {AnimationItemGroup} from '../../components/animationIntersector';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport pause from '../../helpers/schedulers/pause';\nimport {logger, LogTypes} from '../logger';\nimport RLottiePlayer, {RLottieOptions} from './rlottiePlayer';\nimport QueryableWorker from './queryableWorker';\nimport blobConstruct from '../../helpers/blob/blobConstruct';\nimport apiManagerProxy from '../mtproto/mtprotoworker';\nimport IS_WEB_ASSEMBLY_SUPPORTED from '../../environment/webAssemblySupport';\nimport makeError from '../../helpers/makeError';\nimport App from '../../config/app';\n\nexport type LottieAssetName = 'EmptyFolder' | 'Folders_1' | 'Folders_2' |\n 'TwoFactorSetupMonkeyClose' | 'TwoFactorSetupMonkeyCloseAndPeek' |\n 'TwoFactorSetupMonkeyCloseAndPeekToIdle' | 'TwoFactorSetupMonkeyIdle' |\n 'TwoFactorSetupMonkeyPeek' | 'TwoFactorSetupMonkeyTracking' |\n 'voice_outlined2' | 'voip_filled' | 'voice_mini' | 'jolly_roger';\n\nexport class LottieLoader {\n private loadPromise: Promise = !IS_WEB_ASSEMBLY_SUPPORTED ? Promise.reject() : undefined;\n private loaded = false;\n\n private workersLimit = App.threads;\n private players: {[reqId: number]: RLottiePlayer} = {};\n private playersByCacheName: {[cacheName: string]: Set} = {};\n\n private workers: QueryableWorker[] = [];\n private curWorkerNum = 0;\n\n private log = logger('LOTTIE', LogTypes.Error);\n\n public getAnimation(element: HTMLElement) {\n for(const i in this.players) {\n if(this.players[i].el.includes(element)) {\n return this.players[i];\n }\n }\n\n return null;\n }\n\n public loadLottieWorkers() {\n if(this.loadPromise) {\n return this.loadPromise;\n }\n\n return this.loadPromise = new Promise((resolve, reject) => {\n let remain = this.workersLimit;\n for(let i = 0; i < this.workersLimit; ++i) {\n const worker = new Worker(new URL('./rlottie.worker.ts', import.meta.url));\n const queryableWorker = this.workers[i] = new QueryableWorker(worker);\n\n queryableWorker.addEventListener('ready', () => {\n this.log('worker #' + i + ' ready');\n\n queryableWorker.addEventListener('frame', this.onFrame);\n queryableWorker.addEventListener('loaded', this.onPlayerLoaded);\n queryableWorker.addEventListener('error', this.onPlayerError);\n\n --remain;\n if(!remain) {\n this.log('workers ready');\n resolve();\n this.loaded = true;\n }\n }, {once: true});\n\n queryableWorker.addEventListener('workerError', (error) => {\n reject('rlottie load error: ' + error.message);\n this.loaded = false;\n }, {once: true});\n }\n });\n }\n\n private makeAssetUrl(name: LottieAssetName) {\n return 'assets/tgs/' + name + '.json';\n }\n\n public loadAnimationAsAsset(params: Omit, name: LottieAssetName) {\n // (params as RLottieOptions).name = name;\n return this.loadAnimationFromURL(params, this.makeAssetUrl(name));\n }\n\n public loadAnimationDataFromURL(url: string): Promise {\n if(!IS_WEB_ASSEMBLY_SUPPORTED) {\n return this.loadPromise as any;\n }\n\n this.loadLottieWorkers();\n\n return fetch(url)\n .then((res) => {\n if(!res.headers || res.headers.get('content-type') === 'application/octet-stream') {\n return res.arrayBuffer()\n .then((data) => apiManagerProxy.invokeCrypto('gzipUncompress', data))\n .then((arr) => blobConstruct(arr as Uint8Array, ''));\n } else {\n return res.blob();\n }\n });\n /* .then((str) => {\n return new Promise((resolve) => setTimeout(() => resolve(str), 2e3));\n }) */\n }\n\n public loadAnimationFromURLManually(name: LottieAssetName) {\n const url = this.makeAssetUrl(name);\n return this.loadAnimationDataFromURL(url).then((blob) => {\n return (params: Omit) => this.loadAnimationFromURLNext(blob, params, url);\n });\n }\n\n public loadAnimationFromURL(params: Omit, url: string) {\n return this.loadAnimationDataFromURL(url).then((blob) => {\n return this.loadAnimationFromURLNext(blob, params, url);\n });\n }\n\n public loadAnimationFromURLNext(blob: Blob, params: Omit, url: string) {\n const newParams = Object.assign(params, {animationData: blob, needUpscale: true});\n newParams.name ||= url;\n return this.loadAnimationWorker(newParams);\n }\n\n public waitForFirstFrame(player: RLottiePlayer) {\n return Promise.race([\n /* new Promise((resolve) => {\n player.addEventListener('firstFrame', () => {\n setTimeout(() => resolve(), 1500);\n }, true);\n }) */\n new Promise((resolve) => {\n player.addEventListener('firstFrame', resolve, {once: true});\n }),\n pause(2500)\n ]).then(() => player);\n }\n\n public async loadAnimationWorker(params: RLottieOptions): Promise {\n if(!IS_WEB_ASSEMBLY_SUPPORTED) {\n return this.loadPromise as any;\n }\n\n if(!this.loaded) {\n await this.loadLottieWorkers();\n }\n\n const {middleware, group = ''} = params;\n if(middleware && !middleware()) {\n throw makeError('MIDDLEWARE');\n }\n\n if(params.sync) {\n const cacheName = RLottiePlayer.CACHE.generateName(params.name, params.width, params.height, params.color, params.toneIndex);\n const players = this.playersByCacheName[cacheName];\n if(players?.size) {\n return Promise.resolve(players.entries().next().value[0]);\n }\n }\n\n const containers = Array.isArray(params.container) ? params.container : [params.container];\n if(!params.width || !params.height) {\n params.width = parseInt(containers[0].style.width);\n params.height = parseInt(containers[0].style.height);\n }\n\n if(!params.width || !params.height) {\n throw new Error('No size for sticker!');\n }\n\n params.group = group;\n\n const player = this.initPlayer(containers, params);\n\n animationIntersector.addAnimation({\n animation: player,\n group,\n controlled: middleware,\n liteModeKey: params.liteModeKey\n });\n\n return player;\n }\n\n private onPlayerLoaded = (reqId: number, frameCount: number, fps: number) => {\n const player = this.players[reqId];\n if(!player) {\n this.log.warn('onPlayerLoaded on destroyed player:', reqId, frameCount);\n return;\n }\n\n this.log.debug('onPlayerLoaded');\n player.onLoad(frameCount, fps);\n };\n\n private onFrame = (reqId: number, frameNo: number, frame: Uint8ClampedArray | ImageBitmap) => {\n const player = this.players[reqId];\n if(!player) {\n this.log.warn('onFrame on destroyed player:', reqId, frameNo);\n return;\n }\n\n if(player.clamped !== undefined && frame instanceof Uint8ClampedArray) {\n player.clamped = frame;\n }\n\n player.renderFrame(frame, frameNo);\n };\n\n private onPlayerError = (reqId: number, error: Error) => {\n const player = this.players[reqId];\n if(!player) {\n return;\n }\n\n // ! will need refactoring later, this is not the best way to remove the animation\n const animations = animationIntersector.getAnimations(player.el[0]);\n animations.forEach((animation) => {\n animationIntersector.removeAnimation(animation);\n });\n };\n\n public onDestroy(reqId: number) {\n delete this.players[reqId];\n }\n\n public destroyWorkers() {\n if(!IS_WEB_ASSEMBLY_SUPPORTED) {\n return;\n }\n\n this.workers.forEach((worker, idx) => {\n worker.terminate();\n this.log('worker #' + idx + ' terminated');\n });\n\n this.log('workers destroyed');\n this.workers.length = 0;\n this.curWorkerNum = 0;\n this.loaded = false;\n this.loadPromise = undefined;\n }\n\n private initPlayer(el: RLottiePlayer['el'], options: RLottieOptions) {\n const player = new RLottiePlayer({\n el,\n worker: this.workers[this.curWorkerNum++],\n options\n });\n\n const {reqId, cacheName} = player;\n this.players[reqId] = player;\n\n const playersByCacheName = cacheName ? this.playersByCacheName[cacheName] ??= new Set() : undefined;\n if(cacheName) {\n playersByCacheName.add(player);\n }\n\n if(this.curWorkerNum >= this.workers.length) {\n this.curWorkerNum = 0;\n }\n\n player.addEventListener('destroy', () => {\n this.onDestroy(reqId);\n if(playersByCacheName.delete(player) && !playersByCacheName.size) {\n delete this.playersByCacheName[cacheName];\n }\n });\n\n player.loadFromData(options.animationData);\n\n return player;\n }\n}\n\nconst lottieLoader = new LottieLoader();\nMOUNT_CLASS_TO.lottieLoader = lottieLoader;\nexport default lottieLoader;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AnimationItemGroup, AnimationItemWrapper} from '../../components/animationIntersector';\nimport type {Middleware} from '../../helpers/middleware';\nimport type {LiteModeKey} from '../../helpers/liteMode';\nimport CAN_USE_TRANSFERABLES from '../../environment/canUseTransferables';\nimport IS_APPLE_MX from '../../environment/appleMx';\nimport {IS_ANDROID, IS_APPLE_MOBILE, IS_APPLE, IS_SAFARI} from '../../environment/userAgent';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport mediaSizes from '../../helpers/mediaSizes';\nimport clamp from '../../helpers/number/clamp';\nimport QueryableWorker from './queryableWorker';\nimport IS_IMAGE_BITMAP_SUPPORTED from '../../environment/imageBitmapSupport';\nimport framesCache, {FramesCache, FramesCacheItem} from '../../helpers/framesCache';\n\nexport type RLottieOptions = {\n container: HTMLElement | HTMLElement[],\n middleware?: Middleware,\n canvas?: HTMLCanvasElement,\n autoplay?: boolean,\n animationData: Blob,\n loop?: RLottiePlayer['loop'],\n width?: number,\n height?: number,\n group?: AnimationItemGroup,\n noCache?: boolean,\n needUpscale?: boolean,\n skipRatio?: number,\n initFrame?: number, // index\n color?: RLottieColor,\n inverseColor?: RLottieColor,\n name?: string,\n skipFirstFrameRendering?: boolean,\n toneIndex?: number,\n sync?: boolean,\n liteModeKey?: LiteModeKey\n};\n\nexport type RLottieColor = [number, number, number];\n\nexport function getLottiePixelRatio(width: number, height: number, needUpscale?: boolean) {\n let pixelRatio = clamp(window.devicePixelRatio, 1, 2);\n if(pixelRatio > 1 && !needUpscale) {\n if(width > 90 && height > 90) {\n if(!IS_APPLE && mediaSizes.isMobile) {\n pixelRatio = 1;\n }\n } else if((width > 60 && height > 60) || IS_ANDROID) {\n pixelRatio = Math.max(1.5, pixelRatio - 1.5);\n }\n }\n\n return pixelRatio;\n}\n\nexport default class RLottiePlayer extends EventListenerBase<{\n enterFrame: (frameNo: number) => void,\n ready: () => void,\n firstFrame: () => void,\n cached: () => void,\n destroy: () => void\n}> implements AnimationItemWrapper {\n public static CACHE = framesCache;\n private static reqId = 0;\n\n public reqId = 0;\n public curFrame: number;\n private frameCount: number;\n private fps: number;\n private skipDelta: number;\n public name: string;\n public cacheName: string;\n private toneIndex: number;\n\n private worker: QueryableWorker;\n\n private width = 0;\n private height = 0;\n\n public el: HTMLElement[];\n public canvas: HTMLCanvasElement[];\n private contexts: CanvasRenderingContext2D[];\n\n public paused = true;\n // public paused = false;\n public direction = 1;\n private speed = 1;\n public autoplay = true;\n public _autoplay: boolean; // ! will be used to store original value for settings.stickers.loop\n public loop: number | boolean = true;\n public _loop: RLottiePlayer['loop']; // ! will be used to store original value for settings.stickers.loop\n public group: AnimationItemGroup = '';\n public liteModeKey: LiteModeKey;\n\n private frInterval: number;\n private frThen: number;\n private rafId: number;\n\n // private caching = false;\n // private removed = false;\n\n private cache: FramesCacheItem;\n private imageData: ImageData;\n public clamped: Uint8ClampedArray;\n private cachingDelta = 0;\n\n private initFrame: number;\n private color: RLottieColor;\n private inverseColor: RLottieColor;\n\n public minFrame: number;\n public maxFrame: number;\n\n private playedTimes = 0;\n\n private currentMethod: RLottiePlayer['mainLoopForwards'] | RLottiePlayer['mainLoopBackwards'];\n private frameListener: (currentFrame: number) => void;\n private skipFirstFrameRendering: boolean;\n private playToFrameOnFrameCallback: (frameNo: number) => void;\n\n public overrideRender: (frame: ImageData | HTMLCanvasElement | ImageBitmap) => void;\n private renderedFirstFrame: boolean;\n\n private raw: boolean;\n\n constructor({el, worker, options}: {\n el: RLottiePlayer['el'],\n worker: QueryableWorker,\n options: RLottieOptions\n }) {\n super(true);\n\n this.reqId = ++RLottiePlayer['reqId'];\n this.el = el;\n this.worker = worker;\n\n for(const i in options) {\n if(this.hasOwnProperty(i)) {\n // @ts-ignore\n this[i] = options[i];\n }\n }\n\n this._loop = this.loop;\n this._autoplay = this.autoplay;\n\n // ! :(\n this.initFrame = options.initFrame;\n this.color = options.color;\n this.inverseColor = options.inverseColor;\n this.name = options.name;\n this.skipFirstFrameRendering = options.skipFirstFrameRendering;\n this.toneIndex = options.toneIndex;\n this.raw = this.color !== undefined;\n this.liteModeKey = options.liteModeKey;\n\n if(this.name) {\n this.cacheName = RLottiePlayer.CACHE.generateName(this.name, this.width, this.height, this.color, this.toneIndex);\n }\n\n // * Skip ratio (30fps)\n let skipRatio: number;\n if(options.skipRatio !== undefined) skipRatio = options.skipRatio;\n else if((IS_ANDROID || IS_APPLE_MOBILE || (IS_APPLE && !IS_SAFARI && !IS_APPLE_MX)) && this.width < 100 && this.height < 100 && !options.needUpscale) {\n skipRatio = 0.5;\n }\n\n this.skipDelta = skipRatio !== undefined ? 1 / skipRatio | 0 : 1;\n\n // options.needUpscale = true;\n\n // * Pixel ratio\n const pixelRatio = getLottiePixelRatio(this.width, this.height, options.needUpscale);\n\n this.width = Math.round(this.width * pixelRatio);\n this.height = Math.round(this.height * pixelRatio);\n\n // options.noCache = true;\n\n // * Cache frames params\n if(!options.noCache/* && false */) {\n // проверка на размер уже после скейлинга, сделано для попапа и сайдбара, где стикеры 80х80 и 68х68, туда нужно 75%\n if(IS_APPLE && this.width > 100 && this.height > 100) {\n this.cachingDelta = 2; // 2 // 50%\n } else if(this.width < 100 && this.height < 100) {\n this.cachingDelta = Infinity; // 100%\n } else {\n this.cachingDelta = 4; // 75%\n }\n }\n\n // this.cachingDelta = Infinity;\n // this.cachingDelta = 0;\n // if(isApple) {\n // this.cachingDelta = 0; //2 // 50%\n // }\n\n if(!this.canvas) {\n this.canvas = this.el.map(() => {\n const canvas = document.createElement('canvas');\n canvas.classList.add('rlottie');\n canvas.width = this.width;\n canvas.height = this.height;\n canvas.dpr = pixelRatio;\n return canvas;\n });\n }\n\n this.contexts = this.canvas.map((canvas) => canvas.getContext('2d'));\n\n if(!IS_IMAGE_BITMAP_SUPPORTED || this.raw) {\n this.imageData = new ImageData(this.width, this.height);\n\n if(CAN_USE_TRANSFERABLES) {\n this.clamped = new Uint8ClampedArray(this.width * this.height * 4);\n }\n }\n\n if(this.name) {\n this.cache = RLottiePlayer.CACHE.getCache(this.cacheName);\n } else {\n this.cache = FramesCache.createCache();\n }\n }\n\n public clearCache() {\n if(this.cachingDelta === Infinity) {\n return;\n }\n\n if(this.cacheName && this.cache.counter > 1) { // skip clearing because same sticker can be still visible\n return;\n }\n\n this.cache.clearCache();\n }\n\n public sendQuery(args: any[], transfer?: Transferable[]) {\n this.worker.sendQuery([args.shift(), this.reqId, ...args], transfer);\n }\n\n public loadFromData(data: RLottieOptions['animationData']) {\n this.sendQuery(['loadFromData', data, this.width, this.height, this.toneIndex, this.color !== undefined/* , this.canvas.transferControlToOffscreen() */]);\n }\n\n public play() {\n if(!this.paused) {\n return;\n }\n\n this.paused = false;\n this.setMainLoop();\n }\n\n public pause(clearPendingRAF = true) {\n if(this.paused) {\n return;\n }\n\n this.paused = true;\n if(clearPendingRAF) {\n clearTimeout(this.rafId);\n this.rafId = undefined;\n }\n // window.cancelAnimationFrame(this.rafId);\n }\n\n private resetCurrentFrame() {\n return this.curFrame = this.initFrame ?? (this.direction === 1 ? this.minFrame : this.maxFrame);\n }\n\n public stop(renderFirstFrame = true) {\n this.pause();\n\n const curFrame = this.resetCurrentFrame();\n if(renderFirstFrame) {\n this.requestFrame(curFrame);\n // this.sendQuery('renderFrame', this.curFrame);\n }\n }\n\n public restart() {\n this.stop(false);\n this.play();\n }\n\n public playOrRestart() {\n if(!this.paused) {\n return;\n }\n\n if(this.curFrame === this.maxFrame) {\n this.restart();\n } else {\n this.play();\n }\n }\n\n public setSpeed(speed: number) {\n if(this.speed === speed) {\n return;\n }\n\n this.speed = speed;\n\n if(!this.paused) {\n this.setMainLoop();\n }\n }\n\n public setDirection(direction: number) {\n if(this.direction === direction) {\n return;\n }\n\n this.direction = direction;\n\n if(!this.paused) {\n this.setMainLoop();\n }\n }\n\n public remove() {\n this.pause();\n this.sendQuery(['destroy']);\n if(this.cacheName) RLottiePlayer.CACHE.releaseCache(this.cacheName);\n this.dispatchEvent('destroy');\n this.cleanup();\n }\n\n private applyColor(frame: Uint8ClampedArray) {\n const [r, g, b] = this.color;\n for(let i = 0, length = frame.length; i < length; i += 4) {\n if(frame[i + 3] !== 0) {\n frame[i] = r;\n frame[i + 1] = g;\n frame[i + 2] = b;\n }\n }\n }\n\n private applyInversing(frame: Uint8ClampedArray) {\n const [r, g, b] = this.inverseColor;\n for(let i = 0, length = frame.length; i < length; i += 4) {\n if(frame[i + 3] === 0) {\n frame[i] = r;\n frame[i + 1] = g;\n frame[i + 2] = b;\n frame[i + 3] = 255;\n } else {\n frame[i + 3] = 0;\n }\n }\n }\n\n public renderFrame2(frame: Uint8ClampedArray | HTMLCanvasElement | ImageBitmap, frameNo: number) {\n /* this.setListenerResult('enterFrame', frameNo);\n return; */\n\n try {\n if(frame instanceof Uint8ClampedArray) {\n if(this.color) {\n this.applyColor(frame);\n }\n\n if(this.inverseColor) {\n this.applyInversing(frame);\n }\n\n this.imageData.data.set(frame);\n }\n\n // this.context.putImageData(new ImageData(frame, this.width, this.height), 0, 0);\n this.contexts.forEach((context, idx) => {\n let cachedSource: HTMLCanvasElement | ImageBitmap = this.cache.framesNew.get(frameNo);\n if(!(frame instanceof Uint8ClampedArray)) {\n cachedSource = frame;\n } else if(idx > 0) {\n cachedSource = this.canvas[0];\n }\n\n if(!cachedSource) {\n // console.log('drawing from data');\n const c = document.createElement('canvas');\n c.width = context.canvas.width;\n c.height = context.canvas.height;\n c.getContext('2d').putImageData(this.imageData, 0, 0);\n this.cache.framesNew.set(frameNo, c);\n cachedSource = c;\n }\n\n if(this.overrideRender && this.renderedFirstFrame) {\n this.overrideRender(cachedSource || this.imageData);\n } else if(cachedSource) {\n // console.log('drawing from canvas');\n context.clearRect(0, 0, cachedSource.width, cachedSource.height);\n context.drawImage(cachedSource, 0, 0);\n } else {\n context.putImageData(this.imageData, 0, 0);\n }\n\n if(!this.renderedFirstFrame) {\n this.renderedFirstFrame = true;\n }\n });\n\n this.dispatchEvent('enterFrame', frameNo);\n } catch(err) {\n console.error('RLottiePlayer renderFrame error:', err/* , frame */, this.width, this.height);\n this.autoplay = false;\n this.pause();\n }\n }\n\n public renderFrame(frame: Parameters[0], frameNo: number) {\n const canCacheFrame = this.cachingDelta && (frameNo % this.cachingDelta || !frameNo);\n if(canCacheFrame) {\n if(frame instanceof Uint8ClampedArray && !this.cache.frames.has(frameNo)) {\n this.cache.frames.set(frameNo, new Uint8ClampedArray(frame));// frame;\n } else if(IS_IMAGE_BITMAP_SUPPORTED && frame instanceof ImageBitmap && !this.cache.framesNew.has(frameNo)) {\n this.cache.framesNew.set(frameNo, frame);\n }\n }\n\n /* if(!this.listenerResults.hasOwnProperty('cached')) {\n this.setListenerResult('enterFrame', frameNo);\n if(frameNo === (this.frameCount - 1)) {\n this.setListenerResult('cached');\n }\n\n return;\n } */\n\n if(this.frInterval) {\n const now = Date.now(), delta = now - this.frThen;\n\n if(delta < 0) {\n const timeout = this.frInterval > -delta ? -delta % this.frInterval : this.frInterval;\n if(this.rafId) clearTimeout(this.rafId);\n this.rafId = window.setTimeout(() => {\n this.renderFrame2(frame, frameNo);\n }, timeout);\n // await new Promise((resolve) => setTimeout(resolve, -delta % this.frInterval));\n return;\n }\n }\n\n this.renderFrame2(frame, frameNo);\n }\n\n public requestFrame(frameNo: number) {\n const frame = this.cache.frames.get(frameNo);\n const frameNew = this.cache.framesNew.get(frameNo);\n if(frameNew) {\n this.renderFrame(frameNew, frameNo);\n } else if(frame) {\n this.renderFrame(frame, frameNo);\n } else {\n if(this.clamped && !this.clamped.length) { // fix detached\n this.clamped = new Uint8ClampedArray(this.width * this.height * 4);\n }\n\n this.sendQuery(['renderFrame', frameNo], this.clamped ? [this.clamped.buffer] : undefined);\n }\n }\n\n private onLap() {\n if(++this.playedTimes === this.loop) {\n this.loop = false;\n }\n\n if(!this.loop) {\n this.pause(false);\n return false;\n }\n\n return true;\n }\n\n private mainLoopForwards() {\n const {skipDelta, maxFrame} = this;\n const frame = (this.curFrame + skipDelta) > maxFrame ? this.curFrame = (this.loop ? this.minFrame : this.maxFrame) : this.curFrame += skipDelta;\n // console.log('mainLoopForwards', this.curFrame, skipDelta, frame);\n\n this.requestFrame(frame);\n if((frame + skipDelta) > maxFrame) {\n return this.onLap();\n }\n\n return true;\n }\n\n private mainLoopBackwards() {\n const {skipDelta, minFrame} = this;\n const frame = (this.curFrame - skipDelta) < minFrame ? this.curFrame = (this.loop ? this.maxFrame : this.minFrame) : this.curFrame -= skipDelta;\n // console.log('mainLoopBackwards', this.curFrame, skipDelta, frame);\n\n this.requestFrame(frame);\n if((frame - skipDelta) < minFrame) {\n return this.onLap();\n }\n\n return true;\n }\n\n public setMainLoop() {\n // window.cancelAnimationFrame(this.rafId);\n clearTimeout(this.rafId);\n this.rafId = undefined;\n\n this.frInterval = 1000 / this.fps / this.speed * this.skipDelta;\n this.frThen = Date.now() - this.frInterval;\n\n // console.trace('setMainLoop', this.frInterval, this.direction, this, JSON.stringify(this.listenerResults), this.listenerResults);\n\n const method = (this.direction === 1 ? this.mainLoopForwards : this.mainLoopBackwards).bind(this);\n this.currentMethod = method;\n // this.frameListener && this.removeListener('enterFrame', this.frameListener);\n\n // setTimeout(() => {\n // this.addListener('enterFrame', this.frameListener);\n // }, 0);\n\n if(this.frameListener) {\n const lastResult = this.listenerResults.enterFrame;\n if(lastResult !== undefined) {\n this.frameListener(this.curFrame);\n }\n }\n\n // this.mainLoop(method);\n // this.r(method);\n // method();\n }\n\n public playPart(options: {\n from: number,\n to: number,\n callback?: () => void\n }) {\n this.pause();\n\n const {from, to, callback} = options;\n this.curFrame = from - 1;\n\n return this.playToFrame({\n frame: to,\n direction: to > from ? 1 : -1,\n callback\n });\n }\n\n public playToFrame(options: {\n frame: number,\n speed?: number,\n direction?: number,\n callback?: () => void\n }) {\n this.pause();\n\n const {frame, speed, callback, direction} = options;\n this.setDirection(direction === undefined ? this.curFrame > frame ? -1 : 1 : direction);\n speed !== undefined && this.setSpeed(speed);\n\n const bounds = [this.curFrame, frame];\n if(this.direction === -1) bounds.reverse();\n\n this.loop = false;\n this.setMinMax(bounds[0], bounds[1]);\n\n if(this.playToFrameOnFrameCallback) {\n this.removeEventListener('enterFrame', this.playToFrameOnFrameCallback);\n }\n\n if(callback) {\n this.playToFrameOnFrameCallback = (frameNo: number) => {\n if(frameNo === frame) {\n this.removeEventListener('enterFrame', this.playToFrameOnFrameCallback);\n callback();\n }\n };\n\n this.addEventListener('enterFrame', this.playToFrameOnFrameCallback);\n }\n\n this.play();\n }\n\n public setColor(color: RLottieColor, renderIfPaused: boolean) {\n this.color = color;\n\n if(renderIfPaused && this.paused) {\n this.renderFrame2(this.imageData.data, this.curFrame);\n }\n }\n\n public setInverseColor(color: RLottieColor) {\n this.inverseColor = color;\n }\n\n private setMinMax(minFrame = 0, maxFrame = this.frameCount - 1) {\n this.minFrame = minFrame;\n this.maxFrame = maxFrame;\n }\n\n public async onLoad(frameCount: number, fps: number) {\n this.frameCount = frameCount;\n this.fps = fps;\n this.setMinMax();\n if(this.initFrame !== undefined) {\n this.initFrame = clamp(this.initFrame, this.minFrame, this.maxFrame);\n }\n\n const curFrame = this.resetCurrentFrame();\n\n // * Handle 30fps stickers if 30fps set\n if(this.fps < 60 && this.skipDelta !== 1) {\n const diff = 60 / fps;\n this.skipDelta = this.skipDelta / diff | 0;\n }\n\n this.frInterval = 1000 / this.fps / this.speed * this.skipDelta;\n this.frThen = Date.now() - this.frInterval;\n // this.sendQuery('renderFrame', 0);\n\n // Кешировать сразу не получится, рендер стикера (тайгер) занимает 519мс,\n // если рендерить 75% с получением каждого кадра из воркера, будет 475мс, т.е. при 100% было бы 593мс, потеря на передаче 84мс.\n\n /* console.time('cache' + this.reqId);\n for(let i = 0; i < frameCount; ++i) {\n //if(this.removed) return;\n\n if(i % 4) {\n await new Promise((resolve) => {\n delete this.listenerResults.enterFrame;\n this.addListener('enterFrame', resolve, true);\n this.requestFrame(i);\n });\n }\n }\n\n console.timeEnd('cache' + this.reqId); */\n // console.log('cached');\n /* this.el.innerHTML = '';\n this.el.append(this.canvas);\n return; */\n\n !this.skipFirstFrameRendering && this.requestFrame(curFrame);\n this.dispatchEvent('ready');\n this.addEventListener('enterFrame', () => {\n this.dispatchEvent('firstFrame');\n\n if(!this.canvas[0].parentNode && this.el && !this.overrideRender) {\n this.el.forEach((container, idx) => container.append(this.canvas[idx]));\n }\n\n // console.log('enterFrame firstFrame');\n\n // let lastTime = this.frThen;\n this.frameListener = () => {\n if(this.paused || !this.currentMethod) {\n return;\n }\n\n const time = Date.now();\n // console.log(`enterFrame handle${this.reqId}`, time, (time - lastTime), this.frInterval);\n /* if(Math.round(time - lastTime + this.frInterval * 0.25) < Math.round(this.frInterval)) {\n return;\n } */\n\n // lastTime = time;\n\n this.frThen = time + this.frInterval;\n const canContinue = this.currentMethod();\n if(!canContinue && !this.loop && this.autoplay) {\n this.autoplay = false;\n }\n };\n\n this.addEventListener('enterFrame', this.frameListener);\n // setInterval(this.frameListener, this.frInterval);\n\n // ! fix autoplaying since there will be no animationIntersector for it\n if(this.group === 'none' && this.autoplay) {\n this.play();\n }\n }, {once: true});\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Page from './page';\nimport lottieLoader from '../lib/rlottie/lottieLoader';\nimport {horizontalMenu} from '../components/horizontalMenu';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport fastSmoothScroll from '../helpers/fastSmoothScroll';\nimport whichChild from '../helpers/dom/whichChild';\n\nclass PagesManager {\n private pageId = -1;\n private page: Page;\n\n private selectTab: ReturnType;\n public pagesDiv: HTMLDivElement;\n public scrollableDiv: HTMLElement;\n\n constructor() {\n this.pagesDiv = document.getElementById('auth-pages') as HTMLDivElement;\n this.scrollableDiv = this.pagesDiv.querySelector('.scrollable') as HTMLElement;\n this.selectTab = horizontalMenu(null, this.scrollableDiv.querySelector('.tabs-container') as HTMLDivElement, null, () => {\n if(this.page?.onShown) {\n this.page.onShown();\n }\n });\n }\n\n public setPage(page: Page) {\n if(page.isAuthPage) {\n this.pagesDiv.style.display = '';\n\n const id = whichChild(page.pageEl);\n if(this.pageId === id) return;\n\n this.selectTab(id);\n\n if(this.pageId !== -1 && id > 1) {\n lottieLoader.loadLottieWorkers();\n }\n\n\n this.pageId = id;\n\n if(this.scrollableDiv) {\n fastSmoothScroll({\n container: this.scrollableDiv,\n element: this.scrollableDiv.firstElementChild as HTMLElement,\n position: 'start'\n });\n }\n } else {\n this.pagesDiv.style.display = 'none';\n page.pageEl.style.display = '';\n\n this.pageId = -1;\n }\n\n this.page = page;\n }\n}\n\nconst pagesManager = new PagesManager();\nMOUNT_CLASS_TO.pagesManager = pagesManager;\nexport default pagesManager;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport pagesManager from './pagesManager';\n\nexport default class Page {\n public pageEl: HTMLDivElement;\n private installed = false;\n\n constructor(\n className: string,\n public isAuthPage: boolean,\n private onFirstMount?: (...args: any[]) => Promise | void,\n private onMount?: (...args: any[]) => Promise | void,\n public onShown?: () => void\n ) {\n this.pageEl = document.body.querySelector('.' + className) as HTMLDivElement;\n }\n\n public async mount(...args: any[]) {\n // this.pageEl.style.display = '';\n\n if(this.onMount) {\n const res = this.onMount(...args);\n if(res instanceof Promise) {\n await res;\n }\n }\n\n if(!this.installed) {\n if(this.onFirstMount) {\n try {\n const res = this.onFirstMount(...args);\n if(res instanceof Promise) {\n await res;\n }\n } catch(err) {\n console.error('PAGE MOUNT ERROR:', err);\n }\n }\n\n this.installed = true;\n }\n\n pagesManager.setPage(this);\n }\n}\n","// https://github.com/twitter/twemoji-parser/blob/master/src/lib/regex.js\n\nexport function encodeEmoji(emojiText: string) {\n const codepoints = toCodePoints(removeVS16s(emojiText)).join('-');\n return codepoints;\n}\n\nconst vs16RegExp = /\\uFE0F/g;\n// avoid using a string literal like '\\u200D' here because minifiers expand it inline\nconst zeroWidthJoiner = String.fromCharCode(0x200d);\n\nconst removeVS16s = (rawEmoji: string) => (rawEmoji.indexOf(zeroWidthJoiner) < 0 ? rawEmoji.replace(vs16RegExp, '') : rawEmoji);\n\nexport function toCodePoints(unicodeSurrogates: string): Array {\n const points = [];\n let char = 0;\n let previous = 0;\n let i = 0;\n while(i < unicodeSurrogates.length) {\n char = unicodeSurrogates.charCodeAt(i++);\n if(previous) {\n points.push((0x10000 + ((previous - 0xd800) << 10) + (char - 0xdc00)).toString(16));\n previous = 0;\n } else if(char > 0xd800 && char <= 0xdbff) {\n previous = char;\n } else {\n points.push(char.toString(16));\n }\n }\n\n if(points.length && points[0].length === 2) {\n points[0] = '00' + points[0];\n }\n\n return points;\n}\n\nexport function getEmojiToneIndex(input: string) {\n const match = input.match(/[\\uDFFB-\\uDFFF]/);\n return match ? 5 - (57343 - match[0].charCodeAt(0)) : 0;\n}\n\nconst VIRTUAL_COUNTRIES_EMOJIS: Map = new Map([\n ['FT', '🏴‍☠']\n]);\n\nexport function getCountryEmoji(iso2: string) {\n return VIRTUAL_COUNTRIES_EMOJIS.get(iso2) ??\n String.fromCharCode(55356, 56741 + iso2.charCodeAt(0), 55356, 56741 + iso2.charCodeAt(1));\n}\n\nexport function emojiFromCodePoints(codePoints: string) {\n return codePoints.split('-').reduce((prev, curr) => prev + String.fromCodePoint(parseInt(curr, 16)), '');\n}\n","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.Recorder=t():e.Recorder=t()}(\"undefined\"!=typeof self?self:this,(function(){return function(e){var t={};function o(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,i){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},o.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var n in e)o.d(i,n,function(t){return e[t]}.bind(null,n));return i},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,\"a\",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p=\"\",o(o.s=0)}([function(e,t,o){\"use strict\";(function(t){var o=t.AudioContext||t.webkitAudioContext,i=function(e){if(!i.isRecordingSupported())throw new Error(\"Recording is not supported in this browser\");e||(e={}),this.state=\"inactive\",this.config=Object.assign({bufferLength:4096,encoderApplication:2049,encoderFrameSize:20,encoderPath:\"encoderWorker.min.js\",encoderSampleRate:48e3,maxFramesPerPage:40,mediaTrackConstraints:!0,monitorGain:0,numberOfChannels:1,recordingGain:1,resampleQuality:3,streamPages:!1,reuseWorker:!1,wavBitDepth:16},e),this.encodedSamplePosition=0};i.isRecordingSupported=function(){return o&&t.navigator&&t.navigator.mediaDevices&&t.navigator.mediaDevices.getUserMedia&&t.WebAssembly},i.prototype.clearStream=function(){this.stream&&(this.stream.getTracks?this.stream.getTracks().forEach((function(e){e.stop()})):this.stream.stop(),delete this.stream),this.audioContext&&this.closeAudioContext&&(this.audioContext.close(),delete this.audioContext)},i.prototype.encodeBuffers=function(e){if(\"recording\"===this.state){for(var t=[],o=0;o{this.encodeBuffers(e.inputBuffer)},this.monitorGainNode=this.audioContext.createGain(),this.setMonitorGain(this.config.monitorGain),this.monitorGainNode.connect(this.audioContext.destination),this.recordingGainNode=this.audioContext.createGain(),this.setRecordingGain(this.config.recordingGain),this.recordingGainNode.connect(this.scriptProcessorNode)},i.prototype.initSourceNode=function(e){return e&&e.context?t.Promise.resolve(e):t.navigator.mediaDevices.getUserMedia({audio:this.config.mediaTrackConstraints}).then(e=>(this.stream=e,this.audioContext.createMediaStreamSource(e)))},i.prototype.loadWorker=function(){this.encoder||(this.encoder=new t.Worker(this.config.encoderPath))},i.prototype.initWorker=function(){var e=(this.config.streamPages?this.streamPage:this.storePage).bind(this);return this.recordedPages=[],this.totalLength=0,this.loadWorker(),new Promise((t,o)=>{var i=o=>{switch(o.data.message){case\"ready\":t();break;case\"page\":this.encodedSamplePosition=o.data.samplePosition,e(o.data.page);break;case\"done\":this.encoder.removeEventListener(\"message\",i),this.finish()}};this.encoder.addEventListener(\"message\",i),this.encoder.postMessage(Object.assign({command:\"init\",originalSampleRate:this.audioContext.sampleRate,wavSampleRate:this.audioContext.sampleRate},this.config))})},i.prototype.pause=function(e){if(\"recording\"===this.state){if(this.state=\"paused\",e&&this.config.streamPages){var t=this.encoder;return new Promise((e,o)=>{var i=o=>{\"flushed\"===o.data.message&&(t.removeEventListener(\"message\",i),this.onpause(),e())};t.addEventListener(\"message\",i),t.postMessage({command:\"flush\"})})}return this.onpause(),Promise.resolve()}},i.prototype.resume=function(){\"paused\"===this.state&&(this.state=\"recording\",this.onresume())},i.prototype.setRecordingGain=function(e){this.config.recordingGain=e,this.recordingGainNode&&this.audioContext&&this.recordingGainNode.gain.setTargetAtTime(e,this.audioContext.currentTime,.01)},i.prototype.setMonitorGain=function(e){this.config.monitorGain=e,this.monitorGainNode&&this.audioContext&&this.monitorGainNode.gain.setTargetAtTime(e,this.audioContext.currentTime,.01)},i.prototype.start=function(e){if(\"inactive\"===this.state)return this.initAudioContext(e),this.initAudioGraph(),this.encodedSamplePosition=0,this.initWorker().then(()=>this.initSourceNode(e)).then(e=>{this.sourceNode=e,this.state=\"recording\",this.onstart(),this.encoder.postMessage({command:\"getHeaderPages\"}),this.sourceNode.connect(this.monitorGainNode),this.sourceNode.connect(this.recordingGainNode)})},i.prototype.stop=function(){if(\"inactive\"!==this.state){this.state=\"inactive\",this.monitorGainNode.disconnect(),this.scriptProcessorNode.disconnect(),this.recordingGainNode.disconnect(),this.sourceNode.disconnect(),this.clearStream();var e=this.encoder;return new Promise(t=>{var o=i=>{\"done\"===i.data.message&&(e.removeEventListener(\"message\",o),t())};e.addEventListener(\"message\",o),e.postMessage({command:\"done\"}),this.config.reuseWorker||e.postMessage({command:\"close\"})})}return Promise.resolve()},i.prototype.destroyWorker=function(){\"inactive\"===this.state&&this.encoder&&(this.encoder.postMessage({command:\"close\"}),delete this.encoder)},i.prototype.storePage=function(e){this.recordedPages.push(e),this.totalLength+=e.length},i.prototype.streamPage=function(e){this.ondataavailable(e)},i.prototype.finish=function(){if(!this.config.streamPages){var e=new Uint8Array(this.totalLength);this.recordedPages.reduce((function(t,o){return e.set(o,t),t+o.length}),0),this.ondataavailable(e)}this.onstop(),this.config.reuseWorker||delete this.encoder},i.prototype.ondataavailable=function(){},i.prototype.onpause=function(){},i.prototype.onresume=function(){},i.prototype.onstart=function(){},i.prototype.onstop=function(){},e.exports=i}).call(this,o(1))},function(e,t){var o;o=function(){return this}();try{o=o||new Function(\"return this\")()}catch(e){\"object\"==typeof window&&(o=window)}e.exports=o}])}));","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nvar NEWTON_ITERATIONS = 4;\nvar NEWTON_MIN_SLOPE = 0.001;\nvar SUBDIVISION_PRECISION = 0.0000001;\nvar SUBDIVISION_MAX_ITERATIONS = 10;\n\nvar kSplineTableSize = 11;\nvar kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nvar float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\nfunction B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\nfunction C (aA1) { return 3.0 * aA1; }\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); }\n\nfunction binarySubdivide (aX, aA, aB, mX1, mX2) {\n var currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing (x) {\n return x;\n}\n\nmodule.exports = function bezier (mX1, mY1, mX2, mY2) {\n if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if (mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for (var i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX (aX) {\n var intervalStart = 0.0;\n var currentSample = 1;\n var lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n var guessForT = intervalStart + dist * kSampleStepSize;\n\n var initialSlope = getSlope(guessForT, mX1, mX2);\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing (x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if (x === 0 || x === 1) {\n return x;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n};\n"],"names":["animationIntersector","constructor","this","observer","IntersectionObserver","entries","entry","target","group","byGroups","intersectionLockedGroups","animation","find","p","el","isIntersecting","visible","add","checkAnimation","delete","_animation","clearCache","Set","overrideIdleGroups","byPlayer","Map","lockedGroups","onlyOnePlayableGroup","videosLocked","doc","type","checkAnimations2","idle","setOverrideIdleGroup","override","getAnimations","element","found","player","push","removeAnimation","HTMLVideoElement","remove","IS_SAFARI","setTimeout","src","load","length","unobserve","removeAnimationByPlayer","item","get","addAnimation","options","observeElement","controlled","liteModeKey","has","canvas","placeholder","HTMLElement","onClean","loop","observe","set","checkAnimations","blurred","destroy","imitateIntersection","undefined","groups","Object","keys","animations","paused","pause","autoplay","play","getOnlyOnePlayableGroup","setOnlyOnePlayableGroup","lockGroup","unlockGroup","refreshGroup","forEach","lockIntersectionGroup","unlockIntersectionGroup","toggleIntersectionGroup","lock","setAutoplay","changed","animationItem","dataset","stickerPlay","stickerLoop","setLoop","SHOULD_USE_SAFARI_FIX","navigator","userAgent","match","err","AppMediaPlaybackController","media","scheduled","mediaDetails","waitingMediaForLoad","waitingScheduledMediaForLoad","waitingDocumentsForLoad","playbackRates","voice","video","audio","seekBackward","details","playingMedia","currentTime","Math","max","seekOffset","seekForward","min","duration","seekTo","seekTime","onMediaDocumentLoad","managers","appDocsManager","getDoc","docId","supportsStreaming","handleSafariStreamable","cacheContext","thumbsStorage","getCacheContext","url","playbackRate","id","size","onPlay","e","peerId","mid","pip","message","getMessageByMedia","stop","setMedia","verify","listLoader","current","getCurrent","jumpLength","withOtherSide","previous","getPrevious","idx","findIndex","getNext","go","setTargets","dispatchEvent","getPlayingDetails","pauseMediaInOtherTabs","onPause","onEnded","isTrusted","lockedSwitchers","round","next","toggle","force","clean","s","isScheduled","storage","playingMediaType","playItem","searchContext","getMedia","resolveWaitingForLoadMedia","dispatchJump","goRound","browserPlay","bindBrowserCallback","browserPause","browserStop","browserSeekBackward","browserSeekForward","browserSeekTo","browserNext","browserPrevious","seekToStart","construct","container","document","createElement","style","cssText","body","append","mediaSession","actions","seekbackward","seekforward","seekto","previoustrack","nexttrack","action","setActionHandler","console","warn","skipMediaPlayEvent","properties","key","_key","value","dispatchPlaybackParams","defineProperties","getPlaybackParams","volume","muted","setPlaybackParams","params","_volume","_muted","_playbackRate","_loop","_round","addMedia","autoload","pFlags","is_scheduled","setAttribute","addEventListener","media_unread","fromId","appMessagesManager","readMessages","once","deferred","resolve","w","waitingStorage","then","promise","isSafariBuffering","safariBuffering","setSafariBuffering","setNewMediadata","pictureInPictureElement","artwork","isVoice","title","artist","thumbs","bytes","sizes","h","thumb","appPeersManager","getPeerPhoto","plainText","onlyFirstName","attribute","attributes","_","file_name","performer","IS_APPLE","metadata","MediaMetadata","setCurrentMediadata","playbackParams","cb","willBePlayed","willBePlayedMedia","setSearchContext","context","getSearchContext","prev","reset","loadCount","loadWhenLeft","processItem","onJump","older","onEmptied","reverse","folderId","getPlaybackMediaTypeFromMessage","mediaType","setSingleMedia","wasPlaying","toggleSwitchers","playPaused","removeEventListener","enabled","setPictureInPicture","listenerSetter","removeAll","appMediaPlaybackController","AppMediaViewer","captionTimeout","super","isForDocument","inputFilter","isMediaCompatibleForDocumentViewer","onPrevClick","openMedia","getMessageByPeer","fromRight","onNextClick","onDeleteClick","content","close","onForwardClick","onAuthorClick","Number","MAX_SAFE_INTEGER","threadId","tab","lastMsgId","onDownloadClick","queueId","caption","classList","setCaptionTimeout","clearTimeout","window","onAdditionalScroll","wholeDiv","buttons","btnMenuForward","icon","text","onClick","btnMenuDownload","btnMenuDelete","setBtnMenuToggle","setListeners","forward","author","onCaptionClick","a","contains","spoiler","HTMLAnchorElement","onclick","getAttribute","includes","capture","click","getScheduledMessageByPeer","setCaption","html","entities","totalEntities","maxMediaTimestamp","firstElementChild","prevTargets","nextTargets","mediaTimestamp","setMoverPromise","fwd_from","from_name","noForwards","isServiceMessage","cantForwardMessage","canForward","cantDownloadMessage","download","canDeleteMessage","hide","button","_openMedia","timestamp","date","static","mime_type","VideoPlayer","streamable","onPlaybackRackMenuToggle","onPip","onPipClose","wrapper","setup","canHideControls","playbackRateButton","showOnLeaveToClassName","ignoreClickClassName","parentNode","insertBefore","appendChild","skin","stylePlayer","controls","querySelector","progress","onSeekStart","onSeekEnd","prepend","catch","name","finally","initDuration","buildControls","timeDuration","insertAdjacentHTML","pipButton","querySelectorAll","fullScreenButton","timeElapsed","textContent","toHHMMSS","volumeSelector","leftControls","btn","parentElement","Array","from","togglePlay","requestPictureInPicture","visibility","debounceTime","debouncedPip","debounce","listener","timeout","overlayCounter","code","good","toggleFullScreen","altKey","nextIdx","PLAYBACK_RATES","indexOf","cancelEvent","onFullScreen","bind","hideControls","showControls","setPlaybackRateIcon","onMediaLoad","isPaused","IS_MOBILE","pictureInPictureEnabled","map","rate","regularText","btnMenu","onOpen","onClose","PLAYBACK_RATES_ICONS","className","IS_APPLE_MOBILE","webkitEnterFullscreen","enterFullscreen","isFull","setTimestamp","cleanup","removeListeners","isBetween","num","ZOOM_MIN_VALUE","MEDIA_VIEWER_CLASSNAME","AppMediaViewerBase","topButtons","tempId","preloader","preloaderStreamable","isFirstOpen","pageEl","getElementById","zoomElements","transform","x","y","scale","lastTransform","lastZoomCenter","lastDragOffset","lastDragDelta","onSwipeFirst","ctrlKeyDown","moversContainer","rangeSelector","isGesturingNow","lastGestureTime","Date","now","clampZoomDebounced","isZooming","initialContentRect","getBoundingClientRect","onSwipeReset","draggingType","ignoreNextClick","isZoomingNow","closing","s1","scaleFactor","x1","y1","k","elapsedTime","Vx","abs","Vy","calculateOffsetBoundaries","setTransform","resetZoom","onZoom","initialCenterX","initialCenterY","zoom","zoomAdd","currentCenterX","currentCenterY","dragOffsetX","dragOffsetY","zoomFactor","windowSize","clamp","ZOOM_MAX_VALUE","offsetX","offsetY","scaledCenterX","scaledCenterY","scaleOffsetX","scaleOffsetY","calculateScaleOffset","offsetTop","inBoundsX","inBoundsY","minX","maxX","minY","maxY","getZoomBoundaries","setZoomValue","toFixed","btnOut","btnIn","toggleZoom","setMoverAnimationPromise","tagName","highlightSwitchersTimeout","mover","classNames","findUpClassName","onKeyDown","addZoomStep","ctrlKey","metaKey","onKeyUp","rootScope","log","logger","cancelable","lazyLoadQueue","overlaysDiv","mainDiv","topbar","topbarLeft","onlyMobile","authorRight","avatarEl","nameEl","buttonsDiv","concat","noRipple","step","withTransition","setHandlers","onScrub","addZoom","onMouseDown","onMouseUp","main","innerHTML","onLoadedMore","setNewMover","moveLength","adjustPosition","xDiff","yDiff","setLastGestureTime","swipeHandler","onReset","onFirstSwipe","onSwipe","cancelDrag","onDoubleClick","centerX","centerY","ZOOM_INITIAL_VALUE","changeZoomByPosition","verifyTouchTarget","findUpAsChild","cursor","changeZoom","enable","isVisible","auto","mousedown","zoomValue","setProgress","videoPlayer","lockControls","getZoomBounce","left","right","top","bottom","btnMenuToggle","buttonOptions","direction","Promise","reject","navigationItem","appNavigationController","clear","setMoverToTarget","onAnimationEnd","appMediaViewer","removeGlobalListeners","toggleOverlay","active","toggleGlobalListeners","setGlobalListeners","setMediaTimestamp","removeCenterFromMover","wasActive","delay","liteMode","realParent","rect","SVGImageElement","SVGForeignObjectElement","needOpacity","overflowElement","visibleRect","getVisibleRect","overflow","vertical","horizontal","containerRect","aspecter","width","HTMLImageElement","setFullAspect","offsetLeft","height","scaleX","scaleY","borderRadius","getComputedStyle","getPropertyValue","brSplitted","str","splitted","split","i","fillPropertyValue","r","parseInt","join","path","opacity","isOut","ret","isFulfilled","isRejected","SVGSVGElement","sizeTailPath","toggleWholeActive","mediaElement","selector","queryFrom","matches","elements","pop","getContext","naturalWidth","naturalHeight","videoWidth","videoHeight","HTMLCanvasElement","drawImage","image","Image","createVideo","clipId","newClipId","newSvg","createElementNS","setAttributeNS","outerHTML","replace","lastElementChild","defs","use","SVGUseElement","d","getAttributeNS","sX","sY","br","v","generatePathData","foreignObject","renderImageFromUrl","display","proportion","upscale","start","diff","_br","moveTheMover","toLeft","windowW","newTransform","p1","newMover","updateMediaSource","toLowerCase","setAuthorInfo","isPeerId","wrapTitlePromise","dialog","wrapEmojiText","oldAvatar","newAvatar","cloneNode","all","updateWithOptions","peerTitle","replaceContent","replaceWith","setAuthorPromise","isDocument","isVideo","useContainerAsTarget","replaceChildren","onPop","canAnimate","IS_MOBILE_SAFARI","maxWidth","padding","windowH","mediaSizes","maxHeight","thumbPromise","setAttachmentSize","photoSize","img","downloaded","gotThumb","getStrippedThumbIfNeeded","loadPromise","useController","div","moverVideo","canPlayThrough","createPlayer","ckin","overlay","open","otherMediaViewer","releaseSingleMedia","show","readyState","HAVE_FUTURE_DATA","attach","attachCanPlay","detach","loading","networkState","NETWORK_LOADING","isntEnoughData","unshift","appDownloadManager","toast","langPackKey","error","cancellablePromise","photoSizes","slice","filter","sort","b","fullPhotoSize","cancellableFullPromise","attachPromise","haveImage","fullImage","setManual","onPopState","hash","location","state","debug","isPossibleSwipe","currentHash","overriddenHash","overrideHash","onHashChange","pushState","navigations","manual","handleItem","onEscape","back","onTouchStart","touches","passive","history","scrollRestoration","replaceState","pushItem","noBlurOnPop","findItemByType","index","backByItem","splice","onItemAdded","noHistory","unshiftItem","spliceItems","items","origin","pathname","search","removeItem","removeByType","single","SearchGroup","clearable","clickable","autonomous","onFound","noIcons","list","setActive","childElementCount","AppSearch","searchInput","searchGroups","onSearch","minMsgId","loadedCount","foundCount","searchPromise","searchTimeout","query","listsContainer","scrollable","messages","setVirtualContainer","onChange","searchMore","onScrolledBottom","trim","beginSearch","inputField","input","focus","maxId","limit","res","count","shift","searchGroup","avatarSize","meAsSaved","SearchContextMenu","attachTo","searchSuper","onGotoClick","appImManager","selection","isSelecting","selectionForwardBtn","onSelectClick","toggleByElement","onClearSelectionClick","cancelSelection","selectionDeleteBtn","attachContextMenuListener","callback","init","MouseEvent","preventDefault","cancelBubble","toPeerId","isSelected","isMidSelected","selectedMessages","getSelectedMessages","withSelection","positionMenu","contextMenuController","AppSearchSuper","tabs","prevTabId","middleware","historyStorage","usedFromHistory","loadMutex","nextRates","loadPromises","loaded","loadedChats","firstLoad","monthContainers","mediaTabsMap","asChatList","groupByMonth","hideEmptyTabs","showSender","onTransitionStart","onTransitionEnd","safeAssign","searchContextMenu","navScrollableContainer","navScrollable","nav","tabsMenu","mediaTab","mediaTabs","menuTab","span","ripple","unlockScroll","tabsContainer","handleTabSwipe","prevId","selectTab","children","onTouchMove","lockers","lockTouchScroll","contentTab","searchGroupMedia","canLoadMediaTab","horizontalMenu","tabContent","animate","skipScroll","scrollIntoViewNew","position","startCallback","scrollStartCallback","newMediaTab","onChangeTab","fromMediaTab","scrollTop","scroll","scrollHeight","rect2","onScroll","onMediaClick","targetClassName","mediaSpoiler","event","targets","containerEl","copySearchContext","inputMessagesFilterPhotoVideo","inputMessagesFilterDocument","useHeavyAnimationCheck","unlockAndRefresh","filterMessagesByType","filterMessagesByInputFilter","processEmptyFilter","dialogElement","appDialogsManager","setLastMessagePromise","lastMessage","highlightWord","noop","processPhotoVideoFilter","promises","getMediaFromMessage","wrapped","choosePhotoSize","boxWidth","boxHeight","onlyPreview","withoutPreloader","noPlayButton","photo","noBlur","animationGroup","multiply","images","full","Boolean","processDocumentFilter","withTime","fontWeight","voiceAsMusic","autoDownloadSize","getSize","processUrlFilter","webPage","webpage","entity","display_url","sliced","offset","matchUrl","same","URL","hostname","description","previewDiv","setInnerHTML","wrapAbbreviation","subtitleFragment","htmlToDocumentFragment","wrapRichText","innerText","decodeURIComponent","href","firstChild","wrapPlainText","row","titleRight","subtitle","havePadding","applyMediaElement","performSearchResult","elemsToAppend","sharedMediaDiv","processCallback","results","awaited","method","monthContainer","getMonthContainerByTimestamp","toggleElementCheckbox","afterPerforming","parent","child","loadChats","renderedPeerIds","inputMessagesFilterEmpty","setResults","showMembersCount","dom","peer","getPeer","participants_count","participants","regExp","RegExp","escapeRegExp","cleanSearchText","titleSpan","lastMessageSpan","getChatMembersString","toChatId","username","getPeerUsername","user","appUsersManager","getUser","phone","formatPhoneNumber","formatted","onLoad","arg","getContactsPeerIds","contacts","searchContacts","my_results","globalContacts","showMore","intlElement","isShort","update","dialogsStorage","getDialogs","offsetIndex","filterId","dialogs","minDate","renderRecentSearch","recent","recentSearch","isUser","getUserStatusString","toUserId","getTopPeers","peers","people","subtitleEl","loadMembers","chatId","userId","renderParticipants","membersList","rippleEnabled","li","findUpTag","DIALOG_LIST_ELEMENT_TAG","peerIds","participant","getParticipantPeerId","isAnyChat","filtered","filterAsync","deleted","LOAD_COUNT","getCommonChats","messagesChats","lastChat","chats","appChatsManager","isChannel","appProfileManager","getChannelParticipants","getChatFull","chatFull","loadType","justLoad","used","slicedLength","ids","notFilteredMessages","m","checkForTriggers","getSearch","nextRate","next_rate","loadFirstTime","filters","counters","canViewMembers","canViewGroups","getSearchCounters","firstMediaTab","counter","c","membersTab","loadFirstTimePromise","toLoad","t","findAndSplice","setHours","setDate","dateTimestamp","getTime","containers","month","getFullYear","year","dateElement","haveTimestamps","getObjectKeysAndSort","positionElementByIndex","isBroadcast","hasRights","isForum","getProfile","common_chats_count","cleanScrollPositions","cleanupHTML","goFirst","putPreloader","empty","newInputFilter","copy","setQuery","maxDate","AppSelectPeers","chatsContainer","selected","freezed","loadedWhat","peerType","multiSelect","exceptSelf","tempIds","selfPresence","needSwitchList","design","onInput","cachedContacts","getMoreResults","f","renderResultsFunc","renderResults","splitUp","notRendered","filterPeerTypeBy","section","innerContainer","topContainer","selectedContainer","selectedScrollable","sectionNameLangPackKey","noShadow","checkbox","checked","debouncedInput","appendTo","getResultsPromise","onFirstRender","renderSaved","testSelfSearch","getTempId","getMoreDialogs","archived","pageCount","skipMigrated","newOffsetIndex","chatRightsActions","filterByRights","isEnd","getMoreContacts","every","isGlobalSearch","searchResult","resultPeerIds","arr","getMoreChannelParticipants","channelParticipants","getParticipants","q","chatParticipants","getMoreSomething","call","isNonContactUser","checkboxField","label","isDialog","insertAdjacentElement","offsetWidth","getSelected","addInitial","values","requestAnimationFrame","forceDirection","constructDownloadPreloader","tryAgainOnFail","circle","totalLength","mids","attr","elem","findMediaTargets","anchor","anchorMid","isBubbles","justAudioSelector","selectors","prefix","mediaItems","AudioElement","render","isRealVoice","isOutgoing","is_outgoing","uploadingFileName","getDurationStr","HAVE_CURRENT_DATA","downloadDiv","onTypeLoad","audioEl","out","waveform","Uint8Array","valueCount","result","dataView","DataView","buffer","byteIndex","bitShift","getUint16","decodeWaveform","svg","svgContainer","availW","barHeightMax","minW","maxW","normValue","wfSize","barCount","maxValue","maxDelta","barX","sumI","bar_value","barWidth","createWaveformBars","fakeSvgContainer","waveformContainer","timeDiv","transcriptionState","speechRecognitionDiv","speechRecognitionIcon","speechRecognitionLoader","speechTextDiv","transcribeAudio","progressLine","onTimeUpdate","throttledTimeUpdate","addAudioListener","readyPromise","mousemove","scrub","targetTouches","pageX","scrubTime","wrapVoiceMessage","descriptionEl","audioAttribute","parts","titleEl","middleEllipsisEl","fontSize","sizeType","subtitleDiv","launched","lastChild","wrapAudio","audioTimeDiv","onTypeDisconnect","getTimeStr","imgs","autoDownload","shouldPlay","controlledAutoplay","onDownloadInit","pauseListener","notifyAll","done","total","cancel","Error","playListener","setDownloadFunction","setTargetsIfNeeded","hadSearchContext","useSearch","playWithTimestamp","disconnectedCallback","isConnected","customElements","define","AvatarListLoader","loadMore","photoId","appPhotosManager","getUserPhotos","photos","loadedAllUp","AppMediaViewerAvatar","getPhoto","onAvatarUpdate","openAvatarViewer","getTarget","hadMessage","isObject","data","believeMe","seen","getAvatarQueueKey","AvatarElement","addedToQueue","middlewareHelper","attachClickEvent","updateOptions","wasPeerId","wasThreadId","newPeerId","wrapOptions","create","onlyThumb","putPhoto","isBig","AvatarEdit","clearRect","Button","asLink","asDiv","rippleSquare","disabled","ButtonMenuItem","separator","iconDoc","noCheckboxClickListener","textElement","textArgs","iconElement","noFadeIn","processUrl","fetch","response","color","DOMParser","parseFromString","stroke","strokeWidth","keepOpen","menu","checkForClose","multiline","ButtonMenuSync","ButtonMenu","ButtonMenuToggleHandler","openedMenu","ButtonMenuToggle","attachListenerSetter","onOpenBefore","onCloseAfter","closeTimeout","filteredButtons","_element","BubbleGroup","chat","createAvatar","avatarLoadPromise","avatarContainer","fwdFrom","fwdFromId","isForwardFromChannel","from_id","currentPeerId","avatar","bubbles","firstTimestamp","firstItem","firstMid","lastTimestamp","lastItem","lastMid","updateClassNames","first","bubble","_length","last","insertItem","insertInDescendSortedArray","sortGroupItemsKey","insertGroup","indexOfAndSplice","mount","mounted","onItemUnmount","forEachReverse","mountItem","onItemMount","unmountItem","dateContainer","getDateContainerByTimestamp","dateGroups","_group","dateGroupsLength","unmountedLength","reduce","acc","STICKY_OFFSET","deleteEmptyDateGroups","BubbleGroups","itemsArr","itemsMap","newGroupDiff","sortItemsKey","sortGroupsKey","removeItemFromCache","removeAndUnmountBubble","getItemByBubble","siblings","getSiblingsAtIndex","modifiedGroups","previousSibling","nextSibling","canItemsBeGrouped","groupUngrouped","mountUnmountGroups","toMount","toUnmount","partition","getLastGroup","changeBubbleMid","insertItemToArray","changeItemBubble","changeBubbleByBubble","to","item1","item2","isAllMessagesForum","getMessageThreadId","itemIndex","findGroupSiblingByItem","findGroupSiblingInItems","previousItem","siblingGroupedItem","nextItem","addItemToGroup","addItemToCache","array","getMessageFromId","createItem","SERVICE_AS_REGULAR","getDateForDateContainer","groupMid","splitSiblingsOnGrouping","previousGroup","prepareForGrouping","hadGroup","foundItem","splittedGroups","TAG_NAME","RepliesElement","updated","postKey","replies","leftPart","recent_repliers","stackedAvatars","getPeerId","compareAndUpdate","args","isUnread","read_max_id","max_id","textSpan","iconSpan","rippleContainer","formatNumber","subscribeRepliesThread","updateMessage","makeEdited","edited","makeSponsored","MessageRender","setTime","chatType","editedSpan","sponsoredSpan","isSponsored","sponsored","isMessage","time","views","postAuthor","post_author","postViewsSpan","channelViews","edit_date","edit_hide","pinned","timeSpan","inner","clonedArgs","renderReplies","bubbleContainer","messageDiv","isFooter","repliesFooter","setReply","isReplacing","currentReplyDiv","reply_to_mid","replyToPeerId","reply_to","reply_to_peer_id","originalMessage","originalPeerTitle","titlePeerId","originalMessageFwdFromId","needUpdate","replyMid","fillPromise","isAnyGroup","SuperIntersectionObserver","observing","observingQueue","freezedObservingNew","callbacks","disconnect","toggleObservingNew","queue","isMentionUnread","mentioned","wrapAlbum","attachmentDiv","uploading","prepareAlbum","minWidth","spacing","forMedia","containerWidth","containerHeight","hasSpoiler","mediaDiv","withTail","noAutoplayAttribute","itemWidth","itemHeight","getMediaDurationFromMessage","AppPollResultsTab","resultsDiv","poll","appPollsManager","getPoll","setTitle","quiz","question","percents","voters","total_voters","roundPercents","fragment","createDocumentFragment","hr","answer","answers","answerEl","answerTitle","answerPercents","minHeight","getVotes","option","votesList","votes","vote","user_id","next_offset","lineTotalLength","sum","minIndex","minRemainder","remainder","maxRemainder","pollElement","isClosed","closed","performResults","chosenIndexes","PollElement","setMaxLength","resizePolls","hideQuizHint","onHide","prevQuizHint","prevQuizHintOnHide","prevQuizHintTimeout","isListenerSet","isQuiz","isRetracted","isPublic","isMultiple","chosingIndexes","sentVote","clickHandler","answerIndex","foundIndex","sendVotes","MAX_LENGTH","MAX_OFFSET","svgLines","setLineProgress","getTotalLength","descKey","public_voters","multiple_choice","multipleSelect","descDiv","nextElementSibling","typeDiv","avatarsDiv","close_period","close_date","timeLeftDiv","quizTimer","radius","circumference","PI","period","closeTime","quizInterval","setInterval","timeLeft","strokeDashoffset","strokeDasharray","clearInterval","getResults","answerDivs","numberDivs","footerDiv","viewResults","votersCountDiv","sendVoteBtn","canVote","setVotersCount","detachClickEvent","initQuizHint","solution","solution_entities","toggleHint","textEl","setQuizHint","correctResult","correct","chosen","indexes","sendVotePromise","sendVote","timeEl","forwards","recent_voters","isVoted","hideSendVoteBtn","hideViewResultsBtn","maxPercents","getPercentValue","iterate","fullTime","times","votersCount","multiplier","rtlChars","justRtlDirCheck","IGNORE_ACTIONS","TEST_SCROLL_TIMES","TEST_SCROLL","PEER_CHANGED_ERROR","BIG_EMOJI_SIZES","BIG_EMOJI_SIZES_LENGTH","getMainMidForGrouped","ChatBubbles","unreadOut","skippedMids","bubblesNewByGroupedId","bubblesNew","dateMessages","scrolledDown","isScrollingTimeout","unreaded","unreadedSeen","messagesQueueOnRenderAdditional","firstUnreadBubble","followStack","isHeavyAnimationInProgress","isFirstLoad","passEntities","viewsMids","isTopPaddingSet","renderingMessages","bubblesToEject","bubblesToReplace","setPeerTempId","renderNewPromises","extendedMediaMessages","unreadedObserverCallback","onUnreadedInViewport","viewsObserverCallback","sendViewCountersDebounced","sponsoredMessage","randomId","random_id","viewSponsoredMessage","stickerEffectObserverCallback","isInDOM","onBubblesMouseMove","unhoverPrevious","canSelectBubble","hoverBubble","hoverReaction","setHoverVisible","stickerWrapper","getMessage","getGroupsFirstMessage","getMiddleware","appReactionsManager","getAvailableReactionsByMessage","availableReactions","availableReaction","select_animation","needUpscale","withThumb","needFadeIn","assumeType","sendReaction","onBubblesClick","setInnerPeer","previousElementSibling","chatInner","onDatePick","selectedText","contactDiv","callDiv","callUser","appPaymentsManager","getInputInvoiceByPeerId","reactionElement","reactionsElement","reactionCount","getReactionCount","reaction","stickerEmojiEl","findUpAttribute","bubbleMid","reply_to_top_id","saved_from_msg_id","openThread","message1","getMessageWithReplies","getDiscussionMessage","channel_id","via","appDraftsManager","setDraft","nameDiv","peerIdStr","savedFrom","inputInvoice","messageId","stickerSetInput","checkTargetForMediaViewer","getMidsByMessage","isReplyClick","replyToMid","reply_to_msg_id","ignoreHeavyAnimation","scrollDimensions","forceDown","sliceViewportDebounced","pinnedMessage","setCorrectIndexThrottled","lastScrollDirection","setStickyDateManually","distanceToEnd","getDistanceToEnd","loadedAll","setPeerPromise","processBatch","loadQueue","filterQueue","avatarPromises","groupBubbles","updatePosition","perf","performance","timePromises","groupCollapsed","groupEnd","setUnreadDelimiter","restoreScroll","scrollSaver","prepareToSaveScroll","ejectBubbles","oldBubble","replaceSaved","bubbleGroups","local","updatePlaceholderPosition","setAllSeen","requestHistory","setMessageId","constructBubbles","batchProcessor","process","possibleError","storageKey","sequential","messagesStorageKey","messagesQueuePromise","newItem","_items","scrollingToBubble","scrollToEnd","deleteMessagesByIds","tempMessage","_bubble","groupedId","grouped_id","getMessagesByAlbum","reactionsElements","changeMessage","repliesElement","newDiv","safeRenderMessage","scrollToBubbleIfLast","pending","audioElement","transcribedText","dots","createTextNode","before","deletedMids","wasMainMid","mainMid","changedResults","getMountedBubble","createScrollSaver","save","reactions","appendReactionsElementToBubble","restore","obj","listenTo","findTarget","closest","stickyIntersector","stuck","dateMessage","dateBubble","previousStickyDate","sliceViewport","setScroll","attachContainerListeners","contextMenu","attachListeners","highlightBubble","MAX","replyAfter","swipeAvatar","shouldReply","handleHorizontalSwipe","canSend","_target","_swipeAvatar","initMessageReply","listenerOptions","constructPeerHelpers","updateGradient","renderNewMessage","msgs","setUnreadCount","updateUnreadByDialog","getChat","hadRights","hadPlainRights","canSendPlain","hasPlainRights","canEmbedLinks","finishPeerChange","willSendWebPage","lastUrl","onMessageInput","forum","setPeer","reloadMessages","toDelete","setLoaded","postViewsElements","different","postViews","root","incrementMessageViews","onUpdate","getScheduledMessagesStorage","queuePromise","createResizeObserver","resizeObserver","wasHeight","resizing","skip","scrolled","part","rAF","onResizeEnd","offsetHeight","isScrolledDown","setScrollTopSilently","setEndRAF","cancelAnimationFrame","ResizeObserver","contentRect","realDiff","_part","needScrollTop","destroyResizeObserver","setReactionsHoverListeners","useRafs","getRenderedLength","readUnreaded","readPromise","idleController","bubblesMaxId","getHistoryMaxId","readContents","readHistory","documentDiv","groupedItem","SINGLE_MEDIA_CLASSNAME","isSingleMedia","parents","hasAspecter","albumItem","onGoDownClick","bad","getBubbleByPoint","verticalSide","getViewportSlice","getGroupedBubble","groupId","getMidsByAlbum","getBubbleGroupedItems","findNextMountedBubbleByMsgId","filterCallback","_mid","foundMid","loadMoreHistory","getHistoryTopPromise","getHistoryBottomPromise","getHistory1","destroyScrollable","onScrolledTop","getHistoryStorage","readMaxId","readOutboxMaxId","msgId","destroyBubble","permanent","ignoreOnScroll","ignoreNextScrollEvent","deleteSelectedMids","pollExtendedMediaMessages","getExtendedMedia","setExtendedMediaMessagesPollInterval","pollExtendedMediaMessagesPromise","setTopPadding","setPaddingTo","isPaddingNeeded","clientHeight","paddingTop","unsetPadding","_renderNewMessage","newMessage","getLastBubble","performHistoryResult","scrollToBubbleEnd","scrollToBubble","forceDuration","fallbackToElementStartWhenCentering","whichChild","isChangingHeight","messageInput","margin","axis","getNormalSize","dimensions","gradientRenderer","toNextPosition","getProgress","lastScrollPosition","datasetKey","createDateBubble","today","day","bubbleContent","serviceMsg","fakeBubble","observeStickyHeaderChanges","bubblesToo","cleanupPlaceholders","attachedUnreadBubble","fetchNewPromise","getSponsoredMessagePromise","onAnimateLadder","resolveLadderAnimation","attachPlaceholderOnRender","emptyPlaceholderBubble","cancelMeasure","samePeer","stack","startParam","bindPrefix","middlewarePromise","onChangePeer","isRestricted","topMessage","getPinnedMessagesMaxId","isTarget","followingUnread","savedPosition","overrideAdditionMsgId","getChatSavedPosition","getReadMaxIdIfUnread","getDialogOrTopic","unread_count","foundSlice","findSliceOffset","isJump","isStartButtonNeeded","setStartParam","apiFileManager","setQueueId","messageEntityBotCommand","isBot","additionMsgId","maxBubbleId","oldChatInner","oldPlaceholderBubble","haveToScrollToBubble","fromUp","scrollFromDown","scrollFromUp","willScrollOnLoad","setPeerOptions","cached","waitPromise","setPeerCached","mountedByLastMsgId","isPinnedMessagesNeeded","setCorrectIndex","unlock","lastBubble","onRenderScrollSet","afterSetPromise","playMediaWithTimestamp","setFetchReactionsInterval","setFetchHistoryInterval","onScrolledAllDown","isForumTopic","getDialogOnly","unread_mark","markDialogUnread","albumItemMid","textMid","attachment","fetchReactions","getMessagesReactions","needFetchInterval","isFetchIntervalNeeded","apiUpdatesManager","unsubscribeFromChannelUpdates","subscribeToChannelUpdates","historyMaxId","canWrite","renderMessagesQueue","addToQueue","isAvatarNeeded","additionalCallback","wrapMediaSpoiler","processResult","newBubble","originalPromise","renderMessage","albumMids","reactionsMessage","albumMessages","albumMustBeRenderedFull","our","isOurMessage","contentWrapper","isInUnread","unread","customEmojiSize","ignoreAction","langPack","chat_id","is_single","messageMessage","albumTextMessage","messageMedia","needToSetHTML","getAlbumText","bigEmojis","emojiEntities","strLength","curr","setProperty","richTextOptions","richText","canHaveTail","isStandaloneMedia","sticker","appStickersManager","getAnimatedEmojiSticker","haveRTLChar","test","topicNameButtonContainer","withIcons","replyMarkup","reply_markup","replyMarkupRows","rows","containerDiv","rowDiv","buttonEl","noLinks","noLinebreaks","botId","viaBotId","same_peer","appInlineBotsManager","checkSwitchReturn","popup","switchInlineQuery","mediaInvoice","extended_media","receipt_msg_id","button_id","toggleDisability","handleUrlAuth","buttonId","haveButtons","column","callbackButtonClick","callbackAnswer","status","messageWithReplies","getMessageWithCommentReplies","withReplies","isOutMessage","nameContainer","canHideNameIfMedia","isMessageEmpty","viewButton","processingWebPage","IS_ANDROID","wrapUrl","telegram_channel","telegram_megagroup","telegram_bot","makeViewButton","box","quote","previewResizer","preview","quoteTextDiv","mediaSize","noInfo","docDiv","file","canTranscribeVoice","site_name","strong","titleDiv","textDiv","isSquare","animated","isEmoji","boxSize","emojiSticker","animatedSticker","staticSticker","emoji","noPremium","nopremium","getStickerEffectThumb","isRound","newNameContainer","richTextFragment","getMidsByMid","wrapGroupedDocuments","lastContainer","addClassName","formatCallDuration","reason","contact","contactDetails","contactNameDiv","fullName","first_name","last_name","contactNumberDiv","phone_number","avatarElem","wrapPoll","isTest","extendedMedia","isAlreadyPaid","isNotPaid","innerMedia","wrappedPrice","paymentsWrapCurrencyAmount","total_amount","currency","priceEl","video_duration","videoTime","l","joiner","access_hash","dc_id","file_reference","dotRenderer","needName","titleVia","mustHaveName","isHidden","isForward","replyContainer","withPremiumIcon","getPeerColorById","scam","fake","generateFakeIcon","after","goto","generateTail","documentContainer","documentMessageDiv","viewportSlice","deleteViewportSlice","getSaved","historyResult","needReflowScroll","reflowScrollableElement","setLoadedPromises","firstSlice","lastSlice","both","processLocalMessageRender","detached","backLimit","acknowledged","getHistory","ackedResult","getScheduledMessages","animateAsLadder","additionMsgIds","isAdditionRender","targetMid","sortedMids","topIds","middleIds","bottomIds","getServerMessageId","setBubbles","animationPromise","lastMsDelay","elementsToAnimate","transitionDelay","topRes","middleRes","bottomRes","delays","renderEmptyPlaceholder","BASE_CLASS","listElements","getRestrictionReasonText","stickerDiv","getGreetingSticker","renderPromise","order","channel_post","generateMessageId","start_param","chat_invite","chat_invite_hash","link","invite","processInternalLink","creator","isWaitingForAnimation","noTransition","setOn","onDestroy","generateLocalMessageId","addOffset","generateLocalFirstMessage","service","fill","peer_id","getOutputPeer","saveMessages","extraSize","ignoreScrollSaving","invisibleTop","invisibleBottom","invisible","side","checkPlaceholders","toggleSponsoredMessage","renderBotPlaceholder","checkIfEmptyPlaceholderNeeded","getSponsoredMessage","sponsoredMessages","messagePromise","_log","processPromise","userFull","bot_info","botInfo","description_document","description_photo","isBackLimit","resultPromise","isFirstMessageRender","serviceStartMessageId","getThreadServiceMessageId","getProfileByPeerId","sup","_promise","mustBeCount","PopupReportMessagesConfirm","onConfirm","noTitle","descriptionLangKey","langKey","isValid","reportMessages","bool","STICKER_EMOJI","header","maxLength","toggleAttribute","PopupReportMessages","titleLangKey","preloadStickerPromise","preloadAnimatedEmojiSticker","buttonsEl","marginTop","PopupSponsored","descriptionLangArgs","isCancel","PopupReactedList","closable","overlayClosable","canViewReadParticipants","canViewMessageReadParticipants","recent_reactions","chosen_order","btnClose","loaders","hasAllReactions","createFakeReaction","hasReadParticipants","readUserIds","getMessageReadParticipants","noDelimiter","chatlist","dialogSize","skipReadParticipants","skipReactionsList","nextOffset","loader","getPromise","getMessageReactionsListAndReadParticipants","combined","stickerContainer","getReactionCached","emoticon","static_icon","docIds","document_id","listEl","setIsChosen","setCanRenderAvatars","renderCounter","allReactionsSticker","REACTIONS_CLASS_NAME","REACTION_CLASS_NAME","CAN_USE_TRANSFORM","ChatReactionsMenu","reactionsMap","players","onScrollProcessItem","onMouseMove","reactionDiv","appear","select","restart","widthContainer","reactionsContainer","reactionsScrollable","callbackify","premium","renderReaction","setVisible","canUseAnimations","scaleContainer","appearWrapper","selectWrapper","skipRatio","isFirst","appear_animation","frameNo","maxFrame","selectLoadPromise","selectPlayer","lottieLoader","REACTION_SIZE","ChatContextMenu","onContextMenu","hasOwnProperty","isSelectable","isTextSelected","isSelectionEmpty","isAnchorTarget","isUsernameTarget","selectedMid","isOverBubble","isTargetAGroupedItem","viewerPeerId","canOpenReactedList","linkToMessage","getUrlToMessage","selectedMessagesText","getSelectedMessagesText","initResult","menuPadding","reactionsMenu","reactionsMenuPosition","isReactionsMenuVisible","offsetSize","nextVisiblePart","MIN_NEXT_VISIBLE_PART","minSize","onSendScheduledClick","selectionSendNowBtn","onReplyClick","onFaveStickerClick","unfave","faveSticker","onEditClick","getMessageWithText","initMessageEditing","onCopyClick","execCommand","onCopyAnchorLinkClick","onCopyLinkClick","isPrivate","onPinClick","onUnpinClick","onRetractVote","onStopPoll","stopPoll","filterButtons","setButtons","verifyFavoriteSticker","toAdd","favedStickers","getFavedStickersStickers","some","_doc","hasAttribute","notDirect","scheduleSending","editMessage","scheduleDate","onMessageSent","canEditMessage","selectedMids","getMessageFromStorage","canPinMessage","canDownload","localName","emojiInputsPromise","inputs","getUniqueCustomEmojisFromMessage","withTarget","isArray","canSaveMessageMedia","isGoodType","hasTarget","filterUnique","viewsButton","recentReactions","isViewingReactions","participantsCount","reactedLength","i18nElem","fakeText","AVATAR_SIZE","MAX_AVATARS","PADDING_PER_AVATAR","paddingRight","reactionsCount","fakeElem","readParticipants","avatars","totalSize","paddingLeft","emojisButton","setPadding","inputsPromise","appEmojiManager","getCachedCustomEmojiDocuments","docs","getStickerSet","getCustomEmojiDocuments","threadMessage","ChatBackgroundGradientRenderer","_width","_height","_tails","_scrollTails","_curve","_positions","_phases","onWheel","_animatingToNextPosition","_scrollDelta","deltaY","_onWheelRAF","drawOnWheel","floor","ceil","changeTailAndDraw","drawNextPositionAnimated","transitionValue","nextPositionTail","_nextPositionTail","_nextPositionTails","_nextPositionLeft","frames","_frames","drawImageData","_incrementalCurve","hexToRgb","hex","g","getPositions","positions","getNextPositions","phase","curveMax","curve","pos","distances","nextPos","distance","curPosition","tail","changeTail","_tail","_phase","curPos","drawGradient","getGradientImageData","_hctx","createImageData","pixels","centerDistanceY","centerDistanceY2","centerDistanceX","swirlFactor","sqrt","theta","sinTheta","sin","cosTheta","cos","pixelX","pixelY","distanceSum","_colors","distanceX","distanceY","putImageData","_ctx","_hc","colors","alpha","_canvas","fillStyle","fillRect","tails","nextPhaseOnIdx","inc","curves","scrollAnimate","createCanvas","PopupCreatePoll","withConfirm","onSubmitClick","send","radioLabel","isEmpty","isInputEmpty","removeAttribute","questions","appendMoreField","handleChange","correctAnswers","optionInputFields","labelOptions","questionInputField","sendMenu","onSilentClick","sendSilent","onScheduleClick","openSide","onContextElement","btnConfirm","setPeerId","dd","settingsCaption","anonymousCheckboxField","multipleCheckboxField","quizCheckboxField","quizSolutionField","setValueSilently","quizElements","quizSolutionCaption","quizHr","quizSolutionContainer","quizSolutionSubtitle","getFilledAnswers","HTMLInputElement","getRichValueWithCaret","validate","quizSolution","valid","quizSolutionEntities","inputMediaPoll","getInputMediaPoll","sendOther","getMessageSendingParams","helperType","clearHelper","questionField","radioField","deleteBtn","HANDLE_EVENT","ACTIVE_CLASS_NAME","AXIS_Y_KEYS","AXIS_X_KEYS","attachListNavigation","onSelect","waitForKey","waitForKeySet","keyNames","getCurrentTarget","setCurrentTarget","scrollTo","hadTarget","fastSmoothScroll","getNextTargetX","currentTarget","isNext","nextTarget","handleArrowKey","property","endProperty","currentRect","targetRect","getNextTargetY","fireSelect","canContinue","attached","resetTarget","_onKeyDown","AutocompleteHelper","hidden","onVisible","listType","attachNavigation","controller","addHelper","toggleListNavigation","fromController","skipAnimation","hideOtherHelpers","StickersHelper","onChangeScreen","checkEmoticon","getStickersByEmoticon","stickers","ready","superStickerRenderer","renderSticker","getMinDate","getMaxDate","setFullYear","getDate","PopupSchedule","initDate","onPick","canSendWhenOnline","noButtons","showOverflowMonths","confirmShortcutIsSendShortcut","controlsDiv","monthTitle","btnSendWhenOnline","EmojiHelper","chatInput","onEmojiSelected","scrollLeft","emojis","checkQuery","firstChar","getBothEmojiKeywords","searchEmojis","AutocompletePeerHelper","doNotShow","listElement","BASE","BASE_CLASS_LIST_ELEMENT","processPeerFullForCommands","botInfos","ignoreCase","commands","command","indexObject","CommandsHelper","getReadyToSend","sendMessage","AutocompleteHelperController","helpers","helper","preserveHelper","MentionsHelper","usernames","getPeerActiveUsernames","insertAtCaret","topMsgId","trimmed","getMentions","ReplyKeyboard","onBodyTouchStart","btnHover","attachButtonListener","checkAvailability","isActive","checkForceReply","touchListener","confirmationPopup","sendContact","sendText","getReplyMarkup","getHistoryStorageTransferable","ANIMATION_GROUP","InlineHelper","queryId","queryAndResultIds","generateQId","resultId","sendInlineResult","clearDraft","_checkQuery","canSendInline","resolveUsername","bot","getInlineResults","botResults","query_id","gifsMasonry","isGallery","gallery","noCommands","mediaContainer","dcId","mimeType","blob","readBlobAsDataURL","dataURL","renderMediaWithFadeIn","observeAnimated","switch_pm","btnSwitchToPM","switchToPM","POSTING_NOT_ALLOWED_MAP","ChatBotCommands","setUserId","modifyAckedResult","acked","modifyAckedPromise","ChatSendAs","onReady","closeBtn","sendAsButtons","previousAvatar","onSendAsMenuToggle","isChanged","updateButtons","sendAsPeerId","changeSendAsPeerId","executeButtonsUpdate","sendAsPeerIds","saveDefaultSendAs","updateAvatar","getDefaultSendAs","getChannelFull","channelFull","default_send_as","updateManual","updatingPromise","wasSkippingAnimation","getSendAs","sendAsPeers","sendAsPeer","premium_required","addedListener","send_voices","send_stickers","send_gifs","send_media","send_plain","send_polls","send_inline","ChatInput","lastTimeType","replyElements","recording","recordCanceled","recordStartTime","lockRedo","canRedoFromHTML","undoHistory","executedHistory","canUndoFromHTML","onCancelRecordClick","recorder","opusDecodeController","onEmoticonsOpen","toggleClass","btnToggleEmoticons","onEmoticonsClose","isUserOnlineVisible","openScheduled","prepareDocumentExecute","undoRedo","needHTML","sameHTMLTimes","currentHTML","handleMarkdownShortcut","formatKeys","markupTooltip","applyMarkdown","getSelection","showLinkEditor","shiftKey","richValue","markdownEntities","caretPos","messageInputField","parseMarkdown","mergeEntities","parseEntities","urlEntities","getWebPagePromise","appWebPagesManager","getWebPage","setTopInfo","noWebPage","onHelperCancel","helperFunc","setTyping","botCommands","activeElement","placeCaretAtEnd","updateBotCommandsToggle","editMsgId","saveDraftDebounced","checkAutocomplete","updateSendBtn","autocomplete","getEmojiEntityFromEmoji","onBtnSendClick","forwarding","flag","blurActiveElement","restricted","voice_messages_forbidden","langPackArguments","releaseMediaPlayback","setRecording","showDiscardPopup","btnCancelRecord","recordingOverlayListener","recordingNavigationItem","sourceNode","analyser","createAnalyser","connect","fftSize","frequencyData","frequencyBinCount","getByteFrequencyData","recordRippleEl","ms","recordTimeEl","needReturn","draft","getCurrentInputAsDraft","no_webpage","originalDraft","canPassEntitiesTypes","draftsAreEqual","onHelperClick","forwardElements","replyToMsgId","inputContainer","rowsWrapperWrapper","rowsWrapper","fakeRowsWrapper","fakeSelectionWrapper","goDownBtn","controlContainer","createButtonIcon","tabIndex","iconBtn","cancelBtn","onHideAuthorClick","isChangingAuthor","onHideCaptionClick","forwardButtons","canToggleHideAuthor","hideSender","showCaption","hideCaption","changePeer","changeForwardRecipient","forwardBtnMenu","forwardWasDroppingAuthor","replyTitle","forwardHover","modifyArgs","newMessageWrapper","replyInTopicOverlay","inputMessageContainer","goDownUnreadBadge","goMentionBtn","goMentionUnreadBadge","goToNextMention","btnScheduled","btnToggleReplyMarkup","replyKeyboard","botCommandsToggle","scaler","botCommandsIcon","onAttachMediaClick","videos","fileInput","accept","willAttachType","attachMenuButtons","appAttachMenuBotsManager","getAttachMenuBots","attachMenu","attachMenuBots","attachMenuBotsButtons","attachMenuBot","inactive","getAttachMenuBotIcon","short_name","requestWebView","bot_id","webViewResultUrl","SANDBOX_ATTRIBUTES","P","titleRaw","telegramWebView","sandbox","iframe","onMount","verifyMap","attachMenuPeerTypeSameBotPM","attachMenuPeerTypeBotPM","attachMenuPeerTypePM","attachMenuPeerTypeChat","attachMenuPeerTypeBroadcast","peer_types","multiple","autocompleteHelperController","stickersHelper","emojiHelper","commandsHelper","mentionsHelper","inlineHelper","btnSendContainer","btnSend","emoticonsDropdown","attachMessageInputField","previousQuery","onFakeInput","saveDraft","center","encoderSampleRate","monitorGain","numberOfChannels","recordingGain","reuseWorker","files","touchMouseDown","onstop","ondataavailable","typedArray","dataBlob","Blob","sendFile","isVoiceMessage","isMedia","objectURL","botStartBtn","toggleBotStartBtnDisability","startBot","pinnedControlBtn","originalChat","pinnedMessageContainer","_center","neededFakeContainer","fakeWrapperTo","oldFakeWrapperTo","needTranslateX","fakeSelectionRect","fakeRowsRect","widthFrom","widthTo","initTranslateX","getNeededFakeContainer","isReplyInTopicOverlayNeeded","appNotificationsManager","isPeerLocalMuted","respectType","hasMentions","unread_mentions_count","ignoreEmptyValue","tsNow","syncDraft","helperToo","clearInput","fromUpdate","getDraft","inputFake","wrappedDraft","wrappingForPeerId","myEntities","apiEntities","wrapDraftText","wrapDraft","currentDraft","setInputValue","createSendAs","firstChange","sendAs","updateOffset","getPlaceholderKey","updateMessageInputPlaceholder","previousSendAs","ackedPeerFull","ackedScheduledMids","setSendAsCallback","filteredAttachMenuButtons","filterAttachMenuButtons","placeholderKey","hasBotCommands","updateBotCommands","updateMessageInput","haveSomethingInControl","isAnonymousSending","oldKey","newKey","isEditingAndLocked","restoreInputLock","contentEditable","oldInputField","withLinebreaks","attachMessageInputListeners","fixSafariStickyInputFocusing","isSendShortcutPressed","range","createRange","sel","setStart","childNodes","collapse","removeAllRanges","addRange","readAllHistory","isContentEditable","commandsMap","canCombine","hasMarkup","resetCurrentFontFormatting","executed","prepareApplyingMarkdown","hasMarkupInSelection","resetCurrentFormatting","setActiveMarkupButton","simulateInputEvent","insertText","insertEntity","isHelper","makeFocused","fullValue","substr","AUTO_COMPLETE_REG_EXP","matchIndex","toString","modify","hadValue","_value","foundHelper","checkInlineAutocomplete","needPlaceholder","setPreloaderShow","btnPreloader","inlineMatch","bot_inline_placeholder","inlinePlaceholder","helperWaitingForward","canSetDraft","fireEvent","clearValue","fixSafariStickyInput","getValueAndEntities","clearReply","endOffset","unicode","pushRecentEmoji","sendingParams","fromPeerId","forwardMessages","dropAuthor","dropCaptions","isDroppingCaptions","sendMessageWithDocument","silent","saveRecentSticker","hideCaptionCheckboxField","replyFragment","usingMids","initMessagesForward","fromPeerIdsMids","fromPeerIds","smth","messagesWithCaptionsLength","peerTitles","titleKey","senderTitles","firstMessage","usingFullAlbum","newReply","intl","peerTitleEl","_message","setReplyToMsgId","callerFunc","replyParent","oldReply","haveReply","CLASS_NAME","REACTION_DISPLAY_BLOCK_COUNTER_AT","ReactionElement","_reactionCount","canRenderAvatars","doNotRenderSticker","hadStickerContainer","getReaction","center_icon","renderDoc","wrapPromise","wrapStickerPromise","displayOn","renderAvatars","isChosen","fireAroundAnimation","REACTION_INLINE_SIZE","REACTION_BLOCK_SIZE","around_animation","stickerPromise","iconPlayer","aroundPlayer","removeOnFrame","REACTIONS_ELEMENTS","ReactionsElement","sorted","middlewareHelpers","connectedCallback","onConnectCallback","isPlaceholder","hasReactions","getAvailableReactions","counts","totalReactions","can_see_list","handleChangedResults","MEDIA_SIZE","wrapReplyDivAndCaption","mediaEl","mediaChildren","withoutMediaType","video_thumbs","videoSize","ReplyContainer","isMediaSet","accumulateMapSet","AppSelection","targetLookupClassName","verifyTarget","selecting","firstTarget","processElement","checkBetween","seenSet","seenLength","elementsBetween","getElementsBetween","toggleByMid","canceledSelection","getElementFromTarget","verifyMouseMoveTarget","removeManual","listenElement","documentListenerOptions","firstRect","lastRect","isHigher","lookupBetweenParentClassName","lookupBetweenElementsQuery","firstIndex","lastIndex","doNotAnimate","onCancelSelection","toggleSelection","navigationType","random","verifyTouchLongPress","isElementShouldBeSelected","appendCheckbox","hasCheckbox","getCheckboxInputFromElement","updateContainer","forceSelection","cantForward","cantDelete","cantSend","getStorageKey","cantForwardDeleteMids","onUpdateContainer","selectedMessagesPromises","toggleCheckboxes","wasSelecting","toggleResult","onToggleSelection","updateElementSelection","toggleMid","unselect","SearchSelection","selectionCountEl","selectionGotoBtn","selectionContainer","btnCancel","attachClickOptions","transitionElement","ChatSelection","isGroupedBubbleSelected","getMidsFromGroupContainer","groupContainer","isGroupedSelected","isGroupedMidsSelected","selectionInputWrapper","selectionLeft","selectionRight","translateButtonsX","isGrouped","groupedCheckboxInput","SendMenu","sendMenuButtons","CheckboxField","restriction","stateKey","stateValues","stateValueReverse","stateValue","checkSvg","bg","border","withRipple","withHover","isDisabled","disable","CheckboxFields","createField","info","isNested","nestedTo","nested","asRestrictions","subtitleLangKey","accordion","restrictionText","nodes","nestedCounter","_info","setNestedCounter","titleRow","getNestedCheckedLength","toggleWith","unchecked","processToggleWith","fields","processNestedTo","CodeInputField","assign","lastLength","setLabel","onFill","checkboxes","cancelButton","countries","setCountries","country","default_name","localeCompare","VIRTUAL_COUNTRIES","CountryInputField","hidePicker","hideTimeout","selectCountryByTarget","defaultName","phoneCodeEl","phoneCode","countryCode","lastCountrySelected","lastCountryCodeSelected","country_codes","_countryCode","country_code","onCountryChange","liMap","arrowDown","selectList","initSelect","noPhoneCodes","iso2","liArr","Infinity","spanEmoji","mouseDownHandlerAttached","onKeyPress","names","abbr","word","blur","selectCountryByIso2","countryName","DivAndCaption","DotRenderer","dpr","devicePixelRatio","prepare","generateDot","adding","Path2D","arc","mOpacity","draw","dot","addOpacity","easedOpacity","globalAlpha","renderFirstFrame","EditPeer","_disabled","uploadAvatar","changedLength","requiredLength","requiredValidLength","inputFields","required","nextBtn","withoutAvatar","doNotEditAvatar","avatarEdit","_upload","popupOptions","lockWithPromise","unlockOnSuccess","GifsTab","gifsContainer","EmoticonsDropdown","masonry","EMOTICONSSTICKERGROUP","getGifs","processInvisibleDiv","ANIMATIONGROUP","AppGifsTab","onGifsClick","fileId","inputSearch","gifsDiv","onCloseAfterTimeout","newSearch","gifBotPeerId","AppStickersTab","setsDiv","stickerSet","toggleStickerSet","installed_date","renderFeatured","renderSet","countDiv","stickersDiv","documents","withLock","getFeaturedStickers","coveredSets","filterRendered","covered","searchStickerSets","scrollOptions","transitionFunction","ignoreOutClickClassName","tabId","onSelectTabClick","stickersTab","gifsTab","rights","searchButton","emojiTab","checkRights","canSendToPeer","tabsEl","savedRange","getGoodRange","onOpened","refresh","onClosed","getSavedRange","setStartAfter","newRange","cloneRange","collapsed","node","endContainer","newStartNode","nodeType","TEXT_NODE","nodeValue","ELEMENT_NODE","selectNode","newOffset","deleteContents","HIDE_EMOJI_TAB","INIT_TAB_ID","lastMouseMoveEvent","mouseMoveEventAttached","onMouseOut","getElement","forceClose","addLazyLoadQueueRepeat","divs","intersector","getVisible","clearVisible","rangeCount","getRangeAt","menuOnClick","emoticons","menuScroll","prevTab","jumpedTo","getElementPosition","elementPosition","scrollToTab","scrollingToContent","getCategoryByContainer","which","getCategoryByMenuTab","additionalOffset","setActiveStatic","clientWidth","sendDocId","loadedURLs","appendEmoji","unify","kek","wrapSingleEmoji","fixEmoji","getEmojiFromElement","superEmoji","stickerEmoji","EMOJI_RECENT_ID","EMOJI_RECENT_CATEGORY","CUSTOM_EMOJI_RECENT_CATEGORY","EMOJI_CATEGORIES","category","EMOJI_ELEMENT_SIZE","EmojiTab","onCategoryVisibility","categoriesMap","renderer","newChildren","customEmojis","customEmojiElement","clearCanvas","onContentClick","isStandalone","activeElements","menuInnerScroll","intersectionOptions","categoriesIntersector","menuOnClickResult","innerScrollWrapper","preparedMap","noRegularEmoji","titleLangPackKey","createLocalCategory","unified","addEmojiToCategory","batch","getRecentEmojis","stickerSetId","getLocalStickerSet","getCustomEmojis","recentCustom","mainSet","sets","recentCategory","categories","recentCustomCategory","CUSTOM_EMOJI_RECENT_ID","createRendererForCategory","toggleLocalCategory","resizeCategories","renderStickerSet","toggleCustomCategory","postponedEvent","positionCategory","toggleRenderers","ignore","ignoreSettingDimensions","setDimensionsFromRect","deleteCategory","isCategoryVisible","forceRender","closeScrollTop","createCategory","menuTabPadding","stickerEmojiRaw","setCategoryItemsHeight","getCustomCategory","hasPremium","canSeeCustomCategory","activeEmoji","spliceExceed","onLocalCategoryUpdate","LazyLoadQueueRepeat","parallelLimit","onVisibilityChange","elementsMap","queueItem","wasSeen","setProcessQueueTimeout","SuperStickerRenderer","regularLazyLoadQueue","checkAnimationContainer","processVisible","processInvisible","unobserveAnimated","StickersTabCategory","noMenuTab","getContainerSize","getElementMediaSize","gapX","gapY","elementSize","itemsPerRow","EmoticonsTabC","categoryItemsClassName","postponedEvents","categoriesByMenuTabMap","localCategories","menuWrapper","isLocal","esgWidth","customProperties","posItems","foundMenuScroll","posMenu","notMountedItems","notMountedMenus","itemsIdx","menuIdx","StickersTab","setFavedLimit","categoryAppendStickers","clearCategoryItems","onCategoryStickers","deleteSticker","unshiftSticker","favedCategory","clearButton","clearRecentStickers","premiumCategory","apiManager","getLimit","getRecentStickersStickers","getAllStickers","getPremiumStickers","isPremium","race","rendererLazyLoadQueue","faved","createStickersContextMenu","verifyRecent","unshiftRecentSticker","deleteRecentSticker","generateDelimiter","delimiter","isScam","LazyLoadQueueRepeat2","spliced","findAndSpliceAll","GifsMasonry","scrollPromise","processVisibleDiv","noPreview","transitionTime","scrollableX","proxy","Proxy","apply","that","selectTarget","result1","canChange","mutateCallback","useStripe","indicator","currentIndicator","shiftLeft","insertRichTextAsHTML","createCustomEmojiRendererForInput","customEmojiRenderer","richInputHandler","customEmojiElements","ces","documentFragmentToHTML","pre","getCaretPosNew","onBeforeInput","inputType","removeExtraBOMs","originalEvent","clipboardData","getData","usePlainText","filterEntity","curChild","lines","textLength","lineIndex","line","nextLine","correctedText","entities2","InputState","wrappingDraft","processCustomEmojisInInput","hasSet","InputField","showLengthOn","canBeEdited","labelText","onInputCallbacks","isCollapsed","focusOnNext","clientX","inputMode","labelEl","showingLength","wasError","inputLength","isError","selectNodeContents","selectElementContents","fromSet","originalValue","isValidToChange","setDraftValue","setOriginalValue","setState","Valid","setError","USELESS_REG_EXP","InputFieldAnimated","updateInnerHTML","setHeight","noAnimation","newHeight","currentHeight","transitionDuration","onChangeHeight","InputSearch","prevValue","onClearClick","onClear","searchIcon","clearBtn","LazyLoadQueue","getItem","addElement","LazyLoadQueueIntersector","inProcess","loadItem","intersectorTimeout","processQueue","MediaProgressLine","useTransform","onLoadedData","setSeekMax","progressRAF","setLoadProgress","onProgress","filledLoad","buf","buffered","numRanges","nearestStart","end","realDuration","seek","testQueue","pendingTest","setTestQueue","testElement","getElementWidth","mapped","firstTime","font","textWidth","elementWidth","newElementWidth","widthChanged","smallerText","smallerWidth","smallerTextLength","half","half1","half2","MiddleEllipsisElement","PasswordMonkey","passwordInputField","needFrame","noCache","currentFrame","setSpeed","onVisibilityClickAdditional","passwordVisible","setDirection","curFrame","TrackingMonkey","playAnimation","frame","idleAnimation","PasswordInputHelpers","onVisibilityClick","toggleVisible","stealthy","PasswordInputField","PeerProfileAvatars","draggable","loadCallback","intersectionObserver","loadCallbacks","addTab","gradient","arrowPrevious","arrowNext","checkScrollTop","SWITCH_ZONE","freeze","_e","clickX","toRight","cancelNextClick","lastDiffX","lastX","SCALE","TRANSLATE_TEMPLATE","addIndex","loadNearestToTarget","filterChatPhotosMessages","chat_photo","generateFakeAvatarMessage","activeTab","photo_id","setText","PeerProfile","bio","isAnonymous","getUserPhone","notifications","togglePeerMute","setPeerStatus","setMoreDetails","n","fillUsername","self","fillUserPhone","setAvatar","setPeerStatusInterval","needClear","useWhitespace","ignoreSelf","clearSetMoreDetailsTimeout","canBeDetailed","_setAvatar","isTopic","oldAvatars","getUsernamesAlso","also","anchorCopy","formatUserPhone","fillNotifications","notificationsRow","fillName","fillRows","fillProfileElements","cleaned","_setMoreDetails","peerFull","getMiddlewarePromise","about","exportedInvite","exported_invite","address","setMoreDetailsTimeout","isPeerRestricted","setPromise","makeError","generateTitleIcons","noVerifiedIcon","noFakeIcon","noPremiumIcon","verified","use2","generateVerifiedIcon","emojiStatus","emoji_status","generatePremiumIcon","weakMap","WeakMap","PeerTitle","setOptions","setHasInner","hasInner","fromName","limitSymbols","topic","forumTopic","getTopicIconPromise","icons","topicIcon","getPeerTitle","PopupAvatar","cropper","crop","removeHandlers","h6","cropContainer","contents","onload","originalImage","cropComponent","cropImage","event_state","cropLeft","cropTop","cropWidth","cropHeight","scaledRatio","overlayColor","CROPWIDTH","CROPHEIGHT","updateCropSize","updateCropImage","startMoving","keyHandler","imgZoom","newWidth","String","fromCharCode","charCode","stopPropagation","container_width","container_height","container_left","container_top","mouse_x","scrollX","mouse_y","clientY","pageY","scrollY","saveEventState","moving","endMoving","currentTouch","complete","toBlob","darkenCanvas","onCrop","postCanvas","ctx","PopupDatePicker","selectedDate","selectedMonth","setMonth","getMonth","minMonth","prevBtn","maxMonth","onDateClick","selectedEl","setTimeTitle","monthsContainer","handleTimeInput","onOverflow","maxString","hoursInputField","minutesInputField","number","setMinutes","getMinutes","getHours","popupCenterer","timeOptions","minute","hour","sendDate","dateOptions","weekday","renderElement","firstDate","weekStartDate","getDay","dayIndex","clonedDate","PopupDeleteDialog","peerTitleElement","getDialogType","callbackLeave","flush","leave","flushHistory","callbackDelete","titleArgs","descriptionArgs","isDanger","titleLangArgs","PopupDeleteMessages","revoke","deleteScheduledMessages","deleteMessages","isMegagroup","_hasRights","canRevoke","PopupForward","peerIdMids","chatRightsAction","peerTypes","messagesPromises","DEFAULT_APPEND_TO","appendPopupTo","onFullScreenChange","PopupElement","reAppend","MANAGERS","withoutOverlay","attachScrollableListeners","btnConfirmOnEnter","buttonsElements","langArgs","POPUPS","setClassOn","attachBorderListeners","onContentUpdate","popupConstructor","ctor","addCancelButton","PopupJoinChatInvite","chatInvite","request_needed","broadcast","importChatInvite","savePhoto","peopleCount","pin","descriptionPremium","descriptionLocked","folders","_a","limitPremium","isLocked","limitContainer","hint","free","setHintActive","showLimitPopup","appConfig","premium_purchase_blocked","ONE_HOUR","PopupMute","mutePeer","muteUntil","radioForm","createPosterFromMedia","scaleMediaElement","quality","getGifDuration","arrayBuffer","currentPopup","getCurrentNewMediaPopup","PopupNewMedia","ignoreInputValue","attachFile","willAttach","shouldCompress","itemDiv","defineNotNumerableProperties","attachMedia","attachDocument","sendFileDetails","backgroundColor","onlyVisible","actionsPromises","captionMaxLength","captionLengthMax","canSendPhotos","send_photos","canSendVideos","send_videos","canSendDocs","send_docs","changeType","hasAnyMedia","mimeTypes","changeGroup","canGroupSomething","changeSpoilers","canToggleSpoilers","wasInputValue","attachFiles","createContextMenu","applyMediaSpoiler","removeMediaSpoiler","findElement","widthStr","heightStr","containerWidthStr","containerHeightStr","toDataURL","strippedBytes","reveal","destroyAfter","appendDrops","mediaCount","mediaWithSpoilers","addFiles","toPush","_file","lastModified","foundBad","sendFileParams","noSound","shake","scaledBlob","sendAlbum","modifyMimeTypeForTelegram","scaleImageForTelegram","convertWebp","PHOTO_SIDE_LIMIT","revokeObjectURL","startsWith","audioDecodedByteCount","webkitAudioDecodedByteCount","onseeked","onerror","createPosterFromVideo","scaled","isPhoto","isAudio","Audio","onRender","foundPhotos","foundVideos","foundFiles","appendMediaToContainer","calcImageInBox","firstType","oldSendFileDetails","albumContainer","o","oldParams","stringResults","numberResults","replaceNonNumber","CARD_BRAND_REGEXP","visa","mastercard","amex","discover","diners","diners14","jcb","unionpay","elo","mir","CARD_BRANDS","minLength","cvcMaxLength","cvcMinLength","unknown","detectCardBrand","card","sanitizedCard","brand","detectUnifiedCardBrand","createArray","delta","charCodeAt","buggedRegExp","getDistanceFromBuggedToNormal","char","fixBuggedNumbers","makeOptionalCharacter","consumed","makeRequiredCharacter","partial","wrapCharacterRegExpFactory","optional","_regExp","source","makeCharacter","makeMonthDigitPatternCharacter","digit","capitalCharacter","toUpperCase","cleanedResult","formattingCharacter","str1","makeFormattingCharacter","optionalPattern","spaceCharacter","yearOptionalPattern","sixteenPattern","fifteenPattern","requiredPostcodes","generateFourPattern","cardFormattingPatterns","cardNumber","cardExpiry","cardCvc","cardCvcFromBrand","pattern","postalCodeFromCountry","optionalDigits","accumulateLengths","strs","accumulate","nbspRegExp","makeValidationError","validateCardNumber","sanitized","getCardInfoByNumber","ignoreIncomplete","validateCompleteCardNumber","makeCardNumberError","validateCardExpiry","monthStr","yearStr","_year","nextMonth","isNaN","validateExpiry","createVerificationIframe","allow","PopupPaymentVerification","openPathAfter","path_full","InputFieldCorrected","lastKeyDown","deleting","lastTransformed","getPattern","pushRest","autocorrectComplete","selectionStart","selectionEnd","character","getCharacter","meta","formatInputValueByPattern","formatMethod","transformedValue","validateNew","onBlur","justReturn","validateMethod","validateAnyIncomplete","errorKeys","handleInputFieldsOnChange","_onChange","original","createCountryZipFields","zip","countryInputField","postcodeInputField","SUPPORTED_NATIVE_PROVIDERS","PopupPaymentCard","paymentForm","savedCard","native_provider","cardOut","token","credentials","can_save_credentials","cardSection","nativeParams","JSON","parse","native_params","lastBrand","lastBrandImg","brandIconTempId","cardInputField","invalid","incomplete","transformed","getPaymentBrandIconPath","setBrandIcon","cvcInputField","nameInputField","need_cardholder_name","expireInputField","switchFocusOrder","previousInputField","nextInputField","inputFieldsRow","form","billingSection","need_country","need_zip","canSave","saveCheckboxField","saveRow","payButton","PaymentButton","expiryFull","expiryMonth","expiryYear","cvc","cardholderName","nativeProvider","URLSearchParams","headers","publishable_key","json","expiration_month","expiration_year","security_code","public_token","stringify","PopupPaymentCardConfirmation","passwordState","captionArgs","inputCheckPassword","passwordManager","getInputCheckPassword","tmpPassword","invokeApi","password","handled","PopupPaymentShipping","invoice","savedInfo","saved_info","addressSection","address1InputField","address2InputField","cityInputField","stateInputField","receiverSection","emailInputField","telInputField","shipping_address_requested","name_requested","email_requested","phone_requested","validateEmail","matchEmail","validatePhone","selectedCountry","shipping_address","street_line1","street_line2","city","country_iso2","post_code","email","requestedInfo","validateRequestedInfo","shippingAddress","ADDRESS_STREET_LINE1_INVALID","ADDRESS_STREET_LINE2_INVALID","ADDRESS_COUNTRY_INVALID","ADDRESS_CITY_INVALID","ADDRESS_STATE_INVALID","ADDRESS_POSTCODE_INVALID","REQ_INFO_NAME_INVALID","REQ_INFO_EMAIL_INVALID","REQ_INFO_PHONE_INVALID","focusField","PopupPaymentShippingMethods","shippingOption","shipping_options","prices","amount","lastShippingId","PopupPayment","isReceipt","tipButtonsMap","confirmed","onConfirmed","popupPaymentVerification","itemEl","detailsClassName","photoEl","linesClassName","linesEl","botName","preloaderContainer","getPaymentReceipt","msg_id","getPaymentForm","savedCredentials","saved_credentials","lastRequestedInfo","providerPeerTitle","getState","provider_id","wrapAmount","skipSymbol","isRecurring","recurring","peerTitle2","makeLabel","pricesClassName","makePricesElements","price","_label","wrappedAmount","pricesElements","getTipsAmount","shippingAmount","setTotal","totalAmount","totalLabel","payI18n","canTip","max_tip_amount","tip_amount","tipsClassName","currencyData","getInputValue","setInputWidth","getTextWidth","unsetActiveTip","tipEl","tipsLabel","haveToIgnoreEvents","onSelectionChange","ignoreNextSelectionChange","onFocus","onFocusOut","symbol","space_between","symbol_left","tipsEl","tipClassName","tipButtons","suggested_tip_amounts","tipAmount","prevTipEl","setRowIcon","createMedia","createRow","noWrap","setRowTitle","setCardSubtitle","methodRow","onMethodClick","previousCardDetails","previousToken","credentials_title","providerRow","providerAvatar","shippingAddressRow","shippingNameRow","shippingEmailRow","shippingPhoneRow","shippingMethodRow","lastShippingOption","onShippingAddressClick","onShippingMethodClick","setShippingTitle","postAddress","setShippingInfo","setShippingOption","lastShippingPricesElements","shipping","acceptTermsCheckboxField","recurring_terms_url","acceptTermsRow","recurringElements","lastTmpPasword","missingInfo","tmp_password","paymentResult","sendPaymentForm","form_id","_passwordState","valid_until","PopupPeer","PopupPickUser","PopupSendNow","sendScheduledMessages","PopupStickers","isEmojis","onStickersClick","updateAdded","stickersFooter","onStickerSetUpdate","_set","updateButton","loadStickerSet","createStickerSetElements","headerRow","buttonRight","added","itemsContainer","setsPromises","firstSet","isStickerPack","onSend","containersPromises","toggleStickerSets","isAdd","buttonAppend","installed","PopupPinMessage","unpin","canUnpin","oneSide","unpinAllMessages","hidePinnedMessages","updatePinnedMessage","buttonText","getPinnedMessagesCount","pinButtonText","ProgressivePreloader","isUpload","attachMethod","loadFunc","constructContainer","bold","constructDownloadIcon","downloadSvg","cancelSvg","func","startTime","onEnd","notify","TRANSITION_TIME","addNotifyListener","Layouter","ratios","countRatios","proportions","countProportions","averageRatio","maxSizeRatio","layout","ComplexLayouter","layoutTwo","layoutThree","layoutFour","layoutTwoTopBottom","layoutTwoLeftRightEqual","layoutTwoLeftRight","layoutThreeLeftAndOther","layoutThreeTopAndOther","layoutFourTopAndOther","layoutFourLeftAndOther","geometry","sides","RectPart","minimalWidth","secondWidth","firstWidth","firstHeight","thirdHeight","secondHeight","rightWidth","leftWidth","thirdWidth","h0","w0","w2","w1","h1","h2","ratio","cropRatios","attempts","multiHeight","pushAttempt","lineCounts","heights","second","third","fourth","optimalAttempt","optimalDiff","attempt","lineCount","totalHeight","minLineHeight","bad1","bad2","optimalCounts","optimalHeights","rowCount","colCount","lineHeight","col","widthItem","heightItem","borderTopLeftRadius","borderBottomLeftRadius","borderTopRightRadius","borderBottomRightRadius","putAvatar","renderThumbPromise","thumbImage","isFullLoaded","loadThumbPromise","stripped_thumb","getPreviewURLFromBytes","sequentialDom","myId","getForumTopic","avatarAvailable","avatarRendered","appAvatarsManager","isAvatarCached","getPeerInitials","returnDiv","setButtonLoader","RadioField","alignRight","RadioForm","radios","RangeSelector","events","setFilled","filled","stepStr","decimals","_removeListeners","addProgress","rectMax","offsetAxisValue","rippleClickId","attachListenerTo","handler","drawRipple","clickId","_handler","touchStartFired","clickY","isRippleUnneeded","touchEnd","setContent","Row","checkboxFieldOptions","subtitleRight","subtitleRow","subtitleLangArgs","isToggle","withCheckboxSubtitle","titleRightContent","titleRightSecondary","createTitle","navigationTab","buttonRightLangKey","_subtitle","createSubtitle","midtitle","_midtitle","createMidtitle","disableWithPromise","makeSortable","sortIcon","toggleSorting","CreateRowFromCheckboxField","RadioFormFromRows","RadioFormFromValues","checkedRadioField","ScrollableBase","logPrefix","onScrollMeasure","needCheckAfterAnimation","scrollPosition","scrollProperty","addScrollListener","addedScrollListener","removeScrollListener","removeHeavyAnimationListener","Scrollable","onScrollOffset","withPaddingContainer","maxScrollTop","ScrollableX","splitCount","scrollHorizontally","deltaX","scrollWidth","SettingSection","fakeGradientDelimiter","generateContentElement","nameArgs","captionOld","generateSection","AppNewGroupTab","isGeoChat","inputWrapper","groupNameInputField","groupLocationInputField","valueCheck","userLocationCoords","userLocationAddress","createChannel","geo_point","megagroup","inputFile","editPhoto","inviteToChannel","createChat","chatsSection","new","startLocating","usersPromise","myUserPromise","getSelf","users","setTitlePromise","myUser","joined","isLast","geolocation","getCurrentPosition","lat","coords","latitude","long","longitude","uri","display_name","GeolocationPositionError","PrivacyType","getPrivacyRulesDetails","rules","types","allowPeers","disallowPeers","rule","PrivacySection","onRadioChange","captions","captionElement","radioSection","exceptions","radioRows","skipTypes","noExceptions","exceptionTexts","exception","_peerIds","slider","createTab","skippable","takeOut","newPeerIds","generateStr","splitPeersByType","selectedPeerIds","appPrivacyManager","getPrivacy","inputKey","setRadio","eventListener","chatKey","usersKey","getUserInput","setPrivacy","AppPrivacyPhoneNumberTab","captionEl","mePath","phoneSection","sCaption","AppTwoStepVerificationSetTab","inputContent","btnReturn","sliceTabsUntilTab","AppSettingsTab","canFocus","isFirstInput","AppTwoStepVerificationEmailConfirmationTab","codeInputField","confirmPasswordEmail","goNext","btnChange","btnResend","cancelPasswordEmail","AppTwoStepVerificationEmailTab","resendPasswordEmail","onOpenAfterTimeout","onContinueClick","btnContinue","btnSkip","toggleButtons","updateSettings","currentPassword","plainPassword","newPassword","symbols","AppTwoStepVerificationHintTab","onSkipClick","saveHint","AppTwoStepVerificationReEnterPasswordTab","monkey","verifyInput","AppTwoStepVerificationEnterPasswordTab","isNew","has_password","getStateInterval","_state","check","auth","AppTwoStepVerificationTab","removeTabFromHistory","btnChangePassword","btnDisablePassword","btnSetRecoveryEmail","has_recovery","btnSetPassword","AppPrivacyLastSeenTab","AppPrivacyProfilePhotoTab","AppPrivacyForwardMessagesTab","AppPrivacyAddToGroupsTab","AppPrivacyCallsTab","AppActiveSessionsTab","Session","app_name","app_version","ip","date_active","date_created","device_model","system_version","platform","authorizations","session","btnTerminate","otherSection","onError","onTerminateClick","menuElement","AppBlockedUsersTab","btnAdd","toggleBlock","blocked","getBlocked","convertKeyToInputKey","AppPrivacyVoicesTab","AppActiveWebSessionsTab","sessions","region","domain","browser","appSeamlessLoginManager","resetWebAuthorizations","leftLength","resetWebAuthorization","AppPrivacyAndSecurityTab","fromTab","getAppConfig","globalPrivacy","getGlobalPrivacySettings","contentSettings","webAuthorizations","getWebAuthorizations","SUBTITLE","blockedPeerIds","blockedUsersRow","twoFactorRowOptions","email_unconfirmed_pattern","twoFactorRow","activeSessionsRow","updateActiveSessions","websitesRow","updateActiveWebsites","websites","setBlockedCount","updateBlocked","rowsByKeys","numberVisibilityRow","lastSeenTimeRow","photoVisibilityRow","callRow","linkAccountRow","groupChatsAddRow","voicesRow","updatePrivacyRow","disallowLength","allowLength","destroyed","setGlobalPrivacySettings","archive_and_mute_new_noncontact_peers","settings","onPremiumToggle","autoarchive_setting_available","_enabled","sensitive_enabled","sensitive_can_change","payment","clearSavedInfo","deleteButton","clearAllDrafts","auths","AppPowerSavingTab","infoSection","checkboxFields","wrap","mainKey","flatten","field","created","onAllChange","wasAll","appStateManager","setByKey","RangeSettingSelector","initialValue","minValue","writeValue","valueDiv","valueContainer","AppGeneralSettingsTab","themes","chatBackgroundButton","initArgs","getLiteModeStatus","animationsCheckboxField","animationsRow","liteModeRow","themesContainer","themesMap","currentTheme","themeController","isNight","applyThemeOnItem","theme","wallPaperContainer","wallPaperContainers","lastOnFrameNo","lastActive","onFrameNo","availableBaseThemes","defaultThemes","default","themeSettings","base_theme","wallPaper","wallpaper","emoticonContainer","bubbleIn","dayRow","nightRow","systemRow","newIsNight","enterRow","ctrlEnterRow","kilometersRow","milesRow","formats","format","runFirst","getNextTimeout","_callback","run","eachTimeout","getSeconds","eachMinute","toLocaleTimeString","AppChatFoldersTab","filtersRendered","animationData","renderFolder","dialogFilter","non_contacts","broadcasts","bots","folder","getFolderDialogs","channels","filtersStorage","getFilter","setInitFilter","localId","getInitArgs","createFolderBtn","foldersSection","suggestedSection","canCreateFolder","onFiltersContainerUpdate","renderFiltersPromise","toggleAllChats","getSuggestedFilters","loadAnimationPromise","onSort","prevIdx","newIdx","updateDialogFiltersOrder","getDialogFilters","getSuggestedDialogsFilters","suggestedFilters","includePeerIds","excludePeerIds","pinnedPeerIds","createDialogFilter","AppNotificationsTab","NotifySection","enabledRow","typeText","previewEnabledRow","inputNotifyPeer","getNotifySettings","notifySettings","applySettings","isMuted","show_previews","mute","showPreviews","inputSettings","mute_until","flags","updateNotifySettings","notify_settings","contactsSignUpRow","soundRow","sound","getContactSignUpNotification","setContactSignUpNotification","AppLanguageTab","languages1","lang_pack","languages2","rendered","webLangCodes","language","lang_code","native_name","autoDownloadPeerTypeSection","contactsCheckboxField","privateCheckboxField","groupsCheckboxField","channelsCheckboxField","AppAutoDownloadPhotoTab","AppAutoDownloadFileTab","debouncedSave","sizeMax","MIN","MAX_RANGE","upTo","formatBytes","AppAutoDownloadVideoTab","AUTO_DOWNLOAD_FOR_KEYS","private","AppDataAndStorageTab","autoCheckboxField","autoRow","resetButton","deepEqual","setSubtitles","setAutoDownloadSubtitle","photoRow","videoRow","fileRow","openTab","tabConstructor","autoDownloadNew","onDisabledChange","peerKeys","enabledKeys","isAll","AppQuickReactionTab","getQuickReaction","quickReaction","setDefaultReaction","AppStickersAndEmojiTab","allStickers","suggestStickersRow","none","setStickersSuggestDescription","setStickersSuggest","listenForClick","reactionsRow","renderQuickReaction","getCustomEmojiDocument","loopStickersRow","suggestEmojiRow","bigEmojiRow","dynamicPackOrderRow","stickerSets","stickersContent","reorderStickerSets","logOut","edit","profile","changeAvatarBtn","upload","uploadProfilePhoto","updateChangeAvatarBtn","languageArgs","devicesRow","languageRow","buttonsSection","getEditProfileArgs","editProfileArgs","getAuthorizations","overwrite","getAuthorizationsPromise","AppNewChannelTab","channelNameInputField","channelDescriptionInputField","onLengthChange","channelId","PopupCreateContact","importContact","lastNameInputField","editPeer","AppContactsTab","openContacts","isContact","sortedUserList","createList","renderPage","AppArchivedTab","wasFilterId","ul","AppPeopleNearbyTab","isLocationWatched","parseDistance","startWatching","latestLocationSaved","getLocated","accuracy","watchPosition","isLongitudeDifferent","isLatitudeDifferent","distanceCheck","calculateDistance","stopWatching","lat1","long1","lat2","long2","asin","LEFT_COLUMN_ACTIVE_CLASSNAME","AppSidebarLeft","sidebarEl","sidebarHeader","onContactsClick","backBtn","btnArchive","isDialogsLoaded","themeCheckboxField","sessionStorage","kz_version","installPrompt","toolsBtn","btnMenuFooter","rel","archivedCount","newBtnMenu","updateBtn","reload","initSearch","unreadPeerIds","checkUpdateInterval","cache","ok","hasUpdate","onResize","documentElement","searchContainer","pickedElements","selectedPeerId","selectedMinDate","selectedMaxDate","updatePicked","removeProperty","unselectEntity","renderEntity","dates","dateData","pushRecentSearch","peopleContainer","hideNewBtnMenuTimeout","transition","activeClassName","clearRecentSearchBtn","clearRecentSearch","appSidebarLeft","AppAddMembersTab","attachToPromise","isPrivacy","removeLoader","averageColorFromCanvas","pixel","getImageData","pixelsLength","outPixel","Uint8ClampedArray","highlightningColor","rgba","ColorPicker","hue","saturation","lightness","onGrabStart","boxDragger","onGrabEnd","sliders","hueDragger","hexInputField","rgbInputField","setColor","rgbRegExp","attachBoxListeners","attachHueListeners","attachGrabListeners","boxRect","saturationHandler","hueRect","hueHandler","updateHexInput","updateRgbInput","rgb","boxX","percentY","boxY","percentHue","hueX","updatePicker","getCurrentColor","rgbaArray","hexa","hsl","hsla","posX","posY","lightnessX","lightnessY","AppBackgroundColorTab","_applyColor","updateColorPicker","colorPicker","background_color","pushToState","onColorChange","applyColor","gridSection","grid","throttle","isColored","AppBackgroundTab","clicked","wallPapersByElement","elementsByKey","onUploadClick","requestFile","endsWith","createObjectURL","File","prepareWallPaperUpload","uploadPromise","uploadWallPaper","uploadDeferred","getWallPaperKey","setBackgroundDocument","addWallPaper","onResetClick","defaultTheme","blurCheckboxField","onGridClick","getWallPaperKeyFromTheme","backgrounds","uploadButton","colorButton","wallPapers","gridContainer","hasFile","isDark","dark","intensity","webkitMaskImage","_tempId","saveToCache","slug","hadSettings","getPixelPromise","imageUrl","imageSource","averageColorFromImageSource","averageColor","AppIncludedChatsTab","getContacts","foundInFilters","dialogsByFilters","onSelectChange","confirmBtn","editFolderTab","originalFilter","cmp","pinned_peers","other","otherLegacy","getInputPeerById","setFilter","onAppConfig","dialog_filters_chats_limit_premium","dialog_filters_chats_limit_default","categoriesSection","exclude_muted","ico","exclude_archived","exclude_read","selectedPeers","addedInitial","_add","AppEditFolderTab","deleteFolderButton","updateDialogFilter","menuBtn","inputSection","generateList","h2Text","includedFlagsContainer","excludedFlagsContainer","include","include_peers","editCheckForChange","reloadMissingPromises","reloadMissingPeerIds","onEditOpen","onCreateOpen","ignoreClick","hasPeer","renderMore","exclude_peers","purchaseUsernameCaption","purchaseText","setUsername","AppEditProfileTab","bioMaxLength","firstNameInputField","bioInputField","usernameInputField","isPurchase","availableText","takenText","invalidText","profilePromise","updateProfile","updateUsername","RIGHT_COLUMN_ACTIVE_CLASSNAME","AppSidebarRight","canHideFirst","isColumnProportionSet","toggleSidebar","setColumnProportion","createSharedMediaTab","replaceSharedMediaTab","previousTab","sharedMediaTab","historyTabIds","_selectTab","getFrom","setFrom","onCloseTab","isNavigation","willChange","appSidebarRight","AppEditContactTab","privacy","notificationsCheckboxField","profileNameDiv","profileSubtitleDiv","phoneRow","privacyRule","sharePhoneCheckboxField","btnDelete","deleteContacts","addContact","AppEditTopicTab","colorIndex","isGeneral","originalTopic","iconDiv","icon_emoji_id","setIcon","editForumTopic","topicId","iconEmojiId","createForumTopic","iconColor","emojiElement","icon_color","isMainIcon","newTopic","oldTopic","oldEl","applyFadeAnimation","fadeIn","iterations","easing","AppChatTypeTab","privateRow","publicRow","privateSection","publicContainer","chatUpdateListeners","basic","linkRow","btnRevoke","getChatInviteLink","publicSection","linkInputField","applyBtn","getValue","head","usernamesSection","getPeerEditableUsername","wasUsername","migrateChat","makeChannelPrivate","toggleNoForwards","onChatUpdate","noforwards","addChatUpdateListener","AppUserPermissionsTab","destroyListener","ChatPermissions","banned_rights","editBanned","btnDeleteException","clearChannelParticipantBannedRights","kickFromChannel","kickFromChat","defaultBannedRights","default_banned_rights","defaultRights","combineParticipantBannedRights","mediaNested","exceptionText","mediaToggleWith","mainFlag","embed_links","until_date","IGNORE_FLAGS","AppGroupPermissionsTab","chatPermissions","editChatDefaultBannedRights","addExceptionRow","openPermissions","getParticipant","setSubtitle","bannedRights","cantWhat","dialogDom","needAdd","new_participant","view_messages","prev_participant","exceptionsCount","setLength","setLoader","migrateFrom","migrateTo","AppChatReactionsTab","getActiveAvailableReactions","_chatReactions","available_reactions","chatReactions","makeReactionFromEmoticons","getCaptionLangPackKey","toggleSection","reactionsSection","toggleCheckboxFieldsByEmoticons","checkboxFieldsByEmoticon","toggleCheckboxField","toggleRow","saveReactionsDebounced","allow_custom","saveReactions","setChatAvailableReactions","isDebounced","AppEditChatTab","_init","canChangeType","canChangePermissions","canManageTopics","getCachedFullChat","chatNameInputField","descriptionInputField","chatTypeRow","setChatTypeSubtitle","availableReactionsLength","setReactionsLength","chatAvailableReactions","permissionsRow","setPermissionsLength","forum_upgrade_participants_min","topicsRow","setTopics","toggleForum","editTitle","editAbout","signMessagesCheckboxField","signatures","toggleSignatures","showChatHistoryCheckboxField","togglePreHistoryHidden","hidden_prehistory","historiesStorage","AppSharedMediaTab","newCloseBtn","animatedCloseIcon","transitionContainer","transitionFirstItem","titleI18n","editBtn","transitionLastItem","secondTitle","setIsSharedMedia","isSharedMedia","isHeavy","onCloseBtnClick","toggleEditBtn","deleteDeletedMessages","btnAddMembers","showConfirmation","addChatUser","_deleteDeletedMessages","setLoadMutex","peerChanged","changeTitleKey","loadSidebarMedia","destroyable","SetTransition","raf","afterTimeout","SidebarSlider","closeTab","closingId","onOpenTab","preserveTab","getTab","isTabExists","deleteTab","doNotAppend","SliderSuperTab","_constructor","SliderSuperTabEventable","dispatchResultableEvent","SortedUserList","getIndex","getUserStatusForSort","onDelete","onListLengthChange","willChangeLength","onElementCreate","base","updateElementWith","updateListWith","createChatListOptions","doTimeout","updateList","SORT_INTERVAL","AVATAR_CLASS_NAME","AVATAR_CONTAINER_CLASS_NAME","StackedAvatars","hasViewer","attachStickerViewerListeners","originalFindTarget","checkForParent","_middleware","previousTransformer","doThatSticker","lockGroups","isSwitching","effectThumb","mediaRect","fitted","aspectFitted","transformer","transformX","transformY","relativeEffect","loopEffect","firstFramePromise","prevPlayer","onMousePreMove","newMediaContainer","_previousTransformer","StickyIntersector","observeHeaders","observeElements","headersObserver","targetInfo","boundingClientRect","stickyTarget","rootBoundsInfo","rootBounds","threshold","elementsObserver","addSentinel","sentinel","headerSentinel","getEvent","getDistance","hypot","getTouchCenter","attachGlobalListenerTo","RESET_GLOBAL","TOUCH_MOVE_OPTIONS","MOUSE_MOVE_OPTIONS","WHEEL_OPTIONS","SwipeHandler","handleMove","setCursorTo","hadMove","releaseWheelDrag","releaseWheelZoom","resetValues","handleStart","isMouseDown","initialDistance","initialTouchCenter","verifyResult","withDelay","xDown","yDown","eventUp","onStart","xUp","yUp","xAdded","yAdded","setHadMove","endDistance","touchCenter","dispatchOnSwipe","handleWheel","is","onWheelCapture","onWheelZoom","handleWheelDrag","isDragCanceled","sign","initialDragOffset","dx","dy","wheelZoom","setCursor","onSwipeResult","TelInputField","pasted","lastValue","telEl","pixelRatio","letterSpacing","originalFunc","formattedPhoneNumber","leftPattern","TelegramWebView","onTelegramWebViewEvent","eventType","eventData","contentWindow","toastEl","hideToast","toastNew","transitions","navigation","prevTabContent","animateFirst","withAnimationListener","animationFunction","_animateFirst","onTransitionEndCallbacks","animationDeferred","listenerName","onEndEvent","overrideFrom","onTransitionEndCallback","transitionTimeout","_from","isUsernameValid","UsernameInputField","checkUsernameDebounced","checkUsername","checkUsernamePromise","checkPromise","available","UsernamesSection","_usernames","sortedList","editable","changeActive","applyUsernames","getAll","_peerId","cancelClick","newActive","toggleUsername","reorderUsernames","VisibilityIntersector","locked","change","refreshVisible","VolumeSelector","onMuteClick","setVolume","iconIndex","ICONS","wrapCustomEmoji","repeat","wrapCustomEmojiAwaited","wrapDocument","noAutoDownload","uploadFileName","extSplitted","ext","icoDiv","icoTextEl","hadContext","hasThumb","fileName","bytesContainer","descriptionParts","bytesMaxEl","sizeDiv","_downloadDiv","addByteProgress","sizeContainer","_bytesContainer","_d","canOpenAfter","downloadFileName","downloadId","isDownloading","support","was_online","dateEl","toggleMediaSpoiler","onMediaSpoilerClick","wrapMediaSpoilerWithImage","wrapMessageActionTextNew","plain","hadColors","wrapJoinVoiceChatAnchor","wrapLinkToMessage","dir","wrapSomeText","htmlToSpan","wrapTopicIcon","ns","contentSpan","gradientId","strokeColor","clone","topicAvatar","wrapMessageActionTopicIcon","wrapMessageActionTopicIconAndName","wrapMessageActionTextNewUnsafe","unsafeMessage","getNameDivHTML","post","schedule_date","daysToStart","tomorrowDate","_args","fetchMessageReplyTo","anchorHTML","isRecurringInit","recurring_init","isRecurringUsed","recurring_used","invoiceMessage","titleElement","authorElement","isMe","isIconChanged","isIconRemoved","isTitleChanged","isHiddenChanged","waited","wrapMessageForReply","hasAlbumKey","addPart","albumText","game","actionWrapped","restriction_reason","exec","messageWrapped","noTextFormat","wrapPeerTitle","wrapPhoto","noThumb","blurAfter","isImageFromDocument","isWebDoc","isFit","renderOnLoad","canAttachPreloader","haveToDownload","onlyCache","getDownloadPromise","wrapReply","setColorPeerId","wrapSenderToPeer","senderTitle","fromMe","wrapSentTime","STICKER_EFFECT_MULTIPLIER","locksUrls","videosCache","_timeout","wrapSticker","loadStickerMiddleware","exportLoad","asStatic","fullThumb","isCustomEmoji","syncedVideo","isEffect","stickerType","isAnimated","willHaveLock","lockUrl","toneIndex","isThumbNeededForType","lottieCachedThumb","getLottieCachedThumb","haveThumbCached","afterRender","getPathFromBytes","getPreviewURLFromThumb","stickerThumbConverted","webpWorkerController","saveWebPConvertedStrippedThumb","getImageFromStrippedThumb","middlewareError","sync","setLockColor","skipx","skipy","imageData","sr","sg","sb","sa","outCanvas","outContext","computeLockColor","onFirstFrame","saveLottiePreview","preloadAnimatedEmojiStickerAnimation","isSingleVideo","cacheName","framesCache","cachePromise","previousTime","playedTimes","onTimeupdate","mediaLength","lastPromise","_media","preloadSticker","playing","isAvailable","animationDiv","attachStickerEffectHandler","onEmojiStickerClick","getAnimatedEmojiSoundDocument","activeAnimations","emojiData","sendInteractionThrottled","interaction","withRandomOffset","onUnmount","wrapStickerAnimation","unmountAnimation","vibrate","generateRandomSigned","randomOffsetX","randomOffsetY","setPosition","factor","stableOffsetX","stableOffsetY","rectX","rectY","addOffsetX","addOffsetY","wrapStickerEmoji","wrapStickerSetThumb","downloadOptions","getStickerSetThumbDownloadOptions","getDocPromise","thumb_document_id","wrapStickerToRow","previousMedia","_size","wrapTopicNameButton","roundVideoCircumference","wrapVideo","isAlbumItem","canAutoplay","spanTime","spanPlay","needPlayButton","photoRes","divRound","halfSize","globalVideo","onPaused","onFrame","renderDeferred","loadPhotoThumbFunc","wrapWebPageDescription","shortDescriptionText","wrapWebPageTitle","shortTitle","EmojiVersions","Emoji","version","FontFamily","FontSize","FontWeight","instances","getAnimationInstance","cancelAnimationByKey","instance","isCancelled","animateSingle","tick","createAnimationInstance","AudioAssetPlayer","assets","playSound","assetName","createAudio","playSoundIfDifferent","stopSound","cancelDelayedPlay","playSoundWithTimeout","heavyQueue","processingQueue","addHeavyTask","processHeavyQueue","todo","possiblePromise","realResult","timedChunk","requireBlurPromise","fastBlurFunc","processBlurNext","dataUri","JPEG_HEADER","bytesFromHex","JPEG_TAIL","getPreviewBytesFromURL","needle","jpegBytes","atob","isSticker","convertToUint8Array","btoa","bytesToDataURL","imageW","imageH","boxW","boxH","noZoom","boxedImageW","boxedImageH","drawCircle","beginPath","closePath","drawCircleFromStart","measureText","createImageBitmap","resizeWidth","resizeHeight","badCharsRe","trimRe","C2L","clearBadCharsAndTrim","latinize","processSearchText","clearBadChars","hasTag","includeTag","charAt","originalText","ch","latinizeCh","latinizeString","fixCyrillic","fallbackCopyTextToClipboard","textArea","removeChild","copyTextToClipboard","clipboard","writeText","ContextMenuController","diffX","diffY","isOpened","openBtnMenu","months","days","ONE_DAY","getWeekNumber","UTC","dayNum","getUTCDay","setUTCDate","getUTCDate","yearStart","getUTCFullYear","formatDateAccordingToTodayNew","formatFullSentTimeRaw","formatTime","capitalize","textTransform","formatFullSentTime","getFullDate","monthAsNumber","noSeconds","leadingZero","noTime","minYear","yearPattern","monthYearOrDayPattern","yearOrDayAndMonthPattern","shortDate","longDate","numberOfDaysEachMonth","fillTipDates","dayOfWeek","formatWeekLong","getDayOfWeek","g1","g2","createForDayMonth","createForMonthYear","selectedYear","currentYear","g3","validDateForMonth","formatterYearMax","k1","formatterMonthYear","formatterDayMonth","T_ME","copyWhat","copyText","_cancelContextMenuOpening","_cancelContextMenuOpeningTimeout","cancelContextMenuOpening","onCancel","onMove","isTouch","onTouchEnd","touch","changedTouches","lastMouseDownElement","hasMouseMovedSinceDown","CLICK_EVENT_NAME","simulateClickEvent","ControlsHover","setHideTimeout","hideControlsTimeout","isShown","controlsLocked","toggleControls","relatedTarget","onBeforeOpen","disablePictureInPicture","resetCache","computedStyle","getProperty","getPropertyAsSize","simulateEvent","Event","tag","requestFullScreen","requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","msRequestFullscreen","cancelFullScreen","mozCancelFullScreen","webkitCancelFullScreen","msExitFullscreen","addFullScreenListener","addListener","eventName","getFullScreenElement","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","msFullscreenElement","isFullScreen","getCaretPosF","childNodesLength","alt","markdownTags","entityName","underline","italic","monospace","strikethrough","mentionName","BLOCK_TAGS","BOM_REG_EXP","SELECTION_SEPARATOR","checkNodeForEntity","follow","isLineEmpty","getRichElementValue","selNode","selOffset","pushLine","isBlock","isTableCell","wasEntitiesLength","wasNodeEmpty","withEntities","withCaret","DocumentFragment","startOffset","startContainer","possibleChildrenFocusOffset","getCaretPos","overflowRect","foundVisible","lookForSticky","overflowTop","overflowRight","overflowBottom","overflowLeft","sticky","windowWidth","windowHeight","cancelY","onlyFull","commonAncestor","commonAncestorContainer","treeWalker","createTreeWalker","NodeFilter","SHOW_ELEMENT","SHOW_TEXT","acceptNode","intersectsNode","FILTER_ACCEPT","FILTER_REJECT","nextNode","resultBoolean","template","selectionRange","START_TO_END","isComposing","secondaryKey","isSwipingBackSafari","TouchEvent","ignoreTouchCheck","prevPos","backgroundImage","useCache","isImage","renderImageFromUrlPromise","compareNodes","node1","node1Offset","node2","node2Offset","NOT_ONLY_BOMS_REG_EXP","USING_BOMS","RichInputHandler","saveSelectionOnChange","saveRangeForElement","lastNode","lastOffset","setSelectionClassName","caret","getCaretPosN","move","superMove","getFiller","addInputCallback","processEmptiedFillers","fixInsertedLineBreaks","moveFirst","setEnd","isBOM","deleteData","processFilledFillers","removeEmptyTextNodes","fixBuggedCaret","savedRanges","IS_FIREFOX","inputCaptureCallbacks","anchorNode","findPreviousSmthIndex","something","fromSelectionChange","smthIndex","moved","idxidx","rangeString","onlyBOMs","restoreSavedRange","newCallback","sibling","needed","textNode","removePossibleBOMSiblings","removePossibleBOMSiblingsByNode","cleanSiblings","insertData","bomNode","focusNode","focusNodeBefore","focusOffset","focusOffsetBefore","collapseToStart","collapseToEnd","focusNodeAfter","focusOffsetAfter","fillers","smths","INSTANCE","keyframes","Sortable","elementRect","lastSiblings","getSortableTarget","scrollableRect","toEnd","addScrollPos","scrollPos","startScrollPos","isVertical","countNonElements","DropdownHover","onClickOut","ignoreButtons","ignoreMouseOut","toElement","willBeActive","inited","timeouts","setIgnoreMouseOut","onmouseout","onmouseover","FocusDirection","maxDistance","Static","scrollWithJs","rectStartKey","rectEndKey","sizeKey","scrollSizeKey","elementScrollSizeKey","scrollPositionKey","possibleElementPosition","containerSize","scrollSize","remainingPath","absPath","startAt","shortTransition","longTransition","currentPath","FILENAME_JOINER","getFileNameByLocation","thumb_size","big","stickerset","thumb_version","volume_id","local_id","strictDecimals","_decimals","dm","fixed","pow","parseFloat","CALL_DURATION_LANG_KEYS","mm","showLast","formatDuration","strings","prefixes","maxPrefixLength","setPrefix","originalStr","prefixCountry","patterns","searchForPattern","mostMatchedPatternMatches","mostMatchedPattern","_pattern","patternMatches","FramesCache","framesNew","framesURLs","getCache","createCache","releaseCache","getCacheCounter","generateName","arcParameter","rx","ry","xAxisRotation","largeArcFlag","sweepFlag","tl","tr","bl","useBlur","ignoreCache","ListLoader","loadedAllDown","unsetCurrent","toPrevious","goUnsafe","down","loadPromiseDown","loadPromiseUp","processedArr","processed","ListenerSetter","listeners","addManual","onceCallback","onceFired","_listener","isEnabled","MediaSize","aspect","aspectCovered","makeMediaSize","ScreenSize","CUSTOM_EMOJI_SIZE","ESG_CUSTOM_EMOJI_SIZE","EMOJI_STATUS_SIZE","MediaSizes","screenSizes","mobile","medium","large","handhelds","regular","album","esgSticker","documentName","extendedInvoice","customEmoji","esgCustomEmoji","popupSticker","desktop","isMobile","handleResize","innerWidth","activeScreen","wasScreen","throwWhat","numberThousandSplitter","HAVE_METADATA","useCanplayOnIos","loadEventName","errorEventName","OverlayClickHandler","withOverlay","isNegative","amountExp","exp","dec_point","thousands_sep","isFinite","prec","sep","dec","toFixedFix","number_format","decimal_sep","splitter","additionalPadding","getScrollWidthFromElement","menuWidth","menuHeight","paddingBottom","maxTop","maxLeft","minLeft","intermediateX","intermediateY","possibleSides","platforms","getRestrictionReason","reasons","savingLottiePreview","isSavingLottiePreview","saving","throttleWithRaf","fn","schedulerFn","waiting","throttleWith","ScrollSaver","findElements","findAndSetElements","_save","scrollHeightMinusTop","onRestore","useReflow","setScrollTop","newScrollTop","_restore","previousScrollHeightMinusTop","ScrollableLoader","SearchListLoader","filterMids","onHistoryDelete","shouldBeDeleted","onHistoryMultiappend","isInner","otherSideLoader","filterMessagesByInputFilterFromStorage","goToOtherEnd","do","kind","scheduleFlush","measure","mutate","mutateElement","read","write","pushDocumentSize","_isWebDocument","comments","BatchProcessor","setQueue","renderedQueue","SortedList","_updateList","canUpdate","createPromise","noScheduler","encodeEntities","limitFrom","leadZero","sec_num","hours","minutes","seconds","textToSvgURL","reader","FileReader","readAsDataURL","visualViewport","innerHeight","ANIMATION_START_EVENT","ANIMATION_END_EVENT","isAnimating","heavyAnimationPromise","promisesInQueue","dispatchHeavyAnimationEvent","_heavyAnimationPromise","onHeavyAnimationEnd","interruptHeavyAnimation","getHeavyAnimationPromise","handleAnimationStart","handleAnimationEnd","DialogsContextMenu","onArchiveClick","editPeerFolders","folder_id","onHideTopicClick","onToggleTopicClick","toggleDialogPin","onUnmuteClick","onUnreadClick","top_message","getButtons","getDeleteButtonText","lastButton","isDialogUnread","ConnectionStatusComponent","hadConnect","connecting","timedOut","updating","setConnectionStatus","overrideStatus","baseDcId","connectionStatus","setFirstConnectionTimeout","online","forceGetDifference","retryAt","setStatusText","currentLangPackKey","statusEl","statusPreloader","singleInstance","CHANGE_STATE_DELAY","getA","networkerFactory","forceReconnect","timerSpan","interval","forceReconnectTimeout","setStateTimeout","statusContainer","SENDING_STATUS","easeInOutSine","easeInOutSineApply","roundRect","defaultRadius","moveTo","lineTo","quadraticCurveTo","DPR","SIZE","MARGIN","WIDTH","RADIUS","Shimmer","currTime","diffTime","spread","pausedTime","pauseInterval","lightSource","lightSpread","currentAnimationIndex","keepTime","cycleAnimation","currentAnimation","animateGlow","animateSlide","smartInc","lightLeft","lightRight","lightCenter","createLinearGradient","shimmerColor","addColorStop","dict","on","fillText","DialogsPlaceholder","onThemeChange","stopAnimation","startAnimation","updateCanvasSize","shimmer","generatedValues","marginVertical","lineBorderRadius","lineMarginVertical","statusWidth","getRectFrom","onRemove","blockScrollable","overflowY","availableLength","detachTime","renderDetachAnimationFrame","globalCompositeOperation","completed","elapsedRowTime","dialogHeight","renderFrame","createPattern","patternCanvas","patternContext","drawChat","firstLineWidth","secondLineWidth","marginLeft","setPromiseMiddleware","oldPromise","SortedDialogList","getDialogIndex","forumPeerId","indexKey","addListDialog","isBatch","isMainList","DialogElement","bigger","abitbigger","small","captionDiv","titleSpanContainer","peerTitlePromise","statusSpan","lastTimeSpan","rightSpan","setDialogActive","forumTab","createUnreadBadge","unreadBadge","badge","createUnreadAvatarBadge","unreadAvatarBadge","createMentionsBadge","mentionsBadge","toggleBadgeByKey","hasBadge","justCreated","ForumTab","init2","isFloating","toggleForumTab","createChatList","setListClickListener","xd","Some3","bindScrollable","getOptionsForMessages","fullReset","setStatusPromise","noTyping","onChatsScroll","loadResult","setStatus","NOT_IMPLEMENTED_ERROR","Some","onChatsRegularScroll","sliceTimeout","processContact","scrollTopWas","rectContainer","rectTarget","firstY","lastY","firstElement","elementFromPoint","lastElement","elementOverflow","sliceFromStart","sliceFromEnd","deleteDialogByKey","getDialogKeyFromElement","setOffsets","offsets","getOffsetIndex","isDialogMustBeInViewport","topOffset","bottomOffset","setIndexKey","deleteDialog","getDialogKey","updateDialog","loadedDialogsAtLeastOnce","getDialogElement","setLastMessageN","setUnread","onChatsScrollTop","loadDialogs","createPlaceholder","placeholderOptions","getRectFromForPlaceholder","loadDialogsPromise","loadDialogsRenderPromise","cachedInfoPromise","chatList","getConversationsResult","loadDialogsInner","needPlaceholderAtFirstTime","isTopEnd","offsetDialog","firstDialog","lastDialog","getDialogFromElement","getDialogDom","oldTypingElement","newTypingElement","unsetTyping","paddingX","typings","topics","setUnreadMessagesN","drop","sidebarRect","currentOffsetIndex","needIndex","Some2","getUserStatus","setOnlineStatus","processDialogForCallStatus","validateDialogForFilter","getCachedDialogs","validateListForFilter","doNotRenderChatList","hasClassName","generateScrollable","getDialogIndexKey","sortedDialogList","testDialogForFilter","migratedTo","setCallStatus","callIcon","START_X","wasMounted","itemProgress","groupCallActiveIcon","call_active","call_not_empty","loadContacts","toggleAvatarUnreadBadges","sortedDialog","reuseClassNames","unreadContent","isUnreadAvatarBadgeMounted","unreadAvatarBadgeClassList","unreadBadgeClassList","AppDialogsManager","Log","menuScrollContainer","lastActiveElements","initedListeners","xds","onTabChange","_onListLengthChange","checkIfPlaceholderNeeded","hasContacts","removeContactsPlaceholder","updateContactsLength","verifyPeerIdForContacts","getProxiedManagers","stateMiddlewareHelper","bottomPart","forumsTabs","forumsSlider","allChatsIntlElement","isFilterIdAvailable","clearCurrent","showFiltersPromise","onStateLoaded","setFilterId","addFilter","foldersScrollable","_id","filtersNavigationItem","setFilterIdAndChangeTab","changeFiltersAllChatsKey","groupCallsController","callsController","initListeners","setFiltersUnreadCount","setFilterUnreadCount","elementThreadId","elementPeerId","onFiltersLengthChange","containerToAppend","getDialogIndexKeyByFilterId","renderedFilter","filtersArr","haveFilters","addFilters","addFiltersPromise","getNotifyPeerTypeSettings","fillConversations","unreadSpan","unreadUnmutedCount","unreadCount","getFolderUnreadCount","wasShowing","generateEmptyPlaceholder","classNameType","subtitleArgs","placeholderContainer","emptyDialogsPlaceholderSubtitle","usersLength","placeholderType","updatePartClassName","updateContactsLengthPromise","newTab","hideTab","forumNavigationItem","toggleForumTabByPeerId","lastTab","isSameTab","withContext","openInner","lastActiveListElement","setPeerFunc","setLastMessage","draftMessage","isSearch","isMessageRestricted","willPrepend","videoTypes","playIcon","replyTo","forum_topic","setUnreadMessages","isDialogPinned","getForumUnreadCount","hasUnmuted","isPinned","forumUnreadCount","wasMuted","unreadTopicsCount","hasUnmutedTopic","setStatusMessage","read_inbox_max_id","hasUnreadBadge","hasUnreadAvatarBadge","disableAnimationIfRippleFound","iconClassName","setSendingStatus","isUnreadBadgeMounted","hasMentionsBadge","isMentionsBadgeMounted","isBadgeMounted","unreadBadgeText","isMention","notVisited","getDialog","originalDialog","addDialogNew","addDialogAndSetLastMessage","getMessageSenderPeerIdOrName","downloads","getNewDeferred","cancelDownload","clearDownload","getNewDeferredForUpload","getUpload","getDownload","getUploadPromise","getDownloadFileNameFromOptions","downloadMedia","promiseBefore","getDownloadMediaDetails","downloadMediaURL","downloadMediaVoid","getFileNameForUpload","downloadToDisc","justAttach","pingPromise","hadProgress","getDocumentDownloadOptions","getPhotoDownloadOptions","clickEvent","createEvent","initMouseEvent","createDownloadAnchor","CLASSNAME_BASE","PinnedContainer","floating","divAndCaption","wrapperUtils","attachOnCloseEvent","needClose","setFloating","setUtilsWidth","ChatAudio","onPlaybackParams","fasterEl","repeatEl","toggleEl","onStop","onMediaPlay","isMusic","prevEl","nextEl","attachClick","volumeProgressLineContainer","tunnel","progressWrapper","playingDetails","BAR_HEIGHTS","PinnedMessageBorder","drawRect","getClipPath","barHeight","GAP","clipPath","getBarHeight","ONE","TWO","THREE","FOUR","MORE","getMarkHeight","markHeight","getMarkTranslateY","getTrackTranslateY","trackHeight","getTrackHeight","clipPathId","markTranslateY","trackTranslateY","mark","AnimatedSuper","getRow","clearRow","clearRows","currentIndex","DURATION","setNewRow","reflow","previousIndex","fromTop","ignorePrevious","previousRow","AnimatedCounter","previousNumber","getDecimal","animatedSuper","decimal","hideLeft","previousDecimalNumber","EMPTY_INDEX","setCount","previousByDecimal","decimalNumber","ChatPinnedMessage","pinnedMaxMid","pinnedMid","pinnedIndex","wasPinnedIndex","wasPinnedMediaIndex","waitForScrollBottom","loadedBottom","loadedTop","scrollDownListenerSetter","getCurrentIndexPromise","isStatic","dAC","pinnedMessageBorder","animatedSubtitle","animatedMedia","animatedCounter","btnOpen","openPinned","setPinnedMessage","_setPinnedMessage","unsetScrollDownListener","testMid","isNeededMore","getCurrentIndex","LOAD_OFFSET","correctAfter","gotRest","getPinnedMessage","backLimited","offset_id_offset","setScrollDownListener","isDown","handleScrollSideEvent","refreshPosition","handleFollowingPinnedMessage","followPinnedMessage","writeTo","writeMediaTo","ChatTopbar","verifyButtons","isMenuOpen","btnMore","buttonsToVerify","menuButtons","verifyVideoChatButton","currentGroupCall","groupCall","verifyCallButton","getCachedFullUser","phone_calls_available","video_calls_available","onJoinGroupCallClick","joinGroupCall","resize","setUtilsRAF","chatUtils","chatAudio","setPeerStatusManual","btnBack","btnBackBadge","chatInfoContainer","chatInfo","person","avatarElement","deleteButtonText","btnJoin","btnPinned","btnCall","btnGroupCall","btnMute","btnSearch","pushButtonToVerify","onBtnBackClick","isFirstChat","constructUtils","linked_chat_id","onCallClick","chatContextMenuHintWasShown","contactPeerId","getAttachMenuBot","has_settings","constructAvatar","joinChannel","unreadUnmutedPeerIds","setMutedState","isTopMessage","hiddenPinnedMessages","byCurrent","setTitleCallback","setStatusCallback","setTitleManual","canHaveSomeButtons","wasAlreadyUsed","newPinnedMessage","AppPrivateSearchTab","appSearch","btnPickDate","ChatSearch","selectedIndex","onResultsClick","selectResult","onFooterClick","onUpClick","onDownClick","foundCountEl","upBtn","downBtn","footer","dateBtn","renderedCount","ChatBackgroundPatternRenderer","canvases","INSTANCES","renderToCanvas","fillCanvas","crossOrigin","imageBitmap","objectUrl","imageWidth","imageHeight","patternHeight","mask","topY","endY","bottomY","setCanvasDimensions","originalHeight","Chat","backgroundEl","backgroundTempId","sharedMediaTabs","setBackground","patternRenderer","gradientCanvas","previousGradientRenderer","previousPatternRenderer","previousPatternCanvas","isDarkPattern","getInstance","_gradientRenderer","setOpacityTo","opacityMax","setBackgroundPromise","setType","freezeObservers","APP_TABS","CHAT","beforeDestroy","cleanupBackground","destroySharedMediaTab","searchTab","_isAnyGroup","setAutoDownloadMedia","getForumTopicOrReload","isSamePeer","bubblesSetPeerPromise","photoSizeMax","videoSizeMax","fileSizeMax","photo_size_max","video_size_max","file_size_max","getAutoDownloadSettingsByPeerId","callbacksPromise","ignoreThreadId","historyStorageTransferable","historySerialized","updateStickersetOrder","MarkupTooltip","waitingForMouseUp","mouseUpCounter","onMouseUpSingle","resetSelection","tools1","tools2","cancelClosening","linkBackButton","linkInput","applyLink","isLinkValid","setTooltipPosition","linkApplyButton","applyDiv","delimiter1","delimiter2","delimiter3","matchUrlProtocol","getActiveMarkupButton","currentMarkups","markup","activeButtons","isLinkToggle","bodyRect","selectionRect","inputRect","selectionTop","sizesRect","isFirstShow","setMouseUpEvent","handleSelection","ChatDragAndDrop","dropIcon","onDragOver","onDragLeave","onDrop","outlineWrapper","dropHeader","dropSubtitle","headerArgs","setPath","sizeX","sizeY","disableTransition","LineBlobDrawable","maxRadius","minRadius","N","radiusNext","speed","generateBlob","radDif","generateNextBlob","amplitude","speedScale","paint","pinnedTop","progressToPinned","r1","progressNext","x2","cx","y2","bezierCurveTo","WeavingState","stateId","createGradient","shader","getGradientFromType","x0","y0","dt","TopbarWeave","handleDevicePixelRatioChanged","setSize","forceUpdate","resizeHandler","resizeCanvas","invokeDraw","handleFocus","focused","handleBlur","lbd","lbd1","lbd2","currentState","previousState","progressToState","lastUpdateTime","animateToAmplitude","animateAmplitudeDiff","amplitude2","animateAmplitudeDiff2","top1","top2","paint1","setCurrentState","states","componentDidMount","matchMedia","setAmplitude","componentWillUnmount","setCanvasSize","RLottieIconItemPart","playPart","RLottieIconItem","createPart","initFrame","skipFirstFrameRendering","inverseColor","onLoadForColor","onLoadForPart","getPart","RLottieIcon","startFrame","endFrame","frameCount","SuperRLottieIcon","partState","colorState","getColor","partCallback","changedPartState","changedColorState","setPartState","setColorState","prevState","renderIfPaused","invoke","GroupCallMicrophoneIcon","GROUP_CALL_MICROPHONE_BUTTON_STATE","partName","HAND","MUTED","UNMUTED","GroupCallParticipantMutedIcon","colored","GROUP_CALL_PARTICIPANT_MUTED_STATE","colorStr","MUTED_FOR_ME","MUTED_BY_ADMIN","propertyValue","getColorByMutedState","generateEqualParts","clearMutedStateModifier","GroupCallParticipantStatusElement","element2","actionClassName","GroupCallParticipantsList","getParticipantByPeerId","onElementDestroy","getGroupCallParticipantMutedState","mutedIcon","callVideoCanvasBlur","GroupCallParticipantVideoElement","setPinned","setParticipant","groupCallParticipantMutedIcon","groupCallParticipantStatus","updateParticipant","GroupCallParticipantsVideoElement","participantsElements","groupCallId","setElementDisplay","pinnedSource","pinSource","unpinAll","setInstance","shouldDisplayElement","displayPinned","shouldDisplay","hasAnyVideo","participantElements","participantVideo","getVideoElementFromParticipantByType","_onLengthChange","GroupCallParticipantContextMenu","onOpenProfileClick","PopupGroupCall","targetPeerId","toggleParticipantMuted","editParticipant","canManageCall","can_self_unmute","muted_by_you","getContainer","GroupCallParticipantsElement","groupCallParticipantsVideo","appGroupCallsManager","getGroupCallParticipants","GroupCallDescriptionElement","descriptionIntl","GroupCallTitleElement","makeButton","_className","buttonDiv","isConfirm","resizeHandlerClassName","MovableElement","fixDimensions","fixPosition","addResizeHandlers","setSwipeHandler","destroyElements","handlers","startTop","startLeft","startWidth","startHeight","resizingSide","isEnlarging","resizeDiff","maxPossible","setPositionToCenter","MovablePanel","toggleMovable","movable","movableOptions","toggleClassName","raise_hand_rating","onFullScreenClick","onToggleControls","buttonsContainer","onVideoClick","btnVideo","toggleVideoSharing","onScreenClick","btnScreen","toggleScreenSharing","toggleMuted","changeRaiseHand","onLeaveClick","hangUp","discard","toggleBigLayout","btnFullScreen","btnExitFullScreen","wasFullScreen","movablePanel","videosCount","wasBig","btnInvite","btnShowColumn","toggleRightColumn","btnFullScreen2","headerInfo","newHeader","newHeaderInfo","newHeaderTitle","btnHideColumn","videosScrollable","groupCallTitle","groupCallDescription","groupCallBodyHeaderDescription","constructButtons","groupCallParticipants","updateInstance","setHasPinned","groupCallMicrophoneIcon","_makeButton","microphoneIcon","btnLeave","setDescription","microphoneButtonState","getGroupCallMicrophoneButtonState","micState","CallDescriptionElement","connectionState","connectedAt","GroupCallMicrophoneIconMini","INIT_STATE","PopupCall","resizeVideoContainers","videoContainers","interlocutorUserId","emojisSubtitle","partyStates","partyMutedState","stateText","constructFirstButtons","constructSecondButtons","wasTryingToJoin","movableElement","controlsHover","getCallInstance","firstButtonsRow","muteI18nElement","secondButtonsRow","declineI18nElement","btnDecline","btnAccept","acceptCall","createVideoContainer","isPendingIncoming","isSharingVideo","isSharingScreen","outputState","getMediaState","oldContainers","mediaState","getVideoElement","hasFrame","hasPromise","videoState","screencastState","videoContainer","output","getEmojisFingerprint","popupWidth","MAX_WIDTH_PX","MAX_HEIGHT_PX","MAX_SIZE","biggestSideSize","widthRatio","heightRatio","TopbarCall","onState","amplitudes","weave","clearCurrentInstance","currentDescription","instanceListenerSetter","isChangingInstance","callDescription","convertCallStateToGroupState","groupCallMicrophoneIconMini","throttledMuteClick","weaveContainer","uiNotificationsManager","notificationsShown","notificationIndex","notificationsCount","soundsPlayed","vibrateSupport","faviconElements","titleBackup","titleChanged","stopped","pushInited","updateLocalSettings","updSettings","nodesktop","novibrate","nopreview","nopush","needPush","webPushApiManager","registeredDevice","nosound","requestPermission","Notification","mozVibrate","webkitVibrate","setAppBadge","notificationsUiSupport","notifySoundEl","topMessagesDeferred","toggleToggler","peerString","soundReset","tokenData","unregisterDevice","registerDevice","notificationData","custom","hasChat","hasUser","buildNotification","fwdCount","peerReaction","peerTypeNotifySettings","notification","getPeerString","notificationMessage","wrappedMessage","noIncrement","peerTitleOptions","notificationFromPeerId","peerPhoto","loadAvatar","avatarCanvas","avatarContext","avatarGradients","colorTop","colorBottom","abbreviation","getAbbreviation","textBaseline","textAlign","pushData","loc_key","loc_args","resetTitle","isBlink","setFavicon","titleInterval","prevFavicon","testSound","permission","notificationOptions","registration","serviceWorker","showNotification","getNotifications","appRuntimeManager","onclose","getLocalSettings","closeNotification","nextSoundAt","prevSoundVolume","filename","token_type","tokenType","tokenValue","other_uids","app_sandbox","secret","getFilesFromEvent","onlyTypes","scanFiles","isDirectory","directoryReader","createReader","readEntries","itemFile","getAsFile","DataTransferItem","DragEvent","dataTransfer","webkitGetAsEntry","addAnchorListener","protocol","noCancelEvent","pathnameParams","uriParams","u","host","noPathnameParams","noUriParams","parseUriParams","AppImManager","columnEl","offline","updateStatusInterval","cacheStorage","saveState","onHashChangeUnsafe","tgaddr","openUrl","postId","openUsername","userName","setSettings","messagesTextSize","forceRenderAfterSize","chatsSelectTabDebounced","changedLoop","changedAutoplay","toggleChatGradientAnimation","onDocumentPaste","attachType","newMediaPopup","_types","canDrag","backgroundPromises","CHATLIST","updateStatus","emojiAnimationContainer","appendEmojiAnimationContainer","createNewChat","chatsSelectTab","getPremium","compareVersion","deleteFilesIterative","applyCurrentTheme","resizeInstances","saveChatPosition","choosing","setChoosingStickerTyping","typing","onInstanceDeactivated","isUpdated","receiptMessage","onSpoilerClick","spoilerTimeout","mediaStickerWrapper","playOrRestart","stateStorage","topbarCall","discardCurrentCall","currentCall","setAuthorized","telegramMeWebManager","hashtag","makeLink","thread","channel","comment","getStackFromElement","attachKeydownListener","handleAutologinDomains","checkForShare","share","foundMedia","openWindow","onUrlAuthResult","urlAuthResult","botPeerTitle","logInCheckbox","allowMessagesCheckbox","request_write_access","confirmationPromise","logInChecked","allowMessagesChecked","acceptUrlAuth","onUrlAuthResultAccepted","requestUrlAuth","_appConfig","onAnchorClick","url_auth_domains","autologin_token","autologin_domains","originalUrl","searchParams","possibleBubble","timeoutOperation","requests","request","isBad","activatingChat","screen","IGNORE_KEYS","isSelectionCollapsed","isTargetAnInput","getFirstMessageToEdit","getNextDialog","newEvent","KeyboardEvent","commentId","resolveChannel","op","checkChatInvite","saveApiChat","resolvePhone","getInputInvoiceBySlug","wrappedUrl","openComment","openPremiumBot","premium_bot_username","generateThreadServiceStartMessage","phone_calls_private","ignoreGroupCall","ignoreCall","discardGroupCallConfirmation","discardCallConfirmation","title1","title2","isClosing","getGroupCallFull","createGroupCall","setCurrentBackground","broadcastEvent","getBackground","getFile","lastBackgroundUrl","chatBubbles","chatPositions","backgroundUrl","attachDragAndDropListeners","drops","mediaDrops","isFiles","_dropsContainer","mediaDropsContainer","dropsContainer","_drops","foundDocuments","PROFILE","onImTabChange","updateMyOnlineStatus","spliceChats","fromIndex","chatFrom","chatTo","chatIndex","existingIndex","oldChat","getTypingElement","eye","getPeerTyping","getPeerTypings","langPackKeys","multi","mapa","typingElement","descriptionElement","getChatStatus","typingEl","onlines","getOnlines","getPeerStatus","typingContainer","options1","options2","INTERNAL_LINK_TYPE","onlyInner","DialogColorsFg","DialogColors","DialogColorsMap","pic","peerParams","useBytes","bestPhotoSize","CallConnectionInstanceBase","connection","sources","createPeerConnection","config","RTCPeerConnection","signalingState","iceConnectionState","createDataChannel","dataChannel","createDescription","appendStreamToConference","streamManager","appendToConference","closeConnection","closeConnectionAndStream","stopStream","negotiate","negotiating","negotiateInternal","sendDataChannelData","parseSignalingData","sdp","parseMediaSectionInfo","fingerprint","ufrag","pwd","convertNumber","isSending","codec","ssrc","sourceGroups","ssrcGroups","sourceGroup","semantics","ssrcs","rtpExtensions","payloadTypesMap","getPayloadType","payloadType","clockrate","feedbackTypes","subtype","parameters","payloadTypes","CallConnectionInstance","localDescription","remoteDescription","descriptionInit","offerReceived","createAnswer","setLocalDescription","offer","createOffer","offerSent","initialSetup","sendCallSignalingData","crypto","subtle","P2PEncryptor","p2pKey","seqMap","concatSHA256","bufferConcats","encryptPrepared","msgKeyLarge","subarray","msgKey","aesKeyIv","prepareAesKeyIv","aesProcessCtr","encryptRawPacket","seq","ArrayBuffer","setUint32","sha256a","sha256b","iv","encryptedData","dataSize","encrypt","cryptoKey","constTimeIsDifferent","msgKeyEquals","decryptRawPacket","encryptedDataSize","decryptionBuffer","getUint32","ChromeP2PSdpBuilder","fingerprints","stringBuilder","streamName","addExtmap","addPayloadTypes","addSsrc","finalize","FirefoxP2PSdpBuilder","SafariP2PSdpBuilder","isFirefox","isSafari","extmap","j","fmtp","getOwnPropertyNames","pName","ssrcGroup","P2PSdpBuilder","sdpString","sdpMLineIndex","sdpMid","foundation","component","priority","relAddress","generation","tcpType","networkId","networkCost","candidate","generateOffer","generateAnswer","CallInstance","udp_p2p","udp_reflector","min_layer","max_layer","library_versions","createdAt","decryptQueue","candidates","canCreateConferenceEntry","setMediaState","sendMediaState","mediaStates","_sendMediaState","_connectionState","connectionInstance","sortIndex","findEntry","recvEntry","startScreenSharingInternal","wasStartingScreen","wasStartingVideo","requestScreen","stopVideoSharing","startVideoSharingInternal","requestInputSource","track","inputStream","getVideoTracks","stopTrack","isSharingVideoType","audioTrack","getAudioTracks","setHangUpTimeout","clearHangUpTimeout","hangUpTimeout","setPhoneCall","phoneCall","canAccept","overrideConnectionState","g_a_hash","appCallsManager","generateDh","dh","g_b","g_a","g_b_hash","getCallInput","phonePhoneCall","savePhonePhoneCall","joinCall","encryptionKey","configuration","iceServers","connections","ipv6","port","urls","turn","stun","credential","iceTransportPolicy","p2p_allowed","getRtcConfiguration","sendIceCandidate","onTrack","encryptor","decryptor","processDecryptQueue","createDataChannelEntry","dataChannelEntry","createEntry","sendEntry","negotiated","applyDataChannelData","TextEncoder","encode","iceCandidate","parsed","p2pParseCandidate","confirmCall","key_fingerprint","computeKey","emojisFingerprint","getEmojisFingerprintPromise","codePoints","unlockStreamManager","doTheMagic","getTransceivers","transceiver","getEntryByMid","bundle","sdpDescription","generateSdp","isAnswer","setRemoteDescription","onInputStream","stream","videoTrack","onMutedChange","requestAudioSource","setMuted","discardReason","discardedByOtherParty","hasVideo","discardCall","performCodec","_codec","setDataToDescription","setData","transport","screencast","filterNotVP8","vp8PayloadType","rtxIdx","apt","applyCallSignalingData","performSsrcGroups","getEntryBySource","sendRecvEntry","findFreeSendRecvEntry","setEntrySource","tryToReleaseCandidates","generateCandidate","RTCIceCandidate","addIceCandidate","decryptedData","TextDecoder","decode","signalingData","onUpdatePhoneCallSignalingData","getStreamCached","_cache","isScreen","constraints","getScreenStream","getStream","CallInstanceBase","fixSafariAudio","isSharingAudio","hasInputTrackKind","isAudioGood","isVideoGood","getAudioConstraints","getVideoConstraints","getScreenConstraints","endpoint","tryAddTrack","streams","saveInputVideoStream","isOutput","elementEndpoint","addTrack","useStream","outputStream","srcObject","sinkId","outputDeviceId","setSinkId","getTracks","addStream","CALL_STATE","audioAsset","CALL_REQUEST_TIMEOUT","CallsController","sortedInstances","createCallInstance","admin_id","g_a_or_b","bytesCmp","callId","getCallByUserId","hasConnected","hasCurrent","startCallInternal","fullInfo","participant_id","requestCall","GROUP_CALL_AMPLITUDE_ANALYSE_COUNT_MAX","GROUP_CALL_AMPLITUDE_ANALYSE_INTERVAL_MS","GroupCallConnectionInstance","negotiateThrottled","bundlePolicy","rtcpMuxPolicy","iceCandidatePoolSize","maybeUpdateRemoteVideoConstraints","updateConstraintsInterval","invokeJoinGroupCall","localSdp","mainChannels","processedChannels","sectionInfo","payload","processMediaSection","audioChannel","videoChannel","useChannel","setEntryPeerId","performExtmap","filterServerCodecs","isNewConnection","originalOffer","iceRestart","hasMunged","skipAddingMulticast","mediaLine","mediaLineParts","localMLine","codecIds","newData","setPort","setSource","newSdp","addSsrcEntry","newChannel","mungedSdp","fixLocalOffer","entriesToDelete","shouldBeSkipped","answerDescription","deleteEntry","iceGatheringState","updateConstraints","sender","setParameters","getParameters","degradationPreference","colibriClass","defaultConstraints","onStageEndpoints","addInputVideoStream","GroupCallInstance","isSpeakingMap","pinnedSources","participantsSsrcs","hadAutoPinnedSources","dispatchPinnedThrottled","getCachedParticipants","presentation","unpinSource","changeUserMuted","source_groups","createConnectionInstance","raise","raiseHand","stopScreenSharing","startScreenSharing","startScreenSharingPromise","saveApiParticipant","leaveGroupCallPresentation","videoPaused","videoStopped","startVideoSharing","startVideoSharingPromise","rejoin","isDiscarded","isUpdatingMeInCurrentCall","onParticipantUpdate","doNotDispatchParticipantUpdate","hasLeft","oldSsrcs","modifiedTypes","oldSsrc","oldSource","oldEntry","originalDirection","setEndpoint","createTransceiver","GROUP_CALL_STATE","makeSsrcsFromParticipant","makeSsrcFromParticipant","audio_source","generateSelfVideo","audioSource","GroupCallsController","setCurrentGroupCall","startConnectingSound","stopConnectingSound","joinVideo","MediaStream","createMainStreamManager","joinGroupCallInternal","handleUpdateGroupCallParticipants","updatingSdp","channelCount","constraint","mediaDevices","getSupportedConstraints","constraintSupported","skipAudio","frameRate","screenStream","getDisplayMedia","contentHint","getUserMedia","clientInfo","lookupAttributeKeys","telegramSourceGroups","sdpLines","rest","parseSourceGroups","raw","ConferenceEntry","addTransceiver","generateSsrc","LocalConferenceDescription","sessionId","maxSeenId","entriesByMid","entriesBySource","entriesByPeerId","getEntriesByPeerId","conference","SDP","mediaSections","splitStringByLimitWithRest","UniqueNumberGenerator","generate","maxTries","_try","SDPAttributeSplitted","SDPMediaLineParts","SDPLine","SDPAttributeInner","missed","exists","nestedMap","makeAttributes","innerParts","SDPAttributes","fillAttributes","attributesMap","linesArray","SDPMediaSection","isReceiving","resultShouldBeArray","SDPSessionSection","parseSdp","createSection","sessionSection","lineStr","isIncorrectSdpLine","parseSdpLine","addSimulcast","generator","originalSsrcs","ssrcs2","ssrcsStrLines","ssrc2","WEBRTC_MEDIA_PORT","fixMediaLineType","getConnectionTypeForMediaType","generateMediaFirstLine","payloadIds","connectionType","SDPBuilder","addCandidate","performCandidate","addHeader","sId","bundleMids","addTransport","skipCandidates","addSource","addMsid","isApplication","isInactive","hdrexts","hdrext","fbs","fb","addConference","AudioStreamAnalyser","streamSource","createMediaStreamSource","gain","createGain","minDecibels","maxDecibels","smoothingTimeConstant","StreamManager","getAmplitude","streamAnalyser","analyse","ANALYSER_LISTENER","AudioContext","webkitAudioContext","getSource","itemSource","removeTrack","finalizeAddingTrack","changeTimer","substring","replaceInputAudio","oldTrack","timer","transceiverInit","tracks","mediaTrackType","trackIdx","replaceTrack","StringFromLineBuilder","newLine","addJoined","toTelegramSource","fromTelegramSource","rms","SEND_WHEN_ONLINE_TIMESTAMP","EMOJI_REG_EXP","onlyFirst","firstEmojiMatch","lastEmojiMatch","E","setBlankToAnchor","messageEntityTextUrl","messageEntityMentionName","isDraft","EMOJI_VERSIONS_SUPPORTED","inlineEl","newEmojiWidth","legacyEmojiWidth","isEmojiSupported","globalLazyLoadQueue","CustomEmojiElement","syncedPlayer","pausedElements","playersSynced","createCustomFiller","lastPausedVideo","middlewares","CustomEmojiRendererElement","clearedElements","WeakSet","isCanvasClean","emojiRenderers","getOffsets","offsetsMap","offsetParent","elementsArr","placeholders","isDimensionsSet","syncedPlayersFrames","isImageData","ImageData","frameWidth","frameHeight","lastChildWas","checkForAnyFrame","forceRenderAfter","renderEmojis","addCustomEmojis","addElements","usingOwnQueue","_loadPromises","newElements","isLottie","willHaveSyncedPlayer","newElementsArray","CUSTOM_EMOJI_INSTANT_PLAY","addition","_p","overrideRender","setRenderInterval","syncedPlayers","clearRenderInterval","missing","cachedPromises","uncachedPromisesPromise","loadFromPromises","uncached","emojiRenderInterval","renderers","nasty","usedLength","wrapSomething","wrapElement","noFiller","customWraps","contextSite","contextExternal","lastEntity","nextEntity","endPartOffset","fullEntityText","partText","usedText","fontFamily","atPos","fromBot","encodeURIComponent","isSupported","masked","currentContext","electronHelpers","contextUrl","wrapTelegramUrlToAnchor","encoded","encodeSpoiler","entityText","voodoo","insertCustomFillers","notFiller","isCustomFillerNeededBySiblingNode","url1","QueryableWorker","worker","terminate","onmessage","queryMethodListener","queryMethodArguments","postMessage","sendQuery","transfer","queryMethod","workersLimit","playersByCacheName","workers","curWorkerNum","onPlayerLoaded","reqId","fps","clamped","onPlayerError","getAnimation","loadLottieWorkers","remain","Worker","queryableWorker","makeAssetUrl","loadAnimationAsAsset","loadAnimationFromURL","loadAnimationDataFromURL","blobConstruct","loadAnimationFromURLManually","loadAnimationFromURLNext","newParams","loadAnimationWorker","waitForFirstFrame","initPlayer","destroyWorkers","loadFromData","getLottiePixelRatio","RLottiePlayer","cachingDelta","_autoplay","CACHE","skipDelta","contexts","setMainLoop","clearPendingRAF","rafId","resetCurrentFrame","minFrame","requestFrame","applyInversing","renderFrame2","cachedSource","renderedFirstFrame","ImageBitmap","frInterval","frThen","frameNew","onLap","mainLoopForwards","mainLoopBackwards","currentMethod","frameListener","listenerResults","enterFrame","playToFrame","bounds","setMinMax","playToFrameOnFrameCallback","setInverseColor","pagesManager","pageId","pagesDiv","scrollableDiv","page","onShown","setPage","isAuthPage","Page","onFirstMount","encodeEmoji","emojiText","toCodePoints","removeVS16s","vs16RegExp","zeroWidthJoiner","rawEmoji","unicodeSurrogates","points","getEmojiToneIndex","VIRTUAL_COUNTRIES_EMOJIS","getCountryEmoji","emojiFromCodePoints","fromCodePoint","module","exports","defineProperty","enumerable","Symbol","toStringTag","__esModule","prototype","isRecordingSupported","bufferLength","encoderApplication","encoderFrameSize","encoderPath","maxFramesPerPage","mediaTrackConstraints","resampleQuality","streamPages","wavBitDepth","encodedSamplePosition","WebAssembly","clearStream","audioContext","closeAudioContext","encodeBuffers","getChannelData","encoder","buffers","initAudioContext","initAudioGraph","scriptProcessorNode","createScriptProcessor","destination","onaudioprocess","inputBuffer","monitorGainNode","setMonitorGain","recordingGainNode","setRecordingGain","initSourceNode","loadWorker","initWorker","streamPage","storePage","recordedPages","samplePosition","finish","originalSampleRate","sampleRate","wavSampleRate","onpause","resume","onresume","setTargetAtTime","onstart","destroyWorker","Function","kSampleStepSize","float32ArraySupported","Float32Array","A","aA1","aA2","B","C","calcBezier","aT","getSlope","LinearEasing","mX1","mY1","mX2","mY2","sampleValues","aX","intervalStart","currentSample","kSplineTableSize","guessForT","initialSlope","aGuessT","currentSlope","newtonRaphsonIterate","aA","aB","currentX","currentT","binarySubdivide","getTForX"],"sourceRoot":""} \ No newline at end of file diff --git a/public/crypto.worker.7fb5055c6558e4a5c265.chunk.js b/public/crypto.worker.c036d5d715f9894c08a3.chunk.js similarity index 99% rename from public/crypto.worker.7fb5055c6558e4a5c265.chunk.js rename to public/crypto.worker.c036d5d715f9894c08a3.chunk.js index 02bc1ebb..ea769474 100644 --- a/public/crypto.worker.7fb5055c6558e4a5c265.chunk.js +++ b/public/crypto.worker.c036d5d715f9894c08a3.chunk.js @@ -1,2 +1,2 @@ (()=>{"use strict";var e,t,n={410:(e,t,n)=>{n.d(t,{GO:()=>o,ZP:()=>i});const r=n(1267).Z.debug,o="undefined"!=typeof window?window:self,i=r},4762:(e,t,n)=>{n.d(t,{IS_FIREFOX:()=>f,IS_SAFARI:()=>i});var r=n(6761);const o=navigator?navigator.userAgent:null,i=(navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i),navigator.userAgent.toLowerCase().indexOf("android"),/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor),(/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&r.Z.MSStream,!!("safari"in r.Z)||!(!o||!(/\b(iPad|iPhone|iPod)\b/.test(o)||o.match("Safari")&&!o.match("Chrome")))),f=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;(void 0===navigator.maxTouchPoints||navigator.maxTouchPoints>0)&&navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i)},1352:(e,t,n)=>{n.d(t,{N5:()=>o,SU:()=>r,kC:()=>i});const r="undefined"!=typeof ServiceWorkerGlobalScope&&self instanceof ServiceWorkerGlobalScope,o="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&!r,i=o||r,f=(e,...t)=>{try{e.postMessage(...t)}catch(e){console.error("[worker] postMessage error:",e,t)}},c=(e,...t)=>{self.clients.matchAll({includeUncontrolled:!1,type:"window"}).then((n=>{n.length&&n.slice(e?0:-1).forEach((e=>{f(e,...t)}))}))};r&&c.bind(null,!1),r&&c.bind(null,!0)},6991:(e,t,n)=>{function r(...e){const t=e.reduce(((e,t)=>e+(t.byteLength||t.length)),0),n=new Uint8Array(t);let r=0;return e.forEach((e=>{n.set(e instanceof ArrayBuffer?new Uint8Array(e):e,r),r+=e.byteLength||e.length})),n}Uint8Array.prototype.concat=function(...e){return r(this,...e)},Uint8Array.prototype.toJSON=function(){return[...this]},Promise.prototype.finally=Promise.prototype.finally||function(e){const t=t=>Promise.resolve(e()).then(t);return this.then((e=>t((()=>e))),(e=>t((()=>Promise.reject(e)))))};var o=n(4736),i=n.n(o);i()(Number.MAX_SAFE_INTEGER);const f=i()(i()[2]).pow(64),c=f.divide(i()[2]);function a(e,t=256){return i().fromArray(e instanceof Uint8Array?[...e]:e,t)}function s(e){return new Uint8Array(e.toArray(256).value)}function u(e,t,n){const r=a(e),o=a(t),i=a(n);return s(r.modPow(o,i))}var h=n(745),l=n.n(h),d=n(6761),y=n(153),p=n(410),v=n(1352);class g extends y.Z{constructor(){super("CRYPTO"),this.lastIndex=-1}invokeCryptoNew({method:e,args:t,transfer:n}){const r={method:e,args:t},o=this.listeners.invoke;if(null==o?void 0:o.length){let e=o[0].callback(r);return v.kC||e instanceof Promise||(e=Promise.resolve(e)),e}const i="aes-encrypt"===e||"aes-decrypt"===e?this.lastIndex=(this.lastIndex+1)%this.sendPorts.length:0;return this.invoke("invoke",r,void 0,this.sendPorts[i],n)}invokeCrypto(e,...t){return this.invokeCryptoNew({method:e,args:t})}}const w=new g;p.GO&&(p.GO.cryptoMessagePort=w);const b=w;function m(e){const t=e.length,n=8*t;let r=i()(e[0]).and(127).shiftLeft(n-8);for(let o=1;o0&&c>7),f[i[s]^s]=s;for(;!x[c];c^=e||1)n=(n=a^a<<1^a<<2^a<<3^a<<4)>>8^255&n^99,x[c]=n,K[n]=c,o=16843009*i[t=i[e=i[c]]]^65537*t^257*e^16843008*c,r=257*i[n]^16843008*n,E[c]=r=r<<24^r>>>8,L[c]=r=r<<24^r>>>8,O[c]=r=r<<24^r>>>8,F[c]=r=r<<24^r>>>8,_[n]=o=o<<24^o>>>8,I[n]=o=o<<24^o>>>8,z[n]=o=o<<24^o>>>8,N[n]=o=o<<24^o>>>8,a=f[a]||1}();var R=function(){function e(e){var t=Z(e);if(4!==t.length&&6!==t.length&&8!==t.length)throw new Error("Invalid key size");this.encKey=new Uint32Array(4*t.length+28),this.decKey=new Uint32Array(4*t.length+28),this.encKey.set(t);for(var n,r=1,o=t.length;o<4*t.length+28;o++)n=this.encKey[o-1],(o%t.length==0||8===t.length&&o%t.length==4)&&(n=x[n>>>24]<<24^x[n>>16&255]<<16^x[n>>8&255]<<8^x[255&n],o%t.length==0&&(n=n<<8^n>>>24^r<<24,r=r<<1^283*(r>>7))),this.encKey[o]=this.encKey[o-t.length]^n;for(var i=0;o;i++,o--)n=this.encKey[3&i?o:o-4],this.decKey[i]=o<=4||i<4?n:_[x[n>>>24]]^I[x[n>>16&255]]^z[x[n>>8&255]]^N[x[255&n]]}return e.prototype.encrypt=function(e){for(var t,n,r,o=Z(e),i=new Uint32Array(4),f=o[0]^this.encKey[0],c=o[1]^this.encKey[1],a=o[2]^this.encKey[2],s=o[3]^this.encKey[3],u=this.encKey.length/4-2,h=4,l=0;l>>24]^L[c>>16&255]^O[a>>8&255]^F[255&s]^this.encKey[h],n=E[c>>>24]^L[a>>16&255]^O[s>>8&255]^F[255&f]^this.encKey[h+1],r=E[a>>>24]^L[s>>16&255]^O[f>>8&255]^F[255&c]^this.encKey[h+2],s=E[s>>>24]^L[f>>16&255]^O[c>>8&255]^F[255&a]^this.encKey[h+3],f=t,c=n,a=r,h+=4;for(l=0;l<4;l++)i[l]=x[f>>>24]<<24^x[c>>16&255]<<16^x[a>>8&255]<<8^x[255&s]^this.encKey[h++],t=f,f=c,c=a,a=s,s=t;return i},e.prototype.decrypt=function(e){for(var t,n,r,o=Z(e),i=new Uint32Array(4),f=o[0]^this.decKey[0],c=o[3]^this.decKey[1],a=o[2]^this.decKey[2],s=o[1]^this.decKey[3],u=this.decKey.length/4-2,h=4,l=0;l>>24]^I[c>>16&255]^z[a>>8&255]^N[255&s]^this.decKey[h],n=_[c>>>24]^I[a>>16&255]^z[s>>8&255]^N[255&f]^this.decKey[h+1],r=_[a>>>24]^I[s>>16&255]^z[f>>8&255]^N[255&c]^this.decKey[h+2],s=_[s>>>24]^I[f>>16&255]^z[c>>8&255]^N[255&a]^this.decKey[h+3],f=t,c=n,a=r,h+=4;for(l=0;l<4;l++)i[3&-l]=K[f>>>24]<<24^K[c>>16&255]<<16^K[a>>8&255]<<8^K[255&s]^this.decKey[h++],t=f,f=c,c=a,a=s,s=t;return i},e}(),T=function(){function e(e,t,n){void 0===n&&(n=16),this.key=Z(e),this.iv=Z(t),this.cipher=new R(e),this.blockSize=n/4}return e.prototype.encrypt=function(e,t){for(var n=Z(e),r=t||new Uint32Array(n.length),o=this.iv.subarray(this.blockSize,this.iv.length),i=this.iv.subarray(0,this.blockSize),f=new Uint32Array(this.blockSize),c=0;c>>2]|=t[e]<<24-e%4*8;return new Uint32Array(n)}function W(e,t,n,r=!0){return function(e){const t=new Uint8Array(e.byteLength);for(let n=0,r=4*e.length;n>>2]>>>24-n%4*8&255;return t}(new T(B(t),B(n))[r?"encrypt":"decrypt"](B(e)))}!function(){function e(e,t,n){if(void 0===n&&(n=16),this.offset=0,this.key=Z(e),this.counter=Z(t),this.cipher=new R(e),this.blockSize=n/4,4!==this.counter.length)throw new Error("AES-CTR mode counter must be 16 bytes length")}e.prototype.encrypt=function(e,t){for(var n=Z(e),r=t||new Uint32Array(n.length),o=this.offset,i=0;i=this.blockSize&&this.incrementCounter(),o&&(i-=o,o=0)}return this.offset=(this.offset+n.length%4)%4,r},e.prototype.decrypt=function(e,t){return this.encrypt(e,t)},e.prototype.incrementCounter=function(){for(var e=this.counter.length-1;e>=0&&!(++this.counter[e]<4294967295);e--);}}();const G={8:new Uint8Array(1),16:new Uint16Array(1),32:new Uint32Array(1)};function j(e,t){return i().randBetween(e,t,(()=>function(e){const t=G[e];return crypto.getRandomValues(t),t[0]}(32)/4294967295))}function q(e){const t=i()[2];if(e.remainder(t).isZero())return t;const n=i()(1e3);let r,o,f,c,a,s,u;do{r=j(i().one,e.minus(1))}while(r.isZero()||r.eq(e.minus(t)));f=j(i().one,e.minus(1)),a=i().one,s=i().one;const h=i()("FFFFFFFFFFFFFFFF",16).minus(e).plus(1),l=n=>((n=(n=n.pow(t).mod(e)).add(r)).lesser(r)&&(n=n.add(h)),n.mod(e));do{o=f;for(let e=0;i()(e).lesser(a);++e)f=l(f);let t=i().zero;do{c=f;const r=i().min(n,a.minus(t));for(let t=0;i()(t).lesser(r);++t)f=l(f),s=s.multiply(o.greater(f)?o.minus(f):f.minus(o)).mod(e);u=i().gcd(s,e),t=t.add(n)}while(t.lesser(a)&&u.eq(i().one));a=a.shiftLeft(i().one)}while(u.eq(i().one));if(u.eq(e))do{c=l(c),u=i().gcd(o.minus(c).abs(),e)}while(u.eq(i().one));return u}const D="undefined"!=typeof window&&"crypto"in window?window.crypto.subtle:self.crypto.subtle;var J=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function f(e){try{a(r.next(e))}catch(e){i(e)}}function c(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(f,c)}a((r=r.apply(e,t||[])).next())}))};class ${constructor(e,t,n){this.mode=e,this.cryptoKey=t,this.queue=[],this.counter=a(n)}update(e){return J(this,void 0,void 0,(function*(){return new Promise((t=>{this.queue.push({data:e,resolve:t}),this.release()}))}))}release(){return J(this,void 0,void 0,(function*(){if(!this.releasing){for(this.releasing=!0;this.queue.length;){const{data:e,resolve:t}=this.queue.shift();t(yield this._update(e))}this.releasing=!1}}))}perform(e){return J(this,void 0,void 0,(function*(){return yield D[this.mode]({name:"AES-CTR",counter:S(s(this.counter),16,!0,!0,!0),length:128},this.cryptoKey,e)}))}_update(e){return J(this,void 0,void 0,(function*(){let t,n=e;if(this.leftLength){const e=this.leftLength,r=16-e,o=new Uint8Array(e).concat(n.slice(0,r)),i=yield this.perform(o);t=new Uint8Array(i.slice(e)),n=n.slice(r),this.counter=this.counter.add(1)}const r=new Uint8Array(yield this.perform(n)),o=t?t.concat(r):r;let i=n.length;const f=i%16;i-=f;const c=i/16;return this.counter=this.counter.add(c),this.leftLength=f||void 0,o}))}}var V=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function f(e){try{a(r.next(e))}catch(e){i(e)}}function c(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(f,c)}a((r=r.apply(e,t||[])).next())}))};const X=new Map;let H=-1;console.log("CryptoWorker start");const Y={sha1:function(e){return D.digest("SHA-1",U(e)).then((e=>new Uint8Array(e)))},sha256:function(e){return D.digest("SHA-256",U(e)).then((e=>new Uint8Array(e)))},pbkdf2:function(e,t,n){return r=this,o=void 0,f=function*(){const r=yield D.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]);return D.deriveBits({name:"PBKDF2",salt:t,iterations:n,hash:{name:"SHA-512"}},r,512).then((e=>new Uint8Array(e)))},new((i=void 0)||(i=Promise))((function(e,t){function n(e){try{a(f.next(e))}catch(e){t(e)}}function c(e){try{a(f.throw(e))}catch(e){t(e)}}function a(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(n,c)}a((f=f.apply(r,o||[])).next())}));var r,o,i,f},"aes-encrypt":function(e,t,n){return W(S(e),t,n,!0)},"aes-decrypt":function(e,t,n){return W(e,t,n,!1)},"rsa-encrypt":function(e,t){return u(e,P(t.exponent),P(t.modulus))},factorize:function(e){let t=function(e){const t=a(e),n=[],r=[];let o=q(t);n.push(t.divide(o)),n.push(o);do{const e=n.pop();if(!e.eq(i().one))if(e.isPrime(!0)){r.push(e);for(let t=0;te.compare(t))),t.length>2&&(t=[t.splice(t.length-2,1)[0],t.reduce(((e,t)=>e.multiply(t)),i().one)]);const n=t[0],r=t[t.length-1];return(n.lesser(r)?[n,r]:[r,n]).map((e=>s(e)))},"mod-pow":u,gzipUncompress:function(e,t){return l().inflate(e,t?{to:"string"}:void 0)},computeSRP:function(e,t,n){return C(this,void 0,void 0,(function*(){const o=n?t.new_algo:t.current_algo,f=a(o.p),c=i()(o.g),u=yield function(e,t,n){return C(this,void 0,void 0,(function*(){let o=yield b.invokeCrypto("sha256",r(t,(new TextEncoder).encode(e),t));o=r(n,o,n),o=yield b.invokeCrypto("sha256",o);let i=yield b.invokeCrypto("pbkdf2",new Uint8Array(o),t,1e5);return i=r(n,i,n),o=yield b.invokeCrypto("sha256",i),o}))}(e,o.salt1,o.salt2),h=i()(function(e){const t=e.length,n=new Array(t);for(let r=0;r{const t=new Uint8Array(e.length);for(let n=0;n{const n=t.subtract(e);return!(n.isNegative()||n.bitLength().toJSNumber()<1984||e.bitLength().toJSNumber()<1984||Math.floor((e.bitLength().toJSNumber()+7)/8)>256)},{a:k,a_for_hash:P,u:x}=yield(()=>C(this,void 0,void 0,(function*(){for(;;){const e=a(y(t.secure_random)),n=c.modPow(e,f);if(A(n,f)){const t=s(n),o=a(yield b.invokeCrypto("sha256",r(t,w)));if(!o.isZero()&&!o.isNegative())return{a:e,a_for_hash:t,u:o}}}})))();let K;K=p.greater(m)?p:p.add(f),K=K.subtract(m).mod(f);const E=x.multiply(h),L=k.add(E),O=K.modPow(L,f),F=yield b.invokeCrypto("sha256",l(s(O),256));let _=yield b.invokeCrypto("sha256",v);_=function(e,t){const n=e.length,r=new Uint8Array(n);for(let o=0;o{for(;;){const t=k(new Uint8Array(e.length)),n=a(t);if(!n.greater(i().one))continue;const r=a(e);if(n.lesser(r.subtract(i().one)))return t}})(t),o=P(n.toString(16)),f=S(yield b.invokeCrypto("mod-pow",o,r,t),256,!0,!0,!0);return{a:r,g_a:f,g_a_hash:yield b.invokeCrypto("sha256",f),p:t}},new((r=void 0)||(r=Promise))((function(e,i){function f(e){try{a(o.next(e))}catch(e){i(e)}}function c(e){try{a(o.throw(e))}catch(e){i(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(f,c)}a((o=o.apply(t,n||[])).next())}));var t,n,r,o},"compute-dh-key":function(e,t,n){return r=this,o=void 0,s=function*(){const r=yield b.invokeCrypto("mod-pow",e,t,n);var o;return{key:r,key_fingerprint:(o=a((yield b.invokeCrypto("sha1",r)).slice(-8).reverse()),o.greater(c)?o.minus(f):o).toString(10)}},new((i=void 0)||(i=Promise))((function(e,t){function n(e){try{c(s.next(e))}catch(e){t(e)}}function f(e){try{c(s.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(n,f)}c((s=s.apply(r,o||[])).next())}));var r,o,i,s},"get-emojis-fingerprint":function(e,t){return n=this,r=void 0,i=function*(){const n=e.concat(t),r=yield b.invokeCrypto("sha256",n),o=[],i=A.length;for(let e=0;e!=r.length;e+=8){const t=m(r.slice(e,e+8)).mod(i).toJSNumber(),n=A[t];o.push(n)}return o},new((o=void 0)||(o=Promise))((function(e,t){function f(e){try{a(i.next(e))}catch(e){t(e)}}function c(e){try{a(i.throw(e))}catch(e){t(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(f,c)}a((i=i.apply(n,r||[])).next())}));var n,r,o,i},"aes-ctr-prepare":function({encKey:e,encIv:t,decKey:n,decIv:r}){return V(this,void 0,void 0,(function*(){const o=++H,i=[["encrypt",e],["decrypt",n]].map((([e,t])=>D.importKey("raw",t,{name:"AES-CTR"},!1,[e]))),[f,c]=yield Promise.all(i),a={enc:new $("encrypt",f,t.slice()),dec:new $("decrypt",c,r.slice())};return X.set(o,a),o}))},"aes-ctr-process":function({id:e,data:t,operation:n}){return V(this,void 0,void 0,(function*(){const r=X.get(e);return yield("encrypt"===n?r.enc:r.dec).update(t)}))},"aes-ctr-destroy":function(e){X.delete(e)}};b.addMultipleEventsListeners({invoke:({method:e,args:t})=>Y[e](...t),terminate:()=>{d.Z.close()}}),"undefined"!=typeof MessageChannel&&function(e,t,n){const r=(n,r)=>{e.attachListenPort(n),r&&e.attachSendPort(r),null==t||t(n)};e.setOnPortDisconnect(void 0),"undefined"!=typeof SharedWorkerGlobalScope?d.Z.addEventListener("connect",(e=>r(e.source,e.source))):"undefined"!=typeof ServiceWorkerGlobalScope?r(d.Z,null):r(d.Z,d.Z)}(b,(e=>{const t=new MessageChannel;b.attachPort(t.port1),b.invokeVoid("port",void 0,e,[t.port2])}))},5003:(e,t,n)=>{n.d(t,{kg:()=>d});var r,o=n(410),i=n(4762),f=n(1352),c=n(5289);!function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Log=4]="Log",e[e.Debug=8]="Debug"}(r||(r={}));const a=[r.None,r.Error,r.Warn,r.Log,r.Debug],s=!(i.IS_SAFARI||i.IS_FIREFOX),u="",h="",l=[["debug",r.Debug],["info",r.Log],["warn",r.Warn],["error",r.Error],["assert",r.Error],["trace",r.Log],["group",r.Log],["groupCollapsed",r.Log],["groupEnd",r.Log]];function d(e,t=r.Log|r.Warn|r.Error,n=!1,i=""){let y;o.ZP||n||(t=r.Error),s?i||(f.SU?i=u:f.N5&&(i=h)):i="";const p=i;i=i?`%s ${i}%s`:"%s";const v=function(...n){return t&r.Log&&console.log(i,(0,c.Z)(),e,...n)};return l.forEach((([n,r])=>{v[n]=function(...o){return t&r&&console[n](i,(0,c.Z)(),e,...o)}})),v.setPrefix=function(t){y=t,e="["+t+"]"},v.setPrefix(e),v.setLevel=function(e){t=a.slice(0,e+1).reduce(((e,t)=>e|t),0)},v.bindPrefix=function(e){return d(`${y}] [${e}`,t,n,p)},v}}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}o.m=n,o.x=()=>{var e=o.O(void 0,[699,211,85],(()=>o(6991)));return o.O(e)},e=[],o.O=(t,n,r,i)=>{if(!n){var f=1/0;for(u=0;u=i)&&Object.keys(o.O).every((e=>o.O[e](n[a])))?n.splice(a--,1):(c=!1,i0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[n,r,i]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,n)=>(o.f[n](e,t),t)),[])),o.u=e=>85===e?"85.887945ef5f43bc205112.bundle.js":{211:"npm.big-integer",699:"npm.pako"}[e]+"."+{211:"363d763daad0ee4e2741",699:"89deb457201f16c93925"}[e]+".chunk.js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{if(void 0!==o){var e=o.u,t=o.e,n={},r={};o.u=function(t){return e(t)+(n.hasOwnProperty(t)?"?"+n[t]:"")},o.e=function(i){return t(i).catch((function(t){var f=r.hasOwnProperty(i)?r[i]:999999;if(f<1){var c=e(i);throw t.message="Loading chunk "+i+" failed after 999999 retries.\n("+c+")",t.request=c,t}return new Promise((function(e){setTimeout((function(){var t=Date.now();n[i]=t,r[i]=f-1,e(o.e(i))}),3e3)}))}))}}})(),(()=>{var e={589:1};o.f.i=(t,n)=>{e[t]||importScripts(o.p+o.u(t))};var t=this.webpackChunktweb=this.webpackChunktweb||[],n=t.push.bind(t);t.push=t=>{var[r,i,f]=t;for(var c in i)o.o(i,c)&&(o.m[c]=i[c]);for(f&&f(o);r.length;)e[r.pop()]=1;n(t)}})(),t=o.x,o.x=()=>Promise.all([699,211,85].map(o.e,o)).then(t),o.x()})(); -//# sourceMappingURL=crypto.worker.7fb5055c6558e4a5c265.chunk.js.map \ No newline at end of file +//# sourceMappingURL=crypto.worker.c036d5d715f9894c08a3.chunk.js.map \ No newline at end of file diff --git a/public/crypto.worker.7fb5055c6558e4a5c265.chunk.js.map b/public/crypto.worker.c036d5d715f9894c08a3.chunk.js.map similarity index 99% rename from public/crypto.worker.7fb5055c6558e4a5c265.chunk.js.map rename to public/crypto.worker.c036d5d715f9894c08a3.chunk.js.map index 5919e6bb..ac56ad4a 100644 --- a/public/crypto.worker.7fb5055c6558e4a5c265.chunk.js.map +++ b/public/crypto.worker.c036d5d715f9894c08a3.chunk.js.map @@ -1 +1 @@ -{"version":3,"file":"crypto.worker.7fb5055c6558e4a5c265.chunk.js","mappings":"uBAAIA,ECAAC,E,4CCQG,MACMC,E,QAAoB,QAEpBC,EADuB,oBAAb,OAA2BC,OAASC,KAE3D,G,yECJO,MAAMC,EAAaC,UAAYA,UAAUC,UAAY,KAU/CC,GATWF,UAAUC,UAAUE,OAAO,yBACzBH,UAAUC,UAAUG,cAAcC,QAAQ,WACzC,SAASC,KAAKN,UAAUC,YAAc,aAAaK,KAAKN,UAAUO,SAG7D,mBAAmBD,KAAKN,UAAUQ,WACxC,aAAvBR,UAAUQ,UAA2BR,UAAUS,eAAiB,IAC/D,gBAE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ASrI,OAAS,EACnCoL,EAA2BnN,EAAK,C,KjDnB7B5O,EAAOsY,EAAoBvO,EAC/BuO,EAAoBvO,EAAI,IAChBtG,QAAQ1B,IAAI,CAAC,IAAI,IAAI,IAAImP,IAAIoH,EAAoB5B,EAAG4B,IAAsBlW,KAAKpC,GkDD7DsY,EAAoBvO,G","sources":["webpack://tweb/webpack/runtime/chunk loaded","webpack://tweb/webpack/runtime/startup chunk dependencies","webpack://tweb/./src/config/debug.ts","webpack://tweb/./src/environment/userAgent.ts","webpack://tweb/./src/helpers/context.ts","webpack://tweb/./src/helpers/bytes/bufferConcats.ts","webpack://tweb/./src/lib/polyfill.ts","webpack://tweb/./src/helpers/bigInt/bigIntConstants.ts","webpack://tweb/./src/helpers/bigInt/bigIntConversion.ts","webpack://tweb/./src/helpers/bytes/bytesModPow.ts","webpack://tweb/./src/lib/crypto/cryptoMessagePort.ts","webpack://tweb/./src/lib/calls/helpers/getEmojisFingerprint.ts","webpack://tweb/./src/helpers/array/randomize.ts","webpack://tweb/./src/helpers/bytes/addPadding.ts","webpack://tweb/./src/helpers/bytes/bytesFromHex.ts","webpack://tweb/./src/helpers/bytes/convertToUint8Array.ts","webpack://tweb/./node_modules/@cryptography/aes/dist/es/aes.js","webpack://tweb/./src/helpers/bytes/bytesToWordss.ts","webpack://tweb/./src/lib/crypto/utils/aesIGE.ts","webpack://tweb/./src/helpers/bytes/bytesFromWordss.ts","webpack://tweb/./src/helpers/random.ts","webpack://tweb/./src/helpers/bigInt/bigIntRandom.ts","webpack://tweb/./src/lib/crypto/utils/factorize/BrentPollard.ts","webpack://tweb/./src/lib/crypto/subtle.ts","webpack://tweb/./src/lib/crypto/utils/aesCTR.ts","webpack://tweb/./src/lib/crypto/aesCtrUtils.ts","webpack://tweb/./src/lib/crypto/crypto.worker.ts","webpack://tweb/./src/lib/crypto/utils/sha1.ts","webpack://tweb/./src/lib/crypto/utils/sha256.ts","webpack://tweb/./src/lib/crypto/utils/pbkdf2.ts","webpack://tweb/./src/lib/crypto/utils/rsa.ts","webpack://tweb/./src/helpers/gzipUncompress.ts","webpack://tweb/./src/lib/crypto/srp.ts","webpack://tweb/./src/helpers/bytes/bytesToHex.ts","webpack://tweb/./src/helpers/bytes/bytesXor.ts","webpack://tweb/./src/lib/crypto/generateDh.ts","webpack://tweb/./src/lib/crypto/computeDhKey.ts","webpack://tweb/./src/helpers/listenMessagePort.ts","webpack://tweb/./src/lib/logger.ts","webpack://tweb/webpack/bootstrap","webpack://tweb/webpack/runtime/compat get default export","webpack://tweb/webpack/runtime/define property getters","webpack://tweb/webpack/runtime/ensure chunk","webpack://tweb/webpack/runtime/get javascript chunk filename","webpack://tweb/webpack/runtime/get mini-css chunk filename","webpack://tweb/webpack/runtime/global","webpack://tweb/webpack/runtime/hasOwnProperty shorthand","webpack://tweb/webpack/runtime/node module decorator","webpack://tweb/webpack/runtime/publicPath","webpack://tweb/webpack/runtime/compat","webpack://tweb/webpack/runtime/importScripts chunk loading","webpack://tweb/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn Promise.all([699,211,85].map(__webpack_require__.e, __webpack_require__)).then(next);\n};","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Modes from './modes';\n\nexport const IS_BETA = process.env.NODE_ENV !== 'production';\nexport const DEBUG = (IS_BETA || Modes.debug)/* && false */;\nconst ctx: any = typeof(window) !== 'undefined' ? window : self;\nexport const MOUNT_CLASS_TO: any = DEBUG || true/* && false */ ? ctx : {};\nexport default DEBUG;\n\n// let m = DEBUG;\n/* if(!DEBUG) {\n ctx.sandpitTurtle = () => {\n //if(!m) {\n for(let i in MOUNT_CLASS_TO) {\n ctx[i] = MOUNT_CLASS_TO[i];\n }\n //m = true;\n //}\n\n //DEBUG = !DEBUG;\n };\n} */\n\n/* export const superDebug = (object: any, key: string) => {\n var d = object[key];\n var beforeStr = '', afterStr = '';\n for(var r of d) {\n beforeStr += r.before.hex + '\\n';\n afterStr += r.after.hex + '\\n';\n }\n\n beforeStr = beforeStr.trim();\n afterStr = afterStr.trim();\n //var beforeStr = d.map((r) => r.before.hex).join('\\n');\n //var afterStr = d.map((r) => r.after.hex).join('\\n');\n\n var dada = (name: string, str: string) => {\n var a = document.createElement('a');\n a.target = '_blank';\n a.download = name + '.txt';\n a.href = URL.createObjectURL(new Blob([str], {\n type: 'text/plain'\n }));\n document.body.append(a);\n a.click();\n };\n\n dada(key + '_' + 'before', beforeStr);\n dada(key + '_' + 'after', afterStr);\n}\n\nMOUNT_CLASS_TO.superDebug = superDebug; */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ctx from './ctx';\n\nexport const USER_AGENT = navigator ? navigator.userAgent : null;\nexport const IS_APPLE = navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i) !== -1;\nexport const IS_ANDROID = navigator.userAgent.toLowerCase().indexOf('android') !== -1;\nexport const IS_CHROMIUM = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);\n\n// https://stackoverflow.com/a/58065241\nexport const IS_APPLE_MOBILE = (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&\n !(ctx as any).MSStream;\n\nexport const IS_SAFARI = !!('safari' in ctx) || !!(USER_AGENT && (/\\b(iPad|iPhone|iPod)\\b/.test(USER_AGENT) || (!!USER_AGENT.match('Safari') && !USER_AGENT.match('Chrome'))))/* || true */;\nexport const IS_FIREFOX = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n\nexport const IS_MOBILE_SAFARI = IS_SAFARI && IS_APPLE_MOBILE;\n\nexport const IS_MOBILE = (navigator.maxTouchPoints === undefined || navigator.maxTouchPoints > 0) && navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i) != -1;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// в SW может быть сразу две переменных TRUE\nexport const IS_SERVICE_WORKER = typeof ServiceWorkerGlobalScope !== 'undefined' && self instanceof ServiceWorkerGlobalScope;\nexport const IS_WEB_WORKER = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope && !IS_SERVICE_WORKER;\nexport const IS_WORKER = IS_WEB_WORKER || IS_SERVICE_WORKER;\n\nexport const getWindowClients = () => {\n return (self as any as ServiceWorkerGlobalScope)\n .clients\n .matchAll({includeUncontrolled: false, type: 'window'});\n};\n\nexport const getLastWindowClient = () => getWindowClients().then((windowClients) => windowClients.slice(-1)[0]);\n\nconst postMessage = (listener: WindowClient | DedicatedWorkerGlobalScope, ...args: any[]) => {\n try {\n // @ts-ignore\n listener.postMessage(...args);\n } catch(err) {\n console.error('[worker] postMessage error:', err, args);\n }\n};\n\nconst notifyServiceWorker = (all: boolean, ...args: any[]) => {\n getWindowClients().then((listeners) => {\n if(!listeners.length) {\n // console.trace('no listeners?', self, listeners);\n return;\n }\n\n listeners.slice(all ? 0 : -1).forEach((listener) => {\n postMessage(listener, ...args);\n });\n });\n};\n\nconst notifyWorker = (...args: any[]) => {\n postMessage(self as any as DedicatedWorkerGlobalScope, ...args);\n};\n\nconst noop = () => {};\n\nexport const notifySomeone = IS_SERVICE_WORKER ? notifyServiceWorker.bind(null, false) : (IS_WEB_WORKER ? notifyWorker : noop);\nexport const notifyAll = IS_SERVICE_WORKER ? notifyServiceWorker.bind(null, true) : (IS_WEB_WORKER ? notifyWorker : noop);\n","export default function bufferConcats(...args: (ArrayBuffer | Uint8Array | number[])[]) {\n const length = args.reduce((acc, v) => acc + ((v as ArrayBuffer).byteLength || (v as Uint8Array).length), 0);\n\n const tmp = new Uint8Array(length);\n\n let lastLength = 0;\n args.forEach((b) => {\n tmp.set(b instanceof ArrayBuffer ? new Uint8Array(b) : b, lastLength);\n lastLength += (b as ArrayBuffer).byteLength || (b as Uint8Array).length;\n });\n\n return tmp/* .buffer */;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport bufferConcats from '../helpers/bytes/bufferConcats';\n\nUint8Array.prototype.concat = function(...args: Array) {\n return bufferConcats(this, ...args);\n};\n\n/* Uint8Array.prototype.toString = function() {\n return String.fromCharCode.apply(null, [...this]);\n}; */\n\nUint8Array.prototype.toJSON = function() {\n return [...this];\n // return {type: 'bytes', value: [...this]};\n};\n\nPromise.prototype.finally = Promise.prototype.finally || function(this: Promise, fn: () => any) {\n const onFinally = (callback: typeof fn) => Promise.resolve(fn()).then(callback);\n return this.then(\n result => onFinally(() => result),\n reason => onFinally(() => Promise.reject(reason))\n );\n};\n\ndeclare global {\n interface Uint8Array {\n concat: (...args: Array) => Uint8Array,\n // toString: () => string,\n toJSON: () => number[],\n // toJSON: () => {type: 'bytes', value: number[]},\n }\n\n interface Promise {\n finally: (onfinally?: () => void) => Promise;\n }\n}\n","import bigInt from 'big-integer';\n\nexport const safeBigInt = bigInt(Number.MAX_SAFE_INTEGER);\nexport const ulongBigInt = bigInt(bigInt[2]).pow(64);\nexport const longBigInt = ulongBigInt.divide(bigInt[2]);\n","import bigInt from 'big-integer';\nimport { longBigInt, ulongBigInt } from './bigIntConstants';\n\nexport function bigIntFromBytes(bytes: Uint8Array | number[], base = 256) {\n return bigInt.fromArray(bytes instanceof Uint8Array ? [...bytes] : bytes, base);\n}\n\nexport function bigIntToBytes(bigInt: bigInt.BigInteger) {\n return new Uint8Array(bigInt.toArray(256).value);\n}\n\nexport function bigIntToSigned(bigInt: bigInt.BigInteger) {\n return bigInt.greater(longBigInt) ? bigInt.minus(ulongBigInt) : bigInt;\n}\n\nexport function bigIntToUnsigned(bigInt: bigInt.BigInteger) {\n return bigInt.isNegative() ? ulongBigInt.add(bigInt) : bigInt;\n}\n","import {bigIntFromBytes, bigIntToBytes} from '../bigInt/bigIntConversion';\n\nexport default function bytesModPow(bytes: number[] | Uint8Array, exp: number[] | Uint8Array, mod: number[] | Uint8Array) {\n const bytesBigInt = bigIntFromBytes(bytes);\n const expBigInt = bigIntFromBytes(exp);\n const modBigInt = bigIntFromBytes(mod);\n const resBigInt = bytesBigInt.modPow(expBigInt, modBigInt);\n return bigIntToBytes(resBigInt);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {CryptoMethods} from './crypto_methods';\nimport SuperMessagePort from '../mtproto/superMessagePort';\nimport {Awaited} from '../../types';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport {IS_WORKER} from '../../helpers/context';\n\ntype CryptoEvent = {\n invoke: (payload: {method: T, args: Parameters}) => ReturnType,\n port: (payload: void, source: MessageEventSource, event: MessageEvent) => void,\n terminate: () => void\n};\n\nexport class CryptoMessagePort extends SuperMessagePort {\n private lastIndex: number;\n\n constructor() {\n super('CRYPTO');\n this.lastIndex = -1;\n }\n\n public invokeCryptoNew({method, args, transfer}: {\n method: T,\n args: Parameters,\n transfer?: Transferable[]\n }): Promise>> {\n const payload = {method, args};\n const listeners = this.listeners['invoke'];\n if(listeners?.length) { // already in worker\n // try {\n // @ts-ignore\n let result: any = listeners[0].callback(payload);\n if(!IS_WORKER && !(result instanceof Promise)) {\n result = Promise.resolve(result);\n }\n\n return result;\n // } catch(err) {\n // return Promise.reject(err);\n // }\n }\n\n const sendPortIndex = method === 'aes-encrypt' || method === 'aes-decrypt' ?\n this.lastIndex = (this.lastIndex + 1) % this.sendPorts.length :\n 0;\n // @ts-ignore\n return this.invoke('invoke', payload, undefined, this.sendPorts[sendPortIndex], transfer);\n }\n\n public invokeCrypto(method: T, ...args: Parameters): Promise>> {\n return this.invokeCryptoNew({method, args});\n }\n}\n\nconst cryptoMessagePort = new CryptoMessagePort();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.cryptoMessagePort = cryptoMessagePort);\nexport default cryptoMessagePort;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cryptoWorker from '../../crypto/cryptoMessagePort';\nimport bigInt from 'big-integer';\n\nfunction readBigIntFromBytesBE(bytes: Uint8Array) {\n const length = bytes.length;\n const bits = length * 8;\n let value = bigInt(bytes[0]).and(0x7F).shiftLeft(bits - 8);\n for(let i = 1; i < length; ++i) {\n const _bits = bits - (i + 1) * 8;\n const b = bigInt(bytes[i]);\n value = value.or(_bits ? b.shiftLeft(_bits) : b);\n }\n\n return value;\n}\n\n// Emojis were taken from tdlib\nconst emojis = [\n '1f609', '1f60d', '1f61b', '1f62d', '1f631', '1f621', '1f60e',\n '1f634', '1f635', '1f608', '1f62c', '1f607', '1f60f', '1f46e',\n '1f477', '1f482', '1f476', '1f468', '1f469', '1f474', '1f475',\n '1f63b', '1f63d', '1f640', '1f47a', '1f648', '1f649', '1f64a',\n '1f480', '1f47d', '1f4a9', '1f525', '1f4a5', '1f4a4', '1f442',\n '1f440', '1f443', '1f445', '1f444', '1f44d', '1f44e', '1f44c',\n '1f44a', '270c', '270b', '1f450', '1f446', '1f447', '1f449',\n '1f448', '1f64f', '1f44f', '1f4aa', '1f6b6', '1f3c3', '1f483',\n '1f46b', '1f46a', '1f46c', '1f46d', '1f485', '1f3a9', '1f451',\n '1f452', '1f45f', '1f45e', '1f460', '1f455', '1f457', '1f456',\n '1f459', '1f45c', '1f453', '1f380', '1f484', '1f49b', '1f499',\n '1f49c', '1f49a', '1f48d', '1f48e', '1f436', '1f43a', '1f431',\n '1f42d', '1f439', '1f430', '1f438', '1f42f', '1f428', '1f43b',\n '1f437', '1f42e', '1f417', '1f434', '1f411', '1f418', '1f43c',\n '1f427', '1f425', '1f414', '1f40d', '1f422', '1f41b', '1f41d',\n '1f41c', '1f41e', '1f40c', '1f419', '1f41a', '1f41f', '1f42c',\n '1f40b', '1f410', '1f40a', '1f42b', '1f340', '1f339', '1f33b',\n '1f341', '1f33e', '1f344', '1f335', '1f334', '1f333', '1f31e',\n '1f31a', '1f319', '1f30e', '1f30b', '26a1', '2614', '2744', '26c4',\n '1f300', '1f308', '1f30a', '1f393', '1f386', '1f383', '1f47b',\n '1f385', '1f384', '1f381', '1f388', '1f52e', '1f3a5', '1f4f7',\n '1f4bf', '1f4bb', '260e', '1f4e1', '1f4fa', '1f4fb', '1f509',\n '1f514', '23f3', '23f0', '231a', '1f512', '1f511', '1f50e',\n '1f4a1', '1f526', '1f50c', '1f50b', '1f6bf', '1f6bd', '1f527',\n '1f528', '1f6aa', '1f6ac', '1f4a3', '1f52b', '1f52a', '1f48a',\n '1f489', '1f4b0', '1f4b5', '1f4b3', '2709', '1f4eb', '1f4e6',\n '1f4c5', '1f4c1', '2702', '1f4cc', '1f4ce', '2712', '270f',\n '1f4d0', '1f4da', '1f52c', '1f52d', '1f3a8', '1f3ac', '1f3a4',\n '1f3a7', '1f3b5', '1f3b9', '1f3bb', '1f3ba', '1f3b8', '1f47e',\n '1f3ae', '1f0cf', '1f3b2', '1f3af', '1f3c8', '1f3c0', '26bd',\n '26be', '1f3be', '1f3b1', '1f3c9', '1f3b3', '1f3c1', '1f3c7',\n '1f3c6', '1f3ca', '1f3c4', '2615', '1f37c', '1f37a', '1f377',\n '1f374', '1f355', '1f354', '1f35f', '1f357', '1f371', '1f35a',\n '1f35c', '1f361', '1f373', '1f35e', '1f369', '1f366', '1f382',\n '1f370', '1f36a', '1f36b', '1f36d', '1f36f', '1f34e', '1f34f',\n '1f34a', '1f34b', '1f352', '1f347', '1f349', '1f353', '1f351',\n '1f34c', '1f350', '1f34d', '1f346', '1f345', '1f33d', '1f3e1',\n '1f3e5', '1f3e6', '26ea', '1f3f0', '26fa', '1f3ed', '1f5fb',\n '1f5fd', '1f3a0', '1f3a1', '26f2', '1f3a2', '1f6a2', '1f6a4',\n '2693', '1f680', '2708', '1f681', '1f682', '1f68b', '1f68e',\n '1f68c', '1f699', '1f697', '1f695', '1f69b', '1f6a8', '1f694',\n '1f692', '1f691', '1f6b2', '1f6a0', '1f69c', '1f6a6', '26a0',\n '1f6a7', '26fd', '1f3b0', '1f5ff', '1f3aa', '1f3ad',\n '1f1ef-1f1f5', '1f1f0-1f1f7', '1f1e9-1f1ea', '1f1e8-1f1f3',\n '1f1fa-1f1f8', '1f1eb-1f1f7', '1f1ea-1f1f8', '1f1ee-1f1f9',\n '1f1f7-1f1fa', '1f1ec-1f1e7', '0031-20e3', '0032-20e3', '0033-20e3',\n '0034-20e3', '0035-20e3', '0036-20e3', '0037-20e3', '0038-20e3', '0039-20e3',\n '0030-20e3', '1f51f', '2757', '2753', '2665', '2666', '1f4af', '1f517',\n '1f531', '1f534', '1f535', '1f536', '1f537'\n];\n\nexport default async function getEmojisFingerprint(key: Uint8Array, g_a: Uint8Array) {\n const arr = key.concat(g_a);\n const hash = await cryptoWorker.invokeCrypto('sha256', arr);\n\n const result: [string, string, string, string] = [] as any;\n const emojisLength = emojis.length;\n\n const kPartSize = 8;\n for(let partOffset = 0; partOffset != hash.length; partOffset += kPartSize) {\n const bytes = hash.slice(partOffset, partOffset + kPartSize);\n const value = readBigIntFromBytesBE(bytes);\n const index = value.mod(emojisLength).toJSNumber();\n\n // const emoji = emojiFromCodePoints(emojis[index]);\n const codePoints = emojis[index];\n result.push(codePoints);\n }\n\n return result;\n}\n","export default function randomize(arr: T) {\n if(crypto && 'getRandomValues' in crypto) {\n crypto.getRandomValues(arr);\n } else {\n throw new Error('NO_SECURE_RANDOM');\n }\n\n return arr;\n}\n","import randomize from '../array/randomize';\nimport bufferConcats from './bufferConcats';\n\nexport default function addPadding(\n bytes: T,\n blockSize: number = 16,\n zeroes?: boolean,\n blockSizeAsTotalLength = false,\n prepend = false\n): T {\n const len = (bytes as ArrayBuffer).byteLength || (bytes as Uint8Array).length;\n const needPadding = blockSizeAsTotalLength ? blockSize - len : blockSize - (len % blockSize);\n if(needPadding > 0 && needPadding < blockSize) {\n // //console.log('addPadding()', len, blockSize, needPadding);\n const padding = new Uint8Array(needPadding);\n if(zeroes) {\n for(let i = 0; i < needPadding; ++i) {\n padding[i] = 0;\n }\n } else {\n randomize(padding);\n }\n\n if(bytes instanceof ArrayBuffer) {\n return (prepend ? bufferConcats(padding, bytes) : bufferConcats(bytes, padding)).buffer as T;\n } else if(bytes instanceof Uint8Array) {\n return (prepend ? bufferConcats(padding, bytes) : bufferConcats(bytes, padding)) as T;\n } else {\n // @ts-ignore\n return (prepend ? [...padding].concat(bytes) : bytes.concat([...padding])) as T;\n }\n }\n\n return bytes;\n}\n","export default function bytesFromHex(hexString: string) {\n const len = hexString.length;\n const bytes = new Uint8Array(Math.ceil(len / 2));\n let start = 0;\n\n if(len % 2) { // read 0x581 as 0x0581\n bytes[start++] = parseInt(hexString.charAt(0), 16);\n }\n\n for(let i = start; i < len; i += 2) {\n bytes[start++] = parseInt(hexString.substr(i, 2), 16);\n }\n\n return bytes;\n}\n","export default function convertToUint8Array(bytes: Uint8Array | ArrayBuffer | number[] | string): Uint8Array {\n if(bytes instanceof Uint8Array) {\n return bytes;\n } else if(typeof(bytes) === 'string') {\n return new TextEncoder().encode(bytes);\n }\n\n return new Uint8Array(bytes);\n}\n","var S = new Uint8Array(256);\nvar Si = new Uint8Array(256);\nvar T1 = new Uint32Array(256);\nvar T2 = new Uint32Array(256);\nvar T3 = new Uint32Array(256);\nvar T4 = new Uint32Array(256);\nvar T5 = new Uint32Array(256);\nvar T6 = new Uint32Array(256);\nvar T7 = new Uint32Array(256);\nvar T8 = new Uint32Array(256);\nfunction computeTables() {\n var d = new Uint8Array(256);\n var t = new Uint8Array(256);\n var x2;\n var x4;\n var x8;\n var s;\n var tEnc;\n var tDec;\n var x = 0;\n var xInv = 0;\n // Compute double and third tables\n for (var i = 0; i < 256; i++) {\n d[i] = i << 1 ^ (i >> 7) * 283;\n t[d[i] ^ i] = i;\n }\n for (; !S[x]; x ^= x2 || 1) {\n // Compute sbox\n s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n s = s >> 8 ^ s & 255 ^ 99;\n S[x] = s;\n Si[s] = x;\n // Compute MixColumns\n x8 = d[x4 = d[x2 = d[x]]];\n tDec = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n tEnc = d[s] * 0x101 ^ s * 0x1010100;\n T1[x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n T2[x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n T3[x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n T4[x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n T5[s] = tDec = tDec << 24 ^ tDec >>> 8;\n T6[s] = tDec = tDec << 24 ^ tDec >>> 8;\n T7[s] = tDec = tDec << 24 ^ tDec >>> 8;\n T8[s] = tDec = tDec << 24 ^ tDec >>> 8;\n xInv = t[xInv] || 1;\n }\n}\n\n/**\n * Gets a uint32 from string in big-endian order order\n */\nfunction s2i(str, pos) {\n return (str.charCodeAt(pos) << 24\n ^ str.charCodeAt(pos + 1) << 16\n ^ str.charCodeAt(pos + 2) << 8\n ^ str.charCodeAt(pos + 3));\n}\n\n/* eslint-disable import/prefer-default-export */\n/**\n * Helper function for transforming string key to Uint32Array\n */\nfunction getWords(key) {\n if (key instanceof Uint32Array) {\n return key;\n }\n if (typeof key === 'string') {\n if (key.length % 4 !== 0)\n for (var i = key.length % 4; i <= 4; i++)\n key += '\\0x00';\n var buf = new Uint32Array(key.length / 4);\n for (var i = 0; i < key.length; i += 4)\n buf[i / 4] = s2i(key, i);\n return buf;\n }\n if (key instanceof Uint8Array) {\n var buf = new Uint32Array(key.length / 4);\n for (var i = 0; i < key.length; i += 4) {\n buf[i / 4] = (key[i] << 24\n ^ key[i + 1] << 16\n ^ key[i + 2] << 8\n ^ key[i + 3]);\n }\n return buf;\n }\n throw new Error('Unable to create 32-bit words');\n}\nfunction xor(left, right, to) {\n if (to === void 0) { to = left; }\n for (var i = 0; i < left.length; i++)\n to[i] = left[i] ^ right[i];\n}\n\ncomputeTables();\n/**\n * Low-level AES Cipher\n */\nvar AES = /** @class */ (function () {\n function AES(_key) {\n var key = getWords(_key);\n if (key.length !== 4 && key.length !== 6 && key.length !== 8) {\n throw new Error('Invalid key size');\n }\n this.encKey = new Uint32Array(4 * key.length + 28);\n this.decKey = new Uint32Array(4 * key.length + 28);\n this.encKey.set(key);\n var rcon = 1;\n var i = key.length;\n var tmp;\n // schedule encryption keys\n for (; i < 4 * key.length + 28; i++) {\n tmp = this.encKey[i - 1];\n // apply sbox\n if (i % key.length === 0 || (key.length === 8 && i % key.length === 4)) {\n tmp = S[tmp >>> 24] << 24 ^ S[(tmp >> 16) & 255] << 16 ^ S[(tmp >> 8) & 255] << 8 ^ S[tmp & 255];\n // shift rows and add rcon\n if (i % key.length === 0) {\n tmp = tmp << 8 ^ tmp >>> 24 ^ (rcon << 24);\n rcon = rcon << 1 ^ (rcon >> 7) * 283;\n }\n }\n this.encKey[i] = this.encKey[i - key.length] ^ tmp;\n }\n // schedule decryption keys\n for (var j = 0; i; j++, i--) {\n tmp = this.encKey[j & 3 ? i : i - 4];\n if (i <= 4 || j < 4) {\n this.decKey[j] = tmp;\n }\n else {\n this.decKey[j] = (T5[S[tmp >>> 24]]\n ^ T6[S[(tmp >> 16) & 255]]\n ^ T7[S[(tmp >> 8) & 255]]\n ^ T8[S[tmp & 255]]);\n }\n }\n }\n AES.prototype.encrypt = function (_message) {\n var message = getWords(_message);\n var out = new Uint32Array(4);\n var a = message[0] ^ this.encKey[0];\n var b = message[1] ^ this.encKey[1];\n var c = message[2] ^ this.encKey[2];\n var d = message[3] ^ this.encKey[3];\n var rounds = this.encKey.length / 4 - 2;\n var k = 4;\n var a2;\n var b2;\n var c2;\n // Inner rounds. Cribbed from OpenSSL.\n for (var i = 0; i < rounds; i++) {\n a2 = T1[a >>> 24] ^ T2[(b >> 16) & 255] ^ T3[(c >> 8) & 255] ^ T4[d & 255] ^ this.encKey[k];\n b2 = T1[b >>> 24] ^ T2[(c >> 16) & 255] ^ T3[(d >> 8) & 255] ^ T4[a & 255] ^ this.encKey[k + 1];\n c2 = T1[c >>> 24] ^ T2[(d >> 16) & 255] ^ T3[(a >> 8) & 255] ^ T4[b & 255] ^ this.encKey[k + 2];\n d = T1[d >>> 24] ^ T2[(a >> 16) & 255] ^ T3[(b >> 8) & 255] ^ T4[c & 255] ^ this.encKey[k + 3];\n a = a2;\n b = b2;\n c = c2;\n k += 4;\n // console.log(a, b, c, d);\n }\n // Last round.\n for (var i = 0; i < 4; i++) {\n out[i] = (S[a >>> 24] << 24\n ^ S[(b >> 16) & 255] << 16\n ^ S[(c >> 8) & 255] << 8\n ^ S[d & 255]\n ^ this.encKey[k++]);\n a2 = a;\n a = b;\n b = c;\n c = d;\n d = a2;\n }\n return out;\n };\n AES.prototype.decrypt = function (_message) {\n var message = getWords(_message);\n var out = new Uint32Array(4);\n var a = message[0] ^ this.decKey[0];\n var b = message[3] ^ this.decKey[1];\n var c = message[2] ^ this.decKey[2];\n var d = message[1] ^ this.decKey[3];\n var rounds = this.decKey.length / 4 - 2;\n var a2;\n var b2;\n var c2;\n var k = 4;\n // Inner rounds. Cribbed from OpenSSL.\n for (var i = 0; i < rounds; i++) {\n a2 = T5[a >>> 24] ^ T6[(b >> 16) & 255] ^ T7[(c >> 8) & 255] ^ T8[d & 255] ^ this.decKey[k];\n b2 = T5[b >>> 24] ^ T6[(c >> 16) & 255] ^ T7[(d >> 8) & 255] ^ T8[a & 255] ^ this.decKey[k + 1];\n c2 = T5[c >>> 24] ^ T6[(d >> 16) & 255] ^ T7[(a >> 8) & 255] ^ T8[b & 255] ^ this.decKey[k + 2];\n d = T5[d >>> 24] ^ T6[(a >> 16) & 255] ^ T7[(b >> 8) & 255] ^ T8[c & 255] ^ this.decKey[k + 3];\n a = a2;\n b = b2;\n c = c2;\n k += 4;\n }\n // Last round.\n for (var i = 0; i < 4; i++) {\n out[3 & -i] = (Si[a >>> 24] << 24\n ^ Si[(b >> 16) & 255] << 16\n ^ Si[(c >> 8) & 255] << 8\n ^ Si[d & 255]\n ^ this.decKey[k++]);\n a2 = a;\n a = b;\n b = c;\n c = d;\n d = a2;\n }\n return out;\n };\n return AES;\n}());\n\n/**\n * AES-IGE mode.\n */\nvar AES_IGE = /** @class */ (function () {\n function AES_IGE(key, iv, blockSize) {\n if (blockSize === void 0) { blockSize = 16; }\n this.key = getWords(key);\n this.iv = getWords(iv);\n this.cipher = new AES(key);\n this.blockSize = blockSize / 4;\n }\n /**\n * Encrypts plain text with AES-IGE mode.\n */\n AES_IGE.prototype.encrypt = function (message, buf) {\n var text = getWords(message);\n var cipherText = buf || new Uint32Array(text.length);\n var prevX = this.iv.subarray(this.blockSize, this.iv.length);\n var prevY = this.iv.subarray(0, this.blockSize);\n var yXOR = new Uint32Array(this.blockSize);\n for (var i = 0; i < text.length; i += this.blockSize) {\n var x = text.subarray(i, i + this.blockSize);\n xor(x, prevY, yXOR);\n var y = this.cipher.encrypt(yXOR);\n xor(y, prevX);\n prevX = x;\n prevY = y;\n for (var j = i, k = 0; j < text.length && k < 4; j++, k++)\n cipherText[j] = y[k];\n }\n return cipherText;\n };\n /**\n * Decrypts cipher text with AES-IGE mode.\n */\n AES_IGE.prototype.decrypt = function (message, buf) {\n var cipherText = getWords(message);\n var text = buf || new Uint32Array(cipherText.length);\n var prevY = this.iv.subarray(this.blockSize, this.iv.length);\n var prevX = this.iv.subarray(0, this.blockSize);\n var yXOR = new Uint32Array(this.blockSize);\n for (var i = 0; i < text.length; i += this.blockSize) {\n var x = cipherText.subarray(i, i + this.blockSize);\n xor(x, prevY, yXOR);\n var y = this.cipher.decrypt(yXOR);\n xor(y, prevX);\n prevX = x;\n prevY = y;\n for (var j = i, k = 0; j < text.length && k < 4; j++, k++)\n text[j] = y[k];\n }\n return text;\n };\n return AES_IGE;\n}());\n\n/**\n * AES-IGE mode.\n */\nvar AES_IGE$1 = /** @class */ (function () {\n function AES_IGE(key, counter, blockSize) {\n if (blockSize === void 0) { blockSize = 16; }\n this.offset = 0;\n this.key = getWords(key);\n this.counter = getWords(counter);\n this.cipher = new AES(key);\n this.blockSize = blockSize / 4;\n if (this.counter.length !== 4) {\n throw new Error('AES-CTR mode counter must be 16 bytes length');\n }\n }\n /**\n * Encrypts plain text with AES-IGE mode.\n */\n AES_IGE.prototype.encrypt = function (message, buf) {\n var text = getWords(message);\n var cipherText = buf || new Uint32Array(text.length);\n var offset = this.offset;\n for (var i = 0; i < text.length; i += this.blockSize) {\n var x = this.cipher.encrypt(this.counter);\n for (var j = i, k = offset; j < text.length && k < this.blockSize; j++, k++)\n cipherText[j] = x[k] ^ text[j];\n if (text.length - i >= this.blockSize)\n this.incrementCounter();\n if (offset) {\n i -= offset;\n offset = 0;\n }\n }\n this.offset = (this.offset + (text.length % 4)) % 4;\n return cipherText;\n };\n /**\n * Decrypts cipher text with AES-IGE mode.\n */\n AES_IGE.prototype.decrypt = function (message, buf) {\n return this.encrypt(message, buf);\n };\n AES_IGE.prototype.incrementCounter = function () {\n // increment counter\n for (var carry = this.counter.length - 1; carry >= 0; carry--) {\n if (++this.counter[carry] < 0xFFFFFFFF)\n break; // If overflowing, it'll be 0 and we'll have to continue propagating the carry\n }\n };\n return AES_IGE;\n}());\n\nexport default AES;\nexport { AES_IGE$1 as CTR, AES_IGE as IGE };\n","import convertToUint8Array from './convertToUint8Array';\n\nexport default function bytesToWordss(input: Parameters[0]) {\n const bytes = convertToUint8Array(input);\n\n const words: number[] = [];\n for(let i = 0, len = bytes.length; i < len; ++i) {\n words[i >>> 2] |= bytes[i] << (24 - (i % 4) * 8);\n }\n\n return new Uint32Array(words);\n}\n","import {IGE} from '@cryptography/aes';\nimport addPadding from '../../../helpers/bytes/addPadding';\nimport bytesFromWordss from '../../../helpers/bytes/bytesFromWordss';\nimport bytesToWordss from '../../../helpers/bytes/bytesToWordss';\n\nexport default function aesSync(bytes: Uint8Array, keyBytes: Uint8Array, ivBytes: Uint8Array, encrypt = true) {\n // console.log(dT(), 'AES start', bytes, keyBytes, ivBytes);\n\n const cipher = new IGE(bytesToWordss(keyBytes), bytesToWordss(ivBytes));\n const performedBytes = cipher[encrypt ? 'encrypt' : 'decrypt'](bytesToWordss(bytes));\n // console.log(dT(), 'AES finish');\n\n return bytesFromWordss(performedBytes);\n}\n\nexport function aesEncryptSync(bytes: Uint8Array, keyBytes: Uint8Array, ivBytes: Uint8Array) {\n return aesSync(addPadding(bytes), keyBytes, ivBytes, true);\n}\n\nexport function aesDecryptSync(bytes: Uint8Array, keyBytes: Uint8Array, ivBytes: Uint8Array) {\n return aesSync(bytes, keyBytes, ivBytes, false);\n}\n","export default function bytesFromWordss(input: Uint32Array) {\n const o = new Uint8Array(input.byteLength);\n for(let i = 0, length = input.length * 4; i < length; ++i) {\n o[i] = ((input[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff);\n }\n\n return o;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nconst arrays = {\n 8: new Uint8Array(1),\n 16: new Uint16Array(1),\n 32: new Uint32Array(1)\n};\nexport function nextRandomUint(bits: 8 | 16 | 32) {\n const array = arrays[bits];\n crypto.getRandomValues(array);\n return array[0];\n}\n\nexport function randomLong() {\n return '' + nextRandomUint(32) + nextRandomUint(32) % 0xFFFFFF;\n}\n","import bigInt from 'big-integer';\nimport {nextRandomUint} from '../random';\n\nexport default function bigIntRandom(min: bigInt.BigNumber, max: bigInt.BigNumber) {\n return bigInt.randBetween(min, max, () => {\n return nextRandomUint(32) / 0xFFFFFFFF;\n /* const bits = 32;\n const randomBytes = new Uint8Array(bits / 8);\n crypto.getRandomValues(randomBytes);\n const r = bigIntFromBytes(randomBytes).mod(bigInt(2).pow(bits));\n return r.toJSNumber(); */\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// Thanks to https://xn--2-umb.com/09/12/brent-pollard-rho-factorisation/\n\nimport bigInt from 'big-integer';\nimport {bigIntFromBytes, bigIntToBytes} from '../../../../helpers/bigInt/bigIntConversion';\nimport bigIntRandom from '../../../../helpers/bigInt/bigIntRandom';\n\n// let test = 0;\nfunction BrentPollardFactor(n: bigInt.BigInteger) {\n const two = bigInt[2];\n if(n.remainder(two).isZero()) {\n return two;\n }\n\n const m = bigInt(1000);\n let a: bigInt.BigInteger,\n x: bigInt.BigInteger,\n y: bigInt.BigInteger,\n ys: bigInt.BigInteger,\n r: bigInt.BigInteger,\n q: bigInt.BigInteger,\n g: bigInt.BigInteger;\n do\n a = bigIntRandom(bigInt.one, n.minus(1));\n while(a.isZero() || a.eq(n.minus(two)));\n y = bigIntRandom(bigInt.one, n.minus(1));\n r = bigInt.one;\n q = bigInt.one;\n\n // if(!test++) {\n // a = bigInt(3);\n // y = bigInt(3);\n // }\n\n const bigIntUint64 = bigInt('FFFFFFFFFFFFFFFF', 16);\n const bigIntUint64MinusPqPlusOne = bigIntUint64.minus(n).plus(1);\n\n const performY = (y: bigInt.BigInteger) => {\n y = y.pow(two).mod(n);\n y = y.add(a);\n if(y.lesser(a)) { // it slows down the script\n y = y.add(bigIntUint64MinusPqPlusOne);\n }\n y = y.mod(n);\n return y;\n };\n\n do {\n x = y;\n for(let i = 0; bigInt(i).lesser(r); ++i) {\n y = performY(y);\n }\n\n let k = bigInt.zero;\n do {\n ys = y;\n const condition = bigInt.min(m, r.minus(k));\n for(let i = 0; bigInt(i).lesser(condition); ++i) {\n y = performY(y);\n q = q.multiply(x.greater(y) ? x.minus(y) : y.minus(x)).mod(n);\n }\n g = bigInt.gcd(q, n);\n k = k.add(m);\n } while(k.lesser(r) && g.eq(bigInt.one));\n\n r = r.shiftLeft(bigInt.one);\n } while(g.eq(bigInt.one));\n\n if(g.eq(n)) {\n do {\n ys = performY(ys);\n g = bigInt.gcd(x.minus(ys).abs(), n);\n } while(g.eq(bigInt.one));\n }\n\n return g;\n}\n\nfunction primeFactors(pqBytes: Uint8Array | number[]) {\n const n = bigIntFromBytes(pqBytes);\n\n const factors: bigInt.BigInteger[] = [];\n const primes: bigInt.BigInteger[] = [];\n\n let factor = BrentPollardFactor(n);\n factors.push(n.divide(factor));\n factors.push(factor);\n\n // return [factor];\n\n do {\n const m = factors.pop();\n\n if(m.eq(bigInt.one))\n continue;\n\n if(m.isPrime(true)) {\n primes.push(m);\n\n // Remove the prime from the other factors\n for(let i = 0; i < factors.length; ++i) {\n let k = factors[i];\n if(k.mod(m).isZero()) {\n do\n k = k.divide(m);\n while(k.mod(m).isZero());\n factors[i] = k;\n }\n }\n } else {\n // factor = m.lesser(100) ? bigInt(PollardRho(m.toJSNumber())) : this.brentPollardFactor(m);\n factor = BrentPollardFactor(m);\n factors.push(m.divide(factor));\n factors.push(factor);\n }\n } while(factors.length);\n\n return primes;\n}\n\nexport default function factorizeBrentPollardPQ(pqBytes: Uint8Array | number[]): [Uint8Array, Uint8Array] {\n let factors = primeFactors(pqBytes);\n factors.sort((a, b) => a.compare(b));\n if(factors.length > 2) {\n factors = [\n factors.splice(factors.length - 2, 1)[0],\n factors.reduce((acc, v) => acc.multiply(v), bigInt.one)\n ];\n }\n\n const p = factors[0], q = factors[factors.length - 1];\n return (p.lesser(q) ? [p, q] : [q, p]).map((b) => bigIntToBytes(b)) as any;\n}\n","const subtle = typeof(window) !== 'undefined' && 'crypto' in window ? window.crypto.subtle : self.crypto.subtle;\n\nexport default subtle;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {BigInteger} from 'big-integer';\nimport {bigIntFromBytes, bigIntToBytes} from '../../../helpers/bigInt/bigIntConversion';\nimport addPadding from '../../../helpers/bytes/addPadding';\nimport subtle from '../subtle';\n\nconst COUNTER_LENGTH = 16;\n\nexport default class CTR {\n private cryptoKey: CryptoKey;\n // private encLeft: Uint8Array;\n private leftLength: number;\n private mode: 'encrypt' | 'decrypt';\n private counter: BigInteger;\n private queue: {data: Uint8Array, resolve: (data: Uint8Array) => void}[];\n private releasing: boolean;\n\n constructor(mode: 'encrypt' | 'decrypt', cryptoKey: CryptoKey, counter: Uint8Array) {\n this.mode = mode;\n this.cryptoKey = cryptoKey;\n this.queue = [];\n this.counter = bigIntFromBytes(counter);\n }\n\n public async update(data: Uint8Array) {\n return new Promise((resolve) => {\n this.queue.push({data, resolve});\n this.release();\n });\n }\n\n private async release() {\n if(this.releasing) {\n return;\n }\n\n this.releasing = true;\n while(this.queue.length) {\n const {data, resolve} = this.queue.shift();\n resolve(await this._update(data));\n }\n this.releasing = false;\n }\n\n private async perform(data: Uint8Array) {\n const arrayBuffer: ArrayBuffer = await subtle[this.mode]({\n name: 'AES-CTR',\n counter: addPadding(bigIntToBytes(this.counter), COUNTER_LENGTH, true, true, true),\n length: 128\n },\n this.cryptoKey,\n data\n );\n\n return arrayBuffer;\n }\n\n private async _update(data: Uint8Array) {\n let toEncrypt = data;\n let head: Uint8Array/* , tail: Uint8Array */;\n if(this.leftLength) {\n // const leftLength = this.encLeft.byteLength;\n const leftLength = this.leftLength;\n const leftLength2 = COUNTER_LENGTH - leftLength;\n // const left = this.encLeft.concat(toEncrypt.slice(0, leftLength2));\n const left = (new Uint8Array(leftLength)).concat(toEncrypt.slice(0, leftLength2));\n\n const performed = await this.perform(left);\n\n head = new Uint8Array(performed.slice(leftLength));\n\n toEncrypt = toEncrypt.slice(leftLength2);\n\n this.counter = this.counter.add(1);\n }\n\n const tail = new Uint8Array(await this.perform(toEncrypt));\n\n const result = head ? head.concat(tail) : tail;\n\n let length = toEncrypt.length;\n const leftAfter = length % COUNTER_LENGTH;\n length -= leftAfter;\n\n const a = length / COUNTER_LENGTH;\n this.counter = this.counter.add(a);\n\n this.leftLength = leftAfter || undefined;\n // this.encLeft = leftAfter ? toEncrypt.slice(-leftAfter) : undefined;\n\n return result;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport CTR from './utils/aesCTR';\nimport subtle from './subtle';\n\nconst aesCTRs: Map = new Map();\nlet lastCTRId = -1;\n\ntype K = {\n enc: CTR,\n dec: CTR,\n};\n\nexport async function aesCtrPrepare({encKey, encIv, decKey, decIv}: {[k in 'encKey' | 'encIv' | 'decKey' | 'decIv']: Uint8Array}) {\n const id = ++lastCTRId;\n\n const a = [['encrypt', encKey], ['decrypt', decKey]] as ['encrypt' | 'decrypt', Uint8Array][];\n const promises = a.map(([mode, key]) => {\n return subtle.importKey(\n 'raw',\n key,\n {name: 'AES-CTR'},\n false,\n [mode]\n )\n });\n\n const [encCryptoKey, decCryptoKey] = await Promise.all(promises);\n const enc = new CTR('encrypt', encCryptoKey, encIv.slice());\n const dec = new CTR('decrypt', decCryptoKey, decIv.slice());\n\n const k: K = {\n enc,\n dec\n };\n\n aesCTRs.set(id, k);\n\n return id;\n}\n\nexport async function aesCtrProcess({id, data, operation}: {id: number, data: Uint8Array, operation: 'encrypt' | 'decrypt'}) {\n const ctrs = aesCTRs.get(id);\n const result = await (operation === 'encrypt' ? ctrs.enc : ctrs.dec).update(data);\n return result;\n}\n\nexport function aesCtrDestroy(id: number) {\n aesCTRs.delete(id);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport '../polyfill'; // just to include\n\nimport bytesModPow from '../../helpers/bytes/bytesModPow';\nimport gzipUncompress from '../../helpers/gzipUncompress';\nimport listenMessagePort from '../../helpers/listenMessagePort';\nimport getEmojisFingerprint from '../calls/helpers/getEmojisFingerprint';\nimport computeDhKey from './computeDhKey';\nimport cryptoMessagePort from './cryptoMessagePort';\nimport {CryptoMethods} from './crypto_methods';\nimport generateDh from './generateDh';\nimport computeSRP from './srp';\nimport {aesEncryptSync, aesDecryptSync} from './utils/aesIGE';\nimport factorizeBrentPollardPQ from './utils/factorize/BrentPollard';\nimport pbkdf2 from './utils/pbkdf2';\nimport rsaEncrypt from './utils/rsa';\nimport sha1 from './utils/sha1';\nimport sha256 from './utils/sha256';\nimport {aesCtrDestroy, aesCtrPrepare, aesCtrProcess} from './aesCtrUtils';\nimport ctx from '../../environment/ctx';\n\nconsole.log('CryptoWorker start');\n\nconst cryptoMethods: CryptoMethods = {\n 'sha1': sha1,\n 'sha256': sha256,\n 'pbkdf2': pbkdf2,\n 'aes-encrypt': aesEncryptSync,\n 'aes-decrypt': aesDecryptSync,\n 'rsa-encrypt': rsaEncrypt,\n 'factorize': factorizeBrentPollardPQ,\n // 'factorize-tdlib': factorizeTdlibPQ,\n // 'factorize-new-new': pqPrimeLeemonNew,\n 'mod-pow': bytesModPow,\n 'gzipUncompress': gzipUncompress,\n 'computeSRP': computeSRP,\n 'generate-dh': generateDh,\n 'compute-dh-key': computeDhKey,\n 'get-emojis-fingerprint': getEmojisFingerprint,\n 'aes-ctr-prepare': aesCtrPrepare,\n 'aes-ctr-process': aesCtrProcess,\n 'aes-ctr-destroy': aesCtrDestroy\n};\n\ncryptoMessagePort.addMultipleEventsListeners({\n invoke: ({method, args}) => {\n // @ts-ignore\n const result: any = cryptoMethods[method](...args);\n return result;\n },\n\n terminate: () => {\n ctx.close();\n }\n});\n\nif(typeof(MessageChannel) !== 'undefined') listenMessagePort(cryptoMessagePort, (source) => {\n const channel = new MessageChannel();\n cryptoMessagePort.attachPort(channel.port1);\n cryptoMessagePort.invokeVoid('port', undefined, source, [channel.port2]);\n});\n","import convertToUint8Array from '../../../helpers/bytes/convertToUint8Array';\nimport subtle from '../subtle';\n// import sha1 from '@cryptography/sha1';\n\nexport default function sha1(bytes: Parameters[0]) {\n return subtle.digest('SHA-1', convertToUint8Array(bytes)).then((b) => {\n return new Uint8Array(b);\n });\n /* //console.trace(dT(), 'SHA-1 hash start', bytes);\n\n const hashBytes: number[] = [];\n\n let hash = sha1(String.fromCharCode.apply(null,\n bytes instanceof Uint8Array ? [...bytes] : [...new Uint8Array(bytes)]));\n for(let i = 0; i < hash.length; ++i) {\n hashBytes.push(hash.charCodeAt(i));\n }\n\n //console.log(dT(), 'SHA-1 hash finish', hashBytes, bytesToHex(hashBytes));\n\n return new Uint8Array(hashBytes); */\n}\n","import convertToUint8Array from '../../../helpers/bytes/convertToUint8Array';\nimport subtle from '../subtle';\n// import sha256 from '@cryptography/sha256';\n\nexport default function sha256(bytes: Parameters[0]) {\n return subtle.digest('SHA-256', convertToUint8Array(bytes)).then((b) => {\n // console.log('legacy', performance.now() - perfS);\n return new Uint8Array(b);\n });\n /* //console.log('SHA-256 hash start');\n\n let perfS = performance.now();\n\n\n let perfD = performance.now();\n let words = typeof(bytes) === 'string' ? bytes : bytesToWordss(bytes as any);\n let hash = sha256(words);\n console.log('darutkin', performance.now() - perfD);\n\n //console.log('SHA-256 hash finish', hash, sha256(words, 'hex'));\n\n return bytesFromWordss(hash); */\n}\n","import subtle from '../subtle';\n\nexport default async function pbkdf2(buffer: Parameters[1], salt: HkdfParams['salt'], iterations: number) {\n const importKey = await subtle.importKey(\n 'raw',\n buffer,\n {name: 'PBKDF2'},\n false,\n [/* 'deriveKey', */'deriveBits']\n );\n\n /* await subtle.deriveKey(\n {\n name: 'PBKDF2',\n salt,\n iterations,\n hash: {name: 'SHA-512'}\n },\n importKey,\n {\n name: 'AES-CTR',\n length: 256\n },\n false,\n ['encrypt', 'decrypt']\n ); */\n\n const bits = subtle.deriveBits({\n name: 'PBKDF2',\n salt,\n iterations,\n hash: {name: 'SHA-512'}\n },\n importKey,\n 512\n );\n\n return bits.then((buffer) => new Uint8Array(buffer));\n}\n","import type {RSAPublicKeyHex} from '../../mtproto/rsaKeysManager';\nimport bytesModPow from '../../../helpers/bytes/bytesModPow';\nimport bytesFromHex from '../../../helpers/bytes/bytesFromHex';\n\nexport default function rsaEncrypt(bytes: Uint8Array, publicKey: RSAPublicKeyHex) {\n return bytesModPow(bytes, bytesFromHex(publicKey.exponent), bytesFromHex(publicKey.modulus));\n}\n","// export function gzipUncompress(bytes: ArrayBuffer, toString: true): string;\n\n// @ts-ignore\nimport pako from 'pako/dist/pako_inflate.min.js';\n// import dT from './dT';\n\n// export function gzipUncompress(bytes: ArrayBuffer, toString?: false): Uint8Array;\nexport default function gzipUncompress(bytes: ArrayBuffer, toString?: boolean): string | Uint8Array {\n // console.log(dT(), 'Gzip uncompress start');\n const result = pako.inflate(bytes, toString ? {to: 'string'} : undefined);\n // console.log(dT(), 'Gzip uncompress finish'/* , result */);\n return result;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cryptoWorker from './cryptoMessagePort';\nimport {AccountPassword, InputCheckPasswordSRP, PasswordKdfAlgo} from '../../layer';\nimport addPadding from '../../helpers/bytes/addPadding';\nimport bufferConcats from '../../helpers/bytes/bufferConcats';\nimport bytesXor from '../../helpers/bytes/bytesXor';\nimport convertToUint8Array from '../../helpers/bytes/convertToUint8Array';\nimport bigInt from 'big-integer';\nimport {bigIntFromBytes, bigIntToBytes} from '../../helpers/bigInt/bigIntConversion';\nimport bytesToHex from '../../helpers/bytes/bytesToHex';\n\nexport async function makePasswordHash(password: string, client_salt: Uint8Array, server_salt: Uint8Array) {\n // ! look into crypto_methods.test.ts\n let buffer = await cryptoWorker.invokeCrypto('sha256', bufferConcats(client_salt, new TextEncoder().encode(password), client_salt));\n buffer = bufferConcats(server_salt, buffer, server_salt);\n buffer = await cryptoWorker.invokeCrypto('sha256', buffer);\n\n let hash = await cryptoWorker.invokeCrypto('pbkdf2', new Uint8Array(buffer), client_salt, 100000);\n hash = bufferConcats(server_salt, hash, server_salt);\n\n buffer = await cryptoWorker.invokeCrypto('sha256', hash);\n\n return buffer;\n}\n\nexport default async function computeSRP(password: string, state: AccountPassword, isNew: boolean) {\n const algo = (isNew ? state.new_algo : state.current_algo) as PasswordKdfAlgo.passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow;\n\n const p = bigIntFromBytes(algo.p);\n const g = bigInt(algo.g);\n\n /* if(B.compareTo(BigInteger.ZERO) < 0) {\n console.error('srp_B < 0')\n }\n\n if(B.compareTo(p) <= 0) {\n console.error('srp_B <= p');\n } */\n\n /* let check_prime_and_good = (bytes: any, g: number) => {\n let good_prime = 'c71caeb9c6b1c9048e6c522f70f13f73980d40238e3e21c14934d037563d930f48198a0aa7c14058229493d22530f4dbfa336f6e0ac925139543aed44cce7c3720fd51f69458705ac68cd4fe6b6b13abdc9746512969328454f18faf8c595f642477fe96bb2a941d5bcd1d4ac8cc49880708fa9b378e3c4f3a9060bee67cf9a4a4a695811051907e162753b56b0f6b410dba74d8a84b2a14b3144e0ef1284754fd17ed950d5965b4b9dd46582db1178d169c6bc465b0d6ff9ca3928fef5b9ae4e418fc15e83ebea0f87fa9ff5eed70050ded2849f47bf959d956850ce929851f0d8115f635b105ee2e4e15d04b2454bf6f4fadf034b10403119cd8e3b92fcc5b';\n\n if(bytesToHex(bytes) === good_prime && [3, 4, 5, 7].indexOf(g) !== -1) {\n return true;\n }\n\n // TO-DO check_prime_and_good_check\n }; */\n\n // check_prime_and_good(algo.p, g);\n\n const pw_hash = await makePasswordHash(password, algo.salt1, algo.salt2);\n const x = bigInt(bytesToHex(pw_hash), 16);\n\n const padArray = function(arr: number[] | Uint8Array, len: number) {\n if(!(arr instanceof Uint8Array)) {\n arr = convertToUint8Array(arr);\n }\n\n return addPadding(arr, len, true, true, true);\n };\n\n const v = g.modPow(x, p);\n\n const flipper = (arr: Uint8Array | number[]) => {\n const out = new Uint8Array(arr.length);\n for(let i = 0; i < arr.length; i += 4) {\n out[i] = arr[i + 3];\n out[i + 1] = arr[i + 2];\n out[i + 2] = arr[i + 1];\n out[i + 3] = arr[i];\n }\n\n return out;\n };\n\n // * https://core.telegram.org/api/srp#setting-a-new-2fa-password\n if(isNew) {\n const bytes = bigIntToBytes(v);\n return padArray(/* (isBigEndian ? bytes.reverse() : bytes) */bytes, 256);\n }\n\n const B = bigIntFromBytes(state.srp_B);\n\n const pForHash = padArray(bigIntToBytes(p), 256);\n const gForHash = padArray(bigIntToBytes(g), 256);\n const b_for_hash = padArray(bigIntToBytes(B), 256);\n\n const kHash = await cryptoWorker.invokeCrypto('sha256', bufferConcats(pForHash, gForHash));\n const k = bigIntFromBytes(kHash);\n\n const k_v = k.multiply(v).mod(p);\n\n const is_good_mod_exp_first = (modexp: bigInt.BigInteger, prime: bigInt.BigInteger) => {\n const diff = prime.subtract(modexp);\n const min_diff_bits_count = 2048 - 64;\n const max_mod_exp_size = 256;\n if(diff.isNegative() ||\n diff.bitLength().toJSNumber() < min_diff_bits_count ||\n modexp.bitLength().toJSNumber() < min_diff_bits_count ||\n Math.floor((modexp.bitLength().toJSNumber() + 7) / 8) > max_mod_exp_size)\n return false;\n return true;\n };\n\n const generate_and_check_random = async() => {\n while(true) {\n const a = bigIntFromBytes(flipper(state.secure_random));\n // const a = str2bigInt('9153faef8f2bb6da91f6e5bc96bc00860a530a572a0f45aac0842b4602d711f8bda8d59fb53705e4ae3e31a3c4f0681955425f224297b8e9efd898fec22046debb7ba8a0bcf2be1ada7b100424ea318fdcef6ccfe6d7ab7d978c0eb76a807d4ab200eb767a22de0d828bc53f42c5a35c2df6e6ceeef9a3487aae8e9ef2271f2f6742e83b8211161fb1a0e037491ab2c2c73ad63c8bd1d739de1b523fe8d461270cedcf240de8da75f31be4933576532955041dc5770c18d3e75d0b357df9da4a5c8726d4fced87d15752400883dc57fa1937ac17608c5446c4774dcd123676d683ce3a1ab9f7e020ca52faafc99969822717c8e07ea383d5fb1a007ba0d170cb', 16);\n\n const A = g.modPow(a, p);\n if(is_good_mod_exp_first(A, p)) {\n const a_for_hash = bigIntToBytes(A);\n\n const s = await cryptoWorker.invokeCrypto('sha256', bufferConcats(a_for_hash, b_for_hash));\n // const u = bigInt(s.hex, 16);\n const u = bigIntFromBytes(s);\n if(!u.isZero() && !u.isNegative())\n return {a, a_for_hash, u};\n }\n }\n }\n\n const {a, a_for_hash, u} = await generate_and_check_random();\n\n let g_b: bigInt.BigInteger;\n if(!B.greater(k_v)) {\n g_b = B.add(p);\n } else g_b = B;\n g_b = g_b.subtract(k_v).mod(p);\n\n const ux = u.multiply(x);\n const a_ux = a.add(ux);\n const S = g_b.modPow(a_ux, p);\n\n const K = await cryptoWorker.invokeCrypto('sha256', padArray(bigIntToBytes(S), 256));\n\n let h1 = await cryptoWorker.invokeCrypto('sha256', pForHash);\n const h2 = await cryptoWorker.invokeCrypto('sha256', gForHash);\n h1 = bytesXor(h1, h2);\n\n const buff = bufferConcats(\n h1,\n await cryptoWorker.invokeCrypto('sha256', algo.salt1),\n await cryptoWorker.invokeCrypto('sha256', algo.salt2),\n a_for_hash,\n b_for_hash,\n K\n );\n\n const M1 = await cryptoWorker.invokeCrypto('sha256', buff);\n\n const out: InputCheckPasswordSRP.inputCheckPasswordSRP = {\n _: 'inputCheckPasswordSRP',\n srp_id: state.srp_id,\n A: new Uint8Array(a_for_hash),\n M1\n };\n\n return out;\n}\n","export default function bytesToHex(bytes: ArrayLike) {\n const length = bytes.length;\n const arr: string[] = new Array(length);\n for(let i = 0; i < length; ++i) {\n arr[i] = (bytes[i] < 16 ? '0' : '') + (bytes[i] || 0).toString(16);\n }\n return arr.join('');\n}\n","export default function bytesXor(bytes1: Uint8Array, bytes2: Uint8Array) {\n const len = bytes1.length;\n const bytes = new Uint8Array(len);\n\n for(let i = 0; i < len; ++i) {\n bytes[i] = bytes1[i] ^ bytes2[i];\n }\n\n return bytes;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type CallInstance from '../calls/callInstance';\nimport type {MessagesDhConfig} from '../../layer';\nimport bigInt from 'big-integer';\nimport randomize from '../../helpers/array/randomize';\nimport {bigIntFromBytes} from '../../helpers/bigInt/bigIntConversion';\nimport addPadding from '../../helpers/bytes/addPadding';\nimport bytesFromHex from '../../helpers/bytes/bytesFromHex';\nimport cryptoWorker from './cryptoMessagePort';\n\nexport default async function generateDh(dhConfig: MessagesDhConfig.messagesDhConfig) {\n const {p, g} = dhConfig;\n\n const generateA = (p: Uint8Array) => {\n for(;;) {\n const a = randomize(new Uint8Array(p.length));\n // const a = new Uint8Array(4).randomize();\n\n const aBigInt = bigIntFromBytes(a); // str2bigInt(bytesToHex(a), 16);\n if(!aBigInt.greater(bigInt.one)) {\n continue;\n }\n\n const pBigInt = bigIntFromBytes(p); // str2bigInt(bytesToHex(p), 16);\n if(!aBigInt.lesser(pBigInt.subtract(bigInt.one))) {\n continue;\n }\n\n return a;\n }\n };\n\n const a = generateA(p);\n // const a = new Uint8Array([0]);\n\n const gBytes = bytesFromHex(g.toString(16));\n const g_a = addPadding(await cryptoWorker.invokeCrypto('mod-pow', gBytes, a, p), 256, true, true, true);\n const g_a_hash = await cryptoWorker.invokeCrypto('sha256', g_a);\n\n const dh: CallInstance['dh'] = {\n a: a,\n g_a: g_a,\n g_a_hash: g_a_hash,\n p\n };\n\n return dh;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {bigIntFromBytes, bigIntToSigned} from '../../helpers/bigInt/bigIntConversion';\nimport cryptoWorker from './cryptoMessagePort';\n\nexport default async function computeDhKey(g_b: Uint8Array, a: Uint8Array, p: Uint8Array) {\n const key = await cryptoWorker.invokeCrypto('mod-pow', g_b, a, p);\n const keySha1Hashed = await cryptoWorker.invokeCrypto('sha1', key);\n const key_fingerprint = keySha1Hashed.slice(-8).reverse();\n const key_fingerprint_long = bigIntToSigned(bigIntFromBytes(key_fingerprint)).toString(10);\n\n return {key, key_fingerprint: key_fingerprint_long};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type SuperMessagePort from '../lib/mtproto/superMessagePort';\nimport ctx from '../environment/ctx';\n\nexport default function listenMessagePort(\n messagePort: SuperMessagePort,\n onConnect?: (source: MessageEventSource) => void,\n onDisconnect?: (source: MessageEventSource) => void\n) {\n const attachPort = (listenPort: any, sendPort: any) => {\n messagePort.attachListenPort(listenPort);\n sendPort && messagePort.attachSendPort(sendPort);\n onConnect?.(listenPort);\n };\n\n messagePort.setOnPortDisconnect(onDisconnect);\n\n if(typeof(SharedWorkerGlobalScope) !== 'undefined') {\n (ctx as any as SharedWorkerGlobalScope).addEventListener('connect', (e) => attachPort(e.source, e.source));\n } else if(typeof(ServiceWorkerGlobalScope) !== 'undefined') {\n attachPort(ctx, null);\n } else {\n attachPort(ctx, ctx);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport DEBUG from '../config/debug';\nimport {IS_FIREFOX, IS_SAFARI} from '../environment/userAgent';\nimport {IS_SERVICE_WORKER, IS_WEB_WORKER} from '../helpers/context';\nimport dT from '../helpers/dT';\n\nexport enum LogTypes {\n None = 0,\n Error = 1,\n Warn = 2,\n Log = 4,\n Debug = 8\n};\n\nexport const LOG_LEVELS = [LogTypes.None, LogTypes.Error, LogTypes.Warn, LogTypes.Log, LogTypes.Debug];\n\nconst IS_WEBKIT = IS_SAFARI || IS_FIREFOX;\n\n// let getCallerFunctionNameFromLine: (line: string) => string;\n// if(IS_WEBKIT) {\n// getCallerFunctionNameFromLine = (line) => {\n// const splitted = line.split('@');\n// return splitted[0];\n// };\n// } else {\n// getCallerFunctionNameFromLine = (line: string) => {\n// const splitted = line.trim().split(' ');\n// if(splitted.length === 3) {\n// return splitted[1].slice(splitted[1].lastIndexOf('.') + 1);\n// }\n// };\n// }\n\nconst STYLES_SUPPORTED = !IS_WEBKIT;\n// const LINE_INDEX = IS_WEBKIT ? 2 : 3;\n\n// function getCallerFunctionName() {\n// const stack = new Error().stack;\n// const lines = stack.split('\\n');\n// const line = lines[LINE_INDEX] || lines[lines.length - 1];\n// // const match = line.match(/\\.([^\\.]+?)\\s/);\n// // line = match ? match[1] : line.trim();\n// const caller = getCallerFunctionNameFromLine(line) || '';\n// return '[' + caller + ']';\n// }\n\nexport const LOGGER_STYLES = {\n reset: '\\x1b[0m',\n bright: '\\x1b[1m',\n dim: '\\x1b[2m',\n underscore: '\\x1b[4m',\n blink: '\\x1b[5m',\n reverse: '\\x1b[7m',\n hidden: '\\x1b[8m',\n // Foreground (text) colors\n fg: {\n black: '\\x1b[30m',\n red: '\\x1b[31m',\n green: '\\x1b[32m',\n yellow: '\\x1b[33m',\n blue: '\\x1b[34m',\n magenta: '\\x1b[35m',\n cyan: '\\x1b[36m',\n white: '\\x1b[37m'\n },\n // Background colors\n bg: {\n black: '\\x1b[40m',\n red: '\\x1b[41m',\n green: '\\x1b[42m',\n yellow: '\\x1b[43m',\n blue: '\\x1b[44m',\n magenta: '\\x1b[45m',\n cyan: '\\x1b[46m',\n white: '\\x1b[47m'\n }\n};\n\nexport type Logger = {\n (...args: any[]): void;\n warn(...args: any[]): void;\n info(...args: any[]): void;\n error(...args: any[]): void;\n trace(...args: any[]): void;\n debug(...args: any[]): void;\n assert(...args: any[]): void;\n // log(...args: any[]): void;\n group(...args: any[]): void;\n groupCollapsed(...args: any[]): void;\n groupEnd(...args: any[]): void;\n setPrefix(newPrefix: string): void;\n setLevel(level: 0 | 1 | 2 | 3 | 4): void;\n bindPrefix(prefix: string): Logger;\n};\n\nconst methods: ['debug' | 'info' | 'warn' | 'error' | 'assert' | 'trace'/* | 'log' */ | 'group' | 'groupCollapsed' | 'groupEnd', LogTypes][] = [\n ['debug', LogTypes.Debug],\n ['info', LogTypes.Log],\n ['warn', LogTypes.Warn],\n ['error', LogTypes.Error],\n ['assert', LogTypes.Error],\n ['trace', LogTypes.Log],\n ['group', LogTypes.Log],\n ['groupCollapsed', LogTypes.Log],\n ['groupEnd', LogTypes.Log]\n // [\"log\", LogTypes.Log]\n];\n\nexport function logger(prefix: string, type: LogTypes = LogTypes.Log | LogTypes.Warn | LogTypes.Error, ignoreDebugReset = false, style = ''): Logger {\n let originalPrefix: string;\n if(!DEBUG && !ignoreDebugReset/* || true */) {\n type = LogTypes.Error;\n }\n\n if(!STYLES_SUPPORTED) {\n style = '';\n } else if(!style) {\n if(IS_SERVICE_WORKER) style = LOGGER_STYLES.fg.yellow;\n else if(IS_WEB_WORKER) style = LOGGER_STYLES.fg.cyan;\n }\n\n const originalStyle = style;\n if(style) style = `%s ${style}%s`;\n else style = '%s';\n\n // level = LogLevels.log | LogLevels.warn | LogLevels.error | LogLevels.debug\n\n const log: Logger = function(...args: any[]) {\n return type & LogTypes.Log && console.log(style, dT(), prefix, /* getCallerFunctionName(), */ ...args);\n } as any;\n\n methods.forEach(([method, logType]) => {\n log[method] = function(...args: any[]) {\n return type & logType && console[method](style, dT(), prefix, /* getCallerFunctionName(), */ ...args);\n };\n });\n\n log.setPrefix = function(newPrefix: string) {\n originalPrefix = newPrefix;\n prefix = '[' + newPrefix + ']';\n };\n\n log.setPrefix(prefix);\n\n log.setLevel = function(level: 0 | 1 | 2 | 3 | 4) {\n type = LOG_LEVELS.slice(0, level + 1).reduce((acc, v) => acc | v, 0) as any;\n };\n\n log.bindPrefix = function(prefix: string) {\n return logger(`${originalPrefix}] [${prefix}`, type, ignoreDebugReset, originalStyle);\n };\n\n return log;\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [699,211,85], () => (__webpack_require__(6991)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames not based on template\n\tif (chunkId === 85) return \"85.887945ef5f43bc205112.bundle.js\";\n\t// return url for filenames based on template\n\treturn \"\" + {\"211\":\"npm.big-integer\",\"699\":\"npm.pako\"}[chunkId] + \".\" + {\"211\":\"363d763daad0ee4e2741\",\"699\":\"89deb457201f16c93925\"}[chunkId] + \".chunk.js\";\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","(() => {\n if (typeof __webpack_require__ !== 'undefined') {\n var oldGetScript = __webpack_require__.u;\n var oldLoadScript = __webpack_require__.e;\n var queryMap = {};\n var countMap = {};\n var getRetryDelay = function () {\n return 3000;\n };\n __webpack_require__.u = function (chunkId) {\n var result = oldGetScript(chunkId);\n return (\n result +\n (queryMap.hasOwnProperty(chunkId) ? '?' + queryMap[chunkId] : '')\n );\n };\n __webpack_require__.e = function (chunkId) {\n var result = oldLoadScript(chunkId);\n return result.catch(function (error) {\n var retries = countMap.hasOwnProperty(chunkId)\n ? countMap[chunkId]\n : 999999;\n if (retries < 1) {\n var realSrc = oldGetScript(chunkId);\n error.message =\n 'Loading chunk ' +\n chunkId +\n ' failed after 999999 retries.\\n(' +\n realSrc +\n ')';\n error.request = realSrc;\n throw error;\n }\n return new Promise(function (resolve) {\n var retryAttempt = 999999 - retries + 1;\n setTimeout(function () {\n var retryAttemptString = '&retry-attempt=' + retryAttempt;\n var cacheBust = (function () {\n return Date.now();\n })();\n +retryAttemptString;\n queryMap[chunkId] = cacheBust;\n countMap[chunkId] = retries - 1;\n resolve(__webpack_require__.e(chunkId));\n }, getRetryDelay(retryAttempt));\n });\n });\n };\n }\n})();\n","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t589: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = this[\"webpackChunktweb\"] = this[\"webpackChunktweb\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","next","DEBUG","MOUNT_CLASS_TO","window","self","USER_AGENT","navigator","userAgent","IS_SAFARI","search","toLowerCase","indexOf","test","vendor","platform","maxTouchPoints","match","IS_FIREFOX","undefined","IS_SERVICE_WORKER","ServiceWorkerGlobalScope","IS_WEB_WORKER","WorkerGlobalScope","IS_WORKER","postMessage","listener","args","err","console","error","notifyServiceWorker","all","clients","matchAll","includeUncontrolled","type","then","listeners","length","slice","forEach","bind","bufferConcats","reduce","acc","v","byteLength","tmp","Uint8Array","lastLength","b","set","ArrayBuffer","prototype","concat","this","toJSON","Promise","finally","fn","onFinally","callback","resolve","result","reason","reject","Number","MAX_SAFE_INTEGER","pow","longBigInt","divide","bigIntFromBytes","bytes","base","bigIntToBytes","bigInt","toArray","value","bytesModPow","exp","mod","bytesBigInt","expBigInt","modBigInt","modPow","CryptoMessagePort","constructor","super","lastIndex","invokeCryptoNew","method","transfer","payload","sendPortIndex","sendPorts","invoke","invokeCrypto","cryptoMessagePort","readBigIntFromBytesBE","bits","and","shiftLeft","i","_bits","or","emojis","randomize","arr","crypto","Error","getRandomValues","addPadding","blockSize","zeroes","blockSizeAsTotalLength","prepend","len","needPadding","padding","buffer","bytesFromHex","hexString","Math","ceil","start","parseInt","charAt","substr","convertToUint8Array","TextEncoder","encode","S","Si","T1","Uint32Array","T2","T3","T4","T5","T6","T7","T8","getWords","key","buf","pos","str","charCodeAt","xor","left","right","to","x2","x4","s","tEnc","tDec","d","t","x","xInv","computeTables","AES","_key","encKey","decKey","rcon","j","encrypt","_message","a2","b2","c2","message","out","a","c","rounds","k","decrypt","AES_IGE","iv","cipher","text","cipherText","prevX","subarray","prevY","yXOR","y","bytesToWordss","input","words","aesSync","keyBytes","ivBytes","o","bytesFromWordss","counter","offset","incrementCounter","carry","arrays","Uint16Array","bigIntRandom","min","max","array","nextRandomUint","BrentPollardFactor","n","two","remainder","isZero","m","ys","r","q","g","minus","eq","bigIntUint64MinusPqPlusOne","plus","performY","add","lesser","condition","multiply","greater","abs","subtle","CTR","mode","cryptoKey","queue","update","data","push","release","releasing","shift","_update","perform","name","head","toEncrypt","leftLength","leftLength2","performed","tail","leftAfter","aesCTRs","Map","lastCTRId","log","cryptoMethods","salt","iterations","importKey","hash","publicKey","exponent","modulus","pqBytes","factors","primes","factor","pop","isPrime","primeFactors","sort","compare","splice","p","map","toString","password","state","isNew","algo","new_algo","current_algo","pw_hash","client_salt","server_salt","makePasswordHash","salt1","salt2","Array","join","bytesToHex","padArray","flipper","B","srp_B","pForHash","gForHash","b_for_hash","k_v","is_good_mod_exp_first","modexp","prime","diff","subtract","isNegative","bitLength","toJSNumber","floor","a_for_hash","u","secure_random","A","generate_and_check_random","g_b","ux","a_ux","K","h1","bytes1","bytes2","bytesXor","buff","M1","_","srp_id","dhConfig","aBigInt","pBigInt","generateA","gBytes","g_a","g_a_hash","key_fingerprint","reverse","emojisLength","partOffset","index","codePoints","encIv","decIv","id","promises","encCryptoKey","decCryptoKey","enc","dec","operation","ctrs","get","delete","terminate","ctx","messagePort","onConnect","onDisconnect","attachPort","listenPort","sendPort","attachListenPort","attachSendPort","setOnPortDisconnect","listenMessagePort","e","source","channel","MessageChannel","port1","port2","LogTypes","LOG_LEVELS","None","Warn","Log","Debug","STYLES_SUPPORTED","LOGGER_STYLES","methods","logger","prefix","ignoreDebugReset","style","originalPrefix","originalStyle","logType","setPrefix","newPrefix","setLevel","level","bindPrefix","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","loaded","__webpack_modules__","call","__webpack_exports__","O","chunkIds","priority","notFulfilled","Infinity","fulfilled","Object","keys","every","getter","__esModule","definition","defineProperty","enumerable","f","chunkId","miniCssF","globalThis","Function","obj","prop","hasOwnProperty","nmd","paths","children","scriptUrl","importScripts","location","document","currentScript","src","scripts","getElementsByTagName","replace","oldGetScript","oldLoadScript","queryMap","countMap","catch","retries","realSrc","request","setTimeout","cacheBust","Date","now","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","moreModules","runtime"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"crypto.worker.c036d5d715f9894c08a3.chunk.js","mappings":"uBAAIA,ECAAC,E,4CCQG,MACMC,E,QAAoB,QAEpBC,EADuB,oBAAb,OAA2BC,OAASC,KAE3D,G,yECJO,MAAMC,EAAaC,UAAYA,UAAUC,UAAY,KAU/CC,GATWF,UAAUC,UAAUE,OAAO,yBACzBH,UAAUC,UAAUG,cAAcC,QAAQ,WACzC,SAASC,KAAKN,UAAUC,YAAc,aAAaK,KAAKN,UAAUO,SAG7D,mBAAmBD,KAAKN,UAAUQ,WACxC,aAAvBR,UAAUQ,UAA2BR,UAAUS,eAAiB,IAC/D,gBAEwB,oBAAuBV,KAAe,yBAAyBO,KAAKP,IAAkBA,EAAWW,MAAM,YAAcX,EAAWW,MAAM,aACrJC,EAAaX,UAAUC,UAAUG,cAAcC,QAAQ,YAAc,QAI3BO,IAA7BZ,UAAUS,gBAAgCT,UAAUS,eAAiB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W,KAAKpC,GkDD7DsY,EAAoBvO,G","sources":["webpack://tweb/webpack/runtime/chunk loaded","webpack://tweb/webpack/runtime/startup chunk dependencies","webpack://tweb/./src/config/debug.ts","webpack://tweb/./src/environment/userAgent.ts","webpack://tweb/./src/helpers/context.ts","webpack://tweb/./src/helpers/bytes/bufferConcats.ts","webpack://tweb/./src/lib/polyfill.ts","webpack://tweb/./src/helpers/bigInt/bigIntConstants.ts","webpack://tweb/./src/helpers/bigInt/bigIntConversion.ts","webpack://tweb/./src/helpers/bytes/bytesModPow.ts","webpack://tweb/./src/lib/crypto/cryptoMessagePort.ts","webpack://tweb/./src/lib/calls/helpers/getEmojisFingerprint.ts","webpack://tweb/./src/helpers/array/randomize.ts","webpack://tweb/./src/helpers/bytes/addPadding.ts","webpack://tweb/./src/helpers/bytes/bytesFromHex.ts","webpack://tweb/./src/helpers/bytes/convertToUint8Array.ts","webpack://tweb/./node_modules/@cryptography/aes/dist/es/aes.js","webpack://tweb/./src/helpers/bytes/bytesToWordss.ts","webpack://tweb/./src/lib/crypto/utils/aesIGE.ts","webpack://tweb/./src/helpers/bytes/bytesFromWordss.ts","webpack://tweb/./src/helpers/random.ts","webpack://tweb/./src/helpers/bigInt/bigIntRandom.ts","webpack://tweb/./src/lib/crypto/utils/factorize/BrentPollard.ts","webpack://tweb/./src/lib/crypto/subtle.ts","webpack://tweb/./src/lib/crypto/utils/aesCTR.ts","webpack://tweb/./src/lib/crypto/aesCtrUtils.ts","webpack://tweb/./src/lib/crypto/crypto.worker.ts","webpack://tweb/./src/lib/crypto/utils/sha1.ts","webpack://tweb/./src/lib/crypto/utils/sha256.ts","webpack://tweb/./src/lib/crypto/utils/pbkdf2.ts","webpack://tweb/./src/lib/crypto/utils/rsa.ts","webpack://tweb/./src/helpers/gzipUncompress.ts","webpack://tweb/./src/lib/crypto/srp.ts","webpack://tweb/./src/helpers/bytes/bytesToHex.ts","webpack://tweb/./src/helpers/bytes/bytesXor.ts","webpack://tweb/./src/lib/crypto/generateDh.ts","webpack://tweb/./src/lib/crypto/computeDhKey.ts","webpack://tweb/./src/helpers/listenMessagePort.ts","webpack://tweb/./src/lib/logger.ts","webpack://tweb/webpack/bootstrap","webpack://tweb/webpack/runtime/compat get default export","webpack://tweb/webpack/runtime/define property getters","webpack://tweb/webpack/runtime/ensure chunk","webpack://tweb/webpack/runtime/get javascript chunk filename","webpack://tweb/webpack/runtime/get mini-css chunk filename","webpack://tweb/webpack/runtime/global","webpack://tweb/webpack/runtime/hasOwnProperty shorthand","webpack://tweb/webpack/runtime/node module decorator","webpack://tweb/webpack/runtime/publicPath","webpack://tweb/webpack/runtime/compat","webpack://tweb/webpack/runtime/importScripts chunk loading","webpack://tweb/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn Promise.all([699,211,85].map(__webpack_require__.e, __webpack_require__)).then(next);\n};","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Modes from './modes';\n\nexport const IS_BETA = process.env.NODE_ENV !== 'production';\nexport const DEBUG = (IS_BETA || Modes.debug)/* && false */;\nconst ctx: any = typeof(window) !== 'undefined' ? window : self;\nexport const MOUNT_CLASS_TO: any = DEBUG || true/* && false */ ? ctx : {};\nexport default DEBUG;\n\n// let m = DEBUG;\n/* if(!DEBUG) {\n ctx.sandpitTurtle = () => {\n //if(!m) {\n for(let i in MOUNT_CLASS_TO) {\n ctx[i] = MOUNT_CLASS_TO[i];\n }\n //m = true;\n //}\n\n //DEBUG = !DEBUG;\n };\n} */\n\n/* export const superDebug = (object: any, key: string) => {\n var d = object[key];\n var beforeStr = '', afterStr = '';\n for(var r of d) {\n beforeStr += r.before.hex + '\\n';\n afterStr += r.after.hex + '\\n';\n }\n\n beforeStr = beforeStr.trim();\n afterStr = afterStr.trim();\n //var beforeStr = d.map((r) => r.before.hex).join('\\n');\n //var afterStr = d.map((r) => r.after.hex).join('\\n');\n\n var dada = (name: string, str: string) => {\n var a = document.createElement('a');\n a.target = '_blank';\n a.download = name + '.txt';\n a.href = URL.createObjectURL(new Blob([str], {\n type: 'text/plain'\n }));\n document.body.append(a);\n a.click();\n };\n\n dada(key + '_' + 'before', beforeStr);\n dada(key + '_' + 'after', afterStr);\n}\n\nMOUNT_CLASS_TO.superDebug = superDebug; */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ctx from './ctx';\n\nexport const USER_AGENT = navigator ? navigator.userAgent : null;\nexport const IS_APPLE = navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i) !== -1;\nexport const IS_ANDROID = navigator.userAgent.toLowerCase().indexOf('android') !== -1;\nexport const IS_CHROMIUM = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);\n\n// https://stackoverflow.com/a/58065241\nexport const IS_APPLE_MOBILE = (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&\n !(ctx as any).MSStream;\n\nexport const IS_SAFARI = !!('safari' in ctx) || !!(USER_AGENT && (/\\b(iPad|iPhone|iPod)\\b/.test(USER_AGENT) || (!!USER_AGENT.match('Safari') && !USER_AGENT.match('Chrome'))))/* || true */;\nexport const IS_FIREFOX = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n\nexport const IS_MOBILE_SAFARI = IS_SAFARI && IS_APPLE_MOBILE;\n\nexport const IS_MOBILE = (navigator.maxTouchPoints === undefined || navigator.maxTouchPoints > 0) && navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i) != -1;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// в SW может быть сразу две переменных TRUE\nexport const IS_SERVICE_WORKER = typeof ServiceWorkerGlobalScope !== 'undefined' && self instanceof ServiceWorkerGlobalScope;\nexport const IS_WEB_WORKER = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope && !IS_SERVICE_WORKER;\nexport const IS_WORKER = IS_WEB_WORKER || IS_SERVICE_WORKER;\n\nexport const getWindowClients = () => {\n return (self as any as ServiceWorkerGlobalScope)\n .clients\n .matchAll({includeUncontrolled: false, type: 'window'});\n};\n\nexport const getLastWindowClient = () => getWindowClients().then((windowClients) => windowClients.slice(-1)[0]);\n\nconst postMessage = (listener: WindowClient | DedicatedWorkerGlobalScope, ...args: any[]) => {\n try {\n // @ts-ignore\n listener.postMessage(...args);\n } catch(err) {\n console.error('[worker] postMessage error:', err, args);\n }\n};\n\nconst notifyServiceWorker = (all: boolean, ...args: any[]) => {\n getWindowClients().then((listeners) => {\n if(!listeners.length) {\n // console.trace('no listeners?', self, listeners);\n return;\n }\n\n listeners.slice(all ? 0 : -1).forEach((listener) => {\n postMessage(listener, ...args);\n });\n });\n};\n\nconst notifyWorker = (...args: any[]) => {\n postMessage(self as any as DedicatedWorkerGlobalScope, ...args);\n};\n\nconst noop = () => {};\n\nexport const notifySomeone = IS_SERVICE_WORKER ? notifyServiceWorker.bind(null, false) : (IS_WEB_WORKER ? notifyWorker : noop);\nexport const notifyAll = IS_SERVICE_WORKER ? notifyServiceWorker.bind(null, true) : (IS_WEB_WORKER ? notifyWorker : noop);\n","export default function bufferConcats(...args: (ArrayBuffer | Uint8Array | number[])[]) {\n const length = args.reduce((acc, v) => acc + ((v as ArrayBuffer).byteLength || (v as Uint8Array).length), 0);\n\n const tmp = new Uint8Array(length);\n\n let lastLength = 0;\n args.forEach((b) => {\n tmp.set(b instanceof ArrayBuffer ? new Uint8Array(b) : b, lastLength);\n lastLength += (b as ArrayBuffer).byteLength || (b as Uint8Array).length;\n });\n\n return tmp/* .buffer */;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport bufferConcats from '../helpers/bytes/bufferConcats';\n\nUint8Array.prototype.concat = function(...args: Array) {\n return bufferConcats(this, ...args);\n};\n\n/* Uint8Array.prototype.toString = function() {\n return String.fromCharCode.apply(null, [...this]);\n}; */\n\nUint8Array.prototype.toJSON = function() {\n return [...this];\n // return {type: 'bytes', value: [...this]};\n};\n\nPromise.prototype.finally = Promise.prototype.finally || function(this: Promise, fn: () => any) {\n const onFinally = (callback: typeof fn) => Promise.resolve(fn()).then(callback);\n return this.then(\n result => onFinally(() => result),\n reason => onFinally(() => Promise.reject(reason))\n );\n};\n\ndeclare global {\n interface Uint8Array {\n concat: (...args: Array) => Uint8Array,\n // toString: () => string,\n toJSON: () => number[],\n // toJSON: () => {type: 'bytes', value: number[]},\n }\n\n interface Promise {\n finally: (onfinally?: () => void) => Promise;\n }\n}\n","import bigInt from 'big-integer';\n\nexport const safeBigInt = bigInt(Number.MAX_SAFE_INTEGER);\nexport const ulongBigInt = bigInt(bigInt[2]).pow(64);\nexport const longBigInt = ulongBigInt.divide(bigInt[2]);\n","import bigInt from 'big-integer';\nimport { longBigInt, ulongBigInt } from './bigIntConstants';\n\nexport function bigIntFromBytes(bytes: Uint8Array | number[], base = 256) {\n return bigInt.fromArray(bytes instanceof Uint8Array ? [...bytes] : bytes, base);\n}\n\nexport function bigIntToBytes(bigInt: bigInt.BigInteger) {\n return new Uint8Array(bigInt.toArray(256).value);\n}\n\nexport function bigIntToSigned(bigInt: bigInt.BigInteger) {\n return bigInt.greater(longBigInt) ? bigInt.minus(ulongBigInt) : bigInt;\n}\n\nexport function bigIntToUnsigned(bigInt: bigInt.BigInteger) {\n return bigInt.isNegative() ? ulongBigInt.add(bigInt) : bigInt;\n}\n","import {bigIntFromBytes, bigIntToBytes} from '../bigInt/bigIntConversion';\n\nexport default function bytesModPow(bytes: number[] | Uint8Array, exp: number[] | Uint8Array, mod: number[] | Uint8Array) {\n const bytesBigInt = bigIntFromBytes(bytes);\n const expBigInt = bigIntFromBytes(exp);\n const modBigInt = bigIntFromBytes(mod);\n const resBigInt = bytesBigInt.modPow(expBigInt, modBigInt);\n return bigIntToBytes(resBigInt);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {CryptoMethods} from './crypto_methods';\nimport SuperMessagePort from '../mtproto/superMessagePort';\nimport {Awaited} from '../../types';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport {IS_WORKER} from '../../helpers/context';\n\ntype CryptoEvent = {\n invoke: (payload: {method: T, args: Parameters}) => ReturnType,\n port: (payload: void, source: MessageEventSource, event: MessageEvent) => void,\n terminate: () => void\n};\n\nexport class CryptoMessagePort extends SuperMessagePort {\n private lastIndex: number;\n\n constructor() {\n super('CRYPTO');\n this.lastIndex = -1;\n }\n\n public invokeCryptoNew({method, args, transfer}: {\n method: T,\n args: Parameters,\n transfer?: Transferable[]\n }): Promise>> {\n const payload = {method, args};\n const listeners = this.listeners['invoke'];\n if(listeners?.length) { // already in worker\n // try {\n // @ts-ignore\n let result: any = listeners[0].callback(payload);\n if(!IS_WORKER && !(result instanceof Promise)) {\n result = Promise.resolve(result);\n }\n\n return result;\n // } catch(err) {\n // return Promise.reject(err);\n // }\n }\n\n const sendPortIndex = method === 'aes-encrypt' || method === 'aes-decrypt' ?\n this.lastIndex = (this.lastIndex + 1) % this.sendPorts.length :\n 0;\n // @ts-ignore\n return this.invoke('invoke', payload, undefined, this.sendPorts[sendPortIndex], transfer);\n }\n\n public invokeCrypto(method: T, ...args: Parameters): Promise>> {\n return this.invokeCryptoNew({method, args});\n }\n}\n\nconst cryptoMessagePort = new CryptoMessagePort();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.cryptoMessagePort = cryptoMessagePort);\nexport default cryptoMessagePort;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cryptoWorker from '../../crypto/cryptoMessagePort';\nimport bigInt from 'big-integer';\n\nfunction readBigIntFromBytesBE(bytes: Uint8Array) {\n const length = bytes.length;\n const bits = length * 8;\n let value = bigInt(bytes[0]).and(0x7F).shiftLeft(bits - 8);\n for(let i = 1; i < length; ++i) {\n const _bits = bits - (i + 1) * 8;\n const b = bigInt(bytes[i]);\n value = value.or(_bits ? b.shiftLeft(_bits) : b);\n }\n\n return value;\n}\n\n// Emojis were taken from tdlib\nconst emojis = [\n '1f609', '1f60d', '1f61b', '1f62d', '1f631', '1f621', '1f60e',\n '1f634', '1f635', '1f608', '1f62c', '1f607', '1f60f', '1f46e',\n '1f477', '1f482', '1f476', '1f468', '1f469', '1f474', '1f475',\n '1f63b', '1f63d', '1f640', '1f47a', '1f648', '1f649', '1f64a',\n '1f480', '1f47d', '1f4a9', '1f525', '1f4a5', '1f4a4', '1f442',\n '1f440', '1f443', '1f445', '1f444', '1f44d', '1f44e', '1f44c',\n '1f44a', '270c', '270b', '1f450', '1f446', '1f447', '1f449',\n '1f448', '1f64f', '1f44f', '1f4aa', '1f6b6', '1f3c3', '1f483',\n '1f46b', '1f46a', '1f46c', '1f46d', '1f485', '1f3a9', '1f451',\n '1f452', '1f45f', '1f45e', '1f460', '1f455', '1f457', '1f456',\n '1f459', '1f45c', '1f453', '1f380', '1f484', '1f49b', '1f499',\n '1f49c', '1f49a', '1f48d', '1f48e', '1f436', '1f43a', '1f431',\n '1f42d', '1f439', '1f430', '1f438', '1f42f', '1f428', '1f43b',\n '1f437', '1f42e', '1f417', '1f434', '1f411', '1f418', '1f43c',\n '1f427', '1f425', '1f414', '1f40d', '1f422', '1f41b', '1f41d',\n '1f41c', '1f41e', '1f40c', '1f419', '1f41a', '1f41f', '1f42c',\n '1f40b', '1f410', '1f40a', '1f42b', '1f340', '1f339', '1f33b',\n '1f341', '1f33e', '1f344', '1f335', '1f334', '1f333', '1f31e',\n '1f31a', '1f319', '1f30e', '1f30b', '26a1', '2614', '2744', '26c4',\n '1f300', '1f308', '1f30a', '1f393', '1f386', '1f383', '1f47b',\n '1f385', '1f384', '1f381', '1f388', '1f52e', '1f3a5', '1f4f7',\n '1f4bf', '1f4bb', '260e', '1f4e1', '1f4fa', '1f4fb', '1f509',\n '1f514', '23f3', '23f0', '231a', '1f512', '1f511', '1f50e',\n '1f4a1', '1f526', '1f50c', '1f50b', '1f6bf', '1f6bd', '1f527',\n '1f528', '1f6aa', '1f6ac', '1f4a3', '1f52b', '1f52a', '1f48a',\n '1f489', '1f4b0', '1f4b5', '1f4b3', '2709', '1f4eb', '1f4e6',\n '1f4c5', '1f4c1', '2702', '1f4cc', '1f4ce', '2712', '270f',\n '1f4d0', '1f4da', '1f52c', '1f52d', '1f3a8', '1f3ac', '1f3a4',\n '1f3a7', '1f3b5', '1f3b9', '1f3bb', '1f3ba', '1f3b8', '1f47e',\n '1f3ae', '1f0cf', '1f3b2', '1f3af', '1f3c8', '1f3c0', '26bd',\n '26be', '1f3be', '1f3b1', '1f3c9', '1f3b3', '1f3c1', '1f3c7',\n '1f3c6', '1f3ca', '1f3c4', '2615', '1f37c', '1f37a', '1f377',\n '1f374', '1f355', '1f354', '1f35f', '1f357', '1f371', '1f35a',\n '1f35c', '1f361', '1f373', '1f35e', '1f369', '1f366', '1f382',\n '1f370', '1f36a', '1f36b', '1f36d', '1f36f', '1f34e', '1f34f',\n '1f34a', '1f34b', '1f352', '1f347', '1f349', '1f353', '1f351',\n '1f34c', '1f350', '1f34d', '1f346', '1f345', '1f33d', '1f3e1',\n '1f3e5', '1f3e6', '26ea', '1f3f0', '26fa', '1f3ed', '1f5fb',\n '1f5fd', '1f3a0', '1f3a1', '26f2', '1f3a2', '1f6a2', '1f6a4',\n '2693', '1f680', '2708', '1f681', '1f682', '1f68b', '1f68e',\n '1f68c', '1f699', '1f697', '1f695', '1f69b', '1f6a8', '1f694',\n '1f692', '1f691', '1f6b2', '1f6a0', '1f69c', '1f6a6', '26a0',\n '1f6a7', '26fd', '1f3b0', '1f5ff', '1f3aa', '1f3ad',\n '1f1ef-1f1f5', '1f1f0-1f1f7', '1f1e9-1f1ea', '1f1e8-1f1f3',\n '1f1fa-1f1f8', '1f1eb-1f1f7', '1f1ea-1f1f8', '1f1ee-1f1f9',\n '1f1f7-1f1fa', '1f1ec-1f1e7', '0031-20e3', '0032-20e3', '0033-20e3',\n '0034-20e3', '0035-20e3', '0036-20e3', '0037-20e3', '0038-20e3', '0039-20e3',\n '0030-20e3', '1f51f', '2757', '2753', '2665', '2666', '1f4af', '1f517',\n '1f531', '1f534', '1f535', '1f536', '1f537'\n];\n\nexport default async function getEmojisFingerprint(key: Uint8Array, g_a: Uint8Array) {\n const arr = key.concat(g_a);\n const hash = await cryptoWorker.invokeCrypto('sha256', arr);\n\n const result: [string, string, string, string] = [] as any;\n const emojisLength = emojis.length;\n\n const kPartSize = 8;\n for(let partOffset = 0; partOffset != hash.length; partOffset += kPartSize) {\n const bytes = hash.slice(partOffset, partOffset + kPartSize);\n const value = readBigIntFromBytesBE(bytes);\n const index = value.mod(emojisLength).toJSNumber();\n\n // const emoji = emojiFromCodePoints(emojis[index]);\n const codePoints = emojis[index];\n result.push(codePoints);\n }\n\n return result;\n}\n","export default function randomize(arr: T) {\n if(crypto && 'getRandomValues' in crypto) {\n crypto.getRandomValues(arr);\n } else {\n throw new Error('NO_SECURE_RANDOM');\n }\n\n return arr;\n}\n","import randomize from '../array/randomize';\nimport bufferConcats from './bufferConcats';\n\nexport default function addPadding(\n bytes: T,\n blockSize: number = 16,\n zeroes?: boolean,\n blockSizeAsTotalLength = false,\n prepend = false\n): T {\n const len = (bytes as ArrayBuffer).byteLength || (bytes as Uint8Array).length;\n const needPadding = blockSizeAsTotalLength ? blockSize - len : blockSize - (len % blockSize);\n if(needPadding > 0 && needPadding < blockSize) {\n // //console.log('addPadding()', len, blockSize, needPadding);\n const padding = new Uint8Array(needPadding);\n if(zeroes) {\n for(let i = 0; i < needPadding; ++i) {\n padding[i] = 0;\n }\n } else {\n randomize(padding);\n }\n\n if(bytes instanceof ArrayBuffer) {\n return (prepend ? bufferConcats(padding, bytes) : bufferConcats(bytes, padding)).buffer as T;\n } else if(bytes instanceof Uint8Array) {\n return (prepend ? bufferConcats(padding, bytes) : bufferConcats(bytes, padding)) as T;\n } else {\n // @ts-ignore\n return (prepend ? [...padding].concat(bytes) : bytes.concat([...padding])) as T;\n }\n }\n\n return bytes;\n}\n","export default function bytesFromHex(hexString: string) {\n const len = hexString.length;\n const bytes = new Uint8Array(Math.ceil(len / 2));\n let start = 0;\n\n if(len % 2) { // read 0x581 as 0x0581\n bytes[start++] = parseInt(hexString.charAt(0), 16);\n }\n\n for(let i = start; i < len; i += 2) {\n bytes[start++] = parseInt(hexString.substr(i, 2), 16);\n }\n\n return bytes;\n}\n","export default function convertToUint8Array(bytes: Uint8Array | ArrayBuffer | number[] | string): Uint8Array {\n if(bytes instanceof Uint8Array) {\n return bytes;\n } else if(typeof(bytes) === 'string') {\n return new TextEncoder().encode(bytes);\n }\n\n return new Uint8Array(bytes);\n}\n","var S = new Uint8Array(256);\nvar Si = new Uint8Array(256);\nvar T1 = new Uint32Array(256);\nvar T2 = new Uint32Array(256);\nvar T3 = new Uint32Array(256);\nvar T4 = new Uint32Array(256);\nvar T5 = new Uint32Array(256);\nvar T6 = new Uint32Array(256);\nvar T7 = new Uint32Array(256);\nvar T8 = new Uint32Array(256);\nfunction computeTables() {\n var d = new Uint8Array(256);\n var t = new Uint8Array(256);\n var x2;\n var x4;\n var x8;\n var s;\n var tEnc;\n var tDec;\n var x = 0;\n var xInv = 0;\n // Compute double and third tables\n for (var i = 0; i < 256; i++) {\n d[i] = i << 1 ^ (i >> 7) * 283;\n t[d[i] ^ i] = i;\n }\n for (; !S[x]; x ^= x2 || 1) {\n // Compute sbox\n s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n s = s >> 8 ^ s & 255 ^ 99;\n S[x] = s;\n Si[s] = x;\n // Compute MixColumns\n x8 = d[x4 = d[x2 = d[x]]];\n tDec = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n tEnc = d[s] * 0x101 ^ s * 0x1010100;\n T1[x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n T2[x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n T3[x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n T4[x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n T5[s] = tDec = tDec << 24 ^ tDec >>> 8;\n T6[s] = tDec = tDec << 24 ^ tDec >>> 8;\n T7[s] = tDec = tDec << 24 ^ tDec >>> 8;\n T8[s] = tDec = tDec << 24 ^ tDec >>> 8;\n xInv = t[xInv] || 1;\n }\n}\n\n/**\n * Gets a uint32 from string in big-endian order order\n */\nfunction s2i(str, pos) {\n return (str.charCodeAt(pos) << 24\n ^ str.charCodeAt(pos + 1) << 16\n ^ str.charCodeAt(pos + 2) << 8\n ^ str.charCodeAt(pos + 3));\n}\n\n/* eslint-disable import/prefer-default-export */\n/**\n * Helper function for transforming string key to Uint32Array\n */\nfunction getWords(key) {\n if (key instanceof Uint32Array) {\n return key;\n }\n if (typeof key === 'string') {\n if (key.length % 4 !== 0)\n for (var i = key.length % 4; i <= 4; i++)\n key += '\\0x00';\n var buf = new Uint32Array(key.length / 4);\n for (var i = 0; i < key.length; i += 4)\n buf[i / 4] = s2i(key, i);\n return buf;\n }\n if (key instanceof Uint8Array) {\n var buf = new Uint32Array(key.length / 4);\n for (var i = 0; i < key.length; i += 4) {\n buf[i / 4] = (key[i] << 24\n ^ key[i + 1] << 16\n ^ key[i + 2] << 8\n ^ key[i + 3]);\n }\n return buf;\n }\n throw new Error('Unable to create 32-bit words');\n}\nfunction xor(left, right, to) {\n if (to === void 0) { to = left; }\n for (var i = 0; i < left.length; i++)\n to[i] = left[i] ^ right[i];\n}\n\ncomputeTables();\n/**\n * Low-level AES Cipher\n */\nvar AES = /** @class */ (function () {\n function AES(_key) {\n var key = getWords(_key);\n if (key.length !== 4 && key.length !== 6 && key.length !== 8) {\n throw new Error('Invalid key size');\n }\n this.encKey = new Uint32Array(4 * key.length + 28);\n this.decKey = new Uint32Array(4 * key.length + 28);\n this.encKey.set(key);\n var rcon = 1;\n var i = key.length;\n var tmp;\n // schedule encryption keys\n for (; i < 4 * key.length + 28; i++) {\n tmp = this.encKey[i - 1];\n // apply sbox\n if (i % key.length === 0 || (key.length === 8 && i % key.length === 4)) {\n tmp = S[tmp >>> 24] << 24 ^ S[(tmp >> 16) & 255] << 16 ^ S[(tmp >> 8) & 255] << 8 ^ S[tmp & 255];\n // shift rows and add rcon\n if (i % key.length === 0) {\n tmp = tmp << 8 ^ tmp >>> 24 ^ (rcon << 24);\n rcon = rcon << 1 ^ (rcon >> 7) * 283;\n }\n }\n this.encKey[i] = this.encKey[i - key.length] ^ tmp;\n }\n // schedule decryption keys\n for (var j = 0; i; j++, i--) {\n tmp = this.encKey[j & 3 ? i : i - 4];\n if (i <= 4 || j < 4) {\n this.decKey[j] = tmp;\n }\n else {\n this.decKey[j] = (T5[S[tmp >>> 24]]\n ^ T6[S[(tmp >> 16) & 255]]\n ^ T7[S[(tmp >> 8) & 255]]\n ^ T8[S[tmp & 255]]);\n }\n }\n }\n AES.prototype.encrypt = function (_message) {\n var message = getWords(_message);\n var out = new Uint32Array(4);\n var a = message[0] ^ this.encKey[0];\n var b = message[1] ^ this.encKey[1];\n var c = message[2] ^ this.encKey[2];\n var d = message[3] ^ this.encKey[3];\n var rounds = this.encKey.length / 4 - 2;\n var k = 4;\n var a2;\n var b2;\n var c2;\n // Inner rounds. Cribbed from OpenSSL.\n for (var i = 0; i < rounds; i++) {\n a2 = T1[a >>> 24] ^ T2[(b >> 16) & 255] ^ T3[(c >> 8) & 255] ^ T4[d & 255] ^ this.encKey[k];\n b2 = T1[b >>> 24] ^ T2[(c >> 16) & 255] ^ T3[(d >> 8) & 255] ^ T4[a & 255] ^ this.encKey[k + 1];\n c2 = T1[c >>> 24] ^ T2[(d >> 16) & 255] ^ T3[(a >> 8) & 255] ^ T4[b & 255] ^ this.encKey[k + 2];\n d = T1[d >>> 24] ^ T2[(a >> 16) & 255] ^ T3[(b >> 8) & 255] ^ T4[c & 255] ^ this.encKey[k + 3];\n a = a2;\n b = b2;\n c = c2;\n k += 4;\n // console.log(a, b, c, d);\n }\n // Last round.\n for (var i = 0; i < 4; i++) {\n out[i] = (S[a >>> 24] << 24\n ^ S[(b >> 16) & 255] << 16\n ^ S[(c >> 8) & 255] << 8\n ^ S[d & 255]\n ^ this.encKey[k++]);\n a2 = a;\n a = b;\n b = c;\n c = d;\n d = a2;\n }\n return out;\n };\n AES.prototype.decrypt = function (_message) {\n var message = getWords(_message);\n var out = new Uint32Array(4);\n var a = message[0] ^ this.decKey[0];\n var b = message[3] ^ this.decKey[1];\n var c = message[2] ^ this.decKey[2];\n var d = message[1] ^ this.decKey[3];\n var rounds = this.decKey.length / 4 - 2;\n var a2;\n var b2;\n var c2;\n var k = 4;\n // Inner rounds. Cribbed from OpenSSL.\n for (var i = 0; i < rounds; i++) {\n a2 = T5[a >>> 24] ^ T6[(b >> 16) & 255] ^ T7[(c >> 8) & 255] ^ T8[d & 255] ^ this.decKey[k];\n b2 = T5[b >>> 24] ^ T6[(c >> 16) & 255] ^ T7[(d >> 8) & 255] ^ T8[a & 255] ^ this.decKey[k + 1];\n c2 = T5[c >>> 24] ^ T6[(d >> 16) & 255] ^ T7[(a >> 8) & 255] ^ T8[b & 255] ^ this.decKey[k + 2];\n d = T5[d >>> 24] ^ T6[(a >> 16) & 255] ^ T7[(b >> 8) & 255] ^ T8[c & 255] ^ this.decKey[k + 3];\n a = a2;\n b = b2;\n c = c2;\n k += 4;\n }\n // Last round.\n for (var i = 0; i < 4; i++) {\n out[3 & -i] = (Si[a >>> 24] << 24\n ^ Si[(b >> 16) & 255] << 16\n ^ Si[(c >> 8) & 255] << 8\n ^ Si[d & 255]\n ^ this.decKey[k++]);\n a2 = a;\n a = b;\n b = c;\n c = d;\n d = a2;\n }\n return out;\n };\n return AES;\n}());\n\n/**\n * AES-IGE mode.\n */\nvar AES_IGE = /** @class */ (function () {\n function AES_IGE(key, iv, blockSize) {\n if (blockSize === void 0) { blockSize = 16; }\n this.key = getWords(key);\n this.iv = getWords(iv);\n this.cipher = new AES(key);\n this.blockSize = blockSize / 4;\n }\n /**\n * Encrypts plain text with AES-IGE mode.\n */\n AES_IGE.prototype.encrypt = function (message, buf) {\n var text = getWords(message);\n var cipherText = buf || new Uint32Array(text.length);\n var prevX = this.iv.subarray(this.blockSize, this.iv.length);\n var prevY = this.iv.subarray(0, this.blockSize);\n var yXOR = new Uint32Array(this.blockSize);\n for (var i = 0; i < text.length; i += this.blockSize) {\n var x = text.subarray(i, i + this.blockSize);\n xor(x, prevY, yXOR);\n var y = this.cipher.encrypt(yXOR);\n xor(y, prevX);\n prevX = x;\n prevY = y;\n for (var j = i, k = 0; j < text.length && k < 4; j++, k++)\n cipherText[j] = y[k];\n }\n return cipherText;\n };\n /**\n * Decrypts cipher text with AES-IGE mode.\n */\n AES_IGE.prototype.decrypt = function (message, buf) {\n var cipherText = getWords(message);\n var text = buf || new Uint32Array(cipherText.length);\n var prevY = this.iv.subarray(this.blockSize, this.iv.length);\n var prevX = this.iv.subarray(0, this.blockSize);\n var yXOR = new Uint32Array(this.blockSize);\n for (var i = 0; i < text.length; i += this.blockSize) {\n var x = cipherText.subarray(i, i + this.blockSize);\n xor(x, prevY, yXOR);\n var y = this.cipher.decrypt(yXOR);\n xor(y, prevX);\n prevX = x;\n prevY = y;\n for (var j = i, k = 0; j < text.length && k < 4; j++, k++)\n text[j] = y[k];\n }\n return text;\n };\n return AES_IGE;\n}());\n\n/**\n * AES-IGE mode.\n */\nvar AES_IGE$1 = /** @class */ (function () {\n function AES_IGE(key, counter, blockSize) {\n if (blockSize === void 0) { blockSize = 16; }\n this.offset = 0;\n this.key = getWords(key);\n this.counter = getWords(counter);\n this.cipher = new AES(key);\n this.blockSize = blockSize / 4;\n if (this.counter.length !== 4) {\n throw new Error('AES-CTR mode counter must be 16 bytes length');\n }\n }\n /**\n * Encrypts plain text with AES-IGE mode.\n */\n AES_IGE.prototype.encrypt = function (message, buf) {\n var text = getWords(message);\n var cipherText = buf || new Uint32Array(text.length);\n var offset = this.offset;\n for (var i = 0; i < text.length; i += this.blockSize) {\n var x = this.cipher.encrypt(this.counter);\n for (var j = i, k = offset; j < text.length && k < this.blockSize; j++, k++)\n cipherText[j] = x[k] ^ text[j];\n if (text.length - i >= this.blockSize)\n this.incrementCounter();\n if (offset) {\n i -= offset;\n offset = 0;\n }\n }\n this.offset = (this.offset + (text.length % 4)) % 4;\n return cipherText;\n };\n /**\n * Decrypts cipher text with AES-IGE mode.\n */\n AES_IGE.prototype.decrypt = function (message, buf) {\n return this.encrypt(message, buf);\n };\n AES_IGE.prototype.incrementCounter = function () {\n // increment counter\n for (var carry = this.counter.length - 1; carry >= 0; carry--) {\n if (++this.counter[carry] < 0xFFFFFFFF)\n break; // If overflowing, it'll be 0 and we'll have to continue propagating the carry\n }\n };\n return AES_IGE;\n}());\n\nexport default AES;\nexport { AES_IGE$1 as CTR, AES_IGE as IGE };\n","import convertToUint8Array from './convertToUint8Array';\n\nexport default function bytesToWordss(input: Parameters[0]) {\n const bytes = convertToUint8Array(input);\n\n const words: number[] = [];\n for(let i = 0, len = bytes.length; i < len; ++i) {\n words[i >>> 2] |= bytes[i] << (24 - (i % 4) * 8);\n }\n\n return new Uint32Array(words);\n}\n","import {IGE} from '@cryptography/aes';\nimport addPadding from '../../../helpers/bytes/addPadding';\nimport bytesFromWordss from '../../../helpers/bytes/bytesFromWordss';\nimport bytesToWordss from '../../../helpers/bytes/bytesToWordss';\n\nexport default function aesSync(bytes: Uint8Array, keyBytes: Uint8Array, ivBytes: Uint8Array, encrypt = true) {\n // console.log(dT(), 'AES start', bytes, keyBytes, ivBytes);\n\n const cipher = new IGE(bytesToWordss(keyBytes), bytesToWordss(ivBytes));\n const performedBytes = cipher[encrypt ? 'encrypt' : 'decrypt'](bytesToWordss(bytes));\n // console.log(dT(), 'AES finish');\n\n return bytesFromWordss(performedBytes);\n}\n\nexport function aesEncryptSync(bytes: Uint8Array, keyBytes: Uint8Array, ivBytes: Uint8Array) {\n return aesSync(addPadding(bytes), keyBytes, ivBytes, true);\n}\n\nexport function aesDecryptSync(bytes: Uint8Array, keyBytes: Uint8Array, ivBytes: Uint8Array) {\n return aesSync(bytes, keyBytes, ivBytes, false);\n}\n","export default function bytesFromWordss(input: Uint32Array) {\n const o = new Uint8Array(input.byteLength);\n for(let i = 0, length = input.length * 4; i < length; ++i) {\n o[i] = ((input[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff);\n }\n\n return o;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nconst arrays = {\n 8: new Uint8Array(1),\n 16: new Uint16Array(1),\n 32: new Uint32Array(1)\n};\nexport function nextRandomUint(bits: 8 | 16 | 32) {\n const array = arrays[bits];\n crypto.getRandomValues(array);\n return array[0];\n}\n\nexport function randomLong() {\n return '' + nextRandomUint(32) + nextRandomUint(32) % 0xFFFFFF;\n}\n","import bigInt from 'big-integer';\nimport {nextRandomUint} from '../random';\n\nexport default function bigIntRandom(min: bigInt.BigNumber, max: bigInt.BigNumber) {\n return bigInt.randBetween(min, max, () => {\n return nextRandomUint(32) / 0xFFFFFFFF;\n /* const bits = 32;\n const randomBytes = new Uint8Array(bits / 8);\n crypto.getRandomValues(randomBytes);\n const r = bigIntFromBytes(randomBytes).mod(bigInt(2).pow(bits));\n return r.toJSNumber(); */\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// Thanks to https://xn--2-umb.com/09/12/brent-pollard-rho-factorisation/\n\nimport bigInt from 'big-integer';\nimport {bigIntFromBytes, bigIntToBytes} from '../../../../helpers/bigInt/bigIntConversion';\nimport bigIntRandom from '../../../../helpers/bigInt/bigIntRandom';\n\n// let test = 0;\nfunction BrentPollardFactor(n: bigInt.BigInteger) {\n const two = bigInt[2];\n if(n.remainder(two).isZero()) {\n return two;\n }\n\n const m = bigInt(1000);\n let a: bigInt.BigInteger,\n x: bigInt.BigInteger,\n y: bigInt.BigInteger,\n ys: bigInt.BigInteger,\n r: bigInt.BigInteger,\n q: bigInt.BigInteger,\n g: bigInt.BigInteger;\n do\n a = bigIntRandom(bigInt.one, n.minus(1));\n while(a.isZero() || a.eq(n.minus(two)));\n y = bigIntRandom(bigInt.one, n.minus(1));\n r = bigInt.one;\n q = bigInt.one;\n\n // if(!test++) {\n // a = bigInt(3);\n // y = bigInt(3);\n // }\n\n const bigIntUint64 = bigInt('FFFFFFFFFFFFFFFF', 16);\n const bigIntUint64MinusPqPlusOne = bigIntUint64.minus(n).plus(1);\n\n const performY = (y: bigInt.BigInteger) => {\n y = y.pow(two).mod(n);\n y = y.add(a);\n if(y.lesser(a)) { // it slows down the script\n y = y.add(bigIntUint64MinusPqPlusOne);\n }\n y = y.mod(n);\n return y;\n };\n\n do {\n x = y;\n for(let i = 0; bigInt(i).lesser(r); ++i) {\n y = performY(y);\n }\n\n let k = bigInt.zero;\n do {\n ys = y;\n const condition = bigInt.min(m, r.minus(k));\n for(let i = 0; bigInt(i).lesser(condition); ++i) {\n y = performY(y);\n q = q.multiply(x.greater(y) ? x.minus(y) : y.minus(x)).mod(n);\n }\n g = bigInt.gcd(q, n);\n k = k.add(m);\n } while(k.lesser(r) && g.eq(bigInt.one));\n\n r = r.shiftLeft(bigInt.one);\n } while(g.eq(bigInt.one));\n\n if(g.eq(n)) {\n do {\n ys = performY(ys);\n g = bigInt.gcd(x.minus(ys).abs(), n);\n } while(g.eq(bigInt.one));\n }\n\n return g;\n}\n\nfunction primeFactors(pqBytes: Uint8Array | number[]) {\n const n = bigIntFromBytes(pqBytes);\n\n const factors: bigInt.BigInteger[] = [];\n const primes: bigInt.BigInteger[] = [];\n\n let factor = BrentPollardFactor(n);\n factors.push(n.divide(factor));\n factors.push(factor);\n\n // return [factor];\n\n do {\n const m = factors.pop();\n\n if(m.eq(bigInt.one))\n continue;\n\n if(m.isPrime(true)) {\n primes.push(m);\n\n // Remove the prime from the other factors\n for(let i = 0; i < factors.length; ++i) {\n let k = factors[i];\n if(k.mod(m).isZero()) {\n do\n k = k.divide(m);\n while(k.mod(m).isZero());\n factors[i] = k;\n }\n }\n } else {\n // factor = m.lesser(100) ? bigInt(PollardRho(m.toJSNumber())) : this.brentPollardFactor(m);\n factor = BrentPollardFactor(m);\n factors.push(m.divide(factor));\n factors.push(factor);\n }\n } while(factors.length);\n\n return primes;\n}\n\nexport default function factorizeBrentPollardPQ(pqBytes: Uint8Array | number[]): [Uint8Array, Uint8Array] {\n let factors = primeFactors(pqBytes);\n factors.sort((a, b) => a.compare(b));\n if(factors.length > 2) {\n factors = [\n factors.splice(factors.length - 2, 1)[0],\n factors.reduce((acc, v) => acc.multiply(v), bigInt.one)\n ];\n }\n\n const p = factors[0], q = factors[factors.length - 1];\n return (p.lesser(q) ? [p, q] : [q, p]).map((b) => bigIntToBytes(b)) as any;\n}\n","const subtle = typeof(window) !== 'undefined' && 'crypto' in window ? window.crypto.subtle : self.crypto.subtle;\n\nexport default subtle;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {BigInteger} from 'big-integer';\nimport {bigIntFromBytes, bigIntToBytes} from '../../../helpers/bigInt/bigIntConversion';\nimport addPadding from '../../../helpers/bytes/addPadding';\nimport subtle from '../subtle';\n\nconst COUNTER_LENGTH = 16;\n\nexport default class CTR {\n private cryptoKey: CryptoKey;\n // private encLeft: Uint8Array;\n private leftLength: number;\n private mode: 'encrypt' | 'decrypt';\n private counter: BigInteger;\n private queue: {data: Uint8Array, resolve: (data: Uint8Array) => void}[];\n private releasing: boolean;\n\n constructor(mode: 'encrypt' | 'decrypt', cryptoKey: CryptoKey, counter: Uint8Array) {\n this.mode = mode;\n this.cryptoKey = cryptoKey;\n this.queue = [];\n this.counter = bigIntFromBytes(counter);\n }\n\n public async update(data: Uint8Array) {\n return new Promise((resolve) => {\n this.queue.push({data, resolve});\n this.release();\n });\n }\n\n private async release() {\n if(this.releasing) {\n return;\n }\n\n this.releasing = true;\n while(this.queue.length) {\n const {data, resolve} = this.queue.shift();\n resolve(await this._update(data));\n }\n this.releasing = false;\n }\n\n private async perform(data: Uint8Array) {\n const arrayBuffer: ArrayBuffer = await subtle[this.mode]({\n name: 'AES-CTR',\n counter: addPadding(bigIntToBytes(this.counter), COUNTER_LENGTH, true, true, true),\n length: 128\n },\n this.cryptoKey,\n data\n );\n\n return arrayBuffer;\n }\n\n private async _update(data: Uint8Array) {\n let toEncrypt = data;\n let head: Uint8Array/* , tail: Uint8Array */;\n if(this.leftLength) {\n // const leftLength = this.encLeft.byteLength;\n const leftLength = this.leftLength;\n const leftLength2 = COUNTER_LENGTH - leftLength;\n // const left = this.encLeft.concat(toEncrypt.slice(0, leftLength2));\n const left = (new Uint8Array(leftLength)).concat(toEncrypt.slice(0, leftLength2));\n\n const performed = await this.perform(left);\n\n head = new Uint8Array(performed.slice(leftLength));\n\n toEncrypt = toEncrypt.slice(leftLength2);\n\n this.counter = this.counter.add(1);\n }\n\n const tail = new Uint8Array(await this.perform(toEncrypt));\n\n const result = head ? head.concat(tail) : tail;\n\n let length = toEncrypt.length;\n const leftAfter = length % COUNTER_LENGTH;\n length -= leftAfter;\n\n const a = length / COUNTER_LENGTH;\n this.counter = this.counter.add(a);\n\n this.leftLength = leftAfter || undefined;\n // this.encLeft = leftAfter ? toEncrypt.slice(-leftAfter) : undefined;\n\n return result;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport CTR from './utils/aesCTR';\nimport subtle from './subtle';\n\nconst aesCTRs: Map = new Map();\nlet lastCTRId = -1;\n\ntype K = {\n enc: CTR,\n dec: CTR,\n};\n\nexport async function aesCtrPrepare({encKey, encIv, decKey, decIv}: {[k in 'encKey' | 'encIv' | 'decKey' | 'decIv']: Uint8Array}) {\n const id = ++lastCTRId;\n\n const a = [['encrypt', encKey], ['decrypt', decKey]] as ['encrypt' | 'decrypt', Uint8Array][];\n const promises = a.map(([mode, key]) => {\n return subtle.importKey(\n 'raw',\n key,\n {name: 'AES-CTR'},\n false,\n [mode]\n )\n });\n\n const [encCryptoKey, decCryptoKey] = await Promise.all(promises);\n const enc = new CTR('encrypt', encCryptoKey, encIv.slice());\n const dec = new CTR('decrypt', decCryptoKey, decIv.slice());\n\n const k: K = {\n enc,\n dec\n };\n\n aesCTRs.set(id, k);\n\n return id;\n}\n\nexport async function aesCtrProcess({id, data, operation}: {id: number, data: Uint8Array, operation: 'encrypt' | 'decrypt'}) {\n const ctrs = aesCTRs.get(id);\n const result = await (operation === 'encrypt' ? ctrs.enc : ctrs.dec).update(data);\n return result;\n}\n\nexport function aesCtrDestroy(id: number) {\n aesCTRs.delete(id);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport '../polyfill'; // just to include\n\nimport bytesModPow from '../../helpers/bytes/bytesModPow';\nimport gzipUncompress from '../../helpers/gzipUncompress';\nimport listenMessagePort from '../../helpers/listenMessagePort';\nimport getEmojisFingerprint from '../calls/helpers/getEmojisFingerprint';\nimport computeDhKey from './computeDhKey';\nimport cryptoMessagePort from './cryptoMessagePort';\nimport {CryptoMethods} from './crypto_methods';\nimport generateDh from './generateDh';\nimport computeSRP from './srp';\nimport {aesEncryptSync, aesDecryptSync} from './utils/aesIGE';\nimport factorizeBrentPollardPQ from './utils/factorize/BrentPollard';\nimport pbkdf2 from './utils/pbkdf2';\nimport rsaEncrypt from './utils/rsa';\nimport sha1 from './utils/sha1';\nimport sha256 from './utils/sha256';\nimport {aesCtrDestroy, aesCtrPrepare, aesCtrProcess} from './aesCtrUtils';\nimport ctx from '../../environment/ctx';\n\nconsole.log('CryptoWorker start');\n\nconst cryptoMethods: CryptoMethods = {\n 'sha1': sha1,\n 'sha256': sha256,\n 'pbkdf2': pbkdf2,\n 'aes-encrypt': aesEncryptSync,\n 'aes-decrypt': aesDecryptSync,\n 'rsa-encrypt': rsaEncrypt,\n 'factorize': factorizeBrentPollardPQ,\n // 'factorize-tdlib': factorizeTdlibPQ,\n // 'factorize-new-new': pqPrimeLeemonNew,\n 'mod-pow': bytesModPow,\n 'gzipUncompress': gzipUncompress,\n 'computeSRP': computeSRP,\n 'generate-dh': generateDh,\n 'compute-dh-key': computeDhKey,\n 'get-emojis-fingerprint': getEmojisFingerprint,\n 'aes-ctr-prepare': aesCtrPrepare,\n 'aes-ctr-process': aesCtrProcess,\n 'aes-ctr-destroy': aesCtrDestroy\n};\n\ncryptoMessagePort.addMultipleEventsListeners({\n invoke: ({method, args}) => {\n // @ts-ignore\n const result: any = cryptoMethods[method](...args);\n return result;\n },\n\n terminate: () => {\n ctx.close();\n }\n});\n\nif(typeof(MessageChannel) !== 'undefined') listenMessagePort(cryptoMessagePort, (source) => {\n const channel = new MessageChannel();\n cryptoMessagePort.attachPort(channel.port1);\n cryptoMessagePort.invokeVoid('port', undefined, source, [channel.port2]);\n});\n","import convertToUint8Array from '../../../helpers/bytes/convertToUint8Array';\nimport subtle from '../subtle';\n// import sha1 from '@cryptography/sha1';\n\nexport default function sha1(bytes: Parameters[0]) {\n return subtle.digest('SHA-1', convertToUint8Array(bytes)).then((b) => {\n return new Uint8Array(b);\n });\n /* //console.trace(dT(), 'SHA-1 hash start', bytes);\n\n const hashBytes: number[] = [];\n\n let hash = sha1(String.fromCharCode.apply(null,\n bytes instanceof Uint8Array ? [...bytes] : [...new Uint8Array(bytes)]));\n for(let i = 0; i < hash.length; ++i) {\n hashBytes.push(hash.charCodeAt(i));\n }\n\n //console.log(dT(), 'SHA-1 hash finish', hashBytes, bytesToHex(hashBytes));\n\n return new Uint8Array(hashBytes); */\n}\n","import convertToUint8Array from '../../../helpers/bytes/convertToUint8Array';\nimport subtle from '../subtle';\n// import sha256 from '@cryptography/sha256';\n\nexport default function sha256(bytes: Parameters[0]) {\n return subtle.digest('SHA-256', convertToUint8Array(bytes)).then((b) => {\n // console.log('legacy', performance.now() - perfS);\n return new Uint8Array(b);\n });\n /* //console.log('SHA-256 hash start');\n\n let perfS = performance.now();\n\n\n let perfD = performance.now();\n let words = typeof(bytes) === 'string' ? bytes : bytesToWordss(bytes as any);\n let hash = sha256(words);\n console.log('darutkin', performance.now() - perfD);\n\n //console.log('SHA-256 hash finish', hash, sha256(words, 'hex'));\n\n return bytesFromWordss(hash); */\n}\n","import subtle from '../subtle';\n\nexport default async function pbkdf2(buffer: Parameters[1], salt: HkdfParams['salt'], iterations: number) {\n const importKey = await subtle.importKey(\n 'raw',\n buffer,\n {name: 'PBKDF2'},\n false,\n [/* 'deriveKey', */'deriveBits']\n );\n\n /* await subtle.deriveKey(\n {\n name: 'PBKDF2',\n salt,\n iterations,\n hash: {name: 'SHA-512'}\n },\n importKey,\n {\n name: 'AES-CTR',\n length: 256\n },\n false,\n ['encrypt', 'decrypt']\n ); */\n\n const bits = subtle.deriveBits({\n name: 'PBKDF2',\n salt,\n iterations,\n hash: {name: 'SHA-512'}\n },\n importKey,\n 512\n );\n\n return bits.then((buffer) => new Uint8Array(buffer));\n}\n","import type {RSAPublicKeyHex} from '../../mtproto/rsaKeysManager';\nimport bytesModPow from '../../../helpers/bytes/bytesModPow';\nimport bytesFromHex from '../../../helpers/bytes/bytesFromHex';\n\nexport default function rsaEncrypt(bytes: Uint8Array, publicKey: RSAPublicKeyHex) {\n return bytesModPow(bytes, bytesFromHex(publicKey.exponent), bytesFromHex(publicKey.modulus));\n}\n","// export function gzipUncompress(bytes: ArrayBuffer, toString: true): string;\n\n// @ts-ignore\nimport pako from 'pako/dist/pako_inflate.min.js';\n// import dT from './dT';\n\n// export function gzipUncompress(bytes: ArrayBuffer, toString?: false): Uint8Array;\nexport default function gzipUncompress(bytes: ArrayBuffer, toString?: boolean): string | Uint8Array {\n // console.log(dT(), 'Gzip uncompress start');\n const result = pako.inflate(bytes, toString ? {to: 'string'} : undefined);\n // console.log(dT(), 'Gzip uncompress finish'/* , result */);\n return result;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport cryptoWorker from './cryptoMessagePort';\nimport {AccountPassword, InputCheckPasswordSRP, PasswordKdfAlgo} from '../../layer';\nimport addPadding from '../../helpers/bytes/addPadding';\nimport bufferConcats from '../../helpers/bytes/bufferConcats';\nimport bytesXor from '../../helpers/bytes/bytesXor';\nimport convertToUint8Array from '../../helpers/bytes/convertToUint8Array';\nimport bigInt from 'big-integer';\nimport {bigIntFromBytes, bigIntToBytes} from '../../helpers/bigInt/bigIntConversion';\nimport bytesToHex from '../../helpers/bytes/bytesToHex';\n\nexport async function makePasswordHash(password: string, client_salt: Uint8Array, server_salt: Uint8Array) {\n // ! look into crypto_methods.test.ts\n let buffer = await cryptoWorker.invokeCrypto('sha256', bufferConcats(client_salt, new TextEncoder().encode(password), client_salt));\n buffer = bufferConcats(server_salt, buffer, server_salt);\n buffer = await cryptoWorker.invokeCrypto('sha256', buffer);\n\n let hash = await cryptoWorker.invokeCrypto('pbkdf2', new Uint8Array(buffer), client_salt, 100000);\n hash = bufferConcats(server_salt, hash, server_salt);\n\n buffer = await cryptoWorker.invokeCrypto('sha256', hash);\n\n return buffer;\n}\n\nexport default async function computeSRP(password: string, state: AccountPassword, isNew: boolean) {\n const algo = (isNew ? state.new_algo : state.current_algo) as PasswordKdfAlgo.passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow;\n\n const p = bigIntFromBytes(algo.p);\n const g = bigInt(algo.g);\n\n /* if(B.compareTo(BigInteger.ZERO) < 0) {\n console.error('srp_B < 0')\n }\n\n if(B.compareTo(p) <= 0) {\n console.error('srp_B <= p');\n } */\n\n /* let check_prime_and_good = (bytes: any, g: number) => {\n let good_prime = 'c71caeb9c6b1c9048e6c522f70f13f73980d40238e3e21c14934d037563d930f48198a0aa7c14058229493d22530f4dbfa336f6e0ac925139543aed44cce7c3720fd51f69458705ac68cd4fe6b6b13abdc9746512969328454f18faf8c595f642477fe96bb2a941d5bcd1d4ac8cc49880708fa9b378e3c4f3a9060bee67cf9a4a4a695811051907e162753b56b0f6b410dba74d8a84b2a14b3144e0ef1284754fd17ed950d5965b4b9dd46582db1178d169c6bc465b0d6ff9ca3928fef5b9ae4e418fc15e83ebea0f87fa9ff5eed70050ded2849f47bf959d956850ce929851f0d8115f635b105ee2e4e15d04b2454bf6f4fadf034b10403119cd8e3b92fcc5b';\n\n if(bytesToHex(bytes) === good_prime && [3, 4, 5, 7].indexOf(g) !== -1) {\n return true;\n }\n\n // TO-DO check_prime_and_good_check\n }; */\n\n // check_prime_and_good(algo.p, g);\n\n const pw_hash = await makePasswordHash(password, algo.salt1, algo.salt2);\n const x = bigInt(bytesToHex(pw_hash), 16);\n\n const padArray = function(arr: number[] | Uint8Array, len: number) {\n if(!(arr instanceof Uint8Array)) {\n arr = convertToUint8Array(arr);\n }\n\n return addPadding(arr, len, true, true, true);\n };\n\n const v = g.modPow(x, p);\n\n const flipper = (arr: Uint8Array | number[]) => {\n const out = new Uint8Array(arr.length);\n for(let i = 0; i < arr.length; i += 4) {\n out[i] = arr[i + 3];\n out[i + 1] = arr[i + 2];\n out[i + 2] = arr[i + 1];\n out[i + 3] = arr[i];\n }\n\n return out;\n };\n\n // * https://core.telegram.org/api/srp#setting-a-new-2fa-password\n if(isNew) {\n const bytes = bigIntToBytes(v);\n return padArray(/* (isBigEndian ? bytes.reverse() : bytes) */bytes, 256);\n }\n\n const B = bigIntFromBytes(state.srp_B);\n\n const pForHash = padArray(bigIntToBytes(p), 256);\n const gForHash = padArray(bigIntToBytes(g), 256);\n const b_for_hash = padArray(bigIntToBytes(B), 256);\n\n const kHash = await cryptoWorker.invokeCrypto('sha256', bufferConcats(pForHash, gForHash));\n const k = bigIntFromBytes(kHash);\n\n const k_v = k.multiply(v).mod(p);\n\n const is_good_mod_exp_first = (modexp: bigInt.BigInteger, prime: bigInt.BigInteger) => {\n const diff = prime.subtract(modexp);\n const min_diff_bits_count = 2048 - 64;\n const max_mod_exp_size = 256;\n if(diff.isNegative() ||\n diff.bitLength().toJSNumber() < min_diff_bits_count ||\n modexp.bitLength().toJSNumber() < min_diff_bits_count ||\n Math.floor((modexp.bitLength().toJSNumber() + 7) / 8) > max_mod_exp_size)\n return false;\n return true;\n };\n\n const generate_and_check_random = async() => {\n while(true) {\n const a = bigIntFromBytes(flipper(state.secure_random));\n // const a = str2bigInt('9153faef8f2bb6da91f6e5bc96bc00860a530a572a0f45aac0842b4602d711f8bda8d59fb53705e4ae3e31a3c4f0681955425f224297b8e9efd898fec22046debb7ba8a0bcf2be1ada7b100424ea318fdcef6ccfe6d7ab7d978c0eb76a807d4ab200eb767a22de0d828bc53f42c5a35c2df6e6ceeef9a3487aae8e9ef2271f2f6742e83b8211161fb1a0e037491ab2c2c73ad63c8bd1d739de1b523fe8d461270cedcf240de8da75f31be4933576532955041dc5770c18d3e75d0b357df9da4a5c8726d4fced87d15752400883dc57fa1937ac17608c5446c4774dcd123676d683ce3a1ab9f7e020ca52faafc99969822717c8e07ea383d5fb1a007ba0d170cb', 16);\n\n const A = g.modPow(a, p);\n if(is_good_mod_exp_first(A, p)) {\n const a_for_hash = bigIntToBytes(A);\n\n const s = await cryptoWorker.invokeCrypto('sha256', bufferConcats(a_for_hash, b_for_hash));\n // const u = bigInt(s.hex, 16);\n const u = bigIntFromBytes(s);\n if(!u.isZero() && !u.isNegative())\n return {a, a_for_hash, u};\n }\n }\n }\n\n const {a, a_for_hash, u} = await generate_and_check_random();\n\n let g_b: bigInt.BigInteger;\n if(!B.greater(k_v)) {\n g_b = B.add(p);\n } else g_b = B;\n g_b = g_b.subtract(k_v).mod(p);\n\n const ux = u.multiply(x);\n const a_ux = a.add(ux);\n const S = g_b.modPow(a_ux, p);\n\n const K = await cryptoWorker.invokeCrypto('sha256', padArray(bigIntToBytes(S), 256));\n\n let h1 = await cryptoWorker.invokeCrypto('sha256', pForHash);\n const h2 = await cryptoWorker.invokeCrypto('sha256', gForHash);\n h1 = bytesXor(h1, h2);\n\n const buff = bufferConcats(\n h1,\n await cryptoWorker.invokeCrypto('sha256', algo.salt1),\n await cryptoWorker.invokeCrypto('sha256', algo.salt2),\n a_for_hash,\n b_for_hash,\n K\n );\n\n const M1 = await cryptoWorker.invokeCrypto('sha256', buff);\n\n const out: InputCheckPasswordSRP.inputCheckPasswordSRP = {\n _: 'inputCheckPasswordSRP',\n srp_id: state.srp_id,\n A: new Uint8Array(a_for_hash),\n M1\n };\n\n return out;\n}\n","export default function bytesToHex(bytes: ArrayLike) {\n const length = bytes.length;\n const arr: string[] = new Array(length);\n for(let i = 0; i < length; ++i) {\n arr[i] = (bytes[i] < 16 ? '0' : '') + (bytes[i] || 0).toString(16);\n }\n return arr.join('');\n}\n","export default function bytesXor(bytes1: Uint8Array, bytes2: Uint8Array) {\n const len = bytes1.length;\n const bytes = new Uint8Array(len);\n\n for(let i = 0; i < len; ++i) {\n bytes[i] = bytes1[i] ^ bytes2[i];\n }\n\n return bytes;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type CallInstance from '../calls/callInstance';\nimport type {MessagesDhConfig} from '../../layer';\nimport bigInt from 'big-integer';\nimport randomize from '../../helpers/array/randomize';\nimport {bigIntFromBytes} from '../../helpers/bigInt/bigIntConversion';\nimport addPadding from '../../helpers/bytes/addPadding';\nimport bytesFromHex from '../../helpers/bytes/bytesFromHex';\nimport cryptoWorker from './cryptoMessagePort';\n\nexport default async function generateDh(dhConfig: MessagesDhConfig.messagesDhConfig) {\n const {p, g} = dhConfig;\n\n const generateA = (p: Uint8Array) => {\n for(;;) {\n const a = randomize(new Uint8Array(p.length));\n // const a = new Uint8Array(4).randomize();\n\n const aBigInt = bigIntFromBytes(a); // str2bigInt(bytesToHex(a), 16);\n if(!aBigInt.greater(bigInt.one)) {\n continue;\n }\n\n const pBigInt = bigIntFromBytes(p); // str2bigInt(bytesToHex(p), 16);\n if(!aBigInt.lesser(pBigInt.subtract(bigInt.one))) {\n continue;\n }\n\n return a;\n }\n };\n\n const a = generateA(p);\n // const a = new Uint8Array([0]);\n\n const gBytes = bytesFromHex(g.toString(16));\n const g_a = addPadding(await cryptoWorker.invokeCrypto('mod-pow', gBytes, a, p), 256, true, true, true);\n const g_a_hash = await cryptoWorker.invokeCrypto('sha256', g_a);\n\n const dh: CallInstance['dh'] = {\n a: a,\n g_a: g_a,\n g_a_hash: g_a_hash,\n p\n };\n\n return dh;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {bigIntFromBytes, bigIntToSigned} from '../../helpers/bigInt/bigIntConversion';\nimport cryptoWorker from './cryptoMessagePort';\n\nexport default async function computeDhKey(g_b: Uint8Array, a: Uint8Array, p: Uint8Array) {\n const key = await cryptoWorker.invokeCrypto('mod-pow', g_b, a, p);\n const keySha1Hashed = await cryptoWorker.invokeCrypto('sha1', key);\n const key_fingerprint = keySha1Hashed.slice(-8).reverse();\n const key_fingerprint_long = bigIntToSigned(bigIntFromBytes(key_fingerprint)).toString(10);\n\n return {key, key_fingerprint: key_fingerprint_long};\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type SuperMessagePort from '../lib/mtproto/superMessagePort';\nimport ctx from '../environment/ctx';\n\nexport default function listenMessagePort(\n messagePort: SuperMessagePort,\n onConnect?: (source: MessageEventSource) => void,\n onDisconnect?: (source: MessageEventSource) => void\n) {\n const attachPort = (listenPort: any, sendPort: any) => {\n messagePort.attachListenPort(listenPort);\n sendPort && messagePort.attachSendPort(sendPort);\n onConnect?.(listenPort);\n };\n\n messagePort.setOnPortDisconnect(onDisconnect);\n\n if(typeof(SharedWorkerGlobalScope) !== 'undefined') {\n (ctx as any as SharedWorkerGlobalScope).addEventListener('connect', (e) => attachPort(e.source, e.source));\n } else if(typeof(ServiceWorkerGlobalScope) !== 'undefined') {\n attachPort(ctx, null);\n } else {\n attachPort(ctx, ctx);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport DEBUG from '../config/debug';\nimport {IS_FIREFOX, IS_SAFARI} from '../environment/userAgent';\nimport {IS_SERVICE_WORKER, IS_WEB_WORKER} from '../helpers/context';\nimport dT from '../helpers/dT';\n\nexport enum LogTypes {\n None = 0,\n Error = 1,\n Warn = 2,\n Log = 4,\n Debug = 8\n};\n\nexport const LOG_LEVELS = [LogTypes.None, LogTypes.Error, LogTypes.Warn, LogTypes.Log, LogTypes.Debug];\n\nconst IS_WEBKIT = IS_SAFARI || IS_FIREFOX;\n\n// let getCallerFunctionNameFromLine: (line: string) => string;\n// if(IS_WEBKIT) {\n// getCallerFunctionNameFromLine = (line) => {\n// const splitted = line.split('@');\n// return splitted[0];\n// };\n// } else {\n// getCallerFunctionNameFromLine = (line: string) => {\n// const splitted = line.trim().split(' ');\n// if(splitted.length === 3) {\n// return splitted[1].slice(splitted[1].lastIndexOf('.') + 1);\n// }\n// };\n// }\n\nconst STYLES_SUPPORTED = !IS_WEBKIT;\n// const LINE_INDEX = IS_WEBKIT ? 2 : 3;\n\n// function getCallerFunctionName() {\n// const stack = new Error().stack;\n// const lines = stack.split('\\n');\n// const line = lines[LINE_INDEX] || lines[lines.length - 1];\n// // const match = line.match(/\\.([^\\.]+?)\\s/);\n// // line = match ? match[1] : line.trim();\n// const caller = getCallerFunctionNameFromLine(line) || '';\n// return '[' + caller + ']';\n// }\n\nexport const LOGGER_STYLES = {\n reset: '\\x1b[0m',\n bright: '\\x1b[1m',\n dim: '\\x1b[2m',\n underscore: '\\x1b[4m',\n blink: '\\x1b[5m',\n reverse: '\\x1b[7m',\n hidden: '\\x1b[8m',\n // Foreground (text) colors\n fg: {\n black: '\\x1b[30m',\n red: '\\x1b[31m',\n green: '\\x1b[32m',\n yellow: '\\x1b[33m',\n blue: '\\x1b[34m',\n magenta: '\\x1b[35m',\n cyan: '\\x1b[36m',\n white: '\\x1b[37m'\n },\n // Background colors\n bg: {\n black: '\\x1b[40m',\n red: '\\x1b[41m',\n green: '\\x1b[42m',\n yellow: '\\x1b[43m',\n blue: '\\x1b[44m',\n magenta: '\\x1b[45m',\n cyan: '\\x1b[46m',\n white: '\\x1b[47m'\n }\n};\n\nexport type Logger = {\n (...args: any[]): void;\n warn(...args: any[]): void;\n info(...args: any[]): void;\n error(...args: any[]): void;\n trace(...args: any[]): void;\n debug(...args: any[]): void;\n assert(...args: any[]): void;\n // log(...args: any[]): void;\n group(...args: any[]): void;\n groupCollapsed(...args: any[]): void;\n groupEnd(...args: any[]): void;\n setPrefix(newPrefix: string): void;\n setLevel(level: 0 | 1 | 2 | 3 | 4): void;\n bindPrefix(prefix: string): Logger;\n};\n\nconst methods: ['debug' | 'info' | 'warn' | 'error' | 'assert' | 'trace'/* | 'log' */ | 'group' | 'groupCollapsed' | 'groupEnd', LogTypes][] = [\n ['debug', LogTypes.Debug],\n ['info', LogTypes.Log],\n ['warn', LogTypes.Warn],\n ['error', LogTypes.Error],\n ['assert', LogTypes.Error],\n ['trace', LogTypes.Log],\n ['group', LogTypes.Log],\n ['groupCollapsed', LogTypes.Log],\n ['groupEnd', LogTypes.Log]\n // [\"log\", LogTypes.Log]\n];\n\nexport function logger(prefix: string, type: LogTypes = LogTypes.Log | LogTypes.Warn | LogTypes.Error, ignoreDebugReset = false, style = ''): Logger {\n let originalPrefix: string;\n if(!DEBUG && !ignoreDebugReset/* || true */) {\n type = LogTypes.Error;\n }\n\n if(!STYLES_SUPPORTED) {\n style = '';\n } else if(!style) {\n if(IS_SERVICE_WORKER) style = LOGGER_STYLES.fg.yellow;\n else if(IS_WEB_WORKER) style = LOGGER_STYLES.fg.cyan;\n }\n\n const originalStyle = style;\n if(style) style = `%s ${style}%s`;\n else style = '%s';\n\n // level = LogLevels.log | LogLevels.warn | LogLevels.error | LogLevels.debug\n\n const log: Logger = function(...args: any[]) {\n return type & LogTypes.Log && console.log(style, dT(), prefix, /* getCallerFunctionName(), */ ...args);\n } as any;\n\n methods.forEach(([method, logType]) => {\n log[method] = function(...args: any[]) {\n return type & logType && console[method](style, dT(), prefix, /* getCallerFunctionName(), */ ...args);\n };\n });\n\n log.setPrefix = function(newPrefix: string) {\n originalPrefix = newPrefix;\n prefix = '[' + newPrefix + ']';\n };\n\n log.setPrefix(prefix);\n\n log.setLevel = function(level: 0 | 1 | 2 | 3 | 4) {\n type = LOG_LEVELS.slice(0, level + 1).reduce((acc, v) => acc | v, 0) as any;\n };\n\n log.bindPrefix = function(prefix: string) {\n return logger(`${originalPrefix}] [${prefix}`, type, ignoreDebugReset, originalStyle);\n };\n\n return log;\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [699,211,85], () => (__webpack_require__(6991)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames not based on template\n\tif (chunkId === 85) return \"85.887945ef5f43bc205112.bundle.js\";\n\t// return url for filenames based on template\n\treturn \"\" + {\"211\":\"npm.big-integer\",\"699\":\"npm.pako\"}[chunkId] + \".\" + {\"211\":\"363d763daad0ee4e2741\",\"699\":\"89deb457201f16c93925\"}[chunkId] + \".chunk.js\";\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","(() => {\n if (typeof __webpack_require__ !== 'undefined') {\n var oldGetScript = __webpack_require__.u;\n var oldLoadScript = __webpack_require__.e;\n var queryMap = {};\n var countMap = {};\n var getRetryDelay = function () {\n return 3000;\n };\n __webpack_require__.u = function (chunkId) {\n var result = oldGetScript(chunkId);\n return (\n result +\n (queryMap.hasOwnProperty(chunkId) ? '?' + queryMap[chunkId] : '')\n );\n };\n __webpack_require__.e = function (chunkId) {\n var result = oldLoadScript(chunkId);\n return result.catch(function (error) {\n var retries = countMap.hasOwnProperty(chunkId)\n ? countMap[chunkId]\n : 999999;\n if (retries < 1) {\n var realSrc = oldGetScript(chunkId);\n error.message =\n 'Loading chunk ' +\n chunkId +\n ' failed after 999999 retries.\\n(' +\n realSrc +\n ')';\n error.request = realSrc;\n throw error;\n }\n return new Promise(function (resolve) {\n var retryAttempt = 999999 - retries + 1;\n setTimeout(function () {\n var retryAttemptString = '&retry-attempt=' + retryAttempt;\n var cacheBust = (function () {\n return Date.now();\n })();\n +retryAttemptString;\n queryMap[chunkId] = cacheBust;\n countMap[chunkId] = retries - 1;\n resolve(__webpack_require__.e(chunkId));\n }, getRetryDelay(retryAttempt));\n });\n });\n };\n }\n})();\n","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t589: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = this[\"webpackChunktweb\"] = this[\"webpackChunktweb\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","next","DEBUG","MOUNT_CLASS_TO","window","self","USER_AGENT","navigator","userAgent","IS_SAFARI","search","toLowerCase","indexOf","test","vendor","platform","maxTouchPoints","match","IS_FIREFOX","undefined","IS_SERVICE_WORKER","ServiceWorkerGlobalScope","IS_WEB_WORKER","WorkerGlobalScope","IS_WORKER","postMessage","listener","args","err","console","error","notifyServiceWorker","all","clients","matchAll","includeUncontrolled","type","then","listeners","length","slice","forEach","bind","bufferConcats","reduce","acc","v","byteLength","tmp","Uint8Array","lastLength","b","set","ArrayBuffer","prototype","concat","this","toJSON","Promise","finally","fn","onFinally","callback","resolve","result","reason","reject","Number","MAX_SAFE_INTEGER","pow","longBigInt","divide","bigIntFromBytes","bytes","base","bigIntToBytes","bigInt","toArray","value","bytesModPow","exp","mod","bytesBigInt","expBigInt","modBigInt","modPow","CryptoMessagePort","constructor","super","lastIndex","invokeCryptoNew","method","transfer","payload","sendPortIndex","sendPorts","invoke","invokeCrypto","cryptoMessagePort","readBigIntFromBytesBE","bits","and","shiftLeft","i","_bits","or","emojis","randomize","arr","crypto","Error","getRandomValues","addPadding","blockSize","zeroes","blockSizeAsTotalLength","prepend","len","needPadding","padding","buffer","bytesFromHex","hexString","Math","ceil","start","parseInt","charAt","substr","convertToUint8Array","TextEncoder","encode","S","Si","T1","Uint32Array","T2","T3","T4","T5","T6","T7","T8","getWords","key","buf","pos","str","charCodeAt","xor","left","right","to","x2","x4","s","tEnc","tDec","d","t","x","xInv","computeTables","AES","_key","encKey","decKey","rcon","j","encrypt","_message","a2","b2","c2","message","out","a","c","rounds","k","decrypt","AES_IGE","iv","cipher","text","cipherText","prevX","subarray","prevY","yXOR","y","bytesToWordss","input","words","aesSync","keyBytes","ivBytes","o","bytesFromWordss","counter","offset","incrementCounter","carry","arrays","Uint16Array","bigIntRandom","min","max","array","nextRandomUint","BrentPollardFactor","n","two","remainder","isZero","m","ys","r","q","g","minus","eq","bigIntUint64MinusPqPlusOne","plus","performY","add","lesser","condition","multiply","greater","abs","subtle","CTR","mode","cryptoKey","queue","update","data","push","release","releasing","shift","_update","perform","name","head","toEncrypt","leftLength","leftLength2","performed","tail","leftAfter","aesCTRs","Map","lastCTRId","log","cryptoMethods","salt","iterations","importKey","hash","publicKey","exponent","modulus","pqBytes","factors","primes","factor","pop","isPrime","primeFactors","sort","compare","splice","p","map","toString","password","state","isNew","algo","new_algo","current_algo","pw_hash","client_salt","server_salt","makePasswordHash","salt1","salt2","Array","join","bytesToHex","padArray","flipper","B","srp_B","pForHash","gForHash","b_for_hash","k_v","is_good_mod_exp_first","modexp","prime","diff","subtract","isNegative","bitLength","toJSNumber","floor","a_for_hash","u","secure_random","A","generate_and_check_random","g_b","ux","a_ux","K","h1","bytes1","bytes2","bytesXor","buff","M1","_","srp_id","dhConfig","aBigInt","pBigInt","generateA","gBytes","g_a","g_a_hash","key_fingerprint","reverse","emojisLength","partOffset","index","codePoints","encIv","decIv","id","promises","encCryptoKey","decCryptoKey","enc","dec","operation","ctrs","get","delete","terminate","ctx","messagePort","onConnect","onDisconnect","attachPort","listenPort","sendPort","attachListenPort","attachSendPort","setOnPortDisconnect","listenMessagePort","e","source","channel","MessageChannel","port1","port2","LogTypes","LOG_LEVELS","None","Warn","Log","Debug","STYLES_SUPPORTED","LOGGER_STYLES","methods","logger","prefix","ignoreDebugReset","style","originalPrefix","originalStyle","logType","setPrefix","newPrefix","setLevel","level","bindPrefix","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","loaded","__webpack_modules__","call","__webpack_exports__","O","chunkIds","priority","notFulfilled","Infinity","fulfilled","Object","keys","every","getter","__esModule","definition","defineProperty","enumerable","f","chunkId","miniCssF","globalThis","Function","obj","prop","hasOwnProperty","nmd","paths","children","scriptUrl","importScripts","location","document","currentScript","src","scripts","getElementsByTagName","replace","oldGetScript","oldLoadScript","queryMap","countMap","catch","retries","realSrc","request","setTimeout","cacheBust","Date","now","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","moreModules","runtime"],"sourceRoot":""} \ No newline at end of file diff --git a/public/index.html b/public/index.html index a1db4de2..b02491c7 100644 --- a/public/index.html +++ b/public/index.html @@ -1,3 +1,3 @@ -Telegram Web \ No newline at end of file + \ No newline at end of file diff --git a/public/main.228ad639cd68cb5735ce.bundle.js.map b/public/main.228ad639cd68cb5735ce.bundle.js.map deleted file mode 100644 index 2964c3ee..00000000 --- a/public/main.228ad639cd68cb5735ce.bundle.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.228ad639cd68cb5735ce.bundle.js","mappings":"uBAAIA,ECCAC,EADAC,ECAAC,EACAC,E,mECOG,MAAMC,GAAU,EACVC,EAASD,GAAW,UAEpBE,EADuB,oBAAb,OAA2BC,OAASC,KAE3D,G,0ECMA,MAAMC,EAAgB,YAChBC,EAAQ,UAqHDC,EAAuB,CAClCC,EAAG,QACHC,YAAa,GACbC,GAAI,GACJC,SAAU,CAAC,CACTH,EAAG,gBACHI,OAAQ,CAAC,EACTC,WAAY,CAACL,EAAG,oBAChBM,aAAc,QACdC,eAAgB,CAAC,SACjBC,UAAW,CACTR,EAAG,YACHI,OAAQ,CACNK,SAAS,EACTC,SAAS,GAEXT,YAAa,GACbU,cAAUC,EACVV,GAAI,GACJW,KA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W,EAE5B,OAAO3B,EAAoBQ,EAAEtd,EAAO,EAGjCkhB,EAAqB3vB,KAAuB,iBAAIA,KAAuB,kBAAK,GAChF2vB,EAAmBzuB,QAAQouB,EAAqBlB,KAAK,KAAM,IAC3DuB,EAAmBz4B,KAAOo4B,EAAqBlB,KAAK,KAAMuB,EAAmBz4B,KAAKk3B,KAAKuB,G,KClFvF,IAAIC,EAAsBrE,EAAoBQ,OAAEp/B,EAAW,CAAC,GAAG,MAAM,IAAO4+B,EAAoB,QAChGqE,EAAsBrE,EAAoBQ,EAAE6D,E","sources":["webpack://tweb/webpack/runtime/chunk loaded","webpack://tweb/webpack/runtime/create fake namespace object","webpack://tweb/webpack/runtime/load script","webpack://tweb/./src/config/debug.ts","webpack://tweb/./src/config/state.ts","webpack://tweb/./src/helpers/getTimeFormat.ts","webpack://tweb/./src/environment/appleMx.ts","webpack://tweb/./src/environment/callSupport.ts","webpack://tweb/./src/environment/canUseTransferables.ts","webpack://tweb/./src/environment/canvasFilterSupport.ts","webpack://tweb/./src/environment/emojiSupport.ts","webpack://tweb/./src/environment/geolocationSupport.ts","webpack://tweb/./src/environment/groupCallSupport.ts","webpack://tweb/./src/environment/imageMimeTypesSupport.ts","webpack://tweb/./src/environment/mediaMimeTypesSupport.ts","webpack://tweb/./src/environment/movSupport.ts","webpack://tweb/./src/environment/opusSupport.ts","webpack://tweb/./src/environment/parallaxSupport.ts","webpack://tweb/./src/environment/screenSharingSupport.ts","webpack://tweb/./src/environment/sharedWorkerSupport.ts","webpack://tweb/./src/environment/touchSupport.ts","webpack://tweb/./src/environment/userAgent.ts","webpack://tweb/./src/environment/vibrateSupport.ts","webpack://tweb/./src/environment/videoMimeTypesSupport.ts","webpack://tweb/./src/environment/webmSupport.ts","webpack://tweb/./src/environment/webpSupport.ts","webpack://tweb/./src/environment/webrtcSupport.ts","webpack://tweb/./src/helpers/color.ts","webpack://tweb/./src/helpers/compareVersion.ts","webpack://tweb/./src/helpers/dom/blurActiveElement.ts","webpack://tweb/./src/helpers/dom/cancelEvent.ts","webpack://tweb/./src/helpers/dom/findUpClassName.ts","webpack://tweb/./src/helpers/dom/fixSafariStickyInput.ts","webpack://tweb/./src/helpers/dom/fixSafariStickyInputFocusing.ts","webpack://tweb/./src/helpers/dom/installPrompt.ts","webpack://tweb/./src/helpers/dom/loadFonts.ts","webpack://tweb/./src/helpers/dom/setInnerHTML.ts","webpack://tweb/./src/helpers/idleController.ts","webpack://tweb/./src/helpers/number/clamp.ts","webpack://tweb/./src/helpers/overlayCounter.ts","webpack://tweb/./src/helpers/schedulers.ts","webpack://tweb/./src/helpers/string/parseUriParams.ts","webpack://tweb/./src/helpers/themeController.ts","webpack://tweb/./src/helpers/setWorkerProxy.ts","webpack://tweb/./src/environment/installPrompt.ts","webpack://tweb/./src/index.ts","webpack://tweb/./src/helpers/dom/toggleAttributePolyfill.ts","webpack://tweb/./src/lib/appManagers/appRuntimeManager.ts","webpack://tweb/./src/lib/appManagers/getProxiedManagers.ts","webpack://tweb/./src/lib/files/idb.ts","webpack://tweb/./src/lib/langPack.ts","webpack://tweb/./src/lib/mtproto/mtproto_config.ts","webpack://tweb/./src/environment/index.ts","webpack://tweb/./src/lib/appManagers/utils/state/loadState.ts","webpack://tweb/./src/lib/mtproto/mtprotoworker.ts","webpack://tweb/./src/lib/mtproto/singleInstance.ts","webpack://tweb/./src/lib/mtproto/telegramMeWebManager.ts","webpack://tweb/./src/helpers/dom/loadScript.ts","webpack://tweb/./src/lib/mtproto/webPushApiManager.ts","webpack://tweb/./src/lib/opusDecodeController.ts","webpack://tweb/./src/lib/richTextProcessor/index.ts","webpack://tweb/./src/lib/richTextProcessor/wrapUrl.ts","webpack://tweb/./src/lib/rootScope.ts","webpack://tweb/./src/lib/webp/webpWorkerController.ts","webpack://tweb/webpack/bootstrap","webpack://tweb/webpack/runtime/compat get default export","webpack://tweb/webpack/runtime/define property getters","webpack://tweb/webpack/runtime/ensure chunk","webpack://tweb/webpack/runtime/get javascript chunk filename","webpack://tweb/webpack/runtime/get mini-css chunk filename","webpack://tweb/webpack/runtime/global","webpack://tweb/webpack/runtime/hasOwnProperty shorthand","webpack://tweb/webpack/runtime/make namespace object","webpack://tweb/webpack/runtime/publicPath","webpack://tweb/webpack/runtime/compat","webpack://tweb/webpack/runtime/jsonp chunk loading","webpack://tweb/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"tweb:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t};\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Modes from './modes';\n\nexport const IS_BETA = process.env.NODE_ENV !== 'production';\nexport const DEBUG = (IS_BETA || Modes.debug)/* && false */;\nconst ctx: any = typeof(window) !== 'undefined' ? window : self;\nexport const MOUNT_CLASS_TO: any = DEBUG || true/* && false */ ? ctx : {};\nexport default DEBUG;\n\n// let m = DEBUG;\n/* if(!DEBUG) {\n ctx.sandpitTurtle = () => {\n //if(!m) {\n for(let i in MOUNT_CLASS_TO) {\n ctx[i] = MOUNT_CLASS_TO[i];\n }\n //m = true;\n //}\n\n //DEBUG = !DEBUG;\n };\n} */\n\n/* export const superDebug = (object: any, key: string) => {\n var d = object[key];\n var beforeStr = '', afterStr = '';\n for(var r of d) {\n beforeStr += r.before.hex + '\\n';\n afterStr += r.after.hex + '\\n';\n }\n\n beforeStr = beforeStr.trim();\n afterStr = afterStr.trim();\n //var beforeStr = d.map((r) => r.before.hex).join('\\n');\n //var afterStr = d.map((r) => r.after.hex).join('\\n');\n\n var dada = (name: string, str: string) => {\n var a = document.createElement('a');\n a.target = '_blank';\n a.download = name + '.txt';\n a.href = URL.createObjectURL(new Blob([str], {\n type: 'text/plain'\n }));\n document.body.append(a);\n a.click();\n };\n\n dada(key + '_' + 'before', beforeStr);\n dada(key + '_' + 'after', afterStr);\n}\n\nMOUNT_CLASS_TO.superDebug = superDebug; */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {LiteModeKey} from '../helpers/liteMode';\nimport type {AppMediaPlaybackController} from '../components/appMediaPlaybackController';\nimport type {TopPeerType, MyTopPeer} from '../lib/appManagers/appUsersManager';\nimport type {AutoDownloadSettings, BaseTheme, NotifyPeer, PeerNotifySettings, Theme, ThemeSettings, WallPaper} from '../layer';\nimport type DialogsStorage from '../lib/storages/dialogs';\nimport type FiltersStorage from '../lib/storages/filters';\nimport type {AuthState, Modify} from '../types';\nimport {IS_MOBILE} from '../environment/userAgent';\nimport getTimeFormat from '../helpers/getTimeFormat';\nimport {nextRandomUint} from '../helpers/random';\nimport App from './app';\n\nconst STATE_VERSION = App.version;\nconst BUILD = App.build;\n\n// ! DEPRECATED\nexport type Background = {\n type?: 'color' | 'image' | 'default', // ! DEPRECATED\n blur: boolean,\n highlightningColor?: string,\n color?: string,\n slug?: string, // image slug\n intensity?: number, // pattern intensity\n id: string | number, // wallpaper id\n};\n\nexport type AppTheme = Modify\n}>;\n\nexport type AutoDownloadPeerTypeSettings = {\n contacts: boolean,\n private: boolean,\n groups: boolean,\n channels: boolean\n};\n\nexport type State = {\n allDialogsLoaded: DialogsStorage['allDialogsLoaded'],\n pinnedOrders: DialogsStorage['pinnedOrders'],\n // contactsList: UserId[],\n contactsListCachedTime: number,\n updates: Partial<{\n seq: number,\n pts: number,\n date: number\n }>,\n // filters?: FiltersStorage['filters'], // ! DEPRECATED\n filtersArr?: FiltersStorage['filtersArr'],\n maxSeenMsgId: number,\n stateCreatedTime: number,\n recentEmoji: string[],\n recentCustomEmoji: DocId[],\n topPeersCache: {\n [type in TopPeerType]?: {\n peers: MyTopPeer[],\n cachedTime: number\n }\n },\n recentSearch: PeerId[],\n version: typeof STATE_VERSION,\n build: typeof BUILD,\n authState: AuthState,\n hiddenPinnedMessages: {[peerId: PeerId]: number},\n settings: {\n messagesTextSize: number,\n distanceUnit: 'kilometers' | 'miles',\n sendShortcut: 'enter' | 'ctrlEnter',\n animationsEnabled?: boolean, // ! DEPRECATED\n autoDownload: {\n contacts?: boolean, // ! DEPRECATED\n private?: boolean, // ! DEPRECATED\n groups?: boolean, // ! DEPRECATED\n channels?: boolean, // ! DEPRECATED\n photo: AutoDownloadPeerTypeSettings,\n video: AutoDownloadPeerTypeSettings,\n file: AutoDownloadPeerTypeSettings\n },\n autoDownloadNew: AutoDownloadSettings,\n autoPlay?: { // ! DEPRECATED\n gifs: boolean,\n videos: boolean\n },\n stickers: {\n suggest: 'all' | 'installed' | 'none',\n dynamicPackOrder: boolean,\n loop: boolean\n },\n emoji: {\n suggest: boolean,\n big: boolean\n },\n background?: Background, // ! DEPRECATED\n themes: AppTheme[],\n theme: AppTheme['name'],\n notifications: {\n sound: boolean\n },\n nightTheme?: boolean, // ! DEPRECATED\n timeFormat: 'h12' | 'h23',\n liteMode: {[key in LiteModeKey]: boolean}\n },\n playbackParams: ReturnType,\n keepSigned: boolean,\n chatContextMenuHintWasShown: boolean,\n stateId: number,\n notifySettings: {[k in Exclude]?: PeerNotifySettings.peerNotifySettings}\n};\n\n// const BACKGROUND_DAY_MOBILE: Background = {\n// blur: false,\n// slug: '',\n// color: '#dbddbb,#6ba587,#d5d88d,#88b884',\n// highlightningColor: 'hsla(86.4, 43.846153%, 45.117647%, .4)',\n// intensity: 0,\n// id: '1'\n// };\n\n// const BACKGROUND_NIGHT_MOBILE: Background = {\n// blur: false,\n// slug: '',\n// color: '#0f0f0f',\n// highlightningColor: 'hsla(0, 0%, 3.82353%, 0.4)',\n// intensity: 0,\n// id: '-1'\n// };\n\nexport const DEFAULT_THEME: Theme = {\n _: 'theme',\n access_hash: '',\n id: '',\n settings: [{\n _: 'themeSettings',\n pFlags: {},\n base_theme: {_: 'baseThemeClassic'},\n accent_color: 0x3390ec,\n message_colors: [0x4fae4e],\n wallpaper: {\n _: 'wallPaper',\n pFlags: {\n default: true,\n pattern: true\n },\n access_hash: '',\n document: undefined,\n id: '',\n slug: 'pattern',\n settings: {\n _: 'wallPaperSettings',\n pFlags: {},\n intensity: 50,\n background_color: 0xdbddbb,\n second_background_color: 0x6ba587,\n third_background_color: 0xd5d88d,\n fourth_background_color: 0x88b884\n }\n }\n }, {\n _: 'themeSettings',\n pFlags: {},\n base_theme: {_: 'baseThemeNight'},\n accent_color: 0x8774E1,\n message_colors: [0x8774E1],\n wallpaper: {\n _: 'wallPaper',\n pFlags: {\n default: true,\n pattern: true,\n dark: true\n },\n access_hash: '',\n document: undefined,\n id: '',\n slug: 'pattern',\n settings: {\n _: 'wallPaperSettings',\n pFlags: {},\n intensity: -50,\n background_color: 0xfec496,\n second_background_color: 0xdd6cb9,\n third_background_color: 0x962fbf,\n fourth_background_color: 0x4f5bd5\n }\n }\n }],\n slug: '',\n title: '',\n emoticon: '🏠',\n pFlags: {default: true}\n};\n\nconst makeDefaultAppTheme = (\n name: AppTheme['name'],\n baseTheme: BaseTheme['_'],\n highlightningColor: string\n): AppTheme => {\n return {\n ...DEFAULT_THEME,\n name,\n settings: {\n ...DEFAULT_THEME.settings.find((s) => s.base_theme._ === baseTheme),\n highlightningColor\n }\n };\n};\n\nexport const STATE_INIT: State = {\n allDialogsLoaded: {},\n pinnedOrders: {},\n // contactsList: [],\n contactsListCachedTime: 0,\n updates: {},\n filtersArr: [],\n maxSeenMsgId: 0,\n stateCreatedTime: Date.now(),\n recentEmoji: [],\n recentCustomEmoji: [],\n topPeersCache: {},\n recentSearch: [],\n version: STATE_VERSION,\n build: BUILD,\n authState: {\n _: IS_MOBILE ? 'authStateSignIn' : 'authStateSignQr'\n },\n hiddenPinnedMessages: {},\n settings: {\n messagesTextSize: 16,\n distanceUnit: 'kilometers',\n sendShortcut: 'enter',\n autoDownload: {\n photo: {\n contacts: true,\n private: true,\n groups: true,\n channels: true\n },\n video: {\n contacts: true,\n private: true,\n groups: true,\n channels: true\n },\n file: {\n contacts: true,\n private: true,\n groups: true,\n channels: true\n }\n },\n autoDownloadNew: {\n _: 'autoDownloadSettings',\n file_size_max: 3145728,\n pFlags: {\n video_preload_large: true,\n audio_preload_next: true\n },\n photo_size_max: 1048576,\n video_size_max: 15728640,\n video_upload_maxbitrate: 100\n },\n stickers: {\n suggest: 'all',\n dynamicPackOrder: true,\n loop: true\n },\n emoji: {\n suggest: true,\n big: true\n },\n themes: [\n makeDefaultAppTheme('day', 'baseThemeClassic', 'hsla(86.4, 43.846153%, 45.117647%, .4)'),\n makeDefaultAppTheme('night', 'baseThemeNight', 'hsla(299.142857, 44.166666%, 37.470588%, .4)')\n ],\n theme: 'system',\n notifications: {\n sound: false\n },\n timeFormat: getTimeFormat(),\n liteMode: {\n all: false,\n animations: false,\n chat: false,\n chat_background: false,\n chat_spoilers: false,\n effects: false,\n effects_premiumstickers: false,\n effects_reactions: false,\n effects_emoji: false,\n emoji: false,\n emoji_messages: false,\n emoji_panel: false,\n gif: false,\n stickers: false,\n stickers_chat: false,\n stickers_panel: false,\n video: false\n }\n },\n playbackParams: {\n volume: 1,\n muted: false,\n playbackRate: 1,\n playbackRates: {\n voice: 1,\n video: 1,\n audio: 1\n },\n loop: false,\n round: false\n },\n keepSigned: true,\n chatContextMenuHintWasShown: false,\n stateId: nextRandomUint(32),\n notifySettings: {}\n};\n","export default function getTimeFormat(): 'h12' | 'h23' {\n // try {\n // const resolvedOptions = Intl.DateTimeFormat(navigator.language, {hour: 'numeric'}).resolvedOptions();\n // if('hourCycle' in resolvedOptions) {\n // return (resolvedOptions as any).hourCycle === 'h12' ? 'h12' : 'h23';\n // } else {\n // return resolvedOptions.hour12 ? 'h12' : 'h23';\n // }\n // } catch(err) {\n return new Date().toLocaleString().match(/\\s(AM|PM)/) ? 'h12' : 'h23';\n // }\n}\n","let IS_APPLE_MX = false;\n\ntry {\n // Awesome detect from https://stackoverflow.com/a/65412357\n const ctx = document.createElement('canvas').getContext('webgl');\n const extension = ctx.getExtension('WEBGL_debug_renderer_info');\n const renderer: string = extension && ctx.getParameter(extension.UNMASKED_RENDERER_WEBGL) || '';\n if((renderer.match(/Apple/) && !renderer.match(/Apple GPU/)) ||\n ctx.getSupportedExtensions().indexOf('WEBGL_compressed_texture_s3tc_srgb') === -1) {\n IS_APPLE_MX = true;\n }\n} catch(err) {\n\n}\n\nexport default IS_APPLE_MX;\n","import IS_WEBRTC_SUPPORTED from './webrtcSupport';\n\nconst IS_CALL_SUPPORTED = IS_WEBRTC_SUPPORTED;\n\nexport default IS_CALL_SUPPORTED;\n","import {IS_SAFARI} from './userAgent';\n\n/*\n * This is used as a workaround for a memory leak in Safari caused by using Transferable objects to\n * transfer data between WebWorkers and the main thread.\n * https://github.com/mapbox/mapbox-gl-js/issues/8771\n *\n * This should be removed once the underlying Safari issue is fixed.\n */\n\nlet CAN_USE_TRANSFERABLES: boolean;\nif(!IS_SAFARI) CAN_USE_TRANSFERABLES = true;\nelse {\n try {\n const match = navigator.userAgent.match(/Version\\/(.+?) /);\n CAN_USE_TRANSFERABLES = +match[1] >= 14;\n } catch(err) {\n CAN_USE_TRANSFERABLES = false;\n }\n}\n\nexport default CAN_USE_TRANSFERABLES;\n","const IS_CANVAS_FILTER_SUPPORTED = 'filter' in (document.createElement('canvas').getContext('2d') || {});\n\nexport default IS_CANVAS_FILTER_SUPPORTED;\n","const IS_EMOJI_SUPPORTED = navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i) !== -1/* && false *//* || true */;\n\nexport default IS_EMOJI_SUPPORTED;\n","const IS_GEOLOCATION_SUPPORTED = !!navigator?.geolocation?.getCurrentPosition && false;\n\nexport default IS_GEOLOCATION_SUPPORTED;\n","import IS_WEBRTC_SUPPORTED from './webrtcSupport';\n\nconst IS_GROUP_CALL_SUPPORTED = IS_WEBRTC_SUPPORTED;\n\nexport default IS_GROUP_CALL_SUPPORTED;\n","import IS_WEBP_SUPPORTED from './webpSupport';\n\nconst IMAGE_MIME_TYPES_SUPPORTED = new Set([\n 'image/jpeg',\n 'image/png',\n 'image/bmp'\n]);\n\nif(IS_WEBP_SUPPORTED) {\n IMAGE_MIME_TYPES_SUPPORTED.add('image/webp');\n}\n\nexport default IMAGE_MIME_TYPES_SUPPORTED;\n","import IMAGE_MIME_TYPES_SUPPORTED from './imageMimeTypesSupport';\nimport VIDEO_MIME_TYPES_SUPPORTED from './videoMimeTypesSupport';\n\nconst arr = [...IMAGE_MIME_TYPES_SUPPORTED].concat([...VIDEO_MIME_TYPES_SUPPORTED]);\n\nconst MEDIA_MIME_TYPES_SUPPORTED = new Set(arr);\n\nexport default MEDIA_MIME_TYPES_SUPPORTED;\n","import {IS_APPLE_MOBILE, IS_SAFARI} from './userAgent';\n\n// mov is not supported in Chrome on macOS\nconst IS_MOV_SUPPORTED = !!document.createElement('video').canPlayType('video/quicktime') || IS_SAFARI || IS_APPLE_MOBILE;\n\nexport default IS_MOV_SUPPORTED;\n","const audio = document.createElement('audio');\nconst IS_OPUS_SUPPORTED = !!(audio.canPlayType && audio.canPlayType('audio/ogg;').replace(/no/, ''))/* && false */;\n\nexport default IS_OPUS_SUPPORTED;\n","import {IS_FIREFOX} from './userAgent';\n\nconst IS_PARALLAX_SUPPORTED = !IS_FIREFOX && false;\n\nexport default IS_PARALLAX_SUPPORTED;\n","const IS_SCREEN_SHARING_SUPPORTED = !!('getDisplayMedia' in (navigator?.mediaDevices || {}));\n\nexport default IS_SCREEN_SHARING_SUPPORTED;\n","import Modes from '../config/modes';\n\nconst IS_SHARED_WORKER_SUPPORTED = typeof(SharedWorker) !== 'undefined' && !Modes.noSharedWorker/* && false */;\n\nexport default IS_SHARED_WORKER_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// @ts-ignore\nconst IS_TOUCH_SUPPORTED = ('ontouchstart' in window) || (window.DocumentTouch && document instanceof DocumentTouch)/* || true */;\nexport default IS_TOUCH_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ctx from './ctx';\n\nexport const USER_AGENT = navigator ? navigator.userAgent : null;\nexport const IS_APPLE = navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i) !== -1;\nexport const IS_ANDROID = navigator.userAgent.toLowerCase().indexOf('android') !== -1;\nexport const IS_CHROMIUM = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);\n\n// https://stackoverflow.com/a/58065241\nexport const IS_APPLE_MOBILE = (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&\n !(ctx as any).MSStream;\n\nexport const IS_SAFARI = !!('safari' in ctx) || !!(USER_AGENT && (/\\b(iPad|iPhone|iPod)\\b/.test(USER_AGENT) || (!!USER_AGENT.match('Safari') && !USER_AGENT.match('Chrome'))))/* || true */;\nexport const IS_FIREFOX = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n\nexport const IS_MOBILE_SAFARI = IS_SAFARI && IS_APPLE_MOBILE;\n\nexport const IS_MOBILE = (navigator.maxTouchPoints === undefined || navigator.maxTouchPoints > 0) && navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i) != -1;\n","const IS_VIBRATE_SUPPORTED = !!navigator?.vibrate;\n\nexport default IS_VIBRATE_SUPPORTED;\n","import IS_MOV_SUPPORTED from './movSupport';\n\nexport type VIDEO_MIME_TYPE = 'image/gif' | 'video/mp4' | 'video/webm' | 'video/quicktime';\nconst VIDEO_MIME_TYPES_SUPPORTED: Set = new Set([\n 'image/gif', // have to display it as video\n 'video/mp4',\n 'video/webm'\n]);\n\nif(IS_MOV_SUPPORTED) {\n VIDEO_MIME_TYPES_SUPPORTED.add('video/quicktime');\n}\n\nexport default VIDEO_MIME_TYPES_SUPPORTED;\n","import {IS_APPLE_MOBILE, IS_SAFARI} from './userAgent';\n\nconst IS_WEBM_SUPPORTED = !!document.createElement('video').canPlayType('video/webm') && !IS_SAFARI && !IS_APPLE_MOBILE;\n\nexport default IS_WEBM_SUPPORTED;\n","const IS_WEBP_SUPPORTED = document.createElement('canvas').toDataURL('image/webp').startsWith('data:image/webp');\n\nexport default IS_WEBP_SUPPORTED;\n","import {IS_FIREFOX} from './userAgent';\n\nconst IS_WEBRTC_SUPPORTED = !!(typeof(RTCPeerConnection) !== 'undefined' && !IS_FIREFOX);\n\nexport default IS_WEBRTC_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {WallPaper} from '../layer';\nimport clamp from './number/clamp';\n\nexport type ColorHsla = {\n h: number,\n s: number,\n l: number,\n a: number\n};\n\nexport type ColorRgba = [number, number, number, number];\nexport type ColorRgb = [number, number, number];\n\n/**\n * https://stackoverflow.com/a/54070620/6758968\n * r, g, b in [0, 255]\n * @returns h in [0,360) and s, v in [0,1]\n */\nexport function rgbToHsv(r: number, g: number, b: number): [number, number, number] {\n r /= 255, g /= 255, b /= 255;\n const v = Math.max(r, g, b),\n c = v - Math.min(r, g, b);\n const h = c && ((v === r) ? (g - b ) / c : ((v == g) ? 2 + (b - r) / c : 4 + (r - g) / c));\n return [60 * (h < 0 ? h + 6 : h), v && c / v, v];\n}\n\n/**\n * https://stackoverflow.com/a/54024653/6758968\n * @param h [0, 360]\n * @param s [0, 1]\n * @param v [0, 1]\n * @returns r, g, b in [0, 255]\n */\nexport function hsvToRgb(h: number, s: number, v: number): ColorRgb {\n const f = (n: number, k: number = (n + h / 60) % 6) => Math.round((v - v * s * Math.max(Math.min(k, 4 - k, 1), 0)) * 255);\n return [f(5), f(3), f(1)];\n}\n\n/**\n * @returns h [0, 360], s [0, 100], l [0, 100], a [0, 1]\n */\nexport function rgbaToHsla(r: number, g: number, b: number, a: number = 1): ColorHsla {\n r /= 255, g /= 255, b /= 255;\n const max = Math.max(r, g, b),\n min = Math.min(r, g, b);\n let h: number, s: number;\n const l = (max + min) / 2;\n\n if(max === min) {\n h = s = 0; // achromatic\n } else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch(max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n\n return {\n h: h * 360,\n s: s * 100,\n l: l * 100,\n a\n };\n}\n\n// * https://stackoverflow.com/a/9493060/6758968\n/**\n * Converts an HSL color value to RGB. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\n *\n * @param {number} h The hue [0, 360]\n * @param {number} s The saturation [0, 1]\n * @param {number} l The lightness [0, 1]\n * @return {Array} The RGB representation [0, 255]\n */\nexport function hslaToRgba(h: number, s: number, l: number, a: number): ColorRgba {\n h /= 360, s /= 100, l /= 100;\n let r: number, g: number, b: number;\n\n if(s === 0) {\n r = g = b = l; // achromatic\n } else {\n const hue2rgb = function hue2rgb(p: number, q: number, t: number) {\n if(t < 0) t += 1;\n if(t > 1) t -= 1;\n if(t < 1/6) return p + (q - p) * 6 * t;\n if(t < 1/2) return q;\n if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;\n return p;\n }\n\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n\n return [r, g, b, a].map((v) => Math.round(v * 255)) as ColorRgba;\n}\n\nexport function hslaStringToRgba(hsla: string) {\n const splitted = hsla.slice(5, -1).split(', ');\n const alpha = +splitted.pop();\n const arr = splitted.map((val) => {\n if(val.endsWith('%')) {\n return +val.slice(0, -1);\n }\n\n return +val;\n });\n\n return hslaToRgba(arr[0], arr[1], arr[2], alpha);\n}\n\nexport function hexaToRgba(hexa: string) {\n const arr: ColorRgba = [] as any;\n const offset = hexa[0] === '#' ? 1 : 0;\n if(hexa.length === (5 + offset)) {\n hexa = (offset ? '#' : '') + '0' + hexa.slice(offset);\n }\n\n if(hexa.length === (3 + offset)) {\n for(let i = offset; i < hexa.length; ++i) {\n arr.push(parseInt(hexa[i] + hexa[i], 16));\n }\n } else if(hexa.length === (4 + offset)) {\n for(let i = offset; i < (hexa.length - 1); ++i) {\n arr.push(parseInt(hexa[i] + hexa[i], 16));\n }\n\n arr.push(parseInt(hexa[hexa.length - 1], 16));\n } else {\n for(let i = offset; i < hexa.length; i += 2) {\n arr.push(parseInt(hexa.slice(i, i + 2), 16));\n }\n }\n\n return arr;\n}\n\nexport function hexToRgb(hex: string) {\n return hexaToRgba(hex.slice(0, 7)) as any as ColorRgb;\n}\n\nexport function hexaToHsla(hexa: string) {\n const rgba = hexaToRgba(hexa);\n return rgbaToHsla(rgba[0], rgba[1], rgba[2], rgba[3]);\n}\n\nexport function rgbaToHexa(rgba: ColorRgba | ColorRgb) {\n return '#' + rgba.map((v) => ('0' + v.toString(16)).slice(-2)).join('');\n}\n\nexport function hslaStringToHexa(hsla: string) {\n return rgbaToHexa(hslaStringToRgba(hsla));\n}\n\nexport function hslaStringToHex(hsla: string) {\n return hslaStringToHexa(hsla).slice(0, -2);\n}\n\n/**\n * @param weight [0, 1]\n */\nexport function mixColors(color1: ColorRgb, color2: ColorRgb, weight: number) {\n const out = new Array(3) as ColorRgb;\n for(let i = 0; i < 3; ++i) {\n const v1 = color1[i], v2 = color2[i];\n out[i] = Math.floor(v2 + (v1 - v2) * weight);\n }\n\n return out;\n}\n\nexport function computePerceivedBrightness(color: ColorRgb) {\n return (color[0] * 0.2126 + color[1] * 0.7152 + color[2] * 0.0722) / 255;\n}\n\nexport function getAverageColor(color1: ColorRgb, color2: ColorRgb): ColorRgb {\n return color1.map((v, i) => Math.round((v + color2[i]) / 2)) as ColorRgb;\n}\n\nexport function getAccentColor(baseHsv: number[], baseColor: ColorRgb, elementColor: ColorRgb): ColorRgb {\n const hsvTemp3 = rgbToHsv(...baseColor);\n const hsvTemp4 = rgbToHsv(...elementColor);\n\n const dist = Math.min(1.5 * hsvTemp3[1] / baseHsv[1], 1);\n\n hsvTemp3[0] = Math.min(360, hsvTemp4[0] - hsvTemp3[0] + baseHsv[0]);\n hsvTemp3[1] = Math.min(1, hsvTemp4[1] * baseHsv[1] / hsvTemp3[1]);\n hsvTemp3[2] = Math.min(1, (hsvTemp4[2] / hsvTemp3[2] + dist - 1) * baseHsv[2] / dist);\n if(hsvTemp3[2] < 0.3) {\n return elementColor;\n }\n return hsvToRgb(...hsvTemp3);\n}\n\nexport function changeColorAccent(baseHsv: number[], accentHsv: number[], color: ColorRgb, isDarkTheme: boolean) {\n const colorHsv = rgbToHsv(...color);\n\n const diffH = Math.min(Math.abs(colorHsv[0] - baseHsv[0]), Math.abs(colorHsv[0] - baseHsv[0] - 360));\n if(diffH > 30) {\n return color;\n }\n\n const dist = Math.min(1.5 * colorHsv[1] / baseHsv[1], 1);\n\n colorHsv[0] = Math.min(360, colorHsv[0] + accentHsv[0] - baseHsv[0]);\n colorHsv[1] = Math.min(1, colorHsv[1] * accentHsv[1] / baseHsv[1]);\n colorHsv[2] = Math.min(1, colorHsv[2] * (1 - dist + dist * accentHsv[2] / baseHsv[2]));\n\n let newColor = hsvToRgb(...colorHsv);\n\n const origBrightness = computePerceivedBrightness(color);\n const newBrightness = computePerceivedBrightness(newColor);\n\n // We need to keep colors lighter in dark themes and darker in light themes\n const needRevertBrightness = isDarkTheme ? origBrightness > newBrightness : origBrightness < newBrightness;\n\n if(needRevertBrightness) {\n const amountOfNew = 0.6;\n const fallbackAmount = (1 - amountOfNew) * origBrightness / newBrightness + amountOfNew;\n newColor = changeBrightness(newColor, fallbackAmount);\n }\n\n return newColor;\n}\n\nexport function changeBrightness(color: ColorRgb, amount: number) {\n return color.map((v) => clamp(Math.round(v * amount), 0, 255)) as ColorRgb;\n}\n\nexport function getHexColorFromTelegramColor(color: number) {\n const hex = (color < 0 ? 0xFFFFFF + color : color).toString(16);\n return '#' + (hex.length >= 6 ? hex : '0'.repeat(6 - hex.length) + hex);\n}\n\nexport function getRgbColorFromTelegramColor(color: number) {\n return hexToRgb(getHexColorFromTelegramColor(color));\n}\n\nexport function getColorsFromWallPaper(wallPaper: WallPaper) {\n return wallPaper.settings ? [\n wallPaper.settings.background_color,\n wallPaper.settings.second_background_color,\n wallPaper.settings.third_background_color,\n wallPaper.settings.fourth_background_color\n ].filter(Boolean).map(getHexColorFromTelegramColor).join(',') : '';\n}\n","export default function compareVersion(v1: string, v2: string): number {\n v1 = v1.split(' ', 1)[0];\n v2 = v2.split(' ', 1)[0];\n const s1 = v1.split('.');\n const s2 = v2.split('.');\n\n for(let i = 0; i < s1.length; ++i) {\n const v1 = +s1[i];\n const v2 = +s2[i];\n if(v1 > v2) return 1;\n else if(v1 < v2) return -1;\n }\n\n return 0;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function blurActiveElement() {\n if((document.activeElement as HTMLInputElement)?.blur) {\n (document.activeElement as HTMLInputElement).blur();\n return true;\n }\n\n return false;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nexport default function cancelEvent(event?: Event) {\n event ||= window.event;\n if(event) {\n // 'input' event will have cancelable=false, but we still need to preventDefault\n // if(!event.cancelable) {\n // return false;\n // }\n\n // @ts-ignore\n event = event.originalEvent || event;\n\n try {\n if(event.stopPropagation) event.stopPropagation();\n if(event.preventDefault) event.preventDefault();\n event.returnValue = false;\n event.cancelBubble = true;\n } catch(err) {}\n }\n\n return false;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// export function findUpClassName(el: any, className: string): T;\nexport default function findUpClassName(el: EventTarget | {closest: (selector: string) => any}, className: string): HTMLElement {\n return (el as any).closest('.' + className);\n /* if(el.classList.contains(className)) return el; // 03.02.2020\n\n while(el.parentElement) {\n el = el.parentElement;\n if(el.classList.contains(className))\n return el;\n }\n return null; */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {doubleRaf} from '../schedulers';\n\nexport default function fixSafariStickyInput(input: HTMLElement) {\n input.style.transform = 'translateY(-99999px)';\n /* input.style.position = 'fixed';\n input.style.top = '-99999px';\n input.style.left = '0'; */\n input.focus();\n\n // setTimeout(() => {\n doubleRaf().then(() => {\n // fastSmoothScroll(findUpClassName(input, 'scrollable-y') || window as any, document.activeElement as HTMLElement, 'start', 4, undefined, FocusDirection.Static);\n /* input.style.position = '';\n input.style.top = ''; */\n input.style.transform = '';\n // fastSmoothScroll(findUpClassName(input, 'scrollable-y') || window as any, document.activeElement as HTMLElement, 'start', 4, undefined, FocusDirection.Static);\n\n /* setTimeout(() => {\n fastSmoothScroll(findUpClassName(input, 'scrollable-y') || window as any, document.activeElement as HTMLElement, 'start', 4);\n }, 50); */\n });\n // }, 0);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport {IS_MOBILE, IS_SAFARI} from '../../environment/userAgent';\nimport findUpClassName from './findUpClassName';\nimport fixSafariStickyInput from './fixSafariStickyInput';\n\nexport const IS_STICKY_INPUT_BUGGED = IS_SAFARI && IS_MOBILE && IS_TOUCH_SUPPORTED;\n\nif(IS_STICKY_INPUT_BUGGED) {\n const key: 'clientY' | 'pageY' = 'clientY';\n let startY = 0;\n const o = {capture: true, passive: false};\n const onTouchMove = (e: TouchEvent) => {\n const touch = e.touches[0];\n\n // console.log('touchmove y', touch[key], startY);\n\n const scrollable = findUpClassName(touch.target, 'scrollable-y');\n if(scrollable) {\n const y = touch[key];\n const scrolled = startY - y;\n\n /* if(y < startY) {\n startY = y;\n } */\n\n const scrollTop = scrollable.scrollTop;\n const scrollHeight = scrollable.scrollHeight;\n const clientHeight = scrollable.clientHeight;\n const nextScrollTop = scrollTop ? Math.round(scrollTop + scrollable.clientHeight + scrolled) : scrollTop + scrolled;\n // const needCancel = scrollHeight !== clientHeight ? (scrollTop && diff <= 1) || (scrollTop - diff) < 0 : true;\n const needCancel = scrollHeight === clientHeight || nextScrollTop >= scrollHeight || nextScrollTop <= 0;\n if(needCancel) {\n e.preventDefault();\n }\n\n // console.log('touchmove with scrollable', scrollTop, startY, scrolled, nextScrollTop, needCancel, e.cancelable);\n } else {\n e.preventDefault();\n\n // console.log('touchmove no scrollable', e, touch);\n }\n\n // if(e.target === document.documentElement || e.target === document.body) e.preventDefault();\n };\n\n // let el = document.createElement('div');\n // document.body.prepend(el);\n // let a = 0;\n\n // let hasFocus = false;\n let lastFocusOutTimeStamp = 0;\n document.addEventListener('focusin', (e) => {\n if(!(e.target as HTMLElement).classList.contains('is-sticky-input-bugged') || (e.timeStamp - lastFocusOutTimeStamp) < 50/* && document.activeElement === input */) {\n return;\n }\n\n // console.log('focusin', e, e.timeStamp);\n\n // hasFocus = true;\n // document.body.classList.add('is-keyboard-opened');\n\n // el.innerText = 'focusin ' + ++a;\n\n /* a < 2 && */fixSafariStickyInput(e.target as HTMLElement);\n\n document.addEventListener('touchmove', onTouchMove, o);\n document.addEventListener('touchstart', (e) => {\n if(e.touches.length > 1) return;\n const touchStart = e.touches[0];\n\n startY = touchStart[key];\n });\n }, {passive: true});\n\n document.addEventListener('focusout', (e) => {\n // console.log('focusout', e, e.timeStamp);\n document.removeEventListener('touchmove', onTouchMove, o);\n\n lastFocusOutTimeStamp = e.timeStamp;\n\n // el.innerText = 'focusout ' + ++a;\n\n // if(hasFocus) {\n // hasFocus = false;\n // document.body.classList.remove('is-keyboard-opened');\n // }\n }, {passive: true});\n\n document.addEventListener('visibilitychange', () => {\n // console.log('window visibilitychange');\n if(document.activeElement &&\n document.activeElement.classList.contains('is-sticky-input-bugged') &&\n (document.activeElement as HTMLElement).blur) {\n fixSafariStickyInput(document.activeElement as HTMLElement);\n }\n\n /* blurActiveElement();\n window.scrollTo(0, 0);\n setVH(); */\n }, {passive: true});\n}\n\nexport default function fixSafariStickyInputFocusing(input: HTMLElement) {\n if(!IS_STICKY_INPUT_BUGGED) return;\n input.classList.add('is-sticky-input-bugged');\n}\n","let callback: () => Promise;\nexport default function cacheInstallPrompt() {\n window.addEventListener('beforeinstallprompt', (deferredPrompt: any) => {\n callback = async() => {\n deferredPrompt.prompt();\n const {outcome} = await deferredPrompt.userChoice;\n const installed = outcome === 'accepted';\n if(installed) {\n callback = undefined;\n }\n };\n });\n}\n\nexport function getInstallPrompt() {\n return callback;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport noop from '../noop';\nimport pause from '../schedulers/pause';\n\nconst texts = ['b', 'б'];\ntype FontType = 'text' | 'icons' | 'monospace';\n\nconst cache: {\n [key: string]: {\n [text: string]: Promise\n }\n} = {};\n\nconst fonts: {[type in FontType]: string} = {\n text: 'Roboto',\n icons: 'tgico',\n monospace: 'Roboto Mono'\n};\n\nexport default function loadFonts(types: {[type in FontType]?: string[] | 'all'} = {\n text: texts,\n icons: undefined,\n monospace: texts\n}): Promise {\n if(!('fonts' in document)) {\n return Promise.resolve();\n }\n\n const promises: Promise[] = [];\n for(const type in types) {\n let _texts = types[type as FontType];\n if(_texts === 'all') {\n _texts = texts;\n }\n\n const font = fonts[type as FontType];\n const weights = type === 'icons' ? [500] : [400, 500];\n for(const weight of weights) {\n const _promises = (_texts || [undefined]).map((text) => {\n const key = [weight, '1rem', font].join(' ');\n const promise = (cache[key] ??= {})[text || ''] ??= document.fonts.load(key, text);\n return promise;\n });\n promises.push(..._promises);\n }\n }\n\n return Promise.race([\n Promise.all(promises).catch(noop),\n pause(1000)\n ]);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import I18n from '../../lib/langPack';\n\nexport default function setInnerHTML(elem: Element, html: string | DocumentFragment | Element) {\n setDirection(elem);\n if(typeof(html) === 'string') {\n if(!html) elem.replaceChildren();\n else elem.innerHTML = html;\n } else {\n elem.replaceChildren(html);\n }\n}\n\nexport function setDirection(elem: Element) {\n // if(!I18n.isRTL) {\n elem.setAttribute('dir', 'auto');\n // }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport EventListenerBase from './eventListenerBase';\n\nconst FOCUS_EVENT_NAME = IS_TOUCH_SUPPORTED ? 'touchstart' : 'mousemove';\nconst DO_NOT_IDLE = false;\n\nexport class IdleController extends EventListenerBase<{\n change: (idle: boolean) => void\n}> {\n private _isIdle: boolean;\n\n private focusPromise: Promise;\n private focusResolve: () => void;\n\n constructor() {\n super();\n\n this._isIdle = true;\n this.focusPromise = Promise.resolve();\n this.focusResolve = () => {};\n\n window.addEventListener('blur', () => {\n this.isIdle = true;\n\n window.addEventListener('focus', () => {\n this.isIdle = false;\n }, {once: true});\n });\n\n // * Prevent setting online after reloading page\n window.addEventListener(FOCUS_EVENT_NAME, () => {\n this.isIdle = false;\n }, {once: true, passive: true});\n\n this.addEventListener('change', (idle) => {\n if(idle) {\n this.focusPromise = new Promise((resolve) => {\n this.focusResolve = resolve;\n });\n } else {\n this.focusResolve();\n }\n });\n }\n\n public getFocusPromise() {\n return this.focusPromise;\n }\n\n public get isIdle() {\n return this._isIdle;\n }\n\n public set isIdle(value: boolean) {\n if(this._isIdle === value) {\n return;\n }\n\n if(DO_NOT_IDLE && value) {\n return;\n }\n\n this._isIdle = value;\n this.dispatchEvent('change', value);\n }\n}\n\nconst idleController = new IdleController();\nexport default idleController;\n","export default function clamp(v: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, v));\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport EventListenerBase from './eventListenerBase';\n\nexport class OverlayCounter extends EventListenerBase<{\n change: (isActive: boolean) => void\n}> {\n public overlaysActive = 0;\n\n get isOverlayActive() {\n return this.overlaysActive > 0;\n }\n\n set isOverlayActive(value: boolean) {\n this.overlaysActive += value ? 1 : -1;\n this.dispatchEvent('change', this.isOverlayActive);\n }\n}\n\nconst overlayCounter = new OverlayCounter();\nexport default overlayCounter;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// * Jolly Cobra's schedulers\nimport {NoneToVoidFunction} from '../types';\n\n/*\nexport function throttleWithTickEnd(fn: F) {\n return throttleWith(onTickEnd, fn);\n}\n\nexport function throttleWithNow(fn: F) {\n return throttleWith(runNow, fn);\n}\n\nexport function onTickEnd(cb: NoneToVoidFunction) {\n Promise.resolve().then(cb);\n}\n\nfunction runNow(fn: NoneToVoidFunction) {\n fn();\n} */\n\nlet fastRafCallbacks: NoneToVoidFunction[] | undefined;\nexport function fastRaf(callback: NoneToVoidFunction) {\n if(!fastRafCallbacks) {\n fastRafCallbacks = [callback];\n\n requestAnimationFrame(() => {\n const currentCallbacks = fastRafCallbacks!;\n fastRafCallbacks = undefined;\n currentCallbacks.forEach((cb) => cb());\n });\n } else {\n fastRafCallbacks.push(callback);\n }\n}\n\nlet fastRafConventionalCallbacks: NoneToVoidFunction[] | undefined, processing = false;\nexport function fastRafConventional(callback: NoneToVoidFunction) {\n if(!fastRafConventionalCallbacks) {\n fastRafConventionalCallbacks = [callback];\n\n requestAnimationFrame(() => {\n processing = true;\n for(let i = 0; i < fastRafConventionalCallbacks.length; ++i) {\n fastRafConventionalCallbacks[i]();\n }\n\n fastRafConventionalCallbacks = undefined;\n processing = false;\n });\n } else if(processing) {\n callback();\n } else {\n fastRafConventionalCallbacks.push(callback);\n }\n}\n\nlet rafPromise: Promise;\nexport function fastRafPromise() {\n if(rafPromise) return rafPromise;\n\n rafPromise = new Promise((resolve) => fastRaf(() => resolve()));\n rafPromise.then(() => {\n rafPromise = undefined;\n });\n\n return rafPromise;\n}\n\nexport function doubleRaf() {\n return new Promise((resolve) => {\n fastRaf(() => {\n fastRaf(resolve);\n });\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function parseUriParams(uri: string, splitted = uri.split('?')) {\n return parseUriParamsLine(splitted?.[1]);\n}\n\nexport function parseUriParamsLine(line: string) {\n const params: any = {};\n if(!line) {\n return params;\n }\n\n line.split('&').forEach((item) => {\n params[item.split('=')[0]] = decodeURIComponent(item.split('=')[1]);\n });\n\n return params;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AppTheme} from '../config/state';\nimport type {Theme} from '../layer';\nimport type AppBackgroundTab from '../components/sidebarLeft/tabs/background';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport rootScope from '../lib/rootScope';\nimport {changeColorAccent, ColorRgb, getAccentColor, getAverageColor, getHexColorFromTelegramColor, getRgbColorFromTelegramColor, hexToRgb, hslaStringToHex, hsvToRgb, mixColors, rgbaToHexa, rgbaToHsla, rgbToHsv} from './color';\nimport {MOUNT_CLASS_TO} from '../config/debug';\n\ntype AppColorName = 'primary-color' | 'message-out-primary-color' |\n 'surface-color' | 'danger-color' | 'primary-text-color' |\n 'secondary-text-color' | 'message-out-background-color' |\n 'saved-color';\ntype AppColor = {\n rgb?: boolean,\n light?: boolean,\n lightFilled?: boolean,\n dark?: boolean,\n darkRgb?: boolean,\n darkFilled?: boolean\n};\n\nconst appColorMap: {[name in AppColorName]: AppColor} = {\n 'primary-color': {\n rgb: true,\n light: true,\n lightFilled: true,\n dark: true,\n darkRgb: true\n },\n 'message-out-primary-color': {\n lightFilled: true\n },\n 'surface-color': {\n rgb: true\n },\n 'danger-color': {\n light: true,\n dark: true\n },\n 'primary-text-color': {\n rgb: true\n },\n 'secondary-text-color': {\n light: true,\n lightFilled: true\n },\n 'message-out-background-color': {\n light: true,\n lightFilled: true,\n dark: true,\n darkFilled: true\n },\n 'saved-color': {\n lightFilled: true\n }\n};\n\nconst colorMap: {\n [name in AppTheme['name']]?: {\n [name in AppColorName]?: string\n }\n} = {\n day: {\n 'primary-color': '#3390ec',\n 'message-out-primary-color': '#4fae4e',\n 'surface-color': '#ffffff',\n 'danger-color': '#df3f40',\n 'primary-text-color': '#000000',\n 'secondary-text-color': '#707579',\n 'saved-color': '#359AD4'\n },\n night: {\n 'primary-color': '#8774E1',\n 'message-out-primary-color': '#8774E1',\n 'surface-color': '#212121',\n 'danger-color': '#ff595a',\n 'primary-text-color': '#ffffff',\n 'secondary-text-color': '#aaaaaa',\n 'saved-color': '#8774E1'\n }\n};\n\nexport class ThemeController {\n private themeColor: string;\n private _themeColorElem: Element;\n private systemTheme: AppTheme['name'];\n private styleElement: HTMLStyleElement;\n public AppBackgroundTab: typeof AppBackgroundTab;\n\n constructor() {\n rootScope.addEventListener('theme_change', () => {\n this.setTheme();\n });\n\n // rootScope.addEventListener('settings_updated', ())\n }\n\n private get themeColorElem() {\n if(this._themeColorElem !== undefined) {\n return this._themeColorElem;\n }\n\n return this._themeColorElem = document.head.querySelector('[name=\"theme-color\"]') as Element || null;\n }\n\n public setThemeColor(color = this.themeColor) {\n if(!color) {\n color = this.isNight() ? '#212121' : '#ffffff';\n }\n\n const themeColorElem = this.themeColorElem;\n if(themeColorElem) {\n themeColorElem.setAttribute('content', color);\n }\n }\n\n public setThemeListener() {\n try {\n const darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n const checkDarkMode = () => {\n // const theme = this.getTheme();\n this.systemTheme = darkModeMediaQuery.matches ? 'night' : 'day';\n // const newTheme = this.getTheme();\n\n if(rootScope.myId) {\n rootScope.dispatchEvent('theme_change');\n } else {\n this.setTheme();\n }\n };\n\n if('addEventListener' in darkModeMediaQuery) {\n darkModeMediaQuery.addEventListener('change', checkDarkMode);\n } else if('addListener' in darkModeMediaQuery) {\n (darkModeMediaQuery as any).addListener(checkDarkMode);\n }\n\n checkDarkMode();\n } catch(err) {\n\n }\n }\n\n public applyHighlightningColor() {\n let hsla: string;\n const theme = this.getTheme();\n if(theme.settings?.highlightningColor) {\n hsla = theme.settings.highlightningColor;\n document.documentElement.style.setProperty('--message-highlightning-color', hsla);\n } else {\n document.documentElement.style.removeProperty('--message-highlightning-color');\n }\n\n if(!IS_TOUCH_SUPPORTED && hsla) {\n this.themeColor = hslaStringToHex(hsla);\n }\n }\n\n public setTheme() {\n const isNight = this.isNight();\n const colorScheme = document.head.querySelector('[name=\"color-scheme\"]');\n if(colorScheme) {\n colorScheme.setAttribute('content', isNight ? 'dark' : 'light');\n }\n\n document.documentElement.classList.toggle('night', isNight);\n this.setThemeColor();\n const theme = this.getTheme();\n this.applyTheme(theme);\n\n let style = this.styleElement;\n if(!style) {\n style = this.styleElement = document.createElement('style');\n document.head.append(style);\n }\n\n const e = document.createElement('div');\n this.applyTheme(rootScope.settings.themes.find((theme) => theme.name === 'night'), e);\n style.textContent = `.night {${e.style.cssText}}`;\n\n this.applyHighlightningColor();\n }\n\n public async switchTheme(name: AppTheme['name']) {\n await rootScope.managers.appStateManager.setByKey('settings.theme', name);\n rootScope.dispatchEvent('theme_change');\n }\n\n public isNight() {\n return this.getTheme().name === 'night';\n }\n\n public getTheme(name: AppTheme['name'] = rootScope.settings.theme === 'system' ? this.systemTheme : rootScope.settings.theme) {\n return rootScope.settings.themes.find((t) => t.name === name);\n }\n\n // theme applier\n private bindColorApplier(options: Pick[0], 'element' | 'isNight'>) {\n const appliedColors: Set = new Set();\n return {\n applyAppColor: (_options: Omit[0], keyof typeof options>) => {\n appliedColors.add(_options.name);\n return this.applyAppColor({..._options, ...options});\n },\n finalize: () => {\n const isNight = options.isNight;\n for(const name in appColorMap) {\n if(!appliedColors.has(name as AppColorName)) {\n this.applyAppColor({\n name: name as AppColorName,\n hex: colorMap[isNight ? 'night' : 'day'][name as AppColorName],\n ...options\n });\n }\n }\n }\n };\n };\n\n private applyAppColor({\n name,\n hex,\n element,\n lightenAlpha = 0.08,\n darkenAlpha = lightenAlpha,\n mixColor,\n isNight\n }: {\n name: AppColorName,\n hex: string,\n element: HTMLElement,\n lightenAlpha?: number\n darkenAlpha?: number,\n mixColor?: ColorRgb,\n isNight?: boolean\n }) {\n const appColor = appColorMap[name];\n const rgb = hexToRgb(hex);\n const hsla = rgbaToHsla(...rgb);\n\n mixColor ??= hexToRgb(colorMap[isNight ? 'night' : 'day']['surface-color']);\n const lightenedRgb = mixColors(rgb, mixColor, lightenAlpha);\n\n const darkenedHsla: typeof hsla = {\n ...hsla,\n l: hsla.l - darkenAlpha * 100\n };\n\n const properties: [string, string][] = [\n [name, hex],\n appColor.rgb && [name + '-rgb', rgb.join(',')],\n appColor.light && ['light-' + name, `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, ${lightenAlpha})`],\n appColor.lightFilled && ['light-filled-' + name, rgbaToHexa(lightenedRgb)],\n appColor.dark && ['dark-' + name, `hsl(${darkenedHsla.h}, ${darkenedHsla.s}%, ${darkenedHsla.l}%)`]\n // appColor.darkFilled && ['dark-' + name, `hsl(${darkenedHsla.h}, ${darkenedHsla.s}%, ${darkenedHsla.l}%)`]\n ];\n\n properties.filter(Boolean).forEach(([name, value]) => {\n element.style.setProperty('--' + name, value);\n });\n }\n\n public async applyNewTheme(theme: Theme) {\n const isNight = this.isNightTheme(theme);\n const currentTheme = this.getTheme();\n const themes = rootScope.settings.themes;\n const themeSettings = theme.settings.find((themeSettings) => themeSettings.base_theme._ === (isNight ? 'baseThemeNight' : 'baseThemeClassic'));\n const newAppTheme: AppTheme = {\n ...theme,\n name: currentTheme.name,\n settings: {\n ...themeSettings,\n highlightningColor: ''\n }\n };\n\n await this.AppBackgroundTab.setBackgroundDocument(themeSettings.wallpaper, newAppTheme.settings);\n themes[themes.indexOf(currentTheme)] = newAppTheme;\n await rootScope.managers.appStateManager.setByKey('settings.themes', rootScope.settings.themes);\n rootScope.dispatchEvent('theme_change');\n }\n\n private isNightTheme(theme: Theme | AppTheme) {\n return (theme as AppTheme).name === 'night' || this.isNight();\n }\n\n public applyTheme(theme: Theme | AppTheme, element = document.documentElement) {\n const isNight = this.isNightTheme(theme);\n const themeSettings = Array.isArray(theme.settings) ?\n theme.settings.find((settings) => settings.base_theme._ === (isNight ? 'baseThemeNight' : 'baseThemeClassic')) :\n theme.settings;\n const baseColors = colorMap[isNight ? 'night' : 'day'];\n\n let hsvTemp1 = rgbToHsv(...hexToRgb(baseColors['primary-color'])); // primary base\n let hsvTemp2 = rgbToHsv(...getRgbColorFromTelegramColor(themeSettings.accent_color)); // new primary\n\n const newAccentRgb = changeColorAccent(\n hsvTemp1,\n hsvTemp2,\n hexToRgb(baseColors['primary-color']),\n !isNight\n );\n const newAccentHex = rgbaToHexa(newAccentRgb);\n\n const {applyAppColor, finalize} = this.bindColorApplier({element, isNight});\n\n applyAppColor({\n name: 'primary-color',\n hex: newAccentHex,\n darkenAlpha: 0.04\n });\n\n applyAppColor({\n name: 'saved-color',\n hex: newAccentHex,\n lightenAlpha: 0.64,\n mixColor: [255, 255, 255]\n });\n\n if(!themeSettings.message_colors?.length) {\n return;\n }\n\n const messageLightenAlpha = isNight ? 0.92 : 0.12;\n const baseMessageColor = hexToRgb(baseColors['message-out-primary-color']);\n hsvTemp1 = rgbToHsv(...baseMessageColor);\n const baseMessageOutBackgroundColor = mixColors(baseMessageColor, hexToRgb(baseColors['surface-color']), messageLightenAlpha);\n\n const firstColor = getRgbColorFromTelegramColor(themeSettings.message_colors[0]);\n\n let myMessagesAccent = firstColor;\n if(themeSettings.message_colors.length > 1) {\n // const w = getAccentColor(hsvTemp1, baseMessageOutBackgroundColor, myMessagesAccent);\n\n themeSettings.message_colors.slice(1).forEach((nextColor) => {\n myMessagesAccent = getAverageColor(myMessagesAccent, getRgbColorFromTelegramColor(nextColor));\n });\n\n myMessagesAccent = getAccentColor(hsvTemp1, baseMessageOutBackgroundColor, myMessagesAccent);\n\n // console.log('www', rgbaToHexa(w), rgbaToHexa(myMessagesAccent));\n }\n\n const o = myMessagesAccent;\n hsvTemp2 = rgbToHsv(...o);\n\n // const c = changeColorAccent(\n // hsvTemp1,\n // hsvTemp2,\n // baseMessageOutBackgroundColor\n // );\n\n // console.log(o, c, rgbaToHexa(o), rgbaToHexa(c));\n\n const accentColor2 = themeSettings.outbox_accent_color !== undefined && rgbToHsv(...getRgbColorFromTelegramColor(themeSettings.outbox_accent_color));\n\n const newMessageOutBackgroundColor = mixColors(myMessagesAccent, hexToRgb(baseColors['surface-color']), messageLightenAlpha);\n\n applyAppColor({\n name: 'message-out-background-color',\n hex: rgbaToHexa(newMessageOutBackgroundColor),\n lightenAlpha: messageLightenAlpha\n });\n\n applyAppColor({\n name: 'message-out-primary-color',\n hex: isNight ? '#ffffff' : rgbaToHexa(accentColor2 ? hsvToRgb(...accentColor2) : myMessagesAccent),\n mixColor: newMessageOutBackgroundColor\n });\n\n // if(accentColor2) {\n // console.log(rgbaToHexa(myMessagesAccent), rgbaToHexa(hsvToRgb(...accentColor2)));\n // }\n\n finalize();\n }\n}\n\nconst themeController = new ThemeController();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.themeController = themeController);\nexport default themeController;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function setWorkerProxy() {\n // * hook worker constructor to set search parameters (test, debug, etc)\n const workerHandler = {\n construct(target: any, args: any) {\n let url = args[0] + '';\n if(url.indexOf('blob:') !== 0) {\n url += location.search;\n }\n\n return new target(url);\n }\n };\n\n [\n Worker,\n typeof(SharedWorker) !== 'undefined' && SharedWorker\n ].filter(Boolean).forEach((w) => {\n window[w.name as any] = new Proxy(w, workerHandler);\n });\n}\n\nsetWorkerProxy();\n","const IS_INSTALL_PROMPT_SUPPORTED = 'onbeforeinstallprompt' in window;\nexport default IS_INSTALL_PROMPT_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport App from './config/app';\nimport blurActiveElement from './helpers/dom/blurActiveElement';\nimport cancelEvent from './helpers/dom/cancelEvent';\nimport {IS_STICKY_INPUT_BUGGED} from './helpers/dom/fixSafariStickyInputFocusing';\nimport loadFonts from './helpers/dom/loadFonts';\nimport IS_EMOJI_SUPPORTED from './environment/emojiSupport';\nimport {IS_ANDROID, IS_APPLE, IS_APPLE_MOBILE, IS_FIREFOX, IS_MOBILE, IS_MOBILE_SAFARI, IS_SAFARI} from './environment/userAgent';\nimport './materialize.scss';\nimport './scss/style.scss';\nimport pause from './helpers/schedulers/pause';\nimport setWorkerProxy from './helpers/setWorkerProxy';\nimport toggleAttributePolyfill from './helpers/dom/toggleAttributePolyfill';\nimport rootScope from './lib/rootScope';\nimport IS_TOUCH_SUPPORTED from './environment/touchSupport';\nimport I18n from './lib/langPack';\nimport './helpers/peerIdPolyfill';\nimport './lib/polyfill';\nimport apiManagerProxy from './lib/mtproto/mtprotoworker';\nimport getProxiedManagers from './lib/appManagers/getProxiedManagers';\nimport themeController from './helpers/themeController';\nimport overlayCounter from './helpers/overlayCounter';\nimport singleInstance from './lib/mtproto/singleInstance';\nimport {parseUriParamsLine} from './helpers/string/parseUriParams';\nimport Modes from './config/modes';\nimport {AuthState} from './types';\nimport {IS_BETA} from './config/debug';\nimport IS_INSTALL_PROMPT_SUPPORTED from './environment/installPrompt';\nimport cacheInstallPrompt from './helpers/dom/installPrompt';\n// import appNavigationController from './components/appNavigationController';\n\ndocument.addEventListener('DOMContentLoaded', async() => {\n toggleAttributePolyfill();\n\n // polyfill for replaceChildren\n if((Node as any).prototype.replaceChildren === undefined) {\n (Node as any).prototype.replaceChildren = function(...nodes: any[]) {\n this.textContent = '';\n // while(this.lastChild) {\n // this.removeChild(this.lastChild);\n // }\n if(nodes) {\n this.append(...nodes);\n }\n }\n }\n\n rootScope.managers = getProxiedManagers();\n\n const manifest = document.getElementById('manifest') as HTMLLinkElement;\n manifest.href = `site${IS_APPLE && !IS_APPLE_MOBILE ? '_apple' : ''}.webmanifest?v=jw3mK7G9Aq`;\n\n singleInstance.start();\n\n // We listen to the resize event (https://css-tricks.com/the-trick-to-viewport-units-on-mobile/)\n const w = window.visualViewport || window; // * handle iOS keyboard\n let setViewportVH = false/* , hasFocus = false */;\n let lastVH: number;\n const setVH = () => {\n const vh = (setViewportVH && !overlayCounter.isOverlayActive ? (w as VisualViewport).height || (w as Window).innerHeight : window.innerHeight) * 0.01;\n if(lastVH === vh) {\n return;\n } else if(IS_TOUCH_SUPPORTED && lastVH < vh && (vh - lastVH) > 1) {\n blurActiveElement(); // (Android) fix blurring inputs when keyboard is being closed (e.g. closing keyboard by back arrow and touching a bubble)\n }\n\n lastVH = vh;\n\n // const vh = document.documentElement.scrollHeight * 0.01;\n document.documentElement.style.setProperty('--vh', `${vh}px`);\n\n // console.log('setVH', vh, setViewportVH ? w : window);\n\n /* if(setViewportVH && userAgent.isSafari && touchSupport.isTouchSupported && document.activeElement && (document.activeElement as HTMLElement).blur) {\n const rect = document.activeElement.getBoundingClientRect();\n if(rect.top < 0 || rect.bottom >= (w as any).height) {\n fastSmoothScroll(findUpClassName(document.activeElement, 'scrollable-y') || window as any, document.activeElement as HTMLElement, 'center', 4, undefined, FocusDirection.Static);\n }\n } */\n };\n\n setWorkerProxy;\n\n // const [_, touchSupport, userAgent, _rootScope, _appStateManager, _I18n, __/* , ___ */] = await Promise.all([\n // import('./lib/polyfill'),\n // import('./environment/touchSupport'),\n // import('./environment/userAgent'),\n // import('./lib/rootScope'),\n // import('./lib/appManagers/appStateManager'),\n // import('./lib/langPack'),\n // import('./helpers/peerIdPolyfill'),\n // // import('./helpers/cacheFunctionPolyfill')\n // ]);\n\n /* const {IS_TOUCH_SUPPORTED} = touchSupport;\n const {IS_FIREFOX, IS_MOBILE, IS_APPLE, IS_SAFARI, IS_APPLE_MOBILE, IS_ANDROID} = userAgent;\n const rootScope = _rootScope.default;\n const appStateManager = _appStateManager.default;\n const I18n = _I18n.default; */\n\n window.addEventListener('resize', setVH);\n setVH();\n\n if(IS_STICKY_INPUT_BUGGED) {\n const toggleResizeMode = () => {\n setViewportVH = tabId === 1 && IS_STICKY_INPUT_BUGGED && !overlayCounter.isOverlayActive;\n setVH();\n\n if(w !== window) {\n if(setViewportVH) {\n window.removeEventListener('resize', setVH);\n w.addEventListener('resize', setVH);\n } else {\n w.removeEventListener('resize', setVH);\n window.addEventListener('resize', setVH);\n }\n }\n };\n\n let tabId: number;\n (window as any).onImTabChange = (id: number) => {\n const wasTabId = tabId !== undefined;\n tabId = id;\n\n if(wasTabId || tabId === 1) {\n toggleResizeMode();\n }\n };\n\n overlayCounter.addEventListener('change', () => {\n toggleResizeMode();\n });\n }\n\n if(IS_FIREFOX && !IS_EMOJI_SUPPORTED) {\n document.addEventListener('dragstart', (e) => {\n const target = e.target as HTMLElement;\n if(target.tagName === 'IMG' && target.classList.contains('emoji')) {\n cancelEvent(e);\n return false;\n }\n });\n }\n\n if(IS_EMOJI_SUPPORTED) {\n document.documentElement.classList.add('native-emoji');\n }\n\n // prevent firefox image dragging\n document.addEventListener('dragstart', (e) => {\n if((e.target as HTMLElement)?.tagName === 'IMG') {\n e.preventDefault();\n return false;\n }\n });\n\n // restrict contextmenu on images (e.g. webp stickers)\n document.addEventListener('contextmenu', (e) => {\n if((e.target as HTMLElement).tagName === 'IMG' && !(window as any).appMediaViewer) {\n cancelEvent(e);\n }\n });\n\n if(IS_FIREFOX) {\n document.documentElement.classList.add('is-firefox', 'no-backdrop');\n }\n\n if(IS_MOBILE) {\n document.documentElement.classList.add('is-mobile');\n }\n\n if(IS_APPLE) {\n if(IS_SAFARI) {\n document.documentElement.classList.add('is-safari');\n }\n\n // document.documentElement.classList.add('emoji-supported');\n\n if(IS_APPLE_MOBILE) {\n document.documentElement.classList.add('is-ios');\n } else {\n document.documentElement.classList.add('is-mac');\n }\n } else if(IS_ANDROID) {\n document.documentElement.classList.add('is-android');\n\n // force losing focus on input blur\n // focusin and focusout are not working on mobile\n\n const onInResize = () => {\n hasFocus = true;\n window.addEventListener('resize', onOutResize, {once: true});\n };\n\n const onOutResize = () => {\n hasFocus = false;\n blurActiveElement();\n };\n\n let hasFocus = false;\n document.addEventListener('touchend', (e) => {\n const input = (e.target as HTMLElement).closest('[contenteditable=\"true\"], input');\n if(!input) {\n return;\n }\n\n if(document.activeElement !== input && !hasFocus) {\n console.log('input click', e, document.activeElement, input, input.matches(':focus'));\n window.addEventListener('resize', onInResize, {once: true});\n }\n });\n }\n\n if(!IS_TOUCH_SUPPORTED) {\n document.documentElement.classList.add('no-touch');\n } else {\n document.documentElement.classList.add('is-touch');\n /* document.addEventListener('touchmove', (event: any) => {\n event = event.originalEvent || event;\n if(event.scale && event.scale !== 1) {\n event.preventDefault();\n }\n }, {capture: true, passive: false}); */\n }\n\n if(IS_INSTALL_PROMPT_SUPPORTED) {\n cacheInstallPrompt();\n }\n\n const perf = performance.now();\n\n // await pause(1000000);\n\n const langPromise = I18n.getCacheLangPack();\n\n const [stateResult, langPack] = await Promise.all([\n // loadState(),\n apiManagerProxy.sendState().then(([stateResult]) => stateResult),\n langPromise\n ]);\n I18n.setTimeFormat(stateResult.state.settings.timeFormat);\n\n rootScope.managers.rootScope.getPremium().then((isPremium) => {\n rootScope.premium = isPremium;\n });\n\n themeController.setThemeListener();\n\n if(langPack.appVersion !== App.langPackVersion) {\n I18n.getLangPack(langPack.lang_code);\n }\n\n /**\n * won't fire if font is loaded too fast\n */\n function fadeInWhenFontsReady(elem: HTMLElement, promise: Promise) {\n elem.style.opacity = '0';\n\n promise.then(() => {\n window.requestAnimationFrame(() => {\n elem.style.opacity = '';\n });\n });\n }\n\n console.log('got state, time:', performance.now() - perf);\n\n if(langPack.lang_code === 'ar' && IS_BETA && false) {\n document.body.classList.add('is-rtl');\n document.documentElement.dir = 'rtl';\n document.documentElement.lang = langPack.lang_code;\n I18n.setRTL(true);\n } else {\n document.documentElement.dir = 'ltr';\n }\n\n let authState = stateResult.state.authState;\n\n const hash = location.hash;\n const splitted = hash.split('?');\n const params = parseUriParamsLine(splitted[1] ?? splitted[0].slice(1));\n if(params.tgWebAuthToken && authState._ !== 'authStateSignedIn') {\n const data: AuthState.signImport['data'] = {\n token: params.tgWebAuthToken,\n dcId: +params.tgWebAuthDcId,\n userId: params.tgWebAuthUserId.toUserId(),\n isTest: params.tgWebAuthTest !== undefined && !!+params.tgWebAuthTest,\n tgAddr: params.tgaddr\n };\n\n if(data.isTest !== Modes.test) {\n const urlSearchParams = new URLSearchParams(location.search);\n if(+params.tgWebAuthTest) {\n urlSearchParams.set('test', '1');\n } else {\n urlSearchParams.delete('test');\n }\n\n location.search = urlSearchParams.toString();\n return;\n }\n\n rootScope.managers.appStateManager.pushToState('authState', authState = {_: 'authStateSignImport', data});\n\n // appNavigationController.overrideHash('?tgaddr=' + encodeURIComponent(params.tgaddr));\n }\n\n if(authState._ !== 'authStateSignedIn'/* || 1 === 1 */) {\n console.log('Will mount auth page:', authState._, Date.now() / 1000);\n\n const el = document.getElementById('auth-pages');\n let scrollable: HTMLElement;\n if(el) {\n scrollable = el.querySelector('.scrollable') as HTMLElement;\n if((!IS_TOUCH_SUPPORTED || IS_MOBILE_SAFARI)) {\n scrollable.classList.add('no-scrollbar');\n }\n\n // * don't remove this line\n scrollable.style.opacity = '0';\n\n const placeholder = document.createElement('div');\n placeholder.classList.add('auth-placeholder');\n\n scrollable.prepend(placeholder);\n scrollable.append(placeholder.cloneNode());\n }\n\n try {\n await Promise.all([\n import('./lib/mtproto/telegramMeWebManager'),\n import('./lib/mtproto/webPushApiManager')\n ]).then(([meModule, pushModule]) => {\n meModule.default.setAuthorized(false);\n pushModule.default.forceUnsubscribe();\n });\n } catch(err) {\n\n }\n\n let pagePromise: Promise;\n // langPromise.then(async() => {\n switch(authState._) {\n case 'authStateSignIn':\n pagePromise = (await import('./pages/pageSignIn')).default.mount();\n break;\n case 'authStateSignQr':\n pagePromise = (await import('./pages/pageSignQR')).default.mount();\n break;\n case 'authStateAuthCode':\n pagePromise = (await import('./pages/pageAuthCode')).default.mount(authState.sentCode);\n break;\n case 'authStatePassword':\n pagePromise = (await import('./pages/pagePassword')).default.mount();\n break;\n case 'authStateSignUp':\n pagePromise = (await import('./pages/pageSignUp')).default.mount(authState.authCode);\n break;\n case 'authStateSignImport':\n pagePromise = (await import('./pages/pageSignImport')).default.mount(authState.data);\n break;\n }\n // });\n\n if(scrollable) {\n // wait for text appear\n if(pagePromise) {\n await pagePromise;\n }\n\n const promise = 'fonts' in document ?\n Promise.race([\n pause(1000),\n document.fonts.ready\n ]) :\n Promise.resolve();\n fadeInWhenFontsReady(scrollable, promise);\n }\n\n /* setTimeout(async() => {\n (await import('./pages/pageAuthCode')).default.mount({\n \"_\": \"auth.sentCode\",\n \"pFlags\": {},\n \"flags\": 6,\n \"type\": {\n \"_\": \"auth.sentCodeTypeSms\",\n \"length\": 5\n },\n \"phone_code_hash\": \"\",\n \"next_type\": {\n \"_\": \"auth.codeTypeCall\"\n },\n \"timeout\": 120,\n \"phone_number\": \"\"\n });\n\n (await import('./pages/pageSignQR')).default.mount();\n\n (await import('./pages/pagePassword')).default.mount();\n\n (await import('./pages/pageSignUp')).default.mount({\n \"phone_code_hash\": \"\",\n \"phone_number\": \"\"\n });\n }, 500); */\n } else {\n console.log('Will mount IM page:', Date.now() / 1000);\n fadeInWhenFontsReady(document.getElementById('main-columns'), loadFonts());\n (await import('./pages/pageIm')).default.mount();\n }\n});\n","export default function toggleAttributePolyfill() {\n if(!Element.prototype.toggleAttribute) {\n Element.prototype.toggleAttribute = function(name, force) {\n if(force !== void 0) force = !!force;\n\n if(this.hasAttribute(name)) {\n if(force) return true;\n\n this.removeAttribute(name);\n return false;\n }\n if(force === false) return false;\n\n this.setAttribute(name, '');\n return true;\n };\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nexport class AppRuntimeManager {\n public reload() {\n try {\n location.reload();\n } catch(e) {};\n\n // if(window.chrome && chrome.runtime && chrome.runtime.reload) {\n // chrome.runtime.reload();\n // }\n }\n\n public close() {\n try {\n window.close();\n } catch(e) {}\n }\n\n /**\n * Better to call from event\n */\n public focus() {\n // // @ts-ignore\n // if(window.navigator.mozApps && document.hidden) {\n // // Get app instance and launch it to bring app to foreground\n // // @ts-ignore\n // window.navigator.mozApps.getSelf().onsuccess = function() {\n // this.result.launch();\n // };\n // } else {\n // // @ts-ignore\n // if(window.chrome && chrome.app && chrome.app.window) {\n // // @ts-ignore\n // chrome.app.window.current().focus();\n // }\n\n window.focus();\n // }\n }\n}\n\nconst appRuntimeManager = new AppRuntimeManager();\nexport default appRuntimeManager;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type createManagers from './createManagers';\nimport {ModifyFunctionsToAsync} from '../../types';\nimport apiManagerProxy from '../mtproto/mtprotoworker';\nimport {AckedResult} from '../mtproto/superMessagePort';\nimport noop from '../../helpers/noop';\nimport dT from '../../helpers/dT';\nimport DEBUG from '../../config/debug';\n\n// let stats: {\n// [manager: string]: {\n// [method: string]: {\n// times: number[],\n// byArgs: {\n// [args: string]: number[]\n// }\n// }\n// }\n// } = {};\n\n// let sentCount = 0;\n// let sentMethods: {[key: string]: number} = {};\n// let sentMethods2: {[key: string]: number} = {};\n// function collectStats(manager: string, method: string, args: any[], promise: Promise) {\n// ++sentCount;\n\n// const key = [manager, method].join('-');\n// if(!sentMethods[key]) sentMethods[key] = 0;\n// ++sentMethods[key];\n\n// const key2 = [('00000' + sentCount).slice(-5), key].join('-');\n\n// const byManager = stats[manager] ??= {};\n// const byMethod = byManager[method] ??= {times: [], byArgs: {}};\n\n// const perf = performance.now();\n// promise.catch(noop).finally(() => {\n// const time = performance.now() - perf;\n// byMethod.times.push(time);\n\n// sentMethods2[key2] = time;\n\n// try {\n// const argsString = JSON.stringify(args);\n// byMethod.byArgs[argsString].push(time);\n// } catch(err) {}\n// });\n// }\n\n// setInterval(() => {\n// console.log(dT(), '[PROXY] stats', stats, sentCount, sentMethods, sentMethods2);\n// sentCount = 0;\n// stats = {};\n// sentMethods = {};\n// sentMethods2 = {};\n// }, 2000);\n\nconst DEBUG_MANAGER_REQUESTS: {[managerName: string]: Set} = {};\nif(DEBUG) {\n (window as any).DEBUG_MANAGER_REQUESTS = DEBUG_MANAGER_REQUESTS;\n}\n\nfunction createProxy(/* source: T, */name: string, ack?: boolean) {\n const proxy = new Proxy({}, {\n get: (target, p, receiver) => {\n // console.log('get', target, p, receiver);\n // @ts-ignore\n // const value = source[p];\n // if(typeof(value) !== 'function') {\n // return value;\n // }\n\n return (...args: any[]) => {\n const promise = apiManagerProxy.invoke('manager', {\n name,\n method: p as string,\n args\n }, ack as any);\n\n if(DEBUG) {\n if(DEBUG_MANAGER_REQUESTS[name]?.has(p as any)) {\n console.warn('manager request', name, p, args);\n }\n }\n\n // collectStats(name, p as string, args, promise);\n\n return promise;\n\n // @ts-ignore\n // return Promise.resolve(value.call(source, ...args));\n };\n }\n });\n\n return proxy;\n}\n\ntype AA = {\n [key in keyof T]: T[key] extends (...args: infer A) => infer R ? (...args: A) => Promise>> : never\n};\n\ntype T = Awaited>;\ntype ProxiedManagers = {\n [name in keyof T]?: ModifyFunctionsToAsync;\n} & {\n acknowledged?: {\n [name in keyof T]?: AA;\n }\n};\n\nfunction createProxyProxy(proxied: any, ack?: boolean) {\n return new Proxy(proxied, {\n get: (target, p, receiver) => {\n // @ts-ignore\n return target[p] ??= createProxy(p as string, ack);\n }\n });\n}\n\nlet proxied: ProxiedManagers;\nexport default function getProxiedManagers() {\n if(proxied) {\n return proxied;\n }\n\n proxied = createProxyProxy({}, false);\n proxied.acknowledged = createProxyProxy({}, true);\n return proxied;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {Database} from '../../config/databases';\nimport Modes from '../../config/modes';\nimport makeError from '../../helpers/makeError';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport {logger} from '../logger';\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/createIndex\n */\nexport type IDBIndex = {\n indexName: string,\n keyPath: string,\n objectParameters: IDBIndexParameters\n};\n\nexport type IDBStore = {\n name: string,\n indexes?: IDBIndex[]\n};\n\nexport type IDBOptions = {\n name?: string,\n storeName: string,\n stores?: IDBStore[],\n version?: number\n};\n\nconst DEBUG = false;\n\nexport class IDB {\n private static INSTANCES: IDB[] = [];\n private openDbPromise: Promise;\n private db: IDBDatabase;\n private storageIsAvailable: boolean;\n private log: ReturnType;\n private name: string;\n private version: number;\n private stores: IDBStore[];\n\n constructor(db: Database) {\n safeAssign(this, db);\n\n if(Modes.test) {\n this.name += '_test';\n }\n\n this.storageIsAvailable = true;\n this.log = logger(['IDB', db.name].join('-'));\n this.log('constructor');\n\n this.openDatabase(true);\n\n IDB.INSTANCES.push(this);\n }\n\n public isAvailable() {\n return this.storageIsAvailable;\n }\n\n public openDatabase(createNew = false): Promise {\n if(this.openDbPromise && !createNew) {\n return this.openDbPromise;\n }\n\n const createIndexes = (os: IDBObjectStore, store: IDBStore) => {\n const indexNames = Array.from(os.indexNames);\n for(const indexName of indexNames) {\n os.deleteIndex(indexName);\n }\n\n if(!store.indexes?.length) {\n return;\n }\n\n for(const index of store.indexes) {\n if(os.indexNames.contains(index.indexName)) {\n continue;\n }\n\n os.createIndex(index.indexName, index.keyPath, index.objectParameters);\n }\n };\n\n const createObjectStore = (db: IDBDatabase, store: IDBStore) => {\n const os = db.createObjectStore(store.name);\n createIndexes(os, store);\n };\n\n try {\n var request = indexedDB.open(this.name, this.version);\n\n if(!request) {\n return Promise.reject();\n }\n } catch(error) {\n this.log.error('error opening db', (error as Error).message);\n this.storageIsAvailable = false;\n return Promise.reject(error);\n }\n\n let finished = false;\n setTimeout(() => {\n if(!finished) {\n request.onerror(makeError('IDB_CREATE_TIMEOUT') as Event);\n }\n }, 3000);\n\n return this.openDbPromise = new Promise((resolve, reject) => {\n request.onsuccess = (event) => {\n finished = true;\n const db = request.result;\n let calledNew = false;\n\n this.log('Opened');\n\n db.onerror = (error) => {\n this.storageIsAvailable = false;\n this.log.error('Error creating/accessing IndexedDB database', error);\n reject(error);\n };\n\n db.onclose = (e) => {\n this.log.error('closed:', e);\n !calledNew && this.openDatabase();\n };\n\n db.onabort = (e) => {\n this.log.error('abort:', e);\n const transaction = e.target as IDBTransaction;\n\n this.openDatabase(calledNew = true);\n\n if(transaction.onerror) {\n transaction.onerror(e);\n }\n\n db.close();\n };\n\n db.onversionchange = (e) => {\n this.log.error('onversionchange, lol?');\n };\n\n resolve(this.db = db);\n };\n\n request.onerror = (event) => {\n finished = true;\n this.storageIsAvailable = false;\n this.log.error('Error creating/accessing IndexedDB database', event);\n reject(event);\n };\n\n request.onupgradeneeded = (event) => {\n finished = true;\n this.log.warn('performing idb upgrade from', event.oldVersion, 'to', event.newVersion);\n\n const target = event.target as IDBOpenDBRequest;\n const db = target.result;\n this.stores.forEach((store) => {\n /* if(db.objectStoreNames.contains(store.name)) {\n //if(event.oldVersion === 1) {\n db.deleteObjectStore(store.name);\n //}\n } */\n\n if(!db.objectStoreNames.contains(store.name)) {\n createObjectStore(db, store);\n } else {\n const txn = target.transaction;\n const os = txn.objectStore(store.name);\n createIndexes(os, store);\n }\n });\n };\n });\n }\n\n public static create>(db: T) {\n return this.INSTANCES.find((instance) => instance.name === db.name) ?? new IDB(db);\n }\n\n public static closeDatabases(preserve?: IDB) {\n this.INSTANCES.forEach((storage) => {\n if(preserve && preserve === storage) {\n return;\n }\n\n const db = storage.db;\n if(db) {\n db.onclose = () => {};\n db.close();\n }\n });\n }\n}\n\nexport default class IDBStorage, StoreName extends string = T['stores'][0]['name']> {\n private log: ReturnType;\n private storeName: T['stores'][0]['name'];\n private idb: IDB;\n\n constructor(db: T, storeName: typeof db['stores'][0]['name']) {\n this.storeName = storeName;\n this.log = logger(['IDB', db.name, storeName].join('-'));\n this.idb = IDB.create(db);\n }\n\n /**\n * ! WARNING ! function requires at least one opened connection\n */\n /* public static clearObjectStores() {\n const storage = this.STORAGES[0];\n this.closeDatabases(storage);\n\n const names = Array.from(storage.db.objectStoreNames);\n const promises = names.map((name) => storage.clear(name));\n return Promise.all(promises);\n } */\n\n /* public static deleteDatabase() {\n this.closeDatabases();\n\n const storages = this.STORAGES;\n const dbNames = Array.from(new Set(storages.map((storage) => storage.name)));\n const promises = dbNames.map((dbName) => {\n return new Promise((resolve, reject) => {\n const deleteRequest = indexedDB.deleteDatabase(dbName);\n\n deleteRequest.onerror = () => {\n reject();\n };\n\n deleteRequest.onsuccess = () => {\n resolve();\n };\n });\n });\n\n return Promise.all(promises);\n } */\n\n public delete(entryName: string | string[], storeName?: StoreName): Promise {\n // return Promise.resolve();\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n entryName = [].concat(entryName);\n }\n\n return this.getObjectStore('readwrite', (objectStore) => {\n const promises = (entryName as string[]).map((entryName) => objectStore.delete(entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'delete: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n public clear(storeName?: StoreName): Promise {\n return this.getObjectStore('readwrite', (objectStore) => objectStore.clear(), DEBUG ? 'clear' : '', storeName);\n }\n\n public save(entryName: string | string[], value: any | any[], storeName?: StoreName) {\n // const handleError = (error: Error) => {\n // this.log.error('save: transaction error:', entryName, value, db, error, error && error.name);\n // if((!error || error.name === 'InvalidStateError')/* && false */) {\n // setTimeout(() => {\n // this.save(entryName, value);\n // }, 2e3);\n // } else {\n // //console.error('IndexedDB saveFile transaction error:', error, error && error.name);\n // }\n // };\n\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n entryName = [].concat(entryName);\n value = [].concat(value);\n }\n\n return this.getObjectStore('readwrite', (objectStore) => {\n const promises = (entryName as string[]).map((entryName, idx) => objectStore.put(value[idx], entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'save: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n // public saveFile(fileName: string, blob: Blob | Uint8Array) {\n // //return Promise.resolve(blobConstruct([blob]));\n // if(!(blob instanceof Blob)) {\n // blob = blobConstruct(blob);\n // }\n\n // return this.save(fileName, blob);\n // }\n\n /* public saveFileBase64(db: IDBDatabase, fileName: string, blob: Blob | any): Promise {\n if(this.getBlobSize(blob) > 10 * 1024 * 1024) {\n return Promise.reject();\n }\n\n if(!(blob instanceof Blob)) {\n var safeMimeType = blobSafeMimeType(blob.type || 'image/jpeg');\n var address = 'data:' + safeMimeType + ';base64,' + bytesToBase64(blob);\n return this.storagePutB64String(db, fileName, address).then(() => {\n return blob;\n });\n }\n\n try {\n var reader = new FileReader();\n } catch (e) {\n this.storageIsAvailable = false;\n return Promise.reject();\n }\n\n let promise = new Promise((resolve, reject) => {\n reader.onloadend = () => {\n this.storagePutB64String(db, fileName, reader.result as string).then(() => {\n resolve(blob);\n }, reject);\n }\n\n reader.onerror = reject;\n });\n\n\n try {\n reader.readAsDataURL(blob);\n } catch (e) {\n this.storageIsAvailable = false;\n return Promise.reject();\n }\n\n return promise;\n }\n\n public storagePutB64String(db: IDBDatabase, fileName: string, b64string: string) {\n try {\n var objectStore = db.transaction([this.storeName], 'readwrite')\n .objectStore(this.storeName);\n var request = objectStore.put(b64string, fileName);\n } catch(error) {\n this.storageIsAvailable = false;\n return Promise.reject(error);\n }\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n resolve();\n };\n\n request.onerror = reject;\n });\n }\n\n public getBlobSize(blob: any) {\n return blob.size || blob.byteLength || blob.length;\n } */\n\n public get(entryName: string[], storeName?: StoreName): Promise;\n public get(entryName: string, storeName?: StoreName): Promise;\n public get(entryName: string | string[], storeName?: StoreName): Promise | Promise {\n // return Promise.reject();\n\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n if(!entryName) {\n return undefined;\n }\n\n entryName = [].concat(entryName);\n } else if(!entryName.length) {\n return Promise.resolve([]) as any;\n }\n\n return this.getObjectStore('readonly', (objectStore) => {\n const promises = (entryName as string[]).map((entryName) => objectStore.get(entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'get: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n private getObjectStore(\n mode: IDBTransactionMode,\n callback: (objectStore: IDBObjectStore) => IDBRequest | IDBRequest[],\n log?: string,\n storeName = this.storeName\n ) {\n let perf: number;\n\n if(log) {\n perf = performance.now();\n this.log(log + ': start');\n }\n\n return this.idb.openDatabase().then((db) => {\n return new Promise((resolve, reject) => {\n /* if(mode === 'readwrite') {\n return;\n } */\n\n const transaction = db.transaction([storeName], mode);\n\n const onError = () => {\n clearTimeout(timeout);\n reject(transaction.error);\n };\n\n // let resolved = false;\n const onComplete = (/* what: string */) => {\n clearTimeout(timeout);\n\n if(log) {\n this.log(log + ': end', performance.now() - perf/* , what */);\n }\n\n // if(resolved) {\n // return;\n // }\n\n // resolved = true;\n const results = requests.map((r) => r.result);\n resolve(isArray ? results : results[0]);\n };\n\n transaction.onerror = onError;\n\n // * have to wait while clearing or setting something\n const waitForTransactionComplete = mode === 'readwrite';\n if(waitForTransactionComplete) {\n transaction.oncomplete = () => onComplete(/* 'transaction' */);\n }\n\n const timeout = setTimeout(() => {\n this.log.error('transaction not finished', transaction, log);\n }, 10000);\n\n /* transaction.addEventListener('abort', (e) => {\n //handleError();\n this.log.error('IndexedDB: transaction abort!', transaction.error);\n }); */\n\n const callbackResult = callback(transaction.objectStore(storeName));\n\n const isArray = Array.isArray(callbackResult);\n const requests: IDBRequest[] = isArray ? callbackResult : [].concat(callbackResult) as any;\n\n if(waitForTransactionComplete) {\n return;\n }\n\n const length = requests.length;\n let left = length;\n\n const onRequestFinished = () => {\n if(transaction.error) {\n return;\n }\n\n if(!--left) {\n onComplete(/* 'requests' */);\n }\n };\n\n for(let i = 0; i < length; ++i) {\n const request = requests[i];\n request.onerror = onError;\n request.onsuccess = onRequestFinished;\n }\n });\n });\n }\n\n public getAll(storeName?: StoreName): Promise {\n return this.getObjectStore('readonly', (objectStore) => objectStore.getAll(), DEBUG ? 'getAll' : '', storeName);\n }\n\n /* public getAllKeys(): Promise> {\n console.time('getAllEntries');\n return this.openDatabase().then((db) => {\n var objectStore = db.transaction([this.storeName], 'readonly')\n .objectStore(this.storeName);\n var request = objectStore.getAllKeys();\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n // @ts-ignore\n var result = event.target.result;\n resolve(result);\n console.timeEnd('getAllEntries');\n }\n\n request.onerror = reject;\n });\n });\n } */\n\n /* public isFileExists(fileName: string): Promise {\n console.time('isFileExists');\n return this.openDatabase().then((db) => {\n var objectStore = db.transaction([this.storeName], 'readonly')\n .objectStore(this.storeName);\n var request = objectStore.openCursor(fileName);\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n // @ts-ignore\n var cursor = event.target.result;\n resolve(!!cursor);\n console.timeEnd('isFileExists');\n }\n\n request.onerror = reject;\n });\n });\n } */\n\n /* public getFileWriter(fileName: string, mimeType: string) {\n var fakeWriter = FileManager.getFakeFileWriter(mimeType, (blob) => {\n return this.saveFile(fileName, blob);\n });\n\n return Promise.resolve(fakeWriter);\n } */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type lang from '../lang';\nimport type langSign from '../langSign';\nimport type {State} from '../config/state';\nimport DEBUG, {MOUNT_CLASS_TO} from '../config/debug';\nimport {HelpCountriesList, HelpCountry, LangPackDifference, LangPackString} from '../layer';\nimport stateStorage from './stateStorage';\nimport App from '../config/app';\nimport rootScope from './rootScope';\nimport {IS_MOBILE} from '../environment/userAgent';\nimport deepEqual from '../helpers/object/deepEqual';\nimport safeAssign from '../helpers/object/safeAssign';\nimport capitalizeFirstLetter from '../helpers/string/capitalizeFirstLetter';\nimport matchUrlProtocol from './richTextProcessor/matchUrlProtocol';\nimport wrapUrl from './richTextProcessor/wrapUrl';\nimport {setDirection} from '../helpers/dom/setInnerHTML';\n\nexport const langPack: {[actionType: string]: LangPackKey} = {\n 'messageActionChatCreate': 'ActionCreateGroup',\n 'messageActionChatCreateYou': 'ActionYouCreateGroup',\n 'messageActionChatEditTitle': 'ActionChangedTitle',\n 'messageActionChatEditPhoto': 'ActionChangedPhoto',\n 'messageActionChatEditVideo': 'ActionChangedVideo',\n 'messageActionChatDeletePhoto': 'ActionRemovedPhoto',\n 'messageActionChatReturn': 'ActionAddUserSelf',\n 'messageActionChatReturnYou': 'ActionAddUserSelfYou',\n 'messageActionChatJoined': 'ActionAddUserSelfMega',\n 'messageActionChatJoinedYou': 'ChannelMegaJoined',\n 'messageActionChatAddUser': 'ActionAddUser',\n 'messageActionChatAddUsers': 'ActionAddUser',\n 'messageActionChatLeave': 'ActionLeftUser',\n 'messageActionChatLeaveYou': 'YouLeft',\n 'messageActionChatDeleteUser': 'ActionKickUser',\n 'messageActionChatJoinedByLink': 'ActionInviteUser',\n 'messageActionPinMessage': 'Chat.Service.Group.UpdatedPinnedMessage',\n 'messageActionContactSignUp': 'Chat.Service.PeerJoinedTelegram',\n 'messageActionChannelCreate': 'ActionCreateChannel',\n 'messageActionChannelEditTitle': 'Chat.Service.Channel.UpdatedTitle',\n 'messageActionChannelEditPhoto': 'Chat.Service.Channel.UpdatedPhoto',\n 'messageActionChannelEditVideo': 'Chat.Service.Channel.UpdatedVideo',\n 'messageActionChannelDeletePhoto': 'Chat.Service.Channel.RemovedPhoto',\n 'messageActionHistoryClear': 'HistoryCleared',\n 'messageActionDiscussionStarted': 'DiscussionStarted',\n\n 'messageActionChannelMigrateFrom': 'ActionMigrateFromGroup',\n\n 'messageActionPhoneCall.video_in_ok': 'ChatList.Service.VideoCall.incoming',\n 'messageActionPhoneCall.video_out_ok': 'ChatList.Service.VideoCall.outgoing',\n 'messageActionPhoneCall.video_missed': 'ChatList.Service.VideoCall.Missed',\n 'messageActionPhoneCall.video_cancelled': 'ChatList.Service.VideoCall.Cancelled',\n 'messageActionPhoneCall.in_ok': 'ChatList.Service.Call.incoming',\n 'messageActionPhoneCall.out_ok': 'ChatList.Service.Call.outgoing',\n 'messageActionPhoneCall.missed': 'ChatList.Service.Call.Missed',\n 'messageActionPhoneCall.cancelled': 'ChatList.Service.Call.Cancelled',\n\n 'messageActionGroupCall.started': 'Chat.Service.VoiceChatStarted.Channel',\n 'messageActionGroupCall.started_by': 'Chat.Service.VoiceChatStarted',\n 'messageActionGroupCall.started_byYou': 'Chat.Service.VoiceChatStartedYou',\n 'messageActionGroupCall.ended': 'Chat.Service.VoiceChatFinished.Channel',\n 'messageActionGroupCall.ended_by': 'Chat.Service.VoiceChatFinished',\n 'messageActionGroupCall.ended_byYou': 'Chat.Service.VoiceChatFinishedYou',\n\n 'messageActionBotAllowed': 'Chat.Service.BotPermissionAllowed'\n};\n\nexport type LangPackKey = /* string | */keyof typeof lang | keyof typeof langSign;\n\nexport type FormatterArgument = string | number | Node | FormatterArgument[];\nexport type FormatterArguments = FormatterArgument[];\n\nexport const UNSUPPORTED_LANG_PACK_KEY: LangPackKey = IS_MOBILE ? 'Message.Unsupported.Mobile' : 'Message.Unsupported.Desktop';\n\nnamespace I18n {\n export const strings: Map = new Map();\n export const countriesList: HelpCountry[] = [];\n let pluralRules: Intl.PluralRules;\n\n let cacheLangPackPromise: Promise;\n export let lastRequestedLangCode: string;\n export let lastRequestedNormalizedLangCode: string;\n export let lastAppliedLangCode: string;\n export let requestedServerLanguage = false;\n export let timeFormat: State['settings']['timeFormat'];\n export let isRTL = false;\n\n export function setRTL(rtl: boolean) {\n isRTL = rtl;\n }\n\n function setLangCode(langCode: string) {\n lastRequestedLangCode = langCode;\n lastRequestedNormalizedLangCode = langCode.split('-')[0];\n }\n\n export function getCacheLangPack(): Promise {\n if(cacheLangPackPromise) return cacheLangPackPromise;\n return cacheLangPackPromise = Promise.all([\n stateStorage.get('langPack') as Promise,\n polyfillPromise\n ]).then(([langPack]) => {\n if(!langPack/* || true */) {\n return loadLocalLangPack();\n } else if(DEBUG && false) {\n return getLangPack(langPack.lang_code);\n }/* else if(langPack.appVersion !== App.langPackVersion) {\n return getLangPack(langPack.lang_code);\n } */\n\n if(!lastRequestedLangCode) {\n setLangCode(langPack.lang_code);\n }\n\n applyLangPack(langPack);\n return langPack;\n }).finally(() => {\n cacheLangPackPromise = undefined;\n });\n }\n\n function updateAmPm() {\n if(timeFormat === 'h12') {\n try {\n const dateTimeFormat = getDateTimeFormat({hour: 'numeric', minute: 'numeric', hour12: true});\n const date = new Date();\n date.setHours(0);\n const amText = dateTimeFormat.format(date);\n amPmCache.am = amText.split(/\\s/)[1];\n date.setHours(12);\n const pmText = dateTimeFormat.format(date);\n amPmCache.pm = pmText.split(/\\s/)[1];\n } catch(err) {\n console.error('cannot get am/pm', err);\n amPmCache = {am: 'AM', pm: 'PM'};\n }\n }\n }\n\n export function setTimeFormat(\n format: State['settings']['timeFormat'],\n haveToUpdate = !!timeFormat && timeFormat !== format\n ) {\n timeFormat = format;\n\n updateAmPm();\n\n if(haveToUpdate) {\n cachedDateTimeFormats.clear();\n const elements = Array.from(document.querySelectorAll(`.i18n`)) as HTMLElement[];\n elements.forEach((element) => {\n const instance = weakMap.get(element);\n\n if(instance instanceof IntlDateElement) {\n instance.update();\n }\n });\n }\n }\n\n export function loadLocalLangPack() {\n const defaultCode = App.langPackCode;\n setLangCode(defaultCode);\n return Promise.all([\n import('../lang'),\n import('../langSign'),\n import('../countries')\n ]).then(([lang, langSign, countries]) => {\n const strings: LangPackString[] = [];\n formatLocalStrings(lang.default, strings);\n formatLocalStrings(langSign.default, strings);\n\n const langPack: LangPackDifference = {\n _: 'langPackDifference',\n from_version: 0,\n lang_code: defaultCode,\n strings,\n version: 0,\n local: true,\n countries: countries.default\n };\n return saveLangPack(langPack);\n });\n }\n\n export function loadLangPack(langCode: string, web?: boolean) {\n web = true;\n requestedServerLanguage = true;\n const managers = rootScope.managers;\n return Promise.all([\n managers.apiManager.invokeApiCacheable('langpack.getLangPack', {\n lang_code: langCode,\n lang_pack: web ? 'web' : App.langPack\n }),\n !web && managers.apiManager.invokeApiCacheable('langpack.getLangPack', {\n lang_code: langCode,\n lang_pack: 'android'\n }),\n import('../lang'),\n import('../langSign'),\n managers.apiManager.invokeApiCacheable('help.getCountriesList', {\n lang_code: langCode,\n hash: 0\n }) as Promise,\n polyfillPromise\n ]);\n }\n\n export function getStrings(langCode: string, strings: string[]) {\n return rootScope.managers.apiManager.invokeApi('langpack.getStrings', {\n lang_pack: App.langPack,\n lang_code: langCode,\n keys: strings\n });\n }\n\n export function formatLocalStrings(strings: any, pushTo: LangPackString[] = []) {\n for(const i in strings) {\n // @ts-ignore\n const v = strings[i];\n if(typeof(v) === 'string') {\n pushTo.push({\n _: 'langPackString',\n key: i,\n value: v\n });\n } else {\n pushTo.push({\n _: 'langPackStringPluralized',\n key: i,\n ...v\n });\n }\n }\n\n return pushTo;\n }\n\n export function getLangPack(langCode: string, web?: boolean) {\n setLangCode(langCode);\n return loadLangPack(langCode, web).then(([langPack1, langPack2, localLangPack1, localLangPack2, countries, _]) => {\n let strings: LangPackString[] = [];\n\n [localLangPack1, localLangPack2].forEach((l) => {\n formatLocalStrings(l.default as any, strings);\n });\n\n strings = strings.concat(...[langPack1.strings, langPack2.strings].filter(Boolean));\n\n langPack1.strings = strings;\n langPack1.countries = countries;\n return saveLangPack(langPack1);\n });\n }\n\n export function saveLangPack(langPack: LangPackDifference) {\n langPack.appVersion = App.langPackVersion;\n\n return stateStorage.set({langPack}).then(() => {\n applyLangPack(langPack);\n return langPack;\n });\n }\n\n export const polyfillPromise = (function checkIfPolyfillNeeded() {\n if(typeof(Intl) !== 'undefined' && typeof(Intl.PluralRules) !== 'undefined'/* && false */) {\n return Promise.resolve();\n } else {\n return import('./pluralPolyfill').then((_Intl) => {\n (window as any).Intl = Object.assign(typeof(Intl) !== 'undefined' ? Intl : {}, _Intl.default);\n });\n }\n })();\n\n export function applyLangPack(langPack: LangPackDifference) {\n const currentLangCode = lastRequestedLangCode;\n if(langPack.lang_code !== currentLangCode) {\n return;\n }\n\n try {\n pluralRules = new Intl.PluralRules(lastRequestedNormalizedLangCode);\n } catch(err) {\n console.error('pluralRules error', err);\n pluralRules = new Intl.PluralRules(lastRequestedNormalizedLangCode.split('-', 1)[0]);\n }\n\n try {\n pluralRules = new Intl.PluralRules(langPack.lang_code);\n } catch(err) {\n console.error('pluralRules error', err);\n pluralRules = new Intl.PluralRules(langPack.lang_code.split('-', 1)[0]);\n }\n\n strings.clear();\n\n for(const string of langPack.strings) {\n strings.set(string.key as LangPackKey, string);\n }\n\n if(langPack.countries) {\n countriesList.length = 0;\n countriesList.push(...langPack.countries.countries);\n\n langPack.countries.countries.forEach((country) => {\n if(country.name) {\n const langPackKey: any = country.default_name;\n strings.set(langPackKey, {\n _: 'langPackString',\n key: langPackKey,\n value: country.name\n });\n }\n });\n }\n\n if(lastAppliedLangCode !== currentLangCode) {\n rootScope.dispatchEvent('language_change', currentLangCode);\n lastAppliedLangCode = currentLangCode;\n cachedDateTimeFormats.clear();\n updateAmPm();\n }\n\n const elements = Array.from(document.querySelectorAll(`.i18n`)) as HTMLElement[];\n elements.forEach((element) => {\n const instance = weakMap.get(element);\n\n if(instance) {\n instance.update();\n }\n });\n }\n\n function pushNextArgument(out: ReturnType, args: FormatterArguments, indexHolder: {i: number}) {\n const arg = args[indexHolder.i++];\n if(Array.isArray(arg)) {\n out.push(...arg as any);\n } else {\n out.push(arg);\n }\n }\n\n export function superFormatter(input: string, args?: FormatterArguments, indexHolder = {i: 0}): Exclude[] {\n const out: ReturnType = [];\n const regExp = /(\\*\\*|__)(.+?)\\1|(\\n)|(\\[.+?\\]\\(.*?\\))|un\\d|%\\d\\$.|%./g;\n\n let lastIndex = 0;\n input.replace(regExp, (match, p1: any, p2: any, p3: any, p4: string, offset: number, string: string) => {\n // console.table({match, p1, p2, offset, string});\n\n out.push(string.slice(lastIndex, offset));\n\n if(p1) {\n // offset += p1.length;\n let element: HTMLElement;\n switch(p1) {\n case '**': {\n element = document.createElement('b');\n break;\n }\n\n case '__': {\n element = document.createElement('i');\n break;\n }\n }\n\n element.append(...superFormatter(p2, args, indexHolder) as any);\n out.push(element);\n } else if(p3) {\n out.push(document.createElement('br'));\n } else if(p4) {\n const idx = p4.lastIndexOf(']');\n const text = p4.slice(1, idx);\n\n const url = p4.slice(idx + 2, p4.length - 1);\n let a: HTMLAnchorElement;\n if(url && matchUrlProtocol(url)) {\n a = document.createElement('a');\n const wrappedUrl = wrapUrl(url);\n a.href = wrappedUrl.url;\n if(wrappedUrl.onclick) a.setAttribute('onclick', wrappedUrl.onclick);\n a.target = '_blank';\n } else {\n a = args[indexHolder.i++] as HTMLAnchorElement;\n\n if(a instanceof DocumentFragment) { // right after wrapRichText\n a = a.firstChild as any;\n }\n\n if(typeof(a) !== 'string') {\n a.textContent = ''; // reset content\n }\n }\n\n const formatted = superFormatter(text, args, indexHolder) as any;\n if(typeof(a) === 'string') {\n out.push(...formatted);\n } else {\n a.append(...formatted);\n out.push(a);\n }\n } else if(args) {\n pushNextArgument(out, args, indexHolder);\n }\n\n lastIndex = offset + match.length;\n return '';\n });\n\n if(lastIndex !== input.length) {\n out.push(input.slice(lastIndex));\n }\n\n return out;\n }\n\n export function format(key: LangPackKey, plain: true, args?: FormatterArguments): string;\n export function format(key: LangPackKey, plain?: false, args?: FormatterArguments): ReturnType;\n export function format(key: LangPackKey, plain = false, args?: FormatterArguments): ReturnType | string {\n const str = strings.get(key);\n let input: string;\n if(str) {\n if(str._ === 'langPackStringPluralized' && args?.length) {\n let v = args[0] as number | string;\n if(typeof(v) === 'string') v = +v.replace(/\\D/g, '');\n const s = pluralRules.select(v);\n // @ts-ignore\n input = str[s + '_value'] || str['other_value'];\n } else if(str._ === 'langPackString') {\n input = str.value;\n } else {\n // input = '[' + key + ']';\n input = key;\n }\n } else {\n // input = '[' + key + ']';\n input = key;\n }\n\n const result = superFormatter(input, args);\n if(plain) { // * let's try a hack now... (don't want to replace []() entity)\n return result.map((item) => item instanceof Node ? item.textContent : item).join('');\n } else {\n return result;\n }\n\n /* if(plain) {\n if(args?.length) {\n const regExp = /un\\d|%\\d\\$.|%./g;\n let i = 0;\n input = input.replace(regExp, (match, offset, string) => {\n return '' + args[i++];\n });\n }\n\n return input;\n } else {\n return superFormatter(input, args);\n } */\n }\n\n export const weakMap: WeakMap> = new WeakMap();\n\n export type IntlElementBaseOptions = {\n element?: HTMLElement,\n property?: 'innerText' | 'innerHTML' | 'placeholder' | 'textContent',\n };\n\n abstract class IntlElementBase {\n public element: IntlElementBaseOptions['element'];\n public property: IntlElementBaseOptions['property'];\n\n constructor(options?: Options) {\n this.element = options?.element || document.createElement('span');\n this.element.classList.add('i18n');\n\n this.property = options?.property;\n if(options && ((options as any as IntlElementOptions).key || (options as any as IntlDateElementOptions).date)) {\n this.update(options);\n }\n\n weakMap.set(this.element, this);\n }\n\n abstract update(options?: Options): void;\n }\n\n export type IntlElementOptions = IntlElementBaseOptions & {\n key?: LangPackKey,\n args?: FormatterArguments\n };\n export class IntlElement extends IntlElementBase {\n public key: IntlElementOptions['key'];\n public args: IntlElementOptions['args'];\n\n constructor(options: IntlElementOptions = {}) {\n super({...options, property: options.property ?? 'innerHTML'});\n }\n\n public update(options?: IntlElementOptions) {\n safeAssign(this, options);\n\n if(this.property === 'innerHTML') {\n this.element.textContent = '';\n this.element.append(...format(this.key, false, this.args) as any);\n } else {\n // @ts-ignore\n const v = this.element[this.property];\n const formatted = format(this.key, true, this.args);\n\n // * hasOwnProperty won't work here\n if(v === undefined) this.element.dataset[this.property] = formatted;\n else (this.element as HTMLInputElement)[this.property] = formatted;\n }\n }\n\n public compareAndUpdate(options?: IntlElementOptions) {\n if(this.key === options.key && deepEqual(this.args, options.args)) {\n return;\n }\n\n return this.update(options);\n }\n }\n\n const cachedDateTimeFormats: Map = new Map();\n function getDateTimeFormat(options: Intl.DateTimeFormatOptions = {}) {\n const json = JSON.stringify(options);\n let dateTimeFormat = cachedDateTimeFormats.get(json);\n if(!dateTimeFormat) {\n dateTimeFormat = new Intl.DateTimeFormat(lastRequestedNormalizedLangCode + '-u-hc-' + timeFormat, options);\n cachedDateTimeFormats.set(json, dateTimeFormat);\n }\n\n return dateTimeFormat;\n }\n\n export let amPmCache = {am: 'AM', pm: 'PM'};\n export type IntlDateElementOptions = IntlElementBaseOptions & {\n date?: Date,\n options: Intl.DateTimeFormatOptions\n };\n export class IntlDateElement extends IntlElementBase {\n public date: IntlDateElementOptions['date'];\n public options: IntlDateElementOptions['options'];\n\n constructor(options: IntlDateElementOptions) {\n super({...options, property: options.property ?? 'textContent'});\n setDirection(this.element);\n }\n\n public update(options?: IntlDateElementOptions) {\n safeAssign(this, options);\n\n let text: string;\n if(this.options.hour && this.options.minute && Object.keys(this.options).length === 2/* && false */) {\n const hours = this.date.getHours();\n text = ('0' + (timeFormat === 'h12' ? (hours % 12) || 12 : hours)).slice(-2) + ':' + ('0' + this.date.getMinutes()).slice(-2);\n // if(this.options.second) {\n // text += ':' + ('0' + this.date.getSeconds()).slice(-2);\n // }\n\n if(timeFormat === 'h12') {\n text += ' ' + (hours < 12 ? amPmCache.am : amPmCache.pm);\n }\n } else {\n // * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle#adding_an_hour_cycle_via_the_locale_string\n const dateTimeFormat = getDateTimeFormat(this.options);\n text = capitalizeFirstLetter(dateTimeFormat.format(this.date));\n }\n\n (this.element as any)[this.property] = text;\n }\n }\n\n export function i18n(key: LangPackKey, args?: FormatterArguments) {\n return new IntlElement({key, args}).element;\n }\n\n export function i18n_(options: IntlElementOptions) {\n return new IntlElement(options).element;\n }\n\n export function _i18n(element: HTMLElement, key: LangPackKey, args?: FormatterArguments, property?: IntlElementOptions['property']) {\n return new IntlElement({element, key, args, property}).element;\n }\n}\n\nexport {I18n};\nexport default I18n;\n\nconst i18n = I18n.i18n;\nexport {i18n};\n\nconst i18n_ = I18n.i18n_;\nexport {i18n_};\n\nconst _i18n = I18n._i18n;\nexport {_i18n};\n\nexport function joinElementsWith(elements: (Node | string)[], joiner: typeof elements[0] | ((isLast: boolean) => typeof elements[0])) {\n const arr = elements.slice(0, 1);\n for(let i = 1; i < elements.length; ++i) {\n const isLast = (elements.length - 1) === i;\n arr.push(typeof(joiner) === 'function' ? joiner(isLast) : joiner);\n arr.push(elements[i]);\n }\n\n return arr;\n}\n\n\nexport function join(elements: (Node | string)[], useLast: boolean, plain: true): string;\nexport function join(elements: (Node | string)[], useLast?: boolean, plain?: false): (string | Node)[];\nexport function join(elements: (Node | string)[], useLast: boolean, plain: boolean): string | (string | Node)[];\nexport function join(elements: (Node | string)[], useLast = true, plain?: boolean): string | (string | Node)[] {\n const joined = joinElementsWith(elements, (isLast) => {\n const langPackKey: LangPackKey = isLast && useLast ? 'AutoDownloadSettings.LastDelimeter' : 'AutoDownloadSettings.Delimeter';\n return plain ? I18n.format(langPackKey, true) : i18n(langPackKey);\n });\n\n return plain ? joined.join('') : joined;\n}\n\nMOUNT_CLASS_TO.I18n = I18n;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDialogFilter} from '../storages/filters';\n\n/**\n * Legacy Webogram's format, don't change dcID to camelCase. date is timestamp\n */\nexport type UserAuth = {dcID: number | string, date: number, id: PeerId};\nexport type REAL_FOLDER_ID = 0 | 1;\n\nexport const NULL_PEER_ID: PeerId = 0;\nexport const REPLIES_PEER_ID: PeerId = 1271266957;\nexport const REPLIES_HIDDEN_CHANNEL_ID: ChatId = 777;\nexport const SERVICE_PEER_ID: PeerId = 777000;\nexport const MUTE_UNTIL = 0x7FFFFFFF;\nexport const BOT_START_PARAM = '';\nexport const MAX_FILE_SAVE_SIZE = 20 * 1024 * 1024;\nexport const THUMB_TYPE_FULL = '';\nexport const TOPIC_COLORS = [0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, 0xFB6F5F];\nexport const ATTACH_MENU_BOT_ICON_NAME = 'default_static';\nexport const GENERAL_TOPIC_ID = 4295032831;\nexport const T_ME_PREFIXES = new Set(['web', 'k', 'z']);\n\nexport const FOLDER_ID_ALL: REAL_FOLDER_ID = 0;\nexport const FOLDER_ID_ARCHIVE: REAL_FOLDER_ID = 1;\nexport const REAL_FOLDERS: Set = new Set([FOLDER_ID_ALL, FOLDER_ID_ARCHIVE]);\nexport const START_LOCAL_ID = Math.max(...Array.from(REAL_FOLDERS)) + 1 as MyDialogFilter['localId'];\n","import IS_CALL_SUPPORTED from './callSupport';\nimport CAN_USE_TRANSFERABLES from './canUseTransferables';\nimport IS_CANVAS_FILTER_SUPPORTED from './canvasFilterSupport';\nimport IS_EMOJI_SUPPORTED from './emojiSupport';\nimport IS_GEOLOCATION_SUPPORTED from './geolocationSupport';\nimport IS_GROUP_CALL_SUPPORTED from './groupCallSupport';\nimport IMAGE_MIME_TYPES_SUPPORTED from './imageMimeTypesSupport';\nimport MEDIA_MIME_TYPES_SUPPORTED from './mediaMimeTypesSupport';\nimport IS_MOV_SUPPORTED from './movSupport';\nimport IS_PARALLAX_SUPPORTED from './parallaxSupport';\nimport IS_SCREEN_SHARING_SUPPORTED from './screenSharingSupport';\nimport IS_TOUCH_SUPPORTED from './touchSupport';\nimport IS_VIBRATE_SUPPORTED from './vibrateSupport';\nimport VIDEO_MIME_TYPES_SUPPORTED from './videoMimeTypesSupport';\nimport IS_WEBM_SUPPORTED from './webmSupport';\nimport IS_WEBP_SUPPORTED from './webpSupport';\nimport IS_WEBRTC_SUPPORTED from './webrtcSupport';\nimport * as userAgent from './userAgent';\nimport IS_OPUS_SUPPORTED from './opusSupport';\nimport IS_SHARED_WORKER_SUPPORTED from './sharedWorkerSupport';\nimport IS_APPLE_MX from './appleMx';\n\nconst ENVIRONMENT = {\n CAN_USE_TRANSFERABLES,\n IS_APPLE_MX,\n IS_CALL_SUPPORTED,\n IS_CANVAS_FILTER_SUPPORTED,\n IS_EMOJI_SUPPORTED,\n IS_GEOLOCATION_SUPPORTED,\n IS_GROUP_CALL_SUPPORTED,\n IS_MOV_SUPPORTED,\n IS_PARALLAX_SUPPORTED,\n IS_SCREEN_SHARING_SUPPORTED,\n IS_TOUCH_SUPPORTED,\n IS_VIBRATE_SUPPORTED,\n IS_OPUS_SUPPORTED,\n IS_SHARED_WORKER_SUPPORTED,\n IS_WEBM_SUPPORTED,\n IS_WEBP_SUPPORTED,\n IS_WEBRTC_SUPPORTED,\n IMAGE_MIME_TYPES_SUPPORTED,\n MEDIA_MIME_TYPES_SUPPORTED,\n VIDEO_MIME_TYPES_SUPPORTED,\n ...userAgent\n};\n\nexport default ENVIRONMENT;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport App from '../../../../config/app';\nimport DEBUG from '../../../../config/debug';\nimport {AutoDownloadPeerTypeSettings, State, STATE_INIT, Background, AppTheme} from '../../../../config/state';\nimport compareVersion from '../../../../helpers/compareVersion';\nimport copy from '../../../../helpers/object/copy';\nimport validateInitObject from '../../../../helpers/object/validateInitObject';\nimport {UserAuth} from '../../../mtproto/mtproto_config';\nimport rootScope from '../../../rootScope';\nimport stateStorage from '../../../stateStorage';\nimport sessionStorage from '../../../sessionStorage';\nimport {recordPromiseBound} from '../../../../helpers/recordPromise';\n// import RESET_STORAGES_PROMISE from \"../storages/resetStoragesPromise\";\nimport {StoragesResults} from '../storages/loadStorages';\nimport {logger} from '../../../logger';\nimport {WallPaper} from '../../../../layer';\n\nconst REFRESH_EVERY = 24 * 60 * 60 * 1000; // 1 day\n// const REFRESH_EVERY = 1e3;\n// const REFRESH_EVERY_WEEK = 24 * 60 * 60 * 1000 * 7; // 7 days\n\nconst STATE_VERSION = STATE_INIT.version;\nconst BUILD = STATE_INIT.build;\n\nconst ALL_KEYS = Object.keys(STATE_INIT) as any as Array;\n\nconst REFRESH_KEYS: Array = [\n 'contactsListCachedTime',\n 'stateCreatedTime',\n 'maxSeenMsgId',\n 'filtersArr'\n];\n\n// const REFRESH_KEYS_WEEK = ['dialogs', 'allDialogsLoaded', 'updates', 'pinnedOrders'] as any as Array;\n\nasync function loadStateInner() {\n const log = logger('STATE-LOADER');\n\n const totalPerf = performance.now();\n const recordPromise = recordPromiseBound(log);\n\n const promises = ALL_KEYS.map((key) => recordPromise(stateStorage.get(key), 'state ' + key))\n .concat(\n recordPromise(sessionStorage.get('user_auth'), 'auth'),\n recordPromise(sessionStorage.get('state_id'), 'auth'),\n recordPromise(sessionStorage.get('k_build'), 'auth')\n )\n .concat(recordPromise(stateStorage.get('user_auth'), 'old auth')); // support old webk format\n\n const arr = await Promise.all(promises);\n log.warn('promises', performance.now() - totalPerf);\n // await new Promise((resolve) => setTimeout(resolve, 3e3));\n /* const self = this;\n const skipHandleKeys = new Set(['isProxy', 'filters', 'drafts']);\n const getHandler = (path?: string) => {\n return {\n get(target: any, key: any) {\n if(key === 'isProxy') {\n return true;\n }\n\n const prop = target[key];\n\n if(prop !== undefined && !skipHandleKeys.has(key) && !prop.isProxy && typeof(prop) === 'object') {\n target[key] = new Proxy(prop, getHandler(path || key));\n return target[key];\n }\n\n return prop;\n },\n set(target: any, key: any, value: any) {\n console.log('Setting', target, `.${key} to equal`, value, path);\n\n target[key] = value;\n\n // @ts-ignore\n self.pushToState(path || key, path ? self.state[path] : value, false);\n\n return true;\n }\n };\n }; */\n\n // const pushed: {key: keyof State, value: State[keyof State]}[] = [];\n const pushedKeys: (keyof State)[] = [];\n const pushToState = (key: T, value: State[T]) => {\n // appStateManager.pushToState(key, value);\n state[key] = value;\n // pushed.push({key, value});\n pushedKeys.push(key);\n };\n\n const replaceState = (_state: State) => {\n // pushed.length = 0;\n pushedKeys.length = 0;\n state = _state;\n pushedKeys.push(...Object.keys(state) as any as typeof pushedKeys);\n // state = appStateManager.setState(_state);\n // appStateManager.storage.set(state);\n };\n\n // let state: State = appStateManager.setState({} as any);\n let state: State = {} as any;\n\n // ! then can't store false values\n for(let i = 0, length = ALL_KEYS.length; i < length; ++i) {\n const key = ALL_KEYS[i];\n const value = arr[i];\n if(value !== undefined) {\n // @ts-ignore\n state[key] = value;\n } else {\n pushToState(key, copy(STATE_INIT[key]));\n }\n }\n\n arr.splice(0, ALL_KEYS.length);\n\n // * Read auth\n let auth = arr.shift() as UserAuth | number;\n const stateId = arr.shift() as number;\n const sessionBuild = arr.shift() as number;\n const shiftedWebKAuth = arr.shift() as UserAuth | number;\n if(!auth && shiftedWebKAuth) { // support old webk auth\n auth = shiftedWebKAuth;\n const keys: string[] = ['dc', 'server_time_offset', 'xt_instance'];\n for(let i = 1; i <= 5; ++i) {\n keys.push(`dc${i}_server_salt`);\n keys.push(`dc${i}_auth_key`);\n }\n\n const values = await Promise.all(keys.map((key) => stateStorage.get(key as any)));\n keys.push('user_auth');\n values.push(typeof(auth) === 'number' || typeof(auth) === 'string' ? {dcID: values[0] || App.baseDcId, date: Date.now() / 1000 | 0, id: auth.toPeerId(false)} as UserAuth : auth);\n\n const obj: any = {};\n keys.forEach((key, idx) => {\n obj[key] = values[idx];\n });\n\n await sessionStorage.set(obj);\n }\n\n /* if(!auth) { // try to read Webogram's session from localStorage\n try {\n const keys = Object.keys(localStorage);\n for(let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n let value: any;\n try {\n value = localStorage.getItem(key);\n value = JSON.parse(value);\n } catch(err) {\n //console.error(err);\n }\n\n sessionStorage.set({\n [key as any]: value\n });\n }\n\n auth = sessionStorage.getFromCache('user_auth');\n } catch(err) {\n this.log.error('localStorage import error', err);\n }\n } */\n\n if(auth) {\n // ! Warning ! DON'T delete this\n state.authState = {_: 'authStateSignedIn'};\n rootScope.dispatchEvent('user_auth', typeof(auth) === 'number' || typeof(auth) === 'string' ?\n {dcID: 0, date: Date.now() / 1000 | 0, id: auth.toPeerId(false)} :\n auth); // * support old version\n }\n\n const resetStorages: Set = new Set();\n if(state.stateId !== stateId) {\n if(stateId !== undefined) {\n const preserve: Map = new Map([\n ['authState', undefined],\n ['stateId', undefined]\n ]);\n\n preserve.forEach((_, key) => {\n preserve.set(key, copy(state[key]));\n });\n\n state = copy(STATE_INIT);\n\n preserve.forEach((value, key) => {\n // @ts-ignore\n state[key] = value;\n });\n\n const r: {[k in keyof StoragesResults]: number} = {\n chats: 1,\n dialogs: 1,\n users: 1\n };\n for(const key in r) {\n resetStorages.add(key as keyof StoragesResults);\n // this.storagesResults[key as keyof AppStateManager['storagesResults']].length = 0;\n }\n\n replaceState(state);\n }\n\n await sessionStorage.set({\n state_id: state.stateId\n });\n }\n\n const time = Date.now();\n if((state.stateCreatedTime + REFRESH_EVERY) < time) {\n if(DEBUG) {\n log('will refresh state', state.stateCreatedTime, time);\n }\n\n const r = (keys: typeof REFRESH_KEYS) => {\n keys.forEach((key) => {\n pushToState(key, copy(STATE_INIT[key]));\n\n // const s = appStateManager.storagesResults[key as keyof AppStateManager['storagesResults']];\n // if(s?.length) {\n // appStateManager.resetStorages.add(key as keyof AppStateManager['storagesResults']);\n // s.length = 0;\n // }\n });\n };\n\n r(REFRESH_KEYS);\n\n /* if((state.stateCreatedTime + REFRESH_EVERY_WEEK) < time) {\n if(DEBUG) {\n this.log('will refresh updates');\n }\n\n r(REFRESH_KEYS_WEEK);\n } */\n }\n\n // state = this.state = new Proxy(state, getHandler());\n\n // * migrate auto download settings\n const autoDownloadSettings = state.settings.autoDownload;\n if(autoDownloadSettings?.private !== undefined) {\n const oldTypes = [\n 'contacts' as const,\n 'private' as const,\n 'groups' as const,\n 'channels' as const\n ];\n\n const mediaTypes = [\n 'photo' as const,\n 'video' as const,\n 'file' as const\n ];\n\n mediaTypes.forEach((mediaType) => {\n const peerTypeSettings: AutoDownloadPeerTypeSettings = autoDownloadSettings[mediaType] = {} as any;\n oldTypes.forEach((peerType) => {\n peerTypeSettings[peerType] = autoDownloadSettings[peerType];\n });\n });\n\n oldTypes.forEach((peerType) => {\n delete autoDownloadSettings[peerType];\n });\n\n pushToState('settings', state.settings);\n }\n\n const SKIP_VALIDATING_PATHS: Set = new Set([\n 'settings.themes'\n ]);\n validateInitObject(STATE_INIT, state, (missingKey) => {\n pushToState(missingKey as keyof State, state[missingKey as keyof State]);\n }, undefined, SKIP_VALIDATING_PATHS);\n\n let newVersion: string, oldVersion: string;\n if(state.version !== STATE_VERSION || state.build !== BUILD/* || true */) {\n // reset filters and dialogs if version is older\n if(/* compareVersion(state.version, '0.8.7') === -1 || state.build < 179 || */state.build < 217) {\n state.allDialogsLoaded = copy(STATE_INIT.allDialogsLoaded);\n state.pinnedOrders = copy(STATE_INIT.pinnedOrders);\n state.filtersArr = copy(STATE_INIT.filtersArr);\n\n resetStorages.add('dialogs');\n }\n\n if(compareVersion(state.version, '1.7.1') === -1) {\n let migrated = false;\n // * migrate backgrounds (March 13, 2022; to version 1.3.0)\n if(compareVersion(state.version, '1.3.0') === -1) {\n migrated = true;\n state.settings.theme = copy(STATE_INIT.settings.theme);\n state.settings.themes = copy(STATE_INIT.settings.themes);\n } else if(compareVersion(state.version, '1.7.1') === -1) { // * migrate backgrounds (January 25th, 2023; to version 1.7.1)\n migrated = true;\n const oldThemes = state.settings.themes as any as Array<{\n name: AppTheme['name'],\n background: Background\n }>;\n\n state.settings.themes = copy(STATE_INIT.settings.themes);\n\n try {\n oldThemes.forEach((oldTheme) => {\n const oldBackground = oldTheme.background;\n if(!oldBackground) {\n return;\n }\n\n const newTheme = state.settings.themes.find((t) => t.name === oldTheme.name);\n newTheme.settings.highlightningColor = oldBackground.highlightningColor;\n\n const getColorFromHex = (hex: string) => hex && parseInt(hex.slice(1), 16);\n\n const colors = (oldBackground.color || '').split(',').map(getColorFromHex);\n\n if(oldBackground.color && !oldBackground.slug) {\n newTheme.settings.wallpaper = {\n _: 'wallPaperNoFile',\n id: 0,\n pFlags: {},\n settings: {\n _: 'wallPaperSettings',\n pFlags: {}\n }\n };\n } else {\n const wallPaper: WallPaper.wallPaper = {\n _: 'wallPaper',\n id: 0,\n access_hash: 0,\n slug: oldBackground.slug,\n document: {} as any,\n pFlags: {},\n settings: {\n _: 'wallPaperSettings',\n pFlags: {}\n }\n };\n\n const wallPaperSettings = wallPaper.settings;\n newTheme.settings.wallpaper = wallPaper;\n if(oldBackground.slug && !oldBackground.color) {\n wallPaperSettings.pFlags.blur = oldBackground.blur || undefined;\n } else if(oldBackground.intensity) {\n wallPaperSettings.intensity = oldBackground.intensity;\n wallPaper.pFlags.pattern = true;\n wallPaper.pFlags.dark = oldBackground.intensity < 0 || undefined;\n }\n }\n\n if(colors.length) {\n const wallPaperSettings = newTheme.settings.wallpaper.settings;\n wallPaperSettings.background_color = colors[0];\n wallPaperSettings.second_background_color = colors[1];\n wallPaperSettings.third_background_color = colors[2];\n wallPaperSettings.fourth_background_color = colors[3];\n }\n });\n } catch(err) {\n console.error('migrating themes error', err);\n }\n }\n\n if(migrated) {\n pushToState('settings', state.settings);\n }\n }\n\n if(state.build < 309) {\n state.settings.liteMode.animations = !state.settings.animationsEnabled;\n state.settings.liteMode.video = !state.settings.autoPlay.videos;\n state.settings.liteMode.gif = !state.settings.autoPlay.gifs;\n }\n\n if(state.build < 312 && typeof(state.settings.stickers.suggest) === 'boolean') {\n state.settings.stickers.suggest = state.settings.stickers.suggest ? 'all' : 'none';\n }\n\n if(compareVersion(state.version, STATE_VERSION) !== 0) {\n newVersion = STATE_VERSION;\n oldVersion = state.version;\n }\n\n pushToState('version', STATE_VERSION);\n pushToState('build', BUILD);\n }\n\n if(sessionBuild !== BUILD && (!sessionBuild || sessionBuild < BUILD)) {\n sessionStorage.set({k_build: BUILD});\n }\n\n // ! probably there is better place for it\n rootScope.settings = state.settings;\n\n if(DEBUG) {\n log('state res', state, copy(state));\n }\n\n // return resolve();\n\n log.warn('total', performance.now() - totalPerf);\n\n // RESET_STORAGES_PROMISE.resolve(appStateManager.resetStorages);\n\n return {state, resetStorages, newVersion, oldVersion, pushedKeys};\n}\n\nlet promise: ReturnType;\nexport default function loadState() {\n return promise ??= loadStateInner();\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Awaited} from '../../types';\nimport type {CacheStorageDbName} from '../files/cacheStorage';\nimport type {State} from '../../config/state';\nimport type {Message, MessagePeerReaction, PeerNotifySettings} from '../../layer';\nimport {CryptoMethods} from '../crypto/crypto_methods';\nimport rootScope from '../rootScope';\nimport webpWorkerController from '../webp/webpWorkerController';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport sessionStorage from '../sessionStorage';\nimport webPushApiManager from './webPushApiManager';\nimport appRuntimeManager from '../appManagers/appRuntimeManager';\nimport telegramMeWebManager from './telegramMeWebManager';\nimport pause from '../../helpers/schedulers/pause';\nimport ENVIRONMENT from '../../environment';\nimport loadState from '../appManagers/utils/state/loadState';\nimport opusDecodeController from '../opusDecodeController';\nimport MTProtoMessagePort from './mtprotoMessagePort';\nimport cryptoMessagePort from '../crypto/cryptoMessagePort';\nimport SuperMessagePort from './superMessagePort';\nimport IS_SHARED_WORKER_SUPPORTED from '../../environment/sharedWorkerSupport';\nimport toggleStorages from '../../helpers/toggleStorages';\nimport idleController from '../../helpers/idleController';\nimport ServiceMessagePort from '../serviceWorker/serviceMessagePort';\nimport App from '../../config/app';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\n\nexport type Mirrors = {\n state: State\n};\n\nexport type MirrorTaskPayload = {\n name: T,\n key?: K,\n value: any\n};\n\nexport type NotificationBuildTaskPayload = {\n message: Message.message | Message.messageService,\n fwdCount?: number,\n peerReaction?: MessagePeerReaction,\n peerTypeNotifySettings?: PeerNotifySettings\n};\n\nexport type TabState = {\n chatPeerIds: PeerId[],\n idleStartTime: number,\n};\n\nclass ApiManagerProxy extends MTProtoMessagePort {\n // private worker: /* Window */Worker;\n // private sockets: Map = new Map();\n private mirrors: Mirrors;\n\n public newVersion: string;\n public oldVersion: string;\n\n private tabState: TabState;\n\n public share: ShareData;\n\n public serviceMessagePort: ServiceMessagePort;\n private lastServiceWorker: ServiceWorker;\n\n private pingServiceWorkerPromise: CancellablePromise;\n\n constructor() {\n super();\n\n this.mirrors = {} as any;\n this.tabState = {\n chatPeerIds: [],\n idleStartTime: 0\n };\n\n this.log('constructor');\n\n \n this.registerWorker();\n \n\n this.registerServiceWorker();\n this.registerCryptoWorker();\n\n // const perf = performance.now();\n this.addMultipleEventsListeners({\n convertWebp: ({fileName, bytes}) => {\n return webpWorkerController.convert(fileName, bytes);\n },\n\n convertOpus: ({fileName, bytes}) => {\n return opusDecodeController.pushDecodeTask(bytes, false).then((result) => result.bytes);\n },\n\n event: ({name, args}) => {\n // @ts-ignore\n rootScope.dispatchEventSingle(name, ...args);\n },\n\n localStorageProxy: (payload) => {\n const storageTask = payload;\n return (sessionStorage[storageTask.type] as any)(...storageTask.args);\n },\n\n mirror: this.onMirrorTask\n\n // hello: () => {\n // this.log.error('time hello', performance.now() - perf);\n // }\n });\n\n // this.addTaskListener('socketProxy', (task) => {\n // const socketTask = task.payload;\n // const id = socketTask.id;\n // //console.log('socketProxy', socketTask, id);\n\n // if(socketTask.type === 'send') {\n // const socket = this.sockets.get(id);\n // socket.send(socketTask.payload);\n // } else if(socketTask.type === 'close') { // will remove from map in onClose\n // const socket = this.sockets.get(id);\n // socket.close();\n // } else if(socketTask.type === 'setup') {\n // const socket = new Socket(socketTask.payload.dcId, socketTask.payload.url, socketTask.payload.logSuffix);\n\n // const onOpen = () => {\n // //console.log('socketProxy onOpen');\n // this.postMessage({\n // type: 'socketProxy',\n // payload: {\n // type: 'open',\n // id\n // }\n // });\n // };\n // const onClose = () => {\n // this.postMessage({\n // type: 'socketProxy',\n // payload: {\n // type: 'close',\n // id\n // }\n // });\n\n // socket.removeEventListener('open', onOpen);\n // socket.removeEventListener('close', onClose);\n // socket.removeEventListener('message', onMessage);\n // this.sockets.delete(id);\n // };\n // const onMessage = (buffer: ArrayBuffer) => {\n // this.postMessage({\n // type: 'socketProxy',\n // payload: {\n // type: 'message',\n // id,\n // payload: buffer\n // }\n // });\n // };\n\n // socket.addEventListener('open', onOpen);\n // socket.addEventListener('close', onClose);\n // socket.addEventListener('message', onMessage);\n // this.sockets.set(id, socket);\n // }\n // });\n\n rootScope.addEventListener('language_change', (language) => {\n rootScope.managers.networkerFactory.setLanguage(language);\n });\n\n window.addEventListener('online', () => {\n rootScope.managers.networkerFactory.forceReconnectTimeout();\n });\n\n rootScope.addEventListener('logging_out', () => {\n const toClear: CacheStorageDbName[] = ['cachedFiles', 'cachedStreamChunks'];\n Promise.all([\n toggleStorages(false, true),\n sessionStorage.clear(),\n Promise.race([\n telegramMeWebManager.setAuthorized(false),\n pause(3000)\n ]),\n webPushApiManager.forceUnsubscribe(),\n Promise.all(toClear.map((cacheName) => caches.delete(cacheName)))\n ]).finally(() => {\n appRuntimeManager.reload();\n });\n });\n\n idleController.addEventListener('change', (idle) => {\n this.updateTabStateIdle(idle);\n });\n this.updateTabStateIdle(idleController.isIdle);\n\n this.log('Passing environment:', ENVIRONMENT);\n this.invoke('environment', ENVIRONMENT);\n // this.sendState();\n }\n\n public pingServiceWorkerWithIframe() {\n if(this.pingServiceWorkerPromise) {\n return this.pingServiceWorkerPromise;\n }\n\n const promise = this.pingServiceWorkerPromise = deferredPromise();\n const iframe = document.createElement('iframe');\n iframe.hidden = true;\n const onLoad = () => {\n setTimeout(() => { // ping once in 10 seconds\n this.pingServiceWorkerPromise = undefined;\n }, 10e3);\n\n clearTimeout(timeout);\n iframe.remove();\n iframe.removeEventListener('load', onLoad);\n iframe.removeEventListener('error', onLoad);\n promise.resolve();\n };\n iframe.addEventListener('load', onLoad);\n iframe.addEventListener('error', onLoad);\n iframe.src = 'ping/' + (Math.random() * 0xFFFFFFFF | 0);\n document.body.append(iframe);\n\n const timeout = window.setTimeout(onLoad, 1e3);\n return promise;\n }\n\n private attachServiceWorker(serviceWorker: ServiceWorker) {\n this.lastServiceWorker && this.serviceMessagePort.detachPort(this.lastServiceWorker);\n this.serviceMessagePort.attachSendPort(this.lastServiceWorker = serviceWorker);\n this.serviceMessagePort.invokeVoid('hello', undefined);\n }\n\n private _registerServiceWorker() {\n navigator.serviceWorker.register(\n /* webpackChunkName: \"sw\" */\n new URL('../serviceWorker/index.service', import.meta.url),\n {scope: './'}\n ).then((registration) => {\n this.log('SW registered', registration);\n\n // ! doubtful fix for hard refresh\n if(registration.active && !navigator.serviceWorker.controller) {\n return registration.unregister().then(() => {\n window.location.reload();\n });\n }\n\n const sw = registration.installing || registration.waiting || registration.active;\n sw.addEventListener('statechange', (e) => {\n this.log('SW statechange', e);\n });\n\n const controller = navigator.serviceWorker.controller || registration.installing || registration.waiting || registration.active;\n this.attachServiceWorker(controller);\n\n \n \n \n }, (err) => {\n this.log.error('SW registration failed!', err);\n\n this.invokeVoid('serviceWorkerOnline', false);\n });\n }\n\n private registerServiceWorker() {\n if(!('serviceWorker' in navigator)) return;\n\n this.serviceMessagePort = new ServiceMessagePort();\n\n // this.addMultipleEventsListeners({\n // hello: () => {\n // // this.serviceMessagePort.invokeVoid('port', undefined);\n // }\n // });\n\n // ! I hate webpack - it won't load it by using worker.register, only navigator.serviceWorker will do it.\n const worker = navigator.serviceWorker;\n this._registerServiceWorker();\n\n // worker.startMessages();\n\n worker.addEventListener('controllerchange', () => {\n this.log.warn('controllerchange');\n\n const controller = worker.controller;\n this.attachServiceWorker(controller);\n\n controller.addEventListener('error', (e) => {\n this.log.error('controller error:', e);\n });\n });\n\n \n \n \n this.serviceMessagePort.attachListenPort(worker);\n this.serviceMessagePort.addMultipleEventsListeners({\n port: (payload, source, event) => {\n this.invokeVoid('serviceWorkerPort', undefined, undefined, [event.ports[0]]);\n },\n\n hello: (payload, source) => {\n this.serviceMessagePort.resendLockTask(source);\n },\n\n share: (payload) => {\n this.log('will try to share something');\n this.share = payload;\n }\n });\n \n\n worker.addEventListener('messageerror', (e) => {\n this.log.error('SW messageerror:', e);\n });\n }\n\n private async registerCryptoWorker() {\n const get = (url: string) => {\n return fetch(url).then((response) => response.text()).then((text) => {\n const pathnameSplitted = location.pathname.split('/');\n pathnameSplitted[pathnameSplitted.length - 1] = '';\n const pre = location.origin + pathnameSplitted.join('/');\n text = `\n var originalImportScripts = importScripts; \n importScripts = (url) => {\n console.log('importScripts', url);\n var newUrl = '${pre}' + url.split('/').pop();\n return originalImportScripts(newUrl);\n };\n ${text}`;\n const blob = new Blob([text], {type: 'application/javascript'});\n return blob;\n });\n };\n\n const workerHandler = {\n construct(target: any, args: any): any {\n const url = args[0] + location.search;\n return {url};\n }\n };\n\n const originals = [\n Worker,\n typeof(SharedWorker) !== 'undefined' && SharedWorker\n ].filter(Boolean);\n originals.forEach((w) => window[w.name as any] = new Proxy(w, workerHandler));\n\n const worker: SharedWorker | Worker = new Worker(\n /* webpackChunkName: \"crypto.worker\" */\n new URL('../crypto/crypto.worker.ts', import.meta.url),\n {type: 'module'}\n );\n\n originals.forEach((w) => window[w.name as any] = w as any);\n\n const originalUrl = (worker as any).url;\n\n const createWorker = (url: string) => new constructor(url, {type: 'module'});\n const attachWorkerToPort = (worker: SharedWorker | Worker) => this.attachWorkerToPort(worker, cryptoMessagePort, 'crypto');\n const constructor = IS_SHARED_WORKER_SUPPORTED ? SharedWorker : Worker;\n\n // let cryptoWorkers = workers.length;\n cryptoMessagePort.addEventListener('port', (payload, source, event) => {\n this.invokeVoid('cryptoPort', undefined, undefined, [event.ports[0]]);\n // .then((attached) => {\n // if(!attached && cryptoWorkers-- > 1) {\n // this.log.error('terminating unneeded crypto worker');\n\n // cryptoMessagePort.invokeVoid('terminate', undefined, source);\n // const worker = workers.find((worker) => (worker as SharedWorker).port === source || (worker as any) === source);\n // if((worker as SharedWorker).port) (worker as SharedWorker).port.close();\n // else (worker as Worker).terminate();\n // cryptoMessagePort.detachPort(source);\n // }\n // });\n });\n\n const firstWorker = createWorker(originalUrl);\n attachWorkerToPort(firstWorker);\n\n const blob = await get(originalUrl);\n const urlsPromise = await this.invoke('createProxyWorkerURLs', {originalUrl, blob});\n const workers = urlsPromise.slice(1).map(createWorker);\n workers.forEach(attachWorkerToPort);\n }\n\n \n private registerWorker() {\n // return;\n\n let worker: SharedWorker | Worker;\n if(IS_SHARED_WORKER_SUPPORTED) {\n worker = new SharedWorker(\n /* webpackChunkName: \"mtproto.worker\" */\n new URL('./mtproto.worker.ts', import.meta.url),\n {type: 'module'}\n );\n } else {\n worker = new Worker(\n /* webpackChunkName: \"mtproto.worker\" */\n new URL('./mtproto.worker.ts', import.meta.url),\n {type: 'module'}\n );\n }\n\n this.onWorkerFirstMessage(worker);\n }\n \n\n private attachWorkerToPort(worker: SharedWorker | Worker, messagePort: SuperMessagePort, type: string) {\n const port: MessagePort = (worker as SharedWorker).port || worker as any;\n messagePort.attachPort(port);\n\n worker.addEventListener('error', (err) => {\n this.log.error(type, 'worker error', err);\n });\n }\n\n private onWorkerFirstMessage(worker: any) {\n this.log('set webWorker');\n\n // this.worker = worker;\n \n \n \n this.attachWorkerToPort(worker, this, 'mtproto');\n \n }\n\n private loadState() {\n return Promise.all([\n loadState().then((stateResult) => {\n this.newVersion = stateResult.newVersion;\n this.oldVersion = stateResult.oldVersion;\n this.mirrors['state'] = stateResult.state;\n return stateResult;\n })\n // loadStorages(createStorages()),\n ]);\n }\n\n public sendState() {\n return this.loadState().then((result) => {\n const [stateResult] = result;\n this.invoke('state', {...stateResult, userId: rootScope.myId.toUserId()});\n return result;\n });\n }\n\n \n public invokeCrypto(method: Method, ...args: Parameters): Promise>> {\n return cryptoMessagePort.invokeCrypto(method, ...args);\n }\n \n\n public async toggleStorages(enabled: boolean, clearWrite: boolean) {\n await toggleStorages(enabled, clearWrite);\n this.invoke('toggleStorages', {enabled, clearWrite});\n this.serviceMessagePort.invokeVoid('toggleStorages', {enabled, clearWrite});\n }\n\n public async getMirror(name: T) {\n const mirror = this.mirrors[name];\n return mirror;\n }\n\n public getState() {\n return this.getMirror('state');\n }\n\n public updateTabState(key: T, value: TabState[T]) {\n this.tabState[key] = value;\n this.invokeVoid('tabState', this.tabState);\n }\n\n public updateTabStateIdle(idle: boolean) {\n this.updateTabState('idleStartTime', idle ? Date.now() : 0);\n }\n\n private onMirrorTask = (payload: MirrorTaskPayload) => {\n const {name, key, value} = payload;\n if(!payload.hasOwnProperty('key')) {\n this.mirrors[name] = value;\n return;\n }\n\n const mirror = this.mirrors[name] ??= {} as any;\n if(value === undefined) {\n delete mirror[key];\n } else {\n mirror[key] = value;\n }\n };\n}\n\ninterface ApiManagerProxy extends MTProtoMessagePort {}\n\nconst apiManagerProxy = new ApiManagerProxy();\nMOUNT_CLASS_TO.apiManagerProxy = apiManagerProxy;\nexport default apiManagerProxy;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport App from '../../config/app';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport tabId from '../../config/tabId';\nimport IS_SHARED_WORKER_SUPPORTED from '../../environment/sharedWorkerSupport';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport idleController from '../../helpers/idleController';\nimport {logger} from '../logger';\nimport rootScope from '../rootScope';\nimport sessionStorage from '../sessionStorage';\nimport apiManagerProxy from './mtprotoworker';\n\nexport type AppInstance = {\n id: number,\n idle: boolean,\n time: number\n};\n\nexport type InstanceDeactivateReason = 'version' | 'tabs';\n\nconst CHECK_INSTANCE_INTERVAL = 5000;\nconst DEACTIVATE_TIMEOUT = 30000;\nconst MULTIPLE_TABS_THRESHOLD = 20000;\nconst IS_MULTIPLE_TABS_SUPPORTED = IS_SHARED_WORKER_SUPPORTED;\n\nexport class SingleInstance extends EventListenerBase<{\n activated: () => void,\n deactivated: (reason: InstanceDeactivateReason) => void\n}> {\n private instanceId: number;\n private started: boolean;\n private masterInstance: boolean;\n private deactivateTimeout: number;\n private deactivated: InstanceDeactivateReason;\n private log = logger('INSTANCE');\n\n constructor() {\n super(false);\n\n this.log = logger('INSTANCE');\n this.instanceId = tabId;\n }\n\n public get deactivatedReason() {\n return this.deactivated;\n }\n\n public start() {\n this.reset();\n\n if(!this.started/* && !Config.Navigator.mobile && !Config.Modes.packed */) {\n this.started = true;\n\n idleController.addEventListener('change', this.checkInstance);\n setInterval(this.checkInstance, CHECK_INSTANCE_INTERVAL);\n this.checkInstance();\n\n try {\n document.documentElement.addEventListener('beforeunload', this.clearInstance);\n } catch(e) {}\n }\n }\n\n private reset() {\n this.masterInstance = false;\n this.clearDeactivateTimeout();\n this.deactivated = undefined;\n }\n\n private clearInstance = () => {\n if(this.masterInstance && !this.deactivated) {\n this.log.warn('clear master instance');\n sessionStorage.delete('xt_instance');\n }\n };\n\n public activateInstance() {\n if(this.deactivated) {\n this.reset();\n this.checkInstance(false);\n this.dispatchEvent('activated');\n }\n }\n\n private deactivateInstance(reason: InstanceDeactivateReason) {\n if(this.masterInstance || this.deactivated) {\n return;\n }\n\n this.log.warn('deactivate', reason);\n this.clearDeactivateTimeout();\n this.deactivated = reason;\n\n this.dispatchEvent('deactivated', reason);\n }\n\n private clearDeactivateTimeout() {\n if(this.deactivateTimeout) {\n clearTimeout(this.deactivateTimeout);\n this.deactivateTimeout = 0;\n }\n }\n\n private checkInstance = async(idle = idleController.isIdle) => {\n if(this.deactivated) {\n return;\n }\n\n const time = Date.now();\n const newInstance: AppInstance = {\n id: this.instanceId,\n idle,\n time\n };\n\n const [curInstance, build = App.build] = await Promise.all([\n sessionStorage.get('xt_instance', false),\n sessionStorage.get('k_build', false)\n ]);\n\n if(build > App.build) {\n this.masterInstance = false;\n rootScope.managers.networkerFactory.stopAll();\n this.deactivateInstance('version');\n apiManagerProxy.toggleStorages(false, false);\n return;\n } else if(IS_MULTIPLE_TABS_SUPPORTED) {\n sessionStorage.set({xt_instance: newInstance});\n return;\n }\n\n // this.log('check instance', newInstance, curInstance)\n if(!idle ||\n !curInstance ||\n curInstance.id === this.instanceId ||\n curInstance.time < (time - MULTIPLE_TABS_THRESHOLD)) {\n sessionStorage.set({xt_instance: newInstance});\n\n if(!this.masterInstance) {\n this.masterInstance = true;\n rootScope.managers.networkerFactory.startAll();\n this.log.warn('now master instance', newInstance);\n }\n\n this.clearDeactivateTimeout();\n } else if(this.masterInstance) {\n this.masterInstance = false;\n rootScope.managers.networkerFactory.stopAll();\n this.log.warn('now idle instance', newInstance);\n this.deactivateTimeout ||= window.setTimeout(() => this.deactivateInstance('tabs'), DEACTIVATE_TIMEOUT);\n }\n };\n}\n\nconst singleInstance = new SingleInstance();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.singleInstance = singleInstance);\nexport default singleInstance;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport App from '../../config/app';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport Modes from '../../config/modes';\nimport loadScript from '../../helpers/dom/loadScript';\nimport tsNow from '../../helpers/tsNow';\nimport sessionStorage from '../sessionStorage';\n\nexport class TelegramMeWebManager {\n private disabled = /* false && */(Modes.test || !App.domains.includes(location.hostname));\n\n public setAuthorized(canRedirect: boolean) {\n if(this.disabled) {\n return;\n }\n\n return sessionStorage.get('tgme_sync').then((curValue) => {\n const ts = tsNow(true);\n if(\n canRedirect &&\n curValue?.canRedirect === canRedirect &&\n (curValue.ts + 86400) > ts\n ) {\n return;\n }\n\n sessionStorage.set({\n tgme_sync: {\n canRedirect,\n ts\n }\n });\n\n const path = `_websync_?authed=${canRedirect ? '1' : '0'}&version=${encodeURIComponent(App.version + ' ' + App.suffix)}`;\n const urls = [\n '//telegram.me/' + path,\n '//t.me/' + path\n ];\n\n const promises = urls.map((url) => {\n return loadScript(url).then((script) => {\n script.remove();\n });\n });\n\n return Promise.all(promises);\n });\n }\n}\n\nconst telegramMeWebManager = new TelegramMeWebManager();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.telegramMeWebManager = telegramMeWebManager);\nexport default telegramMeWebManager;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function loadScript(url: string) {\n const script = document.createElement('script');\n const promise = new Promise((resolve) => {\n script.onload = script.onerror = () => {\n resolve(script);\n };\n });\n script.src = url;\n document.body.appendChild(script);\n return promise;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {PushNotificationObject} from '../serviceWorker/push';\nimport type {ServicePushPingTaskPayload} from '../serviceWorker/serviceMessagePort';\nimport type {NotificationSettings} from '../appManagers/uiNotificationsManager';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport {logger} from '../logger';\nimport apiManagerProxy from './mtprotoworker';\nimport I18n, {LangPackKey} from '../langPack';\nimport {IS_MOBILE} from '../../environment/userAgent';\nimport appRuntimeManager from '../appManagers/appRuntimeManager';\nimport copy from '../../helpers/object/copy';\nimport singleInstance from './singleInstance';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport getServerMessageId from '../appManagers/utils/messageId/getServerMessageId';\n\nexport type PushSubscriptionNotifyType = 'init' | 'subscribe' | 'unsubscribe';\nexport type PushSubscriptionNotifyEvent = `push_${PushSubscriptionNotifyType}`;\n\nexport type PushSubscriptionNotify = {\n tokenType: number,\n tokenValue: string\n};\n\nconst PING_PUSH_INTERVAL = 10000;\n\nexport class WebPushApiManager extends EventListenerBase<{\n push_notification_click: (n: PushNotificationObject) => void,\n push_init: (n: PushSubscriptionNotify) => void,\n push_subscribe: (n: PushSubscriptionNotify) => void,\n push_unsubscribe: (n: PushSubscriptionNotify) => void\n}> {\n public isAvailable = true;\n private isPushEnabled = false;\n private localNotificationsAvailable = true;\n private started = false;\n private settings: NotificationSettings & {baseUrl?: string} = {} as any;\n private isAliveTO: any;\n private isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n private userVisibleOnly = this.isFirefox ? false : true;\n private log = logger('PM');\n\n constructor() {\n super(false);\n\n if(!('PushManager' in window) ||\n !('Notification' in window) ||\n !('serviceWorker' in navigator)) {\n this.log.warn('Push messaging is not supported.');\n this.isAvailable = false;\n this.localNotificationsAvailable = false;\n }\n\n if(this.isAvailable && Notification.permission === 'denied') {\n this.log.warn('The user has blocked notifications.');\n }\n }\n\n public start() {\n if(!this.started) {\n this.started = true;\n this.getSubscription();\n this.setUpServiceWorkerChannel();\n }\n }\n\n public setLocalNotificationsDisabled() {\n this.localNotificationsAvailable = false;\n }\n\n public getSubscription() {\n if(!this.isAvailable) {\n return;\n }\n\n navigator.serviceWorker.ready.then((reg) => {\n reg.pushManager.getSubscription().then((subscription) => {\n this.isPushEnabled = !!subscription;\n this.pushSubscriptionNotify('init', subscription);\n }).catch((err) => {\n this.log.error('Error during getSubscription()', err);\n });\n });\n }\n\n public subscribe = () => {\n if(!this.isAvailable) {\n return;\n }\n\n navigator.serviceWorker.ready.then((reg) => {\n reg.pushManager.subscribe({userVisibleOnly: this.userVisibleOnly}).then((subscription) => {\n // The subscription was successful\n this.isPushEnabled = true;\n this.pushSubscriptionNotify('subscribe', subscription);\n }).catch((e) => {\n if(Notification.permission === 'denied') {\n this.log('Permission for Notifications was denied');\n } else {\n this.log('Unable to subscribe to push.', e);\n if(!this.userVisibleOnly) {\n this.userVisibleOnly = true;\n setTimeout(this.subscribe, 0);\n }\n }\n });\n });\n }\n\n public unsubscribe() {\n if(!this.isAvailable) {\n return;\n }\n\n navigator.serviceWorker.ready.then((reg) => {\n reg.pushManager.getSubscription().then((subscription) => {\n this.isPushEnabled = false;\n\n if(subscription) {\n this.pushSubscriptionNotify('unsubscribe', subscription);\n\n setTimeout(() => {\n subscription.unsubscribe().then((successful) => {\n this.isPushEnabled = false;\n }).catch((e) => {\n this.log.error('Unsubscription error: ', e);\n });\n }, 3000);\n }\n }).catch((e) => {\n this.log.error('Error thrown while unsubscribing from ' +\n 'push messaging.', e);\n });\n });\n }\n\n public forceUnsubscribe() {\n if(!this.isAvailable) {\n return;\n }\n\n navigator.serviceWorker.ready.then((reg) => {\n reg.pushManager.getSubscription().then((subscription) => {\n this.log.warn('force unsubscribe', subscription);\n if(subscription) {\n subscription.unsubscribe().then((successful) => {\n this.log.warn('force unsubscribe successful', successful);\n this.isPushEnabled = false;\n }).catch((e) => {\n this.log.error('Unsubscription error: ', e);\n });\n }\n }).catch((e) => {\n this.log.error('Error thrown while unsubscribing from ' +\n 'push messaging.', e);\n });\n });\n }\n\n public isAliveNotify = () => {\n if(!this.isAvailable || singleInstance.deactivatedReason) {\n return;\n }\n\n this.settings.baseUrl = (location.href || '').replace(/#.*$/, '');\n\n const lang: ServicePushPingTaskPayload['lang'] = {} as any;\n const ACTIONS_LANG_MAP: Record = {\n push_action_mute1d: IS_MOBILE ? 'PushNotification.Action.Mute1d.Mobile' : 'PushNotification.Action.Mute1d',\n push_action_settings: IS_MOBILE ? 'PushNotification.Action.Settings.Mobile' : 'PushNotification.Action.Settings',\n push_message_nopreview: 'PushNotification.Message.NoPreview'\n };\n\n for(const action in ACTIONS_LANG_MAP) {\n lang[action as keyof typeof ACTIONS_LANG_MAP] = I18n.format(ACTIONS_LANG_MAP[action as keyof typeof ACTIONS_LANG_MAP], true);\n }\n\n apiManagerProxy.serviceMessagePort.invokeVoid('pushPing', {\n localNotifications: this.localNotificationsAvailable,\n lang: lang,\n settings: this.settings\n });\n\n this.isAliveTO = setTimeout(this.isAliveNotify, PING_PUSH_INTERVAL);\n }\n\n public setSettings(newSettings: WebPushApiManager['settings']) {\n this.settings = copy(newSettings);\n clearTimeout(this.isAliveTO);\n this.isAliveNotify();\n }\n\n public hidePushNotifications() {\n if(!this.isAvailable) {\n return;\n }\n\n apiManagerProxy.serviceMessagePort.invokeVoid('notificationsClear', undefined);\n }\n\n public setUpServiceWorkerChannel() {\n if(!this.isAvailable) {\n return;\n }\n\n apiManagerProxy.serviceMessagePort.addEventListener('pushClick', (payload) => {\n if(singleInstance.deactivatedReason) {\n appRuntimeManager.reload();\n return;\n }\n\n this.dispatchEvent('push_notification_click', payload);\n });\n\n navigator.serviceWorker.ready.then(this.isAliveNotify);\n }\n\n public pushSubscriptionNotify(event: PushSubscriptionNotifyType, subscription?: PushSubscription) {\n if(subscription) {\n const subscriptionObj: PushSubscriptionJSON = subscription.toJSON();\n if(!subscriptionObj ||\n !subscriptionObj.endpoint ||\n !subscriptionObj.keys ||\n !subscriptionObj.keys.p256dh ||\n !subscriptionObj.keys.auth) {\n this.log.warn('Invalid push subscription', subscriptionObj);\n this.unsubscribe();\n this.isAvailable = false;\n this.pushSubscriptionNotify(event);\n return;\n }\n\n this.log.warn('Push', event, subscriptionObj);\n this.dispatchEvent(('push_' + event) as PushSubscriptionNotifyEvent, {\n tokenType: 10,\n tokenValue: JSON.stringify(subscriptionObj)\n });\n } else {\n this.log.warn('Push', event, false);\n this.dispatchEvent(('push_' + event) as PushSubscriptionNotifyEvent, false as any);\n }\n }\n\n public ignorePushByMid(peerId: PeerId, mid: number) {\n if(!this.isAvailable) {\n return;\n }\n\n apiManagerProxy.serviceMessagePort.invokeVoid('shownNotification', peerId + '_' + getServerMessageId(mid));\n }\n}\n\nconst webPushApiManager = new WebPushApiManager();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.webPushApiManager = webPushApiManager);\nexport default webPushApiManager;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport IS_OPUS_SUPPORTED from '../environment/opusSupport';\nimport {IS_SAFARI} from '../environment/userAgent';\nimport {Modify} from '../types';\nimport {logger, LogTypes} from './logger';\nimport apiManagerProxy from './mtproto/mtprotoworker';\nimport type {ConvertWebPTask} from './webp/webpWorkerController';\n\ntype Result = {\n bytes: Uint8Array,\n waveform?: Uint8Array\n};\n\ntype Task = {\n pages: Uint8Array,\n withWaveform: boolean,\n waveform?: Uint8Array,\n callback: {resolve: (result: Result) => void, reject: (err: any) => void},\n timeout: number\n};\n\nexport interface ConvertOpusTask extends Modify {\n type: 'convertOpus'\n}\n\nexport class OpusDecodeController {\n private worker: Worker;\n private wavWorker: Worker;\n private sampleRate = 48000;\n private tasks: Array = [];\n private keepAlive = false;\n private log = logger('OPUS', LogTypes.Error);\n\n public isPlaySupported() {\n return IS_OPUS_SUPPORTED;\n }\n\n public loadWavWorker() {\n if(this.wavWorker) return;\n\n this.wavWorker = new Worker('waveWorker.min.js');\n this.wavWorker.addEventListener('message', (e) => {\n const data = e.data;\n\n this.log('[WAV] got message:', data);\n if(data && data.page) {\n const bytes = data.page;\n this.onTaskEnd(this.tasks.shift(), bytes);\n }\n });\n }\n\n public loadWorker() {\n if(this.worker) return;\n\n this.worker = new Worker('decoderWorker.min.js');\n this.worker.addEventListener('message', (e) => {\n const data = e.data;\n\n this.log('[DECODER] got message', data);\n if(data.type === 'done') {\n // this.log('[DECODER] send done to wav');\n this.wavWorker.postMessage({command: 'done'});\n\n if(data.waveform) {\n this.tasks[0].waveform = data.waveform;\n }\n } else { // e.data contains decoded buffers as float32 values\n // this.log('[DECODER] send encode to wav');\n this.wavWorker.postMessage({\n command: 'encode',\n buffers: e.data\n }, IS_SAFARI ? undefined : data.map((typedArray: Uint8Array) => typedArray.buffer));\n }\n });\n }\n\n public setKeepAlive(keepAlive: boolean) {\n this.keepAlive = keepAlive;\n if(this.keepAlive) {\n this.loadWorker();\n this.loadWavWorker();\n } else if(!this.tasks.length) {\n this.terminateWorkers();\n }\n }\n\n public onTaskEnd(task: Task, result?: Uint8Array) {\n if(!result) {\n task.callback.reject('timeout');\n } else {\n clearTimeout(task.timeout);\n task.callback.resolve({bytes: result, waveform: task.waveform});\n }\n\n if(this.tasks.length) {\n this.executeNewTask(this.tasks[0]);\n }\n\n this.terminateWorkers();\n }\n\n public terminateWorkers(kill = false) {\n if((this.keepAlive || this.tasks.length) && !kill) return;\n\n if(this.worker) {\n this.worker.terminate();\n this.worker = null;\n }\n\n if(this.wavWorker) {\n this.wavWorker.terminate();\n this.wavWorker = null;\n }\n }\n\n public executeNewTask(task: Task) {\n this.worker.postMessage({\n command: 'init',\n decoderSampleRate: this.sampleRate,\n outputBufferSampleRate: this.sampleRate\n });\n\n this.wavWorker.postMessage({\n command: 'init',\n wavBitDepth: 16,\n wavSampleRate: this.sampleRate\n });\n\n // console.log('sending command to worker:', task);\n // setTimeout(() => {\n this.log('[DECODER] send decode');\n this.worker.postMessage({\n command: 'decode',\n pages: task.pages,\n waveform: task.withWaveform\n }, IS_SAFARI ? undefined : [task.pages.buffer]);\n // }, 1e3);\n\n task.timeout = window.setTimeout(() => {\n this.log.error('decode timeout'/* , task */);\n\n this.terminateWorkers(true);\n if(this.tasks.length) {\n this.loadWorker();\n this.loadWavWorker();\n }\n\n this.onTaskEnd(this.tasks.shift());\n }, 10e3);\n }\n\n public pushDecodeTask(pages: Uint8Array, withWaveform: boolean) {\n return new Promise((resolve, reject) => {\n const task = {\n pages,\n withWaveform,\n callback: {resolve, reject},\n timeout: 0\n };\n\n this.loadWorker();\n this.loadWavWorker();\n\n if(this.tasks.push(task) === 1) {\n this.executeNewTask(task);\n }\n });\n }\n\n public async decode(typedArray: Uint8Array, withWaveform = false) {\n return this.pushDecodeTask(typedArray, withWaveform).then(async(result) => {\n const dataBlob = new Blob([result.bytes], {type: 'audio/wav'});\n return {url: await apiManagerProxy.invoke('createObjectURL', dataBlob), waveform: result.waveform};\n });\n }\n}\n\nconst opusDecodeController = new OpusDecodeController();\nMOUNT_CLASS_TO.opusDecodeController = opusDecodeController;\nexport default opusDecodeController;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport emojiRegExp from '../../vendor/emoji/regex';\nimport {MessageEntity} from '../../layer';\n\nconst EmojiHelper = {\n emojiMap: (code: string) => { return code; },\n shortcuts: [] as any,\n emojis: [] as any\n};\n\nexport const ALPHA_CHARS_REG_EXP = 'a-z' +\n '\\\\u00c0-\\\\u00d6\\\\u00d8-\\\\u00f6\\\\u00f8-\\\\u00ff' + // Latin-1\n '\\\\u0100-\\\\u024f' + // Latin Extended A and B\n '\\\\u0253\\\\u0254\\\\u0256\\\\u0257\\\\u0259\\\\u025b\\\\u0263\\\\u0268\\\\u026f\\\\u0272\\\\u0289\\\\u028b' + // IPA Extensions\n '\\\\u02bb' + // Hawaiian\n '\\\\u0300-\\\\u036f' + // Combining diacritics\n '\\\\u1e00-\\\\u1eff' + // Latin Extended Additional (mostly for Vietnamese)\n '\\\\u0400-\\\\u04ff\\\\u0500-\\\\u0527' + // Cyrillic\n '\\\\u2de0-\\\\u2dff\\\\ua640-\\\\ua69f' + // Cyrillic Extended A/B\n '\\\\u0591-\\\\u05bf\\\\u05c1-\\\\u05c2\\\\u05c4-\\\\u05c5\\\\u05c7' +\n '\\\\u05d0-\\\\u05ea\\\\u05f0-\\\\u05f4' + // Hebrew\n '\\\\ufb1d-\\\\ufb28\\\\ufb2a-\\\\ufb36\\\\ufb38-\\\\ufb3c\\\\ufb3e\\\\ufb40-\\\\ufb41' +\n '\\\\ufb43-\\\\ufb44\\\\ufb46-\\\\ufb4f' + // Hebrew Pres. Forms\n '\\\\u0610-\\\\u061a\\\\u0620-\\\\u065f\\\\u066e-\\\\u06d3\\\\u06d5-\\\\u06dc' +\n '\\\\u06de-\\\\u06e8\\\\u06ea-\\\\u06ef\\\\u06fa-\\\\u06fc\\\\u06ff' + // Arabic\n '\\\\u0750-\\\\u077f\\\\u08a0\\\\u08a2-\\\\u08ac\\\\u08e4-\\\\u08fe' + // Arabic Supplement and Extended A\n '\\\\ufb50-\\\\ufbb1\\\\ufbd3-\\\\ufd3d\\\\ufd50-\\\\ufd8f\\\\ufd92-\\\\ufdc7\\\\ufdf0-\\\\ufdfb' + // Pres. Forms A\n '\\\\ufe70-\\\\ufe74\\\\ufe76-\\\\ufefc' + // Pres. Forms B\n '\\\\u200c' + // Zero-Width Non-Joiner\n '\\\\u0e01-\\\\u0e3a\\\\u0e40-\\\\u0e4e' + // Thai\n '\\\\u1100-\\\\u11ff\\\\u3130-\\\\u3185\\\\uA960-\\\\uA97F\\\\uAC00-\\\\uD7AF\\\\uD7B0-\\\\uD7FF' + // Hangul (Korean)\n '\\\\u3003\\\\u3005\\\\u303b' + // Kanji/Han iteration marks\n '\\\\uff21-\\\\uff3a\\\\uff41-\\\\uff5a' + // full width Alphabet\n '\\\\uff66-\\\\uff9f' + // half width Katakana\n '\\\\uffa1-\\\\uffdc'; // half width Hangul (Korean)\nexport const ALPHA_NUMERIC_REG_EXP = '0-9\\_' + ALPHA_CHARS_REG_EXP;\nexport const DOMAIN_ADD_CHARS = '\\u00b7';\n// Based on Regular Expression for URL validation by Diego Perini\nexport const URL_ALPHANUMERIC_REG_EXP_PART = '[' + ALPHA_CHARS_REG_EXP + '0-9]';\nexport const URL_PROTOCOL_REG_EXP_PART = '((?:https?|ftp)://|mailto:)?';\nexport const URL_REG_EXP = URL_PROTOCOL_REG_EXP_PART +\n // user:pass authentication\n '(?:' + URL_ALPHANUMERIC_REG_EXP_PART + '{1,64}(?::' + URL_ALPHANUMERIC_REG_EXP_PART + '{0,64})?@)?' +\n '(?:' +\n // sindresorhus/ip-regexp\n '(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}' +\n '|' +\n // host name\n URL_ALPHANUMERIC_REG_EXP_PART + '[' + ALPHA_CHARS_REG_EXP + DOMAIN_ADD_CHARS + '0-9\\-]{0,64}' +\n // domain name\n '(?:\\\\.' + URL_ALPHANUMERIC_REG_EXP_PART + '[' + ALPHA_CHARS_REG_EXP + DOMAIN_ADD_CHARS + '0-9\\-]{0,64}){0,10}' +\n // TLD identifier\n '(?:\\\\.(xn--[0-9a-z]{2,16}|[' + ALPHA_CHARS_REG_EXP + ']{2,24}))' +\n ')' +\n // port number\n '(?::\\\\d{2,5})?' +\n // resource path\n '(?:/(?:\\\\S{0,255}[^\\\\s.;,(\\\\[\\\\]{}<>\"\\'])?)?';\nexport const URL_PROTOCOL_REG_EXP = new RegExp('^' + URL_PROTOCOL_REG_EXP_PART.slice(0, -1), 'i');\nexport const URL_ANY_PROTOCOL_REG_EXP = /^((?:[^\\/]+?):\\/\\/|mailto:)/;\nexport const USERNAME_REG_EXP = '[a-zA-Z\\\\d_]{5,32}';\nexport const TIMESTAMP_REG_EXP = '(?:\\\\s|^)((?:\\\\d{1,2}:)?(?:[0-5]?[0-9]):(?:[0-5][0-9]))(?:\\\\s|$)';\nexport const BOT_COMMAND_REG_EXP = '\\\\/([a-zA-Z\\\\d_]{1,32})(?:@(' + USERNAME_REG_EXP + '))?(\\\\b|$)';\nexport const FULL_REG_EXP = new RegExp('(^| )(@)(' + USERNAME_REG_EXP + ')|(' + URL_REG_EXP + ')|(\\\\n)|(' + emojiRegExp + ')|(^|[\\\\s\\\\(\\\\]])(#[' + ALPHA_NUMERIC_REG_EXP + ']{2,64})|(^|\\\\s)' + BOT_COMMAND_REG_EXP + '|' + TIMESTAMP_REG_EXP + '', 'i');\nexport const EMAIL_REG_EXP = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n// const markdownTestRegExp = /[`_*@~]/;\nexport const MARKDOWN_REG_EXP = /(^|\\s|\\n)(````?)([\\s\\S]+?)(````?)([\\s\\n\\.,:?!;]|$)|(^|\\s|\\x01)(`|~~|\\*\\*|__|_-_|\\|\\|)([^\\n]+?)\\7([\\x01\\s\\.,:?!;]|$)|@(\\d+)\\s*\\((.+?)\\)|(\\[(.+?)\\]\\((.+?)\\))/m;\nexport const SITE_HASHTAGS: {[siteName: string]: string} = {\n 'Telegram': 'tg://search_hashtag?hashtag={1}',\n 'Twitter': 'https://twitter.com/hashtag/{1}',\n 'Instagram': 'https://instagram.com/explore/tags/{1}/',\n 'Google Plus': 'https://plus.google.com/explore/{1}'\n};\n\n// export const SITE_MENTIONS: {[siteName in 'Telegram' | 'Twitter' | 'Instagram' | 'GitHub']: string} = {\n// Telegram: '#{1}',\n// Twitter: 'https://twitter.com/{1}',\n// Instagram: 'https://instagram.com/{1}/',\n// GitHub: 'https://github.com/{1}'\n// };\n\nexport const MARKDOWN_ENTITIES: {[markdown: string]: MessageEntity['_']} = {\n '`': 'messageEntityCode',\n '``': 'messageEntityPre',\n '**': 'messageEntityBold',\n '__': 'messageEntityItalic',\n '~~': 'messageEntityStrike',\n '_-_': 'messageEntityUnderline',\n '||': 'messageEntitySpoiler'\n};\n\nexport const PASS_CONFLICTING_ENTITIES: Set = new Set([\n 'messageEntityEmoji',\n 'messageEntityLinebreak',\n 'messageEntityCaret'\n]);\nfor(const i in MARKDOWN_ENTITIES) {\n PASS_CONFLICTING_ENTITIES.add(MARKDOWN_ENTITIES[i]);\n}\n\nexport const PHONE_NUMBER_REG_EXP = /^\\+\\d+$/;\n\n/* export function parseEmojis(text: string) {\n return text.replace(/:([a-z0-9\\-\\+\\*_]+?):/gi, function (all, shortcut) {\n var emojiCode = EmojiHelper.shortcuts[shortcut]\n if (emojiCode !== undefined) {\n return EmojiHelper.emojis[emojiCode][0]\n }\n return all\n })\n} */\n\n\n/* export function replaceUrlEncodings(urlWithEncoded: string) {\n return urlWithEncoded.replace(/(%[A-Z\\d]{2})+/g, (str) => {\n try {\n return decodeURIComponent(str);\n } catch (e) {\n return str;\n }\n });\n} */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type addAnchorListener from '../../helpers/addAnchorListener';\nimport {PHONE_NUMBER_REG_EXP} from '.';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport matchUrlProtocol from './matchUrlProtocol';\nimport {T_ME_PREFIXES} from '../mtproto/mtproto_config';\n\nexport default function wrapUrl(url: string, unsafe?: number | boolean) {\n if(!matchUrlProtocol(url)) {\n url = 'https://' + url;\n }\n\n const out: {url: string, onclick?: Parameters[0]['name']} = {url};\n let tgMeMatch, telescoPeMatch, tgMatch;\n let onclick: typeof out['onclick'];\n /* if(unsafe === 2) {\n url = 'tg://unsafe_url?url=' + encodeURIComponent(url);\n } else */if((tgMeMatch = url.match(/^(?:https?:\\/\\/)?(?:(.+?)\\.)?(?:(?:web|k|z)\\.)?t(?:elegram)?\\.me(?:\\/(.+))?/))) {\n const u = new URL(url);\n let prefix = tgMeMatch[1];\n if(prefix && T_ME_PREFIXES.has(tgMeMatch[1])) {\n prefix = undefined;\n }\n\n if(prefix) {\n u.pathname = prefix + (u.pathname === '/' ? '' : u.pathname);\n }\n\n const fullPath = u.pathname.slice(1);\n const path = fullPath.split('/');\n\n if(path[0] && path[0][0] === '$' && path[0].length > 1) {\n onclick = 'invoice';\n } else if(/^\\W/.test(fullPath) && !PHONE_NUMBER_REG_EXP.test(fullPath)) { // second regexp is for phone numbers (t.me/+38050...)\n onclick = 'joinchat';\n } else switch(path[0]) {\n case 'joinchat':\n case 'addstickers':\n case 'addemoji':\n case 'voicechat':\n case 'invoice':\n if(path.length !== 1 && !prefix) {\n onclick = path[0];\n break;\n }\n\n default:\n if((path[1] && path[1].match(/^\\d+(?:\\?(?:comment|thread)=\\d+)?$/)) || path.length === 1) {\n onclick = 'im';\n break;\n }\n\n break;\n }\n } else if((telescoPeMatch = url.match(/^(?:https?:\\/\\/)?telesco\\.pe\\/([^/?]+)\\/(\\d+)/))) {\n onclick = 'im';\n } else if((tgMatch = url.match(/tg:(?:\\/\\/)?(.+?)(?:\\?|$)/))) {\n onclick = 'tg_' + tgMatch[1] as any;\n }/* else if(unsafe) {\n url = 'tg://unsafe_url?url=' + encodeURIComponent(url);\n } */\n\n if(!(window as any)[onclick]) {\n onclick = undefined;\n }\n\n out.onclick = onclick;\n return out;\n}\n\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.wrapUrl = wrapUrl);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Message, StickerSet, Update, NotifyPeer, PeerNotifySettings, PollResults, Poll, WebPage, GroupCall, GroupCallParticipant, ReactionCount, MessagePeerReaction, PhoneCall, Config, Reaction} from '../layer';\nimport type {Dialog, ForumTopic, MessagesStorageKey, MyMessage} from './appManagers/appMessagesManager';\nimport type {MyDialogFilter} from './storages/filters';\nimport type {Folder} from './storages/dialogs';\nimport type {UserTyping} from './appManagers/appProfileManager';\nimport type {MyDraftMessage} from './appManagers/appDraftsManager';\nimport type {ConnectionStatusChange} from './mtproto/connectionStatus';\nimport type {GroupCallId} from './appManagers/appGroupCallsManager';\nimport type {AppManagers} from './appManagers/managers';\nimport type {State} from '../config/state';\nimport type {Progress} from './appManagers/appDownloadManager';\nimport type {CallId} from './appManagers/appCallsManager';\nimport type {MyDocument} from './appManagers/appDocsManager';\nimport type {MTAppConfig} from './mtproto/appConfig';\nimport {NULL_PEER_ID, UserAuth} from './mtproto/mtproto_config';\nimport EventListenerBase from '../helpers/eventListenerBase';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport MTProtoMessagePort from './mtproto/mtprotoMessagePort';\nimport {IS_WORKER} from '../helpers/context';\n\nexport type BroadcastEvents = {\n 'chat_full_update': ChatId,\n 'chat_update': ChatId,\n 'chat_toggle_forum': {chatId: ChatId, enabled: boolean},\n 'chat_participant': Update.updateChannelParticipant,\n\n 'channel_update': ChatId,\n\n 'user_update': UserId,\n 'user_auth': UserAuth,\n 'user_full_update': UserId,\n\n 'peer_pinned_messages': {peerId: PeerId, mids?: number[], pinned?: boolean, unpinAll?: true},\n 'peer_pinned_hidden': {peerId: PeerId, maxId: number},\n 'peer_typings': {peerId: PeerId, threadId?: number, typings: UserTyping[]},\n 'peer_block': {peerId: PeerId, blocked: boolean},\n 'peer_title_edit': {peerId: PeerId, threadId?: number},\n 'peer_bio_edit': PeerId,\n 'peer_deleted': PeerId, // left chat, deleted user dialog, left channel\n 'peer_full_update': PeerId,\n\n 'filter_delete': MyDialogFilter,\n 'filter_update': MyDialogFilter,\n 'filter_new': MyDialogFilter,\n 'filter_order': number[],\n\n 'folder_unread': Omit,\n\n 'dialog_draft': {peerId: PeerId, dialog: Dialog | ForumTopic, drop: boolean, draft: MyDraftMessage | undefined},\n 'dialog_unread': {peerId: PeerId, dialog: Dialog | ForumTopic},\n 'dialog_flush': {peerId: PeerId, dialog: Dialog},\n 'dialog_drop': Dialog | ForumTopic,\n 'dialog_migrate': {migrateFrom: PeerId, migrateTo: PeerId},\n // 'dialog_top': Dialog,\n 'dialog_notify_settings': Dialog | ForumTopic,\n // 'dialog_order': {dialog: Dialog, pos: number},\n 'dialogs_multiupdate': Map}>,\n\n 'history_append': {storageKey: MessagesStorageKey, message: Message.message},\n 'history_update': {storageKey: MessagesStorageKey, message: MyMessage, sequential?: boolean},\n 'history_reply_markup': {peerId: PeerId},\n 'history_multiappend': MyMessage,\n 'history_delete': {peerId: PeerId, msgs: Set},\n 'history_forbidden': PeerId,\n 'history_reload': PeerId,\n // 'history_request': void,\n\n 'message_edit': {storageKey: MessagesStorageKey, peerId: PeerId, mid: number, message: MyMessage},\n 'message_sent': {storageKey: MessagesStorageKey, tempId: number, tempMessage: any, mid: number, message: MyMessage},\n 'message_error': {storageKey: MessagesStorageKey, tempId: number, error: ApiError},\n 'message_transcribed': {peerId: PeerId, mid: number, text: string, pending?: boolean},\n 'messages_views': {peerId: PeerId, mid: number, views: number}[],\n 'messages_reactions': {message: Message.message, changedResults: ReactionCount[]}[],\n 'messages_pending': void,\n 'messages_read': void,\n 'messages_downloaded': {peerId: PeerId, mids: number[]},\n 'messages_media_read': {peerId: PeerId, mids: number[]},\n\n 'replies_updated': Message.message,\n\n 'scheduled_new': Message.message,\n 'scheduled_delete': {peerId: PeerId, mids: number[]},\n\n 'album_edit': {peerId: PeerId, groupId: string, deletedMids: number[], messages: Message.message[]},\n\n 'stickers_installed': StickerSet.stickerSet,\n 'stickers_deleted': StickerSet.stickerSet,\n 'stickers_updated': {type: 'recent' | 'faved', stickers: MyDocument[]},\n 'stickers_top': Long,\n 'stickers_order': {type: 'masks' | 'emojis' | 'stickers', order: Long[]},\n 'sticker_updated': {type: 'recent' | 'faved', document: MyDocument, faved: boolean},\n\n 'state_cleared': void,\n 'state_synchronized': ChatId | void,\n 'state_synchronizing': ChatId | void,\n\n 'contacts_update': UserId,\n 'avatar_update': {peerId: PeerId, threadId?: number},\n 'poll_update': {poll: Poll, results: PollResults},\n 'invalidate_participants': ChatId,\n // 'channel_settings': {channelId: number},\n 'webpage_updated': {id: WebPage.webPage['id'], msgs: {peerId: PeerId, mid: number, isScheduled: boolean}[]},\n\n 'connection_status_change': ConnectionStatusChange,\n 'settings_updated': {key: string, value: any, settings: State['settings']},\n 'draft_updated': {peerId: PeerId, threadId: number, draft: MyDraftMessage | undefined, force?: boolean},\n\n 'background_change': void,\n\n 'privacy_update': Update.updatePrivacy,\n\n 'notify_settings': Update.updateNotifySettings,\n 'notify_peer_type_settings': {key: Exclude, settings: PeerNotifySettings},\n\n 'notification_reset': string,\n 'notification_cancel': string,\n\n 'language_change': string,\n\n 'theme_change': void,\n\n 'media_play': void,\n\n 'emoji_recent': AppEmoji,\n\n 'download_progress': Progress,\n 'document_downloading': DocId,\n 'document_downloaded': DocId,\n\n 'choosing_sticker': boolean\n\n 'group_call_update': GroupCall,\n 'group_call_participant': {groupCallId: GroupCallId, participant: GroupCallParticipant},\n // 'group_call_video_track_added': {instance: GroupCallInstance}\n\n 'call_update': PhoneCall,\n 'call_signaling': {callId: CallId, data: Uint8Array},\n\n 'quick_reaction': Reaction,\n\n 'service_notification': Update.updateServiceNotification,\n\n 'logging_out': void,\n\n 'payment_sent': {peerId: PeerId, mid: number, receiptMessage: Message.messageService}\n\n 'premium_toggle': boolean,\n 'premium_toggle_private': {isNew: boolean, isPremium: boolean},\n\n 'config': Config,\n 'app_config': MTAppConfig\n};\n\nexport type BroadcastEventsListeners = {\n [name in keyof BroadcastEvents]: (e: BroadcastEvents[name]) => void\n};\n\nexport class RootScope extends EventListenerBase {\n public myId: PeerId;\n private connectionStatus: {[name: string]: ConnectionStatusChange};\n public settings: State['settings'];\n public managers: AppManagers;\n public premium: boolean;\n\n constructor() {\n super();\n\n this.myId = NULL_PEER_ID;\n this.connectionStatus = {};\n this.premium = false;\n\n this.addEventListener('user_auth', ({id}) => {\n this.myId = id.toPeerId();\n });\n\n this.addEventListener('premium_toggle_private', ({isNew, isPremium}) => {\n this.premium = isPremium;\n this.dispatchEventSingle('premium_toggle', isPremium);\n });\n\n this.addEventListener('connection_status_change', (status) => {\n this.connectionStatus[status.name] = status;\n });\n\n this.dispatchEvent = (e, ...args) => {\n super.dispatchEvent(e, ...args);\n MTProtoMessagePort.getInstance().invokeVoid('event', {name: e as string, args});\n };\n\n if(!IS_WORKER) {\n this.addEventListener('settings_updated', ({settings}) => {\n this.settings = settings;\n });\n }\n }\n\n public getConnectionStatus() {\n return this.connectionStatus;\n }\n\n public getPremium() {\n return this.premium;\n }\n\n public dispatchEventSingle(...args: any[]) {\n // @ts-ignore\n super.dispatchEvent(...args);\n }\n}\n\nconst rootScope = new RootScope();\nMOUNT_CLASS_TO.rootScope = rootScope;\nexport default rootScope;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport {WorkerTaskVoidTemplate} from '../../types';\n\nexport interface ConvertWebPTask extends WorkerTaskVoidTemplate {\n type: 'convertWebp',\n payload: {\n fileName: string,\n bytes: Uint8Array\n }\n};\n\nexport class WebpWorkerController {\n private worker: Worker;\n private convertPromises: {[fileName: string]: CancellablePromise} = {};\n\n private init() {\n this.worker = new Worker(new URL('./webp.worker.ts', import.meta.url));\n this.worker.addEventListener('message', (e) => {\n const task = e.data as ConvertWebPTask;\n const payload = task.payload;\n\n const promise = this.convertPromises[payload.fileName];\n if(promise) {\n payload.bytes ? promise.resolve(payload.bytes) : promise.reject();\n delete this.convertPromises[payload.fileName];\n }\n });\n }\n\n private postMessage(data: ConvertWebPTask) {\n if(this.init) {\n this.init();\n this.init = null;\n }\n\n this.worker.postMessage(data);\n }\n\n public convert(fileName: string, bytes: Uint8Array) {\n if(this.convertPromises.hasOwnProperty(fileName)) {\n return this.convertPromises[fileName];\n }\n\n const convertPromise = deferredPromise();\n\n this.postMessage({type: 'convertWebp', payload: {fileName, bytes}});\n\n return this.convertPromises[fileName] = convertPromise;\n }\n}\n\nconst webpWorkerController = new WebpWorkerController();\nMOUNT_CLASS_TO.webpWorkerController = webpWorkerController;\nexport default webpWorkerController;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + ({\"589\":\"crypto.worker\",\"630\":\"npm.qr-code-styling\",\"670\":\"sw\",\"678\":\"mtproto.worker\"}[chunkId] || chunkId) + \".\" + {\"8\":\"93d2f33af815eb0455aa\",\"53\":\"40d79ab9d14e8d83cf01\",\"61\":\"043c67ed911cb9f8422c\",\"63\":\"7ac6657334217aaadb5b\",\"77\":\"b8cf11d2b5dca36479ca\",\"104\":\"f1b4b4be86382aaf84f5\",\"147\":\"bb5274ee5cc526f48754\",\"231\":\"f4d1bfe6ff7f14577f96\",\"301\":\"95838a8203f23dd1ce8f\",\"339\":\"12bdbede82465e666965\",\"392\":\"6ce981ebdcbba9b6fd04\",\"436\":\"9e54c5e9f3feccf9d736\",\"437\":\"37bcbe9db9cbb8d8a753\",\"442\":\"54c010363ba1cdea7bce\",\"508\":\"864916919938e5f14eb7\",\"589\":\"7fb5055c6558e4a5c265\",\"630\":\"f8f57a1c721e03c3f699\",\"641\":\"527b52a7a5052f57e455\",\"642\":\"be93122d1116ecdc9322\",\"670\":\"a4cbb23cb45b5ad95353\",\"678\":\"44189744893b344288e7\",\"709\":\"c5451446b3485d2557e8\",\"742\":\"4a4829b5ed21258b69e6\",\"776\":\"444edaecf4b03894ef8e\",\"781\":\"c527d73f348ae695f21a\",\"783\":\"949e247466ad3ebe82d6\",\"810\":\"aad7a584f7c8c739c66e\",\"813\":\"315ffd640c7d6013a536\"}[chunkId] + \".chunk.js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","(() => {\n if (typeof __webpack_require__ !== 'undefined') {\n var oldGetScript = __webpack_require__.u;\n var oldLoadScript = __webpack_require__.e;\n var queryMap = {};\n var countMap = {};\n var getRetryDelay = function () {\n return 3000;\n };\n __webpack_require__.u = function (chunkId) {\n var result = oldGetScript(chunkId);\n return (\n result +\n (queryMap.hasOwnProperty(chunkId) ? '?' + queryMap[chunkId] : '')\n );\n };\n __webpack_require__.e = function (chunkId) {\n var result = oldLoadScript(chunkId);\n return result.catch(function (error) {\n var retries = countMap.hasOwnProperty(chunkId)\n ? countMap[chunkId]\n : 999999;\n if (retries < 1) {\n var realSrc = oldGetScript(chunkId);\n error.message =\n 'Loading chunk ' +\n chunkId +\n ' failed after 999999 retries.\\n(' +\n realSrc +\n ')';\n error.request = realSrc;\n throw error;\n }\n return new Promise(function (resolve) {\n var retryAttempt = 999999 - retries + 1;\n setTimeout(function () {\n var retryAttemptString = '&retry-attempt=' + retryAttempt;\n var cacheBust = (function () {\n return Date.now();\n })();\n +retryAttemptString;\n queryMap[chunkId] = cacheBust;\n countMap[chunkId] = retries - 1;\n resolve(__webpack_require__.e(chunkId));\n }, getRetryDelay(retryAttempt));\n });\n });\n };\n }\n})();\n","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = this[\"webpackChunktweb\"] = this[\"webpackChunktweb\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [85,110], () => (__webpack_require__(2938)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","leafPrototypes","getProto","inProgress","dataWebpackPrefix","IS_BETA","DEBUG","MOUNT_CLASS_TO","window","self","STATE_VERSION","BUILD","DEFAULT_THEME","_","access_hash","id","settings","pFlags","base_theme","accent_color","message_colors","wallpaper","default","pattern","document","undefined","slug","intensity","background_color","second_background_color","third_background_color","fourth_background_color","dark","title","emoticon","makeDefaultAppTheme","name","baseTheme","highlightningColor","find","s","STATE_INIT","allDialogsLoaded","pinnedOrders","contactsListCachedTime","updates","filtersArr","maxSeenMsgId","stateCreatedTime","Date","now","recentEmoji","recentCustomEmoji","topPeersCache","recentSearch","version","build","authState","IS_MOBILE","hiddenPinnedMessages","messagesTextSize","distanceUnit","sendShortcut","autoDownload","photo","contacts","private","groups","channels","video","file","autoDownloadNew","file_size_max","video_preload_large","audio_preload_next","photo_size_max","video_size_max","video_upload_maxbitrate","stickers","suggest","dynamicPackOrder","loop","emoji","big","themes","theme","notifications","sound","timeFormat","toLocaleString","match","liteMode","all","animations","chat","chat_background","chat_spoilers","effects","effects_premiumstickers","effects_reactions","effects_emoji","emoji_messages","emoji_panel","gif","stickers_chat","stickers_panel","playbackParams","volume","muted","playbackRate","playbackRates","voice","audio","round","keepSigned","chatContextMenuHintWasShown","stateId","notifySettings","IS_APPLE_MX","ctx","createElement","getContext","extension","getExtension","renderer","getParameter","UNMASKED_RENDERER_WEBGL","getSupportedExtensions","indexOf","err","CAN_USE_TRANSFERABLES","IS_SAFARI","navigator","userAgent","search","geolocation","getCurrentPosition","IMAGE_MIME_TYPES_SUPPORTED","Set","add","arr","concat","canPlayType","IS_APPLE_MOBILE","replace","IS_FIREFOX","mediaDevices","DocumentTouch","USER_AGENT","IS_APPLE","IS_ANDROID","toLowerCase","IS_CHROMIUM","test","vendor","platform","maxTouchPoints","IS_MOBILE_SAFARI","vibrate","VIDEO_MIME_TYPES_SUPPORTED","toDataURL","startsWith","rgbToHsv","r","g","b","v","Math","max","c","min","h","hsvToRgb","f","n","k","rgbaToHsla","a","l","d","hslaToRgba","hue2rgb","p","q","t","map","hexaToRgba","hexa","offset","length","slice","i","push","parseInt","hexToRgb","hex","hexaToHsla","rgba","rgbaToHexa","toString","join","hslaStringToHex","hsla","splitted","split","alpha","pop","val","endsWith","hslaStringToRgba","hslaStringToHexa","mixColors","color1","color2","weight","out","Array","v1","v2","floor","computePerceivedBrightness","color","getAverageColor","getAccentColor","baseHsv","baseColor","elementColor","hsvTemp3","hsvTemp4","dist","changeColorAccent","accentHsv","isDarkTheme","colorHsv","abs","newColor","origBrightness","newBrightness","amountOfNew","amount","changeBrightness","getHexColorFromTelegramColor","repeat","getRgbColorFromTelegramColor","getColorsFromWallPaper","wallPaper","filter","Boolean","compareVersion","s1","s2","blurActiveElement","activeElement","blur","cancelEvent","event","originalEvent","stopPropagation","preventDefault","returnValue","cancelBubble","findUpClassName","el","className","closest","fixSafariStickyInput","input","style","transform","focus","then","IS_STICKY_INPUT_BUGGED","key","startY","o","capture","passive","onTouchMove","e","touch","touches","scrollable","target","y","scrolled","scrollTop","scrollHeight","clientHeight","nextScrollTop","lastFocusOutTimeStamp","addEventListener","classList","contains","timeStamp","touchStart","removeEventListener","fixSafariStickyInputFocusing","callback","cacheInstallPrompt","deferredPrompt","prompt","outcome","userChoice","getInstallPrompt","texts","cache","fonts","text","icons","monospace","loadFonts","types","Promise","resolve","promises","type","_texts","font","weights","_promises","load","race","catch","setInnerHTML","elem","html","setDirection","innerHTML","replaceChildren","setAttribute","FOCUS_EVENT_NAME","IdleController","constructor","super","this","_isIdle","focusPromise","focusResolve","isIdle","once","idle","getFocusPromise","value","dispatchEvent","clamp","OverlayCounter","overlaysActive","isOverlayActive","fastRafCallbacks","fastRaf","requestAnimationFrame","currentCallbacks","forEach","cb","fastRafConventionalCallbacks","rafPromise","processing","fastRafConventional","fastRafPromise","doubleRaf","parseUriParams","uri","parseUriParamsLine","line","params","item","decodeURIComponent","appColorMap","rgb","light","lightFilled","darkRgb","darkFilled","colorMap","day","night","themeController","setTheme","themeColorElem","_themeColorElem","head","querySelector","setThemeColor","themeColor","isNight","setThemeListener","darkModeMediaQuery","matchMedia","checkDarkMode","systemTheme","matches","addListener","applyHighlightningColor","getTheme","documentElement","setProperty","removeProperty","colorScheme","toggle","applyTheme","styleElement","append","textContent","cssText","switchTheme","bindColorApplier","options","appliedColors","applyAppColor","_options","finalize","has","element","lightenAlpha","darkenAlpha","mixColor","appColor","lightenedRgb","darkenedHsla","applyNewTheme","isNightTheme","currentTheme","themeSettings","newAppTheme","AppBackgroundTab","setBackgroundDocument","isArray","baseColors","hsvTemp1","hsvTemp2","newAccentRgb","newAccentHex","messageLightenAlpha","baseMessageColor","baseMessageOutBackgroundColor","myMessagesAccent","nextColor","accentColor2","outbox_accent_color","newMessageOutBackgroundColor","workerHandler","construct","args","url","location","Worker","SharedWorker","w","Proxy","setWorkerProxy","Element","prototype","toggleAttribute","force","hasAttribute","removeAttribute","Node","nodes","rootScope","getProxiedManagers","getElementById","href","singleInstance","visualViewport","lastVH","setViewportVH","setVH","vh","overlayCounter","height","innerHeight","toggleResizeMode","tabId","onImTabChange","wasTabId","tagName","appMediaViewer","onInResize","hasFocus","onOutResize","console","log","perf","performance","langPromise","stateResult","langPack","fadeInWhenFontsReady","promise","opacity","state","isPremium","appVersion","lang_code","dir","hash","tgWebAuthToken","data","token","dcId","tgWebAuthDcId","userId","tgWebAuthUserId","toUserId","isTest","tgWebAuthTest","tgAddr","tgaddr","urlSearchParams","URLSearchParams","set","delete","pagePromise","placeholder","prepend","cloneNode","meModule","pushModule","setAuthorized","forceUnsubscribe","mount","sentCode","authCode","pause","ready","reload","close","DEBUG_MANAGER_REQUESTS","createProxyProxy","proxied","ack","get","receiver","method","warn","createProxy","acknowledged","IDB","db","storageIsAvailable","openDatabase","INSTANCES","isAvailable","createNew","openDbPromise","createIndexes","os","store","indexNames","from","indexName","deleteIndex","indexes","index","createIndex","keyPath","objectParameters","request","indexedDB","open","reject","error","message","finished","setTimeout","onerror","onsuccess","result","calledNew","onclose","onabort","transaction","onversionchange","onupgradeneeded","oldVersion","newVersion","stores","objectStoreNames","objectStore","createObjectStore","static","instance","preserve","storage","IDBStorage","storeName","idb","create","entryName","getObjectStore","clear","save","idx","put","mode","onError","clearTimeout","timeout","onComplete","results","requests","waitForTransactionComplete","oncomplete","callbackResult","left","onRequestFinished","getAll","UNSUPPORTED_LANG_PACK_KEY","I18n","pluralRules","cacheLangPackPromise","setLangCode","langCode","lastRequestedLangCode","lastRequestedNormalizedLangCode","updateAmPm","dateTimeFormat","getDateTimeFormat","hour","minute","hour12","date","setHours","amText","format","amPmCache","am","pmText","pm","loadLocalLangPack","defaultCode","lang","langSign","countries","strings","formatLocalStrings","saveLangPack","from_version","local","loadLangPack","web","requestedServerLanguage","managers","apiManager","invokeApiCacheable","lang_pack","polyfillPromise","pushTo","applyLangPack","currentLangCode","Intl","PluralRules","string","countriesList","country","langPackKey","default_name","lastAppliedLangCode","cachedDateTimeFormats","querySelectorAll","weakMap","update","superFormatter","indexHolder","lastIndex","p1","p2","p3","p4","lastIndexOf","wrappedUrl","onclick","DocumentFragment","firstChild","formatted","arg","pushNextArgument","plain","str","select","Map","isRTL","setRTL","rtl","getCacheLangPack","finally","setTimeFormat","haveToUpdate","IntlDateElement","getStrings","keys","getLangPack","langPack1","langPack2","localLangPack1","localLangPack2","_Intl","Object","assign","WeakMap","IntlElementBase","property","IntlElement","dataset","compareAndUpdate","json","JSON","stringify","DateTimeFormat","hours","getHours","getMinutes","i18n","i18n_","_i18n","joinElementsWith","elements","joiner","isLast","useLast","joined","NULL_PEER_ID","REPLIES_PEER_ID","REPLIES_HIDDEN_CHANNEL_ID","SERVICE_PEER_ID","MUTE_UNTIL","BOT_START_PARAM","MAX_FILE_SAVE_SIZE","THUMB_TYPE_FULL","TOPIC_COLORS","ATTACH_MENU_BOT_ICON_NAME","GENERAL_TOPIC_ID","T_ME_PREFIXES","FOLDER_ID_ALL","FOLDER_ID_ARCHIVE","REAL_FOLDERS","IS_CALL_SUPPORTED","IS_CANVAS_FILTER_SUPPORTED","IS_EMOJI_SUPPORTED","IS_GEOLOCATION_SUPPORTED","IS_GROUP_CALL_SUPPORTED","IS_MOV_SUPPORTED","IS_PARALLAX_SUPPORTED","IS_SCREEN_SHARING_SUPPORTED","IS_TOUCH_SUPPORTED","IS_VIBRATE_SUPPORTED","IS_OPUS_SUPPORTED","IS_SHARED_WORKER_SUPPORTED","IS_WEBM_SUPPORTED","IS_WEBP_SUPPORTED","IS_WEBRTC_SUPPORTED","MEDIA_MIME_TYPES_SUPPORTED","ALL_KEYS","REFRESH_KEYS","loadStateInner","logger","totalPerf","recordPromise","stateStorage","sessionStorage","pushedKeys","pushToState","copy","splice","auth","shift","sessionBuild","shiftedWebKAuth","values","dcID","toPeerId","obj","resetStorages","chats","dialogs","users","_state","state_id","time","autoDownloadSettings","oldTypes","mediaType","peerTypeSettings","peerType","SKIP_VALIDATING_PATHS","validateInitObject","missingKey","migrated","oldThemes","oldTheme","oldBackground","background","newTheme","colors","wallPaperSettings","animationsEnabled","autoPlay","videos","gifs","k_build","ApiManagerProxy","onMirrorTask","payload","hasOwnProperty","mirrors","mirror","tabState","chatPeerIds","idleStartTime","registerWorker","registerServiceWorker","registerCryptoWorker","addMultipleEventsListeners","convertWebp","fileName","bytes","webpWorkerController","convertOpus","opusDecodeController","localStorageProxy","storageTask","language","toggleStorages","telegramMeWebManager","webPushApiManager","cacheName","caches","appRuntimeManager","idleController","updateTabStateIdle","invoke","pingServiceWorkerWithIframe","pingServiceWorkerPromise","iframe","hidden","onLoad","remove","src","random","body","attachServiceWorker","serviceWorker","lastServiceWorker","serviceMessagePort","detachPort","attachSendPort","invokeVoid","_registerServiceWorker","register","URL","scope","registration","active","controller","unregister","installing","waiting","worker","attachListenPort","port","source","ports","hello","resendLockTask","share","originals","originalUrl","createWorker","attachWorkerToPort","cryptoMessagePort","blob","fetch","response","pathnameSplitted","pathname","origin","Blob","onWorkerFirstMessage","messagePort","attachPort","loadState","sendState","invokeCrypto","enabled","clearWrite","getMirror","getState","updateTabState","apiManagerProxy","IS_MULTIPLE_TABS_SUPPORTED","SingleInstance","clearInstance","masterInstance","deactivated","checkInstance","newInstance","instanceId","curInstance","deactivateInstance","xt_instance","clearDeactivateTimeout","deactivateTimeout","deactivatedReason","start","reset","started","setInterval","activateInstance","reason","TelegramMeWebManager","disabled","hostname","canRedirect","curValue","ts","tsNow","tgme_sync","path","encodeURIComponent","script","onload","appendChild","loadScript","WebPushApiManager","isPushEnabled","localNotificationsAvailable","isFirefox","userVisibleOnly","subscribe","reg","pushManager","subscription","pushSubscriptionNotify","Notification","permission","isAliveNotify","baseUrl","ACTIONS_LANG_MAP","push_action_mute1d","push_action_settings","push_message_nopreview","action","localNotifications","isAliveTO","getSubscription","setUpServiceWorkerChannel","setLocalNotificationsDisabled","unsubscribe","successful","setSettings","newSettings","hidePushNotifications","subscriptionObj","toJSON","endpoint","p256dh","tokenType","tokenValue","ignorePushByMid","peerId","mid","sampleRate","tasks","keepAlive","isPlaySupported","loadWavWorker","wavWorker","page","onTaskEnd","loadWorker","postMessage","command","waveform","buffers","typedArray","buffer","setKeepAlive","terminateWorkers","task","executeNewTask","kill","terminate","decoderSampleRate","outputBufferSampleRate","wavBitDepth","wavSampleRate","pages","withWaveform","pushDecodeTask","decode","dataBlob","ALPHA_CHARS_REG_EXP","ALPHA_NUMERIC_REG_EXP","URL_ALPHANUMERIC_REG_EXP_PART","URL_PROTOCOL_REG_EXP_PART","URL_REG_EXP","URL_ANY_PROTOCOL_REG_EXP","RegExp","USERNAME_REG_EXP","BOT_COMMAND_REG_EXP","FULL_REG_EXP","EMAIL_REG_EXP","MARKDOWN_REG_EXP","SITE_HASHTAGS","MARKDOWN_ENTITIES","PASS_CONFLICTING_ENTITIES","PHONE_NUMBER_REG_EXP","wrapUrl","unsafe","tgMeMatch","telescoPeMatch","tgMatch","u","prefix","fullPath","RootScope","myId","connectionStatus","premium","isNew","dispatchEventSingle","status","getConnectionStatus","getPremium","convertPromises","init","convert","convertPromise","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","call","m","O","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","j","every","getter","__esModule","getPrototypeOf","ns","def","current","getOwnPropertyNames","definition","defineProperty","enumerable","chunkId","reduce","miniCssF","globalThis","Function","prop","done","needAttach","scripts","getElementsByTagName","getAttribute","charset","nc","onScriptComplete","prev","doneFns","parentNode","removeChild","bind","Symbol","toStringTag","scriptUrl","importScripts","currentScript","Error","oldGetScript","oldLoadScript","queryMap","countMap","retries","realSrc","cacheBust","baseURI","installedChunks","installedChunkData","errorType","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/public/main.5760f7380bcaa29519f1.css b/public/main.5760f7380bcaa29519f1.css new file mode 100644 index 00000000..e1ec938c --- /dev/null +++ b/public/main.5760f7380bcaa29519f1.css @@ -0,0 +1,4 @@ +/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;line-height:1.15}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{-webkit-text-decoration-skip:objects;background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted currentColor;text-decoration:underline dotted currentColor}b,strong{font-weight:inherit;font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}[hidden],template{display:none}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}ul:not(.browser-default){list-style-type:none;padding-left:0}ul:not(.browser-default)>li{list-style-type:none}a{-webkit-tap-highlight-color:rgba(0,0,0,0)}button{background:none;border:none;cursor:pointer;outline:none;padding:0}img,video{-webkit-user-drag:none}.valign-wrapper{align-items:center;display:flex}.z-depth-0{box-shadow:none!important}.z-depth-1{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2)}.z-depth-1-half{box-shadow:0 3px 3px 0 rgba(0,0,0,.14),0 1px 7px 0 rgba(0,0,0,.12),0 3px 1px -1px rgba(0,0,0,.2)}.z-depth-2{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.3)}.z-depth-3{box-shadow:0 8px 17px 2px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.2)}.z-depth-4{box-shadow:0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12),0 8px 10px -7px rgba(0,0,0,.2)}.z-depth-5{box-shadow:0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12),0 11px 15px -7px rgba(0,0,0,.2)}.hide{display:none!important}.hide-overflow{overflow:hidden}.no-select{-webkit-user-select:none;-moz-user-select:none;user-select:none}.no-transition,.no-transition:after,.no-transition:before{transition:none!important}.inline{display:inline}.center-align,.text-center{text-align:center}.justify-start{justify-content:flex-start!important}.justify-self-start{justify-self:flex-start!important}.justify-self-end{justify-self:flex-end!important}.position-center{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.text-bold{font-weight:500!important}.text-super{display:inline-table}.text-uppercase{text-transform:uppercase}.pre-wrap{white-space:pre-wrap!important}.no-wrap{white-space:nowrap!important}.no-border-radius{border-radius:0!important}.disable-hover{pointer-events:none!important}.reflect-x{transform:scaleX(-1)}[dir=auto]{unicode-bidi:plaintext}.is-rtl [dir=auto]{direction:inherit}a{text-decoration:none}html{font-weight:400;line-height:1.5}h1,h2,h3,h4,h5,h6{line-height:1.3}em{font-style:italic}strong{font-weight:500}small{font-size:75%}code,pre{word-wrap:break-word;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap} +:root{--vh:1vh;--z-below:-1;--hover-alpha:0.08;--transition-standard-easing:cubic-bezier(.4,.0,.2,1);--transition-standard-in-time:.3s;--transition-standard-out-time:.25s;--transition-standard-in:var(--transition-standard-in-time) var(--transition-standard-easing);--transition-standard-out:var(--transition-standard-out-time) var(--transition-standard-easing);--pm-transition:.2s ease-in-out;--layer-transition:.2s cubic-bezier(.4,.0,.2,1);--slide-header-transition:.4s ease-in-out;--tabs-transition:.2s ease-in-out;--btn-menu-transition:.2s cubic-bezier(.4,0,.2,1);--esg-transition:var(--btn-menu-transition);--input-transition:.2s ease-out;--sticker-viewer-open-transition-in:.2s var(--transition-standard-easing);--sticker-viewer-open-transition-out:.2s var(--transition-standard-easing);--sticker-viewer-switch-transition:.2s cubic-bezier(.12,1.1,.56,1.2);--popup-transition-function:cubic-bezier(.4,0,.2,1);--popup-transition-time:.15s;--btn-corner-transition:.2s cubic-bezier(.34,1.56,.64,1);--chatlist-badge-transition-in:.25s cubic-bezier(.35,.35,.47,1.34);--chatlist-badge-transition-out:.25s cubic-bezier(.35,.35,.7,1);--message-handhelds-margin:5.5625rem;--message-beside-button-size:2.375rem;--message-beside-button-margin:calc((var(--message-beside-button-size) + 0.5rem)*-1);--message-time-background:rgba(0,0,0,.35);--message-highlightning-color:rgba(109,141,65,.4);--messages-container-width:728px;--messages-text-size:16px;--messages-line-height:1.3125;--messages-secondary-text-size:calc(var(--messages-text-size) - 2px);--messages-secondary-line-height:calc(var(--messages-secondary-text-size) + 4px);--messages-time-text-size:calc(var(--messages-text-size) - 4px);--messages-service-text-size:calc(var(--messages-text-size) - 1px);--messages-custom-emoji-size:calc(var(--messages-text-size) + 4px);--bubble-transition-in:transform var(--transition-standard-in),opacity var(--transition-standard-in);--bubble-transition-out:transform var(--transition-standard-out),opacity var(--transition-standard-out);--line-height-20:26px;--line-height-16:21px;--line-height-14:18px;--line-height-12:16px;--line-height:1.3125;--font-size-20:20px;--font-size-16:16px;--font-size-14:14px;--font-size-12:12px;--font-size:var(--font-size-16);--esg-sticker-size:72px;--esg-custom-emoji-size:36px;--popup-sticker-size:80px;--disabled-opacity:.3;--round-video-size:280px;--menu-box-shadow:0px 0px 10px var(--menu-box-shadow-color);--menu-backdrop-filter:blur(50px);--font-monospace:"Roboto Mono",monospace;--font-weight-bold:500;--font-weight-normal:400;--selection-background-color:rgba(var(--primary-color-rgb),.4);--selection-color:inherit;--topbar-floating-scaleX:1;--topbar-call-height:3rem;--topbar-floating-call-height:0px;--call-button-size:3.375rem;--call-button-margin:2rem;--custom-emoji-size:1.25rem;--esg-width:100%;--peer-avatar-red-top:#ff845e;--peer-avatar-red-bottom:#d45246;--peer-avatar-orange-top:#febb5b;--peer-avatar-orange-bottom:#f68136;--peer-avatar-violet-top:#b694f9;--peer-avatar-violet-bottom:#6c61df;--peer-avatar-green-top:#9ad164;--peer-avatar-green-bottom:#46ba43;--peer-avatar-cyan-top:#53edd6;--peer-avatar-cyan-bottom:#28c9b7;--peer-avatar-blue-top:#5bcbe3;--peer-avatar-blue-bottom:#359ad4;--peer-avatar-pink-top:#ff8aac;--peer-avatar-pink-bottom:#d95574;--peer-avatar-archive-top:#b8c2cc;--peer-avatar-archive-bottom:#9eaab5;--peer-avatar-saved-top:var(--light-filled-saved-color);--peer-avatar-saved-bottom:var(--saved-color);--avatar-color-top:var(--peer-avatar-saved-top);--avatar-color-bottom:var(--peer-avatar-saved-bottom);--avatar-border-radius-forum:37%;--premium-gradient:linear-gradient(52.62deg,#6b93ff 12.22%,#976fff 50.25%,#e46ace 98.83%)}@media only screen and (max-width:600px){:root{--right-column-width:100vw;--esg-sticker-size:68px;--popup-sticker-size:68px;--round-video-size:200px;--chat-input-size:2.875rem;--chat-input-padding:0.5rem;--chat-input-inner-padding:0.25rem}}@media only screen and (min-width:601px){:root{--right-column-width:420px;--chat-input-size:3.375rem;--chat-input-padding:0.8125rem;--chat-input-inner-padding:0.5rem}}@media only screen and (max-height:569px){:root{--chat-input-size:2.875rem;--chat-input-inner-padding:0.25rem}}@media only screen and (min-height:570px)and (min-width:601px){:root{--esg-width:23.875rem}}@media only screen and (min-width:1276px)and (max-width:1680px){:root{--right-column-width:25vw}}:root{--body-background-color:#fff;--background-color-true:#f4f4f5;--background-color:var(--background-color-true);--border-color:#dfe1e5;--scrollbar-color:rgba(0,0,0,.2);--section-box-shadow-color:rgba(0,0,0,.06);--menu-box-shadow-color:rgba(0,0,0,.15);--input-search-background-color:#fff;--input-search-border-color:#dfe1e5;--secondary-color:#c4c9cc;--avatar-online-color:var(--primary-color);--chatlist-status-color:var(--avatar-online-color);--chatlist-pinned-color:#a2abb2;--badge-text-color:#fff;--link-color:#00488f;--ripple-color:rgba(0,0,0,.08);--poll-circle-color:var(--border-color);--spoiler-background-color:#e3e5e8;--spoiler-draft-background-color:#d9d9d9;--monospace-text-color:var(--danger-color);--backdrop-opacity:.85;--menu-background-color:rgba(var(--surface-color-rgb),var(--backdrop-opacity));--message-background-color:var(--surface-color);--message-time-color:var(--secondary-text-color);--message-checkbox-color:#61c642;--message-checkbox-border-color:#fff;--message-primary-color:var(--primary-color);--light-filled-message-primary-color:var(--light-filled-primary-color);--message-secondary-color:var(--secondary-color);--message-error-color:var(--danger-color);--message-out-link-color:var(--link-color);--message-out-status-color:var(--message-out-primary-color);--message-out-time-color:var(--message-out-status-color);--message-out-audio-play-button-color:#fff;--message-out-selection-background-color:var(--selection-background-color);--gc-background-color:#212121;--gc-button-leave-color:rgba(255,89,90,.3);--gc-button-unmuted-color:rgba(1,200,80,.2);--gc-button-muted-color:rgba(60,135,247,.2);--gc-button-hand-color:rgba(223,68,184,.2);--gc-button-unmuted-fill-color:#195530;--gc-button-muted-fill-color:#3c87f7;--gc-green-color:#195530;--gc-blue-color:#3c87f7;--gc-red-color:#643333;--gc-primary-text-color:#fff;--gc-secondary-text-color:#aaa;--gc-green-text-color:#5cc85e;--gc-blue-text-color:#3390ec;--gc-red-text-color:#ff595a;--gc-right-column-width:26.25rem}.night{--body-background-color:#181818;--background-color-true:#181818;--background-color:var(--background-color-true);--border-color:#0f0f0f;--scrollbar-color:hsla(0,0%,100%,.2);--section-box-shadow-color:rgba(0,0,0,.12);--input-search-background-color:#181818;--input-search-border-color:#2f2f2f;--secondary-color:#707579;--avatar-online-color:var(--primary-color);--chatlist-status-color:var(--primary-color);--chatlist-pinned-color:var(--secondary-color);--badge-text-color:#fff;--link-color:var(--primary-color);--ripple-color:hsla(0,0%,100%,.08);--poll-circle-color:#fff;--spoiler-background-color:#373e4e;--spoiler-draft-background-color:#484848;--monospace-text-color:var(--primary-text-color);--menu-background-color:rgba(var(--surface-color-rgb),.75);--message-background-color:var(--surface-color);--message-time-color:var(--secondary-text-color);--message-checkbox-color:var(--primary-color);--message-checkbox-border-color:#fff;--message-secondary-color:var(--secondary-color);--message-error-color:#fff;--message-out-link-color:#fff;--message-out-status-color:#fff;--message-out-time-color:hsla(0,0%,100%,.6);--message-out-audio-play-button-color:var(--message-out-background-color);--message-out-selection-background-color:rgba(var(--surface-color-rgb),.4)}@font-face{font-display:block;font-family:tgico;font-style:normal;font-weight:400;src:url(assets/fonts/tgico.ttf?bv435t) format("truetype"),url(assets/fonts/tgico.woff?bv435t) format("woff"),url(assets/fonts/tgico.svg?bv435t#tgico) format("svg")}.tgico:after,.tgico:before,[class*=" tgico-"]:after,[class*=" tgico-"]:before,[class^=tgico-]{speak:never;font-feature-settings:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:tgico!important;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none}.tgico-check:before{content:""}.tgico-checks:before{content:""}.tgico-activesessions:before{content:""}.tgico-add:before{content:""}.tgico-add_reaction:before{content:""}.tgico-addmember_filled:before{content:""}.tgico-adduser:before{content:""}.tgico-admin:before{content:""}.tgico-animals:before{content:""}.tgico-animations:before{content:""}.tgico-archive:before{content:""}.tgico-arrow_down:before{content:""}.tgico-arrow_next:before{content:""}.tgico-attach:before{content:""}.tgico-audio_repeat:before{content:""}.tgico-audio_repeat_single:before{content:""}.tgico-avatarnext:before{content:""}.tgico-avatarprevious:before{content:""}.tgico-binfilled:before{content:""}.tgico-bold:before{content:""}.tgico-botcom:before{content:""}.tgico-bots:before{content:""}.tgico-bug:before{content:""}.tgico-calendar:before{content:""}.tgico-calendarfilter:before{content:""}.tgico-camera:before{content:""}.tgico-cameraadd:before{content:""}.tgico-car:before{content:""}.tgico-card:before{content:""}.tgico-card_outline:before{content:""}.tgico-channel:before{content:""}.tgico-channelviews:before{content:""}.tgico-chatspinned:before{content:""}.tgico-chatsplaceholder:before{content:""}.tgico-check1:before{content:""}.tgico-checkbox:before{content:""}.tgico-checkboxblock:before{content:""}.tgico-checkboxempty:before{content:""}.tgico-checkboxon:before{content:""}.tgico-checkretract:before{content:""}.tgico-checkround:before{content:""}.tgico-close:before{content:""}.tgico-clouddownload:before{content:""}.tgico-colorize:before{content:""}.tgico-comments:before{content:""}.tgico-commentssticker:before{content:""}.tgico-copy:before{content:""}.tgico-darkmode:before{content:""}.tgico-data:before{content:""}.tgico-delete:before{content:""}.tgico-delete_filled:before{content:""}.tgico-deletedaccount:before{content:""}.tgico-deleteleft:before{content:""}.tgico-deleteuser:before{content:""}.tgico-devices:before{content:""}.tgico-document:before{content:""}.tgico-down:before{content:""}.tgico-download:before{content:""}.tgico-dragfiles:before{content:""}.tgico-dragmedia:before{content:""}.tgico-eats:before{content:""}.tgico-edit:before{content:""}.tgico-email:before{content:""}.tgico-endcall_filled:before{content:""}.tgico-enter:before{content:""}.tgico-eye1:before{content:""}.tgico-eye2:before{content:""}.tgico-fast_forward:before{content:""}.tgico-fast_rewind:before{content:""}.tgico-favourites:before{content:""}.tgico-flag:before{content:""}.tgico-flip:before{content:""}.tgico-folder:before{content:""}.tgico-fontsize:before{content:""}.tgico-forward:before{content:""}.tgico-forward_filled:before{content:""}.tgico-fullscreen:before{content:""}.tgico-gc_microphone:before{content:""}.tgico-gc_microphoneoff:before{content:""}.tgico-gifs:before{content:""}.tgico-gift:before{content:""}.tgico-group:before{content:""}.tgico-groupmedia:before{content:""}.tgico-groupmediaoff:before{content:""}.tgico-help:before{content:""}.tgico-hide:before{content:""}.tgico-image:before{content:""}.tgico-info:before{content:""}.tgico-info2:before{content:""}.tgico-italic:before{content:""}.tgico-keyboard:before{content:""}.tgico-lamp:before{content:""}.tgico-language:before{content:""}.tgico-largepause:before{content:""}.tgico-largeplay:before{content:""}.tgico-left:before{content:""}.tgico-limit_chat:before{content:""}.tgico-limit_chats:before{content:""}.tgico-limit_file:before{content:""}.tgico-limit_folders:before{content:""}.tgico-limit_link:before{content:""}.tgico-limit_pin:before{content:""}.tgico-link:before{content:""}.tgico-listscreenshare:before{content:""}.tgico-livelocation:before{content:""}.tgico-location:before{content:""}.tgico-lock:before{content:""}.tgico-lockoff:before{content:""}.tgico-loginlogodesktop:before{content:""}.tgico-loginlogomobile:before{content:""}.tgico-logout:before{content:""}.tgico-mediaspoiler:before{content:""}.tgico-mediaspoileroff:before{content:""}.tgico-mention:before{content:""}.tgico-menu:before{content:""}.tgico-message:before{content:""}.tgico-messageunread:before{content:""}.tgico-microphone:before{content:""}.tgico-microphone_crossed:before{content:""}.tgico-microphone_crossed_filled:before{content:""}.tgico-microphone_filled:before{content:""}.tgico-minus:before{content:""}.tgico-monospace:before{content:""}.tgico-more:before{content:""}.tgico-mute:before{content:""}.tgico-muted:before{content:""}.tgico-newchannel:before{content:""}.tgico-newchat_filled:before{content:""}.tgico-newgroup:before{content:""}.tgico-newprivate:before{content:""}.tgico-next:before{content:""}.tgico-noncontacts:before{content:""}.tgico-nosound:before{content:""}.tgico-passwordoff:before{content:""}.tgico-pause:before{content:""}.tgico-permissions:before{content:""}.tgico-phone:before{content:""}.tgico-pin:before{content:""}.tgico-pinlist:before{content:""}.tgico-pinned_filled:before{content:""}.tgico-pinnedchat:before{content:""}.tgico-pip:before{content:""}.tgico-play:before{content:""}.tgico-playback_05:before{content:""}.tgico-playback_15:before{content:""}.tgico-playback_1x:before{content:""}.tgico-playback_2x:before{content:""}.tgico-plus:before{content:""}.tgico-poll:before{content:""}.tgico-premium_addone:before{content:""}.tgico-premium_double:before{content:""}.tgico-premium_lock:before{content:""}.tgico-premium_unlock:before{content:""}.tgico-previous:before{content:""}.tgico-radiooff:before{content:""}.tgico-radioon:before{content:""}.tgico-reactions:before{content:""}.tgico-readchats:before{content:""}.tgico-recent:before{content:""}.tgico-replace:before{content:""}.tgico-reply:before{content:""}.tgico-reply_filled:before{content:""}.tgico-rightpanel:before{content:""}.tgico-rotate_left:before{content:""}.tgico-rotate_right:before{content:""}.tgico-saved:before{content:""}.tgico-savedmessages:before{content:""}.tgico-schedule:before{content:""}.tgico-scheduled:before{content:""}.tgico-search:before{content:""}.tgico-select:before{content:""}.tgico-send:before{content:""}.tgico-send2:before{content:""}.tgico-sending:before{content:""}.tgico-sendingerror:before{content:""}.tgico-settings:before{content:""}.tgico-settings_filled:before{content:""}.tgico-sharescreen_filled:before{content:""}.tgico-shipping:before{content:""}.tgico-shuffle:before{content:""}.tgico-smallscreen:before{content:""}.tgico-smile:before{content:""}.tgico-spoiler:before{content:""}.tgico-sport:before{content:""}.tgico-star:before{content:""}.tgico-stickers:before{content:""}.tgico-stickers_face:before{content:""}.tgico-stop:before{content:""}.tgico-strikethrough:before{content:""}.tgico-textedit:before{content:""}.tgico-tip:before{content:""}.tgico-tools:before{content:""}.tgico-topics:before{content:""}.tgico-transcribe:before{content:""}.tgico-unarchive:before{content:""}.tgico-underline:before{content:""}.tgico-unmute:before{content:""}.tgico-unpin:before{content:""}.tgico-unread:before{content:""}.tgico-up:before{content:""}.tgico-user:before{content:""}.tgico-username:before{content:""}.tgico-videocamera:before{content:""}.tgico-videocamera_crossed_filled:before{content:""}.tgico-videocamera_filled:before{content:""}.tgico-videochat:before{content:""}.tgico-volume_down:before{content:""}.tgico-volume_mute:before{content:""}.tgico-volume_off:before{content:""}.tgico-volume_up:before{content:""}.tgico-zoomin:before{content:""}.tgico-zoomout:before{content:""}.tgico-phone_filled:before{content:"";transform:rotate(-135deg)}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:400;src:local("Roboto"),local("Roboto-Regular"),url(assets/fonts/KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2) format("woff2");unicode-range:U400-45F,U490-491,U4B0-4B1,U2116}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:400;src:local("Roboto"),local("Roboto-Regular"),url(assets/fonts/KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2) format("woff2");unicode-range:U100-24F,U259,U1-1EFF,U2020,U20A0-20AB,U20AD-20CF,U2113,U2C60-2C7F,UA720-A7FF}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:400;src:local("Roboto"),local("Roboto-Regular"),url(assets/fonts/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2) format("woff2");unicode-range:U0-0FF,U131,U152-153,U2BB-2BC,U2C6,U2DA,U2DC,U2000-206F,U2074,U20AC,U2122,U2191,U2193,U2212,U2215,UFEFF,UFFFD}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:500;src:local("Roboto Medium"),local("Roboto-Medium"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2) format("woff2");unicode-range:U400-45F,U490-491,U4B0-4B1,U2116}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:500;src:local("Roboto Medium"),local("Roboto-Medium"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2) format("woff2");unicode-range:U100-24F,U259,U1-1EFF,U2020,U20A0-20AB,U20AD-20CF,U2113,U2C60-2C7F,UA720-A7FF}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:500;src:local("Roboto Medium"),local("Roboto-Medium"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2) format("woff2");unicode-range:U0-0FF,U131,U152-153,U2BB-2BC,U2C6,U2DA,U2DC,U2000-206F,U2074,U20AC,U2122,U2191,U2193,U2212,U2215,UFEFF,UFFFD}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:600;src:local("Roboto Medium"),local("Roboto-Medium"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2) format("woff2");unicode-range:U400-45F,U490-491,U4B0-4B1,U2116}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:600;src:local("Roboto Medium"),local("Roboto-Medium"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2) format("woff2");unicode-range:U100-24F,U259,U1-1EFF,U2020,U20A0-20AB,U20AD-20CF,U2113,U2C60-2C7F,UA720-A7FF}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:600;src:local("Roboto Medium"),local("Roboto-Medium"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2) format("woff2");unicode-range:U0-0FF,U131,U152-153,U2BB-2BC,U2C6,U2DA,U2DC,U2000-206F,U2074,U20AC,U2122,U2191,U2193,U2212,U2215,UFEFF,UFFFD}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEluUlco8VkKjG.woff2) format("woff2");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEn-Ulco8VkKjG.woff2) format("woff2");unicode-range:u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEmOUlco8VkKjG.woff2) format("woff2");unicode-range:u+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtElOUlco8VkKjG.woff2) format("woff2");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+1ea0-1ef9,u+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEleUlco8VkKjG.woff2) format("woff2");unicode-range:u+0100-024f,u+0259,u+1e??,u+2020,u+20a0-20ab,u+20ad-20cf,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEm-Ulco8VkA.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEluUlco8VkKjG.woff2) format("woff2");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEn-Ulco8VkKjG.woff2) format("woff2");unicode-range:u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEmOUlco8VkKjG.woff2) format("woff2");unicode-range:u+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtElOUlco8VkKjG.woff2) format("woff2");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+1ea0-1ef9,u+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEleUlco8VkKjG.woff2) format("woff2");unicode-range:u+0100-024f,u+0259,u+1e??,u+2020,u+20a0-20ab,u+20ad-20cf,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEm-Ulco8VkA.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSV0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSx0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSt0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSd0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+1ea0-1ef9,u+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSZ0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0100-024f,u+0259,u+1e??,u+2020,u+20a0-20ab,u+20ad-20cf,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0me8iUI0.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSV0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSx0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSt0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSd0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+1ea0-1ef9,u+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSZ0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0100-024f,u+0259,u+1e??,u+2020,u+20a0-20ab,u+20ad-20cf,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0me8iUI0.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}.input-wrapper{margin:0 auto;width:360px}.input-field{--height:54px;--border-radius:10px;position:relative}@media only screen and (max-width:600px){.input-field{--height:50px}}.input-field .arrow-down{border:solid var(--secondary-text-color);border-radius:1px;border-width:0 2px 2px 0;bottom:0;content:" ";cursor:pointer;display:inline-block;height:0;margin-top:-9px;padding:5px;position:absolute;right:21px;top:50%;transform:rotate(45deg);-webkit-transform:rotate(45deg);transition:all .2s;vertical-align:middle;width:0;z-index:2}[dir=ltr] .input-field label{left:1rem}[dir=rtl] .input-field label{right:1rem}.input-field label{background-color:var(--surface-color);color:#9e9e9e;height:1.5rem;margin-top:calc((var(--height) - 1.5rem)/2);pointer-events:none;position:absolute;right:auto;top:0;transform:translate(0);transform-origin:left center;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;z-index:2}.is-rtl .input-field label{transform-origin:right center}body.animation-level-2 .input-field label{transition:transform .2s,padding .2s,opacity .1s,font-weight 0s .1s}.input-field-border{border:2px solid var(--primary-color);border-radius:var(--border-radius);bottom:0;left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0;z-index:1}body.animation-level-2 .input-field-border{transition:opacity .2s}.input-field-icon{border-radius:.375rem;height:1.5rem;pointer-events:none;position:absolute;right:1rem;top:50%;transform:translateY(-50%);width:1.5rem;z-index:1}.input-field-input{--padding:1rem;--padding-horizontal:1rem;--border-width:1px;background-color:var(--surface-color);border:var(--border-width) solid var(--input-search-border-color);border-radius:var(--border-radius);box-sizing:border-box;line-height:var(--line-height);min-height:var(--height);padding:calc(var(--padding) - var(--border-width)) calc(var(--padding-horizontal) - var(--border-width));position:relative;transition:border-color 0s;width:100%;z-index:1}.input-field-input:-webkit-autofill,.input-field-input:-webkit-autofill:active,.input-field-input:-webkit-autofill:focus,.input-field-input:-webkit-autofill:hover{-webkit-box-shadow:0 0 0 1000px var(--surface-color) inset}.input-field-input:-webkit-autofill,.input-field-input:-webkit-autofill:active,.input-field-input:-webkit-autofill:first-line,.input-field-input:-webkit-autofill:focus,.input-field-input:-webkit-autofill:hover{color:var(--primary-text-color)!important;font-family:Roboto,-apple-system,apple color emoji,BlinkMacSystemFont,Segoe UI,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif!important;font-size:1rem!important}@media only screen and (max-width:600px){.input-field-input{--padding:.9375rem;--padding-horizontal:.9375rem}}body.animation-level-0 .input-field-input{transition:none!important}html.no-touch .input-field-input:active:not(:focus):not(.error):not(.valid),html.no-touch .input-field-input:hover:not(:focus):not(.error):not(.valid){border-color:var(--primary-color);transition:border-color .2s}html.no-touch .input-field-input:active:not(:focus):not(.error):not(.valid)~label,html.no-touch .input-field-input:hover:not(:focus):not(.error):not(.valid)~label{color:var(--primary-color)}.input-field-input:focus{border-color:var(--primary-color)}.input-field-input.error{border-color:var(--danger-color)}.input-field-input.error~label{color:var(--danger-color)!important}.input-field-input.error~.input-field-border{border-color:var(--danger-color)!important}.input-field-input.valid{border-color:#26962f}.input-field-input.valid~label{color:#26962f!important}.input-field-input.valid~.input-field-border{border-color:#26962f!important}.input-field-input:focus~.arrow-down{border-color:var(--primary-color);margin-top:-4px;transform:rotate(225deg)}.input-field-input:focus~label{color:var(--primary-color);font-weight:var(--font-weight-bold)}.input-field-input:focus~.input-field-border{opacity:1}.input-field-input:disabled~label,.input-field-input:focus~label,.input-field-input:not(:empty)~label,.input-field-input:valid~label{opacity:1;padding:0 .3125rem;transform:translate(-.1875rem,calc(var(--height)/-2 + .0625rem)) scale(.75)}.input-field-input-fake{bottom:auto!important;height:auto!important;left:0;opacity:0;pointer-events:none;position:absolute!important;right:auto!important;top:0;z-index:-3}.input-fields-row{display:flex}.input-fields-row .input-field{flex:1 1 auto;width:1%}.input-wrapper>*+*{margin-top:1.5rem}::-moz-placeholder{color:#909192;opacity:1}::placeholder{color:#909192;opacity:1}:-ms-input-placeholder{color:#909192}::-ms-input-placeholder{color:#909192}button:focus,input:focus{outline:none}.input-clear{border:none;outline:none;padding:0}body.animation-level-0 .input-clear.error{color:var(--danger-color)!important}body:not(.animation-level-0) .input-clear.error{animation:input-shake .2s ease-in-out forwards}@keyframes input-shake{0%{transform:translateX(0)}25%{transform:translateX(-.5rem)}75%{transform:translateX(.5rem)}to{transform:translateX(0)}}.input-search{--border-radius:22px;margin-left:.4375rem;margin-right:.4375rem;overflow:hidden;position:relative;width:100%}@media only screen and (max-width:600px){[dir=ltr] .input-search{margin-left:1rem}[dir=rtl] .input-search{margin-right:1rem}}.input-search-input{--height:42px;background-color:var(--input-search-background-color);border-color:var(--input-search-border-color);height:var(--height);line-height:var(--height);max-height:var(--height)!important;min-height:var(--height)!important;padding:0 calc(var(--height) + 3px - var(--border-width))}body.animation-level-2 .input-search-input{transition:border-color .2s ease-in-out}html.no-touch .input-search-input:active:not(:focus),html.no-touch .input-search-input:hover:not(:focus){border-color:var(--secondary-color)!important}.input-search-input:focus{background-color:transparent;border-color:var(--primary-color)}.input-search-input:focus~.tgico{color:var(--primary-color);opacity:1}html.no-touch .input-search-input:focus~.btn-icon:active,html.no-touch .input-search-input:focus~.btn-icon:hover{background-color:var(--light-primary-color)}.input-search-input:-moz-placeholder-shown~.tgico-close{display:none}.input-search-input:placeholder-shown~.tgico-close{display:none}.input-search>.tgico{color:var(--secondary-text-color);font-size:1.5rem;line-height:1;opacity:.6;position:absolute;text-align:center;top:50%;transform:translateY(-50%);z-index:1}body.animation-level-2 .input-search>.tgico{transition:opacity .2s ease-out,color .2s ease-out}[dir=ltr] .input-search>.tgico-search{left:.8125rem}[dir=rtl] .input-search>.tgico-search{right:.8125rem}.input-search>.tgico-search{height:1.5rem;pointer-events:none;width:1.5rem}[dir=ltr] .input-search>.tgico-close{right:0}[dir=rtl] .input-search>.tgico-close{left:0}.input-search>.tgico-close{height:42px;width:42px;z-index:1}[dir=ltr] .input-search>.tgico-close:before{margin-right:-1px}[dir=rtl] .input-search>.tgico-close:before{margin-left:-1px}[dir=ltr] .input-field-password .input-field-input{padding-right:2.5rem}[dir=rtl] .input-field-password .input-field-input{padding-left:2.5rem}.input-field-password .input-field-input{max-height:var(--height)}.input-field-password .input-field-input[type=password]{font-family:Arial,Helvetica,sans-serif;font-size:2.25rem;line-height:1;padding-bottom:0;padding-left:calc(.875rem - var(--border-width));padding-top:0}@media(-webkit-min-device-pixel-ratio:2){.input-field-password .input-field-input[type=password]{font-size:1.75rem;letter-spacing:.125rem}}html.is-ios .input-field-password .input-field-input[type=password]{font-size:1rem}.input-field-password .toggle-visible{align-items:center;color:#9e9e9e;cursor:pointer;display:flex;font-size:1.5rem;justify-content:center;padding:.5rem;position:absolute;right:.375rem;top:50%;transform:translateY(-50%);transition:color .2s;z-index:2}.input-field-password .toggle-visible:before{content:""}.input-field-password .toggle-visible.eye-hidden:before{content:""}html.no-touch .input-field-password .toggle-visible:active,html.no-touch .input-field-password .toggle-visible:hover{color:var(--primary-text-color)}.input-field-phone .input-field-input{--letter-spacing:.24px}.input-field-phone .input-field-input:after{color:#9e9e9e;content:attr(data-left-pattern);letter-spacing:var(--letter-spacing)}.btn,.btn-icon{background:none;border:none;cursor:pointer;outline:none}body.animation-level-0 .btn,body.animation-level-0 .btn-icon{transition:none}html.no-touch .btn-icon:active,html.no-touch .btn-icon:hover,html.no-touch .btn:active,html.no-touch .btn:hover{background-color:var(--light-secondary-text-color)}html.no-touch .btn-icon.active:active,html.no-touch .btn-icon.active:hover,html.no-touch .btn-icon.blue:active,html.no-touch .btn-icon.blue:hover,html.no-touch .btn-icon.primary:active,html.no-touch .btn-icon.primary:hover,html.no-touch .btn.active:active,html.no-touch .btn.active:hover,html.no-touch .btn.blue:active,html.no-touch .btn.blue:hover,html.no-touch .btn.primary:active,html.no-touch .btn.primary:hover{background-color:var(--light-primary-color)}html.no-touch .btn-icon.danger:active,html.no-touch .btn-icon.danger:hover,html.no-touch .btn.danger:active,html.no-touch .btn.danger:hover{background-color:var(--light-danger-color)}.btn-icon:disabled,.btn:disabled{opacity:var(--disabled-opacity);pointer-events:none!important}.btn-icon{align-items:center;background-color:transparent;border:none;border-radius:50%!important;color:var(--secondary-text-color);display:flex;font-size:1.5rem;justify-content:center;line-height:1;padding:.5rem;position:relative;text-align:center;transition:color .15s ease-in-out,opacity .15s ease-in-out}.btn-icon.rp{overflow:hidden}.btn-icon.active{color:var(--primary-color)}[dir=ltr] .btn-corner{right:var(--offset)}[dir=rtl] .btn-corner{left:var(--offset)}.btn-corner{--offset:1.25rem;--translateY:calc(54px + var(--offset));align-items:center;background-color:var(--primary-color);border:none;bottom:var(--offset);box-shadow:none!important;color:#fff;cursor:pointer;display:flex;font-size:1.5rem;justify-content:center;outline:none;padding:0!important;position:absolute!important;text-align:center;transform:translate3d(0,var(--translateY),0);transition:transform var(--btn-corner-transition)!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:3}html.no-touch .btn-corner:active,html.no-touch .btn-corner:hover{background-color:var(--dark-primary-color)}.btn-corner.is-visible{--translateY:0}body.animation-level-0 .btn-corner{transition:none!important}.btn-corner:disabled{opacity:1!important;pointer-events:all!important}.btn-corner .preloader-circular{height:2.5rem;width:2.5rem}.btn-menu{-webkit-touch-callout:none;-webkit-backdrop-filter:var(--menu-backdrop-filter);backdrop-filter:var(--menu-backdrop-filter);background-color:var(--menu-background-color);border-radius:10px;font-size:1rem;min-width:11.25rem;opacity:0;padding:.3125rem 0;position:absolute;top:100%;transform:scale(.8)!important;transition:opacity var(--btn-menu-transition),transform var(--btn-menu-transition),visibility var(--btn-menu-transition);-webkit-user-select:none;visibility:hidden;z-index:4}.btn-menu-old,.is-mobile .btn-menu{-webkit-backdrop-filter:none;backdrop-filter:none;background-color:var(--surface-color);min-width:auto;padding:.5rem 0}.btn-menu-old .btn-menu-item,.is-mobile .btn-menu .btn-menu-item{--padding-left:1rem;--padding-right:2.5rem;--icon-margin:1.5rem;--icon-size:1.5rem;border-radius:0;font-size:var(--font-size-16);font-weight:400;height:3rem;line-height:var(--line-height-16);margin:0;transform:none!important}.btn-menu-old .btn-menu-item:before,.is-mobile .btn-menu .btn-menu-item:before{align-self:auto;color:var(--secondary-text-color);margin-top:0}.btn-menu-old .btn-menu-footer,.is-mobile .btn-menu .btn-menu-footer{background-color:var(--background-color)}.btn-menu{box-shadow:var(--menu-box-shadow)}body.animation-level-0 .btn-menu{transition:none}.btn-menu.active{opacity:1;visibility:visible}.btn-menu.active,.is-mobile .btn-menu.was-open{transform:scaleX(1)!important}.btn-menu.bottom-left,.is-rtl .btn-menu.bottom-right{left:auto;right:0;top:100%;transform-origin:top right}.btn-menu.bottom-right,.is-rtl .btn-menu.bottom-left{left:0;right:auto;top:100%;transform-origin:top left}.btn-menu.bottom-center{transform-origin:top center}.btn-menu.top-left{bottom:100%;left:auto;right:0;top:auto;transform-origin:bottom right}.btn-menu.top-right,.is-rtl .btn-menu.top-left{bottom:100%;left:0;right:auto;top:auto;transform-origin:bottom left}.btn-menu.top-center{transform-origin:bottom center}.btn-menu.center-left{transform-origin:center right}.btn-menu.center-right{transform-origin:center left}[dir=ltr] .btn-menu-item{text-align:left}[dir=rtl] .btn-menu-item{text-align:right}.btn-menu-item{--padding-vertical:.25rem;--padding-left:.75rem;--padding-right:.75rem;--icon-margin:1.25rem;--icon-size:1.25rem;align-items:center;border-radius:.3125rem;color:var(--primary-text-color);cursor:pointer!important;display:flex;font-size:var(--font-size-14);font-weight:500;height:2rem;line-height:var(--line-height-14);margin-left:.3125rem;margin-right:.3125rem;padding:var(--padding-vertical) var(--padding-right) var(--padding-vertical) var(--padding-left);pointer-events:all!important;position:relative;text-transform:none;transform:scale(1);white-space:nowrap}.btn-menu-item.tgico-char:before{width:var(--icon-size)}body.animation-level-2 .btn-menu-item{transition:transform var(--btn-menu-transition)}.btn-menu-item:active{transform:scale(.96)}html.no-touch .btn-menu-item:active,html.no-touch .btn-menu-item:hover{background-color:var(--light-secondary-text-color)}html.no-touch .btn-menu-item.danger:active,html.no-touch .btn-menu-item.danger:hover{background-color:var(--light-danger-color)}.btn-menu-item:before{align-self:flex-start;color:var(--primary-text-color);font-size:var(--icon-size);margin-top:.125rem}[dir=ltr] .btn-menu-item-icon,[dir=ltr] .btn-menu-item:before{margin-right:var(--icon-margin)}[dir=rtl] .btn-menu-item-icon,[dir=rtl] .btn-menu-item:before{margin-left:var(--icon-margin)}.btn-menu-item-icon,.btn-menu-item:before{position:relative}[dir=ltr] .btn-menu-item-icon{margin-right:calc(var(--icon-margin) - var(--add)/2)}[dir=rtl] .btn-menu-item-icon{margin-left:calc(var(--icon-margin) - var(--add)/2)}[dir=ltr] .btn-menu-item-icon{margin-left:calc(var(--add)/-2)}[dir=rtl] .btn-menu-item-icon{margin-right:calc(var(--add)/-2)}.btn-menu-item-icon{--add:.25rem;--total:calc(var(--icon-size) + var(--add));flex:0 0 auto;height:var(--total);width:var(--total)}.btn-menu-item-icon .media-photo{height:inherit;width:inherit}@media only screen and (max-width:600px){.btn-menu-item{--padding-right:1.875rem}}.btn-menu-item-text{flex:1 1 auto;position:relative}.btn-menu-item-text,.btn-menu-item-text-fake{pointer-events:none}[dir=ltr] .btn-menu-item-text-fake{margin-left:var(--margin-left)}[dir=rtl] .btn-menu-item-text-fake{margin-right:var(--margin-left)}.btn-menu-item-text-fake{--margin-left:calc(var(--icon-size) + var(--icon-margin));max-width:calc(100% - var(--margin-left) - var(--padding-left) - var(--padding-right));overflow:hidden;position:absolute;text-overflow:ellipsis;white-space:nowrap}.btn-menu-item-subtitle{color:var(--secondary-text-color);font-size:.875rem}.btn-menu-item-header{color:var(--secondary-text-color);font-weight:var(--font-weight-bold);height:2rem;pointer-events:none!important}[dir=ltr] .btn-menu-item .stacked-avatars{right:.5rem}[dir=rtl] .btn-menu-item .stacked-avatars{left:.5rem}.btn-menu-item .stacked-avatars{--margin-right:-.6875rem;flex:0 0 auto;pointer-events:none;position:absolute}.btn-menu-item.is-multiline{font-size:.75rem;height:auto;max-width:16.25rem;min-width:calc(100% - .625rem);width:-moz-fit-content;width:fit-content}.btn-menu-item.is-multiline .btn-menu-item-text{white-space:pre-wrap;width:-moz-fit-content;width:fit-content}.btn-menu-item .checkbox-field-toggle{padding:0}.btn-menu-overlay{bottom:0;bottom:-100vh;cursor:default;left:0;left:-100vw;max-width:none!important;position:fixed!important;right:0;right:-100vw;top:0;top:-100vh;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important;z-index:4}.btn-menu.has-footer{padding-bottom:0}.btn-menu-footer{align-items:center;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;color:currentColor;display:flex;font-size:.875rem;height:2.5rem;justify-content:center}.btn-menu hr{display:block!important;margin:.3125rem auto;opacity:.6;padding:0;width:calc(100% - 1.875rem)}html:not(.is-mobile) .btn-menu .badge{background-color:transparent;color:var(--secondary-text-color)}.btn-menu-reactions{--inner-shadow-degree:90deg;-webkit-backdrop-filter:var(--menu-backdrop-filter);backdrop-filter:var(--menu-backdrop-filter);background-color:var(--menu-background-color);border-radius:var(--height);filter:drop-shadow(0 .125rem .5rem rgba(0,0,0,.24));height:inherit;max-height:100%;max-width:100%;opacity:0;position:absolute;transform:scale(.8);transform-origin:bottom left}[dir=ltr] .btn-menu-reactions-container{margin-left:var(--other-side-offset)}[dir=rtl] .btn-menu-reactions-container{margin-right:var(--other-side-offset)}.btn-menu-reactions-container{--height:2.25rem;--bubble-side-offset:0rem;--other-side-offset:0rem;--menu-offset:calc((var(--height) + 0.5rem)*-1);--width:calc(var(--menu-width) + (var(--bubble-side-offset) + var(--other-side-offset))*-1);display:flex;height:var(--height);justify-content:flex-start;margin-top:var(--menu-offset);max-width:var(--width);position:fixed;width:var(--width);z-index:4}.contextmenu.bottom-left+.btn-menu-reactions-container .btn-menu-reactions,.contextmenu.center-left+.btn-menu-reactions-container .btn-menu-reactions{transform-origin:bottom right!important}.contextmenu.bottom-center+.btn-menu-reactions-container .btn-menu-reactions{transform-origin:bottom center!important}[dir=ltr] .btn-menu-reactions-container-vertical{margin-left:var(--menu-offset)}[dir=rtl] .btn-menu-reactions-container-vertical{margin-right:var(--menu-offset)}.btn-menu-reactions-container-vertical{flex-direction:column;height:var(--width);margin-top:0;max-height:var(--width);max-width:var(--height);width:var(--height)}.btn-menu-reactions-container-vertical .btn-menu-reactions{--inner-shadow-degree:180deg;display:flex;flex-direction:column;height:auto;transform-origin:top right;width:inherit}.btn-menu-reactions-container-vertical .btn-menu-reactions-reaction{--padding-vertical:var(--padding-base);--padding-horizontal:0rem}.btn-menu-reactions-container-vertical .btn-menu-reactions-bubble-big{bottom:var(--offset);right:calc(var(--size)/-2)}body.animation-level-2 .btn-menu-reactions{transition:opacity var(--transition-standard-in),transform var(--transition-standard-in)}.btn-menu-reactions.is-visible{opacity:1;transform:scale(1)}.btn-menu-reactions-bubble{background-color:inherit;border-radius:50%;position:absolute;z-index:-1}.btn-menu-reactions-bubble-big{--size:1rem;--offset:calc(var(--height)/2);bottom:calc(var(--size)/-2);height:var(--size);right:var(--offset);width:var(--size)}.btn-menu-reactions:after{background:linear-gradient(var(--inner-shadow-degree),var(--surface-color) 0,rgba(var(--surface-color-rgb),0) 1rem,rgba(var(--surface-color-rgb),0) calc(100% - 1rem),var(--surface-color) 100%);border-radius:inherit;bottom:0;content:" ";left:0;pointer-events:none;position:absolute;right:0;top:0}.btn-menu-reactions .scrollable{border-radius:inherit;display:flex;position:relative}.btn-menu-reactions .scrollable-x{align-items:center;padding:0 .25rem}.btn-menu-reactions .scrollable-y{align-items:center;flex-direction:column;padding:.25rem 0}.btn-menu-reactions-reaction{--size:1.625rem;--padding-base:.25rem;--padding-vertical:0rem;--padding-horizontal:var(--padding-base);cursor:pointer;flex:0 0 auto;height:calc(var(--size) + var(--padding-vertical)*2);padding:var(--padding-vertical) var(--padding-horizontal);width:calc(var(--size) + var(--padding-horizontal)*2)}.btn-menu-reactions-reaction-scale{height:100%;width:100%}html:not(.is-safari) .btn-menu-reactions-reaction-scale{transform:scale(1)}html:not(.is-safari) body.animation-level-2 .btn-menu-reactions-reaction-scale{transition:transform .1s linear}html.no-touch:not(.is-safari) .btn-menu-reactions-reaction-select{transform:scale(1)}html.no-touch:not(.is-safari) .btn-menu-reactions-reaction-select:active,html.no-touch:not(.is-safari) .btn-menu-reactions-reaction-select:hover{transform:scale(1.25)}html.no-touch:not(.is-safari) body.animation-level-2 .btn-menu-reactions-reaction-select{transition:transform var(--transition-standard-in)}.btn-menu-reactions-reaction .media-sticker-wrapper{height:100%;position:relative;width:100%}.btn-primary{border:none;border-radius:10px;cursor:pointer;font-weight:var(--font-weight-bold);height:54px;overflow:hidden;padding:0;position:relative;text-align:center;transition:opacity .2s;width:100%}html.no-touch .btn-primary:active,html.no-touch .btn-primary:hover{background:var(--dark-primary-color);transition:opacity .2s}.btn-primary-transparent{background-color:transparent;color:var(--primary-color)}html.no-touch .btn-primary-transparent:active,html.no-touch .btn-primary-transparent:hover{background:var(--light-primary-color)}.btn-primary-transparent .c-ripple__circle{background-color:var(--light-primary-color)}html.no-touch .btn-primary-transparent.danger:active,html.no-touch .btn-primary-transparent.danger:hover{background-color:var(--light-danger-color)}.btn-primary-transparent .preloader-circular .preloader-path{stroke:var(--primary-color)}body.animation-level-0 .btn-primary{transition:none}[dir=ltr] .btn-primary use,[dir=ltr] .btn-primary>svg{right:15px}[dir=rtl] .btn-primary use,[dir=rtl] .btn-primary>svg{left:15px}.btn-primary use,.btn-primary>svg{height:calc(100% - 20px);left:auto}.btn-primary:disabled{opacity:var(--disabled-opacity);pointer-events:none!important}.btn-primary.shimmer:before{animation:wave 2s cubic-bezier(.4,0,.6,1) infinite;background:linear-gradient(to right,transparent 0,rgba(var(--surface-color-rgb),.2) 50%,transparent 100%);content:"";display:block;height:100%;position:absolute;top:0;width:100%}@keyframes wave{0%{transform:translateX(-100%)}50%{transform:translateX(100%)}to{transform:translateX(100%)}}[dir=ltr] .btn-control{padding-left:.75rem;padding-right:1.5rem}[dir=rtl] .btn-control{padding-left:1.5rem;padding-right:.75rem}.btn-control{align-items:center;border-radius:1.25rem;display:flex;height:2.5rem;line-height:2.5rem;margin:.9375rem auto 1rem;width:auto}[dir=ltr] .btn-control.tgico:before{margin-right:.375rem}[dir=rtl] .btn-control.tgico:before{margin-left:.375rem}.btn-control.tgico:before{font-size:1.5rem}.btn-transparent{align-items:center;background-color:transparent;color:var(--primary-text-color);display:flex;font-weight:400;height:3rem;line-height:var(--line-height);padding:0 1rem}@media only screen and (max-width:600px){.btn-transparent{height:3rem}}html.no-touch .btn-transparent:active,html.no-touch .btn-transparent:hover{background-color:var(--light-secondary-text-color)}html.no-touch .btn-transparent.danger:active,html.no-touch .btn-transparent.danger:hover{background-color:var(--light-danger-color)}html.no-touch .btn-transparent.primary:active,html.no-touch .btn-transparent.primary:hover{background-color:var(--light-primary-color)}[dir=ltr] .btn-transparent:before{margin-right:2rem}[dir=rtl] .btn-transparent:before{margin-left:2rem}.btn-transparent:before{color:var(--secondary-text-color);font-size:1.5rem}@media only screen and (max-width:600px){[dir=ltr] .btn-transparent:before{margin-right:1.5rem}[dir=rtl] .btn-transparent:before{margin-left:1.5rem}}[dir=ltr] .btn-transparent.btn-short:before{margin-right:1rem}[dir=rtl] .btn-transparent.btn-short:before{margin-left:1rem}.btn-primary.btn-circle .preloader-circular{height:calc(100% - 20px);left:auto;margin:0;right:auto;top:10px}.btn-primary.btn-circle .preloader-circular .preloader-path{stroke:#fff}.btn-menu-toggle{cursor:pointer!important;font-weight:400!important;overflow:visible!important;pointer-events:all!important;position:relative}.btn-menu-toggle:not(.btn-primary):not(.btn-corner).menu-open{background-color:var(--light-secondary-text-color)}.btn-menu-toggle .btn-menu{margin-top:.5rem}.btn-circle{--size:54px;border-radius:50%;height:var(--size);line-height:var(--size);width:var(--size)}@media only screen and (max-width:600px){.btn-circle{--size:46px}}.btn-circle path{fill:#fff}.btn-disabled{color:var(--secondary-text-color)!important;cursor:default!important;pointer-events:none!important}.btn-disabled:before{color:inherit!important}.btn-secondary:not(:first-child){margin-top:.5rem!important}.btn-color-primary{background:var(--primary-color);color:#fff}.call-button{-webkit-backdrop-filter:blur(25px);backdrop-filter:blur(25px);border-radius:50%;font-size:1.5rem;height:var(--call-button-size);justify-content:center;position:relative}.call-button,.call-button-container{align-items:center;cursor:pointer;display:flex;width:var(--call-button-size)}.call-button-container{flex-direction:column}.call-button-container.disabled,.call-button-container.disabled .call-button{pointer-events:none}.call-button-container.disabled .call-button,.call-button-container.disabled .call-button-text{opacity:.8}.call-button-text{font-size:.875rem;margin-top:.25rem;white-space:nowrap}body.animation-level-2 .call-button-text{transition:opacity var(--transition-standard-in)}body.animation-level-2 .call-button{transition:background-color var(--transition-standard-in),opacity var(--transition-standard-in)}[dir=ltr] .call-button+.call-button,[dir=ltr] .call-button-container+.call-button-container{margin-left:var(--call-button-margin)}[dir=rtl] .call-button+.call-button,[dir=rtl] .call-button-container+.call-button-container{margin-right:var(--call-button-margin)}[dir=ltr] .btn-update{right:auto!important}[dir=rtl] .btn-update{left:auto!important}.btn-update{border-radius:var(--size);font-size:1rem;font-weight:var(--font-weight-bold);padding:0 2rem!important;width:auto}.animated-close-icon{pointer-events:none;position:absolute;transform:rotate(-45deg)}.animated-close-icon,.animated-close-icon:after,.animated-close-icon:before{background-color:var(--secondary-text-color);border-radius:.125rem;height:.125rem;width:1.125rem}.animated-close-icon:after,.animated-close-icon:before{content:"";left:0;position:absolute;top:0}.animated-close-icon:before{transform:rotate(90deg)}body.animation-level-2 .animated-close-icon,body.animation-level-2 .animated-close-icon:after,body.animation-level-2 .animated-close-icon:before{transition:transform var(--slide-header-transition)}.animated-close-icon.state-back{transform:rotate(180deg)}.animated-close-icon.state-back:before{transform:rotate(45deg) scaleX(.75) translateY(-.375rem)}.animated-close-icon.state-back:after{transform:rotate(-45deg) scaleX(.75) translateY(.375rem)}.animated-menu-icon{--color:var(--secondary-text-color);position:absolute}.animated-menu-icon,.animated-menu-icon:after,.animated-menu-icon:before{background-color:var(--color);border-radius:.125rem;height:.125rem;transform:rotate(0);width:1.125rem}body.animation-level-2 .animated-menu-icon,body.animation-level-2 .animated-menu-icon:after,body.animation-level-2 .animated-menu-icon:before{transition:transform .25s}.animated-menu-icon:after,.animated-menu-icon:before{content:"";left:0;position:absolute}.animated-menu-icon:before{top:-.3125rem}.animated-menu-icon:after{top:.3125rem}.animated-menu-icon.state-back{transform:rotate(180deg)}.animated-menu-icon.state-back:before{transform:rotate(45deg) scaleX(.75) translate(.375rem,-.1875rem)}.animated-menu-icon.state-back:after{transform:rotate(-45deg) scaleX(.75) translate(.375rem,.1875rem)}.animated-menu-close-icon{margin-top:-.625rem}.animated-menu-close-icon:before{opacity:1;top:.3125rem}body.animation-level-2 .animated-menu-close-icon:before{transition:transform .25s,opacity .125s 0s}.animated-menu-close-icon:after{top:.625rem}.animated-menu-close-icon.state-back{transform:translateY(.3125rem) rotate(135deg)}.animated-menu-close-icon.state-back:before{opacity:0;transform:rotate(45deg)}.animated-menu-close-icon.state-back:after{transform:translateY(-.625rem) rotate(90deg)}.animated-button-icon>.tgico{height:24px;line-height:24px;position:absolute}body:not(.animation-level-0) .animated-button-icon>.tgico{animation:hide-icon .4s ease-in-out forwards}body.animation-level-0 .animated-button-icon>.tgico{animation:none!important;visibility:hidden}.autocomplete-helper{--border-radius:10px;border-radius:var(--border-radius)!important;bottom:calc(100% + .5rem);left:0;max-width:100%;overflow:hidden;padding:0!important;position:absolute!important;width:auto!important}.autocomplete-helper:not(.is-visible){display:none}.autocomplete-helper.is-visible{visibility:hidden}body.animation-level-2 .autocomplete-helper.is-visible{animation:fade-out-opacity .2s ease-in-out forwards;transition:visibility 0s .2s}.bubbles:not(.is-selecting)~.chat-input .autocomplete-helper.is-visible:not(.backwards){visibility:visible}body.animation-level-2 .bubbles:not(.is-selecting)~.chat-input .autocomplete-helper.is-visible:not(.backwards){animation-name:fade-in-opacity;transition:visibility 0s 0s}@media only screen and (max-width:319px){.autocomplete-helper{max-width:calc(100vw - var(--padding-horizontal)*4)}}.autocomplete-peer-helper .scrollable{max-height:232px;position:relative}.autocomplete-peer-helper-list{padding:.5rem 0}.autocomplete-peer-helper-list-element{align-items:center;cursor:pointer;display:flex;height:3.125rem;line-height:var(--line-height);padding:0 2.125rem 0 .75rem;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media only screen and (max-width:600px){.autocomplete-peer-helper-list-element{padding-right:.75rem}}.autocomplete-peer-helper-list-element-name{flex:0 0 auto;font-weight:var(--font-weight-bold);margin-left:.875rem}.autocomplete-peer-helper-list-element-description{color:var(--secondary-text-color);margin-left:.5625rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.autocomplete-peer-helper-list-element-avatar{flex:0 0 auto}.badge{--size:1.375rem;--padding:.4375rem;border-radius:calc(var(--size)/2);color:var(--badge-text-color);font-size:.875rem;font-weight:var(--font-weight-bold);height:var(--size);line-height:var(--size)!important;min-width:var(--size);padding:0 var(--padding);text-align:center}body.animation-level-2 .badge{transition:background-color .2s ease-in-out}.badge:not(.tgico):empty{display:none}.badge-20{--size:1.25rem;--padding:.375rem}.badge-24{--size:1.5rem;--padding:.5rem}.badge.tgico:before{font-size:var(--size)}.badge-primary{background-color:var(--primary-color)}.badge-gray{background-color:var(--secondary-color)}.ckin__player{letter-spacing:.02em;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ckin__player.ckin__fullscreen{background:#000;border-radius:0!important;bottom:0;display:flex;height:100%;left:0;position:fixed;right:0;top:0;width:100%;z-index:10000000}.ckin__player.ckin__fullscreen video{height:100%;-o-object-fit:contain;object-fit:contain;width:100%}.ckin__player .time{color:#fff;font-size:.875rem;margin-left:.875rem}@media only screen and (max-width:600px){.ckin__player .time{margin-left:1.125rem}}.default{align-items:center;display:flex;font-size:0;justify-content:center;position:relative}.default.show-controls video{cursor:pointer}.default__button{color:#fff;padding:.375rem}.default__button i{align-self:center}.default__button--big{background:none;border:0;color:#fff;font-size:4rem;left:50%;line-height:1;opacity:1;outline:0;padding:0;position:absolute;text-align:center;top:50%;transform:translate3d(-50%,-50%,0) scale(1)}@media only screen and (min-width:601px){.default__button--big{pointer-events:none}}body.animation-level-2 .default__button--big{transition:opacity var(--layer-transition)}@media only screen and (max-width:600px){.default__button--big{font-size:3rem}}.default:not(.played) .default__button--big{opacity:0}[dir=ltr] .default__controls{text-align:left}[dir=rtl] .default__controls{text-align:right}.default__controls{bottom:0;direction:ltr;left:0;position:absolute;right:0;z-index:6}body.animation-level-2 .default__controls{transition:transform var(--layer-transition)}.default__controls .progress-line{border-radius:var(--border-radius);margin:0 16px}.default__controls .progress-line__filled{background:var(--primary-color)}.default__controls .progress-line__loaded{background-color:#fff}.default__controls .progress-line{background:hsla(0,0%,100%,.38)}@media only screen and (max-width:600px){.default__controls .progress-line{margin-bottom:-1px}}.default__gradient-bottom{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==);background-position:bottom;background-repeat:repeat-x;bottom:0;height:49px;padding-top:93px;pointer-events:none;position:absolute;width:100%;z-index:2}body.animation-level-2 .default__gradient-bottom{transition:transform var(--layer-transition)}@media only screen and (max-width:600px){.default:not(.ckin__fullscreen) .default__gradient-bottom{display:none}}.default .toggle:before{content:""}.default .default__gradient-bottom{transform:translate3d(0,50px,0)}.default .default__controls{transform:translate3d(0,52px,0)}@media only screen and (max-width:600px){.default .default__controls{transform:translate3d(0,65px,0)}}.default.show-controls .default__controls,.default.show-controls .default__gradient-bottom{transform:translateZ(0)}.default.is-playing:not(.show-controls){cursor:none}.default.is-playing .default__button--big,.default.is-seeking .default__button--big,.default:not(.played) .default__button--big{opacity:0}.default.is-playing .toggle:not(.default__button--big):before,.default.is-seeking .toggle:not(.default__button--big):before,.default:not(.played) .toggle:not(.default__button--big):before{content:""}.default .is-seeking+.default__button--big{opacity:0}.default .player-volume{--icon-size:2.25rem;--icon-margin-right:.5rem;--selector-size:50px;--selector-thumb-size:.75rem;--hide-width:var(--icon-size);--show-width:calc(var(--icon-size) + var(--icon-margin-right) + var(--selector-size) + var(--selector-thumb-size)*0.75);align-items:center;display:flex;overflow:hidden;width:var(--hide-width)}body.animation-level-2 .default .player-volume{transition:width var(--layer-transition)}html.is-touch .default .player-volume{display:none}html:not(.is-touch) .default .player-volume+.time{margin-left:.5rem}html.no-touch .default .player-volume:active,html.no-touch .default .player-volume:hover{width:var(--show-width)}.default .player-volume__icon{color:#fff;cursor:pointer;display:flex;font-size:1.5rem;height:var(--icon-size);margin-right:var(--icon-margin-right);padding:.375rem;width:var(--icon-size)}.default .player-volume .progress-line{--color:#fff;--thumb-size:var(--selector-thumb-size);--height:4px;margin:0;min-width:var(--selector-size);width:var(--selector-size)}html.is-ios .default .player-volume .progress-line{display:none}.default.is-buffering>.toggle{display:none!important}video::-webkit-media-controls-enclosure{display:none!important}.progress-line{--color:var(--primary-color);--height:5px;--border-radius:6px;--thumb-size:13px;border-radius:var(--border-radius);cursor:pointer;height:var(--height);position:relative}.progress-line:before{border-radius:inherit;bottom:0;content:" ";display:block;left:0;position:absolute;right:0;top:0}.progress-line__seek{-webkit-appearance:none;-moz-appearance:none;background:transparent;bottom:-.5rem;caret-color:var(--color);cursor:pointer;margin:0;outline:none;padding:0;position:absolute;top:-.5rem;width:100%}.progress-line__seek:focus{outline:none}.progress-line__seek::-webkit-slider-thumb{display:none}.progress-line__seek::-moz-range-thumb{display:none;height:0;width:0}.progress-line__seek::-moz-range-track{display:none}.progress-line__seek::-webkit-slider-runnable-track{display:none}.progress-line__filled{max-width:100%}.progress-line__filled:not(.progress-line__loaded){background-color:var(--color);z-index:1}.progress-line__filled:not(.progress-line__loaded):after{background-color:var(--color);border-radius:50%;content:" ";cursor:pointer;display:block;height:var(--thumb-size);position:absolute;right:0;top:calc((var(--thumb-size) - var(--height))/-2);transform:translateX(calc(var(--thumb-size)/2)) scale(1);width:var(--thumb-size)}body.animation-level-2 .progress-line__filled:not(.progress-line__loaded):after{transition:transform .125s ease-in-out}.progress-line.is-focused .progress-line__filled:not(.progress-line__loaded):after{transform:translateX(calc(var(--thumb-size)/2)) scale(1.125)}.progress-line:before,.progress-line__loaded{background-color:var(--secondary-color);opacity:.3}.progress-line__filled,.progress-line__loaded{border-radius:var(--border-radius);bottom:0;position:absolute;top:0}body.animation-level-2 .progress-line.with-transition .progress-line__filled{transition:width .2s}.progress-line.use-transform .progress-line__filled{transform-origin:left center;width:100%}input[type=range]::-ms-track{visibility:hidden}input[type=range]::-ms-ticks{background:none;border:none;color:none}input[type=range]::-ms-thumb,input[type=range]::-ms-tooltip{visibility:hidden}.bottom-controls,.left-controls,.right-controls{align-items:center;display:flex}.bottom-controls{height:2.25rem;justify-content:space-between;padding:0 .625rem}@media only screen and (max-width:600px){.bottom-controls{height:3.625rem}}[dir=ltr] .checkbox-field{text-align:left}[dir=rtl] .checkbox-field{text-align:right}.checkbox-field{--size:1.25rem;--offset-left:0px;cursor:pointer;display:block;margin:1.5rem 1.1875rem;min-height:var(--size);min-width:var(--size);position:relative}body.animation-level-2 .checkbox-field{transition:opacity .2s}.checkbox-field.checkbox-disabled{opacity:var(--disabled-opacity);pointer-events:none!important}@media only screen and (max-width:600px){.checkbox-field{margin-bottom:27px}}[dir=ltr] .checkbox-field .checkbox-box{left:var(--offset-left)}[dir=rtl] .checkbox-field .checkbox-box{right:var(--offset-left)}.checkbox-field .checkbox-box{border-radius:.3125rem;height:var(--size);overflow:hidden;position:absolute;top:50%;transform:translateY(-50%);width:var(--size)}html.is-safari .checkbox-field .checkbox-box{-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}.checkbox-field .checkbox-box-background,.checkbox-field .checkbox-box-border,.checkbox-field .checkbox-box-check{left:0;position:absolute;top:0}.checkbox-field .checkbox-box-border{border:2px solid #8d969c;border-radius:inherit;bottom:0;left:0;right:0}.checkbox-field .checkbox-box-background{background-color:var(--primary-color);border-radius:50%;bottom:-15%;left:-15%;right:-15%;top:-15%;transform:scale(0);transition:transform .2s ease-in-out .05s}body.animation-level-0 .checkbox-field .checkbox-box-background{transition:none!important}.checkbox-field .checkbox-box-check{--offset:7px;height:calc(var(--size) - var(--offset));left:50%;top:50%;transform:translate(-50%,-50%);width:calc(var(--size) - var(--offset))}.checkbox-field .checkbox-box-check use{stroke:#fff;stroke-width:3.75;stroke-linecap:round;stroke-dasharray:0,24.19;stroke-dashoffset:0;transition:stroke-dasharray .1s ease-in-out,visibility 0s .1s;visibility:hidden}body.animation-level-0 .checkbox-field .checkbox-box-check use{transition:none!important}[dir=ltr] .checkbox-field .checkbox-caption{padding-left:3.375rem}[dir=rtl] .checkbox-field .checkbox-caption{padding-right:3.375rem}.checkbox-field .checkbox-caption{color:inherit;line-height:var(--line-height);overflow:hidden;pointer-events:none;position:relative;text-overflow:ellipsis;transition:opacity .2s;word-break:break-word}body.animation-level-0 .checkbox-field .checkbox-caption{transition:none}.checkbox-field.hover-effect{align-items:center;display:flex;height:3.5rem;margin-left:0;margin-right:0;padding:0 1.1875rem}[dir=ltr] .checkbox-field.hover-effect .checkbox-box{left:auto}[dir=rtl] .checkbox-field.hover-effect .checkbox-box{right:auto}.checkbox-field .anchor-url{pointer-events:all}.checkbox-ripple{border-radius:10px;overflow:hidden}.checkbox-ripple .checkbox-box,.checkbox-ripple .checkbox-caption{pointer-events:none}.checkbox-field-round{--size:1.5rem}.checkbox-field-round .checkbox-box{border-radius:50%;overflow:auto}.checkbox-field-round .checkbox-box-background{bottom:0;left:0;right:0;top:0}.checkbox-field-round .checkbox-box-border{border:2px solid var(--secondary-color);z-index:1}.checkbox-field-round .checkbox-box-check{--offset:calc(var(--size) - var(--size)/2 - 0.125rem)}html.is-safari .checkbox-field-round .checkbox-box{-webkit-mask-image:none}[dir=ltr] .radio-field{text-align:left}[dir=rtl] .radio-field{text-align:right}.radio-field{--size:1.375rem;--offset-left:0px;cursor:pointer;line-height:var(--line-height);margin:1.25rem 0;position:relative}.radio-field.hidden-widget{cursor:default}.radio-field.hidden-widget .radio-field-main:after,.radio-field.hidden-widget .radio-field-main:before{visibility:hidden}.radio-field>input:checked~.radio-field-main:before{border-color:var(--primary-color)}.radio-field>input:checked~.radio-field-main:after{transform:translateY(-50%) scale(1)}[dir=ltr] .radio-field .radio-field-main{padding-left:3.5rem}[dir=rtl] .radio-field .radio-field-main{padding-right:3.5rem}.radio-field .radio-field-main{color:inherit;position:relative}[dir=ltr] .radio-field .radio-field-main:after,[dir=ltr] .radio-field .radio-field-main:before{left:var(--offset-left)}[dir=rtl] .radio-field .radio-field-main:after,[dir=rtl] .radio-field .radio-field-main:before{right:var(--offset-left)}.radio-field .radio-field-main:after,.radio-field .radio-field-main:before{content:"";display:block;height:var(--size);position:absolute;top:50%;transform:translateY(-50%);width:var(--size)}.radio-field .radio-field-main:before{border:2px solid var(--secondary-text-color);border-radius:50%;opacity:1}body.animation-level-2 .radio-field .radio-field-main:before{transition:border-color .1s ease,opacity .1s ease}[dir=ltr] .radio-field .radio-field-main:after{left:calc(var(--offset-left) + .3125rem)}[dir=rtl] .radio-field .radio-field-main:after{right:calc(var(--offset-left) + .3125rem)}.radio-field .radio-field-main:after{background:var(--primary-color);border-radius:50%;height:.75rem;transform:translateY(-50%) scale(0);transform-origin:center;width:.75rem}body.animation-level-2 .radio-field .radio-field-main:after{transition:transform .1s ease}[dir=ltr] .radio-field.radio-field-right .radio-field-main:before{left:auto;right:0}[dir=rtl] .radio-field.radio-field-right .radio-field-main:before{left:0;right:auto}[dir=ltr] .radio-field.radio-field-right .radio-field-main:after{left:auto;right:.3125rem}[dir=rtl] .radio-field.radio-field-right .radio-field-main:after{left:.3125rem;right:auto}[type=checkbox],[type=radio]{box-sizing:border-box;opacity:0;padding:0;position:absolute;z-index:var(--z-below)}.checkbox-field .checkbox-field-input:checked:not(.is-fake-disabled)+.checkbox-box .checkbox-box-check use{stroke-dasharray:24.19,24.19;transition:stroke-dasharray .1s ease-in-out .15s,visibility 0s .15s;visibility:visible}.checkbox-field .checkbox-field-input:checked:not(.is-fake-disabled)+.checkbox-box .checkbox-box-background{transform:scale(1);transition:transform .2s ease-in-out 0s}.checkbox-field .checkbox-field-input:disabled+.checkbox-box,.checkbox-field .checkbox-field-input:disabled~.checkbox-caption{cursor:default;opacity:var(--disabled-opacity)}.checkbox-field-restriction .checkbox-box-border{display:none}.checkbox-field-restriction .checkbox-box-background{transform:none!important;transition:background-color .2s!important}.checkbox-field-restriction .checkbox-box-check use{stroke-dasharray:24.19,24.19!important;transform:rotate(0) translateY(0);transition:stroke-dashoffset .2s ease-in-out,transform .2s ease-in-out!important;visibility:visible!important}.checkbox-field-restriction [type=checkbox]:not(:checked)+.checkbox-box .checkbox-box-check use{stroke-dashoffset:35.5;transform:rotate(45deg) translateY(-10px)}.checkbox-field-restriction [type=checkbox]:not(:checked)+.checkbox-box .checkbox-box-background{background-color:var(--danger-color)}.checkbox-field-toggle{--size:20px;align-items:center;display:flex;margin:0 .3125rem;padding:0 .25rem;pointer-events:none}.checkbox-field-toggle .checkbox-toggle{--offset:3px;--toggle-width:1.9375rem;align-items:center;background-color:var(--secondary-color);border-radius:12px;display:flex;height:.875rem;margin:0 var(--offset);position:relative;width:var(--toggle-width)}body.animation-level-2 .checkbox-field-toggle .checkbox-toggle{transition:background-color .1s}.checkbox-field-toggle .checkbox-toggle:before{background-color:var(--surface-color);border:2px solid var(--secondary-color);border-radius:50%;content:" ";height:1.25rem;position:absolute;transform:translateX(calc(var(--offset)*-1));width:1.25rem}body.animation-level-2 .checkbox-field-toggle .checkbox-toggle:before{transition:border-color .1s,transform .1s cubic-bezier(.22,.75,.7,1.3)}.checkbox-field-toggle-restriction .checkbox-toggle{background-color:var(--danger-color)}.checkbox-field-toggle-restriction .checkbox-toggle:before{border-color:var(--danger-color)}.checkbox-field-toggle [type=checkbox]:checked:not(.is-fake-disabled)+.checkbox-toggle{background-color:var(--primary-color)}.checkbox-field-toggle [type=checkbox]:checked:not(.is-fake-disabled)+.checkbox-toggle:before{border-color:var(--primary-color);transform:translateX(calc(var(--toggle-width) - 1.25rem + var(--offset)))}.chatlist-container{position:relative}@media only screen and (max-width:600px){.chatlist-container .search-group-recent.search-group{padding:2px 0 0}}.chatlist-container .search-group{margin-bottom:17px;padding:1rem 0 .5rem;width:100%}@media only screen and (max-width:600px){.chatlist-container .search-group{margin-bottom:0}}.chatlist-container .search-group__name{color:var(--secondary-text-color);font-weight:var(--font-weight-bold);padding:0 23px 1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media only screen and (max-width:600px){.chatlist-container .search-group__name{font-size:15px;padding:5px 9px 0 16px}}.chatlist-container .search-group-contacts{border-bottom:1px solid var(--border-color)}@media only screen and (max-width:600px){.chatlist-container .search-group-contacts{padding:0 0 2px}}.chatlist-container .search-group-people.search-group-contacts{padding:5px 0!important}.chatlist-container .search-group:last-child{border-bottom:none}.chatlist-container .search-super .search-group{margin-bottom:0;padding:0 0 .5rem}.chatlist-container .search-super .search-group__name{display:flex;justify-content:space-between;padding-top:1rem}ul.chatlist{padding:0 .5rem}@media only screen and (max-width:600px){ul.chatlist{padding:0}}.chatlist{-webkit-touch-callout:none;background-color:var(--surface-color);display:flex;flex-direction:column;margin:0;position:relative;-moz-user-select:none;user-select:none;-webkit-user-select:none;width:100%}.chatlist-chat{--background:unset;-webkit-user-drag:none;background:var(--background)!important}.chatlist-chat.is-forum-open,.chatlist-chat.menu-open,html.no-touch .chatlist-chat:active,html.no-touch .chatlist-chat:hover{--background:var(--light-filled-secondary-text-color)}[dir=ltr] .chatlist-chat.is-muted .user-title:after{margin-left:.125rem}[dir=rtl] .chatlist-chat.is-muted .user-title:after{margin-right:.125rem}.chatlist-chat.is-muted .user-title:after{color:var(--chatlist-pinned-color);content:"";flex:0 0 auto;font-size:1.125rem}body:not(.animation-level-0) .chatlist-chat.is-muted.animating:not(.backwards) .user-title:after{animation:fade-in-opacity .2s ease-in-out forwards}body:not(.animation-level-0) .chatlist-chat.is-muted.animating.backwards .user-title:after{animation:fade-in-backwards-opacity .2s ease-in-out forwards}.chatlist-chat i{font-style:normal}.chatlist-chat .text-highlight{color:var(--primary-text-color)}.chatlist-chat .premium-icon{margin-top:-.125rem}.chatlist-chat .topic-icon{flex:0 0 auto}[dir=ltr] .chatlist-chat .row-title .topic-icon{margin-right:.25rem}[dir=rtl] .chatlist-chat .row-title .topic-icon{margin-left:.25rem}.chatlist-chat .row-title .topic-icon{--size:1.375rem}.chatlist-chat .topic-name .topic-icon{display:inline;line-height:1!important}.chatlist-chat .topic-name .topic-icon-svg{position:relative}.chatlist-chat .topic-name .topic-icon-content{left:0;margin-top:-6px;position:absolute;right:0;top:0}@media only screen and (min-width:601px){.chatlist-chat.active{--background:var(--primary-color)!important}.chatlist-chat.active .message-status,.chatlist-chat.active .premium-icon,.chatlist-chat.active .row-subtitle,.chatlist-chat.active .row-title,.chatlist-chat.active .sending-status-icon,.chatlist-chat.active .text-highlight,.chatlist-chat.active .tgico-chatspinned:before,.chatlist-chat.active .user-title,.chatlist-chat.active .verified-icon{color:#fff!important}.chatlist-chat.active .badge-fake{border-color:#fff;color:#fff}.chatlist-chat.active .danger,.chatlist-chat.active .primary-text{color:#fff!important}.chatlist-chat.active .user-title:after{color:hsla(0,0%,100%,.7)}.chatlist-chat.active .verified-icon-background{fill:#fff!important}.chatlist-chat.active .verified-icon-check{visibility:hidden}.chatlist-chat.active .dialog-avatar.is-online:after,.chatlist-chat.active .dialog-group-call-icon{background-color:#fff;border-color:var(--primary-color)}.chatlist-chat.active .badge.unread,.chatlist-chat.active .mention{background-color:#fff!important;color:var(--primary-color)}.chatlist-chat.active .peer-typing-container{--color:#fff}}.chatlist .peer-typing-container{--color:var(--secondary-text-color)}.chatlist .peer-typing-container .peer-typing-text{display:inline-flex;transform:translateY(-2px)}.chatlist .sending-status-icon.tgico-premium_lock{color:var(--secondary-color);font-size:.8125rem;margin:.1875rem 0 0 .5rem}[dir=ltr] .chatlist .dialog-title-details{margin-left:.5rem}[dir=rtl] .chatlist .dialog-title-details{margin-right:.5rem}.chatlist .dialog-title-details{flex:0 0 auto;font-size:.75rem;padding:1px 0 0}[dir=ltr] .chatlist .dialog-subtitle-badge{margin-left:.5rem}[dir=rtl] .chatlist .dialog-subtitle-badge{margin-right:.5rem}.chatlist .dialog-subtitle-badge{display:block!important;flex:0 0 auto}.chatlist .dialog-subtitle-badge.avatar-badge{--size:1.625rem;border:2px solid var(--background,var(--surface-color));line-height:23px!important;margin:0;pointer-events:none;position:absolute;right:calc(100% - 4.0625rem);top:2.4375rem}[dir=ltr] .chatlist .dialog-subtitle-media{margin-right:.375rem}[dir=rtl] .chatlist .dialog-subtitle-media{margin-left:.375rem}.chatlist .dialog-subtitle-media{border-radius:.25rem;display:inline-block;flex:0 0 auto;height:1.25rem;line-height:1.25rem;position:relative;width:1.25rem}.chatlist .dialog-subtitle-media:before{content:" ";display:inline-block;height:inherit;min-height:inherit;min-width:inherit;width:inherit}.chatlist .dialog-subtitle-media.is-round{border-radius:50%}.chatlist .dialog-subtitle-media.is-round .tgico-play{font-size:.875rem}.chatlist .dialog-subtitle-media .tgico-play{color:#fff;font-size:1rem;left:50%;line-height:1;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:1}.chatlist .dialog-subtitle-media .media-photo{border-radius:inherit;bottom:auto;height:inherit;-o-object-fit:cover;object-fit:cover;top:auto;width:inherit}.chatlist .dialog-group-call-icon{background-color:var(--avatar-online-color);border:2px solid var(--surface-color);border-radius:50%;height:20px;left:45px;overflow:hidden;position:absolute;top:45px;width:20px;z-index:2}body.animation-level-2 .chatlist .dialog-group-call-icon,body.animation-level-2 .chatlist .dialog-subtitle-badge{opacity:1;transform:scale(0);transition:none}body.animation-level-2 .chatlist .dialog-group-call-icon.is-visible:not(.backwards),body.animation-level-2 .chatlist .dialog-subtitle-badge.is-visible:not(.backwards){transform:scale(1)}body.animation-level-2 .chatlist .dialog-group-call-icon.backwards,body.animation-level-2 .chatlist .dialog-subtitle-badge.backwards{opacity:0}body.animation-level-2 .chatlist .dialog-group-call-icon.animating,body.animation-level-2 .chatlist .dialog-subtitle-badge.animating{transition:background-color var(--chatlist-badge-transition-in),transform var(--chatlist-badge-transition-in)}body.animation-level-2 .chatlist .dialog-group-call-icon.animating.backwards,body.animation-level-2 .chatlist .dialog-subtitle-badge.animating.backwards{transition:background-color var(--chatlist-badge-transition-out),transform var(--chatlist-badge-transition-out),opacity var(--chatlist-badge-transition-out)}body.animation-level-2 .chatlist .dialog-avatar:after{opacity:1;transform:scale(0);transition:none}body.animation-level-2 .chatlist .dialog-avatar.is-visible:not(.backwards):after{transform:scale(1)}body.animation-level-2 .chatlist .dialog-avatar.backwards:after{opacity:0}body.animation-level-2 .chatlist .dialog-avatar.animating:after{transition:background-color var(--chatlist-badge-transition-in),transform var(--chatlist-badge-transition-in)}body.animation-level-2 .chatlist .dialog-avatar.animating.backwards:after{transition:background-color var(--chatlist-badge-transition-out),transform var(--chatlist-badge-transition-out),opacity var(--chatlist-badge-transition-out)}.chatlist .dialog-avatar{flex:0 0 auto}.chatlist .dialog-avatar,.chatlist .row-row{pointer-events:none;position:relative}.chatlist .user-title{align-items:center;display:flex!important}.chatlist .user-title img.emoji{height:18px;margin-top:1px;vertical-align:top;width:18px}.chatlist .user-last-message img.emoji{height:20px;margin-top:-3px;width:20px}.chatlist .user-last-message,.chatlist .user-title{flex-grow:1;position:relative}[dir=ltr] .chatlist .message-status{margin-right:.125rem}[dir=rtl] .chatlist .message-status{margin-left:.125rem}.chatlist .message-status{color:var(--chatlist-status-color);display:inline-block;font-size:1.25rem;height:1.25rem;line-height:1;margin-top:-.0625rem;position:relative;vertical-align:middle;width:1.25rem}.chatlist .message-status:before{vertical-align:middle}.chatlist .tgico-chatspinned{background:transparent}body.animation-level-2 .chatlist .tgico-chatspinned:before{transition:opacity .2s ease-in-out}.chatlist .tgico-chatspinned:before{color:var(--chatlist-pinned-color);opacity:1}.chatlist .tgico-chatspinned.unread:before{opacity:0}.chatlist .tgico-chatspinned{position:relative}.chatlist .tgico-chatspinned:before{left:0;position:absolute;top:0}.chatlist .mention{background-color:var(--chatlist-status-color)!important;line-height:1.25rem!important;padding:0}[dir=ltr] .chatlist .mention-badge{margin-right:-.125rem}[dir=rtl] .chatlist .mention-badge{margin-left:-.125rem}.chatlist .is-muted.backwards .unread,.chatlist .unread{background-color:var(--chatlist-status-color)}.chatlist .is-muted .unread,.chatlist .no-unmuted-topic .unread{background-color:var(--secondary-color)}.chatlist .not-visited{--size:.5rem;--padding:0;background-color:var(--secondary-color)!important}.chatlist-parts.with-contacts .chatlist-top:not(.with-placeholder){height:auto;padding-bottom:.5rem}.chatlist-parts.with-contacts .chatlist-top.with-placeholder.has-contacts{height:24.125rem}.chatlist-parts.with-contacts .chatlist-top.with-placeholder .empty-placeholder-dialogs{top:50%}.chatlist-top{height:100%}.chatlist-bottom{max-height:36.375rem}.chatlist-bottom .sidebar-left-section{margin-bottom:0!important;padding-bottom:0}.chatlist-bottom .chatlist-new{padding:0}.chat-input{--translateY:0;--padding-bottom:0.5rem;--bottom:var(--padding-bottom);display:flex;flex:0 0 auto;flex-direction:column;max-width:100%;padding-top:.25rem;position:relative;transform:translate3d(0,var(--translateY),0);transition:transform var(--transition-standard-out);width:100%}body.animation-level-0 .chat-input{transition:none!important}@media only screen and (min-height:570px)and (min-width:601px){.chat-input{max-width:var(--messages-container-width)!important}}@media only screen and (min-width:601px){.chat-input{--padding-bottom:1.25rem}}@media only screen and (max-height:569px){.chat-input{--padding-bottom:0.5rem}}@media only screen and (min-width:1276px){.chat-input{width:calc(100% - var(--right-column-width))!important}body.is-right-column-shown .chat-input{transform:translate3d(calc(var(--right-column-width)/-2),var(--translateY),0)!important;transition:transform var(--transition-standard-in)}}.chat-input.is-hidden{--translateY:100%;bottom:0;position:absolute!important;transform:translate3d(0,var(--translateY),0)!important;transition:transform var(--transition-standard-in)}.bubbles.is-selecting:not(.backwards)~.chat-input.is-hidden{--translateY:0}.chat-input-container{--padding-horizontal:var(--chat-input-padding);align-items:flex-end;display:flex;flex:0 0 auto;justify-content:center;margin:0 auto;max-width:var(--messages-container-width);padding:0 var(--padding-horizontal);padding-bottom:var(--bottom);position:relative;width:100%}.chat-input-container .btn-circle{height:var(--chat-input-size);width:var(--chat-input-size)}.chat-input-container.is-centering .new-message-wrapper{pointer-events:none}.chat-input-container.is-centering:not(.backwards) .new-message-wrapper{opacity:0}.chat-input-container.is-centering:not(.backwards) .rows-wrapper{border-bottom-right-radius:12px;max-height:var(--chat-input-size)}.chat-input-container.is-centering:not(.backwards) .rows-wrapper .bubble-tail{opacity:0;transform:scaleX(-1) translateX(1.125rem)}.chat-input-container.is-centering:not(.backwards) .reply-wrapper{height:0!important;opacity:0;pointer-events:none}.chat-input-container.is-centering:not(.backwards) .btn-send{transform:scale(0)}.chat-input-container.is-centering.animating .rows-wrapper{transition:transform .2s,max-height .2s,border-radius .1s}.chat-input-container.is-centering.animating .rows-wrapper .bubble-tail{transition:transform .1s,opacity 25ms 0s}.chat-input-container.is-centering.animating .selection-wrapper{transition:opacity .1s 75ms}.chat-input-container.is-centering.animating .btn-send{transition:transform .2s}.chat-input-container.is-centering.animating:not(.backwards) .rows-wrapper .bubble-tail{transition:transform .1s,opacity 25ms 75ms}.chat-input .menu-send{bottom:calc(100% + .5rem);top:auto}.chat-input .toggle-emoticons:before{content:""}.chat-input .toggle-emoticons.flip-icon:before{content:""!important}[dir=ltr] .chat-input .btn-record-cancel{right:0}[dir=rtl] .chat-input .btn-record-cancel{left:0}.chat-input .btn-record-cancel{--multiplier:-1;opacity:0;padding:0;position:absolute;top:0;transform:translateX(calc((100% + var(--padding-horizontal) + .5rem)*var(--multiplier)));visibility:hidden;z-index:3}.chat-input .btn-record-cancel .c-ripple__circle,html.no-touch .chat-input .btn-record-cancel:active:after,html.no-touch .chat-input .btn-record-cancel:hover:after{background-color:var(--light-danger-color)}.chat-input .btn-record-cancel:before{color:var(--danger-color)}.is-rtl .chat-input .btn-record-cancel{--multiplier:1}[dir=ltr] .chat-input .btn-scheduled:after{right:5px}[dir=rtl] .chat-input .btn-scheduled:after{left:5px}.chat-input .btn-scheduled:after{background:var(--message-checkbox-color);border-radius:50%;content:"";height:.5rem;position:absolute;top:5px;width:.5rem}.chat-input .btn-preloader .preloader{height:1.5rem;width:1.5rem}.chat-input .btn-preloader .preloader .preloader-path{stroke:var(--secondary-text-color)}body.animation-level-2 .chat-input .btn-preloader.show.backwards{animation:hide-icon .4s ease-in-out forwards!important}[dir=ltr] .chat-input .float{margin-right:.75rem!important}[dir=rtl] .chat-input .float{margin-left:.75rem!important}.chat-input .float{align-self:center;display:none!important;margin:0!important}body.animation-level-2 .chat-input .float{animation:grow-icon .4s ease-in-out forwards!important}@media only screen and (max-height:569px),only screen and (max-width:600px){[dir=ltr] .chat-input .float{margin-right:.125rem!important}[dir=rtl] .chat-input .float{margin-left:.125rem!important}}.chat-input:not(.is-recording) .float.show:not(.hide){display:flex!important}[dir=ltr] .chat-input .btn-send-container{right:var(--padding-horizontal)}[dir=rtl] .chat-input .btn-send-container{left:var(--padding-horizontal)}.chat-input .btn-send-container{align-items:center;bottom:0;display:flex;justify-content:center;padding-bottom:inherit;position:absolute}.chat-input .btn-send-container .btn-menu-overlay{z-index:3}.chat-input .btn-icon{transition:opacity .2s}body.animation-level-0 .chat-input .btn-icon{transition:none}.chat-input .btn-cancel-record,.chat-input .btn-send{box-shadow:0 1px 8px 1px rgba(0,0,0,.12)}.chat-input .btn-send{background-color:var(--primary-color)!important;color:#fff!important;z-index:3}html.no-touch .chat-input .btn-send:active,html.no-touch .chat-input .btn-send:hover{background-color:var(--dark-primary-color)!important}.chat-input .btn-send .tgico-check{font-size:2rem;height:32px!important}.chat-input .btn-send .tgico-check:before{font-weight:var(--font-weight-bold)}.chat-input .btn-send.edit .tgico-check,.chat-input .btn-send.record .tgico-microphone_filled,.chat-input .btn-send.schedule .tgico-schedule,.chat-input .btn-send.send .tgico-send{visibility:visible!important}body.animation-level-2 .chat-input .btn-send.edit .tgico-check,body.animation-level-2 .chat-input .btn-send.record .tgico-microphone_filled,body.animation-level-2 .chat-input .btn-send.schedule .tgico-schedule,body.animation-level-2 .chat-input .btn-send.send .tgico-send{animation:grow-icon .4s ease-in-out forwards!important}.chat-input .btn-record-cancel,.chat-input .btn-send{font-size:1.5rem;line-height:1.5rem}.chat-input .record-time{display:none;height:44px;line-height:44px}.chat-input .record-time:after{background-color:var(--danger-color);border-radius:50%;content:" ";display:inline-block;height:10px;margin-left:9px;margin-right:9px;width:10px}body.animation-level-2 .chat-input .record-time:after{animation:recordBlink 1.25s infinite}.chat-input .record-ripple{background-color:var(--message-highlightning-color);border-radius:50%;height:300px;opacity:.5;position:absolute;transform:scale(0);visibility:hidden;width:300px}@media only screen and (max-width:600px){.chat-input .record-ripple{height:240px;width:240px}}.chat-input.is-locked{pointer-events:none}.chat-input.is-locked .btn-icon,.chat-input.is-locked:not(.is-recording) .btn-send{color:#c6cbce}.chat-input.is-recording:not(.backwards) .btn-record-cancel{opacity:1;visibility:visible}.chat-input.is-recording:not(.backwards) .btn-record-cancel,.chat-input.is-recording:not(.backwards) .btn-send{pointer-events:all}.chat-input.is-recording:not(.backwards) .record-ripple{visibility:visible}.chat-input.is-recording:not(.backwards) .rows-wrapper{width:calc(100% - var(--chat-input-size)*2 - 1rem)}.chat-input.is-recording:not(.backwards) .attach-file{display:none}.chat-input.is-recording:not(.backwards) .record-time{display:block}.chat-input.is-recording.animating .btn-record-cancel{transition:visibility 0s .1s,opacity .1s 0s}.chat-input.is-recording.animating .record-ripple{transition:transform .03s ease-in-out,visibility .1s}.chat-input.is-recording.animating .rows-wrapper{transition:width .2s}.chat-input.is-recording.animating:not(.backwards) .btn-record-cancel{transition:visibility 0s .1s,opacity .1s .1s}.chat-input.is-recording.animating:not(.backwards) .record-ripple{transition:transform .03s,visibility 0s}[dir=ltr] .chat-input:not(.is-recording) .btn-record-cancel{margin-right:0}[dir=rtl] .chat-input:not(.is-recording) .btn-record-cancel{margin-left:0}.chat-input:not(.is-recording) .btn-record-cancel{width:0}.chat-input .new-message-wrapper{opacity:1}.chat-input .reply-in-topic-overlay{align-items:center;background-color:inherit;border-radius:inherit;color:var(--secondary-text-color);display:flex;justify-content:center;padding:0 1rem;pointer-events:none;z-index:3}.bubbles.is-selecting:not(.backwards)~.chat-input .selection-wrapper{opacity:1}.bubbles.is-selecting.animating~.chat-input .new-message-wrapper{transition:opacity .1s 0s}.bubbles.is-selecting.animating~.chat-input .selection-container-left,.bubbles.is-selecting.animating~.chat-input .selection-container-right{transition:transform .2s}.bubbles.is-selecting.animating.backwards~.chat-input .new-message-wrapper{transition:opacity .1s .1s}.bubbles.is-selecting.animating.backwards~.chat-input .selection-wrapper{transition:opacity .1s 0s}@keyframes recordBlink{0%{opacity:1}50%{opacity:.2}to{opacity:1}}#column-center{flex:3;position:relative;width:100%}@media only screen and (max-width:600px){body.is-left-column-shown #column-center{transform:translate3d(100vw,0,0)}body.is-right-column-shown #column-center{filter:brightness(80%);transform:translate3d(-25vw,0,0)}}@media only screen and (min-width:601px)and (max-width:925px){#column-center{bottom:0;left:0;position:fixed!important;right:0;top:0;transform:translateZ(0)}body.animation-level-2 #column-center{transition:transform var(--layer-transition)}body.is-left-column-shown #column-center{transform:translate3d(26.5625rem,0,0)}body.is-left-column-shown #column-center .sidebar-close-button:before{transform:rotate(180deg)}}.chats-container{height:100%}.chat{align-items:center;display:flex!important;flex-direction:column;transition:transform var(--tabs-transition),filter var(--tabs-transition);width:100%}body.animation-level-0 .chat{transition:none!important}.chat:not(.active):not(:last-child){filter:brightness(.8)}@media only screen and (min-width:926px){.chat:not(.active){transform:translate3d(calc((100vw - min(40vw, 420px))*-.25),0,0)}.chat:not(.active):last-child{transform:translate3d(calc(100vw - min(40vw, 420px)),0,0)}}@media only screen and (min-width:1681px){.chat:not(.active){transform:translate3d(calc((1680px - var(--right-column-width))*-.25),0,0)}.chat:not(.active):last-child{transform:translate3d(calc(1680px - var(--right-column-width)),0,0)}}@media only screen and (min-width:1276px)and (max-width:1680px){.chat:not(.active){transform:translate3d(-25vw,0,0)}.chat:not(.active):last-child{transform:translate3d(75vw,0,0)}}@media only screen and (max-width:925px){.chat:not(.active){transform:translate3d(-25vw,0,0)}.chat:not(.active):last-child{transform:translate3d(100vw,0,0)}}.chat.no-forwards .bubble-beside-button.forward{display:none}.chat.no-forwards .bubbles{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.chat-background{background-color:#e6ebee;overflow:hidden}html.night .chat-background{background-color:var(--border-color)}.chat-background.no-transition:before{transition:none!important}.chat-background,.chat-background-item{bottom:0;left:0;position:absolute!important;right:0;top:0}.chat-background-item.is-image{background-color:inherit;background-image:url(assets/img/bg.jpeg);background-position:50%;background-size:cover}.chat-background-item.is-pattern{align-items:center;background-color:#000!important;background-image:none!important;background-repeat:repeat-x;background-size:contain;display:flex;justify-content:center;margin:0!important}@media only screen and (min-width:1276px){.chat-background-item.is-pattern{height:150%;top:-25%}}body.animation-level-2 .chat-background-item{opacity:0;transition:opacity var(--transition-standard-out)}body.animation-level-2 .chat-background-item.is-visible:not(.backwards){opacity:1;transition:opacity var(--transition-standard-in)}@media only screen and (min-width:1276px){body.animation-level-2 .chat-background-item{margin:-18.5rem 0 -22rem;transform:scale(1);transform-origin:left center;transition:transform var(--transition-standard-out),opacity var(--transition-standard-out)!important}body.animation-level-2.is-right-column-shown .chat-background-item{transform:scale(.666666667);transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)!important}}.chat-background-item-canvas{--opacity-max:1;opacity:var(--opacity-max);position:absolute;width:100%}.chat-background-item:not(.is-dark) .chat-background-item-pattern-canvas{mix-blend-mode:soft-light}.chat-background-item-color-canvas{height:100%;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:cover;mask-size:cover}.chat .drops-container{--padding:20px;--pinned-floating-height:0px;top:calc(56px + var(--pinned-floating-height) + var(--padding))}@media only screen and (min-width:1276px){[dir=ltr] body.is-right-column-shown .chat .drops-container{right:calc(var(--right-column-width))}[dir=rtl] body.is-right-column-shown .chat .drops-container{left:calc(var(--right-column-width))}}@media only screen and (max-width:600px){.chat .drops-container{--padding:10px}}.chat .drop{--wrapper-padding:15px;max-width:696px}.chat[data-type=chat] .bubbles.is-chat-input-hidden .bubbles-date-group:last-of-type .bubbles-group:last-of-type .bubble:last-of-type{margin-bottom:1.25rem}.chat-input-wrapper{--padding-vertical:.3125rem;--padding-horizontal:var(--chat-input-inner-padding);--padding:var(--padding-vertical) var(--padding-horizontal);--button-size:2.125rem;--button-horizontal-margin:.125rem;align-items:center;border-radius:1rem;display:flex;flex:0 0 auto;flex-direction:column;justify-content:center;max-height:30rem;max-width:calc(100% - var(--chat-input-size) - .5rem);min-height:var(--chat-input-size);position:relative;width:calc(100% - var(--chat-input-size) - .5rem);z-index:3}.chat-input-wrapper:before{background-color:#fff;border-radius:inherit;bottom:0;box-shadow:0 1px 8px 1px rgba(0,0,0,.12);content:" ";left:0;opacity:1;right:0;top:0}.chat-input-control,.chat-input-wrapper:before{background-color:var(--surface-color);position:absolute}.chat-input-control{--padding-vertical:.3125rem;--padding-horizontal:var(--chat-input-inner-padding);--padding:var(--padding-vertical) var(--padding-horizontal);height:var(--chat-input-size);margin:0 auto;padding:var(--padding);visibility:hidden;width:auto;z-index:3}.chat-input-control:before{opacity:0}.chat-input-control-button{height:2.5rem;justify-content:center;padding:0 .625rem}@media only screen and (max-width:600px){.chat-input-control-button{font-size:15px}}[dir=ltr] .chat-input-control-button:before{margin-right:10px}[dir=rtl] .chat-input-control-button:before{margin-left:10px}.fake-selection-wrapper,.selection-wrapper{max-width:calc(100% - var(--chat-input-padding)*2);position:absolute;top:0;width:28.75rem}.chat-input-control,.selection-wrapper{opacity:0}.selection-wrapper{background-color:var(--surface-color)}.selection-wrapper:before{content:none}.selection-wrapper .selection-container{align-items:center;border-radius:inherit;display:flex;font-size:15px;height:100%;justify-content:space-between;padding:inherit;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.selection-wrapper .selection-container-left,.selection-wrapper .selection-container-right{align-items:center;display:flex;justify-content:space-between;transform:translateX(0)}.selection-wrapper .selection-container-right{flex:0 0 auto}.selection-wrapper .selection-container-count{color:var(--primary-text-color);flex-grow:1;font-weight:var(--font-weight-bold);text-transform:capitalize;white-space:nowrap}[dir=ltr] .selection-wrapper .selection-container .btn-icon{margin-left:6px;margin-right:5px}[dir=rtl] .selection-wrapper .selection-container .btn-icon{margin-left:5px;margin-right:6px}.selection-wrapper .selection-container .btn-icon{height:42px;line-height:42px;width:42px}.selection-wrapper .selection-container .btn-primary{height:2.5rem;width:auto}@media only screen and (max-width:600px){.selection-wrapper .selection-container .btn-primary{padding:0 .5rem}.selection-wrapper .selection-container .btn-primary.tgico-send2{padding:0 2px}}@media only screen and (max-width:380px){.selection-wrapper .selection-container .btn-primary{font-size:0}.selection-wrapper .selection-container .btn-primary:before{margin:0}}[dir=ltr] .selection-wrapper .selection-container-forward:before{margin-right:14px}[dir=rtl] .selection-wrapper .selection-container-forward:before{margin-left:14px}[dir=ltr] .selection-wrapper .selection-container-delete{margin-left:.375rem;margin-right:.625rem}[dir=rtl] .selection-wrapper .selection-container-delete{margin-left:.625rem;margin-right:.375rem}[dir=ltr] .selection-wrapper .selection-container-delete:before{margin-right:10px}[dir=rtl] .selection-wrapper .selection-container-delete:before{margin-left:10px}.fake-wrapper{position:absolute;visibility:hidden;z-index:-1}[dir=ltr] .fake-rows-wrapper{left:var(--padding-horizontal)}[dir=rtl] .fake-rows-wrapper{right:var(--padding-horizontal)}.fake-rows-wrapper{top:0;width:calc(100% - var(--chat-input-size) - var(--padding-horizontal)*2 - .5rem)}.rows-wrapper-wrapper{display:flex;width:100%}.rows-wrapper-wrapper.is-centering-to-control:not(.backwards) .rows-wrapper:before{opacity:0}.rows-wrapper-wrapper.is-centering-to-control:not(.backwards)~.chat-input-control{opacity:1;visibility:visible}.rows-wrapper-wrapper.is-centering-to-control:not(.backwards)~.chat-input-control:before{opacity:1}.rows-wrapper-wrapper.is-centering-to-control.animating .rows-wrapper:before,.rows-wrapper-wrapper.is-centering-to-control.animating~.chat-input-control:before{transition:opacity .05s .15s}.rows-wrapper-wrapper.is-centering-to-control.animating~.chat-input-control{transition:opacity .1s 75ms,visibility 0s 0s}.rows-wrapper-wrapper.is-centering-to-control.animating.backwards .rows-wrapper:before,.rows-wrapper-wrapper.is-centering-to-control.animating.backwards~.chat-input-control:before{transition:opacity .05s 0s}.rows-wrapper-wrapper.is-centering-to-control.animating.backwards~.chat-input-control{transition:opacity .1s 0s,visibility 0s .2s}[dir=ltr] .rows-wrapper{border-bottom-right-radius:0}[dir=rtl] .rows-wrapper{border-bottom-left-radius:0}.rows-wrapper{transform:translateX(0) scaleX(1)}.rows-wrapper .bubble-tail{opacity:1}@media only screen and (max-width:600px){.rows-wrapper{--padding-vertical:1px}}@media only screen and (max-width:420px){.rows-wrapper{max-width:100%}}@media only screen and (max-height:569px){.rows-wrapper{--padding-vertical:1px}}[dir=ltr] .rows-wrapper .bubble-tail{right:-8.4px}[dir=rtl] .rows-wrapper .bubble-tail{left:-8.4px}.rows-wrapper .bubble-tail{fill:var(--surface-color);bottom:-1px;height:20px;position:absolute;transform:scaleX(-1);width:11px}.is-rtl .rows-wrapper .bubble-tail{transform:scaleX(1)}.rows-wrapper .attach-file.menu-open{background-color:var(--light-primary-color)!important;color:var(--primary-color)}.rows-wrapper .attach-file.btn-disabled{opacity:var(--disabled-opacity)}.rows-wrapper>div{align-items:center;background-color:var(--surface-color);border-radius:1rem;display:flex;justify-content:space-between;padding:var(--padding);position:relative;width:100%}.rows-wrapper .reply-wrapper{align-items:center;height:0;justify-content:flex-start;margin-bottom:-.5625rem;opacity:0;padding:.5625rem var(--padding-horizontal) 0;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:2}body.animation-level-2 .rows-wrapper .reply-wrapper{transition:height .15s ease-out,opacity .15s ease-out}@media only screen and (max-height:569px),only screen and (max-width:600px){.rows-wrapper .reply-wrapper{margin-bottom:-.3125rem;padding-top:.3125rem}}.chat.is-helper-active .rows-wrapper .reply-wrapper{height:45px;opacity:1;pointer-events:inherit}.rows-wrapper .reply-wrapper .reply{flex:1 1 auto;margin-left:.625rem;margin-right:.625rem;order:1}.rows-wrapper .reply-wrapper .reply-icon{order:0;pointer-events:none}.rows-wrapper .reply-wrapper .reply-cancel{order:2}.rows-wrapper .reply-wrapper .reply-subtitle{color:var(--secondary-text-color)!important;height:1.125rem}.rows-wrapper .reply-wrapper .reply .peer-title{font-weight:400}[dir=ltr] .rows-wrapper .reply-wrapper .btn-menu{left:3.125rem}[dir=rtl] .rows-wrapper .reply-wrapper .btn-menu{right:3.125rem}.rows-wrapper .reply-wrapper .btn-menu{bottom:calc(100% + .5rem);top:auto;transform:scale(1)!important}[dir=ltr] .rows-wrapper .reply-wrapper .btn-menu-item{padding-right:1.5rem}[dir=rtl] .rows-wrapper .reply-wrapper .btn-menu-item{padding-left:1.5rem}.rows-wrapper .reply-wrapper .btn-menu-item-text{order:1}[dir=ltr] .rows-wrapper .reply-wrapper .btn-menu-item .checkbox-field{margin-right:var(--icon-margin)}[dir=rtl] .rows-wrapper .reply-wrapper .btn-menu-item .checkbox-field{margin-left:var(--icon-margin)}.rows-wrapper .reply-wrapper .btn-menu-item .checkbox-field{--size:1.25rem;margin:0;order:0}.rows-wrapper .reply-wrapper .btn-menu-item .checkbox-box-background,.rows-wrapper .reply-wrapper .btn-menu-item .checkbox-box-border{display:none}.rows-wrapper .reply-wrapper .btn-menu-item .checkbox-box-check use{stroke:var(--primary-text-color)}@media only screen and (max-width:600px){[dir=ltr] .rows-wrapper .reply-wrapper .btn-menu{left:calc(var(--padding-horizontal)*-1)}[dir=rtl] .rows-wrapper .reply-wrapper .btn-menu{right:calc(var(--padding-horizontal)*-1)}}.rows-wrapper .input-message-input{margin-top:-1px;max-height:27.5rem!important}@media only screen and (max-height:30rem){.rows-wrapper .input-message-input{max-height:max(36px,calc(100vh - 10rem))}}@media only screen and (max-width:600px){.rows-wrapper .input-message-input{max-height:10rem}}.rows-wrapper .input-message-input[data-inline-placeholder]:after{color:#a2acb4;content:attr(data-inline-placeholder);pointer-events:none}.rows-wrapper .new-message-wrapper{--send-as-size:1.875rem;--send-as-margin-left:.25rem;--send-as-margin-right:.375rem;--send-as-total-size:calc(var(--send-as-size) + var(--send-as-margin-left) + var(--send-as-margin-right));--commands-size:2.375rem;--commands-margin-left:.25rem;--commands-margin-right:.375rem;--commands-total-size:calc(var(--commands-size) + var(--commands-margin-left) + var(--commands-margin-right));--offset-translateX:0px;align-items:flex-end;min-height:var(--chat-input-size)}.rows-wrapper .new-message-wrapper .new-message-bot-commands,.rows-wrapper .new-message-wrapper .new-message-send-as-container{bottom:calc(var(--padding-vertical) + .4375rem);cursor:pointer;flex:0 0 auto;opacity:0;position:absolute;transform:scale(0);z-index:2}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-bot-commands{margin-left:var(--commands-margin-left)}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-bot-commands{margin-right:var(--commands-margin-left)}.rows-wrapper .new-message-wrapper .new-message-bot-commands{align-items:center;background-color:var(--primary-color);border-radius:1.875rem;cursor:pointer;display:flex;height:1.875rem;justify-content:center;width:var(--commands-size)}.rows-wrapper .new-message-wrapper .new-message-bot-commands .animated-menu-close-icon{position:relative}.rows-wrapper .new-message-wrapper .new-message-bot-commands-icon-scale{align-items:center;display:flex;justify-content:center;transform:scale(.875)}.rows-wrapper .new-message-wrapper .new-message-bot-commands .animated-menu-close-icon{--color:#fff}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-send-as-container{margin-left:var(--send-as-margin-left)}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-send-as-container{margin-right:var(--send-as-margin-left)}.rows-wrapper .new-message-wrapper .new-message-send-as-container{background:none!important;height:var(--send-as-size);width:var(--send-as-size)}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{right:auto}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{left:auto}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{left:calc(var(--padding-horizontal)*-1 - .25rem)!important}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{right:calc(var(--padding-horizontal)*-1 - .25rem)!important}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{height:auto;max-height:20rem;max-width:20rem;top:auto;transform:scaleX(1);width:auto}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item{height:2.25rem}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-header{height:1.875rem}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-icon{margin-right:calc(var(--icon-margin) - .5rem)}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-icon{margin-left:calc(var(--icon-margin) - .5rem)}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-icon.active:before{--offset:-.125rem;border:.0625rem solid var(--primary-color);border-radius:inherit;bottom:var(--offset);content:" ";left:var(--offset);position:absolute;right:var(--offset);top:var(--offset)}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-text{display:flex;flex-direction:column;justify-content:center;line-height:1!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-subtitle{font-size:.8125rem;font-weight:400}.rows-wrapper .new-message-wrapper .new-message-send-as-avatar{opacity:0;pointer-events:none;position:absolute;transform:scale(0)}.rows-wrapper .new-message-wrapper .new-message-send-as-avatar.is-visible:not(.backwards){opacity:1;transform:scale(1)}.rows-wrapper .new-message-wrapper .new-message-send-as-avatar.is-visible.animating{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.rows-wrapper .new-message-wrapper .new-message-send-as-close{align-items:center;background-color:var(--primary-color);border-radius:50%;color:#fff;display:flex;font-size:1.375rem;height:inherit;justify-content:center;width:inherit;z-index:1}.rows-wrapper .new-message-wrapper.has-offset[data-offset=as]{--offset-translateX:var(--send-as-total-size)}.rows-wrapper .new-message-wrapper.has-offset[data-offset=commands]{--offset-translateX:48px}.rows-wrapper .new-message-wrapper.has-offset .input-message-container,.rows-wrapper .new-message-wrapper.has-offset .toggle-emoticons{transform:translateX(0)}.rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .toggle-emoticons{transform:translateX(var(--offset-translateX))}[dir=ltr] .rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .input-message-container{margin-right:var(--translateX)}[dir=rtl] .rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .input-message-container{margin-left:var(--translateX)}.rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .input-message-container{--translateX:calc(var(--offset-translateX));transform:translate(var(--translateX))}.rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .new-message-bot-commands,.rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .new-message-send-as-container{opacity:1;transform:scale(1)}.rows-wrapper .new-message-wrapper.has-offset.animating .input-message-container,.rows-wrapper .new-message-wrapper.has-offset.animating .toggle-emoticons{transition:transform var(--transition-standard-in)}.rows-wrapper .new-message-wrapper.has-offset.animating .new-message-bot-commands,.rows-wrapper .new-message-wrapper.has-offset.animating .new-message-send-as-container{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.rows-wrapper .new-message-wrapper .btn-menu{bottom:calc(100% + 1.125rem)}@media only screen and (max-height:569px),only screen and (max-width:600px){.rows-wrapper .new-message-wrapper .btn-menu{bottom:calc(100% + .875rem)}}.rows-wrapper .new-message-wrapper .btn-menu.top-left{right:calc(var(--padding-horizontal)*-1 - .125rem)}.rows-wrapper .new-message-wrapper .btn-menu.top-right{left:calc(var(--padding-horizontal)*-1 - .125rem)}.rows-wrapper .btn-icon{color:var(--secondary-text-color);flex:0 0 auto;font-size:1.5rem;height:var(--button-size);margin-bottom:5px;margin-left:var(--button-horizontal-margin);margin-right:var(--button-horizontal-margin);margin-top:0;padding:0;width:var(--button-size)}.rows-wrapper .btn-icon.active{color:var(--primary-color)}.input-message-container{align-items:center;align-self:center;display:flex;flex:1 1 auto;max-height:inherit;min-height:calc(var(--chat-input-size) - var(--padding-vertical)*2);overflow:hidden;position:relative;width:1%}.input-message-container .scrollable{position:relative}.input-message-input{--custom-emoji-size:var(--messages-custom-emoji-size);background:none;border:none;font-size:var(--messages-text-size);line-height:var(--line-height);outline:none;overflow-y:none;padding:.5rem .5625rem;resize:none;width:100%}.input-message-input pre{display:inline;margin:0}body.animation-level-2 .input-message-input{transition:height .1s}.bubbles{--translateY:0;flex:1 1 auto;position:relative;transform:translate3d(0,var(--translateY),0);transition:transform var(--transition-standard-out);width:100%}body.animation-level-0 .bubbles{transition:none!important}.chat[data-type=chat] .bubbles.is-chat-input-hidden.is-selecting:not(.backwards){--translateY:-78px;transition:transform var(--transition-standard-in)}@media only screen and (max-width:600px){.chat[data-type=chat] .bubbles.is-chat-input-hidden.is-selecting:not(.backwards){--translateY:-58px}}.chat[data-type=chat] .bubbles.is-chat-input-hidden.is-selecting:not(.backwards) .bubbles-inner{transform:translateY(calc(var(--translateY)*-1));transition:transform var(--transition-standard-in)}.bubbles>.scrollable{display:block;height:auto}@media only screen and (min-width:1276px){body.is-right-column-shown .bubbles{transform:translate3d(calc(var(--right-column-width)/-2),var(--translateY),0);transition:transform var(--transition-standard-in)}}body.animation-level-2 .bubbles.is-selecting .bubbles-group-avatar,body.animation-level-2 .bubbles.is-selecting .is-in .bubble-content-wrapper{transition:var(--bubble-transition-out)}body.animation-level-2 .bubbles.is-selecting:not(.backwards) .bubbles-group-avatar,body.animation-level-2 .bubbles.is-selecting:not(.backwards) .is-in .bubble-content-wrapper{transition:var(--bubble-transition-in)}.bubbles.is-selecting:not(.backwards) .is-in .bubble-content-wrapper{transform:translateX(2.5rem) scale(1)}.bubbles.is-selecting:not(.backwards) .bubbles-group-avatar{transform:translate3d(2.5rem,0,0) scale3d(.76,.76,1)}.bubbles:not(.scrolled-down):not(.search-results-active)+.chat-input .bubbles-go-down{cursor:pointer;opacity:1;visibility:visible}body.animation-level-2 .bubbles:not(.scrolled-down):not(.search-results-active)+.chat-input .bubbles-go-down{transition:opacity var(--layer-transition),visibility 0s 0s!important}.bubbles:not(.scrolled-down):not(.search-results-active)+.chat-input .bubbles-go-mention{--translateY:calc(var(--chat-input-size)*-1 - 0.625rem)}.bubbles .search-group.search-group-messages{padding:.25rem 0 .5rem}.bubbles-inner{display:flex;flex-direction:column;justify-content:flex-end;margin:0 auto;max-width:var(--messages-container-width);min-height:100%;padding:0 .8125rem;transform:translateY(0);transition:transform var(--transition-standard-out);width:100%}body.animation-level-0 .bubbles-inner{transition:none!important}@media only screen and (min-width:1276px){.bubbles-inner{width:calc(100% - var(--right-column-width))}}@media only screen and (max-width:600px){.bubbles-inner{padding:0 .5rem}}.bubbles-inner:after{content:" ";height:.125rem}[dir=ltr] .bubbles-inner.is-chat .is-in .bubble-content-wrapper{margin-left:45px}[dir=rtl] .bubbles-inner.is-chat .is-in .bubble-content-wrapper{margin-right:45px}@media only screen and (max-width:600px){.bubbles-inner.is-chat .is-in .bubble-content-wrapper{max-width:calc(100% - var(--message-handhelds-margin))}}.bubbles-inner.is-channel:not(.is-chat) .bubble-content-wrapper{max-width:100%}.bubbles-inner.is-channel:not(.is-chat) .bubble.with-beside-button .bubble-content-wrapper{max-width:calc(100% - var(--message-beside-button-margin)*-1)!important}.bubbles-inner.is-chat .message,.bubbles-inner.is-chat .name,.bubbles-inner:not(.is-channel) .message,.bubbles-inner:not(.is-channel) .name{max-width:480px}.bubbles-inner.is-scrolling .is-sticky{opacity:.99999!important}html.is-safari .bubbles-inner.is-scrolling .is-sticky{transform:translateY(calc(var(--translateY)*-1))}body.animation-level-2 html.is-safari .bubbles-inner.is-scrolling .is-sticky{transition:transform var(--transition-standard-in)}.bubbles-inner>.bubble.is-in{width:100%}@media only screen and (min-width:1276px){.bubbles-inner>.bubble.is-in .bubble-content-wrapper{max-width:85%}}.bubbles-go-down{cursor:default;opacity:0;transform:none!important;transition:opacity var(--layer-transition),visibility 0s .2s!important;visibility:hidden}.bubbles-go-mention{--translateY:0;cursor:default;opacity:0;transition:transform var(--layer-transition),opacity var(--layer-transition),visibility 0s .2s!important;visibility:hidden}.bubbles-go-mention.is-visible{cursor:pointer;opacity:1;transition:transform var(--layer-transition),opacity var(--layer-transition),visibility 0s 0s!important;visibility:visible}.chat-secondary-button{align-items:center;background-color:var(--surface-color)!important;border-radius:50%;box-shadow:0 1px 8px 1px rgba(0,0,0,.12)!important;color:var(--secondary-text-color);display:flex;font-size:1.5rem;justify-content:center;position:absolute}body.animation-level-0 .chat-secondary-button{transition:none!important}.chat-secondary-button:before{position:relative}.chat-secondary-button:after{border-radius:inherit;bottom:0;content:" ";left:0;position:absolute;right:0;top:0}html.no-touch .chat-secondary-button:active:after,html.no-touch .chat-secondary-button:hover:after{background-color:var(--light-secondary-text-color)}[dir=ltr] .bubbles-corner-button{right:var(--chat-input-padding)}[dir=rtl] .bubbles-corner-button{left:var(--chat-input-padding)}.bubbles-corner-button{bottom:calc(var(--chat-input-size) + var(--bottom) + 10px);overflow:visible;z-index:2}[dir=ltr] .bubbles-corner-button .badge{right:-.25rem}[dir=rtl] .bubbles-corner-button .badge{left:-.25rem}.bubbles-corner-button .badge{position:absolute;top:-.25rem}.bubbles-corner-button .badge.badge-primary:not(.badge-gray){background-color:var(--chatlist-status-color)}@media only screen and (max-width:600px){[dir=ltr] .bubbles-corner-button .badge{right:.1875rem}[dir=rtl] .bubbles-corner-button .badge{left:.1875rem}.bubbles-corner-button .badge{top:-.75rem}}.popup.popup-delete-message .popup-header{margin-bottom:1rem}body.is-calling .topbar,body.is-calling .topbar-call-container{transform:translateY(0)}body.is-calling.animation-level-2 .topbar,body.is-calling.animation-level-2 .topbar-call-container{transition:transform var(--transition-standard-out)}body.is-calling:not(.backwards) .topbar,body.is-calling:not(.backwards) .topbar-call-container{transform:translateY(var(--topbar-call-height))}body.is-calling:not(.backwards):not(.animating){--topbar-floating-call-height:var(--topbar-call-height)}@media only screen and (min-width:1276px){body.is-right-column-shown{--topbar-floating-scaleX:calc(1 - var(--right-column-proportion))}}.topbar{--topbar-height:3.5rem;--pinned-floating-audio-height:0px;--pinned-floating-message-height:0px;--pinned-floating-height:calc(var(--pinned-floating-audio-height) + var(--pinned-floating-message-height) + var(--topbar-floating-call-height));--pinned-audio-height:52px;--pinned-message-height:52px;cursor:pointer!important;margin-bottom:var(--pinned-floating-height);max-height:var(--topbar-height)!important;min-height:var(--topbar-height)!important;position:relative;width:100%;z-index:1}.topbar:before{box-shadow:0 1px 5px -1px rgba(0,0,0,.21);content:" ";height:calc(var(--topbar-height) + var(--pinned-floating-height) - var(--topbar-floating-call-height));left:0;pointer-events:none;position:absolute;right:0;top:0}.topbar.is-pinned-audio-floating{--pinned-floating-audio-height:var(--pinned-audio-height)}.topbar.is-pinned-message-floating{--pinned-floating-message-height:var(--pinned-message-height)}.topbar:not(.is-pinned-message-floating) .chat-utils{position:relative;z-index:1}.topbar.is-pinned-audio-floating.is-pinned-message-floating .pinned-message{top:calc(var(--topbar-height) + var(--pinned-audio-height))}.topbar.is-pinned-audio-floating.is-pinned-message-floating .pinned-message:before{border-top:none}@media only screen and (min-width:601px){.topbar .menu-search{display:none}.topbar.is-pinned-message-shown:not(.hide-pinned) .pinned-message{display:flex}}@media only screen and (min-width:926px){.chat:first-child .topbar .sidebar-close-button{display:none}[dir=ltr] .chat:first-child .topbar .chat-info{padding-left:.1875rem}[dir=rtl] .chat:first-child .topbar .chat-info{padding-right:.1875rem}}@media only screen and (min-width:1276px){.topbar .pinned-container-wrapper-utils{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar .pinned-container-wrapper-utils{transform:translate3d(calc(var(--right-column-width)*-1),0,0);transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar .pinned-container-wrapper-utils{transition:none}}.topbar .sidebar-close-button{position:absolute}.topbar .user-title{align-items:center;display:flex;font-size:1rem;font-weight:var(--font-weight-bold);line-height:1.5rem;max-width:calc(100% - 1.5rem)}.topbar .user-title span.emoji{vertical-align:inherit}.topbar .info,.topbar .peer-title{line-height:var(--line-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topbar .info:not(:empty){margin-top:1px}.topbar .btn-menu-toggle .btn-menu{max-height:calc(var(--vh)*100 - 4.375rem);top:calc(100% + 7px)}@media only screen and (max-width:600px){.topbar .btn-menu-toggle .btn-menu{max-height:calc(var(--vh)*100 - 3.75rem);top:29px}.topbar .btn-menu-toggle{margin-left:0}}[dir=ltr] .topbar .chat-info{padding-left:49px}[dir=rtl] .topbar .chat-info{padding-right:49px}.topbar .chat-info{flex:1 1 auto;max-width:calc(100% - var(--utils-width));overflow:hidden}@media only screen and (max-width:600px){[dir=ltr] .topbar .chat-info{padding-left:52px}[dir=rtl] .topbar .chat-info{padding-right:52px}}@media only screen and (min-width:1276px){body.is-right-column-shown .topbar .chat-info{max-width:calc(100% - var(--right-column-width) - var(--utils-width))}}.topbar .chat-info-container{align-items:center;display:flex;flex:1 1 auto;height:3.5rem;justify-content:space-between;max-height:3.5rem;max-width:100%}.topbar .chat-utils{align-items:center;display:flex;flex:0 0 auto}@media only screen and (min-width:1276px){.topbar .chat-utils{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar .chat-utils{transform:translate3d(calc(var(--right-column-width)*-1),0,0);transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar .chat-utils{transition:none}}@media only screen and (max-width:600px){.topbar .chat-utils>.btn-icon:not(.btn-menu-toggle){display:none}}[dir=ltr] .topbar .chat-join{margin-right:.5rem}[dir=rtl] .topbar .chat-join{margin-left:.5rem}.topbar .chat-join{font-size:.875rem;font-weight:400;height:2.25rem;padding:0 1.375rem;width:auto}.topbar .chat-join:not(.hide)+.chat-mute-button{display:none}[dir=ltr] .topbar .content{padding-left:1.125rem}[dir=rtl] .topbar .content{padding-right:1.125rem}.topbar .content{flex:1 1 auto;max-width:100%;overflow:hidden}.topbar .person{align-items:center;display:flex}.topbar .person-avatar{flex:0 0 auto}.topbar .person .bottom{color:var(--secondary-text-color);font-size:.875rem}.topbar .person .bottom .online{color:var(--primary-color)}.topbar.hide-pinned{--pinned-floating-height:0px}.topbar.hide-pinned .pinned-container{display:none}.topbar.hide-pinned+.bubbles .bubbles-inner{margin-bottom:.25rem}[dir=ltr] .chat:not([data-type=chat]) .topbar .content{padding-left:16px}[dir=rtl] .chat:not([data-type=chat]) .topbar .content{padding-right:16px}[dir=ltr] .topbar-call-container{left:1px;right:0}[dir=rtl] .topbar-call-container{left:0;right:1px}.topbar-call-container{color:#fff;cursor:pointer!important;height:var(--topbar-call-height)!important;min-height:auto!important;position:absolute;top:calc(var(--topbar-call-height)*-1);z-index:2}body:not(.has-chat) .topbar-call-container{background:none!important}@media only screen and (max-width:925px){[dir=ltr] .topbar-call-container{left:0}[dir=rtl] .topbar-call-container{right:0}}.topbar-call-container .btn-icon{color:inherit;flex:0 0 auto;height:2.5rem;padding:0;width:2.5rem}.topbar-call-container .peer-title{font-weight:var(--font-weight-bold);white-space:nowrap}@media only screen and (max-width:480px){.topbar-call-container:not(.is-call) .topbar-call-left,.topbar-call-container:not(.is-call) .topbar-call-right{width:auto}.topbar-call-container:not(.is-call) .group-call-description{display:none}.topbar-call-container.is-call .topbar-call-left,.topbar-call-container.is-call .topbar-call-right{width:6.25rem}.topbar-call-container.is-call .call-description:not(.has-duration){display:none}}.topbar-call-left,.topbar-call-right{flex:0 0 auto;width:12rem}.topbar-call-left{align-items:center;display:flex}[dir=ltr] .topbar-call-left .btn-icon{margin-right:.375rem}[dir=rtl] .topbar-call-left .btn-icon{margin-left:.375rem}.topbar-call-left .call-description{white-space:nowrap}.topbar-call-left .call-description-duration{font-weight:var(--font-weight-bold)}.topbar-call-center{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media only screen and (min-width:1276px){.topbar-call-center{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar-call-center{transform:translate3d(calc(var(--right-column-width)*-.5),0,0);transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar-call-center{transition:none}.topbar-call-center{padding:0 calc(var(--right-column-width)/2)}}.topbar-call-right{display:flex;justify-content:flex-end}@media only screen and (min-width:1276px){.topbar-call-right{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar-call-right{transform:translate3d(calc(var(--right-column-width)*-1),0,0);transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar-call-right{transition:none}}.topbar-call-weave{bottom:-1.125rem;left:0;pointer-events:none;position:absolute;right:0;top:0;transform:scale(var(--topbar-floating-scaleX),-1);transform-origin:left center;z-index:-1}.is-rtl .topbar-call-weave{transform-origin:right center}@media only screen and (min-width:1276px){.topbar-call-weave{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar-call-weave{transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar-call-weave{transition:none}}.topbar-call-weave-canvas{height:100%;width:100%}.topbar .back-unread-badge{position:absolute;right:-.5rem;top:-.25rem}@media only screen and (min-width:601px){.topbar .back-unread-badge{display:none}}@keyframes bubbleSelected{0%{opacity:0}25%{opacity:1}to{opacity:0}}.bubbles-date-group{position:relative}.bubbles-date-group .sticky_sentinel--top{height:.25rem;top:0}.bubbles-group{position:relative}.bubbles-group-avatar{bottom:.25rem;cursor:pointer;pointer-events:all;position:sticky!important;top:0}.bubbles.is-selecting .bubbles-group-avatar{transform:translateZ(0) scaleX(1);transform-origin:bottom}.bubbles-group-avatar.is-gesturing-reply{transform:translateX(0)}.bubbles-group-avatar.is-gesturing-reply.animating.backwards{transition:transform var(--transition-standard-out)}.bubbles-group-avatar-container{bottom:0;display:flex;flex-direction:column-reverse;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:2}.bubble{--line-height:var(--messages-line-height);display:flex;flex-wrap:wrap;margin:0 auto .125rem;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}.bubble.is-gesturing-reply{transform:translateX(0)}.bubble.is-gesturing-reply.animating.backwards{transition:transform var(--transition-standard-out)}.bubble.is-gesturing-reply .bubble-gesture-reply-icon{align-items:center;background-color:var(--message-highlightning-color);border-radius:50%;color:#fff;display:flex;height:var(--message-beside-button-size);justify-content:center;opacity:0;position:absolute;right:var(--message-beside-button-margin);top:50%;transform:translateY(-50%);transform:translateY(-50%) scale(.6);visibility:hidden;width:var(--message-beside-button-size)}.bubble.is-gesturing-reply .bubble-gesture-reply-icon:before{font-size:1.125rem!important}body.animation-level-2 .bubble.is-gesturing-reply .bubble-gesture-reply-icon{transition:transform .1s ease-in-out}.bubble.is-gesturing-reply .bubble-gesture-reply-icon.is-visible{transform:translateY(-50%) scale(1);visibility:visible}.bubble.is-highlighted:after,.bubble.is-selected:after,.bubble:after{bottom:-.0625rem;content:" ";left:-50%;position:absolute;top:-.0625rem;z-index:-1}.bubble.is-highlighted:after{background-color:var(--message-highlightning-color)}body:not(.animation-level-0) .bubble.is-highlighted:after{animation:bubbleSelected 2s linear}@media only screen and (max-width:600px){.bubble.is-first-unread{max-width:none}}.bubble.is-first-unread:before{background-color:var(--surface-color);color:var(--primary-color);content:"Unread messages";font-size:15px;font-weight:var(--font-weight-bold);height:30px;line-height:2.1;margin-bottom:.25rem;margin-left:-50%;margin-right:-50%;position:relative;text-align:center;z-index:2}.bubble.is-first-unread.is-highlighted:after,.bubble.is-first-unread.is-selected:after{top:calc(.0625rem + 30px)}.bubble.is-selected:after{background-color:var(--message-highlightning-color)}body:not(.animation-level-0) .bubble.is-selected:after{animation:fade-in-opacity .2s linear forwards}body:not(.animation-level-0) .bubble.is-selected.backwards:after{animation:fade-in-backwards-opacity .2s linear forwards}.bubble:after,.bubble:before{display:block;width:200%}.bubble.is-multiple-documents:after,.bubble.is-multiple-documents:before{display:none}.bubble.is-multiple-documents .user-avatar{z-index:2}.bubble .replies-footer+.poll-message .poll-footer-button{border-radius:0!important}.bubble-select-checkbox{display:flex;left:0;margin:0;position:absolute;z-index:3}.bubble-select-checkbox .checkbox-box-border{border-color:var(--message-checkbox-border-color)}.bubble-select-checkbox .checkbox-box-background{background-color:var(--message-checkbox-color)}.bubble-select-checkbox .checkbox-box-check use{stroke-width:3.5}.bubble>.bubble-select-checkbox{bottom:.3125rem}.bubble>.bubble-select-checkbox .checkbox-box{box-shadow:0 0 3px 0 rgba(0,0,0,.4)}.bubbles.is-selecting .bubble:not(.is-album) .attachment,.bubbles.is-selecting .bubble:not(.is-album) .audio,.bubbles.is-selecting .bubble:not(.is-album) .document,.bubbles.is-selecting .bubble:not(.is-album) poll-element{pointer-events:none!important}.bubbles.is-selecting .bubble a,.bubbles.is-selecting .bubble img,.bubbles.is-selecting .bubble video{pointer-events:none}.bubble-content{background-color:var(--message-background-color);border-radius:12px;box-shadow:0 1px 2px 0 rgba(16,35,47,.15);display:flex;flex-direction:column-reverse;max-width:100%;min-width:56px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:2}body.animation-level-0 .bubble-content{transition:none}html.is-touch body:not(.no-select) .chat:not(.no-forwards) .bubbles.is-selecting .bubble-content,html.no-touch .chat:not(.no-forwards) .bubbles:not(.is-selecting) .bubble-content{-webkit-user-select:text;-moz-user-select:text;user-select:text}.bubble-content.hover-reaction-visible .bubble-beside-button{transform:translateX(1.125rem)}.bubble.is-out .bubble-content.hover-reaction-visible .bubble-beside-button{transform:translateX(-1.125rem)}.bubble.is-out .bubble-content.hover-reaction-visible .bubble-beside-button.goto-original{transform:translateX(-1.125rem) rotate(180deg)}.bubble-hover-reaction{--size:1.875rem;--offset:calc(var(--size)*-0.75);align-items:center;background-color:var(--surface-color);border-radius:var(--size);bottom:0;box-shadow:var(--menu-box-shadow);cursor:pointer;display:flex;height:1.625rem;justify-content:center;opacity:0;position:absolute;right:var(--offset);transform:scale(.8);width:var(--size);z-index:2}body.animation-level-2 .bubble-hover-reaction{transition:opacity var(--btn-corner-transition),transform var(--btn-corner-transition)}.bubble-hover-reaction.is-visible:not(.backwards){opacity:1;transform:scale(1)}.bubble-hover-reaction-sticker{height:1.125rem;position:relative;width:1.125rem}.bubble.service{max-width:var(--messages-container-width)}.bubble.service .bubble-content{box-shadow:none;margin:0 auto;max-width:100%}.bubble.is-date{font-weight:var(--font-weight-bold);opacity:.99999;padding-bottom:.375rem;pointer-events:none;position:sticky;top:.25rem;transition:opacity .3s ease;z-index:2}.bubble.is-date:after,.bubble.is-date:before{display:none}body.animation-level-0 .bubble.is-date{transition:none}.bubble.is-date.is-sticky{opacity:.00001}.bubbles-inner:not(.is-scrolling) .bubble.is-date.is-sticky .bubble-content{cursor:default}.chat[data-type=chat] .bubble.is-date .bubble-content,.chat[data-type=discussion] .bubble.is-date .bubble-content{cursor:pointer;pointer-events:all}.bubbles:not(.has-sticky-dates) .bubble.is-date{visibility:hidden}.bubbles.has-sticky-dates .bubble.is-date.is-fake{display:none}.bubble.is-date.is-fake{left:50%;opacity:1!important;position:absolute;top:0;transform:translateX(-50%);transition:none!important;visibility:visible!important}.bubble-beside-button{align-items:center;background:var(--message-highlightning-color);border-radius:50%;bottom:0;color:var(--badge-text-color);cursor:pointer;display:flex;font-size:1.5rem;height:var(--message-beside-button-size);justify-content:center;position:absolute;right:var(--message-beside-button-margin);transform:translateX(0);width:var(--message-beside-button-size)}html.no-touch .bubble-beside-button{opacity:0}html.no-touch body.animation-level-2 .bubble-beside-button{transition:opacity .2s ease-in-out,transform .2s ease-in-out}.bubble-view-button{align-items:center;border:1px solid var(--message-primary-color);border-radius:6px;color:var(--message-primary-color);display:flex;height:2rem;justify-content:center;margin:0 .5625rem .5rem;text-decoration:none!important;width:auto}html.no-touch .bubble-view-button:active,html.no-touch .bubble-view-button:hover{background-color:var(--light-filled-message-primary-color)}.bubble-view-button .c-ripple__circle{background-color:var(--message-primary-color);opacity:.08}.message .bubble-view-button{margin:.375rem 0 -.375rem;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.bubble-view-button+.reactions-block{margin-top:.375rem}html.no-touch .bubble:active .bubble-beside-button,html.no-touch .bubble:hover .bubble-beside-button{opacity:1}.bubble .forward{font-size:1.25rem}.bubble.is-group-last{margin-bottom:.5rem}.bubble.is-group-last:after{bottom:-.25rem}.bubbles-inner.is-chat .bubble.is-group-last.is-in>.bubble-select-checkbox{bottom:.1875rem}.bubble.is-group-first:after{top:-.25rem}.bubble:not(.forwarded):not(.must-have-name):not(.is-group-first) .name{display:none}.bubble:not(.forwarded):not(.must-have-name):not(.is-group-first):not(.is-message-empty):not(.is-reply) .message{padding-top:6px}.bubble:not(.is-group-last) .bubble-content-wrapper>.user-avatar{display:none}.bubble.photo .bubble-content,.bubble.video .bubble-content{width:-moz-min-content;width:min-content}.bubble.photo .web,.bubble.video .web{max-width:100%}.bubble.photo .message,.bubble.video .message{max-width:420px}.bubble.webpage .preview-with-document{margin-bottom:0!important;min-width:100%}.bubble.webpage .document{height:3.375rem}@media only screen and (max-width:600px){.bubble.webpage .document{padding-left:44px}}.bubble.webpage .has-document{display:flex;flex-direction:column}.bubble.webpage .has-document .preview-resizer{order:1}.bubble .preview-resizer{display:flex}.bubble img.emoji{height:18px;vertical-align:bottom;width:18px}.bubble .thumbnail{position:absolute}.bubble .canvas-thumbnail{border-radius:inherit}.bubble .canvas-dots{z-index:1}.bubble.emoji-big{--emoji-size:1rem;font-size:0}.bubble.emoji-big .bubble-content{line-height:1}.bubble.emoji-big .attachment{--custom-emoji-size:var(--emoji-size);border-radius:0!important}.bubble.emoji-big .attachment img.emoji{height:var(--emoji-size);max-height:64px;max-width:64px;width:var(--emoji-size)}.bubble.emoji-big .attachment .custom-emoji,.bubble.emoji-big .attachment .emoji{display:inline-block}.bubble.emoji-big:not(.sticker) .attachment{display:block;font-size:var(--emoji-size);max-height:-moz-fit-content!important;max-height:fit-content!important;padding-bottom:1.25rem;padding-top:.25rem;white-space:pre-wrap;word-break:break-word}.bubble.emoji-big:not(.sticker) .attachment span.emoji{height:auto;width:auto}.bubble.emoji-big:not(.sticker) .message{margin-top:-1.125rem}.bubble.emoji-big:not(.sticker) .bubble-content{max-width:min(420px,100%)}.bubble.just-media .bubble-content{background:none!important;box-shadow:none}.bubble.just-media img{-o-object-fit:contain;object-fit:contain}.bubble.just-media.is-message-empty .message{background:var(--message-highlightning-color)}.bubble.emoji-big:not(.sticker) .bubble-content,.bubble.sticker .bubble-content{align-self:flex-start}.bubble.emoji-big:not(.sticker) .message,.bubble.sticker .message{margin-left:auto;position:relative!important;right:0!important}.bubble.sticker .attachment{border-radius:0;position:absolute;z-index:1}.bubble.round .attachment{height:var(--round-video-size)!important;max-height:var(--round-video-size)!important;max-width:var(--round-video-size)!important;width:var(--round-video-size)!important}.bubble.round .media-photo,.bubble.round .media-video{border-radius:50%;pointer-events:none}.bubble:not(.is-message-empty) .attachment{border-bottom-left-radius:0;border-bottom-right-radius:0}.bubble:not(.emoji-big) .attachment{font-size:0}.bubble .attachment{border-radius:inherit;cursor:pointer;display:flex;justify-content:center;max-width:100%;overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble .attachment img,.bubble .attachment video{max-width:100%}.bubble .attachment .download{align-items:center;cursor:pointer;display:flex;height:100%;justify-content:center;left:0;position:absolute;top:0;width:100%}.bubble .attachment .download span{background-color:var(--message-time-background);color:#fff;font-size:23px;text-align:center}.bubble .attachment .download~.video-play,.bubble .attachment .preloader-container~.video-play{display:none}.bubble .media-container-aspecter{margin:0 auto;position:relative;z-index:1}.bubble .media-container-fitted{background-color:transparent!important}.bubble .media-container-fitted>.thumbnail{opacity:.8}.bubble .media-container-fitted>.thumbnail.fade-in{animation:thumbnail-fade-in-opacity .2s ease-in-out forwards}.bubble .preloader-container{z-index:2}.bubble:not(.sticker) .attachment{max-height:min(340px,100%);max-width:min(420px,100%);width:-moz-max-content;width:max-content}.bubble img:not(.emoji),.bubble video{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}html.is-safari .bubble:not(.round) img:not(.emoji),html.is-safari .bubble:not(.round) video{border-radius:inherit}.bubble.is-album .attachment{max-height:none;max-width:min(451px,100%)}.bubble .album-item{background-color:var(--message-highlightning-color);cursor:pointer;max-width:100%;overflow:hidden;position:absolute}body.animation-level-0 .bubble .album-item{transition:none!important}.bubble .album-item img,.bubble .album-item video,.bubble .album-item-media{border-radius:inherit}body.animation-level-0 .bubble .album-item-media{transition:none!important}.bubble .album-item .bubble-select-checkbox{bottom:auto!important;left:auto;right:.5rem;top:.5rem}.bubble .album-item.is-selected{border-radius:0}.bubble .album-item.is-selected .album-item-media{transform:scale(1)}.bubble .album-item.is-selected.animating{transition:border-radius var(--transition-standard-out)}.bubble .album-item.is-selected.animating .album-item-media{transition:transform var(--transition-standard-out),border-radius var(--transition-standard-out)}.bubble .album-item.is-selected:not(.backwards){transition:border-radius var(--transition-standard-in)}.bubble .album-item.is-selected:not(.backwards) .album-item-media{transform:scale(.883333);transition:transform var(--transition-standard-in),border-radius var(--transition-standard-in)}.bubble .album-item.is-selected:not(.backwards),.bubble .album-item.is-selected:not(.backwards) .album-item-media{border-radius:0}html.no-touch .bubble a:active,html.no-touch .bubble a:hover{text-decoration:underline}.bubble-first{align-items:center;justify-content:center;margin-top:.5rem;max-width:100%;order:-1}body.animation-level-0 .bubble-first{flex:1 1 auto}.bubble-first .attachment{pointer-events:none}.bubble-first .bubble-content-wrapper{max-width:100%}.bubble-first.empty-bubble-placeholder{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}body.animation-level-2 .bubble-first.empty-bubble-placeholder .bubble-content-wrapper{transition:var(--bubble-transition-in)}.bubble-first.empty-bubble-placeholder.has-description .service-msg{align-items:flex-start!important;flex-direction:column;padding:.75rem 1rem .875rem!important}.bubble-first.empty-bubble-placeholder.has-description .center{align-self:center}.bubble-first.empty-bubble-placeholder.has-description .empty-bubble-placeholder-title{font-size:1rem!important;font-weight:var(--font-weight-bold)}.bubble-first.empty-bubble-placeholder.has-description .bubble-content{border-radius:1.5rem!important}.bubble-first.empty-bubble-placeholder .empty-bubble-placeholder-line{color:#fff}.bubble-first.empty-bubble-placeholder .empty-bubble-placeholder-line+.empty-bubble-placeholder-line{margin-top:.5rem}.bubble-first.empty-bubble-placeholder .tgico-check{font-size:1.25rem;margin-left:-.1875rem;margin-right:.25rem;vertical-align:bottom}.bubble-first.empty-bubble-placeholder .empty-bubble-placeholder-list-bullet{margin-right:.3125rem}.bubbles.has-groups .bubble-first.empty-bubble-placeholder{pointer-events:none}.bubbles.has-groups .bubble-first.empty-bubble-placeholder .bubble-content-wrapper{opacity:0;transform:scale3d(.8,.8,1) translateX(0)}.bubble-first.empty-bubble-placeholder.empty-bubble-placeholder-group .empty-bubble-placeholder-list-item{margin-top:.4375rem!important}.bubble-first.empty-bubble-placeholder.empty-bubble-placeholder-greeting .service-msg{max-width:232px}.bubble-first.empty-bubble-placeholder.empty-bubble-placeholder-greeting .empty-bubble-placeholder-subtitle{margin-top:.25rem!important}.bubble-first.empty-bubble-placeholder .empty-bubble-placeholder-sticker{cursor:pointer;height:200px;margin-top:.75rem!important;position:relative;width:200px}.bubble-first .time{display:none!important}.bubble-first:after,.bubble-first:before{display:none}.bubble .web{line-height:var(--line-height);margin:.125rem 0 0;max-width:100%;overflow:hidden}.bubble .web+.time{display:block}.bubble .web .preview{border-radius:4px;cursor:pointer;max-height:min(340px,100%);max-width:min(420px,100%);overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:-moz-max-content;width:max-content}.bubble .web .preview img,.bubble .web .preview video{max-width:100%}.bubble .web .preview-resizer:first-child{margin:3px 0}.bubble .web .preview-resizer:first-child:last-child{margin-bottom:2px}.bubble .web .preview.is-round .media-photo,.bubble .web .preview.is-round .media-video{border-radius:50%}.bubble .web.no-text{margin-bottom:.75rem}.bubble .web .title:not(:first-child){margin-top:1px}.bubble .web .text,.bubble .web .title,.bubble .web .webpage-name{font-size:var(--messages-secondary-text-size);line-height:var(--messages-secondary-line-height)}.bubble .web .webpage-name{text-decoration:none}html.no-touch .bubble .web .webpage-name:active,html.no-touch .bubble .web .webpage-name:hover{text-decoration:underline}.bubble .web .text{margin-top:1px;word-break:break-word}.bubble .web .quote{display:flex;max-width:100%;overflow:hidden;width:100%}.bubble .web .quote-text{margin-left:-.625rem;max-width:100%;padding-left:.625rem;width:100%}.bubble .web .quote:before{background-color:var(--primary-color);border-radius:.125rem;content:" ";flex:0 0 auto;margin:.1875rem .5rem .125rem 0;width:.125rem}.bubble .reply{--font-size:var(--messages-secondary-text-size)}.bubble .document-name{font-size:var(--messages-text-size)}.bubble .document-size{font-size:var(--messages-secondary-text-size)}.bubble.is-square-photo .bubble-content{width:-moz-fit-content;width:fit-content}.bubble.is-square-photo .web .webpage-name{margin-right:1rem}.bubble.is-square-photo .web .preview-resizer{float:right;height:3rem;margin:.1875rem 0 0 .625rem;width:3rem}.bubble.is-square-photo .web .preview{margin:0;max-height:min(3rem,100%);max-width:min(3rem,100%)}.bubble .reply{border-radius:.25rem;cursor:pointer;margin:0 .375rem .375rem;min-width:10rem;padding:.25rem;width:auto}.bubble .reply-media{top:.125rem}.bubble .reply-content{height:auto;max-width:calc(100% - 1.25rem);min-height:32px;overflow:hidden;position:absolute;text-overflow:ellipsis;white-space:nowrap}.bubble .message+.reply{margin-bottom:0}.bubble:not(.just-media) .reply{border-radius:6px}html.no-touch .bubble:not(.just-media) .reply:active,html.no-touch .bubble:not(.just-media) .reply:hover{background-color:var(--light-filled-message-primary-color)}.bubble.just-media .floating-part{background-color:var(--message-highlightning-color);border-radius:12px;margin:0;max-width:15rem;padding:.375rem .625rem;position:absolute;top:0;white-space:nowrap}@media only screen and (max-width:600px){.bubble.just-media .floating-part{max-width:calc(100vw - 1rem - 10px - 100%)}}.bubble.just-media .name{color:#fff!important;line-height:var(--line-height);padding:.375rem .625rem}.bubble.just-media .name .peer-title{font-weight:400!important}.bubble.just-media .reply{height:54px;max-height:54px}@media only screen and (max-width:600px){.bubble.just-media .reply{padding:8px 6px 8px 8px}}.bubble.just-media .reply-content{margin-top:0;max-width:none!important;position:relative}.bubble.just-media .reply i,.bubble.just-media .reply-subtitle,.bubble.just-media .reply-title{color:#fff!important}.bubble.just-media .reply-border{background:#fff!important}.bubble.forwarded .attachment,.bubble.is-reply .attachment,.bubble:not(.hide-name) .attachment{border-top-left-radius:0;border-top-right-radius:0}.bubble .message,.bubble .service-msg{--custom-emoji-size:var(--messages-custom-emoji-size)}.bubble .message{color:var(--primary-text-color);font-size:var(--messages-text-size);line-height:var(--line-height);max-width:100%;padding:0 .5rem .375rem .625rem;position:relative;white-space:pre-wrap;word-break:break-word}.bubble .message .custom-emoji{display:inline-flex}.bubble .message:last-child{padding-top:6px}@media only screen and (max-width:600px){.bubble .audio,.bubble .document{--icon-size:2.25rem}}.bubble .audio .audio-title{font-weight:var(--font-weight-bold)}.bubble .audio .audio-ico{font-size:0}@media only screen and (max-width:600px){.bubble .audio{--icon-margin:.6875rem;height:2.375rem}.bubble .audio .audio-details{margin-bottom:0;margin-top:2px}.bubble .audio .audio-to-text-button{margin-top:-.875rem}.bubble .audio .audio-subtitle{margin-top:-1px}}.bubble .message.audio-message{width:335px}@media only screen and (max-width:600px){.bubble .message.audio-message{width:280px}}.bubble .message.audio-message,.bubble .message.voice-message{max-width:min(100%,364px)!important}@media only screen and (max-width:600px){.bubble .message.audio-message,.bubble .message.voice-message{max-width:min(100%,300px)!important}}.bubble.min-content .bubble-content{width:-moz-min-content;width:min-content}.bubble .message.voice-message .document-message{max-width:-moz-fit-content;max-width:fit-content}.bubble .message.audio-message,.bubble .message.voice-message{padding:8px!important}.bubble .message.call-message,.bubble .message.contact-message{min-width:200px;padding-left:8px}.bubble .message.contact-message .contact{cursor:pointer;display:flex;padding:2px 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble .message.contact-message .contact-avatar{color:#fff}.bubble .message.contact-message .contact-details{display:flex;flex-direction:column;margin-top:8px;padding-left:12px}.bubble .message.contact-message .contact-name{font-size:1rem;font-weight:var(--font-weight-bold)}.bubble .message.contact-message .contact-number{font-size:14px;line-height:1.4}.bubble .message.poll-message{max-width:400px}.bubble .message.document-message{max-width:325px!important}.bubble .message.document-message .document{--icon-margin:.75rem;height:58px}@media only screen and (max-width:600px){.bubble .message.document-message .document{--icon-margin:.5rem;height:44px}.bubble .message.document-message .document .document-size{font-size:.75rem}.bubble .message.document-message .document:not(.document-with-thumb) .document-ico{padding:1.125rem 0 0}}.bubble .message.document-message .document-name{line-height:1.4;margin-top:1px;overflow:hidden;text-overflow:ellipsis}.bubble-call{cursor:pointer;display:flex;flex-direction:column;justify-content:center;padding:.125rem 0 .125rem 2.5625rem;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble-call:before{font-size:1.5rem;left:.3125rem;position:absolute}.bubble-call-title{font-weight:var(--font-weight-bold)}.bubble-call-subtitle{align-items:center;color:var(--secondary-text-color);display:flex;font-size:var(--messages-secondary-text-size);line-height:var(--messages-secondary-line-height);margin-left:-.1875rem;margin-top:.0625rem}.bubble-call-subtitle.is-reason:before{margin-right:.0625rem}.bubble-call-subtitle:before{content:"";display:inline-block;font-size:1rem;transform:rotate(135deg)}.bubble-call-subtitle.arrow-red:before{color:var(--danger-color)}.bubble-call-subtitle.arrow-green:before{color:var(--message-out-primary-color)}.bubble .document-wrapper{display:flex;flex-direction:column-reverse}.bubble .document-wrapper .document-message{margin-top:.25rem}.bubble .document .time{align-self:flex-start;height:0}.bubble .document-message+.audio .time,.bubble .document-message+.document .time{display:none!important}.bubble.is-multiple-documents .message{border-radius:inherit;padding:0!important}.bubble.is-multiple-documents .document-container{border-radius:inherit;position:relative}.bubble.is-multiple-documents .document-container .document-selection{bottom:0;left:-75vw;position:absolute;top:0;width:200vw;z-index:-2}.bubble.is-multiple-documents .document-container.is-highlighted .document-wrapper:before,.bubble.is-multiple-documents .document-container.is-selected .document-wrapper:before{background-color:var(--message-background-color);border-radius:inherit;bottom:0;content:" ";left:0;position:absolute;right:0;top:0;z-index:-1}.bubble.is-multiple-documents .document-container.is-highlighted .document-selection{background-color:var(--message-highlightning-color)}body:not(.animation-level-0) .bubble.is-multiple-documents .document-container.is-highlighted .document-selection{animation:bubbleSelected 2s linear}.bubble.is-multiple-documents .document-container.is-selected .document-selection{background-color:var(--message-highlightning-color)}body:not(.animation-level-0) .bubble.is-multiple-documents .document-container.is-selected .document-selection{animation:fade-in-opacity .2s linear forwards}body:not(.animation-level-0) .bubble.is-multiple-documents .document-container.is-selected.backwards .document-selection{animation:fade-in-backwards-opacity .2s linear forwards}.bubble.is-multiple-documents .document-container .bubble-select-checkbox{--margin-top:.25rem;--margin-left:.125rem;background:#fff;border-radius:50%;left:auto;margin-left:calc(var(--padding-left)*-1 + var(--icon-size) - var(--size) + var(--margin-left));margin-top:calc(var(--icon-size) - var(--size) + var(--margin-top));top:auto}@media only screen and (max-width:600px){.bubble.is-multiple-documents .document-container .bubble-select-checkbox{--size:1.125rem}}.bubble.is-multiple-documents .document-container .bubble-select-checkbox:before{--inner-size:.125rem;border:2px solid var(--secondary-color);border-radius:inherit;content:" ";height:calc(var(--size) - var(--inner-size)*2);left:var(--inner-size);position:absolute;top:var(--inner-size);width:calc(var(--size) - var(--inner-size)*2)}.bubble.is-multiple-documents .document-container:first-of-type .document-selection{top:-.0625rem}.bubble.is-multiple-documents .document-container:first-of-type .document-wrapper{border-top-left-radius:inherit;border-top-right-radius:inherit;padding-top:.5rem}.bubble.is-multiple-documents .document-container:last-of-type .document-selection{bottom:-.0625rem}.bubble.is-multiple-documents .document-container:last-of-type .document-wrapper{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;padding-bottom:.5rem}.bubble.is-multiple-documents.is-group-first .document-container:first-of-type .document-selection{top:-.25rem}.bubble.is-multiple-documents.is-group-last .document-container:last-of-type .document-selection{bottom:-.25rem}.bubble.is-multiple-documents .document{height:54px!important}@media only screen and (max-width:600px){.bubble.is-multiple-documents .document{height:38px!important}}.bubble.is-multiple-documents .document-wrapper{padding:.25rem .5rem}.bubble.is-multiple-documents .document-wrapper>.name{margin-top:-.1875rem;padding:0 0 .25rem}.bubble .message .audio .time,.bubble .message.contact-message .time,.bubble .message.poll-message .time{bottom:0;position:absolute;right:0}html:not(.is-safari) .bubble .message.voice-message{overflow:hidden}.bubble.is-message-empty .bubble-content-wrapper{width:-moz-min-content;width:min-content}.bubble.is-message-empty .message{background-color:var(--message-time-background);border-radius:.75rem;bottom:.1875rem;padding:0 .3125rem;position:absolute;right:.1875rem;z-index:2}.bubble.is-message-empty .message .time{align-items:center;display:flex;height:calc(var(--messages-time-text-size) + .375rem);margin:0;padding:0;white-space:nowrap}.bubble.is-message-empty .message .time .inner{bottom:auto;color:#fff;margin:inherit;right:auto}.bubble.is-message-empty .message .time .inner:after{color:#fff!important}.bubble.is-message-empty.with-replies:not(.sticker):not(.with-beside-replies) .message{bottom:55px}.bubble.is-message-empty.emoji-big .message,.bubble.is-message-empty.sticker .message,.bubble.is-message-empty.with-replies.round .message{bottom:0}.bubble.is-message-empty:not(.emoji-big) .reactions-block{max-width:-moz-fit-content;max-width:fit-content}.bubble.is-message-empty .reaction-block{--chosen-background-color:var(--primary-color)}html.no-touch .bubble.is-message-empty .reaction-block:not(.is-chosen):active:after,html.no-touch .bubble.is-message-empty .reaction-block:not(.is-chosen):hover:after{background-color:#fff}.bubble.with-reply-markup .bubble-content{min-width:100%}.bubble.with-replies .attachment{border-bottom-left-radius:0;border-bottom-right-radius:0}.bubble.with-beside-replies .bubble-content{min-height:5.5rem}.bubble .colored-name .premium-icon{color:inherit;opacity:.6}.bubble .time{cursor:pointer;direction:ltr;display:inline-flex;float:right;font-size:var(--messages-time-text-size);height:var(--messages-time-text-size);line-height:1;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;visibility:hidden;z-index:1}.bubble .time i{font-size:1.125rem;margin-right:.375rem}.bubble .time-icon{pointer-events:none}.bubble .time-icon:not(:first-child){margin-left:2px}.bubble .time i.edited{font-size:inherit;overflow:visible}.bubble .time .inner{align-items:center;bottom:0;color:var(--message-time-color);display:flex;height:var(--messages-time-text-size);line-height:1;padding:inherit;pointer-events:all;position:absolute;right:0;visibility:visible;white-space:nowrap}.bubble .time .inner:after{color:var(--message-status-color)}.bubble .time .tgico-pinnedchat{margin-right:.125rem}.bubble .time.is-block{display:block;float:none}.bubble.webpage .time{float:none}.bubble .video-play,.bubble .video-time{pointer-events:none}.bubble .video-time{--height:calc(var(--messages-time-text-size) + 0.375rem);align-items:center;background-color:var(--message-time-background);border-radius:var(--height);color:#fff;display:flex;font-size:var(--messages-time-text-size);height:var(--height);left:3px;line-height:1;padding:0 6px;position:absolute;top:3px;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:2}.bubble .video-time.can-autoplay:after{color:#fff;content:"";font-size:calc(var(--messages-time-text-size) + 8px);padding:0 1px 0 3px}[dir=ltr] .bubble .video-time.is-error:after{margin-left:1px}[dir=rtl] .bubble .video-time.is-error:after{margin-right:1px}.bubble .video-time.is-error:after{content:"";font-size:calc(var(--messages-time-text-size) + 4px);padding:0}.bubble .extended-media-buy{align-items:center;-webkit-backdrop-filter:var(--menu-backdrop-filter);backdrop-filter:var(--menu-backdrop-filter);background-color:rgba(0,0,0,.3);border-radius:2rem;color:#fff;display:flex;font-size:var(--font-size-14);font-weight:var(--font-weight-bold);height:2.5rem;left:50%;padding:0 1rem;position:absolute;top:50%;transform:translate(-50%,-50%);white-space:nowrap;z-index:2}.bubble .extended-media-buy:before{font-size:1.125rem;margin-right:.25rem}.bubble pre{display:inline;margin:0}.bubble .anchor-url{text-decoration:underline}.bubble .video-play{align-items:center;background-color:var(--message-time-background);color:#fff;display:flex;font-size:2.125rem;justify-content:center;text-align:center;z-index:2}.bubble .ckin__player.circle{z-index:1}.bubble:not(.forwarded).hide-name .name{display:none}.bubble .name{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble .peer-title{cursor:pointer}.bubble .name{color:var(--primary-color);font-size:var(--messages-secondary-text-size);font-weight:var(--font-weight-bold)!important;line-height:calc(var(--messages-secondary-text-size) + .25rem);max-width:100%;overflow:hidden;padding:.375rem .625rem 0;text-overflow:ellipsis}.bubble .name .badge-fake{display:inline-block;margin-top:-2px;vertical-align:middle}.bubble:not(.webpage).photo:not(.is-reply) .bubble-content>.name,.bubble:not(.webpage).video:not(.is-reply) .bubble-content>.name{padding-bottom:6px}.bubble:not(.webpage).photo:not(.is-message-empty) .message,.bubble:not(.webpage).video:not(.is-message-empty) .message{padding-top:6px}.bubble:not(.webpage).photo .topic-name-button-container,.bubble:not(.webpage).video .topic-name-button-container{margin-bottom:0}.bubble:not(.webpage):not(.is-album):not(.sticker):not(.round):not(.emoji-big) .attachment{background-color:#000}.bubble.hide-name:not(.is-reply):not(.is-message-empty) .message{padding-top:6px}.bubble:not(.sticker):not(.emoji-big):not(.forwarded).hide-name .reply,.bubble:not(.sticker):not(.emoji-big):not(.forwarded):not(.is-group-first) .reply{margin-top:6px}.bubble .bubble-tail{display:none}.bubble.can-have-tail.is-group-last .bubble-tail{fill:var(--message-background-color);display:block;height:20px;position:absolute;transform:translateY(1px);width:11px;z-index:-2}.bubble.is-message-empty.is-group-last.with-media-tail .bubble-tail,.bubble.photo.is-message-empty.is-group-last:not(.with-replies) .bubble-tail,.bubble.video.is-message-empty.is-group-last:not(.with-replies) .bubble-tail{display:none}.bubble.is-message-empty.is-group-last.with-media-tail .attachment{overflow:visible}.bubble__media-container{border-radius:inherit;cursor:pointer}.bubble audio-element,.bubble poll-element{white-space:normal}.bubble .replies{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble .replies .c-ripple__circle{background-color:var(--light-primary-color)}.bubble .replies .rp{border-radius:inherit;cursor:pointer;height:100%;left:0;overflow:hidden;position:absolute;top:0;width:100%}.bubble .replies-beside{border-radius:2rem;bottom:47px;flex-direction:column;height:auto;max-height:52px;min-height:36px;padding:.375rem 0 .5rem;right:-44px;width:36px}.bubble .replies-beside-text{font-size:.75rem;margin-top:.125rem}.bubble .replies-footer{align-items:center;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;border-top:.0625rem solid var(--border-color);color:var(--primary-color);display:flex;height:3.0625rem;min-width:15rem;padding:0 .5rem;position:relative}html.no-touch .bubble .replies-footer:active,html.no-touch .bubble .replies-footer:hover{background-color:var(--light-primary-color)}html.no-touch .bubble .replies-footer:active~.bubble-tail,html.no-touch .bubble .replies-footer:hover~.bubble-tail{fill:var(--light-filled-message-primary-color)}.bubble .replies-footer .tgico-comments,.bubble .replies-footer .tgico-next{font-size:1.5rem}.bubble .replies-footer .tgico-comments{margin-left:.125rem;margin-right:.375rem}.bubble .replies-footer-text{align-items:center;color:var(--primary-color);display:flex;font-size:.9375rem;font-weight:var(--font-weight-bold);line-height:1.125rem;margin-left:.5rem}.bubble .replies-footer-avatars{--margin-right:-.875rem;--border-size:2px}.bubble .replies-footer .tgico-next{position:absolute;right:.1875rem}.bubble .replies-footer.is-unread .replies-footer-text:after{background-color:var(--primary-color);border-radius:50%;content:" ";height:.5rem;margin-left:.75rem;width:.5rem}.bubble.is-thread-starter .user-avatar{display:none}.bubble.is-thread-starter.is-in .bubble-content-wrapper{margin-left:0}.bubble .message .reaction{--background-color:var(--light-filled-message-primary-color)}.bubble .message .reaction.is-chosen.backwards,.bubble .message .reaction:not(.is-chosen){--counter-color:var(--message-primary-color)}.bubble .message .reaction.is-chosen.backwards .stacked-avatars,.bubble .message .reaction:not(.is-chosen) .stacked-avatars{--border-color:var(--background-color)}.bubble .message .reactions-block .time{bottom:auto!important;order:100;position:static!important;right:auto!important}.bubble code{cursor:pointer}.bubble.is-invoice .attachment{background-color:inherit!important}.bubble.with-reply-markup .bubble-content{border-bottom-left-radius:6px!important;border-bottom-right-radius:6px!important}.bubble .name-with-reply .name{padding:0!important}.bubble .name-with-reply .name:not(:last-child) .hide-ol{display:none}.bubble .name-with-reply .name:not(:last-child) .peer-title{font-weight:var(--font-weight-bold)!important}.bubble .name-with-reply .reply{height:auto;margin:.25rem 0 0;max-height:none;padding:0}.bubble .topic-name-button{--color:var(--message-primary-color)}.bubble .name .topic-name-button-container{margin:.25rem -.125rem}.bubble .name .topic-name-button-container:first-child{margin-top:0}.bubble.is-message-empty:not(.is-reply) .name .topic-name-button-container{margin-bottom:0}.bubble:not(.is-group-first) .topic-name-button-container{display:none!important}.bubble .topic-name-button-container.floating-part{font-size:var(--messages-secondary-text-size);padding-bottom:0;padding-top:0}.bubble .topic-name-button-container.floating-part .topic-name-button{--color:#fff;padding:0}.bubble .topic-name-button-container.floating-part .topic-name-button:before{content:none}.bubble .topic-name-button-container.floating-part+.floating-part{margin-top:1.75rem}.bubble .web .audio-transcribed-text{margin-bottom:0;order:4}.bubble .audio-transcribed-text{margin-bottom:.75rem;margin-top:.25rem}.bubble .audio-transcribed-text.is-error{color:var(--message-primary-color)}.bubble .audio-transcribed-text .audio-transcribing-dots{position:relative}.bubble .audio-transcribed-text .audio-transcribing-dots:after,.bubble .audio-transcribed-text .audio-transcribing-dots:before{content:"..."}.bubble .audio-transcribed-text .audio-transcribing-dots:before{opacity:0}.bubble .audio-transcribed-text .audio-transcribing-dots:after{animation:audio-dots 1.5s linear infinite;left:0;position:absolute;right:0}.timestamp.is-disabled{color:inherit;cursor:inherit;text-decoration:none!important}@keyframes audio-dots{0%{content:""}33%{content:"."}66%{content:".."}to{content:"..."}}.bubbles-date-group:last-of-type .bubbles-group:last-of-type .bubble:last-of-type{margin-bottom:.0625rem}.bubbles-date-group:last-of-type .bubbles-group:last-of-type .bubble:last-of-type .document-container:last-of-type .document-selection,.bubbles-date-group:last-of-type .bubbles-group:last-of-type .bubble:last-of-type:after{bottom:-.0625rem}.can-zoom-fade{opacity:1;transform:scale(1) translateX(0);transform-origin:center}body.animation-level-2 .can-zoom-fade{transition:var(--bubble-transition-out)}.bubbles-inner.zoom-fading .can-zoom-fade{transition:var(--bubble-transition-in)}.can-zoom-fade.zoom-fade{opacity:0;transform:scale3d(.8,.8,1) translateX(0)}.bubble-content-wrapper{display:flex;flex-direction:column}@media only screen and (min-width:601px){.bubble:not(.service) .bubble-content-wrapper{max-width:85%}}@media only screen and (max-width:600px){.bubble-content-wrapper{max-width:calc(100% - var(--message-handhelds-margin))}}.bubble.service{align-self:center;justify-content:center}.bubble.service b{color:inherit}.bubble.service .bubble-content{background-color:transparent;border-radius:.875rem}.bubble.service .bubble-content-wrapper{max-width:100%;padding:0 2rem}.bubble.service .service-msg{align-items:center;background-color:var(--message-highlightning-color);border-radius:inherit;color:#fff;display:flex;font-size:var(--messages-service-text-size);justify-content:center;line-height:calc(var(--messages-service-text-size) + 5px);padding:.28125rem .625rem;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;word-break:break-word}.bubble.service .service-msg i{font-style:normal}.bubble.service .service-msg a{color:#fff}.bubble.service .service-msg .peer-title,.bubble.service .service-msg [data-saved-from],.bubble.service .service-msg a{cursor:pointer;font-weight:var(--font-weight-bold)}.bubble.service .service-msg .peer-title:hover,.bubble.service .service-msg [data-saved-from]:hover,.bubble.service .service-msg a:hover{text-decoration:underline}.bubble.service .service-msg img.emoji{margin-bottom:3px}.bubble.is-in .bubble-content,.bubble.is-in .bubble-content .poll-footer-button{border-radius:6px 12px 12px 6px}.bubble.is-in.is-group-first .bubble-content,.bubble.is-in.is-group-first .poll-footer-button{border-top-left-radius:12px}.bubble.is-in.is-group-last.can-have-tail .bubble-content,.bubble.is-in.is-group-last.can-have-tail .poll-footer-button{border-bottom-left-radius:0!important}.bubble.is-in.is-group-last.can-have-tail .bubble-tail{margin-left:-8.4px}.bubble.is-in.is-group-last:not(.can-have-tail) .bubble-content,.bubble.is-in.is-group-last:not(.can-have-tail) .poll-footer-button{border-bottom-left-radius:12px}.bubble.is-in.just-media .floating-part{left:calc(100% + 10px)}@media only screen and (max-width:600px){.bubble.is-in.just-media .floating-part{left:calc(100% + 1px)}}.bubble.is-in .quote .webpage-name,.bubble.is-in .reply-title{color:var(--primary-color)}.bubble.is-in .time{margin-left:-3px;padding-right:8px}.bubble.is-in .time .inner{margin-bottom:4px}.bubble.is-in.is-message-empty.is-group-last.with-media-tail .attachment{border-bottom-left-radius:0}.bubble.is-in.is-message-empty.is-group-last.with-media-tail .bubble__media-container{margin-left:-9px}.bubble.is-in .audio-subtitle,.bubble.is-in .audio-time,.bubble.is-in .contact-number{color:var(--secondary-text-color)!important}.bubble.is-in code,.bubble.is-in pre{color:var(--monospace-text-color)}.bubble.is-in:not(.just-media) .reply.is-overriding-color .reply-border{background-color:rgb(var(--override-color))}.bubble.is-in:not(.just-media) .reply.is-overriding-color .reply-title{color:rgb(var(--override-color))}html.no-touch .bubble.is-in:not(.just-media) .reply.is-overriding-color:active,html.no-touch .bubble.is-in:not(.just-media) .reply.is-overriding-color:hover{background-color:rgba(var(--override-color),.08)}.bubble.is-out{--message-background-color:var(--message-out-background-color);--light-message-background-color:var(--light-message-out-background-color);--dark-message-background-color:var(--dark-message-out-background-color);--link-color:var(--message-out-link-color);--message-primary-color:var(--message-out-primary-color);--light-filled-message-primary-color:var(--light-filled-message-out-primary-color);--selection-background-color:var(--message-out-selection-background-color);--message-time-color:var(--message-out-time-color);--message-status-color:var(--message-out-status-color);--link-color:var(--message-primary-color);flex-direction:row-reverse}.bubble.is-out .bubble-content{margin-left:auto}.bubble.is-out .bubble-content,.bubble.is-out .bubble-content .poll-footer-button{border-radius:12px 6px 6px 12px}.bubble.is-out .bubble-content .name{color:var(--message-out-primary-color)}@media only screen and (min-width:1276px){.bubble.is-out .bubble-content-wrapper{transform:scale(1) translateX(calc((var(--chat-input-size) + .5rem)*-1))}.bubble.is-out .bubble-content-wrapper.zoom-fade{transform:scale3d(.8,.8,1) translateX(calc((var(--chat-input-size) + .5rem)*-1))}body.animation-level-2 .bubble.is-out .bubble-content-wrapper{transition:var(--bubble-transition-out)}body.is-right-column-shown .bubble.is-out .bubble-content-wrapper{transform:scale(1) translateX(0)}body.animation-level-2 body.is-right-column-shown .bubble.is-out .bubble-content-wrapper{transition:var(--bubble-transition-in)}body.is-right-column-shown .bubble.is-out .bubble-content-wrapper.zoom-fade{transform:scale3d(.8,.8,1) translateX(0)}}.bubble.is-out.is-group-first .bubble-content,.bubble.is-out.is-group-first .poll-footer-button{border-top-right-radius:12px}.bubble.is-out.is-group-last.can-have-tail .bubble-content,.bubble.is-out.is-group-last.can-have-tail .poll-footer-button{border-bottom-right-radius:0!important}.bubble.is-out.is-group-last.can-have-tail .bubble-tail{right:-8.4px;transform:translateY(1px) scaleX(-1)}.bubble.is-out.is-group-last:not(.can-have-tail) .bubble-content,.bubble.is-out.is-group-last:not(.can-have-tail) .poll-footer-button{border-bottom-right-radius:12px}.bubble.is-out.just-media .floating-part{right:calc(100% + 10px)}.bubble.is-out.just-media .message{right:0}.bubble.is-out:not(.just-media) .reply-border{background-color:var(--message-out-primary-color)!important}.bubble.is-out:not(.just-media) .reply i,.bubble.is-out:not(.just-media) .reply-title{color:var(--message-out-primary-color)!important}.bubble.is-out .quote:before{background-color:var(--message-out-primary-color)}.bubble.is-out .quote .webpage-name{color:var(--message-out-primary-color)}.bubble.is-out .time{margin-left:-4px;padding-right:5px}.bubble.is-out .time .inner{bottom:4px}.bubble.is-out .time .inner:after,.bubble.is-out .time:after{font-size:calc(var(--messages-text-size) + 3px);line-height:var(--messages-time-text-size);margin-left:1px}.bubble.is-out.forwarded .name{color:var(--message-out-primary-color)}.bubble.is-out.is-read .time .inner:after,.bubble.is-out.is-read .time:after{content:""}.bubble.is-out.is-sent .time .inner:after,.bubble.is-out.is-sent .time:after{content:""}.bubble.is-out.is-sending .time .inner:after,.bubble.is-out.is-sending .time:after{content:""}.bubble.is-out.is-error .time .inner:after,.bubble.is-out.is-error .time:after{color:var(--message-error-color);content:""}.bubble.is-out .document-ico:after{border-right-color:var(--message-background-color);border-top-color:var(--message-background-color)}.bubble.is-out .audio-waveform-bar{fill:var(--message-out-primary-color)}.bubble.is-out .audio-waveform-bar.active{fill:var(--message-out-primary-color)!important}.bubble.is-out .audio-subtitle,.bubble.is-out .audio-time{color:var(--message-out-status-color)}.bubble.is-out .audio-download,.bubble.is-out .audio-toggle,.bubble.is-out .audio.corner-download .preloader-container{background-color:var(--message-out-primary-color)}.bubble.is-out .audio-download:empty{display:none}.bubble.is-out .audio.is-unread .audio-waveform-bar{fill:var(--message-out-primary-color)}.bubble.is-out .audio.is-unread .audio-time:after{background-color:var(--message-out-primary-color)}.bubble.is-out .audio-toggle .part{background-color:var(--message-out-audio-play-button-color)}.bubble.is-out.is-message-empty.is-group-last.with-media-tail .attachment{border-bottom-right-radius:0}.bubble.is-out.is-message-empty.is-group-last.with-media-tail .bubble__media-container{margin-right:-9px}.bubble.is-out.is-message-empty .reactions-block{justify-content:flex-end}.bubble.is-out.is-message-empty .reaction-block{margin-right:.25rem}.bubble.is-out.is-message-empty .reaction-block:last-child{margin-right:0}.bubble.is-out.is-message-empty .reaction-block.is-chosen{--chosen-background-color:var(--surface-color)}.bubble.is-out.is-message-empty:not(.emoji-big) .reactions-block{margin-left:auto}.bubble.is-out .bubble-call-subtitle,.bubble.is-out .contact-number,.bubble.is-out .document-size{color:var(--message-out-status-color)}.bubble.is-out .bubble-call-subtitle:before{transform:rotate(-45deg)}.bubble.is-out poll-element .poll-desc,.bubble.is-out poll-element .poll-votes-count{color:var(--message-out-primary-color)}.bubble.is-out poll-element .poll-line use{stroke:var(--message-out-primary-color)}.bubble.is-out poll-element .poll-answer-selected{background-color:var(--message-out-primary-color);color:var(--light-filled-message-out-primary-color)}html.no-touch .bubble.is-out poll-element .poll-answer:hover .animation-ring{background-color:var(--message-out-primary-color);opacity:.08}.bubble.is-out poll-element .poll-footer-button,.bubble.is-out poll-element .poll-hint{color:var(--message-out-primary-color)}.bubble.is-out poll-element .poll-avatars .stacked-avatars{--border-color:var(--message-background-color)}.bubble.is-out poll-element .progress-ring__circle{stroke:var(--message-out-primary-color)}.bubble.is-out poll-element .c-ripple__circle{background-color:var(--message-out-primary-color)}.bubble.is-out poll-element .c-ripple__circle:not(.hiding){opacity:.08}.bubble.is-out.is-sending poll-element{pointer-events:none}.bubble.is-out .audio .progress-line{--color:var(--message-out-primary-color)}.bubble.is-out .audio .progress-line:before,.bubble.is-out .audio .progress-line__loaded{background-color:var(--message-out-primary-color)}.bubble.is-out .audio .preloader-container{--color:var(--message-background-color)}.bubble.is-out .bubble-beside-button{left:var(--message-beside-button-margin);right:auto}.bubble.is-out .bubble-beside-button.goto-original{transform:rotate(180deg)}.bubble.is-out.is-multiple-documents .document-container .bubble-select-checkbox{background-color:var(--message-background-color)}.bubble.is-out.is-multiple-documents .document-container .bubble-select-checkbox:before{border-color:var(--dark-message-background-color)}.bubble.is-out.is-multiple-documents .document-container .bubble-select-checkbox .checkbox-box-border{border-color:var(--message-background-color)}.bubble.is-out .bubble-hover-reaction{left:var(--offset);right:auto}.reply-markup{margin-top:.0625rem;width:100%}.bubble:not(.is-group-last) .reply-markup{margin-bottom:.125rem}.reply-markup-row{display:flex;margin-top:.125rem;min-height:2.5rem;overflow:hidden}.reply-markup-row:last-child .reply-markup-button:first-child{border-bottom-left-radius:12px}.reply-markup-row:last-child .reply-markup-button:last-child{border-bottom-right-radius:12px}.reply-markup-button{background:var(--message-highlightning-color);border:none;border-radius:.375rem;color:#fff!important;cursor:pointer;font-size:var(--font-size-14);font-weight:var(--font-weight-bold);outline:none;overflow:hidden;padding:.5625rem 0;position:relative;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:2}.reply-markup-button-text{pointer-events:none;position:relative}.reply-markup-button.anchor-url{text-decoration:none!important}.reply-markup-button+.reply-markup-button{margin-left:.125rem}.reply-markup-button .forward-icon,.reply-markup-button.tgico:before{display:block;position:absolute;right:.125rem;top:.125rem}.reply-markup-button.is-link:before{content:"";transform:rotate(-45deg)}.reply-markup-button.is-buy:before{content:""}.reply-markup-button.is-switch-inline:before{content:""}.bubble-beside-button:after,.bubble.just-media .reply:after,.reply-markup-button:after{background-color:#fff;border-radius:inherit;bottom:0;content:" ";display:block;left:0;opacity:0;position:absolute;right:0;top:0;z-index:-1}html.no-touch .bubble-beside-button:active:after,html.no-touch .bubble-beside-button:hover:after,html.no-touch .bubble.just-media .reply:active:after,html.no-touch .bubble.just-media .reply:hover:after,html.no-touch .reply-markup-button:active:after,html.no-touch .reply-markup-button:hover:after{opacity:var(--hover-alpha)}.bubble-primary-color{color:var(--message-primary-color);font-weight:var(--font-weight-bold)}.pinned-message{--custom-emoji-size:calc(var(--font-size) + 2px)!important}.pinned-message-border{flex:0 0 auto;height:2rem;position:relative;width:.125rem}.pinned-message-border-wrapper-1{background:var(--primary-color);border-radius:1px;height:2rem;position:relative;top:50%;transform:translateY(-50%);width:.125rem}.pinned-message-border-mask{--mask-height:.375rem;--height:2.5rem;height:var(--height);overflow:hidden}.pinned-message-border-mask:after,.pinned-message-border-mask:before{content:" ";display:block;height:var(--mask-height);left:0;opacity:0;position:absolute;right:0;z-index:1}body.animation-level-2 .pinned-message-border-mask:after,body.animation-level-2 .pinned-message-border-mask:before{transition:opacity .2s ease-in-out}.pinned-message-border-mask:before{background:linear-gradient(var(--surface-color),transparent);top:0}.pinned-message-border-mask:after{background:linear-gradient(transparent,var(--surface-color));bottom:0}.pinned-message-border-mask.mask-bottom:after,.pinned-message-border-mask.mask-top:before{opacity:1}.pinned-message-border-wrapper{color:var(--primary-color);position:relative}.pinned-message-border-wrapper:before{background:var(--primary-color);bottom:0;content:" ";display:block;left:0;opacity:.4;position:absolute;right:0;top:0}.pinned-message-border-bars{stroke:currentColor;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.pinned-message-border-mark{background:currentColor;border-radius:1px;left:0;position:absolute;top:0;width:2px}body:not(.animation-level-0) .pinned-message-border-mark,body:not(.animation-level-0) .pinned-message-border-wrapper{transition:transform .25s ease-in-out;will-change:transform}.pinned-message-content{--height:32px;height:var(--height)}.pinned-message-media{border-radius:.1875rem}.pinned-message,.reply{--font-size:var(--font-size-14);--custom-emoji-size:calc(var(--font-size) + 4px);--line-height:calc(var(--font-size) + 4px);align-items:center;cursor:pointer;display:flex;overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.pinned-message-content,.reply-content{display:flex;flex-direction:column;flex-grow:1;flex-shrink:1;justify-content:center;margin-left:.5rem;overflow:hidden;pointer-events:none;position:relative}.pinned-message-title,.reply-title{color:var(--primary-color)}.pinned-message-subtitle,.pinned-message-title,.reply-subtitle,.reply-title{font-size:var(--font-size);line-height:var(--line-height);overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap}.pinned-message-media,.reply-media{height:2rem!important;left:0;overflow:hidden;position:absolute;top:.125rem;width:2rem!important}.pinned-message-media.is-round,.reply-media.is-round{border-radius:50%}.pinned-message-media>img,.pinned-message-media>video,.reply-media>img,.reply-media>video{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.pinned-message i,.reply i{color:var(--secondary-text-color);font-style:normal}.pinned-message img.emoji,.reply img.emoji{height:1rem;vertical-align:top;width:1rem}.reply.is-media .reply-content{padding-left:2.5rem}.reply-border{background:var(--primary-color);border-radius:1px;height:calc(var(--font-size)*2 + .25rem);min-width:2px}.reply-content{margin-left:.625rem}.reply-media{border-radius:.25rem}.reply-cancel{margin-bottom:0!important}.reply-title{margin:-1px 0 1px}.reply .peer-title{font-weight:var(--font-weight-bold)}.pinned-container{--container-height:3.25rem;align-items:center;cursor:pointer;display:flex;flex:0 0 auto;justify-content:space-between;overflow:visible}.pinned-container.is-floating{background-color:var(--surface-color)!important;height:var(--container-height);left:0;margin:0;max-height:var(--container-height);position:absolute!important;right:0;top:var(--topbar-height);width:auto}.pinned-container.is-floating .pinned-container-wrapper{border-radius:0;height:100%;max-width:100%;order:0;padding:0 1rem;z-index:0}@media only screen and (max-width:600px){.pinned-container.is-floating .pinned-container-wrapper{padding:0 .5rem}}.pinned-container.is-floating .pinned-container-content{margin-right:.5rem}@media only screen and (min-width:1276px){body.is-right-column-shown .pinned-container.is-floating .pinned-container-content{padding-right:var(--right-column-width)}}.pinned-container.is-floating:before{border-bottom:1px solid var(--border-color);border-top:1px solid var(--border-color);bottom:0;content:" ";left:0;position:absolute;right:0;top:0}.pinned-container-content{flex:1 1 auto;overflow:hidden;pointer-events:none;position:relative}.pinned-container .btn-icon{display:flex;flex:0 0 auto;font-size:1.5rem;justify-content:center}.pinned-container-wrapper{align-items:center;border-radius:.25rem;display:flex;flex:1 1 auto;order:1;overflow:hidden;padding:.25rem}.pinned-container-wrapper-utils{align-items:center;display:flex;flex:0 0 auto;position:relative}.pinned-message{display:flex;width:auto}.pinned-message-content{overflow:visible!important}.pinned-message-media-container{height:2rem;margin-left:-.25rem;position:absolute;width:2rem}body.animation-level-2 .pinned-message-media-container{transition:transform var(--pm-transition)}.pinned-message-subtitle,.pinned-message-title{transform:translateX(0)}.pinned-message.is-media .pinned-message-subtitle,.pinned-message.is-media .pinned-message-title{transform:translateX(2.25rem)}.pinned-message:not(.is-media) .pinned-message-media-container{transform:scale(0)}.pinned-message .pinned-container-wrapper{min-width:16rem}.pinned-message:not(.is-floating){margin-right:1rem}.pinned-message:not(.is-floating) .pinned-container-wrapper-utils{display:none}.pinned-message:not(.is-floating)>.pinned-message-close{display:flex;margin-right:.75rem;order:0}.pinned-message.is-media .pinned-message-subtitle,.pinned-message.is-media .pinned-message-title{width:calc(100% - 2.25rem)}.pinned-message.is-floating{--container-height:var(--pinned-message-height)}.pinned-message.is-floating>.btn-icon{display:none}.pinned-message.is-floating .pinned-container-wrapper{padding-left:1rem}.pinned-message.is-floating .pinned-container-content{margin-right:0}.pinned-message-content .pinned-message-subtitle,.pinned-message-content .pinned-message-title{height:calc(var(--height)/2);min-height:calc(var(--height)/2);overflow:visible;position:relative}body.animation-level-2 .pinned-message-content .pinned-message-subtitle,body.animation-level-2 .pinned-message-content .pinned-message-title{transition:transform var(--pm-transition)}.pinned-message-title{margin-bottom:.25rem}.pinned-message-subtitle .animated-super-row{font-size:var(--font-size-14);line-height:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pinned-message .animated-counter{transition:transform var(--pm-transition),opacity var(--pm-transition)}body.animation-level-0 .pinned-message .animated-counter{transition:none}.pinned-message .animated-counter:before{content:"#"}.pinned-message .animated-counter.is-last:not(.backwards){opacity:0;transform:scale(.68)}.pinned-message .animated-super-row{--translateY:16px}.pinned-message .pinned-message-media{--translateY:32px}.pinned-message.hide~.tgico-pinlist,.pinned-message.is-many .pinned-message-close,.pinned-message.is-many.is-floating .pinned-message-close,.pinned-message.is-many:not(.is-floating) .pinned-message-pinlist,.pinned-message:not(.is-many) .pinned-message-pinlist,.pinned-message:not(.is-many)~.tgico-pinlist{display:none}.pinned-message-pinlist{order:2}.chat[data-type=discussion] .pinned-message .pinned-container-close{display:none!important}.pinned-audio{--progress-height:.25rem}.pinned-audio.is-floating{--container-height:var(--pinned-audio-height)}.pinned-audio:not(.is-floating){max-width:210px;padding-right:1.75rem;position:relative}.pinned-audio .pinned-container-wrapper{overflow:visible!important}.pinned-audio .pinned-container-wrapper>.btn-icon{margin-left:0!important}.pinned-audio-ico:before{content:""}.pinned-audio-ico.flip-icon:before{content:""}.pinned-audio-title{font-weight:var(--font-weight-bold)}.pinned-audio-subtitle{color:var(--secondary-text-color)}.pinned-audio-subtitle,.pinned-audio-title{font-size:var(--font-size-14);line-height:var(--line-height-14);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.pinned-audio-content{margin-left:.75rem}.pinned-audio-progress{--border-radius:0;--height:var(--progress-height);--translateY:.125rem;bottom:0;left:0;position:absolute;right:0;transform:scaleX(var(--topbar-floating-scaleX)) translateY(var(--translateY));transform-origin:left center}@media only screen and (min-width:1276px){.pinned-audio-progress{transition:transform var(--transition-standard-out)}body.is-right-column-shown .pinned-audio-progress{transition:transform var(--transition-standard-in)}body.animation-level-0 .pinned-audio-progress{transition:none}}body.animation-level-2 .pinned-audio-progress:before{transition:opacity .2s ease-in-out}.pinned-audio-progress:not(:hover):before{opacity:0}html.no-touch .pinned-audio-progress:active,html.no-touch .pinned-audio-progress:hover{--translateY:0}.pinned-audio-progress .progress-line__filled:after{display:none!important}.pinned-audio-progress .progress-line__seek{top:-1rem}.pinned-audio-progress-wrapper{bottom:0;height:.5rem;left:0;overflow:hidden;position:absolute;right:0}.pinned-audio-volume{align-items:center;height:2.5rem;position:relative;width:2.5rem}html.is-touch .pinned-audio-volume{display:none}.pinned-audio-volume-tunnel{bottom:-1rem;content:" ";left:0;position:absolute;right:0;top:100%}.pinned-audio-volume .player-volume__icon{cursor:pointer;display:flex}.pinned-audio-volume .progress-line-container{background-color:var(--surface-color);border-radius:10px;box-shadow:0 1px 5px 0 rgba(0,0,0,.15);margin-top:2.25rem;opacity:0;padding:.75rem 1rem;position:absolute;top:100%;transform:rotate(270deg);transition:opacity .2s ease-in-out,visibility 0s .2s;visibility:hidden;width:5rem}body.animation-level-0 .pinned-audio-volume .progress-line-container{transition:none!important}.pinned-audio-volume:active .progress-line-container,.pinned-audio-volume:hover .progress-line-container{opacity:1;transition:opacity .2s ease-in-out,visibility 0s 0s;visibility:visible}.markup-tooltip{background:var(--surface-color);border-radius:10px;bottom:0;display:flex;height:44px;justify-content:flex-start;left:0;opacity:0;overflow:hidden;position:fixed;right:0;top:0;transform:translateZ(0);transition:opacity var(--layer-transition),transform var(--layer-transition),width var(--layer-transition);width:252px;z-index:1}body.animation-level-0 .markup-tooltip{transition:none}.markup-tooltip-wrapper{align-items:center;display:flex;height:100%;justify-content:flex-start;left:0;max-width:100%;position:absolute;top:0;transform:translateX(0);transition:transform var(--layer-transition);width:672px}body.animation-level-0 .markup-tooltip-wrapper{transition:none}.markup-tooltip-tools{align-items:center;display:flex;flex:0 0 auto;justify-content:space-between;max-width:100%;padding:7px}.markup-tooltip-tools:first-child{width:252px}.markup-tooltip-tools:last-child{width:420px}.markup-tooltip-tools:last-child .markup-tooltip-delimiter{margin:0 .25rem}.markup-tooltip-delimiter{background-color:var(--border-color);height:25px;width:1px}.markup-tooltip .btn-icon{border-radius:8px!important;height:30px;padding:0;width:30px}.markup-tooltip .btn-icon.active{background-color:var(--primary-color)!important;color:#fff!important}.markup-tooltip:not(.is-visible){pointer-events:none}.markup-tooltip.is-visible{opacity:1}.markup-tooltip.is-link{width:420px}.markup-tooltip.is-link .markup-tooltip-wrapper{transform:translateX(-252px)}.markup-tooltip-link-apply{color:var(--primary-color);font-size:2rem}.markup-tooltip-link-apply-container{align-items:center;display:flex;opacity:0;pointer-events:none;transition:opacity var(--layer-transition)}body.animation-level-0 .markup-tooltip-link-apply-container{transition:none}.markup-tooltip .input-clear{flex:1 1 auto;margin:0 .5rem;text-overflow:ellipsis}.markup-tooltip .input-clear.is-valid+.markup-tooltip-link-apply-container{opacity:1;pointer-events:all}.stickers-helper>.scrollable{max-height:13.75rem;min-height:var(--esg-sticker-size);padding:.4375rem;position:relative}.stickers-helper-stickers{border-radius:var(--border-radius);max-width:100%}html.no-touch .stickers-helper .super-sticker:not(.active):active,html.no-touch .stickers-helper .super-sticker:not(.active):hover{background:none}.emoji-helper{height:50px;padding:.25rem 0!important}.emoji-helper>.scrollable{position:relative;width:auto}.emoji-helper .super-emojis{display:block;white-space:nowrap}.emoji-helper .super-emojis:after,.emoji-helper .super-emojis:before{content:" ";display:inline-block;width:.25rem}html.no-touch .emoji-helper .super-emoji:not(.active):active,html.no-touch .emoji-helper .super-emoji:not(.active):hover{background:none}.emoji-helper .super-emoji.active{background-color:var(--primary-color)!important}.inline-helper{-webkit-user-select:none;-moz-user-select:none;user-select:none}.inline-helper:not(.is-gallery){min-width:min(20rem,100%)}.inline-helper .scrollable{max-height:232px;position:relative}.inline-helper-separator{background-color:var(--border-color);height:1px;margin-left:4rem;width:100%}.inline-helper-separator:last-child{display:none}.inline-helper .btn-primary{border-radius:0;border-radius:initial}.inline-helper-results:not(.is-gallery){cursor:pointer}.inline-helper-results:not(.is-gallery) .inline-helper-result{height:4rem;line-height:var(--line-height);padding:.5rem .5rem .5rem 4rem}.inline-helper-results:not(.is-gallery) .inline-helper-result-preview{height:3rem!important;left:.5rem;overflow:hidden;position:absolute;width:3rem!important}.inline-helper-results:not(.is-gallery) .inline-helper-result-preview.empty{align-items:center;background-color:var(--primary-color);border-radius:.375rem;color:#fff;display:flex;font-size:1.75rem;justify-content:center;text-transform:uppercase}.inline-helper .media-container{border-radius:inherit}.inline-helper .media-photo,.inline-helper .media-poster,.inline-helper .media-video{border-radius:inherit;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.inline-helper .gif{bottom:0;height:auto!important;left:0;position:absolute;right:0;top:0;width:auto!important}.inline-helper-results.is-gallery{grid-gap:1px;border-radius:var(--border-radius);grid-template-columns:repeat(auto-fill,minmax(var(--esg-sticker-size),1fr));max-width:100%}.inline-helper-results.is-gallery .inline-helper-result{height:auto!important;width:auto!important}.inline-helper-result{position:relative}.inline-helper-result-title{font-weight:var(--font-weight-bold);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inline-helper-result-description{-webkit-line-clamp:2;-webkit-box-orient:vertical;color:var(--secondary-text-color);display:-webkit-box;font-size:.875rem;overflow:hidden;text-overflow:ellipsis;white-space:pre-wrap}.inline-helper-cant-send{color:var(--secondary-text-color);display:none;margin:0 auto}.inline-helper.cant-send{height:3rem;width:100%!important}.inline-helper.cant-send .scrollable-y{display:none}.inline-helper.cant-send .inline-helper-cant-send{display:block}.chat-search{left:0;position:absolute!important;right:0;top:0;z-index:2}.chat-search-footer{align-items:center;background-color:var(--surface-color);box-shadow:0 -1px 5px -1px rgba(0,0,0,.21);display:flex;flex:0 0 auto;height:46px;justify-content:space-between;overflow:hidden;padding:0 8px;width:100%}.chat-search-footer .chat-search-count{color:var(--secondary-text-color);margin-left:8px}.chat-search-count:empty,.chat-search-count:not(:empty)+.btn-icon,.chat-search-footer+.chat-input{display:none}.chat-search-controls{display:flex}.chat-search-results{background-color:var(--surface-color);height:100%;left:0;max-height:100%;opacity:0;overflow:hidden;position:absolute;top:0;transition:.2s ease;visibility:hidden;width:100%}body.animation-level-0 .chat-search-results{transition:none}.chat-search-results.active{opacity:1;visibility:visible}.chat-search .tgico-up{margin-right:2px}.drops-container{--padding:0px;align-items:center;bottom:var(--padding);display:flex;flex-direction:column;justify-content:center;left:var(--padding);position:absolute!important;right:var(--padding);top:var(--padding);-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important;z-index:3}.drops-container:not(.is-visible){display:none}.drops-container.is-visible{animation:fade-in-opacity .2s linear forwards}.drops-container.is-visible.backwards{animation:fade-in-backwards-opacity .2s linear forwards}.drop{--wrapper-padding:-4px;align-items:center;background-color:var(--surface-color);border-radius:12px;color:#a2acb4;display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;max-width:100%;pointer-events:all;position:relative;transition:color .2s ease-in-out;width:100%}.drop-outline-wrapper{bottom:var(--wrapper-padding);left:var(--wrapper-padding);pointer-events:none;position:absolute;right:var(--wrapper-padding);top:var(--wrapper-padding)}.drop-outline-path{fill:none;stroke-dasharray:13.5,11;stroke:#a2acb4;stroke-width:2;stroke-linecap:round;stroke-dashoffset:0;transition:stroke .2s ease-in-out}.drop.is-dragover .drop-outline-path{stroke:var(--primary-color);animation:drop-outline-move .5s linear infinite}.drop-icon{font-size:6rem}.drop-header{font-size:1.25rem;font-weight:var(--font-weight-bold)}.drop-header:not(:last-child){margin-top:-10px}@media only screen and (max-height:670px){.drop-icon{font-size:0}.drop-header{margin-top:0}}.drop.is-dragover{color:var(--primary-color)}.drop+.drop{margin-top:10px}@keyframes drop-outline-move{0%{stroke-dashoffset:0}to{stroke-dashoffset:-24.5}}body.is-dragging .page-chats{pointer-events:none}.bot-commands{--border-radius-padding:24px;--offset:.5rem;animation:none!important;background-color:transparent!important;border-radius:12px 12px 0 0!important;bottom:calc(100% - var(--border-radius-padding));box-shadow:none;left:calc(var(--offset)*-1);max-height:20rem;max-width:none;overflow:hidden;padding:var(--offset) var(--offset) 0!important;pointer-events:none;position:absolute!important;right:calc(var(--offset)*-1);transition:none!important;visibility:visible!important;width:auto!important}body.animation-level-2 .bot-commands{display:flex!important}.bot-commands .scrollable{background-color:var(--surface-color);border-radius:inherit;box-shadow:0 1px 8px 1px rgba(0,0,0,.12);height:auto;max-height:207px!important;pointer-events:all}body.animation-level-2 .bot-commands .scrollable{opacity:0;transform:translateY(var(--height))}.bot-commands.is-visible.animating .scrollable{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.bot-commands.is-visible:not(.backwards) .scrollable{opacity:1;transform:translateY(0)}.bot-commands-list{border-radius:inherit;height:var(--height);padding-bottom:0;width:100%}.bot-commands-list-element{align-items:flex-start;border-radius:0!important;flex-direction:column;justify-content:center;padding-left:3.375rem}.bot-commands-list-element-avatar{left:.75rem;position:absolute}.bot-commands-list-element-description,.bot-commands-list-element-name{font-size:.875rem;line-height:var(--line-height-14);margin-left:0}.crop .overlay::-moz-selection,.crop-component::-moz-selection{background:transparent}.crop .overlay::selection,.crop-component::selection{background:transparent}.crop-image,.crop-overlay-image{display:block;height:auto;-o-object-fit:contain;object-fit:contain;-o-object-position:center;object-position:center;width:auto}.crop-image{display:block;pointer-events:none;position:relative}.crop-component{background-color:#fff;margin:0 auto;overflow:hidden;position:relative;z-index:999}.crop-component>img{max-width:100%}.crop-overlay{border-radius:50%;box-sizing:content-box;overflow:hidden;position:absolute;z-index:999}.crop-overlay:active,html.no-touch .crop-overlay:hover{cursor:move}.crop-overlay-image{display:block;position:absolute}.crop-overlay-color{background-color:hsla(0,0%,100%,.7);border-radius:8px;height:100%;left:0;position:absolute;top:0;width:100%}.crop.is-forum .crop-overlay{border-radius:var(--avatar-border-radius-forum)}.sidebar-header{align-items:center;background-color:var(--surface-color);cursor:default;display:flex;flex:0 0 auto;justify-content:space-between;min-height:3.5rem;padding-left:1rem;padding-right:1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.sidebar-header .btn-menu{overflow-y:overlay}@media only screen and (max-width:600px){.sidebar-header{padding-left:.5rem;padding-right:.5rem}}[dir=ltr] .sidebar-header__title{padding-left:1.5rem}[dir=rtl] .sidebar-header__title{padding-right:1.5rem}.sidebar-header__title{color:var(--primary-text-color);flex:1;font-size:1.25rem;font-weight:var(--font-weight-bold)}[dir=ltr] .sidebar-header .btn-icon+.btn-icon{margin-left:.5rem}[dir=rtl] .sidebar-header .btn-icon+.btn-icon{margin-right:.5rem}.sidebar-header-right{flex:0 0 auto}.scrollable-y-bordered .sidebar-header{position:relative}.scrollable-y-bordered .sidebar-header:after{background-color:var(--border-color);bottom:-1px;content:" ";height:1px;left:0;opacity:0;position:absolute;right:0;z-index:1}body.animation-level-2 .scrollable-y-bordered .sidebar-header:after{transition:opacity var(--transition-standard-in)}.scrollable-y-bordered:not(.scrolled-top) .sidebar-header:after{opacity:1}.sidebar-close-button{flex:0 0 auto;height:2.5rem;overflow:inherit!important;width:2.5rem}.sidebar-content{display:flex;flex:1 1 auto;height:100%;max-height:100%;overflow:hidden;position:relative;width:100%}.profile-avatars-container{cursor:pointer;padding-bottom:100%;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}html.no-touch .profile-avatars-container:active .profile-avatars-arrow,html.no-touch .profile-avatars-container:hover .profile-avatars-arrow{opacity:.2}.profile-avatars-container.is-single .profile-avatars-arrow,.profile-avatars-container.is-single .profile-avatars-tabs{display:none}.profile-avatars-container.is-swiping .profile-avatars-arrow{opacity:0!important}.profile-avatars-avatars{display:flex;flex-wrap:nowrap;height:100%;position:absolute;transform:translateZ(-1px) scale(2);transform-origin:left top;transition:transform .2s ease-in-out;width:100%}.scrollable.no-parallax .profile-avatars-avatars{transform:translate(0)}.profile-avatars-avatars:before{bottom:0;content:" ";left:0;right:0;top:0}.profile-avatars-avatar{background-color:#000;display:flex;height:inherit;min-height:100%;min-width:100%;position:relative;width:inherit}.profile-avatars-avatar .avatar-photo{height:100%;-o-object-fit:cover;object-fit:cover;pointer-events:none;width:100%}.profile-avatars-gradient{background:linear-gradient(1turn,rgba(0,0,0,.3) 8.98%,transparent);bottom:0;height:80px;left:0;position:absolute;right:0}[dir=ltr] .profile-avatars-info{left:1.5rem}[dir=rtl] .profile-avatars-info{right:1.5rem}.profile-avatars-info{align-items:flex-start;bottom:0;bottom:.5625rem;display:flex;flex-direction:column;pointer-events:none;position:absolute}[dir=ltr] .profile-avatars-info .profile-name,[dir=ltr] .profile-avatars-info .profile-subtitle{text-align:left}[dir=rtl] .profile-avatars-info .profile-name,[dir=rtl] .profile-avatars-info .profile-subtitle{text-align:right}.profile-avatars-info .profile-name,.profile-avatars-info .profile-subtitle{color:#fff;margin:0}.profile-avatars-info .peer-typing-container{--color:#fff}.profile-avatars-info .premium-icon{color:#fff}.profile-avatars-info .verified-icon-background{fill:#fff}.profile-avatars-info .verified-icon-check{visibility:hidden}.profile-avatars-info .premium-icon,.profile-avatars-info .profile-subtitle,.profile-avatars-info .verified-icon{opacity:.7}.profile-avatars-info .online{color:inherit!important}.profile-avatars-tabs{display:flex;height:.125rem;left:.375rem;pointer-events:none;position:absolute;right:.375rem;top:.5rem}.profile-avatars-tab{background-color:#fff;border-radius:4px;flex:1 1 auto;height:inherit;margin:0 .125rem;opacity:.2;transition:opacity .2s ease-in-out}.profile-avatars-tab.active{opacity:.6}.profile-avatars-arrow{bottom:0;left:0;opacity:0;position:absolute;top:0;width:33.3333333333%}.profile-avatars-arrow:before{color:#fff;font-size:2.1875rem;left:.625rem;position:absolute;top:50%;transform:translateY(-50%)}body.animation-level-2 .profile-avatars-arrow{transition:opacity .2s ease-in-out}html.no-touch .profile-avatars-container:not(.is-swiping) .profile-avatars-arrow:active,html.no-touch .profile-avatars-container:not(.is-swiping) .profile-avatars-arrow:hover{opacity:1!important}.profile-avatars-arrow-next{left:auto;right:0}.profile-avatars-arrow-next:before{left:auto;right:.625rem}.profile-content{display:flex;flex:0 0 auto;flex-direction:column;position:relative;width:100%}.profile-content .sidebar-left-section{background-color:var(--surface-color);padding-bottom:.5rem;position:relative}.profile-content .sidebar-left-section .profile-subtitle .peer-typing-container{justify-content:center}.profile-content.search-empty .gradient-delimiter{display:none}@media only screen and (max-width:600px){.profile-button{border-radius:0}}[dir=ltr] .profile-change-avatar{right:1.25rem}[dir=rtl] .profile-change-avatar{left:1.25rem}.profile-change-avatar{--size:3.375rem;position:absolute!important;top:calc(var(--size)/-2);transform:none;transition:none!important}.profile-container>.scrollable{display:flex;flex-direction:column}.profile-name{align-items:flex-end;color:var(--primary-text-color);display:flex;font-size:var(--font-size-20);font-weight:var(--font-weight-bold);line-height:var(--line-height-20);margin:0 auto;max-width:21.25rem;overflow:hidden;text-align:center}.profile-name span.emoji{min-width:-moz-min-content;min-width:min-content;vertical-align:inherit}.profile-name .peer-title{overflow:hidden;text-overflow:ellipsis;word-break:break-word}.sidebar-left-section-content>.profile-name{justify-content:center}.profile-name .badge-fake{align-self:center}.profile-subtitle{align-items:center;color:var(--secondary-text-color);display:flex;font-size:.875rem;justify-content:center;margin-bottom:.875rem;margin-top:1px;text-align:center}@media only screen and (max-width:600px){.profile-subtitle{margin-top:3px}}.profile-subtitle .online{color:var(--primary-color)}.profile-avatar{display:block;margin:.5rem auto 10px}@media only screen and (max-width:600px){.profile-avatar{--size:100px;--multiplier:.54;margin:0 auto 10px}}.profile-avatar,.profile-name,.profile-subtitle{flex:0 0 auto}.menu-horizontal-scrollable{--scrollable-size:3rem;height:var(--scrollable-size)}.menu-horizontal-scrollable:after{border-bottom:1px solid var(--border-color);bottom:0;content:" ";height:1px;left:0;position:absolute;right:0;z-index:-1}.menu-horizontal-scrollable .menu-horizontal-div{border-bottom:none}.menu-horizontal-div{--size:var(--scrollable-size,3rem);--padding-horizontal:0px;border-bottom:1px solid var(--border-color);color:var(--secondary-text-color);display:flex;flex-direction:row;height:var(--size);justify-content:space-around;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:2}.menu-horizontal-div:not(.no-stripe):after,.menu-horizontal-div:not(.no-stripe):before{content:" ";flex:0 0 auto;width:var(--padding-horizontal)}.menu-horizontal-div:not(.no-stripe) .menu-horizontal-div-item{border-radius:10px 10px 0 0}.menu-horizontal-div-item{align-items:center;border-radius:0;cursor:pointer;display:flex;flex:1 1 auto;font-size:1rem;font-weight:var(--font-weight-bold);height:100%;justify-content:center;line-height:var(--line-height);padding:0 1rem;position:relative;text-align:center;transition:none!important}html.no-touch .menu-horizontal-div-item:active,html.no-touch .menu-horizontal-div-item:hover{background-color:var(--light-secondary-text-color)}.menu-horizontal-div-item.active{color:var(--primary-color)}.menu-horizontal-div-item.active i{opacity:1}.menu-horizontal-div-item.active .c-ripple__circle,html.no-touch .menu-horizontal-div-item.active:active,html.no-touch .menu-horizontal-div-item.active:hover{background-color:var(--light-primary-color)}.menu-horizontal-div-item.active .badge{background-color:var(--primary-color)}.menu-horizontal-div-item>span{align-items:center;display:inline-flex;overflow:visible;pointer-events:none;position:relative}.menu-horizontal-div i{background-color:var(--primary-color);border-radius:.1875rem .1875rem 0 0;bottom:-.8125rem;box-sizing:content-box;height:.1875rem;left:0;opacity:0;pointer-events:none;position:absolute;transform-origin:left;width:100%;z-index:1}.menu-horizontal-div i.animate{transition:transform var(--tabs-transition)}.tabs-container{display:grid;grid-template-columns:100%;grid-template-rows:100%;min-width:100%;width:100%}.tabs-container .tabs-tab{background-color:var(--background-color);display:none;flex-direction:column;grid-column-start:1;grid-row-start:1;overflow:hidden}body.animation-level-0 .tabs-container .tabs-tab{transition:none!important}.tabs-container .tabs-tab.active{display:flex}.tabs-container[data-animation=tabs] .tabs-tab{transition:transform var(--tabs-transition)}.tabs-container[data-animation=navigation].animating .tabs-tab{transition:transform var(--transition-standard-in),filter var(--transition-standard-in)}.tabs-container[data-animation=navigation].animating.backwards .tabs-tab{transition:transform var(--transition-standard-out),filter var(--transition-standard-out)}#column-left{flex:1 1 auto;flex-direction:column;max-width:420px;width:420px}@media only screen and (max-width:600px){#column-left{max-width:100%;width:100%}body:not(.is-left-column-shown) #column-left{filter:brightness(80%);transform:translate3d(-25vw,0,0)}}@media only screen and (min-width:601px){#column-left{overflow:visible}[dir=ltr] #column-left:after{right:-1px}[dir=rtl] #column-left:after{left:-1px}#column-left:after{background-color:var(--border-color);content:" ";display:block;height:100vh;position:absolute;top:0;width:1px;z-index:2}}@media only screen and (min-width:601px)and (max-width:925px){#column-left{display:flex;left:0;max-width:none;position:fixed;top:0;transform:translate3d(-5rem,0,0);transition:transform var(--layer-transition);width:26.5rem}body.animation-level-0 #column-left{transition:none}body.is-left-column-shown #column-left{transform:translateZ(0)}}@media only screen and (min-width:926px){#column-left{display:flex}}@media only screen and (max-width:1275px){#column-left{flex:2}}@media only screen and (min-width:1681px){html.is-safari #column-left{max-width:418.75px}}#column-left .item-main .menu-horizontal-scrollable{background-color:var(--surface-color);position:relative;top:auto;z-index:1}@media only screen and (max-width:600px){#column-left .item-main .menu-horizontal-scrollable{box-shadow:0 1px 5px -1px rgba(0,0,0,.16)}}#column-left .item-main .menu-horizontal-scrollable .scrollable{position:relative}[dir=ltr] #column-left .item-main .menu-horizontal-scrollable .badge{margin-left:5px}[dir=rtl] #column-left .item-main .menu-horizontal-scrollable .badge{margin-right:5px}#column-left .item-main .menu-horizontal-scrollable:not(.hide)+#folders-container{height:calc(100% - var(--scrollable-size));position:relative}#column-left .item-main .menu-horizontal-scrollable:not(.hide)+#folders-container .scrollable{padding-top:.5rem}#column-left .item-main .menu-horizontal-scrollable:not(.hide)+#folders-container .dialogs-placeholder-canvas{top:.5rem}#column-left .item-main .menu-horizontal-div{--padding-horizontal:.6875rem;justify-content:flex-start;position:relative!important;z-index:0}@media only screen and (max-width:600px){#column-left .item-main .menu-horizontal-div{--padding-horizontal:.1875rem}}#column-left .item-main .menu-horizontal-div-item{flex:0 0 auto;min-width:3rem}#column-left .item-main .menu-horizontal-div__stripe{display:none}#column-left .folders-tabs-scrollable{flex:0 0 auto}#column-left .item-main{--offset-top:0;background-color:var(--surface-color)}[dir=ltr] #column-left .item-main .input-search .selector-user{left:6px}[dir=rtl] #column-left .item-main .input-search .selector-user{right:6px}[dir=ltr] #column-left .item-main .input-search .selector-user{margin-left:0}[dir=rtl] #column-left .item-main .input-search .selector-user{margin-right:0}#column-left .item-main .input-search .selector-user{height:30px;line-height:1.875rem;position:absolute!important;top:6px;z-index:1}[dir=ltr] #column-left .item-main .input-search.is-picked .input-search-input{padding-left:calc(var(--paddingLeft) + 12px - var(--border-width))}[dir=rtl] #column-left .item-main .input-search.is-picked .input-search-input{padding-right:calc(var(--paddingLeft) + 12px - var(--border-width))}#column-left .item-main .input-search.is-picked .tgico-close{display:block!important}#column-left .item-main .input-search.is-picked-twice .selector-user:first-of-type{width:30px}[dir=ltr] #column-left .item-main .input-search.is-picked-twice .selector-user:last-of-type{left:38px}[dir=rtl] #column-left .item-main .input-search.is-picked-twice .selector-user:last-of-type{right:38px}[dir=ltr] #column-left .item-main .search-helper{margin-left:28px}[dir=rtl] #column-left .item-main .search-helper{margin-right:28px}#column-left .item-main .search-helper{display:flex}@media only screen and (max-width:600px){[dir=ltr] #column-left .item-main .search-helper{margin-left:20px}[dir=rtl] #column-left .item-main .search-helper{margin-right:20px}}#column-left .item-main .search-helper .selector-user{font-size:14px;margin-top:7px}html.no-touch #column-left .item-main .search-helper .selector-user:active,html.no-touch #column-left .item-main .search-helper .selector-user:hover{background-color:var(--light-primary-color)}#column-left .item-main .search-helper .selector-user-avatar:after{display:none!important}#column-left .item-main .search-helper:empty{display:none}#column-left .item-main .search-super-tabs-scrollable{flex:0 0 auto;position:relative!important}#column-left .item-main .search-super-tabs-scrollable:before{display:none}#column-left .item-main .search-super-tabs-scrollable .menu-horizontal-div-item{flex:1 0 auto!important}#column-left .item-main .search-super .preloader{height:100%;top:50%;transform:translate(-50%,-50%)}#column-left #chatlist-container{background-color:var(--surface-color);max-height:100%;position:relative}#column-left #chatlist-container.has-filters .connection-status-bottom{height:calc(100% + var(--offset-top)*-1)}#column-left #folders-container{flex:1 1 auto}#column-left #folders-container .scrollable-y{background-color:transparent;position:absolute}#column-left #folders-container .scrollable-y.active{display:block}#column-left .dialogs-placeholder-canvas{position:absolute;top:0;z-index:2}#column-left .sidebar-slider{height:100%}#column-left .sidebar-header__btn-container{align-items:center;display:flex;flex:0 0 auto;height:2.5rem;justify-content:center;position:relative;width:2.5rem}#column-left .sidebar-header__btn-container>.btn-icon{bottom:0;left:0;margin:0;opacity:0;position:absolute;right:0;top:0;visibility:hidden;z-index:4}body.animation-level-0 #column-left .sidebar-header__btn-container>.btn-icon:before{transition:none}#column-left .sidebar-header__btn-container>.btn-icon.is-visible{opacity:1;visibility:visible}@media only screen and (max-width:600px){#column-left .sidebar-header__btn-container .btn-menu{margin-top:-.25rem}}#column-left .sidebar-tools-button{width:100%}#column-left .sidebar-tools-button .btn-menu{max-height:calc(var(--vh)*100 - 3.75rem);min-width:260px}[dir=ltr] #column-left .sidebar-tools-button .btn-menu-item{padding-right:.375rem}[dir=rtl] #column-left .sidebar-tools-button .btn-menu-item{padding-left:.375rem}[dir=ltr] #column-left .archived-count{margin-left:.625rem}[dir=rtl] #column-left .archived-count{margin-right:.625rem}#column-left .archived-count{justify-self:flex-end}html[dir=ltr].is-mobile #column-left .archived-count{margin-right:.375rem}html[dir=rtl].is-mobile #column-left .archived-count{margin-left:.375rem}@media only screen and (max-width:600px){#column-left .archived-count{font-weight:var(--font-weight-bold)}}#column-left .archived-count:empty{display:none}#column-left .search-group-people .chatlist{display:flex;flex-direction:row;margin-top:-1px;padding:0 0 1px}#column-left .search-group-people .chatlist:after,#column-left .search-group-people .chatlist:before{content:" ";display:inline-block;flex:0 0 auto;width:.3125rem}#column-left .search-group-people .chatlist-chat{align-items:center;border-radius:10px;display:flex;flex:0 0 auto;flex-direction:column;height:6.125rem;justify-content:flex-end;max-width:4.875rem;padding:0!important;width:4.875rem}#column-left .search-group-people .dialog-subtitle,#column-left .search-group-people .dialog-title-details{display:none}#column-left .search-group-people .dialog-title{max-width:65px;padding-bottom:.75rem}#column-left .search-group-people .dialog-title .user-title{font-size:.75rem!important}#column-left .search-group-people .dialog-title .peer-title{font-weight:var(--font-weight-normal)!important}[dir=ltr] #column-left .search-group-people .dialog-avatar{left:auto!important}[dir=rtl] #column-left .search-group-people .dialog-avatar{right:auto!important}#column-left .search-group-people .dialog-avatar{top:.75rem!important}#column-left .search-group-people .search-group-scrollable{position:relative}@media only screen and (max-width:600px){[dir=ltr] #column-left .search-group-people .search-group-scrollable{margin-left:-7px}[dir=rtl] #column-left .search-group-people .search-group-scrollable{margin-right:-7px}#column-left .search-group-people .search-group-scrollable{margin-top:4px}}#column-left .search-group-people .search-group-scrollable>.scrollable{position:relative}#column-left .item-main .sidebar-content{justify-content:center}#column-left .item-main .sidebar-content .btn-menu{bottom:calc(100% + 10px)}#column-left .item-main .sidebar-content .btn-corner.menu-open .tgico-close,#column-left .item-main .sidebar-content .btn-corner:not(.menu-open) .tgico-newchat_filled{visibility:visible!important}body.animation-level-2 #column-left .item-main .sidebar-content .btn-corner.menu-open .tgico-close,body.animation-level-2 #column-left .item-main .sidebar-content .btn-corner:not(.menu-open) .tgico-newchat_filled{animation:grow-icon .4s ease-in-out forwards!important}@media only screen and (max-width:600px){#column-left .item-main .sidebar-content .btn-corner{--size:54px;bottom:14px;position:fixed!important;right:14px;z-index:1}}#column-left .item-main .sidebar-content .btn-corner:not(.is-hidden){transform:translateZ(0)}#column-left .connection-status{flex:0 0 auto;overflow:hidden;padding:0 .5rem .5rem;width:100%}#column-left .connection-status:not(.is-shown) .connection-status-button{display:none}#column-left .connection-status.is-shown.animating .connection-status-button,#column-left .connection-status.is-shown.animating+.connection-status-bottom{transition:transform var(--layer-transition)}#column-left .connection-status.is-shown:not(.backwards) .connection-status-button{transform:translateY(0)}#column-left .connection-status.is-shown:not(.backwards)+.connection-status-bottom{transform:translateY(calc(64px + var(--offset-top)))}#column-left .connection-status.is-shown:not(.animating):not(.backwards)+.connection-status-bottom{height:calc(100% - 64px + var(--offset-top))}[dir=ltr] #column-left .connection-status-button{padding-left:4.5rem}[dir=rtl] #column-left .connection-status-button{padding-right:4.5rem}[dir=ltr] #column-left .connection-status-button{text-align:left}[dir=rtl] #column-left .connection-status-button{text-align:right}#column-left .connection-status-button{align-self:center;color:#2e3939;cursor:default;height:3.5rem;transform:translateY(-100%)}#column-left .connection-status-button .force-reconnect{color:inherit;cursor:pointer;text-decoration:underline}[dir=ltr] #column-left .connection-status-button .preloader-container{left:1rem}[dir=rtl] #column-left .connection-status-button .preloader-container{right:1rem}#column-left .connection-status-button .preloader-container{height:1.5rem;right:auto;width:1.5rem}#column-left .connection-status-button .preloader-container .preloader-path-new{stroke:#2e3939}#column-left .connection-status-bottom{--offset-top:0px;background-color:var(--surface-color);bottom:0;display:flex;flex-direction:column;height:100%;left:0;overflow:hidden;position:absolute;right:0;top:0;transform:translateY(var(--offset-top))}#column-left .input-wrapper{flex:0 0 auto;margin:.75rem 0;max-width:100%;padding:0 .75rem;width:420px}@media only screen and (max-width:600px){#column-left .input-wrapper{width:100%}}#search-container{display:flex;top:var(--offset-top)!important}#search-container .scrollable-y{flex:1 1 auto;position:relative}.edit-profile-container .sidebar-content,.new-channel-container .sidebar-content,.new-group-container .sidebar-content{flex-direction:column}.edit-profile-container .chatlist-container,.new-channel-container .chatlist-container,.new-group-container .chatlist-container{flex:1 1 auto}[dir=ltr] .edit-profile-container .caption,[dir=ltr] .new-channel-container .caption,[dir=ltr] .new-group-container .caption{margin-left:23px}[dir=rtl] .edit-profile-container .caption,[dir=rtl] .new-channel-container .caption,[dir=rtl] .new-group-container .caption{margin-right:23px}[dir=ltr] .edit-profile-container .caption,[dir=ltr] .new-channel-container .caption,[dir=ltr] .new-group-container .caption{padding-right:24px}[dir=rtl] .edit-profile-container .caption,[dir=rtl] .new-channel-container .caption,[dir=rtl] .new-group-container .caption{padding-left:24px}.edit-profile-container .caption,.new-channel-container .caption,.new-group-container .caption{color:var(--secondary-text-color);font-size:.875rem;margin-top:14px}.language-container .sidebar-left-section{padding-bottom:.5rem}.new-group-container .search-group{margin-top:.5rem}.edit-folder-container .chatlist{padding:0}.edit-folder-container .folder-categories .folder-category-button:nth-child(n+2){pointer-events:none}.new-group-members{padding:1.5rem 0 .4375rem}.new-group-members .search-group__name{text-transform:capitalize}.settings-container .profile-avatars-container{height:15rem;padding-bottom:0}.edit-profile-container .scroll-wrapper{width:100%}.chat-folders-container,.edit-folder-container,.people-nearby-container{-webkit-user-select:none;-moz-user-select:none;user-select:none}.chat-folders-container .sticker-container,.edit-folder-container .sticker-container,.people-nearby-container .sticker-container{flex:0 0 auto;height:86px;margin:1px auto 29px;position:relative;width:86px}.chat-folders-container .caption,.edit-folder-container .caption,.people-nearby-container .caption{color:var(--secondary-text-color);font-size:var(--font-size-14);line-height:var(--line-height-14);margin:0 auto;max-width:20rem;text-align:center}.people-nearby-container .sticker-container{margin:1rem auto}.people-nearby-container .caption{margin-bottom:1rem}.chat-folders-container .sidebar-left-section:not(:last-child){padding-bottom:0}.chat-folders-container .sidebar-left-section:last-child{padding-bottom:.5rem}.edit-folder-container .caption{margin-bottom:18px}@media only screen and (max-width:600px){.edit-folder-container .input-wrapper{padding:0 16px;width:100%}}.edit-folder-container .sidebar-left-section{padding-bottom:0}.edit-folder-container .sidebar-left-section:last-child{padding-bottom:.5rem}.folder-categories .checkbox-field{position:absolute;right:1.125rem!important}.included-chatlist-container .sidebar-left-section{padding-bottom:0}.included-chatlist-container .sidebar-left-section:first-child{padding-top:0}.included-chatlist-container .sidebar-left-section:last-child{padding-bottom:.5rem}.included-chatlist-container .sidebar-left-section .chatlist{padding:0}.included-chatlist-container .selector .chatlist .checkbox{margin-top:10px}[dir=ltr] .included-chatlist-container .selector .chatlist [type=checkbox]+span{padding-left:26px}[dir=rtl] .included-chatlist-container .selector .chatlist [type=checkbox]+span{padding-right:26px}[dir=ltr] .included-chatlist-container .chatlist-chat{padding-right:3.5rem!important}[dir=rtl] .included-chatlist-container .chatlist-chat{padding-left:3.5rem!important}.search-group-recent .search-group__name{align-items:center;display:flex;justify-content:space-between}.search-group-recent .btn-icon{font-size:22px}@media only screen and (max-width:600px){.search-group-recent.search-group.search-group-contacts ul{margin-top:0}.search-group.search-group-contacts ul,.search-group.search-group-messages ul{margin-top:7px}.search-group.search-group-messages{margin-top:-6px}}@media only screen and (min-width:601px){.search-group-recent.search-group.search-group-contacts{padding:0 0 7px}}.sidebar-left-section{padding:.5rem 0 1rem}.sidebar-left-section.with-fake-delimiter{box-shadow:none;padding-top:0!important}.sidebar-left-section.with-fake-delimiter .gradient-delimiter{margin-bottom:.5rem}.sidebar-left-section.no-padding-top{padding-top:0!important}@media only screen and (max-width:600px){.sidebar-left-section{padding-bottom:.5rem}}@media only screen and (min-width:601px){.sidebar-left-section-content{margin:0 .5rem}}.sidebar-left-section-content>.btn-primary{margin:0}[dir=ltr] .sidebar-left-section-content>.checkbox-field .checkbox-box{left:auto}[dir=rtl] .sidebar-left-section-content>.checkbox-field .checkbox-box{right:auto}@media only screen and (max-width:600px){.sidebar-left-section-content>.btn-primary,.sidebar-left-section-content>.checkbox-ripple{border-radius:0}}.sidebar-left-section-content.full-width{margin:0!important}.sidebar-left-section-content>.media-sticker-wrapper{flex:0 0 auto;height:86px;margin:1px auto 29px;position:relative;width:86px}.sidebar-left-section-name{padding:1rem}@media only screen and (max-width:600px){.sidebar-left-section-name{font-size:.875rem;padding:.5rem 1rem}}.sidebar-left-section-caption{color:var(--secondary-text-color);font-size:1rem;line-height:var(--line-height);margin-top:1rem;padding:0 1rem}@media only screen and (max-width:600px){.sidebar-left-section-caption{font-size:.875rem;margin:.5rem}}.sidebar-left-section .checkbox-field,.sidebar-left-section .radio-field{margin:0}.sidebar-left-section:first-child:not(.no-delimiter){padding-top:0}.sidebar-left-section .checkbox-field{align-items:center;display:flex;height:3.5rem;padding:0 1.125rem}.sidebar-left-section-disabled{opacity:.25;pointer-events:none!important}.sidebar-left-section .chatlist{padding:0}.sidebar-left-h2{color:var(--primary-color);font-size:16px;font-weight:var(--font-weight-bold)}.general-settings-container{-webkit-user-select:none;-moz-user-select:none;user-select:none}.general-settings-container .sidebar-left-section{padding-bottom:0}.general-settings-container .sidebar-left-section:last-child{padding-bottom:.5rem}#chats-archived-container,#contacts-container,#poll-results-container,#search-gifs-container,#search-private-container,#stickers-container,.add-members-container{background-color:var(--surface-color)!important}.chat-folders-container .btn-control{margin-bottom:1.5rem}.two-step-verification{background-color:var(--surface-color)!important}.two-step-verification .sidebar-left-section{box-shadow:none!important}.two-step-verification .sidebar-left-section:first-child{padding-top:0}.two-step-verification .sidebar-left-section-caption{margin-bottom:1.125rem;margin-left:auto;margin-right:auto;max-width:342px;text-align:center}.two-step-verification-main .btn-primary+.btn-primary{margin-top:.125rem!important}.two-step-verification .btn-primary:not(.btn-transparent){text-transform:uppercase}.two-step-verification .media-sticker-wrapper{height:168px;margin:.625rem auto 1.1875rem;width:168px}.two-step-verification .input-wrapper .btn-primary:first-child:last-child{margin-top:.25rem}.two-step-verification-enter-password .media-sticker-wrapper{height:157px;margin:1.125rem auto 1.8125rem;width:157px}.two-step-verification-hint .media-sticker-wrapper{height:160px;margin:.5rem auto 2.25rem;width:160px}.two-step-verification-email .media-sticker-wrapper{height:160px;margin:.5625rem auto 2.1875rem;width:160px}.two-step-verification-set .media-sticker-wrapper{height:160px;margin:1rem auto 1.3125rem;width:160px}[dir=ltr] .two-step-verification-set .media-sticker-wrapper .rlottie,[dir=ltr] .two-step-verification-set .media-sticker-wrapper .rlottie-vector{left:.625rem}[dir=rtl] .two-step-verification-set .media-sticker-wrapper .rlottie,[dir=rtl] .two-step-verification-set .media-sticker-wrapper .rlottie-vector{right:.625rem}.dont-u-dare-block-me .sidebar-left-section.no-delimiter{padding-top:.75rem}.dont-u-dare-block-me .sidebar-left-section{padding:0 0 .5rem}@media only screen and (min-width:601px){.privacy-tab .sidebar-left-section:first-child{padding-bottom:1.125rem}}.privacy-tab form{padding-bottom:.0625rem}.active-sessions-container .row-title:first-child{font-weight:var(--font-weight-bold)}.active-sessions-container .row-title-right{color:var(--secondary-text-color);font-size:var(--font-size-12);line-height:var(--line-height-12)}.active-sessions-container .row-midtitle,.active-sessions-container .row-subtitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.active-sessions-container .sidebar-left-section:first-child{padding-bottom:0}.active-sessions-container .sidebar-left-section:first-child .row-title{font-weight:var(--font-weight-bold)}@media only screen and (min-width:601px){.blocked-users-container ul{padding:0 .6875rem}}.notifications-container .sidebar-left-section{padding-bottom:0}.range-setting-selector{padding:1rem .875rem}.range-setting-selector-details{display:flex;justify-content:space-between;margin-bottom:1rem}.range-setting-selector-name{color:var(--primary-text-color)}.range-setting-selector-value{color:var(--secondary-text-color)}.range-setting-selector .progress-line{--height:2px;--color:var(--primary-color);--border-radius:4px;--thumb-size:12px;background-color:#e6ecf0}.range-setting-selector .progress-line__filled{background-color:var(--primary-color)}.background-container .background-item:after{border:3px solid var(--primary-color);bottom:0;content:" ";display:block;left:0;opacity:0;position:absolute;right:0;top:0;transition:opacity .2s ease-in-out}.background-container .background-item.active:after{opacity:1}.background-container .background-item.active .grid-item-media{transform:scale(.91)}.background-container .background-item-media{transform:scale(1);transition:transform .2s ease-in-out}.background-container .background .preloader-container{z-index:1}.background-item{cursor:pointer}.background-item-media{border-radius:inherit}.background-item-media.is-pattern{background-color:#000;bottom:0;left:0;position:absolute;right:0;top:0}.background-item-media.is-pattern .media-photo{mix-blend-mode:soft-light}.background-item .media-photo{border-radius:inherit;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.background-colors-canvas{border-radius:inherit;height:100%;-webkit-mask-position:center;-webkit-mask-size:cover;position:absolute;width:100%}.background-image-container .sidebar-left-section{padding-bottom:.5rem}.empty-placeholder{line-height:var(--line-height);margin:0 auto;padding:0 1rem;position:relative;text-align:center;top:40%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none;width:21rem!important}.empty-placeholder .media-sticker-wrapper{height:128px;margin:0 auto 1.9375rem;position:relative;width:128px}.empty-placeholder-header{font-size:1.25rem;font-weight:var(--font-weight-bold)}.empty-placeholder-subtitle{color:var(--secondary-text-color);font-size:.875rem;margin-top:.375rem}.empty-placeholder .btn-control{margin-top:1.75rem;padding:0 1.0625rem 0 .8125rem}[dir=ltr] .empty-placeholder .btn-control:before{margin-right:.625rem}[dir=rtl] .empty-placeholder .btn-control:before{margin-left:.625rem}.empty-placeholder-dialogs{opacity:0}body.animation-level-2 .empty-placeholder-dialogs{transition:opacity .2s ease-in-out}.empty-placeholder-dialogs-icon{margin-bottom:1.0625rem}.empty-placeholder-dialogs.visible{opacity:1}.is-forum-visible .can-have-forum .input-search,.is-forum-visible .can-have-forum .row-row,.is-forum-visible .can-have-forum .sidebar-header__title{opacity:0}.is-forum-visible .folders-tabs-scrollable{opacity:var(--disabled-opacity);pointer-events:none}.is-forum-visible.backwards .can-have-forum .input-search,.is-forum-visible.backwards .can-have-forum .row-row,.is-forum-visible.backwards .can-have-forum .sidebar-header__title,.is-forum-visible.backwards .folders-tabs-scrollable{opacity:1}.is-forum-visible.animating .can-have-forum .input-search,.is-forum-visible.animating .can-have-forum .row-row,.is-forum-visible.animating .can-have-forum .sidebar-header__title,.is-forum-visible.animating .folders-tabs-scrollable{transition:opacity var(--transition-standard-in)}.is-forum-visible.animating.backwards .can-have-forum .input-search,.is-forum-visible.animating.backwards .can-have-forum .row-row,.is-forum-visible.animating.backwards .can-have-forum .sidebar-header__title,.is-forum-visible.animating.backwards .folders-tabs-scrollable{transition:opacity var(--transition-standard-out)}#column-right{overflow:visible;overflow:initial;position:relative}@media only screen and (min-width:601px)and (max-width:1275px){#column-right{box-shadow:0 .25rem .5rem .1rem rgba(0,0,0,.2)}}@media only screen and (max-width:600px){body:not(.is-right-column-shown) #column-right{transform:translate3d(100vw,0,0)}}@media only screen and (min-width:601px)and (max-width:925px){body.is-right-column-shown:not(.is-left-column-shown) #column-right{transform:translateZ(0);transition:transform var(--transition-standard-in)}}@media only screen and (min-width:926px){body.is-right-column-shown #column-right{transform:translateZ(0);transition:transform var(--transition-standard-in)}}@media only screen and (min-width:601px){#column-right{position:absolute;right:0;transform:translate3d(var(--right-column-width),0,0);transition:transform var(--transition-standard-out);width:calc(var(--right-column-width));z-index:3}#column-right .sidebar-content{min-width:var(--right-column-width)}body.animation-level-0 #column-right{transition:none}}@media only screen and (min-width:1276px){#column-right{border-left:1px solid var(--border-color);transform:translate3d(calc(var(--right-column-width) + 1px),0,0);width:calc(var(--right-column-width) + 1px)}}#column-right .sidebar-header{flex:0 0 auto}#column-right .sidebar-header .sidebar-close-button.tgico:before{content:""}@media only screen and (min-width:601px){#column-right .sidebar-header .sidebar-close-button.tgico:before{content:""}}#column-right #search-private-container .chatlist-container{flex:1 1 auto;position:relative}#column-right .sidebar-search{display:none}#column-right .sidebar-search.active{display:flex}#column-right .input-wrapper{margin:.75rem 0;max-width:100%;padding:0 .75rem;width:100%}.shared-media-container .scrollable:not(.no-parallax){perspective:0;perspective-origin:0 0}.shared-media-container .scrollable:not(.no-parallax).parallax{perspective:1px}.shared-media-container .profile-content.is-me .profile-name{margin-bottom:.9375rem}.shared-media-container .profile-content.is-me .profile-subtitle{display:none}.shared-media-container .search-super{min-height:calc(var(--vh, 1vh)*100 - 56px);top:100%}.shared-media-container .search-super-tabs{--padding-horizontal:0}.shared-media-container .search-super-tabs .menu-horizontal-div-item{border-radius:0!important}.shared-media-container .sidebar-header .transition{flex-grow:1}.shared-media-container .sidebar-header .transition .transition-item{align-items:center;display:flex}.shared-media-container .btn-corner.menu-open:before{content:""}@media only screen and (max-width:600px){.shared-media-container .btn-corner{bottom:14px;height:54px;position:fixed!important;right:14px;width:54px;z-index:1}}.shared-media-container.can-add-members .btn-corner:not(.is-hidden){transform:translateZ(0)}.search-super{background-color:var(--surface-color);display:flex;flex-direction:column;max-width:100%;min-height:100%;position:absolute;width:100%}.search-super .search-group__show-more{color:var(--primary-color);cursor:pointer;font-weight:400}.search-super .search-super-month-name{border-top:1px solid var(--border-color);color:var(--secondary-text-color);font-weight:var(--font-weight-bold);padding:24px 0 0 24px}@media only screen and (max-width:600px){.search-super .search-super-month-name{padding:18px 0 0 16px}}.search-super.sliding{max-height:none!important}.search-super-tabs{flex:1 1 auto;width:auto}.search-super-tabs-scrollable{background-color:var(--surface-color);box-shadow:none!important;position:sticky!important;top:0;z-index:2}.search-super-tabs-scrollable:before{background-color:inherit;content:" ";display:block;height:1px;left:0;position:absolute;top:0;width:100%;z-index:-1}.search-super.is-full-viewport .search-super-tabs-scrollable:before{top:-1px}.search-super-tabs-scrollable .scrollable{display:flex;position:relative}.search-super-tabs-container{flex:1 1 auto;grid-template-rows:100%;min-height:calc(100% - 49px)}.search-super-tabs-container>div{background-color:var(--surface-color)!important;min-height:150px;position:relative}.search-super-tabs-container>div>div:first-child{min-height:calc(100vh - 111px);transform:translateY(0)}.search-super-tabs-container .preloader{padding:0;position:absolute!important;top:100px;transform:translate(-50%)}.search-super-tabs-container .preloader>svg{height:50px;width:50px}.search-super-month:first-of-type .search-super-month-name{display:none}.search-super .audio-title,.search-super .document-name,.search-super .title{display:flex;justify-content:space-between}.search-super .sent-time{color:var(--secondary-text-color);flex:0 0 auto;font-size:12px;margin-left:8px;margin-top:3px}.search-super-content-media .search-super-month-name{border:none;padding:9px 0 7px 24px}.search-super-content-media .video-time{background-color:var(--message-time-background);border-radius:4px;color:#fff;font-size:12px;height:18px;left:5px;line-height:18px;padding:0 6px 0 5px;position:absolute;top:4px;z-index:2}.search-super-content-media .grid-item{overflow:hidden}.search-super-content-media .checkbox-field{right:.25rem;top:.25rem}.search-super .checkbox-box{box-shadow:0 0 3px 0 rgba(0,0,0,.4)}.search-super .checkbox-box-border{border-color:var(--message-checkbox-border-color)}.search-super .checkbox-box-background{background-color:var(--message-checkbox-color)}.search-super .checkbox-field{margin:0;position:absolute!important;z-index:2}.search-super-content-media .search-super-month-items{grid-gap:1px;display:grid;grid-auto-rows:1fr;grid-template-columns:repeat(3,1fr);padding-top:1px;width:100%}.search-super-content-files .search-super-month-items{padding:8px 24px 16px 20px}@media only screen and (max-width:600px){.search-super-content-files .search-super-month-items{padding:8px 16px 8px 12px}}.search-super-content-files .document{--icon-size:3rem;--icon-margin:.75rem;height:calc(48px + 1.5rem)}.search-super-content-files .document-download,.search-super-content-files .document-ico{border-radius:5px!important}.search-super-content-files .document-name{font-weight:400;max-width:100%;overflow:hidden;text-overflow:ellipsis;width:100%}.search-super-content-links .search-super-item{cursor:pointer;display:flex;flex-direction:column;justify-content:flex-start;min-height:4.375rem;overflow:hidden;padding-left:4.4375rem;position:relative}.search-super-content-links .row-media{border-radius:.375rem;height:3rem;left:.6875rem;overflow:hidden;position:absolute;width:3rem}.search-super-content-links .row-media.empty{align-items:center;background-color:var(--primary-color);color:#fff;display:flex;font-size:2rem;justify-content:center;text-transform:uppercase}.search-super-content-links a:not(:last-child){position:relative;z-index:2}.search-super-content-links .anchor-url:last-child{position:static}.search-super-content-links .anchor-url:last-child:before{bottom:0;content:" ";cursor:pointer;left:0;position:absolute;right:0;top:0;z-index:1}.search-super-content-links .media-photo{border-radius:inherit;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.search-super-content-links .row-title{margin-top:.1875rem}.search-super-content-links .row-subtitle{overflow:hidden;text-overflow:ellipsis;white-space:pre-wrap;word-break:break-word}.search-super-content-links .sent-time{margin:1px 0 0}.search-super-content-links .sender-title{display:block;margin-top:.25rem}.search-super-content-links .checkbox-field{--offset-left:0!important;margin:2rem 0 0 -1.75rem!important;padding:0!important}@media only screen and (min-width:601px){.search-super-content-links .search-super-month-items{margin:.5625rem}}@media only screen and (max-width:600px){.search-super-content-links .search-super-month-name{padding:.875rem 1rem}}.search-super-content-music .search-super-month-items,.search-super-content-voice .search-super-month-items{padding:20px 15px 0 20px}@media only screen and (max-width:600px){.search-super-content-music .search-super-month-items,.search-super-content-voice .search-super-month-items{padding:20px 15px 0 12px}}.search-super-content-music .audio,.search-super-content-voice .audio{justify-content:normal;margin-bottom:1.5rem}@media only screen and (min-width:601px){.search-super-content-music .audio,.search-super-content-voice .audio{max-width:377px}}.search-super-content-music .audio.audio-show-progress .audio-subtitle,.search-super-content-voice .audio.audio-show-progress .audio-subtitle{overflow:visible}.search-super-content-groups .chatlist,.search-super-content-members .chatlist{padding-bottom:.5rem;padding-top:.5rem}.search-super-tabs-scrollable .search-super-nav-scrollable{opacity:1}body.animation-level-2 .search-super-tabs-scrollable .search-super-nav-scrollable,body.animation-level-2 .search-super-tabs-scrollable .search-super-selection-container{transition:opacity .2s ease-in-out}.search-super-tabs-scrollable.is-selecting:not(.backwards) .search-super-nav-scrollable{opacity:0}.search-super-tabs-scrollable.is-selecting:not(.backwards) .search-super-selection-container{opacity:1}.search-super.is-selecting a{pointer-events:none}.search-super.is-selecting .row:not(.menu-open){background-color:transparent!important}.search-super-selection-container{align-items:center;bottom:0;display:flex;justify-content:space-between;left:0;opacity:0;padding:0 1rem;position:absolute;right:0;top:0}.search-super-selection-container .btn-icon+.btn-icon{margin-left:.5rem}@media only screen and (max-width:600px){.search-super-selection-container{padding:0 .5rem}}.search-super-selection-count{color:var(--primary-text-color);flex-grow:1;font-weight:var(--font-weight-bold);margin-left:1.5rem;text-transform:capitalize;white-space:nowrap}#search-container .search-group.is-short .chatlist-chat:nth-child(n+4),#search-container .search-super-content-music .audio:not(.audio-show-progress) .audio-description:before,#search-container .search-super-content-music .audio:not(.audio-show-progress) .audio-time{display:none}#stickers-container .sticker-sets{display:flex;flex-direction:column;margin-top:16px}#stickers-container .sticker-set{cursor:pointer;display:flex;flex-direction:column;height:140px}#stickers-container .sticker-set-name{font-weight:var(--font-weight-bold)}#stickers-container .sticker-set-count{color:var(--secondary-text-color);font-size:14px}#stickers-container .sticker-set-header{display:flex;justify-content:space-between;padding-bottom:12px;padding-left:16px}#stickers-container .sticker-set-button{border-radius:16px;font-size:15px;font-weight:400;height:30px;margin-right:16px;padding-left:12px;padding-right:13px;transition:width .2s;width:auto}#stickers-container .sticker-set-button.gray{background:#f1f3f4;color:var(--secondary-text-color)}#stickers-container .sticker-set-stickers{display:flex;justify-content:space-around}#stickers-container .sticker-set-sticker{height:68px;position:relative;width:68px}#stickers-container .sticker-set-sticker:hover{background-color:var(--light-secondary-text-color);border-radius:12px}#stickers-container .sticker-set-sticker img{max-height:100%;max-width:100%}#poll-results-container .poll-results{display:flex;flex-direction:column;position:relative;width:100%}#poll-results-container .poll-results-answer{color:var(--secondary-text-color);display:flex;font-size:15px;font-weight:var(--font-weight-bold);justify-content:space-between;margin:0;padding:0 16px 8px;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media only screen and (min-width:601px){#poll-results-container .poll-results-answer{padding:0 24px 8px}}#poll-results-container .poll-results-more{margin:0 .5rem;width:auto}@media only screen and (max-width:600px){#poll-results-container .poll-results-more{border-radius:0;margin:0}}#poll-results-container .poll-results h3{font-size:20px;margin-bottom:16px;margin-top:15px;padding:0 16px}@media only screen and (min-width:601px){#poll-results-container .poll-results h3{padding:0 24px}}#poll-results-container .poll-results hr{display:block!important;margin-bottom:15px;margin-top:7px}.edit-peer-container .input-wrapper{margin-bottom:.5625rem!important}.edit-peer-container .sidebar-left-section{padding:0 0 .5rem}.edit-peer-container .chatlist-new{padding:0}.edit-contact-container .input-wrapper{margin-top:1.8125rem!important}.edit-contact-container .avatar-placeholder{filter:none!important}.edit-contact-container .avatar-edit{margin-bottom:1.375rem!important}.edit-contact-container .profile-name{font-size:1.5rem;line-height:var(--line-height)}.group-type-container .sidebar-left-section-caption{font-size:.875rem;margin-top:.8125rem}.group-type-container .input-wrapper{margin-top:.875rem!important}.media-viewer{align-items:center;background:rgba(0,0,0,.88);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0}@media only screen and (max-width:600px){.media-viewer{background:#000}}.media-viewer-author{align-items:center;cursor:pointer;display:flex;height:100%}@media only screen and (max-width:600px){.media-viewer-author{margin-left:1.5rem}}.media-viewer-userpic{margin-right:1rem}@media only screen and (max-width:600px){.media-viewer-userpic{display:none}}.media-viewer-name{font-weight:var(--font-weight-bold);line-height:var(--line-height);margin:.0625rem 0}@media only screen and (min-width:601px){.media-viewer-name{margin:.0625rem 0 .125rem}}.media-viewer-date{font-size:.875rem;line-height:var(--line-height)}.media-viewer-buttons{display:flex;flex-flow:row nowrap;padding:.5rem .75rem;position:absolute;right:0;top:0}.media-viewer-buttons .btn-icon{margin:0 .25rem;transition:var(--open-duration)}html.no-touch .media-viewer-buttons .btn-icon:active,html.no-touch .media-viewer-buttons .btn-icon:hover{color:#fff}@media only screen and (max-width:600px){.media-viewer-buttons{display:none}}.media-viewer-content{flex-direction:column;height:100%;justify-content:center}.media-viewer-container,.media-viewer-content{align-items:center;display:flex;max-height:100%;max-width:100%;overflow:hidden}.media-viewer-container{align-self:center;flex:1 1 auto;position:relative}.media-viewer-media{visibility:hidden}.media-viewer-caption{background-color:transparent;bottom:0;color:#fff;left:0;line-height:var(--line-height);opacity:0;overflow:hidden;padding:.5rem .5rem 0;position:absolute;right:0;text-align:center;text-overflow:ellipsis;white-space:pre-wrap;word-break:break-word;z-index:4}body.animation-level-2 .media-viewer-caption{transition:transform var(--layer-transition),opacity var(--open-duration) ease-in-out,background-color var(--open-duration) ease-in-out}.media-viewer-caption a{color:#60a5e9!important}.media-viewer-caption .scrollable{height:6rem;margin:0 auto;max-height:6rem;max-width:50rem;padding:.5rem .875rem;position:relative}html.no-touch .media-viewer-whole.active .media-viewer-caption{opacity:.4}html.no-touch .media-viewer-whole.active .media-viewer-caption:hover{opacity:1}html.is-touch .media-viewer-whole.active .media-viewer-caption{opacity:.6}@media only screen and (max-width:600px){.media-viewer-caption{bottom:1.0625rem;text-align:inherit;transform:translateZ(0);width:100%}.media-viewer-caption .scrollable{height:auto;padding:0 .5rem}.media-viewer-whole.has-video-controls .media-viewer-caption{transform:translate3d(0,-69px,0)}.media-viewer-whole.backwards .media-viewer-caption{visibility:hidden}html.no-touch .media-viewer-caption:active,html.no-touch .media-viewer-caption:hover{background-color:#000;opacity:1!important}}.media-viewer-caption.is-focused{background-color:#000;opacity:1!important}.media-viewer-switcher{cursor:pointer;height:calc(100% - 7.5rem);left:0;position:absolute;top:3.75rem;width:7rem}html.no-touch .media-viewer-switcher{height:calc(100% - 3.75rem)}html.no-touch .media-viewer-switcher:hover .tgico-down{opacity:1}@media only screen and (max-width:600px){.media-viewer-switcher{width:4rem}}.media-viewer-switcher-right{left:auto;right:0}.media-viewer-next-button,.media-viewer-prev-button{color:#fff;cursor:pointer;font-size:2rem;left:1rem;opacity:0;position:absolute;top:50%;transform:translateY(-50%) rotate(90deg);transition:var(--open-duration) opacity;z-index:5}@media only screen and (min-width:601px){.media-viewer-next-button,.media-viewer-prev-button{font-size:3rem;left:2rem}}.media-viewer-next-button{left:auto;right:1rem;transform:translateY(-50%) rotate(-90deg)}@media only screen and (min-width:601px){.media-viewer-next-button{right:2rem}}.media-viewer-mover{align-items:center;border-radius:0;display:flex;justify-content:center;left:0;min-height:auto!important;overflow:hidden;position:fixed!important;top:0;transform:translateZ(0) scaleX(1);transform-origin:top left}.media-viewer-mover:not(.center){-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}@media only screen and (max-width:600px){.media-viewer-mover{overflow:visible}}.media-viewer-mover .ckin__player{height:100%;left:0;position:absolute;top:0;width:100%}.media-viewer-mover>svg{height:100%;width:100%}.media-viewer-mover .canvas-thumbnail,.media-viewer-mover img,.media-viewer-mover video{height:100%;max-height:100%;max-width:100%;-o-object-fit:cover;object-fit:cover;opacity:1;position:absolute;transition:var(--open-duration) opacity;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.media-viewer-mover svg img,.media-viewer-mover svg video{position:static}.media-viewer-mover.active{transition:transform var(--open-duration),border-radius var(--open-duration),opacity var(--open-duration) calc(var(--open-duration)/8)}.media-viewer-mover.active.opening{transition:transform var(--open-duration),border-radius var(--open-duration),opacity var(--open-duration) 0s}.media-viewer-mover.moving{transition:transform var(--move-duration) ease}.media-viewer-mover.no-transition{transition:none!important}.media-viewer-mover.center{left:50%!important;max-height:calc(var(--vh, 1vh)*100 - 15rem);max-width:100vw;top:50%!important;transform:translate3d(-50%,-50%,0)!important}@media only screen and (max-width:600px){.media-viewer-mover.center{height:100%!important;max-height:calc(var(--vh, 1vh)*100 - 120px);max-width:100vw!important;width:100%!important}.media-viewer-mover.center .ckin__player:not(.ckin__fullscreen) .default__controls{bottom:-62px}}.media-viewer-mover.center .canvas-thumbnail,.media-viewer-mover.center img:not(.thumbnail),.media-viewer-mover.center video{-o-object-fit:contain;object-fit:contain}.media-viewer-mover.center img.thumbnail{-o-object-fit:contain;object-fit:contain;width:auto}.media-viewer-mover.hiding .canvas-thumbnail,.media-viewer-mover.hiding img,.media-viewer-mover.hiding video{opacity:0}.media-viewer-appear{opacity:0;visibility:hidden}body.animation-level-2 .media-viewer-appear{transition:opacity var(--open-duration) 0s,visibility 0s var(--open-duration)}.media-viewer-topbar{align-items:center;display:flex;height:3.5rem;justify-content:space-between;left:0;padding:0 1.25rem;position:absolute;right:0;top:0;z-index:5}.media-viewer-topbar .btn-icon,.media-viewer-topbar .media-viewer-author{color:#fff;opacity:.4}body.animation-level-2 .media-viewer-topbar .btn-icon,body.animation-level-2 .media-viewer-topbar .media-viewer-author{transition:opacity var(--open-duration) ease-in-out,color var(--open-duration) ease-in-out,background-color var(--open-duration) ease-in-out}html.no-touch .media-viewer-topbar .btn-icon:active,html.no-touch .media-viewer-topbar .btn-icon:hover,html.no-touch .media-viewer-topbar .media-viewer-author:active,html.no-touch .media-viewer-topbar .media-viewer-author:hover{opacity:1}.media-viewer-topbar-left{align-items:center;display:flex}@media only screen and (max-width:600px){.media-viewer-topbar{padding:0 .5rem}}.media-viewer-aspecter{align-items:center;border-radius:0;display:flex;height:100%;justify-content:center;position:absolute;transform:scaleX(1);width:100%}.media-viewer-mover.active .media-viewer-aspecter{transition:width var(--open-duration),height var(--open-duration),transform var(--open-duration),border-radius var(--open-duration)}.media-viewer-whole{--open-duration:.2s;--move-duration:.35s;display:block;height:100%;left:0;position:fixed!important;top:0;transition:visibility 0s var(--open-duration);visibility:hidden;width:100%;z-index:4}body.animation-level-0 .media-viewer-whole{--open-duration:0s;--move-duration:0s}.media-viewer-whole.active{transition-delay:0s;visibility:visible}.media-viewer-whole.active .media-viewer-appear,.media-viewer-whole.active .overlays{opacity:1;visibility:visible}body.animation-level-2 .media-viewer-whole.active .media-viewer-appear,body.animation-level-2 .media-viewer-whole.active .overlays{transition:opacity var(--open-duration) 0s,visibility 0s 0s}.media-viewer-whole.active .media-viewer-caption{visibility:visible}@media only screen and (max-width:600px){.media-viewer-whole .btn-menu-toggle:not(.playback-rate){color:hsla(0,0%,100%,.4);opacity:1}.media-viewer-whole .btn-menu-toggle:not(.playback-rate).menu-open{background-color:hsla(207,4%,46%,.2)!important;color:#fff}.media-viewer-whole.hide-caption .media-viewer-caption{opacity:0!important;pointer-events:none}}.media-viewer-whole.is-zooming .media-viewer-caption,.media-viewer-whole.is-zooming .media-viewer-switcher .tgico-down{opacity:0!important;pointer-events:none}.media-viewer-whole.highlight-switchers .media-viewer-switcher>span{opacity:1}.media-viewer-whole.no-forwards .canvas-thumbnail,.media-viewer-whole.no-forwards img{pointer-events:none}.media-viewer-whole.no-forwards .media-viewer-caption{-webkit-user-select:none;-moz-user-select:none;user-select:none}.media-viewer-movers{bottom:0;left:0;position:absolute;right:0;top:0;transform:translate3d(1,1,0) scale(1);transform-origin:0 0;will-change:transform;z-index:4}body.animation-level-2 .media-viewer-movers{transition:transform var(--open-duration)}.tgico-zoom:before{content:""}.tgico-zoom.zoom-in:before{content:""}.zoom-container{align-items:center;background-color:rgba(0,0,0,.4);border-radius:12px;bottom:1.25rem;display:flex;height:3.375rem;justify-content:space-between;left:50%;opacity:1;padding:.5rem;position:absolute;transform:translateX(-50%);width:17.125rem;z-index:5}body.animation-level-2 .zoom-container{transition:opacity var(--open-duration)}.zoom-container .btn-icon{color:#fff}.zoom-container .btn-icon.inactive{opacity:.4;pointer-events:none}.zoom-container .progress-line{--color:#fff;--height:2px;flex:1 1 auto;margin:0 1px}.zoom-container .progress-line:before{opacity:1}.media-viewer-whole:not(.active) .zoom-container,.zoom-container:not(.is-visible){opacity:0;pointer-events:none}.zoom-container.is-visible{opacity:1}.zoom-container.is-visible~.media-viewer-caption{opacity:0!important;pointer-events:none}.zoom-container.is-visible~.media-viewer-movers .default__button--big{opacity:0!important}.overlays{background-color:rgba(0,0,0,.2);height:100%;left:0;opacity:0;position:fixed!important;top:0;transition:opacity var(--open-duration) 0s,visibility 0s var(--open-duration);visibility:hidden;width:100%;z-index:4}.emoji-dropdown{background:var(--surface-color);display:flex;flex:1 1 auto;flex-direction:column;height:min(282px,calc(var(--vh)*100 - 135px));max-height:100%;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--esg-width)}@media only screen and (min-height:570px)and (min-width:601px){.emoji-dropdown{-webkit-backdrop-filter:var(--menu-backdrop-filter);backdrop-filter:var(--menu-backdrop-filter);background-color:var(--menu-background-color);border-radius:1.25rem;bottom:5.125rem;box-shadow:0 5px 10px 5px rgba(16,35,47,.14);height:26.25rem;left:.8125rem;max-height:26.25rem;opacity:0;position:absolute!important;transform:scale(0);transform-origin:0 100%;transition:transform var(--esg-transition),opacity var(--esg-transition);z-index:3}.emoji-dropdown.active{opacity:1;transform:scale(1)}body.animation-level-0 .emoji-dropdown{transition:none}}.emoji-dropdown .emoji-container{height:100%;max-width:100%;overflow:hidden;width:100%}.emoji-dropdown .emoji-tabs{border:none;border-top:1px solid var(--border-color);justify-content:center}.emoji-dropdown .emoji-tabs:after{content:none}.emoji-dropdown .emoji-tabs-search{left:0;margin-left:.5rem!important;position:absolute}.emoji-dropdown .emoji-tabs-delete{margin-right:.5rem!important;position:absolute;right:0}.emoji-dropdown .emoji-tabs .menu-horizontal-div-item{margin:0 .75rem}.emoji-dropdown .tabs-container{height:100%}.emoji-dropdown .stickers-padding .category-items{gap:.25rem;padding:0 .1875rem}.emoji-dropdown #content-gifs .scrollable-y{padding:0 .1875rem}.emoji-dropdown .gifs-masonry{border-radius:10px;overflow:hidden}.emoticons-container{background-color:transparent;flex-direction:column;height:100%;min-height:100%}.emoticons-menu{--item-size:1.875rem;align-items:center;min-height:3.0625rem;padding:0 .3125rem;width:100%;z-index:4}.emoticons-menu,.emoticons-menu-wrapper{background-color:transparent;height:3.0625rem}.emoticons-menu-wrapper{border-bottom:1px solid var(--border-color);max-width:100%;padding:0;position:relative}.emoticons-menu:after{content:" ";display:block;flex:0 0 auto;height:1px;width:.1875rem}.emoticons-menu .menu-horizontal-div-item{align-items:center;display:flex;flex:0 0 auto;font-size:1.5rem;height:var(--item-size);line-height:var(--item-size);margin:0 .3125rem;padding:0;width:var(--item-size)}.emoticons-menu .menu-horizontal-div-item.not-local{--item-size:2.375rem;border-radius:.25rem!important;padding:.25rem}.emoticons-menu .menu-horizontal-div-item.active{background-color:rgba(var(--primary-text-color-rgb),.06)!important}.emoticons-menu .menu-horizontal-div-item.active,html.no-touch .emoticons-menu .menu-horizontal-div-item:active,html.no-touch .emoticons-menu .menu-horizontal-div-item:hover{color:rgba(var(--primary-text-color-rgb),.8)!important}.emoticons-menu .menu-horizontal-div-item-padding{height:100%;position:relative;width:100%}.emoticons-menu .menu-horizontal-div-item.active:not(.tgico){background-color:var(--light-secondary-text-color)}.emoticons-menu .menu-horizontal-inner{border-radius:15px;flex:0 0 auto;margin:0 .3125rem;overflow:hidden;width:1.875rem}html.is-safari .emoticons-menu .menu-horizontal-inner{-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}body.animation-level-2 .emoticons-menu .menu-horizontal-inner{transition:width .2s ease-in-out}.emoticons-menu .menu-horizontal-inner-scroll{align-items:center;display:flex;height:100%;position:relative;width:8.5rem}.emoticons-menu .menu-horizontal-inner .menu-horizontal-div-item{margin:0!important;transform:scale(1)}body.animation-level-2 .emoticons-menu .menu-horizontal-inner .menu-horizontal-div-item{transition:transform .2s ease-in-out!important}.emoticons-menu .menu-horizontal-inner.active{background-color:rgba(var(--primary-text-color-rgb),.06)!important;width:8.5rem}.emoticons-menu .menu-horizontal-inner.active .menu-horizontal-div-item{transform:scale(.8)}.emoticons-menu .menu-horizontal-inner.active .menu-horizontal-div-item.active{background-color:transparent!important}.emoticons-menu .menu-horizontal-inner:not(.active){cursor:pointer}.emoticons-menu .menu-horizontal-inner:not(.active) .menu-horizontal-inner-scroll{pointer-events:none}.emoticons-menu .menu-horizontal-inner:not(.active) .menu-horizontal-div-item:first-child{pointer-events:all}.emoticons-content{flex:1;padding:0;position:relative}.emoticons-content .emoji-category{position:relative}.emoticons-content .sticky_sentinel--top{height:1px;top:0}.emoticons-content .category-title{color:rgba(var(--primary-text-color-rgb),.42);cursor:pointer;font-size:var(--font-size-16);font-weight:var(--font-weight-bold);line-height:1.1875rem;padding:.75rem .875rem .375rem;position:relative;text-align:center;width:100%}.emoticons-content .category-title .btn-icon{font-size:1.25rem;pointer-events:all;position:absolute;right:.5rem;top:50%;transform:translateY(-50%);z-index:1}.emoticons-content:not(.has-premium) .is-premium-set .category-title:before{content:"";line-height:inherit;margin-right:.125rem;vertical-align:middle}.emoji-padding .super-emojis{padding:0 .5rem}html:not(.is-safari):not(.is-ios) .scrollable::-webkit-scrollbar{height:0;opacity:0;width:0;width:.375rem}html:not(.is-safari):not(.is-ios) .scrollable::-webkit-scrollbar-thumb{height:0;width:0}html:not(.is-safari):not(.is-ios) ::-webkit-scrollbar-thumb{opacity:0;-webkit-transition:.2s ease-in-out;transition:.2s ease-in-out}html:not(.is-safari):not(.is-ios) ::-webkit-scrollbar-button{display:none;height:0;width:0}html:not(.is-safari):not(.is-ios) ::-webkit-scrollbar-corner{background-color:transparent}html:not(.is-safari):not(.is-ios) .scrollable:hover{scrollbar-color:var(--scrollbar-color) transparent}html:not(.is-safari):not(.is-ios) .scrollable:hover::-webkit-scrollbar{opacity:1}html:not(.is-safari):not(.is-ios) .scrollable:hover::-webkit-scrollbar-thumb{-webkit-backdrop-filter:blur(100);backdrop-filter:blur(100);background-color:var(--scrollbar-color);border-radius:10px;max-height:12.5rem;min-height:5rem;opacity:1}.no-scrollbar::-webkit-scrollbar,.scrollable-x::-webkit-scrollbar{display:none}.scrollable{-webkit-overflow-scrolling:touch;bottom:0;height:100%;left:0;max-height:100%;overflow-x:hidden;overflow-y:hidden;position:absolute;right:0;top:0;width:100%}.scrollable.scrollable-x{-ms-overflow-style:none;overflow-x:auto;scrollbar-width:none}.scrollable.scrollable-y{-ms-overflow-style:none;overflow-y:auto;overflow-y:overlay;scrollbar-color:transparent transparent;scrollbar-width:thin;transform:translateZ(0)}.scrollable.scrollable-y.scrollable-y-bordered{border-bottom:1px solid transparent;border-top:1px solid transparent}body.animation-level-2 .scrollable.scrollable-y.scrollable-y-bordered{transition:border-top-color var(--transition-standard-in),border-bottom-color var(--transition-standard-in)}.scrollable.scrollable-y.scrollable-y-bordered:not(.scrolled-top){border-top-color:var(--border-color)}.scrollable.scrollable-y.scrollable-y-bordered:not(.scrolled-bottom){border-bottom-color:var(--border-color)}.scrollable-padding{height:100%;min-width:100%}@keyframes scaleIn{0%{transform:scale(.2)}to{transform:scale(1)}}.selector{display:flex;flex-direction:column;height:100%;width:100%}.selector .selector-search-section{margin-bottom:0!important;padding:0!important;position:relative;z-index:1}.selector-search-container{flex:0 0 auto;max-height:132px;overflow:hidden;position:relative}.selector-search-container .scrollable{max-height:inherit;position:relative}.selector-search{display:flex;flex-flow:wrap;padding-left:1rem;padding-right:1rem;position:relative}.selector-search-input{border:none;flex:1 1 auto;outline:none}.selector-search .selector-search-input{padding:7px 0 19px}[dir=ltr] .selector-user{padding-right:17px}[dir=rtl] .selector-user{padding-left:17px}[dir=ltr] .selector-user{margin-left:-.25rem;margin-right:.75rem}[dir=rtl] .selector-user{margin-left:.75rem;margin-right:-.25rem}.selector-user{background-color:var(--light-secondary-text-color);border-radius:1.5rem;color:var(--primary-text-color);flex:0 0 auto;font-size:1rem;height:2rem;line-height:2rem;margin-bottom:7px;max-width:11.25rem;overflow:hidden;text-overflow:ellipsis;transition:opacity .2s,transform .2s,background-color .2s;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}body.animation-level-0 .selector-user{transition:none}html.no-touch .selector-user:active,html.no-touch .selector-user:hover{background-color:var(--light-danger-color);cursor:pointer}html.no-touch .selector-user:active .selector-user-avatar:after,html.no-touch .selector-user:hover .selector-user-avatar:after{opacity:1;transform:scaleX(-1) rotate(-90deg)}body:not(.animation-level-0) .selector-user.scale-in{animation:scaleIn .15s ease forwards}body:not(.animation-level-0) .selector-user.scale-out{animation:scaleIn .1s ease forwards;animation-direction:reverse}[dir=ltr] .selector-user-avatar{margin-right:8px}[dir=rtl] .selector-user-avatar{margin-left:8px}.selector-user-avatar{border-radius:50%!important;float:left;overflow:hidden;position:relative}.is-rtl .selector-user-avatar{float:right}html.is-safari .selector-user-avatar{-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}[dir=ltr] .selector-user-avatar:after{left:0}[dir=rtl] .selector-user-avatar:after{right:0}.selector-user-avatar:after{background-color:var(--danger-color);content:"";font-size:23px;height:100%;line-height:32px!important;opacity:0;position:absolute;top:0;transform:scaleX(-1) rotate(0deg);transition:opacity .2s,transform .2s;width:100%;z-index:2}body.animation-level-0 .selector-user-avatar:after{transition:none}.selector .chatlist-container{flex:1 1 auto;height:100%}.selector>hr{margin:0;padding:0}[dir=ltr] .selector .checkbox{padding-left:11px}[dir=rtl] .selector .checkbox{padding-right:11px}.selector .checkbox{margin-top:11px}.selector .checkbox-field{--offset-left:0!important;margin:0!important;padding:0!important;pointer-events:none;position:absolute!important;top:50%;transform:translateY(-50%);z-index:1}[dir=ltr] .selector .checkbox-field:first-child{margin-left:.6875rem;margin-right:1.6875rem}[dir=rtl] .selector .checkbox-field:first-child{margin-left:1.6875rem;margin-right:.6875rem}[dir=ltr] .selector .checkbox-field-round{right:1.125rem}[dir=rtl] .selector .checkbox-field-round{left:1.125rem}.selector .checkbox-field-round{--size:1.25rem}.selector .checkbox-field-round .checkbox-box-border{z-index:auto}.selector .checkbox-field-round .checkbox-box-check{--offset:6px}[dir=ltr] .selector-square .checkbox-field{left:1.25rem!important}[dir=rtl] .selector-square .checkbox-field{right:1.25rem!important}[dir=ltr] .selector-square .chatlist-chat.row-with-padding{padding-left:7.5rem!important}[dir=rtl] .selector-square .chatlist-chat.row-with-padding{padding-right:7.5rem!important}[dir=ltr] .selector-square .dialog-avatar{margin-left:3rem!important}[dir=rtl] .selector-square .dialog-avatar{margin-right:3rem!important}.gifs-masonry{grid-gap:.125rem;display:grid;gap:.125rem;grid-auto-rows:1fr;grid-template-columns:repeat(3,1fr)}.gifs-masonry .gif img,.gifs-masonry .gif video{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.gifs-masonry .gif img{left:0;position:absolute;top:0}.gifs-masonry .preloader-container{z-index:2}.preloader-circular{animation:rotate 1s linear infinite;bottom:0;height:100%;left:0;margin:auto;position:absolute;right:0;top:0;transform-origin:center center}.preloader-path{stroke-dasharray:93.6375,124.85;stroke-dashoffset:0;stroke-linecap:round;stroke:#fff;stroke-width:3}.preloader-container{bottom:0;cursor:pointer;display:flex;height:54px;left:0;margin:auto;opacity:0;overflow:hidden;position:absolute;right:0;top:0;transform:scale(0);width:54px}body:not(.animation-level-0) .preloader-container{transition:opacity .2s ease-in-out,transform .2s ease-in-out}.preloader-container.is-visible:not(.backwards){opacity:1;transform:scale(1)}.preloader-container{--color:#fff}.preloader-container .you-spin-me-round{height:100%;width:100%}.preloader-container .preloader-circular{animation:none;background-color:rgba(0,0,0,.3);border-radius:50%;height:100%;width:100%}.preloader-container .preloader-path-new{stroke-dasharray:5,149.82;stroke-dashoffset:0;stroke-linecap:round;stroke:var(--color);stroke-width:2}body.animation-level-2 .preloader-container.is-visible.animating .you-spin-me-round,body.animation-level-2 .preloader-container.is-visible:not(.manual) .you-spin-me-round{animation:rotate 2s linear infinite}body.animation-level-2 .preloader-container.is-visible.animating .preloader-path-new,body.animation-level-2 .preloader-container.is-visible:not(.manual) .preloader-path-new{transition:stroke-dasharray .2s ease-in-out,stroke-width .2s ease-in-out}.preloader-container.preloader-swing{cursor:default}.preloader-container.preloader-swing .you-spin-me-round{animation:rotate 1s linear infinite!important}.preloader-container.preloader-swing .preloader-path-new{stroke-dasharray:112.36,149.82}.preloader-container.preloader-swing.preloader-streamable .preloader-path-new{stroke-dasharray:88.95,118.61}.preloader-container .preloader-close,.preloader-container .preloader-download{bottom:0;color:var(--color);height:56%;left:0;margin:auto;opacity:1;position:absolute;right:0;top:0;width:56%}body.animation-level-2 .preloader-container .preloader-close,body.animation-level-2 .preloader-container .preloader-download{transition:opacity .2s ease-in-out}.preloader-container .preloader-close path,.preloader-container .preloader-download path{fill:var(--color)}html.no-touch .preloader-container .preloader-close:active,html.no-touch .preloader-container .preloader-close:hover,html.no-touch .preloader-container .preloader-download:active,html.no-touch .preloader-container .preloader-download:hover{background:none}.preloader-container.manual .preloader-close,.preloader-container:not(.manual) .preloader-download{opacity:0}.preloader-container.manual .preloader-path-new{stroke-width:0}.preloader-container .preloader-download{height:1.5rem;width:1.5rem}.preloader-container.preloader-streamable,.preloader-container.preloader-streamable svg{cursor:pointer!important}.preloader-container.preloader-streamable circle{stroke-width:2.5!important}.preloader-container.preloader-streamable:after{background-color:var(--color);border-radius:.125rem;content:"";height:.8125rem;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:.8125rem}.preloader-container.preloader-transparent .preloader-circular{background-color:transparent}.preloader-container.preloader-bold .preloader-path-new{stroke-width:3.5}@keyframes rotate{to{transform:rotate(1turn)}}@keyframes dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes dashNew{0%{stroke-dasharray:1,149.82;stroke-dashoffset:0}50%{stroke-dasharray:112.36,149.82;stroke-dashoffset:-38}to{stroke-dasharray:112.36,149.82;stroke-dashoffset:-149.82}}@keyframes dashNewStreamable{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-237%}}.rp{position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.btn-corner.rp .c-ripple,.btn-menu-toggle.rp .c-ripple,.menu-horizontal-div-item.rp .c-ripple,.pinned-container-wrapper.rp .c-ripple,.rp-overflow .c-ripple{border-radius:inherit;height:100%;overflow:hidden;width:100%}.btn-corner.rp .c-ripple__circle,.btn-menu-toggle.rp .c-ripple__circle,.menu-horizontal-div-item.rp .c-ripple__circle,.pinned-container-wrapper.rp .c-ripple__circle,.rp-overflow .c-ripple__circle{overflow:hidden}.c-ripple{--ripple-duration:.7s;bottom:0;left:0;position:absolute;right:0;top:0}html.is-safari .c-ripple:not(:empty){border-radius:inherit;-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}.c-ripple__circle{animation:ripple-effect .7s forwards;background-color:var(--ripple-color);border-radius:50%;display:block;pointer-events:none;position:absolute;transform:scale(0);transition:opacity .35s,background-color .35s}.c-ripple__circle.hiding,.c-ripple__square.hiding{opacity:0}@media only screen and (max-width:925px){.c-ripple{--ripple-duration:.4s}.c-ripple__circle{animation-duration:.4s;animation-name:ripple-effect-handhelds;transition-duration:.3s}}@keyframes ripple-effect{0%{transform:scale(0)}to{transform:scale(2)}}@keyframes ripple-effect-handhelds{0%{transform:scale(.27)}to{transform:scale(2)}}.avatar-like{--size:54px;--multiplier:1;color:#fff;font-size:calc(1.25rem/var(--multiplier));font-weight:var(--font-weight-bold);height:var(--size);line-height:var(--size)!important;text-align:center;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--size)}avatar-element{--color-top:var(--avatar-color-top);--color-bottom:var(--avatar-color-bottom);background:linear-gradient(var(--color-top),var(--color-bottom));border-radius:50%}avatar-element[data-color=red]{--color-top:var(--peer-avatar-red-top);--color-bottom:var(--peer-avatar-red-bottom)}avatar-element[data-color=orange]{--color-top:var(--peer-avatar-orange-top);--color-bottom:var(--peer-avatar-orange-bottom)}avatar-element[data-color=violet]{--color-top:var(--peer-avatar-violet-top);--color-bottom:var(--peer-avatar-violet-bottom)}avatar-element[data-color=green]{--color-top:var(--peer-avatar-green-top);--color-bottom:var(--peer-avatar-green-bottom)}avatar-element[data-color=cyan]{--color-top:var(--peer-avatar-cyan-top);--color-bottom:var(--peer-avatar-cyan-bottom)}avatar-element[data-color=pink]{--color-top:var(--peer-avatar-pink-top);--color-bottom:var(--peer-avatar-pink-bottom)}avatar-element[data-color=blue]{--color-top:var(--peer-avatar-blue-top);--color-bottom:var(--peer-avatar-blue-bottom)}avatar-element.tgico:before{font-size:calc(32px/var(--multiplier))}avatar-element.tgico-calendarfilter:before{font-size:calc(36px/var(--multiplier))}avatar-element.tgico-saved:before{font-size:calc(30px/var(--multiplier))!important}avatar-element.tgico-reply_filled:before{font-size:calc(28px/var(--multiplier))!important}avatar-element.tgico-deletedaccount{--color-top:var(--peer-avatar-archive-top);--color-bottom:var(--peer-avatar-archive-bottom);overflow:hidden}avatar-element.tgico-deletedaccount:before{font-size:calc(30px/var(--multiplier))}avatar-element:before{line-height:inherit!important}avatar-element.media-container{position:relative}avatar-element img{border-radius:inherit!important;display:block;height:var(--size)!important;width:var(--size)!important}avatar-element img.fade-in{animation:fade-in-opacity .2s ease forwards}avatar-element img.emoji{height:calc(1.125rem/var(--multiplier))!important;vertical-align:middle!important;width:calc(1.125rem/var(--multiplier))!important}avatar-element.is-forum{border-radius:var(--avatar-border-radius-forum)}avatar-element.is-topic{background:none;border-radius:0;position:relative}avatar-element.is-topic .topic-icon{--size:inherit}avatar-element.is-online{position:relative}avatar-element.is-online:after{background-color:var(--avatar-online-color);border:2px solid var(--surface-color);border-radius:50%;content:" ";display:block;height:14px;left:2.4375rem;position:absolute;top:2.4375rem;width:14px}avatar-element[clickable]{cursor:pointer}avatar-element.avatar-relative{position:relative}avatar-element.avatar-120{--size:120px;--multiplier:.45}avatar-element.avatar-100{--size:100px;--multiplier:.54}avatar-element.avatar-48{--size:48px;--multiplier:1.125}avatar-element.avatar-46{--size:46px;--multiplier:1.173913}avatar-element.avatar-44{--size:44px;--multiplier:1.227272}avatar-element.avatar-42{--size:42px;--multiplier:1.285714}avatar-element.avatar-40{--size:40px;--multiplier:1.35}avatar-element.avatar-36{--size:36px;--multiplier:1.5}avatar-element.avatar-35{--size:35px;--multiplier:1.542857}avatar-element.avatar-34{--size:34px;--multiplier:1.588235}avatar-element.avatar-32{--size:32px;--multiplier:1.6875}avatar-element.avatar-30{--size:30px;--multiplier:1.6875}avatar-element.avatar-26{--size:26px;--multiplier:2.076923}avatar-element.avatar-24{--size:24px;--multiplier:2.25}avatar-element.avatar-22{--size:22px;--multiplier:2.454545}avatar-element.avatar-18{--size:18px;--multiplier:3}avatar-element.avatar-16{--size:16px;--multiplier:3.375}.avatar-relative .avatar-photo{left:0;position:absolute;top:0}.avatar-full{align-items:center;border-radius:inherit;display:inline-flex;height:100%;justify-content:center;position:absolute;width:100%}.avatar-full .avatar-photo{height:100%!important;-o-object-fit:cover;object-fit:cover;width:100%!important}.document{--background-color:var(--primary-color);height:70px}.document .media-photo{border-radius:inherit}.document .media-photo.thumbnail{left:0}.document-ico{background-color:var(--background-color);border-radius:.375rem;line-height:1;text-align:center}html.is-safari .document-ico{-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}.document-ico-text{opacity:0}body.animation-level-2 .document-ico-text{transition:opacity .2s ease-in-out}.document:not(.document-with-thumb) .document-ico{padding:1.5625rem .25rem 0}@media only screen and (max-width:600px){.document:not(.document-with-thumb) .document-ico{font-size:14px;padding:1.5rem 0 0}.document:not(.document-with-thumb) .document-ico:after{--size:.875rem}}.document-ico:after{--size:1.125rem;border-bottom-color:rgba(0,0,0,.25);border-bottom-left-radius:.25rem;border-left-color:rgba(0,0,0,.25);border-right-color:var(--message-background-color);border-style:solid;border-top-color:var(--message-background-color);border-width:calc(var(--size)/2);content:"";display:block;position:absolute;right:0;top:0}body.animation-level-2 .document-ico:after{transition:border-width .2s ease-in-out}html.no-touch .document:not(.downloaded):active .document-ico:after,html.no-touch .document:not(.downloaded):hover .document-ico:after{border-width:0}html.no-touch .document:not(.downloaded):active .document-ico-text,html.no-touch .document:not(.downloaded):hover .document-ico-text{opacity:0}html.no-touch .document:not(.downloaded):active .preloader-container,html.no-touch .document:not(.downloaded):hover .preloader-container{opacity:1!important}.document:not(.downloading) .document-ico-text{opacity:1}.document:not(.downloading) .preloader-container{opacity:0!important}.document.downloading .document-ico:after{border-width:0}.document-ico{background-size:contain;font-size:1.125rem}.document-ico,.document-name,.document-size{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.document.ext-zip{--background-color:#fb8c00}.document.ext-pdf{--background-color:#df3f40}.document.ext-apk{--background-color:#43a047}.document.document-with-thumb{--background-color:#fff}.document.document-with-thumb .document-ico:after{display:none}.document.document-with-thumb .document-download{background-color:rgba(0,0,0,.2);border-radius:.375rem}.document.document-with-thumb .preloader-circular{transition:background-color .2s}.document.document-with-thumb .preloader-container:not(.manual) .preloader-circular{background-color:rgba(0,0,0,.3)!important}.document-thumb{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.document-name{font-size:var(--font-size-16);font-weight:var(--font-weight-bold);line-height:var(--line-height-16);white-space:nowrap}.document-size{color:var(--secondary-text-color);font-size:var(--font-size-14);line-height:var(--line-height-14);pointer-events:none;position:relative}.document .preloader-container{height:2.5rem;width:2.5rem}@media only screen and (max-width:600px){.document .preloader-container{height:1.625rem;width:1.625rem}}.document .preloader-circular{background-color:transparent!important}.document .preloader-path-new{stroke-width:2.5}[dir=ltr] .audio,[dir=ltr] .document{padding-left:var(--padding-left)}[dir=rtl] .audio,[dir=rtl] .document{padding-right:var(--padding-left)}.audio,.document{--padding:0px;--icon-size:3.375rem;--icon-margin:.875rem;--padding-left:calc(var(--icon-size) + var(--icon-margin) + var(--padding));cursor:pointer;display:flex;flex-direction:column;justify-content:center;padding:var(--padding);-webkit-user-select:none;-moz-user-select:none;user-select:none}[dir=ltr] .audio-download,[dir=ltr] .audio-ico,[dir=ltr] .document-download,[dir=ltr] .document-ico{margin-left:calc((var(--padding-left) - var(--padding))*-1)}[dir=rtl] .audio-download,[dir=rtl] .audio-ico,[dir=rtl] .document-download,[dir=rtl] .document-ico{margin-right:calc((var(--padding-left) - var(--padding))*-1)}.audio-download,.audio-ico,.document-download,.document-ico{color:#fff;height:var(--icon-size);position:absolute;width:var(--icon-size)}.audio-download,.document-download{align-items:center;cursor:pointer;display:flex;font-size:1.5rem;justify-content:center;opacity:1;transition:opacity .2s ease-in-out;z-index:1}.audio-download.downloaded,.document-download.downloaded{opacity:0}.audio-description,.document-description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.audio:not(.corner-download) .preloader-container:not(.preloader-streamable),.document:not(.corner-download) .preloader-container:not(.preloader-streamable){transform:scale(1)!important}.audio .checkbox-field-round,.document .checkbox-field-round{--margin-top:.25rem;--margin-left:.125rem;left:auto;margin-left:calc(var(--padding-left)*-1 + var(--icon-size) - var(--size) + var(--margin-left));margin-top:calc(var(--icon-size) - var(--size) + var(--margin-top));top:auto}.audio-ico{display:flex;justify-content:center}.audio-ico.tgico-largeplay:before{margin-right:-1px}.audio .preloader-circular{background-color:transparent!important}.audio .preloader-container:not(.preloader-streamable){height:100%;width:100%}.audio{--icon-size:3rem;--icon-margin:.5625rem;height:var(--icon-size);overflow:visible!important}.audio-download,.audio-toggle{align-items:center;background-color:var(--primary-color);border-radius:50%}.audio.corner-download .audio-download{background:none;display:flex!important;height:1.375rem;left:57.5%;margin:0!important;top:57.5%;width:1.375rem}.audio.corner-download .preloader-container{background-color:var(--primary-color);border-radius:inherit}.audio.corner-download .preloader-path-new{stroke-width:.25rem}.audio-play-icon{border-radius:inherit;bottom:0;left:0;max-height:100%;max-width:100%;overflow:hidden;position:absolute;right:0;top:0;transform:rotate(-119deg)}body.animation-level-2 .audio-play-icon{transition:transform .25s ease-in-out}.audio-toggle .part{background-color:#fff;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}body.animation-level-2 .audio-toggle .part{transition:-webkit-clip-path .25s ease-in-out;transition:clip-path .25s ease-in-out;transition:clip-path .25s ease-in-out,-webkit-clip-path .25s ease-in-out}@media only screen and (min-width:601px){.audio-toggle .part{height:140px;width:140px}}@media only screen and (max-width:600px){.audio-toggle .part{height:92px;width:92px}}.audio-toggle .part.one{-webkit-clip-path:polygon(56.42249% 57.01763%,54.93283% 57.0175%,53.00511% 57.01738%,50.83554% 57.01727%,48.62036% 57.01718%,46.55585% 57.01709%,44.83822% 57.01702%,43.66373% 57.01698%,43.22863% 57.01696%,42.86372% 57.01904%,42.56988% 57.01621%,42.3402% 56.99486%,42.16778% 56.94152%,42.0457% 56.84267%,41.96705% 56.68478%,41.92493% 56.45432%,41.91246% 56.13777%,41.91258% 55.76282%,41.9129% 55.37058%,41.91335% 54.96757%,41.91387% 54.56032%,41.91439% 54.15537%,41.91485% 53.75926%,41.91517% 53.3785%,41.91529% 53.01965%,41.94275% 52.72355%,42.02117% 52.51653%,42.14465% 52.38328%,42.30727% 52.30854%,42.50308% 52.27699%,42.72619% 52.27341%,42.97065% 52.28248%,43.23056% 52.2889%,43.94949% 52.28896%,45.45083% 52.28912%,47.47445% 52.28932%,49.76027% 52.28957%,52.04818% 52.28981%,54.07805% 52.29003%,55.5898% 52.29019%,56.32332% 52.29024%,56.58221% 52.28816%,56.83726% 52.28948%,57.07897% 52.30593%,57.29794% 52.34898%,57.48468% 52.43029%,57.62978% 52.56146%,57.72375% 52.7541%,57.75718% 53.01981%,57.75713% 53.37763%,57.75699% 53.81831%,57.75679% 54.31106%,57.75657% 54.82507%,57.75635% 55.32958%,57.75615% 55.79377%,57.75601% 56.18684%,57.75596% 56.47801%,57.7549% 56.50122%,57.74034% 56.5624%,57.6955% 56.64887%,57.60334% 56.748%,57.44691% 56.84712%,57.20925% 56.93358%,56.87342% 56.99471%);clip-path:polygon(56.42249% 57.01763%,54.93283% 57.0175%,53.00511% 57.01738%,50.83554% 57.01727%,48.62036% 57.01718%,46.55585% 57.01709%,44.83822% 57.01702%,43.66373% 57.01698%,43.22863% 57.01696%,42.86372% 57.01904%,42.56988% 57.01621%,42.3402% 56.99486%,42.16778% 56.94152%,42.0457% 56.84267%,41.96705% 56.68478%,41.92493% 56.45432%,41.91246% 56.13777%,41.91258% 55.76282%,41.9129% 55.37058%,41.91335% 54.96757%,41.91387% 54.56032%,41.91439% 54.15537%,41.91485% 53.75926%,41.91517% 53.3785%,41.91529% 53.01965%,41.94275% 52.72355%,42.02117% 52.51653%,42.14465% 52.38328%,42.30727% 52.30854%,42.50308% 52.27699%,42.72619% 52.27341%,42.97065% 52.28248%,43.23056% 52.2889%,43.94949% 52.28896%,45.45083% 52.28912%,47.47445% 52.28932%,49.76027% 52.28957%,52.04818% 52.28981%,54.07805% 52.29003%,55.5898% 52.29019%,56.32332% 52.29024%,56.58221% 52.28816%,56.83726% 52.28948%,57.07897% 52.30593%,57.29794% 52.34898%,57.48468% 52.43029%,57.62978% 52.56146%,57.72375% 52.7541%,57.75718% 53.01981%,57.75713% 53.37763%,57.75699% 53.81831%,57.75679% 54.31106%,57.75657% 54.82507%,57.75635% 55.32958%,57.75615% 55.79377%,57.75601% 56.18684%,57.75596% 56.47801%,57.7549% 56.50122%,57.74034% 56.5624%,57.6955% 56.64887%,57.60334% 56.748%,57.44691% 56.84712%,57.20925% 56.93358%,56.87342% 56.99471%)}.audio-toggle .part.two{-webkit-clip-path:polygon(56.42249% 42.44625%,54.93283% 42.44637%,53.00511% 42.44649%,50.83554% 42.4466%,48.62036% 42.4467%,46.55585% 42.44679%,44.83822% 42.44685%,43.66373% 42.4469%,43.22863% 42.44691%,42.86372% 42.44483%,42.56988% 42.44767%,42.3402% 42.46902%,42.16778% 42.52235%,42.0457% 42.6212%,41.96705% 42.77909%,41.92493% 43.00956%,41.91246% 43.32611%,41.91258% 43.70105%,41.9129% 44.0933%,41.91335% 44.49631%,41.91387% 44.90355%,41.91439% 45.3085%,41.91485% 45.70462%,41.91517% 46.08537%,41.91529% 46.44422%,41.94275% 46.74032%,42.02117% 46.94735%,42.14465% 47.0806%,42.30727% 47.15534%,42.50308% 47.18688%,42.72619% 47.19047%,42.97065% 47.1814%,43.23056% 47.17497%,43.94949% 47.17491%,45.45083% 47.17476%,47.47445% 47.17455%,49.76027% 47.1743%,52.04818% 47.17406%,54.07805% 47.17384%,55.5898% 47.17369%,56.32332% 47.17363%,56.58221% 47.17571%,56.83726% 47.17439%,57.07897% 47.15795%,57.29794% 47.1149%,57.48468% 47.03359%,57.62978% 46.90242%,57.72375% 46.70977%,57.75718% 46.44406%,57.75713% 46.08625%,57.75699% 45.64557%,57.75679% 45.15282%,57.75657% 44.6388%,57.75635% 44.1343%,57.75615% 43.6701%,57.75601% 43.27703%,57.75596% 42.98586%,57.7549% 42.96265%,57.74034% 42.90148%,57.6955% 42.815%,57.60334% 42.71587%,57.44691% 42.61675%,57.20925% 42.53029%,56.87342% 42.46916%);clip-path:polygon(56.42249% 42.44625%,54.93283% 42.44637%,53.00511% 42.44649%,50.83554% 42.4466%,48.62036% 42.4467%,46.55585% 42.44679%,44.83822% 42.44685%,43.66373% 42.4469%,43.22863% 42.44691%,42.86372% 42.44483%,42.56988% 42.44767%,42.3402% 42.46902%,42.16778% 42.52235%,42.0457% 42.6212%,41.96705% 42.77909%,41.92493% 43.00956%,41.91246% 43.32611%,41.91258% 43.70105%,41.9129% 44.0933%,41.91335% 44.49631%,41.91387% 44.90355%,41.91439% 45.3085%,41.91485% 45.70462%,41.91517% 46.08537%,41.91529% 46.44422%,41.94275% 46.74032%,42.02117% 46.94735%,42.14465% 47.0806%,42.30727% 47.15534%,42.50308% 47.18688%,42.72619% 47.19047%,42.97065% 47.1814%,43.23056% 47.17497%,43.94949% 47.17491%,45.45083% 47.17476%,47.47445% 47.17455%,49.76027% 47.1743%,52.04818% 47.17406%,54.07805% 47.17384%,55.5898% 47.17369%,56.32332% 47.17363%,56.58221% 47.17571%,56.83726% 47.17439%,57.07897% 47.15795%,57.29794% 47.1149%,57.48468% 47.03359%,57.62978% 46.90242%,57.72375% 46.70977%,57.75718% 46.44406%,57.75713% 46.08625%,57.75699% 45.64557%,57.75679% 45.15282%,57.75657% 44.6388%,57.75635% 44.1343%,57.75615% 43.6701%,57.75601% 43.27703%,57.75596% 42.98586%,57.7549% 42.96265%,57.74034% 42.90148%,57.6955% 42.815%,57.60334% 42.71587%,57.44691% 42.61675%,57.20925% 42.53029%,56.87342% 42.46916%)}.audio-toggle.playing .audio-play-icon{transform:rotate(-90deg)}@media only screen and (min-width:601px){.audio-toggle:not(.playing) .part{height:136px;width:136px}}@media only screen and (max-width:600px){.audio-toggle:not(.playing) .part{height:92px;width:92px}}.audio-toggle:not(.playing) .part.one{-webkit-clip-path:polygon(43.77666% 55.85251%,43.77874% 55.46331%,43.7795% 55.09177%,43.77934% 54.74844%,43.77855% 54.44389%,43.77741% 54.18863%,43.77625% 53.99325%,43.77533% 53.86828%,43.77495% 53.82429%,43.77518% 53.55329%,43.7754% 53.2823%,43.77563% 53.01131%,43.77585% 52.74031%,43.77608% 52.46932%,43.7763% 52.19832%,43.77653% 51.92733%,43.77675% 51.65633%,43.77653% 51.38533%,43.7763% 51.11434%,43.77608% 50.84334%,43.77585% 50.57235%,43.77563% 50.30136%,43.7754% 50.03036%,43.77518% 49.75936%,43.77495% 49.48837%,44.48391% 49.4885%,45.19287% 49.48865%,45.90183% 49.48878%,46.61079% 49.48892%,47.31975% 49.48906%,48.0287% 49.4892%,48.73766% 49.48934%,49.44662% 49.48948%,50.72252% 49.48934%,51.99842% 49.4892%,53.27432% 49.48906%,54.55022% 49.48892%,55.82611% 49.48878%,57.10201% 49.48865%,58.3779% 49.4885%,59.6538% 49.48837%,59.57598% 49.89151%,59.31883% 50.28598%,58.84686% 50.70884%,58.12456% 51.19714%,57.11643% 51.78793%,55.78697% 52.51828%,54.10066% 53.42522%,52.02202% 54.54581%,49.96525% 55.66916%,48.3319% 56.57212%,47.06745% 57.27347%,46.11739% 57.79191%,45.42719% 58.14619%,44.94235% 58.35507%,44.60834% 58.43725%,44.37066% 58.41149%,44.15383% 58.27711%,43.99617% 58.0603%,43.88847% 57.77578%,43.82151% 57.43825%,43.78608% 57.06245%,43.77304% 56.66309%,43.773% 56.25486%);clip-path:polygon(43.77666% 55.85251%,43.77874% 55.46331%,43.7795% 55.09177%,43.77934% 54.74844%,43.77855% 54.44389%,43.77741% 54.18863%,43.77625% 53.99325%,43.77533% 53.86828%,43.77495% 53.82429%,43.77518% 53.55329%,43.7754% 53.2823%,43.77563% 53.01131%,43.77585% 52.74031%,43.77608% 52.46932%,43.7763% 52.19832%,43.77653% 51.92733%,43.77675% 51.65633%,43.77653% 51.38533%,43.7763% 51.11434%,43.77608% 50.84334%,43.77585% 50.57235%,43.77563% 50.30136%,43.7754% 50.03036%,43.77518% 49.75936%,43.77495% 49.48837%,44.48391% 49.4885%,45.19287% 49.48865%,45.90183% 49.48878%,46.61079% 49.48892%,47.31975% 49.48906%,48.0287% 49.4892%,48.73766% 49.48934%,49.44662% 49.48948%,50.72252% 49.48934%,51.99842% 49.4892%,53.27432% 49.48906%,54.55022% 49.48892%,55.82611% 49.48878%,57.10201% 49.48865%,58.3779% 49.4885%,59.6538% 49.48837%,59.57598% 49.89151%,59.31883% 50.28598%,58.84686% 50.70884%,58.12456% 51.19714%,57.11643% 51.78793%,55.78697% 52.51828%,54.10066% 53.42522%,52.02202% 54.54581%,49.96525% 55.66916%,48.3319% 56.57212%,47.06745% 57.27347%,46.11739% 57.79191%,45.42719% 58.14619%,44.94235% 58.35507%,44.60834% 58.43725%,44.37066% 58.41149%,44.15383% 58.27711%,43.99617% 58.0603%,43.88847% 57.77578%,43.82151% 57.43825%,43.78608% 57.06245%,43.77304% 56.66309%,43.773% 56.25486%)}.audio-toggle:not(.playing) .part.two{-webkit-clip-path:polygon(43.77666% 43.83035%,43.77874% 44.21955%,43.7795% 44.59109%,43.77934% 44.93442%,43.77855% 45.23898%,43.77741% 45.49423%,43.77625% 45.68961%,43.77533% 45.81458%,43.77495% 45.85858%,43.77518% 46.12957%,43.7754% 46.40056%,43.77563% 46.67156%,43.77585% 46.94255%,43.77608% 47.21355%,43.7763% 47.48454%,43.77653% 47.75554%,43.77675% 48.02654%,43.77653% 48.29753%,43.7763% 48.56852%,43.77608% 48.83952%,43.77585% 49.11051%,43.77563% 49.38151%,43.7754% 49.65251%,43.77518% 49.9235%,43.77495% 50.1945%,44.48391% 50.19436%,45.19287% 50.19422%,45.90183% 50.19408%,46.61079% 50.19394%,47.31975% 50.1938%,48.0287% 50.19366%,48.73766% 50.19353%,49.44662% 50.19338%,50.72252% 50.19353%,51.99842% 50.19366%,53.27432% 50.1938%,54.55022% 50.19394%,55.82611% 50.19408%,57.10201% 50.19422%,58.3779% 50.19436%,59.6538% 50.1945%,59.57598% 49.79136%,59.31883% 49.39688%,58.84686% 48.97402%,58.12456% 48.48572%,57.11643% 47.89493%,55.78697% 47.16458%,54.10066% 46.25764%,52.02202% 45.13705%,49.96525% 44.01371%,48.3319% 43.11074%,47.06745% 42.4094%,46.11739% 41.89096%,45.42719% 41.53667%,44.94235% 41.3278%,44.60834% 41.24561%,44.37066% 41.27137%,44.15383% 41.40575%,43.99617% 41.62256%,43.88847% 41.90709%,43.82151% 42.24461%,43.78608% 42.62041%,43.77304% 43.01978%,43.773% 43.428%);clip-path:polygon(43.77666% 43.83035%,43.77874% 44.21955%,43.7795% 44.59109%,43.77934% 44.93442%,43.77855% 45.23898%,43.77741% 45.49423%,43.77625% 45.68961%,43.77533% 45.81458%,43.77495% 45.85858%,43.77518% 46.12957%,43.7754% 46.40056%,43.77563% 46.67156%,43.77585% 46.94255%,43.77608% 47.21355%,43.7763% 47.48454%,43.77653% 47.75554%,43.77675% 48.02654%,43.77653% 48.29753%,43.7763% 48.56852%,43.77608% 48.83952%,43.77585% 49.11051%,43.77563% 49.38151%,43.7754% 49.65251%,43.77518% 49.9235%,43.77495% 50.1945%,44.48391% 50.19436%,45.19287% 50.19422%,45.90183% 50.19408%,46.61079% 50.19394%,47.31975% 50.1938%,48.0287% 50.19366%,48.73766% 50.19353%,49.44662% 50.19338%,50.72252% 50.19353%,51.99842% 50.19366%,53.27432% 50.1938%,54.55022% 50.19394%,55.82611% 50.19408%,57.10201% 50.19422%,58.3779% 50.19436%,59.6538% 50.1945%,59.57598% 49.79136%,59.31883% 49.39688%,58.84686% 48.97402%,58.12456% 48.48572%,57.11643% 47.89493%,55.78697% 47.16458%,54.10066% 46.25764%,52.02202% 45.13705%,49.96525% 44.01371%,48.3319% 43.11074%,47.06745% 42.4094%,46.11739% 41.89096%,45.42719% 41.53667%,44.94235% 41.3278%,44.60834% 41.24561%,44.37066% 41.27137%,44.15383% 41.40575%,43.99617% 41.62256%,43.88847% 41.90709%,43.82151% 42.24461%,43.78608% 42.62041%,43.77304% 43.01978%,43.773% 43.428%)}.audio-download{z-index:2}.audio-waveform{height:100%}.audio-waveform-background .audio-waveform-bar{opacity:.3}html.no-touch .audio-waveform-background .audio-waveform-bar:active,html.no-touch .audio-waveform-background .audio-waveform-bar:hover{opacity:1}.audio-waveform-fake{bottom:0;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;width:0}.audio-waveform-container{align-items:center;display:flex;height:23px;margin-top:1px;position:relative}.audio-waveform-bar{fill:var(--primary-color)}.audio .audio-details{margin-bottom:0;margin-top:3px}.audio .audio-title{margin-bottom:-2px}[dir=ltr] body.is-premium .audio.can-transcribe{padding-right:2.25rem}[dir=rtl] body.is-premium .audio.can-transcribe{padding-left:2.25rem}body.is-premium .audio.can-transcribe .audio-to-text-button{display:flex}.audio .audio-to-text-button{align-items:center;align-self:flex-end;background:var(--light-filled-message-primary-color);border-radius:.3125rem;color:var(--message-primary-color);display:none;font-size:1.1875rem;height:1.5rem;justify-content:center;margin-right:-2.25rem;margin-top:-1rem;overflow:hidden;position:absolute;width:-moz-max-content;width:max-content;width:2rem}html.no-touch .audio .audio-to-text-button:active:after,html.no-touch .audio .audio-to-text-button:hover:after{background-color:var(--message-primary-color);border-radius:inherit;bottom:0;content:" ";left:0;opacity:.08;position:absolute;right:0;top:0}.audio .audio-to-text-button .loader{height:100%;left:0;opacity:0;position:absolute;top:0;transition:opacity .2s;width:100%}.audio .audio-to-text-button .loader.active{opacity:1}.audio .audio-to-text-button .loader .audio-transcribe-outline{height:100%;width:100%}@keyframes loading{0%{stroke-dashoffset:100}to{stroke-dashoffset:0}}.audio .audio-to-text-button .loader .audio-transcribe-outline-rect{animation:loading 1s ease-in-out infinite}.audio .part{height:112px!important;width:112px!important}@media only screen and (max-width:600px){.audio .part{height:100px!important;width:100px!important}}.audio-title{color:var(--primary-text-color);font-size:1rem}.audio-description:not(:empty):before{content:" • "}.audio-subtitle,.audio-time{color:var(--secondary-text-color);display:flex;font-size:.875rem}@media only screen and (max-width:600px){.audio-subtitle,.audio-time{font-size:.75rem}}.audio-subtitle,.audio-time,.audio-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.audio-subtitle{align-items:center}.audio-subtitle .audio-time{flex:0 0 auto;margin-right:.25rem}.audio-subtitle,.audio-title{margin-left:-1px}.audio-title,.audio:not(.audio-show-progress) .audio-subtitle{max-width:100%}.audio.is-voice .audio-time{align-items:center;line-height:1;margin-left:-1px;margin-top:7px}[dir=ltr] .audio.is-voice .progress-line{margin-left:0}[dir=rtl] .audio.is-voice .progress-line{margin-right:0}.audio.is-voice .progress-line{margin-top:4px;min-width:11.25rem}.audio.is-voice .progress-line__filled:after{opacity:0}@media only screen and (max-width:600px){.audio.is-voice .audio-time{margin-top:.3125rem}.audio.is-voice .audio-waveform-container{height:16px;margin-top:0}}.audio.is-voice.is-unread .audio-time:after{background-color:var(--primary-color);border-radius:50%;content:" ";height:.5rem;margin-left:.375rem;width:.5rem}.audio.is-voice.is-unread:not(.is-out) .audio-toggle:not(.playing)+.audio-waveform-container .audio-waveform-background .audio-waveform-bar{opacity:1}.audio .progress-line{--height:2px;--border-radius:4px;--thumb-size:.75rem;flex:1 1 auto;margin:0 6px 0 5px}.audio-with-thumb .audio-play-icon{background-color:transparent;opacity:1;z-index:1}body.animation-level-2 .audio-with-thumb .audio-play-icon{transition:transform .25s ease-in-out,background-color .2s ease-in-out,opacity .2s ease-in-out}.audio-with-thumb .audio-play-icon .part{background-color:#fff!important}.audio-with-thumb .audio-play-icon:not(:last-child){background-color:rgba(0,0,0,.3)}.audio-with-thumb .media-photo{border-radius:inherit;height:inherit;-o-object-fit:cover;object-fit:cover;width:inherit}.audio-with-thumb:not(.corner-download) .audio-download{background-color:rgba(0,0,0,.3)}.audio-with-thumb:not(.corner-download).downloading .audio-play-icon{opacity:0}.quiz-hint{align-items:center;display:flex;justify-content:center;left:0;position:absolute;top:8px;transform:translate3d(0,calc(-100% - 10px),0);transition:transform .2s ease;width:100%}body.animation-level-0 .quiz-hint{transition:none}.quiz-hint.active{transform:translateZ(0)}[dir=ltr] .quiz-hint .container{text-align:left}[dir=rtl] .quiz-hint .container{text-align:right}.quiz-hint .container{align-items:center;background:rgba(0,0,0,.7);border-radius:12px;color:#fff;display:flex;flex-wrap:wrap;font-size:15px;line-height:1.5;max-width:400px;min-height:48px;overflow:hidden;padding:10px 18px 12px 50px;position:relative;text-align:center;width:auto}@media only screen and (max-width:600px){.quiz-hint .container{font-size:14px;margin:0 10px;padding:10px 18px 12px 54px}}.quiz-hint .container .text{word-break:break-word}.quiz-hint .container:before{content:"";font-size:1.5rem;left:15px;position:absolute;top:12px}.quiz-hint .container a{border-bottom:1px solid #fff;color:#fff}.peer-typing{margin-right:4px}.peer-typing-container{--color:var(--primary-color);color:var(--color)}.peer-typing-flex{align-items:center;display:flex}.peer-typing:not(.peer-typing-text):not(.peer-typing-choosing-sticker){display:inline-block;transform:translateY(-1px);vertical-align:middle}.peer-typing-text-dot{animation-duration:.6s;animation-iteration-count:infinite;animation-name:dotMiddle;animation-timing-function:linear;background-color:var(--color);border-radius:50%;display:inline-block;height:6px;margin:0 .5px;vertical-align:middle;width:6px}.peer-typing-text-dot:first-child{animation-name:dotFirst}.peer-typing-text-dot:last-child{animation-name:dotLast}.peer-typing-upload{border-radius:2px;height:5px;margin-right:.375rem;overflow:hidden;position:relative;width:13px}.peer-typing-upload:after,.peer-typing-upload:before{background-color:var(--color);border-radius:inherit;bottom:0;content:" ";display:block;left:0;position:absolute;right:0;top:0}.peer-typing-upload:before{opacity:.3}.peer-typing-upload:after{animation:upload 1s ease-in-out infinite}.peer-typing-record{margin-right:.375rem}.peer-typing-record:before{animation:recordBlink 1.25s infinite;background-color:var(--color);border-radius:50%;content:" ";display:block;height:6px;width:6px}.peer-typing-choosing-sticker{align-items:center;display:flex;flex:0 0 auto;height:16px;margin-right:.375rem}.peer-typing-choosing-sticker-eye{animation:eye 1.8s ease-in-out infinite;border:1px solid var(--color);border-radius:50%;display:inline-block;height:14px;margin:0 .0625rem;position:relative;vertical-align:middle;width:8px}.peer-typing-choosing-sticker-eye:before{animation:eye-move 1.8s ease-in-out infinite;background-color:var(--color);border-radius:50%;content:" ";display:block;height:.25rem;position:absolute;top:50%;transform:translate(-1px,-50%);width:.25rem}@keyframes dotFirst{0%{opacity:.8;transform:scale(.6666666667)}50%{opacity:.8;transform:scale(.6666666667)}75%{opacity:1;transform:scale(1)}to{opacity:.8;transform:scale(.6666666667)}}@keyframes dotMiddle{0%{opacity:.9;transform:scale(.8333333333)}12.5%{opacity:.8;transform:scale(.6666666667)}62.5%{opacity:.8;transform:scale(.6666666667)}87.5%{opacity:1;transform:scale(1)}to{opacity:.9;transform:scale(.8333333333)}}@keyframes dotLast{0%{opacity:1;transform:scale(1)}25%{opacity:.8;transform:scale(.6666666667)}75%{opacity:.8;transform:scale(.6666666667)}to{opacity:1;transform:scale(1)}}@keyframes upload{0%{transform:translateX(-13px)}to{transform:translate(13px)}}@keyframes eye{0%{transform:scale(1.1) translateX(-.75px)}12.5%{transform:scale(1) translateX(0)}25%{transform:scale(1.1) translateX(.375px)}50%{transform:scale(1.1) translateX(.75px)}62.5%{transform:scale(1) translateX(0)}75%{transform:scale(1.1) translateX(-.375px)}to{transform:scale(1.1) translateX(-.75px)}}@keyframes eye-move{0%{transform:translate(-1px,-50%)}25%{transform:translate(3px,-50%)}50%{transform:translate(3px,-50%)}75%{transform:translate(-1px,-50%)}to{transform:translate(-1px,-50%)}}poll-element{color:var(--primary-text-color);display:block;margin-top:-1px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:330px}@media only screen and (max-width:600px){poll-element{max-width:100%;width:240px}}poll-element:not(.is-closed):not(.is-voted) .poll-answer{cursor:pointer}poll-element .poll-title{font-weight:var(--font-weight-bold)}@media only screen and (max-width:600px){poll-element .poll-title{max-width:88%;white-space:normal}}poll-element .poll-desc{align-items:center;color:var(--secondary-text-color);display:flex;font-size:14px;margin-bottom:5px;margin-top:2px;position:relative}poll-element .poll-type{margin-top:2px}poll-element .poll-hint{color:var(--primary-color);cursor:pointer;font-size:1.5rem;position:absolute;right:2px;top:-4px;transform:scale(1)}body.animation-level-2 poll-element .poll-hint{transition:transform .2s ease}poll-element .poll-hint.active{pointer-events:none;transform:scale(0)}poll-element .poll-send-vote{cursor:default}poll-element .poll-avatars{cursor:pointer;display:flex;margin-left:18px}poll-element .poll-avatar{border:1px solid var(--border-color);cursor:pointer;height:18px;width:18px}poll-element .poll-answer{display:flex;margin-top:1px;padding-bottom:20px;padding-left:28px;position:relative}poll-element .poll-answer-text{margin-left:12px;margin-top:6px}[dir=ltr] poll-element .poll-answer-percents{text-align:right}[dir=rtl] poll-element .poll-answer-percents{text-align:left}poll-element .poll-answer-percents{font-size:14px;font-weight:var(--font-weight-bold);left:0;margin-left:-9px;margin-top:7px;opacity:0;position:absolute;top:0;width:40px}poll-element .poll-answer-selected{align-items:center;background:var(--primary-color);border-radius:50%;bottom:1px;color:#fff;display:flex;font-size:.75rem;font-weight:var(--font-weight-bold);height:16px;justify-content:center;left:15px;opacity:1;position:absolute;width:16px}poll-element .poll-answer-selected:before{content:"";font-weight:var(--font-weight-bold)}html.no-touch poll-element .poll-answer:active .animation-ring,html.no-touch poll-element .poll-answer:hover .animation-ring{transform:scale(1);visibility:visible}poll-element .poll-answer.is-voting .progress-ring__circle{stroke-dashoffset:-19.792;animation:pollAnswerRotate .65s linear infinite}poll-element .poll-answer:not(.is-correct):not(.is-chosen) .poll-answer-selected{opacity:0}poll-element .poll-answer.is-chosing .circle-hover .poll-answer-selected{opacity:1}poll-element .poll-answer.is-chosing~.poll-footer .poll-send-vote{cursor:pointer}poll-element .poll-votes-count{color:var(--secondary-text-color);font-size:.875rem;margin-top:-.5rem}poll-element .poll-line{stroke-dashoffset:0;stroke-dasharray:0,485.9;bottom:2px;height:35px;left:10px;position:absolute}poll-element .poll-line use{stroke-width:4px;stroke-linecap:round;stroke:var(--primary-color);fill:none}poll-element .poll-footer{height:2.875rem;margin:-.375rem -.5rem -.375rem -.625rem;text-align:center}poll-element .poll-footer-button{border-top-left-radius:0!important;border-top-right-radius:0!important;color:var(--primary-color);cursor:pointer;font-size:1rem;font-weight:var(--font-weight-bold);height:100%;overflow:hidden;width:100%}poll-element .poll-footer,poll-element .poll-footer-button{align-items:center;display:flex;justify-content:center}poll-element .poll-quiz-timer{stroke:#a3adb6;fill:none;stroke-linecap:round;height:32px;position:absolute;right:-2px;top:-7px;transform:rotate(270deg);width:32px}poll-element .poll-time{color:#a3adb6;font-size:12px;font-weight:var(--font-weight-bold);position:absolute;right:27px}poll-element.is-quiz .poll-answer.is-chosen:not(.is-correct) use{stroke:var(--danger-color)}poll-element.is-quiz .poll-answer.is-chosen:not(.is-correct) .poll-answer-selected{background:var(--danger-color)}poll-element.is-quiz .poll-answer.is-chosen:not(.is-correct) .poll-answer-selected:before{content:"";font-size:12px}poll-element .circle-hover{align-items:center;display:flex;height:34px;justify-content:center;left:-1px;position:absolute;top:-1px;transform:scale(1);width:34px}poll-element .circle-hover .poll-answer-selected{animation:none;display:flex!important;font-size:20px;height:20px;left:50%;line-height:16px;opacity:0;top:50%;transform:translate(-50%,-50%);width:20px}body.animation-level-2 poll-element .circle-hover .poll-answer-selected{transition:opacity .2s ease}poll-element .animation-ring{background-color:var(--light-secondary-text-color);border-radius:50%;display:block;height:34px;transform:scale(.1);visibility:hidden;width:34px}body.animation-level-2 poll-element .animation-ring{transition:transform .12s ease}poll-element .progress-ring{height:26px;left:auto;top:auto;width:26px}poll-element .progress-ring__circle{stroke-dasharray:56.5487,56.5487;stroke-dashoffset:0;stroke-opacity:1;stroke-width:2;stroke:var(--poll-circle-color);fill:transparent;transform:rotate(-90deg);transform-origin:center}poll-element.is-voted .animation-ring,poll-element.is-voted .circle-hover{transform:scale(0)}poll-element.is-voted .poll-answer-percents{opacity:1}poll-element.is-retracting .circle-hover{transition-delay:.24s}poll-element.is-retracting .animation-ring{transition-delay:.22s}poll-element.animating .poll-line{transition:stroke-dashoffset .34s linear,stroke-dasharray .34s linear}poll-element.animating .poll-answer-selected{transition-delay:.24s;transition:opacity forwards .1s ease}poll-element.animating.is-retracting .poll-answer-selected{transition-delay:0s}poll-element.animating .poll-answer-percents{transition:opacity .34s}poll-element.animating .progress-ring__circle{transition:stroke-dashoffset .15s}poll-element.animating .circle-hover{transition:transform .1s}poll-element.is-multiple .poll-desc{margin-bottom:.5rem}poll-element .c-ripple__circle{background-color:var(--light-primary-color)}@keyframes pollAnswerRotate{to{transform:rotate(270deg)}}.transition>.transition-item{animation-fill-mode:forwards!important;height:100%;left:0;position:absolute;top:0;width:100%}.transition>.transition-item:not(.active):not(.from):not(.to){display:none!important}.transition.zoom-fade>.from{opacity:1;transform:scale(1);transform-origin:center}.transition.zoom-fade>.to{opacity:0;transform-origin:center}.transition.zoom-fade.animating>.from{animation:fade-out-opacity .15s ease}.transition.zoom-fade.animating>.to{animation:fade-in-opacity .15s ease,zoom-fade-in-move .15s ease}.transition.zoom-fade.backwards>.from{transform:scale(1)}.transition.zoom-fade.backwards>.to{transform:scale(.95)}.transition.zoom-fade.backwards.animating>.from{animation:fade-in-backwards-opacity .1s ease,zoom-fade-in-backwards-move .15s ease}.transition.zoom-fade.backwards.animating>.to{animation:fade-out-backwards-opacity .15s ease,zoom-fade-out-backwards-move .15s ease}.transition.slide-fade{--easeOutSine:cubic-bezier(.39,.575,.565,1);--easeInSine:cubic-bezier(.47,0,.745,.715);position:relative}.transition.slide-fade>.from{opacity:1;transform:translateX(0);transform-origin:left center}.transition.slide-fade>.to{opacity:0;transform:translateX(1.5rem);transform-origin:left center}.transition.slide-fade.animating>.from{animation:fade-out-opacity .4s ease-out,slide-fade-out-move .4s}.transition.slide-fade.animating>.to{animation:fade-in-opacity .4s var(--easeInSine),slide-fade-in-move .4s}.transition.slide-fade.backwards>.from{opacity:1;transform:translateX(0)}.transition.slide-fade.backwards>.to{opacity:0;transform:translateX(-1.5rem)}.transition.slide-fade.backwards.animating>.from{animation:fade-in-backwards-opacity .4s ease-out,slide-fade-in-backwards-move .4s}.transition.slide-fade.backwards.animating>.to{animation:fade-out-backwards-opacity .4s var(--easeOutSine),slide-fade-out-backwards-move .4s}@keyframes zoom-fade-in-move{0%{transform:scale(1.1)}to{transform:scale(1)}}@keyframes zoom-fade-in-backwards-move{0%{transform:scale(1)}to{transform:scale(1.1)}}@keyframes zoom-fade-out-backwards-move{0%{transform:scale(.95)}to{transform:scale(1)}}@keyframes slide-fade-in-move{0%{transform:translateX(1.5rem)}to{transform:translateX(0)}}@keyframes slide-fade-out-move{0%{transform:translateX(0)}to{transform:translateX(-1.5rem)}}@keyframes slide-fade-in-backwards-move{0%{transform:translateX(0)}to{transform:translateX(1.5rem)}}@keyframes slide-fade-out-backwards-move{0%{transform:translateX(-1.5rem)}to{transform:translateX(0)}}.row{display:flex;flex-direction:column;justify-content:center;min-height:3.5rem;padding:.4375rem 1rem;position:relative}.row.no-subtitle,.row.row-small{min-height:3rem;padding-bottom:.1875rem;padding-top:.1875rem}body.animation-level-2 .row{transition:opacity var(--transition-standard-in)}.row.is-disabled{opacity:var(--disabled-opacity);pointer-events:none!important}.row.no-wrap{padding-bottom:0!important;padding-top:0!important}.row a{pointer-events:all;position:relative;z-index:1}.row-title-row,.row>.row-title{order:0}[dir=ltr] .row-big{padding-left:1rem;padding-right:.75rem}[dir=rtl] .row-big{padding-left:.75rem;padding-right:1rem}.row-big{min-height:4.5rem;padding-bottom:.5625rem;padding-top:.5625rem}.row-row{align-items:center;display:flex;justify-content:space-between}.row-row .row-subtitle,.row-row .row-title{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row-subtitle-row,.row>.row-subtitle{order:1}.row-title{color:var(--primary-text-color);font-size:var(--font-size);line-height:var(--line-height);overflow:hidden;text-overflow:ellipsis;word-break:break-word}.row-title-right-secondary{color:var(--secondary-text-color)}.row-title-row.with-delimiter .row-title:first-child{border-right:1px solid var(--border-color)}[dir=ltr] .row-subtitle-right,[dir=ltr] .row-title-right{margin-left:1rem}[dir=rtl] .row-subtitle-right,[dir=rtl] .row-title-right{margin-right:1rem}.row-subtitle-right,.row-title-right{flex:0 0 auto!important}.row-midtitle,.row-subtitle,.row-title{pointer-events:none;position:relative}.row-midtitle{font-size:var(--font-size-14);margin-top:.125rem;order:1}[dir=ltr] .row-with-padding{padding-left:4.5rem}[dir=rtl] .row-with-padding{padding-right:4.5rem}@media only screen and (max-width:600px){[dir=ltr] .row-with-padding{padding-left:4rem}[dir=rtl] .row-with-padding{padding-right:4rem}}[dir=ltr] .row-with-padding.tgico:before{left:1rem}[dir=rtl] .row-with-padding.tgico:before{right:1rem}.row-with-padding.tgico:before{color:var(--secondary-text-color);font-size:1.5rem;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);z-index:1}.row-with-padding:not(.row-with-icon):before{display:none}.row-clickable{cursor:pointer;overflow:hidden}@media only screen and (min-width:601px){.row-clickable{border-radius:10px}}[dir=ltr] .row-sortable .row-subtitle,[dir=ltr] .row-sortable .row-title{padding-right:2.5rem}[dir=rtl] .row-sortable .row-subtitle,[dir=rtl] .row-sortable .row-title{padding-left:2.5rem}[dir=ltr] .row-sortable-icon{right:.75rem}[dir=rtl] .row-sortable-icon{left:.75rem}.row-sortable-icon{color:var(--secondary-text-color);font-size:1.5rem;height:1.5rem;line-height:1;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%)}.row-sortable.cant-sort .row-sortable-icon{display:none}.row-sortable.is-dragging{background-color:var(--surface-color)!important;z-index:1}html.no-touch .row-sortable.is-dragging:active,html.no-touch .row-sortable.is-dragging:hover{background-color:var(--light-filled-secondary-text-color)!important}html.no-touch .row-sortable:active .row-sortable-icon,html.no-touch .row-sortable:hover .row-sortable-icon{opacity:1}body.animation-level-2 .is-reordering .row-sortable{transition:transform var(--transition-standard-in)}[dir=ltr] .row .checkbox-field,[dir=ltr] .row .radio-field-main{padding-left:3.375rem}[dir=rtl] .row .checkbox-field,[dir=rtl] .row .radio-field-main{padding-right:3.375rem}[dir=ltr] .row .checkbox-field,[dir=ltr] .row .radio-field-main{margin-left:-3.375rem}[dir=rtl] .row .checkbox-field,[dir=rtl] .row .radio-field-main{margin-right:-3.375rem}.row .checkbox-field,.row .radio-field,.row .radio-field:not(.radio-field-right) .radio-field-main{position:static}.row .checkbox-field,.row .radio-field{--offset-left:1rem}.row .radio-field{margin-bottom:0;margin-top:0}[dir=ltr] .row .checkbox-field{margin-right:0}[dir=rtl] .row .checkbox-field{margin-left:0}.row .checkbox-field{height:auto;margin-bottom:0;margin-top:0}[dir=ltr] .row .checkbox-field .checkbox-caption{padding-left:0}[dir=rtl] .row .checkbox-field .checkbox-caption{padding-right:0}.row .checkbox-field .checkbox-caption{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row .checkbox-field-toggle{margin-left:.125rem;margin-right:.125rem;padding:0}.row .checkbox-field-absolute{left:0;margin:0!important;padding:0!important;position:absolute}.row .checkbox-field-round .checkbox-box-border{z-index:auto}.row-subtitle{color:var(--secondary-text-color)!important;font-size:var(--font-size-14)!important;line-height:var(--line-height-14);margin-top:.1875rem}.row-subtitle:empty{display:none}[dir=ltr] .row-media{left:.75rem}[dir=rtl] .row-media{right:.75rem}.row-media{align-items:center;display:flex;height:2.25rem!important;justify-content:center;margin:0!important;pointer-events:none;position:absolute!important;width:2.25rem!important}[dir=ltr] .row-media-small{left:.75rem!important}[dir=rtl] .row-media-small{right:.75rem!important}.row-media-small{height:2rem!important;width:2rem!important}[dir=ltr] .row-media-abitbigger{left:.75rem!important}[dir=rtl] .row-media-abitbigger{right:.75rem!important}.row-media-abitbigger{height:2.625rem!important;width:2.625rem!important}[dir=ltr] .row-media-big{left:.5rem!important}[dir=rtl] .row-media-big{right:.5rem!important}.row-media-big{height:3rem!important;width:3rem!important}[dir=ltr] .row-media-bigger{left:.5625rem!important}[dir=rtl] .row-media-bigger{right:.5625rem!important}.row-media-bigger{height:3.375rem!important;width:3.375rem!important}.row.menu-open{background-color:var(--light-secondary-text-color)}[dir=ltr] .row>.btn-primary{right:1rem}[dir=rtl] .row>.btn-primary{left:1rem}.row>.btn-primary{border-radius:.9375rem;font-size:.9375rem;height:1.875rem;line-height:1.875rem;margin:0;padding-left:.75rem;padding-right:.75rem;position:absolute;top:50%;transform:translateY(-50%);width:auto}body.animation-level-2 .row>.btn-primary{transition:width .2s,background-color .2s,color .2s}.row>.btn-primary.active{background-color:var(--light-primary-color)!important;color:var(--primary-color)}.row.accordion-toggler .checkbox-field-toggle{pointer-events:all!important}.color-picker{margin:1.1875rem auto .25rem;max-width:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:380px}@media only screen and (max-width:600px){.color-picker{padding:0 .75rem}}.color-picker-box{height:198px;width:100%}.color-picker-box,.color-picker-color-slider,.color-picker-dragger{overflow:visible!important}.color-picker-sliders{margin:1rem 0 1.125rem}.color-picker-dragger{cursor:grab}.color-picker-inputs{display:flex}.color-picker-inputs .input-field{flex:1 1 auto}.color-picker-inputs .input-field:not(:first-child){margin-left:1.25rem}.reply-keyboard{background:var(--surface-color);border-radius:10px;bottom:calc(100% + .625rem);box-shadow:0 5px 10px 5px rgba(16,35,47,.14);display:flex!important;flex-direction:column;max-height:26.25rem;max-width:100%;opacity:0;overflow:hidden;padding:0!important;position:absolute!important;right:0;transform:scale(0);transform-origin:bottom right;transition:transform var(--esg-transition),opacity var(--esg-transition);width:26.25rem!important;z-index:3}@media only screen and (max-height:569px),only screen and (max-width:600px){.reply-keyboard{bottom:calc(100% + .5rem)}}.reply-keyboard.active{opacity:1;transform:scale(1)}body.animation-level-0 .reply-keyboard{transition:none}.reply-keyboard-row{display:flex}.reply-keyboard-row+.reply-keyboard-row{margin-top:.3125rem}.reply-keyboard-button{background-color:transparent;border:2px solid var(--primary-color);border-radius:.375rem;color:var(--primary-color);font-size:.9375rem;font-weight:var(--font-weight-bold);height:3rem;text-align:center;width:100%}body.animation-level-2 .reply-keyboard-button{transition:color .15s,background-color .15s}html.no-touch .reply-keyboard-button:active,html.no-touch .reply-keyboard-button:hover{background-color:var(--primary-color);color:#fff}.reply-keyboard-button+.reply-keyboard-button{margin-left:.3125rem}.reply-keyboard .scrollable-y{bottom:auto;height:auto;left:auto;max-height:100%;padding:.625rem!important;position:relative;right:auto;top:auto}.peoplenearby-container div.text.nearby-description{color:var(--primary-text-color);margin-top:15px;text-align:center}.peoplenearby-container div.text.nearby-error{color:var(--gc-secondary-text-color);margin-top:10px;text-align:center}.peoplenearby-container .locating-animation-container{align-items:center;display:flex;justify-content:center;min-height:140px;width:100%}.peoplenearby-container .locating-animation-container .tgico.tgico-location{align-items:center;background:var(--avatar-color-bottom);border-radius:50%;display:flex;height:140px;justify-content:center;padding:50px;width:140px}.peoplenearby-container .locating-animation-container .tgico.tgico-location:before{color:#fff;font-size:58px}.peoplenearby-container .locating-animation-container .locating-animation-waves{position:fixed}.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-1,.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-3{animation:waves-animation 3s infinite;border:5px solid #fff;border-radius:50%;-webkit-clip-path:polygon(72% 0,100% 0,100% 100%,72% 100%);clip-path:polygon(72% 0,100% 0,100% 100%,72% 100%);height:50px;margin-left:36px;width:50px}.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-2,.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-4{animation:waves-animation 5s infinite;animation-delay:2s;border:5px solid #fff;border-radius:50%;-webkit-clip-path:polygon(72% 0,100% 0,100% 100%,72% 100%);clip-path:polygon(72% 0,100% 0,100% 100%,72% 100%);height:71px;margin-left:51px;margin-top:1px;width:66px}.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-3{margin-left:-36px!important;transform:rotateY(180deg)}.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-4{margin-left:-51px!important;transform:rotateY(180deg)}@keyframes waves-animation{0%{opacity:1}50%{opacity:0}to{opacity:1}}.spoiler{--anim:.4s ease;background-color:var(--spoiler-background-color)}.spoiler-text{opacity:0}.spoilers-container .custom-emoji-canvas{z-index:-1}.spoilers-container.is-spoiler-visible.animating .spoiler{transition:background-color var(--anim)}.spoilers-container.is-spoiler-visible.animating .spoiler-text{transition:opacity var(--anim)}.spoilers-container.is-spoiler-visible:not(.backwards) .spoiler{background-color:transparent}.spoilers-container.is-spoiler-visible:not(.backwards) .spoiler-text{opacity:1}.spoilers-container:not(.is-spoiler-visible) .spoiler{cursor:pointer}.spoilers-container:not(.is-spoiler-visible) .spoiler-text{pointer-events:none}.emoji-animation,.emoji-animation-container{pointer-events:none;position:absolute}.emoji-animation-container{bottom:0;left:0;overflow:hidden;right:0;top:0;z-index:3}.reactions-block{display:flex;flex-wrap:wrap;-webkit-user-select:none;-moz-user-select:none;user-select:none}.reactions-block.has-no-reactions{display:inline;display:initial}.reactions-inline{display:inline-flex}.reactions-inline:not(:empty){margin-right:.125rem}.reaction,.reaction-sticker{align-items:center;display:flex}.reaction-sticker{--custom-emoji-size:var(--reaction-size);height:var(--reaction-size);justify-content:center;position:relative;width:var(--reaction-size)}.reaction-sticker-activate{bottom:var(--reaction-offset);left:var(--reaction-offset);position:absolute;right:var(--reaction-offset);top:var(--reaction-offset);z-index:1}.reaction-sticker.has-animation>.media-sticker{opacity:0}.reaction-sticker:not(.is-static):not(.is-custom) .media-sticker{--size:calc(var(--reaction-size) + var(--reaction-offset)*-2);bottom:auto;height:var(--size)!important;left:auto;max-height:var(--size);max-width:var(--size);right:auto;top:auto;width:var(--size)!important}.reaction-sticker.is-custom{border-radius:.3125rem}.reaction-sticker.is-custom .custom-emoji,.reaction-sticker.is-custom .media-sticker{border-radius:inherit}.reaction-sticker.is-custom .custom-emoji-canvas{z-index:auto}.reaction-inline{--reaction-size:.875rem;--reaction-offset:-.4375rem;min-height:var(--reaction-size);min-width:var(--reaction-size)}.reaction-inline .reaction-counter{font-size:inherit!important;margin-right:.0625rem!important;order:-1}.reaction-block{--additional-height:.5rem;--margin:.375rem;--reaction-size:1.375rem;--reaction-offset:-.5625rem;--background-color:var(--message-highlightning-color);--chosen-background-color:var(--message-primary-color);--counter-color:#fff;--reaction-total-size:calc(var(--reaction-size) + var(--additional-height));background-color:var(--background-color);border-radius:var(--reaction-total-size);color:var(--counter-color);cursor:pointer;height:var(--reaction-total-size);margin-right:var(--margin);margin-top:var(--margin);padding:0 .5rem;position:relative}html.no-touch .reaction-block:active:after,html.no-touch .reaction-block:hover:after{background-color:var(--chosen-background-color);border-radius:inherit;bottom:0;content:" ";left:0;opacity:.08;position:absolute;right:0;top:0}.reaction-block .reaction-counter,.reaction-block .reaction-sticker{z-index:1}.reaction-block:last-child{margin-right:0}.reaction-block:before{background-color:var(--chosen-background-color);border-radius:inherit;bottom:0;content:" ";left:0;opacity:0;position:absolute;right:0;top:0;transform:scale(0)}.reaction-block.is-chosen:not(.backwards):before{opacity:1;transform:scale(1)}.reaction-block.is-chosen:not(.backwards) .stacked-avatars{--border-color:var(--chosen-background-color)}.reaction-block.is-chosen.animating:before{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.reaction-block.is-chosen.animating .reaction-counter{transition:color var(--transition-standard-in)}.reaction-block.is-chosen.animating .stacked-avatars-avatar-container{transition:border-color var(--transition-standard-in)}.reaction-block .stacked-avatars{--border-color:transparent;--border-size:.125rem;--margin-right:-.875rem;margin-left:.1875rem}.reaction-block .reaction-counter{font-size:.9375rem!important;font-weight:var(--font-weight-bold);line-height:1.125rem;margin:0 .0625rem 0 .375rem;position:relative}.stacked-avatars{--border-color:var(--surface-color);--border-size:1px;--margin-right:-.3125rem;--avatar-size:1rem;--avatar-total-size:calc(var(--avatar-size) + var(--border-size)*2);display:flex;flex-direction:row-reverse}.stacked-avatars-avatar{height:var(--avatar-size);width:var(--avatar-size);z-index:0}.stacked-avatars-avatar-container{align-items:center;border:var(--border-size) solid var(--border-color);border-radius:50%;display:flex;height:var(--avatar-total-size);justify-content:center;position:relative;width:var(--avatar-total-size)}.stacked-avatars-avatar-container:not(:first-child){margin-right:var(--margin-right)}.sticker-viewer{align-items:center;bottom:0;display:flex;justify-content:center;left:0;pointer-events:none;position:fixed;right:0;top:0;z-index:4}.sticker-viewer:before{background-color:rgba(0,0,0,.6);bottom:0;content:" ";left:0;opacity:0;position:absolute;right:0;top:0}body.animation-level-2 .sticker-viewer:before{transition:opacity var(--sticker-viewer-open-transition-out)}.sticker-viewer.is-visible:not(.backwards):before{opacity:1}body.animation-level-2 .sticker-viewer.is-visible:not(.backwards):before{transition:opacity var(--sticker-viewer-open-transition-in)}.sticker-viewer.is-visible:not(.backwards) .sticker-viewer-transformer:not(.is-switching){transform:translateX(var(--translateX)) scale(1)!important}body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .sticker-viewer-transformer:not(.is-switching){transition:transform var(--sticker-viewer-open-transition-in)}.sticker-viewer.is-visible:not(.backwards) .emoji-animation,.sticker-viewer.is-visible:not(.backwards) .sticker-viewer-emoji,.sticker-viewer.is-visible:not(.backwards) .sticker-viewer-sticker{opacity:1}body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .emoji-animation,body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .sticker-viewer-emoji,body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .sticker-viewer-sticker{transition:opacity var(--sticker-viewer-open-transition-in)}body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .sticker-viewer-sticker:not(.is-overflow){transition:opacity 0s}.sticker-viewer-transformer{--translateX:0;align-items:center;display:flex;height:360px;justify-content:center;position:absolute;width:360px}.sticker-viewer-transformer.has-effect{height:280px;width:280px}.sticker-viewer-transformer.has-effect .sticker-viewer-emoji{top:-5.5rem}body.animation-level-2 .sticker-viewer-transformer{transition:transform var(--sticker-viewer-open-transition-out)}.sticker-viewer-transformer.is-switching{opacity:1!important;transform:translateX(var(--translateX)) scale(1)!important}body.animation-level-2 .sticker-viewer-transformer.is-switching{transition:transform var(--sticker-viewer-switch-transition),opacity var(--sticker-viewer-switch-transition)!important}.sticker-viewer-transformer.is-switching:not(.backwards){opacity:0!important;transform:scale(.4) translateX(var(--translateX))!important}.sticker-viewer-emoji{position:absolute;top:-3rem;transform:translateX(var(--translateX)) scale(2)}.sticker-viewer-sticker{position:absolute}.sticker-viewer .emoji-animation,.sticker-viewer-emoji,.sticker-viewer-sticker{opacity:0}body.animation-level-2 .sticker-viewer .emoji-animation,body.animation-level-2 .sticker-viewer-emoji,body.animation-level-2 .sticker-viewer-sticker{transition:opacity var(--sticker-viewer-open-transition-out)}.custom-emoji{display:inline;height:var(--custom-emoji-size)!important;min-height:var(--custom-emoji-size)!important;min-width:var(--custom-emoji-size)!important;position:relative;width:var(--custom-emoji-size)!important}.custom-emoji:before{content:" ";display:inline-block;height:inherit;min-height:inherit;min-width:inherit;width:inherit}.custom-emoji .media-sticker,.custom-emoji .rlottie{height:inherit!important;margin:0;max-height:inherit!important;max-width:inherit!important;pointer-events:none;text-indent:-9999px;width:inherit!important}.custom-emoji-canvas{height:100%;width:100%}.custom-emoji-canvas,.custom-emoji-renderer{bottom:0;left:0;position:absolute;right:0;top:0}.custom-emoji-renderer{pointer-events:none}.custom-emoji-placeholder{display:inline;height:var(--messages-custom-emoji-size);margin-top:-.125rem;vertical-align:middle;width:var(--messages-custom-emoji-size)}.usernames-username-icon{background-color:var(--secondary-color);border-radius:50%;color:#fff;font-size:1.25rem}.usernames-username-icon:before{content:""}.usernames-username.active .usernames-username-status{color:var(--primary-color)!important}.usernames-username.active .usernames-username-icon{background-color:var(--primary-color)}.topics-slider{bottom:0;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0}.topics-container{--offset:0;--width:100%;background-color:var(--surface-color)!important;width:var(--width)!important}.topics-container.is-floating{--offset:5.0625rem;--width:calc(var(--left-column-width) - var(--offset));border-left:1px solid var(--border-color);bottom:0;overflow:visible!important;overflow:initial!important;pointer-events:all;position:absolute;right:0;top:0;transform:translateX(var(--width));z-index:3}.topics-container.is-visible:not(.backwards){transform:translateX(0)}.topics-container.is-visible.animating{transition:transform var(--transition-standard-in)}.topics-container.is-visible.animating.backwards{transition:transform var(--transition-standard-out)}.topics-container .sidebar-header{padding:0 .75rem}.topics-container .sidebar-header__rows{flex:1 1 auto;overflow:hidden;padding-left:.5rem}.topics-container .sidebar-header__rows .sidebar-header__title{font-size:var(--font-size-16);line-height:var(--line-height-16);margin-bottom:.125rem;padding-left:0!important}.topics-container .sidebar-header__subtitle,.topics-container .sidebar-header__title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topics-container .sidebar-header__subtitle{color:var(--secondary-text-color);font-size:var(--font-size-14);line-height:var(--line-height-14)}.topics-container .chatlist-chat{min-height:4rem;padding-left:.75rem}.topic-name .topic-icon{margin-right:.25rem}.topic-name-button{--color:var(--primary-color);align-items:center;color:var(--color);cursor:pointer;display:flex;font-weight:var(--font-weight-bold);height:1.5rem;justify-content:center;max-width:100%;padding:0 .5rem;position:relative;text-decoration:none!important}.topic-name-button-container{align-items:flex-start;display:flex!important;justify-content:flex-start}.topic-name-button .peer-title,.topic-name-button .topic-name{position:relative}.topic-name-button:before{background-color:var(--color);border-radius:1.5rem;bottom:0;content:" ";left:0;opacity:.08;position:absolute;right:0;top:0}html.no-touch .topic-name-button:active:before,html.no-touch .topic-name-button:hover:before{opacity:.16}.topic-icon{--size:1.25rem;--custom-emoji-size:var(--size);display:inline-flex;font-size:calc(var(--size)/2);justify-content:center;line-height:1.875!important;position:relative;vertical-align:middle}.topic-icon-general{fill:var(--secondary-color);height:var(--size);width:var(--size)}.topic-icon-svg{height:inherit;position:absolute;width:inherit}.topic-icon-content{position:relative}.edit-topic-container .scrollable-y{display:flex;flex-direction:column}.edit-topic-icon{position:absolute}.edit-topic-icon .topic-icon{--size:4rem}.edit-topic-icon-container{align-items:center;cursor:pointer;display:flex;height:100px;justify-content:center;margin:0 auto;position:relative;width:100px}.edit-topic-emoticons-container{flex:1 1 auto}.edit-topic-emoticons-container .sidebar-left-section{height:100%;padding:0!important}.edit-topic-emoticons-container .emoji-padding{display:flex;flex-direction:column}.edit-topic-emoticons-container .super-emoji-topic-icon .topic-icon{--size:var(--esg-emoji-size);--custom-emoji-size:inherit;margin-left:calc((var(--custom-emoji-size) - var(--esg-emoji-size))/2)}.themes-container{align-items:center;display:flex;height:6.5rem;position:relative}@media only screen and (min-width:601px){.themes-container{margin:0 -.5rem;padding:0;width:calc(100% + 1rem)}}.themes-container:after,.themes-container:before{content:" ";display:block;flex:0 0 auto;height:.5rem;width:.5rem}.theme-container{border-radius:10px;cursor:pointer;display:flex;flex:0 0 auto;height:calc(100% - .5rem);justify-content:center;margin:0 .25rem;position:relative;width:4.5rem}.theme-container:before{border:2px solid var(--primary-color);border-radius:14px;bottom:-4px;content:" ";left:-4px;opacity:0;position:absolute;right:-4px;top:-4px;transform:scale(.86)}html.is-safari .theme-container:before{transform:none!important}body.animation-level-2 .theme-container:before{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.theme-container.active{pointer-events:none}.theme-container.active:before{opacity:1;transform:scale(1)}.theme-container .background-item{border-radius:inherit;height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.theme-emoticon{bottom:.5rem;height:1.75rem;pointer-events:none;position:absolute;width:1.75rem;z-index:1}html:not(.is-safari) .theme-emoticon{transform:scale(1);transform-origin:center bottom}body.animation-level-2 .theme-emoticon{transition:transform var(--transition-standard-in)}.theme-bubble{background-color:#fff;border-radius:1.75rem;height:1.25rem;pointer-events:none;position:absolute;width:2.5rem}.theme-bubble.is-out{background-color:var(--light-filled-message-out-primary-color);right:.375rem;top:.5rem}.theme-bubble.is-in{background-color:var(--message-background-color);left:.375rem;top:2rem}.popup{background-color:rgba(0,0,0,.3);bottom:0;box-shadow:none;display:flex;left:0;margin:0;max-width:none;opacity:0;overflow:auto;padding:1.875rem;position:fixed!important;right:0;top:0;transition-delay:0s,var(--popup-transition-time);transition-duration:var(--popup-transition-time),0s;transition-property:opacity,visibility;transition-timing-function:var(--popup-transition-function);-webkit-user-select:none;-moz-user-select:none;user-select:none;visibility:hidden;z-index:3}.popup.no-overlay{background-color:transparent;overflow:visible;padding:0}body.animation-level-0 .popup{transition:none}.popup.active{opacity:1;transition-delay:0s,0s;visibility:visible;z-index:4}.popup.active .popup-container,.popup.hiding .popup-container{transform:translate3d(var(--translateX),0,0)}[dir=ltr] .popup-title{padding-left:1.5rem;padding-right:1rem}[dir=rtl] .popup-title{padding-left:1rem;padding-right:1.5rem}.popup-title{flex:1;font-size:1.25rem;font-weight:var(--font-weight-bold);line-height:1;margin:0}.popup-title:first-child{padding-left:0}.popup-container{--translateX:0;-webkit-backface-visibility:hidden;backface-visibility:hidden;background-color:var(--surface-color);border-radius:10px;display:flex;flex-direction:column;margin:auto;overflow:hidden;padding:1rem;position:relative;transform:translate3d(var(--translateX),3rem,0);transition:transform var(--popup-transition-time) var(--popup-transition-function)}body.animation-level-0 .popup-container{transition:none}.popup-description .peer-title{font-weight:var(--font-weight-bold)}.popup-centerer{margin:auto}.popup-close{flex:0 0 auto;justify-self:center;z-index:3}.popup-header{align-items:center;display:flex;flex:0 0 auto;margin-bottom:2rem;position:relative}.popup-body{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.popup-body .scrollable{position:relative}.popup-body .scrollable-y-bordered:last-child{border-bottom:none}.popup-buttons{align-items:center;display:flex;flex-direction:row-reverse;height:3rem;justify-content:flex-start;padding:0 .5rem}.popup-buttons .btn{border-radius:10px;font-weight:var(--font-weight-bold);height:2.5rem;max-width:100%;overflow:hidden;padding:0 1rem;position:relative;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}[dir=ltr] .popup-buttons .btn+.btn{margin-right:.625rem}[dir=rtl] .popup-buttons .btn+.btn{margin-left:.625rem}.popup-avatar .popup-container{max-width:600px;padding:15px 16px 16px 24px}.popup-avatar .popup-container>button{bottom:20px;position:absolute;right:20px}.popup-avatar .popup-close{font-size:1.5rem;margin-top:4px}.popup-avatar .popup-header{margin-bottom:1px}[dir=ltr] .popup-avatar h6{text-align:left}[dir=rtl] .popup-avatar h6{text-align:right}.popup-avatar h6{font-size:1.25rem;margin:0 0 0 2rem}.popup-avatar .crop{border-radius:8px;max-height:100%;max-width:100%;padding:24px 54px 46px 46px}.popup-avatar .crop>img{display:none}.popup-avatar .crop img{border-radius:8px}.popup-new-media .popup-container{max-height:100%;max-width:420px;padding:12px 20px 32.5px;width:420px}.popup-new-media .popup-container img,.popup-new-media .popup-container video{border-radius:inherit}.popup-new-media .popup-header{align-items:center;flex:0 0 auto;flex-wrap:wrap;justify-content:space-between;margin-bottom:9px;padding:12px 20px 15px;position:relative}.popup-new-media .popup-header .btn-primary{border-radius:10px;font-size:var(--font-size-14);height:2.25rem;line-height:2.25rem;padding:0 1.375rem;text-transform:uppercase;width:auto}.popup-new-media .popup-close{margin:-1px 0 0 -4px}.popup-new-media .popup-photo{border-radius:10px;max-width:100%;overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.popup-new-media .scrollable{position:relative}.popup-new-media .input-field{flex:0 0 auto;margin-top:25px;width:100%}.popup-new-media .input-field-input{border-radius:10px;font-size:1rem}.popup-new-media .input-field-input[data-placeholder]:not(:focus):empty~label{opacity:0}.popup-new-media .input-field label{font-size:inherit}.popup-new-media .btn-menu-overlay{z-index:3}.popup-new-media .menu-send{top:calc(100% + .25rem);z-index:4}.popup-new-media.popup-send-photo .popup-container{max-width:25rem;padding:0;width:25rem}.popup-new-media.popup-send-photo .popup-container.border-top-offset .popup-input-container{overflow:visible;overflow:initial}.popup-new-media.popup-send-photo .popup-container.border-top-offset .popup-input-container:before{top:-8px}.popup-new-media.popup-send-photo .menu-send{bottom:3.5rem;right:.5rem;top:auto}.popup-new-media.popup-send-photo .popup-header{height:3.5rem;margin:0;padding:0 1rem}[dir=ltr] .popup-new-media.popup-send-photo .popup-title{padding-left:1.5rem}[dir=rtl] .popup-new-media.popup-send-photo .popup-title{padding-right:1.5rem}.popup-new-media.popup-send-photo .popup-close{margin:0}.popup-new-media.popup-send-photo .popup-body{position:relative}.popup-new-media.popup-send-photo .popup-body .scrollable{padding:0 .5rem}.popup-new-media.popup-send-photo .input-message-container{max-height:inherit;min-height:inherit}.popup-new-media.popup-send-photo .input-message-input{max-height:inherit!important}.popup-new-media.popup-send-photo .btn-primary{flex:0 0 auto;height:2.5rem;line-height:2.5rem;margin-bottom:.5rem;padding:0 1rem;text-transform:uppercase;width:auto}.popup-new-media.popup-send-photo .popup-input-container{--height:3.5rem;--max-height:8.375rem;align-items:flex-end;display:flex;flex:0 0 auto;justify-content:space-between;max-height:var(--max-height);min-height:var(--height);overflow:hidden;padding:0 .5rem;position:relative}.popup-new-media.popup-send-photo .popup-input-container:before{background-color:var(--border-color);content:" ";height:1px;left:0;opacity:0;position:absolute;right:0;top:0}body.animation-level-2 .popup-new-media.popup-send-photo .popup-input-container:before{transition:opacity var(--transition-standard-in)}.popup-new-media.popup-send-photo .popup-input-container.has-border-top:before{opacity:1}.popup-new-media.popup-send-photo .checkbox-field{margin-bottom:0;margin-left:0}.popup-new-media.popup-send-photo .popup-item-album{position:relative}.popup-new-media.popup-send-photo .popup-item-album .album-item{position:absolute}.popup-new-media.popup-send-photo .popup-item-album img,.popup-new-media.popup-send-photo .popup-item-album video{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.popup-new-media.popup-send-photo .popup-photo>.popup-item-media{display:flex;justify-content:center;margin:0 auto}.popup-new-media.popup-send-photo .popup-photo>.popup-item-media img{-o-object-fit:contain;object-fit:contain}.popup-new-media.popup-send-photo .popup-photo>.popup-item{border-radius:inherit;overflow:hidden;position:relative}.popup-new-media.popup-send-photo .popup-photo>.popup-item+.popup-item{margin-top:.5rem}.popup-new-media.popup-send-photo .drop{border-radius:0}.popup-new-media.popup-send-photo .audio,.popup-new-media.popup-send-photo .document{--icon-margin:.5rem;--icon-size:3rem;--padding:.25rem;border-radius:10px;cursor:default;height:3.5rem;margin:0 .25rem}html.no-touch .popup-new-media.popup-send-photo .audio:active,html.no-touch .popup-new-media.popup-send-photo .audio:hover,html.no-touch .popup-new-media.popup-send-photo .document:active,html.no-touch .popup-new-media.popup-send-photo .document:hover{--message-background-color:var(--light-filled-secondary-text-color);background-color:var(--light-secondary-text-color)}.popup-new-media.popup-send-photo .document{max-width:100%;overflow:hidden}.popup-new-media.popup-send-photo .document.document-with-thumb{--icon-size:4.5rem;height:5rem}.popup-new-media.popup-send-photo .document-name{line-height:1.5;margin-bottom:.125rem;max-width:100%;overflow:hidden;text-overflow:ellipsis;width:100%}.popup-new-media.popup-send-photo .document-ico{border-radius:5px;font-size:16px;font-weight:400;letter-spacing:0;line-height:11px}.popup-create-contact .popup-container{padding:0 1rem 1rem!important}.popup-create-contact .popup-header{padding:0!important}.popup-create-contact .btn-primary{margin-bottom:0!important}.popup-create-contact .name-fields{display:flex;flex-direction:column;margin-top:1rem;padding-left:116px;position:relative}.popup-create-contact .name-fields .input-field:first-child{margin-top:0}.popup-create-contact .avatar-placeholder{left:0;position:absolute;top:50%;transform:translateY(-50%)}.popup-peer .popup-header{align-items:center;display:flex;height:2.5rem;margin:0;padding:0 1rem;width:-moz-max-content;width:max-content}.popup-peer .popup-container{max-width:min(400px,100%);min-width:min(100%,17.5rem);padding:.75rem .5rem;width:-moz-min-content;width:min-content}.popup-peer .popup-title{font-size:1.25rem;font-weight:var(--font-weight-bold)}.popup-peer .popup-title:not(:first-child){padding-left:1rem}.popup-peer .popup-description{line-height:var(--line-height);margin-bottom:0;margin-top:0;max-width:-moz-fit-content;max-width:fit-content;min-width:min(100%,15rem);overflow:hidden;padding:.625rem 1rem .5rem;text-overflow:ellipsis;word-break:break-word}.popup-peer .checkbox-field{align-items:center;display:flex;height:auto;margin:0;min-height:3rem;padding:.25rem 1.125rem}.popup-peer .checkbox-field .checkbox-box{left:auto}.popup-stickers{-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-stickers .sticker-set-footer{color:var(--primary-color);text-align:center}.popup-stickers .sticker-set-footer .btn-primary{height:44px;line-height:44px;padding:0 1.0625rem;text-transform:uppercase;width:auto}.popup-stickers .scrollable.is-loading{min-height:9rem;position:relative}.popup-stickers .sticker-set-footer{padding:8px 0}.popup-stickers .super-emojis{padding:0 .5rem}.popup-stickers .popup-container{max-height:420px;max-width:420px;padding:0;width:420px}[dir=ltr] .popup-stickers .popup-close{margin-left:1rem}[dir=rtl] .popup-stickers .popup-close{margin-right:1rem}.popup-stickers .popup-close{font-size:1.5rem}.popup-stickers .popup-header{flex:0 0 auto;margin:.625rem 0}.popup-stickers .sticker-set{margin:.0625rem 0}.popup-stickers .sticker-set .row-title{font-weight:var(--font-weight-bold)}.popup-stickers .sticker-set-stickers{--per-row:5;--item-size:var(--popup-sticker-size);display:grid;grid-template-columns:repeat(var(--per-row),1fr);padding:0 5px;position:relative}@media only screen and (max-width:600px){.popup-stickers .sticker-set-stickers{--per-row:4}}.popup-stickers .sticker-set-stickers .media-sticker-wrapper{cursor:pointer;height:var(--item-size);justify-self:center;margin-bottom:2px;position:relative;width:var(--item-size)}@media only screen and (max-width:600px){.popup-stickers .sticker-set-stickers .media-sticker-wrapper{margin-bottom:8px}}.popup-stickers .sticker-set-stickers .media-sticker-wrapper:hover{background-color:var(--light-secondary-text-color);border-radius:12px}.popup-date-picker{-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-date-picker .popup-container{padding:12px 14px}@media(min-height:470px){.popup-date-picker .popup-container[data-lines="7"]{top:19px}.popup-date-picker .popup-container[data-lines="5"]{top:-19px}}.popup-date-picker .popup-header{margin-bottom:1.375rem;margin-left:6px;margin-top:4px}.popup-date-picker .popup-title{font-size:20px;font-weight:var(--font-weight-bold)}.popup-date-picker .popup-buttons{margin-right:-2px;order:2}.popup-date-picker .popup-buttons button+button{margin-left:9px;margin-top:0}.popup-date-picker .date-picker-controls{align-items:center;display:flex;justify-content:space-between}.popup-date-picker .date-picker-controls .date-picker-month-title{font-size:14px;font-weight:var(--font-weight-bold)}.popup-date-picker .date-picker-prev{transform:rotate(90deg)}.popup-date-picker .date-picker-next{transform:rotate(-90deg)}.popup-date-picker .date-picker-next:disabled,.popup-date-picker .date-picker-prev:disabled{visibility:hidden}.popup-date-picker .date-picker-months{margin-bottom:1.5rem;margin-top:7px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-date-picker .date-picker-month{display:grid;grid-template-columns:repeat(7,1fr);justify-content:center;width:100%}.popup-date-picker .date-picker-month .btn-icon{align-items:center;color:var(--secondary-text-color);display:flex;font-size:12px;height:38px;justify-content:center;justify-self:center;width:38px}.popup-date-picker .date-picker-month .btn-icon:disabled{opacity:1}.popup-date-picker .date-picker-month-date:disabled{opacity:.7!important}.popup-date-picker .date-picker-month .btn-icon:not(:disabled){color:var(--primary-text-color)}.popup-date-picker .date-picker-month .btn-icon.active{background-color:var(--primary-color)!important;border-radius:50%;color:var(--badge-text-color)}.popup-schedule .popup-header{justify-content:space-between;margin-bottom:17px;margin-left:0;margin-top:5px}@media only screen and (max-width:600px){.popup-schedule .popup-header{margin-left:3px}}.popup-schedule .popup-header .btn-icon{font-size:22px}.popup-schedule .popup-container{min-width:420px;padding:4px 16px 16px;width:420px}@media only screen and (max-width:600px){.popup-schedule .popup-container{min-width:312px;padding:4px 14px 14px;width:312px}}.popup-schedule .popup-container[data-lines="5"]{top:-16px}.popup-schedule .popup-container[data-lines="7"]{top:16px}.popup-schedule .date-picker-month{margin-left:2px;margin-right:-20px;width:auto}@media only screen and (max-width:600px){.popup-schedule .date-picker-month{margin-left:0;margin-right:-6px}}.popup-schedule .date-picker-month-title{font-size:20px;font-weight:var(--font-weight-bold);margin-left:-5rem}@media only screen and (max-width:600px){.popup-schedule .date-picker-month-title{margin-left:-2rem}}.popup-schedule .date-picker-month .btn-icon{font-size:14px;font-weight:var(--font-weight-bold);height:36px;justify-self:auto;margin-top:-4px;width:36px}.popup-schedule .date-picker-month-date:disabled{color:#9ba3a8!important}.popup-schedule .date-picker-month-day{color:var(--primary-text-color)!important;font-size:14px!important;font-weight:var(--font-weight-bold)}.popup-schedule .date-picker-months{margin-bottom:14px}@media only screen and (max-width:600px){.popup-schedule .date-picker-months{margin-bottom:13px}}.popup-schedule .date-picker-time{display:flex;justify-content:center;margin-bottom:1.5rem}@media only screen and (max-width:600px){.popup-schedule .date-picker-time{margin-bottom:22px}}.popup-schedule .date-picker-time .input-field{width:80px}.popup-schedule .date-picker-time .input-field-input{text-align:center}.popup-schedule .date-picker-time-delimiter{padding:14px 20px}.popup-schedule .date-picker-controls .btn-icon:disabled{visibility:visible}.popup-schedule .btn-primary{font-weight:400}@media only screen and (max-width:600px){.popup-schedule .btn-primary{widtH:280px;height:50px;margin-left:2px}}.popup-create-poll .popup-container{max-height:min(640px,100%);padding:0}.popup-create-poll .radio-field{margin:0}.popup-create-poll .radio-field .radio-field-main:before{left:.25rem}.popup-create-poll .radio-field .radio-field-main:after{left:.5625rem}.popup-create-poll .hidden-widget .btn-icon,.popup-create-poll .radio-field:first-child:last-child .btn-icon{opacity:0!important;pointer-events:none}.popup-create-poll .input-field .btn-icon{opacity:1;position:absolute;right:.4375rem;top:.4375rem;transition:opacity .2s ease;z-index:1}@media only screen and (max-width:600px){.popup-create-poll .input-field .btn-icon{right:.3125rem;top:.3125rem}}.popup-create-poll .caption{color:var(--secondary-text-color);font-weight:var(--font-weight-bold);padding:1rem 1.5rem 0}.popup-create-poll .poll-create-questions{padding:0 1.25rem 1.5rem}.popup-create-poll .poll-create-questions:not(:last-child) .input-field-input{padding-right:3.25rem}.popup-create-poll .poll-create-settings{padding:0 .5rem .5rem}.popup-create-poll .subtitle{font-size:.875rem;line-height:1.2;margin-top:.875rem}.popup-create-poll .btn-primary{width:94px}.popup-create-poll .menu-send{right:20px;top:54px}.popup-create-poll hr:not(.hide){display:block!important}.popup-forward .popup-container{height:40.625rem;max-height:min(40.625rem,100%);max-width:420px;padding:7px 0 0;width:420px}.popup-forward .popup-header{flex:0 0 auto;margin-bottom:7px;padding:0 1rem}@media only screen and (max-width:600px){.popup-forward .popup-header{padding-left:.8125rem}}.popup-forward .popup-title{flex-grow:1;height:100%;padding:0}.popup-forward .chatlist-container,.popup-forward .selector{display:flex;flex:1 1 auto;flex-direction:row;height:auto;overflow:hidden;width:100%}.popup-forward .selector-search-input{font-size:var(--font-size-20);height:100%;line-height:1;padding:.5rem 1.5rem;width:100%}@media only screen and (max-width:600px){.popup-forward .selector-search-input{padding-left:1.1875rem}}.popup-forward .selector .chatlist{margin-top:0!important}.popup-forward .gradient-delimiter{display:none}.popup-forward .sidebar-left-section{margin-bottom:0!important;padding-top:0!important}.popup-instance-deactivated{background-color:rgba(0,0,0,.6)}.popup-instance-deactivated .instance-deactivated-container{margin:auto;pointer-events:none;text-align:center}.popup-instance-deactivated .header{color:#fff;font-size:2rem}.popup-instance-deactivated .subtitle{color:#fff;font-size:1.5rem;line-height:var(--line-height);opacity:.6}.popup-join-chat-invite{-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-join-chat-invite .popup-container{max-width:420px}.popup-join-chat-invite .popup-body{align-items:center;padding:.5rem 0 1.25rem}.popup-join-chat-invite .chat-title{font-weight:var(--font-weight-bold);line-height:var(--line-height);margin:.75rem 0 .25rem}.popup-join-chat-invite .chat-participants-count{color:var(--secondary-text-color);font-size:.875rem;line-height:var(--line-height)}.popup-join-chat-invite .request-caption{margin-top:1rem;text-align:center}.popup-report-messages-confirm{-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-report-messages-confirm .media-sticker-wrapper{height:100px;margin:0 auto;position:relative;width:100px}.popup-report-messages-confirm .popup-body{margin:1rem 0 .375rem;overflow:visible;overflow:initial}.popup-report-messages-confirm .popup-description{font-size:.875rem;text-align:center}.popup-report-messages-confirm .popup-buttons{margin-top:.625rem}.popup-report-messages-confirm .input-field{width:100%}.popup-call .popup-header{justify-content:space-between;width:100%}.popup-call .popup-title{flex:1 1 auto}.call{align-items:center;color:#fff;height:100%;width:100%}.call.is-full-screen,html.is-mobile .call{border-radius:0}.call.is-full-screen:not(.show-controls){cursor:none}.call.no-video .call-button,.call.no-video .call-button-text,.call.no-video .call-emojis,.call.no-video .call-party-state,.call.no-video .call-subtitle,.call.no-video .call-title,.call.no-video .popup-header,.call.show-controls .call-button,.call.show-controls .call-button-text,.call.show-controls .call-emojis,.call.show-controls .call-party-state,.call.show-controls .call-subtitle,.call.show-controls .call-title,.call.show-controls .popup-header{opacity:1}.call.show-controls .call-video{opacity:.8}.call.show-controls .call-video-blur{opacity:.56}.call .popup-header .btn-icon{color:#fff}.call .popup-header .call-emojis{margin-right:1rem;transform:scale(1.3125)}.call-avatar{border-radius:inherit;bottom:0;left:0;opacity:.7;position:absolute;right:0;top:0;z-index:-1}.call-avatar .avatar-full{font-size:6rem}.call-title{font-size:1.25rem;font-weight:var(--font-weight-bold)}.call-subtitle{font-size:1rem}.call .popup-header,.call-emojis,.call-subtitle,.call-title{opacity:0}body.animation-level-2 .call .popup-header,body.animation-level-2 .call-emojis,body.animation-level-2 .call-subtitle,body.animation-level-2 .call-title{transition:opacity var(--transition-standard-in)}.call-buttons{align-items:center;align-self:center;bottom:1.75rem;display:flex;pointer-events:none;position:absolute;z-index:1}.call-buttons .call-button{pointer-events:all}.call-buttons .call-button-container{--scale:1}.call-buttons .call-button-container.hide-me{--scale:0!important;transform:scale(var(--scale))}body.animation-level-2 .call-buttons .call-button-container.hide-me{transition:transform var(--transition-standard-in)}.call-buttons .call-button-container.hide-me .call-button,.call-buttons .call-button-container.hide-me .call-button-text{opacity:0}body.animation-level-2 .call-buttons .call-button,body.animation-level-2 .call-buttons .call-button-text{transition:opacity var(--transition-standard-in),transform var(--transition-standard-in)}.call-buttons.is-first .call-button,.call-buttons.is-first .call-button-text{transform:translateX(calc(var(--call-button-size)*-.5 + var(--call-button-margin)*-.5))}.call-buttons.is-second{--margin-length:2}.call-buttons.is-second .call-button,.call-buttons.is-second .call-button-text{transform:translateX(calc(var(--call-button-size)*2 + var(--call-button-margin)*var(--margin-length)))}.call.no-screen .call-buttons.is-second{--margin-length:.656875}.call-button{background-color:hsla(0,0%,100%,.1)}.call-button-red{background-color:var(--danger-color)!important}.call-button-green{background-color:var(--gc-green-text-color)!important}.call-button.active{background-color:#fff!important}.call-button.active:before{color:#9e9e9e}.call-button,.call-button-text{opacity:0}.call-video{border-radius:inherit;height:100%;-o-object-fit:contain;object-fit:contain;opacity:1;position:absolute;width:100%}.call-video-container{align-items:center;background-color:#000;bottom:0;display:flex;left:0;position:absolute;right:0;top:0;z-index:-1}.call-video-container.small{border-radius:10px;bottom:8rem;cursor:pointer;left:auto;right:1rem;top:auto;z-index:1}.call-video-blur{border-radius:inherit;height:100%;opacity:.7;position:absolute;width:100%}body.animation-level-2 .call-video,body.animation-level-2 .call-video-blur{transition:opacity var(--transition-standard-in)}.call .call-emojis{transform:scale(1.125)}.call .call-emojis .emoji{margin:0 .125rem}.call-party-states{align-items:center;bottom:calc(4.25rem + var(--call-button-size));display:flex;flex-direction:column;padding:0 1rem;pointer-events:none;position:absolute;width:100%;z-index:2}.call-party-state{align-items:center;-webkit-backdrop-filter:blur(25px);backdrop-filter:blur(25px);background-color:hsla(0,0%,100%,.2);border-radius:1.625rem;color:#fff;display:flex;font-size:.875rem;font-weight:var(--font-weight-bold);height:1.625rem;line-height:1.625rem;margin-top:1rem;max-width:100%;opacity:0;padding:0 .625rem;transform:scale(0) translateY(0)}body.animation-level-2 .call-party-state{transition:opacity var(--transition-standard-in),transform var(--transition-standard-in)}.call-party-state .rlottie-icon{flex:0 0 auto;height:1.875rem!important;margin-left:-.25rem;margin-right:.25rem;width:1.875rem!important}.call-party-state.is-visible:not(.backwards){transform:scale(1) translateY(0)}.call-party-state-text,.call-title{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.call.two-button-rows .call-buttons.is-first .call-button,.call.two-button-rows .call-buttons.is-first .call-button-text{transform:translateY(calc(var(--call-button-size)*-1 + var(--call-button-margin)*-1 + -1.125rem))}.call.two-button-rows .call-buttons.is-second .call-button,.call.two-button-rows .call-buttons.is-second .call-button-text{transform:translateX(0)}.popup-group-call:not(.movable-element){top:7rem}.popup-group-call:not(.movable-element) .group-call{border-bottom-left-radius:0;border-bottom-right-radius:0}.popup-group-call .popup-body{justify-content:space-between}.popup-group-call .popup-container{background-color:var(--gc-background-color);color:var(--gc-primary-text-color)}.popup-group-call .popup{z-index:6}.group-call{--call-button-margin:1.25rem;height:100%;padding:0 .5rem;width:100%}.group-call:after{background:linear-gradient(180deg,rgba(33,33,33,0) 0,rgba(33,33,33,.65) 48.54%,var(--gc-background-color) 100%);bottom:0;content:" ";height:7.5rem;left:0;position:absolute;right:0}.group-call-header{height:3.5rem;margin-bottom:.125rem;padding:0 .5rem}.group-call-header .btn-icon{color:inherit;flex:0 0 auto}.group-call-header-info{flex:1 1 auto;margin-left:1.5rem;overflow:hidden}.group-call-header-title{font-weight:var(--font-weight-bold)}.group-call-header-subtitle,.group-call-header-title{font-size:var(--font-size-16);line-height:var(--line-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.group-call-header-subtitle{color:var(--gc-secondary-text-color);font-size:.875rem}.group-call-buttons{align-items:center;align-self:center;bottom:1.75rem;display:flex;justify-content:space-between;position:absolute;z-index:1}.group-call-button{background-color:var(--gc-button-unmuted-color);color:var(--gc-primary-text-color);opacity:1}.group-call[data-mic-state=muted] .group-call-button{background-color:var(--gc-button-muted-color)}.group-call[data-mic-state=hand] .group-call-button{background-color:var(--gc-button-hand-color)}.group-call:not(.is-big-layout)[data-mic-state=unmuted] .group-call-button{background-color:var(--gc-button-unmuted-fill-color)}.group-call-button-red{background-color:var(--gc-button-leave-color)!important}.group-call[data-mic-state=unmuted] .group-call-microphone-button{background:linear-gradient(230.46deg,#00a3b4 12.94%,#00cb47 86.29%)}.group-call[data-mic-state=muted] .group-call-microphone-button{background:linear-gradient(225deg,#4eabf8 14.73%,#3478f6 85.27%)}.group-call[data-mic-state=hand] .group-call-microphone-button{background:linear-gradient(225deg,#df44b8 14.73%,#3851eb 85.27%)}.group-call-participant-menu{z-index:5}.group-call-participant{padding-right:.5rem}.group-call-participant-status-icon{display:inline-block;font-size:1.125rem;height:1.125rem;line-height:1;margin-right:6px;vertical-align:middle;width:1.125rem}.group-call-participant-status-container{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.group-call-participant .dialog-subtitle,.group-call-participant .dialog-title{padding-right:2.5rem}.group-call-participant-muted-icon-container{position:absolute!important;right:.5rem}.group-call-participant-video-container{align-items:center;background-color:#000;border-radius:10px;cursor:pointer;display:flex;flex:1 1 auto;height:15rem;margin:.25rem;overflow:hidden;position:relative;width:100%;width:33%}.group-call-participant-video-container:after{background:linear-gradient(180deg,transparent 55.62%,rgba(0,0,0,.5) 86.46%);bottom:0;content:" ";left:0;position:absolute;right:0;top:0}.group-call-participant-video-container .group-call-participant-status-icon{font-size:1.25rem;height:1.25rem;width:1.25rem}.group-call-participant-video-container:after,.group-call-participant-video-header,.group-call-participant-video-info{opacity:0}body.animation-level-2 .group-call-participant-video-container:after,body.animation-level-2 .group-call-participant-video-header,body.animation-level-2 .group-call-participant-video-info{transition:opacity var(--transition-standard-in)}.group-call-participant-video-header,.group-call-participant-video-info{align-items:center;bottom:.25rem;display:flex;justify-content:space-between;left:0;padding:0 .5rem 0 .75rem;position:absolute;right:0;z-index:1}.group-call-participant-video-header{bottom:auto;justify-content:flex-end;padding-right:.75rem;padding-top:.875rem;top:0}.group-call-participant-video-header .group-call-pin-icon{font-size:1.5rem;height:1.5rem;width:1.5rem}.group-call-participant-video-info .peer-title{font-weight:var(--font-weight-bold)}.group-call-participant-video-info .peer-title,.group-call-participant-video-info-left{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.group-call-participant-video-info .group-call-participant-status-container{margin-top:-1px;opacity:.6}.group-call-participant-video-info-left{flex:1 1 auto}.group-call-participant-video-info-right{flex:0 0 auto;height:2rem;margin-left:.75rem;width:2rem}.group-call-participant .is-speaking{color:var(--gc-green-text-color)}.group-call-participant .is-waiting{color:var(--gc-blue-text-color)}.group-call-participants{border-radius:10px;flex:1 1 auto;overflow:hidden}.group-call-participants-scrollable{border-radius:inherit;height:auto;padding-bottom:6rem;position:relative}.group-call-participants-video-container{display:flex;flex-wrap:wrap;margin:-.25rem -.25rem 0}.group-call-participants-video-container:not(.show-controls),.group-call-participants-video-container:not(.show-controls) .group-call-participant-video-container{cursor:none}.group-call-participants-video-container:empty{display:none}.group-call-participants-video-container[data-layout="3"] .group-call-participant-video-container:first-child{width:100%}.group-call-participants-video-container[data-layout="3"] .group-call-participant-video-container:nth-child(n+2),.group-call-participants-video-container[data-layout="4"] .group-call-participant-video-container{flex:1 0 auto;height:auto}.group-call-participants-video-container[data-layout="3"] .group-call-participant-video-container:nth-child(n+2):before,.group-call-participants-video-container[data-layout="4"] .group-call-participant-video-container:before{content:" ";display:block;padding-top:100%}.group-call-participants-video-container.show-controls .group-call-participant-video-container:after,.group-call-participants-video-container.show-controls .group-call-participant-video-header,.group-call-participants-video-container.show-controls .group-call-participant-video-info{opacity:1}.group-call-participants .chatlist{background:none;margin:0 auto;max-width:600px;padding:0}.group-call-participants .user-title{color:var(--gc-primary-text-color)}.group-call-participants .user-last-message{color:var(--gc-secondary-text-color)}.group-call-big-video-container{position:relative}.group-call-big-video-container .group-call-participants-video-container{margin-bottom:.25rem;min-height:100%}.group-call-big-video-container .group-call-participant-video-container{height:auto}.group-call-big-video-container .group-call-participant-video-container:before{padding-top:56.25%!important}.group-call-cfs,.group-call:not(.is-big-layout) .group-call-big-video-container,.group-call:not(.is-big-layout) .popup-body .group-call-header,.group-call:not(.is-big-layout).has-pinned .group-call-participant-video-container:not(.video-hidden){display:none}.group-call.is-full-screen{border-radius:0}.group-call.is-big-layout>.group-call-header,.group-call.is-full-screen>.group-call-header{padding:0 1rem}.group-call.is-big-layout:not(.is-full-screen){--gc-right-column-width:17.5rem}.group-call.is-big-layout:not(.is-full-screen) .group-call-cfs{display:flex}.group-call.is-big-layout{background-color:#000}.group-call.is-big-layout:after{content:none}html.no-touch .group-call.is-big-layout>.group-call-header .btn-icon:active,html.no-touch .group-call.is-big-layout>.group-call-header .btn-icon:hover{background-color:hsla(207,4%,46%,.3)}.group-call.is-big-layout .video-hidden{display:none}.group-call.is-big-layout.is-right-column-shown .popup-body{right:0}.group-call.is-big-layout.is-right-column-shown .group-call-big-video-container{width:calc(100% - var(--gc-right-column-width))}.group-call.is-big-layout.is-right-column-shown .group-call-buttons{transform:translateX(calc(var(--gc-right-column-width)/-2))}.group-call.is-big-layout.is-right-column-shown .popup-container{--translateX:calc(var(--gc-right-column-width)/-2)}.group-call.is-big-layout .group-call-header-title{font-size:1.25rem}.group-call.is-big-layout .popup-body{background-color:var(--gc-background-color);bottom:0;padding:inherit;position:absolute;right:calc(var(--gc-right-column-width)*-1);top:0;width:var(--gc-right-column-width)}.group-call.is-big-layout .group-call-buttons{bottom:2.5rem;padding:.75rem}body.animation-level-2 .group-call.is-big-layout .group-call-buttons{transition:opacity var(--transition-standard-in)}.group-call.is-big-layout .group-call-buttons:before{-webkit-backdrop-filter:blur(100px);backdrop-filter:blur(100px);background:rgba(0,0,0,.5);border-radius:1.25rem;bottom:0;content:" ";left:0;position:absolute;right:0;top:0}.group-call.is-big-layout .group-call-buttons .group-call-button,.group-call.is-big-layout .group-call-buttons:before{opacity:0}.group-call.is-big-layout .group-call-buttons.show-controls .group-call-button,.group-call.is-big-layout .group-call-buttons.show-controls:before{opacity:1}body.animation-level-2 .group-call.is-big-layout .group-call-buttons:before{transition:opacity var(--transition-standard-in)}body.animation-level-2 .group-call.is-big-layout .group-call-buttons .group-call-button{transition:opacity var(--transition-standard-in),background-color var(--transition-standard-in)}.group-call.is-big-layout .group-call-participants-scrollable{padding-bottom:.5rem}.group-call.is-big-layout .group-call-header-subtitle{display:none}.popup-sponsored .scrollable-y{margin:0 -1.5rem;max-height:25rem;padding:.5rem 1.5rem;position:relative;-webkit-user-select:text;-moz-user-select:text;user-select:text;width:calc(100% + 3rem)}.popup-mute .popup-container{min-width:16rem}.popup-reacted-list{--size:1.5rem;--custom-emoji-size:var(--size)}.popup-reacted-list .popup-container{height:600px;max-height:600px;padding:0;width:25rem}.popup-reacted-list .popup-header{border-bottom:1px solid var(--border-color);margin:0;min-height:3.5625rem;padding:.25rem .75rem .75rem}.popup-reacted-list .popup-close{height:40px;margin-right:.5rem;margin-top:.375rem;order:-1}.popup-reacted-list .reaction{--reaction-size:var(--size);--additional-height:.75rem;--margin:.5rem;--background-color:var(--light-filled-primary-color);--counter-color:var(--primary-color);flex:1 0 auto;justify-content:space-evenly}.popup-reacted-list .reaction.is-chosen:not(.backwards){--counter-color:#fff}.popup-reacted-list .reaction-sticker-icon{align-items:center;display:flex;font-size:1.25rem!important;margin:0}.popup-reacted-list .sidebar-left-section{margin-bottom:0!important}.popup-reacted-list .tabs-container{flex:1 1 auto;overflow:hidden}.popup-reacted-list .tabs-tab{background-color:var(--surface-color)}.popup-reacted-list .reacted-list-reaction-icon{display:flex;height:var(--size);position:absolute;right:1rem;top:50%;transform:translateY(-50%);width:var(--size)}.popup-reacted-list .chatlist-chat{padding-right:3.25rem!important}.popup-payment .popup-container{border-radius:16px;max-height:min(100%,43.5rem);max-width:26.25rem;padding:0;width:26.25rem}.popup-payment .popup-header{height:3.5rem;margin:0;padding:0 1rem}.popup-payment.is-loading .popup-container{min-height:26.25rem}.popup-payment .scrollable{display:flex;flex:1 1 auto;flex-direction:column}.popup-payment hr{display:block!important;margin:.5rem 0!important;padding:0!important}.popup-payment .input-field{--height:3rem;margin:.75rem .5rem 0}.popup-payment .input-field-input{--padding:.75rem}.popup-payment .input-fields-row .input-field{margin-top:1.25rem}.popup-payment .sidebar-left-section{padding:0!important}.popup-payment .sidebar-left-section-name+.input-field,.popup-payment .sidebar-left-section-name+.input-fields-row .input-field{margin-top:.75rem}.popup-payment .sidebar-left-section .row{margin-top:.5rem}.popup-payment .sidebar-left-section-content{margin:0 .5rem!important}.popup-payment .select-wrapper{box-shadow:var(--menu-box-shadow);max-height:10rem}.popup-payment .select-wrapper li{grid-template-columns:calc(26px + 2rem) 1fr;height:3rem}.popup-payment .payment-verification{border:none;flex:1 1 auto;height:40rem;max-height:100%;width:100%}.popup-payment .row{border-radius:10px}.payment-item{padding:0 1.25rem;width:100%}.payment-item-details{display:flex;flex:0 0 auto;justify-content:space-between;margin-bottom:1rem;overflow:hidden}.payment-item-details:last-child{margin-bottom:0}.payment-item-details-photo{border-radius:10px;flex:0 0 auto;height:6.25rem;margin-right:1rem;width:6.25rem}.payment-item-details-photo .media-photo{border-radius:inherit}.payment-item-details-lines{display:flex;flex:1 1 auto;flex-direction:column}.payment-item-details-lines-title{font-size:var(--font-size-16);font-weight:var(--font-weight-bold);line-height:var(--line-height-16)}.payment-item-details-lines-bot-name,.payment-item-details-lines-description{font-size:var(--font-size-14);line-height:1.25rem}.payment-item-details-lines-bot-name{color:var(--secondary-text-color)}.payment-item-prices{display:flex;flex-direction:column;margin:1rem .25rem .5rem}.payment-item-prices-price{color:var(--secondary-text-color);display:flex;font-weight:500;justify-content:space-between;line-height:1.1875rem}.payment-item-prices-price+.payment-item-prices-price{margin-top:1.5rem}.payment-item-prices-price.is-total{color:var(--primary-text-color)}.payment-item-tips{display:flex;justify-content:space-between;margin:.75rem -.5rem 1.5rem}.payment-item-tips-tip{--background-intensity:.1;background-color:rgba(84,190,97,var(--background-intensity));border-radius:1.25rem;color:#3ba748;flex:1 1 auto;font-size:var(--font-size-16);font-weight:var(--font-weight-bold);height:2.5rem;line-height:2.5rem;text-align:center}body.animation-level-2 .payment-item-tips-tip{transition:color .1s ease-in-out,background-color .1s ease-in-out}.payment-item-tips-tip+.payment-item-tips-tip{margin-left:.5rem}html.no-touch .payment-item-tips-tip:not(.active):active,html.no-touch .payment-item-tips-tip:not(.active):hover{--background-intensity:.3}.payment-item-tips-tip.active{--background-intensity:1;color:#fff}.payment-item-tips-input{color:inherit!important;display:inline;font-weight:inherit!important}.payment-item-row{margin:0 .5rem;padding-bottom:0;padding-top:0}.payment-item-method-row .media-photo{border-radius:10px}.payment-item-pay{flex:0 0 auto;height:3rem;margin:1rem;text-transform:uppercase;width:auto}.payment-item-preloader-container{flex:1 1 auto;position:relative}.popup-payment-shipping-methods .popup-container{min-height:auto}.popup-payment-shipping-methods .row{margin-top:0!important}.popup-payment-verification .popup-header:after{background-color:var(--border-color);bottom:-1px;content:" ";height:1px;left:0;position:absolute;right:0}.popup-payment-card-confirmation .popup-container{min-height:auto}.popup-payment-card-confirmation .input-field-password{margin-top:.5rem!important}.popup-limit .popup-container{min-width:min(100%,22.5rem)}.popup-limit-line{align-items:center;display:flex;flex-direction:column;margin:.75rem 0}.popup-limit-hint{align-items:center;color:#fff;display:flex;font-weight:var(--font-weight-bold);justify-content:center;transform:scale(.6) translate(-280px,16px) rotate(-30deg)}body.animation-level-2 .popup-limit-hint{transition:transform .3s cubic-bezier(.12,1.1,.56,1.2)}.popup-limit-hint.active{transform:scale(1) translate(0) rotate(0)}.popup-limit-hint-icon{display:flex;font-size:1.25rem;margin-right:.25rem}.popup-limit-button.primary{align-items:center;background:linear-gradient(88.39deg,#6c93ff -2.56%,#976fff 51.27%,#df69d1 107.39%);color:#fff!important;display:flex}.popup-limit-button-icon{display:flex;font-size:1.5rem;margin-left:.625rem}.popup-limit .limit-line{align-self:stretch;margin:1rem .5rem 0}.popup-limit:not(.is-locked) .popup-limit-hint{background:linear-gradient(73.4deg,#6c93ff -7.21%,#976fff 114.57%,#df69d1 241.52%);background-size:200px 2rem;border-radius:1rem;height:2rem;padding:0 .75rem;position:relative}.popup-limit:not(.is-locked) .popup-limit-hint:after{background:inherit;background-position-x:calc(-50% - 86px);background-repeat:no-repeat;background-size:inherit;bottom:-9px;-webkit-clip-path:path("M0 0H26H24.4853C22.894 0 21.3679 0.632141 20.2426 1.75736L14.4142 7.58579C13.6332 8.36684 12.3668 8.36683 11.5858 7.58579L5.75736 1.75736C4.63214 0.632139 3.10602 0 1.51472 0H0Z");clip-path:path("M0 0H26H24.4853C22.894 0 21.3679 0.632141 20.2426 1.75736L14.4142 7.58579C13.6332 8.36684 12.3668 8.36683 11.5858 7.58579L5.75736 1.75736C4.63214 0.632139 3.10602 0 1.51472 0H0Z");content:" ";display:block;height:9px;left:50%;margin-left:-13px;position:absolute;width:100%}.popup-limit.is-locked .popup-limit-hint{background-color:var(--primary-color);border-radius:1.375rem;height:2.75rem;margin-right:-.25rem;padding:0 1.25rem 0 1rem}.popup-limit.is-premium .popup-limit-hint{align-self:flex-end;background:linear-gradient(84.4deg,#6c93ff -4.85%,#976fff 51.72%,#df69d1 110.7%);background-position-x:100%;background-size:200px 2rem;border-bottom-right-radius:0;margin-right:.5rem}body.animation-level-2 .popup-limit.is-premium .popup-limit-hint{transition:transform .3s cubic-bezier(.12,1.1,.56,1.1)}.popup-limit.is-premium .popup-limit-hint:after{background-position-x:134%;bottom:-11.3px;-webkit-clip-path:path("M8.44528 0.5H20.5V10.1943C20.5 10.9154 19.9154 11.5 19.1943 11.5C18.8178 11.5 18.4597 11.3375 18.2117 11.0541L10.2274 1.92918C9.75146 1.38523 9.18812 0.924478 8.56057 0.565879L8.44528 0.5Z");clip-path:path("M8.44528 0.5H20.5V10.1943C20.5 10.9154 19.9154 11.5 19.1943 11.5C18.8178 11.5 18.4597 11.3375 18.2117 11.0541L10.2274 1.92918C9.75146 1.38523 9.18812 0.924478 8.56057 0.565879L8.44528 0.5Z");height:12px;left:100%;margin-left:-20.6px}.popup-gift-premium .popup-container{border-radius:16px;max-height:min(100%,43.5rem);max-width:26.25rem;padding:0;width:26.25rem}.popup-gift-premium .popup-header{height:3.5rem;margin:0 0 -2rem;padding:0 1rem}.popup-gift-premium .scrollable-y{flex:1 1 auto;padding:0 1rem 1rem}.popup-gift-premium-avatar{display:block;margin:0 auto}.popup-gift-premium-subtitle,.popup-gift-premium-title{display:block;text-align:center}.popup-gift-premium-title{font-size:var(--font-size-20);font-weight:var(--font-weight-bold);margin:.75rem 0}.popup-gift-premium-options{display:flex;flex-direction:column;margin:.5rem 0 1rem}.popup-gift-premium-option{margin-top:.5rem}.popup-gift-premium-option:first-child{--primary-color:#c564f3}.popup-gift-premium-option:nth-child(2){--primary-color:#ac64f3}.popup-gift-premium-option:nth-child(3){--primary-color:#9377ff}.popup-gift-premium-discount{background-color:var(--primary-color);border-radius:6px;color:#fff;display:inline-block;height:20px;line-height:20px;margin-right:.375rem;padding:0 .3125rem}.popup-gift-premium-confirm{--ripple-color:hsla(0,0%,100%,.08);background:linear-gradient(88.39deg,#6c93ff -2.56%,#976fff 51.27%,#df69d1 107.39%)!important;color:#fff;font-weight:var(--font-weight-bold);text-transform:uppercase}html.no-touch .popup-gift-premium-confirm:active:after,html.no-touch .popup-gift-premium-confirm:hover:after{background-color:#fff;bottom:0;content:" ";left:0;opacity:.08;position:absolute;right:0;top:0}#auth-pages{background:var(--surface-color);max-width:100%;overflow:hidden}#auth-pages .btn-primary{text-transform:uppercase}@media only screen and (max-width:600px){#auth-pages .btn-primary{height:50px}}#auth-pages .subtitle{margin:0}@media only screen and (max-width:600px){#auth-pages .subtitle{font-size:14px}}#auth-pages .input-wrapper{margin-top:49px}@media only screen and (max-width:600px){#auth-pages .input-wrapper{margin-top:41px;padding:0 16px;width:100%}}#auth-pages .auth-image,#auth-pages .input-wrapper,#auth-pages .subtitle{flex:0 0 auto}#auth-pages>.scrollable{display:flex;flex-direction:column;margin:0 auto;max-width:720px;position:relative}#auth-pages>.scrollable .auth-placeholder{flex:1;min-height:3rem;width:100%}@media screen and (max-height:810px){#auth-pages>.scrollable .auth-placeholder:last-child{display:none}}#auth-pages .tabs-container{margin:0 auto;max-width:720px;min-width:auto;position:relative}#auth-pages .tabs-container .tabs-tab{background-color:var(--surface-color)}#auth-pages .tabs-container .tabs-tab .container{display:flex;flex:1 1 auto;flex-direction:column;height:810px;padding:0;width:100%}@media screen and (max-height:810px){#auth-pages .tabs-container .tabs-tab .container{height:760px}}@media only screen and (max-width:600px){#auth-pages .page-password .input-wrapper{margin-top:31px}}#auth-pages .page-password .input-wrapper .btn-primary{margin-top:1rem}.page-sign .checkbox-field{margin-bottom:.5rem;margin-top:.5rem}.page-sign .auth-image,.page-signUp .auth-image{height:7.5rem;margin-bottom:1.5rem;width:7.5rem}@media only screen and (min-width:601px){.page-sign .auth-image,.page-signUp .auth-image{height:10rem;margin-bottom:1.5rem;width:10rem}}.page-authCode .phone-wrapper{flex:0 0 auto}.sign-logo{fill:var(--primary-color);max-height:100%;max-width:100%}.page-sign .btn-secondary,.page-signQR .btn-secondary{font-weight:400}.page-sign .qr,.page-signQR .qr{margin-top:1.5rem}.page-signQR{overflow:visible!important;overflow:initial!important}.page-signQR .auth-image{align-items:center;display:flex;height:240px!important;justify-content:center;width:240px!important}.page-signQR .auth-image .preloader{left:auto;top:auto;transform:none}.page-signQR .auth-image .qr-canvas{height:100%;width:100%}.page-signQR .auth-image .qr-canvas+.qr-canvas{display:none}.page-signQR .input-wrapper{margin-top:1rem!important}.page-signQR h4{flex:0 0 auto}[dir=ltr] .page-signQR .qr-description{text-align:left}[dir=rtl] .page-signQR .qr-description{text-align:right}.page-signQR .qr-description{line-height:var(--line-height);margin:1rem auto;max-width:480px}.page-signQR .qr-description li{margin-top:.5rem}.page-signUp .auth-image{margin-bottom:14px;margin-top:10px}@media only screen and (max-width:600px){.page-signUp .auth-image{margin-bottom:24px}}.page-signUp .fullName{flex:0 0 auto}@media only screen and (max-width:600px){.page-signUp #signUp{margin-top:100px}}.page-signUp .input-field{text-align:left;text-align:initial}.page-sign .btn-primary{margin-top:1.1875rem}#auth-pages>.scrollable,#main-columns{opacity:1;transition:opacity var(--transition-standard-in)}.page-authCode .auth-image{transform:translateY(12px)}.page-authCode .phone-wrapper{align-items:center;display:flex;justify-content:center;margin:1.375rem 0 .875rem}.page-authCode .phone-wrapper h4[contenteditable]{border:none;border-bottom:2px solid var(--primary-color);outline:none;padding:0 1rem}.page-authCode .phone-wrapper .phone.error{border-color:var(--danger-color)!important}.page-authCode .phone-wrapper .phone{margin:0}.page-authCode .subtitle{margin:0 auto!important;max-width:300px}.page-chats{display:flex;max-width:1682px!important}.page-chats #main-columns{height:100%;max-height:100%;min-height:100%;overflow:hidden;position:relative;width:100%}@media only screen and (max-width:600px){.page-chats .main-column{display:flex!important;width:100%;z-index:1}}@media only screen and (min-width:601px){.page-chats #column-center{background-color:#e6ebee;display:flex!important;width:100%}.page-chats #column-right{display:flex!important}.page-chats .main-column{height:100%;max-height:100%;min-height:100%;position:relative}.page-chats #main-columns{display:flex}}.page-chats #search-container,.page-chats .sidebar-search{flex-direction:column;height:100%;left:0;max-height:100%;overflow:hidden;position:absolute;top:0;width:100%;z-index:3}@media only screen and (min-width:1681px){.page-chats{border-color:var(--border-color);border-style:solid;border-width:0 1px}}.page-chats .avatar-edit{flex:0 0 auto;height:120px;margin:1rem auto 2rem;width:120px}body.animation-level-2 .page-chats .main-column{transition:transform var(--tabs-transition),filter var(--tabs-transition)}body,html{height:100%;margin:0;overflow:hidden;padding:0;width:100%}@media only screen and (max-width:600px){body,html{height:calc(var(--vh, 1vh)*100)}}html.is-ios{-webkit-touch-callout:none;position:fixed;-webkit-user-select:none}html.no-backdrop{--menu-background-color:var(--surface-color);--menu-backdrop-filter:none}@supports(padding:max(0px)){html{padding:0 min(16px,env(safe-area-inset-right)) 0 min(16px,env(safe-area-inset-left))}}html{-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);font-size:16px}body{background-color:var(--body-background-color);color:var(--primary-text-color)}body.deactivated{animation:grayscale-in var(--transition-standard-in) forwards}body.deactivated-backwards{animation:grayscale-out var(--transition-standard-out) forwards}@keyframes grayscale-in{0%{filter:grayscale(0)}to{filter:grayscale(1)}}@keyframes grayscale-out{0%{filter:grayscale(1)}to{filter:grayscale(0)}}a{color:var(--link-color)}button,html,input,optgroup,select,textarea{font-family:Roboto,-apple-system,apple color emoji,BlinkMacSystemFont,Segoe UI,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}a,button,div,input,select,textarea{-webkit-tap-highlight-color:rgba(0,0,0,0)}code,kbd,pre,samp{font-family:var(--font-monospace)}.whole{height:100%;margin:0 auto;max-width:1680px;min-height:100%;width:100%}@media only screen and (min-width:601px){.only-handhelds{display:none!important}}.container{margin:0 auto}h1,h2,h3,h4,h5,h6{font-weight:var(--font-weight-bold)}h4{font-size:2rem;line-height:110%;margin:22px 0 14px}@media only screen and (max-width:600px){h4{font-size:20px;margin:2px 0 8px}}[contenteditable=true],input{background-color:transparent;caret-color:var(--primary-color);color:var(--primary-text-color)}input,textarea{-webkit-appearance:none}input::-webkit-contacts-auto-fill-button,input::-webkit-credentials-auto-fill-button{position:absolute;right:0;visibility:hidden}input:-webkit-autofill:first-line{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,Helvetica Neue,Arial;font-size:16px}.subtitle{color:var(--secondary-text-color);line-height:1.35}.danger{color:var(--danger-color)!important}.danger .c-ripple__circle{background-color:var(--light-danger-color)}.blue,.primary{color:var(--primary-color)!important}.blue .c-ripple__circle,.primary .c-ripple__circle{background-color:var(--light-primary-color)}.primary-text{color:var(--primary-text-color)!important}.color-premium{-webkit-text-fill-color:transparent;background:var(--premium-gradient);-webkit-background-clip:text}.blue:before,.danger:before,.primary:before{color:inherit!important}.bg-warning{background:#fed85a!important}.contextmenu{bottom:auto!important;position:fixed!important;right:auto!important;width:auto!important;z-index:4!important}.preloader{height:50px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:50px}.preloader .preloader-path{stroke:var(--primary-color)}@keyframes thumbnail-fade-in-opacity{0%{opacity:0}to{opacity:.8}}@keyframes fade-in-opacity{0%{opacity:0}to{opacity:1}}@keyframes fade-out-opacity{0%{opacity:1}to{opacity:0}}@keyframes fade-in-backwards-opacity{0%{opacity:1}to{opacity:0}}@keyframes fade-out-backwards-opacity{0%{opacity:0}to{opacity:1}}@keyframes fade-in-opacity-fade-out-opacity{0%{opacity:0}10%{opacity:1}50%{opacity:1}to{opacity:0}}.toast{-webkit-backdrop-filter:blur(25px);backdrop-filter:blur(25px);background-color:rgba(0,0,0,.66);border-radius:10px;color:#fff;font-size:1rem;left:50%;max-width:min(30rem,calc(100vw - 2rem));opacity:0;padding:.5rem 1rem;position:fixed;top:50%;transform:translate(-50%,-50%);z-index:5}.toast.is-visible{opacity:1}body.animation-level-2 .toast{transition:opacity var(--transition-standard-in)}.toast b{color:inherit}.toast a{color:#60a5e9!important;cursor:pointer}hr{border:none;border-top:1px solid var(--border-color);margin:0;padding-bottom:.5rem;width:100%}b{font-weight:var(--font-weight-bold)}.avatar-edit{border-radius:50%;cursor:pointer;overflow:hidden;position:relative}.avatar-edit.is-forum{border-radius:var(--avatar-border-radius-forum)}.avatar-edit-canvas{background:linear-gradient(var(--avatar-color-top),var(--avatar-color-bottom));height:100%;max-height:100%;max-width:100%;width:100%}html.no-touch body.animation-level-2 .avatar-edit .tgico-cameraadd{transform:translateY(-50%) translateX(-50%) scale(1);transition:transform .2s ease-in-out}html.no-touch body.animation-level-2 .avatar-edit:hover .tgico-cameraadd{transform:translateY(-50%) translateX(-50%) scale(1.2)}.avatar-edit .tgico-cameraadd{color:#fff;font-size:3rem;height:3rem;left:50%;line-height:1;position:absolute;top:50%;transform:translateY(-50%) translateX(-50%);width:3rem;z-index:2}.avatar-edit .avatar-placeholder{filter:brightness(.7);height:100%;left:0;position:absolute;top:0;width:100%}.missing-icon{height:1.5rem;width:1.5rem}.missing-icon-path{fill:currentColor}.select-wrapper{background-color:var(--surface-color);border-radius:10px;display:flex;flex-direction:column;flex-wrap:wrap;left:0;max-height:23.5rem;opacity:0;overflow:hidden;position:absolute;top:calc(100% + .5rem);transform:scale(.95);transform-origin:top center;transition:opacity .2s ease-out,transform .2s ease-out;width:100%;z-index:3}.select-wrapper.active{opacity:1;transform:scale(1)}.select-wrapper ul{margin:.5rem 0}[dir=ltr] .select-wrapper li{text-align:left}[dir=rtl] .select-wrapper li{text-align:right}.select-wrapper li{align-items:center;cursor:pointer;display:grid;grid-template-columns:calc(26px + 2rem) 1fr 80px;height:3.5rem;justify-content:space-between;padding:0 1rem}html.no-touch .select-wrapper li:active,html.no-touch .select-wrapper li:hover{background-color:var(--light-secondary-text-color)}.select-wrapper .emoji{font-size:26px;height:26px;line-height:1;width:26px}.select-wrapper .scrollable{position:relative}[dir=ltr] .phone-code{text-align:right}[dir=rtl] .phone-code{text-align:left}.phone-code{color:#9e9e9e}.auth-image{height:166px;margin:0 auto 18px;position:relative;width:166px}@media only screen and (max-width:600px){.auth-image{height:120px;width:120px}}[dir=ltr] .phone-edit{margin-left:.4rem}[dir=rtl] .phone-edit{margin-right:.4rem}.phone-edit{cursor:pointer;font-size:1.5rem;height:1.5rem;line-height:1;opacity:.5;transition:opacity .2s;width:1.5rem}html.no-touch .phone-edit:active,html.no-touch .phone-edit:hover{opacity:1}span.emoji{display:inline!important;font-family:apple color emoji,segoe ui emoji,noto color emoji,android emoji,emojisymbols,emojione mozilla,twemoji mozilla,segoe ui symbol;line-height:1!important;vertical-align:baseline!important;vertical-align:initial!important}@media not screen and (-webkit-min-device-pixel-ratio:2),not screen and (min-device-pixel-ratio:2),not screen and (min-resolution:192dpi),not screen and (min-resolution:2dppx){html[dir=ltr]:not(.is-safari) span.emoji{margin-right:5px!important}html[dir=rtl]:not(.is-safari) span.emoji{margin-left:5px!important}html[dir=ltr]:not(.is-safari) avatar-element span.emoji{margin-right:0!important}html[dir=rtl]:not(.is-safari) avatar-element span.emoji{margin-left:0!important}}img.emoji{display:inline-block;height:18px;max-height:100%;max-width:100%;vertical-align:middle;width:18px}[contenteditable=true]{cursor:text;outline:none;-webkit-user-select:text;-moz-user-select:text;user-select:text;white-space:pre-wrap}[contenteditable=true] .custom-emoji{display:inline-block;margin-bottom:-2px}[contenteditable=true] .custom-emoji:before{content:none}[contenteditable=true] [style*=markup]{font-family:inherit!important}[contenteditable=true] [style*=bold]{font-weight:700}[contenteditable=true] [style*=italic]{font-style:italic}[contenteditable=true] [style*=underline]{text-decoration-line:underline}[contenteditable=true] [style*=strikethrough]{text-decoration-line:line-through}[contenteditable=true] [style*=underline][style*=strikethrough]{text-decoration-line:underline line-through}[contenteditable=true] [style*=monospace]{font-family:var(--font-monospace)!important}[contenteditable=true] [style*=spoiler]{background-color:var(--spoiler-draft-background-color)}[contenteditable][data-placeholder]:before{color:#a2acb4;content:attr(data-placeholder);display:block;opacity:0;pointer-events:none;position:absolute}body.animation-level-2 [contenteditable][data-placeholder]:before{transform:translateX(1.75rem);transition:opacity var(--input-transition) .01s,transform var(--input-transition) .01s}[contenteditable][data-placeholder]:empty:before{opacity:1}body.animation-level-2 [contenteditable][data-placeholder]:empty:before{transform:translateX(0)}.sticky_sentinel{left:0;pointer-events:none;position:absolute;right:0;visibility:hidden}.super-stickers{display:grid;grid-template-columns:repeat(auto-fill,var(--esg-sticker-size));justify-content:space-between;width:100%}html.no-touch .super-sticker:active,html.no-touch .super-sticker:hover{background-color:var(--light-secondary-text-color);border-radius:10px}.fade-in-transition{opacity:1}body.animation-level-2 .fade-in-transition{transition:opacity .2s ease-in-out}.show-more{cursor:pointer;padding-bottom:13px;padding-top:13px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media only screen and (min-width:601px){[dir=ltr] .show-more{padding-left:8px}[dir=rtl] .show-more{padding-right:8px}}[dir=ltr] .show-more .tgico-down{padding-left:1rem;padding-right:2rem}[dir=rtl] .show-more .tgico-down{padding-left:2rem;padding-right:1rem}.show-more .tgico-down{float:left;font-size:24px}.content-empty,.show-more .tgico-down{color:var(--secondary-text-color)}::-moz-selection{background:var(--selection-background-color)}.selection:after,::selection{background:var(--selection-background-color)}.selection:after{bottom:0;content:" ";left:0;position:absolute;right:0;top:0}.input-something{display:inline-block}.input-selectable{position:relative}@keyframes grow-icon{0%{opacity:.8;transform:scale(.5)}50%{opacity:1;transform:scale(1.1)}to{transform:scale(1)}}@keyframes hide-icon{0%{opacity:.4;transform:scale(1)}to{opacity:0;transform:scale(.5)}}.popup-disable-password .popup-description,.popup-skip-email .popup-description{max-width:284px}.grid{grid-gap:.25rem;display:grid;grid-auto-rows:1fr;grid-template-columns:repeat(3,1fr);width:100%}.grid-item{cursor:pointer;height:0;padding-bottom:100%;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-item-media{height:100%;left:0;-o-object-fit:cover;object-fit:cover;position:absolute;top:0;width:100%}.animated-super-row{--translateY:100%;bottom:0;left:0;position:absolute;right:0;top:0;transition:transform var(--pm-transition),opacity var(--pm-transition)}body.animation-level-0 .animated-super-row{transition:none}.animated-super-row.is-hiding{opacity:0}.animated-super-row.is-hiding.from-top{transform:translate3d(0,calc(var(--translateY)*-1),0)}.animated-super-row.is-hiding.from-bottom{transform:translate3d(0,var(--translateY),0)}.animated-counter{display:inline-flex}.animated-counter-decimal{position:relative}.animated-counter-decimal-placeholder{color:transparent}.animated-counter-decimal-wrapper{bottom:0;left:0;position:absolute;right:0;top:0}middle-ellipsis-element{display:block;overflow:hidden;width:100%}.album-item-media{height:100%;width:100%}html.no-touch .hover-effect:active,html.no-touch .hover-effect:hover{background-color:var(--light-secondary-text-color)}.progress-ring{left:0;pointer-events:none;position:absolute;top:0}.progress-ring__circle{stroke-linecap:round;transition:stroke-dashoffset}.rlottie,.rlottie-vector{bottom:0;height:100%;left:0;max-height:100%;max-width:100%;position:absolute;right:0;top:0;width:100%}.rlottie-icon{pointer-events:none;position:relative}body.animation-level-2 .rlottie.fade-in{animation:fade-in-opacity .2s ease-in-out forwards}.rlottie-vector{fill:rgba(0,0,0,.08)}.canvas-thumbnail{height:100%;position:absolute;width:100%}.media-container-contain{position:relative}.media-container-contain .media-photo{max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain}.media-container-cover{position:relative}.media-container-cover .media-photo{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.media-photo,.media-poster,.media-round,.media-sticker,.media-video{bottom:0;left:0;position:absolute;right:0;top:0}body.animation-level-2 .media-photo.fade-in,body.animation-level-2 .media-poster.fade-in,body.animation-level-2 .media-round.fade-in,body.animation-level-2 .media-sticker.fade-in,body.animation-level-2 .media-video.fade-in{animation:fade-in-opacity .2s ease-in-out forwards}body.animation-level-2 .media-photo.fade-out,body.animation-level-2 .media-poster.fade-out,body.animation-level-2 .media-round.fade-out,body.animation-level-2 .media-sticker.fade-out,body.animation-level-2 .media-video.fade-out{animation:fade-out-opacity .2s ease-in-out forwards}.media-video{z-index:1}.media-sticker{height:100%;margin:auto;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;width:100%}.media-sticker-wrapper.is-premium-sticker:before{align-items:center;background:rgba(0,0,0,.2);background-image:var(--lock-url);background-repeat:no-repeat;background-size:cover;border-radius:50%;bottom:.125rem;color:#fff;display:flex;height:1.25rem;justify-content:center;left:50%;position:absolute;transform:translateX(-50%);width:1.25rem;z-index:1}body.is-premium .media-sticker-wrapper.is-premium-sticker:after,body.is-premium .media-sticker-wrapper.is-premium-sticker:before{content:none}.media-round{max-height:var(--round-video-size);max-width:var(--round-video-size);z-index:1}.media-round canvas{border-radius:50%;height:100%;position:relative;width:100%}.media-round .video-time{background-color:var(--message-highlightning-color)!important;padding:0 .375rem}[dir=ltr] .media-round .video-time:after,[dir=ltr] .media-round .video-time:before{margin-left:.25rem}[dir=rtl] .media-round .video-time:after,[dir=rtl] .media-round .video-time:before{margin-right:.25rem}.media-round.is-unread .video-time:before{background-color:#fff;border-radius:50%;content:" ";height:.5rem;order:1;width:.5rem}.media-round.is-paused .video-time:after{align-items:center;content:"";display:flex;font-size:1.125rem;order:2}.gradient-delimiter{background-color:var(--background-color-true);height:.75rem;position:relative;width:100%}.gradient-delimiter:before{background:linear-gradient(180deg,rgba(0,0,0,.06),transparent 20%,transparent 94%,rgba(0,0,0,.06));bottom:0;content:" ";left:0;position:absolute;right:0;top:0}.sidebar-left-section{background-color:var(--surface-color);box-shadow:0 1px 3px 0 var(--section-box-shadow-color);margin-bottom:.75rem;padding:.5rem 0!important}.sidebar-left-section.no-shadow{box-shadow:none!important}.sidebar-left-section-name{padding:.5rem 1rem}.sidebar-left-section-caption{font-size:var(--font-size-14);line-height:var(--line-height-14);margin:-.1875rem 0 1rem;padding:0 1.5rem}.sidebar-left-section-caption:first-child{margin-bottom:.8125rem;margin-top:.8125rem}@media only screen and (max-width:600px){.sidebar-left-section-caption{padding:0 1rem}}.sidebar-left-section-container{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sidebar-left-section-container a{cursor:pointer}hr{display:none!important}.tgico-admin:before,.tgico-fontsize:before{font-size:20px!important;padding:2px}.tgico-endcall_filled,.tgico-phone_filled{font-size:26px!important}.stealthy{left:0;margin:0;max-height:1px;max-width:1px;opacity:0;outline:none;overflow:hidden;pointer-events:none;position:absolute;top:0;z-index:-1}.navigable-list .active{background-color:var(--light-secondary-text-color);border-radius:inherit}.super-emojis{--esg-emoji-total-size:calc(var(--esg-emoji-size) + 0.5rem);--custom-emoji-size:var(--esg-emoji-size);grid-column-gap:2.44px;--esg-emoji-size:2.125rem;--esg-emoji-total-size:2.625rem;--custom-emoji-size:2.25rem;-moz-column-gap:2.44px;column-gap:2.44px;-moz-column-gap:.25rem;column-gap:.25rem;display:grid;font-size:var(--esg-emoji-size);grid-template-columns:repeat(auto-fill,var(--esg-emoji-total-size));justify-content:space-between;line-height:var(--esg-emoji-size);position:relative}.super-emojis .super-emoji{border-radius:8px;cursor:pointer;display:inline-block;height:var(--esg-emoji-total-size);line-height:inherit;margin-left:.0625rem;margin-right:.0625rem;padding:.25rem;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:var(--esg-emoji-total-size)}.super-emojis .super-emoji .emoji-placeholder{background-color:var(--light-secondary-text-color);border-radius:50%;height:1.75rem;left:7px;pointer-events:none;position:absolute;top:7px;width:1.75rem}body.animation-level-2 .super-emojis .super-emoji .emoji-placeholder{opacity:0;transition:opacity .2s ease-in-out}body.animation-level-2 .super-emojis .super-emoji img{opacity:1;transition:opacity .2s ease-in-out}.super-emojis .super-emoji .emoji{height:100%;margin:0;vertical-align:baseline;vertical-align:initial;width:100%}.super-emojis .super-emoji.active,html.no-touch .super-emojis .super-emoji:active,html.no-touch .super-emojis .super-emoji:hover{background-color:var(--light-secondary-text-color)}.super-emojis.not-local .super-emoji{padding:.1875rem}.super-emojis .super-emoji{margin:0}.super-emojis:not(.not-local) .super-emoji{overflow:hidden}html.native-emoji .super-emojis:not(.not-local) .super-emoji{padding-bottom:.3125rem;padding-top:.3125rem}.super-emojis .custom-emoji{display:block}.super-emojis .custom-emoji-renderer{z-index:1}.super-emojis .custom-emoji:before{content:none}.tgico-char:before{font-family:Roboto!important;font-weight:var(--font-weight-bold);text-align:center;width:1.5rem}.tgico-char.z:before{content:"Z"}.tgico-char.w:before{content:"W"}.sending-status:empty{display:none}.sending-status .tgico-sendingerror{color:var(--danger-color)}.sending-status-icon{line-height:1!important;position:absolute}.quick-reaction-title{align-items:center;display:flex}.quick-reaction-sticker{height:32px!important;margin:0 .5rem 0 0!important;position:relative!important;width:32px!important}.verified-icon-svg{height:1rem;width:1rem}.verified-icon-check{fill:#fff}.verified-icon-background{fill:var(--primary-color)}[dir=ltr] .emoji-status,[dir=ltr] .premium-icon,[dir=ltr] .verified-icon{margin-left:.125rem}[dir=rtl] .emoji-status,[dir=rtl] .premium-icon,[dir=rtl] .verified-icon{margin-right:.125rem}.emoji-status,.premium-icon,.verified-icon{align-items:center;display:flex;flex:0 0 auto;font-size:1rem;height:1.25rem;justify-content:center;width:1.25rem}[dir=ltr] .emoji-status{margin-left:.25rem}[dir=rtl] .emoji-status{margin-right:.25rem}.emoji-status{height:1.125rem;position:relative;width:1.125rem}.premium-icon{color:var(--primary-color);margin-top:-.0625rem}.badge-fake{border:1px solid var(--danger-color);border-radius:.185rem;color:var(--danger-color);flex:0 0 auto;font-size:.625rem;font-weight:var(--font-weight-bold);line-height:1!important;margin-left:.25rem;margin-right:.25rem;padding:.125rem .25rem}.peer-title.with-icons{align-items:center;display:flex;overflow:hidden}.peer-title-inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.limit-line{display:flex;font-weight:var(--font-weight-bold);height:2rem}.limit-line-free{color:#000}.limit-line-premium{color:#fff}.limit-line-free{background-color:#f1f3f5;border-bottom-left-radius:10px;border-top-left-radius:10px}.limit-line-premium{background:linear-gradient(84.4deg,#6c93ff -4.85%,#976fff 51.72%,#df69d1 110.7%);border-bottom-right-radius:10px;border-top-right-radius:10px}.limit-line-free,.limit-line-premium{align-items:center;display:flex;flex:1 1 0;justify-content:space-between;padding:0 .75rem}.movable-element{--size:.5rem;position:relative}.movable-element-resize-handler{position:absolute}.movable-element-resize-handler-side-n,.movable-element-resize-handler-side-s{cursor:row-resize;height:var(--size);left:0;right:0}.movable-element-resize-handler-side-e,.movable-element-resize-handler-side-w{bottom:0;cursor:col-resize;top:0;width:var(--size)}.movable-element-resize-handler-side-n{top:0}.movable-element-resize-handler-side-e{right:0}.movable-element-resize-handler-side-s{bottom:0}.movable-element-resize-handler-side-w{left:0}.movable-element-resize-handler-side-ne,.movable-element-resize-handler-side-nw,.movable-element-resize-handler-side-se,.movable-element-resize-handler-side-sw{height:var(--size);width:var(--size);z-index:1}.movable-element-resize-handler-side-ne,.movable-element-resize-handler-side-sw{cursor:nesw-resize}.movable-element-resize-handler-side-nw,.movable-element-resize-handler-side-se{cursor:nwse-resize}.movable-element-resize-handler-side-ne{right:0;top:0}.movable-element-resize-handler-side-se{bottom:0;right:0}.movable-element-resize-handler-side-sw{bottom:0;left:0}.movable-element-resize-handler-side-nw{left:0;top:0}[dir=ltr] .chatlist-chat.row-with-padding{padding-left:4.5rem!important}[dir=rtl] .chatlist-chat.row-with-padding{padding-right:4.5rem!important}.chatlist-chat span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chatlist-chat .row-title{font-size:var(--font-size-16)!important;line-height:1.375rem}.chatlist-chat .row-title-right-secondary{font-size:var(--font-size-12)!important;line-height:var(--line-height-12)!important;margin-top:-.4375rem}.chatlist-chat .row-subtitle{display:block!important}.chatlist-chat .row-row{height:1.375rem}.chatlist-chat.chatlist-chat-abitbigger .row-subtitle{margin-top:0}.chatlist-chat.chatlist-chat-bigger .row-subtitle{font-size:var(--font-size-16)!important;line-height:1.375rem;margin-top:0}.chatlist-chat.chatlist-chat-bigger .row-subtitle-row{margin-top:.125rem}.chatlist-chat.chatlist-chat-bigger .row-title .peer-title{font-weight:var(--font-weight-bold)}.username-purchase-help b{color:var(--danger-color)!important;font-weight:var(--font-weight-normal)!important}.media-spoiler-container{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0;z-index:1}.media-spoiler-container.is-revealing{opacity:1}.media-spoiler-container.is-revealing:not(.backwards){opacity:0}.media-spoiler-container.is-revealing.animating{transition:opacity var(--transition-standard-out)}.media-spoiler .canvas-thumbnail,.media-spoiler-thumbnail{height:100%;-o-object-fit:initial!important;object-fit:fill!important;position:absolute;width:100%}.accordion{height:0;overflow:hidden}.accordion.is-expanded{height:var(--max-height)}body.animation-level-2 .accordion{transition:height var(--transition-standard-in)}.accordion-icon{color:var(--secondary-text-color);display:inline-block;font-size:1.25rem;line-height:0;transform:rotate(0deg) translateY(4px)}body.animation-level-2 .accordion-icon{transition:transform var(--transition-standard-in)}.accordion-toggler-expanded .accordion-icon{transform:translateY(4px) rotate(180deg)} + +/*# sourceMappingURL=main.5760f7380bcaa29519f1.css.map*/ \ No newline at end of file diff --git a/public/main.5760f7380bcaa29519f1.css.map b/public/main.5760f7380bcaa29519f1.css.map new file mode 100644 index 00000000..9e77b0cb --- /dev/null +++ b/public/main.5760f7380bcaa29519f1.css.map @@ -0,0 +1 @@ +{"version":3,"file":"main.5760f7380bcaa29519f1.css","mappings":"AAAA,2EAA2E,CAAC,KAAK,yBAAyB,CAAC,6BAA6B,CAAC,gBAAgB,CAAC,KAAK,QAAQ,CAAC,wCAAwC,aAAa,CAAC,GAAG,aAAa,CAAC,cAAc,CAAC,uBAAuB,aAAa,CAAC,OAAO,eAAe,CAAC,GAAG,sBAAsB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,+BAA+B,CAAC,aAAa,CAAC,EAAE,oCAAoC,C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AAO,CAAC,KAAK,CAAC,wCAAwC,QAAQ,CAAC,OAAO,CAAC,wCAAwC,QAAQ,CAAC,MAAM,CAAC,wCAAwC,MAAM,CAAC,KAAK,CAAC,0CAA0C,6BAA6B,CAAC,0CAA0C,8BAA8B,CAAC,oBAAoB,eAAe,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,0BAA0B,uCAAuC,CAAC,oBAAoB,CAAC,0CAA0C,uCAAuC,CAAC,2CAA2C,CAAC,oBAAoB,CAAC,6BAA6B,uBAAuB,CAAC,wBAAwB,eAAe,CAAC,sDAAsD,YAAY,CAAC,kDAAkD,uCAAuC,CAAC,oBAAoB,CAAC,YAAY,CAAC,sDAAsD,kBAAkB,CAAC,2DAA2D,mCAAmC,CAAC,0BAA0B,mCAAmC,CAAC,+CAA+C,CAAC,yBAAyB,qBAAqB,CAAC,QAAQ,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,sCAAsC,SAAS,CAAC,sDAAsD,SAAS,CAAC,gDAAgD,iDAAiD,CAAC,0DAA0D,WAAW,CAAC,+BAA+B,CAAC,yBAAyB,CAAC,iBAAiB,CAAC,UAAU,CAAC,WAAW,QAAQ,CAAC,eAAe,CAAC,uBAAuB,wBAAwB,CAAC,kCAAkC,+CAA+C,CAAC,gBAAgB,iCAAiC,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,aAAa,CAAC,sCAAsC,CAAC,uCAAuC,kDAAkD,CAAC,4CAA4C,wCAAwC,C","sources":["webpack://tweb/./src/materialize.scss","webpack://tweb/./src/scss/style.scss"],"sourcesContent":["/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;line-height:1.15}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{-webkit-text-decoration-skip:objects;background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted currentColor;text-decoration:underline dotted currentColor}b,strong{font-weight:inherit;font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}[hidden],template{display:none}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}ul:not(.browser-default){list-style-type:none;padding-left:0}ul:not(.browser-default)>li{list-style-type:none}a{-webkit-tap-highlight-color:rgba(0,0,0,0)}button{background:none;border:none;cursor:pointer;outline:none;padding:0}img,video{-webkit-user-drag:none}.valign-wrapper{align-items:center;display:flex}.z-depth-0{box-shadow:none!important}.z-depth-1{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2)}.z-depth-1-half{box-shadow:0 3px 3px 0 rgba(0,0,0,.14),0 1px 7px 0 rgba(0,0,0,.12),0 3px 1px -1px rgba(0,0,0,.2)}.z-depth-2{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.3)}.z-depth-3{box-shadow:0 8px 17px 2px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.2)}.z-depth-4{box-shadow:0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12),0 8px 10px -7px rgba(0,0,0,.2)}.z-depth-5{box-shadow:0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12),0 11px 15px -7px rgba(0,0,0,.2)}.hide{display:none!important}.hide-overflow{overflow:hidden}.no-select{-webkit-user-select:none;-moz-user-select:none;user-select:none}.no-transition,.no-transition:after,.no-transition:before{transition:none!important}.inline{display:inline}.center-align,.text-center{text-align:center}.justify-start{justify-content:flex-start!important}.justify-self-start{justify-self:flex-start!important}.justify-self-end{justify-self:flex-end!important}.position-center{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.text-bold{font-weight:500!important}.text-super{display:inline-table}.text-uppercase{text-transform:uppercase}.pre-wrap{white-space:pre-wrap!important}.no-wrap{white-space:nowrap!important}.no-border-radius{border-radius:0!important}.disable-hover{pointer-events:none!important}.reflect-x{transform:scaleX(-1)}[dir=auto]{unicode-bidi:plaintext}.is-rtl [dir=auto]{direction:inherit}a{text-decoration:none}html{font-weight:400;line-height:1.5}h1,h2,h3,h4,h5,h6{line-height:1.3}em{font-style:italic}strong{font-weight:500}small{font-size:75%}code,pre{word-wrap:break-word;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap}",":root{--vh:1vh;--z-below:-1;--hover-alpha:0.08;--transition-standard-easing:cubic-bezier(.4,.0,.2,1);--transition-standard-in-time:.3s;--transition-standard-out-time:.25s;--transition-standard-in:var(--transition-standard-in-time) var(--transition-standard-easing);--transition-standard-out:var(--transition-standard-out-time) var(--transition-standard-easing);--pm-transition:.2s ease-in-out;--layer-transition:.2s cubic-bezier(.4,.0,.2,1);--slide-header-transition:.4s ease-in-out;--tabs-transition:.2s ease-in-out;--btn-menu-transition:.2s cubic-bezier(.4,0,.2,1);--esg-transition:var(--btn-menu-transition);--input-transition:.2s ease-out;--sticker-viewer-open-transition-in:.2s var(--transition-standard-easing);--sticker-viewer-open-transition-out:.2s var(--transition-standard-easing);--sticker-viewer-switch-transition:.2s cubic-bezier(.12,1.1,.56,1.2);--popup-transition-function:cubic-bezier(.4,0,.2,1);--popup-transition-time:.15s;--btn-corner-transition:.2s cubic-bezier(.34,1.56,.64,1);--chatlist-badge-transition-in:.25s cubic-bezier(.35,.35,.47,1.34);--chatlist-badge-transition-out:.25s cubic-bezier(.35,.35,.7,1);--message-handhelds-margin:5.5625rem;--message-beside-button-size:2.375rem;--message-beside-button-margin:calc((var(--message-beside-button-size) + 0.5rem)*-1);--message-time-background:rgba(0,0,0,.35);--message-highlightning-color:rgba(109,141,65,.4);--messages-container-width:728px;--messages-text-size:16px;--messages-line-height:1.3125;--messages-secondary-text-size:calc(var(--messages-text-size) - 2px);--messages-secondary-line-height:calc(var(--messages-secondary-text-size) + 4px);--messages-time-text-size:calc(var(--messages-text-size) - 4px);--messages-service-text-size:calc(var(--messages-text-size) - 1px);--messages-custom-emoji-size:calc(var(--messages-text-size) + 4px);--bubble-transition-in:transform var(--transition-standard-in),opacity var(--transition-standard-in);--bubble-transition-out:transform var(--transition-standard-out),opacity var(--transition-standard-out);--line-height-20:26px;--line-height-16:21px;--line-height-14:18px;--line-height-12:16px;--line-height:1.3125;--font-size-20:20px;--font-size-16:16px;--font-size-14:14px;--font-size-12:12px;--font-size:var(--font-size-16);--esg-sticker-size:72px;--esg-custom-emoji-size:36px;--popup-sticker-size:80px;--disabled-opacity:.3;--round-video-size:280px;--menu-box-shadow:0px 0px 10px var(--menu-box-shadow-color);--menu-backdrop-filter:blur(50px);--font-monospace:\"Roboto Mono\",monospace;--font-weight-bold:500;--font-weight-normal:400;--selection-background-color:rgba(var(--primary-color-rgb),.4);--selection-color:inherit;--topbar-floating-scaleX:1;--topbar-call-height:3rem;--topbar-floating-call-height:0px;--call-button-size:3.375rem;--call-button-margin:2rem;--custom-emoji-size:1.25rem;--esg-width:100%;--peer-avatar-red-top:#ff845e;--peer-avatar-red-bottom:#d45246;--peer-avatar-orange-top:#febb5b;--peer-avatar-orange-bottom:#f68136;--peer-avatar-violet-top:#b694f9;--peer-avatar-violet-bottom:#6c61df;--peer-avatar-green-top:#9ad164;--peer-avatar-green-bottom:#46ba43;--peer-avatar-cyan-top:#53edd6;--peer-avatar-cyan-bottom:#28c9b7;--peer-avatar-blue-top:#5bcbe3;--peer-avatar-blue-bottom:#359ad4;--peer-avatar-pink-top:#ff8aac;--peer-avatar-pink-bottom:#d95574;--peer-avatar-archive-top:#b8c2cc;--peer-avatar-archive-bottom:#9eaab5;--peer-avatar-saved-top:var(--light-filled-saved-color);--peer-avatar-saved-bottom:var(--saved-color);--avatar-color-top:var(--peer-avatar-saved-top);--avatar-color-bottom:var(--peer-avatar-saved-bottom);--avatar-border-radius-forum:37%;--premium-gradient:linear-gradient(52.62deg,#6b93ff 12.22%,#976fff 50.25%,#e46ace 98.83%)}@media only screen and (max-width:600px){:root{--right-column-width:100vw;--esg-sticker-size:68px;--popup-sticker-size:68px;--round-video-size:200px;--chat-input-size:2.875rem;--chat-input-padding:0.5rem;--chat-input-inner-padding:0.25rem}}@media only screen and (min-width:601px){:root{--right-column-width:420px;--chat-input-size:3.375rem;--chat-input-padding:0.8125rem;--chat-input-inner-padding:0.5rem}}@media only screen and (max-height:569px){:root{--chat-input-size:2.875rem;--chat-input-inner-padding:0.25rem}}@media only screen and (min-height:570px)and (min-width:601px){:root{--esg-width:23.875rem}}@media only screen and (min-width:1276px)and (max-width:1680px){:root{--right-column-width:25vw}}:root{--body-background-color:#fff;--background-color-true:#f4f4f5;--background-color:var(--background-color-true);--border-color:#dfe1e5;--scrollbar-color:rgba(0,0,0,.2);--section-box-shadow-color:rgba(0,0,0,.06);--menu-box-shadow-color:rgba(0,0,0,.15);--input-search-background-color:#fff;--input-search-border-color:#dfe1e5;--secondary-color:#c4c9cc;--avatar-online-color:var(--primary-color);--chatlist-status-color:var(--avatar-online-color);--chatlist-pinned-color:#a2abb2;--badge-text-color:#fff;--link-color:#00488f;--ripple-color:rgba(0,0,0,.08);--poll-circle-color:var(--border-color);--spoiler-background-color:#e3e5e8;--spoiler-draft-background-color:#d9d9d9;--monospace-text-color:var(--danger-color);--backdrop-opacity:.85;--menu-background-color:rgba(var(--surface-color-rgb),var(--backdrop-opacity));--message-background-color:var(--surface-color);--message-time-color:var(--secondary-text-color);--message-checkbox-color:#61c642;--message-checkbox-border-color:#fff;--message-primary-color:var(--primary-color);--light-filled-message-primary-color:var(--light-filled-primary-color);--message-secondary-color:var(--secondary-color);--message-error-color:var(--danger-color);--message-out-link-color:var(--link-color);--message-out-status-color:var(--message-out-primary-color);--message-out-time-color:var(--message-out-status-color);--message-out-audio-play-button-color:#fff;--message-out-selection-background-color:var(--selection-background-color);--gc-background-color:#212121;--gc-button-leave-color:rgba(255,89,90,.3);--gc-button-unmuted-color:rgba(1,200,80,.2);--gc-button-muted-color:rgba(60,135,247,.2);--gc-button-hand-color:rgba(223,68,184,.2);--gc-button-unmuted-fill-color:#195530;--gc-button-muted-fill-color:#3c87f7;--gc-green-color:#195530;--gc-blue-color:#3c87f7;--gc-red-color:#643333;--gc-primary-text-color:#fff;--gc-secondary-text-color:#aaa;--gc-green-text-color:#5cc85e;--gc-blue-text-color:#3390ec;--gc-red-text-color:#ff595a;--gc-right-column-width:26.25rem}.night{--body-background-color:#181818;--background-color-true:#181818;--background-color:var(--background-color-true);--border-color:#0f0f0f;--scrollbar-color:hsla(0,0%,100%,.2);--section-box-shadow-color:rgba(0,0,0,.12);--input-search-background-color:#181818;--input-search-border-color:#2f2f2f;--secondary-color:#707579;--avatar-online-color:var(--primary-color);--chatlist-status-color:var(--primary-color);--chatlist-pinned-color:var(--secondary-color);--badge-text-color:#fff;--link-color:var(--primary-color);--ripple-color:hsla(0,0%,100%,.08);--poll-circle-color:#fff;--spoiler-background-color:#373e4e;--spoiler-draft-background-color:#484848;--monospace-text-color:var(--primary-text-color);--menu-background-color:rgba(var(--surface-color-rgb),.75);--message-background-color:var(--surface-color);--message-time-color:var(--secondary-text-color);--message-checkbox-color:var(--primary-color);--message-checkbox-border-color:#fff;--message-secondary-color:var(--secondary-color);--message-error-color:#fff;--message-out-link-color:#fff;--message-out-status-color:#fff;--message-out-time-color:hsla(0,0%,100%,.6);--message-out-audio-play-button-color:var(--message-out-background-color);--message-out-selection-background-color:rgba(var(--surface-color-rgb),.4)}@font-face{font-display:block;font-family:tgico;font-style:normal;font-weight:400;src:url(assets/fonts/tgico.ttf?bv435t) format(\"truetype\"),url(assets/fonts/tgico.woff?bv435t) format(\"woff\"),url(assets/fonts/tgico.svg?bv435t#tgico) format(\"svg\")}.tgico:after,.tgico:before,[class*=\" tgico-\"]:after,[class*=\" tgico-\"]:before,[class^=tgico-]{speak:never;font-feature-settings:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:tgico!important;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none}.tgico-check:before{content:\"\"}.tgico-checks:before{content:\"\"}.tgico-activesessions:before{content:\"\"}.tgico-add:before{content:\"\"}.tgico-add_reaction:before{content:\"\"}.tgico-addmember_filled:before{content:\"\"}.tgico-adduser:before{content:\"\"}.tgico-admin:before{content:\"\"}.tgico-animals:before{content:\"\"}.tgico-animations:before{content:\"\"}.tgico-archive:before{content:\"\"}.tgico-arrow_down:before{content:\"\"}.tgico-arrow_next:before{content:\"\"}.tgico-attach:before{content:\"\"}.tgico-audio_repeat:before{content:\"\"}.tgico-audio_repeat_single:before{content:\"\"}.tgico-avatarnext:before{content:\"\"}.tgico-avatarprevious:before{content:\"\"}.tgico-binfilled:before{content:\"\"}.tgico-bold:before{content:\"\"}.tgico-botcom:before{content:\"\"}.tgico-bots:before{content:\"\"}.tgico-bug:before{content:\"\"}.tgico-calendar:before{content:\"\"}.tgico-calendarfilter:before{content:\"\"}.tgico-camera:before{content:\"\"}.tgico-cameraadd:before{content:\"\"}.tgico-car:before{content:\"\"}.tgico-card:before{content:\"\"}.tgico-card_outline:before{content:\"\"}.tgico-channel:before{content:\"\"}.tgico-channelviews:before{content:\"\"}.tgico-chatspinned:before{content:\"\"}.tgico-chatsplaceholder:before{content:\"\"}.tgico-check1:before{content:\"\"}.tgico-checkbox:before{content:\"\"}.tgico-checkboxblock:before{content:\"\"}.tgico-checkboxempty:before{content:\"\"}.tgico-checkboxon:before{content:\"\"}.tgico-checkretract:before{content:\"\"}.tgico-checkround:before{content:\"\"}.tgico-close:before{content:\"\"}.tgico-clouddownload:before{content:\"\"}.tgico-colorize:before{content:\"\"}.tgico-comments:before{content:\"\"}.tgico-commentssticker:before{content:\"\"}.tgico-copy:before{content:\"\"}.tgico-darkmode:before{content:\"\"}.tgico-data:before{content:\"\"}.tgico-delete:before{content:\"\"}.tgico-delete_filled:before{content:\"\"}.tgico-deletedaccount:before{content:\"\"}.tgico-deleteleft:before{content:\"\"}.tgico-deleteuser:before{content:\"\"}.tgico-devices:before{content:\"\"}.tgico-document:before{content:\"\"}.tgico-down:before{content:\"\"}.tgico-download:before{content:\"\"}.tgico-dragfiles:before{content:\"\"}.tgico-dragmedia:before{content:\"\"}.tgico-eats:before{content:\"\"}.tgico-edit:before{content:\"\"}.tgico-email:before{content:\"\"}.tgico-endcall_filled:before{content:\"\"}.tgico-enter:before{content:\"\"}.tgico-eye1:before{content:\"\"}.tgico-eye2:before{content:\"\"}.tgico-fast_forward:before{content:\"\"}.tgico-fast_rewind:before{content:\"\"}.tgico-favourites:before{content:\"\"}.tgico-flag:before{content:\"\"}.tgico-flip:before{content:\"\"}.tgico-folder:before{content:\"\"}.tgico-fontsize:before{content:\"\"}.tgico-forward:before{content:\"\"}.tgico-forward_filled:before{content:\"\"}.tgico-fullscreen:before{content:\"\"}.tgico-gc_microphone:before{content:\"\"}.tgico-gc_microphoneoff:before{content:\"\"}.tgico-gifs:before{content:\"\"}.tgico-gift:before{content:\"\"}.tgico-group:before{content:\"\"}.tgico-groupmedia:before{content:\"\"}.tgico-groupmediaoff:before{content:\"\"}.tgico-help:before{content:\"\"}.tgico-hide:before{content:\"\"}.tgico-image:before{content:\"\"}.tgico-info:before{content:\"\"}.tgico-info2:before{content:\"\"}.tgico-italic:before{content:\"\"}.tgico-keyboard:before{content:\"\"}.tgico-lamp:before{content:\"\"}.tgico-language:before{content:\"\"}.tgico-largepause:before{content:\"\"}.tgico-largeplay:before{content:\"\"}.tgico-left:before{content:\"\"}.tgico-limit_chat:before{content:\"\"}.tgico-limit_chats:before{content:\"\"}.tgico-limit_file:before{content:\"\"}.tgico-limit_folders:before{content:\"\"}.tgico-limit_link:before{content:\"\"}.tgico-limit_pin:before{content:\"\"}.tgico-link:before{content:\"\"}.tgico-listscreenshare:before{content:\"\"}.tgico-livelocation:before{content:\"\"}.tgico-location:before{content:\"\"}.tgico-lock:before{content:\"\"}.tgico-lockoff:before{content:\"\"}.tgico-loginlogodesktop:before{content:\"\"}.tgico-loginlogomobile:before{content:\"\"}.tgico-logout:before{content:\"\"}.tgico-mediaspoiler:before{content:\"\"}.tgico-mediaspoileroff:before{content:\"\"}.tgico-mention:before{content:\"\"}.tgico-menu:before{content:\"\"}.tgico-message:before{content:\"\"}.tgico-messageunread:before{content:\"\"}.tgico-microphone:before{content:\"\"}.tgico-microphone_crossed:before{content:\"\"}.tgico-microphone_crossed_filled:before{content:\"\"}.tgico-microphone_filled:before{content:\"\"}.tgico-minus:before{content:\"\"}.tgico-monospace:before{content:\"\"}.tgico-more:before{content:\"\"}.tgico-mute:before{content:\"\"}.tgico-muted:before{content:\"\"}.tgico-newchannel:before{content:\"\"}.tgico-newchat_filled:before{content:\"\"}.tgico-newgroup:before{content:\"\"}.tgico-newprivate:before{content:\"\"}.tgico-next:before{content:\"\"}.tgico-noncontacts:before{content:\"\"}.tgico-nosound:before{content:\"\"}.tgico-passwordoff:before{content:\"\"}.tgico-pause:before{content:\"\"}.tgico-permissions:before{content:\"\"}.tgico-phone:before{content:\"\"}.tgico-pin:before{content:\"\"}.tgico-pinlist:before{content:\"\"}.tgico-pinned_filled:before{content:\"\"}.tgico-pinnedchat:before{content:\"\"}.tgico-pip:before{content:\"\"}.tgico-play:before{content:\"\"}.tgico-playback_05:before{content:\"\"}.tgico-playback_15:before{content:\"\"}.tgico-playback_1x:before{content:\"\"}.tgico-playback_2x:before{content:\"\"}.tgico-plus:before{content:\"\"}.tgico-poll:before{content:\"\"}.tgico-premium_addone:before{content:\"\"}.tgico-premium_double:before{content:\"\"}.tgico-premium_lock:before{content:\"\"}.tgico-premium_unlock:before{content:\"\"}.tgico-previous:before{content:\"\"}.tgico-radiooff:before{content:\"\"}.tgico-radioon:before{content:\"\"}.tgico-reactions:before{content:\"\"}.tgico-readchats:before{content:\"\"}.tgico-recent:before{content:\"\"}.tgico-replace:before{content:\"\"}.tgico-reply:before{content:\"\"}.tgico-reply_filled:before{content:\"\"}.tgico-rightpanel:before{content:\"\"}.tgico-rotate_left:before{content:\"\"}.tgico-rotate_right:before{content:\"\"}.tgico-saved:before{content:\"\"}.tgico-savedmessages:before{content:\"\"}.tgico-schedule:before{content:\"\"}.tgico-scheduled:before{content:\"\"}.tgico-search:before{content:\"\"}.tgico-select:before{content:\"\"}.tgico-send:before{content:\"\"}.tgico-send2:before{content:\"\"}.tgico-sending:before{content:\"\"}.tgico-sendingerror:before{content:\"\"}.tgico-settings:before{content:\"\"}.tgico-settings_filled:before{content:\"\"}.tgico-sharescreen_filled:before{content:\"\"}.tgico-shipping:before{content:\"\"}.tgico-shuffle:before{content:\"\"}.tgico-smallscreen:before{content:\"\"}.tgico-smile:before{content:\"\"}.tgico-spoiler:before{content:\"\"}.tgico-sport:before{content:\"\"}.tgico-star:before{content:\"\"}.tgico-stickers:before{content:\"\"}.tgico-stickers_face:before{content:\"\"}.tgico-stop:before{content:\"\"}.tgico-strikethrough:before{content:\"\"}.tgico-textedit:before{content:\"\"}.tgico-tip:before{content:\"\"}.tgico-tools:before{content:\"\"}.tgico-topics:before{content:\"\"}.tgico-transcribe:before{content:\"\"}.tgico-unarchive:before{content:\"\"}.tgico-underline:before{content:\"\"}.tgico-unmute:before{content:\"\"}.tgico-unpin:before{content:\"\"}.tgico-unread:before{content:\"\"}.tgico-up:before{content:\"\"}.tgico-user:before{content:\"\"}.tgico-username:before{content:\"\"}.tgico-videocamera:before{content:\"\"}.tgico-videocamera_crossed_filled:before{content:\"\"}.tgico-videocamera_filled:before{content:\"\"}.tgico-videochat:before{content:\"\"}.tgico-volume_down:before{content:\"\"}.tgico-volume_mute:before{content:\"\"}.tgico-volume_off:before{content:\"\"}.tgico-volume_up:before{content:\"\"}.tgico-zoomin:before{content:\"\"}.tgico-zoomout:before{content:\"\"}.tgico-phone_filled:before{content:\"\";transform:rotate(-135deg)}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:400;src:local(\"Roboto\"),local(\"Roboto-Regular\"),url(assets/fonts/KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2) format(\"woff2\");unicode-range:U400-45F,U490-491,U4B0-4B1,U2116}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:400;src:local(\"Roboto\"),local(\"Roboto-Regular\"),url(assets/fonts/KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2) format(\"woff2\");unicode-range:U100-24F,U259,U1-1EFF,U2020,U20A0-20AB,U20AD-20CF,U2113,U2C60-2C7F,UA720-A7FF}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:400;src:local(\"Roboto\"),local(\"Roboto-Regular\"),url(assets/fonts/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2) format(\"woff2\");unicode-range:U0-0FF,U131,U152-153,U2BB-2BC,U2C6,U2DA,U2DC,U2000-206F,U2074,U20AC,U2122,U2191,U2193,U2212,U2215,UFEFF,UFFFD}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:500;src:local(\"Roboto Medium\"),local(\"Roboto-Medium\"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2) format(\"woff2\");unicode-range:U400-45F,U490-491,U4B0-4B1,U2116}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:500;src:local(\"Roboto Medium\"),local(\"Roboto-Medium\"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2) format(\"woff2\");unicode-range:U100-24F,U259,U1-1EFF,U2020,U20A0-20AB,U20AD-20CF,U2113,U2C60-2C7F,UA720-A7FF}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:500;src:local(\"Roboto Medium\"),local(\"Roboto-Medium\"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2) format(\"woff2\");unicode-range:U0-0FF,U131,U152-153,U2BB-2BC,U2C6,U2DA,U2DC,U2000-206F,U2074,U20AC,U2122,U2191,U2193,U2212,U2215,UFEFF,UFFFD}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:600;src:local(\"Roboto Medium\"),local(\"Roboto-Medium\"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2) format(\"woff2\");unicode-range:U400-45F,U490-491,U4B0-4B1,U2116}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:600;src:local(\"Roboto Medium\"),local(\"Roboto-Medium\"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2) format(\"woff2\");unicode-range:U100-24F,U259,U1-1EFF,U2020,U20A0-20AB,U20AD-20CF,U2113,U2C60-2C7F,UA720-A7FF}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:600;src:local(\"Roboto Medium\"),local(\"Roboto-Medium\"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2) format(\"woff2\");unicode-range:U0-0FF,U131,U152-153,U2BB-2BC,U2C6,U2DA,U2DC,U2000-206F,U2074,U20AC,U2122,U2191,U2193,U2212,U2215,UFEFF,UFFFD}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEluUlco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEn-Ulco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEmOUlco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtElOUlco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+1ea0-1ef9,u+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEleUlco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0100-024f,u+0259,u+1e??,u+2020,u+20a0-20ab,u+20ad-20cf,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEm-Ulco8VkA.woff2) format(\"woff2\");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEluUlco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEn-Ulco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEmOUlco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtElOUlco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+1ea0-1ef9,u+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEleUlco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0100-024f,u+0259,u+1e??,u+2020,u+20a0-20ab,u+20ad-20cf,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEm-Ulco8VkA.woff2) format(\"woff2\");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSV0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSx0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSt0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSd0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+1ea0-1ef9,u+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSZ0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0100-024f,u+0259,u+1e??,u+2020,u+20a0-20ab,u+20ad-20cf,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0me8iUI0.woff2) format(\"woff2\");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSV0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSx0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSt0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSd0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+1ea0-1ef9,u+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSZ0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0100-024f,u+0259,u+1e??,u+2020,u+20a0-20ab,u+20ad-20cf,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0me8iUI0.woff2) format(\"woff2\");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}.input-wrapper{margin:0 auto;width:360px}.input-field{--height:54px;--border-radius:10px;position:relative}@media only screen and (max-width:600px){.input-field{--height:50px}}.input-field .arrow-down{border:solid var(--secondary-text-color);border-radius:1px;border-width:0 2px 2px 0;bottom:0;content:\" \";cursor:pointer;display:inline-block;height:0;margin-top:-9px;padding:5px;position:absolute;right:21px;top:50%;transform:rotate(45deg);-webkit-transform:rotate(45deg);transition:all .2s;vertical-align:middle;width:0;z-index:2}[dir=ltr] .input-field label{left:1rem}[dir=rtl] .input-field label{right:1rem}.input-field label{background-color:var(--surface-color);color:#9e9e9e;height:1.5rem;margin-top:calc((var(--height) - 1.5rem)/2);pointer-events:none;position:absolute;right:auto;top:0;transform:translate(0);transform-origin:left center;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;z-index:2}.is-rtl .input-field label{transform-origin:right center}body.animation-level-2 .input-field label{transition:transform .2s,padding .2s,opacity .1s,font-weight 0s .1s}.input-field-border{border:2px solid var(--primary-color);border-radius:var(--border-radius);bottom:0;left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0;z-index:1}body.animation-level-2 .input-field-border{transition:opacity .2s}.input-field-icon{border-radius:.375rem;height:1.5rem;pointer-events:none;position:absolute;right:1rem;top:50%;transform:translateY(-50%);width:1.5rem;z-index:1}.input-field-input{--padding:1rem;--padding-horizontal:1rem;--border-width:1px;background-color:var(--surface-color);border:var(--border-width) solid var(--input-search-border-color);border-radius:var(--border-radius);box-sizing:border-box;line-height:var(--line-height);min-height:var(--height);padding:calc(var(--padding) - var(--border-width)) calc(var(--padding-horizontal) - var(--border-width));position:relative;transition:border-color 0s;width:100%;z-index:1}.input-field-input:-webkit-autofill,.input-field-input:-webkit-autofill:active,.input-field-input:-webkit-autofill:focus,.input-field-input:-webkit-autofill:hover{-webkit-box-shadow:0 0 0 1000px var(--surface-color) inset}.input-field-input:-webkit-autofill,.input-field-input:-webkit-autofill:active,.input-field-input:-webkit-autofill:first-line,.input-field-input:-webkit-autofill:focus,.input-field-input:-webkit-autofill:hover{color:var(--primary-text-color)!important;font-family:Roboto,-apple-system,apple color emoji,BlinkMacSystemFont,Segoe UI,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif!important;font-size:1rem!important}@media only screen and (max-width:600px){.input-field-input{--padding:.9375rem;--padding-horizontal:.9375rem}}body.animation-level-0 .input-field-input{transition:none!important}html.no-touch .input-field-input:active:not(:focus):not(.error):not(.valid),html.no-touch .input-field-input:hover:not(:focus):not(.error):not(.valid){border-color:var(--primary-color);transition:border-color .2s}html.no-touch .input-field-input:active:not(:focus):not(.error):not(.valid)~label,html.no-touch .input-field-input:hover:not(:focus):not(.error):not(.valid)~label{color:var(--primary-color)}.input-field-input:focus{border-color:var(--primary-color)}.input-field-input.error{border-color:var(--danger-color)}.input-field-input.error~label{color:var(--danger-color)!important}.input-field-input.error~.input-field-border{border-color:var(--danger-color)!important}.input-field-input.valid{border-color:#26962f}.input-field-input.valid~label{color:#26962f!important}.input-field-input.valid~.input-field-border{border-color:#26962f!important}.input-field-input:focus~.arrow-down{border-color:var(--primary-color);margin-top:-4px;transform:rotate(225deg)}.input-field-input:focus~label{color:var(--primary-color);font-weight:var(--font-weight-bold)}.input-field-input:focus~.input-field-border{opacity:1}.input-field-input:disabled~label,.input-field-input:focus~label,.input-field-input:not(:empty)~label,.input-field-input:valid~label{opacity:1;padding:0 .3125rem;transform:translate(-.1875rem,calc(var(--height)/-2 + .0625rem)) scale(.75)}.input-field-input-fake{bottom:auto!important;height:auto!important;left:0;opacity:0;pointer-events:none;position:absolute!important;right:auto!important;top:0;z-index:-3}.input-fields-row{display:flex}.input-fields-row .input-field{flex:1 1 auto;width:1%}.input-wrapper>*+*{margin-top:1.5rem}::-moz-placeholder{color:#909192;opacity:1}::placeholder{color:#909192;opacity:1}:-ms-input-placeholder{color:#909192}::-ms-input-placeholder{color:#909192}button:focus,input:focus{outline:none}.input-clear{border:none;outline:none;padding:0}body.animation-level-0 .input-clear.error{color:var(--danger-color)!important}body:not(.animation-level-0) .input-clear.error{animation:input-shake .2s ease-in-out forwards}@keyframes input-shake{0%{transform:translateX(0)}25%{transform:translateX(-.5rem)}75%{transform:translateX(.5rem)}to{transform:translateX(0)}}.input-search{--border-radius:22px;margin-left:.4375rem;margin-right:.4375rem;overflow:hidden;position:relative;width:100%}@media only screen and (max-width:600px){[dir=ltr] .input-search{margin-left:1rem}[dir=rtl] .input-search{margin-right:1rem}}.input-search-input{--height:42px;background-color:var(--input-search-background-color);border-color:var(--input-search-border-color);height:var(--height);line-height:var(--height);max-height:var(--height)!important;min-height:var(--height)!important;padding:0 calc(var(--height) + 3px - var(--border-width))}body.animation-level-2 .input-search-input{transition:border-color .2s ease-in-out}html.no-touch .input-search-input:active:not(:focus),html.no-touch .input-search-input:hover:not(:focus){border-color:var(--secondary-color)!important}.input-search-input:focus{background-color:transparent;border-color:var(--primary-color)}.input-search-input:focus~.tgico{color:var(--primary-color);opacity:1}html.no-touch .input-search-input:focus~.btn-icon:active,html.no-touch .input-search-input:focus~.btn-icon:hover{background-color:var(--light-primary-color)}.input-search-input:-moz-placeholder-shown~.tgico-close{display:none}.input-search-input:placeholder-shown~.tgico-close{display:none}.input-search>.tgico{color:var(--secondary-text-color);font-size:1.5rem;line-height:1;opacity:.6;position:absolute;text-align:center;top:50%;transform:translateY(-50%);z-index:1}body.animation-level-2 .input-search>.tgico{transition:opacity .2s ease-out,color .2s ease-out}[dir=ltr] .input-search>.tgico-search{left:.8125rem}[dir=rtl] .input-search>.tgico-search{right:.8125rem}.input-search>.tgico-search{height:1.5rem;pointer-events:none;width:1.5rem}[dir=ltr] .input-search>.tgico-close{right:0}[dir=rtl] .input-search>.tgico-close{left:0}.input-search>.tgico-close{height:42px;width:42px;z-index:1}[dir=ltr] .input-search>.tgico-close:before{margin-right:-1px}[dir=rtl] .input-search>.tgico-close:before{margin-left:-1px}[dir=ltr] .input-field-password .input-field-input{padding-right:2.5rem}[dir=rtl] .input-field-password .input-field-input{padding-left:2.5rem}.input-field-password .input-field-input{max-height:var(--height)}.input-field-password .input-field-input[type=password]{font-family:Arial,Helvetica,sans-serif;font-size:2.25rem;line-height:1;padding-bottom:0;padding-left:calc(.875rem - var(--border-width));padding-top:0}@media(-webkit-min-device-pixel-ratio:2){.input-field-password .input-field-input[type=password]{font-size:1.75rem;letter-spacing:.125rem}}html.is-ios .input-field-password .input-field-input[type=password]{font-size:1rem}.input-field-password .toggle-visible{align-items:center;color:#9e9e9e;cursor:pointer;display:flex;font-size:1.5rem;justify-content:center;padding:.5rem;position:absolute;right:.375rem;top:50%;transform:translateY(-50%);transition:color .2s;z-index:2}.input-field-password .toggle-visible:before{content:\"\"}.input-field-password .toggle-visible.eye-hidden:before{content:\"\"}html.no-touch .input-field-password .toggle-visible:active,html.no-touch .input-field-password .toggle-visible:hover{color:var(--primary-text-color)}.input-field-phone .input-field-input{--letter-spacing:.24px}.input-field-phone .input-field-input:after{color:#9e9e9e;content:attr(data-left-pattern);letter-spacing:var(--letter-spacing)}.btn,.btn-icon{background:none;border:none;cursor:pointer;outline:none}body.animation-level-0 .btn,body.animation-level-0 .btn-icon{transition:none}html.no-touch .btn-icon:active,html.no-touch .btn-icon:hover,html.no-touch .btn:active,html.no-touch .btn:hover{background-color:var(--light-secondary-text-color)}html.no-touch .btn-icon.active:active,html.no-touch .btn-icon.active:hover,html.no-touch .btn-icon.blue:active,html.no-touch .btn-icon.blue:hover,html.no-touch .btn-icon.primary:active,html.no-touch .btn-icon.primary:hover,html.no-touch .btn.active:active,html.no-touch .btn.active:hover,html.no-touch .btn.blue:active,html.no-touch .btn.blue:hover,html.no-touch .btn.primary:active,html.no-touch .btn.primary:hover{background-color:var(--light-primary-color)}html.no-touch .btn-icon.danger:active,html.no-touch .btn-icon.danger:hover,html.no-touch .btn.danger:active,html.no-touch .btn.danger:hover{background-color:var(--light-danger-color)}.btn-icon:disabled,.btn:disabled{opacity:var(--disabled-opacity);pointer-events:none!important}.btn-icon{align-items:center;background-color:transparent;border:none;border-radius:50%!important;color:var(--secondary-text-color);display:flex;font-size:1.5rem;justify-content:center;line-height:1;padding:.5rem;position:relative;text-align:center;transition:color .15s ease-in-out,opacity .15s ease-in-out}.btn-icon.rp{overflow:hidden}.btn-icon.active{color:var(--primary-color)}[dir=ltr] .btn-corner{right:var(--offset)}[dir=rtl] .btn-corner{left:var(--offset)}.btn-corner{--offset:1.25rem;--translateY:calc(54px + var(--offset));align-items:center;background-color:var(--primary-color);border:none;bottom:var(--offset);box-shadow:none!important;color:#fff;cursor:pointer;display:flex;font-size:1.5rem;justify-content:center;outline:none;padding:0!important;position:absolute!important;text-align:center;transform:translate3d(0,var(--translateY),0);transition:transform var(--btn-corner-transition)!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:3}html.no-touch .btn-corner:active,html.no-touch .btn-corner:hover{background-color:var(--dark-primary-color)}.btn-corner.is-visible{--translateY:0}body.animation-level-0 .btn-corner{transition:none!important}.btn-corner:disabled{opacity:1!important;pointer-events:all!important}.btn-corner .preloader-circular{height:2.5rem;width:2.5rem}.btn-menu{-webkit-touch-callout:none;-webkit-backdrop-filter:var(--menu-backdrop-filter);backdrop-filter:var(--menu-backdrop-filter);background-color:var(--menu-background-color);border-radius:10px;font-size:1rem;min-width:11.25rem;opacity:0;padding:.3125rem 0;position:absolute;top:100%;transform:scale(.8)!important;transition:opacity var(--btn-menu-transition),transform var(--btn-menu-transition),visibility var(--btn-menu-transition);-webkit-user-select:none;visibility:hidden;z-index:4}.btn-menu-old,.is-mobile .btn-menu{-webkit-backdrop-filter:none;backdrop-filter:none;background-color:var(--surface-color);min-width:auto;padding:.5rem 0}.btn-menu-old .btn-menu-item,.is-mobile .btn-menu .btn-menu-item{--padding-left:1rem;--padding-right:2.5rem;--icon-margin:1.5rem;--icon-size:1.5rem;border-radius:0;font-size:var(--font-size-16);font-weight:400;height:3rem;line-height:var(--line-height-16);margin:0;transform:none!important}.btn-menu-old .btn-menu-item:before,.is-mobile .btn-menu .btn-menu-item:before{align-self:auto;color:var(--secondary-text-color);margin-top:0}.btn-menu-old .btn-menu-footer,.is-mobile .btn-menu .btn-menu-footer{background-color:var(--background-color)}.btn-menu{box-shadow:var(--menu-box-shadow)}body.animation-level-0 .btn-menu{transition:none}.btn-menu.active{opacity:1;visibility:visible}.btn-menu.active,.is-mobile .btn-menu.was-open{transform:scaleX(1)!important}.btn-menu.bottom-left,.is-rtl .btn-menu.bottom-right{left:auto;right:0;top:100%;transform-origin:top right}.btn-menu.bottom-right,.is-rtl .btn-menu.bottom-left{left:0;right:auto;top:100%;transform-origin:top left}.btn-menu.bottom-center{transform-origin:top center}.btn-menu.top-left{bottom:100%;left:auto;right:0;top:auto;transform-origin:bottom right}.btn-menu.top-right,.is-rtl .btn-menu.top-left{bottom:100%;left:0;right:auto;top:auto;transform-origin:bottom left}.btn-menu.top-center{transform-origin:bottom center}.btn-menu.center-left{transform-origin:center right}.btn-menu.center-right{transform-origin:center left}[dir=ltr] .btn-menu-item{text-align:left}[dir=rtl] .btn-menu-item{text-align:right}.btn-menu-item{--padding-vertical:.25rem;--padding-left:.75rem;--padding-right:.75rem;--icon-margin:1.25rem;--icon-size:1.25rem;align-items:center;border-radius:.3125rem;color:var(--primary-text-color);cursor:pointer!important;display:flex;font-size:var(--font-size-14);font-weight:500;height:2rem;line-height:var(--line-height-14);margin-left:.3125rem;margin-right:.3125rem;padding:var(--padding-vertical) var(--padding-right) var(--padding-vertical) var(--padding-left);pointer-events:all!important;position:relative;text-transform:none;transform:scale(1);white-space:nowrap}.btn-menu-item.tgico-char:before{width:var(--icon-size)}body.animation-level-2 .btn-menu-item{transition:transform var(--btn-menu-transition)}.btn-menu-item:active{transform:scale(.96)}html.no-touch .btn-menu-item:active,html.no-touch .btn-menu-item:hover{background-color:var(--light-secondary-text-color)}html.no-touch .btn-menu-item.danger:active,html.no-touch .btn-menu-item.danger:hover{background-color:var(--light-danger-color)}.btn-menu-item:before{align-self:flex-start;color:var(--primary-text-color);font-size:var(--icon-size);margin-top:.125rem}[dir=ltr] .btn-menu-item-icon,[dir=ltr] .btn-menu-item:before{margin-right:var(--icon-margin)}[dir=rtl] .btn-menu-item-icon,[dir=rtl] .btn-menu-item:before{margin-left:var(--icon-margin)}.btn-menu-item-icon,.btn-menu-item:before{position:relative}[dir=ltr] .btn-menu-item-icon{margin-right:calc(var(--icon-margin) - var(--add)/2)}[dir=rtl] .btn-menu-item-icon{margin-left:calc(var(--icon-margin) - var(--add)/2)}[dir=ltr] .btn-menu-item-icon{margin-left:calc(var(--add)/-2)}[dir=rtl] .btn-menu-item-icon{margin-right:calc(var(--add)/-2)}.btn-menu-item-icon{--add:.25rem;--total:calc(var(--icon-size) + var(--add));flex:0 0 auto;height:var(--total);width:var(--total)}.btn-menu-item-icon .media-photo{height:inherit;width:inherit}@media only screen and (max-width:600px){.btn-menu-item{--padding-right:1.875rem}}.btn-menu-item-text{flex:1 1 auto;position:relative}.btn-menu-item-text,.btn-menu-item-text-fake{pointer-events:none}[dir=ltr] .btn-menu-item-text-fake{margin-left:var(--margin-left)}[dir=rtl] .btn-menu-item-text-fake{margin-right:var(--margin-left)}.btn-menu-item-text-fake{--margin-left:calc(var(--icon-size) + var(--icon-margin));max-width:calc(100% - var(--margin-left) - var(--padding-left) - var(--padding-right));overflow:hidden;position:absolute;text-overflow:ellipsis;white-space:nowrap}.btn-menu-item-subtitle{color:var(--secondary-text-color);font-size:.875rem}.btn-menu-item-header{color:var(--secondary-text-color);font-weight:var(--font-weight-bold);height:2rem;pointer-events:none!important}[dir=ltr] .btn-menu-item .stacked-avatars{right:.5rem}[dir=rtl] .btn-menu-item .stacked-avatars{left:.5rem}.btn-menu-item .stacked-avatars{--margin-right:-.6875rem;flex:0 0 auto;pointer-events:none;position:absolute}.btn-menu-item.is-multiline{font-size:.75rem;height:auto;max-width:16.25rem;min-width:calc(100% - .625rem);width:-moz-fit-content;width:fit-content}.btn-menu-item.is-multiline .btn-menu-item-text{white-space:pre-wrap;width:-moz-fit-content;width:fit-content}.btn-menu-item .checkbox-field-toggle{padding:0}.btn-menu-overlay{bottom:0;bottom:-100vh;cursor:default;left:0;left:-100vw;max-width:none!important;position:fixed!important;right:0;right:-100vw;top:0;top:-100vh;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important;z-index:4}.btn-menu.has-footer{padding-bottom:0}.btn-menu-footer{align-items:center;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;color:currentColor;display:flex;font-size:.875rem;height:2.5rem;justify-content:center}.btn-menu hr{display:block!important;margin:.3125rem auto;opacity:.6;padding:0;width:calc(100% - 1.875rem)}html:not(.is-mobile) .btn-menu .badge{background-color:transparent;color:var(--secondary-text-color)}.btn-menu-reactions{--inner-shadow-degree:90deg;-webkit-backdrop-filter:var(--menu-backdrop-filter);backdrop-filter:var(--menu-backdrop-filter);background-color:var(--menu-background-color);border-radius:var(--height);filter:drop-shadow(0 .125rem .5rem rgba(0,0,0,.24));height:inherit;max-height:100%;max-width:100%;opacity:0;position:absolute;transform:scale(.8);transform-origin:bottom left}[dir=ltr] .btn-menu-reactions-container{margin-left:var(--other-side-offset)}[dir=rtl] .btn-menu-reactions-container{margin-right:var(--other-side-offset)}.btn-menu-reactions-container{--height:2.25rem;--bubble-side-offset:0rem;--other-side-offset:0rem;--menu-offset:calc((var(--height) + 0.5rem)*-1);--width:calc(var(--menu-width) + (var(--bubble-side-offset) + var(--other-side-offset))*-1);display:flex;height:var(--height);justify-content:flex-start;margin-top:var(--menu-offset);max-width:var(--width);position:fixed;width:var(--width);z-index:4}.contextmenu.bottom-left+.btn-menu-reactions-container .btn-menu-reactions,.contextmenu.center-left+.btn-menu-reactions-container .btn-menu-reactions{transform-origin:bottom right!important}.contextmenu.bottom-center+.btn-menu-reactions-container .btn-menu-reactions{transform-origin:bottom center!important}[dir=ltr] .btn-menu-reactions-container-vertical{margin-left:var(--menu-offset)}[dir=rtl] .btn-menu-reactions-container-vertical{margin-right:var(--menu-offset)}.btn-menu-reactions-container-vertical{flex-direction:column;height:var(--width);margin-top:0;max-height:var(--width);max-width:var(--height);width:var(--height)}.btn-menu-reactions-container-vertical .btn-menu-reactions{--inner-shadow-degree:180deg;display:flex;flex-direction:column;height:auto;transform-origin:top right;width:inherit}.btn-menu-reactions-container-vertical .btn-menu-reactions-reaction{--padding-vertical:var(--padding-base);--padding-horizontal:0rem}.btn-menu-reactions-container-vertical .btn-menu-reactions-bubble-big{bottom:var(--offset);right:calc(var(--size)/-2)}body.animation-level-2 .btn-menu-reactions{transition:opacity var(--transition-standard-in),transform var(--transition-standard-in)}.btn-menu-reactions.is-visible{opacity:1;transform:scale(1)}.btn-menu-reactions-bubble{background-color:inherit;border-radius:50%;position:absolute;z-index:-1}.btn-menu-reactions-bubble-big{--size:1rem;--offset:calc(var(--height)/2);bottom:calc(var(--size)/-2);height:var(--size);right:var(--offset);width:var(--size)}.btn-menu-reactions:after{background:linear-gradient(var(--inner-shadow-degree),var(--surface-color) 0,rgba(var(--surface-color-rgb),0) 1rem,rgba(var(--surface-color-rgb),0) calc(100% - 1rem),var(--surface-color) 100%);border-radius:inherit;bottom:0;content:\" \";left:0;pointer-events:none;position:absolute;right:0;top:0}.btn-menu-reactions .scrollable{border-radius:inherit;display:flex;position:relative}.btn-menu-reactions .scrollable-x{align-items:center;padding:0 .25rem}.btn-menu-reactions .scrollable-y{align-items:center;flex-direction:column;padding:.25rem 0}.btn-menu-reactions-reaction{--size:1.625rem;--padding-base:.25rem;--padding-vertical:0rem;--padding-horizontal:var(--padding-base);cursor:pointer;flex:0 0 auto;height:calc(var(--size) + var(--padding-vertical)*2);padding:var(--padding-vertical) var(--padding-horizontal);width:calc(var(--size) + var(--padding-horizontal)*2)}.btn-menu-reactions-reaction-scale{height:100%;width:100%}html:not(.is-safari) .btn-menu-reactions-reaction-scale{transform:scale(1)}html:not(.is-safari) body.animation-level-2 .btn-menu-reactions-reaction-scale{transition:transform .1s linear}html.no-touch:not(.is-safari) .btn-menu-reactions-reaction-select{transform:scale(1)}html.no-touch:not(.is-safari) .btn-menu-reactions-reaction-select:active,html.no-touch:not(.is-safari) .btn-menu-reactions-reaction-select:hover{transform:scale(1.25)}html.no-touch:not(.is-safari) body.animation-level-2 .btn-menu-reactions-reaction-select{transition:transform var(--transition-standard-in)}.btn-menu-reactions-reaction .media-sticker-wrapper{height:100%;position:relative;width:100%}.btn-primary{border:none;border-radius:10px;cursor:pointer;font-weight:var(--font-weight-bold);height:54px;overflow:hidden;padding:0;position:relative;text-align:center;transition:opacity .2s;width:100%}html.no-touch .btn-primary:active,html.no-touch .btn-primary:hover{background:var(--dark-primary-color);transition:opacity .2s}.btn-primary-transparent{background-color:transparent;color:var(--primary-color)}html.no-touch .btn-primary-transparent:active,html.no-touch .btn-primary-transparent:hover{background:var(--light-primary-color)}.btn-primary-transparent .c-ripple__circle{background-color:var(--light-primary-color)}html.no-touch .btn-primary-transparent.danger:active,html.no-touch .btn-primary-transparent.danger:hover{background-color:var(--light-danger-color)}.btn-primary-transparent .preloader-circular .preloader-path{stroke:var(--primary-color)}body.animation-level-0 .btn-primary{transition:none}[dir=ltr] .btn-primary use,[dir=ltr] .btn-primary>svg{right:15px}[dir=rtl] .btn-primary use,[dir=rtl] .btn-primary>svg{left:15px}.btn-primary use,.btn-primary>svg{height:calc(100% - 20px);left:auto}.btn-primary:disabled{opacity:var(--disabled-opacity);pointer-events:none!important}.btn-primary.shimmer:before{animation:wave 2s cubic-bezier(.4,0,.6,1) infinite;background:linear-gradient(to right,transparent 0,rgba(var(--surface-color-rgb),.2) 50%,transparent 100%);content:\"\";display:block;height:100%;position:absolute;top:0;width:100%}@keyframes wave{0%{transform:translateX(-100%)}50%{transform:translateX(100%)}to{transform:translateX(100%)}}[dir=ltr] .btn-control{padding-left:.75rem;padding-right:1.5rem}[dir=rtl] .btn-control{padding-left:1.5rem;padding-right:.75rem}.btn-control{align-items:center;border-radius:1.25rem;display:flex;height:2.5rem;line-height:2.5rem;margin:.9375rem auto 1rem;width:auto}[dir=ltr] .btn-control.tgico:before{margin-right:.375rem}[dir=rtl] .btn-control.tgico:before{margin-left:.375rem}.btn-control.tgico:before{font-size:1.5rem}.btn-transparent{align-items:center;background-color:transparent;color:var(--primary-text-color);display:flex;font-weight:400;height:3rem;line-height:var(--line-height);padding:0 1rem}@media only screen and (max-width:600px){.btn-transparent{height:3rem}}html.no-touch .btn-transparent:active,html.no-touch .btn-transparent:hover{background-color:var(--light-secondary-text-color)}html.no-touch .btn-transparent.danger:active,html.no-touch .btn-transparent.danger:hover{background-color:var(--light-danger-color)}html.no-touch .btn-transparent.primary:active,html.no-touch .btn-transparent.primary:hover{background-color:var(--light-primary-color)}[dir=ltr] .btn-transparent:before{margin-right:2rem}[dir=rtl] .btn-transparent:before{margin-left:2rem}.btn-transparent:before{color:var(--secondary-text-color);font-size:1.5rem}@media only screen and (max-width:600px){[dir=ltr] .btn-transparent:before{margin-right:1.5rem}[dir=rtl] .btn-transparent:before{margin-left:1.5rem}}[dir=ltr] .btn-transparent.btn-short:before{margin-right:1rem}[dir=rtl] .btn-transparent.btn-short:before{margin-left:1rem}.btn-primary.btn-circle .preloader-circular{height:calc(100% - 20px);left:auto;margin:0;right:auto;top:10px}.btn-primary.btn-circle .preloader-circular .preloader-path{stroke:#fff}.btn-menu-toggle{cursor:pointer!important;font-weight:400!important;overflow:visible!important;pointer-events:all!important;position:relative}.btn-menu-toggle:not(.btn-primary):not(.btn-corner).menu-open{background-color:var(--light-secondary-text-color)}.btn-menu-toggle .btn-menu{margin-top:.5rem}.btn-circle{--size:54px;border-radius:50%;height:var(--size);line-height:var(--size);width:var(--size)}@media only screen and (max-width:600px){.btn-circle{--size:46px}}.btn-circle path{fill:#fff}.btn-disabled{color:var(--secondary-text-color)!important;cursor:default!important;pointer-events:none!important}.btn-disabled:before{color:inherit!important}.btn-secondary:not(:first-child){margin-top:.5rem!important}.btn-color-primary{background:var(--primary-color);color:#fff}.call-button{-webkit-backdrop-filter:blur(25px);backdrop-filter:blur(25px);border-radius:50%;font-size:1.5rem;height:var(--call-button-size);justify-content:center;position:relative}.call-button,.call-button-container{align-items:center;cursor:pointer;display:flex;width:var(--call-button-size)}.call-button-container{flex-direction:column}.call-button-container.disabled,.call-button-container.disabled .call-button{pointer-events:none}.call-button-container.disabled .call-button,.call-button-container.disabled .call-button-text{opacity:.8}.call-button-text{font-size:.875rem;margin-top:.25rem;white-space:nowrap}body.animation-level-2 .call-button-text{transition:opacity var(--transition-standard-in)}body.animation-level-2 .call-button{transition:background-color var(--transition-standard-in),opacity var(--transition-standard-in)}[dir=ltr] .call-button+.call-button,[dir=ltr] .call-button-container+.call-button-container{margin-left:var(--call-button-margin)}[dir=rtl] .call-button+.call-button,[dir=rtl] .call-button-container+.call-button-container{margin-right:var(--call-button-margin)}[dir=ltr] .btn-update{right:auto!important}[dir=rtl] .btn-update{left:auto!important}.btn-update{border-radius:var(--size);font-size:1rem;font-weight:var(--font-weight-bold);padding:0 2rem!important;width:auto}.animated-close-icon{pointer-events:none;position:absolute;transform:rotate(-45deg)}.animated-close-icon,.animated-close-icon:after,.animated-close-icon:before{background-color:var(--secondary-text-color);border-radius:.125rem;height:.125rem;width:1.125rem}.animated-close-icon:after,.animated-close-icon:before{content:\"\";left:0;position:absolute;top:0}.animated-close-icon:before{transform:rotate(90deg)}body.animation-level-2 .animated-close-icon,body.animation-level-2 .animated-close-icon:after,body.animation-level-2 .animated-close-icon:before{transition:transform var(--slide-header-transition)}.animated-close-icon.state-back{transform:rotate(180deg)}.animated-close-icon.state-back:before{transform:rotate(45deg) scaleX(.75) translateY(-.375rem)}.animated-close-icon.state-back:after{transform:rotate(-45deg) scaleX(.75) translateY(.375rem)}.animated-menu-icon{--color:var(--secondary-text-color);position:absolute}.animated-menu-icon,.animated-menu-icon:after,.animated-menu-icon:before{background-color:var(--color);border-radius:.125rem;height:.125rem;transform:rotate(0);width:1.125rem}body.animation-level-2 .animated-menu-icon,body.animation-level-2 .animated-menu-icon:after,body.animation-level-2 .animated-menu-icon:before{transition:transform .25s}.animated-menu-icon:after,.animated-menu-icon:before{content:\"\";left:0;position:absolute}.animated-menu-icon:before{top:-.3125rem}.animated-menu-icon:after{top:.3125rem}.animated-menu-icon.state-back{transform:rotate(180deg)}.animated-menu-icon.state-back:before{transform:rotate(45deg) scaleX(.75) translate(.375rem,-.1875rem)}.animated-menu-icon.state-back:after{transform:rotate(-45deg) scaleX(.75) translate(.375rem,.1875rem)}.animated-menu-close-icon{margin-top:-.625rem}.animated-menu-close-icon:before{opacity:1;top:.3125rem}body.animation-level-2 .animated-menu-close-icon:before{transition:transform .25s,opacity .125s 0s}.animated-menu-close-icon:after{top:.625rem}.animated-menu-close-icon.state-back{transform:translateY(.3125rem) rotate(135deg)}.animated-menu-close-icon.state-back:before{opacity:0;transform:rotate(45deg)}.animated-menu-close-icon.state-back:after{transform:translateY(-.625rem) rotate(90deg)}.animated-button-icon>.tgico{height:24px;line-height:24px;position:absolute}body:not(.animation-level-0) .animated-button-icon>.tgico{animation:hide-icon .4s ease-in-out forwards}body.animation-level-0 .animated-button-icon>.tgico{animation:none!important;visibility:hidden}.autocomplete-helper{--border-radius:10px;border-radius:var(--border-radius)!important;bottom:calc(100% + .5rem);left:0;max-width:100%;overflow:hidden;padding:0!important;position:absolute!important;width:auto!important}.autocomplete-helper:not(.is-visible){display:none}.autocomplete-helper.is-visible{visibility:hidden}body.animation-level-2 .autocomplete-helper.is-visible{animation:fade-out-opacity .2s ease-in-out forwards;transition:visibility 0s .2s}.bubbles:not(.is-selecting)~.chat-input .autocomplete-helper.is-visible:not(.backwards){visibility:visible}body.animation-level-2 .bubbles:not(.is-selecting)~.chat-input .autocomplete-helper.is-visible:not(.backwards){animation-name:fade-in-opacity;transition:visibility 0s 0s}@media only screen and (max-width:319px){.autocomplete-helper{max-width:calc(100vw - var(--padding-horizontal)*4)}}.autocomplete-peer-helper .scrollable{max-height:232px;position:relative}.autocomplete-peer-helper-list{padding:.5rem 0}.autocomplete-peer-helper-list-element{align-items:center;cursor:pointer;display:flex;height:3.125rem;line-height:var(--line-height);padding:0 2.125rem 0 .75rem;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media only screen and (max-width:600px){.autocomplete-peer-helper-list-element{padding-right:.75rem}}.autocomplete-peer-helper-list-element-name{flex:0 0 auto;font-weight:var(--font-weight-bold);margin-left:.875rem}.autocomplete-peer-helper-list-element-description{color:var(--secondary-text-color);margin-left:.5625rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.autocomplete-peer-helper-list-element-avatar{flex:0 0 auto}.badge{--size:1.375rem;--padding:.4375rem;border-radius:calc(var(--size)/2);color:var(--badge-text-color);font-size:.875rem;font-weight:var(--font-weight-bold);height:var(--size);line-height:var(--size)!important;min-width:var(--size);padding:0 var(--padding);text-align:center}body.animation-level-2 .badge{transition:background-color .2s ease-in-out}.badge:not(.tgico):empty{display:none}.badge-20{--size:1.25rem;--padding:.375rem}.badge-24{--size:1.5rem;--padding:.5rem}.badge.tgico:before{font-size:var(--size)}.badge-primary{background-color:var(--primary-color)}.badge-gray{background-color:var(--secondary-color)}.ckin__player{letter-spacing:.02em;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ckin__player.ckin__fullscreen{background:#000;border-radius:0!important;bottom:0;display:flex;height:100%;left:0;position:fixed;right:0;top:0;width:100%;z-index:10000000}.ckin__player.ckin__fullscreen video{height:100%;-o-object-fit:contain;object-fit:contain;width:100%}.ckin__player .time{color:#fff;font-size:.875rem;margin-left:.875rem}@media only screen and (max-width:600px){.ckin__player .time{margin-left:1.125rem}}.default{align-items:center;display:flex;font-size:0;justify-content:center;position:relative}.default.show-controls video{cursor:pointer}.default__button{color:#fff;padding:.375rem}.default__button i{align-self:center}.default__button--big{background:none;border:0;color:#fff;font-size:4rem;left:50%;line-height:1;opacity:1;outline:0;padding:0;position:absolute;text-align:center;top:50%;transform:translate3d(-50%,-50%,0) scale(1)}@media only screen and (min-width:601px){.default__button--big{pointer-events:none}}body.animation-level-2 .default__button--big{transition:opacity var(--layer-transition)}@media only screen and (max-width:600px){.default__button--big{font-size:3rem}}.default:not(.played) .default__button--big{opacity:0}[dir=ltr] .default__controls{text-align:left}[dir=rtl] .default__controls{text-align:right}.default__controls{bottom:0;direction:ltr;left:0;position:absolute;right:0;z-index:6}body.animation-level-2 .default__controls{transition:transform var(--layer-transition)}.default__controls .progress-line{border-radius:var(--border-radius);margin:0 16px}.default__controls .progress-line__filled{background:var(--primary-color)}.default__controls .progress-line__loaded{background-color:#fff}.default__controls .progress-line{background:hsla(0,0%,100%,.38)}@media only screen and (max-width:600px){.default__controls .progress-line{margin-bottom:-1px}}.default__gradient-bottom{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==);background-position:bottom;background-repeat:repeat-x;bottom:0;height:49px;padding-top:93px;pointer-events:none;position:absolute;width:100%;z-index:2}body.animation-level-2 .default__gradient-bottom{transition:transform var(--layer-transition)}@media only screen and (max-width:600px){.default:not(.ckin__fullscreen) .default__gradient-bottom{display:none}}.default .toggle:before{content:\"\"}.default .default__gradient-bottom{transform:translate3d(0,50px,0)}.default .default__controls{transform:translate3d(0,52px,0)}@media only screen and (max-width:600px){.default .default__controls{transform:translate3d(0,65px,0)}}.default.show-controls .default__controls,.default.show-controls .default__gradient-bottom{transform:translateZ(0)}.default.is-playing:not(.show-controls){cursor:none}.default.is-playing .default__button--big,.default.is-seeking .default__button--big,.default:not(.played) .default__button--big{opacity:0}.default.is-playing .toggle:not(.default__button--big):before,.default.is-seeking .toggle:not(.default__button--big):before,.default:not(.played) .toggle:not(.default__button--big):before{content:\"\"}.default .is-seeking+.default__button--big{opacity:0}.default .player-volume{--icon-size:2.25rem;--icon-margin-right:.5rem;--selector-size:50px;--selector-thumb-size:.75rem;--hide-width:var(--icon-size);--show-width:calc(var(--icon-size) + var(--icon-margin-right) + var(--selector-size) + var(--selector-thumb-size)*0.75);align-items:center;display:flex;overflow:hidden;width:var(--hide-width)}body.animation-level-2 .default .player-volume{transition:width var(--layer-transition)}html.is-touch .default .player-volume{display:none}html:not(.is-touch) .default .player-volume+.time{margin-left:.5rem}html.no-touch .default .player-volume:active,html.no-touch .default .player-volume:hover{width:var(--show-width)}.default .player-volume__icon{color:#fff;cursor:pointer;display:flex;font-size:1.5rem;height:var(--icon-size);margin-right:var(--icon-margin-right);padding:.375rem;width:var(--icon-size)}.default .player-volume .progress-line{--color:#fff;--thumb-size:var(--selector-thumb-size);--height:4px;margin:0;min-width:var(--selector-size);width:var(--selector-size)}html.is-ios .default .player-volume .progress-line{display:none}.default.is-buffering>.toggle{display:none!important}video::-webkit-media-controls-enclosure{display:none!important}.progress-line{--color:var(--primary-color);--height:5px;--border-radius:6px;--thumb-size:13px;border-radius:var(--border-radius);cursor:pointer;height:var(--height);position:relative}.progress-line:before{border-radius:inherit;bottom:0;content:\" \";display:block;left:0;position:absolute;right:0;top:0}.progress-line__seek{-webkit-appearance:none;-moz-appearance:none;background:transparent;bottom:-.5rem;caret-color:var(--color);cursor:pointer;margin:0;outline:none;padding:0;position:absolute;top:-.5rem;width:100%}.progress-line__seek:focus{outline:none}.progress-line__seek::-webkit-slider-thumb{display:none}.progress-line__seek::-moz-range-thumb{display:none;height:0;width:0}.progress-line__seek::-moz-range-track{display:none}.progress-line__seek::-webkit-slider-runnable-track{display:none}.progress-line__filled{max-width:100%}.progress-line__filled:not(.progress-line__loaded){background-color:var(--color);z-index:1}.progress-line__filled:not(.progress-line__loaded):after{background-color:var(--color);border-radius:50%;content:\" \";cursor:pointer;display:block;height:var(--thumb-size);position:absolute;right:0;top:calc((var(--thumb-size) - var(--height))/-2);transform:translateX(calc(var(--thumb-size)/2)) scale(1);width:var(--thumb-size)}body.animation-level-2 .progress-line__filled:not(.progress-line__loaded):after{transition:transform .125s ease-in-out}.progress-line.is-focused .progress-line__filled:not(.progress-line__loaded):after{transform:translateX(calc(var(--thumb-size)/2)) scale(1.125)}.progress-line:before,.progress-line__loaded{background-color:var(--secondary-color);opacity:.3}.progress-line__filled,.progress-line__loaded{border-radius:var(--border-radius);bottom:0;position:absolute;top:0}body.animation-level-2 .progress-line.with-transition .progress-line__filled{transition:width .2s}.progress-line.use-transform .progress-line__filled{transform-origin:left center;width:100%}input[type=range]::-ms-track{visibility:hidden}input[type=range]::-ms-ticks{background:none;border:none;color:none}input[type=range]::-ms-thumb,input[type=range]::-ms-tooltip{visibility:hidden}.bottom-controls,.left-controls,.right-controls{align-items:center;display:flex}.bottom-controls{height:2.25rem;justify-content:space-between;padding:0 .625rem}@media only screen and (max-width:600px){.bottom-controls{height:3.625rem}}[dir=ltr] .checkbox-field{text-align:left}[dir=rtl] .checkbox-field{text-align:right}.checkbox-field{--size:1.25rem;--offset-left:0px;cursor:pointer;display:block;margin:1.5rem 1.1875rem;min-height:var(--size);min-width:var(--size);position:relative}body.animation-level-2 .checkbox-field{transition:opacity .2s}.checkbox-field.checkbox-disabled{opacity:var(--disabled-opacity);pointer-events:none!important}@media only screen and (max-width:600px){.checkbox-field{margin-bottom:27px}}[dir=ltr] .checkbox-field .checkbox-box{left:var(--offset-left)}[dir=rtl] .checkbox-field .checkbox-box{right:var(--offset-left)}.checkbox-field .checkbox-box{border-radius:.3125rem;height:var(--size);overflow:hidden;position:absolute;top:50%;transform:translateY(-50%);width:var(--size)}html.is-safari .checkbox-field .checkbox-box{-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}.checkbox-field .checkbox-box-background,.checkbox-field .checkbox-box-border,.checkbox-field .checkbox-box-check{left:0;position:absolute;top:0}.checkbox-field .checkbox-box-border{border:2px solid #8d969c;border-radius:inherit;bottom:0;left:0;right:0}.checkbox-field .checkbox-box-background{background-color:var(--primary-color);border-radius:50%;bottom:-15%;left:-15%;right:-15%;top:-15%;transform:scale(0);transition:transform .2s ease-in-out .05s}body.animation-level-0 .checkbox-field .checkbox-box-background{transition:none!important}.checkbox-field .checkbox-box-check{--offset:7px;height:calc(var(--size) - var(--offset));left:50%;top:50%;transform:translate(-50%,-50%);width:calc(var(--size) - var(--offset))}.checkbox-field .checkbox-box-check use{stroke:#fff;stroke-width:3.75;stroke-linecap:round;stroke-dasharray:0,24.19;stroke-dashoffset:0;transition:stroke-dasharray .1s ease-in-out,visibility 0s .1s;visibility:hidden}body.animation-level-0 .checkbox-field .checkbox-box-check use{transition:none!important}[dir=ltr] .checkbox-field .checkbox-caption{padding-left:3.375rem}[dir=rtl] .checkbox-field .checkbox-caption{padding-right:3.375rem}.checkbox-field .checkbox-caption{color:inherit;line-height:var(--line-height);overflow:hidden;pointer-events:none;position:relative;text-overflow:ellipsis;transition:opacity .2s;word-break:break-word}body.animation-level-0 .checkbox-field .checkbox-caption{transition:none}.checkbox-field.hover-effect{align-items:center;display:flex;height:3.5rem;margin-left:0;margin-right:0;padding:0 1.1875rem}[dir=ltr] .checkbox-field.hover-effect .checkbox-box{left:auto}[dir=rtl] .checkbox-field.hover-effect .checkbox-box{right:auto}.checkbox-field .anchor-url{pointer-events:all}.checkbox-ripple{border-radius:10px;overflow:hidden}.checkbox-ripple .checkbox-box,.checkbox-ripple .checkbox-caption{pointer-events:none}.checkbox-field-round{--size:1.5rem}.checkbox-field-round .checkbox-box{border-radius:50%;overflow:auto}.checkbox-field-round .checkbox-box-background{bottom:0;left:0;right:0;top:0}.checkbox-field-round .checkbox-box-border{border:2px solid var(--secondary-color);z-index:1}.checkbox-field-round .checkbox-box-check{--offset:calc(var(--size) - var(--size)/2 - 0.125rem)}html.is-safari .checkbox-field-round .checkbox-box{-webkit-mask-image:none}[dir=ltr] .radio-field{text-align:left}[dir=rtl] .radio-field{text-align:right}.radio-field{--size:1.375rem;--offset-left:0px;cursor:pointer;line-height:var(--line-height);margin:1.25rem 0;position:relative}.radio-field.hidden-widget{cursor:default}.radio-field.hidden-widget .radio-field-main:after,.radio-field.hidden-widget .radio-field-main:before{visibility:hidden}.radio-field>input:checked~.radio-field-main:before{border-color:var(--primary-color)}.radio-field>input:checked~.radio-field-main:after{transform:translateY(-50%) scale(1)}[dir=ltr] .radio-field .radio-field-main{padding-left:3.5rem}[dir=rtl] .radio-field .radio-field-main{padding-right:3.5rem}.radio-field .radio-field-main{color:inherit;position:relative}[dir=ltr] .radio-field .radio-field-main:after,[dir=ltr] .radio-field .radio-field-main:before{left:var(--offset-left)}[dir=rtl] .radio-field .radio-field-main:after,[dir=rtl] .radio-field .radio-field-main:before{right:var(--offset-left)}.radio-field .radio-field-main:after,.radio-field .radio-field-main:before{content:\"\";display:block;height:var(--size);position:absolute;top:50%;transform:translateY(-50%);width:var(--size)}.radio-field .radio-field-main:before{border:2px solid var(--secondary-text-color);border-radius:50%;opacity:1}body.animation-level-2 .radio-field .radio-field-main:before{transition:border-color .1s ease,opacity .1s ease}[dir=ltr] .radio-field .radio-field-main:after{left:calc(var(--offset-left) + .3125rem)}[dir=rtl] .radio-field .radio-field-main:after{right:calc(var(--offset-left) + .3125rem)}.radio-field .radio-field-main:after{background:var(--primary-color);border-radius:50%;height:.75rem;transform:translateY(-50%) scale(0);transform-origin:center;width:.75rem}body.animation-level-2 .radio-field .radio-field-main:after{transition:transform .1s ease}[dir=ltr] .radio-field.radio-field-right .radio-field-main:before{left:auto;right:0}[dir=rtl] .radio-field.radio-field-right .radio-field-main:before{left:0;right:auto}[dir=ltr] .radio-field.radio-field-right .radio-field-main:after{left:auto;right:.3125rem}[dir=rtl] .radio-field.radio-field-right .radio-field-main:after{left:.3125rem;right:auto}[type=checkbox],[type=radio]{box-sizing:border-box;opacity:0;padding:0;position:absolute;z-index:var(--z-below)}.checkbox-field .checkbox-field-input:checked:not(.is-fake-disabled)+.checkbox-box .checkbox-box-check use{stroke-dasharray:24.19,24.19;transition:stroke-dasharray .1s ease-in-out .15s,visibility 0s .15s;visibility:visible}.checkbox-field .checkbox-field-input:checked:not(.is-fake-disabled)+.checkbox-box .checkbox-box-background{transform:scale(1);transition:transform .2s ease-in-out 0s}.checkbox-field .checkbox-field-input:disabled+.checkbox-box,.checkbox-field .checkbox-field-input:disabled~.checkbox-caption{cursor:default;opacity:var(--disabled-opacity)}.checkbox-field-restriction .checkbox-box-border{display:none}.checkbox-field-restriction .checkbox-box-background{transform:none!important;transition:background-color .2s!important}.checkbox-field-restriction .checkbox-box-check use{stroke-dasharray:24.19,24.19!important;transform:rotate(0) translateY(0);transition:stroke-dashoffset .2s ease-in-out,transform .2s ease-in-out!important;visibility:visible!important}.checkbox-field-restriction [type=checkbox]:not(:checked)+.checkbox-box .checkbox-box-check use{stroke-dashoffset:35.5;transform:rotate(45deg) translateY(-10px)}.checkbox-field-restriction [type=checkbox]:not(:checked)+.checkbox-box .checkbox-box-background{background-color:var(--danger-color)}.checkbox-field-toggle{--size:20px;align-items:center;display:flex;margin:0 .3125rem;padding:0 .25rem;pointer-events:none}.checkbox-field-toggle .checkbox-toggle{--offset:3px;--toggle-width:1.9375rem;align-items:center;background-color:var(--secondary-color);border-radius:12px;display:flex;height:.875rem;margin:0 var(--offset);position:relative;width:var(--toggle-width)}body.animation-level-2 .checkbox-field-toggle .checkbox-toggle{transition:background-color .1s}.checkbox-field-toggle .checkbox-toggle:before{background-color:var(--surface-color);border:2px solid var(--secondary-color);border-radius:50%;content:\" \";height:1.25rem;position:absolute;transform:translateX(calc(var(--offset)*-1));width:1.25rem}body.animation-level-2 .checkbox-field-toggle .checkbox-toggle:before{transition:border-color .1s,transform .1s cubic-bezier(.22,.75,.7,1.3)}.checkbox-field-toggle-restriction .checkbox-toggle{background-color:var(--danger-color)}.checkbox-field-toggle-restriction .checkbox-toggle:before{border-color:var(--danger-color)}.checkbox-field-toggle [type=checkbox]:checked:not(.is-fake-disabled)+.checkbox-toggle{background-color:var(--primary-color)}.checkbox-field-toggle [type=checkbox]:checked:not(.is-fake-disabled)+.checkbox-toggle:before{border-color:var(--primary-color);transform:translateX(calc(var(--toggle-width) - 1.25rem + var(--offset)))}.chatlist-container{position:relative}@media only screen and (max-width:600px){.chatlist-container .search-group-recent.search-group{padding:2px 0 0}}.chatlist-container .search-group{margin-bottom:17px;padding:1rem 0 .5rem;width:100%}@media only screen and (max-width:600px){.chatlist-container .search-group{margin-bottom:0}}.chatlist-container .search-group__name{color:var(--secondary-text-color);font-weight:var(--font-weight-bold);padding:0 23px 1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media only screen and (max-width:600px){.chatlist-container .search-group__name{font-size:15px;padding:5px 9px 0 16px}}.chatlist-container .search-group-contacts{border-bottom:1px solid var(--border-color)}@media only screen and (max-width:600px){.chatlist-container .search-group-contacts{padding:0 0 2px}}.chatlist-container .search-group-people.search-group-contacts{padding:5px 0!important}.chatlist-container .search-group:last-child{border-bottom:none}.chatlist-container .search-super .search-group{margin-bottom:0;padding:0 0 .5rem}.chatlist-container .search-super .search-group__name{display:flex;justify-content:space-between;padding-top:1rem}ul.chatlist{padding:0 .5rem}@media only screen and (max-width:600px){ul.chatlist{padding:0}}.chatlist{-webkit-touch-callout:none;background-color:var(--surface-color);display:flex;flex-direction:column;margin:0;position:relative;-moz-user-select:none;user-select:none;-webkit-user-select:none;width:100%}.chatlist-chat{--background:unset;-webkit-user-drag:none;background:var(--background)!important}.chatlist-chat.is-forum-open,.chatlist-chat.menu-open,html.no-touch .chatlist-chat:active,html.no-touch .chatlist-chat:hover{--background:var(--light-filled-secondary-text-color)}[dir=ltr] .chatlist-chat.is-muted .user-title:after{margin-left:.125rem}[dir=rtl] .chatlist-chat.is-muted .user-title:after{margin-right:.125rem}.chatlist-chat.is-muted .user-title:after{color:var(--chatlist-pinned-color);content:\"\";flex:0 0 auto;font-size:1.125rem}body:not(.animation-level-0) .chatlist-chat.is-muted.animating:not(.backwards) .user-title:after{animation:fade-in-opacity .2s ease-in-out forwards}body:not(.animation-level-0) .chatlist-chat.is-muted.animating.backwards .user-title:after{animation:fade-in-backwards-opacity .2s ease-in-out forwards}.chatlist-chat i{font-style:normal}.chatlist-chat .text-highlight{color:var(--primary-text-color)}.chatlist-chat .premium-icon{margin-top:-.125rem}.chatlist-chat .topic-icon{flex:0 0 auto}[dir=ltr] .chatlist-chat .row-title .topic-icon{margin-right:.25rem}[dir=rtl] .chatlist-chat .row-title .topic-icon{margin-left:.25rem}.chatlist-chat .row-title .topic-icon{--size:1.375rem}.chatlist-chat .topic-name .topic-icon{display:inline;line-height:1!important}.chatlist-chat .topic-name .topic-icon-svg{position:relative}.chatlist-chat .topic-name .topic-icon-content{left:0;margin-top:-6px;position:absolute;right:0;top:0}@media only screen and (min-width:601px){.chatlist-chat.active{--background:var(--primary-color)!important}.chatlist-chat.active .message-status,.chatlist-chat.active .premium-icon,.chatlist-chat.active .row-subtitle,.chatlist-chat.active .row-title,.chatlist-chat.active .sending-status-icon,.chatlist-chat.active .text-highlight,.chatlist-chat.active .tgico-chatspinned:before,.chatlist-chat.active .user-title,.chatlist-chat.active .verified-icon{color:#fff!important}.chatlist-chat.active .badge-fake{border-color:#fff;color:#fff}.chatlist-chat.active .danger,.chatlist-chat.active .primary-text{color:#fff!important}.chatlist-chat.active .user-title:after{color:hsla(0,0%,100%,.7)}.chatlist-chat.active .verified-icon-background{fill:#fff!important}.chatlist-chat.active .verified-icon-check{visibility:hidden}.chatlist-chat.active .dialog-avatar.is-online:after,.chatlist-chat.active .dialog-group-call-icon{background-color:#fff;border-color:var(--primary-color)}.chatlist-chat.active .badge.unread,.chatlist-chat.active .mention{background-color:#fff!important;color:var(--primary-color)}.chatlist-chat.active .peer-typing-container{--color:#fff}}.chatlist .peer-typing-container{--color:var(--secondary-text-color)}.chatlist .peer-typing-container .peer-typing-text{display:inline-flex;transform:translateY(-2px)}.chatlist .sending-status-icon.tgico-premium_lock{color:var(--secondary-color);font-size:.8125rem;margin:.1875rem 0 0 .5rem}[dir=ltr] .chatlist .dialog-title-details{margin-left:.5rem}[dir=rtl] .chatlist .dialog-title-details{margin-right:.5rem}.chatlist .dialog-title-details{flex:0 0 auto;font-size:.75rem;padding:1px 0 0}[dir=ltr] .chatlist .dialog-subtitle-badge{margin-left:.5rem}[dir=rtl] .chatlist .dialog-subtitle-badge{margin-right:.5rem}.chatlist .dialog-subtitle-badge{display:block!important;flex:0 0 auto}.chatlist .dialog-subtitle-badge.avatar-badge{--size:1.625rem;border:2px solid var(--background,var(--surface-color));line-height:23px!important;margin:0;pointer-events:none;position:absolute;right:calc(100% - 4.0625rem);top:2.4375rem}[dir=ltr] .chatlist .dialog-subtitle-media{margin-right:.375rem}[dir=rtl] .chatlist .dialog-subtitle-media{margin-left:.375rem}.chatlist .dialog-subtitle-media{border-radius:.25rem;display:inline-block;flex:0 0 auto;height:1.25rem;line-height:1.25rem;position:relative;width:1.25rem}.chatlist .dialog-subtitle-media:before{content:\" \";display:inline-block;height:inherit;min-height:inherit;min-width:inherit;width:inherit}.chatlist .dialog-subtitle-media.is-round{border-radius:50%}.chatlist .dialog-subtitle-media.is-round .tgico-play{font-size:.875rem}.chatlist .dialog-subtitle-media .tgico-play{color:#fff;font-size:1rem;left:50%;line-height:1;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:1}.chatlist .dialog-subtitle-media .media-photo{border-radius:inherit;bottom:auto;height:inherit;-o-object-fit:cover;object-fit:cover;top:auto;width:inherit}.chatlist .dialog-group-call-icon{background-color:var(--avatar-online-color);border:2px solid var(--surface-color);border-radius:50%;height:20px;left:45px;overflow:hidden;position:absolute;top:45px;width:20px;z-index:2}body.animation-level-2 .chatlist .dialog-group-call-icon,body.animation-level-2 .chatlist .dialog-subtitle-badge{opacity:1;transform:scale(0);transition:none}body.animation-level-2 .chatlist .dialog-group-call-icon.is-visible:not(.backwards),body.animation-level-2 .chatlist .dialog-subtitle-badge.is-visible:not(.backwards){transform:scale(1)}body.animation-level-2 .chatlist .dialog-group-call-icon.backwards,body.animation-level-2 .chatlist .dialog-subtitle-badge.backwards{opacity:0}body.animation-level-2 .chatlist .dialog-group-call-icon.animating,body.animation-level-2 .chatlist .dialog-subtitle-badge.animating{transition:background-color var(--chatlist-badge-transition-in),transform var(--chatlist-badge-transition-in)}body.animation-level-2 .chatlist .dialog-group-call-icon.animating.backwards,body.animation-level-2 .chatlist .dialog-subtitle-badge.animating.backwards{transition:background-color var(--chatlist-badge-transition-out),transform var(--chatlist-badge-transition-out),opacity var(--chatlist-badge-transition-out)}body.animation-level-2 .chatlist .dialog-avatar:after{opacity:1;transform:scale(0);transition:none}body.animation-level-2 .chatlist .dialog-avatar.is-visible:not(.backwards):after{transform:scale(1)}body.animation-level-2 .chatlist .dialog-avatar.backwards:after{opacity:0}body.animation-level-2 .chatlist .dialog-avatar.animating:after{transition:background-color var(--chatlist-badge-transition-in),transform var(--chatlist-badge-transition-in)}body.animation-level-2 .chatlist .dialog-avatar.animating.backwards:after{transition:background-color var(--chatlist-badge-transition-out),transform var(--chatlist-badge-transition-out),opacity var(--chatlist-badge-transition-out)}.chatlist .dialog-avatar{flex:0 0 auto}.chatlist .dialog-avatar,.chatlist .row-row{pointer-events:none;position:relative}.chatlist .user-title{align-items:center;display:flex!important}.chatlist .user-title img.emoji{height:18px;margin-top:1px;vertical-align:top;width:18px}.chatlist .user-last-message img.emoji{height:20px;margin-top:-3px;width:20px}.chatlist .user-last-message,.chatlist .user-title{flex-grow:1;position:relative}[dir=ltr] .chatlist .message-status{margin-right:.125rem}[dir=rtl] .chatlist .message-status{margin-left:.125rem}.chatlist .message-status{color:var(--chatlist-status-color);display:inline-block;font-size:1.25rem;height:1.25rem;line-height:1;margin-top:-.0625rem;position:relative;vertical-align:middle;width:1.25rem}.chatlist .message-status:before{vertical-align:middle}.chatlist .tgico-chatspinned{background:transparent}body.animation-level-2 .chatlist .tgico-chatspinned:before{transition:opacity .2s ease-in-out}.chatlist .tgico-chatspinned:before{color:var(--chatlist-pinned-color);opacity:1}.chatlist .tgico-chatspinned.unread:before{opacity:0}.chatlist .tgico-chatspinned{position:relative}.chatlist .tgico-chatspinned:before{left:0;position:absolute;top:0}.chatlist .mention{background-color:var(--chatlist-status-color)!important;line-height:1.25rem!important;padding:0}[dir=ltr] .chatlist .mention-badge{margin-right:-.125rem}[dir=rtl] .chatlist .mention-badge{margin-left:-.125rem}.chatlist .is-muted.backwards .unread,.chatlist .unread{background-color:var(--chatlist-status-color)}.chatlist .is-muted .unread,.chatlist .no-unmuted-topic .unread{background-color:var(--secondary-color)}.chatlist .not-visited{--size:.5rem;--padding:0;background-color:var(--secondary-color)!important}.chatlist-parts.with-contacts .chatlist-top:not(.with-placeholder){height:auto;padding-bottom:.5rem}.chatlist-parts.with-contacts .chatlist-top.with-placeholder.has-contacts{height:24.125rem}.chatlist-parts.with-contacts .chatlist-top.with-placeholder .empty-placeholder-dialogs{top:50%}.chatlist-top{height:100%}.chatlist-bottom{max-height:36.375rem}.chatlist-bottom .sidebar-left-section{margin-bottom:0!important;padding-bottom:0}.chatlist-bottom .chatlist-new{padding:0}.chat-input{--translateY:0;--padding-bottom:0.5rem;--bottom:var(--padding-bottom);display:flex;flex:0 0 auto;flex-direction:column;max-width:100%;padding-top:.25rem;position:relative;transform:translate3d(0,var(--translateY),0);transition:transform var(--transition-standard-out);width:100%}body.animation-level-0 .chat-input{transition:none!important}@media only screen and (min-height:570px)and (min-width:601px){.chat-input{max-width:var(--messages-container-width)!important}}@media only screen and (min-width:601px){.chat-input{--padding-bottom:1.25rem}}@media only screen and (max-height:569px){.chat-input{--padding-bottom:0.5rem}}@media only screen and (min-width:1276px){.chat-input{width:calc(100% - var(--right-column-width))!important}body.is-right-column-shown .chat-input{transform:translate3d(calc(var(--right-column-width)/-2),var(--translateY),0)!important;transition:transform var(--transition-standard-in)}}.chat-input.is-hidden{--translateY:100%;bottom:0;position:absolute!important;transform:translate3d(0,var(--translateY),0)!important;transition:transform var(--transition-standard-in)}.bubbles.is-selecting:not(.backwards)~.chat-input.is-hidden{--translateY:0}.chat-input-container{--padding-horizontal:var(--chat-input-padding);align-items:flex-end;display:flex;flex:0 0 auto;justify-content:center;margin:0 auto;max-width:var(--messages-container-width);padding:0 var(--padding-horizontal);padding-bottom:var(--bottom);position:relative;width:100%}.chat-input-container .btn-circle{height:var(--chat-input-size);width:var(--chat-input-size)}.chat-input-container.is-centering .new-message-wrapper{pointer-events:none}.chat-input-container.is-centering:not(.backwards) .new-message-wrapper{opacity:0}.chat-input-container.is-centering:not(.backwards) .rows-wrapper{border-bottom-right-radius:12px;max-height:var(--chat-input-size)}.chat-input-container.is-centering:not(.backwards) .rows-wrapper .bubble-tail{opacity:0;transform:scaleX(-1) translateX(1.125rem)}.chat-input-container.is-centering:not(.backwards) .reply-wrapper{height:0!important;opacity:0;pointer-events:none}.chat-input-container.is-centering:not(.backwards) .btn-send{transform:scale(0)}.chat-input-container.is-centering.animating .rows-wrapper{transition:transform .2s,max-height .2s,border-radius .1s}.chat-input-container.is-centering.animating .rows-wrapper .bubble-tail{transition:transform .1s,opacity 25ms 0s}.chat-input-container.is-centering.animating .selection-wrapper{transition:opacity .1s 75ms}.chat-input-container.is-centering.animating .btn-send{transition:transform .2s}.chat-input-container.is-centering.animating:not(.backwards) .rows-wrapper .bubble-tail{transition:transform .1s,opacity 25ms 75ms}.chat-input .menu-send{bottom:calc(100% + .5rem);top:auto}.chat-input .toggle-emoticons:before{content:\"\"}.chat-input .toggle-emoticons.flip-icon:before{content:\"\"!important}[dir=ltr] .chat-input .btn-record-cancel{right:0}[dir=rtl] .chat-input .btn-record-cancel{left:0}.chat-input .btn-record-cancel{--multiplier:-1;opacity:0;padding:0;position:absolute;top:0;transform:translateX(calc((100% + var(--padding-horizontal) + .5rem)*var(--multiplier)));visibility:hidden;z-index:3}.chat-input .btn-record-cancel .c-ripple__circle,html.no-touch .chat-input .btn-record-cancel:active:after,html.no-touch .chat-input .btn-record-cancel:hover:after{background-color:var(--light-danger-color)}.chat-input .btn-record-cancel:before{color:var(--danger-color)}.is-rtl .chat-input .btn-record-cancel{--multiplier:1}[dir=ltr] .chat-input .btn-scheduled:after{right:5px}[dir=rtl] .chat-input .btn-scheduled:after{left:5px}.chat-input .btn-scheduled:after{background:var(--message-checkbox-color);border-radius:50%;content:\"\";height:.5rem;position:absolute;top:5px;width:.5rem}.chat-input .btn-preloader .preloader{height:1.5rem;width:1.5rem}.chat-input .btn-preloader .preloader .preloader-path{stroke:var(--secondary-text-color)}body.animation-level-2 .chat-input .btn-preloader.show.backwards{animation:hide-icon .4s ease-in-out forwards!important}[dir=ltr] .chat-input .float{margin-right:.75rem!important}[dir=rtl] .chat-input .float{margin-left:.75rem!important}.chat-input .float{align-self:center;display:none!important;margin:0!important}body.animation-level-2 .chat-input .float{animation:grow-icon .4s ease-in-out forwards!important}@media only screen and (max-height:569px),only screen and (max-width:600px){[dir=ltr] .chat-input .float{margin-right:.125rem!important}[dir=rtl] .chat-input .float{margin-left:.125rem!important}}.chat-input:not(.is-recording) .float.show:not(.hide){display:flex!important}[dir=ltr] .chat-input .btn-send-container{right:var(--padding-horizontal)}[dir=rtl] .chat-input .btn-send-container{left:var(--padding-horizontal)}.chat-input .btn-send-container{align-items:center;bottom:0;display:flex;justify-content:center;padding-bottom:inherit;position:absolute}.chat-input .btn-send-container .btn-menu-overlay{z-index:3}.chat-input .btn-icon{transition:opacity .2s}body.animation-level-0 .chat-input .btn-icon{transition:none}.chat-input .btn-cancel-record,.chat-input .btn-send{box-shadow:0 1px 8px 1px rgba(0,0,0,.12)}.chat-input .btn-send{background-color:var(--primary-color)!important;color:#fff!important;z-index:3}html.no-touch .chat-input .btn-send:active,html.no-touch .chat-input .btn-send:hover{background-color:var(--dark-primary-color)!important}.chat-input .btn-send .tgico-check{font-size:2rem;height:32px!important}.chat-input .btn-send .tgico-check:before{font-weight:var(--font-weight-bold)}.chat-input .btn-send.edit .tgico-check,.chat-input .btn-send.record .tgico-microphone_filled,.chat-input .btn-send.schedule .tgico-schedule,.chat-input .btn-send.send .tgico-send{visibility:visible!important}body.animation-level-2 .chat-input .btn-send.edit .tgico-check,body.animation-level-2 .chat-input .btn-send.record .tgico-microphone_filled,body.animation-level-2 .chat-input .btn-send.schedule .tgico-schedule,body.animation-level-2 .chat-input .btn-send.send .tgico-send{animation:grow-icon .4s ease-in-out forwards!important}.chat-input .btn-record-cancel,.chat-input .btn-send{font-size:1.5rem;line-height:1.5rem}.chat-input .record-time{display:none;height:44px;line-height:44px}.chat-input .record-time:after{background-color:var(--danger-color);border-radius:50%;content:\" \";display:inline-block;height:10px;margin-left:9px;margin-right:9px;width:10px}body.animation-level-2 .chat-input .record-time:after{animation:recordBlink 1.25s infinite}.chat-input .record-ripple{background-color:var(--message-highlightning-color);border-radius:50%;height:300px;opacity:.5;position:absolute;transform:scale(0);visibility:hidden;width:300px}@media only screen and (max-width:600px){.chat-input .record-ripple{height:240px;width:240px}}.chat-input.is-locked{pointer-events:none}.chat-input.is-locked .btn-icon,.chat-input.is-locked:not(.is-recording) .btn-send{color:#c6cbce}.chat-input.is-recording:not(.backwards) .btn-record-cancel{opacity:1;visibility:visible}.chat-input.is-recording:not(.backwards) .btn-record-cancel,.chat-input.is-recording:not(.backwards) .btn-send{pointer-events:all}.chat-input.is-recording:not(.backwards) .record-ripple{visibility:visible}.chat-input.is-recording:not(.backwards) .rows-wrapper{width:calc(100% - var(--chat-input-size)*2 - 1rem)}.chat-input.is-recording:not(.backwards) .attach-file{display:none}.chat-input.is-recording:not(.backwards) .record-time{display:block}.chat-input.is-recording.animating .btn-record-cancel{transition:visibility 0s .1s,opacity .1s 0s}.chat-input.is-recording.animating .record-ripple{transition:transform .03s ease-in-out,visibility .1s}.chat-input.is-recording.animating .rows-wrapper{transition:width .2s}.chat-input.is-recording.animating:not(.backwards) .btn-record-cancel{transition:visibility 0s .1s,opacity .1s .1s}.chat-input.is-recording.animating:not(.backwards) .record-ripple{transition:transform .03s,visibility 0s}[dir=ltr] .chat-input:not(.is-recording) .btn-record-cancel{margin-right:0}[dir=rtl] .chat-input:not(.is-recording) .btn-record-cancel{margin-left:0}.chat-input:not(.is-recording) .btn-record-cancel{width:0}.chat-input .new-message-wrapper{opacity:1}.chat-input .reply-in-topic-overlay{align-items:center;background-color:inherit;border-radius:inherit;color:var(--secondary-text-color);display:flex;justify-content:center;padding:0 1rem;pointer-events:none;z-index:3}.bubbles.is-selecting:not(.backwards)~.chat-input .selection-wrapper{opacity:1}.bubbles.is-selecting.animating~.chat-input .new-message-wrapper{transition:opacity .1s 0s}.bubbles.is-selecting.animating~.chat-input .selection-container-left,.bubbles.is-selecting.animating~.chat-input .selection-container-right{transition:transform .2s}.bubbles.is-selecting.animating.backwards~.chat-input .new-message-wrapper{transition:opacity .1s .1s}.bubbles.is-selecting.animating.backwards~.chat-input .selection-wrapper{transition:opacity .1s 0s}@keyframes recordBlink{0%{opacity:1}50%{opacity:.2}to{opacity:1}}#column-center{flex:3;position:relative;width:100%}@media only screen and (max-width:600px){body.is-left-column-shown #column-center{transform:translate3d(100vw,0,0)}body.is-right-column-shown #column-center{filter:brightness(80%);transform:translate3d(-25vw,0,0)}}@media only screen and (min-width:601px)and (max-width:925px){#column-center{bottom:0;left:0;position:fixed!important;right:0;top:0;transform:translateZ(0)}body.animation-level-2 #column-center{transition:transform var(--layer-transition)}body.is-left-column-shown #column-center{transform:translate3d(26.5625rem,0,0)}body.is-left-column-shown #column-center .sidebar-close-button:before{transform:rotate(180deg)}}.chats-container{height:100%}.chat{align-items:center;display:flex!important;flex-direction:column;transition:transform var(--tabs-transition),filter var(--tabs-transition);width:100%}body.animation-level-0 .chat{transition:none!important}.chat:not(.active):not(:last-child){filter:brightness(.8)}@media only screen and (min-width:926px){.chat:not(.active){transform:translate3d(calc((100vw - min(40vw, 420px))*-.25),0,0)}.chat:not(.active):last-child{transform:translate3d(calc(100vw - min(40vw, 420px)),0,0)}}@media only screen and (min-width:1681px){.chat:not(.active){transform:translate3d(calc((1680px - var(--right-column-width))*-.25),0,0)}.chat:not(.active):last-child{transform:translate3d(calc(1680px - var(--right-column-width)),0,0)}}@media only screen and (min-width:1276px)and (max-width:1680px){.chat:not(.active){transform:translate3d(-25vw,0,0)}.chat:not(.active):last-child{transform:translate3d(75vw,0,0)}}@media only screen and (max-width:925px){.chat:not(.active){transform:translate3d(-25vw,0,0)}.chat:not(.active):last-child{transform:translate3d(100vw,0,0)}}.chat.no-forwards .bubble-beside-button.forward{display:none}.chat.no-forwards .bubbles{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.chat-background{background-color:#e6ebee;overflow:hidden}html.night .chat-background{background-color:var(--border-color)}.chat-background.no-transition:before{transition:none!important}.chat-background,.chat-background-item{bottom:0;left:0;position:absolute!important;right:0;top:0}.chat-background-item.is-image{background-color:inherit;background-image:url(assets/img/bg.jpeg);background-position:50%;background-size:cover}.chat-background-item.is-pattern{align-items:center;background-color:#000!important;background-image:none!important;background-repeat:repeat-x;background-size:contain;display:flex;justify-content:center;margin:0!important}@media only screen and (min-width:1276px){.chat-background-item.is-pattern{height:150%;top:-25%}}body.animation-level-2 .chat-background-item{opacity:0;transition:opacity var(--transition-standard-out)}body.animation-level-2 .chat-background-item.is-visible:not(.backwards){opacity:1;transition:opacity var(--transition-standard-in)}@media only screen and (min-width:1276px){body.animation-level-2 .chat-background-item{margin:-18.5rem 0 -22rem;transform:scale(1);transform-origin:left center;transition:transform var(--transition-standard-out),opacity var(--transition-standard-out)!important}body.animation-level-2.is-right-column-shown .chat-background-item{transform:scale(.666666667);transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)!important}}.chat-background-item-canvas{--opacity-max:1;opacity:var(--opacity-max);position:absolute;width:100%}.chat-background-item:not(.is-dark) .chat-background-item-pattern-canvas{mix-blend-mode:soft-light}.chat-background-item-color-canvas{height:100%;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:cover;mask-size:cover}.chat .drops-container{--padding:20px;--pinned-floating-height:0px;top:calc(56px + var(--pinned-floating-height) + var(--padding))}@media only screen and (min-width:1276px){[dir=ltr] body.is-right-column-shown .chat .drops-container{right:calc(var(--right-column-width))}[dir=rtl] body.is-right-column-shown .chat .drops-container{left:calc(var(--right-column-width))}}@media only screen and (max-width:600px){.chat .drops-container{--padding:10px}}.chat .drop{--wrapper-padding:15px;max-width:696px}.chat[data-type=chat] .bubbles.is-chat-input-hidden .bubbles-date-group:last-of-type .bubbles-group:last-of-type .bubble:last-of-type{margin-bottom:1.25rem}.chat-input-wrapper{--padding-vertical:.3125rem;--padding-horizontal:var(--chat-input-inner-padding);--padding:var(--padding-vertical) var(--padding-horizontal);--button-size:2.125rem;--button-horizontal-margin:.125rem;align-items:center;border-radius:1rem;display:flex;flex:0 0 auto;flex-direction:column;justify-content:center;max-height:30rem;max-width:calc(100% - var(--chat-input-size) - .5rem);min-height:var(--chat-input-size);position:relative;width:calc(100% - var(--chat-input-size) - .5rem);z-index:3}.chat-input-wrapper:before{background-color:#fff;border-radius:inherit;bottom:0;box-shadow:0 1px 8px 1px rgba(0,0,0,.12);content:\" \";left:0;opacity:1;right:0;top:0}.chat-input-control,.chat-input-wrapper:before{background-color:var(--surface-color);position:absolute}.chat-input-control{--padding-vertical:.3125rem;--padding-horizontal:var(--chat-input-inner-padding);--padding:var(--padding-vertical) var(--padding-horizontal);height:var(--chat-input-size);margin:0 auto;padding:var(--padding);visibility:hidden;width:auto;z-index:3}.chat-input-control:before{opacity:0}.chat-input-control-button{height:2.5rem;justify-content:center;padding:0 .625rem}@media only screen and (max-width:600px){.chat-input-control-button{font-size:15px}}[dir=ltr] .chat-input-control-button:before{margin-right:10px}[dir=rtl] .chat-input-control-button:before{margin-left:10px}.fake-selection-wrapper,.selection-wrapper{max-width:calc(100% - var(--chat-input-padding)*2);position:absolute;top:0;width:28.75rem}.chat-input-control,.selection-wrapper{opacity:0}.selection-wrapper{background-color:var(--surface-color)}.selection-wrapper:before{content:none}.selection-wrapper .selection-container{align-items:center;border-radius:inherit;display:flex;font-size:15px;height:100%;justify-content:space-between;padding:inherit;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.selection-wrapper .selection-container-left,.selection-wrapper .selection-container-right{align-items:center;display:flex;justify-content:space-between;transform:translateX(0)}.selection-wrapper .selection-container-right{flex:0 0 auto}.selection-wrapper .selection-container-count{color:var(--primary-text-color);flex-grow:1;font-weight:var(--font-weight-bold);text-transform:capitalize;white-space:nowrap}[dir=ltr] .selection-wrapper .selection-container .btn-icon{margin-left:6px;margin-right:5px}[dir=rtl] .selection-wrapper .selection-container .btn-icon{margin-left:5px;margin-right:6px}.selection-wrapper .selection-container .btn-icon{height:42px;line-height:42px;width:42px}.selection-wrapper .selection-container .btn-primary{height:2.5rem;width:auto}@media only screen and (max-width:600px){.selection-wrapper .selection-container .btn-primary{padding:0 .5rem}.selection-wrapper .selection-container .btn-primary.tgico-send2{padding:0 2px}}@media only screen and (max-width:380px){.selection-wrapper .selection-container .btn-primary{font-size:0}.selection-wrapper .selection-container .btn-primary:before{margin:0}}[dir=ltr] .selection-wrapper .selection-container-forward:before{margin-right:14px}[dir=rtl] .selection-wrapper .selection-container-forward:before{margin-left:14px}[dir=ltr] .selection-wrapper .selection-container-delete{margin-left:.375rem;margin-right:.625rem}[dir=rtl] .selection-wrapper .selection-container-delete{margin-left:.625rem;margin-right:.375rem}[dir=ltr] .selection-wrapper .selection-container-delete:before{margin-right:10px}[dir=rtl] .selection-wrapper .selection-container-delete:before{margin-left:10px}.fake-wrapper{position:absolute;visibility:hidden;z-index:-1}[dir=ltr] .fake-rows-wrapper{left:var(--padding-horizontal)}[dir=rtl] .fake-rows-wrapper{right:var(--padding-horizontal)}.fake-rows-wrapper{top:0;width:calc(100% - var(--chat-input-size) - var(--padding-horizontal)*2 - .5rem)}.rows-wrapper-wrapper{display:flex;width:100%}.rows-wrapper-wrapper.is-centering-to-control:not(.backwards) .rows-wrapper:before{opacity:0}.rows-wrapper-wrapper.is-centering-to-control:not(.backwards)~.chat-input-control{opacity:1;visibility:visible}.rows-wrapper-wrapper.is-centering-to-control:not(.backwards)~.chat-input-control:before{opacity:1}.rows-wrapper-wrapper.is-centering-to-control.animating .rows-wrapper:before,.rows-wrapper-wrapper.is-centering-to-control.animating~.chat-input-control:before{transition:opacity .05s .15s}.rows-wrapper-wrapper.is-centering-to-control.animating~.chat-input-control{transition:opacity .1s 75ms,visibility 0s 0s}.rows-wrapper-wrapper.is-centering-to-control.animating.backwards .rows-wrapper:before,.rows-wrapper-wrapper.is-centering-to-control.animating.backwards~.chat-input-control:before{transition:opacity .05s 0s}.rows-wrapper-wrapper.is-centering-to-control.animating.backwards~.chat-input-control{transition:opacity .1s 0s,visibility 0s .2s}[dir=ltr] .rows-wrapper{border-bottom-right-radius:0}[dir=rtl] .rows-wrapper{border-bottom-left-radius:0}.rows-wrapper{transform:translateX(0) scaleX(1)}.rows-wrapper .bubble-tail{opacity:1}@media only screen and (max-width:600px){.rows-wrapper{--padding-vertical:1px}}@media only screen and (max-width:420px){.rows-wrapper{max-width:100%}}@media only screen and (max-height:569px){.rows-wrapper{--padding-vertical:1px}}[dir=ltr] .rows-wrapper .bubble-tail{right:-8.4px}[dir=rtl] .rows-wrapper .bubble-tail{left:-8.4px}.rows-wrapper .bubble-tail{fill:var(--surface-color);bottom:-1px;height:20px;position:absolute;transform:scaleX(-1);width:11px}.is-rtl .rows-wrapper .bubble-tail{transform:scaleX(1)}.rows-wrapper .attach-file.menu-open{background-color:var(--light-primary-color)!important;color:var(--primary-color)}.rows-wrapper .attach-file.btn-disabled{opacity:var(--disabled-opacity)}.rows-wrapper>div{align-items:center;background-color:var(--surface-color);border-radius:1rem;display:flex;justify-content:space-between;padding:var(--padding);position:relative;width:100%}.rows-wrapper .reply-wrapper{align-items:center;height:0;justify-content:flex-start;margin-bottom:-.5625rem;opacity:0;padding:.5625rem var(--padding-horizontal) 0;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:2}body.animation-level-2 .rows-wrapper .reply-wrapper{transition:height .15s ease-out,opacity .15s ease-out}@media only screen and (max-height:569px),only screen and (max-width:600px){.rows-wrapper .reply-wrapper{margin-bottom:-.3125rem;padding-top:.3125rem}}.chat.is-helper-active .rows-wrapper .reply-wrapper{height:45px;opacity:1;pointer-events:inherit}.rows-wrapper .reply-wrapper .reply{flex:1 1 auto;margin-left:.625rem;margin-right:.625rem;order:1}.rows-wrapper .reply-wrapper .reply-icon{order:0;pointer-events:none}.rows-wrapper .reply-wrapper .reply-cancel{order:2}.rows-wrapper .reply-wrapper .reply-subtitle{color:var(--secondary-text-color)!important;height:1.125rem}.rows-wrapper .reply-wrapper .reply .peer-title{font-weight:400}[dir=ltr] .rows-wrapper .reply-wrapper .btn-menu{left:3.125rem}[dir=rtl] .rows-wrapper .reply-wrapper .btn-menu{right:3.125rem}.rows-wrapper .reply-wrapper .btn-menu{bottom:calc(100% + .5rem);top:auto;transform:scale(1)!important}[dir=ltr] .rows-wrapper .reply-wrapper .btn-menu-item{padding-right:1.5rem}[dir=rtl] .rows-wrapper .reply-wrapper .btn-menu-item{padding-left:1.5rem}.rows-wrapper .reply-wrapper .btn-menu-item-text{order:1}[dir=ltr] .rows-wrapper .reply-wrapper .btn-menu-item .checkbox-field{margin-right:var(--icon-margin)}[dir=rtl] .rows-wrapper .reply-wrapper .btn-menu-item .checkbox-field{margin-left:var(--icon-margin)}.rows-wrapper .reply-wrapper .btn-menu-item .checkbox-field{--size:1.25rem;margin:0;order:0}.rows-wrapper .reply-wrapper .btn-menu-item .checkbox-box-background,.rows-wrapper .reply-wrapper .btn-menu-item .checkbox-box-border{display:none}.rows-wrapper .reply-wrapper .btn-menu-item .checkbox-box-check use{stroke:var(--primary-text-color)}@media only screen and (max-width:600px){[dir=ltr] .rows-wrapper .reply-wrapper .btn-menu{left:calc(var(--padding-horizontal)*-1)}[dir=rtl] .rows-wrapper .reply-wrapper .btn-menu{right:calc(var(--padding-horizontal)*-1)}}.rows-wrapper .input-message-input{margin-top:-1px;max-height:27.5rem!important}@media only screen and (max-height:30rem){.rows-wrapper .input-message-input{max-height:max(36px,calc(100vh - 10rem))}}@media only screen and (max-width:600px){.rows-wrapper .input-message-input{max-height:10rem}}.rows-wrapper .input-message-input[data-inline-placeholder]:after{color:#a2acb4;content:attr(data-inline-placeholder);pointer-events:none}.rows-wrapper .new-message-wrapper{--send-as-size:1.875rem;--send-as-margin-left:.25rem;--send-as-margin-right:.375rem;--send-as-total-size:calc(var(--send-as-size) + var(--send-as-margin-left) + var(--send-as-margin-right));--commands-size:2.375rem;--commands-margin-left:.25rem;--commands-margin-right:.375rem;--commands-total-size:calc(var(--commands-size) + var(--commands-margin-left) + var(--commands-margin-right));--offset-translateX:0px;align-items:flex-end;min-height:var(--chat-input-size)}.rows-wrapper .new-message-wrapper .new-message-bot-commands,.rows-wrapper .new-message-wrapper .new-message-send-as-container{bottom:calc(var(--padding-vertical) + .4375rem);cursor:pointer;flex:0 0 auto;opacity:0;position:absolute;transform:scale(0);z-index:2}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-bot-commands{margin-left:var(--commands-margin-left)}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-bot-commands{margin-right:var(--commands-margin-left)}.rows-wrapper .new-message-wrapper .new-message-bot-commands{align-items:center;background-color:var(--primary-color);border-radius:1.875rem;cursor:pointer;display:flex;height:1.875rem;justify-content:center;width:var(--commands-size)}.rows-wrapper .new-message-wrapper .new-message-bot-commands .animated-menu-close-icon{position:relative}.rows-wrapper .new-message-wrapper .new-message-bot-commands-icon-scale{align-items:center;display:flex;justify-content:center;transform:scale(.875)}.rows-wrapper .new-message-wrapper .new-message-bot-commands .animated-menu-close-icon{--color:#fff}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-send-as-container{margin-left:var(--send-as-margin-left)}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-send-as-container{margin-right:var(--send-as-margin-left)}.rows-wrapper .new-message-wrapper .new-message-send-as-container{background:none!important;height:var(--send-as-size);width:var(--send-as-size)}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{right:auto}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{left:auto}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{left:calc(var(--padding-horizontal)*-1 - .25rem)!important}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{right:calc(var(--padding-horizontal)*-1 - .25rem)!important}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{height:auto;max-height:20rem;max-width:20rem;top:auto;transform:scaleX(1);width:auto}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item{height:2.25rem}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-header{height:1.875rem}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-icon{margin-right:calc(var(--icon-margin) - .5rem)}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-icon{margin-left:calc(var(--icon-margin) - .5rem)}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-icon.active:before{--offset:-.125rem;border:.0625rem solid var(--primary-color);border-radius:inherit;bottom:var(--offset);content:\" \";left:var(--offset);position:absolute;right:var(--offset);top:var(--offset)}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-text{display:flex;flex-direction:column;justify-content:center;line-height:1!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-subtitle{font-size:.8125rem;font-weight:400}.rows-wrapper .new-message-wrapper .new-message-send-as-avatar{opacity:0;pointer-events:none;position:absolute;transform:scale(0)}.rows-wrapper .new-message-wrapper .new-message-send-as-avatar.is-visible:not(.backwards){opacity:1;transform:scale(1)}.rows-wrapper .new-message-wrapper .new-message-send-as-avatar.is-visible.animating{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.rows-wrapper .new-message-wrapper .new-message-send-as-close{align-items:center;background-color:var(--primary-color);border-radius:50%;color:#fff;display:flex;font-size:1.375rem;height:inherit;justify-content:center;width:inherit;z-index:1}.rows-wrapper .new-message-wrapper.has-offset[data-offset=as]{--offset-translateX:var(--send-as-total-size)}.rows-wrapper .new-message-wrapper.has-offset[data-offset=commands]{--offset-translateX:48px}.rows-wrapper .new-message-wrapper.has-offset .input-message-container,.rows-wrapper .new-message-wrapper.has-offset .toggle-emoticons{transform:translateX(0)}.rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .toggle-emoticons{transform:translateX(var(--offset-translateX))}[dir=ltr] .rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .input-message-container{margin-right:var(--translateX)}[dir=rtl] .rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .input-message-container{margin-left:var(--translateX)}.rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .input-message-container{--translateX:calc(var(--offset-translateX));transform:translate(var(--translateX))}.rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .new-message-bot-commands,.rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .new-message-send-as-container{opacity:1;transform:scale(1)}.rows-wrapper .new-message-wrapper.has-offset.animating .input-message-container,.rows-wrapper .new-message-wrapper.has-offset.animating .toggle-emoticons{transition:transform var(--transition-standard-in)}.rows-wrapper .new-message-wrapper.has-offset.animating .new-message-bot-commands,.rows-wrapper .new-message-wrapper.has-offset.animating .new-message-send-as-container{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.rows-wrapper .new-message-wrapper .btn-menu{bottom:calc(100% + 1.125rem)}@media only screen and (max-height:569px),only screen and (max-width:600px){.rows-wrapper .new-message-wrapper .btn-menu{bottom:calc(100% + .875rem)}}.rows-wrapper .new-message-wrapper .btn-menu.top-left{right:calc(var(--padding-horizontal)*-1 - .125rem)}.rows-wrapper .new-message-wrapper .btn-menu.top-right{left:calc(var(--padding-horizontal)*-1 - .125rem)}.rows-wrapper .btn-icon{color:var(--secondary-text-color);flex:0 0 auto;font-size:1.5rem;height:var(--button-size);margin-bottom:5px;margin-left:var(--button-horizontal-margin);margin-right:var(--button-horizontal-margin);margin-top:0;padding:0;width:var(--button-size)}.rows-wrapper .btn-icon.active{color:var(--primary-color)}.input-message-container{align-items:center;align-self:center;display:flex;flex:1 1 auto;max-height:inherit;min-height:calc(var(--chat-input-size) - var(--padding-vertical)*2);overflow:hidden;position:relative;width:1%}.input-message-container .scrollable{position:relative}.input-message-input{--custom-emoji-size:var(--messages-custom-emoji-size);background:none;border:none;font-size:var(--messages-text-size);line-height:var(--line-height);outline:none;overflow-y:none;padding:.5rem .5625rem;resize:none;width:100%}.input-message-input pre{display:inline;margin:0}body.animation-level-2 .input-message-input{transition:height .1s}.bubbles{--translateY:0;flex:1 1 auto;position:relative;transform:translate3d(0,var(--translateY),0);transition:transform var(--transition-standard-out);width:100%}body.animation-level-0 .bubbles{transition:none!important}.chat[data-type=chat] .bubbles.is-chat-input-hidden.is-selecting:not(.backwards){--translateY:-78px;transition:transform var(--transition-standard-in)}@media only screen and (max-width:600px){.chat[data-type=chat] .bubbles.is-chat-input-hidden.is-selecting:not(.backwards){--translateY:-58px}}.chat[data-type=chat] .bubbles.is-chat-input-hidden.is-selecting:not(.backwards) .bubbles-inner{transform:translateY(calc(var(--translateY)*-1));transition:transform var(--transition-standard-in)}.bubbles>.scrollable{display:block;height:auto}@media only screen and (min-width:1276px){body.is-right-column-shown .bubbles{transform:translate3d(calc(var(--right-column-width)/-2),var(--translateY),0);transition:transform var(--transition-standard-in)}}body.animation-level-2 .bubbles.is-selecting .bubbles-group-avatar,body.animation-level-2 .bubbles.is-selecting .is-in .bubble-content-wrapper{transition:var(--bubble-transition-out)}body.animation-level-2 .bubbles.is-selecting:not(.backwards) .bubbles-group-avatar,body.animation-level-2 .bubbles.is-selecting:not(.backwards) .is-in .bubble-content-wrapper{transition:var(--bubble-transition-in)}.bubbles.is-selecting:not(.backwards) .is-in .bubble-content-wrapper{transform:translateX(2.5rem) scale(1)}.bubbles.is-selecting:not(.backwards) .bubbles-group-avatar{transform:translate3d(2.5rem,0,0) scale3d(.76,.76,1)}.bubbles:not(.scrolled-down):not(.search-results-active)+.chat-input .bubbles-go-down{cursor:pointer;opacity:1;visibility:visible}body.animation-level-2 .bubbles:not(.scrolled-down):not(.search-results-active)+.chat-input .bubbles-go-down{transition:opacity var(--layer-transition),visibility 0s 0s!important}.bubbles:not(.scrolled-down):not(.search-results-active)+.chat-input .bubbles-go-mention{--translateY:calc(var(--chat-input-size)*-1 - 0.625rem)}.bubbles .search-group.search-group-messages{padding:.25rem 0 .5rem}.bubbles-inner{display:flex;flex-direction:column;justify-content:flex-end;margin:0 auto;max-width:var(--messages-container-width);min-height:100%;padding:0 .8125rem;transform:translateY(0);transition:transform var(--transition-standard-out);width:100%}body.animation-level-0 .bubbles-inner{transition:none!important}@media only screen and (min-width:1276px){.bubbles-inner{width:calc(100% - var(--right-column-width))}}@media only screen and (max-width:600px){.bubbles-inner{padding:0 .5rem}}.bubbles-inner:after{content:\" \";height:.125rem}[dir=ltr] .bubbles-inner.is-chat .is-in .bubble-content-wrapper{margin-left:45px}[dir=rtl] .bubbles-inner.is-chat .is-in .bubble-content-wrapper{margin-right:45px}@media only screen and (max-width:600px){.bubbles-inner.is-chat .is-in .bubble-content-wrapper{max-width:calc(100% - var(--message-handhelds-margin))}}.bubbles-inner.is-channel:not(.is-chat) .bubble-content-wrapper{max-width:100%}.bubbles-inner.is-channel:not(.is-chat) .bubble.with-beside-button .bubble-content-wrapper{max-width:calc(100% - var(--message-beside-button-margin)*-1)!important}.bubbles-inner.is-chat .message,.bubbles-inner.is-chat .name,.bubbles-inner:not(.is-channel) .message,.bubbles-inner:not(.is-channel) .name{max-width:480px}.bubbles-inner.is-scrolling .is-sticky{opacity:.99999!important}html.is-safari .bubbles-inner.is-scrolling .is-sticky{transform:translateY(calc(var(--translateY)*-1))}body.animation-level-2 html.is-safari .bubbles-inner.is-scrolling .is-sticky{transition:transform var(--transition-standard-in)}.bubbles-inner>.bubble.is-in{width:100%}@media only screen and (min-width:1276px){.bubbles-inner>.bubble.is-in .bubble-content-wrapper{max-width:85%}}.bubbles-go-down{cursor:default;opacity:0;transform:none!important;transition:opacity var(--layer-transition),visibility 0s .2s!important;visibility:hidden}.bubbles-go-mention{--translateY:0;cursor:default;opacity:0;transition:transform var(--layer-transition),opacity var(--layer-transition),visibility 0s .2s!important;visibility:hidden}.bubbles-go-mention.is-visible{cursor:pointer;opacity:1;transition:transform var(--layer-transition),opacity var(--layer-transition),visibility 0s 0s!important;visibility:visible}.chat-secondary-button{align-items:center;background-color:var(--surface-color)!important;border-radius:50%;box-shadow:0 1px 8px 1px rgba(0,0,0,.12)!important;color:var(--secondary-text-color);display:flex;font-size:1.5rem;justify-content:center;position:absolute}body.animation-level-0 .chat-secondary-button{transition:none!important}.chat-secondary-button:before{position:relative}.chat-secondary-button:after{border-radius:inherit;bottom:0;content:\" \";left:0;position:absolute;right:0;top:0}html.no-touch .chat-secondary-button:active:after,html.no-touch .chat-secondary-button:hover:after{background-color:var(--light-secondary-text-color)}[dir=ltr] .bubbles-corner-button{right:var(--chat-input-padding)}[dir=rtl] .bubbles-corner-button{left:var(--chat-input-padding)}.bubbles-corner-button{bottom:calc(var(--chat-input-size) + var(--bottom) + 10px);overflow:visible;z-index:2}[dir=ltr] .bubbles-corner-button .badge{right:-.25rem}[dir=rtl] .bubbles-corner-button .badge{left:-.25rem}.bubbles-corner-button .badge{position:absolute;top:-.25rem}.bubbles-corner-button .badge.badge-primary:not(.badge-gray){background-color:var(--chatlist-status-color)}@media only screen and (max-width:600px){[dir=ltr] .bubbles-corner-button .badge{right:.1875rem}[dir=rtl] .bubbles-corner-button .badge{left:.1875rem}.bubbles-corner-button .badge{top:-.75rem}}.popup.popup-delete-message .popup-header{margin-bottom:1rem}body.is-calling .topbar,body.is-calling .topbar-call-container{transform:translateY(0)}body.is-calling.animation-level-2 .topbar,body.is-calling.animation-level-2 .topbar-call-container{transition:transform var(--transition-standard-out)}body.is-calling:not(.backwards) .topbar,body.is-calling:not(.backwards) .topbar-call-container{transform:translateY(var(--topbar-call-height))}body.is-calling:not(.backwards):not(.animating){--topbar-floating-call-height:var(--topbar-call-height)}@media only screen and (min-width:1276px){body.is-right-column-shown{--topbar-floating-scaleX:calc(1 - var(--right-column-proportion))}}.topbar{--topbar-height:3.5rem;--pinned-floating-audio-height:0px;--pinned-floating-message-height:0px;--pinned-floating-height:calc(var(--pinned-floating-audio-height) + var(--pinned-floating-message-height) + var(--topbar-floating-call-height));--pinned-audio-height:52px;--pinned-message-height:52px;cursor:pointer!important;margin-bottom:var(--pinned-floating-height);max-height:var(--topbar-height)!important;min-height:var(--topbar-height)!important;position:relative;width:100%;z-index:1}.topbar:before{box-shadow:0 1px 5px -1px rgba(0,0,0,.21);content:\" \";height:calc(var(--topbar-height) + var(--pinned-floating-height) - var(--topbar-floating-call-height));left:0;pointer-events:none;position:absolute;right:0;top:0}.topbar.is-pinned-audio-floating{--pinned-floating-audio-height:var(--pinned-audio-height)}.topbar.is-pinned-message-floating{--pinned-floating-message-height:var(--pinned-message-height)}.topbar:not(.is-pinned-message-floating) .chat-utils{position:relative;z-index:1}.topbar.is-pinned-audio-floating.is-pinned-message-floating .pinned-message{top:calc(var(--topbar-height) + var(--pinned-audio-height))}.topbar.is-pinned-audio-floating.is-pinned-message-floating .pinned-message:before{border-top:none}@media only screen and (min-width:601px){.topbar .menu-search{display:none}.topbar.is-pinned-message-shown:not(.hide-pinned) .pinned-message{display:flex}}@media only screen and (min-width:926px){.chat:first-child .topbar .sidebar-close-button{display:none}[dir=ltr] .chat:first-child .topbar .chat-info{padding-left:.1875rem}[dir=rtl] .chat:first-child .topbar .chat-info{padding-right:.1875rem}}@media only screen and (min-width:1276px){.topbar .pinned-container-wrapper-utils{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar .pinned-container-wrapper-utils{transform:translate3d(calc(var(--right-column-width)*-1),0,0);transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar .pinned-container-wrapper-utils{transition:none}}.topbar .sidebar-close-button{position:absolute}.topbar .user-title{align-items:center;display:flex;font-size:1rem;font-weight:var(--font-weight-bold);line-height:1.5rem;max-width:calc(100% - 1.5rem)}.topbar .user-title span.emoji{vertical-align:inherit}.topbar .info,.topbar .peer-title{line-height:var(--line-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topbar .info:not(:empty){margin-top:1px}.topbar .btn-menu-toggle .btn-menu{max-height:calc(var(--vh)*100 - 4.375rem);top:calc(100% + 7px)}@media only screen and (max-width:600px){.topbar .btn-menu-toggle .btn-menu{max-height:calc(var(--vh)*100 - 3.75rem);top:29px}.topbar .btn-menu-toggle{margin-left:0}}[dir=ltr] .topbar .chat-info{padding-left:49px}[dir=rtl] .topbar .chat-info{padding-right:49px}.topbar .chat-info{flex:1 1 auto;max-width:calc(100% - var(--utils-width));overflow:hidden}@media only screen and (max-width:600px){[dir=ltr] .topbar .chat-info{padding-left:52px}[dir=rtl] .topbar .chat-info{padding-right:52px}}@media only screen and (min-width:1276px){body.is-right-column-shown .topbar .chat-info{max-width:calc(100% - var(--right-column-width) - var(--utils-width))}}.topbar .chat-info-container{align-items:center;display:flex;flex:1 1 auto;height:3.5rem;justify-content:space-between;max-height:3.5rem;max-width:100%}.topbar .chat-utils{align-items:center;display:flex;flex:0 0 auto}@media only screen and (min-width:1276px){.topbar .chat-utils{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar .chat-utils{transform:translate3d(calc(var(--right-column-width)*-1),0,0);transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar .chat-utils{transition:none}}@media only screen and (max-width:600px){.topbar .chat-utils>.btn-icon:not(.btn-menu-toggle){display:none}}[dir=ltr] .topbar .chat-join{margin-right:.5rem}[dir=rtl] .topbar .chat-join{margin-left:.5rem}.topbar .chat-join{font-size:.875rem;font-weight:400;height:2.25rem;padding:0 1.375rem;width:auto}.topbar .chat-join:not(.hide)+.chat-mute-button{display:none}[dir=ltr] .topbar .content{padding-left:1.125rem}[dir=rtl] .topbar .content{padding-right:1.125rem}.topbar .content{flex:1 1 auto;max-width:100%;overflow:hidden}.topbar .person{align-items:center;display:flex}.topbar .person-avatar{flex:0 0 auto}.topbar .person .bottom{color:var(--secondary-text-color);font-size:.875rem}.topbar .person .bottom .online{color:var(--primary-color)}.topbar.hide-pinned{--pinned-floating-height:0px}.topbar.hide-pinned .pinned-container{display:none}.topbar.hide-pinned+.bubbles .bubbles-inner{margin-bottom:.25rem}[dir=ltr] .chat:not([data-type=chat]) .topbar .content{padding-left:16px}[dir=rtl] .chat:not([data-type=chat]) .topbar .content{padding-right:16px}[dir=ltr] .topbar-call-container{left:1px;right:0}[dir=rtl] .topbar-call-container{left:0;right:1px}.topbar-call-container{color:#fff;cursor:pointer!important;height:var(--topbar-call-height)!important;min-height:auto!important;position:absolute;top:calc(var(--topbar-call-height)*-1);z-index:2}body:not(.has-chat) .topbar-call-container{background:none!important}@media only screen and (max-width:925px){[dir=ltr] .topbar-call-container{left:0}[dir=rtl] .topbar-call-container{right:0}}.topbar-call-container .btn-icon{color:inherit;flex:0 0 auto;height:2.5rem;padding:0;width:2.5rem}.topbar-call-container .peer-title{font-weight:var(--font-weight-bold);white-space:nowrap}@media only screen and (max-width:480px){.topbar-call-container:not(.is-call) .topbar-call-left,.topbar-call-container:not(.is-call) .topbar-call-right{width:auto}.topbar-call-container:not(.is-call) .group-call-description{display:none}.topbar-call-container.is-call .topbar-call-left,.topbar-call-container.is-call .topbar-call-right{width:6.25rem}.topbar-call-container.is-call .call-description:not(.has-duration){display:none}}.topbar-call-left,.topbar-call-right{flex:0 0 auto;width:12rem}.topbar-call-left{align-items:center;display:flex}[dir=ltr] .topbar-call-left .btn-icon{margin-right:.375rem}[dir=rtl] .topbar-call-left .btn-icon{margin-left:.375rem}.topbar-call-left .call-description{white-space:nowrap}.topbar-call-left .call-description-duration{font-weight:var(--font-weight-bold)}.topbar-call-center{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media only screen and (min-width:1276px){.topbar-call-center{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar-call-center{transform:translate3d(calc(var(--right-column-width)*-.5),0,0);transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar-call-center{transition:none}.topbar-call-center{padding:0 calc(var(--right-column-width)/2)}}.topbar-call-right{display:flex;justify-content:flex-end}@media only screen and (min-width:1276px){.topbar-call-right{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar-call-right{transform:translate3d(calc(var(--right-column-width)*-1),0,0);transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar-call-right{transition:none}}.topbar-call-weave{bottom:-1.125rem;left:0;pointer-events:none;position:absolute;right:0;top:0;transform:scale(var(--topbar-floating-scaleX),-1);transform-origin:left center;z-index:-1}.is-rtl .topbar-call-weave{transform-origin:right center}@media only screen and (min-width:1276px){.topbar-call-weave{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar-call-weave{transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar-call-weave{transition:none}}.topbar-call-weave-canvas{height:100%;width:100%}.topbar .back-unread-badge{position:absolute;right:-.5rem;top:-.25rem}@media only screen and (min-width:601px){.topbar .back-unread-badge{display:none}}@keyframes bubbleSelected{0%{opacity:0}25%{opacity:1}to{opacity:0}}.bubbles-date-group{position:relative}.bubbles-date-group .sticky_sentinel--top{height:.25rem;top:0}.bubbles-group{position:relative}.bubbles-group-avatar{bottom:.25rem;cursor:pointer;pointer-events:all;position:sticky!important;top:0}.bubbles.is-selecting .bubbles-group-avatar{transform:translateZ(0) scaleX(1);transform-origin:bottom}.bubbles-group-avatar.is-gesturing-reply{transform:translateX(0)}.bubbles-group-avatar.is-gesturing-reply.animating.backwards{transition:transform var(--transition-standard-out)}.bubbles-group-avatar-container{bottom:0;display:flex;flex-direction:column-reverse;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:2}.bubble{--line-height:var(--messages-line-height);display:flex;flex-wrap:wrap;margin:0 auto .125rem;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}.bubble.is-gesturing-reply{transform:translateX(0)}.bubble.is-gesturing-reply.animating.backwards{transition:transform var(--transition-standard-out)}.bubble.is-gesturing-reply .bubble-gesture-reply-icon{align-items:center;background-color:var(--message-highlightning-color);border-radius:50%;color:#fff;display:flex;height:var(--message-beside-button-size);justify-content:center;opacity:0;position:absolute;right:var(--message-beside-button-margin);top:50%;transform:translateY(-50%);transform:translateY(-50%) scale(.6);visibility:hidden;width:var(--message-beside-button-size)}.bubble.is-gesturing-reply .bubble-gesture-reply-icon:before{font-size:1.125rem!important}body.animation-level-2 .bubble.is-gesturing-reply .bubble-gesture-reply-icon{transition:transform .1s ease-in-out}.bubble.is-gesturing-reply .bubble-gesture-reply-icon.is-visible{transform:translateY(-50%) scale(1);visibility:visible}.bubble.is-highlighted:after,.bubble.is-selected:after,.bubble:after{bottom:-.0625rem;content:\" \";left:-50%;position:absolute;top:-.0625rem;z-index:-1}.bubble.is-highlighted:after{background-color:var(--message-highlightning-color)}body:not(.animation-level-0) .bubble.is-highlighted:after{animation:bubbleSelected 2s linear}@media only screen and (max-width:600px){.bubble.is-first-unread{max-width:none}}.bubble.is-first-unread:before{background-color:var(--surface-color);color:var(--primary-color);content:\"Unread messages\";font-size:15px;font-weight:var(--font-weight-bold);height:30px;line-height:2.1;margin-bottom:.25rem;margin-left:-50%;margin-right:-50%;position:relative;text-align:center;z-index:2}.bubble.is-first-unread.is-highlighted:after,.bubble.is-first-unread.is-selected:after{top:calc(.0625rem + 30px)}.bubble.is-selected:after{background-color:var(--message-highlightning-color)}body:not(.animation-level-0) .bubble.is-selected:after{animation:fade-in-opacity .2s linear forwards}body:not(.animation-level-0) .bubble.is-selected.backwards:after{animation:fade-in-backwards-opacity .2s linear forwards}.bubble:after,.bubble:before{display:block;width:200%}.bubble.is-multiple-documents:after,.bubble.is-multiple-documents:before{display:none}.bubble.is-multiple-documents .user-avatar{z-index:2}.bubble .replies-footer+.poll-message .poll-footer-button{border-radius:0!important}.bubble-select-checkbox{display:flex;left:0;margin:0;position:absolute;z-index:3}.bubble-select-checkbox .checkbox-box-border{border-color:var(--message-checkbox-border-color)}.bubble-select-checkbox .checkbox-box-background{background-color:var(--message-checkbox-color)}.bubble-select-checkbox .checkbox-box-check use{stroke-width:3.5}.bubble>.bubble-select-checkbox{bottom:.3125rem}.bubble>.bubble-select-checkbox .checkbox-box{box-shadow:0 0 3px 0 rgba(0,0,0,.4)}.bubbles.is-selecting .bubble:not(.is-album) .attachment,.bubbles.is-selecting .bubble:not(.is-album) .audio,.bubbles.is-selecting .bubble:not(.is-album) .document,.bubbles.is-selecting .bubble:not(.is-album) poll-element{pointer-events:none!important}.bubbles.is-selecting .bubble a,.bubbles.is-selecting .bubble img,.bubbles.is-selecting .bubble video{pointer-events:none}.bubble-content{background-color:var(--message-background-color);border-radius:12px;box-shadow:0 1px 2px 0 rgba(16,35,47,.15);display:flex;flex-direction:column-reverse;max-width:100%;min-width:56px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:2}body.animation-level-0 .bubble-content{transition:none}html.is-touch body:not(.no-select) .chat:not(.no-forwards) .bubbles.is-selecting .bubble-content,html.no-touch .chat:not(.no-forwards) .bubbles:not(.is-selecting) .bubble-content{-webkit-user-select:text;-moz-user-select:text;user-select:text}.bubble-content.hover-reaction-visible .bubble-beside-button{transform:translateX(1.125rem)}.bubble.is-out .bubble-content.hover-reaction-visible .bubble-beside-button{transform:translateX(-1.125rem)}.bubble.is-out .bubble-content.hover-reaction-visible .bubble-beside-button.goto-original{transform:translateX(-1.125rem) rotate(180deg)}.bubble-hover-reaction{--size:1.875rem;--offset:calc(var(--size)*-0.75);align-items:center;background-color:var(--surface-color);border-radius:var(--size);bottom:0;box-shadow:var(--menu-box-shadow);cursor:pointer;display:flex;height:1.625rem;justify-content:center;opacity:0;position:absolute;right:var(--offset);transform:scale(.8);width:var(--size);z-index:2}body.animation-level-2 .bubble-hover-reaction{transition:opacity var(--btn-corner-transition),transform var(--btn-corner-transition)}.bubble-hover-reaction.is-visible:not(.backwards){opacity:1;transform:scale(1)}.bubble-hover-reaction-sticker{height:1.125rem;position:relative;width:1.125rem}.bubble.service{max-width:var(--messages-container-width)}.bubble.service .bubble-content{box-shadow:none;margin:0 auto;max-width:100%}.bubble.is-date{font-weight:var(--font-weight-bold);opacity:.99999;padding-bottom:.375rem;pointer-events:none;position:sticky;top:.25rem;transition:opacity .3s ease;z-index:2}.bubble.is-date:after,.bubble.is-date:before{display:none}body.animation-level-0 .bubble.is-date{transition:none}.bubble.is-date.is-sticky{opacity:.00001}.bubbles-inner:not(.is-scrolling) .bubble.is-date.is-sticky .bubble-content{cursor:default}.chat[data-type=chat] .bubble.is-date .bubble-content,.chat[data-type=discussion] .bubble.is-date .bubble-content{cursor:pointer;pointer-events:all}.bubbles:not(.has-sticky-dates) .bubble.is-date{visibility:hidden}.bubbles.has-sticky-dates .bubble.is-date.is-fake{display:none}.bubble.is-date.is-fake{left:50%;opacity:1!important;position:absolute;top:0;transform:translateX(-50%);transition:none!important;visibility:visible!important}.bubble-beside-button{align-items:center;background:var(--message-highlightning-color);border-radius:50%;bottom:0;color:var(--badge-text-color);cursor:pointer;display:flex;font-size:1.5rem;height:var(--message-beside-button-size);justify-content:center;position:absolute;right:var(--message-beside-button-margin);transform:translateX(0);width:var(--message-beside-button-size)}html.no-touch .bubble-beside-button{opacity:0}html.no-touch body.animation-level-2 .bubble-beside-button{transition:opacity .2s ease-in-out,transform .2s ease-in-out}.bubble-view-button{align-items:center;border:1px solid var(--message-primary-color);border-radius:6px;color:var(--message-primary-color);display:flex;height:2rem;justify-content:center;margin:0 .5625rem .5rem;text-decoration:none!important;width:auto}html.no-touch .bubble-view-button:active,html.no-touch .bubble-view-button:hover{background-color:var(--light-filled-message-primary-color)}.bubble-view-button .c-ripple__circle{background-color:var(--message-primary-color);opacity:.08}.message .bubble-view-button{margin:.375rem 0 -.375rem;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.bubble-view-button+.reactions-block{margin-top:.375rem}html.no-touch .bubble:active .bubble-beside-button,html.no-touch .bubble:hover .bubble-beside-button{opacity:1}.bubble .forward{font-size:1.25rem}.bubble.is-group-last{margin-bottom:.5rem}.bubble.is-group-last:after{bottom:-.25rem}.bubbles-inner.is-chat .bubble.is-group-last.is-in>.bubble-select-checkbox{bottom:.1875rem}.bubble.is-group-first:after{top:-.25rem}.bubble:not(.forwarded):not(.must-have-name):not(.is-group-first) .name{display:none}.bubble:not(.forwarded):not(.must-have-name):not(.is-group-first):not(.is-message-empty):not(.is-reply) .message{padding-top:6px}.bubble:not(.is-group-last) .bubble-content-wrapper>.user-avatar{display:none}.bubble.photo .bubble-content,.bubble.video .bubble-content{width:-moz-min-content;width:min-content}.bubble.photo .web,.bubble.video .web{max-width:100%}.bubble.photo .message,.bubble.video .message{max-width:420px}.bubble.webpage .preview-with-document{margin-bottom:0!important;min-width:100%}.bubble.webpage .document{height:3.375rem}@media only screen and (max-width:600px){.bubble.webpage .document{padding-left:44px}}.bubble.webpage .has-document{display:flex;flex-direction:column}.bubble.webpage .has-document .preview-resizer{order:1}.bubble .preview-resizer{display:flex}.bubble img.emoji{height:18px;vertical-align:bottom;width:18px}.bubble .thumbnail{position:absolute}.bubble .canvas-thumbnail{border-radius:inherit}.bubble .canvas-dots{z-index:1}.bubble.emoji-big{--emoji-size:1rem;font-size:0}.bubble.emoji-big .bubble-content{line-height:1}.bubble.emoji-big .attachment{--custom-emoji-size:var(--emoji-size);border-radius:0!important}.bubble.emoji-big .attachment img.emoji{height:var(--emoji-size);max-height:64px;max-width:64px;width:var(--emoji-size)}.bubble.emoji-big .attachment .custom-emoji,.bubble.emoji-big .attachment .emoji{display:inline-block}.bubble.emoji-big:not(.sticker) .attachment{display:block;font-size:var(--emoji-size);max-height:-moz-fit-content!important;max-height:fit-content!important;padding-bottom:1.25rem;padding-top:.25rem;white-space:pre-wrap;word-break:break-word}.bubble.emoji-big:not(.sticker) .attachment span.emoji{height:auto;width:auto}.bubble.emoji-big:not(.sticker) .message{margin-top:-1.125rem}.bubble.emoji-big:not(.sticker) .bubble-content{max-width:min(420px,100%)}.bubble.just-media .bubble-content{background:none!important;box-shadow:none}.bubble.just-media img{-o-object-fit:contain;object-fit:contain}.bubble.just-media.is-message-empty .message{background:var(--message-highlightning-color)}.bubble.emoji-big:not(.sticker) .bubble-content,.bubble.sticker .bubble-content{align-self:flex-start}.bubble.emoji-big:not(.sticker) .message,.bubble.sticker .message{margin-left:auto;position:relative!important;right:0!important}.bubble.sticker .attachment{border-radius:0;position:absolute;z-index:1}.bubble.round .attachment{height:var(--round-video-size)!important;max-height:var(--round-video-size)!important;max-width:var(--round-video-size)!important;width:var(--round-video-size)!important}.bubble.round .media-photo,.bubble.round .media-video{border-radius:50%;pointer-events:none}.bubble:not(.is-message-empty) .attachment{border-bottom-left-radius:0;border-bottom-right-radius:0}.bubble:not(.emoji-big) .attachment{font-size:0}.bubble .attachment{border-radius:inherit;cursor:pointer;display:flex;justify-content:center;max-width:100%;overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble .attachment img,.bubble .attachment video{max-width:100%}.bubble .attachment .download{align-items:center;cursor:pointer;display:flex;height:100%;justify-content:center;left:0;position:absolute;top:0;width:100%}.bubble .attachment .download span{background-color:var(--message-time-background);color:#fff;font-size:23px;text-align:center}.bubble .attachment .download~.video-play,.bubble .attachment .preloader-container~.video-play{display:none}.bubble .media-container-aspecter{margin:0 auto;position:relative;z-index:1}.bubble .media-container-fitted{background-color:transparent!important}.bubble .media-container-fitted>.thumbnail{opacity:.8}.bubble .media-container-fitted>.thumbnail.fade-in{animation:thumbnail-fade-in-opacity .2s ease-in-out forwards}.bubble .preloader-container{z-index:2}.bubble:not(.sticker) .attachment{max-height:min(340px,100%);max-width:min(420px,100%);width:-moz-max-content;width:max-content}.bubble img:not(.emoji),.bubble video{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}html.is-safari .bubble:not(.round) img:not(.emoji),html.is-safari .bubble:not(.round) video{border-radius:inherit}.bubble.is-album .attachment{max-height:none;max-width:min(451px,100%)}.bubble .album-item{background-color:var(--message-highlightning-color);cursor:pointer;max-width:100%;overflow:hidden;position:absolute}body.animation-level-0 .bubble .album-item{transition:none!important}.bubble .album-item img,.bubble .album-item video,.bubble .album-item-media{border-radius:inherit}body.animation-level-0 .bubble .album-item-media{transition:none!important}.bubble .album-item .bubble-select-checkbox{bottom:auto!important;left:auto;right:.5rem;top:.5rem}.bubble .album-item.is-selected{border-radius:0}.bubble .album-item.is-selected .album-item-media{transform:scale(1)}.bubble .album-item.is-selected.animating{transition:border-radius var(--transition-standard-out)}.bubble .album-item.is-selected.animating .album-item-media{transition:transform var(--transition-standard-out),border-radius var(--transition-standard-out)}.bubble .album-item.is-selected:not(.backwards){transition:border-radius var(--transition-standard-in)}.bubble .album-item.is-selected:not(.backwards) .album-item-media{transform:scale(.883333);transition:transform var(--transition-standard-in),border-radius var(--transition-standard-in)}.bubble .album-item.is-selected:not(.backwards),.bubble .album-item.is-selected:not(.backwards) .album-item-media{border-radius:0}html.no-touch .bubble a:active,html.no-touch .bubble a:hover{text-decoration:underline}.bubble-first{align-items:center;justify-content:center;margin-top:.5rem;max-width:100%;order:-1}body.animation-level-0 .bubble-first{flex:1 1 auto}.bubble-first .attachment{pointer-events:none}.bubble-first .bubble-content-wrapper{max-width:100%}.bubble-first.empty-bubble-placeholder{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}body.animation-level-2 .bubble-first.empty-bubble-placeholder .bubble-content-wrapper{transition:var(--bubble-transition-in)}.bubble-first.empty-bubble-placeholder.has-description .service-msg{align-items:flex-start!important;flex-direction:column;padding:.75rem 1rem .875rem!important}.bubble-first.empty-bubble-placeholder.has-description .center{align-self:center}.bubble-first.empty-bubble-placeholder.has-description .empty-bubble-placeholder-title{font-size:1rem!important;font-weight:var(--font-weight-bold)}.bubble-first.empty-bubble-placeholder.has-description .bubble-content{border-radius:1.5rem!important}.bubble-first.empty-bubble-placeholder .empty-bubble-placeholder-line{color:#fff}.bubble-first.empty-bubble-placeholder .empty-bubble-placeholder-line+.empty-bubble-placeholder-line{margin-top:.5rem}.bubble-first.empty-bubble-placeholder .tgico-check{font-size:1.25rem;margin-left:-.1875rem;margin-right:.25rem;vertical-align:bottom}.bubble-first.empty-bubble-placeholder .empty-bubble-placeholder-list-bullet{margin-right:.3125rem}.bubbles.has-groups .bubble-first.empty-bubble-placeholder{pointer-events:none}.bubbles.has-groups .bubble-first.empty-bubble-placeholder .bubble-content-wrapper{opacity:0;transform:scale3d(.8,.8,1) translateX(0)}.bubble-first.empty-bubble-placeholder.empty-bubble-placeholder-group .empty-bubble-placeholder-list-item{margin-top:.4375rem!important}.bubble-first.empty-bubble-placeholder.empty-bubble-placeholder-greeting .service-msg{max-width:232px}.bubble-first.empty-bubble-placeholder.empty-bubble-placeholder-greeting .empty-bubble-placeholder-subtitle{margin-top:.25rem!important}.bubble-first.empty-bubble-placeholder .empty-bubble-placeholder-sticker{cursor:pointer;height:200px;margin-top:.75rem!important;position:relative;width:200px}.bubble-first .time{display:none!important}.bubble-first:after,.bubble-first:before{display:none}.bubble .web{line-height:var(--line-height);margin:.125rem 0 0;max-width:100%;overflow:hidden}.bubble .web+.time{display:block}.bubble .web .preview{border-radius:4px;cursor:pointer;max-height:min(340px,100%);max-width:min(420px,100%);overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:-moz-max-content;width:max-content}.bubble .web .preview img,.bubble .web .preview video{max-width:100%}.bubble .web .preview-resizer:first-child{margin:3px 0}.bubble .web .preview-resizer:first-child:last-child{margin-bottom:2px}.bubble .web .preview.is-round .media-photo,.bubble .web .preview.is-round .media-video{border-radius:50%}.bubble .web.no-text{margin-bottom:.75rem}.bubble .web .title:not(:first-child){margin-top:1px}.bubble .web .text,.bubble .web .title,.bubble .web .webpage-name{font-size:var(--messages-secondary-text-size);line-height:var(--messages-secondary-line-height)}.bubble .web .webpage-name{text-decoration:none}html.no-touch .bubble .web .webpage-name:active,html.no-touch .bubble .web .webpage-name:hover{text-decoration:underline}.bubble .web .text{margin-top:1px;word-break:break-word}.bubble .web .quote{display:flex;max-width:100%;overflow:hidden;width:100%}.bubble .web .quote-text{margin-left:-.625rem;max-width:100%;padding-left:.625rem;width:100%}.bubble .web .quote:before{background-color:var(--primary-color);border-radius:.125rem;content:\" \";flex:0 0 auto;margin:.1875rem .5rem .125rem 0;width:.125rem}.bubble .reply{--font-size:var(--messages-secondary-text-size)}.bubble .document-name{font-size:var(--messages-text-size)}.bubble .document-size{font-size:var(--messages-secondary-text-size)}.bubble.is-square-photo .bubble-content{width:-moz-fit-content;width:fit-content}.bubble.is-square-photo .web .webpage-name{margin-right:1rem}.bubble.is-square-photo .web .preview-resizer{float:right;height:3rem;margin:.1875rem 0 0 .625rem;width:3rem}.bubble.is-square-photo .web .preview{margin:0;max-height:min(3rem,100%);max-width:min(3rem,100%)}.bubble .reply{border-radius:.25rem;cursor:pointer;margin:0 .375rem .375rem;min-width:10rem;padding:.25rem;width:auto}.bubble .reply-media{top:.125rem}.bubble .reply-content{height:auto;max-width:calc(100% - 1.25rem);min-height:32px;overflow:hidden;position:absolute;text-overflow:ellipsis;white-space:nowrap}.bubble .message+.reply{margin-bottom:0}.bubble:not(.just-media) .reply{border-radius:6px}html.no-touch .bubble:not(.just-media) .reply:active,html.no-touch .bubble:not(.just-media) .reply:hover{background-color:var(--light-filled-message-primary-color)}.bubble.just-media .floating-part{background-color:var(--message-highlightning-color);border-radius:12px;margin:0;max-width:15rem;padding:.375rem .625rem;position:absolute;top:0;white-space:nowrap}@media only screen and (max-width:600px){.bubble.just-media .floating-part{max-width:calc(100vw - 1rem - 10px - 100%)}}.bubble.just-media .name{color:#fff!important;line-height:var(--line-height);padding:.375rem .625rem}.bubble.just-media .name .peer-title{font-weight:400!important}.bubble.just-media .reply{height:54px;max-height:54px}@media only screen and (max-width:600px){.bubble.just-media .reply{padding:8px 6px 8px 8px}}.bubble.just-media .reply-content{margin-top:0;max-width:none!important;position:relative}.bubble.just-media .reply i,.bubble.just-media .reply-subtitle,.bubble.just-media .reply-title{color:#fff!important}.bubble.just-media .reply-border{background:#fff!important}.bubble.forwarded .attachment,.bubble.is-reply .attachment,.bubble:not(.hide-name) .attachment{border-top-left-radius:0;border-top-right-radius:0}.bubble .message,.bubble .service-msg{--custom-emoji-size:var(--messages-custom-emoji-size)}.bubble .message{color:var(--primary-text-color);font-size:var(--messages-text-size);line-height:var(--line-height);max-width:100%;padding:0 .5rem .375rem .625rem;position:relative;white-space:pre-wrap;word-break:break-word}.bubble .message .custom-emoji{display:inline-flex}.bubble .message:last-child{padding-top:6px}@media only screen and (max-width:600px){.bubble .audio,.bubble .document{--icon-size:2.25rem}}.bubble .audio .audio-title{font-weight:var(--font-weight-bold)}.bubble .audio .audio-ico{font-size:0}@media only screen and (max-width:600px){.bubble .audio{--icon-margin:.6875rem;height:2.375rem}.bubble .audio .audio-details{margin-bottom:0;margin-top:2px}.bubble .audio .audio-to-text-button{margin-top:-.875rem}.bubble .audio .audio-subtitle{margin-top:-1px}}.bubble .message.audio-message{width:335px}@media only screen and (max-width:600px){.bubble .message.audio-message{width:280px}}.bubble .message.audio-message,.bubble .message.voice-message{max-width:min(100%,364px)!important}@media only screen and (max-width:600px){.bubble .message.audio-message,.bubble .message.voice-message{max-width:min(100%,300px)!important}}.bubble.min-content .bubble-content{width:-moz-min-content;width:min-content}.bubble .message.voice-message .document-message{max-width:-moz-fit-content;max-width:fit-content}.bubble .message.audio-message,.bubble .message.voice-message{padding:8px!important}.bubble .message.call-message,.bubble .message.contact-message{min-width:200px;padding-left:8px}.bubble .message.contact-message .contact{cursor:pointer;display:flex;padding:2px 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble .message.contact-message .contact-avatar{color:#fff}.bubble .message.contact-message .contact-details{display:flex;flex-direction:column;margin-top:8px;padding-left:12px}.bubble .message.contact-message .contact-name{font-size:1rem;font-weight:var(--font-weight-bold)}.bubble .message.contact-message .contact-number{font-size:14px;line-height:1.4}.bubble .message.poll-message{max-width:400px}.bubble .message.document-message{max-width:325px!important}.bubble .message.document-message .document{--icon-margin:.75rem;height:58px}@media only screen and (max-width:600px){.bubble .message.document-message .document{--icon-margin:.5rem;height:44px}.bubble .message.document-message .document .document-size{font-size:.75rem}.bubble .message.document-message .document:not(.document-with-thumb) .document-ico{padding:1.125rem 0 0}}.bubble .message.document-message .document-name{line-height:1.4;margin-top:1px;overflow:hidden;text-overflow:ellipsis}.bubble-call{cursor:pointer;display:flex;flex-direction:column;justify-content:center;padding:.125rem 0 .125rem 2.5625rem;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble-call:before{font-size:1.5rem;left:.3125rem;position:absolute}.bubble-call-title{font-weight:var(--font-weight-bold)}.bubble-call-subtitle{align-items:center;color:var(--secondary-text-color);display:flex;font-size:var(--messages-secondary-text-size);line-height:var(--messages-secondary-line-height);margin-left:-.1875rem;margin-top:.0625rem}.bubble-call-subtitle.is-reason:before{margin-right:.0625rem}.bubble-call-subtitle:before{content:\"\";display:inline-block;font-size:1rem;transform:rotate(135deg)}.bubble-call-subtitle.arrow-red:before{color:var(--danger-color)}.bubble-call-subtitle.arrow-green:before{color:var(--message-out-primary-color)}.bubble .document-wrapper{display:flex;flex-direction:column-reverse}.bubble .document-wrapper .document-message{margin-top:.25rem}.bubble .document .time{align-self:flex-start;height:0}.bubble .document-message+.audio .time,.bubble .document-message+.document .time{display:none!important}.bubble.is-multiple-documents .message{border-radius:inherit;padding:0!important}.bubble.is-multiple-documents .document-container{border-radius:inherit;position:relative}.bubble.is-multiple-documents .document-container .document-selection{bottom:0;left:-75vw;position:absolute;top:0;width:200vw;z-index:-2}.bubble.is-multiple-documents .document-container.is-highlighted .document-wrapper:before,.bubble.is-multiple-documents .document-container.is-selected .document-wrapper:before{background-color:var(--message-background-color);border-radius:inherit;bottom:0;content:\" \";left:0;position:absolute;right:0;top:0;z-index:-1}.bubble.is-multiple-documents .document-container.is-highlighted .document-selection{background-color:var(--message-highlightning-color)}body:not(.animation-level-0) .bubble.is-multiple-documents .document-container.is-highlighted .document-selection{animation:bubbleSelected 2s linear}.bubble.is-multiple-documents .document-container.is-selected .document-selection{background-color:var(--message-highlightning-color)}body:not(.animation-level-0) .bubble.is-multiple-documents .document-container.is-selected .document-selection{animation:fade-in-opacity .2s linear forwards}body:not(.animation-level-0) .bubble.is-multiple-documents .document-container.is-selected.backwards .document-selection{animation:fade-in-backwards-opacity .2s linear forwards}.bubble.is-multiple-documents .document-container .bubble-select-checkbox{--margin-top:.25rem;--margin-left:.125rem;background:#fff;border-radius:50%;left:auto;margin-left:calc(var(--padding-left)*-1 + var(--icon-size) - var(--size) + var(--margin-left));margin-top:calc(var(--icon-size) - var(--size) + var(--margin-top));top:auto}@media only screen and (max-width:600px){.bubble.is-multiple-documents .document-container .bubble-select-checkbox{--size:1.125rem}}.bubble.is-multiple-documents .document-container .bubble-select-checkbox:before{--inner-size:.125rem;border:2px solid var(--secondary-color);border-radius:inherit;content:\" \";height:calc(var(--size) - var(--inner-size)*2);left:var(--inner-size);position:absolute;top:var(--inner-size);width:calc(var(--size) - var(--inner-size)*2)}.bubble.is-multiple-documents .document-container:first-of-type .document-selection{top:-.0625rem}.bubble.is-multiple-documents .document-container:first-of-type .document-wrapper{border-top-left-radius:inherit;border-top-right-radius:inherit;padding-top:.5rem}.bubble.is-multiple-documents .document-container:last-of-type .document-selection{bottom:-.0625rem}.bubble.is-multiple-documents .document-container:last-of-type .document-wrapper{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;padding-bottom:.5rem}.bubble.is-multiple-documents.is-group-first .document-container:first-of-type .document-selection{top:-.25rem}.bubble.is-multiple-documents.is-group-last .document-container:last-of-type .document-selection{bottom:-.25rem}.bubble.is-multiple-documents .document{height:54px!important}@media only screen and (max-width:600px){.bubble.is-multiple-documents .document{height:38px!important}}.bubble.is-multiple-documents .document-wrapper{padding:.25rem .5rem}.bubble.is-multiple-documents .document-wrapper>.name{margin-top:-.1875rem;padding:0 0 .25rem}.bubble .message .audio .time,.bubble .message.contact-message .time,.bubble .message.poll-message .time{bottom:0;position:absolute;right:0}html:not(.is-safari) .bubble .message.voice-message{overflow:hidden}.bubble.is-message-empty .bubble-content-wrapper{width:-moz-min-content;width:min-content}.bubble.is-message-empty .message{background-color:var(--message-time-background);border-radius:.75rem;bottom:.1875rem;padding:0 .3125rem;position:absolute;right:.1875rem;z-index:2}.bubble.is-message-empty .message .time{align-items:center;display:flex;height:calc(var(--messages-time-text-size) + .375rem);margin:0;padding:0;white-space:nowrap}.bubble.is-message-empty .message .time .inner{bottom:auto;color:#fff;margin:inherit;right:auto}.bubble.is-message-empty .message .time .inner:after{color:#fff!important}.bubble.is-message-empty.with-replies:not(.sticker):not(.with-beside-replies) .message{bottom:55px}.bubble.is-message-empty.emoji-big .message,.bubble.is-message-empty.sticker .message,.bubble.is-message-empty.with-replies.round .message{bottom:0}.bubble.is-message-empty:not(.emoji-big) .reactions-block{max-width:-moz-fit-content;max-width:fit-content}.bubble.is-message-empty .reaction-block{--chosen-background-color:var(--primary-color)}html.no-touch .bubble.is-message-empty .reaction-block:not(.is-chosen):active:after,html.no-touch .bubble.is-message-empty .reaction-block:not(.is-chosen):hover:after{background-color:#fff}.bubble.with-reply-markup .bubble-content{min-width:100%}.bubble.with-replies .attachment{border-bottom-left-radius:0;border-bottom-right-radius:0}.bubble.with-beside-replies .bubble-content{min-height:5.5rem}.bubble .colored-name .premium-icon{color:inherit;opacity:.6}.bubble .time{cursor:pointer;direction:ltr;display:inline-flex;float:right;font-size:var(--messages-time-text-size);height:var(--messages-time-text-size);line-height:1;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;visibility:hidden;z-index:1}.bubble .time i{font-size:1.125rem;margin-right:.375rem}.bubble .time-icon{pointer-events:none}.bubble .time-icon:not(:first-child){margin-left:2px}.bubble .time i.edited{font-size:inherit;overflow:visible}.bubble .time .inner{align-items:center;bottom:0;color:var(--message-time-color);display:flex;height:var(--messages-time-text-size);line-height:1;padding:inherit;pointer-events:all;position:absolute;right:0;visibility:visible;white-space:nowrap}.bubble .time .inner:after{color:var(--message-status-color)}.bubble .time .tgico-pinnedchat{margin-right:.125rem}.bubble .time.is-block{display:block;float:none}.bubble.webpage .time{float:none}.bubble .video-play,.bubble .video-time{pointer-events:none}.bubble .video-time{--height:calc(var(--messages-time-text-size) + 0.375rem);align-items:center;background-color:var(--message-time-background);border-radius:var(--height);color:#fff;display:flex;font-size:var(--messages-time-text-size);height:var(--height);left:3px;line-height:1;padding:0 6px;position:absolute;top:3px;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:2}.bubble .video-time.can-autoplay:after{color:#fff;content:\"\";font-size:calc(var(--messages-time-text-size) + 8px);padding:0 1px 0 3px}[dir=ltr] .bubble .video-time.is-error:after{margin-left:1px}[dir=rtl] .bubble .video-time.is-error:after{margin-right:1px}.bubble .video-time.is-error:after{content:\"\";font-size:calc(var(--messages-time-text-size) + 4px);padding:0}.bubble .extended-media-buy{align-items:center;-webkit-backdrop-filter:var(--menu-backdrop-filter);backdrop-filter:var(--menu-backdrop-filter);background-color:rgba(0,0,0,.3);border-radius:2rem;color:#fff;display:flex;font-size:var(--font-size-14);font-weight:var(--font-weight-bold);height:2.5rem;left:50%;padding:0 1rem;position:absolute;top:50%;transform:translate(-50%,-50%);white-space:nowrap;z-index:2}.bubble .extended-media-buy:before{font-size:1.125rem;margin-right:.25rem}.bubble pre{display:inline;margin:0}.bubble .anchor-url{text-decoration:underline}.bubble .video-play{align-items:center;background-color:var(--message-time-background);color:#fff;display:flex;font-size:2.125rem;justify-content:center;text-align:center;z-index:2}.bubble .ckin__player.circle{z-index:1}.bubble:not(.forwarded).hide-name .name{display:none}.bubble .name{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble .peer-title{cursor:pointer}.bubble .name{color:var(--primary-color);font-size:var(--messages-secondary-text-size);font-weight:var(--font-weight-bold)!important;line-height:calc(var(--messages-secondary-text-size) + .25rem);max-width:100%;overflow:hidden;padding:.375rem .625rem 0;text-overflow:ellipsis}.bubble .name .badge-fake{display:inline-block;margin-top:-2px;vertical-align:middle}.bubble:not(.webpage).photo:not(.is-reply) .bubble-content>.name,.bubble:not(.webpage).video:not(.is-reply) .bubble-content>.name{padding-bottom:6px}.bubble:not(.webpage).photo:not(.is-message-empty) .message,.bubble:not(.webpage).video:not(.is-message-empty) .message{padding-top:6px}.bubble:not(.webpage).photo .topic-name-button-container,.bubble:not(.webpage).video .topic-name-button-container{margin-bottom:0}.bubble:not(.webpage):not(.is-album):not(.sticker):not(.round):not(.emoji-big) .attachment{background-color:#000}.bubble.hide-name:not(.is-reply):not(.is-message-empty) .message{padding-top:6px}.bubble:not(.sticker):not(.emoji-big):not(.forwarded).hide-name .reply,.bubble:not(.sticker):not(.emoji-big):not(.forwarded):not(.is-group-first) .reply{margin-top:6px}.bubble .bubble-tail{display:none}.bubble.can-have-tail.is-group-last .bubble-tail{fill:var(--message-background-color);display:block;height:20px;position:absolute;transform:translateY(1px);width:11px;z-index:-2}.bubble.is-message-empty.is-group-last.with-media-tail .bubble-tail,.bubble.photo.is-message-empty.is-group-last:not(.with-replies) .bubble-tail,.bubble.video.is-message-empty.is-group-last:not(.with-replies) .bubble-tail{display:none}.bubble.is-message-empty.is-group-last.with-media-tail .attachment{overflow:visible}.bubble__media-container{border-radius:inherit;cursor:pointer}.bubble audio-element,.bubble poll-element{white-space:normal}.bubble .replies{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble .replies .c-ripple__circle{background-color:var(--light-primary-color)}.bubble .replies .rp{border-radius:inherit;cursor:pointer;height:100%;left:0;overflow:hidden;position:absolute;top:0;width:100%}.bubble .replies-beside{border-radius:2rem;bottom:47px;flex-direction:column;height:auto;max-height:52px;min-height:36px;padding:.375rem 0 .5rem;right:-44px;width:36px}.bubble .replies-beside-text{font-size:.75rem;margin-top:.125rem}.bubble .replies-footer{align-items:center;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;border-top:.0625rem solid var(--border-color);color:var(--primary-color);display:flex;height:3.0625rem;min-width:15rem;padding:0 .5rem;position:relative}html.no-touch .bubble .replies-footer:active,html.no-touch .bubble .replies-footer:hover{background-color:var(--light-primary-color)}html.no-touch .bubble .replies-footer:active~.bubble-tail,html.no-touch .bubble .replies-footer:hover~.bubble-tail{fill:var(--light-filled-message-primary-color)}.bubble .replies-footer .tgico-comments,.bubble .replies-footer .tgico-next{font-size:1.5rem}.bubble .replies-footer .tgico-comments{margin-left:.125rem;margin-right:.375rem}.bubble .replies-footer-text{align-items:center;color:var(--primary-color);display:flex;font-size:.9375rem;font-weight:var(--font-weight-bold);line-height:1.125rem;margin-left:.5rem}.bubble .replies-footer-avatars{--margin-right:-.875rem;--border-size:2px}.bubble .replies-footer .tgico-next{position:absolute;right:.1875rem}.bubble .replies-footer.is-unread .replies-footer-text:after{background-color:var(--primary-color);border-radius:50%;content:\" \";height:.5rem;margin-left:.75rem;width:.5rem}.bubble.is-thread-starter .user-avatar{display:none}.bubble.is-thread-starter.is-in .bubble-content-wrapper{margin-left:0}.bubble .message .reaction{--background-color:var(--light-filled-message-primary-color)}.bubble .message .reaction.is-chosen.backwards,.bubble .message .reaction:not(.is-chosen){--counter-color:var(--message-primary-color)}.bubble .message .reaction.is-chosen.backwards .stacked-avatars,.bubble .message .reaction:not(.is-chosen) .stacked-avatars{--border-color:var(--background-color)}.bubble .message .reactions-block .time{bottom:auto!important;order:100;position:static!important;right:auto!important}.bubble code{cursor:pointer}.bubble.is-invoice .attachment{background-color:inherit!important}.bubble.with-reply-markup .bubble-content{border-bottom-left-radius:6px!important;border-bottom-right-radius:6px!important}.bubble .name-with-reply .name{padding:0!important}.bubble .name-with-reply .name:not(:last-child) .hide-ol{display:none}.bubble .name-with-reply .name:not(:last-child) .peer-title{font-weight:var(--font-weight-bold)!important}.bubble .name-with-reply .reply{height:auto;margin:.25rem 0 0;max-height:none;padding:0}.bubble .topic-name-button{--color:var(--message-primary-color)}.bubble .name .topic-name-button-container{margin:.25rem -.125rem}.bubble .name .topic-name-button-container:first-child{margin-top:0}.bubble.is-message-empty:not(.is-reply) .name .topic-name-button-container{margin-bottom:0}.bubble:not(.is-group-first) .topic-name-button-container{display:none!important}.bubble .topic-name-button-container.floating-part{font-size:var(--messages-secondary-text-size);padding-bottom:0;padding-top:0}.bubble .topic-name-button-container.floating-part .topic-name-button{--color:#fff;padding:0}.bubble .topic-name-button-container.floating-part .topic-name-button:before{content:none}.bubble .topic-name-button-container.floating-part+.floating-part{margin-top:1.75rem}.bubble .web .audio-transcribed-text{margin-bottom:0;order:4}.bubble .audio-transcribed-text{margin-bottom:.75rem;margin-top:.25rem}.bubble .audio-transcribed-text.is-error{color:var(--message-primary-color)}.bubble .audio-transcribed-text .audio-transcribing-dots{position:relative}.bubble .audio-transcribed-text .audio-transcribing-dots:after,.bubble .audio-transcribed-text .audio-transcribing-dots:before{content:\"...\"}.bubble .audio-transcribed-text .audio-transcribing-dots:before{opacity:0}.bubble .audio-transcribed-text .audio-transcribing-dots:after{animation:audio-dots 1.5s linear infinite;left:0;position:absolute;right:0}.timestamp.is-disabled{color:inherit;cursor:inherit;text-decoration:none!important}@keyframes audio-dots{0%{content:\"\"}33%{content:\".\"}66%{content:\"..\"}to{content:\"...\"}}.bubbles-date-group:last-of-type .bubbles-group:last-of-type .bubble:last-of-type{margin-bottom:.0625rem}.bubbles-date-group:last-of-type .bubbles-group:last-of-type .bubble:last-of-type .document-container:last-of-type .document-selection,.bubbles-date-group:last-of-type .bubbles-group:last-of-type .bubble:last-of-type:after{bottom:-.0625rem}.can-zoom-fade{opacity:1;transform:scale(1) translateX(0);transform-origin:center}body.animation-level-2 .can-zoom-fade{transition:var(--bubble-transition-out)}.bubbles-inner.zoom-fading .can-zoom-fade{transition:var(--bubble-transition-in)}.can-zoom-fade.zoom-fade{opacity:0;transform:scale3d(.8,.8,1) translateX(0)}.bubble-content-wrapper{display:flex;flex-direction:column}@media only screen and (min-width:601px){.bubble:not(.service) .bubble-content-wrapper{max-width:85%}}@media only screen and (max-width:600px){.bubble-content-wrapper{max-width:calc(100% - var(--message-handhelds-margin))}}.bubble.service{align-self:center;justify-content:center}.bubble.service b{color:inherit}.bubble.service .bubble-content{background-color:transparent;border-radius:.875rem}.bubble.service .bubble-content-wrapper{max-width:100%;padding:0 2rem}.bubble.service .service-msg{align-items:center;background-color:var(--message-highlightning-color);border-radius:inherit;color:#fff;display:flex;font-size:var(--messages-service-text-size);justify-content:center;line-height:calc(var(--messages-service-text-size) + 5px);padding:.28125rem .625rem;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;word-break:break-word}.bubble.service .service-msg i{font-style:normal}.bubble.service .service-msg a{color:#fff}.bubble.service .service-msg .peer-title,.bubble.service .service-msg [data-saved-from],.bubble.service .service-msg a{cursor:pointer;font-weight:var(--font-weight-bold)}.bubble.service .service-msg .peer-title:hover,.bubble.service .service-msg [data-saved-from]:hover,.bubble.service .service-msg a:hover{text-decoration:underline}.bubble.service .service-msg img.emoji{margin-bottom:3px}.bubble.is-in .bubble-content,.bubble.is-in .bubble-content .poll-footer-button{border-radius:6px 12px 12px 6px}.bubble.is-in.is-group-first .bubble-content,.bubble.is-in.is-group-first .poll-footer-button{border-top-left-radius:12px}.bubble.is-in.is-group-last.can-have-tail .bubble-content,.bubble.is-in.is-group-last.can-have-tail .poll-footer-button{border-bottom-left-radius:0!important}.bubble.is-in.is-group-last.can-have-tail .bubble-tail{margin-left:-8.4px}.bubble.is-in.is-group-last:not(.can-have-tail) .bubble-content,.bubble.is-in.is-group-last:not(.can-have-tail) .poll-footer-button{border-bottom-left-radius:12px}.bubble.is-in.just-media .floating-part{left:calc(100% + 10px)}@media only screen and (max-width:600px){.bubble.is-in.just-media .floating-part{left:calc(100% + 1px)}}.bubble.is-in .quote .webpage-name,.bubble.is-in .reply-title{color:var(--primary-color)}.bubble.is-in .time{margin-left:-3px;padding-right:8px}.bubble.is-in .time .inner{margin-bottom:4px}.bubble.is-in.is-message-empty.is-group-last.with-media-tail .attachment{border-bottom-left-radius:0}.bubble.is-in.is-message-empty.is-group-last.with-media-tail .bubble__media-container{margin-left:-9px}.bubble.is-in .audio-subtitle,.bubble.is-in .audio-time,.bubble.is-in .contact-number{color:var(--secondary-text-color)!important}.bubble.is-in code,.bubble.is-in pre{color:var(--monospace-text-color)}.bubble.is-in:not(.just-media) .reply.is-overriding-color .reply-border{background-color:rgb(var(--override-color))}.bubble.is-in:not(.just-media) .reply.is-overriding-color .reply-title{color:rgb(var(--override-color))}html.no-touch .bubble.is-in:not(.just-media) .reply.is-overriding-color:active,html.no-touch .bubble.is-in:not(.just-media) .reply.is-overriding-color:hover{background-color:rgba(var(--override-color),.08)}.bubble.is-out{--message-background-color:var(--message-out-background-color);--light-message-background-color:var(--light-message-out-background-color);--dark-message-background-color:var(--dark-message-out-background-color);--link-color:var(--message-out-link-color);--message-primary-color:var(--message-out-primary-color);--light-filled-message-primary-color:var(--light-filled-message-out-primary-color);--selection-background-color:var(--message-out-selection-background-color);--message-time-color:var(--message-out-time-color);--message-status-color:var(--message-out-status-color);--link-color:var(--message-primary-color);flex-direction:row-reverse}.bubble.is-out .bubble-content{margin-left:auto}.bubble.is-out .bubble-content,.bubble.is-out .bubble-content .poll-footer-button{border-radius:12px 6px 6px 12px}.bubble.is-out .bubble-content .name{color:var(--message-out-primary-color)}@media only screen and (min-width:1276px){.bubble.is-out .bubble-content-wrapper{transform:scale(1) translateX(calc((var(--chat-input-size) + .5rem)*-1))}.bubble.is-out .bubble-content-wrapper.zoom-fade{transform:scale3d(.8,.8,1) translateX(calc((var(--chat-input-size) + .5rem)*-1))}body.animation-level-2 .bubble.is-out .bubble-content-wrapper{transition:var(--bubble-transition-out)}body.is-right-column-shown .bubble.is-out .bubble-content-wrapper{transform:scale(1) translateX(0)}body.animation-level-2 body.is-right-column-shown .bubble.is-out .bubble-content-wrapper{transition:var(--bubble-transition-in)}body.is-right-column-shown .bubble.is-out .bubble-content-wrapper.zoom-fade{transform:scale3d(.8,.8,1) translateX(0)}}.bubble.is-out.is-group-first .bubble-content,.bubble.is-out.is-group-first .poll-footer-button{border-top-right-radius:12px}.bubble.is-out.is-group-last.can-have-tail .bubble-content,.bubble.is-out.is-group-last.can-have-tail .poll-footer-button{border-bottom-right-radius:0!important}.bubble.is-out.is-group-last.can-have-tail .bubble-tail{right:-8.4px;transform:translateY(1px) scaleX(-1)}.bubble.is-out.is-group-last:not(.can-have-tail) .bubble-content,.bubble.is-out.is-group-last:not(.can-have-tail) .poll-footer-button{border-bottom-right-radius:12px}.bubble.is-out.just-media .floating-part{right:calc(100% + 10px)}.bubble.is-out.just-media .message{right:0}.bubble.is-out:not(.just-media) .reply-border{background-color:var(--message-out-primary-color)!important}.bubble.is-out:not(.just-media) .reply i,.bubble.is-out:not(.just-media) .reply-title{color:var(--message-out-primary-color)!important}.bubble.is-out .quote:before{background-color:var(--message-out-primary-color)}.bubble.is-out .quote .webpage-name{color:var(--message-out-primary-color)}.bubble.is-out .time{margin-left:-4px;padding-right:5px}.bubble.is-out .time .inner{bottom:4px}.bubble.is-out .time .inner:after,.bubble.is-out .time:after{font-size:calc(var(--messages-text-size) + 3px);line-height:var(--messages-time-text-size);margin-left:1px}.bubble.is-out.forwarded .name{color:var(--message-out-primary-color)}.bubble.is-out.is-read .time .inner:after,.bubble.is-out.is-read .time:after{content:\"\"}.bubble.is-out.is-sent .time .inner:after,.bubble.is-out.is-sent .time:after{content:\"\"}.bubble.is-out.is-sending .time .inner:after,.bubble.is-out.is-sending .time:after{content:\"\"}.bubble.is-out.is-error .time .inner:after,.bubble.is-out.is-error .time:after{color:var(--message-error-color);content:\"\"}.bubble.is-out .document-ico:after{border-right-color:var(--message-background-color);border-top-color:var(--message-background-color)}.bubble.is-out .audio-waveform-bar{fill:var(--message-out-primary-color)}.bubble.is-out .audio-waveform-bar.active{fill:var(--message-out-primary-color)!important}.bubble.is-out .audio-subtitle,.bubble.is-out .audio-time{color:var(--message-out-status-color)}.bubble.is-out .audio-download,.bubble.is-out .audio-toggle,.bubble.is-out .audio.corner-download .preloader-container{background-color:var(--message-out-primary-color)}.bubble.is-out .audio-download:empty{display:none}.bubble.is-out .audio.is-unread .audio-waveform-bar{fill:var(--message-out-primary-color)}.bubble.is-out .audio.is-unread .audio-time:after{background-color:var(--message-out-primary-color)}.bubble.is-out .audio-toggle .part{background-color:var(--message-out-audio-play-button-color)}.bubble.is-out.is-message-empty.is-group-last.with-media-tail .attachment{border-bottom-right-radius:0}.bubble.is-out.is-message-empty.is-group-last.with-media-tail .bubble__media-container{margin-right:-9px}.bubble.is-out.is-message-empty .reactions-block{justify-content:flex-end}.bubble.is-out.is-message-empty .reaction-block{margin-right:.25rem}.bubble.is-out.is-message-empty .reaction-block:last-child{margin-right:0}.bubble.is-out.is-message-empty .reaction-block.is-chosen{--chosen-background-color:var(--surface-color)}.bubble.is-out.is-message-empty:not(.emoji-big) .reactions-block{margin-left:auto}.bubble.is-out .bubble-call-subtitle,.bubble.is-out .contact-number,.bubble.is-out .document-size{color:var(--message-out-status-color)}.bubble.is-out .bubble-call-subtitle:before{transform:rotate(-45deg)}.bubble.is-out poll-element .poll-desc,.bubble.is-out poll-element .poll-votes-count{color:var(--message-out-primary-color)}.bubble.is-out poll-element .poll-line use{stroke:var(--message-out-primary-color)}.bubble.is-out poll-element .poll-answer-selected{background-color:var(--message-out-primary-color);color:var(--light-filled-message-out-primary-color)}html.no-touch .bubble.is-out poll-element .poll-answer:hover .animation-ring{background-color:var(--message-out-primary-color);opacity:.08}.bubble.is-out poll-element .poll-footer-button,.bubble.is-out poll-element .poll-hint{color:var(--message-out-primary-color)}.bubble.is-out poll-element .poll-avatars .stacked-avatars{--border-color:var(--message-background-color)}.bubble.is-out poll-element .progress-ring__circle{stroke:var(--message-out-primary-color)}.bubble.is-out poll-element .c-ripple__circle{background-color:var(--message-out-primary-color)}.bubble.is-out poll-element .c-ripple__circle:not(.hiding){opacity:.08}.bubble.is-out.is-sending poll-element{pointer-events:none}.bubble.is-out .audio .progress-line{--color:var(--message-out-primary-color)}.bubble.is-out .audio .progress-line:before,.bubble.is-out .audio .progress-line__loaded{background-color:var(--message-out-primary-color)}.bubble.is-out .audio .preloader-container{--color:var(--message-background-color)}.bubble.is-out .bubble-beside-button{left:var(--message-beside-button-margin);right:auto}.bubble.is-out .bubble-beside-button.goto-original{transform:rotate(180deg)}.bubble.is-out.is-multiple-documents .document-container .bubble-select-checkbox{background-color:var(--message-background-color)}.bubble.is-out.is-multiple-documents .document-container .bubble-select-checkbox:before{border-color:var(--dark-message-background-color)}.bubble.is-out.is-multiple-documents .document-container .bubble-select-checkbox .checkbox-box-border{border-color:var(--message-background-color)}.bubble.is-out .bubble-hover-reaction{left:var(--offset);right:auto}.reply-markup{margin-top:.0625rem;width:100%}.bubble:not(.is-group-last) .reply-markup{margin-bottom:.125rem}.reply-markup-row{display:flex;margin-top:.125rem;min-height:2.5rem;overflow:hidden}.reply-markup-row:last-child .reply-markup-button:first-child{border-bottom-left-radius:12px}.reply-markup-row:last-child .reply-markup-button:last-child{border-bottom-right-radius:12px}.reply-markup-button{background:var(--message-highlightning-color);border:none;border-radius:.375rem;color:#fff!important;cursor:pointer;font-size:var(--font-size-14);font-weight:var(--font-weight-bold);outline:none;overflow:hidden;padding:.5625rem 0;position:relative;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:2}.reply-markup-button-text{pointer-events:none;position:relative}.reply-markup-button.anchor-url{text-decoration:none!important}.reply-markup-button+.reply-markup-button{margin-left:.125rem}.reply-markup-button .forward-icon,.reply-markup-button.tgico:before{display:block;position:absolute;right:.125rem;top:.125rem}.reply-markup-button.is-link:before{content:\"\";transform:rotate(-45deg)}.reply-markup-button.is-buy:before{content:\"\"}.reply-markup-button.is-switch-inline:before{content:\"\"}.bubble-beside-button:after,.bubble.just-media .reply:after,.reply-markup-button:after{background-color:#fff;border-radius:inherit;bottom:0;content:\" \";display:block;left:0;opacity:0;position:absolute;right:0;top:0;z-index:-1}html.no-touch .bubble-beside-button:active:after,html.no-touch .bubble-beside-button:hover:after,html.no-touch .bubble.just-media .reply:active:after,html.no-touch .bubble.just-media .reply:hover:after,html.no-touch .reply-markup-button:active:after,html.no-touch .reply-markup-button:hover:after{opacity:var(--hover-alpha)}.bubble-primary-color{color:var(--message-primary-color);font-weight:var(--font-weight-bold)}.pinned-message{--custom-emoji-size:calc(var(--font-size) + 2px)!important}.pinned-message-border{flex:0 0 auto;height:2rem;position:relative;width:.125rem}.pinned-message-border-wrapper-1{background:var(--primary-color);border-radius:1px;height:2rem;position:relative;top:50%;transform:translateY(-50%);width:.125rem}.pinned-message-border-mask{--mask-height:.375rem;--height:2.5rem;height:var(--height);overflow:hidden}.pinned-message-border-mask:after,.pinned-message-border-mask:before{content:\" \";display:block;height:var(--mask-height);left:0;opacity:0;position:absolute;right:0;z-index:1}body.animation-level-2 .pinned-message-border-mask:after,body.animation-level-2 .pinned-message-border-mask:before{transition:opacity .2s ease-in-out}.pinned-message-border-mask:before{background:linear-gradient(var(--surface-color),transparent);top:0}.pinned-message-border-mask:after{background:linear-gradient(transparent,var(--surface-color));bottom:0}.pinned-message-border-mask.mask-bottom:after,.pinned-message-border-mask.mask-top:before{opacity:1}.pinned-message-border-wrapper{color:var(--primary-color);position:relative}.pinned-message-border-wrapper:before{background:var(--primary-color);bottom:0;content:\" \";display:block;left:0;opacity:.4;position:absolute;right:0;top:0}.pinned-message-border-bars{stroke:currentColor;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.pinned-message-border-mark{background:currentColor;border-radius:1px;left:0;position:absolute;top:0;width:2px}body:not(.animation-level-0) .pinned-message-border-mark,body:not(.animation-level-0) .pinned-message-border-wrapper{transition:transform .25s ease-in-out;will-change:transform}.pinned-message-content{--height:32px;height:var(--height)}.pinned-message-media{border-radius:.1875rem}.pinned-message,.reply{--font-size:var(--font-size-14);--custom-emoji-size:calc(var(--font-size) + 4px);--line-height:calc(var(--font-size) + 4px);align-items:center;cursor:pointer;display:flex;overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.pinned-message-content,.reply-content{display:flex;flex-direction:column;flex-grow:1;flex-shrink:1;justify-content:center;margin-left:.5rem;overflow:hidden;pointer-events:none;position:relative}.pinned-message-title,.reply-title{color:var(--primary-color)}.pinned-message-subtitle,.pinned-message-title,.reply-subtitle,.reply-title{font-size:var(--font-size);line-height:var(--line-height);overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap}.pinned-message-media,.reply-media{height:2rem!important;left:0;overflow:hidden;position:absolute;top:.125rem;width:2rem!important}.pinned-message-media.is-round,.reply-media.is-round{border-radius:50%}.pinned-message-media>img,.pinned-message-media>video,.reply-media>img,.reply-media>video{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.pinned-message i,.reply i{color:var(--secondary-text-color);font-style:normal}.pinned-message img.emoji,.reply img.emoji{height:1rem;vertical-align:top;width:1rem}.reply.is-media .reply-content{padding-left:2.5rem}.reply-border{background:var(--primary-color);border-radius:1px;height:calc(var(--font-size)*2 + .25rem);min-width:2px}.reply-content{margin-left:.625rem}.reply-media{border-radius:.25rem}.reply-cancel{margin-bottom:0!important}.reply-title{margin:-1px 0 1px}.reply .peer-title{font-weight:var(--font-weight-bold)}.pinned-container{--container-height:3.25rem;align-items:center;cursor:pointer;display:flex;flex:0 0 auto;justify-content:space-between;overflow:visible}.pinned-container.is-floating{background-color:var(--surface-color)!important;height:var(--container-height);left:0;margin:0;max-height:var(--container-height);position:absolute!important;right:0;top:var(--topbar-height);width:auto}.pinned-container.is-floating .pinned-container-wrapper{border-radius:0;height:100%;max-width:100%;order:0;padding:0 1rem;z-index:0}@media only screen and (max-width:600px){.pinned-container.is-floating .pinned-container-wrapper{padding:0 .5rem}}.pinned-container.is-floating .pinned-container-content{margin-right:.5rem}@media only screen and (min-width:1276px){body.is-right-column-shown .pinned-container.is-floating .pinned-container-content{padding-right:var(--right-column-width)}}.pinned-container.is-floating:before{border-bottom:1px solid var(--border-color);border-top:1px solid var(--border-color);bottom:0;content:\" \";left:0;position:absolute;right:0;top:0}.pinned-container-content{flex:1 1 auto;overflow:hidden;pointer-events:none;position:relative}.pinned-container .btn-icon{display:flex;flex:0 0 auto;font-size:1.5rem;justify-content:center}.pinned-container-wrapper{align-items:center;border-radius:.25rem;display:flex;flex:1 1 auto;order:1;overflow:hidden;padding:.25rem}.pinned-container-wrapper-utils{align-items:center;display:flex;flex:0 0 auto;position:relative}.pinned-message{display:flex;width:auto}.pinned-message-content{overflow:visible!important}.pinned-message-media-container{height:2rem;margin-left:-.25rem;position:absolute;width:2rem}body.animation-level-2 .pinned-message-media-container{transition:transform var(--pm-transition)}.pinned-message-subtitle,.pinned-message-title{transform:translateX(0)}.pinned-message.is-media .pinned-message-subtitle,.pinned-message.is-media .pinned-message-title{transform:translateX(2.25rem)}.pinned-message:not(.is-media) .pinned-message-media-container{transform:scale(0)}.pinned-message .pinned-container-wrapper{min-width:16rem}.pinned-message:not(.is-floating){margin-right:1rem}.pinned-message:not(.is-floating) .pinned-container-wrapper-utils{display:none}.pinned-message:not(.is-floating)>.pinned-message-close{display:flex;margin-right:.75rem;order:0}.pinned-message.is-media .pinned-message-subtitle,.pinned-message.is-media .pinned-message-title{width:calc(100% - 2.25rem)}.pinned-message.is-floating{--container-height:var(--pinned-message-height)}.pinned-message.is-floating>.btn-icon{display:none}.pinned-message.is-floating .pinned-container-wrapper{padding-left:1rem}.pinned-message.is-floating .pinned-container-content{margin-right:0}.pinned-message-content .pinned-message-subtitle,.pinned-message-content .pinned-message-title{height:calc(var(--height)/2);min-height:calc(var(--height)/2);overflow:visible;position:relative}body.animation-level-2 .pinned-message-content .pinned-message-subtitle,body.animation-level-2 .pinned-message-content .pinned-message-title{transition:transform var(--pm-transition)}.pinned-message-title{margin-bottom:.25rem}.pinned-message-subtitle .animated-super-row{font-size:var(--font-size-14);line-height:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pinned-message .animated-counter{transition:transform var(--pm-transition),opacity var(--pm-transition)}body.animation-level-0 .pinned-message .animated-counter{transition:none}.pinned-message .animated-counter:before{content:\"#\"}.pinned-message .animated-counter.is-last:not(.backwards){opacity:0;transform:scale(.68)}.pinned-message .animated-super-row{--translateY:16px}.pinned-message .pinned-message-media{--translateY:32px}.pinned-message.hide~.tgico-pinlist,.pinned-message.is-many .pinned-message-close,.pinned-message.is-many.is-floating .pinned-message-close,.pinned-message.is-many:not(.is-floating) .pinned-message-pinlist,.pinned-message:not(.is-many) .pinned-message-pinlist,.pinned-message:not(.is-many)~.tgico-pinlist{display:none}.pinned-message-pinlist{order:2}.chat[data-type=discussion] .pinned-message .pinned-container-close{display:none!important}.pinned-audio{--progress-height:.25rem}.pinned-audio.is-floating{--container-height:var(--pinned-audio-height)}.pinned-audio:not(.is-floating){max-width:210px;padding-right:1.75rem;position:relative}.pinned-audio .pinned-container-wrapper{overflow:visible!important}.pinned-audio .pinned-container-wrapper>.btn-icon{margin-left:0!important}.pinned-audio-ico:before{content:\"\"}.pinned-audio-ico.flip-icon:before{content:\"\"}.pinned-audio-title{font-weight:var(--font-weight-bold)}.pinned-audio-subtitle{color:var(--secondary-text-color)}.pinned-audio-subtitle,.pinned-audio-title{font-size:var(--font-size-14);line-height:var(--line-height-14);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.pinned-audio-content{margin-left:.75rem}.pinned-audio-progress{--border-radius:0;--height:var(--progress-height);--translateY:.125rem;bottom:0;left:0;position:absolute;right:0;transform:scaleX(var(--topbar-floating-scaleX)) translateY(var(--translateY));transform-origin:left center}@media only screen and (min-width:1276px){.pinned-audio-progress{transition:transform var(--transition-standard-out)}body.is-right-column-shown .pinned-audio-progress{transition:transform var(--transition-standard-in)}body.animation-level-0 .pinned-audio-progress{transition:none}}body.animation-level-2 .pinned-audio-progress:before{transition:opacity .2s ease-in-out}.pinned-audio-progress:not(:hover):before{opacity:0}html.no-touch .pinned-audio-progress:active,html.no-touch .pinned-audio-progress:hover{--translateY:0}.pinned-audio-progress .progress-line__filled:after{display:none!important}.pinned-audio-progress .progress-line__seek{top:-1rem}.pinned-audio-progress-wrapper{bottom:0;height:.5rem;left:0;overflow:hidden;position:absolute;right:0}.pinned-audio-volume{align-items:center;height:2.5rem;position:relative;width:2.5rem}html.is-touch .pinned-audio-volume{display:none}.pinned-audio-volume-tunnel{bottom:-1rem;content:\" \";left:0;position:absolute;right:0;top:100%}.pinned-audio-volume .player-volume__icon{cursor:pointer;display:flex}.pinned-audio-volume .progress-line-container{background-color:var(--surface-color);border-radius:10px;box-shadow:0 1px 5px 0 rgba(0,0,0,.15);margin-top:2.25rem;opacity:0;padding:.75rem 1rem;position:absolute;top:100%;transform:rotate(270deg);transition:opacity .2s ease-in-out,visibility 0s .2s;visibility:hidden;width:5rem}body.animation-level-0 .pinned-audio-volume .progress-line-container{transition:none!important}.pinned-audio-volume:active .progress-line-container,.pinned-audio-volume:hover .progress-line-container{opacity:1;transition:opacity .2s ease-in-out,visibility 0s 0s;visibility:visible}.markup-tooltip{background:var(--surface-color);border-radius:10px;bottom:0;display:flex;height:44px;justify-content:flex-start;left:0;opacity:0;overflow:hidden;position:fixed;right:0;top:0;transform:translateZ(0);transition:opacity var(--layer-transition),transform var(--layer-transition),width var(--layer-transition);width:252px;z-index:1}body.animation-level-0 .markup-tooltip{transition:none}.markup-tooltip-wrapper{align-items:center;display:flex;height:100%;justify-content:flex-start;left:0;max-width:100%;position:absolute;top:0;transform:translateX(0);transition:transform var(--layer-transition);width:672px}body.animation-level-0 .markup-tooltip-wrapper{transition:none}.markup-tooltip-tools{align-items:center;display:flex;flex:0 0 auto;justify-content:space-between;max-width:100%;padding:7px}.markup-tooltip-tools:first-child{width:252px}.markup-tooltip-tools:last-child{width:420px}.markup-tooltip-tools:last-child .markup-tooltip-delimiter{margin:0 .25rem}.markup-tooltip-delimiter{background-color:var(--border-color);height:25px;width:1px}.markup-tooltip .btn-icon{border-radius:8px!important;height:30px;padding:0;width:30px}.markup-tooltip .btn-icon.active{background-color:var(--primary-color)!important;color:#fff!important}.markup-tooltip:not(.is-visible){pointer-events:none}.markup-tooltip.is-visible{opacity:1}.markup-tooltip.is-link{width:420px}.markup-tooltip.is-link .markup-tooltip-wrapper{transform:translateX(-252px)}.markup-tooltip-link-apply{color:var(--primary-color);font-size:2rem}.markup-tooltip-link-apply-container{align-items:center;display:flex;opacity:0;pointer-events:none;transition:opacity var(--layer-transition)}body.animation-level-0 .markup-tooltip-link-apply-container{transition:none}.markup-tooltip .input-clear{flex:1 1 auto;margin:0 .5rem;text-overflow:ellipsis}.markup-tooltip .input-clear.is-valid+.markup-tooltip-link-apply-container{opacity:1;pointer-events:all}.stickers-helper>.scrollable{max-height:13.75rem;min-height:var(--esg-sticker-size);padding:.4375rem;position:relative}.stickers-helper-stickers{border-radius:var(--border-radius);max-width:100%}html.no-touch .stickers-helper .super-sticker:not(.active):active,html.no-touch .stickers-helper .super-sticker:not(.active):hover{background:none}.emoji-helper{height:50px;padding:.25rem 0!important}.emoji-helper>.scrollable{position:relative;width:auto}.emoji-helper .super-emojis{display:block;white-space:nowrap}.emoji-helper .super-emojis:after,.emoji-helper .super-emojis:before{content:\" \";display:inline-block;width:.25rem}html.no-touch .emoji-helper .super-emoji:not(.active):active,html.no-touch .emoji-helper .super-emoji:not(.active):hover{background:none}.emoji-helper .super-emoji.active{background-color:var(--primary-color)!important}.inline-helper{-webkit-user-select:none;-moz-user-select:none;user-select:none}.inline-helper:not(.is-gallery){min-width:min(20rem,100%)}.inline-helper .scrollable{max-height:232px;position:relative}.inline-helper-separator{background-color:var(--border-color);height:1px;margin-left:4rem;width:100%}.inline-helper-separator:last-child{display:none}.inline-helper .btn-primary{border-radius:0;border-radius:initial}.inline-helper-results:not(.is-gallery){cursor:pointer}.inline-helper-results:not(.is-gallery) .inline-helper-result{height:4rem;line-height:var(--line-height);padding:.5rem .5rem .5rem 4rem}.inline-helper-results:not(.is-gallery) .inline-helper-result-preview{height:3rem!important;left:.5rem;overflow:hidden;position:absolute;width:3rem!important}.inline-helper-results:not(.is-gallery) .inline-helper-result-preview.empty{align-items:center;background-color:var(--primary-color);border-radius:.375rem;color:#fff;display:flex;font-size:1.75rem;justify-content:center;text-transform:uppercase}.inline-helper .media-container{border-radius:inherit}.inline-helper .media-photo,.inline-helper .media-poster,.inline-helper .media-video{border-radius:inherit;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.inline-helper .gif{bottom:0;height:auto!important;left:0;position:absolute;right:0;top:0;width:auto!important}.inline-helper-results.is-gallery{grid-gap:1px;border-radius:var(--border-radius);grid-template-columns:repeat(auto-fill,minmax(var(--esg-sticker-size),1fr));max-width:100%}.inline-helper-results.is-gallery .inline-helper-result{height:auto!important;width:auto!important}.inline-helper-result{position:relative}.inline-helper-result-title{font-weight:var(--font-weight-bold);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inline-helper-result-description{-webkit-line-clamp:2;-webkit-box-orient:vertical;color:var(--secondary-text-color);display:-webkit-box;font-size:.875rem;overflow:hidden;text-overflow:ellipsis;white-space:pre-wrap}.inline-helper-cant-send{color:var(--secondary-text-color);display:none;margin:0 auto}.inline-helper.cant-send{height:3rem;width:100%!important}.inline-helper.cant-send .scrollable-y{display:none}.inline-helper.cant-send .inline-helper-cant-send{display:block}.chat-search{left:0;position:absolute!important;right:0;top:0;z-index:2}.chat-search-footer{align-items:center;background-color:var(--surface-color);box-shadow:0 -1px 5px -1px rgba(0,0,0,.21);display:flex;flex:0 0 auto;height:46px;justify-content:space-between;overflow:hidden;padding:0 8px;width:100%}.chat-search-footer .chat-search-count{color:var(--secondary-text-color);margin-left:8px}.chat-search-count:empty,.chat-search-count:not(:empty)+.btn-icon,.chat-search-footer+.chat-input{display:none}.chat-search-controls{display:flex}.chat-search-results{background-color:var(--surface-color);height:100%;left:0;max-height:100%;opacity:0;overflow:hidden;position:absolute;top:0;transition:.2s ease;visibility:hidden;width:100%}body.animation-level-0 .chat-search-results{transition:none}.chat-search-results.active{opacity:1;visibility:visible}.chat-search .tgico-up{margin-right:2px}.drops-container{--padding:0px;align-items:center;bottom:var(--padding);display:flex;flex-direction:column;justify-content:center;left:var(--padding);position:absolute!important;right:var(--padding);top:var(--padding);-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important;z-index:3}.drops-container:not(.is-visible){display:none}.drops-container.is-visible{animation:fade-in-opacity .2s linear forwards}.drops-container.is-visible.backwards{animation:fade-in-backwards-opacity .2s linear forwards}.drop{--wrapper-padding:-4px;align-items:center;background-color:var(--surface-color);border-radius:12px;color:#a2acb4;display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;max-width:100%;pointer-events:all;position:relative;transition:color .2s ease-in-out;width:100%}.drop-outline-wrapper{bottom:var(--wrapper-padding);left:var(--wrapper-padding);pointer-events:none;position:absolute;right:var(--wrapper-padding);top:var(--wrapper-padding)}.drop-outline-path{fill:none;stroke-dasharray:13.5,11;stroke:#a2acb4;stroke-width:2;stroke-linecap:round;stroke-dashoffset:0;transition:stroke .2s ease-in-out}.drop.is-dragover .drop-outline-path{stroke:var(--primary-color);animation:drop-outline-move .5s linear infinite}.drop-icon{font-size:6rem}.drop-header{font-size:1.25rem;font-weight:var(--font-weight-bold)}.drop-header:not(:last-child){margin-top:-10px}@media only screen and (max-height:670px){.drop-icon{font-size:0}.drop-header{margin-top:0}}.drop.is-dragover{color:var(--primary-color)}.drop+.drop{margin-top:10px}@keyframes drop-outline-move{0%{stroke-dashoffset:0}to{stroke-dashoffset:-24.5}}body.is-dragging .page-chats{pointer-events:none}.bot-commands{--border-radius-padding:24px;--offset:.5rem;animation:none!important;background-color:transparent!important;border-radius:12px 12px 0 0!important;bottom:calc(100% - var(--border-radius-padding));box-shadow:none;left:calc(var(--offset)*-1);max-height:20rem;max-width:none;overflow:hidden;padding:var(--offset) var(--offset) 0!important;pointer-events:none;position:absolute!important;right:calc(var(--offset)*-1);transition:none!important;visibility:visible!important;width:auto!important}body.animation-level-2 .bot-commands{display:flex!important}.bot-commands .scrollable{background-color:var(--surface-color);border-radius:inherit;box-shadow:0 1px 8px 1px rgba(0,0,0,.12);height:auto;max-height:207px!important;pointer-events:all}body.animation-level-2 .bot-commands .scrollable{opacity:0;transform:translateY(var(--height))}.bot-commands.is-visible.animating .scrollable{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.bot-commands.is-visible:not(.backwards) .scrollable{opacity:1;transform:translateY(0)}.bot-commands-list{border-radius:inherit;height:var(--height);padding-bottom:0;width:100%}.bot-commands-list-element{align-items:flex-start;border-radius:0!important;flex-direction:column;justify-content:center;padding-left:3.375rem}.bot-commands-list-element-avatar{left:.75rem;position:absolute}.bot-commands-list-element-description,.bot-commands-list-element-name{font-size:.875rem;line-height:var(--line-height-14);margin-left:0}.crop .overlay::-moz-selection,.crop-component::-moz-selection{background:transparent}.crop .overlay::selection,.crop-component::selection{background:transparent}.crop-image,.crop-overlay-image{display:block;height:auto;-o-object-fit:contain;object-fit:contain;-o-object-position:center;object-position:center;width:auto}.crop-image{display:block;pointer-events:none;position:relative}.crop-component{background-color:#fff;margin:0 auto;overflow:hidden;position:relative;z-index:999}.crop-component>img{max-width:100%}.crop-overlay{border-radius:50%;box-sizing:content-box;overflow:hidden;position:absolute;z-index:999}.crop-overlay:active,html.no-touch .crop-overlay:hover{cursor:move}.crop-overlay-image{display:block;position:absolute}.crop-overlay-color{background-color:hsla(0,0%,100%,.7);border-radius:8px;height:100%;left:0;position:absolute;top:0;width:100%}.crop.is-forum .crop-overlay{border-radius:var(--avatar-border-radius-forum)}.sidebar-header{align-items:center;background-color:var(--surface-color);cursor:default;display:flex;flex:0 0 auto;justify-content:space-between;min-height:3.5rem;padding-left:1rem;padding-right:1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.sidebar-header .btn-menu{overflow-y:overlay}@media only screen and (max-width:600px){.sidebar-header{padding-left:.5rem;padding-right:.5rem}}[dir=ltr] .sidebar-header__title{padding-left:1.5rem}[dir=rtl] .sidebar-header__title{padding-right:1.5rem}.sidebar-header__title{color:var(--primary-text-color);flex:1;font-size:1.25rem;font-weight:var(--font-weight-bold)}[dir=ltr] .sidebar-header .btn-icon+.btn-icon{margin-left:.5rem}[dir=rtl] .sidebar-header .btn-icon+.btn-icon{margin-right:.5rem}.sidebar-header-right{flex:0 0 auto}.scrollable-y-bordered .sidebar-header{position:relative}.scrollable-y-bordered .sidebar-header:after{background-color:var(--border-color);bottom:-1px;content:\" \";height:1px;left:0;opacity:0;position:absolute;right:0;z-index:1}body.animation-level-2 .scrollable-y-bordered .sidebar-header:after{transition:opacity var(--transition-standard-in)}.scrollable-y-bordered:not(.scrolled-top) .sidebar-header:after{opacity:1}.sidebar-close-button{flex:0 0 auto;height:2.5rem;overflow:inherit!important;width:2.5rem}.sidebar-content{display:flex;flex:1 1 auto;height:100%;max-height:100%;overflow:hidden;position:relative;width:100%}.profile-avatars-container{cursor:pointer;padding-bottom:100%;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}html.no-touch .profile-avatars-container:active .profile-avatars-arrow,html.no-touch .profile-avatars-container:hover .profile-avatars-arrow{opacity:.2}.profile-avatars-container.is-single .profile-avatars-arrow,.profile-avatars-container.is-single .profile-avatars-tabs{display:none}.profile-avatars-container.is-swiping .profile-avatars-arrow{opacity:0!important}.profile-avatars-avatars{display:flex;flex-wrap:nowrap;height:100%;position:absolute;transform:translateZ(-1px) scale(2);transform-origin:left top;transition:transform .2s ease-in-out;width:100%}.scrollable.no-parallax .profile-avatars-avatars{transform:translate(0)}.profile-avatars-avatars:before{bottom:0;content:\" \";left:0;right:0;top:0}.profile-avatars-avatar{background-color:#000;display:flex;height:inherit;min-height:100%;min-width:100%;position:relative;width:inherit}.profile-avatars-avatar .avatar-photo{height:100%;-o-object-fit:cover;object-fit:cover;pointer-events:none;width:100%}.profile-avatars-gradient{background:linear-gradient(1turn,rgba(0,0,0,.3) 8.98%,transparent);bottom:0;height:80px;left:0;position:absolute;right:0}[dir=ltr] .profile-avatars-info{left:1.5rem}[dir=rtl] .profile-avatars-info{right:1.5rem}.profile-avatars-info{align-items:flex-start;bottom:0;bottom:.5625rem;display:flex;flex-direction:column;pointer-events:none;position:absolute}[dir=ltr] .profile-avatars-info .profile-name,[dir=ltr] .profile-avatars-info .profile-subtitle{text-align:left}[dir=rtl] .profile-avatars-info .profile-name,[dir=rtl] .profile-avatars-info .profile-subtitle{text-align:right}.profile-avatars-info .profile-name,.profile-avatars-info .profile-subtitle{color:#fff;margin:0}.profile-avatars-info .peer-typing-container{--color:#fff}.profile-avatars-info .premium-icon{color:#fff}.profile-avatars-info .verified-icon-background{fill:#fff}.profile-avatars-info .verified-icon-check{visibility:hidden}.profile-avatars-info .premium-icon,.profile-avatars-info .profile-subtitle,.profile-avatars-info .verified-icon{opacity:.7}.profile-avatars-info .online{color:inherit!important}.profile-avatars-tabs{display:flex;height:.125rem;left:.375rem;pointer-events:none;position:absolute;right:.375rem;top:.5rem}.profile-avatars-tab{background-color:#fff;border-radius:4px;flex:1 1 auto;height:inherit;margin:0 .125rem;opacity:.2;transition:opacity .2s ease-in-out}.profile-avatars-tab.active{opacity:.6}.profile-avatars-arrow{bottom:0;left:0;opacity:0;position:absolute;top:0;width:33.3333333333%}.profile-avatars-arrow:before{color:#fff;font-size:2.1875rem;left:.625rem;position:absolute;top:50%;transform:translateY(-50%)}body.animation-level-2 .profile-avatars-arrow{transition:opacity .2s ease-in-out}html.no-touch .profile-avatars-container:not(.is-swiping) .profile-avatars-arrow:active,html.no-touch .profile-avatars-container:not(.is-swiping) .profile-avatars-arrow:hover{opacity:1!important}.profile-avatars-arrow-next{left:auto;right:0}.profile-avatars-arrow-next:before{left:auto;right:.625rem}.profile-content{display:flex;flex:0 0 auto;flex-direction:column;position:relative;width:100%}.profile-content .sidebar-left-section{background-color:var(--surface-color);padding-bottom:.5rem;position:relative}.profile-content .sidebar-left-section .profile-subtitle .peer-typing-container{justify-content:center}.profile-content.search-empty .gradient-delimiter{display:none}@media only screen and (max-width:600px){.profile-button{border-radius:0}}[dir=ltr] .profile-change-avatar{right:1.25rem}[dir=rtl] .profile-change-avatar{left:1.25rem}.profile-change-avatar{--size:3.375rem;position:absolute!important;top:calc(var(--size)/-2);transform:none;transition:none!important}.profile-container>.scrollable{display:flex;flex-direction:column}.profile-name{align-items:flex-end;color:var(--primary-text-color);display:flex;font-size:var(--font-size-20);font-weight:var(--font-weight-bold);line-height:var(--line-height-20);margin:0 auto;max-width:21.25rem;overflow:hidden;text-align:center}.profile-name span.emoji{min-width:-moz-min-content;min-width:min-content;vertical-align:inherit}.profile-name .peer-title{overflow:hidden;text-overflow:ellipsis;word-break:break-word}.sidebar-left-section-content>.profile-name{justify-content:center}.profile-name .badge-fake{align-self:center}.profile-subtitle{align-items:center;color:var(--secondary-text-color);display:flex;font-size:.875rem;justify-content:center;margin-bottom:.875rem;margin-top:1px;text-align:center}@media only screen and (max-width:600px){.profile-subtitle{margin-top:3px}}.profile-subtitle .online{color:var(--primary-color)}.profile-avatar{display:block;margin:.5rem auto 10px}@media only screen and (max-width:600px){.profile-avatar{--size:100px;--multiplier:.54;margin:0 auto 10px}}.profile-avatar,.profile-name,.profile-subtitle{flex:0 0 auto}.menu-horizontal-scrollable{--scrollable-size:3rem;height:var(--scrollable-size)}.menu-horizontal-scrollable:after{border-bottom:1px solid var(--border-color);bottom:0;content:\" \";height:1px;left:0;position:absolute;right:0;z-index:-1}.menu-horizontal-scrollable .menu-horizontal-div{border-bottom:none}.menu-horizontal-div{--size:var(--scrollable-size,3rem);--padding-horizontal:0px;border-bottom:1px solid var(--border-color);color:var(--secondary-text-color);display:flex;flex-direction:row;height:var(--size);justify-content:space-around;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:2}.menu-horizontal-div:not(.no-stripe):after,.menu-horizontal-div:not(.no-stripe):before{content:\" \";flex:0 0 auto;width:var(--padding-horizontal)}.menu-horizontal-div:not(.no-stripe) .menu-horizontal-div-item{border-radius:10px 10px 0 0}.menu-horizontal-div-item{align-items:center;border-radius:0;cursor:pointer;display:flex;flex:1 1 auto;font-size:1rem;font-weight:var(--font-weight-bold);height:100%;justify-content:center;line-height:var(--line-height);padding:0 1rem;position:relative;text-align:center;transition:none!important}html.no-touch .menu-horizontal-div-item:active,html.no-touch .menu-horizontal-div-item:hover{background-color:var(--light-secondary-text-color)}.menu-horizontal-div-item.active{color:var(--primary-color)}.menu-horizontal-div-item.active i{opacity:1}.menu-horizontal-div-item.active .c-ripple__circle,html.no-touch .menu-horizontal-div-item.active:active,html.no-touch .menu-horizontal-div-item.active:hover{background-color:var(--light-primary-color)}.menu-horizontal-div-item.active .badge{background-color:var(--primary-color)}.menu-horizontal-div-item>span{align-items:center;display:inline-flex;overflow:visible;pointer-events:none;position:relative}.menu-horizontal-div i{background-color:var(--primary-color);border-radius:.1875rem .1875rem 0 0;bottom:-.8125rem;box-sizing:content-box;height:.1875rem;left:0;opacity:0;pointer-events:none;position:absolute;transform-origin:left;width:100%;z-index:1}.menu-horizontal-div i.animate{transition:transform var(--tabs-transition)}.tabs-container{display:grid;grid-template-columns:100%;grid-template-rows:100%;min-width:100%;width:100%}.tabs-container .tabs-tab{background-color:var(--background-color);display:none;flex-direction:column;grid-column-start:1;grid-row-start:1;overflow:hidden}body.animation-level-0 .tabs-container .tabs-tab{transition:none!important}.tabs-container .tabs-tab.active{display:flex}.tabs-container[data-animation=tabs] .tabs-tab{transition:transform var(--tabs-transition)}.tabs-container[data-animation=navigation].animating .tabs-tab{transition:transform var(--transition-standard-in),filter var(--transition-standard-in)}.tabs-container[data-animation=navigation].animating.backwards .tabs-tab{transition:transform var(--transition-standard-out),filter var(--transition-standard-out)}#column-left{flex:1 1 auto;flex-direction:column;max-width:420px;width:420px}@media only screen and (max-width:600px){#column-left{max-width:100%;width:100%}body:not(.is-left-column-shown) #column-left{filter:brightness(80%);transform:translate3d(-25vw,0,0)}}@media only screen and (min-width:601px){#column-left{overflow:visible}[dir=ltr] #column-left:after{right:-1px}[dir=rtl] #column-left:after{left:-1px}#column-left:after{background-color:var(--border-color);content:\" \";display:block;height:100vh;position:absolute;top:0;width:1px;z-index:2}}@media only screen and (min-width:601px)and (max-width:925px){#column-left{display:flex;left:0;max-width:none;position:fixed;top:0;transform:translate3d(-5rem,0,0);transition:transform var(--layer-transition);width:26.5rem}body.animation-level-0 #column-left{transition:none}body.is-left-column-shown #column-left{transform:translateZ(0)}}@media only screen and (min-width:926px){#column-left{display:flex}}@media only screen and (max-width:1275px){#column-left{flex:2}}@media only screen and (min-width:1681px){html.is-safari #column-left{max-width:418.75px}}#column-left .item-main .menu-horizontal-scrollable{background-color:var(--surface-color);position:relative;top:auto;z-index:1}@media only screen and (max-width:600px){#column-left .item-main .menu-horizontal-scrollable{box-shadow:0 1px 5px -1px rgba(0,0,0,.16)}}#column-left .item-main .menu-horizontal-scrollable .scrollable{position:relative}[dir=ltr] #column-left .item-main .menu-horizontal-scrollable .badge{margin-left:5px}[dir=rtl] #column-left .item-main .menu-horizontal-scrollable .badge{margin-right:5px}#column-left .item-main .menu-horizontal-scrollable:not(.hide)+#folders-container{height:calc(100% - var(--scrollable-size));position:relative}#column-left .item-main .menu-horizontal-scrollable:not(.hide)+#folders-container .scrollable{padding-top:.5rem}#column-left .item-main .menu-horizontal-scrollable:not(.hide)+#folders-container .dialogs-placeholder-canvas{top:.5rem}#column-left .item-main .menu-horizontal-div{--padding-horizontal:.6875rem;justify-content:flex-start;position:relative!important;z-index:0}@media only screen and (max-width:600px){#column-left .item-main .menu-horizontal-div{--padding-horizontal:.1875rem}}#column-left .item-main .menu-horizontal-div-item{flex:0 0 auto;min-width:3rem}#column-left .item-main .menu-horizontal-div__stripe{display:none}#column-left .folders-tabs-scrollable{flex:0 0 auto}#column-left .item-main{--offset-top:0;background-color:var(--surface-color)}[dir=ltr] #column-left .item-main .input-search .selector-user{left:6px}[dir=rtl] #column-left .item-main .input-search .selector-user{right:6px}[dir=ltr] #column-left .item-main .input-search .selector-user{margin-left:0}[dir=rtl] #column-left .item-main .input-search .selector-user{margin-right:0}#column-left .item-main .input-search .selector-user{height:30px;line-height:1.875rem;position:absolute!important;top:6px;z-index:1}[dir=ltr] #column-left .item-main .input-search.is-picked .input-search-input{padding-left:calc(var(--paddingLeft) + 12px - var(--border-width))}[dir=rtl] #column-left .item-main .input-search.is-picked .input-search-input{padding-right:calc(var(--paddingLeft) + 12px - var(--border-width))}#column-left .item-main .input-search.is-picked .tgico-close{display:block!important}#column-left .item-main .input-search.is-picked-twice .selector-user:first-of-type{width:30px}[dir=ltr] #column-left .item-main .input-search.is-picked-twice .selector-user:last-of-type{left:38px}[dir=rtl] #column-left .item-main .input-search.is-picked-twice .selector-user:last-of-type{right:38px}[dir=ltr] #column-left .item-main .search-helper{margin-left:28px}[dir=rtl] #column-left .item-main .search-helper{margin-right:28px}#column-left .item-main .search-helper{display:flex}@media only screen and (max-width:600px){[dir=ltr] #column-left .item-main .search-helper{margin-left:20px}[dir=rtl] #column-left .item-main .search-helper{margin-right:20px}}#column-left .item-main .search-helper .selector-user{font-size:14px;margin-top:7px}html.no-touch #column-left .item-main .search-helper .selector-user:active,html.no-touch #column-left .item-main .search-helper .selector-user:hover{background-color:var(--light-primary-color)}#column-left .item-main .search-helper .selector-user-avatar:after{display:none!important}#column-left .item-main .search-helper:empty{display:none}#column-left .item-main .search-super-tabs-scrollable{flex:0 0 auto;position:relative!important}#column-left .item-main .search-super-tabs-scrollable:before{display:none}#column-left .item-main .search-super-tabs-scrollable .menu-horizontal-div-item{flex:1 0 auto!important}#column-left .item-main .search-super .preloader{height:100%;top:50%;transform:translate(-50%,-50%)}#column-left #chatlist-container{background-color:var(--surface-color);max-height:100%;position:relative}#column-left #chatlist-container.has-filters .connection-status-bottom{height:calc(100% + var(--offset-top)*-1)}#column-left #folders-container{flex:1 1 auto}#column-left #folders-container .scrollable-y{background-color:transparent;position:absolute}#column-left #folders-container .scrollable-y.active{display:block}#column-left .dialogs-placeholder-canvas{position:absolute;top:0;z-index:2}#column-left .sidebar-slider{height:100%}#column-left .sidebar-header__btn-container{align-items:center;display:flex;flex:0 0 auto;height:2.5rem;justify-content:center;position:relative;width:2.5rem}#column-left .sidebar-header__btn-container>.btn-icon{bottom:0;left:0;margin:0;opacity:0;position:absolute;right:0;top:0;visibility:hidden;z-index:4}body.animation-level-0 #column-left .sidebar-header__btn-container>.btn-icon:before{transition:none}#column-left .sidebar-header__btn-container>.btn-icon.is-visible{opacity:1;visibility:visible}@media only screen and (max-width:600px){#column-left .sidebar-header__btn-container .btn-menu{margin-top:-.25rem}}#column-left .sidebar-tools-button{width:100%}#column-left .sidebar-tools-button .btn-menu{max-height:calc(var(--vh)*100 - 3.75rem);min-width:260px}[dir=ltr] #column-left .sidebar-tools-button .btn-menu-item{padding-right:.375rem}[dir=rtl] #column-left .sidebar-tools-button .btn-menu-item{padding-left:.375rem}[dir=ltr] #column-left .archived-count{margin-left:.625rem}[dir=rtl] #column-left .archived-count{margin-right:.625rem}#column-left .archived-count{justify-self:flex-end}html[dir=ltr].is-mobile #column-left .archived-count{margin-right:.375rem}html[dir=rtl].is-mobile #column-left .archived-count{margin-left:.375rem}@media only screen and (max-width:600px){#column-left .archived-count{font-weight:var(--font-weight-bold)}}#column-left .archived-count:empty{display:none}#column-left .search-group-people .chatlist{display:flex;flex-direction:row;margin-top:-1px;padding:0 0 1px}#column-left .search-group-people .chatlist:after,#column-left .search-group-people .chatlist:before{content:\" \";display:inline-block;flex:0 0 auto;width:.3125rem}#column-left .search-group-people .chatlist-chat{align-items:center;border-radius:10px;display:flex;flex:0 0 auto;flex-direction:column;height:6.125rem;justify-content:flex-end;max-width:4.875rem;padding:0!important;width:4.875rem}#column-left .search-group-people .dialog-subtitle,#column-left .search-group-people .dialog-title-details{display:none}#column-left .search-group-people .dialog-title{max-width:65px;padding-bottom:.75rem}#column-left .search-group-people .dialog-title .user-title{font-size:.75rem!important}#column-left .search-group-people .dialog-title .peer-title{font-weight:var(--font-weight-normal)!important}[dir=ltr] #column-left .search-group-people .dialog-avatar{left:auto!important}[dir=rtl] #column-left .search-group-people .dialog-avatar{right:auto!important}#column-left .search-group-people .dialog-avatar{top:.75rem!important}#column-left .search-group-people .search-group-scrollable{position:relative}@media only screen and (max-width:600px){[dir=ltr] #column-left .search-group-people .search-group-scrollable{margin-left:-7px}[dir=rtl] #column-left .search-group-people .search-group-scrollable{margin-right:-7px}#column-left .search-group-people .search-group-scrollable{margin-top:4px}}#column-left .search-group-people .search-group-scrollable>.scrollable{position:relative}#column-left .item-main .sidebar-content{justify-content:center}#column-left .item-main .sidebar-content .btn-menu{bottom:calc(100% + 10px)}#column-left .item-main .sidebar-content .btn-corner.menu-open .tgico-close,#column-left .item-main .sidebar-content .btn-corner:not(.menu-open) .tgico-newchat_filled{visibility:visible!important}body.animation-level-2 #column-left .item-main .sidebar-content .btn-corner.menu-open .tgico-close,body.animation-level-2 #column-left .item-main .sidebar-content .btn-corner:not(.menu-open) .tgico-newchat_filled{animation:grow-icon .4s ease-in-out forwards!important}@media only screen and (max-width:600px){#column-left .item-main .sidebar-content .btn-corner{--size:54px;bottom:14px;position:fixed!important;right:14px;z-index:1}}#column-left .item-main .sidebar-content .btn-corner:not(.is-hidden){transform:translateZ(0)}#column-left .connection-status{flex:0 0 auto;overflow:hidden;padding:0 .5rem .5rem;width:100%}#column-left .connection-status:not(.is-shown) .connection-status-button{display:none}#column-left .connection-status.is-shown.animating .connection-status-button,#column-left .connection-status.is-shown.animating+.connection-status-bottom{transition:transform var(--layer-transition)}#column-left .connection-status.is-shown:not(.backwards) .connection-status-button{transform:translateY(0)}#column-left .connection-status.is-shown:not(.backwards)+.connection-status-bottom{transform:translateY(calc(64px + var(--offset-top)))}#column-left .connection-status.is-shown:not(.animating):not(.backwards)+.connection-status-bottom{height:calc(100% - 64px + var(--offset-top))}[dir=ltr] #column-left .connection-status-button{padding-left:4.5rem}[dir=rtl] #column-left .connection-status-button{padding-right:4.5rem}[dir=ltr] #column-left .connection-status-button{text-align:left}[dir=rtl] #column-left .connection-status-button{text-align:right}#column-left .connection-status-button{align-self:center;color:#2e3939;cursor:default;height:3.5rem;transform:translateY(-100%)}#column-left .connection-status-button .force-reconnect{color:inherit;cursor:pointer;text-decoration:underline}[dir=ltr] #column-left .connection-status-button .preloader-container{left:1rem}[dir=rtl] #column-left .connection-status-button .preloader-container{right:1rem}#column-left .connection-status-button .preloader-container{height:1.5rem;right:auto;width:1.5rem}#column-left .connection-status-button .preloader-container .preloader-path-new{stroke:#2e3939}#column-left .connection-status-bottom{--offset-top:0px;background-color:var(--surface-color);bottom:0;display:flex;flex-direction:column;height:100%;left:0;overflow:hidden;position:absolute;right:0;top:0;transform:translateY(var(--offset-top))}#column-left .input-wrapper{flex:0 0 auto;margin:.75rem 0;max-width:100%;padding:0 .75rem;width:420px}@media only screen and (max-width:600px){#column-left .input-wrapper{width:100%}}#search-container{display:flex;top:var(--offset-top)!important}#search-container .scrollable-y{flex:1 1 auto;position:relative}.edit-profile-container .sidebar-content,.new-channel-container .sidebar-content,.new-group-container .sidebar-content{flex-direction:column}.edit-profile-container .chatlist-container,.new-channel-container .chatlist-container,.new-group-container .chatlist-container{flex:1 1 auto}[dir=ltr] .edit-profile-container .caption,[dir=ltr] .new-channel-container .caption,[dir=ltr] .new-group-container .caption{margin-left:23px}[dir=rtl] .edit-profile-container .caption,[dir=rtl] .new-channel-container .caption,[dir=rtl] .new-group-container .caption{margin-right:23px}[dir=ltr] .edit-profile-container .caption,[dir=ltr] .new-channel-container .caption,[dir=ltr] .new-group-container .caption{padding-right:24px}[dir=rtl] .edit-profile-container .caption,[dir=rtl] .new-channel-container .caption,[dir=rtl] .new-group-container .caption{padding-left:24px}.edit-profile-container .caption,.new-channel-container .caption,.new-group-container .caption{color:var(--secondary-text-color);font-size:.875rem;margin-top:14px}.language-container .sidebar-left-section{padding-bottom:.5rem}.new-group-container .search-group{margin-top:.5rem}.edit-folder-container .chatlist{padding:0}.edit-folder-container .folder-categories .folder-category-button:nth-child(n+2){pointer-events:none}.new-group-members{padding:1.5rem 0 .4375rem}.new-group-members .search-group__name{text-transform:capitalize}.settings-container .profile-avatars-container{height:15rem;padding-bottom:0}.edit-profile-container .scroll-wrapper{width:100%}.chat-folders-container,.edit-folder-container,.people-nearby-container{-webkit-user-select:none;-moz-user-select:none;user-select:none}.chat-folders-container .sticker-container,.edit-folder-container .sticker-container,.people-nearby-container .sticker-container{flex:0 0 auto;height:86px;margin:1px auto 29px;position:relative;width:86px}.chat-folders-container .caption,.edit-folder-container .caption,.people-nearby-container .caption{color:var(--secondary-text-color);font-size:var(--font-size-14);line-height:var(--line-height-14);margin:0 auto;max-width:20rem;text-align:center}.people-nearby-container .sticker-container{margin:1rem auto}.people-nearby-container .caption{margin-bottom:1rem}.chat-folders-container .sidebar-left-section:not(:last-child){padding-bottom:0}.chat-folders-container .sidebar-left-section:last-child{padding-bottom:.5rem}.edit-folder-container .caption{margin-bottom:18px}@media only screen and (max-width:600px){.edit-folder-container .input-wrapper{padding:0 16px;width:100%}}.edit-folder-container .sidebar-left-section{padding-bottom:0}.edit-folder-container .sidebar-left-section:last-child{padding-bottom:.5rem}.folder-categories .checkbox-field{position:absolute;right:1.125rem!important}.included-chatlist-container .sidebar-left-section{padding-bottom:0}.included-chatlist-container .sidebar-left-section:first-child{padding-top:0}.included-chatlist-container .sidebar-left-section:last-child{padding-bottom:.5rem}.included-chatlist-container .sidebar-left-section .chatlist{padding:0}.included-chatlist-container .selector .chatlist .checkbox{margin-top:10px}[dir=ltr] .included-chatlist-container .selector .chatlist [type=checkbox]+span{padding-left:26px}[dir=rtl] .included-chatlist-container .selector .chatlist [type=checkbox]+span{padding-right:26px}[dir=ltr] .included-chatlist-container .chatlist-chat{padding-right:3.5rem!important}[dir=rtl] .included-chatlist-container .chatlist-chat{padding-left:3.5rem!important}.search-group-recent .search-group__name{align-items:center;display:flex;justify-content:space-between}.search-group-recent .btn-icon{font-size:22px}@media only screen and (max-width:600px){.search-group-recent.search-group.search-group-contacts ul{margin-top:0}.search-group.search-group-contacts ul,.search-group.search-group-messages ul{margin-top:7px}.search-group.search-group-messages{margin-top:-6px}}@media only screen and (min-width:601px){.search-group-recent.search-group.search-group-contacts{padding:0 0 7px}}.sidebar-left-section{padding:.5rem 0 1rem}.sidebar-left-section.with-fake-delimiter{box-shadow:none;padding-top:0!important}.sidebar-left-section.with-fake-delimiter .gradient-delimiter{margin-bottom:.5rem}.sidebar-left-section.no-padding-top{padding-top:0!important}@media only screen and (max-width:600px){.sidebar-left-section{padding-bottom:.5rem}}@media only screen and (min-width:601px){.sidebar-left-section-content{margin:0 .5rem}}.sidebar-left-section-content>.btn-primary{margin:0}[dir=ltr] .sidebar-left-section-content>.checkbox-field .checkbox-box{left:auto}[dir=rtl] .sidebar-left-section-content>.checkbox-field .checkbox-box{right:auto}@media only screen and (max-width:600px){.sidebar-left-section-content>.btn-primary,.sidebar-left-section-content>.checkbox-ripple{border-radius:0}}.sidebar-left-section-content.full-width{margin:0!important}.sidebar-left-section-content>.media-sticker-wrapper{flex:0 0 auto;height:86px;margin:1px auto 29px;position:relative;width:86px}.sidebar-left-section-name{padding:1rem}@media only screen and (max-width:600px){.sidebar-left-section-name{font-size:.875rem;padding:.5rem 1rem}}.sidebar-left-section-caption{color:var(--secondary-text-color);font-size:1rem;line-height:var(--line-height);margin-top:1rem;padding:0 1rem}@media only screen and (max-width:600px){.sidebar-left-section-caption{font-size:.875rem;margin:.5rem}}.sidebar-left-section .checkbox-field,.sidebar-left-section .radio-field{margin:0}.sidebar-left-section:first-child:not(.no-delimiter){padding-top:0}.sidebar-left-section .checkbox-field{align-items:center;display:flex;height:3.5rem;padding:0 1.125rem}.sidebar-left-section-disabled{opacity:.25;pointer-events:none!important}.sidebar-left-section .chatlist{padding:0}.sidebar-left-h2{color:var(--primary-color);font-size:16px;font-weight:var(--font-weight-bold)}.general-settings-container{-webkit-user-select:none;-moz-user-select:none;user-select:none}.general-settings-container .sidebar-left-section{padding-bottom:0}.general-settings-container .sidebar-left-section:last-child{padding-bottom:.5rem}#chats-archived-container,#contacts-container,#poll-results-container,#search-gifs-container,#search-private-container,#stickers-container,.add-members-container{background-color:var(--surface-color)!important}.chat-folders-container .btn-control{margin-bottom:1.5rem}.two-step-verification{background-color:var(--surface-color)!important}.two-step-verification .sidebar-left-section{box-shadow:none!important}.two-step-verification .sidebar-left-section:first-child{padding-top:0}.two-step-verification .sidebar-left-section-caption{margin-bottom:1.125rem;margin-left:auto;margin-right:auto;max-width:342px;text-align:center}.two-step-verification-main .btn-primary+.btn-primary{margin-top:.125rem!important}.two-step-verification .btn-primary:not(.btn-transparent){text-transform:uppercase}.two-step-verification .media-sticker-wrapper{height:168px;margin:.625rem auto 1.1875rem;width:168px}.two-step-verification .input-wrapper .btn-primary:first-child:last-child{margin-top:.25rem}.two-step-verification-enter-password .media-sticker-wrapper{height:157px;margin:1.125rem auto 1.8125rem;width:157px}.two-step-verification-hint .media-sticker-wrapper{height:160px;margin:.5rem auto 2.25rem;width:160px}.two-step-verification-email .media-sticker-wrapper{height:160px;margin:.5625rem auto 2.1875rem;width:160px}.two-step-verification-set .media-sticker-wrapper{height:160px;margin:1rem auto 1.3125rem;width:160px}[dir=ltr] .two-step-verification-set .media-sticker-wrapper .rlottie,[dir=ltr] .two-step-verification-set .media-sticker-wrapper .rlottie-vector{left:.625rem}[dir=rtl] .two-step-verification-set .media-sticker-wrapper .rlottie,[dir=rtl] .two-step-verification-set .media-sticker-wrapper .rlottie-vector{right:.625rem}.dont-u-dare-block-me .sidebar-left-section.no-delimiter{padding-top:.75rem}.dont-u-dare-block-me .sidebar-left-section{padding:0 0 .5rem}@media only screen and (min-width:601px){.privacy-tab .sidebar-left-section:first-child{padding-bottom:1.125rem}}.privacy-tab form{padding-bottom:.0625rem}.active-sessions-container .row-title:first-child{font-weight:var(--font-weight-bold)}.active-sessions-container .row-title-right{color:var(--secondary-text-color);font-size:var(--font-size-12);line-height:var(--line-height-12)}.active-sessions-container .row-midtitle,.active-sessions-container .row-subtitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.active-sessions-container .sidebar-left-section:first-child{padding-bottom:0}.active-sessions-container .sidebar-left-section:first-child .row-title{font-weight:var(--font-weight-bold)}@media only screen and (min-width:601px){.blocked-users-container ul{padding:0 .6875rem}}.notifications-container .sidebar-left-section{padding-bottom:0}.range-setting-selector{padding:1rem .875rem}.range-setting-selector-details{display:flex;justify-content:space-between;margin-bottom:1rem}.range-setting-selector-name{color:var(--primary-text-color)}.range-setting-selector-value{color:var(--secondary-text-color)}.range-setting-selector .progress-line{--height:2px;--color:var(--primary-color);--border-radius:4px;--thumb-size:12px;background-color:#e6ecf0}.range-setting-selector .progress-line__filled{background-color:var(--primary-color)}.background-container .background-item:after{border:3px solid var(--primary-color);bottom:0;content:\" \";display:block;left:0;opacity:0;position:absolute;right:0;top:0;transition:opacity .2s ease-in-out}.background-container .background-item.active:after{opacity:1}.background-container .background-item.active .grid-item-media{transform:scale(.91)}.background-container .background-item-media{transform:scale(1);transition:transform .2s ease-in-out}.background-container .background .preloader-container{z-index:1}.background-item{cursor:pointer}.background-item-media{border-radius:inherit}.background-item-media.is-pattern{background-color:#000;bottom:0;left:0;position:absolute;right:0;top:0}.background-item-media.is-pattern .media-photo{mix-blend-mode:soft-light}.background-item .media-photo{border-radius:inherit;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.background-colors-canvas{border-radius:inherit;height:100%;-webkit-mask-position:center;-webkit-mask-size:cover;position:absolute;width:100%}.background-image-container .sidebar-left-section{padding-bottom:.5rem}.empty-placeholder{line-height:var(--line-height);margin:0 auto;padding:0 1rem;position:relative;text-align:center;top:40%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none;width:21rem!important}.empty-placeholder .media-sticker-wrapper{height:128px;margin:0 auto 1.9375rem;position:relative;width:128px}.empty-placeholder-header{font-size:1.25rem;font-weight:var(--font-weight-bold)}.empty-placeholder-subtitle{color:var(--secondary-text-color);font-size:.875rem;margin-top:.375rem}.empty-placeholder .btn-control{margin-top:1.75rem;padding:0 1.0625rem 0 .8125rem}[dir=ltr] .empty-placeholder .btn-control:before{margin-right:.625rem}[dir=rtl] .empty-placeholder .btn-control:before{margin-left:.625rem}.empty-placeholder-dialogs{opacity:0}body.animation-level-2 .empty-placeholder-dialogs{transition:opacity .2s ease-in-out}.empty-placeholder-dialogs-icon{margin-bottom:1.0625rem}.empty-placeholder-dialogs.visible{opacity:1}.is-forum-visible .can-have-forum .input-search,.is-forum-visible .can-have-forum .row-row,.is-forum-visible .can-have-forum .sidebar-header__title{opacity:0}.is-forum-visible .folders-tabs-scrollable{opacity:var(--disabled-opacity);pointer-events:none}.is-forum-visible.backwards .can-have-forum .input-search,.is-forum-visible.backwards .can-have-forum .row-row,.is-forum-visible.backwards .can-have-forum .sidebar-header__title,.is-forum-visible.backwards .folders-tabs-scrollable{opacity:1}.is-forum-visible.animating .can-have-forum .input-search,.is-forum-visible.animating .can-have-forum .row-row,.is-forum-visible.animating .can-have-forum .sidebar-header__title,.is-forum-visible.animating .folders-tabs-scrollable{transition:opacity var(--transition-standard-in)}.is-forum-visible.animating.backwards .can-have-forum .input-search,.is-forum-visible.animating.backwards .can-have-forum .row-row,.is-forum-visible.animating.backwards .can-have-forum .sidebar-header__title,.is-forum-visible.animating.backwards .folders-tabs-scrollable{transition:opacity var(--transition-standard-out)}#column-right{overflow:visible;overflow:initial;position:relative}@media only screen and (min-width:601px)and (max-width:1275px){#column-right{box-shadow:0 .25rem .5rem .1rem rgba(0,0,0,.2)}}@media only screen and (max-width:600px){body:not(.is-right-column-shown) #column-right{transform:translate3d(100vw,0,0)}}@media only screen and (min-width:601px)and (max-width:925px){body.is-right-column-shown:not(.is-left-column-shown) #column-right{transform:translateZ(0);transition:transform var(--transition-standard-in)}}@media only screen and (min-width:926px){body.is-right-column-shown #column-right{transform:translateZ(0);transition:transform var(--transition-standard-in)}}@media only screen and (min-width:601px){#column-right{position:absolute;right:0;transform:translate3d(var(--right-column-width),0,0);transition:transform var(--transition-standard-out);width:calc(var(--right-column-width));z-index:3}#column-right .sidebar-content{min-width:var(--right-column-width)}body.animation-level-0 #column-right{transition:none}}@media only screen and (min-width:1276px){#column-right{border-left:1px solid var(--border-color);transform:translate3d(calc(var(--right-column-width) + 1px),0,0);width:calc(var(--right-column-width) + 1px)}}#column-right .sidebar-header{flex:0 0 auto}#column-right .sidebar-header .sidebar-close-button.tgico:before{content:\"\"}@media only screen and (min-width:601px){#column-right .sidebar-header .sidebar-close-button.tgico:before{content:\"\"}}#column-right #search-private-container .chatlist-container{flex:1 1 auto;position:relative}#column-right .sidebar-search{display:none}#column-right .sidebar-search.active{display:flex}#column-right .input-wrapper{margin:.75rem 0;max-width:100%;padding:0 .75rem;width:100%}.shared-media-container .scrollable:not(.no-parallax){perspective:0;perspective-origin:0 0}.shared-media-container .scrollable:not(.no-parallax).parallax{perspective:1px}.shared-media-container .profile-content.is-me .profile-name{margin-bottom:.9375rem}.shared-media-container .profile-content.is-me .profile-subtitle{display:none}.shared-media-container .search-super{min-height:calc(var(--vh, 1vh)*100 - 56px);top:100%}.shared-media-container .search-super-tabs{--padding-horizontal:0}.shared-media-container .search-super-tabs .menu-horizontal-div-item{border-radius:0!important}.shared-media-container .sidebar-header .transition{flex-grow:1}.shared-media-container .sidebar-header .transition .transition-item{align-items:center;display:flex}.shared-media-container .btn-corner.menu-open:before{content:\"\"}@media only screen and (max-width:600px){.shared-media-container .btn-corner{bottom:14px;height:54px;position:fixed!important;right:14px;width:54px;z-index:1}}.shared-media-container.can-add-members .btn-corner:not(.is-hidden){transform:translateZ(0)}.search-super{background-color:var(--surface-color);display:flex;flex-direction:column;max-width:100%;min-height:100%;position:absolute;width:100%}.search-super .search-group__show-more{color:var(--primary-color);cursor:pointer;font-weight:400}.search-super .search-super-month-name{border-top:1px solid var(--border-color);color:var(--secondary-text-color);font-weight:var(--font-weight-bold);padding:24px 0 0 24px}@media only screen and (max-width:600px){.search-super .search-super-month-name{padding:18px 0 0 16px}}.search-super.sliding{max-height:none!important}.search-super-tabs{flex:1 1 auto;width:auto}.search-super-tabs-scrollable{background-color:var(--surface-color);box-shadow:none!important;position:sticky!important;top:0;z-index:2}.search-super-tabs-scrollable:before{background-color:inherit;content:\" \";display:block;height:1px;left:0;position:absolute;top:0;width:100%;z-index:-1}.search-super.is-full-viewport .search-super-tabs-scrollable:before{top:-1px}.search-super-tabs-scrollable .scrollable{display:flex;position:relative}.search-super-tabs-container{flex:1 1 auto;grid-template-rows:100%;min-height:calc(100% - 49px)}.search-super-tabs-container>div{background-color:var(--surface-color)!important;min-height:150px;position:relative}.search-super-tabs-container>div>div:first-child{min-height:calc(100vh - 111px);transform:translateY(0)}.search-super-tabs-container .preloader{padding:0;position:absolute!important;top:100px;transform:translate(-50%)}.search-super-tabs-container .preloader>svg{height:50px;width:50px}.search-super-month:first-of-type .search-super-month-name{display:none}.search-super .audio-title,.search-super .document-name,.search-super .title{display:flex;justify-content:space-between}.search-super .sent-time{color:var(--secondary-text-color);flex:0 0 auto;font-size:12px;margin-left:8px;margin-top:3px}.search-super-content-media .search-super-month-name{border:none;padding:9px 0 7px 24px}.search-super-content-media .video-time{background-color:var(--message-time-background);border-radius:4px;color:#fff;font-size:12px;height:18px;left:5px;line-height:18px;padding:0 6px 0 5px;position:absolute;top:4px;z-index:2}.search-super-content-media .grid-item{overflow:hidden}.search-super-content-media .checkbox-field{right:.25rem;top:.25rem}.search-super .checkbox-box{box-shadow:0 0 3px 0 rgba(0,0,0,.4)}.search-super .checkbox-box-border{border-color:var(--message-checkbox-border-color)}.search-super .checkbox-box-background{background-color:var(--message-checkbox-color)}.search-super .checkbox-field{margin:0;position:absolute!important;z-index:2}.search-super-content-media .search-super-month-items{grid-gap:1px;display:grid;grid-auto-rows:1fr;grid-template-columns:repeat(3,1fr);padding-top:1px;width:100%}.search-super-content-files .search-super-month-items{padding:8px 24px 16px 20px}@media only screen and (max-width:600px){.search-super-content-files .search-super-month-items{padding:8px 16px 8px 12px}}.search-super-content-files .document{--icon-size:3rem;--icon-margin:.75rem;height:calc(48px + 1.5rem)}.search-super-content-files .document-download,.search-super-content-files .document-ico{border-radius:5px!important}.search-super-content-files .document-name{font-weight:400;max-width:100%;overflow:hidden;text-overflow:ellipsis;width:100%}.search-super-content-links .search-super-item{cursor:pointer;display:flex;flex-direction:column;justify-content:flex-start;min-height:4.375rem;overflow:hidden;padding-left:4.4375rem;position:relative}.search-super-content-links .row-media{border-radius:.375rem;height:3rem;left:.6875rem;overflow:hidden;position:absolute;width:3rem}.search-super-content-links .row-media.empty{align-items:center;background-color:var(--primary-color);color:#fff;display:flex;font-size:2rem;justify-content:center;text-transform:uppercase}.search-super-content-links a:not(:last-child){position:relative;z-index:2}.search-super-content-links .anchor-url:last-child{position:static}.search-super-content-links .anchor-url:last-child:before{bottom:0;content:\" \";cursor:pointer;left:0;position:absolute;right:0;top:0;z-index:1}.search-super-content-links .media-photo{border-radius:inherit;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.search-super-content-links .row-title{margin-top:.1875rem}.search-super-content-links .row-subtitle{overflow:hidden;text-overflow:ellipsis;white-space:pre-wrap;word-break:break-word}.search-super-content-links .sent-time{margin:1px 0 0}.search-super-content-links .sender-title{display:block;margin-top:.25rem}.search-super-content-links .checkbox-field{--offset-left:0!important;margin:2rem 0 0 -1.75rem!important;padding:0!important}@media only screen and (min-width:601px){.search-super-content-links .search-super-month-items{margin:.5625rem}}@media only screen and (max-width:600px){.search-super-content-links .search-super-month-name{padding:.875rem 1rem}}.search-super-content-music .search-super-month-items,.search-super-content-voice .search-super-month-items{padding:20px 15px 0 20px}@media only screen and (max-width:600px){.search-super-content-music .search-super-month-items,.search-super-content-voice .search-super-month-items{padding:20px 15px 0 12px}}.search-super-content-music .audio,.search-super-content-voice .audio{justify-content:normal;margin-bottom:1.5rem}@media only screen and (min-width:601px){.search-super-content-music .audio,.search-super-content-voice .audio{max-width:377px}}.search-super-content-music .audio.audio-show-progress .audio-subtitle,.search-super-content-voice .audio.audio-show-progress .audio-subtitle{overflow:visible}.search-super-content-groups .chatlist,.search-super-content-members .chatlist{padding-bottom:.5rem;padding-top:.5rem}.search-super-tabs-scrollable .search-super-nav-scrollable{opacity:1}body.animation-level-2 .search-super-tabs-scrollable .search-super-nav-scrollable,body.animation-level-2 .search-super-tabs-scrollable .search-super-selection-container{transition:opacity .2s ease-in-out}.search-super-tabs-scrollable.is-selecting:not(.backwards) .search-super-nav-scrollable{opacity:0}.search-super-tabs-scrollable.is-selecting:not(.backwards) .search-super-selection-container{opacity:1}.search-super.is-selecting a{pointer-events:none}.search-super.is-selecting .row:not(.menu-open){background-color:transparent!important}.search-super-selection-container{align-items:center;bottom:0;display:flex;justify-content:space-between;left:0;opacity:0;padding:0 1rem;position:absolute;right:0;top:0}.search-super-selection-container .btn-icon+.btn-icon{margin-left:.5rem}@media only screen and (max-width:600px){.search-super-selection-container{padding:0 .5rem}}.search-super-selection-count{color:var(--primary-text-color);flex-grow:1;font-weight:var(--font-weight-bold);margin-left:1.5rem;text-transform:capitalize;white-space:nowrap}#search-container .search-group.is-short .chatlist-chat:nth-child(n+4),#search-container .search-super-content-music .audio:not(.audio-show-progress) .audio-description:before,#search-container .search-super-content-music .audio:not(.audio-show-progress) .audio-time{display:none}#stickers-container .sticker-sets{display:flex;flex-direction:column;margin-top:16px}#stickers-container .sticker-set{cursor:pointer;display:flex;flex-direction:column;height:140px}#stickers-container .sticker-set-name{font-weight:var(--font-weight-bold)}#stickers-container .sticker-set-count{color:var(--secondary-text-color);font-size:14px}#stickers-container .sticker-set-header{display:flex;justify-content:space-between;padding-bottom:12px;padding-left:16px}#stickers-container .sticker-set-button{border-radius:16px;font-size:15px;font-weight:400;height:30px;margin-right:16px;padding-left:12px;padding-right:13px;transition:width .2s;width:auto}#stickers-container .sticker-set-button.gray{background:#f1f3f4;color:var(--secondary-text-color)}#stickers-container .sticker-set-stickers{display:flex;justify-content:space-around}#stickers-container .sticker-set-sticker{height:68px;position:relative;width:68px}#stickers-container .sticker-set-sticker:hover{background-color:var(--light-secondary-text-color);border-radius:12px}#stickers-container .sticker-set-sticker img{max-height:100%;max-width:100%}#poll-results-container .poll-results{display:flex;flex-direction:column;position:relative;width:100%}#poll-results-container .poll-results-answer{color:var(--secondary-text-color);display:flex;font-size:15px;font-weight:var(--font-weight-bold);justify-content:space-between;margin:0;padding:0 16px 8px;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media only screen and (min-width:601px){#poll-results-container .poll-results-answer{padding:0 24px 8px}}#poll-results-container .poll-results-more{margin:0 .5rem;width:auto}@media only screen and (max-width:600px){#poll-results-container .poll-results-more{border-radius:0;margin:0}}#poll-results-container .poll-results h3{font-size:20px;margin-bottom:16px;margin-top:15px;padding:0 16px}@media only screen and (min-width:601px){#poll-results-container .poll-results h3{padding:0 24px}}#poll-results-container .poll-results hr{display:block!important;margin-bottom:15px;margin-top:7px}.edit-peer-container .input-wrapper{margin-bottom:.5625rem!important}.edit-peer-container .sidebar-left-section{padding:0 0 .5rem}.edit-peer-container .chatlist-new{padding:0}.edit-contact-container .input-wrapper{margin-top:1.8125rem!important}.edit-contact-container .avatar-placeholder{filter:none!important}.edit-contact-container .avatar-edit{margin-bottom:1.375rem!important}.edit-contact-container .profile-name{font-size:1.5rem;line-height:var(--line-height)}.group-type-container .sidebar-left-section-caption{font-size:.875rem;margin-top:.8125rem}.group-type-container .input-wrapper{margin-top:.875rem!important}.media-viewer{align-items:center;background:rgba(0,0,0,.88);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0}@media only screen and (max-width:600px){.media-viewer{background:#000}}.media-viewer-author{align-items:center;cursor:pointer;display:flex;height:100%}@media only screen and (max-width:600px){.media-viewer-author{margin-left:1.5rem}}.media-viewer-userpic{margin-right:1rem}@media only screen and (max-width:600px){.media-viewer-userpic{display:none}}.media-viewer-name{font-weight:var(--font-weight-bold);line-height:var(--line-height);margin:.0625rem 0}@media only screen and (min-width:601px){.media-viewer-name{margin:.0625rem 0 .125rem}}.media-viewer-date{font-size:.875rem;line-height:var(--line-height)}.media-viewer-buttons{display:flex;flex-flow:row nowrap;padding:.5rem .75rem;position:absolute;right:0;top:0}.media-viewer-buttons .btn-icon{margin:0 .25rem;transition:var(--open-duration)}html.no-touch .media-viewer-buttons .btn-icon:active,html.no-touch .media-viewer-buttons .btn-icon:hover{color:#fff}@media only screen and (max-width:600px){.media-viewer-buttons{display:none}}.media-viewer-content{flex-direction:column;height:100%;justify-content:center}.media-viewer-container,.media-viewer-content{align-items:center;display:flex;max-height:100%;max-width:100%;overflow:hidden}.media-viewer-container{align-self:center;flex:1 1 auto;position:relative}.media-viewer-media{visibility:hidden}.media-viewer-caption{background-color:transparent;bottom:0;color:#fff;left:0;line-height:var(--line-height);opacity:0;overflow:hidden;padding:.5rem .5rem 0;position:absolute;right:0;text-align:center;text-overflow:ellipsis;white-space:pre-wrap;word-break:break-word;z-index:4}body.animation-level-2 .media-viewer-caption{transition:transform var(--layer-transition),opacity var(--open-duration) ease-in-out,background-color var(--open-duration) ease-in-out}.media-viewer-caption a{color:#60a5e9!important}.media-viewer-caption .scrollable{height:6rem;margin:0 auto;max-height:6rem;max-width:50rem;padding:.5rem .875rem;position:relative}html.no-touch .media-viewer-whole.active .media-viewer-caption{opacity:.4}html.no-touch .media-viewer-whole.active .media-viewer-caption:hover{opacity:1}html.is-touch .media-viewer-whole.active .media-viewer-caption{opacity:.6}@media only screen and (max-width:600px){.media-viewer-caption{bottom:1.0625rem;text-align:inherit;transform:translateZ(0);width:100%}.media-viewer-caption .scrollable{height:auto;padding:0 .5rem}.media-viewer-whole.has-video-controls .media-viewer-caption{transform:translate3d(0,-69px,0)}.media-viewer-whole.backwards .media-viewer-caption{visibility:hidden}html.no-touch .media-viewer-caption:active,html.no-touch .media-viewer-caption:hover{background-color:#000;opacity:1!important}}.media-viewer-caption.is-focused{background-color:#000;opacity:1!important}.media-viewer-switcher{cursor:pointer;height:calc(100% - 7.5rem);left:0;position:absolute;top:3.75rem;width:7rem}html.no-touch .media-viewer-switcher{height:calc(100% - 3.75rem)}html.no-touch .media-viewer-switcher:hover .tgico-down{opacity:1}@media only screen and (max-width:600px){.media-viewer-switcher{width:4rem}}.media-viewer-switcher-right{left:auto;right:0}.media-viewer-next-button,.media-viewer-prev-button{color:#fff;cursor:pointer;font-size:2rem;left:1rem;opacity:0;position:absolute;top:50%;transform:translateY(-50%) rotate(90deg);transition:var(--open-duration) opacity;z-index:5}@media only screen and (min-width:601px){.media-viewer-next-button,.media-viewer-prev-button{font-size:3rem;left:2rem}}.media-viewer-next-button{left:auto;right:1rem;transform:translateY(-50%) rotate(-90deg)}@media only screen and (min-width:601px){.media-viewer-next-button{right:2rem}}.media-viewer-mover{align-items:center;border-radius:0;display:flex;justify-content:center;left:0;min-height:auto!important;overflow:hidden;position:fixed!important;top:0;transform:translateZ(0) scaleX(1);transform-origin:top left}.media-viewer-mover:not(.center){-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}@media only screen and (max-width:600px){.media-viewer-mover{overflow:visible}}.media-viewer-mover .ckin__player{height:100%;left:0;position:absolute;top:0;width:100%}.media-viewer-mover>svg{height:100%;width:100%}.media-viewer-mover .canvas-thumbnail,.media-viewer-mover img,.media-viewer-mover video{height:100%;max-height:100%;max-width:100%;-o-object-fit:cover;object-fit:cover;opacity:1;position:absolute;transition:var(--open-duration) opacity;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.media-viewer-mover svg img,.media-viewer-mover svg video{position:static}.media-viewer-mover.active{transition:transform var(--open-duration),border-radius var(--open-duration),opacity var(--open-duration) calc(var(--open-duration)/8)}.media-viewer-mover.active.opening{transition:transform var(--open-duration),border-radius var(--open-duration),opacity var(--open-duration) 0s}.media-viewer-mover.moving{transition:transform var(--move-duration) ease}.media-viewer-mover.no-transition{transition:none!important}.media-viewer-mover.center{left:50%!important;max-height:calc(var(--vh, 1vh)*100 - 15rem);max-width:100vw;top:50%!important;transform:translate3d(-50%,-50%,0)!important}@media only screen and (max-width:600px){.media-viewer-mover.center{height:100%!important;max-height:calc(var(--vh, 1vh)*100 - 120px);max-width:100vw!important;width:100%!important}.media-viewer-mover.center .ckin__player:not(.ckin__fullscreen) .default__controls{bottom:-62px}}.media-viewer-mover.center .canvas-thumbnail,.media-viewer-mover.center img:not(.thumbnail),.media-viewer-mover.center video{-o-object-fit:contain;object-fit:contain}.media-viewer-mover.center img.thumbnail{-o-object-fit:contain;object-fit:contain;width:auto}.media-viewer-mover.hiding .canvas-thumbnail,.media-viewer-mover.hiding img,.media-viewer-mover.hiding video{opacity:0}.media-viewer-appear{opacity:0;visibility:hidden}body.animation-level-2 .media-viewer-appear{transition:opacity var(--open-duration) 0s,visibility 0s var(--open-duration)}.media-viewer-topbar{align-items:center;display:flex;height:3.5rem;justify-content:space-between;left:0;padding:0 1.25rem;position:absolute;right:0;top:0;z-index:5}.media-viewer-topbar .btn-icon,.media-viewer-topbar .media-viewer-author{color:#fff;opacity:.4}body.animation-level-2 .media-viewer-topbar .btn-icon,body.animation-level-2 .media-viewer-topbar .media-viewer-author{transition:opacity var(--open-duration) ease-in-out,color var(--open-duration) ease-in-out,background-color var(--open-duration) ease-in-out}html.no-touch .media-viewer-topbar .btn-icon:active,html.no-touch .media-viewer-topbar .btn-icon:hover,html.no-touch .media-viewer-topbar .media-viewer-author:active,html.no-touch .media-viewer-topbar .media-viewer-author:hover{opacity:1}.media-viewer-topbar-left{align-items:center;display:flex}@media only screen and (max-width:600px){.media-viewer-topbar{padding:0 .5rem}}.media-viewer-aspecter{align-items:center;border-radius:0;display:flex;height:100%;justify-content:center;position:absolute;transform:scaleX(1);width:100%}.media-viewer-mover.active .media-viewer-aspecter{transition:width var(--open-duration),height var(--open-duration),transform var(--open-duration),border-radius var(--open-duration)}.media-viewer-whole{--open-duration:.2s;--move-duration:.35s;display:block;height:100%;left:0;position:fixed!important;top:0;transition:visibility 0s var(--open-duration);visibility:hidden;width:100%;z-index:4}body.animation-level-0 .media-viewer-whole{--open-duration:0s;--move-duration:0s}.media-viewer-whole.active{transition-delay:0s;visibility:visible}.media-viewer-whole.active .media-viewer-appear,.media-viewer-whole.active .overlays{opacity:1;visibility:visible}body.animation-level-2 .media-viewer-whole.active .media-viewer-appear,body.animation-level-2 .media-viewer-whole.active .overlays{transition:opacity var(--open-duration) 0s,visibility 0s 0s}.media-viewer-whole.active .media-viewer-caption{visibility:visible}@media only screen and (max-width:600px){.media-viewer-whole .btn-menu-toggle:not(.playback-rate){color:hsla(0,0%,100%,.4);opacity:1}.media-viewer-whole .btn-menu-toggle:not(.playback-rate).menu-open{background-color:hsla(207,4%,46%,.2)!important;color:#fff}.media-viewer-whole.hide-caption .media-viewer-caption{opacity:0!important;pointer-events:none}}.media-viewer-whole.is-zooming .media-viewer-caption,.media-viewer-whole.is-zooming .media-viewer-switcher .tgico-down{opacity:0!important;pointer-events:none}.media-viewer-whole.highlight-switchers .media-viewer-switcher>span{opacity:1}.media-viewer-whole.no-forwards .canvas-thumbnail,.media-viewer-whole.no-forwards img{pointer-events:none}.media-viewer-whole.no-forwards .media-viewer-caption{-webkit-user-select:none;-moz-user-select:none;user-select:none}.media-viewer-movers{bottom:0;left:0;position:absolute;right:0;top:0;transform:translate3d(1,1,0) scale(1);transform-origin:0 0;will-change:transform;z-index:4}body.animation-level-2 .media-viewer-movers{transition:transform var(--open-duration)}.tgico-zoom:before{content:\"\"}.tgico-zoom.zoom-in:before{content:\"\"}.zoom-container{align-items:center;background-color:rgba(0,0,0,.4);border-radius:12px;bottom:1.25rem;display:flex;height:3.375rem;justify-content:space-between;left:50%;opacity:1;padding:.5rem;position:absolute;transform:translateX(-50%);width:17.125rem;z-index:5}body.animation-level-2 .zoom-container{transition:opacity var(--open-duration)}.zoom-container .btn-icon{color:#fff}.zoom-container .btn-icon.inactive{opacity:.4;pointer-events:none}.zoom-container .progress-line{--color:#fff;--height:2px;flex:1 1 auto;margin:0 1px}.zoom-container .progress-line:before{opacity:1}.media-viewer-whole:not(.active) .zoom-container,.zoom-container:not(.is-visible){opacity:0;pointer-events:none}.zoom-container.is-visible{opacity:1}.zoom-container.is-visible~.media-viewer-caption{opacity:0!important;pointer-events:none}.zoom-container.is-visible~.media-viewer-movers .default__button--big{opacity:0!important}.overlays{background-color:rgba(0,0,0,.2);height:100%;left:0;opacity:0;position:fixed!important;top:0;transition:opacity var(--open-duration) 0s,visibility 0s var(--open-duration);visibility:hidden;width:100%;z-index:4}.emoji-dropdown{background:var(--surface-color);display:flex;flex:1 1 auto;flex-direction:column;height:min(282px,calc(var(--vh)*100 - 135px));max-height:100%;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--esg-width)}@media only screen and (min-height:570px)and (min-width:601px){.emoji-dropdown{-webkit-backdrop-filter:var(--menu-backdrop-filter);backdrop-filter:var(--menu-backdrop-filter);background-color:var(--menu-background-color);border-radius:1.25rem;bottom:5.125rem;box-shadow:0 5px 10px 5px rgba(16,35,47,.14);height:26.25rem;left:.8125rem;max-height:26.25rem;opacity:0;position:absolute!important;transform:scale(0);transform-origin:0 100%;transition:transform var(--esg-transition),opacity var(--esg-transition);z-index:3}.emoji-dropdown.active{opacity:1;transform:scale(1)}body.animation-level-0 .emoji-dropdown{transition:none}}.emoji-dropdown .emoji-container{height:100%;max-width:100%;overflow:hidden;width:100%}.emoji-dropdown .emoji-tabs{border:none;border-top:1px solid var(--border-color);justify-content:center}.emoji-dropdown .emoji-tabs:after{content:none}.emoji-dropdown .emoji-tabs-search{left:0;margin-left:.5rem!important;position:absolute}.emoji-dropdown .emoji-tabs-delete{margin-right:.5rem!important;position:absolute;right:0}.emoji-dropdown .emoji-tabs .menu-horizontal-div-item{margin:0 .75rem}.emoji-dropdown .tabs-container{height:100%}.emoji-dropdown .stickers-padding .category-items{gap:.25rem;padding:0 .1875rem}.emoji-dropdown #content-gifs .scrollable-y{padding:0 .1875rem}.emoji-dropdown .gifs-masonry{border-radius:10px;overflow:hidden}.emoticons-container{background-color:transparent;flex-direction:column;height:100%;min-height:100%}.emoticons-menu{--item-size:1.875rem;align-items:center;min-height:3.0625rem;padding:0 .3125rem;width:100%;z-index:4}.emoticons-menu,.emoticons-menu-wrapper{background-color:transparent;height:3.0625rem}.emoticons-menu-wrapper{border-bottom:1px solid var(--border-color);max-width:100%;padding:0;position:relative}.emoticons-menu:after{content:\" \";display:block;flex:0 0 auto;height:1px;width:.1875rem}.emoticons-menu .menu-horizontal-div-item{align-items:center;display:flex;flex:0 0 auto;font-size:1.5rem;height:var(--item-size);line-height:var(--item-size);margin:0 .3125rem;padding:0;width:var(--item-size)}.emoticons-menu .menu-horizontal-div-item.not-local{--item-size:2.375rem;border-radius:.25rem!important;padding:.25rem}.emoticons-menu .menu-horizontal-div-item.active{background-color:rgba(var(--primary-text-color-rgb),.06)!important}.emoticons-menu .menu-horizontal-div-item.active,html.no-touch .emoticons-menu .menu-horizontal-div-item:active,html.no-touch .emoticons-menu .menu-horizontal-div-item:hover{color:rgba(var(--primary-text-color-rgb),.8)!important}.emoticons-menu .menu-horizontal-div-item-padding{height:100%;position:relative;width:100%}.emoticons-menu .menu-horizontal-div-item.active:not(.tgico){background-color:var(--light-secondary-text-color)}.emoticons-menu .menu-horizontal-inner{border-radius:15px;flex:0 0 auto;margin:0 .3125rem;overflow:hidden;width:1.875rem}html.is-safari .emoticons-menu .menu-horizontal-inner{-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}body.animation-level-2 .emoticons-menu .menu-horizontal-inner{transition:width .2s ease-in-out}.emoticons-menu .menu-horizontal-inner-scroll{align-items:center;display:flex;height:100%;position:relative;width:8.5rem}.emoticons-menu .menu-horizontal-inner .menu-horizontal-div-item{margin:0!important;transform:scale(1)}body.animation-level-2 .emoticons-menu .menu-horizontal-inner .menu-horizontal-div-item{transition:transform .2s ease-in-out!important}.emoticons-menu .menu-horizontal-inner.active{background-color:rgba(var(--primary-text-color-rgb),.06)!important;width:8.5rem}.emoticons-menu .menu-horizontal-inner.active .menu-horizontal-div-item{transform:scale(.8)}.emoticons-menu .menu-horizontal-inner.active .menu-horizontal-div-item.active{background-color:transparent!important}.emoticons-menu .menu-horizontal-inner:not(.active){cursor:pointer}.emoticons-menu .menu-horizontal-inner:not(.active) .menu-horizontal-inner-scroll{pointer-events:none}.emoticons-menu .menu-horizontal-inner:not(.active) .menu-horizontal-div-item:first-child{pointer-events:all}.emoticons-content{flex:1;padding:0;position:relative}.emoticons-content .emoji-category{position:relative}.emoticons-content .sticky_sentinel--top{height:1px;top:0}.emoticons-content .category-title{color:rgba(var(--primary-text-color-rgb),.42);cursor:pointer;font-size:var(--font-size-16);font-weight:var(--font-weight-bold);line-height:1.1875rem;padding:.75rem .875rem .375rem;position:relative;text-align:center;width:100%}.emoticons-content .category-title .btn-icon{font-size:1.25rem;pointer-events:all;position:absolute;right:.5rem;top:50%;transform:translateY(-50%);z-index:1}.emoticons-content:not(.has-premium) .is-premium-set .category-title:before{content:\"\";line-height:inherit;margin-right:.125rem;vertical-align:middle}.emoji-padding .super-emojis{padding:0 .5rem}html:not(.is-safari):not(.is-ios) .scrollable::-webkit-scrollbar{height:0;opacity:0;width:0;width:.375rem}html:not(.is-safari):not(.is-ios) .scrollable::-webkit-scrollbar-thumb{height:0;width:0}html:not(.is-safari):not(.is-ios) ::-webkit-scrollbar-thumb{opacity:0;-webkit-transition:.2s ease-in-out;transition:.2s ease-in-out}html:not(.is-safari):not(.is-ios) ::-webkit-scrollbar-button{display:none;height:0;width:0}html:not(.is-safari):not(.is-ios) ::-webkit-scrollbar-corner{background-color:transparent}html:not(.is-safari):not(.is-ios) .scrollable:hover{scrollbar-color:var(--scrollbar-color) transparent}html:not(.is-safari):not(.is-ios) .scrollable:hover::-webkit-scrollbar{opacity:1}html:not(.is-safari):not(.is-ios) .scrollable:hover::-webkit-scrollbar-thumb{-webkit-backdrop-filter:blur(100);backdrop-filter:blur(100);background-color:var(--scrollbar-color);border-radius:10px;max-height:12.5rem;min-height:5rem;opacity:1}.no-scrollbar::-webkit-scrollbar,.scrollable-x::-webkit-scrollbar{display:none}.scrollable{-webkit-overflow-scrolling:touch;bottom:0;height:100%;left:0;max-height:100%;overflow-x:hidden;overflow-y:hidden;position:absolute;right:0;top:0;width:100%}.scrollable.scrollable-x{-ms-overflow-style:none;overflow-x:auto;scrollbar-width:none}.scrollable.scrollable-y{-ms-overflow-style:none;overflow-y:auto;overflow-y:overlay;scrollbar-color:transparent transparent;scrollbar-width:thin;transform:translateZ(0)}.scrollable.scrollable-y.scrollable-y-bordered{border-bottom:1px solid transparent;border-top:1px solid transparent}body.animation-level-2 .scrollable.scrollable-y.scrollable-y-bordered{transition:border-top-color var(--transition-standard-in),border-bottom-color var(--transition-standard-in)}.scrollable.scrollable-y.scrollable-y-bordered:not(.scrolled-top){border-top-color:var(--border-color)}.scrollable.scrollable-y.scrollable-y-bordered:not(.scrolled-bottom){border-bottom-color:var(--border-color)}.scrollable-padding{height:100%;min-width:100%}@keyframes scaleIn{0%{transform:scale(.2)}to{transform:scale(1)}}.selector{display:flex;flex-direction:column;height:100%;width:100%}.selector .selector-search-section{margin-bottom:0!important;padding:0!important;position:relative;z-index:1}.selector-search-container{flex:0 0 auto;max-height:132px;overflow:hidden;position:relative}.selector-search-container .scrollable{max-height:inherit;position:relative}.selector-search{display:flex;flex-flow:wrap;padding-left:1rem;padding-right:1rem;position:relative}.selector-search-input{border:none;flex:1 1 auto;outline:none}.selector-search .selector-search-input{padding:7px 0 19px}[dir=ltr] .selector-user{padding-right:17px}[dir=rtl] .selector-user{padding-left:17px}[dir=ltr] .selector-user{margin-left:-.25rem;margin-right:.75rem}[dir=rtl] .selector-user{margin-left:.75rem;margin-right:-.25rem}.selector-user{background-color:var(--light-secondary-text-color);border-radius:1.5rem;color:var(--primary-text-color);flex:0 0 auto;font-size:1rem;height:2rem;line-height:2rem;margin-bottom:7px;max-width:11.25rem;overflow:hidden;text-overflow:ellipsis;transition:opacity .2s,transform .2s,background-color .2s;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}body.animation-level-0 .selector-user{transition:none}html.no-touch .selector-user:active,html.no-touch .selector-user:hover{background-color:var(--light-danger-color);cursor:pointer}html.no-touch .selector-user:active .selector-user-avatar:after,html.no-touch .selector-user:hover .selector-user-avatar:after{opacity:1;transform:scaleX(-1) rotate(-90deg)}body:not(.animation-level-0) .selector-user.scale-in{animation:scaleIn .15s ease forwards}body:not(.animation-level-0) .selector-user.scale-out{animation:scaleIn .1s ease forwards;animation-direction:reverse}[dir=ltr] .selector-user-avatar{margin-right:8px}[dir=rtl] .selector-user-avatar{margin-left:8px}.selector-user-avatar{border-radius:50%!important;float:left;overflow:hidden;position:relative}.is-rtl .selector-user-avatar{float:right}html.is-safari .selector-user-avatar{-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}[dir=ltr] .selector-user-avatar:after{left:0}[dir=rtl] .selector-user-avatar:after{right:0}.selector-user-avatar:after{background-color:var(--danger-color);content:\"\";font-size:23px;height:100%;line-height:32px!important;opacity:0;position:absolute;top:0;transform:scaleX(-1) rotate(0deg);transition:opacity .2s,transform .2s;width:100%;z-index:2}body.animation-level-0 .selector-user-avatar:after{transition:none}.selector .chatlist-container{flex:1 1 auto;height:100%}.selector>hr{margin:0;padding:0}[dir=ltr] .selector .checkbox{padding-left:11px}[dir=rtl] .selector .checkbox{padding-right:11px}.selector .checkbox{margin-top:11px}.selector .checkbox-field{--offset-left:0!important;margin:0!important;padding:0!important;pointer-events:none;position:absolute!important;top:50%;transform:translateY(-50%);z-index:1}[dir=ltr] .selector .checkbox-field:first-child{margin-left:.6875rem;margin-right:1.6875rem}[dir=rtl] .selector .checkbox-field:first-child{margin-left:1.6875rem;margin-right:.6875rem}[dir=ltr] .selector .checkbox-field-round{right:1.125rem}[dir=rtl] .selector .checkbox-field-round{left:1.125rem}.selector .checkbox-field-round{--size:1.25rem}.selector .checkbox-field-round .checkbox-box-border{z-index:auto}.selector .checkbox-field-round .checkbox-box-check{--offset:6px}[dir=ltr] .selector-square .checkbox-field{left:1.25rem!important}[dir=rtl] .selector-square .checkbox-field{right:1.25rem!important}[dir=ltr] .selector-square .chatlist-chat.row-with-padding{padding-left:7.5rem!important}[dir=rtl] .selector-square .chatlist-chat.row-with-padding{padding-right:7.5rem!important}[dir=ltr] .selector-square .dialog-avatar{margin-left:3rem!important}[dir=rtl] .selector-square .dialog-avatar{margin-right:3rem!important}.gifs-masonry{grid-gap:.125rem;display:grid;gap:.125rem;grid-auto-rows:1fr;grid-template-columns:repeat(3,1fr)}.gifs-masonry .gif img,.gifs-masonry .gif video{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.gifs-masonry .gif img{left:0;position:absolute;top:0}.gifs-masonry .preloader-container{z-index:2}.preloader-circular{animation:rotate 1s linear infinite;bottom:0;height:100%;left:0;margin:auto;position:absolute;right:0;top:0;transform-origin:center center}.preloader-path{stroke-dasharray:93.6375,124.85;stroke-dashoffset:0;stroke-linecap:round;stroke:#fff;stroke-width:3}.preloader-container{bottom:0;cursor:pointer;display:flex;height:54px;left:0;margin:auto;opacity:0;overflow:hidden;position:absolute;right:0;top:0;transform:scale(0);width:54px}body:not(.animation-level-0) .preloader-container{transition:opacity .2s ease-in-out,transform .2s ease-in-out}.preloader-container.is-visible:not(.backwards){opacity:1;transform:scale(1)}.preloader-container{--color:#fff}.preloader-container .you-spin-me-round{height:100%;width:100%}.preloader-container .preloader-circular{animation:none;background-color:rgba(0,0,0,.3);border-radius:50%;height:100%;width:100%}.preloader-container .preloader-path-new{stroke-dasharray:5,149.82;stroke-dashoffset:0;stroke-linecap:round;stroke:var(--color);stroke-width:2}body.animation-level-2 .preloader-container.is-visible.animating .you-spin-me-round,body.animation-level-2 .preloader-container.is-visible:not(.manual) .you-spin-me-round{animation:rotate 2s linear infinite}body.animation-level-2 .preloader-container.is-visible.animating .preloader-path-new,body.animation-level-2 .preloader-container.is-visible:not(.manual) .preloader-path-new{transition:stroke-dasharray .2s ease-in-out,stroke-width .2s ease-in-out}.preloader-container.preloader-swing{cursor:default}.preloader-container.preloader-swing .you-spin-me-round{animation:rotate 1s linear infinite!important}.preloader-container.preloader-swing .preloader-path-new{stroke-dasharray:112.36,149.82}.preloader-container.preloader-swing.preloader-streamable .preloader-path-new{stroke-dasharray:88.95,118.61}.preloader-container .preloader-close,.preloader-container .preloader-download{bottom:0;color:var(--color);height:56%;left:0;margin:auto;opacity:1;position:absolute;right:0;top:0;width:56%}body.animation-level-2 .preloader-container .preloader-close,body.animation-level-2 .preloader-container .preloader-download{transition:opacity .2s ease-in-out}.preloader-container .preloader-close path,.preloader-container .preloader-download path{fill:var(--color)}html.no-touch .preloader-container .preloader-close:active,html.no-touch .preloader-container .preloader-close:hover,html.no-touch .preloader-container .preloader-download:active,html.no-touch .preloader-container .preloader-download:hover{background:none}.preloader-container.manual .preloader-close,.preloader-container:not(.manual) .preloader-download{opacity:0}.preloader-container.manual .preloader-path-new{stroke-width:0}.preloader-container .preloader-download{height:1.5rem;width:1.5rem}.preloader-container.preloader-streamable,.preloader-container.preloader-streamable svg{cursor:pointer!important}.preloader-container.preloader-streamable circle{stroke-width:2.5!important}.preloader-container.preloader-streamable:after{background-color:var(--color);border-radius:.125rem;content:\"\";height:.8125rem;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:.8125rem}.preloader-container.preloader-transparent .preloader-circular{background-color:transparent}.preloader-container.preloader-bold .preloader-path-new{stroke-width:3.5}@keyframes rotate{to{transform:rotate(1turn)}}@keyframes dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes dashNew{0%{stroke-dasharray:1,149.82;stroke-dashoffset:0}50%{stroke-dasharray:112.36,149.82;stroke-dashoffset:-38}to{stroke-dasharray:112.36,149.82;stroke-dashoffset:-149.82}}@keyframes dashNewStreamable{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-237%}}.rp{position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.btn-corner.rp .c-ripple,.btn-menu-toggle.rp .c-ripple,.menu-horizontal-div-item.rp .c-ripple,.pinned-container-wrapper.rp .c-ripple,.rp-overflow .c-ripple{border-radius:inherit;height:100%;overflow:hidden;width:100%}.btn-corner.rp .c-ripple__circle,.btn-menu-toggle.rp .c-ripple__circle,.menu-horizontal-div-item.rp .c-ripple__circle,.pinned-container-wrapper.rp .c-ripple__circle,.rp-overflow .c-ripple__circle{overflow:hidden}.c-ripple{--ripple-duration:.7s;bottom:0;left:0;position:absolute;right:0;top:0}html.is-safari .c-ripple:not(:empty){border-radius:inherit;-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}.c-ripple__circle{animation:ripple-effect .7s forwards;background-color:var(--ripple-color);border-radius:50%;display:block;pointer-events:none;position:absolute;transform:scale(0);transition:opacity .35s,background-color .35s}.c-ripple__circle.hiding,.c-ripple__square.hiding{opacity:0}@media only screen and (max-width:925px){.c-ripple{--ripple-duration:.4s}.c-ripple__circle{animation-duration:.4s;animation-name:ripple-effect-handhelds;transition-duration:.3s}}@keyframes ripple-effect{0%{transform:scale(0)}to{transform:scale(2)}}@keyframes ripple-effect-handhelds{0%{transform:scale(.27)}to{transform:scale(2)}}.avatar-like{--size:54px;--multiplier:1;color:#fff;font-size:calc(1.25rem/var(--multiplier));font-weight:var(--font-weight-bold);height:var(--size);line-height:var(--size)!important;text-align:center;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--size)}avatar-element{--color-top:var(--avatar-color-top);--color-bottom:var(--avatar-color-bottom);background:linear-gradient(var(--color-top),var(--color-bottom));border-radius:50%}avatar-element[data-color=red]{--color-top:var(--peer-avatar-red-top);--color-bottom:var(--peer-avatar-red-bottom)}avatar-element[data-color=orange]{--color-top:var(--peer-avatar-orange-top);--color-bottom:var(--peer-avatar-orange-bottom)}avatar-element[data-color=violet]{--color-top:var(--peer-avatar-violet-top);--color-bottom:var(--peer-avatar-violet-bottom)}avatar-element[data-color=green]{--color-top:var(--peer-avatar-green-top);--color-bottom:var(--peer-avatar-green-bottom)}avatar-element[data-color=cyan]{--color-top:var(--peer-avatar-cyan-top);--color-bottom:var(--peer-avatar-cyan-bottom)}avatar-element[data-color=pink]{--color-top:var(--peer-avatar-pink-top);--color-bottom:var(--peer-avatar-pink-bottom)}avatar-element[data-color=blue]{--color-top:var(--peer-avatar-blue-top);--color-bottom:var(--peer-avatar-blue-bottom)}avatar-element.tgico:before{font-size:calc(32px/var(--multiplier))}avatar-element.tgico-calendarfilter:before{font-size:calc(36px/var(--multiplier))}avatar-element.tgico-saved:before{font-size:calc(30px/var(--multiplier))!important}avatar-element.tgico-reply_filled:before{font-size:calc(28px/var(--multiplier))!important}avatar-element.tgico-deletedaccount{--color-top:var(--peer-avatar-archive-top);--color-bottom:var(--peer-avatar-archive-bottom);overflow:hidden}avatar-element.tgico-deletedaccount:before{font-size:calc(30px/var(--multiplier))}avatar-element:before{line-height:inherit!important}avatar-element.media-container{position:relative}avatar-element img{border-radius:inherit!important;display:block;height:var(--size)!important;width:var(--size)!important}avatar-element img.fade-in{animation:fade-in-opacity .2s ease forwards}avatar-element img.emoji{height:calc(1.125rem/var(--multiplier))!important;vertical-align:middle!important;width:calc(1.125rem/var(--multiplier))!important}avatar-element.is-forum{border-radius:var(--avatar-border-radius-forum)}avatar-element.is-topic{background:none;border-radius:0;position:relative}avatar-element.is-topic .topic-icon{--size:inherit}avatar-element.is-online{position:relative}avatar-element.is-online:after{background-color:var(--avatar-online-color);border:2px solid var(--surface-color);border-radius:50%;content:\" \";display:block;height:14px;left:2.4375rem;position:absolute;top:2.4375rem;width:14px}avatar-element[clickable]{cursor:pointer}avatar-element.avatar-relative{position:relative}avatar-element.avatar-120{--size:120px;--multiplier:.45}avatar-element.avatar-100{--size:100px;--multiplier:.54}avatar-element.avatar-48{--size:48px;--multiplier:1.125}avatar-element.avatar-46{--size:46px;--multiplier:1.173913}avatar-element.avatar-44{--size:44px;--multiplier:1.227272}avatar-element.avatar-42{--size:42px;--multiplier:1.285714}avatar-element.avatar-40{--size:40px;--multiplier:1.35}avatar-element.avatar-36{--size:36px;--multiplier:1.5}avatar-element.avatar-35{--size:35px;--multiplier:1.542857}avatar-element.avatar-34{--size:34px;--multiplier:1.588235}avatar-element.avatar-32{--size:32px;--multiplier:1.6875}avatar-element.avatar-30{--size:30px;--multiplier:1.6875}avatar-element.avatar-26{--size:26px;--multiplier:2.076923}avatar-element.avatar-24{--size:24px;--multiplier:2.25}avatar-element.avatar-22{--size:22px;--multiplier:2.454545}avatar-element.avatar-18{--size:18px;--multiplier:3}avatar-element.avatar-16{--size:16px;--multiplier:3.375}.avatar-relative .avatar-photo{left:0;position:absolute;top:0}.avatar-full{align-items:center;border-radius:inherit;display:inline-flex;height:100%;justify-content:center;position:absolute;width:100%}.avatar-full .avatar-photo{height:100%!important;-o-object-fit:cover;object-fit:cover;width:100%!important}.document{--background-color:var(--primary-color);height:70px}.document .media-photo{border-radius:inherit}.document .media-photo.thumbnail{left:0}.document-ico{background-color:var(--background-color);border-radius:.375rem;line-height:1;text-align:center}html.is-safari .document-ico{-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}.document-ico-text{opacity:0}body.animation-level-2 .document-ico-text{transition:opacity .2s ease-in-out}.document:not(.document-with-thumb) .document-ico{padding:1.5625rem .25rem 0}@media only screen and (max-width:600px){.document:not(.document-with-thumb) .document-ico{font-size:14px;padding:1.5rem 0 0}.document:not(.document-with-thumb) .document-ico:after{--size:.875rem}}.document-ico:after{--size:1.125rem;border-bottom-color:rgba(0,0,0,.25);border-bottom-left-radius:.25rem;border-left-color:rgba(0,0,0,.25);border-right-color:var(--message-background-color);border-style:solid;border-top-color:var(--message-background-color);border-width:calc(var(--size)/2);content:\"\";display:block;position:absolute;right:0;top:0}body.animation-level-2 .document-ico:after{transition:border-width .2s ease-in-out}html.no-touch .document:not(.downloaded):active .document-ico:after,html.no-touch .document:not(.downloaded):hover .document-ico:after{border-width:0}html.no-touch .document:not(.downloaded):active .document-ico-text,html.no-touch .document:not(.downloaded):hover .document-ico-text{opacity:0}html.no-touch .document:not(.downloaded):active .preloader-container,html.no-touch .document:not(.downloaded):hover .preloader-container{opacity:1!important}.document:not(.downloading) .document-ico-text{opacity:1}.document:not(.downloading) .preloader-container{opacity:0!important}.document.downloading .document-ico:after{border-width:0}.document-ico{background-size:contain;font-size:1.125rem}.document-ico,.document-name,.document-size{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.document.ext-zip{--background-color:#fb8c00}.document.ext-pdf{--background-color:#df3f40}.document.ext-apk{--background-color:#43a047}.document.document-with-thumb{--background-color:#fff}.document.document-with-thumb .document-ico:after{display:none}.document.document-with-thumb .document-download{background-color:rgba(0,0,0,.2);border-radius:.375rem}.document.document-with-thumb .preloader-circular{transition:background-color .2s}.document.document-with-thumb .preloader-container:not(.manual) .preloader-circular{background-color:rgba(0,0,0,.3)!important}.document-thumb{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.document-name{font-size:var(--font-size-16);font-weight:var(--font-weight-bold);line-height:var(--line-height-16);white-space:nowrap}.document-size{color:var(--secondary-text-color);font-size:var(--font-size-14);line-height:var(--line-height-14);pointer-events:none;position:relative}.document .preloader-container{height:2.5rem;width:2.5rem}@media only screen and (max-width:600px){.document .preloader-container{height:1.625rem;width:1.625rem}}.document .preloader-circular{background-color:transparent!important}.document .preloader-path-new{stroke-width:2.5}[dir=ltr] .audio,[dir=ltr] .document{padding-left:var(--padding-left)}[dir=rtl] .audio,[dir=rtl] .document{padding-right:var(--padding-left)}.audio,.document{--padding:0px;--icon-size:3.375rem;--icon-margin:.875rem;--padding-left:calc(var(--icon-size) + var(--icon-margin) + var(--padding));cursor:pointer;display:flex;flex-direction:column;justify-content:center;padding:var(--padding);-webkit-user-select:none;-moz-user-select:none;user-select:none}[dir=ltr] .audio-download,[dir=ltr] .audio-ico,[dir=ltr] .document-download,[dir=ltr] .document-ico{margin-left:calc((var(--padding-left) - var(--padding))*-1)}[dir=rtl] .audio-download,[dir=rtl] .audio-ico,[dir=rtl] .document-download,[dir=rtl] .document-ico{margin-right:calc((var(--padding-left) - var(--padding))*-1)}.audio-download,.audio-ico,.document-download,.document-ico{color:#fff;height:var(--icon-size);position:absolute;width:var(--icon-size)}.audio-download,.document-download{align-items:center;cursor:pointer;display:flex;font-size:1.5rem;justify-content:center;opacity:1;transition:opacity .2s ease-in-out;z-index:1}.audio-download.downloaded,.document-download.downloaded{opacity:0}.audio-description,.document-description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.audio:not(.corner-download) .preloader-container:not(.preloader-streamable),.document:not(.corner-download) .preloader-container:not(.preloader-streamable){transform:scale(1)!important}.audio .checkbox-field-round,.document .checkbox-field-round{--margin-top:.25rem;--margin-left:.125rem;left:auto;margin-left:calc(var(--padding-left)*-1 + var(--icon-size) - var(--size) + var(--margin-left));margin-top:calc(var(--icon-size) - var(--size) + var(--margin-top));top:auto}.audio-ico{display:flex;justify-content:center}.audio-ico.tgico-largeplay:before{margin-right:-1px}.audio .preloader-circular{background-color:transparent!important}.audio .preloader-container:not(.preloader-streamable){height:100%;width:100%}.audio{--icon-size:3rem;--icon-margin:.5625rem;height:var(--icon-size);overflow:visible!important}.audio-download,.audio-toggle{align-items:center;background-color:var(--primary-color);border-radius:50%}.audio.corner-download .audio-download{background:none;display:flex!important;height:1.375rem;left:57.5%;margin:0!important;top:57.5%;width:1.375rem}.audio.corner-download .preloader-container{background-color:var(--primary-color);border-radius:inherit}.audio.corner-download .preloader-path-new{stroke-width:.25rem}.audio-play-icon{border-radius:inherit;bottom:0;left:0;max-height:100%;max-width:100%;overflow:hidden;position:absolute;right:0;top:0;transform:rotate(-119deg)}body.animation-level-2 .audio-play-icon{transition:transform .25s ease-in-out}.audio-toggle .part{background-color:#fff;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}body.animation-level-2 .audio-toggle .part{transition:-webkit-clip-path .25s ease-in-out;transition:clip-path .25s ease-in-out;transition:clip-path .25s ease-in-out,-webkit-clip-path .25s ease-in-out}@media only screen and (min-width:601px){.audio-toggle .part{height:140px;width:140px}}@media only screen and (max-width:600px){.audio-toggle .part{height:92px;width:92px}}.audio-toggle .part.one{-webkit-clip-path:polygon(56.42249% 57.01763%,54.93283% 57.0175%,53.00511% 57.01738%,50.83554% 57.01727%,48.62036% 57.01718%,46.55585% 57.01709%,44.83822% 57.01702%,43.66373% 57.01698%,43.22863% 57.01696%,42.86372% 57.01904%,42.56988% 57.01621%,42.3402% 56.99486%,42.16778% 56.94152%,42.0457% 56.84267%,41.96705% 56.68478%,41.92493% 56.45432%,41.91246% 56.13777%,41.91258% 55.76282%,41.9129% 55.37058%,41.91335% 54.96757%,41.91387% 54.56032%,41.91439% 54.15537%,41.91485% 53.75926%,41.91517% 53.3785%,41.91529% 53.01965%,41.94275% 52.72355%,42.02117% 52.51653%,42.14465% 52.38328%,42.30727% 52.30854%,42.50308% 52.27699%,42.72619% 52.27341%,42.97065% 52.28248%,43.23056% 52.2889%,43.94949% 52.28896%,45.45083% 52.28912%,47.47445% 52.28932%,49.76027% 52.28957%,52.04818% 52.28981%,54.07805% 52.29003%,55.5898% 52.29019%,56.32332% 52.29024%,56.58221% 52.28816%,56.83726% 52.28948%,57.07897% 52.30593%,57.29794% 52.34898%,57.48468% 52.43029%,57.62978% 52.56146%,57.72375% 52.7541%,57.75718% 53.01981%,57.75713% 53.37763%,57.75699% 53.81831%,57.75679% 54.31106%,57.75657% 54.82507%,57.75635% 55.32958%,57.75615% 55.79377%,57.75601% 56.18684%,57.75596% 56.47801%,57.7549% 56.50122%,57.74034% 56.5624%,57.6955% 56.64887%,57.60334% 56.748%,57.44691% 56.84712%,57.20925% 56.93358%,56.87342% 56.99471%);clip-path:polygon(56.42249% 57.01763%,54.93283% 57.0175%,53.00511% 57.01738%,50.83554% 57.01727%,48.62036% 57.01718%,46.55585% 57.01709%,44.83822% 57.01702%,43.66373% 57.01698%,43.22863% 57.01696%,42.86372% 57.01904%,42.56988% 57.01621%,42.3402% 56.99486%,42.16778% 56.94152%,42.0457% 56.84267%,41.96705% 56.68478%,41.92493% 56.45432%,41.91246% 56.13777%,41.91258% 55.76282%,41.9129% 55.37058%,41.91335% 54.96757%,41.91387% 54.56032%,41.91439% 54.15537%,41.91485% 53.75926%,41.91517% 53.3785%,41.91529% 53.01965%,41.94275% 52.72355%,42.02117% 52.51653%,42.14465% 52.38328%,42.30727% 52.30854%,42.50308% 52.27699%,42.72619% 52.27341%,42.97065% 52.28248%,43.23056% 52.2889%,43.94949% 52.28896%,45.45083% 52.28912%,47.47445% 52.28932%,49.76027% 52.28957%,52.04818% 52.28981%,54.07805% 52.29003%,55.5898% 52.29019%,56.32332% 52.29024%,56.58221% 52.28816%,56.83726% 52.28948%,57.07897% 52.30593%,57.29794% 52.34898%,57.48468% 52.43029%,57.62978% 52.56146%,57.72375% 52.7541%,57.75718% 53.01981%,57.75713% 53.37763%,57.75699% 53.81831%,57.75679% 54.31106%,57.75657% 54.82507%,57.75635% 55.32958%,57.75615% 55.79377%,57.75601% 56.18684%,57.75596% 56.47801%,57.7549% 56.50122%,57.74034% 56.5624%,57.6955% 56.64887%,57.60334% 56.748%,57.44691% 56.84712%,57.20925% 56.93358%,56.87342% 56.99471%)}.audio-toggle .part.two{-webkit-clip-path:polygon(56.42249% 42.44625%,54.93283% 42.44637%,53.00511% 42.44649%,50.83554% 42.4466%,48.62036% 42.4467%,46.55585% 42.44679%,44.83822% 42.44685%,43.66373% 42.4469%,43.22863% 42.44691%,42.86372% 42.44483%,42.56988% 42.44767%,42.3402% 42.46902%,42.16778% 42.52235%,42.0457% 42.6212%,41.96705% 42.77909%,41.92493% 43.00956%,41.91246% 43.32611%,41.91258% 43.70105%,41.9129% 44.0933%,41.91335% 44.49631%,41.91387% 44.90355%,41.91439% 45.3085%,41.91485% 45.70462%,41.91517% 46.08537%,41.91529% 46.44422%,41.94275% 46.74032%,42.02117% 46.94735%,42.14465% 47.0806%,42.30727% 47.15534%,42.50308% 47.18688%,42.72619% 47.19047%,42.97065% 47.1814%,43.23056% 47.17497%,43.94949% 47.17491%,45.45083% 47.17476%,47.47445% 47.17455%,49.76027% 47.1743%,52.04818% 47.17406%,54.07805% 47.17384%,55.5898% 47.17369%,56.32332% 47.17363%,56.58221% 47.17571%,56.83726% 47.17439%,57.07897% 47.15795%,57.29794% 47.1149%,57.48468% 47.03359%,57.62978% 46.90242%,57.72375% 46.70977%,57.75718% 46.44406%,57.75713% 46.08625%,57.75699% 45.64557%,57.75679% 45.15282%,57.75657% 44.6388%,57.75635% 44.1343%,57.75615% 43.6701%,57.75601% 43.27703%,57.75596% 42.98586%,57.7549% 42.96265%,57.74034% 42.90148%,57.6955% 42.815%,57.60334% 42.71587%,57.44691% 42.61675%,57.20925% 42.53029%,56.87342% 42.46916%);clip-path:polygon(56.42249% 42.44625%,54.93283% 42.44637%,53.00511% 42.44649%,50.83554% 42.4466%,48.62036% 42.4467%,46.55585% 42.44679%,44.83822% 42.44685%,43.66373% 42.4469%,43.22863% 42.44691%,42.86372% 42.44483%,42.56988% 42.44767%,42.3402% 42.46902%,42.16778% 42.52235%,42.0457% 42.6212%,41.96705% 42.77909%,41.92493% 43.00956%,41.91246% 43.32611%,41.91258% 43.70105%,41.9129% 44.0933%,41.91335% 44.49631%,41.91387% 44.90355%,41.91439% 45.3085%,41.91485% 45.70462%,41.91517% 46.08537%,41.91529% 46.44422%,41.94275% 46.74032%,42.02117% 46.94735%,42.14465% 47.0806%,42.30727% 47.15534%,42.50308% 47.18688%,42.72619% 47.19047%,42.97065% 47.1814%,43.23056% 47.17497%,43.94949% 47.17491%,45.45083% 47.17476%,47.47445% 47.17455%,49.76027% 47.1743%,52.04818% 47.17406%,54.07805% 47.17384%,55.5898% 47.17369%,56.32332% 47.17363%,56.58221% 47.17571%,56.83726% 47.17439%,57.07897% 47.15795%,57.29794% 47.1149%,57.48468% 47.03359%,57.62978% 46.90242%,57.72375% 46.70977%,57.75718% 46.44406%,57.75713% 46.08625%,57.75699% 45.64557%,57.75679% 45.15282%,57.75657% 44.6388%,57.75635% 44.1343%,57.75615% 43.6701%,57.75601% 43.27703%,57.75596% 42.98586%,57.7549% 42.96265%,57.74034% 42.90148%,57.6955% 42.815%,57.60334% 42.71587%,57.44691% 42.61675%,57.20925% 42.53029%,56.87342% 42.46916%)}.audio-toggle.playing .audio-play-icon{transform:rotate(-90deg)}@media only screen and (min-width:601px){.audio-toggle:not(.playing) .part{height:136px;width:136px}}@media only screen and (max-width:600px){.audio-toggle:not(.playing) .part{height:92px;width:92px}}.audio-toggle:not(.playing) .part.one{-webkit-clip-path:polygon(43.77666% 55.85251%,43.77874% 55.46331%,43.7795% 55.09177%,43.77934% 54.74844%,43.77855% 54.44389%,43.77741% 54.18863%,43.77625% 53.99325%,43.77533% 53.86828%,43.77495% 53.82429%,43.77518% 53.55329%,43.7754% 53.2823%,43.77563% 53.01131%,43.77585% 52.74031%,43.77608% 52.46932%,43.7763% 52.19832%,43.77653% 51.92733%,43.77675% 51.65633%,43.77653% 51.38533%,43.7763% 51.11434%,43.77608% 50.84334%,43.77585% 50.57235%,43.77563% 50.30136%,43.7754% 50.03036%,43.77518% 49.75936%,43.77495% 49.48837%,44.48391% 49.4885%,45.19287% 49.48865%,45.90183% 49.48878%,46.61079% 49.48892%,47.31975% 49.48906%,48.0287% 49.4892%,48.73766% 49.48934%,49.44662% 49.48948%,50.72252% 49.48934%,51.99842% 49.4892%,53.27432% 49.48906%,54.55022% 49.48892%,55.82611% 49.48878%,57.10201% 49.48865%,58.3779% 49.4885%,59.6538% 49.48837%,59.57598% 49.89151%,59.31883% 50.28598%,58.84686% 50.70884%,58.12456% 51.19714%,57.11643% 51.78793%,55.78697% 52.51828%,54.10066% 53.42522%,52.02202% 54.54581%,49.96525% 55.66916%,48.3319% 56.57212%,47.06745% 57.27347%,46.11739% 57.79191%,45.42719% 58.14619%,44.94235% 58.35507%,44.60834% 58.43725%,44.37066% 58.41149%,44.15383% 58.27711%,43.99617% 58.0603%,43.88847% 57.77578%,43.82151% 57.43825%,43.78608% 57.06245%,43.77304% 56.66309%,43.773% 56.25486%);clip-path:polygon(43.77666% 55.85251%,43.77874% 55.46331%,43.7795% 55.09177%,43.77934% 54.74844%,43.77855% 54.44389%,43.77741% 54.18863%,43.77625% 53.99325%,43.77533% 53.86828%,43.77495% 53.82429%,43.77518% 53.55329%,43.7754% 53.2823%,43.77563% 53.01131%,43.77585% 52.74031%,43.77608% 52.46932%,43.7763% 52.19832%,43.77653% 51.92733%,43.77675% 51.65633%,43.77653% 51.38533%,43.7763% 51.11434%,43.77608% 50.84334%,43.77585% 50.57235%,43.77563% 50.30136%,43.7754% 50.03036%,43.77518% 49.75936%,43.77495% 49.48837%,44.48391% 49.4885%,45.19287% 49.48865%,45.90183% 49.48878%,46.61079% 49.48892%,47.31975% 49.48906%,48.0287% 49.4892%,48.73766% 49.48934%,49.44662% 49.48948%,50.72252% 49.48934%,51.99842% 49.4892%,53.27432% 49.48906%,54.55022% 49.48892%,55.82611% 49.48878%,57.10201% 49.48865%,58.3779% 49.4885%,59.6538% 49.48837%,59.57598% 49.89151%,59.31883% 50.28598%,58.84686% 50.70884%,58.12456% 51.19714%,57.11643% 51.78793%,55.78697% 52.51828%,54.10066% 53.42522%,52.02202% 54.54581%,49.96525% 55.66916%,48.3319% 56.57212%,47.06745% 57.27347%,46.11739% 57.79191%,45.42719% 58.14619%,44.94235% 58.35507%,44.60834% 58.43725%,44.37066% 58.41149%,44.15383% 58.27711%,43.99617% 58.0603%,43.88847% 57.77578%,43.82151% 57.43825%,43.78608% 57.06245%,43.77304% 56.66309%,43.773% 56.25486%)}.audio-toggle:not(.playing) .part.two{-webkit-clip-path:polygon(43.77666% 43.83035%,43.77874% 44.21955%,43.7795% 44.59109%,43.77934% 44.93442%,43.77855% 45.23898%,43.77741% 45.49423%,43.77625% 45.68961%,43.77533% 45.81458%,43.77495% 45.85858%,43.77518% 46.12957%,43.7754% 46.40056%,43.77563% 46.67156%,43.77585% 46.94255%,43.77608% 47.21355%,43.7763% 47.48454%,43.77653% 47.75554%,43.77675% 48.02654%,43.77653% 48.29753%,43.7763% 48.56852%,43.77608% 48.83952%,43.77585% 49.11051%,43.77563% 49.38151%,43.7754% 49.65251%,43.77518% 49.9235%,43.77495% 50.1945%,44.48391% 50.19436%,45.19287% 50.19422%,45.90183% 50.19408%,46.61079% 50.19394%,47.31975% 50.1938%,48.0287% 50.19366%,48.73766% 50.19353%,49.44662% 50.19338%,50.72252% 50.19353%,51.99842% 50.19366%,53.27432% 50.1938%,54.55022% 50.19394%,55.82611% 50.19408%,57.10201% 50.19422%,58.3779% 50.19436%,59.6538% 50.1945%,59.57598% 49.79136%,59.31883% 49.39688%,58.84686% 48.97402%,58.12456% 48.48572%,57.11643% 47.89493%,55.78697% 47.16458%,54.10066% 46.25764%,52.02202% 45.13705%,49.96525% 44.01371%,48.3319% 43.11074%,47.06745% 42.4094%,46.11739% 41.89096%,45.42719% 41.53667%,44.94235% 41.3278%,44.60834% 41.24561%,44.37066% 41.27137%,44.15383% 41.40575%,43.99617% 41.62256%,43.88847% 41.90709%,43.82151% 42.24461%,43.78608% 42.62041%,43.77304% 43.01978%,43.773% 43.428%);clip-path:polygon(43.77666% 43.83035%,43.77874% 44.21955%,43.7795% 44.59109%,43.77934% 44.93442%,43.77855% 45.23898%,43.77741% 45.49423%,43.77625% 45.68961%,43.77533% 45.81458%,43.77495% 45.85858%,43.77518% 46.12957%,43.7754% 46.40056%,43.77563% 46.67156%,43.77585% 46.94255%,43.77608% 47.21355%,43.7763% 47.48454%,43.77653% 47.75554%,43.77675% 48.02654%,43.77653% 48.29753%,43.7763% 48.56852%,43.77608% 48.83952%,43.77585% 49.11051%,43.77563% 49.38151%,43.7754% 49.65251%,43.77518% 49.9235%,43.77495% 50.1945%,44.48391% 50.19436%,45.19287% 50.19422%,45.90183% 50.19408%,46.61079% 50.19394%,47.31975% 50.1938%,48.0287% 50.19366%,48.73766% 50.19353%,49.44662% 50.19338%,50.72252% 50.19353%,51.99842% 50.19366%,53.27432% 50.1938%,54.55022% 50.19394%,55.82611% 50.19408%,57.10201% 50.19422%,58.3779% 50.19436%,59.6538% 50.1945%,59.57598% 49.79136%,59.31883% 49.39688%,58.84686% 48.97402%,58.12456% 48.48572%,57.11643% 47.89493%,55.78697% 47.16458%,54.10066% 46.25764%,52.02202% 45.13705%,49.96525% 44.01371%,48.3319% 43.11074%,47.06745% 42.4094%,46.11739% 41.89096%,45.42719% 41.53667%,44.94235% 41.3278%,44.60834% 41.24561%,44.37066% 41.27137%,44.15383% 41.40575%,43.99617% 41.62256%,43.88847% 41.90709%,43.82151% 42.24461%,43.78608% 42.62041%,43.77304% 43.01978%,43.773% 43.428%)}.audio-download{z-index:2}.audio-waveform{height:100%}.audio-waveform-background .audio-waveform-bar{opacity:.3}html.no-touch .audio-waveform-background .audio-waveform-bar:active,html.no-touch .audio-waveform-background .audio-waveform-bar:hover{opacity:1}.audio-waveform-fake{bottom:0;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;width:0}.audio-waveform-container{align-items:center;display:flex;height:23px;margin-top:1px;position:relative}.audio-waveform-bar{fill:var(--primary-color)}.audio .audio-details{margin-bottom:0;margin-top:3px}.audio .audio-title{margin-bottom:-2px}[dir=ltr] body.is-premium .audio.can-transcribe{padding-right:2.25rem}[dir=rtl] body.is-premium .audio.can-transcribe{padding-left:2.25rem}body.is-premium .audio.can-transcribe .audio-to-text-button{display:flex}.audio .audio-to-text-button{align-items:center;align-self:flex-end;background:var(--light-filled-message-primary-color);border-radius:.3125rem;color:var(--message-primary-color);display:none;font-size:1.1875rem;height:1.5rem;justify-content:center;margin-right:-2.25rem;margin-top:-1rem;overflow:hidden;position:absolute;width:-moz-max-content;width:max-content;width:2rem}html.no-touch .audio .audio-to-text-button:active:after,html.no-touch .audio .audio-to-text-button:hover:after{background-color:var(--message-primary-color);border-radius:inherit;bottom:0;content:\" \";left:0;opacity:.08;position:absolute;right:0;top:0}.audio .audio-to-text-button .loader{height:100%;left:0;opacity:0;position:absolute;top:0;transition:opacity .2s;width:100%}.audio .audio-to-text-button .loader.active{opacity:1}.audio .audio-to-text-button .loader .audio-transcribe-outline{height:100%;width:100%}@keyframes loading{0%{stroke-dashoffset:100}to{stroke-dashoffset:0}}.audio .audio-to-text-button .loader .audio-transcribe-outline-rect{animation:loading 1s ease-in-out infinite}.audio .part{height:112px!important;width:112px!important}@media only screen and (max-width:600px){.audio .part{height:100px!important;width:100px!important}}.audio-title{color:var(--primary-text-color);font-size:1rem}.audio-description:not(:empty):before{content:\" • \"}.audio-subtitle,.audio-time{color:var(--secondary-text-color);display:flex;font-size:.875rem}@media only screen and (max-width:600px){.audio-subtitle,.audio-time{font-size:.75rem}}.audio-subtitle,.audio-time,.audio-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.audio-subtitle{align-items:center}.audio-subtitle .audio-time{flex:0 0 auto;margin-right:.25rem}.audio-subtitle,.audio-title{margin-left:-1px}.audio-title,.audio:not(.audio-show-progress) .audio-subtitle{max-width:100%}.audio.is-voice .audio-time{align-items:center;line-height:1;margin-left:-1px;margin-top:7px}[dir=ltr] .audio.is-voice .progress-line{margin-left:0}[dir=rtl] .audio.is-voice .progress-line{margin-right:0}.audio.is-voice .progress-line{margin-top:4px;min-width:11.25rem}.audio.is-voice .progress-line__filled:after{opacity:0}@media only screen and (max-width:600px){.audio.is-voice .audio-time{margin-top:.3125rem}.audio.is-voice .audio-waveform-container{height:16px;margin-top:0}}.audio.is-voice.is-unread .audio-time:after{background-color:var(--primary-color);border-radius:50%;content:\" \";height:.5rem;margin-left:.375rem;width:.5rem}.audio.is-voice.is-unread:not(.is-out) .audio-toggle:not(.playing)+.audio-waveform-container .audio-waveform-background .audio-waveform-bar{opacity:1}.audio .progress-line{--height:2px;--border-radius:4px;--thumb-size:.75rem;flex:1 1 auto;margin:0 6px 0 5px}.audio-with-thumb .audio-play-icon{background-color:transparent;opacity:1;z-index:1}body.animation-level-2 .audio-with-thumb .audio-play-icon{transition:transform .25s ease-in-out,background-color .2s ease-in-out,opacity .2s ease-in-out}.audio-with-thumb .audio-play-icon .part{background-color:#fff!important}.audio-with-thumb .audio-play-icon:not(:last-child){background-color:rgba(0,0,0,.3)}.audio-with-thumb .media-photo{border-radius:inherit;height:inherit;-o-object-fit:cover;object-fit:cover;width:inherit}.audio-with-thumb:not(.corner-download) .audio-download{background-color:rgba(0,0,0,.3)}.audio-with-thumb:not(.corner-download).downloading .audio-play-icon{opacity:0}.quiz-hint{align-items:center;display:flex;justify-content:center;left:0;position:absolute;top:8px;transform:translate3d(0,calc(-100% - 10px),0);transition:transform .2s ease;width:100%}body.animation-level-0 .quiz-hint{transition:none}.quiz-hint.active{transform:translateZ(0)}[dir=ltr] .quiz-hint .container{text-align:left}[dir=rtl] .quiz-hint .container{text-align:right}.quiz-hint .container{align-items:center;background:rgba(0,0,0,.7);border-radius:12px;color:#fff;display:flex;flex-wrap:wrap;font-size:15px;line-height:1.5;max-width:400px;min-height:48px;overflow:hidden;padding:10px 18px 12px 50px;position:relative;text-align:center;width:auto}@media only screen and (max-width:600px){.quiz-hint .container{font-size:14px;margin:0 10px;padding:10px 18px 12px 54px}}.quiz-hint .container .text{word-break:break-word}.quiz-hint .container:before{content:\"\";font-size:1.5rem;left:15px;position:absolute;top:12px}.quiz-hint .container a{border-bottom:1px solid #fff;color:#fff}.peer-typing{margin-right:4px}.peer-typing-container{--color:var(--primary-color);color:var(--color)}.peer-typing-flex{align-items:center;display:flex}.peer-typing:not(.peer-typing-text):not(.peer-typing-choosing-sticker){display:inline-block;transform:translateY(-1px);vertical-align:middle}.peer-typing-text-dot{animation-duration:.6s;animation-iteration-count:infinite;animation-name:dotMiddle;animation-timing-function:linear;background-color:var(--color);border-radius:50%;display:inline-block;height:6px;margin:0 .5px;vertical-align:middle;width:6px}.peer-typing-text-dot:first-child{animation-name:dotFirst}.peer-typing-text-dot:last-child{animation-name:dotLast}.peer-typing-upload{border-radius:2px;height:5px;margin-right:.375rem;overflow:hidden;position:relative;width:13px}.peer-typing-upload:after,.peer-typing-upload:before{background-color:var(--color);border-radius:inherit;bottom:0;content:\" \";display:block;left:0;position:absolute;right:0;top:0}.peer-typing-upload:before{opacity:.3}.peer-typing-upload:after{animation:upload 1s ease-in-out infinite}.peer-typing-record{margin-right:.375rem}.peer-typing-record:before{animation:recordBlink 1.25s infinite;background-color:var(--color);border-radius:50%;content:\" \";display:block;height:6px;width:6px}.peer-typing-choosing-sticker{align-items:center;display:flex;flex:0 0 auto;height:16px;margin-right:.375rem}.peer-typing-choosing-sticker-eye{animation:eye 1.8s ease-in-out infinite;border:1px solid var(--color);border-radius:50%;display:inline-block;height:14px;margin:0 .0625rem;position:relative;vertical-align:middle;width:8px}.peer-typing-choosing-sticker-eye:before{animation:eye-move 1.8s ease-in-out infinite;background-color:var(--color);border-radius:50%;content:\" \";display:block;height:.25rem;position:absolute;top:50%;transform:translate(-1px,-50%);width:.25rem}@keyframes dotFirst{0%{opacity:.8;transform:scale(.6666666667)}50%{opacity:.8;transform:scale(.6666666667)}75%{opacity:1;transform:scale(1)}to{opacity:.8;transform:scale(.6666666667)}}@keyframes dotMiddle{0%{opacity:.9;transform:scale(.8333333333)}12.5%{opacity:.8;transform:scale(.6666666667)}62.5%{opacity:.8;transform:scale(.6666666667)}87.5%{opacity:1;transform:scale(1)}to{opacity:.9;transform:scale(.8333333333)}}@keyframes dotLast{0%{opacity:1;transform:scale(1)}25%{opacity:.8;transform:scale(.6666666667)}75%{opacity:.8;transform:scale(.6666666667)}to{opacity:1;transform:scale(1)}}@keyframes upload{0%{transform:translateX(-13px)}to{transform:translate(13px)}}@keyframes eye{0%{transform:scale(1.1) translateX(-.75px)}12.5%{transform:scale(1) translateX(0)}25%{transform:scale(1.1) translateX(.375px)}50%{transform:scale(1.1) translateX(.75px)}62.5%{transform:scale(1) translateX(0)}75%{transform:scale(1.1) translateX(-.375px)}to{transform:scale(1.1) translateX(-.75px)}}@keyframes eye-move{0%{transform:translate(-1px,-50%)}25%{transform:translate(3px,-50%)}50%{transform:translate(3px,-50%)}75%{transform:translate(-1px,-50%)}to{transform:translate(-1px,-50%)}}poll-element{color:var(--primary-text-color);display:block;margin-top:-1px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:330px}@media only screen and (max-width:600px){poll-element{max-width:100%;width:240px}}poll-element:not(.is-closed):not(.is-voted) .poll-answer{cursor:pointer}poll-element .poll-title{font-weight:var(--font-weight-bold)}@media only screen and (max-width:600px){poll-element .poll-title{max-width:88%;white-space:normal}}poll-element .poll-desc{align-items:center;color:var(--secondary-text-color);display:flex;font-size:14px;margin-bottom:5px;margin-top:2px;position:relative}poll-element .poll-type{margin-top:2px}poll-element .poll-hint{color:var(--primary-color);cursor:pointer;font-size:1.5rem;position:absolute;right:2px;top:-4px;transform:scale(1)}body.animation-level-2 poll-element .poll-hint{transition:transform .2s ease}poll-element .poll-hint.active{pointer-events:none;transform:scale(0)}poll-element .poll-send-vote{cursor:default}poll-element .poll-avatars{cursor:pointer;display:flex;margin-left:18px}poll-element .poll-avatar{border:1px solid var(--border-color);cursor:pointer;height:18px;width:18px}poll-element .poll-answer{display:flex;margin-top:1px;padding-bottom:20px;padding-left:28px;position:relative}poll-element .poll-answer-text{margin-left:12px;margin-top:6px}[dir=ltr] poll-element .poll-answer-percents{text-align:right}[dir=rtl] poll-element .poll-answer-percents{text-align:left}poll-element .poll-answer-percents{font-size:14px;font-weight:var(--font-weight-bold);left:0;margin-left:-9px;margin-top:7px;opacity:0;position:absolute;top:0;width:40px}poll-element .poll-answer-selected{align-items:center;background:var(--primary-color);border-radius:50%;bottom:1px;color:#fff;display:flex;font-size:.75rem;font-weight:var(--font-weight-bold);height:16px;justify-content:center;left:15px;opacity:1;position:absolute;width:16px}poll-element .poll-answer-selected:before{content:\"\";font-weight:var(--font-weight-bold)}html.no-touch poll-element .poll-answer:active .animation-ring,html.no-touch poll-element .poll-answer:hover .animation-ring{transform:scale(1);visibility:visible}poll-element .poll-answer.is-voting .progress-ring__circle{stroke-dashoffset:-19.792;animation:pollAnswerRotate .65s linear infinite}poll-element .poll-answer:not(.is-correct):not(.is-chosen) .poll-answer-selected{opacity:0}poll-element .poll-answer.is-chosing .circle-hover .poll-answer-selected{opacity:1}poll-element .poll-answer.is-chosing~.poll-footer .poll-send-vote{cursor:pointer}poll-element .poll-votes-count{color:var(--secondary-text-color);font-size:.875rem;margin-top:-.5rem}poll-element .poll-line{stroke-dashoffset:0;stroke-dasharray:0,485.9;bottom:2px;height:35px;left:10px;position:absolute}poll-element .poll-line use{stroke-width:4px;stroke-linecap:round;stroke:var(--primary-color);fill:none}poll-element .poll-footer{height:2.875rem;margin:-.375rem -.5rem -.375rem -.625rem;text-align:center}poll-element .poll-footer-button{border-top-left-radius:0!important;border-top-right-radius:0!important;color:var(--primary-color);cursor:pointer;font-size:1rem;font-weight:var(--font-weight-bold);height:100%;overflow:hidden;width:100%}poll-element .poll-footer,poll-element .poll-footer-button{align-items:center;display:flex;justify-content:center}poll-element .poll-quiz-timer{stroke:#a3adb6;fill:none;stroke-linecap:round;height:32px;position:absolute;right:-2px;top:-7px;transform:rotate(270deg);width:32px}poll-element .poll-time{color:#a3adb6;font-size:12px;font-weight:var(--font-weight-bold);position:absolute;right:27px}poll-element.is-quiz .poll-answer.is-chosen:not(.is-correct) use{stroke:var(--danger-color)}poll-element.is-quiz .poll-answer.is-chosen:not(.is-correct) .poll-answer-selected{background:var(--danger-color)}poll-element.is-quiz .poll-answer.is-chosen:not(.is-correct) .poll-answer-selected:before{content:\"\";font-size:12px}poll-element .circle-hover{align-items:center;display:flex;height:34px;justify-content:center;left:-1px;position:absolute;top:-1px;transform:scale(1);width:34px}poll-element .circle-hover .poll-answer-selected{animation:none;display:flex!important;font-size:20px;height:20px;left:50%;line-height:16px;opacity:0;top:50%;transform:translate(-50%,-50%);width:20px}body.animation-level-2 poll-element .circle-hover .poll-answer-selected{transition:opacity .2s ease}poll-element .animation-ring{background-color:var(--light-secondary-text-color);border-radius:50%;display:block;height:34px;transform:scale(.1);visibility:hidden;width:34px}body.animation-level-2 poll-element .animation-ring{transition:transform .12s ease}poll-element .progress-ring{height:26px;left:auto;top:auto;width:26px}poll-element .progress-ring__circle{stroke-dasharray:56.5487,56.5487;stroke-dashoffset:0;stroke-opacity:1;stroke-width:2;stroke:var(--poll-circle-color);fill:transparent;transform:rotate(-90deg);transform-origin:center}poll-element.is-voted .animation-ring,poll-element.is-voted .circle-hover{transform:scale(0)}poll-element.is-voted .poll-answer-percents{opacity:1}poll-element.is-retracting .circle-hover{transition-delay:.24s}poll-element.is-retracting .animation-ring{transition-delay:.22s}poll-element.animating .poll-line{transition:stroke-dashoffset .34s linear,stroke-dasharray .34s linear}poll-element.animating .poll-answer-selected{transition-delay:.24s;transition:opacity forwards .1s ease}poll-element.animating.is-retracting .poll-answer-selected{transition-delay:0s}poll-element.animating .poll-answer-percents{transition:opacity .34s}poll-element.animating .progress-ring__circle{transition:stroke-dashoffset .15s}poll-element.animating .circle-hover{transition:transform .1s}poll-element.is-multiple .poll-desc{margin-bottom:.5rem}poll-element .c-ripple__circle{background-color:var(--light-primary-color)}@keyframes pollAnswerRotate{to{transform:rotate(270deg)}}.transition>.transition-item{animation-fill-mode:forwards!important;height:100%;left:0;position:absolute;top:0;width:100%}.transition>.transition-item:not(.active):not(.from):not(.to){display:none!important}.transition.zoom-fade>.from{opacity:1;transform:scale(1);transform-origin:center}.transition.zoom-fade>.to{opacity:0;transform-origin:center}.transition.zoom-fade.animating>.from{animation:fade-out-opacity .15s ease}.transition.zoom-fade.animating>.to{animation:fade-in-opacity .15s ease,zoom-fade-in-move .15s ease}.transition.zoom-fade.backwards>.from{transform:scale(1)}.transition.zoom-fade.backwards>.to{transform:scale(.95)}.transition.zoom-fade.backwards.animating>.from{animation:fade-in-backwards-opacity .1s ease,zoom-fade-in-backwards-move .15s ease}.transition.zoom-fade.backwards.animating>.to{animation:fade-out-backwards-opacity .15s ease,zoom-fade-out-backwards-move .15s ease}.transition.slide-fade{--easeOutSine:cubic-bezier(.39,.575,.565,1);--easeInSine:cubic-bezier(.47,0,.745,.715);position:relative}.transition.slide-fade>.from{opacity:1;transform:translateX(0);transform-origin:left center}.transition.slide-fade>.to{opacity:0;transform:translateX(1.5rem);transform-origin:left center}.transition.slide-fade.animating>.from{animation:fade-out-opacity .4s ease-out,slide-fade-out-move .4s}.transition.slide-fade.animating>.to{animation:fade-in-opacity .4s var(--easeInSine),slide-fade-in-move .4s}.transition.slide-fade.backwards>.from{opacity:1;transform:translateX(0)}.transition.slide-fade.backwards>.to{opacity:0;transform:translateX(-1.5rem)}.transition.slide-fade.backwards.animating>.from{animation:fade-in-backwards-opacity .4s ease-out,slide-fade-in-backwards-move .4s}.transition.slide-fade.backwards.animating>.to{animation:fade-out-backwards-opacity .4s var(--easeOutSine),slide-fade-out-backwards-move .4s}@keyframes zoom-fade-in-move{0%{transform:scale(1.1)}to{transform:scale(1)}}@keyframes zoom-fade-in-backwards-move{0%{transform:scale(1)}to{transform:scale(1.1)}}@keyframes zoom-fade-out-backwards-move{0%{transform:scale(.95)}to{transform:scale(1)}}@keyframes slide-fade-in-move{0%{transform:translateX(1.5rem)}to{transform:translateX(0)}}@keyframes slide-fade-out-move{0%{transform:translateX(0)}to{transform:translateX(-1.5rem)}}@keyframes slide-fade-in-backwards-move{0%{transform:translateX(0)}to{transform:translateX(1.5rem)}}@keyframes slide-fade-out-backwards-move{0%{transform:translateX(-1.5rem)}to{transform:translateX(0)}}.row{display:flex;flex-direction:column;justify-content:center;min-height:3.5rem;padding:.4375rem 1rem;position:relative}.row.no-subtitle,.row.row-small{min-height:3rem;padding-bottom:.1875rem;padding-top:.1875rem}body.animation-level-2 .row{transition:opacity var(--transition-standard-in)}.row.is-disabled{opacity:var(--disabled-opacity);pointer-events:none!important}.row.no-wrap{padding-bottom:0!important;padding-top:0!important}.row a{pointer-events:all;position:relative;z-index:1}.row-title-row,.row>.row-title{order:0}[dir=ltr] .row-big{padding-left:1rem;padding-right:.75rem}[dir=rtl] .row-big{padding-left:.75rem;padding-right:1rem}.row-big{min-height:4.5rem;padding-bottom:.5625rem;padding-top:.5625rem}.row-row{align-items:center;display:flex;justify-content:space-between}.row-row .row-subtitle,.row-row .row-title{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row-subtitle-row,.row>.row-subtitle{order:1}.row-title{color:var(--primary-text-color);font-size:var(--font-size);line-height:var(--line-height);overflow:hidden;text-overflow:ellipsis;word-break:break-word}.row-title-right-secondary{color:var(--secondary-text-color)}.row-title-row.with-delimiter .row-title:first-child{border-right:1px solid var(--border-color)}[dir=ltr] .row-subtitle-right,[dir=ltr] .row-title-right{margin-left:1rem}[dir=rtl] .row-subtitle-right,[dir=rtl] .row-title-right{margin-right:1rem}.row-subtitle-right,.row-title-right{flex:0 0 auto!important}.row-midtitle,.row-subtitle,.row-title{pointer-events:none;position:relative}.row-midtitle{font-size:var(--font-size-14);margin-top:.125rem;order:1}[dir=ltr] .row-with-padding{padding-left:4.5rem}[dir=rtl] .row-with-padding{padding-right:4.5rem}@media only screen and (max-width:600px){[dir=ltr] .row-with-padding{padding-left:4rem}[dir=rtl] .row-with-padding{padding-right:4rem}}[dir=ltr] .row-with-padding.tgico:before{left:1rem}[dir=rtl] .row-with-padding.tgico:before{right:1rem}.row-with-padding.tgico:before{color:var(--secondary-text-color);font-size:1.5rem;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);z-index:1}.row-with-padding:not(.row-with-icon):before{display:none}.row-clickable{cursor:pointer;overflow:hidden}@media only screen and (min-width:601px){.row-clickable{border-radius:10px}}[dir=ltr] .row-sortable .row-subtitle,[dir=ltr] .row-sortable .row-title{padding-right:2.5rem}[dir=rtl] .row-sortable .row-subtitle,[dir=rtl] .row-sortable .row-title{padding-left:2.5rem}[dir=ltr] .row-sortable-icon{right:.75rem}[dir=rtl] .row-sortable-icon{left:.75rem}.row-sortable-icon{color:var(--secondary-text-color);font-size:1.5rem;height:1.5rem;line-height:1;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%)}.row-sortable.cant-sort .row-sortable-icon{display:none}.row-sortable.is-dragging{background-color:var(--surface-color)!important;z-index:1}html.no-touch .row-sortable.is-dragging:active,html.no-touch .row-sortable.is-dragging:hover{background-color:var(--light-filled-secondary-text-color)!important}html.no-touch .row-sortable:active .row-sortable-icon,html.no-touch .row-sortable:hover .row-sortable-icon{opacity:1}body.animation-level-2 .is-reordering .row-sortable{transition:transform var(--transition-standard-in)}[dir=ltr] .row .checkbox-field,[dir=ltr] .row .radio-field-main{padding-left:3.375rem}[dir=rtl] .row .checkbox-field,[dir=rtl] .row .radio-field-main{padding-right:3.375rem}[dir=ltr] .row .checkbox-field,[dir=ltr] .row .radio-field-main{margin-left:-3.375rem}[dir=rtl] .row .checkbox-field,[dir=rtl] .row .radio-field-main{margin-right:-3.375rem}.row .checkbox-field,.row .radio-field,.row .radio-field:not(.radio-field-right) .radio-field-main{position:static}.row .checkbox-field,.row .radio-field{--offset-left:1rem}.row .radio-field{margin-bottom:0;margin-top:0}[dir=ltr] .row .checkbox-field{margin-right:0}[dir=rtl] .row .checkbox-field{margin-left:0}.row .checkbox-field{height:auto;margin-bottom:0;margin-top:0}[dir=ltr] .row .checkbox-field .checkbox-caption{padding-left:0}[dir=rtl] .row .checkbox-field .checkbox-caption{padding-right:0}.row .checkbox-field .checkbox-caption{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row .checkbox-field-toggle{margin-left:.125rem;margin-right:.125rem;padding:0}.row .checkbox-field-absolute{left:0;margin:0!important;padding:0!important;position:absolute}.row .checkbox-field-round .checkbox-box-border{z-index:auto}.row-subtitle{color:var(--secondary-text-color)!important;font-size:var(--font-size-14)!important;line-height:var(--line-height-14);margin-top:.1875rem}.row-subtitle:empty{display:none}[dir=ltr] .row-media{left:.75rem}[dir=rtl] .row-media{right:.75rem}.row-media{align-items:center;display:flex;height:2.25rem!important;justify-content:center;margin:0!important;pointer-events:none;position:absolute!important;width:2.25rem!important}[dir=ltr] .row-media-small{left:.75rem!important}[dir=rtl] .row-media-small{right:.75rem!important}.row-media-small{height:2rem!important;width:2rem!important}[dir=ltr] .row-media-abitbigger{left:.75rem!important}[dir=rtl] .row-media-abitbigger{right:.75rem!important}.row-media-abitbigger{height:2.625rem!important;width:2.625rem!important}[dir=ltr] .row-media-big{left:.5rem!important}[dir=rtl] .row-media-big{right:.5rem!important}.row-media-big{height:3rem!important;width:3rem!important}[dir=ltr] .row-media-bigger{left:.5625rem!important}[dir=rtl] .row-media-bigger{right:.5625rem!important}.row-media-bigger{height:3.375rem!important;width:3.375rem!important}.row.menu-open{background-color:var(--light-secondary-text-color)}[dir=ltr] .row>.btn-primary{right:1rem}[dir=rtl] .row>.btn-primary{left:1rem}.row>.btn-primary{border-radius:.9375rem;font-size:.9375rem;height:1.875rem;line-height:1.875rem;margin:0;padding-left:.75rem;padding-right:.75rem;position:absolute;top:50%;transform:translateY(-50%);width:auto}body.animation-level-2 .row>.btn-primary{transition:width .2s,background-color .2s,color .2s}.row>.btn-primary.active{background-color:var(--light-primary-color)!important;color:var(--primary-color)}.row.accordion-toggler .checkbox-field-toggle{pointer-events:all!important}.color-picker{margin:1.1875rem auto .25rem;max-width:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:380px}@media only screen and (max-width:600px){.color-picker{padding:0 .75rem}}.color-picker-box{height:198px;width:100%}.color-picker-box,.color-picker-color-slider,.color-picker-dragger{overflow:visible!important}.color-picker-sliders{margin:1rem 0 1.125rem}.color-picker-dragger{cursor:grab}.color-picker-inputs{display:flex}.color-picker-inputs .input-field{flex:1 1 auto}.color-picker-inputs .input-field:not(:first-child){margin-left:1.25rem}.reply-keyboard{background:var(--surface-color);border-radius:10px;bottom:calc(100% + .625rem);box-shadow:0 5px 10px 5px rgba(16,35,47,.14);display:flex!important;flex-direction:column;max-height:26.25rem;max-width:100%;opacity:0;overflow:hidden;padding:0!important;position:absolute!important;right:0;transform:scale(0);transform-origin:bottom right;transition:transform var(--esg-transition),opacity var(--esg-transition);width:26.25rem!important;z-index:3}@media only screen and (max-height:569px),only screen and (max-width:600px){.reply-keyboard{bottom:calc(100% + .5rem)}}.reply-keyboard.active{opacity:1;transform:scale(1)}body.animation-level-0 .reply-keyboard{transition:none}.reply-keyboard-row{display:flex}.reply-keyboard-row+.reply-keyboard-row{margin-top:.3125rem}.reply-keyboard-button{background-color:transparent;border:2px solid var(--primary-color);border-radius:.375rem;color:var(--primary-color);font-size:.9375rem;font-weight:var(--font-weight-bold);height:3rem;text-align:center;width:100%}body.animation-level-2 .reply-keyboard-button{transition:color .15s,background-color .15s}html.no-touch .reply-keyboard-button:active,html.no-touch .reply-keyboard-button:hover{background-color:var(--primary-color);color:#fff}.reply-keyboard-button+.reply-keyboard-button{margin-left:.3125rem}.reply-keyboard .scrollable-y{bottom:auto;height:auto;left:auto;max-height:100%;padding:.625rem!important;position:relative;right:auto;top:auto}.peoplenearby-container div.text.nearby-description{color:var(--primary-text-color);margin-top:15px;text-align:center}.peoplenearby-container div.text.nearby-error{color:var(--gc-secondary-text-color);margin-top:10px;text-align:center}.peoplenearby-container .locating-animation-container{align-items:center;display:flex;justify-content:center;min-height:140px;width:100%}.peoplenearby-container .locating-animation-container .tgico.tgico-location{align-items:center;background:var(--avatar-color-bottom);border-radius:50%;display:flex;height:140px;justify-content:center;padding:50px;width:140px}.peoplenearby-container .locating-animation-container .tgico.tgico-location:before{color:#fff;font-size:58px}.peoplenearby-container .locating-animation-container .locating-animation-waves{position:fixed}.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-1,.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-3{animation:waves-animation 3s infinite;border:5px solid #fff;border-radius:50%;-webkit-clip-path:polygon(72% 0,100% 0,100% 100%,72% 100%);clip-path:polygon(72% 0,100% 0,100% 100%,72% 100%);height:50px;margin-left:36px;width:50px}.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-2,.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-4{animation:waves-animation 5s infinite;animation-delay:2s;border:5px solid #fff;border-radius:50%;-webkit-clip-path:polygon(72% 0,100% 0,100% 100%,72% 100%);clip-path:polygon(72% 0,100% 0,100% 100%,72% 100%);height:71px;margin-left:51px;margin-top:1px;width:66px}.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-3{margin-left:-36px!important;transform:rotateY(180deg)}.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-4{margin-left:-51px!important;transform:rotateY(180deg)}@keyframes waves-animation{0%{opacity:1}50%{opacity:0}to{opacity:1}}.spoiler{--anim:.4s ease;background-color:var(--spoiler-background-color)}.spoiler-text{opacity:0}.spoilers-container .custom-emoji-canvas{z-index:-1}.spoilers-container.is-spoiler-visible.animating .spoiler{transition:background-color var(--anim)}.spoilers-container.is-spoiler-visible.animating .spoiler-text{transition:opacity var(--anim)}.spoilers-container.is-spoiler-visible:not(.backwards) .spoiler{background-color:transparent}.spoilers-container.is-spoiler-visible:not(.backwards) .spoiler-text{opacity:1}.spoilers-container:not(.is-spoiler-visible) .spoiler{cursor:pointer}.spoilers-container:not(.is-spoiler-visible) .spoiler-text{pointer-events:none}.emoji-animation,.emoji-animation-container{pointer-events:none;position:absolute}.emoji-animation-container{bottom:0;left:0;overflow:hidden;right:0;top:0;z-index:3}.reactions-block{display:flex;flex-wrap:wrap;-webkit-user-select:none;-moz-user-select:none;user-select:none}.reactions-block.has-no-reactions{display:inline;display:initial}.reactions-inline{display:inline-flex}.reactions-inline:not(:empty){margin-right:.125rem}.reaction,.reaction-sticker{align-items:center;display:flex}.reaction-sticker{--custom-emoji-size:var(--reaction-size);height:var(--reaction-size);justify-content:center;position:relative;width:var(--reaction-size)}.reaction-sticker-activate{bottom:var(--reaction-offset);left:var(--reaction-offset);position:absolute;right:var(--reaction-offset);top:var(--reaction-offset);z-index:1}.reaction-sticker.has-animation>.media-sticker{opacity:0}.reaction-sticker:not(.is-static):not(.is-custom) .media-sticker{--size:calc(var(--reaction-size) + var(--reaction-offset)*-2);bottom:auto;height:var(--size)!important;left:auto;max-height:var(--size);max-width:var(--size);right:auto;top:auto;width:var(--size)!important}.reaction-sticker.is-custom{border-radius:.3125rem}.reaction-sticker.is-custom .custom-emoji,.reaction-sticker.is-custom .media-sticker{border-radius:inherit}.reaction-sticker.is-custom .custom-emoji-canvas{z-index:auto}.reaction-inline{--reaction-size:.875rem;--reaction-offset:-.4375rem;min-height:var(--reaction-size);min-width:var(--reaction-size)}.reaction-inline .reaction-counter{font-size:inherit!important;margin-right:.0625rem!important;order:-1}.reaction-block{--additional-height:.5rem;--margin:.375rem;--reaction-size:1.375rem;--reaction-offset:-.5625rem;--background-color:var(--message-highlightning-color);--chosen-background-color:var(--message-primary-color);--counter-color:#fff;--reaction-total-size:calc(var(--reaction-size) + var(--additional-height));background-color:var(--background-color);border-radius:var(--reaction-total-size);color:var(--counter-color);cursor:pointer;height:var(--reaction-total-size);margin-right:var(--margin);margin-top:var(--margin);padding:0 .5rem;position:relative}html.no-touch .reaction-block:active:after,html.no-touch .reaction-block:hover:after{background-color:var(--chosen-background-color);border-radius:inherit;bottom:0;content:\" \";left:0;opacity:.08;position:absolute;right:0;top:0}.reaction-block .reaction-counter,.reaction-block .reaction-sticker{z-index:1}.reaction-block:last-child{margin-right:0}.reaction-block:before{background-color:var(--chosen-background-color);border-radius:inherit;bottom:0;content:\" \";left:0;opacity:0;position:absolute;right:0;top:0;transform:scale(0)}.reaction-block.is-chosen:not(.backwards):before{opacity:1;transform:scale(1)}.reaction-block.is-chosen:not(.backwards) .stacked-avatars{--border-color:var(--chosen-background-color)}.reaction-block.is-chosen.animating:before{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.reaction-block.is-chosen.animating .reaction-counter{transition:color var(--transition-standard-in)}.reaction-block.is-chosen.animating .stacked-avatars-avatar-container{transition:border-color var(--transition-standard-in)}.reaction-block .stacked-avatars{--border-color:transparent;--border-size:.125rem;--margin-right:-.875rem;margin-left:.1875rem}.reaction-block .reaction-counter{font-size:.9375rem!important;font-weight:var(--font-weight-bold);line-height:1.125rem;margin:0 .0625rem 0 .375rem;position:relative}.stacked-avatars{--border-color:var(--surface-color);--border-size:1px;--margin-right:-.3125rem;--avatar-size:1rem;--avatar-total-size:calc(var(--avatar-size) + var(--border-size)*2);display:flex;flex-direction:row-reverse}.stacked-avatars-avatar{height:var(--avatar-size);width:var(--avatar-size);z-index:0}.stacked-avatars-avatar-container{align-items:center;border:var(--border-size) solid var(--border-color);border-radius:50%;display:flex;height:var(--avatar-total-size);justify-content:center;position:relative;width:var(--avatar-total-size)}.stacked-avatars-avatar-container:not(:first-child){margin-right:var(--margin-right)}.sticker-viewer{align-items:center;bottom:0;display:flex;justify-content:center;left:0;pointer-events:none;position:fixed;right:0;top:0;z-index:4}.sticker-viewer:before{background-color:rgba(0,0,0,.6);bottom:0;content:\" \";left:0;opacity:0;position:absolute;right:0;top:0}body.animation-level-2 .sticker-viewer:before{transition:opacity var(--sticker-viewer-open-transition-out)}.sticker-viewer.is-visible:not(.backwards):before{opacity:1}body.animation-level-2 .sticker-viewer.is-visible:not(.backwards):before{transition:opacity var(--sticker-viewer-open-transition-in)}.sticker-viewer.is-visible:not(.backwards) .sticker-viewer-transformer:not(.is-switching){transform:translateX(var(--translateX)) scale(1)!important}body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .sticker-viewer-transformer:not(.is-switching){transition:transform var(--sticker-viewer-open-transition-in)}.sticker-viewer.is-visible:not(.backwards) .emoji-animation,.sticker-viewer.is-visible:not(.backwards) .sticker-viewer-emoji,.sticker-viewer.is-visible:not(.backwards) .sticker-viewer-sticker{opacity:1}body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .emoji-animation,body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .sticker-viewer-emoji,body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .sticker-viewer-sticker{transition:opacity var(--sticker-viewer-open-transition-in)}body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .sticker-viewer-sticker:not(.is-overflow){transition:opacity 0s}.sticker-viewer-transformer{--translateX:0;align-items:center;display:flex;height:360px;justify-content:center;position:absolute;width:360px}.sticker-viewer-transformer.has-effect{height:280px;width:280px}.sticker-viewer-transformer.has-effect .sticker-viewer-emoji{top:-5.5rem}body.animation-level-2 .sticker-viewer-transformer{transition:transform var(--sticker-viewer-open-transition-out)}.sticker-viewer-transformer.is-switching{opacity:1!important;transform:translateX(var(--translateX)) scale(1)!important}body.animation-level-2 .sticker-viewer-transformer.is-switching{transition:transform var(--sticker-viewer-switch-transition),opacity var(--sticker-viewer-switch-transition)!important}.sticker-viewer-transformer.is-switching:not(.backwards){opacity:0!important;transform:scale(.4) translateX(var(--translateX))!important}.sticker-viewer-emoji{position:absolute;top:-3rem;transform:translateX(var(--translateX)) scale(2)}.sticker-viewer-sticker{position:absolute}.sticker-viewer .emoji-animation,.sticker-viewer-emoji,.sticker-viewer-sticker{opacity:0}body.animation-level-2 .sticker-viewer .emoji-animation,body.animation-level-2 .sticker-viewer-emoji,body.animation-level-2 .sticker-viewer-sticker{transition:opacity var(--sticker-viewer-open-transition-out)}.custom-emoji{display:inline;height:var(--custom-emoji-size)!important;min-height:var(--custom-emoji-size)!important;min-width:var(--custom-emoji-size)!important;position:relative;width:var(--custom-emoji-size)!important}.custom-emoji:before{content:\" \";display:inline-block;height:inherit;min-height:inherit;min-width:inherit;width:inherit}.custom-emoji .media-sticker,.custom-emoji .rlottie{height:inherit!important;margin:0;max-height:inherit!important;max-width:inherit!important;pointer-events:none;text-indent:-9999px;width:inherit!important}.custom-emoji-canvas{height:100%;width:100%}.custom-emoji-canvas,.custom-emoji-renderer{bottom:0;left:0;position:absolute;right:0;top:0}.custom-emoji-renderer{pointer-events:none}.custom-emoji-placeholder{display:inline;height:var(--messages-custom-emoji-size);margin-top:-.125rem;vertical-align:middle;width:var(--messages-custom-emoji-size)}.usernames-username-icon{background-color:var(--secondary-color);border-radius:50%;color:#fff;font-size:1.25rem}.usernames-username-icon:before{content:\"\"}.usernames-username.active .usernames-username-status{color:var(--primary-color)!important}.usernames-username.active .usernames-username-icon{background-color:var(--primary-color)}.topics-slider{bottom:0;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0}.topics-container{--offset:0;--width:100%;background-color:var(--surface-color)!important;width:var(--width)!important}.topics-container.is-floating{--offset:5.0625rem;--width:calc(var(--left-column-width) - var(--offset));border-left:1px solid var(--border-color);bottom:0;overflow:visible!important;overflow:initial!important;pointer-events:all;position:absolute;right:0;top:0;transform:translateX(var(--width));z-index:3}.topics-container.is-visible:not(.backwards){transform:translateX(0)}.topics-container.is-visible.animating{transition:transform var(--transition-standard-in)}.topics-container.is-visible.animating.backwards{transition:transform var(--transition-standard-out)}.topics-container .sidebar-header{padding:0 .75rem}.topics-container .sidebar-header__rows{flex:1 1 auto;overflow:hidden;padding-left:.5rem}.topics-container .sidebar-header__rows .sidebar-header__title{font-size:var(--font-size-16);line-height:var(--line-height-16);margin-bottom:.125rem;padding-left:0!important}.topics-container .sidebar-header__subtitle,.topics-container .sidebar-header__title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topics-container .sidebar-header__subtitle{color:var(--secondary-text-color);font-size:var(--font-size-14);line-height:var(--line-height-14)}.topics-container .chatlist-chat{min-height:4rem;padding-left:.75rem}.topic-name .topic-icon{margin-right:.25rem}.topic-name-button{--color:var(--primary-color);align-items:center;color:var(--color);cursor:pointer;display:flex;font-weight:var(--font-weight-bold);height:1.5rem;justify-content:center;max-width:100%;padding:0 .5rem;position:relative;text-decoration:none!important}.topic-name-button-container{align-items:flex-start;display:flex!important;justify-content:flex-start}.topic-name-button .peer-title,.topic-name-button .topic-name{position:relative}.topic-name-button:before{background-color:var(--color);border-radius:1.5rem;bottom:0;content:\" \";left:0;opacity:.08;position:absolute;right:0;top:0}html.no-touch .topic-name-button:active:before,html.no-touch .topic-name-button:hover:before{opacity:.16}.topic-icon{--size:1.25rem;--custom-emoji-size:var(--size);display:inline-flex;font-size:calc(var(--size)/2);justify-content:center;line-height:1.875!important;position:relative;vertical-align:middle}.topic-icon-general{fill:var(--secondary-color);height:var(--size);width:var(--size)}.topic-icon-svg{height:inherit;position:absolute;width:inherit}.topic-icon-content{position:relative}.edit-topic-container .scrollable-y{display:flex;flex-direction:column}.edit-topic-icon{position:absolute}.edit-topic-icon .topic-icon{--size:4rem}.edit-topic-icon-container{align-items:center;cursor:pointer;display:flex;height:100px;justify-content:center;margin:0 auto;position:relative;width:100px}.edit-topic-emoticons-container{flex:1 1 auto}.edit-topic-emoticons-container .sidebar-left-section{height:100%;padding:0!important}.edit-topic-emoticons-container .emoji-padding{display:flex;flex-direction:column}.edit-topic-emoticons-container .super-emoji-topic-icon .topic-icon{--size:var(--esg-emoji-size);--custom-emoji-size:inherit;margin-left:calc((var(--custom-emoji-size) - var(--esg-emoji-size))/2)}.themes-container{align-items:center;display:flex;height:6.5rem;position:relative}@media only screen and (min-width:601px){.themes-container{margin:0 -.5rem;padding:0;width:calc(100% + 1rem)}}.themes-container:after,.themes-container:before{content:\" \";display:block;flex:0 0 auto;height:.5rem;width:.5rem}.theme-container{border-radius:10px;cursor:pointer;display:flex;flex:0 0 auto;height:calc(100% - .5rem);justify-content:center;margin:0 .25rem;position:relative;width:4.5rem}.theme-container:before{border:2px solid var(--primary-color);border-radius:14px;bottom:-4px;content:\" \";left:-4px;opacity:0;position:absolute;right:-4px;top:-4px;transform:scale(.86)}html.is-safari .theme-container:before{transform:none!important}body.animation-level-2 .theme-container:before{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.theme-container.active{pointer-events:none}.theme-container.active:before{opacity:1;transform:scale(1)}.theme-container .background-item{border-radius:inherit;height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.theme-emoticon{bottom:.5rem;height:1.75rem;pointer-events:none;position:absolute;width:1.75rem;z-index:1}html:not(.is-safari) .theme-emoticon{transform:scale(1);transform-origin:center bottom}body.animation-level-2 .theme-emoticon{transition:transform var(--transition-standard-in)}.theme-bubble{background-color:#fff;border-radius:1.75rem;height:1.25rem;pointer-events:none;position:absolute;width:2.5rem}.theme-bubble.is-out{background-color:var(--light-filled-message-out-primary-color);right:.375rem;top:.5rem}.theme-bubble.is-in{background-color:var(--message-background-color);left:.375rem;top:2rem}.popup{background-color:rgba(0,0,0,.3);bottom:0;box-shadow:none;display:flex;left:0;margin:0;max-width:none;opacity:0;overflow:auto;padding:1.875rem;position:fixed!important;right:0;top:0;transition-delay:0s,var(--popup-transition-time);transition-duration:var(--popup-transition-time),0s;transition-property:opacity,visibility;transition-timing-function:var(--popup-transition-function);-webkit-user-select:none;-moz-user-select:none;user-select:none;visibility:hidden;z-index:3}.popup.no-overlay{background-color:transparent;overflow:visible;padding:0}body.animation-level-0 .popup{transition:none}.popup.active{opacity:1;transition-delay:0s,0s;visibility:visible;z-index:4}.popup.active .popup-container,.popup.hiding .popup-container{transform:translate3d(var(--translateX),0,0)}[dir=ltr] .popup-title{padding-left:1.5rem;padding-right:1rem}[dir=rtl] .popup-title{padding-left:1rem;padding-right:1.5rem}.popup-title{flex:1;font-size:1.25rem;font-weight:var(--font-weight-bold);line-height:1;margin:0}.popup-title:first-child{padding-left:0}.popup-container{--translateX:0;-webkit-backface-visibility:hidden;backface-visibility:hidden;background-color:var(--surface-color);border-radius:10px;display:flex;flex-direction:column;margin:auto;overflow:hidden;padding:1rem;position:relative;transform:translate3d(var(--translateX),3rem,0);transition:transform var(--popup-transition-time) var(--popup-transition-function)}body.animation-level-0 .popup-container{transition:none}.popup-description .peer-title{font-weight:var(--font-weight-bold)}.popup-centerer{margin:auto}.popup-close{flex:0 0 auto;justify-self:center;z-index:3}.popup-header{align-items:center;display:flex;flex:0 0 auto;margin-bottom:2rem;position:relative}.popup-body{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.popup-body .scrollable{position:relative}.popup-body .scrollable-y-bordered:last-child{border-bottom:none}.popup-buttons{align-items:center;display:flex;flex-direction:row-reverse;height:3rem;justify-content:flex-start;padding:0 .5rem}.popup-buttons .btn{border-radius:10px;font-weight:var(--font-weight-bold);height:2.5rem;max-width:100%;overflow:hidden;padding:0 1rem;position:relative;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}[dir=ltr] .popup-buttons .btn+.btn{margin-right:.625rem}[dir=rtl] .popup-buttons .btn+.btn{margin-left:.625rem}.popup-avatar .popup-container{max-width:600px;padding:15px 16px 16px 24px}.popup-avatar .popup-container>button{bottom:20px;position:absolute;right:20px}.popup-avatar .popup-close{font-size:1.5rem;margin-top:4px}.popup-avatar .popup-header{margin-bottom:1px}[dir=ltr] .popup-avatar h6{text-align:left}[dir=rtl] .popup-avatar h6{text-align:right}.popup-avatar h6{font-size:1.25rem;margin:0 0 0 2rem}.popup-avatar .crop{border-radius:8px;max-height:100%;max-width:100%;padding:24px 54px 46px 46px}.popup-avatar .crop>img{display:none}.popup-avatar .crop img{border-radius:8px}.popup-new-media .popup-container{max-height:100%;max-width:420px;padding:12px 20px 32.5px;width:420px}.popup-new-media .popup-container img,.popup-new-media .popup-container video{border-radius:inherit}.popup-new-media .popup-header{align-items:center;flex:0 0 auto;flex-wrap:wrap;justify-content:space-between;margin-bottom:9px;padding:12px 20px 15px;position:relative}.popup-new-media .popup-header .btn-primary{border-radius:10px;font-size:var(--font-size-14);height:2.25rem;line-height:2.25rem;padding:0 1.375rem;text-transform:uppercase;width:auto}.popup-new-media .popup-close{margin:-1px 0 0 -4px}.popup-new-media .popup-photo{border-radius:10px;max-width:100%;overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.popup-new-media .scrollable{position:relative}.popup-new-media .input-field{flex:0 0 auto;margin-top:25px;width:100%}.popup-new-media .input-field-input{border-radius:10px;font-size:1rem}.popup-new-media .input-field-input[data-placeholder]:not(:focus):empty~label{opacity:0}.popup-new-media .input-field label{font-size:inherit}.popup-new-media .btn-menu-overlay{z-index:3}.popup-new-media .menu-send{top:calc(100% + .25rem);z-index:4}.popup-new-media.popup-send-photo .popup-container{max-width:25rem;padding:0;width:25rem}.popup-new-media.popup-send-photo .popup-container.border-top-offset .popup-input-container{overflow:visible;overflow:initial}.popup-new-media.popup-send-photo .popup-container.border-top-offset .popup-input-container:before{top:-8px}.popup-new-media.popup-send-photo .menu-send{bottom:3.5rem;right:.5rem;top:auto}.popup-new-media.popup-send-photo .popup-header{height:3.5rem;margin:0;padding:0 1rem}[dir=ltr] .popup-new-media.popup-send-photo .popup-title{padding-left:1.5rem}[dir=rtl] .popup-new-media.popup-send-photo .popup-title{padding-right:1.5rem}.popup-new-media.popup-send-photo .popup-close{margin:0}.popup-new-media.popup-send-photo .popup-body{position:relative}.popup-new-media.popup-send-photo .popup-body .scrollable{padding:0 .5rem}.popup-new-media.popup-send-photo .input-message-container{max-height:inherit;min-height:inherit}.popup-new-media.popup-send-photo .input-message-input{max-height:inherit!important}.popup-new-media.popup-send-photo .btn-primary{flex:0 0 auto;height:2.5rem;line-height:2.5rem;margin-bottom:.5rem;padding:0 1rem;text-transform:uppercase;width:auto}.popup-new-media.popup-send-photo .popup-input-container{--height:3.5rem;--max-height:8.375rem;align-items:flex-end;display:flex;flex:0 0 auto;justify-content:space-between;max-height:var(--max-height);min-height:var(--height);overflow:hidden;padding:0 .5rem;position:relative}.popup-new-media.popup-send-photo .popup-input-container:before{background-color:var(--border-color);content:\" \";height:1px;left:0;opacity:0;position:absolute;right:0;top:0}body.animation-level-2 .popup-new-media.popup-send-photo .popup-input-container:before{transition:opacity var(--transition-standard-in)}.popup-new-media.popup-send-photo .popup-input-container.has-border-top:before{opacity:1}.popup-new-media.popup-send-photo .checkbox-field{margin-bottom:0;margin-left:0}.popup-new-media.popup-send-photo .popup-item-album{position:relative}.popup-new-media.popup-send-photo .popup-item-album .album-item{position:absolute}.popup-new-media.popup-send-photo .popup-item-album img,.popup-new-media.popup-send-photo .popup-item-album video{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.popup-new-media.popup-send-photo .popup-photo>.popup-item-media{display:flex;justify-content:center;margin:0 auto}.popup-new-media.popup-send-photo .popup-photo>.popup-item-media img{-o-object-fit:contain;object-fit:contain}.popup-new-media.popup-send-photo .popup-photo>.popup-item{border-radius:inherit;overflow:hidden;position:relative}.popup-new-media.popup-send-photo .popup-photo>.popup-item+.popup-item{margin-top:.5rem}.popup-new-media.popup-send-photo .drop{border-radius:0}.popup-new-media.popup-send-photo .audio,.popup-new-media.popup-send-photo .document{--icon-margin:.5rem;--icon-size:3rem;--padding:.25rem;border-radius:10px;cursor:default;height:3.5rem;margin:0 .25rem}html.no-touch .popup-new-media.popup-send-photo .audio:active,html.no-touch .popup-new-media.popup-send-photo .audio:hover,html.no-touch .popup-new-media.popup-send-photo .document:active,html.no-touch .popup-new-media.popup-send-photo .document:hover{--message-background-color:var(--light-filled-secondary-text-color);background-color:var(--light-secondary-text-color)}.popup-new-media.popup-send-photo .document{max-width:100%;overflow:hidden}.popup-new-media.popup-send-photo .document.document-with-thumb{--icon-size:4.5rem;height:5rem}.popup-new-media.popup-send-photo .document-name{line-height:1.5;margin-bottom:.125rem;max-width:100%;overflow:hidden;text-overflow:ellipsis;width:100%}.popup-new-media.popup-send-photo .document-ico{border-radius:5px;font-size:16px;font-weight:400;letter-spacing:0;line-height:11px}.popup-create-contact .popup-container{padding:0 1rem 1rem!important}.popup-create-contact .popup-header{padding:0!important}.popup-create-contact .btn-primary{margin-bottom:0!important}.popup-create-contact .name-fields{display:flex;flex-direction:column;margin-top:1rem;padding-left:116px;position:relative}.popup-create-contact .name-fields .input-field:first-child{margin-top:0}.popup-create-contact .avatar-placeholder{left:0;position:absolute;top:50%;transform:translateY(-50%)}.popup-peer .popup-header{align-items:center;display:flex;height:2.5rem;margin:0;padding:0 1rem;width:-moz-max-content;width:max-content}.popup-peer .popup-container{max-width:min(400px,100%);min-width:min(100%,17.5rem);padding:.75rem .5rem;width:-moz-min-content;width:min-content}.popup-peer .popup-title{font-size:1.25rem;font-weight:var(--font-weight-bold)}.popup-peer .popup-title:not(:first-child){padding-left:1rem}.popup-peer .popup-description{line-height:var(--line-height);margin-bottom:0;margin-top:0;max-width:-moz-fit-content;max-width:fit-content;min-width:min(100%,15rem);overflow:hidden;padding:.625rem 1rem .5rem;text-overflow:ellipsis;word-break:break-word}.popup-peer .checkbox-field{align-items:center;display:flex;height:auto;margin:0;min-height:3rem;padding:.25rem 1.125rem}.popup-peer .checkbox-field .checkbox-box{left:auto}.popup-stickers{-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-stickers .sticker-set-footer{color:var(--primary-color);text-align:center}.popup-stickers .sticker-set-footer .btn-primary{height:44px;line-height:44px;padding:0 1.0625rem;text-transform:uppercase;width:auto}.popup-stickers .scrollable.is-loading{min-height:9rem;position:relative}.popup-stickers .sticker-set-footer{padding:8px 0}.popup-stickers .super-emojis{padding:0 .5rem}.popup-stickers .popup-container{max-height:420px;max-width:420px;padding:0;width:420px}[dir=ltr] .popup-stickers .popup-close{margin-left:1rem}[dir=rtl] .popup-stickers .popup-close{margin-right:1rem}.popup-stickers .popup-close{font-size:1.5rem}.popup-stickers .popup-header{flex:0 0 auto;margin:.625rem 0}.popup-stickers .sticker-set{margin:.0625rem 0}.popup-stickers .sticker-set .row-title{font-weight:var(--font-weight-bold)}.popup-stickers .sticker-set-stickers{--per-row:5;--item-size:var(--popup-sticker-size);display:grid;grid-template-columns:repeat(var(--per-row),1fr);padding:0 5px;position:relative}@media only screen and (max-width:600px){.popup-stickers .sticker-set-stickers{--per-row:4}}.popup-stickers .sticker-set-stickers .media-sticker-wrapper{cursor:pointer;height:var(--item-size);justify-self:center;margin-bottom:2px;position:relative;width:var(--item-size)}@media only screen and (max-width:600px){.popup-stickers .sticker-set-stickers .media-sticker-wrapper{margin-bottom:8px}}.popup-stickers .sticker-set-stickers .media-sticker-wrapper:hover{background-color:var(--light-secondary-text-color);border-radius:12px}.popup-date-picker{-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-date-picker .popup-container{padding:12px 14px}@media(min-height:470px){.popup-date-picker .popup-container[data-lines=\"7\"]{top:19px}.popup-date-picker .popup-container[data-lines=\"5\"]{top:-19px}}.popup-date-picker .popup-header{margin-bottom:1.375rem;margin-left:6px;margin-top:4px}.popup-date-picker .popup-title{font-size:20px;font-weight:var(--font-weight-bold)}.popup-date-picker .popup-buttons{margin-right:-2px;order:2}.popup-date-picker .popup-buttons button+button{margin-left:9px;margin-top:0}.popup-date-picker .date-picker-controls{align-items:center;display:flex;justify-content:space-between}.popup-date-picker .date-picker-controls .date-picker-month-title{font-size:14px;font-weight:var(--font-weight-bold)}.popup-date-picker .date-picker-prev{transform:rotate(90deg)}.popup-date-picker .date-picker-next{transform:rotate(-90deg)}.popup-date-picker .date-picker-next:disabled,.popup-date-picker .date-picker-prev:disabled{visibility:hidden}.popup-date-picker .date-picker-months{margin-bottom:1.5rem;margin-top:7px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-date-picker .date-picker-month{display:grid;grid-template-columns:repeat(7,1fr);justify-content:center;width:100%}.popup-date-picker .date-picker-month .btn-icon{align-items:center;color:var(--secondary-text-color);display:flex;font-size:12px;height:38px;justify-content:center;justify-self:center;width:38px}.popup-date-picker .date-picker-month .btn-icon:disabled{opacity:1}.popup-date-picker .date-picker-month-date:disabled{opacity:.7!important}.popup-date-picker .date-picker-month .btn-icon:not(:disabled){color:var(--primary-text-color)}.popup-date-picker .date-picker-month .btn-icon.active{background-color:var(--primary-color)!important;border-radius:50%;color:var(--badge-text-color)}.popup-schedule .popup-header{justify-content:space-between;margin-bottom:17px;margin-left:0;margin-top:5px}@media only screen and (max-width:600px){.popup-schedule .popup-header{margin-left:3px}}.popup-schedule .popup-header .btn-icon{font-size:22px}.popup-schedule .popup-container{min-width:420px;padding:4px 16px 16px;width:420px}@media only screen and (max-width:600px){.popup-schedule .popup-container{min-width:312px;padding:4px 14px 14px;width:312px}}.popup-schedule .popup-container[data-lines=\"5\"]{top:-16px}.popup-schedule .popup-container[data-lines=\"7\"]{top:16px}.popup-schedule .date-picker-month{margin-left:2px;margin-right:-20px;width:auto}@media only screen and (max-width:600px){.popup-schedule .date-picker-month{margin-left:0;margin-right:-6px}}.popup-schedule .date-picker-month-title{font-size:20px;font-weight:var(--font-weight-bold);margin-left:-5rem}@media only screen and (max-width:600px){.popup-schedule .date-picker-month-title{margin-left:-2rem}}.popup-schedule .date-picker-month .btn-icon{font-size:14px;font-weight:var(--font-weight-bold);height:36px;justify-self:auto;margin-top:-4px;width:36px}.popup-schedule .date-picker-month-date:disabled{color:#9ba3a8!important}.popup-schedule .date-picker-month-day{color:var(--primary-text-color)!important;font-size:14px!important;font-weight:var(--font-weight-bold)}.popup-schedule .date-picker-months{margin-bottom:14px}@media only screen and (max-width:600px){.popup-schedule .date-picker-months{margin-bottom:13px}}.popup-schedule .date-picker-time{display:flex;justify-content:center;margin-bottom:1.5rem}@media only screen and (max-width:600px){.popup-schedule .date-picker-time{margin-bottom:22px}}.popup-schedule .date-picker-time .input-field{width:80px}.popup-schedule .date-picker-time .input-field-input{text-align:center}.popup-schedule .date-picker-time-delimiter{padding:14px 20px}.popup-schedule .date-picker-controls .btn-icon:disabled{visibility:visible}.popup-schedule .btn-primary{font-weight:400}@media only screen and (max-width:600px){.popup-schedule .btn-primary{widtH:280px;height:50px;margin-left:2px}}.popup-create-poll .popup-container{max-height:min(640px,100%);padding:0}.popup-create-poll .radio-field{margin:0}.popup-create-poll .radio-field .radio-field-main:before{left:.25rem}.popup-create-poll .radio-field .radio-field-main:after{left:.5625rem}.popup-create-poll .hidden-widget .btn-icon,.popup-create-poll .radio-field:first-child:last-child .btn-icon{opacity:0!important;pointer-events:none}.popup-create-poll .input-field .btn-icon{opacity:1;position:absolute;right:.4375rem;top:.4375rem;transition:opacity .2s ease;z-index:1}@media only screen and (max-width:600px){.popup-create-poll .input-field .btn-icon{right:.3125rem;top:.3125rem}}.popup-create-poll .caption{color:var(--secondary-text-color);font-weight:var(--font-weight-bold);padding:1rem 1.5rem 0}.popup-create-poll .poll-create-questions{padding:0 1.25rem 1.5rem}.popup-create-poll .poll-create-questions:not(:last-child) .input-field-input{padding-right:3.25rem}.popup-create-poll .poll-create-settings{padding:0 .5rem .5rem}.popup-create-poll .subtitle{font-size:.875rem;line-height:1.2;margin-top:.875rem}.popup-create-poll .btn-primary{width:94px}.popup-create-poll .menu-send{right:20px;top:54px}.popup-create-poll hr:not(.hide){display:block!important}.popup-forward .popup-container{height:40.625rem;max-height:min(40.625rem,100%);max-width:420px;padding:7px 0 0;width:420px}.popup-forward .popup-header{flex:0 0 auto;margin-bottom:7px;padding:0 1rem}@media only screen and (max-width:600px){.popup-forward .popup-header{padding-left:.8125rem}}.popup-forward .popup-title{flex-grow:1;height:100%;padding:0}.popup-forward .chatlist-container,.popup-forward .selector{display:flex;flex:1 1 auto;flex-direction:row;height:auto;overflow:hidden;width:100%}.popup-forward .selector-search-input{font-size:var(--font-size-20);height:100%;line-height:1;padding:.5rem 1.5rem;width:100%}@media only screen and (max-width:600px){.popup-forward .selector-search-input{padding-left:1.1875rem}}.popup-forward .selector .chatlist{margin-top:0!important}.popup-forward .gradient-delimiter{display:none}.popup-forward .sidebar-left-section{margin-bottom:0!important;padding-top:0!important}.popup-instance-deactivated{background-color:rgba(0,0,0,.6)}.popup-instance-deactivated .instance-deactivated-container{margin:auto;pointer-events:none;text-align:center}.popup-instance-deactivated .header{color:#fff;font-size:2rem}.popup-instance-deactivated .subtitle{color:#fff;font-size:1.5rem;line-height:var(--line-height);opacity:.6}.popup-join-chat-invite{-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-join-chat-invite .popup-container{max-width:420px}.popup-join-chat-invite .popup-body{align-items:center;padding:.5rem 0 1.25rem}.popup-join-chat-invite .chat-title{font-weight:var(--font-weight-bold);line-height:var(--line-height);margin:.75rem 0 .25rem}.popup-join-chat-invite .chat-participants-count{color:var(--secondary-text-color);font-size:.875rem;line-height:var(--line-height)}.popup-join-chat-invite .request-caption{margin-top:1rem;text-align:center}.popup-report-messages-confirm{-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-report-messages-confirm .media-sticker-wrapper{height:100px;margin:0 auto;position:relative;width:100px}.popup-report-messages-confirm .popup-body{margin:1rem 0 .375rem;overflow:visible;overflow:initial}.popup-report-messages-confirm .popup-description{font-size:.875rem;text-align:center}.popup-report-messages-confirm .popup-buttons{margin-top:.625rem}.popup-report-messages-confirm .input-field{width:100%}.popup-call .popup-header{justify-content:space-between;width:100%}.popup-call .popup-title{flex:1 1 auto}.call{align-items:center;color:#fff;height:100%;width:100%}.call.is-full-screen,html.is-mobile .call{border-radius:0}.call.is-full-screen:not(.show-controls){cursor:none}.call.no-video .call-button,.call.no-video .call-button-text,.call.no-video .call-emojis,.call.no-video .call-party-state,.call.no-video .call-subtitle,.call.no-video .call-title,.call.no-video .popup-header,.call.show-controls .call-button,.call.show-controls .call-button-text,.call.show-controls .call-emojis,.call.show-controls .call-party-state,.call.show-controls .call-subtitle,.call.show-controls .call-title,.call.show-controls .popup-header{opacity:1}.call.show-controls .call-video{opacity:.8}.call.show-controls .call-video-blur{opacity:.56}.call .popup-header .btn-icon{color:#fff}.call .popup-header .call-emojis{margin-right:1rem;transform:scale(1.3125)}.call-avatar{border-radius:inherit;bottom:0;left:0;opacity:.7;position:absolute;right:0;top:0;z-index:-1}.call-avatar .avatar-full{font-size:6rem}.call-title{font-size:1.25rem;font-weight:var(--font-weight-bold)}.call-subtitle{font-size:1rem}.call .popup-header,.call-emojis,.call-subtitle,.call-title{opacity:0}body.animation-level-2 .call .popup-header,body.animation-level-2 .call-emojis,body.animation-level-2 .call-subtitle,body.animation-level-2 .call-title{transition:opacity var(--transition-standard-in)}.call-buttons{align-items:center;align-self:center;bottom:1.75rem;display:flex;pointer-events:none;position:absolute;z-index:1}.call-buttons .call-button{pointer-events:all}.call-buttons .call-button-container{--scale:1}.call-buttons .call-button-container.hide-me{--scale:0!important;transform:scale(var(--scale))}body.animation-level-2 .call-buttons .call-button-container.hide-me{transition:transform var(--transition-standard-in)}.call-buttons .call-button-container.hide-me .call-button,.call-buttons .call-button-container.hide-me .call-button-text{opacity:0}body.animation-level-2 .call-buttons .call-button,body.animation-level-2 .call-buttons .call-button-text{transition:opacity var(--transition-standard-in),transform var(--transition-standard-in)}.call-buttons.is-first .call-button,.call-buttons.is-first .call-button-text{transform:translateX(calc(var(--call-button-size)*-.5 + var(--call-button-margin)*-.5))}.call-buttons.is-second{--margin-length:2}.call-buttons.is-second .call-button,.call-buttons.is-second .call-button-text{transform:translateX(calc(var(--call-button-size)*2 + var(--call-button-margin)*var(--margin-length)))}.call.no-screen .call-buttons.is-second{--margin-length:.656875}.call-button{background-color:hsla(0,0%,100%,.1)}.call-button-red{background-color:var(--danger-color)!important}.call-button-green{background-color:var(--gc-green-text-color)!important}.call-button.active{background-color:#fff!important}.call-button.active:before{color:#9e9e9e}.call-button,.call-button-text{opacity:0}.call-video{border-radius:inherit;height:100%;-o-object-fit:contain;object-fit:contain;opacity:1;position:absolute;width:100%}.call-video-container{align-items:center;background-color:#000;bottom:0;display:flex;left:0;position:absolute;right:0;top:0;z-index:-1}.call-video-container.small{border-radius:10px;bottom:8rem;cursor:pointer;left:auto;right:1rem;top:auto;z-index:1}.call-video-blur{border-radius:inherit;height:100%;opacity:.7;position:absolute;width:100%}body.animation-level-2 .call-video,body.animation-level-2 .call-video-blur{transition:opacity var(--transition-standard-in)}.call .call-emojis{transform:scale(1.125)}.call .call-emojis .emoji{margin:0 .125rem}.call-party-states{align-items:center;bottom:calc(4.25rem + var(--call-button-size));display:flex;flex-direction:column;padding:0 1rem;pointer-events:none;position:absolute;width:100%;z-index:2}.call-party-state{align-items:center;-webkit-backdrop-filter:blur(25px);backdrop-filter:blur(25px);background-color:hsla(0,0%,100%,.2);border-radius:1.625rem;color:#fff;display:flex;font-size:.875rem;font-weight:var(--font-weight-bold);height:1.625rem;line-height:1.625rem;margin-top:1rem;max-width:100%;opacity:0;padding:0 .625rem;transform:scale(0) translateY(0)}body.animation-level-2 .call-party-state{transition:opacity var(--transition-standard-in),transform var(--transition-standard-in)}.call-party-state .rlottie-icon{flex:0 0 auto;height:1.875rem!important;margin-left:-.25rem;margin-right:.25rem;width:1.875rem!important}.call-party-state.is-visible:not(.backwards){transform:scale(1) translateY(0)}.call-party-state-text,.call-title{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.call.two-button-rows .call-buttons.is-first .call-button,.call.two-button-rows .call-buttons.is-first .call-button-text{transform:translateY(calc(var(--call-button-size)*-1 + var(--call-button-margin)*-1 + -1.125rem))}.call.two-button-rows .call-buttons.is-second .call-button,.call.two-button-rows .call-buttons.is-second .call-button-text{transform:translateX(0)}.popup-group-call:not(.movable-element){top:7rem}.popup-group-call:not(.movable-element) .group-call{border-bottom-left-radius:0;border-bottom-right-radius:0}.popup-group-call .popup-body{justify-content:space-between}.popup-group-call .popup-container{background-color:var(--gc-background-color);color:var(--gc-primary-text-color)}.popup-group-call .popup{z-index:6}.group-call{--call-button-margin:1.25rem;height:100%;padding:0 .5rem;width:100%}.group-call:after{background:linear-gradient(180deg,rgba(33,33,33,0) 0,rgba(33,33,33,.65) 48.54%,var(--gc-background-color) 100%);bottom:0;content:\" \";height:7.5rem;left:0;position:absolute;right:0}.group-call-header{height:3.5rem;margin-bottom:.125rem;padding:0 .5rem}.group-call-header .btn-icon{color:inherit;flex:0 0 auto}.group-call-header-info{flex:1 1 auto;margin-left:1.5rem;overflow:hidden}.group-call-header-title{font-weight:var(--font-weight-bold)}.group-call-header-subtitle,.group-call-header-title{font-size:var(--font-size-16);line-height:var(--line-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.group-call-header-subtitle{color:var(--gc-secondary-text-color);font-size:.875rem}.group-call-buttons{align-items:center;align-self:center;bottom:1.75rem;display:flex;justify-content:space-between;position:absolute;z-index:1}.group-call-button{background-color:var(--gc-button-unmuted-color);color:var(--gc-primary-text-color);opacity:1}.group-call[data-mic-state=muted] .group-call-button{background-color:var(--gc-button-muted-color)}.group-call[data-mic-state=hand] .group-call-button{background-color:var(--gc-button-hand-color)}.group-call:not(.is-big-layout)[data-mic-state=unmuted] .group-call-button{background-color:var(--gc-button-unmuted-fill-color)}.group-call-button-red{background-color:var(--gc-button-leave-color)!important}.group-call[data-mic-state=unmuted] .group-call-microphone-button{background:linear-gradient(230.46deg,#00a3b4 12.94%,#00cb47 86.29%)}.group-call[data-mic-state=muted] .group-call-microphone-button{background:linear-gradient(225deg,#4eabf8 14.73%,#3478f6 85.27%)}.group-call[data-mic-state=hand] .group-call-microphone-button{background:linear-gradient(225deg,#df44b8 14.73%,#3851eb 85.27%)}.group-call-participant-menu{z-index:5}.group-call-participant{padding-right:.5rem}.group-call-participant-status-icon{display:inline-block;font-size:1.125rem;height:1.125rem;line-height:1;margin-right:6px;vertical-align:middle;width:1.125rem}.group-call-participant-status-container{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.group-call-participant .dialog-subtitle,.group-call-participant .dialog-title{padding-right:2.5rem}.group-call-participant-muted-icon-container{position:absolute!important;right:.5rem}.group-call-participant-video-container{align-items:center;background-color:#000;border-radius:10px;cursor:pointer;display:flex;flex:1 1 auto;height:15rem;margin:.25rem;overflow:hidden;position:relative;width:100%;width:33%}.group-call-participant-video-container:after{background:linear-gradient(180deg,transparent 55.62%,rgba(0,0,0,.5) 86.46%);bottom:0;content:\" \";left:0;position:absolute;right:0;top:0}.group-call-participant-video-container .group-call-participant-status-icon{font-size:1.25rem;height:1.25rem;width:1.25rem}.group-call-participant-video-container:after,.group-call-participant-video-header,.group-call-participant-video-info{opacity:0}body.animation-level-2 .group-call-participant-video-container:after,body.animation-level-2 .group-call-participant-video-header,body.animation-level-2 .group-call-participant-video-info{transition:opacity var(--transition-standard-in)}.group-call-participant-video-header,.group-call-participant-video-info{align-items:center;bottom:.25rem;display:flex;justify-content:space-between;left:0;padding:0 .5rem 0 .75rem;position:absolute;right:0;z-index:1}.group-call-participant-video-header{bottom:auto;justify-content:flex-end;padding-right:.75rem;padding-top:.875rem;top:0}.group-call-participant-video-header .group-call-pin-icon{font-size:1.5rem;height:1.5rem;width:1.5rem}.group-call-participant-video-info .peer-title{font-weight:var(--font-weight-bold)}.group-call-participant-video-info .peer-title,.group-call-participant-video-info-left{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.group-call-participant-video-info .group-call-participant-status-container{margin-top:-1px;opacity:.6}.group-call-participant-video-info-left{flex:1 1 auto}.group-call-participant-video-info-right{flex:0 0 auto;height:2rem;margin-left:.75rem;width:2rem}.group-call-participant .is-speaking{color:var(--gc-green-text-color)}.group-call-participant .is-waiting{color:var(--gc-blue-text-color)}.group-call-participants{border-radius:10px;flex:1 1 auto;overflow:hidden}.group-call-participants-scrollable{border-radius:inherit;height:auto;padding-bottom:6rem;position:relative}.group-call-participants-video-container{display:flex;flex-wrap:wrap;margin:-.25rem -.25rem 0}.group-call-participants-video-container:not(.show-controls),.group-call-participants-video-container:not(.show-controls) .group-call-participant-video-container{cursor:none}.group-call-participants-video-container:empty{display:none}.group-call-participants-video-container[data-layout=\"3\"] .group-call-participant-video-container:first-child{width:100%}.group-call-participants-video-container[data-layout=\"3\"] .group-call-participant-video-container:nth-child(n+2),.group-call-participants-video-container[data-layout=\"4\"] .group-call-participant-video-container{flex:1 0 auto;height:auto}.group-call-participants-video-container[data-layout=\"3\"] .group-call-participant-video-container:nth-child(n+2):before,.group-call-participants-video-container[data-layout=\"4\"] .group-call-participant-video-container:before{content:\" \";display:block;padding-top:100%}.group-call-participants-video-container.show-controls .group-call-participant-video-container:after,.group-call-participants-video-container.show-controls .group-call-participant-video-header,.group-call-participants-video-container.show-controls .group-call-participant-video-info{opacity:1}.group-call-participants .chatlist{background:none;margin:0 auto;max-width:600px;padding:0}.group-call-participants .user-title{color:var(--gc-primary-text-color)}.group-call-participants .user-last-message{color:var(--gc-secondary-text-color)}.group-call-big-video-container{position:relative}.group-call-big-video-container .group-call-participants-video-container{margin-bottom:.25rem;min-height:100%}.group-call-big-video-container .group-call-participant-video-container{height:auto}.group-call-big-video-container .group-call-participant-video-container:before{padding-top:56.25%!important}.group-call-cfs,.group-call:not(.is-big-layout) .group-call-big-video-container,.group-call:not(.is-big-layout) .popup-body .group-call-header,.group-call:not(.is-big-layout).has-pinned .group-call-participant-video-container:not(.video-hidden){display:none}.group-call.is-full-screen{border-radius:0}.group-call.is-big-layout>.group-call-header,.group-call.is-full-screen>.group-call-header{padding:0 1rem}.group-call.is-big-layout:not(.is-full-screen){--gc-right-column-width:17.5rem}.group-call.is-big-layout:not(.is-full-screen) .group-call-cfs{display:flex}.group-call.is-big-layout{background-color:#000}.group-call.is-big-layout:after{content:none}html.no-touch .group-call.is-big-layout>.group-call-header .btn-icon:active,html.no-touch .group-call.is-big-layout>.group-call-header .btn-icon:hover{background-color:hsla(207,4%,46%,.3)}.group-call.is-big-layout .video-hidden{display:none}.group-call.is-big-layout.is-right-column-shown .popup-body{right:0}.group-call.is-big-layout.is-right-column-shown .group-call-big-video-container{width:calc(100% - var(--gc-right-column-width))}.group-call.is-big-layout.is-right-column-shown .group-call-buttons{transform:translateX(calc(var(--gc-right-column-width)/-2))}.group-call.is-big-layout.is-right-column-shown .popup-container{--translateX:calc(var(--gc-right-column-width)/-2)}.group-call.is-big-layout .group-call-header-title{font-size:1.25rem}.group-call.is-big-layout .popup-body{background-color:var(--gc-background-color);bottom:0;padding:inherit;position:absolute;right:calc(var(--gc-right-column-width)*-1);top:0;width:var(--gc-right-column-width)}.group-call.is-big-layout .group-call-buttons{bottom:2.5rem;padding:.75rem}body.animation-level-2 .group-call.is-big-layout .group-call-buttons{transition:opacity var(--transition-standard-in)}.group-call.is-big-layout .group-call-buttons:before{-webkit-backdrop-filter:blur(100px);backdrop-filter:blur(100px);background:rgba(0,0,0,.5);border-radius:1.25rem;bottom:0;content:\" \";left:0;position:absolute;right:0;top:0}.group-call.is-big-layout .group-call-buttons .group-call-button,.group-call.is-big-layout .group-call-buttons:before{opacity:0}.group-call.is-big-layout .group-call-buttons.show-controls .group-call-button,.group-call.is-big-layout .group-call-buttons.show-controls:before{opacity:1}body.animation-level-2 .group-call.is-big-layout .group-call-buttons:before{transition:opacity var(--transition-standard-in)}body.animation-level-2 .group-call.is-big-layout .group-call-buttons .group-call-button{transition:opacity var(--transition-standard-in),background-color var(--transition-standard-in)}.group-call.is-big-layout .group-call-participants-scrollable{padding-bottom:.5rem}.group-call.is-big-layout .group-call-header-subtitle{display:none}.popup-sponsored .scrollable-y{margin:0 -1.5rem;max-height:25rem;padding:.5rem 1.5rem;position:relative;-webkit-user-select:text;-moz-user-select:text;user-select:text;width:calc(100% + 3rem)}.popup-mute .popup-container{min-width:16rem}.popup-reacted-list{--size:1.5rem;--custom-emoji-size:var(--size)}.popup-reacted-list .popup-container{height:600px;max-height:600px;padding:0;width:25rem}.popup-reacted-list .popup-header{border-bottom:1px solid var(--border-color);margin:0;min-height:3.5625rem;padding:.25rem .75rem .75rem}.popup-reacted-list .popup-close{height:40px;margin-right:.5rem;margin-top:.375rem;order:-1}.popup-reacted-list .reaction{--reaction-size:var(--size);--additional-height:.75rem;--margin:.5rem;--background-color:var(--light-filled-primary-color);--counter-color:var(--primary-color);flex:1 0 auto;justify-content:space-evenly}.popup-reacted-list .reaction.is-chosen:not(.backwards){--counter-color:#fff}.popup-reacted-list .reaction-sticker-icon{align-items:center;display:flex;font-size:1.25rem!important;margin:0}.popup-reacted-list .sidebar-left-section{margin-bottom:0!important}.popup-reacted-list .tabs-container{flex:1 1 auto;overflow:hidden}.popup-reacted-list .tabs-tab{background-color:var(--surface-color)}.popup-reacted-list .reacted-list-reaction-icon{display:flex;height:var(--size);position:absolute;right:1rem;top:50%;transform:translateY(-50%);width:var(--size)}.popup-reacted-list .chatlist-chat{padding-right:3.25rem!important}.popup-payment .popup-container{border-radius:16px;max-height:min(100%,43.5rem);max-width:26.25rem;padding:0;width:26.25rem}.popup-payment .popup-header{height:3.5rem;margin:0;padding:0 1rem}.popup-payment.is-loading .popup-container{min-height:26.25rem}.popup-payment .scrollable{display:flex;flex:1 1 auto;flex-direction:column}.popup-payment hr{display:block!important;margin:.5rem 0!important;padding:0!important}.popup-payment .input-field{--height:3rem;margin:.75rem .5rem 0}.popup-payment .input-field-input{--padding:.75rem}.popup-payment .input-fields-row .input-field{margin-top:1.25rem}.popup-payment .sidebar-left-section{padding:0!important}.popup-payment .sidebar-left-section-name+.input-field,.popup-payment .sidebar-left-section-name+.input-fields-row .input-field{margin-top:.75rem}.popup-payment .sidebar-left-section .row{margin-top:.5rem}.popup-payment .sidebar-left-section-content{margin:0 .5rem!important}.popup-payment .select-wrapper{box-shadow:var(--menu-box-shadow);max-height:10rem}.popup-payment .select-wrapper li{grid-template-columns:calc(26px + 2rem) 1fr;height:3rem}.popup-payment .payment-verification{border:none;flex:1 1 auto;height:40rem;max-height:100%;width:100%}.popup-payment .row{border-radius:10px}.payment-item{padding:0 1.25rem;width:100%}.payment-item-details{display:flex;flex:0 0 auto;justify-content:space-between;margin-bottom:1rem;overflow:hidden}.payment-item-details:last-child{margin-bottom:0}.payment-item-details-photo{border-radius:10px;flex:0 0 auto;height:6.25rem;margin-right:1rem;width:6.25rem}.payment-item-details-photo .media-photo{border-radius:inherit}.payment-item-details-lines{display:flex;flex:1 1 auto;flex-direction:column}.payment-item-details-lines-title{font-size:var(--font-size-16);font-weight:var(--font-weight-bold);line-height:var(--line-height-16)}.payment-item-details-lines-bot-name,.payment-item-details-lines-description{font-size:var(--font-size-14);line-height:1.25rem}.payment-item-details-lines-bot-name{color:var(--secondary-text-color)}.payment-item-prices{display:flex;flex-direction:column;margin:1rem .25rem .5rem}.payment-item-prices-price{color:var(--secondary-text-color);display:flex;font-weight:500;justify-content:space-between;line-height:1.1875rem}.payment-item-prices-price+.payment-item-prices-price{margin-top:1.5rem}.payment-item-prices-price.is-total{color:var(--primary-text-color)}.payment-item-tips{display:flex;justify-content:space-between;margin:.75rem -.5rem 1.5rem}.payment-item-tips-tip{--background-intensity:.1;background-color:rgba(84,190,97,var(--background-intensity));border-radius:1.25rem;color:#3ba748;flex:1 1 auto;font-size:var(--font-size-16);font-weight:var(--font-weight-bold);height:2.5rem;line-height:2.5rem;text-align:center}body.animation-level-2 .payment-item-tips-tip{transition:color .1s ease-in-out,background-color .1s ease-in-out}.payment-item-tips-tip+.payment-item-tips-tip{margin-left:.5rem}html.no-touch .payment-item-tips-tip:not(.active):active,html.no-touch .payment-item-tips-tip:not(.active):hover{--background-intensity:.3}.payment-item-tips-tip.active{--background-intensity:1;color:#fff}.payment-item-tips-input{color:inherit!important;display:inline;font-weight:inherit!important}.payment-item-row{margin:0 .5rem;padding-bottom:0;padding-top:0}.payment-item-method-row .media-photo{border-radius:10px}.payment-item-pay{flex:0 0 auto;height:3rem;margin:1rem;text-transform:uppercase;width:auto}.payment-item-preloader-container{flex:1 1 auto;position:relative}.popup-payment-shipping-methods .popup-container{min-height:auto}.popup-payment-shipping-methods .row{margin-top:0!important}.popup-payment-verification .popup-header:after{background-color:var(--border-color);bottom:-1px;content:\" \";height:1px;left:0;position:absolute;right:0}.popup-payment-card-confirmation .popup-container{min-height:auto}.popup-payment-card-confirmation .input-field-password{margin-top:.5rem!important}.popup-limit .popup-container{min-width:min(100%,22.5rem)}.popup-limit-line{align-items:center;display:flex;flex-direction:column;margin:.75rem 0}.popup-limit-hint{align-items:center;color:#fff;display:flex;font-weight:var(--font-weight-bold);justify-content:center;transform:scale(.6) translate(-280px,16px) rotate(-30deg)}body.animation-level-2 .popup-limit-hint{transition:transform .3s cubic-bezier(.12,1.1,.56,1.2)}.popup-limit-hint.active{transform:scale(1) translate(0) rotate(0)}.popup-limit-hint-icon{display:flex;font-size:1.25rem;margin-right:.25rem}.popup-limit-button.primary{align-items:center;background:linear-gradient(88.39deg,#6c93ff -2.56%,#976fff 51.27%,#df69d1 107.39%);color:#fff!important;display:flex}.popup-limit-button-icon{display:flex;font-size:1.5rem;margin-left:.625rem}.popup-limit .limit-line{align-self:stretch;margin:1rem .5rem 0}.popup-limit:not(.is-locked) .popup-limit-hint{background:linear-gradient(73.4deg,#6c93ff -7.21%,#976fff 114.57%,#df69d1 241.52%);background-size:200px 2rem;border-radius:1rem;height:2rem;padding:0 .75rem;position:relative}.popup-limit:not(.is-locked) .popup-limit-hint:after{background:inherit;background-position-x:calc(-50% - 86px);background-repeat:no-repeat;background-size:inherit;bottom:-9px;-webkit-clip-path:path(\"M0 0H26H24.4853C22.894 0 21.3679 0.632141 20.2426 1.75736L14.4142 7.58579C13.6332 8.36684 12.3668 8.36683 11.5858 7.58579L5.75736 1.75736C4.63214 0.632139 3.10602 0 1.51472 0H0Z\");clip-path:path(\"M0 0H26H24.4853C22.894 0 21.3679 0.632141 20.2426 1.75736L14.4142 7.58579C13.6332 8.36684 12.3668 8.36683 11.5858 7.58579L5.75736 1.75736C4.63214 0.632139 3.10602 0 1.51472 0H0Z\");content:\" \";display:block;height:9px;left:50%;margin-left:-13px;position:absolute;width:100%}.popup-limit.is-locked .popup-limit-hint{background-color:var(--primary-color);border-radius:1.375rem;height:2.75rem;margin-right:-.25rem;padding:0 1.25rem 0 1rem}.popup-limit.is-premium .popup-limit-hint{align-self:flex-end;background:linear-gradient(84.4deg,#6c93ff -4.85%,#976fff 51.72%,#df69d1 110.7%);background-position-x:100%;background-size:200px 2rem;border-bottom-right-radius:0;margin-right:.5rem}body.animation-level-2 .popup-limit.is-premium .popup-limit-hint{transition:transform .3s cubic-bezier(.12,1.1,.56,1.1)}.popup-limit.is-premium .popup-limit-hint:after{background-position-x:134%;bottom:-11.3px;-webkit-clip-path:path(\"M8.44528 0.5H20.5V10.1943C20.5 10.9154 19.9154 11.5 19.1943 11.5C18.8178 11.5 18.4597 11.3375 18.2117 11.0541L10.2274 1.92918C9.75146 1.38523 9.18812 0.924478 8.56057 0.565879L8.44528 0.5Z\");clip-path:path(\"M8.44528 0.5H20.5V10.1943C20.5 10.9154 19.9154 11.5 19.1943 11.5C18.8178 11.5 18.4597 11.3375 18.2117 11.0541L10.2274 1.92918C9.75146 1.38523 9.18812 0.924478 8.56057 0.565879L8.44528 0.5Z\");height:12px;left:100%;margin-left:-20.6px}.popup-gift-premium .popup-container{border-radius:16px;max-height:min(100%,43.5rem);max-width:26.25rem;padding:0;width:26.25rem}.popup-gift-premium .popup-header{height:3.5rem;margin:0 0 -2rem;padding:0 1rem}.popup-gift-premium .scrollable-y{flex:1 1 auto;padding:0 1rem 1rem}.popup-gift-premium-avatar{display:block;margin:0 auto}.popup-gift-premium-subtitle,.popup-gift-premium-title{display:block;text-align:center}.popup-gift-premium-title{font-size:var(--font-size-20);font-weight:var(--font-weight-bold);margin:.75rem 0}.popup-gift-premium-options{display:flex;flex-direction:column;margin:.5rem 0 1rem}.popup-gift-premium-option{margin-top:.5rem}.popup-gift-premium-option:first-child{--primary-color:#c564f3}.popup-gift-premium-option:nth-child(2){--primary-color:#ac64f3}.popup-gift-premium-option:nth-child(3){--primary-color:#9377ff}.popup-gift-premium-discount{background-color:var(--primary-color);border-radius:6px;color:#fff;display:inline-block;height:20px;line-height:20px;margin-right:.375rem;padding:0 .3125rem}.popup-gift-premium-confirm{--ripple-color:hsla(0,0%,100%,.08);background:linear-gradient(88.39deg,#6c93ff -2.56%,#976fff 51.27%,#df69d1 107.39%)!important;color:#fff;font-weight:var(--font-weight-bold);text-transform:uppercase}html.no-touch .popup-gift-premium-confirm:active:after,html.no-touch .popup-gift-premium-confirm:hover:after{background-color:#fff;bottom:0;content:\" \";left:0;opacity:.08;position:absolute;right:0;top:0}#auth-pages{background:var(--surface-color);max-width:100%;overflow:hidden}#auth-pages .btn-primary{text-transform:uppercase}@media only screen and (max-width:600px){#auth-pages .btn-primary{height:50px}}#auth-pages .subtitle{margin:0}@media only screen and (max-width:600px){#auth-pages .subtitle{font-size:14px}}#auth-pages .input-wrapper{margin-top:49px}@media only screen and (max-width:600px){#auth-pages .input-wrapper{margin-top:41px;padding:0 16px;width:100%}}#auth-pages .auth-image,#auth-pages .input-wrapper,#auth-pages .subtitle{flex:0 0 auto}#auth-pages>.scrollable{display:flex;flex-direction:column;margin:0 auto;max-width:720px;position:relative}#auth-pages>.scrollable .auth-placeholder{flex:1;min-height:3rem;width:100%}@media screen and (max-height:810px){#auth-pages>.scrollable .auth-placeholder:last-child{display:none}}#auth-pages .tabs-container{margin:0 auto;max-width:720px;min-width:auto;position:relative}#auth-pages .tabs-container .tabs-tab{background-color:var(--surface-color)}#auth-pages .tabs-container .tabs-tab .container{display:flex;flex:1 1 auto;flex-direction:column;height:810px;padding:0;width:100%}@media screen and (max-height:810px){#auth-pages .tabs-container .tabs-tab .container{height:760px}}@media only screen and (max-width:600px){#auth-pages .page-password .input-wrapper{margin-top:31px}}#auth-pages .page-password .input-wrapper .btn-primary{margin-top:1rem}.page-sign .checkbox-field{margin-bottom:.5rem;margin-top:.5rem}.page-sign .auth-image,.page-signUp .auth-image{height:7.5rem;margin-bottom:1.5rem;width:7.5rem}@media only screen and (min-width:601px){.page-sign .auth-image,.page-signUp .auth-image{height:10rem;margin-bottom:1.5rem;width:10rem}}.page-authCode .phone-wrapper{flex:0 0 auto}.sign-logo{fill:var(--primary-color);max-height:100%;max-width:100%}.page-sign .btn-secondary,.page-signQR .btn-secondary{font-weight:400}.page-sign .qr,.page-signQR .qr{margin-top:1.5rem}.page-signQR{overflow:visible!important;overflow:initial!important}.page-signQR .auth-image{align-items:center;display:flex;height:240px!important;justify-content:center;width:240px!important}.page-signQR .auth-image .preloader{left:auto;top:auto;transform:none}.page-signQR .auth-image .qr-canvas{height:100%;width:100%}.page-signQR .auth-image .qr-canvas+.qr-canvas{display:none}.page-signQR .input-wrapper{margin-top:1rem!important}.page-signQR h4{flex:0 0 auto}[dir=ltr] .page-signQR .qr-description{text-align:left}[dir=rtl] .page-signQR .qr-description{text-align:right}.page-signQR .qr-description{line-height:var(--line-height);margin:1rem auto;max-width:480px}.page-signQR .qr-description li{margin-top:.5rem}.page-signUp .auth-image{margin-bottom:14px;margin-top:10px}@media only screen and (max-width:600px){.page-signUp .auth-image{margin-bottom:24px}}.page-signUp .fullName{flex:0 0 auto}@media only screen and (max-width:600px){.page-signUp #signUp{margin-top:100px}}.page-signUp .input-field{text-align:left;text-align:initial}.page-sign .btn-primary{margin-top:1.1875rem}#auth-pages>.scrollable,#main-columns{opacity:1;transition:opacity var(--transition-standard-in)}.page-authCode .auth-image{transform:translateY(12px)}.page-authCode .phone-wrapper{align-items:center;display:flex;justify-content:center;margin:1.375rem 0 .875rem}.page-authCode .phone-wrapper h4[contenteditable]{border:none;border-bottom:2px solid var(--primary-color);outline:none;padding:0 1rem}.page-authCode .phone-wrapper .phone.error{border-color:var(--danger-color)!important}.page-authCode .phone-wrapper .phone{margin:0}.page-authCode .subtitle{margin:0 auto!important;max-width:300px}.page-chats{display:flex;max-width:1682px!important}.page-chats #main-columns{height:100%;max-height:100%;min-height:100%;overflow:hidden;position:relative;width:100%}@media only screen and (max-width:600px){.page-chats .main-column{display:flex!important;width:100%;z-index:1}}@media only screen and (min-width:601px){.page-chats #column-center{background-color:#e6ebee;display:flex!important;width:100%}.page-chats #column-right{display:flex!important}.page-chats .main-column{height:100%;max-height:100%;min-height:100%;position:relative}.page-chats #main-columns{display:flex}}.page-chats #search-container,.page-chats .sidebar-search{flex-direction:column;height:100%;left:0;max-height:100%;overflow:hidden;position:absolute;top:0;width:100%;z-index:3}@media only screen and (min-width:1681px){.page-chats{border-color:var(--border-color);border-style:solid;border-width:0 1px}}.page-chats .avatar-edit{flex:0 0 auto;height:120px;margin:1rem auto 2rem;width:120px}body.animation-level-2 .page-chats .main-column{transition:transform var(--tabs-transition),filter var(--tabs-transition)}body,html{height:100%;margin:0;overflow:hidden;padding:0;width:100%}@media only screen and (max-width:600px){body,html{height:calc(var(--vh, 1vh)*100)}}html.is-ios{-webkit-touch-callout:none;position:fixed;-webkit-user-select:none}html.no-backdrop{--menu-background-color:var(--surface-color);--menu-backdrop-filter:none}@supports(padding:max(0px)){html{padding:0 min(16px,env(safe-area-inset-right)) 0 min(16px,env(safe-area-inset-left))}}html{-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);font-size:16px}body{background-color:var(--body-background-color);color:var(--primary-text-color)}body.deactivated{animation:grayscale-in var(--transition-standard-in) forwards}body.deactivated-backwards{animation:grayscale-out var(--transition-standard-out) forwards}@keyframes grayscale-in{0%{filter:grayscale(0)}to{filter:grayscale(1)}}@keyframes grayscale-out{0%{filter:grayscale(1)}to{filter:grayscale(0)}}a{color:var(--link-color)}button,html,input,optgroup,select,textarea{font-family:Roboto,-apple-system,apple color emoji,BlinkMacSystemFont,Segoe UI,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}a,button,div,input,select,textarea{-webkit-tap-highlight-color:rgba(0,0,0,0)}code,kbd,pre,samp{font-family:var(--font-monospace)}.whole{height:100%;margin:0 auto;max-width:1680px;min-height:100%;width:100%}@media only screen and (min-width:601px){.only-handhelds{display:none!important}}.container{margin:0 auto}h1,h2,h3,h4,h5,h6{font-weight:var(--font-weight-bold)}h4{font-size:2rem;line-height:110%;margin:22px 0 14px}@media only screen and (max-width:600px){h4{font-size:20px;margin:2px 0 8px}}[contenteditable=true],input{background-color:transparent;caret-color:var(--primary-color);color:var(--primary-text-color)}input,textarea{-webkit-appearance:none}input::-webkit-contacts-auto-fill-button,input::-webkit-credentials-auto-fill-button{position:absolute;right:0;visibility:hidden}input:-webkit-autofill:first-line{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,Helvetica Neue,Arial;font-size:16px}.subtitle{color:var(--secondary-text-color);line-height:1.35}.danger{color:var(--danger-color)!important}.danger .c-ripple__circle{background-color:var(--light-danger-color)}.blue,.primary{color:var(--primary-color)!important}.blue .c-ripple__circle,.primary .c-ripple__circle{background-color:var(--light-primary-color)}.primary-text{color:var(--primary-text-color)!important}.color-premium{-webkit-text-fill-color:transparent;background:var(--premium-gradient);-webkit-background-clip:text}.blue:before,.danger:before,.primary:before{color:inherit!important}.bg-warning{background:#fed85a!important}.contextmenu{bottom:auto!important;position:fixed!important;right:auto!important;width:auto!important;z-index:4!important}.preloader{height:50px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:50px}.preloader .preloader-path{stroke:var(--primary-color)}@keyframes thumbnail-fade-in-opacity{0%{opacity:0}to{opacity:.8}}@keyframes fade-in-opacity{0%{opacity:0}to{opacity:1}}@keyframes fade-out-opacity{0%{opacity:1}to{opacity:0}}@keyframes fade-in-backwards-opacity{0%{opacity:1}to{opacity:0}}@keyframes fade-out-backwards-opacity{0%{opacity:0}to{opacity:1}}@keyframes fade-in-opacity-fade-out-opacity{0%{opacity:0}10%{opacity:1}50%{opacity:1}to{opacity:0}}.toast{-webkit-backdrop-filter:blur(25px);backdrop-filter:blur(25px);background-color:rgba(0,0,0,.66);border-radius:10px;color:#fff;font-size:1rem;left:50%;max-width:min(30rem,calc(100vw - 2rem));opacity:0;padding:.5rem 1rem;position:fixed;top:50%;transform:translate(-50%,-50%);z-index:5}.toast.is-visible{opacity:1}body.animation-level-2 .toast{transition:opacity var(--transition-standard-in)}.toast b{color:inherit}.toast a{color:#60a5e9!important;cursor:pointer}hr{border:none;border-top:1px solid var(--border-color);margin:0;padding-bottom:.5rem;width:100%}b{font-weight:var(--font-weight-bold)}.avatar-edit{border-radius:50%;cursor:pointer;overflow:hidden;position:relative}.avatar-edit.is-forum{border-radius:var(--avatar-border-radius-forum)}.avatar-edit-canvas{background:linear-gradient(var(--avatar-color-top),var(--avatar-color-bottom));height:100%;max-height:100%;max-width:100%;width:100%}html.no-touch body.animation-level-2 .avatar-edit .tgico-cameraadd{transform:translateY(-50%) translateX(-50%) scale(1);transition:transform .2s ease-in-out}html.no-touch body.animation-level-2 .avatar-edit:hover .tgico-cameraadd{transform:translateY(-50%) translateX(-50%) scale(1.2)}.avatar-edit .tgico-cameraadd{color:#fff;font-size:3rem;height:3rem;left:50%;line-height:1;position:absolute;top:50%;transform:translateY(-50%) translateX(-50%);width:3rem;z-index:2}.avatar-edit .avatar-placeholder{filter:brightness(.7);height:100%;left:0;position:absolute;top:0;width:100%}.missing-icon{height:1.5rem;width:1.5rem}.missing-icon-path{fill:currentColor}.select-wrapper{background-color:var(--surface-color);border-radius:10px;display:flex;flex-direction:column;flex-wrap:wrap;left:0;max-height:23.5rem;opacity:0;overflow:hidden;position:absolute;top:calc(100% + .5rem);transform:scale(.95);transform-origin:top center;transition:opacity .2s ease-out,transform .2s ease-out;width:100%;z-index:3}.select-wrapper.active{opacity:1;transform:scale(1)}.select-wrapper ul{margin:.5rem 0}[dir=ltr] .select-wrapper li{text-align:left}[dir=rtl] .select-wrapper li{text-align:right}.select-wrapper li{align-items:center;cursor:pointer;display:grid;grid-template-columns:calc(26px + 2rem) 1fr 80px;height:3.5rem;justify-content:space-between;padding:0 1rem}html.no-touch .select-wrapper li:active,html.no-touch .select-wrapper li:hover{background-color:var(--light-secondary-text-color)}.select-wrapper .emoji{font-size:26px;height:26px;line-height:1;width:26px}.select-wrapper .scrollable{position:relative}[dir=ltr] .phone-code{text-align:right}[dir=rtl] .phone-code{text-align:left}.phone-code{color:#9e9e9e}.auth-image{height:166px;margin:0 auto 18px;position:relative;width:166px}@media only screen and (max-width:600px){.auth-image{height:120px;width:120px}}[dir=ltr] .phone-edit{margin-left:.4rem}[dir=rtl] .phone-edit{margin-right:.4rem}.phone-edit{cursor:pointer;font-size:1.5rem;height:1.5rem;line-height:1;opacity:.5;transition:opacity .2s;width:1.5rem}html.no-touch .phone-edit:active,html.no-touch .phone-edit:hover{opacity:1}span.emoji{display:inline!important;font-family:apple color emoji,segoe ui emoji,noto color emoji,android emoji,emojisymbols,emojione mozilla,twemoji mozilla,segoe ui symbol;line-height:1!important;vertical-align:baseline!important;vertical-align:initial!important}@media not screen and (-webkit-min-device-pixel-ratio:2),not screen and (min-device-pixel-ratio:2),not screen and (min-resolution:192dpi),not screen and (min-resolution:2dppx){html[dir=ltr]:not(.is-safari) span.emoji{margin-right:5px!important}html[dir=rtl]:not(.is-safari) span.emoji{margin-left:5px!important}html[dir=ltr]:not(.is-safari) avatar-element span.emoji{margin-right:0!important}html[dir=rtl]:not(.is-safari) avatar-element span.emoji{margin-left:0!important}}img.emoji{display:inline-block;height:18px;max-height:100%;max-width:100%;vertical-align:middle;width:18px}[contenteditable=true]{cursor:text;outline:none;-webkit-user-select:text;-moz-user-select:text;user-select:text;white-space:pre-wrap}[contenteditable=true] .custom-emoji{display:inline-block;margin-bottom:-2px}[contenteditable=true] .custom-emoji:before{content:none}[contenteditable=true] [style*=markup]{font-family:inherit!important}[contenteditable=true] [style*=bold]{font-weight:700}[contenteditable=true] [style*=italic]{font-style:italic}[contenteditable=true] [style*=underline]{text-decoration-line:underline}[contenteditable=true] [style*=strikethrough]{text-decoration-line:line-through}[contenteditable=true] [style*=underline][style*=strikethrough]{text-decoration-line:underline line-through}[contenteditable=true] [style*=monospace]{font-family:var(--font-monospace)!important}[contenteditable=true] [style*=spoiler]{background-color:var(--spoiler-draft-background-color)}[contenteditable][data-placeholder]:before{color:#a2acb4;content:attr(data-placeholder);display:block;opacity:0;pointer-events:none;position:absolute}body.animation-level-2 [contenteditable][data-placeholder]:before{transform:translateX(1.75rem);transition:opacity var(--input-transition) .01s,transform var(--input-transition) .01s}[contenteditable][data-placeholder]:empty:before{opacity:1}body.animation-level-2 [contenteditable][data-placeholder]:empty:before{transform:translateX(0)}.sticky_sentinel{left:0;pointer-events:none;position:absolute;right:0;visibility:hidden}.super-stickers{display:grid;grid-template-columns:repeat(auto-fill,var(--esg-sticker-size));justify-content:space-between;width:100%}html.no-touch .super-sticker:active,html.no-touch .super-sticker:hover{background-color:var(--light-secondary-text-color);border-radius:10px}.fade-in-transition{opacity:1}body.animation-level-2 .fade-in-transition{transition:opacity .2s ease-in-out}.show-more{cursor:pointer;padding-bottom:13px;padding-top:13px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media only screen and (min-width:601px){[dir=ltr] .show-more{padding-left:8px}[dir=rtl] .show-more{padding-right:8px}}[dir=ltr] .show-more .tgico-down{padding-left:1rem;padding-right:2rem}[dir=rtl] .show-more .tgico-down{padding-left:2rem;padding-right:1rem}.show-more .tgico-down{float:left;font-size:24px}.content-empty,.show-more .tgico-down{color:var(--secondary-text-color)}::-moz-selection{background:var(--selection-background-color)}.selection:after,::selection{background:var(--selection-background-color)}.selection:after{bottom:0;content:\" \";left:0;position:absolute;right:0;top:0}.input-something{display:inline-block}.input-selectable{position:relative}@keyframes grow-icon{0%{opacity:.8;transform:scale(.5)}50%{opacity:1;transform:scale(1.1)}to{transform:scale(1)}}@keyframes hide-icon{0%{opacity:.4;transform:scale(1)}to{opacity:0;transform:scale(.5)}}.popup-disable-password .popup-description,.popup-skip-email .popup-description{max-width:284px}.grid{grid-gap:.25rem;display:grid;grid-auto-rows:1fr;grid-template-columns:repeat(3,1fr);width:100%}.grid-item{cursor:pointer;height:0;padding-bottom:100%;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-item-media{height:100%;left:0;-o-object-fit:cover;object-fit:cover;position:absolute;top:0;width:100%}.animated-super-row{--translateY:100%;bottom:0;left:0;position:absolute;right:0;top:0;transition:transform var(--pm-transition),opacity var(--pm-transition)}body.animation-level-0 .animated-super-row{transition:none}.animated-super-row.is-hiding{opacity:0}.animated-super-row.is-hiding.from-top{transform:translate3d(0,calc(var(--translateY)*-1),0)}.animated-super-row.is-hiding.from-bottom{transform:translate3d(0,var(--translateY),0)}.animated-counter{display:inline-flex}.animated-counter-decimal{position:relative}.animated-counter-decimal-placeholder{color:transparent}.animated-counter-decimal-wrapper{bottom:0;left:0;position:absolute;right:0;top:0}middle-ellipsis-element{display:block;overflow:hidden;width:100%}.album-item-media{height:100%;width:100%}html.no-touch .hover-effect:active,html.no-touch .hover-effect:hover{background-color:var(--light-secondary-text-color)}.progress-ring{left:0;pointer-events:none;position:absolute;top:0}.progress-ring__circle{stroke-linecap:round;transition:stroke-dashoffset}.rlottie,.rlottie-vector{bottom:0;height:100%;left:0;max-height:100%;max-width:100%;position:absolute;right:0;top:0;width:100%}.rlottie-icon{pointer-events:none;position:relative}body.animation-level-2 .rlottie.fade-in{animation:fade-in-opacity .2s ease-in-out forwards}.rlottie-vector{fill:rgba(0,0,0,.08)}.canvas-thumbnail{height:100%;position:absolute;width:100%}.media-container-contain{position:relative}.media-container-contain .media-photo{max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain}.media-container-cover{position:relative}.media-container-cover .media-photo{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.media-photo,.media-poster,.media-round,.media-sticker,.media-video{bottom:0;left:0;position:absolute;right:0;top:0}body.animation-level-2 .media-photo.fade-in,body.animation-level-2 .media-poster.fade-in,body.animation-level-2 .media-round.fade-in,body.animation-level-2 .media-sticker.fade-in,body.animation-level-2 .media-video.fade-in{animation:fade-in-opacity .2s ease-in-out forwards}body.animation-level-2 .media-photo.fade-out,body.animation-level-2 .media-poster.fade-out,body.animation-level-2 .media-round.fade-out,body.animation-level-2 .media-sticker.fade-out,body.animation-level-2 .media-video.fade-out{animation:fade-out-opacity .2s ease-in-out forwards}.media-video{z-index:1}.media-sticker{height:100%;margin:auto;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;width:100%}.media-sticker-wrapper.is-premium-sticker:before{align-items:center;background:rgba(0,0,0,.2);background-image:var(--lock-url);background-repeat:no-repeat;background-size:cover;border-radius:50%;bottom:.125rem;color:#fff;display:flex;height:1.25rem;justify-content:center;left:50%;position:absolute;transform:translateX(-50%);width:1.25rem;z-index:1}body.is-premium .media-sticker-wrapper.is-premium-sticker:after,body.is-premium .media-sticker-wrapper.is-premium-sticker:before{content:none}.media-round{max-height:var(--round-video-size);max-width:var(--round-video-size);z-index:1}.media-round canvas{border-radius:50%;height:100%;position:relative;width:100%}.media-round .video-time{background-color:var(--message-highlightning-color)!important;padding:0 .375rem}[dir=ltr] .media-round .video-time:after,[dir=ltr] .media-round .video-time:before{margin-left:.25rem}[dir=rtl] .media-round .video-time:after,[dir=rtl] .media-round .video-time:before{margin-right:.25rem}.media-round.is-unread .video-time:before{background-color:#fff;border-radius:50%;content:\" \";height:.5rem;order:1;width:.5rem}.media-round.is-paused .video-time:after{align-items:center;content:\"\";display:flex;font-size:1.125rem;order:2}.gradient-delimiter{background-color:var(--background-color-true);height:.75rem;position:relative;width:100%}.gradient-delimiter:before{background:linear-gradient(180deg,rgba(0,0,0,.06),transparent 20%,transparent 94%,rgba(0,0,0,.06));bottom:0;content:\" \";left:0;position:absolute;right:0;top:0}.sidebar-left-section{background-color:var(--surface-color);box-shadow:0 1px 3px 0 var(--section-box-shadow-color);margin-bottom:.75rem;padding:.5rem 0!important}.sidebar-left-section.no-shadow{box-shadow:none!important}.sidebar-left-section-name{padding:.5rem 1rem}.sidebar-left-section-caption{font-size:var(--font-size-14);line-height:var(--line-height-14);margin:-.1875rem 0 1rem;padding:0 1.5rem}.sidebar-left-section-caption:first-child{margin-bottom:.8125rem;margin-top:.8125rem}@media only screen and (max-width:600px){.sidebar-left-section-caption{padding:0 1rem}}.sidebar-left-section-container{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sidebar-left-section-container a{cursor:pointer}hr{display:none!important}.tgico-admin:before,.tgico-fontsize:before{font-size:20px!important;padding:2px}.tgico-endcall_filled,.tgico-phone_filled{font-size:26px!important}.stealthy{left:0;margin:0;max-height:1px;max-width:1px;opacity:0;outline:none;overflow:hidden;pointer-events:none;position:absolute;top:0;z-index:-1}.navigable-list .active{background-color:var(--light-secondary-text-color);border-radius:inherit}.super-emojis{--esg-emoji-total-size:calc(var(--esg-emoji-size) + 0.5rem);--custom-emoji-size:var(--esg-emoji-size);grid-column-gap:2.44px;--esg-emoji-size:2.125rem;--esg-emoji-total-size:2.625rem;--custom-emoji-size:2.25rem;-moz-column-gap:2.44px;column-gap:2.44px;-moz-column-gap:.25rem;column-gap:.25rem;display:grid;font-size:var(--esg-emoji-size);grid-template-columns:repeat(auto-fill,var(--esg-emoji-total-size));justify-content:space-between;line-height:var(--esg-emoji-size);position:relative}.super-emojis .super-emoji{border-radius:8px;cursor:pointer;display:inline-block;height:var(--esg-emoji-total-size);line-height:inherit;margin-left:.0625rem;margin-right:.0625rem;padding:.25rem;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:var(--esg-emoji-total-size)}.super-emojis .super-emoji .emoji-placeholder{background-color:var(--light-secondary-text-color);border-radius:50%;height:1.75rem;left:7px;pointer-events:none;position:absolute;top:7px;width:1.75rem}body.animation-level-2 .super-emojis .super-emoji .emoji-placeholder{opacity:0;transition:opacity .2s ease-in-out}body.animation-level-2 .super-emojis .super-emoji img{opacity:1;transition:opacity .2s ease-in-out}.super-emojis .super-emoji .emoji{height:100%;margin:0;vertical-align:baseline;vertical-align:initial;width:100%}.super-emojis .super-emoji.active,html.no-touch .super-emojis .super-emoji:active,html.no-touch .super-emojis .super-emoji:hover{background-color:var(--light-secondary-text-color)}.super-emojis.not-local .super-emoji{padding:.1875rem}.super-emojis .super-emoji{margin:0}.super-emojis:not(.not-local) .super-emoji{overflow:hidden}html.native-emoji .super-emojis:not(.not-local) .super-emoji{padding-bottom:.3125rem;padding-top:.3125rem}.super-emojis .custom-emoji{display:block}.super-emojis .custom-emoji-renderer{z-index:1}.super-emojis .custom-emoji:before{content:none}.tgico-char:before{font-family:Roboto!important;font-weight:var(--font-weight-bold);text-align:center;width:1.5rem}.tgico-char.z:before{content:\"Z\"}.tgico-char.w:before{content:\"W\"}.sending-status:empty{display:none}.sending-status .tgico-sendingerror{color:var(--danger-color)}.sending-status-icon{line-height:1!important;position:absolute}.quick-reaction-title{align-items:center;display:flex}.quick-reaction-sticker{height:32px!important;margin:0 .5rem 0 0!important;position:relative!important;width:32px!important}.verified-icon-svg{height:1rem;width:1rem}.verified-icon-check{fill:#fff}.verified-icon-background{fill:var(--primary-color)}[dir=ltr] .emoji-status,[dir=ltr] .premium-icon,[dir=ltr] .verified-icon{margin-left:.125rem}[dir=rtl] .emoji-status,[dir=rtl] .premium-icon,[dir=rtl] .verified-icon{margin-right:.125rem}.emoji-status,.premium-icon,.verified-icon{align-items:center;display:flex;flex:0 0 auto;font-size:1rem;height:1.25rem;justify-content:center;width:1.25rem}[dir=ltr] .emoji-status{margin-left:.25rem}[dir=rtl] .emoji-status{margin-right:.25rem}.emoji-status{height:1.125rem;position:relative;width:1.125rem}.premium-icon{color:var(--primary-color);margin-top:-.0625rem}.badge-fake{border:1px solid var(--danger-color);border-radius:.185rem;color:var(--danger-color);flex:0 0 auto;font-size:.625rem;font-weight:var(--font-weight-bold);line-height:1!important;margin-left:.25rem;margin-right:.25rem;padding:.125rem .25rem}.peer-title.with-icons{align-items:center;display:flex;overflow:hidden}.peer-title-inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.limit-line{display:flex;font-weight:var(--font-weight-bold);height:2rem}.limit-line-free{color:#000}.limit-line-premium{color:#fff}.limit-line-free{background-color:#f1f3f5;border-bottom-left-radius:10px;border-top-left-radius:10px}.limit-line-premium{background:linear-gradient(84.4deg,#6c93ff -4.85%,#976fff 51.72%,#df69d1 110.7%);border-bottom-right-radius:10px;border-top-right-radius:10px}.limit-line-free,.limit-line-premium{align-items:center;display:flex;flex:1 1 0;justify-content:space-between;padding:0 .75rem}.movable-element{--size:.5rem;position:relative}.movable-element-resize-handler{position:absolute}.movable-element-resize-handler-side-n,.movable-element-resize-handler-side-s{cursor:row-resize;height:var(--size);left:0;right:0}.movable-element-resize-handler-side-e,.movable-element-resize-handler-side-w{bottom:0;cursor:col-resize;top:0;width:var(--size)}.movable-element-resize-handler-side-n{top:0}.movable-element-resize-handler-side-e{right:0}.movable-element-resize-handler-side-s{bottom:0}.movable-element-resize-handler-side-w{left:0}.movable-element-resize-handler-side-ne,.movable-element-resize-handler-side-nw,.movable-element-resize-handler-side-se,.movable-element-resize-handler-side-sw{height:var(--size);width:var(--size);z-index:1}.movable-element-resize-handler-side-ne,.movable-element-resize-handler-side-sw{cursor:nesw-resize}.movable-element-resize-handler-side-nw,.movable-element-resize-handler-side-se{cursor:nwse-resize}.movable-element-resize-handler-side-ne{right:0;top:0}.movable-element-resize-handler-side-se{bottom:0;right:0}.movable-element-resize-handler-side-sw{bottom:0;left:0}.movable-element-resize-handler-side-nw{left:0;top:0}[dir=ltr] .chatlist-chat.row-with-padding{padding-left:4.5rem!important}[dir=rtl] .chatlist-chat.row-with-padding{padding-right:4.5rem!important}.chatlist-chat span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chatlist-chat .row-title{font-size:var(--font-size-16)!important;line-height:1.375rem}.chatlist-chat .row-title-right-secondary{font-size:var(--font-size-12)!important;line-height:var(--line-height-12)!important;margin-top:-.4375rem}.chatlist-chat .row-subtitle{display:block!important}.chatlist-chat .row-row{height:1.375rem}.chatlist-chat.chatlist-chat-abitbigger .row-subtitle{margin-top:0}.chatlist-chat.chatlist-chat-bigger .row-subtitle{font-size:var(--font-size-16)!important;line-height:1.375rem;margin-top:0}.chatlist-chat.chatlist-chat-bigger .row-subtitle-row{margin-top:.125rem}.chatlist-chat.chatlist-chat-bigger .row-title .peer-title{font-weight:var(--font-weight-bold)}.username-purchase-help b{color:var(--danger-color)!important;font-weight:var(--font-weight-normal)!important}.media-spoiler-container{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0;z-index:1}.media-spoiler-container.is-revealing{opacity:1}.media-spoiler-container.is-revealing:not(.backwards){opacity:0}.media-spoiler-container.is-revealing.animating{transition:opacity var(--transition-standard-out)}.media-spoiler .canvas-thumbnail,.media-spoiler-thumbnail{height:100%;-o-object-fit:initial!important;object-fit:fill!important;position:absolute;width:100%}.accordion{height:0;overflow:hidden}.accordion.is-expanded{height:var(--max-height)}body.animation-level-2 .accordion{transition:height var(--transition-standard-in)}.accordion-icon{color:var(--secondary-text-color);display:inline-block;font-size:1.25rem;line-height:0;transform:rotate(0deg) translateY(4px)}body.animation-level-2 .accordion-icon{transition:transform var(--transition-standard-in)}.accordion-toggler-expanded .accordion-icon{transform:translateY(4px) rotate(180deg)}"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/public/main.6e3cb54d0a85ecdda73e.css b/public/main.6e3cb54d0a85ecdda73e.css deleted file mode 100644 index b40958ce..00000000 --- a/public/main.6e3cb54d0a85ecdda73e.css +++ /dev/null @@ -1,4 +0,0 @@ -/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;line-height:1.15}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{-webkit-text-decoration-skip:objects;background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted currentColor;text-decoration:underline dotted currentColor}b,strong{font-weight:inherit;font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}[hidden],template{display:none}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}ul:not(.browser-default){list-style-type:none;padding-left:0}ul:not(.browser-default)>li{list-style-type:none}a{-webkit-tap-highlight-color:rgba(0,0,0,0)}button{background:none;border:none;cursor:pointer;outline:none;padding:0}img,video{-webkit-user-drag:none}.valign-wrapper{align-items:center;display:flex}.z-depth-0{box-shadow:none!important}.z-depth-1{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2)}.z-depth-1-half{box-shadow:0 3px 3px 0 rgba(0,0,0,.14),0 1px 7px 0 rgba(0,0,0,.12),0 3px 1px -1px rgba(0,0,0,.2)}.z-depth-2{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.3)}.z-depth-3{box-shadow:0 8px 17px 2px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.2)}.z-depth-4{box-shadow:0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12),0 8px 10px -7px rgba(0,0,0,.2)}.z-depth-5{box-shadow:0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12),0 11px 15px -7px rgba(0,0,0,.2)}.hide{display:none!important}.hide-overflow{overflow:hidden}.no-select{-webkit-user-select:none;-moz-user-select:none;user-select:none}.no-transition,.no-transition:after,.no-transition:before{transition:none!important}.inline{display:inline}.center-align,.text-center{text-align:center}.justify-start{justify-content:flex-start!important}.justify-self-start{justify-self:flex-start!important}.justify-self-end{justify-self:flex-end!important}.position-center{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.text-bold{font-weight:500!important}.text-super{display:inline-table}.text-uppercase{text-transform:uppercase}.pre-wrap{white-space:pre-wrap!important}.no-wrap{white-space:nowrap!important}.no-border-radius{border-radius:0!important}.disable-hover{pointer-events:none!important}.reflect-x{transform:scaleX(-1)}[dir=auto]{unicode-bidi:plaintext}.is-rtl [dir=auto]{direction:inherit}a{text-decoration:none}html{font-weight:400;line-height:1.5}h1,h2,h3,h4,h5,h6{line-height:1.3}em{font-style:italic}strong{font-weight:500}small{font-size:75%}code,pre{word-wrap:break-word;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap} -:root{--vh:1vh;--z-below:-1;--hover-alpha:0.08;--transition-standard-easing:cubic-bezier(.4,.0,.2,1);--transition-standard-in-time:.3s;--transition-standard-out-time:.25s;--transition-standard-in:var(--transition-standard-in-time) var(--transition-standard-easing);--transition-standard-out:var(--transition-standard-out-time) var(--transition-standard-easing);--pm-transition:.2s ease-in-out;--layer-transition:.2s cubic-bezier(.4,.0,.2,1);--slide-header-transition:.4s ease-in-out;--tabs-transition:.2s ease-in-out;--btn-menu-transition:.2s cubic-bezier(.4,0,.2,1);--esg-transition:var(--btn-menu-transition);--input-transition:.2s ease-out;--sticker-viewer-open-transition-in:.2s var(--transition-standard-easing);--sticker-viewer-open-transition-out:.2s var(--transition-standard-easing);--sticker-viewer-switch-transition:.2s cubic-bezier(.12,1.1,.56,1.2);--popup-transition-function:cubic-bezier(.4,0,.2,1);--popup-transition-time:.15s;--btn-corner-transition:.2s cubic-bezier(.34,1.56,.64,1);--chatlist-badge-transition-in:.25s cubic-bezier(.35,.35,.47,1.34);--chatlist-badge-transition-out:.25s cubic-bezier(.35,.35,.7,1);--message-handhelds-margin:5.5625rem;--message-beside-button-size:2.375rem;--message-beside-button-margin:calc((var(--message-beside-button-size) + 0.5rem)*-1);--message-time-background:rgba(0,0,0,.35);--message-highlightning-color:rgba(109,141,65,.4);--messages-container-width:728px;--messages-text-size:16px;--messages-line-height:1.3125;--messages-secondary-text-size:calc(var(--messages-text-size) - 2px);--messages-secondary-line-height:calc(var(--messages-secondary-text-size) + 4px);--messages-time-text-size:calc(var(--messages-text-size) - 4px);--messages-service-text-size:calc(var(--messages-text-size) - 1px);--messages-custom-emoji-size:calc(var(--messages-text-size) + 4px);--bubble-transition-in:transform var(--transition-standard-in),opacity var(--transition-standard-in);--bubble-transition-out:transform var(--transition-standard-out),opacity var(--transition-standard-out);--line-height-20:26px;--line-height-16:21px;--line-height-14:18px;--line-height-12:16px;--line-height:1.3125;--font-size-20:20px;--font-size-16:16px;--font-size-14:14px;--font-size-12:12px;--font-size:var(--font-size-16);--esg-sticker-size:72px;--esg-custom-emoji-size:36px;--popup-sticker-size:80px;--disabled-opacity:.3;--round-video-size:280px;--menu-box-shadow:0px 0px 10px var(--menu-box-shadow-color);--menu-backdrop-filter:blur(50px);--font-monospace:"Roboto Mono",monospace;--font-weight-bold:500;--font-weight-normal:400;--selection-background-color:rgba(var(--primary-color-rgb),.4);--selection-color:inherit;--topbar-floating-scaleX:1;--topbar-call-height:3rem;--topbar-floating-call-height:0px;--call-button-size:3.375rem;--call-button-margin:2rem;--custom-emoji-size:1.25rem;--esg-width:100%;--peer-avatar-red-top:#ff845e;--peer-avatar-red-bottom:#d45246;--peer-avatar-orange-top:#febb5b;--peer-avatar-orange-bottom:#f68136;--peer-avatar-violet-top:#b694f9;--peer-avatar-violet-bottom:#6c61df;--peer-avatar-green-top:#9ad164;--peer-avatar-green-bottom:#46ba43;--peer-avatar-cyan-top:#53edd6;--peer-avatar-cyan-bottom:#28c9b7;--peer-avatar-blue-top:#5bcbe3;--peer-avatar-blue-bottom:#359ad4;--peer-avatar-pink-top:#ff8aac;--peer-avatar-pink-bottom:#d95574;--peer-avatar-archive-top:#b8c2cc;--peer-avatar-archive-bottom:#9eaab5;--peer-avatar-saved-top:var(--light-filled-saved-color);--peer-avatar-saved-bottom:var(--saved-color);--avatar-color-top:var(--peer-avatar-saved-top);--avatar-color-bottom:var(--peer-avatar-saved-bottom);--avatar-border-radius-forum:37%;--premium-gradient:linear-gradient(52.62deg,#6b93ff 12.22%,#976fff 50.25%,#e46ace 98.83%)}@media only screen and (max-width:600px){:root{--right-column-width:100vw;--esg-sticker-size:68px;--popup-sticker-size:68px;--round-video-size:200px;--chat-input-size:2.875rem;--chat-input-padding:0.5rem;--chat-input-inner-padding:0.25rem}}@media only screen and (min-width:601px){:root{--right-column-width:420px;--chat-input-size:3.375rem;--chat-input-padding:0.8125rem;--chat-input-inner-padding:0.5rem}}@media only screen and (max-height:569px){:root{--chat-input-size:2.875rem;--chat-input-inner-padding:0.25rem}}@media only screen and (min-height:570px)and (min-width:601px){:root{--esg-width:23.875rem}}@media only screen and (min-width:1276px)and (max-width:1680px){:root{--right-column-width:25vw}}:root{--body-background-color:#fff;--background-color-true:#f4f4f5;--background-color:var(--background-color-true);--border-color:#dfe1e5;--scrollbar-color:rgba(0,0,0,.2);--section-box-shadow-color:rgba(0,0,0,.06);--menu-box-shadow-color:rgba(0,0,0,.15);--input-search-background-color:#fff;--input-search-border-color:#dfe1e5;--secondary-color:#c4c9cc;--avatar-online-color:var(--primary-color);--chatlist-status-color:var(--avatar-online-color);--chatlist-pinned-color:#a2abb2;--badge-text-color:#fff;--link-color:#00488f;--ripple-color:rgba(0,0,0,.08);--poll-circle-color:var(--border-color);--spoiler-background-color:#e3e5e8;--spoiler-draft-background-color:#d9d9d9;--monospace-text-color:var(--danger-color);--backdrop-opacity:.85;--menu-background-color:rgba(var(--surface-color-rgb),var(--backdrop-opacity));--message-background-color:var(--surface-color);--message-time-color:var(--secondary-text-color);--message-checkbox-color:#61c642;--message-checkbox-border-color:#fff;--message-primary-color:var(--primary-color);--light-filled-message-primary-color:var(--light-filled-primary-color);--message-secondary-color:var(--secondary-color);--message-error-color:var(--danger-color);--message-out-link-color:var(--link-color);--message-out-status-color:var(--message-out-primary-color);--message-out-time-color:var(--message-out-status-color);--message-out-audio-play-button-color:#fff;--message-out-selection-background-color:var(--selection-background-color);--gc-background-color:#212121;--gc-button-leave-color:rgba(255,89,90,.3);--gc-button-unmuted-color:rgba(1,200,80,.2);--gc-button-muted-color:rgba(60,135,247,.2);--gc-button-hand-color:rgba(223,68,184,.2);--gc-button-unmuted-fill-color:#195530;--gc-button-muted-fill-color:#3c87f7;--gc-green-color:#195530;--gc-blue-color:#3c87f7;--gc-red-color:#643333;--gc-primary-text-color:#fff;--gc-secondary-text-color:#aaa;--gc-green-text-color:#5cc85e;--gc-blue-text-color:#3390ec;--gc-red-text-color:#ff595a;--gc-right-column-width:26.25rem}.night{--body-background-color:#181818;--background-color-true:#181818;--background-color:var(--background-color-true);--border-color:#0f0f0f;--scrollbar-color:hsla(0,0%,100%,.2);--section-box-shadow-color:rgba(0,0,0,.12);--input-search-background-color:#181818;--input-search-border-color:#2f2f2f;--secondary-color:#707579;--avatar-online-color:var(--primary-color);--chatlist-status-color:var(--primary-color);--chatlist-pinned-color:var(--secondary-color);--badge-text-color:#fff;--link-color:var(--primary-color);--ripple-color:hsla(0,0%,100%,.08);--poll-circle-color:#fff;--spoiler-background-color:#373e4e;--spoiler-draft-background-color:#484848;--monospace-text-color:var(--primary-text-color);--menu-background-color:rgba(var(--surface-color-rgb),.75);--message-background-color:var(--surface-color);--message-time-color:var(--secondary-text-color);--message-checkbox-color:var(--primary-color);--message-checkbox-border-color:#fff;--message-secondary-color:var(--secondary-color);--message-error-color:#fff;--message-out-link-color:#fff;--message-out-status-color:#fff;--message-out-time-color:hsla(0,0%,100%,.6);--message-out-audio-play-button-color:var(--message-out-background-color);--message-out-selection-background-color:rgba(var(--surface-color-rgb),.4)}@font-face{font-display:block;font-family:tgico;font-style:normal;font-weight:400;src:url(assets/fonts/tgico.ttf?2fcrrv) format("truetype"),url(assets/fonts/tgico.woff?2fcrrv) format("woff"),url(assets/fonts/tgico.svg?2fcrrv#tgico) format("svg")}.tgico:after,.tgico:before,[class*=" tgico-"]:after,[class*=" tgico-"]:before,[class^=tgico-]{speak:never;font-feature-settings:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:tgico!important;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none}.tgico-check:before{content:""}.tgico-checks:before{content:""}.tgico-activesessions:before{content:""}.tgico-add:before{content:""}.tgico-add_reaction:before{content:""}.tgico-addmember_filled:before{content:""}.tgico-adduser:before{content:""}.tgico-admin:before{content:""}.tgico-animals:before{content:""}.tgico-animations:before{content:""}.tgico-archive:before{content:""}.tgico-arrow_down:before{content:""}.tgico-arrow_next:before{content:""}.tgico-attach:before{content:""}.tgico-audio_repeat:before{content:""}.tgico-audio_repeat_single:before{content:""}.tgico-avatarnext:before{content:""}.tgico-avatarprevious:before{content:""}.tgico-binfilled:before{content:""}.tgico-bold:before{content:""}.tgico-botcom:before{content:""}.tgico-bots:before{content:""}.tgico-bug:before{content:""}.tgico-calendar:before{content:""}.tgico-calendarfilter:before{content:""}.tgico-camera:before{content:""}.tgico-cameraadd:before{content:""}.tgico-car:before{content:""}.tgico-card:before{content:""}.tgico-card_outline:before{content:""}.tgico-channel:before{content:""}.tgico-channelviews:before{content:""}.tgico-chatspinned:before{content:""}.tgico-chatsplaceholder:before{content:""}.tgico-check1:before{content:""}.tgico-checkbox:before{content:""}.tgico-checkboxblock:before{content:""}.tgico-checkboxempty:before{content:""}.tgico-checkboxon:before{content:""}.tgico-checkretract:before{content:""}.tgico-checkround:before{content:""}.tgico-close:before{content:""}.tgico-clouddownload:before{content:""}.tgico-colorize:before{content:""}.tgico-comments:before{content:""}.tgico-commentssticker:before{content:""}.tgico-copy:before{content:""}.tgico-darkmode:before{content:""}.tgico-data:before{content:""}.tgico-delete:before{content:""}.tgico-delete_filled:before{content:""}.tgico-deletedaccount:before{content:""}.tgico-deleteleft:before{content:""}.tgico-deleteuser:before{content:""}.tgico-devices:before{content:""}.tgico-document:before{content:""}.tgico-down:before{content:""}.tgico-download:before{content:""}.tgico-dragfiles:before{content:""}.tgico-dragmedia:before{content:""}.tgico-eats:before{content:""}.tgico-edit:before{content:""}.tgico-email:before{content:""}.tgico-endcall_filled:before{content:""}.tgico-enter:before{content:""}.tgico-eye1:before{content:""}.tgico-eye2:before{content:""}.tgico-fast_forward:before{content:""}.tgico-fast_rewind:before{content:""}.tgico-favourites:before{content:""}.tgico-flag:before{content:""}.tgico-flip:before{content:""}.tgico-folder:before{content:""}.tgico-fontsize:before{content:""}.tgico-forward:before{content:""}.tgico-forward_filled:before{content:""}.tgico-fullscreen:before{content:""}.tgico-gc_microphone:before{content:""}.tgico-gc_microphoneoff:before{content:""}.tgico-gifs:before{content:""}.tgico-group:before{content:""}.tgico-groupmedia:before{content:""}.tgico-groupmediaoff:before{content:""}.tgico-help:before{content:""}.tgico-hide:before{content:""}.tgico-image:before{content:""}.tgico-info:before{content:""}.tgico-info2:before{content:""}.tgico-italic:before{content:""}.tgico-keyboard:before{content:""}.tgico-lamp:before{content:""}.tgico-language:before{content:""}.tgico-largepause:before{content:""}.tgico-largeplay:before{content:""}.tgico-left:before{content:""}.tgico-limit_chat:before{content:""}.tgico-limit_chats:before{content:""}.tgico-limit_file:before{content:""}.tgico-limit_folders:before{content:""}.tgico-limit_link:before{content:""}.tgico-limit_pin:before{content:""}.tgico-link:before{content:""}.tgico-listscreenshare:before{content:""}.tgico-livelocation:before{content:""}.tgico-location:before{content:""}.tgico-lock:before{content:""}.tgico-lockoff:before{content:""}.tgico-loginlogodesktop:before{content:""}.tgico-loginlogomobile:before{content:""}.tgico-logout:before{content:""}.tgico-mediaspoiler:before{content:""}.tgico-mediaspoileroff:before{content:""}.tgico-mention:before{content:""}.tgico-menu:before{content:""}.tgico-message:before{content:""}.tgico-messageunread:before{content:""}.tgico-microphone:before{content:""}.tgico-microphone_crossed:before{content:""}.tgico-microphone_crossed_filled:before{content:""}.tgico-microphone_filled:before{content:""}.tgico-minus:before{content:""}.tgico-monospace:before{content:""}.tgico-more:before{content:""}.tgico-mute:before{content:""}.tgico-muted:before{content:""}.tgico-newchannel:before{content:""}.tgico-newchat_filled:before{content:""}.tgico-newgroup:before{content:""}.tgico-newprivate:before{content:""}.tgico-next:before{content:""}.tgico-noncontacts:before{content:""}.tgico-nosound:before{content:""}.tgico-passwordoff:before{content:""}.tgico-pause:before{content:""}.tgico-permissions:before{content:""}.tgico-phone:before{content:""}.tgico-pin:before{content:""}.tgico-pinlist:before{content:""}.tgico-pinned_filled:before{content:""}.tgico-pinnedchat:before{content:""}.tgico-pip:before{content:""}.tgico-play:before{content:""}.tgico-playback_05:before{content:""}.tgico-playback_15:before{content:""}.tgico-playback_1x:before{content:""}.tgico-playback_2x:before{content:""}.tgico-plus:before{content:""}.tgico-poll:before{content:""}.tgico-premium_addone:before{content:""}.tgico-premium_double:before{content:""}.tgico-premium_lock:before{content:""}.tgico-premium_unlock:before{content:""}.tgico-previous:before{content:""}.tgico-radiooff:before{content:""}.tgico-radioon:before{content:""}.tgico-reactions:before{content:""}.tgico-readchats:before{content:""}.tgico-recent:before{content:""}.tgico-replace:before{content:""}.tgico-reply:before{content:""}.tgico-reply_filled:before{content:""}.tgico-rightpanel:before{content:""}.tgico-rotate_left:before{content:""}.tgico-rotate_right:before{content:""}.tgico-saved:before{content:""}.tgico-savedmessages:before{content:""}.tgico-schedule:before{content:""}.tgico-scheduled:before{content:""}.tgico-search:before{content:""}.tgico-select:before{content:""}.tgico-send:before{content:""}.tgico-send2:before{content:""}.tgico-sending:before{content:""}.tgico-sendingerror:before{content:""}.tgico-settings:before{content:""}.tgico-settings_filled:before{content:""}.tgico-sharescreen_filled:before{content:""}.tgico-shipping:before{content:""}.tgico-shuffle:before{content:""}.tgico-smallscreen:before{content:""}.tgico-smile:before{content:""}.tgico-spoiler:before{content:""}.tgico-sport:before{content:""}.tgico-star:before{content:""}.tgico-stickers:before{content:""}.tgico-stickers_face:before{content:""}.tgico-stop:before{content:""}.tgico-strikethrough:before{content:""}.tgico-textedit:before{content:""}.tgico-tip:before{content:""}.tgico-tools:before{content:""}.tgico-topics:before{content:""}.tgico-transcribe:before{content:""}.tgico-unarchive:before{content:""}.tgico-underline:before{content:""}.tgico-unmute:before{content:""}.tgico-unpin:before{content:""}.tgico-unread:before{content:""}.tgico-up:before{content:""}.tgico-user:before{content:""}.tgico-username:before{content:""}.tgico-videocamera:before{content:""}.tgico-videocamera_crossed_filled:before{content:""}.tgico-videocamera_filled:before{content:""}.tgico-videochat:before{content:""}.tgico-volume_down:before{content:""}.tgico-volume_mute:before{content:""}.tgico-volume_off:before{content:""}.tgico-volume_up:before{content:""}.tgico-zoomin:before{content:""}.tgico-zoomout:before{content:""}.tgico-phone_filled:before{content:"";transform:rotate(-135deg)}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:400;src:local("Roboto"),local("Roboto-Regular"),url(assets/fonts/KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2) format("woff2");unicode-range:U400-45F,U490-491,U4B0-4B1,U2116}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:400;src:local("Roboto"),local("Roboto-Regular"),url(assets/fonts/KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2) format("woff2");unicode-range:U100-24F,U259,U1-1EFF,U2020,U20A0-20AB,U20AD-20CF,U2113,U2C60-2C7F,UA720-A7FF}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:400;src:local("Roboto"),local("Roboto-Regular"),url(assets/fonts/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2) format("woff2");unicode-range:U0-0FF,U131,U152-153,U2BB-2BC,U2C6,U2DA,U2DC,U2000-206F,U2074,U20AC,U2122,U2191,U2193,U2212,U2215,UFEFF,UFFFD}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:500;src:local("Roboto Medium"),local("Roboto-Medium"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2) format("woff2");unicode-range:U400-45F,U490-491,U4B0-4B1,U2116}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:500;src:local("Roboto Medium"),local("Roboto-Medium"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2) format("woff2");unicode-range:U100-24F,U259,U1-1EFF,U2020,U20A0-20AB,U20AD-20CF,U2113,U2C60-2C7F,UA720-A7FF}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:500;src:local("Roboto Medium"),local("Roboto-Medium"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2) format("woff2");unicode-range:U0-0FF,U131,U152-153,U2BB-2BC,U2C6,U2DA,U2DC,U2000-206F,U2074,U20AC,U2122,U2191,U2193,U2212,U2215,UFEFF,UFFFD}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:600;src:local("Roboto Medium"),local("Roboto-Medium"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2) format("woff2");unicode-range:U400-45F,U490-491,U4B0-4B1,U2116}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:600;src:local("Roboto Medium"),local("Roboto-Medium"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2) format("woff2");unicode-range:U100-24F,U259,U1-1EFF,U2020,U20A0-20AB,U20AD-20CF,U2113,U2C60-2C7F,UA720-A7FF}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:600;src:local("Roboto Medium"),local("Roboto-Medium"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2) format("woff2");unicode-range:U0-0FF,U131,U152-153,U2BB-2BC,U2C6,U2DA,U2DC,U2000-206F,U2074,U20AC,U2122,U2191,U2193,U2212,U2215,UFEFF,UFFFD}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEluUlco8VkKjG.woff2) format("woff2");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEn-Ulco8VkKjG.woff2) format("woff2");unicode-range:u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEmOUlco8VkKjG.woff2) format("woff2");unicode-range:u+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtElOUlco8VkKjG.woff2) format("woff2");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+1ea0-1ef9,u+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEleUlco8VkKjG.woff2) format("woff2");unicode-range:u+0100-024f,u+0259,u+1e??,u+2020,u+20a0-20ab,u+20ad-20cf,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEm-Ulco8VkA.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEluUlco8VkKjG.woff2) format("woff2");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEn-Ulco8VkKjG.woff2) format("woff2");unicode-range:u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEmOUlco8VkKjG.woff2) format("woff2");unicode-range:u+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtElOUlco8VkKjG.woff2) format("woff2");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+1ea0-1ef9,u+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEleUlco8VkKjG.woff2) format("woff2");unicode-range:u+0100-024f,u+0259,u+1e??,u+2020,u+20a0-20ab,u+20ad-20cf,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEm-Ulco8VkA.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSV0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSx0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSt0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSd0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+1ea0-1ef9,u+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSZ0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0100-024f,u+0259,u+1e??,u+2020,u+20a0-20ab,u+20ad-20cf,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0me8iUI0.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSV0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSx0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSt0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSd0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+1ea0-1ef9,u+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSZ0me8iUI0lkQ.woff2) format("woff2");unicode-range:u+0100-024f,u+0259,u+1e??,u+2020,u+20a0-20ab,u+20ad-20cf,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0me8iUI0.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}.input-wrapper{margin:0 auto;width:360px}.input-field{--height:54px;--border-radius:10px;position:relative}@media only screen and (max-width:600px){.input-field{--height:50px}}.input-field .arrow-down{border:solid var(--secondary-text-color);border-radius:1px;border-width:0 2px 2px 0;bottom:0;content:" ";cursor:pointer;display:inline-block;height:0;margin-top:-9px;padding:5px;position:absolute;right:21px;top:50%;transform:rotate(45deg);-webkit-transform:rotate(45deg);transition:all .2s;vertical-align:middle;width:0;z-index:2}[dir=ltr] .input-field label{left:1rem}[dir=rtl] .input-field label{right:1rem}.input-field label{background-color:var(--surface-color);color:#9e9e9e;height:1.5rem;margin-top:calc((var(--height) - 1.5rem)/2);pointer-events:none;position:absolute;right:auto;top:0;transform:translate(0);transform-origin:left center;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;z-index:2}.is-rtl .input-field label{transform-origin:right center}body.animation-level-2 .input-field label{transition:transform .2s,padding .2s,opacity .1s,font-weight 0s .1s}.input-field-border{border:2px solid var(--primary-color);border-radius:var(--border-radius);bottom:0;left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0;z-index:1}body.animation-level-2 .input-field-border{transition:opacity .2s}.input-field-icon{border-radius:.375rem;height:1.5rem;pointer-events:none;position:absolute;right:1rem;top:50%;transform:translateY(-50%);width:1.5rem;z-index:1}.input-field-input{--padding:1rem;--padding-horizontal:1rem;--border-width:1px;background-color:var(--surface-color);border:var(--border-width) solid var(--input-search-border-color);border-radius:var(--border-radius);box-sizing:border-box;line-height:var(--line-height);min-height:var(--height);padding:calc(var(--padding) - var(--border-width)) calc(var(--padding-horizontal) - var(--border-width));position:relative;transition:border-color 0s;width:100%;z-index:1}.input-field-input:-webkit-autofill,.input-field-input:-webkit-autofill:active,.input-field-input:-webkit-autofill:focus,.input-field-input:-webkit-autofill:hover{-webkit-box-shadow:0 0 0 1000px var(--surface-color) inset}.input-field-input:-webkit-autofill,.input-field-input:-webkit-autofill:active,.input-field-input:-webkit-autofill:first-line,.input-field-input:-webkit-autofill:focus,.input-field-input:-webkit-autofill:hover{color:var(--primary-text-color)!important;font-family:Roboto,-apple-system,apple color emoji,BlinkMacSystemFont,Segoe UI,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif!important;font-size:1rem!important}@media only screen and (max-width:600px){.input-field-input{--padding:.9375rem;--padding-horizontal:.9375rem}}body.animation-level-0 .input-field-input{transition:none!important}html.no-touch .input-field-input:active:not(:focus):not(.error):not(.valid),html.no-touch .input-field-input:hover:not(:focus):not(.error):not(.valid){border-color:var(--primary-color);transition:border-color .2s}html.no-touch .input-field-input:active:not(:focus):not(.error):not(.valid)~label,html.no-touch .input-field-input:hover:not(:focus):not(.error):not(.valid)~label{color:var(--primary-color)}.input-field-input:focus{border-color:var(--primary-color)}.input-field-input.error{border-color:var(--danger-color)}.input-field-input.error~label{color:var(--danger-color)!important}.input-field-input.error~.input-field-border{border-color:var(--danger-color)!important}.input-field-input.valid{border-color:#26962f}.input-field-input.valid~label{color:#26962f!important}.input-field-input.valid~.input-field-border{border-color:#26962f!important}.input-field-input:focus~.arrow-down{border-color:var(--primary-color);margin-top:-4px;transform:rotate(225deg)}.input-field-input:focus~label{color:var(--primary-color);font-weight:var(--font-weight-bold)}.input-field-input:focus~.input-field-border{opacity:1}.input-field-input:disabled~label,.input-field-input:focus~label,.input-field-input:not(:empty)~label,.input-field-input:valid~label{opacity:1;padding:0 .3125rem;transform:translate(-.1875rem,calc(var(--height)/-2 + .0625rem)) scale(.75)}.input-field-input-fake{bottom:auto!important;height:auto!important;left:0;opacity:0;pointer-events:none;position:absolute!important;right:auto!important;top:0;z-index:-3}.input-fields-row{display:flex}.input-fields-row .input-field{flex:1 1 auto;width:1%}.input-wrapper>*+*{margin-top:1.5rem}::-moz-placeholder{color:#909192;opacity:1}::placeholder{color:#909192;opacity:1}:-ms-input-placeholder{color:#909192}::-ms-input-placeholder{color:#909192}button:focus,input:focus{outline:none}.input-clear{border:none;outline:none;padding:0}body.animation-level-0 .input-clear.error{color:var(--danger-color)!important}body:not(.animation-level-0) .input-clear.error{animation:input-shake .2s ease-in-out forwards}@keyframes input-shake{0%{transform:translateX(0)}25%{transform:translateX(-.5rem)}75%{transform:translateX(.5rem)}to{transform:translateX(0)}}.input-search{--border-radius:22px;margin-left:.4375rem;margin-right:.4375rem;overflow:hidden;position:relative;width:100%}@media only screen and (max-width:600px){[dir=ltr] .input-search{margin-left:1rem}[dir=rtl] .input-search{margin-right:1rem}}.input-search-input{--height:42px;background-color:var(--input-search-background-color);border-color:var(--input-search-border-color);height:var(--height);line-height:var(--height);max-height:var(--height)!important;min-height:var(--height)!important;padding:0 calc(var(--height) + 3px - var(--border-width))}body.animation-level-2 .input-search-input{transition:border-color .2s ease-in-out}html.no-touch .input-search-input:active:not(:focus),html.no-touch .input-search-input:hover:not(:focus){border-color:var(--secondary-color)!important}.input-search-input:focus{background-color:transparent;border-color:var(--primary-color)}.input-search-input:focus~.tgico{color:var(--primary-color);opacity:1}html.no-touch .input-search-input:focus~.btn-icon:active,html.no-touch .input-search-input:focus~.btn-icon:hover{background-color:var(--light-primary-color)}.input-search-input:-moz-placeholder-shown~.tgico-close{display:none}.input-search-input:placeholder-shown~.tgico-close{display:none}.input-search>.tgico{color:var(--secondary-text-color);font-size:1.5rem;line-height:1;opacity:.6;position:absolute;text-align:center;top:50%;transform:translateY(-50%);z-index:1}body.animation-level-2 .input-search>.tgico{transition:opacity .2s ease-out,color .2s ease-out}[dir=ltr] .input-search>.tgico-search{left:.8125rem}[dir=rtl] .input-search>.tgico-search{right:.8125rem}.input-search>.tgico-search{height:1.5rem;pointer-events:none;width:1.5rem}[dir=ltr] .input-search>.tgico-close{right:0}[dir=rtl] .input-search>.tgico-close{left:0}.input-search>.tgico-close{height:42px;width:42px;z-index:1}[dir=ltr] .input-search>.tgico-close:before{margin-right:-1px}[dir=rtl] .input-search>.tgico-close:before{margin-left:-1px}[dir=ltr] .input-field-password .input-field-input{padding-right:2.5rem}[dir=rtl] .input-field-password .input-field-input{padding-left:2.5rem}.input-field-password .input-field-input{max-height:var(--height)}.input-field-password .input-field-input[type=password]{font-family:Arial,Helvetica,sans-serif;font-size:2.25rem;line-height:1;padding-bottom:0;padding-left:calc(.875rem - var(--border-width));padding-top:0}@media(-webkit-min-device-pixel-ratio:2){.input-field-password .input-field-input[type=password]{font-size:1.75rem;letter-spacing:.125rem}}html.is-ios .input-field-password .input-field-input[type=password]{font-size:1rem}.input-field-password .toggle-visible{align-items:center;color:#9e9e9e;cursor:pointer;display:flex;font-size:1.5rem;justify-content:center;padding:.5rem;position:absolute;right:.375rem;top:50%;transform:translateY(-50%);transition:color .2s;z-index:2}.input-field-password .toggle-visible:before{content:""}.input-field-password .toggle-visible.eye-hidden:before{content:""}html.no-touch .input-field-password .toggle-visible:active,html.no-touch .input-field-password .toggle-visible:hover{color:var(--primary-text-color)}.input-field-phone .input-field-input{--letter-spacing:.24px}.input-field-phone .input-field-input:after{color:#9e9e9e;content:attr(data-left-pattern);letter-spacing:var(--letter-spacing)}.btn,.btn-icon{background:none;border:none;cursor:pointer;outline:none}body.animation-level-0 .btn,body.animation-level-0 .btn-icon{transition:none}html.no-touch .btn-icon:active,html.no-touch .btn-icon:hover,html.no-touch .btn:active,html.no-touch .btn:hover{background-color:var(--light-secondary-text-color)}html.no-touch .btn-icon.active:active,html.no-touch .btn-icon.active:hover,html.no-touch .btn-icon.blue:active,html.no-touch .btn-icon.blue:hover,html.no-touch .btn-icon.primary:active,html.no-touch .btn-icon.primary:hover,html.no-touch .btn.active:active,html.no-touch .btn.active:hover,html.no-touch .btn.blue:active,html.no-touch .btn.blue:hover,html.no-touch .btn.primary:active,html.no-touch .btn.primary:hover{background-color:var(--light-primary-color)}html.no-touch .btn-icon.danger:active,html.no-touch .btn-icon.danger:hover,html.no-touch .btn.danger:active,html.no-touch .btn.danger:hover{background-color:var(--light-danger-color)}.btn-icon:disabled,.btn:disabled{opacity:var(--disabled-opacity);pointer-events:none!important}.btn-icon{align-items:center;background-color:transparent;border:none;border-radius:50%!important;color:var(--secondary-text-color);display:flex;font-size:1.5rem;justify-content:center;line-height:1;padding:.5rem;position:relative;text-align:center;transition:color .15s ease-in-out,opacity .15s ease-in-out}.btn-icon.rp{overflow:hidden}.btn-icon.active{color:var(--primary-color)}[dir=ltr] .btn-corner{right:var(--offset)}[dir=rtl] .btn-corner{left:var(--offset)}.btn-corner{--offset:1.25rem;--translateY:calc(54px + var(--offset));align-items:center;background-color:var(--primary-color);border:none;bottom:var(--offset);box-shadow:none!important;color:#fff;cursor:pointer;display:flex;font-size:1.5rem;justify-content:center;outline:none;padding:0!important;position:absolute!important;text-align:center;transform:translate3d(0,var(--translateY),0);transition:transform var(--btn-corner-transition)!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:3}html.no-touch .btn-corner:active,html.no-touch .btn-corner:hover{background-color:var(--dark-primary-color)}.btn-corner.is-visible{--translateY:0}body.animation-level-0 .btn-corner{transition:none!important}.btn-corner:disabled{opacity:1!important;pointer-events:all!important}.btn-corner .preloader-circular{height:2.5rem;width:2.5rem}.btn-menu{-webkit-touch-callout:none;-webkit-backdrop-filter:var(--menu-backdrop-filter);backdrop-filter:var(--menu-backdrop-filter);background-color:var(--menu-background-color);border-radius:10px;font-size:1rem;min-width:11.25rem;opacity:0;padding:.3125rem 0;position:absolute;top:100%;transform:scale(.8)!important;transition:opacity var(--btn-menu-transition),transform var(--btn-menu-transition),visibility var(--btn-menu-transition);-webkit-user-select:none;visibility:hidden;z-index:4}.btn-menu-old,.is-mobile .btn-menu{-webkit-backdrop-filter:none;backdrop-filter:none;background-color:var(--surface-color);min-width:auto;padding:.5rem 0}.btn-menu-old .btn-menu-item,.is-mobile .btn-menu .btn-menu-item{--padding-left:1rem;--padding-right:2.5rem;--icon-margin:1.5rem;--icon-size:1.5rem;border-radius:0;font-size:var(--font-size-16);font-weight:400;height:3rem;line-height:var(--line-height-16);margin:0;transform:none!important}.btn-menu-old .btn-menu-item:before,.is-mobile .btn-menu .btn-menu-item:before{align-self:auto;color:var(--secondary-text-color);margin-top:0}.btn-menu-old .btn-menu-footer,.is-mobile .btn-menu .btn-menu-footer{background-color:var(--background-color)}.btn-menu{box-shadow:var(--menu-box-shadow)}body.animation-level-0 .btn-menu{transition:none}.btn-menu.active{opacity:1;visibility:visible}.btn-menu.active,.is-mobile .btn-menu.was-open{transform:scaleX(1)!important}.btn-menu.bottom-left,.is-rtl .btn-menu.bottom-right{left:auto;right:0;top:100%;transform-origin:top right}.btn-menu.bottom-right,.is-rtl .btn-menu.bottom-left{left:0;right:auto;top:100%;transform-origin:top left}.btn-menu.bottom-center{transform-origin:top center}.btn-menu.top-left{bottom:100%;left:auto;right:0;top:auto;transform-origin:bottom right}.btn-menu.top-right,.is-rtl .btn-menu.top-left{bottom:100%;left:0;right:auto;top:auto;transform-origin:bottom left}.btn-menu.top-center{transform-origin:bottom center}.btn-menu.center-left{transform-origin:center right}.btn-menu.center-right{transform-origin:center left}[dir=ltr] .btn-menu-item{text-align:left}[dir=rtl] .btn-menu-item{text-align:right}.btn-menu-item{--padding-vertical:.25rem;--padding-left:.75rem;--padding-right:.75rem;--icon-margin:1.25rem;--icon-size:1.25rem;align-items:center;border-radius:.3125rem;color:var(--primary-text-color);cursor:pointer!important;display:flex;font-size:var(--font-size-14);font-weight:500;height:2rem;line-height:var(--line-height-14);margin-left:.3125rem;margin-right:.3125rem;padding:var(--padding-vertical) var(--padding-right) var(--padding-vertical) var(--padding-left);pointer-events:all!important;position:relative;text-transform:none;transform:scale(1);white-space:nowrap}.btn-menu-item.tgico-char:before{width:var(--icon-size)}body.animation-level-2 .btn-menu-item{transition:transform var(--btn-menu-transition)}.btn-menu-item:active{transform:scale(.96)}html.no-touch .btn-menu-item:active,html.no-touch .btn-menu-item:hover{background-color:var(--light-secondary-text-color)}html.no-touch .btn-menu-item.danger:active,html.no-touch .btn-menu-item.danger:hover{background-color:var(--light-danger-color)}.btn-menu-item:before{align-self:flex-start;color:var(--primary-text-color);font-size:var(--icon-size);margin-top:.125rem}[dir=ltr] .btn-menu-item-icon,[dir=ltr] .btn-menu-item:before{margin-right:var(--icon-margin)}[dir=rtl] .btn-menu-item-icon,[dir=rtl] .btn-menu-item:before{margin-left:var(--icon-margin)}.btn-menu-item-icon,.btn-menu-item:before{position:relative}[dir=ltr] .btn-menu-item-icon{margin-right:calc(var(--icon-margin) - var(--add)/2)}[dir=rtl] .btn-menu-item-icon{margin-left:calc(var(--icon-margin) - var(--add)/2)}[dir=ltr] .btn-menu-item-icon{margin-left:calc(var(--add)/-2)}[dir=rtl] .btn-menu-item-icon{margin-right:calc(var(--add)/-2)}.btn-menu-item-icon{--add:.25rem;--total:calc(var(--icon-size) + var(--add));flex:0 0 auto;height:var(--total);width:var(--total)}.btn-menu-item-icon .media-photo{height:inherit;width:inherit}@media only screen and (max-width:600px){.btn-menu-item{--padding-right:1.875rem}}.btn-menu-item-text{flex:1 1 auto;position:relative}.btn-menu-item-text,.btn-menu-item-text-fake{pointer-events:none}[dir=ltr] .btn-menu-item-text-fake{margin-left:var(--margin-left)}[dir=rtl] .btn-menu-item-text-fake{margin-right:var(--margin-left)}.btn-menu-item-text-fake{--margin-left:calc(var(--icon-size) + var(--icon-margin));max-width:calc(100% - var(--margin-left) - var(--padding-left) - var(--padding-right));overflow:hidden;position:absolute;text-overflow:ellipsis;white-space:nowrap}.btn-menu-item-subtitle{color:var(--secondary-text-color);font-size:.875rem}.btn-menu-item-header{color:var(--secondary-text-color);font-weight:var(--font-weight-bold);height:2rem;pointer-events:none!important}[dir=ltr] .btn-menu-item .stacked-avatars{right:.5rem}[dir=rtl] .btn-menu-item .stacked-avatars{left:.5rem}.btn-menu-item .stacked-avatars{--margin-right:-.6875rem;flex:0 0 auto;pointer-events:none;position:absolute}.btn-menu-item.is-multiline{font-size:.75rem;height:auto;max-width:16.25rem;min-width:calc(100% - .625rem);width:-moz-fit-content;width:fit-content}.btn-menu-item.is-multiline .btn-menu-item-text{white-space:pre-wrap;width:-moz-fit-content;width:fit-content}.btn-menu-item .checkbox-field-toggle{padding:0}.btn-menu-overlay{bottom:0;bottom:-100vh;cursor:default;left:0;left:-100vw;max-width:none!important;position:fixed!important;right:0;right:-100vw;top:0;top:-100vh;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important;z-index:4}.btn-menu.has-footer{padding-bottom:0}.btn-menu-footer{align-items:center;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;color:currentColor;display:flex;font-size:.875rem;height:2.5rem;justify-content:center}.btn-menu hr{display:block!important;margin:.3125rem auto;opacity:.6;padding:0;width:calc(100% - 1.875rem)}html:not(.is-mobile) .btn-menu .badge{background-color:transparent;color:var(--secondary-text-color)}.btn-menu-reactions{--inner-shadow-degree:90deg;-webkit-backdrop-filter:var(--menu-backdrop-filter);backdrop-filter:var(--menu-backdrop-filter);background-color:var(--menu-background-color);border-radius:var(--height);filter:drop-shadow(0 .125rem .5rem rgba(0,0,0,.24));height:inherit;max-height:100%;max-width:100%;opacity:0;position:absolute;transform:scale(.8);transform-origin:bottom left}[dir=ltr] .btn-menu-reactions-container{margin-left:var(--other-side-offset)}[dir=rtl] .btn-menu-reactions-container{margin-right:var(--other-side-offset)}.btn-menu-reactions-container{--height:2.25rem;--bubble-side-offset:0rem;--other-side-offset:0rem;--menu-offset:calc((var(--height) + 0.5rem)*-1);--width:calc(var(--menu-width) + (var(--bubble-side-offset) + var(--other-side-offset))*-1);display:flex;height:var(--height);justify-content:flex-start;margin-top:var(--menu-offset);max-width:var(--width);position:fixed;width:var(--width);z-index:4}.contextmenu.bottom-left+.btn-menu-reactions-container .btn-menu-reactions,.contextmenu.center-left+.btn-menu-reactions-container .btn-menu-reactions{transform-origin:bottom right!important}.contextmenu.bottom-center+.btn-menu-reactions-container .btn-menu-reactions{transform-origin:bottom center!important}[dir=ltr] .btn-menu-reactions-container-vertical{margin-left:var(--menu-offset)}[dir=rtl] .btn-menu-reactions-container-vertical{margin-right:var(--menu-offset)}.btn-menu-reactions-container-vertical{flex-direction:column;height:var(--width);margin-top:0;max-height:var(--width);max-width:var(--height);width:var(--height)}.btn-menu-reactions-container-vertical .btn-menu-reactions{--inner-shadow-degree:180deg;display:flex;flex-direction:column;height:auto;transform-origin:top right;width:inherit}.btn-menu-reactions-container-vertical .btn-menu-reactions-reaction{--padding-vertical:var(--padding-base);--padding-horizontal:0rem}.btn-menu-reactions-container-vertical .btn-menu-reactions-bubble-big{bottom:var(--offset);right:calc(var(--size)/-2)}body.animation-level-2 .btn-menu-reactions{transition:opacity var(--transition-standard-in),transform var(--transition-standard-in)}.btn-menu-reactions.is-visible{opacity:1;transform:scale(1)}.btn-menu-reactions-bubble{background-color:inherit;border-radius:50%;position:absolute;z-index:-1}.btn-menu-reactions-bubble-big{--size:1rem;--offset:calc(var(--height)/2);bottom:calc(var(--size)/-2);height:var(--size);right:var(--offset);width:var(--size)}.btn-menu-reactions:after{background:linear-gradient(var(--inner-shadow-degree),var(--surface-color) 0,rgba(var(--surface-color-rgb),0) 1rem,rgba(var(--surface-color-rgb),0) calc(100% - 1rem),var(--surface-color) 100%);border-radius:inherit;bottom:0;content:" ";left:0;pointer-events:none;position:absolute;right:0;top:0}.btn-menu-reactions .scrollable{border-radius:inherit;display:flex;position:relative}.btn-menu-reactions .scrollable-x{align-items:center;padding:0 .25rem}.btn-menu-reactions .scrollable-y{align-items:center;flex-direction:column;padding:.25rem 0}.btn-menu-reactions-reaction{--size:1.625rem;--padding-base:.25rem;--padding-vertical:0rem;--padding-horizontal:var(--padding-base);cursor:pointer;flex:0 0 auto;height:calc(var(--size) + var(--padding-vertical)*2);padding:var(--padding-vertical) var(--padding-horizontal);width:calc(var(--size) + var(--padding-horizontal)*2)}.btn-menu-reactions-reaction-scale{height:100%;width:100%}html:not(.is-safari) .btn-menu-reactions-reaction-scale{transform:scale(1)}html:not(.is-safari) body.animation-level-2 .btn-menu-reactions-reaction-scale{transition:transform .1s linear}html.no-touch:not(.is-safari) .btn-menu-reactions-reaction-select{transform:scale(1)}html.no-touch:not(.is-safari) .btn-menu-reactions-reaction-select:active,html.no-touch:not(.is-safari) .btn-menu-reactions-reaction-select:hover{transform:scale(1.25)}html.no-touch:not(.is-safari) body.animation-level-2 .btn-menu-reactions-reaction-select{transition:transform var(--transition-standard-in)}.btn-menu-reactions-reaction .media-sticker-wrapper{height:100%;position:relative;width:100%}.btn-primary{border:none;border-radius:10px;cursor:pointer;font-weight:var(--font-weight-bold);height:54px;overflow:hidden;padding:0;position:relative;text-align:center;transition:opacity .2s;width:100%}html.no-touch .btn-primary:active,html.no-touch .btn-primary:hover{background:var(--dark-primary-color);transition:opacity .2s}.btn-primary-transparent{background-color:transparent;color:var(--primary-color)}html.no-touch .btn-primary-transparent:active,html.no-touch .btn-primary-transparent:hover{background:var(--light-primary-color)}.btn-primary-transparent .c-ripple__circle{background-color:var(--light-primary-color)}html.no-touch .btn-primary-transparent.danger:active,html.no-touch .btn-primary-transparent.danger:hover{background-color:var(--light-danger-color)}.btn-primary-transparent .preloader-circular .preloader-path{stroke:var(--primary-color)}body.animation-level-0 .btn-primary{transition:none}[dir=ltr] .btn-primary use,[dir=ltr] .btn-primary>svg{right:15px}[dir=rtl] .btn-primary use,[dir=rtl] .btn-primary>svg{left:15px}.btn-primary use,.btn-primary>svg{height:calc(100% - 20px);left:auto}.btn-primary:disabled{opacity:var(--disabled-opacity);pointer-events:none!important}[dir=ltr] .btn-control{padding-left:.75rem;padding-right:1.5rem}[dir=rtl] .btn-control{padding-left:1.5rem;padding-right:.75rem}.btn-control{align-items:center;border-radius:1.25rem;display:flex;height:2.5rem;line-height:2.5rem;margin:.9375rem auto 1rem;width:auto}[dir=ltr] .btn-control.tgico:before{margin-right:.375rem}[dir=rtl] .btn-control.tgico:before{margin-left:.375rem}.btn-control.tgico:before{font-size:1.5rem}.btn-transparent{align-items:center;background-color:transparent;color:var(--primary-text-color);display:flex;font-weight:400;height:3rem;line-height:var(--line-height);padding:0 1rem}@media only screen and (max-width:600px){.btn-transparent{height:3rem}}html.no-touch .btn-transparent:active,html.no-touch .btn-transparent:hover{background-color:var(--light-secondary-text-color)}html.no-touch .btn-transparent.danger:active,html.no-touch .btn-transparent.danger:hover{background-color:var(--light-danger-color)}html.no-touch .btn-transparent.primary:active,html.no-touch .btn-transparent.primary:hover{background-color:var(--light-primary-color)}[dir=ltr] .btn-transparent:before{margin-right:2rem}[dir=rtl] .btn-transparent:before{margin-left:2rem}.btn-transparent:before{color:var(--secondary-text-color);font-size:1.5rem}@media only screen and (max-width:600px){[dir=ltr] .btn-transparent:before{margin-right:1.5rem}[dir=rtl] .btn-transparent:before{margin-left:1.5rem}}[dir=ltr] .btn-transparent.btn-short:before{margin-right:1rem}[dir=rtl] .btn-transparent.btn-short:before{margin-left:1rem}.btn-primary.btn-circle .preloader-circular{height:calc(100% - 20px);left:auto;margin:0;right:auto;top:10px}.btn-primary.btn-circle .preloader-circular .preloader-path{stroke:#fff}.btn-menu-toggle{cursor:pointer!important;font-weight:400!important;overflow:visible!important;pointer-events:all!important;position:relative}.btn-menu-toggle:not(.btn-primary):not(.btn-corner).menu-open{background-color:var(--light-secondary-text-color)}.btn-menu-toggle .btn-menu{margin-top:.5rem}.btn-circle{--size:54px;border-radius:50%;height:var(--size);line-height:var(--size);width:var(--size)}@media only screen and (max-width:600px){.btn-circle{--size:46px}}.btn-circle path{fill:#fff}.btn-disabled{color:var(--secondary-text-color)!important;cursor:default!important;pointer-events:none!important}.btn-disabled:before{color:inherit!important}.btn-secondary:not(:first-child){margin-top:.5rem!important}.btn-color-primary{background:var(--primary-color);color:#fff}.call-button{-webkit-backdrop-filter:blur(25px);backdrop-filter:blur(25px);border-radius:50%;font-size:1.5rem;height:var(--call-button-size);justify-content:center;position:relative}.call-button,.call-button-container{align-items:center;cursor:pointer;display:flex;width:var(--call-button-size)}.call-button-container{flex-direction:column}.call-button-container.disabled,.call-button-container.disabled .call-button{pointer-events:none}.call-button-container.disabled .call-button,.call-button-container.disabled .call-button-text{opacity:.8}.call-button-text{font-size:.875rem;margin-top:.25rem;white-space:nowrap}body.animation-level-2 .call-button-text{transition:opacity var(--transition-standard-in)}body.animation-level-2 .call-button{transition:background-color var(--transition-standard-in),opacity var(--transition-standard-in)}[dir=ltr] .call-button+.call-button,[dir=ltr] .call-button-container+.call-button-container{margin-left:var(--call-button-margin)}[dir=rtl] .call-button+.call-button,[dir=rtl] .call-button-container+.call-button-container{margin-right:var(--call-button-margin)}[dir=ltr] .btn-update{right:auto!important}[dir=rtl] .btn-update{left:auto!important}.btn-update{border-radius:var(--size);font-size:1rem;font-weight:var(--font-weight-bold);padding:0 2rem!important;width:auto}.animated-close-icon{pointer-events:none;position:absolute;transform:rotate(-45deg)}.animated-close-icon,.animated-close-icon:after,.animated-close-icon:before{background-color:var(--secondary-text-color);border-radius:.125rem;height:.125rem;width:1.125rem}.animated-close-icon:after,.animated-close-icon:before{content:"";left:0;position:absolute;top:0}.animated-close-icon:before{transform:rotate(90deg)}body.animation-level-2 .animated-close-icon,body.animation-level-2 .animated-close-icon:after,body.animation-level-2 .animated-close-icon:before{transition:transform var(--slide-header-transition)}.animated-close-icon.state-back{transform:rotate(180deg)}.animated-close-icon.state-back:before{transform:rotate(45deg) scaleX(.75) translateY(-.375rem)}.animated-close-icon.state-back:after{transform:rotate(-45deg) scaleX(.75) translateY(.375rem)}.animated-menu-icon{--color:var(--secondary-text-color);position:absolute}.animated-menu-icon,.animated-menu-icon:after,.animated-menu-icon:before{background-color:var(--color);border-radius:.125rem;height:.125rem;transform:rotate(0);width:1.125rem}body.animation-level-2 .animated-menu-icon,body.animation-level-2 .animated-menu-icon:after,body.animation-level-2 .animated-menu-icon:before{transition:transform .25s}.animated-menu-icon:after,.animated-menu-icon:before{content:"";left:0;position:absolute}.animated-menu-icon:before{top:-.3125rem}.animated-menu-icon:after{top:.3125rem}.animated-menu-icon.state-back{transform:rotate(180deg)}.animated-menu-icon.state-back:before{transform:rotate(45deg) scaleX(.75) translate(.375rem,-.1875rem)}.animated-menu-icon.state-back:after{transform:rotate(-45deg) scaleX(.75) translate(.375rem,.1875rem)}.animated-menu-close-icon{margin-top:-.625rem}.animated-menu-close-icon:before{opacity:1;top:.3125rem}body.animation-level-2 .animated-menu-close-icon:before{transition:transform .25s,opacity .125s 0s}.animated-menu-close-icon:after{top:.625rem}.animated-menu-close-icon.state-back{transform:translateY(.3125rem) rotate(135deg)}.animated-menu-close-icon.state-back:before{opacity:0;transform:rotate(45deg)}.animated-menu-close-icon.state-back:after{transform:translateY(-.625rem) rotate(90deg)}.animated-button-icon>.tgico{height:24px;line-height:24px;position:absolute}body:not(.animation-level-0) .animated-button-icon>.tgico{animation:hide-icon .4s ease-in-out forwards}body.animation-level-0 .animated-button-icon>.tgico{animation:none!important;visibility:hidden}.autocomplete-helper{--border-radius:10px;border-radius:var(--border-radius)!important;bottom:calc(100% + .5rem);left:0;max-width:100%;overflow:hidden;padding:0!important;position:absolute!important;width:auto!important}.autocomplete-helper:not(.is-visible){display:none}.autocomplete-helper.is-visible{visibility:hidden}body.animation-level-2 .autocomplete-helper.is-visible{animation:fade-out-opacity .2s ease-in-out forwards;transition:visibility 0s .2s}.bubbles:not(.is-selecting)~.chat-input .autocomplete-helper.is-visible:not(.backwards){visibility:visible}body.animation-level-2 .bubbles:not(.is-selecting)~.chat-input .autocomplete-helper.is-visible:not(.backwards){animation-name:fade-in-opacity;transition:visibility 0s 0s}@media only screen and (max-width:319px){.autocomplete-helper{max-width:calc(100vw - var(--padding-horizontal)*4)}}.autocomplete-peer-helper .scrollable{max-height:232px;position:relative}.autocomplete-peer-helper-list{padding:.5rem 0}.autocomplete-peer-helper-list-element{align-items:center;cursor:pointer;display:flex;height:3.125rem;line-height:var(--line-height);padding:0 2.125rem 0 .75rem;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media only screen and (max-width:600px){.autocomplete-peer-helper-list-element{padding-right:.75rem}}.autocomplete-peer-helper-list-element-name{flex:0 0 auto;font-weight:var(--font-weight-bold);margin-left:.875rem}.autocomplete-peer-helper-list-element-description{color:var(--secondary-text-color);margin-left:.5625rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.autocomplete-peer-helper-list-element-avatar{flex:0 0 auto}.badge{--size:1.375rem;--padding:.4375rem;border-radius:calc(var(--size)/2);color:var(--badge-text-color);font-size:.875rem;font-weight:var(--font-weight-bold);height:var(--size);line-height:var(--size)!important;min-width:var(--size);padding:0 var(--padding);text-align:center}body.animation-level-2 .badge{transition:background-color .2s ease-in-out}.badge:not(.tgico):empty{display:none}.badge-20{--size:1.25rem;--padding:.375rem}.badge-24{--size:1.5rem;--padding:.5rem}.badge.tgico:before{font-size:var(--size)}.badge-primary{background-color:var(--primary-color)}.badge-gray{background-color:var(--secondary-color)}.ckin__player{letter-spacing:.02em;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ckin__player.ckin__fullscreen{background:#000;border-radius:0!important;bottom:0;display:flex;height:100%;left:0;position:fixed;right:0;top:0;width:100%;z-index:10000000}.ckin__player.ckin__fullscreen video{height:100%;-o-object-fit:contain;object-fit:contain;width:100%}.ckin__player .time{color:#fff;font-size:.875rem;margin-left:.875rem}@media only screen and (max-width:600px){.ckin__player .time{margin-left:1.125rem}}.default{align-items:center;display:flex;font-size:0;justify-content:center;position:relative}.default.show-controls video{cursor:pointer}.default__button{color:#fff;padding:.375rem}.default__button i{align-self:center}.default__button--big{background:none;border:0;color:#fff;font-size:4rem;left:50%;line-height:1;opacity:1;outline:0;padding:0;position:absolute;text-align:center;top:50%;transform:translate3d(-50%,-50%,0) scale(1)}@media only screen and (min-width:601px){.default__button--big{pointer-events:none}}body.animation-level-2 .default__button--big{transition:opacity var(--layer-transition)}@media only screen and (max-width:600px){.default__button--big{font-size:3rem}}.default:not(.played) .default__button--big{opacity:0}[dir=ltr] .default__controls{text-align:left}[dir=rtl] .default__controls{text-align:right}.default__controls{bottom:0;direction:ltr;left:0;position:absolute;right:0;z-index:6}body.animation-level-2 .default__controls{transition:transform var(--layer-transition)}.default__controls .progress-line{border-radius:var(--border-radius);margin:0 16px}.default__controls .progress-line__filled{background:var(--primary-color)}.default__controls .progress-line__loaded{background-color:#fff}.default__controls .progress-line{background:hsla(0,0%,100%,.38)}@media only screen and (max-width:600px){.default__controls .progress-line{margin-bottom:-1px}}.default__gradient-bottom{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==);background-position:bottom;background-repeat:repeat-x;bottom:0;height:49px;padding-top:93px;pointer-events:none;position:absolute;width:100%;z-index:2}body.animation-level-2 .default__gradient-bottom{transition:transform var(--layer-transition)}@media only screen and (max-width:600px){.default:not(.ckin__fullscreen) .default__gradient-bottom{display:none}}.default .toggle:before{content:""}.default .default__gradient-bottom{transform:translate3d(0,50px,0)}.default .default__controls{transform:translate3d(0,52px,0)}@media only screen and (max-width:600px){.default .default__controls{transform:translate3d(0,65px,0)}}.default.show-controls .default__controls,.default.show-controls .default__gradient-bottom{transform:translateZ(0)}.default.is-playing:not(.show-controls){cursor:none}.default.is-playing .default__button--big,.default.is-seeking .default__button--big,.default:not(.played) .default__button--big{opacity:0}.default.is-playing .toggle:not(.default__button--big):before,.default.is-seeking .toggle:not(.default__button--big):before,.default:not(.played) .toggle:not(.default__button--big):before{content:""}.default .is-seeking+.default__button--big{opacity:0}.default .player-volume{--icon-size:2.25rem;--icon-margin-right:.5rem;--selector-size:50px;--selector-thumb-size:.75rem;--hide-width:var(--icon-size);--show-width:calc(var(--icon-size) + var(--icon-margin-right) + var(--selector-size) + var(--selector-thumb-size)*0.75);align-items:center;display:flex;overflow:hidden;width:var(--hide-width)}body.animation-level-2 .default .player-volume{transition:width var(--layer-transition)}html.is-touch .default .player-volume{display:none}html:not(.is-touch) .default .player-volume+.time{margin-left:.5rem}html.no-touch .default .player-volume:active,html.no-touch .default .player-volume:hover{width:var(--show-width)}.default .player-volume__icon{color:#fff;cursor:pointer;display:flex;font-size:1.5rem;height:var(--icon-size);margin-right:var(--icon-margin-right);padding:.375rem;width:var(--icon-size)}.default .player-volume .progress-line{--color:#fff;--thumb-size:var(--selector-thumb-size);--height:4px;margin:0;min-width:var(--selector-size);width:var(--selector-size)}html.is-ios .default .player-volume .progress-line{display:none}.default.is-buffering>.toggle{display:none!important}video::-webkit-media-controls-enclosure{display:none!important}.progress-line{--color:var(--primary-color);--height:5px;--border-radius:6px;--thumb-size:13px;border-radius:var(--border-radius);cursor:pointer;height:var(--height);position:relative}.progress-line:before{border-radius:inherit;bottom:0;content:" ";display:block;left:0;position:absolute;right:0;top:0}.progress-line__seek{-webkit-appearance:none;-moz-appearance:none;background:transparent;bottom:-.5rem;caret-color:var(--color);cursor:pointer;margin:0;outline:none;padding:0;position:absolute;top:-.5rem;width:100%}.progress-line__seek:focus{outline:none}.progress-line__seek::-webkit-slider-thumb{display:none}.progress-line__seek::-moz-range-thumb{display:none;height:0;width:0}.progress-line__seek::-moz-range-track{display:none}.progress-line__seek::-webkit-slider-runnable-track{display:none}.progress-line__filled{max-width:100%}.progress-line__filled:not(.progress-line__loaded){background-color:var(--color);z-index:1}.progress-line__filled:not(.progress-line__loaded):after{background-color:var(--color);border-radius:50%;content:" ";cursor:pointer;display:block;height:var(--thumb-size);position:absolute;right:0;top:calc((var(--thumb-size) - var(--height))/-2);transform:translateX(calc(var(--thumb-size)/2)) scale(1);width:var(--thumb-size)}body.animation-level-2 .progress-line__filled:not(.progress-line__loaded):after{transition:transform .125s ease-in-out}.progress-line.is-focused .progress-line__filled:not(.progress-line__loaded):after{transform:translateX(calc(var(--thumb-size)/2)) scale(1.125)}.progress-line:before,.progress-line__loaded{background-color:var(--secondary-color);opacity:.3}.progress-line__filled,.progress-line__loaded{border-radius:var(--border-radius);bottom:0;position:absolute;top:0}body.animation-level-2 .progress-line.with-transition .progress-line__filled{transition:width .2s}.progress-line.use-transform .progress-line__filled{transform-origin:left center;width:100%}input[type=range]::-ms-track{visibility:hidden}input[type=range]::-ms-ticks{background:none;border:none;color:none}input[type=range]::-ms-thumb,input[type=range]::-ms-tooltip{visibility:hidden}.bottom-controls,.left-controls,.right-controls{align-items:center;display:flex}.bottom-controls{height:2.25rem;justify-content:space-between;padding:0 .625rem}@media only screen and (max-width:600px){.bottom-controls{height:3.625rem}}[dir=ltr] .checkbox-field{text-align:left}[dir=rtl] .checkbox-field{text-align:right}.checkbox-field{--size:1.25rem;--offset-left:0px;cursor:pointer;display:block;margin:1.5rem 1.1875rem;min-height:var(--size);min-width:var(--size);position:relative}body.animation-level-2 .checkbox-field{transition:opacity .2s}.checkbox-field.checkbox-disabled{opacity:var(--disabled-opacity);pointer-events:none!important}@media only screen and (max-width:600px){.checkbox-field{margin-bottom:27px}}[dir=ltr] .checkbox-field .checkbox-box{left:var(--offset-left)}[dir=rtl] .checkbox-field .checkbox-box{right:var(--offset-left)}.checkbox-field .checkbox-box{border-radius:.3125rem;height:var(--size);overflow:hidden;position:absolute;top:50%;transform:translateY(-50%);width:var(--size)}html.is-safari .checkbox-field .checkbox-box{-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}.checkbox-field .checkbox-box-background,.checkbox-field .checkbox-box-border,.checkbox-field .checkbox-box-check{left:0;position:absolute;top:0}.checkbox-field .checkbox-box-border{border:2px solid #8d969c;border-radius:inherit;bottom:0;left:0;right:0}.checkbox-field .checkbox-box-background{background-color:var(--primary-color);border-radius:50%;bottom:-15%;left:-15%;right:-15%;top:-15%;transform:scale(0);transition:transform .2s ease-in-out .05s}body.animation-level-0 .checkbox-field .checkbox-box-background{transition:none!important}.checkbox-field .checkbox-box-check{--offset:7px;height:calc(var(--size) - var(--offset));left:50%;top:50%;transform:translate(-50%,-50%);width:calc(var(--size) - var(--offset))}.checkbox-field .checkbox-box-check use{stroke:#fff;stroke-width:3.75;stroke-linecap:round;stroke-dasharray:0,24.19;stroke-dashoffset:0;transition:stroke-dasharray .1s ease-in-out,visibility 0s .1s;visibility:hidden}body.animation-level-0 .checkbox-field .checkbox-box-check use{transition:none!important}[dir=ltr] .checkbox-field .checkbox-caption{padding-left:3.375rem}[dir=rtl] .checkbox-field .checkbox-caption{padding-right:3.375rem}.checkbox-field .checkbox-caption{color:inherit;line-height:var(--line-height);overflow:hidden;pointer-events:none;position:relative;text-overflow:ellipsis;transition:opacity .2s;word-break:break-word}body.animation-level-0 .checkbox-field .checkbox-caption{transition:none}.checkbox-field.hover-effect{align-items:center;display:flex;height:3.5rem;margin-left:0;margin-right:0;padding:0 1.1875rem}[dir=ltr] .checkbox-field.hover-effect .checkbox-box{left:auto}[dir=rtl] .checkbox-field.hover-effect .checkbox-box{right:auto}.checkbox-field .anchor-url{pointer-events:all}.checkbox-ripple{border-radius:10px;overflow:hidden}.checkbox-ripple .checkbox-box,.checkbox-ripple .checkbox-caption{pointer-events:none}.checkbox-field-round{--size:1.5rem}.checkbox-field-round .checkbox-box{border-radius:50%;overflow:auto}.checkbox-field-round .checkbox-box-background{bottom:0;left:0;right:0;top:0}.checkbox-field-round .checkbox-box-border{border:2px solid var(--secondary-color);z-index:1}.checkbox-field-round .checkbox-box-check{--offset:calc(var(--size) - var(--size)/2 - 0.125rem)}html.is-safari .checkbox-field-round .checkbox-box{-webkit-mask-image:none}[dir=ltr] .radio-field{text-align:left}[dir=rtl] .radio-field{text-align:right}.radio-field{--size:1.375rem;--offset-left:0px;cursor:pointer;line-height:var(--line-height);margin:1.25rem 0;position:relative}.radio-field.hidden-widget{cursor:default}.radio-field.hidden-widget .radio-field-main:after,.radio-field.hidden-widget .radio-field-main:before{visibility:hidden}.radio-field>input:checked~.radio-field-main:before{border-color:var(--primary-color)}.radio-field>input:checked~.radio-field-main:after{transform:translateY(-50%) scale(1)}[dir=ltr] .radio-field .radio-field-main{padding-left:3.5rem}[dir=rtl] .radio-field .radio-field-main{padding-right:3.5rem}.radio-field .radio-field-main{color:inherit;position:relative}[dir=ltr] .radio-field .radio-field-main:after,[dir=ltr] .radio-field .radio-field-main:before{left:var(--offset-left)}[dir=rtl] .radio-field .radio-field-main:after,[dir=rtl] .radio-field .radio-field-main:before{right:var(--offset-left)}.radio-field .radio-field-main:after,.radio-field .radio-field-main:before{content:"";display:block;height:var(--size);position:absolute;top:50%;transform:translateY(-50%);width:var(--size)}.radio-field .radio-field-main:before{border:2px solid var(--secondary-text-color);border-radius:50%;opacity:1}body.animation-level-2 .radio-field .radio-field-main:before{transition:border-color .1s ease,opacity .1s ease}[dir=ltr] .radio-field .radio-field-main:after{left:calc(var(--offset-left) + .3125rem)}[dir=rtl] .radio-field .radio-field-main:after{right:calc(var(--offset-left) + .3125rem)}.radio-field .radio-field-main:after{background:var(--primary-color);border-radius:50%;height:.75rem;transform:translateY(-50%) scale(0);transform-origin:center;width:.75rem}body.animation-level-2 .radio-field .radio-field-main:after{transition:transform .1s ease}[dir=ltr] .radio-field.radio-field-right .radio-field-main:before{left:auto;right:0}[dir=rtl] .radio-field.radio-field-right .radio-field-main:before{left:0;right:auto}[dir=ltr] .radio-field.radio-field-right .radio-field-main:after{left:auto;right:.3125rem}[dir=rtl] .radio-field.radio-field-right .radio-field-main:after{left:.3125rem;right:auto}[type=checkbox],[type=radio]{box-sizing:border-box;opacity:0;padding:0;position:absolute;z-index:var(--z-below)}.checkbox-field .checkbox-field-input:checked:not(.is-fake-disabled)+.checkbox-box .checkbox-box-check use{stroke-dasharray:24.19,24.19;transition:stroke-dasharray .1s ease-in-out .15s,visibility 0s .15s;visibility:visible}.checkbox-field .checkbox-field-input:checked:not(.is-fake-disabled)+.checkbox-box .checkbox-box-background{transform:scale(1);transition:transform .2s ease-in-out 0s}.checkbox-field .checkbox-field-input:disabled+.checkbox-box,.checkbox-field .checkbox-field-input:disabled~.checkbox-caption{cursor:default;opacity:var(--disabled-opacity)}.checkbox-field-restriction .checkbox-box-border{display:none}.checkbox-field-restriction .checkbox-box-background{transform:none!important;transition:background-color .2s!important}.checkbox-field-restriction .checkbox-box-check use{stroke-dasharray:24.19,24.19!important;transform:rotate(0) translateY(0);transition:stroke-dashoffset .2s ease-in-out,transform .2s ease-in-out!important;visibility:visible!important}.checkbox-field-restriction [type=checkbox]:not(:checked)+.checkbox-box .checkbox-box-check use{stroke-dashoffset:35.5;transform:rotate(45deg) translateY(-10px)}.checkbox-field-restriction [type=checkbox]:not(:checked)+.checkbox-box .checkbox-box-background{background-color:var(--danger-color)}.checkbox-field-toggle{--size:20px;align-items:center;display:flex;margin:0 .3125rem;padding:0 .25rem;pointer-events:none}.checkbox-field-toggle .checkbox-toggle{--offset:3px;--toggle-width:1.9375rem;align-items:center;background-color:var(--secondary-color);border-radius:12px;display:flex;height:.875rem;margin:0 var(--offset);position:relative;width:var(--toggle-width)}body.animation-level-2 .checkbox-field-toggle .checkbox-toggle{transition:background-color .1s}.checkbox-field-toggle .checkbox-toggle:before{background-color:var(--surface-color);border:2px solid var(--secondary-color);border-radius:50%;content:" ";height:1.25rem;position:absolute;transform:translateX(calc(var(--offset)*-1));width:1.25rem}body.animation-level-2 .checkbox-field-toggle .checkbox-toggle:before{transition:border-color .1s,transform .1s cubic-bezier(.22,.75,.7,1.3)}.checkbox-field-toggle-restriction .checkbox-toggle{background-color:var(--danger-color)}.checkbox-field-toggle-restriction .checkbox-toggle:before{border-color:var(--danger-color)}.checkbox-field-toggle [type=checkbox]:checked:not(.is-fake-disabled)+.checkbox-toggle{background-color:var(--primary-color)}.checkbox-field-toggle [type=checkbox]:checked:not(.is-fake-disabled)+.checkbox-toggle:before{border-color:var(--primary-color);transform:translateX(calc(var(--toggle-width) - 1.25rem + var(--offset)))}.chatlist-container{position:relative}@media only screen and (max-width:600px){.chatlist-container .search-group-recent.search-group{padding:2px 0 0}}.chatlist-container .search-group{margin-bottom:17px;padding:1rem 0 .5rem;width:100%}@media only screen and (max-width:600px){.chatlist-container .search-group{margin-bottom:0}}.chatlist-container .search-group__name{color:var(--secondary-text-color);font-weight:var(--font-weight-bold);padding:0 23px 1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media only screen and (max-width:600px){.chatlist-container .search-group__name{font-size:15px;padding:5px 9px 0 16px}}.chatlist-container .search-group-contacts{border-bottom:1px solid var(--border-color)}@media only screen and (max-width:600px){.chatlist-container .search-group-contacts{padding:0 0 2px}}.chatlist-container .search-group-people.search-group-contacts{padding:5px 0!important}.chatlist-container .search-group:last-child{border-bottom:none}.chatlist-container .search-super .search-group{margin-bottom:0;padding:0 0 .5rem}.chatlist-container .search-super .search-group__name{display:flex;justify-content:space-between;padding-top:1rem}ul.chatlist{padding:0 .5rem}@media only screen and (max-width:600px){ul.chatlist{padding:0}}.chatlist{-webkit-touch-callout:none;background-color:var(--surface-color);display:flex;flex-direction:column;margin:0;position:relative;-moz-user-select:none;user-select:none;-webkit-user-select:none;width:100%}.chatlist-chat{--background:unset;-webkit-user-drag:none;background:var(--background)!important}.chatlist-chat.is-forum-open,.chatlist-chat.menu-open,html.no-touch .chatlist-chat:active,html.no-touch .chatlist-chat:hover{--background:var(--light-filled-secondary-text-color)}[dir=ltr] .chatlist-chat.is-muted .user-title:after{margin-left:.125rem}[dir=rtl] .chatlist-chat.is-muted .user-title:after{margin-right:.125rem}.chatlist-chat.is-muted .user-title:after{color:var(--chatlist-pinned-color);content:"";flex:0 0 auto;font-size:1.125rem}body:not(.animation-level-0) .chatlist-chat.is-muted.animating:not(.backwards) .user-title:after{animation:fade-in-opacity .2s ease-in-out forwards}body:not(.animation-level-0) .chatlist-chat.is-muted.animating.backwards .user-title:after{animation:fade-in-backwards-opacity .2s ease-in-out forwards}.chatlist-chat i{font-style:normal}.chatlist-chat .text-highlight{color:var(--primary-text-color)}.chatlist-chat .premium-icon{margin-top:-.125rem}.chatlist-chat .topic-icon{flex:0 0 auto}[dir=ltr] .chatlist-chat .row-title .topic-icon{margin-right:.25rem}[dir=rtl] .chatlist-chat .row-title .topic-icon{margin-left:.25rem}.chatlist-chat .row-title .topic-icon{--size:1.375rem}.chatlist-chat .topic-name .topic-icon{display:inline;line-height:1!important}.chatlist-chat .topic-name .topic-icon-svg{position:relative}.chatlist-chat .topic-name .topic-icon-content{left:0;margin-top:-6px;position:absolute;right:0;top:0}@media only screen and (min-width:601px){.chatlist-chat.active{--background:var(--primary-color)!important}.chatlist-chat.active .message-status,.chatlist-chat.active .premium-icon,.chatlist-chat.active .row-subtitle,.chatlist-chat.active .row-title,.chatlist-chat.active .sending-status-icon,.chatlist-chat.active .text-highlight,.chatlist-chat.active .tgico-chatspinned:before,.chatlist-chat.active .user-title,.chatlist-chat.active .verified-icon{color:#fff!important}.chatlist-chat.active .badge-fake{border-color:#fff;color:#fff}.chatlist-chat.active .danger,.chatlist-chat.active .primary-text{color:#fff!important}.chatlist-chat.active .user-title:after{color:hsla(0,0%,100%,.7)}.chatlist-chat.active .verified-icon-background{fill:#fff!important}.chatlist-chat.active .verified-icon-check{visibility:hidden}.chatlist-chat.active .dialog-avatar.is-online:after,.chatlist-chat.active .dialog-group-call-icon{background-color:#fff;border-color:var(--primary-color)}.chatlist-chat.active .badge.unread,.chatlist-chat.active .mention{background-color:#fff!important;color:var(--primary-color)}.chatlist-chat.active .peer-typing-container{--color:#fff}}.chatlist .peer-typing-container{--color:var(--secondary-text-color)}.chatlist .peer-typing-container .peer-typing-text{display:inline-flex;transform:translateY(-2px)}.chatlist .sending-status-icon.tgico-premium_lock{color:var(--secondary-color);font-size:.8125rem;margin:.1875rem 0 0 .5rem}[dir=ltr] .chatlist .dialog-title-details{margin-left:.5rem}[dir=rtl] .chatlist .dialog-title-details{margin-right:.5rem}.chatlist .dialog-title-details{flex:0 0 auto;font-size:.75rem;padding:1px 0 0}[dir=ltr] .chatlist .dialog-subtitle-badge{margin-left:.5rem}[dir=rtl] .chatlist .dialog-subtitle-badge{margin-right:.5rem}.chatlist .dialog-subtitle-badge{display:block!important;flex:0 0 auto}.chatlist .dialog-subtitle-badge.avatar-badge{--size:1.625rem;border:2px solid var(--background,var(--surface-color));line-height:23px!important;margin:0;pointer-events:none;position:absolute;right:calc(100% - 4.0625rem);top:2.4375rem}[dir=ltr] .chatlist .dialog-subtitle-media{margin-right:.375rem}[dir=rtl] .chatlist .dialog-subtitle-media{margin-left:.375rem}.chatlist .dialog-subtitle-media{border-radius:.25rem;display:inline-block;flex:0 0 auto;height:1.25rem;line-height:1.25rem;position:relative;width:1.25rem}.chatlist .dialog-subtitle-media:before{content:" ";display:inline-block;height:inherit;min-height:inherit;min-width:inherit;width:inherit}.chatlist .dialog-subtitle-media.is-round{border-radius:50%}.chatlist .dialog-subtitle-media.is-round .tgico-play{font-size:.875rem}.chatlist .dialog-subtitle-media .tgico-play{color:#fff;font-size:1rem;left:50%;line-height:1;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:1}.chatlist .dialog-subtitle-media .media-photo{border-radius:inherit;bottom:auto;height:inherit;-o-object-fit:cover;object-fit:cover;top:auto;width:inherit}.chatlist .dialog-group-call-icon{background-color:var(--avatar-online-color);border:2px solid var(--surface-color);border-radius:50%;height:20px;left:45px;overflow:hidden;position:absolute;top:45px;width:20px;z-index:2}body.animation-level-2 .chatlist .dialog-group-call-icon,body.animation-level-2 .chatlist .dialog-subtitle-badge{opacity:1;transform:scale(0);transition:none}body.animation-level-2 .chatlist .dialog-group-call-icon.is-visible:not(.backwards),body.animation-level-2 .chatlist .dialog-subtitle-badge.is-visible:not(.backwards){transform:scale(1)}body.animation-level-2 .chatlist .dialog-group-call-icon.backwards,body.animation-level-2 .chatlist .dialog-subtitle-badge.backwards{opacity:0}body.animation-level-2 .chatlist .dialog-group-call-icon.animating,body.animation-level-2 .chatlist .dialog-subtitle-badge.animating{transition:background-color var(--chatlist-badge-transition-in),transform var(--chatlist-badge-transition-in)}body.animation-level-2 .chatlist .dialog-group-call-icon.animating.backwards,body.animation-level-2 .chatlist .dialog-subtitle-badge.animating.backwards{transition:background-color var(--chatlist-badge-transition-out),transform var(--chatlist-badge-transition-out),opacity var(--chatlist-badge-transition-out)}body.animation-level-2 .chatlist .dialog-avatar:after{opacity:1;transform:scale(0);transition:none}body.animation-level-2 .chatlist .dialog-avatar.is-visible:not(.backwards):after{transform:scale(1)}body.animation-level-2 .chatlist .dialog-avatar.backwards:after{opacity:0}body.animation-level-2 .chatlist .dialog-avatar.animating:after{transition:background-color var(--chatlist-badge-transition-in),transform var(--chatlist-badge-transition-in)}body.animation-level-2 .chatlist .dialog-avatar.animating.backwards:after{transition:background-color var(--chatlist-badge-transition-out),transform var(--chatlist-badge-transition-out),opacity var(--chatlist-badge-transition-out)}.chatlist .dialog-avatar{flex:0 0 auto}.chatlist .dialog-avatar,.chatlist .row-row{pointer-events:none;position:relative}.chatlist .user-title{align-items:center;display:flex!important}.chatlist .user-title img.emoji{height:18px;margin-top:1px;vertical-align:top;width:18px}.chatlist .user-last-message img.emoji{height:20px;margin-top:-3px;width:20px}.chatlist .user-last-message,.chatlist .user-title{flex-grow:1;position:relative}[dir=ltr] .chatlist .message-status{margin-right:.125rem}[dir=rtl] .chatlist .message-status{margin-left:.125rem}.chatlist .message-status{color:var(--chatlist-status-color);display:inline-block;font-size:1.25rem;height:1.25rem;line-height:1;margin-top:-.0625rem;position:relative;vertical-align:middle;width:1.25rem}.chatlist .message-status:before{vertical-align:middle}.chatlist .tgico-chatspinned{background:transparent}body.animation-level-2 .chatlist .tgico-chatspinned:before{transition:opacity .2s ease-in-out}.chatlist .tgico-chatspinned:before{color:var(--chatlist-pinned-color);opacity:1}.chatlist .tgico-chatspinned.unread:before{opacity:0}.chatlist .tgico-chatspinned{position:relative}.chatlist .tgico-chatspinned:before{left:0;position:absolute;top:0}.chatlist .mention{background-color:var(--chatlist-status-color)!important;line-height:1.25rem!important;padding:0}[dir=ltr] .chatlist .mention-badge{margin-right:-.125rem}[dir=rtl] .chatlist .mention-badge{margin-left:-.125rem}.chatlist .is-muted.backwards .unread,.chatlist .unread{background-color:var(--chatlist-status-color)}.chatlist .is-muted .unread,.chatlist .no-unmuted-topic .unread{background-color:var(--secondary-color)}.chatlist .not-visited{--size:.5rem;--padding:0;background-color:var(--secondary-color)!important}.chatlist-parts.with-contacts .chatlist-top:not(.with-placeholder){height:auto;padding-bottom:.5rem}.chatlist-parts.with-contacts .chatlist-top.with-placeholder.has-contacts{height:24.125rem}.chatlist-parts.with-contacts .chatlist-top.with-placeholder .empty-placeholder-dialogs{top:50%}.chatlist-top{height:100%}.chatlist-bottom{max-height:36.375rem}.chatlist-bottom .sidebar-left-section{margin-bottom:0!important;padding-bottom:0}.chatlist-bottom .chatlist-new{padding:0}.chat-input{--translateY:0;--padding-bottom:0.5rem;--bottom:var(--padding-bottom);display:flex;flex:0 0 auto;flex-direction:column;max-width:100%;padding-top:.25rem;position:relative;transform:translate3d(0,var(--translateY),0);transition:transform var(--transition-standard-out);width:100%}body.animation-level-0 .chat-input{transition:none!important}@media only screen and (min-height:570px)and (min-width:601px){.chat-input{max-width:var(--messages-container-width)!important}}@media only screen and (min-width:601px){.chat-input{--padding-bottom:1.25rem}}@media only screen and (max-height:569px){.chat-input{--padding-bottom:0.5rem}}@media only screen and (min-width:1276px){.chat-input{width:calc(100% - var(--right-column-width))!important}body.is-right-column-shown .chat-input{transform:translate3d(calc(var(--right-column-width)/-2),var(--translateY),0)!important;transition:transform var(--transition-standard-in)}}.chat-input.is-hidden{--translateY:100%;bottom:0;position:absolute!important;transform:translate3d(0,var(--translateY),0)!important;transition:transform var(--transition-standard-in)}.bubbles.is-selecting:not(.backwards)~.chat-input.is-hidden{--translateY:0}.chat-input-container{--padding-horizontal:var(--chat-input-padding);align-items:flex-end;display:flex;flex:0 0 auto;justify-content:center;margin:0 auto;max-width:var(--messages-container-width);padding:0 var(--padding-horizontal);padding-bottom:var(--bottom);position:relative;width:100%}.chat-input-container .btn-circle{height:var(--chat-input-size);width:var(--chat-input-size)}.chat-input-container.is-centering .new-message-wrapper{pointer-events:none}.chat-input-container.is-centering:not(.backwards) .new-message-wrapper{opacity:0}.chat-input-container.is-centering:not(.backwards) .rows-wrapper{border-bottom-right-radius:12px;max-height:var(--chat-input-size)}.chat-input-container.is-centering:not(.backwards) .rows-wrapper .bubble-tail{opacity:0;transform:scaleX(-1) translateX(1.125rem)}.chat-input-container.is-centering:not(.backwards) .reply-wrapper{height:0!important;opacity:0;pointer-events:none}.chat-input-container.is-centering:not(.backwards) .btn-send{transform:scale(0)}.chat-input-container.is-centering.animating .rows-wrapper{transition:transform .2s,max-height .2s,border-radius .1s}.chat-input-container.is-centering.animating .rows-wrapper .bubble-tail{transition:transform .1s,opacity 25ms 0s}.chat-input-container.is-centering.animating .selection-wrapper{transition:opacity .1s 75ms}.chat-input-container.is-centering.animating .btn-send{transition:transform .2s}.chat-input-container.is-centering.animating:not(.backwards) .rows-wrapper .bubble-tail{transition:transform .1s,opacity 25ms 75ms}.chat-input .menu-send{bottom:calc(100% + .5rem);top:auto}.chat-input .toggle-emoticons:before{content:""}.chat-input .toggle-emoticons.flip-icon:before{content:""!important}[dir=ltr] .chat-input .btn-record-cancel{right:0}[dir=rtl] .chat-input .btn-record-cancel{left:0}.chat-input .btn-record-cancel{--multiplier:-1;opacity:0;padding:0;position:absolute;top:0;transform:translateX(calc((100% + var(--padding-horizontal) + .5rem)*var(--multiplier)));visibility:hidden;z-index:3}.chat-input .btn-record-cancel .c-ripple__circle,html.no-touch .chat-input .btn-record-cancel:active:after,html.no-touch .chat-input .btn-record-cancel:hover:after{background-color:var(--light-danger-color)}.chat-input .btn-record-cancel:before{color:var(--danger-color)}.is-rtl .chat-input .btn-record-cancel{--multiplier:1}[dir=ltr] .chat-input .btn-scheduled:after{right:5px}[dir=rtl] .chat-input .btn-scheduled:after{left:5px}.chat-input .btn-scheduled:after{background:var(--message-checkbox-color);border-radius:50%;content:"";height:.5rem;position:absolute;top:5px;width:.5rem}.chat-input .btn-preloader .preloader{height:1.5rem;width:1.5rem}.chat-input .btn-preloader .preloader .preloader-path{stroke:var(--secondary-text-color)}body.animation-level-2 .chat-input .btn-preloader.show.backwards{animation:hide-icon .4s ease-in-out forwards!important}[dir=ltr] .chat-input .float{margin-right:.75rem!important}[dir=rtl] .chat-input .float{margin-left:.75rem!important}.chat-input .float{align-self:center;display:none!important;margin:0!important}body.animation-level-2 .chat-input .float{animation:grow-icon .4s ease-in-out forwards!important}@media only screen and (max-height:569px),only screen and (max-width:600px){[dir=ltr] .chat-input .float{margin-right:.125rem!important}[dir=rtl] .chat-input .float{margin-left:.125rem!important}}.chat-input:not(.is-recording) .float.show:not(.hide){display:flex!important}[dir=ltr] .chat-input .btn-send-container{right:var(--padding-horizontal)}[dir=rtl] .chat-input .btn-send-container{left:var(--padding-horizontal)}.chat-input .btn-send-container{align-items:center;bottom:0;display:flex;justify-content:center;padding-bottom:inherit;position:absolute}.chat-input .btn-send-container .btn-menu-overlay{z-index:3}.chat-input .btn-icon{transition:opacity .2s}body.animation-level-0 .chat-input .btn-icon{transition:none}.chat-input .btn-cancel-record,.chat-input .btn-send{box-shadow:0 1px 8px 1px rgba(0,0,0,.12)}.chat-input .btn-send{background-color:var(--primary-color)!important;color:#fff!important;z-index:3}html.no-touch .chat-input .btn-send:active,html.no-touch .chat-input .btn-send:hover{background-color:var(--dark-primary-color)!important}.chat-input .btn-send .tgico-check{font-size:2rem;height:32px!important}.chat-input .btn-send .tgico-check:before{font-weight:var(--font-weight-bold)}.chat-input .btn-send.edit .tgico-check,.chat-input .btn-send.record .tgico-microphone_filled,.chat-input .btn-send.schedule .tgico-schedule,.chat-input .btn-send.send .tgico-send{visibility:visible!important}body.animation-level-2 .chat-input .btn-send.edit .tgico-check,body.animation-level-2 .chat-input .btn-send.record .tgico-microphone_filled,body.animation-level-2 .chat-input .btn-send.schedule .tgico-schedule,body.animation-level-2 .chat-input .btn-send.send .tgico-send{animation:grow-icon .4s ease-in-out forwards!important}.chat-input .btn-record-cancel,.chat-input .btn-send{font-size:1.5rem;line-height:1.5rem}.chat-input .record-time{display:none;height:44px;line-height:44px}.chat-input .record-time:after{background-color:var(--danger-color);border-radius:50%;content:" ";display:inline-block;height:10px;margin-left:9px;margin-right:9px;width:10px}body.animation-level-2 .chat-input .record-time:after{animation:recordBlink 1.25s infinite}.chat-input .record-ripple{background-color:var(--message-highlightning-color);border-radius:50%;height:300px;opacity:.5;position:absolute;transform:scale(0);visibility:hidden;width:300px}@media only screen and (max-width:600px){.chat-input .record-ripple{height:240px;width:240px}}.chat-input.is-locked{pointer-events:none}.chat-input.is-locked .btn-icon,.chat-input.is-locked:not(.is-recording) .btn-send{color:#c6cbce}.chat-input.is-recording:not(.backwards) .btn-record-cancel{opacity:1;visibility:visible}.chat-input.is-recording:not(.backwards) .btn-record-cancel,.chat-input.is-recording:not(.backwards) .btn-send{pointer-events:all}.chat-input.is-recording:not(.backwards) .record-ripple{visibility:visible}.chat-input.is-recording:not(.backwards) .rows-wrapper{width:calc(100% - var(--chat-input-size)*2 - 1rem)}.chat-input.is-recording:not(.backwards) .attach-file{display:none}.chat-input.is-recording:not(.backwards) .record-time{display:block}.chat-input.is-recording.animating .btn-record-cancel{transition:visibility 0s .1s,opacity .1s 0s}.chat-input.is-recording.animating .record-ripple{transition:transform .03s ease-in-out,visibility .1s}.chat-input.is-recording.animating .rows-wrapper{transition:width .2s}.chat-input.is-recording.animating:not(.backwards) .btn-record-cancel{transition:visibility 0s .1s,opacity .1s .1s}.chat-input.is-recording.animating:not(.backwards) .record-ripple{transition:transform .03s,visibility 0s}[dir=ltr] .chat-input:not(.is-recording) .btn-record-cancel{margin-right:0}[dir=rtl] .chat-input:not(.is-recording) .btn-record-cancel{margin-left:0}.chat-input:not(.is-recording) .btn-record-cancel{width:0}.chat-input .new-message-wrapper{opacity:1}.chat-input .reply-in-topic-overlay{align-items:center;background-color:inherit;border-radius:inherit;color:var(--secondary-text-color);display:flex;justify-content:center;padding:0 1rem;pointer-events:none;z-index:3}.bubbles.is-selecting:not(.backwards)~.chat-input .selection-wrapper{opacity:1}.bubbles.is-selecting.animating~.chat-input .new-message-wrapper{transition:opacity .1s 0s}.bubbles.is-selecting.animating~.chat-input .selection-container-left,.bubbles.is-selecting.animating~.chat-input .selection-container-right{transition:transform .2s}.bubbles.is-selecting.animating.backwards~.chat-input .new-message-wrapper{transition:opacity .1s .1s}.bubbles.is-selecting.animating.backwards~.chat-input .selection-wrapper{transition:opacity .1s 0s}@keyframes recordBlink{0%{opacity:1}50%{opacity:.2}to{opacity:1}}#column-center{flex:3;position:relative;width:100%}@media only screen and (max-width:600px){body.is-left-column-shown #column-center{transform:translate3d(100vw,0,0)}body.is-right-column-shown #column-center{filter:brightness(80%);transform:translate3d(-25vw,0,0)}}@media only screen and (min-width:601px)and (max-width:925px){#column-center{bottom:0;left:0;position:fixed!important;right:0;top:0;transform:translateZ(0)}body.animation-level-2 #column-center{transition:transform var(--layer-transition)}body.is-left-column-shown #column-center{transform:translate3d(26.5625rem,0,0)}body.is-left-column-shown #column-center .sidebar-close-button:before{transform:rotate(180deg)}}.chats-container{height:100%}.chat{align-items:center;display:flex!important;flex-direction:column;transition:transform var(--tabs-transition),filter var(--tabs-transition);width:100%}body.animation-level-0 .chat{transition:none!important}.chat:not(.active):not(:last-child){filter:brightness(.8)}@media only screen and (min-width:926px){.chat:not(.active){transform:translate3d(calc((100vw - min(40vw, 420px))*-.25),0,0)}.chat:not(.active):last-child{transform:translate3d(calc(100vw - min(40vw, 420px)),0,0)}}@media only screen and (min-width:1681px){.chat:not(.active){transform:translate3d(calc((1680px - var(--right-column-width))*-.25),0,0)}.chat:not(.active):last-child{transform:translate3d(calc(1680px - var(--right-column-width)),0,0)}}@media only screen and (min-width:1276px)and (max-width:1680px){.chat:not(.active){transform:translate3d(-25vw,0,0)}.chat:not(.active):last-child{transform:translate3d(75vw,0,0)}}@media only screen and (max-width:925px){.chat:not(.active){transform:translate3d(-25vw,0,0)}.chat:not(.active):last-child{transform:translate3d(100vw,0,0)}}.chat.no-forwards .bubble-beside-button.forward{display:none}.chat.no-forwards .bubbles{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.chat-background{background-color:#e6ebee;overflow:hidden}html.night .chat-background{background-color:var(--border-color)}.chat-background.no-transition:before{transition:none!important}.chat-background,.chat-background-item{bottom:0;left:0;position:absolute!important;right:0;top:0}.chat-background-item.is-image{background-color:inherit;background-image:url(assets/img/bg.jpeg);background-position:50%;background-size:cover}.chat-background-item.is-pattern{align-items:center;background-color:#000!important;background-image:none!important;background-repeat:repeat-x;background-size:contain;display:flex;justify-content:center;margin:0!important}@media only screen and (min-width:1276px){.chat-background-item.is-pattern{height:150%;top:-25%}}body.animation-level-2 .chat-background-item{opacity:0;transition:opacity var(--transition-standard-out)}body.animation-level-2 .chat-background-item.is-visible:not(.backwards){opacity:1;transition:opacity var(--transition-standard-in)}@media only screen and (min-width:1276px){body.animation-level-2 .chat-background-item{margin:-18.5rem 0 -22rem;transform:scale(1);transform-origin:left center;transition:transform var(--transition-standard-out),opacity var(--transition-standard-out)!important}body.animation-level-2.is-right-column-shown .chat-background-item{transform:scale(.666666667);transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)!important}}.chat-background-item-canvas{--opacity-max:1;opacity:var(--opacity-max);position:absolute;width:100%}.chat-background-item:not(.is-dark) .chat-background-item-pattern-canvas{mix-blend-mode:soft-light}.chat-background-item-color-canvas{height:100%;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:cover;mask-size:cover}.chat .drops-container{--padding:20px;--pinned-floating-height:0px;top:calc(56px + var(--pinned-floating-height) + var(--padding))}@media only screen and (min-width:1276px){[dir=ltr] body.is-right-column-shown .chat .drops-container{right:calc(var(--right-column-width))}[dir=rtl] body.is-right-column-shown .chat .drops-container{left:calc(var(--right-column-width))}}@media only screen and (max-width:600px){.chat .drops-container{--padding:10px}}.chat .drop{--wrapper-padding:15px;max-width:696px}.chat[data-type=chat] .bubbles.is-chat-input-hidden .bubbles-date-group:last-of-type .bubbles-group:last-of-type .bubble:last-of-type{margin-bottom:1.25rem}.chat-input-wrapper{--padding-vertical:.3125rem;--padding-horizontal:var(--chat-input-inner-padding);--padding:var(--padding-vertical) var(--padding-horizontal);--button-size:2.125rem;--button-horizontal-margin:.125rem;align-items:center;border-radius:1rem;display:flex;flex:0 0 auto;flex-direction:column;justify-content:center;max-height:30rem;max-width:calc(100% - var(--chat-input-size) - .5rem);min-height:var(--chat-input-size);position:relative;width:calc(100% - var(--chat-input-size) - .5rem);z-index:3}.chat-input-wrapper:before{background-color:#fff;border-radius:inherit;bottom:0;box-shadow:0 1px 8px 1px rgba(0,0,0,.12);content:" ";left:0;opacity:1;right:0;top:0}.chat-input-control,.chat-input-wrapper:before{background-color:var(--surface-color);position:absolute}.chat-input-control{--padding-vertical:.3125rem;--padding-horizontal:var(--chat-input-inner-padding);--padding:var(--padding-vertical) var(--padding-horizontal);height:var(--chat-input-size);margin:0 auto;padding:var(--padding);visibility:hidden;width:auto;z-index:3}.chat-input-control:before{opacity:0}.chat-input-control-button{height:2.5rem;justify-content:center;padding:0 .625rem}@media only screen and (max-width:600px){.chat-input-control-button{font-size:15px}}[dir=ltr] .chat-input-control-button:before{margin-right:10px}[dir=rtl] .chat-input-control-button:before{margin-left:10px}.fake-selection-wrapper,.selection-wrapper{max-width:calc(100% - var(--chat-input-padding)*2);position:absolute;top:0;width:28.75rem}.chat-input-control,.selection-wrapper{opacity:0}.selection-wrapper{background-color:var(--surface-color)}.selection-wrapper:before{content:none}.selection-wrapper .selection-container{align-items:center;border-radius:inherit;display:flex;font-size:15px;height:100%;justify-content:space-between;padding:inherit;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.selection-wrapper .selection-container-left,.selection-wrapper .selection-container-right{align-items:center;display:flex;justify-content:space-between;transform:translateX(0)}.selection-wrapper .selection-container-right{flex:0 0 auto}.selection-wrapper .selection-container-count{color:var(--primary-text-color);flex-grow:1;font-weight:var(--font-weight-bold);text-transform:capitalize;white-space:nowrap}[dir=ltr] .selection-wrapper .selection-container .btn-icon{margin-left:6px;margin-right:5px}[dir=rtl] .selection-wrapper .selection-container .btn-icon{margin-left:5px;margin-right:6px}.selection-wrapper .selection-container .btn-icon{height:42px;line-height:42px;width:42px}.selection-wrapper .selection-container .btn-primary{height:2.5rem;width:auto}@media only screen and (max-width:600px){.selection-wrapper .selection-container .btn-primary{padding:0 .5rem}.selection-wrapper .selection-container .btn-primary.tgico-send2{padding:0 2px}}@media only screen and (max-width:380px){.selection-wrapper .selection-container .btn-primary{font-size:0}.selection-wrapper .selection-container .btn-primary:before{margin:0}}[dir=ltr] .selection-wrapper .selection-container-forward:before{margin-right:14px}[dir=rtl] .selection-wrapper .selection-container-forward:before{margin-left:14px}[dir=ltr] .selection-wrapper .selection-container-delete{margin-left:.375rem;margin-right:.625rem}[dir=rtl] .selection-wrapper .selection-container-delete{margin-left:.625rem;margin-right:.375rem}[dir=ltr] .selection-wrapper .selection-container-delete:before{margin-right:10px}[dir=rtl] .selection-wrapper .selection-container-delete:before{margin-left:10px}.fake-wrapper{position:absolute;visibility:hidden;z-index:-1}[dir=ltr] .fake-rows-wrapper{left:var(--padding-horizontal)}[dir=rtl] .fake-rows-wrapper{right:var(--padding-horizontal)}.fake-rows-wrapper{top:0;width:calc(100% - var(--chat-input-size) - var(--padding-horizontal)*2 - .5rem)}.rows-wrapper-wrapper{display:flex;width:100%}.rows-wrapper-wrapper.is-centering-to-control:not(.backwards) .rows-wrapper:before{opacity:0}.rows-wrapper-wrapper.is-centering-to-control:not(.backwards)~.chat-input-control{opacity:1;visibility:visible}.rows-wrapper-wrapper.is-centering-to-control:not(.backwards)~.chat-input-control:before{opacity:1}.rows-wrapper-wrapper.is-centering-to-control.animating .rows-wrapper:before,.rows-wrapper-wrapper.is-centering-to-control.animating~.chat-input-control:before{transition:opacity .05s .15s}.rows-wrapper-wrapper.is-centering-to-control.animating~.chat-input-control{transition:opacity .1s 75ms,visibility 0s 0s}.rows-wrapper-wrapper.is-centering-to-control.animating.backwards .rows-wrapper:before,.rows-wrapper-wrapper.is-centering-to-control.animating.backwards~.chat-input-control:before{transition:opacity .05s 0s}.rows-wrapper-wrapper.is-centering-to-control.animating.backwards~.chat-input-control{transition:opacity .1s 0s,visibility 0s .2s}[dir=ltr] .rows-wrapper{border-bottom-right-radius:0}[dir=rtl] .rows-wrapper{border-bottom-left-radius:0}.rows-wrapper{transform:translateX(0) scaleX(1)}.rows-wrapper .bubble-tail{opacity:1}@media only screen and (max-width:600px){.rows-wrapper{--padding-vertical:1px}}@media only screen and (max-width:420px){.rows-wrapper{max-width:100%}}@media only screen and (max-height:569px){.rows-wrapper{--padding-vertical:1px}}[dir=ltr] .rows-wrapper .bubble-tail{right:-8.4px}[dir=rtl] .rows-wrapper .bubble-tail{left:-8.4px}.rows-wrapper .bubble-tail{fill:var(--surface-color);bottom:-1px;height:20px;position:absolute;transform:scaleX(-1);width:11px}.is-rtl .rows-wrapper .bubble-tail{transform:scaleX(1)}.rows-wrapper .attach-file.menu-open{background-color:var(--light-primary-color)!important;color:var(--primary-color)}.rows-wrapper .attach-file.btn-disabled{opacity:var(--disabled-opacity)}.rows-wrapper>div{align-items:center;background-color:var(--surface-color);border-radius:1rem;display:flex;justify-content:space-between;padding:var(--padding);position:relative;width:100%}.rows-wrapper .reply-wrapper{align-items:center;height:0;justify-content:flex-start;margin-bottom:-.5625rem;opacity:0;padding:.5625rem var(--padding-horizontal) 0;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:2}body.animation-level-2 .rows-wrapper .reply-wrapper{transition:height .15s ease-out,opacity .15s ease-out}@media only screen and (max-height:569px),only screen and (max-width:600px){.rows-wrapper .reply-wrapper{margin-bottom:-.3125rem;padding-top:.3125rem}}.chat.is-helper-active .rows-wrapper .reply-wrapper{height:45px;opacity:1;pointer-events:inherit}.rows-wrapper .reply-wrapper .reply{flex:1 1 auto;margin-left:.625rem;margin-right:.625rem;order:1}.rows-wrapper .reply-wrapper .reply-icon{order:0;pointer-events:none}.rows-wrapper .reply-wrapper .reply-cancel{order:2}.rows-wrapper .reply-wrapper .reply-subtitle{color:var(--secondary-text-color)!important;height:1.125rem}.rows-wrapper .reply-wrapper .reply .peer-title{font-weight:400}[dir=ltr] .rows-wrapper .reply-wrapper .btn-menu{left:3.125rem}[dir=rtl] .rows-wrapper .reply-wrapper .btn-menu{right:3.125rem}.rows-wrapper .reply-wrapper .btn-menu{bottom:calc(100% + .5rem);top:auto;transform:scale(1)!important}[dir=ltr] .rows-wrapper .reply-wrapper .btn-menu-item{padding-right:1.5rem}[dir=rtl] .rows-wrapper .reply-wrapper .btn-menu-item{padding-left:1.5rem}.rows-wrapper .reply-wrapper .btn-menu-item-text{order:1}[dir=ltr] .rows-wrapper .reply-wrapper .btn-menu-item .checkbox-field{margin-right:var(--icon-margin)}[dir=rtl] .rows-wrapper .reply-wrapper .btn-menu-item .checkbox-field{margin-left:var(--icon-margin)}.rows-wrapper .reply-wrapper .btn-menu-item .checkbox-field{--size:1.25rem;margin:0;order:0}.rows-wrapper .reply-wrapper .btn-menu-item .checkbox-box-background,.rows-wrapper .reply-wrapper .btn-menu-item .checkbox-box-border{display:none}.rows-wrapper .reply-wrapper .btn-menu-item .checkbox-box-check use{stroke:var(--primary-text-color)}@media only screen and (max-width:600px){[dir=ltr] .rows-wrapper .reply-wrapper .btn-menu{left:calc(var(--padding-horizontal)*-1)}[dir=rtl] .rows-wrapper .reply-wrapper .btn-menu{right:calc(var(--padding-horizontal)*-1)}}.rows-wrapper .input-message-input{margin-top:-1px;max-height:27.5rem!important}@media only screen and (max-height:30rem){.rows-wrapper .input-message-input{max-height:max(36px,calc(100vh - 10rem))}}@media only screen and (max-width:600px){.rows-wrapper .input-message-input{max-height:10rem}}.rows-wrapper .input-message-input[data-inline-placeholder]:after{color:#a2acb4;content:attr(data-inline-placeholder);pointer-events:none}.rows-wrapper .new-message-wrapper{--send-as-size:1.875rem;--send-as-margin-left:.25rem;--send-as-margin-right:.375rem;--send-as-total-size:calc(var(--send-as-size) + var(--send-as-margin-left) + var(--send-as-margin-right));--commands-size:2.375rem;--commands-margin-left:.25rem;--commands-margin-right:.375rem;--commands-total-size:calc(var(--commands-size) + var(--commands-margin-left) + var(--commands-margin-right));--offset-translateX:0px;align-items:flex-end;min-height:var(--chat-input-size)}.rows-wrapper .new-message-wrapper .new-message-bot-commands,.rows-wrapper .new-message-wrapper .new-message-send-as-container{bottom:calc(var(--padding-vertical) + .4375rem);cursor:pointer;flex:0 0 auto;opacity:0;position:absolute;transform:scale(0);z-index:2}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-bot-commands{margin-left:var(--commands-margin-left)}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-bot-commands{margin-right:var(--commands-margin-left)}.rows-wrapper .new-message-wrapper .new-message-bot-commands{align-items:center;background-color:var(--primary-color);border-radius:1.875rem;cursor:pointer;display:flex;height:1.875rem;justify-content:center;width:var(--commands-size)}.rows-wrapper .new-message-wrapper .new-message-bot-commands .animated-menu-close-icon{position:relative}.rows-wrapper .new-message-wrapper .new-message-bot-commands-icon-scale{align-items:center;display:flex;justify-content:center;transform:scale(.875)}.rows-wrapper .new-message-wrapper .new-message-bot-commands .animated-menu-close-icon{--color:#fff}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-send-as-container{margin-left:var(--send-as-margin-left)}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-send-as-container{margin-right:var(--send-as-margin-left)}.rows-wrapper .new-message-wrapper .new-message-send-as-container{background:none!important;height:var(--send-as-size);width:var(--send-as-size)}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{right:auto}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{left:auto}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{left:calc(var(--padding-horizontal)*-1 - .25rem)!important}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{right:calc(var(--padding-horizontal)*-1 - .25rem)!important}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{height:auto;max-height:20rem;max-width:20rem;top:auto;transform:scaleX(1);width:auto}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item{height:2.25rem}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-header{height:1.875rem}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-icon{margin-right:calc(var(--icon-margin) - .5rem)}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-icon{margin-left:calc(var(--icon-margin) - .5rem)}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-icon.active:before{--offset:-.125rem;border:.0625rem solid var(--primary-color);border-radius:inherit;bottom:var(--offset);content:" ";left:var(--offset);position:absolute;right:var(--offset);top:var(--offset)}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-text{display:flex;flex-direction:column;justify-content:center;line-height:1!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-subtitle{font-size:.8125rem;font-weight:400}.rows-wrapper .new-message-wrapper .new-message-send-as-avatar{opacity:0;pointer-events:none;position:absolute;transform:scale(0)}.rows-wrapper .new-message-wrapper .new-message-send-as-avatar.is-visible:not(.backwards){opacity:1;transform:scale(1)}.rows-wrapper .new-message-wrapper .new-message-send-as-avatar.is-visible.animating{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.rows-wrapper .new-message-wrapper .new-message-send-as-close{align-items:center;background-color:var(--primary-color);border-radius:50%;color:#fff;display:flex;font-size:1.375rem;height:inherit;justify-content:center;width:inherit;z-index:1}.rows-wrapper .new-message-wrapper.has-offset[data-offset=as]{--offset-translateX:var(--send-as-total-size)}.rows-wrapper .new-message-wrapper.has-offset[data-offset=commands]{--offset-translateX:48px}.rows-wrapper .new-message-wrapper.has-offset .input-message-container,.rows-wrapper .new-message-wrapper.has-offset .toggle-emoticons{transform:translateX(0)}.rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .toggle-emoticons{transform:translateX(var(--offset-translateX))}[dir=ltr] .rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .input-message-container{margin-right:var(--translateX)}[dir=rtl] .rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .input-message-container{margin-left:var(--translateX)}.rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .input-message-container{--translateX:calc(var(--offset-translateX));transform:translate(var(--translateX))}.rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .new-message-bot-commands,.rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .new-message-send-as-container{opacity:1;transform:scale(1)}.rows-wrapper .new-message-wrapper.has-offset.animating .input-message-container,.rows-wrapper .new-message-wrapper.has-offset.animating .toggle-emoticons{transition:transform var(--transition-standard-in)}.rows-wrapper .new-message-wrapper.has-offset.animating .new-message-bot-commands,.rows-wrapper .new-message-wrapper.has-offset.animating .new-message-send-as-container{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.rows-wrapper .new-message-wrapper .btn-menu{bottom:calc(100% + 1.125rem)}@media only screen and (max-height:569px),only screen and (max-width:600px){.rows-wrapper .new-message-wrapper .btn-menu{bottom:calc(100% + .875rem)}}.rows-wrapper .new-message-wrapper .btn-menu.top-left{right:calc(var(--padding-horizontal)*-1 - .125rem)}.rows-wrapper .new-message-wrapper .btn-menu.top-right{left:calc(var(--padding-horizontal)*-1 - .125rem)}.rows-wrapper .btn-icon{color:var(--secondary-text-color);flex:0 0 auto;font-size:1.5rem;height:var(--button-size);margin-bottom:5px;margin-left:var(--button-horizontal-margin);margin-right:var(--button-horizontal-margin);margin-top:0;padding:0;width:var(--button-size)}.rows-wrapper .btn-icon.active{color:var(--primary-color)}.input-message-container{align-items:center;align-self:center;display:flex;flex:1 1 auto;max-height:inherit;min-height:calc(var(--chat-input-size) - var(--padding-vertical)*2);overflow:hidden;position:relative;width:1%}.input-message-container .scrollable{position:relative}.input-message-input{--custom-emoji-size:var(--messages-custom-emoji-size);background:none;border:none;font-size:var(--messages-text-size);line-height:var(--line-height);outline:none;overflow-y:none;padding:.5rem .5625rem;resize:none;width:100%}.input-message-input pre{display:inline;margin:0}body.animation-level-2 .input-message-input{transition:height .1s}.bubbles{--translateY:0;flex:1 1 auto;position:relative;transform:translate3d(0,var(--translateY),0);transition:transform var(--transition-standard-out);width:100%}body.animation-level-0 .bubbles{transition:none!important}.chat[data-type=chat] .bubbles.is-chat-input-hidden.is-selecting:not(.backwards){--translateY:-78px;transition:transform var(--transition-standard-in)}@media only screen and (max-width:600px){.chat[data-type=chat] .bubbles.is-chat-input-hidden.is-selecting:not(.backwards){--translateY:-58px}}.chat[data-type=chat] .bubbles.is-chat-input-hidden.is-selecting:not(.backwards) .bubbles-inner{transform:translateY(calc(var(--translateY)*-1));transition:transform var(--transition-standard-in)}.bubbles>.scrollable{display:block;height:auto}@media only screen and (min-width:1276px){body.is-right-column-shown .bubbles{transform:translate3d(calc(var(--right-column-width)/-2),var(--translateY),0);transition:transform var(--transition-standard-in)}}body.animation-level-2 .bubbles.is-selecting .bubbles-group-avatar,body.animation-level-2 .bubbles.is-selecting .is-in .bubble-content-wrapper{transition:var(--bubble-transition-out)}body.animation-level-2 .bubbles.is-selecting:not(.backwards) .bubbles-group-avatar,body.animation-level-2 .bubbles.is-selecting:not(.backwards) .is-in .bubble-content-wrapper{transition:var(--bubble-transition-in)}.bubbles.is-selecting:not(.backwards) .is-in .bubble-content-wrapper{transform:translateX(2.5rem) scale(1)}.bubbles.is-selecting:not(.backwards) .bubbles-group-avatar{transform:translate3d(2.5rem,0,0) scale3d(.76,.76,1)}.bubbles:not(.scrolled-down):not(.search-results-active)+.chat-input .bubbles-go-down{cursor:pointer;opacity:1;visibility:visible}body.animation-level-2 .bubbles:not(.scrolled-down):not(.search-results-active)+.chat-input .bubbles-go-down{transition:opacity var(--layer-transition),visibility 0s 0s!important}.bubbles:not(.scrolled-down):not(.search-results-active)+.chat-input .bubbles-go-mention{--translateY:calc(var(--chat-input-size)*-1 - 0.625rem)}.bubbles .search-group.search-group-messages{padding:.25rem 0 .5rem}.bubbles-inner{display:flex;flex-direction:column;justify-content:flex-end;margin:0 auto;max-width:var(--messages-container-width);min-height:100%;padding:0 .8125rem;transform:translateY(0);transition:transform var(--transition-standard-out);width:100%}body.animation-level-0 .bubbles-inner{transition:none!important}@media only screen and (min-width:1276px){.bubbles-inner{width:calc(100% - var(--right-column-width))}}@media only screen and (max-width:600px){.bubbles-inner{padding:0 .5rem}}.bubbles-inner:after{content:" ";height:.125rem}[dir=ltr] .bubbles-inner.is-chat .is-in .bubble-content-wrapper{margin-left:45px}[dir=rtl] .bubbles-inner.is-chat .is-in .bubble-content-wrapper{margin-right:45px}@media only screen and (max-width:600px){.bubbles-inner.is-chat .is-in .bubble-content-wrapper{max-width:calc(100% - var(--message-handhelds-margin))}}.bubbles-inner.is-channel:not(.is-chat) .bubble-content-wrapper{max-width:100%}.bubbles-inner.is-channel:not(.is-chat) .bubble.with-beside-button .bubble-content-wrapper{max-width:calc(100% - var(--message-beside-button-margin)*-1)!important}.bubbles-inner.is-chat .message,.bubbles-inner.is-chat .name,.bubbles-inner:not(.is-channel) .message,.bubbles-inner:not(.is-channel) .name{max-width:480px}.bubbles-inner.is-scrolling .is-sticky{opacity:.99999!important}html.is-safari .bubbles-inner.is-scrolling .is-sticky{transform:translateY(calc(var(--translateY)*-1))}body.animation-level-2 html.is-safari .bubbles-inner.is-scrolling .is-sticky{transition:transform var(--transition-standard-in)}.bubbles-inner>.bubble.is-in{width:100%}@media only screen and (min-width:1276px){.bubbles-inner>.bubble.is-in .bubble-content-wrapper{max-width:85%}}.bubbles-go-down{cursor:default;opacity:0;transform:none!important;transition:opacity var(--layer-transition),visibility 0s .2s!important;visibility:hidden}.bubbles-go-mention{--translateY:0;cursor:default;opacity:0;transition:transform var(--layer-transition),opacity var(--layer-transition),visibility 0s .2s!important;visibility:hidden}.bubbles-go-mention.is-visible{cursor:pointer;opacity:1;transition:transform var(--layer-transition),opacity var(--layer-transition),visibility 0s 0s!important;visibility:visible}.chat-secondary-button{align-items:center;background-color:var(--surface-color)!important;border-radius:50%;box-shadow:0 1px 8px 1px rgba(0,0,0,.12)!important;color:var(--secondary-text-color);display:flex;font-size:1.5rem;justify-content:center;position:absolute}body.animation-level-0 .chat-secondary-button{transition:none!important}.chat-secondary-button:before{position:relative}.chat-secondary-button:after{border-radius:inherit;bottom:0;content:" ";left:0;position:absolute;right:0;top:0}html.no-touch .chat-secondary-button:active:after,html.no-touch .chat-secondary-button:hover:after{background-color:var(--light-secondary-text-color)}[dir=ltr] .bubbles-corner-button{right:var(--chat-input-padding)}[dir=rtl] .bubbles-corner-button{left:var(--chat-input-padding)}.bubbles-corner-button{bottom:calc(var(--chat-input-size) + var(--bottom) + 10px);overflow:visible;z-index:2}[dir=ltr] .bubbles-corner-button .badge{right:-.25rem}[dir=rtl] .bubbles-corner-button .badge{left:-.25rem}.bubbles-corner-button .badge{position:absolute;top:-.25rem}.bubbles-corner-button .badge.badge-primary:not(.badge-gray){background-color:var(--chatlist-status-color)}@media only screen and (max-width:600px){[dir=ltr] .bubbles-corner-button .badge{right:.1875rem}[dir=rtl] .bubbles-corner-button .badge{left:.1875rem}.bubbles-corner-button .badge{top:-.75rem}}.popup.popup-delete-message .popup-header{margin-bottom:1rem}body.is-calling .topbar,body.is-calling .topbar-call-container{transform:translateY(0)}body.is-calling.animation-level-2 .topbar,body.is-calling.animation-level-2 .topbar-call-container{transition:transform var(--transition-standard-out)}body.is-calling:not(.backwards) .topbar,body.is-calling:not(.backwards) .topbar-call-container{transform:translateY(var(--topbar-call-height))}body.is-calling:not(.backwards):not(.animating){--topbar-floating-call-height:var(--topbar-call-height)}@media only screen and (min-width:1276px){body.is-right-column-shown{--topbar-floating-scaleX:calc(1 - var(--right-column-proportion))}}.topbar{--topbar-height:3.5rem;--pinned-floating-audio-height:0px;--pinned-floating-message-height:0px;--pinned-floating-height:calc(var(--pinned-floating-audio-height) + var(--pinned-floating-message-height) + var(--topbar-floating-call-height));--pinned-audio-height:52px;--pinned-message-height:52px;cursor:pointer!important;margin-bottom:var(--pinned-floating-height);max-height:var(--topbar-height)!important;min-height:var(--topbar-height)!important;position:relative;width:100%;z-index:1}.topbar:before{box-shadow:0 1px 5px -1px rgba(0,0,0,.21);content:" ";height:calc(var(--topbar-height) + var(--pinned-floating-height) - var(--topbar-floating-call-height));left:0;pointer-events:none;position:absolute;right:0;top:0}.topbar.is-pinned-audio-floating{--pinned-floating-audio-height:var(--pinned-audio-height)}.topbar.is-pinned-message-floating{--pinned-floating-message-height:var(--pinned-message-height)}.topbar:not(.is-pinned-message-floating) .chat-utils{position:relative;z-index:1}.topbar.is-pinned-audio-floating.is-pinned-message-floating .pinned-message{top:calc(var(--topbar-height) + var(--pinned-audio-height))}.topbar.is-pinned-audio-floating.is-pinned-message-floating .pinned-message:before{border-top:none}@media only screen and (min-width:601px){.topbar .menu-search{display:none}.topbar.is-pinned-message-shown:not(.hide-pinned) .pinned-message{display:flex}}@media only screen and (min-width:926px){.chat:first-child .topbar .sidebar-close-button{display:none}[dir=ltr] .chat:first-child .topbar .chat-info{padding-left:.1875rem}[dir=rtl] .chat:first-child .topbar .chat-info{padding-right:.1875rem}}@media only screen and (min-width:1276px){.topbar .pinned-container-wrapper-utils{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar .pinned-container-wrapper-utils{transform:translate3d(calc(var(--right-column-width)*-1),0,0);transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar .pinned-container-wrapper-utils{transition:none}}.topbar .sidebar-close-button{position:absolute}.topbar .user-title{align-items:center;display:flex;font-size:1rem;font-weight:var(--font-weight-bold);line-height:1.5rem;max-width:calc(100% - 1.5rem)}.topbar .user-title span.emoji{vertical-align:inherit}.topbar .info,.topbar .peer-title{line-height:var(--line-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topbar .info:not(:empty){margin-top:1px}.topbar .btn-menu-toggle .btn-menu{max-height:calc(var(--vh)*100 - 4.375rem);top:calc(100% + 7px)}@media only screen and (max-width:600px){.topbar .btn-menu-toggle .btn-menu{max-height:calc(var(--vh)*100 - 3.75rem);top:29px}.topbar .btn-menu-toggle{margin-left:0}}[dir=ltr] .topbar .chat-info{padding-left:49px}[dir=rtl] .topbar .chat-info{padding-right:49px}.topbar .chat-info{flex:1 1 auto;max-width:calc(100% - var(--utils-width));overflow:hidden}@media only screen and (max-width:600px){[dir=ltr] .topbar .chat-info{padding-left:52px}[dir=rtl] .topbar .chat-info{padding-right:52px}}@media only screen and (min-width:1276px){body.is-right-column-shown .topbar .chat-info{max-width:calc(100% - var(--right-column-width) - var(--utils-width))}}.topbar .chat-info-container{align-items:center;display:flex;flex:1 1 auto;height:3.5rem;justify-content:space-between;max-height:3.5rem;max-width:100%}.topbar .chat-utils{align-items:center;display:flex;flex:0 0 auto}@media only screen and (min-width:1276px){.topbar .chat-utils{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar .chat-utils{transform:translate3d(calc(var(--right-column-width)*-1),0,0);transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar .chat-utils{transition:none}}@media only screen and (max-width:600px){.topbar .chat-utils>.btn-icon:not(.btn-menu-toggle){display:none}}[dir=ltr] .topbar .chat-join{margin-right:.5rem}[dir=rtl] .topbar .chat-join{margin-left:.5rem}.topbar .chat-join{font-size:.875rem;font-weight:400;height:2.25rem;padding:0 1.375rem;width:auto}.topbar .chat-join:not(.hide)+.chat-mute-button{display:none}[dir=ltr] .topbar .content{padding-left:1.125rem}[dir=rtl] .topbar .content{padding-right:1.125rem}.topbar .content{flex:1 1 auto;max-width:100%;overflow:hidden}.topbar .person{align-items:center;display:flex}.topbar .person-avatar{flex:0 0 auto}.topbar .person .bottom{color:var(--secondary-text-color);font-size:.875rem}.topbar .person .bottom .online{color:var(--primary-color)}.topbar.hide-pinned{--pinned-floating-height:0px}.topbar.hide-pinned .pinned-container{display:none}.topbar.hide-pinned+.bubbles .bubbles-inner{margin-bottom:.25rem}[dir=ltr] .chat:not([data-type=chat]) .topbar .content{padding-left:16px}[dir=rtl] .chat:not([data-type=chat]) .topbar .content{padding-right:16px}[dir=ltr] .topbar-call-container{left:1px;right:0}[dir=rtl] .topbar-call-container{left:0;right:1px}.topbar-call-container{color:#fff;cursor:pointer!important;height:var(--topbar-call-height)!important;min-height:auto!important;position:absolute;top:calc(var(--topbar-call-height)*-1);z-index:2}body:not(.has-chat) .topbar-call-container{background:none!important}@media only screen and (max-width:925px){[dir=ltr] .topbar-call-container{left:0}[dir=rtl] .topbar-call-container{right:0}}.topbar-call-container .btn-icon{color:inherit;flex:0 0 auto;height:2.5rem;padding:0;width:2.5rem}.topbar-call-container .peer-title{font-weight:var(--font-weight-bold);white-space:nowrap}@media only screen and (max-width:480px){.topbar-call-container:not(.is-call) .topbar-call-left,.topbar-call-container:not(.is-call) .topbar-call-right{width:auto}.topbar-call-container:not(.is-call) .group-call-description{display:none}.topbar-call-container.is-call .topbar-call-left,.topbar-call-container.is-call .topbar-call-right{width:6.25rem}.topbar-call-container.is-call .call-description:not(.has-duration){display:none}}.topbar-call-left,.topbar-call-right{flex:0 0 auto;width:12rem}.topbar-call-left{align-items:center;display:flex}[dir=ltr] .topbar-call-left .btn-icon{margin-right:.375rem}[dir=rtl] .topbar-call-left .btn-icon{margin-left:.375rem}.topbar-call-left .call-description{white-space:nowrap}.topbar-call-left .call-description-duration{font-weight:var(--font-weight-bold)}.topbar-call-center{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media only screen and (min-width:1276px){.topbar-call-center{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar-call-center{transform:translate3d(calc(var(--right-column-width)*-.5),0,0);transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar-call-center{transition:none}.topbar-call-center{padding:0 calc(var(--right-column-width)/2)}}.topbar-call-right{display:flex;justify-content:flex-end}@media only screen and (min-width:1276px){.topbar-call-right{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar-call-right{transform:translate3d(calc(var(--right-column-width)*-1),0,0);transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar-call-right{transition:none}}.topbar-call-weave{bottom:-1.125rem;left:0;pointer-events:none;position:absolute;right:0;top:0;transform:scale(var(--topbar-floating-scaleX),-1);transform-origin:left center;z-index:-1}.is-rtl .topbar-call-weave{transform-origin:right center}@media only screen and (min-width:1276px){.topbar-call-weave{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar-call-weave{transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar-call-weave{transition:none}}.topbar-call-weave-canvas{height:100%;width:100%}.topbar .back-unread-badge{position:absolute;right:-.5rem;top:-.25rem}@media only screen and (min-width:601px){.topbar .back-unread-badge{display:none}}@keyframes bubbleSelected{0%{opacity:0}25%{opacity:1}to{opacity:0}}.bubbles-date-group{position:relative}.bubbles-date-group .sticky_sentinel--top{height:.25rem;top:0}.bubbles-group{position:relative}.bubbles-group-avatar{bottom:.25rem;cursor:pointer;pointer-events:all;position:sticky!important;top:0}.bubbles.is-selecting .bubbles-group-avatar{transform:translateZ(0) scaleX(1);transform-origin:bottom}.bubbles-group-avatar.is-gesturing-reply{transform:translateX(0)}.bubbles-group-avatar.is-gesturing-reply.animating.backwards{transition:transform var(--transition-standard-out)}.bubbles-group-avatar-container{bottom:0;display:flex;flex-direction:column-reverse;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:2}.bubble{--line-height:var(--messages-line-height);display:flex;flex-wrap:wrap;margin:0 auto .125rem;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}.bubble.is-gesturing-reply{transform:translateX(0)}.bubble.is-gesturing-reply.animating.backwards{transition:transform var(--transition-standard-out)}.bubble.is-gesturing-reply .bubble-gesture-reply-icon{align-items:center;background-color:var(--message-highlightning-color);border-radius:50%;color:#fff;display:flex;height:var(--message-beside-button-size);justify-content:center;opacity:0;position:absolute;right:var(--message-beside-button-margin);top:50%;transform:translateY(-50%);transform:translateY(-50%) scale(.6);visibility:hidden;width:var(--message-beside-button-size)}.bubble.is-gesturing-reply .bubble-gesture-reply-icon:before{font-size:1.125rem!important}body.animation-level-2 .bubble.is-gesturing-reply .bubble-gesture-reply-icon{transition:transform .1s ease-in-out}.bubble.is-gesturing-reply .bubble-gesture-reply-icon.is-visible{transform:translateY(-50%) scale(1);visibility:visible}.bubble.is-highlighted:after,.bubble.is-selected:after,.bubble:after{bottom:-.0625rem;content:" ";left:-50%;position:absolute;top:-.0625rem;z-index:-1}.bubble.is-highlighted:after{background-color:var(--message-highlightning-color)}body:not(.animation-level-0) .bubble.is-highlighted:after{animation:bubbleSelected 2s linear}@media only screen and (max-width:600px){.bubble.is-first-unread{max-width:none}}.bubble.is-first-unread:before{background-color:var(--surface-color);color:var(--primary-color);content:"Unread messages";font-size:15px;font-weight:var(--font-weight-bold);height:30px;line-height:2.1;margin-bottom:.25rem;margin-left:-50%;margin-right:-50%;position:relative;text-align:center;z-index:2}.bubble.is-first-unread.is-highlighted:after,.bubble.is-first-unread.is-selected:after{top:calc(.0625rem + 30px)}.bubble.is-selected:after{background-color:var(--message-highlightning-color)}body:not(.animation-level-0) .bubble.is-selected:after{animation:fade-in-opacity .2s linear forwards}body:not(.animation-level-0) .bubble.is-selected.backwards:after{animation:fade-in-backwards-opacity .2s linear forwards}.bubble:after,.bubble:before{display:block;width:200%}.bubble.is-multiple-documents:after,.bubble.is-multiple-documents:before{display:none}.bubble.is-multiple-documents .user-avatar{z-index:2}.bubble .replies-footer+.poll-message .poll-footer-button{border-radius:0!important}.bubble-select-checkbox{display:flex;left:0;margin:0;position:absolute;z-index:3}.bubble-select-checkbox .checkbox-box-border{border-color:var(--message-checkbox-border-color)}.bubble-select-checkbox .checkbox-box-background{background-color:var(--message-checkbox-color)}.bubble-select-checkbox .checkbox-box-check use{stroke-width:3.5}.bubble>.bubble-select-checkbox{bottom:.3125rem}.bubble>.bubble-select-checkbox .checkbox-box{box-shadow:0 0 3px 0 rgba(0,0,0,.4)}.bubbles.is-selecting .bubble:not(.is-album) .attachment,.bubbles.is-selecting .bubble:not(.is-album) .audio,.bubbles.is-selecting .bubble:not(.is-album) .document,.bubbles.is-selecting .bubble:not(.is-album) poll-element{pointer-events:none!important}.bubbles.is-selecting .bubble a,.bubbles.is-selecting .bubble img,.bubbles.is-selecting .bubble video{pointer-events:none}.bubble-content{background-color:var(--message-background-color);border-radius:12px;box-shadow:0 1px 2px 0 rgba(16,35,47,.15);display:flex;flex-direction:column-reverse;max-width:100%;min-width:56px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:2}body.animation-level-0 .bubble-content{transition:none}html.is-touch body:not(.no-select) .chat:not(.no-forwards) .bubbles.is-selecting .bubble-content,html.no-touch .chat:not(.no-forwards) .bubbles:not(.is-selecting) .bubble-content{-webkit-user-select:text;-moz-user-select:text;user-select:text}.bubble-content.hover-reaction-visible .bubble-beside-button{transform:translateX(1.125rem)}.bubble.is-out .bubble-content.hover-reaction-visible .bubble-beside-button{transform:translateX(-1.125rem)}.bubble.is-out .bubble-content.hover-reaction-visible .bubble-beside-button.goto-original{transform:translateX(-1.125rem) rotate(180deg)}.bubble-hover-reaction{--size:1.875rem;--offset:calc(var(--size)*-0.75);align-items:center;background-color:var(--surface-color);border-radius:var(--size);bottom:0;box-shadow:var(--menu-box-shadow);cursor:pointer;display:flex;height:1.625rem;justify-content:center;opacity:0;position:absolute;right:var(--offset);transform:scale(.8);width:var(--size);z-index:2}body.animation-level-2 .bubble-hover-reaction{transition:opacity var(--btn-corner-transition),transform var(--btn-corner-transition)}.bubble-hover-reaction.is-visible:not(.backwards){opacity:1;transform:scale(1)}.bubble-hover-reaction-sticker{height:1.125rem;position:relative;width:1.125rem}.bubble.service{max-width:var(--messages-container-width)}.bubble.service .bubble-content{box-shadow:none;margin:0 auto;max-width:100%}.bubble.is-date{font-weight:var(--font-weight-bold);opacity:.99999;padding-bottom:.375rem;pointer-events:none;position:sticky;top:.25rem;transition:opacity .3s ease;z-index:2}.bubble.is-date:after,.bubble.is-date:before{display:none}body.animation-level-0 .bubble.is-date{transition:none}.bubble.is-date.is-sticky{opacity:.00001}.bubbles-inner:not(.is-scrolling) .bubble.is-date.is-sticky .bubble-content{cursor:default}.chat[data-type=chat] .bubble.is-date .bubble-content,.chat[data-type=discussion] .bubble.is-date .bubble-content{cursor:pointer;pointer-events:all}.bubbles:not(.has-sticky-dates) .bubble.is-date{visibility:hidden}.bubbles.has-sticky-dates .bubble.is-date.is-fake{display:none}.bubble.is-date.is-fake{left:50%;opacity:1!important;position:absolute;top:0;transform:translateX(-50%);transition:none!important;visibility:visible!important}.bubble-beside-button{align-items:center;background:var(--message-highlightning-color);border-radius:50%;bottom:0;color:var(--badge-text-color);cursor:pointer;display:flex;font-size:1.5rem;height:var(--message-beside-button-size);justify-content:center;position:absolute;right:var(--message-beside-button-margin);transform:translateX(0);width:var(--message-beside-button-size)}html.no-touch .bubble-beside-button{opacity:0}html.no-touch body.animation-level-2 .bubble-beside-button{transition:opacity .2s ease-in-out,transform .2s ease-in-out}.bubble-view-button{align-items:center;border:1px solid var(--message-primary-color);border-radius:6px;color:var(--message-primary-color);display:flex;height:2rem;justify-content:center;margin:0 .5625rem .5rem;text-decoration:none!important;width:auto}html.no-touch .bubble-view-button:active,html.no-touch .bubble-view-button:hover{background-color:var(--light-filled-message-primary-color)}.bubble-view-button .c-ripple__circle{background-color:var(--message-primary-color);opacity:.08}.message .bubble-view-button{margin:.375rem 0 -.375rem;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.bubble-view-button+.reactions-block{margin-top:.375rem}html.no-touch .bubble:active .bubble-beside-button,html.no-touch .bubble:hover .bubble-beside-button{opacity:1}.bubble .forward{font-size:1.25rem}.bubble.is-group-last{margin-bottom:.5rem}.bubble.is-group-last:after{bottom:-.25rem}.bubbles-inner.is-chat .bubble.is-group-last.is-in>.bubble-select-checkbox{bottom:.1875rem}.bubble.is-group-first:after{top:-.25rem}.bubble:not(.forwarded):not(.must-have-name):not(.is-group-first) .name{display:none}.bubble:not(.forwarded):not(.must-have-name):not(.is-group-first):not(.is-message-empty):not(.is-reply) .message{padding-top:6px}.bubble:not(.is-group-last) .bubble-content-wrapper>.user-avatar{display:none}.bubble.photo .bubble-content,.bubble.video .bubble-content{width:-moz-min-content;width:min-content}.bubble.photo .web,.bubble.video .web{max-width:100%}.bubble.photo .message,.bubble.video .message{max-width:420px}.bubble.webpage .preview-with-document{margin-bottom:0!important;min-width:100%}.bubble.webpage .document{height:3.375rem}@media only screen and (max-width:600px){.bubble.webpage .document{padding-left:44px}}.bubble.webpage .has-document{display:flex;flex-direction:column}.bubble.webpage .has-document .preview-resizer{order:1}.bubble .preview-resizer{display:flex}.bubble img.emoji{height:18px;vertical-align:bottom;width:18px}.bubble .thumbnail{position:absolute}.bubble .canvas-thumbnail{border-radius:inherit}.bubble .canvas-dots{z-index:1}.bubble.emoji-big{--emoji-size:1rem;font-size:0}.bubble.emoji-big .bubble-content{line-height:1}.bubble.emoji-big .attachment{--custom-emoji-size:var(--emoji-size);border-radius:0!important}.bubble.emoji-big .attachment img.emoji{height:var(--emoji-size);max-height:64px;max-width:64px;width:var(--emoji-size)}.bubble.emoji-big .attachment .custom-emoji,.bubble.emoji-big .attachment .emoji{display:inline-block}.bubble.emoji-big:not(.sticker) .attachment{display:block;font-size:var(--emoji-size);max-height:-moz-fit-content!important;max-height:fit-content!important;padding-bottom:1.25rem;padding-top:.25rem;white-space:pre-wrap;word-break:break-word}.bubble.emoji-big:not(.sticker) .attachment span.emoji{height:auto;width:auto}.bubble.emoji-big:not(.sticker) .message{margin-top:-1.125rem}.bubble.emoji-big:not(.sticker) .bubble-content{max-width:min(420px,100%)}.bubble.just-media .bubble-content{background:none!important;box-shadow:none}.bubble.just-media img{-o-object-fit:contain;object-fit:contain}.bubble.just-media.is-message-empty .message{background:var(--message-highlightning-color)}.bubble.emoji-big:not(.sticker) .bubble-content,.bubble.sticker .bubble-content{align-self:flex-start}.bubble.emoji-big:not(.sticker) .message,.bubble.sticker .message{margin-left:auto;position:relative!important;right:0!important}.bubble.sticker .attachment{border-radius:0;position:absolute;z-index:1}.bubble.round .attachment{height:var(--round-video-size)!important;max-height:var(--round-video-size)!important;max-width:var(--round-video-size)!important;width:var(--round-video-size)!important}.bubble.round .media-photo,.bubble.round .media-video{border-radius:50%;pointer-events:none}.bubble:not(.is-message-empty) .attachment{border-bottom-left-radius:0;border-bottom-right-radius:0}.bubble:not(.emoji-big) .attachment{font-size:0}.bubble .attachment{border-radius:inherit;cursor:pointer;display:flex;justify-content:center;max-width:100%;overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble .attachment img,.bubble .attachment video{max-width:100%}.bubble .attachment .download{align-items:center;cursor:pointer;display:flex;height:100%;justify-content:center;left:0;position:absolute;top:0;width:100%}.bubble .attachment .download span{background-color:var(--message-time-background);color:#fff;font-size:23px;text-align:center}.bubble .attachment .download~.video-play,.bubble .attachment .preloader-container~.video-play{display:none}.bubble .media-container-aspecter{margin:0 auto;position:relative;z-index:1}.bubble .media-container-fitted{background-color:transparent!important}.bubble .media-container-fitted>.thumbnail{opacity:.8}.bubble .media-container-fitted>.thumbnail.fade-in{animation:thumbnail-fade-in-opacity .2s ease-in-out forwards}.bubble .preloader-container{z-index:2}.bubble:not(.sticker) .attachment{max-height:min(340px,100%);max-width:min(420px,100%);width:-moz-max-content;width:max-content}.bubble img:not(.emoji),.bubble video{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}html.is-safari .bubble:not(.round) img:not(.emoji),html.is-safari .bubble:not(.round) video{border-radius:inherit}.bubble.is-album .attachment{max-height:none;max-width:min(451px,100%)}.bubble .album-item{background-color:var(--message-highlightning-color);cursor:pointer;max-width:100%;overflow:hidden;position:absolute}body.animation-level-0 .bubble .album-item{transition:none!important}.bubble .album-item img,.bubble .album-item video,.bubble .album-item-media{border-radius:inherit}body.animation-level-0 .bubble .album-item-media{transition:none!important}.bubble .album-item .bubble-select-checkbox{bottom:auto!important;left:auto;right:.5rem;top:.5rem}.bubble .album-item.is-selected{border-radius:0}.bubble .album-item.is-selected .album-item-media{transform:scale(1)}.bubble .album-item.is-selected.animating{transition:border-radius var(--transition-standard-out)}.bubble .album-item.is-selected.animating .album-item-media{transition:transform var(--transition-standard-out),border-radius var(--transition-standard-out)}.bubble .album-item.is-selected:not(.backwards){transition:border-radius var(--transition-standard-in)}.bubble .album-item.is-selected:not(.backwards) .album-item-media{transform:scale(.883333);transition:transform var(--transition-standard-in),border-radius var(--transition-standard-in)}.bubble .album-item.is-selected:not(.backwards),.bubble .album-item.is-selected:not(.backwards) .album-item-media{border-radius:0}html.no-touch .bubble a:active,html.no-touch .bubble a:hover{text-decoration:underline}.bubble-first{align-items:center;justify-content:center;margin-top:.5rem;max-width:100%;order:-1}body.animation-level-0 .bubble-first{flex:1 1 auto}.bubble-first .attachment{pointer-events:none}.bubble-first .bubble-content-wrapper{max-width:100%}.bubble-first.empty-bubble-placeholder{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}body.animation-level-2 .bubble-first.empty-bubble-placeholder .bubble-content-wrapper{transition:var(--bubble-transition-in)}.bubble-first.empty-bubble-placeholder.has-description .service-msg{align-items:flex-start!important;flex-direction:column;padding:.75rem 1rem .875rem!important}.bubble-first.empty-bubble-placeholder.has-description .center{align-self:center}.bubble-first.empty-bubble-placeholder.has-description .empty-bubble-placeholder-title{font-size:1rem!important;font-weight:var(--font-weight-bold)}.bubble-first.empty-bubble-placeholder.has-description .bubble-content{border-radius:1.5rem!important}.bubble-first.empty-bubble-placeholder .empty-bubble-placeholder-line{color:#fff}.bubble-first.empty-bubble-placeholder .empty-bubble-placeholder-line+.empty-bubble-placeholder-line{margin-top:.5rem}.bubble-first.empty-bubble-placeholder .tgico-check{font-size:1.25rem;margin-left:-.1875rem;margin-right:.25rem;vertical-align:bottom}.bubble-first.empty-bubble-placeholder .empty-bubble-placeholder-list-bullet{margin-right:.3125rem}.bubbles.has-groups .bubble-first.empty-bubble-placeholder{pointer-events:none}.bubbles.has-groups .bubble-first.empty-bubble-placeholder .bubble-content-wrapper{opacity:0;transform:scale3d(.8,.8,1) translateX(0)}.bubble-first.empty-bubble-placeholder.empty-bubble-placeholder-group .empty-bubble-placeholder-list-item{margin-top:.4375rem!important}.bubble-first.empty-bubble-placeholder.empty-bubble-placeholder-greeting .service-msg{max-width:232px}.bubble-first.empty-bubble-placeholder.empty-bubble-placeholder-greeting .empty-bubble-placeholder-subtitle{margin-top:.25rem!important}.bubble-first.empty-bubble-placeholder .empty-bubble-placeholder-sticker{cursor:pointer;height:200px;margin-top:.75rem!important;position:relative;width:200px}.bubble-first .time{display:none!important}.bubble-first:after,.bubble-first:before{display:none}.bubble .web{line-height:var(--line-height);margin:.125rem 0 0;max-width:100%;overflow:hidden}.bubble .web+.time{display:block}.bubble .web .preview{border-radius:4px;cursor:pointer;max-height:min(340px,100%);max-width:min(420px,100%);overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:-moz-max-content;width:max-content}.bubble .web .preview img,.bubble .web .preview video{max-width:100%}.bubble .web .preview-resizer:first-child{margin:3px 0}.bubble .web .preview-resizer:first-child:last-child{margin-bottom:2px}.bubble .web .preview.is-round .media-photo,.bubble .web .preview.is-round .media-video{border-radius:50%}.bubble .web.no-text{margin-bottom:.75rem}.bubble .web .title:not(:first-child){margin-top:1px}.bubble .web .text,.bubble .web .title,.bubble .web .webpage-name{font-size:var(--messages-secondary-text-size);line-height:var(--messages-secondary-line-height)}.bubble .web .webpage-name{text-decoration:none}html.no-touch .bubble .web .webpage-name:active,html.no-touch .bubble .web .webpage-name:hover{text-decoration:underline}.bubble .web .text{margin-top:1px;word-break:break-word}.bubble .web .quote{display:flex;max-width:100%;overflow:hidden;width:100%}.bubble .web .quote-text{margin-left:-.625rem;max-width:100%;padding-left:.625rem;width:100%}.bubble .web .quote:before{background-color:var(--primary-color);border-radius:.125rem;content:" ";flex:0 0 auto;margin:.1875rem .5rem .125rem 0;width:.125rem}.bubble .reply{--font-size:var(--messages-secondary-text-size)}.bubble .document-name{font-size:var(--messages-text-size)}.bubble .document-size{font-size:var(--messages-secondary-text-size)}.bubble.is-square-photo .bubble-content{width:-moz-fit-content;width:fit-content}.bubble.is-square-photo .web .webpage-name{margin-right:1rem}.bubble.is-square-photo .web .preview-resizer{float:right;height:3rem;margin:.1875rem 0 0 .625rem;width:3rem}.bubble.is-square-photo .web .preview{margin:0;max-height:min(3rem,100%);max-width:min(3rem,100%)}.bubble .reply{border-radius:.25rem;cursor:pointer;margin:0 .375rem .375rem;min-width:10rem;padding:.25rem;width:auto}.bubble .reply-media{top:.125rem}.bubble .reply-content{height:auto;max-width:calc(100% - 1.25rem);min-height:32px;overflow:hidden;position:absolute;text-overflow:ellipsis;white-space:nowrap}.bubble .message+.reply{margin-bottom:0}.bubble:not(.just-media) .reply{border-radius:6px}html.no-touch .bubble:not(.just-media) .reply:active,html.no-touch .bubble:not(.just-media) .reply:hover{background-color:var(--light-filled-message-primary-color)}.bubble.just-media .floating-part{background-color:var(--message-highlightning-color);border-radius:12px;margin:0;max-width:15rem;padding:.375rem .625rem;position:absolute;top:0;white-space:nowrap}@media only screen and (max-width:600px){.bubble.just-media .floating-part{max-width:calc(100vw - 1rem - 10px - 100%)}}.bubble.just-media .name{color:#fff!important;line-height:var(--line-height);padding:.375rem .625rem}.bubble.just-media .name .peer-title{font-weight:400!important}.bubble.just-media .reply{height:54px;max-height:54px}@media only screen and (max-width:600px){.bubble.just-media .reply{padding:8px 6px 8px 8px}}.bubble.just-media .reply-content{margin-top:0;max-width:none!important;position:relative}.bubble.just-media .reply i,.bubble.just-media .reply-subtitle,.bubble.just-media .reply-title{color:#fff!important}.bubble.just-media .reply-border{background:#fff!important}.bubble.forwarded .attachment,.bubble.is-reply .attachment,.bubble:not(.hide-name) .attachment{border-top-left-radius:0;border-top-right-radius:0}.bubble .message,.bubble .service-msg{--custom-emoji-size:var(--messages-custom-emoji-size)}.bubble .message{color:var(--primary-text-color);font-size:var(--messages-text-size);line-height:var(--line-height);max-width:100%;padding:0 .5rem .375rem .625rem;position:relative;white-space:pre-wrap;word-break:break-word}.bubble .message .custom-emoji{display:inline-flex}.bubble .message:last-child{padding-top:6px}@media only screen and (max-width:600px){.bubble .audio,.bubble .document{--icon-size:2.25rem}}.bubble .audio .audio-title{font-weight:var(--font-weight-bold)}.bubble .audio .audio-ico{font-size:0}@media only screen and (max-width:600px){.bubble .audio{--icon-margin:.6875rem;height:2.375rem}.bubble .audio .audio-details{margin-bottom:0;margin-top:2px}.bubble .audio .audio-to-text-button{margin-top:-.875rem}.bubble .audio .audio-subtitle{margin-top:-1px}}.bubble .message.audio-message{width:335px}@media only screen and (max-width:600px){.bubble .message.audio-message{width:280px}}.bubble .message.audio-message,.bubble .message.voice-message{max-width:min(100%,364px)!important}@media only screen and (max-width:600px){.bubble .message.audio-message,.bubble .message.voice-message{max-width:min(100%,300px)!important}}.bubble.min-content .bubble-content{width:-moz-min-content;width:min-content}.bubble .message.voice-message .document-message{max-width:-moz-fit-content;max-width:fit-content}.bubble .message.audio-message,.bubble .message.voice-message{padding:8px!important}.bubble .message.call-message,.bubble .message.contact-message{min-width:200px;padding-left:8px}.bubble .message.contact-message .contact{cursor:pointer;display:flex;padding:2px 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble .message.contact-message .contact-avatar{color:#fff}.bubble .message.contact-message .contact-details{display:flex;flex-direction:column;margin-top:8px;padding-left:12px}.bubble .message.contact-message .contact-name{font-size:1rem;font-weight:var(--font-weight-bold)}.bubble .message.contact-message .contact-number{font-size:14px;line-height:1.4}.bubble .message.poll-message{max-width:400px}.bubble .message.document-message{max-width:325px!important}.bubble .message.document-message .document{--icon-margin:.75rem;height:58px}@media only screen and (max-width:600px){.bubble .message.document-message .document{--icon-margin:.5rem;height:44px}.bubble .message.document-message .document .document-size{font-size:.75rem}.bubble .message.document-message .document:not(.document-with-thumb) .document-ico{padding:1.125rem 0 0}}.bubble .message.document-message .document-name{line-height:1.4;margin-top:1px;overflow:hidden;text-overflow:ellipsis}.bubble-call{cursor:pointer;display:flex;flex-direction:column;justify-content:center;padding:.125rem 0 .125rem 2.5625rem;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble-call:before{font-size:1.5rem;left:.3125rem;position:absolute}.bubble-call-title{font-weight:var(--font-weight-bold)}.bubble-call-subtitle{align-items:center;color:var(--secondary-text-color);display:flex;font-size:var(--messages-secondary-text-size);line-height:var(--messages-secondary-line-height);margin-left:-.1875rem;margin-top:.0625rem}.bubble-call-subtitle.is-reason:before{margin-right:.0625rem}.bubble-call-subtitle:before{content:"";display:inline-block;font-size:1rem;transform:rotate(135deg)}.bubble-call-subtitle.arrow-red:before{color:var(--danger-color)}.bubble-call-subtitle.arrow-green:before{color:var(--message-out-primary-color)}.bubble .document-wrapper{display:flex;flex-direction:column-reverse}.bubble .document-wrapper .document-message{margin-top:.25rem}.bubble .document .time{align-self:flex-start;height:0}.bubble .document-message+.audio .time,.bubble .document-message+.document .time{display:none!important}.bubble.is-multiple-documents .message{border-radius:inherit;padding:0!important}.bubble.is-multiple-documents .document-container{border-radius:inherit;position:relative}.bubble.is-multiple-documents .document-container .document-selection{bottom:0;left:-75vw;position:absolute;top:0;width:200vw;z-index:-2}.bubble.is-multiple-documents .document-container.is-highlighted .document-wrapper:before,.bubble.is-multiple-documents .document-container.is-selected .document-wrapper:before{background-color:var(--message-background-color);border-radius:inherit;bottom:0;content:" ";left:0;position:absolute;right:0;top:0;z-index:-1}.bubble.is-multiple-documents .document-container.is-highlighted .document-selection{background-color:var(--message-highlightning-color)}body:not(.animation-level-0) .bubble.is-multiple-documents .document-container.is-highlighted .document-selection{animation:bubbleSelected 2s linear}.bubble.is-multiple-documents .document-container.is-selected .document-selection{background-color:var(--message-highlightning-color)}body:not(.animation-level-0) .bubble.is-multiple-documents .document-container.is-selected .document-selection{animation:fade-in-opacity .2s linear forwards}body:not(.animation-level-0) .bubble.is-multiple-documents .document-container.is-selected.backwards .document-selection{animation:fade-in-backwards-opacity .2s linear forwards}.bubble.is-multiple-documents .document-container .bubble-select-checkbox{--margin-top:.25rem;--margin-left:.125rem;background:#fff;border-radius:50%;left:auto;margin-left:calc(var(--padding-left)*-1 + var(--icon-size) - var(--size) + var(--margin-left));margin-top:calc(var(--icon-size) - var(--size) + var(--margin-top));top:auto}@media only screen and (max-width:600px){.bubble.is-multiple-documents .document-container .bubble-select-checkbox{--size:1.125rem}}.bubble.is-multiple-documents .document-container .bubble-select-checkbox:before{--inner-size:.125rem;border:2px solid var(--secondary-color);border-radius:inherit;content:" ";height:calc(var(--size) - var(--inner-size)*2);left:var(--inner-size);position:absolute;top:var(--inner-size);width:calc(var(--size) - var(--inner-size)*2)}.bubble.is-multiple-documents .document-container:first-of-type .document-selection{top:-.0625rem}.bubble.is-multiple-documents .document-container:first-of-type .document-wrapper{border-top-left-radius:inherit;border-top-right-radius:inherit;padding-top:.5rem}.bubble.is-multiple-documents .document-container:last-of-type .document-selection{bottom:-.0625rem}.bubble.is-multiple-documents .document-container:last-of-type .document-wrapper{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;padding-bottom:.5rem}.bubble.is-multiple-documents.is-group-first .document-container:first-of-type .document-selection{top:-.25rem}.bubble.is-multiple-documents.is-group-last .document-container:last-of-type .document-selection{bottom:-.25rem}.bubble.is-multiple-documents .document{height:54px!important}@media only screen and (max-width:600px){.bubble.is-multiple-documents .document{height:38px!important}}.bubble.is-multiple-documents .document-wrapper{padding:.25rem .5rem}.bubble.is-multiple-documents .document-wrapper>.name{margin-top:-.1875rem;padding:0 0 .25rem}.bubble .message .audio .time,.bubble .message.contact-message .time,.bubble .message.poll-message .time{bottom:0;position:absolute;right:0}html:not(.is-safari) .bubble .message.voice-message{overflow:hidden}.bubble.is-message-empty .bubble-content-wrapper{width:-moz-min-content;width:min-content}.bubble.is-message-empty .message{background-color:var(--message-time-background);border-radius:.75rem;bottom:.1875rem;padding:0 .3125rem;position:absolute;right:.1875rem;z-index:2}.bubble.is-message-empty .message .time{align-items:center;display:flex;height:calc(var(--messages-time-text-size) + .375rem);margin:0;padding:0;white-space:nowrap}.bubble.is-message-empty .message .time .inner{bottom:auto;color:#fff;margin:inherit;right:auto}.bubble.is-message-empty .message .time .inner:after{color:#fff!important}.bubble.is-message-empty.with-replies:not(.sticker):not(.with-beside-replies) .message{bottom:55px}.bubble.is-message-empty.emoji-big .message,.bubble.is-message-empty.sticker .message,.bubble.is-message-empty.with-replies.round .message{bottom:0}.bubble.is-message-empty:not(.emoji-big) .reactions-block{max-width:-moz-fit-content;max-width:fit-content}.bubble.is-message-empty .reaction-block{--chosen-background-color:var(--primary-color)}html.no-touch .bubble.is-message-empty .reaction-block:not(.is-chosen):active:after,html.no-touch .bubble.is-message-empty .reaction-block:not(.is-chosen):hover:after{background-color:#fff}.bubble.with-reply-markup .bubble-content{min-width:100%}.bubble.with-replies .attachment{border-bottom-left-radius:0;border-bottom-right-radius:0}.bubble.with-beside-replies .bubble-content{min-height:5.5rem}.bubble .colored-name .premium-icon{color:inherit;opacity:.6}.bubble .time{cursor:pointer;direction:ltr;display:inline-flex;float:right;font-size:var(--messages-time-text-size);height:var(--messages-time-text-size);line-height:1;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;visibility:hidden;z-index:1}.bubble .time i{font-size:1.125rem;margin-right:.375rem}.bubble .time-icon{pointer-events:none}.bubble .time-icon:not(:first-child){margin-left:2px}.bubble .time i.edited{font-size:inherit;overflow:visible}.bubble .time .inner{align-items:center;bottom:0;color:var(--message-time-color);display:flex;height:var(--messages-time-text-size);line-height:1;padding:inherit;pointer-events:all;position:absolute;right:0;visibility:visible;white-space:nowrap}.bubble .time .inner:after{color:var(--message-status-color)}.bubble .time .tgico-pinnedchat{margin-right:.125rem}.bubble .time.is-block{display:block;float:none}.bubble.webpage .time{float:none}.bubble .video-play,.bubble .video-time{pointer-events:none}.bubble .video-time{--height:calc(var(--messages-time-text-size) + 0.375rem);align-items:center;background-color:var(--message-time-background);border-radius:var(--height);color:#fff;display:flex;font-size:var(--messages-time-text-size);height:var(--height);left:3px;line-height:1;padding:0 6px;position:absolute;top:3px;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:2}.bubble .video-time.can-autoplay:after{color:#fff;content:"";font-size:calc(var(--messages-time-text-size) + 8px);padding:0 1px 0 3px}[dir=ltr] .bubble .video-time.is-error:after{margin-left:1px}[dir=rtl] .bubble .video-time.is-error:after{margin-right:1px}.bubble .video-time.is-error:after{content:"";font-size:calc(var(--messages-time-text-size) + 4px);padding:0}.bubble .extended-media-buy{align-items:center;-webkit-backdrop-filter:var(--menu-backdrop-filter);backdrop-filter:var(--menu-backdrop-filter);background-color:rgba(0,0,0,.3);border-radius:2rem;color:#fff;display:flex;font-size:var(--font-size-14);font-weight:var(--font-weight-bold);height:2.5rem;left:50%;padding:0 1rem;position:absolute;top:50%;transform:translate(-50%,-50%);white-space:nowrap;z-index:2}.bubble .extended-media-buy:before{font-size:1.125rem;margin-right:.25rem}.bubble pre{display:inline;margin:0}.bubble .anchor-url{text-decoration:underline}.bubble .video-play{align-items:center;background-color:var(--message-time-background);color:#fff;display:flex;font-size:2.125rem;justify-content:center;text-align:center;z-index:2}.bubble .ckin__player.circle{z-index:1}.bubble:not(.forwarded).hide-name .name{display:none}.bubble .name{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble .peer-title{cursor:pointer}.bubble .name{color:var(--primary-color);font-size:var(--messages-secondary-text-size);font-weight:var(--font-weight-bold)!important;line-height:calc(var(--messages-secondary-text-size) + .25rem);max-width:100%;overflow:hidden;padding:.375rem .625rem 0;text-overflow:ellipsis}.bubble .name .badge-fake{display:inline-block;margin-top:-2px;vertical-align:middle}.bubble:not(.webpage).photo:not(.is-reply) .bubble-content>.name,.bubble:not(.webpage).video:not(.is-reply) .bubble-content>.name{padding-bottom:6px}.bubble:not(.webpage).photo:not(.is-message-empty) .message,.bubble:not(.webpage).video:not(.is-message-empty) .message{padding-top:6px}.bubble:not(.webpage).photo .topic-name-button-container,.bubble:not(.webpage).video .topic-name-button-container{margin-bottom:0}.bubble:not(.webpage):not(.is-album):not(.sticker):not(.round):not(.emoji-big) .attachment{background-color:#000}.bubble.hide-name:not(.is-reply):not(.is-message-empty) .message{padding-top:6px}.bubble:not(.sticker):not(.emoji-big):not(.forwarded).hide-name .reply,.bubble:not(.sticker):not(.emoji-big):not(.forwarded):not(.is-group-first) .reply{margin-top:6px}.bubble .bubble-tail{display:none}.bubble.can-have-tail.is-group-last .bubble-tail{fill:var(--message-background-color);display:block;height:20px;position:absolute;transform:translateY(1px);width:11px;z-index:-2}.bubble.is-message-empty.is-group-last.with-media-tail .bubble-tail,.bubble.photo.is-message-empty.is-group-last:not(.with-replies) .bubble-tail,.bubble.video.is-message-empty.is-group-last:not(.with-replies) .bubble-tail{display:none}.bubble.is-message-empty.is-group-last.with-media-tail .attachment{overflow:visible}.bubble__media-container{border-radius:inherit;cursor:pointer}.bubble audio-element,.bubble poll-element{white-space:normal}.bubble .replies{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble .replies .c-ripple__circle{background-color:var(--light-primary-color)}.bubble .replies .rp{border-radius:inherit;cursor:pointer;height:100%;left:0;overflow:hidden;position:absolute;top:0;width:100%}.bubble .replies-beside{border-radius:2rem;bottom:47px;flex-direction:column;height:auto;max-height:52px;min-height:36px;padding:.375rem 0 .5rem;right:-44px;width:36px}.bubble .replies-beside-text{font-size:.75rem;margin-top:.125rem}.bubble .replies-footer{align-items:center;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;border-top:.0625rem solid var(--border-color);color:var(--primary-color);display:flex;height:3.0625rem;min-width:15rem;padding:0 .5rem;position:relative}html.no-touch .bubble .replies-footer:active,html.no-touch .bubble .replies-footer:hover{background-color:var(--light-primary-color)}html.no-touch .bubble .replies-footer:active~.bubble-tail,html.no-touch .bubble .replies-footer:hover~.bubble-tail{fill:var(--light-filled-message-primary-color)}.bubble .replies-footer .tgico-comments,.bubble .replies-footer .tgico-next{font-size:1.5rem}.bubble .replies-footer .tgico-comments{margin-left:.125rem;margin-right:.375rem}.bubble .replies-footer-text{align-items:center;color:var(--primary-color);display:flex;font-size:.9375rem;font-weight:var(--font-weight-bold);line-height:1.125rem;margin-left:.5rem}.bubble .replies-footer-avatars{--margin-right:-.875rem;--border-size:2px}.bubble .replies-footer .tgico-next{position:absolute;right:.1875rem}.bubble .replies-footer.is-unread .replies-footer-text:after{background-color:var(--primary-color);border-radius:50%;content:" ";height:.5rem;margin-left:.75rem;width:.5rem}.bubble.is-thread-starter .user-avatar{display:none}.bubble.is-thread-starter.is-in .bubble-content-wrapper{margin-left:0}.bubble .message .reaction{--background-color:var(--light-filled-message-primary-color)}.bubble .message .reaction.is-chosen.backwards,.bubble .message .reaction:not(.is-chosen){--counter-color:var(--message-primary-color)}.bubble .message .reaction.is-chosen.backwards .stacked-avatars,.bubble .message .reaction:not(.is-chosen) .stacked-avatars{--border-color:var(--background-color)}.bubble .message .reactions-block .time{bottom:auto!important;order:100;position:static!important;right:auto!important}.bubble code{cursor:pointer}.bubble.is-invoice .attachment{background-color:inherit!important}.bubble.with-reply-markup .bubble-content{border-bottom-left-radius:6px!important;border-bottom-right-radius:6px!important}.bubble .name-with-reply .name{padding:0!important}.bubble .name-with-reply .name:not(:last-child) .hide-ol{display:none}.bubble .name-with-reply .name:not(:last-child) .peer-title{font-weight:var(--font-weight-bold)!important}.bubble .name-with-reply .reply{height:auto;margin:.25rem 0 0;max-height:none;padding:0}.bubble .topic-name-button{--color:var(--message-primary-color)}.bubble .name .topic-name-button-container{margin:.25rem -.125rem}.bubble .name .topic-name-button-container:first-child{margin-top:0}.bubble.is-message-empty:not(.is-reply) .name .topic-name-button-container{margin-bottom:0}.bubble:not(.is-group-first) .topic-name-button-container{display:none!important}.bubble .topic-name-button-container.floating-part{font-size:var(--messages-secondary-text-size);padding-bottom:0;padding-top:0}.bubble .topic-name-button-container.floating-part .topic-name-button{--color:#fff;padding:0}.bubble .topic-name-button-container.floating-part .topic-name-button:before{content:none}.bubble .topic-name-button-container.floating-part+.floating-part{margin-top:1.75rem}.bubble .web .audio-transcribed-text{margin-bottom:0;order:4}.bubble .audio-transcribed-text{margin-bottom:.75rem;margin-top:.25rem}.bubble .audio-transcribed-text.is-error{color:var(--message-primary-color)}.bubble .audio-transcribed-text .audio-transcribing-dots{position:relative}.bubble .audio-transcribed-text .audio-transcribing-dots:after,.bubble .audio-transcribed-text .audio-transcribing-dots:before{content:"..."}.bubble .audio-transcribed-text .audio-transcribing-dots:before{opacity:0}.bubble .audio-transcribed-text .audio-transcribing-dots:after{animation:audio-dots 1.5s linear infinite;left:0;position:absolute;right:0}@keyframes audio-dots{0%{content:""}33%{content:"."}66%{content:".."}to{content:"..."}}.bubbles-date-group:last-of-type .bubbles-group:last-of-type .bubble:last-of-type{margin-bottom:.0625rem}.bubbles-date-group:last-of-type .bubbles-group:last-of-type .bubble:last-of-type .document-container:last-of-type .document-selection,.bubbles-date-group:last-of-type .bubbles-group:last-of-type .bubble:last-of-type:after{bottom:-.0625rem}.can-zoom-fade{opacity:1;transform:scale(1) translateX(0);transform-origin:center}body.animation-level-2 .can-zoom-fade{transition:var(--bubble-transition-out)}.bubbles-inner.zoom-fading .can-zoom-fade{transition:var(--bubble-transition-in)}.can-zoom-fade.zoom-fade{opacity:0;transform:scale3d(.8,.8,1) translateX(0)}.bubble-content-wrapper{display:flex;flex-direction:column}@media only screen and (min-width:601px){.bubble:not(.service) .bubble-content-wrapper{max-width:85%}}@media only screen and (max-width:600px){.bubble-content-wrapper{max-width:calc(100% - var(--message-handhelds-margin))}}.bubble.service{align-self:center;justify-content:center}.bubble.service b{color:inherit}.bubble.service .bubble-content{background-color:transparent;border-radius:.875rem}.bubble.service .bubble-content-wrapper{max-width:100%;padding:0 2rem}.bubble.service .service-msg{align-items:center;background-color:var(--message-highlightning-color);border-radius:inherit;color:#fff;display:flex;font-size:var(--messages-service-text-size);justify-content:center;line-height:calc(var(--messages-service-text-size) + 5px);padding:.28125rem .625rem;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;word-break:break-word}.bubble.service .service-msg i{font-style:normal}.bubble.service .service-msg a{color:#fff}.bubble.service .service-msg .peer-title,.bubble.service .service-msg [data-saved-from],.bubble.service .service-msg a{cursor:pointer;font-weight:var(--font-weight-bold)}.bubble.service .service-msg .peer-title:hover,.bubble.service .service-msg [data-saved-from]:hover,.bubble.service .service-msg a:hover{text-decoration:underline}.bubble.service .service-msg img.emoji{margin-bottom:3px}.bubble.is-in .bubble-content,.bubble.is-in .bubble-content .poll-footer-button{border-radius:6px 12px 12px 6px}.bubble.is-in.is-group-first .bubble-content,.bubble.is-in.is-group-first .poll-footer-button{border-top-left-radius:12px}.bubble.is-in.is-group-last.can-have-tail .bubble-content,.bubble.is-in.is-group-last.can-have-tail .poll-footer-button{border-bottom-left-radius:0!important}.bubble.is-in.is-group-last.can-have-tail .bubble-tail{margin-left:-8.4px}.bubble.is-in.is-group-last:not(.can-have-tail) .bubble-content,.bubble.is-in.is-group-last:not(.can-have-tail) .poll-footer-button{border-bottom-left-radius:12px}.bubble.is-in.just-media .floating-part{left:calc(100% + 10px)}@media only screen and (max-width:600px){.bubble.is-in.just-media .floating-part{left:calc(100% + 1px)}}.bubble.is-in .quote .webpage-name,.bubble.is-in .reply-title{color:var(--primary-color)}.bubble.is-in .time{margin-left:-3px;padding-right:8px}.bubble.is-in .time .inner{margin-bottom:4px}.bubble.is-in.is-message-empty.is-group-last.with-media-tail .attachment{border-bottom-left-radius:0}.bubble.is-in.is-message-empty.is-group-last.with-media-tail .bubble__media-container{margin-left:-9px}.bubble.is-in .audio-subtitle,.bubble.is-in .audio-time,.bubble.is-in .contact-number{color:var(--secondary-text-color)!important}.bubble.is-in code,.bubble.is-in pre{color:var(--monospace-text-color)}.bubble.is-in:not(.just-media) .reply.is-overriding-color .reply-border{background-color:rgb(var(--override-color))}.bubble.is-in:not(.just-media) .reply.is-overriding-color .reply-title{color:rgb(var(--override-color))}html.no-touch .bubble.is-in:not(.just-media) .reply.is-overriding-color:active,html.no-touch .bubble.is-in:not(.just-media) .reply.is-overriding-color:hover{background-color:rgba(var(--override-color),.08)}.bubble.is-out{--message-background-color:var(--message-out-background-color);--light-message-background-color:var(--light-message-out-background-color);--dark-message-background-color:var(--dark-message-out-background-color);--link-color:var(--message-out-link-color);--message-primary-color:var(--message-out-primary-color);--light-filled-message-primary-color:var(--light-filled-message-out-primary-color);--selection-background-color:var(--message-out-selection-background-color);--message-time-color:var(--message-out-time-color);--message-status-color:var(--message-out-status-color);--link-color:var(--message-primary-color);flex-direction:row-reverse}.bubble.is-out .bubble-content{margin-left:auto}.bubble.is-out .bubble-content,.bubble.is-out .bubble-content .poll-footer-button{border-radius:12px 6px 6px 12px}.bubble.is-out .bubble-content .name{color:var(--message-out-primary-color)}@media only screen and (min-width:1276px){.bubble.is-out .bubble-content-wrapper{transform:scale(1) translateX(calc((var(--chat-input-size) + .5rem)*-1))}.bubble.is-out .bubble-content-wrapper.zoom-fade{transform:scale3d(.8,.8,1) translateX(calc((var(--chat-input-size) + .5rem)*-1))}body.animation-level-2 .bubble.is-out .bubble-content-wrapper{transition:var(--bubble-transition-out)}body.is-right-column-shown .bubble.is-out .bubble-content-wrapper{transform:scale(1) translateX(0)}body.animation-level-2 body.is-right-column-shown .bubble.is-out .bubble-content-wrapper{transition:var(--bubble-transition-in)}body.is-right-column-shown .bubble.is-out .bubble-content-wrapper.zoom-fade{transform:scale3d(.8,.8,1) translateX(0)}}.bubble.is-out.is-group-first .bubble-content,.bubble.is-out.is-group-first .poll-footer-button{border-top-right-radius:12px}.bubble.is-out.is-group-last.can-have-tail .bubble-content,.bubble.is-out.is-group-last.can-have-tail .poll-footer-button{border-bottom-right-radius:0!important}.bubble.is-out.is-group-last.can-have-tail .bubble-tail{right:-8.4px;transform:translateY(1px) scaleX(-1)}.bubble.is-out.is-group-last:not(.can-have-tail) .bubble-content,.bubble.is-out.is-group-last:not(.can-have-tail) .poll-footer-button{border-bottom-right-radius:12px}.bubble.is-out.just-media .floating-part{right:calc(100% + 10px)}.bubble.is-out.just-media .message{right:0}.bubble.is-out:not(.just-media) .reply-border{background-color:var(--message-out-primary-color)!important}.bubble.is-out:not(.just-media) .reply i,.bubble.is-out:not(.just-media) .reply-title{color:var(--message-out-primary-color)!important}.bubble.is-out .quote:before{background-color:var(--message-out-primary-color)}.bubble.is-out .quote .webpage-name{color:var(--message-out-primary-color)}.bubble.is-out .time{margin-left:-4px;padding-right:5px}.bubble.is-out .time .inner{bottom:4px}.bubble.is-out .time .inner:after,.bubble.is-out .time:after{font-size:calc(var(--messages-text-size) + 3px);line-height:var(--messages-time-text-size);margin-left:1px}.bubble.is-out.forwarded .name{color:var(--message-out-primary-color)}.bubble.is-out.is-read .time .inner:after,.bubble.is-out.is-read .time:after{content:""}.bubble.is-out.is-sent .time .inner:after,.bubble.is-out.is-sent .time:after{content:""}.bubble.is-out.is-sending .time .inner:after,.bubble.is-out.is-sending .time:after{content:""}.bubble.is-out.is-error .time .inner:after,.bubble.is-out.is-error .time:after{color:var(--message-error-color);content:""}.bubble.is-out .document-ico:after{border-right-color:var(--message-background-color);border-top-color:var(--message-background-color)}.bubble.is-out .audio-waveform-bar{fill:var(--message-out-primary-color)}.bubble.is-out .audio-waveform-bar.active{fill:var(--message-out-primary-color)!important}.bubble.is-out .audio-subtitle,.bubble.is-out .audio-time{color:var(--message-out-status-color)}.bubble.is-out .audio-download,.bubble.is-out .audio-toggle,.bubble.is-out .audio.corner-download .preloader-container{background-color:var(--message-out-primary-color)}.bubble.is-out .audio-download:empty{display:none}.bubble.is-out .audio.is-unread .audio-waveform-bar{fill:var(--message-out-primary-color)}.bubble.is-out .audio.is-unread .audio-time:after{background-color:var(--message-out-primary-color)}.bubble.is-out .audio-toggle .part{background-color:var(--message-out-audio-play-button-color)}.bubble.is-out.is-message-empty.is-group-last.with-media-tail .attachment{border-bottom-right-radius:0}.bubble.is-out.is-message-empty.is-group-last.with-media-tail .bubble__media-container{margin-right:-9px}.bubble.is-out.is-message-empty .reactions-block{justify-content:flex-end}.bubble.is-out.is-message-empty .reaction-block{margin-right:.25rem}.bubble.is-out.is-message-empty .reaction-block:last-child{margin-right:0}.bubble.is-out.is-message-empty .reaction-block.is-chosen{--chosen-background-color:var(--surface-color)}.bubble.is-out.is-message-empty:not(.emoji-big) .reactions-block{margin-left:auto}.bubble.is-out .bubble-call-subtitle,.bubble.is-out .contact-number,.bubble.is-out .document-size{color:var(--message-out-status-color)}.bubble.is-out .bubble-call-subtitle:before{transform:rotate(-45deg)}.bubble.is-out poll-element .poll-desc,.bubble.is-out poll-element .poll-votes-count{color:var(--message-out-primary-color)}.bubble.is-out poll-element .poll-line use{stroke:var(--message-out-primary-color)}.bubble.is-out poll-element .poll-answer-selected{background-color:var(--message-out-primary-color);color:var(--light-filled-message-out-primary-color)}html.no-touch .bubble.is-out poll-element .poll-answer:hover .animation-ring{background-color:var(--message-out-primary-color);opacity:.08}.bubble.is-out poll-element .poll-footer-button,.bubble.is-out poll-element .poll-hint{color:var(--message-out-primary-color)}.bubble.is-out poll-element .poll-avatars .stacked-avatars{--border-color:var(--message-background-color)}.bubble.is-out poll-element .progress-ring__circle{stroke:var(--message-out-primary-color)}.bubble.is-out poll-element .c-ripple__circle{background-color:var(--message-out-primary-color)}.bubble.is-out poll-element .c-ripple__circle:not(.hiding){opacity:.08}.bubble.is-out.is-sending poll-element{pointer-events:none}.bubble.is-out .audio .progress-line{--color:var(--message-out-primary-color)}.bubble.is-out .audio .progress-line:before,.bubble.is-out .audio .progress-line__loaded{background-color:var(--message-out-primary-color)}.bubble.is-out .audio .preloader-container{--color:var(--message-background-color)}.bubble.is-out .bubble-beside-button{left:var(--message-beside-button-margin);right:auto}.bubble.is-out .bubble-beside-button.goto-original{transform:rotate(180deg)}.bubble.is-out.is-multiple-documents .document-container .bubble-select-checkbox{background-color:var(--message-background-color)}.bubble.is-out.is-multiple-documents .document-container .bubble-select-checkbox:before{border-color:var(--dark-message-background-color)}.bubble.is-out.is-multiple-documents .document-container .bubble-select-checkbox .checkbox-box-border{border-color:var(--message-background-color)}.bubble.is-out .bubble-hover-reaction{left:var(--offset);right:auto}.reply-markup{margin-top:.0625rem;width:100%}.bubble:not(.is-group-last) .reply-markup{margin-bottom:.125rem}.reply-markup-row{display:flex;margin-top:.125rem;min-height:2.5rem;overflow:hidden}.reply-markup-row:last-child .reply-markup-button:first-child{border-bottom-left-radius:12px}.reply-markup-row:last-child .reply-markup-button:last-child{border-bottom-right-radius:12px}.reply-markup-button{background:var(--message-highlightning-color);border:none;border-radius:.375rem;color:#fff!important;cursor:pointer;font-size:var(--font-size-14);font-weight:var(--font-weight-bold);outline:none;overflow:hidden;padding:.5625rem 0;position:relative;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:2}.reply-markup-button-text{pointer-events:none;position:relative}.reply-markup-button.anchor-url{text-decoration:none!important}.reply-markup-button+.reply-markup-button{margin-left:.125rem}.reply-markup-button .forward-icon,.reply-markup-button.tgico:before{display:block;position:absolute;right:.125rem;top:.125rem}.reply-markup-button.is-link:before{content:"";transform:rotate(-45deg)}.reply-markup-button.is-buy:before{content:""}.reply-markup-button.is-switch-inline:before{content:""}.bubble-beside-button:after,.bubble.just-media .reply:after,.reply-markup-button:after{background-color:#fff;border-radius:inherit;bottom:0;content:" ";display:block;left:0;opacity:0;position:absolute;right:0;top:0;z-index:-1}html.no-touch .bubble-beside-button:active:after,html.no-touch .bubble-beside-button:hover:after,html.no-touch .bubble.just-media .reply:active:after,html.no-touch .bubble.just-media .reply:hover:after,html.no-touch .reply-markup-button:active:after,html.no-touch .reply-markup-button:hover:after{opacity:var(--hover-alpha)}.bubble-primary-color{color:var(--message-primary-color);font-weight:var(--font-weight-bold)}.pinned-message{--custom-emoji-size:calc(var(--font-size) + 2px)!important}.pinned-message-border{flex:0 0 auto;height:2rem;position:relative;width:.125rem}.pinned-message-border-wrapper-1{background:var(--primary-color);border-radius:1px;height:2rem;position:relative;top:50%;transform:translateY(-50%);width:.125rem}.pinned-message-border-mask{--mask-height:.375rem;--height:2.5rem;height:var(--height);overflow:hidden}.pinned-message-border-mask:after,.pinned-message-border-mask:before{content:" ";display:block;height:var(--mask-height);left:0;opacity:0;position:absolute;right:0;z-index:1}body.animation-level-2 .pinned-message-border-mask:after,body.animation-level-2 .pinned-message-border-mask:before{transition:opacity .2s ease-in-out}.pinned-message-border-mask:before{background:linear-gradient(var(--surface-color),transparent);top:0}.pinned-message-border-mask:after{background:linear-gradient(transparent,var(--surface-color));bottom:0}.pinned-message-border-mask.mask-bottom:after,.pinned-message-border-mask.mask-top:before{opacity:1}.pinned-message-border-wrapper{color:var(--primary-color);position:relative}.pinned-message-border-wrapper:before{background:var(--primary-color);bottom:0;content:" ";display:block;left:0;opacity:.4;position:absolute;right:0;top:0}.pinned-message-border-bars{stroke:currentColor;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.pinned-message-border-mark{background:currentColor;border-radius:1px;left:0;position:absolute;top:0;width:2px}body:not(.animation-level-0) .pinned-message-border-mark,body:not(.animation-level-0) .pinned-message-border-wrapper{transition:transform .25s ease-in-out;will-change:transform}.pinned-message-content{--height:32px;height:var(--height)}.pinned-message-media{border-radius:.1875rem}.pinned-message,.reply{--font-size:var(--font-size-14);--custom-emoji-size:calc(var(--font-size) + 4px);--line-height:calc(var(--font-size) + 4px);align-items:center;cursor:pointer;display:flex;overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.pinned-message-content,.reply-content{display:flex;flex-direction:column;flex-grow:1;flex-shrink:1;justify-content:center;margin-left:.5rem;overflow:hidden;pointer-events:none;position:relative}.pinned-message-title,.reply-title{color:var(--primary-color)}.pinned-message-subtitle,.pinned-message-title,.reply-subtitle,.reply-title{font-size:var(--font-size);line-height:var(--line-height);overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap}.pinned-message-media,.reply-media{height:2rem!important;left:0;overflow:hidden;position:absolute;top:.125rem;width:2rem!important}.pinned-message-media.is-round,.reply-media.is-round{border-radius:50%}.pinned-message-media>img,.pinned-message-media>video,.reply-media>img,.reply-media>video{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.pinned-message i,.reply i{color:var(--secondary-text-color);font-style:normal}.pinned-message img.emoji,.reply img.emoji{height:1rem;vertical-align:top;width:1rem}.reply.is-media .reply-content{padding-left:2.5rem}.reply-border{background:var(--primary-color);border-radius:1px;height:calc(var(--font-size)*2 + .25rem);min-width:2px}.reply-content{margin-left:.625rem}.reply-media{border-radius:.25rem}.reply-cancel{margin-bottom:0!important}.reply-title{margin:-1px 0 1px}.reply .peer-title{font-weight:var(--font-weight-bold)}.pinned-container{--container-height:3.25rem;align-items:center;cursor:pointer;display:flex;flex:0 0 auto;justify-content:space-between;overflow:visible}.pinned-container.is-floating{background-color:var(--surface-color)!important;height:var(--container-height);left:0;margin:0;max-height:var(--container-height);position:absolute!important;right:0;top:var(--topbar-height);width:auto}.pinned-container.is-floating .pinned-container-wrapper{border-radius:0;height:100%;max-width:100%;order:0;padding:0 1rem;z-index:0}@media only screen and (max-width:600px){.pinned-container.is-floating .pinned-container-wrapper{padding:0 .5rem}}.pinned-container.is-floating .pinned-container-content{margin-right:.5rem}@media only screen and (min-width:1276px){body.is-right-column-shown .pinned-container.is-floating .pinned-container-content{padding-right:var(--right-column-width)}}.pinned-container.is-floating:before{border-bottom:1px solid var(--border-color);border-top:1px solid var(--border-color);bottom:0;content:" ";left:0;position:absolute;right:0;top:0}.pinned-container-content{flex:1 1 auto;overflow:hidden;pointer-events:none;position:relative}.pinned-container .btn-icon{display:flex;flex:0 0 auto;font-size:1.5rem;justify-content:center}.pinned-container-wrapper{align-items:center;border-radius:.25rem;display:flex;flex:1 1 auto;order:1;overflow:hidden;padding:.25rem}.pinned-container-wrapper-utils{align-items:center;display:flex;flex:0 0 auto;position:relative}.pinned-message{display:flex;width:auto}.pinned-message-content{overflow:visible!important}.pinned-message-media-container{height:2rem;margin-left:-.25rem;position:absolute;width:2rem}body.animation-level-2 .pinned-message-media-container{transition:transform var(--pm-transition)}.pinned-message-subtitle,.pinned-message-title{transform:translateX(0)}.pinned-message.is-media .pinned-message-subtitle,.pinned-message.is-media .pinned-message-title{transform:translateX(2.25rem)}.pinned-message:not(.is-media) .pinned-message-media-container{transform:scale(0)}.pinned-message .pinned-container-wrapper{min-width:16rem}.pinned-message:not(.is-floating){margin-right:1rem}.pinned-message:not(.is-floating) .pinned-container-wrapper-utils{display:none}.pinned-message:not(.is-floating)>.pinned-message-close{display:flex;margin-right:.75rem;order:0}.pinned-message.is-media .pinned-message-subtitle,.pinned-message.is-media .pinned-message-title{width:calc(100% - 2.25rem)}.pinned-message.is-floating{--container-height:var(--pinned-message-height)}.pinned-message.is-floating>.btn-icon{display:none}.pinned-message.is-floating .pinned-container-wrapper{padding-left:1rem}.pinned-message.is-floating .pinned-container-content{margin-right:0}.pinned-message-content .pinned-message-subtitle,.pinned-message-content .pinned-message-title{height:calc(var(--height)/2);min-height:calc(var(--height)/2);overflow:visible;position:relative}body.animation-level-2 .pinned-message-content .pinned-message-subtitle,body.animation-level-2 .pinned-message-content .pinned-message-title{transition:transform var(--pm-transition)}.pinned-message-title{margin-bottom:.25rem}.pinned-message-subtitle .animated-super-row{font-size:var(--font-size-14);line-height:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pinned-message .animated-counter{transition:transform var(--pm-transition),opacity var(--pm-transition)}body.animation-level-0 .pinned-message .animated-counter{transition:none}.pinned-message .animated-counter:before{content:"#"}.pinned-message .animated-counter.is-last:not(.backwards){opacity:0;transform:scale(.68)}.pinned-message .animated-super-row{--translateY:16px}.pinned-message .pinned-message-media{--translateY:32px}.pinned-message.hide~.tgico-pinlist,.pinned-message.is-many .pinned-message-close,.pinned-message.is-many.is-floating .pinned-message-close,.pinned-message.is-many:not(.is-floating) .pinned-message-pinlist,.pinned-message:not(.is-many) .pinned-message-pinlist,.pinned-message:not(.is-many)~.tgico-pinlist{display:none}.pinned-message-pinlist{order:2}.chat[data-type=discussion] .pinned-message .pinned-container-close{display:none!important}.pinned-audio{--progress-height:.25rem}.pinned-audio.is-floating{--container-height:var(--pinned-audio-height)}.pinned-audio:not(.is-floating){max-width:210px;padding-right:1.75rem;position:relative}.pinned-audio .pinned-container-wrapper{overflow:visible!important}.pinned-audio .pinned-container-wrapper>.btn-icon{margin-left:0!important}.pinned-audio-ico:before{content:""}.pinned-audio-ico.flip-icon:before{content:""}.pinned-audio-title{font-weight:var(--font-weight-bold)}.pinned-audio-subtitle{color:var(--secondary-text-color)}.pinned-audio-subtitle,.pinned-audio-title{font-size:var(--font-size-14);line-height:var(--line-height-14);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.pinned-audio-content{margin-left:.75rem}.pinned-audio-progress{--border-radius:0;--height:var(--progress-height);--translateY:.125rem;bottom:0;left:0;position:absolute;right:0;transform:scaleX(var(--topbar-floating-scaleX)) translateY(var(--translateY));transform-origin:left center}@media only screen and (min-width:1276px){.pinned-audio-progress{transition:transform var(--transition-standard-out)}body.is-right-column-shown .pinned-audio-progress{transition:transform var(--transition-standard-in)}body.animation-level-0 .pinned-audio-progress{transition:none}}body.animation-level-2 .pinned-audio-progress:before{transition:opacity .2s ease-in-out}.pinned-audio-progress:not(:hover):before{opacity:0}html.no-touch .pinned-audio-progress:active,html.no-touch .pinned-audio-progress:hover{--translateY:0}.pinned-audio-progress .progress-line__filled:after{display:none!important}.pinned-audio-progress .progress-line__seek{top:-1rem}.pinned-audio-progress-wrapper{bottom:0;height:.5rem;left:0;overflow:hidden;position:absolute;right:0}.pinned-audio-volume{align-items:center;height:2.5rem;position:relative;width:2.5rem}html.is-touch .pinned-audio-volume{display:none}.pinned-audio-volume-tunnel{bottom:-1rem;content:" ";left:0;position:absolute;right:0;top:100%}.pinned-audio-volume .player-volume__icon{cursor:pointer;display:flex}.pinned-audio-volume .progress-line-container{background-color:var(--surface-color);border-radius:10px;box-shadow:0 1px 5px 0 rgba(0,0,0,.15);margin-top:2.25rem;opacity:0;padding:.75rem 1rem;position:absolute;top:100%;transform:rotate(270deg);transition:opacity .2s ease-in-out,visibility 0s .2s;visibility:hidden;width:5rem}body.animation-level-0 .pinned-audio-volume .progress-line-container{transition:none!important}.pinned-audio-volume:active .progress-line-container,.pinned-audio-volume:hover .progress-line-container{opacity:1;transition:opacity .2s ease-in-out,visibility 0s 0s;visibility:visible}.markup-tooltip{background:var(--surface-color);border-radius:10px;bottom:0;display:flex;height:44px;justify-content:flex-start;left:0;opacity:0;overflow:hidden;position:fixed;right:0;top:0;transform:translateZ(0);transition:opacity var(--layer-transition),transform var(--layer-transition),width var(--layer-transition);width:252px;z-index:1}body.animation-level-0 .markup-tooltip{transition:none}.markup-tooltip-wrapper{align-items:center;display:flex;height:100%;justify-content:flex-start;left:0;max-width:100%;position:absolute;top:0;transform:translateX(0);transition:transform var(--layer-transition);width:672px}body.animation-level-0 .markup-tooltip-wrapper{transition:none}.markup-tooltip-tools{align-items:center;display:flex;flex:0 0 auto;justify-content:space-between;max-width:100%;padding:7px}.markup-tooltip-tools:first-child{width:252px}.markup-tooltip-tools:last-child{width:420px}.markup-tooltip-tools:last-child .markup-tooltip-delimiter{margin:0 .25rem}.markup-tooltip-delimiter{background-color:var(--border-color);height:25px;width:1px}.markup-tooltip .btn-icon{border-radius:8px!important;height:30px;padding:0;width:30px}.markup-tooltip .btn-icon.active{background-color:var(--primary-color)!important;color:#fff!important}.markup-tooltip:not(.is-visible){pointer-events:none}.markup-tooltip.is-visible{opacity:1}.markup-tooltip.is-link{width:420px}.markup-tooltip.is-link .markup-tooltip-wrapper{transform:translateX(-252px)}.markup-tooltip-link-apply{color:var(--primary-color);font-size:2rem}.markup-tooltip-link-apply-container{align-items:center;display:flex;opacity:0;pointer-events:none;transition:opacity var(--layer-transition)}body.animation-level-0 .markup-tooltip-link-apply-container{transition:none}.markup-tooltip .input-clear{flex:1 1 auto;margin:0 .5rem;text-overflow:ellipsis}.markup-tooltip .input-clear.is-valid+.markup-tooltip-link-apply-container{opacity:1;pointer-events:all}.stickers-helper>.scrollable{max-height:13.75rem;min-height:var(--esg-sticker-size);padding:.4375rem;position:relative}.stickers-helper-stickers{border-radius:var(--border-radius);max-width:100%}html.no-touch .stickers-helper .super-sticker:not(.active):active,html.no-touch .stickers-helper .super-sticker:not(.active):hover{background:none}.emoji-helper{height:50px;padding:.25rem 0!important}.emoji-helper>.scrollable{position:relative;width:auto}.emoji-helper .super-emojis{display:block;white-space:nowrap}.emoji-helper .super-emojis:after,.emoji-helper .super-emojis:before{content:" ";display:inline-block;width:.25rem}html.no-touch .emoji-helper .super-emoji:not(.active):active,html.no-touch .emoji-helper .super-emoji:not(.active):hover{background:none}.emoji-helper .super-emoji.active{background-color:var(--primary-color)!important}.inline-helper{-webkit-user-select:none;-moz-user-select:none;user-select:none}.inline-helper:not(.is-gallery){min-width:min(20rem,100%)}.inline-helper .scrollable{max-height:232px;position:relative}.inline-helper-separator{background-color:var(--border-color);height:1px;margin-left:4rem;width:100%}.inline-helper-separator:last-child{display:none}.inline-helper .btn-primary{border-radius:0;border-radius:initial}.inline-helper-results:not(.is-gallery){cursor:pointer}.inline-helper-results:not(.is-gallery) .inline-helper-result{height:4rem;line-height:var(--line-height);padding:.5rem .5rem .5rem 4rem}.inline-helper-results:not(.is-gallery) .inline-helper-result-preview{height:3rem!important;left:.5rem;overflow:hidden;position:absolute;width:3rem!important}.inline-helper-results:not(.is-gallery) .inline-helper-result-preview.empty{align-items:center;background-color:var(--primary-color);border-radius:.375rem;color:#fff;display:flex;font-size:1.75rem;justify-content:center;text-transform:uppercase}.inline-helper .media-container{border-radius:inherit}.inline-helper .media-photo,.inline-helper .media-poster,.inline-helper .media-video{border-radius:inherit;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.inline-helper .gif{bottom:0;height:auto!important;left:0;position:absolute;right:0;top:0;width:auto!important}.inline-helper-results.is-gallery{grid-gap:1px;border-radius:var(--border-radius);grid-template-columns:repeat(auto-fill,minmax(var(--esg-sticker-size),1fr));max-width:100%}.inline-helper-results.is-gallery .inline-helper-result{height:auto!important;width:auto!important}.inline-helper-result{position:relative}.inline-helper-result-title{font-weight:var(--font-weight-bold);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inline-helper-result-description{-webkit-line-clamp:2;-webkit-box-orient:vertical;color:var(--secondary-text-color);display:-webkit-box;font-size:.875rem;overflow:hidden;text-overflow:ellipsis;white-space:pre-wrap}.inline-helper-cant-send{color:var(--secondary-text-color);display:none;margin:0 auto}.inline-helper.cant-send{height:3rem;width:100%!important}.inline-helper.cant-send .scrollable-y{display:none}.inline-helper.cant-send .inline-helper-cant-send{display:block}.chat-search{left:0;position:absolute!important;right:0;top:0;z-index:2}.chat-search-footer{align-items:center;background-color:var(--surface-color);box-shadow:0 -1px 5px -1px rgba(0,0,0,.21);display:flex;flex:0 0 auto;height:46px;justify-content:space-between;overflow:hidden;padding:0 8px;width:100%}.chat-search-footer .chat-search-count{color:var(--secondary-text-color);margin-left:8px}.chat-search-count:empty,.chat-search-count:not(:empty)+.btn-icon,.chat-search-footer+.chat-input{display:none}.chat-search-controls{display:flex}.chat-search-results{background-color:var(--surface-color);height:100%;left:0;max-height:100%;opacity:0;overflow:hidden;position:absolute;top:0;transition:.2s ease;visibility:hidden;width:100%}body.animation-level-0 .chat-search-results{transition:none}.chat-search-results.active{opacity:1;visibility:visible}.chat-search .tgico-up{margin-right:2px}.drops-container{--padding:0px;align-items:center;bottom:var(--padding);display:flex;flex-direction:column;justify-content:center;left:var(--padding);position:absolute!important;right:var(--padding);top:var(--padding);-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important;z-index:3}.drops-container:not(.is-visible){display:none}.drops-container.is-visible{animation:fade-in-opacity .2s linear forwards}.drops-container.is-visible.backwards{animation:fade-in-backwards-opacity .2s linear forwards}.drop{--wrapper-padding:-4px;align-items:center;background-color:var(--surface-color);border-radius:12px;color:#a2acb4;display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;max-width:100%;pointer-events:all;position:relative;transition:color .2s ease-in-out;width:100%}.drop-outline-wrapper{bottom:var(--wrapper-padding);left:var(--wrapper-padding);pointer-events:none;position:absolute;right:var(--wrapper-padding);top:var(--wrapper-padding)}.drop-outline-path{fill:none;stroke-dasharray:13.5,11;stroke:#a2acb4;stroke-width:2;stroke-linecap:round;stroke-dashoffset:0;transition:stroke .2s ease-in-out}.drop.is-dragover .drop-outline-path{stroke:var(--primary-color);animation:drop-outline-move .5s linear infinite}.drop-icon{font-size:6rem}.drop-header{font-size:1.25rem;font-weight:var(--font-weight-bold)}.drop-header:not(:last-child){margin-top:-10px}@media only screen and (max-height:670px){.drop-icon{font-size:0}.drop-header{margin-top:0}}.drop.is-dragover{color:var(--primary-color)}.drop+.drop{margin-top:10px}@keyframes drop-outline-move{0%{stroke-dashoffset:0}to{stroke-dashoffset:-24.5}}body.is-dragging .page-chats{pointer-events:none}.bot-commands{--border-radius-padding:24px;--offset:.5rem;animation:none!important;background-color:transparent!important;border-radius:12px 12px 0 0!important;bottom:calc(100% - var(--border-radius-padding));box-shadow:none;left:calc(var(--offset)*-1);max-height:20rem;max-width:none;overflow:hidden;padding:var(--offset) var(--offset) 0!important;pointer-events:none;position:absolute!important;right:calc(var(--offset)*-1);transition:none!important;visibility:visible!important;width:auto!important}body.animation-level-2 .bot-commands{display:flex!important}.bot-commands .scrollable{background-color:var(--surface-color);border-radius:inherit;box-shadow:0 1px 8px 1px rgba(0,0,0,.12);height:auto;max-height:207px!important;pointer-events:all}body.animation-level-2 .bot-commands .scrollable{opacity:0;transform:translateY(var(--height))}.bot-commands.is-visible.animating .scrollable{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.bot-commands.is-visible:not(.backwards) .scrollable{opacity:1;transform:translateY(0)}.bot-commands-list{border-radius:inherit;height:var(--height);padding-bottom:0;width:100%}.bot-commands-list-element{align-items:flex-start;border-radius:0!important;flex-direction:column;justify-content:center;padding-left:3.375rem}.bot-commands-list-element-avatar{left:.75rem;position:absolute}.bot-commands-list-element-description,.bot-commands-list-element-name{font-size:.875rem;line-height:var(--line-height-14);margin-left:0}.crop .overlay::-moz-selection,.crop-component::-moz-selection{background:transparent}.crop .overlay::selection,.crop-component::selection{background:transparent}.crop-image,.crop-overlay-image{display:block;height:auto;-o-object-fit:contain;object-fit:contain;-o-object-position:center;object-position:center;width:auto}.crop-image{display:block;pointer-events:none;position:relative}.crop-component{background-color:#fff;margin:0 auto;overflow:hidden;position:relative;z-index:999}.crop-component>img{max-width:100%}.crop-overlay{border-radius:50%;box-sizing:content-box;overflow:hidden;position:absolute;z-index:999}.crop-overlay:active,html.no-touch .crop-overlay:hover{cursor:move}.crop-overlay-image{display:block;position:absolute}.crop-overlay-color{background-color:hsla(0,0%,100%,.7);border-radius:8px;height:100%;left:0;position:absolute;top:0;width:100%}.crop.is-forum .crop-overlay{border-radius:var(--avatar-border-radius-forum)}.sidebar-header{align-items:center;background-color:var(--surface-color);cursor:default;display:flex;flex:0 0 auto;justify-content:space-between;min-height:3.5rem;padding-left:1rem;padding-right:1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.sidebar-header .btn-menu{overflow-y:overlay}@media only screen and (max-width:600px){.sidebar-header{padding-left:.5rem;padding-right:.5rem}}[dir=ltr] .sidebar-header__title{padding-left:1.5rem}[dir=rtl] .sidebar-header__title{padding-right:1.5rem}.sidebar-header__title{color:var(--primary-text-color);flex:1;font-size:1.25rem;font-weight:var(--font-weight-bold)}[dir=ltr] .sidebar-header .btn-icon+.btn-icon{margin-left:.5rem}[dir=rtl] .sidebar-header .btn-icon+.btn-icon{margin-right:.5rem}.sidebar-header-right{flex:0 0 auto}.scrollable-y-bordered .sidebar-header{position:relative}.scrollable-y-bordered .sidebar-header:after{background-color:var(--border-color);bottom:-1px;content:" ";height:1px;left:0;opacity:0;position:absolute;right:0;z-index:1}body.animation-level-2 .scrollable-y-bordered .sidebar-header:after{transition:opacity var(--transition-standard-in)}.scrollable-y-bordered:not(.scrolled-top) .sidebar-header:after{opacity:1}.sidebar-close-button{flex:0 0 auto;height:2.5rem;overflow:inherit!important;width:2.5rem}.sidebar-content{display:flex;flex:1 1 auto;height:100%;max-height:100%;overflow:hidden;position:relative;width:100%}.profile-avatars-container{cursor:pointer;padding-bottom:100%;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}html.no-touch .profile-avatars-container:active .profile-avatars-arrow,html.no-touch .profile-avatars-container:hover .profile-avatars-arrow{opacity:.2}.profile-avatars-container.is-single .profile-avatars-arrow,.profile-avatars-container.is-single .profile-avatars-tabs{display:none}.profile-avatars-container.is-swiping .profile-avatars-arrow{opacity:0!important}.profile-avatars-avatars{display:flex;flex-wrap:nowrap;height:100%;position:absolute;transform:translateZ(-1px) scale(2);transform-origin:left top;transition:transform .2s ease-in-out;width:100%}.scrollable.no-parallax .profile-avatars-avatars{transform:translate(0)}.profile-avatars-avatars:before{bottom:0;content:" ";left:0;right:0;top:0}.profile-avatars-avatar{background-color:#000;display:flex;height:inherit;min-height:100%;min-width:100%;position:relative;width:inherit}.profile-avatars-avatar .avatar-photo{height:100%;-o-object-fit:cover;object-fit:cover;pointer-events:none;width:100%}.profile-avatars-gradient{background:linear-gradient(1turn,rgba(0,0,0,.3) 8.98%,transparent);bottom:0;height:80px;left:0;position:absolute;right:0}[dir=ltr] .profile-avatars-info{left:1.5rem}[dir=rtl] .profile-avatars-info{right:1.5rem}.profile-avatars-info{align-items:flex-start;bottom:0;bottom:.5625rem;display:flex;flex-direction:column;pointer-events:none;position:absolute}[dir=ltr] .profile-avatars-info .profile-name,[dir=ltr] .profile-avatars-info .profile-subtitle{text-align:left}[dir=rtl] .profile-avatars-info .profile-name,[dir=rtl] .profile-avatars-info .profile-subtitle{text-align:right}.profile-avatars-info .profile-name,.profile-avatars-info .profile-subtitle{color:#fff;margin:0}.profile-avatars-info .peer-typing-container{--color:#fff}.profile-avatars-info .premium-icon{color:#fff}.profile-avatars-info .verified-icon-background{fill:#fff}.profile-avatars-info .verified-icon-check{visibility:hidden}.profile-avatars-info .premium-icon,.profile-avatars-info .profile-subtitle,.profile-avatars-info .verified-icon{opacity:.7}.profile-avatars-info .online{color:inherit!important}.profile-avatars-tabs{display:flex;height:.125rem;left:.375rem;pointer-events:none;position:absolute;right:.375rem;top:.5rem}.profile-avatars-tab{background-color:#fff;border-radius:4px;flex:1 1 auto;height:inherit;margin:0 .125rem;opacity:.2;transition:opacity .2s ease-in-out}.profile-avatars-tab.active{opacity:.6}.profile-avatars-arrow{bottom:0;left:0;opacity:0;position:absolute;top:0;width:33.3333333333%}.profile-avatars-arrow:before{color:#fff;font-size:2.1875rem;left:.625rem;position:absolute;top:50%;transform:translateY(-50%)}body.animation-level-2 .profile-avatars-arrow{transition:opacity .2s ease-in-out}html.no-touch .profile-avatars-container:not(.is-swiping) .profile-avatars-arrow:active,html.no-touch .profile-avatars-container:not(.is-swiping) .profile-avatars-arrow:hover{opacity:1!important}.profile-avatars-arrow-next{left:auto;right:0}.profile-avatars-arrow-next:before{left:auto;right:.625rem}.profile-content{display:flex;flex:0 0 auto;flex-direction:column;position:relative;width:100%}.profile-content .sidebar-left-section{background-color:var(--surface-color);padding-bottom:.5rem;position:relative}.profile-content .sidebar-left-section .profile-subtitle .peer-typing-container{justify-content:center}.profile-content.search-empty .gradient-delimiter{display:none}@media only screen and (max-width:600px){.profile-button{border-radius:0}}[dir=ltr] .profile-change-avatar{right:1.25rem}[dir=rtl] .profile-change-avatar{left:1.25rem}.profile-change-avatar{--size:3.375rem;position:absolute!important;top:calc(var(--size)/-2);transform:none;transition:none!important}.profile-container>.scrollable{display:flex;flex-direction:column}.profile-name{align-items:flex-end;color:var(--primary-text-color);display:flex;font-size:var(--font-size-20);font-weight:var(--font-weight-bold);line-height:var(--line-height-20);margin:0 auto;max-width:21.25rem;overflow:hidden;text-align:center}.profile-name span.emoji{min-width:-moz-min-content;min-width:min-content;vertical-align:inherit}.profile-name .peer-title{overflow:hidden;text-overflow:ellipsis;word-break:break-word}.sidebar-left-section-content>.profile-name{justify-content:center}.profile-name .badge-fake{align-self:center}.profile-subtitle{align-items:center;color:var(--secondary-text-color);display:flex;font-size:.875rem;justify-content:center;margin-bottom:.875rem;margin-top:1px;text-align:center}@media only screen and (max-width:600px){.profile-subtitle{margin-top:3px}}.profile-subtitle .online{color:var(--primary-color)}.profile-avatar{display:block;margin:.5rem auto 10px}@media only screen and (max-width:600px){.profile-avatar{--size:100px;--multiplier:.54;margin:0 auto 10px}}.profile-avatar,.profile-name,.profile-subtitle{flex:0 0 auto}.menu-horizontal-scrollable{--scrollable-size:3rem;height:var(--scrollable-size)}.menu-horizontal-scrollable:after{border-bottom:1px solid var(--border-color);bottom:0;content:" ";height:1px;left:0;position:absolute;right:0;z-index:-1}.menu-horizontal-scrollable .menu-horizontal-div{border-bottom:none}.menu-horizontal-div{--size:var(--scrollable-size,3rem);--padding-horizontal:0px;border-bottom:1px solid var(--border-color);color:var(--secondary-text-color);display:flex;flex-direction:row;height:var(--size);justify-content:space-around;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:2}.menu-horizontal-div:not(.no-stripe):after,.menu-horizontal-div:not(.no-stripe):before{content:" ";flex:0 0 auto;width:var(--padding-horizontal)}.menu-horizontal-div:not(.no-stripe) .menu-horizontal-div-item{border-radius:10px 10px 0 0}.menu-horizontal-div-item{align-items:center;border-radius:0;cursor:pointer;display:flex;flex:1 1 auto;font-size:1rem;font-weight:var(--font-weight-bold);height:100%;justify-content:center;line-height:var(--line-height);padding:0 1rem;position:relative;text-align:center;transition:none!important}html.no-touch .menu-horizontal-div-item:active,html.no-touch .menu-horizontal-div-item:hover{background-color:var(--light-secondary-text-color)}.menu-horizontal-div-item.active{color:var(--primary-color)}.menu-horizontal-div-item.active i{opacity:1}.menu-horizontal-div-item.active .c-ripple__circle,html.no-touch .menu-horizontal-div-item.active:active,html.no-touch .menu-horizontal-div-item.active:hover{background-color:var(--light-primary-color)}.menu-horizontal-div-item.active .badge{background-color:var(--primary-color)}.menu-horizontal-div-item>span{align-items:center;display:inline-flex;overflow:visible;pointer-events:none;position:relative}.menu-horizontal-div i{background-color:var(--primary-color);border-radius:.1875rem .1875rem 0 0;bottom:-.8125rem;box-sizing:content-box;height:.1875rem;left:0;opacity:0;pointer-events:none;position:absolute;transform-origin:left;width:100%;z-index:1}.menu-horizontal-div i.animate{transition:transform var(--tabs-transition)}.tabs-container{display:grid;grid-template-columns:100%;grid-template-rows:100%;min-width:100%;width:100%}.tabs-container .tabs-tab{background-color:var(--background-color);display:none;flex-direction:column;grid-column-start:1;grid-row-start:1;overflow:hidden}body.animation-level-0 .tabs-container .tabs-tab{transition:none!important}.tabs-container .tabs-tab.active{display:flex}.tabs-container[data-animation=tabs] .tabs-tab{transition:transform var(--tabs-transition)}.tabs-container[data-animation=navigation].animating .tabs-tab{transition:transform var(--transition-standard-in),filter var(--transition-standard-in)}.tabs-container[data-animation=navigation].animating.backwards .tabs-tab{transition:transform var(--transition-standard-out),filter var(--transition-standard-out)}#column-left{flex:1 1 auto;flex-direction:column;max-width:420px;width:420px}@media only screen and (max-width:600px){#column-left{max-width:100%;width:100%}body:not(.is-left-column-shown) #column-left{filter:brightness(80%);transform:translate3d(-25vw,0,0)}}@media only screen and (min-width:601px){#column-left{overflow:visible}[dir=ltr] #column-left:after{right:-1px}[dir=rtl] #column-left:after{left:-1px}#column-left:after{background-color:var(--border-color);content:" ";display:block;height:100vh;position:absolute;top:0;width:1px;z-index:2}}@media only screen and (min-width:601px)and (max-width:925px){#column-left{display:flex;left:0;max-width:none;position:fixed;top:0;transform:translate3d(-5rem,0,0);transition:transform var(--layer-transition);width:26.5rem}body.animation-level-0 #column-left{transition:none}body.is-left-column-shown #column-left{transform:translateZ(0)}}@media only screen and (min-width:926px){#column-left{display:flex}}@media only screen and (max-width:1275px){#column-left{flex:2}}@media only screen and (min-width:1681px){html.is-safari #column-left{max-width:418.75px}}#column-left .item-main .menu-horizontal-scrollable{background-color:var(--surface-color);position:relative;top:auto;z-index:1}@media only screen and (max-width:600px){#column-left .item-main .menu-horizontal-scrollable{box-shadow:0 1px 5px -1px rgba(0,0,0,.16)}}#column-left .item-main .menu-horizontal-scrollable .scrollable{position:relative}[dir=ltr] #column-left .item-main .menu-horizontal-scrollable .badge{margin-left:5px}[dir=rtl] #column-left .item-main .menu-horizontal-scrollable .badge{margin-right:5px}#column-left .item-main .menu-horizontal-scrollable:not(.hide)+#folders-container{height:calc(100% - var(--scrollable-size));position:relative}#column-left .item-main .menu-horizontal-scrollable:not(.hide)+#folders-container .scrollable{padding-top:.5rem}#column-left .item-main .menu-horizontal-scrollable:not(.hide)+#folders-container .dialogs-placeholder-canvas{top:.5rem}#column-left .item-main .menu-horizontal-div{--padding-horizontal:.6875rem;justify-content:flex-start;position:relative!important;z-index:0}@media only screen and (max-width:600px){#column-left .item-main .menu-horizontal-div{--padding-horizontal:.1875rem}}#column-left .item-main .menu-horizontal-div-item{flex:0 0 auto;min-width:3rem}#column-left .item-main .menu-horizontal-div__stripe{display:none}#column-left .folders-tabs-scrollable{flex:0 0 auto}#column-left .item-main{--offset-top:0;background-color:var(--surface-color)}[dir=ltr] #column-left .item-main .input-search .selector-user{left:6px}[dir=rtl] #column-left .item-main .input-search .selector-user{right:6px}[dir=ltr] #column-left .item-main .input-search .selector-user{margin-left:0}[dir=rtl] #column-left .item-main .input-search .selector-user{margin-right:0}#column-left .item-main .input-search .selector-user{height:30px;line-height:1.875rem;position:absolute!important;top:6px;z-index:1}[dir=ltr] #column-left .item-main .input-search.is-picked .input-search-input{padding-left:calc(var(--paddingLeft) + 12px - var(--border-width))}[dir=rtl] #column-left .item-main .input-search.is-picked .input-search-input{padding-right:calc(var(--paddingLeft) + 12px - var(--border-width))}#column-left .item-main .input-search.is-picked .tgico-close{display:block!important}#column-left .item-main .input-search.is-picked-twice .selector-user:first-of-type{width:30px}[dir=ltr] #column-left .item-main .input-search.is-picked-twice .selector-user:last-of-type{left:38px}[dir=rtl] #column-left .item-main .input-search.is-picked-twice .selector-user:last-of-type{right:38px}[dir=ltr] #column-left .item-main .search-helper{margin-left:28px}[dir=rtl] #column-left .item-main .search-helper{margin-right:28px}#column-left .item-main .search-helper{display:flex}@media only screen and (max-width:600px){[dir=ltr] #column-left .item-main .search-helper{margin-left:20px}[dir=rtl] #column-left .item-main .search-helper{margin-right:20px}}#column-left .item-main .search-helper .selector-user{font-size:14px;margin-top:7px}html.no-touch #column-left .item-main .search-helper .selector-user:active,html.no-touch #column-left .item-main .search-helper .selector-user:hover{background-color:var(--light-primary-color)}#column-left .item-main .search-helper .selector-user-avatar:after{display:none!important}#column-left .item-main .search-helper:empty{display:none}#column-left .item-main .search-super-tabs-scrollable{flex:0 0 auto;position:relative!important}#column-left .item-main .search-super-tabs-scrollable:before{display:none}#column-left .item-main .search-super-tabs-scrollable .menu-horizontal-div-item{flex:1 0 auto!important}#column-left .item-main .search-super .preloader{height:100%;top:50%;transform:translate(-50%,-50%)}#column-left #chatlist-container{background-color:var(--surface-color);max-height:100%;position:relative}#column-left #chatlist-container.has-filters .connection-status-bottom{height:calc(100% + var(--offset-top)*-1)}#column-left #folders-container{flex:1 1 auto}#column-left #folders-container .scrollable-y{background-color:transparent;position:absolute}#column-left #folders-container .scrollable-y.active{display:block}#column-left .dialogs-placeholder-canvas{position:absolute;top:0;z-index:2}#column-left .sidebar-slider{height:100%}#column-left .sidebar-header__btn-container{align-items:center;display:flex;flex:0 0 auto;height:2.5rem;justify-content:center;position:relative;width:2.5rem}#column-left .sidebar-header__btn-container>.btn-icon{bottom:0;left:0;margin:0;opacity:0;position:absolute;right:0;top:0;visibility:hidden;z-index:4}body.animation-level-0 #column-left .sidebar-header__btn-container>.btn-icon:before{transition:none}#column-left .sidebar-header__btn-container>.btn-icon.is-visible{opacity:1;visibility:visible}@media only screen and (max-width:600px){#column-left .sidebar-header__btn-container .btn-menu{margin-top:-.25rem}}#column-left .sidebar-tools-button{width:100%}#column-left .sidebar-tools-button .btn-menu{max-height:calc(var(--vh)*100 - 3.75rem);min-width:260px}[dir=ltr] #column-left .sidebar-tools-button .btn-menu-item{padding-right:.375rem}[dir=rtl] #column-left .sidebar-tools-button .btn-menu-item{padding-left:.375rem}[dir=ltr] #column-left .archived-count{margin-left:.625rem}[dir=rtl] #column-left .archived-count{margin-right:.625rem}#column-left .archived-count{justify-self:flex-end}html[dir=ltr].is-mobile #column-left .archived-count{margin-right:.375rem}html[dir=rtl].is-mobile #column-left .archived-count{margin-left:.375rem}@media only screen and (max-width:600px){#column-left .archived-count{font-weight:var(--font-weight-bold)}}#column-left .archived-count:empty{display:none}#column-left .search-group-people .chatlist{display:flex;flex-direction:row;margin-top:-1px;padding:0 0 1px}#column-left .search-group-people .chatlist:after,#column-left .search-group-people .chatlist:before{content:" ";display:inline-block;flex:0 0 auto;width:.3125rem}#column-left .search-group-people .chatlist-chat{align-items:center;border-radius:10px;display:flex;flex:0 0 auto;flex-direction:column;height:6.125rem;justify-content:flex-end;max-width:4.875rem;padding:0!important;width:4.875rem}#column-left .search-group-people .dialog-subtitle,#column-left .search-group-people .dialog-title-details{display:none}#column-left .search-group-people .dialog-title{max-width:65px;padding-bottom:.75rem}#column-left .search-group-people .dialog-title .user-title{font-size:.75rem!important}#column-left .search-group-people .dialog-title .peer-title{font-weight:var(--font-weight-normal)!important}[dir=ltr] #column-left .search-group-people .dialog-avatar{left:auto!important}[dir=rtl] #column-left .search-group-people .dialog-avatar{right:auto!important}#column-left .search-group-people .dialog-avatar{top:.75rem!important}#column-left .search-group-people .search-group-scrollable{position:relative}@media only screen and (max-width:600px){[dir=ltr] #column-left .search-group-people .search-group-scrollable{margin-left:-7px}[dir=rtl] #column-left .search-group-people .search-group-scrollable{margin-right:-7px}#column-left .search-group-people .search-group-scrollable{margin-top:4px}}#column-left .search-group-people .search-group-scrollable>.scrollable{position:relative}#column-left .item-main .sidebar-content{justify-content:center}#column-left .item-main .sidebar-content .btn-menu{bottom:calc(100% + 10px)}#column-left .item-main .sidebar-content .btn-corner.menu-open .tgico-close,#column-left .item-main .sidebar-content .btn-corner:not(.menu-open) .tgico-newchat_filled{visibility:visible!important}body.animation-level-2 #column-left .item-main .sidebar-content .btn-corner.menu-open .tgico-close,body.animation-level-2 #column-left .item-main .sidebar-content .btn-corner:not(.menu-open) .tgico-newchat_filled{animation:grow-icon .4s ease-in-out forwards!important}@media only screen and (max-width:600px){#column-left .item-main .sidebar-content .btn-corner{--size:54px;bottom:14px;position:fixed!important;right:14px;z-index:1}}#column-left .item-main .sidebar-content .btn-corner:not(.is-hidden){transform:translateZ(0)}#column-left .connection-status{flex:0 0 auto;overflow:hidden;padding:0 .5rem .5rem;width:100%}#column-left .connection-status:not(.is-shown) .connection-status-button{display:none}#column-left .connection-status.is-shown.animating .connection-status-button,#column-left .connection-status.is-shown.animating+.connection-status-bottom{transition:transform var(--layer-transition)}#column-left .connection-status.is-shown:not(.backwards) .connection-status-button{transform:translateY(0)}#column-left .connection-status.is-shown:not(.backwards)+.connection-status-bottom{transform:translateY(calc(64px + var(--offset-top)))}#column-left .connection-status.is-shown:not(.animating):not(.backwards)+.connection-status-bottom{height:calc(100% - 64px + var(--offset-top))}[dir=ltr] #column-left .connection-status-button{padding-left:4.5rem}[dir=rtl] #column-left .connection-status-button{padding-right:4.5rem}[dir=ltr] #column-left .connection-status-button{text-align:left}[dir=rtl] #column-left .connection-status-button{text-align:right}#column-left .connection-status-button{align-self:center;color:#2e3939;cursor:default;height:3.5rem;transform:translateY(-100%)}#column-left .connection-status-button .force-reconnect{color:inherit;cursor:pointer;text-decoration:underline}[dir=ltr] #column-left .connection-status-button .preloader-container{left:1rem}[dir=rtl] #column-left .connection-status-button .preloader-container{right:1rem}#column-left .connection-status-button .preloader-container{height:1.5rem;right:auto;width:1.5rem}#column-left .connection-status-button .preloader-container .preloader-path-new{stroke:#2e3939}#column-left .connection-status-bottom{--offset-top:0px;background-color:var(--surface-color);bottom:0;display:flex;flex-direction:column;height:100%;left:0;overflow:hidden;position:absolute;right:0;top:0;transform:translateY(var(--offset-top))}#column-left .input-wrapper{flex:0 0 auto;margin:.75rem 0;max-width:100%;padding:0 .75rem;width:420px}@media only screen and (max-width:600px){#column-left .input-wrapper{width:100%}}#search-container{display:flex;top:var(--offset-top)!important}#search-container .scrollable-y{flex:1 1 auto;position:relative}.edit-profile-container .sidebar-content,.new-channel-container .sidebar-content,.new-group-container .sidebar-content{flex-direction:column}.edit-profile-container .chatlist-container,.new-channel-container .chatlist-container,.new-group-container .chatlist-container{flex:1 1 auto}[dir=ltr] .edit-profile-container .caption,[dir=ltr] .new-channel-container .caption,[dir=ltr] .new-group-container .caption{margin-left:23px}[dir=rtl] .edit-profile-container .caption,[dir=rtl] .new-channel-container .caption,[dir=rtl] .new-group-container .caption{margin-right:23px}[dir=ltr] .edit-profile-container .caption,[dir=ltr] .new-channel-container .caption,[dir=ltr] .new-group-container .caption{padding-right:24px}[dir=rtl] .edit-profile-container .caption,[dir=rtl] .new-channel-container .caption,[dir=rtl] .new-group-container .caption{padding-left:24px}.edit-profile-container .caption,.new-channel-container .caption,.new-group-container .caption{color:var(--secondary-text-color);font-size:.875rem;margin-top:14px}.language-container .sidebar-left-section{padding-bottom:.5rem}.new-group-container .search-group{margin-top:.5rem}.edit-folder-container .chatlist{padding:0}.edit-folder-container .folder-categories .folder-category-button:nth-child(n+2){pointer-events:none}.new-group-members{padding:1.5rem 0 .4375rem}.new-group-members .search-group__name{text-transform:capitalize}.settings-container .profile-avatars-container{height:15rem;padding-bottom:0}.edit-profile-container .scroll-wrapper{width:100%}.chat-folders-container,.edit-folder-container,.people-nearby-container{-webkit-user-select:none;-moz-user-select:none;user-select:none}.chat-folders-container .sticker-container,.edit-folder-container .sticker-container,.people-nearby-container .sticker-container{flex:0 0 auto;height:86px;margin:1px auto 29px;position:relative;width:86px}.chat-folders-container .caption,.edit-folder-container .caption,.people-nearby-container .caption{color:var(--secondary-text-color);font-size:var(--font-size-14);line-height:var(--line-height-14);margin:0 auto;max-width:20rem;text-align:center}.people-nearby-container .sticker-container{margin:1rem auto}.people-nearby-container .caption{margin-bottom:1rem}.chat-folders-container .sidebar-left-section:not(:last-child){padding-bottom:0}.chat-folders-container .sidebar-left-section:last-child{padding-bottom:.5rem}.edit-folder-container .caption{margin-bottom:18px}@media only screen and (max-width:600px){.edit-folder-container .input-wrapper{padding:0 16px;width:100%}}.edit-folder-container .sidebar-left-section{padding-bottom:0}.edit-folder-container .sidebar-left-section:last-child{padding-bottom:.5rem}.folder-categories .checkbox-field{position:absolute;right:1.125rem!important}.included-chatlist-container .sidebar-left-section{padding-bottom:0}.included-chatlist-container .sidebar-left-section:first-child{padding-top:0}.included-chatlist-container .sidebar-left-section:last-child{padding-bottom:.5rem}.included-chatlist-container .sidebar-left-section .chatlist{padding:0}.included-chatlist-container .selector .chatlist .checkbox{margin-top:10px}[dir=ltr] .included-chatlist-container .selector .chatlist [type=checkbox]+span{padding-left:26px}[dir=rtl] .included-chatlist-container .selector .chatlist [type=checkbox]+span{padding-right:26px}[dir=ltr] .included-chatlist-container .chatlist-chat{padding-right:3.5rem!important}[dir=rtl] .included-chatlist-container .chatlist-chat{padding-left:3.5rem!important}.search-group-recent .search-group__name{align-items:center;display:flex;justify-content:space-between}.search-group-recent .btn-icon{font-size:22px}@media only screen and (max-width:600px){.search-group-recent.search-group.search-group-contacts ul{margin-top:0}.search-group.search-group-contacts ul,.search-group.search-group-messages ul{margin-top:7px}.search-group.search-group-messages{margin-top:-6px}}@media only screen and (min-width:601px){.search-group-recent.search-group.search-group-contacts{padding:0 0 7px}}.sidebar-left-section{padding:.5rem 0 1rem}.sidebar-left-section.with-fake-delimiter{box-shadow:none;padding-top:0!important}.sidebar-left-section.with-fake-delimiter .gradient-delimiter{margin-bottom:.5rem}.sidebar-left-section.no-padding-top{padding-top:0!important}@media only screen and (max-width:600px){.sidebar-left-section{padding-bottom:.5rem}}@media only screen and (min-width:601px){.sidebar-left-section-content{margin:0 .5rem}}.sidebar-left-section-content>.btn-primary{margin:0}[dir=ltr] .sidebar-left-section-content>.checkbox-field .checkbox-box{left:auto}[dir=rtl] .sidebar-left-section-content>.checkbox-field .checkbox-box{right:auto}@media only screen and (max-width:600px){.sidebar-left-section-content>.btn-primary,.sidebar-left-section-content>.checkbox-ripple{border-radius:0}}.sidebar-left-section-content.full-width{margin:0!important}.sidebar-left-section-content>.media-sticker-wrapper{flex:0 0 auto;height:86px;margin:1px auto 29px;position:relative;width:86px}.sidebar-left-section-name{padding:1rem}@media only screen and (max-width:600px){.sidebar-left-section-name{font-size:.875rem;padding:.5rem 1rem}}.sidebar-left-section-caption{color:var(--secondary-text-color);font-size:1rem;line-height:var(--line-height);margin-top:1rem;padding:0 1rem}@media only screen and (max-width:600px){.sidebar-left-section-caption{font-size:.875rem;margin:.5rem}}.sidebar-left-section .checkbox-field,.sidebar-left-section .radio-field{margin:0}.sidebar-left-section:first-child:not(.no-delimiter){padding-top:0}.sidebar-left-section .checkbox-field{align-items:center;display:flex;height:3.5rem;padding:0 1.125rem}.sidebar-left-section-disabled{opacity:.25;pointer-events:none!important}.sidebar-left-section .chatlist{padding:0}.sidebar-left-h2{color:var(--primary-color);font-size:16px;font-weight:var(--font-weight-bold)}.general-settings-container{-webkit-user-select:none;-moz-user-select:none;user-select:none}.general-settings-container .sidebar-left-section{padding-bottom:0}.general-settings-container .sidebar-left-section:last-child{padding-bottom:.5rem}#chats-archived-container,#contacts-container,#poll-results-container,#search-gifs-container,#search-private-container,#stickers-container,.add-members-container{background-color:var(--surface-color)!important}.chat-folders-container .btn-control{margin-bottom:1.5rem}.two-step-verification{background-color:var(--surface-color)!important}.two-step-verification .sidebar-left-section{box-shadow:none!important}.two-step-verification .sidebar-left-section:first-child{padding-top:0}.two-step-verification .sidebar-left-section-caption{margin-bottom:1.125rem;margin-left:auto;margin-right:auto;max-width:342px;text-align:center}.two-step-verification-main .btn-primary+.btn-primary{margin-top:.125rem!important}.two-step-verification .btn-primary:not(.btn-transparent){text-transform:uppercase}.two-step-verification .media-sticker-wrapper{height:168px;margin:.625rem auto 1.1875rem;width:168px}.two-step-verification .input-wrapper .btn-primary:first-child:last-child{margin-top:.25rem}.two-step-verification-enter-password .media-sticker-wrapper{height:157px;margin:1.125rem auto 1.8125rem;width:157px}.two-step-verification-hint .media-sticker-wrapper{height:160px;margin:.5rem auto 2.25rem;width:160px}.two-step-verification-email .media-sticker-wrapper{height:160px;margin:.5625rem auto 2.1875rem;width:160px}.two-step-verification-set .media-sticker-wrapper{height:160px;margin:1rem auto 1.3125rem;width:160px}[dir=ltr] .two-step-verification-set .media-sticker-wrapper .rlottie,[dir=ltr] .two-step-verification-set .media-sticker-wrapper .rlottie-vector{left:.625rem}[dir=rtl] .two-step-verification-set .media-sticker-wrapper .rlottie,[dir=rtl] .two-step-verification-set .media-sticker-wrapper .rlottie-vector{right:.625rem}.dont-u-dare-block-me .sidebar-left-section.no-delimiter{padding-top:.75rem}.dont-u-dare-block-me .sidebar-left-section{padding:0 0 .5rem}@media only screen and (min-width:601px){.privacy-tab .sidebar-left-section:first-child{padding-bottom:1.125rem}}.privacy-tab form{padding-bottom:.0625rem}.active-sessions-container .row-title:first-child{font-weight:var(--font-weight-bold)}.active-sessions-container .row-title-right{color:var(--secondary-text-color);font-size:var(--font-size-12);line-height:var(--line-height-12)}.active-sessions-container .row-midtitle,.active-sessions-container .row-subtitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.active-sessions-container .sidebar-left-section:first-child{padding-bottom:0}.active-sessions-container .sidebar-left-section:first-child .row-title{font-weight:var(--font-weight-bold)}@media only screen and (min-width:601px){.blocked-users-container ul{padding:0 .6875rem}}.notifications-container .sidebar-left-section{padding-bottom:0}.range-setting-selector{padding:1rem .875rem}.range-setting-selector-details{display:flex;justify-content:space-between;margin-bottom:1rem}.range-setting-selector-name{color:var(--primary-text-color)}.range-setting-selector-value{color:var(--secondary-text-color)}.range-setting-selector .progress-line{--height:2px;--color:var(--primary-color);--border-radius:4px;--thumb-size:12px;background-color:#e6ecf0}.range-setting-selector .progress-line__filled{background-color:var(--primary-color)}.background-container .background-item:after{border:3px solid var(--primary-color);bottom:0;content:" ";display:block;left:0;opacity:0;position:absolute;right:0;top:0;transition:opacity .2s ease-in-out}.background-container .background-item.active:after{opacity:1}.background-container .background-item.active .grid-item-media{transform:scale(.91)}.background-container .background-item-media{transform:scale(1);transition:transform .2s ease-in-out}.background-container .background .preloader-container{z-index:1}.background-item{cursor:pointer}.background-item-media{border-radius:inherit}.background-item-media.is-pattern{background-color:#000;bottom:0;left:0;position:absolute;right:0;top:0}.background-item-media.is-pattern .media-photo{mix-blend-mode:soft-light}.background-item .media-photo{border-radius:inherit;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.background-colors-canvas{border-radius:inherit;height:100%;-webkit-mask-position:center;-webkit-mask-size:cover;position:absolute;width:100%}.background-image-container .sidebar-left-section{padding-bottom:.5rem}.empty-placeholder{line-height:var(--line-height);margin:0 auto;padding:0 1rem;position:relative;text-align:center;top:40%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none;width:21rem!important}.empty-placeholder .media-sticker-wrapper{height:128px;margin:0 auto 1.9375rem;position:relative;width:128px}.empty-placeholder-header{font-size:1.25rem;font-weight:var(--font-weight-bold)}.empty-placeholder-subtitle{color:var(--secondary-text-color);font-size:.875rem;margin-top:.375rem}.empty-placeholder .btn-control{margin-top:1.75rem;padding:0 1.0625rem 0 .8125rem}[dir=ltr] .empty-placeholder .btn-control:before{margin-right:.625rem}[dir=rtl] .empty-placeholder .btn-control:before{margin-left:.625rem}.empty-placeholder-dialogs{opacity:0}body.animation-level-2 .empty-placeholder-dialogs{transition:opacity .2s ease-in-out}.empty-placeholder-dialogs-icon{margin-bottom:1.0625rem}.empty-placeholder-dialogs.visible{opacity:1}.is-forum-visible .can-have-forum .input-search,.is-forum-visible .can-have-forum .row-row,.is-forum-visible .can-have-forum .sidebar-header__title{opacity:0}.is-forum-visible .folders-tabs-scrollable{opacity:var(--disabled-opacity);pointer-events:none}.is-forum-visible.backwards .can-have-forum .input-search,.is-forum-visible.backwards .can-have-forum .row-row,.is-forum-visible.backwards .can-have-forum .sidebar-header__title,.is-forum-visible.backwards .folders-tabs-scrollable{opacity:1}.is-forum-visible.animating .can-have-forum .input-search,.is-forum-visible.animating .can-have-forum .row-row,.is-forum-visible.animating .can-have-forum .sidebar-header__title,.is-forum-visible.animating .folders-tabs-scrollable{transition:opacity var(--transition-standard-in)}.is-forum-visible.animating.backwards .can-have-forum .input-search,.is-forum-visible.animating.backwards .can-have-forum .row-row,.is-forum-visible.animating.backwards .can-have-forum .sidebar-header__title,.is-forum-visible.animating.backwards .folders-tabs-scrollable{transition:opacity var(--transition-standard-out)}#column-right{overflow:visible;overflow:initial;position:relative}@media only screen and (min-width:601px)and (max-width:1275px){#column-right{box-shadow:0 .25rem .5rem .1rem rgba(0,0,0,.2)}}@media only screen and (max-width:600px){body:not(.is-right-column-shown) #column-right{transform:translate3d(100vw,0,0)}}@media only screen and (min-width:601px)and (max-width:925px){body.is-right-column-shown:not(.is-left-column-shown) #column-right{transform:translateZ(0);transition:transform var(--transition-standard-in)}}@media only screen and (min-width:926px){body.is-right-column-shown #column-right{transform:translateZ(0);transition:transform var(--transition-standard-in)}}@media only screen and (min-width:601px){#column-right{position:absolute;right:0;transform:translate3d(var(--right-column-width),0,0);transition:transform var(--transition-standard-out);width:calc(var(--right-column-width));z-index:3}#column-right .sidebar-content{min-width:var(--right-column-width)}body.animation-level-0 #column-right{transition:none}}@media only screen and (min-width:1276px){#column-right{border-left:1px solid var(--border-color);transform:translate3d(calc(var(--right-column-width) + 1px),0,0);width:calc(var(--right-column-width) + 1px)}}#column-right .sidebar-header{flex:0 0 auto}#column-right .sidebar-header .sidebar-close-button.tgico:before{content:""}@media only screen and (min-width:601px){#column-right .sidebar-header .sidebar-close-button.tgico:before{content:""}}#column-right #search-private-container .chatlist-container{flex:1 1 auto;position:relative}#column-right .sidebar-search{display:none}#column-right .sidebar-search.active{display:flex}#column-right .input-wrapper{margin:.75rem 0;max-width:100%;padding:0 .75rem;width:100%}.shared-media-container .scrollable:not(.no-parallax){perspective:0;perspective-origin:0 0}.shared-media-container .scrollable:not(.no-parallax).parallax{perspective:1px}.shared-media-container .profile-content.is-me .profile-name{margin-bottom:.9375rem}.shared-media-container .profile-content.is-me .profile-subtitle{display:none}.shared-media-container .search-super{min-height:calc(var(--vh, 1vh)*100 - 56px);top:100%}.shared-media-container .search-super-tabs{--padding-horizontal:0}.shared-media-container .search-super-tabs .menu-horizontal-div-item{border-radius:0!important}.shared-media-container .sidebar-header .transition{flex-grow:1}.shared-media-container .sidebar-header .transition .transition-item{align-items:center;display:flex}.shared-media-container .btn-corner.menu-open:before{content:""}@media only screen and (max-width:600px){.shared-media-container .btn-corner{bottom:14px;height:54px;position:fixed!important;right:14px;width:54px;z-index:1}}.shared-media-container.can-add-members .btn-corner:not(.is-hidden){transform:translateZ(0)}.search-super{background-color:var(--surface-color);display:flex;flex-direction:column;max-width:100%;min-height:100%;position:absolute;width:100%}.search-super .search-group__show-more{color:var(--primary-color);cursor:pointer;font-weight:400}.search-super .search-super-month-name{border-top:1px solid var(--border-color);color:var(--secondary-text-color);font-weight:var(--font-weight-bold);padding:24px 0 0 24px}@media only screen and (max-width:600px){.search-super .search-super-month-name{padding:18px 0 0 16px}}.search-super.sliding{max-height:none!important}.search-super-tabs{flex:1 1 auto;width:auto}.search-super-tabs-scrollable{background-color:var(--surface-color);box-shadow:none!important;position:sticky!important;top:0;z-index:2}.search-super-tabs-scrollable:before{background-color:inherit;content:" ";display:block;height:1px;left:0;position:absolute;top:0;width:100%;z-index:-1}.search-super.is-full-viewport .search-super-tabs-scrollable:before{top:-1px}.search-super-tabs-scrollable .scrollable{display:flex;position:relative}.search-super-tabs-container{flex:1 1 auto;grid-template-rows:100%;min-height:calc(100% - 49px)}.search-super-tabs-container>div{background-color:var(--surface-color)!important;min-height:150px;position:relative}.search-super-tabs-container>div>div:first-child{min-height:calc(100vh - 111px);transform:translateY(0)}.search-super-tabs-container .preloader{padding:0;position:absolute!important;top:100px;transform:translate(-50%)}.search-super-tabs-container .preloader>svg{height:50px;width:50px}.search-super-month:first-of-type .search-super-month-name{display:none}.search-super .audio-title,.search-super .document-name,.search-super .title{display:flex;justify-content:space-between}.search-super .sent-time{color:var(--secondary-text-color);flex:0 0 auto;font-size:12px;margin-left:8px;margin-top:3px}.search-super-content-media .search-super-month-name{border:none;padding:9px 0 7px 24px}.search-super-content-media .video-time{background-color:var(--message-time-background);border-radius:4px;color:#fff;font-size:12px;height:18px;left:5px;line-height:18px;padding:0 6px 0 5px;position:absolute;top:4px;z-index:2}.search-super-content-media .grid-item{overflow:hidden}.search-super-content-media .checkbox-field{right:.25rem;top:.25rem}.search-super .checkbox-box{box-shadow:0 0 3px 0 rgba(0,0,0,.4)}.search-super .checkbox-box-border{border-color:var(--message-checkbox-border-color)}.search-super .checkbox-box-background{background-color:var(--message-checkbox-color)}.search-super .checkbox-field{margin:0;position:absolute!important;z-index:2}.search-super-content-media .search-super-month-items{grid-gap:1px;display:grid;grid-auto-rows:1fr;grid-template-columns:repeat(3,1fr);padding-top:1px;width:100%}.search-super-content-files .search-super-month-items{padding:8px 24px 16px 20px}@media only screen and (max-width:600px){.search-super-content-files .search-super-month-items{padding:8px 16px 8px 12px}}.search-super-content-files .document{--icon-size:3rem;--icon-margin:.75rem;height:calc(48px + 1.5rem)}.search-super-content-files .document-download,.search-super-content-files .document-ico{border-radius:5px!important}.search-super-content-files .document-name{font-weight:400;max-width:100%;overflow:hidden;text-overflow:ellipsis;width:100%}.search-super-content-links .search-super-item{cursor:pointer;display:flex;flex-direction:column;justify-content:flex-start;min-height:4.375rem;overflow:hidden;padding-left:4.4375rem;position:relative}.search-super-content-links .row-media{border-radius:.375rem;height:3rem;left:.6875rem;overflow:hidden;position:absolute;width:3rem}.search-super-content-links .row-media.empty{align-items:center;background-color:var(--primary-color);color:#fff;display:flex;font-size:2rem;justify-content:center;text-transform:uppercase}.search-super-content-links a:not(:last-child){position:relative;z-index:2}.search-super-content-links .anchor-url:last-child{position:static}.search-super-content-links .anchor-url:last-child:before{bottom:0;content:" ";cursor:pointer;left:0;position:absolute;right:0;top:0;z-index:1}.search-super-content-links .media-photo{border-radius:inherit;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.search-super-content-links .row-title{margin-top:.1875rem}.search-super-content-links .row-subtitle{overflow:hidden;text-overflow:ellipsis;white-space:pre-wrap;word-break:break-word}.search-super-content-links .sent-time{margin:1px 0 0}.search-super-content-links .sender-title{display:block;margin-top:.25rem}.search-super-content-links .checkbox-field{--offset-left:0!important;margin:2rem 0 0 -1.75rem!important;padding:0!important}@media only screen and (min-width:601px){.search-super-content-links .search-super-month-items{margin:.5625rem}}@media only screen and (max-width:600px){.search-super-content-links .search-super-month-name{padding:.875rem 1rem}}.search-super-content-music .search-super-month-items,.search-super-content-voice .search-super-month-items{padding:20px 15px 0 20px}@media only screen and (max-width:600px){.search-super-content-music .search-super-month-items,.search-super-content-voice .search-super-month-items{padding:20px 15px 0 12px}}.search-super-content-music .audio,.search-super-content-voice .audio{justify-content:normal;margin-bottom:1.5rem}@media only screen and (min-width:601px){.search-super-content-music .audio,.search-super-content-voice .audio{max-width:377px}}.search-super-content-music .audio.audio-show-progress .audio-subtitle,.search-super-content-voice .audio.audio-show-progress .audio-subtitle{overflow:visible}.search-super-content-groups .chatlist,.search-super-content-members .chatlist{padding-bottom:.5rem;padding-top:.5rem}.search-super-tabs-scrollable .search-super-nav-scrollable{opacity:1}body.animation-level-2 .search-super-tabs-scrollable .search-super-nav-scrollable,body.animation-level-2 .search-super-tabs-scrollable .search-super-selection-container{transition:opacity .2s ease-in-out}.search-super-tabs-scrollable.is-selecting:not(.backwards) .search-super-nav-scrollable{opacity:0}.search-super-tabs-scrollable.is-selecting:not(.backwards) .search-super-selection-container{opacity:1}.search-super.is-selecting a{pointer-events:none}.search-super.is-selecting .row:not(.menu-open){background-color:transparent!important}.search-super-selection-container{align-items:center;bottom:0;display:flex;justify-content:space-between;left:0;opacity:0;padding:0 1rem;position:absolute;right:0;top:0}.search-super-selection-container .btn-icon+.btn-icon{margin-left:.5rem}@media only screen and (max-width:600px){.search-super-selection-container{padding:0 .5rem}}.search-super-selection-count{color:var(--primary-text-color);flex-grow:1;font-weight:var(--font-weight-bold);margin-left:1.5rem;text-transform:capitalize;white-space:nowrap}#search-container .search-group.is-short .chatlist-chat:nth-child(n+4),#search-container .search-super-content-music .audio:not(.audio-show-progress) .audio-description:before,#search-container .search-super-content-music .audio:not(.audio-show-progress) .audio-time{display:none}#stickers-container .sticker-sets{display:flex;flex-direction:column;margin-top:16px}#stickers-container .sticker-set{cursor:pointer;display:flex;flex-direction:column;height:140px}#stickers-container .sticker-set-name{font-weight:var(--font-weight-bold)}#stickers-container .sticker-set-count{color:var(--secondary-text-color);font-size:14px}#stickers-container .sticker-set-header{display:flex;justify-content:space-between;padding-bottom:12px;padding-left:16px}#stickers-container .sticker-set-button{border-radius:16px;font-size:15px;font-weight:400;height:30px;margin-right:16px;padding-left:12px;padding-right:13px;transition:width .2s;width:auto}#stickers-container .sticker-set-button.gray{background:#f1f3f4;color:var(--secondary-text-color)}#stickers-container .sticker-set-stickers{display:flex;justify-content:space-around}#stickers-container .sticker-set-sticker{height:68px;position:relative;width:68px}#stickers-container .sticker-set-sticker:hover{background-color:var(--light-secondary-text-color);border-radius:12px}#stickers-container .sticker-set-sticker img{max-height:100%;max-width:100%}#poll-results-container .poll-results{display:flex;flex-direction:column;position:relative;width:100%}#poll-results-container .poll-results-answer{color:var(--secondary-text-color);display:flex;font-size:15px;font-weight:var(--font-weight-bold);justify-content:space-between;margin:0;padding:0 16px 8px;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media only screen and (min-width:601px){#poll-results-container .poll-results-answer{padding:0 24px 8px}}#poll-results-container .poll-results-more{margin:0 .5rem;width:auto}@media only screen and (max-width:600px){#poll-results-container .poll-results-more{border-radius:0;margin:0}}#poll-results-container .poll-results h3{font-size:20px;margin-bottom:16px;margin-top:15px;padding:0 16px}@media only screen and (min-width:601px){#poll-results-container .poll-results h3{padding:0 24px}}#poll-results-container .poll-results hr{display:block!important;margin-bottom:15px;margin-top:7px}.edit-peer-container .input-wrapper{margin-bottom:.5625rem!important}.edit-peer-container .sidebar-left-section{padding:0 0 .5rem}.edit-peer-container .chatlist-new{padding:0}.edit-contact-container .input-wrapper{margin-top:1.8125rem!important}.edit-contact-container .avatar-placeholder{filter:none!important}.edit-contact-container .avatar-edit{margin-bottom:1.375rem!important}.edit-contact-container .profile-name{font-size:1.5rem;line-height:var(--line-height)}.group-type-container .sidebar-left-section-caption{font-size:.875rem;margin-top:.8125rem}.group-type-container .input-wrapper{margin-top:.875rem!important}.media-viewer{align-items:center;background:rgba(0,0,0,.88);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0}@media only screen and (max-width:600px){.media-viewer{background:#000}}.media-viewer-author{align-items:center;cursor:pointer;display:flex;height:100%}@media only screen and (max-width:600px){.media-viewer-author{margin-left:1.5rem}}.media-viewer-userpic{margin-right:1rem}@media only screen and (max-width:600px){.media-viewer-userpic{display:none}}.media-viewer-name{font-weight:var(--font-weight-bold);line-height:var(--line-height);margin:.0625rem 0}@media only screen and (min-width:601px){.media-viewer-name{margin:.0625rem 0 .125rem}}.media-viewer-date{font-size:.875rem;line-height:var(--line-height)}.media-viewer-buttons{display:flex;flex-flow:row nowrap;padding:.5rem .75rem;position:absolute;right:0;top:0}.media-viewer-buttons .btn-icon{margin:0 .25rem;transition:var(--open-duration)}html.no-touch .media-viewer-buttons .btn-icon:active,html.no-touch .media-viewer-buttons .btn-icon:hover{color:#fff}@media only screen and (max-width:600px){.media-viewer-buttons{display:none}}.media-viewer-content{flex-direction:column;height:100%;justify-content:center}.media-viewer-container,.media-viewer-content{align-items:center;display:flex;max-height:100%;max-width:100%;overflow:hidden}.media-viewer-container{align-self:center;flex:1 1 auto;position:relative}.media-viewer-media{visibility:hidden}.media-viewer-caption{background-color:transparent;bottom:0;color:#fff;left:0;line-height:var(--line-height);opacity:0;overflow:hidden;padding:.5rem .5rem 0;position:absolute;right:0;text-align:center;text-overflow:ellipsis;white-space:pre-wrap;word-break:break-word;z-index:4}body.animation-level-2 .media-viewer-caption{transition:transform var(--layer-transition),opacity var(--open-duration) ease-in-out,background-color var(--open-duration) ease-in-out}.media-viewer-caption a{color:#60a5e9!important}.media-viewer-caption .scrollable{height:6rem;margin:0 auto;max-height:6rem;max-width:50rem;padding:.5rem .875rem;position:relative}html.no-touch .media-viewer-whole.active .media-viewer-caption{opacity:.4}html.no-touch .media-viewer-whole.active .media-viewer-caption:hover{opacity:1}html.is-touch .media-viewer-whole.active .media-viewer-caption{opacity:.6}@media only screen and (max-width:600px){.media-viewer-caption{bottom:1.0625rem;text-align:inherit;transform:translateZ(0);width:100%}.media-viewer-caption .scrollable{height:auto;padding:0 .5rem}.media-viewer-whole.has-video-controls .media-viewer-caption{transform:translate3d(0,-69px,0)}.media-viewer-whole.backwards .media-viewer-caption{visibility:hidden}html.no-touch .media-viewer-caption:active,html.no-touch .media-viewer-caption:hover{background-color:#000;opacity:1!important}}.media-viewer-caption.is-focused{background-color:#000;opacity:1!important}.media-viewer-switcher{cursor:pointer;height:calc(100% - 7.5rem);left:0;position:absolute;top:3.75rem;width:7rem}html.no-touch .media-viewer-switcher{height:calc(100% - 3.75rem)}html.no-touch .media-viewer-switcher:hover .tgico-down{opacity:1}@media only screen and (max-width:600px){.media-viewer-switcher{width:4rem}}.media-viewer-switcher-right{left:auto;right:0}.media-viewer-next-button,.media-viewer-prev-button{color:#fff;cursor:pointer;font-size:2rem;left:1rem;opacity:0;position:absolute;top:50%;transform:translateY(-50%) rotate(90deg);transition:var(--open-duration) opacity;z-index:5}@media only screen and (min-width:601px){.media-viewer-next-button,.media-viewer-prev-button{font-size:3rem;left:2rem}}.media-viewer-next-button{left:auto;right:1rem;transform:translateY(-50%) rotate(-90deg)}@media only screen and (min-width:601px){.media-viewer-next-button{right:2rem}}.media-viewer-mover{align-items:center;border-radius:0;display:flex;justify-content:center;left:0;min-height:auto!important;overflow:hidden;position:fixed!important;top:0;transform:translateZ(0) scaleX(1);transform-origin:top left}.media-viewer-mover:not(.center){-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}@media only screen and (max-width:600px){.media-viewer-mover{overflow:visible}}.media-viewer-mover .ckin__player{height:100%;left:0;position:absolute;top:0;width:100%}.media-viewer-mover>svg{height:100%;width:100%}.media-viewer-mover .canvas-thumbnail,.media-viewer-mover img,.media-viewer-mover video{height:100%;max-height:100%;max-width:100%;-o-object-fit:cover;object-fit:cover;opacity:1;position:absolute;transition:var(--open-duration) opacity;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.media-viewer-mover svg img,.media-viewer-mover svg video{position:static}.media-viewer-mover.active{transition:transform var(--open-duration),border-radius var(--open-duration),opacity var(--open-duration) calc(var(--open-duration)/8)}.media-viewer-mover.active.opening{transition:transform var(--open-duration),border-radius var(--open-duration),opacity var(--open-duration) 0s}.media-viewer-mover.moving{transition:transform var(--move-duration) ease}.media-viewer-mover.no-transition{transition:none!important}.media-viewer-mover.center{left:50%!important;max-height:calc(var(--vh, 1vh)*100 - 15rem);max-width:100vw;top:50%!important;transform:translate3d(-50%,-50%,0)!important}@media only screen and (max-width:600px){.media-viewer-mover.center{height:100%!important;max-height:calc(var(--vh, 1vh)*100 - 120px);max-width:100vw!important;width:100%!important}.media-viewer-mover.center .ckin__player:not(.ckin__fullscreen) .default__controls{bottom:-62px}}.media-viewer-mover.center .canvas-thumbnail,.media-viewer-mover.center img:not(.thumbnail),.media-viewer-mover.center video{-o-object-fit:contain;object-fit:contain}.media-viewer-mover.center img.thumbnail{-o-object-fit:contain;object-fit:contain;width:auto}.media-viewer-mover.hiding .canvas-thumbnail,.media-viewer-mover.hiding img,.media-viewer-mover.hiding video{opacity:0}.media-viewer-appear{opacity:0;visibility:hidden}body.animation-level-2 .media-viewer-appear{transition:opacity var(--open-duration) 0s,visibility 0s var(--open-duration)}.media-viewer-topbar{align-items:center;display:flex;height:3.5rem;justify-content:space-between;left:0;padding:0 1.25rem;position:absolute;right:0;top:0;z-index:5}.media-viewer-topbar .btn-icon,.media-viewer-topbar .media-viewer-author{color:#fff;opacity:.4}body.animation-level-2 .media-viewer-topbar .btn-icon,body.animation-level-2 .media-viewer-topbar .media-viewer-author{transition:opacity var(--open-duration) ease-in-out,color var(--open-duration) ease-in-out,background-color var(--open-duration) ease-in-out}html.no-touch .media-viewer-topbar .btn-icon:active,html.no-touch .media-viewer-topbar .btn-icon:hover,html.no-touch .media-viewer-topbar .media-viewer-author:active,html.no-touch .media-viewer-topbar .media-viewer-author:hover{opacity:1}.media-viewer-topbar-left{align-items:center;display:flex}@media only screen and (max-width:600px){.media-viewer-topbar{padding:0 .5rem}}.media-viewer-aspecter{align-items:center;border-radius:0;display:flex;height:100%;justify-content:center;position:absolute;transform:scaleX(1);width:100%}.media-viewer-mover.active .media-viewer-aspecter{transition:width var(--open-duration),height var(--open-duration),transform var(--open-duration),border-radius var(--open-duration)}.media-viewer-whole{--open-duration:.2s;--move-duration:.35s;display:block;height:100%;left:0;position:fixed!important;top:0;transition:visibility 0s var(--open-duration);visibility:hidden;width:100%;z-index:4}body.animation-level-0 .media-viewer-whole{--open-duration:0s;--move-duration:0s}.media-viewer-whole.active{transition-delay:0s;visibility:visible}.media-viewer-whole.active .media-viewer-appear,.media-viewer-whole.active .overlays{opacity:1;visibility:visible}body.animation-level-2 .media-viewer-whole.active .media-viewer-appear,body.animation-level-2 .media-viewer-whole.active .overlays{transition:opacity var(--open-duration) 0s,visibility 0s 0s}.media-viewer-whole.active .media-viewer-caption{visibility:visible}@media only screen and (max-width:600px){.media-viewer-whole .btn-menu-toggle:not(.playback-rate){color:hsla(0,0%,100%,.4);opacity:1}.media-viewer-whole .btn-menu-toggle:not(.playback-rate).menu-open{background-color:hsla(207,4%,46%,.2)!important;color:#fff}.media-viewer-whole.hide-caption .media-viewer-caption{opacity:0!important;pointer-events:none}}.media-viewer-whole.is-zooming .media-viewer-caption,.media-viewer-whole.is-zooming .media-viewer-switcher .tgico-down{opacity:0!important;pointer-events:none}.media-viewer-whole.highlight-switchers .media-viewer-switcher>span{opacity:1}.media-viewer-whole.no-forwards .canvas-thumbnail,.media-viewer-whole.no-forwards img{pointer-events:none}.media-viewer-whole.no-forwards .media-viewer-caption{-webkit-user-select:none;-moz-user-select:none;user-select:none}.media-viewer-movers{bottom:0;left:0;position:absolute;right:0;top:0;transform:translate3d(1,1,0) scale(1);transform-origin:0 0;will-change:transform;z-index:4}body.animation-level-2 .media-viewer-movers{transition:transform var(--open-duration)}.tgico-zoom:before{content:""}.tgico-zoom.zoom-in:before{content:""}.zoom-container{align-items:center;background-color:rgba(0,0,0,.4);border-radius:12px;bottom:1.25rem;display:flex;height:3.375rem;justify-content:space-between;left:50%;opacity:1;padding:.5rem;position:absolute;transform:translateX(-50%);width:17.125rem;z-index:5}body.animation-level-2 .zoom-container{transition:opacity var(--open-duration)}.zoom-container .btn-icon{color:#fff}.zoom-container .btn-icon.inactive{opacity:.4;pointer-events:none}.zoom-container .progress-line{--color:#fff;--height:2px;flex:1 1 auto;margin:0 1px}.zoom-container .progress-line:before{opacity:1}.media-viewer-whole:not(.active) .zoom-container,.zoom-container:not(.is-visible){opacity:0;pointer-events:none}.zoom-container.is-visible{opacity:1}.zoom-container.is-visible~.media-viewer-caption{opacity:0!important;pointer-events:none}.zoom-container.is-visible~.media-viewer-movers .default__button--big{opacity:0!important}.overlays{background-color:rgba(0,0,0,.2);height:100%;left:0;opacity:0;position:fixed!important;top:0;transition:opacity var(--open-duration) 0s,visibility 0s var(--open-duration);visibility:hidden;width:100%;z-index:4}.emoji-dropdown{background:var(--surface-color);display:flex;flex:1 1 auto;flex-direction:column;height:min(282px,calc(var(--vh)*100 - 135px));max-height:100%;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--esg-width)}@media only screen and (min-height:570px)and (min-width:601px){.emoji-dropdown{-webkit-backdrop-filter:var(--menu-backdrop-filter);backdrop-filter:var(--menu-backdrop-filter);background-color:var(--menu-background-color);border-radius:1.25rem;bottom:5.125rem;box-shadow:0 5px 10px 5px rgba(16,35,47,.14);height:26.25rem;left:.8125rem;max-height:26.25rem;opacity:0;position:absolute!important;transform:scale(0);transform-origin:0 100%;transition:transform var(--esg-transition),opacity var(--esg-transition);z-index:3}.emoji-dropdown.active{opacity:1;transform:scale(1)}body.animation-level-0 .emoji-dropdown{transition:none}}.emoji-dropdown .emoji-container{height:100%;max-width:100%;overflow:hidden;width:100%}.emoji-dropdown .emoji-tabs{border:none;border-top:1px solid var(--border-color);justify-content:center}.emoji-dropdown .emoji-tabs:after{content:none}.emoji-dropdown .emoji-tabs-search{left:0;margin-left:.5rem!important;position:absolute}.emoji-dropdown .emoji-tabs-delete{margin-right:.5rem!important;position:absolute;right:0}.emoji-dropdown .emoji-tabs .menu-horizontal-div-item{margin:0 .75rem}.emoji-dropdown .tabs-container{height:100%}.emoji-dropdown .stickers-padding .category-items{gap:.25rem;padding:0 .1875rem}.emoji-dropdown #content-gifs .scrollable-y{padding:0 .1875rem}.emoji-dropdown .gifs-masonry{border-radius:10px;overflow:hidden}.emoticons-container{background-color:transparent;flex-direction:column;height:100%;min-height:100%}.emoticons-menu{--item-size:1.875rem;align-items:center;min-height:3.0625rem;padding:0 .3125rem;width:100%;z-index:4}.emoticons-menu,.emoticons-menu-wrapper{background-color:transparent;height:3.0625rem}.emoticons-menu-wrapper{border-bottom:1px solid var(--border-color);max-width:100%;padding:0;position:relative}.emoticons-menu:after{content:" ";display:block;flex:0 0 auto;height:1px;width:.1875rem}.emoticons-menu .menu-horizontal-div-item{align-items:center;display:flex;flex:0 0 auto;font-size:1.5rem;height:var(--item-size);line-height:var(--item-size);margin:0 .3125rem;padding:0;width:var(--item-size)}.emoticons-menu .menu-horizontal-div-item.not-local{--item-size:2.375rem;border-radius:.25rem!important;padding:.25rem}.emoticons-menu .menu-horizontal-div-item.active{background-color:rgba(var(--primary-text-color-rgb),.06)!important}.emoticons-menu .menu-horizontal-div-item.active,html.no-touch .emoticons-menu .menu-horizontal-div-item:active,html.no-touch .emoticons-menu .menu-horizontal-div-item:hover{color:rgba(var(--primary-text-color-rgb),.8)!important}.emoticons-menu .menu-horizontal-div-item-padding{height:100%;position:relative;width:100%}.emoticons-menu .menu-horizontal-div-item.active:not(.tgico){background-color:var(--light-secondary-text-color)}.emoticons-menu .menu-horizontal-inner{border-radius:15px;flex:0 0 auto;margin:0 .3125rem;overflow:hidden;width:1.875rem}html.is-safari .emoticons-menu .menu-horizontal-inner{-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}body.animation-level-2 .emoticons-menu .menu-horizontal-inner{transition:width .2s ease-in-out}.emoticons-menu .menu-horizontal-inner-scroll{align-items:center;display:flex;height:100%;position:relative;width:8.5rem}.emoticons-menu .menu-horizontal-inner .menu-horizontal-div-item{margin:0!important;transform:scale(1)}body.animation-level-2 .emoticons-menu .menu-horizontal-inner .menu-horizontal-div-item{transition:transform .2s ease-in-out!important}.emoticons-menu .menu-horizontal-inner.active{background-color:rgba(var(--primary-text-color-rgb),.06)!important;width:8.5rem}.emoticons-menu .menu-horizontal-inner.active .menu-horizontal-div-item{transform:scale(.8)}.emoticons-menu .menu-horizontal-inner.active .menu-horizontal-div-item.active{background-color:transparent!important}.emoticons-menu .menu-horizontal-inner:not(.active){cursor:pointer}.emoticons-menu .menu-horizontal-inner:not(.active) .menu-horizontal-inner-scroll{pointer-events:none}.emoticons-menu .menu-horizontal-inner:not(.active) .menu-horizontal-div-item:first-child{pointer-events:all}.emoticons-content{flex:1;padding:0;position:relative}.emoticons-content .emoji-category{position:relative}.emoticons-content .sticky_sentinel--top{height:1px;top:0}.emoticons-content .category-title{color:rgba(var(--primary-text-color-rgb),.42);cursor:pointer;font-size:var(--font-size-16);font-weight:var(--font-weight-bold);line-height:1.1875rem;padding:.75rem .875rem .375rem;position:relative;text-align:center;width:100%}.emoticons-content .category-title .btn-icon{font-size:1.25rem;pointer-events:all;position:absolute;right:.5rem;top:50%;transform:translateY(-50%);z-index:1}.emoticons-content:not(.has-premium) .is-premium-set .category-title:before{content:"";line-height:inherit;margin-right:.125rem;vertical-align:middle}.emoji-padding .super-emojis{padding:0 .5rem}html:not(.is-safari):not(.is-ios) .scrollable::-webkit-scrollbar{height:0;opacity:0;width:0;width:.375rem}html:not(.is-safari):not(.is-ios) .scrollable::-webkit-scrollbar-thumb{height:0;width:0}html:not(.is-safari):not(.is-ios) ::-webkit-scrollbar-thumb{opacity:0;-webkit-transition:.2s ease-in-out;transition:.2s ease-in-out}html:not(.is-safari):not(.is-ios) ::-webkit-scrollbar-button{display:none;height:0;width:0}html:not(.is-safari):not(.is-ios) ::-webkit-scrollbar-corner{background-color:transparent}html:not(.is-safari):not(.is-ios) .scrollable:hover{scrollbar-color:var(--scrollbar-color) transparent}html:not(.is-safari):not(.is-ios) .scrollable:hover::-webkit-scrollbar{opacity:1}html:not(.is-safari):not(.is-ios) .scrollable:hover::-webkit-scrollbar-thumb{-webkit-backdrop-filter:blur(100);backdrop-filter:blur(100);background-color:var(--scrollbar-color);border-radius:10px;max-height:12.5rem;min-height:5rem;opacity:1}.no-scrollbar::-webkit-scrollbar,.scrollable-x::-webkit-scrollbar{display:none}.scrollable{-webkit-overflow-scrolling:touch;bottom:0;height:100%;left:0;max-height:100%;overflow-x:hidden;overflow-y:hidden;position:absolute;right:0;top:0;width:100%}.scrollable.scrollable-x{-ms-overflow-style:none;overflow-x:auto;scrollbar-width:none}.scrollable.scrollable-y{-ms-overflow-style:none;overflow-y:auto;overflow-y:overlay;scrollbar-color:transparent transparent;scrollbar-width:thin;transform:translateZ(0)}.scrollable.scrollable-y.scrollable-y-bordered{border-bottom:1px solid transparent;border-top:1px solid transparent}body.animation-level-2 .scrollable.scrollable-y.scrollable-y-bordered{transition:border-top-color var(--transition-standard-in),border-bottom-color var(--transition-standard-in)}.scrollable.scrollable-y.scrollable-y-bordered:not(.scrolled-top){border-top-color:var(--border-color)}.scrollable.scrollable-y.scrollable-y-bordered:not(.scrolled-bottom){border-bottom-color:var(--border-color)}.scrollable-padding{height:100%;min-width:100%}@keyframes scaleIn{0%{transform:scale(.2)}to{transform:scale(1)}}.selector{display:flex;flex-direction:column;height:100%;width:100%}.selector .selector-search-section{margin-bottom:0!important;padding:0!important;position:relative;z-index:1}.selector-search-container{flex:0 0 auto;max-height:132px;overflow:hidden;position:relative}.selector-search-container .scrollable{max-height:inherit;position:relative}.selector-search{display:flex;flex-flow:wrap;padding-left:1rem;padding-right:1rem;position:relative}.selector-search-input{border:none;flex:1 1 auto;outline:none}.selector-search .selector-search-input{padding:7px 0 19px}[dir=ltr] .selector-user{padding-right:17px}[dir=rtl] .selector-user{padding-left:17px}[dir=ltr] .selector-user{margin-left:-.25rem;margin-right:.75rem}[dir=rtl] .selector-user{margin-left:.75rem;margin-right:-.25rem}.selector-user{background-color:var(--light-secondary-text-color);border-radius:1.5rem;color:var(--primary-text-color);flex:0 0 auto;font-size:1rem;height:2rem;line-height:2rem;margin-bottom:7px;max-width:11.25rem;overflow:hidden;text-overflow:ellipsis;transition:opacity .2s,transform .2s,background-color .2s;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}body.animation-level-0 .selector-user{transition:none}html.no-touch .selector-user:active,html.no-touch .selector-user:hover{background-color:var(--light-danger-color);cursor:pointer}html.no-touch .selector-user:active .selector-user-avatar:after,html.no-touch .selector-user:hover .selector-user-avatar:after{opacity:1;transform:scaleX(-1) rotate(-90deg)}body:not(.animation-level-0) .selector-user.scale-in{animation:scaleIn .15s ease forwards}body:not(.animation-level-0) .selector-user.scale-out{animation:scaleIn .1s ease forwards;animation-direction:reverse}[dir=ltr] .selector-user-avatar{margin-right:8px}[dir=rtl] .selector-user-avatar{margin-left:8px}.selector-user-avatar{border-radius:50%!important;float:left;overflow:hidden;position:relative}.is-rtl .selector-user-avatar{float:right}html.is-safari .selector-user-avatar{-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}[dir=ltr] .selector-user-avatar:after{left:0}[dir=rtl] .selector-user-avatar:after{right:0}.selector-user-avatar:after{background-color:var(--danger-color);content:"";font-size:23px;height:100%;line-height:32px!important;opacity:0;position:absolute;top:0;transform:scaleX(-1) rotate(0deg);transition:opacity .2s,transform .2s;width:100%;z-index:2}body.animation-level-0 .selector-user-avatar:after{transition:none}.selector .chatlist-container{flex:1 1 auto;height:100%}.selector>hr{margin:0;padding:0}[dir=ltr] .selector .checkbox{padding-left:11px}[dir=rtl] .selector .checkbox{padding-right:11px}.selector .checkbox{margin-top:11px}.selector .checkbox-field{--offset-left:0!important;margin:0!important;padding:0!important;pointer-events:none;position:absolute!important;top:50%;transform:translateY(-50%);z-index:1}[dir=ltr] .selector .checkbox-field:first-child{margin-left:.6875rem;margin-right:1.6875rem}[dir=rtl] .selector .checkbox-field:first-child{margin-left:1.6875rem;margin-right:.6875rem}[dir=ltr] .selector .checkbox-field-round{right:1.125rem}[dir=rtl] .selector .checkbox-field-round{left:1.125rem}.selector .checkbox-field-round{--size:1.25rem}.selector .checkbox-field-round .checkbox-box-border{z-index:auto}.selector .checkbox-field-round .checkbox-box-check{--offset:6px}[dir=ltr] .selector-square .checkbox-field{left:1.25rem!important}[dir=rtl] .selector-square .checkbox-field{right:1.25rem!important}[dir=ltr] .selector-square .chatlist-chat.row-with-padding{padding-left:7.5rem!important}[dir=rtl] .selector-square .chatlist-chat.row-with-padding{padding-right:7.5rem!important}[dir=ltr] .selector-square .dialog-avatar{margin-left:3rem!important}[dir=rtl] .selector-square .dialog-avatar{margin-right:3rem!important}.gifs-masonry{grid-gap:.125rem;display:grid;gap:.125rem;grid-auto-rows:1fr;grid-template-columns:repeat(3,1fr)}.gifs-masonry .gif img,.gifs-masonry .gif video{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.gifs-masonry .gif img{left:0;position:absolute;top:0}.gifs-masonry .preloader-container{z-index:2}.preloader-circular{animation:rotate 1s linear infinite;bottom:0;height:100%;left:0;margin:auto;position:absolute;right:0;top:0;transform-origin:center center}.preloader-path{stroke-dasharray:93.6375,124.85;stroke-dashoffset:0;stroke-linecap:round;stroke:#fff;stroke-width:3}.preloader-container{bottom:0;cursor:pointer;display:flex;height:54px;left:0;margin:auto;opacity:0;overflow:hidden;position:absolute;right:0;top:0;transform:scale(0);width:54px}body:not(.animation-level-0) .preloader-container{transition:opacity .2s ease-in-out,transform .2s ease-in-out}.preloader-container.is-visible:not(.backwards){opacity:1;transform:scale(1)}.preloader-container{--color:#fff}.preloader-container .you-spin-me-round{height:100%;width:100%}.preloader-container .preloader-circular{animation:none;background-color:rgba(0,0,0,.3);border-radius:50%;height:100%;width:100%}.preloader-container .preloader-path-new{stroke-dasharray:5,149.82;stroke-dashoffset:0;stroke-linecap:round;stroke:var(--color);stroke-width:2}body.animation-level-2 .preloader-container.is-visible.animating .you-spin-me-round,body.animation-level-2 .preloader-container.is-visible:not(.manual) .you-spin-me-round{animation:rotate 2s linear infinite}body.animation-level-2 .preloader-container.is-visible.animating .preloader-path-new,body.animation-level-2 .preloader-container.is-visible:not(.manual) .preloader-path-new{transition:stroke-dasharray .2s ease-in-out,stroke-width .2s ease-in-out}.preloader-container.preloader-swing{cursor:default}.preloader-container.preloader-swing .you-spin-me-round{animation:rotate 1s linear infinite!important}.preloader-container.preloader-swing .preloader-path-new{stroke-dasharray:112.36,149.82}.preloader-container.preloader-swing.preloader-streamable .preloader-path-new{stroke-dasharray:88.95,118.61}.preloader-container .preloader-close,.preloader-container .preloader-download{bottom:0;color:var(--color);height:56%;left:0;margin:auto;opacity:1;position:absolute;right:0;top:0;width:56%}body.animation-level-2 .preloader-container .preloader-close,body.animation-level-2 .preloader-container .preloader-download{transition:opacity .2s ease-in-out}.preloader-container .preloader-close path,.preloader-container .preloader-download path{fill:var(--color)}html.no-touch .preloader-container .preloader-close:active,html.no-touch .preloader-container .preloader-close:hover,html.no-touch .preloader-container .preloader-download:active,html.no-touch .preloader-container .preloader-download:hover{background:none}.preloader-container.manual .preloader-close,.preloader-container:not(.manual) .preloader-download{opacity:0}.preloader-container.manual .preloader-path-new{stroke-width:0}.preloader-container .preloader-download{height:1.5rem;width:1.5rem}.preloader-container.preloader-streamable,.preloader-container.preloader-streamable svg{cursor:pointer!important}.preloader-container.preloader-streamable circle{stroke-width:2.5!important}.preloader-container.preloader-streamable:after{background-color:var(--color);border-radius:.125rem;content:"";height:.8125rem;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:.8125rem}.preloader-container.preloader-transparent .preloader-circular{background-color:transparent}.preloader-container.preloader-bold .preloader-path-new{stroke-width:3.5}@keyframes rotate{to{transform:rotate(1turn)}}@keyframes dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes dashNew{0%{stroke-dasharray:1,149.82;stroke-dashoffset:0}50%{stroke-dasharray:112.36,149.82;stroke-dashoffset:-38}to{stroke-dasharray:112.36,149.82;stroke-dashoffset:-149.82}}@keyframes dashNewStreamable{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-237%}}.rp{position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.btn-corner.rp .c-ripple,.btn-menu-toggle.rp .c-ripple,.menu-horizontal-div-item.rp .c-ripple,.pinned-container-wrapper.rp .c-ripple,.rp-overflow .c-ripple{border-radius:inherit;height:100%;overflow:hidden;width:100%}.btn-corner.rp .c-ripple__circle,.btn-menu-toggle.rp .c-ripple__circle,.menu-horizontal-div-item.rp .c-ripple__circle,.pinned-container-wrapper.rp .c-ripple__circle,.rp-overflow .c-ripple__circle{overflow:hidden}.c-ripple{--ripple-duration:.7s;bottom:0;left:0;position:absolute;right:0;top:0}html.is-safari .c-ripple:not(:empty){border-radius:inherit;-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}.c-ripple__circle{animation:ripple-effect .7s forwards;background-color:var(--ripple-color);border-radius:50%;display:block;pointer-events:none;position:absolute;transform:scale(0);transition:opacity .35s,background-color .35s}.c-ripple__circle.hiding,.c-ripple__square.hiding{opacity:0}@media only screen and (max-width:925px){.c-ripple{--ripple-duration:.4s}.c-ripple__circle{animation-duration:.4s;animation-name:ripple-effect-handhelds;transition-duration:.3s}}@keyframes ripple-effect{0%{transform:scale(0)}to{transform:scale(2)}}@keyframes ripple-effect-handhelds{0%{transform:scale(.27)}to{transform:scale(2)}}.avatar-like{--size:54px;--multiplier:1;color:#fff;font-size:calc(1.25rem/var(--multiplier));font-weight:var(--font-weight-bold);height:var(--size);line-height:var(--size)!important;text-align:center;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--size)}avatar-element{--color-top:var(--avatar-color-top);--color-bottom:var(--avatar-color-bottom);background:linear-gradient(var(--color-top),var(--color-bottom));border-radius:50%}avatar-element[data-color=red]{--color-top:var(--peer-avatar-red-top);--color-bottom:var(--peer-avatar-red-bottom)}avatar-element[data-color=orange]{--color-top:var(--peer-avatar-orange-top);--color-bottom:var(--peer-avatar-orange-bottom)}avatar-element[data-color=violet]{--color-top:var(--peer-avatar-violet-top);--color-bottom:var(--peer-avatar-violet-bottom)}avatar-element[data-color=green]{--color-top:var(--peer-avatar-green-top);--color-bottom:var(--peer-avatar-green-bottom)}avatar-element[data-color=cyan]{--color-top:var(--peer-avatar-cyan-top);--color-bottom:var(--peer-avatar-cyan-bottom)}avatar-element[data-color=pink]{--color-top:var(--peer-avatar-pink-top);--color-bottom:var(--peer-avatar-pink-bottom)}avatar-element[data-color=blue]{--color-top:var(--peer-avatar-blue-top);--color-bottom:var(--peer-avatar-blue-bottom)}avatar-element.tgico:before{font-size:calc(32px/var(--multiplier))}avatar-element.tgico-calendarfilter:before{font-size:calc(36px/var(--multiplier))}avatar-element.tgico-saved:before{font-size:calc(30px/var(--multiplier))!important}avatar-element.tgico-reply_filled:before{font-size:calc(28px/var(--multiplier))!important}avatar-element.tgico-deletedaccount{--color-top:var(--peer-avatar-archive-top);--color-bottom:var(--peer-avatar-archive-bottom);overflow:hidden}avatar-element.tgico-deletedaccount:before{font-size:calc(30px/var(--multiplier))}avatar-element:before{line-height:inherit!important}avatar-element.media-container{position:relative}avatar-element img{border-radius:inherit!important;display:block;height:var(--size)!important;width:var(--size)!important}avatar-element img.fade-in{animation:fade-in-opacity .2s ease forwards}avatar-element img.emoji{height:calc(1.125rem/var(--multiplier))!important;vertical-align:middle!important;width:calc(1.125rem/var(--multiplier))!important}avatar-element.is-forum{border-radius:var(--avatar-border-radius-forum)}avatar-element.is-topic{background:none;border-radius:0;position:relative}avatar-element.is-topic .topic-icon{--size:inherit}avatar-element.is-online{position:relative}avatar-element.is-online:after{background-color:var(--avatar-online-color);border:2px solid var(--surface-color);border-radius:50%;content:" ";display:block;height:14px;left:2.4375rem;position:absolute;top:2.4375rem;width:14px}avatar-element[clickable]{cursor:pointer}avatar-element.avatar-relative{position:relative}avatar-element.avatar-120{--size:120px;--multiplier:.45}avatar-element.avatar-100{--size:100px;--multiplier:.54}avatar-element.avatar-48{--size:48px;--multiplier:1.125}avatar-element.avatar-46{--size:46px;--multiplier:1.173913}avatar-element.avatar-44{--size:44px;--multiplier:1.227272}avatar-element.avatar-42{--size:42px;--multiplier:1.285714}avatar-element.avatar-40{--size:40px;--multiplier:1.35}avatar-element.avatar-36{--size:36px;--multiplier:1.5}avatar-element.avatar-35{--size:35px;--multiplier:1.542857}avatar-element.avatar-34{--size:34px;--multiplier:1.588235}avatar-element.avatar-32{--size:32px;--multiplier:1.6875}avatar-element.avatar-30{--size:30px;--multiplier:1.6875}avatar-element.avatar-26{--size:26px;--multiplier:2.076923}avatar-element.avatar-24{--size:24px;--multiplier:2.25}avatar-element.avatar-22{--size:22px;--multiplier:2.454545}avatar-element.avatar-18{--size:18px;--multiplier:3}avatar-element.avatar-16{--size:16px;--multiplier:3.375}.avatar-relative .avatar-photo{left:0;position:absolute;top:0}.avatar-full{align-items:center;border-radius:inherit;display:inline-flex;height:100%;justify-content:center;position:absolute;width:100%}.avatar-full .avatar-photo{height:100%!important;-o-object-fit:cover;object-fit:cover;width:100%!important}.document{--background-color:var(--primary-color);height:70px}.document .media-photo{border-radius:inherit}.document .media-photo.thumbnail{left:0}.document-ico{background-color:var(--background-color);border-radius:.375rem;line-height:1;text-align:center}html.is-safari .document-ico{-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}.document-ico-text{opacity:0}body.animation-level-2 .document-ico-text{transition:opacity .2s ease-in-out}.document:not(.document-with-thumb) .document-ico{padding:1.5625rem .25rem 0}@media only screen and (max-width:600px){.document:not(.document-with-thumb) .document-ico{font-size:14px;padding:1.5rem 0 0}.document:not(.document-with-thumb) .document-ico:after{--size:.875rem}}.document-ico:after{--size:1.125rem;border-bottom-color:rgba(0,0,0,.25);border-bottom-left-radius:.25rem;border-left-color:rgba(0,0,0,.25);border-right-color:var(--message-background-color);border-style:solid;border-top-color:var(--message-background-color);border-width:calc(var(--size)/2);content:"";display:block;position:absolute;right:0;top:0}body.animation-level-2 .document-ico:after{transition:border-width .2s ease-in-out}html.no-touch .document:not(.downloaded):active .document-ico:after,html.no-touch .document:not(.downloaded):hover .document-ico:after{border-width:0}html.no-touch .document:not(.downloaded):active .document-ico-text,html.no-touch .document:not(.downloaded):hover .document-ico-text{opacity:0}html.no-touch .document:not(.downloaded):active .preloader-container,html.no-touch .document:not(.downloaded):hover .preloader-container{opacity:1!important}.document:not(.downloading) .document-ico-text{opacity:1}.document:not(.downloading) .preloader-container{opacity:0!important}.document.downloading .document-ico:after{border-width:0}.document-ico{background-size:contain;font-size:1.125rem}.document-ico,.document-name,.document-size{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.document.ext-zip{--background-color:#fb8c00}.document.ext-pdf{--background-color:#df3f40}.document.ext-apk{--background-color:#43a047}.document.document-with-thumb{--background-color:#fff}.document.document-with-thumb .document-ico:after{display:none}.document.document-with-thumb .document-download{background-color:rgba(0,0,0,.2);border-radius:.375rem}.document.document-with-thumb .preloader-circular{transition:background-color .2s}.document.document-with-thumb .preloader-container:not(.manual) .preloader-circular{background-color:rgba(0,0,0,.3)!important}.document-thumb{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.document-name{font-size:var(--font-size-16);font-weight:var(--font-weight-bold);line-height:var(--line-height-16);white-space:nowrap}.document-size{color:var(--secondary-text-color);font-size:var(--font-size-14);line-height:var(--line-height-14);pointer-events:none;position:relative}.document .preloader-container{height:2.5rem;width:2.5rem}@media only screen and (max-width:600px){.document .preloader-container{height:1.625rem;width:1.625rem}}.document .preloader-circular{background-color:transparent!important}.document .preloader-path-new{stroke-width:2.5}[dir=ltr] .audio,[dir=ltr] .document{padding-left:var(--padding-left)}[dir=rtl] .audio,[dir=rtl] .document{padding-right:var(--padding-left)}.audio,.document{--padding:0px;--icon-size:3.375rem;--icon-margin:.875rem;--padding-left:calc(var(--icon-size) + var(--icon-margin) + var(--padding));cursor:pointer;display:flex;flex-direction:column;justify-content:center;padding:var(--padding);-webkit-user-select:none;-moz-user-select:none;user-select:none}[dir=ltr] .audio-download,[dir=ltr] .audio-ico,[dir=ltr] .document-download,[dir=ltr] .document-ico{margin-left:calc((var(--padding-left) - var(--padding))*-1)}[dir=rtl] .audio-download,[dir=rtl] .audio-ico,[dir=rtl] .document-download,[dir=rtl] .document-ico{margin-right:calc((var(--padding-left) - var(--padding))*-1)}.audio-download,.audio-ico,.document-download,.document-ico{color:#fff;height:var(--icon-size);position:absolute;width:var(--icon-size)}.audio-download,.document-download{align-items:center;cursor:pointer;display:flex;font-size:1.5rem;justify-content:center;opacity:1;transition:opacity .2s ease-in-out;z-index:1}.audio-download.downloaded,.document-download.downloaded{opacity:0}.audio-description,.document-description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.audio:not(.corner-download) .preloader-container:not(.preloader-streamable),.document:not(.corner-download) .preloader-container:not(.preloader-streamable){transform:scale(1)!important}.audio .checkbox-field-round,.document .checkbox-field-round{--margin-top:.25rem;--margin-left:.125rem;left:auto;margin-left:calc(var(--padding-left)*-1 + var(--icon-size) - var(--size) + var(--margin-left));margin-top:calc(var(--icon-size) - var(--size) + var(--margin-top));top:auto}.audio-ico{display:flex;justify-content:center}.audio-ico.tgico-largeplay:before{margin-right:-1px}.audio .preloader-circular{background-color:transparent!important}.audio .preloader-container:not(.preloader-streamable){height:100%;width:100%}.audio{--icon-size:3rem;--icon-margin:.5625rem;height:var(--icon-size);overflow:visible!important}.audio-download,.audio-toggle{align-items:center;background-color:var(--primary-color);border-radius:50%}.audio.corner-download .audio-download{background:none;display:flex!important;height:1.375rem;left:57.5%;margin:0!important;top:57.5%;width:1.375rem}.audio.corner-download .preloader-container{background-color:var(--primary-color);border-radius:inherit}.audio.corner-download .preloader-path-new{stroke-width:.25rem}.audio-play-icon{border-radius:inherit;bottom:0;left:0;max-height:100%;max-width:100%;overflow:hidden;position:absolute;right:0;top:0;transform:rotate(-119deg)}body.animation-level-2 .audio-play-icon{transition:transform .25s ease-in-out}.audio-toggle .part{background-color:#fff;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}body.animation-level-2 .audio-toggle .part{transition:-webkit-clip-path .25s ease-in-out;transition:clip-path .25s ease-in-out;transition:clip-path .25s ease-in-out,-webkit-clip-path .25s ease-in-out}@media only screen and (min-width:601px){.audio-toggle .part{height:140px;width:140px}}@media only screen and (max-width:600px){.audio-toggle .part{height:92px;width:92px}}.audio-toggle .part.one{-webkit-clip-path:polygon(56.42249% 57.01763%,54.93283% 57.0175%,53.00511% 57.01738%,50.83554% 57.01727%,48.62036% 57.01718%,46.55585% 57.01709%,44.83822% 57.01702%,43.66373% 57.01698%,43.22863% 57.01696%,42.86372% 57.01904%,42.56988% 57.01621%,42.3402% 56.99486%,42.16778% 56.94152%,42.0457% 56.84267%,41.96705% 56.68478%,41.92493% 56.45432%,41.91246% 56.13777%,41.91258% 55.76282%,41.9129% 55.37058%,41.91335% 54.96757%,41.91387% 54.56032%,41.91439% 54.15537%,41.91485% 53.75926%,41.91517% 53.3785%,41.91529% 53.01965%,41.94275% 52.72355%,42.02117% 52.51653%,42.14465% 52.38328%,42.30727% 52.30854%,42.50308% 52.27699%,42.72619% 52.27341%,42.97065% 52.28248%,43.23056% 52.2889%,43.94949% 52.28896%,45.45083% 52.28912%,47.47445% 52.28932%,49.76027% 52.28957%,52.04818% 52.28981%,54.07805% 52.29003%,55.5898% 52.29019%,56.32332% 52.29024%,56.58221% 52.28816%,56.83726% 52.28948%,57.07897% 52.30593%,57.29794% 52.34898%,57.48468% 52.43029%,57.62978% 52.56146%,57.72375% 52.7541%,57.75718% 53.01981%,57.75713% 53.37763%,57.75699% 53.81831%,57.75679% 54.31106%,57.75657% 54.82507%,57.75635% 55.32958%,57.75615% 55.79377%,57.75601% 56.18684%,57.75596% 56.47801%,57.7549% 56.50122%,57.74034% 56.5624%,57.6955% 56.64887%,57.60334% 56.748%,57.44691% 56.84712%,57.20925% 56.93358%,56.87342% 56.99471%);clip-path:polygon(56.42249% 57.01763%,54.93283% 57.0175%,53.00511% 57.01738%,50.83554% 57.01727%,48.62036% 57.01718%,46.55585% 57.01709%,44.83822% 57.01702%,43.66373% 57.01698%,43.22863% 57.01696%,42.86372% 57.01904%,42.56988% 57.01621%,42.3402% 56.99486%,42.16778% 56.94152%,42.0457% 56.84267%,41.96705% 56.68478%,41.92493% 56.45432%,41.91246% 56.13777%,41.91258% 55.76282%,41.9129% 55.37058%,41.91335% 54.96757%,41.91387% 54.56032%,41.91439% 54.15537%,41.91485% 53.75926%,41.91517% 53.3785%,41.91529% 53.01965%,41.94275% 52.72355%,42.02117% 52.51653%,42.14465% 52.38328%,42.30727% 52.30854%,42.50308% 52.27699%,42.72619% 52.27341%,42.97065% 52.28248%,43.23056% 52.2889%,43.94949% 52.28896%,45.45083% 52.28912%,47.47445% 52.28932%,49.76027% 52.28957%,52.04818% 52.28981%,54.07805% 52.29003%,55.5898% 52.29019%,56.32332% 52.29024%,56.58221% 52.28816%,56.83726% 52.28948%,57.07897% 52.30593%,57.29794% 52.34898%,57.48468% 52.43029%,57.62978% 52.56146%,57.72375% 52.7541%,57.75718% 53.01981%,57.75713% 53.37763%,57.75699% 53.81831%,57.75679% 54.31106%,57.75657% 54.82507%,57.75635% 55.32958%,57.75615% 55.79377%,57.75601% 56.18684%,57.75596% 56.47801%,57.7549% 56.50122%,57.74034% 56.5624%,57.6955% 56.64887%,57.60334% 56.748%,57.44691% 56.84712%,57.20925% 56.93358%,56.87342% 56.99471%)}.audio-toggle .part.two{-webkit-clip-path:polygon(56.42249% 42.44625%,54.93283% 42.44637%,53.00511% 42.44649%,50.83554% 42.4466%,48.62036% 42.4467%,46.55585% 42.44679%,44.83822% 42.44685%,43.66373% 42.4469%,43.22863% 42.44691%,42.86372% 42.44483%,42.56988% 42.44767%,42.3402% 42.46902%,42.16778% 42.52235%,42.0457% 42.6212%,41.96705% 42.77909%,41.92493% 43.00956%,41.91246% 43.32611%,41.91258% 43.70105%,41.9129% 44.0933%,41.91335% 44.49631%,41.91387% 44.90355%,41.91439% 45.3085%,41.91485% 45.70462%,41.91517% 46.08537%,41.91529% 46.44422%,41.94275% 46.74032%,42.02117% 46.94735%,42.14465% 47.0806%,42.30727% 47.15534%,42.50308% 47.18688%,42.72619% 47.19047%,42.97065% 47.1814%,43.23056% 47.17497%,43.94949% 47.17491%,45.45083% 47.17476%,47.47445% 47.17455%,49.76027% 47.1743%,52.04818% 47.17406%,54.07805% 47.17384%,55.5898% 47.17369%,56.32332% 47.17363%,56.58221% 47.17571%,56.83726% 47.17439%,57.07897% 47.15795%,57.29794% 47.1149%,57.48468% 47.03359%,57.62978% 46.90242%,57.72375% 46.70977%,57.75718% 46.44406%,57.75713% 46.08625%,57.75699% 45.64557%,57.75679% 45.15282%,57.75657% 44.6388%,57.75635% 44.1343%,57.75615% 43.6701%,57.75601% 43.27703%,57.75596% 42.98586%,57.7549% 42.96265%,57.74034% 42.90148%,57.6955% 42.815%,57.60334% 42.71587%,57.44691% 42.61675%,57.20925% 42.53029%,56.87342% 42.46916%);clip-path:polygon(56.42249% 42.44625%,54.93283% 42.44637%,53.00511% 42.44649%,50.83554% 42.4466%,48.62036% 42.4467%,46.55585% 42.44679%,44.83822% 42.44685%,43.66373% 42.4469%,43.22863% 42.44691%,42.86372% 42.44483%,42.56988% 42.44767%,42.3402% 42.46902%,42.16778% 42.52235%,42.0457% 42.6212%,41.96705% 42.77909%,41.92493% 43.00956%,41.91246% 43.32611%,41.91258% 43.70105%,41.9129% 44.0933%,41.91335% 44.49631%,41.91387% 44.90355%,41.91439% 45.3085%,41.91485% 45.70462%,41.91517% 46.08537%,41.91529% 46.44422%,41.94275% 46.74032%,42.02117% 46.94735%,42.14465% 47.0806%,42.30727% 47.15534%,42.50308% 47.18688%,42.72619% 47.19047%,42.97065% 47.1814%,43.23056% 47.17497%,43.94949% 47.17491%,45.45083% 47.17476%,47.47445% 47.17455%,49.76027% 47.1743%,52.04818% 47.17406%,54.07805% 47.17384%,55.5898% 47.17369%,56.32332% 47.17363%,56.58221% 47.17571%,56.83726% 47.17439%,57.07897% 47.15795%,57.29794% 47.1149%,57.48468% 47.03359%,57.62978% 46.90242%,57.72375% 46.70977%,57.75718% 46.44406%,57.75713% 46.08625%,57.75699% 45.64557%,57.75679% 45.15282%,57.75657% 44.6388%,57.75635% 44.1343%,57.75615% 43.6701%,57.75601% 43.27703%,57.75596% 42.98586%,57.7549% 42.96265%,57.74034% 42.90148%,57.6955% 42.815%,57.60334% 42.71587%,57.44691% 42.61675%,57.20925% 42.53029%,56.87342% 42.46916%)}.audio-toggle.playing .audio-play-icon{transform:rotate(-90deg)}@media only screen and (min-width:601px){.audio-toggle:not(.playing) .part{height:136px;width:136px}}@media only screen and (max-width:600px){.audio-toggle:not(.playing) .part{height:92px;width:92px}}.audio-toggle:not(.playing) .part.one{-webkit-clip-path:polygon(43.77666% 55.85251%,43.77874% 55.46331%,43.7795% 55.09177%,43.77934% 54.74844%,43.77855% 54.44389%,43.77741% 54.18863%,43.77625% 53.99325%,43.77533% 53.86828%,43.77495% 53.82429%,43.77518% 53.55329%,43.7754% 53.2823%,43.77563% 53.01131%,43.77585% 52.74031%,43.77608% 52.46932%,43.7763% 52.19832%,43.77653% 51.92733%,43.77675% 51.65633%,43.77653% 51.38533%,43.7763% 51.11434%,43.77608% 50.84334%,43.77585% 50.57235%,43.77563% 50.30136%,43.7754% 50.03036%,43.77518% 49.75936%,43.77495% 49.48837%,44.48391% 49.4885%,45.19287% 49.48865%,45.90183% 49.48878%,46.61079% 49.48892%,47.31975% 49.48906%,48.0287% 49.4892%,48.73766% 49.48934%,49.44662% 49.48948%,50.72252% 49.48934%,51.99842% 49.4892%,53.27432% 49.48906%,54.55022% 49.48892%,55.82611% 49.48878%,57.10201% 49.48865%,58.3779% 49.4885%,59.6538% 49.48837%,59.57598% 49.89151%,59.31883% 50.28598%,58.84686% 50.70884%,58.12456% 51.19714%,57.11643% 51.78793%,55.78697% 52.51828%,54.10066% 53.42522%,52.02202% 54.54581%,49.96525% 55.66916%,48.3319% 56.57212%,47.06745% 57.27347%,46.11739% 57.79191%,45.42719% 58.14619%,44.94235% 58.35507%,44.60834% 58.43725%,44.37066% 58.41149%,44.15383% 58.27711%,43.99617% 58.0603%,43.88847% 57.77578%,43.82151% 57.43825%,43.78608% 57.06245%,43.77304% 56.66309%,43.773% 56.25486%);clip-path:polygon(43.77666% 55.85251%,43.77874% 55.46331%,43.7795% 55.09177%,43.77934% 54.74844%,43.77855% 54.44389%,43.77741% 54.18863%,43.77625% 53.99325%,43.77533% 53.86828%,43.77495% 53.82429%,43.77518% 53.55329%,43.7754% 53.2823%,43.77563% 53.01131%,43.77585% 52.74031%,43.77608% 52.46932%,43.7763% 52.19832%,43.77653% 51.92733%,43.77675% 51.65633%,43.77653% 51.38533%,43.7763% 51.11434%,43.77608% 50.84334%,43.77585% 50.57235%,43.77563% 50.30136%,43.7754% 50.03036%,43.77518% 49.75936%,43.77495% 49.48837%,44.48391% 49.4885%,45.19287% 49.48865%,45.90183% 49.48878%,46.61079% 49.48892%,47.31975% 49.48906%,48.0287% 49.4892%,48.73766% 49.48934%,49.44662% 49.48948%,50.72252% 49.48934%,51.99842% 49.4892%,53.27432% 49.48906%,54.55022% 49.48892%,55.82611% 49.48878%,57.10201% 49.48865%,58.3779% 49.4885%,59.6538% 49.48837%,59.57598% 49.89151%,59.31883% 50.28598%,58.84686% 50.70884%,58.12456% 51.19714%,57.11643% 51.78793%,55.78697% 52.51828%,54.10066% 53.42522%,52.02202% 54.54581%,49.96525% 55.66916%,48.3319% 56.57212%,47.06745% 57.27347%,46.11739% 57.79191%,45.42719% 58.14619%,44.94235% 58.35507%,44.60834% 58.43725%,44.37066% 58.41149%,44.15383% 58.27711%,43.99617% 58.0603%,43.88847% 57.77578%,43.82151% 57.43825%,43.78608% 57.06245%,43.77304% 56.66309%,43.773% 56.25486%)}.audio-toggle:not(.playing) .part.two{-webkit-clip-path:polygon(43.77666% 43.83035%,43.77874% 44.21955%,43.7795% 44.59109%,43.77934% 44.93442%,43.77855% 45.23898%,43.77741% 45.49423%,43.77625% 45.68961%,43.77533% 45.81458%,43.77495% 45.85858%,43.77518% 46.12957%,43.7754% 46.40056%,43.77563% 46.67156%,43.77585% 46.94255%,43.77608% 47.21355%,43.7763% 47.48454%,43.77653% 47.75554%,43.77675% 48.02654%,43.77653% 48.29753%,43.7763% 48.56852%,43.77608% 48.83952%,43.77585% 49.11051%,43.77563% 49.38151%,43.7754% 49.65251%,43.77518% 49.9235%,43.77495% 50.1945%,44.48391% 50.19436%,45.19287% 50.19422%,45.90183% 50.19408%,46.61079% 50.19394%,47.31975% 50.1938%,48.0287% 50.19366%,48.73766% 50.19353%,49.44662% 50.19338%,50.72252% 50.19353%,51.99842% 50.19366%,53.27432% 50.1938%,54.55022% 50.19394%,55.82611% 50.19408%,57.10201% 50.19422%,58.3779% 50.19436%,59.6538% 50.1945%,59.57598% 49.79136%,59.31883% 49.39688%,58.84686% 48.97402%,58.12456% 48.48572%,57.11643% 47.89493%,55.78697% 47.16458%,54.10066% 46.25764%,52.02202% 45.13705%,49.96525% 44.01371%,48.3319% 43.11074%,47.06745% 42.4094%,46.11739% 41.89096%,45.42719% 41.53667%,44.94235% 41.3278%,44.60834% 41.24561%,44.37066% 41.27137%,44.15383% 41.40575%,43.99617% 41.62256%,43.88847% 41.90709%,43.82151% 42.24461%,43.78608% 42.62041%,43.77304% 43.01978%,43.773% 43.428%);clip-path:polygon(43.77666% 43.83035%,43.77874% 44.21955%,43.7795% 44.59109%,43.77934% 44.93442%,43.77855% 45.23898%,43.77741% 45.49423%,43.77625% 45.68961%,43.77533% 45.81458%,43.77495% 45.85858%,43.77518% 46.12957%,43.7754% 46.40056%,43.77563% 46.67156%,43.77585% 46.94255%,43.77608% 47.21355%,43.7763% 47.48454%,43.77653% 47.75554%,43.77675% 48.02654%,43.77653% 48.29753%,43.7763% 48.56852%,43.77608% 48.83952%,43.77585% 49.11051%,43.77563% 49.38151%,43.7754% 49.65251%,43.77518% 49.9235%,43.77495% 50.1945%,44.48391% 50.19436%,45.19287% 50.19422%,45.90183% 50.19408%,46.61079% 50.19394%,47.31975% 50.1938%,48.0287% 50.19366%,48.73766% 50.19353%,49.44662% 50.19338%,50.72252% 50.19353%,51.99842% 50.19366%,53.27432% 50.1938%,54.55022% 50.19394%,55.82611% 50.19408%,57.10201% 50.19422%,58.3779% 50.19436%,59.6538% 50.1945%,59.57598% 49.79136%,59.31883% 49.39688%,58.84686% 48.97402%,58.12456% 48.48572%,57.11643% 47.89493%,55.78697% 47.16458%,54.10066% 46.25764%,52.02202% 45.13705%,49.96525% 44.01371%,48.3319% 43.11074%,47.06745% 42.4094%,46.11739% 41.89096%,45.42719% 41.53667%,44.94235% 41.3278%,44.60834% 41.24561%,44.37066% 41.27137%,44.15383% 41.40575%,43.99617% 41.62256%,43.88847% 41.90709%,43.82151% 42.24461%,43.78608% 42.62041%,43.77304% 43.01978%,43.773% 43.428%)}.audio-download{z-index:2}.audio-waveform{height:100%}.audio-waveform-background .audio-waveform-bar{opacity:.3}html.no-touch .audio-waveform-background .audio-waveform-bar:active,html.no-touch .audio-waveform-background .audio-waveform-bar:hover{opacity:1}.audio-waveform-fake{bottom:0;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;width:0}.audio-waveform-container{align-items:center;display:flex;height:23px;margin-top:1px;position:relative}.audio-waveform-bar{fill:var(--primary-color)}.audio .audio-details{margin-bottom:0;margin-top:3px}.audio .audio-title{margin-bottom:-2px}[dir=ltr] body.is-premium .audio.can-transcribe{padding-right:2.25rem}[dir=rtl] body.is-premium .audio.can-transcribe{padding-left:2.25rem}body.is-premium .audio.can-transcribe .audio-to-text-button{display:flex}.audio .audio-to-text-button{align-items:center;align-self:flex-end;background:var(--light-filled-message-primary-color);border-radius:.3125rem;color:var(--message-primary-color);display:none;font-size:1.1875rem;height:1.5rem;justify-content:center;margin-right:-2.25rem;margin-top:-1rem;overflow:hidden;position:absolute;width:-moz-max-content;width:max-content;width:2rem}html.no-touch .audio .audio-to-text-button:active:after,html.no-touch .audio .audio-to-text-button:hover:after{background-color:var(--message-primary-color);border-radius:inherit;bottom:0;content:" ";left:0;opacity:.08;position:absolute;right:0;top:0}.audio .audio-to-text-button .loader{height:100%;left:0;opacity:0;position:absolute;top:0;transition:opacity .2s;width:100%}.audio .audio-to-text-button .loader.active{opacity:1}.audio .audio-to-text-button .loader .audio-transcribe-outline{height:100%;width:100%}@keyframes loading{0%{stroke-dashoffset:100}to{stroke-dashoffset:0}}.audio .audio-to-text-button .loader .audio-transcribe-outline-rect{animation:loading 1s ease-in-out infinite}.audio .part{height:112px!important;width:112px!important}@media only screen and (max-width:600px){.audio .part{height:100px!important;width:100px!important}}.audio-title{color:var(--primary-text-color);font-size:1rem}.audio-description:not(:empty):before{content:" • "}.audio-subtitle,.audio-time{color:var(--secondary-text-color);display:flex;font-size:.875rem}@media only screen and (max-width:600px){.audio-subtitle,.audio-time{font-size:.75rem}}.audio-subtitle,.audio-time,.audio-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.audio-subtitle{align-items:center}.audio-subtitle .audio-time{flex:0 0 auto;margin-right:.25rem}.audio-subtitle,.audio-title{margin-left:-1px}.audio-title,.audio:not(.audio-show-progress) .audio-subtitle{max-width:100%}.audio.is-voice .audio-time{align-items:center;line-height:1;margin-left:-1px;margin-top:7px}[dir=ltr] .audio.is-voice .progress-line{margin-left:0}[dir=rtl] .audio.is-voice .progress-line{margin-right:0}.audio.is-voice .progress-line{margin-top:4px;min-width:11.25rem}.audio.is-voice .progress-line__filled:after{opacity:0}@media only screen and (max-width:600px){.audio.is-voice .audio-time{margin-top:.3125rem}.audio.is-voice .audio-waveform-container{height:16px;margin-top:0}}.audio.is-voice.is-unread .audio-time:after{background-color:var(--primary-color);border-radius:50%;content:" ";height:.5rem;margin-left:.375rem;width:.5rem}.audio.is-voice.is-unread:not(.is-out) .audio-toggle:not(.playing)+.audio-waveform-container .audio-waveform-background .audio-waveform-bar{opacity:1}.audio .progress-line{--height:2px;--border-radius:4px;--thumb-size:.75rem;flex:1 1 auto;margin:0 6px 0 5px}.audio-with-thumb .audio-play-icon{background-color:transparent;opacity:1;z-index:1}body.animation-level-2 .audio-with-thumb .audio-play-icon{transition:transform .25s ease-in-out,background-color .2s ease-in-out,opacity .2s ease-in-out}.audio-with-thumb .audio-play-icon .part{background-color:#fff!important}.audio-with-thumb .audio-play-icon:not(:last-child){background-color:rgba(0,0,0,.3)}.audio-with-thumb .media-photo{border-radius:inherit;height:inherit;-o-object-fit:cover;object-fit:cover;width:inherit}.audio-with-thumb:not(.corner-download) .audio-download{background-color:rgba(0,0,0,.3)}.audio-with-thumb:not(.corner-download).downloading .audio-play-icon{opacity:0}.quiz-hint{align-items:center;display:flex;justify-content:center;left:0;position:absolute;top:8px;transform:translate3d(0,calc(-100% - 10px),0);transition:transform .2s ease;width:100%}body.animation-level-0 .quiz-hint{transition:none}.quiz-hint.active{transform:translateZ(0)}[dir=ltr] .quiz-hint .container{text-align:left}[dir=rtl] .quiz-hint .container{text-align:right}.quiz-hint .container{align-items:center;background:rgba(0,0,0,.7);border-radius:12px;color:#fff;display:flex;flex-wrap:wrap;font-size:15px;line-height:1.5;max-width:400px;min-height:48px;overflow:hidden;padding:10px 18px 12px 50px;position:relative;text-align:center;width:auto}@media only screen and (max-width:600px){.quiz-hint .container{font-size:14px;margin:0 10px;padding:10px 18px 12px 54px}}.quiz-hint .container .text{word-break:break-word}.quiz-hint .container:before{content:"";font-size:1.5rem;left:15px;position:absolute;top:12px}.quiz-hint .container a{border-bottom:1px solid #fff;color:#fff}.peer-typing{margin-right:4px}.peer-typing-container{--color:var(--primary-color);color:var(--color)}.peer-typing-flex{align-items:center;display:flex}.peer-typing:not(.peer-typing-text):not(.peer-typing-choosing-sticker){display:inline-block;transform:translateY(-1px);vertical-align:middle}.peer-typing-text-dot{animation-duration:.6s;animation-iteration-count:infinite;animation-name:dotMiddle;animation-timing-function:linear;background-color:var(--color);border-radius:50%;display:inline-block;height:6px;margin:0 .5px;vertical-align:middle;width:6px}.peer-typing-text-dot:first-child{animation-name:dotFirst}.peer-typing-text-dot:last-child{animation-name:dotLast}.peer-typing-upload{border-radius:2px;height:5px;margin-right:.375rem;overflow:hidden;position:relative;width:13px}.peer-typing-upload:after,.peer-typing-upload:before{background-color:var(--color);border-radius:inherit;bottom:0;content:" ";display:block;left:0;position:absolute;right:0;top:0}.peer-typing-upload:before{opacity:.3}.peer-typing-upload:after{animation:upload 1s ease-in-out infinite}.peer-typing-record{margin-right:.375rem}.peer-typing-record:before{animation:recordBlink 1.25s infinite;background-color:var(--color);border-radius:50%;content:" ";display:block;height:6px;width:6px}.peer-typing-choosing-sticker{align-items:center;display:flex;flex:0 0 auto;height:16px;margin-right:.375rem}.peer-typing-choosing-sticker-eye{animation:eye 1.8s ease-in-out infinite;border:1px solid var(--color);border-radius:50%;display:inline-block;height:14px;margin:0 .0625rem;position:relative;vertical-align:middle;width:8px}.peer-typing-choosing-sticker-eye:before{animation:eye-move 1.8s ease-in-out infinite;background-color:var(--color);border-radius:50%;content:" ";display:block;height:.25rem;position:absolute;top:50%;transform:translate(-1px,-50%);width:.25rem}@keyframes dotFirst{0%{opacity:.8;transform:scale(.6666666667)}50%{opacity:.8;transform:scale(.6666666667)}75%{opacity:1;transform:scale(1)}to{opacity:.8;transform:scale(.6666666667)}}@keyframes dotMiddle{0%{opacity:.9;transform:scale(.8333333333)}12.5%{opacity:.8;transform:scale(.6666666667)}62.5%{opacity:.8;transform:scale(.6666666667)}87.5%{opacity:1;transform:scale(1)}to{opacity:.9;transform:scale(.8333333333)}}@keyframes dotLast{0%{opacity:1;transform:scale(1)}25%{opacity:.8;transform:scale(.6666666667)}75%{opacity:.8;transform:scale(.6666666667)}to{opacity:1;transform:scale(1)}}@keyframes upload{0%{transform:translateX(-13px)}to{transform:translate(13px)}}@keyframes eye{0%{transform:scale(1.1) translateX(-.75px)}12.5%{transform:scale(1) translateX(0)}25%{transform:scale(1.1) translateX(.375px)}50%{transform:scale(1.1) translateX(.75px)}62.5%{transform:scale(1) translateX(0)}75%{transform:scale(1.1) translateX(-.375px)}to{transform:scale(1.1) translateX(-.75px)}}@keyframes eye-move{0%{transform:translate(-1px,-50%)}25%{transform:translate(3px,-50%)}50%{transform:translate(3px,-50%)}75%{transform:translate(-1px,-50%)}to{transform:translate(-1px,-50%)}}poll-element{color:var(--primary-text-color);display:block;margin-top:-1px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:330px}@media only screen and (max-width:600px){poll-element{max-width:100%;width:240px}}poll-element:not(.is-closed):not(.is-voted) .poll-answer{cursor:pointer}poll-element .poll-title{font-weight:var(--font-weight-bold)}@media only screen and (max-width:600px){poll-element .poll-title{max-width:88%;white-space:normal}}poll-element .poll-desc{align-items:center;color:var(--secondary-text-color);display:flex;font-size:14px;margin-bottom:5px;margin-top:2px;position:relative}poll-element .poll-type{margin-top:2px}poll-element .poll-hint{color:var(--primary-color);cursor:pointer;font-size:1.5rem;position:absolute;right:2px;top:-4px;transform:scale(1)}body.animation-level-2 poll-element .poll-hint{transition:transform .2s ease}poll-element .poll-hint.active{pointer-events:none;transform:scale(0)}poll-element .poll-send-vote{cursor:default}poll-element .poll-avatars{cursor:pointer;display:flex;margin-left:18px}poll-element .poll-avatar{border:1px solid var(--border-color);cursor:pointer;height:18px;width:18px}poll-element .poll-answer{display:flex;margin-top:1px;padding-bottom:20px;padding-left:28px;position:relative}poll-element .poll-answer-text{margin-left:12px;margin-top:6px}[dir=ltr] poll-element .poll-answer-percents{text-align:right}[dir=rtl] poll-element .poll-answer-percents{text-align:left}poll-element .poll-answer-percents{font-size:14px;font-weight:var(--font-weight-bold);left:0;margin-left:-9px;margin-top:7px;opacity:0;position:absolute;top:0;width:40px}poll-element .poll-answer-selected{align-items:center;background:var(--primary-color);border-radius:50%;bottom:1px;color:#fff;display:flex;font-size:.75rem;font-weight:var(--font-weight-bold);height:16px;justify-content:center;left:15px;opacity:1;position:absolute;width:16px}poll-element .poll-answer-selected:before{content:"";font-weight:var(--font-weight-bold)}html.no-touch poll-element .poll-answer:active .animation-ring,html.no-touch poll-element .poll-answer:hover .animation-ring{transform:scale(1);visibility:visible}poll-element .poll-answer.is-voting .progress-ring__circle{stroke-dashoffset:-19.792;animation:pollAnswerRotate .65s linear infinite}poll-element .poll-answer:not(.is-correct):not(.is-chosen) .poll-answer-selected{opacity:0}poll-element .poll-answer.is-chosing .circle-hover .poll-answer-selected{opacity:1}poll-element .poll-answer.is-chosing~.poll-footer .poll-send-vote{cursor:pointer}poll-element .poll-votes-count{color:var(--secondary-text-color);font-size:.875rem;margin-top:-.5rem}poll-element .poll-line{stroke-dashoffset:0;stroke-dasharray:0,485.9;bottom:2px;height:35px;left:10px;position:absolute}poll-element .poll-line use{stroke-width:4px;stroke-linecap:round;stroke:var(--primary-color);fill:none}poll-element .poll-footer{height:2.875rem;margin:-.375rem -.5rem -.375rem -.625rem;text-align:center}poll-element .poll-footer-button{border-top-left-radius:0!important;border-top-right-radius:0!important;color:var(--primary-color);cursor:pointer;font-size:1rem;font-weight:var(--font-weight-bold);height:100%;overflow:hidden;width:100%}poll-element .poll-footer,poll-element .poll-footer-button{align-items:center;display:flex;justify-content:center}poll-element .poll-quiz-timer{stroke:#a3adb6;fill:none;stroke-linecap:round;height:32px;position:absolute;right:-2px;top:-7px;transform:rotate(270deg);width:32px}poll-element .poll-time{color:#a3adb6;font-size:12px;font-weight:var(--font-weight-bold);position:absolute;right:27px}poll-element.is-quiz .poll-answer.is-chosen:not(.is-correct) use{stroke:var(--danger-color)}poll-element.is-quiz .poll-answer.is-chosen:not(.is-correct) .poll-answer-selected{background:var(--danger-color)}poll-element.is-quiz .poll-answer.is-chosen:not(.is-correct) .poll-answer-selected:before{content:"";font-size:12px}poll-element .circle-hover{align-items:center;display:flex;height:34px;justify-content:center;left:-1px;position:absolute;top:-1px;transform:scale(1);width:34px}poll-element .circle-hover .poll-answer-selected{animation:none;display:flex!important;font-size:20px;height:20px;left:50%;line-height:16px;opacity:0;top:50%;transform:translate(-50%,-50%);width:20px}body.animation-level-2 poll-element .circle-hover .poll-answer-selected{transition:opacity .2s ease}poll-element .animation-ring{background-color:var(--light-secondary-text-color);border-radius:50%;display:block;height:34px;transform:scale(.1);visibility:hidden;width:34px}body.animation-level-2 poll-element .animation-ring{transition:transform .12s ease}poll-element .progress-ring{height:26px;left:auto;top:auto;width:26px}poll-element .progress-ring__circle{stroke-dasharray:56.5487,56.5487;stroke-dashoffset:0;stroke-opacity:1;stroke-width:2;stroke:var(--poll-circle-color);fill:transparent;transform:rotate(-90deg);transform-origin:center}poll-element.is-voted .animation-ring,poll-element.is-voted .circle-hover{transform:scale(0)}poll-element.is-voted .poll-answer-percents{opacity:1}poll-element.is-retracting .circle-hover{transition-delay:.24s}poll-element.is-retracting .animation-ring{transition-delay:.22s}poll-element.animating .poll-line{transition:stroke-dashoffset .34s linear,stroke-dasharray .34s linear}poll-element.animating .poll-answer-selected{transition-delay:.24s;transition:opacity forwards .1s ease}poll-element.animating.is-retracting .poll-answer-selected{transition-delay:0s}poll-element.animating .poll-answer-percents{transition:opacity .34s}poll-element.animating .progress-ring__circle{transition:stroke-dashoffset .15s}poll-element.animating .circle-hover{transition:transform .1s}poll-element.is-multiple .poll-desc{margin-bottom:.5rem}poll-element .c-ripple__circle{background-color:var(--light-primary-color)}@keyframes pollAnswerRotate{to{transform:rotate(270deg)}}.transition>.transition-item{animation-fill-mode:forwards!important;height:100%;left:0;position:absolute;top:0;width:100%}.transition>.transition-item:not(.active):not(.from):not(.to){display:none!important}.transition.zoom-fade>.from{opacity:1;transform:scale(1);transform-origin:center}.transition.zoom-fade>.to{opacity:0;transform-origin:center}.transition.zoom-fade.animating>.from{animation:fade-out-opacity .15s ease}.transition.zoom-fade.animating>.to{animation:fade-in-opacity .15s ease,zoom-fade-in-move .15s ease}.transition.zoom-fade.backwards>.from{transform:scale(1)}.transition.zoom-fade.backwards>.to{transform:scale(.95)}.transition.zoom-fade.backwards.animating>.from{animation:fade-in-backwards-opacity .1s ease,zoom-fade-in-backwards-move .15s ease}.transition.zoom-fade.backwards.animating>.to{animation:fade-out-backwards-opacity .15s ease,zoom-fade-out-backwards-move .15s ease}.transition.slide-fade{--easeOutSine:cubic-bezier(.39,.575,.565,1);--easeInSine:cubic-bezier(.47,0,.745,.715);position:relative}.transition.slide-fade>.from{opacity:1;transform:translateX(0);transform-origin:left center}.transition.slide-fade>.to{opacity:0;transform:translateX(1.5rem);transform-origin:left center}.transition.slide-fade.animating>.from{animation:fade-out-opacity .4s ease-out,slide-fade-out-move .4s}.transition.slide-fade.animating>.to{animation:fade-in-opacity .4s var(--easeInSine),slide-fade-in-move .4s}.transition.slide-fade.backwards>.from{opacity:1;transform:translateX(0)}.transition.slide-fade.backwards>.to{opacity:0;transform:translateX(-1.5rem)}.transition.slide-fade.backwards.animating>.from{animation:fade-in-backwards-opacity .4s ease-out,slide-fade-in-backwards-move .4s}.transition.slide-fade.backwards.animating>.to{animation:fade-out-backwards-opacity .4s var(--easeOutSine),slide-fade-out-backwards-move .4s}@keyframes zoom-fade-in-move{0%{transform:scale(1.1)}to{transform:scale(1)}}@keyframes zoom-fade-in-backwards-move{0%{transform:scale(1)}to{transform:scale(1.1)}}@keyframes zoom-fade-out-backwards-move{0%{transform:scale(.95)}to{transform:scale(1)}}@keyframes slide-fade-in-move{0%{transform:translateX(1.5rem)}to{transform:translateX(0)}}@keyframes slide-fade-out-move{0%{transform:translateX(0)}to{transform:translateX(-1.5rem)}}@keyframes slide-fade-in-backwards-move{0%{transform:translateX(0)}to{transform:translateX(1.5rem)}}@keyframes slide-fade-out-backwards-move{0%{transform:translateX(-1.5rem)}to{transform:translateX(0)}}.row{display:flex;flex-direction:column;justify-content:center;min-height:3.5rem;padding:.4375rem 1rem;position:relative}.row.no-subtitle,.row.row-small{min-height:3rem;padding-bottom:.1875rem;padding-top:.1875rem}body.animation-level-2 .row{transition:opacity var(--transition-standard-in)}.row.is-disabled{opacity:var(--disabled-opacity);pointer-events:none!important}.row.no-wrap{padding-bottom:0!important;padding-top:0!important}.row a{pointer-events:all;position:relative;z-index:1}.row-title-row,.row>.row-title{order:0}[dir=ltr] .row-big{padding-left:1rem;padding-right:.75rem}[dir=rtl] .row-big{padding-left:.75rem;padding-right:1rem}.row-big{min-height:4.5rem;padding-bottom:.5625rem;padding-top:.5625rem}.row-row{align-items:center;display:flex;justify-content:space-between}.row-row .row-subtitle,.row-row .row-title{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row-subtitle-row,.row>.row-subtitle{order:1}.row-title{color:var(--primary-text-color);font-size:var(--font-size);line-height:var(--line-height);overflow:hidden;text-overflow:ellipsis;word-break:break-word}.row-title-right-secondary{color:var(--secondary-text-color)}.row-title-row.with-delimiter .row-title:first-child{border-right:1px solid var(--border-color)}[dir=ltr] .row-subtitle-right,[dir=ltr] .row-title-right{margin-left:1rem}[dir=rtl] .row-subtitle-right,[dir=rtl] .row-title-right{margin-right:1rem}.row-subtitle-right,.row-title-right{flex:0 0 auto!important}.row-midtitle,.row-subtitle,.row-title{pointer-events:none;position:relative}.row-midtitle{font-size:var(--font-size-14);margin-top:.125rem;order:1}[dir=ltr] .row-with-padding{padding-left:4.5rem}[dir=rtl] .row-with-padding{padding-right:4.5rem}@media only screen and (max-width:600px){[dir=ltr] .row-with-padding{padding-left:4rem}[dir=rtl] .row-with-padding{padding-right:4rem}}[dir=ltr] .row-with-padding.tgico:before{left:1rem}[dir=rtl] .row-with-padding.tgico:before{right:1rem}.row-with-padding.tgico:before{color:var(--secondary-text-color);font-size:1.5rem;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);z-index:1}.row-with-padding:not(.row-with-icon):before{display:none}.row-clickable{cursor:pointer;overflow:hidden}@media only screen and (min-width:601px){.row-clickable{border-radius:10px}}[dir=ltr] .row-sortable .row-subtitle,[dir=ltr] .row-sortable .row-title{padding-right:2.5rem}[dir=rtl] .row-sortable .row-subtitle,[dir=rtl] .row-sortable .row-title{padding-left:2.5rem}[dir=ltr] .row-sortable-icon{right:.75rem}[dir=rtl] .row-sortable-icon{left:.75rem}.row-sortable-icon{color:var(--secondary-text-color);font-size:1.5rem;height:1.5rem;line-height:1;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%)}.row-sortable.cant-sort .row-sortable-icon{display:none}.row-sortable.is-dragging{background-color:var(--surface-color)!important;z-index:1}html.no-touch .row-sortable.is-dragging:active,html.no-touch .row-sortable.is-dragging:hover{background-color:var(--light-filled-secondary-text-color)!important}html.no-touch .row-sortable:active .row-sortable-icon,html.no-touch .row-sortable:hover .row-sortable-icon{opacity:1}body.animation-level-2 .is-reordering .row-sortable{transition:transform var(--transition-standard-in)}[dir=ltr] .row .checkbox-field,[dir=ltr] .row .radio-field-main{padding-left:3.375rem}[dir=rtl] .row .checkbox-field,[dir=rtl] .row .radio-field-main{padding-right:3.375rem}[dir=ltr] .row .checkbox-field,[dir=ltr] .row .radio-field-main{margin-left:-3.375rem}[dir=rtl] .row .checkbox-field,[dir=rtl] .row .radio-field-main{margin-right:-3.375rem}.row .checkbox-field,.row .radio-field,.row .radio-field:not(.radio-field-right) .radio-field-main{position:static}.row .checkbox-field,.row .radio-field{--offset-left:1rem}.row .radio-field{margin-bottom:0;margin-top:0}[dir=ltr] .row .checkbox-field{margin-right:0}[dir=rtl] .row .checkbox-field{margin-left:0}.row .checkbox-field{height:auto;margin-bottom:0;margin-top:0}[dir=ltr] .row .checkbox-field .checkbox-caption{padding-left:0}[dir=rtl] .row .checkbox-field .checkbox-caption{padding-right:0}.row .checkbox-field .checkbox-caption{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row .checkbox-field-toggle{margin-left:.125rem;margin-right:.125rem;padding:0}.row-subtitle{color:var(--secondary-text-color)!important;font-size:var(--font-size-14)!important;line-height:var(--line-height-14);margin-top:.1875rem}.row-subtitle:empty{display:none}[dir=ltr] .row-media{left:.75rem}[dir=rtl] .row-media{right:.75rem}.row-media{align-items:center;display:flex;height:2.25rem!important;justify-content:center;margin:0!important;pointer-events:none;position:absolute!important;width:2.25rem!important}[dir=ltr] .row-media-small{left:.75rem!important}[dir=rtl] .row-media-small{right:.75rem!important}.row-media-small{height:2rem!important;width:2rem!important}[dir=ltr] .row-media-abitbigger{left:.75rem!important}[dir=rtl] .row-media-abitbigger{right:.75rem!important}.row-media-abitbigger{height:2.625rem!important;width:2.625rem!important}[dir=ltr] .row-media-big{left:.5rem!important}[dir=rtl] .row-media-big{right:.5rem!important}.row-media-big{height:3rem!important;width:3rem!important}[dir=ltr] .row-media-bigger{left:.5625rem!important}[dir=rtl] .row-media-bigger{right:.5625rem!important}.row-media-bigger{height:3.375rem!important;width:3.375rem!important}.row.menu-open{background-color:var(--light-secondary-text-color)}[dir=ltr] .row>.btn-primary{right:1rem}[dir=rtl] .row>.btn-primary{left:1rem}.row>.btn-primary{border-radius:.9375rem;font-size:.9375rem;height:1.875rem;line-height:1.875rem;margin:0;padding-left:.75rem;padding-right:.75rem;position:absolute;top:50%;transform:translateY(-50%);width:auto}body.animation-level-2 .row>.btn-primary{transition:width .2s,background-color .2s,color .2s}.row>.btn-primary.active{background-color:var(--light-primary-color)!important;color:var(--primary-color)}.row.accordion-toggler .checkbox-field-toggle{pointer-events:all!important}.color-picker{margin:1.1875rem auto .25rem;max-width:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:380px}@media only screen and (max-width:600px){.color-picker{padding:0 .75rem}}.color-picker-box{height:198px;width:100%}.color-picker-box,.color-picker-color-slider,.color-picker-dragger{overflow:visible!important}.color-picker-sliders{margin:1rem 0 1.125rem}.color-picker-dragger{cursor:grab}.color-picker-inputs{display:flex}.color-picker-inputs .input-field{flex:1 1 auto}.color-picker-inputs .input-field:not(:first-child){margin-left:1.25rem}.reply-keyboard{background:var(--surface-color);border-radius:10px;bottom:calc(100% + .625rem);box-shadow:0 5px 10px 5px rgba(16,35,47,.14);display:flex!important;flex-direction:column;max-height:26.25rem;max-width:100%;opacity:0;overflow:hidden;padding:0!important;position:absolute!important;right:0;transform:scale(0);transform-origin:bottom right;transition:transform var(--esg-transition),opacity var(--esg-transition);width:26.25rem!important;z-index:3}@media only screen and (max-height:569px),only screen and (max-width:600px){.reply-keyboard{bottom:calc(100% + .5rem)}}.reply-keyboard.active{opacity:1;transform:scale(1)}body.animation-level-0 .reply-keyboard{transition:none}.reply-keyboard-row{display:flex}.reply-keyboard-row+.reply-keyboard-row{margin-top:.3125rem}.reply-keyboard-button{background-color:transparent;border:2px solid var(--primary-color);border-radius:.375rem;color:var(--primary-color);font-size:.9375rem;font-weight:var(--font-weight-bold);height:3rem;text-align:center;width:100%}body.animation-level-2 .reply-keyboard-button{transition:color .15s,background-color .15s}html.no-touch .reply-keyboard-button:active,html.no-touch .reply-keyboard-button:hover{background-color:var(--primary-color);color:#fff}.reply-keyboard-button+.reply-keyboard-button{margin-left:.3125rem}.reply-keyboard .scrollable-y{bottom:auto;height:auto;left:auto;max-height:100%;padding:.625rem!important;position:relative;right:auto;top:auto}.peoplenearby-container div.text.nearby-description{color:var(--primary-text-color);margin-top:15px;text-align:center}.peoplenearby-container div.text.nearby-error{color:var(--gc-secondary-text-color);margin-top:10px;text-align:center}.peoplenearby-container .locating-animation-container{align-items:center;display:flex;justify-content:center;min-height:140px;width:100%}.peoplenearby-container .locating-animation-container .tgico.tgico-location{align-items:center;background:var(--avatar-color-bottom);border-radius:50%;display:flex;height:140px;justify-content:center;padding:50px;width:140px}.peoplenearby-container .locating-animation-container .tgico.tgico-location:before{color:#fff;font-size:58px}.peoplenearby-container .locating-animation-container .locating-animation-waves{position:fixed}.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-1,.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-3{animation:waves-animation 3s infinite;border:5px solid #fff;border-radius:50%;-webkit-clip-path:polygon(72% 0,100% 0,100% 100%,72% 100%);clip-path:polygon(72% 0,100% 0,100% 100%,72% 100%);height:50px;margin-left:36px;width:50px}.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-2,.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-4{animation:waves-animation 5s infinite;animation-delay:2s;border:5px solid #fff;border-radius:50%;-webkit-clip-path:polygon(72% 0,100% 0,100% 100%,72% 100%);clip-path:polygon(72% 0,100% 0,100% 100%,72% 100%);height:71px;margin-left:51px;margin-top:1px;width:66px}.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-3{margin-left:-36px!important;transform:rotateY(180deg)}.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-4{margin-left:-51px!important;transform:rotateY(180deg)}@keyframes waves-animation{0%{opacity:1}50%{opacity:0}to{opacity:1}}.spoiler{--anim:.4s ease;background-color:var(--spoiler-background-color)}.spoiler-text{opacity:0}.spoilers-container .custom-emoji-canvas{z-index:-1}.spoilers-container.is-spoiler-visible.animating .spoiler{transition:background-color var(--anim)}.spoilers-container.is-spoiler-visible.animating .spoiler-text{transition:opacity var(--anim)}.spoilers-container.is-spoiler-visible:not(.backwards) .spoiler{background-color:transparent}.spoilers-container.is-spoiler-visible:not(.backwards) .spoiler-text{opacity:1}.spoilers-container:not(.is-spoiler-visible) .spoiler{cursor:pointer}.spoilers-container:not(.is-spoiler-visible) .spoiler-text{pointer-events:none}.emoji-animation,.emoji-animation-container{pointer-events:none;position:absolute}.emoji-animation-container{bottom:0;left:0;overflow:hidden;right:0;top:0;z-index:3}.reactions-block{display:flex;flex-wrap:wrap;-webkit-user-select:none;-moz-user-select:none;user-select:none}.reactions-block.has-no-reactions{display:inline;display:initial}.reactions-inline{display:inline-flex}.reactions-inline:not(:empty){margin-right:.125rem}.reaction,.reaction-sticker{align-items:center;display:flex}.reaction-sticker{--custom-emoji-size:var(--reaction-size);height:var(--reaction-size);justify-content:center;position:relative;width:var(--reaction-size)}.reaction-sticker-activate{bottom:var(--reaction-offset);left:var(--reaction-offset);position:absolute;right:var(--reaction-offset);top:var(--reaction-offset);z-index:1}.reaction-sticker.has-animation>.media-sticker{opacity:0}.reaction-sticker:not(.is-static):not(.is-custom) .media-sticker{--size:calc(var(--reaction-size) + var(--reaction-offset)*-2);bottom:auto;height:var(--size)!important;left:auto;max-height:var(--size);max-width:var(--size);right:auto;top:auto;width:var(--size)!important}.reaction-sticker.is-custom{border-radius:.3125rem}.reaction-sticker.is-custom .custom-emoji,.reaction-sticker.is-custom .media-sticker{border-radius:inherit}.reaction-sticker.is-custom .custom-emoji-canvas{z-index:auto}.reaction-inline{--reaction-size:.875rem;--reaction-offset:-.4375rem;min-height:var(--reaction-size);min-width:var(--reaction-size)}.reaction-inline .reaction-counter{font-size:inherit!important;margin-right:.0625rem!important;order:-1}.reaction-block{--additional-height:.5rem;--margin:.375rem;--reaction-size:1.375rem;--reaction-offset:-.5625rem;--background-color:var(--message-highlightning-color);--chosen-background-color:var(--message-primary-color);--counter-color:#fff;--reaction-total-size:calc(var(--reaction-size) + var(--additional-height));background-color:var(--background-color);border-radius:var(--reaction-total-size);color:var(--counter-color);cursor:pointer;height:var(--reaction-total-size);margin-right:var(--margin);margin-top:var(--margin);padding:0 .5rem;position:relative}html.no-touch .reaction-block:active:after,html.no-touch .reaction-block:hover:after{background-color:var(--chosen-background-color);border-radius:inherit;bottom:0;content:" ";left:0;opacity:.08;position:absolute;right:0;top:0}.reaction-block .reaction-counter,.reaction-block .reaction-sticker{z-index:1}.reaction-block:last-child{margin-right:0}.reaction-block:before{background-color:var(--chosen-background-color);border-radius:inherit;bottom:0;content:" ";left:0;opacity:0;position:absolute;right:0;top:0;transform:scale(0)}.reaction-block.is-chosen:not(.backwards):before{opacity:1;transform:scale(1)}.reaction-block.is-chosen:not(.backwards) .stacked-avatars{--border-color:var(--chosen-background-color)}.reaction-block.is-chosen.animating:before{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.reaction-block.is-chosen.animating .reaction-counter{transition:color var(--transition-standard-in)}.reaction-block.is-chosen.animating .stacked-avatars-avatar-container{transition:border-color var(--transition-standard-in)}.reaction-block .stacked-avatars{--border-color:transparent;--border-size:.125rem;--margin-right:-.875rem;margin-left:.1875rem}.reaction-block .reaction-counter{font-size:.9375rem!important;font-weight:var(--font-weight-bold);line-height:1.125rem;margin:0 .0625rem 0 .375rem;position:relative}.stacked-avatars{--border-color:var(--surface-color);--border-size:1px;--margin-right:-.3125rem;--avatar-size:1rem;--avatar-total-size:calc(var(--avatar-size) + var(--border-size)*2);display:flex;flex-direction:row-reverse}.stacked-avatars-avatar{height:var(--avatar-size);width:var(--avatar-size);z-index:0}.stacked-avatars-avatar-container{align-items:center;border:var(--border-size) solid var(--border-color);border-radius:50%;display:flex;height:var(--avatar-total-size);justify-content:center;position:relative;width:var(--avatar-total-size)}.stacked-avatars-avatar-container:not(:first-child){margin-right:var(--margin-right)}.sticker-viewer{align-items:center;bottom:0;display:flex;justify-content:center;left:0;pointer-events:none;position:fixed;right:0;top:0;z-index:4}.sticker-viewer:before{background-color:rgba(0,0,0,.6);bottom:0;content:" ";left:0;opacity:0;position:absolute;right:0;top:0}body.animation-level-2 .sticker-viewer:before{transition:opacity var(--sticker-viewer-open-transition-out)}.sticker-viewer.is-visible:not(.backwards):before{opacity:1}body.animation-level-2 .sticker-viewer.is-visible:not(.backwards):before{transition:opacity var(--sticker-viewer-open-transition-in)}.sticker-viewer.is-visible:not(.backwards) .sticker-viewer-transformer:not(.is-switching){transform:translateX(var(--translateX)) scale(1)!important}body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .sticker-viewer-transformer:not(.is-switching){transition:transform var(--sticker-viewer-open-transition-in)}.sticker-viewer.is-visible:not(.backwards) .emoji-animation,.sticker-viewer.is-visible:not(.backwards) .sticker-viewer-emoji,.sticker-viewer.is-visible:not(.backwards) .sticker-viewer-sticker{opacity:1}body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .emoji-animation,body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .sticker-viewer-emoji,body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .sticker-viewer-sticker{transition:opacity var(--sticker-viewer-open-transition-in)}body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .sticker-viewer-sticker:not(.is-overflow){transition:opacity 0s}.sticker-viewer-transformer{--translateX:0;align-items:center;display:flex;height:360px;justify-content:center;position:absolute;width:360px}.sticker-viewer-transformer.has-effect{height:280px;width:280px}.sticker-viewer-transformer.has-effect .sticker-viewer-emoji{top:-5.5rem}body.animation-level-2 .sticker-viewer-transformer{transition:transform var(--sticker-viewer-open-transition-out)}.sticker-viewer-transformer.is-switching{opacity:1!important;transform:translateX(var(--translateX)) scale(1)!important}body.animation-level-2 .sticker-viewer-transformer.is-switching{transition:transform var(--sticker-viewer-switch-transition),opacity var(--sticker-viewer-switch-transition)!important}.sticker-viewer-transformer.is-switching:not(.backwards){opacity:0!important;transform:scale(.4) translateX(var(--translateX))!important}.sticker-viewer-emoji{position:absolute;top:-3rem;transform:translateX(var(--translateX)) scale(2)}.sticker-viewer-sticker{position:absolute}.sticker-viewer .emoji-animation,.sticker-viewer-emoji,.sticker-viewer-sticker{opacity:0}body.animation-level-2 .sticker-viewer .emoji-animation,body.animation-level-2 .sticker-viewer-emoji,body.animation-level-2 .sticker-viewer-sticker{transition:opacity var(--sticker-viewer-open-transition-out)}.custom-emoji{display:inline;height:var(--custom-emoji-size)!important;min-height:var(--custom-emoji-size)!important;min-width:var(--custom-emoji-size)!important;position:relative;width:var(--custom-emoji-size)!important}.custom-emoji:before{content:" ";display:inline-block;height:inherit;min-height:inherit;min-width:inherit;width:inherit}.custom-emoji .media-sticker,.custom-emoji .rlottie{height:inherit!important;margin:0;max-height:inherit!important;max-width:inherit!important;pointer-events:none;text-indent:-9999px;width:inherit!important}.custom-emoji-canvas{height:100%;width:100%}.custom-emoji-canvas,.custom-emoji-renderer{bottom:0;left:0;position:absolute;right:0;top:0}.custom-emoji-renderer{pointer-events:none}.custom-emoji-placeholder{display:inline;height:var(--messages-custom-emoji-size);margin-top:-.125rem;vertical-align:middle;width:var(--messages-custom-emoji-size)}.usernames-username-icon{background-color:var(--secondary-color);border-radius:50%;color:#fff;font-size:1.25rem}.usernames-username-icon:before{content:""}.usernames-username.active .usernames-username-status{color:var(--primary-color)!important}.usernames-username.active .usernames-username-icon{background-color:var(--primary-color)}.topics-slider{bottom:0;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0}.topics-container{--offset:0;--width:100%;background-color:var(--surface-color)!important;width:var(--width)!important}.topics-container.is-floating{--offset:5.0625rem;--width:calc(var(--left-column-width) - var(--offset));border-left:1px solid var(--border-color);bottom:0;overflow:visible!important;overflow:initial!important;pointer-events:all;position:absolute;right:0;top:0;transform:translateX(var(--width));z-index:3}.topics-container.is-visible:not(.backwards){transform:translateX(0)}.topics-container.is-visible.animating{transition:transform var(--transition-standard-in)}.topics-container.is-visible.animating.backwards{transition:transform var(--transition-standard-out)}.topics-container .sidebar-header{padding:0 .75rem}.topics-container .sidebar-header__rows{flex:1 1 auto;overflow:hidden;padding-left:.5rem}.topics-container .sidebar-header__rows .sidebar-header__title{font-size:var(--font-size-16);line-height:var(--line-height-16);margin-bottom:.125rem;padding-left:0!important}.topics-container .sidebar-header__subtitle,.topics-container .sidebar-header__title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topics-container .sidebar-header__subtitle{color:var(--secondary-text-color);font-size:var(--font-size-14);line-height:var(--line-height-14)}.topics-container .chatlist-chat{min-height:4rem;padding-left:.75rem}.topic-name .topic-icon{margin-right:.25rem}.topic-name-button{--color:var(--primary-color);align-items:center;color:var(--color);cursor:pointer;display:flex;font-weight:var(--font-weight-bold);height:1.5rem;justify-content:center;max-width:100%;padding:0 .5rem;position:relative;text-decoration:none!important}.topic-name-button-container{align-items:flex-start;display:flex!important;justify-content:flex-start}.topic-name-button .peer-title,.topic-name-button .topic-name{position:relative}.topic-name-button:before{background-color:var(--color);border-radius:1.5rem;bottom:0;content:" ";left:0;opacity:.08;position:absolute;right:0;top:0}html.no-touch .topic-name-button:active:before,html.no-touch .topic-name-button:hover:before{opacity:.16}.topic-icon{--size:1.25rem;--custom-emoji-size:var(--size);display:inline-flex;font-size:calc(var(--size)/2);justify-content:center;line-height:1.875!important;position:relative;vertical-align:middle}.topic-icon-general{fill:var(--secondary-color);height:var(--size);width:var(--size)}.topic-icon-svg{height:inherit;position:absolute;width:inherit}.topic-icon-content{position:relative}.edit-topic-container .scrollable-y{display:flex;flex-direction:column}.edit-topic-icon{position:absolute}.edit-topic-icon .topic-icon{--size:4rem}.edit-topic-icon-container{align-items:center;cursor:pointer;display:flex;height:100px;justify-content:center;margin:0 auto;position:relative;width:100px}.edit-topic-emoticons-container{flex:1 1 auto}.edit-topic-emoticons-container .sidebar-left-section{height:100%;padding:0!important}.edit-topic-emoticons-container .emoji-padding{display:flex;flex-direction:column}.edit-topic-emoticons-container .super-emoji-topic-icon .topic-icon{--size:var(--esg-emoji-size);--custom-emoji-size:inherit;margin-left:calc((var(--custom-emoji-size) - var(--esg-emoji-size))/2)}.themes-container{align-items:center;display:flex;height:6.5rem;position:relative}@media only screen and (min-width:601px){.themes-container{margin:0 -.5rem;padding:0;width:calc(100% + 1rem)}}.themes-container:after,.themes-container:before{content:" ";display:block;flex:0 0 auto;height:.5rem;width:.5rem}.theme-container{border-radius:10px;cursor:pointer;display:flex;flex:0 0 auto;height:calc(100% - .5rem);justify-content:center;margin:0 .25rem;position:relative;width:4.5rem}.theme-container:before{border:2px solid var(--primary-color);border-radius:14px;bottom:-4px;content:" ";left:-4px;opacity:0;position:absolute;right:-4px;top:-4px;transform:scale(.86)}html.is-safari .theme-container:before{transform:none!important}body.animation-level-2 .theme-container:before{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.theme-container.active{pointer-events:none}.theme-container.active:before{opacity:1;transform:scale(1)}.theme-container .background-item{border-radius:inherit;height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.theme-emoticon{bottom:.5rem;height:1.75rem;pointer-events:none;position:absolute;width:1.75rem;z-index:1}html:not(.is-safari) .theme-emoticon{transform:scale(1);transform-origin:center bottom}body.animation-level-2 .theme-emoticon{transition:transform var(--transition-standard-in)}.theme-bubble{background-color:#fff;border-radius:1.75rem;height:1.25rem;pointer-events:none;position:absolute;width:2.5rem}.theme-bubble.is-out{background-color:var(--light-filled-message-out-primary-color);right:.375rem;top:.5rem}.theme-bubble.is-in{background-color:var(--message-background-color);left:.375rem;top:2rem}.popup{background-color:rgba(0,0,0,.3);bottom:0;box-shadow:none;display:flex;left:0;margin:0;max-width:none;opacity:0;overflow:auto;padding:1.875rem;position:fixed!important;right:0;top:0;transition-delay:0s,var(--popup-transition-time);transition-duration:var(--popup-transition-time),0s;transition-property:opacity,visibility;transition-timing-function:var(--popup-transition-function);-webkit-user-select:none;-moz-user-select:none;user-select:none;visibility:hidden;z-index:3}.popup.no-overlay{background-color:transparent;overflow:visible;padding:0}body.animation-level-0 .popup{transition:none}.popup.active{opacity:1;transition-delay:0s,0s;visibility:visible;z-index:4}.popup.active .popup-container,.popup.hiding .popup-container{transform:translate3d(var(--translateX),0,0)}[dir=ltr] .popup-title{padding-left:1.5rem;padding-right:1rem}[dir=rtl] .popup-title{padding-left:1rem;padding-right:1.5rem}.popup-title{flex:1;font-size:1.25rem;font-weight:var(--font-weight-bold);line-height:1;margin:0}.popup-title:first-child{padding-left:0}.popup-container{--translateX:0;-webkit-backface-visibility:hidden;backface-visibility:hidden;background-color:var(--surface-color);border-radius:10px;display:flex;flex-direction:column;margin:auto;overflow:hidden;padding:1rem;position:relative;transform:translate3d(var(--translateX),3rem,0);transition:transform var(--popup-transition-time) var(--popup-transition-function)}body.animation-level-0 .popup-container{transition:none}.popup-description .peer-title{font-weight:var(--font-weight-bold)}.popup-centerer{margin:auto}.popup-close{flex:0 0 auto;justify-self:center;z-index:3}.popup-header{align-items:center;display:flex;flex:0 0 auto;margin-bottom:2rem;position:relative}.popup-body{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.popup-body .scrollable{position:relative}.popup-buttons{align-items:center;display:flex;flex-direction:row-reverse;height:3rem;justify-content:flex-start;padding:0 .5rem}.popup-buttons .btn{border-radius:10px;font-weight:var(--font-weight-bold);height:2.5rem;max-width:100%;overflow:hidden;padding:0 1rem;position:relative;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}[dir=ltr] .popup-buttons .btn+.btn{margin-right:.625rem}[dir=rtl] .popup-buttons .btn+.btn{margin-left:.625rem}.popup-avatar .popup-container{max-width:600px;padding:15px 16px 16px 24px}.popup-avatar .popup-container>button{bottom:20px;position:absolute;right:20px}.popup-avatar .popup-close{font-size:1.5rem;margin-top:4px}.popup-avatar .popup-header{margin-bottom:1px}[dir=ltr] .popup-avatar h6{text-align:left}[dir=rtl] .popup-avatar h6{text-align:right}.popup-avatar h6{font-size:1.25rem;margin:0 0 0 2rem}.popup-avatar .crop{border-radius:8px;max-height:100%;max-width:100%;padding:24px 54px 46px 46px}.popup-avatar .crop>img{display:none}.popup-avatar .crop img{border-radius:8px}.popup-new-media .popup-container{max-height:100%;max-width:420px;padding:12px 20px 32.5px;width:420px}.popup-new-media .popup-container img,.popup-new-media .popup-container video{border-radius:inherit}.popup-new-media .popup-header{align-items:center;flex:0 0 auto;flex-wrap:wrap;justify-content:space-between;margin-bottom:9px;padding:12px 20px 15px;position:relative}.popup-new-media .popup-header .btn-primary{border-radius:10px;font-size:var(--font-size-14);height:2.25rem;line-height:2.25rem;padding:0 1.375rem;text-transform:uppercase;width:auto}.popup-new-media .popup-close{margin:-1px 0 0 -4px}.popup-new-media .popup-photo{border-radius:10px;max-width:100%;overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.popup-new-media .scrollable{position:relative}.popup-new-media .input-field{flex:0 0 auto;margin-top:25px;width:100%}.popup-new-media .input-field-input{border-radius:10px;font-size:1rem}.popup-new-media .input-field-input[data-placeholder]:not(:focus):empty~label{opacity:0}.popup-new-media .input-field label{font-size:inherit}.popup-new-media .btn-menu-overlay{z-index:3}.popup-new-media .menu-send{top:calc(100% + .25rem);z-index:4}.popup-new-media.popup-send-photo .popup-container{max-width:25rem;padding:0;width:25rem}.popup-new-media.popup-send-photo .popup-container.border-top-offset .popup-input-container{overflow:visible;overflow:initial}.popup-new-media.popup-send-photo .popup-container.border-top-offset .popup-input-container:before{top:-8px}.popup-new-media.popup-send-photo .menu-send{bottom:3.5rem;right:.5rem;top:auto}.popup-new-media.popup-send-photo .popup-header{height:3.5rem;margin:0;padding:0 1rem}[dir=ltr] .popup-new-media.popup-send-photo .popup-title{padding-left:1.5rem}[dir=rtl] .popup-new-media.popup-send-photo .popup-title{padding-right:1.5rem}.popup-new-media.popup-send-photo .popup-close{margin:0}.popup-new-media.popup-send-photo .popup-body{position:relative}.popup-new-media.popup-send-photo .popup-body .scrollable{padding:0 .5rem}.popup-new-media.popup-send-photo .input-message-container{max-height:inherit;min-height:inherit}.popup-new-media.popup-send-photo .input-message-input{max-height:inherit!important}.popup-new-media.popup-send-photo .btn-primary{flex:0 0 auto;height:2.5rem;line-height:2.5rem;margin-bottom:.5rem;padding:0 1rem;text-transform:uppercase;width:auto}.popup-new-media.popup-send-photo .popup-input-container{--height:3.5rem;--max-height:8.375rem;align-items:flex-end;display:flex;flex:0 0 auto;justify-content:space-between;max-height:var(--max-height);min-height:var(--height);overflow:hidden;padding:0 .5rem;position:relative}.popup-new-media.popup-send-photo .popup-input-container:before{background-color:var(--border-color);content:" ";height:1px;left:0;opacity:0;position:absolute;right:0;top:0}body.animation-level-2 .popup-new-media.popup-send-photo .popup-input-container:before{transition:opacity var(--transition-standard-in)}.popup-new-media.popup-send-photo .popup-input-container.has-border-top:before{opacity:1}.popup-new-media.popup-send-photo .checkbox-field{margin-bottom:0;margin-left:0}.popup-new-media.popup-send-photo .popup-item-album{position:relative}.popup-new-media.popup-send-photo .popup-item-album .album-item{position:absolute}.popup-new-media.popup-send-photo .popup-item-album img,.popup-new-media.popup-send-photo .popup-item-album video{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.popup-new-media.popup-send-photo .popup-photo>.popup-item-media{display:flex;justify-content:center;margin:0 auto}.popup-new-media.popup-send-photo .popup-photo>.popup-item-media img{-o-object-fit:contain;object-fit:contain}.popup-new-media.popup-send-photo .popup-photo>.popup-item{border-radius:inherit;overflow:hidden;position:relative}.popup-new-media.popup-send-photo .popup-photo>.popup-item+.popup-item{margin-top:.5rem}.popup-new-media.popup-send-photo .drop{border-radius:0}.popup-new-media.popup-send-photo .audio,.popup-new-media.popup-send-photo .document{--icon-margin:.5rem;--icon-size:3rem;--padding:.25rem;border-radius:10px;cursor:default;height:3.5rem;margin:0 .25rem}html.no-touch .popup-new-media.popup-send-photo .audio:active,html.no-touch .popup-new-media.popup-send-photo .audio:hover,html.no-touch .popup-new-media.popup-send-photo .document:active,html.no-touch .popup-new-media.popup-send-photo .document:hover{--message-background-color:var(--light-filled-secondary-text-color);background-color:var(--light-secondary-text-color)}.popup-new-media.popup-send-photo .document{max-width:100%;overflow:hidden}.popup-new-media.popup-send-photo .document.document-with-thumb{--icon-size:4.5rem;height:5rem}.popup-new-media.popup-send-photo .document-name{line-height:1.5;margin-bottom:.125rem;max-width:100%;overflow:hidden;text-overflow:ellipsis;width:100%}.popup-new-media.popup-send-photo .document-ico{border-radius:5px;font-size:16px;font-weight:400;letter-spacing:0;line-height:11px}.popup-create-contact .popup-container{padding:0 1rem 1rem!important}.popup-create-contact .popup-header{padding:0!important}.popup-create-contact .btn-primary{margin-bottom:0!important}.popup-create-contact .name-fields{display:flex;flex-direction:column;margin-top:1rem;padding-left:116px;position:relative}.popup-create-contact .name-fields .input-field:first-child{margin-top:0}.popup-create-contact .avatar-placeholder{left:0;position:absolute;top:50%;transform:translateY(-50%)}.popup-peer .popup-header{align-items:center;display:flex;height:2.5rem;margin:0;padding:0 1rem;width:-moz-max-content;width:max-content}.popup-peer .popup-container{max-width:min(400px,100%);min-width:min(100%,17.5rem);padding:.75rem .5rem;width:-moz-min-content;width:min-content}.popup-peer .popup-title{font-size:1.25rem;font-weight:var(--font-weight-bold)}.popup-peer .popup-title:not(:first-child){padding-left:1rem}.popup-peer .popup-description{line-height:var(--line-height);margin-bottom:0;margin-top:0;max-width:-moz-fit-content;max-width:fit-content;min-width:min(100%,15rem);overflow:hidden;padding:.625rem 1rem .5rem;text-overflow:ellipsis;word-break:break-word}.popup-peer .checkbox-field{align-items:center;display:flex;height:auto;margin:0;min-height:3rem;padding:.25rem 1.125rem}.popup-peer .checkbox-field .checkbox-box{left:auto}.popup-stickers{-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-stickers .sticker-set-footer{color:var(--primary-color);text-align:center}.popup-stickers .sticker-set-footer .btn-primary{height:44px;line-height:44px;padding:0 1.0625rem;text-transform:uppercase;width:auto}.popup-stickers .scrollable.is-loading{min-height:9rem;position:relative}.popup-stickers .sticker-set-footer{padding:8px 0}.popup-stickers .super-emojis{padding:0 .5rem}.popup-stickers .popup-container{max-height:420px;max-width:420px;padding:0;width:420px}[dir=ltr] .popup-stickers .popup-close{margin-left:1rem}[dir=rtl] .popup-stickers .popup-close{margin-right:1rem}.popup-stickers .popup-close{font-size:1.5rem}.popup-stickers .popup-header{flex:0 0 auto;margin:.625rem 0}.popup-stickers .sticker-set{margin:.0625rem 0}.popup-stickers .sticker-set .row-title{font-weight:var(--font-weight-bold)}.popup-stickers .sticker-set-stickers{--per-row:5;--item-size:var(--popup-sticker-size);display:grid;grid-template-columns:repeat(var(--per-row),1fr);padding:0 5px;position:relative}@media only screen and (max-width:600px){.popup-stickers .sticker-set-stickers{--per-row:4}}.popup-stickers .sticker-set-stickers .media-sticker-wrapper{cursor:pointer;height:var(--item-size);justify-self:center;margin-bottom:2px;position:relative;width:var(--item-size)}@media only screen and (max-width:600px){.popup-stickers .sticker-set-stickers .media-sticker-wrapper{margin-bottom:8px}}.popup-stickers .sticker-set-stickers .media-sticker-wrapper:hover{background-color:var(--light-secondary-text-color);border-radius:12px}.popup-date-picker{-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-date-picker .popup-container{padding:12px 14px}@media(min-height:470px){.popup-date-picker .popup-container[data-lines="7"]{top:19px}.popup-date-picker .popup-container[data-lines="5"]{top:-19px}}.popup-date-picker .popup-header{margin-bottom:1.375rem;margin-left:6px;margin-top:4px}.popup-date-picker .popup-title{font-size:20px;font-weight:var(--font-weight-bold)}.popup-date-picker .popup-buttons{margin-right:-2px;order:2}.popup-date-picker .popup-buttons button+button{margin-left:9px;margin-top:0}.popup-date-picker .date-picker-controls{align-items:center;display:flex;justify-content:space-between}.popup-date-picker .date-picker-controls .date-picker-month-title{font-size:14px;font-weight:var(--font-weight-bold)}.popup-date-picker .date-picker-prev{transform:rotate(90deg)}.popup-date-picker .date-picker-next{transform:rotate(-90deg)}.popup-date-picker .date-picker-next:disabled,.popup-date-picker .date-picker-prev:disabled{visibility:hidden}.popup-date-picker .date-picker-months{margin-bottom:1.5rem;margin-top:7px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-date-picker .date-picker-month{display:grid;grid-template-columns:repeat(7,1fr);justify-content:center;width:100%}.popup-date-picker .date-picker-month .btn-icon{align-items:center;color:var(--secondary-text-color);display:flex;font-size:12px;height:38px;justify-content:center;justify-self:center;width:38px}.popup-date-picker .date-picker-month .btn-icon:disabled{opacity:1}.popup-date-picker .date-picker-month-date:disabled{opacity:.7!important}.popup-date-picker .date-picker-month .btn-icon:not(:disabled){color:var(--primary-text-color)}.popup-date-picker .date-picker-month .btn-icon.active{background-color:var(--primary-color)!important;border-radius:50%;color:var(--badge-text-color)}.popup-schedule .popup-header{justify-content:space-between;margin-bottom:17px;margin-left:0;margin-top:5px}@media only screen and (max-width:600px){.popup-schedule .popup-header{margin-left:3px}}.popup-schedule .popup-header .btn-icon{font-size:22px}.popup-schedule .popup-container{min-width:420px;padding:4px 16px 16px;width:420px}@media only screen and (max-width:600px){.popup-schedule .popup-container{min-width:312px;padding:4px 14px 14px;width:312px}}.popup-schedule .popup-container[data-lines="5"]{top:-16px}.popup-schedule .popup-container[data-lines="7"]{top:16px}.popup-schedule .date-picker-month{margin-left:2px;margin-right:-20px;width:auto}@media only screen and (max-width:600px){.popup-schedule .date-picker-month{margin-left:0;margin-right:-6px}}.popup-schedule .date-picker-month-title{font-size:20px;font-weight:var(--font-weight-bold);margin-left:-5rem}@media only screen and (max-width:600px){.popup-schedule .date-picker-month-title{margin-left:-2rem}}.popup-schedule .date-picker-month .btn-icon{font-size:14px;font-weight:var(--font-weight-bold);height:36px;justify-self:auto;margin-top:-4px;width:36px}.popup-schedule .date-picker-month-date:disabled{color:#9ba3a8!important}.popup-schedule .date-picker-month-day{color:var(--primary-text-color)!important;font-size:14px!important;font-weight:var(--font-weight-bold)}.popup-schedule .date-picker-months{margin-bottom:14px}@media only screen and (max-width:600px){.popup-schedule .date-picker-months{margin-bottom:13px}}.popup-schedule .date-picker-time{display:flex;justify-content:center;margin-bottom:1.5rem}@media only screen and (max-width:600px){.popup-schedule .date-picker-time{margin-bottom:22px}}.popup-schedule .date-picker-time .input-field{width:80px}.popup-schedule .date-picker-time .input-field-input{text-align:center}.popup-schedule .date-picker-time-delimiter{padding:14px 20px}.popup-schedule .date-picker-controls .btn-icon:disabled{visibility:visible}.popup-schedule .btn-primary{font-weight:400}@media only screen and (max-width:600px){.popup-schedule .btn-primary{widtH:280px;height:50px;margin-left:2px}}.popup-create-poll .popup-container{max-height:min(640px,100%);padding:0}.popup-create-poll .radio-field{margin:0}.popup-create-poll .radio-field .radio-field-main:before{left:.25rem}.popup-create-poll .radio-field .radio-field-main:after{left:.5625rem}.popup-create-poll .hidden-widget .btn-icon,.popup-create-poll .radio-field:first-child:last-child .btn-icon{opacity:0!important;pointer-events:none}.popup-create-poll .input-field .btn-icon{opacity:1;position:absolute;right:.4375rem;top:.4375rem;transition:opacity .2s ease;z-index:1}@media only screen and (max-width:600px){.popup-create-poll .input-field .btn-icon{right:.3125rem;top:.3125rem}}.popup-create-poll .caption{color:var(--secondary-text-color);font-weight:var(--font-weight-bold);padding:1rem 1.5rem 0}.popup-create-poll .poll-create-questions{padding:0 1.25rem 1.5rem}.popup-create-poll .poll-create-questions:not(:last-child) .input-field-input{padding-right:3.25rem}.popup-create-poll .poll-create-settings{padding:0 .5rem .5rem}.popup-create-poll .subtitle{font-size:.875rem;line-height:1.2;margin-top:.875rem}.popup-create-poll .btn-primary{width:94px}.popup-create-poll .menu-send{right:20px;top:54px}.popup-create-poll hr:not(.hide){display:block!important}.popup-forward .popup-container{height:40.625rem;max-height:min(40.625rem,100%);max-width:420px;padding:7px 0 0;width:420px}.popup-forward .popup-header{flex:0 0 auto;margin-bottom:7px;padding:0 1rem}@media only screen and (max-width:600px){.popup-forward .popup-header{padding-left:.8125rem}}.popup-forward .popup-title{flex-grow:1;height:100%;padding:0}.popup-forward .chatlist-container,.popup-forward .selector{display:flex;flex:1 1 auto;flex-direction:row;height:auto;overflow:hidden;width:100%}.popup-forward .selector-search-input{font-size:var(--font-size-20);height:100%;line-height:1;padding:.5rem 1.5rem;width:100%}@media only screen and (max-width:600px){.popup-forward .selector-search-input{padding-left:1.1875rem}}.popup-forward .selector .chatlist{margin-top:0!important}.popup-forward .gradient-delimiter{display:none}.popup-forward .sidebar-left-section{margin-bottom:0!important;padding-top:0!important}.popup-instance-deactivated{background-color:rgba(0,0,0,.6)}.popup-instance-deactivated .instance-deactivated-container{margin:auto;pointer-events:none;text-align:center}.popup-instance-deactivated .header{color:#fff;font-size:2rem}.popup-instance-deactivated .subtitle{color:#fff;font-size:1.5rem;line-height:var(--line-height);opacity:.6}.popup-join-chat-invite{-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-join-chat-invite .popup-container{max-width:420px}.popup-join-chat-invite .popup-body{align-items:center;padding:.5rem 0 1.25rem}.popup-join-chat-invite .chat-title{font-weight:var(--font-weight-bold);line-height:var(--line-height);margin:.75rem 0 .25rem}.popup-join-chat-invite .chat-participants-count{color:var(--secondary-text-color);font-size:.875rem;line-height:var(--line-height)}.popup-join-chat-invite .request-caption{margin-top:1rem;text-align:center}.popup-report-messages-confirm{-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-report-messages-confirm .media-sticker-wrapper{height:100px;margin:0 auto;position:relative;width:100px}.popup-report-messages-confirm .popup-body{margin:1rem 0 .375rem;overflow:visible;overflow:initial}.popup-report-messages-confirm .popup-description{font-size:.875rem;text-align:center}.popup-report-messages-confirm .popup-buttons{margin-top:.625rem}.popup-report-messages-confirm .input-field{width:100%}.popup-call .popup-header{justify-content:space-between;width:100%}.popup-call .popup-title{flex:1 1 auto}.call{align-items:center;color:#fff;height:100%;width:100%}.call.is-full-screen,html.is-mobile .call{border-radius:0}.call.is-full-screen:not(.show-controls){cursor:none}.call.no-video .call-button,.call.no-video .call-button-text,.call.no-video .call-emojis,.call.no-video .call-party-state,.call.no-video .call-subtitle,.call.no-video .call-title,.call.no-video .popup-header,.call.show-controls .call-button,.call.show-controls .call-button-text,.call.show-controls .call-emojis,.call.show-controls .call-party-state,.call.show-controls .call-subtitle,.call.show-controls .call-title,.call.show-controls .popup-header{opacity:1}.call.show-controls .call-video{opacity:.8}.call.show-controls .call-video-blur{opacity:.56}.call .popup-header .btn-icon{color:#fff}.call .popup-header .call-emojis{margin-right:1rem;transform:scale(1.3125)}.call-avatar{border-radius:inherit;bottom:0;left:0;opacity:.7;position:absolute;right:0;top:0;z-index:-1}.call-avatar .avatar-full{font-size:6rem}.call-title{font-size:1.25rem;font-weight:var(--font-weight-bold)}.call-subtitle{font-size:1rem}.call .popup-header,.call-emojis,.call-subtitle,.call-title{opacity:0}body.animation-level-2 .call .popup-header,body.animation-level-2 .call-emojis,body.animation-level-2 .call-subtitle,body.animation-level-2 .call-title{transition:opacity var(--transition-standard-in)}.call-buttons{align-items:center;align-self:center;bottom:1.75rem;display:flex;pointer-events:none;position:absolute;z-index:1}.call-buttons .call-button{pointer-events:all}.call-buttons .call-button-container{--scale:1}.call-buttons .call-button-container.hide-me{--scale:0!important;transform:scale(var(--scale))}body.animation-level-2 .call-buttons .call-button-container.hide-me{transition:transform var(--transition-standard-in)}.call-buttons .call-button-container.hide-me .call-button,.call-buttons .call-button-container.hide-me .call-button-text{opacity:0}body.animation-level-2 .call-buttons .call-button,body.animation-level-2 .call-buttons .call-button-text{transition:opacity var(--transition-standard-in),transform var(--transition-standard-in)}.call-buttons.is-first .call-button,.call-buttons.is-first .call-button-text{transform:translateX(calc(var(--call-button-size)*-.5 + var(--call-button-margin)*-.5))}.call-buttons.is-second{--margin-length:2}.call-buttons.is-second .call-button,.call-buttons.is-second .call-button-text{transform:translateX(calc(var(--call-button-size)*2 + var(--call-button-margin)*var(--margin-length)))}.call.no-screen .call-buttons.is-second{--margin-length:.656875}.call-button{background-color:hsla(0,0%,100%,.1)}.call-button-red{background-color:var(--danger-color)!important}.call-button-green{background-color:var(--gc-green-text-color)!important}.call-button.active{background-color:#fff!important}.call-button.active:before{color:#9e9e9e}.call-button,.call-button-text{opacity:0}.call-video{border-radius:inherit;height:100%;-o-object-fit:contain;object-fit:contain;opacity:1;position:absolute;width:100%}.call-video-container{align-items:center;background-color:#000;bottom:0;display:flex;left:0;position:absolute;right:0;top:0;z-index:-1}.call-video-container.small{border-radius:10px;bottom:8rem;cursor:pointer;left:auto;right:1rem;top:auto;z-index:1}.call-video-blur{border-radius:inherit;height:100%;opacity:.7;position:absolute;width:100%}body.animation-level-2 .call-video,body.animation-level-2 .call-video-blur{transition:opacity var(--transition-standard-in)}.call .call-emojis{transform:scale(1.125)}.call .call-emojis .emoji{margin:0 .125rem}.call-party-states{align-items:center;bottom:calc(4.25rem + var(--call-button-size));display:flex;flex-direction:column;padding:0 1rem;pointer-events:none;position:absolute;width:100%;z-index:2}.call-party-state{align-items:center;-webkit-backdrop-filter:blur(25px);backdrop-filter:blur(25px);background-color:hsla(0,0%,100%,.2);border-radius:1.625rem;color:#fff;display:flex;font-size:.875rem;font-weight:var(--font-weight-bold);height:1.625rem;line-height:1.625rem;margin-top:1rem;max-width:100%;opacity:0;padding:0 .625rem;transform:scale(0) translateY(0)}body.animation-level-2 .call-party-state{transition:opacity var(--transition-standard-in),transform var(--transition-standard-in)}.call-party-state .rlottie-icon{flex:0 0 auto;height:1.875rem!important;margin-left:-.25rem;margin-right:.25rem;width:1.875rem!important}.call-party-state.is-visible:not(.backwards){transform:scale(1) translateY(0)}.call-party-state-text,.call-title{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.call.two-button-rows .call-buttons.is-first .call-button,.call.two-button-rows .call-buttons.is-first .call-button-text{transform:translateY(calc(var(--call-button-size)*-1 + var(--call-button-margin)*-1 + -1.125rem))}.call.two-button-rows .call-buttons.is-second .call-button,.call.two-button-rows .call-buttons.is-second .call-button-text{transform:translateX(0)}.popup-group-call:not(.movable-element){top:7rem}.popup-group-call:not(.movable-element) .group-call{border-bottom-left-radius:0;border-bottom-right-radius:0}.popup-group-call .popup-body{justify-content:space-between}.popup-group-call .popup-container{background-color:var(--gc-background-color);color:var(--gc-primary-text-color)}.popup-group-call .popup{z-index:6}.group-call{--call-button-margin:1.25rem;height:100%;padding:0 .5rem;width:100%}.group-call:after{background:linear-gradient(180deg,rgba(33,33,33,0) 0,rgba(33,33,33,.65) 48.54%,var(--gc-background-color) 100%);bottom:0;content:" ";height:7.5rem;left:0;position:absolute;right:0}.group-call-header{height:3.5rem;margin-bottom:.125rem;padding:0 .5rem}.group-call-header .btn-icon{color:inherit;flex:0 0 auto}.group-call-header-info{flex:1 1 auto;margin-left:1.5rem;overflow:hidden}.group-call-header-title{font-weight:var(--font-weight-bold)}.group-call-header-subtitle,.group-call-header-title{font-size:var(--font-size-16);line-height:var(--line-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.group-call-header-subtitle{color:var(--gc-secondary-text-color);font-size:.875rem}.group-call-buttons{align-items:center;align-self:center;bottom:1.75rem;display:flex;justify-content:space-between;position:absolute;z-index:1}.group-call-button{background-color:var(--gc-button-unmuted-color);color:var(--gc-primary-text-color);opacity:1}.group-call[data-mic-state=muted] .group-call-button{background-color:var(--gc-button-muted-color)}.group-call[data-mic-state=hand] .group-call-button{background-color:var(--gc-button-hand-color)}.group-call:not(.is-big-layout)[data-mic-state=unmuted] .group-call-button{background-color:var(--gc-button-unmuted-fill-color)}.group-call-button-red{background-color:var(--gc-button-leave-color)!important}.group-call[data-mic-state=unmuted] .group-call-microphone-button{background:linear-gradient(230.46deg,#00a3b4 12.94%,#00cb47 86.29%)}.group-call[data-mic-state=muted] .group-call-microphone-button{background:linear-gradient(225deg,#4eabf8 14.73%,#3478f6 85.27%)}.group-call[data-mic-state=hand] .group-call-microphone-button{background:linear-gradient(225deg,#df44b8 14.73%,#3851eb 85.27%)}.group-call-participant-menu{z-index:5}.group-call-participant{padding-right:.5rem}.group-call-participant-status-icon{display:inline-block;font-size:1.125rem;height:1.125rem;line-height:1;margin-right:6px;vertical-align:middle;width:1.125rem}.group-call-participant-status-container{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.group-call-participant .dialog-subtitle,.group-call-participant .dialog-title{padding-right:2.5rem}.group-call-participant-muted-icon-container{position:absolute!important;right:.5rem}.group-call-participant-video-container{align-items:center;background-color:#000;border-radius:10px;cursor:pointer;display:flex;flex:1 1 auto;height:15rem;margin:.25rem;overflow:hidden;position:relative;width:100%;width:33%}.group-call-participant-video-container:after{background:linear-gradient(180deg,transparent 55.62%,rgba(0,0,0,.5) 86.46%);bottom:0;content:" ";left:0;position:absolute;right:0;top:0}.group-call-participant-video-container .group-call-participant-status-icon{font-size:1.25rem;height:1.25rem;width:1.25rem}.group-call-participant-video-container:after,.group-call-participant-video-header,.group-call-participant-video-info{opacity:0}body.animation-level-2 .group-call-participant-video-container:after,body.animation-level-2 .group-call-participant-video-header,body.animation-level-2 .group-call-participant-video-info{transition:opacity var(--transition-standard-in)}.group-call-participant-video-header,.group-call-participant-video-info{align-items:center;bottom:.25rem;display:flex;justify-content:space-between;left:0;padding:0 .5rem 0 .75rem;position:absolute;right:0;z-index:1}.group-call-participant-video-header{bottom:auto;justify-content:flex-end;padding-right:.75rem;padding-top:.875rem;top:0}.group-call-participant-video-header .group-call-pin-icon{font-size:1.5rem;height:1.5rem;width:1.5rem}.group-call-participant-video-info .peer-title{font-weight:var(--font-weight-bold)}.group-call-participant-video-info .peer-title,.group-call-participant-video-info-left{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.group-call-participant-video-info .group-call-participant-status-container{margin-top:-1px;opacity:.6}.group-call-participant-video-info-left{flex:1 1 auto}.group-call-participant-video-info-right{flex:0 0 auto;height:2rem;margin-left:.75rem;width:2rem}.group-call-participant .is-speaking{color:var(--gc-green-text-color)}.group-call-participant .is-waiting{color:var(--gc-blue-text-color)}.group-call-participants{border-radius:10px;flex:1 1 auto;overflow:hidden}.group-call-participants-scrollable{border-radius:inherit;height:auto;padding-bottom:6rem;position:relative}.group-call-participants-video-container{display:flex;flex-wrap:wrap;margin:-.25rem -.25rem 0}.group-call-participants-video-container:not(.show-controls),.group-call-participants-video-container:not(.show-controls) .group-call-participant-video-container{cursor:none}.group-call-participants-video-container:empty{display:none}.group-call-participants-video-container[data-layout="3"] .group-call-participant-video-container:first-child{width:100%}.group-call-participants-video-container[data-layout="3"] .group-call-participant-video-container:nth-child(n+2),.group-call-participants-video-container[data-layout="4"] .group-call-participant-video-container{flex:1 0 auto;height:auto}.group-call-participants-video-container[data-layout="3"] .group-call-participant-video-container:nth-child(n+2):before,.group-call-participants-video-container[data-layout="4"] .group-call-participant-video-container:before{content:" ";display:block;padding-top:100%}.group-call-participants-video-container.show-controls .group-call-participant-video-container:after,.group-call-participants-video-container.show-controls .group-call-participant-video-header,.group-call-participants-video-container.show-controls .group-call-participant-video-info{opacity:1}.group-call-participants .chatlist{background:none;margin:0 auto;max-width:600px;padding:0}.group-call-participants .user-title{color:var(--gc-primary-text-color)}.group-call-participants .user-last-message{color:var(--gc-secondary-text-color)}.group-call-big-video-container{position:relative}.group-call-big-video-container .group-call-participants-video-container{margin-bottom:.25rem;min-height:100%}.group-call-big-video-container .group-call-participant-video-container{height:auto}.group-call-big-video-container .group-call-participant-video-container:before{padding-top:56.25%!important}.group-call-cfs,.group-call:not(.is-big-layout) .group-call-big-video-container,.group-call:not(.is-big-layout) .popup-body .group-call-header,.group-call:not(.is-big-layout).has-pinned .group-call-participant-video-container:not(.video-hidden){display:none}.group-call.is-full-screen{border-radius:0}.group-call.is-big-layout>.group-call-header,.group-call.is-full-screen>.group-call-header{padding:0 1rem}.group-call.is-big-layout:not(.is-full-screen){--gc-right-column-width:17.5rem}.group-call.is-big-layout:not(.is-full-screen) .group-call-cfs{display:flex}.group-call.is-big-layout{background-color:#000}.group-call.is-big-layout:after{content:none}html.no-touch .group-call.is-big-layout>.group-call-header .btn-icon:active,html.no-touch .group-call.is-big-layout>.group-call-header .btn-icon:hover{background-color:hsla(207,4%,46%,.3)}.group-call.is-big-layout .video-hidden{display:none}.group-call.is-big-layout.is-right-column-shown .popup-body{right:0}.group-call.is-big-layout.is-right-column-shown .group-call-big-video-container{width:calc(100% - var(--gc-right-column-width))}.group-call.is-big-layout.is-right-column-shown .group-call-buttons{transform:translateX(calc(var(--gc-right-column-width)/-2))}.group-call.is-big-layout.is-right-column-shown .popup-container{--translateX:calc(var(--gc-right-column-width)/-2)}.group-call.is-big-layout .group-call-header-title{font-size:1.25rem}.group-call.is-big-layout .popup-body{background-color:var(--gc-background-color);bottom:0;padding:inherit;position:absolute;right:calc(var(--gc-right-column-width)*-1);top:0;width:var(--gc-right-column-width)}.group-call.is-big-layout .group-call-buttons{bottom:2.5rem;padding:.75rem}body.animation-level-2 .group-call.is-big-layout .group-call-buttons{transition:opacity var(--transition-standard-in)}.group-call.is-big-layout .group-call-buttons:before{-webkit-backdrop-filter:blur(100px);backdrop-filter:blur(100px);background:rgba(0,0,0,.5);border-radius:1.25rem;bottom:0;content:" ";left:0;position:absolute;right:0;top:0}.group-call.is-big-layout .group-call-buttons .group-call-button,.group-call.is-big-layout .group-call-buttons:before{opacity:0}.group-call.is-big-layout .group-call-buttons.show-controls .group-call-button,.group-call.is-big-layout .group-call-buttons.show-controls:before{opacity:1}body.animation-level-2 .group-call.is-big-layout .group-call-buttons:before{transition:opacity var(--transition-standard-in)}body.animation-level-2 .group-call.is-big-layout .group-call-buttons .group-call-button{transition:opacity var(--transition-standard-in),background-color var(--transition-standard-in)}.group-call.is-big-layout .group-call-participants-scrollable{padding-bottom:.5rem}.group-call.is-big-layout .group-call-header-subtitle{display:none}.popup-sponsored .scrollable-y{margin:0 -1.5rem;max-height:25rem;padding:.5rem 1.5rem;position:relative;-webkit-user-select:text;-moz-user-select:text;user-select:text;width:calc(100% + 3rem)}.popup-mute .popup-container{min-width:16rem}.popup-reacted-list{--size:1.5rem;--custom-emoji-size:var(--size)}.popup-reacted-list .popup-container{height:600px;max-height:600px;padding:0;width:25rem}.popup-reacted-list .popup-header{border-bottom:1px solid var(--border-color);margin:0;min-height:3.5625rem;padding:.25rem .75rem .75rem}.popup-reacted-list .popup-close{height:40px;margin-right:.5rem;margin-top:.375rem;order:-1}.popup-reacted-list .reaction{--reaction-size:var(--size);--additional-height:.75rem;--margin:.5rem;--background-color:var(--light-filled-primary-color);--counter-color:var(--primary-color);flex:1 0 auto;justify-content:space-evenly}.popup-reacted-list .reaction.is-chosen:not(.backwards){--counter-color:#fff}.popup-reacted-list .reaction-sticker-icon{align-items:center;display:flex;font-size:1.25rem!important;margin:0}.popup-reacted-list .sidebar-left-section{margin-bottom:0!important}.popup-reacted-list .tabs-container{flex:1 1 auto;overflow:hidden}.popup-reacted-list .tabs-tab{background-color:var(--surface-color)}.popup-reacted-list .reacted-list-reaction-icon{display:flex;height:var(--size);position:absolute;right:1rem;top:50%;transform:translateY(-50%);width:var(--size)}.popup-reacted-list .chatlist-chat{padding-right:3.25rem!important}.popup-payment .popup-container{border-radius:16px;max-height:min(100%,43.5rem);max-width:26.25rem;padding:0;width:26.25rem}.popup-payment .popup-header{height:3.5rem;margin:0;padding:0 1rem}.popup-payment.is-loading .popup-container{min-height:26.25rem}.popup-payment .scrollable{display:flex;flex:1 1 auto;flex-direction:column}.popup-payment hr{display:block!important;margin:.5rem 0!important;padding:0!important}.popup-payment .input-field{--height:3rem;margin:.75rem .5rem 0}.popup-payment .input-field-input{--padding:.75rem}.popup-payment .input-fields-row .input-field{margin-top:1.25rem}.popup-payment .sidebar-left-section{padding:0!important}.popup-payment .sidebar-left-section-name+.input-field,.popup-payment .sidebar-left-section-name+.input-fields-row .input-field{margin-top:.75rem}.popup-payment .sidebar-left-section .row{margin-top:.5rem}.popup-payment .sidebar-left-section-content{margin:0 .5rem!important}.popup-payment .select-wrapper{box-shadow:var(--menu-box-shadow);max-height:10rem}.popup-payment .select-wrapper li{grid-template-columns:calc(26px + 2rem) 1fr;height:3rem}.popup-payment .payment-verification{border:none;flex:1 1 auto;height:40rem;max-height:100%;width:100%}.popup-payment .row{border-radius:10px}.payment-item{padding:0 1.25rem;width:100%}.payment-item-details{display:flex;flex:0 0 auto;justify-content:space-between;margin-bottom:1rem;overflow:hidden}.payment-item-details:last-child{margin-bottom:0}.payment-item-details-photo{border-radius:10px;flex:0 0 auto;height:6.25rem;margin-right:1rem;width:6.25rem}.payment-item-details-photo .media-photo{border-radius:inherit}.payment-item-details-lines{display:flex;flex:1 1 auto;flex-direction:column}.payment-item-details-lines-title{font-size:var(--font-size-16);font-weight:var(--font-weight-bold);line-height:var(--line-height-16)}.payment-item-details-lines-bot-name,.payment-item-details-lines-description{font-size:var(--font-size-14);line-height:1.25rem}.payment-item-details-lines-bot-name{color:var(--secondary-text-color)}.payment-item-prices{display:flex;flex-direction:column;margin:1rem .25rem .5rem}.payment-item-prices-price{color:var(--secondary-text-color);display:flex;font-weight:500;justify-content:space-between;line-height:1.1875rem}.payment-item-prices-price+.payment-item-prices-price{margin-top:1.5rem}.payment-item-prices-price.is-total{color:var(--primary-text-color)}.payment-item-tips{display:flex;justify-content:space-between;margin:.75rem -.5rem 1.5rem}.payment-item-tips-tip{--background-intensity:.1;background-color:rgba(84,190,97,var(--background-intensity));border-radius:1.25rem;color:#3ba748;flex:1 1 auto;font-size:var(--font-size-16);font-weight:var(--font-weight-bold);height:2.5rem;line-height:2.5rem;text-align:center}body.animation-level-2 .payment-item-tips-tip{transition:color .1s ease-in-out,background-color .1s ease-in-out}.payment-item-tips-tip+.payment-item-tips-tip{margin-left:.5rem}html.no-touch .payment-item-tips-tip:not(.active):active,html.no-touch .payment-item-tips-tip:not(.active):hover{--background-intensity:.3}.payment-item-tips-tip.active{--background-intensity:1;color:#fff}.payment-item-tips-input{color:inherit!important;display:inline;font-weight:inherit!important}.payment-item-row{margin:0 .5rem;padding-bottom:0;padding-top:0}.payment-item-method-row .media-photo{border-radius:10px}.payment-item-pay{flex:0 0 auto;height:3rem;margin:1rem;text-transform:uppercase;width:auto}.payment-item-preloader-container{flex:1 1 auto;position:relative}.popup-payment-shipping-methods .popup-container{min-height:auto}.popup-payment-shipping-methods .row{margin-top:0!important}.popup-payment-verification .popup-header:after{background-color:var(--border-color);bottom:-1px;content:" ";height:1px;left:0;position:absolute;right:0}.popup-payment-card-confirmation .popup-container{min-height:auto}.popup-payment-card-confirmation .input-field-password{margin-top:.5rem!important}.popup-limit .popup-container{min-width:min(100%,22.5rem)}.popup-limit-line{align-items:center;display:flex;flex-direction:column;margin:.75rem 0}.popup-limit-hint{align-items:center;color:#fff;display:flex;font-weight:var(--font-weight-bold);justify-content:center;transform:scale(.6) translate(-280px,16px) rotate(-30deg)}body.animation-level-2 .popup-limit-hint{transition:transform .3s cubic-bezier(.12,1.1,.56,1.2)}.popup-limit-hint.active{transform:scale(1) translate(0) rotate(0)}.popup-limit-hint-icon{display:flex;font-size:1.25rem;margin-right:.25rem}.popup-limit-button.primary{align-items:center;background:linear-gradient(88.39deg,#6c93ff -2.56%,#976fff 51.27%,#df69d1 107.39%);color:#fff!important;display:flex}.popup-limit-button-icon{display:flex;font-size:1.5rem;margin-left:.625rem}.popup-limit .limit-line{align-self:stretch;margin:1rem .5rem 0}.popup-limit:not(.is-locked) .popup-limit-hint{background:linear-gradient(73.4deg,#6c93ff -7.21%,#976fff 114.57%,#df69d1 241.52%);background-size:200px 2rem;border-radius:1rem;height:2rem;padding:0 .75rem;position:relative}.popup-limit:not(.is-locked) .popup-limit-hint:after{background:inherit;background-position-x:calc(-50% - 86px);background-repeat:no-repeat;background-size:inherit;bottom:-9px;-webkit-clip-path:path("M0 0H26H24.4853C22.894 0 21.3679 0.632141 20.2426 1.75736L14.4142 7.58579C13.6332 8.36684 12.3668 8.36683 11.5858 7.58579L5.75736 1.75736C4.63214 0.632139 3.10602 0 1.51472 0H0Z");clip-path:path("M0 0H26H24.4853C22.894 0 21.3679 0.632141 20.2426 1.75736L14.4142 7.58579C13.6332 8.36684 12.3668 8.36683 11.5858 7.58579L5.75736 1.75736C4.63214 0.632139 3.10602 0 1.51472 0H0Z");content:" ";display:block;height:9px;left:50%;margin-left:-13px;position:absolute;width:100%}.popup-limit.is-locked .popup-limit-hint{background-color:var(--primary-color);border-radius:1.375rem;height:2.75rem;margin-right:-.25rem;padding:0 1.25rem 0 1rem}.popup-limit.is-premium .popup-limit-hint{align-self:flex-end;background:linear-gradient(84.4deg,#6c93ff -4.85%,#976fff 51.72%,#df69d1 110.7%);background-position-x:100%;background-size:200px 2rem;border-bottom-right-radius:0;margin-right:.5rem}body.animation-level-2 .popup-limit.is-premium .popup-limit-hint{transition:transform .3s cubic-bezier(.12,1.1,.56,1.1)}.popup-limit.is-premium .popup-limit-hint:after{background-position-x:134%;bottom:-11.3px;-webkit-clip-path:path("M8.44528 0.5H20.5V10.1943C20.5 10.9154 19.9154 11.5 19.1943 11.5C18.8178 11.5 18.4597 11.3375 18.2117 11.0541L10.2274 1.92918C9.75146 1.38523 9.18812 0.924478 8.56057 0.565879L8.44528 0.5Z");clip-path:path("M8.44528 0.5H20.5V10.1943C20.5 10.9154 19.9154 11.5 19.1943 11.5C18.8178 11.5 18.4597 11.3375 18.2117 11.0541L10.2274 1.92918C9.75146 1.38523 9.18812 0.924478 8.56057 0.565879L8.44528 0.5Z");height:12px;left:100%;margin-left:-20.6px}#auth-pages{background:var(--surface-color);max-width:100%;overflow:hidden}#auth-pages .btn-primary{text-transform:uppercase}@media only screen and (max-width:600px){#auth-pages .btn-primary{height:50px}}#auth-pages .subtitle{margin:0}@media only screen and (max-width:600px){#auth-pages .subtitle{font-size:14px}}#auth-pages .input-wrapper{margin-top:49px}@media only screen and (max-width:600px){#auth-pages .input-wrapper{margin-top:41px;padding:0 16px;width:100%}}#auth-pages .auth-image,#auth-pages .input-wrapper,#auth-pages .subtitle{flex:0 0 auto}#auth-pages>.scrollable{display:flex;flex-direction:column;margin:0 auto;max-width:720px;position:relative}#auth-pages>.scrollable .auth-placeholder{flex:1;min-height:3rem;width:100%}@media screen and (max-height:810px){#auth-pages>.scrollable .auth-placeholder:last-child{display:none}}#auth-pages .tabs-container{margin:0 auto;max-width:720px;min-width:auto;position:relative}#auth-pages .tabs-container .tabs-tab{background-color:var(--surface-color)}#auth-pages .tabs-container .tabs-tab .container{display:flex;flex:1 1 auto;flex-direction:column;height:810px;padding:0;width:100%}@media screen and (max-height:810px){#auth-pages .tabs-container .tabs-tab .container{height:760px}}@media only screen and (max-width:600px){#auth-pages .page-password .input-wrapper{margin-top:31px}}#auth-pages .page-password .input-wrapper .btn-primary{margin-top:1rem}.page-sign .checkbox-field{margin-bottom:.5rem;margin-top:.5rem}.page-sign .auth-image,.page-signUp .auth-image{height:7.5rem;margin-bottom:1.5rem;width:7.5rem}@media only screen and (min-width:601px){.page-sign .auth-image,.page-signUp .auth-image{height:10rem;margin-bottom:1.5rem;width:10rem}}.page-authCode .phone-wrapper{flex:0 0 auto}.sign-logo{fill:var(--primary-color);max-height:100%;max-width:100%}.page-sign .btn-secondary,.page-signQR .btn-secondary{font-weight:400}.page-sign .qr,.page-signQR .qr{margin-top:1.5rem}.page-signQR{overflow:visible!important;overflow:initial!important}.page-signQR .auth-image{align-items:center;display:flex;height:240px!important;justify-content:center;width:240px!important}.page-signQR .auth-image .preloader{left:auto;top:auto;transform:none}.page-signQR .auth-image .qr-canvas{height:100%;width:100%}.page-signQR .auth-image .qr-canvas+.qr-canvas{display:none}.page-signQR .input-wrapper{margin-top:1rem!important}.page-signQR h4{flex:0 0 auto}[dir=ltr] .page-signQR .qr-description{text-align:left}[dir=rtl] .page-signQR .qr-description{text-align:right}.page-signQR .qr-description{line-height:var(--line-height);margin:1rem auto;max-width:480px}.page-signQR .qr-description li{margin-top:.5rem}.page-signUp .auth-image{margin-bottom:14px;margin-top:10px}@media only screen and (max-width:600px){.page-signUp .auth-image{margin-bottom:24px}}.page-signUp .fullName{flex:0 0 auto}@media only screen and (max-width:600px){.page-signUp #signUp{margin-top:100px}}.page-signUp .input-field{text-align:left;text-align:initial}.page-sign .btn-primary{margin-top:1.1875rem}#auth-pages>.scrollable,#main-columns{opacity:1;transition:opacity var(--transition-standard-in)}.page-authCode .auth-image{transform:translateY(12px)}.page-authCode .phone-wrapper{align-items:center;display:flex;justify-content:center;margin:1.375rem 0 .875rem}.page-authCode .phone-wrapper h4[contenteditable]{border:none;border-bottom:2px solid var(--primary-color);outline:none;padding:0 1rem}.page-authCode .phone-wrapper .phone.error{border-color:var(--danger-color)!important}.page-authCode .phone-wrapper .phone{margin:0}.page-authCode .subtitle{margin:0 auto!important;max-width:300px}.page-chats{display:flex;max-width:1682px!important}.page-chats #main-columns{height:100%;max-height:100%;min-height:100%;overflow:hidden;position:relative;width:100%}@media only screen and (max-width:600px){.page-chats .main-column{display:flex!important;width:100%;z-index:1}}@media only screen and (min-width:601px){.page-chats #column-center{background-color:#e6ebee;display:flex!important;width:100%}.page-chats #column-right{display:flex!important}.page-chats .main-column{height:100%;max-height:100%;min-height:100%;position:relative}.page-chats #main-columns{display:flex}}.page-chats #search-container,.page-chats .sidebar-search{flex-direction:column;height:100%;left:0;max-height:100%;overflow:hidden;position:absolute;top:0;width:100%;z-index:3}@media only screen and (min-width:1681px){.page-chats{border-color:var(--border-color);border-style:solid;border-width:0 1px}}.page-chats .avatar-edit{flex:0 0 auto;height:120px;margin:1rem auto 2rem;width:120px}body.animation-level-2 .page-chats .main-column{transition:transform var(--tabs-transition),filter var(--tabs-transition)}body,html{height:100%;margin:0;overflow:hidden;padding:0;width:100%}@media only screen and (max-width:600px){body,html{height:calc(var(--vh, 1vh)*100)}}html.is-ios{-webkit-touch-callout:none;position:fixed;-webkit-user-select:none}html.no-backdrop{--menu-background-color:var(--surface-color);--menu-backdrop-filter:none}@supports(padding:max(0px)){html{padding:0 min(16px,env(safe-area-inset-right)) 0 min(16px,env(safe-area-inset-left))}}html{-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);font-size:16px}body{background-color:var(--body-background-color);color:var(--primary-text-color)}body.deactivated{animation:grayscale-in var(--transition-standard-in) forwards}body.deactivated-backwards{animation:grayscale-out var(--transition-standard-out) forwards}@keyframes grayscale-in{0%{filter:grayscale(0)}to{filter:grayscale(1)}}@keyframes grayscale-out{0%{filter:grayscale(1)}to{filter:grayscale(0)}}a{color:var(--link-color)}button,html,input,optgroup,select,textarea{font-family:Roboto,-apple-system,apple color emoji,BlinkMacSystemFont,Segoe UI,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}a,button,div,input,select,textarea{-webkit-tap-highlight-color:rgba(0,0,0,0)}code,kbd,pre,samp{font-family:var(--font-monospace)}.whole{height:100%;margin:0 auto;max-width:1680px;min-height:100%;width:100%}@media only screen and (min-width:601px){.only-handhelds{display:none!important}}.container{margin:0 auto}h1,h2,h3,h4,h5,h6{font-weight:var(--font-weight-bold)}h4{font-size:2rem;line-height:110%;margin:22px 0 14px}@media only screen and (max-width:600px){h4{font-size:20px;margin:2px 0 8px}}[contenteditable=true],input{background-color:transparent;caret-color:var(--primary-color);color:var(--primary-text-color)}input,textarea{-webkit-appearance:none}input::-webkit-contacts-auto-fill-button,input::-webkit-credentials-auto-fill-button{position:absolute;right:0;visibility:hidden}input:-webkit-autofill:first-line{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,Helvetica Neue,Arial;font-size:16px}.subtitle{color:var(--secondary-text-color);line-height:1.35}.danger{color:var(--danger-color)!important}.danger .c-ripple__circle{background-color:var(--light-danger-color)}.blue,.primary{color:var(--primary-color)!important}.blue .c-ripple__circle,.primary .c-ripple__circle{background-color:var(--light-primary-color)}.primary-text{color:var(--primary-text-color)!important}.color-premium{-webkit-text-fill-color:transparent;background:var(--premium-gradient);-webkit-background-clip:text}.blue:before,.danger:before,.primary:before{color:inherit!important}.bg-warning{background:#fed85a!important}.contextmenu{bottom:auto!important;position:fixed!important;right:auto!important;width:auto!important;z-index:4!important}.preloader{height:50px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:50px}.preloader .preloader-path{stroke:var(--primary-color)}@keyframes thumbnail-fade-in-opacity{0%{opacity:0}to{opacity:.8}}@keyframes fade-in-opacity{0%{opacity:0}to{opacity:1}}@keyframes fade-out-opacity{0%{opacity:1}to{opacity:0}}@keyframes fade-in-backwards-opacity{0%{opacity:1}to{opacity:0}}@keyframes fade-out-backwards-opacity{0%{opacity:0}to{opacity:1}}@keyframes fade-in-opacity-fade-out-opacity{0%{opacity:0}10%{opacity:1}50%{opacity:1}to{opacity:0}}.toast{-webkit-backdrop-filter:blur(25px);backdrop-filter:blur(25px);background-color:rgba(0,0,0,.66);border-radius:10px;color:#fff;font-size:1rem;left:50%;max-width:min(30rem,calc(100vw - 2rem));opacity:0;padding:.5rem 1rem;position:fixed;top:50%;transform:translate(-50%,-50%);z-index:5}.toast.is-visible{opacity:1}body.animation-level-2 .toast{transition:opacity var(--transition-standard-in)}.toast b{color:inherit}.toast a{color:#60a5e9!important;cursor:pointer}hr{border:none;border-top:1px solid var(--border-color);margin:0;padding-bottom:.5rem;width:100%}b{font-weight:var(--font-weight-bold)}.avatar-edit{border-radius:50%;cursor:pointer;overflow:hidden;position:relative}.avatar-edit.is-forum{border-radius:var(--avatar-border-radius-forum)}.avatar-edit-canvas{background:linear-gradient(var(--avatar-color-top),var(--avatar-color-bottom));height:100%;max-height:100%;max-width:100%;width:100%}html.no-touch body.animation-level-2 .avatar-edit .tgico-cameraadd{transform:translateY(-50%) translateX(-50%) scale(1);transition:transform .2s ease-in-out}html.no-touch body.animation-level-2 .avatar-edit:hover .tgico-cameraadd{transform:translateY(-50%) translateX(-50%) scale(1.2)}.avatar-edit .tgico-cameraadd{color:#fff;font-size:3rem;height:3rem;left:50%;line-height:1;position:absolute;top:50%;transform:translateY(-50%) translateX(-50%);width:3rem;z-index:2}.avatar-edit .avatar-placeholder{filter:brightness(.7);height:100%;left:0;position:absolute;top:0;width:100%}.missing-icon{height:1.5rem;width:1.5rem}.missing-icon-path{fill:currentColor}.select-wrapper{background-color:var(--surface-color);border-radius:10px;display:flex;flex-direction:column;flex-wrap:wrap;left:0;max-height:23.5rem;opacity:0;overflow:hidden;position:absolute;top:calc(100% + .5rem);transform:scale(.95);transform-origin:top center;transition:opacity .2s ease-out,transform .2s ease-out;width:100%;z-index:3}.select-wrapper.active{opacity:1;transform:scale(1)}.select-wrapper ul{margin:.5rem 0}[dir=ltr] .select-wrapper li{text-align:left}[dir=rtl] .select-wrapper li{text-align:right}.select-wrapper li{align-items:center;cursor:pointer;display:grid;grid-template-columns:calc(26px + 2rem) 1fr 80px;height:3.5rem;justify-content:space-between;padding:0 1rem}html.no-touch .select-wrapper li:active,html.no-touch .select-wrapper li:hover{background-color:var(--light-secondary-text-color)}.select-wrapper .emoji{font-size:26px;height:26px;line-height:1;width:26px}.select-wrapper .scrollable{position:relative}[dir=ltr] .phone-code{text-align:right}[dir=rtl] .phone-code{text-align:left}.phone-code{color:#9e9e9e}.auth-image{height:166px;margin:0 auto 18px;position:relative;width:166px}@media only screen and (max-width:600px){.auth-image{height:120px;width:120px}}[dir=ltr] .phone-edit{margin-left:.4rem}[dir=rtl] .phone-edit{margin-right:.4rem}.phone-edit{cursor:pointer;font-size:1.5rem;height:1.5rem;line-height:1;opacity:.5;transition:opacity .2s;width:1.5rem}html.no-touch .phone-edit:active,html.no-touch .phone-edit:hover{opacity:1}span.emoji{display:inline!important;font-family:apple color emoji,segoe ui emoji,noto color emoji,android emoji,emojisymbols,emojione mozilla,twemoji mozilla,segoe ui symbol;line-height:1!important;vertical-align:baseline!important;vertical-align:initial!important}@media not screen and (-webkit-min-device-pixel-ratio:2),not screen and (min-device-pixel-ratio:2),not screen and (min-resolution:192dpi),not screen and (min-resolution:2dppx){html[dir=ltr]:not(.is-safari) span.emoji{margin-right:5px!important}html[dir=rtl]:not(.is-safari) span.emoji{margin-left:5px!important}html[dir=ltr]:not(.is-safari) avatar-element span.emoji{margin-right:0!important}html[dir=rtl]:not(.is-safari) avatar-element span.emoji{margin-left:0!important}}img.emoji{display:inline-block;height:18px;max-height:100%;max-width:100%;vertical-align:middle;width:18px}[contenteditable=true]{cursor:text;outline:none;-webkit-user-select:text;-moz-user-select:text;user-select:text;white-space:pre-wrap}[contenteditable=true] .custom-emoji{display:inline-block;margin-bottom:-2px}[contenteditable=true] .custom-emoji:before{content:none}[contenteditable=true] [style*=markup]{font-family:inherit!important}[contenteditable=true] [style*=bold]{font-weight:700}[contenteditable=true] [style*=italic]{font-style:italic}[contenteditable=true] [style*=underline]{text-decoration-line:underline}[contenteditable=true] [style*=strikethrough]{text-decoration-line:line-through}[contenteditable=true] [style*=underline][style*=strikethrough]{text-decoration-line:underline line-through}[contenteditable=true] [style*=monospace]{font-family:var(--font-monospace)!important}[contenteditable=true] [style*=spoiler]{background-color:var(--spoiler-draft-background-color)}[contenteditable][data-placeholder]:before{color:#a2acb4;content:attr(data-placeholder);display:block;opacity:0;pointer-events:none;position:absolute}body.animation-level-2 [contenteditable][data-placeholder]:before{transform:translateX(1.75rem);transition:opacity var(--input-transition) .01s,transform var(--input-transition) .01s}[contenteditable][data-placeholder]:empty:before{opacity:1}body.animation-level-2 [contenteditable][data-placeholder]:empty:before{transform:translateX(0)}.sticky_sentinel{left:0;pointer-events:none;position:absolute;right:0;visibility:hidden}.super-stickers{display:grid;grid-template-columns:repeat(auto-fill,var(--esg-sticker-size));justify-content:space-between;width:100%}html.no-touch .super-sticker:active,html.no-touch .super-sticker:hover{background-color:var(--light-secondary-text-color);border-radius:10px}.fade-in-transition{opacity:1}body.animation-level-2 .fade-in-transition{transition:opacity .2s ease-in-out}.show-more{cursor:pointer;padding-bottom:13px;padding-top:13px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media only screen and (min-width:601px){[dir=ltr] .show-more{padding-left:8px}[dir=rtl] .show-more{padding-right:8px}}[dir=ltr] .show-more .tgico-down{padding-left:1rem;padding-right:2rem}[dir=rtl] .show-more .tgico-down{padding-left:2rem;padding-right:1rem}.show-more .tgico-down{float:left;font-size:24px}.content-empty,.show-more .tgico-down{color:var(--secondary-text-color)}::-moz-selection{background:var(--selection-background-color)}.selection:after,::selection{background:var(--selection-background-color)}.selection:after{bottom:0;content:" ";left:0;position:absolute;right:0;top:0}.input-something{display:inline-block}.input-selectable{position:relative}@keyframes grow-icon{0%{opacity:.8;transform:scale(.5)}50%{opacity:1;transform:scale(1.1)}to{transform:scale(1)}}@keyframes hide-icon{0%{opacity:.4;transform:scale(1)}to{opacity:0;transform:scale(.5)}}.popup-disable-password .popup-description,.popup-skip-email .popup-description{max-width:284px}.grid{grid-gap:.25rem;display:grid;grid-auto-rows:1fr;grid-template-columns:repeat(3,1fr);width:100%}.grid-item{cursor:pointer;height:0;padding-bottom:100%;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-item-media{height:100%;left:0;-o-object-fit:cover;object-fit:cover;position:absolute;top:0;width:100%}.animated-super-row{--translateY:100%;bottom:0;left:0;position:absolute;right:0;top:0;transition:transform var(--pm-transition),opacity var(--pm-transition)}body.animation-level-0 .animated-super-row{transition:none}.animated-super-row.is-hiding{opacity:0}.animated-super-row.is-hiding.from-top{transform:translate3d(0,calc(var(--translateY)*-1),0)}.animated-super-row.is-hiding.from-bottom{transform:translate3d(0,var(--translateY),0)}.animated-counter{display:inline-flex}.animated-counter-decimal{position:relative}.animated-counter-decimal-placeholder{color:transparent}.animated-counter-decimal-wrapper{bottom:0;left:0;position:absolute;right:0;top:0}middle-ellipsis-element{display:block;overflow:hidden;width:100%}.album-item-media{height:100%;width:100%}html.no-touch .hover-effect:active,html.no-touch .hover-effect:hover{background-color:var(--light-secondary-text-color)}.progress-ring{left:0;pointer-events:none;position:absolute;top:0}.progress-ring__circle{stroke-linecap:round;transition:stroke-dashoffset}.rlottie,.rlottie-vector{bottom:0;height:100%;left:0;max-height:100%;max-width:100%;position:absolute;right:0;top:0;width:100%}.rlottie-icon{pointer-events:none;position:relative}body.animation-level-2 .rlottie.fade-in{animation:fade-in-opacity .2s ease-in-out forwards}.rlottie-vector{fill:rgba(0,0,0,.08)}.canvas-thumbnail{height:100%;position:absolute;width:100%}.media-container-contain{position:relative}.media-container-contain .media-photo{max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain}.media-container-cover{position:relative}.media-container-cover .media-photo{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.media-photo,.media-poster,.media-round,.media-sticker,.media-video{bottom:0;left:0;position:absolute;right:0;top:0}body.animation-level-2 .media-photo.fade-in,body.animation-level-2 .media-poster.fade-in,body.animation-level-2 .media-round.fade-in,body.animation-level-2 .media-sticker.fade-in,body.animation-level-2 .media-video.fade-in{animation:fade-in-opacity .2s ease-in-out forwards}body.animation-level-2 .media-photo.fade-out,body.animation-level-2 .media-poster.fade-out,body.animation-level-2 .media-round.fade-out,body.animation-level-2 .media-sticker.fade-out,body.animation-level-2 .media-video.fade-out{animation:fade-out-opacity .2s ease-in-out forwards}.media-video{z-index:1}.media-sticker{height:100%;margin:auto;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;width:100%}.media-sticker-wrapper.is-premium-sticker:before{align-items:center;background:rgba(0,0,0,.2);background-image:var(--lock-url);background-repeat:no-repeat;background-size:cover;border-radius:50%;bottom:.125rem;color:#fff;display:flex;height:1.25rem;justify-content:center;left:50%;position:absolute;transform:translateX(-50%);width:1.25rem;z-index:1}body.is-premium .media-sticker-wrapper.is-premium-sticker:after,body.is-premium .media-sticker-wrapper.is-premium-sticker:before{content:none}.media-round{max-height:var(--round-video-size);max-width:var(--round-video-size);z-index:1}.media-round canvas{border-radius:50%;height:100%;position:relative;width:100%}.media-round .video-time{background-color:var(--message-highlightning-color)!important;padding:0 .375rem}[dir=ltr] .media-round .video-time:after,[dir=ltr] .media-round .video-time:before{margin-left:.25rem}[dir=rtl] .media-round .video-time:after,[dir=rtl] .media-round .video-time:before{margin-right:.25rem}.media-round.is-unread .video-time:before{background-color:#fff;border-radius:50%;content:" ";height:.5rem;order:1;width:.5rem}.media-round.is-paused .video-time:after{align-items:center;content:"";display:flex;font-size:1.125rem;order:2}.gradient-delimiter{background-color:var(--background-color-true);height:.75rem;position:relative;width:100%}.gradient-delimiter:before{background:linear-gradient(180deg,rgba(0,0,0,.06),transparent 20%,transparent 94%,rgba(0,0,0,.06));bottom:0;content:" ";left:0;position:absolute;right:0;top:0}.sidebar-left-section{background-color:var(--surface-color);box-shadow:0 1px 3px 0 var(--section-box-shadow-color);margin-bottom:.75rem;padding:.5rem 0!important}.sidebar-left-section.no-shadow{box-shadow:none!important}.sidebar-left-section-name{padding:.5rem 1rem}.sidebar-left-section-caption{font-size:var(--font-size-14);line-height:var(--line-height-14);margin:-.1875rem 0 1rem;padding:0 1.5rem}.sidebar-left-section-caption:first-child{margin-bottom:.8125rem;margin-top:.8125rem}@media only screen and (max-width:600px){.sidebar-left-section-caption{padding:0 1rem}}.sidebar-left-section-container{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sidebar-left-section-container a{cursor:pointer}hr{display:none!important}.tgico-admin:before,.tgico-fontsize:before{font-size:20px!important;padding:2px}.tgico-endcall_filled,.tgico-phone_filled{font-size:26px!important}.stealthy{left:0;margin:0;max-height:1px;max-width:1px;opacity:0;outline:none;overflow:hidden;pointer-events:none;position:absolute;top:0;z-index:-1}.navigable-list .active{background-color:var(--light-secondary-text-color);border-radius:inherit}.super-emojis{--esg-emoji-total-size:calc(var(--esg-emoji-size) + 0.5rem);--custom-emoji-size:var(--esg-emoji-size);grid-column-gap:2.44px;--esg-emoji-size:2.125rem;--esg-emoji-total-size:2.625rem;--custom-emoji-size:2.25rem;-moz-column-gap:2.44px;column-gap:2.44px;-moz-column-gap:.25rem;column-gap:.25rem;display:grid;font-size:var(--esg-emoji-size);grid-template-columns:repeat(auto-fill,var(--esg-emoji-total-size));justify-content:space-between;line-height:var(--esg-emoji-size);position:relative}.super-emojis .super-emoji{border-radius:8px;cursor:pointer;display:inline-block;height:var(--esg-emoji-total-size);line-height:inherit;margin-left:.0625rem;margin-right:.0625rem;padding:.25rem;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:var(--esg-emoji-total-size)}.super-emojis .super-emoji .emoji-placeholder{background-color:var(--light-secondary-text-color);border-radius:50%;height:1.75rem;left:7px;pointer-events:none;position:absolute;top:7px;width:1.75rem}body.animation-level-2 .super-emojis .super-emoji .emoji-placeholder{opacity:0;transition:opacity .2s ease-in-out}body.animation-level-2 .super-emojis .super-emoji img{opacity:1;transition:opacity .2s ease-in-out}.super-emojis .super-emoji .emoji{height:100%;margin:0;vertical-align:baseline;vertical-align:initial;width:100%}.super-emojis .super-emoji.active,html.no-touch .super-emojis .super-emoji:active,html.no-touch .super-emojis .super-emoji:hover{background-color:var(--light-secondary-text-color)}.super-emojis.not-local .super-emoji{padding:.1875rem}.super-emojis .super-emoji{margin:0}.super-emojis:not(.not-local) .super-emoji{overflow:hidden}html.native-emoji .super-emojis:not(.not-local) .super-emoji{padding-bottom:.3125rem;padding-top:.3125rem}.super-emojis .custom-emoji{display:block}.super-emojis .custom-emoji-renderer{z-index:1}.super-emojis .custom-emoji:before{content:none}.tgico-char:before{font-family:Roboto!important;font-weight:var(--font-weight-bold);text-align:center;width:1.5rem}.tgico-char.z:before{content:"Z"}.tgico-char.w:before{content:"W"}.sending-status:empty{display:none}.sending-status .tgico-sendingerror{color:var(--danger-color)}.sending-status-icon{line-height:1!important;position:absolute}.quick-reaction-title{align-items:center;display:flex}.quick-reaction-sticker{height:32px!important;margin:0 .5rem 0 0!important;position:relative!important;width:32px!important}.verified-icon-svg{height:1rem;width:1rem}.verified-icon-check{fill:#fff}.verified-icon-background{fill:var(--primary-color)}[dir=ltr] .emoji-status,[dir=ltr] .premium-icon,[dir=ltr] .verified-icon{margin-left:.125rem}[dir=rtl] .emoji-status,[dir=rtl] .premium-icon,[dir=rtl] .verified-icon{margin-right:.125rem}.emoji-status,.premium-icon,.verified-icon{align-items:center;display:flex;flex:0 0 auto;font-size:1rem;height:1.25rem;justify-content:center;width:1.25rem}[dir=ltr] .emoji-status{margin-left:.25rem}[dir=rtl] .emoji-status{margin-right:.25rem}.emoji-status{height:1.125rem;position:relative;width:1.125rem}.premium-icon{color:var(--primary-color);margin-top:-.0625rem}.badge-fake{border:1px solid var(--danger-color);border-radius:.185rem;color:var(--danger-color);flex:0 0 auto;font-size:.625rem;font-weight:var(--font-weight-bold);line-height:1!important;margin-left:.25rem;margin-right:.25rem;padding:.125rem .25rem}.peer-title.with-icons{align-items:center;display:flex;overflow:hidden}.peer-title-inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.limit-line{display:flex;font-weight:var(--font-weight-bold);height:2rem}.limit-line-free{color:#000}.limit-line-premium{color:#fff}.limit-line-free{background-color:#f1f3f5;border-bottom-left-radius:10px;border-top-left-radius:10px}.limit-line-premium{background:linear-gradient(84.4deg,#6c93ff -4.85%,#976fff 51.72%,#df69d1 110.7%);border-bottom-right-radius:10px;border-top-right-radius:10px}.limit-line-free,.limit-line-premium{align-items:center;display:flex;flex:1 1 0;justify-content:space-between;padding:0 .75rem}.movable-element{--size:.5rem;position:relative}.movable-element-resize-handler{position:absolute}.movable-element-resize-handler-side-n,.movable-element-resize-handler-side-s{cursor:row-resize;height:var(--size);left:0;right:0}.movable-element-resize-handler-side-e,.movable-element-resize-handler-side-w{bottom:0;cursor:col-resize;top:0;width:var(--size)}.movable-element-resize-handler-side-n{top:0}.movable-element-resize-handler-side-e{right:0}.movable-element-resize-handler-side-s{bottom:0}.movable-element-resize-handler-side-w{left:0}.movable-element-resize-handler-side-ne,.movable-element-resize-handler-side-nw,.movable-element-resize-handler-side-se,.movable-element-resize-handler-side-sw{height:var(--size);width:var(--size);z-index:1}.movable-element-resize-handler-side-ne,.movable-element-resize-handler-side-sw{cursor:nesw-resize}.movable-element-resize-handler-side-nw,.movable-element-resize-handler-side-se{cursor:nwse-resize}.movable-element-resize-handler-side-ne{right:0;top:0}.movable-element-resize-handler-side-se{bottom:0;right:0}.movable-element-resize-handler-side-sw{bottom:0;left:0}.movable-element-resize-handler-side-nw{left:0;top:0}[dir=ltr] .chatlist-chat.row-with-padding{padding-left:4.5rem!important}[dir=rtl] .chatlist-chat.row-with-padding{padding-right:4.5rem!important}.chatlist-chat span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chatlist-chat .row-title{font-size:var(--font-size-16)!important;line-height:1.375rem}.chatlist-chat .row-title-right-secondary{font-size:var(--font-size-12)!important;line-height:var(--line-height-12)!important;margin-top:-.4375rem}.chatlist-chat .row-subtitle{display:block!important}.chatlist-chat .row-row{height:1.375rem}.chatlist-chat.chatlist-chat-abitbigger .row-subtitle{margin-top:0}.chatlist-chat.chatlist-chat-bigger .row-subtitle{font-size:var(--font-size-16)!important;line-height:1.375rem;margin-top:0}.chatlist-chat.chatlist-chat-bigger .row-subtitle-row{margin-top:.125rem}.chatlist-chat.chatlist-chat-bigger .row-title .peer-title{font-weight:var(--font-weight-bold)}.username-purchase-help b{color:var(--danger-color)!important;font-weight:var(--font-weight-normal)!important}.media-spoiler-container{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0;z-index:1}.media-spoiler-container.is-revealing{opacity:1}.media-spoiler-container.is-revealing:not(.backwards){opacity:0}.media-spoiler-container.is-revealing.animating{transition:opacity var(--transition-standard-out)}.media-spoiler .canvas-thumbnail,.media-spoiler-thumbnail{height:100%;-o-object-fit:initial!important;object-fit:fill!important;position:absolute;width:100%}.accordion{height:0;overflow:hidden}.accordion.is-expanded{height:var(--max-height)}body.animation-level-2 .accordion{transition:height var(--transition-standard-in)}.accordion-icon{color:var(--secondary-text-color);display:inline-block;font-size:1.25rem;line-height:0;transform:rotate(0deg) translateY(4px)}body.animation-level-2 .accordion-icon{transition:transform var(--transition-standard-in)}.accordion-toggler-expanded .accordion-icon{transform:translateY(4px) rotate(180deg)} - -/*# sourceMappingURL=main.6e3cb54d0a85ecdda73e.css.map*/ \ No newline at end of file diff --git a/public/main.6e3cb54d0a85ecdda73e.css.map b/public/main.6e3cb54d0a85ecdda73e.css.map deleted file mode 100644 index a75e4699..00000000 --- a/public/main.6e3cb54d0a85ecdda73e.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.6e3cb54d0a85ecdda73e.css","mappings":"AAAA,2EAA2E,CAAC,KAAK,yBAAyB,CAAC,6BAA6B,CAAC,gBAAgB,CAAC,KAAK,QAAQ,CAAC,wCAAwC,aAAa,CAAC,GAAG,aAAa,CAAC,cAAc,CAAC,uBAAuB,aAAa,CAAC,OAAO,eAAe,CAAC,GAAG,sB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":["/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;line-height:1.15}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{-webkit-text-decoration-skip:objects;background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted currentColor;text-decoration:underline dotted currentColor}b,strong{font-weight:inherit;font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}[hidden],template{display:none}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}ul:not(.browser-default){list-style-type:none;padding-left:0}ul:not(.browser-default)>li{list-style-type:none}a{-webkit-tap-highlight-color:rgba(0,0,0,0)}button{background:none;border:none;cursor:pointer;outline:none;padding:0}img,video{-webkit-user-drag:none}.valign-wrapper{align-items:center;display:flex}.z-depth-0{box-shadow:none!important}.z-depth-1{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2)}.z-depth-1-half{box-shadow:0 3px 3px 0 rgba(0,0,0,.14),0 1px 7px 0 rgba(0,0,0,.12),0 3px 1px -1px rgba(0,0,0,.2)}.z-depth-2{box-shadow:0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.3)}.z-depth-3{box-shadow:0 8px 17px 2px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.2)}.z-depth-4{box-shadow:0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12),0 8px 10px -7px rgba(0,0,0,.2)}.z-depth-5{box-shadow:0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12),0 11px 15px -7px rgba(0,0,0,.2)}.hide{display:none!important}.hide-overflow{overflow:hidden}.no-select{-webkit-user-select:none;-moz-user-select:none;user-select:none}.no-transition,.no-transition:after,.no-transition:before{transition:none!important}.inline{display:inline}.center-align,.text-center{text-align:center}.justify-start{justify-content:flex-start!important}.justify-self-start{justify-self:flex-start!important}.justify-self-end{justify-self:flex-end!important}.position-center{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.text-bold{font-weight:500!important}.text-super{display:inline-table}.text-uppercase{text-transform:uppercase}.pre-wrap{white-space:pre-wrap!important}.no-wrap{white-space:nowrap!important}.no-border-radius{border-radius:0!important}.disable-hover{pointer-events:none!important}.reflect-x{transform:scaleX(-1)}[dir=auto]{unicode-bidi:plaintext}.is-rtl [dir=auto]{direction:inherit}a{text-decoration:none}html{font-weight:400;line-height:1.5}h1,h2,h3,h4,h5,h6{line-height:1.3}em{font-style:italic}strong{font-weight:500}small{font-size:75%}code,pre{word-wrap:break-word;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap}",":root{--vh:1vh;--z-below:-1;--hover-alpha:0.08;--transition-standard-easing:cubic-bezier(.4,.0,.2,1);--transition-standard-in-time:.3s;--transition-standard-out-time:.25s;--transition-standard-in:var(--transition-standard-in-time) var(--transition-standard-easing);--transition-standard-out:var(--transition-standard-out-time) var(--transition-standard-easing);--pm-transition:.2s ease-in-out;--layer-transition:.2s cubic-bezier(.4,.0,.2,1);--slide-header-transition:.4s ease-in-out;--tabs-transition:.2s ease-in-out;--btn-menu-transition:.2s cubic-bezier(.4,0,.2,1);--esg-transition:var(--btn-menu-transition);--input-transition:.2s ease-out;--sticker-viewer-open-transition-in:.2s var(--transition-standard-easing);--sticker-viewer-open-transition-out:.2s var(--transition-standard-easing);--sticker-viewer-switch-transition:.2s cubic-bezier(.12,1.1,.56,1.2);--popup-transition-function:cubic-bezier(.4,0,.2,1);--popup-transition-time:.15s;--btn-corner-transition:.2s cubic-bezier(.34,1.56,.64,1);--chatlist-badge-transition-in:.25s cubic-bezier(.35,.35,.47,1.34);--chatlist-badge-transition-out:.25s cubic-bezier(.35,.35,.7,1);--message-handhelds-margin:5.5625rem;--message-beside-button-size:2.375rem;--message-beside-button-margin:calc((var(--message-beside-button-size) + 0.5rem)*-1);--message-time-background:rgba(0,0,0,.35);--message-highlightning-color:rgba(109,141,65,.4);--messages-container-width:728px;--messages-text-size:16px;--messages-line-height:1.3125;--messages-secondary-text-size:calc(var(--messages-text-size) - 2px);--messages-secondary-line-height:calc(var(--messages-secondary-text-size) + 4px);--messages-time-text-size:calc(var(--messages-text-size) - 4px);--messages-service-text-size:calc(var(--messages-text-size) - 1px);--messages-custom-emoji-size:calc(var(--messages-text-size) + 4px);--bubble-transition-in:transform var(--transition-standard-in),opacity var(--transition-standard-in);--bubble-transition-out:transform var(--transition-standard-out),opacity var(--transition-standard-out);--line-height-20:26px;--line-height-16:21px;--line-height-14:18px;--line-height-12:16px;--line-height:1.3125;--font-size-20:20px;--font-size-16:16px;--font-size-14:14px;--font-size-12:12px;--font-size:var(--font-size-16);--esg-sticker-size:72px;--esg-custom-emoji-size:36px;--popup-sticker-size:80px;--disabled-opacity:.3;--round-video-size:280px;--menu-box-shadow:0px 0px 10px var(--menu-box-shadow-color);--menu-backdrop-filter:blur(50px);--font-monospace:\"Roboto Mono\",monospace;--font-weight-bold:500;--font-weight-normal:400;--selection-background-color:rgba(var(--primary-color-rgb),.4);--selection-color:inherit;--topbar-floating-scaleX:1;--topbar-call-height:3rem;--topbar-floating-call-height:0px;--call-button-size:3.375rem;--call-button-margin:2rem;--custom-emoji-size:1.25rem;--esg-width:100%;--peer-avatar-red-top:#ff845e;--peer-avatar-red-bottom:#d45246;--peer-avatar-orange-top:#febb5b;--peer-avatar-orange-bottom:#f68136;--peer-avatar-violet-top:#b694f9;--peer-avatar-violet-bottom:#6c61df;--peer-avatar-green-top:#9ad164;--peer-avatar-green-bottom:#46ba43;--peer-avatar-cyan-top:#53edd6;--peer-avatar-cyan-bottom:#28c9b7;--peer-avatar-blue-top:#5bcbe3;--peer-avatar-blue-bottom:#359ad4;--peer-avatar-pink-top:#ff8aac;--peer-avatar-pink-bottom:#d95574;--peer-avatar-archive-top:#b8c2cc;--peer-avatar-archive-bottom:#9eaab5;--peer-avatar-saved-top:var(--light-filled-saved-color);--peer-avatar-saved-bottom:var(--saved-color);--avatar-color-top:var(--peer-avatar-saved-top);--avatar-color-bottom:var(--peer-avatar-saved-bottom);--avatar-border-radius-forum:37%;--premium-gradient:linear-gradient(52.62deg,#6b93ff 12.22%,#976fff 50.25%,#e46ace 98.83%)}@media only screen and (max-width:600px){:root{--right-column-width:100vw;--esg-sticker-size:68px;--popup-sticker-size:68px;--round-video-size:200px;--chat-input-size:2.875rem;--chat-input-padding:0.5rem;--chat-input-inner-padding:0.25rem}}@media only screen and (min-width:601px){:root{--right-column-width:420px;--chat-input-size:3.375rem;--chat-input-padding:0.8125rem;--chat-input-inner-padding:0.5rem}}@media only screen and (max-height:569px){:root{--chat-input-size:2.875rem;--chat-input-inner-padding:0.25rem}}@media only screen and (min-height:570px)and (min-width:601px){:root{--esg-width:23.875rem}}@media only screen and (min-width:1276px)and (max-width:1680px){:root{--right-column-width:25vw}}:root{--body-background-color:#fff;--background-color-true:#f4f4f5;--background-color:var(--background-color-true);--border-color:#dfe1e5;--scrollbar-color:rgba(0,0,0,.2);--section-box-shadow-color:rgba(0,0,0,.06);--menu-box-shadow-color:rgba(0,0,0,.15);--input-search-background-color:#fff;--input-search-border-color:#dfe1e5;--secondary-color:#c4c9cc;--avatar-online-color:var(--primary-color);--chatlist-status-color:var(--avatar-online-color);--chatlist-pinned-color:#a2abb2;--badge-text-color:#fff;--link-color:#00488f;--ripple-color:rgba(0,0,0,.08);--poll-circle-color:var(--border-color);--spoiler-background-color:#e3e5e8;--spoiler-draft-background-color:#d9d9d9;--monospace-text-color:var(--danger-color);--backdrop-opacity:.85;--menu-background-color:rgba(var(--surface-color-rgb),var(--backdrop-opacity));--message-background-color:var(--surface-color);--message-time-color:var(--secondary-text-color);--message-checkbox-color:#61c642;--message-checkbox-border-color:#fff;--message-primary-color:var(--primary-color);--light-filled-message-primary-color:var(--light-filled-primary-color);--message-secondary-color:var(--secondary-color);--message-error-color:var(--danger-color);--message-out-link-color:var(--link-color);--message-out-status-color:var(--message-out-primary-color);--message-out-time-color:var(--message-out-status-color);--message-out-audio-play-button-color:#fff;--message-out-selection-background-color:var(--selection-background-color);--gc-background-color:#212121;--gc-button-leave-color:rgba(255,89,90,.3);--gc-button-unmuted-color:rgba(1,200,80,.2);--gc-button-muted-color:rgba(60,135,247,.2);--gc-button-hand-color:rgba(223,68,184,.2);--gc-button-unmuted-fill-color:#195530;--gc-button-muted-fill-color:#3c87f7;--gc-green-color:#195530;--gc-blue-color:#3c87f7;--gc-red-color:#643333;--gc-primary-text-color:#fff;--gc-secondary-text-color:#aaa;--gc-green-text-color:#5cc85e;--gc-blue-text-color:#3390ec;--gc-red-text-color:#ff595a;--gc-right-column-width:26.25rem}.night{--body-background-color:#181818;--background-color-true:#181818;--background-color:var(--background-color-true);--border-color:#0f0f0f;--scrollbar-color:hsla(0,0%,100%,.2);--section-box-shadow-color:rgba(0,0,0,.12);--input-search-background-color:#181818;--input-search-border-color:#2f2f2f;--secondary-color:#707579;--avatar-online-color:var(--primary-color);--chatlist-status-color:var(--primary-color);--chatlist-pinned-color:var(--secondary-color);--badge-text-color:#fff;--link-color:var(--primary-color);--ripple-color:hsla(0,0%,100%,.08);--poll-circle-color:#fff;--spoiler-background-color:#373e4e;--spoiler-draft-background-color:#484848;--monospace-text-color:var(--primary-text-color);--menu-background-color:rgba(var(--surface-color-rgb),.75);--message-background-color:var(--surface-color);--message-time-color:var(--secondary-text-color);--message-checkbox-color:var(--primary-color);--message-checkbox-border-color:#fff;--message-secondary-color:var(--secondary-color);--message-error-color:#fff;--message-out-link-color:#fff;--message-out-status-color:#fff;--message-out-time-color:hsla(0,0%,100%,.6);--message-out-audio-play-button-color:var(--message-out-background-color);--message-out-selection-background-color:rgba(var(--surface-color-rgb),.4)}@font-face{font-display:block;font-family:tgico;font-style:normal;font-weight:400;src:url(assets/fonts/tgico.ttf?2fcrrv) format(\"truetype\"),url(assets/fonts/tgico.woff?2fcrrv) format(\"woff\"),url(assets/fonts/tgico.svg?2fcrrv#tgico) format(\"svg\")}.tgico:after,.tgico:before,[class*=\" tgico-\"]:after,[class*=\" tgico-\"]:before,[class^=tgico-]{speak:never;font-feature-settings:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:tgico!important;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none}.tgico-check:before{content:\"\"}.tgico-checks:before{content:\"\"}.tgico-activesessions:before{content:\"\"}.tgico-add:before{content:\"\"}.tgico-add_reaction:before{content:\"\"}.tgico-addmember_filled:before{content:\"\"}.tgico-adduser:before{content:\"\"}.tgico-admin:before{content:\"\"}.tgico-animals:before{content:\"\"}.tgico-animations:before{content:\"\"}.tgico-archive:before{content:\"\"}.tgico-arrow_down:before{content:\"\"}.tgico-arrow_next:before{content:\"\"}.tgico-attach:before{content:\"\"}.tgico-audio_repeat:before{content:\"\"}.tgico-audio_repeat_single:before{content:\"\"}.tgico-avatarnext:before{content:\"\"}.tgico-avatarprevious:before{content:\"\"}.tgico-binfilled:before{content:\"\"}.tgico-bold:before{content:\"\"}.tgico-botcom:before{content:\"\"}.tgico-bots:before{content:\"\"}.tgico-bug:before{content:\"\"}.tgico-calendar:before{content:\"\"}.tgico-calendarfilter:before{content:\"\"}.tgico-camera:before{content:\"\"}.tgico-cameraadd:before{content:\"\"}.tgico-car:before{content:\"\"}.tgico-card:before{content:\"\"}.tgico-card_outline:before{content:\"\"}.tgico-channel:before{content:\"\"}.tgico-channelviews:before{content:\"\"}.tgico-chatspinned:before{content:\"\"}.tgico-chatsplaceholder:before{content:\"\"}.tgico-check1:before{content:\"\"}.tgico-checkbox:before{content:\"\"}.tgico-checkboxblock:before{content:\"\"}.tgico-checkboxempty:before{content:\"\"}.tgico-checkboxon:before{content:\"\"}.tgico-checkretract:before{content:\"\"}.tgico-checkround:before{content:\"\"}.tgico-close:before{content:\"\"}.tgico-clouddownload:before{content:\"\"}.tgico-colorize:before{content:\"\"}.tgico-comments:before{content:\"\"}.tgico-commentssticker:before{content:\"\"}.tgico-copy:before{content:\"\"}.tgico-darkmode:before{content:\"\"}.tgico-data:before{content:\"\"}.tgico-delete:before{content:\"\"}.tgico-delete_filled:before{content:\"\"}.tgico-deletedaccount:before{content:\"\"}.tgico-deleteleft:before{content:\"\"}.tgico-deleteuser:before{content:\"\"}.tgico-devices:before{content:\"\"}.tgico-document:before{content:\"\"}.tgico-down:before{content:\"\"}.tgico-download:before{content:\"\"}.tgico-dragfiles:before{content:\"\"}.tgico-dragmedia:before{content:\"\"}.tgico-eats:before{content:\"\"}.tgico-edit:before{content:\"\"}.tgico-email:before{content:\"\"}.tgico-endcall_filled:before{content:\"\"}.tgico-enter:before{content:\"\"}.tgico-eye1:before{content:\"\"}.tgico-eye2:before{content:\"\"}.tgico-fast_forward:before{content:\"\"}.tgico-fast_rewind:before{content:\"\"}.tgico-favourites:before{content:\"\"}.tgico-flag:before{content:\"\"}.tgico-flip:before{content:\"\"}.tgico-folder:before{content:\"\"}.tgico-fontsize:before{content:\"\"}.tgico-forward:before{content:\"\"}.tgico-forward_filled:before{content:\"\"}.tgico-fullscreen:before{content:\"\"}.tgico-gc_microphone:before{content:\"\"}.tgico-gc_microphoneoff:before{content:\"\"}.tgico-gifs:before{content:\"\"}.tgico-group:before{content:\"\"}.tgico-groupmedia:before{content:\"\"}.tgico-groupmediaoff:before{content:\"\"}.tgico-help:before{content:\"\"}.tgico-hide:before{content:\"\"}.tgico-image:before{content:\"\"}.tgico-info:before{content:\"\"}.tgico-info2:before{content:\"\"}.tgico-italic:before{content:\"\"}.tgico-keyboard:before{content:\"\"}.tgico-lamp:before{content:\"\"}.tgico-language:before{content:\"\"}.tgico-largepause:before{content:\"\"}.tgico-largeplay:before{content:\"\"}.tgico-left:before{content:\"\"}.tgico-limit_chat:before{content:\"\"}.tgico-limit_chats:before{content:\"\"}.tgico-limit_file:before{content:\"\"}.tgico-limit_folders:before{content:\"\"}.tgico-limit_link:before{content:\"\"}.tgico-limit_pin:before{content:\"\"}.tgico-link:before{content:\"\"}.tgico-listscreenshare:before{content:\"\"}.tgico-livelocation:before{content:\"\"}.tgico-location:before{content:\"\"}.tgico-lock:before{content:\"\"}.tgico-lockoff:before{content:\"\"}.tgico-loginlogodesktop:before{content:\"\"}.tgico-loginlogomobile:before{content:\"\"}.tgico-logout:before{content:\"\"}.tgico-mediaspoiler:before{content:\"\"}.tgico-mediaspoileroff:before{content:\"\"}.tgico-mention:before{content:\"\"}.tgico-menu:before{content:\"\"}.tgico-message:before{content:\"\"}.tgico-messageunread:before{content:\"\"}.tgico-microphone:before{content:\"\"}.tgico-microphone_crossed:before{content:\"\"}.tgico-microphone_crossed_filled:before{content:\"\"}.tgico-microphone_filled:before{content:\"\"}.tgico-minus:before{content:\"\"}.tgico-monospace:before{content:\"\"}.tgico-more:before{content:\"\"}.tgico-mute:before{content:\"\"}.tgico-muted:before{content:\"\"}.tgico-newchannel:before{content:\"\"}.tgico-newchat_filled:before{content:\"\"}.tgico-newgroup:before{content:\"\"}.tgico-newprivate:before{content:\"\"}.tgico-next:before{content:\"\"}.tgico-noncontacts:before{content:\"\"}.tgico-nosound:before{content:\"\"}.tgico-passwordoff:before{content:\"\"}.tgico-pause:before{content:\"\"}.tgico-permissions:before{content:\"\"}.tgico-phone:before{content:\"\"}.tgico-pin:before{content:\"\"}.tgico-pinlist:before{content:\"\"}.tgico-pinned_filled:before{content:\"\"}.tgico-pinnedchat:before{content:\"\"}.tgico-pip:before{content:\"\"}.tgico-play:before{content:\"\"}.tgico-playback_05:before{content:\"\"}.tgico-playback_15:before{content:\"\"}.tgico-playback_1x:before{content:\"\"}.tgico-playback_2x:before{content:\"\"}.tgico-plus:before{content:\"\"}.tgico-poll:before{content:\"\"}.tgico-premium_addone:before{content:\"\"}.tgico-premium_double:before{content:\"\"}.tgico-premium_lock:before{content:\"\"}.tgico-premium_unlock:before{content:\"\"}.tgico-previous:before{content:\"\"}.tgico-radiooff:before{content:\"\"}.tgico-radioon:before{content:\"\"}.tgico-reactions:before{content:\"\"}.tgico-readchats:before{content:\"\"}.tgico-recent:before{content:\"\"}.tgico-replace:before{content:\"\"}.tgico-reply:before{content:\"\"}.tgico-reply_filled:before{content:\"\"}.tgico-rightpanel:before{content:\"\"}.tgico-rotate_left:before{content:\"\"}.tgico-rotate_right:before{content:\"\"}.tgico-saved:before{content:\"\"}.tgico-savedmessages:before{content:\"\"}.tgico-schedule:before{content:\"\"}.tgico-scheduled:before{content:\"\"}.tgico-search:before{content:\"\"}.tgico-select:before{content:\"\"}.tgico-send:before{content:\"\"}.tgico-send2:before{content:\"\"}.tgico-sending:before{content:\"\"}.tgico-sendingerror:before{content:\"\"}.tgico-settings:before{content:\"\"}.tgico-settings_filled:before{content:\"\"}.tgico-sharescreen_filled:before{content:\"\"}.tgico-shipping:before{content:\"\"}.tgico-shuffle:before{content:\"\"}.tgico-smallscreen:before{content:\"\"}.tgico-smile:before{content:\"\"}.tgico-spoiler:before{content:\"\"}.tgico-sport:before{content:\"\"}.tgico-star:before{content:\"\"}.tgico-stickers:before{content:\"\"}.tgico-stickers_face:before{content:\"\"}.tgico-stop:before{content:\"\"}.tgico-strikethrough:before{content:\"\"}.tgico-textedit:before{content:\"\"}.tgico-tip:before{content:\"\"}.tgico-tools:before{content:\"\"}.tgico-topics:before{content:\"\"}.tgico-transcribe:before{content:\"\"}.tgico-unarchive:before{content:\"\"}.tgico-underline:before{content:\"\"}.tgico-unmute:before{content:\"\"}.tgico-unpin:before{content:\"\"}.tgico-unread:before{content:\"\"}.tgico-up:before{content:\"\"}.tgico-user:before{content:\"\"}.tgico-username:before{content:\"\"}.tgico-videocamera:before{content:\"\"}.tgico-videocamera_crossed_filled:before{content:\"\"}.tgico-videocamera_filled:before{content:\"\"}.tgico-videochat:before{content:\"\"}.tgico-volume_down:before{content:\"\"}.tgico-volume_mute:before{content:\"\"}.tgico-volume_off:before{content:\"\"}.tgico-volume_up:before{content:\"\"}.tgico-zoomin:before{content:\"\"}.tgico-zoomout:before{content:\"\"}.tgico-phone_filled:before{content:\"\";transform:rotate(-135deg)}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:400;src:local(\"Roboto\"),local(\"Roboto-Regular\"),url(assets/fonts/KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2) format(\"woff2\");unicode-range:U400-45F,U490-491,U4B0-4B1,U2116}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:400;src:local(\"Roboto\"),local(\"Roboto-Regular\"),url(assets/fonts/KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2) format(\"woff2\");unicode-range:U100-24F,U259,U1-1EFF,U2020,U20A0-20AB,U20AD-20CF,U2113,U2C60-2C7F,UA720-A7FF}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:400;src:local(\"Roboto\"),local(\"Roboto-Regular\"),url(assets/fonts/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2) format(\"woff2\");unicode-range:U0-0FF,U131,U152-153,U2BB-2BC,U2C6,U2DA,U2DC,U2000-206F,U2074,U20AC,U2122,U2191,U2193,U2212,U2215,UFEFF,UFFFD}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:500;src:local(\"Roboto Medium\"),local(\"Roboto-Medium\"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2) format(\"woff2\");unicode-range:U400-45F,U490-491,U4B0-4B1,U2116}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:500;src:local(\"Roboto Medium\"),local(\"Roboto-Medium\"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2) format(\"woff2\");unicode-range:U100-24F,U259,U1-1EFF,U2020,U20A0-20AB,U20AD-20CF,U2113,U2C60-2C7F,UA720-A7FF}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:500;src:local(\"Roboto Medium\"),local(\"Roboto-Medium\"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2) format(\"woff2\");unicode-range:U0-0FF,U131,U152-153,U2BB-2BC,U2C6,U2DA,U2DC,U2000-206F,U2074,U20AC,U2122,U2191,U2193,U2212,U2215,UFEFF,UFFFD}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:600;src:local(\"Roboto Medium\"),local(\"Roboto-Medium\"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2) format(\"woff2\");unicode-range:U400-45F,U490-491,U4B0-4B1,U2116}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:600;src:local(\"Roboto Medium\"),local(\"Roboto-Medium\"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2) format(\"woff2\");unicode-range:U100-24F,U259,U1-1EFF,U2020,U20A0-20AB,U20AD-20CF,U2113,U2C60-2C7F,UA720-A7FF}@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:600;src:local(\"Roboto Medium\"),local(\"Roboto-Medium\"),url(assets/fonts/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2) format(\"woff2\");unicode-range:U0-0FF,U131,U152-153,U2BB-2BC,U2C6,U2DA,U2DC,U2000-206F,U2074,U20AC,U2122,U2191,U2193,U2212,U2215,UFEFF,UFFFD}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEluUlco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEn-Ulco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEmOUlco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtElOUlco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+1ea0-1ef9,u+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEleUlco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0100-024f,u+0259,u+1e??,u+2020,u+20a0-20ab,u+20ad-20cf,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:400;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEm-Ulco8VkA.woff2) format(\"woff2\");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEluUlco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEn-Ulco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEmOUlco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtElOUlco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+1ea0-1ef9,u+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEleUlco8VkKjG.woff2) format(\"woff2\");unicode-range:u+0100-024f,u+0259,u+1e??,u+2020,u+20a0-20ab,u+20ad-20cf,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:italic;font-weight:500;src:url(assets/fonts/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEm-Ulco8VkA.woff2) format(\"woff2\");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSV0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSx0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSt0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSd0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+1ea0-1ef9,u+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSZ0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0100-024f,u+0259,u+1e??,u+2020,u+20a0-20ab,u+20ad-20cf,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:400;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0me8iUI0.woff2) format(\"woff2\");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSV0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSx0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSt0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSd0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+1ea0-1ef9,u+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSZ0me8iUI0lkQ.woff2) format(\"woff2\");unicode-range:u+0100-024f,u+0259,u+1e??,u+2020,u+20a0-20ab,u+20ad-20cf,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(assets/fonts/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0me8iUI0.woff2) format(\"woff2\");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}.input-wrapper{margin:0 auto;width:360px}.input-field{--height:54px;--border-radius:10px;position:relative}@media only screen and (max-width:600px){.input-field{--height:50px}}.input-field .arrow-down{border:solid var(--secondary-text-color);border-radius:1px;border-width:0 2px 2px 0;bottom:0;content:\" \";cursor:pointer;display:inline-block;height:0;margin-top:-9px;padding:5px;position:absolute;right:21px;top:50%;transform:rotate(45deg);-webkit-transform:rotate(45deg);transition:all .2s;vertical-align:middle;width:0;z-index:2}[dir=ltr] .input-field label{left:1rem}[dir=rtl] .input-field label{right:1rem}.input-field label{background-color:var(--surface-color);color:#9e9e9e;height:1.5rem;margin-top:calc((var(--height) - 1.5rem)/2);pointer-events:none;position:absolute;right:auto;top:0;transform:translate(0);transform-origin:left center;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;z-index:2}.is-rtl .input-field label{transform-origin:right center}body.animation-level-2 .input-field label{transition:transform .2s,padding .2s,opacity .1s,font-weight 0s .1s}.input-field-border{border:2px solid var(--primary-color);border-radius:var(--border-radius);bottom:0;left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0;z-index:1}body.animation-level-2 .input-field-border{transition:opacity .2s}.input-field-icon{border-radius:.375rem;height:1.5rem;pointer-events:none;position:absolute;right:1rem;top:50%;transform:translateY(-50%);width:1.5rem;z-index:1}.input-field-input{--padding:1rem;--padding-horizontal:1rem;--border-width:1px;background-color:var(--surface-color);border:var(--border-width) solid var(--input-search-border-color);border-radius:var(--border-radius);box-sizing:border-box;line-height:var(--line-height);min-height:var(--height);padding:calc(var(--padding) - var(--border-width)) calc(var(--padding-horizontal) - var(--border-width));position:relative;transition:border-color 0s;width:100%;z-index:1}.input-field-input:-webkit-autofill,.input-field-input:-webkit-autofill:active,.input-field-input:-webkit-autofill:focus,.input-field-input:-webkit-autofill:hover{-webkit-box-shadow:0 0 0 1000px var(--surface-color) inset}.input-field-input:-webkit-autofill,.input-field-input:-webkit-autofill:active,.input-field-input:-webkit-autofill:first-line,.input-field-input:-webkit-autofill:focus,.input-field-input:-webkit-autofill:hover{color:var(--primary-text-color)!important;font-family:Roboto,-apple-system,apple color emoji,BlinkMacSystemFont,Segoe UI,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif!important;font-size:1rem!important}@media only screen and (max-width:600px){.input-field-input{--padding:.9375rem;--padding-horizontal:.9375rem}}body.animation-level-0 .input-field-input{transition:none!important}html.no-touch .input-field-input:active:not(:focus):not(.error):not(.valid),html.no-touch .input-field-input:hover:not(:focus):not(.error):not(.valid){border-color:var(--primary-color);transition:border-color .2s}html.no-touch .input-field-input:active:not(:focus):not(.error):not(.valid)~label,html.no-touch .input-field-input:hover:not(:focus):not(.error):not(.valid)~label{color:var(--primary-color)}.input-field-input:focus{border-color:var(--primary-color)}.input-field-input.error{border-color:var(--danger-color)}.input-field-input.error~label{color:var(--danger-color)!important}.input-field-input.error~.input-field-border{border-color:var(--danger-color)!important}.input-field-input.valid{border-color:#26962f}.input-field-input.valid~label{color:#26962f!important}.input-field-input.valid~.input-field-border{border-color:#26962f!important}.input-field-input:focus~.arrow-down{border-color:var(--primary-color);margin-top:-4px;transform:rotate(225deg)}.input-field-input:focus~label{color:var(--primary-color);font-weight:var(--font-weight-bold)}.input-field-input:focus~.input-field-border{opacity:1}.input-field-input:disabled~label,.input-field-input:focus~label,.input-field-input:not(:empty)~label,.input-field-input:valid~label{opacity:1;padding:0 .3125rem;transform:translate(-.1875rem,calc(var(--height)/-2 + .0625rem)) scale(.75)}.input-field-input-fake{bottom:auto!important;height:auto!important;left:0;opacity:0;pointer-events:none;position:absolute!important;right:auto!important;top:0;z-index:-3}.input-fields-row{display:flex}.input-fields-row .input-field{flex:1 1 auto;width:1%}.input-wrapper>*+*{margin-top:1.5rem}::-moz-placeholder{color:#909192;opacity:1}::placeholder{color:#909192;opacity:1}:-ms-input-placeholder{color:#909192}::-ms-input-placeholder{color:#909192}button:focus,input:focus{outline:none}.input-clear{border:none;outline:none;padding:0}body.animation-level-0 .input-clear.error{color:var(--danger-color)!important}body:not(.animation-level-0) .input-clear.error{animation:input-shake .2s ease-in-out forwards}@keyframes input-shake{0%{transform:translateX(0)}25%{transform:translateX(-.5rem)}75%{transform:translateX(.5rem)}to{transform:translateX(0)}}.input-search{--border-radius:22px;margin-left:.4375rem;margin-right:.4375rem;overflow:hidden;position:relative;width:100%}@media only screen and (max-width:600px){[dir=ltr] .input-search{margin-left:1rem}[dir=rtl] .input-search{margin-right:1rem}}.input-search-input{--height:42px;background-color:var(--input-search-background-color);border-color:var(--input-search-border-color);height:var(--height);line-height:var(--height);max-height:var(--height)!important;min-height:var(--height)!important;padding:0 calc(var(--height) + 3px - var(--border-width))}body.animation-level-2 .input-search-input{transition:border-color .2s ease-in-out}html.no-touch .input-search-input:active:not(:focus),html.no-touch .input-search-input:hover:not(:focus){border-color:var(--secondary-color)!important}.input-search-input:focus{background-color:transparent;border-color:var(--primary-color)}.input-search-input:focus~.tgico{color:var(--primary-color);opacity:1}html.no-touch .input-search-input:focus~.btn-icon:active,html.no-touch .input-search-input:focus~.btn-icon:hover{background-color:var(--light-primary-color)}.input-search-input:-moz-placeholder-shown~.tgico-close{display:none}.input-search-input:placeholder-shown~.tgico-close{display:none}.input-search>.tgico{color:var(--secondary-text-color);font-size:1.5rem;line-height:1;opacity:.6;position:absolute;text-align:center;top:50%;transform:translateY(-50%);z-index:1}body.animation-level-2 .input-search>.tgico{transition:opacity .2s ease-out,color .2s ease-out}[dir=ltr] .input-search>.tgico-search{left:.8125rem}[dir=rtl] .input-search>.tgico-search{right:.8125rem}.input-search>.tgico-search{height:1.5rem;pointer-events:none;width:1.5rem}[dir=ltr] .input-search>.tgico-close{right:0}[dir=rtl] .input-search>.tgico-close{left:0}.input-search>.tgico-close{height:42px;width:42px;z-index:1}[dir=ltr] .input-search>.tgico-close:before{margin-right:-1px}[dir=rtl] .input-search>.tgico-close:before{margin-left:-1px}[dir=ltr] .input-field-password .input-field-input{padding-right:2.5rem}[dir=rtl] .input-field-password .input-field-input{padding-left:2.5rem}.input-field-password .input-field-input{max-height:var(--height)}.input-field-password .input-field-input[type=password]{font-family:Arial,Helvetica,sans-serif;font-size:2.25rem;line-height:1;padding-bottom:0;padding-left:calc(.875rem - var(--border-width));padding-top:0}@media(-webkit-min-device-pixel-ratio:2){.input-field-password .input-field-input[type=password]{font-size:1.75rem;letter-spacing:.125rem}}html.is-ios .input-field-password .input-field-input[type=password]{font-size:1rem}.input-field-password .toggle-visible{align-items:center;color:#9e9e9e;cursor:pointer;display:flex;font-size:1.5rem;justify-content:center;padding:.5rem;position:absolute;right:.375rem;top:50%;transform:translateY(-50%);transition:color .2s;z-index:2}.input-field-password .toggle-visible:before{content:\"\"}.input-field-password .toggle-visible.eye-hidden:before{content:\"\"}html.no-touch .input-field-password .toggle-visible:active,html.no-touch .input-field-password .toggle-visible:hover{color:var(--primary-text-color)}.input-field-phone .input-field-input{--letter-spacing:.24px}.input-field-phone .input-field-input:after{color:#9e9e9e;content:attr(data-left-pattern);letter-spacing:var(--letter-spacing)}.btn,.btn-icon{background:none;border:none;cursor:pointer;outline:none}body.animation-level-0 .btn,body.animation-level-0 .btn-icon{transition:none}html.no-touch .btn-icon:active,html.no-touch .btn-icon:hover,html.no-touch .btn:active,html.no-touch .btn:hover{background-color:var(--light-secondary-text-color)}html.no-touch .btn-icon.active:active,html.no-touch .btn-icon.active:hover,html.no-touch .btn-icon.blue:active,html.no-touch .btn-icon.blue:hover,html.no-touch .btn-icon.primary:active,html.no-touch .btn-icon.primary:hover,html.no-touch .btn.active:active,html.no-touch .btn.active:hover,html.no-touch .btn.blue:active,html.no-touch .btn.blue:hover,html.no-touch .btn.primary:active,html.no-touch .btn.primary:hover{background-color:var(--light-primary-color)}html.no-touch .btn-icon.danger:active,html.no-touch .btn-icon.danger:hover,html.no-touch .btn.danger:active,html.no-touch .btn.danger:hover{background-color:var(--light-danger-color)}.btn-icon:disabled,.btn:disabled{opacity:var(--disabled-opacity);pointer-events:none!important}.btn-icon{align-items:center;background-color:transparent;border:none;border-radius:50%!important;color:var(--secondary-text-color);display:flex;font-size:1.5rem;justify-content:center;line-height:1;padding:.5rem;position:relative;text-align:center;transition:color .15s ease-in-out,opacity .15s ease-in-out}.btn-icon.rp{overflow:hidden}.btn-icon.active{color:var(--primary-color)}[dir=ltr] .btn-corner{right:var(--offset)}[dir=rtl] .btn-corner{left:var(--offset)}.btn-corner{--offset:1.25rem;--translateY:calc(54px + var(--offset));align-items:center;background-color:var(--primary-color);border:none;bottom:var(--offset);box-shadow:none!important;color:#fff;cursor:pointer;display:flex;font-size:1.5rem;justify-content:center;outline:none;padding:0!important;position:absolute!important;text-align:center;transform:translate3d(0,var(--translateY),0);transition:transform var(--btn-corner-transition)!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:3}html.no-touch .btn-corner:active,html.no-touch .btn-corner:hover{background-color:var(--dark-primary-color)}.btn-corner.is-visible{--translateY:0}body.animation-level-0 .btn-corner{transition:none!important}.btn-corner:disabled{opacity:1!important;pointer-events:all!important}.btn-corner .preloader-circular{height:2.5rem;width:2.5rem}.btn-menu{-webkit-touch-callout:none;-webkit-backdrop-filter:var(--menu-backdrop-filter);backdrop-filter:var(--menu-backdrop-filter);background-color:var(--menu-background-color);border-radius:10px;font-size:1rem;min-width:11.25rem;opacity:0;padding:.3125rem 0;position:absolute;top:100%;transform:scale(.8)!important;transition:opacity var(--btn-menu-transition),transform var(--btn-menu-transition),visibility var(--btn-menu-transition);-webkit-user-select:none;visibility:hidden;z-index:4}.btn-menu-old,.is-mobile .btn-menu{-webkit-backdrop-filter:none;backdrop-filter:none;background-color:var(--surface-color);min-width:auto;padding:.5rem 0}.btn-menu-old .btn-menu-item,.is-mobile .btn-menu .btn-menu-item{--padding-left:1rem;--padding-right:2.5rem;--icon-margin:1.5rem;--icon-size:1.5rem;border-radius:0;font-size:var(--font-size-16);font-weight:400;height:3rem;line-height:var(--line-height-16);margin:0;transform:none!important}.btn-menu-old .btn-menu-item:before,.is-mobile .btn-menu .btn-menu-item:before{align-self:auto;color:var(--secondary-text-color);margin-top:0}.btn-menu-old .btn-menu-footer,.is-mobile .btn-menu .btn-menu-footer{background-color:var(--background-color)}.btn-menu{box-shadow:var(--menu-box-shadow)}body.animation-level-0 .btn-menu{transition:none}.btn-menu.active{opacity:1;visibility:visible}.btn-menu.active,.is-mobile .btn-menu.was-open{transform:scaleX(1)!important}.btn-menu.bottom-left,.is-rtl .btn-menu.bottom-right{left:auto;right:0;top:100%;transform-origin:top right}.btn-menu.bottom-right,.is-rtl .btn-menu.bottom-left{left:0;right:auto;top:100%;transform-origin:top left}.btn-menu.bottom-center{transform-origin:top center}.btn-menu.top-left{bottom:100%;left:auto;right:0;top:auto;transform-origin:bottom right}.btn-menu.top-right,.is-rtl .btn-menu.top-left{bottom:100%;left:0;right:auto;top:auto;transform-origin:bottom left}.btn-menu.top-center{transform-origin:bottom center}.btn-menu.center-left{transform-origin:center right}.btn-menu.center-right{transform-origin:center left}[dir=ltr] .btn-menu-item{text-align:left}[dir=rtl] .btn-menu-item{text-align:right}.btn-menu-item{--padding-vertical:.25rem;--padding-left:.75rem;--padding-right:.75rem;--icon-margin:1.25rem;--icon-size:1.25rem;align-items:center;border-radius:.3125rem;color:var(--primary-text-color);cursor:pointer!important;display:flex;font-size:var(--font-size-14);font-weight:500;height:2rem;line-height:var(--line-height-14);margin-left:.3125rem;margin-right:.3125rem;padding:var(--padding-vertical) var(--padding-right) var(--padding-vertical) var(--padding-left);pointer-events:all!important;position:relative;text-transform:none;transform:scale(1);white-space:nowrap}.btn-menu-item.tgico-char:before{width:var(--icon-size)}body.animation-level-2 .btn-menu-item{transition:transform var(--btn-menu-transition)}.btn-menu-item:active{transform:scale(.96)}html.no-touch .btn-menu-item:active,html.no-touch .btn-menu-item:hover{background-color:var(--light-secondary-text-color)}html.no-touch .btn-menu-item.danger:active,html.no-touch .btn-menu-item.danger:hover{background-color:var(--light-danger-color)}.btn-menu-item:before{align-self:flex-start;color:var(--primary-text-color);font-size:var(--icon-size);margin-top:.125rem}[dir=ltr] .btn-menu-item-icon,[dir=ltr] .btn-menu-item:before{margin-right:var(--icon-margin)}[dir=rtl] .btn-menu-item-icon,[dir=rtl] .btn-menu-item:before{margin-left:var(--icon-margin)}.btn-menu-item-icon,.btn-menu-item:before{position:relative}[dir=ltr] .btn-menu-item-icon{margin-right:calc(var(--icon-margin) - var(--add)/2)}[dir=rtl] .btn-menu-item-icon{margin-left:calc(var(--icon-margin) - var(--add)/2)}[dir=ltr] .btn-menu-item-icon{margin-left:calc(var(--add)/-2)}[dir=rtl] .btn-menu-item-icon{margin-right:calc(var(--add)/-2)}.btn-menu-item-icon{--add:.25rem;--total:calc(var(--icon-size) + var(--add));flex:0 0 auto;height:var(--total);width:var(--total)}.btn-menu-item-icon .media-photo{height:inherit;width:inherit}@media only screen and (max-width:600px){.btn-menu-item{--padding-right:1.875rem}}.btn-menu-item-text{flex:1 1 auto;position:relative}.btn-menu-item-text,.btn-menu-item-text-fake{pointer-events:none}[dir=ltr] .btn-menu-item-text-fake{margin-left:var(--margin-left)}[dir=rtl] .btn-menu-item-text-fake{margin-right:var(--margin-left)}.btn-menu-item-text-fake{--margin-left:calc(var(--icon-size) + var(--icon-margin));max-width:calc(100% - var(--margin-left) - var(--padding-left) - var(--padding-right));overflow:hidden;position:absolute;text-overflow:ellipsis;white-space:nowrap}.btn-menu-item-subtitle{color:var(--secondary-text-color);font-size:.875rem}.btn-menu-item-header{color:var(--secondary-text-color);font-weight:var(--font-weight-bold);height:2rem;pointer-events:none!important}[dir=ltr] .btn-menu-item .stacked-avatars{right:.5rem}[dir=rtl] .btn-menu-item .stacked-avatars{left:.5rem}.btn-menu-item .stacked-avatars{--margin-right:-.6875rem;flex:0 0 auto;pointer-events:none;position:absolute}.btn-menu-item.is-multiline{font-size:.75rem;height:auto;max-width:16.25rem;min-width:calc(100% - .625rem);width:-moz-fit-content;width:fit-content}.btn-menu-item.is-multiline .btn-menu-item-text{white-space:pre-wrap;width:-moz-fit-content;width:fit-content}.btn-menu-item .checkbox-field-toggle{padding:0}.btn-menu-overlay{bottom:0;bottom:-100vh;cursor:default;left:0;left:-100vw;max-width:none!important;position:fixed!important;right:0;right:-100vw;top:0;top:-100vh;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important;z-index:4}.btn-menu.has-footer{padding-bottom:0}.btn-menu-footer{align-items:center;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;color:currentColor;display:flex;font-size:.875rem;height:2.5rem;justify-content:center}.btn-menu hr{display:block!important;margin:.3125rem auto;opacity:.6;padding:0;width:calc(100% - 1.875rem)}html:not(.is-mobile) .btn-menu .badge{background-color:transparent;color:var(--secondary-text-color)}.btn-menu-reactions{--inner-shadow-degree:90deg;-webkit-backdrop-filter:var(--menu-backdrop-filter);backdrop-filter:var(--menu-backdrop-filter);background-color:var(--menu-background-color);border-radius:var(--height);filter:drop-shadow(0 .125rem .5rem rgba(0,0,0,.24));height:inherit;max-height:100%;max-width:100%;opacity:0;position:absolute;transform:scale(.8);transform-origin:bottom left}[dir=ltr] .btn-menu-reactions-container{margin-left:var(--other-side-offset)}[dir=rtl] .btn-menu-reactions-container{margin-right:var(--other-side-offset)}.btn-menu-reactions-container{--height:2.25rem;--bubble-side-offset:0rem;--other-side-offset:0rem;--menu-offset:calc((var(--height) + 0.5rem)*-1);--width:calc(var(--menu-width) + (var(--bubble-side-offset) + var(--other-side-offset))*-1);display:flex;height:var(--height);justify-content:flex-start;margin-top:var(--menu-offset);max-width:var(--width);position:fixed;width:var(--width);z-index:4}.contextmenu.bottom-left+.btn-menu-reactions-container .btn-menu-reactions,.contextmenu.center-left+.btn-menu-reactions-container .btn-menu-reactions{transform-origin:bottom right!important}.contextmenu.bottom-center+.btn-menu-reactions-container .btn-menu-reactions{transform-origin:bottom center!important}[dir=ltr] .btn-menu-reactions-container-vertical{margin-left:var(--menu-offset)}[dir=rtl] .btn-menu-reactions-container-vertical{margin-right:var(--menu-offset)}.btn-menu-reactions-container-vertical{flex-direction:column;height:var(--width);margin-top:0;max-height:var(--width);max-width:var(--height);width:var(--height)}.btn-menu-reactions-container-vertical .btn-menu-reactions{--inner-shadow-degree:180deg;display:flex;flex-direction:column;height:auto;transform-origin:top right;width:inherit}.btn-menu-reactions-container-vertical .btn-menu-reactions-reaction{--padding-vertical:var(--padding-base);--padding-horizontal:0rem}.btn-menu-reactions-container-vertical .btn-menu-reactions-bubble-big{bottom:var(--offset);right:calc(var(--size)/-2)}body.animation-level-2 .btn-menu-reactions{transition:opacity var(--transition-standard-in),transform var(--transition-standard-in)}.btn-menu-reactions.is-visible{opacity:1;transform:scale(1)}.btn-menu-reactions-bubble{background-color:inherit;border-radius:50%;position:absolute;z-index:-1}.btn-menu-reactions-bubble-big{--size:1rem;--offset:calc(var(--height)/2);bottom:calc(var(--size)/-2);height:var(--size);right:var(--offset);width:var(--size)}.btn-menu-reactions:after{background:linear-gradient(var(--inner-shadow-degree),var(--surface-color) 0,rgba(var(--surface-color-rgb),0) 1rem,rgba(var(--surface-color-rgb),0) calc(100% - 1rem),var(--surface-color) 100%);border-radius:inherit;bottom:0;content:\" \";left:0;pointer-events:none;position:absolute;right:0;top:0}.btn-menu-reactions .scrollable{border-radius:inherit;display:flex;position:relative}.btn-menu-reactions .scrollable-x{align-items:center;padding:0 .25rem}.btn-menu-reactions .scrollable-y{align-items:center;flex-direction:column;padding:.25rem 0}.btn-menu-reactions-reaction{--size:1.625rem;--padding-base:.25rem;--padding-vertical:0rem;--padding-horizontal:var(--padding-base);cursor:pointer;flex:0 0 auto;height:calc(var(--size) + var(--padding-vertical)*2);padding:var(--padding-vertical) var(--padding-horizontal);width:calc(var(--size) + var(--padding-horizontal)*2)}.btn-menu-reactions-reaction-scale{height:100%;width:100%}html:not(.is-safari) .btn-menu-reactions-reaction-scale{transform:scale(1)}html:not(.is-safari) body.animation-level-2 .btn-menu-reactions-reaction-scale{transition:transform .1s linear}html.no-touch:not(.is-safari) .btn-menu-reactions-reaction-select{transform:scale(1)}html.no-touch:not(.is-safari) .btn-menu-reactions-reaction-select:active,html.no-touch:not(.is-safari) .btn-menu-reactions-reaction-select:hover{transform:scale(1.25)}html.no-touch:not(.is-safari) body.animation-level-2 .btn-menu-reactions-reaction-select{transition:transform var(--transition-standard-in)}.btn-menu-reactions-reaction .media-sticker-wrapper{height:100%;position:relative;width:100%}.btn-primary{border:none;border-radius:10px;cursor:pointer;font-weight:var(--font-weight-bold);height:54px;overflow:hidden;padding:0;position:relative;text-align:center;transition:opacity .2s;width:100%}html.no-touch .btn-primary:active,html.no-touch .btn-primary:hover{background:var(--dark-primary-color);transition:opacity .2s}.btn-primary-transparent{background-color:transparent;color:var(--primary-color)}html.no-touch .btn-primary-transparent:active,html.no-touch .btn-primary-transparent:hover{background:var(--light-primary-color)}.btn-primary-transparent .c-ripple__circle{background-color:var(--light-primary-color)}html.no-touch .btn-primary-transparent.danger:active,html.no-touch .btn-primary-transparent.danger:hover{background-color:var(--light-danger-color)}.btn-primary-transparent .preloader-circular .preloader-path{stroke:var(--primary-color)}body.animation-level-0 .btn-primary{transition:none}[dir=ltr] .btn-primary use,[dir=ltr] .btn-primary>svg{right:15px}[dir=rtl] .btn-primary use,[dir=rtl] .btn-primary>svg{left:15px}.btn-primary use,.btn-primary>svg{height:calc(100% - 20px);left:auto}.btn-primary:disabled{opacity:var(--disabled-opacity);pointer-events:none!important}[dir=ltr] .btn-control{padding-left:.75rem;padding-right:1.5rem}[dir=rtl] .btn-control{padding-left:1.5rem;padding-right:.75rem}.btn-control{align-items:center;border-radius:1.25rem;display:flex;height:2.5rem;line-height:2.5rem;margin:.9375rem auto 1rem;width:auto}[dir=ltr] .btn-control.tgico:before{margin-right:.375rem}[dir=rtl] .btn-control.tgico:before{margin-left:.375rem}.btn-control.tgico:before{font-size:1.5rem}.btn-transparent{align-items:center;background-color:transparent;color:var(--primary-text-color);display:flex;font-weight:400;height:3rem;line-height:var(--line-height);padding:0 1rem}@media only screen and (max-width:600px){.btn-transparent{height:3rem}}html.no-touch .btn-transparent:active,html.no-touch .btn-transparent:hover{background-color:var(--light-secondary-text-color)}html.no-touch .btn-transparent.danger:active,html.no-touch .btn-transparent.danger:hover{background-color:var(--light-danger-color)}html.no-touch .btn-transparent.primary:active,html.no-touch .btn-transparent.primary:hover{background-color:var(--light-primary-color)}[dir=ltr] .btn-transparent:before{margin-right:2rem}[dir=rtl] .btn-transparent:before{margin-left:2rem}.btn-transparent:before{color:var(--secondary-text-color);font-size:1.5rem}@media only screen and (max-width:600px){[dir=ltr] .btn-transparent:before{margin-right:1.5rem}[dir=rtl] .btn-transparent:before{margin-left:1.5rem}}[dir=ltr] .btn-transparent.btn-short:before{margin-right:1rem}[dir=rtl] .btn-transparent.btn-short:before{margin-left:1rem}.btn-primary.btn-circle .preloader-circular{height:calc(100% - 20px);left:auto;margin:0;right:auto;top:10px}.btn-primary.btn-circle .preloader-circular .preloader-path{stroke:#fff}.btn-menu-toggle{cursor:pointer!important;font-weight:400!important;overflow:visible!important;pointer-events:all!important;position:relative}.btn-menu-toggle:not(.btn-primary):not(.btn-corner).menu-open{background-color:var(--light-secondary-text-color)}.btn-menu-toggle .btn-menu{margin-top:.5rem}.btn-circle{--size:54px;border-radius:50%;height:var(--size);line-height:var(--size);width:var(--size)}@media only screen and (max-width:600px){.btn-circle{--size:46px}}.btn-circle path{fill:#fff}.btn-disabled{color:var(--secondary-text-color)!important;cursor:default!important;pointer-events:none!important}.btn-disabled:before{color:inherit!important}.btn-secondary:not(:first-child){margin-top:.5rem!important}.btn-color-primary{background:var(--primary-color);color:#fff}.call-button{-webkit-backdrop-filter:blur(25px);backdrop-filter:blur(25px);border-radius:50%;font-size:1.5rem;height:var(--call-button-size);justify-content:center;position:relative}.call-button,.call-button-container{align-items:center;cursor:pointer;display:flex;width:var(--call-button-size)}.call-button-container{flex-direction:column}.call-button-container.disabled,.call-button-container.disabled .call-button{pointer-events:none}.call-button-container.disabled .call-button,.call-button-container.disabled .call-button-text{opacity:.8}.call-button-text{font-size:.875rem;margin-top:.25rem;white-space:nowrap}body.animation-level-2 .call-button-text{transition:opacity var(--transition-standard-in)}body.animation-level-2 .call-button{transition:background-color var(--transition-standard-in),opacity var(--transition-standard-in)}[dir=ltr] .call-button+.call-button,[dir=ltr] .call-button-container+.call-button-container{margin-left:var(--call-button-margin)}[dir=rtl] .call-button+.call-button,[dir=rtl] .call-button-container+.call-button-container{margin-right:var(--call-button-margin)}[dir=ltr] .btn-update{right:auto!important}[dir=rtl] .btn-update{left:auto!important}.btn-update{border-radius:var(--size);font-size:1rem;font-weight:var(--font-weight-bold);padding:0 2rem!important;width:auto}.animated-close-icon{pointer-events:none;position:absolute;transform:rotate(-45deg)}.animated-close-icon,.animated-close-icon:after,.animated-close-icon:before{background-color:var(--secondary-text-color);border-radius:.125rem;height:.125rem;width:1.125rem}.animated-close-icon:after,.animated-close-icon:before{content:\"\";left:0;position:absolute;top:0}.animated-close-icon:before{transform:rotate(90deg)}body.animation-level-2 .animated-close-icon,body.animation-level-2 .animated-close-icon:after,body.animation-level-2 .animated-close-icon:before{transition:transform var(--slide-header-transition)}.animated-close-icon.state-back{transform:rotate(180deg)}.animated-close-icon.state-back:before{transform:rotate(45deg) scaleX(.75) translateY(-.375rem)}.animated-close-icon.state-back:after{transform:rotate(-45deg) scaleX(.75) translateY(.375rem)}.animated-menu-icon{--color:var(--secondary-text-color);position:absolute}.animated-menu-icon,.animated-menu-icon:after,.animated-menu-icon:before{background-color:var(--color);border-radius:.125rem;height:.125rem;transform:rotate(0);width:1.125rem}body.animation-level-2 .animated-menu-icon,body.animation-level-2 .animated-menu-icon:after,body.animation-level-2 .animated-menu-icon:before{transition:transform .25s}.animated-menu-icon:after,.animated-menu-icon:before{content:\"\";left:0;position:absolute}.animated-menu-icon:before{top:-.3125rem}.animated-menu-icon:after{top:.3125rem}.animated-menu-icon.state-back{transform:rotate(180deg)}.animated-menu-icon.state-back:before{transform:rotate(45deg) scaleX(.75) translate(.375rem,-.1875rem)}.animated-menu-icon.state-back:after{transform:rotate(-45deg) scaleX(.75) translate(.375rem,.1875rem)}.animated-menu-close-icon{margin-top:-.625rem}.animated-menu-close-icon:before{opacity:1;top:.3125rem}body.animation-level-2 .animated-menu-close-icon:before{transition:transform .25s,opacity .125s 0s}.animated-menu-close-icon:after{top:.625rem}.animated-menu-close-icon.state-back{transform:translateY(.3125rem) rotate(135deg)}.animated-menu-close-icon.state-back:before{opacity:0;transform:rotate(45deg)}.animated-menu-close-icon.state-back:after{transform:translateY(-.625rem) rotate(90deg)}.animated-button-icon>.tgico{height:24px;line-height:24px;position:absolute}body:not(.animation-level-0) .animated-button-icon>.tgico{animation:hide-icon .4s ease-in-out forwards}body.animation-level-0 .animated-button-icon>.tgico{animation:none!important;visibility:hidden}.autocomplete-helper{--border-radius:10px;border-radius:var(--border-radius)!important;bottom:calc(100% + .5rem);left:0;max-width:100%;overflow:hidden;padding:0!important;position:absolute!important;width:auto!important}.autocomplete-helper:not(.is-visible){display:none}.autocomplete-helper.is-visible{visibility:hidden}body.animation-level-2 .autocomplete-helper.is-visible{animation:fade-out-opacity .2s ease-in-out forwards;transition:visibility 0s .2s}.bubbles:not(.is-selecting)~.chat-input .autocomplete-helper.is-visible:not(.backwards){visibility:visible}body.animation-level-2 .bubbles:not(.is-selecting)~.chat-input .autocomplete-helper.is-visible:not(.backwards){animation-name:fade-in-opacity;transition:visibility 0s 0s}@media only screen and (max-width:319px){.autocomplete-helper{max-width:calc(100vw - var(--padding-horizontal)*4)}}.autocomplete-peer-helper .scrollable{max-height:232px;position:relative}.autocomplete-peer-helper-list{padding:.5rem 0}.autocomplete-peer-helper-list-element{align-items:center;cursor:pointer;display:flex;height:3.125rem;line-height:var(--line-height);padding:0 2.125rem 0 .75rem;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media only screen and (max-width:600px){.autocomplete-peer-helper-list-element{padding-right:.75rem}}.autocomplete-peer-helper-list-element-name{flex:0 0 auto;font-weight:var(--font-weight-bold);margin-left:.875rem}.autocomplete-peer-helper-list-element-description{color:var(--secondary-text-color);margin-left:.5625rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.autocomplete-peer-helper-list-element-avatar{flex:0 0 auto}.badge{--size:1.375rem;--padding:.4375rem;border-radius:calc(var(--size)/2);color:var(--badge-text-color);font-size:.875rem;font-weight:var(--font-weight-bold);height:var(--size);line-height:var(--size)!important;min-width:var(--size);padding:0 var(--padding);text-align:center}body.animation-level-2 .badge{transition:background-color .2s ease-in-out}.badge:not(.tgico):empty{display:none}.badge-20{--size:1.25rem;--padding:.375rem}.badge-24{--size:1.5rem;--padding:.5rem}.badge.tgico:before{font-size:var(--size)}.badge-primary{background-color:var(--primary-color)}.badge-gray{background-color:var(--secondary-color)}.ckin__player{letter-spacing:.02em;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ckin__player.ckin__fullscreen{background:#000;border-radius:0!important;bottom:0;display:flex;height:100%;left:0;position:fixed;right:0;top:0;width:100%;z-index:10000000}.ckin__player.ckin__fullscreen video{height:100%;-o-object-fit:contain;object-fit:contain;width:100%}.ckin__player .time{color:#fff;font-size:.875rem;margin-left:.875rem}@media only screen and (max-width:600px){.ckin__player .time{margin-left:1.125rem}}.default{align-items:center;display:flex;font-size:0;justify-content:center;position:relative}.default.show-controls video{cursor:pointer}.default__button{color:#fff;padding:.375rem}.default__button i{align-self:center}.default__button--big{background:none;border:0;color:#fff;font-size:4rem;left:50%;line-height:1;opacity:1;outline:0;padding:0;position:absolute;text-align:center;top:50%;transform:translate3d(-50%,-50%,0) scale(1)}@media only screen and (min-width:601px){.default__button--big{pointer-events:none}}body.animation-level-2 .default__button--big{transition:opacity var(--layer-transition)}@media only screen and (max-width:600px){.default__button--big{font-size:3rem}}.default:not(.played) .default__button--big{opacity:0}[dir=ltr] .default__controls{text-align:left}[dir=rtl] .default__controls{text-align:right}.default__controls{bottom:0;direction:ltr;left:0;position:absolute;right:0;z-index:6}body.animation-level-2 .default__controls{transition:transform var(--layer-transition)}.default__controls .progress-line{border-radius:var(--border-radius);margin:0 16px}.default__controls .progress-line__filled{background:var(--primary-color)}.default__controls .progress-line__loaded{background-color:#fff}.default__controls .progress-line{background:hsla(0,0%,100%,.38)}@media only screen and (max-width:600px){.default__controls .progress-line{margin-bottom:-1px}}.default__gradient-bottom{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==);background-position:bottom;background-repeat:repeat-x;bottom:0;height:49px;padding-top:93px;pointer-events:none;position:absolute;width:100%;z-index:2}body.animation-level-2 .default__gradient-bottom{transition:transform var(--layer-transition)}@media only screen and (max-width:600px){.default:not(.ckin__fullscreen) .default__gradient-bottom{display:none}}.default .toggle:before{content:\"\"}.default .default__gradient-bottom{transform:translate3d(0,50px,0)}.default .default__controls{transform:translate3d(0,52px,0)}@media only screen and (max-width:600px){.default .default__controls{transform:translate3d(0,65px,0)}}.default.show-controls .default__controls,.default.show-controls .default__gradient-bottom{transform:translateZ(0)}.default.is-playing:not(.show-controls){cursor:none}.default.is-playing .default__button--big,.default.is-seeking .default__button--big,.default:not(.played) .default__button--big{opacity:0}.default.is-playing .toggle:not(.default__button--big):before,.default.is-seeking .toggle:not(.default__button--big):before,.default:not(.played) .toggle:not(.default__button--big):before{content:\"\"}.default .is-seeking+.default__button--big{opacity:0}.default .player-volume{--icon-size:2.25rem;--icon-margin-right:.5rem;--selector-size:50px;--selector-thumb-size:.75rem;--hide-width:var(--icon-size);--show-width:calc(var(--icon-size) + var(--icon-margin-right) + var(--selector-size) + var(--selector-thumb-size)*0.75);align-items:center;display:flex;overflow:hidden;width:var(--hide-width)}body.animation-level-2 .default .player-volume{transition:width var(--layer-transition)}html.is-touch .default .player-volume{display:none}html:not(.is-touch) .default .player-volume+.time{margin-left:.5rem}html.no-touch .default .player-volume:active,html.no-touch .default .player-volume:hover{width:var(--show-width)}.default .player-volume__icon{color:#fff;cursor:pointer;display:flex;font-size:1.5rem;height:var(--icon-size);margin-right:var(--icon-margin-right);padding:.375rem;width:var(--icon-size)}.default .player-volume .progress-line{--color:#fff;--thumb-size:var(--selector-thumb-size);--height:4px;margin:0;min-width:var(--selector-size);width:var(--selector-size)}html.is-ios .default .player-volume .progress-line{display:none}.default.is-buffering>.toggle{display:none!important}video::-webkit-media-controls-enclosure{display:none!important}.progress-line{--color:var(--primary-color);--height:5px;--border-radius:6px;--thumb-size:13px;border-radius:var(--border-radius);cursor:pointer;height:var(--height);position:relative}.progress-line:before{border-radius:inherit;bottom:0;content:\" \";display:block;left:0;position:absolute;right:0;top:0}.progress-line__seek{-webkit-appearance:none;-moz-appearance:none;background:transparent;bottom:-.5rem;caret-color:var(--color);cursor:pointer;margin:0;outline:none;padding:0;position:absolute;top:-.5rem;width:100%}.progress-line__seek:focus{outline:none}.progress-line__seek::-webkit-slider-thumb{display:none}.progress-line__seek::-moz-range-thumb{display:none;height:0;width:0}.progress-line__seek::-moz-range-track{display:none}.progress-line__seek::-webkit-slider-runnable-track{display:none}.progress-line__filled{max-width:100%}.progress-line__filled:not(.progress-line__loaded){background-color:var(--color);z-index:1}.progress-line__filled:not(.progress-line__loaded):after{background-color:var(--color);border-radius:50%;content:\" \";cursor:pointer;display:block;height:var(--thumb-size);position:absolute;right:0;top:calc((var(--thumb-size) - var(--height))/-2);transform:translateX(calc(var(--thumb-size)/2)) scale(1);width:var(--thumb-size)}body.animation-level-2 .progress-line__filled:not(.progress-line__loaded):after{transition:transform .125s ease-in-out}.progress-line.is-focused .progress-line__filled:not(.progress-line__loaded):after{transform:translateX(calc(var(--thumb-size)/2)) scale(1.125)}.progress-line:before,.progress-line__loaded{background-color:var(--secondary-color);opacity:.3}.progress-line__filled,.progress-line__loaded{border-radius:var(--border-radius);bottom:0;position:absolute;top:0}body.animation-level-2 .progress-line.with-transition .progress-line__filled{transition:width .2s}.progress-line.use-transform .progress-line__filled{transform-origin:left center;width:100%}input[type=range]::-ms-track{visibility:hidden}input[type=range]::-ms-ticks{background:none;border:none;color:none}input[type=range]::-ms-thumb,input[type=range]::-ms-tooltip{visibility:hidden}.bottom-controls,.left-controls,.right-controls{align-items:center;display:flex}.bottom-controls{height:2.25rem;justify-content:space-between;padding:0 .625rem}@media only screen and (max-width:600px){.bottom-controls{height:3.625rem}}[dir=ltr] .checkbox-field{text-align:left}[dir=rtl] .checkbox-field{text-align:right}.checkbox-field{--size:1.25rem;--offset-left:0px;cursor:pointer;display:block;margin:1.5rem 1.1875rem;min-height:var(--size);min-width:var(--size);position:relative}body.animation-level-2 .checkbox-field{transition:opacity .2s}.checkbox-field.checkbox-disabled{opacity:var(--disabled-opacity);pointer-events:none!important}@media only screen and (max-width:600px){.checkbox-field{margin-bottom:27px}}[dir=ltr] .checkbox-field .checkbox-box{left:var(--offset-left)}[dir=rtl] .checkbox-field .checkbox-box{right:var(--offset-left)}.checkbox-field .checkbox-box{border-radius:.3125rem;height:var(--size);overflow:hidden;position:absolute;top:50%;transform:translateY(-50%);width:var(--size)}html.is-safari .checkbox-field .checkbox-box{-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}.checkbox-field .checkbox-box-background,.checkbox-field .checkbox-box-border,.checkbox-field .checkbox-box-check{left:0;position:absolute;top:0}.checkbox-field .checkbox-box-border{border:2px solid #8d969c;border-radius:inherit;bottom:0;left:0;right:0}.checkbox-field .checkbox-box-background{background-color:var(--primary-color);border-radius:50%;bottom:-15%;left:-15%;right:-15%;top:-15%;transform:scale(0);transition:transform .2s ease-in-out .05s}body.animation-level-0 .checkbox-field .checkbox-box-background{transition:none!important}.checkbox-field .checkbox-box-check{--offset:7px;height:calc(var(--size) - var(--offset));left:50%;top:50%;transform:translate(-50%,-50%);width:calc(var(--size) - var(--offset))}.checkbox-field .checkbox-box-check use{stroke:#fff;stroke-width:3.75;stroke-linecap:round;stroke-dasharray:0,24.19;stroke-dashoffset:0;transition:stroke-dasharray .1s ease-in-out,visibility 0s .1s;visibility:hidden}body.animation-level-0 .checkbox-field .checkbox-box-check use{transition:none!important}[dir=ltr] .checkbox-field .checkbox-caption{padding-left:3.375rem}[dir=rtl] .checkbox-field .checkbox-caption{padding-right:3.375rem}.checkbox-field .checkbox-caption{color:inherit;line-height:var(--line-height);overflow:hidden;pointer-events:none;position:relative;text-overflow:ellipsis;transition:opacity .2s;word-break:break-word}body.animation-level-0 .checkbox-field .checkbox-caption{transition:none}.checkbox-field.hover-effect{align-items:center;display:flex;height:3.5rem;margin-left:0;margin-right:0;padding:0 1.1875rem}[dir=ltr] .checkbox-field.hover-effect .checkbox-box{left:auto}[dir=rtl] .checkbox-field.hover-effect .checkbox-box{right:auto}.checkbox-field .anchor-url{pointer-events:all}.checkbox-ripple{border-radius:10px;overflow:hidden}.checkbox-ripple .checkbox-box,.checkbox-ripple .checkbox-caption{pointer-events:none}.checkbox-field-round{--size:1.5rem}.checkbox-field-round .checkbox-box{border-radius:50%;overflow:auto}.checkbox-field-round .checkbox-box-background{bottom:0;left:0;right:0;top:0}.checkbox-field-round .checkbox-box-border{border:2px solid var(--secondary-color);z-index:1}.checkbox-field-round .checkbox-box-check{--offset:calc(var(--size) - var(--size)/2 - 0.125rem)}html.is-safari .checkbox-field-round .checkbox-box{-webkit-mask-image:none}[dir=ltr] .radio-field{text-align:left}[dir=rtl] .radio-field{text-align:right}.radio-field{--size:1.375rem;--offset-left:0px;cursor:pointer;line-height:var(--line-height);margin:1.25rem 0;position:relative}.radio-field.hidden-widget{cursor:default}.radio-field.hidden-widget .radio-field-main:after,.radio-field.hidden-widget .radio-field-main:before{visibility:hidden}.radio-field>input:checked~.radio-field-main:before{border-color:var(--primary-color)}.radio-field>input:checked~.radio-field-main:after{transform:translateY(-50%) scale(1)}[dir=ltr] .radio-field .radio-field-main{padding-left:3.5rem}[dir=rtl] .radio-field .radio-field-main{padding-right:3.5rem}.radio-field .radio-field-main{color:inherit;position:relative}[dir=ltr] .radio-field .radio-field-main:after,[dir=ltr] .radio-field .radio-field-main:before{left:var(--offset-left)}[dir=rtl] .radio-field .radio-field-main:after,[dir=rtl] .radio-field .radio-field-main:before{right:var(--offset-left)}.radio-field .radio-field-main:after,.radio-field .radio-field-main:before{content:\"\";display:block;height:var(--size);position:absolute;top:50%;transform:translateY(-50%);width:var(--size)}.radio-field .radio-field-main:before{border:2px solid var(--secondary-text-color);border-radius:50%;opacity:1}body.animation-level-2 .radio-field .radio-field-main:before{transition:border-color .1s ease,opacity .1s ease}[dir=ltr] .radio-field .radio-field-main:after{left:calc(var(--offset-left) + .3125rem)}[dir=rtl] .radio-field .radio-field-main:after{right:calc(var(--offset-left) + .3125rem)}.radio-field .radio-field-main:after{background:var(--primary-color);border-radius:50%;height:.75rem;transform:translateY(-50%) scale(0);transform-origin:center;width:.75rem}body.animation-level-2 .radio-field .radio-field-main:after{transition:transform .1s ease}[dir=ltr] .radio-field.radio-field-right .radio-field-main:before{left:auto;right:0}[dir=rtl] .radio-field.radio-field-right .radio-field-main:before{left:0;right:auto}[dir=ltr] .radio-field.radio-field-right .radio-field-main:after{left:auto;right:.3125rem}[dir=rtl] .radio-field.radio-field-right .radio-field-main:after{left:.3125rem;right:auto}[type=checkbox],[type=radio]{box-sizing:border-box;opacity:0;padding:0;position:absolute;z-index:var(--z-below)}.checkbox-field .checkbox-field-input:checked:not(.is-fake-disabled)+.checkbox-box .checkbox-box-check use{stroke-dasharray:24.19,24.19;transition:stroke-dasharray .1s ease-in-out .15s,visibility 0s .15s;visibility:visible}.checkbox-field .checkbox-field-input:checked:not(.is-fake-disabled)+.checkbox-box .checkbox-box-background{transform:scale(1);transition:transform .2s ease-in-out 0s}.checkbox-field .checkbox-field-input:disabled+.checkbox-box,.checkbox-field .checkbox-field-input:disabled~.checkbox-caption{cursor:default;opacity:var(--disabled-opacity)}.checkbox-field-restriction .checkbox-box-border{display:none}.checkbox-field-restriction .checkbox-box-background{transform:none!important;transition:background-color .2s!important}.checkbox-field-restriction .checkbox-box-check use{stroke-dasharray:24.19,24.19!important;transform:rotate(0) translateY(0);transition:stroke-dashoffset .2s ease-in-out,transform .2s ease-in-out!important;visibility:visible!important}.checkbox-field-restriction [type=checkbox]:not(:checked)+.checkbox-box .checkbox-box-check use{stroke-dashoffset:35.5;transform:rotate(45deg) translateY(-10px)}.checkbox-field-restriction [type=checkbox]:not(:checked)+.checkbox-box .checkbox-box-background{background-color:var(--danger-color)}.checkbox-field-toggle{--size:20px;align-items:center;display:flex;margin:0 .3125rem;padding:0 .25rem;pointer-events:none}.checkbox-field-toggle .checkbox-toggle{--offset:3px;--toggle-width:1.9375rem;align-items:center;background-color:var(--secondary-color);border-radius:12px;display:flex;height:.875rem;margin:0 var(--offset);position:relative;width:var(--toggle-width)}body.animation-level-2 .checkbox-field-toggle .checkbox-toggle{transition:background-color .1s}.checkbox-field-toggle .checkbox-toggle:before{background-color:var(--surface-color);border:2px solid var(--secondary-color);border-radius:50%;content:\" \";height:1.25rem;position:absolute;transform:translateX(calc(var(--offset)*-1));width:1.25rem}body.animation-level-2 .checkbox-field-toggle .checkbox-toggle:before{transition:border-color .1s,transform .1s cubic-bezier(.22,.75,.7,1.3)}.checkbox-field-toggle-restriction .checkbox-toggle{background-color:var(--danger-color)}.checkbox-field-toggle-restriction .checkbox-toggle:before{border-color:var(--danger-color)}.checkbox-field-toggle [type=checkbox]:checked:not(.is-fake-disabled)+.checkbox-toggle{background-color:var(--primary-color)}.checkbox-field-toggle [type=checkbox]:checked:not(.is-fake-disabled)+.checkbox-toggle:before{border-color:var(--primary-color);transform:translateX(calc(var(--toggle-width) - 1.25rem + var(--offset)))}.chatlist-container{position:relative}@media only screen and (max-width:600px){.chatlist-container .search-group-recent.search-group{padding:2px 0 0}}.chatlist-container .search-group{margin-bottom:17px;padding:1rem 0 .5rem;width:100%}@media only screen and (max-width:600px){.chatlist-container .search-group{margin-bottom:0}}.chatlist-container .search-group__name{color:var(--secondary-text-color);font-weight:var(--font-weight-bold);padding:0 23px 1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media only screen and (max-width:600px){.chatlist-container .search-group__name{font-size:15px;padding:5px 9px 0 16px}}.chatlist-container .search-group-contacts{border-bottom:1px solid var(--border-color)}@media only screen and (max-width:600px){.chatlist-container .search-group-contacts{padding:0 0 2px}}.chatlist-container .search-group-people.search-group-contacts{padding:5px 0!important}.chatlist-container .search-group:last-child{border-bottom:none}.chatlist-container .search-super .search-group{margin-bottom:0;padding:0 0 .5rem}.chatlist-container .search-super .search-group__name{display:flex;justify-content:space-between;padding-top:1rem}ul.chatlist{padding:0 .5rem}@media only screen and (max-width:600px){ul.chatlist{padding:0}}.chatlist{-webkit-touch-callout:none;background-color:var(--surface-color);display:flex;flex-direction:column;margin:0;position:relative;-moz-user-select:none;user-select:none;-webkit-user-select:none;width:100%}.chatlist-chat{--background:unset;-webkit-user-drag:none;background:var(--background)!important}.chatlist-chat.is-forum-open,.chatlist-chat.menu-open,html.no-touch .chatlist-chat:active,html.no-touch .chatlist-chat:hover{--background:var(--light-filled-secondary-text-color)}[dir=ltr] .chatlist-chat.is-muted .user-title:after{margin-left:.125rem}[dir=rtl] .chatlist-chat.is-muted .user-title:after{margin-right:.125rem}.chatlist-chat.is-muted .user-title:after{color:var(--chatlist-pinned-color);content:\"\";flex:0 0 auto;font-size:1.125rem}body:not(.animation-level-0) .chatlist-chat.is-muted.animating:not(.backwards) .user-title:after{animation:fade-in-opacity .2s ease-in-out forwards}body:not(.animation-level-0) .chatlist-chat.is-muted.animating.backwards .user-title:after{animation:fade-in-backwards-opacity .2s ease-in-out forwards}.chatlist-chat i{font-style:normal}.chatlist-chat .text-highlight{color:var(--primary-text-color)}.chatlist-chat .premium-icon{margin-top:-.125rem}.chatlist-chat .topic-icon{flex:0 0 auto}[dir=ltr] .chatlist-chat .row-title .topic-icon{margin-right:.25rem}[dir=rtl] .chatlist-chat .row-title .topic-icon{margin-left:.25rem}.chatlist-chat .row-title .topic-icon{--size:1.375rem}.chatlist-chat .topic-name .topic-icon{display:inline;line-height:1!important}.chatlist-chat .topic-name .topic-icon-svg{position:relative}.chatlist-chat .topic-name .topic-icon-content{left:0;margin-top:-6px;position:absolute;right:0;top:0}@media only screen and (min-width:601px){.chatlist-chat.active{--background:var(--primary-color)!important}.chatlist-chat.active .message-status,.chatlist-chat.active .premium-icon,.chatlist-chat.active .row-subtitle,.chatlist-chat.active .row-title,.chatlist-chat.active .sending-status-icon,.chatlist-chat.active .text-highlight,.chatlist-chat.active .tgico-chatspinned:before,.chatlist-chat.active .user-title,.chatlist-chat.active .verified-icon{color:#fff!important}.chatlist-chat.active .badge-fake{border-color:#fff;color:#fff}.chatlist-chat.active .danger,.chatlist-chat.active .primary-text{color:#fff!important}.chatlist-chat.active .user-title:after{color:hsla(0,0%,100%,.7)}.chatlist-chat.active .verified-icon-background{fill:#fff!important}.chatlist-chat.active .verified-icon-check{visibility:hidden}.chatlist-chat.active .dialog-avatar.is-online:after,.chatlist-chat.active .dialog-group-call-icon{background-color:#fff;border-color:var(--primary-color)}.chatlist-chat.active .badge.unread,.chatlist-chat.active .mention{background-color:#fff!important;color:var(--primary-color)}.chatlist-chat.active .peer-typing-container{--color:#fff}}.chatlist .peer-typing-container{--color:var(--secondary-text-color)}.chatlist .peer-typing-container .peer-typing-text{display:inline-flex;transform:translateY(-2px)}.chatlist .sending-status-icon.tgico-premium_lock{color:var(--secondary-color);font-size:.8125rem;margin:.1875rem 0 0 .5rem}[dir=ltr] .chatlist .dialog-title-details{margin-left:.5rem}[dir=rtl] .chatlist .dialog-title-details{margin-right:.5rem}.chatlist .dialog-title-details{flex:0 0 auto;font-size:.75rem;padding:1px 0 0}[dir=ltr] .chatlist .dialog-subtitle-badge{margin-left:.5rem}[dir=rtl] .chatlist .dialog-subtitle-badge{margin-right:.5rem}.chatlist .dialog-subtitle-badge{display:block!important;flex:0 0 auto}.chatlist .dialog-subtitle-badge.avatar-badge{--size:1.625rem;border:2px solid var(--background,var(--surface-color));line-height:23px!important;margin:0;pointer-events:none;position:absolute;right:calc(100% - 4.0625rem);top:2.4375rem}[dir=ltr] .chatlist .dialog-subtitle-media{margin-right:.375rem}[dir=rtl] .chatlist .dialog-subtitle-media{margin-left:.375rem}.chatlist .dialog-subtitle-media{border-radius:.25rem;display:inline-block;flex:0 0 auto;height:1.25rem;line-height:1.25rem;position:relative;width:1.25rem}.chatlist .dialog-subtitle-media:before{content:\" \";display:inline-block;height:inherit;min-height:inherit;min-width:inherit;width:inherit}.chatlist .dialog-subtitle-media.is-round{border-radius:50%}.chatlist .dialog-subtitle-media.is-round .tgico-play{font-size:.875rem}.chatlist .dialog-subtitle-media .tgico-play{color:#fff;font-size:1rem;left:50%;line-height:1;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:1}.chatlist .dialog-subtitle-media .media-photo{border-radius:inherit;bottom:auto;height:inherit;-o-object-fit:cover;object-fit:cover;top:auto;width:inherit}.chatlist .dialog-group-call-icon{background-color:var(--avatar-online-color);border:2px solid var(--surface-color);border-radius:50%;height:20px;left:45px;overflow:hidden;position:absolute;top:45px;width:20px;z-index:2}body.animation-level-2 .chatlist .dialog-group-call-icon,body.animation-level-2 .chatlist .dialog-subtitle-badge{opacity:1;transform:scale(0);transition:none}body.animation-level-2 .chatlist .dialog-group-call-icon.is-visible:not(.backwards),body.animation-level-2 .chatlist .dialog-subtitle-badge.is-visible:not(.backwards){transform:scale(1)}body.animation-level-2 .chatlist .dialog-group-call-icon.backwards,body.animation-level-2 .chatlist .dialog-subtitle-badge.backwards{opacity:0}body.animation-level-2 .chatlist .dialog-group-call-icon.animating,body.animation-level-2 .chatlist .dialog-subtitle-badge.animating{transition:background-color var(--chatlist-badge-transition-in),transform var(--chatlist-badge-transition-in)}body.animation-level-2 .chatlist .dialog-group-call-icon.animating.backwards,body.animation-level-2 .chatlist .dialog-subtitle-badge.animating.backwards{transition:background-color var(--chatlist-badge-transition-out),transform var(--chatlist-badge-transition-out),opacity var(--chatlist-badge-transition-out)}body.animation-level-2 .chatlist .dialog-avatar:after{opacity:1;transform:scale(0);transition:none}body.animation-level-2 .chatlist .dialog-avatar.is-visible:not(.backwards):after{transform:scale(1)}body.animation-level-2 .chatlist .dialog-avatar.backwards:after{opacity:0}body.animation-level-2 .chatlist .dialog-avatar.animating:after{transition:background-color var(--chatlist-badge-transition-in),transform var(--chatlist-badge-transition-in)}body.animation-level-2 .chatlist .dialog-avatar.animating.backwards:after{transition:background-color var(--chatlist-badge-transition-out),transform var(--chatlist-badge-transition-out),opacity var(--chatlist-badge-transition-out)}.chatlist .dialog-avatar{flex:0 0 auto}.chatlist .dialog-avatar,.chatlist .row-row{pointer-events:none;position:relative}.chatlist .user-title{align-items:center;display:flex!important}.chatlist .user-title img.emoji{height:18px;margin-top:1px;vertical-align:top;width:18px}.chatlist .user-last-message img.emoji{height:20px;margin-top:-3px;width:20px}.chatlist .user-last-message,.chatlist .user-title{flex-grow:1;position:relative}[dir=ltr] .chatlist .message-status{margin-right:.125rem}[dir=rtl] .chatlist .message-status{margin-left:.125rem}.chatlist .message-status{color:var(--chatlist-status-color);display:inline-block;font-size:1.25rem;height:1.25rem;line-height:1;margin-top:-.0625rem;position:relative;vertical-align:middle;width:1.25rem}.chatlist .message-status:before{vertical-align:middle}.chatlist .tgico-chatspinned{background:transparent}body.animation-level-2 .chatlist .tgico-chatspinned:before{transition:opacity .2s ease-in-out}.chatlist .tgico-chatspinned:before{color:var(--chatlist-pinned-color);opacity:1}.chatlist .tgico-chatspinned.unread:before{opacity:0}.chatlist .tgico-chatspinned{position:relative}.chatlist .tgico-chatspinned:before{left:0;position:absolute;top:0}.chatlist .mention{background-color:var(--chatlist-status-color)!important;line-height:1.25rem!important;padding:0}[dir=ltr] .chatlist .mention-badge{margin-right:-.125rem}[dir=rtl] .chatlist .mention-badge{margin-left:-.125rem}.chatlist .is-muted.backwards .unread,.chatlist .unread{background-color:var(--chatlist-status-color)}.chatlist .is-muted .unread,.chatlist .no-unmuted-topic .unread{background-color:var(--secondary-color)}.chatlist .not-visited{--size:.5rem;--padding:0;background-color:var(--secondary-color)!important}.chatlist-parts.with-contacts .chatlist-top:not(.with-placeholder){height:auto;padding-bottom:.5rem}.chatlist-parts.with-contacts .chatlist-top.with-placeholder.has-contacts{height:24.125rem}.chatlist-parts.with-contacts .chatlist-top.with-placeholder .empty-placeholder-dialogs{top:50%}.chatlist-top{height:100%}.chatlist-bottom{max-height:36.375rem}.chatlist-bottom .sidebar-left-section{margin-bottom:0!important;padding-bottom:0}.chatlist-bottom .chatlist-new{padding:0}.chat-input{--translateY:0;--padding-bottom:0.5rem;--bottom:var(--padding-bottom);display:flex;flex:0 0 auto;flex-direction:column;max-width:100%;padding-top:.25rem;position:relative;transform:translate3d(0,var(--translateY),0);transition:transform var(--transition-standard-out);width:100%}body.animation-level-0 .chat-input{transition:none!important}@media only screen and (min-height:570px)and (min-width:601px){.chat-input{max-width:var(--messages-container-width)!important}}@media only screen and (min-width:601px){.chat-input{--padding-bottom:1.25rem}}@media only screen and (max-height:569px){.chat-input{--padding-bottom:0.5rem}}@media only screen and (min-width:1276px){.chat-input{width:calc(100% - var(--right-column-width))!important}body.is-right-column-shown .chat-input{transform:translate3d(calc(var(--right-column-width)/-2),var(--translateY),0)!important;transition:transform var(--transition-standard-in)}}.chat-input.is-hidden{--translateY:100%;bottom:0;position:absolute!important;transform:translate3d(0,var(--translateY),0)!important;transition:transform var(--transition-standard-in)}.bubbles.is-selecting:not(.backwards)~.chat-input.is-hidden{--translateY:0}.chat-input-container{--padding-horizontal:var(--chat-input-padding);align-items:flex-end;display:flex;flex:0 0 auto;justify-content:center;margin:0 auto;max-width:var(--messages-container-width);padding:0 var(--padding-horizontal);padding-bottom:var(--bottom);position:relative;width:100%}.chat-input-container .btn-circle{height:var(--chat-input-size);width:var(--chat-input-size)}.chat-input-container.is-centering .new-message-wrapper{pointer-events:none}.chat-input-container.is-centering:not(.backwards) .new-message-wrapper{opacity:0}.chat-input-container.is-centering:not(.backwards) .rows-wrapper{border-bottom-right-radius:12px;max-height:var(--chat-input-size)}.chat-input-container.is-centering:not(.backwards) .rows-wrapper .bubble-tail{opacity:0;transform:scaleX(-1) translateX(1.125rem)}.chat-input-container.is-centering:not(.backwards) .reply-wrapper{height:0!important;opacity:0;pointer-events:none}.chat-input-container.is-centering:not(.backwards) .btn-send{transform:scale(0)}.chat-input-container.is-centering.animating .rows-wrapper{transition:transform .2s,max-height .2s,border-radius .1s}.chat-input-container.is-centering.animating .rows-wrapper .bubble-tail{transition:transform .1s,opacity 25ms 0s}.chat-input-container.is-centering.animating .selection-wrapper{transition:opacity .1s 75ms}.chat-input-container.is-centering.animating .btn-send{transition:transform .2s}.chat-input-container.is-centering.animating:not(.backwards) .rows-wrapper .bubble-tail{transition:transform .1s,opacity 25ms 75ms}.chat-input .menu-send{bottom:calc(100% + .5rem);top:auto}.chat-input .toggle-emoticons:before{content:\"\"}.chat-input .toggle-emoticons.flip-icon:before{content:\"\"!important}[dir=ltr] .chat-input .btn-record-cancel{right:0}[dir=rtl] .chat-input .btn-record-cancel{left:0}.chat-input .btn-record-cancel{--multiplier:-1;opacity:0;padding:0;position:absolute;top:0;transform:translateX(calc((100% + var(--padding-horizontal) + .5rem)*var(--multiplier)));visibility:hidden;z-index:3}.chat-input .btn-record-cancel .c-ripple__circle,html.no-touch .chat-input .btn-record-cancel:active:after,html.no-touch .chat-input .btn-record-cancel:hover:after{background-color:var(--light-danger-color)}.chat-input .btn-record-cancel:before{color:var(--danger-color)}.is-rtl .chat-input .btn-record-cancel{--multiplier:1}[dir=ltr] .chat-input .btn-scheduled:after{right:5px}[dir=rtl] .chat-input .btn-scheduled:after{left:5px}.chat-input .btn-scheduled:after{background:var(--message-checkbox-color);border-radius:50%;content:\"\";height:.5rem;position:absolute;top:5px;width:.5rem}.chat-input .btn-preloader .preloader{height:1.5rem;width:1.5rem}.chat-input .btn-preloader .preloader .preloader-path{stroke:var(--secondary-text-color)}body.animation-level-2 .chat-input .btn-preloader.show.backwards{animation:hide-icon .4s ease-in-out forwards!important}[dir=ltr] .chat-input .float{margin-right:.75rem!important}[dir=rtl] .chat-input .float{margin-left:.75rem!important}.chat-input .float{align-self:center;display:none!important;margin:0!important}body.animation-level-2 .chat-input .float{animation:grow-icon .4s ease-in-out forwards!important}@media only screen and (max-height:569px),only screen and (max-width:600px){[dir=ltr] .chat-input .float{margin-right:.125rem!important}[dir=rtl] .chat-input .float{margin-left:.125rem!important}}.chat-input:not(.is-recording) .float.show:not(.hide){display:flex!important}[dir=ltr] .chat-input .btn-send-container{right:var(--padding-horizontal)}[dir=rtl] .chat-input .btn-send-container{left:var(--padding-horizontal)}.chat-input .btn-send-container{align-items:center;bottom:0;display:flex;justify-content:center;padding-bottom:inherit;position:absolute}.chat-input .btn-send-container .btn-menu-overlay{z-index:3}.chat-input .btn-icon{transition:opacity .2s}body.animation-level-0 .chat-input .btn-icon{transition:none}.chat-input .btn-cancel-record,.chat-input .btn-send{box-shadow:0 1px 8px 1px rgba(0,0,0,.12)}.chat-input .btn-send{background-color:var(--primary-color)!important;color:#fff!important;z-index:3}html.no-touch .chat-input .btn-send:active,html.no-touch .chat-input .btn-send:hover{background-color:var(--dark-primary-color)!important}.chat-input .btn-send .tgico-check{font-size:2rem;height:32px!important}.chat-input .btn-send .tgico-check:before{font-weight:var(--font-weight-bold)}.chat-input .btn-send.edit .tgico-check,.chat-input .btn-send.record .tgico-microphone_filled,.chat-input .btn-send.schedule .tgico-schedule,.chat-input .btn-send.send .tgico-send{visibility:visible!important}body.animation-level-2 .chat-input .btn-send.edit .tgico-check,body.animation-level-2 .chat-input .btn-send.record .tgico-microphone_filled,body.animation-level-2 .chat-input .btn-send.schedule .tgico-schedule,body.animation-level-2 .chat-input .btn-send.send .tgico-send{animation:grow-icon .4s ease-in-out forwards!important}.chat-input .btn-record-cancel,.chat-input .btn-send{font-size:1.5rem;line-height:1.5rem}.chat-input .record-time{display:none;height:44px;line-height:44px}.chat-input .record-time:after{background-color:var(--danger-color);border-radius:50%;content:\" \";display:inline-block;height:10px;margin-left:9px;margin-right:9px;width:10px}body.animation-level-2 .chat-input .record-time:after{animation:recordBlink 1.25s infinite}.chat-input .record-ripple{background-color:var(--message-highlightning-color);border-radius:50%;height:300px;opacity:.5;position:absolute;transform:scale(0);visibility:hidden;width:300px}@media only screen and (max-width:600px){.chat-input .record-ripple{height:240px;width:240px}}.chat-input.is-locked{pointer-events:none}.chat-input.is-locked .btn-icon,.chat-input.is-locked:not(.is-recording) .btn-send{color:#c6cbce}.chat-input.is-recording:not(.backwards) .btn-record-cancel{opacity:1;visibility:visible}.chat-input.is-recording:not(.backwards) .btn-record-cancel,.chat-input.is-recording:not(.backwards) .btn-send{pointer-events:all}.chat-input.is-recording:not(.backwards) .record-ripple{visibility:visible}.chat-input.is-recording:not(.backwards) .rows-wrapper{width:calc(100% - var(--chat-input-size)*2 - 1rem)}.chat-input.is-recording:not(.backwards) .attach-file{display:none}.chat-input.is-recording:not(.backwards) .record-time{display:block}.chat-input.is-recording.animating .btn-record-cancel{transition:visibility 0s .1s,opacity .1s 0s}.chat-input.is-recording.animating .record-ripple{transition:transform .03s ease-in-out,visibility .1s}.chat-input.is-recording.animating .rows-wrapper{transition:width .2s}.chat-input.is-recording.animating:not(.backwards) .btn-record-cancel{transition:visibility 0s .1s,opacity .1s .1s}.chat-input.is-recording.animating:not(.backwards) .record-ripple{transition:transform .03s,visibility 0s}[dir=ltr] .chat-input:not(.is-recording) .btn-record-cancel{margin-right:0}[dir=rtl] .chat-input:not(.is-recording) .btn-record-cancel{margin-left:0}.chat-input:not(.is-recording) .btn-record-cancel{width:0}.chat-input .new-message-wrapper{opacity:1}.chat-input .reply-in-topic-overlay{align-items:center;background-color:inherit;border-radius:inherit;color:var(--secondary-text-color);display:flex;justify-content:center;padding:0 1rem;pointer-events:none;z-index:3}.bubbles.is-selecting:not(.backwards)~.chat-input .selection-wrapper{opacity:1}.bubbles.is-selecting.animating~.chat-input .new-message-wrapper{transition:opacity .1s 0s}.bubbles.is-selecting.animating~.chat-input .selection-container-left,.bubbles.is-selecting.animating~.chat-input .selection-container-right{transition:transform .2s}.bubbles.is-selecting.animating.backwards~.chat-input .new-message-wrapper{transition:opacity .1s .1s}.bubbles.is-selecting.animating.backwards~.chat-input .selection-wrapper{transition:opacity .1s 0s}@keyframes recordBlink{0%{opacity:1}50%{opacity:.2}to{opacity:1}}#column-center{flex:3;position:relative;width:100%}@media only screen and (max-width:600px){body.is-left-column-shown #column-center{transform:translate3d(100vw,0,0)}body.is-right-column-shown #column-center{filter:brightness(80%);transform:translate3d(-25vw,0,0)}}@media only screen and (min-width:601px)and (max-width:925px){#column-center{bottom:0;left:0;position:fixed!important;right:0;top:0;transform:translateZ(0)}body.animation-level-2 #column-center{transition:transform var(--layer-transition)}body.is-left-column-shown #column-center{transform:translate3d(26.5625rem,0,0)}body.is-left-column-shown #column-center .sidebar-close-button:before{transform:rotate(180deg)}}.chats-container{height:100%}.chat{align-items:center;display:flex!important;flex-direction:column;transition:transform var(--tabs-transition),filter var(--tabs-transition);width:100%}body.animation-level-0 .chat{transition:none!important}.chat:not(.active):not(:last-child){filter:brightness(.8)}@media only screen and (min-width:926px){.chat:not(.active){transform:translate3d(calc((100vw - min(40vw, 420px))*-.25),0,0)}.chat:not(.active):last-child{transform:translate3d(calc(100vw - min(40vw, 420px)),0,0)}}@media only screen and (min-width:1681px){.chat:not(.active){transform:translate3d(calc((1680px - var(--right-column-width))*-.25),0,0)}.chat:not(.active):last-child{transform:translate3d(calc(1680px - var(--right-column-width)),0,0)}}@media only screen and (min-width:1276px)and (max-width:1680px){.chat:not(.active){transform:translate3d(-25vw,0,0)}.chat:not(.active):last-child{transform:translate3d(75vw,0,0)}}@media only screen and (max-width:925px){.chat:not(.active){transform:translate3d(-25vw,0,0)}.chat:not(.active):last-child{transform:translate3d(100vw,0,0)}}.chat.no-forwards .bubble-beside-button.forward{display:none}.chat.no-forwards .bubbles{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.chat-background{background-color:#e6ebee;overflow:hidden}html.night .chat-background{background-color:var(--border-color)}.chat-background.no-transition:before{transition:none!important}.chat-background,.chat-background-item{bottom:0;left:0;position:absolute!important;right:0;top:0}.chat-background-item.is-image{background-color:inherit;background-image:url(assets/img/bg.jpeg);background-position:50%;background-size:cover}.chat-background-item.is-pattern{align-items:center;background-color:#000!important;background-image:none!important;background-repeat:repeat-x;background-size:contain;display:flex;justify-content:center;margin:0!important}@media only screen and (min-width:1276px){.chat-background-item.is-pattern{height:150%;top:-25%}}body.animation-level-2 .chat-background-item{opacity:0;transition:opacity var(--transition-standard-out)}body.animation-level-2 .chat-background-item.is-visible:not(.backwards){opacity:1;transition:opacity var(--transition-standard-in)}@media only screen and (min-width:1276px){body.animation-level-2 .chat-background-item{margin:-18.5rem 0 -22rem;transform:scale(1);transform-origin:left center;transition:transform var(--transition-standard-out),opacity var(--transition-standard-out)!important}body.animation-level-2.is-right-column-shown .chat-background-item{transform:scale(.666666667);transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)!important}}.chat-background-item-canvas{--opacity-max:1;opacity:var(--opacity-max);position:absolute;width:100%}.chat-background-item:not(.is-dark) .chat-background-item-pattern-canvas{mix-blend-mode:soft-light}.chat-background-item-color-canvas{height:100%;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:cover;mask-size:cover}.chat .drops-container{--padding:20px;--pinned-floating-height:0px;top:calc(56px + var(--pinned-floating-height) + var(--padding))}@media only screen and (min-width:1276px){[dir=ltr] body.is-right-column-shown .chat .drops-container{right:calc(var(--right-column-width))}[dir=rtl] body.is-right-column-shown .chat .drops-container{left:calc(var(--right-column-width))}}@media only screen and (max-width:600px){.chat .drops-container{--padding:10px}}.chat .drop{--wrapper-padding:15px;max-width:696px}.chat[data-type=chat] .bubbles.is-chat-input-hidden .bubbles-date-group:last-of-type .bubbles-group:last-of-type .bubble:last-of-type{margin-bottom:1.25rem}.chat-input-wrapper{--padding-vertical:.3125rem;--padding-horizontal:var(--chat-input-inner-padding);--padding:var(--padding-vertical) var(--padding-horizontal);--button-size:2.125rem;--button-horizontal-margin:.125rem;align-items:center;border-radius:1rem;display:flex;flex:0 0 auto;flex-direction:column;justify-content:center;max-height:30rem;max-width:calc(100% - var(--chat-input-size) - .5rem);min-height:var(--chat-input-size);position:relative;width:calc(100% - var(--chat-input-size) - .5rem);z-index:3}.chat-input-wrapper:before{background-color:#fff;border-radius:inherit;bottom:0;box-shadow:0 1px 8px 1px rgba(0,0,0,.12);content:\" \";left:0;opacity:1;right:0;top:0}.chat-input-control,.chat-input-wrapper:before{background-color:var(--surface-color);position:absolute}.chat-input-control{--padding-vertical:.3125rem;--padding-horizontal:var(--chat-input-inner-padding);--padding:var(--padding-vertical) var(--padding-horizontal);height:var(--chat-input-size);margin:0 auto;padding:var(--padding);visibility:hidden;width:auto;z-index:3}.chat-input-control:before{opacity:0}.chat-input-control-button{height:2.5rem;justify-content:center;padding:0 .625rem}@media only screen and (max-width:600px){.chat-input-control-button{font-size:15px}}[dir=ltr] .chat-input-control-button:before{margin-right:10px}[dir=rtl] .chat-input-control-button:before{margin-left:10px}.fake-selection-wrapper,.selection-wrapper{max-width:calc(100% - var(--chat-input-padding)*2);position:absolute;top:0;width:28.75rem}.chat-input-control,.selection-wrapper{opacity:0}.selection-wrapper{background-color:var(--surface-color)}.selection-wrapper:before{content:none}.selection-wrapper .selection-container{align-items:center;border-radius:inherit;display:flex;font-size:15px;height:100%;justify-content:space-between;padding:inherit;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.selection-wrapper .selection-container-left,.selection-wrapper .selection-container-right{align-items:center;display:flex;justify-content:space-between;transform:translateX(0)}.selection-wrapper .selection-container-right{flex:0 0 auto}.selection-wrapper .selection-container-count{color:var(--primary-text-color);flex-grow:1;font-weight:var(--font-weight-bold);text-transform:capitalize;white-space:nowrap}[dir=ltr] .selection-wrapper .selection-container .btn-icon{margin-left:6px;margin-right:5px}[dir=rtl] .selection-wrapper .selection-container .btn-icon{margin-left:5px;margin-right:6px}.selection-wrapper .selection-container .btn-icon{height:42px;line-height:42px;width:42px}.selection-wrapper .selection-container .btn-primary{height:2.5rem;width:auto}@media only screen and (max-width:600px){.selection-wrapper .selection-container .btn-primary{padding:0 .5rem}.selection-wrapper .selection-container .btn-primary.tgico-send2{padding:0 2px}}@media only screen and (max-width:380px){.selection-wrapper .selection-container .btn-primary{font-size:0}.selection-wrapper .selection-container .btn-primary:before{margin:0}}[dir=ltr] .selection-wrapper .selection-container-forward:before{margin-right:14px}[dir=rtl] .selection-wrapper .selection-container-forward:before{margin-left:14px}[dir=ltr] .selection-wrapper .selection-container-delete{margin-left:.375rem;margin-right:.625rem}[dir=rtl] .selection-wrapper .selection-container-delete{margin-left:.625rem;margin-right:.375rem}[dir=ltr] .selection-wrapper .selection-container-delete:before{margin-right:10px}[dir=rtl] .selection-wrapper .selection-container-delete:before{margin-left:10px}.fake-wrapper{position:absolute;visibility:hidden;z-index:-1}[dir=ltr] .fake-rows-wrapper{left:var(--padding-horizontal)}[dir=rtl] .fake-rows-wrapper{right:var(--padding-horizontal)}.fake-rows-wrapper{top:0;width:calc(100% - var(--chat-input-size) - var(--padding-horizontal)*2 - .5rem)}.rows-wrapper-wrapper{display:flex;width:100%}.rows-wrapper-wrapper.is-centering-to-control:not(.backwards) .rows-wrapper:before{opacity:0}.rows-wrapper-wrapper.is-centering-to-control:not(.backwards)~.chat-input-control{opacity:1;visibility:visible}.rows-wrapper-wrapper.is-centering-to-control:not(.backwards)~.chat-input-control:before{opacity:1}.rows-wrapper-wrapper.is-centering-to-control.animating .rows-wrapper:before,.rows-wrapper-wrapper.is-centering-to-control.animating~.chat-input-control:before{transition:opacity .05s .15s}.rows-wrapper-wrapper.is-centering-to-control.animating~.chat-input-control{transition:opacity .1s 75ms,visibility 0s 0s}.rows-wrapper-wrapper.is-centering-to-control.animating.backwards .rows-wrapper:before,.rows-wrapper-wrapper.is-centering-to-control.animating.backwards~.chat-input-control:before{transition:opacity .05s 0s}.rows-wrapper-wrapper.is-centering-to-control.animating.backwards~.chat-input-control{transition:opacity .1s 0s,visibility 0s .2s}[dir=ltr] .rows-wrapper{border-bottom-right-radius:0}[dir=rtl] .rows-wrapper{border-bottom-left-radius:0}.rows-wrapper{transform:translateX(0) scaleX(1)}.rows-wrapper .bubble-tail{opacity:1}@media only screen and (max-width:600px){.rows-wrapper{--padding-vertical:1px}}@media only screen and (max-width:420px){.rows-wrapper{max-width:100%}}@media only screen and (max-height:569px){.rows-wrapper{--padding-vertical:1px}}[dir=ltr] .rows-wrapper .bubble-tail{right:-8.4px}[dir=rtl] .rows-wrapper .bubble-tail{left:-8.4px}.rows-wrapper .bubble-tail{fill:var(--surface-color);bottom:-1px;height:20px;position:absolute;transform:scaleX(-1);width:11px}.is-rtl .rows-wrapper .bubble-tail{transform:scaleX(1)}.rows-wrapper .attach-file.menu-open{background-color:var(--light-primary-color)!important;color:var(--primary-color)}.rows-wrapper .attach-file.btn-disabled{opacity:var(--disabled-opacity)}.rows-wrapper>div{align-items:center;background-color:var(--surface-color);border-radius:1rem;display:flex;justify-content:space-between;padding:var(--padding);position:relative;width:100%}.rows-wrapper .reply-wrapper{align-items:center;height:0;justify-content:flex-start;margin-bottom:-.5625rem;opacity:0;padding:.5625rem var(--padding-horizontal) 0;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:2}body.animation-level-2 .rows-wrapper .reply-wrapper{transition:height .15s ease-out,opacity .15s ease-out}@media only screen and (max-height:569px),only screen and (max-width:600px){.rows-wrapper .reply-wrapper{margin-bottom:-.3125rem;padding-top:.3125rem}}.chat.is-helper-active .rows-wrapper .reply-wrapper{height:45px;opacity:1;pointer-events:inherit}.rows-wrapper .reply-wrapper .reply{flex:1 1 auto;margin-left:.625rem;margin-right:.625rem;order:1}.rows-wrapper .reply-wrapper .reply-icon{order:0;pointer-events:none}.rows-wrapper .reply-wrapper .reply-cancel{order:2}.rows-wrapper .reply-wrapper .reply-subtitle{color:var(--secondary-text-color)!important;height:1.125rem}.rows-wrapper .reply-wrapper .reply .peer-title{font-weight:400}[dir=ltr] .rows-wrapper .reply-wrapper .btn-menu{left:3.125rem}[dir=rtl] .rows-wrapper .reply-wrapper .btn-menu{right:3.125rem}.rows-wrapper .reply-wrapper .btn-menu{bottom:calc(100% + .5rem);top:auto;transform:scale(1)!important}[dir=ltr] .rows-wrapper .reply-wrapper .btn-menu-item{padding-right:1.5rem}[dir=rtl] .rows-wrapper .reply-wrapper .btn-menu-item{padding-left:1.5rem}.rows-wrapper .reply-wrapper .btn-menu-item-text{order:1}[dir=ltr] .rows-wrapper .reply-wrapper .btn-menu-item .checkbox-field{margin-right:var(--icon-margin)}[dir=rtl] .rows-wrapper .reply-wrapper .btn-menu-item .checkbox-field{margin-left:var(--icon-margin)}.rows-wrapper .reply-wrapper .btn-menu-item .checkbox-field{--size:1.25rem;margin:0;order:0}.rows-wrapper .reply-wrapper .btn-menu-item .checkbox-box-background,.rows-wrapper .reply-wrapper .btn-menu-item .checkbox-box-border{display:none}.rows-wrapper .reply-wrapper .btn-menu-item .checkbox-box-check use{stroke:var(--primary-text-color)}@media only screen and (max-width:600px){[dir=ltr] .rows-wrapper .reply-wrapper .btn-menu{left:calc(var(--padding-horizontal)*-1)}[dir=rtl] .rows-wrapper .reply-wrapper .btn-menu{right:calc(var(--padding-horizontal)*-1)}}.rows-wrapper .input-message-input{margin-top:-1px;max-height:27.5rem!important}@media only screen and (max-height:30rem){.rows-wrapper .input-message-input{max-height:max(36px,calc(100vh - 10rem))}}@media only screen and (max-width:600px){.rows-wrapper .input-message-input{max-height:10rem}}.rows-wrapper .input-message-input[data-inline-placeholder]:after{color:#a2acb4;content:attr(data-inline-placeholder);pointer-events:none}.rows-wrapper .new-message-wrapper{--send-as-size:1.875rem;--send-as-margin-left:.25rem;--send-as-margin-right:.375rem;--send-as-total-size:calc(var(--send-as-size) + var(--send-as-margin-left) + var(--send-as-margin-right));--commands-size:2.375rem;--commands-margin-left:.25rem;--commands-margin-right:.375rem;--commands-total-size:calc(var(--commands-size) + var(--commands-margin-left) + var(--commands-margin-right));--offset-translateX:0px;align-items:flex-end;min-height:var(--chat-input-size)}.rows-wrapper .new-message-wrapper .new-message-bot-commands,.rows-wrapper .new-message-wrapper .new-message-send-as-container{bottom:calc(var(--padding-vertical) + .4375rem);cursor:pointer;flex:0 0 auto;opacity:0;position:absolute;transform:scale(0);z-index:2}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-bot-commands{margin-left:var(--commands-margin-left)}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-bot-commands{margin-right:var(--commands-margin-left)}.rows-wrapper .new-message-wrapper .new-message-bot-commands{align-items:center;background-color:var(--primary-color);border-radius:1.875rem;cursor:pointer;display:flex;height:1.875rem;justify-content:center;width:var(--commands-size)}.rows-wrapper .new-message-wrapper .new-message-bot-commands .animated-menu-close-icon{position:relative}.rows-wrapper .new-message-wrapper .new-message-bot-commands-icon-scale{align-items:center;display:flex;justify-content:center;transform:scale(.875)}.rows-wrapper .new-message-wrapper .new-message-bot-commands .animated-menu-close-icon{--color:#fff}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-send-as-container{margin-left:var(--send-as-margin-left)}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-send-as-container{margin-right:var(--send-as-margin-left)}.rows-wrapper .new-message-wrapper .new-message-send-as-container{background:none!important;height:var(--send-as-size);width:var(--send-as-size)}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{right:auto}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{left:auto}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{left:calc(var(--padding-horizontal)*-1 - .25rem)!important}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{right:calc(var(--padding-horizontal)*-1 - .25rem)!important}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu{height:auto;max-height:20rem;max-width:20rem;top:auto;transform:scaleX(1);width:auto}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item{height:2.25rem}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-header{height:1.875rem}[dir=ltr] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-icon{margin-right:calc(var(--icon-margin) - .5rem)}[dir=rtl] .rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-icon{margin-left:calc(var(--icon-margin) - .5rem)}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-icon.active:before{--offset:-.125rem;border:.0625rem solid var(--primary-color);border-radius:inherit;bottom:var(--offset);content:\" \";left:var(--offset);position:absolute;right:var(--offset);top:var(--offset)}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-text{display:flex;flex-direction:column;justify-content:center;line-height:1!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rows-wrapper .new-message-wrapper .new-message-send-as-container .btn-menu-item-subtitle{font-size:.8125rem;font-weight:400}.rows-wrapper .new-message-wrapper .new-message-send-as-avatar{opacity:0;pointer-events:none;position:absolute;transform:scale(0)}.rows-wrapper .new-message-wrapper .new-message-send-as-avatar.is-visible:not(.backwards){opacity:1;transform:scale(1)}.rows-wrapper .new-message-wrapper .new-message-send-as-avatar.is-visible.animating{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.rows-wrapper .new-message-wrapper .new-message-send-as-close{align-items:center;background-color:var(--primary-color);border-radius:50%;color:#fff;display:flex;font-size:1.375rem;height:inherit;justify-content:center;width:inherit;z-index:1}.rows-wrapper .new-message-wrapper.has-offset[data-offset=as]{--offset-translateX:var(--send-as-total-size)}.rows-wrapper .new-message-wrapper.has-offset[data-offset=commands]{--offset-translateX:48px}.rows-wrapper .new-message-wrapper.has-offset .input-message-container,.rows-wrapper .new-message-wrapper.has-offset .toggle-emoticons{transform:translateX(0)}.rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .toggle-emoticons{transform:translateX(var(--offset-translateX))}[dir=ltr] .rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .input-message-container{margin-right:var(--translateX)}[dir=rtl] .rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .input-message-container{margin-left:var(--translateX)}.rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .input-message-container{--translateX:calc(var(--offset-translateX));transform:translate(var(--translateX))}.rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .new-message-bot-commands,.rows-wrapper .new-message-wrapper.has-offset:not(.backwards) .new-message-send-as-container{opacity:1;transform:scale(1)}.rows-wrapper .new-message-wrapper.has-offset.animating .input-message-container,.rows-wrapper .new-message-wrapper.has-offset.animating .toggle-emoticons{transition:transform var(--transition-standard-in)}.rows-wrapper .new-message-wrapper.has-offset.animating .new-message-bot-commands,.rows-wrapper .new-message-wrapper.has-offset.animating .new-message-send-as-container{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.rows-wrapper .new-message-wrapper .btn-menu{bottom:calc(100% + 1.125rem)}@media only screen and (max-height:569px),only screen and (max-width:600px){.rows-wrapper .new-message-wrapper .btn-menu{bottom:calc(100% + .875rem)}}.rows-wrapper .new-message-wrapper .btn-menu.top-left{right:calc(var(--padding-horizontal)*-1 - .125rem)}.rows-wrapper .new-message-wrapper .btn-menu.top-right{left:calc(var(--padding-horizontal)*-1 - .125rem)}.rows-wrapper .btn-icon{color:var(--secondary-text-color);flex:0 0 auto;font-size:1.5rem;height:var(--button-size);margin-bottom:5px;margin-left:var(--button-horizontal-margin);margin-right:var(--button-horizontal-margin);margin-top:0;padding:0;width:var(--button-size)}.rows-wrapper .btn-icon.active{color:var(--primary-color)}.input-message-container{align-items:center;align-self:center;display:flex;flex:1 1 auto;max-height:inherit;min-height:calc(var(--chat-input-size) - var(--padding-vertical)*2);overflow:hidden;position:relative;width:1%}.input-message-container .scrollable{position:relative}.input-message-input{--custom-emoji-size:var(--messages-custom-emoji-size);background:none;border:none;font-size:var(--messages-text-size);line-height:var(--line-height);outline:none;overflow-y:none;padding:.5rem .5625rem;resize:none;width:100%}.input-message-input pre{display:inline;margin:0}body.animation-level-2 .input-message-input{transition:height .1s}.bubbles{--translateY:0;flex:1 1 auto;position:relative;transform:translate3d(0,var(--translateY),0);transition:transform var(--transition-standard-out);width:100%}body.animation-level-0 .bubbles{transition:none!important}.chat[data-type=chat] .bubbles.is-chat-input-hidden.is-selecting:not(.backwards){--translateY:-78px;transition:transform var(--transition-standard-in)}@media only screen and (max-width:600px){.chat[data-type=chat] .bubbles.is-chat-input-hidden.is-selecting:not(.backwards){--translateY:-58px}}.chat[data-type=chat] .bubbles.is-chat-input-hidden.is-selecting:not(.backwards) .bubbles-inner{transform:translateY(calc(var(--translateY)*-1));transition:transform var(--transition-standard-in)}.bubbles>.scrollable{display:block;height:auto}@media only screen and (min-width:1276px){body.is-right-column-shown .bubbles{transform:translate3d(calc(var(--right-column-width)/-2),var(--translateY),0);transition:transform var(--transition-standard-in)}}body.animation-level-2 .bubbles.is-selecting .bubbles-group-avatar,body.animation-level-2 .bubbles.is-selecting .is-in .bubble-content-wrapper{transition:var(--bubble-transition-out)}body.animation-level-2 .bubbles.is-selecting:not(.backwards) .bubbles-group-avatar,body.animation-level-2 .bubbles.is-selecting:not(.backwards) .is-in .bubble-content-wrapper{transition:var(--bubble-transition-in)}.bubbles.is-selecting:not(.backwards) .is-in .bubble-content-wrapper{transform:translateX(2.5rem) scale(1)}.bubbles.is-selecting:not(.backwards) .bubbles-group-avatar{transform:translate3d(2.5rem,0,0) scale3d(.76,.76,1)}.bubbles:not(.scrolled-down):not(.search-results-active)+.chat-input .bubbles-go-down{cursor:pointer;opacity:1;visibility:visible}body.animation-level-2 .bubbles:not(.scrolled-down):not(.search-results-active)+.chat-input .bubbles-go-down{transition:opacity var(--layer-transition),visibility 0s 0s!important}.bubbles:not(.scrolled-down):not(.search-results-active)+.chat-input .bubbles-go-mention{--translateY:calc(var(--chat-input-size)*-1 - 0.625rem)}.bubbles .search-group.search-group-messages{padding:.25rem 0 .5rem}.bubbles-inner{display:flex;flex-direction:column;justify-content:flex-end;margin:0 auto;max-width:var(--messages-container-width);min-height:100%;padding:0 .8125rem;transform:translateY(0);transition:transform var(--transition-standard-out);width:100%}body.animation-level-0 .bubbles-inner{transition:none!important}@media only screen and (min-width:1276px){.bubbles-inner{width:calc(100% - var(--right-column-width))}}@media only screen and (max-width:600px){.bubbles-inner{padding:0 .5rem}}.bubbles-inner:after{content:\" \";height:.125rem}[dir=ltr] .bubbles-inner.is-chat .is-in .bubble-content-wrapper{margin-left:45px}[dir=rtl] .bubbles-inner.is-chat .is-in .bubble-content-wrapper{margin-right:45px}@media only screen and (max-width:600px){.bubbles-inner.is-chat .is-in .bubble-content-wrapper{max-width:calc(100% - var(--message-handhelds-margin))}}.bubbles-inner.is-channel:not(.is-chat) .bubble-content-wrapper{max-width:100%}.bubbles-inner.is-channel:not(.is-chat) .bubble.with-beside-button .bubble-content-wrapper{max-width:calc(100% - var(--message-beside-button-margin)*-1)!important}.bubbles-inner.is-chat .message,.bubbles-inner.is-chat .name,.bubbles-inner:not(.is-channel) .message,.bubbles-inner:not(.is-channel) .name{max-width:480px}.bubbles-inner.is-scrolling .is-sticky{opacity:.99999!important}html.is-safari .bubbles-inner.is-scrolling .is-sticky{transform:translateY(calc(var(--translateY)*-1))}body.animation-level-2 html.is-safari .bubbles-inner.is-scrolling .is-sticky{transition:transform var(--transition-standard-in)}.bubbles-inner>.bubble.is-in{width:100%}@media only screen and (min-width:1276px){.bubbles-inner>.bubble.is-in .bubble-content-wrapper{max-width:85%}}.bubbles-go-down{cursor:default;opacity:0;transform:none!important;transition:opacity var(--layer-transition),visibility 0s .2s!important;visibility:hidden}.bubbles-go-mention{--translateY:0;cursor:default;opacity:0;transition:transform var(--layer-transition),opacity var(--layer-transition),visibility 0s .2s!important;visibility:hidden}.bubbles-go-mention.is-visible{cursor:pointer;opacity:1;transition:transform var(--layer-transition),opacity var(--layer-transition),visibility 0s 0s!important;visibility:visible}.chat-secondary-button{align-items:center;background-color:var(--surface-color)!important;border-radius:50%;box-shadow:0 1px 8px 1px rgba(0,0,0,.12)!important;color:var(--secondary-text-color);display:flex;font-size:1.5rem;justify-content:center;position:absolute}body.animation-level-0 .chat-secondary-button{transition:none!important}.chat-secondary-button:before{position:relative}.chat-secondary-button:after{border-radius:inherit;bottom:0;content:\" \";left:0;position:absolute;right:0;top:0}html.no-touch .chat-secondary-button:active:after,html.no-touch .chat-secondary-button:hover:after{background-color:var(--light-secondary-text-color)}[dir=ltr] .bubbles-corner-button{right:var(--chat-input-padding)}[dir=rtl] .bubbles-corner-button{left:var(--chat-input-padding)}.bubbles-corner-button{bottom:calc(var(--chat-input-size) + var(--bottom) + 10px);overflow:visible;z-index:2}[dir=ltr] .bubbles-corner-button .badge{right:-.25rem}[dir=rtl] .bubbles-corner-button .badge{left:-.25rem}.bubbles-corner-button .badge{position:absolute;top:-.25rem}.bubbles-corner-button .badge.badge-primary:not(.badge-gray){background-color:var(--chatlist-status-color)}@media only screen and (max-width:600px){[dir=ltr] .bubbles-corner-button .badge{right:.1875rem}[dir=rtl] .bubbles-corner-button .badge{left:.1875rem}.bubbles-corner-button .badge{top:-.75rem}}.popup.popup-delete-message .popup-header{margin-bottom:1rem}body.is-calling .topbar,body.is-calling .topbar-call-container{transform:translateY(0)}body.is-calling.animation-level-2 .topbar,body.is-calling.animation-level-2 .topbar-call-container{transition:transform var(--transition-standard-out)}body.is-calling:not(.backwards) .topbar,body.is-calling:not(.backwards) .topbar-call-container{transform:translateY(var(--topbar-call-height))}body.is-calling:not(.backwards):not(.animating){--topbar-floating-call-height:var(--topbar-call-height)}@media only screen and (min-width:1276px){body.is-right-column-shown{--topbar-floating-scaleX:calc(1 - var(--right-column-proportion))}}.topbar{--topbar-height:3.5rem;--pinned-floating-audio-height:0px;--pinned-floating-message-height:0px;--pinned-floating-height:calc(var(--pinned-floating-audio-height) + var(--pinned-floating-message-height) + var(--topbar-floating-call-height));--pinned-audio-height:52px;--pinned-message-height:52px;cursor:pointer!important;margin-bottom:var(--pinned-floating-height);max-height:var(--topbar-height)!important;min-height:var(--topbar-height)!important;position:relative;width:100%;z-index:1}.topbar:before{box-shadow:0 1px 5px -1px rgba(0,0,0,.21);content:\" \";height:calc(var(--topbar-height) + var(--pinned-floating-height) - var(--topbar-floating-call-height));left:0;pointer-events:none;position:absolute;right:0;top:0}.topbar.is-pinned-audio-floating{--pinned-floating-audio-height:var(--pinned-audio-height)}.topbar.is-pinned-message-floating{--pinned-floating-message-height:var(--pinned-message-height)}.topbar:not(.is-pinned-message-floating) .chat-utils{position:relative;z-index:1}.topbar.is-pinned-audio-floating.is-pinned-message-floating .pinned-message{top:calc(var(--topbar-height) + var(--pinned-audio-height))}.topbar.is-pinned-audio-floating.is-pinned-message-floating .pinned-message:before{border-top:none}@media only screen and (min-width:601px){.topbar .menu-search{display:none}.topbar.is-pinned-message-shown:not(.hide-pinned) .pinned-message{display:flex}}@media only screen and (min-width:926px){.chat:first-child .topbar .sidebar-close-button{display:none}[dir=ltr] .chat:first-child .topbar .chat-info{padding-left:.1875rem}[dir=rtl] .chat:first-child .topbar .chat-info{padding-right:.1875rem}}@media only screen and (min-width:1276px){.topbar .pinned-container-wrapper-utils{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar .pinned-container-wrapper-utils{transform:translate3d(calc(var(--right-column-width)*-1),0,0);transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar .pinned-container-wrapper-utils{transition:none}}.topbar .sidebar-close-button{position:absolute}.topbar .user-title{align-items:center;display:flex;font-size:1rem;font-weight:var(--font-weight-bold);line-height:1.5rem;max-width:calc(100% - 1.5rem)}.topbar .user-title span.emoji{vertical-align:inherit}.topbar .info,.topbar .peer-title{line-height:var(--line-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topbar .info:not(:empty){margin-top:1px}.topbar .btn-menu-toggle .btn-menu{max-height:calc(var(--vh)*100 - 4.375rem);top:calc(100% + 7px)}@media only screen and (max-width:600px){.topbar .btn-menu-toggle .btn-menu{max-height:calc(var(--vh)*100 - 3.75rem);top:29px}.topbar .btn-menu-toggle{margin-left:0}}[dir=ltr] .topbar .chat-info{padding-left:49px}[dir=rtl] .topbar .chat-info{padding-right:49px}.topbar .chat-info{flex:1 1 auto;max-width:calc(100% - var(--utils-width));overflow:hidden}@media only screen and (max-width:600px){[dir=ltr] .topbar .chat-info{padding-left:52px}[dir=rtl] .topbar .chat-info{padding-right:52px}}@media only screen and (min-width:1276px){body.is-right-column-shown .topbar .chat-info{max-width:calc(100% - var(--right-column-width) - var(--utils-width))}}.topbar .chat-info-container{align-items:center;display:flex;flex:1 1 auto;height:3.5rem;justify-content:space-between;max-height:3.5rem;max-width:100%}.topbar .chat-utils{align-items:center;display:flex;flex:0 0 auto}@media only screen and (min-width:1276px){.topbar .chat-utils{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar .chat-utils{transform:translate3d(calc(var(--right-column-width)*-1),0,0);transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar .chat-utils{transition:none}}@media only screen and (max-width:600px){.topbar .chat-utils>.btn-icon:not(.btn-menu-toggle){display:none}}[dir=ltr] .topbar .chat-join{margin-right:.5rem}[dir=rtl] .topbar .chat-join{margin-left:.5rem}.topbar .chat-join{font-size:.875rem;font-weight:400;height:2.25rem;padding:0 1.375rem;width:auto}.topbar .chat-join:not(.hide)+.chat-mute-button{display:none}[dir=ltr] .topbar .content{padding-left:1.125rem}[dir=rtl] .topbar .content{padding-right:1.125rem}.topbar .content{flex:1 1 auto;max-width:100%;overflow:hidden}.topbar .person{align-items:center;display:flex}.topbar .person-avatar{flex:0 0 auto}.topbar .person .bottom{color:var(--secondary-text-color);font-size:.875rem}.topbar .person .bottom .online{color:var(--primary-color)}.topbar.hide-pinned{--pinned-floating-height:0px}.topbar.hide-pinned .pinned-container{display:none}.topbar.hide-pinned+.bubbles .bubbles-inner{margin-bottom:.25rem}[dir=ltr] .chat:not([data-type=chat]) .topbar .content{padding-left:16px}[dir=rtl] .chat:not([data-type=chat]) .topbar .content{padding-right:16px}[dir=ltr] .topbar-call-container{left:1px;right:0}[dir=rtl] .topbar-call-container{left:0;right:1px}.topbar-call-container{color:#fff;cursor:pointer!important;height:var(--topbar-call-height)!important;min-height:auto!important;position:absolute;top:calc(var(--topbar-call-height)*-1);z-index:2}body:not(.has-chat) .topbar-call-container{background:none!important}@media only screen and (max-width:925px){[dir=ltr] .topbar-call-container{left:0}[dir=rtl] .topbar-call-container{right:0}}.topbar-call-container .btn-icon{color:inherit;flex:0 0 auto;height:2.5rem;padding:0;width:2.5rem}.topbar-call-container .peer-title{font-weight:var(--font-weight-bold);white-space:nowrap}@media only screen and (max-width:480px){.topbar-call-container:not(.is-call) .topbar-call-left,.topbar-call-container:not(.is-call) .topbar-call-right{width:auto}.topbar-call-container:not(.is-call) .group-call-description{display:none}.topbar-call-container.is-call .topbar-call-left,.topbar-call-container.is-call .topbar-call-right{width:6.25rem}.topbar-call-container.is-call .call-description:not(.has-duration){display:none}}.topbar-call-left,.topbar-call-right{flex:0 0 auto;width:12rem}.topbar-call-left{align-items:center;display:flex}[dir=ltr] .topbar-call-left .btn-icon{margin-right:.375rem}[dir=rtl] .topbar-call-left .btn-icon{margin-left:.375rem}.topbar-call-left .call-description{white-space:nowrap}.topbar-call-left .call-description-duration{font-weight:var(--font-weight-bold)}.topbar-call-center{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media only screen and (min-width:1276px){.topbar-call-center{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar-call-center{transform:translate3d(calc(var(--right-column-width)*-.5),0,0);transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar-call-center{transition:none}.topbar-call-center{padding:0 calc(var(--right-column-width)/2)}}.topbar-call-right{display:flex;justify-content:flex-end}@media only screen and (min-width:1276px){.topbar-call-right{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar-call-right{transform:translate3d(calc(var(--right-column-width)*-1),0,0);transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar-call-right{transition:none}}.topbar-call-weave{bottom:-1.125rem;left:0;pointer-events:none;position:absolute;right:0;top:0;transform:scale(var(--topbar-floating-scaleX),-1);transform-origin:left center;z-index:-1}.is-rtl .topbar-call-weave{transform-origin:right center}@media only screen and (min-width:1276px){.topbar-call-weave{transition:transform var(--transition-standard-out)}body.is-right-column-shown .topbar-call-weave{transition:transform var(--transition-standard-in)}body.animation-level-0 .topbar-call-weave{transition:none}}.topbar-call-weave-canvas{height:100%;width:100%}.topbar .back-unread-badge{position:absolute;right:-.5rem;top:-.25rem}@media only screen and (min-width:601px){.topbar .back-unread-badge{display:none}}@keyframes bubbleSelected{0%{opacity:0}25%{opacity:1}to{opacity:0}}.bubbles-date-group{position:relative}.bubbles-date-group .sticky_sentinel--top{height:.25rem;top:0}.bubbles-group{position:relative}.bubbles-group-avatar{bottom:.25rem;cursor:pointer;pointer-events:all;position:sticky!important;top:0}.bubbles.is-selecting .bubbles-group-avatar{transform:translateZ(0) scaleX(1);transform-origin:bottom}.bubbles-group-avatar.is-gesturing-reply{transform:translateX(0)}.bubbles-group-avatar.is-gesturing-reply.animating.backwards{transition:transform var(--transition-standard-out)}.bubbles-group-avatar-container{bottom:0;display:flex;flex-direction:column-reverse;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:2}.bubble{--line-height:var(--messages-line-height);display:flex;flex-wrap:wrap;margin:0 auto .125rem;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}.bubble.is-gesturing-reply{transform:translateX(0)}.bubble.is-gesturing-reply.animating.backwards{transition:transform var(--transition-standard-out)}.bubble.is-gesturing-reply .bubble-gesture-reply-icon{align-items:center;background-color:var(--message-highlightning-color);border-radius:50%;color:#fff;display:flex;height:var(--message-beside-button-size);justify-content:center;opacity:0;position:absolute;right:var(--message-beside-button-margin);top:50%;transform:translateY(-50%);transform:translateY(-50%) scale(.6);visibility:hidden;width:var(--message-beside-button-size)}.bubble.is-gesturing-reply .bubble-gesture-reply-icon:before{font-size:1.125rem!important}body.animation-level-2 .bubble.is-gesturing-reply .bubble-gesture-reply-icon{transition:transform .1s ease-in-out}.bubble.is-gesturing-reply .bubble-gesture-reply-icon.is-visible{transform:translateY(-50%) scale(1);visibility:visible}.bubble.is-highlighted:after,.bubble.is-selected:after,.bubble:after{bottom:-.0625rem;content:\" \";left:-50%;position:absolute;top:-.0625rem;z-index:-1}.bubble.is-highlighted:after{background-color:var(--message-highlightning-color)}body:not(.animation-level-0) .bubble.is-highlighted:after{animation:bubbleSelected 2s linear}@media only screen and (max-width:600px){.bubble.is-first-unread{max-width:none}}.bubble.is-first-unread:before{background-color:var(--surface-color);color:var(--primary-color);content:\"Unread messages\";font-size:15px;font-weight:var(--font-weight-bold);height:30px;line-height:2.1;margin-bottom:.25rem;margin-left:-50%;margin-right:-50%;position:relative;text-align:center;z-index:2}.bubble.is-first-unread.is-highlighted:after,.bubble.is-first-unread.is-selected:after{top:calc(.0625rem + 30px)}.bubble.is-selected:after{background-color:var(--message-highlightning-color)}body:not(.animation-level-0) .bubble.is-selected:after{animation:fade-in-opacity .2s linear forwards}body:not(.animation-level-0) .bubble.is-selected.backwards:after{animation:fade-in-backwards-opacity .2s linear forwards}.bubble:after,.bubble:before{display:block;width:200%}.bubble.is-multiple-documents:after,.bubble.is-multiple-documents:before{display:none}.bubble.is-multiple-documents .user-avatar{z-index:2}.bubble .replies-footer+.poll-message .poll-footer-button{border-radius:0!important}.bubble-select-checkbox{display:flex;left:0;margin:0;position:absolute;z-index:3}.bubble-select-checkbox .checkbox-box-border{border-color:var(--message-checkbox-border-color)}.bubble-select-checkbox .checkbox-box-background{background-color:var(--message-checkbox-color)}.bubble-select-checkbox .checkbox-box-check use{stroke-width:3.5}.bubble>.bubble-select-checkbox{bottom:.3125rem}.bubble>.bubble-select-checkbox .checkbox-box{box-shadow:0 0 3px 0 rgba(0,0,0,.4)}.bubbles.is-selecting .bubble:not(.is-album) .attachment,.bubbles.is-selecting .bubble:not(.is-album) .audio,.bubbles.is-selecting .bubble:not(.is-album) .document,.bubbles.is-selecting .bubble:not(.is-album) poll-element{pointer-events:none!important}.bubbles.is-selecting .bubble a,.bubbles.is-selecting .bubble img,.bubbles.is-selecting .bubble video{pointer-events:none}.bubble-content{background-color:var(--message-background-color);border-radius:12px;box-shadow:0 1px 2px 0 rgba(16,35,47,.15);display:flex;flex-direction:column-reverse;max-width:100%;min-width:56px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:2}body.animation-level-0 .bubble-content{transition:none}html.is-touch body:not(.no-select) .chat:not(.no-forwards) .bubbles.is-selecting .bubble-content,html.no-touch .chat:not(.no-forwards) .bubbles:not(.is-selecting) .bubble-content{-webkit-user-select:text;-moz-user-select:text;user-select:text}.bubble-content.hover-reaction-visible .bubble-beside-button{transform:translateX(1.125rem)}.bubble.is-out .bubble-content.hover-reaction-visible .bubble-beside-button{transform:translateX(-1.125rem)}.bubble.is-out .bubble-content.hover-reaction-visible .bubble-beside-button.goto-original{transform:translateX(-1.125rem) rotate(180deg)}.bubble-hover-reaction{--size:1.875rem;--offset:calc(var(--size)*-0.75);align-items:center;background-color:var(--surface-color);border-radius:var(--size);bottom:0;box-shadow:var(--menu-box-shadow);cursor:pointer;display:flex;height:1.625rem;justify-content:center;opacity:0;position:absolute;right:var(--offset);transform:scale(.8);width:var(--size);z-index:2}body.animation-level-2 .bubble-hover-reaction{transition:opacity var(--btn-corner-transition),transform var(--btn-corner-transition)}.bubble-hover-reaction.is-visible:not(.backwards){opacity:1;transform:scale(1)}.bubble-hover-reaction-sticker{height:1.125rem;position:relative;width:1.125rem}.bubble.service{max-width:var(--messages-container-width)}.bubble.service .bubble-content{box-shadow:none;margin:0 auto;max-width:100%}.bubble.is-date{font-weight:var(--font-weight-bold);opacity:.99999;padding-bottom:.375rem;pointer-events:none;position:sticky;top:.25rem;transition:opacity .3s ease;z-index:2}.bubble.is-date:after,.bubble.is-date:before{display:none}body.animation-level-0 .bubble.is-date{transition:none}.bubble.is-date.is-sticky{opacity:.00001}.bubbles-inner:not(.is-scrolling) .bubble.is-date.is-sticky .bubble-content{cursor:default}.chat[data-type=chat] .bubble.is-date .bubble-content,.chat[data-type=discussion] .bubble.is-date .bubble-content{cursor:pointer;pointer-events:all}.bubbles:not(.has-sticky-dates) .bubble.is-date{visibility:hidden}.bubbles.has-sticky-dates .bubble.is-date.is-fake{display:none}.bubble.is-date.is-fake{left:50%;opacity:1!important;position:absolute;top:0;transform:translateX(-50%);transition:none!important;visibility:visible!important}.bubble-beside-button{align-items:center;background:var(--message-highlightning-color);border-radius:50%;bottom:0;color:var(--badge-text-color);cursor:pointer;display:flex;font-size:1.5rem;height:var(--message-beside-button-size);justify-content:center;position:absolute;right:var(--message-beside-button-margin);transform:translateX(0);width:var(--message-beside-button-size)}html.no-touch .bubble-beside-button{opacity:0}html.no-touch body.animation-level-2 .bubble-beside-button{transition:opacity .2s ease-in-out,transform .2s ease-in-out}.bubble-view-button{align-items:center;border:1px solid var(--message-primary-color);border-radius:6px;color:var(--message-primary-color);display:flex;height:2rem;justify-content:center;margin:0 .5625rem .5rem;text-decoration:none!important;width:auto}html.no-touch .bubble-view-button:active,html.no-touch .bubble-view-button:hover{background-color:var(--light-filled-message-primary-color)}.bubble-view-button .c-ripple__circle{background-color:var(--message-primary-color);opacity:.08}.message .bubble-view-button{margin:.375rem 0 -.375rem;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.bubble-view-button+.reactions-block{margin-top:.375rem}html.no-touch .bubble:active .bubble-beside-button,html.no-touch .bubble:hover .bubble-beside-button{opacity:1}.bubble .forward{font-size:1.25rem}.bubble.is-group-last{margin-bottom:.5rem}.bubble.is-group-last:after{bottom:-.25rem}.bubbles-inner.is-chat .bubble.is-group-last.is-in>.bubble-select-checkbox{bottom:.1875rem}.bubble.is-group-first:after{top:-.25rem}.bubble:not(.forwarded):not(.must-have-name):not(.is-group-first) .name{display:none}.bubble:not(.forwarded):not(.must-have-name):not(.is-group-first):not(.is-message-empty):not(.is-reply) .message{padding-top:6px}.bubble:not(.is-group-last) .bubble-content-wrapper>.user-avatar{display:none}.bubble.photo .bubble-content,.bubble.video .bubble-content{width:-moz-min-content;width:min-content}.bubble.photo .web,.bubble.video .web{max-width:100%}.bubble.photo .message,.bubble.video .message{max-width:420px}.bubble.webpage .preview-with-document{margin-bottom:0!important;min-width:100%}.bubble.webpage .document{height:3.375rem}@media only screen and (max-width:600px){.bubble.webpage .document{padding-left:44px}}.bubble.webpage .has-document{display:flex;flex-direction:column}.bubble.webpage .has-document .preview-resizer{order:1}.bubble .preview-resizer{display:flex}.bubble img.emoji{height:18px;vertical-align:bottom;width:18px}.bubble .thumbnail{position:absolute}.bubble .canvas-thumbnail{border-radius:inherit}.bubble .canvas-dots{z-index:1}.bubble.emoji-big{--emoji-size:1rem;font-size:0}.bubble.emoji-big .bubble-content{line-height:1}.bubble.emoji-big .attachment{--custom-emoji-size:var(--emoji-size);border-radius:0!important}.bubble.emoji-big .attachment img.emoji{height:var(--emoji-size);max-height:64px;max-width:64px;width:var(--emoji-size)}.bubble.emoji-big .attachment .custom-emoji,.bubble.emoji-big .attachment .emoji{display:inline-block}.bubble.emoji-big:not(.sticker) .attachment{display:block;font-size:var(--emoji-size);max-height:-moz-fit-content!important;max-height:fit-content!important;padding-bottom:1.25rem;padding-top:.25rem;white-space:pre-wrap;word-break:break-word}.bubble.emoji-big:not(.sticker) .attachment span.emoji{height:auto;width:auto}.bubble.emoji-big:not(.sticker) .message{margin-top:-1.125rem}.bubble.emoji-big:not(.sticker) .bubble-content{max-width:min(420px,100%)}.bubble.just-media .bubble-content{background:none!important;box-shadow:none}.bubble.just-media img{-o-object-fit:contain;object-fit:contain}.bubble.just-media.is-message-empty .message{background:var(--message-highlightning-color)}.bubble.emoji-big:not(.sticker) .bubble-content,.bubble.sticker .bubble-content{align-self:flex-start}.bubble.emoji-big:not(.sticker) .message,.bubble.sticker .message{margin-left:auto;position:relative!important;right:0!important}.bubble.sticker .attachment{border-radius:0;position:absolute;z-index:1}.bubble.round .attachment{height:var(--round-video-size)!important;max-height:var(--round-video-size)!important;max-width:var(--round-video-size)!important;width:var(--round-video-size)!important}.bubble.round .media-photo,.bubble.round .media-video{border-radius:50%;pointer-events:none}.bubble:not(.is-message-empty) .attachment{border-bottom-left-radius:0;border-bottom-right-radius:0}.bubble:not(.emoji-big) .attachment{font-size:0}.bubble .attachment{border-radius:inherit;cursor:pointer;display:flex;justify-content:center;max-width:100%;overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble .attachment img,.bubble .attachment video{max-width:100%}.bubble .attachment .download{align-items:center;cursor:pointer;display:flex;height:100%;justify-content:center;left:0;position:absolute;top:0;width:100%}.bubble .attachment .download span{background-color:var(--message-time-background);color:#fff;font-size:23px;text-align:center}.bubble .attachment .download~.video-play,.bubble .attachment .preloader-container~.video-play{display:none}.bubble .media-container-aspecter{margin:0 auto;position:relative;z-index:1}.bubble .media-container-fitted{background-color:transparent!important}.bubble .media-container-fitted>.thumbnail{opacity:.8}.bubble .media-container-fitted>.thumbnail.fade-in{animation:thumbnail-fade-in-opacity .2s ease-in-out forwards}.bubble .preloader-container{z-index:2}.bubble:not(.sticker) .attachment{max-height:min(340px,100%);max-width:min(420px,100%);width:-moz-max-content;width:max-content}.bubble img:not(.emoji),.bubble video{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}html.is-safari .bubble:not(.round) img:not(.emoji),html.is-safari .bubble:not(.round) video{border-radius:inherit}.bubble.is-album .attachment{max-height:none;max-width:min(451px,100%)}.bubble .album-item{background-color:var(--message-highlightning-color);cursor:pointer;max-width:100%;overflow:hidden;position:absolute}body.animation-level-0 .bubble .album-item{transition:none!important}.bubble .album-item img,.bubble .album-item video,.bubble .album-item-media{border-radius:inherit}body.animation-level-0 .bubble .album-item-media{transition:none!important}.bubble .album-item .bubble-select-checkbox{bottom:auto!important;left:auto;right:.5rem;top:.5rem}.bubble .album-item.is-selected{border-radius:0}.bubble .album-item.is-selected .album-item-media{transform:scale(1)}.bubble .album-item.is-selected.animating{transition:border-radius var(--transition-standard-out)}.bubble .album-item.is-selected.animating .album-item-media{transition:transform var(--transition-standard-out),border-radius var(--transition-standard-out)}.bubble .album-item.is-selected:not(.backwards){transition:border-radius var(--transition-standard-in)}.bubble .album-item.is-selected:not(.backwards) .album-item-media{transform:scale(.883333);transition:transform var(--transition-standard-in),border-radius var(--transition-standard-in)}.bubble .album-item.is-selected:not(.backwards),.bubble .album-item.is-selected:not(.backwards) .album-item-media{border-radius:0}html.no-touch .bubble a:active,html.no-touch .bubble a:hover{text-decoration:underline}.bubble-first{align-items:center;justify-content:center;margin-top:.5rem;max-width:100%;order:-1}body.animation-level-0 .bubble-first{flex:1 1 auto}.bubble-first .attachment{pointer-events:none}.bubble-first .bubble-content-wrapper{max-width:100%}.bubble-first.empty-bubble-placeholder{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}body.animation-level-2 .bubble-first.empty-bubble-placeholder .bubble-content-wrapper{transition:var(--bubble-transition-in)}.bubble-first.empty-bubble-placeholder.has-description .service-msg{align-items:flex-start!important;flex-direction:column;padding:.75rem 1rem .875rem!important}.bubble-first.empty-bubble-placeholder.has-description .center{align-self:center}.bubble-first.empty-bubble-placeholder.has-description .empty-bubble-placeholder-title{font-size:1rem!important;font-weight:var(--font-weight-bold)}.bubble-first.empty-bubble-placeholder.has-description .bubble-content{border-radius:1.5rem!important}.bubble-first.empty-bubble-placeholder .empty-bubble-placeholder-line{color:#fff}.bubble-first.empty-bubble-placeholder .empty-bubble-placeholder-line+.empty-bubble-placeholder-line{margin-top:.5rem}.bubble-first.empty-bubble-placeholder .tgico-check{font-size:1.25rem;margin-left:-.1875rem;margin-right:.25rem;vertical-align:bottom}.bubble-first.empty-bubble-placeholder .empty-bubble-placeholder-list-bullet{margin-right:.3125rem}.bubbles.has-groups .bubble-first.empty-bubble-placeholder{pointer-events:none}.bubbles.has-groups .bubble-first.empty-bubble-placeholder .bubble-content-wrapper{opacity:0;transform:scale3d(.8,.8,1) translateX(0)}.bubble-first.empty-bubble-placeholder.empty-bubble-placeholder-group .empty-bubble-placeholder-list-item{margin-top:.4375rem!important}.bubble-first.empty-bubble-placeholder.empty-bubble-placeholder-greeting .service-msg{max-width:232px}.bubble-first.empty-bubble-placeholder.empty-bubble-placeholder-greeting .empty-bubble-placeholder-subtitle{margin-top:.25rem!important}.bubble-first.empty-bubble-placeholder .empty-bubble-placeholder-sticker{cursor:pointer;height:200px;margin-top:.75rem!important;position:relative;width:200px}.bubble-first .time{display:none!important}.bubble-first:after,.bubble-first:before{display:none}.bubble .web{line-height:var(--line-height);margin:.125rem 0 0;max-width:100%;overflow:hidden}.bubble .web+.time{display:block}.bubble .web .preview{border-radius:4px;cursor:pointer;max-height:min(340px,100%);max-width:min(420px,100%);overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:-moz-max-content;width:max-content}.bubble .web .preview img,.bubble .web .preview video{max-width:100%}.bubble .web .preview-resizer:first-child{margin:3px 0}.bubble .web .preview-resizer:first-child:last-child{margin-bottom:2px}.bubble .web .preview.is-round .media-photo,.bubble .web .preview.is-round .media-video{border-radius:50%}.bubble .web.no-text{margin-bottom:.75rem}.bubble .web .title:not(:first-child){margin-top:1px}.bubble .web .text,.bubble .web .title,.bubble .web .webpage-name{font-size:var(--messages-secondary-text-size);line-height:var(--messages-secondary-line-height)}.bubble .web .webpage-name{text-decoration:none}html.no-touch .bubble .web .webpage-name:active,html.no-touch .bubble .web .webpage-name:hover{text-decoration:underline}.bubble .web .text{margin-top:1px;word-break:break-word}.bubble .web .quote{display:flex;max-width:100%;overflow:hidden;width:100%}.bubble .web .quote-text{margin-left:-.625rem;max-width:100%;padding-left:.625rem;width:100%}.bubble .web .quote:before{background-color:var(--primary-color);border-radius:.125rem;content:\" \";flex:0 0 auto;margin:.1875rem .5rem .125rem 0;width:.125rem}.bubble .reply{--font-size:var(--messages-secondary-text-size)}.bubble .document-name{font-size:var(--messages-text-size)}.bubble .document-size{font-size:var(--messages-secondary-text-size)}.bubble.is-square-photo .bubble-content{width:-moz-fit-content;width:fit-content}.bubble.is-square-photo .web .webpage-name{margin-right:1rem}.bubble.is-square-photo .web .preview-resizer{float:right;height:3rem;margin:.1875rem 0 0 .625rem;width:3rem}.bubble.is-square-photo .web .preview{margin:0;max-height:min(3rem,100%);max-width:min(3rem,100%)}.bubble .reply{border-radius:.25rem;cursor:pointer;margin:0 .375rem .375rem;min-width:10rem;padding:.25rem;width:auto}.bubble .reply-media{top:.125rem}.bubble .reply-content{height:auto;max-width:calc(100% - 1.25rem);min-height:32px;overflow:hidden;position:absolute;text-overflow:ellipsis;white-space:nowrap}.bubble .message+.reply{margin-bottom:0}.bubble:not(.just-media) .reply{border-radius:6px}html.no-touch .bubble:not(.just-media) .reply:active,html.no-touch .bubble:not(.just-media) .reply:hover{background-color:var(--light-filled-message-primary-color)}.bubble.just-media .floating-part{background-color:var(--message-highlightning-color);border-radius:12px;margin:0;max-width:15rem;padding:.375rem .625rem;position:absolute;top:0;white-space:nowrap}@media only screen and (max-width:600px){.bubble.just-media .floating-part{max-width:calc(100vw - 1rem - 10px - 100%)}}.bubble.just-media .name{color:#fff!important;line-height:var(--line-height);padding:.375rem .625rem}.bubble.just-media .name .peer-title{font-weight:400!important}.bubble.just-media .reply{height:54px;max-height:54px}@media only screen and (max-width:600px){.bubble.just-media .reply{padding:8px 6px 8px 8px}}.bubble.just-media .reply-content{margin-top:0;max-width:none!important;position:relative}.bubble.just-media .reply i,.bubble.just-media .reply-subtitle,.bubble.just-media .reply-title{color:#fff!important}.bubble.just-media .reply-border{background:#fff!important}.bubble.forwarded .attachment,.bubble.is-reply .attachment,.bubble:not(.hide-name) .attachment{border-top-left-radius:0;border-top-right-radius:0}.bubble .message,.bubble .service-msg{--custom-emoji-size:var(--messages-custom-emoji-size)}.bubble .message{color:var(--primary-text-color);font-size:var(--messages-text-size);line-height:var(--line-height);max-width:100%;padding:0 .5rem .375rem .625rem;position:relative;white-space:pre-wrap;word-break:break-word}.bubble .message .custom-emoji{display:inline-flex}.bubble .message:last-child{padding-top:6px}@media only screen and (max-width:600px){.bubble .audio,.bubble .document{--icon-size:2.25rem}}.bubble .audio .audio-title{font-weight:var(--font-weight-bold)}.bubble .audio .audio-ico{font-size:0}@media only screen and (max-width:600px){.bubble .audio{--icon-margin:.6875rem;height:2.375rem}.bubble .audio .audio-details{margin-bottom:0;margin-top:2px}.bubble .audio .audio-to-text-button{margin-top:-.875rem}.bubble .audio .audio-subtitle{margin-top:-1px}}.bubble .message.audio-message{width:335px}@media only screen and (max-width:600px){.bubble .message.audio-message{width:280px}}.bubble .message.audio-message,.bubble .message.voice-message{max-width:min(100%,364px)!important}@media only screen and (max-width:600px){.bubble .message.audio-message,.bubble .message.voice-message{max-width:min(100%,300px)!important}}.bubble.min-content .bubble-content{width:-moz-min-content;width:min-content}.bubble .message.voice-message .document-message{max-width:-moz-fit-content;max-width:fit-content}.bubble .message.audio-message,.bubble .message.voice-message{padding:8px!important}.bubble .message.call-message,.bubble .message.contact-message{min-width:200px;padding-left:8px}.bubble .message.contact-message .contact{cursor:pointer;display:flex;padding:2px 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble .message.contact-message .contact-avatar{color:#fff}.bubble .message.contact-message .contact-details{display:flex;flex-direction:column;margin-top:8px;padding-left:12px}.bubble .message.contact-message .contact-name{font-size:1rem;font-weight:var(--font-weight-bold)}.bubble .message.contact-message .contact-number{font-size:14px;line-height:1.4}.bubble .message.poll-message{max-width:400px}.bubble .message.document-message{max-width:325px!important}.bubble .message.document-message .document{--icon-margin:.75rem;height:58px}@media only screen and (max-width:600px){.bubble .message.document-message .document{--icon-margin:.5rem;height:44px}.bubble .message.document-message .document .document-size{font-size:.75rem}.bubble .message.document-message .document:not(.document-with-thumb) .document-ico{padding:1.125rem 0 0}}.bubble .message.document-message .document-name{line-height:1.4;margin-top:1px;overflow:hidden;text-overflow:ellipsis}.bubble-call{cursor:pointer;display:flex;flex-direction:column;justify-content:center;padding:.125rem 0 .125rem 2.5625rem;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble-call:before{font-size:1.5rem;left:.3125rem;position:absolute}.bubble-call-title{font-weight:var(--font-weight-bold)}.bubble-call-subtitle{align-items:center;color:var(--secondary-text-color);display:flex;font-size:var(--messages-secondary-text-size);line-height:var(--messages-secondary-line-height);margin-left:-.1875rem;margin-top:.0625rem}.bubble-call-subtitle.is-reason:before{margin-right:.0625rem}.bubble-call-subtitle:before{content:\"\";display:inline-block;font-size:1rem;transform:rotate(135deg)}.bubble-call-subtitle.arrow-red:before{color:var(--danger-color)}.bubble-call-subtitle.arrow-green:before{color:var(--message-out-primary-color)}.bubble .document-wrapper{display:flex;flex-direction:column-reverse}.bubble .document-wrapper .document-message{margin-top:.25rem}.bubble .document .time{align-self:flex-start;height:0}.bubble .document-message+.audio .time,.bubble .document-message+.document .time{display:none!important}.bubble.is-multiple-documents .message{border-radius:inherit;padding:0!important}.bubble.is-multiple-documents .document-container{border-radius:inherit;position:relative}.bubble.is-multiple-documents .document-container .document-selection{bottom:0;left:-75vw;position:absolute;top:0;width:200vw;z-index:-2}.bubble.is-multiple-documents .document-container.is-highlighted .document-wrapper:before,.bubble.is-multiple-documents .document-container.is-selected .document-wrapper:before{background-color:var(--message-background-color);border-radius:inherit;bottom:0;content:\" \";left:0;position:absolute;right:0;top:0;z-index:-1}.bubble.is-multiple-documents .document-container.is-highlighted .document-selection{background-color:var(--message-highlightning-color)}body:not(.animation-level-0) .bubble.is-multiple-documents .document-container.is-highlighted .document-selection{animation:bubbleSelected 2s linear}.bubble.is-multiple-documents .document-container.is-selected .document-selection{background-color:var(--message-highlightning-color)}body:not(.animation-level-0) .bubble.is-multiple-documents .document-container.is-selected .document-selection{animation:fade-in-opacity .2s linear forwards}body:not(.animation-level-0) .bubble.is-multiple-documents .document-container.is-selected.backwards .document-selection{animation:fade-in-backwards-opacity .2s linear forwards}.bubble.is-multiple-documents .document-container .bubble-select-checkbox{--margin-top:.25rem;--margin-left:.125rem;background:#fff;border-radius:50%;left:auto;margin-left:calc(var(--padding-left)*-1 + var(--icon-size) - var(--size) + var(--margin-left));margin-top:calc(var(--icon-size) - var(--size) + var(--margin-top));top:auto}@media only screen and (max-width:600px){.bubble.is-multiple-documents .document-container .bubble-select-checkbox{--size:1.125rem}}.bubble.is-multiple-documents .document-container .bubble-select-checkbox:before{--inner-size:.125rem;border:2px solid var(--secondary-color);border-radius:inherit;content:\" \";height:calc(var(--size) - var(--inner-size)*2);left:var(--inner-size);position:absolute;top:var(--inner-size);width:calc(var(--size) - var(--inner-size)*2)}.bubble.is-multiple-documents .document-container:first-of-type .document-selection{top:-.0625rem}.bubble.is-multiple-documents .document-container:first-of-type .document-wrapper{border-top-left-radius:inherit;border-top-right-radius:inherit;padding-top:.5rem}.bubble.is-multiple-documents .document-container:last-of-type .document-selection{bottom:-.0625rem}.bubble.is-multiple-documents .document-container:last-of-type .document-wrapper{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;padding-bottom:.5rem}.bubble.is-multiple-documents.is-group-first .document-container:first-of-type .document-selection{top:-.25rem}.bubble.is-multiple-documents.is-group-last .document-container:last-of-type .document-selection{bottom:-.25rem}.bubble.is-multiple-documents .document{height:54px!important}@media only screen and (max-width:600px){.bubble.is-multiple-documents .document{height:38px!important}}.bubble.is-multiple-documents .document-wrapper{padding:.25rem .5rem}.bubble.is-multiple-documents .document-wrapper>.name{margin-top:-.1875rem;padding:0 0 .25rem}.bubble .message .audio .time,.bubble .message.contact-message .time,.bubble .message.poll-message .time{bottom:0;position:absolute;right:0}html:not(.is-safari) .bubble .message.voice-message{overflow:hidden}.bubble.is-message-empty .bubble-content-wrapper{width:-moz-min-content;width:min-content}.bubble.is-message-empty .message{background-color:var(--message-time-background);border-radius:.75rem;bottom:.1875rem;padding:0 .3125rem;position:absolute;right:.1875rem;z-index:2}.bubble.is-message-empty .message .time{align-items:center;display:flex;height:calc(var(--messages-time-text-size) + .375rem);margin:0;padding:0;white-space:nowrap}.bubble.is-message-empty .message .time .inner{bottom:auto;color:#fff;margin:inherit;right:auto}.bubble.is-message-empty .message .time .inner:after{color:#fff!important}.bubble.is-message-empty.with-replies:not(.sticker):not(.with-beside-replies) .message{bottom:55px}.bubble.is-message-empty.emoji-big .message,.bubble.is-message-empty.sticker .message,.bubble.is-message-empty.with-replies.round .message{bottom:0}.bubble.is-message-empty:not(.emoji-big) .reactions-block{max-width:-moz-fit-content;max-width:fit-content}.bubble.is-message-empty .reaction-block{--chosen-background-color:var(--primary-color)}html.no-touch .bubble.is-message-empty .reaction-block:not(.is-chosen):active:after,html.no-touch .bubble.is-message-empty .reaction-block:not(.is-chosen):hover:after{background-color:#fff}.bubble.with-reply-markup .bubble-content{min-width:100%}.bubble.with-replies .attachment{border-bottom-left-radius:0;border-bottom-right-radius:0}.bubble.with-beside-replies .bubble-content{min-height:5.5rem}.bubble .colored-name .premium-icon{color:inherit;opacity:.6}.bubble .time{cursor:pointer;direction:ltr;display:inline-flex;float:right;font-size:var(--messages-time-text-size);height:var(--messages-time-text-size);line-height:1;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;visibility:hidden;z-index:1}.bubble .time i{font-size:1.125rem;margin-right:.375rem}.bubble .time-icon{pointer-events:none}.bubble .time-icon:not(:first-child){margin-left:2px}.bubble .time i.edited{font-size:inherit;overflow:visible}.bubble .time .inner{align-items:center;bottom:0;color:var(--message-time-color);display:flex;height:var(--messages-time-text-size);line-height:1;padding:inherit;pointer-events:all;position:absolute;right:0;visibility:visible;white-space:nowrap}.bubble .time .inner:after{color:var(--message-status-color)}.bubble .time .tgico-pinnedchat{margin-right:.125rem}.bubble .time.is-block{display:block;float:none}.bubble.webpage .time{float:none}.bubble .video-play,.bubble .video-time{pointer-events:none}.bubble .video-time{--height:calc(var(--messages-time-text-size) + 0.375rem);align-items:center;background-color:var(--message-time-background);border-radius:var(--height);color:#fff;display:flex;font-size:var(--messages-time-text-size);height:var(--height);left:3px;line-height:1;padding:0 6px;position:absolute;top:3px;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:2}.bubble .video-time.can-autoplay:after{color:#fff;content:\"\";font-size:calc(var(--messages-time-text-size) + 8px);padding:0 1px 0 3px}[dir=ltr] .bubble .video-time.is-error:after{margin-left:1px}[dir=rtl] .bubble .video-time.is-error:after{margin-right:1px}.bubble .video-time.is-error:after{content:\"\";font-size:calc(var(--messages-time-text-size) + 4px);padding:0}.bubble .extended-media-buy{align-items:center;-webkit-backdrop-filter:var(--menu-backdrop-filter);backdrop-filter:var(--menu-backdrop-filter);background-color:rgba(0,0,0,.3);border-radius:2rem;color:#fff;display:flex;font-size:var(--font-size-14);font-weight:var(--font-weight-bold);height:2.5rem;left:50%;padding:0 1rem;position:absolute;top:50%;transform:translate(-50%,-50%);white-space:nowrap;z-index:2}.bubble .extended-media-buy:before{font-size:1.125rem;margin-right:.25rem}.bubble pre{display:inline;margin:0}.bubble .anchor-url{text-decoration:underline}.bubble .video-play{align-items:center;background-color:var(--message-time-background);color:#fff;display:flex;font-size:2.125rem;justify-content:center;text-align:center;z-index:2}.bubble .ckin__player.circle{z-index:1}.bubble:not(.forwarded).hide-name .name{display:none}.bubble .name{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble .peer-title{cursor:pointer}.bubble .name{color:var(--primary-color);font-size:var(--messages-secondary-text-size);font-weight:var(--font-weight-bold)!important;line-height:calc(var(--messages-secondary-text-size) + .25rem);max-width:100%;overflow:hidden;padding:.375rem .625rem 0;text-overflow:ellipsis}.bubble .name .badge-fake{display:inline-block;margin-top:-2px;vertical-align:middle}.bubble:not(.webpage).photo:not(.is-reply) .bubble-content>.name,.bubble:not(.webpage).video:not(.is-reply) .bubble-content>.name{padding-bottom:6px}.bubble:not(.webpage).photo:not(.is-message-empty) .message,.bubble:not(.webpage).video:not(.is-message-empty) .message{padding-top:6px}.bubble:not(.webpage).photo .topic-name-button-container,.bubble:not(.webpage).video .topic-name-button-container{margin-bottom:0}.bubble:not(.webpage):not(.is-album):not(.sticker):not(.round):not(.emoji-big) .attachment{background-color:#000}.bubble.hide-name:not(.is-reply):not(.is-message-empty) .message{padding-top:6px}.bubble:not(.sticker):not(.emoji-big):not(.forwarded).hide-name .reply,.bubble:not(.sticker):not(.emoji-big):not(.forwarded):not(.is-group-first) .reply{margin-top:6px}.bubble .bubble-tail{display:none}.bubble.can-have-tail.is-group-last .bubble-tail{fill:var(--message-background-color);display:block;height:20px;position:absolute;transform:translateY(1px);width:11px;z-index:-2}.bubble.is-message-empty.is-group-last.with-media-tail .bubble-tail,.bubble.photo.is-message-empty.is-group-last:not(.with-replies) .bubble-tail,.bubble.video.is-message-empty.is-group-last:not(.with-replies) .bubble-tail{display:none}.bubble.is-message-empty.is-group-last.with-media-tail .attachment{overflow:visible}.bubble__media-container{border-radius:inherit;cursor:pointer}.bubble audio-element,.bubble poll-element{white-space:normal}.bubble .replies{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bubble .replies .c-ripple__circle{background-color:var(--light-primary-color)}.bubble .replies .rp{border-radius:inherit;cursor:pointer;height:100%;left:0;overflow:hidden;position:absolute;top:0;width:100%}.bubble .replies-beside{border-radius:2rem;bottom:47px;flex-direction:column;height:auto;max-height:52px;min-height:36px;padding:.375rem 0 .5rem;right:-44px;width:36px}.bubble .replies-beside-text{font-size:.75rem;margin-top:.125rem}.bubble .replies-footer{align-items:center;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;border-top:.0625rem solid var(--border-color);color:var(--primary-color);display:flex;height:3.0625rem;min-width:15rem;padding:0 .5rem;position:relative}html.no-touch .bubble .replies-footer:active,html.no-touch .bubble .replies-footer:hover{background-color:var(--light-primary-color)}html.no-touch .bubble .replies-footer:active~.bubble-tail,html.no-touch .bubble .replies-footer:hover~.bubble-tail{fill:var(--light-filled-message-primary-color)}.bubble .replies-footer .tgico-comments,.bubble .replies-footer .tgico-next{font-size:1.5rem}.bubble .replies-footer .tgico-comments{margin-left:.125rem;margin-right:.375rem}.bubble .replies-footer-text{align-items:center;color:var(--primary-color);display:flex;font-size:.9375rem;font-weight:var(--font-weight-bold);line-height:1.125rem;margin-left:.5rem}.bubble .replies-footer-avatars{--margin-right:-.875rem;--border-size:2px}.bubble .replies-footer .tgico-next{position:absolute;right:.1875rem}.bubble .replies-footer.is-unread .replies-footer-text:after{background-color:var(--primary-color);border-radius:50%;content:\" \";height:.5rem;margin-left:.75rem;width:.5rem}.bubble.is-thread-starter .user-avatar{display:none}.bubble.is-thread-starter.is-in .bubble-content-wrapper{margin-left:0}.bubble .message .reaction{--background-color:var(--light-filled-message-primary-color)}.bubble .message .reaction.is-chosen.backwards,.bubble .message .reaction:not(.is-chosen){--counter-color:var(--message-primary-color)}.bubble .message .reaction.is-chosen.backwards .stacked-avatars,.bubble .message .reaction:not(.is-chosen) .stacked-avatars{--border-color:var(--background-color)}.bubble .message .reactions-block .time{bottom:auto!important;order:100;position:static!important;right:auto!important}.bubble code{cursor:pointer}.bubble.is-invoice .attachment{background-color:inherit!important}.bubble.with-reply-markup .bubble-content{border-bottom-left-radius:6px!important;border-bottom-right-radius:6px!important}.bubble .name-with-reply .name{padding:0!important}.bubble .name-with-reply .name:not(:last-child) .hide-ol{display:none}.bubble .name-with-reply .name:not(:last-child) .peer-title{font-weight:var(--font-weight-bold)!important}.bubble .name-with-reply .reply{height:auto;margin:.25rem 0 0;max-height:none;padding:0}.bubble .topic-name-button{--color:var(--message-primary-color)}.bubble .name .topic-name-button-container{margin:.25rem -.125rem}.bubble .name .topic-name-button-container:first-child{margin-top:0}.bubble.is-message-empty:not(.is-reply) .name .topic-name-button-container{margin-bottom:0}.bubble:not(.is-group-first) .topic-name-button-container{display:none!important}.bubble .topic-name-button-container.floating-part{font-size:var(--messages-secondary-text-size);padding-bottom:0;padding-top:0}.bubble .topic-name-button-container.floating-part .topic-name-button{--color:#fff;padding:0}.bubble .topic-name-button-container.floating-part .topic-name-button:before{content:none}.bubble .topic-name-button-container.floating-part+.floating-part{margin-top:1.75rem}.bubble .web .audio-transcribed-text{margin-bottom:0;order:4}.bubble .audio-transcribed-text{margin-bottom:.75rem;margin-top:.25rem}.bubble .audio-transcribed-text.is-error{color:var(--message-primary-color)}.bubble .audio-transcribed-text .audio-transcribing-dots{position:relative}.bubble .audio-transcribed-text .audio-transcribing-dots:after,.bubble .audio-transcribed-text .audio-transcribing-dots:before{content:\"...\"}.bubble .audio-transcribed-text .audio-transcribing-dots:before{opacity:0}.bubble .audio-transcribed-text .audio-transcribing-dots:after{animation:audio-dots 1.5s linear infinite;left:0;position:absolute;right:0}@keyframes audio-dots{0%{content:\"\"}33%{content:\".\"}66%{content:\"..\"}to{content:\"...\"}}.bubbles-date-group:last-of-type .bubbles-group:last-of-type .bubble:last-of-type{margin-bottom:.0625rem}.bubbles-date-group:last-of-type .bubbles-group:last-of-type .bubble:last-of-type .document-container:last-of-type .document-selection,.bubbles-date-group:last-of-type .bubbles-group:last-of-type .bubble:last-of-type:after{bottom:-.0625rem}.can-zoom-fade{opacity:1;transform:scale(1) translateX(0);transform-origin:center}body.animation-level-2 .can-zoom-fade{transition:var(--bubble-transition-out)}.bubbles-inner.zoom-fading .can-zoom-fade{transition:var(--bubble-transition-in)}.can-zoom-fade.zoom-fade{opacity:0;transform:scale3d(.8,.8,1) translateX(0)}.bubble-content-wrapper{display:flex;flex-direction:column}@media only screen and (min-width:601px){.bubble:not(.service) .bubble-content-wrapper{max-width:85%}}@media only screen and (max-width:600px){.bubble-content-wrapper{max-width:calc(100% - var(--message-handhelds-margin))}}.bubble.service{align-self:center;justify-content:center}.bubble.service b{color:inherit}.bubble.service .bubble-content{background-color:transparent;border-radius:.875rem}.bubble.service .bubble-content-wrapper{max-width:100%;padding:0 2rem}.bubble.service .service-msg{align-items:center;background-color:var(--message-highlightning-color);border-radius:inherit;color:#fff;display:flex;font-size:var(--messages-service-text-size);justify-content:center;line-height:calc(var(--messages-service-text-size) + 5px);padding:.28125rem .625rem;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;word-break:break-word}.bubble.service .service-msg i{font-style:normal}.bubble.service .service-msg a{color:#fff}.bubble.service .service-msg .peer-title,.bubble.service .service-msg [data-saved-from],.bubble.service .service-msg a{cursor:pointer;font-weight:var(--font-weight-bold)}.bubble.service .service-msg .peer-title:hover,.bubble.service .service-msg [data-saved-from]:hover,.bubble.service .service-msg a:hover{text-decoration:underline}.bubble.service .service-msg img.emoji{margin-bottom:3px}.bubble.is-in .bubble-content,.bubble.is-in .bubble-content .poll-footer-button{border-radius:6px 12px 12px 6px}.bubble.is-in.is-group-first .bubble-content,.bubble.is-in.is-group-first .poll-footer-button{border-top-left-radius:12px}.bubble.is-in.is-group-last.can-have-tail .bubble-content,.bubble.is-in.is-group-last.can-have-tail .poll-footer-button{border-bottom-left-radius:0!important}.bubble.is-in.is-group-last.can-have-tail .bubble-tail{margin-left:-8.4px}.bubble.is-in.is-group-last:not(.can-have-tail) .bubble-content,.bubble.is-in.is-group-last:not(.can-have-tail) .poll-footer-button{border-bottom-left-radius:12px}.bubble.is-in.just-media .floating-part{left:calc(100% + 10px)}@media only screen and (max-width:600px){.bubble.is-in.just-media .floating-part{left:calc(100% + 1px)}}.bubble.is-in .quote .webpage-name,.bubble.is-in .reply-title{color:var(--primary-color)}.bubble.is-in .time{margin-left:-3px;padding-right:8px}.bubble.is-in .time .inner{margin-bottom:4px}.bubble.is-in.is-message-empty.is-group-last.with-media-tail .attachment{border-bottom-left-radius:0}.bubble.is-in.is-message-empty.is-group-last.with-media-tail .bubble__media-container{margin-left:-9px}.bubble.is-in .audio-subtitle,.bubble.is-in .audio-time,.bubble.is-in .contact-number{color:var(--secondary-text-color)!important}.bubble.is-in code,.bubble.is-in pre{color:var(--monospace-text-color)}.bubble.is-in:not(.just-media) .reply.is-overriding-color .reply-border{background-color:rgb(var(--override-color))}.bubble.is-in:not(.just-media) .reply.is-overriding-color .reply-title{color:rgb(var(--override-color))}html.no-touch .bubble.is-in:not(.just-media) .reply.is-overriding-color:active,html.no-touch .bubble.is-in:not(.just-media) .reply.is-overriding-color:hover{background-color:rgba(var(--override-color),.08)}.bubble.is-out{--message-background-color:var(--message-out-background-color);--light-message-background-color:var(--light-message-out-background-color);--dark-message-background-color:var(--dark-message-out-background-color);--link-color:var(--message-out-link-color);--message-primary-color:var(--message-out-primary-color);--light-filled-message-primary-color:var(--light-filled-message-out-primary-color);--selection-background-color:var(--message-out-selection-background-color);--message-time-color:var(--message-out-time-color);--message-status-color:var(--message-out-status-color);--link-color:var(--message-primary-color);flex-direction:row-reverse}.bubble.is-out .bubble-content{margin-left:auto}.bubble.is-out .bubble-content,.bubble.is-out .bubble-content .poll-footer-button{border-radius:12px 6px 6px 12px}.bubble.is-out .bubble-content .name{color:var(--message-out-primary-color)}@media only screen and (min-width:1276px){.bubble.is-out .bubble-content-wrapper{transform:scale(1) translateX(calc((var(--chat-input-size) + .5rem)*-1))}.bubble.is-out .bubble-content-wrapper.zoom-fade{transform:scale3d(.8,.8,1) translateX(calc((var(--chat-input-size) + .5rem)*-1))}body.animation-level-2 .bubble.is-out .bubble-content-wrapper{transition:var(--bubble-transition-out)}body.is-right-column-shown .bubble.is-out .bubble-content-wrapper{transform:scale(1) translateX(0)}body.animation-level-2 body.is-right-column-shown .bubble.is-out .bubble-content-wrapper{transition:var(--bubble-transition-in)}body.is-right-column-shown .bubble.is-out .bubble-content-wrapper.zoom-fade{transform:scale3d(.8,.8,1) translateX(0)}}.bubble.is-out.is-group-first .bubble-content,.bubble.is-out.is-group-first .poll-footer-button{border-top-right-radius:12px}.bubble.is-out.is-group-last.can-have-tail .bubble-content,.bubble.is-out.is-group-last.can-have-tail .poll-footer-button{border-bottom-right-radius:0!important}.bubble.is-out.is-group-last.can-have-tail .bubble-tail{right:-8.4px;transform:translateY(1px) scaleX(-1)}.bubble.is-out.is-group-last:not(.can-have-tail) .bubble-content,.bubble.is-out.is-group-last:not(.can-have-tail) .poll-footer-button{border-bottom-right-radius:12px}.bubble.is-out.just-media .floating-part{right:calc(100% + 10px)}.bubble.is-out.just-media .message{right:0}.bubble.is-out:not(.just-media) .reply-border{background-color:var(--message-out-primary-color)!important}.bubble.is-out:not(.just-media) .reply i,.bubble.is-out:not(.just-media) .reply-title{color:var(--message-out-primary-color)!important}.bubble.is-out .quote:before{background-color:var(--message-out-primary-color)}.bubble.is-out .quote .webpage-name{color:var(--message-out-primary-color)}.bubble.is-out .time{margin-left:-4px;padding-right:5px}.bubble.is-out .time .inner{bottom:4px}.bubble.is-out .time .inner:after,.bubble.is-out .time:after{font-size:calc(var(--messages-text-size) + 3px);line-height:var(--messages-time-text-size);margin-left:1px}.bubble.is-out.forwarded .name{color:var(--message-out-primary-color)}.bubble.is-out.is-read .time .inner:after,.bubble.is-out.is-read .time:after{content:\"\"}.bubble.is-out.is-sent .time .inner:after,.bubble.is-out.is-sent .time:after{content:\"\"}.bubble.is-out.is-sending .time .inner:after,.bubble.is-out.is-sending .time:after{content:\"\"}.bubble.is-out.is-error .time .inner:after,.bubble.is-out.is-error .time:after{color:var(--message-error-color);content:\"\"}.bubble.is-out .document-ico:after{border-right-color:var(--message-background-color);border-top-color:var(--message-background-color)}.bubble.is-out .audio-waveform-bar{fill:var(--message-out-primary-color)}.bubble.is-out .audio-waveform-bar.active{fill:var(--message-out-primary-color)!important}.bubble.is-out .audio-subtitle,.bubble.is-out .audio-time{color:var(--message-out-status-color)}.bubble.is-out .audio-download,.bubble.is-out .audio-toggle,.bubble.is-out .audio.corner-download .preloader-container{background-color:var(--message-out-primary-color)}.bubble.is-out .audio-download:empty{display:none}.bubble.is-out .audio.is-unread .audio-waveform-bar{fill:var(--message-out-primary-color)}.bubble.is-out .audio.is-unread .audio-time:after{background-color:var(--message-out-primary-color)}.bubble.is-out .audio-toggle .part{background-color:var(--message-out-audio-play-button-color)}.bubble.is-out.is-message-empty.is-group-last.with-media-tail .attachment{border-bottom-right-radius:0}.bubble.is-out.is-message-empty.is-group-last.with-media-tail .bubble__media-container{margin-right:-9px}.bubble.is-out.is-message-empty .reactions-block{justify-content:flex-end}.bubble.is-out.is-message-empty .reaction-block{margin-right:.25rem}.bubble.is-out.is-message-empty .reaction-block:last-child{margin-right:0}.bubble.is-out.is-message-empty .reaction-block.is-chosen{--chosen-background-color:var(--surface-color)}.bubble.is-out.is-message-empty:not(.emoji-big) .reactions-block{margin-left:auto}.bubble.is-out .bubble-call-subtitle,.bubble.is-out .contact-number,.bubble.is-out .document-size{color:var(--message-out-status-color)}.bubble.is-out .bubble-call-subtitle:before{transform:rotate(-45deg)}.bubble.is-out poll-element .poll-desc,.bubble.is-out poll-element .poll-votes-count{color:var(--message-out-primary-color)}.bubble.is-out poll-element .poll-line use{stroke:var(--message-out-primary-color)}.bubble.is-out poll-element .poll-answer-selected{background-color:var(--message-out-primary-color);color:var(--light-filled-message-out-primary-color)}html.no-touch .bubble.is-out poll-element .poll-answer:hover .animation-ring{background-color:var(--message-out-primary-color);opacity:.08}.bubble.is-out poll-element .poll-footer-button,.bubble.is-out poll-element .poll-hint{color:var(--message-out-primary-color)}.bubble.is-out poll-element .poll-avatars .stacked-avatars{--border-color:var(--message-background-color)}.bubble.is-out poll-element .progress-ring__circle{stroke:var(--message-out-primary-color)}.bubble.is-out poll-element .c-ripple__circle{background-color:var(--message-out-primary-color)}.bubble.is-out poll-element .c-ripple__circle:not(.hiding){opacity:.08}.bubble.is-out.is-sending poll-element{pointer-events:none}.bubble.is-out .audio .progress-line{--color:var(--message-out-primary-color)}.bubble.is-out .audio .progress-line:before,.bubble.is-out .audio .progress-line__loaded{background-color:var(--message-out-primary-color)}.bubble.is-out .audio .preloader-container{--color:var(--message-background-color)}.bubble.is-out .bubble-beside-button{left:var(--message-beside-button-margin);right:auto}.bubble.is-out .bubble-beside-button.goto-original{transform:rotate(180deg)}.bubble.is-out.is-multiple-documents .document-container .bubble-select-checkbox{background-color:var(--message-background-color)}.bubble.is-out.is-multiple-documents .document-container .bubble-select-checkbox:before{border-color:var(--dark-message-background-color)}.bubble.is-out.is-multiple-documents .document-container .bubble-select-checkbox .checkbox-box-border{border-color:var(--message-background-color)}.bubble.is-out .bubble-hover-reaction{left:var(--offset);right:auto}.reply-markup{margin-top:.0625rem;width:100%}.bubble:not(.is-group-last) .reply-markup{margin-bottom:.125rem}.reply-markup-row{display:flex;margin-top:.125rem;min-height:2.5rem;overflow:hidden}.reply-markup-row:last-child .reply-markup-button:first-child{border-bottom-left-radius:12px}.reply-markup-row:last-child .reply-markup-button:last-child{border-bottom-right-radius:12px}.reply-markup-button{background:var(--message-highlightning-color);border:none;border-radius:.375rem;color:#fff!important;cursor:pointer;font-size:var(--font-size-14);font-weight:var(--font-weight-bold);outline:none;overflow:hidden;padding:.5625rem 0;position:relative;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:2}.reply-markup-button-text{pointer-events:none;position:relative}.reply-markup-button.anchor-url{text-decoration:none!important}.reply-markup-button+.reply-markup-button{margin-left:.125rem}.reply-markup-button .forward-icon,.reply-markup-button.tgico:before{display:block;position:absolute;right:.125rem;top:.125rem}.reply-markup-button.is-link:before{content:\"\";transform:rotate(-45deg)}.reply-markup-button.is-buy:before{content:\"\"}.reply-markup-button.is-switch-inline:before{content:\"\"}.bubble-beside-button:after,.bubble.just-media .reply:after,.reply-markup-button:after{background-color:#fff;border-radius:inherit;bottom:0;content:\" \";display:block;left:0;opacity:0;position:absolute;right:0;top:0;z-index:-1}html.no-touch .bubble-beside-button:active:after,html.no-touch .bubble-beside-button:hover:after,html.no-touch .bubble.just-media .reply:active:after,html.no-touch .bubble.just-media .reply:hover:after,html.no-touch .reply-markup-button:active:after,html.no-touch .reply-markup-button:hover:after{opacity:var(--hover-alpha)}.bubble-primary-color{color:var(--message-primary-color);font-weight:var(--font-weight-bold)}.pinned-message{--custom-emoji-size:calc(var(--font-size) + 2px)!important}.pinned-message-border{flex:0 0 auto;height:2rem;position:relative;width:.125rem}.pinned-message-border-wrapper-1{background:var(--primary-color);border-radius:1px;height:2rem;position:relative;top:50%;transform:translateY(-50%);width:.125rem}.pinned-message-border-mask{--mask-height:.375rem;--height:2.5rem;height:var(--height);overflow:hidden}.pinned-message-border-mask:after,.pinned-message-border-mask:before{content:\" \";display:block;height:var(--mask-height);left:0;opacity:0;position:absolute;right:0;z-index:1}body.animation-level-2 .pinned-message-border-mask:after,body.animation-level-2 .pinned-message-border-mask:before{transition:opacity .2s ease-in-out}.pinned-message-border-mask:before{background:linear-gradient(var(--surface-color),transparent);top:0}.pinned-message-border-mask:after{background:linear-gradient(transparent,var(--surface-color));bottom:0}.pinned-message-border-mask.mask-bottom:after,.pinned-message-border-mask.mask-top:before{opacity:1}.pinned-message-border-wrapper{color:var(--primary-color);position:relative}.pinned-message-border-wrapper:before{background:var(--primary-color);bottom:0;content:\" \";display:block;left:0;opacity:.4;position:absolute;right:0;top:0}.pinned-message-border-bars{stroke:currentColor;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.pinned-message-border-mark{background:currentColor;border-radius:1px;left:0;position:absolute;top:0;width:2px}body:not(.animation-level-0) .pinned-message-border-mark,body:not(.animation-level-0) .pinned-message-border-wrapper{transition:transform .25s ease-in-out;will-change:transform}.pinned-message-content{--height:32px;height:var(--height)}.pinned-message-media{border-radius:.1875rem}.pinned-message,.reply{--font-size:var(--font-size-14);--custom-emoji-size:calc(var(--font-size) + 4px);--line-height:calc(var(--font-size) + 4px);align-items:center;cursor:pointer;display:flex;overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.pinned-message-content,.reply-content{display:flex;flex-direction:column;flex-grow:1;flex-shrink:1;justify-content:center;margin-left:.5rem;overflow:hidden;pointer-events:none;position:relative}.pinned-message-title,.reply-title{color:var(--primary-color)}.pinned-message-subtitle,.pinned-message-title,.reply-subtitle,.reply-title{font-size:var(--font-size);line-height:var(--line-height);overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap}.pinned-message-media,.reply-media{height:2rem!important;left:0;overflow:hidden;position:absolute;top:.125rem;width:2rem!important}.pinned-message-media.is-round,.reply-media.is-round{border-radius:50%}.pinned-message-media>img,.pinned-message-media>video,.reply-media>img,.reply-media>video{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.pinned-message i,.reply i{color:var(--secondary-text-color);font-style:normal}.pinned-message img.emoji,.reply img.emoji{height:1rem;vertical-align:top;width:1rem}.reply.is-media .reply-content{padding-left:2.5rem}.reply-border{background:var(--primary-color);border-radius:1px;height:calc(var(--font-size)*2 + .25rem);min-width:2px}.reply-content{margin-left:.625rem}.reply-media{border-radius:.25rem}.reply-cancel{margin-bottom:0!important}.reply-title{margin:-1px 0 1px}.reply .peer-title{font-weight:var(--font-weight-bold)}.pinned-container{--container-height:3.25rem;align-items:center;cursor:pointer;display:flex;flex:0 0 auto;justify-content:space-between;overflow:visible}.pinned-container.is-floating{background-color:var(--surface-color)!important;height:var(--container-height);left:0;margin:0;max-height:var(--container-height);position:absolute!important;right:0;top:var(--topbar-height);width:auto}.pinned-container.is-floating .pinned-container-wrapper{border-radius:0;height:100%;max-width:100%;order:0;padding:0 1rem;z-index:0}@media only screen and (max-width:600px){.pinned-container.is-floating .pinned-container-wrapper{padding:0 .5rem}}.pinned-container.is-floating .pinned-container-content{margin-right:.5rem}@media only screen and (min-width:1276px){body.is-right-column-shown .pinned-container.is-floating .pinned-container-content{padding-right:var(--right-column-width)}}.pinned-container.is-floating:before{border-bottom:1px solid var(--border-color);border-top:1px solid var(--border-color);bottom:0;content:\" \";left:0;position:absolute;right:0;top:0}.pinned-container-content{flex:1 1 auto;overflow:hidden;pointer-events:none;position:relative}.pinned-container .btn-icon{display:flex;flex:0 0 auto;font-size:1.5rem;justify-content:center}.pinned-container-wrapper{align-items:center;border-radius:.25rem;display:flex;flex:1 1 auto;order:1;overflow:hidden;padding:.25rem}.pinned-container-wrapper-utils{align-items:center;display:flex;flex:0 0 auto;position:relative}.pinned-message{display:flex;width:auto}.pinned-message-content{overflow:visible!important}.pinned-message-media-container{height:2rem;margin-left:-.25rem;position:absolute;width:2rem}body.animation-level-2 .pinned-message-media-container{transition:transform var(--pm-transition)}.pinned-message-subtitle,.pinned-message-title{transform:translateX(0)}.pinned-message.is-media .pinned-message-subtitle,.pinned-message.is-media .pinned-message-title{transform:translateX(2.25rem)}.pinned-message:not(.is-media) .pinned-message-media-container{transform:scale(0)}.pinned-message .pinned-container-wrapper{min-width:16rem}.pinned-message:not(.is-floating){margin-right:1rem}.pinned-message:not(.is-floating) .pinned-container-wrapper-utils{display:none}.pinned-message:not(.is-floating)>.pinned-message-close{display:flex;margin-right:.75rem;order:0}.pinned-message.is-media .pinned-message-subtitle,.pinned-message.is-media .pinned-message-title{width:calc(100% - 2.25rem)}.pinned-message.is-floating{--container-height:var(--pinned-message-height)}.pinned-message.is-floating>.btn-icon{display:none}.pinned-message.is-floating .pinned-container-wrapper{padding-left:1rem}.pinned-message.is-floating .pinned-container-content{margin-right:0}.pinned-message-content .pinned-message-subtitle,.pinned-message-content .pinned-message-title{height:calc(var(--height)/2);min-height:calc(var(--height)/2);overflow:visible;position:relative}body.animation-level-2 .pinned-message-content .pinned-message-subtitle,body.animation-level-2 .pinned-message-content .pinned-message-title{transition:transform var(--pm-transition)}.pinned-message-title{margin-bottom:.25rem}.pinned-message-subtitle .animated-super-row{font-size:var(--font-size-14);line-height:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pinned-message .animated-counter{transition:transform var(--pm-transition),opacity var(--pm-transition)}body.animation-level-0 .pinned-message .animated-counter{transition:none}.pinned-message .animated-counter:before{content:\"#\"}.pinned-message .animated-counter.is-last:not(.backwards){opacity:0;transform:scale(.68)}.pinned-message .animated-super-row{--translateY:16px}.pinned-message .pinned-message-media{--translateY:32px}.pinned-message.hide~.tgico-pinlist,.pinned-message.is-many .pinned-message-close,.pinned-message.is-many.is-floating .pinned-message-close,.pinned-message.is-many:not(.is-floating) .pinned-message-pinlist,.pinned-message:not(.is-many) .pinned-message-pinlist,.pinned-message:not(.is-many)~.tgico-pinlist{display:none}.pinned-message-pinlist{order:2}.chat[data-type=discussion] .pinned-message .pinned-container-close{display:none!important}.pinned-audio{--progress-height:.25rem}.pinned-audio.is-floating{--container-height:var(--pinned-audio-height)}.pinned-audio:not(.is-floating){max-width:210px;padding-right:1.75rem;position:relative}.pinned-audio .pinned-container-wrapper{overflow:visible!important}.pinned-audio .pinned-container-wrapper>.btn-icon{margin-left:0!important}.pinned-audio-ico:before{content:\"\"}.pinned-audio-ico.flip-icon:before{content:\"\"}.pinned-audio-title{font-weight:var(--font-weight-bold)}.pinned-audio-subtitle{color:var(--secondary-text-color)}.pinned-audio-subtitle,.pinned-audio-title{font-size:var(--font-size-14);line-height:var(--line-height-14);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.pinned-audio-content{margin-left:.75rem}.pinned-audio-progress{--border-radius:0;--height:var(--progress-height);--translateY:.125rem;bottom:0;left:0;position:absolute;right:0;transform:scaleX(var(--topbar-floating-scaleX)) translateY(var(--translateY));transform-origin:left center}@media only screen and (min-width:1276px){.pinned-audio-progress{transition:transform var(--transition-standard-out)}body.is-right-column-shown .pinned-audio-progress{transition:transform var(--transition-standard-in)}body.animation-level-0 .pinned-audio-progress{transition:none}}body.animation-level-2 .pinned-audio-progress:before{transition:opacity .2s ease-in-out}.pinned-audio-progress:not(:hover):before{opacity:0}html.no-touch .pinned-audio-progress:active,html.no-touch .pinned-audio-progress:hover{--translateY:0}.pinned-audio-progress .progress-line__filled:after{display:none!important}.pinned-audio-progress .progress-line__seek{top:-1rem}.pinned-audio-progress-wrapper{bottom:0;height:.5rem;left:0;overflow:hidden;position:absolute;right:0}.pinned-audio-volume{align-items:center;height:2.5rem;position:relative;width:2.5rem}html.is-touch .pinned-audio-volume{display:none}.pinned-audio-volume-tunnel{bottom:-1rem;content:\" \";left:0;position:absolute;right:0;top:100%}.pinned-audio-volume .player-volume__icon{cursor:pointer;display:flex}.pinned-audio-volume .progress-line-container{background-color:var(--surface-color);border-radius:10px;box-shadow:0 1px 5px 0 rgba(0,0,0,.15);margin-top:2.25rem;opacity:0;padding:.75rem 1rem;position:absolute;top:100%;transform:rotate(270deg);transition:opacity .2s ease-in-out,visibility 0s .2s;visibility:hidden;width:5rem}body.animation-level-0 .pinned-audio-volume .progress-line-container{transition:none!important}.pinned-audio-volume:active .progress-line-container,.pinned-audio-volume:hover .progress-line-container{opacity:1;transition:opacity .2s ease-in-out,visibility 0s 0s;visibility:visible}.markup-tooltip{background:var(--surface-color);border-radius:10px;bottom:0;display:flex;height:44px;justify-content:flex-start;left:0;opacity:0;overflow:hidden;position:fixed;right:0;top:0;transform:translateZ(0);transition:opacity var(--layer-transition),transform var(--layer-transition),width var(--layer-transition);width:252px;z-index:1}body.animation-level-0 .markup-tooltip{transition:none}.markup-tooltip-wrapper{align-items:center;display:flex;height:100%;justify-content:flex-start;left:0;max-width:100%;position:absolute;top:0;transform:translateX(0);transition:transform var(--layer-transition);width:672px}body.animation-level-0 .markup-tooltip-wrapper{transition:none}.markup-tooltip-tools{align-items:center;display:flex;flex:0 0 auto;justify-content:space-between;max-width:100%;padding:7px}.markup-tooltip-tools:first-child{width:252px}.markup-tooltip-tools:last-child{width:420px}.markup-tooltip-tools:last-child .markup-tooltip-delimiter{margin:0 .25rem}.markup-tooltip-delimiter{background-color:var(--border-color);height:25px;width:1px}.markup-tooltip .btn-icon{border-radius:8px!important;height:30px;padding:0;width:30px}.markup-tooltip .btn-icon.active{background-color:var(--primary-color)!important;color:#fff!important}.markup-tooltip:not(.is-visible){pointer-events:none}.markup-tooltip.is-visible{opacity:1}.markup-tooltip.is-link{width:420px}.markup-tooltip.is-link .markup-tooltip-wrapper{transform:translateX(-252px)}.markup-tooltip-link-apply{color:var(--primary-color);font-size:2rem}.markup-tooltip-link-apply-container{align-items:center;display:flex;opacity:0;pointer-events:none;transition:opacity var(--layer-transition)}body.animation-level-0 .markup-tooltip-link-apply-container{transition:none}.markup-tooltip .input-clear{flex:1 1 auto;margin:0 .5rem;text-overflow:ellipsis}.markup-tooltip .input-clear.is-valid+.markup-tooltip-link-apply-container{opacity:1;pointer-events:all}.stickers-helper>.scrollable{max-height:13.75rem;min-height:var(--esg-sticker-size);padding:.4375rem;position:relative}.stickers-helper-stickers{border-radius:var(--border-radius);max-width:100%}html.no-touch .stickers-helper .super-sticker:not(.active):active,html.no-touch .stickers-helper .super-sticker:not(.active):hover{background:none}.emoji-helper{height:50px;padding:.25rem 0!important}.emoji-helper>.scrollable{position:relative;width:auto}.emoji-helper .super-emojis{display:block;white-space:nowrap}.emoji-helper .super-emojis:after,.emoji-helper .super-emojis:before{content:\" \";display:inline-block;width:.25rem}html.no-touch .emoji-helper .super-emoji:not(.active):active,html.no-touch .emoji-helper .super-emoji:not(.active):hover{background:none}.emoji-helper .super-emoji.active{background-color:var(--primary-color)!important}.inline-helper{-webkit-user-select:none;-moz-user-select:none;user-select:none}.inline-helper:not(.is-gallery){min-width:min(20rem,100%)}.inline-helper .scrollable{max-height:232px;position:relative}.inline-helper-separator{background-color:var(--border-color);height:1px;margin-left:4rem;width:100%}.inline-helper-separator:last-child{display:none}.inline-helper .btn-primary{border-radius:0;border-radius:initial}.inline-helper-results:not(.is-gallery){cursor:pointer}.inline-helper-results:not(.is-gallery) .inline-helper-result{height:4rem;line-height:var(--line-height);padding:.5rem .5rem .5rem 4rem}.inline-helper-results:not(.is-gallery) .inline-helper-result-preview{height:3rem!important;left:.5rem;overflow:hidden;position:absolute;width:3rem!important}.inline-helper-results:not(.is-gallery) .inline-helper-result-preview.empty{align-items:center;background-color:var(--primary-color);border-radius:.375rem;color:#fff;display:flex;font-size:1.75rem;justify-content:center;text-transform:uppercase}.inline-helper .media-container{border-radius:inherit}.inline-helper .media-photo,.inline-helper .media-poster,.inline-helper .media-video{border-radius:inherit;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.inline-helper .gif{bottom:0;height:auto!important;left:0;position:absolute;right:0;top:0;width:auto!important}.inline-helper-results.is-gallery{grid-gap:1px;border-radius:var(--border-radius);grid-template-columns:repeat(auto-fill,minmax(var(--esg-sticker-size),1fr));max-width:100%}.inline-helper-results.is-gallery .inline-helper-result{height:auto!important;width:auto!important}.inline-helper-result{position:relative}.inline-helper-result-title{font-weight:var(--font-weight-bold);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inline-helper-result-description{-webkit-line-clamp:2;-webkit-box-orient:vertical;color:var(--secondary-text-color);display:-webkit-box;font-size:.875rem;overflow:hidden;text-overflow:ellipsis;white-space:pre-wrap}.inline-helper-cant-send{color:var(--secondary-text-color);display:none;margin:0 auto}.inline-helper.cant-send{height:3rem;width:100%!important}.inline-helper.cant-send .scrollable-y{display:none}.inline-helper.cant-send .inline-helper-cant-send{display:block}.chat-search{left:0;position:absolute!important;right:0;top:0;z-index:2}.chat-search-footer{align-items:center;background-color:var(--surface-color);box-shadow:0 -1px 5px -1px rgba(0,0,0,.21);display:flex;flex:0 0 auto;height:46px;justify-content:space-between;overflow:hidden;padding:0 8px;width:100%}.chat-search-footer .chat-search-count{color:var(--secondary-text-color);margin-left:8px}.chat-search-count:empty,.chat-search-count:not(:empty)+.btn-icon,.chat-search-footer+.chat-input{display:none}.chat-search-controls{display:flex}.chat-search-results{background-color:var(--surface-color);height:100%;left:0;max-height:100%;opacity:0;overflow:hidden;position:absolute;top:0;transition:.2s ease;visibility:hidden;width:100%}body.animation-level-0 .chat-search-results{transition:none}.chat-search-results.active{opacity:1;visibility:visible}.chat-search .tgico-up{margin-right:2px}.drops-container{--padding:0px;align-items:center;bottom:var(--padding);display:flex;flex-direction:column;justify-content:center;left:var(--padding);position:absolute!important;right:var(--padding);top:var(--padding);-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important;z-index:3}.drops-container:not(.is-visible){display:none}.drops-container.is-visible{animation:fade-in-opacity .2s linear forwards}.drops-container.is-visible.backwards{animation:fade-in-backwards-opacity .2s linear forwards}.drop{--wrapper-padding:-4px;align-items:center;background-color:var(--surface-color);border-radius:12px;color:#a2acb4;display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;max-width:100%;pointer-events:all;position:relative;transition:color .2s ease-in-out;width:100%}.drop-outline-wrapper{bottom:var(--wrapper-padding);left:var(--wrapper-padding);pointer-events:none;position:absolute;right:var(--wrapper-padding);top:var(--wrapper-padding)}.drop-outline-path{fill:none;stroke-dasharray:13.5,11;stroke:#a2acb4;stroke-width:2;stroke-linecap:round;stroke-dashoffset:0;transition:stroke .2s ease-in-out}.drop.is-dragover .drop-outline-path{stroke:var(--primary-color);animation:drop-outline-move .5s linear infinite}.drop-icon{font-size:6rem}.drop-header{font-size:1.25rem;font-weight:var(--font-weight-bold)}.drop-header:not(:last-child){margin-top:-10px}@media only screen and (max-height:670px){.drop-icon{font-size:0}.drop-header{margin-top:0}}.drop.is-dragover{color:var(--primary-color)}.drop+.drop{margin-top:10px}@keyframes drop-outline-move{0%{stroke-dashoffset:0}to{stroke-dashoffset:-24.5}}body.is-dragging .page-chats{pointer-events:none}.bot-commands{--border-radius-padding:24px;--offset:.5rem;animation:none!important;background-color:transparent!important;border-radius:12px 12px 0 0!important;bottom:calc(100% - var(--border-radius-padding));box-shadow:none;left:calc(var(--offset)*-1);max-height:20rem;max-width:none;overflow:hidden;padding:var(--offset) var(--offset) 0!important;pointer-events:none;position:absolute!important;right:calc(var(--offset)*-1);transition:none!important;visibility:visible!important;width:auto!important}body.animation-level-2 .bot-commands{display:flex!important}.bot-commands .scrollable{background-color:var(--surface-color);border-radius:inherit;box-shadow:0 1px 8px 1px rgba(0,0,0,.12);height:auto;max-height:207px!important;pointer-events:all}body.animation-level-2 .bot-commands .scrollable{opacity:0;transform:translateY(var(--height))}.bot-commands.is-visible.animating .scrollable{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.bot-commands.is-visible:not(.backwards) .scrollable{opacity:1;transform:translateY(0)}.bot-commands-list{border-radius:inherit;height:var(--height);padding-bottom:0;width:100%}.bot-commands-list-element{align-items:flex-start;border-radius:0!important;flex-direction:column;justify-content:center;padding-left:3.375rem}.bot-commands-list-element-avatar{left:.75rem;position:absolute}.bot-commands-list-element-description,.bot-commands-list-element-name{font-size:.875rem;line-height:var(--line-height-14);margin-left:0}.crop .overlay::-moz-selection,.crop-component::-moz-selection{background:transparent}.crop .overlay::selection,.crop-component::selection{background:transparent}.crop-image,.crop-overlay-image{display:block;height:auto;-o-object-fit:contain;object-fit:contain;-o-object-position:center;object-position:center;width:auto}.crop-image{display:block;pointer-events:none;position:relative}.crop-component{background-color:#fff;margin:0 auto;overflow:hidden;position:relative;z-index:999}.crop-component>img{max-width:100%}.crop-overlay{border-radius:50%;box-sizing:content-box;overflow:hidden;position:absolute;z-index:999}.crop-overlay:active,html.no-touch .crop-overlay:hover{cursor:move}.crop-overlay-image{display:block;position:absolute}.crop-overlay-color{background-color:hsla(0,0%,100%,.7);border-radius:8px;height:100%;left:0;position:absolute;top:0;width:100%}.crop.is-forum .crop-overlay{border-radius:var(--avatar-border-radius-forum)}.sidebar-header{align-items:center;background-color:var(--surface-color);cursor:default;display:flex;flex:0 0 auto;justify-content:space-between;min-height:3.5rem;padding-left:1rem;padding-right:1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.sidebar-header .btn-menu{overflow-y:overlay}@media only screen and (max-width:600px){.sidebar-header{padding-left:.5rem;padding-right:.5rem}}[dir=ltr] .sidebar-header__title{padding-left:1.5rem}[dir=rtl] .sidebar-header__title{padding-right:1.5rem}.sidebar-header__title{color:var(--primary-text-color);flex:1;font-size:1.25rem;font-weight:var(--font-weight-bold)}[dir=ltr] .sidebar-header .btn-icon+.btn-icon{margin-left:.5rem}[dir=rtl] .sidebar-header .btn-icon+.btn-icon{margin-right:.5rem}.sidebar-header-right{flex:0 0 auto}.scrollable-y-bordered .sidebar-header{position:relative}.scrollable-y-bordered .sidebar-header:after{background-color:var(--border-color);bottom:-1px;content:\" \";height:1px;left:0;opacity:0;position:absolute;right:0;z-index:1}body.animation-level-2 .scrollable-y-bordered .sidebar-header:after{transition:opacity var(--transition-standard-in)}.scrollable-y-bordered:not(.scrolled-top) .sidebar-header:after{opacity:1}.sidebar-close-button{flex:0 0 auto;height:2.5rem;overflow:inherit!important;width:2.5rem}.sidebar-content{display:flex;flex:1 1 auto;height:100%;max-height:100%;overflow:hidden;position:relative;width:100%}.profile-avatars-container{cursor:pointer;padding-bottom:100%;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}html.no-touch .profile-avatars-container:active .profile-avatars-arrow,html.no-touch .profile-avatars-container:hover .profile-avatars-arrow{opacity:.2}.profile-avatars-container.is-single .profile-avatars-arrow,.profile-avatars-container.is-single .profile-avatars-tabs{display:none}.profile-avatars-container.is-swiping .profile-avatars-arrow{opacity:0!important}.profile-avatars-avatars{display:flex;flex-wrap:nowrap;height:100%;position:absolute;transform:translateZ(-1px) scale(2);transform-origin:left top;transition:transform .2s ease-in-out;width:100%}.scrollable.no-parallax .profile-avatars-avatars{transform:translate(0)}.profile-avatars-avatars:before{bottom:0;content:\" \";left:0;right:0;top:0}.profile-avatars-avatar{background-color:#000;display:flex;height:inherit;min-height:100%;min-width:100%;position:relative;width:inherit}.profile-avatars-avatar .avatar-photo{height:100%;-o-object-fit:cover;object-fit:cover;pointer-events:none;width:100%}.profile-avatars-gradient{background:linear-gradient(1turn,rgba(0,0,0,.3) 8.98%,transparent);bottom:0;height:80px;left:0;position:absolute;right:0}[dir=ltr] .profile-avatars-info{left:1.5rem}[dir=rtl] .profile-avatars-info{right:1.5rem}.profile-avatars-info{align-items:flex-start;bottom:0;bottom:.5625rem;display:flex;flex-direction:column;pointer-events:none;position:absolute}[dir=ltr] .profile-avatars-info .profile-name,[dir=ltr] .profile-avatars-info .profile-subtitle{text-align:left}[dir=rtl] .profile-avatars-info .profile-name,[dir=rtl] .profile-avatars-info .profile-subtitle{text-align:right}.profile-avatars-info .profile-name,.profile-avatars-info .profile-subtitle{color:#fff;margin:0}.profile-avatars-info .peer-typing-container{--color:#fff}.profile-avatars-info .premium-icon{color:#fff}.profile-avatars-info .verified-icon-background{fill:#fff}.profile-avatars-info .verified-icon-check{visibility:hidden}.profile-avatars-info .premium-icon,.profile-avatars-info .profile-subtitle,.profile-avatars-info .verified-icon{opacity:.7}.profile-avatars-info .online{color:inherit!important}.profile-avatars-tabs{display:flex;height:.125rem;left:.375rem;pointer-events:none;position:absolute;right:.375rem;top:.5rem}.profile-avatars-tab{background-color:#fff;border-radius:4px;flex:1 1 auto;height:inherit;margin:0 .125rem;opacity:.2;transition:opacity .2s ease-in-out}.profile-avatars-tab.active{opacity:.6}.profile-avatars-arrow{bottom:0;left:0;opacity:0;position:absolute;top:0;width:33.3333333333%}.profile-avatars-arrow:before{color:#fff;font-size:2.1875rem;left:.625rem;position:absolute;top:50%;transform:translateY(-50%)}body.animation-level-2 .profile-avatars-arrow{transition:opacity .2s ease-in-out}html.no-touch .profile-avatars-container:not(.is-swiping) .profile-avatars-arrow:active,html.no-touch .profile-avatars-container:not(.is-swiping) .profile-avatars-arrow:hover{opacity:1!important}.profile-avatars-arrow-next{left:auto;right:0}.profile-avatars-arrow-next:before{left:auto;right:.625rem}.profile-content{display:flex;flex:0 0 auto;flex-direction:column;position:relative;width:100%}.profile-content .sidebar-left-section{background-color:var(--surface-color);padding-bottom:.5rem;position:relative}.profile-content .sidebar-left-section .profile-subtitle .peer-typing-container{justify-content:center}.profile-content.search-empty .gradient-delimiter{display:none}@media only screen and (max-width:600px){.profile-button{border-radius:0}}[dir=ltr] .profile-change-avatar{right:1.25rem}[dir=rtl] .profile-change-avatar{left:1.25rem}.profile-change-avatar{--size:3.375rem;position:absolute!important;top:calc(var(--size)/-2);transform:none;transition:none!important}.profile-container>.scrollable{display:flex;flex-direction:column}.profile-name{align-items:flex-end;color:var(--primary-text-color);display:flex;font-size:var(--font-size-20);font-weight:var(--font-weight-bold);line-height:var(--line-height-20);margin:0 auto;max-width:21.25rem;overflow:hidden;text-align:center}.profile-name span.emoji{min-width:-moz-min-content;min-width:min-content;vertical-align:inherit}.profile-name .peer-title{overflow:hidden;text-overflow:ellipsis;word-break:break-word}.sidebar-left-section-content>.profile-name{justify-content:center}.profile-name .badge-fake{align-self:center}.profile-subtitle{align-items:center;color:var(--secondary-text-color);display:flex;font-size:.875rem;justify-content:center;margin-bottom:.875rem;margin-top:1px;text-align:center}@media only screen and (max-width:600px){.profile-subtitle{margin-top:3px}}.profile-subtitle .online{color:var(--primary-color)}.profile-avatar{display:block;margin:.5rem auto 10px}@media only screen and (max-width:600px){.profile-avatar{--size:100px;--multiplier:.54;margin:0 auto 10px}}.profile-avatar,.profile-name,.profile-subtitle{flex:0 0 auto}.menu-horizontal-scrollable{--scrollable-size:3rem;height:var(--scrollable-size)}.menu-horizontal-scrollable:after{border-bottom:1px solid var(--border-color);bottom:0;content:\" \";height:1px;left:0;position:absolute;right:0;z-index:-1}.menu-horizontal-scrollable .menu-horizontal-div{border-bottom:none}.menu-horizontal-div{--size:var(--scrollable-size,3rem);--padding-horizontal:0px;border-bottom:1px solid var(--border-color);color:var(--secondary-text-color);display:flex;flex-direction:row;height:var(--size);justify-content:space-around;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:2}.menu-horizontal-div:not(.no-stripe):after,.menu-horizontal-div:not(.no-stripe):before{content:\" \";flex:0 0 auto;width:var(--padding-horizontal)}.menu-horizontal-div:not(.no-stripe) .menu-horizontal-div-item{border-radius:10px 10px 0 0}.menu-horizontal-div-item{align-items:center;border-radius:0;cursor:pointer;display:flex;flex:1 1 auto;font-size:1rem;font-weight:var(--font-weight-bold);height:100%;justify-content:center;line-height:var(--line-height);padding:0 1rem;position:relative;text-align:center;transition:none!important}html.no-touch .menu-horizontal-div-item:active,html.no-touch .menu-horizontal-div-item:hover{background-color:var(--light-secondary-text-color)}.menu-horizontal-div-item.active{color:var(--primary-color)}.menu-horizontal-div-item.active i{opacity:1}.menu-horizontal-div-item.active .c-ripple__circle,html.no-touch .menu-horizontal-div-item.active:active,html.no-touch .menu-horizontal-div-item.active:hover{background-color:var(--light-primary-color)}.menu-horizontal-div-item.active .badge{background-color:var(--primary-color)}.menu-horizontal-div-item>span{align-items:center;display:inline-flex;overflow:visible;pointer-events:none;position:relative}.menu-horizontal-div i{background-color:var(--primary-color);border-radius:.1875rem .1875rem 0 0;bottom:-.8125rem;box-sizing:content-box;height:.1875rem;left:0;opacity:0;pointer-events:none;position:absolute;transform-origin:left;width:100%;z-index:1}.menu-horizontal-div i.animate{transition:transform var(--tabs-transition)}.tabs-container{display:grid;grid-template-columns:100%;grid-template-rows:100%;min-width:100%;width:100%}.tabs-container .tabs-tab{background-color:var(--background-color);display:none;flex-direction:column;grid-column-start:1;grid-row-start:1;overflow:hidden}body.animation-level-0 .tabs-container .tabs-tab{transition:none!important}.tabs-container .tabs-tab.active{display:flex}.tabs-container[data-animation=tabs] .tabs-tab{transition:transform var(--tabs-transition)}.tabs-container[data-animation=navigation].animating .tabs-tab{transition:transform var(--transition-standard-in),filter var(--transition-standard-in)}.tabs-container[data-animation=navigation].animating.backwards .tabs-tab{transition:transform var(--transition-standard-out),filter var(--transition-standard-out)}#column-left{flex:1 1 auto;flex-direction:column;max-width:420px;width:420px}@media only screen and (max-width:600px){#column-left{max-width:100%;width:100%}body:not(.is-left-column-shown) #column-left{filter:brightness(80%);transform:translate3d(-25vw,0,0)}}@media only screen and (min-width:601px){#column-left{overflow:visible}[dir=ltr] #column-left:after{right:-1px}[dir=rtl] #column-left:after{left:-1px}#column-left:after{background-color:var(--border-color);content:\" \";display:block;height:100vh;position:absolute;top:0;width:1px;z-index:2}}@media only screen and (min-width:601px)and (max-width:925px){#column-left{display:flex;left:0;max-width:none;position:fixed;top:0;transform:translate3d(-5rem,0,0);transition:transform var(--layer-transition);width:26.5rem}body.animation-level-0 #column-left{transition:none}body.is-left-column-shown #column-left{transform:translateZ(0)}}@media only screen and (min-width:926px){#column-left{display:flex}}@media only screen and (max-width:1275px){#column-left{flex:2}}@media only screen and (min-width:1681px){html.is-safari #column-left{max-width:418.75px}}#column-left .item-main .menu-horizontal-scrollable{background-color:var(--surface-color);position:relative;top:auto;z-index:1}@media only screen and (max-width:600px){#column-left .item-main .menu-horizontal-scrollable{box-shadow:0 1px 5px -1px rgba(0,0,0,.16)}}#column-left .item-main .menu-horizontal-scrollable .scrollable{position:relative}[dir=ltr] #column-left .item-main .menu-horizontal-scrollable .badge{margin-left:5px}[dir=rtl] #column-left .item-main .menu-horizontal-scrollable .badge{margin-right:5px}#column-left .item-main .menu-horizontal-scrollable:not(.hide)+#folders-container{height:calc(100% - var(--scrollable-size));position:relative}#column-left .item-main .menu-horizontal-scrollable:not(.hide)+#folders-container .scrollable{padding-top:.5rem}#column-left .item-main .menu-horizontal-scrollable:not(.hide)+#folders-container .dialogs-placeholder-canvas{top:.5rem}#column-left .item-main .menu-horizontal-div{--padding-horizontal:.6875rem;justify-content:flex-start;position:relative!important;z-index:0}@media only screen and (max-width:600px){#column-left .item-main .menu-horizontal-div{--padding-horizontal:.1875rem}}#column-left .item-main .menu-horizontal-div-item{flex:0 0 auto;min-width:3rem}#column-left .item-main .menu-horizontal-div__stripe{display:none}#column-left .folders-tabs-scrollable{flex:0 0 auto}#column-left .item-main{--offset-top:0;background-color:var(--surface-color)}[dir=ltr] #column-left .item-main .input-search .selector-user{left:6px}[dir=rtl] #column-left .item-main .input-search .selector-user{right:6px}[dir=ltr] #column-left .item-main .input-search .selector-user{margin-left:0}[dir=rtl] #column-left .item-main .input-search .selector-user{margin-right:0}#column-left .item-main .input-search .selector-user{height:30px;line-height:1.875rem;position:absolute!important;top:6px;z-index:1}[dir=ltr] #column-left .item-main .input-search.is-picked .input-search-input{padding-left:calc(var(--paddingLeft) + 12px - var(--border-width))}[dir=rtl] #column-left .item-main .input-search.is-picked .input-search-input{padding-right:calc(var(--paddingLeft) + 12px - var(--border-width))}#column-left .item-main .input-search.is-picked .tgico-close{display:block!important}#column-left .item-main .input-search.is-picked-twice .selector-user:first-of-type{width:30px}[dir=ltr] #column-left .item-main .input-search.is-picked-twice .selector-user:last-of-type{left:38px}[dir=rtl] #column-left .item-main .input-search.is-picked-twice .selector-user:last-of-type{right:38px}[dir=ltr] #column-left .item-main .search-helper{margin-left:28px}[dir=rtl] #column-left .item-main .search-helper{margin-right:28px}#column-left .item-main .search-helper{display:flex}@media only screen and (max-width:600px){[dir=ltr] #column-left .item-main .search-helper{margin-left:20px}[dir=rtl] #column-left .item-main .search-helper{margin-right:20px}}#column-left .item-main .search-helper .selector-user{font-size:14px;margin-top:7px}html.no-touch #column-left .item-main .search-helper .selector-user:active,html.no-touch #column-left .item-main .search-helper .selector-user:hover{background-color:var(--light-primary-color)}#column-left .item-main .search-helper .selector-user-avatar:after{display:none!important}#column-left .item-main .search-helper:empty{display:none}#column-left .item-main .search-super-tabs-scrollable{flex:0 0 auto;position:relative!important}#column-left .item-main .search-super-tabs-scrollable:before{display:none}#column-left .item-main .search-super-tabs-scrollable .menu-horizontal-div-item{flex:1 0 auto!important}#column-left .item-main .search-super .preloader{height:100%;top:50%;transform:translate(-50%,-50%)}#column-left #chatlist-container{background-color:var(--surface-color);max-height:100%;position:relative}#column-left #chatlist-container.has-filters .connection-status-bottom{height:calc(100% + var(--offset-top)*-1)}#column-left #folders-container{flex:1 1 auto}#column-left #folders-container .scrollable-y{background-color:transparent;position:absolute}#column-left #folders-container .scrollable-y.active{display:block}#column-left .dialogs-placeholder-canvas{position:absolute;top:0;z-index:2}#column-left .sidebar-slider{height:100%}#column-left .sidebar-header__btn-container{align-items:center;display:flex;flex:0 0 auto;height:2.5rem;justify-content:center;position:relative;width:2.5rem}#column-left .sidebar-header__btn-container>.btn-icon{bottom:0;left:0;margin:0;opacity:0;position:absolute;right:0;top:0;visibility:hidden;z-index:4}body.animation-level-0 #column-left .sidebar-header__btn-container>.btn-icon:before{transition:none}#column-left .sidebar-header__btn-container>.btn-icon.is-visible{opacity:1;visibility:visible}@media only screen and (max-width:600px){#column-left .sidebar-header__btn-container .btn-menu{margin-top:-.25rem}}#column-left .sidebar-tools-button{width:100%}#column-left .sidebar-tools-button .btn-menu{max-height:calc(var(--vh)*100 - 3.75rem);min-width:260px}[dir=ltr] #column-left .sidebar-tools-button .btn-menu-item{padding-right:.375rem}[dir=rtl] #column-left .sidebar-tools-button .btn-menu-item{padding-left:.375rem}[dir=ltr] #column-left .archived-count{margin-left:.625rem}[dir=rtl] #column-left .archived-count{margin-right:.625rem}#column-left .archived-count{justify-self:flex-end}html[dir=ltr].is-mobile #column-left .archived-count{margin-right:.375rem}html[dir=rtl].is-mobile #column-left .archived-count{margin-left:.375rem}@media only screen and (max-width:600px){#column-left .archived-count{font-weight:var(--font-weight-bold)}}#column-left .archived-count:empty{display:none}#column-left .search-group-people .chatlist{display:flex;flex-direction:row;margin-top:-1px;padding:0 0 1px}#column-left .search-group-people .chatlist:after,#column-left .search-group-people .chatlist:before{content:\" \";display:inline-block;flex:0 0 auto;width:.3125rem}#column-left .search-group-people .chatlist-chat{align-items:center;border-radius:10px;display:flex;flex:0 0 auto;flex-direction:column;height:6.125rem;justify-content:flex-end;max-width:4.875rem;padding:0!important;width:4.875rem}#column-left .search-group-people .dialog-subtitle,#column-left .search-group-people .dialog-title-details{display:none}#column-left .search-group-people .dialog-title{max-width:65px;padding-bottom:.75rem}#column-left .search-group-people .dialog-title .user-title{font-size:.75rem!important}#column-left .search-group-people .dialog-title .peer-title{font-weight:var(--font-weight-normal)!important}[dir=ltr] #column-left .search-group-people .dialog-avatar{left:auto!important}[dir=rtl] #column-left .search-group-people .dialog-avatar{right:auto!important}#column-left .search-group-people .dialog-avatar{top:.75rem!important}#column-left .search-group-people .search-group-scrollable{position:relative}@media only screen and (max-width:600px){[dir=ltr] #column-left .search-group-people .search-group-scrollable{margin-left:-7px}[dir=rtl] #column-left .search-group-people .search-group-scrollable{margin-right:-7px}#column-left .search-group-people .search-group-scrollable{margin-top:4px}}#column-left .search-group-people .search-group-scrollable>.scrollable{position:relative}#column-left .item-main .sidebar-content{justify-content:center}#column-left .item-main .sidebar-content .btn-menu{bottom:calc(100% + 10px)}#column-left .item-main .sidebar-content .btn-corner.menu-open .tgico-close,#column-left .item-main .sidebar-content .btn-corner:not(.menu-open) .tgico-newchat_filled{visibility:visible!important}body.animation-level-2 #column-left .item-main .sidebar-content .btn-corner.menu-open .tgico-close,body.animation-level-2 #column-left .item-main .sidebar-content .btn-corner:not(.menu-open) .tgico-newchat_filled{animation:grow-icon .4s ease-in-out forwards!important}@media only screen and (max-width:600px){#column-left .item-main .sidebar-content .btn-corner{--size:54px;bottom:14px;position:fixed!important;right:14px;z-index:1}}#column-left .item-main .sidebar-content .btn-corner:not(.is-hidden){transform:translateZ(0)}#column-left .connection-status{flex:0 0 auto;overflow:hidden;padding:0 .5rem .5rem;width:100%}#column-left .connection-status:not(.is-shown) .connection-status-button{display:none}#column-left .connection-status.is-shown.animating .connection-status-button,#column-left .connection-status.is-shown.animating+.connection-status-bottom{transition:transform var(--layer-transition)}#column-left .connection-status.is-shown:not(.backwards) .connection-status-button{transform:translateY(0)}#column-left .connection-status.is-shown:not(.backwards)+.connection-status-bottom{transform:translateY(calc(64px + var(--offset-top)))}#column-left .connection-status.is-shown:not(.animating):not(.backwards)+.connection-status-bottom{height:calc(100% - 64px + var(--offset-top))}[dir=ltr] #column-left .connection-status-button{padding-left:4.5rem}[dir=rtl] #column-left .connection-status-button{padding-right:4.5rem}[dir=ltr] #column-left .connection-status-button{text-align:left}[dir=rtl] #column-left .connection-status-button{text-align:right}#column-left .connection-status-button{align-self:center;color:#2e3939;cursor:default;height:3.5rem;transform:translateY(-100%)}#column-left .connection-status-button .force-reconnect{color:inherit;cursor:pointer;text-decoration:underline}[dir=ltr] #column-left .connection-status-button .preloader-container{left:1rem}[dir=rtl] #column-left .connection-status-button .preloader-container{right:1rem}#column-left .connection-status-button .preloader-container{height:1.5rem;right:auto;width:1.5rem}#column-left .connection-status-button .preloader-container .preloader-path-new{stroke:#2e3939}#column-left .connection-status-bottom{--offset-top:0px;background-color:var(--surface-color);bottom:0;display:flex;flex-direction:column;height:100%;left:0;overflow:hidden;position:absolute;right:0;top:0;transform:translateY(var(--offset-top))}#column-left .input-wrapper{flex:0 0 auto;margin:.75rem 0;max-width:100%;padding:0 .75rem;width:420px}@media only screen and (max-width:600px){#column-left .input-wrapper{width:100%}}#search-container{display:flex;top:var(--offset-top)!important}#search-container .scrollable-y{flex:1 1 auto;position:relative}.edit-profile-container .sidebar-content,.new-channel-container .sidebar-content,.new-group-container .sidebar-content{flex-direction:column}.edit-profile-container .chatlist-container,.new-channel-container .chatlist-container,.new-group-container .chatlist-container{flex:1 1 auto}[dir=ltr] .edit-profile-container .caption,[dir=ltr] .new-channel-container .caption,[dir=ltr] .new-group-container .caption{margin-left:23px}[dir=rtl] .edit-profile-container .caption,[dir=rtl] .new-channel-container .caption,[dir=rtl] .new-group-container .caption{margin-right:23px}[dir=ltr] .edit-profile-container .caption,[dir=ltr] .new-channel-container .caption,[dir=ltr] .new-group-container .caption{padding-right:24px}[dir=rtl] .edit-profile-container .caption,[dir=rtl] .new-channel-container .caption,[dir=rtl] .new-group-container .caption{padding-left:24px}.edit-profile-container .caption,.new-channel-container .caption,.new-group-container .caption{color:var(--secondary-text-color);font-size:.875rem;margin-top:14px}.language-container .sidebar-left-section{padding-bottom:.5rem}.new-group-container .search-group{margin-top:.5rem}.edit-folder-container .chatlist{padding:0}.edit-folder-container .folder-categories .folder-category-button:nth-child(n+2){pointer-events:none}.new-group-members{padding:1.5rem 0 .4375rem}.new-group-members .search-group__name{text-transform:capitalize}.settings-container .profile-avatars-container{height:15rem;padding-bottom:0}.edit-profile-container .scroll-wrapper{width:100%}.chat-folders-container,.edit-folder-container,.people-nearby-container{-webkit-user-select:none;-moz-user-select:none;user-select:none}.chat-folders-container .sticker-container,.edit-folder-container .sticker-container,.people-nearby-container .sticker-container{flex:0 0 auto;height:86px;margin:1px auto 29px;position:relative;width:86px}.chat-folders-container .caption,.edit-folder-container .caption,.people-nearby-container .caption{color:var(--secondary-text-color);font-size:var(--font-size-14);line-height:var(--line-height-14);margin:0 auto;max-width:20rem;text-align:center}.people-nearby-container .sticker-container{margin:1rem auto}.people-nearby-container .caption{margin-bottom:1rem}.chat-folders-container .sidebar-left-section:not(:last-child){padding-bottom:0}.chat-folders-container .sidebar-left-section:last-child{padding-bottom:.5rem}.edit-folder-container .caption{margin-bottom:18px}@media only screen and (max-width:600px){.edit-folder-container .input-wrapper{padding:0 16px;width:100%}}.edit-folder-container .sidebar-left-section{padding-bottom:0}.edit-folder-container .sidebar-left-section:last-child{padding-bottom:.5rem}.folder-categories .checkbox-field{position:absolute;right:1.125rem!important}.included-chatlist-container .sidebar-left-section{padding-bottom:0}.included-chatlist-container .sidebar-left-section:first-child{padding-top:0}.included-chatlist-container .sidebar-left-section:last-child{padding-bottom:.5rem}.included-chatlist-container .sidebar-left-section .chatlist{padding:0}.included-chatlist-container .selector .chatlist .checkbox{margin-top:10px}[dir=ltr] .included-chatlist-container .selector .chatlist [type=checkbox]+span{padding-left:26px}[dir=rtl] .included-chatlist-container .selector .chatlist [type=checkbox]+span{padding-right:26px}[dir=ltr] .included-chatlist-container .chatlist-chat{padding-right:3.5rem!important}[dir=rtl] .included-chatlist-container .chatlist-chat{padding-left:3.5rem!important}.search-group-recent .search-group__name{align-items:center;display:flex;justify-content:space-between}.search-group-recent .btn-icon{font-size:22px}@media only screen and (max-width:600px){.search-group-recent.search-group.search-group-contacts ul{margin-top:0}.search-group.search-group-contacts ul,.search-group.search-group-messages ul{margin-top:7px}.search-group.search-group-messages{margin-top:-6px}}@media only screen and (min-width:601px){.search-group-recent.search-group.search-group-contacts{padding:0 0 7px}}.sidebar-left-section{padding:.5rem 0 1rem}.sidebar-left-section.with-fake-delimiter{box-shadow:none;padding-top:0!important}.sidebar-left-section.with-fake-delimiter .gradient-delimiter{margin-bottom:.5rem}.sidebar-left-section.no-padding-top{padding-top:0!important}@media only screen and (max-width:600px){.sidebar-left-section{padding-bottom:.5rem}}@media only screen and (min-width:601px){.sidebar-left-section-content{margin:0 .5rem}}.sidebar-left-section-content>.btn-primary{margin:0}[dir=ltr] .sidebar-left-section-content>.checkbox-field .checkbox-box{left:auto}[dir=rtl] .sidebar-left-section-content>.checkbox-field .checkbox-box{right:auto}@media only screen and (max-width:600px){.sidebar-left-section-content>.btn-primary,.sidebar-left-section-content>.checkbox-ripple{border-radius:0}}.sidebar-left-section-content.full-width{margin:0!important}.sidebar-left-section-content>.media-sticker-wrapper{flex:0 0 auto;height:86px;margin:1px auto 29px;position:relative;width:86px}.sidebar-left-section-name{padding:1rem}@media only screen and (max-width:600px){.sidebar-left-section-name{font-size:.875rem;padding:.5rem 1rem}}.sidebar-left-section-caption{color:var(--secondary-text-color);font-size:1rem;line-height:var(--line-height);margin-top:1rem;padding:0 1rem}@media only screen and (max-width:600px){.sidebar-left-section-caption{font-size:.875rem;margin:.5rem}}.sidebar-left-section .checkbox-field,.sidebar-left-section .radio-field{margin:0}.sidebar-left-section:first-child:not(.no-delimiter){padding-top:0}.sidebar-left-section .checkbox-field{align-items:center;display:flex;height:3.5rem;padding:0 1.125rem}.sidebar-left-section-disabled{opacity:.25;pointer-events:none!important}.sidebar-left-section .chatlist{padding:0}.sidebar-left-h2{color:var(--primary-color);font-size:16px;font-weight:var(--font-weight-bold)}.general-settings-container{-webkit-user-select:none;-moz-user-select:none;user-select:none}.general-settings-container .sidebar-left-section{padding-bottom:0}.general-settings-container .sidebar-left-section:last-child{padding-bottom:.5rem}#chats-archived-container,#contacts-container,#poll-results-container,#search-gifs-container,#search-private-container,#stickers-container,.add-members-container{background-color:var(--surface-color)!important}.chat-folders-container .btn-control{margin-bottom:1.5rem}.two-step-verification{background-color:var(--surface-color)!important}.two-step-verification .sidebar-left-section{box-shadow:none!important}.two-step-verification .sidebar-left-section:first-child{padding-top:0}.two-step-verification .sidebar-left-section-caption{margin-bottom:1.125rem;margin-left:auto;margin-right:auto;max-width:342px;text-align:center}.two-step-verification-main .btn-primary+.btn-primary{margin-top:.125rem!important}.two-step-verification .btn-primary:not(.btn-transparent){text-transform:uppercase}.two-step-verification .media-sticker-wrapper{height:168px;margin:.625rem auto 1.1875rem;width:168px}.two-step-verification .input-wrapper .btn-primary:first-child:last-child{margin-top:.25rem}.two-step-verification-enter-password .media-sticker-wrapper{height:157px;margin:1.125rem auto 1.8125rem;width:157px}.two-step-verification-hint .media-sticker-wrapper{height:160px;margin:.5rem auto 2.25rem;width:160px}.two-step-verification-email .media-sticker-wrapper{height:160px;margin:.5625rem auto 2.1875rem;width:160px}.two-step-verification-set .media-sticker-wrapper{height:160px;margin:1rem auto 1.3125rem;width:160px}[dir=ltr] .two-step-verification-set .media-sticker-wrapper .rlottie,[dir=ltr] .two-step-verification-set .media-sticker-wrapper .rlottie-vector{left:.625rem}[dir=rtl] .two-step-verification-set .media-sticker-wrapper .rlottie,[dir=rtl] .two-step-verification-set .media-sticker-wrapper .rlottie-vector{right:.625rem}.dont-u-dare-block-me .sidebar-left-section.no-delimiter{padding-top:.75rem}.dont-u-dare-block-me .sidebar-left-section{padding:0 0 .5rem}@media only screen and (min-width:601px){.privacy-tab .sidebar-left-section:first-child{padding-bottom:1.125rem}}.privacy-tab form{padding-bottom:.0625rem}.active-sessions-container .row-title:first-child{font-weight:var(--font-weight-bold)}.active-sessions-container .row-title-right{color:var(--secondary-text-color);font-size:var(--font-size-12);line-height:var(--line-height-12)}.active-sessions-container .row-midtitle,.active-sessions-container .row-subtitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.active-sessions-container .sidebar-left-section:first-child{padding-bottom:0}.active-sessions-container .sidebar-left-section:first-child .row-title{font-weight:var(--font-weight-bold)}@media only screen and (min-width:601px){.blocked-users-container ul{padding:0 .6875rem}}.notifications-container .sidebar-left-section{padding-bottom:0}.range-setting-selector{padding:1rem .875rem}.range-setting-selector-details{display:flex;justify-content:space-between;margin-bottom:1rem}.range-setting-selector-name{color:var(--primary-text-color)}.range-setting-selector-value{color:var(--secondary-text-color)}.range-setting-selector .progress-line{--height:2px;--color:var(--primary-color);--border-radius:4px;--thumb-size:12px;background-color:#e6ecf0}.range-setting-selector .progress-line__filled{background-color:var(--primary-color)}.background-container .background-item:after{border:3px solid var(--primary-color);bottom:0;content:\" \";display:block;left:0;opacity:0;position:absolute;right:0;top:0;transition:opacity .2s ease-in-out}.background-container .background-item.active:after{opacity:1}.background-container .background-item.active .grid-item-media{transform:scale(.91)}.background-container .background-item-media{transform:scale(1);transition:transform .2s ease-in-out}.background-container .background .preloader-container{z-index:1}.background-item{cursor:pointer}.background-item-media{border-radius:inherit}.background-item-media.is-pattern{background-color:#000;bottom:0;left:0;position:absolute;right:0;top:0}.background-item-media.is-pattern .media-photo{mix-blend-mode:soft-light}.background-item .media-photo{border-radius:inherit;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.background-colors-canvas{border-radius:inherit;height:100%;-webkit-mask-position:center;-webkit-mask-size:cover;position:absolute;width:100%}.background-image-container .sidebar-left-section{padding-bottom:.5rem}.empty-placeholder{line-height:var(--line-height);margin:0 auto;padding:0 1rem;position:relative;text-align:center;top:40%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none;width:21rem!important}.empty-placeholder .media-sticker-wrapper{height:128px;margin:0 auto 1.9375rem;position:relative;width:128px}.empty-placeholder-header{font-size:1.25rem;font-weight:var(--font-weight-bold)}.empty-placeholder-subtitle{color:var(--secondary-text-color);font-size:.875rem;margin-top:.375rem}.empty-placeholder .btn-control{margin-top:1.75rem;padding:0 1.0625rem 0 .8125rem}[dir=ltr] .empty-placeholder .btn-control:before{margin-right:.625rem}[dir=rtl] .empty-placeholder .btn-control:before{margin-left:.625rem}.empty-placeholder-dialogs{opacity:0}body.animation-level-2 .empty-placeholder-dialogs{transition:opacity .2s ease-in-out}.empty-placeholder-dialogs-icon{margin-bottom:1.0625rem}.empty-placeholder-dialogs.visible{opacity:1}.is-forum-visible .can-have-forum .input-search,.is-forum-visible .can-have-forum .row-row,.is-forum-visible .can-have-forum .sidebar-header__title{opacity:0}.is-forum-visible .folders-tabs-scrollable{opacity:var(--disabled-opacity);pointer-events:none}.is-forum-visible.backwards .can-have-forum .input-search,.is-forum-visible.backwards .can-have-forum .row-row,.is-forum-visible.backwards .can-have-forum .sidebar-header__title,.is-forum-visible.backwards .folders-tabs-scrollable{opacity:1}.is-forum-visible.animating .can-have-forum .input-search,.is-forum-visible.animating .can-have-forum .row-row,.is-forum-visible.animating .can-have-forum .sidebar-header__title,.is-forum-visible.animating .folders-tabs-scrollable{transition:opacity var(--transition-standard-in)}.is-forum-visible.animating.backwards .can-have-forum .input-search,.is-forum-visible.animating.backwards .can-have-forum .row-row,.is-forum-visible.animating.backwards .can-have-forum .sidebar-header__title,.is-forum-visible.animating.backwards .folders-tabs-scrollable{transition:opacity var(--transition-standard-out)}#column-right{overflow:visible;overflow:initial;position:relative}@media only screen and (min-width:601px)and (max-width:1275px){#column-right{box-shadow:0 .25rem .5rem .1rem rgba(0,0,0,.2)}}@media only screen and (max-width:600px){body:not(.is-right-column-shown) #column-right{transform:translate3d(100vw,0,0)}}@media only screen and (min-width:601px)and (max-width:925px){body.is-right-column-shown:not(.is-left-column-shown) #column-right{transform:translateZ(0);transition:transform var(--transition-standard-in)}}@media only screen and (min-width:926px){body.is-right-column-shown #column-right{transform:translateZ(0);transition:transform var(--transition-standard-in)}}@media only screen and (min-width:601px){#column-right{position:absolute;right:0;transform:translate3d(var(--right-column-width),0,0);transition:transform var(--transition-standard-out);width:calc(var(--right-column-width));z-index:3}#column-right .sidebar-content{min-width:var(--right-column-width)}body.animation-level-0 #column-right{transition:none}}@media only screen and (min-width:1276px){#column-right{border-left:1px solid var(--border-color);transform:translate3d(calc(var(--right-column-width) + 1px),0,0);width:calc(var(--right-column-width) + 1px)}}#column-right .sidebar-header{flex:0 0 auto}#column-right .sidebar-header .sidebar-close-button.tgico:before{content:\"\"}@media only screen and (min-width:601px){#column-right .sidebar-header .sidebar-close-button.tgico:before{content:\"\"}}#column-right #search-private-container .chatlist-container{flex:1 1 auto;position:relative}#column-right .sidebar-search{display:none}#column-right .sidebar-search.active{display:flex}#column-right .input-wrapper{margin:.75rem 0;max-width:100%;padding:0 .75rem;width:100%}.shared-media-container .scrollable:not(.no-parallax){perspective:0;perspective-origin:0 0}.shared-media-container .scrollable:not(.no-parallax).parallax{perspective:1px}.shared-media-container .profile-content.is-me .profile-name{margin-bottom:.9375rem}.shared-media-container .profile-content.is-me .profile-subtitle{display:none}.shared-media-container .search-super{min-height:calc(var(--vh, 1vh)*100 - 56px);top:100%}.shared-media-container .search-super-tabs{--padding-horizontal:0}.shared-media-container .search-super-tabs .menu-horizontal-div-item{border-radius:0!important}.shared-media-container .sidebar-header .transition{flex-grow:1}.shared-media-container .sidebar-header .transition .transition-item{align-items:center;display:flex}.shared-media-container .btn-corner.menu-open:before{content:\"\"}@media only screen and (max-width:600px){.shared-media-container .btn-corner{bottom:14px;height:54px;position:fixed!important;right:14px;width:54px;z-index:1}}.shared-media-container.can-add-members .btn-corner:not(.is-hidden){transform:translateZ(0)}.search-super{background-color:var(--surface-color);display:flex;flex-direction:column;max-width:100%;min-height:100%;position:absolute;width:100%}.search-super .search-group__show-more{color:var(--primary-color);cursor:pointer;font-weight:400}.search-super .search-super-month-name{border-top:1px solid var(--border-color);color:var(--secondary-text-color);font-weight:var(--font-weight-bold);padding:24px 0 0 24px}@media only screen and (max-width:600px){.search-super .search-super-month-name{padding:18px 0 0 16px}}.search-super.sliding{max-height:none!important}.search-super-tabs{flex:1 1 auto;width:auto}.search-super-tabs-scrollable{background-color:var(--surface-color);box-shadow:none!important;position:sticky!important;top:0;z-index:2}.search-super-tabs-scrollable:before{background-color:inherit;content:\" \";display:block;height:1px;left:0;position:absolute;top:0;width:100%;z-index:-1}.search-super.is-full-viewport .search-super-tabs-scrollable:before{top:-1px}.search-super-tabs-scrollable .scrollable{display:flex;position:relative}.search-super-tabs-container{flex:1 1 auto;grid-template-rows:100%;min-height:calc(100% - 49px)}.search-super-tabs-container>div{background-color:var(--surface-color)!important;min-height:150px;position:relative}.search-super-tabs-container>div>div:first-child{min-height:calc(100vh - 111px);transform:translateY(0)}.search-super-tabs-container .preloader{padding:0;position:absolute!important;top:100px;transform:translate(-50%)}.search-super-tabs-container .preloader>svg{height:50px;width:50px}.search-super-month:first-of-type .search-super-month-name{display:none}.search-super .audio-title,.search-super .document-name,.search-super .title{display:flex;justify-content:space-between}.search-super .sent-time{color:var(--secondary-text-color);flex:0 0 auto;font-size:12px;margin-left:8px;margin-top:3px}.search-super-content-media .search-super-month-name{border:none;padding:9px 0 7px 24px}.search-super-content-media .video-time{background-color:var(--message-time-background);border-radius:4px;color:#fff;font-size:12px;height:18px;left:5px;line-height:18px;padding:0 6px 0 5px;position:absolute;top:4px;z-index:2}.search-super-content-media .grid-item{overflow:hidden}.search-super-content-media .checkbox-field{right:.25rem;top:.25rem}.search-super .checkbox-box{box-shadow:0 0 3px 0 rgba(0,0,0,.4)}.search-super .checkbox-box-border{border-color:var(--message-checkbox-border-color)}.search-super .checkbox-box-background{background-color:var(--message-checkbox-color)}.search-super .checkbox-field{margin:0;position:absolute!important;z-index:2}.search-super-content-media .search-super-month-items{grid-gap:1px;display:grid;grid-auto-rows:1fr;grid-template-columns:repeat(3,1fr);padding-top:1px;width:100%}.search-super-content-files .search-super-month-items{padding:8px 24px 16px 20px}@media only screen and (max-width:600px){.search-super-content-files .search-super-month-items{padding:8px 16px 8px 12px}}.search-super-content-files .document{--icon-size:3rem;--icon-margin:.75rem;height:calc(48px + 1.5rem)}.search-super-content-files .document-download,.search-super-content-files .document-ico{border-radius:5px!important}.search-super-content-files .document-name{font-weight:400;max-width:100%;overflow:hidden;text-overflow:ellipsis;width:100%}.search-super-content-links .search-super-item{cursor:pointer;display:flex;flex-direction:column;justify-content:flex-start;min-height:4.375rem;overflow:hidden;padding-left:4.4375rem;position:relative}.search-super-content-links .row-media{border-radius:.375rem;height:3rem;left:.6875rem;overflow:hidden;position:absolute;width:3rem}.search-super-content-links .row-media.empty{align-items:center;background-color:var(--primary-color);color:#fff;display:flex;font-size:2rem;justify-content:center;text-transform:uppercase}.search-super-content-links a:not(:last-child){position:relative;z-index:2}.search-super-content-links .anchor-url:last-child{position:static}.search-super-content-links .anchor-url:last-child:before{bottom:0;content:\" \";cursor:pointer;left:0;position:absolute;right:0;top:0;z-index:1}.search-super-content-links .media-photo{border-radius:inherit;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.search-super-content-links .row-title{margin-top:.1875rem}.search-super-content-links .row-subtitle{overflow:hidden;text-overflow:ellipsis;white-space:pre-wrap;word-break:break-word}.search-super-content-links .sent-time{margin:1px 0 0}.search-super-content-links .sender-title{display:block;margin-top:.25rem}.search-super-content-links .checkbox-field{--offset-left:0!important;margin:2rem 0 0 -1.75rem!important;padding:0!important}@media only screen and (min-width:601px){.search-super-content-links .search-super-month-items{margin:.5625rem}}@media only screen and (max-width:600px){.search-super-content-links .search-super-month-name{padding:.875rem 1rem}}.search-super-content-music .search-super-month-items,.search-super-content-voice .search-super-month-items{padding:20px 15px 0 20px}@media only screen and (max-width:600px){.search-super-content-music .search-super-month-items,.search-super-content-voice .search-super-month-items{padding:20px 15px 0 12px}}.search-super-content-music .audio,.search-super-content-voice .audio{justify-content:normal;margin-bottom:1.5rem}@media only screen and (min-width:601px){.search-super-content-music .audio,.search-super-content-voice .audio{max-width:377px}}.search-super-content-music .audio.audio-show-progress .audio-subtitle,.search-super-content-voice .audio.audio-show-progress .audio-subtitle{overflow:visible}.search-super-content-groups .chatlist,.search-super-content-members .chatlist{padding-bottom:.5rem;padding-top:.5rem}.search-super-tabs-scrollable .search-super-nav-scrollable{opacity:1}body.animation-level-2 .search-super-tabs-scrollable .search-super-nav-scrollable,body.animation-level-2 .search-super-tabs-scrollable .search-super-selection-container{transition:opacity .2s ease-in-out}.search-super-tabs-scrollable.is-selecting:not(.backwards) .search-super-nav-scrollable{opacity:0}.search-super-tabs-scrollable.is-selecting:not(.backwards) .search-super-selection-container{opacity:1}.search-super.is-selecting a{pointer-events:none}.search-super.is-selecting .row:not(.menu-open){background-color:transparent!important}.search-super-selection-container{align-items:center;bottom:0;display:flex;justify-content:space-between;left:0;opacity:0;padding:0 1rem;position:absolute;right:0;top:0}.search-super-selection-container .btn-icon+.btn-icon{margin-left:.5rem}@media only screen and (max-width:600px){.search-super-selection-container{padding:0 .5rem}}.search-super-selection-count{color:var(--primary-text-color);flex-grow:1;font-weight:var(--font-weight-bold);margin-left:1.5rem;text-transform:capitalize;white-space:nowrap}#search-container .search-group.is-short .chatlist-chat:nth-child(n+4),#search-container .search-super-content-music .audio:not(.audio-show-progress) .audio-description:before,#search-container .search-super-content-music .audio:not(.audio-show-progress) .audio-time{display:none}#stickers-container .sticker-sets{display:flex;flex-direction:column;margin-top:16px}#stickers-container .sticker-set{cursor:pointer;display:flex;flex-direction:column;height:140px}#stickers-container .sticker-set-name{font-weight:var(--font-weight-bold)}#stickers-container .sticker-set-count{color:var(--secondary-text-color);font-size:14px}#stickers-container .sticker-set-header{display:flex;justify-content:space-between;padding-bottom:12px;padding-left:16px}#stickers-container .sticker-set-button{border-radius:16px;font-size:15px;font-weight:400;height:30px;margin-right:16px;padding-left:12px;padding-right:13px;transition:width .2s;width:auto}#stickers-container .sticker-set-button.gray{background:#f1f3f4;color:var(--secondary-text-color)}#stickers-container .sticker-set-stickers{display:flex;justify-content:space-around}#stickers-container .sticker-set-sticker{height:68px;position:relative;width:68px}#stickers-container .sticker-set-sticker:hover{background-color:var(--light-secondary-text-color);border-radius:12px}#stickers-container .sticker-set-sticker img{max-height:100%;max-width:100%}#poll-results-container .poll-results{display:flex;flex-direction:column;position:relative;width:100%}#poll-results-container .poll-results-answer{color:var(--secondary-text-color);display:flex;font-size:15px;font-weight:var(--font-weight-bold);justify-content:space-between;margin:0;padding:0 16px 8px;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media only screen and (min-width:601px){#poll-results-container .poll-results-answer{padding:0 24px 8px}}#poll-results-container .poll-results-more{margin:0 .5rem;width:auto}@media only screen and (max-width:600px){#poll-results-container .poll-results-more{border-radius:0;margin:0}}#poll-results-container .poll-results h3{font-size:20px;margin-bottom:16px;margin-top:15px;padding:0 16px}@media only screen and (min-width:601px){#poll-results-container .poll-results h3{padding:0 24px}}#poll-results-container .poll-results hr{display:block!important;margin-bottom:15px;margin-top:7px}.edit-peer-container .input-wrapper{margin-bottom:.5625rem!important}.edit-peer-container .sidebar-left-section{padding:0 0 .5rem}.edit-peer-container .chatlist-new{padding:0}.edit-contact-container .input-wrapper{margin-top:1.8125rem!important}.edit-contact-container .avatar-placeholder{filter:none!important}.edit-contact-container .avatar-edit{margin-bottom:1.375rem!important}.edit-contact-container .profile-name{font-size:1.5rem;line-height:var(--line-height)}.group-type-container .sidebar-left-section-caption{font-size:.875rem;margin-top:.8125rem}.group-type-container .input-wrapper{margin-top:.875rem!important}.media-viewer{align-items:center;background:rgba(0,0,0,.88);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0}@media only screen and (max-width:600px){.media-viewer{background:#000}}.media-viewer-author{align-items:center;cursor:pointer;display:flex;height:100%}@media only screen and (max-width:600px){.media-viewer-author{margin-left:1.5rem}}.media-viewer-userpic{margin-right:1rem}@media only screen and (max-width:600px){.media-viewer-userpic{display:none}}.media-viewer-name{font-weight:var(--font-weight-bold);line-height:var(--line-height);margin:.0625rem 0}@media only screen and (min-width:601px){.media-viewer-name{margin:.0625rem 0 .125rem}}.media-viewer-date{font-size:.875rem;line-height:var(--line-height)}.media-viewer-buttons{display:flex;flex-flow:row nowrap;padding:.5rem .75rem;position:absolute;right:0;top:0}.media-viewer-buttons .btn-icon{margin:0 .25rem;transition:var(--open-duration)}html.no-touch .media-viewer-buttons .btn-icon:active,html.no-touch .media-viewer-buttons .btn-icon:hover{color:#fff}@media only screen and (max-width:600px){.media-viewer-buttons{display:none}}.media-viewer-content{flex-direction:column;height:100%;justify-content:center}.media-viewer-container,.media-viewer-content{align-items:center;display:flex;max-height:100%;max-width:100%;overflow:hidden}.media-viewer-container{align-self:center;flex:1 1 auto;position:relative}.media-viewer-media{visibility:hidden}.media-viewer-caption{background-color:transparent;bottom:0;color:#fff;left:0;line-height:var(--line-height);opacity:0;overflow:hidden;padding:.5rem .5rem 0;position:absolute;right:0;text-align:center;text-overflow:ellipsis;white-space:pre-wrap;word-break:break-word;z-index:4}body.animation-level-2 .media-viewer-caption{transition:transform var(--layer-transition),opacity var(--open-duration) ease-in-out,background-color var(--open-duration) ease-in-out}.media-viewer-caption a{color:#60a5e9!important}.media-viewer-caption .scrollable{height:6rem;margin:0 auto;max-height:6rem;max-width:50rem;padding:.5rem .875rem;position:relative}html.no-touch .media-viewer-whole.active .media-viewer-caption{opacity:.4}html.no-touch .media-viewer-whole.active .media-viewer-caption:hover{opacity:1}html.is-touch .media-viewer-whole.active .media-viewer-caption{opacity:.6}@media only screen and (max-width:600px){.media-viewer-caption{bottom:1.0625rem;text-align:inherit;transform:translateZ(0);width:100%}.media-viewer-caption .scrollable{height:auto;padding:0 .5rem}.media-viewer-whole.has-video-controls .media-viewer-caption{transform:translate3d(0,-69px,0)}.media-viewer-whole.backwards .media-viewer-caption{visibility:hidden}html.no-touch .media-viewer-caption:active,html.no-touch .media-viewer-caption:hover{background-color:#000;opacity:1!important}}.media-viewer-caption.is-focused{background-color:#000;opacity:1!important}.media-viewer-switcher{cursor:pointer;height:calc(100% - 7.5rem);left:0;position:absolute;top:3.75rem;width:7rem}html.no-touch .media-viewer-switcher{height:calc(100% - 3.75rem)}html.no-touch .media-viewer-switcher:hover .tgico-down{opacity:1}@media only screen and (max-width:600px){.media-viewer-switcher{width:4rem}}.media-viewer-switcher-right{left:auto;right:0}.media-viewer-next-button,.media-viewer-prev-button{color:#fff;cursor:pointer;font-size:2rem;left:1rem;opacity:0;position:absolute;top:50%;transform:translateY(-50%) rotate(90deg);transition:var(--open-duration) opacity;z-index:5}@media only screen and (min-width:601px){.media-viewer-next-button,.media-viewer-prev-button{font-size:3rem;left:2rem}}.media-viewer-next-button{left:auto;right:1rem;transform:translateY(-50%) rotate(-90deg)}@media only screen and (min-width:601px){.media-viewer-next-button{right:2rem}}.media-viewer-mover{align-items:center;border-radius:0;display:flex;justify-content:center;left:0;min-height:auto!important;overflow:hidden;position:fixed!important;top:0;transform:translateZ(0) scaleX(1);transform-origin:top left}.media-viewer-mover:not(.center){-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}@media only screen and (max-width:600px){.media-viewer-mover{overflow:visible}}.media-viewer-mover .ckin__player{height:100%;left:0;position:absolute;top:0;width:100%}.media-viewer-mover>svg{height:100%;width:100%}.media-viewer-mover .canvas-thumbnail,.media-viewer-mover img,.media-viewer-mover video{height:100%;max-height:100%;max-width:100%;-o-object-fit:cover;object-fit:cover;opacity:1;position:absolute;transition:var(--open-duration) opacity;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.media-viewer-mover svg img,.media-viewer-mover svg video{position:static}.media-viewer-mover.active{transition:transform var(--open-duration),border-radius var(--open-duration),opacity var(--open-duration) calc(var(--open-duration)/8)}.media-viewer-mover.active.opening{transition:transform var(--open-duration),border-radius var(--open-duration),opacity var(--open-duration) 0s}.media-viewer-mover.moving{transition:transform var(--move-duration) ease}.media-viewer-mover.no-transition{transition:none!important}.media-viewer-mover.center{left:50%!important;max-height:calc(var(--vh, 1vh)*100 - 15rem);max-width:100vw;top:50%!important;transform:translate3d(-50%,-50%,0)!important}@media only screen and (max-width:600px){.media-viewer-mover.center{height:100%!important;max-height:calc(var(--vh, 1vh)*100 - 120px);max-width:100vw!important;width:100%!important}.media-viewer-mover.center .ckin__player:not(.ckin__fullscreen) .default__controls{bottom:-62px}}.media-viewer-mover.center .canvas-thumbnail,.media-viewer-mover.center img:not(.thumbnail),.media-viewer-mover.center video{-o-object-fit:contain;object-fit:contain}.media-viewer-mover.center img.thumbnail{-o-object-fit:contain;object-fit:contain;width:auto}.media-viewer-mover.hiding .canvas-thumbnail,.media-viewer-mover.hiding img,.media-viewer-mover.hiding video{opacity:0}.media-viewer-appear{opacity:0;visibility:hidden}body.animation-level-2 .media-viewer-appear{transition:opacity var(--open-duration) 0s,visibility 0s var(--open-duration)}.media-viewer-topbar{align-items:center;display:flex;height:3.5rem;justify-content:space-between;left:0;padding:0 1.25rem;position:absolute;right:0;top:0;z-index:5}.media-viewer-topbar .btn-icon,.media-viewer-topbar .media-viewer-author{color:#fff;opacity:.4}body.animation-level-2 .media-viewer-topbar .btn-icon,body.animation-level-2 .media-viewer-topbar .media-viewer-author{transition:opacity var(--open-duration) ease-in-out,color var(--open-duration) ease-in-out,background-color var(--open-duration) ease-in-out}html.no-touch .media-viewer-topbar .btn-icon:active,html.no-touch .media-viewer-topbar .btn-icon:hover,html.no-touch .media-viewer-topbar .media-viewer-author:active,html.no-touch .media-viewer-topbar .media-viewer-author:hover{opacity:1}.media-viewer-topbar-left{align-items:center;display:flex}@media only screen and (max-width:600px){.media-viewer-topbar{padding:0 .5rem}}.media-viewer-aspecter{align-items:center;border-radius:0;display:flex;height:100%;justify-content:center;position:absolute;transform:scaleX(1);width:100%}.media-viewer-mover.active .media-viewer-aspecter{transition:width var(--open-duration),height var(--open-duration),transform var(--open-duration),border-radius var(--open-duration)}.media-viewer-whole{--open-duration:.2s;--move-duration:.35s;display:block;height:100%;left:0;position:fixed!important;top:0;transition:visibility 0s var(--open-duration);visibility:hidden;width:100%;z-index:4}body.animation-level-0 .media-viewer-whole{--open-duration:0s;--move-duration:0s}.media-viewer-whole.active{transition-delay:0s;visibility:visible}.media-viewer-whole.active .media-viewer-appear,.media-viewer-whole.active .overlays{opacity:1;visibility:visible}body.animation-level-2 .media-viewer-whole.active .media-viewer-appear,body.animation-level-2 .media-viewer-whole.active .overlays{transition:opacity var(--open-duration) 0s,visibility 0s 0s}.media-viewer-whole.active .media-viewer-caption{visibility:visible}@media only screen and (max-width:600px){.media-viewer-whole .btn-menu-toggle:not(.playback-rate){color:hsla(0,0%,100%,.4);opacity:1}.media-viewer-whole .btn-menu-toggle:not(.playback-rate).menu-open{background-color:hsla(207,4%,46%,.2)!important;color:#fff}.media-viewer-whole.hide-caption .media-viewer-caption{opacity:0!important;pointer-events:none}}.media-viewer-whole.is-zooming .media-viewer-caption,.media-viewer-whole.is-zooming .media-viewer-switcher .tgico-down{opacity:0!important;pointer-events:none}.media-viewer-whole.highlight-switchers .media-viewer-switcher>span{opacity:1}.media-viewer-whole.no-forwards .canvas-thumbnail,.media-viewer-whole.no-forwards img{pointer-events:none}.media-viewer-whole.no-forwards .media-viewer-caption{-webkit-user-select:none;-moz-user-select:none;user-select:none}.media-viewer-movers{bottom:0;left:0;position:absolute;right:0;top:0;transform:translate3d(1,1,0) scale(1);transform-origin:0 0;will-change:transform;z-index:4}body.animation-level-2 .media-viewer-movers{transition:transform var(--open-duration)}.tgico-zoom:before{content:\"\"}.tgico-zoom.zoom-in:before{content:\"\"}.zoom-container{align-items:center;background-color:rgba(0,0,0,.4);border-radius:12px;bottom:1.25rem;display:flex;height:3.375rem;justify-content:space-between;left:50%;opacity:1;padding:.5rem;position:absolute;transform:translateX(-50%);width:17.125rem;z-index:5}body.animation-level-2 .zoom-container{transition:opacity var(--open-duration)}.zoom-container .btn-icon{color:#fff}.zoom-container .btn-icon.inactive{opacity:.4;pointer-events:none}.zoom-container .progress-line{--color:#fff;--height:2px;flex:1 1 auto;margin:0 1px}.zoom-container .progress-line:before{opacity:1}.media-viewer-whole:not(.active) .zoom-container,.zoom-container:not(.is-visible){opacity:0;pointer-events:none}.zoom-container.is-visible{opacity:1}.zoom-container.is-visible~.media-viewer-caption{opacity:0!important;pointer-events:none}.zoom-container.is-visible~.media-viewer-movers .default__button--big{opacity:0!important}.overlays{background-color:rgba(0,0,0,.2);height:100%;left:0;opacity:0;position:fixed!important;top:0;transition:opacity var(--open-duration) 0s,visibility 0s var(--open-duration);visibility:hidden;width:100%;z-index:4}.emoji-dropdown{background:var(--surface-color);display:flex;flex:1 1 auto;flex-direction:column;height:min(282px,calc(var(--vh)*100 - 135px));max-height:100%;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--esg-width)}@media only screen and (min-height:570px)and (min-width:601px){.emoji-dropdown{-webkit-backdrop-filter:var(--menu-backdrop-filter);backdrop-filter:var(--menu-backdrop-filter);background-color:var(--menu-background-color);border-radius:1.25rem;bottom:5.125rem;box-shadow:0 5px 10px 5px rgba(16,35,47,.14);height:26.25rem;left:.8125rem;max-height:26.25rem;opacity:0;position:absolute!important;transform:scale(0);transform-origin:0 100%;transition:transform var(--esg-transition),opacity var(--esg-transition);z-index:3}.emoji-dropdown.active{opacity:1;transform:scale(1)}body.animation-level-0 .emoji-dropdown{transition:none}}.emoji-dropdown .emoji-container{height:100%;max-width:100%;overflow:hidden;width:100%}.emoji-dropdown .emoji-tabs{border:none;border-top:1px solid var(--border-color);justify-content:center}.emoji-dropdown .emoji-tabs:after{content:none}.emoji-dropdown .emoji-tabs-search{left:0;margin-left:.5rem!important;position:absolute}.emoji-dropdown .emoji-tabs-delete{margin-right:.5rem!important;position:absolute;right:0}.emoji-dropdown .emoji-tabs .menu-horizontal-div-item{margin:0 .75rem}.emoji-dropdown .tabs-container{height:100%}.emoji-dropdown .stickers-padding .category-items{gap:.25rem;padding:0 .1875rem}.emoji-dropdown #content-gifs .scrollable-y{padding:0 .1875rem}.emoji-dropdown .gifs-masonry{border-radius:10px;overflow:hidden}.emoticons-container{background-color:transparent;flex-direction:column;height:100%;min-height:100%}.emoticons-menu{--item-size:1.875rem;align-items:center;min-height:3.0625rem;padding:0 .3125rem;width:100%;z-index:4}.emoticons-menu,.emoticons-menu-wrapper{background-color:transparent;height:3.0625rem}.emoticons-menu-wrapper{border-bottom:1px solid var(--border-color);max-width:100%;padding:0;position:relative}.emoticons-menu:after{content:\" \";display:block;flex:0 0 auto;height:1px;width:.1875rem}.emoticons-menu .menu-horizontal-div-item{align-items:center;display:flex;flex:0 0 auto;font-size:1.5rem;height:var(--item-size);line-height:var(--item-size);margin:0 .3125rem;padding:0;width:var(--item-size)}.emoticons-menu .menu-horizontal-div-item.not-local{--item-size:2.375rem;border-radius:.25rem!important;padding:.25rem}.emoticons-menu .menu-horizontal-div-item.active{background-color:rgba(var(--primary-text-color-rgb),.06)!important}.emoticons-menu .menu-horizontal-div-item.active,html.no-touch .emoticons-menu .menu-horizontal-div-item:active,html.no-touch .emoticons-menu .menu-horizontal-div-item:hover{color:rgba(var(--primary-text-color-rgb),.8)!important}.emoticons-menu .menu-horizontal-div-item-padding{height:100%;position:relative;width:100%}.emoticons-menu .menu-horizontal-div-item.active:not(.tgico){background-color:var(--light-secondary-text-color)}.emoticons-menu .menu-horizontal-inner{border-radius:15px;flex:0 0 auto;margin:0 .3125rem;overflow:hidden;width:1.875rem}html.is-safari .emoticons-menu .menu-horizontal-inner{-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}body.animation-level-2 .emoticons-menu .menu-horizontal-inner{transition:width .2s ease-in-out}.emoticons-menu .menu-horizontal-inner-scroll{align-items:center;display:flex;height:100%;position:relative;width:8.5rem}.emoticons-menu .menu-horizontal-inner .menu-horizontal-div-item{margin:0!important;transform:scale(1)}body.animation-level-2 .emoticons-menu .menu-horizontal-inner .menu-horizontal-div-item{transition:transform .2s ease-in-out!important}.emoticons-menu .menu-horizontal-inner.active{background-color:rgba(var(--primary-text-color-rgb),.06)!important;width:8.5rem}.emoticons-menu .menu-horizontal-inner.active .menu-horizontal-div-item{transform:scale(.8)}.emoticons-menu .menu-horizontal-inner.active .menu-horizontal-div-item.active{background-color:transparent!important}.emoticons-menu .menu-horizontal-inner:not(.active){cursor:pointer}.emoticons-menu .menu-horizontal-inner:not(.active) .menu-horizontal-inner-scroll{pointer-events:none}.emoticons-menu .menu-horizontal-inner:not(.active) .menu-horizontal-div-item:first-child{pointer-events:all}.emoticons-content{flex:1;padding:0;position:relative}.emoticons-content .emoji-category{position:relative}.emoticons-content .sticky_sentinel--top{height:1px;top:0}.emoticons-content .category-title{color:rgba(var(--primary-text-color-rgb),.42);cursor:pointer;font-size:var(--font-size-16);font-weight:var(--font-weight-bold);line-height:1.1875rem;padding:.75rem .875rem .375rem;position:relative;text-align:center;width:100%}.emoticons-content .category-title .btn-icon{font-size:1.25rem;pointer-events:all;position:absolute;right:.5rem;top:50%;transform:translateY(-50%);z-index:1}.emoticons-content:not(.has-premium) .is-premium-set .category-title:before{content:\"\";line-height:inherit;margin-right:.125rem;vertical-align:middle}.emoji-padding .super-emojis{padding:0 .5rem}html:not(.is-safari):not(.is-ios) .scrollable::-webkit-scrollbar{height:0;opacity:0;width:0;width:.375rem}html:not(.is-safari):not(.is-ios) .scrollable::-webkit-scrollbar-thumb{height:0;width:0}html:not(.is-safari):not(.is-ios) ::-webkit-scrollbar-thumb{opacity:0;-webkit-transition:.2s ease-in-out;transition:.2s ease-in-out}html:not(.is-safari):not(.is-ios) ::-webkit-scrollbar-button{display:none;height:0;width:0}html:not(.is-safari):not(.is-ios) ::-webkit-scrollbar-corner{background-color:transparent}html:not(.is-safari):not(.is-ios) .scrollable:hover{scrollbar-color:var(--scrollbar-color) transparent}html:not(.is-safari):not(.is-ios) .scrollable:hover::-webkit-scrollbar{opacity:1}html:not(.is-safari):not(.is-ios) .scrollable:hover::-webkit-scrollbar-thumb{-webkit-backdrop-filter:blur(100);backdrop-filter:blur(100);background-color:var(--scrollbar-color);border-radius:10px;max-height:12.5rem;min-height:5rem;opacity:1}.no-scrollbar::-webkit-scrollbar,.scrollable-x::-webkit-scrollbar{display:none}.scrollable{-webkit-overflow-scrolling:touch;bottom:0;height:100%;left:0;max-height:100%;overflow-x:hidden;overflow-y:hidden;position:absolute;right:0;top:0;width:100%}.scrollable.scrollable-x{-ms-overflow-style:none;overflow-x:auto;scrollbar-width:none}.scrollable.scrollable-y{-ms-overflow-style:none;overflow-y:auto;overflow-y:overlay;scrollbar-color:transparent transparent;scrollbar-width:thin;transform:translateZ(0)}.scrollable.scrollable-y.scrollable-y-bordered{border-bottom:1px solid transparent;border-top:1px solid transparent}body.animation-level-2 .scrollable.scrollable-y.scrollable-y-bordered{transition:border-top-color var(--transition-standard-in),border-bottom-color var(--transition-standard-in)}.scrollable.scrollable-y.scrollable-y-bordered:not(.scrolled-top){border-top-color:var(--border-color)}.scrollable.scrollable-y.scrollable-y-bordered:not(.scrolled-bottom){border-bottom-color:var(--border-color)}.scrollable-padding{height:100%;min-width:100%}@keyframes scaleIn{0%{transform:scale(.2)}to{transform:scale(1)}}.selector{display:flex;flex-direction:column;height:100%;width:100%}.selector .selector-search-section{margin-bottom:0!important;padding:0!important;position:relative;z-index:1}.selector-search-container{flex:0 0 auto;max-height:132px;overflow:hidden;position:relative}.selector-search-container .scrollable{max-height:inherit;position:relative}.selector-search{display:flex;flex-flow:wrap;padding-left:1rem;padding-right:1rem;position:relative}.selector-search-input{border:none;flex:1 1 auto;outline:none}.selector-search .selector-search-input{padding:7px 0 19px}[dir=ltr] .selector-user{padding-right:17px}[dir=rtl] .selector-user{padding-left:17px}[dir=ltr] .selector-user{margin-left:-.25rem;margin-right:.75rem}[dir=rtl] .selector-user{margin-left:.75rem;margin-right:-.25rem}.selector-user{background-color:var(--light-secondary-text-color);border-radius:1.5rem;color:var(--primary-text-color);flex:0 0 auto;font-size:1rem;height:2rem;line-height:2rem;margin-bottom:7px;max-width:11.25rem;overflow:hidden;text-overflow:ellipsis;transition:opacity .2s,transform .2s,background-color .2s;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}body.animation-level-0 .selector-user{transition:none}html.no-touch .selector-user:active,html.no-touch .selector-user:hover{background-color:var(--light-danger-color);cursor:pointer}html.no-touch .selector-user:active .selector-user-avatar:after,html.no-touch .selector-user:hover .selector-user-avatar:after{opacity:1;transform:scaleX(-1) rotate(-90deg)}body:not(.animation-level-0) .selector-user.scale-in{animation:scaleIn .15s ease forwards}body:not(.animation-level-0) .selector-user.scale-out{animation:scaleIn .1s ease forwards;animation-direction:reverse}[dir=ltr] .selector-user-avatar{margin-right:8px}[dir=rtl] .selector-user-avatar{margin-left:8px}.selector-user-avatar{border-radius:50%!important;float:left;overflow:hidden;position:relative}.is-rtl .selector-user-avatar{float:right}html.is-safari .selector-user-avatar{-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}[dir=ltr] .selector-user-avatar:after{left:0}[dir=rtl] .selector-user-avatar:after{right:0}.selector-user-avatar:after{background-color:var(--danger-color);content:\"\";font-size:23px;height:100%;line-height:32px!important;opacity:0;position:absolute;top:0;transform:scaleX(-1) rotate(0deg);transition:opacity .2s,transform .2s;width:100%;z-index:2}body.animation-level-0 .selector-user-avatar:after{transition:none}.selector .chatlist-container{flex:1 1 auto;height:100%}.selector>hr{margin:0;padding:0}[dir=ltr] .selector .checkbox{padding-left:11px}[dir=rtl] .selector .checkbox{padding-right:11px}.selector .checkbox{margin-top:11px}.selector .checkbox-field{--offset-left:0!important;margin:0!important;padding:0!important;pointer-events:none;position:absolute!important;top:50%;transform:translateY(-50%);z-index:1}[dir=ltr] .selector .checkbox-field:first-child{margin-left:.6875rem;margin-right:1.6875rem}[dir=rtl] .selector .checkbox-field:first-child{margin-left:1.6875rem;margin-right:.6875rem}[dir=ltr] .selector .checkbox-field-round{right:1.125rem}[dir=rtl] .selector .checkbox-field-round{left:1.125rem}.selector .checkbox-field-round{--size:1.25rem}.selector .checkbox-field-round .checkbox-box-border{z-index:auto}.selector .checkbox-field-round .checkbox-box-check{--offset:6px}[dir=ltr] .selector-square .checkbox-field{left:1.25rem!important}[dir=rtl] .selector-square .checkbox-field{right:1.25rem!important}[dir=ltr] .selector-square .chatlist-chat.row-with-padding{padding-left:7.5rem!important}[dir=rtl] .selector-square .chatlist-chat.row-with-padding{padding-right:7.5rem!important}[dir=ltr] .selector-square .dialog-avatar{margin-left:3rem!important}[dir=rtl] .selector-square .dialog-avatar{margin-right:3rem!important}.gifs-masonry{grid-gap:.125rem;display:grid;gap:.125rem;grid-auto-rows:1fr;grid-template-columns:repeat(3,1fr)}.gifs-masonry .gif img,.gifs-masonry .gif video{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.gifs-masonry .gif img{left:0;position:absolute;top:0}.gifs-masonry .preloader-container{z-index:2}.preloader-circular{animation:rotate 1s linear infinite;bottom:0;height:100%;left:0;margin:auto;position:absolute;right:0;top:0;transform-origin:center center}.preloader-path{stroke-dasharray:93.6375,124.85;stroke-dashoffset:0;stroke-linecap:round;stroke:#fff;stroke-width:3}.preloader-container{bottom:0;cursor:pointer;display:flex;height:54px;left:0;margin:auto;opacity:0;overflow:hidden;position:absolute;right:0;top:0;transform:scale(0);width:54px}body:not(.animation-level-0) .preloader-container{transition:opacity .2s ease-in-out,transform .2s ease-in-out}.preloader-container.is-visible:not(.backwards){opacity:1;transform:scale(1)}.preloader-container{--color:#fff}.preloader-container .you-spin-me-round{height:100%;width:100%}.preloader-container .preloader-circular{animation:none;background-color:rgba(0,0,0,.3);border-radius:50%;height:100%;width:100%}.preloader-container .preloader-path-new{stroke-dasharray:5,149.82;stroke-dashoffset:0;stroke-linecap:round;stroke:var(--color);stroke-width:2}body.animation-level-2 .preloader-container.is-visible.animating .you-spin-me-round,body.animation-level-2 .preloader-container.is-visible:not(.manual) .you-spin-me-round{animation:rotate 2s linear infinite}body.animation-level-2 .preloader-container.is-visible.animating .preloader-path-new,body.animation-level-2 .preloader-container.is-visible:not(.manual) .preloader-path-new{transition:stroke-dasharray .2s ease-in-out,stroke-width .2s ease-in-out}.preloader-container.preloader-swing{cursor:default}.preloader-container.preloader-swing .you-spin-me-round{animation:rotate 1s linear infinite!important}.preloader-container.preloader-swing .preloader-path-new{stroke-dasharray:112.36,149.82}.preloader-container.preloader-swing.preloader-streamable .preloader-path-new{stroke-dasharray:88.95,118.61}.preloader-container .preloader-close,.preloader-container .preloader-download{bottom:0;color:var(--color);height:56%;left:0;margin:auto;opacity:1;position:absolute;right:0;top:0;width:56%}body.animation-level-2 .preloader-container .preloader-close,body.animation-level-2 .preloader-container .preloader-download{transition:opacity .2s ease-in-out}.preloader-container .preloader-close path,.preloader-container .preloader-download path{fill:var(--color)}html.no-touch .preloader-container .preloader-close:active,html.no-touch .preloader-container .preloader-close:hover,html.no-touch .preloader-container .preloader-download:active,html.no-touch .preloader-container .preloader-download:hover{background:none}.preloader-container.manual .preloader-close,.preloader-container:not(.manual) .preloader-download{opacity:0}.preloader-container.manual .preloader-path-new{stroke-width:0}.preloader-container .preloader-download{height:1.5rem;width:1.5rem}.preloader-container.preloader-streamable,.preloader-container.preloader-streamable svg{cursor:pointer!important}.preloader-container.preloader-streamable circle{stroke-width:2.5!important}.preloader-container.preloader-streamable:after{background-color:var(--color);border-radius:.125rem;content:\"\";height:.8125rem;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:.8125rem}.preloader-container.preloader-transparent .preloader-circular{background-color:transparent}.preloader-container.preloader-bold .preloader-path-new{stroke-width:3.5}@keyframes rotate{to{transform:rotate(1turn)}}@keyframes dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes dashNew{0%{stroke-dasharray:1,149.82;stroke-dashoffset:0}50%{stroke-dasharray:112.36,149.82;stroke-dashoffset:-38}to{stroke-dasharray:112.36,149.82;stroke-dashoffset:-149.82}}@keyframes dashNewStreamable{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-237%}}.rp{position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.btn-corner.rp .c-ripple,.btn-menu-toggle.rp .c-ripple,.menu-horizontal-div-item.rp .c-ripple,.pinned-container-wrapper.rp .c-ripple,.rp-overflow .c-ripple{border-radius:inherit;height:100%;overflow:hidden;width:100%}.btn-corner.rp .c-ripple__circle,.btn-menu-toggle.rp .c-ripple__circle,.menu-horizontal-div-item.rp .c-ripple__circle,.pinned-container-wrapper.rp .c-ripple__circle,.rp-overflow .c-ripple__circle{overflow:hidden}.c-ripple{--ripple-duration:.7s;bottom:0;left:0;position:absolute;right:0;top:0}html.is-safari .c-ripple:not(:empty){border-radius:inherit;-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}.c-ripple__circle{animation:ripple-effect .7s forwards;background-color:var(--ripple-color);border-radius:50%;display:block;pointer-events:none;position:absolute;transform:scale(0);transition:opacity .35s,background-color .35s}.c-ripple__circle.hiding,.c-ripple__square.hiding{opacity:0}@media only screen and (max-width:925px){.c-ripple{--ripple-duration:.4s}.c-ripple__circle{animation-duration:.4s;animation-name:ripple-effect-handhelds;transition-duration:.3s}}@keyframes ripple-effect{0%{transform:scale(0)}to{transform:scale(2)}}@keyframes ripple-effect-handhelds{0%{transform:scale(.27)}to{transform:scale(2)}}.avatar-like{--size:54px;--multiplier:1;color:#fff;font-size:calc(1.25rem/var(--multiplier));font-weight:var(--font-weight-bold);height:var(--size);line-height:var(--size)!important;text-align:center;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--size)}avatar-element{--color-top:var(--avatar-color-top);--color-bottom:var(--avatar-color-bottom);background:linear-gradient(var(--color-top),var(--color-bottom));border-radius:50%}avatar-element[data-color=red]{--color-top:var(--peer-avatar-red-top);--color-bottom:var(--peer-avatar-red-bottom)}avatar-element[data-color=orange]{--color-top:var(--peer-avatar-orange-top);--color-bottom:var(--peer-avatar-orange-bottom)}avatar-element[data-color=violet]{--color-top:var(--peer-avatar-violet-top);--color-bottom:var(--peer-avatar-violet-bottom)}avatar-element[data-color=green]{--color-top:var(--peer-avatar-green-top);--color-bottom:var(--peer-avatar-green-bottom)}avatar-element[data-color=cyan]{--color-top:var(--peer-avatar-cyan-top);--color-bottom:var(--peer-avatar-cyan-bottom)}avatar-element[data-color=pink]{--color-top:var(--peer-avatar-pink-top);--color-bottom:var(--peer-avatar-pink-bottom)}avatar-element[data-color=blue]{--color-top:var(--peer-avatar-blue-top);--color-bottom:var(--peer-avatar-blue-bottom)}avatar-element.tgico:before{font-size:calc(32px/var(--multiplier))}avatar-element.tgico-calendarfilter:before{font-size:calc(36px/var(--multiplier))}avatar-element.tgico-saved:before{font-size:calc(30px/var(--multiplier))!important}avatar-element.tgico-reply_filled:before{font-size:calc(28px/var(--multiplier))!important}avatar-element.tgico-deletedaccount{--color-top:var(--peer-avatar-archive-top);--color-bottom:var(--peer-avatar-archive-bottom);overflow:hidden}avatar-element.tgico-deletedaccount:before{font-size:calc(30px/var(--multiplier))}avatar-element:before{line-height:inherit!important}avatar-element.media-container{position:relative}avatar-element img{border-radius:inherit!important;display:block;height:var(--size)!important;width:var(--size)!important}avatar-element img.fade-in{animation:fade-in-opacity .2s ease forwards}avatar-element img.emoji{height:calc(1.125rem/var(--multiplier))!important;vertical-align:middle!important;width:calc(1.125rem/var(--multiplier))!important}avatar-element.is-forum{border-radius:var(--avatar-border-radius-forum)}avatar-element.is-topic{background:none;border-radius:0;position:relative}avatar-element.is-topic .topic-icon{--size:inherit}avatar-element.is-online{position:relative}avatar-element.is-online:after{background-color:var(--avatar-online-color);border:2px solid var(--surface-color);border-radius:50%;content:\" \";display:block;height:14px;left:2.4375rem;position:absolute;top:2.4375rem;width:14px}avatar-element[clickable]{cursor:pointer}avatar-element.avatar-relative{position:relative}avatar-element.avatar-120{--size:120px;--multiplier:.45}avatar-element.avatar-100{--size:100px;--multiplier:.54}avatar-element.avatar-48{--size:48px;--multiplier:1.125}avatar-element.avatar-46{--size:46px;--multiplier:1.173913}avatar-element.avatar-44{--size:44px;--multiplier:1.227272}avatar-element.avatar-42{--size:42px;--multiplier:1.285714}avatar-element.avatar-40{--size:40px;--multiplier:1.35}avatar-element.avatar-36{--size:36px;--multiplier:1.5}avatar-element.avatar-35{--size:35px;--multiplier:1.542857}avatar-element.avatar-34{--size:34px;--multiplier:1.588235}avatar-element.avatar-32{--size:32px;--multiplier:1.6875}avatar-element.avatar-30{--size:30px;--multiplier:1.6875}avatar-element.avatar-26{--size:26px;--multiplier:2.076923}avatar-element.avatar-24{--size:24px;--multiplier:2.25}avatar-element.avatar-22{--size:22px;--multiplier:2.454545}avatar-element.avatar-18{--size:18px;--multiplier:3}avatar-element.avatar-16{--size:16px;--multiplier:3.375}.avatar-relative .avatar-photo{left:0;position:absolute;top:0}.avatar-full{align-items:center;border-radius:inherit;display:inline-flex;height:100%;justify-content:center;position:absolute;width:100%}.avatar-full .avatar-photo{height:100%!important;-o-object-fit:cover;object-fit:cover;width:100%!important}.document{--background-color:var(--primary-color);height:70px}.document .media-photo{border-radius:inherit}.document .media-photo.thumbnail{left:0}.document-ico{background-color:var(--background-color);border-radius:.375rem;line-height:1;text-align:center}html.is-safari .document-ico{-webkit-mask-image:-webkit-radial-gradient(circle,#fff 100%,#000 0)}.document-ico-text{opacity:0}body.animation-level-2 .document-ico-text{transition:opacity .2s ease-in-out}.document:not(.document-with-thumb) .document-ico{padding:1.5625rem .25rem 0}@media only screen and (max-width:600px){.document:not(.document-with-thumb) .document-ico{font-size:14px;padding:1.5rem 0 0}.document:not(.document-with-thumb) .document-ico:after{--size:.875rem}}.document-ico:after{--size:1.125rem;border-bottom-color:rgba(0,0,0,.25);border-bottom-left-radius:.25rem;border-left-color:rgba(0,0,0,.25);border-right-color:var(--message-background-color);border-style:solid;border-top-color:var(--message-background-color);border-width:calc(var(--size)/2);content:\"\";display:block;position:absolute;right:0;top:0}body.animation-level-2 .document-ico:after{transition:border-width .2s ease-in-out}html.no-touch .document:not(.downloaded):active .document-ico:after,html.no-touch .document:not(.downloaded):hover .document-ico:after{border-width:0}html.no-touch .document:not(.downloaded):active .document-ico-text,html.no-touch .document:not(.downloaded):hover .document-ico-text{opacity:0}html.no-touch .document:not(.downloaded):active .preloader-container,html.no-touch .document:not(.downloaded):hover .preloader-container{opacity:1!important}.document:not(.downloading) .document-ico-text{opacity:1}.document:not(.downloading) .preloader-container{opacity:0!important}.document.downloading .document-ico:after{border-width:0}.document-ico{background-size:contain;font-size:1.125rem}.document-ico,.document-name,.document-size{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.document.ext-zip{--background-color:#fb8c00}.document.ext-pdf{--background-color:#df3f40}.document.ext-apk{--background-color:#43a047}.document.document-with-thumb{--background-color:#fff}.document.document-with-thumb .document-ico:after{display:none}.document.document-with-thumb .document-download{background-color:rgba(0,0,0,.2);border-radius:.375rem}.document.document-with-thumb .preloader-circular{transition:background-color .2s}.document.document-with-thumb .preloader-container:not(.manual) .preloader-circular{background-color:rgba(0,0,0,.3)!important}.document-thumb{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.document-name{font-size:var(--font-size-16);font-weight:var(--font-weight-bold);line-height:var(--line-height-16);white-space:nowrap}.document-size{color:var(--secondary-text-color);font-size:var(--font-size-14);line-height:var(--line-height-14);pointer-events:none;position:relative}.document .preloader-container{height:2.5rem;width:2.5rem}@media only screen and (max-width:600px){.document .preloader-container{height:1.625rem;width:1.625rem}}.document .preloader-circular{background-color:transparent!important}.document .preloader-path-new{stroke-width:2.5}[dir=ltr] .audio,[dir=ltr] .document{padding-left:var(--padding-left)}[dir=rtl] .audio,[dir=rtl] .document{padding-right:var(--padding-left)}.audio,.document{--padding:0px;--icon-size:3.375rem;--icon-margin:.875rem;--padding-left:calc(var(--icon-size) + var(--icon-margin) + var(--padding));cursor:pointer;display:flex;flex-direction:column;justify-content:center;padding:var(--padding);-webkit-user-select:none;-moz-user-select:none;user-select:none}[dir=ltr] .audio-download,[dir=ltr] .audio-ico,[dir=ltr] .document-download,[dir=ltr] .document-ico{margin-left:calc((var(--padding-left) - var(--padding))*-1)}[dir=rtl] .audio-download,[dir=rtl] .audio-ico,[dir=rtl] .document-download,[dir=rtl] .document-ico{margin-right:calc((var(--padding-left) - var(--padding))*-1)}.audio-download,.audio-ico,.document-download,.document-ico{color:#fff;height:var(--icon-size);position:absolute;width:var(--icon-size)}.audio-download,.document-download{align-items:center;cursor:pointer;display:flex;font-size:1.5rem;justify-content:center;opacity:1;transition:opacity .2s ease-in-out;z-index:1}.audio-download.downloaded,.document-download.downloaded{opacity:0}.audio-description,.document-description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.audio:not(.corner-download) .preloader-container:not(.preloader-streamable),.document:not(.corner-download) .preloader-container:not(.preloader-streamable){transform:scale(1)!important}.audio .checkbox-field-round,.document .checkbox-field-round{--margin-top:.25rem;--margin-left:.125rem;left:auto;margin-left:calc(var(--padding-left)*-1 + var(--icon-size) - var(--size) + var(--margin-left));margin-top:calc(var(--icon-size) - var(--size) + var(--margin-top));top:auto}.audio-ico{display:flex;justify-content:center}.audio-ico.tgico-largeplay:before{margin-right:-1px}.audio .preloader-circular{background-color:transparent!important}.audio .preloader-container:not(.preloader-streamable){height:100%;width:100%}.audio{--icon-size:3rem;--icon-margin:.5625rem;height:var(--icon-size);overflow:visible!important}.audio-download,.audio-toggle{align-items:center;background-color:var(--primary-color);border-radius:50%}.audio.corner-download .audio-download{background:none;display:flex!important;height:1.375rem;left:57.5%;margin:0!important;top:57.5%;width:1.375rem}.audio.corner-download .preloader-container{background-color:var(--primary-color);border-radius:inherit}.audio.corner-download .preloader-path-new{stroke-width:.25rem}.audio-play-icon{border-radius:inherit;bottom:0;left:0;max-height:100%;max-width:100%;overflow:hidden;position:absolute;right:0;top:0;transform:rotate(-119deg)}body.animation-level-2 .audio-play-icon{transition:transform .25s ease-in-out}.audio-toggle .part{background-color:#fff;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}body.animation-level-2 .audio-toggle .part{transition:-webkit-clip-path .25s ease-in-out;transition:clip-path .25s ease-in-out;transition:clip-path .25s ease-in-out,-webkit-clip-path .25s ease-in-out}@media only screen and (min-width:601px){.audio-toggle .part{height:140px;width:140px}}@media only screen and (max-width:600px){.audio-toggle .part{height:92px;width:92px}}.audio-toggle .part.one{-webkit-clip-path:polygon(56.42249% 57.01763%,54.93283% 57.0175%,53.00511% 57.01738%,50.83554% 57.01727%,48.62036% 57.01718%,46.55585% 57.01709%,44.83822% 57.01702%,43.66373% 57.01698%,43.22863% 57.01696%,42.86372% 57.01904%,42.56988% 57.01621%,42.3402% 56.99486%,42.16778% 56.94152%,42.0457% 56.84267%,41.96705% 56.68478%,41.92493% 56.45432%,41.91246% 56.13777%,41.91258% 55.76282%,41.9129% 55.37058%,41.91335% 54.96757%,41.91387% 54.56032%,41.91439% 54.15537%,41.91485% 53.75926%,41.91517% 53.3785%,41.91529% 53.01965%,41.94275% 52.72355%,42.02117% 52.51653%,42.14465% 52.38328%,42.30727% 52.30854%,42.50308% 52.27699%,42.72619% 52.27341%,42.97065% 52.28248%,43.23056% 52.2889%,43.94949% 52.28896%,45.45083% 52.28912%,47.47445% 52.28932%,49.76027% 52.28957%,52.04818% 52.28981%,54.07805% 52.29003%,55.5898% 52.29019%,56.32332% 52.29024%,56.58221% 52.28816%,56.83726% 52.28948%,57.07897% 52.30593%,57.29794% 52.34898%,57.48468% 52.43029%,57.62978% 52.56146%,57.72375% 52.7541%,57.75718% 53.01981%,57.75713% 53.37763%,57.75699% 53.81831%,57.75679% 54.31106%,57.75657% 54.82507%,57.75635% 55.32958%,57.75615% 55.79377%,57.75601% 56.18684%,57.75596% 56.47801%,57.7549% 56.50122%,57.74034% 56.5624%,57.6955% 56.64887%,57.60334% 56.748%,57.44691% 56.84712%,57.20925% 56.93358%,56.87342% 56.99471%);clip-path:polygon(56.42249% 57.01763%,54.93283% 57.0175%,53.00511% 57.01738%,50.83554% 57.01727%,48.62036% 57.01718%,46.55585% 57.01709%,44.83822% 57.01702%,43.66373% 57.01698%,43.22863% 57.01696%,42.86372% 57.01904%,42.56988% 57.01621%,42.3402% 56.99486%,42.16778% 56.94152%,42.0457% 56.84267%,41.96705% 56.68478%,41.92493% 56.45432%,41.91246% 56.13777%,41.91258% 55.76282%,41.9129% 55.37058%,41.91335% 54.96757%,41.91387% 54.56032%,41.91439% 54.15537%,41.91485% 53.75926%,41.91517% 53.3785%,41.91529% 53.01965%,41.94275% 52.72355%,42.02117% 52.51653%,42.14465% 52.38328%,42.30727% 52.30854%,42.50308% 52.27699%,42.72619% 52.27341%,42.97065% 52.28248%,43.23056% 52.2889%,43.94949% 52.28896%,45.45083% 52.28912%,47.47445% 52.28932%,49.76027% 52.28957%,52.04818% 52.28981%,54.07805% 52.29003%,55.5898% 52.29019%,56.32332% 52.29024%,56.58221% 52.28816%,56.83726% 52.28948%,57.07897% 52.30593%,57.29794% 52.34898%,57.48468% 52.43029%,57.62978% 52.56146%,57.72375% 52.7541%,57.75718% 53.01981%,57.75713% 53.37763%,57.75699% 53.81831%,57.75679% 54.31106%,57.75657% 54.82507%,57.75635% 55.32958%,57.75615% 55.79377%,57.75601% 56.18684%,57.75596% 56.47801%,57.7549% 56.50122%,57.74034% 56.5624%,57.6955% 56.64887%,57.60334% 56.748%,57.44691% 56.84712%,57.20925% 56.93358%,56.87342% 56.99471%)}.audio-toggle .part.two{-webkit-clip-path:polygon(56.42249% 42.44625%,54.93283% 42.44637%,53.00511% 42.44649%,50.83554% 42.4466%,48.62036% 42.4467%,46.55585% 42.44679%,44.83822% 42.44685%,43.66373% 42.4469%,43.22863% 42.44691%,42.86372% 42.44483%,42.56988% 42.44767%,42.3402% 42.46902%,42.16778% 42.52235%,42.0457% 42.6212%,41.96705% 42.77909%,41.92493% 43.00956%,41.91246% 43.32611%,41.91258% 43.70105%,41.9129% 44.0933%,41.91335% 44.49631%,41.91387% 44.90355%,41.91439% 45.3085%,41.91485% 45.70462%,41.91517% 46.08537%,41.91529% 46.44422%,41.94275% 46.74032%,42.02117% 46.94735%,42.14465% 47.0806%,42.30727% 47.15534%,42.50308% 47.18688%,42.72619% 47.19047%,42.97065% 47.1814%,43.23056% 47.17497%,43.94949% 47.17491%,45.45083% 47.17476%,47.47445% 47.17455%,49.76027% 47.1743%,52.04818% 47.17406%,54.07805% 47.17384%,55.5898% 47.17369%,56.32332% 47.17363%,56.58221% 47.17571%,56.83726% 47.17439%,57.07897% 47.15795%,57.29794% 47.1149%,57.48468% 47.03359%,57.62978% 46.90242%,57.72375% 46.70977%,57.75718% 46.44406%,57.75713% 46.08625%,57.75699% 45.64557%,57.75679% 45.15282%,57.75657% 44.6388%,57.75635% 44.1343%,57.75615% 43.6701%,57.75601% 43.27703%,57.75596% 42.98586%,57.7549% 42.96265%,57.74034% 42.90148%,57.6955% 42.815%,57.60334% 42.71587%,57.44691% 42.61675%,57.20925% 42.53029%,56.87342% 42.46916%);clip-path:polygon(56.42249% 42.44625%,54.93283% 42.44637%,53.00511% 42.44649%,50.83554% 42.4466%,48.62036% 42.4467%,46.55585% 42.44679%,44.83822% 42.44685%,43.66373% 42.4469%,43.22863% 42.44691%,42.86372% 42.44483%,42.56988% 42.44767%,42.3402% 42.46902%,42.16778% 42.52235%,42.0457% 42.6212%,41.96705% 42.77909%,41.92493% 43.00956%,41.91246% 43.32611%,41.91258% 43.70105%,41.9129% 44.0933%,41.91335% 44.49631%,41.91387% 44.90355%,41.91439% 45.3085%,41.91485% 45.70462%,41.91517% 46.08537%,41.91529% 46.44422%,41.94275% 46.74032%,42.02117% 46.94735%,42.14465% 47.0806%,42.30727% 47.15534%,42.50308% 47.18688%,42.72619% 47.19047%,42.97065% 47.1814%,43.23056% 47.17497%,43.94949% 47.17491%,45.45083% 47.17476%,47.47445% 47.17455%,49.76027% 47.1743%,52.04818% 47.17406%,54.07805% 47.17384%,55.5898% 47.17369%,56.32332% 47.17363%,56.58221% 47.17571%,56.83726% 47.17439%,57.07897% 47.15795%,57.29794% 47.1149%,57.48468% 47.03359%,57.62978% 46.90242%,57.72375% 46.70977%,57.75718% 46.44406%,57.75713% 46.08625%,57.75699% 45.64557%,57.75679% 45.15282%,57.75657% 44.6388%,57.75635% 44.1343%,57.75615% 43.6701%,57.75601% 43.27703%,57.75596% 42.98586%,57.7549% 42.96265%,57.74034% 42.90148%,57.6955% 42.815%,57.60334% 42.71587%,57.44691% 42.61675%,57.20925% 42.53029%,56.87342% 42.46916%)}.audio-toggle.playing .audio-play-icon{transform:rotate(-90deg)}@media only screen and (min-width:601px){.audio-toggle:not(.playing) .part{height:136px;width:136px}}@media only screen and (max-width:600px){.audio-toggle:not(.playing) .part{height:92px;width:92px}}.audio-toggle:not(.playing) .part.one{-webkit-clip-path:polygon(43.77666% 55.85251%,43.77874% 55.46331%,43.7795% 55.09177%,43.77934% 54.74844%,43.77855% 54.44389%,43.77741% 54.18863%,43.77625% 53.99325%,43.77533% 53.86828%,43.77495% 53.82429%,43.77518% 53.55329%,43.7754% 53.2823%,43.77563% 53.01131%,43.77585% 52.74031%,43.77608% 52.46932%,43.7763% 52.19832%,43.77653% 51.92733%,43.77675% 51.65633%,43.77653% 51.38533%,43.7763% 51.11434%,43.77608% 50.84334%,43.77585% 50.57235%,43.77563% 50.30136%,43.7754% 50.03036%,43.77518% 49.75936%,43.77495% 49.48837%,44.48391% 49.4885%,45.19287% 49.48865%,45.90183% 49.48878%,46.61079% 49.48892%,47.31975% 49.48906%,48.0287% 49.4892%,48.73766% 49.48934%,49.44662% 49.48948%,50.72252% 49.48934%,51.99842% 49.4892%,53.27432% 49.48906%,54.55022% 49.48892%,55.82611% 49.48878%,57.10201% 49.48865%,58.3779% 49.4885%,59.6538% 49.48837%,59.57598% 49.89151%,59.31883% 50.28598%,58.84686% 50.70884%,58.12456% 51.19714%,57.11643% 51.78793%,55.78697% 52.51828%,54.10066% 53.42522%,52.02202% 54.54581%,49.96525% 55.66916%,48.3319% 56.57212%,47.06745% 57.27347%,46.11739% 57.79191%,45.42719% 58.14619%,44.94235% 58.35507%,44.60834% 58.43725%,44.37066% 58.41149%,44.15383% 58.27711%,43.99617% 58.0603%,43.88847% 57.77578%,43.82151% 57.43825%,43.78608% 57.06245%,43.77304% 56.66309%,43.773% 56.25486%);clip-path:polygon(43.77666% 55.85251%,43.77874% 55.46331%,43.7795% 55.09177%,43.77934% 54.74844%,43.77855% 54.44389%,43.77741% 54.18863%,43.77625% 53.99325%,43.77533% 53.86828%,43.77495% 53.82429%,43.77518% 53.55329%,43.7754% 53.2823%,43.77563% 53.01131%,43.77585% 52.74031%,43.77608% 52.46932%,43.7763% 52.19832%,43.77653% 51.92733%,43.77675% 51.65633%,43.77653% 51.38533%,43.7763% 51.11434%,43.77608% 50.84334%,43.77585% 50.57235%,43.77563% 50.30136%,43.7754% 50.03036%,43.77518% 49.75936%,43.77495% 49.48837%,44.48391% 49.4885%,45.19287% 49.48865%,45.90183% 49.48878%,46.61079% 49.48892%,47.31975% 49.48906%,48.0287% 49.4892%,48.73766% 49.48934%,49.44662% 49.48948%,50.72252% 49.48934%,51.99842% 49.4892%,53.27432% 49.48906%,54.55022% 49.48892%,55.82611% 49.48878%,57.10201% 49.48865%,58.3779% 49.4885%,59.6538% 49.48837%,59.57598% 49.89151%,59.31883% 50.28598%,58.84686% 50.70884%,58.12456% 51.19714%,57.11643% 51.78793%,55.78697% 52.51828%,54.10066% 53.42522%,52.02202% 54.54581%,49.96525% 55.66916%,48.3319% 56.57212%,47.06745% 57.27347%,46.11739% 57.79191%,45.42719% 58.14619%,44.94235% 58.35507%,44.60834% 58.43725%,44.37066% 58.41149%,44.15383% 58.27711%,43.99617% 58.0603%,43.88847% 57.77578%,43.82151% 57.43825%,43.78608% 57.06245%,43.77304% 56.66309%,43.773% 56.25486%)}.audio-toggle:not(.playing) .part.two{-webkit-clip-path:polygon(43.77666% 43.83035%,43.77874% 44.21955%,43.7795% 44.59109%,43.77934% 44.93442%,43.77855% 45.23898%,43.77741% 45.49423%,43.77625% 45.68961%,43.77533% 45.81458%,43.77495% 45.85858%,43.77518% 46.12957%,43.7754% 46.40056%,43.77563% 46.67156%,43.77585% 46.94255%,43.77608% 47.21355%,43.7763% 47.48454%,43.77653% 47.75554%,43.77675% 48.02654%,43.77653% 48.29753%,43.7763% 48.56852%,43.77608% 48.83952%,43.77585% 49.11051%,43.77563% 49.38151%,43.7754% 49.65251%,43.77518% 49.9235%,43.77495% 50.1945%,44.48391% 50.19436%,45.19287% 50.19422%,45.90183% 50.19408%,46.61079% 50.19394%,47.31975% 50.1938%,48.0287% 50.19366%,48.73766% 50.19353%,49.44662% 50.19338%,50.72252% 50.19353%,51.99842% 50.19366%,53.27432% 50.1938%,54.55022% 50.19394%,55.82611% 50.19408%,57.10201% 50.19422%,58.3779% 50.19436%,59.6538% 50.1945%,59.57598% 49.79136%,59.31883% 49.39688%,58.84686% 48.97402%,58.12456% 48.48572%,57.11643% 47.89493%,55.78697% 47.16458%,54.10066% 46.25764%,52.02202% 45.13705%,49.96525% 44.01371%,48.3319% 43.11074%,47.06745% 42.4094%,46.11739% 41.89096%,45.42719% 41.53667%,44.94235% 41.3278%,44.60834% 41.24561%,44.37066% 41.27137%,44.15383% 41.40575%,43.99617% 41.62256%,43.88847% 41.90709%,43.82151% 42.24461%,43.78608% 42.62041%,43.77304% 43.01978%,43.773% 43.428%);clip-path:polygon(43.77666% 43.83035%,43.77874% 44.21955%,43.7795% 44.59109%,43.77934% 44.93442%,43.77855% 45.23898%,43.77741% 45.49423%,43.77625% 45.68961%,43.77533% 45.81458%,43.77495% 45.85858%,43.77518% 46.12957%,43.7754% 46.40056%,43.77563% 46.67156%,43.77585% 46.94255%,43.77608% 47.21355%,43.7763% 47.48454%,43.77653% 47.75554%,43.77675% 48.02654%,43.77653% 48.29753%,43.7763% 48.56852%,43.77608% 48.83952%,43.77585% 49.11051%,43.77563% 49.38151%,43.7754% 49.65251%,43.77518% 49.9235%,43.77495% 50.1945%,44.48391% 50.19436%,45.19287% 50.19422%,45.90183% 50.19408%,46.61079% 50.19394%,47.31975% 50.1938%,48.0287% 50.19366%,48.73766% 50.19353%,49.44662% 50.19338%,50.72252% 50.19353%,51.99842% 50.19366%,53.27432% 50.1938%,54.55022% 50.19394%,55.82611% 50.19408%,57.10201% 50.19422%,58.3779% 50.19436%,59.6538% 50.1945%,59.57598% 49.79136%,59.31883% 49.39688%,58.84686% 48.97402%,58.12456% 48.48572%,57.11643% 47.89493%,55.78697% 47.16458%,54.10066% 46.25764%,52.02202% 45.13705%,49.96525% 44.01371%,48.3319% 43.11074%,47.06745% 42.4094%,46.11739% 41.89096%,45.42719% 41.53667%,44.94235% 41.3278%,44.60834% 41.24561%,44.37066% 41.27137%,44.15383% 41.40575%,43.99617% 41.62256%,43.88847% 41.90709%,43.82151% 42.24461%,43.78608% 42.62041%,43.77304% 43.01978%,43.773% 43.428%)}.audio-download{z-index:2}.audio-waveform{height:100%}.audio-waveform-background .audio-waveform-bar{opacity:.3}html.no-touch .audio-waveform-background .audio-waveform-bar:active,html.no-touch .audio-waveform-background .audio-waveform-bar:hover{opacity:1}.audio-waveform-fake{bottom:0;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;width:0}.audio-waveform-container{align-items:center;display:flex;height:23px;margin-top:1px;position:relative}.audio-waveform-bar{fill:var(--primary-color)}.audio .audio-details{margin-bottom:0;margin-top:3px}.audio .audio-title{margin-bottom:-2px}[dir=ltr] body.is-premium .audio.can-transcribe{padding-right:2.25rem}[dir=rtl] body.is-premium .audio.can-transcribe{padding-left:2.25rem}body.is-premium .audio.can-transcribe .audio-to-text-button{display:flex}.audio .audio-to-text-button{align-items:center;align-self:flex-end;background:var(--light-filled-message-primary-color);border-radius:.3125rem;color:var(--message-primary-color);display:none;font-size:1.1875rem;height:1.5rem;justify-content:center;margin-right:-2.25rem;margin-top:-1rem;overflow:hidden;position:absolute;width:-moz-max-content;width:max-content;width:2rem}html.no-touch .audio .audio-to-text-button:active:after,html.no-touch .audio .audio-to-text-button:hover:after{background-color:var(--message-primary-color);border-radius:inherit;bottom:0;content:\" \";left:0;opacity:.08;position:absolute;right:0;top:0}.audio .audio-to-text-button .loader{height:100%;left:0;opacity:0;position:absolute;top:0;transition:opacity .2s;width:100%}.audio .audio-to-text-button .loader.active{opacity:1}.audio .audio-to-text-button .loader .audio-transcribe-outline{height:100%;width:100%}@keyframes loading{0%{stroke-dashoffset:100}to{stroke-dashoffset:0}}.audio .audio-to-text-button .loader .audio-transcribe-outline-rect{animation:loading 1s ease-in-out infinite}.audio .part{height:112px!important;width:112px!important}@media only screen and (max-width:600px){.audio .part{height:100px!important;width:100px!important}}.audio-title{color:var(--primary-text-color);font-size:1rem}.audio-description:not(:empty):before{content:\" • \"}.audio-subtitle,.audio-time{color:var(--secondary-text-color);display:flex;font-size:.875rem}@media only screen and (max-width:600px){.audio-subtitle,.audio-time{font-size:.75rem}}.audio-subtitle,.audio-time,.audio-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.audio-subtitle{align-items:center}.audio-subtitle .audio-time{flex:0 0 auto;margin-right:.25rem}.audio-subtitle,.audio-title{margin-left:-1px}.audio-title,.audio:not(.audio-show-progress) .audio-subtitle{max-width:100%}.audio.is-voice .audio-time{align-items:center;line-height:1;margin-left:-1px;margin-top:7px}[dir=ltr] .audio.is-voice .progress-line{margin-left:0}[dir=rtl] .audio.is-voice .progress-line{margin-right:0}.audio.is-voice .progress-line{margin-top:4px;min-width:11.25rem}.audio.is-voice .progress-line__filled:after{opacity:0}@media only screen and (max-width:600px){.audio.is-voice .audio-time{margin-top:.3125rem}.audio.is-voice .audio-waveform-container{height:16px;margin-top:0}}.audio.is-voice.is-unread .audio-time:after{background-color:var(--primary-color);border-radius:50%;content:\" \";height:.5rem;margin-left:.375rem;width:.5rem}.audio.is-voice.is-unread:not(.is-out) .audio-toggle:not(.playing)+.audio-waveform-container .audio-waveform-background .audio-waveform-bar{opacity:1}.audio .progress-line{--height:2px;--border-radius:4px;--thumb-size:.75rem;flex:1 1 auto;margin:0 6px 0 5px}.audio-with-thumb .audio-play-icon{background-color:transparent;opacity:1;z-index:1}body.animation-level-2 .audio-with-thumb .audio-play-icon{transition:transform .25s ease-in-out,background-color .2s ease-in-out,opacity .2s ease-in-out}.audio-with-thumb .audio-play-icon .part{background-color:#fff!important}.audio-with-thumb .audio-play-icon:not(:last-child){background-color:rgba(0,0,0,.3)}.audio-with-thumb .media-photo{border-radius:inherit;height:inherit;-o-object-fit:cover;object-fit:cover;width:inherit}.audio-with-thumb:not(.corner-download) .audio-download{background-color:rgba(0,0,0,.3)}.audio-with-thumb:not(.corner-download).downloading .audio-play-icon{opacity:0}.quiz-hint{align-items:center;display:flex;justify-content:center;left:0;position:absolute;top:8px;transform:translate3d(0,calc(-100% - 10px),0);transition:transform .2s ease;width:100%}body.animation-level-0 .quiz-hint{transition:none}.quiz-hint.active{transform:translateZ(0)}[dir=ltr] .quiz-hint .container{text-align:left}[dir=rtl] .quiz-hint .container{text-align:right}.quiz-hint .container{align-items:center;background:rgba(0,0,0,.7);border-radius:12px;color:#fff;display:flex;flex-wrap:wrap;font-size:15px;line-height:1.5;max-width:400px;min-height:48px;overflow:hidden;padding:10px 18px 12px 50px;position:relative;text-align:center;width:auto}@media only screen and (max-width:600px){.quiz-hint .container{font-size:14px;margin:0 10px;padding:10px 18px 12px 54px}}.quiz-hint .container .text{word-break:break-word}.quiz-hint .container:before{content:\"\";font-size:1.5rem;left:15px;position:absolute;top:12px}.quiz-hint .container a{border-bottom:1px solid #fff;color:#fff}.peer-typing{margin-right:4px}.peer-typing-container{--color:var(--primary-color);color:var(--color)}.peer-typing-flex{align-items:center;display:flex}.peer-typing:not(.peer-typing-text):not(.peer-typing-choosing-sticker){display:inline-block;transform:translateY(-1px);vertical-align:middle}.peer-typing-text-dot{animation-duration:.6s;animation-iteration-count:infinite;animation-name:dotMiddle;animation-timing-function:linear;background-color:var(--color);border-radius:50%;display:inline-block;height:6px;margin:0 .5px;vertical-align:middle;width:6px}.peer-typing-text-dot:first-child{animation-name:dotFirst}.peer-typing-text-dot:last-child{animation-name:dotLast}.peer-typing-upload{border-radius:2px;height:5px;margin-right:.375rem;overflow:hidden;position:relative;width:13px}.peer-typing-upload:after,.peer-typing-upload:before{background-color:var(--color);border-radius:inherit;bottom:0;content:\" \";display:block;left:0;position:absolute;right:0;top:0}.peer-typing-upload:before{opacity:.3}.peer-typing-upload:after{animation:upload 1s ease-in-out infinite}.peer-typing-record{margin-right:.375rem}.peer-typing-record:before{animation:recordBlink 1.25s infinite;background-color:var(--color);border-radius:50%;content:\" \";display:block;height:6px;width:6px}.peer-typing-choosing-sticker{align-items:center;display:flex;flex:0 0 auto;height:16px;margin-right:.375rem}.peer-typing-choosing-sticker-eye{animation:eye 1.8s ease-in-out infinite;border:1px solid var(--color);border-radius:50%;display:inline-block;height:14px;margin:0 .0625rem;position:relative;vertical-align:middle;width:8px}.peer-typing-choosing-sticker-eye:before{animation:eye-move 1.8s ease-in-out infinite;background-color:var(--color);border-radius:50%;content:\" \";display:block;height:.25rem;position:absolute;top:50%;transform:translate(-1px,-50%);width:.25rem}@keyframes dotFirst{0%{opacity:.8;transform:scale(.6666666667)}50%{opacity:.8;transform:scale(.6666666667)}75%{opacity:1;transform:scale(1)}to{opacity:.8;transform:scale(.6666666667)}}@keyframes dotMiddle{0%{opacity:.9;transform:scale(.8333333333)}12.5%{opacity:.8;transform:scale(.6666666667)}62.5%{opacity:.8;transform:scale(.6666666667)}87.5%{opacity:1;transform:scale(1)}to{opacity:.9;transform:scale(.8333333333)}}@keyframes dotLast{0%{opacity:1;transform:scale(1)}25%{opacity:.8;transform:scale(.6666666667)}75%{opacity:.8;transform:scale(.6666666667)}to{opacity:1;transform:scale(1)}}@keyframes upload{0%{transform:translateX(-13px)}to{transform:translate(13px)}}@keyframes eye{0%{transform:scale(1.1) translateX(-.75px)}12.5%{transform:scale(1) translateX(0)}25%{transform:scale(1.1) translateX(.375px)}50%{transform:scale(1.1) translateX(.75px)}62.5%{transform:scale(1) translateX(0)}75%{transform:scale(1.1) translateX(-.375px)}to{transform:scale(1.1) translateX(-.75px)}}@keyframes eye-move{0%{transform:translate(-1px,-50%)}25%{transform:translate(3px,-50%)}50%{transform:translate(3px,-50%)}75%{transform:translate(-1px,-50%)}to{transform:translate(-1px,-50%)}}poll-element{color:var(--primary-text-color);display:block;margin-top:-1px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:330px}@media only screen and (max-width:600px){poll-element{max-width:100%;width:240px}}poll-element:not(.is-closed):not(.is-voted) .poll-answer{cursor:pointer}poll-element .poll-title{font-weight:var(--font-weight-bold)}@media only screen and (max-width:600px){poll-element .poll-title{max-width:88%;white-space:normal}}poll-element .poll-desc{align-items:center;color:var(--secondary-text-color);display:flex;font-size:14px;margin-bottom:5px;margin-top:2px;position:relative}poll-element .poll-type{margin-top:2px}poll-element .poll-hint{color:var(--primary-color);cursor:pointer;font-size:1.5rem;position:absolute;right:2px;top:-4px;transform:scale(1)}body.animation-level-2 poll-element .poll-hint{transition:transform .2s ease}poll-element .poll-hint.active{pointer-events:none;transform:scale(0)}poll-element .poll-send-vote{cursor:default}poll-element .poll-avatars{cursor:pointer;display:flex;margin-left:18px}poll-element .poll-avatar{border:1px solid var(--border-color);cursor:pointer;height:18px;width:18px}poll-element .poll-answer{display:flex;margin-top:1px;padding-bottom:20px;padding-left:28px;position:relative}poll-element .poll-answer-text{margin-left:12px;margin-top:6px}[dir=ltr] poll-element .poll-answer-percents{text-align:right}[dir=rtl] poll-element .poll-answer-percents{text-align:left}poll-element .poll-answer-percents{font-size:14px;font-weight:var(--font-weight-bold);left:0;margin-left:-9px;margin-top:7px;opacity:0;position:absolute;top:0;width:40px}poll-element .poll-answer-selected{align-items:center;background:var(--primary-color);border-radius:50%;bottom:1px;color:#fff;display:flex;font-size:.75rem;font-weight:var(--font-weight-bold);height:16px;justify-content:center;left:15px;opacity:1;position:absolute;width:16px}poll-element .poll-answer-selected:before{content:\"\";font-weight:var(--font-weight-bold)}html.no-touch poll-element .poll-answer:active .animation-ring,html.no-touch poll-element .poll-answer:hover .animation-ring{transform:scale(1);visibility:visible}poll-element .poll-answer.is-voting .progress-ring__circle{stroke-dashoffset:-19.792;animation:pollAnswerRotate .65s linear infinite}poll-element .poll-answer:not(.is-correct):not(.is-chosen) .poll-answer-selected{opacity:0}poll-element .poll-answer.is-chosing .circle-hover .poll-answer-selected{opacity:1}poll-element .poll-answer.is-chosing~.poll-footer .poll-send-vote{cursor:pointer}poll-element .poll-votes-count{color:var(--secondary-text-color);font-size:.875rem;margin-top:-.5rem}poll-element .poll-line{stroke-dashoffset:0;stroke-dasharray:0,485.9;bottom:2px;height:35px;left:10px;position:absolute}poll-element .poll-line use{stroke-width:4px;stroke-linecap:round;stroke:var(--primary-color);fill:none}poll-element .poll-footer{height:2.875rem;margin:-.375rem -.5rem -.375rem -.625rem;text-align:center}poll-element .poll-footer-button{border-top-left-radius:0!important;border-top-right-radius:0!important;color:var(--primary-color);cursor:pointer;font-size:1rem;font-weight:var(--font-weight-bold);height:100%;overflow:hidden;width:100%}poll-element .poll-footer,poll-element .poll-footer-button{align-items:center;display:flex;justify-content:center}poll-element .poll-quiz-timer{stroke:#a3adb6;fill:none;stroke-linecap:round;height:32px;position:absolute;right:-2px;top:-7px;transform:rotate(270deg);width:32px}poll-element .poll-time{color:#a3adb6;font-size:12px;font-weight:var(--font-weight-bold);position:absolute;right:27px}poll-element.is-quiz .poll-answer.is-chosen:not(.is-correct) use{stroke:var(--danger-color)}poll-element.is-quiz .poll-answer.is-chosen:not(.is-correct) .poll-answer-selected{background:var(--danger-color)}poll-element.is-quiz .poll-answer.is-chosen:not(.is-correct) .poll-answer-selected:before{content:\"\";font-size:12px}poll-element .circle-hover{align-items:center;display:flex;height:34px;justify-content:center;left:-1px;position:absolute;top:-1px;transform:scale(1);width:34px}poll-element .circle-hover .poll-answer-selected{animation:none;display:flex!important;font-size:20px;height:20px;left:50%;line-height:16px;opacity:0;top:50%;transform:translate(-50%,-50%);width:20px}body.animation-level-2 poll-element .circle-hover .poll-answer-selected{transition:opacity .2s ease}poll-element .animation-ring{background-color:var(--light-secondary-text-color);border-radius:50%;display:block;height:34px;transform:scale(.1);visibility:hidden;width:34px}body.animation-level-2 poll-element .animation-ring{transition:transform .12s ease}poll-element .progress-ring{height:26px;left:auto;top:auto;width:26px}poll-element .progress-ring__circle{stroke-dasharray:56.5487,56.5487;stroke-dashoffset:0;stroke-opacity:1;stroke-width:2;stroke:var(--poll-circle-color);fill:transparent;transform:rotate(-90deg);transform-origin:center}poll-element.is-voted .animation-ring,poll-element.is-voted .circle-hover{transform:scale(0)}poll-element.is-voted .poll-answer-percents{opacity:1}poll-element.is-retracting .circle-hover{transition-delay:.24s}poll-element.is-retracting .animation-ring{transition-delay:.22s}poll-element.animating .poll-line{transition:stroke-dashoffset .34s linear,stroke-dasharray .34s linear}poll-element.animating .poll-answer-selected{transition-delay:.24s;transition:opacity forwards .1s ease}poll-element.animating.is-retracting .poll-answer-selected{transition-delay:0s}poll-element.animating .poll-answer-percents{transition:opacity .34s}poll-element.animating .progress-ring__circle{transition:stroke-dashoffset .15s}poll-element.animating .circle-hover{transition:transform .1s}poll-element.is-multiple .poll-desc{margin-bottom:.5rem}poll-element .c-ripple__circle{background-color:var(--light-primary-color)}@keyframes pollAnswerRotate{to{transform:rotate(270deg)}}.transition>.transition-item{animation-fill-mode:forwards!important;height:100%;left:0;position:absolute;top:0;width:100%}.transition>.transition-item:not(.active):not(.from):not(.to){display:none!important}.transition.zoom-fade>.from{opacity:1;transform:scale(1);transform-origin:center}.transition.zoom-fade>.to{opacity:0;transform-origin:center}.transition.zoom-fade.animating>.from{animation:fade-out-opacity .15s ease}.transition.zoom-fade.animating>.to{animation:fade-in-opacity .15s ease,zoom-fade-in-move .15s ease}.transition.zoom-fade.backwards>.from{transform:scale(1)}.transition.zoom-fade.backwards>.to{transform:scale(.95)}.transition.zoom-fade.backwards.animating>.from{animation:fade-in-backwards-opacity .1s ease,zoom-fade-in-backwards-move .15s ease}.transition.zoom-fade.backwards.animating>.to{animation:fade-out-backwards-opacity .15s ease,zoom-fade-out-backwards-move .15s ease}.transition.slide-fade{--easeOutSine:cubic-bezier(.39,.575,.565,1);--easeInSine:cubic-bezier(.47,0,.745,.715);position:relative}.transition.slide-fade>.from{opacity:1;transform:translateX(0);transform-origin:left center}.transition.slide-fade>.to{opacity:0;transform:translateX(1.5rem);transform-origin:left center}.transition.slide-fade.animating>.from{animation:fade-out-opacity .4s ease-out,slide-fade-out-move .4s}.transition.slide-fade.animating>.to{animation:fade-in-opacity .4s var(--easeInSine),slide-fade-in-move .4s}.transition.slide-fade.backwards>.from{opacity:1;transform:translateX(0)}.transition.slide-fade.backwards>.to{opacity:0;transform:translateX(-1.5rem)}.transition.slide-fade.backwards.animating>.from{animation:fade-in-backwards-opacity .4s ease-out,slide-fade-in-backwards-move .4s}.transition.slide-fade.backwards.animating>.to{animation:fade-out-backwards-opacity .4s var(--easeOutSine),slide-fade-out-backwards-move .4s}@keyframes zoom-fade-in-move{0%{transform:scale(1.1)}to{transform:scale(1)}}@keyframes zoom-fade-in-backwards-move{0%{transform:scale(1)}to{transform:scale(1.1)}}@keyframes zoom-fade-out-backwards-move{0%{transform:scale(.95)}to{transform:scale(1)}}@keyframes slide-fade-in-move{0%{transform:translateX(1.5rem)}to{transform:translateX(0)}}@keyframes slide-fade-out-move{0%{transform:translateX(0)}to{transform:translateX(-1.5rem)}}@keyframes slide-fade-in-backwards-move{0%{transform:translateX(0)}to{transform:translateX(1.5rem)}}@keyframes slide-fade-out-backwards-move{0%{transform:translateX(-1.5rem)}to{transform:translateX(0)}}.row{display:flex;flex-direction:column;justify-content:center;min-height:3.5rem;padding:.4375rem 1rem;position:relative}.row.no-subtitle,.row.row-small{min-height:3rem;padding-bottom:.1875rem;padding-top:.1875rem}body.animation-level-2 .row{transition:opacity var(--transition-standard-in)}.row.is-disabled{opacity:var(--disabled-opacity);pointer-events:none!important}.row.no-wrap{padding-bottom:0!important;padding-top:0!important}.row a{pointer-events:all;position:relative;z-index:1}.row-title-row,.row>.row-title{order:0}[dir=ltr] .row-big{padding-left:1rem;padding-right:.75rem}[dir=rtl] .row-big{padding-left:.75rem;padding-right:1rem}.row-big{min-height:4.5rem;padding-bottom:.5625rem;padding-top:.5625rem}.row-row{align-items:center;display:flex;justify-content:space-between}.row-row .row-subtitle,.row-row .row-title{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row-subtitle-row,.row>.row-subtitle{order:1}.row-title{color:var(--primary-text-color);font-size:var(--font-size);line-height:var(--line-height);overflow:hidden;text-overflow:ellipsis;word-break:break-word}.row-title-right-secondary{color:var(--secondary-text-color)}.row-title-row.with-delimiter .row-title:first-child{border-right:1px solid var(--border-color)}[dir=ltr] .row-subtitle-right,[dir=ltr] .row-title-right{margin-left:1rem}[dir=rtl] .row-subtitle-right,[dir=rtl] .row-title-right{margin-right:1rem}.row-subtitle-right,.row-title-right{flex:0 0 auto!important}.row-midtitle,.row-subtitle,.row-title{pointer-events:none;position:relative}.row-midtitle{font-size:var(--font-size-14);margin-top:.125rem;order:1}[dir=ltr] .row-with-padding{padding-left:4.5rem}[dir=rtl] .row-with-padding{padding-right:4.5rem}@media only screen and (max-width:600px){[dir=ltr] .row-with-padding{padding-left:4rem}[dir=rtl] .row-with-padding{padding-right:4rem}}[dir=ltr] .row-with-padding.tgico:before{left:1rem}[dir=rtl] .row-with-padding.tgico:before{right:1rem}.row-with-padding.tgico:before{color:var(--secondary-text-color);font-size:1.5rem;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);z-index:1}.row-with-padding:not(.row-with-icon):before{display:none}.row-clickable{cursor:pointer;overflow:hidden}@media only screen and (min-width:601px){.row-clickable{border-radius:10px}}[dir=ltr] .row-sortable .row-subtitle,[dir=ltr] .row-sortable .row-title{padding-right:2.5rem}[dir=rtl] .row-sortable .row-subtitle,[dir=rtl] .row-sortable .row-title{padding-left:2.5rem}[dir=ltr] .row-sortable-icon{right:.75rem}[dir=rtl] .row-sortable-icon{left:.75rem}.row-sortable-icon{color:var(--secondary-text-color);font-size:1.5rem;height:1.5rem;line-height:1;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%)}.row-sortable.cant-sort .row-sortable-icon{display:none}.row-sortable.is-dragging{background-color:var(--surface-color)!important;z-index:1}html.no-touch .row-sortable.is-dragging:active,html.no-touch .row-sortable.is-dragging:hover{background-color:var(--light-filled-secondary-text-color)!important}html.no-touch .row-sortable:active .row-sortable-icon,html.no-touch .row-sortable:hover .row-sortable-icon{opacity:1}body.animation-level-2 .is-reordering .row-sortable{transition:transform var(--transition-standard-in)}[dir=ltr] .row .checkbox-field,[dir=ltr] .row .radio-field-main{padding-left:3.375rem}[dir=rtl] .row .checkbox-field,[dir=rtl] .row .radio-field-main{padding-right:3.375rem}[dir=ltr] .row .checkbox-field,[dir=ltr] .row .radio-field-main{margin-left:-3.375rem}[dir=rtl] .row .checkbox-field,[dir=rtl] .row .radio-field-main{margin-right:-3.375rem}.row .checkbox-field,.row .radio-field,.row .radio-field:not(.radio-field-right) .radio-field-main{position:static}.row .checkbox-field,.row .radio-field{--offset-left:1rem}.row .radio-field{margin-bottom:0;margin-top:0}[dir=ltr] .row .checkbox-field{margin-right:0}[dir=rtl] .row .checkbox-field{margin-left:0}.row .checkbox-field{height:auto;margin-bottom:0;margin-top:0}[dir=ltr] .row .checkbox-field .checkbox-caption{padding-left:0}[dir=rtl] .row .checkbox-field .checkbox-caption{padding-right:0}.row .checkbox-field .checkbox-caption{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row .checkbox-field-toggle{margin-left:.125rem;margin-right:.125rem;padding:0}.row-subtitle{color:var(--secondary-text-color)!important;font-size:var(--font-size-14)!important;line-height:var(--line-height-14);margin-top:.1875rem}.row-subtitle:empty{display:none}[dir=ltr] .row-media{left:.75rem}[dir=rtl] .row-media{right:.75rem}.row-media{align-items:center;display:flex;height:2.25rem!important;justify-content:center;margin:0!important;pointer-events:none;position:absolute!important;width:2.25rem!important}[dir=ltr] .row-media-small{left:.75rem!important}[dir=rtl] .row-media-small{right:.75rem!important}.row-media-small{height:2rem!important;width:2rem!important}[dir=ltr] .row-media-abitbigger{left:.75rem!important}[dir=rtl] .row-media-abitbigger{right:.75rem!important}.row-media-abitbigger{height:2.625rem!important;width:2.625rem!important}[dir=ltr] .row-media-big{left:.5rem!important}[dir=rtl] .row-media-big{right:.5rem!important}.row-media-big{height:3rem!important;width:3rem!important}[dir=ltr] .row-media-bigger{left:.5625rem!important}[dir=rtl] .row-media-bigger{right:.5625rem!important}.row-media-bigger{height:3.375rem!important;width:3.375rem!important}.row.menu-open{background-color:var(--light-secondary-text-color)}[dir=ltr] .row>.btn-primary{right:1rem}[dir=rtl] .row>.btn-primary{left:1rem}.row>.btn-primary{border-radius:.9375rem;font-size:.9375rem;height:1.875rem;line-height:1.875rem;margin:0;padding-left:.75rem;padding-right:.75rem;position:absolute;top:50%;transform:translateY(-50%);width:auto}body.animation-level-2 .row>.btn-primary{transition:width .2s,background-color .2s,color .2s}.row>.btn-primary.active{background-color:var(--light-primary-color)!important;color:var(--primary-color)}.row.accordion-toggler .checkbox-field-toggle{pointer-events:all!important}.color-picker{margin:1.1875rem auto .25rem;max-width:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:380px}@media only screen and (max-width:600px){.color-picker{padding:0 .75rem}}.color-picker-box{height:198px;width:100%}.color-picker-box,.color-picker-color-slider,.color-picker-dragger{overflow:visible!important}.color-picker-sliders{margin:1rem 0 1.125rem}.color-picker-dragger{cursor:grab}.color-picker-inputs{display:flex}.color-picker-inputs .input-field{flex:1 1 auto}.color-picker-inputs .input-field:not(:first-child){margin-left:1.25rem}.reply-keyboard{background:var(--surface-color);border-radius:10px;bottom:calc(100% + .625rem);box-shadow:0 5px 10px 5px rgba(16,35,47,.14);display:flex!important;flex-direction:column;max-height:26.25rem;max-width:100%;opacity:0;overflow:hidden;padding:0!important;position:absolute!important;right:0;transform:scale(0);transform-origin:bottom right;transition:transform var(--esg-transition),opacity var(--esg-transition);width:26.25rem!important;z-index:3}@media only screen and (max-height:569px),only screen and (max-width:600px){.reply-keyboard{bottom:calc(100% + .5rem)}}.reply-keyboard.active{opacity:1;transform:scale(1)}body.animation-level-0 .reply-keyboard{transition:none}.reply-keyboard-row{display:flex}.reply-keyboard-row+.reply-keyboard-row{margin-top:.3125rem}.reply-keyboard-button{background-color:transparent;border:2px solid var(--primary-color);border-radius:.375rem;color:var(--primary-color);font-size:.9375rem;font-weight:var(--font-weight-bold);height:3rem;text-align:center;width:100%}body.animation-level-2 .reply-keyboard-button{transition:color .15s,background-color .15s}html.no-touch .reply-keyboard-button:active,html.no-touch .reply-keyboard-button:hover{background-color:var(--primary-color);color:#fff}.reply-keyboard-button+.reply-keyboard-button{margin-left:.3125rem}.reply-keyboard .scrollable-y{bottom:auto;height:auto;left:auto;max-height:100%;padding:.625rem!important;position:relative;right:auto;top:auto}.peoplenearby-container div.text.nearby-description{color:var(--primary-text-color);margin-top:15px;text-align:center}.peoplenearby-container div.text.nearby-error{color:var(--gc-secondary-text-color);margin-top:10px;text-align:center}.peoplenearby-container .locating-animation-container{align-items:center;display:flex;justify-content:center;min-height:140px;width:100%}.peoplenearby-container .locating-animation-container .tgico.tgico-location{align-items:center;background:var(--avatar-color-bottom);border-radius:50%;display:flex;height:140px;justify-content:center;padding:50px;width:140px}.peoplenearby-container .locating-animation-container .tgico.tgico-location:before{color:#fff;font-size:58px}.peoplenearby-container .locating-animation-container .locating-animation-waves{position:fixed}.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-1,.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-3{animation:waves-animation 3s infinite;border:5px solid #fff;border-radius:50%;-webkit-clip-path:polygon(72% 0,100% 0,100% 100%,72% 100%);clip-path:polygon(72% 0,100% 0,100% 100%,72% 100%);height:50px;margin-left:36px;width:50px}.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-2,.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-4{animation:waves-animation 5s infinite;animation-delay:2s;border:5px solid #fff;border-radius:50%;-webkit-clip-path:polygon(72% 0,100% 0,100% 100%,72% 100%);clip-path:polygon(72% 0,100% 0,100% 100%,72% 100%);height:71px;margin-left:51px;margin-top:1px;width:66px}.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-3{margin-left:-36px!important;transform:rotateY(180deg)}.peoplenearby-container .locating-animation-container .locating-animation-waves.wave-4{margin-left:-51px!important;transform:rotateY(180deg)}@keyframes waves-animation{0%{opacity:1}50%{opacity:0}to{opacity:1}}.spoiler{--anim:.4s ease;background-color:var(--spoiler-background-color)}.spoiler-text{opacity:0}.spoilers-container .custom-emoji-canvas{z-index:-1}.spoilers-container.is-spoiler-visible.animating .spoiler{transition:background-color var(--anim)}.spoilers-container.is-spoiler-visible.animating .spoiler-text{transition:opacity var(--anim)}.spoilers-container.is-spoiler-visible:not(.backwards) .spoiler{background-color:transparent}.spoilers-container.is-spoiler-visible:not(.backwards) .spoiler-text{opacity:1}.spoilers-container:not(.is-spoiler-visible) .spoiler{cursor:pointer}.spoilers-container:not(.is-spoiler-visible) .spoiler-text{pointer-events:none}.emoji-animation,.emoji-animation-container{pointer-events:none;position:absolute}.emoji-animation-container{bottom:0;left:0;overflow:hidden;right:0;top:0;z-index:3}.reactions-block{display:flex;flex-wrap:wrap;-webkit-user-select:none;-moz-user-select:none;user-select:none}.reactions-block.has-no-reactions{display:inline;display:initial}.reactions-inline{display:inline-flex}.reactions-inline:not(:empty){margin-right:.125rem}.reaction,.reaction-sticker{align-items:center;display:flex}.reaction-sticker{--custom-emoji-size:var(--reaction-size);height:var(--reaction-size);justify-content:center;position:relative;width:var(--reaction-size)}.reaction-sticker-activate{bottom:var(--reaction-offset);left:var(--reaction-offset);position:absolute;right:var(--reaction-offset);top:var(--reaction-offset);z-index:1}.reaction-sticker.has-animation>.media-sticker{opacity:0}.reaction-sticker:not(.is-static):not(.is-custom) .media-sticker{--size:calc(var(--reaction-size) + var(--reaction-offset)*-2);bottom:auto;height:var(--size)!important;left:auto;max-height:var(--size);max-width:var(--size);right:auto;top:auto;width:var(--size)!important}.reaction-sticker.is-custom{border-radius:.3125rem}.reaction-sticker.is-custom .custom-emoji,.reaction-sticker.is-custom .media-sticker{border-radius:inherit}.reaction-sticker.is-custom .custom-emoji-canvas{z-index:auto}.reaction-inline{--reaction-size:.875rem;--reaction-offset:-.4375rem;min-height:var(--reaction-size);min-width:var(--reaction-size)}.reaction-inline .reaction-counter{font-size:inherit!important;margin-right:.0625rem!important;order:-1}.reaction-block{--additional-height:.5rem;--margin:.375rem;--reaction-size:1.375rem;--reaction-offset:-.5625rem;--background-color:var(--message-highlightning-color);--chosen-background-color:var(--message-primary-color);--counter-color:#fff;--reaction-total-size:calc(var(--reaction-size) + var(--additional-height));background-color:var(--background-color);border-radius:var(--reaction-total-size);color:var(--counter-color);cursor:pointer;height:var(--reaction-total-size);margin-right:var(--margin);margin-top:var(--margin);padding:0 .5rem;position:relative}html.no-touch .reaction-block:active:after,html.no-touch .reaction-block:hover:after{background-color:var(--chosen-background-color);border-radius:inherit;bottom:0;content:\" \";left:0;opacity:.08;position:absolute;right:0;top:0}.reaction-block .reaction-counter,.reaction-block .reaction-sticker{z-index:1}.reaction-block:last-child{margin-right:0}.reaction-block:before{background-color:var(--chosen-background-color);border-radius:inherit;bottom:0;content:\" \";left:0;opacity:0;position:absolute;right:0;top:0;transform:scale(0)}.reaction-block.is-chosen:not(.backwards):before{opacity:1;transform:scale(1)}.reaction-block.is-chosen:not(.backwards) .stacked-avatars{--border-color:var(--chosen-background-color)}.reaction-block.is-chosen.animating:before{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.reaction-block.is-chosen.animating .reaction-counter{transition:color var(--transition-standard-in)}.reaction-block.is-chosen.animating .stacked-avatars-avatar-container{transition:border-color var(--transition-standard-in)}.reaction-block .stacked-avatars{--border-color:transparent;--border-size:.125rem;--margin-right:-.875rem;margin-left:.1875rem}.reaction-block .reaction-counter{font-size:.9375rem!important;font-weight:var(--font-weight-bold);line-height:1.125rem;margin:0 .0625rem 0 .375rem;position:relative}.stacked-avatars{--border-color:var(--surface-color);--border-size:1px;--margin-right:-.3125rem;--avatar-size:1rem;--avatar-total-size:calc(var(--avatar-size) + var(--border-size)*2);display:flex;flex-direction:row-reverse}.stacked-avatars-avatar{height:var(--avatar-size);width:var(--avatar-size);z-index:0}.stacked-avatars-avatar-container{align-items:center;border:var(--border-size) solid var(--border-color);border-radius:50%;display:flex;height:var(--avatar-total-size);justify-content:center;position:relative;width:var(--avatar-total-size)}.stacked-avatars-avatar-container:not(:first-child){margin-right:var(--margin-right)}.sticker-viewer{align-items:center;bottom:0;display:flex;justify-content:center;left:0;pointer-events:none;position:fixed;right:0;top:0;z-index:4}.sticker-viewer:before{background-color:rgba(0,0,0,.6);bottom:0;content:\" \";left:0;opacity:0;position:absolute;right:0;top:0}body.animation-level-2 .sticker-viewer:before{transition:opacity var(--sticker-viewer-open-transition-out)}.sticker-viewer.is-visible:not(.backwards):before{opacity:1}body.animation-level-2 .sticker-viewer.is-visible:not(.backwards):before{transition:opacity var(--sticker-viewer-open-transition-in)}.sticker-viewer.is-visible:not(.backwards) .sticker-viewer-transformer:not(.is-switching){transform:translateX(var(--translateX)) scale(1)!important}body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .sticker-viewer-transformer:not(.is-switching){transition:transform var(--sticker-viewer-open-transition-in)}.sticker-viewer.is-visible:not(.backwards) .emoji-animation,.sticker-viewer.is-visible:not(.backwards) .sticker-viewer-emoji,.sticker-viewer.is-visible:not(.backwards) .sticker-viewer-sticker{opacity:1}body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .emoji-animation,body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .sticker-viewer-emoji,body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .sticker-viewer-sticker{transition:opacity var(--sticker-viewer-open-transition-in)}body.animation-level-2 .sticker-viewer.is-visible:not(.backwards) .sticker-viewer-sticker:not(.is-overflow){transition:opacity 0s}.sticker-viewer-transformer{--translateX:0;align-items:center;display:flex;height:360px;justify-content:center;position:absolute;width:360px}.sticker-viewer-transformer.has-effect{height:280px;width:280px}.sticker-viewer-transformer.has-effect .sticker-viewer-emoji{top:-5.5rem}body.animation-level-2 .sticker-viewer-transformer{transition:transform var(--sticker-viewer-open-transition-out)}.sticker-viewer-transformer.is-switching{opacity:1!important;transform:translateX(var(--translateX)) scale(1)!important}body.animation-level-2 .sticker-viewer-transformer.is-switching{transition:transform var(--sticker-viewer-switch-transition),opacity var(--sticker-viewer-switch-transition)!important}.sticker-viewer-transformer.is-switching:not(.backwards){opacity:0!important;transform:scale(.4) translateX(var(--translateX))!important}.sticker-viewer-emoji{position:absolute;top:-3rem;transform:translateX(var(--translateX)) scale(2)}.sticker-viewer-sticker{position:absolute}.sticker-viewer .emoji-animation,.sticker-viewer-emoji,.sticker-viewer-sticker{opacity:0}body.animation-level-2 .sticker-viewer .emoji-animation,body.animation-level-2 .sticker-viewer-emoji,body.animation-level-2 .sticker-viewer-sticker{transition:opacity var(--sticker-viewer-open-transition-out)}.custom-emoji{display:inline;height:var(--custom-emoji-size)!important;min-height:var(--custom-emoji-size)!important;min-width:var(--custom-emoji-size)!important;position:relative;width:var(--custom-emoji-size)!important}.custom-emoji:before{content:\" \";display:inline-block;height:inherit;min-height:inherit;min-width:inherit;width:inherit}.custom-emoji .media-sticker,.custom-emoji .rlottie{height:inherit!important;margin:0;max-height:inherit!important;max-width:inherit!important;pointer-events:none;text-indent:-9999px;width:inherit!important}.custom-emoji-canvas{height:100%;width:100%}.custom-emoji-canvas,.custom-emoji-renderer{bottom:0;left:0;position:absolute;right:0;top:0}.custom-emoji-renderer{pointer-events:none}.custom-emoji-placeholder{display:inline;height:var(--messages-custom-emoji-size);margin-top:-.125rem;vertical-align:middle;width:var(--messages-custom-emoji-size)}.usernames-username-icon{background-color:var(--secondary-color);border-radius:50%;color:#fff;font-size:1.25rem}.usernames-username-icon:before{content:\"\"}.usernames-username.active .usernames-username-status{color:var(--primary-color)!important}.usernames-username.active .usernames-username-icon{background-color:var(--primary-color)}.topics-slider{bottom:0;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0}.topics-container{--offset:0;--width:100%;background-color:var(--surface-color)!important;width:var(--width)!important}.topics-container.is-floating{--offset:5.0625rem;--width:calc(var(--left-column-width) - var(--offset));border-left:1px solid var(--border-color);bottom:0;overflow:visible!important;overflow:initial!important;pointer-events:all;position:absolute;right:0;top:0;transform:translateX(var(--width));z-index:3}.topics-container.is-visible:not(.backwards){transform:translateX(0)}.topics-container.is-visible.animating{transition:transform var(--transition-standard-in)}.topics-container.is-visible.animating.backwards{transition:transform var(--transition-standard-out)}.topics-container .sidebar-header{padding:0 .75rem}.topics-container .sidebar-header__rows{flex:1 1 auto;overflow:hidden;padding-left:.5rem}.topics-container .sidebar-header__rows .sidebar-header__title{font-size:var(--font-size-16);line-height:var(--line-height-16);margin-bottom:.125rem;padding-left:0!important}.topics-container .sidebar-header__subtitle,.topics-container .sidebar-header__title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topics-container .sidebar-header__subtitle{color:var(--secondary-text-color);font-size:var(--font-size-14);line-height:var(--line-height-14)}.topics-container .chatlist-chat{min-height:4rem;padding-left:.75rem}.topic-name .topic-icon{margin-right:.25rem}.topic-name-button{--color:var(--primary-color);align-items:center;color:var(--color);cursor:pointer;display:flex;font-weight:var(--font-weight-bold);height:1.5rem;justify-content:center;max-width:100%;padding:0 .5rem;position:relative;text-decoration:none!important}.topic-name-button-container{align-items:flex-start;display:flex!important;justify-content:flex-start}.topic-name-button .peer-title,.topic-name-button .topic-name{position:relative}.topic-name-button:before{background-color:var(--color);border-radius:1.5rem;bottom:0;content:\" \";left:0;opacity:.08;position:absolute;right:0;top:0}html.no-touch .topic-name-button:active:before,html.no-touch .topic-name-button:hover:before{opacity:.16}.topic-icon{--size:1.25rem;--custom-emoji-size:var(--size);display:inline-flex;font-size:calc(var(--size)/2);justify-content:center;line-height:1.875!important;position:relative;vertical-align:middle}.topic-icon-general{fill:var(--secondary-color);height:var(--size);width:var(--size)}.topic-icon-svg{height:inherit;position:absolute;width:inherit}.topic-icon-content{position:relative}.edit-topic-container .scrollable-y{display:flex;flex-direction:column}.edit-topic-icon{position:absolute}.edit-topic-icon .topic-icon{--size:4rem}.edit-topic-icon-container{align-items:center;cursor:pointer;display:flex;height:100px;justify-content:center;margin:0 auto;position:relative;width:100px}.edit-topic-emoticons-container{flex:1 1 auto}.edit-topic-emoticons-container .sidebar-left-section{height:100%;padding:0!important}.edit-topic-emoticons-container .emoji-padding{display:flex;flex-direction:column}.edit-topic-emoticons-container .super-emoji-topic-icon .topic-icon{--size:var(--esg-emoji-size);--custom-emoji-size:inherit;margin-left:calc((var(--custom-emoji-size) - var(--esg-emoji-size))/2)}.themes-container{align-items:center;display:flex;height:6.5rem;position:relative}@media only screen and (min-width:601px){.themes-container{margin:0 -.5rem;padding:0;width:calc(100% + 1rem)}}.themes-container:after,.themes-container:before{content:\" \";display:block;flex:0 0 auto;height:.5rem;width:.5rem}.theme-container{border-radius:10px;cursor:pointer;display:flex;flex:0 0 auto;height:calc(100% - .5rem);justify-content:center;margin:0 .25rem;position:relative;width:4.5rem}.theme-container:before{border:2px solid var(--primary-color);border-radius:14px;bottom:-4px;content:\" \";left:-4px;opacity:0;position:absolute;right:-4px;top:-4px;transform:scale(.86)}html.is-safari .theme-container:before{transform:none!important}body.animation-level-2 .theme-container:before{transition:transform var(--transition-standard-in),opacity var(--transition-standard-in)}.theme-container.active{pointer-events:none}.theme-container.active:before{opacity:1;transform:scale(1)}.theme-container .background-item{border-radius:inherit;height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.theme-emoticon{bottom:.5rem;height:1.75rem;pointer-events:none;position:absolute;width:1.75rem;z-index:1}html:not(.is-safari) .theme-emoticon{transform:scale(1);transform-origin:center bottom}body.animation-level-2 .theme-emoticon{transition:transform var(--transition-standard-in)}.theme-bubble{background-color:#fff;border-radius:1.75rem;height:1.25rem;pointer-events:none;position:absolute;width:2.5rem}.theme-bubble.is-out{background-color:var(--light-filled-message-out-primary-color);right:.375rem;top:.5rem}.theme-bubble.is-in{background-color:var(--message-background-color);left:.375rem;top:2rem}.popup{background-color:rgba(0,0,0,.3);bottom:0;box-shadow:none;display:flex;left:0;margin:0;max-width:none;opacity:0;overflow:auto;padding:1.875rem;position:fixed!important;right:0;top:0;transition-delay:0s,var(--popup-transition-time);transition-duration:var(--popup-transition-time),0s;transition-property:opacity,visibility;transition-timing-function:var(--popup-transition-function);-webkit-user-select:none;-moz-user-select:none;user-select:none;visibility:hidden;z-index:3}.popup.no-overlay{background-color:transparent;overflow:visible;padding:0}body.animation-level-0 .popup{transition:none}.popup.active{opacity:1;transition-delay:0s,0s;visibility:visible;z-index:4}.popup.active .popup-container,.popup.hiding .popup-container{transform:translate3d(var(--translateX),0,0)}[dir=ltr] .popup-title{padding-left:1.5rem;padding-right:1rem}[dir=rtl] .popup-title{padding-left:1rem;padding-right:1.5rem}.popup-title{flex:1;font-size:1.25rem;font-weight:var(--font-weight-bold);line-height:1;margin:0}.popup-title:first-child{padding-left:0}.popup-container{--translateX:0;-webkit-backface-visibility:hidden;backface-visibility:hidden;background-color:var(--surface-color);border-radius:10px;display:flex;flex-direction:column;margin:auto;overflow:hidden;padding:1rem;position:relative;transform:translate3d(var(--translateX),3rem,0);transition:transform var(--popup-transition-time) var(--popup-transition-function)}body.animation-level-0 .popup-container{transition:none}.popup-description .peer-title{font-weight:var(--font-weight-bold)}.popup-centerer{margin:auto}.popup-close{flex:0 0 auto;justify-self:center;z-index:3}.popup-header{align-items:center;display:flex;flex:0 0 auto;margin-bottom:2rem;position:relative}.popup-body{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.popup-body .scrollable{position:relative}.popup-buttons{align-items:center;display:flex;flex-direction:row-reverse;height:3rem;justify-content:flex-start;padding:0 .5rem}.popup-buttons .btn{border-radius:10px;font-weight:var(--font-weight-bold);height:2.5rem;max-width:100%;overflow:hidden;padding:0 1rem;position:relative;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}[dir=ltr] .popup-buttons .btn+.btn{margin-right:.625rem}[dir=rtl] .popup-buttons .btn+.btn{margin-left:.625rem}.popup-avatar .popup-container{max-width:600px;padding:15px 16px 16px 24px}.popup-avatar .popup-container>button{bottom:20px;position:absolute;right:20px}.popup-avatar .popup-close{font-size:1.5rem;margin-top:4px}.popup-avatar .popup-header{margin-bottom:1px}[dir=ltr] .popup-avatar h6{text-align:left}[dir=rtl] .popup-avatar h6{text-align:right}.popup-avatar h6{font-size:1.25rem;margin:0 0 0 2rem}.popup-avatar .crop{border-radius:8px;max-height:100%;max-width:100%;padding:24px 54px 46px 46px}.popup-avatar .crop>img{display:none}.popup-avatar .crop img{border-radius:8px}.popup-new-media .popup-container{max-height:100%;max-width:420px;padding:12px 20px 32.5px;width:420px}.popup-new-media .popup-container img,.popup-new-media .popup-container video{border-radius:inherit}.popup-new-media .popup-header{align-items:center;flex:0 0 auto;flex-wrap:wrap;justify-content:space-between;margin-bottom:9px;padding:12px 20px 15px;position:relative}.popup-new-media .popup-header .btn-primary{border-radius:10px;font-size:var(--font-size-14);height:2.25rem;line-height:2.25rem;padding:0 1.375rem;text-transform:uppercase;width:auto}.popup-new-media .popup-close{margin:-1px 0 0 -4px}.popup-new-media .popup-photo{border-radius:10px;max-width:100%;overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.popup-new-media .scrollable{position:relative}.popup-new-media .input-field{flex:0 0 auto;margin-top:25px;width:100%}.popup-new-media .input-field-input{border-radius:10px;font-size:1rem}.popup-new-media .input-field-input[data-placeholder]:not(:focus):empty~label{opacity:0}.popup-new-media .input-field label{font-size:inherit}.popup-new-media .btn-menu-overlay{z-index:3}.popup-new-media .menu-send{top:calc(100% + .25rem);z-index:4}.popup-new-media.popup-send-photo .popup-container{max-width:25rem;padding:0;width:25rem}.popup-new-media.popup-send-photo .popup-container.border-top-offset .popup-input-container{overflow:visible;overflow:initial}.popup-new-media.popup-send-photo .popup-container.border-top-offset .popup-input-container:before{top:-8px}.popup-new-media.popup-send-photo .menu-send{bottom:3.5rem;right:.5rem;top:auto}.popup-new-media.popup-send-photo .popup-header{height:3.5rem;margin:0;padding:0 1rem}[dir=ltr] .popup-new-media.popup-send-photo .popup-title{padding-left:1.5rem}[dir=rtl] .popup-new-media.popup-send-photo .popup-title{padding-right:1.5rem}.popup-new-media.popup-send-photo .popup-close{margin:0}.popup-new-media.popup-send-photo .popup-body{position:relative}.popup-new-media.popup-send-photo .popup-body .scrollable{padding:0 .5rem}.popup-new-media.popup-send-photo .input-message-container{max-height:inherit;min-height:inherit}.popup-new-media.popup-send-photo .input-message-input{max-height:inherit!important}.popup-new-media.popup-send-photo .btn-primary{flex:0 0 auto;height:2.5rem;line-height:2.5rem;margin-bottom:.5rem;padding:0 1rem;text-transform:uppercase;width:auto}.popup-new-media.popup-send-photo .popup-input-container{--height:3.5rem;--max-height:8.375rem;align-items:flex-end;display:flex;flex:0 0 auto;justify-content:space-between;max-height:var(--max-height);min-height:var(--height);overflow:hidden;padding:0 .5rem;position:relative}.popup-new-media.popup-send-photo .popup-input-container:before{background-color:var(--border-color);content:\" \";height:1px;left:0;opacity:0;position:absolute;right:0;top:0}body.animation-level-2 .popup-new-media.popup-send-photo .popup-input-container:before{transition:opacity var(--transition-standard-in)}.popup-new-media.popup-send-photo .popup-input-container.has-border-top:before{opacity:1}.popup-new-media.popup-send-photo .checkbox-field{margin-bottom:0;margin-left:0}.popup-new-media.popup-send-photo .popup-item-album{position:relative}.popup-new-media.popup-send-photo .popup-item-album .album-item{position:absolute}.popup-new-media.popup-send-photo .popup-item-album img,.popup-new-media.popup-send-photo .popup-item-album video{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.popup-new-media.popup-send-photo .popup-photo>.popup-item-media{display:flex;justify-content:center;margin:0 auto}.popup-new-media.popup-send-photo .popup-photo>.popup-item-media img{-o-object-fit:contain;object-fit:contain}.popup-new-media.popup-send-photo .popup-photo>.popup-item{border-radius:inherit;overflow:hidden;position:relative}.popup-new-media.popup-send-photo .popup-photo>.popup-item+.popup-item{margin-top:.5rem}.popup-new-media.popup-send-photo .drop{border-radius:0}.popup-new-media.popup-send-photo .audio,.popup-new-media.popup-send-photo .document{--icon-margin:.5rem;--icon-size:3rem;--padding:.25rem;border-radius:10px;cursor:default;height:3.5rem;margin:0 .25rem}html.no-touch .popup-new-media.popup-send-photo .audio:active,html.no-touch .popup-new-media.popup-send-photo .audio:hover,html.no-touch .popup-new-media.popup-send-photo .document:active,html.no-touch .popup-new-media.popup-send-photo .document:hover{--message-background-color:var(--light-filled-secondary-text-color);background-color:var(--light-secondary-text-color)}.popup-new-media.popup-send-photo .document{max-width:100%;overflow:hidden}.popup-new-media.popup-send-photo .document.document-with-thumb{--icon-size:4.5rem;height:5rem}.popup-new-media.popup-send-photo .document-name{line-height:1.5;margin-bottom:.125rem;max-width:100%;overflow:hidden;text-overflow:ellipsis;width:100%}.popup-new-media.popup-send-photo .document-ico{border-radius:5px;font-size:16px;font-weight:400;letter-spacing:0;line-height:11px}.popup-create-contact .popup-container{padding:0 1rem 1rem!important}.popup-create-contact .popup-header{padding:0!important}.popup-create-contact .btn-primary{margin-bottom:0!important}.popup-create-contact .name-fields{display:flex;flex-direction:column;margin-top:1rem;padding-left:116px;position:relative}.popup-create-contact .name-fields .input-field:first-child{margin-top:0}.popup-create-contact .avatar-placeholder{left:0;position:absolute;top:50%;transform:translateY(-50%)}.popup-peer .popup-header{align-items:center;display:flex;height:2.5rem;margin:0;padding:0 1rem;width:-moz-max-content;width:max-content}.popup-peer .popup-container{max-width:min(400px,100%);min-width:min(100%,17.5rem);padding:.75rem .5rem;width:-moz-min-content;width:min-content}.popup-peer .popup-title{font-size:1.25rem;font-weight:var(--font-weight-bold)}.popup-peer .popup-title:not(:first-child){padding-left:1rem}.popup-peer .popup-description{line-height:var(--line-height);margin-bottom:0;margin-top:0;max-width:-moz-fit-content;max-width:fit-content;min-width:min(100%,15rem);overflow:hidden;padding:.625rem 1rem .5rem;text-overflow:ellipsis;word-break:break-word}.popup-peer .checkbox-field{align-items:center;display:flex;height:auto;margin:0;min-height:3rem;padding:.25rem 1.125rem}.popup-peer .checkbox-field .checkbox-box{left:auto}.popup-stickers{-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-stickers .sticker-set-footer{color:var(--primary-color);text-align:center}.popup-stickers .sticker-set-footer .btn-primary{height:44px;line-height:44px;padding:0 1.0625rem;text-transform:uppercase;width:auto}.popup-stickers .scrollable.is-loading{min-height:9rem;position:relative}.popup-stickers .sticker-set-footer{padding:8px 0}.popup-stickers .super-emojis{padding:0 .5rem}.popup-stickers .popup-container{max-height:420px;max-width:420px;padding:0;width:420px}[dir=ltr] .popup-stickers .popup-close{margin-left:1rem}[dir=rtl] .popup-stickers .popup-close{margin-right:1rem}.popup-stickers .popup-close{font-size:1.5rem}.popup-stickers .popup-header{flex:0 0 auto;margin:.625rem 0}.popup-stickers .sticker-set{margin:.0625rem 0}.popup-stickers .sticker-set .row-title{font-weight:var(--font-weight-bold)}.popup-stickers .sticker-set-stickers{--per-row:5;--item-size:var(--popup-sticker-size);display:grid;grid-template-columns:repeat(var(--per-row),1fr);padding:0 5px;position:relative}@media only screen and (max-width:600px){.popup-stickers .sticker-set-stickers{--per-row:4}}.popup-stickers .sticker-set-stickers .media-sticker-wrapper{cursor:pointer;height:var(--item-size);justify-self:center;margin-bottom:2px;position:relative;width:var(--item-size)}@media only screen and (max-width:600px){.popup-stickers .sticker-set-stickers .media-sticker-wrapper{margin-bottom:8px}}.popup-stickers .sticker-set-stickers .media-sticker-wrapper:hover{background-color:var(--light-secondary-text-color);border-radius:12px}.popup-date-picker{-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-date-picker .popup-container{padding:12px 14px}@media(min-height:470px){.popup-date-picker .popup-container[data-lines=\"7\"]{top:19px}.popup-date-picker .popup-container[data-lines=\"5\"]{top:-19px}}.popup-date-picker .popup-header{margin-bottom:1.375rem;margin-left:6px;margin-top:4px}.popup-date-picker .popup-title{font-size:20px;font-weight:var(--font-weight-bold)}.popup-date-picker .popup-buttons{margin-right:-2px;order:2}.popup-date-picker .popup-buttons button+button{margin-left:9px;margin-top:0}.popup-date-picker .date-picker-controls{align-items:center;display:flex;justify-content:space-between}.popup-date-picker .date-picker-controls .date-picker-month-title{font-size:14px;font-weight:var(--font-weight-bold)}.popup-date-picker .date-picker-prev{transform:rotate(90deg)}.popup-date-picker .date-picker-next{transform:rotate(-90deg)}.popup-date-picker .date-picker-next:disabled,.popup-date-picker .date-picker-prev:disabled{visibility:hidden}.popup-date-picker .date-picker-months{margin-bottom:1.5rem;margin-top:7px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-date-picker .date-picker-month{display:grid;grid-template-columns:repeat(7,1fr);justify-content:center;width:100%}.popup-date-picker .date-picker-month .btn-icon{align-items:center;color:var(--secondary-text-color);display:flex;font-size:12px;height:38px;justify-content:center;justify-self:center;width:38px}.popup-date-picker .date-picker-month .btn-icon:disabled{opacity:1}.popup-date-picker .date-picker-month-date:disabled{opacity:.7!important}.popup-date-picker .date-picker-month .btn-icon:not(:disabled){color:var(--primary-text-color)}.popup-date-picker .date-picker-month .btn-icon.active{background-color:var(--primary-color)!important;border-radius:50%;color:var(--badge-text-color)}.popup-schedule .popup-header{justify-content:space-between;margin-bottom:17px;margin-left:0;margin-top:5px}@media only screen and (max-width:600px){.popup-schedule .popup-header{margin-left:3px}}.popup-schedule .popup-header .btn-icon{font-size:22px}.popup-schedule .popup-container{min-width:420px;padding:4px 16px 16px;width:420px}@media only screen and (max-width:600px){.popup-schedule .popup-container{min-width:312px;padding:4px 14px 14px;width:312px}}.popup-schedule .popup-container[data-lines=\"5\"]{top:-16px}.popup-schedule .popup-container[data-lines=\"7\"]{top:16px}.popup-schedule .date-picker-month{margin-left:2px;margin-right:-20px;width:auto}@media only screen and (max-width:600px){.popup-schedule .date-picker-month{margin-left:0;margin-right:-6px}}.popup-schedule .date-picker-month-title{font-size:20px;font-weight:var(--font-weight-bold);margin-left:-5rem}@media only screen and (max-width:600px){.popup-schedule .date-picker-month-title{margin-left:-2rem}}.popup-schedule .date-picker-month .btn-icon{font-size:14px;font-weight:var(--font-weight-bold);height:36px;justify-self:auto;margin-top:-4px;width:36px}.popup-schedule .date-picker-month-date:disabled{color:#9ba3a8!important}.popup-schedule .date-picker-month-day{color:var(--primary-text-color)!important;font-size:14px!important;font-weight:var(--font-weight-bold)}.popup-schedule .date-picker-months{margin-bottom:14px}@media only screen and (max-width:600px){.popup-schedule .date-picker-months{margin-bottom:13px}}.popup-schedule .date-picker-time{display:flex;justify-content:center;margin-bottom:1.5rem}@media only screen and (max-width:600px){.popup-schedule .date-picker-time{margin-bottom:22px}}.popup-schedule .date-picker-time .input-field{width:80px}.popup-schedule .date-picker-time .input-field-input{text-align:center}.popup-schedule .date-picker-time-delimiter{padding:14px 20px}.popup-schedule .date-picker-controls .btn-icon:disabled{visibility:visible}.popup-schedule .btn-primary{font-weight:400}@media only screen and (max-width:600px){.popup-schedule .btn-primary{widtH:280px;height:50px;margin-left:2px}}.popup-create-poll .popup-container{max-height:min(640px,100%);padding:0}.popup-create-poll .radio-field{margin:0}.popup-create-poll .radio-field .radio-field-main:before{left:.25rem}.popup-create-poll .radio-field .radio-field-main:after{left:.5625rem}.popup-create-poll .hidden-widget .btn-icon,.popup-create-poll .radio-field:first-child:last-child .btn-icon{opacity:0!important;pointer-events:none}.popup-create-poll .input-field .btn-icon{opacity:1;position:absolute;right:.4375rem;top:.4375rem;transition:opacity .2s ease;z-index:1}@media only screen and (max-width:600px){.popup-create-poll .input-field .btn-icon{right:.3125rem;top:.3125rem}}.popup-create-poll .caption{color:var(--secondary-text-color);font-weight:var(--font-weight-bold);padding:1rem 1.5rem 0}.popup-create-poll .poll-create-questions{padding:0 1.25rem 1.5rem}.popup-create-poll .poll-create-questions:not(:last-child) .input-field-input{padding-right:3.25rem}.popup-create-poll .poll-create-settings{padding:0 .5rem .5rem}.popup-create-poll .subtitle{font-size:.875rem;line-height:1.2;margin-top:.875rem}.popup-create-poll .btn-primary{width:94px}.popup-create-poll .menu-send{right:20px;top:54px}.popup-create-poll hr:not(.hide){display:block!important}.popup-forward .popup-container{height:40.625rem;max-height:min(40.625rem,100%);max-width:420px;padding:7px 0 0;width:420px}.popup-forward .popup-header{flex:0 0 auto;margin-bottom:7px;padding:0 1rem}@media only screen and (max-width:600px){.popup-forward .popup-header{padding-left:.8125rem}}.popup-forward .popup-title{flex-grow:1;height:100%;padding:0}.popup-forward .chatlist-container,.popup-forward .selector{display:flex;flex:1 1 auto;flex-direction:row;height:auto;overflow:hidden;width:100%}.popup-forward .selector-search-input{font-size:var(--font-size-20);height:100%;line-height:1;padding:.5rem 1.5rem;width:100%}@media only screen and (max-width:600px){.popup-forward .selector-search-input{padding-left:1.1875rem}}.popup-forward .selector .chatlist{margin-top:0!important}.popup-forward .gradient-delimiter{display:none}.popup-forward .sidebar-left-section{margin-bottom:0!important;padding-top:0!important}.popup-instance-deactivated{background-color:rgba(0,0,0,.6)}.popup-instance-deactivated .instance-deactivated-container{margin:auto;pointer-events:none;text-align:center}.popup-instance-deactivated .header{color:#fff;font-size:2rem}.popup-instance-deactivated .subtitle{color:#fff;font-size:1.5rem;line-height:var(--line-height);opacity:.6}.popup-join-chat-invite{-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-join-chat-invite .popup-container{max-width:420px}.popup-join-chat-invite .popup-body{align-items:center;padding:.5rem 0 1.25rem}.popup-join-chat-invite .chat-title{font-weight:var(--font-weight-bold);line-height:var(--line-height);margin:.75rem 0 .25rem}.popup-join-chat-invite .chat-participants-count{color:var(--secondary-text-color);font-size:.875rem;line-height:var(--line-height)}.popup-join-chat-invite .request-caption{margin-top:1rem;text-align:center}.popup-report-messages-confirm{-webkit-user-select:none;-moz-user-select:none;user-select:none}.popup-report-messages-confirm .media-sticker-wrapper{height:100px;margin:0 auto;position:relative;width:100px}.popup-report-messages-confirm .popup-body{margin:1rem 0 .375rem;overflow:visible;overflow:initial}.popup-report-messages-confirm .popup-description{font-size:.875rem;text-align:center}.popup-report-messages-confirm .popup-buttons{margin-top:.625rem}.popup-report-messages-confirm .input-field{width:100%}.popup-call .popup-header{justify-content:space-between;width:100%}.popup-call .popup-title{flex:1 1 auto}.call{align-items:center;color:#fff;height:100%;width:100%}.call.is-full-screen,html.is-mobile .call{border-radius:0}.call.is-full-screen:not(.show-controls){cursor:none}.call.no-video .call-button,.call.no-video .call-button-text,.call.no-video .call-emojis,.call.no-video .call-party-state,.call.no-video .call-subtitle,.call.no-video .call-title,.call.no-video .popup-header,.call.show-controls .call-button,.call.show-controls .call-button-text,.call.show-controls .call-emojis,.call.show-controls .call-party-state,.call.show-controls .call-subtitle,.call.show-controls .call-title,.call.show-controls .popup-header{opacity:1}.call.show-controls .call-video{opacity:.8}.call.show-controls .call-video-blur{opacity:.56}.call .popup-header .btn-icon{color:#fff}.call .popup-header .call-emojis{margin-right:1rem;transform:scale(1.3125)}.call-avatar{border-radius:inherit;bottom:0;left:0;opacity:.7;position:absolute;right:0;top:0;z-index:-1}.call-avatar .avatar-full{font-size:6rem}.call-title{font-size:1.25rem;font-weight:var(--font-weight-bold)}.call-subtitle{font-size:1rem}.call .popup-header,.call-emojis,.call-subtitle,.call-title{opacity:0}body.animation-level-2 .call .popup-header,body.animation-level-2 .call-emojis,body.animation-level-2 .call-subtitle,body.animation-level-2 .call-title{transition:opacity var(--transition-standard-in)}.call-buttons{align-items:center;align-self:center;bottom:1.75rem;display:flex;pointer-events:none;position:absolute;z-index:1}.call-buttons .call-button{pointer-events:all}.call-buttons .call-button-container{--scale:1}.call-buttons .call-button-container.hide-me{--scale:0!important;transform:scale(var(--scale))}body.animation-level-2 .call-buttons .call-button-container.hide-me{transition:transform var(--transition-standard-in)}.call-buttons .call-button-container.hide-me .call-button,.call-buttons .call-button-container.hide-me .call-button-text{opacity:0}body.animation-level-2 .call-buttons .call-button,body.animation-level-2 .call-buttons .call-button-text{transition:opacity var(--transition-standard-in),transform var(--transition-standard-in)}.call-buttons.is-first .call-button,.call-buttons.is-first .call-button-text{transform:translateX(calc(var(--call-button-size)*-.5 + var(--call-button-margin)*-.5))}.call-buttons.is-second{--margin-length:2}.call-buttons.is-second .call-button,.call-buttons.is-second .call-button-text{transform:translateX(calc(var(--call-button-size)*2 + var(--call-button-margin)*var(--margin-length)))}.call.no-screen .call-buttons.is-second{--margin-length:.656875}.call-button{background-color:hsla(0,0%,100%,.1)}.call-button-red{background-color:var(--danger-color)!important}.call-button-green{background-color:var(--gc-green-text-color)!important}.call-button.active{background-color:#fff!important}.call-button.active:before{color:#9e9e9e}.call-button,.call-button-text{opacity:0}.call-video{border-radius:inherit;height:100%;-o-object-fit:contain;object-fit:contain;opacity:1;position:absolute;width:100%}.call-video-container{align-items:center;background-color:#000;bottom:0;display:flex;left:0;position:absolute;right:0;top:0;z-index:-1}.call-video-container.small{border-radius:10px;bottom:8rem;cursor:pointer;left:auto;right:1rem;top:auto;z-index:1}.call-video-blur{border-radius:inherit;height:100%;opacity:.7;position:absolute;width:100%}body.animation-level-2 .call-video,body.animation-level-2 .call-video-blur{transition:opacity var(--transition-standard-in)}.call .call-emojis{transform:scale(1.125)}.call .call-emojis .emoji{margin:0 .125rem}.call-party-states{align-items:center;bottom:calc(4.25rem + var(--call-button-size));display:flex;flex-direction:column;padding:0 1rem;pointer-events:none;position:absolute;width:100%;z-index:2}.call-party-state{align-items:center;-webkit-backdrop-filter:blur(25px);backdrop-filter:blur(25px);background-color:hsla(0,0%,100%,.2);border-radius:1.625rem;color:#fff;display:flex;font-size:.875rem;font-weight:var(--font-weight-bold);height:1.625rem;line-height:1.625rem;margin-top:1rem;max-width:100%;opacity:0;padding:0 .625rem;transform:scale(0) translateY(0)}body.animation-level-2 .call-party-state{transition:opacity var(--transition-standard-in),transform var(--transition-standard-in)}.call-party-state .rlottie-icon{flex:0 0 auto;height:1.875rem!important;margin-left:-.25rem;margin-right:.25rem;width:1.875rem!important}.call-party-state.is-visible:not(.backwards){transform:scale(1) translateY(0)}.call-party-state-text,.call-title{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.call.two-button-rows .call-buttons.is-first .call-button,.call.two-button-rows .call-buttons.is-first .call-button-text{transform:translateY(calc(var(--call-button-size)*-1 + var(--call-button-margin)*-1 + -1.125rem))}.call.two-button-rows .call-buttons.is-second .call-button,.call.two-button-rows .call-buttons.is-second .call-button-text{transform:translateX(0)}.popup-group-call:not(.movable-element){top:7rem}.popup-group-call:not(.movable-element) .group-call{border-bottom-left-radius:0;border-bottom-right-radius:0}.popup-group-call .popup-body{justify-content:space-between}.popup-group-call .popup-container{background-color:var(--gc-background-color);color:var(--gc-primary-text-color)}.popup-group-call .popup{z-index:6}.group-call{--call-button-margin:1.25rem;height:100%;padding:0 .5rem;width:100%}.group-call:after{background:linear-gradient(180deg,rgba(33,33,33,0) 0,rgba(33,33,33,.65) 48.54%,var(--gc-background-color) 100%);bottom:0;content:\" \";height:7.5rem;left:0;position:absolute;right:0}.group-call-header{height:3.5rem;margin-bottom:.125rem;padding:0 .5rem}.group-call-header .btn-icon{color:inherit;flex:0 0 auto}.group-call-header-info{flex:1 1 auto;margin-left:1.5rem;overflow:hidden}.group-call-header-title{font-weight:var(--font-weight-bold)}.group-call-header-subtitle,.group-call-header-title{font-size:var(--font-size-16);line-height:var(--line-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.group-call-header-subtitle{color:var(--gc-secondary-text-color);font-size:.875rem}.group-call-buttons{align-items:center;align-self:center;bottom:1.75rem;display:flex;justify-content:space-between;position:absolute;z-index:1}.group-call-button{background-color:var(--gc-button-unmuted-color);color:var(--gc-primary-text-color);opacity:1}.group-call[data-mic-state=muted] .group-call-button{background-color:var(--gc-button-muted-color)}.group-call[data-mic-state=hand] .group-call-button{background-color:var(--gc-button-hand-color)}.group-call:not(.is-big-layout)[data-mic-state=unmuted] .group-call-button{background-color:var(--gc-button-unmuted-fill-color)}.group-call-button-red{background-color:var(--gc-button-leave-color)!important}.group-call[data-mic-state=unmuted] .group-call-microphone-button{background:linear-gradient(230.46deg,#00a3b4 12.94%,#00cb47 86.29%)}.group-call[data-mic-state=muted] .group-call-microphone-button{background:linear-gradient(225deg,#4eabf8 14.73%,#3478f6 85.27%)}.group-call[data-mic-state=hand] .group-call-microphone-button{background:linear-gradient(225deg,#df44b8 14.73%,#3851eb 85.27%)}.group-call-participant-menu{z-index:5}.group-call-participant{padding-right:.5rem}.group-call-participant-status-icon{display:inline-block;font-size:1.125rem;height:1.125rem;line-height:1;margin-right:6px;vertical-align:middle;width:1.125rem}.group-call-participant-status-container{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.group-call-participant .dialog-subtitle,.group-call-participant .dialog-title{padding-right:2.5rem}.group-call-participant-muted-icon-container{position:absolute!important;right:.5rem}.group-call-participant-video-container{align-items:center;background-color:#000;border-radius:10px;cursor:pointer;display:flex;flex:1 1 auto;height:15rem;margin:.25rem;overflow:hidden;position:relative;width:100%;width:33%}.group-call-participant-video-container:after{background:linear-gradient(180deg,transparent 55.62%,rgba(0,0,0,.5) 86.46%);bottom:0;content:\" \";left:0;position:absolute;right:0;top:0}.group-call-participant-video-container .group-call-participant-status-icon{font-size:1.25rem;height:1.25rem;width:1.25rem}.group-call-participant-video-container:after,.group-call-participant-video-header,.group-call-participant-video-info{opacity:0}body.animation-level-2 .group-call-participant-video-container:after,body.animation-level-2 .group-call-participant-video-header,body.animation-level-2 .group-call-participant-video-info{transition:opacity var(--transition-standard-in)}.group-call-participant-video-header,.group-call-participant-video-info{align-items:center;bottom:.25rem;display:flex;justify-content:space-between;left:0;padding:0 .5rem 0 .75rem;position:absolute;right:0;z-index:1}.group-call-participant-video-header{bottom:auto;justify-content:flex-end;padding-right:.75rem;padding-top:.875rem;top:0}.group-call-participant-video-header .group-call-pin-icon{font-size:1.5rem;height:1.5rem;width:1.5rem}.group-call-participant-video-info .peer-title{font-weight:var(--font-weight-bold)}.group-call-participant-video-info .peer-title,.group-call-participant-video-info-left{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.group-call-participant-video-info .group-call-participant-status-container{margin-top:-1px;opacity:.6}.group-call-participant-video-info-left{flex:1 1 auto}.group-call-participant-video-info-right{flex:0 0 auto;height:2rem;margin-left:.75rem;width:2rem}.group-call-participant .is-speaking{color:var(--gc-green-text-color)}.group-call-participant .is-waiting{color:var(--gc-blue-text-color)}.group-call-participants{border-radius:10px;flex:1 1 auto;overflow:hidden}.group-call-participants-scrollable{border-radius:inherit;height:auto;padding-bottom:6rem;position:relative}.group-call-participants-video-container{display:flex;flex-wrap:wrap;margin:-.25rem -.25rem 0}.group-call-participants-video-container:not(.show-controls),.group-call-participants-video-container:not(.show-controls) .group-call-participant-video-container{cursor:none}.group-call-participants-video-container:empty{display:none}.group-call-participants-video-container[data-layout=\"3\"] .group-call-participant-video-container:first-child{width:100%}.group-call-participants-video-container[data-layout=\"3\"] .group-call-participant-video-container:nth-child(n+2),.group-call-participants-video-container[data-layout=\"4\"] .group-call-participant-video-container{flex:1 0 auto;height:auto}.group-call-participants-video-container[data-layout=\"3\"] .group-call-participant-video-container:nth-child(n+2):before,.group-call-participants-video-container[data-layout=\"4\"] .group-call-participant-video-container:before{content:\" \";display:block;padding-top:100%}.group-call-participants-video-container.show-controls .group-call-participant-video-container:after,.group-call-participants-video-container.show-controls .group-call-participant-video-header,.group-call-participants-video-container.show-controls .group-call-participant-video-info{opacity:1}.group-call-participants .chatlist{background:none;margin:0 auto;max-width:600px;padding:0}.group-call-participants .user-title{color:var(--gc-primary-text-color)}.group-call-participants .user-last-message{color:var(--gc-secondary-text-color)}.group-call-big-video-container{position:relative}.group-call-big-video-container .group-call-participants-video-container{margin-bottom:.25rem;min-height:100%}.group-call-big-video-container .group-call-participant-video-container{height:auto}.group-call-big-video-container .group-call-participant-video-container:before{padding-top:56.25%!important}.group-call-cfs,.group-call:not(.is-big-layout) .group-call-big-video-container,.group-call:not(.is-big-layout) .popup-body .group-call-header,.group-call:not(.is-big-layout).has-pinned .group-call-participant-video-container:not(.video-hidden){display:none}.group-call.is-full-screen{border-radius:0}.group-call.is-big-layout>.group-call-header,.group-call.is-full-screen>.group-call-header{padding:0 1rem}.group-call.is-big-layout:not(.is-full-screen){--gc-right-column-width:17.5rem}.group-call.is-big-layout:not(.is-full-screen) .group-call-cfs{display:flex}.group-call.is-big-layout{background-color:#000}.group-call.is-big-layout:after{content:none}html.no-touch .group-call.is-big-layout>.group-call-header .btn-icon:active,html.no-touch .group-call.is-big-layout>.group-call-header .btn-icon:hover{background-color:hsla(207,4%,46%,.3)}.group-call.is-big-layout .video-hidden{display:none}.group-call.is-big-layout.is-right-column-shown .popup-body{right:0}.group-call.is-big-layout.is-right-column-shown .group-call-big-video-container{width:calc(100% - var(--gc-right-column-width))}.group-call.is-big-layout.is-right-column-shown .group-call-buttons{transform:translateX(calc(var(--gc-right-column-width)/-2))}.group-call.is-big-layout.is-right-column-shown .popup-container{--translateX:calc(var(--gc-right-column-width)/-2)}.group-call.is-big-layout .group-call-header-title{font-size:1.25rem}.group-call.is-big-layout .popup-body{background-color:var(--gc-background-color);bottom:0;padding:inherit;position:absolute;right:calc(var(--gc-right-column-width)*-1);top:0;width:var(--gc-right-column-width)}.group-call.is-big-layout .group-call-buttons{bottom:2.5rem;padding:.75rem}body.animation-level-2 .group-call.is-big-layout .group-call-buttons{transition:opacity var(--transition-standard-in)}.group-call.is-big-layout .group-call-buttons:before{-webkit-backdrop-filter:blur(100px);backdrop-filter:blur(100px);background:rgba(0,0,0,.5);border-radius:1.25rem;bottom:0;content:\" \";left:0;position:absolute;right:0;top:0}.group-call.is-big-layout .group-call-buttons .group-call-button,.group-call.is-big-layout .group-call-buttons:before{opacity:0}.group-call.is-big-layout .group-call-buttons.show-controls .group-call-button,.group-call.is-big-layout .group-call-buttons.show-controls:before{opacity:1}body.animation-level-2 .group-call.is-big-layout .group-call-buttons:before{transition:opacity var(--transition-standard-in)}body.animation-level-2 .group-call.is-big-layout .group-call-buttons .group-call-button{transition:opacity var(--transition-standard-in),background-color var(--transition-standard-in)}.group-call.is-big-layout .group-call-participants-scrollable{padding-bottom:.5rem}.group-call.is-big-layout .group-call-header-subtitle{display:none}.popup-sponsored .scrollable-y{margin:0 -1.5rem;max-height:25rem;padding:.5rem 1.5rem;position:relative;-webkit-user-select:text;-moz-user-select:text;user-select:text;width:calc(100% + 3rem)}.popup-mute .popup-container{min-width:16rem}.popup-reacted-list{--size:1.5rem;--custom-emoji-size:var(--size)}.popup-reacted-list .popup-container{height:600px;max-height:600px;padding:0;width:25rem}.popup-reacted-list .popup-header{border-bottom:1px solid var(--border-color);margin:0;min-height:3.5625rem;padding:.25rem .75rem .75rem}.popup-reacted-list .popup-close{height:40px;margin-right:.5rem;margin-top:.375rem;order:-1}.popup-reacted-list .reaction{--reaction-size:var(--size);--additional-height:.75rem;--margin:.5rem;--background-color:var(--light-filled-primary-color);--counter-color:var(--primary-color);flex:1 0 auto;justify-content:space-evenly}.popup-reacted-list .reaction.is-chosen:not(.backwards){--counter-color:#fff}.popup-reacted-list .reaction-sticker-icon{align-items:center;display:flex;font-size:1.25rem!important;margin:0}.popup-reacted-list .sidebar-left-section{margin-bottom:0!important}.popup-reacted-list .tabs-container{flex:1 1 auto;overflow:hidden}.popup-reacted-list .tabs-tab{background-color:var(--surface-color)}.popup-reacted-list .reacted-list-reaction-icon{display:flex;height:var(--size);position:absolute;right:1rem;top:50%;transform:translateY(-50%);width:var(--size)}.popup-reacted-list .chatlist-chat{padding-right:3.25rem!important}.popup-payment .popup-container{border-radius:16px;max-height:min(100%,43.5rem);max-width:26.25rem;padding:0;width:26.25rem}.popup-payment .popup-header{height:3.5rem;margin:0;padding:0 1rem}.popup-payment.is-loading .popup-container{min-height:26.25rem}.popup-payment .scrollable{display:flex;flex:1 1 auto;flex-direction:column}.popup-payment hr{display:block!important;margin:.5rem 0!important;padding:0!important}.popup-payment .input-field{--height:3rem;margin:.75rem .5rem 0}.popup-payment .input-field-input{--padding:.75rem}.popup-payment .input-fields-row .input-field{margin-top:1.25rem}.popup-payment .sidebar-left-section{padding:0!important}.popup-payment .sidebar-left-section-name+.input-field,.popup-payment .sidebar-left-section-name+.input-fields-row .input-field{margin-top:.75rem}.popup-payment .sidebar-left-section .row{margin-top:.5rem}.popup-payment .sidebar-left-section-content{margin:0 .5rem!important}.popup-payment .select-wrapper{box-shadow:var(--menu-box-shadow);max-height:10rem}.popup-payment .select-wrapper li{grid-template-columns:calc(26px + 2rem) 1fr;height:3rem}.popup-payment .payment-verification{border:none;flex:1 1 auto;height:40rem;max-height:100%;width:100%}.popup-payment .row{border-radius:10px}.payment-item{padding:0 1.25rem;width:100%}.payment-item-details{display:flex;flex:0 0 auto;justify-content:space-between;margin-bottom:1rem;overflow:hidden}.payment-item-details:last-child{margin-bottom:0}.payment-item-details-photo{border-radius:10px;flex:0 0 auto;height:6.25rem;margin-right:1rem;width:6.25rem}.payment-item-details-photo .media-photo{border-radius:inherit}.payment-item-details-lines{display:flex;flex:1 1 auto;flex-direction:column}.payment-item-details-lines-title{font-size:var(--font-size-16);font-weight:var(--font-weight-bold);line-height:var(--line-height-16)}.payment-item-details-lines-bot-name,.payment-item-details-lines-description{font-size:var(--font-size-14);line-height:1.25rem}.payment-item-details-lines-bot-name{color:var(--secondary-text-color)}.payment-item-prices{display:flex;flex-direction:column;margin:1rem .25rem .5rem}.payment-item-prices-price{color:var(--secondary-text-color);display:flex;font-weight:500;justify-content:space-between;line-height:1.1875rem}.payment-item-prices-price+.payment-item-prices-price{margin-top:1.5rem}.payment-item-prices-price.is-total{color:var(--primary-text-color)}.payment-item-tips{display:flex;justify-content:space-between;margin:.75rem -.5rem 1.5rem}.payment-item-tips-tip{--background-intensity:.1;background-color:rgba(84,190,97,var(--background-intensity));border-radius:1.25rem;color:#3ba748;flex:1 1 auto;font-size:var(--font-size-16);font-weight:var(--font-weight-bold);height:2.5rem;line-height:2.5rem;text-align:center}body.animation-level-2 .payment-item-tips-tip{transition:color .1s ease-in-out,background-color .1s ease-in-out}.payment-item-tips-tip+.payment-item-tips-tip{margin-left:.5rem}html.no-touch .payment-item-tips-tip:not(.active):active,html.no-touch .payment-item-tips-tip:not(.active):hover{--background-intensity:.3}.payment-item-tips-tip.active{--background-intensity:1;color:#fff}.payment-item-tips-input{color:inherit!important;display:inline;font-weight:inherit!important}.payment-item-row{margin:0 .5rem;padding-bottom:0;padding-top:0}.payment-item-method-row .media-photo{border-radius:10px}.payment-item-pay{flex:0 0 auto;height:3rem;margin:1rem;text-transform:uppercase;width:auto}.payment-item-preloader-container{flex:1 1 auto;position:relative}.popup-payment-shipping-methods .popup-container{min-height:auto}.popup-payment-shipping-methods .row{margin-top:0!important}.popup-payment-verification .popup-header:after{background-color:var(--border-color);bottom:-1px;content:\" \";height:1px;left:0;position:absolute;right:0}.popup-payment-card-confirmation .popup-container{min-height:auto}.popup-payment-card-confirmation .input-field-password{margin-top:.5rem!important}.popup-limit .popup-container{min-width:min(100%,22.5rem)}.popup-limit-line{align-items:center;display:flex;flex-direction:column;margin:.75rem 0}.popup-limit-hint{align-items:center;color:#fff;display:flex;font-weight:var(--font-weight-bold);justify-content:center;transform:scale(.6) translate(-280px,16px) rotate(-30deg)}body.animation-level-2 .popup-limit-hint{transition:transform .3s cubic-bezier(.12,1.1,.56,1.2)}.popup-limit-hint.active{transform:scale(1) translate(0) rotate(0)}.popup-limit-hint-icon{display:flex;font-size:1.25rem;margin-right:.25rem}.popup-limit-button.primary{align-items:center;background:linear-gradient(88.39deg,#6c93ff -2.56%,#976fff 51.27%,#df69d1 107.39%);color:#fff!important;display:flex}.popup-limit-button-icon{display:flex;font-size:1.5rem;margin-left:.625rem}.popup-limit .limit-line{align-self:stretch;margin:1rem .5rem 0}.popup-limit:not(.is-locked) .popup-limit-hint{background:linear-gradient(73.4deg,#6c93ff -7.21%,#976fff 114.57%,#df69d1 241.52%);background-size:200px 2rem;border-radius:1rem;height:2rem;padding:0 .75rem;position:relative}.popup-limit:not(.is-locked) .popup-limit-hint:after{background:inherit;background-position-x:calc(-50% - 86px);background-repeat:no-repeat;background-size:inherit;bottom:-9px;-webkit-clip-path:path(\"M0 0H26H24.4853C22.894 0 21.3679 0.632141 20.2426 1.75736L14.4142 7.58579C13.6332 8.36684 12.3668 8.36683 11.5858 7.58579L5.75736 1.75736C4.63214 0.632139 3.10602 0 1.51472 0H0Z\");clip-path:path(\"M0 0H26H24.4853C22.894 0 21.3679 0.632141 20.2426 1.75736L14.4142 7.58579C13.6332 8.36684 12.3668 8.36683 11.5858 7.58579L5.75736 1.75736C4.63214 0.632139 3.10602 0 1.51472 0H0Z\");content:\" \";display:block;height:9px;left:50%;margin-left:-13px;position:absolute;width:100%}.popup-limit.is-locked .popup-limit-hint{background-color:var(--primary-color);border-radius:1.375rem;height:2.75rem;margin-right:-.25rem;padding:0 1.25rem 0 1rem}.popup-limit.is-premium .popup-limit-hint{align-self:flex-end;background:linear-gradient(84.4deg,#6c93ff -4.85%,#976fff 51.72%,#df69d1 110.7%);background-position-x:100%;background-size:200px 2rem;border-bottom-right-radius:0;margin-right:.5rem}body.animation-level-2 .popup-limit.is-premium .popup-limit-hint{transition:transform .3s cubic-bezier(.12,1.1,.56,1.1)}.popup-limit.is-premium .popup-limit-hint:after{background-position-x:134%;bottom:-11.3px;-webkit-clip-path:path(\"M8.44528 0.5H20.5V10.1943C20.5 10.9154 19.9154 11.5 19.1943 11.5C18.8178 11.5 18.4597 11.3375 18.2117 11.0541L10.2274 1.92918C9.75146 1.38523 9.18812 0.924478 8.56057 0.565879L8.44528 0.5Z\");clip-path:path(\"M8.44528 0.5H20.5V10.1943C20.5 10.9154 19.9154 11.5 19.1943 11.5C18.8178 11.5 18.4597 11.3375 18.2117 11.0541L10.2274 1.92918C9.75146 1.38523 9.18812 0.924478 8.56057 0.565879L8.44528 0.5Z\");height:12px;left:100%;margin-left:-20.6px}#auth-pages{background:var(--surface-color);max-width:100%;overflow:hidden}#auth-pages .btn-primary{text-transform:uppercase}@media only screen and (max-width:600px){#auth-pages .btn-primary{height:50px}}#auth-pages .subtitle{margin:0}@media only screen and (max-width:600px){#auth-pages .subtitle{font-size:14px}}#auth-pages .input-wrapper{margin-top:49px}@media only screen and (max-width:600px){#auth-pages .input-wrapper{margin-top:41px;padding:0 16px;width:100%}}#auth-pages .auth-image,#auth-pages .input-wrapper,#auth-pages .subtitle{flex:0 0 auto}#auth-pages>.scrollable{display:flex;flex-direction:column;margin:0 auto;max-width:720px;position:relative}#auth-pages>.scrollable .auth-placeholder{flex:1;min-height:3rem;width:100%}@media screen and (max-height:810px){#auth-pages>.scrollable .auth-placeholder:last-child{display:none}}#auth-pages .tabs-container{margin:0 auto;max-width:720px;min-width:auto;position:relative}#auth-pages .tabs-container .tabs-tab{background-color:var(--surface-color)}#auth-pages .tabs-container .tabs-tab .container{display:flex;flex:1 1 auto;flex-direction:column;height:810px;padding:0;width:100%}@media screen and (max-height:810px){#auth-pages .tabs-container .tabs-tab .container{height:760px}}@media only screen and (max-width:600px){#auth-pages .page-password .input-wrapper{margin-top:31px}}#auth-pages .page-password .input-wrapper .btn-primary{margin-top:1rem}.page-sign .checkbox-field{margin-bottom:.5rem;margin-top:.5rem}.page-sign .auth-image,.page-signUp .auth-image{height:7.5rem;margin-bottom:1.5rem;width:7.5rem}@media only screen and (min-width:601px){.page-sign .auth-image,.page-signUp .auth-image{height:10rem;margin-bottom:1.5rem;width:10rem}}.page-authCode .phone-wrapper{flex:0 0 auto}.sign-logo{fill:var(--primary-color);max-height:100%;max-width:100%}.page-sign .btn-secondary,.page-signQR .btn-secondary{font-weight:400}.page-sign .qr,.page-signQR .qr{margin-top:1.5rem}.page-signQR{overflow:visible!important;overflow:initial!important}.page-signQR .auth-image{align-items:center;display:flex;height:240px!important;justify-content:center;width:240px!important}.page-signQR .auth-image .preloader{left:auto;top:auto;transform:none}.page-signQR .auth-image .qr-canvas{height:100%;width:100%}.page-signQR .auth-image .qr-canvas+.qr-canvas{display:none}.page-signQR .input-wrapper{margin-top:1rem!important}.page-signQR h4{flex:0 0 auto}[dir=ltr] .page-signQR .qr-description{text-align:left}[dir=rtl] .page-signQR .qr-description{text-align:right}.page-signQR .qr-description{line-height:var(--line-height);margin:1rem auto;max-width:480px}.page-signQR .qr-description li{margin-top:.5rem}.page-signUp .auth-image{margin-bottom:14px;margin-top:10px}@media only screen and (max-width:600px){.page-signUp .auth-image{margin-bottom:24px}}.page-signUp .fullName{flex:0 0 auto}@media only screen and (max-width:600px){.page-signUp #signUp{margin-top:100px}}.page-signUp .input-field{text-align:left;text-align:initial}.page-sign .btn-primary{margin-top:1.1875rem}#auth-pages>.scrollable,#main-columns{opacity:1;transition:opacity var(--transition-standard-in)}.page-authCode .auth-image{transform:translateY(12px)}.page-authCode .phone-wrapper{align-items:center;display:flex;justify-content:center;margin:1.375rem 0 .875rem}.page-authCode .phone-wrapper h4[contenteditable]{border:none;border-bottom:2px solid var(--primary-color);outline:none;padding:0 1rem}.page-authCode .phone-wrapper .phone.error{border-color:var(--danger-color)!important}.page-authCode .phone-wrapper .phone{margin:0}.page-authCode .subtitle{margin:0 auto!important;max-width:300px}.page-chats{display:flex;max-width:1682px!important}.page-chats #main-columns{height:100%;max-height:100%;min-height:100%;overflow:hidden;position:relative;width:100%}@media only screen and (max-width:600px){.page-chats .main-column{display:flex!important;width:100%;z-index:1}}@media only screen and (min-width:601px){.page-chats #column-center{background-color:#e6ebee;display:flex!important;width:100%}.page-chats #column-right{display:flex!important}.page-chats .main-column{height:100%;max-height:100%;min-height:100%;position:relative}.page-chats #main-columns{display:flex}}.page-chats #search-container,.page-chats .sidebar-search{flex-direction:column;height:100%;left:0;max-height:100%;overflow:hidden;position:absolute;top:0;width:100%;z-index:3}@media only screen and (min-width:1681px){.page-chats{border-color:var(--border-color);border-style:solid;border-width:0 1px}}.page-chats .avatar-edit{flex:0 0 auto;height:120px;margin:1rem auto 2rem;width:120px}body.animation-level-2 .page-chats .main-column{transition:transform var(--tabs-transition),filter var(--tabs-transition)}body,html{height:100%;margin:0;overflow:hidden;padding:0;width:100%}@media only screen and (max-width:600px){body,html{height:calc(var(--vh, 1vh)*100)}}html.is-ios{-webkit-touch-callout:none;position:fixed;-webkit-user-select:none}html.no-backdrop{--menu-background-color:var(--surface-color);--menu-backdrop-filter:none}@supports(padding:max(0px)){html{padding:0 min(16px,env(safe-area-inset-right)) 0 min(16px,env(safe-area-inset-left))}}html{-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);font-size:16px}body{background-color:var(--body-background-color);color:var(--primary-text-color)}body.deactivated{animation:grayscale-in var(--transition-standard-in) forwards}body.deactivated-backwards{animation:grayscale-out var(--transition-standard-out) forwards}@keyframes grayscale-in{0%{filter:grayscale(0)}to{filter:grayscale(1)}}@keyframes grayscale-out{0%{filter:grayscale(1)}to{filter:grayscale(0)}}a{color:var(--link-color)}button,html,input,optgroup,select,textarea{font-family:Roboto,-apple-system,apple color emoji,BlinkMacSystemFont,Segoe UI,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}a,button,div,input,select,textarea{-webkit-tap-highlight-color:rgba(0,0,0,0)}code,kbd,pre,samp{font-family:var(--font-monospace)}.whole{height:100%;margin:0 auto;max-width:1680px;min-height:100%;width:100%}@media only screen and (min-width:601px){.only-handhelds{display:none!important}}.container{margin:0 auto}h1,h2,h3,h4,h5,h6{font-weight:var(--font-weight-bold)}h4{font-size:2rem;line-height:110%;margin:22px 0 14px}@media only screen and (max-width:600px){h4{font-size:20px;margin:2px 0 8px}}[contenteditable=true],input{background-color:transparent;caret-color:var(--primary-color);color:var(--primary-text-color)}input,textarea{-webkit-appearance:none}input::-webkit-contacts-auto-fill-button,input::-webkit-credentials-auto-fill-button{position:absolute;right:0;visibility:hidden}input:-webkit-autofill:first-line{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,Helvetica Neue,Arial;font-size:16px}.subtitle{color:var(--secondary-text-color);line-height:1.35}.danger{color:var(--danger-color)!important}.danger .c-ripple__circle{background-color:var(--light-danger-color)}.blue,.primary{color:var(--primary-color)!important}.blue .c-ripple__circle,.primary .c-ripple__circle{background-color:var(--light-primary-color)}.primary-text{color:var(--primary-text-color)!important}.color-premium{-webkit-text-fill-color:transparent;background:var(--premium-gradient);-webkit-background-clip:text}.blue:before,.danger:before,.primary:before{color:inherit!important}.bg-warning{background:#fed85a!important}.contextmenu{bottom:auto!important;position:fixed!important;right:auto!important;width:auto!important;z-index:4!important}.preloader{height:50px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:50px}.preloader .preloader-path{stroke:var(--primary-color)}@keyframes thumbnail-fade-in-opacity{0%{opacity:0}to{opacity:.8}}@keyframes fade-in-opacity{0%{opacity:0}to{opacity:1}}@keyframes fade-out-opacity{0%{opacity:1}to{opacity:0}}@keyframes fade-in-backwards-opacity{0%{opacity:1}to{opacity:0}}@keyframes fade-out-backwards-opacity{0%{opacity:0}to{opacity:1}}@keyframes fade-in-opacity-fade-out-opacity{0%{opacity:0}10%{opacity:1}50%{opacity:1}to{opacity:0}}.toast{-webkit-backdrop-filter:blur(25px);backdrop-filter:blur(25px);background-color:rgba(0,0,0,.66);border-radius:10px;color:#fff;font-size:1rem;left:50%;max-width:min(30rem,calc(100vw - 2rem));opacity:0;padding:.5rem 1rem;position:fixed;top:50%;transform:translate(-50%,-50%);z-index:5}.toast.is-visible{opacity:1}body.animation-level-2 .toast{transition:opacity var(--transition-standard-in)}.toast b{color:inherit}.toast a{color:#60a5e9!important;cursor:pointer}hr{border:none;border-top:1px solid var(--border-color);margin:0;padding-bottom:.5rem;width:100%}b{font-weight:var(--font-weight-bold)}.avatar-edit{border-radius:50%;cursor:pointer;overflow:hidden;position:relative}.avatar-edit.is-forum{border-radius:var(--avatar-border-radius-forum)}.avatar-edit-canvas{background:linear-gradient(var(--avatar-color-top),var(--avatar-color-bottom));height:100%;max-height:100%;max-width:100%;width:100%}html.no-touch body.animation-level-2 .avatar-edit .tgico-cameraadd{transform:translateY(-50%) translateX(-50%) scale(1);transition:transform .2s ease-in-out}html.no-touch body.animation-level-2 .avatar-edit:hover .tgico-cameraadd{transform:translateY(-50%) translateX(-50%) scale(1.2)}.avatar-edit .tgico-cameraadd{color:#fff;font-size:3rem;height:3rem;left:50%;line-height:1;position:absolute;top:50%;transform:translateY(-50%) translateX(-50%);width:3rem;z-index:2}.avatar-edit .avatar-placeholder{filter:brightness(.7);height:100%;left:0;position:absolute;top:0;width:100%}.missing-icon{height:1.5rem;width:1.5rem}.missing-icon-path{fill:currentColor}.select-wrapper{background-color:var(--surface-color);border-radius:10px;display:flex;flex-direction:column;flex-wrap:wrap;left:0;max-height:23.5rem;opacity:0;overflow:hidden;position:absolute;top:calc(100% + .5rem);transform:scale(.95);transform-origin:top center;transition:opacity .2s ease-out,transform .2s ease-out;width:100%;z-index:3}.select-wrapper.active{opacity:1;transform:scale(1)}.select-wrapper ul{margin:.5rem 0}[dir=ltr] .select-wrapper li{text-align:left}[dir=rtl] .select-wrapper li{text-align:right}.select-wrapper li{align-items:center;cursor:pointer;display:grid;grid-template-columns:calc(26px + 2rem) 1fr 80px;height:3.5rem;justify-content:space-between;padding:0 1rem}html.no-touch .select-wrapper li:active,html.no-touch .select-wrapper li:hover{background-color:var(--light-secondary-text-color)}.select-wrapper .emoji{font-size:26px;height:26px;line-height:1;width:26px}.select-wrapper .scrollable{position:relative}[dir=ltr] .phone-code{text-align:right}[dir=rtl] .phone-code{text-align:left}.phone-code{color:#9e9e9e}.auth-image{height:166px;margin:0 auto 18px;position:relative;width:166px}@media only screen and (max-width:600px){.auth-image{height:120px;width:120px}}[dir=ltr] .phone-edit{margin-left:.4rem}[dir=rtl] .phone-edit{margin-right:.4rem}.phone-edit{cursor:pointer;font-size:1.5rem;height:1.5rem;line-height:1;opacity:.5;transition:opacity .2s;width:1.5rem}html.no-touch .phone-edit:active,html.no-touch .phone-edit:hover{opacity:1}span.emoji{display:inline!important;font-family:apple color emoji,segoe ui emoji,noto color emoji,android emoji,emojisymbols,emojione mozilla,twemoji mozilla,segoe ui symbol;line-height:1!important;vertical-align:baseline!important;vertical-align:initial!important}@media not screen and (-webkit-min-device-pixel-ratio:2),not screen and (min-device-pixel-ratio:2),not screen and (min-resolution:192dpi),not screen and (min-resolution:2dppx){html[dir=ltr]:not(.is-safari) span.emoji{margin-right:5px!important}html[dir=rtl]:not(.is-safari) span.emoji{margin-left:5px!important}html[dir=ltr]:not(.is-safari) avatar-element span.emoji{margin-right:0!important}html[dir=rtl]:not(.is-safari) avatar-element span.emoji{margin-left:0!important}}img.emoji{display:inline-block;height:18px;max-height:100%;max-width:100%;vertical-align:middle;width:18px}[contenteditable=true]{cursor:text;outline:none;-webkit-user-select:text;-moz-user-select:text;user-select:text;white-space:pre-wrap}[contenteditable=true] .custom-emoji{display:inline-block;margin-bottom:-2px}[contenteditable=true] .custom-emoji:before{content:none}[contenteditable=true] [style*=markup]{font-family:inherit!important}[contenteditable=true] [style*=bold]{font-weight:700}[contenteditable=true] [style*=italic]{font-style:italic}[contenteditable=true] [style*=underline]{text-decoration-line:underline}[contenteditable=true] [style*=strikethrough]{text-decoration-line:line-through}[contenteditable=true] [style*=underline][style*=strikethrough]{text-decoration-line:underline line-through}[contenteditable=true] [style*=monospace]{font-family:var(--font-monospace)!important}[contenteditable=true] [style*=spoiler]{background-color:var(--spoiler-draft-background-color)}[contenteditable][data-placeholder]:before{color:#a2acb4;content:attr(data-placeholder);display:block;opacity:0;pointer-events:none;position:absolute}body.animation-level-2 [contenteditable][data-placeholder]:before{transform:translateX(1.75rem);transition:opacity var(--input-transition) .01s,transform var(--input-transition) .01s}[contenteditable][data-placeholder]:empty:before{opacity:1}body.animation-level-2 [contenteditable][data-placeholder]:empty:before{transform:translateX(0)}.sticky_sentinel{left:0;pointer-events:none;position:absolute;right:0;visibility:hidden}.super-stickers{display:grid;grid-template-columns:repeat(auto-fill,var(--esg-sticker-size));justify-content:space-between;width:100%}html.no-touch .super-sticker:active,html.no-touch .super-sticker:hover{background-color:var(--light-secondary-text-color);border-radius:10px}.fade-in-transition{opacity:1}body.animation-level-2 .fade-in-transition{transition:opacity .2s ease-in-out}.show-more{cursor:pointer;padding-bottom:13px;padding-top:13px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media only screen and (min-width:601px){[dir=ltr] .show-more{padding-left:8px}[dir=rtl] .show-more{padding-right:8px}}[dir=ltr] .show-more .tgico-down{padding-left:1rem;padding-right:2rem}[dir=rtl] .show-more .tgico-down{padding-left:2rem;padding-right:1rem}.show-more .tgico-down{float:left;font-size:24px}.content-empty,.show-more .tgico-down{color:var(--secondary-text-color)}::-moz-selection{background:var(--selection-background-color)}.selection:after,::selection{background:var(--selection-background-color)}.selection:after{bottom:0;content:\" \";left:0;position:absolute;right:0;top:0}.input-something{display:inline-block}.input-selectable{position:relative}@keyframes grow-icon{0%{opacity:.8;transform:scale(.5)}50%{opacity:1;transform:scale(1.1)}to{transform:scale(1)}}@keyframes hide-icon{0%{opacity:.4;transform:scale(1)}to{opacity:0;transform:scale(.5)}}.popup-disable-password .popup-description,.popup-skip-email .popup-description{max-width:284px}.grid{grid-gap:.25rem;display:grid;grid-auto-rows:1fr;grid-template-columns:repeat(3,1fr);width:100%}.grid-item{cursor:pointer;height:0;padding-bottom:100%;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-item-media{height:100%;left:0;-o-object-fit:cover;object-fit:cover;position:absolute;top:0;width:100%}.animated-super-row{--translateY:100%;bottom:0;left:0;position:absolute;right:0;top:0;transition:transform var(--pm-transition),opacity var(--pm-transition)}body.animation-level-0 .animated-super-row{transition:none}.animated-super-row.is-hiding{opacity:0}.animated-super-row.is-hiding.from-top{transform:translate3d(0,calc(var(--translateY)*-1),0)}.animated-super-row.is-hiding.from-bottom{transform:translate3d(0,var(--translateY),0)}.animated-counter{display:inline-flex}.animated-counter-decimal{position:relative}.animated-counter-decimal-placeholder{color:transparent}.animated-counter-decimal-wrapper{bottom:0;left:0;position:absolute;right:0;top:0}middle-ellipsis-element{display:block;overflow:hidden;width:100%}.album-item-media{height:100%;width:100%}html.no-touch .hover-effect:active,html.no-touch .hover-effect:hover{background-color:var(--light-secondary-text-color)}.progress-ring{left:0;pointer-events:none;position:absolute;top:0}.progress-ring__circle{stroke-linecap:round;transition:stroke-dashoffset}.rlottie,.rlottie-vector{bottom:0;height:100%;left:0;max-height:100%;max-width:100%;position:absolute;right:0;top:0;width:100%}.rlottie-icon{pointer-events:none;position:relative}body.animation-level-2 .rlottie.fade-in{animation:fade-in-opacity .2s ease-in-out forwards}.rlottie-vector{fill:rgba(0,0,0,.08)}.canvas-thumbnail{height:100%;position:absolute;width:100%}.media-container-contain{position:relative}.media-container-contain .media-photo{max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain}.media-container-cover{position:relative}.media-container-cover .media-photo{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.media-photo,.media-poster,.media-round,.media-sticker,.media-video{bottom:0;left:0;position:absolute;right:0;top:0}body.animation-level-2 .media-photo.fade-in,body.animation-level-2 .media-poster.fade-in,body.animation-level-2 .media-round.fade-in,body.animation-level-2 .media-sticker.fade-in,body.animation-level-2 .media-video.fade-in{animation:fade-in-opacity .2s ease-in-out forwards}body.animation-level-2 .media-photo.fade-out,body.animation-level-2 .media-poster.fade-out,body.animation-level-2 .media-round.fade-out,body.animation-level-2 .media-sticker.fade-out,body.animation-level-2 .media-video.fade-out{animation:fade-out-opacity .2s ease-in-out forwards}.media-video{z-index:1}.media-sticker{height:100%;margin:auto;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;width:100%}.media-sticker-wrapper.is-premium-sticker:before{align-items:center;background:rgba(0,0,0,.2);background-image:var(--lock-url);background-repeat:no-repeat;background-size:cover;border-radius:50%;bottom:.125rem;color:#fff;display:flex;height:1.25rem;justify-content:center;left:50%;position:absolute;transform:translateX(-50%);width:1.25rem;z-index:1}body.is-premium .media-sticker-wrapper.is-premium-sticker:after,body.is-premium .media-sticker-wrapper.is-premium-sticker:before{content:none}.media-round{max-height:var(--round-video-size);max-width:var(--round-video-size);z-index:1}.media-round canvas{border-radius:50%;height:100%;position:relative;width:100%}.media-round .video-time{background-color:var(--message-highlightning-color)!important;padding:0 .375rem}[dir=ltr] .media-round .video-time:after,[dir=ltr] .media-round .video-time:before{margin-left:.25rem}[dir=rtl] .media-round .video-time:after,[dir=rtl] .media-round .video-time:before{margin-right:.25rem}.media-round.is-unread .video-time:before{background-color:#fff;border-radius:50%;content:\" \";height:.5rem;order:1;width:.5rem}.media-round.is-paused .video-time:after{align-items:center;content:\"\";display:flex;font-size:1.125rem;order:2}.gradient-delimiter{background-color:var(--background-color-true);height:.75rem;position:relative;width:100%}.gradient-delimiter:before{background:linear-gradient(180deg,rgba(0,0,0,.06),transparent 20%,transparent 94%,rgba(0,0,0,.06));bottom:0;content:\" \";left:0;position:absolute;right:0;top:0}.sidebar-left-section{background-color:var(--surface-color);box-shadow:0 1px 3px 0 var(--section-box-shadow-color);margin-bottom:.75rem;padding:.5rem 0!important}.sidebar-left-section.no-shadow{box-shadow:none!important}.sidebar-left-section-name{padding:.5rem 1rem}.sidebar-left-section-caption{font-size:var(--font-size-14);line-height:var(--line-height-14);margin:-.1875rem 0 1rem;padding:0 1.5rem}.sidebar-left-section-caption:first-child{margin-bottom:.8125rem;margin-top:.8125rem}@media only screen and (max-width:600px){.sidebar-left-section-caption{padding:0 1rem}}.sidebar-left-section-container{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sidebar-left-section-container a{cursor:pointer}hr{display:none!important}.tgico-admin:before,.tgico-fontsize:before{font-size:20px!important;padding:2px}.tgico-endcall_filled,.tgico-phone_filled{font-size:26px!important}.stealthy{left:0;margin:0;max-height:1px;max-width:1px;opacity:0;outline:none;overflow:hidden;pointer-events:none;position:absolute;top:0;z-index:-1}.navigable-list .active{background-color:var(--light-secondary-text-color);border-radius:inherit}.super-emojis{--esg-emoji-total-size:calc(var(--esg-emoji-size) + 0.5rem);--custom-emoji-size:var(--esg-emoji-size);grid-column-gap:2.44px;--esg-emoji-size:2.125rem;--esg-emoji-total-size:2.625rem;--custom-emoji-size:2.25rem;-moz-column-gap:2.44px;column-gap:2.44px;-moz-column-gap:.25rem;column-gap:.25rem;display:grid;font-size:var(--esg-emoji-size);grid-template-columns:repeat(auto-fill,var(--esg-emoji-total-size));justify-content:space-between;line-height:var(--esg-emoji-size);position:relative}.super-emojis .super-emoji{border-radius:8px;cursor:pointer;display:inline-block;height:var(--esg-emoji-total-size);line-height:inherit;margin-left:.0625rem;margin-right:.0625rem;padding:.25rem;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:var(--esg-emoji-total-size)}.super-emojis .super-emoji .emoji-placeholder{background-color:var(--light-secondary-text-color);border-radius:50%;height:1.75rem;left:7px;pointer-events:none;position:absolute;top:7px;width:1.75rem}body.animation-level-2 .super-emojis .super-emoji .emoji-placeholder{opacity:0;transition:opacity .2s ease-in-out}body.animation-level-2 .super-emojis .super-emoji img{opacity:1;transition:opacity .2s ease-in-out}.super-emojis .super-emoji .emoji{height:100%;margin:0;vertical-align:baseline;vertical-align:initial;width:100%}.super-emojis .super-emoji.active,html.no-touch .super-emojis .super-emoji:active,html.no-touch .super-emojis .super-emoji:hover{background-color:var(--light-secondary-text-color)}.super-emojis.not-local .super-emoji{padding:.1875rem}.super-emojis .super-emoji{margin:0}.super-emojis:not(.not-local) .super-emoji{overflow:hidden}html.native-emoji .super-emojis:not(.not-local) .super-emoji{padding-bottom:.3125rem;padding-top:.3125rem}.super-emojis .custom-emoji{display:block}.super-emojis .custom-emoji-renderer{z-index:1}.super-emojis .custom-emoji:before{content:none}.tgico-char:before{font-family:Roboto!important;font-weight:var(--font-weight-bold);text-align:center;width:1.5rem}.tgico-char.z:before{content:\"Z\"}.tgico-char.w:before{content:\"W\"}.sending-status:empty{display:none}.sending-status .tgico-sendingerror{color:var(--danger-color)}.sending-status-icon{line-height:1!important;position:absolute}.quick-reaction-title{align-items:center;display:flex}.quick-reaction-sticker{height:32px!important;margin:0 .5rem 0 0!important;position:relative!important;width:32px!important}.verified-icon-svg{height:1rem;width:1rem}.verified-icon-check{fill:#fff}.verified-icon-background{fill:var(--primary-color)}[dir=ltr] .emoji-status,[dir=ltr] .premium-icon,[dir=ltr] .verified-icon{margin-left:.125rem}[dir=rtl] .emoji-status,[dir=rtl] .premium-icon,[dir=rtl] .verified-icon{margin-right:.125rem}.emoji-status,.premium-icon,.verified-icon{align-items:center;display:flex;flex:0 0 auto;font-size:1rem;height:1.25rem;justify-content:center;width:1.25rem}[dir=ltr] .emoji-status{margin-left:.25rem}[dir=rtl] .emoji-status{margin-right:.25rem}.emoji-status{height:1.125rem;position:relative;width:1.125rem}.premium-icon{color:var(--primary-color);margin-top:-.0625rem}.badge-fake{border:1px solid var(--danger-color);border-radius:.185rem;color:var(--danger-color);flex:0 0 auto;font-size:.625rem;font-weight:var(--font-weight-bold);line-height:1!important;margin-left:.25rem;margin-right:.25rem;padding:.125rem .25rem}.peer-title.with-icons{align-items:center;display:flex;overflow:hidden}.peer-title-inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.limit-line{display:flex;font-weight:var(--font-weight-bold);height:2rem}.limit-line-free{color:#000}.limit-line-premium{color:#fff}.limit-line-free{background-color:#f1f3f5;border-bottom-left-radius:10px;border-top-left-radius:10px}.limit-line-premium{background:linear-gradient(84.4deg,#6c93ff -4.85%,#976fff 51.72%,#df69d1 110.7%);border-bottom-right-radius:10px;border-top-right-radius:10px}.limit-line-free,.limit-line-premium{align-items:center;display:flex;flex:1 1 0;justify-content:space-between;padding:0 .75rem}.movable-element{--size:.5rem;position:relative}.movable-element-resize-handler{position:absolute}.movable-element-resize-handler-side-n,.movable-element-resize-handler-side-s{cursor:row-resize;height:var(--size);left:0;right:0}.movable-element-resize-handler-side-e,.movable-element-resize-handler-side-w{bottom:0;cursor:col-resize;top:0;width:var(--size)}.movable-element-resize-handler-side-n{top:0}.movable-element-resize-handler-side-e{right:0}.movable-element-resize-handler-side-s{bottom:0}.movable-element-resize-handler-side-w{left:0}.movable-element-resize-handler-side-ne,.movable-element-resize-handler-side-nw,.movable-element-resize-handler-side-se,.movable-element-resize-handler-side-sw{height:var(--size);width:var(--size);z-index:1}.movable-element-resize-handler-side-ne,.movable-element-resize-handler-side-sw{cursor:nesw-resize}.movable-element-resize-handler-side-nw,.movable-element-resize-handler-side-se{cursor:nwse-resize}.movable-element-resize-handler-side-ne{right:0;top:0}.movable-element-resize-handler-side-se{bottom:0;right:0}.movable-element-resize-handler-side-sw{bottom:0;left:0}.movable-element-resize-handler-side-nw{left:0;top:0}[dir=ltr] .chatlist-chat.row-with-padding{padding-left:4.5rem!important}[dir=rtl] .chatlist-chat.row-with-padding{padding-right:4.5rem!important}.chatlist-chat span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chatlist-chat .row-title{font-size:var(--font-size-16)!important;line-height:1.375rem}.chatlist-chat .row-title-right-secondary{font-size:var(--font-size-12)!important;line-height:var(--line-height-12)!important;margin-top:-.4375rem}.chatlist-chat .row-subtitle{display:block!important}.chatlist-chat .row-row{height:1.375rem}.chatlist-chat.chatlist-chat-abitbigger .row-subtitle{margin-top:0}.chatlist-chat.chatlist-chat-bigger .row-subtitle{font-size:var(--font-size-16)!important;line-height:1.375rem;margin-top:0}.chatlist-chat.chatlist-chat-bigger .row-subtitle-row{margin-top:.125rem}.chatlist-chat.chatlist-chat-bigger .row-title .peer-title{font-weight:var(--font-weight-bold)}.username-purchase-help b{color:var(--danger-color)!important;font-weight:var(--font-weight-normal)!important}.media-spoiler-container{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0;z-index:1}.media-spoiler-container.is-revealing{opacity:1}.media-spoiler-container.is-revealing:not(.backwards){opacity:0}.media-spoiler-container.is-revealing.animating{transition:opacity var(--transition-standard-out)}.media-spoiler .canvas-thumbnail,.media-spoiler-thumbnail{height:100%;-o-object-fit:initial!important;object-fit:fill!important;position:absolute;width:100%}.accordion{height:0;overflow:hidden}.accordion.is-expanded{height:var(--max-height)}body.animation-level-2 .accordion{transition:height var(--transition-standard-in)}.accordion-icon{color:var(--secondary-text-color);display:inline-block;font-size:1.25rem;line-height:0;transform:rotate(0deg) translateY(4px)}body.animation-level-2 .accordion-icon{transition:transform var(--transition-standard-in)}.accordion-toggler-expanded .accordion-icon{transform:translateY(4px) rotate(180deg)}"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/public/main.228ad639cd68cb5735ce.bundle.js b/public/main.b611b259692b9fd072db.bundle.js similarity index 85% rename from public/main.228ad639cd68cb5735ce.bundle.js rename to public/main.b611b259692b9fd072db.bundle.js index 1510f5c2..45ee09aa 100644 --- a/public/main.228ad639cd68cb5735ce.bundle.js +++ b/public/main.b611b259692b9fd072db.bundle.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e,t,n,s,i,o={410:(e,t,n)=>{n.d(t,{GO:()=>r,Tj:()=>i,ZP:()=>a});var s=n(1267);const i=!1,o=i||s.Z.debug,r="undefined"!=typeof window?window:self,a=o},236:(e,t,n)=>{n.d(t,{t:()=>c,h:()=>d});var s=n(4762),i=n(144),o=n(4159);const r=o.Z.version,a=o.Z.build,c={_:"theme",access_hash:"",id:"",settings:[{_:"themeSettings",pFlags:{},base_theme:{_:"baseThemeClassic"},accent_color:3379436,message_colors:[5221966],wallpaper:{_:"wallPaper",pFlags:{default:!0,pattern:!0},access_hash:"",document:void 0,id:"",slug:"pattern",settings:{_:"wallPaperSettings",pFlags:{},intensity:50,background_color:14409147,second_background_color:7054727,third_background_color:14014605,fourth_background_color:8960132}}},{_:"themeSettings",pFlags:{},base_theme:{_:"baseThemeNight"},accent_color:8877281,message_colors:[8877281],wallpaper:{_:"wallPaper",pFlags:{default:!0,pattern:!0,dark:!0},access_hash:"",document:void 0,id:"",slug:"pattern",settings:{_:"wallPaperSettings",pFlags:{},intensity:-50,background_color:16696470,second_background_color:14511289,third_background_color:9842623,fourth_background_color:5200853}}}],slug:"",title:"",emoticon:"🏠",pFlags:{default:!0}},l=(e,t,n)=>Object.assign(Object.assign({},c),{name:e,settings:Object.assign(Object.assign({},c.settings.find((e=>e.base_theme._===t))),{highlightningColor:n})}),d={allDialogsLoaded:{},pinnedOrders:{},contactsListCachedTime:0,updates:{},filtersArr:[],maxSeenMsgId:0,stateCreatedTime:Date.now(),recentEmoji:[],recentCustomEmoji:[],topPeersCache:{},recentSearch:[],version:r,build:a,authState:{_:s.IS_MOBILE?"authStateSignIn":"authStateSignQr"},hiddenPinnedMessages:{},settings:{messagesTextSize:16,distanceUnit:"kilometers",sendShortcut:"enter",autoDownload:{photo:{contacts:!0,private:!0,groups:!0,channels:!0},video:{contacts:!0,private:!0,groups:!0,channels:!0},file:{contacts:!0,private:!0,groups:!0,channels:!0}},autoDownloadNew:{_:"autoDownloadSettings",file_size_max:3145728,pFlags:{video_preload_large:!0,audio_preload_next:!0},photo_size_max:1048576,video_size_max:15728640,video_upload_maxbitrate:100},stickers:{suggest:"all",dynamicPackOrder:!0,loop:!0},emoji:{suggest:!0,big:!0},themes:[l("day","baseThemeClassic","hsla(86.4, 43.846153%, 45.117647%, .4)"),l("night","baseThemeNight","hsla(299.142857, 44.166666%, 37.470588%, .4)")],theme:"system",notifications:{sound:!1},timeFormat:(new Date).toLocaleString().match(/\s(AM|PM)/)?"h12":"h23",liteMode:{all:!1,animations:!1,chat:!1,chat_background:!1,chat_spoilers:!1,effects:!1,effects_premiumstickers:!1,effects_reactions:!1,effects_emoji:!1,emoji:!1,emoji_messages:!1,emoji_panel:!1,gif:!1,stickers:!1,stickers_chat:!1,stickers_panel:!1,video:!1}},playbackParams:{volume:1,muted:!1,playbackRate:1,playbackRates:{voice:1,video:1,audio:1},loop:!1,round:!1},keepSigned:!0,chatContextMenuHintWasShown:!1,stateId:(0,i.d)(32),notifySettings:{}}},8189:(e,t,n)=>{n.d(t,{Z:()=>i});let s=!1;try{const e=document.createElement("canvas").getContext("webgl"),t=e.getExtension("WEBGL_debug_renderer_info"),n=t&&e.getParameter(t.UNMASKED_RENDERER_WEBGL)||"";(n.match(/Apple/)&&!n.match(/Apple GPU/)||-1===e.getSupportedExtensions().indexOf("WEBGL_compressed_texture_s3tc_srgb"))&&(s=!0)}catch(e){}const i=s},993:(e,t,n)=>{n.d(t,{Z:()=>s});const s=n(4089).Z},7328:(e,t,n)=>{let s;if(n.d(t,{Z:()=>i}),n(4762).IS_SAFARI)try{s=+navigator.userAgent.match(/Version\/(.+?) /)[1]>=14}catch(e){s=!1}else s=!0;const i=s},6663:(e,t,n)=>{n.d(t,{Z:()=>s});const s="filter"in(document.createElement("canvas").getContext("2d")||{})},9976:(e,t,n)=>{n.d(t,{Z:()=>s});const s=-1!==navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i)},3731:(e,t,n)=>{var s;n.d(t,{Z:()=>i});const i=!!(null===(s=null===navigator||void 0===navigator?void 0:navigator.geolocation)||void 0===s?void 0:s.getCurrentPosition)&&!1},6818:(e,t,n)=>{n.d(t,{Z:()=>s});const s=n(4089).Z},1174:(e,t,n)=>{n.d(t,{Z:()=>o});var s=n(5269);const i=new Set(["image/jpeg","image/png","image/bmp"]);s.Z&&i.add("image/webp");const o=i},2341:(e,t,n)=>{n.d(t,{Z:()=>r});var s=n(1174),i=n(554);const o=[...s.Z].concat([...i.Z]),r=new Set(o)},9030:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(4762);const i=!!document.createElement("video").canPlayType("video/quicktime")||s.IS_SAFARI||s.IS_APPLE_MOBILE},5783:(e,t,n)=>{n.d(t,{Z:()=>i});const s=document.createElement("audio"),i=!(!s.canPlayType||!s.canPlayType("audio/ogg;").replace(/no/,""))},2365:(e,t,n)=>{n.d(t,{Z:()=>s});const s=!n(4762).IS_FIREFOX&&!1},2820:(e,t,n)=>{n.d(t,{Z:()=>s});const s=!!("getDisplayMedia"in((null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||{}))},2045:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(1267);const i="undefined"!=typeof SharedWorker&&!s.Z.noSharedWorker},5432:(e,t,n)=>{n.d(t,{Z:()=>s});const s="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch},4762:(e,t,n)=>{n.r(t),n.d(t,{IS_ANDROID:()=>r,IS_APPLE:()=>o,IS_APPLE_MOBILE:()=>c,IS_CHROMIUM:()=>a,IS_FIREFOX:()=>d,IS_MOBILE:()=>u,IS_MOBILE_SAFARI:()=>h,IS_SAFARI:()=>l,USER_AGENT:()=>i});var s=n(6761);const i=navigator?navigator.userAgent:null,o=-1!==navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i),r=-1!==navigator.userAgent.toLowerCase().indexOf("android"),a=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor),c=(/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!s.Z.MSStream,l=!!("safari"in s.Z)||!(!i||!(/\b(iPad|iPhone|iPod)\b/.test(i)||i.match("Safari")&&!i.match("Chrome"))),d=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,h=l&&c,u=(void 0===navigator.maxTouchPoints||navigator.maxTouchPoints>0)&&-1!=navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i)},2131:(e,t,n)=>{n.d(t,{Z:()=>s});const s=!!(null===navigator||void 0===navigator?void 0:navigator.vibrate)},554:(e,t,n)=>{n.d(t,{Z:()=>o});var s=n(9030);const i=new Set(["image/gif","video/mp4","video/webm"]);s.Z&&i.add("video/quicktime");const o=i},393:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(4762);const i=!!document.createElement("video").canPlayType("video/webm")&&!s.IS_SAFARI&&!s.IS_APPLE_MOBILE},5269:(e,t,n)=>{n.d(t,{Z:()=>s});const s=document.createElement("canvas").toDataURL("image/webp").startsWith("data:image/webp")},4089:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(4762);const i=!("undefined"==typeof RTCPeerConnection||s.IS_FIREFOX)},2064:(e,t,n)=>{n.d(t,{Dk:()=>g,EM:()=>w,K5:()=>u,Pi:()=>c,WE:()=>o,Y6:()=>a,cw:()=>d,dI:()=>r,e9:()=>f,ix:()=>p,oo:()=>l,py:()=>i,t1:()=>h,tB:()=>y,uY:()=>v});var s=n(3228);function i(e,t,n){e/=255,t/=255,n/=255;const s=Math.max(e,t,n),i=s-Math.min(e,t,n),o=i&&(s===e?(t-n)/i:s==t?2+(n-e)/i:4+(e-t)/i);return[60*(o<0?o+6:o),s&&i/s,s]}function o(e,t,n){const s=(s,i=(s+e/60)%6)=>Math.round(255*(n-n*t*Math.max(Math.min(i,4-i,1),0)));return[s(5),s(3),s(1)]}function r(e,t,n,s=1){e/=255,t/=255,n/=255;const i=Math.max(e,t,n),o=Math.min(e,t,n);let r,a;const c=(i+o)/2;if(i===o)r=a=0;else{const s=i-o;switch(a=c>.5?s/(2-i-o):s/(i+o),i){case e:r=(t-n)/s+(t1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;i=s(c,a,e+1/3),o=s(c,a,e),r=s(c,a,e-1/3)}return[i,o,r,s].map((e=>Math.round(255*e)))}function c(e){const t=[],n="#"===e[0]?1:0;if(e.length===5+n&&(e=(n?"#":"")+"0"+e.slice(n)),e.length===3+n)for(let s=n;s("0"+e.toString(16)).slice(-2))).join("")}function u(e){return function(e){return h(function(e){const t=e.slice(5,-1).split(", "),n=+t.pop(),s=t.map((e=>e.endsWith("%")?+e.slice(0,-1):+e));return a(s[0],s[1],s[2],n)}(e))}(e).slice(0,-2)}function g(e,t,n){const s=new Array(3);for(let i=0;i<3;++i){const o=e[i],r=t[i];s[i]=Math.floor(r+(o-r)*n)}return s}function m(e){return(.2126*e[0]+.7152*e[1]+.0722*e[2])/255}function p(e,t){return e.map(((e,n)=>Math.round((e+t[n])/2)))}function f(e,t,n){const s=i(...t),r=i(...n),a=Math.min(1.5*s[1]/e[1],1);return s[0]=Math.min(360,r[0]-s[0]+e[0]),s[1]=Math.min(1,r[1]*e[1]/s[1]),s[2]=Math.min(1,(r[2]/s[2]+a-1)*e[2]/a),s[2]<.3?n:o(...s)}function v(e,t,n,r){const a=i(...n);if(Math.min(Math.abs(a[0]-e[0]),Math.abs(a[0]-e[0]-360))>30)return n;const c=Math.min(1.5*a[1]/e[1],1);a[0]=Math.min(360,a[0]+t[0]-e[0]),a[1]=Math.min(1,a[1]*t[1]/e[1]),a[2]=Math.min(1,a[2]*(1-c+c*t[2]/e[2]));let l=o(...a);const d=m(n),h=m(l);if(r?d>h:d(0,s.Z)(Math.round(e*t),0,255)))}(l,(1-e)*d/h+e)}return l}function b(e){const t=(e<0?16777215+e:e).toString(16);return"#"+(t.length>=6?t:"0".repeat(6-t.length)+t)}function y(e){return l(b(e))}function w(e){return e.settings?[e.settings.background_color,e.settings.second_background_color,e.settings.third_background_color,e.settings.fourth_background_color].filter(Boolean).map(b).join(","):""}},6009:(e,t,n)=>{function s(e,t){e=e.split(" ",1)[0],t=t.split(" ",1)[0];const n=e.split("."),s=t.split(".");for(let e=0;ei)return 1;if(ts})},8799:(e,t,n)=>{function s(){var e;return!!(null===(e=document.activeElement)||void 0===e?void 0:e.blur)&&(document.activeElement.blur(),!0)}n.d(t,{Z:()=>s})},3910:(e,t,n)=>{function s(e){if(e||(e=window.event),e){e=e.originalEvent||e;try{e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.returnValue=!1,e.cancelBubble=!0}catch(e){}}return!1}n.d(t,{Z:()=>s})},8497:(e,t,n)=>{function s(e,t){return e.closest("."+t)}n.d(t,{Z:()=>s})},5494:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(3035);function i(e){e.style.transform="translateY(-99999px)",e.focus(),(0,s.d1)().then((()=>{e.style.transform=""}))}},8090:(e,t,n)=>{n.d(t,{T:()=>a,Z:()=>c});var s=n(5432),i=n(4762),o=n(8497),r=n(5494);const a=i.IS_SAFARI&&i.IS_MOBILE&&s.Z;if(a){const e="clientY";let t=0;const n={capture:!0,passive:!1},s=n=>{const s=n.touches[0],i=(0,o.Z)(s.target,"scrollable-y");if(i){const o=s[e],r=t-o,a=i.scrollTop,c=i.scrollHeight,l=i.clientHeight,d=a?Math.round(a+i.clientHeight+r):a+r;(c===l||d>=c||d<=0)&&n.preventDefault()}else n.preventDefault()};let i=0;document.addEventListener("focusin",(o=>{!o.target.classList.contains("is-sticky-input-bugged")||o.timeStamp-i<50||((0,r.Z)(o.target),document.addEventListener("touchmove",s,n),document.addEventListener("touchstart",(n=>{if(n.touches.length>1)return;const s=n.touches[0];t=s[e]})))}),{passive:!0}),document.addEventListener("focusout",(e=>{document.removeEventListener("touchmove",s,n),i=e.timeStamp}),{passive:!0}),document.addEventListener("visibilitychange",(()=>{document.activeElement&&document.activeElement.classList.contains("is-sticky-input-bugged")&&document.activeElement.blur&&(0,r.Z)(document.activeElement)}),{passive:!0})}function c(e){a&&e.classList.add("is-sticky-input-bugged")}},6472:(e,t,n)=>{n.d(t,{B:()=>o,Z:()=>i});let s;function i(){window.addEventListener("beforeinstallprompt",(e=>{s=()=>{return t=this,n=void 0,o=function*(){e.prompt();const{outcome:t}=yield e.userChoice;"accepted"===t&&(s=void 0)},new((i=void 0)||(i=Promise))((function(e,s){function r(e){try{c(o.next(e))}catch(e){s(e)}}function a(e){try{c(o.throw(e))}catch(e){s(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(r,a)}c((o=o.apply(t,n||[])).next())}));var t,n,i,o}}))}function o(){return s}},4541:(e,t,n)=>{n.d(t,{Z:()=>c});var s=n(319),i=n(5418);const o=["b","б"],r={},a={text:"Roboto",icons:"tgico",monospace:"Roboto Mono"};function c(e={text:o,icons:void 0,monospace:o}){if(!("fonts"in document))return Promise.resolve();const t=[];for(const n in e){let s=e[n];"all"===s&&(s=o);const i=a[n],c="icons"===n?[500]:[400,500];for(const e of c){const n=(s||[void 0]).map((t=>{var n,s,o,a;const c=[e,"1rem",i].join(" ");return null!==(s=(o=null!==(n=r[c])&&void 0!==n?n:r[c]={})[a=t||""])&&void 0!==s?s:o[a]=document.fonts.load(c,t)}));t.push(...n)}}return Promise.race([Promise.all(t).catch(s.Z),(0,i.Z)(1e3)])}},130:(e,t,n)=>{function s(e,t){i(e),"string"==typeof t?t?e.innerHTML=t:e.replaceChildren():e.replaceChildren(t)}function i(e){e.setAttribute("dir","auto")}n.d(t,{Z:()=>s,m:()=>i})},2586:(e,t,n)=>{n.d(t,{Z:()=>a});var s=n(5432),i=n(3241);const o=s.Z?"touchstart":"mousemove";class r extends i.Z{constructor(){super(),this._isIdle=!0,this.focusPromise=Promise.resolve(),this.focusResolve=()=>{},window.addEventListener("blur",(()=>{this.isIdle=!0,window.addEventListener("focus",(()=>{this.isIdle=!1}),{once:!0})})),window.addEventListener(o,(()=>{this.isIdle=!1}),{once:!0,passive:!0}),this.addEventListener("change",(e=>{e?this.focusPromise=new Promise((e=>{this.focusResolve=e})):this.focusResolve()}))}getFocusPromise(){return this.focusPromise}get isIdle(){return this._isIdle}set isIdle(e){this._isIdle!==e&&(this._isIdle=e,this.dispatchEvent("change",e))}}const a=new r},3228:(e,t,n)=>{function s(e,t,n){return Math.min(n,Math.max(t,e))}n.d(t,{Z:()=>s})},3815:(e,t,n)=>{n.d(t,{Z:()=>o});var s=n(3241);class i extends s.Z{constructor(){super(...arguments),this.overlaysActive=0}get isOverlayActive(){return this.overlaysActive>0}set isOverlayActive(e){this.overlaysActive+=e?1:-1,this.dispatchEvent("change",this.isOverlayActive)}}const o=new i},3035:(e,t,n)=>{let s;function i(e){s?s.push(e):(s=[e],requestAnimationFrame((()=>{const e=s;s=void 0,e.forEach((e=>e()))})))}n.d(t,{AD:()=>l,T2:()=>i,TR:()=>c,d1:()=>d});let o,r,a=!1;function c(e){o?a?e():o.push(e):(o=[e],requestAnimationFrame((()=>{a=!0;for(let e=0;ei((()=>e())))),r.then((()=>{r=void 0})),r)}function d(){return new Promise((e=>{i((()=>{i(e)}))}))}},764:(e,t,n)=>{function s(e,t=e.split("?")){return i(null==t?void 0:t[1])}function i(e){const t={};return e?(e.split("&").forEach((e=>{t[e.split("=")[0]]=decodeURIComponent(e.split("=")[1])})),t):t}n.d(t,{V:()=>i,Z:()=>s})},6714:(e,t,n)=>{n.d(t,{Z:()=>h});var s=n(5432),i=n(3512),o=n(2064),r=n(410),a=function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function r(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}c((s=s.apply(e,t||[])).next())}))};const c={"primary-color":{rgb:!0,light:!0,lightFilled:!0,dark:!0,darkRgb:!0},"message-out-primary-color":{lightFilled:!0},"surface-color":{rgb:!0},"danger-color":{light:!0,dark:!0},"primary-text-color":{rgb:!0},"secondary-text-color":{light:!0,lightFilled:!0},"message-out-background-color":{light:!0,lightFilled:!0,dark:!0,darkFilled:!0},"saved-color":{lightFilled:!0}},l={day:{"primary-color":"#3390ec","message-out-primary-color":"#4fae4e","surface-color":"#ffffff","danger-color":"#df3f40","primary-text-color":"#000000","secondary-text-color":"#707579","saved-color":"#359AD4"},night:{"primary-color":"#8774E1","message-out-primary-color":"#8774E1","surface-color":"#212121","danger-color":"#ff595a","primary-text-color":"#ffffff","secondary-text-color":"#aaaaaa","saved-color":"#8774E1"}},d=new class{constructor(){i.Z.addEventListener("theme_change",(()=>{this.setTheme()}))}get themeColorElem(){return void 0!==this._themeColorElem?this._themeColorElem:this._themeColorElem=document.head.querySelector('[name="theme-color"]')||null}setThemeColor(e=this.themeColor){e||(e=this.isNight()?"#212121":"#ffffff");const t=this.themeColorElem;t&&t.setAttribute("content",e)}setThemeListener(){try{const e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{this.systemTheme=e.matches?"night":"day",i.Z.myId?i.Z.dispatchEvent("theme_change"):this.setTheme()};"addEventListener"in e?e.addEventListener("change",t):"addListener"in e&&e.addListener(t),t()}catch(e){}}applyHighlightningColor(){var e;let t;const n=this.getTheme();(null===(e=n.settings)||void 0===e?void 0:e.highlightningColor)?(t=n.settings.highlightningColor,document.documentElement.style.setProperty("--message-highlightning-color",t)):document.documentElement.style.removeProperty("--message-highlightning-color"),!s.Z&&t&&(this.themeColor=(0,o.K5)(t))}setTheme(){const e=this.isNight(),t=document.head.querySelector('[name="color-scheme"]');t&&t.setAttribute("content",e?"dark":"light"),document.documentElement.classList.toggle("night",e),this.setThemeColor();const n=this.getTheme();this.applyTheme(n);let s=this.styleElement;s||(s=this.styleElement=document.createElement("style"),document.head.append(s));const o=document.createElement("div");this.applyTheme(i.Z.settings.themes.find((e=>"night"===e.name)),o),s.textContent=`.night {${o.style.cssText}}`,this.applyHighlightningColor()}switchTheme(e){return a(this,void 0,void 0,(function*(){yield i.Z.managers.appStateManager.setByKey("settings.theme",e),i.Z.dispatchEvent("theme_change")}))}isNight(){return"night"===this.getTheme().name}getTheme(e=("system"===i.Z.settings.theme?this.systemTheme:i.Z.settings.theme)){return i.Z.settings.themes.find((t=>t.name===e))}bindColorApplier(e){const t=new Set;return{applyAppColor:n=>(t.add(n.name),this.applyAppColor(Object.assign(Object.assign({},n),e))),finalize:()=>{const n=e.isNight;for(const s in c)t.has(s)||this.applyAppColor(Object.assign({name:s,hex:l[n?"night":"day"][s]},e))}}}applyAppColor({name:e,hex:t,element:n,lightenAlpha:s=.08,darkenAlpha:i=s,mixColor:r,isNight:a}){const d=c[e],h=(0,o.oo)(t),u=(0,o.dI)(...h);null!=r||(r=(0,o.oo)(l[a?"night":"day"]["surface-color"]));const g=(0,o.Dk)(h,r,s),m=Object.assign(Object.assign({},u),{l:u.l-100*i});[[e,t],d.rgb&&[e+"-rgb",h.join(",")],d.light&&["light-"+e,`rgba(${h[0]}, ${h[1]}, ${h[2]}, ${s})`],d.lightFilled&&["light-filled-"+e,(0,o.t1)(g)],d.dark&&["dark-"+e,`hsl(${m.h}, ${m.s}%, ${m.l}%)`]].filter(Boolean).forEach((([e,t])=>{n.style.setProperty("--"+e,t)}))}applyNewTheme(e){return a(this,void 0,void 0,(function*(){const t=this.isNightTheme(e),n=this.getTheme(),s=i.Z.settings.themes,o=e.settings.find((e=>e.base_theme._===(t?"baseThemeNight":"baseThemeClassic"))),r=Object.assign(Object.assign({},e),{name:n.name,settings:Object.assign(Object.assign({},o),{highlightningColor:""})});yield this.AppBackgroundTab.setBackgroundDocument(o.wallpaper,r.settings),s[s.indexOf(n)]=r,yield i.Z.managers.appStateManager.setByKey("settings.themes",i.Z.settings.themes),i.Z.dispatchEvent("theme_change")}))}isNightTheme(e){return"night"===e.name||this.isNight()}applyTheme(e,t=document.documentElement){var n;const s=this.isNightTheme(e),i=Array.isArray(e.settings)?e.settings.find((e=>e.base_theme._===(s?"baseThemeNight":"baseThemeClassic"))):e.settings,r=l[s?"night":"day"];let a=(0,o.py)(...(0,o.oo)(r["primary-color"])),c=(0,o.py)(...(0,o.tB)(i.accent_color));const d=(0,o.uY)(a,c,(0,o.oo)(r["primary-color"]),!s),h=(0,o.t1)(d),{applyAppColor:u,finalize:g}=this.bindColorApplier({element:t,isNight:s});if(u({name:"primary-color",hex:h,darkenAlpha:.04}),u({name:"saved-color",hex:h,lightenAlpha:.64,mixColor:[255,255,255]}),!(null===(n=i.message_colors)||void 0===n?void 0:n.length))return;const m=s?.92:.12,p=(0,o.oo)(r["message-out-primary-color"]);a=(0,o.py)(...p);const f=(0,o.Dk)(p,(0,o.oo)(r["surface-color"]),m);let v=(0,o.tB)(i.message_colors[0]);i.message_colors.length>1&&(i.message_colors.slice(1).forEach((e=>{v=(0,o.ix)(v,(0,o.tB)(e))})),v=(0,o.e9)(a,f,v));const b=v;c=(0,o.py)(...b);const y=void 0!==i.outbox_accent_color&&(0,o.py)(...(0,o.tB)(i.outbox_accent_color)),w=(0,o.Dk)(v,(0,o.oo)(r["surface-color"]),m);u({name:"message-out-background-color",hex:(0,o.t1)(w),lightenAlpha:m}),u({name:"message-out-primary-color",hex:s?"#ffffff":(0,o.t1)(y?(0,o.WE)(...y):v),mixColor:w}),g()}};r.GO&&(r.GO.themeController=d);const h=d},2938:(e,t,n)=>{var s=n(4159),i=n(8799),o=n(3910),r=n(8090),a=n(4541),c=n(9976),l=n(4762),d=n(5418);!function(){const e={construct(e,t){let n=t[0]+"";return 0!==n.indexOf("blob:")&&(n+=location.search),new e(n)}};[Worker,"undefined"!=typeof SharedWorker&&SharedWorker].filter(Boolean).forEach((t=>{window[t.name]=new Proxy(t,e)}))}();var h=n(3512),u=n(5432),g=n(2325),m=(n(4110),n(690),n(3855)),p=n(2554),f=n(6714),v=n(3815),b=n(490),y=n(764),w=n(1267),S=n(410);const k="onbeforeinstallprompt"in window;var P=n(6472);document.addEventListener("DOMContentLoaded",(()=>{return e=void 0,t=void 0,E=function*(){var e;Element.prototype.toggleAttribute||(Element.prototype.toggleAttribute=function(e,t){return void 0!==t&&(t=!!t),this.hasAttribute(e)?!!t||(this.removeAttribute(e),!1):!1!==t&&(this.setAttribute(e,""),!0)}),void 0===Node.prototype.replaceChildren&&(Node.prototype.replaceChildren=function(...e){this.textContent="",e&&this.append(...e)}),h.Z.managers=(0,p.Z)(),document.getElementById("manifest").href=`site${l.IS_APPLE&&!l.IS_APPLE_MOBILE?"_apple":""}.webmanifest?v=jw3mK7G9Aq`,b.Z.start();const t=window.visualViewport||window;let _,E=!1;const A=()=>{const e=.01*(E&&!v.Z.isOverlayActive?t.height||t.innerHeight:window.innerHeight);_!==e&&(u.Z&&_1&&(0,i.Z)(),_=e,document.documentElement.style.setProperty("--vh",`${e}px`))};if(window.addEventListener("resize",A),A(),r.T){const e=()=>{E=1===n&&r.T&&!v.Z.isOverlayActive,A(),t!==window&&(E?(window.removeEventListener("resize",A),t.addEventListener("resize",A)):(t.removeEventListener("resize",A),window.addEventListener("resize",A)))};let n;window.onImTabChange=t=>{const s=void 0!==n;n=t,(s||1===n)&&e()},v.Z.addEventListener("change",(()=>{e()}))}if(l.IS_FIREFOX&&!c.Z&&document.addEventListener("dragstart",(e=>{const t=e.target;if("IMG"===t.tagName&&t.classList.contains("emoji"))return(0,o.Z)(e),!1})),c.Z&&document.documentElement.classList.add("native-emoji"),document.addEventListener("dragstart",(e=>{var t;if("IMG"===(null===(t=e.target)||void 0===t?void 0:t.tagName))return e.preventDefault(),!1})),document.addEventListener("contextmenu",(e=>{"IMG"!==e.target.tagName||window.appMediaViewer||(0,o.Z)(e)})),l.IS_FIREFOX&&document.documentElement.classList.add("is-firefox","no-backdrop"),l.IS_MOBILE&&document.documentElement.classList.add("is-mobile"),l.IS_APPLE)l.IS_SAFARI&&document.documentElement.classList.add("is-safari"),l.IS_APPLE_MOBILE?document.documentElement.classList.add("is-ios"):document.documentElement.classList.add("is-mac");else if(l.IS_ANDROID){document.documentElement.classList.add("is-android");const e=()=>{n=!0,window.addEventListener("resize",t,{once:!0})},t=()=>{n=!1,(0,i.Z)()};let n=!1;document.addEventListener("touchend",(t=>{const s=t.target.closest('[contenteditable="true"], input');s&&(document.activeElement===s||n||(console.log("input click",t,document.activeElement,s,s.matches(":focus")),window.addEventListener("resize",e,{once:!0})))}))}u.Z?document.documentElement.classList.add("is-touch"):document.documentElement.classList.add("no-touch"),k&&(0,P.Z)();const Z=performance.now(),C=g.ZP.getCacheLangPack(),[I,L]=yield Promise.all([m.Z.sendState().then((([e])=>e)),C]);function T(e,t){e.style.opacity="0",t.then((()=>{window.requestAnimationFrame((()=>{e.style.opacity=""}))}))}g.ZP.setTimeFormat(I.state.settings.timeFormat),h.Z.managers.rootScope.getPremium().then((e=>{h.Z.premium=e})),f.Z.setThemeListener(),L.appVersion!==s.Z.langPackVersion&&g.ZP.getLangPack(L.lang_code),console.log("got state, time:",performance.now()-Z),"ar"===L.lang_code&&S.Tj,document.documentElement.dir="ltr";let O=I.state.authState;const M=location.hash.split("?"),x=(0,y.V)(null!==(e=M[1])&&void 0!==e?e:M[0].slice(1));if(x.tgWebAuthToken&&"authStateSignedIn"!==O._){const e={token:x.tgWebAuthToken,dcId:+x.tgWebAuthDcId,userId:x.tgWebAuthUserId.toUserId(),isTest:void 0!==x.tgWebAuthTest&&!!+x.tgWebAuthTest,tgAddr:x.tgaddr};if(e.isTest!==w.Z.test){const e=new URLSearchParams(location.search);return+x.tgWebAuthTest?e.set("test","1"):e.delete("test"),void(location.search=e.toString())}h.Z.managers.appStateManager.pushToState("authState",O={_:"authStateSignImport",data:e})}if("authStateSignedIn"!==O._){console.log("Will mount auth page:",O._,Date.now()/1e3);const e=document.getElementById("auth-pages");let t,s;if(e){t=e.querySelector(".scrollable"),u.Z&&!l.IS_MOBILE_SAFARI||t.classList.add("no-scrollbar"),t.style.opacity="0";const n=document.createElement("div");n.classList.add("auth-placeholder"),t.prepend(n),t.append(n.cloneNode())}try{yield Promise.all([Promise.resolve().then(n.bind(n,2831)),Promise.resolve().then(n.bind(n,6702))]).then((([e,t])=>{e.default.setAuthorized(!1),t.default.forceUnsubscribe()}))}catch(e){}switch(O._){case"authStateSignIn":s=(yield Promise.all([n.e(147),n.e(742),n.e(63)]).then(n.bind(n,810))).default.mount();break;case"authStateSignQr":s=(yield Promise.all([n.e(147),n.e(742),n.e(709)]).then(n.bind(n,9709))).default.mount();break;case"authStateAuthCode":s=(yield Promise.all([n.e(147),n.e(742),n.e(53)]).then(n.bind(n,6392))).default.mount(O.sentCode);break;case"authStatePassword":s=(yield Promise.all([n.e(147),n.e(742),n.e(437)]).then(n.bind(n,9437))).default.mount();break;case"authStateSignUp":s=(yield Promise.all([n.e(147),n.e(742),n.e(339)]).then(n.bind(n,8339))).default.mount(O.authCode);break;case"authStateSignImport":s=(yield Promise.all([n.e(147),n.e(742),n.e(231)]).then(n.bind(n,3231))).default.mount(O.data)}t&&(s&&(yield s),T(t,"fonts"in document?Promise.race([(0,d.Z)(1e3),document.fonts.ready]):Promise.resolve()))}else console.log("Will mount IM page:",Date.now()/1e3),T(document.getElementById("main-columns"),(0,a.Z)()),(yield Promise.all([n.e(147),n.e(742),n.e(436)]).then(n.bind(n,5436))).default.mount()},new((_=void 0)||(_=Promise))((function(n,s){function i(e){try{r(E.next(e))}catch(e){s(e)}}function o(e){try{r(E.throw(e))}catch(e){s(e)}}function r(e){var t;e.done?n(e.value):(t=e.value,t instanceof _?t:new _((function(e){e(t)}))).then(i,o)}r((E=E.apply(e,t||[])).next())}));var e,t,_,E}))},1722:(e,t,n)=>{n.d(t,{Z:()=>s});const s=new class{reload(){try{location.reload()}catch(e){}}close(){try{window.close()}catch(e){}}focus(){window.focus()}}},2554:(e,t,n)=>{n.d(t,{Z:()=>c});var s=n(3855),i=n(410);const o={};function r(e,t){return new Proxy(e,{get:(e,n,r)=>{var a;return null!==(a=e[n])&&void 0!==a?a:e[n]=function(e,t){return new Proxy({},{get:(n,r,a)=>(...n)=>{var a;const c=s.Z.invoke("manager",{name:e,method:r,args:n},t);return i.ZP&&(null===(a=o[e])||void 0===a?void 0:a.has(r))&&console.warn("manager request",e,r,n),c}})}(n,t)}})}let a;function c(){return a||(a=r({},!1),a.acknowledged=r({},!0),a)}i.ZP&&(window.DEBUG_MANAGER_REQUESTS=o)},6666:(e,t,n)=>{n.d(t,{Z:()=>c});var s=n(1267),i=n(5471),o=n(5953),r=n(5003);class a{constructor(e){(0,o.Z)(this,e),s.Z.test&&(this.name+="_test"),this.storageIsAvailable=!0,this.log=(0,r.kg)(["IDB",e.name].join("-")),this.log("constructor"),this.openDatabase(!0),a.INSTANCES.push(this)}isAvailable(){return this.storageIsAvailable}openDatabase(e=!1){if(this.openDbPromise&&!e)return this.openDbPromise;const t=(e,t)=>{var n;const s=Array.from(e.indexNames);for(const t of s)e.deleteIndex(t);if(null===(n=t.indexes)||void 0===n?void 0:n.length)for(const n of t.indexes)e.indexNames.contains(n.indexName)||e.createIndex(n.indexName,n.keyPath,n.objectParameters)};try{var n=indexedDB.open(this.name,this.version);if(!n)return Promise.reject()}catch(e){return this.log.error("error opening db",e.message),this.storageIsAvailable=!1,Promise.reject(e)}let s=!1;return setTimeout((()=>{s||n.onerror((0,i.Z)("IDB_CREATE_TIMEOUT"))}),3e3),this.openDbPromise=new Promise(((e,i)=>{n.onsuccess=t=>{s=!0;const o=n.result;let r=!1;this.log("Opened"),o.onerror=e=>{this.storageIsAvailable=!1,this.log.error("Error creating/accessing IndexedDB database",e),i(e)},o.onclose=e=>{this.log.error("closed:",e),!r&&this.openDatabase()},o.onabort=e=>{this.log.error("abort:",e);const t=e.target;this.openDatabase(r=!0),t.onerror&&t.onerror(e),o.close()},o.onversionchange=e=>{this.log.error("onversionchange, lol?")},e(this.db=o)},n.onerror=e=>{s=!0,this.storageIsAvailable=!1,this.log.error("Error creating/accessing IndexedDB database",e),i(e)},n.onupgradeneeded=e=>{s=!0,this.log.warn("performing idb upgrade from",e.oldVersion,"to",e.newVersion);const n=e.target,i=n.result;this.stores.forEach((e=>{if(i.objectStoreNames.contains(e.name)){const s=n.transaction.objectStore(e.name);t(s,e)}else((e,n)=>{const s=e.createObjectStore(n.name);t(s,n)})(i,e)}))}}))}static create(e){var t;return null!==(t=this.INSTANCES.find((t=>t.name===e.name)))&&void 0!==t?t:new a(e)}static closeDatabases(e){this.INSTANCES.forEach((t=>{if(e&&e===t)return;const n=t.db;n&&(n.onclose=()=>{},n.close())}))}}a.INSTANCES=[];class c{constructor(e,t){this.storeName=t,this.log=(0,r.kg)(["IDB",e.name,t].join("-")),this.idb=a.create(e)}delete(e,t){const n=Array.isArray(e);return n||(e=[].concat(e)),this.getObjectStore("readwrite",(t=>{const s=e.map((e=>t.delete(e)));return n?s:s[0]}),"",t)}clear(e){return this.getObjectStore("readwrite",(e=>e.clear()),"",e)}save(e,t,n){const s=Array.isArray(e);return s||(e=[].concat(e),t=[].concat(t)),this.getObjectStore("readwrite",(n=>{const i=e.map(((e,s)=>n.put(t[s],e)));return s?i:i[0]}),"",n)}get(e,t){const n=Array.isArray(e);if(n){if(!e.length)return Promise.resolve([])}else{if(!e)return;e=[].concat(e)}return this.getObjectStore("readonly",(t=>{const s=e.map((e=>t.get(e)));return n?s:s[0]}),"",t)}getObjectStore(e,t,n,s=this.storeName){let i;return n&&(i=performance.now(),this.log(n+": start")),this.idb.openDatabase().then((o=>new Promise(((r,a)=>{const c=o.transaction([s],e),l=()=>{clearTimeout(u),a(c.error)},d=()=>{clearTimeout(u),n&&this.log(n+": end",performance.now()-i);const e=p.map((e=>e.result));r(m?e:e[0])};c.onerror=l;const h="readwrite"===e;h&&(c.oncomplete=()=>d());const u=setTimeout((()=>{this.log.error("transaction not finished",c,n)}),1e4),g=t(c.objectStore(s)),m=Array.isArray(g),p=m?g:[].concat(g);if(h)return;const f=p.length;let v=f;const b=()=>{c.error||--v||d()};for(let e=0;ee.getAll()),"",e)}}},2325:(e,t,n)=>{n.d(t,{$d:()=>w,A1:()=>S,Hz:()=>m,XZ:()=>y,ZP:()=>v,ag:()=>b,nK:()=>p,v_:()=>k});var s=n(410),i=n(7922),o=n(4159),r=n(3512),a=n(4762),c=n(6848),l=n(5953),d=n(9005),h=n(6637),u=n(3591),g=n(130);const m={messageActionChatCreate:"ActionCreateGroup",messageActionChatCreateYou:"ActionYouCreateGroup",messageActionChatEditTitle:"ActionChangedTitle",messageActionChatEditPhoto:"ActionChangedPhoto",messageActionChatEditVideo:"ActionChangedVideo",messageActionChatDeletePhoto:"ActionRemovedPhoto",messageActionChatReturn:"ActionAddUserSelf",messageActionChatReturnYou:"ActionAddUserSelfYou",messageActionChatJoined:"ActionAddUserSelfMega",messageActionChatJoinedYou:"ChannelMegaJoined",messageActionChatAddUser:"ActionAddUser",messageActionChatAddUsers:"ActionAddUser",messageActionChatLeave:"ActionLeftUser",messageActionChatLeaveYou:"YouLeft",messageActionChatDeleteUser:"ActionKickUser",messageActionChatJoinedByLink:"ActionInviteUser",messageActionPinMessage:"Chat.Service.Group.UpdatedPinnedMessage",messageActionContactSignUp:"Chat.Service.PeerJoinedTelegram",messageActionChannelCreate:"ActionCreateChannel",messageActionChannelEditTitle:"Chat.Service.Channel.UpdatedTitle",messageActionChannelEditPhoto:"Chat.Service.Channel.UpdatedPhoto",messageActionChannelEditVideo:"Chat.Service.Channel.UpdatedVideo",messageActionChannelDeletePhoto:"Chat.Service.Channel.RemovedPhoto",messageActionHistoryClear:"HistoryCleared",messageActionDiscussionStarted:"DiscussionStarted",messageActionChannelMigrateFrom:"ActionMigrateFromGroup","messageActionPhoneCall.video_in_ok":"ChatList.Service.VideoCall.incoming","messageActionPhoneCall.video_out_ok":"ChatList.Service.VideoCall.outgoing","messageActionPhoneCall.video_missed":"ChatList.Service.VideoCall.Missed","messageActionPhoneCall.video_cancelled":"ChatList.Service.VideoCall.Cancelled","messageActionPhoneCall.in_ok":"ChatList.Service.Call.incoming","messageActionPhoneCall.out_ok":"ChatList.Service.Call.outgoing","messageActionPhoneCall.missed":"ChatList.Service.Call.Missed","messageActionPhoneCall.cancelled":"ChatList.Service.Call.Cancelled","messageActionGroupCall.started":"Chat.Service.VoiceChatStarted.Channel","messageActionGroupCall.started_by":"Chat.Service.VoiceChatStarted","messageActionGroupCall.started_byYou":"Chat.Service.VoiceChatStartedYou","messageActionGroupCall.ended":"Chat.Service.VoiceChatFinished.Channel","messageActionGroupCall.ended_by":"Chat.Service.VoiceChatFinished","messageActionGroupCall.ended_byYou":"Chat.Service.VoiceChatFinishedYou",messageActionBotAllowed:"Chat.Service.BotPermissionAllowed"},p=a.IS_MOBILE?"Message.Unsupported.Mobile":"Message.Unsupported.Desktop";var f;!function(e){let t,a;function m(t){e.lastRequestedLangCode=t,e.lastRequestedNormalizedLangCode=t.split("-")[0]}function p(){if("h12"===e.timeFormat)try{const t=A({hour:"numeric",minute:"numeric",hour12:!0}),n=new Date;n.setHours(0);const s=t.format(n);e.amPmCache.am=s.split(/\s/)[1],n.setHours(12);const i=t.format(n);e.amPmCache.pm=i.split(/\s/)[1]}catch(t){console.error("cannot get am/pm",t),e.amPmCache={am:"AM",pm:"PM"}}}function f(){const e=o.Z.langPackCode;return m(e),Promise.all([n.e(104).then(n.bind(n,9104)),n.e(301).then(n.bind(n,9301)),n.e(8).then(n.bind(n,9179))]).then((([t,n,s])=>{const i=[];return b(t.default,i),b(n.default,i),y({_:"langPackDifference",from_version:0,lang_code:e,strings:i,version:0,local:!0,countries:s.default})}))}function v(t,s){e.requestedServerLanguage=!0;const i=r.Z.managers;return Promise.all([i.apiManager.invokeApiCacheable("langpack.getLangPack",{lang_code:t,lang_pack:"web"}),!1,n.e(104).then(n.bind(n,9104)),n.e(301).then(n.bind(n,9301)),i.apiManager.invokeApiCacheable("help.getCountriesList",{lang_code:t,hash:0}),e.polyfillPromise])}function b(e,t=[]){for(const n in e){const s=e[n];"string"==typeof s?t.push({_:"langPackString",key:n,value:s}):t.push(Object.assign({_:"langPackStringPluralized",key:n},s))}return t}function y(e){return e.appVersion=o.Z.langPackVersion,i.Z.set({langPack:e}).then((()=>(w(e),e)))}function w(n){const s=e.lastRequestedLangCode;if(n.lang_code===s){try{t=new Intl.PluralRules(e.lastRequestedNormalizedLangCode)}catch(n){console.error("pluralRules error",n),t=new Intl.PluralRules(e.lastRequestedNormalizedLangCode.split("-",1)[0])}try{t=new Intl.PluralRules(n.lang_code)}catch(e){console.error("pluralRules error",e),t=new Intl.PluralRules(n.lang_code.split("-",1)[0])}e.strings.clear();for(const t of n.strings)e.strings.set(t.key,t);n.countries&&(e.countriesList.length=0,e.countriesList.push(...n.countries.countries),n.countries.countries.forEach((t=>{if(t.name){const n=t.default_name;e.strings.set(n,{_:"langPackString",key:n,value:t.name})}}))),e.lastAppliedLangCode!==s&&(r.Z.dispatchEvent("language_change",s),e.lastAppliedLangCode=s,E.clear(),p()),Array.from(document.querySelectorAll(".i18n")).forEach((t=>{const n=e.weakMap.get(t);n&&n.update()}))}}function S(e,t,n={i:0}){const s=[];let i=0;return e.replace(/(\*\*|__)(.+?)\1|(\n)|(\[.+?\]\(.*?\))|un\d|%\d\$.|%./g,((e,o,r,a,c,l,d)=>{if(s.push(d.slice(i,l)),o){let e;switch(o){case"**":e=document.createElement("b");break;case"__":e=document.createElement("i")}e.append(...S(r,t,n)),s.push(e)}else if(a)s.push(document.createElement("br"));else if(c){const e=c.lastIndexOf("]"),i=c.slice(1,e),o=c.slice(e+2,c.length-1);let r;if(o&&(0,h.Z)(o)){r=document.createElement("a");const e=(0,u.Z)(o);r.href=e.url,e.onclick&&r.setAttribute("onclick",e.onclick),r.target="_blank"}else r=t[n.i++],r instanceof DocumentFragment&&(r=r.firstChild),"string"!=typeof r&&(r.textContent="");const a=S(i,t,n);"string"==typeof r?s.push(...a):(r.append(...a),s.push(r))}else t&&function(e,t,n){const s=t[n.i++];Array.isArray(s)?e.push(...s):e.push(s)}(s,t,n);return i=l+e.length,""})),i!==e.length&&s.push(e.slice(i)),s}function k(n,s=!1,i){const o=e.strings.get(n);let r;if(o)if("langPackStringPluralized"===o._&&(null==i?void 0:i.length)){let e=i[0];"string"==typeof e&&(e=+e.replace(/\D/g,"")),r=o[t.select(e)+"_value"]||o.other_value}else r="langPackString"===o._?o.value:n;else r=n;const a=S(r,i);return s?a.map((e=>e instanceof Node?e.textContent:e)).join(""):a}e.strings=new Map,e.countriesList=[],e.requestedServerLanguage=!1,e.isRTL=!1,e.setRTL=function(t){e.isRTL=t},e.getCacheLangPack=function(){return a||(a=Promise.all([i.Z.get("langPack"),e.polyfillPromise]).then((([t])=>t?(s.ZP,e.lastRequestedLangCode||m(t.lang_code),w(t),t):f())).finally((()=>{a=void 0})))},e.setTimeFormat=function(t,n=!!e.timeFormat&&e.timeFormat!==t){e.timeFormat=t,p(),n&&(E.clear(),Array.from(document.querySelectorAll(".i18n")).forEach((t=>{const n=e.weakMap.get(t);n instanceof Z&&n.update()})))},e.loadLocalLangPack=f,e.loadLangPack=v,e.getStrings=function(e,t){return r.Z.managers.apiManager.invokeApi("langpack.getStrings",{lang_pack:o.Z.langPack,lang_code:e,keys:t})},e.formatLocalStrings=b,e.getLangPack=function(e,t){return m(e),v(e).then((([e,t,n,s,i,o])=>{let r=[];return[n,s].forEach((e=>{b(e.default,r)})),r=r.concat(...[e.strings,t.strings].filter(Boolean)),e.strings=r,e.countries=i,y(e)}))},e.saveLangPack=y,e.polyfillPromise="undefined"!=typeof Intl&&void 0!==Intl.PluralRules?Promise.resolve():n.e(642).then(n.bind(n,4642)).then((e=>{window.Intl=Object.assign("undefined"!=typeof Intl?Intl:{},e.default)})),e.applyLangPack=w,e.superFormatter=S,e.format=k,e.weakMap=new WeakMap;class P{constructor(t){this.element=(null==t?void 0:t.element)||document.createElement("span"),this.element.classList.add("i18n"),this.property=null==t?void 0:t.property,t&&(t.key||t.date)&&this.update(t),e.weakMap.set(this.element,this)}}class _ extends P{constructor(e={}){var t;super(Object.assign(Object.assign({},e),{property:null!==(t=e.property)&&void 0!==t?t:"innerHTML"}))}update(e){if((0,l.Z)(this,e),"innerHTML"===this.property)this.element.textContent="",this.element.append(...k(this.key,!1,this.args));else{const e=this.element[this.property],t=k(this.key,!0,this.args);void 0===e?this.element.dataset[this.property]=t:this.element[this.property]=t}}compareAndUpdate(e){if(this.key!==e.key||!(0,c.Z)(this.args,e.args))return this.update(e)}}e.IntlElement=_;const E=new Map;function A(t={}){const n=JSON.stringify(t);let s=E.get(n);return s||(s=new Intl.DateTimeFormat(e.lastRequestedNormalizedLangCode+"-u-hc-"+e.timeFormat,t),E.set(n,s)),s}e.amPmCache={am:"AM",pm:"PM"};class Z extends P{constructor(e){var t;super(Object.assign(Object.assign({},e),{property:null!==(t=e.property)&&void 0!==t?t:"textContent"})),(0,g.m)(this.element)}update(t){let n;if((0,l.Z)(this,t),this.options.hour&&this.options.minute&&2===Object.keys(this.options).length){const t=this.date.getHours();n=("0"+("h12"===e.timeFormat?t%12||12:t)).slice(-2)+":"+("0"+this.date.getMinutes()).slice(-2),"h12"===e.timeFormat&&(n+=" "+(t<12?e.amPmCache.am:e.amPmCache.pm))}else{const e=A(this.options);n=(0,d.Z)(e.format(this.date))}this.element[this.property]=n}}e.IntlDateElement=Z,e.i18n=function(e,t){return new _({key:e,args:t}).element},e.i18n_=function(e){return new _(e).element},e._i18n=function(e,t,n,s){return new _({element:e,key:t,args:n,property:s}).element}}(f||(f={}));const v=f,b=f.i18n,y=f.i18n_,w=f._i18n;function S(e,t){const n=e.slice(0,1);for(let s=1;s{const s=e&&t?"AutoDownloadSettings.LastDelimeter":"AutoDownloadSettings.Delimeter";return n?f.format(s,!0):b(s)}));return n?s.join(""):s}s.GO.I18n=f},1507:(e,t,n)=>{n.d(t,{BP:()=>u,BX:()=>m,DZ:()=>v,IA:()=>o,Iw:()=>l,J$:()=>p,NM:()=>s,OS:()=>h,Ox:()=>g,Pt:()=>d,Zi:()=>f,gZ:()=>c,hj:()=>i,rU:()=>a,yF:()=>r});const s=0,i=1271266957,o=777,r=777e3,a=2147483647,c="",l=20971520,d="",h=[7322096,16766590,13338331,9367192,16749490,16478047],u="default_static",g=4295032831,m=new Set(["web","k","z"]),p=0,f=1,v=new Set([p,f]);Math.max(...Array.from(v))},3855:(e,t,n)=>{n.d(t,{Z:()=>se});var s=n(3512),i=n(7730),o=n(410),r=n(7487),a=n(6702),c=n(1722),l=n(2831),d=n(5418),h=n(993),u=n(7328),g=n(6663),m=n(9976),p=n(3731),f=n(6818),v=n(1174),b=n(2341),y=n(9030),w=n(2365),S=n(2820),k=n(5432),P=n(2131),_=n(554),E=n(393),A=n(5269),Z=n(4089),C=n(4762),I=n(5783),L=n(2045),T=n(8189);const O=Object.assign({CAN_USE_TRANSFERABLES:u.Z,IS_APPLE_MX:T.Z,IS_CALL_SUPPORTED:h.Z,IS_CANVAS_FILTER_SUPPORTED:g.Z,IS_EMOJI_SUPPORTED:m.Z,IS_GEOLOCATION_SUPPORTED:p.Z,IS_GROUP_CALL_SUPPORTED:f.Z,IS_MOV_SUPPORTED:y.Z,IS_PARALLAX_SUPPORTED:w.Z,IS_SCREEN_SHARING_SUPPORTED:S.Z,IS_TOUCH_SUPPORTED:k.Z,IS_VIBRATE_SUPPORTED:P.Z,IS_OPUS_SUPPORTED:I.Z,IS_SHARED_WORKER_SUPPORTED:L.Z,IS_WEBM_SUPPORTED:E.Z,IS_WEBP_SUPPORTED:A.Z,IS_WEBRTC_SUPPORTED:Z.Z,IMAGE_MIME_TYPES_SUPPORTED:v.Z,MEDIA_MIME_TYPES_SUPPORTED:b.Z,VIDEO_MIME_TYPES_SUPPORTED:_.Z},C);var M=n(4159),x=n(236),W=n(6009),D=n(8479),R=n(946),N=n(7922),j=n(5466),F=n(5003);const U=x.h.version,B=x.h.build,V=Object.keys(x.h),G=["contactsListCachedTime","stateCreatedTime","maxSeenMsgId","filtersArr"];function $(){return e=this,t=void 0,i=function*(){const e=(0,F.kg)("STATE-LOADER"),t=performance.now(),n=(0,j.$)(e),i=V.map((e=>n(N.Z.get(e),"state "+e))).concat(n(r.Z.get("user_auth"),"auth"),n(r.Z.get("state_id"),"auth"),n(r.Z.get("k_build"),"auth")).concat(n(N.Z.get("user_auth"),"old auth")),a=yield Promise.all(i);e.warn("promises",performance.now()-t);const c=[],l=(e,t)=>{d[e]=t,c.push(e)};let d={};for(let e=0,t=V.length;eN.Z.get(e))));e.push("user_auth"),t.push("number"==typeof h||"string"==typeof h?{dcID:t[0]||M.Z.baseDcId,date:Date.now()/1e3|0,id:h.toPeerId(!1)}:h);const n={};e.forEach(((e,s)=>{n[e]=t[s]})),yield r.Z.set(n)}h&&(d.authState={_:"authStateSignedIn"},s.Z.dispatchEvent("user_auth","number"==typeof h||"string"==typeof h?{dcID:0,date:Date.now()/1e3|0,id:h.toPeerId(!1)}:h));const p=new Set;if(d.stateId!==u){if(void 0!==u){const e=new Map([["authState",void 0],["stateId",void 0]]);e.forEach(((t,n)=>{e.set(n,(0,D.Z)(d[n]))})),d=(0,D.Z)(x.h),e.forEach(((e,t)=>{d[t]=e}));const t={chats:1,dialogs:1,users:1};for(const e in t)p.add(e);f=d,c.length=0,d=f,c.push(...Object.keys(d))}yield r.Z.set({state_id:d.stateId})}var f;const v=Date.now();d.stateCreatedTime+864e5{l(e,(0,D.Z)(x.h[e]))})));const b=d.settings.autoDownload;if(void 0!==(null==b?void 0:b.private)){const e=["contacts","private","groups","channels"];["photo","video","file"].forEach((t=>{const n=b[t]={};e.forEach((e=>{n[e]=b[e]}))})),e.forEach((e=>{delete b[e]})),l("settings",d.settings)}const y=new Set(["settings.themes"]);let w,S;if((0,R.Z)(x.h,d,(e=>{l(e,d[e])}),void 0,y),d.version!==U||d.build!==B){if(d.build<217&&(d.allDialogsLoaded=(0,D.Z)(x.h.allDialogsLoaded),d.pinnedOrders=(0,D.Z)(x.h.pinnedOrders),d.filtersArr=(0,D.Z)(x.h.filtersArr),p.add("dialogs")),-1===(0,W.Z)(d.version,"1.7.1")){let e=!1;if(-1===(0,W.Z)(d.version,"1.3.0"))e=!0,d.settings.theme=(0,D.Z)(x.h.settings.theme),d.settings.themes=(0,D.Z)(x.h.settings.themes);else if(-1===(0,W.Z)(d.version,"1.7.1")){e=!0;const t=d.settings.themes;d.settings.themes=(0,D.Z)(x.h.settings.themes);try{t.forEach((e=>{const t=e.background;if(!t)return;const n=d.settings.themes.find((t=>t.name===e.name));n.settings.highlightningColor=t.highlightningColor;const s=(t.color||"").split(",").map((e=>e&&parseInt(e.slice(1),16)));if(t.color&&!t.slug)n.settings.wallpaper={_:"wallPaperNoFile",id:0,pFlags:{},settings:{_:"wallPaperSettings",pFlags:{}}};else{const e={_:"wallPaper",id:0,access_hash:0,slug:t.slug,document:{},pFlags:{},settings:{_:"wallPaperSettings",pFlags:{}}},s=e.settings;n.settings.wallpaper=e,t.slug&&!t.color?s.pFlags.blur=t.blur||void 0:t.intensity&&(s.intensity=t.intensity,e.pFlags.pattern=!0,e.pFlags.dark=t.intensity<0||void 0)}if(s.length){const e=n.settings.wallpaper.settings;e.background_color=s[0],e.second_background_color=s[1],e.third_background_color=s[2],e.fourth_background_color=s[3]}}))}catch(e){console.error("migrating themes error",e)}}e&&l("settings",d.settings)}d.build<309&&(d.settings.liteMode.animations=!d.settings.animationsEnabled,d.settings.liteMode.video=!d.settings.autoPlay.videos,d.settings.liteMode.gif=!d.settings.autoPlay.gifs),d.build<312&&"boolean"==typeof d.settings.stickers.suggest&&(d.settings.stickers.suggest=d.settings.stickers.suggest?"all":"none"),0!==(0,W.Z)(d.version,U)&&(w=U,S=d.version),l("version",U),l("build",B)}return g!==B&&(!g||g{var t,n;const{name:s,key:i,value:o}=e;if(!e.hasOwnProperty("key"))return void(this.mirrors[s]=o);const r=null!==(t=(n=this.mirrors)[s])&&void 0!==t?t:n[s]={};void 0===o?delete r[i]:r[i]=o},this.mirrors={},this.tabState={chatPeerIds:[],idleStartTime:0},this.log("constructor"),this.registerWorker(),this.registerServiceWorker(),this.registerCryptoWorker(),this.addMultipleEventsListeners({convertWebp:({fileName:e,bytes:t})=>i.Z.convert(e,t),convertOpus:({fileName:e,bytes:t})=>q.Z.pushDecodeTask(t,!1).then((e=>e.bytes)),event:({name:e,args:t})=>{s.Z.dispatchEventSingle(e,...t)},localStorageProxy:e=>{const t=e;return r.Z[t.type](...t.args)},mirror:this.onMirrorTask}),s.Z.addEventListener("language_change",(e=>{s.Z.managers.networkerFactory.setLanguage(e)})),window.addEventListener("online",(()=>{s.Z.managers.networkerFactory.forceReconnectTimeout()})),s.Z.addEventListener("logging_out",(()=>{Promise.all([(0,X.Z)(!1,!0),r.Z.clear(),Promise.race([l.default.setAuthorized(!1),(0,d.Z)(3e3)]),a.default.forceUnsubscribe(),Promise.all(["cachedFiles","cachedStreamChunks"].map((e=>caches.delete(e))))]).finally((()=>{c.Z.reload()}))})),J.Z.addEventListener("change",(e=>{this.updateTabStateIdle(e)})),this.updateTabStateIdle(J.Z.isIdle),this.log("Passing environment:",O),this.invoke("environment",O)}pingServiceWorkerWithIframe(){if(this.pingServiceWorkerPromise)return this.pingServiceWorkerPromise;const e=this.pingServiceWorkerPromise=(0,Q.Z)(),t=document.createElement("iframe");t.hidden=!0;const n=()=>{setTimeout((()=>{this.pingServiceWorkerPromise=void 0}),1e4),clearTimeout(s),t.remove(),t.removeEventListener("load",n),t.removeEventListener("error",n),e.resolve()};t.addEventListener("load",n),t.addEventListener("error",n),t.src="ping/"+(4294967295*Math.random()|0),document.body.append(t);const s=window.setTimeout(n,1e3);return e}attachServiceWorker(e){this.lastServiceWorker&&this.serviceMessagePort.detachPort(this.lastServiceWorker),this.serviceMessagePort.attachSendPort(this.lastServiceWorker=e),this.serviceMessagePort.invokeVoid("hello",void 0)}_registerServiceWorker(){navigator.serviceWorker.register(new URL(n.p+n.u(670),n.b),{scope:"./"}).then((e=>{if(this.log("SW registered",e),e.active&&!navigator.serviceWorker.controller)return e.unregister().then((()=>{window.location.reload()}));(e.installing||e.waiting||e.active).addEventListener("statechange",(e=>{this.log("SW statechange",e)}));const t=navigator.serviceWorker.controller||e.installing||e.waiting||e.active;this.attachServiceWorker(t)}),(e=>{this.log.error("SW registration failed!",e),this.invokeVoid("serviceWorkerOnline",!1)}))}registerServiceWorker(){if(!("serviceWorker"in navigator))return;this.serviceMessagePort=new K.Z;const e=navigator.serviceWorker;this._registerServiceWorker(),e.addEventListener("controllerchange",(()=>{this.log.warn("controllerchange");const t=e.controller;this.attachServiceWorker(t),t.addEventListener("error",(e=>{this.log.error("controller error:",e)}))})),this.serviceMessagePort.attachListenPort(e),this.serviceMessagePort.addMultipleEventsListeners({port:(e,t,n)=>{this.invokeVoid("serviceWorkerPort",void 0,void 0,[n.ports[0]])},hello:(e,t)=>{this.serviceMessagePort.resendLockTask(t)},share:e=>{this.log("will try to share something"),this.share=e}}),e.addEventListener("messageerror",(e=>{this.log.error("SW messageerror:",e)}))}registerCryptoWorker(){return ee(this,void 0,void 0,(function*(){const e={construct:(e,t)=>({url:t[0]+location.search})},t=[Worker,"undefined"!=typeof SharedWorker&&SharedWorker].filter(Boolean);t.forEach((t=>window[t.name]=new Proxy(t,e)));const s=new Worker(new URL(n.p+n.u(589),n.b),{type:void 0});t.forEach((e=>window[e.name]=e));const i=s.url,o=e=>new a(e,{type:"module"}),r=e=>this.attachWorkerToPort(e,Y.Z,"crypto"),a=L.Z?SharedWorker:Worker;Y.Z.addEventListener("port",((e,t,n)=>{this.invokeVoid("cryptoPort",void 0,void 0,[n.ports[0]])})),r(o(i));const c=yield(l=i,fetch(l).then((e=>e.text())).then((e=>{const t=location.pathname.split("/");return t[t.length-1]="",e=`\n var originalImportScripts = importScripts; \n importScripts = (url) => {\n console.log('importScripts', url);\n var newUrl = '${location.origin+t.join("/")}' + url.split('/').pop();\n return originalImportScripts(newUrl);\n };\n ${e}`,new Blob([e],{type:"application/javascript"})})));var l;(yield this.invoke("createProxyWorkerURLs",{originalUrl:i,blob:c})).slice(1).map(o).forEach(r)}))}registerWorker(){let e;e=L.Z?new SharedWorker(new URL(n.p+n.u(678),n.b),{type:void 0}):new Worker(new URL(n.p+n.u(678),n.b),{type:void 0}),this.onWorkerFirstMessage(e)}attachWorkerToPort(e,t,n){const s=e.port||e;t.attachPort(s),e.addEventListener("error",(e=>{this.log.error(n,"worker error",e)}))}onWorkerFirstMessage(e){this.log("set webWorker"),this.attachWorkerToPort(e,this,"mtproto")}loadState(){return Promise.all([(null!=z?z:z=$()).then((e=>(this.newVersion=e.newVersion,this.oldVersion=e.oldVersion,this.mirrors.state=e.state,e)))])}sendState(){return this.loadState().then((e=>{const[t]=e;return this.invoke("state",Object.assign(Object.assign({},t),{userId:s.Z.myId.toUserId()})),e}))}invokeCrypto(e,...t){return Y.Z.invokeCrypto(e,...t)}toggleStorages(e,t){return ee(this,void 0,void 0,(function*(){yield(0,X.Z)(e,t),this.invoke("toggleStorages",{enabled:e,clearWrite:t}),this.serviceMessagePort.invokeVoid("toggleStorages",{enabled:e,clearWrite:t})}))}getMirror(e){return ee(this,void 0,void 0,(function*(){return this.mirrors[e]}))}getState(){return this.getMirror("state")}updateTabState(e,t){this.tabState[e]=t,this.invokeVoid("tabState",this.tabState)}updateTabStateIdle(e){this.updateTabState("idleStartTime",e?Date.now():0)}}const ne=new te;o.GO.apiManagerProxy=ne;const se=ne},490:(e,t,n)=>{n.d(t,{Z:()=>f});var s=n(4159),i=n(410),o=n(2219),r=n(2045),a=n(3241),c=n(2586),l=n(5003),d=n(3512),h=n(7487),u=n(3855);const g=r.Z;class m extends a.Z{constructor(){super(!1),this.log=(0,l.kg)("INSTANCE"),this.clearInstance=()=>{this.masterInstance&&!this.deactivated&&(this.log.warn("clear master instance"),h.Z.delete("xt_instance"))},this.checkInstance=(e=c.Z.isIdle)=>{return t=this,n=void 0,o=function*(){if(this.deactivated)return;const t=Date.now(),n={id:this.instanceId,idle:e,time:t},[i,o=s.Z.build]=yield Promise.all([h.Z.get("xt_instance",!1),h.Z.get("k_build",!1)]);if(o>s.Z.build)return this.masterInstance=!1,d.Z.managers.networkerFactory.stopAll(),this.deactivateInstance("version"),void u.Z.toggleStorages(!1,!1);g?h.Z.set({xt_instance:n}):!e||!i||i.id===this.instanceId||i.timethis.deactivateInstance("tabs")),3e4)))},new((i=void 0)||(i=Promise))((function(e,s){function r(e){try{c(o.next(e))}catch(e){s(e)}}function a(e){try{c(o.throw(e))}catch(e){s(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(r,a)}c((o=o.apply(t,n||[])).next())}));var t,n,i,o},this.log=(0,l.kg)("INSTANCE"),this.instanceId=o.Z}get deactivatedReason(){return this.deactivated}start(){if(this.reset(),!this.started){this.started=!0,c.Z.addEventListener("change",this.checkInstance),setInterval(this.checkInstance,5e3),this.checkInstance();try{document.documentElement.addEventListener("beforeunload",this.clearInstance)}catch(e){}}}reset(){this.masterInstance=!1,this.clearDeactivateTimeout(),this.deactivated=void 0}activateInstance(){this.deactivated&&(this.reset(),this.checkInstance(!1),this.dispatchEvent("activated"))}deactivateInstance(e){this.masterInstance||this.deactivated||(this.log.warn("deactivate",e),this.clearDeactivateTimeout(),this.deactivated=e,this.dispatchEvent("deactivated",e))}clearDeactivateTimeout(){this.deactivateTimeout&&(clearTimeout(this.deactivateTimeout),this.deactivateTimeout=0)}}const p=new m;i.GO&&(i.GO.singleInstance=p);const f=p},2831:(e,t,n)=>{n.r(t),n.d(t,{TelegramMeWebManager:()=>c,default:()=>d});var s=n(4159),i=n(410),o=n(1267),r=n(7298),a=n(7487);class c{constructor(){this.disabled=o.Z.test||!s.Z.domains.includes(location.hostname)}setAuthorized(e){if(!this.disabled)return a.Z.get("tgme_sync").then((t=>{const n=(0,r.Z)(!0);if(e&&(null==t?void 0:t.canRedirect)===e&&t.ts+86400>n)return;a.Z.set({tgme_sync:{canRedirect:e,ts:n}});const i=`_websync_?authed=${e?"1":"0"}&version=${encodeURIComponent(s.Z.version+" "+s.Z.suffix)}`,o=["//telegram.me/"+i,"//t.me/"+i].map((e=>function(e){const t=document.createElement("script"),n=new Promise((e=>{t.onload=t.onerror=()=>{e(t)}}));return t.src=e,document.body.appendChild(t),n}(e).then((e=>{e.remove()}))));return Promise.all(o)}))}}const l=new c;i.GO&&(i.GO.telegramMeWebManager=l);const d=l},6702:(e,t,n)=>{n.r(t),n.d(t,{WebPushApiManager:()=>g,default:()=>p});var s=n(410),i=n(5003),o=n(3855),r=n(2325),a=n(4762),c=n(1722),l=n(8479),d=n(490),h=n(3241),u=n(2790);class g extends h.Z{constructor(){super(!1),this.isAvailable=!0,this.isPushEnabled=!1,this.localNotificationsAvailable=!0,this.started=!1,this.settings={},this.isFirefox=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,this.userVisibleOnly=!this.isFirefox,this.log=(0,i.kg)("PM"),this.subscribe=()=>{this.isAvailable&&navigator.serviceWorker.ready.then((e=>{e.pushManager.subscribe({userVisibleOnly:this.userVisibleOnly}).then((e=>{this.isPushEnabled=!0,this.pushSubscriptionNotify("subscribe",e)})).catch((e=>{"denied"===Notification.permission?this.log("Permission for Notifications was denied"):(this.log("Unable to subscribe to push.",e),this.userVisibleOnly||(this.userVisibleOnly=!0,setTimeout(this.subscribe,0)))}))}))},this.isAliveNotify=()=>{if(!this.isAvailable||d.Z.deactivatedReason)return;this.settings.baseUrl=(location.href||"").replace(/#.*$/,"");const e={},t={push_action_mute1d:a.IS_MOBILE?"PushNotification.Action.Mute1d.Mobile":"PushNotification.Action.Mute1d",push_action_settings:a.IS_MOBILE?"PushNotification.Action.Settings.Mobile":"PushNotification.Action.Settings",push_message_nopreview:"PushNotification.Message.NoPreview"};for(const n in t)e[n]=r.ZP.format(t[n],!0);o.Z.serviceMessagePort.invokeVoid("pushPing",{localNotifications:this.localNotificationsAvailable,lang:e,settings:this.settings}),this.isAliveTO=setTimeout(this.isAliveNotify,1e4)},"PushManager"in window&&"Notification"in window&&"serviceWorker"in navigator||(this.log.warn("Push messaging is not supported."),this.isAvailable=!1,this.localNotificationsAvailable=!1),this.isAvailable&&"denied"===Notification.permission&&this.log.warn("The user has blocked notifications.")}start(){this.started||(this.started=!0,this.getSubscription(),this.setUpServiceWorkerChannel())}setLocalNotificationsDisabled(){this.localNotificationsAvailable=!1}getSubscription(){this.isAvailable&&navigator.serviceWorker.ready.then((e=>{e.pushManager.getSubscription().then((e=>{this.isPushEnabled=!!e,this.pushSubscriptionNotify("init",e)})).catch((e=>{this.log.error("Error during getSubscription()",e)}))}))}unsubscribe(){this.isAvailable&&navigator.serviceWorker.ready.then((e=>{e.pushManager.getSubscription().then((e=>{this.isPushEnabled=!1,e&&(this.pushSubscriptionNotify("unsubscribe",e),setTimeout((()=>{e.unsubscribe().then((e=>{this.isPushEnabled=!1})).catch((e=>{this.log.error("Unsubscription error: ",e)}))}),3e3))})).catch((e=>{this.log.error("Error thrown while unsubscribing from push messaging.",e)}))}))}forceUnsubscribe(){this.isAvailable&&navigator.serviceWorker.ready.then((e=>{e.pushManager.getSubscription().then((e=>{this.log.warn("force unsubscribe",e),e&&e.unsubscribe().then((e=>{this.log.warn("force unsubscribe successful",e),this.isPushEnabled=!1})).catch((e=>{this.log.error("Unsubscription error: ",e)}))})).catch((e=>{this.log.error("Error thrown while unsubscribing from push messaging.",e)}))}))}setSettings(e){this.settings=(0,l.Z)(e),clearTimeout(this.isAliveTO),this.isAliveNotify()}hidePushNotifications(){this.isAvailable&&o.Z.serviceMessagePort.invokeVoid("notificationsClear",void 0)}setUpServiceWorkerChannel(){this.isAvailable&&(o.Z.serviceMessagePort.addEventListener("pushClick",(e=>{d.Z.deactivatedReason?c.Z.reload():this.dispatchEvent("push_notification_click",e)})),navigator.serviceWorker.ready.then(this.isAliveNotify))}pushSubscriptionNotify(e,t){if(t){const n=t.toJSON();if(!(n&&n.endpoint&&n.keys&&n.keys.p256dh&&n.keys.auth))return this.log.warn("Invalid push subscription",n),this.unsubscribe(),this.isAvailable=!1,void this.pushSubscriptionNotify(e);this.log.warn("Push",e,n),this.dispatchEvent("push_"+e,{tokenType:10,tokenValue:JSON.stringify(n)})}else this.log.warn("Push",e,!1),this.dispatchEvent("push_"+e,!1)}ignorePushByMid(e,t){this.isAvailable&&o.Z.serviceMessagePort.invokeVoid("shownNotification",e+"_"+(0,u.Z)(t))}}const m=new g;s.GO&&(s.GO.webPushApiManager=m);const p=m},9043:(e,t,n)=>{n.d(t,{Z:()=>d});var s=n(410),i=n(5783),o=n(4762),r=n(5003),a=n(3855),c=function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function r(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}c((s=s.apply(e,t||[])).next())}))};const l=new class{constructor(){this.sampleRate=48e3,this.tasks=[],this.keepAlive=!1,this.log=(0,r.kg)("OPUS",r.v9.Error)}isPlaySupported(){return i.Z}loadWavWorker(){this.wavWorker||(this.wavWorker=new Worker("waveWorker.min.js"),this.wavWorker.addEventListener("message",(e=>{const t=e.data;if(this.log("[WAV] got message:",t),t&&t.page){const e=t.page;this.onTaskEnd(this.tasks.shift(),e)}})))}loadWorker(){this.worker||(this.worker=new Worker("decoderWorker.min.js"),this.worker.addEventListener("message",(e=>{const t=e.data;this.log("[DECODER] got message",t),"done"===t.type?(this.wavWorker.postMessage({command:"done"}),t.waveform&&(this.tasks[0].waveform=t.waveform)):this.wavWorker.postMessage({command:"encode",buffers:e.data},o.IS_SAFARI?void 0:t.map((e=>e.buffer)))})))}setKeepAlive(e){this.keepAlive=e,this.keepAlive?(this.loadWorker(),this.loadWavWorker()):this.tasks.length||this.terminateWorkers()}onTaskEnd(e,t){t?(clearTimeout(e.timeout),e.callback.resolve({bytes:t,waveform:e.waveform})):e.callback.reject("timeout"),this.tasks.length&&this.executeNewTask(this.tasks[0]),this.terminateWorkers()}terminateWorkers(e=!1){(!this.keepAlive&&!this.tasks.length||e)&&(this.worker&&(this.worker.terminate(),this.worker=null),this.wavWorker&&(this.wavWorker.terminate(),this.wavWorker=null))}executeNewTask(e){this.worker.postMessage({command:"init",decoderSampleRate:this.sampleRate,outputBufferSampleRate:this.sampleRate}),this.wavWorker.postMessage({command:"init",wavBitDepth:16,wavSampleRate:this.sampleRate}),this.log("[DECODER] send decode"),this.worker.postMessage({command:"decode",pages:e.pages,waveform:e.withWaveform},o.IS_SAFARI?void 0:[e.pages.buffer]),e.timeout=window.setTimeout((()=>{this.log.error("decode timeout"),this.terminateWorkers(!0),this.tasks.length&&(this.loadWorker(),this.loadWavWorker()),this.onTaskEnd(this.tasks.shift())}),1e4)}pushDecodeTask(e,t){return new Promise(((n,s)=>{const i={pages:e,withWaveform:t,callback:{resolve:n,reject:s},timeout:0};this.loadWorker(),this.loadWavWorker(),1===this.tasks.push(i)&&this.executeNewTask(i)}))}decode(e,t=!1){return c(this,void 0,void 0,(function*(){return this.pushDecodeTask(e,t).then((e=>c(this,void 0,void 0,(function*(){const t=new Blob([e.bytes],{type:"audio/wav"});return{url:yield a.Z.invoke("createObjectURL",t),waveform:e.waveform}}))))}))}};s.GO.opusDecodeController=l;const d=l},2423:(e,t,n)=>{n.d(t,{$2:()=>u,E:()=>g,Hk:()=>p,QB:()=>m,SC:()=>f,bu:()=>l,it:()=>c,kO:()=>b,tY:()=>v});var s=n(1229);const i="a-z\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u00ff\\u0100-\\u024f\\u0253\\u0254\\u0256\\u0257\\u0259\\u025b\\u0263\\u0268\\u026f\\u0272\\u0289\\u028b\\u02bb\\u0300-\\u036f\\u1e00-\\u1eff\\u0400-\\u04ff\\u0500-\\u0527\\u2de0-\\u2dff\\ua640-\\ua69f\\u0591-\\u05bf\\u05c1-\\u05c2\\u05c4-\\u05c5\\u05c7\\u05d0-\\u05ea\\u05f0-\\u05f4\\ufb1d-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40-\\ufb41\\ufb43-\\ufb44\\ufb46-\\ufb4f\\u0610-\\u061a\\u0620-\\u065f\\u066e-\\u06d3\\u06d5-\\u06dc\\u06de-\\u06e8\\u06ea-\\u06ef\\u06fa-\\u06fc\\u06ff\\u0750-\\u077f\\u08a0\\u08a2-\\u08ac\\u08e4-\\u08fe\\ufb50-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\u200c\\u0e01-\\u0e3a\\u0e40-\\u0e4e\\u1100-\\u11ff\\u3130-\\u3185\\uA960-\\uA97F\\uAC00-\\uD7AF\\uD7B0-\\uD7FF\\u3003\\u3005\\u303b\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uff9f\\uffa1-\\uffdc",o="0-9_"+i,r="["+i+"0-9]",a="((?:https?|ftp)://|mailto:)?",c=a+"(?:"+r+"{1,64}(?::"+r+"{0,64})?@)?(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}|"+r+"["+i+"·0-9-]{0,64}(?:\\."+r+"["+i+"·0-9-]{0,64}){0,10}(?:\\.(xn--[0-9a-z]{2,16}|["+i+"]{2,24})))(?::\\d{2,5})?(?:/(?:\\S{0,255}[^\\s.;,(\\[\\]{}<>\"'])?)?",l=(new RegExp("^"+a.slice(0,-1),"i"),/^((?:[^\/]+?):\/\/|mailto:)/),d="[a-zA-Z\\d_]{5,32}",h="\\/([a-zA-Z\\d_]{1,32})(?:@("+d+"))?(\\b|$)",u=new RegExp("(^| )(@)("+d+")|("+c+")|(\\n)|("+s.Z+")|(^|[\\s\\(\\]])(#["+o+"]{2,64})|(^|\\s)"+h+"|(?:\\s|^)((?:\\d{1,2}:)?(?:[0-5]?[0-9]):(?:[0-5][0-9]))(?:\\s|$)","i"),g=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,m=/(^|\s|\n)(````?)([\s\S]+?)(````?)([\s\n\.,:?!;]|$)|(^|\s|\x01)(`|~~|\*\*|__|_-_|\|\|)([^\n]+?)\7([\x01\s\.,:?!;]|$)|@(\d+)\s*\((.+?)\)|(\[(.+?)\]\((.+?)\))/m,p={Telegram:"tg://search_hashtag?hashtag={1}",Twitter:"https://twitter.com/hashtag/{1}",Instagram:"https://instagram.com/explore/tags/{1}/","Google Plus":"https://plus.google.com/explore/{1}"},f={"`":"messageEntityCode","``":"messageEntityPre","**":"messageEntityBold",__:"messageEntityItalic","~~":"messageEntityStrike","_-_":"messageEntityUnderline","||":"messageEntitySpoiler"},v=new Set(["messageEntityEmoji","messageEntityLinebreak","messageEntityCaret"]);for(const e in f)v.add(f[e]);const b=/^\+\d+$/},3591:(e,t,n)=>{n.d(t,{Z:()=>a});var s=n(2423),i=n(410),o=n(6637),r=n(1507);function a(e,t){(0,o.Z)(e)||(e="https://"+e);const n={url:e};let i,a,c,l;if(i=e.match(/^(?:https?:\/\/)?(?:(.+?)\.)?(?:(?:web|k|z)\.)?t(?:elegram)?\.me(?:\/(.+))?/)){const t=new URL(e);let n=i[1];n&&r.BX.has(i[1])&&(n=void 0),n&&(t.pathname=n+("/"===t.pathname?"":t.pathname));const o=t.pathname.slice(1),a=o.split("/");if(a[0]&&"$"===a[0][0]&&a[0].length>1)l="invoice";else if(/^\W/.test(o)&&!s.kO.test(o))l="joinchat";else switch(a[0]){case"joinchat":case"addstickers":case"addemoji":case"voicechat":case"invoice":if(1!==a.length&&!n){l=a[0];break}default:if(a[1]&&a[1].match(/^\d+(?:\?(?:comment|thread)=\d+)?$/)||1===a.length){l="im";break}}}else(a=e.match(/^(?:https?:\/\/)?telesco\.pe\/([^/?]+)\/(\d+)/))?l="im":(c=e.match(/tg:(?:\/\/)?(.+?)(?:\?|$)/))&&(l="tg_"+c[1]);return window[l]||(l=void 0),n.onclick=l,n}i.GO&&(i.GO.wrapUrl=a)},3512:(e,t,n)=>{n.d(t,{Z:()=>d});var s=n(1507),i=n(3241),o=n(410),r=n(3206),a=n(1352);class c extends i.Z{constructor(){super(),this.myId=s.NM,this.connectionStatus={},this.premium=!1,this.addEventListener("user_auth",(({id:e})=>{this.myId=e.toPeerId()})),this.addEventListener("premium_toggle_private",(({isNew:e,isPremium:t})=>{this.premium=t,this.dispatchEventSingle("premium_toggle",t)})),this.addEventListener("connection_status_change",(e=>{this.connectionStatus[e.name]=e})),this.dispatchEvent=(e,...t)=>{super.dispatchEvent(e,...t),r.Z.getInstance().invokeVoid("event",{name:e,args:t})},a.kC||this.addEventListener("settings_updated",(({settings:e})=>{this.settings=e}))}getConnectionStatus(){return this.connectionStatus}getPremium(){return this.premium}dispatchEventSingle(...e){super.dispatchEvent(...e)}}const l=new c;o.GO.rootScope=l;const d=l},7730:(e,t,n)=>{n.d(t,{Z:()=>r});var s=n(410),i=n(3725);const o=new class{constructor(){this.convertPromises={}}init(){this.worker=new Worker(new URL(n.p+n.u(61),n.b)),this.worker.addEventListener("message",(e=>{const t=e.data.payload,n=this.convertPromises[t.fileName];n&&(t.bytes?n.resolve(t.bytes):n.reject(),delete this.convertPromises[t.fileName])}))}postMessage(e){this.init&&(this.init(),this.init=null),this.worker.postMessage(e)}convert(e,t){if(this.convertPromises.hasOwnProperty(e))return this.convertPromises[e];const n=(0,i.Z)();return this.postMessage({type:"convertWebp",payload:{fileName:e,bytes:t}}),this.convertPromises[e]=n}};s.GO.webpWorkerController=o;const r=o}},r={};function a(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={exports:{}};return o[e].call(n.exports,n,n.exports,a),n.exports}a.m=o,e=[],a.O=(t,n,s,i)=>{if(!n){var o=1/0;for(d=0;d=i)&&Object.keys(a.O).every((e=>a.O[e](n[c])))?n.splice(c--,1):(r=!1,i0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[n,s,i]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(e,s){if(1&s&&(e=this(e)),8&s)return e;if("object"==typeof e&&e){if(4&s&&e.__esModule)return e;if(16&s&&"function"==typeof e.then)return e}var i=Object.create(null);a.r(i);var o={};t=t||[null,n({}),n([]),n(n)];for(var r=2&s&&e;"object"==typeof r&&!~t.indexOf(r);r=n(r))Object.getOwnPropertyNames(r).forEach((t=>o[t]=()=>e[t]));return o.default=()=>e,a.d(i,o),i},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,n)=>(a.f[n](e,t),t)),[])),a.u=e=>(({589:"crypto.worker",630:"npm.qr-code-styling",670:"sw",678:"mtproto.worker"}[e]||e)+"."+{8:"93d2f33af815eb0455aa",53:"40d79ab9d14e8d83cf01",61:"043c67ed911cb9f8422c",63:"7ac6657334217aaadb5b",77:"b8cf11d2b5dca36479ca",104:"f1b4b4be86382aaf84f5",147:"bb5274ee5cc526f48754",231:"f4d1bfe6ff7f14577f96",301:"95838a8203f23dd1ce8f",339:"12bdbede82465e666965",392:"6ce981ebdcbba9b6fd04",436:"9e54c5e9f3feccf9d736",437:"37bcbe9db9cbb8d8a753",442:"54c010363ba1cdea7bce",508:"864916919938e5f14eb7",589:"7fb5055c6558e4a5c265",630:"f8f57a1c721e03c3f699",641:"527b52a7a5052f57e455",642:"be93122d1116ecdc9322",670:"a4cbb23cb45b5ad95353",678:"44189744893b344288e7",709:"c5451446b3485d2557e8",742:"4a4829b5ed21258b69e6",776:"444edaecf4b03894ef8e",781:"c527d73f348ae695f21a",783:"949e247466ad3ebe82d6",810:"aad7a584f7c8c739c66e",813:"315ffd640c7d6013a536"}[e]+".chunk.js"),a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s={},i="tweb:",a.l=(e,t,n,o)=>{if(s[e])s[e].push(t);else{var r,c;if(void 0!==n)for(var l=document.getElementsByTagName("script"),d=0;d{r.onerror=r.onload=null,clearTimeout(g);var i=s[e];if(delete s[e],r.parentNode&&r.parentNode.removeChild(r),i&&i.forEach((e=>e(n))),t)return t(n)},g=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),c&&document.head.appendChild(r)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{if(void 0!==a){var e=a.u,t=a.e,n={},s={};a.u=function(t){return e(t)+(n.hasOwnProperty(t)?"?"+n[t]:"")},a.e=function(i){return t(i).catch((function(t){var o=s.hasOwnProperty(i)?s[i]:999999;if(o<1){var r=e(i);throw t.message="Loading chunk "+i+" failed after 999999 retries.\n("+r+")",t.request=r,t}return new Promise((function(e){setTimeout((function(){var t=Date.now();n[i]=t,s[i]=o-1,e(a.e(i))}),3e3)}))}))}}})(),(()=>{a.b=document.baseURI||self.location.href;var e={179:0};a.f.j=(t,n)=>{var s=a.o(e,t)?e[t]:void 0;if(0!==s)if(s)n.push(s[2]);else{var i=new Promise(((n,i)=>s=e[t]=[n,i]));n.push(s[2]=i);var o=a.p+a.u(t),r=new Error;a.l(o,(n=>{if(a.o(e,t)&&(0!==(s=e[t])&&(e[t]=void 0),s)){var i=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;r.message="Loading chunk "+t+" failed.\n("+i+": "+o+")",r.name="ChunkLoadError",r.type=i,r.request=o,s[1](r)}}),"chunk-"+t,t)}},a.O.j=t=>0===e[t];var t=(t,n)=>{var s,i,[o,r,c]=n,l=0;if(o.some((t=>0!==e[t]))){for(s in r)a.o(r,s)&&(a.m[s]=r[s]);if(c)var d=c(a)}for(t&&t(n);la(2938)));c=a.O(c)})(); -//# sourceMappingURL=main.228ad639cd68cb5735ce.bundle.js.map \ No newline at end of file +(()=>{"use strict";var e,t,n,s,i,o={410:(e,t,n)=>{n.d(t,{GO:()=>r,Tj:()=>i,ZP:()=>a});var s=n(1267);const i=!1,o=i||s.Z.debug,r="undefined"!=typeof window?window:self,a=o},236:(e,t,n)=>{n.d(t,{t:()=>c,h:()=>d});var s=n(4762),i=n(144),o=n(4159);const r=o.Z.version,a=o.Z.build,c={_:"theme",access_hash:"",id:"",settings:[{_:"themeSettings",pFlags:{},base_theme:{_:"baseThemeClassic"},accent_color:3379436,message_colors:[5221966],wallpaper:{_:"wallPaper",pFlags:{default:!0,pattern:!0},access_hash:"",document:void 0,id:"",slug:"pattern",settings:{_:"wallPaperSettings",pFlags:{},intensity:50,background_color:14409147,second_background_color:7054727,third_background_color:14014605,fourth_background_color:8960132}}},{_:"themeSettings",pFlags:{},base_theme:{_:"baseThemeNight"},accent_color:8877281,message_colors:[8877281],wallpaper:{_:"wallPaper",pFlags:{default:!0,pattern:!0,dark:!0},access_hash:"",document:void 0,id:"",slug:"pattern",settings:{_:"wallPaperSettings",pFlags:{},intensity:-50,background_color:16696470,second_background_color:14511289,third_background_color:9842623,fourth_background_color:5200853}}}],slug:"",title:"",emoticon:"🏠",pFlags:{default:!0}},l=(e,t,n)=>Object.assign(Object.assign({},c),{name:e,settings:Object.assign(Object.assign({},c.settings.find((e=>e.base_theme._===t))),{highlightningColor:n})}),d={allDialogsLoaded:{},pinnedOrders:{},contactsListCachedTime:0,updates:{},filtersArr:[],maxSeenMsgId:0,stateCreatedTime:Date.now(),recentEmoji:[],recentCustomEmoji:[],topPeersCache:{},recentSearch:[],version:r,build:a,authState:{_:s.IS_MOBILE?"authStateSignIn":"authStateSignQr"},hiddenPinnedMessages:{},settings:{messagesTextSize:16,distanceUnit:"kilometers",sendShortcut:"enter",autoDownload:{photo:{contacts:!0,private:!0,groups:!0,channels:!0},video:{contacts:!0,private:!0,groups:!0,channels:!0},file:{contacts:!0,private:!0,groups:!0,channels:!0}},autoDownloadNew:{_:"autoDownloadSettings",file_size_max:3145728,pFlags:{video_preload_large:!0,audio_preload_next:!0},photo_size_max:1048576,video_size_max:15728640,video_upload_maxbitrate:100},stickers:{suggest:"all",dynamicPackOrder:!0,loop:!0},emoji:{suggest:!0,big:!0},themes:[l("day","baseThemeClassic","hsla(86.4, 43.846153%, 45.117647%, .4)"),l("night","baseThemeNight","hsla(299.142857, 44.166666%, 37.470588%, .4)")],theme:"system",notifications:{sound:!1},timeFormat:(new Date).toLocaleString().match(/\s(AM|PM)/)?"h12":"h23",liteMode:{all:!1,animations:!1,chat:!1,chat_background:!1,chat_spoilers:!1,effects:!1,effects_premiumstickers:!1,effects_reactions:!1,effects_emoji:!1,emoji:!1,emoji_messages:!1,emoji_panel:!1,gif:!1,stickers:!1,stickers_chat:!1,stickers_panel:!1,video:!1}},playbackParams:{volume:1,muted:!1,playbackRate:1,playbackRates:{voice:1,video:1,audio:1},loop:!1,round:!1},keepSigned:!0,chatContextMenuHintWasShown:!1,stateId:(0,i.d)(32),notifySettings:{}}},8189:(e,t,n)=>{n.d(t,{Z:()=>i});let s=!1;try{const e=document.createElement("canvas").getContext("webgl"),t=e.getExtension("WEBGL_debug_renderer_info"),n=t&&e.getParameter(t.UNMASKED_RENDERER_WEBGL)||"";(n.match(/Apple/)&&!n.match(/Apple GPU/)||-1===e.getSupportedExtensions().indexOf("WEBGL_compressed_texture_s3tc_srgb"))&&(s=!0)}catch(e){}const i=s},993:(e,t,n)=>{n.d(t,{Z:()=>s});const s=n(4089).Z},7328:(e,t,n)=>{let s;if(n.d(t,{Z:()=>i}),n(4762).IS_SAFARI)try{s=+navigator.userAgent.match(/Version\/(.+?) /)[1]>=14}catch(e){s=!1}else s=!0;const i=s},6663:(e,t,n)=>{n.d(t,{Z:()=>s});const s="filter"in(document.createElement("canvas").getContext("2d")||{})},9976:(e,t,n)=>{n.d(t,{Z:()=>s});const s=-1!==navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i)},3731:(e,t,n)=>{var s;n.d(t,{Z:()=>i});const i=!!(null===(s=null===navigator||void 0===navigator?void 0:navigator.geolocation)||void 0===s?void 0:s.getCurrentPosition)&&!1},6818:(e,t,n)=>{n.d(t,{Z:()=>s});const s=n(4089).Z},1174:(e,t,n)=>{n.d(t,{Z:()=>o});var s=n(5269);const i=new Set(["image/jpeg","image/png","image/bmp"]);s.Z&&i.add("image/webp");const o=i},2341:(e,t,n)=>{n.d(t,{Z:()=>r});var s=n(1174),i=n(554);const o=[...s.Z].concat([...i.Z]),r=new Set(o)},9030:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(4762);const i=!!document.createElement("video").canPlayType("video/quicktime")||s.IS_SAFARI||s.IS_APPLE_MOBILE},5783:(e,t,n)=>{n.d(t,{Z:()=>i});const s=document.createElement("audio"),i=!(!s.canPlayType||!s.canPlayType("audio/ogg;").replace(/no/,""))},2365:(e,t,n)=>{n.d(t,{Z:()=>s});const s=!n(4762).IS_FIREFOX&&!1},2820:(e,t,n)=>{n.d(t,{Z:()=>s});const s=!!("getDisplayMedia"in((null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||{}))},2045:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(1267);const i="undefined"!=typeof SharedWorker&&!s.Z.noSharedWorker},5432:(e,t,n)=>{n.d(t,{Z:()=>s});const s="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch},4762:(e,t,n)=>{n.r(t),n.d(t,{IS_ANDROID:()=>r,IS_APPLE:()=>o,IS_APPLE_MOBILE:()=>c,IS_CHROMIUM:()=>a,IS_FIREFOX:()=>d,IS_MOBILE:()=>u,IS_MOBILE_SAFARI:()=>h,IS_SAFARI:()=>l,USER_AGENT:()=>i});var s=n(6761);const i=navigator?navigator.userAgent:null,o=-1!==navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i),r=-1!==navigator.userAgent.toLowerCase().indexOf("android"),a=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor),c=(/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!s.Z.MSStream,l=!!("safari"in s.Z)||!(!i||!(/\b(iPad|iPhone|iPod)\b/.test(i)||i.match("Safari")&&!i.match("Chrome"))),d=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,h=l&&c,u=(void 0===navigator.maxTouchPoints||navigator.maxTouchPoints>0)&&-1!=navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i)},2131:(e,t,n)=>{n.d(t,{Z:()=>s});const s=!!(null===navigator||void 0===navigator?void 0:navigator.vibrate)},554:(e,t,n)=>{n.d(t,{Z:()=>o});var s=n(9030);const i=new Set(["image/gif","video/mp4","video/webm"]);s.Z&&i.add("video/quicktime");const o=i},393:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(4762);const i=!!document.createElement("video").canPlayType("video/webm")&&!s.IS_SAFARI&&!s.IS_APPLE_MOBILE},5269:(e,t,n)=>{n.d(t,{Z:()=>s});const s=document.createElement("canvas").toDataURL("image/webp").startsWith("data:image/webp")},4089:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(4762);const i=!("undefined"==typeof RTCPeerConnection||s.IS_FIREFOX)},2064:(e,t,n)=>{n.d(t,{Dk:()=>g,EM:()=>w,K5:()=>u,Pi:()=>c,WE:()=>o,Y6:()=>a,cw:()=>d,dI:()=>r,e9:()=>f,ix:()=>p,oo:()=>l,py:()=>i,t1:()=>h,tB:()=>y,uY:()=>v});var s=n(3228);function i(e,t,n){e/=255,t/=255,n/=255;const s=Math.max(e,t,n),i=s-Math.min(e,t,n),o=i&&(s===e?(t-n)/i:s==t?2+(n-e)/i:4+(e-t)/i);return[60*(o<0?o+6:o),s&&i/s,s]}function o(e,t,n){const s=(s,i=(s+e/60)%6)=>Math.round(255*(n-n*t*Math.max(Math.min(i,4-i,1),0)));return[s(5),s(3),s(1)]}function r(e,t,n,s=1){e/=255,t/=255,n/=255;const i=Math.max(e,t,n),o=Math.min(e,t,n);let r,a;const c=(i+o)/2;if(i===o)r=a=0;else{const s=i-o;switch(a=c>.5?s/(2-i-o):s/(i+o),i){case e:r=(t-n)/s+(t1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;i=s(c,a,e+1/3),o=s(c,a,e),r=s(c,a,e-1/3)}return[i,o,r,s].map((e=>Math.round(255*e)))}function c(e){const t=[],n="#"===e[0]?1:0;if(e.length===5+n&&(e=(n?"#":"")+"0"+e.slice(n)),e.length===3+n)for(let s=n;s("0"+e.toString(16)).slice(-2))).join("")}function u(e){return function(e){return h(function(e){const t=e.slice(5,-1).split(", "),n=+t.pop(),s=t.map((e=>e.endsWith("%")?+e.slice(0,-1):+e));return a(s[0],s[1],s[2],n)}(e))}(e).slice(0,-2)}function g(e,t,n){const s=new Array(3);for(let i=0;i<3;++i){const o=e[i],r=t[i];s[i]=Math.floor(r+(o-r)*n)}return s}function m(e){return(.2126*e[0]+.7152*e[1]+.0722*e[2])/255}function p(e,t){return e.map(((e,n)=>Math.round((e+t[n])/2)))}function f(e,t,n){const s=i(...t),r=i(...n),a=Math.min(1.5*s[1]/e[1],1);return s[0]=Math.min(360,r[0]-s[0]+e[0]),s[1]=Math.min(1,r[1]*e[1]/s[1]),s[2]=Math.min(1,(r[2]/s[2]+a-1)*e[2]/a),s[2]<.3?n:o(...s)}function v(e,t,n,r){const a=i(...n);if(Math.min(Math.abs(a[0]-e[0]),Math.abs(a[0]-e[0]-360))>30)return n;const c=Math.min(1.5*a[1]/e[1],1);a[0]=Math.min(360,a[0]+t[0]-e[0]),a[1]=Math.min(1,a[1]*t[1]/e[1]),a[2]=Math.min(1,a[2]*(1-c+c*t[2]/e[2]));let l=o(...a);const d=m(n),h=m(l);if(r?d>h:d(0,s.Z)(Math.round(e*t),0,255)))}(l,(1-e)*d/h+e)}return l}function b(e){const t=(e<0?16777215+e:e).toString(16);return"#"+(t.length>=6?t:"0".repeat(6-t.length)+t)}function y(e){return l(b(e))}function w(e){return e.settings?[e.settings.background_color,e.settings.second_background_color,e.settings.third_background_color,e.settings.fourth_background_color].filter(Boolean).map(b).join(","):""}},6009:(e,t,n)=>{function s(e,t){e=e.split(" ",1)[0],t=t.split(" ",1)[0];const n=e.split("."),s=t.split(".");for(let e=0;ei)return 1;if(ts})},8799:(e,t,n)=>{function s(){var e;return!!(null===(e=document.activeElement)||void 0===e?void 0:e.blur)&&(document.activeElement.blur(),!0)}n.d(t,{Z:()=>s})},3910:(e,t,n)=>{function s(e){if(e||(e=window.event),e){e=e.originalEvent||e;try{e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.returnValue=!1,e.cancelBubble=!0}catch(e){}}return!1}n.d(t,{Z:()=>s})},8497:(e,t,n)=>{function s(e,t){return e.closest("."+t)}n.d(t,{Z:()=>s})},5494:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(3035);function i(e){e.style.transform="translateY(-99999px)",e.focus(),(0,s.d1)().then((()=>{e.style.transform=""}))}},8090:(e,t,n)=>{n.d(t,{T:()=>a,Z:()=>c});var s=n(5432),i=n(4762),o=n(8497),r=n(5494);const a=i.IS_SAFARI&&i.IS_MOBILE&&s.Z;if(a){const e="clientY";let t=0;const n={capture:!0,passive:!1},s=n=>{const s=n.touches[0],i=(0,o.Z)(s.target,"scrollable-y");if(i){const o=s[e],r=t-o,a=i.scrollTop,c=i.scrollHeight,l=i.clientHeight,d=a?Math.round(a+i.clientHeight+r):a+r;(c===l||d>=c||d<=0)&&n.preventDefault()}else n.preventDefault()};let i=0;document.addEventListener("focusin",(o=>{!o.target.classList.contains("is-sticky-input-bugged")||o.timeStamp-i<50||((0,r.Z)(o.target),document.addEventListener("touchmove",s,n),document.addEventListener("touchstart",(n=>{if(n.touches.length>1)return;const s=n.touches[0];t=s[e]})))}),{passive:!0}),document.addEventListener("focusout",(e=>{document.removeEventListener("touchmove",s,n),i=e.timeStamp}),{passive:!0}),document.addEventListener("visibilitychange",(()=>{document.activeElement&&document.activeElement.classList.contains("is-sticky-input-bugged")&&document.activeElement.blur&&(0,r.Z)(document.activeElement)}),{passive:!0})}function c(e){a&&e.classList.add("is-sticky-input-bugged")}},6472:(e,t,n)=>{n.d(t,{B:()=>o,Z:()=>i});let s;function i(){window.addEventListener("beforeinstallprompt",(e=>{s=()=>{return t=this,n=void 0,o=function*(){e.prompt();const{outcome:t}=yield e.userChoice;"accepted"===t&&(s=void 0)},new((i=void 0)||(i=Promise))((function(e,s){function r(e){try{c(o.next(e))}catch(e){s(e)}}function a(e){try{c(o.throw(e))}catch(e){s(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(r,a)}c((o=o.apply(t,n||[])).next())}));var t,n,i,o}}))}function o(){return s}},4541:(e,t,n)=>{n.d(t,{Z:()=>c});var s=n(319),i=n(5418);const o=["b","б"],r={},a={text:"Roboto",icons:"tgico",monospace:"Roboto Mono"};function c(e={text:o,icons:void 0,monospace:o}){if(!("fonts"in document))return Promise.resolve();const t=[];for(const n in e){let s=e[n];"all"===s&&(s=o);const i=a[n],c="icons"===n?[500]:[400,500];for(const e of c){const n=(s||[void 0]).map((t=>{var n,s,o,a;const c=[e,"1rem",i].join(" ");return null!==(s=(o=null!==(n=r[c])&&void 0!==n?n:r[c]={})[a=t||""])&&void 0!==s?s:o[a]=document.fonts.load(c,t)}));t.push(...n)}}return Promise.race([Promise.all(t).catch(s.Z),(0,i.Z)(1e3)])}},130:(e,t,n)=>{function s(e,t){i(e),"string"==typeof t?t?e.innerHTML=t:e.replaceChildren():e.replaceChildren(t)}function i(e){e.setAttribute("dir","auto")}n.d(t,{Z:()=>s,m:()=>i})},2586:(e,t,n)=>{n.d(t,{Z:()=>a});var s=n(5432),i=n(3241);const o=s.Z?"touchstart":"mousemove";class r extends i.Z{constructor(){super(),this._isIdle=!0,this.focusPromise=Promise.resolve(),this.focusResolve=()=>{},window.addEventListener("blur",(()=>{this.isIdle=!0,window.addEventListener("focus",(()=>{this.isIdle=!1}),{once:!0})})),window.addEventListener(o,(()=>{this.isIdle=!1}),{once:!0,passive:!0}),this.addEventListener("change",(e=>{e?this.focusPromise=new Promise((e=>{this.focusResolve=e})):this.focusResolve()}))}getFocusPromise(){return this.focusPromise}get isIdle(){return this._isIdle}set isIdle(e){this._isIdle!==e&&(this._isIdle=e,this.dispatchEvent("change",e))}}const a=new r},3228:(e,t,n)=>{function s(e,t,n){return Math.min(n,Math.max(t,e))}n.d(t,{Z:()=>s})},3815:(e,t,n)=>{n.d(t,{Z:()=>o});var s=n(3241);class i extends s.Z{constructor(){super(...arguments),this.overlaysActive=0}get isOverlayActive(){return this.overlaysActive>0}set isOverlayActive(e){this.overlaysActive+=e?1:-1,this.dispatchEvent("change",this.isOverlayActive)}}const o=new i},3035:(e,t,n)=>{let s;function i(e){s?s.push(e):(s=[e],requestAnimationFrame((()=>{const e=s;s=void 0,e.forEach((e=>e()))})))}n.d(t,{AD:()=>l,T2:()=>i,TR:()=>c,d1:()=>d});let o,r,a=!1;function c(e){o?a?e():o.push(e):(o=[e],requestAnimationFrame((()=>{a=!0;for(let e=0;ei((()=>e())))),r.then((()=>{r=void 0})),r)}function d(){return new Promise((e=>{i((()=>{i(e)}))}))}},764:(e,t,n)=>{function s(e,t=e.split("?")){return i(null==t?void 0:t[1])}function i(e){const t={};return e?(e.split("&").forEach((e=>{t[e.split("=")[0]]=decodeURIComponent(e.split("=")[1])})),t):t}n.d(t,{V:()=>i,Z:()=>s})},6714:(e,t,n)=>{n.d(t,{Z:()=>h});var s=n(5432),i=n(3512),o=n(2064),r=n(410),a=function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function r(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}c((s=s.apply(e,t||[])).next())}))};const c={"primary-color":{rgb:!0,light:!0,lightFilled:!0,dark:!0,darkRgb:!0},"message-out-primary-color":{lightFilled:!0},"surface-color":{rgb:!0},"danger-color":{light:!0,dark:!0},"primary-text-color":{rgb:!0},"secondary-text-color":{light:!0,lightFilled:!0},"message-out-background-color":{light:!0,lightFilled:!0,dark:!0,darkFilled:!0},"saved-color":{lightFilled:!0}},l={day:{"primary-color":"#3390ec","message-out-primary-color":"#4fae4e","surface-color":"#ffffff","danger-color":"#df3f40","primary-text-color":"#000000","secondary-text-color":"#707579","saved-color":"#359AD4"},night:{"primary-color":"#8774E1","message-out-primary-color":"#8774E1","surface-color":"#212121","danger-color":"#ff595a","primary-text-color":"#ffffff","secondary-text-color":"#aaaaaa","saved-color":"#8774E1"}},d=new class{constructor(){i.Z.addEventListener("theme_change",(()=>{this.setTheme()}))}get themeColorElem(){return void 0!==this._themeColorElem?this._themeColorElem:this._themeColorElem=document.head.querySelector('[name="theme-color"]')||null}setThemeColor(e=this.themeColor){e||(e=this.isNight()?"#212121":"#ffffff");const t=this.themeColorElem;t&&t.setAttribute("content",e)}setThemeListener(){try{const e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{this.systemTheme=e.matches?"night":"day",i.Z.myId?i.Z.dispatchEvent("theme_change"):this.setTheme()};"addEventListener"in e?e.addEventListener("change",t):"addListener"in e&&e.addListener(t),t()}catch(e){}}applyHighlightningColor(){var e;let t;const n=this.getTheme();(null===(e=n.settings)||void 0===e?void 0:e.highlightningColor)?(t=n.settings.highlightningColor,document.documentElement.style.setProperty("--message-highlightning-color",t)):document.documentElement.style.removeProperty("--message-highlightning-color"),!s.Z&&t&&(this.themeColor=(0,o.K5)(t))}setTheme(){const e=this.isNight(),t=document.head.querySelector('[name="color-scheme"]');t&&t.setAttribute("content",e?"dark":"light"),document.documentElement.classList.toggle("night",e),this.setThemeColor();const n=this.getTheme();this.applyTheme(n);let s=this.styleElement;s||(s=this.styleElement=document.createElement("style"),document.head.append(s));const o=document.createElement("div");this.applyTheme(i.Z.settings.themes.find((e=>"night"===e.name)),o),s.textContent=`.night {${o.style.cssText}}`,this.applyHighlightningColor()}switchTheme(e){return a(this,void 0,void 0,(function*(){yield i.Z.managers.appStateManager.setByKey("settings.theme",e),i.Z.dispatchEvent("theme_change")}))}isNight(){return"night"===this.getTheme().name}getTheme(e=("system"===i.Z.settings.theme?this.systemTheme:i.Z.settings.theme)){return i.Z.settings.themes.find((t=>t.name===e))}bindColorApplier(e){const t=new Set;return{applyAppColor:n=>(t.add(n.name),this.applyAppColor(Object.assign(Object.assign({},n),e))),finalize:()=>{const n=e.isNight;for(const s in c)t.has(s)||this.applyAppColor(Object.assign({name:s,hex:l[n?"night":"day"][s]},e))}}}applyAppColor({name:e,hex:t,element:n,lightenAlpha:s=.08,darkenAlpha:i=s,mixColor:r,isNight:a}){const d=c[e],h=(0,o.oo)(t),u=(0,o.dI)(...h);null!=r||(r=(0,o.oo)(l[a?"night":"day"]["surface-color"]));const g=(0,o.Dk)(h,r,s),m=Object.assign(Object.assign({},u),{l:u.l-100*i});[[e,t],d.rgb&&[e+"-rgb",h.join(",")],d.light&&["light-"+e,`rgba(${h[0]}, ${h[1]}, ${h[2]}, ${s})`],d.lightFilled&&["light-filled-"+e,(0,o.t1)(g)],d.dark&&["dark-"+e,`hsl(${m.h}, ${m.s}%, ${m.l}%)`]].filter(Boolean).forEach((([e,t])=>{n.style.setProperty("--"+e,t)}))}applyNewTheme(e){return a(this,void 0,void 0,(function*(){const t=this.isNightTheme(e),n=this.getTheme(),s=i.Z.settings.themes,o=e.settings.find((e=>e.base_theme._===(t?"baseThemeNight":"baseThemeClassic"))),r=Object.assign(Object.assign({},e),{name:n.name,settings:Object.assign(Object.assign({},o),{highlightningColor:""})});yield this.AppBackgroundTab.setBackgroundDocument(o.wallpaper,r.settings),s[s.indexOf(n)]=r,yield i.Z.managers.appStateManager.setByKey("settings.themes",i.Z.settings.themes),i.Z.dispatchEvent("theme_change")}))}isNightTheme(e){return"night"===e.name||this.isNight()}applyTheme(e,t=document.documentElement){var n;const s=this.isNightTheme(e),i=Array.isArray(e.settings)?e.settings.find((e=>e.base_theme._===(s?"baseThemeNight":"baseThemeClassic"))):e.settings,r=l[s?"night":"day"];let a=(0,o.py)(...(0,o.oo)(r["primary-color"])),c=(0,o.py)(...(0,o.tB)(i.accent_color));const d=(0,o.uY)(a,c,(0,o.oo)(r["primary-color"]),!s),h=(0,o.t1)(d),{applyAppColor:u,finalize:g}=this.bindColorApplier({element:t,isNight:s});if(u({name:"primary-color",hex:h,darkenAlpha:.04}),u({name:"saved-color",hex:h,lightenAlpha:.64,mixColor:[255,255,255]}),!(null===(n=i.message_colors)||void 0===n?void 0:n.length))return;const m=s?.92:.12,p=(0,o.oo)(r["message-out-primary-color"]);a=(0,o.py)(...p);const f=(0,o.Dk)(p,(0,o.oo)(r["surface-color"]),m);let v=(0,o.tB)(i.message_colors[0]);i.message_colors.length>1&&(i.message_colors.slice(1).forEach((e=>{v=(0,o.ix)(v,(0,o.tB)(e))})),v=(0,o.e9)(a,f,v));const b=v;c=(0,o.py)(...b);const y=void 0!==i.outbox_accent_color&&(0,o.py)(...(0,o.tB)(i.outbox_accent_color)),w=(0,o.Dk)(v,(0,o.oo)(r["surface-color"]),m);u({name:"message-out-background-color",hex:(0,o.t1)(w),lightenAlpha:m}),u({name:"message-out-primary-color",hex:s?"#ffffff":(0,o.t1)(y?(0,o.WE)(...y):v),mixColor:w}),g()}};r.GO&&(r.GO.themeController=d);const h=d},2938:(e,t,n)=>{var s=n(4159),i=n(8799),o=n(3910),r=n(8090),a=n(4541),c=n(9976),l=n(4762),d=n(5418);!function(){const e={construct(e,t){let n=t[0]+"";return 0!==n.indexOf("blob:")&&(n+=location.search),new e(n)}};[Worker,"undefined"!=typeof SharedWorker&&SharedWorker].filter(Boolean).forEach((t=>{window[t.name]=new Proxy(t,e)}))}();var h=n(3512),u=n(5432),g=n(2325),m=(n(4110),n(690),n(3855)),p=n(2554),f=n(6714),v=n(3815),b=n(490),y=n(764),w=n(1267),S=n(410);const k="onbeforeinstallprompt"in window;var P=n(6472);document.addEventListener("DOMContentLoaded",(()=>{return e=void 0,t=void 0,E=function*(){var e;Element.prototype.toggleAttribute||(Element.prototype.toggleAttribute=function(e,t){return void 0!==t&&(t=!!t),this.hasAttribute(e)?!!t||(this.removeAttribute(e),!1):!1!==t&&(this.setAttribute(e,""),!0)}),void 0===Node.prototype.replaceChildren&&(Node.prototype.replaceChildren=function(...e){this.textContent="",e&&this.append(...e)}),h.Z.managers=(0,p.Z)(),document.getElementById("manifest").href=`site${l.IS_APPLE&&!l.IS_APPLE_MOBILE?"_apple":""}.webmanifest?v=jw3mK7G9Aq`,b.Z.start();const t=window.visualViewport||window;let _,E=!1;const A=()=>{const e=.01*(E&&!v.Z.isOverlayActive?t.height||t.innerHeight:window.innerHeight);_!==e&&(u.Z&&_1&&(0,i.Z)(),_=e,document.documentElement.style.setProperty("--vh",`${e}px`))};if(window.addEventListener("resize",A),A(),r.T){const e=()=>{E=1===n&&r.T&&!v.Z.isOverlayActive,A(),t!==window&&(E?(window.removeEventListener("resize",A),t.addEventListener("resize",A)):(t.removeEventListener("resize",A),window.addEventListener("resize",A)))};let n;window.onImTabChange=t=>{const s=void 0!==n;n=t,(s||1===n)&&e()},v.Z.addEventListener("change",(()=>{e()}))}if(l.IS_FIREFOX&&!c.Z&&document.addEventListener("dragstart",(e=>{const t=e.target;if("IMG"===t.tagName&&t.classList.contains("emoji"))return(0,o.Z)(e),!1})),c.Z&&document.documentElement.classList.add("native-emoji"),document.addEventListener("dragstart",(e=>{var t;if("IMG"===(null===(t=e.target)||void 0===t?void 0:t.tagName))return e.preventDefault(),!1})),document.addEventListener("contextmenu",(e=>{"IMG"!==e.target.tagName||window.appMediaViewer||(0,o.Z)(e)})),l.IS_FIREFOX&&document.documentElement.classList.add("is-firefox","no-backdrop"),l.IS_MOBILE&&document.documentElement.classList.add("is-mobile"),l.IS_APPLE)l.IS_SAFARI&&document.documentElement.classList.add("is-safari"),l.IS_APPLE_MOBILE?document.documentElement.classList.add("is-ios"):document.documentElement.classList.add("is-mac");else if(l.IS_ANDROID){document.documentElement.classList.add("is-android");const e=()=>{n=!0,window.addEventListener("resize",t,{once:!0})},t=()=>{n=!1,(0,i.Z)()};let n=!1;document.addEventListener("touchend",(t=>{const s=t.target.closest('[contenteditable="true"], input');s&&(document.activeElement===s||n||(console.log("input click",t,document.activeElement,s,s.matches(":focus")),window.addEventListener("resize",e,{once:!0})))}))}u.Z?document.documentElement.classList.add("is-touch"):document.documentElement.classList.add("no-touch"),k&&(0,P.Z)();const Z=performance.now(),C=g.ZP.getCacheLangPack(),[I,L]=yield Promise.all([m.Z.sendState().then((([e])=>e)),C]);function T(e,t){e.style.opacity="0",t.then((()=>{window.requestAnimationFrame((()=>{e.style.opacity=""}))}))}g.ZP.setTimeFormat(I.state.settings.timeFormat),h.Z.managers.rootScope.getPremium().then((e=>{h.Z.premium=e})),f.Z.setThemeListener(),L.appVersion!==s.Z.langPackVersion&&g.ZP.getLangPack(L.lang_code),console.log("got state, time:",performance.now()-Z),"ar"===L.lang_code&&S.Tj,document.documentElement.dir="ltr";let O=I.state.authState;const M=location.hash.split("?"),x=(0,y.V)(null!==(e=M[1])&&void 0!==e?e:M[0].slice(1));if(x.tgWebAuthToken&&"authStateSignedIn"!==O._){const e={token:x.tgWebAuthToken,dcId:+x.tgWebAuthDcId,userId:x.tgWebAuthUserId.toUserId(),isTest:void 0!==x.tgWebAuthTest&&!!+x.tgWebAuthTest,tgAddr:x.tgaddr};if(e.isTest!==w.Z.test){const e=new URLSearchParams(location.search);return+x.tgWebAuthTest?e.set("test","1"):e.delete("test"),void(location.search=e.toString())}h.Z.managers.appStateManager.pushToState("authState",O={_:"authStateSignImport",data:e})}if("authStateSignedIn"!==O._){console.log("Will mount auth page:",O._,Date.now()/1e3);const e=document.getElementById("auth-pages");let t,s;if(e){t=e.querySelector(".scrollable"),u.Z&&!l.IS_MOBILE_SAFARI||t.classList.add("no-scrollbar"),t.style.opacity="0";const n=document.createElement("div");n.classList.add("auth-placeholder"),t.prepend(n),t.append(n.cloneNode())}try{yield Promise.all([Promise.resolve().then(n.bind(n,2831)),Promise.resolve().then(n.bind(n,6702))]).then((([e,t])=>{e.default.setAuthorized(!1),t.default.forceUnsubscribe()}))}catch(e){}switch(O._){case"authStateSignIn":s=(yield Promise.all([n.e(147),n.e(297),n.e(63)]).then(n.bind(n,810))).default.mount();break;case"authStateSignQr":s=(yield Promise.all([n.e(147),n.e(297),n.e(709)]).then(n.bind(n,9709))).default.mount();break;case"authStateAuthCode":s=(yield Promise.all([n.e(147),n.e(297),n.e(53)]).then(n.bind(n,6392))).default.mount(O.sentCode);break;case"authStatePassword":s=(yield Promise.all([n.e(147),n.e(297),n.e(437)]).then(n.bind(n,9437))).default.mount();break;case"authStateSignUp":s=(yield Promise.all([n.e(147),n.e(297),n.e(339)]).then(n.bind(n,8339))).default.mount(O.authCode);break;case"authStateSignImport":s=(yield Promise.all([n.e(147),n.e(297),n.e(231)]).then(n.bind(n,3231))).default.mount(O.data)}t&&(s&&(yield s),T(t,"fonts"in document?Promise.race([(0,d.Z)(1e3),document.fonts.ready]):Promise.resolve()))}else console.log("Will mount IM page:",Date.now()/1e3),T(document.getElementById("main-columns"),(0,a.Z)()),(yield Promise.all([n.e(147),n.e(297),n.e(436)]).then(n.bind(n,5436))).default.mount()},new((_=void 0)||(_=Promise))((function(n,s){function i(e){try{r(E.next(e))}catch(e){s(e)}}function o(e){try{r(E.throw(e))}catch(e){s(e)}}function r(e){var t;e.done?n(e.value):(t=e.value,t instanceof _?t:new _((function(e){e(t)}))).then(i,o)}r((E=E.apply(e,t||[])).next())}));var e,t,_,E}))},1722:(e,t,n)=>{n.d(t,{Z:()=>s});const s=new class{reload(){try{location.reload()}catch(e){}}close(){try{window.close()}catch(e){}}focus(){window.focus()}}},2554:(e,t,n)=>{n.d(t,{Z:()=>c});var s=n(3855),i=n(410);const o={};function r(e,t){return new Proxy(e,{get:(e,n,r)=>{var a;return null!==(a=e[n])&&void 0!==a?a:e[n]=function(e,t){return new Proxy({},{get:(n,r,a)=>(...n)=>{var a;const c=s.Z.invoke("manager",{name:e,method:r,args:n},t);return i.ZP&&(null===(a=o[e])||void 0===a?void 0:a.has(r))&&console.warn("manager request",e,r,n),c}})}(n,t)}})}let a;function c(){return a||(a=r({},!1),a.acknowledged=r({},!0),a)}i.ZP&&(window.DEBUG_MANAGER_REQUESTS=o)},6666:(e,t,n)=>{n.d(t,{Z:()=>c});var s=n(1267),i=n(5471),o=n(5953),r=n(5003);class a{constructor(e){(0,o.Z)(this,e),s.Z.test&&(this.name+="_test"),this.storageIsAvailable=!0,this.log=(0,r.kg)(["IDB",e.name].join("-")),this.log("constructor"),this.openDatabase(!0),a.INSTANCES.push(this)}isAvailable(){return this.storageIsAvailable}openDatabase(e=!1){if(this.openDbPromise&&!e)return this.openDbPromise;const t=(e,t)=>{var n;const s=Array.from(e.indexNames);for(const t of s)e.deleteIndex(t);if(null===(n=t.indexes)||void 0===n?void 0:n.length)for(const n of t.indexes)e.indexNames.contains(n.indexName)||e.createIndex(n.indexName,n.keyPath,n.objectParameters)};try{var n=indexedDB.open(this.name,this.version);if(!n)return Promise.reject()}catch(e){return this.log.error("error opening db",e.message),this.storageIsAvailable=!1,Promise.reject(e)}let s=!1;return setTimeout((()=>{s||n.onerror((0,i.Z)("IDB_CREATE_TIMEOUT"))}),3e3),this.openDbPromise=new Promise(((e,i)=>{n.onsuccess=t=>{s=!0;const o=n.result;let r=!1;this.log("Opened"),o.onerror=e=>{this.storageIsAvailable=!1,this.log.error("Error creating/accessing IndexedDB database",e),i(e)},o.onclose=e=>{this.log.error("closed:",e),!r&&this.openDatabase()},o.onabort=e=>{this.log.error("abort:",e);const t=e.target;this.openDatabase(r=!0),t.onerror&&t.onerror(e),o.close()},o.onversionchange=e=>{this.log.error("onversionchange, lol?")},e(this.db=o)},n.onerror=e=>{s=!0,this.storageIsAvailable=!1,this.log.error("Error creating/accessing IndexedDB database",e),i(e)},n.onupgradeneeded=e=>{s=!0,this.log.warn("performing idb upgrade from",e.oldVersion,"to",e.newVersion);const n=e.target,i=n.result;this.stores.forEach((e=>{if(i.objectStoreNames.contains(e.name)){const s=n.transaction.objectStore(e.name);t(s,e)}else((e,n)=>{const s=e.createObjectStore(n.name);t(s,n)})(i,e)}))}}))}static create(e){var t;return null!==(t=this.INSTANCES.find((t=>t.name===e.name)))&&void 0!==t?t:new a(e)}static closeDatabases(e){this.INSTANCES.forEach((t=>{if(e&&e===t)return;const n=t.db;n&&(n.onclose=()=>{},n.close())}))}}a.INSTANCES=[];class c{constructor(e,t){this.storeName=t,this.log=(0,r.kg)(["IDB",e.name,t].join("-")),this.idb=a.create(e)}delete(e,t){const n=Array.isArray(e);return n||(e=[].concat(e)),this.getObjectStore("readwrite",(t=>{const s=e.map((e=>t.delete(e)));return n?s:s[0]}),"",t)}clear(e){return this.getObjectStore("readwrite",(e=>e.clear()),"",e)}save(e,t,n){const s=Array.isArray(e);return s||(e=[].concat(e),t=[].concat(t)),this.getObjectStore("readwrite",(n=>{const i=e.map(((e,s)=>n.put(t[s],e)));return s?i:i[0]}),"",n)}get(e,t){const n=Array.isArray(e);if(n){if(!e.length)return Promise.resolve([])}else{if(!e)return;e=[].concat(e)}return this.getObjectStore("readonly",(t=>{const s=e.map((e=>t.get(e)));return n?s:s[0]}),"",t)}getObjectStore(e,t,n,s=this.storeName){let i;return n&&(i=performance.now(),this.log(n+": start")),this.idb.openDatabase().then((o=>new Promise(((r,a)=>{const c=o.transaction([s],e),l=()=>{clearTimeout(u),a(c.error)},d=()=>{clearTimeout(u),n&&this.log(n+": end",performance.now()-i);const e=p.map((e=>e.result));r(m?e:e[0])};c.onerror=l;const h="readwrite"===e;h&&(c.oncomplete=()=>d());const u=setTimeout((()=>{this.log.error("transaction not finished",c,n)}),1e4),g=t(c.objectStore(s)),m=Array.isArray(g),p=m?g:[].concat(g);if(h)return;const f=p.length;let v=f;const b=()=>{c.error||--v||d()};for(let e=0;ee.getAll()),"",e)}}},2325:(e,t,n)=>{n.d(t,{$d:()=>w,A1:()=>S,Hz:()=>m,XZ:()=>y,ZP:()=>v,ag:()=>b,nK:()=>p,v_:()=>k});var s=n(410),i=n(7922),o=n(4159),r=n(3512),a=n(4762),c=n(6848),l=n(5953),d=n(9005),h=n(6637),u=n(3591),g=n(130);const m={messageActionChatCreate:"ActionCreateGroup",messageActionChatCreateYou:"ActionYouCreateGroup",messageActionChatEditTitle:"ActionChangedTitle",messageActionChatEditPhoto:"ActionChangedPhoto",messageActionChatEditVideo:"ActionChangedVideo",messageActionChatDeletePhoto:"ActionRemovedPhoto",messageActionChatReturn:"ActionAddUserSelf",messageActionChatReturnYou:"ActionAddUserSelfYou",messageActionChatJoined:"ActionAddUserSelfMega",messageActionChatJoinedYou:"ChannelMegaJoined",messageActionChatAddUser:"ActionAddUser",messageActionChatAddUsers:"ActionAddUser",messageActionChatLeave:"ActionLeftUser",messageActionChatLeaveYou:"YouLeft",messageActionChatDeleteUser:"ActionKickUser",messageActionChatJoinedByLink:"ActionInviteUser",messageActionPinMessage:"Chat.Service.Group.UpdatedPinnedMessage",messageActionContactSignUp:"Chat.Service.PeerJoinedTelegram",messageActionChannelCreate:"ActionCreateChannel",messageActionChannelEditTitle:"Chat.Service.Channel.UpdatedTitle",messageActionChannelEditPhoto:"Chat.Service.Channel.UpdatedPhoto",messageActionChannelEditVideo:"Chat.Service.Channel.UpdatedVideo",messageActionChannelDeletePhoto:"Chat.Service.Channel.RemovedPhoto",messageActionHistoryClear:"HistoryCleared",messageActionDiscussionStarted:"DiscussionStarted",messageActionChannelMigrateFrom:"ActionMigrateFromGroup","messageActionPhoneCall.video_in_ok":"ChatList.Service.VideoCall.incoming","messageActionPhoneCall.video_out_ok":"ChatList.Service.VideoCall.outgoing","messageActionPhoneCall.video_missed":"ChatList.Service.VideoCall.Missed","messageActionPhoneCall.video_cancelled":"ChatList.Service.VideoCall.Cancelled","messageActionPhoneCall.in_ok":"ChatList.Service.Call.incoming","messageActionPhoneCall.out_ok":"ChatList.Service.Call.outgoing","messageActionPhoneCall.missed":"ChatList.Service.Call.Missed","messageActionPhoneCall.cancelled":"ChatList.Service.Call.Cancelled","messageActionGroupCall.started":"Chat.Service.VoiceChatStarted.Channel","messageActionGroupCall.started_by":"Chat.Service.VoiceChatStarted","messageActionGroupCall.started_byYou":"Chat.Service.VoiceChatStartedYou","messageActionGroupCall.ended":"Chat.Service.VoiceChatFinished.Channel","messageActionGroupCall.ended_by":"Chat.Service.VoiceChatFinished","messageActionGroupCall.ended_byYou":"Chat.Service.VoiceChatFinishedYou",messageActionBotAllowed:"Chat.Service.BotPermissionAllowed"},p=a.IS_MOBILE?"Message.Unsupported.Mobile":"Message.Unsupported.Desktop";var f;!function(e){let t,a;function m(t){e.lastRequestedLangCode=t,e.lastRequestedNormalizedLangCode=t.split("-")[0]}function p(){if("h12"===e.timeFormat)try{const t=A({hour:"numeric",minute:"numeric",hour12:!0}),n=new Date;n.setHours(0);const s=t.format(n);e.amPmCache.am=s.split(/\s/)[1],n.setHours(12);const i=t.format(n);e.amPmCache.pm=i.split(/\s/)[1]}catch(t){console.error("cannot get am/pm",t),e.amPmCache={am:"AM",pm:"PM"}}}function f(){const e=o.Z.langPackCode;return m(e),Promise.all([n.e(104).then(n.bind(n,9104)),n.e(301).then(n.bind(n,9301)),n.e(8).then(n.bind(n,9179))]).then((([t,n,s])=>{const i=[];return b(t.default,i),b(n.default,i),y({_:"langPackDifference",from_version:0,lang_code:e,strings:i,version:0,local:!0,countries:s.default})}))}function v(t,s){e.requestedServerLanguage=!0;const i=r.Z.managers;return Promise.all([i.apiManager.invokeApiCacheable("langpack.getLangPack",{lang_code:t,lang_pack:"web"}),!1,n.e(104).then(n.bind(n,9104)),n.e(301).then(n.bind(n,9301)),i.apiManager.invokeApiCacheable("help.getCountriesList",{lang_code:t,hash:0}),e.polyfillPromise])}function b(e,t=[]){for(const n in e){const s=e[n];"string"==typeof s?t.push({_:"langPackString",key:n,value:s}):t.push(Object.assign({_:"langPackStringPluralized",key:n},s))}return t}function y(e){return e.appVersion=o.Z.langPackVersion,i.Z.set({langPack:e}).then((()=>(w(e),e)))}function w(n){const s=e.lastRequestedLangCode;if(n.lang_code===s){try{t=new Intl.PluralRules(e.lastRequestedNormalizedLangCode)}catch(n){console.error("pluralRules error",n),t=new Intl.PluralRules(e.lastRequestedNormalizedLangCode.split("-",1)[0])}try{t=new Intl.PluralRules(n.lang_code)}catch(e){console.error("pluralRules error",e),t=new Intl.PluralRules(n.lang_code.split("-",1)[0])}e.strings.clear();for(const t of n.strings)e.strings.set(t.key,t);n.countries&&(e.countriesList.length=0,e.countriesList.push(...n.countries.countries),n.countries.countries.forEach((t=>{if(t.name){const n=t.default_name;e.strings.set(n,{_:"langPackString",key:n,value:t.name})}}))),e.lastAppliedLangCode!==s&&(r.Z.dispatchEvent("language_change",s),e.lastAppliedLangCode=s,E.clear(),p()),Array.from(document.querySelectorAll(".i18n")).forEach((t=>{const n=e.weakMap.get(t);n&&n.update()}))}}function S(e,t,n={i:0}){const s=[];let i=0;return e.replace(/(\*\*|__)(.+?)\1|(\n)|(\[.+?\]\(.*?\))|un\d|%\d\$.|%./g,((e,o,r,a,c,l,d)=>{if(s.push(d.slice(i,l)),o){let e;switch(o){case"**":e=document.createElement("b");break;case"__":e=document.createElement("i")}e.append(...S(r,t,n)),s.push(e)}else if(a)s.push(document.createElement("br"));else if(c){const e=c.lastIndexOf("]"),i=c.slice(1,e),o=c.slice(e+2,c.length-1);let r;if(o&&(0,h.Z)(o)){r=document.createElement("a");const e=(0,u.Z)(o);r.href=e.url,e.onclick&&r.setAttribute("onclick",e.onclick),r.target="_blank"}else r=t[n.i++],r instanceof DocumentFragment&&(r=r.firstChild),"string"!=typeof r&&(r.textContent="");const a=S(i,t,n);"string"==typeof r?s.push(...a):(r.append(...a),s.push(r))}else t&&function(e,t,n){const s=t[n.i++];Array.isArray(s)?e.push(...s):e.push(s)}(s,t,n);return i=l+e.length,""})),i!==e.length&&s.push(e.slice(i)),s}function k(n,s=!1,i){const o=e.strings.get(n);let r;if(o)if("langPackStringPluralized"===o._&&(null==i?void 0:i.length)){let e=i[0];"string"==typeof e&&(e=+e.replace(/\D/g,"")),r=o[t.select(e)+"_value"]||o.other_value}else r="langPackString"===o._?o.value:n;else r=n;const a=S(r,i);return s?a.map((e=>e instanceof Node?e.textContent:e)).join(""):a}e.strings=new Map,e.countriesList=[],e.requestedServerLanguage=!1,e.isRTL=!1,e.setRTL=function(t){e.isRTL=t},e.getCacheLangPack=function(){return a||(a=Promise.all([i.Z.get("langPack"),e.polyfillPromise]).then((([t])=>t?(s.ZP,e.lastRequestedLangCode||m(t.lang_code),w(t),t):f())).finally((()=>{a=void 0})))},e.setTimeFormat=function(t,n=!!e.timeFormat&&e.timeFormat!==t){e.timeFormat=t,p(),n&&(E.clear(),Array.from(document.querySelectorAll(".i18n")).forEach((t=>{const n=e.weakMap.get(t);n instanceof Z&&n.update()})))},e.loadLocalLangPack=f,e.loadLangPack=v,e.getStrings=function(e,t){return r.Z.managers.apiManager.invokeApi("langpack.getStrings",{lang_pack:o.Z.langPack,lang_code:e,keys:t})},e.formatLocalStrings=b,e.getLangPack=function(e,t){return m(e),v(e).then((([e,t,n,s,i,o])=>{let r=[];return[n,s].forEach((e=>{b(e.default,r)})),r=r.concat(...[e.strings,t.strings].filter(Boolean)),e.strings=r,e.countries=i,y(e)}))},e.saveLangPack=y,e.polyfillPromise="undefined"!=typeof Intl&&void 0!==Intl.PluralRules?Promise.resolve():n.e(642).then(n.bind(n,4642)).then((e=>{window.Intl=Object.assign("undefined"!=typeof Intl?Intl:{},e.default)})),e.applyLangPack=w,e.superFormatter=S,e.format=k,e.weakMap=new WeakMap;class P{constructor(t){this.element=(null==t?void 0:t.element)||document.createElement("span"),this.element.classList.add("i18n"),this.property=null==t?void 0:t.property,t&&(t.key||t.date)&&this.update(t),e.weakMap.set(this.element,this)}}class _ extends P{constructor(e={}){var t;super(Object.assign(Object.assign({},e),{property:null!==(t=e.property)&&void 0!==t?t:"innerHTML"}))}update(e){if((0,l.Z)(this,e),"innerHTML"===this.property)this.element.textContent="",this.element.append(...k(this.key,!1,this.args));else{const e=this.element[this.property],t=k(this.key,!0,this.args);void 0===e?this.element.dataset[this.property]=t:this.element[this.property]=t}}compareAndUpdate(e){if(this.key!==e.key||!(0,c.Z)(this.args,e.args))return this.update(e)}}e.IntlElement=_;const E=new Map;function A(t={}){const n=JSON.stringify(t);let s=E.get(n);return s||(s=new Intl.DateTimeFormat(e.lastRequestedNormalizedLangCode+"-u-hc-"+e.timeFormat,t),E.set(n,s)),s}e.amPmCache={am:"AM",pm:"PM"};class Z extends P{constructor(e){var t;super(Object.assign(Object.assign({},e),{property:null!==(t=e.property)&&void 0!==t?t:"textContent"})),(0,g.m)(this.element)}update(t){let n;if((0,l.Z)(this,t),this.options.hour&&this.options.minute&&2===Object.keys(this.options).length){const t=this.date.getHours();n=("0"+("h12"===e.timeFormat?t%12||12:t)).slice(-2)+":"+("0"+this.date.getMinutes()).slice(-2),"h12"===e.timeFormat&&(n+=" "+(t<12?e.amPmCache.am:e.amPmCache.pm))}else{const e=A(this.options);n=(0,d.Z)(e.format(this.date))}this.element[this.property]=n}}e.IntlDateElement=Z,e.i18n=function(e,t){return new _({key:e,args:t}).element},e.i18n_=function(e){return new _(e).element},e._i18n=function(e,t,n,s){return new _({element:e,key:t,args:n,property:s}).element}}(f||(f={}));const v=f,b=f.i18n,y=f.i18n_,w=f._i18n;function S(e,t){const n=e.slice(0,1);for(let s=1;s{const s=e&&t?"AutoDownloadSettings.LastDelimeter":"AutoDownloadSettings.Delimeter";return n?f.format(s,!0):b(s)}));return n?s.join(""):s}s.GO.I18n=f},1507:(e,t,n)=>{n.d(t,{BP:()=>u,BX:()=>m,DZ:()=>v,IA:()=>o,Iw:()=>l,J$:()=>p,NM:()=>s,OS:()=>h,Ox:()=>g,Pt:()=>d,Zi:()=>f,gZ:()=>c,hj:()=>i,rU:()=>a,yF:()=>r});const s=0,i=1271266957,o=777,r=777e3,a=2147483647,c="",l=20971520,d="",h=[7322096,16766590,13338331,9367192,16749490,16478047],u="default_static",g=4295032831,m=new Set(["web","k","z"]),p=0,f=1,v=new Set([p,f]);Math.max(...Array.from(v))},3855:(e,t,n)=>{n.d(t,{Z:()=>se});var s=n(3512),i=n(7730),o=n(410),r=n(7487),a=n(6702),c=n(1722),l=n(2831),d=n(5418),h=n(993),u=n(7328),g=n(6663),m=n(9976),p=n(3731),f=n(6818),v=n(1174),b=n(2341),y=n(9030),w=n(2365),S=n(2820),k=n(5432),P=n(2131),_=n(554),E=n(393),A=n(5269),Z=n(4089),C=n(4762),I=n(5783),L=n(2045),T=n(8189);const O=Object.assign({CAN_USE_TRANSFERABLES:u.Z,IS_APPLE_MX:T.Z,IS_CALL_SUPPORTED:h.Z,IS_CANVAS_FILTER_SUPPORTED:g.Z,IS_EMOJI_SUPPORTED:m.Z,IS_GEOLOCATION_SUPPORTED:p.Z,IS_GROUP_CALL_SUPPORTED:f.Z,IS_MOV_SUPPORTED:y.Z,IS_PARALLAX_SUPPORTED:w.Z,IS_SCREEN_SHARING_SUPPORTED:S.Z,IS_TOUCH_SUPPORTED:k.Z,IS_VIBRATE_SUPPORTED:P.Z,IS_OPUS_SUPPORTED:I.Z,IS_SHARED_WORKER_SUPPORTED:L.Z,IS_WEBM_SUPPORTED:E.Z,IS_WEBP_SUPPORTED:A.Z,IS_WEBRTC_SUPPORTED:Z.Z,IMAGE_MIME_TYPES_SUPPORTED:v.Z,MEDIA_MIME_TYPES_SUPPORTED:b.Z,VIDEO_MIME_TYPES_SUPPORTED:_.Z},C);var M=n(4159),x=n(236),W=n(6009),D=n(8479),R=n(946),N=n(7922),j=n(5466),F=n(5003);const U=x.h.version,B=x.h.build,V=Object.keys(x.h),G=["contactsListCachedTime","stateCreatedTime","maxSeenMsgId","filtersArr"];function $(){return e=this,t=void 0,i=function*(){const e=(0,F.kg)("STATE-LOADER"),t=performance.now(),n=(0,j.$)(e),i=V.map((e=>n(N.Z.get(e),"state "+e))).concat(n(r.Z.get("user_auth"),"auth"),n(r.Z.get("state_id"),"auth"),n(r.Z.get("k_build"),"auth")).concat(n(N.Z.get("user_auth"),"old auth")),a=yield Promise.all(i);e.warn("promises",performance.now()-t);const c=[],l=(e,t)=>{d[e]=t,c.push(e)};let d={};for(let e=0,t=V.length;eN.Z.get(e))));e.push("user_auth"),t.push("number"==typeof h||"string"==typeof h?{dcID:t[0]||M.Z.baseDcId,date:Date.now()/1e3|0,id:h.toPeerId(!1)}:h);const n={};e.forEach(((e,s)=>{n[e]=t[s]})),yield r.Z.set(n)}h&&(d.authState={_:"authStateSignedIn"},s.Z.dispatchEvent("user_auth","number"==typeof h||"string"==typeof h?{dcID:0,date:Date.now()/1e3|0,id:h.toPeerId(!1)}:h));const p=new Set;if(d.stateId!==u){if(void 0!==u){const e=new Map([["authState",void 0],["stateId",void 0]]);e.forEach(((t,n)=>{e.set(n,(0,D.Z)(d[n]))})),d=(0,D.Z)(x.h),e.forEach(((e,t)=>{d[t]=e}));const t={chats:1,dialogs:1,users:1};for(const e in t)p.add(e);f=d,c.length=0,d=f,c.push(...Object.keys(d))}yield r.Z.set({state_id:d.stateId})}var f;const v=Date.now();d.stateCreatedTime+864e5{l(e,(0,D.Z)(x.h[e]))})));const b=d.settings.autoDownload;if(void 0!==(null==b?void 0:b.private)){const e=["contacts","private","groups","channels"];["photo","video","file"].forEach((t=>{const n=b[t]={};e.forEach((e=>{n[e]=b[e]}))})),e.forEach((e=>{delete b[e]})),l("settings",d.settings)}const y=new Set(["settings.themes"]);let w,S;if((0,R.Z)(x.h,d,(e=>{l(e,d[e])}),void 0,y),d.version!==U||d.build!==B){if(d.build<217&&(d.allDialogsLoaded=(0,D.Z)(x.h.allDialogsLoaded),d.pinnedOrders=(0,D.Z)(x.h.pinnedOrders),d.filtersArr=(0,D.Z)(x.h.filtersArr),p.add("dialogs")),-1===(0,W.Z)(d.version,"1.7.1")){let e=!1;if(-1===(0,W.Z)(d.version,"1.3.0"))e=!0,d.settings.theme=(0,D.Z)(x.h.settings.theme),d.settings.themes=(0,D.Z)(x.h.settings.themes);else if(-1===(0,W.Z)(d.version,"1.7.1")){e=!0;const t=d.settings.themes;d.settings.themes=(0,D.Z)(x.h.settings.themes);try{t.forEach((e=>{const t=e.background;if(!t)return;const n=d.settings.themes.find((t=>t.name===e.name));n.settings.highlightningColor=t.highlightningColor;const s=(t.color||"").split(",").map((e=>e&&parseInt(e.slice(1),16)));if(t.color&&!t.slug)n.settings.wallpaper={_:"wallPaperNoFile",id:0,pFlags:{},settings:{_:"wallPaperSettings",pFlags:{}}};else{const e={_:"wallPaper",id:0,access_hash:0,slug:t.slug,document:{},pFlags:{},settings:{_:"wallPaperSettings",pFlags:{}}},s=e.settings;n.settings.wallpaper=e,t.slug&&!t.color?s.pFlags.blur=t.blur||void 0:t.intensity&&(s.intensity=t.intensity,e.pFlags.pattern=!0,e.pFlags.dark=t.intensity<0||void 0)}if(s.length){const e=n.settings.wallpaper.settings;e.background_color=s[0],e.second_background_color=s[1],e.third_background_color=s[2],e.fourth_background_color=s[3]}}))}catch(e){console.error("migrating themes error",e)}}e&&l("settings",d.settings)}d.build<309&&(d.settings.liteMode.animations=!d.settings.animationsEnabled,d.settings.liteMode.video=!d.settings.autoPlay.videos,d.settings.liteMode.gif=!d.settings.autoPlay.gifs),d.build<312&&"boolean"==typeof d.settings.stickers.suggest&&(d.settings.stickers.suggest=d.settings.stickers.suggest?"all":"none"),0!==(0,W.Z)(d.version,U)&&(w=U,S=d.version),l("version",U),l("build",B)}return g!==B&&(!g||g{var t,n;const{name:s,key:i,value:o}=e;if(!e.hasOwnProperty("key"))return void(this.mirrors[s]=o);const r=null!==(t=(n=this.mirrors)[s])&&void 0!==t?t:n[s]={};void 0===o?delete r[i]:r[i]=o},this.mirrors={},this.tabState={chatPeerIds:[],idleStartTime:0},this.log("constructor"),this.registerWorker(),this.registerServiceWorker(),this.registerCryptoWorker(),this.addMultipleEventsListeners({convertWebp:({fileName:e,bytes:t})=>i.Z.convert(e,t),convertOpus:({fileName:e,bytes:t})=>q.Z.pushDecodeTask(t,!1).then((e=>e.bytes)),event:({name:e,args:t})=>{s.Z.dispatchEventSingle(e,...t)},localStorageProxy:e=>{const t=e;return r.Z[t.type](...t.args)},mirror:this.onMirrorTask}),s.Z.addEventListener("language_change",(e=>{s.Z.managers.networkerFactory.setLanguage(e)})),window.addEventListener("online",(()=>{s.Z.managers.networkerFactory.forceReconnectTimeout()})),s.Z.addEventListener("logging_out",(()=>{Promise.all([(0,X.Z)(!1,!0),r.Z.clear(),Promise.race([l.default.setAuthorized(!1),(0,d.Z)(3e3)]),a.default.forceUnsubscribe(),Promise.all(["cachedFiles","cachedStreamChunks"].map((e=>caches.delete(e))))]).finally((()=>{c.Z.reload()}))})),J.Z.addEventListener("change",(e=>{this.updateTabStateIdle(e)})),this.updateTabStateIdle(J.Z.isIdle),this.log("Passing environment:",O),this.invoke("environment",O)}pingServiceWorkerWithIframe(){if(this.pingServiceWorkerPromise)return this.pingServiceWorkerPromise;const e=this.pingServiceWorkerPromise=(0,Q.Z)(),t=document.createElement("iframe");t.hidden=!0;const n=()=>{setTimeout((()=>{this.pingServiceWorkerPromise=void 0}),1e4),clearTimeout(s),t.remove(),t.removeEventListener("load",n),t.removeEventListener("error",n),e.resolve()};t.addEventListener("load",n),t.addEventListener("error",n),t.src="ping/"+(4294967295*Math.random()|0),document.body.append(t);const s=window.setTimeout(n,1e3);return e}attachServiceWorker(e){this.lastServiceWorker&&this.serviceMessagePort.detachPort(this.lastServiceWorker),this.serviceMessagePort.attachSendPort(this.lastServiceWorker=e),this.serviceMessagePort.invokeVoid("hello",void 0)}_registerServiceWorker(){navigator.serviceWorker.register(new URL(n.p+n.u(670),n.b),{scope:"./"}).then((e=>{if(this.log("SW registered",e),e.active&&!navigator.serviceWorker.controller)return e.unregister().then((()=>{window.location.reload()}));(e.installing||e.waiting||e.active).addEventListener("statechange",(e=>{this.log("SW statechange",e)}));const t=navigator.serviceWorker.controller||e.installing||e.waiting||e.active;this.attachServiceWorker(t)}),(e=>{this.log.error("SW registration failed!",e),this.invokeVoid("serviceWorkerOnline",!1)}))}registerServiceWorker(){if(!("serviceWorker"in navigator))return;this.serviceMessagePort=new K.Z;const e=navigator.serviceWorker;this._registerServiceWorker(),e.addEventListener("controllerchange",(()=>{this.log.warn("controllerchange");const t=e.controller;this.attachServiceWorker(t),t.addEventListener("error",(e=>{this.log.error("controller error:",e)}))})),this.serviceMessagePort.attachListenPort(e),this.serviceMessagePort.addMultipleEventsListeners({port:(e,t,n)=>{this.invokeVoid("serviceWorkerPort",void 0,void 0,[n.ports[0]])},hello:(e,t)=>{this.serviceMessagePort.resendLockTask(t)},share:e=>{this.log("will try to share something"),this.share=e}}),e.addEventListener("messageerror",(e=>{this.log.error("SW messageerror:",e)}))}registerCryptoWorker(){return ee(this,void 0,void 0,(function*(){const e={construct:(e,t)=>({url:t[0]+location.search})},t=[Worker,"undefined"!=typeof SharedWorker&&SharedWorker].filter(Boolean);t.forEach((t=>window[t.name]=new Proxy(t,e)));const s=new Worker(new URL(n.p+n.u(589),n.b),{type:void 0});t.forEach((e=>window[e.name]=e));const i=s.url,o=e=>new a(e,{type:"module"}),r=e=>this.attachWorkerToPort(e,Y.Z,"crypto"),a=L.Z?SharedWorker:Worker;Y.Z.addEventListener("port",((e,t,n)=>{this.invokeVoid("cryptoPort",void 0,void 0,[n.ports[0]])})),r(o(i));const c=yield(l=i,fetch(l).then((e=>e.text())).then((e=>{const t=location.pathname.split("/");return t[t.length-1]="",e=`\n var originalImportScripts = importScripts; \n importScripts = (url) => {\n console.log('importScripts', url);\n var newUrl = '${location.origin+t.join("/")}' + url.split('/').pop();\n return originalImportScripts(newUrl);\n };\n ${e}`,new Blob([e],{type:"application/javascript"})})));var l;(yield this.invoke("createProxyWorkerURLs",{originalUrl:i,blob:c})).slice(1).map(o).forEach(r)}))}registerWorker(){let e;e=L.Z?new SharedWorker(new URL(n.p+n.u(678),n.b),{type:void 0}):new Worker(new URL(n.p+n.u(678),n.b),{type:void 0}),this.onWorkerFirstMessage(e)}attachWorkerToPort(e,t,n){const s=e.port||e;t.attachPort(s),e.addEventListener("error",(e=>{this.log.error(n,"worker error",e)}))}onWorkerFirstMessage(e){this.log("set webWorker"),this.attachWorkerToPort(e,this,"mtproto")}loadState(){return Promise.all([(null!=z?z:z=$()).then((e=>(this.newVersion=e.newVersion,this.oldVersion=e.oldVersion,this.mirrors.state=e.state,e)))])}sendState(){return this.loadState().then((e=>{const[t]=e;return this.invoke("state",Object.assign(Object.assign({},t),{userId:s.Z.myId.toUserId()})),e}))}invokeCrypto(e,...t){return Y.Z.invokeCrypto(e,...t)}toggleStorages(e,t){return ee(this,void 0,void 0,(function*(){yield(0,X.Z)(e,t),this.invoke("toggleStorages",{enabled:e,clearWrite:t}),this.serviceMessagePort.invokeVoid("toggleStorages",{enabled:e,clearWrite:t})}))}getMirror(e){return ee(this,void 0,void 0,(function*(){return this.mirrors[e]}))}getState(){return this.getMirror("state")}updateTabState(e,t){this.tabState[e]=t,this.invokeVoid("tabState",this.tabState)}updateTabStateIdle(e){this.updateTabState("idleStartTime",e?Date.now():0)}}const ne=new te;o.GO.apiManagerProxy=ne;const se=ne},490:(e,t,n)=>{n.d(t,{Z:()=>f});var s=n(4159),i=n(410),o=n(2219),r=n(2045),a=n(3241),c=n(2586),l=n(5003),d=n(3512),h=n(7487),u=n(3855);const g=r.Z;class m extends a.Z{constructor(){super(!1),this.log=(0,l.kg)("INSTANCE"),this.clearInstance=()=>{this.masterInstance&&!this.deactivated&&(this.log.warn("clear master instance"),h.Z.delete("xt_instance"))},this.checkInstance=(e=c.Z.isIdle)=>{return t=this,n=void 0,o=function*(){if(this.deactivated)return;const t=Date.now(),n={id:this.instanceId,idle:e,time:t},[i,o=s.Z.build]=yield Promise.all([h.Z.get("xt_instance",!1),h.Z.get("k_build",!1)]);if(o>s.Z.build)return this.masterInstance=!1,d.Z.managers.networkerFactory.stopAll(),this.deactivateInstance("version"),void u.Z.toggleStorages(!1,!1);g?h.Z.set({xt_instance:n}):!e||!i||i.id===this.instanceId||i.timethis.deactivateInstance("tabs")),3e4)))},new((i=void 0)||(i=Promise))((function(e,s){function r(e){try{c(o.next(e))}catch(e){s(e)}}function a(e){try{c(o.throw(e))}catch(e){s(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(r,a)}c((o=o.apply(t,n||[])).next())}));var t,n,i,o},this.log=(0,l.kg)("INSTANCE"),this.instanceId=o.Z}get deactivatedReason(){return this.deactivated}start(){if(this.reset(),!this.started){this.started=!0,c.Z.addEventListener("change",this.checkInstance),setInterval(this.checkInstance,5e3),this.checkInstance();try{document.documentElement.addEventListener("beforeunload",this.clearInstance)}catch(e){}}}reset(){this.masterInstance=!1,this.clearDeactivateTimeout(),this.deactivated=void 0}activateInstance(){this.deactivated&&(this.reset(),this.checkInstance(!1),this.dispatchEvent("activated"))}deactivateInstance(e){this.masterInstance||this.deactivated||(this.log.warn("deactivate",e),this.clearDeactivateTimeout(),this.deactivated=e,this.dispatchEvent("deactivated",e))}clearDeactivateTimeout(){this.deactivateTimeout&&(clearTimeout(this.deactivateTimeout),this.deactivateTimeout=0)}}const p=new m;i.GO&&(i.GO.singleInstance=p);const f=p},2831:(e,t,n)=>{n.r(t),n.d(t,{TelegramMeWebManager:()=>c,default:()=>d});var s=n(4159),i=n(410),o=n(1267),r=n(7298),a=n(7487);class c{constructor(){this.disabled=o.Z.test||!s.Z.domains.includes(location.hostname)}setAuthorized(e){if(!this.disabled)return a.Z.get("tgme_sync").then((t=>{const n=(0,r.Z)(!0);if(e&&(null==t?void 0:t.canRedirect)===e&&t.ts+86400>n)return;a.Z.set({tgme_sync:{canRedirect:e,ts:n}});const i=`_websync_?authed=${e?"1":"0"}&version=${encodeURIComponent(s.Z.version+" "+s.Z.suffix)}`,o=["//telegram.me/"+i,"//t.me/"+i].map((e=>function(e){const t=document.createElement("script"),n=new Promise((e=>{t.onload=t.onerror=()=>{e(t)}}));return t.src=e,document.body.appendChild(t),n}(e).then((e=>{e.remove()}))));return Promise.all(o)}))}}const l=new c;i.GO&&(i.GO.telegramMeWebManager=l);const d=l},6702:(e,t,n)=>{n.r(t),n.d(t,{WebPushApiManager:()=>g,default:()=>p});var s=n(410),i=n(5003),o=n(3855),r=n(2325),a=n(4762),c=n(1722),l=n(8479),d=n(490),h=n(3241),u=n(2790);class g extends h.Z{constructor(){super(!1),this.isAvailable=!0,this.isPushEnabled=!1,this.localNotificationsAvailable=!0,this.started=!1,this.settings={},this.isFirefox=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,this.userVisibleOnly=!this.isFirefox,this.log=(0,i.kg)("PM"),this.subscribe=()=>{this.isAvailable&&navigator.serviceWorker.ready.then((e=>{e.pushManager.subscribe({userVisibleOnly:this.userVisibleOnly}).then((e=>{this.isPushEnabled=!0,this.pushSubscriptionNotify("subscribe",e)})).catch((e=>{"denied"===Notification.permission?this.log("Permission for Notifications was denied"):(this.log("Unable to subscribe to push.",e),this.userVisibleOnly||(this.userVisibleOnly=!0,setTimeout(this.subscribe,0)))}))}))},this.isAliveNotify=()=>{if(!this.isAvailable||d.Z.deactivatedReason)return;this.settings.baseUrl=(location.href||"").replace(/#.*$/,"");const e={},t={push_action_mute1d:a.IS_MOBILE?"PushNotification.Action.Mute1d.Mobile":"PushNotification.Action.Mute1d",push_action_settings:a.IS_MOBILE?"PushNotification.Action.Settings.Mobile":"PushNotification.Action.Settings",push_message_nopreview:"PushNotification.Message.NoPreview"};for(const n in t)e[n]=r.ZP.format(t[n],!0);o.Z.serviceMessagePort.invokeVoid("pushPing",{localNotifications:this.localNotificationsAvailable,lang:e,settings:this.settings}),this.isAliveTO=setTimeout(this.isAliveNotify,1e4)},"PushManager"in window&&"Notification"in window&&"serviceWorker"in navigator||(this.log.warn("Push messaging is not supported."),this.isAvailable=!1,this.localNotificationsAvailable=!1),this.isAvailable&&"denied"===Notification.permission&&this.log.warn("The user has blocked notifications.")}start(){this.started||(this.started=!0,this.getSubscription(),this.setUpServiceWorkerChannel())}setLocalNotificationsDisabled(){this.localNotificationsAvailable=!1}getSubscription(){this.isAvailable&&navigator.serviceWorker.ready.then((e=>{e.pushManager.getSubscription().then((e=>{this.isPushEnabled=!!e,this.pushSubscriptionNotify("init",e)})).catch((e=>{this.log.error("Error during getSubscription()",e)}))}))}unsubscribe(){this.isAvailable&&navigator.serviceWorker.ready.then((e=>{e.pushManager.getSubscription().then((e=>{this.isPushEnabled=!1,e&&(this.pushSubscriptionNotify("unsubscribe",e),setTimeout((()=>{e.unsubscribe().then((e=>{this.isPushEnabled=!1})).catch((e=>{this.log.error("Unsubscription error: ",e)}))}),3e3))})).catch((e=>{this.log.error("Error thrown while unsubscribing from push messaging.",e)}))}))}forceUnsubscribe(){this.isAvailable&&navigator.serviceWorker.ready.then((e=>{e.pushManager.getSubscription().then((e=>{this.log.warn("force unsubscribe",e),e&&e.unsubscribe().then((e=>{this.log.warn("force unsubscribe successful",e),this.isPushEnabled=!1})).catch((e=>{this.log.error("Unsubscription error: ",e)}))})).catch((e=>{this.log.error("Error thrown while unsubscribing from push messaging.",e)}))}))}setSettings(e){this.settings=(0,l.Z)(e),clearTimeout(this.isAliveTO),this.isAliveNotify()}hidePushNotifications(){this.isAvailable&&o.Z.serviceMessagePort.invokeVoid("notificationsClear",void 0)}setUpServiceWorkerChannel(){this.isAvailable&&(o.Z.serviceMessagePort.addEventListener("pushClick",(e=>{d.Z.deactivatedReason?c.Z.reload():this.dispatchEvent("push_notification_click",e)})),navigator.serviceWorker.ready.then(this.isAliveNotify))}pushSubscriptionNotify(e,t){if(t){const n=t.toJSON();if(!(n&&n.endpoint&&n.keys&&n.keys.p256dh&&n.keys.auth))return this.log.warn("Invalid push subscription",n),this.unsubscribe(),this.isAvailable=!1,void this.pushSubscriptionNotify(e);this.log.warn("Push",e,n),this.dispatchEvent("push_"+e,{tokenType:10,tokenValue:JSON.stringify(n)})}else this.log.warn("Push",e,!1),this.dispatchEvent("push_"+e,!1)}ignorePushByMid(e,t){this.isAvailable&&o.Z.serviceMessagePort.invokeVoid("shownNotification",e+"_"+(0,u.Z)(t))}}const m=new g;s.GO&&(s.GO.webPushApiManager=m);const p=m},9043:(e,t,n)=>{n.d(t,{Z:()=>d});var s=n(410),i=n(5783),o=n(4762),r=n(5003),a=n(3855),c=function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function r(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}c((s=s.apply(e,t||[])).next())}))};const l=new class{constructor(){this.sampleRate=48e3,this.tasks=[],this.keepAlive=!1,this.log=(0,r.kg)("OPUS",r.v9.Error)}isPlaySupported(){return i.Z}loadWavWorker(){this.wavWorker||(this.wavWorker=new Worker("waveWorker.min.js"),this.wavWorker.addEventListener("message",(e=>{const t=e.data;if(this.log("[WAV] got message:",t),t&&t.page){const e=t.page;this.onTaskEnd(this.tasks.shift(),e)}})))}loadWorker(){this.worker||(this.worker=new Worker("decoderWorker.min.js"),this.worker.addEventListener("message",(e=>{const t=e.data;this.log("[DECODER] got message",t),"done"===t.type?(this.wavWorker.postMessage({command:"done"}),t.waveform&&(this.tasks[0].waveform=t.waveform)):this.wavWorker.postMessage({command:"encode",buffers:e.data},o.IS_SAFARI?void 0:t.map((e=>e.buffer)))})))}setKeepAlive(e){this.keepAlive=e,this.keepAlive?(this.loadWorker(),this.loadWavWorker()):this.tasks.length||this.terminateWorkers()}onTaskEnd(e,t){t?(clearTimeout(e.timeout),e.callback.resolve({bytes:t,waveform:e.waveform})):e.callback.reject("timeout"),this.tasks.length&&this.executeNewTask(this.tasks[0]),this.terminateWorkers()}terminateWorkers(e=!1){(!this.keepAlive&&!this.tasks.length||e)&&(this.worker&&(this.worker.terminate(),this.worker=null),this.wavWorker&&(this.wavWorker.terminate(),this.wavWorker=null))}executeNewTask(e){this.worker.postMessage({command:"init",decoderSampleRate:this.sampleRate,outputBufferSampleRate:this.sampleRate}),this.wavWorker.postMessage({command:"init",wavBitDepth:16,wavSampleRate:this.sampleRate}),this.log("[DECODER] send decode"),this.worker.postMessage({command:"decode",pages:e.pages,waveform:e.withWaveform},o.IS_SAFARI?void 0:[e.pages.buffer]),e.timeout=window.setTimeout((()=>{this.log.error("decode timeout"),this.terminateWorkers(!0),this.tasks.length&&(this.loadWorker(),this.loadWavWorker()),this.onTaskEnd(this.tasks.shift())}),1e4)}pushDecodeTask(e,t){return new Promise(((n,s)=>{const i={pages:e,withWaveform:t,callback:{resolve:n,reject:s},timeout:0};this.loadWorker(),this.loadWavWorker(),1===this.tasks.push(i)&&this.executeNewTask(i)}))}decode(e,t=!1){return c(this,void 0,void 0,(function*(){return this.pushDecodeTask(e,t).then((e=>c(this,void 0,void 0,(function*(){const t=new Blob([e.bytes],{type:"audio/wav"});return{url:yield a.Z.invoke("createObjectURL",t),waveform:e.waveform}}))))}))}};s.GO.opusDecodeController=l;const d=l},2423:(e,t,n)=>{n.d(t,{$2:()=>u,E:()=>g,Hk:()=>p,QB:()=>m,SC:()=>f,bu:()=>l,c$:()=>v,it:()=>c,kO:()=>y,tY:()=>b});var s=n(1229);const i="a-z\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u00ff\\u0100-\\u024f\\u0253\\u0254\\u0256\\u0257\\u0259\\u025b\\u0263\\u0268\\u026f\\u0272\\u0289\\u028b\\u02bb\\u0300-\\u036f\\u1e00-\\u1eff\\u0400-\\u04ff\\u0500-\\u0527\\u2de0-\\u2dff\\ua640-\\ua69f\\u0591-\\u05bf\\u05c1-\\u05c2\\u05c4-\\u05c5\\u05c7\\u05d0-\\u05ea\\u05f0-\\u05f4\\ufb1d-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40-\\ufb41\\ufb43-\\ufb44\\ufb46-\\ufb4f\\u0610-\\u061a\\u0620-\\u065f\\u066e-\\u06d3\\u06d5-\\u06dc\\u06de-\\u06e8\\u06ea-\\u06ef\\u06fa-\\u06fc\\u06ff\\u0750-\\u077f\\u08a0\\u08a2-\\u08ac\\u08e4-\\u08fe\\ufb50-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\u200c\\u0e01-\\u0e3a\\u0e40-\\u0e4e\\u1100-\\u11ff\\u3130-\\u3185\\uA960-\\uA97F\\uAC00-\\uD7AF\\uD7B0-\\uD7FF\\u3003\\u3005\\u303b\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uff9f\\uffa1-\\uffdc",o="0-9_"+i,r="["+i+"0-9]",a="((?:https?|ftp)://|mailto:)?",c=a+"(?:"+r+"{1,64}(?::"+r+"{0,64})?@)?(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}|"+r+"["+i+"·0-9-]{0,64}(?:\\."+r+"["+i+"·0-9-]{0,64}){0,10}(?:\\.(xn--[0-9a-z]{2,16}|["+i+"]{2,24})))(?::\\d{2,5})?(?:/(?:\\S{0,255}[^\\s.;,(\\[\\]{}<>\"'])?)?",l=(new RegExp("^"+a.slice(0,-1),"i"),/^((?:[^\/]+?):\/\/|mailto:)/),d="[a-zA-Z\\d_]{5,32}",h="\\/([a-zA-Z\\d_]{1,32})(?:@("+d+"))?(\\b|$)",u=new RegExp("(^| )(@)("+d+")|("+c+")|(\\n)|("+s.Z+")|(^|[\\s\\(\\]])(#["+o+"]{2,64})|(^|\\s)"+h+"|(?:\\s|^)((?:\\d{1,2}:)?(?:[0-5]?[0-9]):(?:[0-5][0-9]))(?:\\s|$)","i"),g=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,m=/(^|\s|\n)(````?)([\s\S]+?)(````?)([\s\n\.,:?!;]|$)|(^|\s|\x01)(`|~~|\*\*|__|_-_|\|\|)([^\n]+?)\7([\x01\s\.,:?!;]|$)|@(\d+)\s*\((.+?)\)|(\[(.+?)\]\((.+?)\))/m,p={Telegram:"tg://search_hashtag?hashtag={1}",Twitter:"https://twitter.com/hashtag/{1}",Instagram:"https://instagram.com/explore/tags/{1}/","Google Plus":"https://plus.google.com/explore/{1}"},f={"`":"messageEntityCode","``":"messageEntityPre","**":"messageEntityBold",__:"messageEntityItalic","~~":"messageEntityStrike","_-_":"messageEntityUnderline","||":"messageEntitySpoiler"},v=new Set(Object.values(f)),b=new Set(["messageEntityEmoji","messageEntityLinebreak","messageEntityCaret"]);for(const e in f)b.add(f[e]);const y=/^\+\d+$/},3591:(e,t,n)=>{n.d(t,{Z:()=>a});var s=n(2423),i=n(410),o=n(6637),r=n(1507);function a(e,t){(0,o.Z)(e)||(e="https://"+e);const n={url:e};let i,a,c,l;if(i=e.match(/^(?:https?:\/\/)?(?:(.+?)\.)?(?:(?:web|k|z)\.)?t(?:elegram)?\.me(?:\/(.+))?/)){const t=new URL(e);let n=i[1];n&&r.BX.has(i[1])&&(n=void 0),n&&(t.pathname=n+("/"===t.pathname?"":t.pathname));const o=t.pathname.slice(1),a=o.split("/");if(a[0]&&"$"===a[0][0]&&a[0].length>1)l="invoice";else if(/^\W/.test(o)&&!s.kO.test(o))l="joinchat";else switch(a[0]){case"joinchat":case"addstickers":case"addemoji":case"voicechat":case"invoice":if(1!==a.length&&!n){l=a[0];break}default:if(a[1]&&a[1].match(/^\d+(?:\?(?:comment|thread)=\d+)?$/)||1===a.length){l="im";break}}}else(a=e.match(/^(?:https?:\/\/)?telesco\.pe\/([^/?]+)\/(\d+)/))?l="im":(c=e.match(/tg:(?:\/\/)?(.+?)(?:\?|$)/))&&(l="tg_"+c[1]);return window[l]||(l=void 0),n.onclick=l,n}i.GO&&(i.GO.wrapUrl=a)},3512:(e,t,n)=>{n.d(t,{Z:()=>d});var s=n(1507),i=n(3241),o=n(410),r=n(3206),a=n(1352);class c extends i.Z{constructor(){super(),this.myId=s.NM,this.connectionStatus={},this.premium=!1,this.addEventListener("user_auth",(({id:e})=>{this.myId=e.toPeerId()})),this.addEventListener("premium_toggle_private",(({isNew:e,isPremium:t})=>{this.premium=t,this.dispatchEventSingle("premium_toggle",t)})),this.addEventListener("connection_status_change",(e=>{this.connectionStatus[e.name]=e})),this.dispatchEvent=(e,...t)=>{super.dispatchEvent(e,...t),r.Z.getInstance().invokeVoid("event",{name:e,args:t})},a.kC||this.addEventListener("settings_updated",(({settings:e})=>{this.settings=e}))}getConnectionStatus(){return this.connectionStatus}getPremium(){return this.premium}dispatchEventSingle(...e){super.dispatchEvent(...e)}}const l=new c;o.GO.rootScope=l;const d=l},7730:(e,t,n)=>{n.d(t,{Z:()=>r});var s=n(410),i=n(3725);const o=new class{constructor(){this.convertPromises={}}init(){this.worker=new Worker(new URL(n.p+n.u(61),n.b)),this.worker.addEventListener("message",(e=>{const t=e.data.payload,n=this.convertPromises[t.fileName];n&&(t.bytes?n.resolve(t.bytes):n.reject(),delete this.convertPromises[t.fileName])}))}postMessage(e){this.init&&(this.init(),this.init=null),this.worker.postMessage(e)}convert(e,t){if(this.convertPromises.hasOwnProperty(e))return this.convertPromises[e];const n=(0,i.Z)();return this.postMessage({type:"convertWebp",payload:{fileName:e,bytes:t}}),this.convertPromises[e]=n}};s.GO.webpWorkerController=o;const r=o}},r={};function a(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={exports:{}};return o[e].call(n.exports,n,n.exports,a),n.exports}a.m=o,e=[],a.O=(t,n,s,i)=>{if(!n){var o=1/0;for(d=0;d=i)&&Object.keys(a.O).every((e=>a.O[e](n[c])))?n.splice(c--,1):(r=!1,i0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[n,s,i]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(e,s){if(1&s&&(e=this(e)),8&s)return e;if("object"==typeof e&&e){if(4&s&&e.__esModule)return e;if(16&s&&"function"==typeof e.then)return e}var i=Object.create(null);a.r(i);var o={};t=t||[null,n({}),n([]),n(n)];for(var r=2&s&&e;"object"==typeof r&&!~t.indexOf(r);r=n(r))Object.getOwnPropertyNames(r).forEach((t=>o[t]=()=>e[t]));return o.default=()=>e,a.d(i,o),i},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,n)=>(a.f[n](e,t),t)),[])),a.u=e=>(({589:"crypto.worker",630:"npm.qr-code-styling",670:"sw",678:"mtproto.worker"}[e]||e)+"."+{8:"93d2f33af815eb0455aa",53:"40d79ab9d14e8d83cf01",61:"8c05eb6b6906de5287fa",63:"7ac6657334217aaadb5b",77:"b8cf11d2b5dca36479ca",104:"be090b1ee184fa23f913",147:"52e5e3f41bb7eb15ae10",231:"f4d1bfe6ff7f14577f96",297:"30de9795e39435a29676",301:"95838a8203f23dd1ce8f",339:"12bdbede82465e666965",392:"6ce981ebdcbba9b6fd04",436:"9e54c5e9f3feccf9d736",437:"37bcbe9db9cbb8d8a753",442:"54c010363ba1cdea7bce",508:"dfcdc07d46a7ba4348a1",589:"c036d5d715f9894c08a3",630:"f8f57a1c721e03c3f699",641:"527b52a7a5052f57e455",642:"be93122d1116ecdc9322",670:"ee91e25d52a3425cb42c",678:"c9d58d1702ff11ef9b30",709:"c5451446b3485d2557e8",776:"444edaecf4b03894ef8e",781:"c527d73f348ae695f21a",783:"949e247466ad3ebe82d6",810:"aad7a584f7c8c739c66e",813:"315ffd640c7d6013a536"}[e]+".chunk.js"),a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s={},i="tweb:",a.l=(e,t,n,o)=>{if(s[e])s[e].push(t);else{var r,c;if(void 0!==n)for(var l=document.getElementsByTagName("script"),d=0;d{r.onerror=r.onload=null,clearTimeout(g);var i=s[e];if(delete s[e],r.parentNode&&r.parentNode.removeChild(r),i&&i.forEach((e=>e(n))),t)return t(n)},g=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),c&&document.head.appendChild(r)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{if(void 0!==a){var e=a.u,t=a.e,n={},s={};a.u=function(t){return e(t)+(n.hasOwnProperty(t)?"?"+n[t]:"")},a.e=function(i){return t(i).catch((function(t){var o=s.hasOwnProperty(i)?s[i]:999999;if(o<1){var r=e(i);throw t.message="Loading chunk "+i+" failed after 999999 retries.\n("+r+")",t.request=r,t}return new Promise((function(e){setTimeout((function(){var t=Date.now();n[i]=t,s[i]=o-1,e(a.e(i))}),3e3)}))}))}}})(),(()=>{a.b=document.baseURI||self.location.href;var e={179:0};a.f.j=(t,n)=>{var s=a.o(e,t)?e[t]:void 0;if(0!==s)if(s)n.push(s[2]);else{var i=new Promise(((n,i)=>s=e[t]=[n,i]));n.push(s[2]=i);var o=a.p+a.u(t),r=new Error;a.l(o,(n=>{if(a.o(e,t)&&(0!==(s=e[t])&&(e[t]=void 0),s)){var i=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;r.message="Loading chunk "+t+" failed.\n("+i+": "+o+")",r.name="ChunkLoadError",r.type=i,r.request=o,s[1](r)}}),"chunk-"+t,t)}},a.O.j=t=>0===e[t];var t=(t,n)=>{var s,i,[o,r,c]=n,l=0;if(o.some((t=>0!==e[t]))){for(s in r)a.o(r,s)&&(a.m[s]=r[s]);if(c)var d=c(a)}for(t&&t(n);la(2938)));c=a.O(c)})(); +//# sourceMappingURL=main.b611b259692b9fd072db.bundle.js.map \ No newline at end of file diff --git a/public/main.b611b259692b9fd072db.bundle.js.map b/public/main.b611b259692b9fd072db.bundle.js.map new file mode 100644 index 00000000..653c3712 --- /dev/null +++ b/public/main.b611b259692b9fd072db.bundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main.b611b259692b9fd072db.bundle.js","mappings":"uBAAIA,ECCAC,EADAC,ECAAC,EACAC,E,mECOG,MAAMC,GAA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C3B,GAAGg1B,EAAS0D,MAAM1jC,GAAgC,IAAxBmjC,EAAgBnjC,KAAa,CACtD,IAAIw/B,KAAYgE,EACZjE,EAAoBpvB,EAAEqzB,EAAahE,KACrCD,EAAoBO,EAAEN,GAAYgE,EAAYhE,IAGhD,GAAGiE,EAAS,IAAIjhB,EAASihB,EAAQlE,EAClC,CAEA,IADGgE,GAA4BA,EAA2BrlB,GACrDlT,EAAIg1B,EAASl1B,OAAQE,IACzBk2B,EAAUlB,EAASh1B,GAChBu0B,EAAoBpvB,EAAEgzB,EAAiBjC,IAAYiC,EAAgBjC,IACrEiC,EAAgBjC,GAAS,KAE1BiC,EAAgBjC,GAAW,EAE5B,OAAO3B,EAAoBQ,EAAEvd,EAAO,EAGjCmhB,EAAqB5vB,KAAuB,iBAAIA,KAAuB,kBAAK,GAChF4vB,EAAmB1uB,QAAQquB,EAAqBlB,KAAK,KAAM,IAC3DuB,EAAmB14B,KAAOq4B,EAAqBlB,KAAK,KAAMuB,EAAmB14B,KAAKm3B,KAAKuB,G,KClFvF,IAAIC,EAAsBrE,EAAoBQ,OAAEr/B,EAAW,CAAC,GAAG,MAAM,IAAO6+B,EAAoB,QAChGqE,EAAsBrE,EAAoBQ,EAAE6D,E","sources":["webpack://tweb/webpack/runtime/chunk loaded","webpack://tweb/webpack/runtime/create fake namespace object","webpack://tweb/webpack/runtime/load script","webpack://tweb/./src/config/debug.ts","webpack://tweb/./src/config/state.ts","webpack://tweb/./src/helpers/getTimeFormat.ts","webpack://tweb/./src/environment/appleMx.ts","webpack://tweb/./src/environment/callSupport.ts","webpack://tweb/./src/environment/canUseTransferables.ts","webpack://tweb/./src/environment/canvasFilterSupport.ts","webpack://tweb/./src/environment/emojiSupport.ts","webpack://tweb/./src/environment/geolocationSupport.ts","webpack://tweb/./src/environment/groupCallSupport.ts","webpack://tweb/./src/environment/imageMimeTypesSupport.ts","webpack://tweb/./src/environment/mediaMimeTypesSupport.ts","webpack://tweb/./src/environment/movSupport.ts","webpack://tweb/./src/environment/opusSupport.ts","webpack://tweb/./src/environment/parallaxSupport.ts","webpack://tweb/./src/environment/screenSharingSupport.ts","webpack://tweb/./src/environment/sharedWorkerSupport.ts","webpack://tweb/./src/environment/touchSupport.ts","webpack://tweb/./src/environment/userAgent.ts","webpack://tweb/./src/environment/vibrateSupport.ts","webpack://tweb/./src/environment/videoMimeTypesSupport.ts","webpack://tweb/./src/environment/webmSupport.ts","webpack://tweb/./src/environment/webpSupport.ts","webpack://tweb/./src/environment/webrtcSupport.ts","webpack://tweb/./src/helpers/color.ts","webpack://tweb/./src/helpers/compareVersion.ts","webpack://tweb/./src/helpers/dom/blurActiveElement.ts","webpack://tweb/./src/helpers/dom/cancelEvent.ts","webpack://tweb/./src/helpers/dom/findUpClassName.ts","webpack://tweb/./src/helpers/dom/fixSafariStickyInput.ts","webpack://tweb/./src/helpers/dom/fixSafariStickyInputFocusing.ts","webpack://tweb/./src/helpers/dom/installPrompt.ts","webpack://tweb/./src/helpers/dom/loadFonts.ts","webpack://tweb/./src/helpers/dom/setInnerHTML.ts","webpack://tweb/./src/helpers/idleController.ts","webpack://tweb/./src/helpers/number/clamp.ts","webpack://tweb/./src/helpers/overlayCounter.ts","webpack://tweb/./src/helpers/schedulers.ts","webpack://tweb/./src/helpers/string/parseUriParams.ts","webpack://tweb/./src/helpers/themeController.ts","webpack://tweb/./src/helpers/setWorkerProxy.ts","webpack://tweb/./src/environment/installPrompt.ts","webpack://tweb/./src/index.ts","webpack://tweb/./src/helpers/dom/toggleAttributePolyfill.ts","webpack://tweb/./src/lib/appManagers/appRuntimeManager.ts","webpack://tweb/./src/lib/appManagers/getProxiedManagers.ts","webpack://tweb/./src/lib/files/idb.ts","webpack://tweb/./src/lib/langPack.ts","webpack://tweb/./src/lib/mtproto/mtproto_config.ts","webpack://tweb/./src/environment/index.ts","webpack://tweb/./src/lib/appManagers/utils/state/loadState.ts","webpack://tweb/./src/lib/mtproto/mtprotoworker.ts","webpack://tweb/./src/lib/mtproto/singleInstance.ts","webpack://tweb/./src/lib/mtproto/telegramMeWebManager.ts","webpack://tweb/./src/helpers/dom/loadScript.ts","webpack://tweb/./src/lib/mtproto/webPushApiManager.ts","webpack://tweb/./src/lib/opusDecodeController.ts","webpack://tweb/./src/lib/richTextProcessor/index.ts","webpack://tweb/./src/lib/richTextProcessor/wrapUrl.ts","webpack://tweb/./src/lib/rootScope.ts","webpack://tweb/./src/lib/webp/webpWorkerController.ts","webpack://tweb/webpack/bootstrap","webpack://tweb/webpack/runtime/compat get default export","webpack://tweb/webpack/runtime/define property getters","webpack://tweb/webpack/runtime/ensure chunk","webpack://tweb/webpack/runtime/get javascript chunk filename","webpack://tweb/webpack/runtime/get mini-css chunk filename","webpack://tweb/webpack/runtime/global","webpack://tweb/webpack/runtime/hasOwnProperty shorthand","webpack://tweb/webpack/runtime/make namespace object","webpack://tweb/webpack/runtime/publicPath","webpack://tweb/webpack/runtime/compat","webpack://tweb/webpack/runtime/jsonp chunk loading","webpack://tweb/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"tweb:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t};\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Modes from './modes';\n\nexport const IS_BETA = process.env.NODE_ENV !== 'production';\nexport const DEBUG = (IS_BETA || Modes.debug)/* && false */;\nconst ctx: any = typeof(window) !== 'undefined' ? window : self;\nexport const MOUNT_CLASS_TO: any = DEBUG || true/* && false */ ? ctx : {};\nexport default DEBUG;\n\n// let m = DEBUG;\n/* if(!DEBUG) {\n ctx.sandpitTurtle = () => {\n //if(!m) {\n for(let i in MOUNT_CLASS_TO) {\n ctx[i] = MOUNT_CLASS_TO[i];\n }\n //m = true;\n //}\n\n //DEBUG = !DEBUG;\n };\n} */\n\n/* export const superDebug = (object: any, key: string) => {\n var d = object[key];\n var beforeStr = '', afterStr = '';\n for(var r of d) {\n beforeStr += r.before.hex + '\\n';\n afterStr += r.after.hex + '\\n';\n }\n\n beforeStr = beforeStr.trim();\n afterStr = afterStr.trim();\n //var beforeStr = d.map((r) => r.before.hex).join('\\n');\n //var afterStr = d.map((r) => r.after.hex).join('\\n');\n\n var dada = (name: string, str: string) => {\n var a = document.createElement('a');\n a.target = '_blank';\n a.download = name + '.txt';\n a.href = URL.createObjectURL(new Blob([str], {\n type: 'text/plain'\n }));\n document.body.append(a);\n a.click();\n };\n\n dada(key + '_' + 'before', beforeStr);\n dada(key + '_' + 'after', afterStr);\n}\n\nMOUNT_CLASS_TO.superDebug = superDebug; */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {LiteModeKey} from '../helpers/liteMode';\nimport type {AppMediaPlaybackController} from '../components/appMediaPlaybackController';\nimport type {TopPeerType, MyTopPeer} from '../lib/appManagers/appUsersManager';\nimport type {AutoDownloadSettings, BaseTheme, NotifyPeer, PeerNotifySettings, Theme, ThemeSettings, WallPaper} from '../layer';\nimport type DialogsStorage from '../lib/storages/dialogs';\nimport type FiltersStorage from '../lib/storages/filters';\nimport type {AuthState, Modify} from '../types';\nimport {IS_MOBILE} from '../environment/userAgent';\nimport getTimeFormat from '../helpers/getTimeFormat';\nimport {nextRandomUint} from '../helpers/random';\nimport App from './app';\n\nconst STATE_VERSION = App.version;\nconst BUILD = App.build;\n\n// ! DEPRECATED\nexport type Background = {\n type?: 'color' | 'image' | 'default', // ! DEPRECATED\n blur: boolean,\n highlightningColor?: string,\n color?: string,\n slug?: string, // image slug\n intensity?: number, // pattern intensity\n id: string | number, // wallpaper id\n};\n\nexport type AppTheme = Modify\n}>;\n\nexport type AutoDownloadPeerTypeSettings = {\n contacts: boolean,\n private: boolean,\n groups: boolean,\n channels: boolean\n};\n\nexport type State = {\n allDialogsLoaded: DialogsStorage['allDialogsLoaded'],\n pinnedOrders: DialogsStorage['pinnedOrders'],\n // contactsList: UserId[],\n contactsListCachedTime: number,\n updates: Partial<{\n seq: number,\n pts: number,\n date: number\n }>,\n // filters?: FiltersStorage['filters'], // ! DEPRECATED\n filtersArr?: FiltersStorage['filtersArr'],\n maxSeenMsgId: number,\n stateCreatedTime: number,\n recentEmoji: string[],\n recentCustomEmoji: DocId[],\n topPeersCache: {\n [type in TopPeerType]?: {\n peers: MyTopPeer[],\n cachedTime: number\n }\n },\n recentSearch: PeerId[],\n version: typeof STATE_VERSION,\n build: typeof BUILD,\n authState: AuthState,\n hiddenPinnedMessages: {[peerId: PeerId]: number},\n settings: {\n messagesTextSize: number,\n distanceUnit: 'kilometers' | 'miles',\n sendShortcut: 'enter' | 'ctrlEnter',\n animationsEnabled?: boolean, // ! DEPRECATED\n autoDownload: {\n contacts?: boolean, // ! DEPRECATED\n private?: boolean, // ! DEPRECATED\n groups?: boolean, // ! DEPRECATED\n channels?: boolean, // ! DEPRECATED\n photo: AutoDownloadPeerTypeSettings,\n video: AutoDownloadPeerTypeSettings,\n file: AutoDownloadPeerTypeSettings\n },\n autoDownloadNew: AutoDownloadSettings,\n autoPlay?: { // ! DEPRECATED\n gifs: boolean,\n videos: boolean\n },\n stickers: {\n suggest: 'all' | 'installed' | 'none',\n dynamicPackOrder: boolean,\n loop: boolean\n },\n emoji: {\n suggest: boolean,\n big: boolean\n },\n background?: Background, // ! DEPRECATED\n themes: AppTheme[],\n theme: AppTheme['name'],\n notifications: {\n sound: boolean\n },\n nightTheme?: boolean, // ! DEPRECATED\n timeFormat: 'h12' | 'h23',\n liteMode: {[key in LiteModeKey]: boolean}\n },\n playbackParams: ReturnType,\n keepSigned: boolean,\n chatContextMenuHintWasShown: boolean,\n stateId: number,\n notifySettings: {[k in Exclude]?: PeerNotifySettings.peerNotifySettings}\n};\n\n// const BACKGROUND_DAY_MOBILE: Background = {\n// blur: false,\n// slug: '',\n// color: '#dbddbb,#6ba587,#d5d88d,#88b884',\n// highlightningColor: 'hsla(86.4, 43.846153%, 45.117647%, .4)',\n// intensity: 0,\n// id: '1'\n// };\n\n// const BACKGROUND_NIGHT_MOBILE: Background = {\n// blur: false,\n// slug: '',\n// color: '#0f0f0f',\n// highlightningColor: 'hsla(0, 0%, 3.82353%, 0.4)',\n// intensity: 0,\n// id: '-1'\n// };\n\nexport const DEFAULT_THEME: Theme = {\n _: 'theme',\n access_hash: '',\n id: '',\n settings: [{\n _: 'themeSettings',\n pFlags: {},\n base_theme: {_: 'baseThemeClassic'},\n accent_color: 0x3390ec,\n message_colors: [0x4fae4e],\n wallpaper: {\n _: 'wallPaper',\n pFlags: {\n default: true,\n pattern: true\n },\n access_hash: '',\n document: undefined,\n id: '',\n slug: 'pattern',\n settings: {\n _: 'wallPaperSettings',\n pFlags: {},\n intensity: 50,\n background_color: 0xdbddbb,\n second_background_color: 0x6ba587,\n third_background_color: 0xd5d88d,\n fourth_background_color: 0x88b884\n }\n }\n }, {\n _: 'themeSettings',\n pFlags: {},\n base_theme: {_: 'baseThemeNight'},\n accent_color: 0x8774E1,\n message_colors: [0x8774E1],\n wallpaper: {\n _: 'wallPaper',\n pFlags: {\n default: true,\n pattern: true,\n dark: true\n },\n access_hash: '',\n document: undefined,\n id: '',\n slug: 'pattern',\n settings: {\n _: 'wallPaperSettings',\n pFlags: {},\n intensity: -50,\n background_color: 0xfec496,\n second_background_color: 0xdd6cb9,\n third_background_color: 0x962fbf,\n fourth_background_color: 0x4f5bd5\n }\n }\n }],\n slug: '',\n title: '',\n emoticon: '🏠',\n pFlags: {default: true}\n};\n\nconst makeDefaultAppTheme = (\n name: AppTheme['name'],\n baseTheme: BaseTheme['_'],\n highlightningColor: string\n): AppTheme => {\n return {\n ...DEFAULT_THEME,\n name,\n settings: {\n ...DEFAULT_THEME.settings.find((s) => s.base_theme._ === baseTheme),\n highlightningColor\n }\n };\n};\n\nexport const STATE_INIT: State = {\n allDialogsLoaded: {},\n pinnedOrders: {},\n // contactsList: [],\n contactsListCachedTime: 0,\n updates: {},\n filtersArr: [],\n maxSeenMsgId: 0,\n stateCreatedTime: Date.now(),\n recentEmoji: [],\n recentCustomEmoji: [],\n topPeersCache: {},\n recentSearch: [],\n version: STATE_VERSION,\n build: BUILD,\n authState: {\n _: IS_MOBILE ? 'authStateSignIn' : 'authStateSignQr'\n },\n hiddenPinnedMessages: {},\n settings: {\n messagesTextSize: 16,\n distanceUnit: 'kilometers',\n sendShortcut: 'enter',\n autoDownload: {\n photo: {\n contacts: true,\n private: true,\n groups: true,\n channels: true\n },\n video: {\n contacts: true,\n private: true,\n groups: true,\n channels: true\n },\n file: {\n contacts: true,\n private: true,\n groups: true,\n channels: true\n }\n },\n autoDownloadNew: {\n _: 'autoDownloadSettings',\n file_size_max: 3145728,\n pFlags: {\n video_preload_large: true,\n audio_preload_next: true\n },\n photo_size_max: 1048576,\n video_size_max: 15728640,\n video_upload_maxbitrate: 100\n },\n stickers: {\n suggest: 'all',\n dynamicPackOrder: true,\n loop: true\n },\n emoji: {\n suggest: true,\n big: true\n },\n themes: [\n makeDefaultAppTheme('day', 'baseThemeClassic', 'hsla(86.4, 43.846153%, 45.117647%, .4)'),\n makeDefaultAppTheme('night', 'baseThemeNight', 'hsla(299.142857, 44.166666%, 37.470588%, .4)')\n ],\n theme: 'system',\n notifications: {\n sound: false\n },\n timeFormat: getTimeFormat(),\n liteMode: {\n all: false,\n animations: false,\n chat: false,\n chat_background: false,\n chat_spoilers: false,\n effects: false,\n effects_premiumstickers: false,\n effects_reactions: false,\n effects_emoji: false,\n emoji: false,\n emoji_messages: false,\n emoji_panel: false,\n gif: false,\n stickers: false,\n stickers_chat: false,\n stickers_panel: false,\n video: false\n }\n },\n playbackParams: {\n volume: 1,\n muted: false,\n playbackRate: 1,\n playbackRates: {\n voice: 1,\n video: 1,\n audio: 1\n },\n loop: false,\n round: false\n },\n keepSigned: true,\n chatContextMenuHintWasShown: false,\n stateId: nextRandomUint(32),\n notifySettings: {}\n};\n","export default function getTimeFormat(): 'h12' | 'h23' {\n // try {\n // const resolvedOptions = Intl.DateTimeFormat(navigator.language, {hour: 'numeric'}).resolvedOptions();\n // if('hourCycle' in resolvedOptions) {\n // return (resolvedOptions as any).hourCycle === 'h12' ? 'h12' : 'h23';\n // } else {\n // return resolvedOptions.hour12 ? 'h12' : 'h23';\n // }\n // } catch(err) {\n return new Date().toLocaleString().match(/\\s(AM|PM)/) ? 'h12' : 'h23';\n // }\n}\n","let IS_APPLE_MX = false;\n\ntry {\n // Awesome detect from https://stackoverflow.com/a/65412357\n const ctx = document.createElement('canvas').getContext('webgl');\n const extension = ctx.getExtension('WEBGL_debug_renderer_info');\n const renderer: string = extension && ctx.getParameter(extension.UNMASKED_RENDERER_WEBGL) || '';\n if((renderer.match(/Apple/) && !renderer.match(/Apple GPU/)) ||\n ctx.getSupportedExtensions().indexOf('WEBGL_compressed_texture_s3tc_srgb') === -1) {\n IS_APPLE_MX = true;\n }\n} catch(err) {\n\n}\n\nexport default IS_APPLE_MX;\n","import IS_WEBRTC_SUPPORTED from './webrtcSupport';\n\nconst IS_CALL_SUPPORTED = IS_WEBRTC_SUPPORTED;\n\nexport default IS_CALL_SUPPORTED;\n","import {IS_SAFARI} from './userAgent';\n\n/*\n * This is used as a workaround for a memory leak in Safari caused by using Transferable objects to\n * transfer data between WebWorkers and the main thread.\n * https://github.com/mapbox/mapbox-gl-js/issues/8771\n *\n * This should be removed once the underlying Safari issue is fixed.\n */\n\nlet CAN_USE_TRANSFERABLES: boolean;\nif(!IS_SAFARI) CAN_USE_TRANSFERABLES = true;\nelse {\n try {\n const match = navigator.userAgent.match(/Version\\/(.+?) /);\n CAN_USE_TRANSFERABLES = +match[1] >= 14;\n } catch(err) {\n CAN_USE_TRANSFERABLES = false;\n }\n}\n\nexport default CAN_USE_TRANSFERABLES;\n","const IS_CANVAS_FILTER_SUPPORTED = 'filter' in (document.createElement('canvas').getContext('2d') || {});\n\nexport default IS_CANVAS_FILTER_SUPPORTED;\n","const IS_EMOJI_SUPPORTED = navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i) !== -1/* && false *//* || true */;\n\nexport default IS_EMOJI_SUPPORTED;\n","const IS_GEOLOCATION_SUPPORTED = !!navigator?.geolocation?.getCurrentPosition && false;\n\nexport default IS_GEOLOCATION_SUPPORTED;\n","import IS_WEBRTC_SUPPORTED from './webrtcSupport';\n\nconst IS_GROUP_CALL_SUPPORTED = IS_WEBRTC_SUPPORTED;\n\nexport default IS_GROUP_CALL_SUPPORTED;\n","import IS_WEBP_SUPPORTED from './webpSupport';\n\nconst IMAGE_MIME_TYPES_SUPPORTED = new Set([\n 'image/jpeg',\n 'image/png',\n 'image/bmp'\n]);\n\nif(IS_WEBP_SUPPORTED) {\n IMAGE_MIME_TYPES_SUPPORTED.add('image/webp');\n}\n\nexport default IMAGE_MIME_TYPES_SUPPORTED;\n","import IMAGE_MIME_TYPES_SUPPORTED from './imageMimeTypesSupport';\nimport VIDEO_MIME_TYPES_SUPPORTED from './videoMimeTypesSupport';\n\nconst arr = [...IMAGE_MIME_TYPES_SUPPORTED].concat([...VIDEO_MIME_TYPES_SUPPORTED]);\n\nconst MEDIA_MIME_TYPES_SUPPORTED = new Set(arr);\n\nexport default MEDIA_MIME_TYPES_SUPPORTED;\n","import {IS_APPLE_MOBILE, IS_SAFARI} from './userAgent';\n\n// mov is not supported in Chrome on macOS\nconst IS_MOV_SUPPORTED = !!document.createElement('video').canPlayType('video/quicktime') || IS_SAFARI || IS_APPLE_MOBILE;\n\nexport default IS_MOV_SUPPORTED;\n","const audio = document.createElement('audio');\nconst IS_OPUS_SUPPORTED = !!(audio.canPlayType && audio.canPlayType('audio/ogg;').replace(/no/, ''))/* && false */;\n\nexport default IS_OPUS_SUPPORTED;\n","import {IS_FIREFOX} from './userAgent';\n\nconst IS_PARALLAX_SUPPORTED = !IS_FIREFOX && false;\n\nexport default IS_PARALLAX_SUPPORTED;\n","const IS_SCREEN_SHARING_SUPPORTED = !!('getDisplayMedia' in (navigator?.mediaDevices || {}));\n\nexport default IS_SCREEN_SHARING_SUPPORTED;\n","import Modes from '../config/modes';\n\nconst IS_SHARED_WORKER_SUPPORTED = typeof(SharedWorker) !== 'undefined' && !Modes.noSharedWorker/* && false */;\n\nexport default IS_SHARED_WORKER_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// @ts-ignore\nconst IS_TOUCH_SUPPORTED = ('ontouchstart' in window) || (window.DocumentTouch && document instanceof DocumentTouch)/* || true */;\nexport default IS_TOUCH_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ctx from './ctx';\n\nexport const USER_AGENT = navigator ? navigator.userAgent : null;\nexport const IS_APPLE = navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i) !== -1;\nexport const IS_ANDROID = navigator.userAgent.toLowerCase().indexOf('android') !== -1;\nexport const IS_CHROMIUM = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);\n\n// https://stackoverflow.com/a/58065241\nexport const IS_APPLE_MOBILE = (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&\n !(ctx as any).MSStream;\n\nexport const IS_SAFARI = !!('safari' in ctx) || !!(USER_AGENT && (/\\b(iPad|iPhone|iPod)\\b/.test(USER_AGENT) || (!!USER_AGENT.match('Safari') && !USER_AGENT.match('Chrome'))))/* || true */;\nexport const IS_FIREFOX = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n\nexport const IS_MOBILE_SAFARI = IS_SAFARI && IS_APPLE_MOBILE;\n\nexport const IS_MOBILE = (navigator.maxTouchPoints === undefined || navigator.maxTouchPoints > 0) && navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i) != -1;\n","const IS_VIBRATE_SUPPORTED = !!navigator?.vibrate;\n\nexport default IS_VIBRATE_SUPPORTED;\n","import IS_MOV_SUPPORTED from './movSupport';\n\nexport type VIDEO_MIME_TYPE = 'image/gif' | 'video/mp4' | 'video/webm' | 'video/quicktime';\nconst VIDEO_MIME_TYPES_SUPPORTED: Set = new Set([\n 'image/gif', // have to display it as video\n 'video/mp4',\n 'video/webm'\n]);\n\nif(IS_MOV_SUPPORTED) {\n VIDEO_MIME_TYPES_SUPPORTED.add('video/quicktime');\n}\n\nexport default VIDEO_MIME_TYPES_SUPPORTED;\n","import {IS_APPLE_MOBILE, IS_SAFARI} from './userAgent';\n\nconst IS_WEBM_SUPPORTED = !!document.createElement('video').canPlayType('video/webm') && !IS_SAFARI && !IS_APPLE_MOBILE;\n\nexport default IS_WEBM_SUPPORTED;\n","const IS_WEBP_SUPPORTED = document.createElement('canvas').toDataURL('image/webp').startsWith('data:image/webp');\n\nexport default IS_WEBP_SUPPORTED;\n","import {IS_FIREFOX} from './userAgent';\n\nconst IS_WEBRTC_SUPPORTED = !!(typeof(RTCPeerConnection) !== 'undefined' && !IS_FIREFOX);\n\nexport default IS_WEBRTC_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {WallPaper} from '../layer';\nimport clamp from './number/clamp';\n\nexport type ColorHsla = {\n h: number,\n s: number,\n l: number,\n a: number\n};\n\nexport type ColorRgba = [number, number, number, number];\nexport type ColorRgb = [number, number, number];\n\n/**\n * https://stackoverflow.com/a/54070620/6758968\n * r, g, b in [0, 255]\n * @returns h in [0,360) and s, v in [0,1]\n */\nexport function rgbToHsv(r: number, g: number, b: number): [number, number, number] {\n r /= 255, g /= 255, b /= 255;\n const v = Math.max(r, g, b),\n c = v - Math.min(r, g, b);\n const h = c && ((v === r) ? (g - b ) / c : ((v == g) ? 2 + (b - r) / c : 4 + (r - g) / c));\n return [60 * (h < 0 ? h + 6 : h), v && c / v, v];\n}\n\n/**\n * https://stackoverflow.com/a/54024653/6758968\n * @param h [0, 360]\n * @param s [0, 1]\n * @param v [0, 1]\n * @returns r, g, b in [0, 255]\n */\nexport function hsvToRgb(h: number, s: number, v: number): ColorRgb {\n const f = (n: number, k: number = (n + h / 60) % 6) => Math.round((v - v * s * Math.max(Math.min(k, 4 - k, 1), 0)) * 255);\n return [f(5), f(3), f(1)];\n}\n\n/**\n * @returns h [0, 360], s [0, 100], l [0, 100], a [0, 1]\n */\nexport function rgbaToHsla(r: number, g: number, b: number, a: number = 1): ColorHsla {\n r /= 255, g /= 255, b /= 255;\n const max = Math.max(r, g, b),\n min = Math.min(r, g, b);\n let h: number, s: number;\n const l = (max + min) / 2;\n\n if(max === min) {\n h = s = 0; // achromatic\n } else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch(max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n\n return {\n h: h * 360,\n s: s * 100,\n l: l * 100,\n a\n };\n}\n\n// * https://stackoverflow.com/a/9493060/6758968\n/**\n * Converts an HSL color value to RGB. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\n *\n * @param {number} h The hue [0, 360]\n * @param {number} s The saturation [0, 1]\n * @param {number} l The lightness [0, 1]\n * @return {Array} The RGB representation [0, 255]\n */\nexport function hslaToRgba(h: number, s: number, l: number, a: number): ColorRgba {\n h /= 360, s /= 100, l /= 100;\n let r: number, g: number, b: number;\n\n if(s === 0) {\n r = g = b = l; // achromatic\n } else {\n const hue2rgb = function hue2rgb(p: number, q: number, t: number) {\n if(t < 0) t += 1;\n if(t > 1) t -= 1;\n if(t < 1/6) return p + (q - p) * 6 * t;\n if(t < 1/2) return q;\n if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;\n return p;\n }\n\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n\n return [r, g, b, a].map((v) => Math.round(v * 255)) as ColorRgba;\n}\n\nexport function hslaStringToRgba(hsla: string) {\n const splitted = hsla.slice(5, -1).split(', ');\n const alpha = +splitted.pop();\n const arr = splitted.map((val) => {\n if(val.endsWith('%')) {\n return +val.slice(0, -1);\n }\n\n return +val;\n });\n\n return hslaToRgba(arr[0], arr[1], arr[2], alpha);\n}\n\nexport function hexaToRgba(hexa: string) {\n const arr: ColorRgba = [] as any;\n const offset = hexa[0] === '#' ? 1 : 0;\n if(hexa.length === (5 + offset)) {\n hexa = (offset ? '#' : '') + '0' + hexa.slice(offset);\n }\n\n if(hexa.length === (3 + offset)) {\n for(let i = offset; i < hexa.length; ++i) {\n arr.push(parseInt(hexa[i] + hexa[i], 16));\n }\n } else if(hexa.length === (4 + offset)) {\n for(let i = offset; i < (hexa.length - 1); ++i) {\n arr.push(parseInt(hexa[i] + hexa[i], 16));\n }\n\n arr.push(parseInt(hexa[hexa.length - 1], 16));\n } else {\n for(let i = offset; i < hexa.length; i += 2) {\n arr.push(parseInt(hexa.slice(i, i + 2), 16));\n }\n }\n\n return arr;\n}\n\nexport function hexToRgb(hex: string) {\n return hexaToRgba(hex.slice(0, 7)) as any as ColorRgb;\n}\n\nexport function hexaToHsla(hexa: string) {\n const rgba = hexaToRgba(hexa);\n return rgbaToHsla(rgba[0], rgba[1], rgba[2], rgba[3]);\n}\n\nexport function rgbaToHexa(rgba: ColorRgba | ColorRgb) {\n return '#' + rgba.map((v) => ('0' + v.toString(16)).slice(-2)).join('');\n}\n\nexport function hslaStringToHexa(hsla: string) {\n return rgbaToHexa(hslaStringToRgba(hsla));\n}\n\nexport function hslaStringToHex(hsla: string) {\n return hslaStringToHexa(hsla).slice(0, -2);\n}\n\n/**\n * @param weight [0, 1]\n */\nexport function mixColors(color1: ColorRgb, color2: ColorRgb, weight: number) {\n const out = new Array(3) as ColorRgb;\n for(let i = 0; i < 3; ++i) {\n const v1 = color1[i], v2 = color2[i];\n out[i] = Math.floor(v2 + (v1 - v2) * weight);\n }\n\n return out;\n}\n\nexport function computePerceivedBrightness(color: ColorRgb) {\n return (color[0] * 0.2126 + color[1] * 0.7152 + color[2] * 0.0722) / 255;\n}\n\nexport function getAverageColor(color1: ColorRgb, color2: ColorRgb): ColorRgb {\n return color1.map((v, i) => Math.round((v + color2[i]) / 2)) as ColorRgb;\n}\n\nexport function getAccentColor(baseHsv: number[], baseColor: ColorRgb, elementColor: ColorRgb): ColorRgb {\n const hsvTemp3 = rgbToHsv(...baseColor);\n const hsvTemp4 = rgbToHsv(...elementColor);\n\n const dist = Math.min(1.5 * hsvTemp3[1] / baseHsv[1], 1);\n\n hsvTemp3[0] = Math.min(360, hsvTemp4[0] - hsvTemp3[0] + baseHsv[0]);\n hsvTemp3[1] = Math.min(1, hsvTemp4[1] * baseHsv[1] / hsvTemp3[1]);\n hsvTemp3[2] = Math.min(1, (hsvTemp4[2] / hsvTemp3[2] + dist - 1) * baseHsv[2] / dist);\n if(hsvTemp3[2] < 0.3) {\n return elementColor;\n }\n return hsvToRgb(...hsvTemp3);\n}\n\nexport function changeColorAccent(baseHsv: number[], accentHsv: number[], color: ColorRgb, isDarkTheme: boolean) {\n const colorHsv = rgbToHsv(...color);\n\n const diffH = Math.min(Math.abs(colorHsv[0] - baseHsv[0]), Math.abs(colorHsv[0] - baseHsv[0] - 360));\n if(diffH > 30) {\n return color;\n }\n\n const dist = Math.min(1.5 * colorHsv[1] / baseHsv[1], 1);\n\n colorHsv[0] = Math.min(360, colorHsv[0] + accentHsv[0] - baseHsv[0]);\n colorHsv[1] = Math.min(1, colorHsv[1] * accentHsv[1] / baseHsv[1]);\n colorHsv[2] = Math.min(1, colorHsv[2] * (1 - dist + dist * accentHsv[2] / baseHsv[2]));\n\n let newColor = hsvToRgb(...colorHsv);\n\n const origBrightness = computePerceivedBrightness(color);\n const newBrightness = computePerceivedBrightness(newColor);\n\n // We need to keep colors lighter in dark themes and darker in light themes\n const needRevertBrightness = isDarkTheme ? origBrightness > newBrightness : origBrightness < newBrightness;\n\n if(needRevertBrightness) {\n const amountOfNew = 0.6;\n const fallbackAmount = (1 - amountOfNew) * origBrightness / newBrightness + amountOfNew;\n newColor = changeBrightness(newColor, fallbackAmount);\n }\n\n return newColor;\n}\n\nexport function changeBrightness(color: ColorRgb, amount: number) {\n return color.map((v) => clamp(Math.round(v * amount), 0, 255)) as ColorRgb;\n}\n\nexport function getHexColorFromTelegramColor(color: number) {\n const hex = (color < 0 ? 0xFFFFFF + color : color).toString(16);\n return '#' + (hex.length >= 6 ? hex : '0'.repeat(6 - hex.length) + hex);\n}\n\nexport function getRgbColorFromTelegramColor(color: number) {\n return hexToRgb(getHexColorFromTelegramColor(color));\n}\n\nexport function getColorsFromWallPaper(wallPaper: WallPaper) {\n return wallPaper.settings ? [\n wallPaper.settings.background_color,\n wallPaper.settings.second_background_color,\n wallPaper.settings.third_background_color,\n wallPaper.settings.fourth_background_color\n ].filter(Boolean).map(getHexColorFromTelegramColor).join(',') : '';\n}\n","export default function compareVersion(v1: string, v2: string): number {\n v1 = v1.split(' ', 1)[0];\n v2 = v2.split(' ', 1)[0];\n const s1 = v1.split('.');\n const s2 = v2.split('.');\n\n for(let i = 0; i < s1.length; ++i) {\n const v1 = +s1[i];\n const v2 = +s2[i];\n if(v1 > v2) return 1;\n else if(v1 < v2) return -1;\n }\n\n return 0;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function blurActiveElement() {\n if((document.activeElement as HTMLInputElement)?.blur) {\n (document.activeElement as HTMLInputElement).blur();\n return true;\n }\n\n return false;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nexport default function cancelEvent(event?: Event) {\n event ||= window.event;\n if(event) {\n // 'input' event will have cancelable=false, but we still need to preventDefault\n // if(!event.cancelable) {\n // return false;\n // }\n\n // @ts-ignore\n event = event.originalEvent || event;\n\n try {\n if(event.stopPropagation) event.stopPropagation();\n if(event.preventDefault) event.preventDefault();\n event.returnValue = false;\n event.cancelBubble = true;\n } catch(err) {}\n }\n\n return false;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// export function findUpClassName(el: any, className: string): T;\nexport default function findUpClassName(el: EventTarget | {closest: (selector: string) => any}, className: string): HTMLElement {\n return (el as any).closest('.' + className);\n /* if(el.classList.contains(className)) return el; // 03.02.2020\n\n while(el.parentElement) {\n el = el.parentElement;\n if(el.classList.contains(className))\n return el;\n }\n return null; */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {doubleRaf} from '../schedulers';\n\nexport default function fixSafariStickyInput(input: HTMLElement) {\n input.style.transform = 'translateY(-99999px)';\n /* input.style.position = 'fixed';\n input.style.top = '-99999px';\n input.style.left = '0'; */\n input.focus();\n\n // setTimeout(() => {\n doubleRaf().then(() => {\n // fastSmoothScroll(findUpClassName(input, 'scrollable-y') || window as any, document.activeElement as HTMLElement, 'start', 4, undefined, FocusDirection.Static);\n /* input.style.position = '';\n input.style.top = ''; */\n input.style.transform = '';\n // fastSmoothScroll(findUpClassName(input, 'scrollable-y') || window as any, document.activeElement as HTMLElement, 'start', 4, undefined, FocusDirection.Static);\n\n /* setTimeout(() => {\n fastSmoothScroll(findUpClassName(input, 'scrollable-y') || window as any, document.activeElement as HTMLElement, 'start', 4);\n }, 50); */\n });\n // }, 0);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../../environment/touchSupport';\nimport {IS_MOBILE, IS_SAFARI} from '../../environment/userAgent';\nimport findUpClassName from './findUpClassName';\nimport fixSafariStickyInput from './fixSafariStickyInput';\n\nexport const IS_STICKY_INPUT_BUGGED = IS_SAFARI && IS_MOBILE && IS_TOUCH_SUPPORTED;\n\nif(IS_STICKY_INPUT_BUGGED) {\n const key: 'clientY' | 'pageY' = 'clientY';\n let startY = 0;\n const o = {capture: true, passive: false};\n const onTouchMove = (e: TouchEvent) => {\n const touch = e.touches[0];\n\n // console.log('touchmove y', touch[key], startY);\n\n const scrollable = findUpClassName(touch.target, 'scrollable-y');\n if(scrollable) {\n const y = touch[key];\n const scrolled = startY - y;\n\n /* if(y < startY) {\n startY = y;\n } */\n\n const scrollTop = scrollable.scrollTop;\n const scrollHeight = scrollable.scrollHeight;\n const clientHeight = scrollable.clientHeight;\n const nextScrollTop = scrollTop ? Math.round(scrollTop + scrollable.clientHeight + scrolled) : scrollTop + scrolled;\n // const needCancel = scrollHeight !== clientHeight ? (scrollTop && diff <= 1) || (scrollTop - diff) < 0 : true;\n const needCancel = scrollHeight === clientHeight || nextScrollTop >= scrollHeight || nextScrollTop <= 0;\n if(needCancel) {\n e.preventDefault();\n }\n\n // console.log('touchmove with scrollable', scrollTop, startY, scrolled, nextScrollTop, needCancel, e.cancelable);\n } else {\n e.preventDefault();\n\n // console.log('touchmove no scrollable', e, touch);\n }\n\n // if(e.target === document.documentElement || e.target === document.body) e.preventDefault();\n };\n\n // let el = document.createElement('div');\n // document.body.prepend(el);\n // let a = 0;\n\n // let hasFocus = false;\n let lastFocusOutTimeStamp = 0;\n document.addEventListener('focusin', (e) => {\n if(!(e.target as HTMLElement).classList.contains('is-sticky-input-bugged') || (e.timeStamp - lastFocusOutTimeStamp) < 50/* && document.activeElement === input */) {\n return;\n }\n\n // console.log('focusin', e, e.timeStamp);\n\n // hasFocus = true;\n // document.body.classList.add('is-keyboard-opened');\n\n // el.innerText = 'focusin ' + ++a;\n\n /* a < 2 && */fixSafariStickyInput(e.target as HTMLElement);\n\n document.addEventListener('touchmove', onTouchMove, o);\n document.addEventListener('touchstart', (e) => {\n if(e.touches.length > 1) return;\n const touchStart = e.touches[0];\n\n startY = touchStart[key];\n });\n }, {passive: true});\n\n document.addEventListener('focusout', (e) => {\n // console.log('focusout', e, e.timeStamp);\n document.removeEventListener('touchmove', onTouchMove, o);\n\n lastFocusOutTimeStamp = e.timeStamp;\n\n // el.innerText = 'focusout ' + ++a;\n\n // if(hasFocus) {\n // hasFocus = false;\n // document.body.classList.remove('is-keyboard-opened');\n // }\n }, {passive: true});\n\n document.addEventListener('visibilitychange', () => {\n // console.log('window visibilitychange');\n if(document.activeElement &&\n document.activeElement.classList.contains('is-sticky-input-bugged') &&\n (document.activeElement as HTMLElement).blur) {\n fixSafariStickyInput(document.activeElement as HTMLElement);\n }\n\n /* blurActiveElement();\n window.scrollTo(0, 0);\n setVH(); */\n }, {passive: true});\n}\n\nexport default function fixSafariStickyInputFocusing(input: HTMLElement) {\n if(!IS_STICKY_INPUT_BUGGED) return;\n input.classList.add('is-sticky-input-bugged');\n}\n","let callback: () => Promise;\nexport default function cacheInstallPrompt() {\n window.addEventListener('beforeinstallprompt', (deferredPrompt: any) => {\n callback = async() => {\n deferredPrompt.prompt();\n const {outcome} = await deferredPrompt.userChoice;\n const installed = outcome === 'accepted';\n if(installed) {\n callback = undefined;\n }\n };\n });\n}\n\nexport function getInstallPrompt() {\n return callback;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport noop from '../noop';\nimport pause from '../schedulers/pause';\n\nconst texts = ['b', 'б'];\ntype FontType = 'text' | 'icons' | 'monospace';\n\nconst cache: {\n [key: string]: {\n [text: string]: Promise\n }\n} = {};\n\nconst fonts: {[type in FontType]: string} = {\n text: 'Roboto',\n icons: 'tgico',\n monospace: 'Roboto Mono'\n};\n\nexport default function loadFonts(types: {[type in FontType]?: string[] | 'all'} = {\n text: texts,\n icons: undefined,\n monospace: texts\n}): Promise {\n if(!('fonts' in document)) {\n return Promise.resolve();\n }\n\n const promises: Promise[] = [];\n for(const type in types) {\n let _texts = types[type as FontType];\n if(_texts === 'all') {\n _texts = texts;\n }\n\n const font = fonts[type as FontType];\n const weights = type === 'icons' ? [500] : [400, 500];\n for(const weight of weights) {\n const _promises = (_texts || [undefined]).map((text) => {\n const key = [weight, '1rem', font].join(' ');\n const promise = (cache[key] ??= {})[text || ''] ??= document.fonts.load(key, text);\n return promise;\n });\n promises.push(..._promises);\n }\n }\n\n return Promise.race([\n Promise.all(promises).catch(noop),\n pause(1000)\n ]);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import I18n from '../../lib/langPack';\n\nexport default function setInnerHTML(elem: Element, html: string | DocumentFragment | Element) {\n setDirection(elem);\n if(typeof(html) === 'string') {\n if(!html) elem.replaceChildren();\n else elem.innerHTML = html;\n } else {\n elem.replaceChildren(html);\n }\n}\n\nexport function setDirection(elem: Element) {\n // if(!I18n.isRTL) {\n elem.setAttribute('dir', 'auto');\n // }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport EventListenerBase from './eventListenerBase';\n\nconst FOCUS_EVENT_NAME = IS_TOUCH_SUPPORTED ? 'touchstart' : 'mousemove';\nconst DO_NOT_IDLE = false;\n\nexport class IdleController extends EventListenerBase<{\n change: (idle: boolean) => void\n}> {\n private _isIdle: boolean;\n\n private focusPromise: Promise;\n private focusResolve: () => void;\n\n constructor() {\n super();\n\n this._isIdle = true;\n this.focusPromise = Promise.resolve();\n this.focusResolve = () => {};\n\n window.addEventListener('blur', () => {\n this.isIdle = true;\n\n window.addEventListener('focus', () => {\n this.isIdle = false;\n }, {once: true});\n });\n\n // * Prevent setting online after reloading page\n window.addEventListener(FOCUS_EVENT_NAME, () => {\n this.isIdle = false;\n }, {once: true, passive: true});\n\n this.addEventListener('change', (idle) => {\n if(idle) {\n this.focusPromise = new Promise((resolve) => {\n this.focusResolve = resolve;\n });\n } else {\n this.focusResolve();\n }\n });\n }\n\n public getFocusPromise() {\n return this.focusPromise;\n }\n\n public get isIdle() {\n return this._isIdle;\n }\n\n public set isIdle(value: boolean) {\n if(this._isIdle === value) {\n return;\n }\n\n if(DO_NOT_IDLE && value) {\n return;\n }\n\n this._isIdle = value;\n this.dispatchEvent('change', value);\n }\n}\n\nconst idleController = new IdleController();\nexport default idleController;\n","export default function clamp(v: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, v));\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport EventListenerBase from './eventListenerBase';\n\nexport class OverlayCounter extends EventListenerBase<{\n change: (isActive: boolean) => void\n}> {\n public overlaysActive = 0;\n\n get isOverlayActive() {\n return this.overlaysActive > 0;\n }\n\n set isOverlayActive(value: boolean) {\n this.overlaysActive += value ? 1 : -1;\n this.dispatchEvent('change', this.isOverlayActive);\n }\n}\n\nconst overlayCounter = new OverlayCounter();\nexport default overlayCounter;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// * Jolly Cobra's schedulers\nimport {NoneToVoidFunction} from '../types';\n\n/*\nexport function throttleWithTickEnd(fn: F) {\n return throttleWith(onTickEnd, fn);\n}\n\nexport function throttleWithNow(fn: F) {\n return throttleWith(runNow, fn);\n}\n\nexport function onTickEnd(cb: NoneToVoidFunction) {\n Promise.resolve().then(cb);\n}\n\nfunction runNow(fn: NoneToVoidFunction) {\n fn();\n} */\n\nlet fastRafCallbacks: NoneToVoidFunction[] | undefined;\nexport function fastRaf(callback: NoneToVoidFunction) {\n if(!fastRafCallbacks) {\n fastRafCallbacks = [callback];\n\n requestAnimationFrame(() => {\n const currentCallbacks = fastRafCallbacks!;\n fastRafCallbacks = undefined;\n currentCallbacks.forEach((cb) => cb());\n });\n } else {\n fastRafCallbacks.push(callback);\n }\n}\n\nlet fastRafConventionalCallbacks: NoneToVoidFunction[] | undefined, processing = false;\nexport function fastRafConventional(callback: NoneToVoidFunction) {\n if(!fastRafConventionalCallbacks) {\n fastRafConventionalCallbacks = [callback];\n\n requestAnimationFrame(() => {\n processing = true;\n for(let i = 0; i < fastRafConventionalCallbacks.length; ++i) {\n fastRafConventionalCallbacks[i]();\n }\n\n fastRafConventionalCallbacks = undefined;\n processing = false;\n });\n } else if(processing) {\n callback();\n } else {\n fastRafConventionalCallbacks.push(callback);\n }\n}\n\nlet rafPromise: Promise;\nexport function fastRafPromise() {\n if(rafPromise) return rafPromise;\n\n rafPromise = new Promise((resolve) => fastRaf(() => resolve()));\n rafPromise.then(() => {\n rafPromise = undefined;\n });\n\n return rafPromise;\n}\n\nexport function doubleRaf() {\n return new Promise((resolve) => {\n fastRaf(() => {\n fastRaf(resolve);\n });\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function parseUriParams(uri: string, splitted = uri.split('?')) {\n return parseUriParamsLine(splitted?.[1]);\n}\n\nexport function parseUriParamsLine(line: string) {\n const params: any = {};\n if(!line) {\n return params;\n }\n\n line.split('&').forEach((item) => {\n params[item.split('=')[0]] = decodeURIComponent(item.split('=')[1]);\n });\n\n return params;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {AppTheme} from '../config/state';\nimport type {Theme} from '../layer';\nimport type AppBackgroundTab from '../components/sidebarLeft/tabs/background';\nimport IS_TOUCH_SUPPORTED from '../environment/touchSupport';\nimport rootScope from '../lib/rootScope';\nimport {changeColorAccent, ColorRgb, getAccentColor, getAverageColor, getHexColorFromTelegramColor, getRgbColorFromTelegramColor, hexToRgb, hslaStringToHex, hsvToRgb, mixColors, rgbaToHexa, rgbaToHsla, rgbToHsv} from './color';\nimport {MOUNT_CLASS_TO} from '../config/debug';\n\ntype AppColorName = 'primary-color' | 'message-out-primary-color' |\n 'surface-color' | 'danger-color' | 'primary-text-color' |\n 'secondary-text-color' | 'message-out-background-color' |\n 'saved-color';\ntype AppColor = {\n rgb?: boolean,\n light?: boolean,\n lightFilled?: boolean,\n dark?: boolean,\n darkRgb?: boolean,\n darkFilled?: boolean\n};\n\nconst appColorMap: {[name in AppColorName]: AppColor} = {\n 'primary-color': {\n rgb: true,\n light: true,\n lightFilled: true,\n dark: true,\n darkRgb: true\n },\n 'message-out-primary-color': {\n lightFilled: true\n },\n 'surface-color': {\n rgb: true\n },\n 'danger-color': {\n light: true,\n dark: true\n },\n 'primary-text-color': {\n rgb: true\n },\n 'secondary-text-color': {\n light: true,\n lightFilled: true\n },\n 'message-out-background-color': {\n light: true,\n lightFilled: true,\n dark: true,\n darkFilled: true\n },\n 'saved-color': {\n lightFilled: true\n }\n};\n\nconst colorMap: {\n [name in AppTheme['name']]?: {\n [name in AppColorName]?: string\n }\n} = {\n day: {\n 'primary-color': '#3390ec',\n 'message-out-primary-color': '#4fae4e',\n 'surface-color': '#ffffff',\n 'danger-color': '#df3f40',\n 'primary-text-color': '#000000',\n 'secondary-text-color': '#707579',\n 'saved-color': '#359AD4'\n },\n night: {\n 'primary-color': '#8774E1',\n 'message-out-primary-color': '#8774E1',\n 'surface-color': '#212121',\n 'danger-color': '#ff595a',\n 'primary-text-color': '#ffffff',\n 'secondary-text-color': '#aaaaaa',\n 'saved-color': '#8774E1'\n }\n};\n\nexport class ThemeController {\n private themeColor: string;\n private _themeColorElem: Element;\n private systemTheme: AppTheme['name'];\n private styleElement: HTMLStyleElement;\n public AppBackgroundTab: typeof AppBackgroundTab;\n\n constructor() {\n rootScope.addEventListener('theme_change', () => {\n this.setTheme();\n });\n\n // rootScope.addEventListener('settings_updated', ())\n }\n\n private get themeColorElem() {\n if(this._themeColorElem !== undefined) {\n return this._themeColorElem;\n }\n\n return this._themeColorElem = document.head.querySelector('[name=\"theme-color\"]') as Element || null;\n }\n\n public setThemeColor(color = this.themeColor) {\n if(!color) {\n color = this.isNight() ? '#212121' : '#ffffff';\n }\n\n const themeColorElem = this.themeColorElem;\n if(themeColorElem) {\n themeColorElem.setAttribute('content', color);\n }\n }\n\n public setThemeListener() {\n try {\n const darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n const checkDarkMode = () => {\n // const theme = this.getTheme();\n this.systemTheme = darkModeMediaQuery.matches ? 'night' : 'day';\n // const newTheme = this.getTheme();\n\n if(rootScope.myId) {\n rootScope.dispatchEvent('theme_change');\n } else {\n this.setTheme();\n }\n };\n\n if('addEventListener' in darkModeMediaQuery) {\n darkModeMediaQuery.addEventListener('change', checkDarkMode);\n } else if('addListener' in darkModeMediaQuery) {\n (darkModeMediaQuery as any).addListener(checkDarkMode);\n }\n\n checkDarkMode();\n } catch(err) {\n\n }\n }\n\n public applyHighlightningColor() {\n let hsla: string;\n const theme = this.getTheme();\n if(theme.settings?.highlightningColor) {\n hsla = theme.settings.highlightningColor;\n document.documentElement.style.setProperty('--message-highlightning-color', hsla);\n } else {\n document.documentElement.style.removeProperty('--message-highlightning-color');\n }\n\n if(!IS_TOUCH_SUPPORTED && hsla) {\n this.themeColor = hslaStringToHex(hsla);\n }\n }\n\n public setTheme() {\n const isNight = this.isNight();\n const colorScheme = document.head.querySelector('[name=\"color-scheme\"]');\n if(colorScheme) {\n colorScheme.setAttribute('content', isNight ? 'dark' : 'light');\n }\n\n document.documentElement.classList.toggle('night', isNight);\n this.setThemeColor();\n const theme = this.getTheme();\n this.applyTheme(theme);\n\n let style = this.styleElement;\n if(!style) {\n style = this.styleElement = document.createElement('style');\n document.head.append(style);\n }\n\n const e = document.createElement('div');\n this.applyTheme(rootScope.settings.themes.find((theme) => theme.name === 'night'), e);\n style.textContent = `.night {${e.style.cssText}}`;\n\n this.applyHighlightningColor();\n }\n\n public async switchTheme(name: AppTheme['name']) {\n await rootScope.managers.appStateManager.setByKey('settings.theme', name);\n rootScope.dispatchEvent('theme_change');\n }\n\n public isNight() {\n return this.getTheme().name === 'night';\n }\n\n public getTheme(name: AppTheme['name'] = rootScope.settings.theme === 'system' ? this.systemTheme : rootScope.settings.theme) {\n return rootScope.settings.themes.find((t) => t.name === name);\n }\n\n // theme applier\n private bindColorApplier(options: Pick[0], 'element' | 'isNight'>) {\n const appliedColors: Set = new Set();\n return {\n applyAppColor: (_options: Omit[0], keyof typeof options>) => {\n appliedColors.add(_options.name);\n return this.applyAppColor({..._options, ...options});\n },\n finalize: () => {\n const isNight = options.isNight;\n for(const name in appColorMap) {\n if(!appliedColors.has(name as AppColorName)) {\n this.applyAppColor({\n name: name as AppColorName,\n hex: colorMap[isNight ? 'night' : 'day'][name as AppColorName],\n ...options\n });\n }\n }\n }\n };\n };\n\n private applyAppColor({\n name,\n hex,\n element,\n lightenAlpha = 0.08,\n darkenAlpha = lightenAlpha,\n mixColor,\n isNight\n }: {\n name: AppColorName,\n hex: string,\n element: HTMLElement,\n lightenAlpha?: number\n darkenAlpha?: number,\n mixColor?: ColorRgb,\n isNight?: boolean\n }) {\n const appColor = appColorMap[name];\n const rgb = hexToRgb(hex);\n const hsla = rgbaToHsla(...rgb);\n\n mixColor ??= hexToRgb(colorMap[isNight ? 'night' : 'day']['surface-color']);\n const lightenedRgb = mixColors(rgb, mixColor, lightenAlpha);\n\n const darkenedHsla: typeof hsla = {\n ...hsla,\n l: hsla.l - darkenAlpha * 100\n };\n\n const properties: [string, string][] = [\n [name, hex],\n appColor.rgb && [name + '-rgb', rgb.join(',')],\n appColor.light && ['light-' + name, `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, ${lightenAlpha})`],\n appColor.lightFilled && ['light-filled-' + name, rgbaToHexa(lightenedRgb)],\n appColor.dark && ['dark-' + name, `hsl(${darkenedHsla.h}, ${darkenedHsla.s}%, ${darkenedHsla.l}%)`]\n // appColor.darkFilled && ['dark-' + name, `hsl(${darkenedHsla.h}, ${darkenedHsla.s}%, ${darkenedHsla.l}%)`]\n ];\n\n properties.filter(Boolean).forEach(([name, value]) => {\n element.style.setProperty('--' + name, value);\n });\n }\n\n public async applyNewTheme(theme: Theme) {\n const isNight = this.isNightTheme(theme);\n const currentTheme = this.getTheme();\n const themes = rootScope.settings.themes;\n const themeSettings = theme.settings.find((themeSettings) => themeSettings.base_theme._ === (isNight ? 'baseThemeNight' : 'baseThemeClassic'));\n const newAppTheme: AppTheme = {\n ...theme,\n name: currentTheme.name,\n settings: {\n ...themeSettings,\n highlightningColor: ''\n }\n };\n\n await this.AppBackgroundTab.setBackgroundDocument(themeSettings.wallpaper, newAppTheme.settings);\n themes[themes.indexOf(currentTheme)] = newAppTheme;\n await rootScope.managers.appStateManager.setByKey('settings.themes', rootScope.settings.themes);\n rootScope.dispatchEvent('theme_change');\n }\n\n private isNightTheme(theme: Theme | AppTheme) {\n return (theme as AppTheme).name === 'night' || this.isNight();\n }\n\n public applyTheme(theme: Theme | AppTheme, element = document.documentElement) {\n const isNight = this.isNightTheme(theme);\n const themeSettings = Array.isArray(theme.settings) ?\n theme.settings.find((settings) => settings.base_theme._ === (isNight ? 'baseThemeNight' : 'baseThemeClassic')) :\n theme.settings;\n const baseColors = colorMap[isNight ? 'night' : 'day'];\n\n let hsvTemp1 = rgbToHsv(...hexToRgb(baseColors['primary-color'])); // primary base\n let hsvTemp2 = rgbToHsv(...getRgbColorFromTelegramColor(themeSettings.accent_color)); // new primary\n\n const newAccentRgb = changeColorAccent(\n hsvTemp1,\n hsvTemp2,\n hexToRgb(baseColors['primary-color']),\n !isNight\n );\n const newAccentHex = rgbaToHexa(newAccentRgb);\n\n const {applyAppColor, finalize} = this.bindColorApplier({element, isNight});\n\n applyAppColor({\n name: 'primary-color',\n hex: newAccentHex,\n darkenAlpha: 0.04\n });\n\n applyAppColor({\n name: 'saved-color',\n hex: newAccentHex,\n lightenAlpha: 0.64,\n mixColor: [255, 255, 255]\n });\n\n if(!themeSettings.message_colors?.length) {\n return;\n }\n\n const messageLightenAlpha = isNight ? 0.92 : 0.12;\n const baseMessageColor = hexToRgb(baseColors['message-out-primary-color']);\n hsvTemp1 = rgbToHsv(...baseMessageColor);\n const baseMessageOutBackgroundColor = mixColors(baseMessageColor, hexToRgb(baseColors['surface-color']), messageLightenAlpha);\n\n const firstColor = getRgbColorFromTelegramColor(themeSettings.message_colors[0]);\n\n let myMessagesAccent = firstColor;\n if(themeSettings.message_colors.length > 1) {\n // const w = getAccentColor(hsvTemp1, baseMessageOutBackgroundColor, myMessagesAccent);\n\n themeSettings.message_colors.slice(1).forEach((nextColor) => {\n myMessagesAccent = getAverageColor(myMessagesAccent, getRgbColorFromTelegramColor(nextColor));\n });\n\n myMessagesAccent = getAccentColor(hsvTemp1, baseMessageOutBackgroundColor, myMessagesAccent);\n\n // console.log('www', rgbaToHexa(w), rgbaToHexa(myMessagesAccent));\n }\n\n const o = myMessagesAccent;\n hsvTemp2 = rgbToHsv(...o);\n\n // const c = changeColorAccent(\n // hsvTemp1,\n // hsvTemp2,\n // baseMessageOutBackgroundColor\n // );\n\n // console.log(o, c, rgbaToHexa(o), rgbaToHexa(c));\n\n const accentColor2 = themeSettings.outbox_accent_color !== undefined && rgbToHsv(...getRgbColorFromTelegramColor(themeSettings.outbox_accent_color));\n\n const newMessageOutBackgroundColor = mixColors(myMessagesAccent, hexToRgb(baseColors['surface-color']), messageLightenAlpha);\n\n applyAppColor({\n name: 'message-out-background-color',\n hex: rgbaToHexa(newMessageOutBackgroundColor),\n lightenAlpha: messageLightenAlpha\n });\n\n applyAppColor({\n name: 'message-out-primary-color',\n hex: isNight ? '#ffffff' : rgbaToHexa(accentColor2 ? hsvToRgb(...accentColor2) : myMessagesAccent),\n mixColor: newMessageOutBackgroundColor\n });\n\n // if(accentColor2) {\n // console.log(rgbaToHexa(myMessagesAccent), rgbaToHexa(hsvToRgb(...accentColor2)));\n // }\n\n finalize();\n }\n}\n\nconst themeController = new ThemeController();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.themeController = themeController);\nexport default themeController;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function setWorkerProxy() {\n // * hook worker constructor to set search parameters (test, debug, etc)\n const workerHandler = {\n construct(target: any, args: any) {\n let url = args[0] + '';\n if(url.indexOf('blob:') !== 0) {\n url += location.search;\n }\n\n return new target(url);\n }\n };\n\n [\n Worker,\n typeof(SharedWorker) !== 'undefined' && SharedWorker\n ].filter(Boolean).forEach((w) => {\n window[w.name as any] = new Proxy(w, workerHandler);\n });\n}\n\nsetWorkerProxy();\n","const IS_INSTALL_PROMPT_SUPPORTED = 'onbeforeinstallprompt' in window;\nexport default IS_INSTALL_PROMPT_SUPPORTED;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport App from './config/app';\nimport blurActiveElement from './helpers/dom/blurActiveElement';\nimport cancelEvent from './helpers/dom/cancelEvent';\nimport {IS_STICKY_INPUT_BUGGED} from './helpers/dom/fixSafariStickyInputFocusing';\nimport loadFonts from './helpers/dom/loadFonts';\nimport IS_EMOJI_SUPPORTED from './environment/emojiSupport';\nimport {IS_ANDROID, IS_APPLE, IS_APPLE_MOBILE, IS_FIREFOX, IS_MOBILE, IS_MOBILE_SAFARI, IS_SAFARI} from './environment/userAgent';\nimport './materialize.scss';\nimport './scss/style.scss';\nimport pause from './helpers/schedulers/pause';\nimport setWorkerProxy from './helpers/setWorkerProxy';\nimport toggleAttributePolyfill from './helpers/dom/toggleAttributePolyfill';\nimport rootScope from './lib/rootScope';\nimport IS_TOUCH_SUPPORTED from './environment/touchSupport';\nimport I18n from './lib/langPack';\nimport './helpers/peerIdPolyfill';\nimport './lib/polyfill';\nimport apiManagerProxy from './lib/mtproto/mtprotoworker';\nimport getProxiedManagers from './lib/appManagers/getProxiedManagers';\nimport themeController from './helpers/themeController';\nimport overlayCounter from './helpers/overlayCounter';\nimport singleInstance from './lib/mtproto/singleInstance';\nimport {parseUriParamsLine} from './helpers/string/parseUriParams';\nimport Modes from './config/modes';\nimport {AuthState} from './types';\nimport {IS_BETA} from './config/debug';\nimport IS_INSTALL_PROMPT_SUPPORTED from './environment/installPrompt';\nimport cacheInstallPrompt from './helpers/dom/installPrompt';\n// import appNavigationController from './components/appNavigationController';\n\ndocument.addEventListener('DOMContentLoaded', async() => {\n toggleAttributePolyfill();\n\n // polyfill for replaceChildren\n if((Node as any).prototype.replaceChildren === undefined) {\n (Node as any).prototype.replaceChildren = function(...nodes: any[]) {\n this.textContent = '';\n // while(this.lastChild) {\n // this.removeChild(this.lastChild);\n // }\n if(nodes) {\n this.append(...nodes);\n }\n }\n }\n\n rootScope.managers = getProxiedManagers();\n\n const manifest = document.getElementById('manifest') as HTMLLinkElement;\n manifest.href = `site${IS_APPLE && !IS_APPLE_MOBILE ? '_apple' : ''}.webmanifest?v=jw3mK7G9Aq`;\n\n singleInstance.start();\n\n // We listen to the resize event (https://css-tricks.com/the-trick-to-viewport-units-on-mobile/)\n const w = window.visualViewport || window; // * handle iOS keyboard\n let setViewportVH = false/* , hasFocus = false */;\n let lastVH: number;\n const setVH = () => {\n const vh = (setViewportVH && !overlayCounter.isOverlayActive ? (w as VisualViewport).height || (w as Window).innerHeight : window.innerHeight) * 0.01;\n if(lastVH === vh) {\n return;\n } else if(IS_TOUCH_SUPPORTED && lastVH < vh && (vh - lastVH) > 1) {\n blurActiveElement(); // (Android) fix blurring inputs when keyboard is being closed (e.g. closing keyboard by back arrow and touching a bubble)\n }\n\n lastVH = vh;\n\n // const vh = document.documentElement.scrollHeight * 0.01;\n document.documentElement.style.setProperty('--vh', `${vh}px`);\n\n // console.log('setVH', vh, setViewportVH ? w : window);\n\n /* if(setViewportVH && userAgent.isSafari && touchSupport.isTouchSupported && document.activeElement && (document.activeElement as HTMLElement).blur) {\n const rect = document.activeElement.getBoundingClientRect();\n if(rect.top < 0 || rect.bottom >= (w as any).height) {\n fastSmoothScroll(findUpClassName(document.activeElement, 'scrollable-y') || window as any, document.activeElement as HTMLElement, 'center', 4, undefined, FocusDirection.Static);\n }\n } */\n };\n\n setWorkerProxy;\n\n // const [_, touchSupport, userAgent, _rootScope, _appStateManager, _I18n, __/* , ___ */] = await Promise.all([\n // import('./lib/polyfill'),\n // import('./environment/touchSupport'),\n // import('./environment/userAgent'),\n // import('./lib/rootScope'),\n // import('./lib/appManagers/appStateManager'),\n // import('./lib/langPack'),\n // import('./helpers/peerIdPolyfill'),\n // // import('./helpers/cacheFunctionPolyfill')\n // ]);\n\n /* const {IS_TOUCH_SUPPORTED} = touchSupport;\n const {IS_FIREFOX, IS_MOBILE, IS_APPLE, IS_SAFARI, IS_APPLE_MOBILE, IS_ANDROID} = userAgent;\n const rootScope = _rootScope.default;\n const appStateManager = _appStateManager.default;\n const I18n = _I18n.default; */\n\n window.addEventListener('resize', setVH);\n setVH();\n\n if(IS_STICKY_INPUT_BUGGED) {\n const toggleResizeMode = () => {\n setViewportVH = tabId === 1 && IS_STICKY_INPUT_BUGGED && !overlayCounter.isOverlayActive;\n setVH();\n\n if(w !== window) {\n if(setViewportVH) {\n window.removeEventListener('resize', setVH);\n w.addEventListener('resize', setVH);\n } else {\n w.removeEventListener('resize', setVH);\n window.addEventListener('resize', setVH);\n }\n }\n };\n\n let tabId: number;\n (window as any).onImTabChange = (id: number) => {\n const wasTabId = tabId !== undefined;\n tabId = id;\n\n if(wasTabId || tabId === 1) {\n toggleResizeMode();\n }\n };\n\n overlayCounter.addEventListener('change', () => {\n toggleResizeMode();\n });\n }\n\n if(IS_FIREFOX && !IS_EMOJI_SUPPORTED) {\n document.addEventListener('dragstart', (e) => {\n const target = e.target as HTMLElement;\n if(target.tagName === 'IMG' && target.classList.contains('emoji')) {\n cancelEvent(e);\n return false;\n }\n });\n }\n\n if(IS_EMOJI_SUPPORTED) {\n document.documentElement.classList.add('native-emoji');\n }\n\n // prevent firefox image dragging\n document.addEventListener('dragstart', (e) => {\n if((e.target as HTMLElement)?.tagName === 'IMG') {\n e.preventDefault();\n return false;\n }\n });\n\n // restrict contextmenu on images (e.g. webp stickers)\n document.addEventListener('contextmenu', (e) => {\n if((e.target as HTMLElement).tagName === 'IMG' && !(window as any).appMediaViewer) {\n cancelEvent(e);\n }\n });\n\n if(IS_FIREFOX) {\n document.documentElement.classList.add('is-firefox', 'no-backdrop');\n }\n\n if(IS_MOBILE) {\n document.documentElement.classList.add('is-mobile');\n }\n\n if(IS_APPLE) {\n if(IS_SAFARI) {\n document.documentElement.classList.add('is-safari');\n }\n\n // document.documentElement.classList.add('emoji-supported');\n\n if(IS_APPLE_MOBILE) {\n document.documentElement.classList.add('is-ios');\n } else {\n document.documentElement.classList.add('is-mac');\n }\n } else if(IS_ANDROID) {\n document.documentElement.classList.add('is-android');\n\n // force losing focus on input blur\n // focusin and focusout are not working on mobile\n\n const onInResize = () => {\n hasFocus = true;\n window.addEventListener('resize', onOutResize, {once: true});\n };\n\n const onOutResize = () => {\n hasFocus = false;\n blurActiveElement();\n };\n\n let hasFocus = false;\n document.addEventListener('touchend', (e) => {\n const input = (e.target as HTMLElement).closest('[contenteditable=\"true\"], input');\n if(!input) {\n return;\n }\n\n if(document.activeElement !== input && !hasFocus) {\n console.log('input click', e, document.activeElement, input, input.matches(':focus'));\n window.addEventListener('resize', onInResize, {once: true});\n }\n });\n }\n\n if(!IS_TOUCH_SUPPORTED) {\n document.documentElement.classList.add('no-touch');\n } else {\n document.documentElement.classList.add('is-touch');\n /* document.addEventListener('touchmove', (event: any) => {\n event = event.originalEvent || event;\n if(event.scale && event.scale !== 1) {\n event.preventDefault();\n }\n }, {capture: true, passive: false}); */\n }\n\n if(IS_INSTALL_PROMPT_SUPPORTED) {\n cacheInstallPrompt();\n }\n\n const perf = performance.now();\n\n // await pause(1000000);\n\n const langPromise = I18n.getCacheLangPack();\n\n const [stateResult, langPack] = await Promise.all([\n // loadState(),\n apiManagerProxy.sendState().then(([stateResult]) => stateResult),\n langPromise\n ]);\n I18n.setTimeFormat(stateResult.state.settings.timeFormat);\n\n rootScope.managers.rootScope.getPremium().then((isPremium) => {\n rootScope.premium = isPremium;\n });\n\n themeController.setThemeListener();\n\n if(langPack.appVersion !== App.langPackVersion) {\n I18n.getLangPack(langPack.lang_code);\n }\n\n /**\n * won't fire if font is loaded too fast\n */\n function fadeInWhenFontsReady(elem: HTMLElement, promise: Promise) {\n elem.style.opacity = '0';\n\n promise.then(() => {\n window.requestAnimationFrame(() => {\n elem.style.opacity = '';\n });\n });\n }\n\n console.log('got state, time:', performance.now() - perf);\n\n if(langPack.lang_code === 'ar' && IS_BETA && false) {\n document.body.classList.add('is-rtl');\n document.documentElement.dir = 'rtl';\n document.documentElement.lang = langPack.lang_code;\n I18n.setRTL(true);\n } else {\n document.documentElement.dir = 'ltr';\n }\n\n let authState = stateResult.state.authState;\n\n const hash = location.hash;\n const splitted = hash.split('?');\n const params = parseUriParamsLine(splitted[1] ?? splitted[0].slice(1));\n if(params.tgWebAuthToken && authState._ !== 'authStateSignedIn') {\n const data: AuthState.signImport['data'] = {\n token: params.tgWebAuthToken,\n dcId: +params.tgWebAuthDcId,\n userId: params.tgWebAuthUserId.toUserId(),\n isTest: params.tgWebAuthTest !== undefined && !!+params.tgWebAuthTest,\n tgAddr: params.tgaddr\n };\n\n if(data.isTest !== Modes.test) {\n const urlSearchParams = new URLSearchParams(location.search);\n if(+params.tgWebAuthTest) {\n urlSearchParams.set('test', '1');\n } else {\n urlSearchParams.delete('test');\n }\n\n location.search = urlSearchParams.toString();\n return;\n }\n\n rootScope.managers.appStateManager.pushToState('authState', authState = {_: 'authStateSignImport', data});\n\n // appNavigationController.overrideHash('?tgaddr=' + encodeURIComponent(params.tgaddr));\n }\n\n if(authState._ !== 'authStateSignedIn'/* || 1 === 1 */) {\n console.log('Will mount auth page:', authState._, Date.now() / 1000);\n\n const el = document.getElementById('auth-pages');\n let scrollable: HTMLElement;\n if(el) {\n scrollable = el.querySelector('.scrollable') as HTMLElement;\n if((!IS_TOUCH_SUPPORTED || IS_MOBILE_SAFARI)) {\n scrollable.classList.add('no-scrollbar');\n }\n\n // * don't remove this line\n scrollable.style.opacity = '0';\n\n const placeholder = document.createElement('div');\n placeholder.classList.add('auth-placeholder');\n\n scrollable.prepend(placeholder);\n scrollable.append(placeholder.cloneNode());\n }\n\n try {\n await Promise.all([\n import('./lib/mtproto/telegramMeWebManager'),\n import('./lib/mtproto/webPushApiManager')\n ]).then(([meModule, pushModule]) => {\n meModule.default.setAuthorized(false);\n pushModule.default.forceUnsubscribe();\n });\n } catch(err) {\n\n }\n\n let pagePromise: Promise;\n // langPromise.then(async() => {\n switch(authState._) {\n case 'authStateSignIn':\n pagePromise = (await import('./pages/pageSignIn')).default.mount();\n break;\n case 'authStateSignQr':\n pagePromise = (await import('./pages/pageSignQR')).default.mount();\n break;\n case 'authStateAuthCode':\n pagePromise = (await import('./pages/pageAuthCode')).default.mount(authState.sentCode);\n break;\n case 'authStatePassword':\n pagePromise = (await import('./pages/pagePassword')).default.mount();\n break;\n case 'authStateSignUp':\n pagePromise = (await import('./pages/pageSignUp')).default.mount(authState.authCode);\n break;\n case 'authStateSignImport':\n pagePromise = (await import('./pages/pageSignImport')).default.mount(authState.data);\n break;\n }\n // });\n\n if(scrollable) {\n // wait for text appear\n if(pagePromise) {\n await pagePromise;\n }\n\n const promise = 'fonts' in document ?\n Promise.race([\n pause(1000),\n document.fonts.ready\n ]) :\n Promise.resolve();\n fadeInWhenFontsReady(scrollable, promise);\n }\n\n /* setTimeout(async() => {\n (await import('./pages/pageAuthCode')).default.mount({\n \"_\": \"auth.sentCode\",\n \"pFlags\": {},\n \"flags\": 6,\n \"type\": {\n \"_\": \"auth.sentCodeTypeSms\",\n \"length\": 5\n },\n \"phone_code_hash\": \"\",\n \"next_type\": {\n \"_\": \"auth.codeTypeCall\"\n },\n \"timeout\": 120,\n \"phone_number\": \"\"\n });\n\n (await import('./pages/pageSignQR')).default.mount();\n\n (await import('./pages/pagePassword')).default.mount();\n\n (await import('./pages/pageSignUp')).default.mount({\n \"phone_code_hash\": \"\",\n \"phone_number\": \"\"\n });\n }, 500); */\n } else {\n console.log('Will mount IM page:', Date.now() / 1000);\n fadeInWhenFontsReady(document.getElementById('main-columns'), loadFonts());\n (await import('./pages/pageIm')).default.mount();\n }\n});\n","export default function toggleAttributePolyfill() {\n if(!Element.prototype.toggleAttribute) {\n Element.prototype.toggleAttribute = function(name, force) {\n if(force !== void 0) force = !!force;\n\n if(this.hasAttribute(name)) {\n if(force) return true;\n\n this.removeAttribute(name);\n return false;\n }\n if(force === false) return false;\n\n this.setAttribute(name, '');\n return true;\n };\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nexport class AppRuntimeManager {\n public reload() {\n try {\n location.reload();\n } catch(e) {};\n\n // if(window.chrome && chrome.runtime && chrome.runtime.reload) {\n // chrome.runtime.reload();\n // }\n }\n\n public close() {\n try {\n window.close();\n } catch(e) {}\n }\n\n /**\n * Better to call from event\n */\n public focus() {\n // // @ts-ignore\n // if(window.navigator.mozApps && document.hidden) {\n // // Get app instance and launch it to bring app to foreground\n // // @ts-ignore\n // window.navigator.mozApps.getSelf().onsuccess = function() {\n // this.result.launch();\n // };\n // } else {\n // // @ts-ignore\n // if(window.chrome && chrome.app && chrome.app.window) {\n // // @ts-ignore\n // chrome.app.window.current().focus();\n // }\n\n window.focus();\n // }\n }\n}\n\nconst appRuntimeManager = new AppRuntimeManager();\nexport default appRuntimeManager;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type createManagers from './createManagers';\nimport {ModifyFunctionsToAsync} from '../../types';\nimport apiManagerProxy from '../mtproto/mtprotoworker';\nimport {AckedResult} from '../mtproto/superMessagePort';\nimport noop from '../../helpers/noop';\nimport dT from '../../helpers/dT';\nimport DEBUG from '../../config/debug';\n\n// let stats: {\n// [manager: string]: {\n// [method: string]: {\n// times: number[],\n// byArgs: {\n// [args: string]: number[]\n// }\n// }\n// }\n// } = {};\n\n// let sentCount = 0;\n// let sentMethods: {[key: string]: number} = {};\n// let sentMethods2: {[key: string]: number} = {};\n// function collectStats(manager: string, method: string, args: any[], promise: Promise) {\n// ++sentCount;\n\n// const key = [manager, method].join('-');\n// if(!sentMethods[key]) sentMethods[key] = 0;\n// ++sentMethods[key];\n\n// const key2 = [('00000' + sentCount).slice(-5), key].join('-');\n\n// const byManager = stats[manager] ??= {};\n// const byMethod = byManager[method] ??= {times: [], byArgs: {}};\n\n// const perf = performance.now();\n// promise.catch(noop).finally(() => {\n// const time = performance.now() - perf;\n// byMethod.times.push(time);\n\n// sentMethods2[key2] = time;\n\n// try {\n// const argsString = JSON.stringify(args);\n// byMethod.byArgs[argsString].push(time);\n// } catch(err) {}\n// });\n// }\n\n// setInterval(() => {\n// console.log(dT(), '[PROXY] stats', stats, sentCount, sentMethods, sentMethods2);\n// sentCount = 0;\n// stats = {};\n// sentMethods = {};\n// sentMethods2 = {};\n// }, 2000);\n\nconst DEBUG_MANAGER_REQUESTS: {[managerName: string]: Set} = {};\nif(DEBUG) {\n (window as any).DEBUG_MANAGER_REQUESTS = DEBUG_MANAGER_REQUESTS;\n}\n\nfunction createProxy(/* source: T, */name: string, ack?: boolean) {\n const proxy = new Proxy({}, {\n get: (target, p, receiver) => {\n // console.log('get', target, p, receiver);\n // @ts-ignore\n // const value = source[p];\n // if(typeof(value) !== 'function') {\n // return value;\n // }\n\n return (...args: any[]) => {\n const promise = apiManagerProxy.invoke('manager', {\n name,\n method: p as string,\n args\n }, ack as any);\n\n if(DEBUG) {\n if(DEBUG_MANAGER_REQUESTS[name]?.has(p as any)) {\n console.warn('manager request', name, p, args);\n }\n }\n\n // collectStats(name, p as string, args, promise);\n\n return promise;\n\n // @ts-ignore\n // return Promise.resolve(value.call(source, ...args));\n };\n }\n });\n\n return proxy;\n}\n\ntype AA = {\n [key in keyof T]: T[key] extends (...args: infer A) => infer R ? (...args: A) => Promise>> : never\n};\n\ntype T = Awaited>;\ntype ProxiedManagers = {\n [name in keyof T]?: ModifyFunctionsToAsync;\n} & {\n acknowledged?: {\n [name in keyof T]?: AA;\n }\n};\n\nfunction createProxyProxy(proxied: any, ack?: boolean) {\n return new Proxy(proxied, {\n get: (target, p, receiver) => {\n // @ts-ignore\n return target[p] ??= createProxy(p as string, ack);\n }\n });\n}\n\nlet proxied: ProxiedManagers;\nexport default function getProxiedManagers() {\n if(proxied) {\n return proxied;\n }\n\n proxied = createProxyProxy({}, false);\n proxied.acknowledged = createProxyProxy({}, true);\n return proxied;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {Database} from '../../config/databases';\nimport Modes from '../../config/modes';\nimport makeError from '../../helpers/makeError';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport {logger} from '../logger';\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/createIndex\n */\nexport type IDBIndex = {\n indexName: string,\n keyPath: string,\n objectParameters: IDBIndexParameters\n};\n\nexport type IDBStore = {\n name: string,\n indexes?: IDBIndex[]\n};\n\nexport type IDBOptions = {\n name?: string,\n storeName: string,\n stores?: IDBStore[],\n version?: number\n};\n\nconst DEBUG = false;\n\nexport class IDB {\n private static INSTANCES: IDB[] = [];\n private openDbPromise: Promise;\n private db: IDBDatabase;\n private storageIsAvailable: boolean;\n private log: ReturnType;\n private name: string;\n private version: number;\n private stores: IDBStore[];\n\n constructor(db: Database) {\n safeAssign(this, db);\n\n if(Modes.test) {\n this.name += '_test';\n }\n\n this.storageIsAvailable = true;\n this.log = logger(['IDB', db.name].join('-'));\n this.log('constructor');\n\n this.openDatabase(true);\n\n IDB.INSTANCES.push(this);\n }\n\n public isAvailable() {\n return this.storageIsAvailable;\n }\n\n public openDatabase(createNew = false): Promise {\n if(this.openDbPromise && !createNew) {\n return this.openDbPromise;\n }\n\n const createIndexes = (os: IDBObjectStore, store: IDBStore) => {\n const indexNames = Array.from(os.indexNames);\n for(const indexName of indexNames) {\n os.deleteIndex(indexName);\n }\n\n if(!store.indexes?.length) {\n return;\n }\n\n for(const index of store.indexes) {\n if(os.indexNames.contains(index.indexName)) {\n continue;\n }\n\n os.createIndex(index.indexName, index.keyPath, index.objectParameters);\n }\n };\n\n const createObjectStore = (db: IDBDatabase, store: IDBStore) => {\n const os = db.createObjectStore(store.name);\n createIndexes(os, store);\n };\n\n try {\n var request = indexedDB.open(this.name, this.version);\n\n if(!request) {\n return Promise.reject();\n }\n } catch(error) {\n this.log.error('error opening db', (error as Error).message);\n this.storageIsAvailable = false;\n return Promise.reject(error);\n }\n\n let finished = false;\n setTimeout(() => {\n if(!finished) {\n request.onerror(makeError('IDB_CREATE_TIMEOUT') as Event);\n }\n }, 3000);\n\n return this.openDbPromise = new Promise((resolve, reject) => {\n request.onsuccess = (event) => {\n finished = true;\n const db = request.result;\n let calledNew = false;\n\n this.log('Opened');\n\n db.onerror = (error) => {\n this.storageIsAvailable = false;\n this.log.error('Error creating/accessing IndexedDB database', error);\n reject(error);\n };\n\n db.onclose = (e) => {\n this.log.error('closed:', e);\n !calledNew && this.openDatabase();\n };\n\n db.onabort = (e) => {\n this.log.error('abort:', e);\n const transaction = e.target as IDBTransaction;\n\n this.openDatabase(calledNew = true);\n\n if(transaction.onerror) {\n transaction.onerror(e);\n }\n\n db.close();\n };\n\n db.onversionchange = (e) => {\n this.log.error('onversionchange, lol?');\n };\n\n resolve(this.db = db);\n };\n\n request.onerror = (event) => {\n finished = true;\n this.storageIsAvailable = false;\n this.log.error('Error creating/accessing IndexedDB database', event);\n reject(event);\n };\n\n request.onupgradeneeded = (event) => {\n finished = true;\n this.log.warn('performing idb upgrade from', event.oldVersion, 'to', event.newVersion);\n\n const target = event.target as IDBOpenDBRequest;\n const db = target.result;\n this.stores.forEach((store) => {\n /* if(db.objectStoreNames.contains(store.name)) {\n //if(event.oldVersion === 1) {\n db.deleteObjectStore(store.name);\n //}\n } */\n\n if(!db.objectStoreNames.contains(store.name)) {\n createObjectStore(db, store);\n } else {\n const txn = target.transaction;\n const os = txn.objectStore(store.name);\n createIndexes(os, store);\n }\n });\n };\n });\n }\n\n public static create>(db: T) {\n return this.INSTANCES.find((instance) => instance.name === db.name) ?? new IDB(db);\n }\n\n public static closeDatabases(preserve?: IDB) {\n this.INSTANCES.forEach((storage) => {\n if(preserve && preserve === storage) {\n return;\n }\n\n const db = storage.db;\n if(db) {\n db.onclose = () => {};\n db.close();\n }\n });\n }\n}\n\nexport default class IDBStorage, StoreName extends string = T['stores'][0]['name']> {\n private log: ReturnType;\n private storeName: T['stores'][0]['name'];\n private idb: IDB;\n\n constructor(db: T, storeName: typeof db['stores'][0]['name']) {\n this.storeName = storeName;\n this.log = logger(['IDB', db.name, storeName].join('-'));\n this.idb = IDB.create(db);\n }\n\n /**\n * ! WARNING ! function requires at least one opened connection\n */\n /* public static clearObjectStores() {\n const storage = this.STORAGES[0];\n this.closeDatabases(storage);\n\n const names = Array.from(storage.db.objectStoreNames);\n const promises = names.map((name) => storage.clear(name));\n return Promise.all(promises);\n } */\n\n /* public static deleteDatabase() {\n this.closeDatabases();\n\n const storages = this.STORAGES;\n const dbNames = Array.from(new Set(storages.map((storage) => storage.name)));\n const promises = dbNames.map((dbName) => {\n return new Promise((resolve, reject) => {\n const deleteRequest = indexedDB.deleteDatabase(dbName);\n\n deleteRequest.onerror = () => {\n reject();\n };\n\n deleteRequest.onsuccess = () => {\n resolve();\n };\n });\n });\n\n return Promise.all(promises);\n } */\n\n public delete(entryName: string | string[], storeName?: StoreName): Promise {\n // return Promise.resolve();\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n entryName = [].concat(entryName);\n }\n\n return this.getObjectStore('readwrite', (objectStore) => {\n const promises = (entryName as string[]).map((entryName) => objectStore.delete(entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'delete: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n public clear(storeName?: StoreName): Promise {\n return this.getObjectStore('readwrite', (objectStore) => objectStore.clear(), DEBUG ? 'clear' : '', storeName);\n }\n\n public save(entryName: string | string[], value: any | any[], storeName?: StoreName) {\n // const handleError = (error: Error) => {\n // this.log.error('save: transaction error:', entryName, value, db, error, error && error.name);\n // if((!error || error.name === 'InvalidStateError')/* && false */) {\n // setTimeout(() => {\n // this.save(entryName, value);\n // }, 2e3);\n // } else {\n // //console.error('IndexedDB saveFile transaction error:', error, error && error.name);\n // }\n // };\n\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n entryName = [].concat(entryName);\n value = [].concat(value);\n }\n\n return this.getObjectStore('readwrite', (objectStore) => {\n const promises = (entryName as string[]).map((entryName, idx) => objectStore.put(value[idx], entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'save: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n // public saveFile(fileName: string, blob: Blob | Uint8Array) {\n // //return Promise.resolve(blobConstruct([blob]));\n // if(!(blob instanceof Blob)) {\n // blob = blobConstruct(blob);\n // }\n\n // return this.save(fileName, blob);\n // }\n\n /* public saveFileBase64(db: IDBDatabase, fileName: string, blob: Blob | any): Promise {\n if(this.getBlobSize(blob) > 10 * 1024 * 1024) {\n return Promise.reject();\n }\n\n if(!(blob instanceof Blob)) {\n var safeMimeType = blobSafeMimeType(blob.type || 'image/jpeg');\n var address = 'data:' + safeMimeType + ';base64,' + bytesToBase64(blob);\n return this.storagePutB64String(db, fileName, address).then(() => {\n return blob;\n });\n }\n\n try {\n var reader = new FileReader();\n } catch (e) {\n this.storageIsAvailable = false;\n return Promise.reject();\n }\n\n let promise = new Promise((resolve, reject) => {\n reader.onloadend = () => {\n this.storagePutB64String(db, fileName, reader.result as string).then(() => {\n resolve(blob);\n }, reject);\n }\n\n reader.onerror = reject;\n });\n\n\n try {\n reader.readAsDataURL(blob);\n } catch (e) {\n this.storageIsAvailable = false;\n return Promise.reject();\n }\n\n return promise;\n }\n\n public storagePutB64String(db: IDBDatabase, fileName: string, b64string: string) {\n try {\n var objectStore = db.transaction([this.storeName], 'readwrite')\n .objectStore(this.storeName);\n var request = objectStore.put(b64string, fileName);\n } catch(error) {\n this.storageIsAvailable = false;\n return Promise.reject(error);\n }\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n resolve();\n };\n\n request.onerror = reject;\n });\n }\n\n public getBlobSize(blob: any) {\n return blob.size || blob.byteLength || blob.length;\n } */\n\n public get(entryName: string[], storeName?: StoreName): Promise;\n public get(entryName: string, storeName?: StoreName): Promise;\n public get(entryName: string | string[], storeName?: StoreName): Promise | Promise {\n // return Promise.reject();\n\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n if(!entryName) {\n return undefined;\n }\n\n entryName = [].concat(entryName);\n } else if(!entryName.length) {\n return Promise.resolve([]) as any;\n }\n\n return this.getObjectStore('readonly', (objectStore) => {\n const promises = (entryName as string[]).map((entryName) => objectStore.get(entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'get: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n private getObjectStore(\n mode: IDBTransactionMode,\n callback: (objectStore: IDBObjectStore) => IDBRequest | IDBRequest[],\n log?: string,\n storeName = this.storeName\n ) {\n let perf: number;\n\n if(log) {\n perf = performance.now();\n this.log(log + ': start');\n }\n\n return this.idb.openDatabase().then((db) => {\n return new Promise((resolve, reject) => {\n /* if(mode === 'readwrite') {\n return;\n } */\n\n const transaction = db.transaction([storeName], mode);\n\n const onError = () => {\n clearTimeout(timeout);\n reject(transaction.error);\n };\n\n // let resolved = false;\n const onComplete = (/* what: string */) => {\n clearTimeout(timeout);\n\n if(log) {\n this.log(log + ': end', performance.now() - perf/* , what */);\n }\n\n // if(resolved) {\n // return;\n // }\n\n // resolved = true;\n const results = requests.map((r) => r.result);\n resolve(isArray ? results : results[0]);\n };\n\n transaction.onerror = onError;\n\n // * have to wait while clearing or setting something\n const waitForTransactionComplete = mode === 'readwrite';\n if(waitForTransactionComplete) {\n transaction.oncomplete = () => onComplete(/* 'transaction' */);\n }\n\n const timeout = setTimeout(() => {\n this.log.error('transaction not finished', transaction, log);\n }, 10000);\n\n /* transaction.addEventListener('abort', (e) => {\n //handleError();\n this.log.error('IndexedDB: transaction abort!', transaction.error);\n }); */\n\n const callbackResult = callback(transaction.objectStore(storeName));\n\n const isArray = Array.isArray(callbackResult);\n const requests: IDBRequest[] = isArray ? callbackResult : [].concat(callbackResult) as any;\n\n if(waitForTransactionComplete) {\n return;\n }\n\n const length = requests.length;\n let left = length;\n\n const onRequestFinished = () => {\n if(transaction.error) {\n return;\n }\n\n if(!--left) {\n onComplete(/* 'requests' */);\n }\n };\n\n for(let i = 0; i < length; ++i) {\n const request = requests[i];\n request.onerror = onError;\n request.onsuccess = onRequestFinished;\n }\n });\n });\n }\n\n public getAll(storeName?: StoreName): Promise {\n return this.getObjectStore('readonly', (objectStore) => objectStore.getAll(), DEBUG ? 'getAll' : '', storeName);\n }\n\n /* public getAllKeys(): Promise> {\n console.time('getAllEntries');\n return this.openDatabase().then((db) => {\n var objectStore = db.transaction([this.storeName], 'readonly')\n .objectStore(this.storeName);\n var request = objectStore.getAllKeys();\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n // @ts-ignore\n var result = event.target.result;\n resolve(result);\n console.timeEnd('getAllEntries');\n }\n\n request.onerror = reject;\n });\n });\n } */\n\n /* public isFileExists(fileName: string): Promise {\n console.time('isFileExists');\n return this.openDatabase().then((db) => {\n var objectStore = db.transaction([this.storeName], 'readonly')\n .objectStore(this.storeName);\n var request = objectStore.openCursor(fileName);\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n // @ts-ignore\n var cursor = event.target.result;\n resolve(!!cursor);\n console.timeEnd('isFileExists');\n }\n\n request.onerror = reject;\n });\n });\n } */\n\n /* public getFileWriter(fileName: string, mimeType: string) {\n var fakeWriter = FileManager.getFakeFileWriter(mimeType, (blob) => {\n return this.saveFile(fileName, blob);\n });\n\n return Promise.resolve(fakeWriter);\n } */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type lang from '../lang';\nimport type langSign from '../langSign';\nimport type {State} from '../config/state';\nimport DEBUG, {MOUNT_CLASS_TO} from '../config/debug';\nimport {HelpCountriesList, HelpCountry, LangPackDifference, LangPackString} from '../layer';\nimport stateStorage from './stateStorage';\nimport App from '../config/app';\nimport rootScope from './rootScope';\nimport {IS_MOBILE} from '../environment/userAgent';\nimport deepEqual from '../helpers/object/deepEqual';\nimport safeAssign from '../helpers/object/safeAssign';\nimport capitalizeFirstLetter from '../helpers/string/capitalizeFirstLetter';\nimport matchUrlProtocol from './richTextProcessor/matchUrlProtocol';\nimport wrapUrl from './richTextProcessor/wrapUrl';\nimport {setDirection} from '../helpers/dom/setInnerHTML';\n\nexport const langPack: {[actionType: string]: LangPackKey} = {\n 'messageActionChatCreate': 'ActionCreateGroup',\n 'messageActionChatCreateYou': 'ActionYouCreateGroup',\n 'messageActionChatEditTitle': 'ActionChangedTitle',\n 'messageActionChatEditPhoto': 'ActionChangedPhoto',\n 'messageActionChatEditVideo': 'ActionChangedVideo',\n 'messageActionChatDeletePhoto': 'ActionRemovedPhoto',\n 'messageActionChatReturn': 'ActionAddUserSelf',\n 'messageActionChatReturnYou': 'ActionAddUserSelfYou',\n 'messageActionChatJoined': 'ActionAddUserSelfMega',\n 'messageActionChatJoinedYou': 'ChannelMegaJoined',\n 'messageActionChatAddUser': 'ActionAddUser',\n 'messageActionChatAddUsers': 'ActionAddUser',\n 'messageActionChatLeave': 'ActionLeftUser',\n 'messageActionChatLeaveYou': 'YouLeft',\n 'messageActionChatDeleteUser': 'ActionKickUser',\n 'messageActionChatJoinedByLink': 'ActionInviteUser',\n 'messageActionPinMessage': 'Chat.Service.Group.UpdatedPinnedMessage',\n 'messageActionContactSignUp': 'Chat.Service.PeerJoinedTelegram',\n 'messageActionChannelCreate': 'ActionCreateChannel',\n 'messageActionChannelEditTitle': 'Chat.Service.Channel.UpdatedTitle',\n 'messageActionChannelEditPhoto': 'Chat.Service.Channel.UpdatedPhoto',\n 'messageActionChannelEditVideo': 'Chat.Service.Channel.UpdatedVideo',\n 'messageActionChannelDeletePhoto': 'Chat.Service.Channel.RemovedPhoto',\n 'messageActionHistoryClear': 'HistoryCleared',\n 'messageActionDiscussionStarted': 'DiscussionStarted',\n\n 'messageActionChannelMigrateFrom': 'ActionMigrateFromGroup',\n\n 'messageActionPhoneCall.video_in_ok': 'ChatList.Service.VideoCall.incoming',\n 'messageActionPhoneCall.video_out_ok': 'ChatList.Service.VideoCall.outgoing',\n 'messageActionPhoneCall.video_missed': 'ChatList.Service.VideoCall.Missed',\n 'messageActionPhoneCall.video_cancelled': 'ChatList.Service.VideoCall.Cancelled',\n 'messageActionPhoneCall.in_ok': 'ChatList.Service.Call.incoming',\n 'messageActionPhoneCall.out_ok': 'ChatList.Service.Call.outgoing',\n 'messageActionPhoneCall.missed': 'ChatList.Service.Call.Missed',\n 'messageActionPhoneCall.cancelled': 'ChatList.Service.Call.Cancelled',\n\n 'messageActionGroupCall.started': 'Chat.Service.VoiceChatStarted.Channel',\n 'messageActionGroupCall.started_by': 'Chat.Service.VoiceChatStarted',\n 'messageActionGroupCall.started_byYou': 'Chat.Service.VoiceChatStartedYou',\n 'messageActionGroupCall.ended': 'Chat.Service.VoiceChatFinished.Channel',\n 'messageActionGroupCall.ended_by': 'Chat.Service.VoiceChatFinished',\n 'messageActionGroupCall.ended_byYou': 'Chat.Service.VoiceChatFinishedYou',\n\n 'messageActionBotAllowed': 'Chat.Service.BotPermissionAllowed'\n};\n\nexport type LangPackKey = /* string | */keyof typeof lang | keyof typeof langSign;\n\nexport type FormatterArgument = string | number | Node | FormatterArgument[];\nexport type FormatterArguments = FormatterArgument[];\n\nexport const UNSUPPORTED_LANG_PACK_KEY: LangPackKey = IS_MOBILE ? 'Message.Unsupported.Mobile' : 'Message.Unsupported.Desktop';\n\nnamespace I18n {\n export const strings: Map = new Map();\n export const countriesList: HelpCountry[] = [];\n let pluralRules: Intl.PluralRules;\n\n let cacheLangPackPromise: Promise;\n export let lastRequestedLangCode: string;\n export let lastRequestedNormalizedLangCode: string;\n export let lastAppliedLangCode: string;\n export let requestedServerLanguage = false;\n export let timeFormat: State['settings']['timeFormat'];\n export let isRTL = false;\n\n export function setRTL(rtl: boolean) {\n isRTL = rtl;\n }\n\n function setLangCode(langCode: string) {\n lastRequestedLangCode = langCode;\n lastRequestedNormalizedLangCode = langCode.split('-')[0];\n }\n\n export function getCacheLangPack(): Promise {\n if(cacheLangPackPromise) return cacheLangPackPromise;\n return cacheLangPackPromise = Promise.all([\n stateStorage.get('langPack') as Promise,\n polyfillPromise\n ]).then(([langPack]) => {\n if(!langPack/* || true */) {\n return loadLocalLangPack();\n } else if(DEBUG && false) {\n return getLangPack(langPack.lang_code);\n }/* else if(langPack.appVersion !== App.langPackVersion) {\n return getLangPack(langPack.lang_code);\n } */\n\n if(!lastRequestedLangCode) {\n setLangCode(langPack.lang_code);\n }\n\n applyLangPack(langPack);\n return langPack;\n }).finally(() => {\n cacheLangPackPromise = undefined;\n });\n }\n\n function updateAmPm() {\n if(timeFormat === 'h12') {\n try {\n const dateTimeFormat = getDateTimeFormat({hour: 'numeric', minute: 'numeric', hour12: true});\n const date = new Date();\n date.setHours(0);\n const amText = dateTimeFormat.format(date);\n amPmCache.am = amText.split(/\\s/)[1];\n date.setHours(12);\n const pmText = dateTimeFormat.format(date);\n amPmCache.pm = pmText.split(/\\s/)[1];\n } catch(err) {\n console.error('cannot get am/pm', err);\n amPmCache = {am: 'AM', pm: 'PM'};\n }\n }\n }\n\n export function setTimeFormat(\n format: State['settings']['timeFormat'],\n haveToUpdate = !!timeFormat && timeFormat !== format\n ) {\n timeFormat = format;\n\n updateAmPm();\n\n if(haveToUpdate) {\n cachedDateTimeFormats.clear();\n const elements = Array.from(document.querySelectorAll(`.i18n`)) as HTMLElement[];\n elements.forEach((element) => {\n const instance = weakMap.get(element);\n\n if(instance instanceof IntlDateElement) {\n instance.update();\n }\n });\n }\n }\n\n export function loadLocalLangPack() {\n const defaultCode = App.langPackCode;\n setLangCode(defaultCode);\n return Promise.all([\n import('../lang'),\n import('../langSign'),\n import('../countries')\n ]).then(([lang, langSign, countries]) => {\n const strings: LangPackString[] = [];\n formatLocalStrings(lang.default, strings);\n formatLocalStrings(langSign.default, strings);\n\n const langPack: LangPackDifference = {\n _: 'langPackDifference',\n from_version: 0,\n lang_code: defaultCode,\n strings,\n version: 0,\n local: true,\n countries: countries.default\n };\n return saveLangPack(langPack);\n });\n }\n\n export function loadLangPack(langCode: string, web?: boolean) {\n web = true;\n requestedServerLanguage = true;\n const managers = rootScope.managers;\n return Promise.all([\n managers.apiManager.invokeApiCacheable('langpack.getLangPack', {\n lang_code: langCode,\n lang_pack: web ? 'web' : App.langPack\n }),\n !web && managers.apiManager.invokeApiCacheable('langpack.getLangPack', {\n lang_code: langCode,\n lang_pack: 'android'\n }),\n import('../lang'),\n import('../langSign'),\n managers.apiManager.invokeApiCacheable('help.getCountriesList', {\n lang_code: langCode,\n hash: 0\n }) as Promise,\n polyfillPromise\n ]);\n }\n\n export function getStrings(langCode: string, strings: string[]) {\n return rootScope.managers.apiManager.invokeApi('langpack.getStrings', {\n lang_pack: App.langPack,\n lang_code: langCode,\n keys: strings\n });\n }\n\n export function formatLocalStrings(strings: any, pushTo: LangPackString[] = []) {\n for(const i in strings) {\n // @ts-ignore\n const v = strings[i];\n if(typeof(v) === 'string') {\n pushTo.push({\n _: 'langPackString',\n key: i,\n value: v\n });\n } else {\n pushTo.push({\n _: 'langPackStringPluralized',\n key: i,\n ...v\n });\n }\n }\n\n return pushTo;\n }\n\n export function getLangPack(langCode: string, web?: boolean) {\n setLangCode(langCode);\n return loadLangPack(langCode, web).then(([langPack1, langPack2, localLangPack1, localLangPack2, countries, _]) => {\n let strings: LangPackString[] = [];\n\n [localLangPack1, localLangPack2].forEach((l) => {\n formatLocalStrings(l.default as any, strings);\n });\n\n strings = strings.concat(...[langPack1.strings, langPack2.strings].filter(Boolean));\n\n langPack1.strings = strings;\n langPack1.countries = countries;\n return saveLangPack(langPack1);\n });\n }\n\n export function saveLangPack(langPack: LangPackDifference) {\n langPack.appVersion = App.langPackVersion;\n\n return stateStorage.set({langPack}).then(() => {\n applyLangPack(langPack);\n return langPack;\n });\n }\n\n export const polyfillPromise = (function checkIfPolyfillNeeded() {\n if(typeof(Intl) !== 'undefined' && typeof(Intl.PluralRules) !== 'undefined'/* && false */) {\n return Promise.resolve();\n } else {\n return import('./pluralPolyfill').then((_Intl) => {\n (window as any).Intl = Object.assign(typeof(Intl) !== 'undefined' ? Intl : {}, _Intl.default);\n });\n }\n })();\n\n export function applyLangPack(langPack: LangPackDifference) {\n const currentLangCode = lastRequestedLangCode;\n if(langPack.lang_code !== currentLangCode) {\n return;\n }\n\n try {\n pluralRules = new Intl.PluralRules(lastRequestedNormalizedLangCode);\n } catch(err) {\n console.error('pluralRules error', err);\n pluralRules = new Intl.PluralRules(lastRequestedNormalizedLangCode.split('-', 1)[0]);\n }\n\n try {\n pluralRules = new Intl.PluralRules(langPack.lang_code);\n } catch(err) {\n console.error('pluralRules error', err);\n pluralRules = new Intl.PluralRules(langPack.lang_code.split('-', 1)[0]);\n }\n\n strings.clear();\n\n for(const string of langPack.strings) {\n strings.set(string.key as LangPackKey, string);\n }\n\n if(langPack.countries) {\n countriesList.length = 0;\n countriesList.push(...langPack.countries.countries);\n\n langPack.countries.countries.forEach((country) => {\n if(country.name) {\n const langPackKey: any = country.default_name;\n strings.set(langPackKey, {\n _: 'langPackString',\n key: langPackKey,\n value: country.name\n });\n }\n });\n }\n\n if(lastAppliedLangCode !== currentLangCode) {\n rootScope.dispatchEvent('language_change', currentLangCode);\n lastAppliedLangCode = currentLangCode;\n cachedDateTimeFormats.clear();\n updateAmPm();\n }\n\n const elements = Array.from(document.querySelectorAll(`.i18n`)) as HTMLElement[];\n elements.forEach((element) => {\n const instance = weakMap.get(element);\n\n if(instance) {\n instance.update();\n }\n });\n }\n\n function pushNextArgument(out: ReturnType, args: FormatterArguments, indexHolder: {i: number}) {\n const arg = args[indexHolder.i++];\n if(Array.isArray(arg)) {\n out.push(...arg as any);\n } else {\n out.push(arg);\n }\n }\n\n export function superFormatter(input: string, args?: FormatterArguments, indexHolder = {i: 0}): Exclude[] {\n const out: ReturnType = [];\n const regExp = /(\\*\\*|__)(.+?)\\1|(\\n)|(\\[.+?\\]\\(.*?\\))|un\\d|%\\d\\$.|%./g;\n\n let lastIndex = 0;\n input.replace(regExp, (match, p1: any, p2: any, p3: any, p4: string, offset: number, string: string) => {\n // console.table({match, p1, p2, offset, string});\n\n out.push(string.slice(lastIndex, offset));\n\n if(p1) {\n // offset += p1.length;\n let element: HTMLElement;\n switch(p1) {\n case '**': {\n element = document.createElement('b');\n break;\n }\n\n case '__': {\n element = document.createElement('i');\n break;\n }\n }\n\n element.append(...superFormatter(p2, args, indexHolder) as any);\n out.push(element);\n } else if(p3) {\n out.push(document.createElement('br'));\n } else if(p4) {\n const idx = p4.lastIndexOf(']');\n const text = p4.slice(1, idx);\n\n const url = p4.slice(idx + 2, p4.length - 1);\n let a: HTMLAnchorElement;\n if(url && matchUrlProtocol(url)) {\n a = document.createElement('a');\n const wrappedUrl = wrapUrl(url);\n a.href = wrappedUrl.url;\n if(wrappedUrl.onclick) a.setAttribute('onclick', wrappedUrl.onclick);\n a.target = '_blank';\n } else {\n a = args[indexHolder.i++] as HTMLAnchorElement;\n\n if(a instanceof DocumentFragment) { // right after wrapRichText\n a = a.firstChild as any;\n }\n\n if(typeof(a) !== 'string') {\n a.textContent = ''; // reset content\n }\n }\n\n const formatted = superFormatter(text, args, indexHolder) as any;\n if(typeof(a) === 'string') {\n out.push(...formatted);\n } else {\n a.append(...formatted);\n out.push(a);\n }\n } else if(args) {\n pushNextArgument(out, args, indexHolder);\n }\n\n lastIndex = offset + match.length;\n return '';\n });\n\n if(lastIndex !== input.length) {\n out.push(input.slice(lastIndex));\n }\n\n return out;\n }\n\n export function format(key: LangPackKey, plain: true, args?: FormatterArguments): string;\n export function format(key: LangPackKey, plain?: false, args?: FormatterArguments): ReturnType;\n export function format(key: LangPackKey, plain = false, args?: FormatterArguments): ReturnType | string {\n const str = strings.get(key);\n let input: string;\n if(str) {\n if(str._ === 'langPackStringPluralized' && args?.length) {\n let v = args[0] as number | string;\n if(typeof(v) === 'string') v = +v.replace(/\\D/g, '');\n const s = pluralRules.select(v);\n // @ts-ignore\n input = str[s + '_value'] || str['other_value'];\n } else if(str._ === 'langPackString') {\n input = str.value;\n } else {\n // input = '[' + key + ']';\n input = key;\n }\n } else {\n // input = '[' + key + ']';\n input = key;\n }\n\n const result = superFormatter(input, args);\n if(plain) { // * let's try a hack now... (don't want to replace []() entity)\n return result.map((item) => item instanceof Node ? item.textContent : item).join('');\n } else {\n return result;\n }\n\n /* if(plain) {\n if(args?.length) {\n const regExp = /un\\d|%\\d\\$.|%./g;\n let i = 0;\n input = input.replace(regExp, (match, offset, string) => {\n return '' + args[i++];\n });\n }\n\n return input;\n } else {\n return superFormatter(input, args);\n } */\n }\n\n export const weakMap: WeakMap> = new WeakMap();\n\n export type IntlElementBaseOptions = {\n element?: HTMLElement,\n property?: 'innerText' | 'innerHTML' | 'placeholder' | 'textContent',\n };\n\n abstract class IntlElementBase {\n public element: IntlElementBaseOptions['element'];\n public property: IntlElementBaseOptions['property'];\n\n constructor(options?: Options) {\n this.element = options?.element || document.createElement('span');\n this.element.classList.add('i18n');\n\n this.property = options?.property;\n if(options && ((options as any as IntlElementOptions).key || (options as any as IntlDateElementOptions).date)) {\n this.update(options);\n }\n\n weakMap.set(this.element, this);\n }\n\n abstract update(options?: Options): void;\n }\n\n export type IntlElementOptions = IntlElementBaseOptions & {\n key?: LangPackKey,\n args?: FormatterArguments\n };\n export class IntlElement extends IntlElementBase {\n public key: IntlElementOptions['key'];\n public args: IntlElementOptions['args'];\n\n constructor(options: IntlElementOptions = {}) {\n super({...options, property: options.property ?? 'innerHTML'});\n }\n\n public update(options?: IntlElementOptions) {\n safeAssign(this, options);\n\n if(this.property === 'innerHTML') {\n this.element.textContent = '';\n this.element.append(...format(this.key, false, this.args) as any);\n } else {\n // @ts-ignore\n const v = this.element[this.property];\n const formatted = format(this.key, true, this.args);\n\n // * hasOwnProperty won't work here\n if(v === undefined) this.element.dataset[this.property] = formatted;\n else (this.element as HTMLInputElement)[this.property] = formatted;\n }\n }\n\n public compareAndUpdate(options?: IntlElementOptions) {\n if(this.key === options.key && deepEqual(this.args, options.args)) {\n return;\n }\n\n return this.update(options);\n }\n }\n\n const cachedDateTimeFormats: Map = new Map();\n function getDateTimeFormat(options: Intl.DateTimeFormatOptions = {}) {\n const json = JSON.stringify(options);\n let dateTimeFormat = cachedDateTimeFormats.get(json);\n if(!dateTimeFormat) {\n dateTimeFormat = new Intl.DateTimeFormat(lastRequestedNormalizedLangCode + '-u-hc-' + timeFormat, options);\n cachedDateTimeFormats.set(json, dateTimeFormat);\n }\n\n return dateTimeFormat;\n }\n\n export let amPmCache = {am: 'AM', pm: 'PM'};\n export type IntlDateElementOptions = IntlElementBaseOptions & {\n date?: Date,\n options: Intl.DateTimeFormatOptions\n };\n export class IntlDateElement extends IntlElementBase {\n public date: IntlDateElementOptions['date'];\n public options: IntlDateElementOptions['options'];\n\n constructor(options: IntlDateElementOptions) {\n super({...options, property: options.property ?? 'textContent'});\n setDirection(this.element);\n }\n\n public update(options?: IntlDateElementOptions) {\n safeAssign(this, options);\n\n let text: string;\n if(this.options.hour && this.options.minute && Object.keys(this.options).length === 2/* && false */) {\n const hours = this.date.getHours();\n text = ('0' + (timeFormat === 'h12' ? (hours % 12) || 12 : hours)).slice(-2) + ':' + ('0' + this.date.getMinutes()).slice(-2);\n // if(this.options.second) {\n // text += ':' + ('0' + this.date.getSeconds()).slice(-2);\n // }\n\n if(timeFormat === 'h12') {\n text += ' ' + (hours < 12 ? amPmCache.am : amPmCache.pm);\n }\n } else {\n // * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle#adding_an_hour_cycle_via_the_locale_string\n const dateTimeFormat = getDateTimeFormat(this.options);\n text = capitalizeFirstLetter(dateTimeFormat.format(this.date));\n }\n\n (this.element as any)[this.property] = text;\n }\n }\n\n export function i18n(key: LangPackKey, args?: FormatterArguments) {\n return new IntlElement({key, args}).element;\n }\n\n export function i18n_(options: IntlElementOptions) {\n return new IntlElement(options).element;\n }\n\n export function _i18n(element: HTMLElement, key: LangPackKey, args?: FormatterArguments, property?: IntlElementOptions['property']) {\n return new IntlElement({element, key, args, property}).element;\n }\n}\n\nexport {I18n};\nexport default I18n;\n\nconst i18n = I18n.i18n;\nexport {i18n};\n\nconst i18n_ = I18n.i18n_;\nexport {i18n_};\n\nconst _i18n = I18n._i18n;\nexport {_i18n};\n\nexport function joinElementsWith(elements: (Node | string)[], joiner: typeof elements[0] | ((isLast: boolean) => typeof elements[0])) {\n const arr = elements.slice(0, 1);\n for(let i = 1; i < elements.length; ++i) {\n const isLast = (elements.length - 1) === i;\n arr.push(typeof(joiner) === 'function' ? joiner(isLast) : joiner);\n arr.push(elements[i]);\n }\n\n return arr;\n}\n\n\nexport function join(elements: (Node | string)[], useLast: boolean, plain: true): string;\nexport function join(elements: (Node | string)[], useLast?: boolean, plain?: false): (string | Node)[];\nexport function join(elements: (Node | string)[], useLast: boolean, plain: boolean): string | (string | Node)[];\nexport function join(elements: (Node | string)[], useLast = true, plain?: boolean): string | (string | Node)[] {\n const joined = joinElementsWith(elements, (isLast) => {\n const langPackKey: LangPackKey = isLast && useLast ? 'AutoDownloadSettings.LastDelimeter' : 'AutoDownloadSettings.Delimeter';\n return plain ? I18n.format(langPackKey, true) : i18n(langPackKey);\n });\n\n return plain ? joined.join('') : joined;\n}\n\nMOUNT_CLASS_TO.I18n = I18n;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDialogFilter} from '../storages/filters';\n\n/**\n * Legacy Webogram's format, don't change dcID to camelCase. date is timestamp\n */\nexport type UserAuth = {dcID: number | string, date: number, id: PeerId};\nexport type REAL_FOLDER_ID = 0 | 1;\n\nexport const NULL_PEER_ID: PeerId = 0;\nexport const REPLIES_PEER_ID: PeerId = 1271266957;\nexport const REPLIES_HIDDEN_CHANNEL_ID: ChatId = 777;\nexport const SERVICE_PEER_ID: PeerId = 777000;\nexport const MUTE_UNTIL = 0x7FFFFFFF;\nexport const BOT_START_PARAM = '';\nexport const MAX_FILE_SAVE_SIZE = 20 * 1024 * 1024;\nexport const THUMB_TYPE_FULL = '';\nexport const TOPIC_COLORS = [0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, 0xFB6F5F];\nexport const ATTACH_MENU_BOT_ICON_NAME = 'default_static';\nexport const GENERAL_TOPIC_ID = 4295032831;\nexport const T_ME_PREFIXES = new Set(['web', 'k', 'z']);\n\nexport const FOLDER_ID_ALL: REAL_FOLDER_ID = 0;\nexport const FOLDER_ID_ARCHIVE: REAL_FOLDER_ID = 1;\nexport const REAL_FOLDERS: Set = new Set([FOLDER_ID_ALL, FOLDER_ID_ARCHIVE]);\nexport const START_LOCAL_ID = Math.max(...Array.from(REAL_FOLDERS)) + 1 as MyDialogFilter['localId'];\n","import IS_CALL_SUPPORTED from './callSupport';\nimport CAN_USE_TRANSFERABLES from './canUseTransferables';\nimport IS_CANVAS_FILTER_SUPPORTED from './canvasFilterSupport';\nimport IS_EMOJI_SUPPORTED from './emojiSupport';\nimport IS_GEOLOCATION_SUPPORTED from './geolocationSupport';\nimport IS_GROUP_CALL_SUPPORTED from './groupCallSupport';\nimport IMAGE_MIME_TYPES_SUPPORTED from './imageMimeTypesSupport';\nimport MEDIA_MIME_TYPES_SUPPORTED from './mediaMimeTypesSupport';\nimport IS_MOV_SUPPORTED from './movSupport';\nimport IS_PARALLAX_SUPPORTED from './parallaxSupport';\nimport IS_SCREEN_SHARING_SUPPORTED from './screenSharingSupport';\nimport IS_TOUCH_SUPPORTED from './touchSupport';\nimport IS_VIBRATE_SUPPORTED from './vibrateSupport';\nimport VIDEO_MIME_TYPES_SUPPORTED from './videoMimeTypesSupport';\nimport IS_WEBM_SUPPORTED from './webmSupport';\nimport IS_WEBP_SUPPORTED from './webpSupport';\nimport IS_WEBRTC_SUPPORTED from './webrtcSupport';\nimport * as userAgent from './userAgent';\nimport IS_OPUS_SUPPORTED from './opusSupport';\nimport IS_SHARED_WORKER_SUPPORTED from './sharedWorkerSupport';\nimport IS_APPLE_MX from './appleMx';\n\nconst ENVIRONMENT = {\n CAN_USE_TRANSFERABLES,\n IS_APPLE_MX,\n IS_CALL_SUPPORTED,\n IS_CANVAS_FILTER_SUPPORTED,\n IS_EMOJI_SUPPORTED,\n IS_GEOLOCATION_SUPPORTED,\n IS_GROUP_CALL_SUPPORTED,\n IS_MOV_SUPPORTED,\n IS_PARALLAX_SUPPORTED,\n IS_SCREEN_SHARING_SUPPORTED,\n IS_TOUCH_SUPPORTED,\n IS_VIBRATE_SUPPORTED,\n IS_OPUS_SUPPORTED,\n IS_SHARED_WORKER_SUPPORTED,\n IS_WEBM_SUPPORTED,\n IS_WEBP_SUPPORTED,\n IS_WEBRTC_SUPPORTED,\n IMAGE_MIME_TYPES_SUPPORTED,\n MEDIA_MIME_TYPES_SUPPORTED,\n VIDEO_MIME_TYPES_SUPPORTED,\n ...userAgent\n};\n\nexport default ENVIRONMENT;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport App from '../../../../config/app';\nimport DEBUG from '../../../../config/debug';\nimport {AutoDownloadPeerTypeSettings, State, STATE_INIT, Background, AppTheme} from '../../../../config/state';\nimport compareVersion from '../../../../helpers/compareVersion';\nimport copy from '../../../../helpers/object/copy';\nimport validateInitObject from '../../../../helpers/object/validateInitObject';\nimport {UserAuth} from '../../../mtproto/mtproto_config';\nimport rootScope from '../../../rootScope';\nimport stateStorage from '../../../stateStorage';\nimport sessionStorage from '../../../sessionStorage';\nimport {recordPromiseBound} from '../../../../helpers/recordPromise';\n// import RESET_STORAGES_PROMISE from \"../storages/resetStoragesPromise\";\nimport {StoragesResults} from '../storages/loadStorages';\nimport {logger} from '../../../logger';\nimport {WallPaper} from '../../../../layer';\n\nconst REFRESH_EVERY = 24 * 60 * 60 * 1000; // 1 day\n// const REFRESH_EVERY = 1e3;\n// const REFRESH_EVERY_WEEK = 24 * 60 * 60 * 1000 * 7; // 7 days\n\nconst STATE_VERSION = STATE_INIT.version;\nconst BUILD = STATE_INIT.build;\n\nconst ALL_KEYS = Object.keys(STATE_INIT) as any as Array;\n\nconst REFRESH_KEYS: Array = [\n 'contactsListCachedTime',\n 'stateCreatedTime',\n 'maxSeenMsgId',\n 'filtersArr'\n];\n\n// const REFRESH_KEYS_WEEK = ['dialogs', 'allDialogsLoaded', 'updates', 'pinnedOrders'] as any as Array;\n\nasync function loadStateInner() {\n const log = logger('STATE-LOADER');\n\n const totalPerf = performance.now();\n const recordPromise = recordPromiseBound(log);\n\n const promises = ALL_KEYS.map((key) => recordPromise(stateStorage.get(key), 'state ' + key))\n .concat(\n recordPromise(sessionStorage.get('user_auth'), 'auth'),\n recordPromise(sessionStorage.get('state_id'), 'auth'),\n recordPromise(sessionStorage.get('k_build'), 'auth')\n )\n .concat(recordPromise(stateStorage.get('user_auth'), 'old auth')); // support old webk format\n\n const arr = await Promise.all(promises);\n log.warn('promises', performance.now() - totalPerf);\n // await new Promise((resolve) => setTimeout(resolve, 3e3));\n /* const self = this;\n const skipHandleKeys = new Set(['isProxy', 'filters', 'drafts']);\n const getHandler = (path?: string) => {\n return {\n get(target: any, key: any) {\n if(key === 'isProxy') {\n return true;\n }\n\n const prop = target[key];\n\n if(prop !== undefined && !skipHandleKeys.has(key) && !prop.isProxy && typeof(prop) === 'object') {\n target[key] = new Proxy(prop, getHandler(path || key));\n return target[key];\n }\n\n return prop;\n },\n set(target: any, key: any, value: any) {\n console.log('Setting', target, `.${key} to equal`, value, path);\n\n target[key] = value;\n\n // @ts-ignore\n self.pushToState(path || key, path ? self.state[path] : value, false);\n\n return true;\n }\n };\n }; */\n\n // const pushed: {key: keyof State, value: State[keyof State]}[] = [];\n const pushedKeys: (keyof State)[] = [];\n const pushToState = (key: T, value: State[T]) => {\n // appStateManager.pushToState(key, value);\n state[key] = value;\n // pushed.push({key, value});\n pushedKeys.push(key);\n };\n\n const replaceState = (_state: State) => {\n // pushed.length = 0;\n pushedKeys.length = 0;\n state = _state;\n pushedKeys.push(...Object.keys(state) as any as typeof pushedKeys);\n // state = appStateManager.setState(_state);\n // appStateManager.storage.set(state);\n };\n\n // let state: State = appStateManager.setState({} as any);\n let state: State = {} as any;\n\n // ! then can't store false values\n for(let i = 0, length = ALL_KEYS.length; i < length; ++i) {\n const key = ALL_KEYS[i];\n const value = arr[i];\n if(value !== undefined) {\n // @ts-ignore\n state[key] = value;\n } else {\n pushToState(key, copy(STATE_INIT[key]));\n }\n }\n\n arr.splice(0, ALL_KEYS.length);\n\n // * Read auth\n let auth = arr.shift() as UserAuth | number;\n const stateId = arr.shift() as number;\n const sessionBuild = arr.shift() as number;\n const shiftedWebKAuth = arr.shift() as UserAuth | number;\n if(!auth && shiftedWebKAuth) { // support old webk auth\n auth = shiftedWebKAuth;\n const keys: string[] = ['dc', 'server_time_offset', 'xt_instance'];\n for(let i = 1; i <= 5; ++i) {\n keys.push(`dc${i}_server_salt`);\n keys.push(`dc${i}_auth_key`);\n }\n\n const values = await Promise.all(keys.map((key) => stateStorage.get(key as any)));\n keys.push('user_auth');\n values.push(typeof(auth) === 'number' || typeof(auth) === 'string' ? {dcID: values[0] || App.baseDcId, date: Date.now() / 1000 | 0, id: auth.toPeerId(false)} as UserAuth : auth);\n\n const obj: any = {};\n keys.forEach((key, idx) => {\n obj[key] = values[idx];\n });\n\n await sessionStorage.set(obj);\n }\n\n /* if(!auth) { // try to read Webogram's session from localStorage\n try {\n const keys = Object.keys(localStorage);\n for(let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n let value: any;\n try {\n value = localStorage.getItem(key);\n value = JSON.parse(value);\n } catch(err) {\n //console.error(err);\n }\n\n sessionStorage.set({\n [key as any]: value\n });\n }\n\n auth = sessionStorage.getFromCache('user_auth');\n } catch(err) {\n this.log.error('localStorage import error', err);\n }\n } */\n\n if(auth) {\n // ! Warning ! DON'T delete this\n state.authState = {_: 'authStateSignedIn'};\n rootScope.dispatchEvent('user_auth', typeof(auth) === 'number' || typeof(auth) === 'string' ?\n {dcID: 0, date: Date.now() / 1000 | 0, id: auth.toPeerId(false)} :\n auth); // * support old version\n }\n\n const resetStorages: Set = new Set();\n if(state.stateId !== stateId) {\n if(stateId !== undefined) {\n const preserve: Map = new Map([\n ['authState', undefined],\n ['stateId', undefined]\n ]);\n\n preserve.forEach((_, key) => {\n preserve.set(key, copy(state[key]));\n });\n\n state = copy(STATE_INIT);\n\n preserve.forEach((value, key) => {\n // @ts-ignore\n state[key] = value;\n });\n\n const r: {[k in keyof StoragesResults]: number} = {\n chats: 1,\n dialogs: 1,\n users: 1\n };\n for(const key in r) {\n resetStorages.add(key as keyof StoragesResults);\n // this.storagesResults[key as keyof AppStateManager['storagesResults']].length = 0;\n }\n\n replaceState(state);\n }\n\n await sessionStorage.set({\n state_id: state.stateId\n });\n }\n\n const time = Date.now();\n if((state.stateCreatedTime + REFRESH_EVERY) < time) {\n if(DEBUG) {\n log('will refresh state', state.stateCreatedTime, time);\n }\n\n const r = (keys: typeof REFRESH_KEYS) => {\n keys.forEach((key) => {\n pushToState(key, copy(STATE_INIT[key]));\n\n // const s = appStateManager.storagesResults[key as keyof AppStateManager['storagesResults']];\n // if(s?.length) {\n // appStateManager.resetStorages.add(key as keyof AppStateManager['storagesResults']);\n // s.length = 0;\n // }\n });\n };\n\n r(REFRESH_KEYS);\n\n /* if((state.stateCreatedTime + REFRESH_EVERY_WEEK) < time) {\n if(DEBUG) {\n this.log('will refresh updates');\n }\n\n r(REFRESH_KEYS_WEEK);\n } */\n }\n\n // state = this.state = new Proxy(state, getHandler());\n\n // * migrate auto download settings\n const autoDownloadSettings = state.settings.autoDownload;\n if(autoDownloadSettings?.private !== undefined) {\n const oldTypes = [\n 'contacts' as const,\n 'private' as const,\n 'groups' as const,\n 'channels' as const\n ];\n\n const mediaTypes = [\n 'photo' as const,\n 'video' as const,\n 'file' as const\n ];\n\n mediaTypes.forEach((mediaType) => {\n const peerTypeSettings: AutoDownloadPeerTypeSettings = autoDownloadSettings[mediaType] = {} as any;\n oldTypes.forEach((peerType) => {\n peerTypeSettings[peerType] = autoDownloadSettings[peerType];\n });\n });\n\n oldTypes.forEach((peerType) => {\n delete autoDownloadSettings[peerType];\n });\n\n pushToState('settings', state.settings);\n }\n\n const SKIP_VALIDATING_PATHS: Set = new Set([\n 'settings.themes'\n ]);\n validateInitObject(STATE_INIT, state, (missingKey) => {\n pushToState(missingKey as keyof State, state[missingKey as keyof State]);\n }, undefined, SKIP_VALIDATING_PATHS);\n\n let newVersion: string, oldVersion: string;\n if(state.version !== STATE_VERSION || state.build !== BUILD/* || true */) {\n // reset filters and dialogs if version is older\n if(/* compareVersion(state.version, '0.8.7') === -1 || state.build < 179 || */state.build < 217) {\n state.allDialogsLoaded = copy(STATE_INIT.allDialogsLoaded);\n state.pinnedOrders = copy(STATE_INIT.pinnedOrders);\n state.filtersArr = copy(STATE_INIT.filtersArr);\n\n resetStorages.add('dialogs');\n }\n\n if(compareVersion(state.version, '1.7.1') === -1) {\n let migrated = false;\n // * migrate backgrounds (March 13, 2022; to version 1.3.0)\n if(compareVersion(state.version, '1.3.0') === -1) {\n migrated = true;\n state.settings.theme = copy(STATE_INIT.settings.theme);\n state.settings.themes = copy(STATE_INIT.settings.themes);\n } else if(compareVersion(state.version, '1.7.1') === -1) { // * migrate backgrounds (January 25th, 2023; to version 1.7.1)\n migrated = true;\n const oldThemes = state.settings.themes as any as Array<{\n name: AppTheme['name'],\n background: Background\n }>;\n\n state.settings.themes = copy(STATE_INIT.settings.themes);\n\n try {\n oldThemes.forEach((oldTheme) => {\n const oldBackground = oldTheme.background;\n if(!oldBackground) {\n return;\n }\n\n const newTheme = state.settings.themes.find((t) => t.name === oldTheme.name);\n newTheme.settings.highlightningColor = oldBackground.highlightningColor;\n\n const getColorFromHex = (hex: string) => hex && parseInt(hex.slice(1), 16);\n\n const colors = (oldBackground.color || '').split(',').map(getColorFromHex);\n\n if(oldBackground.color && !oldBackground.slug) {\n newTheme.settings.wallpaper = {\n _: 'wallPaperNoFile',\n id: 0,\n pFlags: {},\n settings: {\n _: 'wallPaperSettings',\n pFlags: {}\n }\n };\n } else {\n const wallPaper: WallPaper.wallPaper = {\n _: 'wallPaper',\n id: 0,\n access_hash: 0,\n slug: oldBackground.slug,\n document: {} as any,\n pFlags: {},\n settings: {\n _: 'wallPaperSettings',\n pFlags: {}\n }\n };\n\n const wallPaperSettings = wallPaper.settings;\n newTheme.settings.wallpaper = wallPaper;\n if(oldBackground.slug && !oldBackground.color) {\n wallPaperSettings.pFlags.blur = oldBackground.blur || undefined;\n } else if(oldBackground.intensity) {\n wallPaperSettings.intensity = oldBackground.intensity;\n wallPaper.pFlags.pattern = true;\n wallPaper.pFlags.dark = oldBackground.intensity < 0 || undefined;\n }\n }\n\n if(colors.length) {\n const wallPaperSettings = newTheme.settings.wallpaper.settings;\n wallPaperSettings.background_color = colors[0];\n wallPaperSettings.second_background_color = colors[1];\n wallPaperSettings.third_background_color = colors[2];\n wallPaperSettings.fourth_background_color = colors[3];\n }\n });\n } catch(err) {\n console.error('migrating themes error', err);\n }\n }\n\n if(migrated) {\n pushToState('settings', state.settings);\n }\n }\n\n if(state.build < 309) {\n state.settings.liteMode.animations = !state.settings.animationsEnabled;\n state.settings.liteMode.video = !state.settings.autoPlay.videos;\n state.settings.liteMode.gif = !state.settings.autoPlay.gifs;\n }\n\n if(state.build < 312 && typeof(state.settings.stickers.suggest) === 'boolean') {\n state.settings.stickers.suggest = state.settings.stickers.suggest ? 'all' : 'none';\n }\n\n if(compareVersion(state.version, STATE_VERSION) !== 0) {\n newVersion = STATE_VERSION;\n oldVersion = state.version;\n }\n\n pushToState('version', STATE_VERSION);\n pushToState('build', BUILD);\n }\n\n if(sessionBuild !== BUILD && (!sessionBuild || sessionBuild < BUILD)) {\n sessionStorage.set({k_build: BUILD});\n }\n\n // ! probably there is better place for it\n rootScope.settings = state.settings;\n\n if(DEBUG) {\n log('state res', state, copy(state));\n }\n\n // return resolve();\n\n log.warn('total', performance.now() - totalPerf);\n\n // RESET_STORAGES_PROMISE.resolve(appStateManager.resetStorages);\n\n return {state, resetStorages, newVersion, oldVersion, pushedKeys};\n}\n\nlet promise: ReturnType;\nexport default function loadState() {\n return promise ??= loadStateInner();\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Awaited} from '../../types';\nimport type {CacheStorageDbName} from '../files/cacheStorage';\nimport type {State} from '../../config/state';\nimport type {Message, MessagePeerReaction, PeerNotifySettings} from '../../layer';\nimport {CryptoMethods} from '../crypto/crypto_methods';\nimport rootScope from '../rootScope';\nimport webpWorkerController from '../webp/webpWorkerController';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport sessionStorage from '../sessionStorage';\nimport webPushApiManager from './webPushApiManager';\nimport appRuntimeManager from '../appManagers/appRuntimeManager';\nimport telegramMeWebManager from './telegramMeWebManager';\nimport pause from '../../helpers/schedulers/pause';\nimport ENVIRONMENT from '../../environment';\nimport loadState from '../appManagers/utils/state/loadState';\nimport opusDecodeController from '../opusDecodeController';\nimport MTProtoMessagePort from './mtprotoMessagePort';\nimport cryptoMessagePort from '../crypto/cryptoMessagePort';\nimport SuperMessagePort from './superMessagePort';\nimport IS_SHARED_WORKER_SUPPORTED from '../../environment/sharedWorkerSupport';\nimport toggleStorages from '../../helpers/toggleStorages';\nimport idleController from '../../helpers/idleController';\nimport ServiceMessagePort from '../serviceWorker/serviceMessagePort';\nimport App from '../../config/app';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\n\nexport type Mirrors = {\n state: State\n};\n\nexport type MirrorTaskPayload = {\n name: T,\n key?: K,\n value: any\n};\n\nexport type NotificationBuildTaskPayload = {\n message: Message.message | Message.messageService,\n fwdCount?: number,\n peerReaction?: MessagePeerReaction,\n peerTypeNotifySettings?: PeerNotifySettings\n};\n\nexport type TabState = {\n chatPeerIds: PeerId[],\n idleStartTime: number,\n};\n\nclass ApiManagerProxy extends MTProtoMessagePort {\n // private worker: /* Window */Worker;\n // private sockets: Map = new Map();\n private mirrors: Mirrors;\n\n public newVersion: string;\n public oldVersion: string;\n\n private tabState: TabState;\n\n public share: ShareData;\n\n public serviceMessagePort: ServiceMessagePort;\n private lastServiceWorker: ServiceWorker;\n\n private pingServiceWorkerPromise: CancellablePromise;\n\n constructor() {\n super();\n\n this.mirrors = {} as any;\n this.tabState = {\n chatPeerIds: [],\n idleStartTime: 0\n };\n\n this.log('constructor');\n\n \n this.registerWorker();\n \n\n this.registerServiceWorker();\n this.registerCryptoWorker();\n\n // const perf = performance.now();\n this.addMultipleEventsListeners({\n convertWebp: ({fileName, bytes}) => {\n return webpWorkerController.convert(fileName, bytes);\n },\n\n convertOpus: ({fileName, bytes}) => {\n return opusDecodeController.pushDecodeTask(bytes, false).then((result) => result.bytes);\n },\n\n event: ({name, args}) => {\n // @ts-ignore\n rootScope.dispatchEventSingle(name, ...args);\n },\n\n localStorageProxy: (payload) => {\n const storageTask = payload;\n return (sessionStorage[storageTask.type] as any)(...storageTask.args);\n },\n\n mirror: this.onMirrorTask\n\n // hello: () => {\n // this.log.error('time hello', performance.now() - perf);\n // }\n });\n\n // this.addTaskListener('socketProxy', (task) => {\n // const socketTask = task.payload;\n // const id = socketTask.id;\n // //console.log('socketProxy', socketTask, id);\n\n // if(socketTask.type === 'send') {\n // const socket = this.sockets.get(id);\n // socket.send(socketTask.payload);\n // } else if(socketTask.type === 'close') { // will remove from map in onClose\n // const socket = this.sockets.get(id);\n // socket.close();\n // } else if(socketTask.type === 'setup') {\n // const socket = new Socket(socketTask.payload.dcId, socketTask.payload.url, socketTask.payload.logSuffix);\n\n // const onOpen = () => {\n // //console.log('socketProxy onOpen');\n // this.postMessage({\n // type: 'socketProxy',\n // payload: {\n // type: 'open',\n // id\n // }\n // });\n // };\n // const onClose = () => {\n // this.postMessage({\n // type: 'socketProxy',\n // payload: {\n // type: 'close',\n // id\n // }\n // });\n\n // socket.removeEventListener('open', onOpen);\n // socket.removeEventListener('close', onClose);\n // socket.removeEventListener('message', onMessage);\n // this.sockets.delete(id);\n // };\n // const onMessage = (buffer: ArrayBuffer) => {\n // this.postMessage({\n // type: 'socketProxy',\n // payload: {\n // type: 'message',\n // id,\n // payload: buffer\n // }\n // });\n // };\n\n // socket.addEventListener('open', onOpen);\n // socket.addEventListener('close', onClose);\n // socket.addEventListener('message', onMessage);\n // this.sockets.set(id, socket);\n // }\n // });\n\n rootScope.addEventListener('language_change', (language) => {\n rootScope.managers.networkerFactory.setLanguage(language);\n });\n\n window.addEventListener('online', () => {\n rootScope.managers.networkerFactory.forceReconnectTimeout();\n });\n\n rootScope.addEventListener('logging_out', () => {\n const toClear: CacheStorageDbName[] = ['cachedFiles', 'cachedStreamChunks'];\n Promise.all([\n toggleStorages(false, true),\n sessionStorage.clear(),\n Promise.race([\n telegramMeWebManager.setAuthorized(false),\n pause(3000)\n ]),\n webPushApiManager.forceUnsubscribe(),\n Promise.all(toClear.map((cacheName) => caches.delete(cacheName)))\n ]).finally(() => {\n appRuntimeManager.reload();\n });\n });\n\n idleController.addEventListener('change', (idle) => {\n this.updateTabStateIdle(idle);\n });\n this.updateTabStateIdle(idleController.isIdle);\n\n this.log('Passing environment:', ENVIRONMENT);\n this.invoke('environment', ENVIRONMENT);\n // this.sendState();\n }\n\n public pingServiceWorkerWithIframe() {\n if(this.pingServiceWorkerPromise) {\n return this.pingServiceWorkerPromise;\n }\n\n const promise = this.pingServiceWorkerPromise = deferredPromise();\n const iframe = document.createElement('iframe');\n iframe.hidden = true;\n const onLoad = () => {\n setTimeout(() => { // ping once in 10 seconds\n this.pingServiceWorkerPromise = undefined;\n }, 10e3);\n\n clearTimeout(timeout);\n iframe.remove();\n iframe.removeEventListener('load', onLoad);\n iframe.removeEventListener('error', onLoad);\n promise.resolve();\n };\n iframe.addEventListener('load', onLoad);\n iframe.addEventListener('error', onLoad);\n iframe.src = 'ping/' + (Math.random() * 0xFFFFFFFF | 0);\n document.body.append(iframe);\n\n const timeout = window.setTimeout(onLoad, 1e3);\n return promise;\n }\n\n private attachServiceWorker(serviceWorker: ServiceWorker) {\n this.lastServiceWorker && this.serviceMessagePort.detachPort(this.lastServiceWorker);\n this.serviceMessagePort.attachSendPort(this.lastServiceWorker = serviceWorker);\n this.serviceMessagePort.invokeVoid('hello', undefined);\n }\n\n private _registerServiceWorker() {\n navigator.serviceWorker.register(\n /* webpackChunkName: \"sw\" */\n new URL('../serviceWorker/index.service', import.meta.url),\n {scope: './'}\n ).then((registration) => {\n this.log('SW registered', registration);\n\n // ! doubtful fix for hard refresh\n if(registration.active && !navigator.serviceWorker.controller) {\n return registration.unregister().then(() => {\n window.location.reload();\n });\n }\n\n const sw = registration.installing || registration.waiting || registration.active;\n sw.addEventListener('statechange', (e) => {\n this.log('SW statechange', e);\n });\n\n const controller = navigator.serviceWorker.controller || registration.installing || registration.waiting || registration.active;\n this.attachServiceWorker(controller);\n\n \n \n \n }, (err) => {\n this.log.error('SW registration failed!', err);\n\n this.invokeVoid('serviceWorkerOnline', false);\n });\n }\n\n private registerServiceWorker() {\n if(!('serviceWorker' in navigator)) return;\n\n this.serviceMessagePort = new ServiceMessagePort();\n\n // this.addMultipleEventsListeners({\n // hello: () => {\n // // this.serviceMessagePort.invokeVoid('port', undefined);\n // }\n // });\n\n // ! I hate webpack - it won't load it by using worker.register, only navigator.serviceWorker will do it.\n const worker = navigator.serviceWorker;\n this._registerServiceWorker();\n\n // worker.startMessages();\n\n worker.addEventListener('controllerchange', () => {\n this.log.warn('controllerchange');\n\n const controller = worker.controller;\n this.attachServiceWorker(controller);\n\n controller.addEventListener('error', (e) => {\n this.log.error('controller error:', e);\n });\n });\n\n \n \n \n this.serviceMessagePort.attachListenPort(worker);\n this.serviceMessagePort.addMultipleEventsListeners({\n port: (payload, source, event) => {\n this.invokeVoid('serviceWorkerPort', undefined, undefined, [event.ports[0]]);\n },\n\n hello: (payload, source) => {\n this.serviceMessagePort.resendLockTask(source);\n },\n\n share: (payload) => {\n this.log('will try to share something');\n this.share = payload;\n }\n });\n \n\n worker.addEventListener('messageerror', (e) => {\n this.log.error('SW messageerror:', e);\n });\n }\n\n private async registerCryptoWorker() {\n const get = (url: string) => {\n return fetch(url).then((response) => response.text()).then((text) => {\n const pathnameSplitted = location.pathname.split('/');\n pathnameSplitted[pathnameSplitted.length - 1] = '';\n const pre = location.origin + pathnameSplitted.join('/');\n text = `\n var originalImportScripts = importScripts; \n importScripts = (url) => {\n console.log('importScripts', url);\n var newUrl = '${pre}' + url.split('/').pop();\n return originalImportScripts(newUrl);\n };\n ${text}`;\n const blob = new Blob([text], {type: 'application/javascript'});\n return blob;\n });\n };\n\n const workerHandler = {\n construct(target: any, args: any): any {\n const url = args[0] + location.search;\n return {url};\n }\n };\n\n const originals = [\n Worker,\n typeof(SharedWorker) !== 'undefined' && SharedWorker\n ].filter(Boolean);\n originals.forEach((w) => window[w.name as any] = new Proxy(w, workerHandler));\n\n const worker: SharedWorker | Worker = new Worker(\n /* webpackChunkName: \"crypto.worker\" */\n new URL('../crypto/crypto.worker.ts', import.meta.url),\n {type: 'module'}\n );\n\n originals.forEach((w) => window[w.name as any] = w as any);\n\n const originalUrl = (worker as any).url;\n\n const createWorker = (url: string) => new constructor(url, {type: 'module'});\n const attachWorkerToPort = (worker: SharedWorker | Worker) => this.attachWorkerToPort(worker, cryptoMessagePort, 'crypto');\n const constructor = IS_SHARED_WORKER_SUPPORTED ? SharedWorker : Worker;\n\n // let cryptoWorkers = workers.length;\n cryptoMessagePort.addEventListener('port', (payload, source, event) => {\n this.invokeVoid('cryptoPort', undefined, undefined, [event.ports[0]]);\n // .then((attached) => {\n // if(!attached && cryptoWorkers-- > 1) {\n // this.log.error('terminating unneeded crypto worker');\n\n // cryptoMessagePort.invokeVoid('terminate', undefined, source);\n // const worker = workers.find((worker) => (worker as SharedWorker).port === source || (worker as any) === source);\n // if((worker as SharedWorker).port) (worker as SharedWorker).port.close();\n // else (worker as Worker).terminate();\n // cryptoMessagePort.detachPort(source);\n // }\n // });\n });\n\n const firstWorker = createWorker(originalUrl);\n attachWorkerToPort(firstWorker);\n\n const blob = await get(originalUrl);\n const urlsPromise = await this.invoke('createProxyWorkerURLs', {originalUrl, blob});\n const workers = urlsPromise.slice(1).map(createWorker);\n workers.forEach(attachWorkerToPort);\n }\n\n \n private registerWorker() {\n // return;\n\n let worker: SharedWorker | Worker;\n if(IS_SHARED_WORKER_SUPPORTED) {\n worker = new SharedWorker(\n /* webpackChunkName: \"mtproto.worker\" */\n new URL('./mtproto.worker.ts', import.meta.url),\n {type: 'module'}\n );\n } else {\n worker = new Worker(\n /* webpackChunkName: \"mtproto.worker\" */\n new URL('./mtproto.worker.ts', import.meta.url),\n {type: 'module'}\n );\n }\n\n this.onWorkerFirstMessage(worker);\n }\n \n\n private attachWorkerToPort(worker: SharedWorker | Worker, messagePort: SuperMessagePort, type: string) {\n const port: MessagePort = (worker as SharedWorker).port || worker as any;\n messagePort.attachPort(port);\n\n worker.addEventListener('error', (err) => {\n this.log.error(type, 'worker error', err);\n });\n }\n\n private onWorkerFirstMessage(worker: any) {\n this.log('set webWorker');\n\n // this.worker = worker;\n \n \n \n this.attachWorkerToPort(worker, this, 'mtproto');\n \n }\n\n private loadState() {\n return Promise.all([\n loadState().then((stateResult) => {\n this.newVersion = stateResult.newVersion;\n this.oldVersion = stateResult.oldVersion;\n this.mirrors['state'] = stateResult.state;\n return stateResult;\n })\n // loadStorages(createStorages()),\n ]);\n }\n\n public sendState() {\n return this.loadState().then((result) => {\n const [stateResult] = result;\n this.invoke('state', {...stateResult, userId: rootScope.myId.toUserId()});\n return result;\n });\n }\n\n \n public invokeCrypto(method: Method, ...args: Parameters): Promise>> {\n return cryptoMessagePort.invokeCrypto(method, ...args);\n }\n \n\n public async toggleStorages(enabled: boolean, clearWrite: boolean) {\n await toggleStorages(enabled, clearWrite);\n this.invoke('toggleStorages', {enabled, clearWrite});\n this.serviceMessagePort.invokeVoid('toggleStorages', {enabled, clearWrite});\n }\n\n public async getMirror(name: T) {\n const mirror = this.mirrors[name];\n return mirror;\n }\n\n public getState() {\n return this.getMirror('state');\n }\n\n public updateTabState(key: T, value: TabState[T]) {\n this.tabState[key] = value;\n this.invokeVoid('tabState', this.tabState);\n }\n\n public updateTabStateIdle(idle: boolean) {\n this.updateTabState('idleStartTime', idle ? Date.now() : 0);\n }\n\n private onMirrorTask = (payload: MirrorTaskPayload) => {\n const {name, key, value} = payload;\n if(!payload.hasOwnProperty('key')) {\n this.mirrors[name] = value;\n return;\n }\n\n const mirror = this.mirrors[name] ??= {} as any;\n if(value === undefined) {\n delete mirror[key];\n } else {\n mirror[key] = value;\n }\n };\n}\n\ninterface ApiManagerProxy extends MTProtoMessagePort {}\n\nconst apiManagerProxy = new ApiManagerProxy();\nMOUNT_CLASS_TO.apiManagerProxy = apiManagerProxy;\nexport default apiManagerProxy;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport App from '../../config/app';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport tabId from '../../config/tabId';\nimport IS_SHARED_WORKER_SUPPORTED from '../../environment/sharedWorkerSupport';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport idleController from '../../helpers/idleController';\nimport {logger} from '../logger';\nimport rootScope from '../rootScope';\nimport sessionStorage from '../sessionStorage';\nimport apiManagerProxy from './mtprotoworker';\n\nexport type AppInstance = {\n id: number,\n idle: boolean,\n time: number\n};\n\nexport type InstanceDeactivateReason = 'version' | 'tabs';\n\nconst CHECK_INSTANCE_INTERVAL = 5000;\nconst DEACTIVATE_TIMEOUT = 30000;\nconst MULTIPLE_TABS_THRESHOLD = 20000;\nconst IS_MULTIPLE_TABS_SUPPORTED = IS_SHARED_WORKER_SUPPORTED;\n\nexport class SingleInstance extends EventListenerBase<{\n activated: () => void,\n deactivated: (reason: InstanceDeactivateReason) => void\n}> {\n private instanceId: number;\n private started: boolean;\n private masterInstance: boolean;\n private deactivateTimeout: number;\n private deactivated: InstanceDeactivateReason;\n private log = logger('INSTANCE');\n\n constructor() {\n super(false);\n\n this.log = logger('INSTANCE');\n this.instanceId = tabId;\n }\n\n public get deactivatedReason() {\n return this.deactivated;\n }\n\n public start() {\n this.reset();\n\n if(!this.started/* && !Config.Navigator.mobile && !Config.Modes.packed */) {\n this.started = true;\n\n idleController.addEventListener('change', this.checkInstance);\n setInterval(this.checkInstance, CHECK_INSTANCE_INTERVAL);\n this.checkInstance();\n\n try {\n document.documentElement.addEventListener('beforeunload', this.clearInstance);\n } catch(e) {}\n }\n }\n\n private reset() {\n this.masterInstance = false;\n this.clearDeactivateTimeout();\n this.deactivated = undefined;\n }\n\n private clearInstance = () => {\n if(this.masterInstance && !this.deactivated) {\n this.log.warn('clear master instance');\n sessionStorage.delete('xt_instance');\n }\n };\n\n public activateInstance() {\n if(this.deactivated) {\n this.reset();\n this.checkInstance(false);\n this.dispatchEvent('activated');\n }\n }\n\n private deactivateInstance(reason: InstanceDeactivateReason) {\n if(this.masterInstance || this.deactivated) {\n return;\n }\n\n this.log.warn('deactivate', reason);\n this.clearDeactivateTimeout();\n this.deactivated = reason;\n\n this.dispatchEvent('deactivated', reason);\n }\n\n private clearDeactivateTimeout() {\n if(this.deactivateTimeout) {\n clearTimeout(this.deactivateTimeout);\n this.deactivateTimeout = 0;\n }\n }\n\n private checkInstance = async(idle = idleController.isIdle) => {\n if(this.deactivated) {\n return;\n }\n\n const time = Date.now();\n const newInstance: AppInstance = {\n id: this.instanceId,\n idle,\n time\n };\n\n const [curInstance, build = App.build] = await Promise.all([\n sessionStorage.get('xt_instance', false),\n sessionStorage.get('k_build', false)\n ]);\n\n if(build > App.build) {\n this.masterInstance = false;\n rootScope.managers.networkerFactory.stopAll();\n this.deactivateInstance('version');\n apiManagerProxy.toggleStorages(false, false);\n return;\n } else if(IS_MULTIPLE_TABS_SUPPORTED) {\n sessionStorage.set({xt_instance: newInstance});\n return;\n }\n\n // this.log('check instance', newInstance, curInstance)\n if(!idle ||\n !curInstance ||\n curInstance.id === this.instanceId ||\n curInstance.time < (time - MULTIPLE_TABS_THRESHOLD)) {\n sessionStorage.set({xt_instance: newInstance});\n\n if(!this.masterInstance) {\n this.masterInstance = true;\n rootScope.managers.networkerFactory.startAll();\n this.log.warn('now master instance', newInstance);\n }\n\n this.clearDeactivateTimeout();\n } else if(this.masterInstance) {\n this.masterInstance = false;\n rootScope.managers.networkerFactory.stopAll();\n this.log.warn('now idle instance', newInstance);\n this.deactivateTimeout ||= window.setTimeout(() => this.deactivateInstance('tabs'), DEACTIVATE_TIMEOUT);\n }\n };\n}\n\nconst singleInstance = new SingleInstance();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.singleInstance = singleInstance);\nexport default singleInstance;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport App from '../../config/app';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport Modes from '../../config/modes';\nimport loadScript from '../../helpers/dom/loadScript';\nimport tsNow from '../../helpers/tsNow';\nimport sessionStorage from '../sessionStorage';\n\nexport class TelegramMeWebManager {\n private disabled = /* false && */(Modes.test || !App.domains.includes(location.hostname));\n\n public setAuthorized(canRedirect: boolean) {\n if(this.disabled) {\n return;\n }\n\n return sessionStorage.get('tgme_sync').then((curValue) => {\n const ts = tsNow(true);\n if(\n canRedirect &&\n curValue?.canRedirect === canRedirect &&\n (curValue.ts + 86400) > ts\n ) {\n return;\n }\n\n sessionStorage.set({\n tgme_sync: {\n canRedirect,\n ts\n }\n });\n\n const path = `_websync_?authed=${canRedirect ? '1' : '0'}&version=${encodeURIComponent(App.version + ' ' + App.suffix)}`;\n const urls = [\n '//telegram.me/' + path,\n '//t.me/' + path\n ];\n\n const promises = urls.map((url) => {\n return loadScript(url).then((script) => {\n script.remove();\n });\n });\n\n return Promise.all(promises);\n });\n }\n}\n\nconst telegramMeWebManager = new TelegramMeWebManager();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.telegramMeWebManager = telegramMeWebManager);\nexport default telegramMeWebManager;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function loadScript(url: string) {\n const script = document.createElement('script');\n const promise = new Promise((resolve) => {\n script.onload = script.onerror = () => {\n resolve(script);\n };\n });\n script.src = url;\n document.body.appendChild(script);\n return promise;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {PushNotificationObject} from '../serviceWorker/push';\nimport type {ServicePushPingTaskPayload} from '../serviceWorker/serviceMessagePort';\nimport type {NotificationSettings} from '../appManagers/uiNotificationsManager';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport {logger} from '../logger';\nimport apiManagerProxy from './mtprotoworker';\nimport I18n, {LangPackKey} from '../langPack';\nimport {IS_MOBILE} from '../../environment/userAgent';\nimport appRuntimeManager from '../appManagers/appRuntimeManager';\nimport copy from '../../helpers/object/copy';\nimport singleInstance from './singleInstance';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport getServerMessageId from '../appManagers/utils/messageId/getServerMessageId';\n\nexport type PushSubscriptionNotifyType = 'init' | 'subscribe' | 'unsubscribe';\nexport type PushSubscriptionNotifyEvent = `push_${PushSubscriptionNotifyType}`;\n\nexport type PushSubscriptionNotify = {\n tokenType: number,\n tokenValue: string\n};\n\nconst PING_PUSH_INTERVAL = 10000;\n\nexport class WebPushApiManager extends EventListenerBase<{\n push_notification_click: (n: PushNotificationObject) => void,\n push_init: (n: PushSubscriptionNotify) => void,\n push_subscribe: (n: PushSubscriptionNotify) => void,\n push_unsubscribe: (n: PushSubscriptionNotify) => void\n}> {\n public isAvailable = true;\n private isPushEnabled = false;\n private localNotificationsAvailable = true;\n private started = false;\n private settings: NotificationSettings & {baseUrl?: string} = {} as any;\n private isAliveTO: any;\n private isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n private userVisibleOnly = this.isFirefox ? false : true;\n private log = logger('PM');\n\n constructor() {\n super(false);\n\n if(!('PushManager' in window) ||\n !('Notification' in window) ||\n !('serviceWorker' in navigator)) {\n this.log.warn('Push messaging is not supported.');\n this.isAvailable = false;\n this.localNotificationsAvailable = false;\n }\n\n if(this.isAvailable && Notification.permission === 'denied') {\n this.log.warn('The user has blocked notifications.');\n }\n }\n\n public start() {\n if(!this.started) {\n this.started = true;\n this.getSubscription();\n this.setUpServiceWorkerChannel();\n }\n }\n\n public setLocalNotificationsDisabled() {\n this.localNotificationsAvailable = false;\n }\n\n public getSubscription() {\n if(!this.isAvailable) {\n return;\n }\n\n navigator.serviceWorker.ready.then((reg) => {\n reg.pushManager.getSubscription().then((subscription) => {\n this.isPushEnabled = !!subscription;\n this.pushSubscriptionNotify('init', subscription);\n }).catch((err) => {\n this.log.error('Error during getSubscription()', err);\n });\n });\n }\n\n public subscribe = () => {\n if(!this.isAvailable) {\n return;\n }\n\n navigator.serviceWorker.ready.then((reg) => {\n reg.pushManager.subscribe({userVisibleOnly: this.userVisibleOnly}).then((subscription) => {\n // The subscription was successful\n this.isPushEnabled = true;\n this.pushSubscriptionNotify('subscribe', subscription);\n }).catch((e) => {\n if(Notification.permission === 'denied') {\n this.log('Permission for Notifications was denied');\n } else {\n this.log('Unable to subscribe to push.', e);\n if(!this.userVisibleOnly) {\n this.userVisibleOnly = true;\n setTimeout(this.subscribe, 0);\n }\n }\n });\n });\n }\n\n public unsubscribe() {\n if(!this.isAvailable) {\n return;\n }\n\n navigator.serviceWorker.ready.then((reg) => {\n reg.pushManager.getSubscription().then((subscription) => {\n this.isPushEnabled = false;\n\n if(subscription) {\n this.pushSubscriptionNotify('unsubscribe', subscription);\n\n setTimeout(() => {\n subscription.unsubscribe().then((successful) => {\n this.isPushEnabled = false;\n }).catch((e) => {\n this.log.error('Unsubscription error: ', e);\n });\n }, 3000);\n }\n }).catch((e) => {\n this.log.error('Error thrown while unsubscribing from ' +\n 'push messaging.', e);\n });\n });\n }\n\n public forceUnsubscribe() {\n if(!this.isAvailable) {\n return;\n }\n\n navigator.serviceWorker.ready.then((reg) => {\n reg.pushManager.getSubscription().then((subscription) => {\n this.log.warn('force unsubscribe', subscription);\n if(subscription) {\n subscription.unsubscribe().then((successful) => {\n this.log.warn('force unsubscribe successful', successful);\n this.isPushEnabled = false;\n }).catch((e) => {\n this.log.error('Unsubscription error: ', e);\n });\n }\n }).catch((e) => {\n this.log.error('Error thrown while unsubscribing from ' +\n 'push messaging.', e);\n });\n });\n }\n\n public isAliveNotify = () => {\n if(!this.isAvailable || singleInstance.deactivatedReason) {\n return;\n }\n\n this.settings.baseUrl = (location.href || '').replace(/#.*$/, '');\n\n const lang: ServicePushPingTaskPayload['lang'] = {} as any;\n const ACTIONS_LANG_MAP: Record = {\n push_action_mute1d: IS_MOBILE ? 'PushNotification.Action.Mute1d.Mobile' : 'PushNotification.Action.Mute1d',\n push_action_settings: IS_MOBILE ? 'PushNotification.Action.Settings.Mobile' : 'PushNotification.Action.Settings',\n push_message_nopreview: 'PushNotification.Message.NoPreview'\n };\n\n for(const action in ACTIONS_LANG_MAP) {\n lang[action as keyof typeof ACTIONS_LANG_MAP] = I18n.format(ACTIONS_LANG_MAP[action as keyof typeof ACTIONS_LANG_MAP], true);\n }\n\n apiManagerProxy.serviceMessagePort.invokeVoid('pushPing', {\n localNotifications: this.localNotificationsAvailable,\n lang: lang,\n settings: this.settings\n });\n\n this.isAliveTO = setTimeout(this.isAliveNotify, PING_PUSH_INTERVAL);\n }\n\n public setSettings(newSettings: WebPushApiManager['settings']) {\n this.settings = copy(newSettings);\n clearTimeout(this.isAliveTO);\n this.isAliveNotify();\n }\n\n public hidePushNotifications() {\n if(!this.isAvailable) {\n return;\n }\n\n apiManagerProxy.serviceMessagePort.invokeVoid('notificationsClear', undefined);\n }\n\n public setUpServiceWorkerChannel() {\n if(!this.isAvailable) {\n return;\n }\n\n apiManagerProxy.serviceMessagePort.addEventListener('pushClick', (payload) => {\n if(singleInstance.deactivatedReason) {\n appRuntimeManager.reload();\n return;\n }\n\n this.dispatchEvent('push_notification_click', payload);\n });\n\n navigator.serviceWorker.ready.then(this.isAliveNotify);\n }\n\n public pushSubscriptionNotify(event: PushSubscriptionNotifyType, subscription?: PushSubscription) {\n if(subscription) {\n const subscriptionObj: PushSubscriptionJSON = subscription.toJSON();\n if(!subscriptionObj ||\n !subscriptionObj.endpoint ||\n !subscriptionObj.keys ||\n !subscriptionObj.keys.p256dh ||\n !subscriptionObj.keys.auth) {\n this.log.warn('Invalid push subscription', subscriptionObj);\n this.unsubscribe();\n this.isAvailable = false;\n this.pushSubscriptionNotify(event);\n return;\n }\n\n this.log.warn('Push', event, subscriptionObj);\n this.dispatchEvent(('push_' + event) as PushSubscriptionNotifyEvent, {\n tokenType: 10,\n tokenValue: JSON.stringify(subscriptionObj)\n });\n } else {\n this.log.warn('Push', event, false);\n this.dispatchEvent(('push_' + event) as PushSubscriptionNotifyEvent, false as any);\n }\n }\n\n public ignorePushByMid(peerId: PeerId, mid: number) {\n if(!this.isAvailable) {\n return;\n }\n\n apiManagerProxy.serviceMessagePort.invokeVoid('shownNotification', peerId + '_' + getServerMessageId(mid));\n }\n}\n\nconst webPushApiManager = new WebPushApiManager();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.webPushApiManager = webPushApiManager);\nexport default webPushApiManager;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport IS_OPUS_SUPPORTED from '../environment/opusSupport';\nimport {IS_SAFARI} from '../environment/userAgent';\nimport {Modify} from '../types';\nimport {logger, LogTypes} from './logger';\nimport apiManagerProxy from './mtproto/mtprotoworker';\nimport type {ConvertWebPTask} from './webp/webpWorkerController';\n\ntype Result = {\n bytes: Uint8Array,\n waveform?: Uint8Array\n};\n\ntype Task = {\n pages: Uint8Array,\n withWaveform: boolean,\n waveform?: Uint8Array,\n callback: {resolve: (result: Result) => void, reject: (err: any) => void},\n timeout: number\n};\n\nexport interface ConvertOpusTask extends Modify {\n type: 'convertOpus'\n}\n\nexport class OpusDecodeController {\n private worker: Worker;\n private wavWorker: Worker;\n private sampleRate = 48000;\n private tasks: Array = [];\n private keepAlive = false;\n private log = logger('OPUS', LogTypes.Error);\n\n public isPlaySupported() {\n return IS_OPUS_SUPPORTED;\n }\n\n public loadWavWorker() {\n if(this.wavWorker) return;\n\n this.wavWorker = new Worker('waveWorker.min.js');\n this.wavWorker.addEventListener('message', (e) => {\n const data = e.data;\n\n this.log('[WAV] got message:', data);\n if(data && data.page) {\n const bytes = data.page;\n this.onTaskEnd(this.tasks.shift(), bytes);\n }\n });\n }\n\n public loadWorker() {\n if(this.worker) return;\n\n this.worker = new Worker('decoderWorker.min.js');\n this.worker.addEventListener('message', (e) => {\n const data = e.data;\n\n this.log('[DECODER] got message', data);\n if(data.type === 'done') {\n // this.log('[DECODER] send done to wav');\n this.wavWorker.postMessage({command: 'done'});\n\n if(data.waveform) {\n this.tasks[0].waveform = data.waveform;\n }\n } else { // e.data contains decoded buffers as float32 values\n // this.log('[DECODER] send encode to wav');\n this.wavWorker.postMessage({\n command: 'encode',\n buffers: e.data\n }, IS_SAFARI ? undefined : data.map((typedArray: Uint8Array) => typedArray.buffer));\n }\n });\n }\n\n public setKeepAlive(keepAlive: boolean) {\n this.keepAlive = keepAlive;\n if(this.keepAlive) {\n this.loadWorker();\n this.loadWavWorker();\n } else if(!this.tasks.length) {\n this.terminateWorkers();\n }\n }\n\n public onTaskEnd(task: Task, result?: Uint8Array) {\n if(!result) {\n task.callback.reject('timeout');\n } else {\n clearTimeout(task.timeout);\n task.callback.resolve({bytes: result, waveform: task.waveform});\n }\n\n if(this.tasks.length) {\n this.executeNewTask(this.tasks[0]);\n }\n\n this.terminateWorkers();\n }\n\n public terminateWorkers(kill = false) {\n if((this.keepAlive || this.tasks.length) && !kill) return;\n\n if(this.worker) {\n this.worker.terminate();\n this.worker = null;\n }\n\n if(this.wavWorker) {\n this.wavWorker.terminate();\n this.wavWorker = null;\n }\n }\n\n public executeNewTask(task: Task) {\n this.worker.postMessage({\n command: 'init',\n decoderSampleRate: this.sampleRate,\n outputBufferSampleRate: this.sampleRate\n });\n\n this.wavWorker.postMessage({\n command: 'init',\n wavBitDepth: 16,\n wavSampleRate: this.sampleRate\n });\n\n // console.log('sending command to worker:', task);\n // setTimeout(() => {\n this.log('[DECODER] send decode');\n this.worker.postMessage({\n command: 'decode',\n pages: task.pages,\n waveform: task.withWaveform\n }, IS_SAFARI ? undefined : [task.pages.buffer]);\n // }, 1e3);\n\n task.timeout = window.setTimeout(() => {\n this.log.error('decode timeout'/* , task */);\n\n this.terminateWorkers(true);\n if(this.tasks.length) {\n this.loadWorker();\n this.loadWavWorker();\n }\n\n this.onTaskEnd(this.tasks.shift());\n }, 10e3);\n }\n\n public pushDecodeTask(pages: Uint8Array, withWaveform: boolean) {\n return new Promise((resolve, reject) => {\n const task = {\n pages,\n withWaveform,\n callback: {resolve, reject},\n timeout: 0\n };\n\n this.loadWorker();\n this.loadWavWorker();\n\n if(this.tasks.push(task) === 1) {\n this.executeNewTask(task);\n }\n });\n }\n\n public async decode(typedArray: Uint8Array, withWaveform = false) {\n return this.pushDecodeTask(typedArray, withWaveform).then(async(result) => {\n const dataBlob = new Blob([result.bytes], {type: 'audio/wav'});\n return {url: await apiManagerProxy.invoke('createObjectURL', dataBlob), waveform: result.waveform};\n });\n }\n}\n\nconst opusDecodeController = new OpusDecodeController();\nMOUNT_CLASS_TO.opusDecodeController = opusDecodeController;\nexport default opusDecodeController;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport emojiRegExp from '../../vendor/emoji/regex';\nimport {MessageEntity} from '../../layer';\n\nconst EmojiHelper = {\n emojiMap: (code: string) => { return code; },\n shortcuts: [] as any,\n emojis: [] as any\n};\n\nexport const ALPHA_CHARS_REG_EXP = 'a-z' +\n '\\\\u00c0-\\\\u00d6\\\\u00d8-\\\\u00f6\\\\u00f8-\\\\u00ff' + // Latin-1\n '\\\\u0100-\\\\u024f' + // Latin Extended A and B\n '\\\\u0253\\\\u0254\\\\u0256\\\\u0257\\\\u0259\\\\u025b\\\\u0263\\\\u0268\\\\u026f\\\\u0272\\\\u0289\\\\u028b' + // IPA Extensions\n '\\\\u02bb' + // Hawaiian\n '\\\\u0300-\\\\u036f' + // Combining diacritics\n '\\\\u1e00-\\\\u1eff' + // Latin Extended Additional (mostly for Vietnamese)\n '\\\\u0400-\\\\u04ff\\\\u0500-\\\\u0527' + // Cyrillic\n '\\\\u2de0-\\\\u2dff\\\\ua640-\\\\ua69f' + // Cyrillic Extended A/B\n '\\\\u0591-\\\\u05bf\\\\u05c1-\\\\u05c2\\\\u05c4-\\\\u05c5\\\\u05c7' +\n '\\\\u05d0-\\\\u05ea\\\\u05f0-\\\\u05f4' + // Hebrew\n '\\\\ufb1d-\\\\ufb28\\\\ufb2a-\\\\ufb36\\\\ufb38-\\\\ufb3c\\\\ufb3e\\\\ufb40-\\\\ufb41' +\n '\\\\ufb43-\\\\ufb44\\\\ufb46-\\\\ufb4f' + // Hebrew Pres. Forms\n '\\\\u0610-\\\\u061a\\\\u0620-\\\\u065f\\\\u066e-\\\\u06d3\\\\u06d5-\\\\u06dc' +\n '\\\\u06de-\\\\u06e8\\\\u06ea-\\\\u06ef\\\\u06fa-\\\\u06fc\\\\u06ff' + // Arabic\n '\\\\u0750-\\\\u077f\\\\u08a0\\\\u08a2-\\\\u08ac\\\\u08e4-\\\\u08fe' + // Arabic Supplement and Extended A\n '\\\\ufb50-\\\\ufbb1\\\\ufbd3-\\\\ufd3d\\\\ufd50-\\\\ufd8f\\\\ufd92-\\\\ufdc7\\\\ufdf0-\\\\ufdfb' + // Pres. Forms A\n '\\\\ufe70-\\\\ufe74\\\\ufe76-\\\\ufefc' + // Pres. Forms B\n '\\\\u200c' + // Zero-Width Non-Joiner\n '\\\\u0e01-\\\\u0e3a\\\\u0e40-\\\\u0e4e' + // Thai\n '\\\\u1100-\\\\u11ff\\\\u3130-\\\\u3185\\\\uA960-\\\\uA97F\\\\uAC00-\\\\uD7AF\\\\uD7B0-\\\\uD7FF' + // Hangul (Korean)\n '\\\\u3003\\\\u3005\\\\u303b' + // Kanji/Han iteration marks\n '\\\\uff21-\\\\uff3a\\\\uff41-\\\\uff5a' + // full width Alphabet\n '\\\\uff66-\\\\uff9f' + // half width Katakana\n '\\\\uffa1-\\\\uffdc'; // half width Hangul (Korean)\nexport const ALPHA_NUMERIC_REG_EXP = '0-9\\_' + ALPHA_CHARS_REG_EXP;\nexport const DOMAIN_ADD_CHARS = '\\u00b7';\n// Based on Regular Expression for URL validation by Diego Perini\nexport const URL_ALPHANUMERIC_REG_EXP_PART = '[' + ALPHA_CHARS_REG_EXP + '0-9]';\nexport const URL_PROTOCOL_REG_EXP_PART = '((?:https?|ftp)://|mailto:)?';\nexport const URL_REG_EXP = URL_PROTOCOL_REG_EXP_PART +\n // user:pass authentication\n '(?:' + URL_ALPHANUMERIC_REG_EXP_PART + '{1,64}(?::' + URL_ALPHANUMERIC_REG_EXP_PART + '{0,64})?@)?' +\n '(?:' +\n // sindresorhus/ip-regexp\n '(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}' +\n '|' +\n // host name\n URL_ALPHANUMERIC_REG_EXP_PART + '[' + ALPHA_CHARS_REG_EXP + DOMAIN_ADD_CHARS + '0-9\\-]{0,64}' +\n // domain name\n '(?:\\\\.' + URL_ALPHANUMERIC_REG_EXP_PART + '[' + ALPHA_CHARS_REG_EXP + DOMAIN_ADD_CHARS + '0-9\\-]{0,64}){0,10}' +\n // TLD identifier\n '(?:\\\\.(xn--[0-9a-z]{2,16}|[' + ALPHA_CHARS_REG_EXP + ']{2,24}))' +\n ')' +\n // port number\n '(?::\\\\d{2,5})?' +\n // resource path\n '(?:/(?:\\\\S{0,255}[^\\\\s.;,(\\\\[\\\\]{}<>\"\\'])?)?';\nexport const URL_PROTOCOL_REG_EXP = new RegExp('^' + URL_PROTOCOL_REG_EXP_PART.slice(0, -1), 'i');\nexport const URL_ANY_PROTOCOL_REG_EXP = /^((?:[^\\/]+?):\\/\\/|mailto:)/;\nexport const USERNAME_REG_EXP = '[a-zA-Z\\\\d_]{5,32}';\nexport const TIMESTAMP_REG_EXP = '(?:\\\\s|^)((?:\\\\d{1,2}:)?(?:[0-5]?[0-9]):(?:[0-5][0-9]))(?:\\\\s|$)';\nexport const BOT_COMMAND_REG_EXP = '\\\\/([a-zA-Z\\\\d_]{1,32})(?:@(' + USERNAME_REG_EXP + '))?(\\\\b|$)';\nexport const FULL_REG_EXP = new RegExp('(^| )(@)(' + USERNAME_REG_EXP + ')|(' + URL_REG_EXP + ')|(\\\\n)|(' + emojiRegExp + ')|(^|[\\\\s\\\\(\\\\]])(#[' + ALPHA_NUMERIC_REG_EXP + ']{2,64})|(^|\\\\s)' + BOT_COMMAND_REG_EXP + '|' + TIMESTAMP_REG_EXP + '', 'i');\nexport const EMAIL_REG_EXP = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n// const markdownTestRegExp = /[`_*@~]/;\nexport const MARKDOWN_REG_EXP = /(^|\\s|\\n)(````?)([\\s\\S]+?)(````?)([\\s\\n\\.,:?!;]|$)|(^|\\s|\\x01)(`|~~|\\*\\*|__|_-_|\\|\\|)([^\\n]+?)\\7([\\x01\\s\\.,:?!;]|$)|@(\\d+)\\s*\\((.+?)\\)|(\\[(.+?)\\]\\((.+?)\\))/m;\nexport const SITE_HASHTAGS: {[siteName: string]: string} = {\n 'Telegram': 'tg://search_hashtag?hashtag={1}',\n 'Twitter': 'https://twitter.com/hashtag/{1}',\n 'Instagram': 'https://instagram.com/explore/tags/{1}/',\n 'Google Plus': 'https://plus.google.com/explore/{1}'\n};\n\n// export const SITE_MENTIONS: {[siteName in 'Telegram' | 'Twitter' | 'Instagram' | 'GitHub']: string} = {\n// Telegram: '#{1}',\n// Twitter: 'https://twitter.com/{1}',\n// Instagram: 'https://instagram.com/{1}/',\n// GitHub: 'https://github.com/{1}'\n// };\n\nexport const MARKDOWN_ENTITIES: {[markdown: string]: MessageEntity['_']} = {\n '`': 'messageEntityCode',\n '``': 'messageEntityPre',\n '**': 'messageEntityBold',\n '__': 'messageEntityItalic',\n '~~': 'messageEntityStrike',\n '_-_': 'messageEntityUnderline',\n '||': 'messageEntitySpoiler'\n};\n\nexport const MARKDOWN_ENTITIES_TYPES = new Set(Object.values(MARKDOWN_ENTITIES));\n\nexport const PASS_CONFLICTING_ENTITIES: Set = new Set([\n 'messageEntityEmoji',\n 'messageEntityLinebreak',\n 'messageEntityCaret'\n]);\nfor(const i in MARKDOWN_ENTITIES) {\n PASS_CONFLICTING_ENTITIES.add(MARKDOWN_ENTITIES[i]);\n}\n\nexport const PHONE_NUMBER_REG_EXP = /^\\+\\d+$/;\n\n/* export function parseEmojis(text: string) {\n return text.replace(/:([a-z0-9\\-\\+\\*_]+?):/gi, function (all, shortcut) {\n var emojiCode = EmojiHelper.shortcuts[shortcut]\n if (emojiCode !== undefined) {\n return EmojiHelper.emojis[emojiCode][0]\n }\n return all\n })\n} */\n\n\n/* export function replaceUrlEncodings(urlWithEncoded: string) {\n return urlWithEncoded.replace(/(%[A-Z\\d]{2})+/g, (str) => {\n try {\n return decodeURIComponent(str);\n } catch (e) {\n return str;\n }\n });\n} */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type addAnchorListener from '../../helpers/addAnchorListener';\nimport {PHONE_NUMBER_REG_EXP} from '.';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport matchUrlProtocol from './matchUrlProtocol';\nimport {T_ME_PREFIXES} from '../mtproto/mtproto_config';\n\nexport default function wrapUrl(url: string, unsafe?: number | boolean) {\n if(!matchUrlProtocol(url)) {\n url = 'https://' + url;\n }\n\n const out: {url: string, onclick?: Parameters[0]['name']} = {url};\n let tgMeMatch, telescoPeMatch, tgMatch;\n let onclick: typeof out['onclick'];\n /* if(unsafe === 2) {\n url = 'tg://unsafe_url?url=' + encodeURIComponent(url);\n } else */if((tgMeMatch = url.match(/^(?:https?:\\/\\/)?(?:(.+?)\\.)?(?:(?:web|k|z)\\.)?t(?:elegram)?\\.me(?:\\/(.+))?/))) {\n const u = new URL(url);\n let prefix = tgMeMatch[1];\n if(prefix && T_ME_PREFIXES.has(tgMeMatch[1])) {\n prefix = undefined;\n }\n\n if(prefix) {\n u.pathname = prefix + (u.pathname === '/' ? '' : u.pathname);\n }\n\n const fullPath = u.pathname.slice(1);\n const path = fullPath.split('/');\n\n if(path[0] && path[0][0] === '$' && path[0].length > 1) {\n onclick = 'invoice';\n } else if(/^\\W/.test(fullPath) && !PHONE_NUMBER_REG_EXP.test(fullPath)) { // second regexp is for phone numbers (t.me/+38050...)\n onclick = 'joinchat';\n } else switch(path[0]) {\n case 'joinchat':\n case 'addstickers':\n case 'addemoji':\n case 'voicechat':\n case 'invoice':\n if(path.length !== 1 && !prefix) {\n onclick = path[0];\n break;\n }\n\n default:\n if((path[1] && path[1].match(/^\\d+(?:\\?(?:comment|thread)=\\d+)?$/)) || path.length === 1) {\n onclick = 'im';\n break;\n }\n\n break;\n }\n } else if((telescoPeMatch = url.match(/^(?:https?:\\/\\/)?telesco\\.pe\\/([^/?]+)\\/(\\d+)/))) {\n onclick = 'im';\n } else if((tgMatch = url.match(/tg:(?:\\/\\/)?(.+?)(?:\\?|$)/))) {\n onclick = 'tg_' + tgMatch[1] as any;\n }/* else if(unsafe) {\n url = 'tg://unsafe_url?url=' + encodeURIComponent(url);\n } */\n\n if(!(window as any)[onclick]) {\n onclick = undefined;\n }\n\n out.onclick = onclick;\n return out;\n}\n\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.wrapUrl = wrapUrl);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Message, StickerSet, Update, NotifyPeer, PeerNotifySettings, PollResults, Poll, WebPage, GroupCall, GroupCallParticipant, ReactionCount, MessagePeerReaction, PhoneCall, Config, Reaction} from '../layer';\nimport type {Dialog, ForumTopic, MessagesStorageKey, MyMessage} from './appManagers/appMessagesManager';\nimport type {MyDialogFilter} from './storages/filters';\nimport type {Folder} from './storages/dialogs';\nimport type {UserTyping} from './appManagers/appProfileManager';\nimport type {MyDraftMessage} from './appManagers/appDraftsManager';\nimport type {ConnectionStatusChange} from './mtproto/connectionStatus';\nimport type {GroupCallId} from './appManagers/appGroupCallsManager';\nimport type {AppManagers} from './appManagers/managers';\nimport type {State} from '../config/state';\nimport type {Progress} from './appManagers/appDownloadManager';\nimport type {CallId} from './appManagers/appCallsManager';\nimport type {MyDocument} from './appManagers/appDocsManager';\nimport type {MTAppConfig} from './mtproto/appConfig';\nimport {NULL_PEER_ID, UserAuth} from './mtproto/mtproto_config';\nimport EventListenerBase from '../helpers/eventListenerBase';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport MTProtoMessagePort from './mtproto/mtprotoMessagePort';\nimport {IS_WORKER} from '../helpers/context';\n\nexport type BroadcastEvents = {\n 'chat_full_update': ChatId,\n 'chat_update': ChatId,\n 'chat_toggle_forum': {chatId: ChatId, enabled: boolean},\n 'chat_participant': Update.updateChannelParticipant,\n\n 'channel_update': ChatId,\n\n 'user_update': UserId,\n 'user_auth': UserAuth,\n 'user_full_update': UserId,\n\n 'peer_pinned_messages': {peerId: PeerId, mids?: number[], pinned?: boolean, unpinAll?: true},\n 'peer_pinned_hidden': {peerId: PeerId, maxId: number},\n 'peer_typings': {peerId: PeerId, threadId?: number, typings: UserTyping[]},\n 'peer_block': {peerId: PeerId, blocked: boolean},\n 'peer_title_edit': {peerId: PeerId, threadId?: number},\n 'peer_bio_edit': PeerId,\n 'peer_deleted': PeerId, // left chat, deleted user dialog, left channel\n 'peer_full_update': PeerId,\n\n 'filter_delete': MyDialogFilter,\n 'filter_update': MyDialogFilter,\n 'filter_new': MyDialogFilter,\n 'filter_order': number[],\n\n 'folder_unread': Omit,\n\n 'dialog_draft': {peerId: PeerId, dialog: Dialog | ForumTopic, drop: boolean, draft: MyDraftMessage | undefined},\n 'dialog_unread': {peerId: PeerId, dialog: Dialog | ForumTopic},\n 'dialog_flush': {peerId: PeerId, dialog: Dialog},\n 'dialog_drop': Dialog | ForumTopic,\n 'dialog_migrate': {migrateFrom: PeerId, migrateTo: PeerId},\n // 'dialog_top': Dialog,\n 'dialog_notify_settings': Dialog | ForumTopic,\n // 'dialog_order': {dialog: Dialog, pos: number},\n 'dialogs_multiupdate': Map}>,\n\n 'history_append': {storageKey: MessagesStorageKey, message: Message.message},\n 'history_update': {storageKey: MessagesStorageKey, message: MyMessage, sequential?: boolean},\n 'history_reply_markup': {peerId: PeerId},\n 'history_multiappend': MyMessage,\n 'history_delete': {peerId: PeerId, msgs: Set},\n 'history_forbidden': PeerId,\n 'history_reload': PeerId,\n // 'history_request': void,\n\n 'message_edit': {storageKey: MessagesStorageKey, peerId: PeerId, mid: number, message: MyMessage},\n 'message_sent': {storageKey: MessagesStorageKey, tempId: number, tempMessage: any, mid: number, message: MyMessage},\n 'message_error': {storageKey: MessagesStorageKey, tempId: number, error: ApiError},\n 'message_transcribed': {peerId: PeerId, mid: number, text: string, pending?: boolean},\n 'messages_views': {peerId: PeerId, mid: number, views: number}[],\n 'messages_reactions': {message: Message.message, changedResults: ReactionCount[]}[],\n 'messages_pending': void,\n 'messages_read': void,\n 'messages_downloaded': {peerId: PeerId, mids: number[]},\n 'messages_media_read': {peerId: PeerId, mids: number[]},\n\n 'replies_updated': Message.message,\n\n 'scheduled_new': Message.message,\n 'scheduled_delete': {peerId: PeerId, mids: number[]},\n\n 'album_edit': {peerId: PeerId, groupId: string, deletedMids: number[], messages: Message.message[]},\n\n 'stickers_installed': StickerSet.stickerSet,\n 'stickers_deleted': StickerSet.stickerSet,\n 'stickers_updated': {type: 'recent' | 'faved', stickers: MyDocument[]},\n 'stickers_top': Long,\n 'stickers_order': {type: 'masks' | 'emojis' | 'stickers', order: Long[]},\n 'sticker_updated': {type: 'recent' | 'faved', document: MyDocument, faved: boolean},\n\n 'state_cleared': void,\n 'state_synchronized': ChatId | void,\n 'state_synchronizing': ChatId | void,\n\n 'contacts_update': UserId,\n 'avatar_update': {peerId: PeerId, threadId?: number},\n 'poll_update': {poll: Poll, results: PollResults},\n 'invalidate_participants': ChatId,\n // 'channel_settings': {channelId: number},\n 'webpage_updated': {id: WebPage.webPage['id'], msgs: {peerId: PeerId, mid: number, isScheduled: boolean}[]},\n\n 'connection_status_change': ConnectionStatusChange,\n 'settings_updated': {key: string, value: any, settings: State['settings']},\n 'draft_updated': {peerId: PeerId, threadId: number, draft: MyDraftMessage | undefined, force?: boolean},\n\n 'background_change': void,\n\n 'privacy_update': Update.updatePrivacy,\n\n 'notify_settings': Update.updateNotifySettings,\n 'notify_peer_type_settings': {key: Exclude, settings: PeerNotifySettings},\n\n 'notification_reset': string,\n 'notification_cancel': string,\n\n 'language_change': string,\n\n 'theme_change': void,\n\n 'media_play': void,\n\n 'emoji_recent': AppEmoji,\n\n 'download_progress': Progress,\n 'document_downloading': DocId,\n 'document_downloaded': DocId,\n\n 'choosing_sticker': boolean\n\n 'group_call_update': GroupCall,\n 'group_call_participant': {groupCallId: GroupCallId, participant: GroupCallParticipant},\n // 'group_call_video_track_added': {instance: GroupCallInstance}\n\n 'call_update': PhoneCall,\n 'call_signaling': {callId: CallId, data: Uint8Array},\n\n 'quick_reaction': Reaction,\n\n 'service_notification': Update.updateServiceNotification,\n\n 'logging_out': void,\n\n 'payment_sent': {peerId: PeerId, mid: number, receiptMessage: Message.messageService}\n\n 'premium_toggle': boolean,\n 'premium_toggle_private': {isNew: boolean, isPremium: boolean},\n\n 'config': Config,\n 'app_config': MTAppConfig\n};\n\nexport type BroadcastEventsListeners = {\n [name in keyof BroadcastEvents]: (e: BroadcastEvents[name]) => void\n};\n\nexport class RootScope extends EventListenerBase {\n public myId: PeerId;\n private connectionStatus: {[name: string]: ConnectionStatusChange};\n public settings: State['settings'];\n public managers: AppManagers;\n public premium: boolean;\n\n constructor() {\n super();\n\n this.myId = NULL_PEER_ID;\n this.connectionStatus = {};\n this.premium = false;\n\n this.addEventListener('user_auth', ({id}) => {\n this.myId = id.toPeerId();\n });\n\n this.addEventListener('premium_toggle_private', ({isNew, isPremium}) => {\n this.premium = isPremium;\n this.dispatchEventSingle('premium_toggle', isPremium);\n });\n\n this.addEventListener('connection_status_change', (status) => {\n this.connectionStatus[status.name] = status;\n });\n\n this.dispatchEvent = (e, ...args) => {\n super.dispatchEvent(e, ...args);\n MTProtoMessagePort.getInstance().invokeVoid('event', {name: e as string, args});\n };\n\n if(!IS_WORKER) {\n this.addEventListener('settings_updated', ({settings}) => {\n this.settings = settings;\n });\n }\n }\n\n public getConnectionStatus() {\n return this.connectionStatus;\n }\n\n public getPremium() {\n return this.premium;\n }\n\n public dispatchEventSingle(...args: any[]) {\n // @ts-ignore\n super.dispatchEvent(...args);\n }\n}\n\nconst rootScope = new RootScope();\nMOUNT_CLASS_TO.rootScope = rootScope;\nexport default rootScope;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport {WorkerTaskVoidTemplate} from '../../types';\n\nexport interface ConvertWebPTask extends WorkerTaskVoidTemplate {\n type: 'convertWebp',\n payload: {\n fileName: string,\n bytes: Uint8Array\n }\n};\n\nexport class WebpWorkerController {\n private worker: Worker;\n private convertPromises: {[fileName: string]: CancellablePromise} = {};\n\n private init() {\n this.worker = new Worker(new URL('./webp.worker.ts', import.meta.url));\n this.worker.addEventListener('message', (e) => {\n const task = e.data as ConvertWebPTask;\n const payload = task.payload;\n\n const promise = this.convertPromises[payload.fileName];\n if(promise) {\n payload.bytes ? promise.resolve(payload.bytes) : promise.reject();\n delete this.convertPromises[payload.fileName];\n }\n });\n }\n\n private postMessage(data: ConvertWebPTask) {\n if(this.init) {\n this.init();\n this.init = null;\n }\n\n this.worker.postMessage(data);\n }\n\n public convert(fileName: string, bytes: Uint8Array) {\n if(this.convertPromises.hasOwnProperty(fileName)) {\n return this.convertPromises[fileName];\n }\n\n const convertPromise = deferredPromise();\n\n this.postMessage({type: 'convertWebp', payload: {fileName, bytes}});\n\n return this.convertPromises[fileName] = convertPromise;\n }\n}\n\nconst webpWorkerController = new WebpWorkerController();\nMOUNT_CLASS_TO.webpWorkerController = webpWorkerController;\nexport default webpWorkerController;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + ({\"589\":\"crypto.worker\",\"630\":\"npm.qr-code-styling\",\"670\":\"sw\",\"678\":\"mtproto.worker\"}[chunkId] || chunkId) + \".\" + {\"8\":\"93d2f33af815eb0455aa\",\"53\":\"40d79ab9d14e8d83cf01\",\"61\":\"8c05eb6b6906de5287fa\",\"63\":\"7ac6657334217aaadb5b\",\"77\":\"b8cf11d2b5dca36479ca\",\"104\":\"be090b1ee184fa23f913\",\"147\":\"52e5e3f41bb7eb15ae10\",\"231\":\"f4d1bfe6ff7f14577f96\",\"297\":\"30de9795e39435a29676\",\"301\":\"95838a8203f23dd1ce8f\",\"339\":\"12bdbede82465e666965\",\"392\":\"6ce981ebdcbba9b6fd04\",\"436\":\"9e54c5e9f3feccf9d736\",\"437\":\"37bcbe9db9cbb8d8a753\",\"442\":\"54c010363ba1cdea7bce\",\"508\":\"dfcdc07d46a7ba4348a1\",\"589\":\"c036d5d715f9894c08a3\",\"630\":\"f8f57a1c721e03c3f699\",\"641\":\"527b52a7a5052f57e455\",\"642\":\"be93122d1116ecdc9322\",\"670\":\"ee91e25d52a3425cb42c\",\"678\":\"c9d58d1702ff11ef9b30\",\"709\":\"c5451446b3485d2557e8\",\"776\":\"444edaecf4b03894ef8e\",\"781\":\"c527d73f348ae695f21a\",\"783\":\"949e247466ad3ebe82d6\",\"810\":\"aad7a584f7c8c739c66e\",\"813\":\"315ffd640c7d6013a536\"}[chunkId] + \".chunk.js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","(() => {\n if (typeof __webpack_require__ !== 'undefined') {\n var oldGetScript = __webpack_require__.u;\n var oldLoadScript = __webpack_require__.e;\n var queryMap = {};\n var countMap = {};\n var getRetryDelay = function () {\n return 3000;\n };\n __webpack_require__.u = function (chunkId) {\n var result = oldGetScript(chunkId);\n return (\n result +\n (queryMap.hasOwnProperty(chunkId) ? '?' + queryMap[chunkId] : '')\n );\n };\n __webpack_require__.e = function (chunkId) {\n var result = oldLoadScript(chunkId);\n return result.catch(function (error) {\n var retries = countMap.hasOwnProperty(chunkId)\n ? countMap[chunkId]\n : 999999;\n if (retries < 1) {\n var realSrc = oldGetScript(chunkId);\n error.message =\n 'Loading chunk ' +\n chunkId +\n ' failed after 999999 retries.\\n(' +\n realSrc +\n ')';\n error.request = realSrc;\n throw error;\n }\n return new Promise(function (resolve) {\n var retryAttempt = 999999 - retries + 1;\n setTimeout(function () {\n var retryAttemptString = '&retry-attempt=' + retryAttempt;\n var cacheBust = (function () {\n return Date.now();\n })();\n +retryAttemptString;\n queryMap[chunkId] = cacheBust;\n countMap[chunkId] = retries - 1;\n resolve(__webpack_require__.e(chunkId));\n }, getRetryDelay(retryAttempt));\n });\n });\n };\n }\n})();\n","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = this[\"webpackChunktweb\"] = this[\"webpackChunktweb\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [85,110], () => (__webpack_require__(2938)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","leafPrototypes","getProto","inProgress","dataWebpackPrefix","IS_BETA","DEBUG","MOUNT_CLASS_TO","window","self","STATE_VERSION","BUILD","DEFAULT_THEME","_","access_hash","id","settings","pFlags","base_theme","accent_color","message_colors","wallpaper","default","pattern","document","undefined","slug","intensity","background_color","second_background_color","third_background_color","fourth_background_color","dark","title","emoticon","makeDefaultAppTheme","name","baseTheme","highlightningColor","find","s","STATE_INIT","allDialogsLoaded","pinnedOrders","contactsListCachedTime","updates","filtersArr","maxSeenMsgId","stateCreatedTime","Date","now","recentEmoji","recentCustomEmoji","topPeersCache","recentSearch","version","build","authState","IS_MOBILE","hiddenPinnedMessages","messagesTextSize","distanceUnit","sendShortcut","autoDownload","photo","contacts","private","groups","channels","video","file","autoDownloadNew","file_size_max","video_preload_large","audio_preload_next","photo_size_max","video_size_max","video_upload_maxbitrate","stickers","suggest","dynamicPackOrder","loop","emoji","big","themes","theme","notifications","sound","timeFormat","toLocaleString","match","liteMode","all","animations","chat","chat_background","chat_spoilers","effects","effects_premiumstickers","effects_reactions","effects_emoji","emoji_messages","emoji_panel","gif","stickers_chat","stickers_panel","playbackParams","volume","muted","playbackRate","playbackRates","voice","audio","round","keepSigned","chatContextMenuHintWasShown","stateId","notifySettings","IS_APPLE_MX","ctx","createElement","getContext","extension","getExtension","renderer","getParameter","UNMASKED_RENDERER_WEBGL","getSupportedExtensions","indexOf","err","CAN_USE_TRANSFERABLES","IS_SAFARI","navigator","userAgent","search","geolocation","getCurrentPosition","IMAGE_MIME_TYPES_SUPPORTED","Set","add","arr","concat","canPlayType","IS_APPLE_MOBILE","replace","IS_FIREFOX","mediaDevices","DocumentTouch","USER_AGENT","IS_APPLE","IS_ANDROID","toLowerCase","IS_CHROMIUM","test","vendor","platform","maxTouchPoints","IS_MOBILE_SAFARI","vibrate","VIDEO_MIME_TYPES_SUPPORTED","toDataURL","startsWith","rgbToHsv","r","g","b","v","Math","max","c","min","h","hsvToRgb","f","n","k","rgbaToHsla","a","l","d","hslaToRgba","hue2rgb","p","q","t","map","hexaToRgba","hexa","offset","length","slice","i","push","parseInt","hexToRgb","hex","hexaToHsla","rgba","rgbaToHexa","toString","join","hslaStringToHex","hsla","splitted","split","alpha","pop","val","endsWith","hslaStringToRgba","hslaStringToHexa","mixColors","color1","color2","weight","out","Array","v1","v2","floor","computePerceivedBrightness","color","getAverageColor","getAccentColor","baseHsv","baseColor","elementColor","hsvTemp3","hsvTemp4","dist","changeColorAccent","accentHsv","isDarkTheme","colorHsv","abs","newColor","origBrightness","newBrightness","amountOfNew","amount","changeBrightness","getHexColorFromTelegramColor","repeat","getRgbColorFromTelegramColor","getColorsFromWallPaper","wallPaper","filter","Boolean","compareVersion","s1","s2","blurActiveElement","activeElement","blur","cancelEvent","event","originalEvent","stopPropagation","preventDefault","returnValue","cancelBubble","findUpClassName","el","className","closest","fixSafariStickyInput","input","style","transform","focus","then","IS_STICKY_INPUT_BUGGED","key","startY","o","capture","passive","onTouchMove","e","touch","touches","scrollable","target","y","scrolled","scrollTop","scrollHeight","clientHeight","nextScrollTop","lastFocusOutTimeStamp","addEventListener","classList","contains","timeStamp","touchStart","removeEventListener","fixSafariStickyInputFocusing","callback","cacheInstallPrompt","deferredPrompt","prompt","outcome","userChoice","getInstallPrompt","texts","cache","fonts","text","icons","monospace","loadFonts","types","Promise","resolve","promises","type","_texts","font","weights","_promises","load","race","catch","setInnerHTML","elem","html","setDirection","innerHTML","replaceChildren","setAttribute","FOCUS_EVENT_NAME","IdleController","constructor","super","this","_isIdle","focusPromise","focusResolve","isIdle","once","idle","getFocusPromise","value","dispatchEvent","clamp","OverlayCounter","overlaysActive","isOverlayActive","fastRafCallbacks","fastRaf","requestAnimationFrame","currentCallbacks","forEach","cb","fastRafConventionalCallbacks","rafPromise","processing","fastRafConventional","fastRafPromise","doubleRaf","parseUriParams","uri","parseUriParamsLine","line","params","item","decodeURIComponent","appColorMap","rgb","light","lightFilled","darkRgb","darkFilled","colorMap","day","night","themeController","setTheme","themeColorElem","_themeColorElem","head","querySelector","setThemeColor","themeColor","isNight","setThemeListener","darkModeMediaQuery","matchMedia","checkDarkMode","systemTheme","matches","addListener","applyHighlightningColor","getTheme","documentElement","setProperty","removeProperty","colorScheme","toggle","applyTheme","styleElement","append","textContent","cssText","switchTheme","bindColorApplier","options","appliedColors","applyAppColor","_options","finalize","has","element","lightenAlpha","darkenAlpha","mixColor","appColor","lightenedRgb","darkenedHsla","applyNewTheme","isNightTheme","currentTheme","themeSettings","newAppTheme","AppBackgroundTab","setBackgroundDocument","isArray","baseColors","hsvTemp1","hsvTemp2","newAccentRgb","newAccentHex","messageLightenAlpha","baseMessageColor","baseMessageOutBackgroundColor","myMessagesAccent","nextColor","accentColor2","outbox_accent_color","newMessageOutBackgroundColor","workerHandler","construct","args","url","location","Worker","SharedWorker","w","Proxy","setWorkerProxy","Element","prototype","toggleAttribute","force","hasAttribute","removeAttribute","Node","nodes","rootScope","getProxiedManagers","getElementById","href","singleInstance","visualViewport","lastVH","setViewportVH","setVH","vh","overlayCounter","height","innerHeight","toggleResizeMode","tabId","onImTabChange","wasTabId","tagName","appMediaViewer","onInResize","hasFocus","onOutResize","console","log","perf","performance","langPromise","stateResult","langPack","fadeInWhenFontsReady","promise","opacity","state","isPremium","appVersion","lang_code","dir","hash","tgWebAuthToken","data","token","dcId","tgWebAuthDcId","userId","tgWebAuthUserId","toUserId","isTest","tgWebAuthTest","tgAddr","tgaddr","urlSearchParams","URLSearchParams","set","delete","pagePromise","placeholder","prepend","cloneNode","meModule","pushModule","setAuthorized","forceUnsubscribe","mount","sentCode","authCode","pause","ready","reload","close","DEBUG_MANAGER_REQUESTS","createProxyProxy","proxied","ack","get","receiver","method","warn","createProxy","acknowledged","IDB","db","storageIsAvailable","openDatabase","INSTANCES","isAvailable","createNew","openDbPromise","createIndexes","os","store","indexNames","from","indexName","deleteIndex","indexes","index","createIndex","keyPath","objectParameters","request","indexedDB","open","reject","error","message","finished","setTimeout","onerror","onsuccess","result","calledNew","onclose","onabort","transaction","onversionchange","onupgradeneeded","oldVersion","newVersion","stores","objectStoreNames","objectStore","createObjectStore","static","instance","preserve","storage","IDBStorage","storeName","idb","create","entryName","getObjectStore","clear","save","idx","put","mode","onError","clearTimeout","timeout","onComplete","results","requests","waitForTransactionComplete","oncomplete","callbackResult","left","onRequestFinished","getAll","UNSUPPORTED_LANG_PACK_KEY","I18n","pluralRules","cacheLangPackPromise","setLangCode","langCode","lastRequestedLangCode","lastRequestedNormalizedLangCode","updateAmPm","dateTimeFormat","getDateTimeFormat","hour","minute","hour12","date","setHours","amText","format","amPmCache","am","pmText","pm","loadLocalLangPack","defaultCode","lang","langSign","countries","strings","formatLocalStrings","saveLangPack","from_version","local","loadLangPack","web","requestedServerLanguage","managers","apiManager","invokeApiCacheable","lang_pack","polyfillPromise","pushTo","applyLangPack","currentLangCode","Intl","PluralRules","string","countriesList","country","langPackKey","default_name","lastAppliedLangCode","cachedDateTimeFormats","querySelectorAll","weakMap","update","superFormatter","indexHolder","lastIndex","p1","p2","p3","p4","lastIndexOf","wrappedUrl","onclick","DocumentFragment","firstChild","formatted","arg","pushNextArgument","plain","str","select","Map","isRTL","setRTL","rtl","getCacheLangPack","finally","setTimeFormat","haveToUpdate","IntlDateElement","getStrings","keys","getLangPack","langPack1","langPack2","localLangPack1","localLangPack2","_Intl","Object","assign","WeakMap","IntlElementBase","property","IntlElement","dataset","compareAndUpdate","json","JSON","stringify","DateTimeFormat","hours","getHours","getMinutes","i18n","i18n_","_i18n","joinElementsWith","elements","joiner","isLast","useLast","joined","NULL_PEER_ID","REPLIES_PEER_ID","REPLIES_HIDDEN_CHANNEL_ID","SERVICE_PEER_ID","MUTE_UNTIL","BOT_START_PARAM","MAX_FILE_SAVE_SIZE","THUMB_TYPE_FULL","TOPIC_COLORS","ATTACH_MENU_BOT_ICON_NAME","GENERAL_TOPIC_ID","T_ME_PREFIXES","FOLDER_ID_ALL","FOLDER_ID_ARCHIVE","REAL_FOLDERS","IS_CALL_SUPPORTED","IS_CANVAS_FILTER_SUPPORTED","IS_EMOJI_SUPPORTED","IS_GEOLOCATION_SUPPORTED","IS_GROUP_CALL_SUPPORTED","IS_MOV_SUPPORTED","IS_PARALLAX_SUPPORTED","IS_SCREEN_SHARING_SUPPORTED","IS_TOUCH_SUPPORTED","IS_VIBRATE_SUPPORTED","IS_OPUS_SUPPORTED","IS_SHARED_WORKER_SUPPORTED","IS_WEBM_SUPPORTED","IS_WEBP_SUPPORTED","IS_WEBRTC_SUPPORTED","MEDIA_MIME_TYPES_SUPPORTED","ALL_KEYS","REFRESH_KEYS","loadStateInner","logger","totalPerf","recordPromise","stateStorage","sessionStorage","pushedKeys","pushToState","copy","splice","auth","shift","sessionBuild","shiftedWebKAuth","values","dcID","toPeerId","obj","resetStorages","chats","dialogs","users","_state","state_id","time","autoDownloadSettings","oldTypes","mediaType","peerTypeSettings","peerType","SKIP_VALIDATING_PATHS","validateInitObject","missingKey","migrated","oldThemes","oldTheme","oldBackground","background","newTheme","colors","wallPaperSettings","animationsEnabled","autoPlay","videos","gifs","k_build","ApiManagerProxy","onMirrorTask","payload","hasOwnProperty","mirrors","mirror","tabState","chatPeerIds","idleStartTime","registerWorker","registerServiceWorker","registerCryptoWorker","addMultipleEventsListeners","convertWebp","fileName","bytes","webpWorkerController","convertOpus","opusDecodeController","localStorageProxy","storageTask","language","toggleStorages","telegramMeWebManager","webPushApiManager","cacheName","caches","appRuntimeManager","idleController","updateTabStateIdle","invoke","pingServiceWorkerWithIframe","pingServiceWorkerPromise","iframe","hidden","onLoad","remove","src","random","body","attachServiceWorker","serviceWorker","lastServiceWorker","serviceMessagePort","detachPort","attachSendPort","invokeVoid","_registerServiceWorker","register","URL","scope","registration","active","controller","unregister","installing","waiting","worker","attachListenPort","port","source","ports","hello","resendLockTask","share","originals","originalUrl","createWorker","attachWorkerToPort","cryptoMessagePort","blob","fetch","response","pathnameSplitted","pathname","origin","Blob","onWorkerFirstMessage","messagePort","attachPort","loadState","sendState","invokeCrypto","enabled","clearWrite","getMirror","getState","updateTabState","apiManagerProxy","IS_MULTIPLE_TABS_SUPPORTED","SingleInstance","clearInstance","masterInstance","deactivated","checkInstance","newInstance","instanceId","curInstance","deactivateInstance","xt_instance","clearDeactivateTimeout","deactivateTimeout","deactivatedReason","start","reset","started","setInterval","activateInstance","reason","TelegramMeWebManager","disabled","hostname","canRedirect","curValue","ts","tsNow","tgme_sync","path","encodeURIComponent","script","onload","appendChild","loadScript","WebPushApiManager","isPushEnabled","localNotificationsAvailable","isFirefox","userVisibleOnly","subscribe","reg","pushManager","subscription","pushSubscriptionNotify","Notification","permission","isAliveNotify","baseUrl","ACTIONS_LANG_MAP","push_action_mute1d","push_action_settings","push_message_nopreview","action","localNotifications","isAliveTO","getSubscription","setUpServiceWorkerChannel","setLocalNotificationsDisabled","unsubscribe","successful","setSettings","newSettings","hidePushNotifications","subscriptionObj","toJSON","endpoint","p256dh","tokenType","tokenValue","ignorePushByMid","peerId","mid","sampleRate","tasks","keepAlive","isPlaySupported","loadWavWorker","wavWorker","page","onTaskEnd","loadWorker","postMessage","command","waveform","buffers","typedArray","buffer","setKeepAlive","terminateWorkers","task","executeNewTask","kill","terminate","decoderSampleRate","outputBufferSampleRate","wavBitDepth","wavSampleRate","pages","withWaveform","pushDecodeTask","decode","dataBlob","ALPHA_CHARS_REG_EXP","ALPHA_NUMERIC_REG_EXP","URL_ALPHANUMERIC_REG_EXP_PART","URL_PROTOCOL_REG_EXP_PART","URL_REG_EXP","URL_ANY_PROTOCOL_REG_EXP","RegExp","USERNAME_REG_EXP","BOT_COMMAND_REG_EXP","FULL_REG_EXP","EMAIL_REG_EXP","MARKDOWN_REG_EXP","SITE_HASHTAGS","MARKDOWN_ENTITIES","MARKDOWN_ENTITIES_TYPES","PASS_CONFLICTING_ENTITIES","PHONE_NUMBER_REG_EXP","wrapUrl","unsafe","tgMeMatch","telescoPeMatch","tgMatch","u","prefix","fullPath","RootScope","myId","connectionStatus","premium","isNew","dispatchEventSingle","status","getConnectionStatus","getPremium","convertPromises","init","convert","convertPromise","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","call","m","O","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","j","every","getter","__esModule","getPrototypeOf","ns","def","current","getOwnPropertyNames","definition","defineProperty","enumerable","chunkId","reduce","miniCssF","globalThis","Function","prop","done","needAttach","scripts","getElementsByTagName","getAttribute","charset","nc","onScriptComplete","prev","doneFns","parentNode","removeChild","bind","Symbol","toStringTag","scriptUrl","importScripts","currentScript","Error","oldGetScript","oldLoadScript","queryMap","countMap","retries","realSrc","cacheBust","baseURI","installedChunks","installedChunkData","errorType","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/public/mtproto.worker.44189744893b344288e7.chunk.js b/public/mtproto.worker.44189744893b344288e7.chunk.js deleted file mode 100644 index fcb940d7..00000000 --- a/public/mtproto.worker.44189744893b344288e7.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -(()=>{"use strict";var e,t,a={410:(e,t,a)=>{a.d(t,{GO:()=>n,ZP:()=>i});const s=a(1267).Z.debug,n="undefined"!=typeof window?window:self,i=s},3447:(e,t,a)=>{a.d(t,{Z:()=>i});const s={14:{"1f6dd":4867,"1f6de":4916,"1f6df":4923,"1f7f0":62832,"1f979":183,"1f9cc":1557,"1fa7b":61332,"1fa7c":61330,"1faa9":51093,"1faaa":61364,"1faab":61189,"1faac":51085,"1fab7":2651,"1fab8":2631,"1fab9":2672,"1faba":2673,"1fac3":1520,"1fac4":1521,"1fac5":1505,"1fad7":3793,"1fad8":3707,"1fad9":3804,"1fae0":111,"1fae1":136,"1fae2":132,"1fae3":133,"1fae4":174,"1fae5":142,"1fae6":1385,"1fae7":61353,"1faf0":1341,"1faf1":1332,"1faf2":1333,"1faf3":1334,"1faf4":1335,"1faf5":1351,"1faf6":1360,"1faf1-1f3fb-200d-1faf2-1f3fc":0,"1faf1-1f3fb-200d-1faf2-1f3fd":0,"1faf1-1f3fb-200d-1faf2-1f3fe":0,"1faf1-1f3fb-200d-1faf2-1f3ff":0,"1faf1-1f3fc-200d-1faf2-1f3fb":0,"1faf1-1f3fc-200d-1faf2-1f3fd":0,"1faf1-1f3fc-200d-1faf2-1f3fe":0,"1faf1-1f3fc-200d-1faf2-1f3ff":0,"1faf1-1f3fd-200d-1faf2-1f3fb":0,"1faf1-1f3fd-200d-1faf2-1f3fc":0,"1faf1-1f3fd-200d-1faf2-1f3fe":0,"1faf1-1f3fd-200d-1faf2-1f3ff":0,"1faf1-1f3fe-200d-1faf2-1f3fb":0,"1faf1-1f3fe-200d-1faf2-1f3fc":0,"1faf1-1f3fe-200d-1faf2-1f3fd":0,"1faf1-1f3fe-200d-1faf2-1f3ff":0,"1faf1-1f3ff-200d-1faf2-1f3fb":0,"1faf1-1f3ff-200d-1faf2-1f3fc":0,"1faf1-1f3ff-200d-1faf2-1f3fd":0,"1faf1-1f3ff-200d-1faf2-1f3fe":0,"1fac3-1f3fb":0,"1fac3-1f3fc":0,"1fac3-1f3fd":0,"1fac3-1f3fe":0,"1fac3-1f3ff":0,"1fac4-1f3fb":0,"1fac4-1f3fc":0,"1fac4-1f3fd":0,"1fac4-1f3fe":0,"1fac4-1f3ff":0,"1fac5-1f3fb":0,"1fac5-1f3fc":0,"1fac5-1f3fd":0,"1fac5-1f3fe":0,"1fac5-1f3ff":0,"1faf0-1f3fb":0,"1faf0-1f3fc":0,"1faf0-1f3fd":0,"1faf0-1f3fe":0,"1faf0-1f3ff":0,"1faf1-1f3fb":0,"1faf1-1f3fc":0,"1faf1-1f3fd":0,"1faf1-1f3fe":0,"1faf1-1f3ff":0,"1faf2-1f3fb":0,"1faf2-1f3fc":0,"1faf2-1f3fd":0,"1faf2-1f3fe":0,"1faf2-1f3ff":0,"1faf3-1f3fb":0,"1faf3-1f3fc":0,"1faf3-1f3fd":0,"1faf3-1f3fe":0,"1faf3-1f3ff":0,"1faf4-1f3fb":0,"1faf4-1f3fc":0,"1faf4-1f3fd":0,"1faf4-1f3fe":0,"1faf4-1f3ff":0,"1faf5-1f3fb":0,"1faf5-1f3fc":0,"1faf5-1f3fd":0,"1faf5-1f3fe":0,"1faf5-1f3ff":0,"1faf6-1f3fb":0,"1faf6-1f3fc":0,"1faf6-1f3fd":0,"1faf6-1f3fe":0,"1faf6-1f3ff":0},"":{2049:62835,2122:62863,2139:62888,2194:62764,2195:62763,2196:62762,2197:62756,2198:62758,2199:62760,2328:61194,2600:4990,2601:4998,2602:41013,2603:41018,2604:41020,2611:62851,2614:41014,2615:3781,2618:2667,2620:1106,2622:62753,2623:62754,2626:62783,2638:62780,2639:177,2648:62788,2649:62789,2650:62796,2651:62797,2652:62798,2653:62799,2660:51095,2663:51098,2665:51096,2666:51097,2668:4865,2692:61297,2693:4922,2694:61300,2696:61311,2697:61319,2699:61309,2702:61284,2705:62850,2708:4931,2709:61245,2712:61259,2714:62852,2716:62828,2721:62779,2728:51029,2733:62858,2734:62859,2744:41017,2747:62860,2753:62836,2754:62837,2755:62838,2757:62839,2763:1137,2764:1141,2795:62829,2796:62830,2797:62831,2934:62767,2935:62768,3030:62840,3297:62912,3299:62913,"0023-20e3":62864,"002a-20e3":62865,"0030-20e3":62866,"0031-20e3":62867,"0032-20e3":62868,"0033-20e3":62869,"0034-20e3":62870,"0035-20e3":62871,"0036-20e3":62872,"0037-20e3":62873,"0038-20e3":62874,"0039-20e3":62875,"00a9":62861,"00ae":62862,"1f004":51101,"1f0cf":51100,"1f170":62882,"1f171":62884,"1f17e":62893,"1f17f":62895,"1f18e":62883,"1f191":62885,"1f192":62886,"1f193":62887,"1f194":62889,"1f195":62891,"1f196":62892,"1f197":62894,"1f198":62896,"1f199":62897,"1f19a":62898,"1f1e6-1f1e8":71594,"1f1e6-1f1e9":71595,"1f1e6-1f1ea":71596,"1f1e6-1f1eb":71597,"1f1e6-1f1ec":71598,"1f1e6-1f1ee":71599,"1f1e6-1f1f1":71600,"1f1e6-1f1f2":71601,"1f1e6-1f1f4":71602,"1f1e6-1f1f6":71603,"1f1e6-1f1f7":71604,"1f1e6-1f1f8":71605,"1f1e6-1f1f9":71606,"1f1e6-1f1fa":71607,"1f1e6-1f1fc":71608,"1f1e6-1f1fd":71609,"1f1e6-1f1ff":71610,"1f1e7-1f1e6":71611,"1f1e7-1f1e7":71612,"1f1e7-1f1e9":71613,"1f1e7-1f1ea":71614,"1f1e7-1f1eb":71615,"1f1e7-1f1ec":71616,"1f1e7-1f1ed":71617,"1f1e7-1f1ee":71618,"1f1e7-1f1ef":71619,"1f1e7-1f1f1":71620,"1f1e7-1f1f2":71621,"1f1e7-1f1f3":71622,"1f1e7-1f1f4":71623,"1f1e7-1f1f6":71624,"1f1e7-1f1f7":71625,"1f1e7-1f1f8":71626,"1f1e7-1f1f9":71627,"1f1e7-1f1fb":71628,"1f1e7-1f1fc":71629,"1f1e7-1f1fe":71630,"1f1e7-1f1ff":71631,"1f1e8-1f1e6":71632,"1f1e8-1f1e8":71633,"1f1e8-1f1e9":71634,"1f1e8-1f1eb":71635,"1f1e8-1f1ec":71636,"1f1e8-1f1ed":71637,"1f1e8-1f1ee":71638,"1f1e8-1f1f0":71639,"1f1e8-1f1f1":71640,"1f1e8-1f1f2":71641,"1f1e8-1f1f3":71642,"1f1e8-1f1f4":71643,"1f1e8-1f1f5":71644,"1f1e8-1f1f7":71645,"1f1e8-1f1fa":71646,"1f1e8-1f1fb":71647,"1f1e8-1f1fc":71648,"1f1e8-1f1fd":71649,"1f1e8-1f1fe":71650,"1f1e8-1f1ff":71651,"1f1e9-1f1ea":71652,"1f1e9-1f1ec":71653,"1f1e9-1f1ef":71654,"1f1e9-1f1f0":71655,"1f1e9-1f1f2":71656,"1f1e9-1f1f4":71657,"1f1e9-1f1ff":71658,"1f1ea-1f1e6":71659,"1f1ea-1f1e8":71660,"1f1ea-1f1ea":71661,"1f1ea-1f1ec":71662,"1f1ea-1f1ed":71663,"1f1ea-1f1f7":71664,"1f1ea-1f1f8":71665,"1f1ea-1f1f9":71666,"1f1ea-1f1fa":71667,"1f1eb-1f1ee":71668,"1f1eb-1f1ef":71669,"1f1eb-1f1f0":71670,"1f1eb-1f1f2":71671,"1f1eb-1f1f4":71672,"1f1eb-1f1f7":71673,"1f1ec-1f1e6":71674,"1f1ec-1f1e7":71675,"1f1ec-1f1e9":71676,"1f1ec-1f1ea":71677,"1f1ec-1f1eb":71678,"1f1ec-1f1ec":71679,"1f1ec-1f1ed":71680,"1f1ec-1f1ee":71681,"1f1ec-1f1f1":71682,"1f1ec-1f1f2":71683,"1f1ec-1f1f3":71684,"1f1ec-1f1f5":71685,"1f1ec-1f1f6":71686,"1f1ec-1f1f7":71687,"1f1ec-1f1f8":71688,"1f1ec-1f1f9":71689,"1f1ec-1f1fa":71690,"1f1ec-1f1fc":71691,"1f1ec-1f1fe":71692,"1f1ed-1f1f0":71693,"1f1ed-1f1f2":71694,"1f1ed-1f1f3":71695,"1f1ed-1f1f7":71696,"1f1ed-1f1f9":71697,"1f1ed-1f1fa":71698,"1f1ee-1f1e8":71699,"1f1ee-1f1e9":71700,"1f1ee-1f1ea":71701,"1f1ee-1f1f1":71702,"1f1ee-1f1f2":71703,"1f1ee-1f1f3":71704,"1f1ee-1f1f4":71705,"1f1ee-1f1f6":71706,"1f1ee-1f1f7":71707,"1f1ee-1f1f8":71708,"1f1ee-1f1f9":71709,"1f1ef-1f1ea":71710,"1f1ef-1f1f2":71711,"1f1ef-1f1f4":71712,"1f1ef-1f1f5":71713,"1f1f0-1f1ea":71714,"1f1f0-1f1ec":71715,"1f1f0-1f1ed":71716,"1f1f0-1f1ee":71717,"1f1f0-1f1f2":71718,"1f1f0-1f1f3":71719,"1f1f0-1f1f5":71720,"1f1f0-1f1f7":71721,"1f1f0-1f1fc":71722,"1f1f0-1f1fe":71723,"1f1f0-1f1ff":71724,"1f1f1-1f1e6":71725,"1f1f1-1f1e7":71726,"1f1f1-1f1e8":71727,"1f1f1-1f1ee":71728,"1f1f1-1f1f0":71729,"1f1f1-1f1f7":71730,"1f1f1-1f1f8":71731,"1f1f1-1f1f9":71732,"1f1f1-1f1fa":71733,"1f1f1-1f1fb":71734,"1f1f1-1f1fe":71735,"1f1f2-1f1e6":71736,"1f1f2-1f1e8":71737,"1f1f2-1f1e9":71738,"1f1f2-1f1ea":71739,"1f1f2-1f1eb":71740,"1f1f2-1f1ec":71741,"1f1f2-1f1ed":71742,"1f1f2-1f1f0":71743,"1f1f2-1f1f1":71744,"1f1f2-1f1f2":71745,"1f1f2-1f1f3":71746,"1f1f2-1f1f4":71747,"1f1f2-1f1f5":71748,"1f1f2-1f1f6":71749,"1f1f2-1f1f7":71750,"1f1f2-1f1f8":71751,"1f1f2-1f1f9":71752,"1f1f2-1f1fa":71753,"1f1f2-1f1fb":71754,"1f1f2-1f1fc":71755,"1f1f2-1f1fd":71756,"1f1f2-1f1fe":71757,"1f1f2-1f1ff":71758,"1f1f3-1f1e6":71759,"1f1f3-1f1e8":71760,"1f1f3-1f1ea":71761,"1f1f3-1f1eb":71762,"1f1f3-1f1ec":71763,"1f1f3-1f1ee":71764,"1f1f3-1f1f1":71765,"1f1f3-1f1f4":71766,"1f1f3-1f1f5":71767,"1f1f3-1f1f7":71768,"1f1f3-1f1fa":71769,"1f1f3-1f1ff":71770,"1f1f4-1f1f2":71771,"1f1f5-1f1e6":71772,"1f1f5-1f1ea":71773,"1f1f5-1f1eb":71774,"1f1f5-1f1ec":71775,"1f1f5-1f1ed":71776,"1f1f5-1f1f0":71777,"1f1f5-1f1f1":71778,"1f1f5-1f1f2":71779,"1f1f5-1f1f3":71780,"1f1f5-1f1f7":71781,"1f1f5-1f1f8":71782,"1f1f5-1f1f9":71783,"1f1f5-1f1fc":71784,"1f1f5-1f1fe":71785,"1f1f6-1f1e6":71786,"1f1f7-1f1ea":71787,"1f1f7-1f1f4":71788,"1f1f7-1f1f8":71789,"1f1f7-1f1fa":71790,"1f1f7-1f1fc":71791,"1f1f8-1f1e6":71792,"1f1f8-1f1e7":71793,"1f1f8-1f1e8":71794,"1f1f8-1f1e9":71795,"1f1f8-1f1ea":71796,"1f1f8-1f1ec":71797,"1f1f8-1f1ed":71798,"1f1f8-1f1ee":71799,"1f1f8-1f1ef":71800,"1f1f8-1f1f0":71801,"1f1f8-1f1f1":71802,"1f1f8-1f1f2":71803,"1f1f8-1f1f3":71804,"1f1f8-1f1f4":71805,"1f1f8-1f1f7":71806,"1f1f8-1f1f8":71807,"1f1f8-1f1f9":71808,"1f1f8-1f1fb":71809,"1f1f8-1f1fd":71810,"1f1f8-1f1fe":71811,"1f1f8-1f1ff":71812,"1f1f9-1f1e6":71813,"1f1f9-1f1e8":71814,"1f1f9-1f1e9":71815,"1f1f9-1f1eb":71816,"1f1f9-1f1ec":71817,"1f1f9-1f1ed":71818,"1f1f9-1f1ef":71819,"1f1f9-1f1f0":71820,"1f1f9-1f1f1":71821,"1f1f9-1f1f2":71822,"1f1f9-1f1f3":71823,"1f1f9-1f1f4":71824,"1f1f9-1f1f7":71825,"1f1f9-1f1f9":71826,"1f1f9-1f1fb":71827,"1f1f9-1f1fc":71828,"1f1f9-1f1ff":71829,"1f1fa-1f1e6":71830,"1f1fa-1f1ec":71831,"1f1fa-1f1f2":71832,"1f1fa-1f1f3":71833,"1f1fa-1f1f8":71834,"1f1fa-1f1fe":71835,"1f1fa-1f1ff":71836,"1f1fb-1f1e6":71837,"1f1fb-1f1e8":71838,"1f1fb-1f1ea":71839,"1f1fb-1f1ec":71840,"1f1fb-1f1ee":71841,"1f1fb-1f1f3":71842,"1f1fb-1f1fa":71843,"1f1fc-1f1eb":71844,"1f1fc-1f1f8":71845,"1f1fd-1f1f0":71846,"1f1fe-1f1ea":71847,"1f1fe-1f1f9":71848,"1f1ff-1f1e6":71849,"1f1ff-1f1f2":71850,"1f1ff-1f1fc":71851,"1f201":62899,"1f202":62900,"1f21a":62906,"1f22f":62903,"1f232":62907,"1f233":62911,"1f234":62910,"1f235":62915,"1f236":62902,"1f237":62901,"1f238":62909,"1f239":62905,"1f23a":62914,"1f250":62904,"1f251":62908,"1f300":41010,"1f301":4857,"1f302":41012,"1f303":4858,"1f304":4860,"1f305":4861,"1f306":4862,"1f307":4863,"1f308":41011,"1f309":4864,"1f30a":41023,"1f30b":4815,"1f30c":4997,"1f30d":4806,"1f30e":4807,"1f30f":4808,"1f310":4809,"1f311":4977,"1f312":4978,"1f313":4979,"1f314":4980,"1f315":4981,"1f316":4982,"1f317":4983,"1f318":4984,"1f319":4985,"1f31a":4986,"1f31b":4987,"1f31c":4988,"1f31d":4991,"1f31e":4992,"1f31f":4995,"1f320":4996,"1f321":4989,"1f324":41001,"1f325":41002,"1f326":41003,"1f327":41004,"1f328":41005,"1f329":41006,"1f32a":41007,"1f32b":41008,"1f32c":41009,"1f32d":3725,"1f32e":3727,"1f32f":3728,"1f330":3708,"1f331":2659,"1f332":2661,"1f333":2662,"1f334":2663,"1f335":2664,"1f336":3698,"1f337":2658,"1f338":2649,"1f339":2653,"1f33a":2655,"1f33b":2656,"1f33c":2657,"1f33d":3697,"1f33e":2665,"1f33f":2666,"1f340":2668,"1f341":2669,"1f342":2670,"1f343":2671,"1f344":3705,"1f345":3690,"1f346":3694,"1f347":3674,"1f348":3675,"1f349":3676,"1f34a":3677,"1f34b":3678,"1f34c":3679,"1f34d":3680,"1f34e":3682,"1f34f":3683,"1f350":3684,"1f351":3685,"1f352":3686,"1f353":3687,"1f354":3722,"1f355":3724,"1f356":3718,"1f357":3719,"1f358":3744,"1f359":3745,"1f35a":3746,"1f35b":3747,"1f35c":3748,"1f35d":3749,"1f35e":3709,"1f35f":3723,"1f360":3750,"1f361":3756,"1f362":3751,"1f363":3752,"1f364":3753,"1f365":3754,"1f366":3765,"1f367":3766,"1f368":3767,"1f369":3768,"1f36a":3769,"1f36b":3774,"1f36c":3775,"1f36d":3776,"1f36e":3777,"1f36f":3778,"1f370":3771,"1f371":3743,"1f372":3735,"1f373":3733,"1f374":3801,"1f375":3783,"1f376":3784,"1f377":3786,"1f378":3787,"1f379":3788,"1f37a":3789,"1f37b":3790,"1f37c":3779,"1f37d":3800,"1f37e":3785,"1f37f":3739,"1f380":51040,"1f381":51041,"1f382":3770,"1f383":51024,"1f384":51025,"1f385":1527,"1f386":51026,"1f387":51027,"1f388":51030,"1f389":51031,"1f38a":51032,"1f38b":51033,"1f38c":71588,"1f38d":51034,"1f38e":51035,"1f38f":51036,"1f390":51037,"1f391":51038,"1f392":61134,"1f393":61147,"1f396":51045,"1f397":51042,"1f399":61167,"1f39a":61168,"1f39b":61169,"1f39e":61203,"1f39f":51043,"1f3a0":4866,"1f3a1":4868,"1f3a2":4869,"1f3a3":51072,"1f3a4":61170,"1f3a5":61202,"1f3a6":62819,"1f3a7":61171,"1f3a8":51105,"1f3a9":61146,"1f3aa":4871,"1f3ab":51044,"1f3ac":61205,"1f3ad":51103,"1f3ae":51086,"1f3af":51078,"1f3b0":51088,"1f3b1":51081,"1f3b2":51089,"1f3b3":51060,"1f3b4":51102,"1f3b5":61165,"1f3b6":61166,"1f3b7":61173,"1f3b8":61175,"1f3b9":61176,"1f3ba":61177,"1f3bb":61178,"1f3bc":61164,"1f3bd":51074,"1f3be":51058,"1f3bf":51075,"1f3c0":51054,"1f3c1":71586,"1f3c2":1600,"1f3c3-200d-2640":1584,"1f3c3-200d-2642":1583,"1f3c3":1582,"1f3c4-200d-2640":1606,"1f3c4-200d-2642":1605,"1f3c4":1604,"1f3c5":51047,"1f3c6":51046,"1f3c7":1598,"1f3c8":51056,"1f3c9":51057,"1f3ca-200d-2640":1612,"1f3ca-200d-2642":1611,"1f3ca":1610,"1f3cb-200d-2640":1618,"1f3cb-200d-2642":1617,"1f3cb":1616,"1f3cc-200d-2640":1603,"1f3cc-200d-2642":1602,"1f3cc":1601,"1f3cd":4902,"1f3ce":4901,"1f3cf":51061,"1f3d0":51055,"1f3d1":51062,"1f3d2":51063,"1f3d3":51065,"1f3d4":4813,"1f3d5":4817,"1f3d6":4818,"1f3d7":4824,"1f3d8":4829,"1f3d9":4859,"1f3da":4830,"1f3db":4823,"1f3dc":4819,"1f3dd":4820,"1f3de":4821,"1f3df":4822,"1f3e0":4831,"1f3e1":4832,"1f3e2":4833,"1f3e3":4834,"1f3e4":4835,"1f3e5":4836,"1f3e6":4837,"1f3e7":62729,"1f3e8":4838,"1f3e9":4839,"1f3ea":4840,"1f3eb":4841,"1f3ec":4842,"1f3ed":4843,"1f3ee":61216,"1f3ef":4844,"1f3f0":4845,"1f3f3-200d-1f308":71591,"1f3f3-200d-26a7":71592,"1f3f3":71590,"1f3f4-200d-2620":71593,"1f3f4-e0067-e0062-e0065-e006e-e0067-e007f":71852,"1f3f4-e0067-e0062-e0073-e0063-e0074-e007f":71853,"1f3f4-e0067-e0062-e0077-e006c-e0073-e007f":71854,"1f3f4":71589,"1f3f5":2652,"1f3f7":61234,"1f3f8":51066,"1f3f9":61303,"1f3fa":3805,"1f3fb":9525,"1f3fc":9526,"1f3fd":9527,"1f3fe":9528,"1f3ff":9529,"1f400":2576,"1f401":2575,"1f402":2556,"1f403":2557,"1f404":2558,"1f405":2547,"1f406":2548,"1f407":2579,"1f408-200d-2b1b":2544,"1f408":2543,"1f409":2618,"1f40a":2613,"1f40b":2622,"1f40c":2632,"1f40d":2616,"1f40e":2550,"1f40f":2563,"1f410":2565,"1f411":2564,"1f412":2531,"1f413":2596,"1f414":2595,"1f415-200d-1f9ba":2537,"1f415":2535,"1f416":2560,"1f417":2561,"1f418":2570,"1f419":2629,"1f41a":2630,"1f41b":2634,"1f41c":2635,"1f41d":2636,"1f41e":2638,"1f41f":2625,"1f420":2626,"1f421":2627,"1f422":2614,"1f423":2597,"1f424":2598,"1f425":2599,"1f426":2600,"1f427":2601,"1f428":2586,"1f429":2538,"1f42a":2566,"1f42b":2567,"1f42c":2623,"1f42d":2574,"1f42e":2555,"1f42f":2546,"1f430":2578,"1f431":2542,"1f432":2617,"1f433":2621,"1f434":2549,"1f435":2530,"1f436":2534,"1f437":2559,"1f438":2612,"1f439":2577,"1f43a":2539,"1f43b-200d-2744":2585,"1f43b":2584,"1f43c":2587,"1f43d":2562,"1f43e":2593,"1f43f":2580,"1f440":1381,"1f441-200d-1f5e8":1159,"1f441":1382,"1f442":1373,"1f443":1375,"1f444":1384,"1f445":1383,"1f446":1347,"1f447":1349,"1f448":1345,"1f449":1346,"1f44a":1355,"1f44b":1327,"1f44c":1336,"1f44d":1352,"1f44e":1353,"1f44f":1358,"1f450":1361,"1f451":61144,"1f452":61145,"1f453":61110,"1f454":61115,"1f455":61116,"1f456":61117,"1f457":61122,"1f458":61123,"1f459":61128,"1f45a":61129,"1f45b":61130,"1f45c":61131,"1f45d":61132,"1f45e":61136,"1f45f":61137,"1f460":61140,"1f461":61141,"1f462":61143,"1f463":1687,"1f464":1684,"1f465":1685,"1f466":1388,"1f467":1389,"1f468-200d-1f33e":1457,"1f468-200d-1f373":1460,"1f468-200d-1f37c":1524,"1f468-200d-1f393":1448,"1f468-200d-1f3a4":1478,"1f468-200d-1f3a8":1481,"1f468-200d-1f3eb":1451,"1f468-200d-1f3ed":1466,"1f468-200d-1f466-200d-1f466":1674,"1f468-200d-1f466":1673,"1f468-200d-1f467-200d-1f466":1676,"1f468-200d-1f467-200d-1f467":1677,"1f468-200d-1f467":1675,"1f468-200d-1f468-200d-1f466":1663,"1f468-200d-1f468-200d-1f466-200d-1f466":1666,"1f468-200d-1f468-200d-1f467":1664,"1f468-200d-1f468-200d-1f467-200d-1f466":1665,"1f468-200d-1f468-200d-1f467-200d-1f467":1667,"1f468-200d-1f469-200d-1f466":1658,"1f468-200d-1f469-200d-1f466-200d-1f466":1661,"1f468-200d-1f469-200d-1f467":1659,"1f468-200d-1f469-200d-1f467-200d-1f466":1660,"1f468-200d-1f469-200d-1f467-200d-1f467":1662,"1f468-200d-1f4bb":1475,"1f468-200d-1f4bc":1469,"1f468-200d-1f527":1463,"1f468-200d-1f52c":1472,"1f468-200d-1f680":1487,"1f468-200d-1f692":1490,"1f468-200d-1f9af":1574,"1f468-200d-1f9b0":1396,"1f468-200d-1f9b1":1397,"1f468-200d-1f9b2":1399,"1f468-200d-1f9b3":1398,"1f468-200d-1f9bc":1577,"1f468-200d-1f9bd":1580,"1f468-200d-2695":1445,"1f468-200d-2696":1454,"1f468-200d-2708":1484,"1f468-200d-2764-200d-1f468":1655,"1f468-200d-2764-200d-1f48b-200d-1f468":1651,"1f468":1392,"1f469-200d-1f33e":1458,"1f469-200d-1f373":1461,"1f469-200d-1f37c":1523,"1f469-200d-1f393":1449,"1f469-200d-1f3a4":1479,"1f469-200d-1f3a8":1482,"1f469-200d-1f3eb":1452,"1f469-200d-1f3ed":1467,"1f469-200d-1f466-200d-1f466":1679,"1f469-200d-1f466":1678,"1f469-200d-1f467-200d-1f466":1681,"1f469-200d-1f467-200d-1f467":1682,"1f469-200d-1f467":1680,"1f469-200d-1f469-200d-1f466":1668,"1f469-200d-1f469-200d-1f466-200d-1f466":1671,"1f469-200d-1f469-200d-1f467":1669,"1f469-200d-1f469-200d-1f467-200d-1f466":1670,"1f469-200d-1f469-200d-1f467-200d-1f467":1672,"1f469-200d-1f4bb":1476,"1f469-200d-1f4bc":1470,"1f469-200d-1f527":1464,"1f469-200d-1f52c":1473,"1f469-200d-1f680":1488,"1f469-200d-1f692":1491,"1f469-200d-1f9af":1575,"1f469-200d-1f9b0":1401,"1f469-200d-1f9b1":1403,"1f469-200d-1f9b2":1407,"1f469-200d-1f9b3":1405,"1f469-200d-1f9bc":1578,"1f469-200d-1f9bd":1581,"1f469-200d-2695":1446,"1f469-200d-2696":1455,"1f469-200d-2708":1485,"1f469-200d-2764-200d-1f468":1654,"1f469-200d-2764-200d-1f469":1656,"1f469-200d-2764-200d-1f48b-200d-1f468":1650,"1f469-200d-2764-200d-1f48b-200d-1f469":1652,"1f469":1400,"1f46a":1657,"1f46b":1647,"1f46c":1648,"1f46d":1646,"1f46e-200d-2640":1494,"1f46e-200d-2642":1493,"1f46e":1492,"1f46f-200d-2640":1590,"1f46f-200d-2642":1589,"1f46f":1588,"1f470-200d-2640":1518,"1f470-200d-2642":1517,"1f470":1516,"1f471-200d-2640":1409,"1f471-200d-2642":1410,"1f471":1391,"1f472":1511,"1f473-200d-2640":1510,"1f473-200d-2642":1509,"1f473":1508,"1f474":1412,"1f475":1413,"1f476":1386,"1f477-200d-2640":1504,"1f477-200d-2642":1503,"1f477":1502,"1f478":1507,"1f479":1109,"1f47a":1110,"1f47b":1111,"1f47c":1526,"1f47d":1112,"1f47e":1113,"1f47f":1104,"1f480":1105,"1f481-200d-2640":1428,"1f481-200d-2642":1427,"1f481":1426,"1f482-200d-2640":1500,"1f482-200d-2642":1499,"1f482":1498,"1f483":1585,"1f484":61152,"1f485":1366,"1f486-200d-2640":1560,"1f486-200d-2642":1559,"1f486":1558,"1f487-200d-2640":1563,"1f487-200d-2642":1562,"1f487":1561,"1f488":4870,"1f489":61326,"1f48a":61328,"1f48b":1127,"1f48c":1128,"1f48d":61153,"1f48e":61154,"1f48f":1649,"1f490":2648,"1f491":1653,"1f492":4846,"1f493":1133,"1f494":1138,"1f495":1135,"1f496":1131,"1f497":1132,"1f498":1129,"1f499":1145,"1f49a":1144,"1f49b":1143,"1f49c":1146,"1f49d":1130,"1f49e":1134,"1f49f":1136,"1f4a0":62946,"1f4a1":61214,"1f4a2":1151,"1f4a3":1157,"1f4a4":1163,"1f4a5":1152,"1f4a6":1154,"1f4a7":41022,"1f4a8":1155,"1f4a9":1107,"1f4aa":1368,"1f4ab":1153,"1f4ac":1158,"1f4ad":1162,"1f4ae":2650,"1f4af":1150,"1f4b0":61235,"1f4b1":62841,"1f4b2":62842,"1f4b3":61242,"1f4b4":61237,"1f4b5":61238,"1f4b6":61239,"1f4b7":61240,"1f4b8":61241,"1f4b9":61244,"1f4ba":4936,"1f4bb":61191,"1f4bc":61265,"1f4bd":61197,"1f4be":61198,"1f4bf":61199,"1f4c0":61200,"1f4c1":61266,"1f4c2":61267,"1f4c3":61227,"1f4c4":61229,"1f4c5":61269,"1f4c6":61270,"1f4c7":61273,"1f4c8":61274,"1f4c9":61275,"1f4ca":61276,"1f4cb":61277,"1f4cc":61278,"1f4cd":61279,"1f4ce":61280,"1f4cf":61282,"1f4d0":61283,"1f4d1":61232,"1f4d2":61226,"1f4d3":61225,"1f4d4":61218,"1f4d5":61219,"1f4d6":61220,"1f4d7":61221,"1f4d8":61222,"1f4d9":61223,"1f4da":61224,"1f4db":62847,"1f4dc":61228,"1f4dd":61264,"1f4de":61185,"1f4df":61186,"1f4e0":61187,"1f4e1":61325,"1f4e2":61159,"1f4e3":61160,"1f4e4":61249,"1f4e5":61250,"1f4e6":61251,"1f4e7":61246,"1f4e8":61247,"1f4e9":61248,"1f4ea":61253,"1f4eb":61252,"1f4ec":61254,"1f4ed":61255,"1f4ee":61256,"1f4ef":61161,"1f4f0":61230,"1f4f1":61182,"1f4f2":61183,"1f4f3":62823,"1f4f4":62824,"1f4f5":62751,"1f4f6":62822,"1f4f7":61207,"1f4f8":61208,"1f4f9":61209,"1f4fa":61206,"1f4fb":61172,"1f4fc":61210,"1f4fd":61204,"1f4ff":61151,"1f500":62801,"1f501":62802,"1f502":62803,"1f503":62769,"1f504":62770,"1f505":62820,"1f506":62821,"1f507":61155,"1f508":61156,"1f509":61157,"1f50a":61158,"1f50b":61188,"1f50c":61190,"1f50d":61211,"1f50e":61212,"1f50f":61290,"1f510":61291,"1f511":61292,"1f512":61288,"1f513":61289,"1f514":61162,"1f515":61163,"1f516":61233,"1f517":61313,"1f518":62947,"1f519":62771,"1f51a":62772,"1f51b":62773,"1f51c":62774,"1f51d":62775,"1f51e":62752,"1f51f":62876,"1f520":62877,"1f521":62878,"1f522":62879,"1f523":62880,"1f524":62881,"1f525":41021,"1f526":61215,"1f527":61306,"1f528":61294,"1f529":61308,"1f52a":3803,"1f52b":61301,"1f52c":61323,"1f52d":61324,"1f52e":51082,"1f52f":62787,"1f530":62848,"1f531":62846,"1f532":62949,"1f533":62948,"1f534":62916,"1f535":62920,"1f536":62940,"1f537":62941,"1f538":62942,"1f539":62943,"1f53a":62944,"1f53b":62945,"1f53c":62811,"1f53d":62813,"1f549":62778,"1f54a":2602,"1f54b":4854,"1f54c":4850,"1f54d":4852,"1f54e":62786,"1f550":4955,"1f551":4957,"1f552":4959,"1f553":4961,"1f554":4963,"1f555":4965,"1f556":4967,"1f557":4969,"1f558":4971,"1f559":4973,"1f55a":4975,"1f55b":4953,"1f55c":4956,"1f55d":4958,"1f55e":4960,"1f55f":4962,"1f560":4964,"1f561":4966,"1f562":4968,"1f563":4970,"1f564":4972,"1f565":4974,"1f566":4976,"1f567":4954,"1f56f":61213,"1f570":4952,"1f573":1156,"1f574":1587,"1f575-200d-2640":1497,"1f575-200d-2642":1496,"1f575":1495,"1f576":61111,"1f577":2641,"1f578":2642,"1f579":51087,"1f57a":1586,"1f587":61281,"1f58a":61261,"1f58b":61260,"1f58c":61262,"1f58d":61263,"1f590":1329,"1f595":1348,"1f596":1331,"1f5a4":1148,"1f5a5":61192,"1f5a8":61193,"1f5b1":61195,"1f5b2":61196,"1f5bc":51104,"1f5c2":61268,"1f5c3":61285,"1f5c4":61286,"1f5d1":61287,"1f5d2":61271,"1f5d3":61272,"1f5dc":61310,"1f5dd":61293,"1f5de":61231,"1f5e1":61299,"1f5e3":1683,"1f5e8":1160,"1f5ef":1161,"1f5f3":61257,"1f5fa":4810,"1f5fb":4816,"1f5fc":4847,"1f5fd":4848,"1f5fe":4811,"1f5ff":61362,"1f600":11,"1f601":14,"1f602":18,"1f603":12,"1f604":13,"1f605":16,"1f606":15,"1f607":114,"1f608":1103,"1f609":112,"1f60a":113,"1f60b":124,"1f60c":150,"1f60d":116,"1f60e":170,"1f60f":144,"1f610":139,"1f611":140,"1f612":145,"1f613":195,"1f614":151,"1f615":173,"1f616":192,"1f617":119,"1f618":118,"1f619":122,"1f61a":121,"1f61b":125,"1f61c":126,"1f61d":128,"1f61e":194,"1f61f":175,"1f620":1101,"1f621":1100,"1f622":189,"1f623":193,"1f624":199,"1f625":188,"1f626":184,"1f627":185,"1f628":186,"1f629":196,"1f62a":152,"1f62b":197,"1f62c":147,"1f62d":190,"1f62e-200d-1f4a8":148,"1f62e":178,"1f62f":179,"1f630":187,"1f631":191,"1f632":180,"1f633":181,"1f634":154,"1f635-200d-1f4ab":165,"1f635":164,"1f636-200d-1f32b":143,"1f636":141,"1f637":155,"1f638":1116,"1f639":1117,"1f63a":1115,"1f63b":1118,"1f63c":1119,"1f63d":1120,"1f63e":1123,"1f63f":1122,"1f640":1121,"1f641":176,"1f642":19,"1f643":110,"1f644":146,"1f645-200d-2640":1422,"1f645-200d-2642":1421,"1f645":1420,"1f646-200d-2640":1425,"1f646-200d-2642":1424,"1f646":1423,"1f647-200d-2640":1437,"1f647-200d-2642":1436,"1f647":1435,"1f648":1124,"1f649":1125,"1f64a":1126,"1f64b-200d-2640":1431,"1f64b-200d-2642":1430,"1f64b":1429,"1f64c":1359,"1f64d-200d-2640":1416,"1f64d-200d-2642":1415,"1f64d":1414,"1f64e-200d-2640":1419,"1f64e-200d-2642":1418,"1f64e":1417,"1f64f":1364,"1f680":4942,"1f681":4937,"1f682":4872,"1f683":4873,"1f684":4874,"1f685":4875,"1f686":4876,"1f687":4877,"1f688":4878,"1f689":4879,"1f68a":4880,"1f68b":4883,"1f68c":4884,"1f68d":4885,"1f68e":4886,"1f68f":4911,"1f690":4887,"1f691":4888,"1f692":4889,"1f693":4890,"1f694":4891,"1f695":4892,"1f696":4893,"1f697":4894,"1f698":4895,"1f699":4896,"1f69a":4898,"1f69b":4899,"1f69c":4900,"1f69d":4881,"1f69e":4882,"1f69f":4938,"1f6a0":4939,"1f6a1":4940,"1f6a2":4930,"1f6a3-200d-2640":1609,"1f6a3-200d-2642":1608,"1f6a3":1607,"1f6a4":4926,"1f6a5":4918,"1f6a6":4919,"1f6a7":4921,"1f6a8":4917,"1f6a9":71587,"1f6aa":61333,"1f6ab":62745,"1f6ac":61358,"1f6ad":62747,"1f6ae":62730,"1f6af":62748,"1f6b0":62731,"1f6b1":62749,"1f6b2":4907,"1f6b3":62746,"1f6b4-200d-2640":1621,"1f6b4-200d-2642":1620,"1f6b4":1619,"1f6b5-200d-2640":1624,"1f6b5-200d-2642":1623,"1f6b5":1622,"1f6b6-200d-2640":1566,"1f6b6-200d-2642":1565,"1f6b6":1564,"1f6b7":62750,"1f6b8":62743,"1f6b9":62733,"1f6ba":62734,"1f6bb":62735,"1f6bc":62736,"1f6bd":61340,"1f6be":62737,"1f6bf":61342,"1f6c0":1643,"1f6c1":61343,"1f6c2":62738,"1f6c3":62739,"1f6c4":62740,"1f6c5":62741,"1f6cb":61338,"1f6cc":1644,"1f6cd":61133,"1f6ce":4944,"1f6cf":61337,"1f6d0":62776,"1f6d1":4920,"1f6d2":61357,"1f6d5":4851,"1f6d6":4828,"1f6d7":61334,"1f6e0":61298,"1f6e1":61304,"1f6e2":4914,"1f6e3":4912,"1f6e4":4913,"1f6e5":4929,"1f6e9":4932,"1f6eb":4933,"1f6ec":4934,"1f6f0":4941,"1f6f3":4927,"1f6f4":4908,"1f6f5":4903,"1f6f6":4925,"1f6f7":51076,"1f6f8":4943,"1f6f9":4909,"1f6fa":4906,"1f6fb":4897,"1f6fc":4910,"1f7e0":62917,"1f7e1":62918,"1f7e2":62919,"1f7e3":62921,"1f7e4":62922,"1f7e5":62925,"1f7e6":62929,"1f7e7":62926,"1f7e8":62927,"1f7e9":62928,"1f7ea":62930,"1f7eb":62931,"1f90c":1337,"1f90d":1149,"1f90e":1147,"1f90f":1338,"1f910":137,"1f911":129,"1f912":156,"1f913":171,"1f914":135,"1f915":157,"1f916":1114,"1f917":130,"1f918":1343,"1f919":1344,"1f91a":1328,"1f91b":1356,"1f91c":1357,"1f91d":1363,"1f91e":1340,"1f91f":1342,"1f920":167,"1f921":1108,"1f922":158,"1f923":17,"1f924":153,"1f925":149,"1f926-200d-2640":1440,"1f926-200d-2642":1439,"1f926":1438,"1f927":160,"1f928":138,"1f929":117,"1f92a":127,"1f92b":134,"1f92c":1102,"1f92d":131,"1f92e":159,"1f92f":166,"1f930":1519,"1f931":1522,"1f932":1362,"1f933":1367,"1f934":1506,"1f935-200d-2640":1515,"1f935-200d-2642":1514,"1f935":1513,"1f936":1528,"1f937-200d-2640":1443,"1f937-200d-2642":1442,"1f937":1441,"1f938-200d-2640":1627,"1f938-200d-2642":1626,"1f938":1625,"1f939-200d-2640":1639,"1f939-200d-2642":1638,"1f939":1637,"1f93a":1597,"1f93c-200d-2640":1630,"1f93c-200d-2642":1629,"1f93c":1628,"1f93d-200d-2640":1633,"1f93d-200d-2642":1632,"1f93d":1631,"1f93e-200d-2640":1636,"1f93e-200d-2642":1635,"1f93e":1634,"1f93f":51073,"1f940":2654,"1f941":61180,"1f942":3791,"1f943":3792,"1f944":3802,"1f945":51069,"1f947":51048,"1f948":51049,"1f949":51050,"1f94a":51067,"1f94b":51068,"1f94c":51077,"1f94d":51064,"1f94e":51053,"1f94f":51059,"1f950":3710,"1f951":3693,"1f952":3700,"1f953":3721,"1f954":3695,"1f955":3696,"1f956":3711,"1f957":3738,"1f958":3734,"1f959":3730,"1f95a":3732,"1f95b":3780,"1f95c":3706,"1f95d":3689,"1f95e":3715,"1f95f":3757,"1f960":3758,"1f961":3759,"1f962":3799,"1f963":3737,"1f964":3794,"1f965":3692,"1f966":3702,"1f967":3773,"1f968":3713,"1f969":3720,"1f96a":3726,"1f96b":3742,"1f96c":3701,"1f96d":3681,"1f96e":3755,"1f96f":3714,"1f970":115,"1f971":198,"1f972":123,"1f973":168,"1f974":163,"1f975":161,"1f976":162,"1f977":1501,"1f978":169,"1f97a":182,"1f97b":61124,"1f97c":61113,"1f97d":61112,"1f97e":61138,"1f97f":61139,"1f980":3760,"1f981":2545,"1f982":2643,"1f983":2594,"1f984":2551,"1f985":2603,"1f986":2604,"1f987":2583,"1f988":2628,"1f989":2606,"1f98a":2540,"1f98b":2633,"1f98c":2553,"1f98d":2532,"1f98e":2615,"1f98f":2572,"1f990":3762,"1f991":3763,"1f992":2569,"1f993":2552,"1f994":2582,"1f995":2619,"1f996":2620,"1f997":2639,"1f998":2591,"1f999":2568,"1f99a":2610,"1f99b":2573,"1f99c":2611,"1f99d":2541,"1f99e":3761,"1f99f":2644,"1f9a0":2647,"1f9a1":2592,"1f9a2":2605,"1f9a3":2571,"1f9a4":2607,"1f9a5":2588,"1f9a6":2589,"1f9a7":2533,"1f9a8":2590,"1f9a9":2609,"1f9aa":3764,"1f9ab":2581,"1f9ac":2554,"1f9ad":2624,"1f9ae":2536,"1f9af":61312,"1f9b4":1380,"1f9b5":1371,"1f9b6":1372,"1f9b7":1379,"1f9b8-200d-2640":1532,"1f9b8-200d-2642":1531,"1f9b8":1530,"1f9b9-200d-2640":1535,"1f9b9-200d-2642":1534,"1f9b9":1533,"1f9ba":61114,"1f9bb":1374,"1f9bc":4905,"1f9bd":4904,"1f9be":1369,"1f9bf":1370,"1f9c0":3717,"1f9c1":3772,"1f9c2":3741,"1f9c3":3796,"1f9c4":3703,"1f9c5":3704,"1f9c6":3731,"1f9c7":3716,"1f9c8":3740,"1f9c9":3797,"1f9ca":3798,"1f9cb":3795,"1f9cd-200d-2640":1569,"1f9cd-200d-2642":1568,"1f9cd":1567,"1f9ce-200d-2640":1572,"1f9ce-200d-2642":1571,"1f9ce":1570,"1f9cf-200d-2640":1434,"1f9cf-200d-2642":1433,"1f9cf":1432,"1f9d0":172,"1f9d1-200d-1f33e":1456,"1f9d1-200d-1f373":1459,"1f9d1-200d-1f37c":1525,"1f9d1-200d-1f384":1529,"1f9d1-200d-1f393":1447,"1f9d1-200d-1f3a4":1477,"1f9d1-200d-1f3a8":1480,"1f9d1-200d-1f3eb":1450,"1f9d1-200d-1f3ed":1465,"1f9d1-200d-1f4bb":1474,"1f9d1-200d-1f4bc":1468,"1f9d1-200d-1f527":1462,"1f9d1-200d-1f52c":1471,"1f9d1-200d-1f680":1486,"1f9d1-200d-1f692":1489,"1f9d1-200d-1f91d-200d-1f9d1":1645,"1f9d1-200d-1f9af":1573,"1f9d1-200d-1f9b0":1402,"1f9d1-200d-1f9b1":1404,"1f9d1-200d-1f9b2":1408,"1f9d1-200d-1f9b3":1406,"1f9d1-200d-1f9bc":1576,"1f9d1-200d-1f9bd":1579,"1f9d1-200d-2695":1444,"1f9d1-200d-2696":1453,"1f9d1-200d-2708":1483,"1f9d1":1390,"1f9d2":1387,"1f9d3":1411,"1f9d4-200d-2640":1395,"1f9d4-200d-2642":1394,"1f9d4":1393,"1f9d5":1512,"1f9d6-200d-2640":1593,"1f9d6-200d-2642":1592,"1f9d6":1591,"1f9d7-200d-2640":1596,"1f9d7-200d-2642":1595,"1f9d7":1594,"1f9d8-200d-2640":1642,"1f9d8-200d-2642":1641,"1f9d8":1640,"1f9d9-200d-2640":1538,"1f9d9-200d-2642":1537,"1f9d9":1536,"1f9da-200d-2640":1541,"1f9da-200d-2642":1540,"1f9da":1539,"1f9db-200d-2640":1544,"1f9db-200d-2642":1543,"1f9db":1542,"1f9dc-200d-2640":1547,"1f9dc-200d-2642":1546,"1f9dc":1545,"1f9dd-200d-2640":1550,"1f9dd-200d-2642":1549,"1f9dd":1548,"1f9de-200d-2640":1553,"1f9de-200d-2642":1552,"1f9de":1551,"1f9df-200d-2640":1556,"1f9df-200d-2642":1555,"1f9df":1554,"1f9e0":1376,"1f9e1":1142,"1f9e2":61148,"1f9e3":61118,"1f9e4":61119,"1f9e5":61120,"1f9e6":61121,"1f9e7":51039,"1f9e8":51028,"1f9e9":51090,"1f9ea":61320,"1f9eb":61321,"1f9ec":61322,"1f9ed":4812,"1f9ee":61201,"1f9ef":61356,"1f9f0":61316,"1f9f1":4825,"1f9f2":61317,"1f9f3":4945,"1f9f4":61346,"1f9f5":51106,"1f9f6":51108,"1f9f7":61347,"1f9f8":51091,"1f9f9":61348,"1f9fa":61349,"1f9fb":61350,"1f9fc":61352,"1f9fd":61355,"1f9fe":61243,"1f9ff":51084,"1fa70":61142,"1fa71":61125,"1fa72":61126,"1fa73":61127,"1fa74":61135,"1fa78":61327,"1fa79":61329,"1fa7a":61331,"1fa80":51079,"1fa81":51080,"1fa82":4935,"1fa83":61302,"1fa84":51083,"1fa85":51092,"1fa86":51094,"1fa90":4993,"1fa91":61339,"1fa92":61345,"1fa93":61295,"1fa94":61217,"1fa95":61179,"1fa96":61149,"1fa97":61174,"1fa98":61181,"1fa99":61236,"1fa9a":61305,"1fa9b":61307,"1fa9c":61318,"1fa9d":61315,"1fa9e":61335,"1fa9f":61336,"1faa0":61341,"1faa1":51107,"1faa2":51109,"1faa3":61351,"1faa4":61344,"1faa5":61354,"1faa6":61360,"1faa7":61363,"1faa8":4826,"1fab0":2645,"1fab1":2646,"1fab2":2637,"1fab3":2640,"1fab4":2660,"1fab5":4827,"1fab6":2608,"1fac0":1377,"1fac1":1378,"1fac2":1686,"1fad0":3688,"1fad1":3699,"1fad2":3691,"1fad3":3712,"1fad4":3729,"1fad5":3736,"1fad6":3782,"203c":62834,"21a9":62765,"21aa":62766,"231a":4948,"231b":4946,"23cf":62818,"23e9":62805,"23ea":62809,"23eb":62812,"23ec":62814,"23ed":62806,"23ee":62810,"23ef":62807,"23f0":4949,"23f1":4950,"23f2":4951,"23f3":4947,"23f8":62815,"23f9":62816,"23fa":62817,"24c2":62890,"25aa":62938,"25ab":62939,"25b6":62804,"25c0":62808,"25fb":62935,"25fc":62934,"25fd":62937,"25fe":62936,"260e":61184,"261d":1350,"262a":62784,"262e":62785,"262f":62781,"263a":120,"264a":62790,"264b":62791,"264c":62792,"264d":62793,"264e":62794,"264f":62795,"265f":51099,"267b":62844,"267e":62833,"267f":62732,"269b":62777,"269c":62845,"26a0":62742,"26a1":41016,"26a7":62827,"26aa":62924,"26ab":62923,"26b0":61359,"26b1":61361,"26bd":51051,"26be":51052,"26c4":41019,"26c5":4999,"26c8":41e3,"26ce":62800,"26cf":61296,"26d1":61150,"26d3":61314,"26d4":62744,"26e9":4853,"26ea":4849,"26f0":4814,"26f1":41015,"26f2":4855,"26f3":51070,"26f4":4928,"26f5":4924,"26f7":1599,"26f8":51071,"26f9-200d-2640":1615,"26f9-200d-2642":1614,"26f9":1613,"26fa":4856,"26fd":4915,"270a":1354,"270b":1330,"270c":1339,"270d":1365,"270f":61258,"271d":62782,"274c":62853,"274e":62854,"2764-200d-1f525":1139,"2764-200d-1fa79":1140,"27a1":62757,"27b0":62855,"27bf":62856,"2b05":62761,"2b06":62755,"2b07":62759,"2b1b":62932,"2b1c":62933,"2b50":4994,"2b55":62849,"303d":62857,"1f385-1f3fb":0,"1f385-1f3fc":0,"1f385-1f3fd":0,"1f385-1f3fe":0,"1f385-1f3ff":0,"1f3c2-1f3fb":0,"1f3c2-1f3fc":0,"1f3c2-1f3fd":0,"1f3c2-1f3fe":0,"1f3c2-1f3ff":0,"1f3c3-1f3fb-200d-2640":0,"1f3c3-1f3fc-200d-2640":0,"1f3c3-1f3fd-200d-2640":0,"1f3c3-1f3fe-200d-2640":0,"1f3c3-1f3ff-200d-2640":0,"1f3c3-1f3fb-200d-2642":0,"1f3c3-1f3fc-200d-2642":0,"1f3c3-1f3fd-200d-2642":0,"1f3c3-1f3fe-200d-2642":0,"1f3c3-1f3ff-200d-2642":0,"1f3c3-1f3fb":0,"1f3c3-1f3fc":0,"1f3c3-1f3fd":0,"1f3c3-1f3fe":0,"1f3c3-1f3ff":0,"1f3c4-1f3fb-200d-2640":0,"1f3c4-1f3fc-200d-2640":0,"1f3c4-1f3fd-200d-2640":0,"1f3c4-1f3fe-200d-2640":0,"1f3c4-1f3ff-200d-2640":0,"1f3c4-1f3fb-200d-2642":0,"1f3c4-1f3fc-200d-2642":0,"1f3c4-1f3fd-200d-2642":0,"1f3c4-1f3fe-200d-2642":0,"1f3c4-1f3ff-200d-2642":0,"1f3c4-1f3fb":0,"1f3c4-1f3fc":0,"1f3c4-1f3fd":0,"1f3c4-1f3fe":0,"1f3c4-1f3ff":0,"1f3c7-1f3fb":0,"1f3c7-1f3fc":0,"1f3c7-1f3fd":0,"1f3c7-1f3fe":0,"1f3c7-1f3ff":0,"1f3ca-1f3fb-200d-2640":0,"1f3ca-1f3fc-200d-2640":0,"1f3ca-1f3fd-200d-2640":0,"1f3ca-1f3fe-200d-2640":0,"1f3ca-1f3ff-200d-2640":0,"1f3ca-1f3fb-200d-2642":0,"1f3ca-1f3fc-200d-2642":0,"1f3ca-1f3fd-200d-2642":0,"1f3ca-1f3fe-200d-2642":0,"1f3ca-1f3ff-200d-2642":0,"1f3ca-1f3fb":0,"1f3ca-1f3fc":0,"1f3ca-1f3fd":0,"1f3ca-1f3fe":0,"1f3ca-1f3ff":0,"1f3cb-1f3fb-200d-2640":0,"1f3cb-1f3fc-200d-2640":0,"1f3cb-1f3fd-200d-2640":0,"1f3cb-1f3fe-200d-2640":0,"1f3cb-1f3ff-200d-2640":0,"1f3cb-1f3fb-200d-2642":0,"1f3cb-1f3fc-200d-2642":0,"1f3cb-1f3fd-200d-2642":0,"1f3cb-1f3fe-200d-2642":0,"1f3cb-1f3ff-200d-2642":0,"1f3cb-1f3fb":0,"1f3cb-1f3fc":0,"1f3cb-1f3fd":0,"1f3cb-1f3fe":0,"1f3cb-1f3ff":0,"1f3cc-1f3fb-200d-2640":0,"1f3cc-1f3fc-200d-2640":0,"1f3cc-1f3fd-200d-2640":0,"1f3cc-1f3fe-200d-2640":0,"1f3cc-1f3ff-200d-2640":0,"1f3cc-1f3fb-200d-2642":0,"1f3cc-1f3fc-200d-2642":0,"1f3cc-1f3fd-200d-2642":0,"1f3cc-1f3fe-200d-2642":0,"1f3cc-1f3ff-200d-2642":0,"1f3cc-1f3fb":0,"1f3cc-1f3fc":0,"1f3cc-1f3fd":0,"1f3cc-1f3fe":0,"1f3cc-1f3ff":0,"1f442-1f3fb":0,"1f442-1f3fc":0,"1f442-1f3fd":0,"1f442-1f3fe":0,"1f442-1f3ff":0,"1f443-1f3fb":0,"1f443-1f3fc":0,"1f443-1f3fd":0,"1f443-1f3fe":0,"1f443-1f3ff":0,"1f446-1f3fb":0,"1f446-1f3fc":0,"1f446-1f3fd":0,"1f446-1f3fe":0,"1f446-1f3ff":0,"1f447-1f3fb":0,"1f447-1f3fc":0,"1f447-1f3fd":0,"1f447-1f3fe":0,"1f447-1f3ff":0,"1f448-1f3fb":0,"1f448-1f3fc":0,"1f448-1f3fd":0,"1f448-1f3fe":0,"1f448-1f3ff":0,"1f449-1f3fb":0,"1f449-1f3fc":0,"1f449-1f3fd":0,"1f449-1f3fe":0,"1f449-1f3ff":0,"1f44a-1f3fb":0,"1f44a-1f3fc":0,"1f44a-1f3fd":0,"1f44a-1f3fe":0,"1f44a-1f3ff":0,"1f44b-1f3fb":0,"1f44b-1f3fc":0,"1f44b-1f3fd":0,"1f44b-1f3fe":0,"1f44b-1f3ff":0,"1f44c-1f3fb":0,"1f44c-1f3fc":0,"1f44c-1f3fd":0,"1f44c-1f3fe":0,"1f44c-1f3ff":0,"1f44d-1f3fb":0,"1f44d-1f3fc":0,"1f44d-1f3fd":0,"1f44d-1f3fe":0,"1f44d-1f3ff":0,"1f44e-1f3fb":0,"1f44e-1f3fc":0,"1f44e-1f3fd":0,"1f44e-1f3fe":0,"1f44e-1f3ff":0,"1f44f-1f3fb":0,"1f44f-1f3fc":0,"1f44f-1f3fd":0,"1f44f-1f3fe":0,"1f44f-1f3ff":0,"1f450-1f3fb":0,"1f450-1f3fc":0,"1f450-1f3fd":0,"1f450-1f3fe":0,"1f450-1f3ff":0,"1f466-1f3fb":0,"1f466-1f3fc":0,"1f466-1f3fd":0,"1f466-1f3fe":0,"1f466-1f3ff":0,"1f467-1f3fb":0,"1f467-1f3fc":0,"1f467-1f3fd":0,"1f467-1f3fe":0,"1f467-1f3ff":0,"1f468-1f3fb-200d-1f33e":0,"1f468-1f3fc-200d-1f33e":0,"1f468-1f3fd-200d-1f33e":0,"1f468-1f3fe-200d-1f33e":0,"1f468-1f3ff-200d-1f33e":0,"1f468-1f3fb-200d-1f373":0,"1f468-1f3fc-200d-1f373":0,"1f468-1f3fd-200d-1f373":0,"1f468-1f3fe-200d-1f373":0,"1f468-1f3ff-200d-1f373":0,"1f468-1f3fb-200d-1f37c":0,"1f468-1f3fc-200d-1f37c":0,"1f468-1f3fd-200d-1f37c":0,"1f468-1f3fe-200d-1f37c":0,"1f468-1f3ff-200d-1f37c":0,"1f468-1f3fb-200d-1f393":0,"1f468-1f3fc-200d-1f393":0,"1f468-1f3fd-200d-1f393":0,"1f468-1f3fe-200d-1f393":0,"1f468-1f3ff-200d-1f393":0,"1f468-1f3fb-200d-1f3a4":0,"1f468-1f3fc-200d-1f3a4":0,"1f468-1f3fd-200d-1f3a4":0,"1f468-1f3fe-200d-1f3a4":0,"1f468-1f3ff-200d-1f3a4":0,"1f468-1f3fb-200d-1f3a8":0,"1f468-1f3fc-200d-1f3a8":0,"1f468-1f3fd-200d-1f3a8":0,"1f468-1f3fe-200d-1f3a8":0,"1f468-1f3ff-200d-1f3a8":0,"1f468-1f3fb-200d-1f3eb":0,"1f468-1f3fc-200d-1f3eb":0,"1f468-1f3fd-200d-1f3eb":0,"1f468-1f3fe-200d-1f3eb":0,"1f468-1f3ff-200d-1f3eb":0,"1f468-1f3fb-200d-1f3ed":0,"1f468-1f3fc-200d-1f3ed":0,"1f468-1f3fd-200d-1f3ed":0,"1f468-1f3fe-200d-1f3ed":0,"1f468-1f3ff-200d-1f3ed":0,"1f468-1f3fb-200d-1f4bb":0,"1f468-1f3fc-200d-1f4bb":0,"1f468-1f3fd-200d-1f4bb":0,"1f468-1f3fe-200d-1f4bb":0,"1f468-1f3ff-200d-1f4bb":0,"1f468-1f3fb-200d-1f4bc":0,"1f468-1f3fc-200d-1f4bc":0,"1f468-1f3fd-200d-1f4bc":0,"1f468-1f3fe-200d-1f4bc":0,"1f468-1f3ff-200d-1f4bc":0,"1f468-1f3fb-200d-1f527":0,"1f468-1f3fc-200d-1f527":0,"1f468-1f3fd-200d-1f527":0,"1f468-1f3fe-200d-1f527":0,"1f468-1f3ff-200d-1f527":0,"1f468-1f3fb-200d-1f52c":0,"1f468-1f3fc-200d-1f52c":0,"1f468-1f3fd-200d-1f52c":0,"1f468-1f3fe-200d-1f52c":0,"1f468-1f3ff-200d-1f52c":0,"1f468-1f3fb-200d-1f680":0,"1f468-1f3fc-200d-1f680":0,"1f468-1f3fd-200d-1f680":0,"1f468-1f3fe-200d-1f680":0,"1f468-1f3ff-200d-1f680":0,"1f468-1f3fb-200d-1f692":0,"1f468-1f3fc-200d-1f692":0,"1f468-1f3fd-200d-1f692":0,"1f468-1f3fe-200d-1f692":0,"1f468-1f3ff-200d-1f692":0,"1f468-1f3fb-200d-1f9af":0,"1f468-1f3fc-200d-1f9af":0,"1f468-1f3fd-200d-1f9af":0,"1f468-1f3fe-200d-1f9af":0,"1f468-1f3ff-200d-1f9af":0,"1f468-1f3fb-200d-1f9b0":0,"1f468-1f3fc-200d-1f9b0":0,"1f468-1f3fd-200d-1f9b0":0,"1f468-1f3fe-200d-1f9b0":0,"1f468-1f3ff-200d-1f9b0":0,"1f468-1f3fb-200d-1f9b1":0,"1f468-1f3fc-200d-1f9b1":0,"1f468-1f3fd-200d-1f9b1":0,"1f468-1f3fe-200d-1f9b1":0,"1f468-1f3ff-200d-1f9b1":0,"1f468-1f3fb-200d-1f9b2":0,"1f468-1f3fc-200d-1f9b2":0,"1f468-1f3fd-200d-1f9b2":0,"1f468-1f3fe-200d-1f9b2":0,"1f468-1f3ff-200d-1f9b2":0,"1f468-1f3fb-200d-1f9b3":0,"1f468-1f3fc-200d-1f9b3":0,"1f468-1f3fd-200d-1f9b3":0,"1f468-1f3fe-200d-1f9b3":0,"1f468-1f3ff-200d-1f9b3":0,"1f468-1f3fb-200d-1f9bc":0,"1f468-1f3fc-200d-1f9bc":0,"1f468-1f3fd-200d-1f9bc":0,"1f468-1f3fe-200d-1f9bc":0,"1f468-1f3ff-200d-1f9bc":0,"1f468-1f3fb-200d-1f9bd":0,"1f468-1f3fc-200d-1f9bd":0,"1f468-1f3fd-200d-1f9bd":0,"1f468-1f3fe-200d-1f9bd":0,"1f468-1f3ff-200d-1f9bd":0,"1f468-1f3fb-200d-2695":0,"1f468-1f3fc-200d-2695":0,"1f468-1f3fd-200d-2695":0,"1f468-1f3fe-200d-2695":0,"1f468-1f3ff-200d-2695":0,"1f468-1f3fb-200d-2696":0,"1f468-1f3fc-200d-2696":0,"1f468-1f3fd-200d-2696":0,"1f468-1f3fe-200d-2696":0,"1f468-1f3ff-200d-2696":0,"1f468-1f3fb-200d-2708":0,"1f468-1f3fc-200d-2708":0,"1f468-1f3fd-200d-2708":0,"1f468-1f3fe-200d-2708":0,"1f468-1f3ff-200d-2708":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fb":0,"1f468-1f3fc":0,"1f468-1f3fd":0,"1f468-1f3fe":0,"1f468-1f3ff":0,"1f469-1f3fb-200d-1f33e":0,"1f469-1f3fc-200d-1f33e":0,"1f469-1f3fd-200d-1f33e":0,"1f469-1f3fe-200d-1f33e":0,"1f469-1f3ff-200d-1f33e":0,"1f469-1f3fb-200d-1f373":0,"1f469-1f3fc-200d-1f373":0,"1f469-1f3fd-200d-1f373":0,"1f469-1f3fe-200d-1f373":0,"1f469-1f3ff-200d-1f373":0,"1f469-1f3fb-200d-1f37c":0,"1f469-1f3fc-200d-1f37c":0,"1f469-1f3fd-200d-1f37c":0,"1f469-1f3fe-200d-1f37c":0,"1f469-1f3ff-200d-1f37c":0,"1f469-1f3fb-200d-1f393":0,"1f469-1f3fc-200d-1f393":0,"1f469-1f3fd-200d-1f393":0,"1f469-1f3fe-200d-1f393":0,"1f469-1f3ff-200d-1f393":0,"1f469-1f3fb-200d-1f3a4":0,"1f469-1f3fc-200d-1f3a4":0,"1f469-1f3fd-200d-1f3a4":0,"1f469-1f3fe-200d-1f3a4":0,"1f469-1f3ff-200d-1f3a4":0,"1f469-1f3fb-200d-1f3a8":0,"1f469-1f3fc-200d-1f3a8":0,"1f469-1f3fd-200d-1f3a8":0,"1f469-1f3fe-200d-1f3a8":0,"1f469-1f3ff-200d-1f3a8":0,"1f469-1f3fb-200d-1f3eb":0,"1f469-1f3fc-200d-1f3eb":0,"1f469-1f3fd-200d-1f3eb":0,"1f469-1f3fe-200d-1f3eb":0,"1f469-1f3ff-200d-1f3eb":0,"1f469-1f3fb-200d-1f3ed":0,"1f469-1f3fc-200d-1f3ed":0,"1f469-1f3fd-200d-1f3ed":0,"1f469-1f3fe-200d-1f3ed":0,"1f469-1f3ff-200d-1f3ed":0,"1f469-1f3fb-200d-1f4bb":0,"1f469-1f3fc-200d-1f4bb":0,"1f469-1f3fd-200d-1f4bb":0,"1f469-1f3fe-200d-1f4bb":0,"1f469-1f3ff-200d-1f4bb":0,"1f469-1f3fb-200d-1f4bc":0,"1f469-1f3fc-200d-1f4bc":0,"1f469-1f3fd-200d-1f4bc":0,"1f469-1f3fe-200d-1f4bc":0,"1f469-1f3ff-200d-1f4bc":0,"1f469-1f3fb-200d-1f527":0,"1f469-1f3fc-200d-1f527":0,"1f469-1f3fd-200d-1f527":0,"1f469-1f3fe-200d-1f527":0,"1f469-1f3ff-200d-1f527":0,"1f469-1f3fb-200d-1f52c":0,"1f469-1f3fc-200d-1f52c":0,"1f469-1f3fd-200d-1f52c":0,"1f469-1f3fe-200d-1f52c":0,"1f469-1f3ff-200d-1f52c":0,"1f469-1f3fb-200d-1f680":0,"1f469-1f3fc-200d-1f680":0,"1f469-1f3fd-200d-1f680":0,"1f469-1f3fe-200d-1f680":0,"1f469-1f3ff-200d-1f680":0,"1f469-1f3fb-200d-1f692":0,"1f469-1f3fc-200d-1f692":0,"1f469-1f3fd-200d-1f692":0,"1f469-1f3fe-200d-1f692":0,"1f469-1f3ff-200d-1f692":0,"1f469-1f3fb-200d-1f9af":0,"1f469-1f3fc-200d-1f9af":0,"1f469-1f3fd-200d-1f9af":0,"1f469-1f3fe-200d-1f9af":0,"1f469-1f3ff-200d-1f9af":0,"1f469-1f3fb-200d-1f9b0":0,"1f469-1f3fc-200d-1f9b0":0,"1f469-1f3fd-200d-1f9b0":0,"1f469-1f3fe-200d-1f9b0":0,"1f469-1f3ff-200d-1f9b0":0,"1f469-1f3fb-200d-1f9b1":0,"1f469-1f3fc-200d-1f9b1":0,"1f469-1f3fd-200d-1f9b1":0,"1f469-1f3fe-200d-1f9b1":0,"1f469-1f3ff-200d-1f9b1":0,"1f469-1f3fb-200d-1f9b2":0,"1f469-1f3fc-200d-1f9b2":0,"1f469-1f3fd-200d-1f9b2":0,"1f469-1f3fe-200d-1f9b2":0,"1f469-1f3ff-200d-1f9b2":0,"1f469-1f3fb-200d-1f9b3":0,"1f469-1f3fc-200d-1f9b3":0,"1f469-1f3fd-200d-1f9b3":0,"1f469-1f3fe-200d-1f9b3":0,"1f469-1f3ff-200d-1f9b3":0,"1f469-1f3fb-200d-1f9bc":0,"1f469-1f3fc-200d-1f9bc":0,"1f469-1f3fd-200d-1f9bc":0,"1f469-1f3fe-200d-1f9bc":0,"1f469-1f3ff-200d-1f9bc":0,"1f469-1f3fb-200d-1f9bd":0,"1f469-1f3fc-200d-1f9bd":0,"1f469-1f3fd-200d-1f9bd":0,"1f469-1f3fe-200d-1f9bd":0,"1f469-1f3ff-200d-1f9bd":0,"1f469-1f3fb-200d-2695":0,"1f469-1f3fc-200d-2695":0,"1f469-1f3fd-200d-2695":0,"1f469-1f3fe-200d-2695":0,"1f469-1f3ff-200d-2695":0,"1f469-1f3fb-200d-2696":0,"1f469-1f3fc-200d-2696":0,"1f469-1f3fd-200d-2696":0,"1f469-1f3fe-200d-2696":0,"1f469-1f3ff-200d-2696":0,"1f469-1f3fb-200d-2708":0,"1f469-1f3fc-200d-2708":0,"1f469-1f3fd-200d-2708":0,"1f469-1f3fe-200d-2708":0,"1f469-1f3ff-200d-2708":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fb":0,"1f469-1f3fc":0,"1f469-1f3fd":0,"1f469-1f3fe":0,"1f469-1f3ff":0,"1f46b-1f3fb":0,"1f46b-1f3fc":0,"1f46b-1f3fd":0,"1f46b-1f3fe":0,"1f46b-1f3ff":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3fe":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3fe":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3fe":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fe":0,"1f46c-1f3fb":0,"1f46c-1f3fc":0,"1f46c-1f3fd":0,"1f46c-1f3fe":0,"1f46c-1f3ff":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3fe":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3fe":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3fe":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fe":0,"1f46d-1f3fb":0,"1f46d-1f3fc":0,"1f46d-1f3fd":0,"1f46d-1f3fe":0,"1f46d-1f3ff":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3fe":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3fe":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3fe":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fe":0,"1f46e-1f3fb-200d-2640":0,"1f46e-1f3fc-200d-2640":0,"1f46e-1f3fd-200d-2640":0,"1f46e-1f3fe-200d-2640":0,"1f46e-1f3ff-200d-2640":0,"1f46e-1f3fb-200d-2642":0,"1f46e-1f3fc-200d-2642":0,"1f46e-1f3fd-200d-2642":0,"1f46e-1f3fe-200d-2642":0,"1f46e-1f3ff-200d-2642":0,"1f46e-1f3fb":0,"1f46e-1f3fc":0,"1f46e-1f3fd":0,"1f46e-1f3fe":0,"1f46e-1f3ff":0,"1f470-1f3fb-200d-2640":0,"1f470-1f3fc-200d-2640":0,"1f470-1f3fd-200d-2640":0,"1f470-1f3fe-200d-2640":0,"1f470-1f3ff-200d-2640":0,"1f470-1f3fb-200d-2642":0,"1f470-1f3fc-200d-2642":0,"1f470-1f3fd-200d-2642":0,"1f470-1f3fe-200d-2642":0,"1f470-1f3ff-200d-2642":0,"1f470-1f3fb":0,"1f470-1f3fc":0,"1f470-1f3fd":0,"1f470-1f3fe":0,"1f470-1f3ff":0,"1f471-1f3fb-200d-2640":0,"1f471-1f3fc-200d-2640":0,"1f471-1f3fd-200d-2640":0,"1f471-1f3fe-200d-2640":0,"1f471-1f3ff-200d-2640":0,"1f471-1f3fb-200d-2642":0,"1f471-1f3fc-200d-2642":0,"1f471-1f3fd-200d-2642":0,"1f471-1f3fe-200d-2642":0,"1f471-1f3ff-200d-2642":0,"1f471-1f3fb":0,"1f471-1f3fc":0,"1f471-1f3fd":0,"1f471-1f3fe":0,"1f471-1f3ff":0,"1f472-1f3fb":0,"1f472-1f3fc":0,"1f472-1f3fd":0,"1f472-1f3fe":0,"1f472-1f3ff":0,"1f473-1f3fb-200d-2640":0,"1f473-1f3fc-200d-2640":0,"1f473-1f3fd-200d-2640":0,"1f473-1f3fe-200d-2640":0,"1f473-1f3ff-200d-2640":0,"1f473-1f3fb-200d-2642":0,"1f473-1f3fc-200d-2642":0,"1f473-1f3fd-200d-2642":0,"1f473-1f3fe-200d-2642":0,"1f473-1f3ff-200d-2642":0,"1f473-1f3fb":0,"1f473-1f3fc":0,"1f473-1f3fd":0,"1f473-1f3fe":0,"1f473-1f3ff":0,"1f474-1f3fb":0,"1f474-1f3fc":0,"1f474-1f3fd":0,"1f474-1f3fe":0,"1f474-1f3ff":0,"1f475-1f3fb":0,"1f475-1f3fc":0,"1f475-1f3fd":0,"1f475-1f3fe":0,"1f475-1f3ff":0,"1f476-1f3fb":0,"1f476-1f3fc":0,"1f476-1f3fd":0,"1f476-1f3fe":0,"1f476-1f3ff":0,"1f477-1f3fb-200d-2640":0,"1f477-1f3fc-200d-2640":0,"1f477-1f3fd-200d-2640":0,"1f477-1f3fe-200d-2640":0,"1f477-1f3ff-200d-2640":0,"1f477-1f3fb-200d-2642":0,"1f477-1f3fc-200d-2642":0,"1f477-1f3fd-200d-2642":0,"1f477-1f3fe-200d-2642":0,"1f477-1f3ff-200d-2642":0,"1f477-1f3fb":0,"1f477-1f3fc":0,"1f477-1f3fd":0,"1f477-1f3fe":0,"1f477-1f3ff":0,"1f478-1f3fb":0,"1f478-1f3fc":0,"1f478-1f3fd":0,"1f478-1f3fe":0,"1f478-1f3ff":0,"1f47c-1f3fb":0,"1f47c-1f3fc":0,"1f47c-1f3fd":0,"1f47c-1f3fe":0,"1f47c-1f3ff":0,"1f481-1f3fb-200d-2640":0,"1f481-1f3fc-200d-2640":0,"1f481-1f3fd-200d-2640":0,"1f481-1f3fe-200d-2640":0,"1f481-1f3ff-200d-2640":0,"1f481-1f3fb-200d-2642":0,"1f481-1f3fc-200d-2642":0,"1f481-1f3fd-200d-2642":0,"1f481-1f3fe-200d-2642":0,"1f481-1f3ff-200d-2642":0,"1f481-1f3fb":0,"1f481-1f3fc":0,"1f481-1f3fd":0,"1f481-1f3fe":0,"1f481-1f3ff":0,"1f482-1f3fb-200d-2640":0,"1f482-1f3fc-200d-2640":0,"1f482-1f3fd-200d-2640":0,"1f482-1f3fe-200d-2640":0,"1f482-1f3ff-200d-2640":0,"1f482-1f3fb-200d-2642":0,"1f482-1f3fc-200d-2642":0,"1f482-1f3fd-200d-2642":0,"1f482-1f3fe-200d-2642":0,"1f482-1f3ff-200d-2642":0,"1f482-1f3fb":0,"1f482-1f3fc":0,"1f482-1f3fd":0,"1f482-1f3fe":0,"1f482-1f3ff":0,"1f483-1f3fb":0,"1f483-1f3fc":0,"1f483-1f3fd":0,"1f483-1f3fe":0,"1f483-1f3ff":0,"1f485-1f3fb":0,"1f485-1f3fc":0,"1f485-1f3fd":0,"1f485-1f3fe":0,"1f485-1f3ff":0,"1f486-1f3fb-200d-2640":0,"1f486-1f3fc-200d-2640":0,"1f486-1f3fd-200d-2640":0,"1f486-1f3fe-200d-2640":0,"1f486-1f3ff-200d-2640":0,"1f486-1f3fb-200d-2642":0,"1f486-1f3fc-200d-2642":0,"1f486-1f3fd-200d-2642":0,"1f486-1f3fe-200d-2642":0,"1f486-1f3ff-200d-2642":0,"1f486-1f3fb":0,"1f486-1f3fc":0,"1f486-1f3fd":0,"1f486-1f3fe":0,"1f486-1f3ff":0,"1f487-1f3fb-200d-2640":0,"1f487-1f3fc-200d-2640":0,"1f487-1f3fd-200d-2640":0,"1f487-1f3fe-200d-2640":0,"1f487-1f3ff-200d-2640":0,"1f487-1f3fb-200d-2642":0,"1f487-1f3fc-200d-2642":0,"1f487-1f3fd-200d-2642":0,"1f487-1f3fe-200d-2642":0,"1f487-1f3ff-200d-2642":0,"1f487-1f3fb":0,"1f487-1f3fc":0,"1f487-1f3fd":0,"1f487-1f3fe":0,"1f487-1f3ff":0,"1f48f-1f3fb":0,"1f48f-1f3fc":0,"1f48f-1f3fd":0,"1f48f-1f3fe":0,"1f48f-1f3ff":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f491-1f3fb":0,"1f491-1f3fc":0,"1f491-1f3fd":0,"1f491-1f3fe":0,"1f491-1f3ff":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fe":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fe":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fe":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fe":0,"1f4aa-1f3fb":0,"1f4aa-1f3fc":0,"1f4aa-1f3fd":0,"1f4aa-1f3fe":0,"1f4aa-1f3ff":0,"1f574-1f3fb":0,"1f574-1f3fc":0,"1f574-1f3fd":0,"1f574-1f3fe":0,"1f574-1f3ff":0,"1f575-1f3fb-200d-2640":0,"1f575-1f3fc-200d-2640":0,"1f575-1f3fd-200d-2640":0,"1f575-1f3fe-200d-2640":0,"1f575-1f3ff-200d-2640":0,"1f575-1f3fb-200d-2642":0,"1f575-1f3fc-200d-2642":0,"1f575-1f3fd-200d-2642":0,"1f575-1f3fe-200d-2642":0,"1f575-1f3ff-200d-2642":0,"1f575-1f3fb":0,"1f575-1f3fc":0,"1f575-1f3fd":0,"1f575-1f3fe":0,"1f575-1f3ff":0,"1f57a-1f3fb":0,"1f57a-1f3fc":0,"1f57a-1f3fd":0,"1f57a-1f3fe":0,"1f57a-1f3ff":0,"1f590-1f3fb":0,"1f590-1f3fc":0,"1f590-1f3fd":0,"1f590-1f3fe":0,"1f590-1f3ff":0,"1f595-1f3fb":0,"1f595-1f3fc":0,"1f595-1f3fd":0,"1f595-1f3fe":0,"1f595-1f3ff":0,"1f596-1f3fb":0,"1f596-1f3fc":0,"1f596-1f3fd":0,"1f596-1f3fe":0,"1f596-1f3ff":0,"1f645-1f3fb-200d-2640":0,"1f645-1f3fc-200d-2640":0,"1f645-1f3fd-200d-2640":0,"1f645-1f3fe-200d-2640":0,"1f645-1f3ff-200d-2640":0,"1f645-1f3fb-200d-2642":0,"1f645-1f3fc-200d-2642":0,"1f645-1f3fd-200d-2642":0,"1f645-1f3fe-200d-2642":0,"1f645-1f3ff-200d-2642":0,"1f645-1f3fb":0,"1f645-1f3fc":0,"1f645-1f3fd":0,"1f645-1f3fe":0,"1f645-1f3ff":0,"1f646-1f3fb-200d-2640":0,"1f646-1f3fc-200d-2640":0,"1f646-1f3fd-200d-2640":0,"1f646-1f3fe-200d-2640":0,"1f646-1f3ff-200d-2640":0,"1f646-1f3fb-200d-2642":0,"1f646-1f3fc-200d-2642":0,"1f646-1f3fd-200d-2642":0,"1f646-1f3fe-200d-2642":0,"1f646-1f3ff-200d-2642":0,"1f646-1f3fb":0,"1f646-1f3fc":0,"1f646-1f3fd":0,"1f646-1f3fe":0,"1f646-1f3ff":0,"1f647-1f3fb-200d-2640":0,"1f647-1f3fc-200d-2640":0,"1f647-1f3fd-200d-2640":0,"1f647-1f3fe-200d-2640":0,"1f647-1f3ff-200d-2640":0,"1f647-1f3fb-200d-2642":0,"1f647-1f3fc-200d-2642":0,"1f647-1f3fd-200d-2642":0,"1f647-1f3fe-200d-2642":0,"1f647-1f3ff-200d-2642":0,"1f647-1f3fb":0,"1f647-1f3fc":0,"1f647-1f3fd":0,"1f647-1f3fe":0,"1f647-1f3ff":0,"1f64b-1f3fb-200d-2640":0,"1f64b-1f3fc-200d-2640":0,"1f64b-1f3fd-200d-2640":0,"1f64b-1f3fe-200d-2640":0,"1f64b-1f3ff-200d-2640":0,"1f64b-1f3fb-200d-2642":0,"1f64b-1f3fc-200d-2642":0,"1f64b-1f3fd-200d-2642":0,"1f64b-1f3fe-200d-2642":0,"1f64b-1f3ff-200d-2642":0,"1f64b-1f3fb":0,"1f64b-1f3fc":0,"1f64b-1f3fd":0,"1f64b-1f3fe":0,"1f64b-1f3ff":0,"1f64c-1f3fb":0,"1f64c-1f3fc":0,"1f64c-1f3fd":0,"1f64c-1f3fe":0,"1f64c-1f3ff":0,"1f64d-1f3fb-200d-2640":0,"1f64d-1f3fc-200d-2640":0,"1f64d-1f3fd-200d-2640":0,"1f64d-1f3fe-200d-2640":0,"1f64d-1f3ff-200d-2640":0,"1f64d-1f3fb-200d-2642":0,"1f64d-1f3fc-200d-2642":0,"1f64d-1f3fd-200d-2642":0,"1f64d-1f3fe-200d-2642":0,"1f64d-1f3ff-200d-2642":0,"1f64d-1f3fb":0,"1f64d-1f3fc":0,"1f64d-1f3fd":0,"1f64d-1f3fe":0,"1f64d-1f3ff":0,"1f64e-1f3fb-200d-2640":0,"1f64e-1f3fc-200d-2640":0,"1f64e-1f3fd-200d-2640":0,"1f64e-1f3fe-200d-2640":0,"1f64e-1f3ff-200d-2640":0,"1f64e-1f3fb-200d-2642":0,"1f64e-1f3fc-200d-2642":0,"1f64e-1f3fd-200d-2642":0,"1f64e-1f3fe-200d-2642":0,"1f64e-1f3ff-200d-2642":0,"1f64e-1f3fb":0,"1f64e-1f3fc":0,"1f64e-1f3fd":0,"1f64e-1f3fe":0,"1f64e-1f3ff":0,"1f64f-1f3fb":0,"1f64f-1f3fc":0,"1f64f-1f3fd":0,"1f64f-1f3fe":0,"1f64f-1f3ff":0,"1f6a3-1f3fb-200d-2640":0,"1f6a3-1f3fc-200d-2640":0,"1f6a3-1f3fd-200d-2640":0,"1f6a3-1f3fe-200d-2640":0,"1f6a3-1f3ff-200d-2640":0,"1f6a3-1f3fb-200d-2642":0,"1f6a3-1f3fc-200d-2642":0,"1f6a3-1f3fd-200d-2642":0,"1f6a3-1f3fe-200d-2642":0,"1f6a3-1f3ff-200d-2642":0,"1f6a3-1f3fb":0,"1f6a3-1f3fc":0,"1f6a3-1f3fd":0,"1f6a3-1f3fe":0,"1f6a3-1f3ff":0,"1f6b4-1f3fb-200d-2640":0,"1f6b4-1f3fc-200d-2640":0,"1f6b4-1f3fd-200d-2640":0,"1f6b4-1f3fe-200d-2640":0,"1f6b4-1f3ff-200d-2640":0,"1f6b4-1f3fb-200d-2642":0,"1f6b4-1f3fc-200d-2642":0,"1f6b4-1f3fd-200d-2642":0,"1f6b4-1f3fe-200d-2642":0,"1f6b4-1f3ff-200d-2642":0,"1f6b4-1f3fb":0,"1f6b4-1f3fc":0,"1f6b4-1f3fd":0,"1f6b4-1f3fe":0,"1f6b4-1f3ff":0,"1f6b5-1f3fb-200d-2640":0,"1f6b5-1f3fc-200d-2640":0,"1f6b5-1f3fd-200d-2640":0,"1f6b5-1f3fe-200d-2640":0,"1f6b5-1f3ff-200d-2640":0,"1f6b5-1f3fb-200d-2642":0,"1f6b5-1f3fc-200d-2642":0,"1f6b5-1f3fd-200d-2642":0,"1f6b5-1f3fe-200d-2642":0,"1f6b5-1f3ff-200d-2642":0,"1f6b5-1f3fb":0,"1f6b5-1f3fc":0,"1f6b5-1f3fd":0,"1f6b5-1f3fe":0,"1f6b5-1f3ff":0,"1f6b6-1f3fb-200d-2640":0,"1f6b6-1f3fc-200d-2640":0,"1f6b6-1f3fd-200d-2640":0,"1f6b6-1f3fe-200d-2640":0,"1f6b6-1f3ff-200d-2640":0,"1f6b6-1f3fb-200d-2642":0,"1f6b6-1f3fc-200d-2642":0,"1f6b6-1f3fd-200d-2642":0,"1f6b6-1f3fe-200d-2642":0,"1f6b6-1f3ff-200d-2642":0,"1f6b6-1f3fb":0,"1f6b6-1f3fc":0,"1f6b6-1f3fd":0,"1f6b6-1f3fe":0,"1f6b6-1f3ff":0,"1f6c0-1f3fb":0,"1f6c0-1f3fc":0,"1f6c0-1f3fd":0,"1f6c0-1f3fe":0,"1f6c0-1f3ff":0,"1f6cc-1f3fb":0,"1f6cc-1f3fc":0,"1f6cc-1f3fd":0,"1f6cc-1f3fe":0,"1f6cc-1f3ff":0,"1f90c-1f3fb":0,"1f90c-1f3fc":0,"1f90c-1f3fd":0,"1f90c-1f3fe":0,"1f90c-1f3ff":0,"1f90f-1f3fb":0,"1f90f-1f3fc":0,"1f90f-1f3fd":0,"1f90f-1f3fe":0,"1f90f-1f3ff":0,"1f918-1f3fb":0,"1f918-1f3fc":0,"1f918-1f3fd":0,"1f918-1f3fe":0,"1f918-1f3ff":0,"1f919-1f3fb":0,"1f919-1f3fc":0,"1f919-1f3fd":0,"1f919-1f3fe":0,"1f919-1f3ff":0,"1f91a-1f3fb":0,"1f91a-1f3fc":0,"1f91a-1f3fd":0,"1f91a-1f3fe":0,"1f91a-1f3ff":0,"1f91b-1f3fb":0,"1f91b-1f3fc":0,"1f91b-1f3fd":0,"1f91b-1f3fe":0,"1f91b-1f3ff":0,"1f91c-1f3fb":0,"1f91c-1f3fc":0,"1f91c-1f3fd":0,"1f91c-1f3fe":0,"1f91c-1f3ff":0,"1f91d-1f3fb":0,"1f91d-1f3fc":0,"1f91d-1f3fd":0,"1f91d-1f3fe":0,"1f91d-1f3ff":0,"1f91e-1f3fb":0,"1f91e-1f3fc":0,"1f91e-1f3fd":0,"1f91e-1f3fe":0,"1f91e-1f3ff":0,"1f91f-1f3fb":0,"1f91f-1f3fc":0,"1f91f-1f3fd":0,"1f91f-1f3fe":0,"1f91f-1f3ff":0,"1f926-1f3fb-200d-2640":0,"1f926-1f3fc-200d-2640":0,"1f926-1f3fd-200d-2640":0,"1f926-1f3fe-200d-2640":0,"1f926-1f3ff-200d-2640":0,"1f926-1f3fb-200d-2642":0,"1f926-1f3fc-200d-2642":0,"1f926-1f3fd-200d-2642":0,"1f926-1f3fe-200d-2642":0,"1f926-1f3ff-200d-2642":0,"1f926-1f3fb":0,"1f926-1f3fc":0,"1f926-1f3fd":0,"1f926-1f3fe":0,"1f926-1f3ff":0,"1f930-1f3fb":0,"1f930-1f3fc":0,"1f930-1f3fd":0,"1f930-1f3fe":0,"1f930-1f3ff":0,"1f931-1f3fb":0,"1f931-1f3fc":0,"1f931-1f3fd":0,"1f931-1f3fe":0,"1f931-1f3ff":0,"1f932-1f3fb":0,"1f932-1f3fc":0,"1f932-1f3fd":0,"1f932-1f3fe":0,"1f932-1f3ff":0,"1f933-1f3fb":0,"1f933-1f3fc":0,"1f933-1f3fd":0,"1f933-1f3fe":0,"1f933-1f3ff":0,"1f934-1f3fb":0,"1f934-1f3fc":0,"1f934-1f3fd":0,"1f934-1f3fe":0,"1f934-1f3ff":0,"1f935-1f3fb-200d-2640":0,"1f935-1f3fc-200d-2640":0,"1f935-1f3fd-200d-2640":0,"1f935-1f3fe-200d-2640":0,"1f935-1f3ff-200d-2640":0,"1f935-1f3fb-200d-2642":0,"1f935-1f3fc-200d-2642":0,"1f935-1f3fd-200d-2642":0,"1f935-1f3fe-200d-2642":0,"1f935-1f3ff-200d-2642":0,"1f935-1f3fb":0,"1f935-1f3fc":0,"1f935-1f3fd":0,"1f935-1f3fe":0,"1f935-1f3ff":0,"1f936-1f3fb":0,"1f936-1f3fc":0,"1f936-1f3fd":0,"1f936-1f3fe":0,"1f936-1f3ff":0,"1f937-1f3fb-200d-2640":0,"1f937-1f3fc-200d-2640":0,"1f937-1f3fd-200d-2640":0,"1f937-1f3fe-200d-2640":0,"1f937-1f3ff-200d-2640":0,"1f937-1f3fb-200d-2642":0,"1f937-1f3fc-200d-2642":0,"1f937-1f3fd-200d-2642":0,"1f937-1f3fe-200d-2642":0,"1f937-1f3ff-200d-2642":0,"1f937-1f3fb":0,"1f937-1f3fc":0,"1f937-1f3fd":0,"1f937-1f3fe":0,"1f937-1f3ff":0,"1f938-1f3fb-200d-2640":0,"1f938-1f3fc-200d-2640":0,"1f938-1f3fd-200d-2640":0,"1f938-1f3fe-200d-2640":0,"1f938-1f3ff-200d-2640":0,"1f938-1f3fb-200d-2642":0,"1f938-1f3fc-200d-2642":0,"1f938-1f3fd-200d-2642":0,"1f938-1f3fe-200d-2642":0,"1f938-1f3ff-200d-2642":0,"1f938-1f3fb":0,"1f938-1f3fc":0,"1f938-1f3fd":0,"1f938-1f3fe":0,"1f938-1f3ff":0,"1f939-1f3fb-200d-2640":0,"1f939-1f3fc-200d-2640":0,"1f939-1f3fd-200d-2640":0,"1f939-1f3fe-200d-2640":0,"1f939-1f3ff-200d-2640":0,"1f939-1f3fb-200d-2642":0,"1f939-1f3fc-200d-2642":0,"1f939-1f3fd-200d-2642":0,"1f939-1f3fe-200d-2642":0,"1f939-1f3ff-200d-2642":0,"1f939-1f3fb":0,"1f939-1f3fc":0,"1f939-1f3fd":0,"1f939-1f3fe":0,"1f939-1f3ff":0,"1f93d-1f3fb-200d-2640":0,"1f93d-1f3fc-200d-2640":0,"1f93d-1f3fd-200d-2640":0,"1f93d-1f3fe-200d-2640":0,"1f93d-1f3ff-200d-2640":0,"1f93d-1f3fb-200d-2642":0,"1f93d-1f3fc-200d-2642":0,"1f93d-1f3fd-200d-2642":0,"1f93d-1f3fe-200d-2642":0,"1f93d-1f3ff-200d-2642":0,"1f93d-1f3fb":0,"1f93d-1f3fc":0,"1f93d-1f3fd":0,"1f93d-1f3fe":0,"1f93d-1f3ff":0,"1f93e-1f3fb-200d-2640":0,"1f93e-1f3fc-200d-2640":0,"1f93e-1f3fd-200d-2640":0,"1f93e-1f3fe-200d-2640":0,"1f93e-1f3ff-200d-2640":0,"1f93e-1f3fb-200d-2642":0,"1f93e-1f3fc-200d-2642":0,"1f93e-1f3fd-200d-2642":0,"1f93e-1f3fe-200d-2642":0,"1f93e-1f3ff-200d-2642":0,"1f93e-1f3fb":0,"1f93e-1f3fc":0,"1f93e-1f3fd":0,"1f93e-1f3fe":0,"1f93e-1f3ff":0,"1f977-1f3fb":0,"1f977-1f3fc":0,"1f977-1f3fd":0,"1f977-1f3fe":0,"1f977-1f3ff":0,"1f9b5-1f3fb":0,"1f9b5-1f3fc":0,"1f9b5-1f3fd":0,"1f9b5-1f3fe":0,"1f9b5-1f3ff":0,"1f9b6-1f3fb":0,"1f9b6-1f3fc":0,"1f9b6-1f3fd":0,"1f9b6-1f3fe":0,"1f9b6-1f3ff":0,"1f9b8-1f3fb-200d-2640":0,"1f9b8-1f3fc-200d-2640":0,"1f9b8-1f3fd-200d-2640":0,"1f9b8-1f3fe-200d-2640":0,"1f9b8-1f3ff-200d-2640":0,"1f9b8-1f3fb-200d-2642":0,"1f9b8-1f3fc-200d-2642":0,"1f9b8-1f3fd-200d-2642":0,"1f9b8-1f3fe-200d-2642":0,"1f9b8-1f3ff-200d-2642":0,"1f9b8-1f3fb":0,"1f9b8-1f3fc":0,"1f9b8-1f3fd":0,"1f9b8-1f3fe":0,"1f9b8-1f3ff":0,"1f9b9-1f3fb-200d-2640":0,"1f9b9-1f3fc-200d-2640":0,"1f9b9-1f3fd-200d-2640":0,"1f9b9-1f3fe-200d-2640":0,"1f9b9-1f3ff-200d-2640":0,"1f9b9-1f3fb-200d-2642":0,"1f9b9-1f3fc-200d-2642":0,"1f9b9-1f3fd-200d-2642":0,"1f9b9-1f3fe-200d-2642":0,"1f9b9-1f3ff-200d-2642":0,"1f9b9-1f3fb":0,"1f9b9-1f3fc":0,"1f9b9-1f3fd":0,"1f9b9-1f3fe":0,"1f9b9-1f3ff":0,"1f9bb-1f3fb":0,"1f9bb-1f3fc":0,"1f9bb-1f3fd":0,"1f9bb-1f3fe":0,"1f9bb-1f3ff":0,"1f9cd-1f3fb-200d-2640":0,"1f9cd-1f3fc-200d-2640":0,"1f9cd-1f3fd-200d-2640":0,"1f9cd-1f3fe-200d-2640":0,"1f9cd-1f3ff-200d-2640":0,"1f9cd-1f3fb-200d-2642":0,"1f9cd-1f3fc-200d-2642":0,"1f9cd-1f3fd-200d-2642":0,"1f9cd-1f3fe-200d-2642":0,"1f9cd-1f3ff-200d-2642":0,"1f9cd-1f3fb":0,"1f9cd-1f3fc":0,"1f9cd-1f3fd":0,"1f9cd-1f3fe":0,"1f9cd-1f3ff":0,"1f9ce-1f3fb-200d-2640":0,"1f9ce-1f3fc-200d-2640":0,"1f9ce-1f3fd-200d-2640":0,"1f9ce-1f3fe-200d-2640":0,"1f9ce-1f3ff-200d-2640":0,"1f9ce-1f3fb-200d-2642":0,"1f9ce-1f3fc-200d-2642":0,"1f9ce-1f3fd-200d-2642":0,"1f9ce-1f3fe-200d-2642":0,"1f9ce-1f3ff-200d-2642":0,"1f9ce-1f3fb":0,"1f9ce-1f3fc":0,"1f9ce-1f3fd":0,"1f9ce-1f3fe":0,"1f9ce-1f3ff":0,"1f9cf-1f3fb-200d-2640":0,"1f9cf-1f3fc-200d-2640":0,"1f9cf-1f3fd-200d-2640":0,"1f9cf-1f3fe-200d-2640":0,"1f9cf-1f3ff-200d-2640":0,"1f9cf-1f3fb-200d-2642":0,"1f9cf-1f3fc-200d-2642":0,"1f9cf-1f3fd-200d-2642":0,"1f9cf-1f3fe-200d-2642":0,"1f9cf-1f3ff-200d-2642":0,"1f9cf-1f3fb":0,"1f9cf-1f3fc":0,"1f9cf-1f3fd":0,"1f9cf-1f3fe":0,"1f9cf-1f3ff":0,"1f9d1-1f3fb-200d-1f33e":0,"1f9d1-1f3fc-200d-1f33e":0,"1f9d1-1f3fd-200d-1f33e":0,"1f9d1-1f3fe-200d-1f33e":0,"1f9d1-1f3ff-200d-1f33e":0,"1f9d1-1f3fb-200d-1f373":0,"1f9d1-1f3fc-200d-1f373":0,"1f9d1-1f3fd-200d-1f373":0,"1f9d1-1f3fe-200d-1f373":0,"1f9d1-1f3ff-200d-1f373":0,"1f9d1-1f3fb-200d-1f37c":0,"1f9d1-1f3fc-200d-1f37c":0,"1f9d1-1f3fd-200d-1f37c":0,"1f9d1-1f3fe-200d-1f37c":0,"1f9d1-1f3ff-200d-1f37c":0,"1f9d1-1f3fb-200d-1f384":0,"1f9d1-1f3fc-200d-1f384":0,"1f9d1-1f3fd-200d-1f384":0,"1f9d1-1f3fe-200d-1f384":0,"1f9d1-1f3ff-200d-1f384":0,"1f9d1-1f3fb-200d-1f393":0,"1f9d1-1f3fc-200d-1f393":0,"1f9d1-1f3fd-200d-1f393":0,"1f9d1-1f3fe-200d-1f393":0,"1f9d1-1f3ff-200d-1f393":0,"1f9d1-1f3fb-200d-1f3a4":0,"1f9d1-1f3fc-200d-1f3a4":0,"1f9d1-1f3fd-200d-1f3a4":0,"1f9d1-1f3fe-200d-1f3a4":0,"1f9d1-1f3ff-200d-1f3a4":0,"1f9d1-1f3fb-200d-1f3a8":0,"1f9d1-1f3fc-200d-1f3a8":0,"1f9d1-1f3fd-200d-1f3a8":0,"1f9d1-1f3fe-200d-1f3a8":0,"1f9d1-1f3ff-200d-1f3a8":0,"1f9d1-1f3fb-200d-1f3eb":0,"1f9d1-1f3fc-200d-1f3eb":0,"1f9d1-1f3fd-200d-1f3eb":0,"1f9d1-1f3fe-200d-1f3eb":0,"1f9d1-1f3ff-200d-1f3eb":0,"1f9d1-1f3fb-200d-1f3ed":0,"1f9d1-1f3fc-200d-1f3ed":0,"1f9d1-1f3fd-200d-1f3ed":0,"1f9d1-1f3fe-200d-1f3ed":0,"1f9d1-1f3ff-200d-1f3ed":0,"1f9d1-1f3fb-200d-1f4bb":0,"1f9d1-1f3fc-200d-1f4bb":0,"1f9d1-1f3fd-200d-1f4bb":0,"1f9d1-1f3fe-200d-1f4bb":0,"1f9d1-1f3ff-200d-1f4bb":0,"1f9d1-1f3fb-200d-1f4bc":0,"1f9d1-1f3fc-200d-1f4bc":0,"1f9d1-1f3fd-200d-1f4bc":0,"1f9d1-1f3fe-200d-1f4bc":0,"1f9d1-1f3ff-200d-1f4bc":0,"1f9d1-1f3fb-200d-1f527":0,"1f9d1-1f3fc-200d-1f527":0,"1f9d1-1f3fd-200d-1f527":0,"1f9d1-1f3fe-200d-1f527":0,"1f9d1-1f3ff-200d-1f527":0,"1f9d1-1f3fb-200d-1f52c":0,"1f9d1-1f3fc-200d-1f52c":0,"1f9d1-1f3fd-200d-1f52c":0,"1f9d1-1f3fe-200d-1f52c":0,"1f9d1-1f3ff-200d-1f52c":0,"1f9d1-1f3fb-200d-1f680":0,"1f9d1-1f3fc-200d-1f680":0,"1f9d1-1f3fd-200d-1f680":0,"1f9d1-1f3fe-200d-1f680":0,"1f9d1-1f3ff-200d-1f680":0,"1f9d1-1f3fb-200d-1f692":0,"1f9d1-1f3fc-200d-1f692":0,"1f9d1-1f3fd-200d-1f692":0,"1f9d1-1f3fe-200d-1f692":0,"1f9d1-1f3ff-200d-1f692":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fb-200d-1f9af":0,"1f9d1-1f3fc-200d-1f9af":0,"1f9d1-1f3fd-200d-1f9af":0,"1f9d1-1f3fe-200d-1f9af":0,"1f9d1-1f3ff-200d-1f9af":0,"1f9d1-1f3fb-200d-1f9b0":0,"1f9d1-1f3fc-200d-1f9b0":0,"1f9d1-1f3fd-200d-1f9b0":0,"1f9d1-1f3fe-200d-1f9b0":0,"1f9d1-1f3ff-200d-1f9b0":0,"1f9d1-1f3fb-200d-1f9b1":0,"1f9d1-1f3fc-200d-1f9b1":0,"1f9d1-1f3fd-200d-1f9b1":0,"1f9d1-1f3fe-200d-1f9b1":0,"1f9d1-1f3ff-200d-1f9b1":0,"1f9d1-1f3fb-200d-1f9b2":0,"1f9d1-1f3fc-200d-1f9b2":0,"1f9d1-1f3fd-200d-1f9b2":0,"1f9d1-1f3fe-200d-1f9b2":0,"1f9d1-1f3ff-200d-1f9b2":0,"1f9d1-1f3fb-200d-1f9b3":0,"1f9d1-1f3fc-200d-1f9b3":0,"1f9d1-1f3fd-200d-1f9b3":0,"1f9d1-1f3fe-200d-1f9b3":0,"1f9d1-1f3ff-200d-1f9b3":0,"1f9d1-1f3fb-200d-1f9bc":0,"1f9d1-1f3fc-200d-1f9bc":0,"1f9d1-1f3fd-200d-1f9bc":0,"1f9d1-1f3fe-200d-1f9bc":0,"1f9d1-1f3ff-200d-1f9bc":0,"1f9d1-1f3fb-200d-1f9bd":0,"1f9d1-1f3fc-200d-1f9bd":0,"1f9d1-1f3fd-200d-1f9bd":0,"1f9d1-1f3fe-200d-1f9bd":0,"1f9d1-1f3ff-200d-1f9bd":0,"1f9d1-1f3fb-200d-2695":0,"1f9d1-1f3fc-200d-2695":0,"1f9d1-1f3fd-200d-2695":0,"1f9d1-1f3fe-200d-2695":0,"1f9d1-1f3ff-200d-2695":0,"1f9d1-1f3fb-200d-2696":0,"1f9d1-1f3fc-200d-2696":0,"1f9d1-1f3fd-200d-2696":0,"1f9d1-1f3fe-200d-2696":0,"1f9d1-1f3ff-200d-2696":0,"1f9d1-1f3fb-200d-2708":0,"1f9d1-1f3fc-200d-2708":0,"1f9d1-1f3fd-200d-2708":0,"1f9d1-1f3fe-200d-2708":0,"1f9d1-1f3ff-200d-2708":0,"1f9d1-1f3fb":0,"1f9d1-1f3fc":0,"1f9d1-1f3fd":0,"1f9d1-1f3fe":0,"1f9d1-1f3ff":0,"1f9d2-1f3fb":0,"1f9d2-1f3fc":0,"1f9d2-1f3fd":0,"1f9d2-1f3fe":0,"1f9d2-1f3ff":0,"1f9d3-1f3fb":0,"1f9d3-1f3fc":0,"1f9d3-1f3fd":0,"1f9d3-1f3fe":0,"1f9d3-1f3ff":0,"1f9d4-1f3fb-200d-2640":0,"1f9d4-1f3fc-200d-2640":0,"1f9d4-1f3fd-200d-2640":0,"1f9d4-1f3fe-200d-2640":0,"1f9d4-1f3ff-200d-2640":0,"1f9d4-1f3fb-200d-2642":0,"1f9d4-1f3fc-200d-2642":0,"1f9d4-1f3fd-200d-2642":0,"1f9d4-1f3fe-200d-2642":0,"1f9d4-1f3ff-200d-2642":0,"1f9d4-1f3fb":0,"1f9d4-1f3fc":0,"1f9d4-1f3fd":0,"1f9d4-1f3fe":0,"1f9d4-1f3ff":0,"1f9d5-1f3fb":0,"1f9d5-1f3fc":0,"1f9d5-1f3fd":0,"1f9d5-1f3fe":0,"1f9d5-1f3ff":0,"1f9d6-1f3fb-200d-2640":0,"1f9d6-1f3fc-200d-2640":0,"1f9d6-1f3fd-200d-2640":0,"1f9d6-1f3fe-200d-2640":0,"1f9d6-1f3ff-200d-2640":0,"1f9d6-1f3fb-200d-2642":0,"1f9d6-1f3fc-200d-2642":0,"1f9d6-1f3fd-200d-2642":0,"1f9d6-1f3fe-200d-2642":0,"1f9d6-1f3ff-200d-2642":0,"1f9d6-1f3fb":0,"1f9d6-1f3fc":0,"1f9d6-1f3fd":0,"1f9d6-1f3fe":0,"1f9d6-1f3ff":0,"1f9d7-1f3fb-200d-2640":0,"1f9d7-1f3fc-200d-2640":0,"1f9d7-1f3fd-200d-2640":0,"1f9d7-1f3fe-200d-2640":0,"1f9d7-1f3ff-200d-2640":0,"1f9d7-1f3fb-200d-2642":0,"1f9d7-1f3fc-200d-2642":0,"1f9d7-1f3fd-200d-2642":0,"1f9d7-1f3fe-200d-2642":0,"1f9d7-1f3ff-200d-2642":0,"1f9d7-1f3fb":0,"1f9d7-1f3fc":0,"1f9d7-1f3fd":0,"1f9d7-1f3fe":0,"1f9d7-1f3ff":0,"1f9d8-1f3fb-200d-2640":0,"1f9d8-1f3fc-200d-2640":0,"1f9d8-1f3fd-200d-2640":0,"1f9d8-1f3fe-200d-2640":0,"1f9d8-1f3ff-200d-2640":0,"1f9d8-1f3fb-200d-2642":0,"1f9d8-1f3fc-200d-2642":0,"1f9d8-1f3fd-200d-2642":0,"1f9d8-1f3fe-200d-2642":0,"1f9d8-1f3ff-200d-2642":0,"1f9d8-1f3fb":0,"1f9d8-1f3fc":0,"1f9d8-1f3fd":0,"1f9d8-1f3fe":0,"1f9d8-1f3ff":0,"1f9d9-1f3fb-200d-2640":0,"1f9d9-1f3fc-200d-2640":0,"1f9d9-1f3fd-200d-2640":0,"1f9d9-1f3fe-200d-2640":0,"1f9d9-1f3ff-200d-2640":0,"1f9d9-1f3fb-200d-2642":0,"1f9d9-1f3fc-200d-2642":0,"1f9d9-1f3fd-200d-2642":0,"1f9d9-1f3fe-200d-2642":0,"1f9d9-1f3ff-200d-2642":0,"1f9d9-1f3fb":0,"1f9d9-1f3fc":0,"1f9d9-1f3fd":0,"1f9d9-1f3fe":0,"1f9d9-1f3ff":0,"1f9da-1f3fb-200d-2640":0,"1f9da-1f3fc-200d-2640":0,"1f9da-1f3fd-200d-2640":0,"1f9da-1f3fe-200d-2640":0,"1f9da-1f3ff-200d-2640":0,"1f9da-1f3fb-200d-2642":0,"1f9da-1f3fc-200d-2642":0,"1f9da-1f3fd-200d-2642":0,"1f9da-1f3fe-200d-2642":0,"1f9da-1f3ff-200d-2642":0,"1f9da-1f3fb":0,"1f9da-1f3fc":0,"1f9da-1f3fd":0,"1f9da-1f3fe":0,"1f9da-1f3ff":0,"1f9db-1f3fb-200d-2640":0,"1f9db-1f3fc-200d-2640":0,"1f9db-1f3fd-200d-2640":0,"1f9db-1f3fe-200d-2640":0,"1f9db-1f3ff-200d-2640":0,"1f9db-1f3fb-200d-2642":0,"1f9db-1f3fc-200d-2642":0,"1f9db-1f3fd-200d-2642":0,"1f9db-1f3fe-200d-2642":0,"1f9db-1f3ff-200d-2642":0,"1f9db-1f3fb":0,"1f9db-1f3fc":0,"1f9db-1f3fd":0,"1f9db-1f3fe":0,"1f9db-1f3ff":0,"1f9dc-1f3fb-200d-2640":0,"1f9dc-1f3fc-200d-2640":0,"1f9dc-1f3fd-200d-2640":0,"1f9dc-1f3fe-200d-2640":0,"1f9dc-1f3ff-200d-2640":0,"1f9dc-1f3fb-200d-2642":0,"1f9dc-1f3fc-200d-2642":0,"1f9dc-1f3fd-200d-2642":0,"1f9dc-1f3fe-200d-2642":0,"1f9dc-1f3ff-200d-2642":0,"1f9dc-1f3fb":0,"1f9dc-1f3fc":0,"1f9dc-1f3fd":0,"1f9dc-1f3fe":0,"1f9dc-1f3ff":0,"1f9dd-1f3fb-200d-2640":0,"1f9dd-1f3fc-200d-2640":0,"1f9dd-1f3fd-200d-2640":0,"1f9dd-1f3fe-200d-2640":0,"1f9dd-1f3ff-200d-2640":0,"1f9dd-1f3fb-200d-2642":0,"1f9dd-1f3fc-200d-2642":0,"1f9dd-1f3fd-200d-2642":0,"1f9dd-1f3fe-200d-2642":0,"1f9dd-1f3ff-200d-2642":0,"1f9dd-1f3fb":0,"1f9dd-1f3fc":0,"1f9dd-1f3fd":0,"1f9dd-1f3fe":0,"1f9dd-1f3ff":0,"261d-1f3fb":0,"261d-1f3fc":0,"261d-1f3fd":0,"261d-1f3fe":0,"261d-1f3ff":0,"26f9-1f3fb-200d-2640":0,"26f9-1f3fc-200d-2640":0,"26f9-1f3fd-200d-2640":0,"26f9-1f3fe-200d-2640":0,"26f9-1f3ff-200d-2640":0,"26f9-1f3fb-200d-2642":0,"26f9-1f3fc-200d-2642":0,"26f9-1f3fd-200d-2642":0,"26f9-1f3fe-200d-2642":0,"26f9-1f3ff-200d-2642":0,"26f9-1f3fb":0,"26f9-1f3fc":0,"26f9-1f3fd":0,"26f9-1f3fe":0,"26f9-1f3ff":0,"270a-1f3fb":0,"270a-1f3fc":0,"270a-1f3fd":0,"270a-1f3fe":0,"270a-1f3ff":0,"270b-1f3fb":0,"270b-1f3fc":0,"270b-1f3fd":0,"270b-1f3fe":0,"270b-1f3ff":0,"270c-1f3fb":0,"270c-1f3fc":0,"270c-1f3fd":0,"270c-1f3fe":0,"270c-1f3ff":0,"270d-1f3fb":0,"270d-1f3fc":0,"270d-1f3fd":0,"270d-1f3fe":0,"270d-1f3ff":0}},n=s[""];for(const e in s)e&&Object.assign(n,s[e]);const i=n},4762:(e,t,a)=>{a.d(t,{IS_FIREFOX:()=>r,IS_SAFARI:()=>i});var s=a(6761);const n=navigator?navigator.userAgent:null,i=(navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i),navigator.userAgent.toLowerCase().indexOf("android"),/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor),(/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&s.Z.MSStream,!!("safari"in s.Z)||!(!n||!(/\b(iPad|iPhone|iPod)\b/.test(n)||n.match("Safari")&&!n.match("Chrome")))),r=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;(void 0===navigator.maxTouchPoints||navigator.maxTouchPoints>0)&&navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i)},467:(e,t,a)=>{a.d(t,{ZP:()=>o,gV:()=>p});var s=a(5813);const n=/[`~!@#$%^&*()\-_=+\[\]\\|{}'";:\/?.>,<]+/g,i=/^\s+|\s$/g,r={й:"q",ц:"w",у:"e",к:"r",е:"t",н:"y",г:"u",ш:"i",щ:"o",з:"p",х:"[",ъ:"]",ф:"a",ы:"s",в:"d",а:"f",п:"g",р:"h",о:"j",л:"k",д:"l",ж:";",э:"'",я:"z",ч:"x",с:"c",м:"v",и:"b",т:"n",ь:"m",б:",",ю:".",".":"/"};function o(e,t=!0){return p(e,{clearBadChars:!0,latinize:t,ignoreCase:!0})}function p(e,t={}){const a=t.includeTag&&"%"===e.charAt(0),o=e;return t.clearBadChars&&(e=function(e){return e.replace(n,"").replace(i,"")}(e)),t.latinize&&(e=function(e){return e.replace(/[^A-Za-z0-9]/g,(e=>{const t=s.Z[e];return null!=t?t:e}))}(e)),t.ignoreCase&&(e=e.toLowerCase()),a&&(e="%"+e),t.latinize&&(e+=""+function(e){return e.toLowerCase().replace(/[\wа-я]/g,(e=>{const t=r[e];return null!=t?t:e}))}(o)),e}},8801:(e,t,a)=>{a.d(t,{P:()=>n,q:()=>i});const s="_";function n(e,t){const a=""["".length-1]||"";let n;switch(e._){case"inputPhotoFileLocation":n=["photo",""[0],e.id,e.thumb_size].filter(Boolean).join(s);break;case"inputDocumentFileLocation":n=["document",""[0],e.id,e.thumb_size].filter(Boolean).join(s);break;case"inputPeerPhotoFileLocation":n=["peerPhoto",e.photo_id,e.pFlags.big?"big":"small"].join(s);break;case"inputStickerSetThumb":n=["stickerSetThumb",e.stickerset.id||e.stickerset.short_name||e.stickerset.emoticon||e.stickerset._,e.thumb_version].join(s);break;case"inputFileLocation":n=[e.volume_id,e.local_id].join(s);break;case"inputWebFileLocation":n=["webFile",e.url].join(s);break;default:console.error("Unrecognized location:",e),n=""}return n+((null==t?void 0:t.downloadId)?"_download":"")+(a?"."+a:a)}function i(e,t){return e+"/"+encodeURIComponent(JSON.stringify(t))}},677:(e,t,a)=>{a.d(t,{Ki:()=>o,RP:()=>i,X:()=>r});const s=new Set(["all","web","webk"]),n=new Set;function i(e){return e.find((e=>s.has(e.platform)&&!n.has(e.reason)))}function r(e){return!!i(e)}function o(e){n.clear(),e.forEach((e=>{n.add(e)}))}},2946:(e,t,a)=>{a.d(t,{Z:()=>i});var s=a(5880),n=a(1507);function i(e){if(void 0!==e&&e.isPeerId&&e.isPeerId())return e;if((0,s.Z)(e)){const t=e.user_id;if(void 0!==t)return t.toPeerId(!1);const a=e.channel_id||e.chat_id;return void 0!==a?a.toPeerId(!0):n.NM}if(!e)return n.NM;const t="u"===e.charAt(0),a=e.substr(1).split("_");return t?a[0].toPeerId():(a[0]||"").toPeerId(!0)}},6666:(e,t,a)=>{a.d(t,{C:()=>o,Z:()=>p});var s=a(1267),n=a(5471),i=a(5953),r=a(5003);class o{constructor(e){(0,i.Z)(this,e),s.Z.test&&(this.name+="_test"),this.storageIsAvailable=!0,this.log=(0,r.kg)(["IDB",e.name].join("-")),this.log("constructor"),this.openDatabase(!0),o.INSTANCES.push(this)}isAvailable(){return this.storageIsAvailable}openDatabase(e=!1){if(this.openDbPromise&&!e)return this.openDbPromise;const t=(e,t)=>{var a;const s=Array.from(e.indexNames);for(const t of s)e.deleteIndex(t);if(null===(a=t.indexes)||void 0===a?void 0:a.length)for(const a of t.indexes)e.indexNames.contains(a.indexName)||e.createIndex(a.indexName,a.keyPath,a.objectParameters)};try{var a=indexedDB.open(this.name,this.version);if(!a)return Promise.reject()}catch(e){return this.log.error("error opening db",e.message),this.storageIsAvailable=!1,Promise.reject(e)}let s=!1;return setTimeout((()=>{s||a.onerror((0,n.Z)("IDB_CREATE_TIMEOUT"))}),3e3),this.openDbPromise=new Promise(((e,n)=>{a.onsuccess=t=>{s=!0;const i=a.result;let r=!1;this.log("Opened"),i.onerror=e=>{this.storageIsAvailable=!1,this.log.error("Error creating/accessing IndexedDB database",e),n(e)},i.onclose=e=>{this.log.error("closed:",e),!r&&this.openDatabase()},i.onabort=e=>{this.log.error("abort:",e);const t=e.target;this.openDatabase(r=!0),t.onerror&&t.onerror(e),i.close()},i.onversionchange=e=>{this.log.error("onversionchange, lol?")},e(this.db=i)},a.onerror=e=>{s=!0,this.storageIsAvailable=!1,this.log.error("Error creating/accessing IndexedDB database",e),n(e)},a.onupgradeneeded=e=>{s=!0,this.log.warn("performing idb upgrade from",e.oldVersion,"to",e.newVersion);const a=e.target,n=a.result;this.stores.forEach((e=>{if(n.objectStoreNames.contains(e.name)){const s=a.transaction.objectStore(e.name);t(s,e)}else((e,a)=>{const s=e.createObjectStore(a.name);t(s,a)})(n,e)}))}}))}static create(e){var t;return null!==(t=this.INSTANCES.find((t=>t.name===e.name)))&&void 0!==t?t:new o(e)}static closeDatabases(e){this.INSTANCES.forEach((t=>{if(e&&e===t)return;const a=t.db;a&&(a.onclose=()=>{},a.close())}))}}o.INSTANCES=[];class p{constructor(e,t){this.storeName=t,this.log=(0,r.kg)(["IDB",e.name,t].join("-")),this.idb=o.create(e)}delete(e,t){const a=Array.isArray(e);return a||(e=[].concat(e)),this.getObjectStore("readwrite",(t=>{const s=e.map((e=>t.delete(e)));return a?s:s[0]}),"",t)}clear(e){return this.getObjectStore("readwrite",(e=>e.clear()),"",e)}save(e,t,a){const s=Array.isArray(e);return s||(e=[].concat(e),t=[].concat(t)),this.getObjectStore("readwrite",(a=>{const n=e.map(((e,s)=>a.put(t[s],e)));return s?n:n[0]}),"",a)}get(e,t){const a=Array.isArray(e);if(a){if(!e.length)return Promise.resolve([])}else{if(!e)return;e=[].concat(e)}return this.getObjectStore("readonly",(t=>{const s=e.map((e=>t.get(e)));return a?s:s[0]}),"",t)}getObjectStore(e,t,a,s=this.storeName){let n;return a&&(n=performance.now(),this.log(a+": start")),this.idb.openDatabase().then((i=>new Promise(((r,o)=>{const p=i.transaction([s],e),d=()=>{clearTimeout(l),o(p.error)},f=()=>{clearTimeout(l),a&&this.log(a+": end",performance.now()-n);const e=h.map((e=>e.result));r(g?e:e[0])};p.onerror=d;const c="readwrite"===e;c&&(p.oncomplete=()=>f());const l=setTimeout((()=>{this.log.error("transaction not finished",p,a)}),1e4),m=t(p.objectStore(s)),g=Array.isArray(m),h=g?m:[].concat(m);if(c)return;const u=h.length;let y=u;const _=()=>{p.error||--y||f()};for(let e=0;ee.getAll()),"",e)}}},9092:(e,t,a)=>{a.d(t,{r:()=>zs,H:()=>Ws}),a(690),a(4110);var s=a(8630);let n;function i(){return n}function r(e){return n=e}var o=a(1507),p=a(3241),d=a(410),f=a(3206),c=a(1352);class l extends p.Z{constructor(){super(),this.myId=o.NM,this.connectionStatus={},this.premium=!1,this.addEventListener("user_auth",(({id:e})=>{this.myId=e.toPeerId()})),this.addEventListener("premium_toggle_private",(({isNew:e,isPremium:t})=>{this.premium=t,this.dispatchEventSingle("premium_toggle",t)})),this.addEventListener("connection_status_change",(e=>{this.connectionStatus[e.name]=e})),this.dispatchEvent=(e,...t)=>{super.dispatchEvent(e,...t),f.Z.getInstance().invokeVoid("event",{name:e,args:t})},c.kC||this.addEventListener("settings_updated",(({settings:e})=>{this.settings=e}))}getConnectionStatus(){return this.connectionStatus}getPremium(){return this.premium}dispatchEventSingle(...e){super.dispatchEvent(...e)}}const m=new l;d.GO.rootScope=m;const g=m;var h=a(7922),u=a(9750);const y=new class{constructor(){this.state={},this.storage=h.Z}getState(){return Promise.resolve(this.state)}setByKey(e,t){!function(e,t,a){const s=t.split(".");(0,u.Z)(e,s.slice(0,-1).join("."))[s.pop()]=a}(this.state,e,t);const a=e.split(".")[0];"settings"===a&&g.dispatchEvent("settings_updated",{key:e,value:t,settings:this.state.settings}),this.pushToState(a,this.state[a])}pushToState(e,t,a=!0,s){a&&(this.state[e]=t),this.setKeyValueToStorage(e,t,s)}setKeyValueToStorage(e,t=this.state[e],a){f.Z.getInstance().invokeVoid("mirror",{name:"state",key:e,value:t}),this.storage.set({[e]:t},a)}};var _=a(4159),v=a(3725),P=a(5418),b=a(1267),M=a(1655),S=a(5003);class I{constructor(e,t,a){this.dcId=e,this.url=t,this.pending=[],this.debug=b.Z.debug&&!1;let s=S.v9.Error|S.v9.Log;this.debug&&(s|=S.v9.Debug),this.log=(0,S.kg)(`HTTP-${e}`+a,s),this.log("constructor"),this.connected=!1}_send(e,t){const a=e.length;return this.debug&&this.log.debug("-> body length to send:",a),fetch(this.url,{method:"POST",body:e,mode:t}).then((e=>{if(200!==e.status&&!t)throw e.arrayBuffer().then((e=>{this.log.error("not 200",new TextDecoder("utf-8").decode(new Uint8Array(e)))})),e;return this.setConnected(!0),e.arrayBuffer().then((e=>new Uint8Array(e)))}),(e=>{throw this.setConnected(!1),e}))}setConnected(e){this.connected===e||this.destroyed||(this.connected=e,Z.setTransportValue("https",e))}destroy(){this.setConnected(!1),this.destroyed=!0,this.pending.forEach((e=>e.reject())),this.pending.length=0}send(e){if(this.networker)return this._send(e);{const t=new Promise(((t,a)=>{this.pending.push({resolve:t,reject:a,body:e})}));return this.releasePending(),t}}releasePending(){return e=this,t=void 0,s=function*(){if(!this.releasing){this.releasing=!0;for(let e=0;e{this.log("opened"),this.debug&&this.log.debug("sending init packet"),this.dispatchEvent("open")},this.handleError=e=>{this.log.error("handleError",e),this.close()},this.handleClose=e=>{this.log("closed",e),this.removeListeners(),this.dispatchEvent("close")},this.handleMessage=e=>{this.debug&&this.log.debug("<-","handleMessage",e.data.byteLength),this.dispatchEvent("message",e.data)},this.send=e=>{this.debug&&this.log.debug("-> body length to send:",e.length),this.ws.send(e)};let s=S.v9.Error|S.v9.Log;return this.debug&&(s|=S.v9.Debug),this.log=(0,S.kg)(`WS-${e}`+a,s),this.log("constructor"),this.connect(),this}removeListeners(){this.ws&&(this.ws.removeEventListener("open",this.handleOpen),this.ws.removeEventListener("close",this.handleClose),this.ws.removeEventListener("error",this.handleError),this.ws.removeEventListener("message",this.handleMessage),this.ws=void 0)}connect(){this.ws=new WebSocket(this.url,"binary"),this.ws.binaryType="arraybuffer",this.ws.addEventListener("open",this.handleOpen),this.ws.addEventListener("close",this.handleClose),this.ws.addEventListener("error",this.handleError),this.ws.addEventListener("message",this.handleMessage)}close(){if(this.ws){this.log("close execution");try{this.ws.close()}catch(e){}this.handleClose()}}}function k(e){if(!crypto||!("getRandomValues"in crypto))throw new Error("NO_SECURE_RANDOM");return crypto.getRandomValues(e),e}var w=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};class A{constructor(){this._process=(e,t)=>s.Z.invokeCryptoNew({method:"aes-ctr-process",args:[{id:this.id,data:e,operation:t}],transfer:[e.buffer]})}init(e){return w(this,void 0,void 0,(function*(){void 0!==this.idPromise&&this.release();const t=new Uint8Array(64);for(k(t);;){const e=t[3]<<24|t[2]<<16|t[1]<<8|t[0],a=t[7]<<24|t[6]<<16|t[5]<<8|t[4];if(239!==t[0]&&1145128264!==e&&1414745936!==e&&542393671!==e&&1230262351!==e&&4008636142!==e&&3722304989!==e&&0!==a)break;k(t)}const a=t.slice().reverse(),n=t.slice(8,40),i=t.slice(40,56),r=a.slice(8,40),o=a.slice(40,56),p=this.idPromise=s.Z.invokeCrypto("aes-ctr-prepare",{encKey:n,encIv:i,decKey:r,decIv:o});this.process=(e,t)=>w(this,void 0,void 0,(function*(){return yield p,this._process(e,t)})),this.id=yield p,this.process=this._process,t.set(e.obfuscateTag,56);const d=yield this.encode(t.slice());return t.set(d.slice(56,64),56),t}))}encode(e){return this.process(e,"encrypt")}decode(e){return this.process(e,"decrypt")}release(){return w(this,void 0,void 0,(function*(){const e=this.idPromise;if(void 0===e)return;this.id=void 0,this.idPromise=void 0;const t=yield e;s.Z.invokeCrypto("aes-ctr-destroy",t)}))}destroy(){this.release()}}const U=new class{constructor(){this.tag=239,this.obfuscateTag=new Uint8Array([this.tag,this.tag,this.tag,this.tag])}encodePacket(e){const t=e.byteLength>>2;let a;return a=t<127?new Uint8Array([t]):new Uint8Array([127,255&t,t>>8&255,t>>16&255]),a.concat(e)}readPacket(e){let t=e[0];return t>=127?(t=e[1]|e[2]<<8|e[3]<<16,e.slice(4,t<<3)):e.slice(1,t<<3)}};var D=a(9174);function E(e){const t=e.length,a=new Array(t);for(let s=0;sF(this,void 0,void 0,(function*(){this.connected=!0,Z.setTransportOpened("websocket");const e=yield this.obfuscation.init(this.codec);this.connected&&(this.connection.send(e),this.networker&&(this.pending.length=0,this.networker.setConnectionStatus(D.Q.Connected),this.networker.cleanupSent(),this.networker.resend()),setTimeout((()=>{this.releasePending()}),0))})),this.onMessage=e=>F(this,void 0,void 0,(function*(){let t=yield this.obfuscation.decode(new Uint8Array(e));if(t=this.codec.readPacket(t),this.networker)return this.debug&&this.log.debug("redirecting to networker",t.length),void this.networker.parseResponse(t).then((e=>{this.debug&&this.log.debug("redirecting to networker response:",e);try{this.networker.processMessage(e.response,e.messageId,e.sessionId)}catch(e){this.log.error("handleMessage networker processMessage error",e)}})).catch((e=>{this.log.error("handleMessage networker parseResponse error",e)}));const a=this.pending.shift();a?a.resolve(t):this.debug&&this.log.debug("no pending for res:",E(t))})),this.onClose=()=>{let e,t;if(this.clear(),this.autoReconnect){const a=Date.now(),s=a-this.lastCloseTime;e=!isNaN(s)&&s{if(void 0!==this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0),!this.connection){if(this.log("trying to reconnect..."),this.lastCloseTime=Date.now(),this.networker)this.networker.setConnectionStatus(D.Q.Connecting);else for(const e of this.pending)e.bodySent&&(e.bodySent=!1);this.connect()}};let i=S.v9.Error|S.v9.Log;this.debug&&(i|=S.v9.Debug),this.log=(0,S.kg)(`TCP-${t}`+s,i),this.log("constructor"),this.connect()}clear(){this.connected&&Z.setTransportClosed("websocket"),this.connected=!1,this.connection&&(this.connection.removeEventListener("open",this.onOpen),this.connection.removeEventListener("close",this.onClose),this.connection.removeEventListener("message",this.onMessage),this.connection=void 0)}forceReconnect(){this.close(),this.reconnect()}destroy(){this.setAutoReconnect(!1),this.close(),this.obfuscation&&this.obfuscation.destroy(),this.pending.forEach((e=>{e.reject&&e.reject()})),this.pending.length=0}close(){const e=this.connection;if(e){const t=this.connected;this.clear(),t&&(e.addEventListener("message",this.onMessage),e.addEventListener("close",(()=>{e.removeEventListener("message",this.onMessage)}),{once:!0}),e.close())}}setAutoReconnect(e){this.autoReconnect=e,e?this.connection||void 0!==this.reconnectTimeout||this.reconnect():void 0!==this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0)}connect(){this.connection&&this.close(),this.connection=new this.Connection(this.dcId,this.url,this.logSuffix),this.connection.addEventListener("open",this.onOpen),this.connection.addEventListener("close",this.onClose),this.connection.addEventListener("message",this.onMessage)}changeUrl(e){this.url!==e&&(this.url=e,this.forceReconnect())}encodeBody(e){const t=this.codec.encodePacket(e);return this.obfuscation.encode(t)}send(e){this.debug&&this.log.debug("-> body length to pending:",e.length);const t=void 0;if(!this.networker){const a=new Promise(((a,s)=>{this.pending.push({resolve:a,reject:s,body:e,encoded:t})}));return this.releasePending(),a}this.pending.push({body:e,encoded:t}),this.releasePending()}releasePending(){var e;return F(this,void 0,void 0,(function*(){if(!this.connected||this.releasingPending)return;this.releasingPending=!0;let t=this.pending.length,a=!1;for(let s=0;s body length to send:",i.length);const r=null!==(e=n.encoded)&&void 0!==e?e:n.encoded=yield this.encodeBody(i);if(!this.connected)break;this.connection.send(r),n.resolve?n.bodySent=!0:(this.pending.splice(s--,1),t--),a=!0}}this.releasingPending=void 0,this.pending.length&&a&&this.releasePending()}))}}const x=b.Z.test?"_test":"";function B(e){return"client"===e?"":"-1"}function V(e,t,a){const s=B(t),n="client"!==t?"apiws"+x+(a?"_premium":""):"apiws"+x;return`wss://${_.Z.suffix.toLowerCase()}ws${e}${s}.web.telegram.org/${n}`}class O{constructor(){this.sslSubdomains=["pluto","venus","aurora","vesta","flora"],this.dcOptions=b.Z.test?[{id:1,host:"149.154.175.10",port:80},{id:2,host:"149.154.167.40",port:80},{id:3,host:"149.154.175.117",port:80}]:[{id:1,host:"149.154.175.50",port:80},{id:2,host:"149.154.167.50",port:80},{id:3,host:"149.154.175.100",port:80},{id:4,host:"149.154.167.91",port:80},{id:5,host:"149.154.171.5",port:80}],this.chosenServers={},this.transportSocket=(e,t,a)=>{const s=V(e,t,a);let n;return n=C,new R(n,e,s,"upload"===t?"-U":"download"===t?"-D":"",1e4)},this.transportHTTP=(e,t,a)=>{let s;if(b.Z.ssl||!b.Z.http){const a=B(t);s="https://"+(this.sslSubdomains[e-1]+a)+".web.telegram.org/"+(b.Z.test?"apiw_test1":"apiw1")}else for(const t of this.dcOptions)if(t.id===e){s="http://"+t.host+(80!==t.port?":"+t.port:"")+"/apiw1";break}return new I(e,s,"upload"===t?"-U":"download"===t?"-D":"")}}chooseServer(e,t="client",a=b.Z.transport,s=!0,n){this.chosenServers.hasOwnProperty(a)||(this.chosenServers[a]={client:{},download:{},upload:{}});const i=this.chosenServers[a][t];e in i||(i[e]=[]);const r=i[e];if(!r.length||!s){let i;return i=("websocket"===a?this.transportSocket:this.transportHTTP)(e,t,n),i?(s&&r.push(i),i):(console.error("No chosenServer!",e),null)}return r[0]}static removeTransport(e,t){for(const a in e)for(const s in e[a])for(const n in e[a][s]){const i=e[a][s][n];(0,M.Z)(i,t)}}}var L=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};class N extends p.Z{constructor(){super(!0),this.opened=new Map,this.addEventListener("change",(e=>{e.get("websocket")||this.waitForWebSocket()}))}pingTransports(){var e;return L(this,void 0,void 0,(function*(){const t=null!==(e=this.dcConfigurator)&&void 0!==e?e:this.dcConfigurator=new O,a=this.transports={https:t.chooseServer(_.Z.baseDcId,"client","https",!1),websocket:t.chooseServer(_.Z.baseDcId,"client","websocket",!1)},s=(0,v.Z)();this.transports.https._send(new Uint8Array,"no-cors").then((()=>s.resolve(!0)),(()=>s.resolve(!1))),setTimeout((()=>s.resolve(!1)),2e3);const n=(0,v.Z)(),i=a.websocket;i.setAutoReconnect(!1),i.connection.addEventListener("close",(()=>n.resolve(!1)),{once:!0}),i.connection.addEventListener("open",(()=>n.resolve(!0)),{once:!0}),setTimeout((()=>{n.isFulfilled||n.isRejected||(i.connection&&i.connection.close(),n.resolve(!1))}),2e3);const[r,o]=yield Promise.all([s,n]);for(const e in a)a[e].destroy();return{https:r||this.opened.get("https")>0,websocket:o||this.opened.get("websocket")>0}}))}waitForWebSocket(){return L(this,void 0,void 0,(function*(){if(!this.pinging){for(this.pinging=!0;;){const{https:e,websocket:t}=yield this.pingTransports();if((e||t)&&this.dispatchEvent("transport",t||!e?"websocket":"https"),t)break;yield(0,P.Z)(1e4)}this.pinging=!1}}))}setTransportValue(e,t){let a=this.opened.get(e)||0;a+=t?1:-1,this.opened.set(e,a),this.dispatchEvent("change",this.opened)}setTransportOpened(e){return this.setTransportValue(e,!0)}setTransportClosed(e){return this.setTransportValue(e,!1)}}const Z=new N,j=(0,v.Z)();var q=a(6654);class G{setManagers(e){Object.assign(this,e)}}var H=a(3127),W=a(3989),z=a(5466);let K;function J(e){return null!=K?K:K=function(e){return t=this,a=void 0,n=function*(){const t=(0,z.$)((0,S.kg)("STORAGES-LOADER")),a=Object.keys(e),s=a.map((a=>{const s=e[a].getAll();return t(s,"storage "+a)})),n={},i=yield Promise.all(s);for(let e=0,t=a.length;e({storage:this.storages[e],results:t[e]})))},new((s=void 0)||(s=Promise))((function(e,i){function r(e){try{p(n.next(e))}catch(e){i(e)}}function o(e){try{p(n.throw(e))}catch(e){i(e)}}function p(t){var a;t.done?e(t.value):(a=t.value,a instanceof s?a:new s((function(e){e(a)}))).then(r,o)}p((n=n.apply(t,a||[])).next())}));var t,a,s,n}}class Q extends G{getState(){return this.apiManager.invokeApi("account.getPassword").then((e=>e))}updateSettings(e={}){return this.getState().then((t=>{let a,s;const n={password:null,new_settings:{_:"account.passwordInputSettings",hint:e.hint,email:e.email}};a=e.currentPassword?this.cryptoWorker.invokeCrypto("computeSRP",e.currentPassword,t,!1):Promise.resolve({_:"inputCheckPasswordEmpty"});const i=t.new_algo,r=new Uint8Array(i.salt1.length+32);return k(r),r.set(i.salt1,0),i.salt1=r,s=e.newPassword?this.cryptoWorker.invokeCrypto("computeSRP",e.newPassword,t,!0):Promise.resolve(new Uint8Array),Promise.all([a,s]).then((e=>(n.password=e[0],n.new_settings.new_algo=i,n.new_settings.new_password_hash=e[1],this.apiManager.invokeApi("account.updatePasswordSettings",n))))}))}getInputCheckPassword(e,t){return this.cryptoWorker.invokeCrypto("computeSRP",e,t,!1)}check(e,t,a={}){return this.getInputCheckPassword(e,t).then((e=>this.apiManager.invokeApi("auth.checkPassword",{password:e},a).then((e=>("auth.authorization"===e._&&this.apiManager.setUser(e.user),e)))))}confirmPasswordEmail(e){return this.apiManager.invokeApi("account.confirmPasswordEmail",{code:e})}resendPasswordEmail(){return this.apiManager.invokeApi("account.resendPasswordEmail")}cancelPasswordEmail(){return this.apiManager.invokeApi("account.cancelPasswordEmail")}}var Y=a(6848),X=a(5471);class ee extends G{constructor(){super(...arguments),this.contexts=new Map,this.links={},this.log=(0,S.kg)("RD",void 0,!0)}saveContext(e,t,a){[a,e]=this.getContexts(e),a||(a=new Set,this.contexts.set(e,a)),this.links[E(e)]=e;for(const e of a)if((0,Y.Z)(e,t))return;a.add(t)}getReferenceByLink(e){return this.links[E(e)]}getContexts(e){return[this.contexts.get(e)||(e=this.getReferenceByLink(e)||e,this.contexts.get(e)),e]}getContext(e){const t=this.getContexts(e);return t[0]?[t[0].values().next().value,t[1]]:void 0}deleteContext(e,t,a){if([a,e]=this.getContexts(e),a)for(const s of a)if((0,Y.Z)(s,t))return a.delete(s),a.size||(this.contexts.delete(e),delete this.links[E(e)]),!0;return!1}refreshReference(e,t){if(this.log("refreshReference: start",e.slice(),t),!t){const a=this.getContext(e);if(!a)return this.log("refreshReference: got no context for reference:",e.slice()),Promise.reject("NO_CONTEXT");[t,e]=a}let a;switch(null==t?void 0:t.type){case"message":a=this.appMessagesManager.reloadMessages(t.peerId,t.messageId,!0);break;case"emojiesSounds":a=this.refreshEmojiesSoundsPromise||this.appStickersManager.getAnimatedEmojiSounds(!0).then((()=>{this.refreshEmojiesSoundsPromise=void 0}));break;case"userFull":a=Promise.resolve(this.appProfileManager.getProfile(t.userId,!0));break;case"customEmoji":a=this.appEmojiManager.getCustomEmojiDocuments([t.docId]);break;case"attachMenuBotIcon":a=this.appAttachMenuBotsManager.getAttachMenuBot(t.botId,!0);break;case"wallPaper":a=this.appThemesManager.getWallPaperById(t.wallPaperId);break;default:return this.log.warn("refreshReference: not implemented context",t),Promise.reject()}const s=E(e);return this.log("refreshReference: refreshing reference:",s),a.then((()=>{const a=E(e);if(this.log("refreshReference: refreshed, reference before:",s,"after:",a),s!==a)return e;this.deleteContext(e,t);const n=this.getContext(e);if(n)return this.refreshReference(e,n[0]);throw this.log.error("refreshReference: no new context, reference before:",s,"after:",a,t),(0,X.Z)("NO_NEW_CONTEXT")}))}}var te=a(7298),ae=a(7381),se=a(252),ne=a(7625),ie=a(6519);function re(e,t){if(!e)return t;for(var a in e)t.hasOwnProperty(a)||delete e[a];for(var a in t)e[a]=t[a];return e}var oe=a(2790),pe=a(3781),de=a(3385),fe=a(5880),ce=a(8050),le=a(2946);function me(e){var t,a;const s=[e.fromId,e.viaBotId,e.fwdFromId],n=e.media;if(n){const e=n.user_id;void 0!==e&&s.push(e.toPeerId());const t=n.results,a=null==t?void 0:t.recent_voters;(null==a?void 0:a.length)&&s.push(...a.map((e=>e.toPeerId())))}const i=null===(t=e.reactions)||void 0===t?void 0:t.recent_reactions;(null==i?void 0:i.length)&&s.push(...i.map((e=>(0,le.Z)(e.peer_id))));const r=e.action;if(r){const e=[...r.users||[],r.user_id,r.inviter_id];s.push(...e.filter(Boolean).map((e=>e.toPeerId())));const t=[r.channel_id,r.chat_id];s.push(...t.filter(Boolean).map((e=>e.toPeerId(!0))))}const o=null===(a=e.replies)||void 0===a?void 0:a.recent_repliers;return(null==o?void 0:o.length)&&s.push(...o.map((e=>(0,le.Z)(e)))),new Set(s.filter(Boolean))}var ge=a(8027);function he(e,t,a){return e[t]=a}var ue=a(8938);const ye=void 0;class _e extends G{constructor(){super(...arguments),this.clear=(e=!1)=>{if(e){this.allDialogsLoaded={},this.pinnedOrders={};for(const e of o.DZ)this.pinnedOrders[e]=[]}else{this.storage.clear(),this.allDialogsLoaded={},this.saveAllDialogsLoaded(),this.pinnedOrders=Object.assign({},this.pinnedOrders);for(const e of o.DZ)this.resetPinnedOrder(e);this.savePinnedOrders()}this.forumTopics=new Map,this.folders={},this.dialogsOffsetDate={},this.dialogsNum=0,this.dialogsIndex=new ae.Z({clearBadChars:!0,ignoreCase:!0,latinize:!0,includeTag:!0}),this.cachedResults={query:"",count:0,dialogs:[],folderId:0}},this.onUpdateFolderPeers=e=>{e.folder_peers.forEach((e=>{var t;const{folder_id:a,peer:s}=e,n=this.appPeersManager.getPeerId(s),i=this.dropDialog(n)[0];i&&((null===(t=i.pFlags)||void 0===t?void 0:t.pinned)&&this.handleDialogUnpinning(i,a),i.folder_id=a,this.generateIndexForDialog(i),this.pushDialog({dialog:i})),this.appMessagesManager.scheduleHandleNewDialogs(n,i)}))},this.onUpdateDialogPinned=e=>{var t;const a=null!==(t=e.folder_id)&&void 0!==t?t:o.J$,s=this.appPeersManager.getPeerId(e.peer.peer),n=this.getDialogOnly(s);this.handleDialogTogglePinned(n,e.pFlags.pinned,a)},this.onUpdateChannelPinnedTopic=e=>{const t=e.channel_id.toPeerId(!0),a=(0,pe.Z)(e.topic_id),s=this.getForumTopic(t,a);s&&this.handleDialogTogglePinned(s,e.pFlags.pinned,this.getFilterIdForForum(s))},this.onUpdatePinnedDialogs=e=>{var t;const a=null!==(t=e.folder_id)&&void 0!==t?t:o.J$;e.order?this.handleDialogsPinned(a,e.order.map((e=>this.appPeersManager.getPeerId(e.peer)))):this.apiManager.invokeApi("messages.getPinnedDialogs",{folder_id:a}).then((e=>{this.applyDialogs(e),this.handleDialogsPinned(a,e.dialogs.map((e=>e.peerId)))}))},this.onUpdateChannelPinnedTopics=e=>{return t=this,a=void 0,n=function*(){const t=e.channel_id.toPeerId(!0);if(!this.forumTopics.get(t))return;const a=t;if(e.order){const t=e.order.map((e=>(0,pe.Z)(e)));this.handleDialogsPinned(a,t)}else{const e=yield this.apiManager.getLimit("topicPin",!0),s=this.apiManager.invokeApi("channels.getForumTopics",{channel:this.appChatsManager.getChannelInput(t.toChatId()),limit:e,offset_date:0,offset_id:0,offset_topic:0}),n=(yield this.processTopics(t,s)).topics.filter((e=>e.pFlags.pinned));this.handleDialogsPinned(a,n.map((e=>e.id)))}},new((s=void 0)||(s=Promise))((function(e,i){function r(e){try{p(n.next(e))}catch(e){i(e)}}function o(e){try{p(n.throw(e))}catch(e){i(e)}}function p(t){var a;t.done?e(t.value):(a=t.value,a instanceof s?a:new s((function(e){e(a)}))).then(r,o)}p((n=n.apply(t,a||[])).next())}));var t,a,s,n}}after(){this.clear(!0),this.rootScope.addEventListener("language_change",(()=>{const e=this.appUsersManager.getSelf().id.toPeerId(!1);if(this.getDialogOnly(e)){const t=this.appPeersManager.getPeerSearchText(e);this.dialogsIndex.indexObject(e,t)}}));const e=e=>{const t=this.getCachedDialogs(!1);for(let a=0;a{const e=this.getCachedDialogs(!1);for(const e in this.folders)+e>1&&delete this.folders[e];for(let t=0;t{const t=this.getCachedDialogs(!1),a=this.getDialogIndexKeyByFilterId(e.id);for(let e=0;e{this.processChangedUnreadOrUnmuted(e.peerId)})),this.rootScope.addEventListener("chat_update",(e=>{const t=this.appChatsManager.getChat(e),a=e.toPeerId(!0);t.pFlags.left&&this.getDialogOnly(a)&&this.dropDialogOnDeletion(a)})),this.rootScope.addEventListener("chat_toggle_forum",(({chatId:e,enabled:t})=>{const a=e.toPeerId(!0);t||this.flushForumTopicsCache(a),this.processChangedUnreadOrUnmuted(a)})),this.apiUpdatesManager.addMultipleEventsListeners({updateFolderPeers:this.onUpdateFolderPeers,updateDialogPinned:this.onUpdateDialogPinned,updateChannelPinnedTopic:this.onUpdateChannelPinnedTopic,updatePinnedDialogs:this.onUpdatePinnedDialogs,updateChannelPinnedTopics:this.onUpdateChannelPinnedTopics}),Promise.all([this.appStateManager.getState(),this.appStoragesManager.loadStorage("dialogs")]).then((([e,{results:t,storage:a}])=>{this.storage=a,this.dialogs=this.storage.getCache();for(const t of o.DZ){const a=e.pinnedOrders[t];if(!a)continue;const s=this.getPinnedOrders(t);s.splice(0,s.length,...a)}t.length&&W.Z.freezeSaving(this.setDialogsFromState.bind(this,t),["chats","dialogs","messages","users"]),this.allDialogsLoaded=e.allDialogsLoaded||{},t.length&&this.appDraftsManager.addMissedDialogs()}))}setDialogsFromState(e){for(let t=0,a=e.length;tthis.allDialogsLoaded[e]))&&(this.allDialogsLoaded[void 0]=!0),this.saveAllDialogsLoaded())}saveAllDialogsLoaded(){this.appStateManager.pushToState("allDialogsLoaded",this.allDialogsLoaded)}handleDialogUnpinning(e,t){delete e.pFlags.pinned,(0,M.Z)(this.getPinnedOrders(t),this.isFilterIdForForum(t)?e.id:e.peerId),this.savePinnedOrders()}savePinnedOrders(){this.appStateManager.pushToState("pinnedOrders",this.pinnedOrders)}resetPinnedOrder(e){this.getPinnedOrders(e).length=0}getPinnedOrders(e){let t=this.pinnedOrders[e];return!t&&this.isFilterIdForForum(e)&&((0,ge.Z)(this.pinnedOrders,[e]),t=this.pinnedOrders[e]=[]),t}isDialogPinned(e,t){const a=this.filtersStorage.getFilter(t);let s;return s=a?-1!==a.pinnedPeerIds.indexOf(e):!!this.getDialogOnly(e).pFlags.pinned,s}getOffsetDate(e){const t=this.dialogsOffsetDate[e]||0;return e!==ye||t?t:Math.min(...Array.from(o.DZ).sort(((e,t)=>e-t)))}generateFolder(e){const t={dialogs:[],id:e,unreadMessagesCount:0,unreadPeerIds:new Set,unreadUnmutedPeerIds:new Set};return(0,ge.Z)(t,["dispatchUnreadTimeout"]),t}getFolder(e){var t,a;return null!==(t=(a=this.folders)[e])&&void 0!==t?t:a[e]=this.generateFolder(e)}isFilterIdForForum(e){return e&&e<0}getFilterIdForForum(e){return e.peerId}getDialogKey(e){return this.isTopic(e)?e.id:e.peerId}getFolderDialogs(e,t=!0){if(e===ye)return this.getCachedDialogs(t);const a=this.getFolder(e);return this.isFilterIdForForum(e)?t?a.dialogs.filter((e=>!e.pFlags.hidden)):a.dialogs:t?a.dialogs.filter((e=>void 0===e.migratedTo)):a.dialogs}getNextDialog(e,t,a){const s=this.getFolderDialogs(a,!0);let n;if(e){const a=s.findIndex((t=>t.peerId===e));-1!==a&&(n=s[t?a+1:a-1])}else t&&(n=s[0]);return n}getDialogIndexKeyByFilterId(e){if(this.isFilterIdForForum(e))return(0,de.Z)();if(o.DZ.has(e))return(0,de.Z)(e);const t=this.filtersStorage.getFilter(e);return(0,de.Z)(t.localId)}isDialogUnmuted(e){return!this.appNotificationsManager.isPeerLocalMuted({peerId:e.peerId,respectType:!0,threadId:this.isTopic(e)?e.id:void 0})}getFolderUnreadCount(e){const t=this.getFolder(e);return{unreadUnmutedCount:t.unreadUnmutedPeerIds.size,unreadCount:t.unreadPeerIds.size}}getCachedDialogs(e){const t=Array.from(o.DZ).map((t=>this.getFolderDialogs(t,e)));return[].concat(...t)}setDialogIndexInFilter(e,t,a){var s,n;let i;const r=this.isTopic(e),p=r||o.DZ.has(a.id);if(this.filtersStorage.testDialogForFilter(e,a)){const t=r?this.getPinnedOrders(this.getFilterIdForForum(e)):a.pinnedPeerIds,o=this.getDialogKey(e),d=t.indexOf(o);i=-1!==d?this.generateDialogIndex(this.generateDialogPinnedDateByIndex(t.length-1-d),!0):(null===(s=e.pFlags)||void 0===s?void 0:s.pinned)||p?this.generateIndexForDialog(e,!0,void 0,!p):null!==(n=(0,ce.Z)(e))&&void 0!==n?n:this.generateIndexForDialog(e,!0)}return he(e,t,i)}getDialog(e,t,a,s=!0){const n=[];a&&(t=e),void 0===t?n.push(...Array.from(o.DZ).map((e=>this.getFolder(e).dialogs))):n.push(this.getFolderDialogs(t,!1));const i=a?e=>e.id===a:t=>t.peerId===e;for(const e of n){let t=0,a=0;for(let n=e.length;tt.id===e.id:t=>t.peerId===e.peerId,d=r.findIndex(p),f=r[d],c=this.getDialogIndex(f,i);a&&n>o.Zi&&(a=void 0);const l=a?void 0:this.setDialogIndexInFilter(e,i,t);return c!==l&&(!!c!=!!l&&this.prepareFolderUnreadCountModifyingByDialog(n,e,!!l),-1!==d&&r.splice(d,1),l&&(0,ie.Z)(r,e,(e=>this.getDialogIndex(e,i)),-1),!0)}prepareDialogUnreadCountModifying(e,t){const a=this.isTopic(e),s=[],n=a?this.getFilterIdForForum(e):e.folder_id;if(s.push(this.prepareFolderUnreadCountModifyingByDialog(n,e,t)),!a){const a=this.filtersStorage.getFilters();for(const n in a){const i=a[n];this.filtersStorage.testDialogForFilter(e,i)&&s.push(this.prepareFolderUnreadCountModifyingByDialog(i.id,e,t))}}return()=>!t&&s.forEach((e=>e()))}prepareFolderUnreadCountModifyingByDialog(e,t,a){const s=this.appMessagesManager.getDialogUnreadCount(t),n=this.isDialogUnmuted(t);if(void 0===a)return()=>{const a=this.appMessagesManager.getDialogUnreadCount(t),n=this.isDialogUnmuted(t),i=a-s;this.modifyFolderUnreadCount(e,i,!!a,a&&n,t)};{const i=a?s:-s;this.modifyFolderUnreadCount(e,i,!!s,s&&n,t)}}modifyFolderUnreadCount(e,t,a,s,n){var i;const{peerId:r}=n,o=this.appPeersManager.isForum(r),p=this.isTopic(n);if(o&&!p){const i=this.getForumUnreadCount(r);if(i instanceof Promise)return void i.then((({count:t,hasUnmuted:a})=>{n=this.getDialogOnly(r);const s=this.getFolder(e);n&&this.appPeersManager.isForum(r)&&s&&s.dialogs.some((e=>e.peerId===r))&&this.modifyFolderUnreadCount(e,0,!1,!1,n)}));t=0,a=i.count>0,s=i.hasUnmuted}const d=this.getFolder(e);t&&(d.unreadMessagesCount=Math.max(0,d.unreadMessagesCount+t));const f=this.getDialogKey(n);a?d.unreadPeerIds.add(f):d.unreadPeerIds.delete(f),s?d.unreadUnmutedPeerIds.add(f):d.unreadUnmutedPeerIds.delete(f),null!==(i=d.dispatchUnreadTimeout)&&void 0!==i||(d.dispatchUnreadTimeout=T.Z.setTimeout((()=>{d.dispatchUnreadTimeout=void 0;const e=Object.assign({},d);delete e.dialogs,this.rootScope.dispatchEvent("folder_unread",e),p&&this.processChangedUnreadOrUnmuted(r)}),0))}processChangedUnreadOrUnmuted(e){const t=this.getDialogOnly(e);t&&(this.processDialogForFilters(t),this.prepareDialogUnreadCountModifying(t)(),this.rootScope.dispatchEvent("dialog_unread",{peerId:e,dialog:t}))}generateIndexForDialog(e,t,a,s){var n;if(!t)return;const i=this.isTopic(e);let r,o=0;if(e.pFlags.hidden)o=this.generateDialogPinnedDateByIndex(4095),r=!0;else if(e.pFlags.pinned&&!s)o=this.generateDialogPinnedDate(e),r=!0;else{if(a||(a=this.appMessagesManager.getMessageByPeer(e.peerId,e.top_message)),o=(null==a?void 0:a.date)||o,!i){const t=this.appPeersManager.isChannel(e.peerId)&&e.peerId.toChatId();if(t){const e=this.appChatsManager.getChat(t);(!o||e.date&&e.date>o)&&(o=e.date)}}"draftMessage"===(null===(n=e.draft)||void 0===n?void 0:n._)&&e.draft.date>o&&(o=e.draft.date)}o||(o=(0,te.Z)(!0));const p=this.generateDialogIndex(o,r);if(t)return p;he(e,(0,de.Z)(e.folder_id),p)}generateDialogPinnedDateByIndex(e){return 2147418112+(65535&e)}generateDialogPinnedDate(e){const t=this.isTopic(e),a=this.getPinnedOrders(t?this.getFilterIdForForum(e):e.folder_id),s=this.getDialogKey(e);let n=a.indexOf(s);return-1===n&&(a.unshift(s),n=0,t||this.savePinnedOrders()),this.generateDialogPinnedDateByIndex(a.length-1-n)}setDialogToState(e){if(this.isTopic(e))return;const{peerId:t,pts:a}=e,s=this.appMessagesManager.getHistoryStorage(t),n=this.appMessagesManager.getHistoryMessagesStorage(t),i=s.history.slice;let r;for(let e=0,a=i.length;e{"dialogFolder"===t._&&e.dialogs.splice(a,1)})),(0,ue.Z)(s),this.appUsersManager.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats),this.appMessagesManager.saveMessages(e.messages);const n=new Map;s.forEach((e=>{var t,s;const i=this.appPeersManager.getPeerId(e.peer);let r=e.top_message;const o=this.appMessagesManager.pendingTopMsgs[i];if(o){const t=this.appMessagesManager.getMessageByPeer(i,o),a=this.appMessagesManager.getMessageByPeer(i,r);(!r||t&&(!a||(null==t?void 0:t.date)>(null==a?void 0:a.date)))&&(e.top_message=r=o,this.appMessagesManager.getHistoryStorage(i).maxId=o)}if(r||"draftMessage"===(null===(t=e.draft)||void 0===t?void 0:t._)){if(this.saveDialog({dialog:e})){const t=(e=>{let t=n.get(e);return t||n.set(e,t={}),t})(i);a?(null!==(s=t.topics)&&void 0!==s?s:t.topics=new Map).set(e.id,e):t.dialog=e}}else this.dropDialogWithEvent(i,a?this.getDialogKey(e):void 0);const p=this.appMessagesManager.getUpdateAfterReloadKey(i,a?this.getDialogKey(e):void 0),d=this.appMessagesManager.newUpdatesAfterReloadToHandle[p];if(void 0!==d){for(const e of d)d.delete(e),this.apiUpdatesManager.saveUpdate(e);d.size||delete this.appMessagesManager.newUpdatesAfterReloadToHandle[p]}})),n.size&&this.rootScope.dispatchEvent("dialogs_multiupdate",n)}getDialogOffsetDate(e){const t=this.appMessagesManager.getMessageByPeer(e.peerId,e.top_message);return(null==t?void 0:t.date)||0}canSaveDialogByPeerId(e){if(e.isAnyChat()){const t=this.appChatsManager.getChat(e.toChatId());if("channelForbidden"===t._||t.pFlags.left)return!1}return!0}saveDialog({dialog:e,folderId:t,ignoreOffsetDate:a,saveGlobalOffset:s}){var n,i;const r=this.isTopic(e),p=!r,d=r?e.id=(0,pe.Z)(e.id):void 0;r||null!=t||(t=null!==(n=e.folder_id)&&void 0!==n?n:o.J$);const f=this.appPeersManager.getPeerId(e.peer);if(!f)return console.error("saveConversation no peerId???",e,t),!1;if(r||"dialog"===e._||console.error("saveConversation not regular dialog",e,Object.assign({},e)),p&&!this.canSaveDialogByPeerId(f))return!1;const c=this.appPeersManager.isChannel(f)?f.toChatId():o.NM;if(p){const e=this.appPeersManager.getPeerSearchText(f);this.dialogsIndex.indexObject(f,e)}const l=this.getDialogOrTopic(f,d);let m,g;if(e.top_message){m=(0,pe.Z)(e.top_message);const t=(null==l?void 0:l.top_message)&&this.appMessagesManager.getMessageByPeer(f,l.top_message);(null===(i=null==t?void 0:t.pFlags)||void 0===i?void 0:i.is_outgoing)&&l.top_message>=m&&(m=l.top_message),g=this.appMessagesManager.getMessageByPeer(f,m)}else m=this.appMessagesManager.generateTempMessageId(f),g={_:"message",id:m,mid:m,from_id:this.appPeersManager.getOutputPeer(this.appUsersManager.getSelf().id.toPeerId(!1)),peer_id:this.appPeersManager.getOutputPeer(f),deleted:!0,pFlags:{out:!0},date:0,message:""},this.appMessagesManager.saveMessages([g],{isOutgoing:!0});if((null==g?void 0:g.pFlags)||this.appMessagesManager.log.error("saveConversation no message:",e,g),p&&!c&&f.isAnyChat()){const t=this.appChatsManager.getChat(f.toChatId());if(t&&t.migrated_to&&t.pFlags.deactivated){const a=this.appPeersManager.getPeerId(t.migrated_to);this.appMessagesManager.migratedFromTo[f]=a,this.appMessagesManager.migratedToFrom[a]=f,e.migratedTo=a}}if(e.top_message=m,e.read_inbox_max_id=(0,pe.Z)(l&&!e.read_inbox_max_id?l.read_inbox_max_id:e.read_inbox_max_id),e.read_outbox_max_id=(0,pe.Z)(l&&!e.read_outbox_max_id?l.read_outbox_max_id:e.read_outbox_max_id),p&&void 0===e.folder_id&&"dialog"===e._&&(e.folder_id=l?l.folder_id:t),e.draft=this.appDraftsManager.saveDraft({peerId:f,threadId:d,draft:e.draft}),e.peerId=f,g&&g.pFlags.is_outgoing){const t=g.pFlags.out;m>e[t?"read_outbox_max_id":"read_inbox_max_id"]?(g.pFlags.unread=!0,e.unread_count||t||++e.unread_count):delete g.pFlags.unread}const h=this.appMessagesManager.getHistoryStorage(f,d),u=h.history.slice;if(u.length?u.isEnd(se.D.Bottom)||(h.history.insertSlice([m]).setEnd(se.D.Bottom),h.count||(h.count=1),this.appMessagesManager.mergeReplyKeyboard(h,g)&&this.rootScope.dispatchEvent("history_reply_markup",{peerId:f})):(h.history.unshift(m),h.count||(h.count=1),this.appMessagesManager.mergeReplyKeyboard(h,g)&&this.rootScope.dispatchEvent("history_reply_markup",{peerId:f})),h.maxId=m,h.readMaxId=e.read_inbox_max_id,h.readOutboxMaxId=e.read_outbox_max_id,this.appNotificationsManager.savePeerSettings({peerId:f,threadId:r?e.id:void 0,settings:e.notify_settings}),p&&c&&e.pts&&this.apiUpdatesManager.addChannelState(c,e.pts),this.generateIndexForDialog(e),l){const t=this.dialogsStorage.prepareDialogUnreadCountModifying(l);re(l,e),t()}return this.pushDialog({dialog:e,offsetDate:null==g?void 0:g.date,ignoreOffsetDate:a,saveGlobalOffset:s}),r&&this.processTopicUpdate(e,l),!0}processTopicUpdate(e,t){if(!t)return;const{peerId:a,id:s}=e,n=e.icon_emoji_id!==t.icon_emoji_id,i=e.title!==t.title,r=n||i;n&&this.rootScope.dispatchEvent("avatar_update",{peerId:a,threadId:s}),r&&this.rootScope.dispatchEvent("peer_title_edit",{peerId:a,threadId:s})}getDialogs(e){const{query:t="",offsetIndex:a,limit:s=20,filterId:n=o.J$,skipMigrated:i=!1}=e,r=this.isFilterIdForForum(n);if(!r&&!o.DZ.has(n)){const t=[],a=this.appUsersManager.fillContacts();a.cached||t.push(a.promise);const s=this.filtersStorage.reloadMissingPeerIds(n);if(s&&t.push(s),t.length)return Promise.all(t).then((()=>this.getDialogs(e)))}const p=o.DZ.has(n)&&!this.getOffsetDate(n)||r?n:ye;let d=this.getFolderDialogs(n,i);const f=this.getDialogIndexKeyByFilterId(n);if(t&&!r){if(!s||this.cachedResults.query!==t||this.cachedResults.folderId!==n){this.cachedResults.query=t,this.cachedResults.folderId=n;const e=this.dialogsIndex.search(t),a=[];for(const t in this.dialogs){const s=this.dialogs[t];e.has(s.peerId)&&s.folder_id===n&&a.push(s)}a.sort(((e,t)=>this.getDialogIndex(t,f)-this.getDialogIndex(e,f))),this.cachedResults.dialogs=a,this.cachedResults.count=a.length}d=this.cachedResults.dialogs}else this.cachedResults.query="";let c=0;if(a>0)for(let e=d.length;cthis.getDialogIndex(d[c],f));++c);const l=this.isDialogsLoaded(p),m=d.length>=c+s;if(t||l||m){const e=d.slice(c,c+s);return{dialogs:e,count:l?d.length:null,isTopEnd:d.length&&(e[0]&&e[0]===d[0]||this.getDialogIndex(d[0],f)=d.length}}return this.appMessagesManager.getTopMessages({limit:s,folderId:p}).then((e=>{if(i&&(d=this.getFolderDialogs(n,i)),c=0,a>0)for(let e=d.length;cthis.getDialogIndex(d[c],f));++c);const t=d.slice(c,c+s);return{dialogs:t,count:void 0===e.count?d.length:e.count,isTopEnd:d.length&&(t[0]&&t[0]===d[0]||this.getDialogIndex(d[0],f){const t={},a=[];for(const[e,n]of s.getTopicPromises)t[e]=n,a.push((0,oe.Z)(e));s.getTopicPromises.clear();const n=()=>{for(const e in t)t[e].resolve(void 0),s.deletedTopics.add(+e)};if(this.getForumTopicsCache(e)===s)return this.apiManager.invokeApi("channels.getForumTopicsByID",{channel:this.appChatsManager.getChannelInput(e.toChatId()),topics:a}).then((a=>{if(this.getForumTopicsCache(e)===s)return this.applyDialogs(a,e),a.topics.forEach((a=>{"forumTopic"===a._&&(t[a.id].resolve(a),delete t[e])})),a}),(()=>{})).then((()=>{n(),s.getTopicsPromise=void 0,s.getTopicPromises.size&&this.getForumTopicById(e)}));n()}))),n||s.getTopicsPromise}getForumTopic(e,t){var a;const s=this.forumTopics.get(e);return null===(a=null==s?void 0:s.topics)||void 0===a?void 0:a.get(t)}getForumTopicOrReload(e,t){var a;const s=this.getForumTopic(e,t);if(s)return s;const n=this.getForumTopicsCache(e);return(null===(a=null==n?void 0:n.deletedTopics)||void 0===a?void 0:a.has(t))?void 0:this.getForumTopicById(e,t)}processTopics(e,t){return(0,q.Z)(t,(t=>{"pts"in t&&this.apiUpdatesManager.addChannelState(e.toChatId(),t.pts);const a=this.appPeersManager.getOutputPeer(e);return t.topics=t.topics.map((e=>{if("forumTopicDeleted"!==e._)return e.peer=a,e.id=(0,pe.Z)(e.id),e})).filter(Boolean),t}))}processTopicsPromise(e,t){return t.then((t=>(this.processTopics(e,t),t)))}getForumUnreadCount(e){if(!this.appPeersManager.isForum(e))return;const t=this.getFolder(e),a=t.dialogs.length>=20||this.isDialogsLoaded(e)?t.dialogs.slice(0,20):(0,q.Z)(this.getDialogs({filterId:e,limit:20}),(e=>e.dialogs));return(0,q.Z)(a,(e=>({count:e.reduce(((e,t)=>e+ +!!t.unread_count),0),hasUnmuted:e.some((e=>e.unread_count&&this.isDialogUnmuted(e)))})))}handleDialogTogglePinned(e,t,a){e&&(t?e.pFlags.pinned=!0:this.handleDialogUnpinning(e,a),this.generateIndexForDialog(e)),this.appMessagesManager.scheduleHandleNewDialogs(e.peerId,e)}handleDialogsPinned(e,t){const a=this.isFilterIdForForum(e);this.resetPinnedOrder(e),this.getPinnedOrders(e).push(...t),this.savePinnedOrders(),t.reverse();const s={};t.forEach((t=>{s[t]=!0;const n=a?e:t,i=a?t:void 0,r=this.getDialogOrTopic(n,i);this.appMessagesManager.scheduleHandleNewDialogs(n,r),r&&(r.pFlags.pinned=!0,this.generateIndexForDialog(r))}));const n=this.getFolderDialogs(e,!1);for(const e of n){if(!e.pFlags.pinned)break;s[this.getDialogKey(e)]||(delete e.pFlags.pinned,this.generateIndexForDialog(e),this.appMessagesManager.scheduleHandleNewDialogs(e.peerId,e))}}}var ve=a(8479),Pe=a(4064),be=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};const Me=[["pinned_peers","pinnedPeerIds"],["exclude_peers","excludePeerIds"],["include_peers","includePeerIds"]],Se=o.DZ.size,Ie={_:"dialogFilter",pFlags:{},flags:0,id:0,title:"",exclude_peers:[],include_peers:[],pinned_peers:[],excludePeerIds:[],includePeerIds:[],pinnedPeerIds:[]};class Ce extends G{constructor(){super(...arguments),this.clear=e=>{if(e){this.filters={},this.filtersArr=[],this.reloadedPeerIds=new Set,this.localFilters={};for(const e of o.DZ)this.localFilters[e]=this.generateLocalFilter(e)}else this.reloadedPeerIds.clear(),this.clearFilters();this.localId=o.Gu},this.onUpdateDialogFilter=e=>{e.filter?this.saveDialogFilter(e.filter):this.filters[e.id]&&(this.rootScope.dispatchEvent("filter_delete",this.filters[e.id]),delete this.filters[e.id],(0,Pe.Z)(this.filtersArr,(t=>t.id===e.id))),this.pushToState()},this.onUpdateDialogFilters=e=>{const t=(0,ve.Z)(this.filters);this.getDialogFilters(!0).then((e=>{for(const a in t){const t=+a;e.find((e=>e.id===t))||this.onUpdateDialogFilter({_:"updateDialogFilter",id:t})}this.onUpdateDialogFilterOrder({_:"updateDialogFilterOrder",order:e.map((e=>e.id))})}))},this.onUpdateDialogFilterOrder=e=>{const t=e.order.slice();t.includes(o.Zi)||t.splice(t[0]===o.J$?1:0,0,o.Zi),this.localId=o.Gu,t.forEach((e=>{const t=this.filters[e];delete t.localId,this.setLocalId(t)})),this.rootScope.dispatchEvent("filter_order",t),this.pushToState()}}after(){return this.clear(!0),this.apiUpdatesManager.addMultipleEventsListeners({updateDialogFilter:this.onUpdateDialogFilter,updateDialogFilters:this.onUpdateDialogFilters,updateDialogFilterOrder:this.onUpdateDialogFilterOrder}),this.rootScope.addEventListener("premium_toggle",(()=>{this.onUpdateDialogFilters({_:"updateDialogFilters"})})),this.appStateManager.getState().then((e=>{this.prependFilters(e.filtersArr).map((e=>{this.saveDialogFilter(e,!1,!0)}))}))}prependFilters(e){e=e.slice();const t=this.localFilters[o.J$],a=this.localFilters[o.Zi],s=e.findIndex((e=>"dialogFilterDefault"===e._||e.id===o.J$));return-1!==s?e[s]=t:e.unshift(t),(0,Pe.Z)(e,(e=>e.id===o.Zi)),e.splice(e[0]===t?1:0,0,a),this.localId=o.Gu,e.forEach((e=>{delete e.localId})),e}generateLocalFilter(e){const t=Object.assign(Object.assign({},(0,ve.Z)(Ie)),{id:e});return e===o.J$?t.pFlags.exclude_archived=!0:e===o.Zi&&(t.pFlags.exclude_unarchived=!0),o.DZ.has(e)&&(t.pinnedPeerIds=this.dialogsStorage.getPinnedOrders(e)),t}pushToState(){this.appStateManager.pushToState("filtersArr",this.filtersArr)}testDialogForFilter(e,t){if(!t)return!0;if(o.DZ.has(t.id))return e.folder_id===t.id&&this.dialogsStorage.canSaveDialogByPeerId(e.peerId);const a=e.peerId;if(!this.appMessagesManager.getDialogOnly(a))return!1;if(t.excludePeerIds.includes(a))return!1;if(t.includePeerIds.includes(a))return!0;const s=t.pFlags;if(s.exclude_archived&&e.folder_id===o.Zi)return!1;if(s.exclude_read&&!this.appMessagesManager.isDialogUnread(e))return!1;if(s.exclude_muted&&this.appNotificationsManager.isPeerLocalMuted({peerId:a})&&(!e.unread_mentions_count||!e.unread_count))return!1;if(this.appPeersManager.isAnyChat(a)){if(s.broadcasts&&this.appPeersManager.isBroadcast(a))return!0;if(s.groups&&this.appPeersManager.isAnyGroup(a))return!0}else{const e=a.toUserId();if(this.appUsersManager.isBot(e))return!!s.bots;if(s.non_contacts&&!this.appUsersManager.isContact(e))return!0;if(s.contacts&&this.appUsersManager.isContact(e))return!0}return!1}testDialogForFilterId(e,t){return this.testDialogForFilter(e,this.filters[t])}getFilter(e){return this.filters[e]}getFilters(){return this.filters}clearFilters(){const e=this.getFilters();for(const t in e)o.DZ.has(+t)||this.onUpdateDialogFilter({_:"updateDialogFilter",id:+t})}toggleDialogPin(e,t){return be(this,void 0,void 0,(function*(){const a=this.filters[t],s=a.pinnedPeerIds.indexOf(e),n=-1!==s;if(n&&(a.pinned_peers.splice(s,1),a.pinnedPeerIds.splice(s,1)),!n){if(a.pinned_peers.length>=(yield this.apiManager.getConfig()).pinned_infolder_count_max)return Promise.reject((0,X.Z)("PINNED_DIALOGS_TOO_MUCH"));a.pinned_peers.unshift(this.appPeersManager.getInputPeerById(e)),a.pinnedPeerIds.unshift(e)}return this.updateDialogFilter(a)}))}createDialogFilter(e,t){const a=Math.max(1,...Object.keys(this.filters).map((e=>+e)));return(e=(0,ve.Z)(e)).id=a+1,this.updateDialogFilter(e,void 0,t)}updateDialogFilter(e,t=!1,a=!1){const s=t?0:1;return this.apiManager.invokeApi("messages.updateDialogFilter",{flags:s,id:e.id,filter:t?void 0:this.getOutputDialogFilter(e)}).then((s=>{if(this.onUpdateDialogFilter({_:"updateDialogFilter",id:e.id,filter:t?void 0:e}),a){const t=[];for(const e in this.filters){const a=this.filters[e];++a.localId,t.push(a)}e.localId=o.Gu;const a=t.sort(((e,t)=>e.localId-t.localId)).map((e=>e.id));this.onUpdateDialogFilterOrder({_:"updateDialogFilterOrder",order:a})}}))}updateDialogFiltersOrder(e){return this.apiManager.invokeApi("messages.updateDialogFiltersOrder",{order:e}).then((()=>{this.onUpdateDialogFilterOrder({_:"updateDialogFilterOrder",order:e})}))}getOutputDialogFilter(e){const t=(0,ve.Z)(e);return this.filterIncludedPinnedPeers(e),t}filterIncludedPinnedPeers(e){(0,ne.Z)(e.includePeerIds,((t,a)=>{e.pinnedPeerIds.includes(t)&&(e.include_peers.splice(a,1),e.includePeerIds.splice(a,1))}))}reloadMissingPeerIds(e,t="pinned_peers"){const a=this.getFilter(e),s=null==a?void 0:a[t];if(!(null==s?void 0:s.length))return;const n=s.filter((e=>{const t=this.appPeersManager.getPeerId(e),a=this.reloadedPeerIds.has(t),s=this.appMessagesManager.getDialogOnly(t);return!a&&!s}));if(!n.length)return;const i=n.map((e=>{const t=this.appPeersManager.getPeerId(e);return this.appMessagesManager.reloadConversation(e).then((e=>(this.reloadedPeerIds.add(t),e?void 0:t)))}));return Promise.all(i).then((e=>{(e=e.filter(Boolean)).length}))}getDialogFilters(e=!1){return be(this,void 0,void 0,(function*(){const t=Object.keys(this.filters);if(t.length>Se&&!e)return t.map((e=>this.filters[e])).sort(((e,t)=>e.localId-t.localId));const a=yield this.apiManager.invokeApiSingle("messages.getDialogFilters");return this.prependFilters(a).map((t=>this.saveDialogFilter(t,e))).filter(Boolean)}))}getSuggestedDialogsFilters(){return this.apiManager.invokeApi("messages.getSuggestedDialogFilters")}saveDialogFilter(e,t=!0,a){"dialogFilterDefault"===e._&&(e=this.localFilters[o.J$]),(0,ue.Z)(e),o.DZ.has(e.id)||(Me.forEach((([t,a])=>{(0,ue.Z)(e),e[a]=e[t].map((e=>this.appPeersManager.getPeerId(e)))})),this.filterIncludedPinnedPeers(e),e.include_peers=e.pinned_peers.concat(e.include_peers),e.includePeerIds=e.pinnedPeerIds.concat(e.includePeerIds));const s=this.filters[e.id];return s?Object.assign(s,e):this.filters[e.id]=e,this.setLocalId(e),a||(t?this.rootScope.dispatchEvent("filter_update",e):s||this.rootScope.dispatchEvent("filter_new",e)),e}setLocalId(e){void 0!==e.localId?e.localId>=this.localId&&(this.localId=e.localId+1):(e.localId=this.localId++,(0,Pe.Z)(this.filtersArr,(t=>t.id===e.id)),this.filtersArr.push(e),this.pushToState())}isFilterIdAvailable(e){return be(this,void 0,void 0,(function*(){if(o.DZ.has(e))return!0;const t=yield this.apiManager.getLimit("folders");return this.filtersArr.filter((e=>!o.DZ.has(e.id))).slice(0,t).some((t=>t.id===e))}))}}var ke=a(6690),we=a(2821);function Ae(e,t){t.forEach((t=>{Object.getOwnPropertyNames(t.prototype).forEach((a=>{const s=Object.getOwnPropertyDescriptor(t.prototype,a)||Object.create(null);"constructor"!==a&&Object.defineProperty(e.prototype,a,s)}))}))}class Ue{constructor(){this.updatesState={pendingPtsUpdates:[],pendingSeqUpdates:{},syncPending:null,syncLoading:null},this.channelStates={},this.attached=!1,this.log=(0,S.kg)("UPDATES",S.v9.Error|S.v9.Warn|S.v9.Log),this.debug=d.ZP,this.subscriptions={},this.processUpdateMessage=(e,t={})=>{const a={date:e.date,seq:e.seq,seqStart:e.seq_start};switch(this.debug&&this.log.debug("processUpdateMessage",e),e._){case"updatesTooLong":case"new_session_created":this.forceGetDifference();break;case"updateShort":this.processUpdate(e.update,a);break;case"updateShortMessage":case"updateShortChatMessage":{(0,ue.Z)(e),this.debug&&this.log.debug("updateShortMessage | updateShortChatMessage",Object.assign({},e));const t=e.pFlags.out,s=e.from_id||(t?this.appPeersManager.peerId:e.user_id),n=e.chat_id?e.chat_id.toPeerId(!0):e.user_id.toPeerId(!1)||this.appPeersManager.peerId;this.processUpdate({_:"updateNewMessage",message:{_:"message",pFlags:e.pFlags,id:e.id,from_id:this.appPeersManager.getOutputPeer(s.toPeerId()),peer_id:this.appPeersManager.getOutputPeer(n),date:e.date,message:e.message,fwd_from:e.fwd_from,reply_to:e.reply_to,entities:e.entities},pts:e.pts,pts_count:e.pts_count},a);break}case"updatesCombined":case"updates":this.appUsersManager.saveApiUsers(e.users,t.override),this.appChatsManager.saveApiChats(e.chats,t.override),e.updates.forEach((e=>{this.processUpdate(e,a)}));break;default:this.log.warn("Unknown update message",e)}},this._constructor(!1)}setProxy(){const e=this;this.updatesState=new Proxy(this.updatesState,{set:function(t,a,s){return t[a]=s,e.saveUpdatesState(),!0}})}saveUpdatesState(){const e=this.updatesState;this.appStateManager.pushToState("updates",{seq:e.seq,pts:e.pts,date:e.date})}popPendingSeqUpdate(){var e;const t=this.updatesState,a=t.seq+1,s=t.pendingSeqUpdates[a];if(!s)return!1;const n=s.updates;for(let e=0,t=n.length;e=t.syncPending.seqAwaiting&&(t.syncPending.ptsAwaiting?delete t.syncPending.seqAwaiting:this.clearStatePendingSync(t)),!0}popPendingPtsUpdate(e){const t=e?this.getChannelState(e):this.updatesState;if(!t.pendingPtsUpdates.length)return!1;t.pendingPtsUpdates.sort(((e,t)=>e.pts-t.pts));let a=t.pts,s=0,n=0;for(let e=0,i=t.pendingPtsUpdates.length;e=i.pts&&(s=i.pts,n=e)}if(!s)return!1;this.debug&&this.log.debug("pop pending pts updates",s,t.pendingPtsUpdates.slice(0,n+1)),t.pts=s;for(let e=0;e<=n;++e){const a=t.pendingPtsUpdates[e];this.saveUpdate(a)}return t.pendingPtsUpdates.splice(0,n+1),!t.pendingPtsUpdates.length&&t.syncPending&&(t.syncPending.seqAwaiting?delete t.syncPending.ptsAwaiting:this.clearStatePendingSync(t)),!0}forceGetDifference(){this.updatesState.syncLoading||this.getDifference()}processLocalUpdate(e){this.processUpdateMessage({_:"updateShort",update:e})}getDifference(e=!1){const t=this.updatesState,a=t.syncLoading;a||(t.pendingSeqUpdates={},t.pendingPtsUpdates=[]),this.clearStatePendingSync(t);const s=this.apiManager.invokeApi("updates.getDifference",{pts:t.pts,pts_total_limit:e?1200:void 0,date:t.date,qts:-1},{timeout:2147483647}).then((a=>{if(this.debug&&this.log.debug("Get diff result",a),"updates.differenceEmpty"===a._)return this.debug&&this.log.debug("apply empty diff",a.seq),t.date=a.date,void(t.seq=a.seq);if(e&&this.rootScope.dispatchEvent("state_synchronizing"),"updates.differenceTooLong"!==a._){this.appUsersManager.saveApiUsers(a.users),this.appChatsManager.saveApiChats(a.chats),a.other_updates.forEach((e=>{switch(e._){case"updateChannelTooLong":case"updateNewChannelMessage":case"updateEditChannelMessage":return void this.processUpdate(e)}this.saveUpdate(e)})),a.new_messages.forEach((e=>{this.saveUpdate({_:"updateNewMessage",message:e,pts:t.pts,pts_count:0})}));const e="updates.difference"===a._?a.state:a.intermediate_state;t.seq=e.seq,t.pts=e.pts,t.date=e.date}else t.pts=a.pts,t.date=(0,te.Z)(!0)+this.timeManager.getServerTimeOffset(),delete t.seq,this.channelStates={},this.log.warn("getDifference:",a._),this.onDifferenceTooLong();if("updates.differenceSlice"===a._)return this.getDifference();this.debug&&this.log.debug("finished get diff")}));return a||this.justAName(t,s),s}clearStatePendingSync(e){e.syncPending&&(clearTimeout(e.syncPending.timeout),e.syncPending=null)}getChannelDifference(e){const t=this.getChannelState(e),a=t.syncLoading;a||(t.pendingPtsUpdates=[]),this.clearStatePendingSync(t);const s=this.debug?this.log.bindPrefix("getChannelDifference-"+e):void 0,n=this.apiManager.invokeApi("updates.getChannelDifference",{channel:this.appChatsManager.getChannelInput(e),filter:{_:"channelMessagesFilterEmpty"},pts:t.pts,limit:1e3},{timeout:2147483647}).then((a=>{if(null==s||s.debug("diff result",a),t.pts="pts"in a?a.pts:void 0,t.lastDifferenceTime=Date.now(),"updates.channelDifferenceEmpty"!==a._){if("updates.channelDifferenceTooLong"===a._)return delete this.channelStates[e],void this.saveUpdate({_:"updateChannelReload",channel_id:e});if(this.appUsersManager.saveApiUsers(a.users),this.appChatsManager.saveApiChats(a.chats),null==s||s.debug("applying",a.other_updates.length,"channel other updates"),a.other_updates.forEach((e=>{this.saveUpdate(e)})),null==s||s.debug("applying",a.new_messages.length,"channel new messages"),a.new_messages.forEach((e=>{this.saveUpdate({_:"updateNewChannelMessage",message:e,pts:t.pts,pts_count:0})})),null==s||s.debug("apply channel diff",t.pts),"updates.channelDifference"===a._&&!a.pFlags.final)return this.getChannelDifference(e);null==s||s.debug("finished channel get diff")}}));return a||this.justAName(t,n,e),n}onDifferenceTooLong(){this.appUsersManager.clear(),this.appChatsManager.clear(),this.appMessagesManager.clear(),this.rootScope.dispatchEvent("state_cleared")}justAName(e,t,a){e.syncLoading=t,this.rootScope.dispatchEvent("state_synchronizing",a),t.then((()=>{e.syncLoading=null,this.rootScope.dispatchEvent("state_synchronized",a)}),(()=>{e.syncLoading=null}))}addChannelState(e,t){var a,s;if(!t)throw new Error("Add channel state without pts "+e);return null!==(a=(s=this.channelStates)[e])&&void 0!==a?a:s[e]={pts:t,pendingPtsUpdates:[],syncPending:null,syncLoading:null}}getChannelState(e,t){return void 0===this.channelStates[e]&&this.addChannelState(e,t),this.channelStates[e]}processUpdate(e,t={}){var a,s,n,i;let r;switch(e._){case"updateNewChannelMessage":case"updateEditChannelMessage":r=this.appPeersManager.getPeerId(e.message.peer_id).toChatId();break;case"updateChannelTooLong":if(r=e.channel_id,!(r in this.channelStates))return!1;break;default:"channel_id"in e&&"pts"in e&&(r=e.channel_id)}const{pts:o,pts_count:p}=e,d=r?this.getChannelState(r,o):this.updatesState;if(d.syncLoading)return!1;if("updateChannelTooLong"===e._)return(!d.lastPtsUpdateTime||d.lastPtsUpdateTime{d.syncPending=null,d.syncLoading||(r?this.getChannelDifference(r):this.getDifference())}),6)}),d.syncPending.ptsAwaiting=!0,!1;if(o>d.pts)d.pts=o,f=!0,d.lastPtsUpdateTime=Date.now();else if(p)return!1;r&&t.date&&this.updatesState.date0){const a=t.seq,r=t.seqStart||a;if(r!==d.seq+1&&r>d.seq)return this.debug&&this.log.warn("Seq hole",d,null===(s=d.syncPending)||void 0===s?void 0:s.seqAwaiting),null!==(n=(i=d.pendingSeqUpdates)[r])&&void 0!==n||(i[r]={seq:a,date:t.date,updates:[]}),d.pendingSeqUpdates[r].updates.push(e),d.syncPending||(d.syncPending={timeout:T.Z.setTimeout((()=>{d.syncPending=null,d.syncLoading||this.getDifference()}),6)}),(!d.syncPending.seqAwaiting||d.syncPending.seqAwaiting{const t=this.getChannelState(e);t.syncLoading||t.lastDifferenceTime&&!(Date.now()-t.lastDifferenceTime>2500)||this.getChannelDifference(e)};null!==(a=n.interval)&&void 0!==a||(n.interval=T.Z.setInterval(i,3e3)),i()}unsubscribeFromChannelUpdates(e,t){const a=this.subscriptions[e];!(null==a?void 0:a.interval)||--a.count&&!t||(clearInterval(a.interval),a.interval=void 0,delete this.subscriptions[e])}attach(e){this.attached||(this.log("attach"),this.attached=!0,this.appStateManager.getState().then((({updates:t})=>{const a=this.appStateManager.newVersion;t&&t.pts&&t.date?(Object.assign(this.updatesState,t),this.log("will get difference",Object.assign({},t)),this.getDifference(!0)):(this.log("will get new state"),this.updatesState.syncLoading=new Promise((e=>{this.apiManager.invokeApi("updates.getState",{},{noErrorBox:!0}).then((t=>{this.updatesState.seq=t.seq,this.updatesState.pts=t.pts,this.updatesState.date=t.date,this.saveUpdatesState(),this.updatesState.syncLoading=null,e()}))}))),this.apiManager.setUpdatesProcessor(this.processUpdateMessage),this.setProxy(),a&&this.updatesState.syncLoading.then((()=>{return t=this,s=void 0,i=function*(){const t={en:"was updated to version",ru:"обновлён до версии"},s=e=>{fetch(`changelogs/${e}_${a.split(" ")[0]}.md`).then((e=>200===e.status&&e.ok&&e.text()||Promise.reject())).then((s=>{const n=t[e]||t.en;s=`**Telegram Web${_.Z.suffix} ${n} ${a}**\n\n`+s;const i=[],r={_:"updateServiceNotification",entities:i,message:(0,we.Z)(s,i),type:"local",pFlags:{},inbox_date:(0,te.Z)(!0),media:void 0};this.processLocalUpdate(r)}))},n=(0,ke.Z)([e,"en"]);for(const e of n)try{yield s(e);break}catch(e){}},new((n=void 0)||(n=Promise))((function(e,a){function r(e){try{p(i.next(e))}catch(e){a(e)}}function o(e){try{p(i.throw(e))}catch(e){a(e)}}function p(t){var a;t.done?e(t.value):(a=t.value,a instanceof n?a:new n((function(e){e(a)}))).then(r,o)}p((i=i.apply(t,s||[])).next())}));var t,s,n,i}))})))}}Ae(Ue,[p.Z,G]);class De extends G{constructor(){super(...arguments),this.savedAvatarURLs={}}after(){this.rootScope.addEventListener("avatar_update",(({peerId:e,threadId:t})=>{t||this.removeFromAvatarsCache(e)}))}isAvatarCached(e,t){const a=this.savedAvatarURLs[e];return void 0===t?!!a:!(!a||!a[t]||a[t]instanceof Promise)}removeFromAvatarsCache(e){this.savedAvatarURLs[e]&&delete this.savedAvatarURLs[e]}loadAvatar(e,t,a){var s,n;const i=null!==(s=(n=this.savedAvatarURLs)[e])&&void 0!==s?s:n[e]={};if(i[a])return i[a];{const s={_:"inputPeerPhotoFileLocation",pFlags:{},peer:this.appPeersManager.getInputPeerById(e),photo_id:t.photo_id},n={dcId:t.dc_id,location:s};"photo_big"===a&&(s.pFlags.big=!0,n.limitPart=524288);const r=this.apiFileManager.download(n);return i[a]=r.then((e=>i[a]=URL.createObjectURL(e)))}}}var Ee=a(144),Te=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};class Fe extends G{after(){this.calls=new Map,i().IS_CALL_SUPPORTED&&this.apiUpdatesManager.addMultipleEventsListeners({updatePhoneCall:e=>{this.saveCall(e.phone_call)},updatePhoneCallSignalingData:e=>{this.rootScope.dispatchEvent("call_signaling",{callId:e.phone_call_id,data:e.data})}})}computeKey(e,t,a){return this.cryptoWorker.invokeCrypto("compute-dh-key",e,t,a)}saveCall(e){const t="phoneCallDiscarded"===e._,a=this.calls.get(e.id);return a?(re(a,e),t&&this.calls.delete(e.id),e=a):t||this.calls.set(e.id,e),this.rootScope.dispatchEvent("call_update",e),e}getCall(e){return this.calls.get(e)}getCallInput(e){const t=this.getCall(e);return{_:"inputPhoneCall",id:t.id,access_hash:t.access_hash}}savePhonePhoneCall(e){return this.appUsersManager.saveApiUsers(e.users),this.saveCall(e.phone_call)}generateDh(){return this.apiManager.invokeApi("messages.getDhConfig",{version:0,random_length:256}).then((e=>this.cryptoWorker.invokeCrypto("generate-dh",e)))}requestCall(e,t,a,s){return Te(this,void 0,void 0,(function*(){const n=yield this.apiManager.invokeApi("phone.requestCall",{user_id:this.appUsersManager.getUserInput(e),protocol:t,video:s,random_id:(0,Ee.d)(32),g_a_hash:a});return this.savePhonePhoneCall(n)}))}discardCall(e,t,a,s){return Te(this,void 0,void 0,(function*(){if(!this.getCall(e))return;const n=yield this.apiManager.invokeApi("phone.discardCall",{video:s,peer:this.getCallInput(e),duration:t,reason:{_:a},connection_id:"0"});this.apiUpdatesManager.processUpdateMessage(n)}))}}var Re=a(7120),xe=a(2566),Be=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};class Ve extends G{constructor(){super(...arguments),this.clear=(e=!1)=>{if(e)this.chats={};else for(const e in this.chats)if(e&&!this.peersStorage.isPeerNeeded(e.toPeerId(!0))){const t=this.chats[e];this.appUsersManager.modifyUsernamesCache(t,!1),this.storage.delete(e),delete this.chats[e]}},this.onChatUpdated=(e,t)=>{var a;this.apiUpdatesManager.processUpdateMessage(t),(null===(a=null==t?void 0:t.updates)||void 0===a?void 0:a.length)&&this.isChannel(e)&&this.rootScope.dispatchEvent("invalidate_participants",e)},this.onUpdateChannelParticipant=e=>{this.apiManager.clearCache("channels.getParticipants",(t=>t.channel.channel_id===e.channel_id)),this.rootScope.dispatchEvent("chat_participant",e)},this.onUpdateChatDefaultBannedRights=e=>{const t=this.appPeersManager.getPeerId(e.peer).toChatId(),a=this.chats[t];a&&(a.default_banned_rights=e.default_banned_rights,this.rootScope.dispatchEvent("chat_update",t))}}after(){return this.clear(!0),this.apiUpdatesManager.addMultipleEventsListeners({updateChannelParticipant:this.onUpdateChannelParticipant,updateChatDefaultBannedRights:this.onUpdateChatDefaultBannedRights}),Promise.all([this.appStateManager.getState(),this.appStoragesManager.loadStorage("chats")]).then((([e,{results:t,storage:a}])=>{this.storage=a,this.saveApiChats(t),this.peersStorage.addEventListener("peerNeeded",(e=>{e.isUser()||this.storage.getFromCache(e.toChatId())||this.storage.set({[e.toChatId()]:this.getChat(e.toChatId())})})),this.peersStorage.addEventListener("peerUnneeded",(e=>{!e.isUser()&&this.storage.getFromCache(e.toChatId())&&this.storage.delete(e.toChatId())}))}))}saveApiChats(e,t){e.saved||(e.saved=!0,e.forEach((e=>this.saveApiChat(e,t))))}saveApiChat(e,t){var a,s,n,i,r;if(!e||"chatEmpty"===e._)return;const o=this.chats[e.id];if(null!==(a=(r=e).pFlags)&&void 0!==a||(r.pFlags={}),e.pFlags.min&&void 0!==o)return;"channel"===e._&&void 0===e.participants_count&&void 0!==o&&o.participants_count&&(e.participants_count=o.participants_count),"chatPhotoEmpty"===(null===(s=e.photo)||void 0===s?void 0:s._)&&delete e.photo;const p=this.appUsersManager.setUsernameToCache(e,o),d=e.id.toPeerId(!0);if(void 0===o)this.chats[e.id]=e;else{const t=null===(n=o.photo)||void 0===n?void 0:n.photo_id,a=null===(i=e.photo)||void 0===i?void 0:i.photo_id,s=o.pFlags.forum!==e.pFlags.forum,r=t!==a||s,f=o.title!==e.title||p,c=o.pFlags.verified!==e.pFlags.verified||o.pFlags.scam!==e.pFlags.scam||o.pFlags.fake!==e.pFlags.fake;re(o,e),this.rootScope.dispatchEvent("chat_update",e.id),r&&this.rootScope.dispatchEvent("avatar_update",{peerId:d}),(f||c)&&this.rootScope.dispatchEvent("peer_title_edit",{peerId:d}),s&&this.rootScope.dispatchEvent("chat_toggle_forum",{chatId:e.id,enabled:!!e.pFlags.forum})}this.peersStorage.isPeerNeeded(d)&&this.storage.set({[e.id]:e})}getChat(e){return this.chats[e]}hasRights(e,t,a,s){return(0,Re.Z)(this.getChat(e),t,a,s)}editChatDefaultBannedRights(e,t){const a=this.getChat(e);return a.default_banned_rights&&a.default_banned_rights.until_date===t.until_date&&(0,Y.Z)(a.default_banned_rights.pFlags,t.pFlags)?Promise.resolve():this.apiManager.invokeApi("messages.editChatDefaultBannedRights",{peer:this.appPeersManager.getInputPeerById(e.toPeerId(!0)),banned_rights:t}).then(this.onChatUpdated.bind(this,e))}isChannel(e){const t=this.chats[e];return!(!t||"channel"!==t._&&"channelForbidden"!==t._)}isMegagroup(e){var t;const a=this.chats[e];return!!(null===(t=null==a?void 0:a.pFlags)||void 0===t?void 0:t.megagroup)}isForum(e){var t;const a=this.chats[e];return!!(null===(t=null==a?void 0:a.pFlags)||void 0===t?void 0:t.forum)}isBroadcast(e){return this.isChannel(e)&&!this.isMegagroup(e)}isInChat(e){let t=!0;const a=this.getChat(e);return(!a||"channelForbidden"===a._||"chatForbidden"===a._||"chatEmpty"===a._||a.pFlags.left||a.pFlags.deactivated)&&(t=!1),t}getChannelInput(e){const t=this.getChat(e);return t&&t.access_hash?{_:"inputChannel",channel_id:e,access_hash:t.access_hash||"0"}:{_:"inputChannelEmpty"}}getInputPeer(e){return this.isChannel(e)?this.getChannelInputPeer(e):this.getChatInputPeer(e)}getChatInputPeer(e){return{_:"inputPeerChat",chat_id:e}}getChannelInputPeer(e){return{_:"inputPeerChannel",channel_id:e,access_hash:this.getChat(e).access_hash||0}}hasChat(e,t){const a=this.chats[e];return(0,fe.Z)(a)&&(t||!a.pFlags.min)}getChatString(e){const t=this.getChat(e);return this.isChannel(e)?(this.isMegagroup(e)?"s":"c")+e+"_"+t.access_hash:"g"+e}createChannel(e){return this.apiManager.invokeApi("channels.createChannel",e).then((e=>(this.apiUpdatesManager.processUpdateMessage(e),e.chats[0].id)))}inviteToChannel(e,t){const a=this.getChannelInput(e),s=t.map((e=>this.appUsersManager.getUserInput(e)));return this.apiManager.invokeApi("channels.inviteToChannel",{channel:a,users:s}).then(this.onChatUpdated.bind(this,e))}createChat(e,t){return this.apiManager.invokeApi("messages.createChat",{users:t.map((e=>this.appUsersManager.getUserInput(e))),title:e}).then((e=>(this.apiUpdatesManager.processUpdateMessage(e),e.chats[0].id)))}leaveChannel(e){return this.apiManager.invokeApi("channels.leaveChannel",{channel:this.getChannelInput(e)}).then(this.onChatUpdated.bind(this,e))}joinChannel(e){return this.apiManager.invokeApi("channels.joinChannel",{channel:this.getChannelInput(e)}).then(this.onChatUpdated.bind(this,e))}addChatUser(e,t,a=100){return this.apiManager.invokeApi("messages.addChatUser",{chat_id:e,user_id:this.appUsersManager.getUserInput(t),fwd_limit:a}).then(this.onChatUpdated.bind(this,e))}deleteChatUser(e,t){return this.apiManager.invokeApi("messages.deleteChatUser",{chat_id:e,user_id:this.appUsersManager.getUserInput(t)}).then(this.onChatUpdated.bind(this,e))}leaveChat(e){return this.deleteChatUser(e,this.appUsersManager.getSelf().id)}leave(e){return this.isChannel(e)?this.leaveChannel(e):this.leaveChat(e)}delete(e){return this.isChannel(e)?this.deleteChannel(e):this.deleteChat(e)}deleteChannel(e){return this.apiManager.invokeApi("channels.deleteChannel",{channel:this.getChannelInput(e)}).then(this.onChatUpdated.bind(this,e))}deleteChat(e){return this.apiManager.invokeApi("messages.deleteChat",{chat_id:e})}migrateChat(e){const t=this.getChat(e);return"channel"===t._?Promise.resolve(t.id):this.apiManager.invokeApi("messages.migrateChat",{chat_id:e}).then((t=>(this.onChatUpdated(e,t),t.updates.find((e=>"updateChannel"===e._)).channel_id)))}updateUsername(e,t,a){const s=this.apiManager.invokeApi("channels.updateUsername",{channel:this.getChannelInput(e),username:t});return this.refreshChatAfterRequest(e,s,a)}editPhoto(e,t){const a={_:"inputChatUploadedPhoto",file:t};let s;return s=this.isChannel(e)?this.apiManager.invokeApi("channels.editPhoto",{channel:this.getChannelInput(e),photo:a}):this.apiManager.invokeApi("messages.editChatPhoto",{chat_id:e,photo:a}),s.then(this.onChatUpdated.bind(this,e))}editTitle(e,t){let a;return a=this.isChannel(e)?this.apiManager.invokeApi("channels.editTitle",{channel:this.getChannelInput(e),title:t}):this.apiManager.invokeApi("messages.editChatTitle",{chat_id:e,title:t}),a.then(this.onChatUpdated.bind(this,e))}editAbout(e,t){const a=e.toPeerId(!0);return this.apiManager.invokeApi("messages.editChatAbout",{peer:this.appPeersManager.getInputPeerById(a),about:t}).then((e=>(e&&this.rootScope.dispatchEvent("peer_bio_edit",a),e)))}editBanned(e,t,a){return Be(this,void 0,void 0,(function*(){const s="object"!=typeof t?t:(0,xe.Z)(t),n=this.isChannel(e);if(!n){const t=yield this.migrateChat(e);e=t}return this.apiManager.invokeApi("channels.editBanned",{channel:this.getChannelInput(e),participant:this.appPeersManager.getInputPeerById(s),banned_rights:a}).then((i=>{if(this.onChatUpdated(e,i),"object"==typeof t){const i=(0,te.Z)(!0);this.apiUpdatesManager.processLocalUpdate({_:"updateChannelParticipant",channel_id:e,date:i,actor_id:void 0,qts:void 0,user_id:s,prev_participant:n?t:void 0,new_participant:Object.keys(a.pFlags).length?{_:"channelParticipantBanned",date:i,banned_rights:a,kicked_by:this.appUsersManager.getSelf().id,peer:this.appPeersManager.getOutputPeer(s),pFlags:{}}:void 0})}}))}))}clearChannelParticipantBannedRights(e,t){return this.editBanned(e,t,{_:"chatBannedRights",until_date:0,pFlags:{}})}kickFromChannel(e,t){return this.editBanned(e,t,{_:"chatBannedRights",until_date:0,pFlags:{view_messages:!0}})}kickFromChat(e,t){return this.isChannel(e)?this.kickFromChannel(e,t):this.deleteChatUser(e,(0,fe.Z)(t)?(0,xe.Z)(t):t.toUserId())}resolveChannel(e){return this.apiManager.invokeApiSingle("channels.getChannels",{id:[{_:"inputChannel",channel_id:e,access_hash:"0"}]}).then((e=>{this.saveApiChats(e.chats)}))}togglePreHistoryHidden(e,t){return this.migrateChat(e).then((e=>this.apiManager.invokeApi("channels.togglePreHistoryHidden",{channel:this.getChannelInput(e),enabled:t}).then(this.onChatUpdated.bind(this,e))))}toggleSignatures(e,t){return this.apiManager.invokeApi("channels.toggleSignatures",{channel:this.getChannelInput(e),enabled:t}).then(this.onChatUpdated.bind(this,e))}toggleNoForwards(e,t){return this.apiManager.invokeApi("messages.toggleNoForwards",{peer:this.getInputPeer(e),enabled:t}).then(this.onChatUpdated.bind(this,e))}setChatAvailableReactions(e,t){const a=this.appProfileManager.getCachedFullChat(e);return a&&(a.available_reactions=t,this.rootScope.dispatchEvent("chat_full_update",e)),this.apiManager.invokeApi("messages.setChatAvailableReactions",{peer:this.getInputPeer(e),available_reactions:t}).then(this.onChatUpdated.bind(this,e))}getSendAs(e){return this.apiManager.invokeApiSingleProcess({method:"channels.getSendAs",params:{peer:this.getChannelInputPeer(e)},processResult:e=>(this.appUsersManager.saveApiUsers(e.users),this.saveApiChats(e.chats),e.peers)})}importChatInvite(e){return this.apiManager.invokeApi("messages.importChatInvite",{hash:e}).then((e=>(this.apiUpdatesManager.processUpdateMessage(e),e.chats[0].id)))}checkUsername(e,t){return this.apiManager.invokeApi("channels.checkUsername",{channel:this.getChannelInput(e),username:t})}getSponsoredMessage(e){return this.apiManager.invokeApiCacheable("channels.getSponsoredMessages",{channel:this.getChannelInput(e)},{cacheSeconds:300}).then((e=>{if("messages.sponsoredMessages"===e._){this.appUsersManager.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats);const t=e.messages.shift();e.messages.push(t)}return e}))}viewSponsoredMessage(e,t){return this.apiManager.invokeApiSingle("channels.viewSponsoredMessage",{channel:this.getChannelInput(e),random_id:t})}checkChatInvite(e){return this.apiManager.invokeApi("messages.checkChatInvite",{hash:e}).then((e=>(e.chat&&this.saveApiChat(e.chat,!0),e)))}toggleUsername(e,t,a){const s=this.apiManager.invokeApi("channels.toggleUsername",{channel:this.getChannelInput(e),username:t,active:a});return this.refreshChatAfterRequest(e,s)}reorderUsernames(e,t){const a=this.apiManager.invokeApi("channels.reorderUsernames",{channel:this.getChannelInput(e),order:t});return this.refreshChatAfterRequest(e,a)}deactivateAllUsernames(e,t){const a=this.apiManager.invokeApi("channels.deactivateAllUsernames",{channel:this.getChannelInput(e)});return this.refreshChatAfterRequest(e,a,t)}makeChannelPrivate(e){const t=[this.updateUsername(e,"",!0),this.deactivateAllUsernames(e,!0)],a=Promise.all(t).then((()=>!0));return this.refreshChatAfterRequest(e,a)}refreshChatAfterRequest(e,t,a){return a?t:t.then((t=>this.getChannels([e]).then((()=>t))))}getChannels(e){return this.apiManager.invokeApi("channels.getChannels",{id:e.map((e=>this.getChannelInput(e)))}).then((e=>{this.saveApiChats(e.chats)}))}toggleForum(e,t){return this.migrateChat(e).then((e=>this.apiManager.invokeApi("channels.toggleForum",{channel:this.getChannelInput(e),enabled:t}).then(this.onChatUpdated.bind(this,e))))}editForumTopic(e){const{chatId:t,topicId:a,title:s,iconEmojiId:n,closed:i,hidden:r}=e;return this.apiManager.invokeApi("channels.editForumTopic",{channel:this.getChannelInput(t),topic_id:(0,oe.Z)(a),title:s,icon_emoji_id:n,closed:i,hidden:r}).then(this.onChatUpdated.bind(this,t))}createForumTopic(e){return Be(this,void 0,void 0,(function*(){const{chatId:t,title:a,iconColor:s,iconEmojiId:n}=e,i=yield this.appProfileManager.getChannelFull(t),r=i.default_send_as&&this.appPeersManager.getInputPeerById(this.appPeersManager.getPeerId(i.default_send_as));return this.apiManager.invokeApi("channels.createForumTopic",{channel:this.getChannelInput(t),title:a,icon_color:s,icon_emoji_id:n,random_id:(0,Ee.a)(),send_as:r}).then((e=>{this.onChatUpdated(t,e);const a=e.updates.find((e=>"updateNewChannelMessage"===e._));return(0,pe.Z)(a.message.id)}))}))}updatePinnedForumTopic(e,t,a){return this.apiManager.invokeApi("channels.updatePinnedForumTopic",{channel:this.getChannelInput(e),topic_id:(0,oe.Z)(t),pinned:a}).then(this.onChatUpdated.bind(this,e))}}a(4762);var Oe,Le=a(5953),Ne=a(9005),Ze=a(6637),je=a(2423);function qe(e,t){(0,Ze.Z)(e)||(e="https://"+e);const a={url:e};let s,n,i,r;if(s=e.match(/^(?:https?:\/\/)?(?:(.+?)\.)?(?:(?:web|k|z)\.)?t(?:elegram)?\.me(?:\/(.+))?/)){const t=new URL(e);let a=s[1];a&&o.BX.has(s[1])&&(a=void 0),a&&(t.pathname=a+("/"===t.pathname?"":t.pathname));const n=t.pathname.slice(1),i=n.split("/");if(i[0]&&"$"===i[0][0]&&i[0].length>1)r="invoice";else if(/^\W/.test(n)&&!je.kO.test(n))r="joinchat";else switch(i[0]){case"joinchat":case"addstickers":case"addemoji":case"voicechat":case"invoice":if(1!==i.length&&!a){r=i[0];break}default:if(i[1]&&i[1].match(/^\d+(?:\?(?:comment|thread)=\d+)?$/)||1===i.length){r="im";break}}}else(n=e.match(/^(?:https?:\/\/)?telesco\.pe\/([^/?]+)\/(\d+)/))?r="im":(i=e.match(/tg:(?:\/\/)?(.+?)(?:\?|$)/))&&(r="tg_"+i[1]);return window[r]||(r=void 0),a.onclick=r,a}d.GO&&(d.GO.wrapUrl=qe),function(e){let t,s;function n(t){e.lastRequestedLangCode=t,e.lastRequestedNormalizedLangCode=t.split("-")[0]}function i(){if("h12"===e.timeFormat)try{const t=P({hour:"numeric",minute:"numeric",hour12:!0}),a=new Date;a.setHours(0);const s=t.format(a);e.amPmCache.am=s.split(/\s/)[1],a.setHours(12);const n=t.format(a);e.amPmCache.pm=n.split(/\s/)[1]}catch(t){console.error("cannot get am/pm",t),e.amPmCache={am:"AM",pm:"PM"}}}function r(){const e=_.Z.langPackCode;return n(e),Promise.all([a.e(104).then(a.bind(a,9104)),a.e(301).then(a.bind(a,9301)),a.e(8).then(a.bind(a,9179))]).then((([t,a,s])=>{const n=[];return p(t.default,n),p(a.default,n),f({_:"langPackDifference",from_version:0,lang_code:e,strings:n,version:0,local:!0,countries:s.default})}))}function o(t,s){e.requestedServerLanguage=!0;const n=g.managers;return Promise.all([n.apiManager.invokeApiCacheable("langpack.getLangPack",{lang_code:t,lang_pack:"web"}),!1,a.e(104).then(a.bind(a,9104)),a.e(301).then(a.bind(a,9301)),n.apiManager.invokeApiCacheable("help.getCountriesList",{lang_code:t,hash:0}),e.polyfillPromise])}function p(e,t=[]){for(const a in e){const s=e[a];"string"==typeof s?t.push({_:"langPackString",key:a,value:s}):t.push(Object.assign({_:"langPackStringPluralized",key:a},s))}return t}function f(e){return e.appVersion=_.Z.langPackVersion,h.Z.set({langPack:e}).then((()=>(c(e),e)))}function c(a){const s=e.lastRequestedLangCode;if(a.lang_code===s){try{t=new Intl.PluralRules(e.lastRequestedNormalizedLangCode)}catch(a){console.error("pluralRules error",a),t=new Intl.PluralRules(e.lastRequestedNormalizedLangCode.split("-",1)[0])}try{t=new Intl.PluralRules(a.lang_code)}catch(e){console.error("pluralRules error",e),t=new Intl.PluralRules(a.lang_code.split("-",1)[0])}e.strings.clear();for(const t of a.strings)e.strings.set(t.key,t);a.countries&&(e.countriesList.length=0,e.countriesList.push(...a.countries.countries),a.countries.countries.forEach((t=>{if(t.name){const a=t.default_name;e.strings.set(a,{_:"langPackString",key:a,value:t.name})}}))),e.lastAppliedLangCode!==s&&(g.dispatchEvent("language_change",s),e.lastAppliedLangCode=s,v.clear(),i()),Array.from(document.querySelectorAll(".i18n")).forEach((t=>{const a=e.weakMap.get(t);a&&a.update()}))}}function l(e,t,a={i:0}){const s=[];let n=0;return e.replace(/(\*\*|__)(.+?)\1|(\n)|(\[.+?\]\(.*?\))|un\d|%\d\$.|%./g,((e,i,r,o,p,d,f)=>{if(s.push(f.slice(n,d)),i){let e;switch(i){case"**":e=document.createElement("b");break;case"__":e=document.createElement("i")}e.append(...l(r,t,a)),s.push(e)}else if(o)s.push(document.createElement("br"));else if(p){const e=p.lastIndexOf("]"),n=p.slice(1,e),i=p.slice(e+2,p.length-1);let r;if(i&&(0,Ze.Z)(i)){r=document.createElement("a");const e=qe(i);r.href=e.url,e.onclick&&r.setAttribute("onclick",e.onclick),r.target="_blank"}else r=t[a.i++],r instanceof DocumentFragment&&(r=r.firstChild),"string"!=typeof r&&(r.textContent="");const o=l(n,t,a);"string"==typeof r?s.push(...o):(r.append(...o),s.push(r))}else t&&function(e,t,a){const s=t[a.i++];Array.isArray(s)?e.push(...s):e.push(s)}(s,t,a);return n=d+e.length,""})),n!==e.length&&s.push(e.slice(n)),s}function m(a,s=!1,n){const i=e.strings.get(a);let r;if(i)if("langPackStringPluralized"===i._&&(null==n?void 0:n.length)){let e=n[0];"string"==typeof e&&(e=+e.replace(/\D/g,"")),r=i[t.select(e)+"_value"]||i.other_value}else r="langPackString"===i._?i.value:a;else r=a;const o=l(r,n);return s?o.map((e=>e instanceof Node?e.textContent:e)).join(""):o}e.strings=new Map,e.countriesList=[],e.requestedServerLanguage=!1,e.isRTL=!1,e.setRTL=function(t){e.isRTL=t},e.getCacheLangPack=function(){return s||(s=Promise.all([h.Z.get("langPack"),e.polyfillPromise]).then((([t])=>t?(d.ZP,e.lastRequestedLangCode||n(t.lang_code),c(t),t):r())).finally((()=>{s=void 0})))},e.setTimeFormat=function(t,a=!!e.timeFormat&&e.timeFormat!==t){e.timeFormat=t,i(),a&&(v.clear(),Array.from(document.querySelectorAll(".i18n")).forEach((t=>{const a=e.weakMap.get(t);a instanceof b&&a.update()})))},e.loadLocalLangPack=r,e.loadLangPack=o,e.getStrings=function(e,t){return g.managers.apiManager.invokeApi("langpack.getStrings",{lang_pack:_.Z.langPack,lang_code:e,keys:t})},e.formatLocalStrings=p,e.getLangPack=function(e,t){return n(e),o(e).then((([e,t,a,s,n,i])=>{let r=[];return[a,s].forEach((e=>{p(e.default,r)})),r=r.concat(...[e.strings,t.strings].filter(Boolean)),e.strings=r,e.countries=n,f(e)}))},e.saveLangPack=f,e.polyfillPromise="undefined"!=typeof Intl&&void 0!==Intl.PluralRules?Promise.resolve():a.e(642).then(a.bind(a,4642)).then((e=>{window.Intl=Object.assign("undefined"!=typeof Intl?Intl:{},e.default)})),e.applyLangPack=c,e.superFormatter=l,e.format=m,e.weakMap=new WeakMap;class u{constructor(t){this.element=(null==t?void 0:t.element)||document.createElement("span"),this.element.classList.add("i18n"),this.property=null==t?void 0:t.property,t&&(t.key||t.date)&&this.update(t),e.weakMap.set(this.element,this)}}class y extends u{constructor(e={}){var t;super(Object.assign(Object.assign({},e),{property:null!==(t=e.property)&&void 0!==t?t:"innerHTML"}))}update(e){if((0,Le.Z)(this,e),"innerHTML"===this.property)this.element.textContent="",this.element.append(...m(this.key,!1,this.args));else{const e=this.element[this.property],t=m(this.key,!0,this.args);void 0===e?this.element.dataset[this.property]=t:this.element[this.property]=t}}compareAndUpdate(e){if(this.key!==e.key||!(0,Y.Z)(this.args,e.args))return this.update(e)}}e.IntlElement=y;const v=new Map;function P(t={}){const a=JSON.stringify(t);let s=v.get(a);return s||(s=new Intl.DateTimeFormat(e.lastRequestedNormalizedLangCode+"-u-hc-"+e.timeFormat,t),v.set(a,s)),s}e.amPmCache={am:"AM",pm:"PM"};class b extends u{constructor(e){var t;super(Object.assign(Object.assign({},e),{property:null!==(t=e.property)&&void 0!==t?t:"textContent"})),this.element.setAttribute("dir","auto")}update(t){let a;if((0,Le.Z)(this,t),this.options.hour&&this.options.minute&&2===Object.keys(this.options).length){const t=this.date.getHours();a=("0"+("h12"===e.timeFormat?t%12||12:t)).slice(-2)+":"+("0"+this.date.getMinutes()).slice(-2),"h12"===e.timeFormat&&(a+=" "+(t<12?e.amPmCache.am:e.amPmCache.pm))}else{const e=P(this.options);a=(0,Ne.Z)(e.format(this.date))}this.element[this.property]=a}}e.IntlDateElement=b,e.i18n=function(e,t){return new y({key:e,args:t}).element},e.i18n_=function(e){return new y(e).element},e._i18n=function(e,t,a,s){return new y({element:e,key:t,args:a,property:s}).element}}(Oe||(Oe={}));const Ge=Oe;Oe.i18n,Oe.i18n_,Oe._i18n,d.GO.I18n=Oe;const He=["January","February","March","April","May","June","July","August","September","October","November","December"],We=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ze=e=>{const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),a=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-a);const s=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-s.getTime())/86400+1)/7)};d.GO&&(d.GO.formatDateAccordingToTodayNew=function(e){const t=new Date,a=t.getTime()/1e3|0,s=e.getTime()/1e3|0,n={};return a-s<86400&&t.getDate()===e.getDate()?n.hour=n.minute="2-digit":t.getFullYear()!==e.getFullYear()?(n.year=n.day="numeric",n.month="2-digit"):a-s<604800&&ze(t)===ze(e)?n.weekday="short":(n.month="short",n.day="numeric"),new Ge.IntlDateElement({date:e,options:n}).element});const Ke=2013,Je=new RegExp("20[0-9]{1,2}"),$e=new RegExp("(\\w{3,}) ([0-9]{0,4})","i"),Qe=new RegExp("([0-9]{0,4}) (\\w{2,})","i"),Ye=new RegExp("^([0-9]{1,4})(\\.| |/|\\-)([0-9]{1,4})$","i"),Xe=new RegExp("^([0-9]{1,2})(\\.| |/|\\-)([0-9]{1,2})(\\.| |/|\\-)([0-9]{1,4})$","i"),et=[31,29,31,30,31,30,31,31,30,31,30,31];function tt(e,t,a){const s=(new Date).getFullYear(),n=Date.now();if(a>=Ke&&a<=s){const s=new Date;s.setFullYear(a,t,1),s.setHours(0,0,0);const i=s.getTime();if(i>n)return;s.setMonth(s.getMonth()+1);const r=s.getTime()-1;e.push({title:st(i),minDate:i,maxDate:r})}}function at(e,t,a){if(ot(t,a)){const n=(new Date).getFullYear(),i=Date.now();for(let r=n;r>=Ke;r--){if(1===a&&28===t&&((s=r)%4!=0||s%100==0)&&s%400!=0)continue;const o=new Date;o.setFullYear(r,a,t+1),o.setHours(0,0,0);const p=o.getTime();if(p>i)continue;o.setFullYear(r,a,t+2),o.setHours(0,0,0);const d=o.getTime()-1;r===n?e.push({title:nt(p),minDate:p,maxDate:d}):e.push({title:it(p),minDate:p,maxDate:d})}}var s}function st(e){const t=new Date(e);return He[t.getMonth()].slice(0,3)+" "+t.getFullYear()}function nt(e){const t=new Date(e);return He[t.getMonth()].slice(0,3)+" "+t.getDate()}function it(e){const t=new Date(e);return("0"+t.getDate()).slice(-2)+"."+("0"+(t.getMonth()+1)).slice(-2)+"."+t.getFullYear()}function rt(e){const t=new Date(e);return We[t.getDay()]}function ot(e,t){return t>=0&&t<12&&e>=0&&e{t[e][s]=a})),a[e]=t[e])}d.GO.fillTipDates=function(e,t){const a=e.trim().toLowerCase();if(a.length<3)return;if(0==="today".indexOf(a)){const e=new Date,a=e.getFullYear(),s=e.getMonth(),n=e.getDate();e.setFullYear(a,s,n),e.setHours(0,0,0);const i=e.getTime();e.setFullYear(a,s,n+1),e.setHours(0,0,0);const r=e.getTime()-1;return void t.push({title:"Today",minDate:i,maxDate:r})}if(0==="yesterday".indexOf(a)){const e=new Date,a=e.getFullYear(),s=e.getMonth(),n=e.getDate();e.setFullYear(a,s,n),e.setHours(0,0,0);const i=e.getTime()-864e5;e.setFullYear(a,s,n+1),e.setHours(0,0,0);const r=e.getTime()-86400001;return void t.push({title:"Yesterday",minDate:i,maxDate:r})}const s=function(e){const t=new Date;if(e.length<=3)return-1;for(let a=0;a<7;a++)if(t.setDate(t.getDate()+1),0===rt(t.getTime()).toLowerCase().indexOf(e))return t.getDay();return-1}(a);if(s>=0){const e=new Date,a=e.getTime(),n=s-e.getDay();e.setDate(e.getDate()+n),e.getTime()>a&&e.setTime(e.getTime()-6048e5);const i=e.getFullYear(),r=e.getMonth(),o=e.getDate();e.setFullYear(i,r,o),e.setHours(0,0,0);const p=e.getTime();e.setFullYear(i,r,o+1),e.setHours(0,0,0);const d=e.getTime()-1;return void t.push({title:rt(p),minDate:p,maxDate:d})}let n;if(null===(n=Ye.exec(a)))if(null===(n=Xe.exec(a)))if(null===(n=Je.exec(a))){if(null!==(n=$e.exec(a))){const e=n[1],a=n[2],s=pt(e);if(s>=0){const e=+a;if(e>0&&e<=31)return void at(t,e-1,s);if(e>=Ke)return void tt(t,s,e)}}if(null!==(n=Qe.exec(a))){const e=n[1],a=pt(n[2]);if(a>=0){const s=+e;if(s>0&&s<=31)return void at(t,s-1,a);s>=Ke&&tt(t,a,s)}}}else{let e=+a;const s=(new Date).getFullYear();if(e=e;a--){const e=new Date;e.setFullYear(a,0,1),e.setHours(0,0,0);const s=e.getTime();e.setFullYear(a+1,0,1),e.setHours(0,0,0);const n=e.getTime()-1;t.push({title:""+a,minDate:s,maxDate:n})}}else if(e<=s){const a=new Date;a.setFullYear(e,0,1),a.setHours(0,0,0);const s=a.getTime();a.setFullYear(e+1,0,1),a.setHours(0,0,0);const n=a.getTime()-1;t.push({title:""+e,minDate:s,maxDate:n})}}else{const e=n[1],a=n[3],s=n[5];if(!n[2]===n[4])return;const i=parseInt(e),r=parseInt(a)-1;let o=parseInt(s);o>=10&&o<=99&&(o+=2e3);const p=(new Date).getFullYear();if(ot(i-1,r)&&o>=Ke&&o<=p){const e=new Date;e.setFullYear(o,r,i),e.setHours(0,0,0);const a=e.getTime();e.setFullYear(o,r,i+1),e.setHours(0,0,0);const s=e.getTime()-1;return void t.push({title:it(a),minDate:a,maxDate:s})}}else{const e=n[1],a=n[3],s=parseInt(e),i=parseInt(a);if(s>0&&s<=31){if(i>=Ke&&s<=12)return void tt(t,s-1,i);i<=12&&at(t,s-1,i-1)}else s>=Ke&&i<=12&&tt(t,i-1,s)}};var ft=a(2491),ct=a(7072),lt=a(8801),mt=a(6658);const gt={pdf:"application/pdf",tgv:"application/x-tgwallpattern",tgs:"application/x-tgsticker",json:"application/json",wav:"audio/wav",mp3:"audio/mpeg",ogg:"audio/ogg",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",mp4:"video/mp4",webm:"video/webm",mov:"video/quicktime",svg:"image/svg+xml"},ht={};for(const e in gt)ht[gt[e]]=e;let ut=0;class yt extends G{constructor(){super(...arguments),this.onServiceWorkerFail=()=>{for(const e in this.docs){const t=this.docs[e];t.supportsStreaming&&(delete t.supportsStreaming,this.thumbsStorage.deleteCacheContext(t))}}}after(){this.docs={},this.stickerCachedThumbs={},this.uploadingWallPapers={},f.Z.getInstance().addEventListener("serviceWorkerOnline",(e=>{e||this.onServiceWorkerFail()}))}saveDoc(e,t){if(!e||"documentEmpty"===e._)return;const a=this.docs[e.id];e.file_reference&&(dt("file_reference",a,e),this.referenceDatabase.saveContext(e.file_reference,t)),a||(this.docs[e.id]=e);for(let t=0,a=e.attributes.length;t"documentAttributeFilename"===e._)),a=t&&t.file_name.split(".").pop(),s=((e,t={})=>{const a=t.monthAsNumber?".":" ",s=("0"+e.getHours()).slice(-2)+":"+("0"+e.getMinutes()).slice(-2)+(t.noSeconds?"":":"+("0"+e.getSeconds()).slice(-2));return(t.leadingZero?("0"+e.getDate()).slice(-2):e.getDate())+a+(t.monthAsNumber?("0"+(e.getMonth()+1)).slice(-2):He[e.getMonth()])+a+e.getFullYear()+(t.noTime?"":", "+s)})(new Date(1e3*e.date),{monthAsNumber:!0,leadingZero:!0}).replace(/[:\.]/g,"-").replace(", ","_");e.file_name=`${e.type}_${s}${a?"."+a:""}`}return Ws()&&("gif"===e.type&&e.size>8e6||"audio"===e.type||"video"===e.type)?(e.supportsStreaming=!0,this.thumbsStorage.getCacheContext(e).url||this.thumbsStorage.setCacheContextURL(e,void 0,function(e,t=!1,a){let s;return s=t?"download":a?"thumb":e.supportsStreaming?"stream":"document",(0,lt.q)(s,(0,mt.Z)(e,a))}(e),0)):e.supportsStreaming=!1,e.file_name||(e.file_name=""),a?Object.assign(a,e):e}getDoc(e){return(0,fe.Z)(e)?e:this.docs[e]}downloadDoc(e,t,a){return this.apiFileManager.downloadMedia({media:e,queueId:t,onlyCache:a})}getLottieCachedThumb(e,t){const a=this.stickerCachedThumbs[e];return a&&a[t]}saveLottiePreview(e,t,a,s,n){var i,r,o;const p=this.getDoc(e);if(!p)return;const d=null!==(i=(r=this.stickerCachedThumbs)[o=p.id])&&void 0!==i?i:r[o]={},f=d[n];f&&f.w>=a&&f.h>=s||(d[n]={url:URL.createObjectURL(t),w:a,h:s})}saveWebPConvertedStrippedThumb(e,t){const a=this.getDoc(e);if(!a)return;const s=a.thumbs&&a.thumbs.find((e=>"photoStrippedSize"===e._));s&&(a.pFlags.stickerThumbConverted=!0,s.bytes=t)}prepareWallPaperUpload(e){const t="wallpaper-upload-"+ ++ut,a={_:"photoSize",h:0,w:0,location:{},size:e.size,type:o.Pt};let s={_:"document",access_hash:"",attributes:[],dc_id:0,file_reference:[],id:t,mime_type:e.type,size:e.size,date:(0,te.Z)(!0),pFlags:{},thumbs:[a],file_name:e.name};s=this.saveDoc(s);const n=this.thumbsStorage.setCacheContextURL(s,void 0,URL.createObjectURL(e),e.size),i={_:"wallPaper",access_hash:"",document:s,id:t,slug:t,pFlags:{}};return this.uploadingWallPapers[t]={cacheContext:n,file:e},i}uploadWallPaper(e){const{cacheContext:t,file:a}=this.uploadingWallPapers[e];return delete this.uploadingWallPapers[e],this.apiFileManager.upload({file:a,fileName:a.name}).then((e=>this.apiManager.invokeApi("account.uploadWallPaper",{file:e,mime_type:a.type,settings:{_:"wallPaperSettings",pFlags:{}}}).then((e=>((0,ue.Z)(e),e.document=this.saveDoc(e.document),this.thumbsStorage.setCacheContextURL(e.document,void 0,t.url,t.downloaded),e)))))}getGifs(){return this.apiManager.invokeApiHashable({method:"messages.getSavedGifs",processResult:e=>((0,ue.Z)(e),e.gifs.map((e=>this.saveDoc(e))))})}requestDocPart(e,t,a,s){const n=this.getDoc(e);return n?this.apiFileManager.requestFilePart(t,(0,ct.Z)(n),a,s):Promise.reject((0,X.Z)("NO_DOC"))}}var _t=a(6034);class vt extends G{constructor(){super(...arguments),this.drafts={}}after(){this.apiUpdatesManager.addMultipleEventsListeners({updateDraftMessage:e=>{const t=this.appPeersManager.getPeerId(e.peer);this.saveDraft({peerId:t,threadId:e.threadId,draft:e.draft,notify:!0})}}),h.Z.get("drafts").then((e=>{this.drafts=e||{}}))}getKey(e,t){return e+(t?"_"+t:"")}getDraft(e,t){return this.drafts[this.getKey(e,t)]}addMissedDialogs(){return this.getAllDrafts().then((()=>{for(const e in this.drafts){if(-1!==e.indexOf("_"))continue;const t=e.toPeerId();this.appMessagesManager.getDialogOnly(t)||this.appMessagesManager.reloadConversation(t)}}))}getAllDrafts(){var e;return null!==(e=this.getAllDraftPromise)&&void 0!==e?e:this.getAllDraftPromise=this.apiManager.invokeApi("messages.getAllDrafts").then((e=>{(this.apiUpdatesManager.updatesState.syncLoading||Promise.resolve()).then((()=>{this.apiUpdatesManager.processUpdateMessage(e)}))}))}saveDraft({peerId:e,threadId:t,draft:a,notify:s,force:n}){const i=this.processApiDraft(a),r=this.getKey(e,t);return i?this.drafts[r]=i:delete this.drafts[r],h.Z.set({drafts:this.drafts}),s&&this.rootScope.dispatchEvent("draft_updated",{peerId:e,threadId:t,draft:i,force:n}),i}isEmptyDraft(e){return"draftMessage"!==(null==e?void 0:e._)||!(void 0!==e.reply_to_msg_id&&e.reply_to_msg_id>0)&&!e.message.length}processApiDraft(e){if(e&&"draftMessage"===e._)return e.reply_to_msg_id&&(e.reply_to_msg_id=(0,pe.Z)(e.reply_to_msg_id)),e}syncDraft(e,t,a,s=!0,n=!1){const i=this.getDraft(e,t);if((0,_t.Z)(i,a))return!0;const r={peer:this.appPeersManager.getInputPeerById(e),message:""};let o;if(this.isEmptyDraft(a))o={_:"draftMessageEmpty"};else{(0,ue.Z)(a);const e=a.message,t=a.entities;a.reply_to_msg_id&&(r.reply_to_msg_id=(0,oe.Z)(a.reply_to_msg_id)),(null==t?void 0:t.length)&&(r.entities=this.appMessagesManager.getInputEntities(t)),a.pFlags.no_webpage&&(r.no_webpage=a.pFlags.no_webpage),r.message=e}t&&(r.top_msg_id=(0,oe.Z)(t));const p=o||a;return p.date=(0,te.Z)(!0)+this.timeManager.getServerTimeOffset(),this.saveDraft({peerId:e,threadId:t,draft:p,notify:!0,force:n}),!s||this.apiManager.invokeApi("messages.saveDraft",r)}clearAllDrafts(){return this.apiManager.invokeApi("messages.clearAllDrafts").then((e=>{if(e)for(const e in this.drafts){const[t,a]=e.split("_");this.rootScope.dispatchEvent("draft_updated",{peerId:t.toPeerId(),threadId:a?+a:void 0,draft:void 0})}}))}clearDraft(e,t){const a={_:"draftMessageEmpty"};t?this.syncDraft(e,t,a,!1,!0):this.saveDraft({peerId:e,threadId:t,draft:a,notify:!0,force:!0})}setDraft(e,t,a,s){const n={_:"draftMessage",date:(0,te.Z)(!0),message:a,pFlags:{},entities:s};t?this.syncDraft(e,t,n,!1,!0):this.saveDraft({peerId:e,threadId:t,draft:n,notify:!0,force:!0})}}var Pt=a(946),bt=a(7746);const Mt={keywords:{},version:0,langCode:_.Z.langPackCode};class St extends G{constructor(){super(...arguments),this.keywordLangPacks={},this.indexedLangPacks={},this.getKeywordsPromises={},this.recent={},this.getRecentEmojisPromises={},this.getCustomEmojiDocumentPromises=new Map}getEmojiKeywords(e=_.Z.langPackCode){const t=this.getKeywordsPromises[e];if(t)return t;const a="emojiKeywords_"+e;return this.getKeywordsPromises[e]=h.Z.get(a).then((t=>((0,fe.Z)(t)||(t={}),(0,Pt.Z)(Mt,t),t.langCode=e,this.keywordLangPacks[e]=t,this.apiManager.invokeApi("messages.getEmojiKeywordsDifference",{lang_code:t.langCode,from_version:t.version}).then((e=>{t.version=e.version;const s=t.keywords,n=e.keywords;for(let e=0,t=n.length;et)))))}getBothEmojiKeywords(){const e=[this.getEmojiKeywords()];return this.networkerFactory.language!==_.Z.langPackCode&&e.push(this.getEmojiKeywords(this.networkerFactory.language)),this.recent.native||e.push(this.getRecentEmojis("native")),Promise.all(e)}indexEmojis(){this.index||(this.index=new ae.Z(void 0,2));for(const e in this.keywordLangPacks){if(this.indexedLangPacks[e])continue;const t=this.keywordLangPacks[e].keywords;for(const e in t){const a=t[e];this.index.indexObject(a,e)}this.indexedLangPacks[e]=!0}}searchEmojis(e){let t;if(this.indexEmojis(),(e=e.toLowerCase().replace(/_/g," ")).trim()){const a=this.index.search(e);t=Array.from(a).reduce(((e,t)=>e.concat(t)),[])}else t=this.recent.native.concat(St.POPULAR_EMOJI).slice(0,32);return t=Array.from(new Set(t)),t}getRecentEmojis(e){var t;const a=this.getRecentEmojisPromises;return null!==(t=a[e])&&void 0!==t?t:a[e]=this.appStateManager.getState().then((t=>{let a=[];if("native"===e){const{recentEmoji:e}=t;a=Array.isArray(e)&&e.length?e:St.POPULAR_EMOJI}else{const{recentCustomEmoji:e}=t;a=Array.isArray(e)&&e.length?e:[]}return this.recent[e]=a}))}pushRecentEmoji(e){const t=e.docId?"custom":"native";e.emoji=(0,bt.Z)(e.emoji),this.getRecentEmojis(t).then((a=>{const s=e.docId||e.emoji;(0,M.Z)(a,s),a.unshift(s),a.splice(32,a.length-32),this.appStateManager.pushToState("custom"===t?"recentCustomEmoji":"recentEmoji",a),this.rootScope.dispatchEvent("emoji_recent",e)}))}getCustomEmojiDocuments(e){return e.length?this.apiManager.invokeApi("messages.getCustomEmojiDocuments",{document_id:e}).then((e=>e.map((e=>this.appDocsManager.saveDoc(e,{type:"customEmoji",docId:e.id}))))):Promise.resolve([])}getCachedCustomEmojiDocuments(e){return e.map((e=>this.appDocsManager.getDoc(e)))}setDebouncedGetCustomEmojiDocuments(){!this.getCustomEmojiDocumentsPromise&&this.getCustomEmojiDocumentPromises.size&&(this.getCustomEmojiDocumentsPromise=(0,P.Z)(0).then((()=>{const e=[...this.getCustomEmojiDocumentPromises.keys()],t=[];do{const a=e.splice(0,100),s=this.getCustomEmojiDocuments(a).then((e=>{e.forEach(((e,t)=>{const s=a[t],n=this.getCustomEmojiDocumentPromises.get(s);this.getCustomEmojiDocumentPromises.delete(s),n.resolve(e)}))}));t.push(s)}while(e.length);return Promise.all(t)})).finally((()=>{this.getCustomEmojiDocumentsPromise=void 0,this.setDebouncedGetCustomEmojiDocuments()})))}getCustomEmojiDocument(e){let t=this.getCustomEmojiDocumentPromises.get(e);if(t)return t;return this.appDocsManager.getDoc(e)||(t=(0,v.Z)(),this.getCustomEmojiDocumentPromises.set(e,t),this.setDebouncedGetCustomEmojiDocuments(),t)}getCustomEmojis(){return this.appStickersManager.getEmojiStickers()}}St.POPULAR_EMOJI=["😂","😘","❤️","😍","😊","😁","👍","☺️","😔","😄","😭","💋","😒","😳","😜","🙈","😉","😃","😢","😝","😱","😡","😏","😞","😅","😚","🙊","😌","😀","😋","😆","👌","😐","😕"];var It=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};class Ct extends G{after(){this.log=(0,S.kg)("GROUP-CALLS"),this.groupCalls=new Map,this.participants=new Map,this.nextOffsets=new Map,this.apiUpdatesManager.addMultipleEventsListeners({updateGroupCall:e=>{this.saveGroupCall(e.call,e.chat_id)},updateGroupCallParticipants:e=>{this.saveGroupCall(e.call);const t=e.call.id;this.saveApiParticipants(t,e.participants)}}),this.rootScope.addEventListener("group_call_update",(e=>{"groupCallDiscarded"===e._&&this.participants.delete(e.id)}))}getCachedParticipants(e){let t=this.participants.get(e);return t||this.participants.set(e,t=new Map),t}prepareToSavingNextOffset(e){const t=this.nextOffsets,a=t.get(e);return{nextOffset:a,setNextOffset:s=>{t.get(e)===a&&t.set(e,s)}}}saveApiParticipant(e,t,a){const s=this.getCachedParticipants(e),n=(0,le.Z)(t.peer),i=s.get(n),r=t.pFlags.left;if(!i&&r)return;t.pFlags.muted||t.pFlags.can_self_unmute||(t.pFlags.can_self_unmute=!0),i?(re(i,t),t=i):s.set(n,t);const o=this.getGroupCall(e);if("groupCall"===(null==o?void 0:o._)){let e=!1;r?(--o.participants_count,e=!0):!t.pFlags.just_joined||i||t.pFlags.self||(++o.participants_count,e=!0),e&&this.rootScope.dispatchEvent("group_call_update",o)}r&&s.delete(n),this.rootScope.dispatchEvent("group_call_participant",{groupCallId:e,participant:t})}saveApiParticipants(e,t,a){t.saved||(t.saved=!0,t.forEach((t=>this.saveApiParticipant(e,t,a))))}editParticipant(e,t,a){return It(this,void 0,void 0,(function*(){this.saveApiParticipant(e,t);const s=t.pFlags.self?o.NM:(0,le.Z)(t.peer),n=yield this.apiManager.invokeApiSingle("phone.editGroupCallParticipant",{call:this.getGroupCallInput(e),participant:s===o.NM?this.appPeersManager.getInputPeerSelf():this.appPeersManager.getInputPeerById(s),muted:a.muted,volume:a.volume,raise_hand:a.raiseHand,video_paused:a.videoPaused,video_stopped:a.videoStopped,presentation_paused:a.presentationPaused});this.apiUpdatesManager.processUpdateMessage(n)}))}getGroupCall(e){return this.groupCalls.get(e)}getGroupCallFull(e,t){return It(this,void 0,void 0,(function*(){const a=this.getGroupCall(e);if(a&&"inputGroupCall"!==a._&&!t)return a;const s=this.getCachedParticipants(e).size?0:100;return this.apiManager.invokeApiSingleProcess({method:"phone.getGroupCall",params:{call:this.getGroupCallInput(e),limit:s},processResult:t=>{this.appUsersManager.saveApiUsers(t.users),this.appChatsManager.saveApiChats(t.chats),this.saveApiParticipants(e,t.participants,!0);const a=this.saveGroupCall(t.call);return s&&void 0===this.nextOffsets.get(e)&&this.nextOffsets.set(e,t.participants_next_offset),a}})}))}saveGroupCall(e,t){const a=this.groupCalls.get(e.id),s="inputGroupCall"!==e._&&(!a||"groupCallDiscarded"!==a._);return a?(s&&re(a,e),e=a):this.groupCalls.set(e.id,e),s&&this.rootScope.dispatchEvent("group_call_update",e),e}createGroupCall(e,t,a){return It(this,void 0,void 0,(function*(){const s=yield this.apiManager.invokeApi("phone.createGroupCall",{peer:this.appPeersManager.getInputPeerById(e.toPeerId(!0)),random_id:(0,Ee.d)(32),schedule_date:t,title:a});return this.apiUpdatesManager.processUpdateMessage(s),s.updates.find((e=>"updateGroupCall"===e._)).call}))}getGroupCallInput(e){const t=this.getGroupCall(e);return{_:"inputGroupCall",id:t.id,access_hash:t.access_hash}}getGroupCallParticipants(e){return It(this,void 0,void 0,(function*(){const{nextOffset:t,setNextOffset:a}=this.prepareToSavingNextOffset(e);return""!==t&&(yield this.apiManager.invokeApiSingleProcess({method:"phone.getGroupParticipants",params:{call:this.getGroupCallInput(e),ids:[],sources:[],offset:t||"",limit:100},processResult:t=>{const s=t.count===t.participants.length?"":t.next_offset;this.appChatsManager.saveApiChats(t.chats),this.appUsersManager.saveApiUsers(t.users),this.saveApiParticipants(e,t.participants),a(s)}})),{participants:this.getCachedParticipants(e),isEnd:""===this.nextOffsets.get(e)}}))}hangUp(e,t){const a=this.getGroupCallInput(e);let s;return s="boolean"==typeof t&&t?this.apiManager.invokeApi("phone.discardGroupCall",{call:a}):"number"==typeof t?this.apiManager.invokeApi("phone.leaveGroupCall",{call:a,source:t}):this.apiManager.invokeApi("phone.joinGroupCall",{call:a,join_as:this.appPeersManager.getInputPeerSelf(),muted:!0,video_stopped:!0,params:{_:"dataJSON",data:""}}),s.then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}))}joinGroupCall(e,t,a){return It(this,void 0,void 0,(function*(){const s=this.getGroupCallInput(e);let n;if("main"===a.type){const i={call:s,join_as:this.appPeersManager.getInputPeerSelf(),params:t,muted:a.isMuted,video_stopped:!a.joinVideo};n=this.apiManager.invokeApi("phone.joinGroupCall",i),this.log(`[api] joinGroupCall id=${e}`,i)}else{const a={call:s,params:t};n=this.apiManager.invokeApi("phone.joinGroupCallPresentation",a),this.log(`[api] joinGroupCallPresentation id=${e}`,a)}const i=yield n;return this.apiUpdatesManager.processUpdateMessage(i),i.updates.find((e=>"updateGroupCallConnection"===e._))}))}leaveGroupCallPresentation(e){return this.apiManager.invokeApi("phone.leaveGroupCallPresentation",{call:this.getGroupCallInput(e)}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}))}}function kt(e){return{_:"inputPhoto",id:e.id,access_hash:e.access_hash,file_reference:e.file_reference}}function wt(e){return{_:"inputMediaPhoto",id:kt(e),ttl_seconds:0,pFlags:{}}}var At=a(515);function Ut(e){return{_:"inputMediaDocument",id:{_:"inputDocument",id:e.id,access_hash:e.access_hash,file_reference:e.file_reference},ttl_seconds:0,pFlags:{}}}class Dt extends G{constructor(){super(...arguments),this.inlineResults={},this.setHash={}}getGeoInput(e){return"geoPoint"===e._?{_:"inputGeoPoint",lat:e.lat,long:e.long,accuracy_radius:e.accuracy_radius}:{_:"inputGeoPointEmpty"}}getInlineResults(e,t,a="",s="",n){return this.apiManager.invokeApi("messages.getInlineBotResults",{bot:this.appUsersManager.getUserInput(t),peer:this.appPeersManager.getInputPeerById(e),query:a,geo_point:n?this.getGeoInput(n):void 0,offset:s},{stopTime:-1,noErrorBox:!0}).then((e=>{const t=e.query_id;return e.results.forEach((e=>{"botInlineMediaResult"===e._&&(e.document&&(e.document=this.appDocsManager.saveDoc(e.document)),e.photo&&(e.photo=this.appPhotosManager.savePhoto(e.photo))),this.inlineResults[(0,At.Z)(t,e.id)]=e})),e}))}pushPopularBot(e){this.appUsersManager.getTopPeers("bots_inline").then((t=>{const a=e.toPeerId(),s=t.findIndex((e=>e.id===a));let n;n=-1!==s?t[s]:{id:a,rating:0},++n.rating,(0,ie.Z)(t,n,"rating"),this.appStateManager.setKeyValueToStorage("topPeersCache")}))}switchToPM(e,t,a){return this.setHash[t]={peerId:e,time:Date.now()},this.appMessagesManager.startBot(t,void 0,a)}checkSwitchReturn(e){return t=this,a=void 0,n=function*(){const t=this.appUsersManager.getUser(e);if(!t||!t.pFlags.bot||!t.bot_inline_placeholder)return;const a=this.setHash[e];return a&&(delete this.setHash[e],Date.now()-a.time<36e5)?a.peerId:void 0},new((s=void 0)||(s=Promise))((function(e,i){function r(e){try{p(n.next(e))}catch(e){i(e)}}function o(e){try{p(n.throw(e))}catch(e){i(e)}}function p(t){var a;t.done?e(t.value):(a=t.value,a instanceof s?a:new s((function(e){e(a)}))).then(r,o)}p((n=n.apply(t,a||[])).next())}));var t,a,s,n}switchInlineQuery(e,t,a,s){this.appDraftsManager.setDraft(e,t,"@"+this.appPeersManager.getPeerUsername(a.toPeerId())+" "+s)}callbackButtonClick(e,t,a){return this.apiManager.invokeApi("messages.getBotCallbackAnswer",{peer:this.appPeersManager.getInputPeerById(e),msg_id:(0,oe.Z)(t),data:a.data},{stopTime:-1,noErrorBox:!0})}sendInlineResult(e,t,a,s={}){const n=this.inlineResults[a];if(!n)return;this.pushPopularBot(t);const i=a.split("_"),r=i.shift(),o=i.join("_");if(s.viaBotId=t,s.queryId=r,s.resultId=o,n.send_message.reply_markup&&(s.replyMarkup=n.send_message.reply_markup),"botInlineMessageText"===n.send_message._)s.entities=n.send_message.entities,this.appMessagesManager.sendText(e,n.send_message.message,s);else{let t,a,i="";const r=n.send_message;switch(r._){case"botInlineMessageMediaAuto":if(i=r.message,"botInlineMediaResult"===n._){const{document:e,photo:a}=n;t=e?Ut(e):wt(a)}break;case"botInlineMessageMediaGeo":t={_:"inputMediaGeoPoint",geo_point:this.getGeoInput(r.geo)},s.geoPoint=r.geo;break;case"botInlineMessageMediaVenue":t={_:"inputMediaVenue",geo_point:this.getGeoInput(r.geo),title:r.title,address:r.address,provider:r.provider,venue_id:r.venue_id,venue_type:r.venue_type},s.geoPoint=r.geo;break;case"botInlineMessageMediaContact":t={_:"inputMediaContact",phone_number:r.phone_number,first_name:r.first_name,last_name:r.last_name,vcard:r.vcard};break;case"botInlineMessageMediaInvoice":a={_:"messageMediaInvoice",title:r.title,description:r.description,photo:r.photo,currency:r.currency,total_amount:r.total_amount,pFlags:{shipping_address_requested:r.pFlags.shipping_address_requested,test:r.pFlags.test},start_param:void 0}}!t&&a&&(t={_:"messageMediaPending",messageMedia:a}),this.appMessagesManager.sendOther(e,t,s)}}}var Et=a(7082);class Tt{constructor(){this.tempNum=0}generateTempMessageId(e){const t=++this.tempNum;return(0,pe.Z)(e)+(t&Et.o-1)}}var Ft=a(4421),Rt=a(3624),xt=a(7401);function Bt(e,t){if(e.length{let o=e.slice(s,r);const p=n++;o.length>t&&(Bt(o.slice(t),t).forEach((e=>{i[n++]=e})),o=o.slice(0,t)),s=r,a=0,i[p]=(i[p]||"")+o};let o=0;for(;;){let s=e.indexOf(" ",o);if(-1===s){o!==e.length-1&&r();break}s+=" ".length;const n=s-o;a+n>t&&r(a),o=s,a+=n}return i}var Vt=a(5701),Ot=a(7667),Lt=a(6241),Nt=a(6535),Zt=a(6566),jt=a(2202),qt=a(319);const Gt=new class{constructor(){this.tabs=new Map}start(){f.Z.getInstance().addEventListener("tabState",((e,t)=>{this.tabs.get(t).state=e}))}getTabs(){return[...this.tabs.values()].filter((e=>!!e.state))}addTab(e){const t={source:e,state:void 0};this.tabs.set(e,t)}deleteTab(e){this.tabs.delete(e)}};d.GO&&(d.GO.appTabsManager=Gt);const Ht=Gt;var Wt=a(2381),zt=a(13);function Kt(e){return{_:"inputDocument",id:e.id,access_hash:e.access_hash,file_reference:e.file_reference}}var Jt=a(5285),$t=a(5102);function Qt(e,t,a){a?e[t]=!0:delete e[t]}var Yt=a(4993),Xt=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};const ea=e=>{e()};class ta extends G{constructor(){super(...arguments),this.pendingByRandomId={},this.pendingByMessageId={},this.pendingAfterMsgs={},this.pendingTopMsgs={},this.tempFinalizeCallbacks={},this.sendSmthLazyLoadQueue=new Ft.Z(10),this.needSingleMessages=new Map,this.extendedMedia=new Map,this.maxSeenId=0,this.migratedFromTo={},this.migratedToFrom={},this.newDialogsToHandle=new Map,this.newUpdatesAfterReloadToHandle={},this.notificationsToHandle={},this.reloadConversationsPeers=new Map,this.log=(0,S.kg)("MESSAGES",S.v9.Error|S.v9.Debug|S.v9.Log|S.v9.Warn),this.groupedTempId=0,this.typings={},this.unreadMentions={},this.goToNextMentionPromises={},this.batchUpdates={},this.clear=e=>{this.middleware?this.middleware.clean():(this.middleware=(0,Rt.k)(),this.uploadFilePromises={}),this.messagesStorageByPeerId={},this.groupedMessagesStorage={},this.scheduledMessagesStorage={},this.historiesStorage={},this.threadsStorage={},this.searchesStorage={},this.pinnedMessages={},this.threadsServiceMessagesIdsStorage={},this.threadsToReplies={},this.dialogsStorage&&this.dialogsStorage.clear(e),this.filtersStorage&&this.filtersStorage.clear(e)},this.handleNewDialogs=()=>{let e=0;const t=new Map,a=a=>{var s;const{peerId:n}=a;this.dialogsStorage.pushDialog({dialog:a}),this.appPeersManager.isChannel(n)||(e=Math.max(e,a.top_message||0));let i=t.get(n);i||t.set(n,i={}),"forumTopic"===a._?(null!==(s=i.topics)&&void 0!==s?s:i.topics=new Map).set(a.id,a):i.dialog=a};for(const[e,t]of this.newDialogsToHandle){const s="dialog"in t,{dialog:n,topics:i}=t;s&&(n?this.dialogsStorage.getDialogOnly(e)&&a(n):this.reloadConversation(e.toPeerId())),i&&(null==i||i.forEach(((t,s)=>{t?this.dialogsStorage.getForumTopic(e,s)&&a(t):this.dialogsStorage.getForumTopicById(e,s)})))}0!==e&&this.incrementMaxSeenId(e),this.rootScope.dispatchEvent("dialogs_multiupdate",t),this.newDialogsToHandle.clear()},this.handleNotifications=()=>{T.Z.clearTimeout(this.notificationsHandlePromise),this.notificationsHandlePromise=void 0;for(const e in this.notificationsToHandle){const[t,a]=e.split("_"),s=this.notificationsToHandle[e];this.getNotifyPeerSettings(t.toPeerId(),a?+a:void 0).then((({muted:e,peerTypeNotifySettings:t})=>{const a=s.topMessage;e&&!a.pFlags.mentioned||!a.pFlags.unread||a.pFlags.unread&&this.notifyAboutMessage(a,{fwdCount:s.fwdCount,peerTypeNotifySettings:t})}))}this.notificationsToHandle={}},this.onUpdateMessageId=e=>{const t=e.random_id;if(!this.pendingByRandomId[t])return;const a=(0,pe.Z)(e.id);this.pendingByMessageId[a]=t},this.onUpdateNewMessage=e=>{var t,a,s,n;const i=e.message,r=this.getMessagePeer(i),p=this.getHistoryMessagesStorage(r),d="updateNewDiscussionMessage"===e._;this.saveMessages([i],{storage:this.createMessageStorage(r,"history")});const f=this.appPeersManager.isForum(r),c=this.getThreadKey(i),l=c?+c.split("_")[1]:void 0,m=this.dialogsStorage.getDialogOrTopic(r,d?l:void 0);if((!m||this.reloadConversationsPeers.has(r))&&!d){let t=!0;if(r.isAnyChat()&&(t=this.appChatsManager.isInChat(r.toChatId())),t)return void this.handleNewUpdateAfterReload(r,e)}if(l&&!d){const e=null===(t=this.threadsStorage[r])||void 0===t?void 0:t[l],a={_:"updateNewDiscussionMessage",message:i};this.appChatsManager.isForum(r.toChatId())&&!this.dialogsStorage.getForumTopic(r,l)?this.handleNewUpdateAfterReload(r,a,l):e&&this.onUpdateNewMessage(a)}if("messageService"===i._){const{action:e}=i;if("messageActionPaymentSent"===e._&&i.reply_to&&this.rootScope.dispatchEvent("payment_sent",{peerId:i.reply_to.reply_to_peer_id?this.appPeersManager.getPeerId(i.reply_to.reply_to_peer_id):i.peerId,mid:i.reply_to_mid,receiptMessage:i}),"messageActionTopicEdit"===e._&&!d){const t=this.dialogsStorage.getForumTopic(r,l);if(t){const a=(0,ve.Z)(t);void 0!==e.title&&(t.title=e.title),void 0!==e.closed&&Qt(t.pFlags,"closed",e.closed),void 0!==e.hidden&&Qt(t.pFlags,"hidden",e.hidden),void 0!==e.icon_emoji_id&&(t.icon_emoji_id=e.icon_emoji_id),this.scheduleHandleNewDialogs(r,t),this.dialogsStorage.processTopicUpdate(t,a)}else this.dialogsStorage.getForumTopicById(r,l)}}this.saveMessages([i],{storage:p}),this.checkPendingMessage(i);const g=this.getHistoryStorage(r,d?l:void 0);d||this.updateMessageRepliesIfNeeded(i);const h=e.ignoreExisting;if(g.history.findSlice(i.mid)){if(!h)return!1}else{const e=g.history.first;if(e.isEnd(se.D.Bottom)){let t=0;for(const a=e.length;te[t]);++t);e.splice(t,0,i.mid)}else g.history.unshift(i.mid);null!==g.count&&++g.count}(!g.maxId||i.mid>g.maxId)&&(g.maxId=i.mid),this.mergeReplyKeyboard(g,i)&&this.rootScope.dispatchEvent("history_reply_markup",{peerId:r});const u=i.fromId;if(u.isUser()&&!i.pFlags.out&&i.from_id){this.appUsersManager.forceUserOnline(u,i.date);const e={_:"sendMessageCancelAction"};let t;t=r.isUser()?{_:"updateUserTyping",action:e,user_id:u}:this.appPeersManager.isChannel(r)?{_:"updateChannelUserTyping",action:e,channel_id:r.toChatId(),from_id:this.appPeersManager.getOutputPeer(u),top_msg_id:l?(0,oe.Z)(l):void 0}:{_:"updateChatUserTyping",action:e,chat_id:r.toChatId(),from_id:this.appPeersManager.getOutputPeer(u)},this.apiUpdatesManager.processLocalUpdate(t)}this.handleNewMessage(i);const y="forumTopic"===(null==m?void 0:m._);if(d&&!y||!m)return;const _=!i.pFlags.out&&i.pFlags.unread;if(_&&i.mid>m.top_message){const e=this.dialogsStorage.prepareDialogUnreadCountModifying(m);++m.unread_count,i.pFlags.mentioned&&(++m.unread_mentions_count,this.modifyCachedMentions(r,i.mid,!0,y?l:void 0)),e()}if(i.mid>=m.top_message&&this.setDialogTopMessage(i,m),(!d&&!f||y)&&_){const e=c||r,t=null!==(a=(n=this.notificationsToHandle)[e])&&void 0!==a?a:n[e]={fwdCount:0,fromId:o.NM};t.fromId!==u&&(t.fromId=u,t.fwdCount=0),i.fwd_from&&++t.fwdCount,t.topMessage=i,null!==(s=this.notificationsHandlePromise)&&void 0!==s||(this.notificationsHandlePromise=T.Z.setTimeout(this.handleNotifications,0))}},this.onUpdateMessageReactions=e=>{const{peer:t,msg_id:a,reactions:s}=e,n=(0,pe.Z)(a),i=this.appPeersManager.getPeerId(t),r=this.getMessageByPeer(i,n);if("message"!==(null==r?void 0:r._))return;const o=null==s?void 0:s.recent_reactions;if((null==o?void 0:o.length)&&r.pFlags.out){const e=o[o.length-1],t=r.reactions,a=null==t?void 0:t.recent_reactions;this.appPeersManager.getPeerId(e.peer_id)===this.appPeersManager.peerId||a&&!(a.length<=o.length)||a&&(0,Y.Z)(e,a[a.length-1])||this.getNotifyPeerSettings(i).then((({muted:t,peerTypeNotifySettings:a})=>{a.show_previews&&this.notifyAboutMessage(r,{peerReaction:e,peerTypeNotifySettings:a})}))}const p=r.peerId+"_"+r.mid;this.pushBatchUpdate("messages_reactions",this.batchUpdateReactions,p,(()=>(0,ve.Z)(r.reactions))),r.reactions=s,e.local||this.setDialogToStateIfMessageIsTop(r)},this.onUpdateDialogUnreadMark=e=>{const t=this.appPeersManager.getPeerId(e.peer.peer),a=this.getDialogOnly(t);if(a){const s=this.dialogsStorage.prepareDialogUnreadCountModifying(a);e.pFlags.unread?a.pFlags.unread_mark=!0:delete a.pFlags.unread_mark,s(),this.dialogsStorage.setDialogToState(a),this.rootScope.dispatchEvent("dialogs_multiupdate",new Map([[t,{dialog:a}]]))}else this.scheduleHandleNewDialogs(t)},this.onUpdateEditMessage=e=>{var t,a;const s=e.message,n=this.getMessagePeer(s),i=(0,pe.Z)(s.id),r=this.getHistoryMessagesStorage(n);if(!r.has(i))return;const o=this.getMessageFromStorage(r,i);this.saveMessages([s],{storage:r});const p=this.getMessageFromStorage(r,i);this.handleEditedMessage(o,p,r);const d=this.getDialogOnly(n),f=(null==d?void 0:d.top_message)===i;if(s.clear_history)f&&this.rootScope.dispatchEvent("dialog_flush",{peerId:n,dialog:d});else{let e=!0;if("message"===(null==o?void 0:o._)&&!(0,Y.Z)(o.reactions,p.reactions)){const t=p.reactions;p.reactions=o.reactions,this.apiUpdatesManager.processLocalUpdate({_:"updateMessageReactions",peer:this.appPeersManager.getOutputPeer(n),msg_id:s.id,reactions:t}),e=!1}e&&this.rootScope.dispatchEvent("message_edit",{storageKey:r.key,peerId:n,mid:i,message:s}),f&&this.dialogsStorage.setDialogToState(d);const c=new Map,l=()=>{let e=c.get(n);return e||c.set(n,e={}),e};(f||s.grouped_id)&&d&&(l().dialog=d);const m=this.getThreadKey(s);if(m){const e=+m.split("_")[1],s=this.dialogsStorage.getForumTopic(n,e);s&&(null!==(t=(a=l()).topics)&&void 0!==t?t:a.topics=new Map).set(e,s)}c.size&&this.rootScope.dispatchEvent("dialogs_multiupdate",c)}},this.onUpdateReadHistory=e=>{const t=e.channel_id,a=(0,pe.Z)(e.max_id||e.read_max_id),s=(0,pe.Z)(e.top_msg_id),n=t?t.toPeerId(!0):this.appPeersManager.getPeerId(e.peer),i="updateReadHistoryOutbox"===e._||"updateReadChannelOutbox"===e._||"updateReadChannelDiscussionOutbox"===e._||void 0,r=!!t&&this.appChatsManager.isForum(t),o=this.getHistoryMessagesStorage(n),p=(0,xt.Z)(o,"desc"),d=s&&r?this.dialogsStorage.getForumTopic(n,s):this.getDialogOnly(n),f=e.still_unread_count;let c=0,l=0,m=!1;const g=this.getHistoryStorage(n,s);if(n.isUser()&&i&&this.appUsersManager.forceUserOnline(n.toUserId()),s){const e=this.threadsToReplies[n+"_"+s];if(e){const[t,a]=e.split("_");this.updateMessage(t.toPeerId(),+a,"replies_updated")}}const h=d&&this.dialogsStorage.prepareDialogUnreadCountModifying(d),u=this.getReadMaxIdIfUnread(n,s);for(let e=0,t=p.length;ea)continue;const g=o.get(t);if(g.pFlags.out!==i)continue;const h=(0,Yt.Z)(g,r);if(!s||h===s){if(!(g.pFlags.unread||u&&u=d.top_message||!u?e=0:c&&d.top_message>a&&(e=c),void 0!==e&&(d.unread_count=e),(l<0||!d.unread_count)&&(d.unread_mentions_count=0)}null==h||h(),this.dialogsStorage.processDialogForFilters(d),this.rootScope.dispatchEvent("dialog_unread",{peerId:n,dialog:d}),this.dialogsStorage.setDialogToState(d),m||void 0!==f||i||!d.unread_count||("forumTopic"===d._?this.dialogsStorage.getForumTopicById(n,s):this.reloadConversation(n))}if(m&&this.rootScope.dispatchEvent("messages_read"),!s&&t){const e=n+"_";for(const t in this.threadsToReplies)if(0===t.indexOf(e)){const[e,a]=this.threadsToReplies[t].split("_");this.rootScope.dispatchEvent("replies_updated",this.getMessageByPeer(e.toPeerId(),+a))}}},this.onUpdateReadMessagesContents=e=>{const t=e.channel_id,a=e.top_msg_id,s=a?(0,pe.Z)(a):void 0,n=e.messages.map((e=>(0,pe.Z)(e))),i=t?t.toPeerId(!0):this.findPeerIdByMids(n);for(let e=0,t=n.length;e{const t=e.channel_id.toPeerId(!0),a=this.getHistoryStorage(t).history.slice,s=(0,pe.Z)(e.available_min_id),n=a.filter((e=>e<=s));e.messages=n,this.onUpdateDeleteMessages(e)},this.onUpdateDeleteMessages=e=>{var t;const a=e.channel_id,s=e.messages.map((e=>(0,pe.Z)(e))),n=a?a.toPeerId(!0):this.findPeerIdByMids(s);if(!n)return;this.apiManager.clearCache("messages.getSearchCounters",(e=>this.appPeersManager.getPeerId(e.peer)===n));const i=new Set,r=new Map;for(const e of s){const a=this.getMessageByPeer(n,e),s=this.getThreadKey(a);if(!s)continue;const o=+s.split("_")[1];if((null===(t=this.threadsStorage[n])||void 0===t?void 0:t[o])&&(i.add(s),!r.has(o))){const e=this.dialogsStorage.getForumTopic(n,o);e&&r.set(o,e)}}const o=this.handleDeletedMessages(n,this.getHistoryMessagesStorage(n),s),p=Array.from(i).map((e=>{const[t,a]=e.split("_");return this.getHistoryStorage(t.toPeerId(),+a)}));[this.getHistoryStorage(n),...p].forEach((e=>{for(const t of o.msgs)e.history.delete(t);o.count&&e.count&&(e.count=Math.max(0,e.count-o.count))})),this.rootScope.dispatchEvent("history_delete",{peerId:n,msgs:o.msgs});const d=[...r.values()],f=this.getDialogOnly(n);f&&d.unshift(f),d.forEach((e=>{const t="forumTopic"===e._,a=o.unreadMentions||o.unread,s=a&&this.dialogsStorage.prepareDialogUnreadCountModifying(e);if(o.unread&&(e.unread_count=Math.max(0,e.unread_count-o.unread)),o.unreadMentions&&(e.unread_mentions_count=e.unread_count?Math.max(0,e.unread_mentions_count-o.unreadMentions):0),a&&(s(),t||this.rootScope.dispatchEvent("dialog_unread",{peerId:n,dialog:e})),o.msgs.has(e.top_message)){const a=this.getHistoryStorage(e.peerId,t?e.id:void 0).history.first;if(a.isEnd(se.D.Bottom)&&a.length){const t=a[0],s=this.getMessageByPeer(n,t);this.setDialogTopMessage(s,e)}else t?this.dialogsStorage.getForumTopicById(n,e.id):this.reloadConversation(n)}}))},this.onUpdateChannel=e=>{const t=e.channel_id,a=t.toPeerId(!0),s=this.appChatsManager.getChat(t),n=this.appChatsManager.isInChat(t);(!!(0,$t.Z)(s)[0]||!s.pFlags.left)!=(void 0!==this.historiesStorage[a])&&(delete this.historiesStorage[a],this.rootScope.dispatchEvent("history_forbidden",a)),!!this.getDialogOnly(a)!==n&&(n?this.reloadConversation(a):this.dialogsStorage.dropDialogOnDeletion(a)),this.rootScope.dispatchEvent("channel_update",t)},this.onUpdateChannelReload=e=>{const t=e.channel_id.toPeerId(!0);this.flushStoragesByPeerId(t),Promise.all([this.reloadConversation(t)]).then((()=>{this.rootScope.dispatchEvent("history_reload",t)}))},this.onUpdateChannelMessageViews=e=>{var t;const a=e.views,s=null!==(t=e.peerId)&&void 0!==t?t:e.channel_id.toPeerId(!0),n=(0,pe.Z)(e.id),i=this.getMessageByPeer(s,n);void 0!==(null==i?void 0:i.views)&&i.views{var t;if(null===(t=e.pFlags)||void 0===t?void 0:t.popup)return void this.rootScope.dispatchEvent("service_notification",e);const a=o.yF,s=a,n=this.generateTempMessageId(s),i={_:"message",id:n,from_id:this.appPeersManager.getOutputPeer(a),peer_id:this.appPeersManager.getOutputPeer(s),pFlags:{unread:!0},date:(e.inbox_date||(0,te.Z)(!0))+this.timeManager.getServerTimeOffset(),message:e.message,media:e.media,entities:e.entities};this.appUsersManager.hasUser(a)||this.appUsersManager.saveApiUsers([{_:"user",id:a,pFlags:{verified:!0},access_hash:"0",first_name:"Telegram",phone:"42777"}]),this.saveMessages([i],{isOutgoing:!0}),e.inbox_date&&(this.pendingTopMsgs[s]=n,this.onUpdateNewMessage({_:"updateNewMessage",message:i,pts:void 0,pts_count:void 0}))},this.onUpdatePinnedMessages=e=>{const t="updatePinnedChannelMessages"===e._?e.channel_id:void 0,a=t?t.toPeerId(!0):this.appPeersManager.getPeerId(e.peer),s=e.messages.map((e=>(0,pe.Z)(e))),n=this.getHistoryMessagesStorage(a),i=s.filter((e=>!n.has(e)));(i.length?Promise.all(i.map((e=>this.reloadMessages(a,e)))):Promise.resolve()).finally((()=>{var t;const i=null===(t=e.pFlags)||void 0===t?void 0:t.pinned;if(i)for(const e of s)n.get(e).pFlags.pinned=!0;else for(const e of s)delete n.get(e).pFlags.pinned;delete this.pinnedMessages[this.getPinnedMessagesKey(a)],this.appStateManager.getState().then((e=>{delete e.hiddenPinnedMessages[a],this.rootScope.dispatchEvent("peer_pinned_messages",{peerId:a,mids:s,pinned:i})}))}))},this.onUpdateNotifySettings=e=>{const{peer:t,notify_settings:a}=e,s="notifyForumTopic"===t._;if("notifyPeer"!==t._&&!s)return;const n=this.appPeersManager.getPeerId(t.peer),i=this.dialogsStorage.getDialogOrTopic(n,s?(0,pe.Z)(t.top_msg_id):void 0);i&&(i.notify_settings=a,this.rootScope.dispatchEvent("dialog_notify_settings",i),this.dialogsStorage.setDialogToState(i))},this.onUpdateNewScheduledMessage=e=>{const t=e.message,a=this.getMessagePeer(t),s=this.scheduledMessagesStorage[a];if(!s)return;const n=(0,pe.Z)(t.id),i=this.getMessageFromStorage(s,n);this.saveMessages([t],{storage:s,isScheduled:!0});const r=this.getMessageFromStorage(s,n);i?(this.handleEditedMessage(i,r,s),this.rootScope.dispatchEvent("message_edit",{storageKey:s.key,peerId:a,mid:t.mid,message:t})):this.checkPendingMessage(t)||this.rootScope.dispatchEvent("scheduled_new",t)},this.onUpdateDeleteScheduledMessages=e=>{const t=this.appPeersManager.getPeerId(e.peer),a=this.scheduledMessagesStorage[t];if(a){const s=e.messages.map((e=>(0,pe.Z)(e)));this.handleDeletedMessages(t,a,s),this.rootScope.dispatchEvent("scheduled_delete",{peerId:t,mids:s})}},this.onUpdateMessageExtendedMedia=e=>{var t;const a=this.appPeersManager.getPeerId(e.peer),s=(0,pe.Z)(e.msg_id),n=this.getHistoryMessagesStorage(a);if(!n.has(s))return;const i=this.getMessageFromStorage(n,s),r=i.media;"messageExtendedMedia"!==(null===(t=r.extended_media)||void 0===t?void 0:t._)&&(r.extended_media=e.extended_media,this.onUpdateEditMessage({_:"updateEditMessage",message:i,pts:0,pts_count:0}))},this.onUpdateTranscribedAudio=e=>{const t=this.appPeersManager.getPeerId(e.peer),a=e.text,s=(0,pe.Z)(e.msg_id);this.rootScope.dispatchEvent("message_transcribed",{peerId:t,mid:s,text:a,pending:e.pFlags.pending})},this.batchUpdateViews=e=>{const t=[],a=this.getMessagesFromMap(e);for(const[e]of a)t.push({peerId:e.peerId,mid:e.mid,views:e.views});return t},this.batchUpdateReactions=e=>{var t,a,s;const n=[],i=this.getMessagesFromMap(e);for(const[e,r]of i){const i=null!==(a=null===(t=e.reactions)||void 0===t?void 0:t.results)&&void 0!==a?a:[],o=null!==(s=null==r?void 0:r.results)&&void 0!==s?s:[],p=i.filter((t=>{const a=o.find((e=>(0,Jt.Z)(e.reaction,t.reaction)));return e.pFlags.out&&(!a||t.count>a.count)||void 0!==t.chosen_order&&(!a||void 0===a.chosen_order)}));n.push({message:e,changedResults:p})}return n}}after(){return this.clear(!0),this.apiUpdatesManager.addMultipleEventsListeners({updateMessageID:this.onUpdateMessageId,updateNewDiscussionMessage:this.onUpdateNewMessage,updateNewMessage:this.onUpdateNewMessage,updateNewChannelMessage:this.onUpdateNewMessage,updateDialogUnreadMark:this.onUpdateDialogUnreadMark,updateEditMessage:this.onUpdateEditMessage,updateEditChannelMessage:this.onUpdateEditMessage,updateMessageReactions:this.onUpdateMessageReactions,updateReadChannelDiscussionInbox:this.onUpdateReadHistory,updateReadChannelDiscussionOutbox:this.onUpdateReadHistory,updateReadHistoryInbox:this.onUpdateReadHistory,updateReadHistoryOutbox:this.onUpdateReadHistory,updateReadChannelInbox:this.onUpdateReadHistory,updateReadChannelOutbox:this.onUpdateReadHistory,updateChannelReadMessagesContents:this.onUpdateReadMessagesContents,updateReadMessagesContents:this.onUpdateReadMessagesContents,updateChannelAvailableMessages:this.onUpdateChannelAvailableMessages,updateDeleteMessages:this.onUpdateDeleteMessages,updateDeleteChannelMessages:this.onUpdateDeleteMessages,updateChannel:this.onUpdateChannel,updateChannelReload:this.onUpdateChannelReload,updateChannelMessageViews:this.onUpdateChannelMessageViews,updateServiceNotification:this.onUpdateServiceNotification,updatePinnedMessages:this.onUpdatePinnedMessages,updatePinnedChannelMessages:this.onUpdatePinnedMessages,updateNotifySettings:this.onUpdateNotifySettings,updateNewScheduledMessage:this.onUpdateNewScheduledMessage,updateDeleteScheduledMessages:this.onUpdateDeleteScheduledMessages,updateMessageExtendedMedia:this.onUpdateMessageExtendedMedia,updateTranscribedAudio:this.onUpdateTranscribedAudio}),this.rootScope.addEventListener("notify_peer_type_settings",(({key:e,settings:t})=>{let a;a="notifyUsers"===e?e=>e.peerId.isUser():"notifyBroadcasts"===e?e=>this.appPeersManager.isBroadcast(e.peerId):e=>this.appPeersManager.isAnyGroup(e.peerId),this.dialogsStorage.getFolderDialogs(0).concat(this.dialogsStorage.getFolderDialogs(1)).filter(a).forEach((e=>{this.rootScope.dispatchEvent("dialog_notify_settings",e)}))})),this.rootScope.addEventListener("webpage_updated",(({id:e,msgs:t})=>{t.forEach((({peerId:t,mid:a,isScheduled:s})=>{const n=s?this.getScheduledMessagesStorage(t):this.getHistoryMessagesStorage(t),i=this.getMessageFromStorage(n,a);i&&(i.media={_:"messageMediaWebPage",webpage:this.appWebPagesManager.getCachedWebPage(e)},this.rootScope.dispatchEvent("message_edit",{storageKey:n.key,peerId:t,mid:a,message:i}))}))})),this.rootScope.addEventListener("draft_updated",(({peerId:e,threadId:t,draft:a})=>{const s=this.dialogsStorage.getDialogOrTopic(e,t);if(s){s.draft=a;let t=!1;a||(0,oe.Z)(s.top_message)?(this.dialogsStorage.generateIndexForDialog(s),this.dialogsStorage.pushDialog({dialog:s})):(this.dialogsStorage.dropDialog(e),t=!0),this.rootScope.dispatchEvent("dialog_draft",{peerId:e,dialog:s,drop:t,draft:a})}else if(t){const a=this.appChatsManager.getChat(e.toChatId());a?a.pFlags.forum&&this.dialogsStorage.getForumTopicById(e,t):this.reloadConversation(e)}else this.reloadConversation(e)})),this.rootScope.addEventListener("poll_update",(({poll:e})=>{const t=this.appPollsManager.pollToMessages[e.id];if(t)for(const e of t){const[t,a]=e.split("_"),s=this.getMessageByPeer(t.toPeerId(),+a);s&&this.setDialogToStateIfMessageIsTop(s)}})),this.rootScope.addEventListener("chat_toggle_forum",(({chatId:e,enabled:t})=>{const a=e.toPeerId(!0);if(!t){delete this.threadsStorage[a];for(const e in this.pinnedMessages)+e===a&&e.startsWith(a+"_")&&delete this.pinnedMessages[e]}})),this.batchUpdatesDebounced=(0,Vt.Z)((()=>{for(const e in this.batchUpdates){const t=this.batchUpdates[e];delete this.batchUpdates[e];const a=t.callback(t.batch);!a||a instanceof Array&&!a.length||rootScope.dispatchEvent(e,a)}}),33,!1,!0),this.appStateManager.getState().then((e=>{e.maxSeenMsgId&&(this.maxSeenId=e.maxSeenMsgId)}))}getInputEntities(e){const t=(0,ve.Z)(e);return t.forEach((e=>{"messageEntityMentionName"===e._&&(e._="inputMessageEntityMentionName",e.user_id=this.appUsersManager.getUserInput(e.user_id))})),t}invokeAfterMessageIsSent(e,t,a){var s,n,i;const r=null!==(s=(i=this.tempFinalizeCallbacks)[e])&&void 0!==s?s:i[e]={},o=null!==(n=r[t])&&void 0!==n?n:r[t]={deferred:(0,v.Z)()};return o.callback=a,o.deferred}editMessage(e,t,a={}){const{mid:s,peerId:n}=e;if(e.pFlags.is_outgoing)return this.invokeAfterMessageIsSent(s,"edit",(e=>this.editMessage(e,t,a)));const i=a.entities||[];t&&(t=(0,we.Z)(t,i));const r=a.scheduleDate||(e.pFlags.is_scheduled?e.date:void 0);return this.apiManager.invokeApi("messages.editMessage",{peer:this.appPeersManager.getInputPeerById(n),id:e.id,message:t,media:a.newMedia,entities:i.length?this.getInputEntities(i):void 0,no_webpage:a.noWebPage,schedule_date:r}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}),(e=>{if(this.log.error("editMessage error:",e),!e||"MESSAGE_NOT_MODIFIED"!==e.type)return e&&"MESSAGE_EMPTY"===e.type&&(e.handled=!0),Promise.reject(e);e.handled=!0}))}transcribeAudio(e){return Xt(this,void 0,void 0,(function*(){const{id:t,peerId:a}=e,s=t=>{this.apiUpdatesManager.processLocalUpdate({_:"updateTranscribedAudio",msg_id:e.id,peer:this.appPeersManager.getOutputPeer(a),pFlags:t.pFlags,text:t.text,transcription_id:t.transcription_id})};return this.apiManager.invokeApiSingleProcess({method:"messages.transcribeAudio",params:{peer:this.appPeersManager.getInputPeerById(a),msg_id:t},processResult:e=>(s(e),e),processError:e=>{throw"TRANSCRIPTION_FAILED"!==e.type&&"MSG_VOICE_MISSING"!==e.type||s({_:"messages.transcribedAudio",transcription_id:0,text:"",pFlags:{}}),e}})}))}sendText(e,t,a={}){var s,n;return Xt(this,void 0,void 0,(function*(){if(!t.trim())return;null!==(s=a.entities)&&void 0!==s||(a.entities=[]),a.threadId&&!a.replyToMsgId&&(a.replyToMsgId=a.threadId);const i=(yield this.apiManager.getConfig()).message_length_max,r=Bt(t,i);t=r[0],r.length>1&&("webPage"!==(null===(n=a.webPage)||void 0===n?void 0:n._)||t.includes(a.webPage.url)||delete a.webPage),e=this.appPeersManager.getPeerMigratedTo(e)||e;const o=a.entities;a.viaBotId||(t=(0,we.Z)(t,o));let p=this.getInputEntities(o);p.length||(p=void 0);const d=this.generateOutgoingMessage(e,a);d.entities=o,d.message=t;const f=a.replyToMsgId?(0,oe.Z)(a.replyToMsgId):void 0,c=this.appPeersManager.isChannel(e);a.webPage&&(d.media={_:"messageMediaWebPage",webpage:a.webPage});const l=e=>{this.onMessagesSendError([d],e),this.rootScope.dispatchEvent("messages_pending")};d.send=()=>{l();const s={};this.pendingAfterMsgs[e]&&(s.afterMessageId=this.pendingAfterMsgs[e].messageId);const n=a.sendAsPeerId?this.appPeersManager.getInputPeerById(a.sendAsPeerId):void 0;let i;return i=a.viaBotId?this.apiManager.invokeApiAfter("messages.sendInlineBotResult",{peer:this.appPeersManager.getInputPeerById(e),random_id:d.random_id,reply_to_msg_id:f||void 0,query_id:a.queryId,id:a.resultId,clear_draft:a.clearDraft,send_as:n},s):this.apiManager.invokeApiAfter("messages.sendMessage",{no_webpage:a.noWebPage,peer:this.appPeersManager.getInputPeerById(e),message:t,random_id:d.random_id,reply_to_msg_id:f||void 0,entities:p,clear_draft:a.clearDraft,schedule_date:a.scheduleDate||void 0,silent:a.silent,send_as:n,update_stickersets_order:a.updateStickersetOrder},s),this.pendingAfterMsgs[e]=s,i.then((e=>{if("updateShortSentMessage"===e._){const t=d.promise;delete d.promise;const s=(0,ve.Z)(d);(0,ge.Z)(d,["promise"]),d.promise=t,s.date=e.date,s.id=e.id,s.media=e.media,s.entities=e.entities,this.wrapMessageEntities(s),e.pFlags.out&&(s.pFlags.out=!0),e={_:"updates",users:[],chats:[],seq:0,date:void 0,updates:[{_:"updateMessageID",random_id:d.random_id,id:s.id},{_:a.scheduleDate?"updateNewScheduledMessage":c?"updateNewChannelMessage":"updateNewMessage",message:s,pts:e.pts,pts_count:e.pts_count}]}}else e.updates&&e.updates.forEach((e=>{"updateDraftMessage"===e._&&(e.local=!0)}));this.apiUpdatesManager.processUpdateMessage(e),d.promise.resolve()}),(e=>{throw l(e),d.promise.reject(e),e})).finally((()=>{this.pendingAfterMsgs[e]===s&&delete this.pendingAfterMsgs[e]}))},this.beforeMessageSending(d,{isScheduled:!!a.scheduleDate||void 0,threadId:a.threadId,clearDraft:a.clearDraft,sequential:!0});const m=[d.promise];for(let t=1;t=0){r="audio",p="audio."+("ogg"===d.split("/")[1]?"ogg":"mp3"),P="sendMessageUploadAudioAction",t.isVoiceMessage&&(r="voice",s.pFlags.media_unread=!0);const e={_:"documentAttributeAudio",pFlags:{voice:t.isVoiceMessage||void 0},waveform:t.waveform,duration:t.duration||void 0};g.push(e)}else if(t.isMedia)if(h){r="photo",p="photo."+d.split("/")[1],P="sendMessageUploadPhotoAction";const e={_:"photoSize",w:t.width,h:t.height,type:o.Pt,location:null,size:a.size};y={_:"photo",id:""+s.id,sizes:[e],w:t.width,h:t.height},u&&y.sizes.unshift(u);const n=this.thumbsStorage.getCacheContext(y,e.type);n.downloaded=a.size,n.url=t.objectURL||"",y=this.appPhotosManager.savePhoto(y)}else if(i().VIDEO_MIME_TYPES_SUPPORTED.has(d)){r="video",p="video.mp4",P="sendMessageUploadVideoAction";const e={_:"documentAttributeVideo",pFlags:{round_message:t.isRoundMessage||void 0,supports_streaming:!0},duration:t.duration,w:t.width,h:t.height};g.push(e),t.noSound&&a.size>10240&&a.size<10485760&&g.push({_:"documentAttributeAnimated"})}else r="document",p="document."+d.split("/")[1],P="sendMessageUploadDocumentAction";else r="document",p="document."+d.split("/")[1],P="sendMessageUploadDocumentAction";if(g.push({_:"documentAttributeFilename",file_name:f||p}),-1!==["document","video","audio","voice"].indexOf(r)&&!c){const e=[];if(_={_:"document",id:""+s.id,duration:t.duration,attributes:g,w:t.width,h:t.height,thumbs:e,mime_type:d,size:a.size},t.objectURL){const e=this.thumbsStorage.getCacheContext(_);e.downloaded=a.size,e.url=t.objectURL}let n;if(h)g.push({_:"documentAttributeImageSize",w:t.width,h:t.height}),n={_:"photoSize",w:t.width,h:t.height,type:o.Pt,size:a.size};else if("video"===r&&t.thumb){n={_:"photoSize",w:t.thumb.size.width,h:t.thumb.size.height,type:"local-thumb",size:t.thumb.blob.size};const e=this.thumbsStorage.getCacheContext(_,n.type);e.downloaded=n.size,e.url=t.thumb.url}n&&e.push(n),u&&e.unshift(u),_=this.appDocsManager.saveDoc(_)}this.log("sendFile",r,p,a.type,t);const b=(0,v.Z)(),M=c?void 0:{_:y?"messageMediaPhoto":"messageMediaDocument",pFlags:{},photo:y,document:_};M&&((0,ge.Z)(M,["promise"]),M.promise=b,t.spoiler&&(M.pFlags.spoiler=!0)),s.entities=m,s.message=l,s.media=c?{_:"messageMediaDocument",pFlags:{},document:a}:M;const S=c?void 0:(0,jt.Z)(a);s.uploadingFileName=S,S&&(this.uploadFilePromises[S]=b);const I=e=>{this.onMessagesSendError([s],e),this.rootScope.dispatchEvent("messages_pending")};let C=!1,k=null;s.send=()=>{if(c){const e={_:"inputMediaDocument",id:Kt(a),pFlags:{}};b.resolve(e)}else if(a instanceof File||a instanceof Blob){const n=()=>{var n;let i;return C&&!s.error||(C=!1,k=this.apiFileManager.upload({file:a,fileName:S}),k.catch((a=>{C||(this.log("cancelling upload",M),this.cancelPendingMessage(s.random_id),this.setTyping(e,{_:"sendMessageCancelAction"},void 0,t.threadId),b.reject(a))})),k.addNotifyListener((a=>{const s=Math.max(1,Math.floor(100*a.done/a.total));P&&this.setTyping(e,{_:P,progress:0|s},void 0,t.threadId),b.notifyAll(a)})),b.notifyAll({done:0,total:a.size})),"video"===r&&t.objectURL&&(null===(n=t.thumb)||void 0===n?void 0:n.blob)&&(i=this.apiFileManager.upload({file:t.thumb.blob})),k&&k.then((e=>Xt(this,void 0,void 0,(function*(){let a;if(e.name=p,C=!0,a="photo"===r?{_:"inputMediaUploadedPhoto",file:e,pFlags:{spoiler:t.spoiler||void 0}}:{_:"inputMediaUploadedDocument",file:e,mime_type:d,pFlags:{force_file:"sendMessageUploadDocumentAction"===P||void 0,spoiler:t.spoiler||void 0},attributes:g},i)try{const e=yield i;a.thumb=e}catch(e){this.log.error("sendFile thumb upload error:",e)}b.resolve(a)}))),(e=>{throw I(e),e})),b};t.isGroupedItem?n():this.sendSmthLazyLoadQueue.push({load:n})}return b},this.beforeMessageSending(s,{isGroupedItem:t.isGroupedItem,isScheduled:!!t.scheduleDate||void 0,threadId:t.threadId,clearDraft:t.clearDraft,processAfter:t.processAfter}),t.isGroupedItem||(b.then((a=>(this.setTyping(e,{_:"sendMessageCancelAction"},void 0,t.threadId),this.apiManager.invokeApi("messages.sendMedia",{background:t.background,peer:this.appPeersManager.getInputPeerById(e),media:a,message:l,random_id:s.random_id,reply_to_msg_id:n,schedule_date:t.scheduleDate,silent:t.silent,entities:m,clear_draft:t.clearDraft,send_as:t.sendAsPeerId?this.appPeersManager.getInputPeerById(t.sendAsPeerId):void 0,update_stickersets_order:t.updateStickersetOrder}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}),(e=>{if("photo"===r&&400===e.code&&("PHOTO_INVALID_DIMENSIONS"===e.type||"PHOTO_SAVE_FILE_INVALID"===e.type))return e.handled=!0,r="document",void s.send();throw I(e),e}))))),b.then(s.promise.resolve,s.promise.reject));const w={message:s};return(0,ge.Z)(w,["promise"]),w.promise=b,w}sendAlbum(e,t){return Xt(this,void 0,void 0,(function*(){if(t.threadId&&!t.replyToMsgId&&(t.replyToMsgId=t.threadId),1===t.sendFileDetails.length)return this.sendFile(e,Object.assign(Object.assign({},t),t.sendFileDetails[0]));e=this.appPeersManager.getPeerMigratedTo(e)||e;const a=t.replyToMsgId?(0,oe.Z)(t.replyToMsgId):void 0;let s=t.caption||"",n=t.entities||[];s&&(s=(0,we.Z)(s,n)),this.log("sendAlbum",t);const i=""+ ++this.groupedTempId,r=[],o=e=>{r.push(e)},p=t.sendFileDetails.map(((r,p)=>{const d=Object.assign({isGroupedItem:!0,isMedia:t.isMedia,scheduleDate:t.scheduleDate,silent:t.silent,replyToMsgId:a,threadId:t.threadId,sendAsPeerId:t.sendAsPeerId,groupId:i,processAfter:o},r);return 0===p&&(d.caption=s,d.entities=n),this.sendFile(e,d).message}));t.clearDraft&&r.push((()=>{this.appDraftsManager.clearDraft(e,t.threadId)})),r.forEach((e=>{e()}));const d=(e,t)=>{this.onMessagesSendError([e],t),this.rootScope.dispatchEvent("messages_pending")},f=this.appPeersManager.getInputPeerById(e),c=s=>{this.setTyping(e,{_:"sendMessageCancelAction"},void 0,t.threadId);const n=(0,v.Z)();return this.sendSmthLazyLoadQueue.push({load:()=>this.apiManager.invokeApi("messages.sendMultiMedia",{peer:f,multi_media:s,reply_to_msg_id:a,schedule_date:t.scheduleDate,silent:t.silent,clear_draft:t.clearDraft,send_as:t.sendAsPeerId?this.appPeersManager.getInputPeerById(t.sendAsPeerId):void 0,update_stickersets_order:t.updateStickersetOrder}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e),n.resolve()}),(e=>{p.forEach((t=>d(t,e))),n.reject(e)}))}),n},l=p.map((e=>e.send().then((e=>Promise.all([e,this.apiManager.invokeApi("messages.uploadMedia",{peer:f,media:e})]))).then((([t,a])=>{let i;if("messageMediaPhoto"===a._){const e=this.appPhotosManager.savePhoto(a.photo);i=wt(e)}else if("messageMediaDocument"===a._){const e=this.appDocsManager.saveDoc(a.document);i=Ut(e)}["pFlags","ttl_seconds"].forEach((e=>{var a;i[e]=null!==(a=t[e])&&void 0!==a?a:i[e]}));const r={_:"inputSingleMedia",media:i,random_id:e.random_id,message:s,entities:n};return s&&(s="",n=[]),r})).catch((t=>{throw this.log.error("sendAlbum upload item error:",t,e),d(e,t),t}))));return Promise.all(l).then((e=>c(e.filter(Boolean))))}))}sendContact(e,t){return this.sendOther(e,this.appUsersManager.getContactMediaInput(t))}sendOther(e,t,a={}){var s;e=this.appPeersManager.getPeerMigratedTo(e)||e;const n=this.generateOutgoingMessage(e,a),i=a.replyToMsgId?(0,oe.Z)(a.replyToMsgId):void 0;let r;switch(t._){case"inputMediaPoll":{const e=""+n.id;t.poll.id=e,this.appPollsManager.savePoll(t.poll,{_:"pollResults",flags:4,total_voters:0,pFlags:{},recent_voters:[]});const{poll:a,results:s}=this.appPollsManager.getPoll(e);r={_:"messageMediaPoll",poll:a,results:s};break}case"inputMediaPhoto":r={_:"messageMediaPhoto",photo:this.appPhotosManager.getPhoto(t.id.id),pFlags:{}};break;case"inputMediaDocument":r={_:"messageMediaDocument",document:this.appDocsManager.getDoc(t.id.id),pFlags:{}};break;case"inputMediaContact":r={_:"messageMediaContact",phone_number:t.phone_number,first_name:t.first_name,last_name:t.last_name,user_id:null!==(s=t.user_id)&&void 0!==s?s:"0",vcard:t.vcard};break;case"inputMediaGeoPoint":r={_:"messageMediaGeo",geo:a.geoPoint};break;case"inputMediaVenue":r={_:"messageMediaVenue",geo:a.geoPoint,title:t.title,address:t.address,provider:t.provider,venue_id:t.venue_id,venue_type:t.venue_type};break;case"messageMediaPending":r=t.messageMedia}n.media=r;const o=e=>{this.onMessagesSendError([n],e),this.rootScope.dispatchEvent("messages_pending")};return n.send=()=>{const s={};this.pendingAfterMsgs[e]&&(s.afterMessageId=this.pendingAfterMsgs[e].messageId);const r=a.sendAsPeerId?this.appPeersManager.getInputPeerById(a.sendAsPeerId):void 0;let p;return p=a.viaBotId?this.apiManager.invokeApiAfter("messages.sendInlineBotResult",{peer:this.appPeersManager.getInputPeerById(e),random_id:n.random_id,reply_to_msg_id:i||void 0,query_id:a.queryId,id:a.resultId,clear_draft:a.clearDraft,schedule_date:a.scheduleDate,silent:a.silent,send_as:r},s):this.apiManager.invokeApiAfter("messages.sendMedia",{peer:this.appPeersManager.getInputPeerById(e),media:t,random_id:n.random_id,reply_to_msg_id:i||void 0,message:"",clear_draft:a.clearDraft,schedule_date:a.scheduleDate,silent:a.silent,send_as:r,update_stickersets_order:a.updateStickersetOrder},s),this.pendingAfterMsgs[e]=s,p.then((e=>{e.updates&&e.updates.forEach((e=>{"updateDraftMessage"===e._&&(e.local=!0)})),this.apiUpdatesManager.processUpdateMessage(e)}),(e=>{throw o(e),e})).finally((()=>{this.pendingAfterMsgs[e]===s&&delete this.pendingAfterMsgs[e]}))},this.beforeMessageSending(n,{isScheduled:!!a.scheduleDate||void 0,threadId:a.threadId,clearDraft:a.clearDraft,sequential:!0}),n.promise}beforeMessageSending(e,t={}){const a=e.id,s=this.getMessagePeer(e),n=t.isScheduled?this.getScheduledMessagesStorage(s):this.getHistoryMessagesStorage(s);e.storageKey=n.key;const i=[];if(t.isScheduled)this.saveMessages([e],{storage:n,isScheduled:!0,isOutgoing:!0}),i.push((()=>{this.rootScope.dispatchEvent("scheduled_new",e)}));else{const r=[this.getHistoryStorage(s),t.threadId?this.getHistoryStorage(s,t.threadId):void 0];for(const e of r)e&&e.history.unshift(a);if(this.saveMessages([e],{storage:n,isOutgoing:!0}),this.setDialogTopMessage(e),t.threadId){const a=this.dialogsStorage.getForumTopic(s,t.threadId);a&&this.setDialogTopMessage(e,a)}i.push((()=>{this.rootScope.dispatchEvent("history_append",{storageKey:n.key,message:e})}))}const r=this.pendingByRandomId[e.random_id]={peerId:s,tempId:a,threadId:t.threadId,storage:n,sequential:t.sequential};return this.pendingTopMsgs[s]=a,!t.isGroupedItem&&e.send&&i.push((()=>{t.clearDraft&&this.appDraftsManager.clearDraft(s,t.threadId),e.send()})),i.length&&(t.processAfter||ea)((()=>{for(const e of i)e()})),r}generateOutgoingMessage(e,t){let a;t.threadId&&!t.replyToMsgId&&(t.replyToMsgId=t.threadId);const s=this.appPeersManager.isBroadcast(e);if(s&&this.appPeersManager.getPeer(e).pFlags.signatures){const e=this.appUsersManager.getSelf();a=e.first_name+(e.last_name?" "+e.last_name:"")}const n={_:"message",id:this.generateTempMessageId(e),from_id:t.sendAsPeerId?this.appPeersManager.getOutputPeer(t.sendAsPeerId):this.generateFromId(e),peer_id:this.appPeersManager.getOutputPeer(e),post_author:a,pFlags:this.generateFlags(e),date:t.scheduleDate||(0,te.Z)(!0)+this.timeManager.getServerTimeOffset(),message:"",grouped_id:t.groupId,random_id:(0,Ee.a)(),reply_to:this.generateReplyHeader(e,t.replyToMsgId,t.threadId),via_bot_id:t.viaBotId,reply_markup:t.replyMarkup,replies:this.generateReplies(e),views:s&&1,pending:!0};return(0,ge.Z)(n,["send","promise"]),void 0===t.groupId&&(n.promise=(0,v.Z)()),n}generateReplyHeader(e,t,a){const s=this.appPeersManager.isForum(e);if(s&&!a){const s=this.getMessageByPeer(e,t);s&&(a=(0,Yt.Z)(s,!0))}const n={_:"messageReplyHeader",reply_to_msg_id:t||a,pFlags:{}};return a&&s&&o.Ox!==a&&(n.pFlags.forum_topic=!0),a&&n.reply_to_msg_id!==a&&(n.reply_to_top_id=a),n}generateReplies(e){let t;if(this.appPeersManager.isBroadcast(e)){const a=this.appProfileManager.getCachedFullChat(e.toChatId());(null==a?void 0:a.linked_chat_id)&&(t={_:"messageReplies",flags:1,pFlags:{comments:!0},channel_id:a.linked_chat_id,replies:0,replies_pts:0})}return t}generateFromId(e){return this.appPeersManager.isAnyChat(e)&&(this.appPeersManager.isBroadcast(e)||this.isAnonymousSending(e))?void 0:this.appPeersManager.getOutputPeer(this.appUsersManager.getSelf().id.toPeerId())}generateFlags(e){const t={};return e!==this.appUsersManager.getSelf().id&&(t.out=!0,this.appPeersManager.isChannel(e)||this.appUsersManager.isBot(e)||(t.unread=!0)),this.appPeersManager.isBroadcast(e)&&(t.post=!0),t}generateForwardHeader(e,t){const a=this.appUsersManager.getSelf().id.toPeerId(),s=t.fromId;if(s===a&&t.peerId===a&&!t.fwd_from)return;const n={_:"messageFwdHeader",flags:0,date:t.date,pFlags:{}};let i=!1;if(t.fwd_from)n.from_id=t.fwd_from.from_id,n.from_name=t.fwd_from.from_name,n.post_author=t.fwd_from.post_author;else{if(n.post_author=t.post_author,s.isUser()){const e=this.appProfileManager.getCachedFullUser(s.toUserId());(null==e?void 0:e.private_forward_name)&&(n.from_name=e.private_forward_name,i=!0)}i||(n.from_id=this.appPeersManager.getOutputPeer(s))}return this.appPeersManager.isBroadcast(t.peerId)&&(t.post_author&&(n.post_author=t.post_author),n.channel_post=t.id),e!==a||i||(n.saved_from_msg_id=t.id,n.saved_from_peer=this.appPeersManager.getOutputPeer(t.peerId)),n}generateFakeAvatarMessage(e,t){const a=Number.MAX_SAFE_INTEGER,s={_:"messageService",pFlags:{},action:{_:"messageActionChannelEditPhoto",photo:t},id:a,peer_id:this.appPeersManager.getOutputPeer(e),mid:a,peerId:e,date:t.date,fromId:e};return this.getHistoryMessagesStorage(e).set(a,s),s}getUploadPromise(e){return this.uploadFilePromises[e]}isAnonymousSending(e){var t,a;return!!e.isAnyChat()&&(null===(a=null===(t=this.appPeersManager.getPeer(e).admin_rights)||void 0===t?void 0:t.pFlags)||void 0===a?void 0:a.anonymous)}setDialogTopMessage(e,t=this.getDialogOnly(e.peerId)){t&&(t.top_message=e.mid,this.getHistoryStorage(e.peerId,"forumTopic"===t._?t.id:void 0).maxId=e.mid,this.dialogsStorage.generateIndexForDialog(t,!1,e),this.scheduleHandleNewDialogs(e.peerId,t))}cancelPendingMessage(e){const t=this.pendingByRandomId[e];if(t){const{peerId:a,tempId:s,storage:n}=t,i=this.getHistoryStorage(a);return this.apiUpdatesManager.processLocalUpdate({_:"updateDeleteMessages",messages:[s],pts:void 0,pts_count:void 0}),i.history.delete(s),delete this.pendingByRandomId[e],n.delete(s),!0}return!1}fillConversations(e){return Xt(this,void 0,void 0,(function*(){const t=this.middleware.get();for(;!this.dialogsStorage.isDialogsLoaded(e);){const a=yield this.getTopMessages({limit:100,folderId:e});if(!t()||a.isEnd)break}}))}getReadMaxIdIfUnread(e,t){var a,s,n;const i=this.getHistoryStorage(e,t);if(t&&!this.appChatsManager.isForum(e.toChatId())){const t=this.getHistoryStorage(e),n=Math.max(null!==(a=t.readMaxId)&&void 0!==a?a:0,i.readMaxId),r=this.getMessageByPeer(e,i.maxId);return!(null===(s=null==r?void 0:r.pFlags)||void 0===s?void 0:s.out)&&n{if(!n()||"messages.dialogsNotModified"===r._)return null;d.ZP&&this.log("messages.getDialogs result:",r),i||s||t===ye||this.dialogsStorage.resetPinnedOrder(t),i||s||this.appDraftsManager.addMissedDialogs(),this.appUsersManager.saveApiUsers(r.users),this.appChatsManager.saveApiChats(r.chats),this.saveMessages(r.messages);let p=!!s,c=!1;const l=new Map,m=t===ye?o.J$:t,g=!!i||t===ye,h=r.dialogs||r.topics;if((0,ne.Z)(h,(e=>{var t,s;if(e)if(i||null!==(t=(s=e).folder_id)&&void 0!==t||(s.folder_id=m),this.dialogsStorage.saveDialog({dialog:e,ignoreOffsetDate:!0,saveGlobalOffset:g}),void 0!==e.peerId)if(p||this.appPeersManager.isChannel(e.peerId||this.appPeersManager.getPeerId(e.peer))||(this.incrementMaxSeenId(e.top_message),p=!0),a&&(0,ce.Z)(e)>a&&(this.scheduleHandleNewDialogs(e.peerId,e),c=!0),i||(0,oe.Z)(e.read_inbox_max_id)||(0,oe.Z)(e.read_outbox_max_id)){if(e.top_message){const t=this.getMessageByPeer(e.peerId,e.top_message);t&&(this.setMessageUnreadByDialog(t,e),this.dialogsStorage.setDialogToState(e))}}else l.set(e.peerId,{dialog:e}),this.log.error("noIdsDialogs",e,f);else this.log.error("bugged dialog?",e)})),l.size){const e=[...l.keys()],t=e.map((e=>this.reloadConversation(e)));Promise.all(t).then((()=>{this.rootScope.dispatchEvent("dialogs_multiupdate",l);for(let t=0;t=u||!h.length;v&&this.dialogsStorage.setDialogsLoaded(t,!0),c?this.scheduleHandleNewDialogs():this.rootScope.dispatchEvent("dialogs_multiupdate",new Map);const P=h,b=100===e?P:P.slice(0,e);return{isEnd:v&&b[b.length-1]===P[P.length-1],count:u,dialogs:b}};let p,f;return p=i?this.apiManager.invokeApiSingleProcess({method:"channels.getForumTopics",params:f={channel:this.appChatsManager.getChannelInput(i.toChatId()),limit:100,offset_date:s,offset_id:0,offset_topic:0},options:{noErrorBox:!0},processResult:e=>(e=this.dialogsStorage.processTopics(i,e),r(e))}):this.apiManager.invokeApiSingleProcess({method:"messages.getDialogs",params:f={folder_id:t,offset_date:s,offset_id:0,offset_peer:this.appPeersManager.getInputPeerById(undefined),limit:100,hash:"0"},options:{noErrorBox:!0},processResult:r}),p}forwardMessages(e,t,a,s={}){return Xt(this,void 0,void 0,(function*(){delete s.replyToMsgId,delete s.threadId,e=this.appPeersManager.getPeerMigratedTo(e)||e;for(let n=0,i=(a=a.slice().sort(((e,t)=>e-t))).length;n{var i,p,d,f,c;const l=this.getMessageByPeer(t,n),m=this.generateOutgoingMessage(e,s);o.push(m.id);const g=["entities","media"];s.dropAuthor||(m.fwd_from=this.generateForwardHeader(e,l),g.push("views","forwards"),(null===(i=m.fwd_from)||void 0===i?void 0:i.from_name)&&e===this.appPeersManager.peerId&&delete m.from_id),s.dropCaptions&&l.media||g.push("message");const h=null===(p=l.reply_to)||void 0===p?void 0:p.reply_to_msg_id,u=a.indexOf(h);if(h&&-1!==u){const e=o[u];m.reply_to={_:"messageReplyHeader",reply_to_msg_id:e,pFlags:{}}}g.forEach((e=>{m[e]=(0,ve.Z)(l[e])}));const y=null===(d=m.media)||void 0===d?void 0:d.document;return y&&(["round","voice"].includes(y.type)&&(m.pFlags.media_unread=!0),y.sticker&&!this.rootScope.premium&&(0,zt.Z)(y)&&(m.media.pFlags.nopremium=!0)),l.grouped_id&&(null!==(f=r[c=l.grouped_id])&&void 0!==f?f:r[c]={tempId:""+ ++this.groupedTempId,messages:[]}).messages.push(m),m}));for(const e in r){const t=r[e];t.messages.length>1&&t.messages.forEach((e=>{e.grouped_id=t.tempId}))}p.forEach((e=>{this.beforeMessageSending(e,{isScheduled:!!s.scheduleDate||void 0,sequential:!0})}));const d={};this.pendingAfterMsgs[e]&&(d.afterMessageId=this.pendingAfterMsgs[e].messageId);const f=this.apiManager.invokeApiAfter("messages.forwardMessages",{from_peer:this.appPeersManager.getInputPeerById(t),id:a.map((e=>(0,oe.Z)(e))),random_id:p.map((e=>e.random_id)),to_peer:this.appPeersManager.getInputPeerById(e),with_my_score:s.withMyScore,silent:s.silent,schedule_date:s.scheduleDate,drop_author:s.dropAuthor,drop_media_captions:s.dropCaptions,send_as:s.sendAsPeerId?this.appPeersManager.getInputPeerById(s.sendAsPeerId):void 0},d).then((e=>{this.log("forwardMessages updates:",e),this.apiUpdatesManager.processUpdateMessage(e)}),(e=>{throw this.onMessagesSendError(p,e),e})).finally((()=>{this.pendingAfterMsgs[e]===d&&delete this.pendingAfterMsgs[e]}));this.pendingAfterMsgs[e]=d;const c=[f];return i.length&&c.push(this.forwardMessages(e,t,i,s)),Promise.all(c).then(qt.Z)}))}generateEmptyMessage(e){}onMessagesSendError(e,t){e.forEach((e=>{if(e.error!==t)if(t){e.error=t,this.rootScope.dispatchEvent("message_error",{storageKey:e.storageKey,tempId:e.mid,error:t});const a=this.getDialogOnly(e.peerId);a&&this.rootScope.dispatchEvent("dialog_unread",{peerId:e.peerId,dialog:a})}else delete e.error}))}getMessagesStorageByKey(e){const t=e.split("_"),a=+t[0];return"scheduled"===t[1]?this.getScheduledMessagesStorage(a):this.getHistoryMessagesStorage(a)}getMessageFromStorage(e,t){return"string"==typeof e&&(e=this.getMessagesStorageByKey(e)),e&&e.get(t)}createMessageStorage(e,t){const a=new Map;return a.peerId=e,a.type=t,a.key=`${e}_${t}`,a}getHistoryMessagesStorage(e){var t,a;return null!==(t=(a=this.messagesStorageByPeerId)[e])&&void 0!==t?t:a[e]=this.createMessageStorage(e,"history")}getMessagesStorage(e){return"object"==typeof e?e:this.getMessagesStorageByKey(e)}getMessageById(e){for(const t in this.messagesStorageByPeerId){if(this.appPeersManager.isChannel(t.toPeerId()))continue;const a=this.messagesStorageByPeerId[t].get(e);if(a)return a}return this.getMessageFromStorage(null,e)}getMessageByPeer(e,t){return e?this.getMessageFromStorage(this.getHistoryMessagesStorage(e),t):this.getMessageById(t)}getMessagePeer(e){return e.peer_id&&this.appPeersManager.getPeerId(e.peer_id)||o.NM}getDialogOnly(e){return this.dialogsStorage.getDialogOnly(e)}cantForwardDeleteMids(e,t){const a=this.getMessagesStorage(e);let s=!t.length,n=!t.length;for(const e of t){const t=this.getMessageFromStorage(a,e);if(s||(s=!this.canForward(t)),n||(n=!this.canDeleteMessage(t)),s&&n)break}return{cantForward:s,cantDelete:n}}reloadConversationOrTopic(e,t){t?this.dialogsStorage.getForumTopicById(e,t):this.reloadConversation(e)}reloadConversation(e){let t;if(void 0!==e){const a=this.appPeersManager.getPeerId(e);this.log.warn("reloadConversation",a);let s=this.reloadConversationsPeers.get(a);if(s&&(t=s.promise),t)return t;t=(0,v.Z)(),this.reloadConversationsPeers.set(a,s={inputDialogPeer:this.appPeersManager.getInputDialogPeerById(e),promise:t})}return this.reloadConversationsPromise||(this.reloadConversationsPromise=(0,P.Z)(0).then((()=>{const e=[],t={};for(const[a,{inputDialogPeer:s,promise:n}]of this.reloadConversationsPeers)e.push(s),t[a]=n;const a=()=>{for(const e in t)this.reloadConversationsPeers.delete(+e),t[e].resolve(void 0)};return(()=>Xt(this,void 0,void 0,(function*(){for(;;){const t=yield this.apiManager.invokeApi("messages.getPeerDialogs",{peers:e}),a=this.apiUpdatesManager.updatesState,{state:s}=t;if(!a.pts||a.pts===s.pts)return t;yield(0,P.Z)(500)}})))().then((e=>{for(const e in t)this.reloadConversationsPeers.delete(+e);this.dialogsStorage.applyDialogs(e),e.dialogs.forEach((e=>{const a=e.peerId;a&&(t[a].resolve(e),delete t[a])}))}),qt.Z).then((()=>{a(),this.reloadConversationsPromise=null,this.reloadConversationsPeers.size&&this.reloadConversation()}))}))),t||this.reloadConversationsPromise}doFlushHistory(e,t,a,s){let n;const i=n=>(this.apiUpdatesManager.processUpdateMessage({_:"updateShort",update:{_:"updatePts",pts:n.pts,pts_count:n.pts_count}}),!n.offset||this.doFlushHistory(e,t,a,s));return n=s?this.apiManager.invokeApiSingleProcess({method:"channels.deleteTopicHistory",params:{channel:this.appChatsManager.getChannelInput(e.toChatId()),top_msg_id:(0,oe.Z)(s)},processResult:i}):this.apiManager.invokeApiSingleProcess({method:"messages.deleteHistory",params:{just_clear:t,revoke:a,peer:this.appPeersManager.getInputPeerById(e),max_id:0},processResult:i}),n}flushHistory(e,t,a,s){return Xt(this,void 0,void 0,(function*(){if(this.appPeersManager.isChannel(e)&&!s){const t=this.getHistory(e,0,1),a=yield t,s=e.toChatId(),n=a.history[0]||0;return this.apiManager.invokeApiSingle("channels.deleteHistory",{channel:this.appChatsManager.getChannelInput(s),max_id:(0,oe.Z)(n)}).then((e=>(e&&this.apiUpdatesManager.processLocalUpdate({_:"updateChannelAvailableMessages",channel_id:s,available_min_id:n}),e)))}return this.doFlushHistory(e,t,a,s).then((()=>{if(s||this.flushStoragesByPeerId(e),t)this.rootScope.dispatchEvent("dialog_flush",{peerId:e,dialog:this.getDialogOnly(e)});else{const t=this.getTypingKey(e,s);if(delete this.notificationsToHandle[t],delete this.typings[t],!s){const t=this.reloadConversationsPeers.get(e);t&&(this.reloadConversationsPeers.delete(e),t.promise.resolve(void 0))}this.dialogsStorage.dropDialogOnDeletion(e,s)}}))}))}flushStoragesByPeerId(e){[this.historiesStorage,this.threadsStorage,this.searchesStorage,this.pendingAfterMsgs,this.pendingTopMsgs].forEach((t=>{delete t[e]}));for(const t in this.pinnedMessages)(+t===e||t.startsWith(e+"_"))&&delete this.pinnedMessages[t];const t=this.needSingleMessages.get(e);if(t){for(const[e,a]of t)a.resolve(this.generateEmptyMessage(e));t.clear()}[this.messagesStorageByPeerId,this.scheduledMessagesStorage].forEach((t=>{const a=t[e];a&&a.clear()})),this.dialogsStorage.flushForumTopicsCache(e)}hidePinnedMessages(e){return Promise.all([this.appStateManager.getState(),this.getPinnedMessage(e)]).then((([t,a])=>{t.hiddenPinnedMessages[e]=a.maxId,this.rootScope.dispatchEvent("peer_pinned_hidden",{peerId:e,maxId:a.maxId})}))}getPinnedMessagesKey(e,t){return e+(t?"_"+t:"")}getPinnedMessage(e,t){var a,s,n;const i=null!==(a=(s=this.pinnedMessages)[n=this.getPinnedMessagesKey(e,t)])&&void 0!==a?a:s[n]={};return i.promise?i.promise:i.maxId?Promise.resolve(i):i.promise=this.getSearch({peerId:e,inputFilter:{_:"inputMessagesFilterPinned"},maxId:0,limit:1,threadId:t}).then((e=>{var t;return i.count=e.count,i.maxId=null===(t=e.history[0])||void 0===t?void 0:t.mid,i})).finally((()=>{delete i.promise}))}getPinnedMessagesCount(e,t){var a;return null===(a=this.pinnedMessages[this.getPinnedMessagesKey(e,t)])||void 0===a?void 0:a.count}getPinnedMessagesMaxId(e,t){var a;return null===(a=this.pinnedMessages[this.getPinnedMessagesKey(e,t)])||void 0===a?void 0:a.maxId}updatePinnedMessage(e,t,a,s,n){return this.apiManager.invokeApi("messages.updatePinnedMessage",{peer:this.appPeersManager.getInputPeerById(e),unpin:a,silent:s,pm_oneside:n,id:(0,oe.Z)(t)}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}))}unpinAllMessages(e){return this.apiManager.invokeApiSingle("messages.unpinAllMessages",{peer:this.appPeersManager.getInputPeerById(e)}).then((t=>(this.apiUpdatesManager.processUpdateMessage({_:"updateShort",update:{_:"updatePts",pts:t.pts,pts_count:t.pts_count}}),t.offset?this.unpinAllMessages(e):(this.getHistoryMessagesStorage(e).forEach((e=>{e.pFlags.pinned&&delete e.pFlags.pinned})),this.rootScope.dispatchEvent("peer_pinned_messages",{peerId:e,unpinAll:!0}),delete this.pinnedMessages[this.getPinnedMessagesKey(e)],!0))))}getAlbumText(e){const t=this.groupedMessagesStorage[e];return(0,Wt.Z)(Array.from(t.values()))}getGroupsFirstMessage(e){if(!(null==e?void 0:e.grouped_id))return e;const t=this.groupedMessagesStorage[e.grouped_id];let a=Number.MAX_SAFE_INTEGER;for(const[e,s]of t)s.midthis.getMessageFromStorage(a,e)))}getMidsByMessage(e){return e?e.grouped_id?this.getMidsByAlbum(e.grouped_id):[e.mid]:[]}filterMessages(e,t){const a=[];if(e.grouped_id){const s=this.groupedMessagesStorage[e.grouped_id];for(const[e,n]of s)t(n)&&a.push(n)}else t(e)&&a.push(e);return a}generateTempMessageId(e){const t=this.getDialogOnly(e);return this.appMessagesIdsManager.generateTempMessageId((null==t?void 0:t.top_message)||0)}setMessageUnreadByDialog(e,t=this.getDialogOnly(e.peerId)){t&&e.mid&&e.mid>t[e.pFlags.out?"read_outbox_max_id":"read_inbox_max_id"]&&(e.pFlags.unread=!0)}saveMessage(e,t={}){var a,s,n,i,r;if(!e||"messageEmpty"===e._)return;null!==(a=e.pFlags)&&void 0!==a||(e.pFlags={});const p=this.getMessagePeer(e),d=t.storage||this.getHistoryMessagesStorage(p),f="peerChannel"===e.peer_id._,c=f&&this.appChatsManager.isBroadcast(p.toChatId()),l="message"===e._;t.isOutgoing&&(e.pFlags.is_outgoing=!0);const m=(0,pe.Z)(e.id);e.mid=m,l&&(t.isScheduled&&(e.pFlags.is_scheduled=!0),e.grouped_id&&(null!==(s=(i=this.groupedMessagesStorage)[r=e.grouped_id])&&void 0!==s?s:i[r]=this.createMessageStorage(p,"grouped")).set(m,e),e.via_bot_id&&(e.viaBotId=e.via_bot_id));const g=e.reply_to;g&&(g.reply_to_msg_id&&(g.reply_to_msg_id=e.reply_to_mid=(0,pe.Z)(g.reply_to_msg_id)),g.reply_to_top_id&&(g.reply_to_top_id=(0,pe.Z)(g.reply_to_top_id)));const h=l&&e.replies;h&&(h.max_id&&(h.max_id=(0,pe.Z)(h.max_id)),h.read_max_id&&(h.read_max_id=(0,pe.Z)(h.read_max_id)));const u=!!p;u||(e.date-=this.timeManager.getServerTimeOffset());const y=this.appPeersManager.peerId,_=l&&e.fwd_from;if(e.peerId=p,e.fromId=p===y?_?_.from_id?this.appPeersManager.getPeerId(_.from_id):o.NM:y:e.pFlags.post||!e.from_id?p:this.appPeersManager.getPeerId(e.from_id),this.setMessageUnreadByDialog(e),_){_.saved_from_msg_id&&(_.saved_from_msg_id=(0,pe.Z)(_.saved_from_msg_id)),_.channel_post&&(_.channel_post=(0,pe.Z)(_.channel_post));const t=_.saved_from_peer||_.from_id,a=_.saved_from_msg_id||_.channel_post;if(t&&a){const s=this.appPeersManager.getPeerId(t),n=(0,pe.Z)(a);e.savedFrom=s+"_"+n}e.fwdFromId=this.appPeersManager.getPeerId(_.from_id),u||(_.date-=this.timeManager.getServerTimeOffset())}const v={type:"message",peerId:p,messageId:m};let P=!1;const b=l&&e.media;if(b)switch(b._){case"messageMediaEmpty":delete e.media;break;case"messageMediaPhoto":b.ttl_seconds?P=!0:b.photo=this.appPhotosManager.savePhoto(b.photo,v),b.photo||delete e.media;break;case"messageMediaPoll":{const t=this.appPollsManager.savePoll(b.poll,b.results,e);b.poll=t.poll,b.results=t.results;break}case"messageMediaDocument":if(b.ttl_seconds)P=!0;else{const e=b.document;b.document=this.appDocsManager.saveDoc(e,v),b.document||"documentEmpty"===e._||(P=!0)}break;case"messageMediaWebPage":{const a=this.appWebPagesManager.getMessageKeyForPendingWebPage(p,m,t.isScheduled);b.webpage=this.appWebPagesManager.saveWebPage(b.webpage,a,v),b.webpage||delete e.media;break}case"messageMediaInvoice":{b.photo=this.appWebDocsManager.saveWebDocument(b.photo);const e=b.extended_media;if("messageExtendedMedia"===(null==e?void 0:e._)){const t=e.media;t.photo=this.appPhotosManager.savePhoto(t.photo,v),t.document=this.appDocsManager.saveDoc(t.document,v)}break}case"messageMediaUnsupported":P=!0}if(l&&P&&(e.media={_:"messageMediaUnsupported"},e.message="",delete e.entities,delete e.totalEntities),!l&&e.action){const t=e.action,a=e.fromId===this.appUsersManager.getSelf().id?"You":"";let s,i;switch(t.photo&&(t.photo=this.appPhotosManager.savePhoto(t.photo,v)),t.document&&(t.document=this.appDocsManager.saveDoc(t.photo,v)),t._){case"messageActionChatEditPhoto":(null===(n=t.photo)||void 0===n?void 0:n.video_sizes)?t._=c?"messageActionChannelEditVideo":"messageActionChatEditVideo":c&&(t._="messageActionChannelEditPhoto");break;case"messageActionGroupCall":{let e;this.appGroupCallsManager.saveGroupCall(t.call),e=void 0===t.duration?"started":"ended",c||(e+="_by"+a),t.type=e;break}case"messageActionChatEditTitle":c&&(t._="messageActionChannelEditTitle");break;case"messageActionChatDeletePhoto":c&&(t._="messageActionChannelDeletePhoto");break;case"messageActionChatAddUser":1===t.users.length?(t.user_id=t.users[0],e.fromId===t.user_id&&(t._=f?"messageActionChatJoined"+a:"messageActionChatReturn"+a)):t.users.length>1&&(t._="messageActionChatAddUsers");break;case"messageActionChatDeleteUser":e.fromId===t.user_id&&(t._="messageActionChatLeave"+a);break;case"messageActionChannelMigrateFrom":s=t.chat_id.toPeerId(!0),i=p;break;case"messageActionChatMigrateTo":s=p,i=t.channel_id.toPeerId(!0);break;case"messageActionHistoryClear":e.clear_history=!0,delete e.pFlags.out,delete e.pFlags.unread;break;case"messageActionPhoneCall":t.type=(t.pFlags.video?"video_":"")+(void 0!==t.duration?e.pFlags.out?"out_":"in_":"")+(void 0!==t.duration?"ok":"phoneCallDiscardReasonMissed"===t.reason._?"missed":"cancelled")}s&&i&&!this.migratedFromTo[s]&&!this.migratedToFrom[i]&&this.migrateChecks(s,i)}return l&&e.message.length&&!e.totalEntities&&this.wrapMessageEntities(e),d.set(m,e),e}saveMessages(e,t={}){return e.saved||(e.saved=!0,e.forEach(((e,a,s)=>{s[a]=this.saveMessage(e,t)}))),e}getFirstMessageToEdit(e,t){return Xt(this,void 0,void 0,(function*(){const a=this.getHistoryStorage(e,t).history.slice;if(a.isEnd(se.D.Bottom)&&a.length){let t;const s=this.appPeersManager.peerId;for(const n of a){const a=this.getMessageByPeer(e,n);if((s===e?a.fromId===s:a.pFlags.out)&&(yield this.canEditMessage(a,"text"))){t=a;break}}return t}}))}wrapMessageEntities(e){const t=e.entities?e.entities.slice():[];e.message=(0,bt.Z)(e.message,t);const a=(0,Nt.Z)(e.message);e.totalEntities=(0,Lt.Z)(t,a)}reportMessages(e,t,a,s){return this.apiManager.invokeApiSingle("messages.report",{peer:this.appPeersManager.getInputPeerById(e),id:t.map((e=>(0,oe.Z)(e))),reason:{_:a},message:s})}startBot(e,t,a){const s=t?t.toPeerId(!0):e.toPeerId();if(a){const t=(0,Ee.a)();return this.apiManager.invokeApi("messages.startBot",{bot:this.appUsersManager.getUserInput(e),peer:this.appPeersManager.getInputPeerById(s),random_id:t,start_param:a}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}))}const n="/start";if(t){let a;return a=this.appChatsManager.isChannel(t)?this.appChatsManager.inviteToChannel(t,[e]):this.appChatsManager.addChatUser(t,e,0),a.catch((e=>{if("USER_ALREADY_PARTICIPANT"!=(null==e?void 0:e.type))throw e;e.handled=!0})).then((()=>this.sendText(s,n+"@"+this.appPeersManager.getPeerUsername(e.toPeerId()))))}return this.sendText(s,n)}editPeerFolders(e,t){this.apiManager.invokeApi("folders.editPeerFolders",{folder_peers:e.map((e=>({_:"inputFolderPeer",peer:this.appPeersManager.getInputPeerById(e),folder_id:t})))}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}))}getFilter(e){return this.filtersStorage.getFilter(e)}toggleDialogPin(e){var t;return Xt(this,void 0,void 0,(function*(){const{peerId:a,topicId:s,filterId:n=(s?a:void 0)}=e;if(void 0===n)throw new Error("No filterId");if(n>1)return this.filtersStorage.toggleDialogPin(a,n);const i=this.dialogsStorage.getDialogOrTopic(a,s);if(!i)throw void 0;const r=!(null===(t=i.pFlags)||void 0===t?void 0:t.pinned)||void 0;if(r){const e=yield this.apiManager.getLimit(s?"topicPin":1===n?"folderPin":"pin");if(this.dialogsStorage.getPinnedOrders(n).length>=e)throw(0,X.Z)(s?"PINNED_TOO_MUCH":"PINNED_DIALOGS_TOO_MUCH")}return s?this.appChatsManager.updatePinnedForumTopic(a.toChatId(),s,r):this.apiManager.invokeApi("messages.toggleDialogPin",{peer:this.appPeersManager.getInputDialogPeerById(a),pinned:r}).then((e=>{const t=r?{pinned:r}:{};this.apiUpdatesManager.saveUpdate({_:"updateDialogPinned",peer:this.appPeersManager.getDialogPeer(a),folder_id:n,pFlags:t})}))}))}markDialogUnread(e,t){var a;const s=this.getDialogOnly(e);if(!s)return Promise.reject();const n=!t&&!(null===(a=s.pFlags)||void 0===a?void 0:a.unread_mark)||void 0;return this.apiManager.invokeApi("messages.markDialogUnread",{peer:this.appPeersManager.getInputDialogPeerById(e),unread:n}).then((t=>{if(t){const t=n?{unread:n}:{};this.onUpdateDialogUnreadMark({_:"updateDialogUnreadMark",peer:this.appPeersManager.getDialogPeer(e),pFlags:t})}}))}migrateChecks(e,t){if(!this.migratedFromTo[e]&&!this.migratedToFrom[t]&&this.appChatsManager.hasChat(t.toChatId())){const a=this.appChatsManager.getChat(e.toChatId());(null==a?void 0:a.migrated_to)&&a.migrated_to.channel_id===t.toChatId()&&(this.migratedFromTo[e]=t,this.migratedToFrom[t]=e,this.rootScope.dispatchEvent("dialog_migrate",{migrateFrom:e,migrateTo:t}),this.dialogsStorage.dropDialogWithEvent(e))}}canMessageBeEdited(e,t){var a,s;if(null===(a=null==e?void 0:e.pFlags)||void 0===a?void 0:a.is_outgoing)return!1;const n=["messageMediaPhoto","messageMediaDocument","messageMediaWebPage"];return"poll"===t&&n.push("messageMediaPoll"),!(!e||"message"!==e._||e.deleted||e.fwd_from||e.via_bot_id||e.media&&-1===n.indexOf(e.media._)||e.fromId&&this.appUsersManager.isBot(e.fromId)||"messageMediaDocument"===(null===(s=e.media)||void 0===s?void 0:s._)&&(e.media.document.sticker||"round"===e.media.document.type))}canEditMessage(e,t="text"){var a;return Xt(this,void 0,void 0,(function*(){if(!e||!this.canMessageBeEdited(e,t))return!1;if(this.getMessagePeer(e)===this.appUsersManager.getSelf().id)return!0;const{peerId:s}=e;return!(!(this.appPeersManager.isBroadcast(s)?this.appChatsManager.hasRights(s.toChatId(),"edit_messages"):(!s.isAnyChat()||"text"!==t||this.appChatsManager.hasRights(s.toChatId(),"send_plain")||this.appChatsManager.hasRights(s.toChatId(),"send_media"))&&e.pFlags.out)||"peerChannel"!==e.peer_id._&&e.date<(0,te.Z)(!0)-(yield this.apiManager.getConfig()).edit_time_limit&&"messageMediaPoll"!==(null===(a=e.media)||void 0===a?void 0:a._))}))}canDeleteMessage(e){return e&&(e.peerId.isUser()||e.pFlags.out||"chat"===this.appChatsManager.getChat(e.peerId.toChatId())._||this.appChatsManager.hasRights(e.peerId.toChatId(),"delete_messages"))&&(!e.pFlags.is_outgoing||!!e.error)}getReplyKeyboard(e){return this.getHistoryStorage(e).replyMarkup}mergeReplyKeyboard(e,t){var a,s;if(!t)return!1;const n=t.reply_markup;if(!n&&!(null===(a=t.pFlags)||void 0===a?void 0:a.out)&&!t.action)return!1;if("replyInlineMarkup"===(null==n?void 0:n._))return!1;const i=e.replyMarkup;if(n)return!(i&&i.mid>=t.mid||n.pFlags.selective||(e.maxOutId&&t.midi.mid||t.pFlags.is_outgoing)&&t.message)return i.pFlags.hidden=!0,!0}else(!e.maxOutId||t.mid>e.maxOutId)&&(e.maxOutId=t.mid);return(0,ue.Z)(t),!("messageActionChatDeleteUser"!==(null===(s=t.action)||void 0===s?void 0:s._)||!(i?t.action.user_id===i.fromId:this.appUsersManager.isBot(t.action.user_id))||(e.replyMarkup={_:"replyKeyboardHide",mid:t.mid,pFlags:{}},0))}getSearchStorage(e,t){return this.searchesStorage[e]||(this.searchesStorage[e]={}),this.searchesStorage[e][t]||(this.searchesStorage[e][t]={history:[]}),this.searchesStorage[e][t]}getSearchCounters(e,t,a=!0,s){return this.appPeersManager.isPeerRestricted(e)?Promise.resolve(t.map((e=>({_:"messages.searchCounter",pFlags:{},filter:e,count:0})))):(a?this.apiManager.invokeApiCacheable:this.apiManager.invokeApi).bind(this.apiManager)("messages.getSearchCounters",{peer:this.appPeersManager.getInputPeerById(e),filters:t,top_msg_id:s?(0,oe.Z)(s):void 0})}filterMessagesByInputFilterFromStorage(e,t,a,s){const n=this.getMessagesStorage(a);return(0,Zt.Z)(e,t.map((e=>n.get(e))),s)}getSearch({peerId:e,query:t,inputFilter:a,maxId:s,limit:n,nextRate:i,backLimit:r,threadId:o,folderId:p,minDate:f,maxDate:c}){if(this.appPeersManager.isPeerRestricted(e))return Promise.resolve({count:0,offset_id_offset:0,next_rate:void 0,history:[]});t||(t=""),a||(a={_:"inputMessagesFilterEmpty"}),void 0===n&&(n=20),i||(i=0),r||(r=0),f=f?f/1e3|0:0,c=c?c/1e3|0:0;let l=[];r&&(n+=r);let m;if(!e||r||s||t||1===n||o||(m=this.getHistoryStorage(e),l=this.filterMessagesByInputFilterFromStorage(a._,m.history.slice,this.getHistoryMessagesStorage(e),n)),l.length){if(!(l.length{this.appUsersManager.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats),this.saveMessages(e.messages),d.ZP&&this.log("getSearch result:",a,e);const t=e.count||l.length+e.messages.length;return e.messages.forEach((e=>{const t=this.getMessagePeer(e);if(t.isAnyChat()){const e=this.appChatsManager.getChat(t.toChatId());e.migrated_to&&this.migrateChecks(t,e.migrated_to.channel_id.toPeerId(!0))}l.push(e)})),{count:t,offset_id_offset:e.offset_id_offset||0,next_rate:e.next_rate,history:l}}))}subscribeRepliesThread(e,t){const a=e+"_"+t;for(const e in this.threadsToReplies)if(this.threadsToReplies[e]===a)return;this.getDiscussionMessage(e,t)}generateThreadServiceStartMessage(e){const t=e.peerId+"_"+e.mid;if(this.threadsServiceMessagesIdsStorage[t])return;const a=(0,oe.Z)(Math.max(...this.getMidsByMessage(e))),s={_:"messageService",pFlags:{is_single:!0},id:this.appMessagesIdsManager.generateTempMessageId(a),date:e.date,from_id:{_:"peerUser",user_id:o.NM},peer_id:e.peer_id,action:{_:"messageActionDiscussionStarted"},reply_to:this.generateReplyHeader(e.peerId,e.id)};this.saveMessages([s],{isOutgoing:!0}),this.threadsServiceMessagesIdsStorage[t]=s.mid}getThreadServiceMessageId(e,t){return this.threadsServiceMessagesIdsStorage[e+"_"+t]}getDiscussionMessage(e,t){return this.apiManager.invokeApiSingle("messages.getDiscussionMessage",{peer:this.appPeersManager.getInputPeerById(e),msg_id:(0,oe.Z)(t)}).then((a=>{var s;this.appChatsManager.saveApiChats(a.chats),this.appUsersManager.saveApiUsers(a.users),this.saveMessages(a.messages);const n=this.getMessageWithReplies(a.messages[0]),i=n.peerId+"_"+n.mid;this.generateThreadServiceStartMessage(n);const r=this.getHistoryStorage(n.peerId,n.mid),o=a.max_id=(0,pe.Z)(a.max_id)||0;a.read_inbox_max_id=r.readMaxId=(0,pe.Z)(null!==(s=a.read_inbox_max_id)&&void 0!==s?s:n.mid),a.read_outbox_max_id=r.readOutboxMaxId=(0,pe.Z)(a.read_outbox_max_id)||0;const p=r.history.first;return r.maxId&&r.maxId{this.newDialogsHandlePromise=void 0,this.handleNewDialogs()}))}deleteMessages(e,t,a,s){var n,i;return Xt(this,void 0,void 0,(function*(){let r;const o=this.appPeersManager.isChannel(e),p=o&&e.toChatId();if(o&&!s){const a=this.appChatsManager.getChat(p);if(!a.pFlags.creator&&!(null===(i=null===(n=a.admin_rights)||void 0===n?void 0:n.pFlags)||void 0===i?void 0:i.delete_messages)&&!(t=t.filter((t=>!!this.getMessageByPeer(e,t).pFlags.out))).length)return}const d=yield this.apiManager.getConfig(),f=t.splice(d.forwarded_count_max,t.length-d.forwarded_count_max),c=t.map((e=>{const t=(0,oe.Z)(e);return(0,pe.Z)(t)===e&&t})).filter(Boolean);r=o?this.apiManager.invokeApi("channels.deleteMessages",{channel:this.appChatsManager.getChannelInput(p),id:c}).then((e=>{this.apiUpdatesManager.processLocalUpdate({_:"updateDeleteChannelMessages",channel_id:p,messages:t,pts:e.pts,pts_count:e.pts_count})})):this.apiManager.invokeApi("messages.deleteMessages",{revoke:a,id:c}).then((e=>{this.apiUpdatesManager.processLocalUpdate({_:"updateDeleteMessages",messages:t,pts:e.pts,pts_count:e.pts_count})}));const l=[r];return f.length&&l.push(this.deleteMessages(e,f,a,!0)),Promise.all(l).then(qt.Z)}))}readHistory(e,t=0,a,s=!1){if(this.log("readHistory:",e,t,a),!this.getReadMaxIdIfUnread(e,a)){if(a&&!s){const t=this.dialogsStorage.getForumTopic(e,a);(0,oe.Z)(t.read_inbox_max_id)||(s=!0)}if(!s){const t=this.appChatsManager.isForum(e.toChatId())&&a?this.dialogsStorage.getForumTopic(e,a):this.getDialogOnly(e);t&&this.isDialogUnread(t)&&(s=!0)}if(!s)return this.log("readHistory: isn't unread"),Promise.resolve()}const n=this.getHistoryStorage(e,a);if(n.triedToReadMaxId>=t)return Promise.resolve();let i;return a?(n.readPromise||(i=this.apiManager.invokeApi("messages.readDiscussion",{peer:this.appPeersManager.getInputPeerById(e),msg_id:(0,oe.Z)(a),read_max_id:(0,oe.Z)(t)})),this.apiUpdatesManager.processLocalUpdate({_:"updateReadChannelDiscussionInbox",channel_id:e.toChatId(),top_msg_id:a,read_max_id:t})):this.appPeersManager.isChannel(e)?(n.readPromise||(i=this.apiManager.invokeApi("channels.readHistory",{channel:this.appChatsManager.getChannelInput(e.toChatId()),max_id:(0,oe.Z)(t)})),this.apiUpdatesManager.processLocalUpdate({_:"updateReadChannelInbox",max_id:t,channel_id:e.toChatId(),still_unread_count:void 0,pts:void 0})):(n.readPromise||(i=this.apiManager.invokeApi("messages.readHistory",{peer:this.appPeersManager.getInputPeerById(e),max_id:(0,oe.Z)(t)}).then((e=>{this.apiUpdatesManager.processUpdateMessage({_:"updateShort",update:{_:"updatePts",pts:e.pts,pts_count:e.pts_count}})}))),this.apiUpdatesManager.processLocalUpdate({_:"updateReadHistoryInbox",max_id:t,peer:this.appPeersManager.getOutputPeer(e),still_unread_count:void 0,pts:void 0,pts_count:void 0})),this.rootScope.dispatchEvent("notification_reset",this.appPeersManager.getPeerString(e)),n.readPromise?n.readPromise:(n.triedToReadMaxId=t,i.finally((()=>{delete n.readPromise;const{readMaxId:s}=n;this.log("readHistory: promise finally",t,s),s>t&&this.readHistory(e,s,a,!0)})),n.readPromise=i)}readAllHistory(e,t,a=!1){const s=this.getHistoryStorage(e,t);s.maxId&&this.readHistory(e,s.maxId,t,a)}getUnreadMentionsKey(e,t){return e+(t?`_${t}`:"")}fixDialogUnreadMentionsIfNoMessage(e,t){const a=this.dialogsStorage.getDialogOrTopic(e,t);(null==a?void 0:a.unread_mentions_count)&&this.reloadConversationOrTopic(e)}modifyCachedMentions(e,t,a,s){const n=this.unreadMentions[this.getUnreadMentionsKey(e,s)];n&&(a?n.first.isEnd(se.D.Top)&&n.insertSlice([t]):n.delete(t))}fixUnreadMentionsCountIfNeeded(e,t,a){const s=this.dialogsStorage.getDialogOrTopic(e,a);!t.length&&(null==s?void 0:s.unread_mentions_count)&&this.reloadConversationOrTopic(e)}goToNextMention(e,t){var a,s;const n=this.getUnreadMentionsKey(e,t),i=this.goToNextMentionPromises[n];if(i)return i;const r=null!==(a=(s=this.unreadMentions)[e])&&void 0!==a?a:s[e]=new se.Z,o=r.length,p=r.first.isEnd(se.D.Top);if(!o&&p)return this.fixUnreadMentionsCountIfNeeded(e,r,t),Promise.resolve();let d=Promise.resolve();return!p&&o<25&&(d=this.loadNextMentions(e,t)),this.goToNextMentionPromises[n]=d.then((()=>{const a=r.last,s=a&&a[a.length-1];if(s)return r.delete(s),s;this.fixUnreadMentionsCountIfNeeded(e,r,t)})).finally((()=>{delete this.goToNextMentionPromises[n]}))}loadNextMentions(e,t){const a=this.unreadMentions[e],s=a.first[0]||1;return this.getUnreadMentions(e,s,-50,50,void 0,void 0,t).then((e=>{this.mergeHistoryResult(a,e,1===s?0:s,50,-50)}))}getUnreadMentions(e,t,a,s,n=0,i=0,r){return this.apiManager.invokeApiSingleProcess({method:"messages.getUnreadMentions",params:{peer:this.appPeersManager.getInputPeerById(e),offset_id:(0,oe.Z)(t),add_offset:a,limit:s,max_id:(0,oe.Z)(n),min_id:(0,oe.Z)(i),top_msg_id:r?(0,oe.Z)(r):void 0},processResult:e=>((0,ue.Z)(e),this.appUsersManager.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats),this.saveMessages(e.messages),e)})}readMessages(e,t){if(!t.length)return Promise.resolve();let a,s;if(t=t.map((e=>(0,oe.Z)(e))),e.isAnyChat()&&this.appPeersManager.isChannel(e)){const n=e.toChatId();s={_:"updateChannelReadMessagesContents",channel_id:n,messages:t},a=this.apiManager.invokeApi("channels.readMessageContents",{channel:this.appChatsManager.getChannelInput(n),id:t})}else s={_:"updateReadMessagesContents",messages:t,pts:void 0,pts_count:void 0},a=this.apiManager.invokeApi("messages.readMessageContents",{id:t}).then((e=>{s.pts=e.pts,s.pts_count=e.pts_count,this.apiUpdatesManager.processLocalUpdate(s)}));return this.apiUpdatesManager.processLocalUpdate(s),a}getHistoryStorage(e,t){var a,s,n,i,r,o;return t?null!==(s=(r=null!==(a=(i=this.threadsStorage)[e])&&void 0!==a?a:i[e]={})[t])&&void 0!==s?s:r[t]={count:null,history:new se.Z}:null!==(n=(o=this.historiesStorage)[e])&&void 0!==n?n:o[e]={count:null,history:new se.Z}}getHistoryStorageTransferable(e,t){const a=this.getHistoryStorage(e,t),{count:s,history:n,maxId:i,readMaxId:r,readOutboxMaxId:o,maxOutId:p,replyMarkup:d}=a;return{count:s,history:void 0,historySerialized:n.toJSON(),maxId:i,readMaxId:r,readOutboxMaxId:o,maxOutId:p,replyMarkup:d}}getNotifyPeerSettings(e,t){const a=this.appPeersManager.getInputNotifyPeerById({peerId:e,ignorePeerId:!0,threadId:t});return Promise.all([this.appNotificationsManager.getNotifyPeerTypeSettings(),this.appNotificationsManager.getNotifySettings(a)]).then((([a,s])=>({muted:this.appNotificationsManager.isPeerLocalMuted({peerId:e,respectType:!0,threadId:t}),peerTypeNotifySettings:s})))}getUpdateAfterReloadKey(e,t){return e+(t?"_"+t:"")}handleNewUpdateAfterReload(e,t,a){var s,n,i;const r=null!==(s=(n=this.newUpdatesAfterReloadToHandle)[i=this.getUpdateAfterReloadKey(e,a)])&&void 0!==s?s:n[i]=new Set;r.has(t)?this.log.error("here we go again",e):(t.ignoreExisting=!0,r.add(t),this.scheduleHandleNewDialogs(e,a))}setDialogToStateIfMessageIsTop(e){this.isMessageIsTopMessage(e)&&this.dialogsStorage.setDialogToState(this.getDialogOnly(e.peerId))}isMessageIsTopMessage(e){const t=this.getDialogOnly(e.peerId);return t&&t.top_message===e.mid}updateMessageRepliesIfNeeded(e){try{const t=this.getThreadKey(e);if(t){const e=this.threadsToReplies[t];if(e){const[t,a]=e.split("_");this.updateMessage(t.toPeerId(),+a,"replies_updated")}}}catch(t){this.log.error("incrementMessageReplies err",t,e)}}getThreadKey(e){var t;let a="";if(null===(t=null==e?void 0:e.peerId)||void 0===t?void 0:t.isAnyChat()){const t=(0,Yt.Z)(e,this.appChatsManager.isForum(e.peerId.toChatId()));t&&(a=e.peerId+"_"+t)}return a}updateMessage(e,t,a){return this.reloadMessages(e,t,!0).then((()=>{const s=this.getMessageByPeer(e,t);if(s)return a&&this.rootScope.dispatchEvent(a,s),s}))}checkPendingMessage(e){const t=this.pendingByMessageId[e.mid];let a;if(t){const s=this.pendingByRandomId[t];(a=this.finalizePendingMessage(t,e))&&this.rootScope.dispatchEvent("history_update",{storageKey:s.storage.key,message:e,sequential:s.sequential}),delete this.pendingByMessageId[e.mid]}return a}mutePeer(e){if(!(e=this.appNotificationsManager.validatePeerSettings(e)))return;const{peerId:t,muteUntil:a,threadId:s}=e,n={_:"inputPeerNotifySettings"};n.mute_until=a;const i=this.appPeersManager.getInputPeerById(t);return this.appNotificationsManager.updateNotifySettings(s?{_:"inputNotifyForumTopic",peer:i,top_msg_id:(0,oe.Z)(s)}:{_:"inputNotifyPeer",peer:i},n)}togglePeerMute({peerId:e,mute:t,threadId:a}){return void 0===t&&(t=!this.appNotificationsManager.isPeerLocalMuted({peerId:e,respectType:!1,threadId:a})),this.mutePeer({peerId:e,muteUntil:t?o.rU:0,threadId:a})}findPeerIdByMids(e){for(let t=e.length-1;t>=0;--t){const a=e[t],s=this.getMessageById(a);if(s)return s.peerId}}canSendToPeer(e,t,a="send_messages"){var s;if(this.appPeersManager.isPeerRestricted(e))return!1;if(e.isAnyChat()){const n=e.toChatId();if(t){const a=this.dialogsStorage.getForumTopic(e,t);if((null===(s=null==a?void 0:a.pFlags)||void 0===s?void 0:s.closed)&&!this.appChatsManager.hasRights(n,"manage_topics"))return!1}const i=this.appChatsManager.getChat(n);return this.appChatsManager.hasRights(n,a,void 0,!!t)&&(!i.pFlags.left||!!t)}return this.appUsersManager.canSendToUser(e)}finalizePendingMessage(e,t){const a=this.pendingByRandomId[e];if(!a)return;const{peerId:s,tempId:n,threadId:i,storage:r}=a;[this.getHistoryStorage(s),i?this.getHistoryStorage(s,i):void 0].filter(Boolean).forEach((e=>{e.history.delete(n)}));const o=this.getMessageFromStorage(r,n);return o&&(delete t.pFlags.is_outgoing,delete t.pending,delete t.error,delete t.random_id,delete t.send),this.rootScope.dispatchEvent("messages_pending"),delete this.pendingByRandomId[e],this.finalizePendingMessageCallbacks(r,n,t),o}finalizePendingMessageCallbacks(e,t,a){const s=this.tempFinalizeCallbacks[t];if(void 0!==s){for(const e in s){const{deferred:t,callback:n}=s[e];n(a).then(t.resolve,t.reject)}delete this.tempFinalizeCallbacks[t]}if(a.media){(0,ue.Z)(a);const{photo:e,document:s}=a.media;if(e){const a=this.appPhotosManager.getPhoto(""+t);if(a){const t=e.sizes[e.sizes.length-1],s=this.thumbsStorage.getCacheContext(e,t.type),n=this.thumbsStorage.getCacheContext(a,o.Pt);Object.assign(s,n);const i=e.sizes[e.sizes.length-1],r=(0,Ot.Z)(e,i);(0,lt.P)(r.location)}}else if(s){const e=this.appDocsManager.getDoc(""+t);if(e){const t=this.thumbsStorage.getCacheContext(e);if(e.type&&"sticker"!==e.type&&"image/gif"!==e.mime_type&&t.url){const e=this.thumbsStorage.getCacheContext(s);Object.assign(e,t),n=s,(0,lt.P)((0,ct.Z)(n,undefined),{fileName:n.file_name})}}}else a.media.poll&&(delete this.appPollsManager.polls[t],delete this.appPollsManager.results[t])}var n;const i=this.getMessageFromStorage(e,t);e.delete(t),!i.reply_markup&&a.reply_markup&&setTimeout((()=>{this.getMessageFromStorage(e,a.mid)&&this.rootScope.dispatchEvent("message_edit",{storageKey:e.key,peerId:a.peerId,mid:a.mid,message:a})}),0),this.handleReleasingMessage(i,e),this.rootScope.dispatchEvent("message_sent",{storageKey:e.key,tempId:t,tempMessage:i,mid:a.mid,message:a})}incrementMaxSeenId(e){if(!e||this.maxSeenId&&!(e>this.maxSeenId))return!1;this.maxSeenId=e,this.appStateManager.pushToState("maxSeenMsgId",e),this.apiManager.invokeApi("messages.receivedMessages",{max_id:(0,oe.Z)(e)})}getMessageReactionsListAndReadParticipants(e,t,a,s,n,i){var r,o;return Xt(this,void 0,void 0,(function*(){const p={reactions:[],count:0,next_offset:void 0},d=yield this.canViewMessageReadParticipants(e);return d&&void 0===t?t=100:void 0===t&&(t=50),Promise.all([!d||a||n?[]:this.getMessageReadParticipants(e.peerId,e.mid).catch((()=>[])),(null===(o=null===(r=e.reactions)||void 0===r?void 0:r.recent_reactions)||void 0===o?void 0:o.length)&&!i?this.appReactionsManager.getMessageReactionsList(e.peerId,e.mid,t,a,s).catch((e=>p)):p]).then((([e,t])=>{const a=e.map((e=>e.toPeerId())),s=a.slice();(0,ne.Z)(s,((e,a,s)=>{t.reactions.some((t=>this.appPeersManager.getPeerId(t.peer_id)===e))&&s.splice(a,1)}));let n=t.reactions.map((e=>({peerId:this.appPeersManager.getPeerId(e.peer_id),reaction:e.reaction})));return n=n.concat(s.map((e=>({peerId:e})))),{reactions:t.reactions,reactionsCount:t.count,readParticipants:a,combined:n,nextOffset:t.next_offset}}))}))}getMessageReadParticipants(e,t){return this.apiManager.invokeApiSingle("messages.getMessageReadParticipants",{peer:this.appPeersManager.getInputPeerById(e),msg_id:(0,oe.Z)(t)}).then((e=>e.map((e=>e.toUserId()))))}canViewMessageReadParticipants(e){return Xt(this,void 0,void 0,(function*(){if("message"!==(null==e?void 0:e._)||e.pFlags.is_outgoing||!e.pFlags.out||!this.appPeersManager.isAnyGroup(e.peerId))return!1;const t=this.appChatsManager.getChat(e.peerId.toChatId()),a=yield this.apiManager.getAppConfig();return t.participants_count<=a.chat_read_mark_size_threshold&&(0,te.Z)(!0)-e.date(0,oe.Z)(e))),increment:!0}).then((a=>{const s=new Array(t.length);for(let n=0,i=t.length;n{const{chatPeerIds:t}=e.state;return t[t.length-1]===a}));!n&&s.length&&(s.sort(((e,t)=>e.state.idleStartTime-t.state.idleStartTime)),n=s[0].state.idleStartTime?s[s.length-1]:s[0]),f.Z.getInstance().invokeVoid("notificationBuild",Object.assign({message:e},t),null==n?void 0:n.source)}getScheduledMessagesStorage(e){var t,a;return null!==(t=(a=this.scheduledMessagesStorage)[e])&&void 0!==t?t:a[e]=this.createMessageStorage(e,"scheduled")}getScheduledMessageByPeer(e,t){return this.getMessageFromStorage(this.getScheduledMessagesStorage(e),t)}getScheduledMessages(e){if(!this.canSendToPeer(e))return;const t=this.getScheduledMessagesStorage(e);return t.size?[...t.keys()]:this.apiManager.invokeApiSingle("messages.getScheduledHistory",{peer:this.appPeersManager.getInputPeerById(e),hash:""}).then((t=>{if("messages.messagesNotModified"!==t._){this.appUsersManager.saveApiUsers(t.users),this.appChatsManager.saveApiChats(t.chats);const a=this.getScheduledMessagesStorage(e);return this.saveMessages(t.messages,{storage:a,isScheduled:!0}),[...a.keys()]}return[]}))}sendScheduledMessages(e,t){return this.apiManager.invokeApi("messages.sendScheduledMessages",{peer:this.appPeersManager.getInputPeerById(e),id:t.map((e=>(0,oe.Z)(e)))}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}))}deleteScheduledMessages(e,t){return this.apiManager.invokeApi("messages.deleteScheduledMessages",{peer:this.appPeersManager.getInputPeerById(e),id:t.map((e=>(0,oe.Z)(e)))}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}))}getMessageWithReplies(e){return this.filterMessages(e,(e=>!!e.replies))[0]}getMessageWithCommentReplies(e){if(e.peerId!==o.hj){const t=null==(e=this.getMessageWithReplies(e))?void 0:e.replies;if(!t||!t.pFlags.comments||t.channel_id.toChatId()===o.IA)return}return e}isFetchIntervalNeeded(e){return e.isAnyChat()&&(!this.appChatsManager.isInChat(e.toChatId())||this.appChatsManager.isForum(e.toChatId()))}getNewHistory(e,t){var a;return Xt(this,void 0,void 0,(function*(){if(!this.isFetchIntervalNeeded(e))return;const s=this.getHistoryStorage(e,t),n=s.history.slice;if(!n.isEnd(se.D.Bottom))return;delete s.maxId,n.unsetEnd(se.D.Bottom);const i=yield this.getHistory(e,null!==(a=n[0])&&void 0!==a?a:1,0,50,t);for(let t=0,a=i.history.length;t{const e=i.history.sliceMe(t,r,a),s=(null==e?void 0:e.slice)||i.history.constructSlice();return{count:i.count,history:Array.from(s),isEnd:s.getEnds(),offsetIdOffset:(null==e?void 0:e.offsetIdOffset)||i.count}})):{count:i.count,history:Array.from(o.slice),isEnd:o.slice.getEnds(),offsetIdOffset:o.offsetIdOffset}}isHistoryResultEnd(e,t,a){const{offset_id_offset:s,messages:n}=e,i=e.count||n.length,r=null!=s?s:i-1,o=a<0?t+a:t;return{count:i,offsetIdOffset:r,isTopEnd:r>=i-o||ie.mid));if(a&&(0,oe.Z)(a)&&!c.includes(a)&&pc[e]);++e);c.splice(e,0,a)}const l=e.insertSlice(c)||e.slice;return d&&l.setEnd(se.D.Top),f&&l.setEnd(se.D.Bottom),Object.assign({slice:l,mids:c,messages:i},r)}fillHistoryStorage(e,t,a,s,n,i){const r=n.maxId;return this.requestHistory(e,t,a,s,void 0,i).then((i=>{const{count:o,isBottomEnd:p,slice:d,messages:f}=this.mergeHistoryResult(n.history,i,t,a,s);n.count=o;for(let t=0,a=f.length;t{d.ZP&&this.log("requestHistory result:",e,r,t,a,s),this.appUsersManager.saveApiUsers(r.users),this.appChatsManager.saveApiChats(r.chats),this.saveMessages(r.messages),"pts"in r&&this.apiUpdatesManager.addChannelState(e.toChatId(),r.pts);let o=r.messages.length,p=r.count;o&&!r.messages[o-1]&&(r.messages.splice(o-1,1),o--,p--);const f=this.getHistoryStorage(e,i),c=r.messages[o-1];if(o&&c.grouped_id){const t=f.history.findSlice(c.mid);if(t&&t.slice.length+r.messages.lengthr))}return r}),(t=>{if("CHANNEL_PRIVATE"===t.type){let t=this.appChatsManager.getChat(e.toChatId());"channel"===t._&&(t={_:"channelForbidden",id:e.toChatId(),access_hash:t.access_hash,title:t.title,pFlags:t.pFlags}),this.apiUpdatesManager.processUpdateMessage({_:"updates",updates:[{_:"updateChannel",channel_id:e.toChatId()}],chats:[t],users:[]})}throw t}))}fetchSingleMessages(){return this.fetchSingleMessagesPromise?this.fetchSingleMessagesPromise:this.fetchSingleMessagesPromise=(0,P.Z)(0).then((()=>{const e=[];for(const[t,a]of this.needSingleMessages){const s=[...a.keys()],n=s.map((e=>({_:"inputMessageID",id:(0,oe.Z)(e)})));let i;i=t.isAnyChat()&&this.appPeersManager.isChannel(t)?this.apiManager.invokeApiSingle("channels.getMessages",{channel:this.appChatsManager.getChannelInput(t.toChatId()),id:n}):this.apiManager.invokeApiSingle("messages.getMessages",{id:n});const r=i.then((e=>{(0,ue.Z)(e),this.appUsersManager.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats);const t=this.saveMessages(e.messages);for(let e=0;e{this.rootScope.dispatchEvent("messages_downloaded",{peerId:t,mids:s})}));e.push(r)}return this.needSingleMessages.clear(),Promise.all(e).then(qt.Z,qt.Z).then((()=>{this.fetchSingleMessagesPromise=void 0,this.needSingleMessages.size&&this.fetchSingleMessages()}))}))}reloadMessages(e,t,a){if(Array.isArray(t))return Promise.all(t.map((t=>this.reloadMessages(e,t,a))));const s=this.getMessageByPeer(e,t);if(s&&!a)return this.rootScope.dispatchEvent("messages_downloaded",{peerId:e,mids:[t]}),Promise.resolve(s);{let a=this.needSingleMessages.get(e);a||this.needSingleMessages.set(e,a=new Map);let s=a.get(t);return s||(s=(0,v.Z)(),a.set(t,s),this.fetchSingleMessages(),s)}}getExtendedMedia(e,t){let a=this.extendedMedia.get(e);a||this.extendedMedia.set(e,a=new Map);const s=(0,v.Z)(),n=[],i=t.map((t=>{let i=a.get(t);return i||(a.set(t,i=s),n.push(t),i.then((()=>{a.delete(t),a.size||this.extendedMedia.get(e)!==a||this.extendedMedia.delete(e)}))),i}));return n.length?this.apiManager.invokeApi("messages.getExtendedMedia",{peer:this.appPeersManager.getInputPeerById(e),id:n.map((e=>(0,oe.Z)(e)))}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e),s.resolve()})):s.resolve(),Promise.all(i)}fetchMessageReplyTo(e){if(!e.reply_to_mid)return Promise.resolve(this.generateEmptyMessage(0));const t=e.reply_to.reply_to_peer_id?this.appPeersManager.getPeerId(e.reply_to.reply_to_peer_id):e.peerId;return this.reloadMessages(t,e.reply_to_mid).then((t=>{if(t||delete(e=this.getMessageByPeer(e.peerId,e.mid)).reply_to_mid,"messageService"===e._){const t=e.peerId;this.rootScope.dispatchEvent("message_edit",{storageKey:`${t}_history`,peerId:t,mid:e.mid,message:e}),this.isMessageIsTopMessage(e)&&this.rootScope.dispatchEvent("dialogs_multiupdate",new Map([[t,{dialog:this.getDialogOnly(t)}]]))}return t}))}getTypingKey(e,t){return t?`${e}_${t}`:e}setTyping(e,t,a,s){var n;s&&!this.appPeersManager.isForum(e)&&(s=void 0);const i=this.getTypingKey(e,s);let r=this.typings[i];return e&&this.canSendToPeer(e)&&e!==this.appPeersManager.peerId&&(a||(null===(n=null==r?void 0:r.action)||void 0===n?void 0:n._)!==t._)?((null==r?void 0:r.timeout)&&clearTimeout(r.timeout),r=this.typings[i]={action:t},this.apiManager.invokeApi("messages.setTyping",{peer:this.appPeersManager.getInputPeerById(e),action:t,top_msg_id:s?(0,oe.Z)(s):void 0}).finally((()=>{r===this.typings[i]&&(r.timeout=T.Z.setTimeout((()=>{delete this.typings[i]}),6e3))}))):Promise.resolve(!1)}handleReleasingMessage(e,t){const a=e.media;if(a){const s=a.webpage||a,n=s.photo||s.document;if((null==n?void 0:n.file_reference)&&this.referenceDatabase.deleteContext(n.file_reference,{type:"message",peerId:e.peerId,messageId:e.mid}),"webpage"in a&&a.webpage){const s=this.getScheduledMessagesStorage(e.peerId)===t,n=this.appWebPagesManager.getMessageKeyForPendingWebPage(e.peerId,e.mid,s);this.appWebPagesManager.deleteWebPageFromPending(a.webpage,n)}a.poll&&this.appPollsManager.updatePollToMessage(e,!1)}}handleDeletedMessages(e,t,a){const s={count:0,unread:0,unreadMentions:0,msgs:new Set};for(const n of a){const a=this.getMessageFromStorage(t,n);if(!a){this.fixDialogUnreadMentionsIfNoMessage(e);continue}this.handleReleasingMessage(a,t),this.updateMessageRepliesIfNeeded(a),a.pFlags.out||a.pFlags.is_outgoing||!a.pFlags.unread||(++s.unread,this.rootScope.dispatchEvent("notification_cancel","msg"+n),a.pFlags.mentioned&&(++s.unreadMentions,this.modifyCachedMentions(e,n,!1))),++s.count,s.msgs.add(n),a.deleted=!0;const i=a.grouped_id;if(i){const e=this.groupedMessagesStorage[i];e&&(e.delete(n),s.albums||(s.albums={}),(s.albums[i]||(s.albums[i]=new Set)).add(n),e.size||(delete s.albums,delete this.groupedMessagesStorage[i]))}t.delete(n)}if(s.albums)for(const e in s.albums)this.dispatchAlbumEdit(e,t,[...s.albums[e]]);return s}handleEditedMessage(e,t,a){var s;if("message"===e._){if(null===(s=e.media)||void 0===s?void 0:s.webpage){const t=this.appWebPagesManager.getMessageKeyForPendingWebPage(e.peerId,e.mid,!!e.pFlags.is_scheduled);this.appWebPagesManager.deleteWebPageFromPending(e.media.webpage,t)}const t=e.grouped_id;t&&this.dispatchAlbumEdit(t,a,[])}}dispatchAlbumEdit(e,t,a){const s=this.getMidsByAlbum(e).map((e=>this.getMessageFromStorage(t,e)));this.rootScope.dispatchEvent("album_edit",{peerId:s[0].peerId,groupId:e,deletedMids:a||[],messages:s})}getDialogUnreadCount(e){var t;let a=e.unread_count;if(!this.dialogsStorage.isTopic(e)&&this.appPeersManager.isForum(e.peerId)){const t=this.dialogsStorage.getForumUnreadCount(e.peerId);a=t instanceof Promise?0:t.count}return a||+!!(null===(t=e.pFlags)||void 0===t?void 0:t.unread_mark)}isDialogUnread(e){return!!this.getDialogUnreadCount(e)}canForward(e){return"message"===(null==e?void 0:e._)&&!e.pFlags.noforwards&&!this.appPeersManager.noForwards(e.peerId)}pushBatchUpdate(e,t,a,s){let n=this.batchUpdates[e];n||(n=this.batchUpdates[e]={callback:t,batch:new Map}),n.batch.has(a)||(n.batch.set(a,s?s():void 0),this.batchUpdatesDebounced())}getMessagesFromMap(e){const t=new Map;for(const[a,s]of e){const[e,n]=a.split("_"),i=this.getMessageByPeer(e.toPeerId(),+n);i&&t.set(i,s)}return t}saveDefaultSendAs(e,t){return this.appProfileManager.getCachedFullChat(e.toChatId()).default_send_as=this.appPeersManager.getOutputPeer(t),this.apiManager.invokeApi("messages.saveDefaultSendAs",{peer:this.appPeersManager.getInputPeerById(e),send_as:this.appPeersManager.getInputPeerById(t)})}}var aa=a(6724);function sa(e){const t=e.replace("input","");return t[0].toLowerCase()+t.slice(1)}class na extends G{constructor(){super(...arguments),this.peerSettings={notifyPeer:{},notifyUsers:null,notifyChats:null,notifyBroadcasts:null,notifyForumTopic:{}},this.checkMuteUntil=()=>{void 0!==this.checkMuteUntilTimeout&&(clearTimeout(this.checkMuteUntilTimeout),this.checkMuteUntilTimeout=void 0);const e=(0,te.Z)(!0);let t=o.rU;const a=a=>{if(a instanceof Promise)return!1;const s=a.mute_until;return!!s&&(s<=e?(a.mute_until=0,!0):(s{for(const t in this.peerSettings[e]){const s=this.peerSettings[e][t];if(a(s)){const[e,a]=t.split("_"),n=this.appPeersManager.getOutputPeer(e.toPeerId());this.apiUpdatesManager.saveUpdate({_:"updateNotifySettings",peer:a?{_:"notifyForumTopic",peer:n,top_msg_id:+a}:{_:"notifyPeer",peer:n},notify_settings:s})}}}));const s=Math.min(18e5,1e3*(t-e));this.checkMuteUntilTimeout=T.Z.setTimeout(this.checkMuteUntil,s)}}after(){return this.checkMuteUntilThrottled=(0,aa.Z)(this.checkMuteUntil,1e3,!1),this.apiUpdatesManager.addMultipleEventsListeners({updateNotifySettings:e=>{const{peer:t}=e,a="notifyForumTopic"===t._,s="notifyPeer"===t._||a,n=s&&this.appPeersManager.getPeerId(t.peer),i=s?void 0:t._;this.savePeerSettings({key:i,peerId:n,threadId:a?(0,pe.Z)(t.top_msg_id):void 0,settings:e.notify_settings}),this.rootScope.dispatchEvent("notify_settings",e)}}),this.appStateManager.getState().then((e=>{if(e.notifySettings)for(const t in e.notifySettings)(0,ue.Z)(t),this.savePeerSettings({key:t,settings:e.notifySettings[t]})}))}getNotifySettings(e){let t,a=sa(e._),s=this.peerSettings[a];return"inputNotifyPeer"===e._&&(t=a=this.appPeersManager.getPeerId(e.peer),s=s[a]),s||((s||this.peerSettings)[a]=this.apiManager.invokeApi("account.getNotifySettings",{peer:e}).then((e=>(this.savePeerSettings({key:a,peerId:t,settings:e}),e))))}getNotifyPeerTypeSettings(){if(this.getNotifyPeerTypePromise)return this.getNotifyPeerTypePromise;const e=["inputNotifyBroadcasts","inputNotifyUsers","inputNotifyChats"].map((e=>this.getNotifySettings({_:e})));return this.getNotifyPeerTypePromise=Promise.all(e)}updateNotifySettings(e,t){return this.apiManager.invokeApi("account.updateNotifySettings",{peer:e,settings:t}).then((a=>{a&&this.apiUpdatesManager.processLocalUpdate({_:"updateNotifySettings",peer:Object.assign(Object.assign({},e),{_:sa(e._)}),notify_settings:Object.assign(Object.assign({},t),{_:"peerNotifySettings"})})}))}getContactSignUpNotification(){return this.notifyContactsSignUp?this.notifyContactsSignUp:this.notifyContactsSignUp=this.apiManager.invokeApi("account.getContactSignUpNotification")}setContactSignUpNotification(e){this.apiManager.invokeApi("account.setContactSignUpNotification",{silent:e}).then((t=>{this.notifyContactsSignUp=Promise.resolve(!e)}))}getPeerKey(e,t){return e+(t?"_"+t:"")}savePeerSettings({key:e,peerId:t,threadId:a,settings:s}){let n;t&&(e=this.getPeerKey(t,a),n=this.peerSettings[a?"notifyForumTopic":"notifyPeer"]),(n||this.peerSettings)[e]=s,t?this.checkMuteUntilThrottled():(this.rootScope.dispatchEvent("notify_peer_type_settings",{key:e,settings:s}),this.appStateManager.getState().then((t=>{const a=t.notifySettings;a[e]=s,this.appStateManager.pushToState("notifySettings",a)})))}isMuted(e){return"peerNotifySettings"===e._&&(e.silent||void 0!==e.mute_until&&1e3*e.mute_until>(0,te.Z)())}getPeerMuted(e){const t=this.getNotifySettings({_:"inputNotifyPeer",peer:this.appPeersManager.getInputPeerById(e)});return(t instanceof Promise?t:Promise.resolve(t)).then((e=>this.isMuted(e)))}getPeerLocalSettings({peerId:e,respectType:t=!0,threadId:a}){const s={_:"peerNotifySettings"},n=this.getPeerKey(e,a),i=this.peerSettings[a?"notifyForumTopic":"notifyPeer"][n];if(!i||i instanceof Promise||Object.assign(s,i),t){const t=sa(this.appPeersManager.getInputNotifyPeerById({peerId:e,ignorePeerId:!0,threadId:a})._),n=this.peerSettings[t];if(n&&!(n instanceof Promise))for(const e in n)void 0===s[e]&&(s[e]=n[e])}return s}validatePeerSettings(e){if(e.peerId!==this.appPeersManager.peerId)return e.threadId&&!this.appPeersManager.isForum(e.peerId)&&(e.threadId=void 0),e}isPeerLocalMuted(e){if(!(e=this.validatePeerSettings(e)))return!1;if(e.threadId){const t=this.getPeerLocalSettings(Object.assign(Object.assign({},e),{respectType:!1}));return void 0!==t.silent||void 0!==t.mute_until?this.isMuted(t):this.isPeerLocalMuted(Object.assign(Object.assign({},e),{threadId:void 0}))}const t=this.getPeerLocalSettings(e);return this.isMuted(t)}}var ia=a(677),ra=a(617),oa=a(7361),pa=a(7419),da=a(7256);class fa extends G{get peerId(){return this.appUsersManager.userId.toPeerId()}canPinMessage(e){return e.isUser()||this.appChatsManager.hasRights(e.toChatId(),"pin_messages")}getPeerPhoto(e){const t=this.getPeer(e);return(0,da.Z)(t)}getPeerMigratedTo(e){if(e.isUser())return!1;const t=this.appChatsManager.getChat(e.toChatId()),a=null==t?void 0:t.migrated_to;return!(!a||!t.pFlags.deactivated)&&(0,le.Z)(a)}getOutputPeer(e){if(e.isUser())return{_:"peerUser",user_id:e.toUserId()};const t=e.toChatId();return this.appChatsManager.isChannel(t)?{_:"peerChannel",channel_id:t}:{_:"peerChat",chat_id:t}}getPeerString(e){return e.isUser()?this.appUsersManager.getUserString(e.toUserId()):this.appChatsManager.getChatString(e.toChatId())}getPeerUsername(e){return this.getPeerActiveUsernames(e)[0]||""}getPeerActiveUsernames(e){const t=this.getPeer(e);return(0,$t.Z)(t)}getPeer(e){return e.isUser()?this.appUsersManager.getUser(e.toUserId()):this.appChatsManager.getChat(e.toChatId())}getPeerId(e){return(0,le.Z)(e)||(0,fe.Z)(e)&&"inputPeerSelf"===e._&&this.peerId||o.NM}getDialogPeer(e){return{_:"dialogPeer",peer:this.getOutputPeer(e)}}isChannel(e){return!e.isUser()&&this.appChatsManager.isChannel(e.toChatId())}isMegagroup(e){return!e.isUser()&&this.appChatsManager.isMegagroup(e.toChatId())}isForum(e){return!e.isUser()&&this.appChatsManager.isForum(e.toChatId())}isAnyGroup(e){return!e.isUser()&&!this.appChatsManager.isBroadcast(e.toChatId())}isBroadcast(e){return this.isChannel(e)&&!this.isMegagroup(e)}isBot(e){return e.isUser()&&this.appUsersManager.isBot(e.toUserId())}isContact(e){return e.isUser()&&this.appUsersManager.isContact(e.toUserId())}isUser(e){return(0,ra.Z)(e)}isAnyChat(e){return(0,oa.Z)(e)}isPeerRestricted(e){return(0,pa.Z)(this.getPeer(e))}getRestrictionReasonText(e){const t=this.getPeer(e),a=t.restriction_reason?(0,ia.RP)(t.restriction_reason):void 0;return a?a.text:e.isUser()?"This user is restricted":"This chat is restricted"}getInputNotifyPeerById({peerId:e,ignorePeerId:t,threadId:a}){return t?e.isUser()?{_:"inputNotifyUsers"}:this.isBroadcast(e)?{_:"inputNotifyBroadcasts"}:{_:"inputNotifyChats"}:a?{_:"inputNotifyForumTopic",peer:this.getInputPeerById(e),top_msg_id:(0,oe.Z)(a)}:{_:"inputNotifyPeer",peer:this.getInputPeerById(e)}}getInputPeerById(e){if(!e)return{_:"inputPeerEmpty"};if(!e.isUser()){const t=e.toChatId();return this.appChatsManager.getInputPeer(t)}const t=e.toUserId();return this.appUsersManager.getUserInputPeer(t)}getInputPeerSelf(){return{_:"inputPeerSelf"}}getInputDialogPeerById(e){return{_:"inputDialogPeer",peer:(0,fe.Z)(e)?e:this.getInputPeerById(e)}}getPeerSearchText(e){let t;return t=this.isUser(e)?"%pu "+this.appUsersManager.getUserSearchText(e.toUserId()):"%pg "+(this.appChatsManager.getChat(e.toChatId()).title||""),t}getDialogType(e){return this.isMegagroup(e)?"megagroup":this.isChannel(e)?"channel":this.isUser(e)?e===this.peerId?"saved":"chat":"group"}getDeleteButtonText(e){switch(this.getDialogType(e)){case"channel":return this.appChatsManager.hasRights(e.toChatId(),"delete_chat")?"ChannelDelete":"ChatList.Context.LeaveChannel";case"megagroup":case"group":return this.appChatsManager.hasRights(e.toChatId(),"delete_chat")?"DeleteMega":"ChatList.Context.LeaveGroup";default:return"ChatList.Context.DeleteChat"}}noForwards(e){var t;return!e.isUser()&&!!(null===(t=this.appChatsManager.getChat(e.toChatId()).pFlags)||void 0===t?void 0:t.noforwards)}}class ca extends G{constructor(){super(...arguments),this.photos={}}savePhoto(e,t){var a;if(!e||"photoEmpty"===e._)return;const s=this.photos[e.id];if(e.file_reference&&(dt("file_reference",s,e),this.referenceDatabase.saveContext(e.file_reference,t)),null===(a=e.sizes)||void 0===a?void 0:a.length){e.sizes.sort(((e,t)=>(e.size||(e.sizes?1/0:0))-(t.size||(t.sizes?1/0:0))));const t=e.sizes[e.sizes.length-1];"photoSizeProgressive"===t._&&(t.size=t.sizes[t.sizes.length-1])}return s?Object.assign(s,e):this.photos[e.id]=e}getUserPhotos(e,t="0",a=20){const s=this.appUsersManager.getUserInput(e);return this.apiManager.invokeApiCacheable("photos.getUserPhotos",{user_id:s,offset:0,limit:a,max_id:t},{cacheSeconds:60}).then((a=>{this.appUsersManager.saveApiUsers(a.users);const s=a.photos.map(((t,s)=>(a.photos[s]=this.savePhoto(t,{type:"profilePhoto",peerId:e.toPeerId()}),t.id)));if("0"!==t&&t){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}return{count:a.count||s.length,photos:s}}))}getPhoto(e){return(0,fe.Z)(e)?e:this.photos[e]}}class la extends G{constructor(){super(...arguments),this.polls={},this.results={},this.pollToMessages={},this.log=(0,S.kg)("POLLS",S.v9.Error)}after(){this.apiUpdatesManager.addMultipleEventsListeners({updateMessagePoll:e=>{this.log("updateMessagePoll:",e);let t=e.poll||this.polls[e.poll_id];if(!t)return;let a=e.results;const s=this.savePoll(t,a);t=s.poll,a=s.results,this.rootScope.dispatchEvent("poll_update",{poll:t,results:a})}})}savePoll(e,t,a){a&&this.updatePollToMessage(a,!0);const s=e.id;return this.polls[s]?(e=Object.assign(this.polls[s],e),t=this.saveResults(e,t)):(this.polls[s]=e,e.chosenIndexes=[],t=this.saveResults(e,t)),{poll:e,results:t}}saveResults(e,t){var a;return this.results[e.id]?t=Object.assign(this.results[e.id],t):this.results[e.id]=t,t.pFlags.min||(e.chosenIndexes.length=0,(null===(a=null==t?void 0:t.results)||void 0===a?void 0:a.length)&&t.results.forEach(((t,a)=>{var s;(null===(s=t.pFlags)||void 0===s?void 0:s.chosen)&&e.chosenIndexes.push(a)}))),t}getPoll(e){return{poll:this.polls[e],results:this.results[e]}}getInputMediaPoll(e,t,a,s){return a?(s||(s=[]),a=(0,we.Z)(a,s)):a=void 0,{_:"inputMediaPoll",poll:e,correct_answers:t,solution:a,solution_entities:a?s:void 0}}updatePollToMessage(e,t){const{id:a}=e.media.poll;let s=this.pollToMessages[a];if(!t&&!s)return;s||(s=this.pollToMessages[a]=new Set);const n=e.peerId+"_"+e.mid;t?s.add(n):s.delete(n),t||s.size||(delete this.polls[a],delete this.results[a],delete this.pollToMessages[a])}sendVote(e,t){const a=e.media.poll,s=t.map((e=>a.answers[e].option)),n=e.mid,i=e.peerId,r=this.appPeersManager.getInputPeerById(i);return e.pFlags.is_outgoing?this.appMessagesManager.invokeAfterMessageIsSent(n,"sendVote",(e=>(this.log("invoke sendVote callback"),this.sendVote(e,t)))):this.apiManager.invokeApi("messages.sendVote",{peer:r,msg_id:(0,oe.Z)(e.mid),options:s}).then((e=>{this.log("sendVote updates:",e),this.apiUpdatesManager.processUpdateMessage(e)}))}getResults(e){const t=this.appPeersManager.getInputPeerById(e.peerId);return this.apiManager.invokeApi("messages.getPollResults",{peer:t,msg_id:(0,oe.Z)(e.mid)}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e),this.log("getResults updates:",e)}))}getVotes(e,t,a,s=20){return this.apiManager.invokeApi("messages.getPollVotes",{peer:this.appPeersManager.getInputPeerById(e.peerId),id:(0,oe.Z)(e.mid),option:t,offset:a,limit:s}).then((e=>(this.log("getPollVotes messages:",e),this.appUsersManager.saveApiUsers(e.users),e)))}stopPoll(e){const t=e.media.poll;if(t.pFlags.closed)return Promise.resolve();const a=(0,ve.Z)(t);return a.pFlags.closed=!0,this.appMessagesManager.editMessage(e,void 0,{newMedia:this.getInputMediaPoll(a)}).then((()=>{}),(e=>{this.log.error("stopPoll error:",e)}))}}class ma extends G{constructor(){super(...arguments),this.privacy={}}after(){this.apiUpdatesManager.addMultipleEventsListeners({updatePrivacy:e=>{const t=e.key._;this.privacy[t]=e.rules,this.rootScope.dispatchEvent("privacy_update",e)}})}setPrivacy(e,t){return this.apiManager.invokeApi("account.setPrivacy",{key:{_:e},rules:t}).then((a=>(this.appUsersManager.saveApiUsers(a.users),this.appChatsManager.saveApiChats(a.chats),this.apiUpdatesManager.processLocalUpdate({_:"updatePrivacy",key:{_:sa(e)},rules:t.map((e=>{const t={};return Object.assign(t,e),t._=sa(t._),t}))}),a.rules)))}getPrivacy(e){const t=sa(e),a=this.privacy[t];return a?Promise.resolve(a):this.privacy[t]=this.apiManager.invokeApi("account.getPrivacy",{key:{_:e}}).then((e=>(this.appUsersManager.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats),this.privacy[t]=e.rules)))}getGlobalPrivacySettings(){return this.apiManager.invokeApi("account.getGlobalPrivacySettings")}setGlobalPrivacySettings(e){return this.apiManager.invokeApi("account.setGlobalPrivacySettings",{settings:e})}}var ga=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};const ha=18e4;class ua extends G{constructor(){super(...arguments),this.usersFull={},this.chatsFull={},this.fullExpiration={},this.onUpdateChatParticipants=e=>{const t=e.participants;if("chatParticipants"!==t._)return;const a=t.chat_id,s=this.chatsFull[a];void 0!==s&&(s.participants=t,this.rootScope.dispatchEvent("chat_full_update",a))},this.onUpdateChatParticipantAdd=e=>{const t=this.chatsFull[e.chat_id];if(void 0===t)return;const a=t.participants,s=a.participants||[];for(let t=0,a=s.length;t{const t=this.chatsFull[e.chat_id];if(void 0===t)return;const a=t.participants,s=a.participants||[];for(let t=0,n=s.length;t{var t,a;const s=e.user_id?e.user_id.toPeerId():this.appPeersManager.getPeerId(e.from_id);if(this.appPeersManager.peerId===s||"speakingInGroupCallAction"===e.action._)return;const n=e.top_msg_id,i=n?(0,pe.Z)(n):void 0,r=this.appPeersManager.getPeerId(e),o=this.getTypingsKey(r,i),p=null!==(t=(a=this.typingsInPeer)[o])&&void 0!==t?t:a[o]=[];let d=p.find((e=>e.userId===s));const f=()=>{delete d.timeout;const e=p.indexOf(d);-1!==e&&p.splice(e,1),this.rootScope.dispatchEvent("peer_typings",{peerId:r,threadId:i,typings:p}),p.length||delete this.typingsInPeer[o]};if(void 0!==(null==d?void 0:d.timeout)&&clearTimeout(d.timeout),"sendMessageCancelAction"===e.action._){if(!d)return;return void f()}d||(d={userId:s},p.push(d)),d.action=e.action;const c=this.appUsersManager.hasUser(s);c?this.appUsersManager.forceUserOnline(s):"updateChatUserTyping"===e._&&e.chat_id&&this.appChatsManager.hasChat(e.chat_id)&&!this.appChatsManager.isChannel(e.chat_id)&&Promise.resolve(this.getChatFull(e.chat_id)).then((()=>{void 0!==d.timeout&&this.appUsersManager.hasUser(s)&&this.rootScope.dispatchEvent("peer_typings",{peerId:r,threadId:i,typings:p})})),d.timeout=T.Z.setTimeout(f,6e3),c&&this.rootScope.dispatchEvent("peer_typings",{peerId:r,threadId:i,typings:p})},this.onUpdatePeerBlocked=e=>{const t=this.appPeersManager.getPeerId(e.peer_id);if(this.appPeersManager.isUser(t)){const a=t.toUserId(),s=this.usersFull[a];s&&(e.blocked?s.pFlags.blocked=!0:delete s.pFlags.blocked),this.rootScope.dispatchEvent("user_full_update",a)}this.rootScope.dispatchEvent("peer_block",{peerId:t,blocked:e.blocked})}}after(){this.apiUpdatesManager.addMultipleEventsListeners({updateChatParticipants:this.onUpdateChatParticipants,updateChatParticipantAdd:this.onUpdateChatParticipantAdd,updateChatParticipantDelete:this.onUpdateChatParticipantDelete,updateUserTyping:this.onUpdateUserTyping,updateChatUserTyping:this.onUpdateUserTyping,updateChannelUserTyping:this.onUpdateUserTyping,updatePeerBlocked:this.onUpdatePeerBlocked}),this.rootScope.addEventListener("chat_update",(e=>{var t,a;const s=this.chatsFull[e],n=this.appChatsManager.getChat(e);if(!s||!n)return;let i=!1;!!s.call!=!!(null===(t=n.pFlags)||void 0===t?void 0:t.call_active)&&(i=!0);const{photo:r}=n;if(r){const e="chatPhotoEmpty"!==r._;(e!==!(!s.chat_photo||"photoEmpty"===s.chat_photo._)||e&&r.photo_id!==(null===(a=s.chat_photo)||void 0===a?void 0:a.id))&&(i=!0)}i&&this.refreshFullPeer(e.toPeerId(!0))})),this.rootScope.addEventListener("channel_update",(e=>{this.refreshFullPeer(e.toPeerId(!0))})),this.rootScope.addEventListener("chat_full_update",(e=>{this.rootScope.dispatchEvent("peer_full_update",e.toPeerId(!0))})),this.rootScope.addEventListener("user_full_update",(e=>{this.rootScope.dispatchEvent("peer_full_update",e.toPeerId(!1))})),this.rootScope.addEventListener("invalidate_participants",(e=>{this.invalidateChannelParticipants(e)})),this.typingsInPeer={}}getProfile(e,t){return this.usersFull[e]&&!t&&Date.now(){this.appChatsManager.saveApiChats(t.chats,!0),this.appUsersManager.saveApiUsers(t.users);const a=t.full_user,s=e.toPeerId(!1);a.profile_photo&&(a.profile_photo=this.appPhotosManager.savePhoto(a.profile_photo,{type:"profilePhoto",peerId:s}));const n=a.bot_info;if(n){const t={type:"userFull",userId:e};n.description_document=this.appDocsManager.saveDoc(n.description_document,t),n.description_photo=this.appPhotosManager.savePhoto(n.description_photo,t)}return this.appNotificationsManager.savePeerSettings({peerId:s,settings:a.notify_settings}),this.usersFull[e]=a,this.fullExpiration[s]=Date.now()+ha,this.rootScope.dispatchEvent("user_full_update",e),a}})}getProfileByPeerId(e,t){return this.appPeersManager.isAnyChat(e)?this.getChatFull(e.toChatId(),t):this.getProfile(e.toUserId(),t)}getCachedFullChat(e){return this.chatsFull[e]}getCachedFullUser(e){return this.usersFull[e]}getCachedProfileByPeerId(e){return e.isUser()?this.getCachedFullUser(e.toUserId()):this.getCachedFullChat(e.toChatId())}getFullPhoto(e){return ga(this,void 0,void 0,(function*(){const t=yield this.getProfileByPeerId(e);switch(t._){case"userFull":return t.profile_photo;case"channelFull":case"chatFull":return t.chat_photo}}))}getChatFull(e,t){if(this.appChatsManager.isChannel(e))return this.getChannelFull(e,t);const a=e.toPeerId(!0),s=this.chatsFull[e];if(s&&!t&&Date.now(){this.appChatsManager.saveApiChats(t.chats,!0),this.appUsersManager.saveApiUsers(t.users);const s=t.full_chat;return s&&s.chat_photo&&s.chat_photo.id&&(s.chat_photo=this.appPhotosManager.savePhoto(s.chat_photo,{type:"profilePhoto",peerId:a})),s.call&&this.appGroupCallsManager.saveGroupCall(s.call,e),this.appNotificationsManager.savePeerSettings({peerId:a,settings:s.notify_settings}),this.chatsFull[e]=s,this.fullExpiration[a]=Date.now()+ha,this.rootScope.dispatchEvent("chat_full_update",e),s}})}getChatInviteLink(e,t){return ga(this,void 0,void 0,(function*(){const a=yield this.getChatFull(e);return!t&&a.exported_invite&&"chatInviteExported"==a.exported_invite._?a.exported_invite.link:this.apiManager.invokeApi("messages.exportChatInvite",{peer:this.appPeersManager.getInputPeerById(e.toPeerId(!0))}).then((t=>(void 0!==this.chatsFull[e]&&(this.chatsFull[e].exported_invite=t),t.link)))}))}getParticipants(e,t={_:"channelParticipantsRecent"},a=200,s=0){return this.appChatsManager.isChannel(e)?this.getChannelParticipants(e,t,a,s):Promise.resolve(this.getChatFull(e)).then((e=>{const a=e.participants;if("chatParticipants"!==a._)throw(0,X.Z)("CHAT_PRIVATE");if("channelParticipantsSearch"===t._&&t.q.trim()){const e=this.appUsersManager.createSearchIndex();a.participants.forEach((t=>{const a=t.user_id;e.indexObject(a,this.appUsersManager.getUserSearchText(a))}));const s=e.search(t.q),n=a.participants.filter((e=>s.has(e.user_id)));return Object.assign(Object.assign({},a),{participants:n})}return a}))}getParticipant(e,t){return this.appChatsManager.isChannel(e)?this.getChannelParticipant(e,t):this.getParticipants(e).then((e=>{(0,ue.Z)(e);const a=e.participants.find((e=>{if((0,xe.Z)(e)===t)return e}));if(!a)throw(0,X.Z)("USER_NOT_PARTICIPANT");return a}))}getChannelParticipants(e,t={_:"channelParticipantsRecent"},a=200,s=0){if("channelParticipantsRecent"===t._){const t=this.appChatsManager.getChat(e);if((null==t?void 0:t.pFlags)&&t.pFlags.broadcast&&!t.pFlags.creator&&!t.admin_rights)return Promise.reject()}return this.apiManager.invokeApiCacheable("channels.getParticipants",{channel:this.appChatsManager.getChannelInput(e),filter:t,offset:s,limit:a,hash:"0"},{cacheSeconds:60}).then((e=>(this.appUsersManager.saveApiUsers(e.users),e)))}getChannelParticipant(e,t){return this.apiManager.invokeApiSingle("channels.getParticipant",{channel:this.appChatsManager.getChannelInput(e),participant:this.appPeersManager.getInputPeerById(t)}).then((e=>(this.appUsersManager.saveApiUsers(e.users),e.participant)))}getChannelFull(e,t){const a=e.toPeerId(!0);return void 0!==this.chatsFull[e]&&!t&&Date.now(){this.appChatsManager.saveApiChats(t.chats,!0),this.appUsersManager.saveApiUsers(t.users);const s=t.full_chat;return s&&s.chat_photo.id&&(s.chat_photo=this.appPhotosManager.savePhoto(s.chat_photo,{type:"profilePhoto",peerId:a})),s.call&&this.appGroupCallsManager.saveGroupCall(s.call,e),this.appNotificationsManager.savePeerSettings({peerId:a,settings:s.notify_settings}),this.chatsFull[e]=s,this.fullExpiration[a]=Date.now()+ha,this.rootScope.dispatchEvent("chat_full_update",e),s},processError:t=>{if("CHANNEL_PRIVATE"===t.type){const t=this.appChatsManager.getChat(e);this.apiUpdatesManager.processUpdateMessage({_:"updates",updates:[{_:"updateChannel",channel_id:e}],chats:["channelForbidden"===t._?t:{_:"channelForbidden",id:e,access_hash:t.access_hash,title:t.title,pFlags:t.pFlags}],users:[]})}throw t}})}getMentions(e,t,a){const s=e=>{"@"===t.charAt(0)&&(t=t.slice(1));const a=new ae.Z({ignoreCase:!0}),s=new Map;e.forEach((e=>{a.indexObject(e.id,this.appUsersManager.getUserSearchText(e.id)),s.set(e.id,e.rating)}));const n=Array.from(a.search(t));return n.sort(((e,t)=>s.get(t)-s.get(e))),n};let n;return n=this.appChatsManager.isChannel(e)?this.getChannelParticipants(e,{_:"channelParticipantsMentions",q:t,top_msg_id:(0,oe.Z)(a)},50,0).then((e=>e.participants.map((e=>(0,xe.Z)(e))))):e?Promise.resolve(this.getChatFull(e)).then((e=>e.participants.participants.map((e=>e.user_id.toPeerId())))):Promise.resolve([]),Promise.all([this.appUsersManager.getTopPeers("bots_inline").catch((()=>[])),n]).then((e=>{const t=e[0].concat(e[1].map((e=>({id:e,rating:0}))));return s(t)}))}invalidateChannelParticipants(e){this.apiManager.clearCache("channels.getParticipants",(t=>t.channel.channel_id===e)),this.refreshFullPeer(e.toPeerId(!0))}refreshFullPeer(e){if(e.isUser()){const t=e.toUserId();delete this.usersFull[t],this.rootScope.dispatchEvent("user_full_update",t)}else{const t=e.toChatId();delete this.chatsFull[t],this.rootScope.dispatchEvent("chat_full_update",t)}}updateProfile(e,t,a){return this.apiManager.invokeApi("account.updateProfile",{first_name:e,last_name:t,about:a}).then((e=>{if(this.appUsersManager.saveApiUser(e),void 0!==a){const t=e.id.toPeerId(),s=this.usersFull[e.id];s&&(s.about=a),this.rootScope.dispatchEvent("peer_bio_edit",t)}return this.getProfile(e.id,!0)}))}uploadProfilePhoto(e){return this.apiManager.invokeApi("photos.uploadProfilePhoto",{file:e}).then((e=>{const t=e.photo;if(!e.users.length){const a=t.sizes.find((e=>"photoStrippedSize"===e._));e.users.push(Object.assign(Object.assign({},this.appUsersManager.getSelf()),{photo:{_:"userProfilePhoto",dc_id:t.dc_id,photo_id:t.id,stripped_thumb:null==a?void 0:a.bytes,pFlags:{}}}))}this.appUsersManager.saveApiUsers(e.users);const a=this.appPeersManager.peerId;this.appPhotosManager.savePhoto(e.photo,{type:"profilePhoto",peerId:a});const s=a.toUserId();this.apiUpdatesManager.processLocalUpdate({_:"updateUser",user_id:s})}))}deletePhotos(e){return this.apiManager.invokeApiSingle("photos.deletePhotos",{id:e.map((e=>kt(this.appPhotosManager.getPhoto(e))))}).then((e=>{}))}verifyParticipantForOnlineCount(e){const t=this.appUsersManager.getUser(e.user_id);return!(!t||!t.status||"userStatusOnline"!==t.status._)}reduceParticipantsForOnlineCount(e){return e.reduce(((e,t)=>e+ +this.verifyParticipantForOnlineCount(t)),0)}getOnlines(e){var t;return ga(this,void 0,void 0,(function*(){if(this.appChatsManager.isBroadcast(e))return 1;const a=yield this.getChatFull(e);if(this.appChatsManager.isMegagroup(e)){if(a.participants_count<=100){const t=yield this.getChannelParticipants(e,{_:"channelParticipantsRecent"},100);return this.reduceParticipantsForOnlineCount(t.participants)}const s=yield this.apiManager.invokeApiCacheable("messages.getOnlines",{peer:this.appChatsManager.getChannelInputPeer(e)},{cacheSeconds:60});return null!==(t=s.onlines)&&void 0!==t?t:1}const s=a.participants;return(null==s?void 0:s.participants)?this.reduceParticipantsForOnlineCount(s.participants):1}))}getTypingsKey(e,t){return e+(t?`_${t}`:"")}getPeerTypings(e,t){return this.typingsInPeer[this.getTypingsKey(e,t)]}}function ya(e,t){return e.some((e=>e instanceof Promise))?Promise.all(e).then(t):t(e)}var _a=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};const va=["static_icon","appear_animation","select_animation","activate_animation","effect_animation","around_animation","center_icon"],Pa={type:"reactions"};class ba extends G{after(){this.rootScope.addEventListener("language_change",(()=>{this.availableReactions=void 0,this.getAvailableReactions()})),this.sendReactionPromises=new Map,this.lastSendingTimes=new Map,this.rootScope.addEventListener("user_auth",(()=>{setTimeout((()=>{Promise.resolve(this.getAvailableReactions()).then((e=>_a(this,void 0,void 0,(function*(){for(const t of e)yield Promise.all([t.around_animation&&this.apiFileManager.downloadMedia({media:t.around_animation}),t.static_icon&&this.apiFileManager.downloadMedia({media:t.static_icon}),t.appear_animation&&this.apiFileManager.downloadMedia({media:t.appear_animation}),t.center_icon&&this.apiFileManager.downloadMedia({media:t.center_icon})]),yield(0,P.Z)(1e3)}))))}),7500)}))}getAvailableReactions(){return this.availableReactions?this.availableReactions:this.apiManager.invokeApiSingleProcess({method:"messages.getAvailableReactions",processResult:e=>{(0,ue.Z)(e);const t=this.availableReactions=e.reactions;for(const e of t)for(const t of va)e[t]&&(e[t]=this.appDocsManager.saveDoc(e[t],Pa));return t},params:{hash:0}})}getActiveAvailableReactions(){return(0,q.Z)(this.getAvailableReactions(),(e=>e.filter((e=>!e.pFlags.inactive))))}getAvailableReactionsForPeer(e){const t=this.getActiveAvailableReactions();return e.isUser()?this.unshiftQuickReaction(t):ya([t,this.appProfileManager.getChatFull(e.toChatId()),this.getQuickReaction()],(([e,t,a])=>{var s;const n=null!==(s=t.available_reactions)&&void 0!==s?s:{_:"chatReactionsNone"};let i=[];return"chatReactionsAll"===n._?i=e:"chatReactionsSome"===n._&&(i=n.reactions.map((t=>e.find((e=>e.reaction===t.emoticon)))).filter(Boolean)),this.unshiftQuickReactionInner(i,a)}))}unshiftQuickReactionInner(e,t){if(t&&"reactionEmoji"!==t._&&"availableReaction"!==t._)return e;const a=t.emoticon||t.reaction,s=(0,Pe.Z)(e,(e=>e.reaction===a));return s&&e.unshift(s),e}unshiftQuickReaction(e,t=this.getQuickReaction()){return ya([e,t],(([e,t])=>this.unshiftQuickReactionInner(e,t)))}getAvailableReactionsByMessage(e){var t;if(!e)return[];const a=(null===(t=e.fwd_from)||void 0===t?void 0:t.channel_post)&&this.appPeersManager.isMegagroup(e.peerId)&&e.fwdFromId||e.peerId;return this.getAvailableReactionsForPeer(a)}isReactionActive(e){return!!this.availableReactions&&!!this.availableReactions.find((t=>t.reaction===e))}getQuickReaction(){return ya([this.apiManager.getConfig(),this.getAvailableReactions()],(([e,t])=>{const a=e.reactions_default;return"reactionEmoji"===(null==a?void 0:a._)?t.find((e=>e.reaction===a.emoticon)):a}))}getReactionCached(e){return this.availableReactions.find((t=>t.reaction===e))}getReaction(e){return(0,q.Z)(this.getAvailableReactions(),(()=>this.getReactionCached(e)))}getMessagesReactions(e,t){return this.apiManager.invokeApiSingleProcess({method:"messages.getMessagesReactions",params:{id:t.map((e=>(0,oe.Z)(e))),peer:this.appPeersManager.getInputPeerById(e)},processResult:e=>{this.apiUpdatesManager.processUpdateMessage(e)}})}getMessageReactionsList(e,t,a,s,n){return this.apiManager.invokeApiSingleProcess({method:"messages.getMessageReactionsList",params:{peer:this.appPeersManager.getInputPeerById(e),id:(0,oe.Z)(t),limit:a,reaction:s,offset:n},processResult:e=>(this.appUsersManager.saveApiUsers(e.users),e)})}setDefaultReaction(e){return this.apiManager.invokeApi("messages.setDefaultReaction",{reaction:e}).then((t=>_a(this,void 0,void 0,(function*(){if(t){const t=yield this.apiManager.getConfig();t&&(t.reactions_default=e),this.rootScope.dispatchEvent("quick_reaction",e)}return t}))))}sendReaction(e,t,a){var s,n;return _a(this,void 0,void 0,(function*(){"availableReaction"===t._&&(t={_:"reactionEmoji",emoticon:t.reaction});const i=yield this.apiManager.getLimit("reactions"),r=e.peerId+"_"+e.mid;if(this.lastSendingTimes.get(r))return;this.lastSendingTimes.set(r,Date.now()),setTimeout((()=>{this.lastSendingTimes.delete(r)}),333);const{peerId:o,mid:p}=e,d=this.appPeersManager.peerId,f=e=>{--e.count,delete e.chosen_order,(0,Jt.Z)(t,e.reaction)&&(t=void 0),e.count||(0,M.Z)(l.results,e),l.recent_reactions&&(0,Pe.Z)(l.recent_reactions,(t=>(0,Jt.Z)(t.reaction,e.reaction)&&this.appPeersManager.getPeerId(t.peer_id)===d)),l.results.length||(l=void 0)},c=(null===(n=null===(s=e.reactions)||void 0===s?void 0:s.pFlags)||void 0===n?void 0:n.can_see_list)||!this.appPeersManager.isBroadcast(e.peerId)||e.peerId.isUser();e.reactions||(e.reactions={_:"messageReactions",results:[],recent_reactions:c?[]:void 0,pFlags:{can_see_list:c||void 0}});let l=a?e.reactions:(0,ve.Z)(e.reactions);const m=l.results.filter((e=>void 0!==e.chosen_order));m.sort(((e,t)=>t.chosen_order-e.chosen_order));const g=[],h=m.findIndex((e=>(0,Jt.Z)(e.reaction,t)));-1!==h&&g.push(...m.splice(h,1)),g.push(...m.splice(i-+(-1===h))),g.forEach((e=>{m.forEach((t=>{t.chosen_order>e.chosen_order&&--t.chosen_order})),f(e)}));const u=m.length;if(m.forEach(((e,t)=>{e.chosen_order=u-1-t})),t){l||(l={_:"messageReactions",results:[],pFlags:{}},c&&(l.pFlags.can_see_list=!0));let e=l.results.findIndex((e=>(0,Jt.Z)(e.reaction,t))),a=-1!==e&&l.results[e];if(a||(a={_:"reactionCount",count:0,reaction:t},e=l.results.push(a)-1),++a.count,a.chosen_order=m.length?m[0].chosen_order+1:0,m.unshift(a),!l.recent_reactions&&c&&(l.recent_reactions=[]),l.recent_reactions){const e={_:"messagePeerReaction",reaction:t,peer_id:this.appPeersManager.getOutputPeer(d),pFlags:{}};this.appPeersManager.isMegagroup(o),l.recent_reactions.unshift(e),l.recent_reactions=l.recent_reactions.slice(0,3)}}const y=this.availableReactions;if(l&&(null==y?void 0:y.length)){const e=new Map;y.forEach(((t,a)=>{e.set(t.reaction,a)})),l.results.sort(((t,a)=>{var s,n;const i=t.reaction.document_id||t.reaction.emoticon,r=a.reaction.document_id||a.reaction.emoticon;return a.count-t.count||(null!==(s=e.get(i))&&void 0!==s?s:0)-(null!==(n=e.get(r))&&void 0!==n?n:0)}))}if(a)return e.reactions=l,this.rootScope.dispatchEvent("messages_reactions",[{message:e,changedResults:[]}]),Promise.resolve();this.apiUpdatesManager.processLocalUpdate({_:"updateMessageReactions",peer:e.peer_id,msg_id:e.id,reactions:l,local:!0});const _=[o,p].join("-"),v=(0,oe.Z)(p),P=this.apiManager.invokeApi("messages.sendReaction",{peer:this.appPeersManager.getInputPeerById(o),msg_id:v,reaction:m.map((e=>e.reaction))}).then((e=>{(0,ue.Z)(e);const t=e.updates.findIndex((e=>"updateEditMessage"===e._||"updateEditChannelMessage"===e._));if(-1!==t){const a=e.updates[t];e.updates[t]={_:"updateMessageReactions",msg_id:v,peer:this.appPeersManager.getOutputPeer(o),reactions:a.message.reactions,pts:a.pts,pts_count:a.pts_count}}this.apiUpdatesManager.processUpdateMessage(e)})).catch((t=>{var a;"REACTION_INVALID"===t.type&&this.sendReactionPromises.get(_)===P&&this.sendReaction(e,null===(a=m[0])||void 0===a?void 0:a.reaction,!0)})).finally((()=>{this.sendReactionPromises.get(_)===P&&this.sendReactionPromises.delete(_)}));return this.sendReactionPromises.set(_,P),P}))}}var Ma=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};const Sa={EMOJI:"inputStickerSetAnimatedEmoji",EMOJI_ANIMATIONS:"inputStickerSetAnimatedEmojiAnimations",PREMIUM_GIFTS:"inputStickerSetPremiumGifts",GENERIC_ANIMATIONS:"inputStickerSetEmojiGenericAnimations",DEFAULT_STATUSES:"inputStickerSetEmojiDefaultStatuses",DEFAULT_TOPIC_ICONS:"inputStickerSetEmojiDefaultTopicIcons"},Ia=new Set(Object.values(Sa));class Ca extends G{constructor(){super(...arguments),this.storage=new W.Z(H.Z,"stickerSets"),this.clear=e=>{this.getStickerSetPromises={},this.getStickersByEmoticonsPromises={},this.sounds={},this.names={}},this.processAllStickersResult=e=>((0,ue.Z)(e),(0,ne.Z)(e.sets,((e,t,a)=>{e.pFlags.videos&&!i().IS_WEBM_SUPPORTED&&a.splice(t,1)})),e)}after(){this.clear(!0),this.rootScope.addEventListener("user_auth",(()=>{var e;setTimeout((()=>{this.getAnimatedEmojiStickerSet()}),1e3),this.getGreetingStickersPromise||null!==(e=this.getGreetingStickersTimeout)&&void 0!==e||(this.getGreetingStickersTimeout=T.Z.setTimeout((()=>{this.getGreetingStickersTimeout=void 0,this.getGreetingSticker(!0)}),5e3))})),this.rootScope.addEventListener("app_config",(()=>this.onStickersUpdated("faved",!0))),this.apiUpdatesManager.addMultipleEventsListeners({updateNewStickerSet:e=>{const t=e.stickerset;this.saveStickerSet(t,t.set.id),this.rootScope.dispatchEvent("stickers_installed",t.set)},updateRecentStickers:()=>this.onStickersUpdated("recent",!0),updateFavedStickers:()=>this.onStickersUpdated("faved",!0),updateMoveStickerSetToTop:e=>{this.rootScope.dispatchEvent("stickers_top",e.stickerset)},updateStickerSetsOrder:e=>{this.rootScope.dispatchEvent("stickers_order",{type:e.pFlags.emojis?"emojis":e.pFlags.masks?"masks":"stickers",order:e.order})}})}onStickersUpdated(e,t){return Ma(this,void 0,void 0,(function*(){const a=yield"faved"===e?this.getFavedStickersStickers(t):this.getRecentStickersStickers(t);this.rootScope.dispatchEvent("stickers_updated",{type:e,stickers:a})}))}getGreetingSticker(e=!1){return this.getGreetingStickersTimeout&&(clearTimeout(this.getGreetingStickersTimeout),this.getGreetingStickersTimeout=void 0),this.getGreetingStickersPromise||(this.getGreetingStickersPromise=this.getStickersByEmoticon("👋⭐️",!1).then((e=>{if(!e.length)throw"NO_STICKERS";this.greetingStickers=e.slice(),this.greetingStickers.sort(((e,t)=>Math.random()-Math.random()))}))),this.getGreetingStickersPromise.then((()=>{let t;return e||(t=this.greetingStickers.shift(),this.greetingStickers.push(t)),this.apiFileManager.downloadMedia({media:this.greetingStickers[0]}),t}))}saveStickers(e){(0,ne.Z)(e,((t,a)=>{(t=this.appDocsManager.saveDoc(t))?e[a]=t:e.splice(a,1)}))}canUseStickerSetCache(e,t){var a;return e&&(null===(a=e.documents)||void 0===a?void 0:a.length)&&(Date.now()-e.refreshTime<36e5||t)}getStickerSet(e,t={}){let{id:a}=e;if(e.access_hash||(e=this.names[a]||e,a=e.id),this.getStickerSetPromises[a])return this.getStickerSetPromises[a];if(!t.overwrite){const e=this.storage.getFromCache(a);if(this.canUseStickerSetCache(e,t.useCache))return e}const s=this.getStickerSetPromises[a]=new Promise((n=>Ma(this,void 0,void 0,(function*(){if(!t.overwrite){const e=yield this.storage.get(a);if(this.canUseStickerSetCache(e,t.useCache))return this.saveStickers(e.documents),n(e),void(this.getStickerSetPromises[a]===s&&delete this.getStickerSetPromises[a])}try{const s=yield this.apiManager.invokeApi("messages.getStickerSet",{stickerset:this.getStickerSetInput(e),hash:0}),i=t.saveById?a:s.set.id;this.saveStickerSet(s,i),n(s)}catch(e){n(null)}this.getStickerSetPromises[a]===s&&delete this.getStickerSetPromises[a]}))));return s}getLocalStickerSet(e){return this.getStickerSet({id:e},{saveById:!0})}getAnimatedEmojiStickerSet(){return Promise.all([this.getLocalStickerSet(Sa.EMOJI),this.getLocalStickerSet(Sa.EMOJI_ANIMATIONS),this.getAnimatedEmojiSounds()]).then((([e,t])=>({emoji:e,animations:t})))}getAnimatedEmojiSounds(e){if(this.getAnimatedEmojiSoundsPromise&&!e)return this.getAnimatedEmojiSoundsPromise;const t=this.getAnimatedEmojiSoundsPromise=Promise.all([this.apiManager.getAppConfig(e),this.apiManager.getConfig()]).then((([e,a])=>{if(this.getAnimatedEmojiSoundsPromise===t)for(const t in e.emojies_sounds){const s=e.emojies_sounds[t],n=atob(s.file_reference_base64.replace(/-/g,"+").replace(/_/g,"/")),i=new Uint8Array(n.length);for(let e=0,t=i.length;e((0,ue.Z)(e),this.recentStickers=e.stickers,this.saveStickers(e.stickers),e),overwrite:e})}))}getRecentStickersStickers(e){if(e)this.recentStickers=void 0;else if(this.recentStickers)return this.recentStickers;return this.getRecentStickers(e).then((()=>this.recentStickers))}saveRecentSticker(e,t,a){const s=this.appDocsManager.getDoc(e);if((0,Pe.Z)(this.recentStickers,(t=>t.id===e)),!t){this.recentStickers.unshift(s);const e=(0,bt.Z)(s.stickerEmojiRaw);for(const t in this.getStickersByEmoticonsPromises)this.getStickersByEmoticonsPromises[t].then((a=>{const n=(0,Pe.Z)(a,(e=>e.id===s.id));n?a.unshift(n):t.includes(e)&&a.unshift(s)}))}return this.rootScope.dispatchEvent("sticker_updated",{type:"recent",faved:!t,document:s}),t&&this.onStickersUpdated("recent",!1),this.apiManager.invokeApi("messages.saveRecentSticker",{id:Kt(s),unsave:t,attached:a})}cleanEmoji(e){return e.replace(/\ufe0f/g,"").replace(/🏻|🏼|🏽|🏾|🏿/g,"")}getAnimatedEmojiSticker(e,t){const a=t?Sa.EMOJI_ANIMATIONS:Sa.EMOJI,s=this.storage.getFromCache(a);if(!(null==s?void 0:s.documents))return;t&&["🧡","💛","💚","💙","💜","🖤","🤍","🤎"].includes(e)&&(e="❤️"),e=this.cleanEmoji(e);const n=s.packs.find((t=>t.emoticon===e));return n?this.appDocsManager.getDoc(n.documents[0]):void 0}getAnimatedEmojiSoundDocument(e){return this.sounds[this.cleanEmoji(e)]}preloadAnimatedEmojiSticker(e){const t=this.getAnimatedEmojiStickerSet().then((()=>this.getAnimatedEmojiSticker(e)));return Promise.all([t,this.preloadAnimatedEmojiStickerAnimation(e)]).then((([e,t])=>({doc:e,animation:null==t?void 0:t.doc,sound:null==t?void 0:t.sound})))}preloadAnimatedEmojiStickerAnimation(e){return this.getAnimatedEmojiStickerSet().then((()=>this.getAnimatedEmojiSticker(e,!0))).then((t=>{if(!t)return;const a=this.getAnimatedEmojiSoundDocument(e);return Promise.all([this.preloadSticker(t.id),a?this.preloadSticker(a.id):void 0]).then((()=>({doc:t,sound:a})))}))}preloadSticker(e,t){var a;const s=this.appDocsManager.getDoc(e);return this.apiFileManager.downloadMedia({media:s,thumb:t?null===(a=s.video_thumbs)||void 0===a?void 0:a[0]:void 0})}saveStickerSet(e,t){const a={_:"messages.stickerSet",set:e.set,packs:e.packs,documents:e.documents,keywords:e.keywords};let s=this.storage.getFromCache(t);s?Object.assign(s,a):s=this.storage.setToCache(t,a),s.set.short_name&&(this.names[s.set.short_name]=this.getStickerSetInput(a.set)),this.saveStickers(e.documents);const n=s.set.installed_date||Ia.has(t);s.refreshTime=Date.now(),this.storage.set({[t]:s},!n)}getStickerSetThumbDownloadOptions(e){var t;const a=e.thumbs.find((e=>"photoSize"===e._)),s=e.thumb_dc_id,n=null===(t=e.pFlags)||void 0===t?void 0:t.animated;return{dcId:s,location:{_:"inputStickerSetThumb",stickerset:this.getStickerSetInput(e),thumb_version:e.thumb_version},size:a.size,mimeType:n?"application/x-tgsticker":"image/webp"}}getStickerSetInput(e){return Ia.has(e.id)?{_:e.id}:e.access_hash?{_:"inputStickerSetID",id:e.id,access_hash:e.access_hash}:{_:"inputStickerSetShortName",short_name:""+e.id}}getFeaturedStickers(){return Ma(this,void 0,void 0,(function*(){return(yield this.apiManager.invokeApiHashable({method:"messages.getFeaturedStickers",processResult:e=>((0,ue.Z)(e),(0,ne.Z)(e.sets,((e,t,a)=>{e.set.pFlags.videos&&!i().IS_WEBM_SUPPORTED&&a.splice(t,1)})),e.sets.forEach((e=>{this.saveStickerSet({set:e.set,documents:[],packs:[],keywords:[]},e.set.id)})),e)})).sets}))}getPromoPremiumStickers(){return this.getStickersByEmoticon("⭐️⭐️",!1)}getPremiumStickers(){return this.getStickersByEmoticon("📂⭐️",!1)}getFavedStickers(e){return this.apiManager.invokeApiHashable({method:"messages.getFavedStickers",processResult:e=>((0,ue.Z)(e),this.saveStickers(e.stickers),this.favedStickers=e.stickers,e),overwrite:e})}getFavedStickersStickers(e){if(e)this.favedStickers=void 0;else if(this.favedStickers)return this.favedStickers;return this.getFavedStickers(e).then((()=>this.favedStickers))}getFavedStickersLimit(){return this.apiManager.getLimit("favedStickers")}faveSticker(e,t){return Ma(this,void 0,void 0,(function*(){this.favedStickers||(yield this.getFavedStickersStickers());const a=yield this.getFavedStickersLimit(),s=this.appDocsManager.getDoc(e);return(0,Pe.Z)(this.favedStickers,(e=>e.id===s.id)),t||(this.favedStickers.unshift(s),this.favedStickers.splice(a,this.favedStickers.length-a)),this.rootScope.dispatchEvent("sticker_updated",{type:"faved",faved:!t,document:s}),this.apiManager.invokeApi("messages.faveSticker",{id:Kt(s),unfave:t}).then((()=>{t&&this.onStickersUpdated("faved",!0)}))}))}toggleStickerSet(e){return Ma(this,void 0,void 0,(function*(){if((e=this.storage.getFromCache(e.id).set).installed_date){if(yield this.apiManager.invokeApi("messages.uninstallStickerSet",{stickerset:this.getStickerSetInput(e)}))return delete e.installed_date,this.rootScope.dispatchEvent("stickers_deleted",e),this.storage.delete(e.id,!0),!0}else if(yield this.apiManager.invokeApi("messages.installStickerSet",{stickerset:this.getStickerSetInput(e),archived:!1}))return e.installed_date=(0,te.Z)(!0),this.rootScope.dispatchEvent("stickers_installed",e),!0;return!1}))}toggleStickerSets(e){return Promise.all(e.map((e=>this.toggleStickerSet(e))))}searchStickerSets(e,t=!0){return Ma(this,void 0,void 0,(function*(){const a=t?1:0,s=yield this.apiManager.invokeApiHashable({method:"messages.searchStickerSets",params:{flags:a,exclude_featured:t||void 0,q:e},processResult:e=>((0,ue.Z)(e),(0,ne.Z)(e.sets,((e,t,a)=>{e.set.pFlags.videos&&!i().IS_WEBM_SUPPORTED&&a.splice(t,1)})),e.sets.forEach((e=>{this.saveStickerSet({set:e.set,documents:[],packs:[],keywords:[]},e.set.id)})),e)}),n=[],r=this.storage.getCache();for(const t in r){const{set:a}=r[t];a.title.toLowerCase().includes(e.toLowerCase())&&!s.sets.find((e=>e.set.id===a.id))&&n.push({_:"stickerSetCovered",set:a,cover:null})}return s.sets.concat(n)}))}getAllStickers(){return this.apiManager.invokeApiHashable({method:"messages.getAllStickers",processResult:this.processAllStickersResult})}getEmojiStickers(){return this.apiManager.invokeApiHashable({method:"messages.getEmojiStickers",processResult:this.processAllStickersResult})}preloadStickerSets(){return this.getAllStickers().then((e=>{const t=e.sets;return Promise.all(t.map((e=>this.getStickerSet(e,{useCache:!0}))))}))}getStickersByEmoticon(e,t=!0,a=!0){const s=(e=(0,bt.Z)(e))+(t?"1":"0")+(a?"1":"0");return this.getStickersByEmoticonsPromises[s]?this.getStickersByEmoticonsPromises[s]:this.getStickersByEmoticonsPromises[s]=Promise.all([a?this.apiManager.invokeApiHashable({method:"messages.getStickers",params:{emoticon:e},processResult:e=>e}):void 0,t?this.preloadStickerSets():[],t?this.getRecentStickers():void 0]).then((([t,a,s])=>{const n=t?t.stickers.map((e=>this.appDocsManager.saveDoc(e))):[],r=[],o=[],p=t=>{for(const a of t)if((0,bt.Z)(a.emoticon).includes(e))for(const e of a.documents){const t=this.appDocsManager.getDoc(e);(t.animated?r:o).push(t)}};if(s){p(s.packs);const e=s.stickers;[r,o].forEach((t=>{t.sort(((t,a)=>e.indexOf(t)-e.indexOf(a)))}))}for(const e of a)p(e.packs);const d=[...new Set(r.concat(o,n))];return(0,ne.Z)(d,((e,t,a)=>{(3===e.sticker&&!i().IS_WEBM_SUPPORTED||!this.rootScope.premium&&(0,zt.Z)(e))&&a.splice(t,1)})),d}))}clearRecentStickers(){return this.recentStickers&&(this.recentStickers.length=0,this.onStickersUpdated("recent",!1)),this.apiManager.invokeApi("messages.clearRecentStickers")}reorderStickerSets(e,t,a){return this.apiManager.invokeApi("messages.reorderStickerSets",{emojis:t,masks:a,order:e}).then((()=>{this.apiUpdatesManager.processLocalUpdate({_:"updateStickerSetsOrder",order:e,pFlags:{emojis:t||void 0,masks:a||void 0}})}))}}var ka=a(467),wa=a(8493);class Aa extends G{constructor(){super(...arguments),this.clear=(e=!1)=>{if(e)this.users={},this.usernames={};else for(const e in this.users){if(!e)continue;const t=e.toPeerId();if(!this.peersStorage.isPeerNeeded(t)){const t=this.users[e];this.modifyUsernamesCache(t,!1),this.storage.delete(e),delete this.users[e]}}this.getTopPeersPromises={},this.contactsIndex=this.createSearchIndex(),this.contactsFillPromise=void 0,this.contactsList=new Set,this.updatedContactsList=!1},this.updateUsersStatuses=()=>{const e=(0,te.Z)(!0);for(const t in this.users){const a=this.users[t];this.updateUserStatus(a,e)}}}after(){return this.clear(!0),setInterval(this.updateUsersStatuses,6e4),this.rootScope.addEventListener("state_synchronized",this.updateUsersStatuses),this.apiUpdatesManager.addMultipleEventsListeners({updateUserStatus:e=>{const t=e.user_id,a=this.users[t];a&&(a.status=e.status,a.status&&("expires"in a.status&&(a.status.expires-=this.timeManager.getServerTimeOffset()),"was_online"in a.status&&(a.status.was_online-=this.timeManager.getServerTimeOffset())),this.rootScope.dispatchEvent("user_update",t),this.setUserToStateIfNeeded(a))},updateUserName:e=>{const t=e.user_id,a=this.users[t];a&&(this.forceUserOnline(t),this.saveApiUser(Object.assign(Object.assign({},a),{first_name:e.first_name,last_name:e.last_name,username:void 0,usernames:e.usernames}),!0))}}),this.rootScope.addEventListener("language_change",(e=>{const t=this.getSelf().id;this.contactsIndex.indexObject(t,this.getUserSearchText(t))})),Promise.all([this.appStateManager.getState(),this.appStoragesManager.loadStorage("users")]).then((([e,{results:t,storage:a}])=>{this.storage=a,this.saveApiUsers(t);for(let a=0,s=t.length;a{if(!this.appPeersManager.isUser(e))return;const t=e.toUserId();this.storage.getFromCache(t)||this.storage.set({[t]:this.getUser(t)})})),this.peersStorage.addEventListener("peerUnneeded",(e=>{if(!this.appPeersManager.isUser(e))return;const t=e.toUserId();this.storage.getFromCache(t)&&this.storage.delete(t)}))}))}get userId(){return this.rootScope.myId.toUserId()}onContactsModified(e){e&&this.appStateManager.pushToState("contactsListCachedTime",(0,te.Z)(!0))}pushRecentSearch(e){return this.appStateManager.getState().then((t=>{const a=t.recentSearch||[];if(a[0]!==e){(0,M.Z)(a,e),a.unshift(e),a.length>20&&(a.length=20),this.appStateManager.pushToState("recentSearch",a);for(const e of a)this.peersStorage.requestPeer(e,"recentSearch")}}))}clearRecentSearch(){return this.appStateManager.getState().then((e=>{const t=e.recentSearch||[];for(const e of t)this.peersStorage.releasePeer(e,"recentSearch");t.length=0,this.appStateManager.pushToState("recentSearch",t)}))}fillContacts(){var e;if(this.contactsFillPromise&&this.updatedContactsList)return{cached:this.contactsFillPromise.isFulfilled,promise:this.contactsFillPromise};this.updatedContactsList=!0;const t=(0,v.Z)();return this.apiManager.invokeApi("contacts.getContacts").then((e=>{"contacts.contacts"===e._&&(this.contactsList.clear(),this.saveApiUsers(e.users),e.contacts.forEach((e=>{this.pushContact(e.user_id)})),this.onContactsModified(!0),this.contactsFillPromise=t),t.resolve(this.contactsList)}),(()=>{this.updatedContactsList=!1})),{cached:null===(e=this.contactsFillPromise)||void 0===e?void 0:e.isFulfilled,promise:this.contactsFillPromise||(this.contactsFillPromise=t)}}resolveUsername(e){"@"===e[0]&&(e=e.slice(1)),e=e.toLowerCase();const t=this.usernames[e];return t?this.appPeersManager.getPeer(t):this.apiManager.invokeApiSingleProcess({method:"contacts.resolveUsername",params:{username:e},processResult:e=>this.processResolvedPeer(e)})}processResolvedPeer(e){return this.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats),this.appPeersManager.getPeer((0,le.Z)(e.peer))}resolvePhone(e){return this.apiManager.invokeApi("contacts.resolvePhone",{phone:e}).then((e=>this.processResolvedPeer(e)))}pushContact(e){this.contactsList.add(e),this.contactsIndex.indexObject(e,this.getUserSearchText(e)),this.peersStorage.requestPeer(e.toPeerId(),"contact")}popContact(e){this.contactsList.delete(e),this.contactsIndex.indexObject(e,""),this.peersStorage.releasePeer(e.toPeerId(),"contact")}getUserSearchText(e){const t=this.users[e];return t?[t.first_name,t.last_name,t.phone,...(0,$t.Z)(t),t.pFlags.self?"Saved Messages":""].filter(Boolean).join(" "):""}getContacts(e,t=!1,a="name"){return this.fillContacts().promise.then((s=>{let n=[...s];if(e){const t=this.contactsIndex.search(e);n=[...n].filter((e=>t.has(e)))}"name"===a?n.sort(((e,t)=>{const a=(this.users[e]||{}).sortName||"",s=(this.users[t]||{}).sortName||"";return a.localeCompare(s)})):"online"===a&&n.sort(((e,t)=>{const a=this.getUserStatusForSort(this.getUser(e).status);return this.getUserStatusForSort(this.getUser(t).status)-a}));const i=this.userId;return(0,M.Z)(n,i),t&&this.testSelfSearch(e)&&n.unshift(i),n}))}getContactsPeerIds(e,t,a,s){return this.getContacts(e,t,a).then((e=>{const t=e.map((e=>e.toPeerId(!1)));return s?t.slice(0,s):t}))}toggleBlock(e,t){return this.apiManager.invokeApiSingle(t?"contacts.block":"contacts.unblock",{id:this.appPeersManager.getInputPeerById(e)}).then((a=>(a&&this.apiUpdatesManager.processLocalUpdate({_:"updatePeerBlocked",peer_id:this.appPeersManager.getOutputPeer(e),blocked:t}),a)))}testSelfSearch(e){const t=this.getSelf(),a=this.createSearchIndex();return a.indexObject(t.id,this.getUserSearchText(t.id)),a.search(e).has(t.id)}createSearchIndex(){return new ae.Z({clearBadChars:!0,ignoreCase:!0,latinize:!0,includeTag:!0})}saveApiUsers(e,t){e.saved||(e.saved=!0,e.forEach((e=>this.saveApiUser(e,t))))}modifyUsernamesCache(e,t){const a=(0,$t.Z)(e);if(!a.length)return;const s=a.map((e=>function(e){return e&&e.toLowerCase()||""}(e)));t?s.forEach((t=>{this.usernames[t]=e.id.toPeerId("user"!==e._)})):s.forEach((e=>{delete this.usernames[e]}))}setUsernameToCache(e,t){return!(t&&t.username===e.username&&(0,Y.Z)(t.usernames,e.usernames)||(this.modifyUsernamesCache(t,!1),this.modifyUsernamesCache(e,!0),0))}saveApiUser(e,t){var a,s,n,i;if(!e||"userEmpty"===e._)return;const r=e.id,o=this.users[r];if(null!==(a=e.pFlags)&&void 0!==a||(e.pFlags={}),e.pFlags.min&&void 0!==o)return;const p=this.setUsernameToCache(e,o);if(o&&void 0!==o.sortName&&o.first_name===e.first_name&&o.last_name===e.last_name)e.sortName=o.sortName;else{const t=e.first_name+(e.last_name?" "+e.last_name:"");e.sortName=e.pFlags.deleted?"":(0,ka.ZP)(t,!1)}if(e.status&&(e.status.expires&&(e.status.expires-=this.timeManager.getServerTimeOffset()),e.status.was_online&&(e.status.was_online-=this.timeManager.getServerTimeOffset())),"userProfilePhotoEmpty"===(null===(s=e.photo)||void 0===s?void 0:s._)&&delete e.photo,void 0===o)this.users[r]=e;else{const t=e.first_name!==o.first_name||e.last_name!==o.last_name||p,a=(null===(n=o.photo)||void 0===n?void 0:n.photo_id)!==(null===(i=e.photo)||void 0===i?void 0:i.photo_id),s=o.pFlags.premium!==e.pFlags.premium||o.pFlags.verified!==e.pFlags.verified||o.pFlags.scam!==e.pFlags.scam||o.pFlags.fake!==e.pFlags.fake,d=!!o.pFlags.contact,f=!!e.pFlags.contact;re(o,e),this.rootScope.dispatchEvent("user_update",r),d!==f&&this.onContactUpdated(r,f,d),a&&this.rootScope.dispatchEvent("avatar_update",{peerId:e.id.toPeerId()}),(t||s)&&this.rootScope.dispatchEvent("peer_title_edit",{peerId:e.id.toPeerId()})}this.checkPremium(e,o),this.setUserToStateIfNeeded(e)}checkPremium(e,t){if(e.pFlags.self){const a=!!e.pFlags.premium;this.rootScope.premium!==a&&this.rootScope.dispatchEvent("premium_toggle_private",{isNew:!t,isPremium:a})}}setUserToStateIfNeeded(e){this.peersStorage.isPeerNeeded(e.id.toPeerId())&&this.storage.set({[e.id]:e})}isUserOnlineVisible(e){return this.getUserStatusForSort(e)>3}getUserStatusForSort(e){if("object"!=typeof e){const t=this.getUser(e);e=null==t?void 0:t.status}if(e){const t="userStatusOnline"===e._?e.expires:"userStatusOffline"===e._?e.was_online:0;if(t)return t;switch(e._){case"userStatusRecently":return 3;case"userStatusLastWeek":return 2;case"userStatusLastMonth":return 1}}return 0}getUser(e){return(0,fe.Z)(e)?e:this.users[e]}getUserStatus(e){return this.isRegularUser(e)&&!this.users[e].pFlags.self&&this.users[e].status}getUserPhone(e){return t=this,a=void 0,n=function*(){const t=this.getUser(e);if(!(null==t?void 0:t.phone))return;const a=yield this.apiManager.getAppConfig();return{phone:t.phone,isAnonymous:a.fragment_prefixes.some((e=>t.phone.startsWith(e)))}},new((s=void 0)||(s=Promise))((function(e,i){function r(e){try{p(n.next(e))}catch(e){i(e)}}function o(e){try{p(n.throw(e))}catch(e){i(e)}}function p(t){var a;t.done?e(t.value):(a=t.value,a instanceof s?a:new s((function(e){e(a)}))).then(r,o)}p((n=n.apply(t,a||[])).next())}));var t,a,s,n}getSelf(){return this.getUser(this.userId)}isBot(e){return this.users[e]&&!!this.users[e].pFlags.bot}isAttachMenuBot(e){return this.isBot(e)&&!!this.users[e].pFlags.bot_attach_menu}isContact(e){return this.contactsList.has(e)||!(!this.users[e]||!this.users[e].pFlags.contact)}isRegularUser(e){const t=this.users[e];return t&&!this.isBot(e)&&!t.pFlags.deleted&&!t.pFlags.support}isNonContactUser(e){return this.isRegularUser(e)&&!this.isContact(e)&&e!==this.userId}hasUser(e,t){const a=this.users[e];return(0,fe.Z)(a)&&(t||!a.pFlags.min)}getUserString(e){const t=this.getUser(e);return"u"+e+(t.access_hash?"_"+t.access_hash:"")}getUserInput(e){const t=this.getUser(e);return t.pFlags&&t.pFlags.self?{_:"inputUserSelf"}:{_:"inputUser",user_id:e,access_hash:t.access_hash}}getUserInputPeer(e){return{_:"inputPeerUser",user_id:e,access_hash:this.getUser(e).access_hash}}getContactMediaInput(e){const t=this.getUser(e);return{_:"inputMediaContact",first_name:t.first_name,last_name:t.last_name,phone_number:t.phone,vcard:"",user_id:e}}updateUserStatus(e,t=(0,te.Z)(!0)){e.status&&"userStatusOnline"===e.status._&&e.status.expires=60)return}else if(this.apiUpdatesManager.updatesState.syncLoading)return;const s=this.getUser(e);!(null==s?void 0:s.status)||"userStatusOnline"===s.status._||"userStatusEmpty"===s.status._||s.pFlags.support||s.pFlags.deleted||(s.status={_:"userStatusOnline",expires:a+60},this.rootScope.dispatchEvent("user_update",e),this.setUserToStateIfNeeded(s))}importContact(e,t,a){return this.importContacts([{first_name:e,last_name:t,phones:[a]}]).then((e=>{if(!e.length){const e=new Error;throw e.type="NO_USER",e}return e[0]}))}importContacts(e){const t=[];for(let a=0;a(this.saveApiUsers(e.users),e.imported.map((e=>(this.onContactUpdated(e.user_id,!0),e.user_id))))))}getTopPeers(e){return this.getTopPeersPromises[e]?this.getTopPeersPromises[e]:this.getTopPeersPromises[e]=this.appStateManager.getState().then((t=>{const a=t.topPeersCache[e];return a&&a.cachedTime+864e5>Date.now()&&a.peers?a.peers:this.apiManager.invokeApi("contacts.getTopPeers",{[e]:!0,offset:0,limit:15,hash:"0"}).then((a=>{let s=[];return"contacts.topPeers"===a._&&(this.saveApiUsers(a.users),this.appChatsManager.saveApiChats(a.chats),a.categories.length&&(s=a.categories[0].peers.map((e=>{const t=(0,le.Z)(e.peer);return this.peersStorage.requestPeer(t,"topPeer"),{id:t,rating:e.rating}})))),t.topPeersCache[e]={peers:s,cachedTime:Date.now()},this.appStateManager.pushToState("topPeersCache",t.topPeersCache),s}))}))}getBlocked(e=0,t=0){return this.apiManager.invokeApiSingle("contacts.getBlocked",{offset:e,limit:t}).then((e=>(this.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats),{count:"contacts.blocked"===e._?e.users.length+e.chats.length:e.count,peerIds:e.users.map((e=>e.id.toPeerId())).concat(e.chats.map((e=>e.id.toPeerId(!0))))})))}getLocated(e,t,a,s=!1,n=0){const i={_:"inputGeoPoint",lat:e,long:t,accuracy_radius:a};return this.apiManager.invokeApi("contacts.getLocated",{geo_point:i,background:s}).then((e=>(this.apiUpdatesManager.processUpdateMessage(e),e)))}searchContacts(e,t=20){const a=(0,Nt.Z)(e);if(a.length&&a[0].length===e.trim().length&&"messageEntityUrl"===a[0]._)try{const t=new URL(qe(e).url).pathname.slice(1);t&&(e=t)}catch(e){}return this.apiManager.invokeApiCacheable("contacts.search",{q:e,limit:t},{cacheSeconds:60}).then((e=>(this.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats),{my_results:(0,ke.Z)(e.my_results.map((e=>(0,le.Z)(e)))),results:e.results.map((e=>(0,le.Z)(e)))})))}onContactUpdated(e,t,a=this.isContact(e)){t!==a&&(t?this.pushContact(e):this.popContact(e),this.onContactsModified(),this.rootScope.dispatchEvent("contacts_update",e))}updateUsername(e){return this.apiManager.invokeApi("account.updateUsername",{username:e}).then((e=>{this.saveApiUser(e)}))}setUserStatus(e,t){if(this.isBot(e))return;const a=this.users[e];if(a){const s=t?{_:"userStatusOffline",was_online:(0,te.Z)(!0)}:{_:"userStatusOnline",expires:(0,te.Z)(!0)+50};a.status=s,this.rootScope.dispatchEvent("user_update",e),this.setUserToStateIfNeeded(a)}}updateMyOnlineStatus(e){return this.setUserStatus(this.getSelf().id,e),this.apiManager.invokeApiSingle("account.updateStatus",{offline:e})}addContact(e,t,a,s,n){return this.apiManager.invokeApi("contacts.addContact",{id:this.getUserInput(e),first_name:t,last_name:a,phone:s,add_phone_privacy_exception:n}).then((t=>{this.apiUpdatesManager.processUpdateMessage(t,{override:!0}),this.onContactUpdated(e,!0)}))}deleteContacts(e){return this.apiManager.invokeApi("contacts.deleteContacts",{id:e.map((e=>this.getUserInput(e)))}).then((t=>{this.apiUpdatesManager.processUpdateMessage(t,{override:!0}),e.forEach((e=>{this.onContactUpdated(e,!1)}))}))}checkUsername(e){return this.apiManager.invokeApi("account.checkUsername",{username:e})}toggleUsername(e,t){return this.apiManager.invokeApi("account.toggleUsername",{username:e,active:t})}reorderUsernames(e){return this.apiManager.invokeApi("account.reorderUsernames",{order:e})}canSendToUser(e){return(0,wa.Z)(this.getUser(e))}getCommonChats(e,t=100,a){return this.apiManager.invokeApiSingleProcess({method:"messages.getCommonChats",params:{user_id:this.getUserInput(e),limit:t,max_id:null!=a?a:0},processResult:e=>(this.appChatsManager.saveApiChats(e.chats),e)})}}const Ua=new Set(["photo","video","gif","document"]);class Da extends G{constructor(){super(...arguments),this.webpages={},this.pendingWebPages={}}after(){this.apiUpdatesManager.addMultipleEventsListeners({updateWebPage:e=>{this.saveWebPage(e.webpage)}})}saveWebPage(e,t,a){var s,n;if("webPageNotModified"===e._||"webPageEmpty"===e._)return;const{id:i}=e,r=this.webpages[i],o=r&&r._===e._&&r.hash==r.hash;if("webPage"===e._){"photo"===(null===(s=e.photo)||void 0===s?void 0:s._)?e.photo=this.appPhotosManager.savePhoto(e.photo,a):delete e.photo,"document"===(null===(n=e.document)||void 0===n?void 0:n._)?e.document=this.appDocsManager.saveDoc(e.document,a):("document"===e.type&&delete e.type,delete e.document);const t=e.site_name,i=e.title||e.author||t||"";t&&i===t&&delete e.site_name,Ua.has(e.type)||e.description||!e.photo||(e.type="photo")}let p=this.pendingWebPages[i];if(t&&(p||(p=this.pendingWebPages[i]=new Set),p.add(t)),void 0===r?this.webpages[i]=e:re(r,e),!t&&void 0!==p&&o){const e=[];p.forEach((t=>{const[a,s,n]=t.split("_");e.push({peerId:a.toPeerId(),mid:+s,isScheduled:!!n})})),this.rootScope.dispatchEvent("webpage_updated",{id:i,msgs:e})}return e}getMessageKeyForPendingWebPage(e,t,a){return e+"_"+t+(a?"_s":"")}deleteWebPageFromPending(e,t){const a=e.id;if(!a)return;const s=this.pendingWebPages[a];s&&s.has(t)&&(s.delete(t),s.size||delete this.pendingWebPages[a])}getCachedWebPage(e){return this.webpages[e]}getWebPage(e){return this.apiManager.invokeApiHashable({method:"messages.getWebPage",processResult:e=>this.saveWebPage(e),params:{url:e}})}}var Ea=a(5936),Ta=a(3019);function Fa(e){return(0,Ta.Z)(e,"readAsArrayBuffer")}var Ra=a(1243),xa=a(7086);function Ba(e){return encodeURIComponent(e).replace(/['()]/g,escape).replace(/\*/g,"%2A")}class Va{constructor(e,t){this.serviceMessagePort=e,this.downloadId=t,this.serviceMessagePort=zs()}write(e,t){return a=this,s=void 0,i=function*(){return this.serviceMessagePort.invoke("downloadChunk",{id:this.downloadId,chunk:e})},new((n=void 0)||(n=Promise))((function(e,t){function r(e){try{p(i.next(e))}catch(e){t(e)}}function o(e){try{p(i.throw(e))}catch(e){t(e)}}function p(t){var a;t.done?e(t.value):(a=t.value,a instanceof n?a:new n((function(e){e(a)}))).then(r,o)}p((i=i.apply(a,s||[])).next())}));var a,s,n,i}finalize(e){return this.serviceMessagePort.invoke("downloadFinalize",this.downloadId).then((()=>{}))}}class Oa{getFile(e){return Promise.reject((0,X.Z)("NO_ENTRY_FOUND"))}prepareWriting({fileName:e,downloadId:t,size:a}){const s=Object.assign({"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+Ba(e)},a?{"Content-Length":a}:{}),n=zs(),i=n.invoke("download",{headers:s,id:t}),r=(0,v.Z)();return r.cancel=()=>{r.reject((0,X.Z)("DOWNLOAD_CANCELED"))},r.catch((()=>{zs().invoke("downloadCancel",t)})),i.then(r.resolve,r.reject),{deferred:r,getWriter:()=>new Va(n,t)}}}var La=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};const Na=131072,Za=new Set(["DOWNLOAD_CANCELED","UPLOAD_CANCELED","UNKNOWN","NO_NEW_CONTEXT"]);class ja extends G{constructor(){super(...arguments),this.cacheStorage=new Ea.Z("cachedFiles"),this.downloadStorage=new Oa,this.downloadPromises={},this.uploadPromises={},this.downloadPulls={},this.downloadActives={},this.refreshReferencePromises={},this.log=(0,S.kg)("AFM",S.v9.Error|S.v9.Log),this.tempId=0,this.queueId=0,this.debug=b.Z.debug,this.maxUploadParts=4e3,this.maxDownloadParts=8e3,this.uncompressTGS=(e,t)=>this.cryptoWorker.invokeCrypto("gzipUncompress",e.slice().buffer,!1),this.uncompressTGV=(e,t)=>{const a=e.slice().buffer;return i().IS_FIREFOX?this.cryptoWorker.invokeCrypto("gzipUncompress",a,!0).then((e=>function(e){const t=e.indexOf("/,` width="${n}" height="${i}">`).replace(/[^\x00-\x7F]/g,"")}(e))).then((e=>(new TextEncoder).encode(e))):this.cryptoWorker.invokeCrypto("gzipUncompress",a,!1)},this.convertWebp=(e,t)=>f.Z.getInstance().invoke("convertWebp",{fileName:t,bytes:e}),this.convertOpus=(e,t)=>f.Z.getInstance().invoke("convertOpus",{fileName:t,bytes:e})}after(){setInterval((()=>{for(const e in this.refreshReferencePromises){const{deferred:t}=this.refreshReferencePromises[e];(t.isFulfilled||t.isRejected)&&delete this.refreshReferencePromises[e]}}),18e5),this.rootScope.addEventListener("config",(e=>{this.webFileDcId=e.webfile_dc_id})),this.rootScope.addEventListener("app_config",(e=>{this.maxUploadParts=this.rootScope.premium?e.upload_max_fileparts_premium:e.upload_max_fileparts_default,this.maxDownloadParts=e.upload_max_fileparts_premium}))}downloadRequest(e,t,a,s,n=0){void 0===this.downloadPulls[e]&&(this.downloadPulls[e]=[],this.downloadActives[e]=0);const i=this.downloadPulls[e],r=new Promise(((e,r)=>{i.push({id:t,queueId:n,cb:a,deferred:{resolve:e,reject:r},activeDelta:s})}));return setTimeout((()=>{this.downloadCheck(e)}),0),r}downloadCheck(e){const t=this.downloadPulls[e],a=this.rootScope.premium?224:36;if(this.downloadActives[e]>=a||!(null==t?void 0:t.length))return!1;const s=(0,Pe.Z)(t,(e=>0===e.queueId))||(0,Pe.Z)(t,(e=>e.queueId===this.queueId))||t.shift(),n=s.activeDelta||1;this.downloadActives[e]+=n;const i=s.cb();i.then((()=>{this.downloadActives[e]-=n,this.downloadCheck(e)}),(t=>{(null==t?void 0:t.type)&&Za.has(t.type)||this.log.error("downloadCheck error:",t),this.downloadActives[e]-=n,this.downloadCheck(e)})).finally((()=>{i.then(s.deferred.resolve,s.deferred.reject)}))}setQueueId(e){this.queueId=e}getFileStorage(){return this.cacheStorage}cancelDownload(e){const t=[this.downloadPromises[e],this.uploadPromises[e]].filter(Boolean);let a=!1;for(let e=0,s=t.length;eLa(this,void 0,void 0,(function*(){if(null==r||r(),"url"in t){const e=t.url;if(this.isLocalWebFile(e))return fetch(e).then((e=>e.arrayBuffer())).then((t=>{const a=e.split(".").pop(),s=gt[a]||"application/octet-stream";return{_:"upload.webFile",size:t.byteLength,mime_type:s,file_type:{_:"storage.fileUnknown"},mtime:0,bytes:new Uint8Array(t)}}))}return this.apiManager.invokeApi("upload.getWebFile",{location:t,offset:a,limit:s},{dcId:e,fileDownload:!0})}))),this.getDelta(s),i)}requestFilePart(e,t,a,s,n=0,i=0,r){return this.downloadRequest(e,n,(()=>La(this,void 0,void 0,(function*(){null==r||r();const n=()=>La(this,void 0,void 0,(function*(){var i;null==r||r();const o=null===(i=t.file_reference)||void 0===i?void 0:i.slice();return this.apiManager.invokeApi("upload.getFile",{location:t,offset:a,limit:s},{dcId:e,fileDownload:!0}).catch((e=>{if(null==r||r(),"FILE_REFERENCE_EXPIRED"===e.type)return this.refreshReference(t,o).then(n);throw e}))}));(0,ue.Z)(t);const i=t.file_reference;if(i&&!t.checkedReference){t.checkedReference=!0;const e=E(i);if(this.refreshReferencePromises[e])return this.refreshReference(t,i).then(n)}return n()}))),this.getDelta(s),i)}getDelta(e){return e/Na}getLimitPart(e,t){if(!e)return 524288;let a=Na;const s=t?this.maxUploadParts:this.maxDownloadParts,n=t?524288:1048576;for(;e/a>s&&a{a===E(t)&&e.reject((0,X.Z)("REFERENCE_IS_NOT_REFRESHED")),e.resolve(t)}),e.reject)}return s.deferred.then((t=>{e.file_reference=t}))}isDownloading(e){return!!this.downloadPromises[e]}getDownload(e){return this.downloadPromises[e]}getUpload(e){return this.uploadPromises[e]}getConvertMethod(e){let t;return"application/x-tgwallpattern"===e?(t=this.uncompressTGV,e="image/svg+xml"):"image/webp"!==e||i().IS_WEBP_SUPPORTED?"application/x-tgsticker"===e?(t=this.uncompressTGS,e="application/json"):"audio/ogg"!==e||i().IS_OPUS_SUPPORTED||(t=this.convertOpus,e="audio/wav"):(t=this.convertWebp,e="image/png"),{mimeType:e,process:t}}allocateDeferredPromises(e,t,a){const s=[];let n,i=e,r=Promise.resolve();do{n=(0,v.Z)(),s.push({offset:i,writePromise:r,writeDeferred:n}),r=n,i+=a}while(i{if(!(null==e?void 0:e.error))for(const a of I)e&&e!==a||(a.error=t,a.deferred.reject(t))},y="inputWebFileLocation"===i._,_=y&&this.isLocalWebFile(i.url),v=this.tempId++,P=_?s:e.limitPart||this.getLimitPart(s,!1);let b,M,S=m.getFile.bind(m);const I=[],C=s||P,k=(e,t)=>{const{deferred:a}=e,s=u.bind(null,e);a.cancel=()=>a.reject((0,X.Z)("DOWNLOAD_CANCELED")),a.catch((t=>{var a,n;s(t),null===(n=null===(a=e.writer)||void 0===a?void 0:a.truncate)||void 0===n||n.call(a)})).finally((()=>{this.downloadPromises[t]===a&&delete this.downloadPromises[t],delete e.writer})),this.downloadPromises[t]=a,I.push(e)};if(m&&(!g||C<=o.Iw)&&(b=m.prepareWriting(l,C,e.mimeType),k(b,l)),g){let t=e.fileName;if(!t){t=l;const a=ht[e.mimeType];a&&(t+="."+a)}M=g.prepareWriting({fileName:t,downloadId:r,size:C}),k(M,c),b&&M.deferred.catch((e=>b.deferred.reject(e)))}h=null!==(a=null==M?void 0:M.deferred)&&void 0!==a?a:b.deferred,g&&f&&(S=g.getFile.bind(g)),S(l).then((e=>La(this,void 0,void 0,(function*(){if(w(),M){const t=M.writer=M.getWriter();w();const a=yield function(e){return Fa(e).then((e=>new Uint8Array(e)))}(e);w(),yield t.write(a),w(),M.deferred.resolve(yield t.finalize())}b&&b.deferred.resolve(e)})))).catch((t=>La(this,void 0,void 0,(function*(){if(e.onlyCache)return void u(null,t);I.forEach((e=>{e.writer=e.getWriter()}));const a=(y?this.requestWebFilePart:this.requestFilePart).bind(this);y&&void 0===this.webFileDcId&&!_&&(yield this.apiManager.getConfig(),w());const r=this.allocateDeferredPromises(0,s,P),p={done:0,offset:0,total:s,fileName:c},d=()=>{try{w(),p.done=g,this.rootScope.dispatchEvent("download_progress",p)}catch(e){}},m=(0,aa.Z)(d,50,!0);let g=0;const h=()=>La(this,void 0,void 0,(function*(){const{offset:t,writePromise:p,writeDeferred:y}=r.shift();try{w();performance.now();const u=yield a(n,i,t,P,v,e.queueId,w),_=(performance.now(),u.bytes);r.length&&h();const b=_.byteLength;this.debug&&this.log("downloadFile requestFilePart result:",c,u);const M=t+P>=s||!b;if(b){g+=b,M?d():m();performance.now();yield p,w(),performance.now(),performance.now(),yield Promise.all(I.map((({writer:e})=>null==e?void 0:e.write(_,t)))),w()}if(M&&(!s||g{var t;return null===(t=null==e?void 0:e.trim)||void 0===t?void 0:t.call(e,g)})),M&&f){const e=I.filter((({writer:e})=>(null==e?void 0:e.getParts)&&e.replaceParts)).map((({writer:e})=>La(this,void 0,void 0,(function*(){const t=e.getParts(),a=yield f(t,l);e.replaceParts(a)}))));yield Promise.all(e),w()}if(y.resolve(),M){const e=g<=o.Iw;I.forEach((t=>{const{deferred:a,writer:s}=t;if(a.isFulfilled||a.isRejected||!s)return;const n=s.finalize(e);a.resolve(n)}))}}catch(e){u(null,e)}}));for(let e=0,t=Math.min(1/0,r.length);e{if(I.reduce(((e,t)=>e+ +!!t.error),0)===I.length)throw I[0].error};return h}downloadMedia(e){let{media:t,thumb:a}=e;const s="photo"===t._;if(s&&!a)return Promise.reject("preloadPhoto photoEmpty!");const n="document"===t._;n?t=this.appDocsManager.getDoc(t.id):s&&(t=this.appPhotosManager.getPhoto(t.id));const{fileName:i,downloadOptions:r}=(0,Ra.Z)(e);let o=this.getDownload(i);return o||(o=this.download(r),n&&!a&&(this.rootScope.dispatchEvent("document_downloading",t.id),o.then((()=>{this.rootScope.dispatchEvent("document_downloaded",t.id)})).catch(qt.Z))),o}downloadMediaURL(e){const{media:t,thumb:a}=e;let s=this.thumbsStorage.getCacheContext(t,null==a?void 0:a.type);return(!a||s.downloaded>=("size"in a?a.size:0))&&s.url?Promise.resolve(s.url):this.downloadMedia(e).then((e=>{if(!s.downloaded||s.downloaded=10485760,n=this.getLimitPart(a,!0),i=this.getDelta(n),r=Math.ceil(a/n),o=(0,Ee.a)(),p={_:s?"inputFileBig":"inputFile",id:o,parts:r,name:t,md5_checksum:""},d=(0,v.Z)();if(r>this.maxUploadParts)return d.reject((0,X.Z)("FILE_TOO_BIG")),d;let f=!1,c=!1,l=e=>{"UPLOAD_CANCELED"!==(null==e?void 0:e.type)&&this.log.error("Up Error",e),d.reject(e),f=!0,l=qt.Z};const m=s?"upload.saveBigFilePart":"upload.saveFilePart",g=this.tempId++,h=this,u=function*(){let u=0,y=0;for(let v=0;vLa(this,void 0,void 0,(function*(){_();const i=e.slice(v,v+n),g=yield Fa(i);return _(),h.debug&&h.log("Upload file part, isBig:",s,P,g.byteLength,new Uint8Array(g).length,new Uint8Array(g).slice().length),h.apiManager.invokeApi(m,{file_id:o,file_part:P,file_total_parts:r,bytes:g},{fileUpload:!0}).then((()=>{if(f)return;++y;const e={done:y*n,offset:v,total:a,fileName:t};d.notify(e),y>=r&&(d.resolve(p),c=!0)}),l)}))),i).catch(l)}}(),y=()=>{if(f)return;const e=u.next();e.done||f||e.value.then(y)};for(let e=0,t=Math.min(1/0,r);e{if(f)throw(0,X.Z)("UPLOAD_CANCELED")};return d.cancel=()=>{f||c||(f=!0,l((0,X.Z)("UPLOAD_CANCELED")))},d.notify=e=>{this.rootScope.dispatchEvent("download_progress",e)},d.finally((()=>{this.uploadPromises[t]===d&&delete this.uploadPromises[t]})),this.uploadPromises[t]=d}}var qa=a(7487),Ga=a(6666),Ha=a(3306);class Wa extends G{constructor(){super(),this.hashes={},this.apiPromisesSingleProcess={},this.apiPromisesSingle={},this.apiPromisesCacheable={},this.afterMessageIdTemp=0}setUser(e){return this.setUserAuth(e.id)}invokeApiAfter(e,t={},a={}){let s=a;return s.prepareTempMessageId=""+ ++this.afterMessageIdTemp,s=Object.assign({},a),a.messageId=s.prepareTempMessageId,this.invokeApi(e,t,s)}invokeApiHashable(e){var t,a;null!==(t=e.params)&&void 0!==t||(e.params={}),null!==(a=e.options)&&void 0!==a||(e.options={});const{params:s,options:n,method:i,overwrite:r}=e,o=JSON.stringify(s);let p;return this.hashes[i]&&(p=this.hashes[i][o],p&&(r?(delete this.hashes[i][o],p=void 0):s.hash=p.hash)),this.invokeApiSingleProcess({method:i,processResult:t=>{if(t._.includes("NotModified"))return p.result;if(t.hash){const e=t.hash;this.hashes[i]||(this.hashes[i]={}),p=this.hashes[i][o]={hash:e,result:t}}if(e.processResult){const a=e.processResult(t);return p?p.result=a:a}return t},params:s,options:n})}invokeApiSingle(e,t={},a={}){const s=e+"-"+JSON.stringify(t),n=this.apiPromisesSingle;return n[s]?n[s]:n[s]=this.invokeApi(e,t,a).finally((()=>{delete n[s]}))}invokeApiSingleProcess(e){var t,a,s;null!==(t=e.params)&&void 0!==t||(e.params={}),null!==(a=e.options)&&void 0!==a||(e.options={});const{method:n,processResult:i,processError:r,params:o,options:p}=e,d=this.apiPromisesSingleProcess,f=p.cacheKey||JSON.stringify(o),c=null!==(s=d[n])&&void 0!==s?s:d[n]=new Map,l=c.get(f);if(l)return l;const m=()=>{const e=c.get(f);return e===h?void 0:e},g=this.invokeApi(n,o,p).then((e=>m()||i(e)),(e=>{const t=m();if(t)return t;if(!r)throw e;return r(e)})),h=g.finally((()=>{c.get(f)===h&&(c.delete(f),c.size||delete d[n])}));return c.set(f,h),h}invokeApiCacheable(e,t={},a={}){var s;const n=null!==(s=this.apiPromisesCacheable[e])&&void 0!==s?s:this.apiPromisesCacheable[e]={},i=JSON.stringify(t),r=n[i];if(r&&(!a.override||!r.fulfilled))return r.promise;let o;a.override&&(r&&r.timeout&&(clearTimeout(r.timeout),delete r.timeout),delete a.override),a.cacheSeconds&&(o=T.Z.setTimeout((()=>{delete n[i]}),1e3*a.cacheSeconds),delete a.cacheSeconds);const p=this.invokeApi(e,t,a);return n[i]={timestamp:Date.now(),fulfilled:!1,timeout:o,promise:p,params:t},p}clearCache(e,t){const a=this.apiPromisesCacheable[e];if(a)for(const e in a){const s=a[e];try{t(s.params)&&(s.timeout&&clearTimeout(s.timeout),delete a[e])}catch(e){}}}getConfig(e){return this.config&&!e?this.config:this.invokeApiSingleProcess({method:"help.getConfig",params:{},processResult:e=>(this.config=e,this.rootScope.dispatchEvent("config",e),e),options:{overwrite:e}})}getAppConfig(e){return this.appConfig&&!e?this.appConfig:this.invokeApiSingleProcess({method:"help.getAppConfig",params:{},processResult:e=>{var t;return this.appConfig=e,(0,ia.Ki)(null!==(t=e.ignore_restriction_reasons)&&void 0!==t?t:[]),this.rootScope.dispatchEvent("app_config",e),e},options:{overwrite:e}})}getLimit(e,t){return(0,q.Z)(this.getAppConfig(),(a=>{null!=t||(t=this.rootScope.premium);const s={pin:["dialogs_pinned_limit_default","dialogs_pinned_limit_premium"],folderPin:["dialogs_folder_pinned_limit_default","dialogs_folder_pinned_limit_premium"],folders:["dialog_filters_limit_default","dialog_filters_limit_premium"],favedStickers:["stickers_faved_limit_default","stickers_faved_limit_premium"],reactions:["reactions_user_max_default","reactions_user_max_premium"],bio:["about_length_limit_default","about_length_limit_premium"],topicPin:"topics_pinned_limit",caption:["caption_length_limit_default","caption_length_limit_premium"]}[e];return a[Array.isArray(s)?s[t?1:0]:s]}))}}var za=a(8453),Ka=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};class Ja extends Wa{constructor(){super(),this.log=(0,S.kg)("API"),this.cachedNetworkers={},this.cachedExportPromise={},this.gettingNetworkers={},this.baseDcId=0,this.afterMessageTempIds={},this.transportType=b.Z.transport,Z.addEventListener("transport",(e=>{this.changeTransportType(e)})),setInterval((()=>{this.getAppConfig(!0)}),997e4)}after(){this.apiUpdatesManager.addMultipleEventsListeners({updateConfig:()=>{this.getConfig(!0),this.getAppConfig(!0)}}),this.rootScope.addEventListener("user_auth",(()=>{this.config&&this.apiUpdatesManager.processLocalUpdate({_:"updateConfig"})})),this.rootScope.addEventListener("premium_toggle",(e=>{this.iterateNetworkers((({networker:t,connectionType:a,dcId:s,transportType:n})=>{if("client"===a||"websocket"!==n)return;const i=t.transport;if(i){if(i.connection){const t=V(s,a,e);i.changeUrl(t)}}else this.log.error("wow what, no transport?",t)}))}))}getTransportType(e){return this.transportType}iterateNetworkers(e){for(const t in this.cachedNetworkers){const a=this.cachedNetworkers[t];for(const s in a){const n=a[s];for(const a in n)n[a].forEach(((n,i,r)=>{e({networker:n,dcId:+a,connectionType:s,transportType:t,index:i,array:r})}))}}}chooseServer(e,t,a){return this.dcConfigurator.chooseServer(e,t,a,"client"===t,this.rootScope.premium)}changeTransportType(e){const t=this.transportType;if(t===e)return;this.log("changing transport from",t,"to",e);const a=this.cachedNetworkers[t],s=this.cachedNetworkers[e];this.cachedNetworkers[e]=a,this.cachedNetworkers[t]=s,this.transportType=e;for(const a in this.gettingNetworkers){const s=this.gettingNetworkers[a];delete this.gettingNetworkers[a];const n=a.replace(t,e);this.gettingNetworkers[n]=s,this.log("changed networker getKey from",a,"to",n)}this.iterateNetworkers((e=>{const t=this.getTransportType(e.connectionType),a=this.chooseServer(e.dcId,e.connectionType,t);this.changeNetworkerTransport(e.networker,a)}))}getBaseDcId(){return Ka(this,void 0,void 0,(function*(){if(this.baseDcId)return this.baseDcId;const e=yield qa.Z.get("dc");return this.baseDcId||(e?this.baseDcId=e:this.setBaseDcId(_.Z.baseDcId)),this.baseDcId}))}setUserAuth(e){return Ka(this,void 0,void 0,(function*(){if("string"!=typeof e&&"number"!=typeof e||(e={dcID:0,date:(0,te.Z)(!0),id:e.toPeerId(!1)}),this.rootScope.dispatchEvent("user_auth",e),!e.dcID){const t=yield this.getBaseDcId();e.dcID=t}qa.Z.set({user_auth:e})}))}setBaseDcId(e){const t=this.baseDcId;t&&this.getNetworker(t).then((e=>{this.setOnDrainIfNeeded(e)})),this.baseDcId=e,qa.Z.set({dc:this.baseDcId})}logOut(){return Ka(this,void 0,void 0,(function*(){if(this.loggingOut)return;this.loggingOut=!0;const e=[];for(let t=1;t<=5;t++)e.push("dc"+t+"_auth_key");const t=yield Promise.all(e.map((e=>qa.Z.get(e)))),a=[];for(let e=0;eKa(this,void 0,void 0,(function*(){this.baseDcId=void 0,yield(0,za.Z)(!1,!0),Ga.C.closeDatabases(),this.rootScope.dispatchEvent("logging_out")}));return setTimeout(s,1e3),Promise.all(a).catch((e=>{e.handled=!0})).finally(s)}))}generateNetworkerGetKey(e,t,a){return[e,t,a].join("-")}getNetworker(e,t={}){const a=t.fileDownload?"download":t.fileUpload?"upload":"client",n=this.getTransportType(a);this.cachedNetworkers[n]||(this.cachedNetworkers[n]={client:{},download:{},upload:{}});const i=this.cachedNetworkers[n][a];e in i||(i[e]=[]);const r=i[e],o="client"===a||"https"===n?1:this.rootScope.premium?6:3;if(r.length>=o){let e=o-1,t=!1;for(;e>=0;--e)if(r[e].isOnline){t=!0;break}const a=r.splice(t?e:o-1,1)[0];return r.unshift(a),Promise.resolve(a)}let p=this.generateNetworkerGetKey(e,n,a);if(this.gettingNetworkers[p])return this.gettingNetworkers[p];const d=`dc${e}_auth_key`,f=`dc${e}_server_salt`;let c=this.chooseServer(e,a,n);return this.gettingNetworkers[p]=Promise.all([d,f].map((e=>qa.Z.get(e)))).then((([i,o])=>Ka(this,void 0,void 0,(function*(){let l,m;if(i&&512===i.length){o&&16===o.length||(o="AAAAAAAAAAAAAAAA");const a=(0,Ha.Z)(i),n=(yield s.Z.invokeCrypto("sha1",a)).slice(-8),r=(0,Ha.Z)(o);l=this.networkerFactory.getNetworker(e,a,n,r,t)}else try{const a=yield this.authorizer.auth(e);qa.Z.set({[d]:E(a.authKey),[f]:E(a.serverSalt)}),l=this.networkerFactory.getNetworker(e,a.authKey,a.authKeyId,a.serverSalt,t)}catch(e){m=e}const g=this.getTransportType(a);if(g!==n&&(p=this.generateNetworkerGetKey(e,g,a),c.destroy(),O.removeTransport(this.dcConfigurator.chosenServers,c),l&&(c=this.chooseServer(e,a,g)),this.log("transport has been changed during authorization from",n,"to",g)),delete this.gettingNetworkers[p],m)throw this.log("get networker error",m,m.stack),m;return this.changeNetworkerTransport(l,c),r.unshift(l),this.setOnDrainIfNeeded(l),l}))))}getNetworkerVoid(e){return this.getNetworker(e).then(qt.Z,qt.Z)}changeNetworkerTransport(e,t){const a=e.transport;a&&O.removeTransport(this.dcConfigurator.chosenServers,a),e.changeTransport(t)}onNetworkerDrain(e){this.log("networker drain",e.dcId),e.onDrain=void 0,this.changeNetworkerTransport(e),e.destroy(),this.networkerFactory.removeNetworker(e),O.removeTransport(this.cachedNetworkers,e)}setOnDrainIfNeeded(e){e.onDrain||(e.isFileNetworker?Promise.resolve(!0):this.getBaseDcId().then((t=>e.dcId!==t))).then((t=>{e.onDrain||t&&(e.onDrain=()=>this.onNetworkerDrain(e),e.setDrainTimeout())}))}setUpdatesProcessor(e){this.updatesProcessor=e,this.networkerFactory.setUpdatesProcessor(e)}invokeApi(e,t={},a={}){const s=(0,v.Z)();let n,i,{afterMessageId:r,prepareTempMessageId:o}=a;if(o&&s.then((()=>{delete this.afterMessageTempIds[o]})),d.GO){const n=Date.now(),r=T.Z.setInterval((()=>{i&&i.isStopped()||this.log.error("Request is still processing:",e,t,a,"time:",(Date.now()-n)/1e3)}),5e3);s.catch(qt.Z).finally((()=>{clearInterval(r)}))}const p=(new Error).stack||"empty stack",f=()=>{if(r){const e=this.afterMessageTempIds[r];e&&(a.afterMessageId=e.messageId)}const p=i.wrapApiCall(e,t,a);return o&&(this.afterMessageTempIds[o]={messageId:a.messageId,promise:s}),p.catch((s=>{var i;if("FILE_REFERENCE_EXPIRED"!==s.type&&this.log.error("Error",s.code,s.type,this.baseDcId,n,e,t),401===s.code&&this.baseDcId===n)throw"SESSION_PASSWORD_NEEDED"!==s.type&&(qa.Z.delete("dc"),qa.Z.delete("user_auth")),s;if(401===s.code&&this.baseDcId&&n!==this.baseDcId){if(void 0===this.cachedExportPromise[n]){const e=new Promise(((e,t)=>{this.invokeApi("auth.exportAuthorization",{dc_id:n},{noErrorBox:!0}).then((a=>{this.invokeApi("auth.importAuthorization",{id:a.id,bytes:a.bytes},{dcId:n,noErrorBox:!0}).then(e,t)}),t)}));this.cachedExportPromise[n]=e}return this.cachedExportPromise[n].then((()=>f()))}if(303!==s.code){if(400===s.code&&0===s.type.indexOf("FILE_MIGRATE")){const i=+s.type.match(/^(FILE_MIGRATE_)(\d+)/)[2];if(i!==n)return a.dcId=i,this.invokeApi(e,t,a);throw s}if(400===s.code&&"CONNECTION_NOT_INITED"===s.type)return this.networkerFactory.unsetConnectionInited(),f();if(a.rawError||420!==s.code){if(!a.rawError&&["MSG_WAIT_FAILED","MSG_WAIT_TIMEOUT"].includes(s.type)){const e=this.afterMessageTempIds[r];return r=void 0,delete a.afterMessageId,e?e.promise.then((()=>f())):f()}if(a.rawError||500!==s.code){if("UNKNOWN"===s.type||"MTPROTO_CLUSTER_INVALID"===s.type)return(0,P.Z)(1e3).then((()=>f()));throw s}{const e=Date.now();if(a.stopTime&&e>=a.stopTime)throw s;return a.waitTime=a.waitTime?Math.min(60,1.5*a.waitTime):1,(0,P.Z)(1e3*a.waitTime).then((()=>f()))}}{const e=+s.type.match(/^FLOOD_WAIT_(\d+)/)[1]||1;if(e>(null!==(i=a.floodMaxTimeout)&&void 0!==i?i:60)&&!a.prepareTempMessageId)throw s;return(0,P.Z)(1e3*e).then((()=>f()))}}{const i=+s.type.match(/^(PHONE_MIGRATE_|NETWORK_MIGRATE_|USER_MIGRATE_)(\d+)/)[2];if(i!==n)return a.dcId?a.dcId=i:this.setBaseDcId(i),this.invokeApi(e,t,a)}}))};let c;return c=(n=a.dcId||this.baseDcId)?this.getNetworker(n,a):this.getBaseDcId().then((e=>this.getNetworker(n=e,a))),c.then((e=>{i=e;const t=f();return i.attachPromise(s,a),t})).then(s.resolve).catch((t=>Ka(this,void 0,void 0,(function*(){if(t?(0,fe.Z)(t)||(t={message:t}):t={type:"ERROR_EMPTY"},(401===t.code&&"SESSION_REVOKED"===t.type||406===t.code&&"AUTH_KEY_DUPLICATED"===t.type)&&this.logOut(),a.ignoreErrors)throw t;throw 406===t.code&&(t.handled=!0),a.noErrorBox||(t.input=e,t.stack=p||t.originalError&&t.originalError.stack||t.stack||(new Error).stack,setTimeout((()=>{t.handled||(401===t.code&&this.logOut(),t.handled=!0)}),100)),t})))).catch(s.reject),s}}class $a{constructor(){this.neededPeers=new Map,this.singlePeerMap=new Map,this._constructor(!1)}after(){this.rootScope.addEventListener("user_auth",(()=>{this.requestPeer(this.appPeersManager.peerId,"self")}))}requestPeer(e,t){let a=this.neededPeers.get(e);a&&a.has(t)||(a||(a=new Set,this.neededPeers.set(e,a)),a.add(t),this.dispatchEvent("peerNeeded",e))}releasePeer(e,t){const a=this.neededPeers.get(e);a&&(a.delete(t),a.size||(this.neededPeers.delete(e),this.dispatchEvent("peerUnneeded",e)))}requestPeersForKey(e,t){Array.isArray(e)&&(e=new Set(e));let a=this.singlePeerMap.get(t);if(a){for(const s of a)e.has(s)||(this.releasePeer(s,t),a.delete(s));if(!a.size&&!e.size)return void this.singlePeerMap.delete(t)}if(e.size){a||(a=new Set,this.singlePeerMap.set(t,a));for(const s of e)a.has(s)||(this.requestPeer(s,t),a.add(s))}}isPeerNeeded(e){return this.neededPeers.has(e)}}Ae($a,[p.Z,G]);const Qa=$a,Ya=o.Pt;class Xa{constructor(){this.thumbsCache={}}getKey(e){var t;return e._+(null!==(t=e.id)&&void 0!==t?t:e.url)}getCacheContext(e,t=Ya){var a,s,n,i;const r=null!==(a=(n=this.thumbsCache)[i=this.getKey(e)])&&void 0!==a?a:n[i]={};return null!==(s=r[t])&&void 0!==s?s:r[t]={downloaded:0,url:"",type:t}}setCacheContextURL(e,t=Ya,a,s=0){const n=this.getCacheContext(e,t);return n.url=a,n.downloaded=s,n}deleteCacheContext(e,t=Ya){const a=this.thumbsCache[this.getKey(e)];a&&delete a[t]}}const es={MTProto:{constructors:[{id:481674261,predicate:"vector",params:[],type:"Vector t"},{id:85337187,predicate:"resPQ",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"pq",type:"bytes"},{name:"server_public_key_fingerprints",type:"Vector"}],type:"ResPQ"},{id:-1443537003,predicate:"p_q_inner_data_dc",params:[{name:"pq",type:"bytes"},{name:"p",type:"bytes"},{name:"q",type:"bytes"},{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"new_nonce",type:"int256"},{name:"dc",type:"int"}],type:"P_Q_inner_data"},{id:1459478408,predicate:"p_q_inner_data_temp_dc",params:[{name:"pq",type:"bytes"},{name:"p",type:"bytes"},{name:"q",type:"bytes"},{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"new_nonce",type:"int256"},{name:"dc",type:"int"},{name:"expires_in",type:"int"}],type:"P_Q_inner_data"},{id:-790100132,predicate:"server_DH_params_ok",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"encrypted_answer",type:"bytes"}],type:"Server_DH_Params"},{id:-1249309254,predicate:"server_DH_inner_data",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"g",type:"int"},{name:"dh_prime",type:"bytes"},{name:"g_a",type:"bytes"},{name:"server_time",type:"int"}],type:"Server_DH_inner_data"},{id:1715713620,predicate:"client_DH_inner_data",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"retry_id",type:"long"},{name:"g_b",type:"bytes"}],type:"Client_DH_Inner_Data"},{id:1003222836,predicate:"dh_gen_ok",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"new_nonce_hash1",type:"int128"}],type:"Set_client_DH_params_answer"},{id:1188831161,predicate:"dh_gen_retry",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"new_nonce_hash2",type:"int128"}],type:"Set_client_DH_params_answer"},{id:-1499615742,predicate:"dh_gen_fail",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"new_nonce_hash3",type:"int128"}],type:"Set_client_DH_params_answer"},{id:1973679973,predicate:"bind_auth_key_inner",params:[{name:"nonce",type:"long"},{name:"temp_auth_key_id",type:"long"},{name:"perm_auth_key_id",type:"long"},{name:"temp_session_id",type:"long"},{name:"expires_at",type:"int"}],type:"BindAuthKeyInner"},{id:-212046591,predicate:"rpc_result",params:[{name:"req_msg_id",type:"long"},{name:"result",type:"Object"}],type:"RpcResult"},{id:558156313,predicate:"rpc_error",params:[{name:"error_code",type:"int"},{name:"error_message",type:"string"}],type:"RpcError"},{id:1579864942,predicate:"rpc_answer_unknown",params:[],type:"RpcDropAnswer"},{id:-847714938,predicate:"rpc_answer_dropped_running",params:[],type:"RpcDropAnswer"},{id:-1539647305,predicate:"rpc_answer_dropped",params:[{name:"msg_id",type:"long"},{name:"seq_no",type:"int"},{name:"bytes",type:"int"}],type:"RpcDropAnswer"},{id:155834844,predicate:"future_salt",params:[{name:"valid_since",type:"int"},{name:"valid_until",type:"int"},{name:"salt",type:"long"}],type:"FutureSalt"},{id:-1370486635,predicate:"future_salts",params:[{name:"req_msg_id",type:"long"},{name:"now",type:"int"},{name:"salts",type:"vector"}],type:"FutureSalts"},{id:880243653,predicate:"pong",params:[{name:"msg_id",type:"long"},{name:"ping_id",type:"long"}],type:"Pong"},{id:-501201412,predicate:"destroy_session_ok",params:[{name:"session_id",type:"long"}],type:"DestroySessionRes"},{id:1658015945,predicate:"destroy_session_none",params:[{name:"session_id",type:"long"}],type:"DestroySessionRes"},{id:-1631450872,predicate:"new_session_created",params:[{name:"first_msg_id",type:"long"},{name:"unique_id",type:"long"},{name:"server_salt",type:"long"}],type:"NewSession"},{id:1945237724,predicate:"msg_container",params:[{name:"messages",type:"vector<%Message>"}],type:"MessageContainer"},{id:1538843921,predicate:"message",params:[{name:"msg_id",type:"long"},{name:"seqno",type:"int"},{name:"bytes",type:"int"},{name:"body",type:"Object"}],type:"Message"},{id:-530561358,predicate:"msg_copy",params:[{name:"orig_message",type:"Message"}],type:"MessageCopy"},{id:812830625,predicate:"gzip_packed",params:[{name:"packed_data",type:"bytes"}],type:"Object"},{id:1658238041,predicate:"msgs_ack",params:[{name:"msg_ids",type:"Vector"}],type:"MsgsAck"},{id:-1477445615,predicate:"bad_msg_notification",params:[{name:"bad_msg_id",type:"long"},{name:"bad_msg_seqno",type:"int"},{name:"error_code",type:"int"}],type:"BadMsgNotification"},{id:-307542917,predicate:"bad_server_salt",params:[{name:"bad_msg_id",type:"long"},{name:"bad_msg_seqno",type:"int"},{name:"error_code",type:"int"},{name:"new_server_salt",type:"long"}],type:"BadMsgNotification"},{id:2105940488,predicate:"msg_resend_req",params:[{name:"msg_ids",type:"Vector"}],type:"MsgResendReq"},{id:-630588590,predicate:"msgs_state_req",params:[{name:"msg_ids",type:"Vector"}],type:"MsgsStateReq"},{id:81704317,predicate:"msgs_state_info",params:[{name:"req_msg_id",type:"long"},{name:"info",type:"bytes"}],type:"MsgsStateInfo"},{id:-1933520591,predicate:"msgs_all_info",params:[{name:"msg_ids",type:"Vector"},{name:"info",type:"bytes"}],type:"MsgsAllInfo"},{id:661470918,predicate:"msg_detailed_info",params:[{name:"msg_id",type:"long"},{name:"answer_msg_id",type:"long"},{name:"bytes",type:"int"},{name:"status",type:"int"}],type:"MsgDetailedInfo"},{id:-2137147681,predicate:"msg_new_detailed_info",params:[{name:"answer_msg_id",type:"long"},{name:"bytes",type:"int"},{name:"status",type:"int"}],type:"MsgDetailedInfo"},{id:-161422892,predicate:"destroy_auth_key_ok",params:[],type:"DestroyAuthKeyRes"},{id:178201177,predicate:"destroy_auth_key_none",params:[],type:"DestroyAuthKeyRes"},{id:-368010477,predicate:"destroy_auth_key_fail",params:[],type:"DestroyAuthKeyRes"}],methods:[{id:-1099002127,method:"req_pq_multi",params:[{name:"nonce",type:"int128"}],type:"ResPQ"},{id:-686627650,method:"req_DH_params",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"p",type:"bytes"},{name:"q",type:"bytes"},{name:"public_key_fingerprint",type:"long"},{name:"encrypted_data",type:"bytes"}],type:"Server_DH_Params"},{id:-184262881,method:"set_client_DH_params",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"encrypted_data",type:"bytes"}],type:"Set_client_DH_params_answer"},{id:1491380032,method:"rpc_drop_answer",params:[{name:"req_msg_id",type:"long"}],type:"RpcDropAnswer"},{id:-1188971260,method:"get_future_salts",params:[{name:"num",type:"int"}],type:"FutureSalts"},{id:2059302892,method:"ping",params:[{name:"ping_id",type:"long"}],type:"Pong"},{id:-213746804,method:"ping_delay_disconnect",params:[{name:"ping_id",type:"long"},{name:"disconnect_delay",type:"int"}],type:"Pong"},{id:-414113498,method:"destroy_session",params:[{name:"session_id",type:"long"}],type:"DestroySessionRes"},{id:-1835453025,method:"http_wait",params:[{name:"max_delay",type:"int"},{name:"wait_after",type:"int"},{name:"max_wait",type:"int"}],type:"HttpWait"},{id:-784117408,method:"destroy_auth_key",params:[],type:"DestroyAuthKeyRes"}]},API:{constructors:[{id:-1132882121,predicate:"boolFalse",params:[],type:"Bool"},{id:-1720552011,predicate:"boolTrue",params:[],type:"Bool"},{id:1072550713,predicate:"true",params:[],type:"True"},{id:481674261,predicate:"vector",params:[],type:"Vector t"},{id:-994444869,predicate:"error",params:[{name:"code",type:"int"},{name:"text",type:"string"}],type:"Error"},{id:1450380236,predicate:"null",params:[],type:"Null"},{id:2134579434,predicate:"inputPeerEmpty",params:[],type:"InputPeer"},{id:2107670217,predicate:"inputPeerSelf",params:[],type:"InputPeer"},{id:900291769,predicate:"inputPeerChat",params:[{name:"chat_id",type:"long"}],type:"InputPeer"},{id:-1182234929,predicate:"inputUserEmpty",params:[],type:"InputUser"},{id:-138301121,predicate:"inputUserSelf",params:[],type:"InputUser"},{id:-208488460,predicate:"inputPhoneContact",params:[{name:"client_id",type:"long"},{name:"phone",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"}],type:"InputContact"},{id:-181407105,predicate:"inputFile",params:[{name:"id",type:"long"},{name:"parts",type:"int"},{name:"name",type:"string"},{name:"md5_checksum",type:"string"}],type:"InputFile"},{id:-1771768449,predicate:"inputMediaEmpty",params:[],type:"InputMedia"},{id:505969924,predicate:"inputMediaUploadedPhoto",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.2?true"},{name:"file",type:"InputFile"},{name:"stickers",type:"flags.0?Vector"},{name:"ttl_seconds",type:"flags.1?int"}],type:"InputMedia"},{id:-1279654347,predicate:"inputMediaPhoto",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.1?true"},{name:"id",type:"InputPhoto"},{name:"ttl_seconds",type:"flags.0?int"}],type:"InputMedia"},{id:-104578748,predicate:"inputMediaGeoPoint",params:[{name:"geo_point",type:"InputGeoPoint"}],type:"InputMedia"},{id:-122978821,predicate:"inputMediaContact",params:[{name:"phone_number",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"vcard",type:"string"}],type:"InputMedia"},{id:480546647,predicate:"inputChatPhotoEmpty",params:[],type:"InputChatPhoto"},{id:-1110593856,predicate:"inputChatUploadedPhoto",params:[{name:"flags",type:"#"},{name:"file",type:"flags.0?InputFile"},{name:"video",type:"flags.1?InputFile"},{name:"video_start_ts",type:"flags.2?double"},{name:"video_emoji_markup",type:"flags.3?VideoSize"}],type:"InputChatPhoto"},{id:-1991004873,predicate:"inputChatPhoto",params:[{name:"id",type:"InputPhoto"}],type:"InputChatPhoto"},{id:-457104426,predicate:"inputGeoPointEmpty",params:[],type:"InputGeoPoint"},{id:1210199983,predicate:"inputGeoPoint",params:[{name:"flags",type:"#"},{name:"lat",type:"double"},{name:"long",type:"double"},{name:"accuracy_radius",type:"flags.0?int"}],type:"InputGeoPoint"},{id:483901197,predicate:"inputPhotoEmpty",params:[],type:"InputPhoto"},{id:1001634122,predicate:"inputPhoto",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"}],type:"InputPhoto"},{id:-539317279,predicate:"inputFileLocation",params:[{name:"volume_id",type:"long"},{name:"local_id",type:"int"},{name:"secret",type:"long"},{name:"file_reference",type:"bytes"}],type:"InputFileLocation"},{id:1498486562,predicate:"peerUser",params:[{name:"user_id",type:"long"}],type:"Peer"},{id:918946202,predicate:"peerChat",params:[{name:"chat_id",type:"long"}],type:"Peer"},{id:-1432995067,predicate:"storage.fileUnknown",params:[],type:"storage.FileType"},{id:1086091090,predicate:"storage.filePartial",params:[],type:"storage.FileType"},{id:8322574,predicate:"storage.fileJpeg",params:[],type:"storage.FileType"},{id:-891180321,predicate:"storage.fileGif",params:[],type:"storage.FileType"},{id:172975040,predicate:"storage.filePng",params:[],type:"storage.FileType"},{id:-1373745011,predicate:"storage.filePdf",params:[],type:"storage.FileType"},{id:1384777335,predicate:"storage.fileMp3",params:[],type:"storage.FileType"},{id:1258941372,predicate:"storage.fileMov",params:[],type:"storage.FileType"},{id:-1278304028,predicate:"storage.fileMp4",params:[],type:"storage.FileType"},{id:276907596,predicate:"storage.fileWebp",params:[],type:"storage.FileType"},{id:-742634630,predicate:"userEmpty",params:[{name:"id",type:"long"}],type:"User"},{id:1326562017,predicate:"userProfilePhotoEmpty",params:[],type:"UserProfilePhoto"},{id:-2100168954,predicate:"userProfilePhoto",params:[{name:"flags",type:"#"},{name:"has_video",type:"flags.0?true"},{name:"personal",type:"flags.2?true"},{name:"photo_id",type:"long"},{name:"stripped_thumb",type:"flags.1?bytes"},{name:"dc_id",type:"int"}],type:"UserProfilePhoto"},{id:164646985,predicate:"userStatusEmpty",params:[],type:"UserStatus"},{id:-306628279,predicate:"userStatusOnline",params:[{name:"expires",type:"int"}],type:"UserStatus"},{id:9203775,predicate:"userStatusOffline",params:[{name:"was_online",type:"int"}],type:"UserStatus"},{id:693512293,predicate:"chatEmpty",params:[{name:"id",type:"long"}],type:"Chat"},{id:1103884886,predicate:"chat",params:[{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"left",type:"flags.2?true"},{name:"deactivated",type:"flags.5?true"},{name:"call_active",type:"flags.23?true"},{name:"call_not_empty",type:"flags.24?true"},{name:"noforwards",type:"flags.25?true"},{name:"id",type:"long"},{name:"title",type:"string"},{name:"photo",type:"ChatPhoto"},{name:"participants_count",type:"int"},{name:"date",type:"int"},{name:"version",type:"int"},{name:"migrated_to",type:"flags.6?InputChannel"},{name:"admin_rights",type:"flags.14?ChatAdminRights"},{name:"default_banned_rights",type:"flags.18?ChatBannedRights"}],type:"Chat"},{id:1704108455,predicate:"chatForbidden",params:[{name:"id",type:"long"},{name:"title",type:"string"}],type:"Chat"},{id:-908914376,predicate:"chatFull",params:[{name:"flags",type:"#"},{name:"can_set_username",type:"flags.7?true"},{name:"has_scheduled",type:"flags.8?true"},{name:"translations_disabled",type:"flags.19?true"},{name:"id",type:"long"},{name:"about",type:"string"},{name:"participants",type:"ChatParticipants"},{name:"chat_photo",type:"flags.2?Photo"},{name:"notify_settings",type:"PeerNotifySettings"},{name:"exported_invite",type:"flags.13?ExportedChatInvite"},{name:"bot_info",type:"flags.3?Vector"},{name:"pinned_msg_id",type:"flags.6?int"},{name:"folder_id",type:"flags.11?int"},{name:"call",type:"flags.12?InputGroupCall"},{name:"ttl_period",type:"flags.14?int"},{name:"groupcall_default_join_as",type:"flags.15?Peer"},{name:"theme_emoticon",type:"flags.16?string"},{name:"requests_pending",type:"flags.17?int"},{name:"recent_requesters",type:"flags.17?Vector"},{name:"available_reactions",type:"flags.18?ChatReactions"}],type:"ChatFull"},{id:-1070776313,predicate:"chatParticipant",params:[{name:"user_id",type:"long"},{name:"inviter_id",type:"long"},{name:"date",type:"int"}],type:"ChatParticipant"},{id:-2023500831,predicate:"chatParticipantsForbidden",params:[{name:"flags",type:"#"},{name:"chat_id",type:"long"},{name:"self_participant",type:"flags.0?ChatParticipant"}],type:"ChatParticipants"},{id:1018991608,predicate:"chatParticipants",params:[{name:"chat_id",type:"long"},{name:"participants",type:"Vector"},{name:"version",type:"int"}],type:"ChatParticipants"},{id:935395612,predicate:"chatPhotoEmpty",params:[],type:"ChatPhoto"},{id:476978193,predicate:"chatPhoto",params:[{name:"flags",type:"#"},{name:"has_video",type:"flags.0?true"},{name:"photo_id",type:"long"},{name:"stripped_thumb",type:"flags.1?bytes"},{name:"dc_id",type:"int"}],type:"ChatPhoto"},{id:-1868117372,predicate:"messageEmpty",params:[{name:"flags",type:"#"},{name:"id",type:"int"},{name:"peer_id",type:"flags.0?Peer"}],type:"Message"},{id:940666592,predicate:"message",params:[{name:"flags",type:"#"},{name:"out",type:"flags.1?true"},{name:"mentioned",type:"flags.4?true"},{name:"media_unread",type:"flags.5?true"},{name:"silent",type:"flags.13?true"},{name:"post",type:"flags.14?true"},{name:"from_scheduled",type:"flags.18?true"},{name:"legacy",type:"flags.19?true"},{name:"edit_hide",type:"flags.21?true"},{name:"pinned",type:"flags.24?true"},{name:"noforwards",type:"flags.26?true"},{name:"id",type:"int"},{name:"from_id",type:"flags.8?Peer"},{name:"peer_id",type:"Peer"},{name:"fwd_from",type:"flags.2?MessageFwdHeader"},{name:"via_bot_id",type:"flags.11?long"},{name:"reply_to",type:"flags.3?MessageReplyHeader"},{name:"date",type:"int"},{name:"message",type:"string"},{name:"media",type:"flags.9?MessageMedia"},{name:"reply_markup",type:"flags.6?ReplyMarkup"},{name:"entities",type:"flags.7?Vector"},{name:"views",type:"flags.10?int"},{name:"forwards",type:"flags.10?int"},{name:"replies",type:"flags.23?MessageReplies"},{name:"edit_date",type:"flags.15?int"},{name:"post_author",type:"flags.16?string"},{name:"grouped_id",type:"flags.17?long"},{name:"reactions",type:"flags.20?MessageReactions"},{name:"restriction_reason",type:"flags.22?Vector"},{name:"ttl_period",type:"flags.25?int"}],type:"Message"},{id:721967202,predicate:"messageService",params:[{name:"flags",type:"#"},{name:"out",type:"flags.1?true"},{name:"mentioned",type:"flags.4?true"},{name:"media_unread",type:"flags.5?true"},{name:"silent",type:"flags.13?true"},{name:"post",type:"flags.14?true"},{name:"legacy",type:"flags.19?true"},{name:"id",type:"int"},{name:"from_id",type:"flags.8?Peer"},{name:"peer_id",type:"Peer"},{name:"reply_to",type:"flags.3?MessageReplyHeader"},{name:"date",type:"int"},{name:"action",type:"MessageAction"},{name:"ttl_period",type:"flags.25?int"}],type:"Message"},{id:1038967584,predicate:"messageMediaEmpty",params:[],type:"MessageMedia"},{id:1766936791,predicate:"messageMediaPhoto",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.3?true"},{name:"photo",type:"flags.0?Photo"},{name:"ttl_seconds",type:"flags.2?int"}],type:"MessageMedia"},{id:1457575028,predicate:"messageMediaGeo",params:[{name:"geo",type:"GeoPoint"}],type:"MessageMedia"},{id:1882335561,predicate:"messageMediaContact",params:[{name:"phone_number",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"vcard",type:"string"},{name:"user_id",type:"long"}],type:"MessageMedia"},{id:-1618676578,predicate:"messageMediaUnsupported",params:[],type:"MessageMedia"},{id:-1230047312,predicate:"messageActionEmpty",params:[],type:"MessageAction"},{id:-1119368275,predicate:"messageActionChatCreate",params:[{name:"title",type:"string"},{name:"users",type:"Vector"}],type:"MessageAction"},{id:-1247687078,predicate:"messageActionChatEditTitle",params:[{name:"title",type:"string"}],type:"MessageAction"},{id:2144015272,predicate:"messageActionChatEditPhoto",params:[{name:"photo",type:"Photo"}],type:"MessageAction"},{id:-1780220945,predicate:"messageActionChatDeletePhoto",params:[],type:"MessageAction"},{id:365886720,predicate:"messageActionChatAddUser",params:[{name:"users",type:"Vector"}],type:"MessageAction"},{id:-1539362612,predicate:"messageActionChatDeleteUser",params:[{name:"user_id",type:"long"}],type:"MessageAction"},{id:-712374074,predicate:"dialog",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.2?true"},{name:"unread_mark",type:"flags.3?true"},{name:"peer",type:"Peer"},{name:"top_message",type:"int"},{name:"read_inbox_max_id",type:"int"},{name:"read_outbox_max_id",type:"int"},{name:"unread_count",type:"int"},{name:"unread_mentions_count",type:"int"},{name:"unread_reactions_count",type:"int"},{name:"notify_settings",type:"PeerNotifySettings"},{name:"pts",type:"flags.0?int"},{name:"draft",type:"flags.1?DraftMessage"},{name:"folder_id",type:"flags.4?int"},{name:"ttl_period",type:"flags.5?int"}],type:"Dialog"},{id:590459437,predicate:"photoEmpty",params:[{name:"id",type:"long"}],type:"Photo"},{id:-82216347,predicate:"photo",params:[{name:"flags",type:"#"},{name:"has_stickers",type:"flags.0?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"},{name:"date",type:"int"},{name:"sizes",type:"Vector"},{name:"video_sizes",type:"flags.1?Vector"},{name:"dc_id",type:"int"}],type:"Photo"},{id:236446268,predicate:"photoSizeEmpty",params:[{name:"type",type:"string"}],type:"PhotoSize"},{id:1976012384,predicate:"photoSize",params:[{name:"type",type:"string"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"size",type:"int"}],type:"PhotoSize"},{id:35527382,predicate:"photoCachedSize",params:[{name:"type",type:"string"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"bytes",type:"bytes"}],type:"PhotoSize"},{id:286776671,predicate:"geoPointEmpty",params:[],type:"GeoPoint"},{id:-1297942941,predicate:"geoPoint",params:[{name:"flags",type:"#"},{name:"long",type:"double"},{name:"lat",type:"double"},{name:"access_hash",type:"long"},{name:"accuracy_radius",type:"flags.0?int"}],type:"GeoPoint"},{id:1577067778,predicate:"auth.sentCode",params:[{name:"flags",type:"#"},{name:"type",type:"auth.SentCodeType"},{name:"phone_code_hash",type:"string"},{name:"next_type",type:"flags.1?auth.CodeType"},{name:"timeout",type:"flags.2?int"}],type:"auth.SentCode"},{id:782418132,predicate:"auth.authorization",params:[{name:"flags",type:"#"},{name:"setup_password_required",type:"flags.1?true"},{name:"otherwise_relogin_days",type:"flags.1?int"},{name:"tmp_sessions",type:"flags.0?int"},{name:"future_auth_token",type:"flags.2?bytes"},{name:"user",type:"User"}],type:"auth.Authorization"},{id:-1271602504,predicate:"auth.exportedAuthorization",params:[{name:"id",type:"long"},{name:"bytes",type:"bytes"}],type:"auth.ExportedAuthorization"},{id:-1195615476,predicate:"inputNotifyPeer",params:[{name:"peer",type:"InputPeer"}],type:"InputNotifyPeer"},{id:423314455,predicate:"inputNotifyUsers",params:[],type:"InputNotifyPeer"},{id:1251338318,predicate:"inputNotifyChats",params:[],type:"InputNotifyPeer"},{id:-551616469,predicate:"inputPeerNotifySettings",params:[{name:"flags",type:"#"},{name:"show_previews",type:"flags.0?Bool"},{name:"silent",type:"flags.1?Bool"},{name:"mute_until",type:"flags.2?int"},{name:"sound",type:"flags.3?NotificationSound"}],type:"InputPeerNotifySettings"},{id:-1472527322,predicate:"peerNotifySettings",params:[{name:"flags",type:"#"},{name:"show_previews",type:"flags.0?Bool"},{name:"silent",type:"flags.1?Bool"},{name:"mute_until",type:"flags.2?int"},{name:"ios_sound",type:"flags.3?NotificationSound"},{name:"android_sound",type:"flags.4?NotificationSound"},{name:"other_sound",type:"flags.5?NotificationSound"}],type:"PeerNotifySettings"},{id:-1525149427,predicate:"peerSettings",params:[{name:"flags",type:"#"},{name:"report_spam",type:"flags.0?true"},{name:"add_contact",type:"flags.1?true"},{name:"block_contact",type:"flags.2?true"},{name:"share_contact",type:"flags.3?true"},{name:"need_contacts_exception",type:"flags.4?true"},{name:"report_geo",type:"flags.5?true"},{name:"autoarchived",type:"flags.7?true"},{name:"invite_members",type:"flags.8?true"},{name:"request_chat_broadcast",type:"flags.10?true"},{name:"geo_distance",type:"flags.6?int"},{name:"request_chat_title",type:"flags.9?string"},{name:"request_chat_date",type:"flags.9?int"}],type:"PeerSettings"},{id:-1539849235,predicate:"wallPaper",params:[{name:"id",type:"long"},{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"default",type:"flags.1?true"},{name:"pattern",type:"flags.3?true"},{name:"dark",type:"flags.4?true"},{name:"access_hash",type:"long"},{name:"slug",type:"string"},{name:"document",type:"Document"},{name:"settings",type:"flags.2?WallPaperSettings"}],type:"WallPaper"},{id:1490799288,predicate:"inputReportReasonSpam",params:[],type:"ReportReason"},{id:505595789,predicate:"inputReportReasonViolence",params:[],type:"ReportReason"},{id:777640226,predicate:"inputReportReasonPornography",params:[],type:"ReportReason"},{id:-1376497949,predicate:"inputReportReasonChildAbuse",params:[],type:"ReportReason"},{id:-1041980751,predicate:"inputReportReasonOther",params:[],type:"ReportReason"},{id:-120378643,predicate:"userFull",params:[{name:"flags",type:"#"},{name:"blocked",type:"flags.0?true"},{name:"phone_calls_available",type:"flags.4?true"},{name:"phone_calls_private",type:"flags.5?true"},{name:"can_pin_message",type:"flags.7?true"},{name:"has_scheduled",type:"flags.12?true"},{name:"video_calls_available",type:"flags.13?true"},{name:"voice_messages_forbidden",type:"flags.20?true"},{name:"translations_disabled",type:"flags.23?true"},{name:"id",type:"long"},{name:"about",type:"flags.1?string"},{name:"settings",type:"PeerSettings"},{name:"personal_photo",type:"flags.21?Photo"},{name:"profile_photo",type:"flags.2?Photo"},{name:"fallback_photo",type:"flags.22?Photo"},{name:"notify_settings",type:"PeerNotifySettings"},{name:"bot_info",type:"flags.3?BotInfo"},{name:"pinned_msg_id",type:"flags.6?int"},{name:"common_chats_count",type:"int"},{name:"folder_id",type:"flags.11?int"},{name:"ttl_period",type:"flags.14?int"},{name:"theme_emoticon",type:"flags.15?string"},{name:"private_forward_name",type:"flags.16?string"},{name:"bot_group_admin_rights",type:"flags.17?ChatAdminRights"},{name:"bot_broadcast_admin_rights",type:"flags.18?ChatAdminRights"},{name:"premium_gifts",type:"flags.19?Vector"}],type:"UserFull"},{id:341499403,predicate:"contact",params:[{name:"user_id",type:"long"},{name:"mutual",type:"Bool"}],type:"Contact"},{id:-1052885936,predicate:"importedContact",params:[{name:"user_id",type:"long"},{name:"client_id",type:"long"}],type:"ImportedContact"},{id:383348795,predicate:"contactStatus",params:[{name:"user_id",type:"long"},{name:"status",type:"UserStatus"}],type:"ContactStatus"},{id:-1219778094,predicate:"contacts.contactsNotModified",params:[],type:"contacts.Contacts"},{id:-353862078,predicate:"contacts.contacts",params:[{name:"contacts",type:"Vector"},{name:"saved_count",type:"int"},{name:"users",type:"Vector"}],type:"contacts.Contacts"},{id:2010127419,predicate:"contacts.importedContacts",params:[{name:"imported",type:"Vector"},{name:"popular_invites",type:"Vector"},{name:"retry_contacts",type:"Vector"},{name:"users",type:"Vector"}],type:"contacts.ImportedContacts"},{id:182326673,predicate:"contacts.blocked",params:[{name:"blocked",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"contacts.Blocked"},{id:-513392236,predicate:"contacts.blockedSlice",params:[{name:"count",type:"int"},{name:"blocked",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"contacts.Blocked"},{id:364538944,predicate:"messages.dialogs",params:[{name:"dialogs",type:"Vector"},{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.Dialogs"},{id:1910543603,predicate:"messages.dialogsSlice",params:[{name:"count",type:"int"},{name:"dialogs",type:"Vector"},{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.Dialogs"},{id:-1938715001,predicate:"messages.messages",params:[{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.Messages"},{id:978610270,predicate:"messages.messagesSlice",params:[{name:"flags",type:"#"},{name:"inexact",type:"flags.1?true"},{name:"count",type:"int"},{name:"next_rate",type:"flags.0?int"},{name:"offset_id_offset",type:"flags.2?int"},{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.Messages"},{id:1694474197,predicate:"messages.chats",params:[{name:"chats",type:"Vector"}],type:"messages.Chats"},{id:-438840932,predicate:"messages.chatFull",params:[{name:"full_chat",type:"ChatFull"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.ChatFull"},{id:-1269012015,predicate:"messages.affectedHistory",params:[{name:"pts",type:"int"},{name:"pts_count",type:"int"},{name:"offset",type:"int"}],type:"messages.AffectedHistory"},{id:1474492012,predicate:"inputMessagesFilterEmpty",params:[],type:"MessagesFilter"},{id:-1777752804,predicate:"inputMessagesFilterPhotos",params:[],type:"MessagesFilter"},{id:-1614803355,predicate:"inputMessagesFilterVideo",params:[],type:"MessagesFilter"},{id:1458172132,predicate:"inputMessagesFilterPhotoVideo",params:[],type:"MessagesFilter"},{id:-1629621880,predicate:"inputMessagesFilterDocument",params:[],type:"MessagesFilter"},{id:2129714567,predicate:"inputMessagesFilterUrl",params:[],type:"MessagesFilter"},{id:-3644025,predicate:"inputMessagesFilterGif",params:[],type:"MessagesFilter"},{id:522914557,predicate:"updateNewMessage",params:[{name:"message",type:"Message"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:1318109142,predicate:"updateMessageID",params:[{name:"id",type:"int"},{name:"random_id",type:"long"}],type:"Update"},{id:-1576161051,predicate:"updateDeleteMessages",params:[{name:"messages",type:"Vector"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-1071741569,predicate:"updateUserTyping",params:[{name:"user_id",type:"long"},{name:"action",type:"SendMessageAction"}],type:"Update"},{id:-2092401936,predicate:"updateChatUserTyping",params:[{name:"chat_id",type:"long"},{name:"from_id",type:"Peer"},{name:"action",type:"SendMessageAction"}],type:"Update"},{id:125178264,predicate:"updateChatParticipants",params:[{name:"participants",type:"ChatParticipants"}],type:"Update"},{id:-440534818,predicate:"updateUserStatus",params:[{name:"user_id",type:"long"},{name:"status",type:"UserStatus"}],type:"Update"},{id:-1484486364,predicate:"updateUserName",params:[{name:"user_id",type:"long"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"usernames",type:"Vector"}],type:"Update"},{id:-1519637954,predicate:"updates.state",params:[{name:"pts",type:"int"},{name:"qts",type:"int"},{name:"date",type:"int"},{name:"seq",type:"int"},{name:"unread_count",type:"int"}],type:"updates.State"},{id:1567990072,predicate:"updates.differenceEmpty",params:[{name:"date",type:"int"},{name:"seq",type:"int"}],type:"updates.Difference"},{id:16030880,predicate:"updates.difference",params:[{name:"new_messages",type:"Vector"},{name:"new_encrypted_messages",type:"Vector"},{name:"other_updates",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"},{name:"state",type:"updates.State"}],type:"updates.Difference"},{id:-1459938943,predicate:"updates.differenceSlice",params:[{name:"new_messages",type:"Vector"},{name:"new_encrypted_messages",type:"Vector"},{name:"other_updates",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"},{name:"intermediate_state",type:"updates.State"}],type:"updates.Difference"},{id:-484987010,predicate:"updatesTooLong",params:[],type:"Updates"},{id:826001400,predicate:"updateShortMessage",params:[{name:"flags",type:"#"},{name:"out",type:"flags.1?true"},{name:"mentioned",type:"flags.4?true"},{name:"media_unread",type:"flags.5?true"},{name:"silent",type:"flags.13?true"},{name:"id",type:"int"},{name:"user_id",type:"long"},{name:"message",type:"string"},{name:"pts",type:"int"},{name:"pts_count",type:"int"},{name:"date",type:"int"},{name:"fwd_from",type:"flags.2?MessageFwdHeader"},{name:"via_bot_id",type:"flags.11?long"},{name:"reply_to",type:"flags.3?MessageReplyHeader"},{name:"entities",type:"flags.7?Vector"},{name:"ttl_period",type:"flags.25?int"}],type:"Updates"},{id:1299050149,predicate:"updateShortChatMessage",params:[{name:"flags",type:"#"},{name:"out",type:"flags.1?true"},{name:"mentioned",type:"flags.4?true"},{name:"media_unread",type:"flags.5?true"},{name:"silent",type:"flags.13?true"},{name:"id",type:"int"},{name:"from_id",type:"long"},{name:"chat_id",type:"long"},{name:"message",type:"string"},{name:"pts",type:"int"},{name:"pts_count",type:"int"},{name:"date",type:"int"},{name:"fwd_from",type:"flags.2?MessageFwdHeader"},{name:"via_bot_id",type:"flags.11?long"},{name:"reply_to",type:"flags.3?MessageReplyHeader"},{name:"entities",type:"flags.7?Vector"},{name:"ttl_period",type:"flags.25?int"}],type:"Updates"},{id:2027216577,predicate:"updateShort",params:[{name:"update",type:"Update"},{name:"date",type:"int"}],type:"Updates"},{id:1918567619,predicate:"updatesCombined",params:[{name:"updates",type:"Vector"},{name:"users",type:"Vector"},{name:"chats",type:"Vector"},{name:"date",type:"int"},{name:"seq_start",type:"int"},{name:"seq",type:"int"}],type:"Updates"},{id:1957577280,predicate:"updates",params:[{name:"updates",type:"Vector"},{name:"users",type:"Vector"},{name:"chats",type:"Vector"},{name:"date",type:"int"},{name:"seq",type:"int"}],type:"Updates"},{id:-1916114267,predicate:"photos.photos",params:[{name:"photos",type:"Vector"},{name:"users",type:"Vector"}],type:"photos.Photos"},{id:352657236,predicate:"photos.photosSlice",params:[{name:"count",type:"int"},{name:"photos",type:"Vector"},{name:"users",type:"Vector"}],type:"photos.Photos"},{id:539045032,predicate:"photos.photo",params:[{name:"photo",type:"Photo"},{name:"users",type:"Vector"}],type:"photos.Photo"},{id:157948117,predicate:"upload.file",params:[{name:"type",type:"storage.FileType"},{name:"mtime",type:"int"},{name:"bytes",type:"bytes"}],type:"upload.File"},{id:414687501,predicate:"dcOption",params:[{name:"flags",type:"#"},{name:"ipv6",type:"flags.0?true"},{name:"media_only",type:"flags.1?true"},{name:"tcpo_only",type:"flags.2?true"},{name:"cdn",type:"flags.3?true"},{name:"static",type:"flags.4?true"},{name:"this_port_only",type:"flags.5?true"},{name:"id",type:"int"},{name:"ip_address",type:"string"},{name:"port",type:"int"},{name:"secret",type:"flags.10?bytes"}],type:"DcOption"},{id:589653676,predicate:"config",params:[{name:"flags",type:"#"},{name:"phonecalls_enabled",type:"flags.1?true"},{name:"default_p2p_contacts",type:"flags.3?true"},{name:"preload_featured_stickers",type:"flags.4?true"},{name:"ignore_phone_entities",type:"flags.5?true"},{name:"revoke_pm_inbox",type:"flags.6?true"},{name:"blocked_mode",type:"flags.8?true"},{name:"pfs_enabled",type:"flags.13?true"},{name:"force_try_ipv6",type:"flags.14?true"},{name:"date",type:"int"},{name:"expires",type:"int"},{name:"test_mode",type:"Bool"},{name:"this_dc",type:"int"},{name:"dc_options",type:"Vector"},{name:"dc_txt_domain_name",type:"string"},{name:"chat_size_max",type:"int"},{name:"megagroup_size_max",type:"int"},{name:"forwarded_count_max",type:"int"},{name:"online_update_period_ms",type:"int"},{name:"offline_blur_timeout_ms",type:"int"},{name:"offline_idle_timeout_ms",type:"int"},{name:"online_cloud_timeout_ms",type:"int"},{name:"notify_cloud_delay_ms",type:"int"},{name:"notify_default_delay_ms",type:"int"},{name:"push_chat_period_ms",type:"int"},{name:"push_chat_limit",type:"int"},{name:"saved_gifs_limit",type:"int"},{name:"edit_time_limit",type:"int"},{name:"revoke_time_limit",type:"int"},{name:"revoke_pm_time_limit",type:"int"},{name:"rating_e_decay",type:"int"},{name:"stickers_recent_limit",type:"int"},{name:"stickers_faved_limit",type:"int"},{name:"channels_read_media_period",type:"int"},{name:"tmp_sessions",type:"flags.0?int"},{name:"pinned_dialogs_count_max",type:"int"},{name:"pinned_infolder_count_max",type:"int"},{name:"call_receive_timeout_ms",type:"int"},{name:"call_ring_timeout_ms",type:"int"},{name:"call_connect_timeout_ms",type:"int"},{name:"call_packet_timeout_ms",type:"int"},{name:"me_url_prefix",type:"string"},{name:"autoupdate_url_prefix",type:"flags.7?string"},{name:"gif_search_username",type:"flags.9?string"},{name:"venue_search_username",type:"flags.10?string"},{name:"img_search_username",type:"flags.11?string"},{name:"static_maps_provider",type:"flags.12?string"},{name:"caption_length_max",type:"int"},{name:"message_length_max",type:"int"},{name:"webfile_dc_id",type:"int"},{name:"suggested_lang_code",type:"flags.2?string"},{name:"lang_pack_version",type:"flags.2?int"},{name:"base_lang_pack_version",type:"flags.2?int"},{name:"reactions_default",type:"flags.15?Reaction"}],type:"Config"},{id:-1910892683,predicate:"nearestDc",params:[{name:"country",type:"string"},{name:"this_dc",type:"int"},{name:"nearest_dc",type:"int"}],type:"NearestDc"},{id:-860107216,predicate:"help.appUpdate",params:[{name:"flags",type:"#"},{name:"can_not_skip",type:"flags.0?true"},{name:"id",type:"int"},{name:"version",type:"string"},{name:"text",type:"string"},{name:"entities",type:"Vector"},{name:"document",type:"flags.1?Document"},{name:"url",type:"flags.2?string"},{name:"sticker",type:"flags.3?Document"}],type:"help.AppUpdate"},{id:-1000708810,predicate:"help.noAppUpdate",params:[],type:"help.AppUpdate"},{id:415997816,predicate:"help.inviteText",params:[{name:"message",type:"string"}],type:"help.InviteText"},{id:314359194,predicate:"updateNewEncryptedMessage",params:[{name:"message",type:"EncryptedMessage"},{name:"qts",type:"int"}],type:"Update"},{id:386986326,predicate:"updateEncryptedChatTyping",params:[{name:"chat_id",type:"int"}],type:"Update"},{id:-1264392051,predicate:"updateEncryption",params:[{name:"chat",type:"EncryptedChat"},{name:"date",type:"int"}],type:"Update"},{id:956179895,predicate:"updateEncryptedMessagesRead",params:[{name:"chat_id",type:"int"},{name:"max_date",type:"int"},{name:"date",type:"int"}],type:"Update"},{id:-1417756512,predicate:"encryptedChatEmpty",params:[{name:"id",type:"int"}],type:"EncryptedChat"},{id:1722964307,predicate:"encryptedChatWaiting",params:[{name:"id",type:"int"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"}],type:"EncryptedChat"},{id:1223809356,predicate:"encryptedChatRequested",params:[{name:"flags",type:"#"},{name:"folder_id",type:"flags.0?int"},{name:"id",type:"int"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"g_a",type:"bytes"}],type:"EncryptedChat"},{id:1643173063,predicate:"encryptedChat",params:[{name:"id",type:"int"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"g_a_or_b",type:"bytes"},{name:"key_fingerprint",type:"long"}],type:"EncryptedChat"},{id:505183301,predicate:"encryptedChatDiscarded",params:[{name:"flags",type:"#"},{name:"history_deleted",type:"flags.0?true"},{name:"id",type:"int"}],type:"EncryptedChat"},{id:-247351839,predicate:"inputEncryptedChat",params:[{name:"chat_id",type:"int"},{name:"access_hash",type:"long"}],type:"InputEncryptedChat"},{id:-1038136962,predicate:"encryptedFileEmpty",params:[],type:"EncryptedFile"},{id:-1476358952,predicate:"encryptedFile",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"size",type:"long"},{name:"dc_id",type:"int"},{name:"key_fingerprint",type:"int"}],type:"EncryptedFile"},{id:406307684,predicate:"inputEncryptedFileEmpty",params:[],type:"InputEncryptedFile"},{id:1690108678,predicate:"inputEncryptedFileUploaded",params:[{name:"id",type:"long"},{name:"parts",type:"int"},{name:"md5_checksum",type:"string"},{name:"key_fingerprint",type:"int"}],type:"InputEncryptedFile"},{id:1511503333,predicate:"inputEncryptedFile",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputEncryptedFile"},{id:-182231723,predicate:"inputEncryptedFileLocation",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputFileLocation"},{id:-317144808,predicate:"encryptedMessage",params:[{name:"random_id",type:"long"},{name:"chat_id",type:"int"},{name:"date",type:"int"},{name:"bytes",type:"bytes"},{name:"file",type:"EncryptedFile"}],type:"EncryptedMessage"},{id:594758406,predicate:"encryptedMessageService",params:[{name:"random_id",type:"long"},{name:"chat_id",type:"int"},{name:"date",type:"int"},{name:"bytes",type:"bytes"}],type:"EncryptedMessage"},{id:-1058912715,predicate:"messages.dhConfigNotModified",params:[{name:"random",type:"bytes"}],type:"messages.DhConfig"},{id:740433629,predicate:"messages.dhConfig",params:[{name:"g",type:"int"},{name:"p",type:"bytes"},{name:"version",type:"int"},{name:"random",type:"bytes"}],type:"messages.DhConfig"},{id:1443858741,predicate:"messages.sentEncryptedMessage",params:[{name:"date",type:"int"}],type:"messages.SentEncryptedMessage"},{id:-1802240206,predicate:"messages.sentEncryptedFile",params:[{name:"date",type:"int"},{name:"file",type:"EncryptedFile"}],type:"messages.SentEncryptedMessage"},{id:-95482955,predicate:"inputFileBig",params:[{name:"id",type:"long"},{name:"parts",type:"int"},{name:"name",type:"string"}],type:"InputFile"},{id:767652808,predicate:"inputEncryptedFileBigUploaded",params:[{name:"id",type:"long"},{name:"parts",type:"int"},{name:"key_fingerprint",type:"int"}],type:"InputEncryptedFile"},{id:1037718609,predicate:"updateChatParticipantAdd",params:[{name:"chat_id",type:"long"},{name:"user_id",type:"long"},{name:"inviter_id",type:"long"},{name:"date",type:"int"},{name:"version",type:"int"}],type:"Update"},{id:-483443337,predicate:"updateChatParticipantDelete",params:[{name:"chat_id",type:"long"},{name:"user_id",type:"long"},{name:"version",type:"int"}],type:"Update"},{id:-1906403213,predicate:"updateDcOptions",params:[{name:"dc_options",type:"Vector"}],type:"Update"},{id:1530447553,predicate:"inputMediaUploadedDocument",params:[{name:"flags",type:"#"},{name:"nosound_video",type:"flags.3?true"},{name:"force_file",type:"flags.4?true"},{name:"spoiler",type:"flags.5?true"},{name:"file",type:"InputFile"},{name:"thumb",type:"flags.2?InputFile"},{name:"mime_type",type:"string"},{name:"attributes",type:"Vector"},{name:"stickers",type:"flags.0?Vector"},{name:"ttl_seconds",type:"flags.1?int"}],type:"InputMedia"},{id:860303448,predicate:"inputMediaDocument",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.2?true"},{name:"id",type:"InputDocument"},{name:"ttl_seconds",type:"flags.0?int"},{name:"query",type:"flags.1?string"}],type:"InputMedia"},{id:-1666158377,predicate:"messageMediaDocument",params:[{name:"flags",type:"#"},{name:"nopremium",type:"flags.3?true"},{name:"spoiler",type:"flags.4?true"},{name:"document",type:"flags.0?Document"},{name:"ttl_seconds",type:"flags.2?int"}],type:"MessageMedia"},{id:1928391342,predicate:"inputDocumentEmpty",params:[],type:"InputDocument"},{id:448771445,predicate:"inputDocument",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"}],type:"InputDocument"},{id:-1160743548,predicate:"inputDocumentFileLocation",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"},{name:"thumb_size",type:"string"}],type:"InputFileLocation"},{id:922273905,predicate:"documentEmpty",params:[{name:"id",type:"long"}],type:"Document"},{id:-1881881384,predicate:"document",params:[{name:"flags",type:"#"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"},{name:"date",type:"int"},{name:"mime_type",type:"string"},{name:"size",type:"long"},{name:"thumbs",type:"flags.0?Vector"},{name:"video_thumbs",type:"flags.1?Vector"},{name:"dc_id",type:"int"},{name:"attributes",type:"Vector"}],type:"Document"},{id:398898678,predicate:"help.support",params:[{name:"phone_number",type:"string"},{name:"user",type:"User"}],type:"help.Support"},{id:-1613493288,predicate:"notifyPeer",params:[{name:"peer",type:"Peer"}],type:"NotifyPeer"},{id:-1261946036,predicate:"notifyUsers",params:[],type:"NotifyPeer"},{id:-1073230141,predicate:"notifyChats",params:[],type:"NotifyPeer"},{id:-1094555409,predicate:"updateNotifySettings",params:[{name:"peer",type:"NotifyPeer"},{name:"notify_settings",type:"PeerNotifySettings"}],type:"Update"},{id:381645902,predicate:"sendMessageTypingAction",params:[],type:"SendMessageAction"},{id:-44119819,predicate:"sendMessageCancelAction",params:[],type:"SendMessageAction"},{id:-1584933265,predicate:"sendMessageRecordVideoAction",params:[],type:"SendMessageAction"},{id:-378127636,predicate:"sendMessageUploadVideoAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:-718310409,predicate:"sendMessageRecordAudioAction",params:[],type:"SendMessageAction"},{id:-212740181,predicate:"sendMessageUploadAudioAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:-774682074,predicate:"sendMessageUploadPhotoAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:-1441998364,predicate:"sendMessageUploadDocumentAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:393186209,predicate:"sendMessageGeoLocationAction",params:[],type:"SendMessageAction"},{id:1653390447,predicate:"sendMessageChooseContactAction",params:[],type:"SendMessageAction"},{id:-1290580579,predicate:"contacts.found",params:[{name:"my_results",type:"Vector"},{name:"results",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"contacts.Found"},{id:-337352679,predicate:"updateServiceNotification",params:[{name:"flags",type:"#"},{name:"popup",type:"flags.0?true"},{name:"inbox_date",type:"flags.1?int"},{name:"type",type:"string"},{name:"message",type:"string"},{name:"media",type:"MessageMedia"},{name:"entities",type:"Vector"}],type:"Update"},{id:-496024847,predicate:"userStatusRecently",params:[],type:"UserStatus"},{id:129960444,predicate:"userStatusLastWeek",params:[],type:"UserStatus"},{id:2011940674,predicate:"userStatusLastMonth",params:[],type:"UserStatus"},{id:-298113238,predicate:"updatePrivacy",params:[{name:"key",type:"PrivacyKey"},{name:"rules",type:"Vector"}],type:"Update"},{id:1335282456,predicate:"inputPrivacyKeyStatusTimestamp",params:[],type:"InputPrivacyKey"},{id:-1137792208,predicate:"privacyKeyStatusTimestamp",params:[],type:"PrivacyKey"},{id:218751099,predicate:"inputPrivacyValueAllowContacts",params:[],type:"InputPrivacyRule"},{id:407582158,predicate:"inputPrivacyValueAllowAll",params:[],type:"InputPrivacyRule"},{id:320652927,predicate:"inputPrivacyValueAllowUsers",params:[{name:"users",type:"Vector"}],type:"InputPrivacyRule"},{id:195371015,predicate:"inputPrivacyValueDisallowContacts",params:[],type:"InputPrivacyRule"},{id:-697604407,predicate:"inputPrivacyValueDisallowAll",params:[],type:"InputPrivacyRule"},{id:-1877932953,predicate:"inputPrivacyValueDisallowUsers",params:[{name:"users",type:"Vector"}],type:"InputPrivacyRule"},{id:-123988,predicate:"privacyValueAllowContacts",params:[],type:"PrivacyRule"},{id:1698855810,predicate:"privacyValueAllowAll",params:[],type:"PrivacyRule"},{id:-1198497870,predicate:"privacyValueAllowUsers",params:[{name:"users",type:"Vector"}],type:"PrivacyRule"},{id:-125240806,predicate:"privacyValueDisallowContacts",params:[],type:"PrivacyRule"},{id:-1955338397,predicate:"privacyValueDisallowAll",params:[],type:"PrivacyRule"},{id:-463335103,predicate:"privacyValueDisallowUsers",params:[{name:"users",type:"Vector"}],type:"PrivacyRule"},{id:1352683077,predicate:"account.privacyRules",params:[{name:"rules",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"account.PrivacyRules"},{id:-1194283041,predicate:"accountDaysTTL",params:[{name:"days",type:"int"}],type:"AccountDaysTTL"},{id:88680979,predicate:"updateUserPhone",params:[{name:"user_id",type:"long"},{name:"phone",type:"string"}],type:"Update"},{id:1815593308,predicate:"documentAttributeImageSize",params:[{name:"w",type:"int"},{name:"h",type:"int"}],type:"DocumentAttribute"},{id:297109817,predicate:"documentAttributeAnimated",params:[],type:"DocumentAttribute"},{id:1662637586,predicate:"documentAttributeSticker",params:[{name:"flags",type:"#"},{name:"mask",type:"flags.1?true"},{name:"alt",type:"string"},{name:"stickerset",type:"InputStickerSet"},{name:"mask_coords",type:"flags.0?MaskCoords"}],type:"DocumentAttribute"},{id:250621158,predicate:"documentAttributeVideo",params:[{name:"flags",type:"#"},{name:"round_message",type:"flags.0?true"},{name:"supports_streaming",type:"flags.1?true"},{name:"duration",type:"int"},{name:"w",type:"int"},{name:"h",type:"int"}],type:"DocumentAttribute"},{id:-1739392570,predicate:"documentAttributeAudio",params:[{name:"flags",type:"#"},{name:"voice",type:"flags.10?true"},{name:"duration",type:"int"},{name:"title",type:"flags.0?string"},{name:"performer",type:"flags.1?string"},{name:"waveform",type:"flags.2?bytes"}],type:"DocumentAttribute"},{id:358154344,predicate:"documentAttributeFilename",params:[{name:"file_name",type:"string"}],type:"DocumentAttribute"},{id:-244016606,predicate:"messages.stickersNotModified",params:[],type:"messages.Stickers"},{id:816245886,predicate:"messages.stickers",params:[{name:"hash",type:"long"},{name:"stickers",type:"Vector"}],type:"messages.Stickers"},{id:313694676,predicate:"stickerPack",params:[{name:"emoticon",type:"string"},{name:"documents",type:"Vector"}],type:"StickerPack"},{id:-395967805,predicate:"messages.allStickersNotModified",params:[],type:"messages.AllStickers"},{id:-843329861,predicate:"messages.allStickers",params:[{name:"hash",type:"long"},{name:"sets",type:"Vector"}],type:"messages.AllStickers"},{id:-1667805217,predicate:"updateReadHistoryInbox",params:[{name:"flags",type:"#"},{name:"folder_id",type:"flags.0?int"},{name:"peer",type:"Peer"},{name:"max_id",type:"int"},{name:"still_unread_count",type:"int"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:791617983,predicate:"updateReadHistoryOutbox",params:[{name:"peer",type:"Peer"},{name:"max_id",type:"int"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-2066640507,predicate:"messages.affectedMessages",params:[{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"messages.AffectedMessages"},{id:2139689491,predicate:"updateWebPage",params:[{name:"webpage",type:"WebPage"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-350980120,predicate:"webPageEmpty",params:[{name:"id",type:"long"}],type:"WebPage"},{id:-981018084,predicate:"webPagePending",params:[{name:"id",type:"long"},{name:"date",type:"int"}],type:"WebPage"},{id:-392411726,predicate:"webPage",params:[{name:"flags",type:"#"},{name:"id",type:"long"},{name:"url",type:"string"},{name:"display_url",type:"string"},{name:"hash",type:"int"},{name:"type",type:"flags.0?string"},{name:"site_name",type:"flags.1?string"},{name:"title",type:"flags.2?string"},{name:"description",type:"flags.3?string"},{name:"photo",type:"flags.4?Photo"},{name:"embed_url",type:"flags.5?string"},{name:"embed_type",type:"flags.5?string"},{name:"embed_width",type:"flags.6?int"},{name:"embed_height",type:"flags.6?int"},{name:"duration",type:"flags.7?int"},{name:"author",type:"flags.8?string"},{name:"document",type:"flags.9?Document"},{name:"cached_page",type:"flags.10?Page"},{name:"attributes",type:"flags.12?Vector"}],type:"WebPage"},{id:-1557277184,predicate:"messageMediaWebPage",params:[{name:"webpage",type:"WebPage"}],type:"MessageMedia"},{id:-1392388579,predicate:"authorization",params:[{name:"flags",type:"#"},{name:"current",type:"flags.0?true"},{name:"official_app",type:"flags.1?true"},{name:"password_pending",type:"flags.2?true"},{name:"encrypted_requests_disabled",type:"flags.3?true"},{name:"call_requests_disabled",type:"flags.4?true"},{name:"hash",type:"long"},{name:"device_model",type:"string"},{name:"platform",type:"string"},{name:"system_version",type:"string"},{name:"api_id",type:"int"},{name:"app_name",type:"string"},{name:"app_version",type:"string"},{name:"date_created",type:"int"},{name:"date_active",type:"int"},{name:"ip",type:"string"},{name:"country",type:"string"},{name:"region",type:"string"}],type:"Authorization"},{id:1275039392,predicate:"account.authorizations",params:[{name:"authorization_ttl_days",type:"int"},{name:"authorizations",type:"Vector"}],type:"account.Authorizations"},{id:-1787080453,predicate:"account.password",params:[{name:"flags",type:"#"},{name:"has_recovery",type:"flags.0?true"},{name:"has_secure_values",type:"flags.1?true"},{name:"has_password",type:"flags.2?true"},{name:"current_algo",type:"flags.2?PasswordKdfAlgo"},{name:"srp_B",type:"flags.2?bytes"},{name:"srp_id",type:"flags.2?long"},{name:"hint",type:"flags.3?string"},{name:"email_unconfirmed_pattern",type:"flags.4?string"},{name:"new_algo",type:"PasswordKdfAlgo"},{name:"new_secure_algo",type:"SecurePasswordKdfAlgo"},{name:"secure_random",type:"bytes"},{name:"pending_reset_date",type:"flags.5?int"},{name:"login_email_pattern",type:"flags.6?string"}],type:"account.Password"},{id:-1705233435,predicate:"account.passwordSettings",params:[{name:"flags",type:"#"},{name:"email",type:"flags.0?string"},{name:"secure_settings",type:"flags.1?SecureSecretSettings"}],type:"account.PasswordSettings"},{id:-1036572727,predicate:"account.passwordInputSettings",params:[{name:"flags",type:"#"},{name:"new_algo",type:"flags.0?PasswordKdfAlgo"},{name:"new_password_hash",type:"flags.0?bytes"},{name:"hint",type:"flags.0?string"},{name:"email",type:"flags.1?string"},{name:"new_secure_settings",type:"flags.2?SecureSecretSettings"}],type:"account.PasswordInputSettings"},{id:326715557,predicate:"auth.passwordRecovery",params:[{name:"email_pattern",type:"string"}],type:"auth.PasswordRecovery"},{id:-1052959727,predicate:"inputMediaVenue",params:[{name:"geo_point",type:"InputGeoPoint"},{name:"title",type:"string"},{name:"address",type:"string"},{name:"provider",type:"string"},{name:"venue_id",type:"string"},{name:"venue_type",type:"string"}],type:"InputMedia"},{id:784356159,predicate:"messageMediaVenue",params:[{name:"geo",type:"GeoPoint"},{name:"title",type:"string"},{name:"address",type:"string"},{name:"provider",type:"string"},{name:"venue_id",type:"string"},{name:"venue_type",type:"string"}],type:"MessageMedia"},{id:-1551583367,predicate:"receivedNotifyMessage",params:[{name:"id",type:"int"},{name:"flags",type:"int"}],type:"ReceivedNotifyMessage"},{id:179611673,predicate:"chatInviteExported",params:[{name:"flags",type:"#"},{name:"revoked",type:"flags.0?true"},{name:"permanent",type:"flags.5?true"},{name:"request_needed",type:"flags.6?true"},{name:"link",type:"string"},{name:"admin_id",type:"long"},{name:"date",type:"int"},{name:"start_date",type:"flags.4?int"},{name:"expire_date",type:"flags.1?int"},{name:"usage_limit",type:"flags.2?int"},{name:"usage",type:"flags.3?int"},{name:"requested",type:"flags.7?int"},{name:"title",type:"flags.8?string"}],type:"ExportedChatInvite"},{id:1516793212,predicate:"chatInviteAlready",params:[{name:"chat",type:"Chat"}],type:"ChatInvite"},{id:806110401,predicate:"chatInvite",params:[{name:"flags",type:"#"},{name:"channel",type:"flags.0?true"},{name:"broadcast",type:"flags.1?true"},{name:"public",type:"flags.2?true"},{name:"megagroup",type:"flags.3?true"},{name:"request_needed",type:"flags.6?true"},{name:"title",type:"string"},{name:"about",type:"flags.5?string"},{name:"photo",type:"Photo"},{name:"participants_count",type:"int"},{name:"participants",type:"flags.4?Vector"}],type:"ChatInvite"},{id:51520707,predicate:"messageActionChatJoinedByLink",params:[{name:"inviter_id",type:"long"}],type:"MessageAction"},{id:1757493555,predicate:"updateReadMessagesContents",params:[{name:"messages",type:"Vector"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-4838507,predicate:"inputStickerSetEmpty",params:[],type:"InputStickerSet"},{id:-1645763991,predicate:"inputStickerSetID",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputStickerSet"},{id:-2044933984,predicate:"inputStickerSetShortName",params:[{name:"short_name",type:"string"}],type:"InputStickerSet"},{id:768691932,predicate:"stickerSet",params:[{name:"flags",type:"#"},{name:"archived",type:"flags.1?true"},{name:"official",type:"flags.2?true"},{name:"masks",type:"flags.3?true"},{name:"animated",type:"flags.5?true"},{name:"videos",type:"flags.6?true"},{name:"emojis",type:"flags.7?true"},{name:"installed_date",type:"flags.0?int"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"title",type:"string"},{name:"short_name",type:"string"},{name:"thumbs",type:"flags.4?Vector"},{name:"thumb_dc_id",type:"flags.4?int"},{name:"thumb_version",type:"flags.4?int"},{name:"thumb_document_id",type:"flags.8?long"},{name:"count",type:"int"},{name:"hash",type:"int"}],type:"StickerSet"},{id:1846886166,predicate:"messages.stickerSet",params:[{name:"set",type:"StickerSet"},{name:"packs",type:"Vector"},{name:"keywords",type:"Vector"},{name:"documents",type:"Vector"}],type:"messages.StickerSet"},{id:-1885878744,predicate:"user",params:[{name:"flags",type:"#"},{name:"self",type:"flags.10?true"},{name:"contact",type:"flags.11?true"},{name:"mutual_contact",type:"flags.12?true"},{name:"deleted",type:"flags.13?true"},{name:"bot",type:"flags.14?true"},{name:"bot_chat_history",type:"flags.15?true"},{name:"bot_nochats",type:"flags.16?true"},{name:"verified",type:"flags.17?true"},{name:"restricted",type:"flags.18?true"},{name:"min",type:"flags.20?true"},{name:"bot_inline_geo",type:"flags.21?true"},{name:"support",type:"flags.23?true"},{name:"scam",type:"flags.24?true"},{name:"apply_min_photo",type:"flags.25?true"},{name:"fake",type:"flags.26?true"},{name:"bot_attach_menu",type:"flags.27?true"},{name:"premium",type:"flags.28?true"},{name:"attach_menu_enabled",type:"flags.29?true"},{name:"flags2",type:"#"},{name:"id",type:"long"},{name:"access_hash",type:"flags.0?long"},{name:"first_name",type:"flags.1?string"},{name:"last_name",type:"flags.2?string"},{name:"username",type:"flags.3?string"},{name:"phone",type:"flags.4?string"},{name:"photo",type:"flags.5?UserProfilePhoto"},{name:"status",type:"flags.6?UserStatus"},{name:"bot_info_version",type:"flags.14?int"},{name:"restriction_reason",type:"flags.18?Vector"},{name:"bot_inline_placeholder",type:"flags.19?string"},{name:"lang_code",type:"flags.22?string"},{name:"emoji_status",type:"flags.30?EmojiStatus"},{name:"usernames",type:"flags2.0?Vector"}],type:"User"},{id:-1032140601,predicate:"botCommand",params:[{name:"command",type:"string"},{name:"description",type:"string"}],type:"BotCommand"},{id:-1892676777,predicate:"botInfo",params:[{name:"flags",type:"#"},{name:"user_id",type:"flags.0?long"},{name:"description",type:"flags.1?string"},{name:"description_photo",type:"flags.4?Photo"},{name:"description_document",type:"flags.5?Document"},{name:"commands",type:"flags.2?Vector"},{name:"menu_button",type:"flags.3?BotMenuButton"}],type:"BotInfo"},{id:-1560655744,predicate:"keyboardButton",params:[{name:"text",type:"string"}],type:"KeyboardButton"},{id:2002815875,predicate:"keyboardButtonRow",params:[{name:"buttons",type:"Vector"}],type:"KeyboardButtonRow"},{id:-1606526075,predicate:"replyKeyboardHide",params:[{name:"flags",type:"#"},{name:"selective",type:"flags.2?true"}],type:"ReplyMarkup"},{id:-2035021048,predicate:"replyKeyboardForceReply",params:[{name:"flags",type:"#"},{name:"single_use",type:"flags.1?true"},{name:"selective",type:"flags.2?true"},{name:"placeholder",type:"flags.3?string"}],type:"ReplyMarkup"},{id:-2049074735,predicate:"replyKeyboardMarkup",params:[{name:"flags",type:"#"},{name:"resize",type:"flags.0?true"},{name:"single_use",type:"flags.1?true"},{name:"selective",type:"flags.2?true"},{name:"persistent",type:"flags.4?true"},{name:"rows",type:"Vector"},{name:"placeholder",type:"flags.3?string"}],type:"ReplyMarkup"},{id:-571955892,predicate:"inputPeerUser",params:[{name:"user_id",type:"long"},{name:"access_hash",type:"long"}],type:"InputPeer"},{id:-233744186,predicate:"inputUser",params:[{name:"user_id",type:"long"},{name:"access_hash",type:"long"}],type:"InputUser"},{id:-1148011883,predicate:"messageEntityUnknown",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-100378723,predicate:"messageEntityMention",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1868782349,predicate:"messageEntityHashtag",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1827637959,predicate:"messageEntityBotCommand",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1859134776,predicate:"messageEntityUrl",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1692693954,predicate:"messageEntityEmail",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-1117713463,predicate:"messageEntityBold",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-2106619040,predicate:"messageEntityItalic",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:681706865,predicate:"messageEntityCode",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1938967520,predicate:"messageEntityPre",params:[{name:"offset",type:"int"},{name:"length",type:"int"},{name:"language",type:"string"}],type:"MessageEntity"},{id:1990644519,predicate:"messageEntityTextUrl",params:[{name:"offset",type:"int"},{name:"length",type:"int"},{name:"url",type:"string"}],type:"MessageEntity"},{id:-1877614335,predicate:"updateShortSentMessage",params:[{name:"flags",type:"#"},{name:"out",type:"flags.1?true"},{name:"id",type:"int"},{name:"pts",type:"int"},{name:"pts_count",type:"int"},{name:"date",type:"int"},{name:"media",type:"flags.9?MessageMedia"},{name:"entities",type:"flags.7?Vector"},{name:"ttl_period",type:"flags.25?int"}],type:"Updates"},{id:-292807034,predicate:"inputChannelEmpty",params:[],type:"InputChannel"},{id:-212145112,predicate:"inputChannel",params:[{name:"channel_id",type:"long"},{name:"access_hash",type:"long"}],type:"InputChannel"},{id:-1566230754,predicate:"peerChannel",params:[{name:"channel_id",type:"long"}],type:"Peer"},{id:666680316,predicate:"inputPeerChannel",params:[{name:"channel_id",type:"long"},{name:"access_hash",type:"long"}],type:"InputPeer"},{id:-2094689180,predicate:"channel",params:[{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"left",type:"flags.2?true"},{name:"broadcast",type:"flags.5?true"},{name:"verified",type:"flags.7?true"},{name:"megagroup",type:"flags.8?true"},{name:"restricted",type:"flags.9?true"},{name:"signatures",type:"flags.11?true"},{name:"min",type:"flags.12?true"},{name:"scam",type:"flags.19?true"},{name:"has_link",type:"flags.20?true"},{name:"has_geo",type:"flags.21?true"},{name:"slowmode_enabled",type:"flags.22?true"},{name:"call_active",type:"flags.23?true"},{name:"call_not_empty",type:"flags.24?true"},{name:"fake",type:"flags.25?true"},{name:"gigagroup",type:"flags.26?true"},{name:"noforwards",type:"flags.27?true"},{name:"join_to_send",type:"flags.28?true"},{name:"join_request",type:"flags.29?true"},{name:"forum",type:"flags.30?true"},{name:"flags2",type:"#"},{name:"id",type:"long"},{name:"access_hash",type:"flags.13?long"},{name:"title",type:"string"},{name:"username",type:"flags.6?string"},{name:"photo",type:"ChatPhoto"},{name:"date",type:"int"},{name:"restriction_reason",type:"flags.9?Vector"},{name:"admin_rights",type:"flags.14?ChatAdminRights"},{name:"banned_rights",type:"flags.15?ChatBannedRights"},{name:"default_banned_rights",type:"flags.18?ChatBannedRights"},{name:"participants_count",type:"flags.17?int"},{name:"usernames",type:"flags2.0?Vector"}],type:"Chat"},{id:399807445,predicate:"channelForbidden",params:[{name:"flags",type:"#"},{name:"broadcast",type:"flags.5?true"},{name:"megagroup",type:"flags.8?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"title",type:"string"},{name:"until_date",type:"flags.16?int"}],type:"Chat"},{id:2131196633,predicate:"contacts.resolvedPeer",params:[{name:"peer",type:"Peer"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"contacts.ResolvedPeer"},{id:-231385849,predicate:"channelFull",params:[{name:"flags",type:"#"},{name:"can_view_participants",type:"flags.3?true"},{name:"can_set_username",type:"flags.6?true"},{name:"can_set_stickers",type:"flags.7?true"},{name:"hidden_prehistory",type:"flags.10?true"},{name:"can_set_location",type:"flags.16?true"},{name:"has_scheduled",type:"flags.19?true"},{name:"can_view_stats",type:"flags.20?true"},{name:"blocked",type:"flags.22?true"},{name:"flags2",type:"#"},{name:"can_delete_channel",type:"flags2.0?true"},{name:"antispam",type:"flags2.1?true"},{name:"participants_hidden",type:"flags2.2?true"},{name:"translations_disabled",type:"flags2.3?true"},{name:"id",type:"long"},{name:"about",type:"string"},{name:"participants_count",type:"flags.0?int"},{name:"admins_count",type:"flags.1?int"},{name:"kicked_count",type:"flags.2?int"},{name:"banned_count",type:"flags.2?int"},{name:"online_count",type:"flags.13?int"},{name:"read_inbox_max_id",type:"int"},{name:"read_outbox_max_id",type:"int"},{name:"unread_count",type:"int"},{name:"chat_photo",type:"Photo"},{name:"notify_settings",type:"PeerNotifySettings"},{name:"exported_invite",type:"flags.23?ExportedChatInvite"},{name:"bot_info",type:"Vector"},{name:"migrated_from_chat_id",type:"flags.4?long"},{name:"migrated_from_max_id",type:"flags.4?int"},{name:"pinned_msg_id",type:"flags.5?int"},{name:"stickerset",type:"flags.8?StickerSet"},{name:"available_min_id",type:"flags.9?int"},{name:"folder_id",type:"flags.11?int"},{name:"linked_chat_id",type:"flags.14?long"},{name:"location",type:"flags.15?ChannelLocation"},{name:"slowmode_seconds",type:"flags.17?int"},{name:"slowmode_next_send_date",type:"flags.18?int"},{name:"stats_dc",type:"flags.12?int"},{name:"pts",type:"int"},{name:"call",type:"flags.21?InputGroupCall"},{name:"ttl_period",type:"flags.24?int"},{name:"pending_suggestions",type:"flags.25?Vector"},{name:"groupcall_default_join_as",type:"flags.26?Peer"},{name:"theme_emoticon",type:"flags.27?string"},{name:"requests_pending",type:"flags.28?int"},{name:"recent_requesters",type:"flags.28?Vector"},{name:"default_send_as",type:"flags.29?Peer"},{name:"available_reactions",type:"flags.30?ChatReactions"}],type:"ChatFull"},{id:182649427,predicate:"messageRange",params:[{name:"min_id",type:"int"},{name:"max_id",type:"int"}],type:"MessageRange"},{id:-948520370,predicate:"messages.channelMessages",params:[{name:"flags",type:"#"},{name:"inexact",type:"flags.1?true"},{name:"pts",type:"int"},{name:"count",type:"int"},{name:"offset_id_offset",type:"flags.2?int"},{name:"messages",type:"Vector"},{name:"topics",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.Messages"},{id:-1781355374,predicate:"messageActionChannelCreate",params:[{name:"title",type:"string"}],type:"MessageAction"},{id:277713951,predicate:"updateChannelTooLong",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"pts",type:"flags.0?int"}],type:"Update"},{id:1666927625,predicate:"updateChannel",params:[{name:"channel_id",type:"long"}],type:"Update"},{id:1656358105,predicate:"updateNewChannelMessage",params:[{name:"message",type:"Message"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-1842450928,predicate:"updateReadChannelInbox",params:[{name:"flags",type:"#"},{name:"folder_id",type:"flags.0?int"},{name:"channel_id",type:"long"},{name:"max_id",type:"int"},{name:"still_unread_count",type:"int"},{name:"pts",type:"int"}],type:"Update"},{id:-1020437742,predicate:"updateDeleteChannelMessages",params:[{name:"channel_id",type:"long"},{name:"messages",type:"Vector"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-232346616,predicate:"updateChannelMessageViews",params:[{name:"channel_id",type:"long"},{name:"id",type:"int"},{name:"views",type:"int"}],type:"Update"},{id:1041346555,predicate:"updates.channelDifferenceEmpty",params:[{name:"flags",type:"#"},{name:"final",type:"flags.0?true"},{name:"pts",type:"int"},{name:"timeout",type:"flags.1?int"}],type:"updates.ChannelDifference"},{id:-1531132162,predicate:"updates.channelDifferenceTooLong",params:[{name:"flags",type:"#"},{name:"final",type:"flags.0?true"},{name:"timeout",type:"flags.1?int"},{name:"dialog",type:"Dialog"},{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"updates.ChannelDifference"},{id:543450958,predicate:"updates.channelDifference",params:[{name:"flags",type:"#"},{name:"final",type:"flags.0?true"},{name:"pts",type:"int"},{name:"timeout",type:"flags.1?int"},{name:"new_messages",type:"Vector"},{name:"other_updates",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"updates.ChannelDifference"},{id:-1798033689,predicate:"channelMessagesFilterEmpty",params:[],type:"ChannelMessagesFilter"},{id:-847783593,predicate:"channelMessagesFilter",params:[{name:"flags",type:"#"},{name:"exclude_new_messages",type:"flags.1?true"},{name:"ranges",type:"Vector"}],type:"ChannelMessagesFilter"},{id:-1072953408,predicate:"channelParticipant",params:[{name:"user_id",type:"long"},{name:"date",type:"int"}],type:"ChannelParticipant"},{id:900251559,predicate:"channelParticipantSelf",params:[{name:"flags",type:"#"},{name:"via_request",type:"flags.0?true"},{name:"user_id",type:"long"},{name:"inviter_id",type:"long"},{name:"date",type:"int"}],type:"ChannelParticipant"},{id:803602899,predicate:"channelParticipantCreator",params:[{name:"flags",type:"#"},{name:"user_id",type:"long"},{name:"admin_rights",type:"ChatAdminRights"},{name:"rank",type:"flags.0?string"}],type:"ChannelParticipant"},{id:-566281095,predicate:"channelParticipantsRecent",params:[],type:"ChannelParticipantsFilter"},{id:-1268741783,predicate:"channelParticipantsAdmins",params:[],type:"ChannelParticipantsFilter"},{id:-1548400251,predicate:"channelParticipantsKicked",params:[{name:"q",type:"string"}],type:"ChannelParticipantsFilter"},{id:-1699676497,predicate:"channels.channelParticipants",params:[{name:"count",type:"int"},{name:"participants",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"channels.ChannelParticipants"},{id:-541588713,predicate:"channels.channelParticipant",params:[{name:"participant",type:"ChannelParticipant"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"channels.ChannelParticipant"},{id:-462696732,predicate:"chatParticipantCreator",params:[{name:"user_id",type:"long"}],type:"ChatParticipant"},{id:-1600962725,predicate:"chatParticipantAdmin",params:[{name:"user_id",type:"long"},{name:"inviter_id",type:"long"},{name:"date",type:"int"}],type:"ChatParticipant"},{id:-674602590,predicate:"updateChatParticipantAdmin",params:[{name:"chat_id",type:"long"},{name:"user_id",type:"long"},{name:"is_admin",type:"Bool"},{name:"version",type:"int"}],type:"Update"},{id:-519864430,predicate:"messageActionChatMigrateTo",params:[{name:"channel_id",type:"long"}],type:"MessageAction"},{id:-365344535,predicate:"messageActionChannelMigrateFrom",params:[{name:"title",type:"string"},{name:"chat_id",type:"long"}],type:"MessageAction"},{id:-1328445861,predicate:"channelParticipantsBots",params:[],type:"ChannelParticipantsFilter"},{id:2013922064,predicate:"help.termsOfService",params:[{name:"flags",type:"#"},{name:"popup",type:"flags.0?true"},{name:"id",type:"DataJSON"},{name:"text",type:"string"},{name:"entities",type:"Vector"},{name:"min_age_confirm",type:"flags.1?int"}],type:"help.TermsOfService"},{id:1753886890,predicate:"updateNewStickerSet",params:[{name:"stickerset",type:"messages.StickerSet"}],type:"Update"},{id:196268545,predicate:"updateStickerSetsOrder",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"emojis",type:"flags.1?true"},{name:"order",type:"Vector"}],type:"Update"},{id:834816008,predicate:"updateStickerSets",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"emojis",type:"flags.1?true"}],type:"Update"},{id:-402498398,predicate:"messages.savedGifsNotModified",params:[],type:"messages.SavedGifs"},{id:-2069878259,predicate:"messages.savedGifs",params:[{name:"hash",type:"long"},{name:"gifs",type:"Vector"}],type:"messages.SavedGifs"},{id:-1821035490,predicate:"updateSavedGifs",params:[],type:"Update"},{id:864077702,predicate:"inputBotInlineMessageMediaAuto",params:[{name:"flags",type:"#"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:1036876423,predicate:"inputBotInlineMessageText",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.0?true"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:-2000710887,predicate:"inputBotInlineResult",params:[{name:"flags",type:"#"},{name:"id",type:"string"},{name:"type",type:"string"},{name:"title",type:"flags.1?string"},{name:"description",type:"flags.2?string"},{name:"url",type:"flags.3?string"},{name:"thumb",type:"flags.4?InputWebDocument"},{name:"content",type:"flags.5?InputWebDocument"},{name:"send_message",type:"InputBotInlineMessage"}],type:"InputBotInlineResult"},{id:1984755728,predicate:"botInlineMessageMediaAuto",params:[{name:"flags",type:"#"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:-1937807902,predicate:"botInlineMessageText",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.0?true"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:295067450,predicate:"botInlineResult",params:[{name:"flags",type:"#"},{name:"id",type:"string"},{name:"type",type:"string"},{name:"title",type:"flags.1?string"},{name:"description",type:"flags.2?string"},{name:"url",type:"flags.3?string"},{name:"thumb",type:"flags.4?WebDocument"},{name:"content",type:"flags.5?WebDocument"},{name:"send_message",type:"BotInlineMessage"}],type:"BotInlineResult"},{id:-1803769784,predicate:"messages.botResults",params:[{name:"flags",type:"#"},{name:"gallery",type:"flags.0?true"},{name:"query_id",type:"long"},{name:"next_offset",type:"flags.1?string"},{name:"switch_pm",type:"flags.2?InlineBotSwitchPM"},{name:"results",type:"Vector"},{name:"cache_time",type:"int"},{name:"users",type:"Vector"}],type:"messages.BotResults"},{id:1232025500,predicate:"updateBotInlineQuery",params:[{name:"flags",type:"#"},{name:"query_id",type:"long"},{name:"user_id",type:"long"},{name:"query",type:"string"},{name:"geo",type:"flags.0?GeoPoint"},{name:"peer_type",type:"flags.1?InlineQueryPeerType"},{name:"offset",type:"string"}],type:"Update"},{id:317794823,predicate:"updateBotInlineSend",params:[{name:"flags",type:"#"},{name:"user_id",type:"long"},{name:"query",type:"string"},{name:"geo",type:"flags.0?GeoPoint"},{name:"id",type:"string"},{name:"msg_id",type:"flags.1?InputBotInlineMessageID"}],type:"Update"},{id:1358283666,predicate:"inputMessagesFilterVoice",params:[],type:"MessagesFilter"},{id:928101534,predicate:"inputMessagesFilterMusic",params:[],type:"MessagesFilter"},{id:-1107622874,predicate:"inputPrivacyKeyChatInvite",params:[],type:"InputPrivacyKey"},{id:1343122938,predicate:"privacyKeyChatInvite",params:[],type:"PrivacyKey"},{id:1571494644,predicate:"exportedMessageLink",params:[{name:"link",type:"string"},{name:"html",type:"string"}],type:"ExportedMessageLink"},{id:1601666510,predicate:"messageFwdHeader",params:[{name:"flags",type:"#"},{name:"imported",type:"flags.7?true"},{name:"from_id",type:"flags.0?Peer"},{name:"from_name",type:"flags.5?string"},{name:"date",type:"int"},{name:"channel_post",type:"flags.2?int"},{name:"post_author",type:"flags.3?string"},{name:"saved_from_peer",type:"flags.4?Peer"},{name:"saved_from_msg_id",type:"flags.4?int"},{name:"psa_type",type:"flags.6?string"}],type:"MessageFwdHeader"},{id:457133559,predicate:"updateEditChannelMessage",params:[{name:"message",type:"Message"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-1799538451,predicate:"messageActionPinMessage",params:[],type:"MessageAction"},{id:1923290508,predicate:"auth.codeTypeSms",params:[],type:"auth.CodeType"},{id:1948046307,predicate:"auth.codeTypeCall",params:[],type:"auth.CodeType"},{id:577556219,predicate:"auth.codeTypeFlashCall",params:[],type:"auth.CodeType"},{id:1035688326,predicate:"auth.sentCodeTypeApp",params:[{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:-1073693790,predicate:"auth.sentCodeTypeSms",params:[{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:1398007207,predicate:"auth.sentCodeTypeCall",params:[{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:-1425815847,predicate:"auth.sentCodeTypeFlashCall",params:[{name:"pattern",type:"string"}],type:"auth.SentCodeType"},{id:629866245,predicate:"keyboardButtonUrl",params:[{name:"text",type:"string"},{name:"url",type:"string"}],type:"KeyboardButton"},{id:901503851,predicate:"keyboardButtonCallback",params:[{name:"flags",type:"#"},{name:"requires_password",type:"flags.0?true"},{name:"text",type:"string"},{name:"data",type:"bytes"}],type:"KeyboardButton"},{id:-1318425559,predicate:"keyboardButtonRequestPhone",params:[{name:"text",type:"string"}],type:"KeyboardButton"},{id:-59151553,predicate:"keyboardButtonRequestGeoLocation",params:[{name:"text",type:"string"}],type:"KeyboardButton"},{id:90744648,predicate:"keyboardButtonSwitchInline",params:[{name:"flags",type:"#"},{name:"same_peer",type:"flags.0?true"},{name:"text",type:"string"},{name:"query",type:"string"}],type:"KeyboardButton"},{id:1218642516,predicate:"replyInlineMarkup",params:[{name:"rows",type:"Vector"}],type:"ReplyMarkup"},{id:911761060,predicate:"messages.botCallbackAnswer",params:[{name:"flags",type:"#"},{name:"alert",type:"flags.1?true"},{name:"has_url",type:"flags.3?true"},{name:"native_ui",type:"flags.4?true"},{name:"message",type:"flags.0?string"},{name:"url",type:"flags.2?string"},{name:"cache_time",type:"int"}],type:"messages.BotCallbackAnswer"},{id:-1177566067,predicate:"updateBotCallbackQuery",params:[{name:"flags",type:"#"},{name:"query_id",type:"long"},{name:"user_id",type:"long"},{name:"peer",type:"Peer"},{name:"msg_id",type:"int"},{name:"chat_instance",type:"long"},{name:"data",type:"flags.0?bytes"},{name:"game_short_name",type:"flags.1?string"}],type:"Update"},{id:649453030,predicate:"messages.messageEditData",params:[{name:"flags",type:"#"},{name:"caption",type:"flags.0?true"}],type:"messages.MessageEditData"},{id:-469536605,predicate:"updateEditMessage",params:[{name:"message",type:"Message"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-1768777083,predicate:"inputBotInlineMessageMediaGeo",params:[{name:"flags",type:"#"},{name:"geo_point",type:"InputGeoPoint"},{name:"heading",type:"flags.0?int"},{name:"period",type:"flags.1?int"},{name:"proximity_notification_radius",type:"flags.3?int"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:1098628881,predicate:"inputBotInlineMessageMediaVenue",params:[{name:"flags",type:"#"},{name:"geo_point",type:"InputGeoPoint"},{name:"title",type:"string"},{name:"address",type:"string"},{name:"provider",type:"string"},{name:"venue_id",type:"string"},{name:"venue_type",type:"string"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:-1494368259,predicate:"inputBotInlineMessageMediaContact",params:[{name:"flags",type:"#"},{name:"phone_number",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"vcard",type:"string"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:85477117,predicate:"botInlineMessageMediaGeo",params:[{name:"flags",type:"#"},{name:"geo",type:"GeoPoint"},{name:"heading",type:"flags.0?int"},{name:"period",type:"flags.1?int"},{name:"proximity_notification_radius",type:"flags.3?int"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:-1970903652,predicate:"botInlineMessageMediaVenue",params:[{name:"flags",type:"#"},{name:"geo",type:"GeoPoint"},{name:"title",type:"string"},{name:"address",type:"string"},{name:"provider",type:"string"},{name:"venue_id",type:"string"},{name:"venue_type",type:"string"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:416402882,predicate:"botInlineMessageMediaContact",params:[{name:"flags",type:"#"},{name:"phone_number",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"vcard",type:"string"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:-1462213465,predicate:"inputBotInlineResultPhoto",params:[{name:"id",type:"string"},{name:"type",type:"string"},{name:"photo",type:"InputPhoto"},{name:"send_message",type:"InputBotInlineMessage"}],type:"InputBotInlineResult"},{id:-459324,predicate:"inputBotInlineResultDocument",params:[{name:"flags",type:"#"},{name:"id",type:"string"},{name:"type",type:"string"},{name:"title",type:"flags.1?string"},{name:"description",type:"flags.2?string"},{name:"document",type:"InputDocument"},{name:"send_message",type:"InputBotInlineMessage"}],type:"InputBotInlineResult"},{id:400266251,predicate:"botInlineMediaResult",params:[{name:"flags",type:"#"},{name:"id",type:"string"},{name:"type",type:"string"},{name:"photo",type:"flags.0?Photo"},{name:"document",type:"flags.1?Document"},{name:"title",type:"flags.2?string"},{name:"description",type:"flags.3?string"},{name:"send_message",type:"BotInlineMessage"}],type:"BotInlineResult"},{id:-1995686519,predicate:"inputBotInlineMessageID",params:[{name:"dc_id",type:"int"},{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputBotInlineMessageID"},{id:1763610706,predicate:"updateInlineBotCallbackQuery",params:[{name:"flags",type:"#"},{name:"query_id",type:"long"},{name:"user_id",type:"long"},{name:"msg_id",type:"InputBotInlineMessageID"},{name:"chat_instance",type:"long"},{name:"data",type:"flags.0?bytes"},{name:"game_short_name",type:"flags.1?string"}],type:"Update"},{id:1008755359,predicate:"inlineBotSwitchPM",params:[{name:"text",type:"string"},{name:"start_param",type:"string"}],type:"InlineBotSwitchPM"},{id:863093588,predicate:"messages.peerDialogs",params:[{name:"dialogs",type:"Vector"},{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"},{name:"state",type:"updates.State"}],type:"messages.PeerDialogs"},{id:-305282981,predicate:"topPeer",params:[{name:"peer",type:"Peer"},{name:"rating",type:"double"}],type:"TopPeer"},{id:-1419371685,predicate:"topPeerCategoryBotsPM",params:[],type:"TopPeerCategory"},{id:344356834,predicate:"topPeerCategoryBotsInline",params:[],type:"TopPeerCategory"},{id:104314861,predicate:"topPeerCategoryCorrespondents",params:[],type:"TopPeerCategory"},{id:-1122524854,predicate:"topPeerCategoryGroups",params:[],type:"TopPeerCategory"},{id:371037736,predicate:"topPeerCategoryChannels",params:[],type:"TopPeerCategory"},{id:-75283823,predicate:"topPeerCategoryPeers",params:[{name:"category",type:"TopPeerCategory"},{name:"count",type:"int"},{name:"peers",type:"Vector"}],type:"TopPeerCategoryPeers"},{id:-567906571,predicate:"contacts.topPeersNotModified",params:[],type:"contacts.TopPeers"},{id:1891070632,predicate:"contacts.topPeers",params:[{name:"categories",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"contacts.TopPeers"},{id:-595914432,predicate:"messageEntityMentionName",params:[{name:"offset",type:"int"},{name:"length",type:"int"},{name:"user_id",type:"long"}],type:"MessageEntity"},{id:546203849,predicate:"inputMessageEntityMentionName",params:[{name:"offset",type:"int"},{name:"length",type:"int"},{name:"user_id",type:"InputUser"}],type:"MessageEntity"},{id:975236280,predicate:"inputMessagesFilterChatPhotos",params:[],type:"MessagesFilter"},{id:-1218471511,predicate:"updateReadChannelOutbox",params:[{name:"channel_id",type:"long"},{name:"max_id",type:"int"}],type:"Update"},{id:457829485,predicate:"updateDraftMessage",params:[{name:"flags",type:"#"},{name:"peer",type:"Peer"},{name:"top_msg_id",type:"flags.0?int"},{name:"draft",type:"DraftMessage"}],type:"Update"},{id:453805082,predicate:"draftMessageEmpty",params:[{name:"flags",type:"#"},{name:"date",type:"flags.0?int"}],type:"DraftMessage"},{id:-40996577,predicate:"draftMessage",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.1?true"},{name:"reply_to_msg_id",type:"flags.0?int"},{name:"message",type:"string"},{name:"entities",type:"flags.3?Vector"},{name:"date",type:"int"}],type:"DraftMessage"},{id:-1615153660,predicate:"messageActionHistoryClear",params:[],type:"MessageAction"},{id:-958657434,predicate:"messages.featuredStickersNotModified",params:[{name:"count",type:"int"}],type:"messages.FeaturedStickers"},{id:-1103615738,predicate:"messages.featuredStickers",params:[{name:"flags",type:"#"},{name:"premium",type:"flags.0?true"},{name:"hash",type:"long"},{name:"count",type:"int"},{name:"sets",type:"Vector"},{name:"unread",type:"Vector"}],type:"messages.FeaturedStickers"},{id:1461528386,predicate:"updateReadFeaturedStickers",params:[],type:"Update"},{id:186120336,predicate:"messages.recentStickersNotModified",params:[],type:"messages.RecentStickers"},{id:-1999405994,predicate:"messages.recentStickers",params:[{name:"hash",type:"long"},{name:"packs",type:"Vector"},{name:"stickers",type:"Vector"},{name:"dates",type:"Vector"}],type:"messages.RecentStickers"},{id:-1706939360,predicate:"updateRecentStickers",params:[],type:"Update"},{id:1338747336,predicate:"messages.archivedStickers",params:[{name:"count",type:"int"},{name:"sets",type:"Vector"}],type:"messages.ArchivedStickers"},{id:946083368,predicate:"messages.stickerSetInstallResultSuccess",params:[],type:"messages.StickerSetInstallResult"},{id:904138920,predicate:"messages.stickerSetInstallResultArchive",params:[{name:"sets",type:"Vector"}],type:"messages.StickerSetInstallResult"},{id:1678812626,predicate:"stickerSetCovered",params:[{name:"set",type:"StickerSet"},{name:"cover",type:"Document"}],type:"StickerSetCovered"},{id:-1574314746,predicate:"updateConfig",params:[],type:"Update"},{id:861169551,predicate:"updatePtsChanged",params:[],type:"Update"},{id:-440664550,predicate:"inputMediaPhotoExternal",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.1?true"},{name:"url",type:"string"},{name:"ttl_seconds",type:"flags.0?int"}],type:"InputMedia"},{id:-78455655,predicate:"inputMediaDocumentExternal",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.1?true"},{name:"url",type:"string"},{name:"ttl_seconds",type:"flags.0?int"}],type:"InputMedia"},{id:872932635,predicate:"stickerSetMultiCovered",params:[{name:"set",type:"StickerSet"},{name:"covers",type:"Vector"}],type:"StickerSetCovered"},{id:-1361650766,predicate:"maskCoords",params:[{name:"n",type:"int"},{name:"x",type:"double"},{name:"y",type:"double"},{name:"zoom",type:"double"}],type:"MaskCoords"},{id:-1744710921,predicate:"documentAttributeHasStickers",params:[],type:"DocumentAttribute"},{id:1251549527,predicate:"inputStickeredMediaPhoto",params:[{name:"id",type:"InputPhoto"}],type:"InputStickeredMedia"},{id:70813275,predicate:"inputStickeredMediaDocument",params:[{name:"id",type:"InputDocument"}],type:"InputStickeredMedia"},{id:-1107729093,predicate:"game",params:[{name:"flags",type:"#"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"short_name",type:"string"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"Photo"},{name:"document",type:"flags.0?Document"}],type:"Game"},{id:1336154098,predicate:"inputBotInlineResultGame",params:[{name:"id",type:"string"},{name:"short_name",type:"string"},{name:"send_message",type:"InputBotInlineMessage"}],type:"InputBotInlineResult"},{id:1262639204,predicate:"inputBotInlineMessageGame",params:[{name:"flags",type:"#"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:-38694904,predicate:"messageMediaGame",params:[{name:"game",type:"Game"}],type:"MessageMedia"},{id:-750828557,predicate:"inputMediaGame",params:[{name:"id",type:"InputGame"}],type:"InputMedia"},{id:53231223,predicate:"inputGameID",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputGame"},{id:-1020139510,predicate:"inputGameShortName",params:[{name:"bot_id",type:"InputUser"},{name:"short_name",type:"string"}],type:"InputGame"},{id:1358175439,predicate:"keyboardButtonGame",params:[{name:"text",type:"string"}],type:"KeyboardButton"},{id:-1834538890,predicate:"messageActionGameScore",params:[{name:"game_id",type:"long"},{name:"score",type:"int"}],type:"MessageAction"},{id:1940093419,predicate:"highScore",params:[{name:"pos",type:"int"},{name:"user_id",type:"long"},{name:"score",type:"int"}],type:"HighScore"},{id:-1707344487,predicate:"messages.highScores",params:[{name:"scores",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.HighScores"},{id:1258196845,predicate:"updates.differenceTooLong",params:[{name:"pts",type:"int"}],type:"updates.Difference"},{id:791390623,predicate:"updateChannelWebPage",params:[{name:"channel_id",type:"long"},{name:"webpage",type:"WebPage"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-1663561404,predicate:"messages.chatsSlice",params:[{name:"count",type:"int"},{name:"chats",type:"Vector"}],type:"messages.Chats"},{id:-599948721,predicate:"textEmpty",params:[],type:"RichText"},{id:1950782688,predicate:"textPlain",params:[{name:"text",type:"string"}],type:"RichText"},{id:1730456516,predicate:"textBold",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:-653089380,predicate:"textItalic",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:-1054465340,predicate:"textUnderline",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:-1678197867,predicate:"textStrike",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:1816074681,predicate:"textFixed",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:1009288385,predicate:"textUrl",params:[{name:"text",type:"RichText"},{name:"url",type:"string"},{name:"webpage_id",type:"long"}],type:"RichText"},{id:-564523562,predicate:"textEmail",params:[{name:"text",type:"RichText"},{name:"email",type:"string"}],type:"RichText"},{id:2120376535,predicate:"textConcat",params:[{name:"texts",type:"Vector"}],type:"RichText"},{id:324435594,predicate:"pageBlockUnsupported",params:[],type:"PageBlock"},{id:1890305021,predicate:"pageBlockTitle",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:-1879401953,predicate:"pageBlockSubtitle",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:-1162877472,predicate:"pageBlockAuthorDate",params:[{name:"author",type:"RichText"},{name:"published_date",type:"int"}],type:"PageBlock"},{id:-1076861716,predicate:"pageBlockHeader",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:-248793375,predicate:"pageBlockSubheader",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:1182402406,predicate:"pageBlockParagraph",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:-1066346178,predicate:"pageBlockPreformatted",params:[{name:"text",type:"RichText"},{name:"language",type:"string"}],type:"PageBlock"},{id:1216809369,predicate:"pageBlockFooter",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:-618614392,predicate:"pageBlockDivider",params:[],type:"PageBlock"},{id:-837994576,predicate:"pageBlockAnchor",params:[{name:"name",type:"string"}],type:"PageBlock"},{id:-454524911,predicate:"pageBlockList",params:[{name:"items",type:"Vector"}],type:"PageBlock"},{id:641563686,predicate:"pageBlockBlockquote",params:[{name:"text",type:"RichText"},{name:"caption",type:"RichText"}],type:"PageBlock"},{id:1329878739,predicate:"pageBlockPullquote",params:[{name:"text",type:"RichText"},{name:"caption",type:"RichText"}],type:"PageBlock"},{id:391759200,predicate:"pageBlockPhoto",params:[{name:"flags",type:"#"},{name:"photo_id",type:"long"},{name:"caption",type:"PageCaption"},{name:"url",type:"flags.0?string"},{name:"webpage_id",type:"flags.0?long"}],type:"PageBlock"},{id:2089805750,predicate:"pageBlockVideo",params:[{name:"flags",type:"#"},{name:"autoplay",type:"flags.0?true"},{name:"loop",type:"flags.1?true"},{name:"video_id",type:"long"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:972174080,predicate:"pageBlockCover",params:[{name:"cover",type:"PageBlock"}],type:"PageBlock"},{id:-1468953147,predicate:"pageBlockEmbed",params:[{name:"flags",type:"#"},{name:"full_width",type:"flags.0?true"},{name:"allow_scrolling",type:"flags.3?true"},{name:"url",type:"flags.1?string"},{name:"html",type:"flags.2?string"},{name:"poster_photo_id",type:"flags.4?long"},{name:"w",type:"flags.5?int"},{name:"h",type:"flags.5?int"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:-229005301,predicate:"pageBlockEmbedPost",params:[{name:"url",type:"string"},{name:"webpage_id",type:"long"},{name:"author_photo_id",type:"long"},{name:"author",type:"string"},{name:"date",type:"int"},{name:"blocks",type:"Vector"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:1705048653,predicate:"pageBlockCollage",params:[{name:"items",type:"Vector"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:52401552,predicate:"pageBlockSlideshow",params:[{name:"items",type:"Vector"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:1930545681,predicate:"webPageNotModified",params:[{name:"flags",type:"#"},{name:"cached_page_views",type:"flags.0?int"}],type:"WebPage"},{id:-88417185,predicate:"inputPrivacyKeyPhoneCall",params:[],type:"InputPrivacyKey"},{id:1030105979,predicate:"privacyKeyPhoneCall",params:[],type:"PrivacyKey"},{id:-580219064,predicate:"sendMessageGamePlayAction",params:[],type:"SendMessageAction"},{id:-2048646399,predicate:"phoneCallDiscardReasonMissed",params:[],type:"PhoneCallDiscardReason"},{id:-527056480,predicate:"phoneCallDiscardReasonDisconnect",params:[],type:"PhoneCallDiscardReason"},{id:1471006352,predicate:"phoneCallDiscardReasonHangup",params:[],type:"PhoneCallDiscardReason"},{id:-84416311,predicate:"phoneCallDiscardReasonBusy",params:[],type:"PhoneCallDiscardReason"},{id:1852826908,predicate:"updateDialogPinned",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.0?true"},{name:"folder_id",type:"flags.1?int"},{name:"peer",type:"DialogPeer"}],type:"Update"},{id:-99664734,predicate:"updatePinnedDialogs",params:[{name:"flags",type:"#"},{name:"folder_id",type:"flags.1?int"},{name:"order",type:"flags.0?Vector"}],type:"Update"},{id:2104790276,predicate:"dataJSON",params:[{name:"data",type:"string"}],type:"DataJSON"},{id:-2095595325,predicate:"updateBotWebhookJSON",params:[{name:"data",type:"DataJSON"}],type:"Update"},{id:-1684914010,predicate:"updateBotWebhookJSONQuery",params:[{name:"query_id",type:"long"},{name:"data",type:"DataJSON"},{name:"timeout",type:"int"}],type:"Update"},{id:-886477832,predicate:"labeledPrice",params:[{name:"label",type:"string"},{name:"amount",type:"long"}],type:"LabeledPrice"},{id:1048946971,predicate:"invoice",params:[{name:"flags",type:"#"},{name:"test",type:"flags.0?true"},{name:"name_requested",type:"flags.1?true"},{name:"phone_requested",type:"flags.2?true"},{name:"email_requested",type:"flags.3?true"},{name:"shipping_address_requested",type:"flags.4?true"},{name:"flexible",type:"flags.5?true"},{name:"phone_to_provider",type:"flags.6?true"},{name:"email_to_provider",type:"flags.7?true"},{name:"recurring",type:"flags.9?true"},{name:"currency",type:"string"},{name:"prices",type:"Vector"},{name:"max_tip_amount",type:"flags.8?long"},{name:"suggested_tip_amounts",type:"flags.8?Vector"},{name:"recurring_terms_url",type:"flags.9?string"}],type:"Invoice"},{id:-1900697899,predicate:"inputMediaInvoice",params:[{name:"flags",type:"#"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.0?InputWebDocument"},{name:"invoice",type:"Invoice"},{name:"payload",type:"bytes"},{name:"provider",type:"string"},{name:"provider_data",type:"DataJSON"},{name:"start_param",type:"flags.1?string"},{name:"extended_media",type:"flags.2?InputMedia"}],type:"InputMedia"},{id:-368917890,predicate:"paymentCharge",params:[{name:"id",type:"string"},{name:"provider_charge_id",type:"string"}],type:"PaymentCharge"},{id:-1892568281,predicate:"messageActionPaymentSentMe",params:[{name:"flags",type:"#"},{name:"recurring_init",type:"flags.2?true"},{name:"recurring_used",type:"flags.3?true"},{name:"currency",type:"string"},{name:"total_amount",type:"long"},{name:"payload",type:"bytes"},{name:"info",type:"flags.0?PaymentRequestedInfo"},{name:"shipping_option_id",type:"flags.1?string"},{name:"charge",type:"PaymentCharge"}],type:"MessageAction"},{id:-156940077,predicate:"messageMediaInvoice",params:[{name:"flags",type:"#"},{name:"shipping_address_requested",type:"flags.1?true"},{name:"test",type:"flags.3?true"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.0?WebDocument"},{name:"receipt_msg_id",type:"flags.2?int"},{name:"currency",type:"string"},{name:"total_amount",type:"long"},{name:"start_param",type:"string"},{name:"extended_media",type:"flags.4?MessageExtendedMedia"}],type:"MessageMedia"},{id:512535275,predicate:"postAddress",params:[{name:"street_line1",type:"string"},{name:"street_line2",type:"string"},{name:"city",type:"string"},{name:"state",type:"string"},{name:"country_iso2",type:"string"},{name:"post_code",type:"string"}],type:"PostAddress"},{id:-1868808300,predicate:"paymentRequestedInfo",params:[{name:"flags",type:"#"},{name:"name",type:"flags.0?string"},{name:"phone",type:"flags.1?string"},{name:"email",type:"flags.2?string"},{name:"shipping_address",type:"flags.3?PostAddress"}],type:"PaymentRequestedInfo"},{id:-1344716869,predicate:"keyboardButtonBuy",params:[{name:"text",type:"string"}],type:"KeyboardButton"},{id:-1776926890,predicate:"messageActionPaymentSent",params:[{name:"flags",type:"#"},{name:"recurring_init",type:"flags.2?true"},{name:"recurring_used",type:"flags.3?true"},{name:"currency",type:"string"},{name:"total_amount",type:"long"},{name:"invoice_slug",type:"flags.0?string"}],type:"MessageAction"},{id:-842892769,predicate:"paymentSavedCredentialsCard",params:[{name:"id",type:"string"},{name:"title",type:"string"}],type:"PaymentSavedCredentials"},{id:475467473,predicate:"webDocument",params:[{name:"url",type:"string"},{name:"access_hash",type:"long"},{name:"size",type:"int"},{name:"mime_type",type:"string"},{name:"attributes",type:"Vector"}],type:"WebDocument"},{id:-1678949555,predicate:"inputWebDocument",params:[{name:"url",type:"string"},{name:"size",type:"int"},{name:"mime_type",type:"string"},{name:"attributes",type:"Vector"}],type:"InputWebDocument"},{id:-1036396922,predicate:"inputWebFileLocation",params:[{name:"url",type:"string"},{name:"access_hash",type:"long"}],type:"InputWebFileLocation"},{id:568808380,predicate:"upload.webFile",params:[{name:"size",type:"int"},{name:"mime_type",type:"string"},{name:"file_type",type:"storage.FileType"},{name:"mtime",type:"int"},{name:"bytes",type:"bytes"}],type:"upload.WebFile"},{id:-1610250415,predicate:"payments.paymentForm",params:[{name:"flags",type:"#"},{name:"can_save_credentials",type:"flags.2?true"},{name:"password_missing",type:"flags.3?true"},{name:"form_id",type:"long"},{name:"bot_id",type:"long"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.5?WebDocument"},{name:"invoice",type:"Invoice"},{name:"provider_id",type:"long"},{name:"url",type:"string"},{name:"native_provider",type:"flags.4?string"},{name:"native_params",type:"flags.4?DataJSON"},{name:"additional_methods",type:"flags.6?Vector"},{name:"saved_info",type:"flags.0?PaymentRequestedInfo"},{name:"saved_credentials",type:"flags.1?Vector"},{name:"users",type:"Vector"}],type:"payments.PaymentForm"},{id:-784000893,predicate:"payments.validatedRequestedInfo",params:[{name:"flags",type:"#"},{name:"id",type:"flags.0?string"},{name:"shipping_options",type:"flags.1?Vector"}],type:"payments.ValidatedRequestedInfo"},{id:1314881805,predicate:"payments.paymentResult",params:[{name:"updates",type:"Updates"}],type:"payments.PaymentResult"},{id:1891958275,predicate:"payments.paymentReceipt",params:[{name:"flags",type:"#"},{name:"date",type:"int"},{name:"bot_id",type:"long"},{name:"provider_id",type:"long"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.2?WebDocument"},{name:"invoice",type:"Invoice"},{name:"info",type:"flags.0?PaymentRequestedInfo"},{name:"shipping",type:"flags.1?ShippingOption"},{name:"tip_amount",type:"flags.3?long"},{name:"currency",type:"string"},{name:"total_amount",type:"long"},{name:"credentials_title",type:"string"},{name:"users",type:"Vector"}],type:"payments.PaymentReceipt"},{id:-74456004,predicate:"payments.savedInfo",params:[{name:"flags",type:"#"},{name:"has_saved_credentials",type:"flags.1?true"},{name:"saved_info",type:"flags.0?PaymentRequestedInfo"}],type:"payments.SavedInfo"},{id:-1056001329,predicate:"inputPaymentCredentialsSaved",params:[{name:"id",type:"string"},{name:"tmp_password",type:"bytes"}],type:"InputPaymentCredentials"},{id:873977640,predicate:"inputPaymentCredentials",params:[{name:"flags",type:"#"},{name:"save",type:"flags.0?true"},{name:"data",type:"DataJSON"}],type:"InputPaymentCredentials"},{id:-614138572,predicate:"account.tmpPassword",params:[{name:"tmp_password",type:"bytes"},{name:"valid_until",type:"int"}],type:"account.TmpPassword"},{id:-1239335713,predicate:"shippingOption",params:[{name:"id",type:"string"},{name:"title",type:"string"},{name:"prices",type:"Vector"}],type:"ShippingOption"},{id:-1246823043,predicate:"updateBotShippingQuery",params:[{name:"query_id",type:"long"},{name:"user_id",type:"long"},{name:"payload",type:"bytes"},{name:"shipping_address",type:"PostAddress"}],type:"Update"},{id:-1934976362,predicate:"updateBotPrecheckoutQuery",params:[{name:"flags",type:"#"},{name:"query_id",type:"long"},{name:"user_id",type:"long"},{name:"payload",type:"bytes"},{name:"info",type:"flags.0?PaymentRequestedInfo"},{name:"shipping_option_id",type:"flags.1?string"},{name:"currency",type:"string"},{name:"total_amount",type:"long"}],type:"Update"},{id:-6249322,predicate:"inputStickerSetItem",params:[{name:"flags",type:"#"},{name:"document",type:"InputDocument"},{name:"emoji",type:"string"},{name:"mask_coords",type:"flags.0?MaskCoords"}],type:"InputStickerSetItem"},{id:-1425052898,predicate:"updatePhoneCall",params:[{name:"phone_call",type:"PhoneCall"}],type:"Update"},{id:506920429,predicate:"inputPhoneCall",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputPhoneCall"},{id:1399245077,predicate:"phoneCallEmpty",params:[{name:"id",type:"long"}],type:"PhoneCall"},{id:-987599081,predicate:"phoneCallWaiting",params:[{name:"flags",type:"#"},{name:"video",type:"flags.6?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"protocol",type:"PhoneCallProtocol"},{name:"receive_date",type:"flags.0?int"}],type:"PhoneCall"},{id:347139340,predicate:"phoneCallRequested",params:[{name:"flags",type:"#"},{name:"video",type:"flags.6?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"g_a_hash",type:"bytes"},{name:"protocol",type:"PhoneCallProtocol"}],type:"PhoneCall"},{id:912311057,predicate:"phoneCallAccepted",params:[{name:"flags",type:"#"},{name:"video",type:"flags.6?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"g_b",type:"bytes"},{name:"protocol",type:"PhoneCallProtocol"}],type:"PhoneCall"},{id:-1770029977,predicate:"phoneCall",params:[{name:"flags",type:"#"},{name:"p2p_allowed",type:"flags.5?true"},{name:"video",type:"flags.6?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"g_a_or_b",type:"bytes"},{name:"key_fingerprint",type:"long"},{name:"protocol",type:"PhoneCallProtocol"},{name:"connections",type:"Vector"},{name:"start_date",type:"int"}],type:"PhoneCall"},{id:1355435489,predicate:"phoneCallDiscarded",params:[{name:"flags",type:"#"},{name:"need_rating",type:"flags.2?true"},{name:"need_debug",type:"flags.3?true"},{name:"video",type:"flags.6?true"},{name:"id",type:"long"},{name:"reason",type:"flags.0?PhoneCallDiscardReason"},{name:"duration",type:"flags.1?int"}],type:"PhoneCall"},{id:-1665063993,predicate:"phoneConnection",params:[{name:"flags",type:"#"},{name:"tcp",type:"flags.0?true"},{name:"id",type:"long"},{name:"ip",type:"string"},{name:"ipv6",type:"string"},{name:"port",type:"int"},{name:"peer_tag",type:"bytes"}],type:"PhoneConnection"},{id:-58224696,predicate:"phoneCallProtocol",params:[{name:"flags",type:"#"},{name:"udp_p2p",type:"flags.0?true"},{name:"udp_reflector",type:"flags.1?true"},{name:"min_layer",type:"int"},{name:"max_layer",type:"int"},{name:"library_versions",type:"Vector"}],type:"PhoneCallProtocol"},{id:-326966976,predicate:"phone.phoneCall",params:[{name:"phone_call",type:"PhoneCall"},{name:"users",type:"Vector"}],type:"phone.PhoneCall"},{id:-2134272152,predicate:"inputMessagesFilterPhoneCalls",params:[{name:"flags",type:"#"},{name:"missed",type:"flags.0?true"}],type:"MessagesFilter"},{id:-2132731265,predicate:"messageActionPhoneCall",params:[{name:"flags",type:"#"},{name:"video",type:"flags.2?true"},{name:"call_id",type:"long"},{name:"reason",type:"flags.0?PhoneCallDiscardReason"},{name:"duration",type:"flags.1?int"}],type:"MessageAction"},{id:2054952868,predicate:"inputMessagesFilterRoundVoice",params:[],type:"MessagesFilter"},{id:-1253451181,predicate:"inputMessagesFilterRoundVideo",params:[],type:"MessagesFilter"},{id:-1997373508,predicate:"sendMessageRecordRoundAction",params:[],type:"SendMessageAction"},{id:608050278,predicate:"sendMessageUploadRoundAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:-242427324,predicate:"upload.fileCdnRedirect",params:[{name:"dc_id",type:"int"},{name:"file_token",type:"bytes"},{name:"encryption_key",type:"bytes"},{name:"encryption_iv",type:"bytes"},{name:"file_hashes",type:"Vector"}],type:"upload.File"},{id:-290921362,predicate:"upload.cdnFileReuploadNeeded",params:[{name:"request_token",type:"bytes"}],type:"upload.CdnFile"},{id:-1449145777,predicate:"upload.cdnFile",params:[{name:"bytes",type:"bytes"}],type:"upload.CdnFile"},{id:-914167110,predicate:"cdnPublicKey",params:[{name:"dc_id",type:"int"},{name:"public_key",type:"string"}],type:"CdnPublicKey"},{id:1462101002,predicate:"cdnConfig",params:[{name:"public_keys",type:"Vector"}],type:"CdnConfig"},{id:-283684427,predicate:"pageBlockChannel",params:[{name:"channel",type:"Chat"}],type:"PageBlock"},{id:-892239370,predicate:"langPackString",params:[{name:"key",type:"string"},{name:"value",type:"string"}],type:"LangPackString"},{id:1816636575,predicate:"langPackStringPluralized",params:[{name:"flags",type:"#"},{name:"key",type:"string"},{name:"zero_value",type:"flags.0?string"},{name:"one_value",type:"flags.1?string"},{name:"two_value",type:"flags.2?string"},{name:"few_value",type:"flags.3?string"},{name:"many_value",type:"flags.4?string"},{name:"other_value",type:"string"}],type:"LangPackString"},{id:695856818,predicate:"langPackStringDeleted",params:[{name:"key",type:"string"}],type:"LangPackString"},{id:-209337866,predicate:"langPackDifference",params:[{name:"lang_code",type:"string"},{name:"from_version",type:"int"},{name:"version",type:"int"},{name:"strings",type:"Vector"}],type:"LangPackDifference"},{id:-288727837,predicate:"langPackLanguage",params:[{name:"flags",type:"#"},{name:"official",type:"flags.0?true"},{name:"rtl",type:"flags.2?true"},{name:"beta",type:"flags.3?true"},{name:"name",type:"string"},{name:"native_name",type:"string"},{name:"lang_code",type:"string"},{name:"base_lang_code",type:"flags.1?string"},{name:"plural_code",type:"string"},{name:"strings_count",type:"int"},{name:"translated_count",type:"int"},{name:"translations_url",type:"string"}],type:"LangPackLanguage"},{id:1180041828,predicate:"updateLangPackTooLong",params:[{name:"lang_code",type:"string"}],type:"Update"},{id:1442983757,predicate:"updateLangPack",params:[{name:"difference",type:"LangPackDifference"}],type:"Update"},{id:885242707,predicate:"channelParticipantAdmin",params:[{name:"flags",type:"#"},{name:"can_edit",type:"flags.0?true"},{name:"self",type:"flags.1?true"},{name:"user_id",type:"long"},{name:"inviter_id",type:"flags.1?long"},{name:"promoted_by",type:"long"},{name:"date",type:"int"},{name:"admin_rights",type:"ChatAdminRights"},{name:"rank",type:"flags.2?string"}],type:"ChannelParticipant"},{id:1844969806,predicate:"channelParticipantBanned",params:[{name:"flags",type:"#"},{name:"left",type:"flags.0?true"},{name:"peer",type:"Peer"},{name:"kicked_by",type:"long"},{name:"date",type:"int"},{name:"banned_rights",type:"ChatBannedRights"}],type:"ChannelParticipant"},{id:338142689,predicate:"channelParticipantsBanned",params:[{name:"q",type:"string"}],type:"ChannelParticipantsFilter"},{id:106343499,predicate:"channelParticipantsSearch",params:[{name:"q",type:"string"}],type:"ChannelParticipantsFilter"},{id:-421545947,predicate:"channelAdminLogEventActionChangeTitle",params:[{name:"prev_value",type:"string"},{name:"new_value",type:"string"}],type:"ChannelAdminLogEventAction"},{id:1427671598,predicate:"channelAdminLogEventActionChangeAbout",params:[{name:"prev_value",type:"string"},{name:"new_value",type:"string"}],type:"ChannelAdminLogEventAction"},{id:1783299128,predicate:"channelAdminLogEventActionChangeUsername",params:[{name:"prev_value",type:"string"},{name:"new_value",type:"string"}],type:"ChannelAdminLogEventAction"},{id:1129042607,predicate:"channelAdminLogEventActionChangePhoto",params:[{name:"prev_photo",type:"Photo"},{name:"new_photo",type:"Photo"}],type:"ChannelAdminLogEventAction"},{id:460916654,predicate:"channelAdminLogEventActionToggleInvites",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:648939889,predicate:"channelAdminLogEventActionToggleSignatures",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:-370660328,predicate:"channelAdminLogEventActionUpdatePinned",params:[{name:"message",type:"Message"}],type:"ChannelAdminLogEventAction"},{id:1889215493,predicate:"channelAdminLogEventActionEditMessage",params:[{name:"prev_message",type:"Message"},{name:"new_message",type:"Message"}],type:"ChannelAdminLogEventAction"},{id:1121994683,predicate:"channelAdminLogEventActionDeleteMessage",params:[{name:"message",type:"Message"}],type:"ChannelAdminLogEventAction"},{id:405815507,predicate:"channelAdminLogEventActionParticipantJoin",params:[],type:"ChannelAdminLogEventAction"},{id:-124291086,predicate:"channelAdminLogEventActionParticipantLeave",params:[],type:"ChannelAdminLogEventAction"},{id:-484690728,predicate:"channelAdminLogEventActionParticipantInvite",params:[{name:"participant",type:"ChannelParticipant"}],type:"ChannelAdminLogEventAction"},{id:-422036098,predicate:"channelAdminLogEventActionParticipantToggleBan",params:[{name:"prev_participant",type:"ChannelParticipant"},{name:"new_participant",type:"ChannelParticipant"}],type:"ChannelAdminLogEventAction"},{id:-714643696,predicate:"channelAdminLogEventActionParticipantToggleAdmin",params:[{name:"prev_participant",type:"ChannelParticipant"},{name:"new_participant",type:"ChannelParticipant"}],type:"ChannelAdminLogEventAction"},{id:531458253,predicate:"channelAdminLogEvent",params:[{name:"id",type:"long"},{name:"date",type:"int"},{name:"user_id",type:"long"},{name:"action",type:"ChannelAdminLogEventAction"}],type:"ChannelAdminLogEvent"},{id:-309659827,predicate:"channels.adminLogResults",params:[{name:"events",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"channels.AdminLogResults"},{id:-368018716,predicate:"channelAdminLogEventsFilter",params:[{name:"flags",type:"#"},{name:"join",type:"flags.0?true"},{name:"leave",type:"flags.1?true"},{name:"invite",type:"flags.2?true"},{name:"ban",type:"flags.3?true"},{name:"unban",type:"flags.4?true"},{name:"kick",type:"flags.5?true"},{name:"unkick",type:"flags.6?true"},{name:"promote",type:"flags.7?true"},{name:"demote",type:"flags.8?true"},{name:"info",type:"flags.9?true"},{name:"settings",type:"flags.10?true"},{name:"pinned",type:"flags.11?true"},{name:"edit",type:"flags.12?true"},{name:"delete",type:"flags.13?true"},{name:"group_call",type:"flags.14?true"},{name:"invites",type:"flags.15?true"},{name:"send",type:"flags.16?true"},{name:"forums",type:"flags.17?true"}],type:"ChannelAdminLogEventsFilter"},{id:511092620,predicate:"topPeerCategoryPhoneCalls",params:[],type:"TopPeerCategory"},{id:-2143067670,predicate:"pageBlockAudio",params:[{name:"audio_id",type:"long"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:1558266229,predicate:"popularContact",params:[{name:"client_id",type:"long"},{name:"importers",type:"int"}],type:"PopularContact"},{id:1200788123,predicate:"messageActionScreenshotTaken",params:[],type:"MessageAction"},{id:-1634752813,predicate:"messages.favedStickersNotModified",params:[],type:"messages.FavedStickers"},{id:750063767,predicate:"messages.favedStickers",params:[{name:"hash",type:"long"},{name:"packs",type:"Vector"},{name:"stickers",type:"Vector"}],type:"messages.FavedStickers"},{id:-451831443,predicate:"updateFavedStickers",params:[],type:"Update"},{id:-366410403,predicate:"updateChannelReadMessagesContents",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"top_msg_id",type:"flags.0?int"},{name:"messages",type:"Vector"}],type:"Update"},{id:-1040652646,predicate:"inputMessagesFilterMyMentions",params:[],type:"MessagesFilter"},{id:1887741886,predicate:"updateContactsReset",params:[],type:"Update"},{id:-1312568665,predicate:"channelAdminLogEventActionChangeStickerSet",params:[{name:"prev_stickerset",type:"InputStickerSet"},{name:"new_stickerset",type:"InputStickerSet"}],type:"ChannelAdminLogEventAction"},{id:-85549226,predicate:"messageActionCustomAction",params:[{name:"message",type:"string"}],type:"MessageAction"},{id:178373535,predicate:"inputPaymentCredentialsApplePay",params:[{name:"payment_data",type:"DataJSON"}],type:"InputPaymentCredentials"},{id:-419271411,predicate:"inputMessagesFilterGeo",params:[],type:"MessagesFilter"},{id:-530392189,predicate:"inputMessagesFilterContacts",params:[],type:"MessagesFilter"},{id:-1304443240,predicate:"updateChannelAvailableMessages",params:[{name:"channel_id",type:"long"},{name:"available_min_id",type:"int"}],type:"Update"},{id:1599903217,predicate:"channelAdminLogEventActionTogglePreHistoryHidden",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:-1759532989,predicate:"inputMediaGeoLive",params:[{name:"flags",type:"#"},{name:"stopped",type:"flags.0?true"},{name:"geo_point",type:"InputGeoPoint"},{name:"heading",type:"flags.2?int"},{name:"period",type:"flags.1?int"},{name:"proximity_notification_radius",type:"flags.3?int"}],type:"InputMedia"},{id:-1186937242,predicate:"messageMediaGeoLive",params:[{name:"flags",type:"#"},{name:"geo",type:"GeoPoint"},{name:"heading",type:"flags.0?int"},{name:"period",type:"int"},{name:"proximity_notification_radius",type:"flags.1?int"}],type:"MessageMedia"},{id:1189204285,predicate:"recentMeUrlUnknown",params:[{name:"url",type:"string"}],type:"RecentMeUrl"},{id:-1188296222,predicate:"recentMeUrlUser",params:[{name:"url",type:"string"},{name:"user_id",type:"long"}],type:"RecentMeUrl"},{id:-1294306862,predicate:"recentMeUrlChat",params:[{name:"url",type:"string"},{name:"chat_id",type:"long"}],type:"RecentMeUrl"},{id:-347535331,predicate:"recentMeUrlChatInvite",params:[{name:"url",type:"string"},{name:"chat_invite",type:"ChatInvite"}],type:"RecentMeUrl"},{id:-1140172836,predicate:"recentMeUrlStickerSet",params:[{name:"url",type:"string"},{name:"set",type:"StickerSetCovered"}],type:"RecentMeUrl"},{id:235081943,predicate:"help.recentMeUrls",params:[{name:"urls",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"help.RecentMeUrls"},{id:-266911767,predicate:"channels.channelParticipantsNotModified",params:[],type:"channels.ChannelParticipants"},{id:1951620897,predicate:"messages.messagesNotModified",params:[{name:"count",type:"int"}],type:"messages.Messages"},{id:482797855,predicate:"inputSingleMedia",params:[{name:"flags",type:"#"},{name:"media",type:"InputMedia"},{name:"random_id",type:"long"},{name:"message",type:"string"},{name:"entities",type:"flags.0?Vector"}],type:"InputSingleMedia"},{id:-1493633966,predicate:"webAuthorization",params:[{name:"hash",type:"long"},{name:"bot_id",type:"long"},{name:"domain",type:"string"},{name:"browser",type:"string"},{name:"platform",type:"string"},{name:"date_created",type:"int"},{name:"date_active",type:"int"},{name:"ip",type:"string"},{name:"region",type:"string"}],type:"WebAuthorization"},{id:-313079300,predicate:"account.webAuthorizations",params:[{name:"authorizations",type:"Vector"},{name:"users",type:"Vector"}],type:"account.WebAuthorizations"},{id:-1502174430,predicate:"inputMessageID",params:[{name:"id",type:"int"}],type:"InputMessage"},{id:-1160215659,predicate:"inputMessageReplyTo",params:[{name:"id",type:"int"}],type:"InputMessage"},{id:-2037963464,predicate:"inputMessagePinned",params:[],type:"InputMessage"},{id:-1687559349,predicate:"messageEntityPhone",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1280209983,predicate:"messageEntityCashtag",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-1410748418,predicate:"messageActionBotAllowed",params:[{name:"domain",type:"string"}],type:"MessageAction"},{id:-55902537,predicate:"inputDialogPeer",params:[{name:"peer",type:"InputPeer"}],type:"InputDialogPeer"},{id:-445792507,predicate:"dialogPeer",params:[{name:"peer",type:"Peer"}],type:"DialogPeer"},{id:223655517,predicate:"messages.foundStickerSetsNotModified",params:[],type:"messages.FoundStickerSets"},{id:-1963942446,predicate:"messages.foundStickerSets",params:[{name:"hash",type:"long"},{name:"sets",type:"Vector"}],type:"messages.FoundStickerSets"},{id:-207944868,predicate:"fileHash",params:[{name:"offset",type:"long"},{name:"limit",type:"int"},{name:"hash",type:"bytes"}],type:"FileHash"},{id:-104284986,predicate:"webDocumentNoProxy",params:[{name:"url",type:"string"},{name:"size",type:"int"},{name:"mime_type",type:"string"},{name:"attributes",type:"Vector"}],type:"WebDocument"},{id:1968737087,predicate:"inputClientProxy",params:[{name:"address",type:"string"},{name:"port",type:"int"}],type:"InputClientProxy"},{id:-483352705,predicate:"help.termsOfServiceUpdateEmpty",params:[{name:"expires",type:"int"}],type:"help.TermsOfServiceUpdate"},{id:686618977,predicate:"help.termsOfServiceUpdate",params:[{name:"expires",type:"int"},{name:"terms_of_service",type:"help.TermsOfService"}],type:"help.TermsOfServiceUpdate"},{id:859091184,predicate:"inputSecureFileUploaded",params:[{name:"id",type:"long"},{name:"parts",type:"int"},{name:"md5_checksum",type:"string"},{name:"file_hash",type:"bytes"},{name:"secret",type:"bytes"}],type:"InputSecureFile"},{id:1399317950,predicate:"inputSecureFile",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputSecureFile"},{id:-876089816,predicate:"inputSecureFileLocation",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputFileLocation"},{id:1679398724,predicate:"secureFileEmpty",params:[],type:"SecureFile"},{id:2097791614,predicate:"secureFile",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"size",type:"long"},{name:"dc_id",type:"int"},{name:"date",type:"int"},{name:"file_hash",type:"bytes"},{name:"secret",type:"bytes"}],type:"SecureFile"},{id:-1964327229,predicate:"secureData",params:[{name:"data",type:"bytes"},{name:"data_hash",type:"bytes"},{name:"secret",type:"bytes"}],type:"SecureData"},{id:2103482845,predicate:"securePlainPhone",params:[{name:"phone",type:"string"}],type:"SecurePlainData"},{id:569137759,predicate:"securePlainEmail",params:[{name:"email",type:"string"}],type:"SecurePlainData"},{id:-1658158621,predicate:"secureValueTypePersonalDetails",params:[],type:"SecureValueType"},{id:1034709504,predicate:"secureValueTypePassport",params:[],type:"SecureValueType"},{id:115615172,predicate:"secureValueTypeDriverLicense",params:[],type:"SecureValueType"},{id:-1596951477,predicate:"secureValueTypeIdentityCard",params:[],type:"SecureValueType"},{id:-1717268701,predicate:"secureValueTypeInternalPassport",params:[],type:"SecureValueType"},{id:-874308058,predicate:"secureValueTypeAddress",params:[],type:"SecureValueType"},{id:-63531698,predicate:"secureValueTypeUtilityBill",params:[],type:"SecureValueType"},{id:-1995211763,predicate:"secureValueTypeBankStatement",params:[],type:"SecureValueType"},{id:-1954007928,predicate:"secureValueTypeRentalAgreement",params:[],type:"SecureValueType"},{id:-1713143702,predicate:"secureValueTypePassportRegistration",params:[],type:"SecureValueType"},{id:-368907213,predicate:"secureValueTypeTemporaryRegistration",params:[],type:"SecureValueType"},{id:-1289704741,predicate:"secureValueTypePhone",params:[],type:"SecureValueType"},{id:-1908627474,predicate:"secureValueTypeEmail",params:[],type:"SecureValueType"},{id:411017418,predicate:"secureValue",params:[{name:"flags",type:"#"},{name:"type",type:"SecureValueType"},{name:"data",type:"flags.0?SecureData"},{name:"front_side",type:"flags.1?SecureFile"},{name:"reverse_side",type:"flags.2?SecureFile"},{name:"selfie",type:"flags.3?SecureFile"},{name:"translation",type:"flags.6?Vector"},{name:"files",type:"flags.4?Vector"},{name:"plain_data",type:"flags.5?SecurePlainData"},{name:"hash",type:"bytes"}],type:"SecureValue"},{id:-618540889,predicate:"inputSecureValue",params:[{name:"flags",type:"#"},{name:"type",type:"SecureValueType"},{name:"data",type:"flags.0?SecureData"},{name:"front_side",type:"flags.1?InputSecureFile"},{name:"reverse_side",type:"flags.2?InputSecureFile"},{name:"selfie",type:"flags.3?InputSecureFile"},{name:"translation",type:"flags.6?Vector"},{name:"files",type:"flags.4?Vector"},{name:"plain_data",type:"flags.5?SecurePlainData"}],type:"InputSecureValue"},{id:-316748368,predicate:"secureValueHash",params:[{name:"type",type:"SecureValueType"},{name:"hash",type:"bytes"}],type:"SecureValueHash"},{id:-391902247,predicate:"secureValueErrorData",params:[{name:"type",type:"SecureValueType"},{name:"data_hash",type:"bytes"},{name:"field",type:"string"},{name:"text",type:"string"}],type:"SecureValueError"},{id:12467706,predicate:"secureValueErrorFrontSide",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:-2037765467,predicate:"secureValueErrorReverseSide",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:-449327402,predicate:"secureValueErrorSelfie",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:2054162547,predicate:"secureValueErrorFile",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:1717706985,predicate:"secureValueErrorFiles",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"Vector"},{name:"text",type:"string"}],type:"SecureValueError"},{id:871426631,predicate:"secureCredentialsEncrypted",params:[{name:"data",type:"bytes"},{name:"hash",type:"bytes"},{name:"secret",type:"bytes"}],type:"SecureCredentialsEncrypted"},{id:-1389486888,predicate:"account.authorizationForm",params:[{name:"flags",type:"#"},{name:"required_types",type:"Vector"},{name:"values",type:"Vector"},{name:"errors",type:"Vector"},{name:"users",type:"Vector"},{name:"privacy_policy_url",type:"flags.0?string"}],type:"account.AuthorizationForm"},{id:-2128640689,predicate:"account.sentEmailCode",params:[{name:"email_pattern",type:"string"},{name:"length",type:"int"}],type:"account.SentEmailCode"},{id:455635795,predicate:"messageActionSecureValuesSentMe",params:[{name:"values",type:"Vector"},{name:"credentials",type:"SecureCredentialsEncrypted"}],type:"MessageAction"},{id:-648257196,predicate:"messageActionSecureValuesSent",params:[{name:"types",type:"Vector"}],type:"MessageAction"},{id:1722786150,predicate:"help.deepLinkInfoEmpty",params:[],type:"help.DeepLinkInfo"},{id:1783556146,predicate:"help.deepLinkInfo",params:[{name:"flags",type:"#"},{name:"update_app",type:"flags.0?true"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector"}],type:"help.DeepLinkInfo"},{id:289586518,predicate:"savedPhoneContact",params:[{name:"phone",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"date",type:"int"}],type:"SavedContact"},{id:1304052993,predicate:"account.takeout",params:[{name:"id",type:"long"}],type:"account.Takeout"},{id:700340377,predicate:"inputTakeoutFileLocation",params:[],type:"InputFileLocation"},{id:-513517117,predicate:"updateDialogUnreadMark",params:[{name:"flags",type:"#"},{name:"unread",type:"flags.0?true"},{name:"peer",type:"DialogPeer"}],type:"Update"},{id:-253500010,predicate:"messages.dialogsNotModified",params:[{name:"count",type:"int"}],type:"messages.Dialogs"},{id:-1625153079,predicate:"inputWebFileGeoPointLocation",params:[{name:"geo_point",type:"InputGeoPoint"},{name:"access_hash",type:"long"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"zoom",type:"int"},{name:"scale",type:"int"}],type:"InputWebFileLocation"},{id:-1255369827,predicate:"contacts.topPeersDisabled",params:[],type:"contacts.TopPeers"},{id:-1685456582,predicate:"inputReportReasonCopyright",params:[],type:"ReportReason"},{id:-732254058,predicate:"passwordKdfAlgoUnknown",params:[],type:"PasswordKdfAlgo"},{id:4883767,predicate:"securePasswordKdfAlgoUnknown",params:[],type:"SecurePasswordKdfAlgo"},{id:-1141711456,predicate:"securePasswordKdfAlgoPBKDF2HMACSHA512iter100000",params:[{name:"salt",type:"bytes"}],type:"SecurePasswordKdfAlgo"},{id:-2042159726,predicate:"securePasswordKdfAlgoSHA512",params:[{name:"salt",type:"bytes"}],type:"SecurePasswordKdfAlgo"},{id:354925740,predicate:"secureSecretSettings",params:[{name:"secure_algo",type:"SecurePasswordKdfAlgo"},{name:"secure_secret",type:"bytes"},{name:"secure_secret_id",type:"long"}],type:"SecureSecretSettings"},{id:982592842,predicate:"passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow",params:[{name:"salt1",type:"bytes"},{name:"salt2",type:"bytes"},{name:"g",type:"int"},{name:"p",type:"bytes"}],type:"PasswordKdfAlgo"},{id:-1736378792,predicate:"inputCheckPasswordEmpty",params:[],type:"InputCheckPasswordSRP"},{id:-763367294,predicate:"inputCheckPasswordSRP",params:[{name:"srp_id",type:"long"},{name:"A",type:"bytes"},{name:"M1",type:"bytes"}],type:"InputCheckPasswordSRP"},{id:-2036501105,predicate:"secureValueError",params:[{name:"type",type:"SecureValueType"},{name:"hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:-1592506512,predicate:"secureValueErrorTranslationFile",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:878931416,predicate:"secureValueErrorTranslationFiles",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"Vector"},{name:"text",type:"string"}],type:"SecureValueError"},{id:-2103600678,predicate:"secureRequiredType",params:[{name:"flags",type:"#"},{name:"native_names",type:"flags.0?true"},{name:"selfie_required",type:"flags.1?true"},{name:"translation_required",type:"flags.2?true"},{name:"type",type:"SecureValueType"}],type:"SecureRequiredType"},{id:41187252,predicate:"secureRequiredTypeOneOf",params:[{name:"types",type:"Vector"}],type:"SecureRequiredType"},{id:-1078332329,predicate:"help.passportConfigNotModified",params:[],type:"help.PassportConfig"},{id:-1600596305,predicate:"help.passportConfig",params:[{name:"hash",type:"int"},{name:"countries_langs",type:"DataJSON"}],type:"help.PassportConfig"},{id:488313413,predicate:"inputAppEvent",params:[{name:"time",type:"double"},{name:"type",type:"string"},{name:"peer",type:"long"},{name:"data",type:"JSONValue"}],type:"InputAppEvent"},{id:-1059185703,predicate:"jsonObjectValue",params:[{name:"key",type:"string"},{name:"value",type:"JSONValue"}],type:"JSONObjectValue"},{id:1064139624,predicate:"jsonNull",params:[],type:"JSONValue"},{id:-952869270,predicate:"jsonBool",params:[{name:"value",type:"Bool"}],type:"JSONValue"},{id:736157604,predicate:"jsonNumber",params:[{name:"value",type:"double"}],type:"JSONValue"},{id:-1222740358,predicate:"jsonString",params:[{name:"value",type:"string"}],type:"JSONValue"},{id:-146520221,predicate:"jsonArray",params:[{name:"value",type:"Vector"}],type:"JSONValue"},{id:-1715350371,predicate:"jsonObject",params:[{name:"value",type:"Vector"}],type:"JSONValue"},{id:-1311015810,predicate:"inputNotifyBroadcasts",params:[],type:"InputNotifyPeer"},{id:-703403793,predicate:"notifyBroadcasts",params:[],type:"NotifyPeer"},{id:-311786236,predicate:"textSubscript",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:-939827711,predicate:"textSuperscript",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:55281185,predicate:"textMarked",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:483104362,predicate:"textPhone",params:[{name:"text",type:"RichText"},{name:"phone",type:"string"}],type:"RichText"},{id:136105807,predicate:"textImage",params:[{name:"document_id",type:"long"},{name:"w",type:"int"},{name:"h",type:"int"}],type:"RichText"},{id:504660880,predicate:"pageBlockKicker",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:878078826,predicate:"pageTableCell",params:[{name:"flags",type:"#"},{name:"header",type:"flags.0?true"},{name:"align_center",type:"flags.3?true"},{name:"align_right",type:"flags.4?true"},{name:"valign_middle",type:"flags.5?true"},{name:"valign_bottom",type:"flags.6?true"},{name:"text",type:"flags.7?RichText"},{name:"colspan",type:"flags.1?int"},{name:"rowspan",type:"flags.2?int"}],type:"PageTableCell"},{id:-524237339,predicate:"pageTableRow",params:[{name:"cells",type:"Vector"}],type:"PageTableRow"},{id:-1085412734,predicate:"pageBlockTable",params:[{name:"flags",type:"#"},{name:"bordered",type:"flags.0?true"},{name:"striped",type:"flags.1?true"},{name:"title",type:"RichText"},{name:"rows",type:"Vector"}],type:"PageBlock"},{id:1869903447,predicate:"pageCaption",params:[{name:"text",type:"RichText"},{name:"credit",type:"RichText"}],type:"PageCaption"},{id:-1188055347,predicate:"pageListItemText",params:[{name:"text",type:"RichText"}],type:"PageListItem"},{id:635466748,predicate:"pageListItemBlocks",params:[{name:"blocks",type:"Vector"}],type:"PageListItem"},{id:1577484359,predicate:"pageListOrderedItemText",params:[{name:"num",type:"string"},{name:"text",type:"RichText"}],type:"PageListOrderedItem"},{id:-1730311882,predicate:"pageListOrderedItemBlocks",params:[{name:"num",type:"string"},{name:"blocks",type:"Vector"}],type:"PageListOrderedItem"},{id:-1702174239,predicate:"pageBlockOrderedList",params:[{name:"items",type:"Vector"}],type:"PageBlock"},{id:1987480557,predicate:"pageBlockDetails",params:[{name:"flags",type:"#"},{name:"open",type:"flags.0?true"},{name:"blocks",type:"Vector"},{name:"title",type:"RichText"}],type:"PageBlock"},{id:-1282352120,predicate:"pageRelatedArticle",params:[{name:"flags",type:"#"},{name:"url",type:"string"},{name:"webpage_id",type:"long"},{name:"title",type:"flags.0?string"},{name:"description",type:"flags.1?string"},{name:"photo_id",type:"flags.2?long"},{name:"author",type:"flags.3?string"},{name:"published_date",type:"flags.4?int"}],type:"PageRelatedArticle"},{id:370236054,predicate:"pageBlockRelatedArticles",params:[{name:"title",type:"RichText"},{name:"articles",type:"Vector"}],type:"PageBlock"},{id:-1538310410,predicate:"pageBlockMap",params:[{name:"geo",type:"GeoPoint"},{name:"zoom",type:"int"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:-1738178803,predicate:"page",params:[{name:"flags",type:"#"},{name:"part",type:"flags.0?true"},{name:"rtl",type:"flags.1?true"},{name:"v2",type:"flags.2?true"},{name:"url",type:"string"},{name:"blocks",type:"Vector"},{name:"photos",type:"Vector"},{name:"documents",type:"Vector"},{name:"views",type:"flags.3?int"}],type:"Page"},{id:-610373422,predicate:"inputPrivacyKeyPhoneP2P",params:[],type:"InputPrivacyKey"},{id:961092808,predicate:"privacyKeyPhoneP2P",params:[],type:"PrivacyKey"},{id:894777186,predicate:"textAnchor",params:[{name:"text",type:"RichText"},{name:"name",type:"string"}],type:"RichText"},{id:-1945767479,predicate:"help.supportName",params:[{name:"name",type:"string"}],type:"help.SupportName"},{id:-206688531,predicate:"help.userInfoEmpty",params:[],type:"help.UserInfo"},{id:32192344,predicate:"help.userInfo",params:[{name:"message",type:"string"},{name:"entities",type:"Vector"},{name:"author",type:"string"},{name:"date",type:"int"}],type:"help.UserInfo"},{id:-202219658,predicate:"messageActionContactSignUp",params:[],type:"MessageAction"},{id:-1398708869,predicate:"updateMessagePoll",params:[{name:"flags",type:"#"},{name:"poll_id",type:"long"},{name:"poll",type:"flags.0?Poll"},{name:"results",type:"PollResults"}],type:"Update"},{id:1823064809,predicate:"pollAnswer",params:[{name:"text",type:"string"},{name:"option",type:"bytes"}],type:"PollAnswer"},{id:-2032041631,predicate:"poll",params:[{name:"id",type:"long"},{name:"flags",type:"#"},{name:"closed",type:"flags.0?true"},{name:"public_voters",type:"flags.1?true"},{name:"multiple_choice",type:"flags.2?true"},{name:"quiz",type:"flags.3?true"},{name:"question",type:"string"},{name:"answers",type:"Vector"},{name:"close_period",type:"flags.4?int"},{name:"close_date",type:"flags.5?int"}],type:"Poll"},{id:997055186,predicate:"pollAnswerVoters",params:[{name:"flags",type:"#"},{name:"chosen",type:"flags.0?true"},{name:"correct",type:"flags.1?true"},{name:"option",type:"bytes"},{name:"voters",type:"int"}],type:"PollAnswerVoters"},{id:-591909213,predicate:"pollResults",params:[{name:"flags",type:"#"},{name:"min",type:"flags.0?true"},{name:"results",type:"flags.1?Vector"},{name:"total_voters",type:"flags.2?int"},{name:"recent_voters",type:"flags.3?Vector"},{name:"solution",type:"flags.4?string"},{name:"solution_entities",type:"flags.4?Vector"}],type:"PollResults"},{id:261416433,predicate:"inputMediaPoll",params:[{name:"flags",type:"#"},{name:"poll",type:"Poll"},{name:"correct_answers",type:"flags.0?Vector"},{name:"solution",type:"flags.1?string"},{name:"solution_entities",type:"flags.1?Vector"}],type:"InputMedia"},{id:1272375192,predicate:"messageMediaPoll",params:[{name:"poll",type:"Poll"},{name:"results",type:"PollResults"}],type:"MessageMedia"},{id:-264117680,predicate:"chatOnlines",params:[{name:"onlines",type:"int"}],type:"ChatOnlines"},{id:1202287072,predicate:"statsURL",params:[{name:"url",type:"string"}],type:"StatsURL"},{id:-525288402,predicate:"photoStrippedSize",params:[{name:"type",type:"string"},{name:"bytes",type:"bytes"}],type:"PhotoSize"},{id:1605510357,predicate:"chatAdminRights",params:[{name:"flags",type:"#"},{name:"change_info",type:"flags.0?true"},{name:"post_messages",type:"flags.1?true"},{name:"edit_messages",type:"flags.2?true"},{name:"delete_messages",type:"flags.3?true"},{name:"ban_users",type:"flags.4?true"},{name:"invite_users",type:"flags.5?true"},{name:"pin_messages",type:"flags.7?true"},{name:"add_admins",type:"flags.9?true"},{name:"anonymous",type:"flags.10?true"},{name:"manage_call",type:"flags.11?true"},{name:"other",type:"flags.12?true"},{name:"manage_topics",type:"flags.13?true"}],type:"ChatAdminRights"},{id:-1626209256,predicate:"chatBannedRights",params:[{name:"flags",type:"#"},{name:"view_messages",type:"flags.0?true"},{name:"send_messages",type:"flags.1?true"},{name:"send_media",type:"flags.2?true"},{name:"send_stickers",type:"flags.3?true"},{name:"send_gifs",type:"flags.4?true"},{name:"send_games",type:"flags.5?true"},{name:"send_inline",type:"flags.6?true"},{name:"embed_links",type:"flags.7?true"},{name:"send_polls",type:"flags.8?true"},{name:"change_info",type:"flags.10?true"},{name:"invite_users",type:"flags.15?true"},{name:"pin_messages",type:"flags.17?true"},{name:"manage_topics",type:"flags.18?true"},{name:"send_photos",type:"flags.19?true"},{name:"send_videos",type:"flags.20?true"},{name:"send_roundvideos",type:"flags.21?true"},{name:"send_audios",type:"flags.22?true"},{name:"send_voices",type:"flags.23?true"},{name:"send_docs",type:"flags.24?true"},{name:"send_plain",type:"flags.25?true"},{name:"until_date",type:"int"}],type:"ChatBannedRights"},{id:1421875280,predicate:"updateChatDefaultBannedRights",params:[{name:"peer",type:"Peer"},{name:"default_banned_rights",type:"ChatBannedRights"},{name:"version",type:"int"}],type:"Update"},{id:-433014407,predicate:"inputWallPaper",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputWallPaper"},{id:1913199744,predicate:"inputWallPaperSlug",params:[{name:"slug",type:"string"}],type:"InputWallPaper"},{id:-1150621555,predicate:"channelParticipantsContacts",params:[{name:"q",type:"string"}],type:"ChannelParticipantsFilter"},{id:771095562,predicate:"channelAdminLogEventActionDefaultBannedRights",params:[{name:"prev_banned_rights",type:"ChatBannedRights"},{name:"new_banned_rights",type:"ChatBannedRights"}],type:"ChannelAdminLogEventAction"},{id:-1895328189,predicate:"channelAdminLogEventActionStopPoll",params:[{name:"message",type:"Message"}],type:"ChannelAdminLogEventAction"},{id:471437699,predicate:"account.wallPapersNotModified",params:[],type:"account.WallPapers"},{id:-842824308,predicate:"account.wallPapers",params:[{name:"hash",type:"long"},{name:"wallpapers",type:"Vector"}],type:"account.WallPapers"},{id:-1390068360,predicate:"codeSettings",params:[{name:"flags",type:"#"},{name:"allow_flashcall",type:"flags.0?true"},{name:"current_number",type:"flags.1?true"},{name:"allow_app_hash",type:"flags.4?true"},{name:"allow_missed_call",type:"flags.5?true"},{name:"allow_firebase",type:"flags.7?true"},{name:"logout_tokens",type:"flags.6?Vector"},{name:"token",type:"flags.8?string"},{name:"app_sandbox",type:"flags.8?Bool"}],type:"CodeSettings"},{id:499236004,predicate:"wallPaperSettings",params:[{name:"flags",type:"#"},{name:"blur",type:"flags.1?true"},{name:"motion",type:"flags.2?true"},{name:"background_color",type:"flags.0?int"},{name:"second_background_color",type:"flags.4?int"},{name:"third_background_color",type:"flags.5?int"},{name:"fourth_background_color",type:"flags.6?int"},{name:"intensity",type:"flags.3?int"},{name:"rotation",type:"flags.4?int"}],type:"WallPaperSettings"},{id:-1896171181,predicate:"autoDownloadSettings",params:[{name:"flags",type:"#"},{name:"disabled",type:"flags.0?true"},{name:"video_preload_large",type:"flags.1?true"},{name:"audio_preload_next",type:"flags.2?true"},{name:"phonecalls_less_data",type:"flags.3?true"},{name:"photo_size_max",type:"int"},{name:"video_size_max",type:"long"},{name:"file_size_max",type:"long"},{name:"video_upload_maxbitrate",type:"int"}],type:"AutoDownloadSettings"},{id:1674235686,predicate:"account.autoDownloadSettings",params:[{name:"low",type:"AutoDownloadSettings"},{name:"medium",type:"AutoDownloadSettings"},{name:"high",type:"AutoDownloadSettings"}],type:"account.AutoDownloadSettings"},{id:-709641735,predicate:"emojiKeyword",params:[{name:"keyword",type:"string"},{name:"emoticons",type:"Vector"}],type:"EmojiKeyword"},{id:594408994,predicate:"emojiKeywordDeleted",params:[{name:"keyword",type:"string"},{name:"emoticons",type:"Vector"}],type:"EmojiKeyword"},{id:1556570557,predicate:"emojiKeywordsDifference",params:[{name:"lang_code",type:"string"},{name:"from_version",type:"int"},{name:"version",type:"int"},{name:"keywords",type:"Vector"}],type:"EmojiKeywordsDifference"},{id:-1519029347,predicate:"emojiURL",params:[{name:"url",type:"string"}],type:"EmojiURL"},{id:-1275374751,predicate:"emojiLanguage",params:[{name:"lang_code",type:"string"}],type:"EmojiLanguage"},{id:-1529000952,predicate:"inputPrivacyKeyForwards",params:[],type:"InputPrivacyKey"},{id:1777096355,predicate:"privacyKeyForwards",params:[],type:"PrivacyKey"},{id:1461304012,predicate:"inputPrivacyKeyProfilePhoto",params:[],type:"InputPrivacyKey"},{id:-1777000467,predicate:"privacyKeyProfilePhoto",params:[],type:"PrivacyKey"},{id:1075322878,predicate:"inputPhotoFileLocation",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"},{name:"thumb_size",type:"string"}],type:"InputFileLocation"},{id:-667654413,predicate:"inputPhotoLegacyFileLocation",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"},{name:"volume_id",type:"long"},{name:"local_id",type:"int"},{name:"secret",type:"long"}],type:"InputFileLocation"},{id:925204121,predicate:"inputPeerPhotoFileLocation",params:[{name:"flags",type:"#"},{name:"big",type:"flags.0?true"},{name:"peer",type:"InputPeer"},{name:"photo_id",type:"long"}],type:"InputFileLocation"},{id:-1652231205,predicate:"inputStickerSetThumb",params:[{name:"stickerset",type:"InputStickerSet"},{name:"thumb_version",type:"int"}],type:"InputFileLocation"},{id:-11252123,predicate:"folder",params:[{name:"flags",type:"#"},{name:"autofill_new_broadcasts",type:"flags.0?true"},{name:"autofill_public_groups",type:"flags.1?true"},{name:"autofill_new_correspondents",type:"flags.2?true"},{name:"id",type:"int"},{name:"title",type:"string"},{name:"photo",type:"flags.3?ChatPhoto"}],type:"Folder"},{id:1908216652,predicate:"dialogFolder",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.2?true"},{name:"folder",type:"Folder"},{name:"peer",type:"Peer"},{name:"top_message",type:"int"},{name:"unread_muted_peers_count",type:"int"},{name:"unread_unmuted_peers_count",type:"int"},{name:"unread_muted_messages_count",type:"int"},{name:"unread_unmuted_messages_count",type:"int"}],type:"Dialog"},{id:1684014375,predicate:"inputDialogPeerFolder",params:[{name:"folder_id",type:"int"}],type:"InputDialogPeer"},{id:1363483106,predicate:"dialogPeerFolder",params:[{name:"folder_id",type:"int"}],type:"DialogPeer"},{id:-70073706,predicate:"inputFolderPeer",params:[{name:"peer",type:"InputPeer"},{name:"folder_id",type:"int"}],type:"InputFolderPeer"},{id:-373643672,predicate:"folderPeer",params:[{name:"peer",type:"Peer"},{name:"folder_id",type:"int"}],type:"FolderPeer"},{id:422972864,predicate:"updateFolderPeers",params:[{name:"folder_peers",type:"Vector"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:497305826,predicate:"inputUserFromMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"user_id",type:"long"}],type:"InputUser"},{id:1536380829,predicate:"inputChannelFromMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"channel_id",type:"long"}],type:"InputChannel"},{id:-1468331492,predicate:"inputPeerUserFromMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"user_id",type:"long"}],type:"InputPeer"},{id:-1121318848,predicate:"inputPeerChannelFromMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"channel_id",type:"long"}],type:"InputPeer"},{id:55761658,predicate:"inputPrivacyKeyPhoneNumber",params:[],type:"InputPrivacyKey"},{id:-778378131,predicate:"privacyKeyPhoneNumber",params:[],type:"PrivacyKey"},{id:-1472172887,predicate:"topPeerCategoryForwardUsers",params:[],type:"TopPeerCategory"},{id:-68239120,predicate:"topPeerCategoryForwardChats",params:[],type:"TopPeerCategory"},{id:84703944,predicate:"channelAdminLogEventActionChangeLinkedChat",params:[{name:"prev_value",type:"long"},{name:"new_value",type:"long"}],type:"ChannelAdminLogEventAction"},{id:-398136321,predicate:"messages.searchCounter",params:[{name:"flags",type:"#"},{name:"inexact",type:"flags.1?true"},{name:"filter",type:"MessagesFilter"},{name:"count",type:"int"}],type:"messages.SearchCounter"},{id:280464681,predicate:"keyboardButtonUrlAuth",params:[{name:"flags",type:"#"},{name:"text",type:"string"},{name:"fwd_text",type:"flags.0?string"},{name:"url",type:"string"},{name:"button_id",type:"int"}],type:"KeyboardButton"},{id:-802258988,predicate:"inputKeyboardButtonUrlAuth",params:[{name:"flags",type:"#"},{name:"request_write_access",type:"flags.0?true"},{name:"text",type:"string"},{name:"fwd_text",type:"flags.1?string"},{name:"url",type:"string"},{name:"bot",type:"InputUser"}],type:"KeyboardButton"},{id:-1831650802,predicate:"urlAuthResultRequest",params:[{name:"flags",type:"#"},{name:"request_write_access",type:"flags.0?true"},{name:"bot",type:"User"},{name:"domain",type:"string"}],type:"UrlAuthResult"},{id:-1886646706,predicate:"urlAuthResultAccepted",params:[{name:"url",type:"string"}],type:"UrlAuthResult"},{id:-1445536993,predicate:"urlAuthResultDefault",params:[],type:"UrlAuthResult"},{id:-2079962673,predicate:"inputPrivacyValueAllowChatParticipants",params:[{name:"chats",type:"Vector"}],type:"InputPrivacyRule"},{id:-380694650,predicate:"inputPrivacyValueDisallowChatParticipants",params:[{name:"chats",type:"Vector"}],type:"InputPrivacyRule"},{id:1796427406,predicate:"privacyValueAllowChatParticipants",params:[{name:"chats",type:"Vector"}],type:"PrivacyRule"},{id:1103656293,predicate:"privacyValueDisallowChatParticipants",params:[{name:"chats",type:"Vector"}],type:"PrivacyRule"},{id:-1672577397,predicate:"messageEntityUnderline",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-1090087980,predicate:"messageEntityStrike",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:34469328,predicate:"messageEntityBlockquote",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1786671974,predicate:"updatePeerSettings",params:[{name:"peer",type:"Peer"},{name:"settings",type:"PeerSettings"}],type:"Update"},{id:-1078612597,predicate:"channelLocationEmpty",params:[],type:"ChannelLocation"},{id:547062491,predicate:"channelLocation",params:[{name:"geo_point",type:"GeoPoint"},{name:"address",type:"string"}],type:"ChannelLocation"},{id:-901375139,predicate:"peerLocated",params:[{name:"peer",type:"Peer"},{name:"expires",type:"int"},{name:"distance",type:"int"}],type:"PeerLocated"},{id:-1263546448,predicate:"updatePeerLocated",params:[{name:"peers",type:"Vector"}],type:"Update"},{id:241923758,predicate:"channelAdminLogEventActionChangeLocation",params:[{name:"prev_value",type:"ChannelLocation"},{name:"new_value",type:"ChannelLocation"}],type:"ChannelAdminLogEventAction"},{id:-606798099,predicate:"inputReportReasonGeoIrrelevant",params:[],type:"ReportReason"},{id:1401984889,predicate:"channelAdminLogEventActionToggleSlowMode",params:[{name:"prev_value",type:"int"},{name:"new_value",type:"int"}],type:"ChannelAdminLogEventAction"},{id:1148485274,predicate:"auth.authorizationSignUpRequired",params:[{name:"flags",type:"#"},{name:"terms_of_service",type:"flags.0?help.TermsOfService"}],type:"auth.Authorization"},{id:-666824391,predicate:"payments.paymentVerificationNeeded",params:[{name:"url",type:"string"}],type:"payments.PaymentResult"},{id:42402760,predicate:"inputStickerSetAnimatedEmoji",params:[],type:"InputStickerSet"},{id:967122427,predicate:"updateNewScheduledMessage",params:[{name:"message",type:"Message"}],type:"Update"},{id:-1870238482,predicate:"updateDeleteScheduledMessages",params:[{name:"peer",type:"Peer"},{name:"messages",type:"Vector"}],type:"Update"},{id:-797791052,predicate:"restrictionReason",params:[{name:"platform",type:"string"},{name:"reason",type:"string"},{name:"text",type:"string"}],type:"RestrictionReason"},{id:1012306921,predicate:"inputTheme",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputTheme"},{id:-175567375,predicate:"inputThemeSlug",params:[{name:"slug",type:"string"}],type:"InputTheme"},{id:-1609668650,predicate:"theme",params:[{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"default",type:"flags.1?true"},{name:"for_chat",type:"flags.5?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"slug",type:"string"},{name:"title",type:"string"},{name:"document",type:"flags.2?Document"},{name:"settings",type:"flags.3?Vector"},{name:"emoticon",type:"flags.6?string"},{name:"installs_count",type:"flags.4?int"}],type:"Theme"},{id:-199313886,predicate:"account.themesNotModified",params:[],type:"account.Themes"},{id:-1707242387,predicate:"account.themes",params:[{name:"hash",type:"long"},{name:"themes",type:"Vector"}],type:"account.Themes"},{id:-2112423005,predicate:"updateTheme",params:[{name:"theme",type:"Theme"}],type:"Update"},{id:-786326563,predicate:"inputPrivacyKeyAddedByPhone",params:[],type:"InputPrivacyKey"},{id:1124062251,predicate:"privacyKeyAddedByPhone",params:[],type:"PrivacyKey"},{id:-2027964103,predicate:"updateGeoLiveViewed",params:[{name:"peer",type:"Peer"},{name:"msg_id",type:"int"}],type:"Update"},{id:1448076945,predicate:"updateLoginToken",params:[],type:"Update"},{id:1654593920,predicate:"auth.loginToken",params:[{name:"expires",type:"int"},{name:"token",type:"bytes"}],type:"auth.LoginToken"},{id:110008598,predicate:"auth.loginTokenMigrateTo",params:[{name:"dc_id",type:"int"},{name:"token",type:"bytes"}],type:"auth.LoginToken"},{id:957176926,predicate:"auth.loginTokenSuccess",params:[{name:"authorization",type:"auth.Authorization"}],type:"auth.LoginToken"},{id:1474462241,predicate:"account.contentSettings",params:[{name:"flags",type:"#"},{name:"sensitive_enabled",type:"flags.0?true"},{name:"sensitive_can_change",type:"flags.1?true"}],type:"account.ContentSettings"},{id:-1456996667,predicate:"messages.inactiveChats",params:[{name:"dates",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.InactiveChats"},{id:-1012849566,predicate:"baseThemeClassic",params:[],type:"BaseTheme"},{id:-69724536,predicate:"baseThemeDay",params:[],type:"BaseTheme"},{id:-1212997976,predicate:"baseThemeNight",params:[],type:"BaseTheme"},{id:1834973166,predicate:"baseThemeTinted",params:[],type:"BaseTheme"},{id:1527845466,predicate:"baseThemeArctic",params:[],type:"BaseTheme"},{id:-1770371538,predicate:"inputWallPaperNoFile",params:[{name:"id",type:"long"}],type:"InputWallPaper"},{id:-528465642,predicate:"wallPaperNoFile",params:[{name:"id",type:"long"},{name:"flags",type:"#"},{name:"default",type:"flags.1?true"},{name:"dark",type:"flags.4?true"},{name:"settings",type:"flags.2?WallPaperSettings"}],type:"WallPaper"},{id:-1881255857,predicate:"inputThemeSettings",params:[{name:"flags",type:"#"},{name:"message_colors_animated",type:"flags.2?true"},{name:"base_theme",type:"BaseTheme"},{name:"accent_color",type:"int"},{name:"outbox_accent_color",type:"flags.3?int"},{name:"message_colors",type:"flags.0?Vector"},{name:"wallpaper",type:"flags.1?InputWallPaper"},{name:"wallpaper_settings",type:"flags.1?WallPaperSettings"}],type:"InputThemeSettings"},{id:-94849324,predicate:"themeSettings",params:[{name:"flags",type:"#"},{name:"message_colors_animated",type:"flags.2?true"},{name:"base_theme",type:"BaseTheme"},{name:"accent_color",type:"int"},{name:"outbox_accent_color",type:"flags.3?int"},{name:"message_colors",type:"flags.0?Vector"},{name:"wallpaper",type:"flags.1?WallPaper"}],type:"ThemeSettings"},{id:1421174295,predicate:"webPageAttributeTheme",params:[{name:"flags",type:"#"},{name:"documents",type:"flags.0?Vector"},{name:"settings",type:"flags.1?ThemeSettings"}],type:"WebPageAttribute"},{id:274961865,predicate:"updateMessagePollVote",params:[{name:"poll_id",type:"long"},{name:"user_id",type:"long"},{name:"options",type:"Vector"},{name:"qts",type:"int"}],type:"Update"},{id:886196148,predicate:"messageUserVote",params:[{name:"user_id",type:"long"},{name:"option",type:"bytes"},{name:"date",type:"int"}],type:"MessageUserVote"},{id:1017491692,predicate:"messageUserVoteInputOption",params:[{name:"user_id",type:"long"},{name:"date",type:"int"}],type:"MessageUserVote"},{id:-1973033641,predicate:"messageUserVoteMultiple",params:[{name:"user_id",type:"long"},{name:"options",type:"Vector"},{name:"date",type:"int"}],type:"MessageUserVote"},{id:136574537,predicate:"messages.votesList",params:[{name:"flags",type:"#"},{name:"count",type:"int"},{name:"votes",type:"Vector"},{name:"users",type:"Vector"},{name:"next_offset",type:"flags.0?string"}],type:"messages.VotesList"},{id:-1144565411,predicate:"keyboardButtonRequestPoll",params:[{name:"flags",type:"#"},{name:"quiz",type:"flags.0?Bool"},{name:"text",type:"string"}],type:"KeyboardButton"},{id:1981704948,predicate:"messageEntityBankCard",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-177732982,predicate:"bankCardOpenUrl",params:[{name:"url",type:"string"},{name:"name",type:"string"}],type:"BankCardOpenUrl"},{id:1042605427,predicate:"payments.bankCardData",params:[{name:"title",type:"string"},{name:"open_urls",type:"Vector"}],type:"payments.BankCardData"},{id:-118740917,predicate:"peerSelfLocated",params:[{name:"expires",type:"int"}],type:"PeerLocated"},{id:1949890536,predicate:"dialogFilter",params:[{name:"flags",type:"#"},{name:"contacts",type:"flags.0?true"},{name:"non_contacts",type:"flags.1?true"},{name:"groups",type:"flags.2?true"},{name:"broadcasts",type:"flags.3?true"},{name:"bots",type:"flags.4?true"},{name:"exclude_muted",type:"flags.11?true"},{name:"exclude_read",type:"flags.12?true"},{name:"exclude_archived",type:"flags.13?true"},{name:"id",type:"int"},{name:"title",type:"string"},{name:"emoticon",type:"flags.25?string"},{name:"pinned_peers",type:"Vector"},{name:"include_peers",type:"Vector"},{name:"exclude_peers",type:"Vector"}],type:"DialogFilter"},{id:2004110666,predicate:"dialogFilterSuggested",params:[{name:"filter",type:"DialogFilter"},{name:"description",type:"string"}],type:"DialogFilterSuggested"},{id:654302845,predicate:"updateDialogFilter",params:[{name:"flags",type:"#"},{name:"id",type:"int"},{name:"filter",type:"flags.0?DialogFilter"}],type:"Update"},{id:-1512627963,predicate:"updateDialogFilterOrder",params:[{name:"order",type:"Vector"}],type:"Update"},{id:889491791,predicate:"updateDialogFilters",params:[],type:"Update"},{id:-1237848657,predicate:"statsDateRangeDays",params:[{name:"min_date",type:"int"},{name:"max_date",type:"int"}],type:"StatsDateRangeDays"},{id:-884757282,predicate:"statsAbsValueAndPrev",params:[{name:"current",type:"double"},{name:"previous",type:"double"}],type:"StatsAbsValueAndPrev"},{id:-875679776,predicate:"statsPercentValue",params:[{name:"part",type:"double"},{name:"total",type:"double"}],type:"StatsPercentValue"},{id:1244130093,predicate:"statsGraphAsync",params:[{name:"token",type:"string"}],type:"StatsGraph"},{id:-1092839390,predicate:"statsGraphError",params:[{name:"error",type:"string"}],type:"StatsGraph"},{id:-1901828938,predicate:"statsGraph",params:[{name:"flags",type:"#"},{name:"json",type:"DataJSON"},{name:"zoom_token",type:"flags.0?string"}],type:"StatsGraph"},{id:-1387279939,predicate:"messageInteractionCounters",params:[{name:"msg_id",type:"int"},{name:"views",type:"int"},{name:"forwards",type:"int"}],type:"MessageInteractionCounters"},{id:-1107852396,predicate:"stats.broadcastStats",params:[{name:"period",type:"StatsDateRangeDays"},{name:"followers",type:"StatsAbsValueAndPrev"},{name:"views_per_post",type:"StatsAbsValueAndPrev"},{name:"shares_per_post",type:"StatsAbsValueAndPrev"},{name:"enabled_notifications",type:"StatsPercentValue"},{name:"growth_graph",type:"StatsGraph"},{name:"followers_graph",type:"StatsGraph"},{name:"mute_graph",type:"StatsGraph"},{name:"top_hours_graph",type:"StatsGraph"},{name:"interactions_graph",type:"StatsGraph"},{name:"iv_interactions_graph",type:"StatsGraph"},{name:"views_by_source_graph",type:"StatsGraph"},{name:"new_followers_by_source_graph",type:"StatsGraph"},{name:"languages_graph",type:"StatsGraph"},{name:"recent_message_interactions",type:"Vector"}],type:"stats.BroadcastStats"},{id:-428884101,predicate:"inputMediaDice",params:[{name:"emoticon",type:"string"}],type:"InputMedia"},{id:1065280907,predicate:"messageMediaDice",params:[{name:"value",type:"int"},{name:"emoticon",type:"string"}],type:"MessageMedia"},{id:-427863538,predicate:"inputStickerSetDice",params:[{name:"emoticon",type:"string"}],type:"InputStickerSet"},{id:-1728664459,predicate:"help.promoDataEmpty",params:[{name:"expires",type:"int"}],type:"help.PromoData"},{id:-1942390465,predicate:"help.promoData",params:[{name:"flags",type:"#"},{name:"proxy",type:"flags.0?true"},{name:"expires",type:"int"},{name:"peer",type:"Peer"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"},{name:"psa_type",type:"flags.1?string"},{name:"psa_message",type:"flags.2?string"}],type:"help.PromoData"},{id:-567037804,predicate:"videoSize",params:[{name:"flags",type:"#"},{name:"type",type:"string"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"size",type:"int"},{name:"video_start_ts",type:"flags.0?double"}],type:"VideoSize"},{id:643940105,predicate:"updatePhoneCallSignalingData",params:[{name:"phone_call_id",type:"long"},{name:"data",type:"bytes"}],type:"Update"},{id:1634294960,predicate:"chatInvitePeek",params:[{name:"chat",type:"Chat"},{name:"expires",type:"int"}],type:"ChatInvite"},{id:-1660637285,predicate:"statsGroupTopPoster",params:[{name:"user_id",type:"long"},{name:"messages",type:"int"},{name:"avg_chars",type:"int"}],type:"StatsGroupTopPoster"},{id:-682079097,predicate:"statsGroupTopAdmin",params:[{name:"user_id",type:"long"},{name:"deleted",type:"int"},{name:"kicked",type:"int"},{name:"banned",type:"int"}],type:"StatsGroupTopAdmin"},{id:1398765469,predicate:"statsGroupTopInviter",params:[{name:"user_id",type:"long"},{name:"invitations",type:"int"}],type:"StatsGroupTopInviter"},{id:-276825834,predicate:"stats.megagroupStats",params:[{name:"period",type:"StatsDateRangeDays"},{name:"members",type:"StatsAbsValueAndPrev"},{name:"messages",type:"StatsAbsValueAndPrev"},{name:"viewers",type:"StatsAbsValueAndPrev"},{name:"posters",type:"StatsAbsValueAndPrev"},{name:"growth_graph",type:"StatsGraph"},{name:"members_graph",type:"StatsGraph"},{name:"new_members_by_source_graph",type:"StatsGraph"},{name:"languages_graph",type:"StatsGraph"},{name:"messages_graph",type:"StatsGraph"},{name:"actions_graph",type:"StatsGraph"},{name:"top_hours_graph",type:"StatsGraph"},{name:"weekdays_graph",type:"StatsGraph"},{name:"top_posters",type:"Vector"},{name:"top_admins",type:"Vector"},{name:"top_inviters",type:"Vector"},{name:"users",type:"Vector"}],type:"stats.MegagroupStats"},{id:-1096616924,predicate:"globalPrivacySettings",params:[{name:"flags",type:"#"},{name:"archive_and_mute_new_noncontact_peers",type:"flags.0?Bool"}],type:"GlobalPrivacySettings"},{id:1667228533,predicate:"phoneConnectionWebrtc",params:[{name:"flags",type:"#"},{name:"turn",type:"flags.0?true"},{name:"stun",type:"flags.1?true"},{name:"id",type:"long"},{name:"ip",type:"string"},{name:"ipv6",type:"string"},{name:"port",type:"int"},{name:"username",type:"string"},{name:"password",type:"string"}],type:"PhoneConnection"},{id:1107543535,predicate:"help.countryCode",params:[{name:"flags",type:"#"},{name:"country_code",type:"string"},{name:"prefixes",type:"flags.0?Vector"},{name:"patterns",type:"flags.1?Vector"}],type:"help.CountryCode"},{id:-1014526429,predicate:"help.country",params:[{name:"flags",type:"#"},{name:"hidden",type:"flags.0?true"},{name:"iso2",type:"string"},{name:"default_name",type:"string"},{name:"name",type:"flags.1?string"},{name:"country_codes",type:"Vector"}],type:"help.Country"},{id:-1815339214,predicate:"help.countriesListNotModified",params:[],type:"help.CountriesList"},{id:-2016381538,predicate:"help.countriesList",params:[{name:"countries",type:"Vector"},{name:"hash",type:"int"}],type:"help.CountriesList"},{id:1163625789,predicate:"messageViews",params:[{name:"flags",type:"#"},{name:"views",type:"flags.0?int"},{name:"forwards",type:"flags.1?int"},{name:"replies",type:"flags.2?MessageReplies"}],type:"MessageViews"},{id:-761649164,predicate:"updateChannelMessageForwards",params:[{name:"channel_id",type:"long"},{name:"id",type:"int"},{name:"forwards",type:"int"}],type:"Update"},{id:-96535659,predicate:"photoSizeProgressive",params:[{name:"type",type:"string"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"sizes",type:"Vector"}],type:"PhotoSize"},{id:-1228606141,predicate:"messages.messageViews",params:[{name:"views",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.MessageViews"},{id:-693004986,predicate:"updateReadChannelDiscussionInbox",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"top_msg_id",type:"int"},{name:"read_max_id",type:"int"},{name:"broadcast_id",type:"flags.0?long"},{name:"broadcast_post",type:"flags.0?int"}],type:"Update"},{id:1767677564,predicate:"updateReadChannelDiscussionOutbox",params:[{name:"channel_id",type:"long"},{name:"top_msg_id",type:"int"},{name:"read_max_id",type:"int"}],type:"Update"},{id:-1506535550,predicate:"messages.discussionMessage",params:[{name:"flags",type:"#"},{name:"messages",type:"Vector"},{name:"max_id",type:"flags.0?int"},{name:"read_inbox_max_id",type:"flags.1?int"},{name:"read_outbox_max_id",type:"flags.2?int"},{name:"unread_count",type:"int"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.DiscussionMessage"},{id:-1495959709,predicate:"messageReplyHeader",params:[{name:"flags",type:"#"},{name:"reply_to_scheduled",type:"flags.2?true"},{name:"forum_topic",type:"flags.3?true"},{name:"reply_to_msg_id",type:"int"},{name:"reply_to_peer_id",type:"flags.0?Peer"},{name:"reply_to_top_id",type:"flags.1?int"}],type:"MessageReplyHeader"},{id:-2083123262,predicate:"messageReplies",params:[{name:"flags",type:"#"},{name:"comments",type:"flags.0?true"},{name:"replies",type:"int"},{name:"replies_pts",type:"int"},{name:"recent_repliers",type:"flags.1?Vector"},{name:"channel_id",type:"flags.0?long"},{name:"max_id",type:"flags.2?int"},{name:"read_max_id",type:"flags.3?int"}],type:"MessageReplies"},{id:610945826,predicate:"updatePeerBlocked",params:[{name:"peer_id",type:"Peer"},{name:"blocked",type:"Bool"}],type:"Update"},{id:-386039788,predicate:"peerBlocked",params:[{name:"peer_id",type:"Peer"},{name:"date",type:"int"}],type:"PeerBlocked"},{id:-1937192669,predicate:"updateChannelUserTyping",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"top_msg_id",type:"flags.0?int"},{name:"from_id",type:"Peer"},{name:"action",type:"SendMessageAction"}],type:"Update"},{id:-1392895362,predicate:"inputMessageCallbackQuery",params:[{name:"id",type:"int"},{name:"query_id",type:"long"}],type:"InputMessage"},{id:453242886,predicate:"channelParticipantLeft",params:[{name:"peer",type:"Peer"}],type:"ChannelParticipant"},{id:-531931925,predicate:"channelParticipantsMentions",params:[{name:"flags",type:"#"},{name:"q",type:"flags.0?string"},{name:"top_msg_id",type:"flags.1?int"}],type:"ChannelParticipantsFilter"},{id:-309990731,predicate:"updatePinnedMessages",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.0?true"},{name:"peer",type:"Peer"},{name:"messages",type:"Vector"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:1538885128,predicate:"updatePinnedChannelMessages",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.0?true"},{name:"channel_id",type:"long"},{name:"messages",type:"Vector"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:464520273,predicate:"inputMessagesFilterPinned",params:[],type:"MessagesFilter"},{id:-1986399595,predicate:"stats.messageStats",params:[{name:"views_graph",type:"StatsGraph"}],type:"stats.MessageStats"},{id:-1730095465,predicate:"messageActionGeoProximityReached",params:[{name:"from_id",type:"Peer"},{name:"to_id",type:"Peer"},{name:"distance",type:"int"}],type:"MessageAction"},{id:-668906175,predicate:"photoPathSize",params:[{name:"type",type:"string"},{name:"bytes",type:"bytes"}],type:"PhotoSize"},{id:-651419003,predicate:"speakingInGroupCallAction",params:[],type:"SendMessageAction"},{id:2004925620,predicate:"groupCallDiscarded",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"duration",type:"int"}],type:"GroupCall"},{id:-711498484,predicate:"groupCall",params:[{name:"flags",type:"#"},{name:"join_muted",type:"flags.1?true"},{name:"can_change_join_muted",type:"flags.2?true"},{name:"join_date_asc",type:"flags.6?true"},{name:"schedule_start_subscribed",type:"flags.8?true"},{name:"can_start_video",type:"flags.9?true"},{name:"record_video_active",type:"flags.11?true"},{name:"rtmp_stream",type:"flags.12?true"},{name:"listeners_hidden",type:"flags.13?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"participants_count",type:"int"},{name:"title",type:"flags.3?string"},{name:"stream_dc_id",type:"flags.4?int"},{name:"record_start_date",type:"flags.5?int"},{name:"schedule_date",type:"flags.7?int"},{name:"unmuted_video_count",type:"flags.10?int"},{name:"unmuted_video_limit",type:"int"},{name:"version",type:"int"}],type:"GroupCall"},{id:-659913713,predicate:"inputGroupCall",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputGroupCall"},{id:2047704898,predicate:"messageActionGroupCall",params:[{name:"flags",type:"#"},{name:"call",type:"InputGroupCall"},{name:"duration",type:"flags.0?int"}],type:"MessageAction"},{id:1345295095,predicate:"messageActionInviteToGroupCall",params:[{name:"call",type:"InputGroupCall"},{name:"users",type:"Vector"}],type:"MessageAction"},{id:-341428482,predicate:"groupCallParticipant",params:[{name:"flags",type:"#"},{name:"muted",type:"flags.0?true"},{name:"left",type:"flags.1?true"},{name:"can_self_unmute",type:"flags.2?true"},{name:"just_joined",type:"flags.4?true"},{name:"versioned",type:"flags.5?true"},{name:"min",type:"flags.8?true"},{name:"muted_by_you",type:"flags.9?true"},{name:"volume_by_admin",type:"flags.10?true"},{name:"self",type:"flags.12?true"},{name:"video_joined",type:"flags.15?true"},{name:"peer",type:"Peer"},{name:"date",type:"int"},{name:"active_date",type:"flags.3?int"},{name:"source",type:"int"},{name:"volume",type:"flags.7?int"},{name:"about",type:"flags.11?string"},{name:"raise_hand_rating",type:"flags.13?long"},{name:"video",type:"flags.6?GroupCallParticipantVideo"},{name:"presentation",type:"flags.14?GroupCallParticipantVideo"}],type:"GroupCallParticipant"},{id:-124097970,predicate:"updateChat",params:[{name:"chat_id",type:"long"}],type:"Update"},{id:-219423922,predicate:"updateGroupCallParticipants",params:[{name:"call",type:"InputGroupCall"},{name:"participants",type:"Vector"},{name:"version",type:"int"}],type:"Update"},{id:347227392,predicate:"updateGroupCall",params:[{name:"chat_id",type:"long"},{name:"call",type:"GroupCall"}],type:"Update"},{id:-1636664659,predicate:"phone.groupCall",params:[{name:"call",type:"GroupCall"},{name:"participants",type:"Vector"},{name:"participants_next_offset",type:"string"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"phone.GroupCall"},{id:-193506890,predicate:"phone.groupParticipants",params:[{name:"count",type:"int"},{name:"participants",type:"Vector"},{name:"next_offset",type:"string"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"},{name:"version",type:"int"}],type:"phone.GroupParticipants"},{id:813821341,predicate:"inlineQueryPeerTypeSameBotPM",params:[],type:"InlineQueryPeerType"},{id:-2093215828,predicate:"inlineQueryPeerTypePM",params:[],type:"InlineQueryPeerType"},{id:-681130742,predicate:"inlineQueryPeerTypeChat",params:[],type:"InlineQueryPeerType"},{id:1589952067,predicate:"inlineQueryPeerTypeMegagroup",params:[],type:"InlineQueryPeerType"},{id:1664413338,predicate:"inlineQueryPeerTypeBroadcast",params:[],type:"InlineQueryPeerType"},{id:589338437,predicate:"channelAdminLogEventActionStartGroupCall",params:[{name:"call",type:"InputGroupCall"}],type:"ChannelAdminLogEventAction"},{id:-610299584,predicate:"channelAdminLogEventActionDiscardGroupCall",params:[{name:"call",type:"InputGroupCall"}],type:"ChannelAdminLogEventAction"},{id:-115071790,predicate:"channelAdminLogEventActionParticipantMute",params:[{name:"participant",type:"GroupCallParticipant"}],type:"ChannelAdminLogEventAction"},{id:-431740480,predicate:"channelAdminLogEventActionParticipantUnmute",params:[{name:"participant",type:"GroupCallParticipant"}],type:"ChannelAdminLogEventAction"},{id:1456906823,predicate:"channelAdminLogEventActionToggleGroupCallSetting",params:[{name:"join_muted",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:-1966921727,predicate:"inputPaymentCredentialsGooglePay",params:[{name:"payment_token",type:"DataJSON"}],type:"InputPaymentCredentials"},{id:375566091,predicate:"messages.historyImport",params:[{name:"id",type:"long"}],type:"messages.HistoryImport"},{id:-606432698,predicate:"sendMessageHistoryImportAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:1578088377,predicate:"messages.historyImportParsed",params:[{name:"flags",type:"#"},{name:"pm",type:"flags.0?true"},{name:"group",type:"flags.1?true"},{name:"title",type:"flags.2?string"}],type:"messages.HistoryImportParsed"},{id:-170010905,predicate:"inputReportReasonFake",params:[],type:"ReportReason"},{id:-275956116,predicate:"messages.affectedFoundMessages",params:[{name:"pts",type:"int"},{name:"pts_count",type:"int"},{name:"offset",type:"int"},{name:"messages",type:"Vector"}],type:"messages.AffectedFoundMessages"},{id:1007897979,predicate:"messageActionSetMessagesTTL",params:[{name:"flags",type:"#"},{name:"period",type:"int"},{name:"auto_setting_from",type:"flags.0?long"}],type:"MessageAction"},{id:-1147422299,predicate:"updatePeerHistoryTTL",params:[{name:"flags",type:"#"},{name:"peer",type:"Peer"},{name:"ttl_period",type:"flags.0?int"}],type:"Update"},{id:-796432838,predicate:"updateChatParticipant",params:[{name:"flags",type:"#"},{name:"chat_id",type:"long"},{name:"date",type:"int"},{name:"actor_id",type:"long"},{name:"user_id",type:"long"},{name:"prev_participant",type:"flags.0?ChatParticipant"},{name:"new_participant",type:"flags.1?ChatParticipant"},{name:"invite",type:"flags.2?ExportedChatInvite"},{name:"qts",type:"int"}],type:"Update"},{id:-1738720581,predicate:"updateChannelParticipant",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"date",type:"int"},{name:"actor_id",type:"long"},{name:"user_id",type:"long"},{name:"prev_participant",type:"flags.0?ChannelParticipant"},{name:"new_participant",type:"flags.1?ChannelParticipant"},{name:"invite",type:"flags.2?ExportedChatInvite"},{name:"qts",type:"int"}],type:"Update"},{id:-997782967,predicate:"updateBotStopped",params:[{name:"user_id",type:"long"},{name:"date",type:"int"},{name:"stopped",type:"Bool"},{name:"qts",type:"int"}],type:"Update"},{id:-1940201511,predicate:"chatInviteImporter",params:[{name:"flags",type:"#"},{name:"requested",type:"flags.0?true"},{name:"user_id",type:"long"},{name:"date",type:"int"},{name:"about",type:"flags.2?string"},{name:"approved_by",type:"flags.1?long"}],type:"ChatInviteImporter"},{id:-1111085620,predicate:"messages.exportedChatInvites",params:[{name:"count",type:"int"},{name:"invites",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.ExportedChatInvites"},{id:410107472,predicate:"messages.exportedChatInvite",params:[{name:"invite",type:"ExportedChatInvite"},{name:"users",type:"Vector"}],type:"messages.ExportedChatInvite"},{id:572915951,predicate:"messages.exportedChatInviteReplaced",params:[{name:"invite",type:"ExportedChatInvite"},{name:"new_invite",type:"ExportedChatInvite"},{name:"users",type:"Vector"}],type:"messages.ExportedChatInvite"},{id:-2118733814,predicate:"messages.chatInviteImporters",params:[{name:"count",type:"int"},{name:"importers",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.ChatInviteImporters"},{id:-219353309,predicate:"chatAdminWithInvites",params:[{name:"admin_id",type:"long"},{name:"invites_count",type:"int"},{name:"revoked_invites_count",type:"int"}],type:"ChatAdminWithInvites"},{id:-1231326505,predicate:"messages.chatAdminsWithInvites",params:[{name:"admins",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.ChatAdminsWithInvites"},{id:1557846647,predicate:"channelAdminLogEventActionParticipantJoinByInvite",params:[{name:"invite",type:"ExportedChatInvite"}],type:"ChannelAdminLogEventAction"},{id:1515256996,predicate:"channelAdminLogEventActionExportedInviteDelete",params:[{name:"invite",type:"ExportedChatInvite"}],type:"ChannelAdminLogEventAction"},{id:1091179342,predicate:"channelAdminLogEventActionExportedInviteRevoke",params:[{name:"invite",type:"ExportedChatInvite"}],type:"ChannelAdminLogEventAction"},{id:-384910503,predicate:"channelAdminLogEventActionExportedInviteEdit",params:[{name:"prev_invite",type:"ExportedChatInvite"},{name:"new_invite",type:"ExportedChatInvite"}],type:"ChannelAdminLogEventAction"},{id:1048537159,predicate:"channelAdminLogEventActionParticipantVolume",params:[{name:"participant",type:"GroupCallParticipant"}],type:"ChannelAdminLogEventAction"},{id:1855199800,predicate:"channelAdminLogEventActionChangeHistoryTTL",params:[{name:"prev_value",type:"int"},{name:"new_value",type:"int"}],type:"ChannelAdminLogEventAction"},{id:-1571952873,predicate:"messages.checkedHistoryImportPeer",params:[{name:"confirm_text",type:"string"}],type:"messages.CheckedHistoryImportPeer"},{id:93890858,predicate:"inputGroupCallStream",params:[{name:"flags",type:"#"},{name:"call",type:"InputGroupCall"},{name:"time_ms",type:"long"},{name:"scale",type:"int"},{name:"video_channel",type:"flags.0?int"},{name:"video_quality",type:"flags.0?int"}],type:"InputFileLocation"},{id:-1343921601,predicate:"phone.joinAsPeers",params:[{name:"peers",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"phone.JoinAsPeers"},{id:541839704,predicate:"phone.exportedGroupCallInvite",params:[{name:"link",type:"string"}],type:"phone.ExportedGroupCallInvite"},{id:-672693723,predicate:"inputBotInlineMessageMediaInvoice",params:[{name:"flags",type:"#"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.0?InputWebDocument"},{name:"invoice",type:"Invoice"},{name:"payload",type:"bytes"},{name:"provider",type:"string"},{name:"provider_data",type:"DataJSON"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:894081801,predicate:"botInlineMessageMediaInvoice",params:[{name:"flags",type:"#"},{name:"shipping_address_requested",type:"flags.1?true"},{name:"test",type:"flags.3?true"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.0?WebDocument"},{name:"currency",type:"string"},{name:"total_amount",type:"long"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:-1281329567,predicate:"messageActionGroupCallScheduled",params:[{name:"call",type:"InputGroupCall"},{name:"schedule_date",type:"int"}],type:"MessageAction"},{id:-592373577,predicate:"groupCallParticipantVideoSourceGroup",params:[{name:"semantics",type:"string"},{name:"sources",type:"Vector"}],type:"GroupCallParticipantVideoSourceGroup"},{id:1735736008,predicate:"groupCallParticipantVideo",params:[{name:"flags",type:"#"},{name:"paused",type:"flags.0?true"},{name:"endpoint",type:"string"},{name:"source_groups",type:"Vector"},{name:"audio_source",type:"flags.1?int"}],type:"GroupCallParticipantVideo"},{id:192428418,predicate:"updateGroupCallConnection",params:[{name:"flags",type:"#"},{name:"presentation",type:"flags.0?true"},{name:"params",type:"DataJSON"}],type:"Update"},{id:-2046910401,predicate:"stickers.suggestedShortName",params:[{name:"short_name",type:"string"}],type:"stickers.SuggestedShortName"},{id:795652779,predicate:"botCommandScopeDefault",params:[],type:"BotCommandScope"},{id:1011811544,predicate:"botCommandScopeUsers",params:[],type:"BotCommandScope"},{id:1877059713,predicate:"botCommandScopeChats",params:[],type:"BotCommandScope"},{id:-1180016534,predicate:"botCommandScopeChatAdmins",params:[],type:"BotCommandScope"},{id:-610432643,predicate:"botCommandScopePeer",params:[{name:"peer",type:"InputPeer"}],type:"BotCommandScope"},{id:1071145937,predicate:"botCommandScopePeerAdmins",params:[{name:"peer",type:"InputPeer"}],type:"BotCommandScope"},{id:169026035,predicate:"botCommandScopePeerUser",params:[{name:"peer",type:"InputPeer"},{name:"user_id",type:"InputUser"}],type:"BotCommandScope"},{id:-478701471,predicate:"account.resetPasswordFailedWait",params:[{name:"retry_date",type:"int"}],type:"account.ResetPasswordResult"},{id:-370148227,predicate:"account.resetPasswordRequestedWait",params:[{name:"until_date",type:"int"}],type:"account.ResetPasswordResult"},{id:-383330754,predicate:"account.resetPasswordOk",params:[],type:"account.ResetPasswordResult"},{id:1299263278,predicate:"updateBotCommands",params:[{name:"peer",type:"Peer"},{name:"bot_id",type:"long"},{name:"commands",type:"Vector"}],type:"Update"},{id:-1434950843,predicate:"messageActionSetChatTheme",params:[{name:"emoticon",type:"string"}],type:"MessageAction"},{id:-1336228175,predicate:"sendMessageChooseStickerAction",params:[],type:"SendMessageAction"},{id:981691896,predicate:"sponsoredMessage",params:[{name:"flags",type:"#"},{name:"recommended",type:"flags.5?true"},{name:"show_peer_photo",type:"flags.6?true"},{name:"random_id",type:"bytes"},{name:"from_id",type:"flags.3?Peer"},{name:"chat_invite",type:"flags.4?ChatInvite"},{name:"chat_invite_hash",type:"flags.4?string"},{name:"channel_post",type:"flags.2?int"},{name:"start_param",type:"flags.0?string"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector"}],type:"SponsoredMessage"},{id:-907141753,predicate:"messages.sponsoredMessages",params:[{name:"flags",type:"#"},{name:"posts_between",type:"flags.0?int"},{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.SponsoredMessages"},{id:215889721,predicate:"inputStickerSetAnimatedEmojiAnimations",params:[],type:"InputStickerSet"},{id:630664139,predicate:"sendMessageEmojiInteraction",params:[{name:"emoticon",type:"string"},{name:"msg_id",type:"int"},{name:"interaction",type:"DataJSON"}],type:"SendMessageAction"},{id:-1234857938,predicate:"sendMessageEmojiInteractionSeen",params:[{name:"emoticon",type:"string"}],type:"SendMessageAction"},{id:-1227287081,predicate:"inputBotInlineMessageID64",params:[{name:"dc_id",type:"int"},{name:"owner_id",type:"long"},{name:"id",type:"int"},{name:"access_hash",type:"long"}],type:"InputBotInlineMessageID"},{id:-911191137,predicate:"searchResultsCalendarPeriod",params:[{name:"date",type:"int"},{name:"min_msg_id",type:"int"},{name:"max_msg_id",type:"int"},{name:"count",type:"int"}],type:"SearchResultsCalendarPeriod"},{id:343859772,predicate:"messages.searchResultsCalendar",params:[{name:"flags",type:"#"},{name:"inexact",type:"flags.0?true"},{name:"count",type:"int"},{name:"min_date",type:"int"},{name:"min_msg_id",type:"int"},{name:"offset_id_offset",type:"flags.1?int"},{name:"periods",type:"Vector"},{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.SearchResultsCalendar"},{id:2137295719,predicate:"searchResultPosition",params:[{name:"msg_id",type:"int"},{name:"date",type:"int"},{name:"offset",type:"int"}],type:"SearchResultsPosition"},{id:1404185519,predicate:"messages.searchResultsPositions",params:[{name:"count",type:"int"},{name:"positions",type:"Vector"}],type:"messages.SearchResultsPositions"},{id:-339958837,predicate:"messageActionChatJoinedByRequest",params:[],type:"MessageAction"},{id:1885586395,predicate:"updatePendingJoinRequests",params:[{name:"peer",type:"Peer"},{name:"requests_pending",type:"int"},{name:"recent_requesters",type:"Vector"}],type:"Update"},{id:299870598,predicate:"updateBotChatInviteRequester",params:[{name:"peer",type:"Peer"},{name:"date",type:"int"},{name:"user_id",type:"long"},{name:"about",type:"string"},{name:"invite",type:"ExportedChatInvite"},{name:"qts",type:"int"}],type:"Update"},{id:-1347021750,predicate:"channelAdminLogEventActionParticipantJoinByRequest",params:[{name:"invite",type:"ExportedChatInvite"},{name:"approved_by",type:"long"}],type:"ChannelAdminLogEventAction"},{id:-376962181,predicate:"inputKeyboardButtonUserProfile",params:[{name:"text",type:"string"},{name:"user_id",type:"InputUser"}],type:"KeyboardButton"},{id:814112961,predicate:"keyboardButtonUserProfile",params:[{name:"text",type:"string"},{name:"user_id",type:"long"}],type:"KeyboardButton"},{id:-191450938,predicate:"channels.sendAsPeers",params:[{name:"peers",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"channels.SendAsPeers"},{id:-886388890,predicate:"channelAdminLogEventActionToggleNoForwards",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:-738646805,predicate:"messages.stickerSetNotModified",params:[],type:"messages.StickerSet"},{id:997004590,predicate:"users.userFull",params:[{name:"full_user",type:"UserFull"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"users.UserFull"},{id:1753266509,predicate:"messages.peerSettings",params:[{name:"settings",type:"PeerSettings"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.PeerSettings"},{id:663693416,predicate:"channelAdminLogEventActionSendMessage",params:[{name:"message",type:"Message"}],type:"ChannelAdminLogEventAction"},{id:-702884114,predicate:"auth.codeTypeMissedCall",params:[],type:"auth.CodeType"},{id:-2113903484,predicate:"auth.sentCodeTypeMissedCall",params:[{name:"prefix",type:"string"},{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:-1012759713,predicate:"auth.loggedOut",params:[{name:"flags",type:"#"},{name:"future_auth_token",type:"flags.0?bytes"}],type:"auth.LoggedOut"},{id:1578843320,predicate:"updateMessageReactions",params:[{name:"flags",type:"#"},{name:"peer",type:"Peer"},{name:"msg_id",type:"int"},{name:"top_msg_id",type:"flags.0?int"},{name:"reactions",type:"MessageReactions"}],type:"Update"},{id:-1546531968,predicate:"reactionCount",params:[{name:"flags",type:"#"},{name:"chosen_order",type:"flags.0?int"},{name:"reaction",type:"Reaction"},{name:"count",type:"int"}],type:"ReactionCount"},{id:1328256121,predicate:"messageReactions",params:[{name:"flags",type:"#"},{name:"min",type:"flags.0?true"},{name:"can_see_list",type:"flags.2?true"},{name:"results",type:"Vector"},{name:"recent_reactions",type:"flags.1?Vector"}],type:"MessageReactions"},{id:834488621,predicate:"messages.messageReactionsList",params:[{name:"flags",type:"#"},{name:"count",type:"int"},{name:"reactions",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"},{name:"next_offset",type:"flags.0?string"}],type:"messages.MessageReactionsList"},{id:-1065882623,predicate:"availableReaction",params:[{name:"flags",type:"#"},{name:"inactive",type:"flags.0?true"},{name:"premium",type:"flags.2?true"},{name:"reaction",type:"string"},{name:"title",type:"string"},{name:"static_icon",type:"Document"},{name:"appear_animation",type:"Document"},{name:"select_animation",type:"Document"},{name:"activate_animation",type:"Document"},{name:"effect_animation",type:"Document"},{name:"around_animation",type:"flags.1?Document"},{name:"center_icon",type:"flags.1?Document"}],type:"AvailableReaction"},{id:-1626924713,predicate:"messages.availableReactionsNotModified",params:[],type:"messages.AvailableReactions"},{id:1989032621,predicate:"messages.availableReactions",params:[{name:"hash",type:"int"},{name:"reactions",type:"Vector"}],type:"messages.AvailableReactions"},{id:852137487,predicate:"messageEntitySpoiler",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-1102180616,predicate:"channelAdminLogEventActionChangeAvailableReactions",params:[{name:"prev_value",type:"ChatReactions"},{name:"new_value",type:"ChatReactions"}],type:"ChannelAdminLogEventAction"},{id:-1319698788,predicate:"messagePeerReaction",params:[{name:"flags",type:"#"},{name:"big",type:"flags.0?true"},{name:"unread",type:"flags.1?true"},{name:"peer_id",type:"Peer"},{name:"reaction",type:"Reaction"}],type:"MessagePeerReaction"},{id:-2132064081,predicate:"groupCallStreamChannel",params:[{name:"channel",type:"int"},{name:"scale",type:"int"},{name:"last_timestamp_ms",type:"long"}],type:"GroupCallStreamChannel"},{id:-790330702,predicate:"phone.groupCallStreamChannels",params:[{name:"channels",type:"Vector"}],type:"phone.GroupCallStreamChannels"},{id:177124030,predicate:"inputReportReasonIllegalDrugs",params:[],type:"ReportReason"},{id:-1631091139,predicate:"inputReportReasonPersonalDetails",params:[],type:"ReportReason"},{id:767505458,predicate:"phone.groupCallStreamRtmpUrl",params:[{name:"url",type:"string"},{name:"key",type:"string"}],type:"phone.GroupCallStreamRtmpUrl"},{id:1165423600,predicate:"attachMenuBotIconColor",params:[{name:"name",type:"string"},{name:"color",type:"int"}],type:"AttachMenuBotIconColor"},{id:-1297663893,predicate:"attachMenuBotIcon",params:[{name:"flags",type:"#"},{name:"name",type:"string"},{name:"icon",type:"Document"},{name:"colors",type:"flags.0?Vector"}],type:"AttachMenuBotIcon"},{id:-928371502,predicate:"attachMenuBot",params:[{name:"flags",type:"#"},{name:"inactive",type:"flags.0?true"},{name:"has_settings",type:"flags.1?true"},{name:"request_write_access",type:"flags.2?true"},{name:"bot_id",type:"long"},{name:"short_name",type:"string"},{name:"peer_types",type:"Vector"},{name:"icons",type:"Vector"}],type:"AttachMenuBot"},{id:-237467044,predicate:"attachMenuBotsNotModified",params:[],type:"AttachMenuBots"},{id:1011024320,predicate:"attachMenuBots",params:[{name:"hash",type:"long"},{name:"bots",type:"Vector"},{name:"users",type:"Vector"}],type:"AttachMenuBots"},{id:-1816172929,predicate:"attachMenuBotsBot",params:[{name:"bot",type:"AttachMenuBot"},{name:"users",type:"Vector"}],type:"AttachMenuBotsBot"},{id:397910539,predicate:"updateAttachMenuBots",params:[],type:"Update"},{id:202659196,predicate:"webViewResultUrl",params:[{name:"query_id",type:"long"},{name:"url",type:"string"}],type:"WebViewResult"},{id:-2010155333,predicate:"simpleWebViewResultUrl",params:[{name:"url",type:"string"}],type:"SimpleWebViewResult"},{id:211046684,predicate:"webViewMessageSent",params:[{name:"flags",type:"#"},{name:"msg_id",type:"flags.0?InputBotInlineMessageID"}],type:"WebViewMessageSent"},{id:361936797,predicate:"updateWebViewResultSent",params:[{name:"query_id",type:"long"}],type:"Update"},{id:326529584,predicate:"keyboardButtonWebView",params:[{name:"text",type:"string"},{name:"url",type:"string"}],type:"KeyboardButton"},{id:-1598009252,predicate:"keyboardButtonSimpleWebView",params:[{name:"text",type:"string"},{name:"url",type:"string"}],type:"KeyboardButton"},{id:1205698681,predicate:"messageActionWebViewDataSentMe",params:[{name:"text",type:"string"},{name:"data",type:"string"}],type:"MessageAction"},{id:-1262252875,predicate:"messageActionWebViewDataSent",params:[{name:"text",type:"string"}],type:"MessageAction"},{id:347625491,predicate:"updateBotMenuButton",params:[{name:"bot_id",type:"long"},{name:"button",type:"BotMenuButton"}],type:"Update"},{id:1966318984,predicate:"botMenuButtonDefault",params:[],type:"BotMenuButton"},{id:1113113093,predicate:"botMenuButtonCommands",params:[],type:"BotMenuButton"},{id:-944407322,predicate:"botMenuButton",params:[{name:"text",type:"string"},{name:"url",type:"string"}],type:"BotMenuButton"},{id:-67704655,predicate:"account.savedRingtonesNotModified",params:[],type:"account.SavedRingtones"},{id:-1041683259,predicate:"account.savedRingtones",params:[{name:"hash",type:"long"},{name:"ringtones",type:"Vector"}],type:"account.SavedRingtones"},{id:1960361625,predicate:"updateSavedRingtones",params:[],type:"Update"},{id:-1746354498,predicate:"notificationSoundDefault",params:[],type:"NotificationSound"},{id:1863070943,predicate:"notificationSoundNone",params:[],type:"NotificationSound"},{id:-2096391452,predicate:"notificationSoundLocal",params:[{name:"title",type:"string"},{name:"data",type:"string"}],type:"NotificationSound"},{id:-9666487,predicate:"notificationSoundRingtone",params:[{name:"id",type:"long"}],type:"NotificationSound"},{id:-1222230163,predicate:"account.savedRingtone",params:[],type:"account.SavedRingtone"},{id:523271863,predicate:"account.savedRingtoneConverted",params:[{name:"document",type:"Document"}],type:"account.SavedRingtone"},{id:2104224014,predicate:"attachMenuPeerTypeSameBotPM",params:[],type:"AttachMenuPeerType"},{id:-1020528102,predicate:"attachMenuPeerTypeBotPM",params:[],type:"AttachMenuPeerType"},{id:-247016673,predicate:"attachMenuPeerTypePM",params:[],type:"AttachMenuPeerType"},{id:84480319,predicate:"attachMenuPeerTypeChat",params:[],type:"AttachMenuPeerType"},{id:2080104188,predicate:"attachMenuPeerTypeBroadcast",params:[],type:"AttachMenuPeerType"},{id:-317687113,predicate:"chatInvitePublicJoinRequests",params:[],type:"ExportedChatInvite"},{id:-977967015,predicate:"inputInvoiceMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"InputInvoice"},{id:-1020867857,predicate:"inputInvoiceSlug",params:[{name:"slug",type:"string"}],type:"InputInvoice"},{id:-1362048039,predicate:"payments.exportedInvoice",params:[{name:"url",type:"string"}],type:"payments.ExportedInvoice"},{id:8703322,predicate:"updateTranscribedAudio",params:[{name:"flags",type:"#"},{name:"pending",type:"flags.0?true"},{name:"peer",type:"Peer"},{name:"msg_id",type:"int"},{name:"transcription_id",type:"long"},{name:"text",type:"string"}],type:"Update"},{id:-1821037486,predicate:"messages.transcribedAudio",params:[{name:"flags",type:"#"},{name:"pending",type:"flags.0?true"},{name:"transcription_id",type:"long"},{name:"text",type:"string"}],type:"messages.TranscribedAudio"},{id:909284270,predicate:"dialogFilterDefault",params:[],type:"DialogFilter"},{id:1395946908,predicate:"help.premiumPromo",params:[{name:"status_text",type:"string"},{name:"status_entities",type:"Vector"},{name:"video_sections",type:"Vector"},{name:"videos",type:"Vector"},{name:"period_options",type:"Vector"},{name:"users",type:"Vector"}],type:"help.PremiumPromo"},{id:-925956616,predicate:"messageEntityCustomEmoji",params:[{name:"offset",type:"int"},{name:"length",type:"int"},{name:"document_id",type:"long"}],type:"MessageEntity"},{id:-48981863,predicate:"documentAttributeCustomEmoji",params:[{name:"flags",type:"#"},{name:"free",type:"flags.0?true"},{name:"text_color",type:"flags.1?true"},{name:"alt",type:"string"},{name:"stickerset",type:"InputStickerSet"}],type:"DocumentAttribute"},{id:1087454222,predicate:"stickerSetFullCovered",params:[{name:"set",type:"StickerSet"},{name:"packs",type:"Vector"},{name:"keywords",type:"Vector"},{name:"documents",type:"Vector"}],type:"StickerSetCovered"},{id:-1502273946,predicate:"inputStorePaymentPremiumSubscription",params:[{name:"flags",type:"#"},{name:"restore",type:"flags.0?true"},{name:"upgrade",type:"flags.1?true"}],type:"InputStorePaymentPurpose"},{id:1634697192,predicate:"inputStorePaymentGiftPremium",params:[{name:"user_id",type:"InputUser"},{name:"currency",type:"string"},{name:"amount",type:"long"}],type:"InputStorePaymentPurpose"},{id:-1415514682,predicate:"messageActionGiftPremium",params:[{name:"currency",type:"string"},{name:"amount",type:"long"},{name:"months",type:"int"}],type:"MessageAction"},{id:1958953753,predicate:"premiumGiftOption",params:[{name:"flags",type:"#"},{name:"months",type:"int"},{name:"currency",type:"string"},{name:"amount",type:"long"},{name:"bot_url",type:"string"},{name:"store_product",type:"flags.0?string"}],type:"PremiumGiftOption"},{id:-930399486,predicate:"inputStickerSetPremiumGifts",params:[],type:"InputStickerSet"},{id:-78886548,predicate:"updateReadFeaturedEmojiStickers",params:[],type:"Update"},{id:-1360618136,predicate:"inputPrivacyKeyVoiceMessages",params:[],type:"InputPrivacyKey"},{id:110621716,predicate:"privacyKeyVoiceMessages",params:[],type:"PrivacyKey"},{id:-1996951013,predicate:"paymentFormMethod",params:[{name:"url",type:"string"},{name:"title",type:"string"}],type:"PaymentFormMethod"},{id:-193992412,predicate:"inputWebFileAudioAlbumThumbLocation",params:[{name:"flags",type:"#"},{name:"small",type:"flags.2?true"},{name:"document",type:"flags.0?InputDocument"},{name:"title",type:"flags.1?string"},{name:"performer",type:"flags.1?string"}],type:"InputWebFileLocation"},{id:183518013,predicate:"bots.premiumGiftsOptions",params:[{name:"name",type:"string"},{name:"gifts",type:"Vector"}],type:"bots.PremiumGiftsOptions"},{id:769727150,predicate:"emojiStatusEmpty",params:[],type:"EmojiStatus"},{id:-1835310691,predicate:"emojiStatus",params:[{name:"document_id",type:"long"}],type:"EmojiStatus"},{id:-97474361,predicate:"emojiStatusUntil",params:[{name:"document_id",type:"long"},{name:"until",type:"int"}],type:"EmojiStatus"},{id:674706841,predicate:"updateUserEmojiStatus",params:[{name:"user_id",type:"long"},{name:"emoji_status",type:"EmojiStatus"}],type:"Update"},{id:821314523,predicate:"updateRecentEmojiStatuses",params:[],type:"Update"},{id:-796072379,predicate:"account.emojiStatusesNotModified",params:[],type:"account.EmojiStatuses"},{id:-1866176559,predicate:"account.emojiStatuses",params:[{name:"hash",type:"long"},{name:"statuses",type:"Vector"}],type:"account.EmojiStatuses"},{id:2046153753,predicate:"reactionEmpty",params:[],type:"Reaction"},{id:455247544,predicate:"reactionEmoji",params:[{name:"emoticon",type:"string"}],type:"Reaction"},{id:-1992950669,predicate:"reactionCustomEmoji",params:[{name:"document_id",type:"long"}],type:"Reaction"},{id:-352570692,predicate:"chatReactionsNone",params:[],type:"ChatReactions"},{id:1385335754,predicate:"chatReactionsAll",params:[{name:"flags",type:"#"},{name:"allow_custom",type:"flags.0?true"}],type:"ChatReactions"},{id:1713193015,predicate:"chatReactionsSome",params:[{name:"reactions",type:"Vector"}],type:"ChatReactions"},{id:-1334846497,predicate:"messages.reactionsNotModified",params:[],type:"messages.Reactions"},{id:-352454890,predicate:"messages.reactions",params:[{name:"hash",type:"long"},{name:"reactions",type:"Vector"}],type:"messages.Reactions"},{id:1870160884,predicate:"updateRecentReactions",params:[],type:"Update"},{id:-2030252155,predicate:"updateMoveStickerSetToTop",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"emojis",type:"flags.1?true"},{name:"stickerset",type:"long"}],type:"Update"},{id:1511364673,predicate:"auth.sentCodeTypeEmailCode",params:[{name:"flags",type:"#"},{name:"apple_signin_allowed",type:"flags.0?true"},{name:"google_signin_allowed",type:"flags.1?true"},{name:"email_pattern",type:"string"},{name:"length",type:"int"},{name:"next_phone_login_date",type:"flags.2?int"}],type:"auth.SentCodeType"},{id:-1521934870,predicate:"auth.sentCodeTypeSetUpEmailRequired",params:[{name:"flags",type:"#"},{name:"apple_signin_allowed",type:"flags.0?true"},{name:"google_signin_allowed",type:"flags.1?true"}],type:"auth.SentCodeType"},{id:1128644211,predicate:"emailVerifyPurposeLoginSetup",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"}],type:"EmailVerifyPurpose"},{id:1383932651,predicate:"emailVerifyPurposeLoginChange",params:[],type:"EmailVerifyPurpose"},{id:-1141565819,predicate:"emailVerifyPurposePassport",params:[],type:"EmailVerifyPurpose"},{id:-1842457175,predicate:"emailVerificationCode",params:[{name:"code",type:"string"}],type:"EmailVerification"},{id:-611279166,predicate:"emailVerificationGoogle",params:[{name:"token",type:"string"}],type:"EmailVerification"},{id:-1764723459,predicate:"emailVerificationApple",params:[{name:"token",type:"string"}],type:"EmailVerification"},{id:731303195,predicate:"account.emailVerified",params:[{name:"email",type:"string"}],type:"account.EmailVerified"},{id:-507835039,predicate:"account.emailVerifiedLogin",params:[{name:"email",type:"string"},{name:"sent_code",type:"auth.SentCode"}],type:"account.EmailVerified"},{id:1596792306,predicate:"premiumSubscriptionOption",params:[{name:"flags",type:"#"},{name:"current",type:"flags.1?true"},{name:"can_purchase_upgrade",type:"flags.2?true"},{name:"transaction",type:"flags.3?string"},{name:"months",type:"int"},{name:"currency",type:"string"},{name:"amount",type:"long"},{name:"bot_url",type:"string"},{name:"store_product",type:"flags.0?string"}],type:"PremiumSubscriptionOption"},{id:80008398,predicate:"inputStickerSetEmojiGenericAnimations",params:[],type:"InputStickerSet"},{id:701560302,predicate:"inputStickerSetEmojiDefaultStatuses",params:[],type:"InputStickerSet"},{id:-1206095820,predicate:"sendAsPeer",params:[{name:"flags",type:"#"},{name:"premium_required",type:"flags.0?true"},{name:"peer",type:"Peer"}],type:"SendAsPeer"},{id:-1386050360,predicate:"messageExtendedMediaPreview",params:[{name:"flags",type:"#"},{name:"w",type:"flags.0?int"},{name:"h",type:"flags.0?int"},{name:"thumb",type:"flags.1?PhotoSize"},{name:"video_duration",type:"flags.2?int"}],type:"MessageExtendedMedia"},{id:-297296796,predicate:"messageExtendedMedia",params:[{name:"media",type:"MessageMedia"}],type:"MessageExtendedMedia"},{id:1517529484,predicate:"updateMessageExtendedMedia",params:[{name:"peer",type:"Peer"},{name:"msg_id",type:"int"},{name:"extended_media",type:"MessageExtendedMedia"}],type:"Update"},{id:-50416996,predicate:"stickerKeyword",params:[{name:"document_id",type:"long"},{name:"keyword",type:"Vector"}],type:"StickerKeyword"},{id:-1274595769,predicate:"username",params:[{name:"flags",type:"#"},{name:"editable",type:"flags.0?true"},{name:"active",type:"flags.1?true"},{name:"username",type:"string"}],type:"Username"},{id:-263212119,predicate:"channelAdminLogEventActionChangeUsernames",params:[{name:"prev_value",type:"Vector"},{name:"new_value",type:"Vector"}],type:"ChannelAdminLogEventAction"},{id:46949251,predicate:"channelAdminLogEventActionToggleForum",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:1483767080,predicate:"channelAdminLogEventActionCreateTopic",params:[{name:"topic",type:"ForumTopic"}],type:"ChannelAdminLogEventAction"},{id:-261103096,predicate:"channelAdminLogEventActionEditTopic",params:[{name:"prev_topic",type:"ForumTopic"},{name:"new_topic",type:"ForumTopic"}],type:"ChannelAdminLogEventAction"},{id:-1374254839,predicate:"channelAdminLogEventActionDeleteTopic",params:[{name:"topic",type:"ForumTopic"}],type:"ChannelAdminLogEventAction"},{id:1569535291,predicate:"channelAdminLogEventActionPinTopic",params:[{name:"flags",type:"#"},{name:"prev_topic",type:"flags.0?ForumTopic"},{name:"new_topic",type:"flags.1?ForumTopic"}],type:"ChannelAdminLogEventAction"},{id:37687451,predicate:"forumTopicDeleted",params:[{name:"id",type:"int"}],type:"ForumTopic"},{id:1903173033,predicate:"forumTopic",params:[{name:"flags",type:"#"},{name:"my",type:"flags.1?true"},{name:"closed",type:"flags.2?true"},{name:"pinned",type:"flags.3?true"},{name:"short",type:"flags.5?true"},{name:"hidden",type:"flags.6?true"},{name:"id",type:"int"},{name:"date",type:"int"},{name:"title",type:"string"},{name:"icon_color",type:"int"},{name:"icon_emoji_id",type:"flags.0?long"},{name:"top_message",type:"int"},{name:"read_inbox_max_id",type:"int"},{name:"read_outbox_max_id",type:"int"},{name:"unread_count",type:"int"},{name:"unread_mentions_count",type:"int"},{name:"unread_reactions_count",type:"int"},{name:"from_id",type:"Peer"},{name:"notify_settings",type:"PeerNotifySettings"},{name:"draft",type:"flags.4?DraftMessage"}],type:"ForumTopic"},{id:913709011,predicate:"messages.forumTopics",params:[{name:"flags",type:"#"},{name:"order_by_create_date",type:"flags.0?true"},{name:"count",type:"int"},{name:"topics",type:"Vector"},{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"},{name:"pts",type:"int"}],type:"messages.ForumTopics"},{id:228168278,predicate:"messageActionTopicCreate",params:[{name:"flags",type:"#"},{name:"title",type:"string"},{name:"icon_color",type:"int"},{name:"icon_emoji_id",type:"flags.0?long"}],type:"MessageAction"},{id:-1064024032,predicate:"messageActionTopicEdit",params:[{name:"flags",type:"#"},{name:"title",type:"flags.0?string"},{name:"icon_emoji_id",type:"flags.1?long"},{name:"closed",type:"flags.2?Bool"},{name:"hidden",type:"flags.3?Bool"}],type:"MessageAction"},{id:422509539,predicate:"updateChannelPinnedTopic",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.0?true"},{name:"channel_id",type:"long"},{name:"topic_id",type:"int"}],type:"Update"},{id:1548122514,predicate:"inputNotifyForumTopic",params:[{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"int"}],type:"InputNotifyPeer"},{id:577659656,predicate:"notifyForumTopic",params:[{name:"peer",type:"Peer"},{name:"top_msg_id",type:"int"}],type:"NotifyPeer"},{id:1153562857,predicate:"inputStickerSetEmojiDefaultTopicIcons",params:[],type:"InputStickerSet"},{id:406407439,predicate:"messages.sponsoredMessagesEmpty",params:[],type:"messages.SponsoredMessages"},{id:-31881726,predicate:"updateChannelPinnedTopics",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"order",type:"flags.0?Vector"}],type:"Update"},{id:1135897376,predicate:"defaultHistoryTTL",params:[{name:"period",type:"int"}],type:"DefaultHistoryTTL"},{id:116234636,predicate:"auth.codeTypeFragmentSms",params:[],type:"auth.CodeType"},{id:-648651719,predicate:"auth.sentCodeTypeFragmentSms",params:[{name:"url",type:"string"},{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:1103040667,predicate:"exportedContactToken",params:[{name:"url",type:"string"},{name:"expires",type:"int"}],type:"ExportedContactToken"},{id:1693675004,predicate:"channelAdminLogEventActionToggleAntiSpam",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:1474192222,predicate:"messageActionSuggestProfilePhoto",params:[{name:"photo",type:"Photo"}],type:"MessageAction"},{id:-404267113,predicate:"messageActionAttachMenuBotAllowed",params:[],type:"MessageAction"},{id:2008112412,predicate:"stickerSetNoCovered",params:[{name:"set",type:"StickerSet"}],type:"StickerSetCovered"},{id:542282808,predicate:"updateUser",params:[{name:"user_id",type:"long"}],type:"Update"},{id:596704836,predicate:"auth.sentCodeSuccess",params:[{name:"authorization",type:"auth.Authorization"}],type:"auth.SentCode"},{id:-25742243,predicate:"messageActionRequestedPeer",params:[{name:"button_id",type:"int"},{name:"peer",type:"Peer"}],type:"MessageAction"},{id:1597737472,predicate:"requestPeerTypeUser",params:[{name:"flags",type:"#"},{name:"bot",type:"flags.0?Bool"},{name:"premium",type:"flags.1?Bool"}],type:"RequestPeerType"},{id:-906990053,predicate:"requestPeerTypeChat",params:[{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"bot_participant",type:"flags.5?true"},{name:"has_username",type:"flags.3?Bool"},{name:"forum",type:"flags.4?Bool"},{name:"user_admin_rights",type:"flags.1?ChatAdminRights"},{name:"bot_admin_rights",type:"flags.2?ChatAdminRights"}],type:"RequestPeerType"},{id:865857388,predicate:"requestPeerTypeBroadcast",params:[{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"has_username",type:"flags.3?Bool"},{name:"user_admin_rights",type:"flags.1?ChatAdminRights"},{name:"bot_admin_rights",type:"flags.2?ChatAdminRights"}],type:"RequestPeerType"},{id:218842764,predicate:"keyboardButtonRequestPeer",params:[{name:"text",type:"string"},{name:"button_id",type:"int"},{name:"peer_type",type:"RequestPeerType"}],type:"KeyboardButton"},{id:1209970170,predicate:"emojiListNotModified",params:[],type:"EmojiList"},{id:2048790993,predicate:"emojiList",params:[{name:"hash",type:"long"},{name:"document_id",type:"Vector"}],type:"EmojiList"},{id:-444918734,predicate:"auth.sentCodeTypeFirebaseSms",params:[{name:"flags",type:"#"},{name:"nonce",type:"flags.0?bytes"},{name:"receipt",type:"flags.1?string"},{name:"push_timeout",type:"flags.1?int"},{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:2056961449,predicate:"emojiGroup",params:[{name:"title",type:"string"},{name:"icon_emoji_id",type:"long"},{name:"emoticons",type:"Vector"}],type:"EmojiGroup"},{id:1874111879,predicate:"messages.emojiGroupsNotModified",params:[],type:"messages.EmojiGroups"},{id:-2011186869,predicate:"messages.emojiGroups",params:[{name:"hash",type:"int"},{name:"groups",type:"Vector"}],type:"messages.EmojiGroups"},{id:-128171716,predicate:"videoSizeEmojiMarkup",params:[{name:"emoji_id",type:"long"},{name:"background_colors",type:"Vector"}],type:"VideoSize"},{id:228623102,predicate:"videoSizeStickerMarkup",params:[{name:"stickerset",type:"InputStickerSet"},{name:"sticker_id",type:"long"},{name:"background_colors",type:"Vector"}],type:"VideoSize"},{id:1964978502,predicate:"textWithEntities",params:[{name:"text",type:"string"},{name:"entities",type:"Vector"}],type:"TextWithEntities"},{id:870003448,predicate:"messages.translateResult",params:[{name:"result",type:"Vector"}],type:"messages.TranslatedText"},{id:-934791986,predicate:"autoSaveSettings",params:[{name:"flags",type:"#"},{name:"photos",type:"flags.0?true"},{name:"videos",type:"flags.1?true"},{name:"video_max_size",type:"flags.2?long"}],type:"AutoSaveSettings"},{id:-2124403385,predicate:"autoSaveException",params:[{name:"peer",type:"Peer"},{name:"settings",type:"AutoSaveSettings"}],type:"AutoSaveException"},{id:1279133341,predicate:"account.autoSaveSettings",params:[{name:"users_settings",type:"AutoSaveSettings"},{name:"chats_settings",type:"AutoSaveSettings"},{name:"broadcasts_settings",type:"AutoSaveSettings"},{name:"exceptions",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"account.AutoSaveSettings"},{id:-335171433,predicate:"updateAutoSaveSettings",params:[],type:"Update"}],methods:[{id:-878758099,method:"invokeAfterMsg",params:[{name:"msg_id",type:"long"},{name:"query",type:"!X"}],type:"X"},{id:1036301552,method:"invokeAfterMsgs",params:[{name:"msg_ids",type:"Vector"},{name:"query",type:"!X"}],type:"X"},{id:-1502141361,method:"auth.sendCode",params:[{name:"phone_number",type:"string"},{name:"api_id",type:"int"},{name:"api_hash",type:"string"},{name:"settings",type:"CodeSettings"}],type:"auth.SentCode"},{id:-2131827673,method:"auth.signUp",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"}],type:"auth.Authorization"},{id:-1923962543,method:"auth.signIn",params:[{name:"flags",type:"#"},{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"},{name:"phone_code",type:"flags.0?string"},{name:"email_verification",type:"flags.1?EmailVerification"}],type:"auth.Authorization"},{id:1047706137,method:"auth.logOut",params:[],type:"auth.LoggedOut"},{id:-1616179942,method:"auth.resetAuthorizations",params:[],type:"Bool"},{id:-440401971,method:"auth.exportAuthorization",params:[{name:"dc_id",type:"int"}],type:"auth.ExportedAuthorization"},{id:-1518699091,method:"auth.importAuthorization",params:[{name:"id",type:"long"},{name:"bytes",type:"bytes"}],type:"auth.Authorization"},{id:-841733627,method:"auth.bindTempAuthKey",params:[{name:"perm_auth_key_id",type:"long"},{name:"nonce",type:"long"},{name:"expires_at",type:"int"},{name:"encrypted_message",type:"bytes"}],type:"Bool"},{id:-326762118,method:"account.registerDevice",params:[{name:"flags",type:"#"},{name:"no_muted",type:"flags.0?true"},{name:"token_type",type:"int"},{name:"token",type:"string"},{name:"app_sandbox",type:"Bool"},{name:"secret",type:"bytes"},{name:"other_uids",type:"Vector"}],type:"Bool"},{id:1779249670,method:"account.unregisterDevice",params:[{name:"token_type",type:"int"},{name:"token",type:"string"},{name:"other_uids",type:"Vector"}],type:"Bool"},{id:-2067899501,method:"account.updateNotifySettings",params:[{name:"peer",type:"InputNotifyPeer"},{name:"settings",type:"InputPeerNotifySettings"}],type:"Bool"},{id:313765169,method:"account.getNotifySettings",params:[{name:"peer",type:"InputNotifyPeer"}],type:"PeerNotifySettings"},{id:-612493497,method:"account.resetNotifySettings",params:[],type:"Bool"},{id:2018596725,method:"account.updateProfile",params:[{name:"flags",type:"#"},{name:"first_name",type:"flags.0?string"},{name:"last_name",type:"flags.1?string"},{name:"about",type:"flags.2?string"}],type:"User"},{id:1713919532,method:"account.updateStatus",params:[{name:"offline",type:"Bool"}],type:"Bool"},{id:127302966,method:"account.getWallPapers",params:[{name:"hash",type:"long"}],type:"account.WallPapers"},{id:-977650298,method:"account.reportPeer",params:[{name:"peer",type:"InputPeer"},{name:"reason",type:"ReportReason"},{name:"message",type:"string"}],type:"Bool"},{id:227648840,method:"users.getUsers",params:[{name:"id",type:"Vector"}],type:"Vector"},{id:-1240508136,method:"users.getFullUser",params:[{name:"id",type:"InputUser"}],type:"users.UserFull"},{id:2061264541,method:"contacts.getContactIDs",params:[{name:"hash",type:"long"}],type:"Vector"},{id:-995929106,method:"contacts.getStatuses",params:[],type:"Vector"},{id:1574346258,method:"contacts.getContacts",params:[{name:"hash",type:"long"}],type:"contacts.Contacts"},{id:746589157,method:"contacts.importContacts",params:[{name:"contacts",type:"Vector"}],type:"contacts.ImportedContacts"},{id:157945344,method:"contacts.deleteContacts",params:[{name:"id",type:"Vector"}],type:"Updates"},{id:269745566,method:"contacts.deleteByPhones",params:[{name:"phones",type:"Vector"}],type:"Bool"},{id:1758204945,method:"contacts.block",params:[{name:"id",type:"InputPeer"}],type:"Bool"},{id:-1096393392,method:"contacts.unblock",params:[{name:"id",type:"InputPeer"}],type:"Bool"},{id:-176409329,method:"contacts.getBlocked",params:[{name:"offset",type:"int"},{name:"limit",type:"int"}],type:"contacts.Blocked"},{id:1673946374,method:"messages.getMessages",params:[{name:"id",type:"Vector"}],type:"messages.Messages"},{id:-1594569905,method:"messages.getDialogs",params:[{name:"flags",type:"#"},{name:"exclude_pinned",type:"flags.0?true"},{name:"folder_id",type:"flags.1?int"},{name:"offset_date",type:"int"},{name:"offset_id",type:"int"},{name:"offset_peer",type:"InputPeer"},{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"messages.Dialogs"},{id:1143203525,method:"messages.getHistory",params:[{name:"peer",type:"InputPeer"},{name:"offset_id",type:"int"},{name:"offset_date",type:"int"},{name:"add_offset",type:"int"},{name:"limit",type:"int"},{name:"max_id",type:"int"},{name:"min_id",type:"int"},{name:"hash",type:"long"}],type:"messages.Messages"},{id:-1593989278,method:"messages.search",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"q",type:"string"},{name:"from_id",type:"flags.0?InputPeer"},{name:"top_msg_id",type:"flags.1?int"},{name:"filter",type:"MessagesFilter"},{name:"min_date",type:"int"},{name:"max_date",type:"int"},{name:"offset_id",type:"int"},{name:"add_offset",type:"int"},{name:"limit",type:"int"},{name:"max_id",type:"int"},{name:"min_id",type:"int"},{name:"hash",type:"long"}],type:"messages.Messages"},{id:238054714,method:"messages.readHistory",params:[{name:"peer",type:"InputPeer"},{name:"max_id",type:"int"}],type:"messages.AffectedMessages"},{id:-1332768214,method:"messages.deleteHistory",params:[{name:"flags",type:"#"},{name:"just_clear",type:"flags.0?true"},{name:"revoke",type:"flags.1?true"},{name:"peer",type:"InputPeer"},{name:"max_id",type:"int"},{name:"min_date",type:"flags.2?int"},{name:"max_date",type:"flags.3?int"}],type:"messages.AffectedHistory"},{id:-443640366,method:"messages.deleteMessages",params:[{name:"flags",type:"#"},{name:"revoke",type:"flags.0?true"},{name:"id",type:"Vector"}],type:"messages.AffectedMessages"},{id:94983360,method:"messages.receivedMessages",params:[{name:"max_id",type:"int"}],type:"Vector"},{id:1486110434,method:"messages.setTyping",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"},{name:"action",type:"SendMessageAction"}],type:"Bool"},{id:482476935,method:"messages.sendMessage",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.1?true"},{name:"silent",type:"flags.5?true"},{name:"background",type:"flags.6?true"},{name:"clear_draft",type:"flags.7?true"},{name:"noforwards",type:"flags.14?true"},{name:"update_stickersets_order",type:"flags.15?true"},{name:"peer",type:"InputPeer"},{name:"reply_to_msg_id",type:"flags.0?int"},{name:"top_msg_id",type:"flags.9?int"},{name:"message",type:"string"},{name:"random_id",type:"long"},{name:"reply_markup",type:"flags.2?ReplyMarkup"},{name:"entities",type:"flags.3?Vector"},{name:"schedule_date",type:"flags.10?int"},{name:"send_as",type:"flags.13?InputPeer"}],type:"Updates"},{id:1967638886,method:"messages.sendMedia",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.5?true"},{name:"background",type:"flags.6?true"},{name:"clear_draft",type:"flags.7?true"},{name:"noforwards",type:"flags.14?true"},{name:"update_stickersets_order",type:"flags.15?true"},{name:"peer",type:"InputPeer"},{name:"reply_to_msg_id",type:"flags.0?int"},{name:"top_msg_id",type:"flags.9?int"},{name:"media",type:"InputMedia"},{name:"message",type:"string"},{name:"random_id",type:"long"},{name:"reply_markup",type:"flags.2?ReplyMarkup"},{name:"entities",type:"flags.3?Vector"},{name:"schedule_date",type:"flags.10?int"},{name:"send_as",type:"flags.13?InputPeer"}],type:"Updates"},{id:-966673468,method:"messages.forwardMessages",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.5?true"},{name:"background",type:"flags.6?true"},{name:"with_my_score",type:"flags.8?true"},{name:"drop_author",type:"flags.11?true"},{name:"drop_media_captions",type:"flags.12?true"},{name:"noforwards",type:"flags.14?true"},{name:"from_peer",type:"InputPeer"},{name:"id",type:"Vector"},{name:"random_id",type:"Vector"},{name:"to_peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.9?int"},{name:"schedule_date",type:"flags.10?int"},{name:"send_as",type:"flags.13?InputPeer"}],type:"Updates"},{id:-820669733,method:"messages.reportSpam",params:[{name:"peer",type:"InputPeer"}],type:"Bool"},{id:-270948702,method:"messages.getPeerSettings",params:[{name:"peer",type:"InputPeer"}],type:"messages.PeerSettings"},{id:-1991005362,method:"messages.report",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector"},{name:"reason",type:"ReportReason"},{name:"message",type:"string"}],type:"Bool"},{id:1240027791,method:"messages.getChats",params:[{name:"id",type:"Vector"}],type:"messages.Chats"},{id:-1364194508,method:"messages.getFullChat",params:[{name:"chat_id",type:"long"}],type:"messages.ChatFull"},{id:1937260541,method:"messages.editChatTitle",params:[{name:"chat_id",type:"long"},{name:"title",type:"string"}],type:"Updates"},{id:903730804,method:"messages.editChatPhoto",params:[{name:"chat_id",type:"long"},{name:"photo",type:"InputChatPhoto"}],type:"Updates"},{id:-230206493,method:"messages.addChatUser",params:[{name:"chat_id",type:"long"},{name:"user_id",type:"InputUser"},{name:"fwd_limit",type:"int"}],type:"Updates"},{id:-1575461717,method:"messages.deleteChatUser",params:[{name:"flags",type:"#"},{name:"revoke_history",type:"flags.0?true"},{name:"chat_id",type:"long"},{name:"user_id",type:"InputUser"}],type:"Updates"},{id:3450904,method:"messages.createChat",params:[{name:"flags",type:"#"},{name:"users",type:"Vector"},{name:"title",type:"string"},{name:"ttl_period",type:"flags.0?int"}],type:"Updates"},{id:-304838614,method:"updates.getState",params:[],type:"updates.State"},{id:630429265,method:"updates.getDifference",params:[{name:"flags",type:"#"},{name:"pts",type:"int"},{name:"pts_total_limit",type:"flags.0?int"},{name:"date",type:"int"},{name:"qts",type:"int"}],type:"updates.Difference"},{id:473782614,method:"photos.updateProfilePhoto",params:[{name:"flags",type:"#"},{name:"fallback",type:"flags.0?true"},{name:"id",type:"InputPhoto"}],type:"photos.Photo"},{id:154966609,method:"photos.uploadProfilePhoto",params:[{name:"flags",type:"#"},{name:"fallback",type:"flags.3?true"},{name:"file",type:"flags.0?InputFile"},{name:"video",type:"flags.1?InputFile"},{name:"video_start_ts",type:"flags.2?double"},{name:"video_emoji_markup",type:"flags.4?VideoSize"}],type:"photos.Photo"},{id:-2016444625,method:"photos.deletePhotos",params:[{name:"id",type:"Vector"}],type:"Vector"},{id:-1291540959,method:"upload.saveFilePart",params:[{name:"file_id",type:"long"},{name:"file_part",type:"int"},{name:"bytes",type:"bytes"}],type:"Bool"},{id:-1101843010,method:"upload.getFile",params:[{name:"flags",type:"#"},{name:"precise",type:"flags.0?true"},{name:"cdn_supported",type:"flags.1?true"},{name:"location",type:"InputFileLocation"},{name:"offset",type:"long"},{name:"limit",type:"int"}],type:"upload.File"},{id:-990308245,method:"help.getConfig",params:[],type:"Config"},{id:531836966,method:"help.getNearestDc",params:[],type:"NearestDc"},{id:1378703997,method:"help.getAppUpdate",params:[{name:"source",type:"string"}],type:"help.AppUpdate"},{id:1295590211,method:"help.getInviteText",params:[],type:"help.InviteText"},{id:-1848823128,method:"photos.getUserPhotos",params:[{name:"user_id",type:"InputUser"},{name:"offset",type:"int"},{name:"max_id",type:"long"},{name:"limit",type:"int"}],type:"photos.Photos"},{id:651135312,method:"messages.getDhConfig",params:[{name:"version",type:"int"},{name:"random_length",type:"int"}],type:"messages.DhConfig"},{id:-162681021,method:"messages.requestEncryption",params:[{name:"user_id",type:"InputUser"},{name:"random_id",type:"int"},{name:"g_a",type:"bytes"}],type:"EncryptedChat"},{id:1035731989,method:"messages.acceptEncryption",params:[{name:"peer",type:"InputEncryptedChat"},{name:"g_b",type:"bytes"},{name:"key_fingerprint",type:"long"}],type:"EncryptedChat"},{id:-208425312,method:"messages.discardEncryption",params:[{name:"flags",type:"#"},{name:"delete_history",type:"flags.0?true"},{name:"chat_id",type:"int"}],type:"Bool"},{id:2031374829,method:"messages.setEncryptedTyping",params:[{name:"peer",type:"InputEncryptedChat"},{name:"typing",type:"Bool"}],type:"Bool"},{id:2135648522,method:"messages.readEncryptedHistory",params:[{name:"peer",type:"InputEncryptedChat"},{name:"max_date",type:"int"}],type:"Bool"},{id:1157265941,method:"messages.sendEncrypted",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.0?true"},{name:"peer",type:"InputEncryptedChat"},{name:"random_id",type:"long"},{name:"data",type:"bytes"}],type:"messages.SentEncryptedMessage"},{id:1431914525,method:"messages.sendEncryptedFile",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.0?true"},{name:"peer",type:"InputEncryptedChat"},{name:"random_id",type:"long"},{name:"data",type:"bytes"},{name:"file",type:"InputEncryptedFile"}],type:"messages.SentEncryptedMessage"},{id:852769188,method:"messages.sendEncryptedService",params:[{name:"peer",type:"InputEncryptedChat"},{name:"random_id",type:"long"},{name:"data",type:"bytes"}],type:"messages.SentEncryptedMessage"},{id:1436924774,method:"messages.receivedQueue",params:[{name:"max_qts",type:"int"}],type:"Vector"},{id:1259113487,method:"messages.reportEncryptedSpam",params:[{name:"peer",type:"InputEncryptedChat"}],type:"Bool"},{id:-562337987,method:"upload.saveBigFilePart",params:[{name:"file_id",type:"long"},{name:"file_part",type:"int"},{name:"file_total_parts",type:"int"},{name:"bytes",type:"bytes"}],type:"Bool"},{id:-1043505495,method:"initConnection",params:[{name:"flags",type:"#"},{name:"api_id",type:"int"},{name:"device_model",type:"string"},{name:"system_version",type:"string"},{name:"app_version",type:"string"},{name:"system_lang_code",type:"string"},{name:"lang_pack",type:"string"},{name:"lang_code",type:"string"},{name:"proxy",type:"flags.0?InputClientProxy"},{name:"params",type:"flags.1?JSONValue"},{name:"query",type:"!X"}],type:"X"},{id:-1663104819,method:"help.getSupport",params:[],type:"help.Support"},{id:916930423,method:"messages.readMessageContents",params:[{name:"id",type:"Vector"}],type:"messages.AffectedMessages"},{id:655677548,method:"account.checkUsername",params:[{name:"username",type:"string"}],type:"Bool"},{id:1040964988,method:"account.updateUsername",params:[{name:"username",type:"string"}],type:"User"},{id:301470424,method:"contacts.search",params:[{name:"q",type:"string"},{name:"limit",type:"int"}],type:"contacts.Found"},{id:-623130288,method:"account.getPrivacy",params:[{name:"key",type:"InputPrivacyKey"}],type:"account.PrivacyRules"},{id:-906486552,method:"account.setPrivacy",params:[{name:"key",type:"InputPrivacyKey"},{name:"rules",type:"Vector"}],type:"account.PrivacyRules"},{id:-1564422284,method:"account.deleteAccount",params:[{name:"flags",type:"#"},{name:"reason",type:"string"},{name:"password",type:"flags.0?InputCheckPasswordSRP"}],type:"Bool"},{id:150761757,method:"account.getAccountTTL",params:[],type:"AccountDaysTTL"},{id:608323678,method:"account.setAccountTTL",params:[{name:"ttl",type:"AccountDaysTTL"}],type:"Bool"},{id:-627372787,method:"invokeWithLayer",params:[{name:"layer",type:"int"},{name:"query",type:"!X"}],type:"X"},{id:-113456221,method:"contacts.resolveUsername",params:[{name:"username",type:"string"}],type:"contacts.ResolvedPeer"},{id:-2108208411,method:"account.sendChangePhoneCode",params:[{name:"phone_number",type:"string"},{name:"settings",type:"CodeSettings"}],type:"auth.SentCode"},{id:1891839707,method:"account.changePhone",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"},{name:"phone_code",type:"string"}],type:"User"},{id:-710552671,method:"messages.getStickers",params:[{name:"emoticon",type:"string"},{name:"hash",type:"long"}],type:"messages.Stickers"},{id:-1197432408,method:"messages.getAllStickers",params:[{name:"hash",type:"long"}],type:"messages.AllStickers"},{id:954152242,method:"account.updateDeviceLocked",params:[{name:"period",type:"int"}],type:"Bool"},{id:1738800940,method:"auth.importBotAuthorization",params:[{name:"flags",type:"int"},{name:"api_id",type:"int"},{name:"api_hash",type:"string"},{name:"bot_auth_token",type:"string"}],type:"auth.Authorization"},{id:-1956073268,method:"messages.getWebPagePreview",params:[{name:"flags",type:"#"},{name:"message",type:"string"},{name:"entities",type:"flags.3?Vector"}],type:"MessageMedia"},{id:-484392616,method:"account.getAuthorizations",params:[],type:"account.Authorizations"},{id:-545786948,method:"account.resetAuthorization",params:[{name:"hash",type:"long"}],type:"Bool"},{id:1418342645,method:"account.getPassword",params:[],type:"account.Password"},{id:-1663767815,method:"account.getPasswordSettings",params:[{name:"password",type:"InputCheckPasswordSRP"}],type:"account.PasswordSettings"},{id:-1516564433,method:"account.updatePasswordSettings",params:[{name:"password",type:"InputCheckPasswordSRP"},{name:"new_settings",type:"account.PasswordInputSettings"}],type:"Bool"},{id:-779399914,method:"auth.checkPassword",params:[{name:"password",type:"InputCheckPasswordSRP"}],type:"auth.Authorization"},{id:-661144474,method:"auth.requestPasswordRecovery",params:[],type:"auth.PasswordRecovery"},{id:923364464,method:"auth.recoverPassword",params:[{name:"flags",type:"#"},{name:"code",type:"string"},{name:"new_settings",type:"flags.0?account.PasswordInputSettings"}],type:"auth.Authorization"},{id:-1080796745,method:"invokeWithoutUpdates",params:[{name:"query",type:"!X"}],type:"X"},{id:-1607670315,method:"messages.exportChatInvite",params:[{name:"flags",type:"#"},{name:"legacy_revoke_permanent",type:"flags.2?true"},{name:"request_needed",type:"flags.3?true"},{name:"peer",type:"InputPeer"},{name:"expire_date",type:"flags.0?int"},{name:"usage_limit",type:"flags.1?int"},{name:"title",type:"flags.4?string"}],type:"ExportedChatInvite"},{id:1051570619,method:"messages.checkChatInvite",params:[{name:"hash",type:"string"}],type:"ChatInvite"},{id:1817183516,method:"messages.importChatInvite",params:[{name:"hash",type:"string"}],type:"Updates"},{id:-928977804,method:"messages.getStickerSet",params:[{name:"stickerset",type:"InputStickerSet"},{name:"hash",type:"int"}],type:"messages.StickerSet"},{id:-946871200,method:"messages.installStickerSet",params:[{name:"stickerset",type:"InputStickerSet"},{name:"archived",type:"Bool"}],type:"messages.StickerSetInstallResult"},{id:-110209570,method:"messages.uninstallStickerSet",params:[{name:"stickerset",type:"InputStickerSet"}],type:"Bool"},{id:-421563528,method:"messages.startBot",params:[{name:"bot",type:"InputUser"},{name:"peer",type:"InputPeer"},{name:"random_id",type:"long"},{name:"start_param",type:"string"}],type:"Updates"},{id:-1877938321,method:"help.getAppChangelog",params:[{name:"prev_app_version",type:"string"}],type:"Updates"},{id:1468322785,method:"messages.getMessagesViews",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector"},{name:"increment",type:"Bool"}],type:"messages.MessageViews"},{id:-871347913,method:"channels.readHistory",params:[{name:"channel",type:"InputChannel"},{name:"max_id",type:"int"}],type:"Bool"},{id:-2067661490,method:"channels.deleteMessages",params:[{name:"channel",type:"InputChannel"},{name:"id",type:"Vector"}],type:"messages.AffectedMessages"},{id:-196443371,method:"channels.reportSpam",params:[{name:"channel",type:"InputChannel"},{name:"participant",type:"InputPeer"},{name:"id",type:"Vector"}],type:"Bool"},{id:-1383294429,method:"channels.getMessages",params:[{name:"channel",type:"InputChannel"},{name:"id",type:"Vector"}],type:"messages.Messages"},{id:2010044880,method:"channels.getParticipants",params:[{name:"channel",type:"InputChannel"},{name:"filter",type:"ChannelParticipantsFilter"},{name:"offset",type:"int"},{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"channels.ChannelParticipants"},{id:-1599378234,method:"channels.getParticipant",params:[{name:"channel",type:"InputChannel"},{name:"participant",type:"InputPeer"}],type:"channels.ChannelParticipant"},{id:176122811,method:"channels.getChannels",params:[{name:"id",type:"Vector"}],type:"messages.Chats"},{id:141781513,method:"channels.getFullChannel",params:[{name:"channel",type:"InputChannel"}],type:"messages.ChatFull"},{id:-1862244601,method:"channels.createChannel",params:[{name:"flags",type:"#"},{name:"broadcast",type:"flags.0?true"},{name:"megagroup",type:"flags.1?true"},{name:"for_import",type:"flags.3?true"},{name:"forum",type:"flags.5?true"},{name:"title",type:"string"},{name:"about",type:"string"},{name:"geo_point",type:"flags.2?InputGeoPoint"},{name:"address",type:"flags.2?string"},{name:"ttl_period",type:"flags.4?int"}],type:"Updates"},{id:-751007486,method:"channels.editAdmin",params:[{name:"channel",type:"InputChannel"},{name:"user_id",type:"InputUser"},{name:"admin_rights",type:"ChatAdminRights"},{name:"rank",type:"string"}],type:"Updates"},{id:1450044624,method:"channels.editTitle",params:[{name:"channel",type:"InputChannel"},{name:"title",type:"string"}],type:"Updates"},{id:-248621111,method:"channels.editPhoto",params:[{name:"channel",type:"InputChannel"},{name:"photo",type:"InputChatPhoto"}],type:"Updates"},{id:283557164,method:"channels.checkUsername",params:[{name:"channel",type:"InputChannel"},{name:"username",type:"string"}],type:"Bool"},{id:890549214,method:"channels.updateUsername",params:[{name:"channel",type:"InputChannel"},{name:"username",type:"string"}],type:"Bool"},{id:615851205,method:"channels.joinChannel",params:[{name:"channel",type:"InputChannel"}],type:"Updates"},{id:-130635115,method:"channels.leaveChannel",params:[{name:"channel",type:"InputChannel"}],type:"Updates"},{id:429865580,method:"channels.inviteToChannel",params:[{name:"channel",type:"InputChannel"},{name:"users",type:"Vector"}],type:"Updates"},{id:-1072619549,method:"channels.deleteChannel",params:[{name:"channel",type:"InputChannel"}],type:"Updates"},{id:51854712,method:"updates.getChannelDifference",params:[{name:"flags",type:"#"},{name:"force",type:"flags.0?true"},{name:"channel",type:"InputChannel"},{name:"filter",type:"ChannelMessagesFilter"},{name:"pts",type:"int"},{name:"limit",type:"int"}],type:"updates.ChannelDifference"},{id:-1470377534,method:"messages.editChatAdmin",params:[{name:"chat_id",type:"long"},{name:"user_id",type:"InputUser"},{name:"is_admin",type:"Bool"}],type:"Bool"},{id:-1568189671,method:"messages.migrateChat",params:[{name:"chat_id",type:"long"}],type:"Updates"},{id:1271290010,method:"messages.searchGlobal",params:[{name:"flags",type:"#"},{name:"folder_id",type:"flags.0?int"},{name:"q",type:"string"},{name:"filter",type:"MessagesFilter"},{name:"min_date",type:"int"},{name:"max_date",type:"int"},{name:"offset_rate",type:"int"},{name:"offset_peer",type:"InputPeer"},{name:"offset_id",type:"int"},{name:"limit",type:"int"}],type:"messages.Messages"},{id:2016638777,method:"messages.reorderStickerSets",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"emojis",type:"flags.1?true"},{name:"order",type:"Vector"}],type:"Bool"},{id:-1309538785,method:"messages.getDocumentByHash",params:[{name:"sha256",type:"bytes"},{name:"size",type:"long"},{name:"mime_type",type:"string"}],type:"Document"},{id:1559270965,method:"messages.getSavedGifs",params:[{name:"hash",type:"long"}],type:"messages.SavedGifs"},{id:846868683,method:"messages.saveGif",params:[{name:"id",type:"InputDocument"},{name:"unsave",type:"Bool"}],type:"Bool"},{id:1364105629,method:"messages.getInlineBotResults",params:[{name:"flags",type:"#"},{name:"bot",type:"InputUser"},{name:"peer",type:"InputPeer"},{name:"geo_point",type:"flags.0?InputGeoPoint"},{name:"query",type:"string"},{name:"offset",type:"string"}],type:"messages.BotResults"},{id:-346119674,method:"messages.setInlineBotResults",params:[{name:"flags",type:"#"},{name:"gallery",type:"flags.0?true"},{name:"private",type:"flags.1?true"},{name:"query_id",type:"long"},{name:"results",type:"Vector"},{name:"cache_time",type:"int"},{name:"next_offset",type:"flags.2?string"},{name:"switch_pm",type:"flags.3?InlineBotSwitchPM"}],type:"Bool"},{id:-738468661,method:"messages.sendInlineBotResult",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.5?true"},{name:"background",type:"flags.6?true"},{name:"clear_draft",type:"flags.7?true"},{name:"hide_via",type:"flags.11?true"},{name:"peer",type:"InputPeer"},{name:"reply_to_msg_id",type:"flags.0?int"},{name:"top_msg_id",type:"flags.9?int"},{name:"random_id",type:"long"},{name:"query_id",type:"long"},{name:"id",type:"string"},{name:"schedule_date",type:"flags.10?int"},{name:"send_as",type:"flags.13?InputPeer"}],type:"Updates"},{id:-432034325,method:"channels.exportMessageLink",params:[{name:"flags",type:"#"},{name:"grouped",type:"flags.0?true"},{name:"thread",type:"flags.1?true"},{name:"channel",type:"InputChannel"},{name:"id",type:"int"}],type:"ExportedMessageLink"},{id:527021574,method:"channels.toggleSignatures",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:1056025023,method:"auth.resendCode",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"}],type:"auth.SentCode"},{id:520357240,method:"auth.cancelCode",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"}],type:"Bool"},{id:-39416522,method:"messages.getMessageEditData",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"int"}],type:"messages.MessageEditData"},{id:1224152952,method:"messages.editMessage",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.1?true"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"message",type:"flags.11?string"},{name:"media",type:"flags.14?InputMedia"},{name:"reply_markup",type:"flags.2?ReplyMarkup"},{name:"entities",type:"flags.3?Vector"},{name:"schedule_date",type:"flags.15?int"}],type:"Updates"},{id:-2091549254,method:"messages.editInlineBotMessage",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.1?true"},{name:"id",type:"InputBotInlineMessageID"},{name:"message",type:"flags.11?string"},{name:"media",type:"flags.14?InputMedia"},{name:"reply_markup",type:"flags.2?ReplyMarkup"},{name:"entities",type:"flags.3?Vector"}],type:"Bool"},{id:-1824339449,method:"messages.getBotCallbackAnswer",params:[{name:"flags",type:"#"},{name:"game",type:"flags.1?true"},{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"data",type:"flags.0?bytes"},{name:"password",type:"flags.2?InputCheckPasswordSRP"}],type:"messages.BotCallbackAnswer"},{id:-712043766,method:"messages.setBotCallbackAnswer",params:[{name:"flags",type:"#"},{name:"alert",type:"flags.1?true"},{name:"query_id",type:"long"},{name:"message",type:"flags.0?string"},{name:"url",type:"flags.2?string"},{name:"cache_time",type:"int"}],type:"Bool"},{id:-1758168906,method:"contacts.getTopPeers",params:[{name:"flags",type:"#"},{name:"correspondents",type:"flags.0?true"},{name:"bots_pm",type:"flags.1?true"},{name:"bots_inline",type:"flags.2?true"},{name:"phone_calls",type:"flags.3?true"},{name:"forward_users",type:"flags.4?true"},{name:"forward_chats",type:"flags.5?true"},{name:"groups",type:"flags.10?true"},{name:"channels",type:"flags.15?true"},{name:"offset",type:"int"},{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"contacts.TopPeers"},{id:451113900,method:"contacts.resetTopPeerRating",params:[{name:"category",type:"TopPeerCategory"},{name:"peer",type:"InputPeer"}],type:"Bool"},{id:-462373635,method:"messages.getPeerDialogs",params:[{name:"peers",type:"Vector"}],type:"messages.PeerDialogs"},{id:-1271718337,method:"messages.saveDraft",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.1?true"},{name:"reply_to_msg_id",type:"flags.0?int"},{name:"top_msg_id",type:"flags.2?int"},{name:"peer",type:"InputPeer"},{name:"message",type:"string"},{name:"entities",type:"flags.3?Vector"}],type:"Bool"},{id:1782549861,method:"messages.getAllDrafts",params:[],type:"Updates"},{id:1685588756,method:"messages.getFeaturedStickers",params:[{name:"hash",type:"long"}],type:"messages.FeaturedStickers"},{id:1527873830,method:"messages.readFeaturedStickers",params:[{name:"id",type:"Vector"}],type:"Bool"},{id:-1649852357,method:"messages.getRecentStickers",params:[{name:"flags",type:"#"},{name:"attached",type:"flags.0?true"},{name:"hash",type:"long"}],type:"messages.RecentStickers"},{id:958863608,method:"messages.saveRecentSticker",params:[{name:"flags",type:"#"},{name:"attached",type:"flags.0?true"},{name:"id",type:"InputDocument"},{name:"unsave",type:"Bool"}],type:"Bool"},{id:-1986437075,method:"messages.clearRecentStickers",params:[{name:"flags",type:"#"},{name:"attached",type:"flags.0?true"}],type:"Bool"},{id:1475442322,method:"messages.getArchivedStickers",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"emojis",type:"flags.1?true"},{name:"offset_id",type:"long"},{name:"limit",type:"int"}],type:"messages.ArchivedStickers"},{id:457157256,method:"account.sendConfirmPhoneCode",params:[{name:"hash",type:"string"},{name:"settings",type:"CodeSettings"}],type:"auth.SentCode"},{id:1596029123,method:"account.confirmPhone",params:[{name:"phone_code_hash",type:"string"},{name:"phone_code",type:"string"}],type:"Bool"},{id:-122669393,method:"channels.getAdminedPublicChannels",params:[{name:"flags",type:"#"},{name:"by_location",type:"flags.0?true"},{name:"check_limit",type:"flags.1?true"}],type:"messages.Chats"},{id:1678738104,method:"messages.getMaskStickers",params:[{name:"hash",type:"long"}],type:"messages.AllStickers"},{id:-866424884,method:"messages.getAttachedStickers",params:[{name:"media",type:"InputStickeredMedia"}],type:"Vector"},{id:-1907842680,method:"auth.dropTempAuthKeys",params:[{name:"except_auth_keys",type:"Vector"}],type:"Bool"},{id:-1896289088,method:"messages.setGameScore",params:[{name:"flags",type:"#"},{name:"edit_message",type:"flags.0?true"},{name:"force",type:"flags.1?true"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"user_id",type:"InputUser"},{name:"score",type:"int"}],type:"Updates"},{id:363700068,method:"messages.setInlineGameScore",params:[{name:"flags",type:"#"},{name:"edit_message",type:"flags.0?true"},{name:"force",type:"flags.1?true"},{name:"id",type:"InputBotInlineMessageID"},{name:"user_id",type:"InputUser"},{name:"score",type:"int"}],type:"Bool"},{id:-400399203,method:"messages.getGameHighScores",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"user_id",type:"InputUser"}],type:"messages.HighScores"},{id:258170395,method:"messages.getInlineGameHighScores",params:[{name:"id",type:"InputBotInlineMessageID"},{name:"user_id",type:"InputUser"}],type:"messages.HighScores"},{id:-468934396,method:"messages.getCommonChats",params:[{name:"user_id",type:"InputUser"},{name:"max_id",type:"long"},{name:"limit",type:"int"}],type:"messages.Chats"},{id:-2023787330,method:"messages.getAllChats",params:[{name:"except_ids",type:"Vector"}],type:"messages.Chats"},{id:-333262899,method:"help.setBotUpdatesStatus",params:[{name:"pending_updates_count",type:"int"},{name:"message",type:"string"}],type:"Bool"},{id:852135825,method:"messages.getWebPage",params:[{name:"url",type:"string"},{name:"hash",type:"int"}],type:"WebPage"},{id:-1489903017,method:"messages.toggleDialogPin",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.0?true"},{name:"peer",type:"InputDialogPeer"}],type:"Bool"},{id:991616823,method:"messages.reorderPinnedDialogs",params:[{name:"flags",type:"#"},{name:"force",type:"flags.0?true"},{name:"folder_id",type:"int"},{name:"order",type:"Vector"}],type:"Bool"},{id:-692498958,method:"messages.getPinnedDialogs",params:[{name:"folder_id",type:"int"}],type:"messages.PeerDialogs"},{id:-1440257555,method:"bots.sendCustomRequest",params:[{name:"custom_method",type:"string"},{name:"params",type:"DataJSON"}],type:"DataJSON"},{id:-434028723,method:"bots.answerWebhookJSONQuery",params:[{name:"query_id",type:"long"},{name:"data",type:"DataJSON"}],type:"Bool"},{id:619086221,method:"upload.getWebFile",params:[{name:"location",type:"InputWebFileLocation"},{name:"offset",type:"int"},{name:"limit",type:"int"}],type:"upload.WebFile"},{id:924093883,method:"payments.getPaymentForm",params:[{name:"flags",type:"#"},{name:"invoice",type:"InputInvoice"},{name:"theme_params",type:"flags.0?DataJSON"}],type:"payments.PaymentForm"},{id:611897804,method:"payments.getPaymentReceipt",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"payments.PaymentReceipt"},{id:-1228345045,method:"payments.validateRequestedInfo",params:[{name:"flags",type:"#"},{name:"save",type:"flags.0?true"},{name:"invoice",type:"InputInvoice"},{name:"info",type:"PaymentRequestedInfo"}],type:"payments.ValidatedRequestedInfo"},{id:755192367,method:"payments.sendPaymentForm",params:[{name:"flags",type:"#"},{name:"form_id",type:"long"},{name:"invoice",type:"InputInvoice"},{name:"requested_info_id",type:"flags.0?string"},{name:"shipping_option_id",type:"flags.1?string"},{name:"credentials",type:"InputPaymentCredentials"},{name:"tip_amount",type:"flags.2?long"}],type:"payments.PaymentResult"},{id:1151208273,method:"account.getTmpPassword",params:[{name:"password",type:"InputCheckPasswordSRP"},{name:"period",type:"int"}],type:"account.TmpPassword"},{id:578650699,method:"payments.getSavedInfo",params:[],type:"payments.SavedInfo"},{id:-667062079,method:"payments.clearSavedInfo",params:[{name:"flags",type:"#"},{name:"credentials",type:"flags.0?true"},{name:"info",type:"flags.1?true"}],type:"Bool"},{id:-436833542,method:"messages.setBotShippingResults",params:[{name:"flags",type:"#"},{name:"query_id",type:"long"},{name:"error",type:"flags.0?string"},{name:"shipping_options",type:"flags.1?Vector"}],type:"Bool"},{id:163765653,method:"messages.setBotPrecheckoutResults",params:[{name:"flags",type:"#"},{name:"success",type:"flags.1?true"},{name:"query_id",type:"long"},{name:"error",type:"flags.0?string"}],type:"Bool"},{id:-1876841625,method:"stickers.createStickerSet",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"animated",type:"flags.1?true"},{name:"videos",type:"flags.4?true"},{name:"emojis",type:"flags.5?true"},{name:"text_color",type:"flags.6?true"},{name:"user_id",type:"InputUser"},{name:"title",type:"string"},{name:"short_name",type:"string"},{name:"thumb",type:"flags.2?InputDocument"},{name:"stickers",type:"Vector"},{name:"software",type:"flags.3?string"}],type:"messages.StickerSet"},{id:-143257775,method:"stickers.removeStickerFromSet",params:[{name:"sticker",type:"InputDocument"}],type:"messages.StickerSet"},{id:-4795190,method:"stickers.changeStickerPosition",params:[{name:"sticker",type:"InputDocument"},{name:"position",type:"int"}],type:"messages.StickerSet"},{id:-2041315650,method:"stickers.addStickerToSet",params:[{name:"stickerset",type:"InputStickerSet"},{name:"sticker",type:"InputStickerSetItem"}],type:"messages.StickerSet"},{id:1369162417,method:"messages.uploadMedia",params:[{name:"peer",type:"InputPeer"},{name:"media",type:"InputMedia"}],type:"MessageMedia"},{id:1430593449,method:"phone.getCallConfig",params:[],type:"DataJSON"},{id:1124046573,method:"phone.requestCall",params:[{name:"flags",type:"#"},{name:"video",type:"flags.0?true"},{name:"user_id",type:"InputUser"},{name:"random_id",type:"int"},{name:"g_a_hash",type:"bytes"},{name:"protocol",type:"PhoneCallProtocol"}],type:"phone.PhoneCall"},{id:1003664544,method:"phone.acceptCall",params:[{name:"peer",type:"InputPhoneCall"},{name:"g_b",type:"bytes"},{name:"protocol",type:"PhoneCallProtocol"}],type:"phone.PhoneCall"},{id:788404002,method:"phone.confirmCall",params:[{name:"peer",type:"InputPhoneCall"},{name:"g_a",type:"bytes"},{name:"key_fingerprint",type:"long"},{name:"protocol",type:"PhoneCallProtocol"}],type:"phone.PhoneCall"},{id:399855457,method:"phone.receivedCall",params:[{name:"peer",type:"InputPhoneCall"}],type:"Bool"},{id:-1295269440,method:"phone.discardCall",params:[{name:"flags",type:"#"},{name:"video",type:"flags.0?true"},{name:"peer",type:"InputPhoneCall"},{name:"duration",type:"int"},{name:"reason",type:"PhoneCallDiscardReason"},{name:"connection_id",type:"long"}],type:"Updates"},{id:1508562471,method:"phone.setCallRating",params:[{name:"flags",type:"#"},{name:"user_initiative",type:"flags.0?true"},{name:"peer",type:"InputPhoneCall"},{name:"rating",type:"int"},{name:"comment",type:"string"}],type:"Updates"},{id:662363518,method:"phone.saveCallDebug",params:[{name:"peer",type:"InputPhoneCall"},{name:"debug",type:"DataJSON"}],type:"Bool"},{id:962554330,method:"upload.getCdnFile",params:[{name:"file_token",type:"bytes"},{name:"offset",type:"long"},{name:"limit",type:"int"}],type:"upload.CdnFile"},{id:-1691921240,method:"upload.reuploadCdnFile",params:[{name:"file_token",type:"bytes"},{name:"request_token",type:"bytes"}],type:"Vector"},{id:1375900482,method:"help.getCdnConfig",params:[],type:"CdnConfig"},{id:-219008246,method:"langpack.getLangPack",params:[{name:"lang_pack",type:"string"},{name:"lang_code",type:"string"}],type:"LangPackDifference"},{id:-269862909,method:"langpack.getStrings",params:[{name:"lang_pack",type:"string"},{name:"lang_code",type:"string"},{name:"keys",type:"Vector"}],type:"Vector"},{id:-845657435,method:"langpack.getDifference",params:[{name:"lang_pack",type:"string"},{name:"lang_code",type:"string"},{name:"from_version",type:"int"}],type:"LangPackDifference"},{id:1120311183,method:"langpack.getLanguages",params:[{name:"lang_pack",type:"string"}],type:"Vector"},{id:-1763259007,method:"channels.editBanned",params:[{name:"channel",type:"InputChannel"},{name:"participant",type:"InputPeer"},{name:"banned_rights",type:"ChatBannedRights"}],type:"Updates"},{id:870184064,method:"channels.getAdminLog",params:[{name:"flags",type:"#"},{name:"channel",type:"InputChannel"},{name:"q",type:"string"},{name:"events_filter",type:"flags.0?ChannelAdminLogEventsFilter"},{name:"admins",type:"flags.1?Vector"},{name:"max_id",type:"long"},{name:"min_id",type:"long"},{name:"limit",type:"int"}],type:"channels.AdminLogResults"},{id:-1847836879,method:"upload.getCdnFileHashes",params:[{name:"file_token",type:"bytes"},{name:"offset",type:"long"}],type:"Vector"},{id:-914493408,method:"messages.sendScreenshotNotification",params:[{name:"peer",type:"InputPeer"},{name:"reply_to_msg_id",type:"int"},{name:"random_id",type:"long"}],type:"Updates"},{id:-359881479,method:"channels.setStickers",params:[{name:"channel",type:"InputChannel"},{name:"stickerset",type:"InputStickerSet"}],type:"Bool"},{id:82946729,method:"messages.getFavedStickers",params:[{name:"hash",type:"long"}],type:"messages.FavedStickers"},{id:-1174420133,method:"messages.faveSticker",params:[{name:"id",type:"InputDocument"},{name:"unfave",type:"Bool"}],type:"Bool"},{id:-357180360,method:"channels.readMessageContents",params:[{name:"channel",type:"InputChannel"},{name:"id",type:"Vector"}],type:"Bool"},{id:-2020263951,method:"contacts.resetSaved",params:[],type:"Bool"},{id:-251140208,method:"messages.getUnreadMentions",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"},{name:"offset_id",type:"int"},{name:"add_offset",type:"int"},{name:"limit",type:"int"},{name:"max_id",type:"int"},{name:"min_id",type:"int"}],type:"messages.Messages"},{id:-1683319225,method:"channels.deleteHistory",params:[{name:"flags",type:"#"},{name:"for_everyone",type:"flags.0?true"},{name:"channel",type:"InputChannel"},{name:"max_id",type:"int"}],type:"Updates"},{id:1036054804,method:"help.getRecentMeUrls",params:[{name:"referer",type:"string"}],type:"help.RecentMeUrls"},{id:-356796084,method:"channels.togglePreHistoryHidden",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:921026381,method:"messages.readMentions",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"}],type:"messages.AffectedHistory"},{id:1881817312,method:"messages.getRecentLocations",params:[{name:"peer",type:"InputPeer"},{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"messages.Messages"},{id:-1225713124,method:"messages.sendMultiMedia",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.5?true"},{name:"background",type:"flags.6?true"},{name:"clear_draft",type:"flags.7?true"},{name:"noforwards",type:"flags.14?true"},{name:"update_stickersets_order",type:"flags.15?true"},{name:"peer",type:"InputPeer"},{name:"reply_to_msg_id",type:"flags.0?int"},{name:"top_msg_id",type:"flags.9?int"},{name:"multi_media",type:"Vector"},{name:"schedule_date",type:"flags.10?int"},{name:"send_as",type:"flags.13?InputPeer"}],type:"Updates"},{id:1347929239,method:"messages.uploadEncryptedFile",params:[{name:"peer",type:"InputEncryptedChat"},{name:"file",type:"InputEncryptedFile"}],type:"EncryptedFile"},{id:405695855,method:"account.getWebAuthorizations",params:[],type:"account.WebAuthorizations"},{id:755087855,method:"account.resetWebAuthorization",params:[{name:"hash",type:"long"}],type:"Bool"},{id:1747789204,method:"account.resetWebAuthorizations",params:[],type:"Bool"},{id:896555914,method:"messages.searchStickerSets",params:[{name:"flags",type:"#"},{name:"exclude_featured",type:"flags.0?true"},{name:"q",type:"string"},{name:"hash",type:"long"}],type:"messages.FoundStickerSets"},{id:-1856595926,method:"upload.getFileHashes",params:[{name:"location",type:"InputFileLocation"},{name:"offset",type:"long"}],type:"Vector"},{id:749019089,method:"help.getTermsOfServiceUpdate",params:[],type:"help.TermsOfServiceUpdate"},{id:-294455398,method:"help.acceptTermsOfService",params:[{name:"id",type:"DataJSON"}],type:"Bool"},{id:-1299661699,method:"account.getAllSecureValues",params:[],type:"Vector"},{id:1936088002,method:"account.getSecureValue",params:[{name:"types",type:"Vector"}],type:"Vector"},{id:-1986010339,method:"account.saveSecureValue",params:[{name:"value",type:"InputSecureValue"},{name:"secure_secret_id",type:"long"}],type:"SecureValue"},{id:-1199522741,method:"account.deleteSecureValue",params:[{name:"types",type:"Vector"}],type:"Bool"},{id:-1865902923,method:"users.setSecureValueErrors",params:[{name:"id",type:"InputUser"},{name:"errors",type:"Vector"}],type:"Bool"},{id:-1456907910,method:"account.getAuthorizationForm",params:[{name:"bot_id",type:"long"},{name:"scope",type:"string"},{name:"public_key",type:"string"}],type:"account.AuthorizationForm"},{id:-202552205,method:"account.acceptAuthorization",params:[{name:"bot_id",type:"long"},{name:"scope",type:"string"},{name:"public_key",type:"string"},{name:"value_hashes",type:"Vector"},{name:"credentials",type:"SecureCredentialsEncrypted"}],type:"Bool"},{id:-1516022023,method:"account.sendVerifyPhoneCode",params:[{name:"phone_number",type:"string"},{name:"settings",type:"CodeSettings"}],type:"auth.SentCode"},{id:1305716726,method:"account.verifyPhone",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"},{name:"phone_code",type:"string"}],type:"Bool"},{id:-1730136133,method:"account.sendVerifyEmailCode",params:[{name:"purpose",type:"EmailVerifyPurpose"},{name:"email",type:"string"}],type:"account.SentEmailCode"},{id:53322959,method:"account.verifyEmail",params:[{name:"purpose",type:"EmailVerifyPurpose"},{name:"verification",type:"EmailVerification"}],type:"account.EmailVerified"},{id:1072547679,method:"help.getDeepLinkInfo",params:[{name:"path",type:"string"}],type:"help.DeepLinkInfo"},{id:-2098076769,method:"contacts.getSaved",params:[],type:"Vector"},{id:-2092831552,method:"channels.getLeftChannels",params:[{name:"offset",type:"int"}],type:"messages.Chats"},{id:-1896617296,method:"account.initTakeoutSession",params:[{name:"flags",type:"#"},{name:"contacts",type:"flags.0?true"},{name:"message_users",type:"flags.1?true"},{name:"message_chats",type:"flags.2?true"},{name:"message_megagroups",type:"flags.3?true"},{name:"message_channels",type:"flags.4?true"},{name:"files",type:"flags.5?true"},{name:"file_max_size",type:"flags.5?long"}],type:"account.Takeout"},{id:489050862,method:"account.finishTakeoutSession",params:[{name:"flags",type:"#"},{name:"success",type:"flags.0?true"}],type:"Bool"},{id:486505992,method:"messages.getSplitRanges",params:[],type:"Vector"},{id:911373810,method:"invokeWithMessagesRange",params:[{name:"range",type:"MessageRange"},{name:"query",type:"!X"}],type:"X"},{id:-1398145746,method:"invokeWithTakeout",params:[{name:"takeout_id",type:"long"},{name:"query",type:"!X"}],type:"X"},{id:-1031349873,method:"messages.markDialogUnread",params:[{name:"flags",type:"#"},{name:"unread",type:"flags.0?true"},{name:"peer",type:"InputDialogPeer"}],type:"Bool"},{id:585256482,method:"messages.getDialogUnreadMarks",params:[],type:"Vector"},{id:-2062238246,method:"contacts.toggleTopPeers",params:[{name:"enabled",type:"Bool"}],type:"Bool"},{id:2119757468,method:"messages.clearAllDrafts",params:[],type:"Bool"},{id:-1735311088,method:"help.getAppConfig",params:[],type:"JSONValue"},{id:1862465352,method:"help.saveAppLog",params:[{name:"events",type:"Vector"}],type:"Bool"},{id:-966677240,method:"help.getPassportConfig",params:[{name:"hash",type:"int"}],type:"help.PassportConfig"},{id:1784243458,method:"langpack.getLanguage",params:[{name:"lang_pack",type:"string"},{name:"lang_code",type:"string"}],type:"LangPackLanguage"},{id:-760547348,method:"messages.updatePinnedMessage",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.0?true"},{name:"unpin",type:"flags.1?true"},{name:"pm_oneside",type:"flags.2?true"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"}],type:"Updates"},{id:-1881204448,method:"account.confirmPasswordEmail",params:[{name:"code",type:"string"}],type:"Bool"},{id:2055154197,method:"account.resendPasswordEmail",params:[],type:"Bool"},{id:-1043606090,method:"account.cancelPasswordEmail",params:[],type:"Bool"},{id:-748624084,method:"help.getSupportName",params:[],type:"help.SupportName"},{id:59377875,method:"help.getUserInfo",params:[{name:"user_id",type:"InputUser"}],type:"help.UserInfo"},{id:1723407216,method:"help.editUserInfo",params:[{name:"user_id",type:"InputUser"},{name:"message",type:"string"},{name:"entities",type:"Vector"}],type:"help.UserInfo"},{id:-1626880216,method:"account.getContactSignUpNotification",params:[],type:"Bool"},{id:-806076575,method:"account.setContactSignUpNotification",params:[{name:"silent",type:"Bool"}],type:"Bool"},{id:1398240377,method:"account.getNotifyExceptions",params:[{name:"flags",type:"#"},{name:"compare_sound",type:"flags.1?true"},{name:"peer",type:"flags.0?InputNotifyPeer"}],type:"Updates"},{id:283795844,method:"messages.sendVote",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"options",type:"Vector"}],type:"Updates"},{id:1941660731,method:"messages.getPollResults",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"Updates"},{id:1848369232,method:"messages.getOnlines",params:[{name:"peer",type:"InputPeer"}],type:"ChatOnlines"},{id:-554301545,method:"messages.editChatAbout",params:[{name:"peer",type:"InputPeer"},{name:"about",type:"string"}],type:"Bool"},{id:-1517917375,method:"messages.editChatDefaultBannedRights",params:[{name:"peer",type:"InputPeer"},{name:"banned_rights",type:"ChatBannedRights"}],type:"Updates"},{id:-57811990,method:"account.getWallPaper",params:[{name:"wallpaper",type:"InputWallPaper"}],type:"WallPaper"},{id:-578472351,method:"account.uploadWallPaper",params:[{name:"file",type:"InputFile"},{name:"mime_type",type:"string"},{name:"settings",type:"WallPaperSettings"}],type:"WallPaper"},{id:1817860919,method:"account.saveWallPaper",params:[{name:"wallpaper",type:"InputWallPaper"},{name:"unsave",type:"Bool"},{name:"settings",type:"WallPaperSettings"}],type:"Bool"},{id:-18000023,method:"account.installWallPaper",params:[{name:"wallpaper",type:"InputWallPaper"},{name:"settings",type:"WallPaperSettings"}],type:"Bool"},{id:-1153722364,method:"account.resetWallPapers",params:[],type:"Bool"},{id:1457130303,method:"account.getAutoDownloadSettings",params:[],type:"account.AutoDownloadSettings"},{id:1995661875,method:"account.saveAutoDownloadSettings",params:[{name:"flags",type:"#"},{name:"low",type:"flags.0?true"},{name:"high",type:"flags.1?true"},{name:"settings",type:"AutoDownloadSettings"}],type:"Bool"},{id:899735650,method:"messages.getEmojiKeywords",params:[{name:"lang_code",type:"string"}],type:"EmojiKeywordsDifference"},{id:352892591,method:"messages.getEmojiKeywordsDifference",params:[{name:"lang_code",type:"string"},{name:"from_version",type:"int"}],type:"EmojiKeywordsDifference"},{id:1318675378,method:"messages.getEmojiKeywordsLanguages",params:[{name:"lang_codes",type:"Vector"}],type:"Vector"},{id:-709817306,method:"messages.getEmojiURL",params:[{name:"lang_code",type:"string"}],type:"EmojiURL"},{id:1749536939,method:"folders.editPeerFolders",params:[{name:"folder_peers",type:"Vector"}],type:"Updates"},{id:472471681,method:"folders.deleteFolder",params:[{name:"folder_id",type:"int"}],type:"Updates"},{id:11435201,method:"messages.getSearchCounters",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"},{name:"filters",type:"Vector"}],type:"Vector"},{id:-170208392,method:"channels.getGroupsForDiscussion",params:[],type:"messages.Chats"},{id:1079520178,method:"channels.setDiscussionGroup",params:[{name:"broadcast",type:"InputChannel"},{name:"group",type:"InputChannel"}],type:"Bool"},{id:428848198,method:"messages.requestUrlAuth",params:[{name:"flags",type:"#"},{name:"peer",type:"flags.1?InputPeer"},{name:"msg_id",type:"flags.1?int"},{name:"button_id",type:"flags.1?int"},{name:"url",type:"flags.2?string"}],type:"UrlAuthResult"},{id:-1322487515,method:"messages.acceptUrlAuth",params:[{name:"flags",type:"#"},{name:"write_allowed",type:"flags.0?true"},{name:"peer",type:"flags.1?InputPeer"},{name:"msg_id",type:"flags.1?int"},{name:"button_id",type:"flags.1?int"},{name:"url",type:"flags.2?string"}],type:"UrlAuthResult"},{id:1336717624,method:"messages.hidePeerSettingsBar",params:[{name:"peer",type:"InputPeer"}],type:"Bool"},{id:-386636848,method:"contacts.addContact",params:[{name:"flags",type:"#"},{name:"add_phone_privacy_exception",type:"flags.0?true"},{name:"id",type:"InputUser"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"phone",type:"string"}],type:"Updates"},{id:-130964977,method:"contacts.acceptContact",params:[{name:"id",type:"InputUser"}],type:"Updates"},{id:-1892102881,method:"channels.editCreator",params:[{name:"channel",type:"InputChannel"},{name:"user_id",type:"InputUser"},{name:"password",type:"InputCheckPasswordSRP"}],type:"Updates"},{id:-750207932,method:"contacts.getLocated",params:[{name:"flags",type:"#"},{name:"background",type:"flags.1?true"},{name:"geo_point",type:"InputGeoPoint"},{name:"self_expires",type:"flags.0?int"}],type:"Updates"},{id:1491484525,method:"channels.editLocation",params:[{name:"channel",type:"InputChannel"},{name:"geo_point",type:"InputGeoPoint"},{name:"address",type:"string"}],type:"Bool"},{id:-304832784,method:"channels.toggleSlowMode",params:[{name:"channel",type:"InputChannel"},{name:"seconds",type:"int"}],type:"Updates"},{id:-183077365,method:"messages.getScheduledHistory",params:[{name:"peer",type:"InputPeer"},{name:"hash",type:"long"}],type:"messages.Messages"},{id:-1111817116,method:"messages.getScheduledMessages",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector"}],type:"messages.Messages"},{id:-1120369398,method:"messages.sendScheduledMessages",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector"}],type:"Updates"},{id:1504586518,method:"messages.deleteScheduledMessages",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector"}],type:"Updates"},{id:473805619,method:"account.uploadTheme",params:[{name:"flags",type:"#"},{name:"file",type:"InputFile"},{name:"thumb",type:"flags.0?InputFile"},{name:"file_name",type:"string"},{name:"mime_type",type:"string"}],type:"Document"},{id:1697530880,method:"account.createTheme",params:[{name:"flags",type:"#"},{name:"slug",type:"string"},{name:"title",type:"string"},{name:"document",type:"flags.2?InputDocument"},{name:"settings",type:"flags.3?Vector"}],type:"Theme"},{id:737414348,method:"account.updateTheme",params:[{name:"flags",type:"#"},{name:"format",type:"string"},{name:"theme",type:"InputTheme"},{name:"slug",type:"flags.0?string"},{name:"title",type:"flags.1?string"},{name:"document",type:"flags.2?InputDocument"},{name:"settings",type:"flags.3?Vector"}],type:"Theme"},{id:-229175188,method:"account.saveTheme",params:[{name:"theme",type:"InputTheme"},{name:"unsave",type:"Bool"}],type:"Bool"},{id:-953697477,method:"account.installTheme",params:[{name:"flags",type:"#"},{name:"dark",type:"flags.0?true"},{name:"theme",type:"flags.1?InputTheme"},{name:"format",type:"flags.2?string"},{name:"base_theme",type:"flags.3?BaseTheme"}],type:"Bool"},{id:978872812,method:"account.getTheme",params:[{name:"format",type:"string"},{name:"theme",type:"InputTheme"}],type:"Theme"},{id:1913054296,method:"account.getThemes",params:[{name:"format",type:"string"},{name:"hash",type:"long"}],type:"account.Themes"},{id:-1210022402,method:"auth.exportLoginToken",params:[{name:"api_id",type:"int"},{name:"api_hash",type:"string"},{name:"except_ids",type:"Vector"}],type:"auth.LoginToken"},{id:-1783866140,method:"auth.importLoginToken",params:[{name:"token",type:"bytes"}],type:"auth.LoginToken"},{id:-392909491,method:"auth.acceptLoginToken",params:[{name:"token",type:"bytes"}],type:"Authorization"},{id:-1250643605,method:"account.setContentSettings",params:[{name:"flags",type:"#"},{name:"sensitive_enabled",type:"flags.0?true"}],type:"Bool"},{id:-1952756306,method:"account.getContentSettings",params:[],type:"account.ContentSettings"},{id:300429806,method:"channels.getInactiveChannels",params:[],type:"messages.InactiveChats"},{id:1705865692,method:"account.getMultiWallPapers",params:[{name:"wallpapers",type:"Vector"}],type:"Vector"},{id:-1200736242,method:"messages.getPollVotes",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"option",type:"flags.0?bytes"},{name:"offset",type:"flags.1?string"},{name:"limit",type:"int"}],type:"messages.VotesList"},{id:-1257951254,method:"messages.toggleStickerSets",params:[{name:"flags",type:"#"},{name:"uninstall",type:"flags.0?true"},{name:"archive",type:"flags.1?true"},{name:"unarchive",type:"flags.2?true"},{name:"stickersets",type:"Vector"}],type:"Bool"},{id:779736953,method:"payments.getBankCardData",params:[{name:"number",type:"string"}],type:"payments.BankCardData"},{id:-241247891,method:"messages.getDialogFilters",params:[],type:"Vector"},{id:-1566780372,method:"messages.getSuggestedDialogFilters",params:[],type:"Vector"},{id:450142282,method:"messages.updateDialogFilter",params:[{name:"flags",type:"#"},{name:"id",type:"int"},{name:"filter",type:"flags.0?DialogFilter"}],type:"Bool"},{id:-983318044,method:"messages.updateDialogFiltersOrder",params:[{name:"order",type:"Vector"}],type:"Bool"},{id:-1421720550,method:"stats.getBroadcastStats",params:[{name:"flags",type:"#"},{name:"dark",type:"flags.0?true"},{name:"channel",type:"InputChannel"}],type:"stats.BroadcastStats"},{id:1646092192,method:"stats.loadAsyncGraph",params:[{name:"flags",type:"#"},{name:"token",type:"string"},{name:"x",type:"flags.0?long"}],type:"StatsGraph"},{id:-1707717072,method:"stickers.setStickerSetThumb",params:[{name:"stickerset",type:"InputStickerSet"},{name:"thumb",type:"InputDocument"}],type:"messages.StickerSet"},{id:85399130,method:"bots.setBotCommands",params:[{name:"scope",type:"BotCommandScope"},{name:"lang_code",type:"string"},{name:"commands",type:"Vector"}],type:"Bool"},{id:2127598753,method:"messages.getOldFeaturedStickers",params:[{name:"offset",type:"int"},{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"messages.FeaturedStickers"},{id:-1063816159,method:"help.getPromoData",params:[],type:"help.PromoData"},{id:505748629,method:"help.hidePromoData",params:[{name:"peer",type:"InputPeer"}],type:"Bool"},{id:-8744061,method:"phone.sendSignalingData",params:[{name:"peer",type:"InputPhoneCall"},{name:"data",type:"bytes"}],type:"Bool"},{id:-589330937,method:"stats.getMegagroupStats",params:[{name:"flags",type:"#"},{name:"dark",type:"flags.0?true"},{name:"channel",type:"InputChannel"}],type:"stats.MegagroupStats"},{id:-349483786,method:"account.getGlobalPrivacySettings",params:[],type:"GlobalPrivacySettings"},{id:517647042,method:"account.setGlobalPrivacySettings",params:[{name:"settings",type:"GlobalPrivacySettings"}],type:"GlobalPrivacySettings"},{id:-183649631,method:"help.dismissSuggestion",params:[{name:"peer",type:"InputPeer"},{name:"suggestion",type:"string"}],type:"Bool"},{id:1935116200,method:"help.getCountriesList",params:[{name:"lang_code",type:"string"},{name:"hash",type:"int"}],type:"help.CountriesList"},{id:584962828,method:"messages.getReplies",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"offset_id",type:"int"},{name:"offset_date",type:"int"},{name:"add_offset",type:"int"},{name:"limit",type:"int"},{name:"max_id",type:"int"},{name:"min_id",type:"int"},{name:"hash",type:"long"}],type:"messages.Messages"},{id:1147761405,method:"messages.getDiscussionMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"messages.DiscussionMessage"},{id:-147740172,method:"messages.readDiscussion",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"read_max_id",type:"int"}],type:"Bool"},{id:698914348,method:"contacts.blockFromReplies",params:[{name:"flags",type:"#"},{name:"delete_message",type:"flags.0?true"},{name:"delete_history",type:"flags.1?true"},{name:"report_spam",type:"flags.2?true"},{name:"msg_id",type:"int"}],type:"Updates"},{id:1445996571,method:"stats.getMessagePublicForwards",params:[{name:"channel",type:"InputChannel"},{name:"msg_id",type:"int"},{name:"offset_rate",type:"int"},{name:"offset_peer",type:"InputPeer"},{name:"offset_id",type:"int"},{name:"limit",type:"int"}],type:"messages.Messages"},{id:-1226791947,method:"stats.getMessageStats",params:[{name:"flags",type:"#"},{name:"dark",type:"flags.0?true"},{name:"channel",type:"InputChannel"},{name:"msg_id",type:"int"}],type:"stats.MessageStats"},{id:-299714136,method:"messages.unpinAllMessages",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"}],type:"messages.AffectedHistory"},{id:1221445336,method:"phone.createGroupCall",params:[{name:"flags",type:"#"},{name:"rtmp_stream",type:"flags.2?true"},{name:"peer",type:"InputPeer"},{name:"random_id",type:"int"},{name:"title",type:"flags.0?string"},{name:"schedule_date",type:"flags.1?int"}],type:"Updates"},{id:-1322057861,method:"phone.joinGroupCall",params:[{name:"flags",type:"#"},{name:"muted",type:"flags.0?true"},{name:"video_stopped",type:"flags.2?true"},{name:"call",type:"InputGroupCall"},{name:"join_as",type:"InputPeer"},{name:"invite_hash",type:"flags.1?string"},{name:"params",type:"DataJSON"}],type:"Updates"},{id:1342404601,method:"phone.leaveGroupCall",params:[{name:"call",type:"InputGroupCall"},{name:"source",type:"int"}],type:"Updates"},{id:2067345760,method:"phone.inviteToGroupCall",params:[{name:"call",type:"InputGroupCall"},{name:"users",type:"Vector"}],type:"Updates"},{id:2054648117,method:"phone.discardGroupCall",params:[{name:"call",type:"InputGroupCall"}],type:"Updates"},{id:1958458429,method:"phone.toggleGroupCallSettings",params:[{name:"flags",type:"#"},{name:"reset_invite_hash",type:"flags.1?true"},{name:"call",type:"InputGroupCall"},{name:"join_muted",type:"flags.0?Bool"}],type:"Updates"},{id:68699611,method:"phone.getGroupCall",params:[{name:"call",type:"InputGroupCall"},{name:"limit",type:"int"}],type:"phone.GroupCall"},{id:-984033109,method:"phone.getGroupParticipants",params:[{name:"call",type:"InputGroupCall"},{name:"ids",type:"Vector"},{name:"sources",type:"Vector"},{name:"offset",type:"string"},{name:"limit",type:"int"}],type:"phone.GroupParticipants"},{id:-1248003721,method:"phone.checkGroupCall",params:[{name:"call",type:"InputGroupCall"},{name:"sources",type:"Vector"}],type:"Vector"},{id:1540419152,method:"messages.deleteChat",params:[{name:"chat_id",type:"long"}],type:"Bool"},{id:-104078327,method:"messages.deletePhoneCallHistory",params:[{name:"flags",type:"#"},{name:"revoke",type:"flags.0?true"}],type:"messages.AffectedFoundMessages"},{id:1140726259,method:"messages.checkHistoryImport",params:[{name:"import_head",type:"string"}],type:"messages.HistoryImportParsed"},{id:873008187,method:"messages.initHistoryImport",params:[{name:"peer",type:"InputPeer"},{name:"file",type:"InputFile"},{name:"media_count",type:"int"}],type:"messages.HistoryImport"},{id:713433234,method:"messages.uploadImportedMedia",params:[{name:"peer",type:"InputPeer"},{name:"import_id",type:"long"},{name:"file_name",type:"string"},{name:"media",type:"InputMedia"}],type:"MessageMedia"},{id:-1271008444,method:"messages.startHistoryImport",params:[{name:"peer",type:"InputPeer"},{name:"import_id",type:"long"}],type:"Bool"},{id:-1565154314,method:"messages.getExportedChatInvites",params:[{name:"flags",type:"#"},{name:"revoked",type:"flags.3?true"},{name:"peer",type:"InputPeer"},{name:"admin_id",type:"InputUser"},{name:"offset_date",type:"flags.2?int"},{name:"offset_link",type:"flags.2?string"},{name:"limit",type:"int"}],type:"messages.ExportedChatInvites"},{id:1937010524,method:"messages.getExportedChatInvite",params:[{name:"peer",type:"InputPeer"},{name:"link",type:"string"}],type:"messages.ExportedChatInvite"},{id:-1110823051,method:"messages.editExportedChatInvite",params:[{name:"flags",type:"#"},{name:"revoked",type:"flags.2?true"},{name:"peer",type:"InputPeer"},{name:"link",type:"string"},{name:"expire_date",type:"flags.0?int"},{name:"usage_limit",type:"flags.1?int"},{name:"request_needed",type:"flags.3?Bool"},{name:"title",type:"flags.4?string"}],type:"messages.ExportedChatInvite"},{id:1452833749,method:"messages.deleteRevokedExportedChatInvites",params:[{name:"peer",type:"InputPeer"},{name:"admin_id",type:"InputUser"}],type:"Bool"},{id:-731601877,method:"messages.deleteExportedChatInvite",params:[{name:"peer",type:"InputPeer"},{name:"link",type:"string"}],type:"Bool"},{id:958457583,method:"messages.getAdminsWithInvites",params:[{name:"peer",type:"InputPeer"}],type:"messages.ChatAdminsWithInvites"},{id:-553329330,method:"messages.getChatInviteImporters",params:[{name:"flags",type:"#"},{name:"requested",type:"flags.0?true"},{name:"peer",type:"InputPeer"},{name:"link",type:"flags.1?string"},{name:"q",type:"flags.2?string"},{name:"offset_date",type:"int"},{name:"offset_user",type:"InputUser"},{name:"limit",type:"int"}],type:"messages.ChatInviteImporters"},{id:-1207017500,method:"messages.setHistoryTTL",params:[{name:"peer",type:"InputPeer"},{name:"period",type:"int"}],type:"Updates"},{id:-91437323,method:"account.reportProfilePhoto",params:[{name:"peer",type:"InputPeer"},{name:"photo_id",type:"InputPhoto"},{name:"reason",type:"ReportReason"},{name:"message",type:"string"}],type:"Bool"},{id:187239529,method:"channels.convertToGigagroup",params:[{name:"channel",type:"InputChannel"}],type:"Updates"},{id:1573261059,method:"messages.checkHistoryImportPeer",params:[{name:"peer",type:"InputPeer"}],type:"messages.CheckedHistoryImportPeer"},{id:-248985848,method:"phone.toggleGroupCallRecord",params:[{name:"flags",type:"#"},{name:"start",type:"flags.0?true"},{name:"video",type:"flags.2?true"},{name:"call",type:"InputGroupCall"},{name:"title",type:"flags.1?string"},{name:"video_portrait",type:"flags.2?Bool"}],type:"Updates"},{id:-1524155713,method:"phone.editGroupCallParticipant",params:[{name:"flags",type:"#"},{name:"call",type:"InputGroupCall"},{name:"participant",type:"InputPeer"},{name:"muted",type:"flags.0?Bool"},{name:"volume",type:"flags.1?int"},{name:"raise_hand",type:"flags.2?Bool"},{name:"video_stopped",type:"flags.3?Bool"},{name:"video_paused",type:"flags.4?Bool"},{name:"presentation_paused",type:"flags.5?Bool"}],type:"Updates"},{id:480685066,method:"phone.editGroupCallTitle",params:[{name:"call",type:"InputGroupCall"},{name:"title",type:"string"}],type:"Updates"},{id:-277077702,method:"phone.getGroupCallJoinAs",params:[{name:"peer",type:"InputPeer"}],type:"phone.JoinAsPeers"},{id:-425040769,method:"phone.exportGroupCallInvite",params:[{name:"flags",type:"#"},{name:"can_self_unmute",type:"flags.0?true"},{name:"call",type:"InputGroupCall"}],type:"phone.ExportedGroupCallInvite"},{id:563885286,method:"phone.toggleGroupCallStartSubscription",params:[{name:"call",type:"InputGroupCall"},{name:"subscribed",type:"Bool"}],type:"Updates"},{id:1451287362,method:"phone.startScheduledGroupCall",params:[{name:"call",type:"InputGroupCall"}],type:"Updates"},{id:1465786252,method:"phone.saveDefaultGroupCallJoinAs",params:[{name:"peer",type:"InputPeer"},{name:"join_as",type:"InputPeer"}],type:"Bool"},{id:-873829436,method:"phone.joinGroupCallPresentation",params:[{name:"call",type:"InputGroupCall"},{name:"params",type:"DataJSON"}],type:"Updates"},{id:475058500,method:"phone.leaveGroupCallPresentation",params:[{name:"call",type:"InputGroupCall"}],type:"Updates"},{id:676017721,method:"stickers.checkShortName",params:[{name:"short_name",type:"string"}],type:"Bool"},{id:1303364867,method:"stickers.suggestShortName",params:[{name:"title",type:"string"}],type:"stickers.SuggestedShortName"},{id:1032708345,method:"bots.resetBotCommands",params:[{name:"scope",type:"BotCommandScope"},{name:"lang_code",type:"string"}],type:"Bool"},{id:-481554986,method:"bots.getBotCommands",params:[{name:"scope",type:"BotCommandScope"},{name:"lang_code",type:"string"}],type:"Vector"},{id:-1828139493,method:"account.resetPassword",params:[],type:"account.ResetPasswordResult"},{id:1284770294,method:"account.declinePasswordReset",params:[],type:"Bool"},{id:221691769,method:"auth.checkRecoveryPassword",params:[{name:"code",type:"string"}],type:"Bool"},{id:-700916087,method:"account.getChatThemes",params:[{name:"hash",type:"long"}],type:"account.Themes"},{id:-432283329,method:"messages.setChatTheme",params:[{name:"peer",type:"InputPeer"},{name:"emoticon",type:"string"}],type:"Updates"},{id:-1095836780,method:"channels.viewSponsoredMessage",params:[{name:"channel",type:"InputChannel"},{name:"random_id",type:"bytes"}],type:"Bool"},{id:-333377601,method:"channels.getSponsoredMessages",params:[{name:"channel",type:"InputChannel"}],type:"messages.SponsoredMessages"},{id:745510839,method:"messages.getMessageReadParticipants",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"Vector"},{id:1240514025,method:"messages.getSearchResultsCalendar",params:[{name:"peer",type:"InputPeer"},{name:"filter",type:"MessagesFilter"},{name:"offset_id",type:"int"},{name:"offset_date",type:"int"}],type:"messages.SearchResultsCalendar"},{id:1855292323,method:"messages.getSearchResultsPositions",params:[{name:"peer",type:"InputPeer"},{name:"filter",type:"MessagesFilter"},{name:"offset_id",type:"int"},{name:"limit",type:"int"}],type:"messages.SearchResultsPositions"},{id:2145904661,method:"messages.hideChatJoinRequest",params:[{name:"flags",type:"#"},{name:"approved",type:"flags.0?true"},{name:"peer",type:"InputPeer"},{name:"user_id",type:"InputUser"}],type:"Updates"},{id:-528091926,method:"messages.hideAllChatJoinRequests",params:[{name:"flags",type:"#"},{name:"approved",type:"flags.0?true"},{name:"peer",type:"InputPeer"},{name:"link",type:"flags.1?string"}],type:"Updates"},{id:-1323389022,method:"messages.toggleNoForwards",params:[{name:"peer",type:"InputPeer"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:-855777386,method:"messages.saveDefaultSendAs",params:[{name:"peer",type:"InputPeer"},{name:"send_as",type:"InputPeer"}],type:"Bool"},{id:231174382,method:"channels.getSendAs",params:[{name:"peer",type:"InputPeer"}],type:"channels.SendAsPeers"},{id:-1081501024,method:"account.setAuthorizationTTL",params:[{name:"authorization_ttl_days",type:"int"}],type:"Bool"},{id:1089766498,method:"account.changeAuthorizationSettings",params:[{name:"flags",type:"#"},{name:"hash",type:"long"},{name:"encrypted_requests_disabled",type:"flags.0?Bool"},{name:"call_requests_disabled",type:"flags.1?Bool"}],type:"Bool"},{id:913655003,method:"channels.deleteParticipantHistory",params:[{name:"channel",type:"InputChannel"},{name:"participant",type:"InputPeer"}],type:"messages.AffectedHistory"},{id:-754091820,method:"messages.sendReaction",params:[{name:"flags",type:"#"},{name:"big",type:"flags.1?true"},{name:"add_to_recent",type:"flags.2?true"},{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"reaction",type:"flags.0?Vector"}],type:"Updates"},{id:-1950707482,method:"messages.getMessagesReactions",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector"}],type:"Updates"},{id:1176190792,method:"messages.getMessageReactionsList",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"reaction",type:"flags.0?Reaction"},{name:"offset",type:"flags.1?string"},{name:"limit",type:"int"}],type:"messages.MessageReactionsList"},{id:-21928079,method:"messages.setChatAvailableReactions",params:[{name:"peer",type:"InputPeer"},{name:"available_reactions",type:"ChatReactions"}],type:"Updates"},{id:417243308,method:"messages.getAvailableReactions",params:[{name:"hash",type:"int"}],type:"messages.AvailableReactions"},{id:1330094102,method:"messages.setDefaultReaction",params:[{name:"reaction",type:"Reaction"}],type:"Bool"},{id:1662529584,method:"messages.translateText",params:[{name:"flags",type:"#"},{name:"peer",type:"flags.0?InputPeer"},{name:"id",type:"flags.0?Vector"},{name:"text",type:"flags.1?Vector"},{name:"to_lang",type:"string"}],type:"messages.TranslatedText"},{id:841173339,method:"messages.getUnreadReactions",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"},{name:"offset_id",type:"int"},{name:"add_offset",type:"int"},{name:"limit",type:"int"},{name:"max_id",type:"int"},{name:"min_id",type:"int"}],type:"messages.Messages"},{id:1420459918,method:"messages.readReactions",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"}],type:"messages.AffectedHistory"},{id:-1963375804,method:"contacts.resolvePhone",params:[{name:"phone",type:"string"}],type:"contacts.ResolvedPeer"},{id:447879488,method:"phone.getGroupCallStreamChannels",params:[{name:"call",type:"InputGroupCall"}],type:"phone.GroupCallStreamChannels"},{id:-558650433,method:"phone.getGroupCallStreamRtmpUrl",params:[{name:"peer",type:"InputPeer"},{name:"revoke",type:"Bool"}],type:"phone.GroupCallStreamRtmpUrl"},{id:276705696,method:"messages.searchSentMedia",params:[{name:"q",type:"string"},{name:"filter",type:"MessagesFilter"},{name:"limit",type:"int"}],type:"messages.Messages"},{id:385663691,method:"messages.getAttachMenuBots",params:[{name:"hash",type:"long"}],type:"AttachMenuBots"},{id:1998676370,method:"messages.getAttachMenuBot",params:[{name:"bot",type:"InputUser"}],type:"AttachMenuBotsBot"},{id:1777704297,method:"messages.toggleBotInAttachMenu",params:[{name:"flags",type:"#"},{name:"write_allowed",type:"flags.0?true"},{name:"bot",type:"InputUser"},{name:"enabled",type:"Bool"}],type:"Bool"},{id:395003915,method:"messages.requestWebView",params:[{name:"flags",type:"#"},{name:"from_bot_menu",type:"flags.4?true"},{name:"silent",type:"flags.5?true"},{name:"peer",type:"InputPeer"},{name:"bot",type:"InputUser"},{name:"url",type:"flags.1?string"},{name:"start_param",type:"flags.3?string"},{name:"theme_params",type:"flags.2?DataJSON"},{name:"platform",type:"string"},{name:"reply_to_msg_id",type:"flags.0?int"},{name:"top_msg_id",type:"flags.9?int"},{name:"send_as",type:"flags.13?InputPeer"}],type:"WebViewResult"},{id:2146648841,method:"messages.prolongWebView",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.5?true"},{name:"peer",type:"InputPeer"},{name:"bot",type:"InputUser"},{name:"query_id",type:"long"},{name:"reply_to_msg_id",type:"flags.0?int"},{name:"top_msg_id",type:"flags.9?int"},{name:"send_as",type:"flags.13?InputPeer"}],type:"Bool"},{id:698084494,method:"messages.requestSimpleWebView",params:[{name:"flags",type:"#"},{name:"bot",type:"InputUser"},{name:"url",type:"string"},{name:"theme_params",type:"flags.0?DataJSON"},{name:"platform",type:"string"}],type:"SimpleWebViewResult"},{id:172168437,method:"messages.sendWebViewResultMessage",params:[{name:"bot_query_id",type:"string"},{name:"result",type:"InputBotInlineResult"}],type:"WebViewMessageSent"},{id:-603831608,method:"messages.sendWebViewData",params:[{name:"bot",type:"InputUser"},{name:"random_id",type:"long"},{name:"button_text",type:"string"},{name:"data",type:"string"}],type:"Updates"},{id:1157944655,method:"bots.setBotMenuButton",params:[{name:"user_id",type:"InputUser"},{name:"button",type:"BotMenuButton"}],type:"Bool"},{id:-1671369944,method:"bots.getBotMenuButton",params:[{name:"user_id",type:"InputUser"}],type:"BotMenuButton"},{id:-510647672,method:"account.getSavedRingtones",params:[{name:"hash",type:"long"}],type:"account.SavedRingtones"},{id:1038768899,method:"account.saveRingtone",params:[{name:"id",type:"InputDocument"},{name:"unsave",type:"Bool"}],type:"account.SavedRingtone"},{id:-2095414366,method:"account.uploadRingtone",params:[{name:"file",type:"InputFile"},{name:"file_name",type:"string"},{name:"mime_type",type:"string"}],type:"Document"},{id:2021942497,method:"bots.setBotBroadcastDefaultAdminRights",params:[{name:"admin_rights",type:"ChatAdminRights"}],type:"Bool"},{id:-1839281686,method:"bots.setBotGroupDefaultAdminRights",params:[{name:"admin_rights",type:"ChatAdminRights"}],type:"Bool"},{id:1092913030,method:"phone.saveCallLog",params:[{name:"peer",type:"InputPhoneCall"},{name:"file",type:"InputFile"}],type:"Bool"},{id:-456419968,method:"channels.toggleJoinToSend",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:1277789622,method:"channels.toggleJoinRequest",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:261206117,method:"payments.exportInvoice",params:[{name:"invoice_media",type:"InputMedia"}],type:"payments.ExportedInvoice"},{id:647928393,method:"messages.transcribeAudio",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"messages.TranscribedAudio"},{id:2132608815,method:"messages.rateTranscribedAudio",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"transcription_id",type:"long"},{name:"good",type:"Bool"}],type:"Bool"},{id:-2131921795,method:"payments.assignAppStoreTransaction",params:[{name:"receipt",type:"bytes"},{name:"purpose",type:"InputStorePaymentPurpose"}],type:"Updates"},{id:-537046829,method:"payments.assignPlayMarketTransaction",params:[{name:"receipt",type:"DataJSON"},{name:"purpose",type:"InputStorePaymentPurpose"}],type:"Updates"},{id:-1614700874,method:"payments.canPurchasePremium",params:[{name:"purpose",type:"InputStorePaymentPurpose"}],type:"Bool"},{id:-1206152236,method:"help.getPremiumPromo",params:[],type:"help.PremiumPromo"},{id:-643100844,method:"messages.getCustomEmojiDocuments",params:[{name:"document_id",type:"Vector"}],type:"Vector"},{id:-67329649,method:"messages.getEmojiStickers",params:[{name:"hash",type:"long"}],type:"messages.AllStickers"},{id:248473398,method:"messages.getFeaturedEmojiStickers",params:[{name:"hash",type:"long"}],type:"messages.FeaturedStickers"},{id:-70001045,method:"account.updateEmojiStatus",params:[{name:"emoji_status",type:"EmojiStatus"}],type:"Bool"},{id:-696962170,method:"account.getDefaultEmojiStatuses",params:[{name:"hash",type:"long"}],type:"account.EmojiStatuses"},{id:257392901,method:"account.getRecentEmojiStatuses",params:[{name:"hash",type:"long"}],type:"account.EmojiStatuses"},{id:404757166,method:"account.clearRecentEmojiStatuses",params:[],type:"Bool"},{id:1063567478,method:"messages.reportReaction",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"reaction_peer",type:"InputPeer"}],type:"Bool"},{id:-1149164102,method:"messages.getTopReactions",params:[{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"messages.Reactions"},{id:960896434,method:"messages.getRecentReactions",params:[{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"messages.Reactions"},{id:-1644236876,method:"messages.clearRecentReactions",params:[],type:"Bool"},{id:-2064119788,method:"messages.getExtendedMedia",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector"}],type:"Updates"},{id:767062953,method:"auth.importWebTokenAuthorization",params:[{name:"api_id",type:"int"},{name:"api_hash",type:"string"},{name:"web_auth_token",type:"string"}],type:"auth.Authorization"},{id:-279966037,method:"account.reorderUsernames",params:[{name:"order",type:"Vector"}],type:"Bool"},{id:1490465654,method:"account.toggleUsername",params:[{name:"username",type:"string"},{name:"active",type:"Bool"}],type:"Bool"},{id:-1268978403,method:"channels.reorderUsernames",params:[{name:"channel",type:"InputChannel"},{name:"order",type:"Vector"}],type:"Bool"},{id:1358053637,method:"channels.toggleUsername",params:[{name:"channel",type:"InputChannel"},{name:"username",type:"string"},{name:"active",type:"Bool"}],type:"Bool"},{id:170155475,method:"channels.deactivateAllUsernames",params:[{name:"channel",type:"InputChannel"}],type:"Bool"},{id:-1540781271,method:"channels.toggleForum",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:-200539612,method:"channels.createForumTopic",params:[{name:"flags",type:"#"},{name:"channel",type:"InputChannel"},{name:"title",type:"string"},{name:"icon_color",type:"flags.0?int"},{name:"icon_emoji_id",type:"flags.3?long"},{name:"random_id",type:"long"},{name:"send_as",type:"flags.2?InputPeer"}],type:"Updates"},{id:233136337,method:"channels.getForumTopics",params:[{name:"flags",type:"#"},{name:"channel",type:"InputChannel"},{name:"q",type:"flags.0?string"},{name:"offset_date",type:"int"},{name:"offset_id",type:"int"},{name:"offset_topic",type:"int"},{name:"limit",type:"int"}],type:"messages.ForumTopics"},{id:-1333584199,method:"channels.getForumTopicsByID",params:[{name:"channel",type:"InputChannel"},{name:"topics",type:"Vector"}],type:"messages.ForumTopics"},{id:-186670715,method:"channels.editForumTopic",params:[{name:"flags",type:"#"},{name:"channel",type:"InputChannel"},{name:"topic_id",type:"int"},{name:"title",type:"flags.0?string"},{name:"icon_emoji_id",type:"flags.1?long"},{name:"closed",type:"flags.2?Bool"},{name:"hidden",type:"flags.3?Bool"}],type:"Updates"},{id:1814925350,method:"channels.updatePinnedForumTopic",params:[{name:"channel",type:"InputChannel"},{name:"topic_id",type:"int"},{name:"pinned",type:"Bool"}],type:"Updates"},{id:876830509,method:"channels.deleteTopicHistory",params:[{name:"channel",type:"InputChannel"},{name:"top_msg_id",type:"int"}],type:"messages.AffectedHistory"},{id:693150095,method:"channels.reorderPinnedForumTopics",params:[{name:"flags",type:"#"},{name:"force",type:"flags.0?true"},{name:"channel",type:"InputChannel"},{name:"order",type:"Vector"}],type:"Updates"},{id:1760814315,method:"channels.toggleAntiSpam",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:-1471109485,method:"channels.reportAntiSpamFalsePositive",params:[{name:"channel",type:"InputChannel"},{name:"msg_id",type:"int"}],type:"Bool"},{id:-1632299963,method:"messages.setDefaultHistoryTTL",params:[{name:"period",type:"int"}],type:"Bool"},{id:1703637384,method:"messages.getDefaultHistoryTTL",params:[],type:"DefaultHistoryTTL"},{id:-127582169,method:"contacts.exportContactToken",params:[],type:"ExportedContactToken"},{id:318789512,method:"contacts.importContactToken",params:[{name:"token",type:"string"}],type:"User"},{id:-515093903,method:"photos.uploadContactProfilePhoto",params:[{name:"flags",type:"#"},{name:"suggest",type:"flags.3?true"},{name:"save",type:"flags.4?true"},{name:"user_id",type:"InputUser"},{name:"file",type:"flags.0?InputFile"},{name:"video",type:"flags.1?InputFile"},{name:"video_start_ts",type:"flags.2?double"},{name:"video_emoji_markup",type:"flags.5?VideoSize"}],type:"photos.Photo"},{id:1785624660,method:"channels.toggleParticipantsHidden",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:-29831141,method:"messages.sendBotRequestedPeer",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"button_id",type:"int"},{name:"requested_peer",type:"InputPeer"}],type:"Updates"},{id:-495647960,method:"account.getDefaultProfilePhotoEmojis",params:[{name:"hash",type:"long"}],type:"EmojiList"},{id:-1856479058,method:"account.getDefaultGroupPhotoEmojis",params:[{name:"hash",type:"long"}],type:"EmojiList"},{id:-1991881904,method:"auth.requestFirebaseSms",params:[{name:"flags",type:"#"},{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"},{name:"safety_net_token",type:"flags.0?string"},{name:"ios_push_secret",type:"flags.1?string"}],type:"Bool"},{id:1955122779,method:"messages.getEmojiGroups",params:[{name:"hash",type:"int"}],type:"messages.EmojiGroups"},{id:785209037,method:"messages.getEmojiStatusGroups",params:[{name:"hash",type:"int"}],type:"messages.EmojiGroups"},{id:564480243,method:"messages.getEmojiProfilePhotoGroups",params:[{name:"hash",type:"int"}],type:"messages.EmojiGroups"},{id:739360983,method:"messages.searchCustomEmoji",params:[{name:"emoticon",type:"string"},{name:"hash",type:"long"}],type:"EmojiList"},{id:-461589127,method:"messages.togglePeerTranslations",params:[{name:"flags",type:"#"},{name:"disabled",type:"flags.0?true"},{name:"peer",type:"InputPeer"}],type:"Bool"},{id:-1379156774,method:"account.getAutoSaveSettings",params:[],type:"account.AutoSaveSettings"},{id:-694451359,method:"account.saveAutoSaveSettings",params:[{name:"flags",type:"#"},{name:"users",type:"flags.0?true"},{name:"chats",type:"flags.1?true"},{name:"broadcasts",type:"flags.2?true"},{name:"peer",type:"flags.3?InputPeer"},{name:"settings",type:"AutoSaveSettings"}],type:"Bool"},{id:1404829728,method:"account.deleteAutoSaveExceptions",params:[],type:"Bool"}]},layer:152};var ts=a(745),as=a.n(ts),ss=a(4736),ns=a.n(ss);function is(e){return e>>>0}function rs(e,t){return e=is(e),t=is(t),ns()(e).shiftLeft(32).add(ns()(t))}const os=ns()(Number.MAX_SAFE_INTEGER),ps=ns()(ns()[2]).pow(64),ds=ps.divide(ns()[2]);function fs(e,t=256){return ns().fromArray(e instanceof Uint8Array?[...e]:e,t)}const cs=+es.API.constructors.find((e=>"boolFalse"===e.predicate)).id,ls=+es.API.constructors.find((e=>"boolTrue"===e.predicate)).id,ms=+es.API.constructors.find((e=>"vector"===e.predicate)).id,gs=+es.MTProto.constructors.find((e=>"gzip_packed"===e.predicate)).id,hs="slice";class us{constructor(e={}){this.maxLength=2048,this.offset=0,this.mtproto=!1,this.debug=!1,this.maxLength=e.startMaxLength||2048,this.mtproto=e.mtproto||!1,this.createBuffer()}createBuffer(){this.buffer=new ArrayBuffer(this.maxLength),this.intView=new Int32Array(this.buffer),this.byteView=new Uint8Array(this.buffer)}getArray(){const e=new ArrayBuffer(this.offset),t=new Int32Array(e);return t.set(this.intView.subarray(0,this.offset/4)),t}getBuffer(){return this.getArray().buffer}getBytes(e=!0){if(e){const e=new ArrayBuffer(this.offset),t=new Uint8Array(e);return t.set(this.byteView.subarray(0,this.offset)),t}const t=new Array(this.offset);for(let e=0;e>>",e.toString(16),e,t);const a=this.offset/4;return this.checkLength(4),this.intView[a]=e,this.offset+=4,a}storeInt(e,t){return this.writeInt(e,(t||"")+":int")}storeBool(e,t){e?this.writeInt(ls,(t||"")+":bool"):this.writeInt(cs,(t||"")+":bool")}storeLongP(e,t,a){this.writeInt(t,(a||"")+":long[low]"),this.writeInt(e,(a||"")+":long[high]")}storeLong(e,t){if(Array.isArray(e))return 2===e.length?this.storeLongP(e[0],e[1],t):this.storeIntBytes(e,64,t);const a=(s=ns()(e)).isNegative()?ps.add(s):s;var s;const{quotient:n,remainder:i}=a.divmod(4294967296),r=n.toJSNumber(),o=i.toJSNumber();this.writeInt(o,(t||"")+":long[low]"),this.writeInt(r,(t||"")+":long[high]")}storeDouble(e,t){const a=new ArrayBuffer(8),s=new Int32Array(a);new Float64Array(a)[0]=e,this.writeInt(s[0],(t||"")+":double[low]"),this.writeInt(s[1],(t||"")+":double[high]")}storeString(e,t){this.debug&&console.log(">>>",e,(t||"")+":string"),void 0===e&&(e="");const a=unescape(encodeURIComponent(e));this.checkLength(a.length+8);const s=a.length;s<=253?this.byteView[this.offset++]=s:(this.byteView[this.offset++]=254,this.byteView[this.offset++]=255&s,this.byteView[this.offset++]=(65280&s)>>8,this.byteView[this.offset++]=(16711680&s)>>16);for(let e=0;e>>",E(e),(t||"")+":bytes");const a=e.length;for(this.checkLength(a+8),a<=253?this.byteView[this.offset++]=a:(this.byteView[this.offset++]=254,this.byteView[this.offset++]=255&a,this.byteView[this.offset++]=(65280&a)>>8,this.byteView[this.offset++]=(16711680&a)>>16),this.byteView.set(e,this.offset),this.offset+=a;this.offset%4;)this.byteView[this.offset++]=0}storeIntBytes(e,t,a){e instanceof ArrayBuffer&&(e=new Uint8Array(e));const s=e.length;if(t%32||8*s!==t){const n=new Error("Invalid bits: "+t+", "+s);throw console.error(n,e,a),n}this.debug&&console.log(">>>",E(e),(a||"")+":int"+t),this.checkLength(s),this.byteView.set(e,this.offset),this.offset+=s}storeRawBytes(e,t){e instanceof ArrayBuffer&&(e=new Uint8Array(e));const a=e.length;this.debug&&console.log(">>>",E(e),t||""),this.checkLength(a),this.byteView.set(e,this.offset),this.offset+=a}storeMethod(e,t){const a=(this.mtproto?es.MTProto:es.API).methods.find((t=>t.method===e));if(!a)throw new Error("No method "+e+" found");this.storeInt(a.id,e+"[id]");const s=t.pFlags||t,n={};for(const i of a.params){let a=i.type;if(-1!==a.indexOf("?")){const e=a.split("?"),n=e[0].split(".");if(!(t[n[0]]&1<<+n[1])){if(!("true"===e[1]?s[i.name]:void 0!==t[i.name]))continue;t[n[0]]|=1<<+n[1]}a=e[1]}const r=this.storeObject(t[i.name],a,e+"["+i.name+"]");"#"===a&&(t[i.name]=t[i.name]||0,n[i.name]=r)}for(const e in n)this.intView[n[e]]=t[e];return a.type}storeObject(e,t,a){switch(t){case"#":e=e||0;case"int":return this.storeInt(e,a);case"long":return this.storeLong(e,a);case"int128":return this.storeIntBytes(e,128,a);case"int256":return this.storeIntBytes(e,256,a);case"int512":return this.storeIntBytes(e,512,a);case"string":return this.storeString(e,a);case"bytes":return this.storeBytes(e,a);case"double":return this.storeDouble(e,a);case"Bool":return this.storeBool(e,a);case"true":return}if(Array.isArray(e)){if("Vector"===t.substr(0,6))this.writeInt(ms,a+"[id]");else if("vector"!==t.substr(0,6))throw new Error("Invalid vector type "+t);const s=t.substr(7,t.length-8);this.writeInt(e.length,a+"[count]");for(let t=0;te.predicate===n));if((i="%"===t.charAt(0))&&(t=t.substr(1)),!r)throw new Error("No predicate "+n+" found");n===t&&(i=!0),i||this.writeInt(r.id,a+"["+n+"][id]");const o=e.pFlags,p={};for(const t of r.params){let s=t.type;if(-1!==s.indexOf("?")){const a=s.split("?"),n=a[0].split(".");if(!(e[n[0]]&1<<+n[1])){if(!("true"===a[1]?o&&o[t.name]:void 0!==e[t.name]))continue;e[n[0]]|=1<<+n[1]}s=a[1]}const i=this.storeObject(e[t.name],s,a+"["+n+"]["+t.name+"]");"#"===s&&(e[t.name]=e[t.name]||0,p[t.name]=i)}for(const t in p)this.intView[p[t]]=e[t];return r.type}}class ys{constructor(e,t={}){this.offset=0,this.mtproto=!1,e instanceof ArrayBuffer?(this.buffer=e,this.intView=new Int32Array(e),this.byteView=new Uint8Array(this.buffer)):(this.buffer=e.buffer,this.intView=new Int32Array(e.buffer),this.byteView=e),this.override=t.override||{},this.mtproto=!!t.mtproto,this.debug=void 0!==t.debug&&t.debug}readInt(e){if(this.byteView.length-this.offset<4)throw console.error(this.byteView,this.offset),new Error("Nothing to fetch: "+e);const t=this.intView[this.offset/4];return this.debug&&console.log("<<<",t.toString(16),t,e,this.byteView.slice(this.offset-16,this.offset+16),E(this.byteView.slice(this.offset-16,this.offset+16))),this.offset+=4,t}fetchInt(e){return this.readInt((e||"")+":int")}fetchDouble(e){const t=new ArrayBuffer(8),a=new Int32Array(t),s=new Float64Array(t);return a[0]=this.readInt((e||"")+":double[low]"),a[1]=this.readInt((e||"")+":double[high]"),s[0]}fetchLong(e){const t=this.readInt((e||"")+":long[low]");let a=rs(this.readInt((e||"")+":long[high]"),t);var s;return this.mtproto||(a=(s=a).greater(ds)?s.minus(ps):s),!this.mtproto&&os.greaterOrEquals(a.abs())?a.toJSNumber():a.toString(10)}fetchBool(e){const t=this.readInt((e||"")+":bool");return t===ls||t!==cs&&(this.offset-=4,this.fetchObject("Object",e))}fetchString(e){let t=this.byteView[this.offset++];254===t&&(t=this.byteView[this.offset++]|this.byteView[this.offset++]<<8|this.byteView[this.offset++]<<16);let a,s="";for(let e=0;ethis.byteView.byteLength)throw new Error("Invalid raw bytes length: "+e+", buffer len: "+this.byteView.byteLength);if(t){const t=new Uint8Array(e);return t.set(this.byteView[hs](this.offset,this.offset+e)),this.offset+=e,t}const s=new Array(e);for(let t=0;t0){const n=e.substr(7,e.length-8);for(let e=0;ee.type===t)),!s)throw new Error("Constructor not found for type: "+e)}else{const r=this.readInt(t+"[id]");if(r===gs){const a=(i=this.fetchBytes(t+"[packed_string]"),as().inflate(i,void 0));return new ys(a).fetchObject(e,t)}if(r===ms)return this.fetchVector(e,t);let o=a.constructorsIndex;if(!o){a.constructorsIndex=o={};for(let e=0,t=a.constructors.length;e0&&r{var e;if(this.pingDelayDisconnectDeferred||!this.transport||!this.transport.connected)return;const t=this.pingDelayDisconnectDeferred=(0,v.Z)(),a=this.delays,s=this.delays.pingMaxTime,n=Math.min(null!==(e=this.lastPingTime)&&void 0!==e?e:0,s),i=Math.round(a.disconnectDelayMin+n/s*(a.disconnectDelayMax-a.disconnectDelayMin)),r=1e3*i,o=this.lastPingStartTime=Date.now(),p=this.lastPingDelayDisconnectId=(0,Ee.a)(),d={notContentRelated:!0};this.wrapMtpCall("ping_delay_disconnect",{ping_id:p,disconnect_delay:i},d);const f=this.log.bindPrefix("sendPingDelayDisconnect");this.debug&&f.debug(`ping, timeout=${r}, lastPingTime=${this.lastPingTime}, msgId=${d.messageId}, pingId=${p}`);const c=T.Z.setTimeout(t.reject,r);t.then((e=>{clearTimeout(c);const t=Date.now()-o;if(this.lastPingTime=t/1e3,this.debug&&f.debug(`pong, reason='${e}', time=${n}, msgId=${d.messageId}`),t>r)throw void 0;return(0,P.Z)(Math.max(0,this.delays.pingInterval-t))})).catch((()=>{clearTimeout(c);const e=this.transport;this.pingDelayDisconnectDeferred===t&&(null==e?void 0:e.connection)&&(f.error("catch, closing connection",this.lastPingTime,d.messageId),e.connection.close())})).finally((()=>{this.pingDelayDisconnectDeferred===t&&(this.pingDelayDisconnectDeferred=void 0,this.sendPingDelayDisconnect())}))},this.checkLongPoll=()=>{const e=this.cleanupSent();if(this.longPollPending&&Date.now(){e&&(t!==this.dcId||this.sleepAfter&&Date.now()>this.sleepAfter)||this.sendLongPoll()}))},this.checkConnection=e=>{if(this.debug&&this.log("Check connection",e),this.clearCheckConnectionTimeout(),!this.transport)return void this.log.warn("No transport for checkConnection");const t=new us({mtproto:!0}),a=(0,Ee.a)();t.storeMethod("ping",{ping_id:a});const s={msg_id:this.timeManager.generateId(),seq_no:this.generateSeqNo(!0),body:t.getBytes(!0)};this.offline&&this.setConnectionStatus(D.Q.Connecting),this.sendEncryptedRequest(s).then((()=>{this.toggleOffline(!1)}),(()=>{this.debug&&this.log("Delay",1e3*this.checkConnectionPeriod),this.checkConnectionTimeout=T.Z.setTimeout((()=>this.checkConnection("from failed checkConnection request")),1e3*this.checkConnectionPeriod|0),this.checkConnectionPeriod=Math.min(60,1.5*this.checkConnectionPeriod)}))},this.authKeyUint8=(0,bs.Z)(this.authKey),this.serverSalt=(0,bs.Z)(i),this.isFileUpload=!!r.fileUpload,this.isFileDownload=!!r.fileDownload,this.isFileNetworker=this.isFileUpload||this.isFileDownload,this.delays=this.isFileNetworker?Ss.file:Ss.client;const o=this.isFileUpload?"-U":this.isFileDownload?"-D":"";this.name="NET-"+a+o,this.log=(0,S.kg)(this.name+(o?"":"-C")+"-"+ks++,S.v9.Log|S.v9.Error|S.v9.Warn),this.log("constructor"),this.updateSession()}updateSession(){this.seqNo=0,this.prevSessionId=this.sessionId,this.sessionId=k(new Uint8Array(8))}updateSentMessage(e){const t=this.sentMessages[e];return!!t&&(t.container&&(0,ne.Z)(t.inner,((e,a)=>{const s=this.updateSentMessage(e);s?t.inner[a]=s.msg_id:t.inner.splice(a,1)})),t.msg_id=this.timeManager.generateId(),t.seq_no=this.generateSeqNo(t.notContentRelated||t.container),this.debug&&this.log(`updateSentMessage, old=${e}, new=${t.msg_id}`),this.sentMessages[t.msg_id]=t,delete this.sentMessages[e],t)}generateSeqNo(e){let t=2*this.seqNo;return e||(t++,this.seqNo++),t}wrapMtpCall(e,t,a){const s=new us({mtproto:!0});s.storeMethod(e,t);const n=this.timeManager.generateId(),i=this.generateSeqNo(),r={msg_id:n,seq_no:i,body:s.getBytes(!0)};return b.Z.debug&&this.log("MT call",e,t,n,i),this.pushMessage(r,a)}wrapMtpMessage(e,t){const a=new us({mtproto:!0});a.storeObject(e,"Object");const s=this.timeManager.generateId(),n=this.generateSeqNo(t.notContentRelated),i={msg_id:s,seq_no:n,body:a.getBytes(!0)};return b.Z.debug&&this.log("MT message",e,s,n),this.pushMessage(i,t)}wrapApiCall(e,t={},a={}){const s=new us(a);if(!this.connectionInited){const e=es.API.methods.find((e=>"invokeWithLayer"===e.method));if(!e)throw new Error("no invokeWithLayer!");s.storeInt(+e.id,"invokeWithLayer"),s.storeInt(es.layer,"layer");const t=es.API.methods.find((e=>"initConnection"===e.method));if(!t)throw new Error("no initConnection!");s.storeInt(+t.id,"initConnection"),s.storeInt(0,"flags"),s.storeInt(_.Z.id,"api_id"),s.storeString(i().USER_AGENT||"Unknown UserAgent","device_model"),s.storeString(navigator.platform||"Unknown Platform","system_version"),s.storeString(_.Z.version+(_.Z.isMainDomain?" "+_.Z.suffix:""),"app_version"),s.storeString(navigator.language||"en","system_lang_code"),s.storeString(_.Z.langPack,"lang_pack"),s.storeString(this.networkerFactory.language,"lang_code")}if(a.afterMessageId){if(void 0===Cs){const e=es.API.methods.find((e=>"invokeAfterMsg"===e.method));Cs=e?+e.id:0}Cs?(s.storeInt(Cs,"invokeAfterMsg"),s.storeLong(a.afterMessageId,"msg_id")):this.log.error("no invokeAfterMsg!")}a.resultType=s.storeMethod(e,t);const n={msg_id:this.timeManager.generateId(),seq_no:this.generateSeqNo(),body:s.getBytes(!0),isAPI:!0};return b.Z.debug?this.log("Api call",e,n,t,a):this.debug&&this.log("Api call",e,t,a),this.pushMessage(n,a)}changeTransport(e){const t=this.transport;t&&(t.destroy(),this.nextReqTimeout&&(clearTimeout(this.nextReqTimeout),this.nextReqTimeout=0,this.nextReq=0),this.connectionInited=!1,void 0!==this.longPollInterval&&(clearInterval(this.longPollInterval),this.longPollInterval=void 0),this.clearCheckConnectionTimeout()),this.log("change transport",e,t),this.clearPingDelayDisconnect(),this.transport=e,e&&(e.networker=this,e instanceof I&&(this.longPollInterval=T.Z.setInterval(this.checkLongPoll,1e4),this.checkLongPoll(),this.checkConnection("changed transport")),e.connection&&e.connected&&this.setConnectionStatus(D.Q.Connected),this.resend())}destroy(){this.log("destroy")}forceReconnectTimeout(){this.transport.reconnect?this.transport.reconnect():this.resend()}forceReconnect(){this.transport.forceReconnect?this.transport.forceReconnect():this.checkConnection("force reconnect")}clearPingDelayDisconnect(){const e=this.pingDelayDisconnectDeferred;this.pingDelayDisconnectDeferred=void 0,this.lastPingDelayDisconnectId=void 0,e&&e.reject()}sendLongPoll(){this.sendingLongPoll||(this.sendingLongPoll=!0,this.longPollPending=Date.now()+25e3,this.debug&&this.log.debug("sendLongPoll",this.longPollPending),this.wrapMtpCall("http_wait",{max_delay:500,wait_after:150,max_wait:25e3},{noResponse:!0,longPoll:!0}).then((()=>{this.longPollPending=void 0,setTimeout(this.checkLongPoll,0)}),(e=>{this.log("Long-poll failed",e)})).finally((()=>{this.sendingLongPoll=void 0})))}clearCheckConnectionTimeout(){void 0!==this.checkConnectionTimeout&&(clearTimeout(this.checkConnectionTimeout),this.checkConnectionTimeout=void 0)}toggleOffline(e){if(this.offline!==e)if(this.offline=e,this.clearCheckConnectionTimeout(),e){clearTimeout(this.nextReqTimeout),this.nextReqTimeout=0,this.nextReq=0,this.checkConnectionPeriod<1.5&&(this.checkConnectionPeriod=0);const e=1e3*this.checkConnectionPeriod|0;this.checkConnectionRetryAt=Date.now()+e,this.setConnectionStatus(D.Q.Closed,this.checkConnectionRetryAt),this.checkConnectionTimeout=T.Z.setTimeout((()=>this.checkConnection("from toggleOfline")),e),this.checkConnectionPeriod=Math.min(30,1.5*(1+this.checkConnectionPeriod))}else this.setConnectionStatus(D.Q.Connected),this.checkLongPoll(),this.scheduleRequest();this.setConnectionStatus(e?D.Q.Closed:D.Q.Connected,e?this.checkConnectionRetryAt:void 0)}handleSentEncryptedRequestHTTP(e,t,a){e.then((e=>(this.toggleOffline(!1),this.parseResponse(e).then((e=>(this.debug&&this.log.debug("Server response",e),this.processMessage(e.response,e.messageId,e.sessionId),this.checkLongPoll(),this.checkConnectionPeriod=Math.max(1.1,Math.sqrt(this.checkConnectionPeriod)),!0))))),(e=>(this.log.error("Encrypted request failed",e,t),this.pushResend(t.msg_id),this.toggleOffline(!0),!1))).then((e=>{const t=this.sentMessages;a.forEach((a=>{const s=t[a];if(s){const n=s.deferred;delete t[a],delete this.pendingMessages[a],e?n.resolve():n.reject()}}))}))}pushMessage(e,t){let a;return t.notContentRelated&&!t.noResponse||(a=(0,v.Z)()),this.sentMessages[e.msg_id]=Object.assign(e,t,a?{deferred:a}:void 0),this.pendingMessages[e.msg_id]=0,t.noSchedule||this.scheduleRequest(),(0,fe.Z)(t)&&(t.messageId=e.msg_id),a}attachPromise(e,t){const a=setTimeout((()=>{this.lastResponseTime&&Date.now()-this.lastResponseTime{clearTimeout(a),this.setConnectionStatus(D.Q.Connected),--this.activeRequests,this.setDrainTimeout()})),++this.activeRequests,void 0!==this.onDrainTimeout&&(clearTimeout(this.onDrainTimeout),this.onDrainTimeout=void 0)}setDrainTimeout(){!this.activeRequests&&this.onDrain&&void 0===this.onDrainTimeout&&(this.onDrainTimeout=T.Z.setTimeout((()=>{this.onDrainTimeout=void 0,this.log("drain"),this.onDrain()}),1e4))}setConnectionStatus(e,t){var a;const s=e===D.Q.Connected,n=this.status!==e;this.isOnline=s,this.status=e,n&&(this.networkerFactory.onConnectionStatusChange&&this.networkerFactory.onConnectionStatusChange({_:"networkerStatus",status:e,dcId:this.dcId,name:this.name,isFileNetworker:this.isFileNetworker,isFileDownload:this.isFileDownload,isFileUpload:this.isFileUpload,retryAt:t}),this.isOnline&&this.scheduleRequest(),(null===(a=this.transport)||void 0===a?void 0:a.connection)&&(this.clearPingDelayDisconnect(),this.sendPingDelayDisconnect()))}pushResend(e,t=100){const a=t?Date.now()+t:0,s=this.sentMessages[e];if(s.container)for(const e of s.inner)this.pendingMessages[e]=a;else this.pendingMessages[e]=a;s.acked&&this.log.error("pushResend: acked message?",s),this.debug&&this.log.debug("pushResend:",e,s,this.pendingMessages,t),this.scheduleRequest(t)}getMsgKey(e,t){return Ms(this,void 0,void 0,(function*(){const a=t?0:8,n=(0,_s.Z)(this.authKeyUint8.subarray(88+a,88+a+32),e),i=yield s.Z.invokeCrypto("sha256",n);return new Uint8Array(i).subarray(8,24)}))}getAesKeyIv(e,t){const a=t?0:8,n=new Uint8Array(52),i=new Uint8Array(52),r=[];return n.set(e,0),n.set(this.authKeyUint8.subarray(a,a+36),16),r.push(s.Z.invokeCrypto("sha256",n)),i.set(this.authKeyUint8.subarray(40+a,40+a+36),0),i.set(e,36),r.push(s.Z.invokeCrypto("sha256",i)),Promise.all(r).then((e=>{const t=new Uint8Array(32),a=new Uint8Array(32),s=new Uint8Array(e[0]),n=new Uint8Array(e[1]);return t.set(s.subarray(0,8)),t.set(n.subarray(8,24),8),t.set(s.subarray(24,32),24),a.set(n.subarray(0,8)),a.set(s.subarray(8,24),8),a.set(n.subarray(24,32),24),[t,a]}))}isStopped(){return this.networkerFactory.akStopped&&!this.isFileNetworker}performScheduledRequest(){if(this.isStopped())return!1;if(this.pendingAcks.length){const e=this.pendingAcks.slice();this.wrapMtpMessage({_:"msgs_ack",msg_ids:e},{notContentRelated:!0,noSchedule:!0})}const e=this.pendingResendReq.length;if(e){const t=Object.assign({},Is),a=this.pendingResendReq.splice(0,e);this.wrapMtpMessage({_:"msg_resend_req",msg_ids:a},t),this.log("resend: resending requests",t.messageId,a)}let t;const a=[];let s=0,n=!1,i=!1,r=!1;const o=Object.keys(this.pendingMessages).map((e=>ns()(e))).sort(((e,t)=>e.compare(t))).map((e=>e.toString(10)));for(const e of o){const o=this.sentMessages[e];if(o&&o.body){const e=o.body.length+32;if(s+e>655360&&(this.log.warn("lengthOverflow",o,a),r=!0,t))break;a.push(o),s+=e,o.isAPI?n=!0:o.longPoll&&(i=!0),t=o}delete this.pendingMessages[e]}if(this.transport instanceof I&&n&&!i){const e=new us({mtproto:!0});e.storeMethod("http_wait",{max_delay:500,wait_after:150,max_wait:3e3}),a.push({msg_id:this.timeManager.generateId(),seq_no:this.generateSeqNo(),body:e.getBytes(!0)})}if(!a.length)return;const p=a.filter((e=>e.noResponse)).map((e=>e.msg_id));if(a.length>1){const e=this.generateContainerMessage(s,a);t=e.messageWithBody,this.sentMessages[t.msg_id]=e.message}else this.sentMessages[t.msg_id]=t;this.pendingAcks=[];const d=this.sendEncryptedRequest(t);this.transport instanceof I&&this.handleSentEncryptedRequestHTTP(d,t,p),this.transport instanceof I||this.cleanupSent(),r&&this.scheduleRequest()}generateContainerMessage(e,t){const a=new us({mtproto:!0,startMaxLength:e+64});a.storeInt(1945237724,"CONTAINER[id]"),a.storeInt(t.length,"CONTAINER[count]");const s=[];t.forEach(((e,t)=>{s.push(e.msg_id),a.storeLong(e.msg_id,"CONTAINER["+t+"][msg_id]"),a.storeInt(e.seq_no,"CONTAINER["+t+"][seq_no]"),a.storeInt(e.body.length,"CONTAINER["+t+"][bytes]"),a.storeRawBytes(e.body,"CONTAINER["+t+"][body]")}));const n={msg_id:this.timeManager.generateId(),seq_no:this.generateSeqNo(!0),container:!0,inner:s};return b.Z.debug&&this.log.warn("Container",s,n.msg_id,n.seq_no),{message:n,messageWithBody:Object.assign({body:a.getBytes(!0)},n)}}getEncryptedMessage(e){return Ms(this,void 0,void 0,(function*(){const t=yield this.getMsgKey(e,!0),a=yield this.getAesKeyIv(t,!0);return{bytes:yield s.Z.invokeCrypto("aes-encrypt",e,a[0],a[1]),msgKey:t}}))}getDecryptedMessage(e,t){return this.getAesKeyIv(e,!1).then((e=>s.Z.invokeCrypto("aes-decrypt",t,e[0],e[1])))}getEncryptedOutput(e){const t=new us({startMaxLength:e.body.length+2048});t.storeIntBytes(this.serverSalt,64,"salt"),t.storeIntBytes(this.sessionId,64,"session_id"),t.storeLong(e.msg_id,"message_id"),t.storeInt(e.seq_no,"seq_no"),t.storeInt(e.body.length,"message_data_length"),t.storeRawBytes(e.body,"message_data");const a=t.getBuffer(),s=16-t.getOffset()%16+16*(1+(0,Ee.d)(8)%5),n=k(new Uint8Array(s)),i=(0,_s.Z)(a,n);return this.getEncryptedMessage(i).then((e=>{const t=new us({startMaxLength:e.bytes.length+256});return t.storeIntBytes(this.authKeyId,64,"auth_key_id"),t.storeIntBytes(e.msgKey,128,"msg_key"),t.storeRawBytes(e.bytes,"encrypted_data"),t.getBytes(!0)}))}sendEncryptedRequest(e){return Ms(this,void 0,void 0,(function*(){const t=yield this.getEncryptedOutput(e);this.transport||this.log.error("trying to send something when offline",this.transport,this),this.debug&&this.log.debug("sending:",e,[e.msg_id].concat(e.inner||[]),t.length);const a=this.transport?this.transport.send(t):Promise.reject({});if(!(this.transport instanceof I))return a;const s={code:406,type:"NETWORK_BAD_RESPONSE",transport:this.transport};return a.then((e=>{if(!(null==e?void 0:e.byteLength))throw s;return e}),(e=>{throw e.message||e.type||(e=Object.assign(s,{type:"NETWORK_BAD_REQUEST",originalError:e})),e}))}))}parseResponse(e){this.lastResponseTime=Date.now();const t=new ys(e),a=t.fetchIntBytes(64,!0,"auth_key_id");if(!(0,Ps.Z)(a,this.authKeyId))throw new Error("[MT] Invalid server auth_key_id: "+E(a));const s=t.fetchIntBytes(128,!0,"msg_key"),n=t.fetchRawBytes(e.byteLength-t.getOffset(),!0,"encrypted_data");return this.getDecryptedMessage(s,n).then((e=>this.getMsgKey(e,!1).then((t=>{if(!(0,Ps.Z)(s,t))throw this.log.warn("[MT] msg_keys",s,t),this.updateSession(),new Error("[MT] server msgKey mismatch, updating session");let a=new ys(e,{mtproto:!0});a.fetchIntBytes(64,!0,"salt");const n=a.fetchIntBytes(64,!0,"session_id"),i=a.fetchLong("message_id");if(!((0,Ps.Z)(n,this.sessionId)||this.prevSessionId&&(0,Ps.Z)(n,this.prevSessionId)))throw this.log.warn("Sessions",n,this.sessionId,this.prevSessionId,e),new Error("[MT] Invalid server session_id: "+E(n));const r=a.fetchInt("seq_no"),o=e.byteLength,p=a.fetchInt("message_data[length]");let d=a.getOffset();if(p%4||p>o-d)throw new Error("[MT] Invalid body length: "+p);const f=a.fetchRawBytes(p,!0,"message_data");d=a.getOffset();const c=o-d;if(c<12||c>1024)throw new Error("[MT] Invalid padding length: "+c);return a=new ys(f,{mtproto:!0,override:{mt_message:(e,t)=>{e.msg_id=a.fetchLong(t+"[msg_id]"),e.seqno=a.fetchInt(t+"[seqno]"),e.bytes=a.fetchInt(t+"[bytes]");const s=a.getOffset();try{e.body=a.fetchObject("Object",t+"[body]")}catch(t){this.log.error("parse error",t.message,t.stack),e.body={_:"parse_error",error:t}}a.getOffset()!==s+e.bytes&&a.setOffset(s+e.bytes)},mt_rpc_result:(e,t)=>{e.req_msg_id=a.fetchLong(t+"[req_msg_id]");const s=this.sentMessages[e.req_msg_id],n=s&&s.resultType||"Object";e.req_msg_id&&!s||(e.result=a.fetchObject(n,t+"[result]"))}}}),{response:a.fetchObject("","INPUT"),messageId:i,sessionId:n,seqNo:r}}))))}applyServerSalt(e){const t=(a=e,vs((s=ns()(a),new Uint8Array(s.toArray(256).value)).reverse(),8,!0,!1,!1));var a,s;qa.Z.set({["dc"+this.dcId+"_server_salt"]:E(t)}),this.serverSalt=new Uint8Array(t)}scheduleRequest(e){this.transport instanceof I&&(this.offline&&this.checkConnection("forced schedule"),e||(e=0));const t=Date.now()+(e||0);if(this.nextReq&&(void 0===e||this.nextReq<=t))return;this.nextReqTimeout&&clearTimeout(this.nextReqTimeout);const a=()=>{this.nextReqTimeout=0,this.nextReq=0,this.transport instanceof I&&this.offline||this.performScheduledRequest()};this.nextReq=t,void 0!==e?this.nextReqTimeout=T.Z.setTimeout(a,e):a()}ackMessage(e){let t;this.pendingAcks.push(e),this.transport instanceof I&&(t=3e4),this.scheduleRequest(t)}reqResend(e){this.debug&&this.log.debug("Req resend",e),this.pendingResendReq.push(e),this.scheduleRequest(100)}cleanupSent(){let e=!1;const t=this.sentMessages;return Object.keys(t).forEach((a=>{const s=t[a];if(s.notContentRelated&&void 0===this.pendingMessages[a])delete t[a];else if(s.container){for(const a of s.inner)if(void 0!==t[a])return void(e=!0);delete t[a]}else e=!0})),!e}processMessageAck(e){const t=this.sentMessages[e];t&&!t.acked&&(t.acked=!0)}processError(e){const t=(e.error_message||"").match(/^([A-Z_0-9]+\b)(: (.+))?/)||[];return e.error_code=e.error_code,{code:!e.error_code||e.error_code<=0?500:e.error_code,type:t[1]||"UNKNOWN",description:t[3]||"CODE#"+e.error_code+" "+e.error_message,originalError:e}}resend(){const e=this.sentMessages;for(const t in e){const a=e[t];(a.body||a.container)&&this.pushResend(t)}this.transport.connection&&(this.clearPingDelayDisconnect(),this.sendPingDelayDisconnect())}applyServerTime(e){const t=ns()(e).shiftRight(32).toJSNumber();return this.log("applying server time",t),this.timeManager.applyServerTime(t)}processMessage(e,t,a){if("messageEmpty"!==e._)if(parseInt(t.substr(0,-10),10)%2)this.log.warn("Server even message id: ",t,e);else switch(this.debug&&this.log.debug("process message",e,t),this.pingDelayDisconnectDeferred&&this.pingDelayDisconnectDeferred.resolve("any message"),e._){case"msg_container":for(const t of e.messages)this.processMessage(t,t.msg_id,a);break;case"bad_server_salt":this.log("Bad server salt",e),this.applyServerSalt(e.new_server_salt),this.sentMessages[e.bad_msg_id]&&this.pushResend(e.bad_msg_id),this.ackMessage(t);break;case"bad_msg_notification":switch(this.log.error("Bad msg notification",e),e.error_code){case 16:case 17:case 32:case 33:case 64:{const a=this.applyServerTime(t);(17===e.error_code||a)&&(this.log("Update session"),this.updateSession());const s=this.updateSentMessage(e.bad_msg_id);s&&this.pushResend(s.msg_id)}}break;case"message":if(-1!==this.lastServerMessages.indexOf(t))return void this.ackMessage(t);this.lastServerMessages.push(t),this.lastServerMessages.length>100&&this.lastServerMessages.shift(),this.processMessage(e.body,e.msg_id,a);break;case"new_session_created":this.ackMessage(t),this.debug&&this.log.debug("new_session_created",e),this.processMessageAck(e.first_msg_id),this.applyServerSalt(e.server_salt),qa.Z.get("dc").then((t=>{t===this.dcId&&!this.isFileNetworker&&this.networkerFactory.updatesProcessor&&this.networkerFactory.updatesProcessor(e)}));break;case"msgs_ack":this.debug&&this.log("got acks",e.msg_ids);for(const t of e.msg_ids)this.processMessageAck(t);break;case"msg_detailed_info":if(!this.sentMessages[e.msg_id]){this.ackMessage(e.answer_msg_id);break}case"msg_new_detailed_info":if(-1!==this.pendingAcks.indexOf(e.answer_msg_id))break;this.reqResend(e.answer_msg_id);break;case"msgs_state_info":{this.ackMessage(e.answer_msg_id);const t=[[this.lastResendReq,this.pendingResendReq]];for(const[a,s]of t)if((null==a?void 0:a.reqMsgId)===e.req_msg_id&&s.length)for(const e of a.msgIds){const t=s.indexOf(e);-1!==t&&s.splice(t,1)}break}case"rpc_result":{this.ackMessage(t);const a=e.req_msg_id,s=this.sentMessages[a];if(this.debug&&this.log("Rpc response",e.result,s),this.processMessageAck(a),s){const t=s.deferred;if("rpc_error"===e.result._){const a=this.processError(e.result);this.log("Rpc error",a),t&&t.reject(a)}else t&&t.resolve(e.result),s.isAPI&&!this.connectionInited&&(this.connectionInited=!0);delete this.sentMessages[a]}else this.debug&&this.log("Rpc result for unknown message:",a,e);break}case"pong":{const t=e.ping_id;if(this.lastPingDelayDisconnectId===t){const e=this.pingDelayDisconnectDeferred;e?e.resolve("pong"):this.log("ping deferred deleted",t)}break}default:this.ackMessage(t),null!==this.networkerFactory.updatesProcessor&&this.networkerFactory.updatesProcessor(e)}else this.log.warn("processMessage: messageEmpty",e,t)}}class As extends G{constructor(){super(...arguments),this.networkers=[],this.language=navigator.language||_.Z.langPackCode,this.updatesProcessor=null,this.akStopped=!1}onConnectionStatusChange(e){this.rootScope.dispatchEvent("connection_status_change",e)}removeNetworker(e){(0,M.Z)(this.networkers,e)}setUpdatesProcessor(e){this.updatesProcessor=e}getNetworker(e,t,a,s,n){const i=new ws(this,this.timeManager,e,t,a,s,n);return this.networkers.push(i),i}startAll(){if(this.akStopped){const e=this.networkers.filter((e=>e.isStopped()));this.akStopped=!1,this.updatesProcessor&&this.updatesProcessor({_:"new_session_created"});for(const t of e)t.scheduleRequest()}}stopAll(){this.akStopped=!0}setLanguage(e){this.language=e;for(const e of this.networkers)e.isFileNetworker||(e.connectionInited=!1)}unsetConnectionInited(){for(const e of this.networkers)e.connectionInited=!1}forceReconnectTimeout(){for(const e of this.networkers)e.forceReconnectTimeout()}forceReconnect(){for(const e of this.networkers)if(!e.isFileNetworker){e.forceReconnect();break}}}const Us=new class{constructor(){this.testPublicKeysHex=[{modulus:"c8c11d635691fac091dd9489aedced2932aa8a0bcefef05fa800892d9b52ed03200865c9e97211cb2ee6c7ae96d3fb0e15aeffd66019b44a08a240cfdd2868a85e1f54d6fa5deaa041f6941ddf302690d61dc476385c2fa655142353cb4e4b59f6e5b6584db76fe8b1370263246c010c93d011014113ebdf987d093f9d37c2be48352d69a1683f8f6e6c2167983c761e3ab169fde5daaa12123fa1beab621e4da5935e9c198f82f35eae583a99386d8110ea6bd1abb0f568759f62694419ea5f69847c43462abef858b4cb5edc84e7b9226cd7bd7e183aa974a712c079dde85b9dc063b8a5c08e8f859c0ee5dcd824c7807f20153361a7f63cfd2a433a1be7f5",exponent:"010001"}],this.publisKeysHex=[{modulus:"e8bb3305c0b52c6cf2afdf7637313489e63e05268e5badb601af417786472e5f93b85438968e20e6729a301c0afc121bf7151f834436f7fda680847a66bf64accec78ee21c0b316f0edafe2f41908da7bd1f4a5107638eeb67040ace472a14f90d9f7c2b7def99688ba3073adb5750bb02964902a359fe745d8170e36876d4fd8a5d41b2a76cbff9a13267eb9580b2d06d10357448d20d9da2191cb5d8c93982961cdfdeda629e37f1fb09a0722027696032fe61ed663db7a37f6f263d370f69db53a0dc0a1748bdaaff6209d5645485e6e001d1953255757e4b8e42813347b11da6ab500fd0ace7e6dfa3736199ccaf9397ed0745a427dcfa6cd67bcb1acff3",exponent:"010001"}],this.publicKeysParsed={},this.prepared=!1,this.preparePromise=null,b.Z.test&&(this.publisKeysHex=this.testPublicKeysHex)}prepare(){return this.preparePromise?this.preparePromise:this.prepared?Promise.resolve():this.preparePromise=Promise.all(this.publisKeysHex.map((e=>{const t=new us;t.storeBytes((0,Ha.Z)(e.modulus),"n"),t.storeBytes((0,Ha.Z)(e.exponent),"e");const a=t.getBuffer();return s.Z.invokeCrypto("sha1",a).then((t=>{const a=t.slice(-8);a.reverse(),this.publicKeysParsed[E(a).toLowerCase()]={modulus:e.modulus,exponent:e.exponent}}))}))).then((()=>{this.prepared=!0,this.preparePromise=null}))}select(e){return t=this,a=void 0,n=function*(){yield this.prepare();for(let t=0;t{if(d.ZP&&this.log("mtpSendPlainRequest: in good sector",e),!e||!e.byteLength)throw o;try{const t=new ys(e,{mtproto:!0});if(4===e.length){const e=t.fetchInt();throw this.log.error("mtpSendPlainRequest: wrong response, error code:",e),e}const a=t.fetchLong("auth_key_id");"0"!==a&&this.log.error("auth_key_id !== 0",a);const s=t.fetchLong("msg_id");"0"===s&&this.log.error("msg_id === 0",s);const n=t.fetchInt("msg_len");return n||this.log.error("no msg_len",n),t}catch(e){throw this.log.error("mtpSendPlainRequest: deserialization went bad",e),Object.assign(o,{originalError:e})}}),(e=>{throw e.message||e.type||(e=Object.assign(o,{originalError:e})),e}))}sendReqPQ(e){return Es(this,void 0,void 0,(function*(){const t=new us({mtproto:!0});let a;t.storeMethod("req_pq_multi",{nonce:e.nonce}),d.ZP&&this.log("Send req_pq",E(e.nonce));try{const s=this.sendPlainRequest(e.dcId,t.getBytes(!0));Us.prepare(),a=yield s}catch(e){throw this.log.error("req_pq error",e.message),e}const n=a.fetchObject("ResPQ");if("resPQ"!==n._)throw new Error("[MT] resPQ response invalid: "+n._);if(!(0,Ps.Z)(e.nonce,n.nonce))throw this.log.error(e.nonce,n.nonce),new Error("[MT] resPQ nonce mismatch");e.serverNonce=n.server_nonce,e.pq=n.pq,e.fingerprints=n.server_public_key_fingerprints,d.ZP&&this.log("Got ResPQ",E(e.serverNonce),E(e.pq),e.fingerprints);const i=yield Us.select(e.fingerprints);if(!i)throw new Error("[MT] No public key found");e.publicKey=i,d.ZP&&this.log("PQ factorization start",e.pq);try{var r=yield s.Z.invokeCrypto("factorize",e.pq)}catch(e){throw this.log.error("worker error factorize",e),e}return e.p=r[0],e.q=r[1],d.ZP&&this.log("PQ factorization done",r),this.sendReqDhParams(e)}))}sendReqDhParams(e){return Es(this,void 0,void 0,(function*(){e.newNonce=k(new Uint8Array(32));const t={_:"p_q_inner_data_dc",pq:e.pq,p:e.p,q:e.q,nonce:e.nonce,server_nonce:e.serverNonce,new_nonce:e.newNonce,dc:0},a=new us({mtproto:!0});a.storeObject(t,"P_Q_inner_data","DECRYPTED_DATA");const n=a.getBytes(!0);if(n.length>144)throw"DH_params: data is more than 144 bytes!";const i=vs(n,192,!1,!0,!1),r=i.slice().reverse(),o=yield(()=>Es(this,void 0,void 0,(function*(){for(;;){const t=k(new Uint8Array(32)),a=r.concat(yield s.Z.invokeCrypto("sha256",t.concat(i)));if(224!==a.length)throw"DH_params: dataWithHash !== 224 bytes!";const n=yield s.Z.invokeCrypto("aes-encrypt",a,t,new Uint8Array([0])),o=Ds(t,yield s.Z.invokeCrypto("sha256",n)).concat(n),p=fs(o),d=ns()(e.publicKey.modulus,16);if(-1===p.compare(d))return o}})))(),p=vs(yield s.Z.invokeCrypto("rsa-encrypt",o,e.publicKey),256,!0,!0,!0),f={nonce:e.nonce,server_nonce:e.serverNonce,p:e.p,q:e.q,public_key_fingerprint:e.publicKey.fingerprint,encrypted_data:p},c=new us({mtproto:!0});c.storeMethod("req_DH_params",f);const l=c.getBytes(!0);let m;d.ZP&&this.log("Send req_DH_params",f);try{m=yield this.sendPlainRequest(e.dcId,l)}catch(e){throw this.log.error("Send req_DH_params FAIL!",e),e}const g=m.fetchObject("Server_DH_Params","RESPONSE");if(d.ZP&&this.log("Sent req_DH_params, response:",g),"server_DH_params_fail"!==g._&&"server_DH_params_ok"!==g._)throw new Error("[MT] Server_DH_Params response invalid: "+g._);if(!(0,Ps.Z)(e.nonce,g.nonce))throw new Error("[MT] Server_DH_Params nonce mismatch");if(!(0,Ps.Z)(e.serverNonce,g.server_nonce))throw new Error("[MT] Server_DH_Params server_nonce mismatch");if("server_DH_params_fail"===g._){const t=(yield s.Z.invokeCrypto("sha1",e.newNonce)).slice(-16);if(!(0,Ps.Z)(t,g.new_nonce_hash))throw new Error("[MT] server_DH_params_fail new_nonce_hash mismatch");throw new Error("[MT] server_DH_params_fail")}try{yield this.decryptServerDhDataAnswer(e,g.encrypted_answer)}catch(e){throw this.log.error("mtpDecryptServerDhDataAnswer FAILED!",e),e}return this.sendSetClientDhParams(e)}))}decryptServerDhDataAnswer(e,t){return Es(this,void 0,void 0,(function*(){e.localTime=Date.now(),e.tmpAesKey=(yield s.Z.invokeCrypto("sha1",e.newNonce.concat(e.serverNonce))).concat((yield s.Z.invokeCrypto("sha1",e.serverNonce.concat(e.newNonce))).slice(0,12)),e.tmpAesIv=(yield s.Z.invokeCrypto("sha1",e.serverNonce.concat(e.newNonce))).slice(12).concat(yield s.Z.invokeCrypto("sha1",e.newNonce.concat(e.newNonce)),e.newNonce.slice(0,4));const a=new Uint8Array(yield s.Z.invokeCrypto("aes-decrypt",t,e.tmpAesKey,e.tmpAesIv)),n=a.slice(0,20),i=a.slice(20),r=new ys(i,{mtproto:!0}),o=r.fetchObject("Server_DH_inner_data");if("server_DH_inner_data"!==o._)throw new Error("[MT] server_DH_inner_data response invalid: "+o);if(!(0,Ps.Z)(e.nonce,o.nonce))throw new Error("[MT] server_DH_inner_data nonce mismatch");if(!(0,Ps.Z)(e.serverNonce,o.server_nonce))throw new Error("[MT] server_DH_inner_data serverNonce mismatch");d.ZP&&this.log("Done decrypting answer"),e.g=o.g,e.dhPrime=o.dh_prime,e.gA=o.g_a,e.serverTime=o.server_time,e.retry=0,this.verifyDhParams(e.g,e.dhPrime,e.gA);const p=r.getOffset();if(!(0,Ps.Z)(n,yield s.Z.invokeCrypto("sha1",i.slice(0,p))))throw new Error("[MT] server_DH_inner_data SHA1 mismatch");this.timeManager.applyServerTime(e.serverTime,e.localTime)}))}verifyDhParams(e,t,a){d.ZP&&this.log("Verifying DH params",e,t,a);const s=E(t);if(3!==e||"c71caeb9c6b1c9048e6c522f70f13f73980d40238e3e21c14934d037563d930f48198a0aa7c14058229493d22530f4dbfa336f6e0ac925139543aed44cce7c3720fd51f69458705ac68cd4fe6b6b13abdc9746512969328454f18faf8c595f642477fe96bb2a941d5bcd1d4ac8cc49880708fa9b378e3c4f3a9060bee67cf9a4a4a695811051907e162753b56b0f6b410dba74d8a84b2a14b3144e0ef1284754fd17ed950d5965b4b9dd46582db1178d169c6bc465b0d6ff9ca3928fef5b9ae4e418fc15e83ebea0f87fa9ff5eed70050ded2849f47bf959d956850ce929851f0d8115f635b105ee2e4e15d04b2454bf6f4fadf034b10403119cd8e3b92fcc5b"!==s)throw new Error("[MT] DH params are not verified: unknown dhPrime");d.ZP&&this.log("dhPrime cmp OK");const n=fs(a),i=ns()(s,16);if(n.compare(ns().one)<=0)throw new Error("[MT] DH params are not verified: gA <= 1");if(n.compare(i.subtract(ns().one))>=0)throw new Error("[MT] DH params are not verified: gA >= dhPrime - 1");d.ZP&&this.log("1 < gA < dhPrime-1 OK");const r=ns()(2).pow(1984);if(n.compare(r)<0)throw new Error("[MT] DH params are not verified: gA < 2^{2048-64}");if(n.compare(i.subtract(r))>=0)throw new Error("[MT] DH params are not verified: gA > dhPrime - 2^{2048-64}");return d.ZP&&this.log("2^{2048-64} < gA < dhPrime-2^{2048-64} OK"),!0}sendSetClientDhParams(e){return Es(this,void 0,void 0,(function*(){const t=(0,Ha.Z)(e.g.toString(16));e.b=k(new Uint8Array(256));try{var a=yield s.Z.invokeCrypto("mod-pow",t,e.b,e.dhPrime)}catch(e){throw e}const n=new us({mtproto:!0});n.storeObject({_:"client_DH_inner_data",nonce:e.nonce,server_nonce:e.serverNonce,retry_id:[0,e.retry++],g_b:a},"Client_DH_Inner_Data");const i=(yield s.Z.invokeCrypto("sha1",n.getBuffer())).concat(n.getBytes(!0)),r=yield s.Z.invokeCrypto("aes-encrypt",i,e.tmpAesKey,e.tmpAesIv),o=new us({mtproto:!0});let p;o.storeMethod("set_client_DH_params",{nonce:e.nonce,server_nonce:e.serverNonce,encrypted_data:r}),d.ZP&&this.log("Send set_client_DH_params");try{p=yield this.sendPlainRequest(e.dcId,o.getBytes(!0))}catch(e){throw e}const f=p.fetchObject("Set_client_DH_params_answer");if("dh_gen_ok"!==f._&&"dh_gen_retry"!==f._&&"dh_gen_fail"!==f._)throw new Error("[MT] Set_client_DH_params_answer response invalid: "+f._);if(!(0,Ps.Z)(e.nonce,f.nonce))throw new Error("[MT] Set_client_DH_params_answer nonce mismatch");if(!(0,Ps.Z)(e.serverNonce,f.server_nonce))throw new Error("[MT] Set_client_DH_params_answer server_nonce mismatch");try{var c=yield s.Z.invokeCrypto("mod-pow",e.gA,e.b,e.dhPrime)}catch(e){throw c}const l=yield s.Z.invokeCrypto("sha1",c),m=l.slice(0,8),g=l.slice(-8);switch(d.ZP&&this.log("Got Set_client_DH_params_answer",f._,c),f._){case"dh_gen_ok":{const t=(yield s.Z.invokeCrypto("sha1",e.newNonce.concat([1],m))).slice(-16);if(!(0,Ps.Z)(t,f.new_nonce_hash1))throw this.log.error("Set_client_DH_params_answer new_nonce_hash1 mismatch",t,f),new Error("new_nonce_hash1 mismatch");const a=Ds(e.newNonce.slice(0,8),e.serverNonce.slice(0,8));return d.ZP&&this.log("Auth successfull!",g,c,a),e.authKeyId=g,e.authKey=c,e.serverSalt=a,e}case"dh_gen_retry":{const t=(yield s.Z.invokeCrypto("sha1",e.newNonce.concat([2],m))).slice(-16);if(!(0,Ps.Z)(t,f.new_nonce_hash2))throw new Error("[MT] Set_client_DH_params_answer new_nonce_hash2 mismatch");return this.sendSetClientDhParams(e)}case"dh_gen_fail":{const t=(yield s.Z.invokeCrypto("sha1",e.newNonce.concat([3],m))).slice(-16);if(!(0,Ps.Z)(t,f.new_nonce_hash3))throw new Error("[MT] Set_client_DH_params_answer new_nonce_hash3 mismatch");throw new Error("[MT] Set_client_DH_params_answer fail")}}}))}getTransportType(){return this.getTransportTypePromise?this.getTransportTypePromise:this.getTransportTypePromise=Z.pingTransports().then((({websocket:e})=>{this.transportType=e?"websocket":"https",this.log("will use transport:",this.transportType)}))}auth(e){let t=this.cached[e];return t||(t=new Promise(((t,a)=>Es(this,void 0,void 0,(function*(){let s;yield this.getTransportType();let n=1;for(;n++<=3;)try{const a={dcId:e,nonce:k(new Uint8Array(16))},s=this.sendReqPQ(a);return void t(yield s)}catch(e){s=e}a(s)})))),this.cached[e]=t)}}class Fs extends G{after(){this.lastMessageId=[0,0],this.timeOffset=0,qa.Z.get("server_time_offset").then((e=>{e&&(this.timeOffset=e)}))}getServerTimeOffset(){return this.timeOffset}generateId(){const e=Date.now();let t=[Math.floor(e/1e3)+this.timeOffset,e%1e3<<21|(0,Ee.d)(16)<<3|4];return(this.lastMessageId[0]>t[0]||this.lastMessageId[0]===t[0]&&this.lastMessageId[1]>=t[1])&&(t=[this.lastMessageId[0],this.lastMessageId[1]+4]),this.lastMessageId=t,rs(t[0],t[1]).toString(10)}applyServerTime(e,t){const a=e-(t=(t||Date.now())/1e3|0),s=Math.abs(this.timeOffset-a)>10;return this.lastMessageId=[0,0],this.timeOffset!==a&&(qa.Z.set({server_time_offset:a}),this.timeOffset=a),s}}class Rs{saveWebDocument(e){if(!e)return;const t=e.attributes.find((e=>"documentAttributeImageSize"===e._));return t&&(e.w=t.w,e.h=t.h),e}}class xs extends G{getInputInvoiceBySlug(e){return{_:"inputInvoiceSlug",slug:e}}getInputInvoiceByPeerId(e,t){return{_:"inputInvoiceMessage",peer:this.appPeersManager.getInputPeerById(e),msg_id:(0,oe.Z)(t)}}getPaymentForm(e){return this.apiManager.invokeApi("payments.getPaymentForm",{invoice:e}).then((e=>(this.appUsersManager.saveApiUsers(e.users),e)))}getPaymentReceipt(e,t){return this.apiManager.invokeApi("payments.getPaymentReceipt",{peer:this.appPeersManager.getInputPeerById(e),msg_id:(0,oe.Z)(t)}).then((e=>(this.appUsersManager.saveApiUsers(e.users),e)))}validateRequestedInfo(e,t,a){return this.apiManager.invokeApi("payments.validateRequestedInfo",{save:a,invoice:e,info:t})}sendPaymentForm(e,t,a,s,n,i){return this.apiManager.invokeApi("payments.sendPaymentForm",{form_id:t,invoice:e,requested_info_id:a,shipping_option_id:s,credentials:n,tip_amount:i||void 0}).then((e=>("payments.paymentResult"===e._&&this.apiUpdatesManager.processUpdateMessage(e.updates),e)))}clearSavedInfo(e,t){return this.apiManager.invokeApi("payments.clearSavedInfo",{info:e,credentials:t})}}var Bs=a(8794);class Vs extends G{constructor(){super(...arguments),this.clear=(e=!1)=>{e?this.attachMenuBots=new Map:(this.attachMenuBots.clear(),this.attachMenuBotsArr=void 0)},this.onUpdateAttachMenuBots=e=>{this.clear(),this.getAttachMenuBots()}}after(){this.clear(!0),this.apiUpdatesManager.addMultipleEventsListeners({updateAttachMenuBots:this.onUpdateAttachMenuBots})}saveAttachMenuBot(e){this.attachMenuBots.set(e.bot_id,e);const t=(0,Bs.Z)(e);return t.icon=this.appDocsManager.saveDoc(t.icon,{type:"attachMenuBotIcon",botId:e.bot_id}),e}saveAttachMenuBots(e){e.saved||(e.saved=!0,e.forEach((e=>this.saveAttachMenuBot(e))))}getAttachMenuBots(){var e;return null!==(e=this.attachMenuBotsArr)&&void 0!==e?e:this.apiManager.invokeApiSingleProcess({method:"messages.getAttachMenuBots",processResult:e=>((0,ue.Z)(e),this.appUsersManager.saveApiUsers(e.users),this.saveAttachMenuBots(e.bots),this.attachMenuBotsArr=e.bots.slice(0,0))})}getAttachMenuBotCached(e){return this.attachMenuBots.get(e)}getAttachMenuBot(e,t){throw this.appUsersManager.isAttachMenuBot(e),(0,X.Z)("BOT_INVALID")}requestWebView(e){const{botId:t,peerId:a,url:s,fromBotMenu:n,themeParams:i,replyToMsgId:r,silent:o,sendAsPeerId:p,startParam:d,threadId:f}=e;return this.apiManager.invokeApiSingleProcess({method:"messages.requestWebView",params:{peer:this.appPeersManager.getInputPeerById(a),bot:this.appUsersManager.getUserInput(t),silent:o,platform:"web",url:s,reply_to_msg_id:r?(0,oe.Z)(r):void 0,from_bot_menu:n,theme_params:i,send_as:p?this.appPeersManager.getInputPeerById(p):void 0,start_param:d,top_msg_id:f?(0,oe.Z)(f):void 0},processResult:e=>(console.log(e),e)})}prolongWebView(e){return this.apiManager.invokeApiSingleProcess({method:"messages.prolongWebView",params:{peer:this.appPeersManager.getInputPeerById(e.peerId),bot:this.appUsersManager.getUserInput(e.botId),query_id:e.queryId,silent:e.silent,reply_to_msg_id:e.replyToMsgId?(0,oe.Z)(e.replyToMsgId):void 0,send_as:e.sendAsPeerId?this.appPeersManager.getInputPeerById(e.sendAsPeerId):void 0,top_msg_id:e.threadId?(0,oe.Z)(e.threadId):void 0},processResult:e=>{console.log(e)}})}}class Os extends G{requestUrlAuth(e,t,a,s){return this.apiManager.invokeApi("messages.requestUrlAuth",{button_id:s,msg_id:a?(0,oe.Z)(a):void 0,peer:t?this.appPeersManager.getInputPeerById(t):void 0,url:e}).then((e=>("urlAuthResultRequest"===e._&&this.appUsersManager.saveApiUser(e.bot),e)))}acceptUrlAuth(e,t,a,s,n){return this.apiManager.invokeApi("messages.acceptUrlAuth",{button_id:s,msg_id:a?(0,oe.Z)(a):void 0,peer:t?this.appPeersManager.getInputPeerById(t):void 0,url:e,write_allowed:n}).then((e=>e))}getWebAuthorizations(){return this.apiManager.invokeApi("account.getWebAuthorizations").then((e=>(this.appUsersManager.saveApiUsers(e.users),e.authorizations)))}resetWebAuthorization(e){return this.apiManager.invokeApi("account.resetWebAuthorization",{hash:e})}resetWebAuthorizations(){return this.apiManager.invokeApi("account.resetWebAuthorizations")}}class Ls extends G{after(){this.wallPapers={}}saveWallPaper(e){return e?("wallPaperNoFile"!==e._&&(e.document=this.appDocsManager.saveDoc(e.document,{type:"wallPaper",wallPaperId:e.id})),this.wallPapers[e.id]=e,e):e}getWallPaper(e){return this.apiManager.invokeApiSingleProcess({method:"account.getWallPaper",params:{wallpaper:e},processResult:e=>this.saveWallPaper(e)})}getInputWallPaper(e){return"string"==typeof e?{_:"inputWallPaperSlug",slug:e}:"wallPaperNoFile"===e._?{_:"inputWallPaperNoFile",id:e.id}:{_:"inputWallPaper",id:e.id,access_hash:e.access_hash}}getWallPaperById(e){const t=this.wallPapers[e];return this.getWallPaper(this.getInputWallPaper(t))}getThemes(){return this.apiManager.invokeApiSingleProcess({method:"account.getThemes",params:{format:"macos",hash:0},processResult:e=>((0,ue.Z)(e),e.themes.forEach((e=>{e.settings&&e.settings.forEach((e=>{e.wallpaper=this.saveWallPaper(e.wallpaper)}))})),e.themes)})}getWallPapers(){return this.apiManager.invokeApiHashable({method:"account.getWallPapers"}).then((e=>{const t=e.wallpapers;return t.forEach(((e,t,a)=>{a[t]=this.saveWallPaper(e)})),t}))}}const Ns=new class{constructor(){this.cryptoWorkersURLs=[],this.cryptoPortsAttached=0,this.cryptoPortPromise=(0,v.Z)(),this.cryptoPortPromise.then((()=>{this.cryptoPortPromise=void 0}))}start(){const e=f.Z.getInstance();e.addEventListener("manager",(({name:e,method:t,args:a})=>(0,q.Z)(this.getManagers(),(s=>{const n=s[e];return n[t].apply(n,a)})))),e.addEventListener("cryptoPort",((e,t,a)=>{var n;const i=a.ports[0];this.cryptoPortsAttached>=this.cryptoWorkersURLs.length?i.close():(++this.cryptoPortsAttached,s.Z.attachPort(i),null===(n=this.cryptoPortPromise)||void 0===n||n.resolve())})),e.addEventListener("createProxyWorkerURLs",(({originalUrl:e,blob:t})=>{let a=this.cryptoWorkersURLs.length;a||(this.cryptoWorkersURLs.push(e),++a);const s=_.Z.cryptoWorkers;if(a===s)return this.cryptoWorkersURLs;const n=new Array(s-a).fill(void 0).map((()=>URL.createObjectURL(t)));return this.cryptoWorkersURLs.push(...n),this.cryptoWorkersURLs}))}createManagers(){return e=this,t=void 0,n=function*(){const e=new $;yield Promise.all([e.loadStorages(),this.cryptoPortPromise]);const t=yield function(e,t){const a={appPeersManager:new fa,appChatsManager:new Ve,appDocsManager:new yt,appPhotosManager:new ca,appPollsManager:new la,appUsersManager:new Aa,appWebPagesManager:new Da,appDraftsManager:new vt,appProfileManager:new ua,appNotificationsManager:new na,apiUpdatesManager:new Ue,appAvatarsManager:new De,appGroupCallsManager:new Ct,appCallsManager:new Fe,appReactionsManager:new ba,appMessagesManager:new ta,appMessagesIdsManager:new Tt,appPrivacyManager:new ma,appInlineBotsManager:new Dt,appStickersManager:new Ca,referenceDatabase:new ee,appEmojiManager:new St,filtersStorage:new Ce,dialogsStorage:new _e,apiManager:new Ja,cryptoWorker:s.Z,passwordManager:new Q,apiFileManager:new ja,peersStorage:new Qa,thumbsStorage:new Xa,networkerFactory:new As,rootScope:new l,authorizer:new Ts,dcConfigurator:new O,timeManager:new Fs,appStoragesManager:e,appStateManager:y,appWebDocsManager:new Rs,appPaymentsManager:new xs,appAttachMenuBotsManager:new Vs,appSeamlessLoginManager:new Os,appThemesManager:new Ls};for(const e in a){const t=a[e];t&&(t.setManagers&&(t.setManagers(a),delete t.setManagers),T.Z[e]=t)}const n=[];let i=Object.keys(a);i.unshift("appUsersManager","appChatsManager","appNotificationsManager","appMessagesManager","dialogsStorage"),i=(0,ke.Z)(i);for(const e of i){const t=a[e];if(null==t?void 0:t.after){const e=t.after();n.push(e)}}return t&&a.apiManager.setUserAuth(t),Promise.all(n).then((()=>a))}(e,y.userId);return this.managers=t},new((a=void 0)||(a=Promise))((function(s,i){function r(e){try{p(n.next(e))}catch(e){i(e)}}function o(e){try{p(n.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?s(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((n=n.apply(e,t||[])).next())}));var e,t,a,n}getManagers(){var e;return null!==(e=this.managers)&&void 0!==e?e:this.managers=this.createManagers()}};d.GO&&(d.GO.appManagersManager=Ns);const Zs=Ns;var js=a(3655);let qs,Gs,Hs=!0;function Ws(){return Hs}function zs(){return Hs?qs:void 0}const Ks=(0,S.kg)("MTPROTO"),Js=new f.Z;Js.addMultipleEventsListeners({environment:e=>{r(e),Z.waitForWebSocket()},crypto:({method:e,args:t})=>s.Z.invokeCrypto(e,...t),state:({state:e,resetStorages:t,pushedKeys:a,newVersion:s,oldVersion:n,userId:i})=>{Ks("got state",e,a),y.userId=i,y.newVersion=s,y.oldVersion=n,Object.keys(e).forEach((t=>{y.pushToState(t,e[t],!0,!a.includes(t))})),j.resolve(t)},toggleStorages:({enabled:e,clearWrite:t})=>(0,za.Z)(e,t),event:(e,t)=>{Ks("will redirect event",e,t),Js.invokeExceptSource("event",e,t)},serviceWorkerOnline:e=>{Hs=e},serviceWorkerPort:(e,t,a)=>{qs?(qs.detachPort(Gs),Gs=void 0):(qs=new js.Z,qs.addMultipleEventsListeners({requestFilePart:e=>(0,q.Z)(Zs.getManagers(),(t=>{const{docId:a,dcId:s,offset:n,limit:i}=e;return t.appDocsManager.requestDocPart(a,s,n,i)}))})),(Gs=a.ports[0])&&qs.attachPort(Gs)},createObjectURL:e=>URL.createObjectURL(e)}),Ks("MTProto start"),Zs.start(),Zs.getManagers(),Ht.start(),function(e,t,a){const s=(a,s)=>{e.attachListenPort(a),s&&e.attachSendPort(s),null==t||t(a)};e.setOnPortDisconnect((e=>{Ht.deleteTab(e)})),"undefined"!=typeof SharedWorkerGlobalScope?T.Z.addEventListener("connect",(e=>s(e.source,e.source))):"undefined"!=typeof ServiceWorkerGlobalScope?s(T.Z,null):s(T.Z,T.Z)}(Js,(e=>{Ht.addTab(e)}))},1507:(e,t,a)=>{a.d(t,{BP:()=>f,BX:()=>l,DZ:()=>h,Gu:()=>u,IA:()=>i,Iw:()=>p,J$:()=>m,NM:()=>s,Ox:()=>c,Pt:()=>d,Zi:()=>g,hj:()=>n,rU:()=>o,yF:()=>r});const s=0,n=1271266957,i=777,r=777e3,o=2147483647,p=20971520,d="",f="default_static",c=4295032831,l=new Set(["web","k","z"]),m=0,g=1,h=new Set([m,g]),u=Math.max(...Array.from(h))+1},2423:(e,t,a)=>{a.d(t,{$2:()=>l,E:()=>m,QB:()=>g,SC:()=>h,bu:()=>d,it:()=>p,kO:()=>y,tY:()=>u});var s=a(1229);const n="a-z\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u00ff\\u0100-\\u024f\\u0253\\u0254\\u0256\\u0257\\u0259\\u025b\\u0263\\u0268\\u026f\\u0272\\u0289\\u028b\\u02bb\\u0300-\\u036f\\u1e00-\\u1eff\\u0400-\\u04ff\\u0500-\\u0527\\u2de0-\\u2dff\\ua640-\\ua69f\\u0591-\\u05bf\\u05c1-\\u05c2\\u05c4-\\u05c5\\u05c7\\u05d0-\\u05ea\\u05f0-\\u05f4\\ufb1d-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40-\\ufb41\\ufb43-\\ufb44\\ufb46-\\ufb4f\\u0610-\\u061a\\u0620-\\u065f\\u066e-\\u06d3\\u06d5-\\u06dc\\u06de-\\u06e8\\u06ea-\\u06ef\\u06fa-\\u06fc\\u06ff\\u0750-\\u077f\\u08a0\\u08a2-\\u08ac\\u08e4-\\u08fe\\ufb50-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\u200c\\u0e01-\\u0e3a\\u0e40-\\u0e4e\\u1100-\\u11ff\\u3130-\\u3185\\uA960-\\uA97F\\uAC00-\\uD7AF\\uD7B0-\\uD7FF\\u3003\\u3005\\u303b\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uff9f\\uffa1-\\uffdc",i="0-9_"+n,r="["+n+"0-9]",o="((?:https?|ftp)://|mailto:)?",p=o+"(?:"+r+"{1,64}(?::"+r+"{0,64})?@)?(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}|"+r+"["+n+"·0-9-]{0,64}(?:\\."+r+"["+n+"·0-9-]{0,64}){0,10}(?:\\.(xn--[0-9a-z]{2,16}|["+n+"]{2,24})))(?::\\d{2,5})?(?:/(?:\\S{0,255}[^\\s.;,(\\[\\]{}<>\"'])?)?",d=(new RegExp("^"+o.slice(0,-1),"i"),/^((?:[^\/]+?):\/\/|mailto:)/),f="[a-zA-Z\\d_]{5,32}",c="\\/([a-zA-Z\\d_]{1,32})(?:@("+f+"))?(\\b|$)",l=new RegExp("(^| )(@)("+f+")|("+p+")|(\\n)|("+s.Z+")|(^|[\\s\\(\\]])(#["+i+"]{2,64})|(^|\\s)"+c+"|(?:\\s|^)((?:\\d{1,2}:)?(?:[0-5]?[0-9]):(?:[0-5][0-9]))(?:\\s|$)","i"),m=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,g=/(^|\s|\n)(````?)([\s\S]+?)(````?)([\s\n\.,:?!;]|$)|(^|\s|\x01)(`|~~|\*\*|__|_-_|\|\|)([^\n]+?)\7([\x01\s\.,:?!;]|$)|@(\d+)\s*\((.+?)\)|(\[(.+?)\]\((.+?)\))/m,h={"`":"messageEntityCode","``":"messageEntityPre","**":"messageEntityBold",__:"messageEntityItalic","~~":"messageEntityStrike","_-_":"messageEntityUnderline","||":"messageEntitySpoiler"},u=new Set(["messageEntityEmoji","messageEntityLinebreak","messageEntityCaret"]);for(const e in h)u.add(h[e]);const y=/^\+\d+$/},671:(e,t,a)=>{function s(e){return function(e){const t=[];let a=0,s=0,n=0;for(;n55296&&a<=56319?s=a:t.push(a.toString(16));return t.length&&2===t[0].length&&(t[0]="00"+t[0]),t}(r(e)).join("-")}a.d(t,{N0:()=>s});const n=/\uFE0F/g,i=String.fromCharCode(8205),r=e=>e.indexOf(i)<0?e.replace(n,""):e;new Map([["FT","🏴‍☠"]])}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var i=s[e]={id:e,loaded:!1,exports:{}};return a[e].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.m=a,n.x=()=>{var e=n.O(void 0,[699,211,147,85,110],(()=>n(9092)));return n.O(e)},e=[],n.O=(t,a,s,i)=>{if(!a){var r=1/0;for(f=0;f=i)&&Object.keys(n.O).every((e=>n.O[e](a[p])))?a.splice(p--,1):(o=!1,i0&&e[f-1][2]>i;f--)e[f]=e[f-1];e[f]=[a,s,i]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,a)=>(n.f[a](e,t),t)),[])),n.u=e=>85===e?"85.887945ef5f43bc205112.bundle.js":110===e?"110.b39868e78bf4adf7dd36.bundle.js":({211:"npm.big-integer",699:"npm.pako"}[e]||e)+"."+{8:"93d2f33af815eb0455aa",104:"f1b4b4be86382aaf84f5",147:"bb5274ee5cc526f48754",211:"363d763daad0ee4e2741",301:"95838a8203f23dd1ce8f",642:"be93122d1116ecdc9322",699:"89deb457201f16c93925"}[e]+".chunk.js",n.miniCssF=e=>{},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var a=t.getElementsByTagName("script");a.length&&(e=a[a.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{if(void 0!==n){var e=n.u,t=n.e,a={},s={};n.u=function(t){return e(t)+(a.hasOwnProperty(t)?"?"+a[t]:"")},n.e=function(i){return t(i).catch((function(t){var r=s.hasOwnProperty(i)?s[i]:999999;if(r<1){var o=e(i);throw t.message="Loading chunk "+i+" failed after 999999 retries.\n("+o+")",t.request=o,t}return new Promise((function(e){setTimeout((function(){var t=Date.now();a[i]=t,s[i]=r-1,e(n.e(i))}),3e3)}))}))}}})(),(()=>{var e={678:1};n.f.i=(t,a)=>{e[t]||importScripts(n.p+n.u(t))};var t=this.webpackChunktweb=this.webpackChunktweb||[],a=t.push.bind(t);t.push=t=>{var[s,i,r]=t;for(var o in i)n.o(i,o)&&(n.m[o]=i[o]);for(r&&r(n);s.length;)e[s.pop()]=1;a(t)}})(),t=n.x,n.x=()=>Promise.all([699,211,147,85,110].map(n.e,n)).then(t),n.x()})(); -//# sourceMappingURL=mtproto.worker.44189744893b344288e7.chunk.js.map \ No newline at end of file diff --git a/public/mtproto.worker.44189744893b344288e7.chunk.js.map b/public/mtproto.worker.44189744893b344288e7.chunk.js.map deleted file mode 100644 index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O,IAAIgtG,EAAoB5uG,EAAG4uG,IAAsBrsG,KAAKrL,G+HDrE03G,EAAoB9T,G","sources":["webpack://tweb/webpack/runtime/chunk loaded","webpack://tweb/webpack/runtime/startup chunk dependencies","webpack://tweb/./src/config/debug.ts","webpack://tweb/./src/config/emoji.ts","webpack://tweb/./src/environment/userAgent.ts","webpack://tweb/./src/helpers/cleanSearchText.ts","webpack://tweb/./src/helpers/fileName.ts","webpack://tweb/./src/helpers/restrictions.ts","webpack://tweb/./src/lib/appManagers/utils/peers/getPeerId.ts","webpack://tweb/./src/lib/files/idb.ts","webpack://tweb/./src/environment/utils.ts","webpack://tweb/./src/lib/rootScope.ts","webpack://tweb/./src/lib/appManagers/appStateManager.ts","webpack://tweb/./src/helpers/object/setDeepProperty.ts","webpack://tweb/./src/lib/mtproto/transports/http.ts","webpack://tweb/./src/lib/mtproto/transports/websocket.ts","webpack://tweb/./src/helpers/array/randomize.ts","webpack://tweb/./src/lib/mtproto/transports/obfuscation.ts","webpack://tweb/./src/lib/mtproto/transports/abridged.ts","webpack://tweb/./src/helpers/bytes/bytesToHex.ts","webpack://tweb/./src/lib/mtproto/transports/tcpObfuscated.ts","webpack://tweb/./src/lib/mtproto/dcConfigurator.ts","webpack://tweb/./src/lib/mtproto/transports/controller.ts","webpack://tweb/./src/lib/appManagers/utils/storages/resetStoragesPromise.ts","webpack://tweb/./src/lib/appManagers/manager.ts","webpack://tweb/./src/lib/appManagers/utils/storages/loadStorages.ts","webpack://tweb/./src/lib/appManagers/appStoragesManager.ts","webpack://tweb/./src/lib/appManagers/utils/storages/createStorages.ts","webpack://tweb/./src/lib/mtproto/passwordManager.ts","webpack://tweb/./src/lib/mtproto/referenceDatabase.ts","webpack://tweb/./src/helpers/object/safeReplaceObject.ts","webpack://tweb/./src/lib/appManagers/utils/messages/getPeerIdsFromMessage.ts","webpack://tweb/./src/lib/appManagers/utils/dialogs/setDialogIndex.ts","webpack://tweb/./src/lib/storages/dialogs.ts","webpack://tweb/./src/lib/storages/filters.ts","webpack://tweb/./src/helpers/applyMixins.ts","webpack://tweb/./src/lib/appManagers/apiUpdatesManager.ts","webpack://tweb/./src/lib/appManagers/appAvatarsManager.ts","webpack://tweb/./src/lib/appManagers/appCallsManager.ts","webpack://tweb/./src/lib/appManagers/appChatsManager.ts","webpack://tweb/./src/lib/langPack.ts","webpack://tweb/./src/lib/richTextProcessor/wrapUrl.ts","webpack://tweb/./src/helpers/dom/setInnerHTML.ts","webpack://tweb/./src/helpers/date.ts","webpack://tweb/./src/helpers/object/safeReplaceArrayInObject.ts","webpack://tweb/./src/environment/mimeTypeMap.ts","webpack://tweb/./src/lib/appManagers/appDocsManager.ts","webpack://tweb/./src/lib/appManagers/utils/docs/getDocumentURL.ts","webpack://tweb/./src/lib/appManagers/appDraftsManager.ts","webpack://tweb/./src/lib/appManagers/appEmojiManager.ts","webpack://tweb/./src/lib/appManagers/appGroupCallsManager.ts","webpack://tweb/./src/lib/appManagers/utils/photos/getPhotoInput.ts","webpack://tweb/./src/lib/appManagers/utils/photos/getPhotoMediaInput.ts","webpack://tweb/./src/lib/appManagers/utils/docs/getDocumentMediaInput.ts","webpack://tweb/./src/lib/appManagers/appInlineBotsManager.ts","webpack://tweb/./src/lib/appManagers/appMessagesIdsManager.ts","webpack://tweb/./src/helpers/string/splitStringByLength.ts","webpack://tweb/./src/lib/appManagers/appTabsManager.ts","webpack://tweb/./src/lib/appManagers/utils/docs/getDocumentInput.ts","webpack://tweb/./src/helpers/object/setBooleanFlag.ts","webpack://tweb/./src/lib/appManagers/appMessagesManager.ts","webpack://tweb/./src/lib/appManagers/utils/docs/getDocumentInputFileName.ts","webpack://tweb/./src/helpers/string/convertInputKeyToKey.ts","webpack://tweb/./src/lib/appManagers/appNotificationsManager.ts","webpack://tweb/./src/lib/appManagers/appPeersManager.ts","webpack://tweb/./src/lib/appManagers/appPhotosManager.ts","webpack://tweb/./src/lib/appManagers/appPollsManager.ts","webpack://tweb/./src/lib/appManagers/appPrivacyManager.ts","webpack://tweb/./src/lib/appManagers/appProfileManager.ts","webpack://tweb/./src/helpers/callbackifyAll.ts","webpack://tweb/./src/lib/appManagers/appReactionsManager.ts","webpack://tweb/./src/lib/appManagers/appStickersManager.ts","webpack://tweb/./src/helpers/fixBase64String.ts","webpack://tweb/./src/lib/appManagers/appUsersManager.ts","webpack://tweb/./src/helpers/cleanUsername.ts","webpack://tweb/./src/lib/appManagers/appWebPagesManager.ts","webpack://tweb/./src/helpers/blob/readBlobAsArrayBuffer.ts","webpack://tweb/./src/helpers/string/fileNameRFC.ts","webpack://tweb/./src/lib/files/downloadWriter.ts","webpack://tweb/./src/lib/files/downloadStorage.ts","webpack://tweb/./src/lib/mtproto/apiFileManager.ts","webpack://tweb/./src/helpers/fixFirefoxSvg.ts","webpack://tweb/./src/helpers/blob/readBlobAsUint8Array.ts","webpack://tweb/./src/lib/mtproto/api_methods.ts","webpack://tweb/./src/lib/mtproto/apiManager.ts","webpack://tweb/./src/lib/storages/peers.ts","webpack://tweb/./src/lib/storages/thumbs.ts","webpack://tweb/./src/lib/mtproto/schema.ts","webpack://tweb/./src/helpers/number/intToUint.ts","webpack://tweb/./src/helpers/long/ulongFromInts.ts","webpack://tweb/./src/helpers/bigInt/bigIntConstants.ts","webpack://tweb/./src/helpers/bigInt/bigIntConversion.ts","webpack://tweb/./src/lib/mtproto/tl_utils.ts","webpack://tweb/./src/helpers/gzipUncompress.ts","webpack://tweb/./src/helpers/bytes/addPadding.ts","webpack://tweb/./src/lib/mtproto/networker.ts","webpack://tweb/./src/helpers/long/sortLongsArray.ts","webpack://tweb/./src/helpers/long/longToBytes.ts","webpack://tweb/./src/lib/mtproto/networkerFactory.ts","webpack://tweb/./src/lib/mtproto/rsaKeysManager.ts","webpack://tweb/./src/helpers/bytes/bytesXor.ts","webpack://tweb/./src/lib/mtproto/authorizer.ts","webpack://tweb/./src/lib/mtproto/timeManager.ts","webpack://tweb/./src/lib/appManagers/appWebDocsManager.ts","webpack://tweb/./src/lib/appManagers/appPaymentsManager.ts","webpack://tweb/./src/lib/appManagers/appAttachMenuBotsManager.ts","webpack://tweb/./src/lib/appManagers/appSeamlessLoginManager.ts","webpack://tweb/./src/lib/appManagers/appThemesManager.ts","webpack://tweb/./src/lib/appManagers/appManagersManager.ts","webpack://tweb/./src/lib/appManagers/createManagers.ts","webpack://tweb/./src/lib/mtproto/mtproto.worker.ts","webpack://tweb/./src/helpers/listenMessagePort.ts","webpack://tweb/./src/lib/mtproto/mtproto_config.ts","webpack://tweb/./src/lib/richTextProcessor/index.ts","webpack://tweb/./src/vendor/emoji/index.ts","webpack://tweb/webpack/bootstrap","webpack://tweb/webpack/runtime/compat get default export","webpack://tweb/webpack/runtime/define property getters","webpack://tweb/webpack/runtime/ensure chunk","webpack://tweb/webpack/runtime/get javascript chunk filename","webpack://tweb/webpack/runtime/get mini-css chunk filename","webpack://tweb/webpack/runtime/global","webpack://tweb/webpack/runtime/hasOwnProperty shorthand","webpack://tweb/webpack/runtime/make namespace object","webpack://tweb/webpack/runtime/node module decorator","webpack://tweb/webpack/runtime/publicPath","webpack://tweb/webpack/runtime/compat","webpack://tweb/webpack/runtime/importScripts chunk loading","webpack://tweb/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn Promise.all([699,211,147,85,110].map(__webpack_require__.e, __webpack_require__)).then(next);\n};","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Modes from './modes';\n\nexport const IS_BETA = process.env.NODE_ENV !== 'production';\nexport const DEBUG = (IS_BETA || Modes.debug)/* && false */;\nconst ctx: any = typeof(window) !== 'undefined' ? window : self;\nexport const MOUNT_CLASS_TO: any = DEBUG || true/* && false */ ? ctx : {};\nexport default DEBUG;\n\n// let m = DEBUG;\n/* if(!DEBUG) {\n ctx.sandpitTurtle = () => {\n //if(!m) {\n for(let i in MOUNT_CLASS_TO) {\n ctx[i] = MOUNT_CLASS_TO[i];\n }\n //m = true;\n //}\n\n //DEBUG = !DEBUG;\n };\n} */\n\n/* export const superDebug = (object: any, key: string) => {\n var d = object[key];\n var beforeStr = '', afterStr = '';\n for(var r of d) {\n beforeStr += r.before.hex + '\\n';\n afterStr += r.after.hex + '\\n';\n }\n\n beforeStr = beforeStr.trim();\n afterStr = afterStr.trim();\n //var beforeStr = d.map((r) => r.before.hex).join('\\n');\n //var afterStr = d.map((r) => r.after.hex).join('\\n');\n\n var dada = (name: string, str: string) => {\n var a = document.createElement('a');\n a.target = '_blank';\n a.download = name + '.txt';\n a.href = URL.createObjectURL(new Blob([str], {\n type: 'text/plain'\n }));\n document.body.append(a);\n a.click();\n };\n\n dada(key + '_' + 'before', beforeStr);\n dada(key + '_' + 'after', afterStr);\n}\n\nMOUNT_CLASS_TO.superDebug = superDebug; */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {EMOJI_VERSION} from '../environment/emojiVersionsSupport';\n\nexport const EmojiVersions: {[version in EMOJI_VERSION]: {[emoji: string]: number}} = {'14':{'1f6dd':4867, '1f6de':4916, '1f6df':4923, '1f7f0':62832, '1f979':183, '1f9cc':1557, '1fa7b':61332, '1fa7c':61330, '1faa9':51093, '1faaa':61364, '1faab':61189, '1faac':51085, '1fab7':2651, '1fab8':2631, '1fab9':2672, '1faba':2673, '1fac3':1520, '1fac4':1521, '1fac5':1505, '1fad7':3793, '1fad8':3707, '1fad9':3804, '1fae0':111, '1fae1':136, '1fae2':132, '1fae3':133, '1fae4':174, '1fae5':142, '1fae6':1385, '1fae7':61353, '1faf0':1341, '1faf1':1332, '1faf2':1333, '1faf3':1334, '1faf4':1335, '1faf5':1351, '1faf6':1360, '1faf1-1f3fb-200d-1faf2-1f3fc':0, '1faf1-1f3fb-200d-1faf2-1f3fd':0, '1faf1-1f3fb-200d-1faf2-1f3fe':0, '1faf1-1f3fb-200d-1faf2-1f3ff':0, '1faf1-1f3fc-200d-1faf2-1f3fb':0, '1faf1-1f3fc-200d-1faf2-1f3fd':0, '1faf1-1f3fc-200d-1faf2-1f3fe':0, '1faf1-1f3fc-200d-1faf2-1f3ff':0, '1faf1-1f3fd-200d-1faf2-1f3fb':0, '1faf1-1f3fd-200d-1faf2-1f3fc':0, '1faf1-1f3fd-200d-1faf2-1f3fe':0, '1faf1-1f3fd-200d-1faf2-1f3ff':0, '1faf1-1f3fe-200d-1faf2-1f3fb':0, '1faf1-1f3fe-200d-1faf2-1f3fc':0, '1faf1-1f3fe-200d-1faf2-1f3fd':0, '1faf1-1f3fe-200d-1faf2-1f3ff':0, '1faf1-1f3ff-200d-1faf2-1f3fb':0, '1faf1-1f3ff-200d-1faf2-1f3fc':0, '1faf1-1f3ff-200d-1faf2-1f3fd':0, '1faf1-1f3ff-200d-1faf2-1f3fe':0, '1fac3-1f3fb':0, '1fac3-1f3fc':0, '1fac3-1f3fd':0, '1fac3-1f3fe':0, '1fac3-1f3ff':0, '1fac4-1f3fb':0, '1fac4-1f3fc':0, '1fac4-1f3fd':0, '1fac4-1f3fe':0, '1fac4-1f3ff':0, '1fac5-1f3fb':0, '1fac5-1f3fc':0, '1fac5-1f3fd':0, '1fac5-1f3fe':0, '1fac5-1f3ff':0, '1faf0-1f3fb':0, '1faf0-1f3fc':0, '1faf0-1f3fd':0, '1faf0-1f3fe':0, '1faf0-1f3ff':0, '1faf1-1f3fb':0, '1faf1-1f3fc':0, '1faf1-1f3fd':0, '1faf1-1f3fe':0, '1faf1-1f3ff':0, '1faf2-1f3fb':0, '1faf2-1f3fc':0, '1faf2-1f3fd':0, '1faf2-1f3fe':0, '1faf2-1f3ff':0, '1faf3-1f3fb':0, '1faf3-1f3fc':0, '1faf3-1f3fd':0, '1faf3-1f3fe':0, '1faf3-1f3ff':0, '1faf4-1f3fb':0, '1faf4-1f3fc':0, '1faf4-1f3fd':0, '1faf4-1f3fe':0, '1faf4-1f3ff':0, '1faf5-1f3fb':0, '1faf5-1f3fc':0, '1faf5-1f3fd':0, '1faf5-1f3fe':0, '1faf5-1f3ff':0, '1faf6-1f3fb':0, '1faf6-1f3fc':0, '1faf6-1f3fd':0, '1faf6-1f3fe':0, '1faf6-1f3ff':0}, '':{'2049':62835, '2122':62863, '2139':62888, '2194':62764, '2195':62763, '2196':62762, '2197':62756, '2198':62758, '2199':62760, '2328':61194, '2600':4990, '2601':4998, '2602':41013, '2603':41018, '2604':41020, '2611':62851, '2614':41014, '2615':3781, '2618':2667, '2620':1106, '2622':62753, '2623':62754, '2626':62783, '2638':62780, '2639':177, '2648':62788, '2649':62789, '2650':62796, '2651':62797, '2652':62798, '2653':62799, '2660':51095, '2663':51098, '2665':51096, '2666':51097, '2668':4865, '2692':61297, '2693':4922, '2694':61300, '2696':61311, '2697':61319, '2699':61309, '2702':61284, '2705':62850, '2708':4931, '2709':61245, '2712':61259, '2714':62852, '2716':62828, '2721':62779, '2728':51029, '2733':62858, '2734':62859, '2744':41017, '2747':62860, '2753':62836, '2754':62837, '2755':62838, '2757':62839, '2763':1137, '2764':1141, '2795':62829, '2796':62830, '2797':62831, '2934':62767, '2935':62768, '3030':62840, '3297':62912, '3299':62913, '0023-20e3':62864, '002a-20e3':62865, '0030-20e3':62866, '0031-20e3':62867, '0032-20e3':62868, '0033-20e3':62869, '0034-20e3':62870, '0035-20e3':62871, '0036-20e3':62872, '0037-20e3':62873, '0038-20e3':62874, '0039-20e3':62875, '00a9':62861, '00ae':62862, '1f004':51101, '1f0cf':51100, '1f170':62882, '1f171':62884, '1f17e':62893, '1f17f':62895, '1f18e':62883, '1f191':62885, '1f192':62886, '1f193':62887, '1f194':62889, '1f195':62891, '1f196':62892, '1f197':62894, '1f198':62896, '1f199':62897, '1f19a':62898, '1f1e6-1f1e8':71594, '1f1e6-1f1e9':71595, '1f1e6-1f1ea':71596, '1f1e6-1f1eb':71597, '1f1e6-1f1ec':71598, '1f1e6-1f1ee':71599, '1f1e6-1f1f1':71600, '1f1e6-1f1f2':71601, '1f1e6-1f1f4':71602, '1f1e6-1f1f6':71603, '1f1e6-1f1f7':71604, '1f1e6-1f1f8':71605, '1f1e6-1f1f9':71606, '1f1e6-1f1fa':71607, '1f1e6-1f1fc':71608, '1f1e6-1f1fd':71609, '1f1e6-1f1ff':71610, '1f1e7-1f1e6':71611, '1f1e7-1f1e7':71612, '1f1e7-1f1e9':71613, '1f1e7-1f1ea':71614, '1f1e7-1f1eb':71615, '1f1e7-1f1ec':71616, '1f1e7-1f1ed':71617, '1f1e7-1f1ee':71618, '1f1e7-1f1ef':71619, '1f1e7-1f1f1':71620, '1f1e7-1f1f2':71621, '1f1e7-1f1f3':71622, '1f1e7-1f1f4':71623, '1f1e7-1f1f6':71624, '1f1e7-1f1f7':71625, '1f1e7-1f1f8':71626, '1f1e7-1f1f9':71627, '1f1e7-1f1fb':71628, '1f1e7-1f1fc':71629, '1f1e7-1f1fe':71630, '1f1e7-1f1ff':71631, '1f1e8-1f1e6':71632, '1f1e8-1f1e8':71633, '1f1e8-1f1e9':71634, '1f1e8-1f1eb':71635, '1f1e8-1f1ec':71636, '1f1e8-1f1ed':71637, '1f1e8-1f1ee':71638, '1f1e8-1f1f0':71639, '1f1e8-1f1f1':71640, '1f1e8-1f1f2':71641, '1f1e8-1f1f3':71642, '1f1e8-1f1f4':71643, '1f1e8-1f1f5':71644, '1f1e8-1f1f7':71645, '1f1e8-1f1fa':71646, '1f1e8-1f1fb':71647, '1f1e8-1f1fc':71648, '1f1e8-1f1fd':71649, '1f1e8-1f1fe':71650, '1f1e8-1f1ff':71651, '1f1e9-1f1ea':71652, '1f1e9-1f1ec':71653, '1f1e9-1f1ef':71654, '1f1e9-1f1f0':71655, '1f1e9-1f1f2':71656, '1f1e9-1f1f4':71657, '1f1e9-1f1ff':71658, '1f1ea-1f1e6':71659, '1f1ea-1f1e8':71660, '1f1ea-1f1ea':71661, '1f1ea-1f1ec':71662, '1f1ea-1f1ed':71663, '1f1ea-1f1f7':71664, '1f1ea-1f1f8':71665, '1f1ea-1f1f9':71666, '1f1ea-1f1fa':71667, '1f1eb-1f1ee':71668, '1f1eb-1f1ef':71669, '1f1eb-1f1f0':71670, '1f1eb-1f1f2':71671, '1f1eb-1f1f4':71672, '1f1eb-1f1f7':71673, '1f1ec-1f1e6':71674, '1f1ec-1f1e7':71675, '1f1ec-1f1e9':71676, '1f1ec-1f1ea':71677, '1f1ec-1f1eb':71678, '1f1ec-1f1ec':71679, '1f1ec-1f1ed':71680, '1f1ec-1f1ee':71681, '1f1ec-1f1f1':71682, '1f1ec-1f1f2':71683, '1f1ec-1f1f3':71684, '1f1ec-1f1f5':71685, '1f1ec-1f1f6':71686, '1f1ec-1f1f7':71687, '1f1ec-1f1f8':71688, '1f1ec-1f1f9':71689, '1f1ec-1f1fa':71690, '1f1ec-1f1fc':71691, '1f1ec-1f1fe':71692, '1f1ed-1f1f0':71693, '1f1ed-1f1f2':71694, '1f1ed-1f1f3':71695, '1f1ed-1f1f7':71696, '1f1ed-1f1f9':71697, '1f1ed-1f1fa':71698, '1f1ee-1f1e8':71699, '1f1ee-1f1e9':71700, '1f1ee-1f1ea':71701, '1f1ee-1f1f1':71702, '1f1ee-1f1f2':71703, '1f1ee-1f1f3':71704, '1f1ee-1f1f4':71705, '1f1ee-1f1f6':71706, '1f1ee-1f1f7':71707, '1f1ee-1f1f8':71708, '1f1ee-1f1f9':71709, '1f1ef-1f1ea':71710, '1f1ef-1f1f2':71711, '1f1ef-1f1f4':71712, '1f1ef-1f1f5':71713, '1f1f0-1f1ea':71714, '1f1f0-1f1ec':71715, '1f1f0-1f1ed':71716, '1f1f0-1f1ee':71717, '1f1f0-1f1f2':71718, '1f1f0-1f1f3':71719, '1f1f0-1f1f5':71720, '1f1f0-1f1f7':71721, '1f1f0-1f1fc':71722, '1f1f0-1f1fe':71723, '1f1f0-1f1ff':71724, '1f1f1-1f1e6':71725, '1f1f1-1f1e7':71726, '1f1f1-1f1e8':71727, '1f1f1-1f1ee':71728, '1f1f1-1f1f0':71729, '1f1f1-1f1f7':71730, '1f1f1-1f1f8':71731, '1f1f1-1f1f9':71732, '1f1f1-1f1fa':71733, '1f1f1-1f1fb':71734, '1f1f1-1f1fe':71735, '1f1f2-1f1e6':71736, '1f1f2-1f1e8':71737, '1f1f2-1f1e9':71738, '1f1f2-1f1ea':71739, '1f1f2-1f1eb':71740, '1f1f2-1f1ec':71741, '1f1f2-1f1ed':71742, '1f1f2-1f1f0':71743, '1f1f2-1f1f1':71744, '1f1f2-1f1f2':71745, '1f1f2-1f1f3':71746, '1f1f2-1f1f4':71747, '1f1f2-1f1f5':71748, '1f1f2-1f1f6':71749, '1f1f2-1f1f7':71750, '1f1f2-1f1f8':71751, '1f1f2-1f1f9':71752, '1f1f2-1f1fa':71753, '1f1f2-1f1fb':71754, '1f1f2-1f1fc':71755, '1f1f2-1f1fd':71756, '1f1f2-1f1fe':71757, '1f1f2-1f1ff':71758, '1f1f3-1f1e6':71759, '1f1f3-1f1e8':71760, '1f1f3-1f1ea':71761, '1f1f3-1f1eb':71762, '1f1f3-1f1ec':71763, '1f1f3-1f1ee':71764, '1f1f3-1f1f1':71765, '1f1f3-1f1f4':71766, '1f1f3-1f1f5':71767, '1f1f3-1f1f7':71768, '1f1f3-1f1fa':71769, '1f1f3-1f1ff':71770, '1f1f4-1f1f2':71771, '1f1f5-1f1e6':71772, '1f1f5-1f1ea':71773, '1f1f5-1f1eb':71774, '1f1f5-1f1ec':71775, '1f1f5-1f1ed':71776, '1f1f5-1f1f0':71777, '1f1f5-1f1f1':71778, '1f1f5-1f1f2':71779, '1f1f5-1f1f3':71780, '1f1f5-1f1f7':71781, '1f1f5-1f1f8':71782, '1f1f5-1f1f9':71783, '1f1f5-1f1fc':71784, '1f1f5-1f1fe':71785, '1f1f6-1f1e6':71786, '1f1f7-1f1ea':71787, '1f1f7-1f1f4':71788, '1f1f7-1f1f8':71789, '1f1f7-1f1fa':71790, '1f1f7-1f1fc':71791, '1f1f8-1f1e6':71792, '1f1f8-1f1e7':71793, '1f1f8-1f1e8':71794, '1f1f8-1f1e9':71795, '1f1f8-1f1ea':71796, '1f1f8-1f1ec':71797, '1f1f8-1f1ed':71798, '1f1f8-1f1ee':71799, '1f1f8-1f1ef':71800, '1f1f8-1f1f0':71801, '1f1f8-1f1f1':71802, '1f1f8-1f1f2':71803, '1f1f8-1f1f3':71804, '1f1f8-1f1f4':71805, '1f1f8-1f1f7':71806, '1f1f8-1f1f8':71807, '1f1f8-1f1f9':71808, '1f1f8-1f1fb':71809, '1f1f8-1f1fd':71810, '1f1f8-1f1fe':71811, '1f1f8-1f1ff':71812, '1f1f9-1f1e6':71813, '1f1f9-1f1e8':71814, '1f1f9-1f1e9':71815, '1f1f9-1f1eb':71816, '1f1f9-1f1ec':71817, '1f1f9-1f1ed':71818, '1f1f9-1f1ef':71819, '1f1f9-1f1f0':71820, '1f1f9-1f1f1':71821, '1f1f9-1f1f2':71822, '1f1f9-1f1f3':71823, '1f1f9-1f1f4':71824, '1f1f9-1f1f7':71825, '1f1f9-1f1f9':71826, '1f1f9-1f1fb':71827, '1f1f9-1f1fc':71828, '1f1f9-1f1ff':71829, '1f1fa-1f1e6':71830, '1f1fa-1f1ec':71831, '1f1fa-1f1f2':71832, '1f1fa-1f1f3':71833, '1f1fa-1f1f8':71834, '1f1fa-1f1fe':71835, '1f1fa-1f1ff':71836, '1f1fb-1f1e6':71837, '1f1fb-1f1e8':71838, '1f1fb-1f1ea':71839, '1f1fb-1f1ec':71840, '1f1fb-1f1ee':71841, '1f1fb-1f1f3':71842, '1f1fb-1f1fa':71843, '1f1fc-1f1eb':71844, '1f1fc-1f1f8':71845, '1f1fd-1f1f0':71846, '1f1fe-1f1ea':71847, '1f1fe-1f1f9':71848, '1f1ff-1f1e6':71849, '1f1ff-1f1f2':71850, '1f1ff-1f1fc':71851, '1f201':62899, '1f202':62900, '1f21a':62906, '1f22f':62903, '1f232':62907, '1f233':62911, '1f234':62910, '1f235':62915, '1f236':62902, '1f237':62901, '1f238':62909, '1f239':62905, '1f23a':62914, '1f250':62904, '1f251':62908, '1f300':41010, '1f301':4857, '1f302':41012, '1f303':4858, '1f304':4860, '1f305':4861, '1f306':4862, '1f307':4863, '1f308':41011, '1f309':4864, '1f30a':41023, '1f30b':4815, '1f30c':4997, '1f30d':4806, '1f30e':4807, '1f30f':4808, '1f310':4809, '1f311':4977, '1f312':4978, '1f313':4979, '1f314':4980, '1f315':4981, '1f316':4982, '1f317':4983, '1f318':4984, '1f319':4985, '1f31a':4986, '1f31b':4987, '1f31c':4988, '1f31d':4991, '1f31e':4992, '1f31f':4995, '1f320':4996, '1f321':4989, '1f324':41001, '1f325':41002, '1f326':41003, '1f327':41004, '1f328':41005, '1f329':41006, '1f32a':41007, '1f32b':41008, '1f32c':41009, '1f32d':3725, '1f32e':3727, '1f32f':3728, '1f330':3708, '1f331':2659, '1f332':2661, '1f333':2662, '1f334':2663, '1f335':2664, '1f336':3698, '1f337':2658, '1f338':2649, '1f339':2653, '1f33a':2655, '1f33b':2656, '1f33c':2657, '1f33d':3697, '1f33e':2665, '1f33f':2666, '1f340':2668, '1f341':2669, '1f342':2670, '1f343':2671, '1f344':3705, '1f345':3690, '1f346':3694, '1f347':3674, '1f348':3675, '1f349':3676, '1f34a':3677, '1f34b':3678, '1f34c':3679, '1f34d':3680, '1f34e':3682, '1f34f':3683, '1f350':3684, '1f351':3685, '1f352':3686, '1f353':3687, '1f354':3722, '1f355':3724, '1f356':3718, '1f357':3719, '1f358':3744, '1f359':3745, '1f35a':3746, '1f35b':3747, '1f35c':3748, '1f35d':3749, '1f35e':3709, '1f35f':3723, '1f360':3750, '1f361':3756, '1f362':3751, '1f363':3752, '1f364':3753, '1f365':3754, '1f366':3765, '1f367':3766, '1f368':3767, '1f369':3768, '1f36a':3769, '1f36b':3774, '1f36c':3775, '1f36d':3776, '1f36e':3777, '1f36f':3778, '1f370':3771, '1f371':3743, '1f372':3735, '1f373':3733, '1f374':3801, '1f375':3783, '1f376':3784, '1f377':3786, '1f378':3787, '1f379':3788, '1f37a':3789, '1f37b':3790, '1f37c':3779, '1f37d':3800, '1f37e':3785, '1f37f':3739, '1f380':51040, '1f381':51041, '1f382':3770, '1f383':51024, '1f384':51025, '1f385':1527, '1f386':51026, '1f387':51027, '1f388':51030, '1f389':51031, '1f38a':51032, '1f38b':51033, '1f38c':71588, '1f38d':51034, '1f38e':51035, '1f38f':51036, '1f390':51037, '1f391':51038, '1f392':61134, '1f393':61147, '1f396':51045, '1f397':51042, '1f399':61167, '1f39a':61168, '1f39b':61169, '1f39e':61203, '1f39f':51043, '1f3a0':4866, '1f3a1':4868, '1f3a2':4869, '1f3a3':51072, '1f3a4':61170, '1f3a5':61202, '1f3a6':62819, '1f3a7':61171, '1f3a8':51105, '1f3a9':61146, '1f3aa':4871, '1f3ab':51044, '1f3ac':61205, '1f3ad':51103, '1f3ae':51086, '1f3af':51078, '1f3b0':51088, '1f3b1':51081, '1f3b2':51089, '1f3b3':51060, '1f3b4':51102, '1f3b5':61165, '1f3b6':61166, '1f3b7':61173, '1f3b8':61175, '1f3b9':61176, '1f3ba':61177, '1f3bb':61178, '1f3bc':61164, '1f3bd':51074, '1f3be':51058, '1f3bf':51075, '1f3c0':51054, '1f3c1':71586, '1f3c2':1600, '1f3c3-200d-2640':1584, '1f3c3-200d-2642':1583, '1f3c3':1582, '1f3c4-200d-2640':1606, '1f3c4-200d-2642':1605, '1f3c4':1604, '1f3c5':51047, '1f3c6':51046, '1f3c7':1598, '1f3c8':51056, '1f3c9':51057, '1f3ca-200d-2640':1612, '1f3ca-200d-2642':1611, '1f3ca':1610, '1f3cb-200d-2640':1618, '1f3cb-200d-2642':1617, '1f3cb':1616, '1f3cc-200d-2640':1603, '1f3cc-200d-2642':1602, '1f3cc':1601, '1f3cd':4902, '1f3ce':4901, '1f3cf':51061, '1f3d0':51055, '1f3d1':51062, '1f3d2':51063, '1f3d3':51065, '1f3d4':4813, '1f3d5':4817, '1f3d6':4818, '1f3d7':4824, '1f3d8':4829, '1f3d9':4859, '1f3da':4830, '1f3db':4823, '1f3dc':4819, '1f3dd':4820, '1f3de':4821, '1f3df':4822, '1f3e0':4831, '1f3e1':4832, '1f3e2':4833, '1f3e3':4834, '1f3e4':4835, '1f3e5':4836, '1f3e6':4837, '1f3e7':62729, '1f3e8':4838, '1f3e9':4839, '1f3ea':4840, '1f3eb':4841, '1f3ec':4842, '1f3ed':4843, '1f3ee':61216, '1f3ef':4844, '1f3f0':4845, '1f3f3-200d-1f308':71591, '1f3f3-200d-26a7':71592, '1f3f3':71590, '1f3f4-200d-2620':71593, '1f3f4-e0067-e0062-e0065-e006e-e0067-e007f':71852, '1f3f4-e0067-e0062-e0073-e0063-e0074-e007f':71853, '1f3f4-e0067-e0062-e0077-e006c-e0073-e007f':71854, '1f3f4':71589, '1f3f5':2652, '1f3f7':61234, '1f3f8':51066, '1f3f9':61303, '1f3fa':3805, '1f3fb':9525, '1f3fc':9526, '1f3fd':9527, '1f3fe':9528, '1f3ff':9529, '1f400':2576, '1f401':2575, '1f402':2556, '1f403':2557, '1f404':2558, '1f405':2547, '1f406':2548, '1f407':2579, '1f408-200d-2b1b':2544, '1f408':2543, '1f409':2618, '1f40a':2613, '1f40b':2622, '1f40c':2632, '1f40d':2616, '1f40e':2550, '1f40f':2563, '1f410':2565, '1f411':2564, '1f412':2531, '1f413':2596, '1f414':2595, '1f415-200d-1f9ba':2537, '1f415':2535, '1f416':2560, '1f417':2561, '1f418':2570, '1f419':2629, '1f41a':2630, '1f41b':2634, '1f41c':2635, '1f41d':2636, '1f41e':2638, '1f41f':2625, '1f420':2626, '1f421':2627, '1f422':2614, '1f423':2597, '1f424':2598, '1f425':2599, '1f426':2600, '1f427':2601, '1f428':2586, '1f429':2538, '1f42a':2566, '1f42b':2567, '1f42c':2623, '1f42d':2574, '1f42e':2555, '1f42f':2546, '1f430':2578, '1f431':2542, '1f432':2617, '1f433':2621, '1f434':2549, '1f435':2530, '1f436':2534, '1f437':2559, '1f438':2612, '1f439':2577, '1f43a':2539, '1f43b-200d-2744':2585, '1f43b':2584, '1f43c':2587, '1f43d':2562, '1f43e':2593, '1f43f':2580, '1f440':1381, '1f441-200d-1f5e8':1159, '1f441':1382, '1f442':1373, '1f443':1375, '1f444':1384, '1f445':1383, '1f446':1347, '1f447':1349, '1f448':1345, '1f449':1346, '1f44a':1355, '1f44b':1327, '1f44c':1336, '1f44d':1352, '1f44e':1353, '1f44f':1358, '1f450':1361, '1f451':61144, '1f452':61145, '1f453':61110, '1f454':61115, '1f455':61116, '1f456':61117, '1f457':61122, '1f458':61123, '1f459':61128, '1f45a':61129, '1f45b':61130, '1f45c':61131, '1f45d':61132, '1f45e':61136, '1f45f':61137, '1f460':61140, '1f461':61141, '1f462':61143, '1f463':1687, '1f464':1684, '1f465':1685, '1f466':1388, '1f467':1389, '1f468-200d-1f33e':1457, '1f468-200d-1f373':1460, '1f468-200d-1f37c':1524, '1f468-200d-1f393':1448, '1f468-200d-1f3a4':1478, '1f468-200d-1f3a8':1481, '1f468-200d-1f3eb':1451, '1f468-200d-1f3ed':1466, '1f468-200d-1f466-200d-1f466':1674, '1f468-200d-1f466':1673, '1f468-200d-1f467-200d-1f466':1676, '1f468-200d-1f467-200d-1f467':1677, '1f468-200d-1f467':1675, '1f468-200d-1f468-200d-1f466':1663, '1f468-200d-1f468-200d-1f466-200d-1f466':1666, '1f468-200d-1f468-200d-1f467':1664, '1f468-200d-1f468-200d-1f467-200d-1f466':1665, '1f468-200d-1f468-200d-1f467-200d-1f467':1667, '1f468-200d-1f469-200d-1f466':1658, '1f468-200d-1f469-200d-1f466-200d-1f466':1661, '1f468-200d-1f469-200d-1f467':1659, '1f468-200d-1f469-200d-1f467-200d-1f466':1660, '1f468-200d-1f469-200d-1f467-200d-1f467':1662, '1f468-200d-1f4bb':1475, '1f468-200d-1f4bc':1469, '1f468-200d-1f527':1463, '1f468-200d-1f52c':1472, '1f468-200d-1f680':1487, '1f468-200d-1f692':1490, '1f468-200d-1f9af':1574, '1f468-200d-1f9b0':1396, '1f468-200d-1f9b1':1397, '1f468-200d-1f9b2':1399, '1f468-200d-1f9b3':1398, '1f468-200d-1f9bc':1577, '1f468-200d-1f9bd':1580, '1f468-200d-2695':1445, '1f468-200d-2696':1454, '1f468-200d-2708':1484, '1f468-200d-2764-200d-1f468':1655, '1f468-200d-2764-200d-1f48b-200d-1f468':1651, '1f468':1392, '1f469-200d-1f33e':1458, '1f469-200d-1f373':1461, '1f469-200d-1f37c':1523, '1f469-200d-1f393':1449, '1f469-200d-1f3a4':1479, '1f469-200d-1f3a8':1482, '1f469-200d-1f3eb':1452, '1f469-200d-1f3ed':1467, '1f469-200d-1f466-200d-1f466':1679, '1f469-200d-1f466':1678, '1f469-200d-1f467-200d-1f466':1681, '1f469-200d-1f467-200d-1f467':1682, '1f469-200d-1f467':1680, '1f469-200d-1f469-200d-1f466':1668, '1f469-200d-1f469-200d-1f466-200d-1f466':1671, '1f469-200d-1f469-200d-1f467':1669, '1f469-200d-1f469-200d-1f467-200d-1f466':1670, '1f469-200d-1f469-200d-1f467-200d-1f467':1672, '1f469-200d-1f4bb':1476, '1f469-200d-1f4bc':1470, '1f469-200d-1f527':1464, '1f469-200d-1f52c':1473, '1f469-200d-1f680':1488, '1f469-200d-1f692':1491, '1f469-200d-1f9af':1575, '1f469-200d-1f9b0':1401, '1f469-200d-1f9b1':1403, '1f469-200d-1f9b2':1407, '1f469-200d-1f9b3':1405, '1f469-200d-1f9bc':1578, '1f469-200d-1f9bd':1581, '1f469-200d-2695':1446, '1f469-200d-2696':1455, '1f469-200d-2708':1485, '1f469-200d-2764-200d-1f468':1654, '1f469-200d-2764-200d-1f469':1656, '1f469-200d-2764-200d-1f48b-200d-1f468':1650, '1f469-200d-2764-200d-1f48b-200d-1f469':1652, '1f469':1400, '1f46a':1657, '1f46b':1647, '1f46c':1648, '1f46d':1646, '1f46e-200d-2640':1494, '1f46e-200d-2642':1493, '1f46e':1492, '1f46f-200d-2640':1590, '1f46f-200d-2642':1589, '1f46f':1588, '1f470-200d-2640':1518, '1f470-200d-2642':1517, '1f470':1516, '1f471-200d-2640':1409, '1f471-200d-2642':1410, '1f471':1391, '1f472':1511, '1f473-200d-2640':1510, '1f473-200d-2642':1509, '1f473':1508, '1f474':1412, '1f475':1413, '1f476':1386, '1f477-200d-2640':1504, '1f477-200d-2642':1503, '1f477':1502, '1f478':1507, '1f479':1109, '1f47a':1110, '1f47b':1111, '1f47c':1526, '1f47d':1112, '1f47e':1113, '1f47f':1104, '1f480':1105, '1f481-200d-2640':1428, '1f481-200d-2642':1427, '1f481':1426, '1f482-200d-2640':1500, '1f482-200d-2642':1499, '1f482':1498, '1f483':1585, '1f484':61152, '1f485':1366, '1f486-200d-2640':1560, '1f486-200d-2642':1559, '1f486':1558, '1f487-200d-2640':1563, '1f487-200d-2642':1562, '1f487':1561, '1f488':4870, '1f489':61326, '1f48a':61328, '1f48b':1127, '1f48c':1128, '1f48d':61153, '1f48e':61154, '1f48f':1649, '1f490':2648, '1f491':1653, '1f492':4846, '1f493':1133, '1f494':1138, '1f495':1135, '1f496':1131, '1f497':1132, '1f498':1129, '1f499':1145, '1f49a':1144, '1f49b':1143, '1f49c':1146, '1f49d':1130, '1f49e':1134, '1f49f':1136, '1f4a0':62946, '1f4a1':61214, '1f4a2':1151, '1f4a3':1157, '1f4a4':1163, '1f4a5':1152, '1f4a6':1154, '1f4a7':41022, '1f4a8':1155, '1f4a9':1107, '1f4aa':1368, '1f4ab':1153, '1f4ac':1158, '1f4ad':1162, '1f4ae':2650, '1f4af':1150, '1f4b0':61235, '1f4b1':62841, '1f4b2':62842, '1f4b3':61242, '1f4b4':61237, '1f4b5':61238, '1f4b6':61239, '1f4b7':61240, '1f4b8':61241, '1f4b9':61244, '1f4ba':4936, '1f4bb':61191, '1f4bc':61265, '1f4bd':61197, '1f4be':61198, '1f4bf':61199, '1f4c0':61200, '1f4c1':61266, '1f4c2':61267, '1f4c3':61227, '1f4c4':61229, '1f4c5':61269, '1f4c6':61270, '1f4c7':61273, '1f4c8':61274, '1f4c9':61275, '1f4ca':61276, '1f4cb':61277, '1f4cc':61278, '1f4cd':61279, '1f4ce':61280, '1f4cf':61282, '1f4d0':61283, '1f4d1':61232, '1f4d2':61226, '1f4d3':61225, '1f4d4':61218, '1f4d5':61219, '1f4d6':61220, '1f4d7':61221, '1f4d8':61222, '1f4d9':61223, '1f4da':61224, '1f4db':62847, '1f4dc':61228, '1f4dd':61264, '1f4de':61185, '1f4df':61186, '1f4e0':61187, '1f4e1':61325, '1f4e2':61159, '1f4e3':61160, '1f4e4':61249, '1f4e5':61250, '1f4e6':61251, '1f4e7':61246, '1f4e8':61247, '1f4e9':61248, '1f4ea':61253, '1f4eb':61252, '1f4ec':61254, '1f4ed':61255, '1f4ee':61256, '1f4ef':61161, '1f4f0':61230, '1f4f1':61182, '1f4f2':61183, '1f4f3':62823, '1f4f4':62824, '1f4f5':62751, '1f4f6':62822, '1f4f7':61207, '1f4f8':61208, '1f4f9':61209, '1f4fa':61206, '1f4fb':61172, '1f4fc':61210, '1f4fd':61204, '1f4ff':61151, '1f500':62801, '1f501':62802, '1f502':62803, '1f503':62769, '1f504':62770, '1f505':62820, '1f506':62821, '1f507':61155, '1f508':61156, '1f509':61157, '1f50a':61158, '1f50b':61188, '1f50c':61190, '1f50d':61211, '1f50e':61212, '1f50f':61290, '1f510':61291, '1f511':61292, '1f512':61288, '1f513':61289, '1f514':61162, '1f515':61163, '1f516':61233, '1f517':61313, '1f518':62947, '1f519':62771, '1f51a':62772, '1f51b':62773, '1f51c':62774, '1f51d':62775, '1f51e':62752, '1f51f':62876, '1f520':62877, '1f521':62878, '1f522':62879, '1f523':62880, '1f524':62881, '1f525':41021, '1f526':61215, '1f527':61306, '1f528':61294, '1f529':61308, '1f52a':3803, '1f52b':61301, '1f52c':61323, '1f52d':61324, '1f52e':51082, '1f52f':62787, '1f530':62848, '1f531':62846, '1f532':62949, '1f533':62948, '1f534':62916, '1f535':62920, '1f536':62940, '1f537':62941, '1f538':62942, '1f539':62943, '1f53a':62944, '1f53b':62945, '1f53c':62811, '1f53d':62813, '1f549':62778, '1f54a':2602, '1f54b':4854, '1f54c':4850, '1f54d':4852, '1f54e':62786, '1f550':4955, '1f551':4957, '1f552':4959, '1f553':4961, '1f554':4963, '1f555':4965, '1f556':4967, '1f557':4969, '1f558':4971, '1f559':4973, '1f55a':4975, '1f55b':4953, '1f55c':4956, '1f55d':4958, '1f55e':4960, '1f55f':4962, '1f560':4964, '1f561':4966, '1f562':4968, '1f563':4970, '1f564':4972, '1f565':4974, '1f566':4976, '1f567':4954, '1f56f':61213, '1f570':4952, '1f573':1156, '1f574':1587, '1f575-200d-2640':1497, '1f575-200d-2642':1496, '1f575':1495, '1f576':61111, '1f577':2641, '1f578':2642, '1f579':51087, '1f57a':1586, '1f587':61281, '1f58a':61261, '1f58b':61260, '1f58c':61262, '1f58d':61263, '1f590':1329, '1f595':1348, '1f596':1331, '1f5a4':1148, '1f5a5':61192, '1f5a8':61193, '1f5b1':61195, '1f5b2':61196, '1f5bc':51104, '1f5c2':61268, '1f5c3':61285, '1f5c4':61286, '1f5d1':61287, '1f5d2':61271, '1f5d3':61272, '1f5dc':61310, '1f5dd':61293, '1f5de':61231, '1f5e1':61299, '1f5e3':1683, '1f5e8':1160, '1f5ef':1161, '1f5f3':61257, '1f5fa':4810, '1f5fb':4816, '1f5fc':4847, '1f5fd':4848, '1f5fe':4811, '1f5ff':61362, '1f600':11, '1f601':14, '1f602':18, '1f603':12, '1f604':13, '1f605':16, '1f606':15, '1f607':114, '1f608':1103, '1f609':112, '1f60a':113, '1f60b':124, '1f60c':150, '1f60d':116, '1f60e':170, '1f60f':144, '1f610':139, '1f611':140, '1f612':145, '1f613':195, '1f614':151, '1f615':173, '1f616':192, '1f617':119, '1f618':118, '1f619':122, '1f61a':121, '1f61b':125, '1f61c':126, '1f61d':128, '1f61e':194, '1f61f':175, '1f620':1101, '1f621':1100, '1f622':189, '1f623':193, '1f624':199, '1f625':188, '1f626':184, '1f627':185, '1f628':186, '1f629':196, '1f62a':152, '1f62b':197, '1f62c':147, '1f62d':190, '1f62e-200d-1f4a8':148, '1f62e':178, '1f62f':179, '1f630':187, '1f631':191, '1f632':180, '1f633':181, '1f634':154, '1f635-200d-1f4ab':165, '1f635':164, '1f636-200d-1f32b':143, '1f636':141, '1f637':155, '1f638':1116, '1f639':1117, '1f63a':1115, '1f63b':1118, '1f63c':1119, '1f63d':1120, '1f63e':1123, '1f63f':1122, '1f640':1121, '1f641':176, '1f642':19, '1f643':110, '1f644':146, '1f645-200d-2640':1422, '1f645-200d-2642':1421, '1f645':1420, '1f646-200d-2640':1425, '1f646-200d-2642':1424, '1f646':1423, '1f647-200d-2640':1437, '1f647-200d-2642':1436, '1f647':1435, '1f648':1124, '1f649':1125, '1f64a':1126, '1f64b-200d-2640':1431, '1f64b-200d-2642':1430, '1f64b':1429, '1f64c':1359, '1f64d-200d-2640':1416, '1f64d-200d-2642':1415, '1f64d':1414, '1f64e-200d-2640':1419, '1f64e-200d-2642':1418, '1f64e':1417, '1f64f':1364, '1f680':4942, '1f681':4937, '1f682':4872, '1f683':4873, '1f684':4874, '1f685':4875, '1f686':4876, '1f687':4877, '1f688':4878, '1f689':4879, '1f68a':4880, '1f68b':4883, '1f68c':4884, '1f68d':4885, '1f68e':4886, '1f68f':4911, '1f690':4887, '1f691':4888, '1f692':4889, '1f693':4890, '1f694':4891, '1f695':4892, '1f696':4893, '1f697':4894, '1f698':4895, '1f699':4896, '1f69a':4898, '1f69b':4899, '1f69c':4900, '1f69d':4881, '1f69e':4882, '1f69f':4938, '1f6a0':4939, '1f6a1':4940, '1f6a2':4930, '1f6a3-200d-2640':1609, '1f6a3-200d-2642':1608, '1f6a3':1607, '1f6a4':4926, '1f6a5':4918, '1f6a6':4919, '1f6a7':4921, '1f6a8':4917, '1f6a9':71587, '1f6aa':61333, '1f6ab':62745, '1f6ac':61358, '1f6ad':62747, '1f6ae':62730, '1f6af':62748, '1f6b0':62731, '1f6b1':62749, '1f6b2':4907, '1f6b3':62746, '1f6b4-200d-2640':1621, '1f6b4-200d-2642':1620, '1f6b4':1619, '1f6b5-200d-2640':1624, '1f6b5-200d-2642':1623, '1f6b5':1622, '1f6b6-200d-2640':1566, '1f6b6-200d-2642':1565, '1f6b6':1564, '1f6b7':62750, '1f6b8':62743, '1f6b9':62733, '1f6ba':62734, '1f6bb':62735, '1f6bc':62736, '1f6bd':61340, '1f6be':62737, '1f6bf':61342, '1f6c0':1643, '1f6c1':61343, '1f6c2':62738, '1f6c3':62739, '1f6c4':62740, '1f6c5':62741, '1f6cb':61338, '1f6cc':1644, '1f6cd':61133, '1f6ce':4944, '1f6cf':61337, '1f6d0':62776, '1f6d1':4920, '1f6d2':61357, '1f6d5':4851, '1f6d6':4828, '1f6d7':61334, '1f6e0':61298, '1f6e1':61304, '1f6e2':4914, '1f6e3':4912, '1f6e4':4913, '1f6e5':4929, '1f6e9':4932, '1f6eb':4933, '1f6ec':4934, '1f6f0':4941, '1f6f3':4927, '1f6f4':4908, '1f6f5':4903, '1f6f6':4925, '1f6f7':51076, '1f6f8':4943, '1f6f9':4909, '1f6fa':4906, '1f6fb':4897, '1f6fc':4910, '1f7e0':62917, '1f7e1':62918, '1f7e2':62919, '1f7e3':62921, '1f7e4':62922, '1f7e5':62925, '1f7e6':62929, '1f7e7':62926, '1f7e8':62927, '1f7e9':62928, '1f7ea':62930, '1f7eb':62931, '1f90c':1337, '1f90d':1149, '1f90e':1147, '1f90f':1338, '1f910':137, '1f911':129, '1f912':156, '1f913':171, '1f914':135, '1f915':157, '1f916':1114, '1f917':130, '1f918':1343, '1f919':1344, '1f91a':1328, '1f91b':1356, '1f91c':1357, '1f91d':1363, '1f91e':1340, '1f91f':1342, '1f920':167, '1f921':1108, '1f922':158, '1f923':17, '1f924':153, '1f925':149, '1f926-200d-2640':1440, '1f926-200d-2642':1439, '1f926':1438, '1f927':160, '1f928':138, '1f929':117, '1f92a':127, '1f92b':134, '1f92c':1102, '1f92d':131, '1f92e':159, '1f92f':166, '1f930':1519, '1f931':1522, '1f932':1362, '1f933':1367, '1f934':1506, '1f935-200d-2640':1515, '1f935-200d-2642':1514, '1f935':1513, '1f936':1528, '1f937-200d-2640':1443, '1f937-200d-2642':1442, '1f937':1441, '1f938-200d-2640':1627, '1f938-200d-2642':1626, '1f938':1625, '1f939-200d-2640':1639, '1f939-200d-2642':1638, '1f939':1637, '1f93a':1597, '1f93c-200d-2640':1630, '1f93c-200d-2642':1629, '1f93c':1628, '1f93d-200d-2640':1633, '1f93d-200d-2642':1632, '1f93d':1631, '1f93e-200d-2640':1636, '1f93e-200d-2642':1635, '1f93e':1634, '1f93f':51073, '1f940':2654, '1f941':61180, '1f942':3791, '1f943':3792, '1f944':3802, '1f945':51069, '1f947':51048, '1f948':51049, '1f949':51050, '1f94a':51067, '1f94b':51068, '1f94c':51077, '1f94d':51064, '1f94e':51053, '1f94f':51059, '1f950':3710, '1f951':3693, '1f952':3700, '1f953':3721, '1f954':3695, '1f955':3696, '1f956':3711, '1f957':3738, '1f958':3734, '1f959':3730, '1f95a':3732, '1f95b':3780, '1f95c':3706, '1f95d':3689, '1f95e':3715, '1f95f':3757, '1f960':3758, '1f961':3759, '1f962':3799, '1f963':3737, '1f964':3794, '1f965':3692, '1f966':3702, '1f967':3773, '1f968':3713, '1f969':3720, '1f96a':3726, '1f96b':3742, '1f96c':3701, '1f96d':3681, '1f96e':3755, '1f96f':3714, '1f970':115, '1f971':198, '1f972':123, '1f973':168, '1f974':163, '1f975':161, '1f976':162, '1f977':1501, '1f978':169, '1f97a':182, '1f97b':61124, '1f97c':61113, '1f97d':61112, '1f97e':61138, '1f97f':61139, '1f980':3760, '1f981':2545, '1f982':2643, '1f983':2594, '1f984':2551, '1f985':2603, '1f986':2604, '1f987':2583, '1f988':2628, '1f989':2606, '1f98a':2540, '1f98b':2633, '1f98c':2553, '1f98d':2532, '1f98e':2615, '1f98f':2572, '1f990':3762, '1f991':3763, '1f992':2569, '1f993':2552, '1f994':2582, '1f995':2619, '1f996':2620, '1f997':2639, '1f998':2591, '1f999':2568, '1f99a':2610, '1f99b':2573, '1f99c':2611, '1f99d':2541, '1f99e':3761, '1f99f':2644, '1f9a0':2647, '1f9a1':2592, '1f9a2':2605, '1f9a3':2571, '1f9a4':2607, '1f9a5':2588, '1f9a6':2589, '1f9a7':2533, '1f9a8':2590, '1f9a9':2609, '1f9aa':3764, '1f9ab':2581, '1f9ac':2554, '1f9ad':2624, '1f9ae':2536, '1f9af':61312, '1f9b4':1380, '1f9b5':1371, '1f9b6':1372, '1f9b7':1379, '1f9b8-200d-2640':1532, '1f9b8-200d-2642':1531, '1f9b8':1530, '1f9b9-200d-2640':1535, '1f9b9-200d-2642':1534, '1f9b9':1533, '1f9ba':61114, '1f9bb':1374, '1f9bc':4905, '1f9bd':4904, '1f9be':1369, '1f9bf':1370, '1f9c0':3717, '1f9c1':3772, '1f9c2':3741, '1f9c3':3796, '1f9c4':3703, '1f9c5':3704, '1f9c6':3731, '1f9c7':3716, '1f9c8':3740, '1f9c9':3797, '1f9ca':3798, '1f9cb':3795, '1f9cd-200d-2640':1569, '1f9cd-200d-2642':1568, '1f9cd':1567, '1f9ce-200d-2640':1572, '1f9ce-200d-2642':1571, '1f9ce':1570, '1f9cf-200d-2640':1434, '1f9cf-200d-2642':1433, '1f9cf':1432, '1f9d0':172, '1f9d1-200d-1f33e':1456, '1f9d1-200d-1f373':1459, '1f9d1-200d-1f37c':1525, '1f9d1-200d-1f384':1529, '1f9d1-200d-1f393':1447, '1f9d1-200d-1f3a4':1477, '1f9d1-200d-1f3a8':1480, '1f9d1-200d-1f3eb':1450, '1f9d1-200d-1f3ed':1465, '1f9d1-200d-1f4bb':1474, '1f9d1-200d-1f4bc':1468, '1f9d1-200d-1f527':1462, '1f9d1-200d-1f52c':1471, '1f9d1-200d-1f680':1486, '1f9d1-200d-1f692':1489, '1f9d1-200d-1f91d-200d-1f9d1':1645, '1f9d1-200d-1f9af':1573, '1f9d1-200d-1f9b0':1402, '1f9d1-200d-1f9b1':1404, '1f9d1-200d-1f9b2':1408, '1f9d1-200d-1f9b3':1406, '1f9d1-200d-1f9bc':1576, '1f9d1-200d-1f9bd':1579, '1f9d1-200d-2695':1444, '1f9d1-200d-2696':1453, '1f9d1-200d-2708':1483, '1f9d1':1390, '1f9d2':1387, '1f9d3':1411, '1f9d4-200d-2640':1395, '1f9d4-200d-2642':1394, '1f9d4':1393, '1f9d5':1512, '1f9d6-200d-2640':1593, '1f9d6-200d-2642':1592, '1f9d6':1591, '1f9d7-200d-2640':1596, '1f9d7-200d-2642':1595, '1f9d7':1594, '1f9d8-200d-2640':1642, '1f9d8-200d-2642':1641, '1f9d8':1640, '1f9d9-200d-2640':1538, '1f9d9-200d-2642':1537, '1f9d9':1536, '1f9da-200d-2640':1541, '1f9da-200d-2642':1540, '1f9da':1539, '1f9db-200d-2640':1544, '1f9db-200d-2642':1543, '1f9db':1542, '1f9dc-200d-2640':1547, '1f9dc-200d-2642':1546, '1f9dc':1545, '1f9dd-200d-2640':1550, '1f9dd-200d-2642':1549, '1f9dd':1548, '1f9de-200d-2640':1553, '1f9de-200d-2642':1552, '1f9de':1551, '1f9df-200d-2640':1556, '1f9df-200d-2642':1555, '1f9df':1554, '1f9e0':1376, '1f9e1':1142, '1f9e2':61148, '1f9e3':61118, '1f9e4':61119, '1f9e5':61120, '1f9e6':61121, '1f9e7':51039, '1f9e8':51028, '1f9e9':51090, '1f9ea':61320, '1f9eb':61321, '1f9ec':61322, '1f9ed':4812, '1f9ee':61201, '1f9ef':61356, '1f9f0':61316, '1f9f1':4825, '1f9f2':61317, '1f9f3':4945, '1f9f4':61346, '1f9f5':51106, '1f9f6':51108, '1f9f7':61347, '1f9f8':51091, '1f9f9':61348, '1f9fa':61349, '1f9fb':61350, '1f9fc':61352, '1f9fd':61355, '1f9fe':61243, '1f9ff':51084, '1fa70':61142, '1fa71':61125, '1fa72':61126, '1fa73':61127, '1fa74':61135, '1fa78':61327, '1fa79':61329, '1fa7a':61331, '1fa80':51079, '1fa81':51080, '1fa82':4935, '1fa83':61302, '1fa84':51083, '1fa85':51092, '1fa86':51094, '1fa90':4993, '1fa91':61339, '1fa92':61345, '1fa93':61295, '1fa94':61217, '1fa95':61179, '1fa96':61149, '1fa97':61174, '1fa98':61181, '1fa99':61236, '1fa9a':61305, '1fa9b':61307, '1fa9c':61318, '1fa9d':61315, '1fa9e':61335, '1fa9f':61336, '1faa0':61341, '1faa1':51107, '1faa2':51109, '1faa3':61351, '1faa4':61344, '1faa5':61354, '1faa6':61360, '1faa7':61363, '1faa8':4826, '1fab0':2645, '1fab1':2646, '1fab2':2637, '1fab3':2640, '1fab4':2660, '1fab5':4827, '1fab6':2608, '1fac0':1377, '1fac1':1378, '1fac2':1686, '1fad0':3688, '1fad1':3699, '1fad2':3691, '1fad3':3712, '1fad4':3729, '1fad5':3736, '1fad6':3782, '203c':62834, '21a9':62765, '21aa':62766, '231a':4948, '231b':4946, '23cf':62818, '23e9':62805, '23ea':62809, '23eb':62812, '23ec':62814, '23ed':62806, '23ee':62810, '23ef':62807, '23f0':4949, '23f1':4950, '23f2':4951, '23f3':4947, '23f8':62815, '23f9':62816, '23fa':62817, '24c2':62890, '25aa':62938, '25ab':62939, '25b6':62804, '25c0':62808, '25fb':62935, '25fc':62934, '25fd':62937, '25fe':62936, '260e':61184, '261d':1350, '262a':62784, '262e':62785, '262f':62781, '263a':120, '264a':62790, '264b':62791, '264c':62792, '264d':62793, '264e':62794, '264f':62795, '265f':51099, '267b':62844, '267e':62833, '267f':62732, '269b':62777, '269c':62845, '26a0':62742, '26a1':41016, '26a7':62827, '26aa':62924, '26ab':62923, '26b0':61359, '26b1':61361, '26bd':51051, '26be':51052, '26c4':41019, '26c5':4999, '26c8':41000, '26ce':62800, '26cf':61296, '26d1':61150, '26d3':61314, '26d4':62744, '26e9':4853, '26ea':4849, '26f0':4814, '26f1':41015, '26f2':4855, '26f3':51070, '26f4':4928, '26f5':4924, '26f7':1599, '26f8':51071, '26f9-200d-2640':1615, '26f9-200d-2642':1614, '26f9':1613, '26fa':4856, '26fd':4915, '270a':1354, '270b':1330, '270c':1339, '270d':1365, '270f':61258, '271d':62782, '274c':62853, '274e':62854, '2764-200d-1f525':1139, '2764-200d-1fa79':1140, '27a1':62757, '27b0':62855, '27bf':62856, '2b05':62761, '2b06':62755, '2b07':62759, '2b1b':62932, '2b1c':62933, '2b50':4994, '2b55':62849, '303d':62857, '1f385-1f3fb':0, '1f385-1f3fc':0, '1f385-1f3fd':0, '1f385-1f3fe':0, '1f385-1f3ff':0, '1f3c2-1f3fb':0, '1f3c2-1f3fc':0, '1f3c2-1f3fd':0, '1f3c2-1f3fe':0, '1f3c2-1f3ff':0, '1f3c3-1f3fb-200d-2640':0, '1f3c3-1f3fc-200d-2640':0, '1f3c3-1f3fd-200d-2640':0, '1f3c3-1f3fe-200d-2640':0, '1f3c3-1f3ff-200d-2640':0, '1f3c3-1f3fb-200d-2642':0, '1f3c3-1f3fc-200d-2642':0, '1f3c3-1f3fd-200d-2642':0, '1f3c3-1f3fe-200d-2642':0, '1f3c3-1f3ff-200d-2642':0, '1f3c3-1f3fb':0, '1f3c3-1f3fc':0, '1f3c3-1f3fd':0, '1f3c3-1f3fe':0, '1f3c3-1f3ff':0, '1f3c4-1f3fb-200d-2640':0, '1f3c4-1f3fc-200d-2640':0, '1f3c4-1f3fd-200d-2640':0, '1f3c4-1f3fe-200d-2640':0, '1f3c4-1f3ff-200d-2640':0, '1f3c4-1f3fb-200d-2642':0, '1f3c4-1f3fc-200d-2642':0, '1f3c4-1f3fd-200d-2642':0, '1f3c4-1f3fe-200d-2642':0, '1f3c4-1f3ff-200d-2642':0, '1f3c4-1f3fb':0, '1f3c4-1f3fc':0, '1f3c4-1f3fd':0, '1f3c4-1f3fe':0, '1f3c4-1f3ff':0, '1f3c7-1f3fb':0, '1f3c7-1f3fc':0, '1f3c7-1f3fd':0, '1f3c7-1f3fe':0, '1f3c7-1f3ff':0, '1f3ca-1f3fb-200d-2640':0, '1f3ca-1f3fc-200d-2640':0, '1f3ca-1f3fd-200d-2640':0, '1f3ca-1f3fe-200d-2640':0, '1f3ca-1f3ff-200d-2640':0, '1f3ca-1f3fb-200d-2642':0, '1f3ca-1f3fc-200d-2642':0, '1f3ca-1f3fd-200d-2642':0, '1f3ca-1f3fe-200d-2642':0, '1f3ca-1f3ff-200d-2642':0, '1f3ca-1f3fb':0, '1f3ca-1f3fc':0, '1f3ca-1f3fd':0, '1f3ca-1f3fe':0, '1f3ca-1f3ff':0, '1f3cb-1f3fb-200d-2640':0, '1f3cb-1f3fc-200d-2640':0, '1f3cb-1f3fd-200d-2640':0, '1f3cb-1f3fe-200d-2640':0, '1f3cb-1f3ff-200d-2640':0, '1f3cb-1f3fb-200d-2642':0, '1f3cb-1f3fc-200d-2642':0, '1f3cb-1f3fd-200d-2642':0, '1f3cb-1f3fe-200d-2642':0, '1f3cb-1f3ff-200d-2642':0, '1f3cb-1f3fb':0, '1f3cb-1f3fc':0, '1f3cb-1f3fd':0, '1f3cb-1f3fe':0, '1f3cb-1f3ff':0, '1f3cc-1f3fb-200d-2640':0, '1f3cc-1f3fc-200d-2640':0, '1f3cc-1f3fd-200d-2640':0, '1f3cc-1f3fe-200d-2640':0, '1f3cc-1f3ff-200d-2640':0, '1f3cc-1f3fb-200d-2642':0, '1f3cc-1f3fc-200d-2642':0, '1f3cc-1f3fd-200d-2642':0, '1f3cc-1f3fe-200d-2642':0, '1f3cc-1f3ff-200d-2642':0, '1f3cc-1f3fb':0, '1f3cc-1f3fc':0, '1f3cc-1f3fd':0, '1f3cc-1f3fe':0, '1f3cc-1f3ff':0, '1f442-1f3fb':0, '1f442-1f3fc':0, '1f442-1f3fd':0, '1f442-1f3fe':0, '1f442-1f3ff':0, '1f443-1f3fb':0, '1f443-1f3fc':0, '1f443-1f3fd':0, '1f443-1f3fe':0, '1f443-1f3ff':0, '1f446-1f3fb':0, '1f446-1f3fc':0, '1f446-1f3fd':0, '1f446-1f3fe':0, '1f446-1f3ff':0, '1f447-1f3fb':0, '1f447-1f3fc':0, '1f447-1f3fd':0, '1f447-1f3fe':0, '1f447-1f3ff':0, '1f448-1f3fb':0, '1f448-1f3fc':0, '1f448-1f3fd':0, '1f448-1f3fe':0, '1f448-1f3ff':0, '1f449-1f3fb':0, '1f449-1f3fc':0, '1f449-1f3fd':0, '1f449-1f3fe':0, '1f449-1f3ff':0, '1f44a-1f3fb':0, '1f44a-1f3fc':0, '1f44a-1f3fd':0, '1f44a-1f3fe':0, '1f44a-1f3ff':0, '1f44b-1f3fb':0, '1f44b-1f3fc':0, '1f44b-1f3fd':0, '1f44b-1f3fe':0, '1f44b-1f3ff':0, '1f44c-1f3fb':0, '1f44c-1f3fc':0, '1f44c-1f3fd':0, '1f44c-1f3fe':0, '1f44c-1f3ff':0, '1f44d-1f3fb':0, '1f44d-1f3fc':0, '1f44d-1f3fd':0, '1f44d-1f3fe':0, '1f44d-1f3ff':0, '1f44e-1f3fb':0, '1f44e-1f3fc':0, '1f44e-1f3fd':0, '1f44e-1f3fe':0, '1f44e-1f3ff':0, '1f44f-1f3fb':0, '1f44f-1f3fc':0, '1f44f-1f3fd':0, '1f44f-1f3fe':0, '1f44f-1f3ff':0, '1f450-1f3fb':0, '1f450-1f3fc':0, '1f450-1f3fd':0, '1f450-1f3fe':0, '1f450-1f3ff':0, '1f466-1f3fb':0, '1f466-1f3fc':0, '1f466-1f3fd':0, '1f466-1f3fe':0, '1f466-1f3ff':0, '1f467-1f3fb':0, '1f467-1f3fc':0, '1f467-1f3fd':0, '1f467-1f3fe':0, '1f467-1f3ff':0, '1f468-1f3fb-200d-1f33e':0, '1f468-1f3fc-200d-1f33e':0, '1f468-1f3fd-200d-1f33e':0, '1f468-1f3fe-200d-1f33e':0, '1f468-1f3ff-200d-1f33e':0, '1f468-1f3fb-200d-1f373':0, '1f468-1f3fc-200d-1f373':0, '1f468-1f3fd-200d-1f373':0, '1f468-1f3fe-200d-1f373':0, '1f468-1f3ff-200d-1f373':0, '1f468-1f3fb-200d-1f37c':0, '1f468-1f3fc-200d-1f37c':0, '1f468-1f3fd-200d-1f37c':0, '1f468-1f3fe-200d-1f37c':0, '1f468-1f3ff-200d-1f37c':0, '1f468-1f3fb-200d-1f393':0, '1f468-1f3fc-200d-1f393':0, '1f468-1f3fd-200d-1f393':0, '1f468-1f3fe-200d-1f393':0, '1f468-1f3ff-200d-1f393':0, '1f468-1f3fb-200d-1f3a4':0, '1f468-1f3fc-200d-1f3a4':0, '1f468-1f3fd-200d-1f3a4':0, '1f468-1f3fe-200d-1f3a4':0, '1f468-1f3ff-200d-1f3a4':0, '1f468-1f3fb-200d-1f3a8':0, '1f468-1f3fc-200d-1f3a8':0, '1f468-1f3fd-200d-1f3a8':0, '1f468-1f3fe-200d-1f3a8':0, '1f468-1f3ff-200d-1f3a8':0, '1f468-1f3fb-200d-1f3eb':0, '1f468-1f3fc-200d-1f3eb':0, '1f468-1f3fd-200d-1f3eb':0, '1f468-1f3fe-200d-1f3eb':0, '1f468-1f3ff-200d-1f3eb':0, '1f468-1f3fb-200d-1f3ed':0, '1f468-1f3fc-200d-1f3ed':0, '1f468-1f3fd-200d-1f3ed':0, '1f468-1f3fe-200d-1f3ed':0, '1f468-1f3ff-200d-1f3ed':0, '1f468-1f3fb-200d-1f4bb':0, '1f468-1f3fc-200d-1f4bb':0, '1f468-1f3fd-200d-1f4bb':0, '1f468-1f3fe-200d-1f4bb':0, '1f468-1f3ff-200d-1f4bb':0, '1f468-1f3fb-200d-1f4bc':0, '1f468-1f3fc-200d-1f4bc':0, '1f468-1f3fd-200d-1f4bc':0, '1f468-1f3fe-200d-1f4bc':0, '1f468-1f3ff-200d-1f4bc':0, '1f468-1f3fb-200d-1f527':0, '1f468-1f3fc-200d-1f527':0, '1f468-1f3fd-200d-1f527':0, '1f468-1f3fe-200d-1f527':0, '1f468-1f3ff-200d-1f527':0, '1f468-1f3fb-200d-1f52c':0, '1f468-1f3fc-200d-1f52c':0, '1f468-1f3fd-200d-1f52c':0, '1f468-1f3fe-200d-1f52c':0, '1f468-1f3ff-200d-1f52c':0, '1f468-1f3fb-200d-1f680':0, '1f468-1f3fc-200d-1f680':0, '1f468-1f3fd-200d-1f680':0, '1f468-1f3fe-200d-1f680':0, '1f468-1f3ff-200d-1f680':0, '1f468-1f3fb-200d-1f692':0, '1f468-1f3fc-200d-1f692':0, '1f468-1f3fd-200d-1f692':0, '1f468-1f3fe-200d-1f692':0, '1f468-1f3ff-200d-1f692':0, '1f468-1f3fb-200d-1f9af':0, '1f468-1f3fc-200d-1f9af':0, '1f468-1f3fd-200d-1f9af':0, '1f468-1f3fe-200d-1f9af':0, '1f468-1f3ff-200d-1f9af':0, '1f468-1f3fb-200d-1f9b0':0, '1f468-1f3fc-200d-1f9b0':0, '1f468-1f3fd-200d-1f9b0':0, '1f468-1f3fe-200d-1f9b0':0, '1f468-1f3ff-200d-1f9b0':0, '1f468-1f3fb-200d-1f9b1':0, '1f468-1f3fc-200d-1f9b1':0, '1f468-1f3fd-200d-1f9b1':0, '1f468-1f3fe-200d-1f9b1':0, '1f468-1f3ff-200d-1f9b1':0, '1f468-1f3fb-200d-1f9b2':0, '1f468-1f3fc-200d-1f9b2':0, '1f468-1f3fd-200d-1f9b2':0, '1f468-1f3fe-200d-1f9b2':0, '1f468-1f3ff-200d-1f9b2':0, '1f468-1f3fb-200d-1f9b3':0, '1f468-1f3fc-200d-1f9b3':0, '1f468-1f3fd-200d-1f9b3':0, '1f468-1f3fe-200d-1f9b3':0, '1f468-1f3ff-200d-1f9b3':0, '1f468-1f3fb-200d-1f9bc':0, '1f468-1f3fc-200d-1f9bc':0, '1f468-1f3fd-200d-1f9bc':0, '1f468-1f3fe-200d-1f9bc':0, '1f468-1f3ff-200d-1f9bc':0, '1f468-1f3fb-200d-1f9bd':0, '1f468-1f3fc-200d-1f9bd':0, '1f468-1f3fd-200d-1f9bd':0, '1f468-1f3fe-200d-1f9bd':0, '1f468-1f3ff-200d-1f9bd':0, '1f468-1f3fb-200d-2695':0, '1f468-1f3fc-200d-2695':0, '1f468-1f3fd-200d-2695':0, '1f468-1f3fe-200d-2695':0, '1f468-1f3ff-200d-2695':0, '1f468-1f3fb-200d-2696':0, '1f468-1f3fc-200d-2696':0, '1f468-1f3fd-200d-2696':0, '1f468-1f3fe-200d-2696':0, '1f468-1f3ff-200d-2696':0, '1f468-1f3fb-200d-2708':0, '1f468-1f3fc-200d-2708':0, '1f468-1f3fd-200d-2708':0, '1f468-1f3fe-200d-2708':0, '1f468-1f3ff-200d-2708':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3fb':0, '1f468-1f3fc':0, '1f468-1f3fd':0, '1f468-1f3fe':0, '1f468-1f3ff':0, '1f469-1f3fb-200d-1f33e':0, '1f469-1f3fc-200d-1f33e':0, '1f469-1f3fd-200d-1f33e':0, '1f469-1f3fe-200d-1f33e':0, '1f469-1f3ff-200d-1f33e':0, '1f469-1f3fb-200d-1f373':0, '1f469-1f3fc-200d-1f373':0, '1f469-1f3fd-200d-1f373':0, '1f469-1f3fe-200d-1f373':0, '1f469-1f3ff-200d-1f373':0, '1f469-1f3fb-200d-1f37c':0, '1f469-1f3fc-200d-1f37c':0, '1f469-1f3fd-200d-1f37c':0, '1f469-1f3fe-200d-1f37c':0, '1f469-1f3ff-200d-1f37c':0, '1f469-1f3fb-200d-1f393':0, '1f469-1f3fc-200d-1f393':0, '1f469-1f3fd-200d-1f393':0, '1f469-1f3fe-200d-1f393':0, '1f469-1f3ff-200d-1f393':0, '1f469-1f3fb-200d-1f3a4':0, '1f469-1f3fc-200d-1f3a4':0, '1f469-1f3fd-200d-1f3a4':0, '1f469-1f3fe-200d-1f3a4':0, '1f469-1f3ff-200d-1f3a4':0, '1f469-1f3fb-200d-1f3a8':0, '1f469-1f3fc-200d-1f3a8':0, '1f469-1f3fd-200d-1f3a8':0, '1f469-1f3fe-200d-1f3a8':0, '1f469-1f3ff-200d-1f3a8':0, '1f469-1f3fb-200d-1f3eb':0, '1f469-1f3fc-200d-1f3eb':0, '1f469-1f3fd-200d-1f3eb':0, '1f469-1f3fe-200d-1f3eb':0, '1f469-1f3ff-200d-1f3eb':0, '1f469-1f3fb-200d-1f3ed':0, '1f469-1f3fc-200d-1f3ed':0, '1f469-1f3fd-200d-1f3ed':0, '1f469-1f3fe-200d-1f3ed':0, '1f469-1f3ff-200d-1f3ed':0, '1f469-1f3fb-200d-1f4bb':0, '1f469-1f3fc-200d-1f4bb':0, '1f469-1f3fd-200d-1f4bb':0, '1f469-1f3fe-200d-1f4bb':0, '1f469-1f3ff-200d-1f4bb':0, '1f469-1f3fb-200d-1f4bc':0, '1f469-1f3fc-200d-1f4bc':0, '1f469-1f3fd-200d-1f4bc':0, '1f469-1f3fe-200d-1f4bc':0, '1f469-1f3ff-200d-1f4bc':0, '1f469-1f3fb-200d-1f527':0, '1f469-1f3fc-200d-1f527':0, '1f469-1f3fd-200d-1f527':0, '1f469-1f3fe-200d-1f527':0, '1f469-1f3ff-200d-1f527':0, '1f469-1f3fb-200d-1f52c':0, '1f469-1f3fc-200d-1f52c':0, '1f469-1f3fd-200d-1f52c':0, '1f469-1f3fe-200d-1f52c':0, '1f469-1f3ff-200d-1f52c':0, '1f469-1f3fb-200d-1f680':0, '1f469-1f3fc-200d-1f680':0, '1f469-1f3fd-200d-1f680':0, '1f469-1f3fe-200d-1f680':0, '1f469-1f3ff-200d-1f680':0, '1f469-1f3fb-200d-1f692':0, '1f469-1f3fc-200d-1f692':0, '1f469-1f3fd-200d-1f692':0, '1f469-1f3fe-200d-1f692':0, '1f469-1f3ff-200d-1f692':0, '1f469-1f3fb-200d-1f9af':0, '1f469-1f3fc-200d-1f9af':0, '1f469-1f3fd-200d-1f9af':0, '1f469-1f3fe-200d-1f9af':0, '1f469-1f3ff-200d-1f9af':0, '1f469-1f3fb-200d-1f9b0':0, '1f469-1f3fc-200d-1f9b0':0, '1f469-1f3fd-200d-1f9b0':0, '1f469-1f3fe-200d-1f9b0':0, '1f469-1f3ff-200d-1f9b0':0, '1f469-1f3fb-200d-1f9b1':0, '1f469-1f3fc-200d-1f9b1':0, '1f469-1f3fd-200d-1f9b1':0, '1f469-1f3fe-200d-1f9b1':0, '1f469-1f3ff-200d-1f9b1':0, '1f469-1f3fb-200d-1f9b2':0, '1f469-1f3fc-200d-1f9b2':0, '1f469-1f3fd-200d-1f9b2':0, '1f469-1f3fe-200d-1f9b2':0, '1f469-1f3ff-200d-1f9b2':0, '1f469-1f3fb-200d-1f9b3':0, '1f469-1f3fc-200d-1f9b3':0, '1f469-1f3fd-200d-1f9b3':0, '1f469-1f3fe-200d-1f9b3':0, '1f469-1f3ff-200d-1f9b3':0, '1f469-1f3fb-200d-1f9bc':0, '1f469-1f3fc-200d-1f9bc':0, '1f469-1f3fd-200d-1f9bc':0, '1f469-1f3fe-200d-1f9bc':0, '1f469-1f3ff-200d-1f9bc':0, '1f469-1f3fb-200d-1f9bd':0, '1f469-1f3fc-200d-1f9bd':0, '1f469-1f3fd-200d-1f9bd':0, '1f469-1f3fe-200d-1f9bd':0, '1f469-1f3ff-200d-1f9bd':0, '1f469-1f3fb-200d-2695':0, '1f469-1f3fc-200d-2695':0, '1f469-1f3fd-200d-2695':0, '1f469-1f3fe-200d-2695':0, '1f469-1f3ff-200d-2695':0, '1f469-1f3fb-200d-2696':0, '1f469-1f3fc-200d-2696':0, '1f469-1f3fd-200d-2696':0, '1f469-1f3fe-200d-2696':0, '1f469-1f3ff-200d-2696':0, '1f469-1f3fb-200d-2708':0, '1f469-1f3fc-200d-2708':0, '1f469-1f3fd-200d-2708':0, '1f469-1f3fe-200d-2708':0, '1f469-1f3ff-200d-2708':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3fb':0, '1f469-1f3fc':0, '1f469-1f3fd':0, '1f469-1f3fe':0, '1f469-1f3ff':0, '1f46b-1f3fb':0, '1f46b-1f3fc':0, '1f46b-1f3fd':0, '1f46b-1f3fe':0, '1f46b-1f3ff':0, '1f469-1f3fb-200d-1f91d-200d-1f468-1f3fc':0, '1f469-1f3fb-200d-1f91d-200d-1f468-1f3fd':0, '1f469-1f3fb-200d-1f91d-200d-1f468-1f3fe':0, '1f469-1f3fb-200d-1f91d-200d-1f468-1f3ff':0, '1f469-1f3fc-200d-1f91d-200d-1f468-1f3fb':0, '1f469-1f3fc-200d-1f91d-200d-1f468-1f3fd':0, '1f469-1f3fc-200d-1f91d-200d-1f468-1f3fe':0, '1f469-1f3fc-200d-1f91d-200d-1f468-1f3ff':0, '1f469-1f3fd-200d-1f91d-200d-1f468-1f3fb':0, '1f469-1f3fd-200d-1f91d-200d-1f468-1f3fc':0, '1f469-1f3fd-200d-1f91d-200d-1f468-1f3fe':0, '1f469-1f3fd-200d-1f91d-200d-1f468-1f3ff':0, '1f469-1f3fe-200d-1f91d-200d-1f468-1f3fb':0, '1f469-1f3fe-200d-1f91d-200d-1f468-1f3fc':0, '1f469-1f3fe-200d-1f91d-200d-1f468-1f3fd':0, '1f469-1f3fe-200d-1f91d-200d-1f468-1f3ff':0, '1f469-1f3ff-200d-1f91d-200d-1f468-1f3fb':0, '1f469-1f3ff-200d-1f91d-200d-1f468-1f3fc':0, '1f469-1f3ff-200d-1f91d-200d-1f468-1f3fd':0, '1f469-1f3ff-200d-1f91d-200d-1f468-1f3fe':0, '1f46c-1f3fb':0, '1f46c-1f3fc':0, '1f46c-1f3fd':0, '1f46c-1f3fe':0, '1f46c-1f3ff':0, '1f468-1f3fb-200d-1f91d-200d-1f468-1f3fc':0, '1f468-1f3fb-200d-1f91d-200d-1f468-1f3fd':0, '1f468-1f3fb-200d-1f91d-200d-1f468-1f3fe':0, '1f468-1f3fb-200d-1f91d-200d-1f468-1f3ff':0, '1f468-1f3fc-200d-1f91d-200d-1f468-1f3fb':0, '1f468-1f3fc-200d-1f91d-200d-1f468-1f3fd':0, '1f468-1f3fc-200d-1f91d-200d-1f468-1f3fe':0, '1f468-1f3fc-200d-1f91d-200d-1f468-1f3ff':0, '1f468-1f3fd-200d-1f91d-200d-1f468-1f3fb':0, '1f468-1f3fd-200d-1f91d-200d-1f468-1f3fc':0, '1f468-1f3fd-200d-1f91d-200d-1f468-1f3fe':0, '1f468-1f3fd-200d-1f91d-200d-1f468-1f3ff':0, '1f468-1f3fe-200d-1f91d-200d-1f468-1f3fb':0, '1f468-1f3fe-200d-1f91d-200d-1f468-1f3fc':0, '1f468-1f3fe-200d-1f91d-200d-1f468-1f3fd':0, '1f468-1f3fe-200d-1f91d-200d-1f468-1f3ff':0, '1f468-1f3ff-200d-1f91d-200d-1f468-1f3fb':0, '1f468-1f3ff-200d-1f91d-200d-1f468-1f3fc':0, '1f468-1f3ff-200d-1f91d-200d-1f468-1f3fd':0, '1f468-1f3ff-200d-1f91d-200d-1f468-1f3fe':0, '1f46d-1f3fb':0, '1f46d-1f3fc':0, '1f46d-1f3fd':0, '1f46d-1f3fe':0, '1f46d-1f3ff':0, '1f469-1f3fb-200d-1f91d-200d-1f469-1f3fc':0, '1f469-1f3fb-200d-1f91d-200d-1f469-1f3fd':0, '1f469-1f3fb-200d-1f91d-200d-1f469-1f3fe':0, '1f469-1f3fb-200d-1f91d-200d-1f469-1f3ff':0, '1f469-1f3fc-200d-1f91d-200d-1f469-1f3fb':0, '1f469-1f3fc-200d-1f91d-200d-1f469-1f3fd':0, '1f469-1f3fc-200d-1f91d-200d-1f469-1f3fe':0, '1f469-1f3fc-200d-1f91d-200d-1f469-1f3ff':0, '1f469-1f3fd-200d-1f91d-200d-1f469-1f3fb':0, '1f469-1f3fd-200d-1f91d-200d-1f469-1f3fc':0, '1f469-1f3fd-200d-1f91d-200d-1f469-1f3fe':0, '1f469-1f3fd-200d-1f91d-200d-1f469-1f3ff':0, '1f469-1f3fe-200d-1f91d-200d-1f469-1f3fb':0, '1f469-1f3fe-200d-1f91d-200d-1f469-1f3fc':0, '1f469-1f3fe-200d-1f91d-200d-1f469-1f3fd':0, '1f469-1f3fe-200d-1f91d-200d-1f469-1f3ff':0, '1f469-1f3ff-200d-1f91d-200d-1f469-1f3fb':0, '1f469-1f3ff-200d-1f91d-200d-1f469-1f3fc':0, '1f469-1f3ff-200d-1f91d-200d-1f469-1f3fd':0, '1f469-1f3ff-200d-1f91d-200d-1f469-1f3fe':0, '1f46e-1f3fb-200d-2640':0, '1f46e-1f3fc-200d-2640':0, '1f46e-1f3fd-200d-2640':0, '1f46e-1f3fe-200d-2640':0, '1f46e-1f3ff-200d-2640':0, '1f46e-1f3fb-200d-2642':0, '1f46e-1f3fc-200d-2642':0, '1f46e-1f3fd-200d-2642':0, '1f46e-1f3fe-200d-2642':0, '1f46e-1f3ff-200d-2642':0, '1f46e-1f3fb':0, '1f46e-1f3fc':0, '1f46e-1f3fd':0, '1f46e-1f3fe':0, '1f46e-1f3ff':0, '1f470-1f3fb-200d-2640':0, '1f470-1f3fc-200d-2640':0, '1f470-1f3fd-200d-2640':0, '1f470-1f3fe-200d-2640':0, '1f470-1f3ff-200d-2640':0, '1f470-1f3fb-200d-2642':0, '1f470-1f3fc-200d-2642':0, '1f470-1f3fd-200d-2642':0, '1f470-1f3fe-200d-2642':0, '1f470-1f3ff-200d-2642':0, '1f470-1f3fb':0, '1f470-1f3fc':0, '1f470-1f3fd':0, '1f470-1f3fe':0, '1f470-1f3ff':0, '1f471-1f3fb-200d-2640':0, '1f471-1f3fc-200d-2640':0, '1f471-1f3fd-200d-2640':0, '1f471-1f3fe-200d-2640':0, '1f471-1f3ff-200d-2640':0, '1f471-1f3fb-200d-2642':0, '1f471-1f3fc-200d-2642':0, '1f471-1f3fd-200d-2642':0, '1f471-1f3fe-200d-2642':0, '1f471-1f3ff-200d-2642':0, '1f471-1f3fb':0, '1f471-1f3fc':0, '1f471-1f3fd':0, '1f471-1f3fe':0, '1f471-1f3ff':0, '1f472-1f3fb':0, '1f472-1f3fc':0, '1f472-1f3fd':0, '1f472-1f3fe':0, '1f472-1f3ff':0, '1f473-1f3fb-200d-2640':0, '1f473-1f3fc-200d-2640':0, '1f473-1f3fd-200d-2640':0, '1f473-1f3fe-200d-2640':0, '1f473-1f3ff-200d-2640':0, '1f473-1f3fb-200d-2642':0, '1f473-1f3fc-200d-2642':0, '1f473-1f3fd-200d-2642':0, '1f473-1f3fe-200d-2642':0, '1f473-1f3ff-200d-2642':0, '1f473-1f3fb':0, '1f473-1f3fc':0, '1f473-1f3fd':0, '1f473-1f3fe':0, '1f473-1f3ff':0, '1f474-1f3fb':0, '1f474-1f3fc':0, '1f474-1f3fd':0, '1f474-1f3fe':0, '1f474-1f3ff':0, '1f475-1f3fb':0, '1f475-1f3fc':0, '1f475-1f3fd':0, '1f475-1f3fe':0, '1f475-1f3ff':0, '1f476-1f3fb':0, '1f476-1f3fc':0, '1f476-1f3fd':0, '1f476-1f3fe':0, '1f476-1f3ff':0, '1f477-1f3fb-200d-2640':0, '1f477-1f3fc-200d-2640':0, '1f477-1f3fd-200d-2640':0, '1f477-1f3fe-200d-2640':0, '1f477-1f3ff-200d-2640':0, '1f477-1f3fb-200d-2642':0, '1f477-1f3fc-200d-2642':0, '1f477-1f3fd-200d-2642':0, '1f477-1f3fe-200d-2642':0, '1f477-1f3ff-200d-2642':0, '1f477-1f3fb':0, '1f477-1f3fc':0, '1f477-1f3fd':0, '1f477-1f3fe':0, '1f477-1f3ff':0, '1f478-1f3fb':0, '1f478-1f3fc':0, '1f478-1f3fd':0, '1f478-1f3fe':0, '1f478-1f3ff':0, '1f47c-1f3fb':0, '1f47c-1f3fc':0, '1f47c-1f3fd':0, '1f47c-1f3fe':0, '1f47c-1f3ff':0, '1f481-1f3fb-200d-2640':0, '1f481-1f3fc-200d-2640':0, '1f481-1f3fd-200d-2640':0, '1f481-1f3fe-200d-2640':0, '1f481-1f3ff-200d-2640':0, '1f481-1f3fb-200d-2642':0, '1f481-1f3fc-200d-2642':0, '1f481-1f3fd-200d-2642':0, '1f481-1f3fe-200d-2642':0, '1f481-1f3ff-200d-2642':0, '1f481-1f3fb':0, '1f481-1f3fc':0, '1f481-1f3fd':0, '1f481-1f3fe':0, '1f481-1f3ff':0, '1f482-1f3fb-200d-2640':0, '1f482-1f3fc-200d-2640':0, '1f482-1f3fd-200d-2640':0, '1f482-1f3fe-200d-2640':0, '1f482-1f3ff-200d-2640':0, '1f482-1f3fb-200d-2642':0, '1f482-1f3fc-200d-2642':0, '1f482-1f3fd-200d-2642':0, '1f482-1f3fe-200d-2642':0, '1f482-1f3ff-200d-2642':0, '1f482-1f3fb':0, '1f482-1f3fc':0, '1f482-1f3fd':0, '1f482-1f3fe':0, '1f482-1f3ff':0, '1f483-1f3fb':0, '1f483-1f3fc':0, '1f483-1f3fd':0, '1f483-1f3fe':0, '1f483-1f3ff':0, '1f485-1f3fb':0, '1f485-1f3fc':0, '1f485-1f3fd':0, '1f485-1f3fe':0, '1f485-1f3ff':0, '1f486-1f3fb-200d-2640':0, '1f486-1f3fc-200d-2640':0, '1f486-1f3fd-200d-2640':0, '1f486-1f3fe-200d-2640':0, '1f486-1f3ff-200d-2640':0, '1f486-1f3fb-200d-2642':0, '1f486-1f3fc-200d-2642':0, '1f486-1f3fd-200d-2642':0, '1f486-1f3fe-200d-2642':0, '1f486-1f3ff-200d-2642':0, '1f486-1f3fb':0, '1f486-1f3fc':0, '1f486-1f3fd':0, '1f486-1f3fe':0, '1f486-1f3ff':0, '1f487-1f3fb-200d-2640':0, '1f487-1f3fc-200d-2640':0, '1f487-1f3fd-200d-2640':0, '1f487-1f3fe-200d-2640':0, '1f487-1f3ff-200d-2640':0, '1f487-1f3fb-200d-2642':0, '1f487-1f3fc-200d-2642':0, '1f487-1f3fd-200d-2642':0, '1f487-1f3fe-200d-2642':0, '1f487-1f3ff-200d-2642':0, '1f487-1f3fb':0, '1f487-1f3fc':0, '1f487-1f3fd':0, '1f487-1f3fe':0, '1f487-1f3ff':0, '1f48f-1f3fb':0, '1f48f-1f3fc':0, '1f48f-1f3fd':0, '1f48f-1f3fe':0, '1f48f-1f3ff':0, '1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fc':0, '1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fd':0, '1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fe':0, '1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3ff':0, '1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fb':0, '1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fd':0, '1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fe':0, '1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3ff':0, '1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fb':0, '1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fc':0, '1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fe':0, '1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3ff':0, '1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fb':0, '1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fc':0, '1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fd':0, '1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3ff':0, '1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fb':0, '1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fc':0, '1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fd':0, '1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fe':0, '1f491-1f3fb':0, '1f491-1f3fc':0, '1f491-1f3fd':0, '1f491-1f3fe':0, '1f491-1f3ff':0, '1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fc':0, '1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fd':0, '1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fe':0, '1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3ff':0, '1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fb':0, '1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fd':0, '1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fe':0, '1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3ff':0, '1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fb':0, '1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fc':0, '1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fe':0, '1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3ff':0, '1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fb':0, '1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fc':0, '1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fd':0, '1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3ff':0, '1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fb':0, '1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fc':0, '1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fd':0, '1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fe':0, '1f4aa-1f3fb':0, '1f4aa-1f3fc':0, '1f4aa-1f3fd':0, '1f4aa-1f3fe':0, '1f4aa-1f3ff':0, '1f574-1f3fb':0, '1f574-1f3fc':0, '1f574-1f3fd':0, '1f574-1f3fe':0, '1f574-1f3ff':0, '1f575-1f3fb-200d-2640':0, '1f575-1f3fc-200d-2640':0, '1f575-1f3fd-200d-2640':0, '1f575-1f3fe-200d-2640':0, '1f575-1f3ff-200d-2640':0, '1f575-1f3fb-200d-2642':0, '1f575-1f3fc-200d-2642':0, '1f575-1f3fd-200d-2642':0, '1f575-1f3fe-200d-2642':0, '1f575-1f3ff-200d-2642':0, '1f575-1f3fb':0, '1f575-1f3fc':0, '1f575-1f3fd':0, '1f575-1f3fe':0, '1f575-1f3ff':0, '1f57a-1f3fb':0, '1f57a-1f3fc':0, '1f57a-1f3fd':0, '1f57a-1f3fe':0, '1f57a-1f3ff':0, '1f590-1f3fb':0, '1f590-1f3fc':0, '1f590-1f3fd':0, '1f590-1f3fe':0, '1f590-1f3ff':0, '1f595-1f3fb':0, '1f595-1f3fc':0, '1f595-1f3fd':0, '1f595-1f3fe':0, '1f595-1f3ff':0, '1f596-1f3fb':0, '1f596-1f3fc':0, '1f596-1f3fd':0, '1f596-1f3fe':0, '1f596-1f3ff':0, '1f645-1f3fb-200d-2640':0, '1f645-1f3fc-200d-2640':0, '1f645-1f3fd-200d-2640':0, '1f645-1f3fe-200d-2640':0, '1f645-1f3ff-200d-2640':0, '1f645-1f3fb-200d-2642':0, '1f645-1f3fc-200d-2642':0, '1f645-1f3fd-200d-2642':0, '1f645-1f3fe-200d-2642':0, '1f645-1f3ff-200d-2642':0, '1f645-1f3fb':0, '1f645-1f3fc':0, '1f645-1f3fd':0, '1f645-1f3fe':0, '1f645-1f3ff':0, '1f646-1f3fb-200d-2640':0, '1f646-1f3fc-200d-2640':0, '1f646-1f3fd-200d-2640':0, '1f646-1f3fe-200d-2640':0, '1f646-1f3ff-200d-2640':0, '1f646-1f3fb-200d-2642':0, '1f646-1f3fc-200d-2642':0, '1f646-1f3fd-200d-2642':0, '1f646-1f3fe-200d-2642':0, '1f646-1f3ff-200d-2642':0, '1f646-1f3fb':0, '1f646-1f3fc':0, '1f646-1f3fd':0, '1f646-1f3fe':0, '1f646-1f3ff':0, '1f647-1f3fb-200d-2640':0, '1f647-1f3fc-200d-2640':0, '1f647-1f3fd-200d-2640':0, '1f647-1f3fe-200d-2640':0, '1f647-1f3ff-200d-2640':0, '1f647-1f3fb-200d-2642':0, '1f647-1f3fc-200d-2642':0, '1f647-1f3fd-200d-2642':0, '1f647-1f3fe-200d-2642':0, '1f647-1f3ff-200d-2642':0, '1f647-1f3fb':0, '1f647-1f3fc':0, '1f647-1f3fd':0, '1f647-1f3fe':0, '1f647-1f3ff':0, '1f64b-1f3fb-200d-2640':0, '1f64b-1f3fc-200d-2640':0, '1f64b-1f3fd-200d-2640':0, '1f64b-1f3fe-200d-2640':0, '1f64b-1f3ff-200d-2640':0, '1f64b-1f3fb-200d-2642':0, '1f64b-1f3fc-200d-2642':0, '1f64b-1f3fd-200d-2642':0, '1f64b-1f3fe-200d-2642':0, '1f64b-1f3ff-200d-2642':0, '1f64b-1f3fb':0, '1f64b-1f3fc':0, '1f64b-1f3fd':0, '1f64b-1f3fe':0, '1f64b-1f3ff':0, '1f64c-1f3fb':0, '1f64c-1f3fc':0, '1f64c-1f3fd':0, '1f64c-1f3fe':0, '1f64c-1f3ff':0, '1f64d-1f3fb-200d-2640':0, '1f64d-1f3fc-200d-2640':0, '1f64d-1f3fd-200d-2640':0, '1f64d-1f3fe-200d-2640':0, '1f64d-1f3ff-200d-2640':0, '1f64d-1f3fb-200d-2642':0, '1f64d-1f3fc-200d-2642':0, '1f64d-1f3fd-200d-2642':0, '1f64d-1f3fe-200d-2642':0, '1f64d-1f3ff-200d-2642':0, '1f64d-1f3fb':0, '1f64d-1f3fc':0, '1f64d-1f3fd':0, '1f64d-1f3fe':0, '1f64d-1f3ff':0, '1f64e-1f3fb-200d-2640':0, '1f64e-1f3fc-200d-2640':0, '1f64e-1f3fd-200d-2640':0, '1f64e-1f3fe-200d-2640':0, '1f64e-1f3ff-200d-2640':0, '1f64e-1f3fb-200d-2642':0, '1f64e-1f3fc-200d-2642':0, '1f64e-1f3fd-200d-2642':0, '1f64e-1f3fe-200d-2642':0, '1f64e-1f3ff-200d-2642':0, '1f64e-1f3fb':0, '1f64e-1f3fc':0, '1f64e-1f3fd':0, '1f64e-1f3fe':0, '1f64e-1f3ff':0, '1f64f-1f3fb':0, '1f64f-1f3fc':0, '1f64f-1f3fd':0, '1f64f-1f3fe':0, '1f64f-1f3ff':0, '1f6a3-1f3fb-200d-2640':0, '1f6a3-1f3fc-200d-2640':0, '1f6a3-1f3fd-200d-2640':0, '1f6a3-1f3fe-200d-2640':0, '1f6a3-1f3ff-200d-2640':0, '1f6a3-1f3fb-200d-2642':0, '1f6a3-1f3fc-200d-2642':0, '1f6a3-1f3fd-200d-2642':0, '1f6a3-1f3fe-200d-2642':0, '1f6a3-1f3ff-200d-2642':0, '1f6a3-1f3fb':0, '1f6a3-1f3fc':0, '1f6a3-1f3fd':0, '1f6a3-1f3fe':0, '1f6a3-1f3ff':0, '1f6b4-1f3fb-200d-2640':0, '1f6b4-1f3fc-200d-2640':0, '1f6b4-1f3fd-200d-2640':0, '1f6b4-1f3fe-200d-2640':0, '1f6b4-1f3ff-200d-2640':0, '1f6b4-1f3fb-200d-2642':0, '1f6b4-1f3fc-200d-2642':0, '1f6b4-1f3fd-200d-2642':0, '1f6b4-1f3fe-200d-2642':0, '1f6b4-1f3ff-200d-2642':0, '1f6b4-1f3fb':0, '1f6b4-1f3fc':0, '1f6b4-1f3fd':0, '1f6b4-1f3fe':0, '1f6b4-1f3ff':0, '1f6b5-1f3fb-200d-2640':0, '1f6b5-1f3fc-200d-2640':0, '1f6b5-1f3fd-200d-2640':0, '1f6b5-1f3fe-200d-2640':0, '1f6b5-1f3ff-200d-2640':0, '1f6b5-1f3fb-200d-2642':0, '1f6b5-1f3fc-200d-2642':0, '1f6b5-1f3fd-200d-2642':0, '1f6b5-1f3fe-200d-2642':0, '1f6b5-1f3ff-200d-2642':0, '1f6b5-1f3fb':0, '1f6b5-1f3fc':0, '1f6b5-1f3fd':0, '1f6b5-1f3fe':0, '1f6b5-1f3ff':0, '1f6b6-1f3fb-200d-2640':0, '1f6b6-1f3fc-200d-2640':0, '1f6b6-1f3fd-200d-2640':0, '1f6b6-1f3fe-200d-2640':0, '1f6b6-1f3ff-200d-2640':0, '1f6b6-1f3fb-200d-2642':0, '1f6b6-1f3fc-200d-2642':0, '1f6b6-1f3fd-200d-2642':0, '1f6b6-1f3fe-200d-2642':0, '1f6b6-1f3ff-200d-2642':0, '1f6b6-1f3fb':0, '1f6b6-1f3fc':0, '1f6b6-1f3fd':0, '1f6b6-1f3fe':0, '1f6b6-1f3ff':0, '1f6c0-1f3fb':0, '1f6c0-1f3fc':0, '1f6c0-1f3fd':0, '1f6c0-1f3fe':0, '1f6c0-1f3ff':0, '1f6cc-1f3fb':0, '1f6cc-1f3fc':0, '1f6cc-1f3fd':0, '1f6cc-1f3fe':0, '1f6cc-1f3ff':0, '1f90c-1f3fb':0, '1f90c-1f3fc':0, '1f90c-1f3fd':0, '1f90c-1f3fe':0, '1f90c-1f3ff':0, '1f90f-1f3fb':0, '1f90f-1f3fc':0, '1f90f-1f3fd':0, '1f90f-1f3fe':0, '1f90f-1f3ff':0, '1f918-1f3fb':0, '1f918-1f3fc':0, '1f918-1f3fd':0, '1f918-1f3fe':0, '1f918-1f3ff':0, '1f919-1f3fb':0, '1f919-1f3fc':0, '1f919-1f3fd':0, '1f919-1f3fe':0, '1f919-1f3ff':0, '1f91a-1f3fb':0, '1f91a-1f3fc':0, '1f91a-1f3fd':0, '1f91a-1f3fe':0, '1f91a-1f3ff':0, '1f91b-1f3fb':0, '1f91b-1f3fc':0, '1f91b-1f3fd':0, '1f91b-1f3fe':0, '1f91b-1f3ff':0, '1f91c-1f3fb':0, '1f91c-1f3fc':0, '1f91c-1f3fd':0, '1f91c-1f3fe':0, '1f91c-1f3ff':0, '1f91d-1f3fb':0, '1f91d-1f3fc':0, '1f91d-1f3fd':0, '1f91d-1f3fe':0, '1f91d-1f3ff':0, '1f91e-1f3fb':0, '1f91e-1f3fc':0, '1f91e-1f3fd':0, '1f91e-1f3fe':0, '1f91e-1f3ff':0, '1f91f-1f3fb':0, '1f91f-1f3fc':0, '1f91f-1f3fd':0, '1f91f-1f3fe':0, '1f91f-1f3ff':0, '1f926-1f3fb-200d-2640':0, '1f926-1f3fc-200d-2640':0, '1f926-1f3fd-200d-2640':0, '1f926-1f3fe-200d-2640':0, '1f926-1f3ff-200d-2640':0, '1f926-1f3fb-200d-2642':0, '1f926-1f3fc-200d-2642':0, '1f926-1f3fd-200d-2642':0, '1f926-1f3fe-200d-2642':0, '1f926-1f3ff-200d-2642':0, '1f926-1f3fb':0, '1f926-1f3fc':0, '1f926-1f3fd':0, '1f926-1f3fe':0, '1f926-1f3ff':0, '1f930-1f3fb':0, '1f930-1f3fc':0, '1f930-1f3fd':0, '1f930-1f3fe':0, '1f930-1f3ff':0, '1f931-1f3fb':0, '1f931-1f3fc':0, '1f931-1f3fd':0, '1f931-1f3fe':0, '1f931-1f3ff':0, '1f932-1f3fb':0, '1f932-1f3fc':0, '1f932-1f3fd':0, '1f932-1f3fe':0, '1f932-1f3ff':0, '1f933-1f3fb':0, '1f933-1f3fc':0, '1f933-1f3fd':0, '1f933-1f3fe':0, '1f933-1f3ff':0, '1f934-1f3fb':0, '1f934-1f3fc':0, '1f934-1f3fd':0, '1f934-1f3fe':0, '1f934-1f3ff':0, '1f935-1f3fb-200d-2640':0, '1f935-1f3fc-200d-2640':0, '1f935-1f3fd-200d-2640':0, '1f935-1f3fe-200d-2640':0, '1f935-1f3ff-200d-2640':0, '1f935-1f3fb-200d-2642':0, '1f935-1f3fc-200d-2642':0, '1f935-1f3fd-200d-2642':0, '1f935-1f3fe-200d-2642':0, '1f935-1f3ff-200d-2642':0, '1f935-1f3fb':0, '1f935-1f3fc':0, '1f935-1f3fd':0, '1f935-1f3fe':0, '1f935-1f3ff':0, '1f936-1f3fb':0, '1f936-1f3fc':0, '1f936-1f3fd':0, '1f936-1f3fe':0, '1f936-1f3ff':0, '1f937-1f3fb-200d-2640':0, '1f937-1f3fc-200d-2640':0, '1f937-1f3fd-200d-2640':0, '1f937-1f3fe-200d-2640':0, '1f937-1f3ff-200d-2640':0, '1f937-1f3fb-200d-2642':0, '1f937-1f3fc-200d-2642':0, '1f937-1f3fd-200d-2642':0, '1f937-1f3fe-200d-2642':0, '1f937-1f3ff-200d-2642':0, '1f937-1f3fb':0, '1f937-1f3fc':0, '1f937-1f3fd':0, '1f937-1f3fe':0, '1f937-1f3ff':0, '1f938-1f3fb-200d-2640':0, '1f938-1f3fc-200d-2640':0, '1f938-1f3fd-200d-2640':0, '1f938-1f3fe-200d-2640':0, '1f938-1f3ff-200d-2640':0, '1f938-1f3fb-200d-2642':0, '1f938-1f3fc-200d-2642':0, '1f938-1f3fd-200d-2642':0, '1f938-1f3fe-200d-2642':0, '1f938-1f3ff-200d-2642':0, '1f938-1f3fb':0, '1f938-1f3fc':0, '1f938-1f3fd':0, '1f938-1f3fe':0, '1f938-1f3ff':0, '1f939-1f3fb-200d-2640':0, '1f939-1f3fc-200d-2640':0, '1f939-1f3fd-200d-2640':0, '1f939-1f3fe-200d-2640':0, '1f939-1f3ff-200d-2640':0, '1f939-1f3fb-200d-2642':0, '1f939-1f3fc-200d-2642':0, '1f939-1f3fd-200d-2642':0, '1f939-1f3fe-200d-2642':0, '1f939-1f3ff-200d-2642':0, '1f939-1f3fb':0, '1f939-1f3fc':0, '1f939-1f3fd':0, '1f939-1f3fe':0, '1f939-1f3ff':0, '1f93d-1f3fb-200d-2640':0, '1f93d-1f3fc-200d-2640':0, '1f93d-1f3fd-200d-2640':0, '1f93d-1f3fe-200d-2640':0, '1f93d-1f3ff-200d-2640':0, '1f93d-1f3fb-200d-2642':0, '1f93d-1f3fc-200d-2642':0, '1f93d-1f3fd-200d-2642':0, '1f93d-1f3fe-200d-2642':0, '1f93d-1f3ff-200d-2642':0, '1f93d-1f3fb':0, '1f93d-1f3fc':0, '1f93d-1f3fd':0, '1f93d-1f3fe':0, '1f93d-1f3ff':0, '1f93e-1f3fb-200d-2640':0, '1f93e-1f3fc-200d-2640':0, '1f93e-1f3fd-200d-2640':0, '1f93e-1f3fe-200d-2640':0, '1f93e-1f3ff-200d-2640':0, '1f93e-1f3fb-200d-2642':0, '1f93e-1f3fc-200d-2642':0, '1f93e-1f3fd-200d-2642':0, '1f93e-1f3fe-200d-2642':0, '1f93e-1f3ff-200d-2642':0, '1f93e-1f3fb':0, '1f93e-1f3fc':0, '1f93e-1f3fd':0, '1f93e-1f3fe':0, '1f93e-1f3ff':0, '1f977-1f3fb':0, '1f977-1f3fc':0, '1f977-1f3fd':0, '1f977-1f3fe':0, '1f977-1f3ff':0, '1f9b5-1f3fb':0, '1f9b5-1f3fc':0, '1f9b5-1f3fd':0, '1f9b5-1f3fe':0, '1f9b5-1f3ff':0, '1f9b6-1f3fb':0, '1f9b6-1f3fc':0, '1f9b6-1f3fd':0, '1f9b6-1f3fe':0, '1f9b6-1f3ff':0, '1f9b8-1f3fb-200d-2640':0, '1f9b8-1f3fc-200d-2640':0, '1f9b8-1f3fd-200d-2640':0, '1f9b8-1f3fe-200d-2640':0, '1f9b8-1f3ff-200d-2640':0, '1f9b8-1f3fb-200d-2642':0, '1f9b8-1f3fc-200d-2642':0, '1f9b8-1f3fd-200d-2642':0, '1f9b8-1f3fe-200d-2642':0, '1f9b8-1f3ff-200d-2642':0, '1f9b8-1f3fb':0, '1f9b8-1f3fc':0, '1f9b8-1f3fd':0, '1f9b8-1f3fe':0, '1f9b8-1f3ff':0, '1f9b9-1f3fb-200d-2640':0, '1f9b9-1f3fc-200d-2640':0, '1f9b9-1f3fd-200d-2640':0, '1f9b9-1f3fe-200d-2640':0, '1f9b9-1f3ff-200d-2640':0, '1f9b9-1f3fb-200d-2642':0, '1f9b9-1f3fc-200d-2642':0, '1f9b9-1f3fd-200d-2642':0, '1f9b9-1f3fe-200d-2642':0, '1f9b9-1f3ff-200d-2642':0, '1f9b9-1f3fb':0, '1f9b9-1f3fc':0, '1f9b9-1f3fd':0, '1f9b9-1f3fe':0, '1f9b9-1f3ff':0, '1f9bb-1f3fb':0, '1f9bb-1f3fc':0, '1f9bb-1f3fd':0, '1f9bb-1f3fe':0, '1f9bb-1f3ff':0, '1f9cd-1f3fb-200d-2640':0, '1f9cd-1f3fc-200d-2640':0, '1f9cd-1f3fd-200d-2640':0, '1f9cd-1f3fe-200d-2640':0, '1f9cd-1f3ff-200d-2640':0, '1f9cd-1f3fb-200d-2642':0, '1f9cd-1f3fc-200d-2642':0, '1f9cd-1f3fd-200d-2642':0, '1f9cd-1f3fe-200d-2642':0, '1f9cd-1f3ff-200d-2642':0, '1f9cd-1f3fb':0, '1f9cd-1f3fc':0, '1f9cd-1f3fd':0, '1f9cd-1f3fe':0, '1f9cd-1f3ff':0, '1f9ce-1f3fb-200d-2640':0, '1f9ce-1f3fc-200d-2640':0, '1f9ce-1f3fd-200d-2640':0, '1f9ce-1f3fe-200d-2640':0, '1f9ce-1f3ff-200d-2640':0, '1f9ce-1f3fb-200d-2642':0, '1f9ce-1f3fc-200d-2642':0, '1f9ce-1f3fd-200d-2642':0, '1f9ce-1f3fe-200d-2642':0, '1f9ce-1f3ff-200d-2642':0, '1f9ce-1f3fb':0, '1f9ce-1f3fc':0, '1f9ce-1f3fd':0, '1f9ce-1f3fe':0, '1f9ce-1f3ff':0, '1f9cf-1f3fb-200d-2640':0, '1f9cf-1f3fc-200d-2640':0, '1f9cf-1f3fd-200d-2640':0, '1f9cf-1f3fe-200d-2640':0, '1f9cf-1f3ff-200d-2640':0, '1f9cf-1f3fb-200d-2642':0, '1f9cf-1f3fc-200d-2642':0, '1f9cf-1f3fd-200d-2642':0, '1f9cf-1f3fe-200d-2642':0, '1f9cf-1f3ff-200d-2642':0, '1f9cf-1f3fb':0, '1f9cf-1f3fc':0, '1f9cf-1f3fd':0, '1f9cf-1f3fe':0, '1f9cf-1f3ff':0, '1f9d1-1f3fb-200d-1f33e':0, '1f9d1-1f3fc-200d-1f33e':0, '1f9d1-1f3fd-200d-1f33e':0, '1f9d1-1f3fe-200d-1f33e':0, '1f9d1-1f3ff-200d-1f33e':0, '1f9d1-1f3fb-200d-1f373':0, '1f9d1-1f3fc-200d-1f373':0, '1f9d1-1f3fd-200d-1f373':0, '1f9d1-1f3fe-200d-1f373':0, '1f9d1-1f3ff-200d-1f373':0, '1f9d1-1f3fb-200d-1f37c':0, '1f9d1-1f3fc-200d-1f37c':0, '1f9d1-1f3fd-200d-1f37c':0, '1f9d1-1f3fe-200d-1f37c':0, '1f9d1-1f3ff-200d-1f37c':0, '1f9d1-1f3fb-200d-1f384':0, '1f9d1-1f3fc-200d-1f384':0, '1f9d1-1f3fd-200d-1f384':0, '1f9d1-1f3fe-200d-1f384':0, '1f9d1-1f3ff-200d-1f384':0, '1f9d1-1f3fb-200d-1f393':0, '1f9d1-1f3fc-200d-1f393':0, '1f9d1-1f3fd-200d-1f393':0, '1f9d1-1f3fe-200d-1f393':0, '1f9d1-1f3ff-200d-1f393':0, '1f9d1-1f3fb-200d-1f3a4':0, '1f9d1-1f3fc-200d-1f3a4':0, '1f9d1-1f3fd-200d-1f3a4':0, '1f9d1-1f3fe-200d-1f3a4':0, '1f9d1-1f3ff-200d-1f3a4':0, '1f9d1-1f3fb-200d-1f3a8':0, '1f9d1-1f3fc-200d-1f3a8':0, '1f9d1-1f3fd-200d-1f3a8':0, '1f9d1-1f3fe-200d-1f3a8':0, '1f9d1-1f3ff-200d-1f3a8':0, '1f9d1-1f3fb-200d-1f3eb':0, '1f9d1-1f3fc-200d-1f3eb':0, '1f9d1-1f3fd-200d-1f3eb':0, '1f9d1-1f3fe-200d-1f3eb':0, '1f9d1-1f3ff-200d-1f3eb':0, '1f9d1-1f3fb-200d-1f3ed':0, '1f9d1-1f3fc-200d-1f3ed':0, '1f9d1-1f3fd-200d-1f3ed':0, '1f9d1-1f3fe-200d-1f3ed':0, '1f9d1-1f3ff-200d-1f3ed':0, '1f9d1-1f3fb-200d-1f4bb':0, '1f9d1-1f3fc-200d-1f4bb':0, '1f9d1-1f3fd-200d-1f4bb':0, '1f9d1-1f3fe-200d-1f4bb':0, '1f9d1-1f3ff-200d-1f4bb':0, '1f9d1-1f3fb-200d-1f4bc':0, '1f9d1-1f3fc-200d-1f4bc':0, '1f9d1-1f3fd-200d-1f4bc':0, '1f9d1-1f3fe-200d-1f4bc':0, '1f9d1-1f3ff-200d-1f4bc':0, '1f9d1-1f3fb-200d-1f527':0, '1f9d1-1f3fc-200d-1f527':0, '1f9d1-1f3fd-200d-1f527':0, '1f9d1-1f3fe-200d-1f527':0, '1f9d1-1f3ff-200d-1f527':0, '1f9d1-1f3fb-200d-1f52c':0, '1f9d1-1f3fc-200d-1f52c':0, '1f9d1-1f3fd-200d-1f52c':0, '1f9d1-1f3fe-200d-1f52c':0, '1f9d1-1f3ff-200d-1f52c':0, '1f9d1-1f3fb-200d-1f680':0, '1f9d1-1f3fc-200d-1f680':0, '1f9d1-1f3fd-200d-1f680':0, '1f9d1-1f3fe-200d-1f680':0, '1f9d1-1f3ff-200d-1f680':0, '1f9d1-1f3fb-200d-1f692':0, '1f9d1-1f3fc-200d-1f692':0, '1f9d1-1f3fd-200d-1f692':0, '1f9d1-1f3fe-200d-1f692':0, '1f9d1-1f3ff-200d-1f692':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3fb-200d-1f9af':0, '1f9d1-1f3fc-200d-1f9af':0, '1f9d1-1f3fd-200d-1f9af':0, '1f9d1-1f3fe-200d-1f9af':0, '1f9d1-1f3ff-200d-1f9af':0, '1f9d1-1f3fb-200d-1f9b0':0, '1f9d1-1f3fc-200d-1f9b0':0, '1f9d1-1f3fd-200d-1f9b0':0, '1f9d1-1f3fe-200d-1f9b0':0, '1f9d1-1f3ff-200d-1f9b0':0, '1f9d1-1f3fb-200d-1f9b1':0, '1f9d1-1f3fc-200d-1f9b1':0, '1f9d1-1f3fd-200d-1f9b1':0, '1f9d1-1f3fe-200d-1f9b1':0, '1f9d1-1f3ff-200d-1f9b1':0, '1f9d1-1f3fb-200d-1f9b2':0, '1f9d1-1f3fc-200d-1f9b2':0, '1f9d1-1f3fd-200d-1f9b2':0, '1f9d1-1f3fe-200d-1f9b2':0, '1f9d1-1f3ff-200d-1f9b2':0, '1f9d1-1f3fb-200d-1f9b3':0, '1f9d1-1f3fc-200d-1f9b3':0, '1f9d1-1f3fd-200d-1f9b3':0, '1f9d1-1f3fe-200d-1f9b3':0, '1f9d1-1f3ff-200d-1f9b3':0, '1f9d1-1f3fb-200d-1f9bc':0, '1f9d1-1f3fc-200d-1f9bc':0, '1f9d1-1f3fd-200d-1f9bc':0, '1f9d1-1f3fe-200d-1f9bc':0, '1f9d1-1f3ff-200d-1f9bc':0, '1f9d1-1f3fb-200d-1f9bd':0, '1f9d1-1f3fc-200d-1f9bd':0, '1f9d1-1f3fd-200d-1f9bd':0, '1f9d1-1f3fe-200d-1f9bd':0, '1f9d1-1f3ff-200d-1f9bd':0, '1f9d1-1f3fb-200d-2695':0, '1f9d1-1f3fc-200d-2695':0, '1f9d1-1f3fd-200d-2695':0, '1f9d1-1f3fe-200d-2695':0, '1f9d1-1f3ff-200d-2695':0, '1f9d1-1f3fb-200d-2696':0, '1f9d1-1f3fc-200d-2696':0, '1f9d1-1f3fd-200d-2696':0, '1f9d1-1f3fe-200d-2696':0, '1f9d1-1f3ff-200d-2696':0, '1f9d1-1f3fb-200d-2708':0, '1f9d1-1f3fc-200d-2708':0, '1f9d1-1f3fd-200d-2708':0, '1f9d1-1f3fe-200d-2708':0, '1f9d1-1f3ff-200d-2708':0, '1f9d1-1f3fb':0, '1f9d1-1f3fc':0, '1f9d1-1f3fd':0, '1f9d1-1f3fe':0, '1f9d1-1f3ff':0, '1f9d2-1f3fb':0, '1f9d2-1f3fc':0, '1f9d2-1f3fd':0, '1f9d2-1f3fe':0, '1f9d2-1f3ff':0, '1f9d3-1f3fb':0, '1f9d3-1f3fc':0, '1f9d3-1f3fd':0, '1f9d3-1f3fe':0, '1f9d3-1f3ff':0, '1f9d4-1f3fb-200d-2640':0, '1f9d4-1f3fc-200d-2640':0, '1f9d4-1f3fd-200d-2640':0, '1f9d4-1f3fe-200d-2640':0, '1f9d4-1f3ff-200d-2640':0, '1f9d4-1f3fb-200d-2642':0, '1f9d4-1f3fc-200d-2642':0, '1f9d4-1f3fd-200d-2642':0, '1f9d4-1f3fe-200d-2642':0, '1f9d4-1f3ff-200d-2642':0, '1f9d4-1f3fb':0, '1f9d4-1f3fc':0, '1f9d4-1f3fd':0, '1f9d4-1f3fe':0, '1f9d4-1f3ff':0, '1f9d5-1f3fb':0, '1f9d5-1f3fc':0, '1f9d5-1f3fd':0, '1f9d5-1f3fe':0, '1f9d5-1f3ff':0, '1f9d6-1f3fb-200d-2640':0, '1f9d6-1f3fc-200d-2640':0, '1f9d6-1f3fd-200d-2640':0, '1f9d6-1f3fe-200d-2640':0, '1f9d6-1f3ff-200d-2640':0, '1f9d6-1f3fb-200d-2642':0, '1f9d6-1f3fc-200d-2642':0, '1f9d6-1f3fd-200d-2642':0, '1f9d6-1f3fe-200d-2642':0, '1f9d6-1f3ff-200d-2642':0, '1f9d6-1f3fb':0, '1f9d6-1f3fc':0, '1f9d6-1f3fd':0, '1f9d6-1f3fe':0, '1f9d6-1f3ff':0, '1f9d7-1f3fb-200d-2640':0, '1f9d7-1f3fc-200d-2640':0, '1f9d7-1f3fd-200d-2640':0, '1f9d7-1f3fe-200d-2640':0, '1f9d7-1f3ff-200d-2640':0, '1f9d7-1f3fb-200d-2642':0, '1f9d7-1f3fc-200d-2642':0, '1f9d7-1f3fd-200d-2642':0, '1f9d7-1f3fe-200d-2642':0, '1f9d7-1f3ff-200d-2642':0, '1f9d7-1f3fb':0, '1f9d7-1f3fc':0, '1f9d7-1f3fd':0, '1f9d7-1f3fe':0, '1f9d7-1f3ff':0, '1f9d8-1f3fb-200d-2640':0, '1f9d8-1f3fc-200d-2640':0, '1f9d8-1f3fd-200d-2640':0, '1f9d8-1f3fe-200d-2640':0, '1f9d8-1f3ff-200d-2640':0, '1f9d8-1f3fb-200d-2642':0, '1f9d8-1f3fc-200d-2642':0, '1f9d8-1f3fd-200d-2642':0, '1f9d8-1f3fe-200d-2642':0, '1f9d8-1f3ff-200d-2642':0, '1f9d8-1f3fb':0, '1f9d8-1f3fc':0, '1f9d8-1f3fd':0, '1f9d8-1f3fe':0, '1f9d8-1f3ff':0, '1f9d9-1f3fb-200d-2640':0, '1f9d9-1f3fc-200d-2640':0, '1f9d9-1f3fd-200d-2640':0, '1f9d9-1f3fe-200d-2640':0, '1f9d9-1f3ff-200d-2640':0, '1f9d9-1f3fb-200d-2642':0, '1f9d9-1f3fc-200d-2642':0, '1f9d9-1f3fd-200d-2642':0, '1f9d9-1f3fe-200d-2642':0, '1f9d9-1f3ff-200d-2642':0, '1f9d9-1f3fb':0, '1f9d9-1f3fc':0, '1f9d9-1f3fd':0, '1f9d9-1f3fe':0, '1f9d9-1f3ff':0, '1f9da-1f3fb-200d-2640':0, '1f9da-1f3fc-200d-2640':0, '1f9da-1f3fd-200d-2640':0, '1f9da-1f3fe-200d-2640':0, '1f9da-1f3ff-200d-2640':0, '1f9da-1f3fb-200d-2642':0, '1f9da-1f3fc-200d-2642':0, '1f9da-1f3fd-200d-2642':0, '1f9da-1f3fe-200d-2642':0, '1f9da-1f3ff-200d-2642':0, '1f9da-1f3fb':0, '1f9da-1f3fc':0, '1f9da-1f3fd':0, '1f9da-1f3fe':0, '1f9da-1f3ff':0, '1f9db-1f3fb-200d-2640':0, '1f9db-1f3fc-200d-2640':0, '1f9db-1f3fd-200d-2640':0, '1f9db-1f3fe-200d-2640':0, '1f9db-1f3ff-200d-2640':0, '1f9db-1f3fb-200d-2642':0, '1f9db-1f3fc-200d-2642':0, '1f9db-1f3fd-200d-2642':0, '1f9db-1f3fe-200d-2642':0, '1f9db-1f3ff-200d-2642':0, '1f9db-1f3fb':0, '1f9db-1f3fc':0, '1f9db-1f3fd':0, '1f9db-1f3fe':0, '1f9db-1f3ff':0, '1f9dc-1f3fb-200d-2640':0, '1f9dc-1f3fc-200d-2640':0, '1f9dc-1f3fd-200d-2640':0, '1f9dc-1f3fe-200d-2640':0, '1f9dc-1f3ff-200d-2640':0, '1f9dc-1f3fb-200d-2642':0, '1f9dc-1f3fc-200d-2642':0, '1f9dc-1f3fd-200d-2642':0, '1f9dc-1f3fe-200d-2642':0, '1f9dc-1f3ff-200d-2642':0, '1f9dc-1f3fb':0, '1f9dc-1f3fc':0, '1f9dc-1f3fd':0, '1f9dc-1f3fe':0, '1f9dc-1f3ff':0, '1f9dd-1f3fb-200d-2640':0, '1f9dd-1f3fc-200d-2640':0, '1f9dd-1f3fd-200d-2640':0, '1f9dd-1f3fe-200d-2640':0, '1f9dd-1f3ff-200d-2640':0, '1f9dd-1f3fb-200d-2642':0, '1f9dd-1f3fc-200d-2642':0, '1f9dd-1f3fd-200d-2642':0, '1f9dd-1f3fe-200d-2642':0, '1f9dd-1f3ff-200d-2642':0, '1f9dd-1f3fb':0, '1f9dd-1f3fc':0, '1f9dd-1f3fd':0, '1f9dd-1f3fe':0, '1f9dd-1f3ff':0, '261d-1f3fb':0, '261d-1f3fc':0, '261d-1f3fd':0, '261d-1f3fe':0, '261d-1f3ff':0, '26f9-1f3fb-200d-2640':0, '26f9-1f3fc-200d-2640':0, '26f9-1f3fd-200d-2640':0, '26f9-1f3fe-200d-2640':0, '26f9-1f3ff-200d-2640':0, '26f9-1f3fb-200d-2642':0, '26f9-1f3fc-200d-2642':0, '26f9-1f3fd-200d-2642':0, '26f9-1f3fe-200d-2642':0, '26f9-1f3ff-200d-2642':0, '26f9-1f3fb':0, '26f9-1f3fc':0, '26f9-1f3fd':0, '26f9-1f3fe':0, '26f9-1f3ff':0, '270a-1f3fb':0, '270a-1f3fc':0, '270a-1f3fd':0, '270a-1f3fe':0, '270a-1f3ff':0, '270b-1f3fb':0, '270b-1f3fc':0, '270b-1f3fd':0, '270b-1f3fe':0, '270b-1f3ff':0, '270c-1f3fb':0, '270c-1f3fc':0, '270c-1f3fd':0, '270c-1f3fe':0, '270c-1f3ff':0, '270d-1f3fb':0, '270d-1f3fc':0, '270d-1f3fd':0, '270d-1f3fe':0, '270d-1f3ff':0}};\n\nconst Emoji: {[emoji: string]: number} = EmojiVersions[''];\nfor(const version in EmojiVersions) {\n if(version) {\n Object.assign(Emoji, EmojiVersions[version as EMOJI_VERSION]);\n }\n}\n\nexport default Emoji;\n\n/* Emoji[\"00a9-fe0f\"] = 6362;\nEmoji[\"00ae-fe0f\"] = 6363;\nEmoji[\"2122-fe0f\"] = 6364; */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ctx from './ctx';\n\nexport const USER_AGENT = navigator ? navigator.userAgent : null;\nexport const IS_APPLE = navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i) !== -1;\nexport const IS_ANDROID = navigator.userAgent.toLowerCase().indexOf('android') !== -1;\nexport const IS_CHROMIUM = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);\n\n// https://stackoverflow.com/a/58065241\nexport const IS_APPLE_MOBILE = (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&\n !(ctx as any).MSStream;\n\nexport const IS_SAFARI = !!('safari' in ctx) || !!(USER_AGENT && (/\\b(iPad|iPhone|iPod)\\b/.test(USER_AGENT) || (!!USER_AGENT.match('Safari') && !USER_AGENT.match('Chrome'))))/* || true */;\nexport const IS_FIREFOX = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n\nexport const IS_MOBILE_SAFARI = IS_SAFARI && IS_APPLE_MOBILE;\n\nexport const IS_MOBILE = (navigator.maxTouchPoints === undefined || navigator.maxTouchPoints > 0) && navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i) != -1;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport LatinizeMap from '../config/latinizeMap';\n\nexport const badCharsRe = /[`~!@#$%^&*()\\-_=+\\[\\]\\\\|{}'\";:\\/?.>,<]+/g;\nconst trimRe = /^\\s+|\\s$/g;\n\nconst C2L: {[k: string]: string} = {\n 'й': 'q',\n 'ц': 'w',\n 'у': 'e',\n 'к': 'r',\n 'е': 't',\n 'н': 'y',\n 'г': 'u',\n 'ш': 'i',\n 'щ': 'o',\n 'з': 'p',\n 'х': '[',\n 'ъ': ']',\n 'ф': 'a',\n 'ы': 's',\n 'в': 'd',\n 'а': 'f',\n 'п': 'g',\n 'р': 'h',\n 'о': 'j',\n 'л': 'k',\n 'д': 'l',\n 'ж': ';',\n 'э': '\\'',\n 'я': 'z',\n 'ч': 'x',\n 'с': 'c',\n 'м': 'v',\n 'и': 'b',\n 'т': 'n',\n 'ь': 'm',\n 'б': ',',\n 'ю': '.',\n '.': '/'\n};\n\nexport function clearBadCharsAndTrim(text: string) {\n return text.replace(badCharsRe, '').replace(trimRe, '');\n}\n\nexport function fixCyrillic(text: string) {\n return text.toLowerCase().replace(/[\\wа-я]/g, (ch) => {\n const latinizeCh = C2L[ch];\n return latinizeCh ?? ch;\n });\n}\n\nexport function latinizeString(text: string) {\n return text.replace(/[^A-Za-z0-9]/g, (ch) => {\n const latinizeCh = LatinizeMap[ch];\n return latinizeCh ?? ch;\n });\n}\n\nexport default function cleanSearchText(text: string, latinize = true) {\n return processSearchText(text, {\n clearBadChars: true,\n latinize,\n ignoreCase: true\n });\n}\n\nexport type ProcessSearchTextOptions = Partial<{\n clearBadChars: boolean,\n latinize: boolean,\n ignoreCase: boolean,\n includeTag: boolean\n}>;\n\nexport function processSearchText(text: string, options: ProcessSearchTextOptions = {}) {\n const hasTag = options.includeTag && text.charAt(0) === '%';\n const originalText = text;\n if(options.clearBadChars) text = clearBadCharsAndTrim(text);\n if(options.latinize) text = latinizeString(text);\n if(options.ignoreCase) text = text.toLowerCase();\n if(hasTag) text = '%' + text;\n if(options.latinize) text += '\\x01' + fixCyrillic(originalText);\n return text;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {InputFileLocation, InputStickerSet, InputWebFileLocation} from '../layer';\nimport type {DownloadOptions} from '../lib/mtproto/apiFileManager';\n\nconst FILENAME_JOINER = '_';\n\nexport function getFileNameByLocation(location: InputFileLocation | InputWebFileLocation, options?: Partial<{\n fileName: string,\n downloadId: string\n}>) {\n const fileName = '';// (options?.fileName || '').split('.');\n const ext = fileName[fileName.length - 1] || '';\n\n let str: string;\n switch(location._) {\n case 'inputPhotoFileLocation': {\n str = ['photo', fileName[0], location.id, location.thumb_size].filter(Boolean).join(FILENAME_JOINER);\n break;\n }\n\n case 'inputDocumentFileLocation': {\n str = ['document', fileName[0], location.id, location.thumb_size].filter(Boolean).join(FILENAME_JOINER);\n break;\n }\n\n case 'inputPeerPhotoFileLocation':\n str = ['peerPhoto', location.photo_id, location.pFlags.big ? 'big' : 'small'].join(FILENAME_JOINER);\n break;\n\n case 'inputStickerSetThumb': {\n const id = (location.stickerset as InputStickerSet.inputStickerSetID).id ||\n (location.stickerset as InputStickerSet.inputStickerSetShortName).short_name ||\n (location.stickerset as InputStickerSet.inputStickerSetDice).emoticon ||\n location.stickerset._;\n str = ['stickerSetThumb', id, location.thumb_version].join(FILENAME_JOINER);\n break;\n }\n\n case 'inputFileLocation': {\n str = [location.volume_id, location.local_id].join(FILENAME_JOINER);\n break;\n }\n\n case 'inputWebFileLocation': {\n str = ['webFile', location.url].join(FILENAME_JOINER);\n break;\n }\n\n default: {\n console.error('Unrecognized location:', location);\n str = '';\n break;\n }\n }\n\n return str + (options?.downloadId ? '_download' : '') + (ext ? '.' + ext : ext);\n}\n\nexport type FileURLType = 'photo' | 'thumb' | 'document' | 'stream' | 'download';\nexport function getFileURL(type: FileURLType, options: DownloadOptions) {\n // console.log('getFileURL', location);\n // const perf = performance.now();\n const encoded = encodeURIComponent(JSON.stringify(options));\n // console.log('getFileURL encode:', performance.now() - perf, encoded);\n\n return /* '/' + */type + '/' + encoded;\n}\n","import {RestrictionReason} from '../layer';\n\nconst platforms = new Set([\n 'all',\n 'web',\n 'webk'\n]);\n\nconst ignore = new Set();\n\nexport function getRestrictionReason(reasons: RestrictionReason[]) {\n // return reasons[0];\n return reasons.find((reason) => platforms.has(reason.platform) && !ignore.has(reason.reason));\n}\n\nexport function isRestricted(reasons: RestrictionReason[]) {\n return !!getRestrictionReason(reasons);\n}\n\nexport function ignoreRestrictionReasons(reasons: string[]) {\n ignore.clear();\n reasons.forEach((reason) => {\n ignore.add(reason);\n });\n}\n","import isObject from '../../../../helpers/object/isObject';\nimport {InputChannel, InputPeer, Peer} from '../../../../layer';\nimport {NULL_PEER_ID} from '../../../mtproto/mtproto_config';\n\nexport default function getPeerId(peerId: {user_id: UserId} | {channel_id: ChatId} | {chat_id: ChatId} | InputPeer | InputChannel | PeerId | string): PeerId {\n if(peerId !== undefined && ((peerId as string).isPeerId ? (peerId as string).isPeerId() : false)) return peerId as PeerId;\n // if(typeof(peerId) === 'string' && /^[uc]/.test(peerId)) return peerId as PeerId;\n // if(typeof(peerId) === 'number') return peerId;\n else if(isObject(peerId)) {\n const userId = (peerId as Peer.peerUser).user_id;\n if(userId !== undefined) {\n return userId.toPeerId(false);\n }\n\n const chatId = (peerId as Peer.peerChannel).channel_id || (peerId as Peer.peerChat).chat_id;\n if(chatId !== undefined) {\n return chatId.toPeerId(true);\n }\n\n return NULL_PEER_ID; // maybe it is an inputPeerSelf\n // } else if(!peerId) return 'u0';\n } else if(!peerId) return NULL_PEER_ID;\n\n const isUser = (peerId as string).charAt(0) === 'u';\n const peerParams = (peerId as string).substr(1).split('_');\n\n return isUser ? peerParams[0].toPeerId() : (peerParams[0] || '').toPeerId(true);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {Database} from '../../config/databases';\nimport Modes from '../../config/modes';\nimport makeError from '../../helpers/makeError';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport {logger} from '../logger';\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/createIndex\n */\nexport type IDBIndex = {\n indexName: string,\n keyPath: string,\n objectParameters: IDBIndexParameters\n};\n\nexport type IDBStore = {\n name: string,\n indexes?: IDBIndex[]\n};\n\nexport type IDBOptions = {\n name?: string,\n storeName: string,\n stores?: IDBStore[],\n version?: number\n};\n\nconst DEBUG = false;\n\nexport class IDB {\n private static INSTANCES: IDB[] = [];\n private openDbPromise: Promise;\n private db: IDBDatabase;\n private storageIsAvailable: boolean;\n private log: ReturnType;\n private name: string;\n private version: number;\n private stores: IDBStore[];\n\n constructor(db: Database) {\n safeAssign(this, db);\n\n if(Modes.test) {\n this.name += '_test';\n }\n\n this.storageIsAvailable = true;\n this.log = logger(['IDB', db.name].join('-'));\n this.log('constructor');\n\n this.openDatabase(true);\n\n IDB.INSTANCES.push(this);\n }\n\n public isAvailable() {\n return this.storageIsAvailable;\n }\n\n public openDatabase(createNew = false): Promise {\n if(this.openDbPromise && !createNew) {\n return this.openDbPromise;\n }\n\n const createIndexes = (os: IDBObjectStore, store: IDBStore) => {\n const indexNames = Array.from(os.indexNames);\n for(const indexName of indexNames) {\n os.deleteIndex(indexName);\n }\n\n if(!store.indexes?.length) {\n return;\n }\n\n for(const index of store.indexes) {\n if(os.indexNames.contains(index.indexName)) {\n continue;\n }\n\n os.createIndex(index.indexName, index.keyPath, index.objectParameters);\n }\n };\n\n const createObjectStore = (db: IDBDatabase, store: IDBStore) => {\n const os = db.createObjectStore(store.name);\n createIndexes(os, store);\n };\n\n try {\n var request = indexedDB.open(this.name, this.version);\n\n if(!request) {\n return Promise.reject();\n }\n } catch(error) {\n this.log.error('error opening db', (error as Error).message);\n this.storageIsAvailable = false;\n return Promise.reject(error);\n }\n\n let finished = false;\n setTimeout(() => {\n if(!finished) {\n request.onerror(makeError('IDB_CREATE_TIMEOUT') as Event);\n }\n }, 3000);\n\n return this.openDbPromise = new Promise((resolve, reject) => {\n request.onsuccess = (event) => {\n finished = true;\n const db = request.result;\n let calledNew = false;\n\n this.log('Opened');\n\n db.onerror = (error) => {\n this.storageIsAvailable = false;\n this.log.error('Error creating/accessing IndexedDB database', error);\n reject(error);\n };\n\n db.onclose = (e) => {\n this.log.error('closed:', e);\n !calledNew && this.openDatabase();\n };\n\n db.onabort = (e) => {\n this.log.error('abort:', e);\n const transaction = e.target as IDBTransaction;\n\n this.openDatabase(calledNew = true);\n\n if(transaction.onerror) {\n transaction.onerror(e);\n }\n\n db.close();\n };\n\n db.onversionchange = (e) => {\n this.log.error('onversionchange, lol?');\n };\n\n resolve(this.db = db);\n };\n\n request.onerror = (event) => {\n finished = true;\n this.storageIsAvailable = false;\n this.log.error('Error creating/accessing IndexedDB database', event);\n reject(event);\n };\n\n request.onupgradeneeded = (event) => {\n finished = true;\n this.log.warn('performing idb upgrade from', event.oldVersion, 'to', event.newVersion);\n\n const target = event.target as IDBOpenDBRequest;\n const db = target.result;\n this.stores.forEach((store) => {\n /* if(db.objectStoreNames.contains(store.name)) {\n //if(event.oldVersion === 1) {\n db.deleteObjectStore(store.name);\n //}\n } */\n\n if(!db.objectStoreNames.contains(store.name)) {\n createObjectStore(db, store);\n } else {\n const txn = target.transaction;\n const os = txn.objectStore(store.name);\n createIndexes(os, store);\n }\n });\n };\n });\n }\n\n public static create>(db: T) {\n return this.INSTANCES.find((instance) => instance.name === db.name) ?? new IDB(db);\n }\n\n public static closeDatabases(preserve?: IDB) {\n this.INSTANCES.forEach((storage) => {\n if(preserve && preserve === storage) {\n return;\n }\n\n const db = storage.db;\n if(db) {\n db.onclose = () => {};\n db.close();\n }\n });\n }\n}\n\nexport default class IDBStorage, StoreName extends string = T['stores'][0]['name']> {\n private log: ReturnType;\n private storeName: T['stores'][0]['name'];\n private idb: IDB;\n\n constructor(db: T, storeName: typeof db['stores'][0]['name']) {\n this.storeName = storeName;\n this.log = logger(['IDB', db.name, storeName].join('-'));\n this.idb = IDB.create(db);\n }\n\n /**\n * ! WARNING ! function requires at least one opened connection\n */\n /* public static clearObjectStores() {\n const storage = this.STORAGES[0];\n this.closeDatabases(storage);\n\n const names = Array.from(storage.db.objectStoreNames);\n const promises = names.map((name) => storage.clear(name));\n return Promise.all(promises);\n } */\n\n /* public static deleteDatabase() {\n this.closeDatabases();\n\n const storages = this.STORAGES;\n const dbNames = Array.from(new Set(storages.map((storage) => storage.name)));\n const promises = dbNames.map((dbName) => {\n return new Promise((resolve, reject) => {\n const deleteRequest = indexedDB.deleteDatabase(dbName);\n\n deleteRequest.onerror = () => {\n reject();\n };\n\n deleteRequest.onsuccess = () => {\n resolve();\n };\n });\n });\n\n return Promise.all(promises);\n } */\n\n public delete(entryName: string | string[], storeName?: StoreName): Promise {\n // return Promise.resolve();\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n entryName = [].concat(entryName);\n }\n\n return this.getObjectStore('readwrite', (objectStore) => {\n const promises = (entryName as string[]).map((entryName) => objectStore.delete(entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'delete: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n public clear(storeName?: StoreName): Promise {\n return this.getObjectStore('readwrite', (objectStore) => objectStore.clear(), DEBUG ? 'clear' : '', storeName);\n }\n\n public save(entryName: string | string[], value: any | any[], storeName?: StoreName) {\n // const handleError = (error: Error) => {\n // this.log.error('save: transaction error:', entryName, value, db, error, error && error.name);\n // if((!error || error.name === 'InvalidStateError')/* && false */) {\n // setTimeout(() => {\n // this.save(entryName, value);\n // }, 2e3);\n // } else {\n // //console.error('IndexedDB saveFile transaction error:', error, error && error.name);\n // }\n // };\n\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n entryName = [].concat(entryName);\n value = [].concat(value);\n }\n\n return this.getObjectStore('readwrite', (objectStore) => {\n const promises = (entryName as string[]).map((entryName, idx) => objectStore.put(value[idx], entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'save: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n // public saveFile(fileName: string, blob: Blob | Uint8Array) {\n // //return Promise.resolve(blobConstruct([blob]));\n // if(!(blob instanceof Blob)) {\n // blob = blobConstruct(blob);\n // }\n\n // return this.save(fileName, blob);\n // }\n\n /* public saveFileBase64(db: IDBDatabase, fileName: string, blob: Blob | any): Promise {\n if(this.getBlobSize(blob) > 10 * 1024 * 1024) {\n return Promise.reject();\n }\n\n if(!(blob instanceof Blob)) {\n var safeMimeType = blobSafeMimeType(blob.type || 'image/jpeg');\n var address = 'data:' + safeMimeType + ';base64,' + bytesToBase64(blob);\n return this.storagePutB64String(db, fileName, address).then(() => {\n return blob;\n });\n }\n\n try {\n var reader = new FileReader();\n } catch (e) {\n this.storageIsAvailable = false;\n return Promise.reject();\n }\n\n let promise = new Promise((resolve, reject) => {\n reader.onloadend = () => {\n this.storagePutB64String(db, fileName, reader.result as string).then(() => {\n resolve(blob);\n }, reject);\n }\n\n reader.onerror = reject;\n });\n\n\n try {\n reader.readAsDataURL(blob);\n } catch (e) {\n this.storageIsAvailable = false;\n return Promise.reject();\n }\n\n return promise;\n }\n\n public storagePutB64String(db: IDBDatabase, fileName: string, b64string: string) {\n try {\n var objectStore = db.transaction([this.storeName], 'readwrite')\n .objectStore(this.storeName);\n var request = objectStore.put(b64string, fileName);\n } catch(error) {\n this.storageIsAvailable = false;\n return Promise.reject(error);\n }\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n resolve();\n };\n\n request.onerror = reject;\n });\n }\n\n public getBlobSize(blob: any) {\n return blob.size || blob.byteLength || blob.length;\n } */\n\n public get(entryName: string[], storeName?: StoreName): Promise;\n public get(entryName: string, storeName?: StoreName): Promise;\n public get(entryName: string | string[], storeName?: StoreName): Promise | Promise {\n // return Promise.reject();\n\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n if(!entryName) {\n return undefined;\n }\n\n entryName = [].concat(entryName);\n } else if(!entryName.length) {\n return Promise.resolve([]) as any;\n }\n\n return this.getObjectStore('readonly', (objectStore) => {\n const promises = (entryName as string[]).map((entryName) => objectStore.get(entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'get: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n private getObjectStore(\n mode: IDBTransactionMode,\n callback: (objectStore: IDBObjectStore) => IDBRequest | IDBRequest[],\n log?: string,\n storeName = this.storeName\n ) {\n let perf: number;\n\n if(log) {\n perf = performance.now();\n this.log(log + ': start');\n }\n\n return this.idb.openDatabase().then((db) => {\n return new Promise((resolve, reject) => {\n /* if(mode === 'readwrite') {\n return;\n } */\n\n const transaction = db.transaction([storeName], mode);\n\n const onError = () => {\n clearTimeout(timeout);\n reject(transaction.error);\n };\n\n // let resolved = false;\n const onComplete = (/* what: string */) => {\n clearTimeout(timeout);\n\n if(log) {\n this.log(log + ': end', performance.now() - perf/* , what */);\n }\n\n // if(resolved) {\n // return;\n // }\n\n // resolved = true;\n const results = requests.map((r) => r.result);\n resolve(isArray ? results : results[0]);\n };\n\n transaction.onerror = onError;\n\n // * have to wait while clearing or setting something\n const waitForTransactionComplete = mode === 'readwrite';\n if(waitForTransactionComplete) {\n transaction.oncomplete = () => onComplete(/* 'transaction' */);\n }\n\n const timeout = setTimeout(() => {\n this.log.error('transaction not finished', transaction, log);\n }, 10000);\n\n /* transaction.addEventListener('abort', (e) => {\n //handleError();\n this.log.error('IndexedDB: transaction abort!', transaction.error);\n }); */\n\n const callbackResult = callback(transaction.objectStore(storeName));\n\n const isArray = Array.isArray(callbackResult);\n const requests: IDBRequest[] = isArray ? callbackResult : [].concat(callbackResult) as any;\n\n if(waitForTransactionComplete) {\n return;\n }\n\n const length = requests.length;\n let left = length;\n\n const onRequestFinished = () => {\n if(transaction.error) {\n return;\n }\n\n if(!--left) {\n onComplete(/* 'requests' */);\n }\n };\n\n for(let i = 0; i < length; ++i) {\n const request = requests[i];\n request.onerror = onError;\n request.onsuccess = onRequestFinished;\n }\n });\n });\n }\n\n public getAll(storeName?: StoreName): Promise {\n return this.getObjectStore('readonly', (objectStore) => objectStore.getAll(), DEBUG ? 'getAll' : '', storeName);\n }\n\n /* public getAllKeys(): Promise> {\n console.time('getAllEntries');\n return this.openDatabase().then((db) => {\n var objectStore = db.transaction([this.storeName], 'readonly')\n .objectStore(this.storeName);\n var request = objectStore.getAllKeys();\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n // @ts-ignore\n var result = event.target.result;\n resolve(result);\n console.timeEnd('getAllEntries');\n }\n\n request.onerror = reject;\n });\n });\n } */\n\n /* public isFileExists(fileName: string): Promise {\n console.time('isFileExists');\n return this.openDatabase().then((db) => {\n var objectStore = db.transaction([this.storeName], 'readonly')\n .objectStore(this.storeName);\n var request = objectStore.openCursor(fileName);\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n // @ts-ignore\n var cursor = event.target.result;\n resolve(!!cursor);\n console.timeEnd('isFileExists');\n }\n\n request.onerror = reject;\n });\n });\n } */\n\n /* public getFileWriter(fileName: string, mimeType: string) {\n var fakeWriter = FileManager.getFakeFileWriter(mimeType, (blob) => {\n return this.saveFile(fileName, blob);\n });\n\n return Promise.resolve(fakeWriter);\n } */\n}\n","import type ENVIRONMENT from '.';\n\nlet environment: typeof ENVIRONMENT;\nexport function getEnvironment() {\n return environment;\n}\n\nexport function setEnvironment(env: typeof environment) {\n return environment = env;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Message, StickerSet, Update, NotifyPeer, PeerNotifySettings, PollResults, Poll, WebPage, GroupCall, GroupCallParticipant, ReactionCount, MessagePeerReaction, PhoneCall, Config, Reaction} from '../layer';\nimport type {Dialog, ForumTopic, MessagesStorageKey, MyMessage} from './appManagers/appMessagesManager';\nimport type {MyDialogFilter} from './storages/filters';\nimport type {Folder} from './storages/dialogs';\nimport type {UserTyping} from './appManagers/appProfileManager';\nimport type {MyDraftMessage} from './appManagers/appDraftsManager';\nimport type {ConnectionStatusChange} from './mtproto/connectionStatus';\nimport type {GroupCallId} from './appManagers/appGroupCallsManager';\nimport type {AppManagers} from './appManagers/managers';\nimport type {State} from '../config/state';\nimport type {Progress} from './appManagers/appDownloadManager';\nimport type {CallId} from './appManagers/appCallsManager';\nimport type {MyDocument} from './appManagers/appDocsManager';\nimport type {MTAppConfig} from './mtproto/appConfig';\nimport {NULL_PEER_ID, UserAuth} from './mtproto/mtproto_config';\nimport EventListenerBase from '../helpers/eventListenerBase';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport MTProtoMessagePort from './mtproto/mtprotoMessagePort';\nimport {IS_WORKER} from '../helpers/context';\n\nexport type BroadcastEvents = {\n 'chat_full_update': ChatId,\n 'chat_update': ChatId,\n 'chat_toggle_forum': {chatId: ChatId, enabled: boolean},\n 'chat_participant': Update.updateChannelParticipant,\n\n 'channel_update': ChatId,\n\n 'user_update': UserId,\n 'user_auth': UserAuth,\n 'user_full_update': UserId,\n\n 'peer_pinned_messages': {peerId: PeerId, mids?: number[], pinned?: boolean, unpinAll?: true},\n 'peer_pinned_hidden': {peerId: PeerId, maxId: number},\n 'peer_typings': {peerId: PeerId, threadId?: number, typings: UserTyping[]},\n 'peer_block': {peerId: PeerId, blocked: boolean},\n 'peer_title_edit': {peerId: PeerId, threadId?: number},\n 'peer_bio_edit': PeerId,\n 'peer_deleted': PeerId, // left chat, deleted user dialog, left channel\n 'peer_full_update': PeerId,\n\n 'filter_delete': MyDialogFilter,\n 'filter_update': MyDialogFilter,\n 'filter_new': MyDialogFilter,\n 'filter_order': number[],\n\n 'folder_unread': Omit,\n\n 'dialog_draft': {peerId: PeerId, dialog: Dialog | ForumTopic, drop: boolean, draft: MyDraftMessage | undefined},\n 'dialog_unread': {peerId: PeerId, dialog: Dialog | ForumTopic},\n 'dialog_flush': {peerId: PeerId, dialog: Dialog},\n 'dialog_drop': Dialog | ForumTopic,\n 'dialog_migrate': {migrateFrom: PeerId, migrateTo: PeerId},\n // 'dialog_top': Dialog,\n 'dialog_notify_settings': Dialog | ForumTopic,\n // 'dialog_order': {dialog: Dialog, pos: number},\n 'dialogs_multiupdate': Map}>,\n\n 'history_append': {storageKey: MessagesStorageKey, message: Message.message},\n 'history_update': {storageKey: MessagesStorageKey, message: MyMessage, sequential?: boolean},\n 'history_reply_markup': {peerId: PeerId},\n 'history_multiappend': MyMessage,\n 'history_delete': {peerId: PeerId, msgs: Set},\n 'history_forbidden': PeerId,\n 'history_reload': PeerId,\n // 'history_request': void,\n\n 'message_edit': {storageKey: MessagesStorageKey, peerId: PeerId, mid: number, message: MyMessage},\n 'message_sent': {storageKey: MessagesStorageKey, tempId: number, tempMessage: any, mid: number, message: MyMessage},\n 'message_error': {storageKey: MessagesStorageKey, tempId: number, error: ApiError},\n 'message_transcribed': {peerId: PeerId, mid: number, text: string, pending?: boolean},\n 'messages_views': {peerId: PeerId, mid: number, views: number}[],\n 'messages_reactions': {message: Message.message, changedResults: ReactionCount[]}[],\n 'messages_pending': void,\n 'messages_read': void,\n 'messages_downloaded': {peerId: PeerId, mids: number[]},\n 'messages_media_read': {peerId: PeerId, mids: number[]},\n\n 'replies_updated': Message.message,\n\n 'scheduled_new': Message.message,\n 'scheduled_delete': {peerId: PeerId, mids: number[]},\n\n 'album_edit': {peerId: PeerId, groupId: string, deletedMids: number[], messages: Message.message[]},\n\n 'stickers_installed': StickerSet.stickerSet,\n 'stickers_deleted': StickerSet.stickerSet,\n 'stickers_updated': {type: 'recent' | 'faved', stickers: MyDocument[]},\n 'stickers_top': Long,\n 'stickers_order': {type: 'masks' | 'emojis' | 'stickers', order: Long[]},\n 'sticker_updated': {type: 'recent' | 'faved', document: MyDocument, faved: boolean},\n\n 'state_cleared': void,\n 'state_synchronized': ChatId | void,\n 'state_synchronizing': ChatId | void,\n\n 'contacts_update': UserId,\n 'avatar_update': {peerId: PeerId, threadId?: number},\n 'poll_update': {poll: Poll, results: PollResults},\n 'invalidate_participants': ChatId,\n // 'channel_settings': {channelId: number},\n 'webpage_updated': {id: WebPage.webPage['id'], msgs: {peerId: PeerId, mid: number, isScheduled: boolean}[]},\n\n 'connection_status_change': ConnectionStatusChange,\n 'settings_updated': {key: string, value: any, settings: State['settings']},\n 'draft_updated': {peerId: PeerId, threadId: number, draft: MyDraftMessage | undefined, force?: boolean},\n\n 'background_change': void,\n\n 'privacy_update': Update.updatePrivacy,\n\n 'notify_settings': Update.updateNotifySettings,\n 'notify_peer_type_settings': {key: Exclude, settings: PeerNotifySettings},\n\n 'notification_reset': string,\n 'notification_cancel': string,\n\n 'language_change': string,\n\n 'theme_change': void,\n\n 'media_play': void,\n\n 'emoji_recent': AppEmoji,\n\n 'download_progress': Progress,\n 'document_downloading': DocId,\n 'document_downloaded': DocId,\n\n 'choosing_sticker': boolean\n\n 'group_call_update': GroupCall,\n 'group_call_participant': {groupCallId: GroupCallId, participant: GroupCallParticipant},\n // 'group_call_video_track_added': {instance: GroupCallInstance}\n\n 'call_update': PhoneCall,\n 'call_signaling': {callId: CallId, data: Uint8Array},\n\n 'quick_reaction': Reaction,\n\n 'service_notification': Update.updateServiceNotification,\n\n 'logging_out': void,\n\n 'payment_sent': {peerId: PeerId, mid: number, receiptMessage: Message.messageService}\n\n 'premium_toggle': boolean,\n 'premium_toggle_private': {isNew: boolean, isPremium: boolean},\n\n 'config': Config,\n 'app_config': MTAppConfig\n};\n\nexport type BroadcastEventsListeners = {\n [name in keyof BroadcastEvents]: (e: BroadcastEvents[name]) => void\n};\n\nexport class RootScope extends EventListenerBase {\n public myId: PeerId;\n private connectionStatus: {[name: string]: ConnectionStatusChange};\n public settings: State['settings'];\n public managers: AppManagers;\n public premium: boolean;\n\n constructor() {\n super();\n\n this.myId = NULL_PEER_ID;\n this.connectionStatus = {};\n this.premium = false;\n\n this.addEventListener('user_auth', ({id}) => {\n this.myId = id.toPeerId();\n });\n\n this.addEventListener('premium_toggle_private', ({isNew, isPremium}) => {\n this.premium = isPremium;\n this.dispatchEventSingle('premium_toggle', isPremium);\n });\n\n this.addEventListener('connection_status_change', (status) => {\n this.connectionStatus[status.name] = status;\n });\n\n this.dispatchEvent = (e, ...args) => {\n super.dispatchEvent(e, ...args);\n MTProtoMessagePort.getInstance().invokeVoid('event', {name: e as string, args});\n };\n\n if(!IS_WORKER) {\n this.addEventListener('settings_updated', ({settings}) => {\n this.settings = settings;\n });\n }\n }\n\n public getConnectionStatus() {\n return this.connectionStatus;\n }\n\n public getPremium() {\n return this.premium;\n }\n\n public dispatchEventSingle(...args: any[]) {\n // @ts-ignore\n super.dispatchEvent(...args);\n }\n}\n\nconst rootScope = new RootScope();\nMOUNT_CLASS_TO.rootScope = rootScope;\nexport default rootScope;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {State} from '../../config/state';\nimport rootScope from '../rootScope';\nimport stateStorage from '../stateStorage';\nimport setDeepProperty from '../../helpers/object/setDeepProperty';\nimport MTProtoMessagePort from '../mtproto/mtprotoMessagePort';\n\nexport class AppStateManager {\n private state: State = {} as any;\n private storage = stateStorage;\n\n // ! for mtproto worker use only\n public newVersion: string;\n public oldVersion: string;\n public userId: UserId;\n\n public getState() {\n return Promise.resolve(this.state);\n }\n\n public setByKey(key: string, value: any) {\n setDeepProperty(this.state, key, value);\n\n const first = key.split('.')[0] as keyof State;\n if(first === 'settings') {\n rootScope.dispatchEvent('settings_updated', {key, value, settings: this.state.settings});\n }\n\n this.pushToState(first, this.state[first]);\n }\n\n public pushToState(key: T, value: State[T], direct = true, onlyLocal?: boolean) {\n if(direct) {\n this.state[key] = value;\n }\n\n this.setKeyValueToStorage(key, value, onlyLocal);\n }\n\n public setKeyValueToStorage(key: T, value: State[T] = this.state[key], onlyLocal?: boolean) {\n MTProtoMessagePort.getInstance().invokeVoid('mirror', {name: 'state', key, value});\n\n this.storage.set({\n [key]: value\n }, onlyLocal);\n }\n\n /* public resetState() {\n for(let i in this.state) {\n // @ts-ignore\n this.state[i] = false;\n }\n sessionStorage.set(this.state).then(() => {\n location.reload();\n });\n } */\n}\n\nconst appStateManager = new AppStateManager();\nexport default appStateManager;\n","import getDeepProperty from './getDeepProperty';\n\nexport default function setDeepProperty(object: any, key: string, value: any) {\n const splitted = key.split('.');\n getDeepProperty(object, splitted.slice(0, -1).join('.'))[splitted.pop()] = value;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport pause from '../../../helpers/schedulers/pause';\nimport {DcId} from '../../../types';\nimport {logger, LogTypes} from '../../logger';\nimport type MTPNetworker from '../networker';\nimport MTTransport from './transport';\nimport Modes from '../../../config/modes';\n\n \nimport transportController from './controller';\n// import networkStats from '../networkStats';\n \n\nexport default class HTTP implements MTTransport {\n public networker: MTPNetworker;\n private log: ReturnType;\n\n private pending: Array<{\n resolve: (body: Uint8Array) => void,\n reject: any,\n body: Uint8Array\n }> = [];\n private releasing: boolean;\n\n public connected: boolean;\n private destroyed: boolean;\n private debug: boolean;\n\n constructor(protected dcId: DcId, protected url: string, logSuffix: string) {\n this.debug = Modes.debug && false;\n\n let logTypes = LogTypes.Error | LogTypes.Log;\n if(this.debug) logTypes |= LogTypes.Debug;\n\n this.log = logger(`HTTP-${dcId}` + logSuffix, logTypes);\n this.log('constructor');\n\n this.connected = false;\n }\n\n public _send(body: Uint8Array, mode?: RequestMode) {\n const length = body.length;\n this.debug && this.log.debug('-> body length to send:', length);\n\n // networkStats.addSent(this.dcId, length);\n return fetch(this.url, {method: 'POST', body, mode}).then((response) => {\n if(response.status !== 200 && !mode) {\n response.arrayBuffer().then((buffer) => {\n this.log.error('not 200',\n new TextDecoder('utf-8').decode(new Uint8Array(buffer)));\n });\n\n throw response;\n }\n\n this.setConnected(true);\n\n // * test resending by dropping random request\n // if(Math.random() > .5) {\n // throw 'asd';\n // }\n\n return response.arrayBuffer().then((buffer) => {\n // networkStats.addReceived(this.dcId, buffer.byteLength);\n return new Uint8Array(buffer);\n });\n }, (err) => {\n this.setConnected(false);\n throw err;\n });\n }\n\n private setConnected(connected: boolean) {\n if(this.connected === connected || this.destroyed) {\n return;\n }\n\n this.connected = connected;\n\n \n transportController.setTransportValue('https', connected);\n \n }\n\n public destroy() {\n this.setConnected(false);\n this.destroyed = true;\n this.pending.forEach((pending) => pending.reject());\n this.pending.length = 0;\n }\n\n public send(body: Uint8Array) {\n if(this.networker) {\n return this._send(body);\n } else {\n const promise = new Promise((resolve, reject) => {\n this.pending.push({resolve, reject, body});\n });\n\n this.releasePending();\n\n return promise;\n }\n }\n\n private async releasePending() {\n if(this.releasing) return;\n\n this.releasing = true;\n // this.log('-> messages to send:', this.pending.length);\n for(let i = 0; i < this.pending.length; ++i) {\n const pending = this.pending[i];\n const {body, resolve} = pending;\n\n try {\n const result = await this._send(body);\n resolve(result);\n this.pending.splice(i, 1);\n } catch(err) {\n this.log.error('Send plain request error:', err);\n await pause(5000);\n }\n\n --i;\n }\n\n this.releasing = false;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {logger, LogTypes} from '../../logger';\nimport Modes from '../../../config/modes';\nimport EventListenerBase from '../../../helpers/eventListenerBase';\nimport {MTConnection} from './transport';\n\n// let closeSocketBefore = Date.now() + 30e3;\n// let closeSocketAfter = Date.now() + 10e3;\n\nexport default class Socket extends EventListenerBase<{\n open: () => void,\n message: (buffer: ArrayBuffer) => any,\n close: () => void,\n}> implements MTConnection {\n private ws: WebSocket;\n private log: ReturnType;\n private debug = Modes.debug && false;\n\n constructor(protected dcId: number, protected url: string, logSuffix: string) {\n super();\n\n let logTypes = LogTypes.Error | LogTypes.Log;\n if(this.debug) logTypes |= LogTypes.Debug;\n this.log = logger(`WS-${dcId}` + logSuffix, logTypes);\n this.log('constructor');\n this.connect();\n\n return this;\n }\n\n private removeListeners() {\n if(!this.ws) {\n return;\n }\n\n this.ws.removeEventListener('open', this.handleOpen);\n this.ws.removeEventListener('close', this.handleClose);\n this.ws.removeEventListener('error', this.handleError);\n this.ws.removeEventListener('message', this.handleMessage);\n this.ws = undefined;\n }\n\n private connect() {\n this.ws = new WebSocket(this.url, 'binary');\n this.ws.binaryType = 'arraybuffer';\n this.ws.addEventListener('open', this.handleOpen);\n this.ws.addEventListener('close', this.handleClose);\n this.ws.addEventListener('error', this.handleError);\n this.ws.addEventListener('message', this.handleMessage);\n\n // if(Date.now() < closeSocketBefore) {\n // if(Date.now() >= closeSocketAfter) {\n // this.ws.close();\n // }\n }\n\n public close() {\n if(!this.ws) {\n return;\n }\n\n this.log('close execution');\n\n try {\n this.ws.close();\n } catch(err) {\n\n }\n this.handleClose();\n }\n\n private handleOpen = () => {\n this.log('opened');\n\n this.debug && this.log.debug('sending init packet');\n this.dispatchEvent('open');\n };\n\n private handleError = (e: Event) => {\n this.log.error('handleError', e);\n this.close();\n };\n\n private handleClose = (e?: CloseEvent) => {\n this.log('closed', e/* , this.pending, this.ws.bufferedAmount */);\n\n this.removeListeners();\n this.dispatchEvent('close');\n };\n\n private handleMessage = (event: MessageEvent) => {\n this.debug && this.log.debug('<-', 'handleMessage', /* event, */event.data.byteLength);\n\n this.dispatchEvent('message', event.data as ArrayBuffer);\n };\n\n public send = (body: Uint8Array) => {\n this.debug && this.log.debug('-> body length to send:', body.length);\n\n this.ws.send(body);\n };\n}\n","export default function randomize(arr: T) {\n if(crypto && 'getRandomValues' in crypto) {\n crypto.getRandomValues(arr);\n } else {\n throw new Error('NO_SECURE_RANDOM');\n }\n\n return arr;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import aesjs from 'aes-js';\nimport randomize from '../../../helpers/array/randomize';\nimport cryptoMessagePort from '../../crypto/cryptoMessagePort';\nimport {Codec} from './codec';\n\n/*\n@cryptography/aes не работает с массивами которые не кратны 4, поэтому использую intermediate а не abridged\n*/\nexport default class Obfuscation {\n /* private enc: aesjs.ModeOfOperation.ModeOfOperationCTR;\n private dec: aesjs.ModeOfOperation.ModeOfOperationCTR; */\n\n private id: number;\n private idPromise: Promise;\n private process: (data: Uint8Array, operation: 'encrypt' | 'decrypt') => ReturnType;\n\n // private cryptoEncKey: CryptoKey;\n // private cryptoDecKey: CryptoKey;\n // private cryptoKey: CryptoKey;\n\n // private encIv: Uint8Array;\n // private decIv: Uint8Array;\n\n // private decIvCounter: Counter;\n\n public async init(codec: Codec) {\n if(this.idPromise !== undefined) {\n this.release();\n }\n\n const initPayload = new Uint8Array(64);\n randomize(initPayload);\n\n while(true) {\n const val = (initPayload[3] << 24) | (initPayload[2] << 16) | (initPayload[1] << 8) | initPayload[0];\n const val2 = (initPayload[7] << 24) | (initPayload[6] << 16) | (initPayload[5] << 8) | initPayload[4];\n if(initPayload[0] !== 0xef &&\n val !== 0x44414548 &&\n val !== 0x54534f50 &&\n val !== 0x20544547 &&\n val !== 0x4954504f &&\n val !== 0xeeeeeeee &&\n val !== 0xdddddddd &&\n val2 !== 0x00000000) {\n // initPayload[56] = initPayload[57] = initPayload[58] = initPayload[59] = transport;\n break;\n }\n randomize(initPayload);\n }\n\n // //////////////////////initPayload.subarray(60, 62).hex = dcId;\n /* initPayload.set(new Uint8Array([161, 208, 67, 71, 118, 109, 20, 111, 113, 255, 134, 10, 159, 241, 7, 44, 217, 82, 187, 76, 108, 131, 200, 186, 33, 57, 177, 251, 52, 34, 18, 54, 65, 105, 37, 89, 38, 20, 47, 168, 126, 181, 24, 138, 212, 68, 60, 150, 225, 37, 181, 4, 201, 50, 72, 151, 168, 143, 204, 169, 81, 187, 241, 23]));\n console.log('initPayload', initPayload); */\n\n const reversedPayload = initPayload.slice().reverse();\n\n const encKey = initPayload.slice(8, 40);\n const encIv = /* this.encIv = */initPayload.slice(40, 56);\n const decKey = reversedPayload.slice(8, 40);\n const decIv = /* this.decIv = */reversedPayload.slice(40, 56);\n\n /* this.enc = new aesjs.ModeOfOperation.ctr(encKey, new aesjs.Counter(encIv as any));\n this.dec = new aesjs.ModeOfOperation.ctr(decKey, new aesjs.Counter(decIv as any)); */\n\n // console.log('encKey', encKey.hex, encIv.hex);\n // console.log('decKey', decKey.hex, decIv.hex);\n\n const idPromise = this.idPromise = cryptoMessagePort.invokeCrypto('aes-ctr-prepare', {\n encKey,\n encIv,\n decKey,\n decIv\n });\n\n this.process = async(data, operation) => {\n await idPromise;\n return this._process(data, operation);\n };\n\n this.id = await idPromise;\n\n this.process = this._process;\n\n // this.decIvCounter = new Counter(this.decIv);\n /* const key = this.cryptoEncKey = await subtle.importKey(\n 'raw',\n encKey,\n {name: 'AES-CTR'},\n false,\n ['encrypt']\n ); */\n\n // this.cryptoDecKey = await subtle.importKey(\n // 'raw',\n // decKey,\n // {name: 'AES-CTR'},\n // false,\n // ['encrypt']\n // );\n\n // this.cryptoKey = await subtle.importKey(\n // 'raw',\n // encKey,\n // {name: 'AES-CTR'},\n // false,\n // ['encrypt', 'decrypt']\n // );\n\n initPayload.set(codec.obfuscateTag, 56);\n const encrypted = await this.encode(initPayload.slice());\n\n // console.log('encrypted', encrypted);\n\n initPayload.set(encrypted.slice(56, 64), 56);\n\n return initPayload;\n }\n\n /* public encode(payload: Uint8Array) {\n let startTime = performance.now();\n let res = this.enc.encrypt(payload);\n let time = performance.now() - startTime;\n\n try {\n startTime = performance.now();\n let arr = this.encNew.encrypt(payload);\n //let resNew = bytesFromWords({words: arr, sigBytes: arr.length});\n let resNew = new Uint8Array(bytesFromWordss(arr));\n let time2 = performance.now() - startTime;\n console.log('Obfuscation: encode comparison:', res, arr, resNew, res.hex === resNew.hex, time2 < time);\n } catch(err) {\n console.error('Obfuscation: error:', err);\n }\n\n return res;\n }\n\n public decode(payload: Uint8Array) {\n let res = this.dec.encrypt(payload);\n\n try {\n let arr = this.decNew.decrypt(payload);\n //let resNew = bytesFromWords({words: arr, sigBytes: arr.length});\n let resNew = new Uint8Array(bytesFromWordss(arr));\n console.log('Obfuscation: decode comparison:', res, arr, resNew, res.hex === resNew.hex);\n } catch(err) {\n console.error('Obfuscation: error:', err);\n }\n\n return res;\n } */\n\n private _process = (data: Uint8Array, operation: 'encrypt' | 'decrypt') => {\n return cryptoMessagePort.invokeCryptoNew({\n method: 'aes-ctr-process',\n args: [{id: this.id, data, operation}],\n transfer: [data.buffer]\n }) as Promise;\n };\n\n public encode(payload: Uint8Array) {\n /* return subtle.encrypt({\n name: 'AES-CTR',\n counter: this.encIv,\n length: 64\n },\n this.cryptoEncKey,\n payload\n ); */\n return this.process(payload, 'encrypt');\n }\n\n public decode(payload: Uint8Array) {\n return this.process(payload, 'decrypt');\n }\n\n public async release() {\n const idPromise = this.idPromise;\n if(idPromise === undefined) {\n return;\n }\n\n this.id = undefined;\n this.idPromise = undefined;\n\n const id = await idPromise;\n cryptoMessagePort.invokeCrypto('aes-ctr-destroy', id);\n }\n\n public destroy() {\n this.release();\n }\n\n // public encode(payload: Uint8Array) {\n // let res = this.encNew.encrypt(payload);\n // let bytes = new Uint8Array(bytesFromWordss(res));\n\n // return bytes;\n // }\n\n // public async decode(payload: Uint8Array) {\n // const counter = this.decIvCounter.counter.slice();\n // this.decIvCounter.increment();\n\n // const n: ArrayBuffer = await subtle.encrypt({\n // name: 'AES-CTR',\n // counter: counter,\n // length: 64\n // },\n // this.cryptoDecKey,\n // payload\n // );\n\n // const decoded = this.decNew.update(payload);\n\n // console.log('decode', bytesToHex(decoded), 'new', n, bytesToHex(new Uint8Array(n)));\n\n // return decoded;\n // }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import { bytesFromHex, addPadding } from \"../../bin_utils\";\nimport {Codec} from './codec';\n\nclass AbridgedPacketCodec implements Codec {\n public tag = 0xef;\n public obfuscateTag = new Uint8Array([this.tag, this.tag, this.tag, this.tag]);\n\n public encodePacket(data: Uint8Array) {\n const len = data.byteLength >> 2;\n let header: Uint8Array;\n if(len < 127) {\n header = new Uint8Array([len]);\n } else { // Length: payload length, divided by four, and encoded as 3 length bytes (little endian)\n // header = new Uint8Array([0x7f, ...addPadding(bytesFromHex(len.toString(16)).reverse(), 3, true)/* .reverse() */]);\n header = new Uint8Array([0x7f, len & 0xFF, (len >> 8) & 0xFF, (len >> 16) & 0xFF]);\n // console.log('got nobody cause im braindead', header, len);\n }\n\n return header.concat(data);\n // return new Uint8Array([...header, ...data]);\n }\n\n public readPacket(data: Uint8Array) {\n let length = data[0];\n if(length >= 127) { // 0x7f\n length = data[1] | (data[2] << 8) | (data[3] << 16);\n\n return data.slice(4, length << 2 + 1); // need +1\n }\n\n return data.slice(1, length << 2 + 1); // need +1\n }\n}\n\nexport default new AbridgedPacketCodec();\n","export default function bytesToHex(bytes: ArrayLike) {\n const length = bytes.length;\n const arr: string[] = new Array(length);\n for(let i = 0; i < length; ++i) {\n arr[i] = (bytes[i] < 16 ? '0' : '') + (bytes[i] || 0).toString(16);\n }\n return arr.join('');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Modes from '../../../config/modes';\nimport {logger, LogTypes} from '../../logger';\nimport MTPNetworker from '../networker';\nimport Obfuscation from './obfuscation';\nimport MTTransport, {MTConnection, MTConnectionConstructable} from './transport';\n// import intermediatePacketCodec from './intermediate';\nimport abridgedPacketCodec from './abridged';\n// import paddedIntermediatePacketCodec from './padded';\nimport {ConnectionStatus} from '../connectionStatus';\n\n \nimport transportController from './controller';\nimport bytesToHex from '../../../helpers/bytes/bytesToHex';\n// import networkStats from '../networkStats';\nimport ctx from '../../../environment/ctx';\n \n\nexport default class TcpObfuscated implements MTTransport {\n private codec = abridgedPacketCodec;\n private obfuscation = new Obfuscation();\n public networker: MTPNetworker;\n\n private pending: Array> = [];\n\n private debug = Modes.debug && false/* true */;\n private log: ReturnType;\n public connected = false;\n private lastCloseTime: number;\n public connection: MTConnection;\n\n private autoReconnect = true;\n private reconnectTimeout: number;\n private releasingPending: boolean;\n\n // private debugPayloads: MTPNetworker['debugRequests'] = [];\n\n constructor(\n private Connection: MTConnectionConstructable,\n private dcId: number,\n private url: string,\n private logSuffix: string,\n private retryTimeout: number\n ) {\n let logTypes = LogTypes.Error | LogTypes.Log;\n if(this.debug) logTypes |= LogTypes.Debug;\n this.log = logger(`TCP-${dcId}` + logSuffix, logTypes);\n this.log('constructor');\n\n this.connect();\n }\n\n private onOpen = async() => {\n this.connected = true;\n\n \n transportController.setTransportOpened('websocket');\n \n\n const initPayload = await this.obfuscation.init(this.codec);\n if(!this.connected) {\n return;\n }\n\n this.connection.send(initPayload);\n\n if(this.networker) {\n this.pending.length = 0; // ! clear queue and reformat messages to container, because if sending simultaneously 10+ messages, connection will die\n this.networker.setConnectionStatus(ConnectionStatus.Connected);\n this.networker.cleanupSent();\n this.networker.resend();\n }/* else {\n for(const pending of this.pending) {\n if(pending.encoded && pending.body) {\n pending.encoded = this.encodeBody(pending.body);\n }\n }\n } */\n\n setTimeout(() => {\n this.releasePending();\n }, 0);\n };\n\n private onMessage = async(buffer: ArrayBuffer) => {\n // networkStats.addReceived(this.dcId, buffer.byteLength);\n\n let data = await this.obfuscation.decode(new Uint8Array(buffer));\n data = this.codec.readPacket(data);\n\n if(this.networker) { // authenticated!\n // this.pending = this.pending.filter((p) => p.body); // clear pending\n\n this.debug && this.log.debug('redirecting to networker', data.length);\n this.networker.parseResponse(data).then((response) => {\n this.debug && this.log.debug('redirecting to networker response:', response);\n\n try {\n this.networker.processMessage(response.response, response.messageId, response.sessionId);\n } catch(err) {\n this.log.error('handleMessage networker processMessage error', err);\n }\n\n // this.releasePending();\n }).catch((err) => {\n this.log.error('handleMessage networker parseResponse error', err);\n });\n\n // this.dd();\n return;\n }\n\n // console.log('got hex:', data.hex);\n const pending = this.pending.shift();\n if(!pending) {\n this.debug && this.log.debug('no pending for res:', bytesToHex(data));\n return;\n }\n\n pending.resolve(data);\n };\n\n private onClose = () => {\n this.clear();\n\n let needTimeout: number, retryAt: number;\n if(this.autoReconnect) {\n const time = Date.now();\n const diff = time - this.lastCloseTime;\n needTimeout = !isNaN(diff) && diff < this.retryTimeout ? this.retryTimeout - diff : 0;\n retryAt = time + needTimeout;\n }\n\n if(this.networker) {\n this.networker.setConnectionStatus(ConnectionStatus.Closed, retryAt);\n this.pending.length = 0;\n }\n\n if(this.autoReconnect) {\n this.log('will try to reconnect after timeout:', needTimeout / 1000);\n this.reconnectTimeout = ctx.setTimeout(this.reconnect, needTimeout);\n } else {\n this.log('reconnect isn\\'t needed');\n }\n };\n\n public clear() {\n \n if(this.connected) {\n transportController.setTransportClosed('websocket');\n }\n \n\n this.connected = false;\n\n if(this.connection) {\n this.connection.removeEventListener('open', this.onOpen);\n this.connection.removeEventListener('close', this.onClose);\n this.connection.removeEventListener('message', this.onMessage);\n this.connection = undefined;\n }\n }\n\n /**\n * invoke only when closed\n */\n public reconnect = () => {\n if(this.reconnectTimeout !== undefined) {\n clearTimeout(this.reconnectTimeout);\n this.reconnectTimeout = undefined;\n }\n\n if(this.connection) {\n return;\n }\n\n this.log('trying to reconnect...');\n this.lastCloseTime = Date.now();\n\n if(!this.networker) {\n for(const pending of this.pending) {\n if(pending.bodySent) {\n pending.bodySent = false;\n }\n }\n } else {\n this.networker.setConnectionStatus(ConnectionStatus.Connecting);\n }\n\n this.connect();\n }\n\n public forceReconnect() {\n this.close();\n this.reconnect();\n }\n\n public destroy() {\n this.setAutoReconnect(false);\n this.close();\n\n if(this.obfuscation) {\n this.obfuscation.destroy();\n }\n\n this.pending.forEach((pending) => {\n if(pending.reject) {\n pending.reject();\n }\n });\n this.pending.length = 0;\n }\n\n public close() {\n const connection = this.connection;\n if(connection) {\n const connected = this.connected;\n this.clear();\n if(connected) { // wait for buffered messages if they are there\n connection.addEventListener('message', this.onMessage);\n connection.addEventListener('close', () => {\n connection.removeEventListener('message', this.onMessage);\n }, {once: true});\n connection.close();\n }\n }\n }\n\n /**\n * Will connect if enable and disconnected \\\n * Will reset reconnection timeout if disable\n */\n public setAutoReconnect(enable: boolean) {\n this.autoReconnect = enable;\n\n if(!enable) {\n if(this.reconnectTimeout !== undefined) {\n clearTimeout(this.reconnectTimeout);\n this.reconnectTimeout = undefined;\n }\n } else if(!this.connection && this.reconnectTimeout === undefined) {\n this.reconnect();\n }\n }\n\n private connect() {\n if(this.connection) {\n this.close();\n }\n\n this.connection = new this.Connection(this.dcId, this.url, this.logSuffix);\n this.connection.addEventListener('open', this.onOpen);\n this.connection.addEventListener('close', this.onClose);\n this.connection.addEventListener('message', this.onMessage);\n }\n\n public changeUrl(url: string) {\n if(this.url === url) {\n return;\n }\n\n this.url = url;\n this.forceReconnect();\n }\n\n private encodeBody(body: Uint8Array) {\n const toEncode = this.codec.encodePacket(body);\n\n // this.log('send before obf:', /* body.hex, nonce.hex, */ toEncode.hex);\n const encoded = this.obfuscation.encode(toEncode);\n // this.log('send after obf:', enc.hex);\n\n return encoded;\n }\n\n public send(body: Uint8Array) {\n this.debug && this.log.debug('-> body length to pending:', body.length);\n\n const encoded: typeof body = /* this.connected ? this.encodeBody(body) : */undefined;\n\n // return;\n\n if(this.networker) {\n this.pending.push({body, encoded});\n this.releasePending();\n } else {\n const promise = new Promise((resolve, reject) => {\n this.pending.push({resolve, reject, body, encoded});\n });\n\n this.releasePending();\n\n return promise;\n }\n }\n\n private async releasePending(/* tt = false */) {\n if(!this.connected || this.releasingPending) {\n // this.connect();\n return;\n }\n\n this.releasingPending = true;\n\n /* if(!tt) {\n this.releasePendingDebounced();\n return;\n } */\n\n // this.log('-> messages to send:', this.pending.length);\n let length = this.pending.length;\n let sent = false;\n // for(let i = length - 1; i >= 0; --i) {\n for(let i = 0; i < length; ++i) {\n const pending = this.pending[i];\n if(!pending) {\n break;\n }\n\n const {body, bodySent} = pending;\n if(body && !bodySent) {\n // this.debugPayloads.push({before: body.slice(), after: enc});\n\n this.debug && this.log.debug('-> body length to send:', body.length);\n\n // if(!encoded) {\n // encoded = pending.encoded = this.encodeBody(body);\n // }\n\n const encoded = pending.encoded ??= await this.encodeBody(body);\n if(!this.connected) {\n break;\n }\n\n // networkStats.addSent(this.dcId, encoded.byteLength);\n this.connection.send(encoded);\n\n if(!pending.resolve) { // remove if no response needed\n this.pending.splice(i--, 1);\n length--;\n } else {\n pending.bodySent = true;\n }\n\n sent = true;\n // delete pending.body;\n }\n }\n\n this.releasingPending = undefined;\n\n if(this.pending.length && sent) {\n this.releasePending();\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport MTTransport, {MTConnectionConstructable} from './transports/transport';\nimport Modes from '../../config/modes';\nimport App from '../../config/app';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\n\n \nimport HTTP from './transports/http';\n \n\n \nimport Socket from './transports/websocket';\nimport TcpObfuscated from './transports/tcpObfuscated';\nimport {IS_WEB_WORKER} from '../../helpers/context';\nimport {DcId} from '../../types';\nimport {getEnvironment} from '../../environment/utils';\n\n \n \n \n\n \n\nexport type TransportType = 'websocket' | 'https' | 'http';\nexport type ConnectionType = 'client' | 'download' | 'upload';\ntype Servers = {\n [transportType in TransportType]: {\n [connectionType in ConnectionType]: {\n [dcId: DcId]: MTTransport[]\n }\n }\n};\n\nconst TEST_SUFFIX = Modes.test ? '_test' : '';\nconst PREMIUM_SUFFIX = '_premium';\n\nexport function getTelegramConnectionSuffix(connectionType: ConnectionType) {\n return connectionType === 'client' ? '' : '-1';\n}\n\n \nexport function constructTelegramWebSocketUrl(dcId: DcId, connectionType: ConnectionType, premium?: boolean) {\n const suffix = getTelegramConnectionSuffix(connectionType);\n const path = connectionType !== 'client' ? 'apiws' + TEST_SUFFIX + (premium ? PREMIUM_SUFFIX : '') : ('apiws' + TEST_SUFFIX);\n const chosenServer = `wss://${App.suffix.toLowerCase()}ws${dcId}${suffix}.web.telegram.org/${path}`;\n\n return chosenServer;\n}\n \n\nexport class DcConfigurator {\n private sslSubdomains = ['pluto', 'venus', 'aurora', 'vesta', 'flora'];\n\n private dcOptions = Modes.test ?\n [\n {id: 1, host: '149.154.175.10', port: 80},\n {id: 2, host: '149.154.167.40', port: 80},\n {id: 3, host: '149.154.175.117', port: 80}\n ] :\n [\n {id: 1, host: '149.154.175.50', port: 80},\n {id: 2, host: '149.154.167.50', port: 80},\n {id: 3, host: '149.154.175.100', port: 80},\n {id: 4, host: '149.154.167.91', port: 80},\n {id: 5, host: '149.154.171.5', port: 80}\n ];\n\n public chosenServers: Servers = {} as any;\n\n \n private transportSocket = (dcId: DcId, connectionType: ConnectionType, premium?: boolean) => {\n const chosenServer = constructTelegramWebSocketUrl(dcId, connectionType, premium);\n const logSuffix = connectionType === 'upload' ? '-U' : connectionType === 'download' ? '-D' : '';\n\n const retryTimeout = connectionType === 'client' ? 10000 : 10000;\n\n let oooohLetMeLive: MTConnectionConstructable;\n \n oooohLetMeLive = Socket;\n \n \n \n\n return new TcpObfuscated(oooohLetMeLive, dcId, chosenServer, logSuffix, retryTimeout);\n };\n \n\n \n private transportHTTP = (dcId: DcId, connectionType: ConnectionType, premium?: boolean) => {\n let chosenServer: string;\n if(Modes.ssl || !Modes.http) {\n const suffix = getTelegramConnectionSuffix(connectionType);\n const subdomain = this.sslSubdomains[dcId - 1] + suffix;\n const path = Modes.test ? 'apiw_test1' : 'apiw1';\n chosenServer = 'https://' + subdomain + '.web.telegram.org/' + path;\n } else {\n for(const dcOption of this.dcOptions) {\n if(dcOption.id === dcId) {\n chosenServer = 'http://' + dcOption.host + (dcOption.port !== 80 ? ':' + dcOption.port : '') + '/apiw1';\n break;\n }\n }\n }\n\n const logSuffix = connectionType === 'upload' ? '-U' : connectionType === 'download' ? '-D' : '';\n return new HTTP(dcId, chosenServer, logSuffix);\n };\n \n\n public chooseServer(\n dcId: DcId,\n connectionType: ConnectionType = 'client',\n transportType: TransportType = Modes.transport,\n reuse = true,\n premium?: boolean\n ) {\n /* if(transportType === 'websocket' && !Modes.multipleConnections) {\n connectionType = 'client';\n } */\n\n if(!this.chosenServers.hasOwnProperty(transportType)) {\n this.chosenServers[transportType] = {\n client: {},\n download: {},\n upload: {}\n };\n }\n\n const servers = this.chosenServers[transportType][connectionType];\n\n if(!(dcId in servers)) {\n servers[dcId] = [];\n }\n\n const transports = servers[dcId];\n\n if(!transports.length || !reuse/* || (upload && transports.length < 1) */) {\n let transport: MTTransport;\n\n \n transport = (transportType === 'websocket' ? this.transportSocket : this.transportHTTP)(dcId, connectionType, premium);\n \n \n \n \n \n\n if(!transport) {\n console.error('No chosenServer!', dcId);\n return null;\n }\n\n if(reuse) {\n transports.push(transport);\n }\n\n return transport;\n }\n\n return transports[0];\n }\n\n public static removeTransport(obj: any, transport: T) {\n for(const transportType in obj) {\n // @ts-ignore\n for(const connectionType in obj[transportType]) {\n // @ts-ignore\n for(const dcId in obj[transportType][connectionType]) {\n // @ts-ignore\n const transports: T[] = obj[transportType][connectionType][dcId];\n indexOfAndSplice(transports, transport);\n }\n }\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport App from '../../../config/app';\nimport deferredPromise from '../../../helpers/cancellablePromise';\nimport EventListenerBase from '../../../helpers/eventListenerBase';\nimport pause from '../../../helpers/schedulers/pause';\nimport {TransportType, DcConfigurator} from '../dcConfigurator';\nimport type HTTP from './http';\nimport type TcpObfuscated from './tcpObfuscated';\nimport MTTransport from './transport';\n\nexport class MTTransportController extends EventListenerBase<{\n change: (opened: MTTransportController['opened']) => void,\n transport: (type: TransportType) => void\n}> {\n private opened: Map;\n private transports: {[k in TransportType]?: MTTransport};\n private pinging: boolean;\n private dcConfigurator: DcConfigurator;\n\n constructor() {\n super(true);\n\n this.opened = new Map();\n /* this.addEventListener('change', (opened) => {\n this.dispatchEvent('transport', opened.get('websocket') || !opened.get('https') ? 'websocket' : 'https');\n }); */\n\n this.addEventListener('change', (opened) => {\n if(!opened.get('websocket')) {\n this.waitForWebSocket();\n }\n });\n\n // setTimeout(() => {\n // this.waitForWebSocket();\n // }, 200); // wait for first transport so won't have delay for first WS\n }\n\n public async pingTransports() {\n const dcConfigurator = this.dcConfigurator ??= new DcConfigurator();\n const timeout = 2000;\n const transports: {[k in TransportType]?: MTTransport} = this.transports = {\n https: dcConfigurator.chooseServer(App.baseDcId, 'client', 'https', false),\n websocket: dcConfigurator.chooseServer(App.baseDcId, 'client', 'websocket', false)\n };\n\n const httpPromise = deferredPromise();\n ((this.transports.https as HTTP)._send(new Uint8Array(), 'no-cors') as any as Promise)\n .then(() => httpPromise.resolve(true), () => httpPromise.resolve(false));\n setTimeout(() => httpPromise.resolve(false), timeout);\n\n const websocketPromise = deferredPromise();\n const socket = transports.websocket as TcpObfuscated;\n socket.setAutoReconnect(false);\n socket.connection.addEventListener('close', () => websocketPromise.resolve(false), {once: true});\n socket.connection.addEventListener('open', () => websocketPromise.resolve(true), {once: true});\n setTimeout(() => {\n if(websocketPromise.isFulfilled || websocketPromise.isRejected) {\n return;\n }\n\n if(socket.connection) {\n socket.connection.close();\n }\n\n websocketPromise.resolve(false);\n }, timeout);\n\n const [isHttpAvailable, isWebSocketAvailable] = await Promise.all([httpPromise, websocketPromise]);\n\n for(const transportType in transports) {\n const transport = transports[transportType as TransportType];\n transport.destroy();\n }\n\n const result = {\n https: isHttpAvailable || this.opened.get('https') > 0,\n websocket: isWebSocketAvailable || this.opened.get('websocket') > 0\n };\n\n // result.websocket = false;\n return result;\n }\n\n public async waitForWebSocket() {\n if(this.pinging) return;\n this.pinging = true;\n\n while(true) {\n const {https, websocket} = await this.pingTransports();\n if(https || websocket) {\n this.dispatchEvent('transport', websocket || !https ? 'websocket' : 'https');\n }\n\n if(websocket) {\n break;\n }\n\n await pause(10000);\n }\n\n this.pinging = false;\n }\n\n public setTransportValue(type: TransportType, value: boolean) {\n let length = this.opened.get(type) || 0;\n length += value ? 1 : -1;\n\n this.opened.set(type, length);\n this.dispatchEvent('change', this.opened);\n }\n\n public setTransportOpened(type: TransportType) {\n return this.setTransportValue(type, true);\n }\n\n public setTransportClosed(type: TransportType) {\n return this.setTransportValue(type, false);\n }\n}\n\nconst transportController = new MTTransportController();\nexport default transportController;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport deferredPromise, {CancellablePromise} from '../../../../helpers/cancellablePromise';\nimport type {StoragesResults} from './loadStorages';\n\nconst RESET_STORAGES_PROMISE: CancellablePromise> = deferredPromise();\nexport default RESET_STORAGES_PROMISE;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {CryptoMessagePort} from '../crypto/cryptoMessagePort';\nimport type {ApiFileManager} from '../mtproto/apiFileManager';\nimport type {ApiManager} from '../mtproto/apiManager';\nimport type {Authorizer} from '../mtproto/authorizer';\nimport type {DcConfigurator} from '../mtproto/dcConfigurator';\nimport type {NetworkerFactory} from '../mtproto/networkerFactory';\nimport type {PasswordManager} from '../mtproto/passwordManager';\nimport type {ReferenceDatabase} from '../mtproto/referenceDatabase';\nimport type {TimeManager} from '../mtproto/timeManager';\nimport type {RootScope} from '../rootScope';\nimport type DialogsStorage from '../storages/dialogs';\nimport type FiltersStorage from '../storages/filters';\nimport type PeersStorage from '../storages/peers';\nimport type ThumbsStorage from '../storages/thumbs';\nimport type {ApiUpdatesManager} from './apiUpdatesManager';\nimport type {AppAvatarsManager} from './appAvatarsManager';\nimport type {AppCallsManager} from './appCallsManager';\nimport type {AppChatsManager} from './appChatsManager';\nimport type {AppDocsManager} from './appDocsManager';\nimport type {AppDraftsManager} from './appDraftsManager';\nimport type {AppEmojiManager} from './appEmojiManager';\nimport type {AppGroupCallsManager} from './appGroupCallsManager';\nimport type {AppInlineBotsManager} from './appInlineBotsManager';\nimport type {AppMessagesIdsManager} from './appMessagesIdsManager';\nimport type {AppMessagesManager} from './appMessagesManager';\nimport type {AppNotificationsManager} from './appNotificationsManager';\nimport type AppPaymentsManager from './appPaymentsManager';\nimport type {AppPeersManager} from './appPeersManager';\nimport type {AppPhotosManager} from './appPhotosManager';\nimport type {AppPollsManager} from './appPollsManager';\nimport type {AppPrivacyManager} from './appPrivacyManager';\nimport type {AppProfileManager} from './appProfileManager';\nimport type {AppReactionsManager} from './appReactionsManager';\nimport type {AppStateManager} from './appStateManager';\nimport type {AppStickersManager} from './appStickersManager';\nimport type {AppStoragesManager} from './appStoragesManager';\nimport type {AppUsersManager} from './appUsersManager';\nimport type AppWebDocsManager from './appWebDocsManager';\nimport type {AppWebPagesManager} from './appWebPagesManager';\nimport type AppAttachMenuBotsManager from './appAttachMenuBotsManager';\nimport type AppSeamlessLoginManager from './appSeamlessLoginManager';\nimport type AppThemesManager from './appThemesManager';\nimport type {AppManagers} from './managers';\n\nexport class AppManager {\n protected appPeersManager: AppPeersManager;\n protected appChatsManager: AppChatsManager;\n protected appDocsManager: AppDocsManager;\n protected appPhotosManager: AppPhotosManager;\n protected appPollsManager: AppPollsManager;\n protected appUsersManager: AppUsersManager;\n protected appWebPagesManager: AppWebPagesManager;\n protected appDraftsManager: AppDraftsManager;\n protected appProfileManager: AppProfileManager;\n protected appNotificationsManager: AppNotificationsManager;\n protected apiUpdatesManager: ApiUpdatesManager;\n protected appAvatarsManager: AppAvatarsManager;\n protected appGroupCallsManager: AppGroupCallsManager;\n protected appCallsManager: AppCallsManager;\n protected appReactionsManager: AppReactionsManager;\n protected appMessagesManager: AppMessagesManager;\n protected appMessagesIdsManager: AppMessagesIdsManager;\n protected appPrivacyManager: AppPrivacyManager;\n protected appInlineBotsManager: AppInlineBotsManager;\n protected appStickersManager: AppStickersManager;\n protected referenceDatabase: ReferenceDatabase;\n protected appEmojiManager: AppEmojiManager;\n protected dialogsStorage: DialogsStorage;\n protected filtersStorage: FiltersStorage;\n protected apiManager: ApiManager;\n // protected apiManager: ApiManagerProxy;\n protected passwordManager: PasswordManager;\n protected cryptoWorker: CryptoMessagePort;\n protected apiFileManager: ApiFileManager;\n protected peersStorage: PeersStorage;\n protected thumbsStorage: ThumbsStorage;\n protected networkerFactory: NetworkerFactory;\n protected rootScope: RootScope;\n protected authorizer: Authorizer;\n protected dcConfigurator: DcConfigurator;\n protected timeManager: TimeManager;\n protected appStoragesManager: AppStoragesManager;\n protected appStateManager: AppStateManager;\n protected appWebDocsManager: AppWebDocsManager;\n protected appPaymentsManager: AppPaymentsManager;\n protected appAttachMenuBotsManager: AppAttachMenuBotsManager;\n protected appSeamlessLoginManager: AppSeamlessLoginManager;\n protected appThemesManager: AppThemesManager;\n\n public clear: (init?: boolean) => void;\n\n public setManagers(managers: AppManagers) {\n Object.assign(this, managers);\n // this.after();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type{Chat} from '../../../../layer';\nimport type{Dialog} from '../../appMessagesManager';\nimport type{User} from '../../appUsersManager';\nimport type {StoragesStorages} from './createStorages';\nimport {recordPromiseBound} from '../../../../helpers/recordPromise';\nimport {Awaited} from '../../../../types';\nimport {logger} from '../../../logger';\nimport RESET_STORAGES_PROMISE from './resetStoragesPromise';\n\nexport type StoragesResults = Awaited>;\n\nasync function loadStoragesInner(storages: StoragesStorages) {\n const recordPromise = recordPromiseBound(logger('STORAGES-LOADER'));\n const storagesKeys = Object.keys(storages) as Array;\n const storagesPromises: Promise[] = storagesKeys.map((key) => {\n const promise = storages[key].getAll();\n return recordPromise(promise, 'storage ' + (key as any as string));\n });\n\n const storagesResults: {\n users: User[],\n chats: Chat[],\n dialogs: Dialog[]\n } = {} as any;\n const arr = await Promise.all(storagesPromises);\n for(let i = 0, length = storagesKeys.length; i < length; ++i) {\n storagesResults[storagesKeys[i]] = arr[i] as any;\n }\n\n arr.splice(0, storagesKeys.length);\n\n const resetStorages = await RESET_STORAGES_PROMISE;\n if(resetStorages.size) {\n for(const key of resetStorages) {\n storagesResults[key].length = 0;\n }\n\n resetStorages.clear();\n }\n\n return storagesResults;\n}\n\nlet promise: ReturnType;\nexport default function loadStorages(storages: StoragesStorages) {\n return promise ??= loadStoragesInner(storages);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {logger} from '../logger';\nimport {AppManager} from './manager';\nimport createStorages from './utils/storages/createStorages';\nimport loadStorages from './utils/storages/loadStorages';\n\nexport class AppStoragesManager extends AppManager {\n private storages: ReturnType;\n\n // private loadPromise: CancellablePromise;\n\n private log: ReturnType;\n\n constructor() {\n super();\n\n this.log = logger('STORAGES');\n this.storages = createStorages();\n // this.loadPromise = deferredPromise();\n }\n\n public loadStorages() {\n return loadStorages(this.storages);\n // loadStorages(this.storages).then((storagesResults) => {\n // this.loadPromise.resolve(storagesResults);\n // });\n\n // return this.loadPromise;\n }\n\n // public setStoragesResults(storagesResults: StoragesResults) {\n // this.loadPromise.resolve(storagesResults);\n // }\n\n public async loadStorage(name: T) {\n return this.loadStorages().then((storagesResults) => {\n return {\n storage: this.storages[name],\n results: storagesResults[name]\n };\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Chat} from '../../../../layer';\nimport type {Dialog} from '../../appMessagesManager';\nimport type {User} from '../../appUsersManager';\nimport DATABASE_STATE from '../../../../config/databases/state';\nimport AppStorage from '../../../storage';\n\nexport type StoragesStorages = {\n users: AppStorage, typeof DATABASE_STATE>,\n chats: AppStorage, typeof DATABASE_STATE>,\n dialogs: AppStorage, typeof DATABASE_STATE>\n};\n\nexport default function createStorages() {\n const names: (keyof StoragesStorages)[] = ['users', 'chats', 'dialogs'];\n const storages: StoragesStorages = {} as any;\n for(const name of names) {\n // @ts-ignore\n storages[name] = new AppStorage(DATABASE_STATE, name);\n }\n\n return storages;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {AccountPassword, AccountUpdatePasswordSettings, InputCheckPasswordSRP, PasswordKdfAlgo} from '../../layer';\nimport randomize from '../../helpers/array/randomize';\nimport {AppManager} from '../appManagers/manager';\n\nexport class PasswordManager extends AppManager {\n public getState(): Promise {\n return this.apiManager.invokeApi('account.getPassword').then((result) => {\n return result;\n });\n }\n\n public updateSettings(settings: {\n hint?: string,\n email?: string,\n newPassword?: string,\n currentPassword?: string\n } = {}) {\n // state = Object.assign({}, state);\n // state.new_algo = Object.assign({}, state.new_algo);\n\n return this.getState().then((state) => {\n let currentHashPromise: Promise;\n let newHashPromise: Promise;\n const params: AccountUpdatePasswordSettings = {\n password: null,\n new_settings: {\n _: 'account.passwordInputSettings',\n hint: settings.hint,\n email: settings.email\n }\n };\n\n if(settings.currentPassword) {\n currentHashPromise = this.cryptoWorker.invokeCrypto('computeSRP', settings.currentPassword, state, false) as any;\n } else {\n currentHashPromise = Promise.resolve({\n _: 'inputCheckPasswordEmpty'\n });\n }\n\n // * https://core.telegram.org/api/srp#setting-a-new-2fa-password, but still there is a mistake, TDesktop passes 'new_algo' everytime\n const newAlgo = state.new_algo as PasswordKdfAlgo.passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow;\n const salt1 = new Uint8Array(newAlgo.salt1.length + 32);\n randomize(salt1);\n salt1.set(newAlgo.salt1, 0);\n newAlgo.salt1 = salt1;\n\n if(settings.newPassword) {\n newHashPromise = this.cryptoWorker.invokeCrypto('computeSRP', settings.newPassword, state, true) as any;\n } else {\n newHashPromise = Promise.resolve(new Uint8Array());\n }\n\n return Promise.all([currentHashPromise, newHashPromise]).then((hashes) => {\n params.password = hashes[0];\n params.new_settings.new_algo = newAlgo;\n params.new_settings.new_password_hash = hashes[1];\n\n return this.apiManager.invokeApi('account.updatePasswordSettings', params);\n });\n });\n }\n\n public getInputCheckPassword(password: string, state: AccountPassword) {\n return this.cryptoWorker.invokeCrypto('computeSRP', password, state, false) as Promise;\n }\n\n public check(password: string, state: AccountPassword, options: any = {}) {\n return this.getInputCheckPassword(password, state).then((inputCheckPassword) => {\n // console.log('SRP', inputCheckPassword);\n return this.apiManager.invokeApi('auth.checkPassword', {\n password: inputCheckPassword as InputCheckPasswordSRP.inputCheckPasswordSRP\n }, options).then((auth) => {\n if(auth._ === 'auth.authorization') {\n this.apiManager.setUser(auth.user);\n }\n\n return auth;\n });\n });\n }\n\n public confirmPasswordEmail(code: string) {\n return this.apiManager.invokeApi('account.confirmPasswordEmail', {code});\n }\n\n public resendPasswordEmail() {\n return this.apiManager.invokeApi('account.resendPasswordEmail');\n }\n\n public cancelPasswordEmail() {\n return this.apiManager.invokeApi('account.cancelPasswordEmail');\n }\n\n /* public requestRecovery(options: any = {}) {\n return apiManager.invokeApi('auth.requestPasswordRecovery', {}, options);\n }\n\n public recover(code: any, options: any = {}) {\n return apiManager.invokeApi('auth.recoverPassword', {\n code\n }, options);\n } */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Photo, WallPaper} from '../../layer';\nimport {logger} from '../logger';\nimport bytesToHex from '../../helpers/bytes/bytesToHex';\nimport deepEqual from '../../helpers/object/deepEqual';\nimport {AppManager} from '../appManagers/manager';\nimport makeError from '../../helpers/makeError';\n\nexport type ReferenceContext = ReferenceContext.referenceContextProfilePhoto | ReferenceContext.referenceContextMessage | ReferenceContext.referenceContextEmojiesSounds | ReferenceContext.referenceContextReactions | ReferenceContext.referenceContextUserFull | ReferenceContext.referenceContextCustomEmoji | ReferenceContext.referenceContextAttachMenuBotIcon | ReferenceContext.referenceContextWallPaper;\nexport namespace ReferenceContext {\n export type referenceContextProfilePhoto = {\n type: 'profilePhoto',\n peerId: PeerId\n };\n\n export type referenceContextMessage = {\n type: 'message',\n peerId: PeerId,\n messageId: number\n };\n\n export type referenceContextEmojiesSounds = {\n type: 'emojiesSounds'\n };\n\n export type referenceContextReactions = {\n type: 'reactions'\n };\n\n export type referenceContextUserFull = {\n type: 'userFull',\n userId: UserId\n };\n\n export type referenceContextCustomEmoji = {\n type: 'customEmoji',\n docId: DocId\n };\n\n export type referenceContextAttachMenuBotIcon = {\n type: 'attachMenuBotIcon',\n botId: BotId\n };\n\n export type referenceContextWallPaper = {\n type: 'wallPaper',\n wallPaperId: WallPaper['id']\n };\n}\n\nexport type ReferenceBytes = Photo.photo['file_reference'];\nexport type ReferenceContexts = Set;\n\n// type ReferenceBytes = Uint8Array;\n\nexport class ReferenceDatabase extends AppManager {\n private contexts: Map = new Map();\n // private references: Map = new Map();\n private links: {[hex: string]: ReferenceBytes} = {};\n private log = logger('RD', undefined, true);\n private refreshEmojiesSoundsPromise: Promise;\n\n // constructor() {\n // super();\n\n // apiManager.addTaskListener('refreshReference', (task: RefreshReferenceTask) => {\n // const originalPayload = task.payload;\n\n // assumeType(task);\n // task.originalPayload = originalPayload;\n\n // this.refreshReference(originalPayload).then((bytes) => {\n // task.payload = bytes;\n // }, (err) => {\n // task.error = err;\n // }).then(() => apiManager.postMessage(task));\n // });\n // }\n\n public saveContext(reference: ReferenceBytes, context: ReferenceContext, contexts?: ReferenceContexts) {\n [contexts, reference] = this.getContexts(reference);\n if(!contexts) {\n contexts = new Set();\n this.contexts.set(reference, contexts);\n }\n\n this.links[bytesToHex(reference)] = reference;\n for(const _context of contexts) {\n if(deepEqual(_context, context)) {\n return;\n }\n }\n\n contexts.add(context);\n }\n\n public getReferenceByLink(reference: ReferenceBytes) {\n return this.links[bytesToHex(reference)];\n }\n\n public getContexts(reference: ReferenceBytes): [ReferenceContexts, ReferenceBytes] {\n const contexts = this.contexts.get(reference) || (reference = this.getReferenceByLink(reference) || reference, this.contexts.get(reference));\n return [contexts, reference];\n }\n\n public getContext(reference: ReferenceBytes): [ReferenceContext, ReferenceBytes] {\n const contexts = this.getContexts(reference);\n return contexts[0] ? [contexts[0].values().next().value, contexts[1]] : undefined;\n }\n\n public deleteContext(reference: ReferenceBytes, context: ReferenceContext, contexts?: ReferenceContexts) {\n [contexts, reference] = this.getContexts(reference);\n if(contexts) {\n for(const _context of contexts) {\n if(deepEqual(_context, context)) {\n contexts.delete(_context);\n if(!contexts.size) {\n this.contexts.delete(reference);\n delete this.links[bytesToHex(reference)];\n }\n return true;\n }\n }\n }\n\n return false;\n }\n\n public refreshReference(reference: ReferenceBytes, context?: ReferenceContext): Promise {\n this.log('refreshReference: start', reference.slice(), context);\n if(!context) {\n const c = this.getContext(reference);\n if(!c) {\n this.log('refreshReference: got no context for reference:', reference.slice());\n return Promise.reject('NO_CONTEXT');\n }\n\n [context, reference] = c;\n }\n\n let promise: Promise;\n switch(context?.type) {\n case 'message': {\n promise = this.appMessagesManager.reloadMessages(context.peerId, context.messageId, true);\n break;\n // .then(() => {\n // console.log('FILE_REFERENCE_EXPIRED: got message', context, appMessagesManager.getMessage((context as ReferenceContext.referenceContextMessage).messageId).media, reference);\n // });\n }\n\n case 'emojiesSounds': {\n promise = this.refreshEmojiesSoundsPromise || this.appStickersManager.getAnimatedEmojiSounds(true).then(() => {\n this.refreshEmojiesSoundsPromise = undefined;\n });\n break;\n }\n\n case 'userFull': {\n promise = Promise.resolve(this.appProfileManager.getProfile(context.userId, true));\n break;\n }\n\n case 'customEmoji': {\n promise = this.appEmojiManager.getCustomEmojiDocuments([context.docId]);\n break;\n }\n\n case 'attachMenuBotIcon': {\n promise = this.appAttachMenuBotsManager.getAttachMenuBot(context.botId, true) as any;\n break;\n }\n\n case 'wallPaper': {\n promise = this.appThemesManager.getWallPaperById(context.wallPaperId);\n break;\n }\n\n default: {\n this.log.warn('refreshReference: not implemented context', context);\n return Promise.reject();\n }\n }\n\n const hex = bytesToHex(reference);\n this.log('refreshReference: refreshing reference:', hex);\n return promise.then(() => {\n const newHex = bytesToHex(reference);\n this.log('refreshReference: refreshed, reference before:', hex, 'after:', newHex);\n if(hex !== newHex) {\n return reference;\n }\n\n this.deleteContext(reference, context);\n\n const newContext = this.getContext(reference);\n if(newContext) {\n return this.refreshReference(reference, newContext[0]);\n }\n\n this.log.error('refreshReference: no new context, reference before:', hex, 'after:', newHex, context);\n\n throw makeError('NO_NEW_CONTEXT');\n });\n }\n\n /* public replaceReference(oldReference: ReferenceBytes, newReference: ReferenceBytes) {\n const contexts = this.contexts.get(oldReference);\n if(contexts) {\n this.contexts.delete(oldReference);\n this.contexts.set(newReference, contexts);\n }\n } */\n}\n","export default function safeReplaceObject(wasObject: any, newObject: any) {\n if(!wasObject) {\n return newObject;\n }\n\n for(var key in wasObject) {\n if(!newObject.hasOwnProperty(key)) {\n delete wasObject[key];\n }\n }\n\n for(var key in newObject) {\n // if (newObject.hasOwnProperty(key)) { // useless\n wasObject[key] = newObject[key];\n // }\n }\n\n return wasObject;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Message, MessageAction, MessageMedia} from '../../../../layer';\nimport getPeerId from '../peers/getPeerId';\n\nexport default function getPeerIdsFromMessage(message: Message.message | Message.messageService) {\n const peerIds: number[] = [\n message.fromId,\n message.viaBotId,\n (message as Message.message).fwdFromId\n ];\n\n const media = (message as Message.message).media;\n if(media) {\n const contactUserId = (media as MessageMedia.messageMediaContact).user_id;\n if(contactUserId !== undefined) {\n peerIds.push(contactUserId.toPeerId());\n }\n\n const results = (media as MessageMedia.messageMediaPoll).results;\n const recentVoters = results?.recent_voters;\n if(recentVoters?.length) {\n peerIds.push(...recentVoters.map((userId) => userId.toPeerId()));\n }\n }\n\n const recentReactions = ((message as Message.message).reactions)?.recent_reactions;\n if(recentReactions?.length) {\n peerIds.push(...recentReactions.map((reaction) => getPeerId(reaction.peer_id)));\n }\n\n const action = (message as Message.messageService).action;\n if(action) {\n const userIds: UserId[] = [\n ...((action as MessageAction.messageActionChatAddUser).users || []),\n (action as MessageAction.messageActionChatDeleteUser).user_id,\n (action as MessageAction.messageActionChatJoinedByLink).inviter_id\n ];\n peerIds.push(...userIds.filter(Boolean).map((userId) => userId.toPeerId()));\n\n const chatIds: ChatId[] = [\n (action as MessageAction.messageActionChatMigrateTo).channel_id,\n (action as MessageAction.messageActionChannelMigrateFrom).chat_id\n ];\n peerIds.push(...chatIds.filter(Boolean).map((chatId) => chatId.toPeerId(true)));\n }\n\n const recentRepliers = ((message as Message.message).replies)?.recent_repliers;\n if(recentRepliers?.length) {\n peerIds.push(...recentRepliers.map((reply) => getPeerId(reply)));\n }\n\n return new Set(peerIds.filter(Boolean));\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {ForumTopic} from '../../../../layer';\nimport type {Dialog} from '../../appMessagesManager';\nimport type getDialogIndexKey from './getDialogIndexKey';\n\nexport default function setDialogIndex(\n dialog: Dialog | ForumTopic.forumTopic,\n indexKey: ReturnType,\n index: number\n) {\n return (dialog as Dialog)[indexKey] = index;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {Chat, ForumTopic as MTForumTopic, DialogPeer, Message, MessageAction, MessageMedia, MessagesForumTopics, MessagesPeerDialogs, Update} from '../../layer';\nimport type {Dialog, ForumTopic, MyMessage} from '../appManagers/appMessagesManager';\nimport tsNow from '../../helpers/tsNow';\nimport SearchIndex from '../searchIndex';\nimport {SliceEnd} from '../../helpers/slicedArray';\nimport {MyDialogFilter} from './filters';\nimport {FOLDER_ID_ALL, FOLDER_ID_ARCHIVE, NULL_PEER_ID, REAL_FOLDERS, REAL_FOLDER_ID} from '../mtproto/mtproto_config';\nimport {MaybePromise, NoneToVoidFunction} from '../../types';\nimport ctx from '../../environment/ctx';\nimport AppStorage from '../storage';\nimport type DATABASE_STATE from '../../config/databases/state';\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport insertInDescendSortedArray from '../../helpers/array/insertInDescendSortedArray';\nimport safeReplaceObject from '../../helpers/object/safeReplaceObject';\nimport getServerMessageId from '../appManagers/utils/messageId/getServerMessageId';\nimport generateMessageId from '../appManagers/utils/messageId/generateMessageId';\nimport {AppManager} from '../appManagers/manager';\nimport getDialogIndexKey from '../appManagers/utils/dialogs/getDialogIndexKey';\nimport isObject from '../../helpers/object/isObject';\nimport getDialogIndex from '../appManagers/utils/dialogs/getDialogIndex';\nimport getPeerIdsFromMessage from '../appManagers/utils/messages/getPeerIdsFromMessage';\nimport {AppStoragesManager} from '../appManagers/appStoragesManager';\nimport defineNotNumerableProperties from '../../helpers/object/defineNotNumerableProperties';\nimport setDialogIndex from '../appManagers/utils/dialogs/setDialogIndex';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport pause from '../../helpers/schedulers/pause';\nimport {BroadcastEvents} from '../rootScope';\nimport assumeType from '../../helpers/assumeType';\nimport makeError from '../../helpers/makeError';\nimport callbackify from '../../helpers/callbackify';\n\nexport type FolderDialog = {\n dialog: Dialog,\n index: number\n};\n\nexport type Folder = {\n dialogs: (Dialog | ForumTopic)[],\n id: number,\n unreadMessagesCount: number,\n unreadPeerIds: Set,\n unreadUnmutedPeerIds: Set,\n dispatchUnreadTimeout?: number\n};\n\nexport const GLOBAL_FOLDER_ID: REAL_FOLDER_ID = undefined;\n\n// let spentTime = 0;\nexport default class DialogsStorage extends AppManager {\n private storage: AppStoragesManager['storages']['dialogs'];\n\n private dialogs: {[peerId: PeerId]: Dialog};\n\n private folders: {[folderId: number]: Folder};\n\n private allDialogsLoaded: {[folder_id: number]: boolean};\n private dialogsOffsetDate: {[folder_id: number]: number};\n private pinnedOrders: {[folder_id: number]: PeerId[]};\n private dialogsNum: number;\n\n private dialogsIndex: SearchIndex;\n\n private cachedResults: {\n query: string,\n count: number,\n dialogs: Dialog[],\n folderId: number\n };\n\n private forumTopics: Map,\n deletedTopics: Set,\n getTopicPromises: Map>,\n getTopicsPromise?: Promise\n }>;\n\n protected after() {\n this.clear(true);\n\n this.rootScope.addEventListener('language_change', () => {\n const peerId = this.appUsersManager.getSelf().id.toPeerId(false);\n const dialog = this.getDialogOnly(peerId);\n if(dialog) {\n const peerText = this.appPeersManager.getPeerSearchText(peerId);\n this.dialogsIndex.indexObject(peerId, peerText);\n }\n });\n\n const onFilterUpdate = (filter: MyDialogFilter) => {\n const dialogs = this.getCachedDialogs(false);\n for(let i = 0; i < dialogs.length; ++i) {\n this.processDialogForFilter(dialogs[i], filter);\n }\n };\n\n this.rootScope.addEventListener('filter_order', () => {\n const dialogs = this.getCachedDialogs(false);\n // const indexKeys: ReturnType[] = [];\n for(const filterId in this.folders) {\n if(+filterId > 1) {\n delete this.folders[filterId];\n }\n\n // indexKeys.push(this.getDialogIndexKey(+filterId));\n }\n\n for(let i = 0; i < dialogs.length; ++i) {\n const dialog = dialogs[i];\n // for(const indexKey of indexKeys) {\n // delete dialog[indexKey];\n // }\n\n this.processDialogForFilters(dialog);\n }\n });\n\n this.rootScope.addEventListener('filter_update', onFilterUpdate);\n this.rootScope.addEventListener('filter_new', onFilterUpdate);\n\n this.rootScope.addEventListener('filter_delete', (filter) => {\n const dialogs = this.getCachedDialogs(false);\n\n const indexKey = this.getDialogIndexKeyByFilterId(filter.id);\n for(let i = 0; i < dialogs.length; ++i) {\n const dialog = dialogs[i];\n delete dialog[indexKey];\n }\n\n delete this.folders[filter.id];\n });\n\n this.rootScope.addEventListener('dialog_notify_settings', (dialog) => {\n this.processChangedUnreadOrUnmuted(dialog.peerId);\n });\n\n this.rootScope.addEventListener('chat_update', (chatId) => {\n const chat = this.appChatsManager.getChat(chatId);\n\n const peerId = chatId.toPeerId(true);\n if((chat as Chat.chat).pFlags.left && this.getDialogOnly(peerId)) {\n this.dropDialogOnDeletion(peerId);\n }\n });\n\n this.rootScope.addEventListener('chat_toggle_forum', ({chatId, enabled}) => {\n const peerId = chatId.toPeerId(true);\n if(!enabled) {\n this.flushForumTopicsCache(peerId);\n }\n\n this.processChangedUnreadOrUnmuted(peerId);\n });\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateFolderPeers: this.onUpdateFolderPeers,\n\n updateDialogPinned: this.onUpdateDialogPinned,\n\n updateChannelPinnedTopic: this.onUpdateChannelPinnedTopic,\n\n updatePinnedDialogs: this.onUpdatePinnedDialogs,\n\n updateChannelPinnedTopics: this.onUpdateChannelPinnedTopics\n });\n\n return Promise.all([\n this.appStateManager.getState(),\n this.appStoragesManager.loadStorage('dialogs')\n ]).then(([state, {results: dialogs, storage}]) => {\n this.storage = storage;\n this.dialogs = this.storage.getCache();\n\n for(const folderId of REAL_FOLDERS) {\n const order = state.pinnedOrders[folderId];\n if(!order) {\n continue;\n }\n\n const _order = this.getPinnedOrders(folderId);\n _order.splice(0, _order.length, ...order);\n }\n\n if(dialogs.length) {\n AppStorage.freezeSaving(this.setDialogsFromState.bind(this, dialogs), ['chats', 'dialogs', 'messages', 'users']);\n }\n\n this.allDialogsLoaded = state.allDialogsLoaded || {};\n\n if(dialogs.length) {\n this.appDraftsManager.addMissedDialogs();\n }\n });\n }\n\n private setDialogsFromState(dialogs: Dialog[]) {\n for(let i = 0, length = dialogs.length; i < length; ++i) {\n const dialog = dialogs[i];\n if(!dialog) {\n continue;\n }\n\n // if(dialog.peerId !== SERVICE_PEER_ID) {\n dialog.top_message = getServerMessageId(dialog.top_message); // * fix outgoing message to avoid copying dialog\n // }\n\n if(dialog.topMessage) {\n this.appMessagesManager.saveMessages([dialog.topMessage]);\n }\n\n for(let i = 0; i <= 21; ++i) {\n const indexKey: ReturnType = `index_${i}` as any;\n delete dialog[indexKey];\n }\n // delete dialog.indexes;\n\n this.saveDialog({\n dialog,\n ignoreOffsetDate: true\n });\n\n // ! WARNING, убрать это когда нужно будет делать чтобы pending сообщения сохранялись\n const message = this.appMessagesManager.getMessageByPeer(dialog.peerId, dialog.top_message);\n if(!message) {\n this.appMessagesManager.reloadConversation(dialog.peerId);\n }\n }\n }\n\n public isDialogsLoaded(folderId: number) {\n return !!this.allDialogsLoaded[folderId];\n }\n\n public setDialogsLoaded(folderId: number, loaded: boolean) {\n const isForum = this.isFilterIdForForum(folderId);\n\n if(folderId === GLOBAL_FOLDER_ID && loaded) {\n this.allDialogsLoaded[FOLDER_ID_ALL] = loaded;\n this.allDialogsLoaded[FOLDER_ID_ARCHIVE] = loaded;\n } else {\n if(isForum) {\n defineNotNumerableProperties(this.allDialogsLoaded, [folderId]);\n }\n\n this.allDialogsLoaded[folderId] = loaded;\n }\n\n if(isForum) {\n return;\n }\n\n if(Array.from(REAL_FOLDERS).every((folderId) => this.allDialogsLoaded[folderId])) {\n this.allDialogsLoaded[GLOBAL_FOLDER_ID] = true;\n }\n\n this.saveAllDialogsLoaded();\n }\n\n private saveAllDialogsLoaded() {\n this.appStateManager.pushToState('allDialogsLoaded', this.allDialogsLoaded);\n }\n\n public clear = (init = false) => {\n if(!init) {\n this.storage.clear();\n\n this.allDialogsLoaded = {};\n this.saveAllDialogsLoaded();\n\n // * clear not numerable properties\n this.pinnedOrders = Object.assign({}, this.pinnedOrders);\n for(const folderId of REAL_FOLDERS) {\n this.resetPinnedOrder(folderId);\n }\n this.savePinnedOrders();\n } else {\n this.allDialogsLoaded = {};\n this.pinnedOrders = {};\n for(const folderId of REAL_FOLDERS) {\n this.pinnedOrders[folderId] = [];\n }\n }\n\n this.forumTopics = new Map();\n this.folders = {};\n this.dialogsOffsetDate = {};\n this.dialogsNum = 0;\n this.dialogsIndex = new SearchIndex({\n clearBadChars: true,\n ignoreCase: true,\n latinize: true,\n includeTag: true\n });\n this.cachedResults = {\n query: '',\n count: 0,\n dialogs: [],\n folderId: 0\n };\n };\n\n public handleDialogUnpinning(dialog: Dialog | ForumTopic, folderId: number) {\n delete dialog.pFlags.pinned;\n indexOfAndSplice(this.getPinnedOrders(folderId), this.isFilterIdForForum(folderId) ? (dialog as ForumTopic).id : dialog.peerId);\n this.savePinnedOrders();\n }\n\n public savePinnedOrders() {\n this.appStateManager.pushToState('pinnedOrders', this.pinnedOrders);\n }\n\n public resetPinnedOrder(folderId: number) {\n this.getPinnedOrders(folderId).length = 0;\n }\n\n public getPinnedOrders(folderId: number) {\n let orders = this.pinnedOrders[folderId];\n if(!orders && this.isFilterIdForForum(folderId)) {\n defineNotNumerableProperties(this.pinnedOrders, [folderId]);\n orders = this.pinnedOrders[folderId] = [];\n }\n\n return orders;\n }\n\n public isDialogPinned(peerId: PeerId, folderId: number) {\n const filter = this.filtersStorage.getFilter(folderId);\n let isPinned: boolean;\n if(filter) {\n isPinned = filter.pinnedPeerIds.indexOf(peerId) !== -1;\n } else {\n isPinned = !!this.getDialogOnly(peerId).pFlags.pinned;\n }\n\n return isPinned;\n }\n\n public getOffsetDate(folderId: number): number {\n const offsetDate = this.dialogsOffsetDate[folderId] || 0;\n if(folderId === GLOBAL_FOLDER_ID && !offsetDate) { // make request not from beginning if we have loaded some dialogs\n return Math.min(...Array.from(REAL_FOLDERS).sort((a, b) => a - b));\n }\n\n return offsetDate;\n }\n\n private generateFolder(id: number) {\n const folder: Folder = {\n dialogs: [],\n id,\n unreadMessagesCount: 0,\n unreadPeerIds: new Set(),\n unreadUnmutedPeerIds: new Set()\n };\n\n defineNotNumerableProperties(folder, ['dispatchUnreadTimeout']);\n\n return folder;\n }\n\n public getFolder(id: number) {\n return this.folders[id] ??= this.generateFolder(id);\n }\n\n public isFilterIdForForum(filterId: number) {\n return filterId && filterId < 0;\n }\n\n public getFilterIdForForum(forumTopic: ForumTopic) {\n return forumTopic.peerId;\n }\n\n public getDialogKey(dialog: Dialog | ForumTopic) {\n return this.isTopic(dialog) ? dialog.id : dialog.peerId;\n }\n\n public getFolderDialogs(id: number, skipMigrated = true): Folder['dialogs'] {\n if(id === GLOBAL_FOLDER_ID) { // * it won't be sorted\n return this.getCachedDialogs(skipMigrated);\n }\n\n const folder = this.getFolder(id);\n if(this.isFilterIdForForum(id)) {\n return skipMigrated ? folder.dialogs.filter((forumTopic) => !(forumTopic as ForumTopic).pFlags.hidden) : folder.dialogs;\n }\n\n return skipMigrated ? folder.dialogs.filter((dialog) => (dialog as Dialog).migratedTo === undefined) : folder.dialogs;\n }\n\n public getNextDialog(currentPeerId: PeerId, next: boolean, filterId: number) {\n const folder = this.getFolderDialogs(filterId, true);\n let dialog: Folder['dialogs'][0];\n if(!currentPeerId) {\n if(next) {\n dialog = folder[0];\n }\n } else {\n const idx = folder.findIndex((dialog) => dialog.peerId === currentPeerId);\n if(idx !== -1) {\n const nextIndex = next ? idx + 1 : idx - 1;\n dialog = folder[nextIndex];\n }\n }\n\n return dialog;\n }\n\n public getDialogIndexKeyByFilterId(filterId: number) {\n if(this.isFilterIdForForum(filterId)) return getDialogIndexKey();\n if(REAL_FOLDERS.has(filterId)) return getDialogIndexKey(filterId as REAL_FOLDER_ID);\n const filter = this.filtersStorage.getFilter(filterId);\n return getDialogIndexKey(filter.localId);\n }\n\n private isDialogUnmuted(dialog: Dialog | ForumTopic) {\n return !this.appNotificationsManager.isPeerLocalMuted({\n peerId: dialog.peerId,\n respectType: true,\n threadId: this.isTopic(dialog) ? (dialog as ForumTopic).id : undefined\n });\n }\n\n public getFolderUnreadCount(filterId: number) {\n const folder = this.getFolder(filterId);\n return {unreadUnmutedCount: folder.unreadUnmutedPeerIds.size, unreadCount: folder.unreadPeerIds.size};\n }\n\n public getCachedDialogs(skipMigrated?: boolean) {\n const arrays = Array.from(REAL_FOLDERS).map((folderId) => this.getFolderDialogs(folderId, skipMigrated));\n return [].concat(...arrays) as Dialog[];\n }\n\n private setDialogIndexInFilter(\n dialog: Dialog | ForumTopic,\n indexKey: ReturnType,\n filter?: MyDialogFilter\n ) {\n // if(this.isTopic(dialog)) {\n // return dialog['index_0'];\n // }\n\n let index: number;\n\n const isTopic = this.isTopic(dialog);\n const isRealFolder = isTopic || REAL_FOLDERS.has(filter.id);\n /* if(isRealFolder) {\n // index = getDialogIndex(dialog, indexKey);\n index = this.generateIndexForDialog(dialog, true);\n } else */if(this.filtersStorage.testDialogForFilter(dialog, filter)) {\n const pinnedIds = isTopic ?\n this.getPinnedOrders(this.getFilterIdForForum(dialog)) :\n filter.pinnedPeerIds;\n\n const pinnedKey = this.getDialogKey(dialog);\n const pinnedIndex = pinnedIds.indexOf(pinnedKey);\n\n if(pinnedIndex !== -1) {\n index = this.generateDialogIndex(this.generateDialogPinnedDateByIndex(pinnedIds.length - 1 - pinnedIndex), true);\n } else if(dialog.pFlags?.pinned || isRealFolder) {\n index = this.generateIndexForDialog(dialog, true, undefined, !isRealFolder);\n } else {\n index = getDialogIndex(dialog) ?? this.generateIndexForDialog(dialog, true);\n }\n }\n\n // if(!dialog.hasOwnProperty(indexKey)) {\n // defineNotNumerableProperties(dialog, [indexKey]);\n // }\n\n return setDialogIndex(dialog, indexKey, index);\n }\n\n public getDialog(peerId: PeerId, folderId?: number, topicId?: number, skipMigrated = true): [Folder['dialogs'][0], number] | [] {\n const folders: Folder['dialogs'][] = [];\n\n if(topicId) {\n folderId = peerId;\n // skipMigrated = false;\n }\n\n if(folderId === undefined) {\n folders.push(...Array.from(REAL_FOLDERS).map((folderId) => this.getFolder(folderId).dialogs as Dialog[]));\n } else {\n folders.push(this.getFolderDialogs(folderId, false) as Dialog[]);\n }\n\n const verify: (d: Folder['dialogs'][0]) => boolean = topicId ?\n (d) => (d as ForumTopic).id === topicId :\n (d) => (d as Dialog).peerId === peerId;\n for(const folder of folders) {\n let i = 0, skipped = 0;\n for(let length = folder.length; i < length; ++i) {\n const dialog = folder[i];\n if(verify(dialog)) {\n return [dialog, i - skipped];\n } else if(skipMigrated && ((dialog as ForumTopic).pFlags.hidden || (dialog as Dialog).migratedTo !== undefined)) {\n ++skipped;\n }\n }\n }\n\n return [];\n }\n\n public getDialogOnly(peerId: PeerId) {\n return this.dialogs[peerId];\n }\n\n public getDialogOrTopic(peerId: PeerId, topicId?: number) {\n return topicId ? this.getForumTopic(peerId, topicId) : this.dialogs[peerId];\n }\n\n public getDialogIndex(\n peerId: PeerId | Parameters[0],\n indexKey: ReturnType,\n topicId?: number\n ) {\n const dialog = isObject(peerId) ? peerId : this.getDialogOrTopic(peerId, topicId);\n return getDialogIndex(dialog, indexKey);\n }\n\n /*\n var date = Date.now() / 1000 | 0;\n var m = date * 0x10000;\n\n var k = (date + 1) * 0x10000;\n k - m;\n 65536\n */\n public generateDialogIndex(date?: number, isPinned?: boolean) {\n date ??= tsNow(true) + this.timeManager.getServerTimeOffset();\n return (date * 0x10000) + (isPinned ? 0 : (++this.dialogsNum & 0xFFFF));\n }\n\n // public makeFilterForTopics(id: number): MyDialogFilter {\n // return {\n // _: 'dialogFilter',\n // id,\n\n // };\n // }\n\n public isTopic(dialog: Dialog | ForumTopic): dialog is ForumTopic {\n return 'id' in dialog;\n }\n\n public processDialogForFilters(dialog: Dialog | ForumTopic, noIndex?: boolean) {\n // let perf = performance.now();\n if(this.isTopic(dialog)) {\n this.processDialogForFilter(dialog, undefined, noIndex);\n return;\n }\n\n const filters = this.filtersStorage.getFilters();\n for(const id in filters) {\n const filter = filters[id];\n this.processDialogForFilter(dialog, filter, noIndex);\n }\n // spentTime += (performance.now() - perf);\n // console.log('generate index time:', spentTime);\n }\n\n public processDialogForFilter(\n dialog: Dialog | ForumTopic,\n filter?: MyDialogFilter,\n noIndex?: boolean\n ) {\n const isTopic = this.isTopic(dialog);\n const folderId = isTopic ? this.getFilterIdForForum(dialog) : filter.id;\n\n const indexKey = isTopic ? 'index_0' : this.getDialogIndexKeyByFilterId(folderId);\n const folder = this.getFolder(folderId);\n const dialogs = folder.dialogs;\n\n const cmp: (d: typeof dialog) => boolean = isTopic ?\n ((d: ForumTopic) => d.id === dialog.id) as any :\n ((d: Dialog) => d.peerId === dialog.peerId) as any;\n const wasIndex = dialogs.findIndex(cmp);\n const wasDialog = dialogs[wasIndex];\n const wasDialogIndex = this.getDialogIndex(wasDialog, indexKey);\n\n if(noIndex && folderId > FOLDER_ID_ARCHIVE) {\n noIndex = undefined;\n }\n\n const newDialogIndex = noIndex ? undefined : this.setDialogIndexInFilter(dialog, indexKey, filter);\n\n if(wasDialogIndex === newDialogIndex) {\n return false;\n }\n\n if(!!wasDialogIndex !== !!newDialogIndex) {\n this.prepareFolderUnreadCountModifyingByDialog(folderId, dialog, !!newDialogIndex);\n }\n\n if(wasIndex !== -1) {\n dialogs.splice(wasIndex, 1);\n }\n\n if(newDialogIndex) {\n insertInDescendSortedArray(dialogs, dialog, (dialog) => this.getDialogIndex(dialog, indexKey), -1);\n }\n\n return true;\n }\n\n public prepareDialogUnreadCountModifying(dialog: Dialog | ForumTopic, toggle?: boolean) {\n const isTopic = this.isTopic(dialog);\n const callbacks: NoneToVoidFunction[] = [];\n\n const folderId = isTopic ? this.getFilterIdForForum(dialog) : dialog.folder_id;\n callbacks.push(this.prepareFolderUnreadCountModifyingByDialog(folderId, dialog, toggle));\n\n if(!isTopic) {\n const filters = this.filtersStorage.getFilters();\n for(const id in filters) {\n const filter = filters[id];\n if(this.filtersStorage.testDialogForFilter(dialog, filter)) {\n callbacks.push(this.prepareFolderUnreadCountModifyingByDialog(filter.id, dialog, toggle));\n }\n }\n }\n\n return () => !toggle && callbacks.forEach((callback) => callback());\n }\n\n public prepareFolderUnreadCountModifyingByDialog(folderId: number, dialog: Dialog | ForumTopic, toggle?: boolean) {\n const wasUnreadCount = this.appMessagesManager.getDialogUnreadCount(dialog);\n const wasUnmuted = this.isDialogUnmuted(dialog);\n\n if(toggle !== undefined) {\n const addMessagesCount = toggle ? wasUnreadCount : -wasUnreadCount;\n this.modifyFolderUnreadCount(folderId, addMessagesCount, !!wasUnreadCount, wasUnreadCount && wasUnmuted, dialog);\n return;\n }\n\n return () => {\n const newUnreadCount = this.appMessagesManager.getDialogUnreadCount(dialog);\n const newUnmuted = this.isDialogUnmuted(dialog);\n\n const addMessagesCount = newUnreadCount - wasUnreadCount;\n this.modifyFolderUnreadCount(folderId, addMessagesCount, !!newUnreadCount, newUnreadCount && newUnmuted, dialog);\n };\n }\n\n public modifyFolderUnreadCount(\n folderId: number,\n addMessagesCount: number,\n toggleDialog: boolean,\n toggleUnmuted: boolean,\n dialog: Dialog | ForumTopic\n ) {\n const {peerId} = dialog;\n const isForum = this.appPeersManager.isForum(peerId);\n const isTopic = this.isTopic(dialog);\n if(isForum && !isTopic) {\n const forumUnreadCount = this.getForumUnreadCount(peerId);\n if(forumUnreadCount instanceof Promise) {\n forumUnreadCount.then(({count, hasUnmuted}) => {\n dialog = this.getDialogOnly(peerId);\n const folder = this.getFolder(folderId);\n if(\n !dialog ||\n !this.appPeersManager.isForum(peerId) ||\n !folder ||\n !folder.dialogs.some((dialog) => dialog.peerId === peerId)\n ) {\n return;\n }\n\n this.modifyFolderUnreadCount(folderId, 0, false, false, dialog);\n });\n\n return;\n } else {\n addMessagesCount = 0;\n toggleDialog = forumUnreadCount.count > 0;\n toggleUnmuted = forumUnreadCount.hasUnmuted;\n }\n }\n\n const folder = this.getFolder(folderId);\n if(addMessagesCount) {\n folder.unreadMessagesCount = Math.max(0, folder.unreadMessagesCount + addMessagesCount);\n }\n\n const key = this.getDialogKey(dialog);\n if(toggleDialog) {\n folder.unreadPeerIds.add(key);\n } else {\n folder.unreadPeerIds.delete(key);\n }\n\n if(toggleUnmuted) {\n folder.unreadUnmutedPeerIds.add(key);\n } else {\n folder.unreadUnmutedPeerIds.delete(key);\n }\n\n folder.dispatchUnreadTimeout ??= ctx.setTimeout(() => {\n folder.dispatchUnreadTimeout = undefined;\n const _folder = {...folder};\n delete _folder.dialogs;\n this.rootScope.dispatchEvent('folder_unread', _folder);\n\n if(isTopic) { // * refresh forum dialog unread count\n this.processChangedUnreadOrUnmuted(peerId);\n }\n }, 0);\n }\n\n public processChangedUnreadOrUnmuted(peerId: PeerId) {\n const dialog = this.getDialogOnly(peerId);\n if(dialog) {\n this.processDialogForFilters(dialog);\n this.prepareDialogUnreadCountModifying(dialog)();\n this.rootScope.dispatchEvent('dialog_unread', {\n peerId,\n dialog\n });\n }\n }\n\n public generateIndexForDialog(\n dialog: Dialog | ForumTopic,\n justReturn?: boolean,\n message?: MyMessage,\n noPinnedOrderUpdate?: boolean\n ) {\n if(!justReturn/* && !isTopic */) {\n return;\n }\n\n const isTopic = this.isTopic(dialog);\n let topDate = 0, isPinned: boolean;\n if((dialog as ForumTopic).pFlags.hidden) { // general topic must be first\n topDate = this.generateDialogPinnedDateByIndex(0xFFF);\n isPinned = true;\n } else if(dialog.pFlags.pinned && !noPinnedOrderUpdate) {\n topDate = this.generateDialogPinnedDate(dialog);\n isPinned = true;\n } else {\n message ||= this.appMessagesManager.getMessageByPeer(dialog.peerId, dialog.top_message);\n\n topDate = (message as Message.message)?.date || topDate;\n\n if(!isTopic) {\n const channelId = this.appPeersManager.isChannel(dialog.peerId) && dialog.peerId.toChatId();\n if(channelId) {\n const channel = this.appChatsManager.getChat(channelId) as Chat.channel;\n if(!topDate || (channel.date && channel.date > topDate)) {\n topDate = channel.date;\n }\n }\n }\n\n if(dialog.draft?._ === 'draftMessage' && dialog.draft.date > topDate) {\n topDate = dialog.draft.date;\n }\n }\n\n topDate ||= tsNow(true);\n\n const index = this.generateDialogIndex(topDate, isPinned);\n if(justReturn) {\n return index;\n }\n\n const indexKey = getDialogIndexKey((dialog as Dialog).folder_id);\n setDialogIndex(dialog, indexKey, index);\n }\n\n public generateDialogPinnedDateByIndex(pinnedIndex: number) {\n return 0x7fff0000 + (pinnedIndex & 0xFFFF); // 0xFFFF - потому что в папках может быть бесконечное число пиннедов\n }\n\n public generateDialogPinnedDate(dialog: Dialog | ForumTopic) {\n const isTopic = this.isTopic(dialog);\n const order = this.getPinnedOrders(isTopic ? this.getFilterIdForForum(dialog) : dialog.folder_id);\n\n const dialogKey = this.getDialogKey(dialog);\n let pinnedIndex = order.indexOf(dialogKey);\n if(pinnedIndex === -1) {\n order.unshift(dialogKey);\n pinnedIndex = 0;\n\n if(!isTopic) {\n this.savePinnedOrders();\n }\n }\n\n return this.generateDialogPinnedDateByIndex(order.length - 1 - pinnedIndex);\n }\n\n /* public generateDialog(peerId: PeerId) {\n const dialog: Dialog = {\n _: 'dialog',\n pFlags: {},\n peer: this.appPeersManager.getOutputPeer(peerId),\n top_message: 0,\n read_inbox_max_id: 0,\n read_outbox_max_id: 0,\n unread_count: 0,\n unread_mentions_count: 0,\n notify_settings: {\n _: 'peerNotifySettings',\n },\n };\n\n return dialog;\n } */\n\n public setDialogToState(dialog: Dialog | ForumTopic) {\n if(this.isTopic(dialog)) {\n return;\n }\n\n const {peerId, pts} = dialog;\n const historyStorage = this.appMessagesManager.getHistoryStorage(peerId);\n const messagesStorage = this.appMessagesManager.getHistoryMessagesStorage(peerId);\n const history = historyStorage.history.slice;\n let incomingMessage: MyMessage;\n for(let i = 0, length = history.length; i < length; ++i) {\n const mid = history[i];\n const message: MyMessage = this.appMessagesManager.getMessageFromStorage(messagesStorage, mid);\n if(message && !message.pFlags.is_outgoing/* || peerId === SERVICE_PEER_ID */) {\n incomingMessage = message;\n\n const peerIds = getPeerIdsFromMessage(message);\n this.peersStorage.requestPeersForKey(peerIds, `topMessage_${peerId}`);\n\n break;\n }\n }\n\n dialog.topMessage = incomingMessage;\n\n // DO NOT TOUCH THESE LINES, SOME REAL MAGIC HERE.\n // * Read service chat when refreshing page with outgoing & getting new service outgoing message\n /* if(incomingMessage && dialog.read_inbox_max_id >= dialog.top_message) {\n dialog.unread_count = 0;\n }\n\n dialog.read_inbox_max_id = this.appMessagesIdsManager.clearMessageId(dialog.read_inbox_max_id);\n dialog.read_outbox_max_id = this.appMessagesIdsManager.clearMessageId(dialog.read_outbox_max_id); */\n // CAN TOUCH NOW\n\n if(peerId.isAnyChat() && pts) {\n const newPts = this.apiUpdatesManager.getChannelState(peerId.toChatId(), pts).pts;\n dialog.pts = newPts;\n }\n\n this.storage.set({\n [peerId]: dialog\n });\n\n this.peersStorage.requestPeer(peerId, 'dialog');\n\n /* for(let id in this.filtersStorage.filters) {\n const filter = this.filtersStorage.filters[id];\n\n if(this.filtersStorage.testDialogForFilter(dialog, filter)) {\n\n }\n } */\n }\n\n public pushDialog({dialog, offsetDate, ignoreOffsetDate, saveGlobalOffset}: {\n dialog: Dialog | ForumTopic,\n offsetDate?: number,\n ignoreOffsetDate?: boolean,\n saveGlobalOffset?: boolean\n }) {\n const isTopic = this.isTopic(dialog);\n const {folder_id, peerId} = dialog as Dialog;\n\n if(isTopic) {\n const forumTopics = this.getForumTopicsCache(peerId);\n forumTopics.topics.set(dialog.id, dialog);\n } else {\n this.dialogs[peerId] = dialog;\n }\n\n offsetDate ??= this.getDialogOffsetDate(dialog);\n\n // if(!isTopic) {\n this.processDialogForFilters(dialog);\n // }\n\n if(offsetDate && !dialog.pFlags.pinned) {\n if(!isTopic && saveGlobalOffset) {\n const savedGlobalOffsetDate = this.dialogsOffsetDate[GLOBAL_FOLDER_ID];\n if(!savedGlobalOffsetDate || offsetDate < savedGlobalOffsetDate) {\n this.dialogsOffsetDate[GLOBAL_FOLDER_ID] = offsetDate;\n }\n }\n\n const folderId = isTopic ? this.getFilterIdForForum(dialog) : folder_id;\n const savedOffsetDate = this.dialogsOffsetDate[folderId];\n if(!savedOffsetDate || offsetDate < savedOffsetDate) {\n // if(pos !== -1) {\n if(!ignoreOffsetDate && !this.isDialogsLoaded(folderId)) {\n this.dropDialog(peerId, isTopic ? this.getDialogKey(dialog) : undefined, true);\n return;\n }\n\n this.dialogsOffsetDate[folderId] = offsetDate;\n }\n }\n\n this.setDialogToState(dialog);\n\n // if(pos === -1) {\n // this.prepareFolderUnreadCountModifyingByDialog(folder_id, dialog, true);\n // }\n\n // const indexKey = getDialogIndexKey(folder_id);\n // /* const newPos = */insertInDescendSortedArray(dialogs, dialog, (dialog) => getDialogIndex(dialog, indexKey), -1);\n /* if(pos !== -1 && pos !== newPos) {\n rootScope.dispatchEvent('dialog_order', {dialog, pos: newPos});\n } */\n }\n\n public dropDialogFromFolders(peerId: PeerId, topicId?: number) {\n const foundDialog = this.getDialog(peerId, undefined, topicId, false);\n const [dialog, index] = foundDialog;\n if(dialog) {\n const filterId = topicId ?\n this.getFilterIdForForum(dialog as ForumTopic) :\n (dialog as Dialog).folder_id;\n\n // const folder = this.getFolder(filterId);\n // folder.dialogs.splice(index, 1);\n const wasPinned = indexOfAndSplice(this.getPinnedOrders(filterId), this.getDialogKey(dialog)) !== undefined;\n\n this.processDialogForFilters(dialog, true);\n\n this.dialogsIndex.indexObject(peerId, '');\n\n if(wasPinned) {\n this.savePinnedOrders();\n }\n }\n\n return foundDialog;\n }\n\n public dropDialog(peerId: PeerId, topicId?: number, keepLocal?: boolean) {\n const dialog = this.getDialogOrTopic(peerId, topicId);\n const foundDialog = this.dropDialogFromFolders(peerId, topicId);\n if(dialog) {\n if(!keepLocal) {\n if(topicId) {\n this.getForumTopicsCache(peerId).topics.delete(topicId);\n } else {\n delete this.dialogs[peerId];\n }\n }\n\n this.clearDialogFromState(dialog, keepLocal);\n }\n\n return foundDialog;\n }\n\n public clearDialogFromState(dialog: Dialog | ForumTopic, keepLocal: boolean) {\n if(dialog._ === 'forumTopic') {\n return;\n }\n\n const {peerId} = dialog;\n this.peersStorage.requestPeersForKey([], `topMessage_${peerId}`);\n this.peersStorage.releasePeer(peerId, 'dialog');\n this.storage.delete(peerId, keepLocal);\n }\n\n public dropDialogWithEvent(peerId: PeerId, topicId?: number) {\n const dropped = this.dropDialog(peerId, topicId);\n if(dropped.length) {\n this.rootScope.dispatchEvent('dialog_drop', dropped[0]);\n }\n\n return dropped;\n }\n\n /**\n * leaving chat, leaving channel, deleting private dialog\n */\n public dropDialogOnDeletion(peerId: PeerId, topicId?: number) {\n this.dropDialogWithEvent(peerId, topicId);\n this.rootScope.dispatchEvent('peer_deleted', peerId);\n }\n\n public applyDialogs(result: MessagesPeerDialogs | MessagesForumTopics, peerId?: PeerId) {\n // * В эту функцию попадут только те диалоги, в которых есть read_inbox_max_id и read_outbox_max_id, в отличие от тех, что будут в getTopMessages\n\n const isForum = result._ === 'messages.forumTopics';\n const items = (result as MessagesPeerDialogs).dialogs || (result as MessagesForumTopics).topics;\n if(!isForum) {\n // ! fix 'dialogFolder', maybe there is better way to do it, this only can happen by 'messages.getPinnedDialogs' by folder_id: 0\n forEachReverse(result.dialogs, (dialog, idx) => {\n if(dialog._ === 'dialogFolder') {\n result.dialogs.splice(idx, 1);\n }\n });\n } else {\n this.processTopics(peerId, result);\n }\n\n assumeType(items);\n\n this.appUsersManager.saveApiUsers(result.users);\n this.appChatsManager.saveApiChats(result.chats);\n this.appMessagesManager.saveMessages(result.messages);\n\n // this.appMessagesManager.log('applyConversation', dialogsResult);\n\n const updatedDialogs: BroadcastEvents['dialogs_multiupdate'] = new Map();\n const getUpdateCache = (peerId: PeerId) => {\n let cache = updatedDialogs.get(peerId);\n if(!cache) {\n updatedDialogs.set(peerId, cache = {});\n }\n\n return cache;\n };\n\n items.forEach((dialog) => {\n const peerId = this.appPeersManager.getPeerId(dialog.peer);\n let topMid = dialog.top_message;\n\n const topPendingMid = this.appMessagesManager.pendingTopMsgs[peerId];\n if(topPendingMid) {\n const topPendingMessage = this.appMessagesManager.getMessageByPeer(peerId, topPendingMid) as MyMessage;\n const topMessage = this.appMessagesManager.getMessageByPeer(peerId, topMid) as MyMessage;\n if(!topMid || (topPendingMessage && (!topMessage || topPendingMessage?.date > topMessage?.date))) {\n dialog.top_message = topMid = topPendingMid;\n this.appMessagesManager.getHistoryStorage(peerId).maxId = topPendingMid;\n }\n }\n\n /* const d = Object.assign({}, dialog);\n if(peerId === 239602833) {\n this.log.error('applyConversation lun', dialog, d);\n } */\n\n if(topMid || dialog.draft?._ === 'draftMessage') {\n if(this.saveDialog({dialog})) {\n const cache = getUpdateCache(peerId);\n\n if(isForum) {\n (cache.topics ??= new Map()).set(\n (dialog as ForumTopic).id,\n dialog as ForumTopic\n );\n } else {\n cache.dialog = dialog as Dialog;\n }\n }\n } else {\n this.dropDialogWithEvent(peerId, isForum ? this.getDialogKey(dialog) : undefined);\n }\n\n const key = this.appMessagesManager.getUpdateAfterReloadKey(peerId, isForum ? this.getDialogKey(dialog) : undefined);\n const updates = this.appMessagesManager.newUpdatesAfterReloadToHandle[key];\n if(updates !== undefined) {\n for(const update of updates) {\n updates.delete(update);\n this.apiUpdatesManager.saveUpdate(update);\n }\n\n if(!updates.size) {\n delete this.appMessagesManager.newUpdatesAfterReloadToHandle[key];\n }\n }\n });\n\n if(updatedDialogs.size) {\n this.rootScope.dispatchEvent('dialogs_multiupdate', updatedDialogs);\n }\n }\n\n private getDialogOffsetDate(dialog: Dialog | ForumTopic) {\n const message = this.appMessagesManager.getMessageByPeer(dialog.peerId, dialog.top_message);\n return message?.date || 0;\n }\n\n public canSaveDialogByPeerId(peerId: PeerId) {\n if(peerId.isAnyChat()) {\n const chat: Chat = this.appChatsManager.getChat(peerId.toChatId());\n // ! chatForbidden stays for chat where you're kicked\n if(\n chat._ === 'channelForbidden' ||\n // || chat._ === 'chatForbidden'\n (chat as Chat.chat).pFlags.left\n // || (chat as any).pFlags.kicked\n ) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Won't save migrated from peer, forbidden peers, left and kicked\n */\n public saveDialog({\n dialog,\n folderId,\n ignoreOffsetDate,\n saveGlobalOffset\n }: {\n dialog: Dialog | ForumTopic,\n folderId?: REAL_FOLDER_ID,\n ignoreOffsetDate?: boolean,\n saveGlobalOffset?: boolean\n }) {\n const isTopic = this.isTopic(dialog);\n const isDialog = !isTopic;\n\n const topicId = isTopic ? dialog.id = generateMessageId(dialog.id) : undefined;\n if(!isTopic) {\n folderId ??= dialog.folder_id ?? FOLDER_ID_ALL;\n }\n\n const peerId = this.appPeersManager.getPeerId(dialog.peer);\n if(!peerId) {\n console.error('saveConversation no peerId???', dialog, folderId);\n return false;\n }\n\n if(!isTopic && dialog._ !== 'dialog'/* || peerId === 239602833 */) {\n console.error('saveConversation not regular dialog', dialog, Object.assign({}, dialog));\n }\n\n if(isDialog && !this.canSaveDialogByPeerId(peerId)) {\n return false;\n }\n\n const channelId = this.appPeersManager.isChannel(peerId) ? peerId.toChatId() : NULL_PEER_ID;\n\n if(isDialog) {\n const peerText = this.appPeersManager.getPeerSearchText(peerId);\n this.dialogsIndex.indexObject(peerId, peerText);\n }\n\n const wasDialogBefore = this.getDialogOrTopic(peerId, topicId);\n\n let mid: number, message: MyMessage;\n if(dialog.top_message) {\n mid = generateMessageId(dialog.top_message);// dialog.top_message;\n\n // preserve outgoing message\n const wasTopMessage = wasDialogBefore?.top_message && this.appMessagesManager.getMessageByPeer(peerId, wasDialogBefore.top_message) as MyMessage;\n if(wasTopMessage?.pFlags?.is_outgoing && wasDialogBefore.top_message >= mid) {\n mid = wasDialogBefore.top_message;\n }\n\n message = this.appMessagesManager.getMessageByPeer(peerId, mid);\n } else {\n mid = this.appMessagesManager.generateTempMessageId(peerId);\n message = {\n _: 'message',\n id: mid,\n mid,\n from_id: this.appPeersManager.getOutputPeer(this.appUsersManager.getSelf().id.toPeerId(false)),\n peer_id: this.appPeersManager.getOutputPeer(peerId),\n deleted: true,\n pFlags: {out: true},\n date: 0,\n message: ''\n };\n this.appMessagesManager.saveMessages([message], {isOutgoing: true});\n }\n\n if(!message?.pFlags) {\n this.appMessagesManager.log.error('saveConversation no message:', dialog, message);\n }\n\n if(isDialog && !channelId && peerId.isAnyChat()) {\n const chat = this.appChatsManager.getChat(peerId.toChatId()) as Chat.chat;\n if(chat && chat.migrated_to && chat.pFlags.deactivated) {\n const migratedToPeer = this.appPeersManager.getPeerId(chat.migrated_to);\n this.appMessagesManager.migratedFromTo[peerId] = migratedToPeer;\n this.appMessagesManager.migratedToFrom[migratedToPeer] = peerId;\n dialog.migratedTo = migratedToPeer;\n // return;\n }\n }\n\n dialog.top_message = mid;\n // dialog.unread_count = wasDialogBefore && dialog.read_inbox_max_id === getServerMessageId(wasDialogBefore.read_inbox_max_id) ? wasDialogBefore.unread_count : dialog.unread_count;\n dialog.read_inbox_max_id = generateMessageId(wasDialogBefore && !dialog.read_inbox_max_id ? wasDialogBefore.read_inbox_max_id : dialog.read_inbox_max_id);\n dialog.read_outbox_max_id = generateMessageId(wasDialogBefore && !dialog.read_outbox_max_id ? wasDialogBefore.read_outbox_max_id : dialog.read_outbox_max_id);\n\n if(isDialog && dialog.folder_id === undefined) {\n if(dialog._ === 'dialog') {\n // ! СЛОЖНО ! СМОТРИ В getTopMessages\n dialog.folder_id = wasDialogBefore ? (wasDialogBefore as typeof dialog).folder_id : folderId;\n }/* else if(dialog._ === 'dialogFolder') {\n dialog.folder_id = dialog.folder.id;\n } */\n }\n\n dialog.draft = this.appDraftsManager.saveDraft({peerId, threadId: topicId, draft: dialog.draft});\n dialog.peerId = peerId;\n // dialog.indexes ??= {} as any;\n\n // Because we saved message without dialog present\n if(message && message.pFlags.is_outgoing) {\n const isOut = message.pFlags.out;\n if(mid > dialog[isOut ? 'read_outbox_max_id' : 'read_inbox_max_id']) {\n message.pFlags.unread = true;\n\n if(!dialog.unread_count && !isOut) {\n ++dialog.unread_count;\n }\n } else {\n delete message.pFlags.unread;\n }\n }\n\n const historyStorage = this.appMessagesManager.getHistoryStorage(peerId, topicId);\n const slice = historyStorage.history.slice;\n /* if(historyStorage === undefined) { // warning\n historyStorage.history.push(mid);\n } else */if(!slice.length) {\n historyStorage.history.unshift(mid);\n historyStorage.count ||= 1;\n if(this.appMessagesManager.mergeReplyKeyboard(historyStorage, message)) {\n this.rootScope.dispatchEvent('history_reply_markup', {peerId});\n }\n } else if(!slice.isEnd(SliceEnd.Bottom)) { // * this will probably never happen, however, if it does, then it will fix slice with top_message\n const slice = historyStorage.history.insertSlice([mid]);\n slice.setEnd(SliceEnd.Bottom);\n historyStorage.count ||= 1;\n if(this.appMessagesManager.mergeReplyKeyboard(historyStorage, message)) {\n this.rootScope.dispatchEvent('history_reply_markup', {peerId});\n }\n }\n\n historyStorage.maxId = mid;\n historyStorage.readMaxId = dialog.read_inbox_max_id;\n historyStorage.readOutboxMaxId = dialog.read_outbox_max_id;\n\n this.appNotificationsManager.savePeerSettings({\n peerId,\n threadId: isTopic ? dialog.id : undefined,\n settings: dialog.notify_settings\n });\n\n if(isDialog && channelId && dialog.pts) {\n this.apiUpdatesManager.addChannelState(channelId, dialog.pts);\n }\n\n this.generateIndexForDialog(dialog);\n\n if(wasDialogBefore) {\n // fix unread count\n const releaseUnreadCount = this.dialogsStorage.prepareDialogUnreadCountModifying(wasDialogBefore);\n safeReplaceObject(wasDialogBefore, dialog);\n releaseUnreadCount();\n }\n\n this.pushDialog({\n dialog,\n offsetDate: message?.date,\n ignoreOffsetDate,\n saveGlobalOffset\n });\n\n if(isTopic) {\n this.processTopicUpdate(dialog, wasDialogBefore as ForumTopic);\n }\n\n return true;\n }\n\n public processTopicUpdate(topic: ForumTopic, oldTopic?: ForumTopic) {\n if(!oldTopic) {\n return;\n }\n\n const {peerId, id: threadId} = topic;\n const isIconChanged = topic.icon_emoji_id !== (oldTopic as ForumTopic).icon_emoji_id;\n const isTitleChanged = topic.title !== (oldTopic as ForumTopic).title;\n const isChanged = isIconChanged || isTitleChanged;\n\n if(isIconChanged) {\n this.rootScope.dispatchEvent('avatar_update', {peerId, threadId});\n }\n\n if(isChanged) {\n this.rootScope.dispatchEvent('peer_title_edit', {peerId, threadId});\n }\n }\n\n public getDialogs(options: {\n query?: string,\n offsetIndex?: number,\n limit?: number,\n filterId?: number,\n skipMigrated?: boolean\n }): MaybePromise<{\n dialogs: Folder['dialogs'],\n count: number,\n isTopEnd: boolean,\n isEnd: boolean\n }> {\n const {\n query = '',\n offsetIndex,\n limit = 20,\n filterId = FOLDER_ID_ALL,\n skipMigrated = false\n } = options;\n\n const isForum = this.isFilterIdForForum(filterId);\n if(!isForum && !REAL_FOLDERS.has(filterId)) {\n const promises: Promise[] = [];\n\n const fillContactsResult = this.appUsersManager.fillContacts();\n if(!fillContactsResult.cached) {\n promises.push(fillContactsResult.promise);\n }\n\n const reloadMissingDialogsPromise = this.filtersStorage.reloadMissingPeerIds(filterId);\n if(reloadMissingDialogsPromise) {\n promises.push(reloadMissingDialogsPromise);\n }\n\n if(promises.length) {\n return Promise.all(promises).then(() => {\n return this.getDialogs(options);\n });\n }\n }\n\n // let's load only first pages by certain folderId. next pages will load without folder filtering\n const realFolderId/* : REAL_FOLDER_ID */ =\n (!REAL_FOLDERS.has(filterId) || this.getOffsetDate(filterId)) && !isForum ?\n GLOBAL_FOLDER_ID :\n filterId/* as REAL_FOLDER_ID */;\n let curDialogStorage = this.getFolderDialogs(filterId, skipMigrated);\n\n const indexKey = this.getDialogIndexKeyByFilterId(filterId);\n\n if(query && !isForum) {\n if(!limit || this.cachedResults.query !== query || this.cachedResults.folderId !== filterId) {\n this.cachedResults.query = query;\n this.cachedResults.folderId = filterId;\n\n const results = this.dialogsIndex.search(query);\n\n const dialogs: Dialog[] = [];\n for(const peerId in this.dialogs) {\n const dialog = this.dialogs[peerId];\n if(results.has(dialog.peerId) && dialog.folder_id === filterId) {\n dialogs.push(dialog);\n }\n }\n\n dialogs.sort((d1, d2) => this.getDialogIndex(d2, indexKey) - this.getDialogIndex(d1, indexKey));\n this.cachedResults.dialogs = dialogs;\n this.cachedResults.count = dialogs.length;\n }\n\n curDialogStorage = this.cachedResults.dialogs;\n } else {\n this.cachedResults.query = '';\n }\n\n let offset = 0;\n if(offsetIndex > 0) {\n for(let length = curDialogStorage.length; offset < length; ++offset) {\n if(offsetIndex > this.getDialogIndex(curDialogStorage[offset], indexKey)) {\n break;\n }\n }\n }\n\n const loadedAll = this.isDialogsLoaded(realFolderId);\n const isEnoughDialogs = curDialogStorage.length >= (offset + limit);\n if(query || loadedAll || isEnoughDialogs) {\n const dialogs = curDialogStorage.slice(offset, offset + limit);\n return {\n dialogs,\n count: loadedAll ? curDialogStorage.length : null,\n isTopEnd: curDialogStorage.length && ((dialogs[0] && dialogs[0] === curDialogStorage[0]) || this.getDialogIndex(curDialogStorage[0], indexKey) < offsetIndex),\n isEnd: (query || loadedAll) && (offset + limit) >= curDialogStorage.length\n };\n }\n\n return this.appMessagesManager.getTopMessages({limit, folderId: realFolderId}).then((result) => {\n // const curDialogStorage = this[folderId];\n if(skipMigrated) {\n curDialogStorage = this.getFolderDialogs(filterId, skipMigrated);\n }\n\n offset = 0;\n if(offsetIndex > 0) {\n for(let length = curDialogStorage.length; offset < length; ++offset) {\n if(offsetIndex > this.getDialogIndex(curDialogStorage[offset], indexKey)) {\n break;\n }\n }\n }\n\n // this.log.warn(offset, offset + limit, curDialogStorage.dialogs.length, this.dialogs.length);\n\n const dialogs = curDialogStorage.slice(offset, offset + limit);\n return {\n dialogs,\n count: result.count === undefined ? curDialogStorage.length : result.count,\n isTopEnd: curDialogStorage.length && ((dialogs[0] && dialogs[0] === curDialogStorage[0]) || this.getDialogIndex(curDialogStorage[0], indexKey) < offsetIndex),\n // isEnd: this.isDialogsLoaded(realFolderId) && (offset + limit) >= curDialogStorage.length\n isEnd: result.isEnd\n };\n });\n }\n\n // * FORUMS SECTION\n\n public flushForumTopicsCache(peerId: PeerId) {\n const cache = this.forumTopics.get(peerId);\n if(!cache) {\n return;\n }\n\n const folder = this.folders[peerId];\n if(folder) {\n if(folder.dispatchUnreadTimeout) {\n clearTimeout(folder.dispatchUnreadTimeout);\n }\n\n delete this.allDialogsLoaded[peerId];\n delete this.pinnedOrders[peerId];\n delete this.dialogsOffsetDate[peerId];\n delete this.folders[peerId];\n }\n\n cache.topics.clear();\n\n // for permanent delete\n // this.forumTopics.delete(peerId);\n }\n\n public getForumTopicsCache(peerId: PeerId) {\n let forumTopics = this.forumTopics.get(peerId);\n if(!forumTopics) {\n forumTopics = {\n topics: new Map(),\n deletedTopics: new Set(),\n getTopicPromises: new Map()\n };\n\n this.forumTopics.set(peerId, forumTopics);\n }\n\n return forumTopics;\n }\n\n public getForumTopicById(peerId: PeerId, topicId?: number): Promise {\n if(!this.appPeersManager.isForum(peerId)) {\n return Promise.reject(makeError('CHANNEL_FORUM_MISSING'));\n }\n\n const cache = this.getForumTopicsCache(peerId);\n let promise: CancellablePromise;\n if(topicId) {\n promise = cache.getTopicPromises.get(topicId);\n if(promise) {\n return promise;\n }\n\n if(cache.deletedTopics.has(topicId)) {\n return Promise.resolve(undefined);\n }\n\n cache.getTopicPromises.set(topicId, promise = deferredPromise());\n }\n\n cache.getTopicsPromise ??= pause(0).then(() => {\n const promises: {[topicId: number]: typeof promise} = {};\n const ids: number[] = [];\n for(const [topicId, promise] of cache.getTopicPromises) {\n promises[topicId] = promise;\n ids.push(getServerMessageId(topicId));\n }\n\n cache.getTopicPromises.clear();\n\n const fullfillLeft = () => {\n for(const topicId in promises) {\n promises[topicId].resolve(undefined);\n cache.deletedTopics.add(+topicId);\n }\n };\n\n if(this.getForumTopicsCache(peerId) !== cache) {\n fullfillLeft();\n return;\n }\n\n return this.apiManager.invokeApi('channels.getForumTopicsByID', {\n channel: this.appChatsManager.getChannelInput(peerId.toChatId()),\n topics: ids\n }).then((messagesForumTopics) => {\n if(this.getForumTopicsCache(peerId) !== cache) {\n return;\n }\n\n this.applyDialogs(messagesForumTopics, peerId);\n\n messagesForumTopics.topics.forEach((forumTopic) => {\n if(forumTopic._ === 'forumTopic') {\n promises[forumTopic.id].resolve(forumTopic);\n delete promises[peerId];\n }\n });\n\n return messagesForumTopics;\n }, () => {}).then(() => {\n fullfillLeft();\n\n cache.getTopicsPromise = undefined;\n if(cache.getTopicPromises.size) {\n this.getForumTopicById(peerId);\n }\n });\n });\n\n return promise || cache.getTopicsPromise;\n }\n\n // public getForumTopicById(peerId: PeerId, topicId: number) {\n // return this.getForumTopicsByID(peerId, topicId).then((result) => result.topics[0]);\n // }\n\n public getForumTopic(peerId: PeerId, topicId: number) {\n const forumTopics = this.forumTopics.get(peerId);\n return forumTopics?.topics?.get(topicId);\n }\n\n public getForumTopicOrReload(peerId: PeerId, topicId: number) {\n const forumTopic = this.getForumTopic(peerId, topicId);\n if(forumTopic) {\n return forumTopic;\n }\n\n const cache = this.getForumTopicsCache(peerId);\n return cache?.deletedTopics?.has(topicId) ? undefined : this.getForumTopicById(peerId, topicId);\n }\n\n public processTopics>(peerId: PeerId, result: T) {\n return callbackify(result, (result) => {\n if('pts' in result) {\n this.apiUpdatesManager.addChannelState(peerId.toChatId(), result.pts);\n }\n\n const peer = this.appPeersManager.getOutputPeer(peerId);\n result.topics = result.topics.map((topic) => {\n if(topic._ === 'forumTopicDeleted') {\n return;\n }\n\n (topic as ForumTopic).peer = peer;\n topic.id = generateMessageId(topic.id);\n return topic;\n }).filter(Boolean);\n\n return result;\n });\n }\n\n public processTopicsPromise[1]>>(peerId: PeerId, promise: T): T {\n return promise.then((result) => {\n this.processTopics(peerId, result);\n return result;\n }) as any;\n }\n\n public getForumUnreadCount(peerId: PeerId) {\n if(!this.appPeersManager.isForum(peerId)) {\n return;\n }\n\n const folder = this.getFolder(peerId);\n\n const f = folder.dialogs.length >= 20 || this.isDialogsLoaded(peerId) ?\n folder.dialogs.slice(0, 20) :\n callbackify(this.getDialogs({filterId: peerId, limit: 20}), (result) => {\n return result.dialogs;\n });\n\n return callbackify(f, (dialogs) => {\n return {\n count: dialogs.reduce((acc, v) => acc + +!!v.unread_count, 0),\n hasUnmuted: dialogs.some((dialog) => dialog.unread_count && this.isDialogUnmuted(dialog))\n };\n });\n }\n\n // * FORUMS SECTION END\n\n private handleDialogTogglePinned(dialog: Dialog | ForumTopic, pinned: boolean, folderId: number) {\n if(dialog) {\n if(!pinned) {\n this.handleDialogUnpinning(dialog, folderId);\n } else { // means set\n dialog.pFlags.pinned = true;\n }\n\n this.generateIndexForDialog(dialog);\n }\n\n this.appMessagesManager.scheduleHandleNewDialogs(dialog.peerId, dialog);\n }\n\n private handleDialogsPinned(folderId: number, order: (Dialog['peerId'] | ForumTopic['id'])[]) {\n const isForum = this.isFilterIdForForum(folderId);\n this.resetPinnedOrder(folderId);\n this.getPinnedOrders(folderId).push(...order);\n this.savePinnedOrders();\n order.reverse(); // index must be higher\n const newPinned: {[id: typeof order[0]]: true} = {};\n order.forEach((id) => {\n newPinned[id] = true;\n\n const peerId = isForum ? folderId : id;\n const topicId = isForum ? id : undefined;\n\n const dialog = this.getDialogOrTopic(peerId, topicId);\n this.appMessagesManager.scheduleHandleNewDialogs(peerId, dialog);\n if(!dialog) {\n return;\n }\n\n dialog.pFlags.pinned = true;\n this.generateIndexForDialog(dialog);\n });\n\n const dialogs = this.getFolderDialogs(folderId, false);\n for(const dialog of dialogs) {\n if(!dialog.pFlags.pinned) {\n break;\n }\n\n if(!newPinned[this.getDialogKey(dialog)]) {\n delete dialog.pFlags.pinned;\n this.generateIndexForDialog(dialog);\n this.appMessagesManager.scheduleHandleNewDialogs(dialog.peerId, dialog);\n }\n }\n }\n\n // only 0 and 1 folders\n private onUpdateFolderPeers = (update: Update.updateFolderPeers) => {\n // this.log('updateFolderPeers', update);\n const peers = update.folder_peers;\n\n peers.forEach((folderPeer) => {\n const {folder_id, peer} = folderPeer;\n\n const peerId = this.appPeersManager.getPeerId(peer);\n const dialog = this.dropDialog(peerId)[0];\n if(dialog) {\n if(dialog.pFlags?.pinned) {\n this.handleDialogUnpinning(dialog, folder_id);\n }\n\n (dialog as Dialog).folder_id = folder_id as REAL_FOLDER_ID;\n this.generateIndexForDialog(dialog);\n this.pushDialog({dialog}); // need for simultaneously updatePinnedDialogs\n }\n\n this.appMessagesManager.scheduleHandleNewDialogs(peerId, dialog);\n });\n };\n\n private onUpdateDialogPinned = (update: Update.updateDialogPinned) => {\n const folderId = update.folder_id ?? FOLDER_ID_ALL;\n // this.log('updateDialogPinned', update);\n const peerId = this.appPeersManager.getPeerId((update.peer as DialogPeer.dialogPeer).peer);\n const dialog = this.getDialogOnly(peerId);\n\n // этот код внизу никогда не сработает, в папках за пиннед отвечает updateDialogFilter\n /* if(update.folder_id > 1) {\n const filter = this.filtersStorage.filters[update.folder_id];\n if(update.pFlags.pinned) {\n filter.pinned_peers.unshift(peerId);\n } else {\n filter.pinned_peers.findAndSplice((p) => p === peerId);\n }\n } */\n\n this.handleDialogTogglePinned(dialog, update.pFlags.pinned, folderId);\n };\n\n private onUpdateChannelPinnedTopic = (update: Update.updateChannelPinnedTopic) => {\n const peerId = update.channel_id.toPeerId(true);\n const topicId = generateMessageId(update.topic_id);\n const topic = this.getForumTopic(peerId, topicId);\n if(!topic) {\n return;\n }\n\n this.handleDialogTogglePinned(topic, update.pFlags.pinned, this.getFilterIdForForum(topic));\n };\n\n private onUpdatePinnedDialogs = (update: Update.updatePinnedDialogs) => {\n const folderId = update.folder_id ?? FOLDER_ID_ALL;\n\n if(update.order) {\n this.handleDialogsPinned(folderId, update.order.map((peer) => this.appPeersManager.getPeerId((peer as DialogPeer.dialogPeer).peer)));\n } else {\n this.apiManager.invokeApi('messages.getPinnedDialogs', {\n folder_id: folderId\n }).then((dialogsResult) => {\n // * for test reordering and rendering\n // dialogsResult.dialogs.reverse();\n\n this.applyDialogs(dialogsResult);\n\n this.handleDialogsPinned(folderId, dialogsResult.dialogs.map((d) => d.peerId));\n });\n }\n };\n\n private onUpdateChannelPinnedTopics = async(update: Update.updateChannelPinnedTopics) => {\n const peerId = update.channel_id.toPeerId(true);\n const forumTopics = this.forumTopics.get(peerId);\n if(!forumTopics) {\n return;\n }\n\n const filterId = peerId;\n if(update.order) {\n const order = update.order.map((topicId) => generateMessageId(topicId));\n this.handleDialogsPinned(filterId, order);\n } else {\n const limit = await this.apiManager.getLimit('topicPin', true);\n\n const promise = this.apiManager.invokeApi('channels.getForumTopics', {\n channel: this.appChatsManager.getChannelInput(peerId.toChatId()),\n limit,\n offset_date: 0,\n offset_id: 0,\n offset_topic: 0\n });\n\n const result = await this.processTopics(peerId, promise);\n\n const topics = result.topics as ForumTopic[];\n const pinned = topics.filter((topic) => topic.pFlags.pinned);\n this.handleDialogsPinned(filterId, pinned.map((topic) => topic.id));\n }\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {DialogFilter, ForumTopic, Update} from '../../layer';\nimport type {Dialog} from '../appManagers/appMessagesManager';\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport copy from '../../helpers/object/copy';\nimport {AppManager} from '../appManagers/manager';\nimport findAndSplice from '../../helpers/array/findAndSplice';\nimport assumeType from '../../helpers/assumeType';\nimport {FOLDER_ID_ALL, FOLDER_ID_ARCHIVE, REAL_FOLDERS, REAL_FOLDER_ID, START_LOCAL_ID} from '../mtproto/mtproto_config';\nimport makeError from '../../helpers/makeError';\n\nexport type MyDialogFilter = DialogFilter.dialogFilter;\n\nconst convertment = [\n ['pinned_peers', 'pinnedPeerIds'],\n ['exclude_peers', 'excludePeerIds'],\n ['include_peers', 'includePeerIds']\n] as ['pinned_peers' | 'exclude_peers' | 'include_peers', 'pinnedPeerIds' | 'excludePeerIds' | 'includePeerIds'][];\n\nconst PREPENDED_FILTERS = REAL_FOLDERS.size;\n\nconst LOCAL_FILTER: MyDialogFilter = {\n _: 'dialogFilter',\n pFlags: {},\n flags: 0,\n id: 0,\n title: '',\n exclude_peers: [],\n include_peers: [],\n pinned_peers: [],\n excludePeerIds: [],\n includePeerIds: [],\n pinnedPeerIds: []\n};\n\nexport default class FiltersStorage extends AppManager {\n private filters: {[filterId: string]: MyDialogFilter};\n private filtersArr: Array;\n private localFilters: {[filterId: string]: MyDialogFilter};\n private localId: number;\n private reloadedPeerIds: Set;\n\n protected after() {\n this.clear(true);\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateDialogFilter: this.onUpdateDialogFilter,\n\n updateDialogFilters: this.onUpdateDialogFilters,\n\n updateDialogFilterOrder: this.onUpdateDialogFilterOrder\n });\n\n // delete peers when dialog is being dropped\n /* rootScope.addEventListener('peer_deleted', (peerId) => {\n for(const filterId in this.filters) {\n const filter = this.filters[filterId];\n let modified = false;\n [filter.pinned_peers, filter.include_peers, filter.exclude_peers].forEach((arr) => {\n forEachReverse(arr, (inputPeer, idx) => {\n if(getPeerId(inputPeer) === peerId) {\n arr.splice(idx, 1);\n modified = true;\n }\n });\n });\n\n if(modified) {\n this.saveDialogFilter(filter, true);\n }\n }\n }); */\n\n this.rootScope.addEventListener('premium_toggle', () => {\n this.onUpdateDialogFilters({_: 'updateDialogFilters'});\n });\n\n return this.appStateManager.getState().then((state) => {\n const filtersArr = this.prependFilters(state.filtersArr);\n filtersArr.map((filter) => {\n this.saveDialogFilter(filter, false, true);\n });\n });\n }\n\n /**\n * ! use it only with saving\n */\n private prependFilters(filters: DialogFilter[]) {\n filters = filters.slice();\n\n const allChatsFilter = this.localFilters[FOLDER_ID_ALL];\n const archiveFilter = this.localFilters[FOLDER_ID_ARCHIVE];\n\n const allChatsFilterIndex = filters.findIndex((filter) => filter._ === 'dialogFilterDefault' || filter.id === FOLDER_ID_ALL);\n if(allChatsFilterIndex !== -1) filters[allChatsFilterIndex] = allChatsFilter;\n else filters.unshift(allChatsFilter);\n\n findAndSplice(filters, (filter) => (filter as MyDialogFilter).id === FOLDER_ID_ARCHIVE);\n filters.splice(/* 1 */filters[0] === allChatsFilter ? 1 : 0, 0, archiveFilter);\n\n this.localId = START_LOCAL_ID;\n filters.forEach((filter) => {\n delete filter.localId;\n });\n\n return filters;\n }\n\n private generateLocalFilter(id: REAL_FOLDER_ID) {\n const filter: MyDialogFilter = {...copy(LOCAL_FILTER), id};\n if(id === FOLDER_ID_ALL) {\n filter.pFlags.exclude_archived = true;\n } else if(id === FOLDER_ID_ARCHIVE) {\n filter.pFlags.exclude_unarchived = true;\n }\n\n if(REAL_FOLDERS.has(id)) {\n filter.pinnedPeerIds = this.dialogsStorage.getPinnedOrders(id);\n }\n\n return filter;\n }\n\n // private getLocalFilter(id: number) {\n // return this.filters[id] ??= this.generateLocalFilter(id);\n // }\n\n public clear = (init?: boolean) => {\n if(!init) {\n // safeReplaceObject(this.filters, {});\n this.reloadedPeerIds.clear();\n this.clearFilters();\n } else {\n this.filters = {};\n this.filtersArr = [];\n this.reloadedPeerIds = new Set();\n\n this.localFilters = {};\n for(const filterId of REAL_FOLDERS) {\n this.localFilters[filterId] = this.generateLocalFilter(filterId as REAL_FOLDER_ID);\n }\n }\n\n this.localId = START_LOCAL_ID;\n };\n\n private onUpdateDialogFilter = (update: Update.updateDialogFilter) => {\n if(update.filter) {\n this.saveDialogFilter(update.filter as any);\n } else if(this.filters[update.id]) { // Папка удалена\n // this.getDialogFilters(true);\n this.rootScope.dispatchEvent('filter_delete', this.filters[update.id]);\n delete this.filters[update.id];\n findAndSplice(this.filtersArr, (filter) => (filter as DialogFilter.dialogFilter).id === update.id);\n }\n\n this.pushToState();\n };\n\n private onUpdateDialogFilters = (update: Update.updateDialogFilters) => {\n // console.warn('updateDialogFilters', update);\n\n const oldFilters = copy(this.filters);\n\n this.getDialogFilters(true).then((filters) => {\n for(const _filterId in oldFilters) {\n const filterId = +_filterId;\n if(!filters.find((filter) => filter.id === filterId)) { // * deleted\n this.onUpdateDialogFilter({_: 'updateDialogFilter', id: filterId});\n }\n }\n\n this.onUpdateDialogFilterOrder({_: 'updateDialogFilterOrder', order: filters.map((filter) => filter.id)});\n });\n };\n\n private onUpdateDialogFilterOrder = (update: Update.updateDialogFilterOrder) => {\n // console.log('updateDialogFilterOrder', update);\n\n const order = update.order.slice();\n if(!order.includes(FOLDER_ID_ARCHIVE)) {\n order.splice(order[0] === FOLDER_ID_ALL ? 1 : 0, 0, FOLDER_ID_ARCHIVE);\n }\n\n this.localId = START_LOCAL_ID;\n order.forEach((filterId) => {\n const filter = this.filters[filterId];\n delete filter.localId;\n this.setLocalId(filter);\n });\n\n this.rootScope.dispatchEvent('filter_order', order);\n\n this.pushToState();\n };\n\n private pushToState() {\n this.appStateManager.pushToState('filtersArr', this.filtersArr);\n }\n\n public testDialogForFilter(dialog: Dialog | ForumTopic.forumTopic, filter?: MyDialogFilter) {\n if(!filter) {\n return true;\n }\n\n if(REAL_FOLDERS.has(filter.id)) {\n return (dialog as Dialog).folder_id === filter.id && this.dialogsStorage.canSaveDialogByPeerId(dialog.peerId);\n }\n\n const peerId = dialog.peerId;\n\n // * check whether dialog exists\n if(!this.appMessagesManager.getDialogOnly(peerId)) {\n return false;\n }\n\n // exclude_peers\n if(filter.excludePeerIds.includes(peerId)) {\n return false;\n }\n\n // include_peers\n if(filter.includePeerIds.includes(peerId)) {\n return true;\n }\n\n const pFlags = filter.pFlags;\n\n // exclude_archived\n if(pFlags.exclude_archived && (dialog as Dialog).folder_id === FOLDER_ID_ARCHIVE) {\n return false;\n }\n\n // exclude_read\n if(pFlags.exclude_read && !this.appMessagesManager.isDialogUnread(dialog)) {\n return false;\n }\n\n // exclude_muted\n if(pFlags.exclude_muted && this.appNotificationsManager.isPeerLocalMuted({peerId}) && !(dialog.unread_mentions_count && dialog.unread_count)) {\n return false;\n }\n\n if(this.appPeersManager.isAnyChat(peerId)) {\n // broadcasts\n if(pFlags.broadcasts && this.appPeersManager.isBroadcast(peerId)) {\n return true;\n }\n\n // groups\n if(pFlags.groups && this.appPeersManager.isAnyGroup(peerId)) {\n return true;\n }\n } else {\n const userId = peerId.toUserId();\n\n // bots\n if(this.appUsersManager.isBot(userId)) {\n return !!pFlags.bots;\n }\n\n // non_contacts\n if(pFlags.non_contacts && !this.appUsersManager.isContact(userId)) {\n return true;\n }\n\n // contacts\n if(pFlags.contacts && this.appUsersManager.isContact(userId)) {\n return true;\n }\n }\n\n return false;\n }\n\n public testDialogForFilterId(dialog: Dialog, filterId: number) {\n return this.testDialogForFilter(dialog, this.filters[filterId]);\n }\n\n public getFilter(filterId: number) {\n return this.filters[filterId];\n }\n\n public getFilters() {\n return this.filters;\n }\n\n public clearFilters() {\n const filters = this.getFilters();\n for(const filterId in filters) { // delete filters\n if(REAL_FOLDERS.has(+filterId)) {\n continue;\n }\n\n this.onUpdateDialogFilter({\n _: 'updateDialogFilter',\n id: +filterId\n });\n }\n }\n\n public async toggleDialogPin(peerId: PeerId, filterId: number) {\n const filter = this.filters[filterId];\n\n const index = filter.pinnedPeerIds.indexOf(peerId);\n const wasPinned = index !== -1;\n\n if(wasPinned) {\n filter.pinned_peers.splice(index, 1);\n filter.pinnedPeerIds.splice(index, 1);\n }\n\n if(!wasPinned) {\n if(filter.pinned_peers.length >= (await this.apiManager.getConfig()).pinned_infolder_count_max) {\n return Promise.reject(makeError('PINNED_DIALOGS_TOO_MUCH'));\n }\n\n filter.pinned_peers.unshift(this.appPeersManager.getInputPeerById(peerId));\n filter.pinnedPeerIds.unshift(peerId);\n }\n\n return this.updateDialogFilter(filter);\n }\n\n public createDialogFilter(filter: MyDialogFilter, prepend?: boolean) {\n const maxId = Math.max(1, ...Object.keys(this.filters).map((i) => +i));\n filter = copy(filter);\n filter.id = maxId + 1;\n return this.updateDialogFilter(filter, undefined, prepend);\n }\n\n public updateDialogFilter(filter: MyDialogFilter, remove = false, prepend = false) {\n const flags = remove ? 0 : 1;\n\n return this.apiManager.invokeApi('messages.updateDialogFilter', {\n flags,\n id: filter.id,\n filter: remove ? undefined : this.getOutputDialogFilter(filter)\n }).then((bool) => { // возможно нужна проверка и откат, если результат не ТРУ\n // console.log('updateDialogFilter bool:', bool);\n\n /* if(!this.filters[filter.id]) {\n this.saveDialogFilter(filter);\n }\n\n rootScope.$broadcast('filter_update', filter); */\n\n this.onUpdateDialogFilter({\n _: 'updateDialogFilter',\n id: filter.id,\n filter: remove ? undefined : filter as any\n });\n\n if(prepend) {\n const f: MyDialogFilter[] = [];\n for(const filterId in this.filters) {\n const filter = this.filters[filterId];\n ++filter.localId;\n f.push(filter);\n }\n\n filter.localId = START_LOCAL_ID;\n\n const order = f.sort((a, b) => a.localId - b.localId).map((filter) => filter.id);\n this.onUpdateDialogFilterOrder({\n _: 'updateDialogFilterOrder',\n order\n });\n }\n });\n }\n\n public updateDialogFiltersOrder(order: number[]) {\n return this.apiManager.invokeApi('messages.updateDialogFiltersOrder', {\n order\n }).then(() => {\n this.onUpdateDialogFilterOrder({\n _: 'updateDialogFilterOrder',\n order\n });\n });\n }\n\n public getOutputDialogFilter(filter: MyDialogFilter) {\n const c = copy(filter);\n /* convertment.forEach(([from, to]) => {\n c[from] = c[to].map((peerId) => this.appPeersManager.getInputPeerById(peerId));\n }); */\n\n this.filterIncludedPinnedPeers(filter);\n\n return c;\n }\n\n private filterIncludedPinnedPeers(filter: MyDialogFilter) {\n forEachReverse(filter.includePeerIds, (peerId, idx) => {\n if(filter.pinnedPeerIds.includes(peerId)) {\n filter.include_peers.splice(idx, 1);\n filter.includePeerIds.splice(idx, 1);\n }\n });\n }\n\n // private spliceMissingPeerIds(filterId: number, type: ArgumentTypes[1], missingPeerIds: PeerId[]) {\n // const filter = this.getFilter(filterId);\n // const peers = filter && filter[type];\n // if(!peers?.length) {\n // return;\n // }\n\n // let spliced = false;\n // missingPeerIds.forEach((peerId) => {\n // const inputPeer = findAndSplice(peers, (inputPeer) => getPeerId(inputPeer) === peerId);\n // if(inputPeer) {\n // spliced = true;\n // }\n // });\n\n // if(spliced) {\n // this.onUpdateDialogFilter({\n // _: 'updateDialogFilter',\n // id: filterId,\n // filter\n // });\n // }\n // }\n\n public reloadMissingPeerIds(\n filterId: number,\n type: 'pinned_peers' | 'include_peers' | 'exclude_peers' = 'pinned_peers'\n ) {\n const filter = this.getFilter(filterId);\n const peers = filter?.[type];\n if(!peers?.length) {\n return;\n }\n\n // const missingPeerIds: PeerId[] = [];\n const reloadDialogs = peers.filter((inputPeer) => {\n const peerId = this.appPeersManager.getPeerId(inputPeer);\n const isAlreadyReloaded = this.reloadedPeerIds.has(peerId);\n const dialog = this.appMessagesManager.getDialogOnly(peerId);\n // if(isAlreadyReloaded && !dialog) {\n // missingPeerIds.push(peerId);\n // }\n\n const reload = !isAlreadyReloaded && !dialog;\n return reload;\n });\n\n if(!reloadDialogs.length) {\n // if(missingPeerIds.length) {\n // this.spliceMissingPeerIds(filterId, type, missingPeerIds);\n // }\n\n return;\n }\n\n const reloadPromises = reloadDialogs.map((inputPeer) => {\n const peerId = this.appPeersManager.getPeerId(inputPeer);\n const promise = this.appMessagesManager.reloadConversation(inputPeer)\n .then((dialog) => {\n this.reloadedPeerIds.add(peerId);\n\n return dialog ? undefined : peerId;\n });\n\n return promise;\n });\n\n const reloadPromise = Promise.all(reloadPromises).then((missingPeerIds) => {\n missingPeerIds = missingPeerIds.filter(Boolean);\n if(!missingPeerIds.length) {\n return;\n }\n\n // this.spliceMissingPeerIds(filterId, type, missingPeerIds);\n });\n\n return reloadPromise;\n }\n\n public async getDialogFilters(overwrite = false): Promise {\n const keys = Object.keys(this.filters);\n if(keys.length > PREPENDED_FILTERS && !overwrite) {\n return keys.map((filterId) => this.filters[filterId]).sort((a, b) => a.localId - b.localId);\n }\n\n const filters = await this.apiManager.invokeApiSingle('messages.getDialogFilters');\n const prepended = this.prependFilters(filters);\n return prepended.map((filter) => this.saveDialogFilter(filter, overwrite)).filter(Boolean);\n }\n\n public getSuggestedDialogsFilters() {\n return this.apiManager.invokeApi('messages.getSuggestedDialogFilters');\n }\n\n public saveDialogFilter(filter: DialogFilter, update = true, silent?: boolean) {\n // defineNotNumerableProperties(filter, ['includePeerIds', 'excludePeerIds', 'pinnedPeerIds']);\n\n if(filter._ === 'dialogFilterDefault') {\n filter = this.localFilters[FOLDER_ID_ALL];\n }\n\n assumeType(filter);\n if(!REAL_FOLDERS.has(filter.id)) {\n convertment.forEach(([from, to]) => {\n assumeType(filter);\n filter[to] = filter[from].map((peer) => this.appPeersManager.getPeerId(peer));\n });\n\n this.filterIncludedPinnedPeers(filter);\n\n filter.include_peers = filter.pinned_peers.concat(filter.include_peers);\n filter.includePeerIds = filter.pinnedPeerIds.concat(filter.includePeerIds);\n }\n\n const oldFilter = this.filters[filter.id];\n if(oldFilter) {\n Object.assign(oldFilter, filter);\n } else {\n this.filters[filter.id] = filter;\n }\n\n this.setLocalId(filter);\n\n if(!silent) {\n if(update) {\n this.rootScope.dispatchEvent('filter_update', filter);\n } else if(!oldFilter) {\n this.rootScope.dispatchEvent('filter_new', filter);\n }\n }\n\n return filter;\n }\n\n private setLocalId(filter: MyDialogFilter) {\n if(filter.localId !== undefined) {\n if(filter.localId >= this.localId) {\n this.localId = filter.localId + 1;\n }\n } else {\n filter.localId = this.localId++ as MyDialogFilter['localId'];\n findAndSplice(this.filtersArr, (_filter) => _filter.id === filter.id);\n this.filtersArr.push(filter);\n this.pushToState();\n }\n }\n\n public async isFilterIdAvailable(filterId: number) {\n if(REAL_FOLDERS.has(filterId)) {\n return true;\n }\n\n const limit = await this.apiManager.getLimit('folders');\n const isFolderAvailable = this.filtersArr.filter((filter) => !REAL_FOLDERS.has(filter.id)).slice(0, limit).some((filter) => filter.id === filterId);\n\n return isFolderAvailable;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function applyMixins(derivedCtor: any, constructors: any[]) {\n // const callbacks: Array<(...args: any[]) => any> = [];\n\n constructors.forEach((baseCtor) => {\n Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => {\n const value: PropertyDescriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name) || Object.create(null);\n /* if(name === '_constructor') {\n callbacks.push(value.value);\n return;\n } else */if(name === 'constructor') {\n return;\n }\n\n Object.defineProperty(\n derivedCtor.prototype,\n name,\n value\n );\n });\n });\n\n // if(callbacks.length) {\n // function c(...args: any[]): any {\n // callbacks.forEach((cb, idx) => {\n // // @ts-ignore\n // cb.apply(this, args[idx] || []);\n // });\n // };\n\n // Object.defineProperty(derivedCtor.prototype, 'superConstructor', {\n // configurable: true,\n // enumerable: true,\n // value: c,\n // writable: true\n // });\n // }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport DEBUG from '../../config/debug';\nimport {ConstructorDeclMap, Message, MessageEntity, MessageFwdHeader, Peer, Update, Updates} from '../../layer';\nimport {logger, LogTypes} from '../logger';\nimport assumeType from '../../helpers/assumeType';\nimport App from '../../config/app';\nimport filterUnique from '../../helpers/array/filterUnique';\nimport {AppManager} from './manager';\nimport parseMarkdown from '../richTextProcessor/parseMarkdown';\nimport ctx from '../../environment/ctx';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport applyMixins from '../../helpers/applyMixins';\nimport tsNow from '../../helpers/tsNow';\n\ntype UpdatesState = {\n pendingPtsUpdates: (Update & {pts: number, pts_count: number})[],\n pendingSeqUpdates?: {[seq: number]: {seq: number, date: number, updates: any[]}},\n syncPending: {\n seqAwaiting?: number,\n ptsAwaiting?: boolean,\n timeout: number\n },\n syncLoading: Promise,\n\n seq?: number,\n pts?: number,\n date?: number,\n lastPtsUpdateTime?: number,\n lastDifferenceTime?: number\n};\n\nconst SYNC_DELAY = 6;\n\nclass ApiUpdatesManager {\n public updatesState: UpdatesState = {\n pendingPtsUpdates: [],\n pendingSeqUpdates: {},\n syncPending: null,\n syncLoading: null\n };\n\n private channelStates: {[channelId: ChatId]: UpdatesState} = {};\n private attached = false;\n\n private log = logger('UPDATES', LogTypes.Error | LogTypes.Warn | LogTypes.Log/* | LogTypes.Debug */);\n private debug = DEBUG;\n\n private subscriptions: {[channelId: ChatId]: {count: number, interval?: number}} = {};\n\n constructor() {\n this._constructor(false);\n }\n\n private setProxy() {\n const self = this;\n this.updatesState = new Proxy(this.updatesState, {\n set: function(target: ApiUpdatesManager['updatesState'], key: keyof ApiUpdatesManager['updatesState'], value: ApiUpdatesManager['updatesState'][typeof key]) {\n // @ts-ignore\n target[key] = value;\n self.saveUpdatesState();\n return true;\n }\n });\n }\n\n public saveUpdatesState() {\n const us = this.updatesState;\n this.appStateManager.pushToState('updates', {\n seq: us.seq,\n pts: us.pts,\n date: us.date\n });\n }\n\n private popPendingSeqUpdate() {\n const state = this.updatesState;\n const nextSeq = state.seq + 1;\n const pendingUpdatesData = state.pendingSeqUpdates[nextSeq];\n if(!pendingUpdatesData) {\n return false;\n }\n\n const updates = pendingUpdatesData.updates;\n for(let i = 0, length = updates.length; i < length; ++i) {\n this.saveUpdate(updates[i]);\n }\n\n state.seq = pendingUpdatesData.seq;\n if(pendingUpdatesData.date && state.date < pendingUpdatesData.date) {\n state.date = pendingUpdatesData.date;\n }\n delete state.pendingSeqUpdates[nextSeq];\n\n if(!this.popPendingSeqUpdate() &&\n state.syncPending?.seqAwaiting &&\n state.seq >= state.syncPending.seqAwaiting) {\n if(!state.syncPending.ptsAwaiting) {\n this.clearStatePendingSync(state);\n } else {\n delete state.syncPending.seqAwaiting;\n }\n }\n\n return true;\n }\n\n private popPendingPtsUpdate(channelId: ChatId) {\n const curState = channelId ? this.getChannelState(channelId) : this.updatesState;\n if(!curState.pendingPtsUpdates.length) {\n return false;\n }\n\n curState.pendingPtsUpdates.sort((a, b) => {\n return a.pts - b.pts;\n });\n // this.log('pop update', channelId, curState.pendingPtsUpdates)\n\n let curPts = curState.pts;\n let goodPts = 0;\n let goodIndex = 0;\n for(let i = 0, length = curState.pendingPtsUpdates.length; i < length; ++i) {\n const update = curState.pendingPtsUpdates[i];\n curPts += update.pts_count;\n if(curPts >= update.pts) {\n goodPts = update.pts;\n goodIndex = i;\n }\n }\n\n if(!goodPts) {\n return false;\n }\n\n this.debug && this.log.debug('pop pending pts updates', goodPts, curState.pendingPtsUpdates.slice(0, goodIndex + 1));\n\n curState.pts = goodPts;\n for(let i = 0; i <= goodIndex; ++i) {\n const update = curState.pendingPtsUpdates[i];\n\n // @ts-ignore\n this.saveUpdate(update);\n }\n curState.pendingPtsUpdates.splice(0, goodIndex + 1);\n\n if(!curState.pendingPtsUpdates.length && curState.syncPending) {\n if(!curState.syncPending.seqAwaiting) {\n this.clearStatePendingSync(curState);\n } else {\n delete curState.syncPending.ptsAwaiting;\n }\n }\n\n return true;\n }\n\n public forceGetDifference() {\n if(!this.updatesState.syncLoading) {\n this.getDifference();\n }\n }\n\n public processLocalUpdate(update: Update) {\n this.processUpdateMessage({\n _: 'updateShort',\n update\n } as Updates);\n }\n\n public processUpdateMessage = (updateMessage: any, options: Partial<{\n override: boolean\n }> = {}) => {\n // return forceGetDifference()\n const processOpts = {\n date: updateMessage.date,\n seq: updateMessage.seq,\n seqStart: updateMessage.seq_start\n // ignoreSyncLoading: options.ignoreSyncLoading\n };\n\n this.debug && this.log.debug('processUpdateMessage', updateMessage);\n\n switch(updateMessage._) {\n case 'updatesTooLong':\n case 'new_session_created':\n this.forceGetDifference();\n break;\n\n case 'updateShort':\n this.processUpdate(updateMessage.update, processOpts);\n break;\n\n case 'updateShortMessage':\n case 'updateShortChatMessage': {\n assumeType(updateMessage);\n this.debug && this.log.debug('updateShortMessage | updateShortChatMessage', {...updateMessage});\n const isOut = updateMessage.pFlags.out;\n const fromId = (updateMessage as Updates.updateShortChatMessage).from_id || (isOut ? this.appPeersManager.peerId : (updateMessage as Updates.updateShortMessage).user_id);\n const toId = (updateMessage as Updates.updateShortChatMessage).chat_id ?\n (updateMessage as Updates.updateShortChatMessage).chat_id.toPeerId(true) :\n ((updateMessage as Updates.updateShortMessage).user_id.toPeerId(false) || this.appPeersManager.peerId);\n\n this.processUpdate({\n _: 'updateNewMessage',\n message: {\n _: 'message',\n pFlags: updateMessage.pFlags,\n id: updateMessage.id,\n from_id: this.appPeersManager.getOutputPeer(fromId.toPeerId()),\n peer_id: this.appPeersManager.getOutputPeer(toId),\n date: updateMessage.date,\n message: updateMessage.message,\n fwd_from: updateMessage.fwd_from,\n reply_to: updateMessage.reply_to,\n entities: updateMessage.entities\n },\n pts: updateMessage.pts,\n pts_count: updateMessage.pts_count\n }, processOpts);\n break;\n }\n\n case 'updatesCombined':\n case 'updates':\n this.appUsersManager.saveApiUsers(updateMessage.users, options.override);\n this.appChatsManager.saveApiChats(updateMessage.chats, options.override);\n\n updateMessage.updates.forEach((update: Update) => {\n this.processUpdate(update, processOpts);\n });\n break;\n\n default:\n this.log.warn('Unknown update message', updateMessage);\n }\n };\n\n private getDifference(first = false): Promise {\n // this.trace('Get full diff')\n const updatesState = this.updatesState;\n const wasSyncing = updatesState.syncLoading;\n if(!wasSyncing) {\n updatesState.pendingSeqUpdates = {};\n updatesState.pendingPtsUpdates = [];\n }\n\n this.clearStatePendingSync(updatesState);\n\n const promise = this.apiManager.invokeApi('updates.getDifference', {\n pts: updatesState.pts,\n pts_total_limit: first /* && false */? /* 50 */1200 : undefined,\n date: updatesState.date,\n qts: -1\n }, {\n timeout: 0x7fffffff\n }).then((differenceResult) => {\n this.debug && this.log.debug('Get diff result', differenceResult);\n\n if(differenceResult._ === 'updates.differenceEmpty') {\n this.debug && this.log.debug('apply empty diff', differenceResult.seq);\n updatesState.date = differenceResult.date;\n updatesState.seq = differenceResult.seq;\n return;\n }\n\n // ! SORRY I'M SORRY I'M SORRY\n if(first) {\n this.rootScope.dispatchEvent('state_synchronizing');\n }\n\n if(differenceResult._ !== 'updates.differenceTooLong') {\n this.appUsersManager.saveApiUsers(differenceResult.users);\n this.appChatsManager.saveApiChats(differenceResult.chats);\n\n // Should be first because of updateMessageID\n // this.log('applying', differenceResult.other_updates.length, 'other updates')\n\n differenceResult.other_updates.forEach((update) => {\n switch(update._) {\n case 'updateChannelTooLong':\n case 'updateNewChannelMessage':\n case 'updateEditChannelMessage':\n this.processUpdate(update);\n return;\n }\n\n this.saveUpdate(update);\n });\n\n // this.log('applying', differenceResult.new_messages.length, 'new messages')\n differenceResult.new_messages.forEach((apiMessage) => {\n this.saveUpdate({\n _: 'updateNewMessage',\n message: apiMessage,\n pts: updatesState.pts,\n pts_count: 0\n });\n });\n\n const nextState = differenceResult._ === 'updates.difference' ? differenceResult.state : differenceResult.intermediate_state;\n updatesState.seq = nextState.seq;\n updatesState.pts = nextState.pts;\n updatesState.date = nextState.date;\n } else {\n updatesState.pts = differenceResult.pts;\n updatesState.date = tsNow(true) + this.timeManager.getServerTimeOffset();\n delete updatesState.seq;\n\n this.channelStates = {};\n\n this.log.warn('getDifference:', differenceResult._);\n this.onDifferenceTooLong();\n }\n\n // this.log('apply diff', updatesState.seq, updatesState.pts)\n\n if(differenceResult._ === 'updates.differenceSlice') {\n return this.getDifference();\n } else {\n this.debug && this.log.debug('finished get diff');\n }\n });\n\n if(!wasSyncing) {\n this.justAName(updatesState, promise);\n }\n\n return promise;\n }\n\n private clearStatePendingSync(state: UpdatesState) {\n if(state.syncPending) {\n clearTimeout(state.syncPending.timeout);\n state.syncPending = null;\n }\n }\n\n private getChannelDifference(channelId: ChatId): Promise {\n const channelState = this.getChannelState(channelId);\n const wasSyncing = channelState.syncLoading;\n if(!wasSyncing) {\n channelState.pendingPtsUpdates = [];\n }\n\n this.clearStatePendingSync(channelState);\n\n const log = this.debug ? this.log.bindPrefix('getChannelDifference-' + channelId) : undefined;\n // this.log.trace('Get channel diff', appChatsManager.getChat(channelId), channelState.pts);\n const promise = this.apiManager.invokeApi('updates.getChannelDifference', {\n channel: this.appChatsManager.getChannelInput(channelId),\n filter: {_: 'channelMessagesFilterEmpty'},\n pts: channelState.pts,\n limit: 1000\n }, {timeout: 0x7fffffff}).then((differenceResult) => {\n log?.debug('diff result', differenceResult)\n channelState.pts = 'pts' in differenceResult ? differenceResult.pts : undefined;\n channelState.lastDifferenceTime = Date.now();\n\n if(differenceResult._ === 'updates.channelDifferenceEmpty') {\n // log?.debug('apply channel empty diff', differenceResult);\n return;\n }\n\n if(differenceResult._ === 'updates.channelDifferenceTooLong') {\n // log?.debug('channel diff too long', differenceResult);\n delete this.channelStates[channelId];\n\n this.saveUpdate({_: 'updateChannelReload', channel_id: channelId});\n return;\n }\n\n this.appUsersManager.saveApiUsers(differenceResult.users);\n this.appChatsManager.saveApiChats(differenceResult.chats);\n\n // Should be first because of updateMessageID\n log?.debug('applying', differenceResult.other_updates.length, 'channel other updates');\n differenceResult.other_updates.forEach((update) => {\n this.saveUpdate(update);\n });\n\n log?.debug('applying', differenceResult.new_messages.length, 'channel new messages');\n differenceResult.new_messages.forEach((apiMessage) => {\n this.saveUpdate({\n _: 'updateNewChannelMessage',\n message: apiMessage,\n pts: channelState.pts,\n pts_count: 0\n });\n });\n\n log?.debug('apply channel diff', channelState.pts);\n\n if(differenceResult._ === 'updates.channelDifference' &&\n !differenceResult.pFlags.final) {\n return this.getChannelDifference(channelId);\n } else {\n log?.debug('finished channel get diff');\n }\n });\n\n if(!wasSyncing) {\n this.justAName(channelState, promise, channelId);\n }\n\n return promise;\n }\n\n private onDifferenceTooLong() {\n this.appUsersManager.clear();\n this.appChatsManager.clear();\n this.appMessagesManager.clear();\n\n this.rootScope.dispatchEvent('state_cleared');\n }\n\n private justAName(state: UpdatesState, promise: UpdatesState['syncLoading'], channelId?: ChatId) {\n state.syncLoading = promise;\n this.rootScope.dispatchEvent('state_synchronizing', channelId);\n\n promise.then(() => {\n state.syncLoading = null;\n this.rootScope.dispatchEvent('state_synchronized', channelId);\n }, () => {\n state.syncLoading = null;\n });\n }\n\n public addChannelState(channelId: ChatId, pts: number) {\n if(!pts) {\n throw new Error('Add channel state without pts ' + channelId);\n }\n\n return this.channelStates[channelId] ??= {\n pts,\n pendingPtsUpdates: [],\n syncPending: null,\n syncLoading: null\n };\n }\n\n public getChannelState(channelId: ChatId, pts?: number) {\n if(this.channelStates[channelId] === undefined) {\n this.addChannelState(channelId, pts);\n }\n\n return this.channelStates[channelId];\n }\n\n private processUpdate(update: Update, options: Partial<{\n date: number,\n seq: number,\n seqStart: number/* ,\n ignoreSyncLoading: boolean */\n }> = {}) {\n let channelId: ChatId;\n switch(update._) {\n case 'updateNewChannelMessage':\n case 'updateEditChannelMessage':\n channelId = this.appPeersManager.getPeerId(update.message.peer_id).toChatId();\n break;\n /* case 'updateDeleteChannelMessages':\n channelId = update.channel_id;\n break; */\n case 'updateChannelTooLong':\n channelId = update.channel_id;\n if(!(channelId in this.channelStates)) {\n return false;\n }\n break;\n default:\n if('channel_id' in update && 'pts' in update) {\n channelId = update.channel_id;\n }\n break;\n }\n\n const {pts, pts_count} = update as Update.updateNewMessage;\n const curState = channelId ? this.getChannelState(channelId, pts) : this.updatesState;\n\n // this.log.log('process', channelId, curState.pts, update)\n\n if(curState.syncLoading/* && !options.ignoreSyncLoading */) {\n return false;\n }\n\n if(update._ === 'updateChannelTooLong') {\n if(!curState.lastPtsUpdateTime ||\n curState.lastPtsUpdateTime < (Date.now() - SYNC_DELAY)) {\n // this.log.trace('channel too long, get diff', channelId, update)\n this.getChannelDifference(channelId);\n }\n return false;\n }\n\n if(update._ === 'updateNewMessage' ||\n update._ === 'updateEditMessage' ||\n update._ === 'updateNewChannelMessage' ||\n update._ === 'updateEditChannelMessage') {\n const message = update.message as Message.message;\n const toPeerId = this.appPeersManager.getPeerId(message.peer_id);\n const fwdHeader: MessageFwdHeader.messageFwdHeader = message.fwd_from || {} as any;\n let reason: string;\n if(message.from_id && !this.appUsersManager.hasUser(this.appPeersManager.getPeerId(message.from_id), message.pFlags.post/* || channelId*/) && (reason = 'author') ||\n fwdHeader.from_id && !this.appUsersManager.hasUser(this.appPeersManager.getPeerId(fwdHeader.from_id), !!(fwdHeader.from_id as Peer.peerChannel).channel_id) && (reason = 'fwdAuthor') ||\n (fwdHeader.from_id as Peer.peerChannel)?.channel_id && !this.appChatsManager.hasChat((fwdHeader.from_id as Peer.peerChannel).channel_id, true) && (reason = 'fwdChannel') ||\n toPeerId.isUser() && !this.appUsersManager.hasUser(toPeerId) && (reason = 'toPeer User') ||\n toPeerId.isAnyChat() && !this.appChatsManager.hasChat(toPeerId.toChatId()) && (reason = 'toPeer Chat')) {\n this.log.warn('Not enough data for message update', toPeerId, reason, message);\n if(channelId && this.appChatsManager.hasChat(channelId)) {\n this.getChannelDifference(channelId);\n } else {\n this.forceGetDifference();\n }\n return false;\n }\n } else if(channelId && !this.appChatsManager.hasChat(channelId)) {\n // this.log.log('skip update, missing channel', channelId, update)\n return false;\n }\n\n let popPts: boolean;\n let popSeq: boolean;\n\n if(pts) {\n const newPts = curState.pts + (pts_count || 0);\n if(newPts < pts) {\n this.debug && this.log.warn('Pts hole', curState, update, channelId && this.appChatsManager.getChat(channelId));\n curState.pendingPtsUpdates.push(update as Update.updateNewMessage);\n if(!curState.syncPending && !curState.syncLoading) {\n curState.syncPending = {\n timeout: ctx.setTimeout(() => {\n curState.syncPending = null;\n\n if(curState.syncLoading) {\n return;\n }\n\n if(channelId) {\n this.getChannelDifference(channelId);\n } else {\n this.getDifference();\n }\n }, SYNC_DELAY)\n };\n }\n\n curState.syncPending.ptsAwaiting = true;\n return false;\n }\n\n if(pts > curState.pts) {\n curState.pts = pts;\n popPts = true;\n\n curState.lastPtsUpdateTime = Date.now();\n } else if(pts_count) {\n // this.log.warn('Duplicate update', update)\n return false;\n }\n\n if(channelId && options.date && this.updatesState.date < options.date) {\n this.updatesState.date = options.date;\n }\n } else if(!channelId && options.seq > 0) {\n const seq = options.seq;\n const seqStart = options.seqStart || seq;\n\n if(seqStart !== curState.seq + 1) {\n if(seqStart > curState.seq) {\n this.debug && this.log.warn('Seq hole', curState, curState.syncPending?.seqAwaiting);\n\n curState.pendingSeqUpdates[seqStart] ??= {seq, date: options.date, updates: []};\n curState.pendingSeqUpdates[seqStart].updates.push(update);\n\n if(!curState.syncPending) {\n curState.syncPending = {\n timeout: ctx.setTimeout(() => {\n curState.syncPending = null;\n\n if(curState.syncLoading) {\n return;\n }\n\n this.getDifference();\n }, SYNC_DELAY)\n };\n }\n\n if(!curState.syncPending.seqAwaiting ||\n curState.syncPending.seqAwaiting < seqStart) {\n curState.syncPending.seqAwaiting = seqStart;\n }\n return false;\n }\n }\n\n if(curState.seq !== seq) {\n curState.seq = seq;\n if(options.date && curState.date < options.date) {\n curState.date = options.date;\n }\n\n popSeq = true;\n }\n }\n\n this.saveUpdate(update);\n\n if(popPts) {\n this.popPendingPtsUpdate(channelId);\n } else if(popSeq) {\n this.popPendingSeqUpdate();\n }\n }\n\n public saveUpdate(update: Update) {\n // this.debug && this.log('saveUpdate', update);\n this.dispatchEvent(update._, update as any);\n }\n\n public subscribeToChannelUpdates(channelId: ChatId) {\n const subscription = this.subscriptions[channelId] ??= {count: 0};\n ++subscription.count;\n\n const cb = () => {\n const state = this.getChannelState(channelId);\n if(!state.syncLoading && (!state.lastDifferenceTime || (Date.now() - state.lastDifferenceTime) > 2500)) {\n this.getChannelDifference(channelId);\n }\n };\n\n subscription.interval ??= ctx.setInterval(cb, 3000);\n cb();\n }\n\n public unsubscribeFromChannelUpdates(channelId: ChatId, force?: boolean) {\n const subscription = this.subscriptions[channelId];\n if(!subscription?.interval || (--subscription.count && !force)) {\n return;\n }\n\n clearInterval(subscription.interval);\n subscription.interval = undefined;\n delete this.subscriptions[channelId];\n }\n\n public attach(langCode?: string) {\n if(this.attached) return;\n\n // return;\n\n this.log('attach');\n\n this.attached = true;\n\n this.appStateManager.getState().then(({updates: state}) => {\n const newVersion = this.appStateManager.newVersion/* || '1.6.0' */;\n\n // rootScope.broadcast('state_synchronizing');\n if(!state || !state.pts || !state.date/* || !state.seq */) { // seq can be undefined because of updates.differenceTooLong\n this.log('will get new state');\n\n this.updatesState.syncLoading = new Promise((resolve) => {\n this.apiManager.invokeApi('updates.getState', {}, {noErrorBox: true}).then((stateResult) => {\n this.updatesState.seq = stateResult.seq;\n this.updatesState.pts = stateResult.pts;\n this.updatesState.date = stateResult.date;\n this.saveUpdatesState();\n // setTimeout(() => {\n this.updatesState.syncLoading = null;\n resolve();\n // rootScope.broadcast('state_synchronized');\n // }, 1000);\n\n // ! for testing\n // updatesState.seq = 1\n // updatesState.pts = stateResult.pts - 5000\n // updatesState.date = 1\n // getDifference()\n });\n });\n } else {\n // ! for testing\n /* state.seq = 1;\n state.pts = state.pts - 15;\n state.date = 1; */\n // state.pts -= 100;\n\n // state.date = 1628623682;\n // state.pts = 2007500;\n // state.seq = 503;\n\n Object.assign(this.updatesState, state);\n\n this.log('will get difference', Object.assign({}, state));\n\n this.getDifference(true)/* .finally(() => {\n if(this.updatesState.syncLoading) {\n rootScope.broadcast('state_synchronizing');\n }\n }) */;\n }\n\n this.apiManager.setUpdatesProcessor(this.processUpdateMessage);\n\n // this.updatesState.syncLoading.then(() => {\n this.setProxy();\n // });\n\n if(newVersion) {\n this.updatesState.syncLoading.then(async() => {\n const strs: Record = {\n en: 'was updated to version',\n ru: 'обновлён до версии'\n };\n\n const getChangelog = (lang: string) => {\n fetch(`changelogs/${lang}_${newVersion.split(' ')[0]}.md`)\n .then((res) => (res.status === 200 && res.ok && res.text()) || Promise.reject())\n .then((text) => {\n const langStr = strs[lang] || strs.en;\n const pre = `**Telegram Web${App.suffix} ${langStr} ${newVersion}**\\n\\n`;\n\n text = pre + text;\n\n const entities: MessageEntity[] = [];\n const message = parseMarkdown(text, entities);\n\n const update: Update.updateServiceNotification = {\n _: 'updateServiceNotification',\n entities,\n message,\n type: 'local',\n pFlags: {},\n inbox_date: tsNow(true),\n media: undefined\n };\n\n this.processLocalUpdate(update);\n });\n };\n\n const languages = filterUnique([langCode, 'en']);\n for(const language of languages) {\n try {\n await getChangelog(language);\n break;\n } catch(err) {\n\n }\n }\n });\n }\n });\n }\n}\n\ninterface ApiUpdatesManager extends EventListenerBase<{\n [name in Update['_']]: (update: ConstructorDeclMap[name]) => void\n}>, AppManager {}\napplyMixins(ApiUpdatesManager, [EventListenerBase, AppManager]);\n\nexport {ApiUpdatesManager};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {UserProfilePhoto, ChatPhoto, InputFileLocation} from '../../layer';\nimport {DownloadOptions} from '../mtproto/apiFileManager';\nimport {AppManager} from './manager';\n\nexport type PeerPhotoSize = 'photo_small' | 'photo_big';\n\nexport class AppAvatarsManager extends AppManager {\n private savedAvatarURLs: {\n [peerId: PeerId]: {\n [size in PeerPhotoSize]?: string | Promise\n }\n } = {};\n\n protected after() {\n this.rootScope.addEventListener('avatar_update', ({peerId, threadId}) => {\n if(threadId) {\n return;\n }\n\n this.removeFromAvatarsCache(peerId);\n });\n }\n\n public isAvatarCached(peerId: PeerId, size?: PeerPhotoSize) {\n const saved = this.savedAvatarURLs[peerId];\n if(size === undefined) {\n return !!saved;\n }\n\n return !!(saved && saved[size] && !(saved[size] instanceof Promise));\n }\n\n public removeFromAvatarsCache(peerId: PeerId) {\n if(this.savedAvatarURLs[peerId]) {\n delete this.savedAvatarURLs[peerId];\n }\n }\n\n public loadAvatar(peerId: PeerId, photo: UserProfilePhoto.userProfilePhoto | ChatPhoto.chatPhoto, size: PeerPhotoSize) {\n const saved = this.savedAvatarURLs[peerId] ??= {};\n if(!saved[size]) {\n // console.warn('will invoke downloadSmallFile:', peerId);\n const peerPhotoFileLocation: InputFileLocation.inputPeerPhotoFileLocation = {\n _: 'inputPeerPhotoFileLocation',\n pFlags: {},\n peer: this.appPeersManager.getInputPeerById(peerId),\n photo_id: photo.photo_id\n };\n\n const downloadOptions: DownloadOptions = {dcId: photo.dc_id, location: peerPhotoFileLocation};\n if(size === 'photo_big') {\n peerPhotoFileLocation.pFlags.big = true;\n downloadOptions.limitPart = 512 * 1024;\n }\n\n /* let str: string;\n const time = Date.now();\n if(peerId === 0) {\n str = `download avatar ${peerId}`;\n } */\n\n const promise = this.apiFileManager.download(downloadOptions);\n return saved[size] = promise.then((blob) => {\n return saved[size] = URL.createObjectURL(blob);\n\n /* if(str) {\n console.log(str, Date.now() / 1000, Date.now() - time);\n } */\n });\n } else {\n return saved[size];\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {getEnvironment} from '../../environment/utils';\nimport safeReplaceObject from '../../helpers/object/safeReplaceObject';\nimport {nextRandomUint} from '../../helpers/random';\nimport {InputPhoneCall, MessagesDhConfig, PhoneCall, PhoneCallDiscardReason, PhoneCallProtocol, PhonePhoneCall} from '../../layer';\nimport {AppManager} from './manager';\n\nexport type CallId = PhoneCall['id'];\n\nexport type MyPhoneCall = Exclude;\n\nexport class AppCallsManager extends AppManager {\n private calls: Map;\n\n protected after() {\n this.calls = new Map();\n\n if(!getEnvironment().IS_CALL_SUPPORTED) {\n return;\n }\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updatePhoneCall: (update) => {\n this.saveCall(update.phone_call);\n },\n\n updatePhoneCallSignalingData: (update) => {\n this.rootScope.dispatchEvent('call_signaling', {callId: update.phone_call_id, data: update.data});\n }\n });\n }\n\n public computeKey(g_b: Uint8Array, a: Uint8Array, p: Uint8Array) {\n return this.cryptoWorker.invokeCrypto('compute-dh-key', g_b, a, p);\n }\n\n public saveCall(call: PhoneCall) {\n const isDiscarded = call._ === 'phoneCallDiscarded';\n const oldCall = this.calls.get(call.id);\n if(oldCall) {\n // if(shouldUpdate) {\n safeReplaceObject(oldCall, call);\n // }\n\n if(isDiscarded) {\n this.calls.delete(call.id);\n }\n\n call = oldCall;\n } else if(!isDiscarded) {\n this.calls.set(call.id, call as any);\n }\n\n this.rootScope.dispatchEvent('call_update', call);\n\n return call;\n }\n\n public getCall(callId: CallId) {\n return this.calls.get(callId);\n }\n\n public getCallInput(id: CallId): InputPhoneCall {\n const call = this.getCall(id);\n return {\n _: 'inputPhoneCall',\n id: call.id,\n access_hash: call.access_hash\n };\n }\n\n public savePhonePhoneCall(phonePhoneCall: PhonePhoneCall) {\n this.appUsersManager.saveApiUsers(phonePhoneCall.users);\n return this.saveCall(phonePhoneCall.phone_call);\n }\n\n public generateDh() {\n return this.apiManager.invokeApi('messages.getDhConfig', {\n version: 0,\n random_length: 256\n }).then((dhConfig) => {\n return this.cryptoWorker.invokeCrypto('generate-dh', dhConfig as MessagesDhConfig.messagesDhConfig);\n });\n }\n\n // private verifyProtocolCompatibility(protocol: PhoneCallProtocol) {\n // const my = getCallProtocol();\n // const myVersion = my.library_versions[0];\n // return !protocol.library_versions.find((version) => {\n // return compareVersion(myVersion, version) > 0;\n // });\n // }\n\n public async requestCall(userId: UserId, protocol: PhoneCallProtocol, g_a_hash: Uint8Array, video?: boolean) {\n const phonePhoneCall = await this.apiManager.invokeApi('phone.requestCall', {\n user_id: this.appUsersManager.getUserInput(userId),\n protocol: protocol,\n video: video,\n random_id: nextRandomUint(32),\n g_a_hash: g_a_hash\n });\n\n return this.savePhonePhoneCall(phonePhoneCall);\n }\n\n public async discardCall(callId: CallId, duration: number, reason: PhoneCallDiscardReason['_'], video?: boolean) {\n if(!this.getCall(callId)) {\n return;\n }\n\n const updates = await this.apiManager.invokeApi('phone.discardCall', {\n video,\n peer: this.getCallInput(callId),\n duration,\n reason: {\n _: reason\n },\n connection_id: '0'\n });\n\n this.apiUpdatesManager.processUpdateMessage(updates);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport deepEqual from '../../helpers/object/deepEqual';\nimport isObject from '../../helpers/object/isObject';\nimport safeReplaceObject from '../../helpers/object/safeReplaceObject';\nimport {ChannelParticipant, ChannelsCreateChannel, Chat, ChatAdminRights, ChatBannedRights, ChatInvite, ChatParticipant, ChatPhoto, ChatReactions, InputChannel, InputChatPhoto, InputFile, InputPeer, MessagesSponsoredMessages, SponsoredMessage, Update, Updates} from '../../layer';\nimport {isRestricted} from '../../helpers/restrictions';\nimport {AppManager} from './manager';\nimport hasRights from './utils/chats/hasRights';\nimport getParticipantPeerId from './utils/chats/getParticipantPeerId';\nimport {AppStoragesManager} from './appStoragesManager';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\nimport {randomLong} from '../../helpers/random';\nimport generateMessageId from './utils/messageId/generateMessageId';\nimport tsNow from '../../helpers/tsNow';\n\nexport type Channel = Chat.channel;\nexport type ChatRights = keyof ChatBannedRights['pFlags'] | keyof ChatAdminRights['pFlags'] | 'change_type' | 'change_permissions' | 'delete_chat' | 'view_participants';\n\nexport class AppChatsManager extends AppManager {\n private storage: AppStoragesManager['storages']['chats'];\n\n private chats: {[id: ChatId]: Exclude};\n // private usernames: any;\n // private channelAccess: any;\n // private megagroups: {[id: number]: true};\n\n protected after() {\n this.clear(true);\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateChannelParticipant: this.onUpdateChannelParticipant,\n\n updateChatDefaultBannedRights: this.onUpdateChatDefaultBannedRights\n });\n\n return Promise.all([\n this.appStateManager.getState(),\n this.appStoragesManager.loadStorage('chats')\n ]).then(([state, {results: chats, storage}]) => {\n this.storage = storage;\n\n this.saveApiChats(chats);\n\n this.peersStorage.addEventListener('peerNeeded', (peerId) => {\n if(peerId.isUser() || this.storage.getFromCache(peerId.toChatId())) {\n return;\n }\n\n this.storage.set({\n [peerId.toChatId()]: this.getChat(peerId.toChatId())\n });\n });\n\n this.peersStorage.addEventListener('peerUnneeded', (peerId) => {\n if(peerId.isUser() || !this.storage.getFromCache(peerId.toChatId())) {\n return;\n }\n\n this.storage.delete(peerId.toChatId());\n });\n });\n }\n\n public clear = (init = false) => {\n if(!init) {\n for(const chatId in this.chats) {\n if(!chatId) continue;\n if(!this.peersStorage.isPeerNeeded(chatId.toPeerId(true))) {\n const chat = this.chats[chatId];\n this.appUsersManager.modifyUsernamesCache(chat, false);\n\n this.storage.delete(chatId);\n delete this.chats[chatId];\n }\n }\n } else {\n this.chats = {};\n }\n };\n\n public saveApiChats(apiChats: any[], override?: boolean) {\n if((apiChats as any).saved) return;\n (apiChats as any).saved = true;\n apiChats.forEach((chat) => this.saveApiChat(chat, override));\n }\n\n public saveApiChat(chat: Chat, override?: boolean) {\n if(!chat || chat._ === 'chatEmpty') return;\n /* if(chat._ !== 'chat' && chat._ !== 'channel') {\n return;\n } */\n\n // * exclude from state\n // defineNotNumerableProperties(chat, ['rTitle', 'initials']);\n\n const oldChat = this.chats[chat.id];\n\n /* if(oldChat && !override) {\n return;\n } */\n\n (chat as Chat.chat).pFlags ??= {};\n\n if((chat as Chat.channel).pFlags.min && oldChat !== undefined) {\n return;\n }\n\n if(chat._ === 'channel' &&\n chat.participants_count === undefined &&\n oldChat !== undefined &&\n (oldChat as Chat.channel).participants_count) {\n chat.participants_count = (oldChat as Chat.channel).participants_count;\n }\n\n if((chat as Chat.channel).photo?._ === 'chatPhotoEmpty') {\n delete (chat as Chat.channel).photo;\n }\n\n const changedUsername = this.appUsersManager.setUsernameToCache(chat, oldChat);\n\n /* if(chat.username) {\n let searchUsername = searchIndexManager.cleanUsername(chat.username);\n this.usernames[searchUsername] = chat.id;\n } */\n\n const peerId = chat.id.toPeerId(true);\n if(oldChat === undefined) {\n this.chats[chat.id] = chat;\n } else {\n const oldPhotoId = ((oldChat as Chat.chat).photo as ChatPhoto.chatPhoto)?.photo_id;\n const newPhotoId = ((chat as Chat.chat).photo as ChatPhoto.chatPhoto)?.photo_id;\n const toggledForum = (oldChat as Chat.channel).pFlags.forum !== (chat as Chat.channel).pFlags.forum;\n const changedPhoto = oldPhotoId !== newPhotoId || toggledForum;\n\n const changedTitle = oldChat.title !== chat.title || changedUsername;\n\n const changedAnyBadge = (oldChat as Chat.channel).pFlags.verified !== (chat as Chat.channel).pFlags.verified ||\n (oldChat as Chat.channel).pFlags.scam !== (chat as Chat.channel).pFlags.scam ||\n (oldChat as Chat.channel).pFlags.fake !== (chat as Chat.channel).pFlags.fake;\n\n safeReplaceObject(oldChat, chat);\n this.rootScope.dispatchEvent('chat_update', chat.id);\n\n if(changedPhoto) {\n this.rootScope.dispatchEvent('avatar_update', {peerId});\n }\n\n if(changedTitle || changedAnyBadge) {\n this.rootScope.dispatchEvent('peer_title_edit', {peerId});\n }\n\n if(toggledForum) {\n this.rootScope.dispatchEvent('chat_toggle_forum', {chatId: chat.id, enabled: !!(chat as Chat.channel).pFlags.forum});\n }\n }\n\n if(this.peersStorage.isPeerNeeded(peerId)) {\n this.storage.set({\n [chat.id]: chat\n });\n }\n }\n\n public getChat(id: ChatId) {\n return this.chats[id];\n }\n\n /**\n * Check the user's ability to do an action in chat\n * @param id\n * @param action creator can still send messages to left channel. so this function shows server rights. see canSendToPeer for local rights in messages manager.\n * @param rights do not provide this parameter when checking rights for self\n * @param isThread\n * @returns\n */\n public hasRights(id: ChatId, action: ChatRights, rights?: ChatAdminRights | ChatBannedRights, isThread?: boolean) {\n return hasRights(this.getChat(id), action, rights, isThread);\n }\n\n public editChatDefaultBannedRights(id: ChatId, banned_rights: ChatBannedRights) {\n const chat = this.getChat(id) as Chat.chat;\n if(chat.default_banned_rights) {\n if(chat.default_banned_rights.until_date === banned_rights.until_date && deepEqual(chat.default_banned_rights.pFlags, banned_rights.pFlags)) {\n return Promise.resolve();\n }\n }\n\n return this.apiManager.invokeApi('messages.editChatDefaultBannedRights', {\n peer: this.appPeersManager.getInputPeerById(id.toPeerId(true)),\n banned_rights\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n /* public resolveUsername(username: string) {\n return this.usernames[username] || 0;\n } */\n\n /* public saveChannelAccess(id: ChatId, accessHash: string) {\n this.channelAccess[id] = accessHash;\n } */\n\n /* public saveIsMegagroup(id: ChatId) {\n this.megagroups[id] = true;\n } */\n\n public isChannel(id: ChatId) {\n const chat = this.chats[id];\n return !!(chat && (chat._ === 'channel' || chat._ === 'channelForbidden')/* || this.channelAccess[id] */);\n }\n\n public isMegagroup(id: ChatId) {\n /* if(this.megagroups[id]) {\n return true;\n } */\n\n const chat: Chat = this.chats[id];\n return !!(chat as Chat.channel)?.pFlags?.megagroup;\n }\n\n public isForum(id: ChatId) {\n const chat = this.chats[id];\n return !!(chat as Chat.channel)?.pFlags?.forum;\n }\n\n public isBroadcast(id: ChatId) {\n return this.isChannel(id) && !this.isMegagroup(id);\n }\n\n public isInChat(id: ChatId) {\n let good = true;\n const chat: Chat = this.getChat(id);\n if(!chat ||\n chat._ === 'channelForbidden' ||\n chat._ === 'chatForbidden' ||\n (chat as any as Chat.chatEmpty)._ === 'chatEmpty' ||\n (chat as Chat.chat).pFlags.left ||\n // || (chat as any).pFlags.kicked\n (chat as Chat.chat).pFlags.deactivated) {\n good = false;\n }\n\n return good;\n }\n\n public getChannelInput(id: ChatId): InputChannel {\n const chat: Chat = this.getChat(id);\n if(!chat || !(chat as Chat.channel).access_hash) {\n return {\n _: 'inputChannelEmpty'\n };\n } else {\n return {\n _: 'inputChannel',\n channel_id: id,\n access_hash: (chat as Chat.channel).access_hash/* || this.channelAccess[id] */ || '0'\n };\n }\n }\n\n public getInputPeer(id: ChatId) {\n return this.isChannel(id) ? this.getChannelInputPeer(id) : this.getChatInputPeer(id);\n }\n\n public getChatInputPeer(id: ChatId): InputPeer.inputPeerChat {\n return {\n _: 'inputPeerChat',\n chat_id: id\n };\n }\n\n public getChannelInputPeer(id: ChatId): InputPeer.inputPeerChannel {\n return {\n _: 'inputPeerChannel',\n channel_id: id,\n access_hash: (this.getChat(id) as Chat.channel).access_hash/* || this.channelAccess[id] */ || 0\n };\n }\n\n public hasChat(id: ChatId, allowMin?: true) {\n const chat = this.chats[id];\n return isObject(chat) && (allowMin || !(chat as Chat.channel).pFlags.min);\n }\n\n public getChatString(id: ChatId) {\n const chat = this.getChat(id);\n if(this.isChannel(id)) {\n return (this.isMegagroup(id) ? 's' : 'c') + id + '_' + (chat as Chat.channel).access_hash;\n }\n return 'g' + id;\n }\n\n /* public wrapForFull(id: number, fullChat: any) {\n const chatFull = copy(fullChat);\n const chat = this.getChat(id);\n\n if(!chatFull.participants_count) {\n chatFull.participants_count = chat.participants_count;\n }\n\n if(chatFull.participants &&\n chatFull.participants._ === 'chatParticipants') {\n chatFull.participants.participants = this.wrapParticipants(id, chatFull.participants.participants);\n }\n\n if(chatFull.about) {\n chatFull.rAbout = wrapRichText(chatFull.about, {noLinebreaks: true});\n }\n\n //chatFull.peerString = this.getChatString(id);\n chatFull.chat = chat;\n\n return chatFull;\n }\n\n public wrapParticipants(id: number, participants: any[]) {\n const chat = this.getChat(id);\n const myId = appUsersManager.getSelf().id;\n if(this.isChannel(id)) {\n const isAdmin = chat.pFlags.creator;\n participants.forEach((participant) => {\n participant.canLeave = myId === participant.user_id;\n participant.canKick = isAdmin && participant._ === 'channelParticipant';\n\n // just for order by last seen\n participant.user = appUsersManager.getUser(participant.user_id);\n });\n } else {\n const isAdmin = chat.pFlags.creator || chat.pFlags.admins_enabled && chat.pFlags.admin;\n participants.forEach((participant) => {\n participant.canLeave = myId === participant.user_id;\n participant.canKick = !participant.canLeave && (\n chat.pFlags.creator ||\n participant._ === 'chatParticipant' && (isAdmin || myId === participant.inviter_id)\n );\n\n // just for order by last seen\n participant.user = appUsersManager.getUser(participant.user_id);\n });\n }\n\n return participants;\n } */\n\n public createChannel(options: ChannelsCreateChannel): Promise {\n return this.apiManager.invokeApi('channels.createChannel', options).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n\n const channelId = (updates as any).chats[0].id;\n return channelId;\n });\n }\n\n public inviteToChannel(id: ChatId, userIds: UserId[]) {\n const input = this.getChannelInput(id);\n const usersInputs = userIds.map((u) => this.appUsersManager.getUserInput(u));\n\n return this.apiManager.invokeApi('channels.inviteToChannel', {\n channel: input,\n users: usersInputs\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public createChat(title: string, userIds: UserId[]): Promise {\n return this.apiManager.invokeApi('messages.createChat', {\n users: userIds.map((u) => this.appUsersManager.getUserInput(u)),\n title\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n\n const chatId = (updates as any as Updates.updates).chats[0].id;\n return chatId;\n });\n }\n\n private onChatUpdated = (chatId: ChatId, updates?: Updates) => {\n // console.log('onChatUpdated', chatId, updates);\n\n this.apiUpdatesManager.processUpdateMessage(updates);\n if((updates as Updates.updates)?.updates?.length && this.isChannel(chatId)) {\n this.rootScope.dispatchEvent('invalidate_participants', chatId);\n }\n };\n\n public leaveChannel(id: ChatId) {\n return this.apiManager.invokeApi('channels.leaveChannel', {\n channel: this.getChannelInput(id)\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public joinChannel(id: ChatId) {\n return this.apiManager.invokeApi('channels.joinChannel', {\n channel: this.getChannelInput(id)\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public addChatUser(id: ChatId, userId: UserId, fwdLimit = 100) {\n return this.apiManager.invokeApi('messages.addChatUser', {\n chat_id: id,\n user_id: this.appUsersManager.getUserInput(userId),\n fwd_limit: fwdLimit\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public deleteChatUser(id: ChatId, userId: UserId) {\n return this.apiManager.invokeApi('messages.deleteChatUser', {\n chat_id: id,\n user_id: this.appUsersManager.getUserInput(userId)\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public leaveChat(id: ChatId) {\n return this.deleteChatUser(id, this.appUsersManager.getSelf().id);\n }\n\n public leave(id: ChatId) {\n return this.isChannel(id) ? this.leaveChannel(id) : this.leaveChat(id);\n }\n\n public delete(id: ChatId) {\n return this.isChannel(id) ? this.deleteChannel(id) : this.deleteChat(id);\n }\n\n public deleteChannel(id: ChatId) {\n return this.apiManager.invokeApi('channels.deleteChannel', {\n channel: this.getChannelInput(id)\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public deleteChat(id: ChatId) {\n // return this.leaveChat(id).then(() => {\n return this.apiManager.invokeApi('messages.deleteChat', {\n chat_id: id\n });\n // });\n }\n\n public migrateChat(id: ChatId): Promise {\n const chat: Chat = this.getChat(id);\n if(chat._ === 'channel') return Promise.resolve(chat.id);\n return this.apiManager.invokeApi('messages.migrateChat', {\n chat_id: id\n }).then((updates) => {\n this.onChatUpdated(id, updates);\n const update: Update.updateChannel = (updates as Updates.updates).updates.find((u) => u._ === 'updateChannel') as any;\n return update.channel_id;\n });\n }\n\n public updateUsername(id: ChatId, username: string, doNotRefresh?: boolean) {\n const promise = this.apiManager.invokeApi('channels.updateUsername', {\n channel: this.getChannelInput(id),\n username\n });\n\n return this.refreshChatAfterRequest(id, promise, doNotRefresh);\n }\n\n public editPhoto(id: ChatId, inputFile: InputFile) {\n const inputChatPhoto: InputChatPhoto = {\n _: 'inputChatUploadedPhoto',\n file: inputFile\n };\n\n let promise: any;\n if(this.isChannel(id)) {\n promise = this.apiManager.invokeApi('channels.editPhoto', {\n channel: this.getChannelInput(id),\n photo: inputChatPhoto\n });\n } else {\n promise = this.apiManager.invokeApi('messages.editChatPhoto', {\n chat_id: id,\n photo: inputChatPhoto\n });\n }\n\n return promise.then(this.onChatUpdated.bind(this, id));\n }\n\n public editTitle(id: ChatId, title: string) {\n let promise: any;\n\n if(this.isChannel(id)) {\n promise = this.apiManager.invokeApi('channels.editTitle', {\n channel: this.getChannelInput(id),\n title\n });\n } else {\n promise = this.apiManager.invokeApi('messages.editChatTitle', {\n chat_id: id,\n title\n });\n }\n\n return promise.then(this.onChatUpdated.bind(this, id));\n }\n\n public editAbout(id: ChatId, about: string) {\n const peerId = id.toPeerId(true);\n return this.apiManager.invokeApi('messages.editChatAbout', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n about\n }).then((bool) => {\n if(bool) {\n this.rootScope.dispatchEvent('peer_bio_edit', peerId);\n }\n\n return bool;\n });\n }\n\n public async editBanned(id: ChatId, participant: PeerId | ChannelParticipant | ChatParticipant, banned_rights: ChatBannedRights) {\n const peerId = typeof(participant) !== 'object' ? participant : getParticipantPeerId(participant);\n const wasChannel = this.isChannel(id);\n if(!wasChannel) {\n const channelId = await this.migrateChat(id);\n id = channelId;\n }\n\n return this.apiManager.invokeApi('channels.editBanned', {\n channel: this.getChannelInput(id),\n participant: this.appPeersManager.getInputPeerById(peerId),\n banned_rights\n }).then((updates) => {\n this.onChatUpdated(id, updates);\n\n if(typeof(participant) === 'object') {\n const timestamp = tsNow(true);\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateChannelParticipant',\n channel_id: id,\n date: timestamp,\n actor_id: undefined,\n qts: undefined,\n user_id: peerId,\n prev_participant: wasChannel ? participant as ChannelParticipant : undefined,\n new_participant: Object.keys(banned_rights.pFlags).length ? {\n _: 'channelParticipantBanned',\n date: timestamp,\n banned_rights,\n kicked_by: this.appUsersManager.getSelf().id,\n peer: this.appPeersManager.getOutputPeer(peerId),\n pFlags: {}\n } : undefined\n });\n }\n });\n }\n\n public clearChannelParticipantBannedRights(id: ChatId, participant: PeerId | ChannelParticipant) {\n return this.editBanned(id, participant, {\n _: 'chatBannedRights',\n until_date: 0,\n pFlags: {}\n });\n }\n\n public kickFromChannel(id: ChatId, participant: PeerId | ChannelParticipant) {\n return this.editBanned(id, participant, {\n _: 'chatBannedRights',\n until_date: 0,\n pFlags: {\n view_messages: true\n }\n });\n }\n\n public kickFromChat(id: ChatId, participant: PeerId | ChannelParticipant | ChatParticipant) {\n if(this.isChannel(id)) return this.kickFromChannel(id, participant as ChannelParticipant);\n else return this.deleteChatUser(id, isObject(participant) ? getParticipantPeerId(participant) : (participant as PeerId).toUserId());\n }\n\n public resolveChannel(id: ChatId) {\n return this.apiManager.invokeApiSingle('channels.getChannels', {\n id: [{\n _: 'inputChannel',\n channel_id: id,\n access_hash: '0'\n }]\n }).then((messagesChats) => {\n this.saveApiChats(messagesChats.chats);\n });\n }\n\n public togglePreHistoryHidden(id: ChatId, enabled: boolean) {\n return this.migrateChat(id).then((channelId) => {\n return this.apiManager.invokeApi('channels.togglePreHistoryHidden', {\n channel: this.getChannelInput(channelId),\n enabled\n }).then(this.onChatUpdated.bind(this, channelId));\n });\n }\n\n public toggleSignatures(id: ChatId, enabled: boolean) {\n return this.apiManager.invokeApi('channels.toggleSignatures', {\n channel: this.getChannelInput(id),\n enabled\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public toggleNoForwards(id: ChatId, enabled: boolean) {\n return this.apiManager.invokeApi('messages.toggleNoForwards', {\n peer: this.getInputPeer(id),\n enabled\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public setChatAvailableReactions(id: ChatId, reactions: ChatReactions) {\n const chatFull = this.appProfileManager.getCachedFullChat(id);\n if(chatFull) {\n chatFull.available_reactions = reactions;\n this.rootScope.dispatchEvent('chat_full_update', id);\n }\n\n return this.apiManager.invokeApi('messages.setChatAvailableReactions', {\n peer: this.getInputPeer(id),\n available_reactions: reactions\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public getSendAs(channelId: ChatId) {\n return this.apiManager.invokeApiSingleProcess({\n method: 'channels.getSendAs',\n params: {\n peer: this.getChannelInputPeer(channelId)\n },\n processResult: (sendAsPeers) => {\n this.appUsersManager.saveApiUsers(sendAsPeers.users);\n this.saveApiChats(sendAsPeers.chats);\n\n return sendAsPeers.peers;\n }\n });\n }\n\n public importChatInvite(hash: string) {\n return this.apiManager.invokeApi('messages.importChatInvite', {hash})\n .then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n const chat = (updates as Updates.updates).chats[0];\n return chat.id;\n });\n }\n\n public checkUsername(chatId: ChatId, username: string) {\n return this.apiManager.invokeApi('channels.checkUsername', {\n channel: this.getChannelInput(chatId),\n username\n });\n }\n\n public getSponsoredMessage(chatId: ChatId) {\n // const s: MessagesSponsoredMessages.messagesSponsoredMessages = {\n // '_': 'messages.sponsoredMessages',\n // 'messages': [\n // {\n // '_': 'sponsoredMessage',\n // 'pFlags': {},\n // 'flags': 9,\n // 'random_id': new Uint8Array([\n // 80,\n // 5,\n // 249,\n // 174,\n // 44,\n // 73,\n // 173,\n // 14,\n // 246,\n // 81,\n // 187,\n // 182,\n // 223,\n // 5,\n // 4,\n // 128\n // ]),\n // 'from_id': {\n // '_': 'peerUser',\n // 'user_id': 983000232\n // },\n // 'start_param': 'GreatMinds',\n // 'message': 'This is a long sponsored message. In fact, it has the maximum length allowed on the platform – 160 characters 😬😬. It\\'s promoting a bot with a start parameter.' + chatId\n // }\n // ],\n // 'chats': [],\n // 'users': [\n // {\n // '_': 'user',\n // 'pFlags': {\n // 'bot': true,\n // 'verified': true,\n // 'apply_min_photo': true\n // },\n // 'flags': 34226219,\n // 'id': 983000232,\n // 'access_hash': '-294959558742535650',\n // 'first_name': 'Quiz Bot',\n // 'username': 'QuizBot',\n // 'photo': {\n // '_': 'userProfilePhoto',\n // 'pFlags': {},\n // 'flags': 2,\n // 'photo_id': '4221953848856651689',\n // 'stripped_thumb': new Uint8Array([\n // 1,\n // 8,\n // 8,\n // 155,\n // 247,\n // 95,\n // 103,\n // 255,\n // 0,\n // 110,\n // 138,\n // 40,\n // 174,\n // 132,\n // 142,\n // 6,\n // 238,\n // 127\n // ]),\n // 'dc_id': 2\n // },\n // 'bot_info_version': 11,\n // 'bot_inline_placeholder': 'Search a quiz...',\n // 'sortName': 'quiz bot'\n // }\n // ]\n // };\n\n // const promise = Promise.resolve(s);\n const promise = this.apiManager.invokeApiCacheable('channels.getSponsoredMessages', {\n channel: this.getChannelInput(chatId)\n }, {cacheSeconds: 300});\n\n return promise.then((sponsoredMessages) => {\n if(sponsoredMessages._ === 'messages.sponsoredMessages') {\n this.appUsersManager.saveApiUsers(sponsoredMessages.users);\n this.appChatsManager.saveApiChats(sponsoredMessages.chats);\n\n const sponsoredMessage = sponsoredMessages.messages.shift();\n sponsoredMessages.messages.push(sponsoredMessage);\n }\n\n return sponsoredMessages;\n });\n }\n\n public viewSponsoredMessage(chatId: ChatId, randomId: SponsoredMessage['random_id']) {\n return this.apiManager.invokeApiSingle('channels.viewSponsoredMessage', {\n channel: this.getChannelInput(chatId),\n random_id: randomId\n });\n }\n\n public checkChatInvite(hash: string) {\n return this.apiManager.invokeApi('messages.checkChatInvite', {\n hash: hash\n }).then((chatInvite) => {\n if((chatInvite as ChatInvite.chatInvitePeek).chat) {\n this.saveApiChat((chatInvite as ChatInvite.chatInvitePeek).chat, true);\n }\n\n return chatInvite;\n });\n }\n\n public toggleUsername(chatId: ChatId, username: string, active: boolean) {\n const promise = this.apiManager.invokeApi('channels.toggleUsername', {\n channel: this.getChannelInput(chatId),\n username,\n active\n });\n\n return this.refreshChatAfterRequest(chatId, promise);\n }\n\n public reorderUsernames(chatId: ChatId, order: string[]) {\n const promise = this.apiManager.invokeApi('channels.reorderUsernames', {\n channel: this.getChannelInput(chatId),\n order\n });\n\n return this.refreshChatAfterRequest(chatId, promise);\n }\n\n public deactivateAllUsernames(chatId: ChatId, doNotRefresh?: boolean) {\n const promise = this.apiManager.invokeApi('channels.deactivateAllUsernames', {\n channel: this.getChannelInput(chatId)\n });\n\n return this.refreshChatAfterRequest(chatId, promise, doNotRefresh);\n }\n\n public makeChannelPrivate(chatId: ChatId) {\n const promises: Promise[] = [\n this.updateUsername(chatId, '', true),\n this.deactivateAllUsernames(chatId, true)\n ];\n\n const promise = Promise.all(promises).then(() => true);\n return this.refreshChatAfterRequest(chatId, promise);\n }\n\n public refreshChatAfterRequest>(chatId: ChatId, promise: T, doNotRefresh?: boolean): T {\n if(doNotRefresh) {\n return promise;\n }\n\n return promise.then((value) => {\n return this.getChannels([chatId]).then(() => value);\n }) as T;\n }\n\n public getChannels(chatIds: ChatId[]) {\n return this.apiManager.invokeApi('channels.getChannels', {\n id: chatIds.map((chatId) => this.getChannelInput(chatId))\n }).then((messagesChats) => {\n this.saveApiChats(messagesChats.chats);\n });\n }\n\n public toggleForum(chatId: ChatId, enabled: boolean) {\n return this.migrateChat(chatId).then((channelId) => {\n return this.apiManager.invokeApi('channels.toggleForum', {\n channel: this.getChannelInput(channelId),\n enabled\n }).then(this.onChatUpdated.bind(this, channelId));\n });\n }\n\n public editForumTopic(options: {\n chatId: ChatId,\n topicId: number,\n title?: string,\n iconEmojiId?: DocId,\n closed?: boolean,\n hidden?: boolean\n }) {\n const {chatId, topicId, title, iconEmojiId, closed, hidden} = options;\n return this.apiManager.invokeApi('channels.editForumTopic', {\n channel: this.getChannelInput(chatId),\n topic_id: getServerMessageId(topicId),\n title,\n icon_emoji_id: iconEmojiId,\n closed,\n hidden\n }).then(this.onChatUpdated.bind(this, chatId));\n }\n\n public async createForumTopic(options: {\n chatId: ChatId,\n title: string,\n iconColor: number,\n iconEmojiId: DocId\n }) {\n const {chatId, title, iconColor, iconEmojiId} = options;\n\n const channelFull = await this.appProfileManager.getChannelFull(chatId);\n const sendAsInputPeer = channelFull.default_send_as && this.appPeersManager.getInputPeerById(this.appPeersManager.getPeerId(channelFull.default_send_as));\n\n return this.apiManager.invokeApi('channels.createForumTopic', {\n channel: this.getChannelInput(chatId),\n title,\n icon_color: iconColor,\n icon_emoji_id: iconEmojiId,\n random_id: randomLong(),\n send_as: sendAsInputPeer\n }).then((updates) => {\n this.onChatUpdated(chatId, updates);\n\n const update = (updates as Updates.updates).updates.find((update) => update._ === 'updateNewChannelMessage') as Update.updateNewChannelMessage;\n return generateMessageId(update.message.id);\n });\n }\n\n public updatePinnedForumTopic(chatId: ChatId, topicId: number, pinned: boolean) {\n return this.apiManager.invokeApi('channels.updatePinnedForumTopic', {\n channel: this.getChannelInput(chatId),\n topic_id: getServerMessageId(topicId),\n pinned\n }).then(this.onChatUpdated.bind(this, chatId));\n }\n\n private onUpdateChannelParticipant = (update: Update.updateChannelParticipant) => {\n this.apiManager.clearCache('channels.getParticipants', (params) => {\n return (params.channel as InputChannel.inputChannel).channel_id === update.channel_id;\n });\n\n this.rootScope.dispatchEvent('chat_participant', update);\n };\n\n private onUpdateChatDefaultBannedRights = (update: Update.updateChatDefaultBannedRights) => {\n const chatId = this.appPeersManager.getPeerId(update.peer).toChatId();\n const chat = this.chats[chatId] as Chat.chat;\n if(chat) {\n chat.default_banned_rights = update.default_banned_rights;\n this.rootScope.dispatchEvent('chat_update', chatId);\n }\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type lang from '../lang';\nimport type langSign from '../langSign';\nimport type {State} from '../config/state';\nimport DEBUG, {MOUNT_CLASS_TO} from '../config/debug';\nimport {HelpCountriesList, HelpCountry, LangPackDifference, LangPackString} from '../layer';\nimport stateStorage from './stateStorage';\nimport App from '../config/app';\nimport rootScope from './rootScope';\nimport {IS_MOBILE} from '../environment/userAgent';\nimport deepEqual from '../helpers/object/deepEqual';\nimport safeAssign from '../helpers/object/safeAssign';\nimport capitalizeFirstLetter from '../helpers/string/capitalizeFirstLetter';\nimport matchUrlProtocol from './richTextProcessor/matchUrlProtocol';\nimport wrapUrl from './richTextProcessor/wrapUrl';\nimport {setDirection} from '../helpers/dom/setInnerHTML';\n\nexport const langPack: {[actionType: string]: LangPackKey} = {\n 'messageActionChatCreate': 'ActionCreateGroup',\n 'messageActionChatCreateYou': 'ActionYouCreateGroup',\n 'messageActionChatEditTitle': 'ActionChangedTitle',\n 'messageActionChatEditPhoto': 'ActionChangedPhoto',\n 'messageActionChatEditVideo': 'ActionChangedVideo',\n 'messageActionChatDeletePhoto': 'ActionRemovedPhoto',\n 'messageActionChatReturn': 'ActionAddUserSelf',\n 'messageActionChatReturnYou': 'ActionAddUserSelfYou',\n 'messageActionChatJoined': 'ActionAddUserSelfMega',\n 'messageActionChatJoinedYou': 'ChannelMegaJoined',\n 'messageActionChatAddUser': 'ActionAddUser',\n 'messageActionChatAddUsers': 'ActionAddUser',\n 'messageActionChatLeave': 'ActionLeftUser',\n 'messageActionChatLeaveYou': 'YouLeft',\n 'messageActionChatDeleteUser': 'ActionKickUser',\n 'messageActionChatJoinedByLink': 'ActionInviteUser',\n 'messageActionPinMessage': 'Chat.Service.Group.UpdatedPinnedMessage',\n 'messageActionContactSignUp': 'Chat.Service.PeerJoinedTelegram',\n 'messageActionChannelCreate': 'ActionCreateChannel',\n 'messageActionChannelEditTitle': 'Chat.Service.Channel.UpdatedTitle',\n 'messageActionChannelEditPhoto': 'Chat.Service.Channel.UpdatedPhoto',\n 'messageActionChannelEditVideo': 'Chat.Service.Channel.UpdatedVideo',\n 'messageActionChannelDeletePhoto': 'Chat.Service.Channel.RemovedPhoto',\n 'messageActionHistoryClear': 'HistoryCleared',\n 'messageActionDiscussionStarted': 'DiscussionStarted',\n\n 'messageActionChannelMigrateFrom': 'ActionMigrateFromGroup',\n\n 'messageActionPhoneCall.video_in_ok': 'ChatList.Service.VideoCall.incoming',\n 'messageActionPhoneCall.video_out_ok': 'ChatList.Service.VideoCall.outgoing',\n 'messageActionPhoneCall.video_missed': 'ChatList.Service.VideoCall.Missed',\n 'messageActionPhoneCall.video_cancelled': 'ChatList.Service.VideoCall.Cancelled',\n 'messageActionPhoneCall.in_ok': 'ChatList.Service.Call.incoming',\n 'messageActionPhoneCall.out_ok': 'ChatList.Service.Call.outgoing',\n 'messageActionPhoneCall.missed': 'ChatList.Service.Call.Missed',\n 'messageActionPhoneCall.cancelled': 'ChatList.Service.Call.Cancelled',\n\n 'messageActionGroupCall.started': 'Chat.Service.VoiceChatStarted.Channel',\n 'messageActionGroupCall.started_by': 'Chat.Service.VoiceChatStarted',\n 'messageActionGroupCall.started_byYou': 'Chat.Service.VoiceChatStartedYou',\n 'messageActionGroupCall.ended': 'Chat.Service.VoiceChatFinished.Channel',\n 'messageActionGroupCall.ended_by': 'Chat.Service.VoiceChatFinished',\n 'messageActionGroupCall.ended_byYou': 'Chat.Service.VoiceChatFinishedYou',\n\n 'messageActionBotAllowed': 'Chat.Service.BotPermissionAllowed'\n};\n\nexport type LangPackKey = /* string | */keyof typeof lang | keyof typeof langSign;\n\nexport type FormatterArgument = string | number | Node | FormatterArgument[];\nexport type FormatterArguments = FormatterArgument[];\n\nexport const UNSUPPORTED_LANG_PACK_KEY: LangPackKey = IS_MOBILE ? 'Message.Unsupported.Mobile' : 'Message.Unsupported.Desktop';\n\nnamespace I18n {\n export const strings: Map = new Map();\n export const countriesList: HelpCountry[] = [];\n let pluralRules: Intl.PluralRules;\n\n let cacheLangPackPromise: Promise;\n export let lastRequestedLangCode: string;\n export let lastRequestedNormalizedLangCode: string;\n export let lastAppliedLangCode: string;\n export let requestedServerLanguage = false;\n export let timeFormat: State['settings']['timeFormat'];\n export let isRTL = false;\n\n export function setRTL(rtl: boolean) {\n isRTL = rtl;\n }\n\n function setLangCode(langCode: string) {\n lastRequestedLangCode = langCode;\n lastRequestedNormalizedLangCode = langCode.split('-')[0];\n }\n\n export function getCacheLangPack(): Promise {\n if(cacheLangPackPromise) return cacheLangPackPromise;\n return cacheLangPackPromise = Promise.all([\n stateStorage.get('langPack') as Promise,\n polyfillPromise\n ]).then(([langPack]) => {\n if(!langPack/* || true */) {\n return loadLocalLangPack();\n } else if(DEBUG && false) {\n return getLangPack(langPack.lang_code);\n }/* else if(langPack.appVersion !== App.langPackVersion) {\n return getLangPack(langPack.lang_code);\n } */\n\n if(!lastRequestedLangCode) {\n setLangCode(langPack.lang_code);\n }\n\n applyLangPack(langPack);\n return langPack;\n }).finally(() => {\n cacheLangPackPromise = undefined;\n });\n }\n\n function updateAmPm() {\n if(timeFormat === 'h12') {\n try {\n const dateTimeFormat = getDateTimeFormat({hour: 'numeric', minute: 'numeric', hour12: true});\n const date = new Date();\n date.setHours(0);\n const amText = dateTimeFormat.format(date);\n amPmCache.am = amText.split(/\\s/)[1];\n date.setHours(12);\n const pmText = dateTimeFormat.format(date);\n amPmCache.pm = pmText.split(/\\s/)[1];\n } catch(err) {\n console.error('cannot get am/pm', err);\n amPmCache = {am: 'AM', pm: 'PM'};\n }\n }\n }\n\n export function setTimeFormat(\n format: State['settings']['timeFormat'],\n haveToUpdate = !!timeFormat && timeFormat !== format\n ) {\n timeFormat = format;\n\n updateAmPm();\n\n if(haveToUpdate) {\n cachedDateTimeFormats.clear();\n const elements = Array.from(document.querySelectorAll(`.i18n`)) as HTMLElement[];\n elements.forEach((element) => {\n const instance = weakMap.get(element);\n\n if(instance instanceof IntlDateElement) {\n instance.update();\n }\n });\n }\n }\n\n export function loadLocalLangPack() {\n const defaultCode = App.langPackCode;\n setLangCode(defaultCode);\n return Promise.all([\n import('../lang'),\n import('../langSign'),\n import('../countries')\n ]).then(([lang, langSign, countries]) => {\n const strings: LangPackString[] = [];\n formatLocalStrings(lang.default, strings);\n formatLocalStrings(langSign.default, strings);\n\n const langPack: LangPackDifference = {\n _: 'langPackDifference',\n from_version: 0,\n lang_code: defaultCode,\n strings,\n version: 0,\n local: true,\n countries: countries.default\n };\n return saveLangPack(langPack);\n });\n }\n\n export function loadLangPack(langCode: string, web?: boolean) {\n web = true;\n requestedServerLanguage = true;\n const managers = rootScope.managers;\n return Promise.all([\n managers.apiManager.invokeApiCacheable('langpack.getLangPack', {\n lang_code: langCode,\n lang_pack: web ? 'web' : App.langPack\n }),\n !web && managers.apiManager.invokeApiCacheable('langpack.getLangPack', {\n lang_code: langCode,\n lang_pack: 'android'\n }),\n import('../lang'),\n import('../langSign'),\n managers.apiManager.invokeApiCacheable('help.getCountriesList', {\n lang_code: langCode,\n hash: 0\n }) as Promise,\n polyfillPromise\n ]);\n }\n\n export function getStrings(langCode: string, strings: string[]) {\n return rootScope.managers.apiManager.invokeApi('langpack.getStrings', {\n lang_pack: App.langPack,\n lang_code: langCode,\n keys: strings\n });\n }\n\n export function formatLocalStrings(strings: any, pushTo: LangPackString[] = []) {\n for(const i in strings) {\n // @ts-ignore\n const v = strings[i];\n if(typeof(v) === 'string') {\n pushTo.push({\n _: 'langPackString',\n key: i,\n value: v\n });\n } else {\n pushTo.push({\n _: 'langPackStringPluralized',\n key: i,\n ...v\n });\n }\n }\n\n return pushTo;\n }\n\n export function getLangPack(langCode: string, web?: boolean) {\n setLangCode(langCode);\n return loadLangPack(langCode, web).then(([langPack1, langPack2, localLangPack1, localLangPack2, countries, _]) => {\n let strings: LangPackString[] = [];\n\n [localLangPack1, localLangPack2].forEach((l) => {\n formatLocalStrings(l.default as any, strings);\n });\n\n strings = strings.concat(...[langPack1.strings, langPack2.strings].filter(Boolean));\n\n langPack1.strings = strings;\n langPack1.countries = countries;\n return saveLangPack(langPack1);\n });\n }\n\n export function saveLangPack(langPack: LangPackDifference) {\n langPack.appVersion = App.langPackVersion;\n\n return stateStorage.set({langPack}).then(() => {\n applyLangPack(langPack);\n return langPack;\n });\n }\n\n export const polyfillPromise = (function checkIfPolyfillNeeded() {\n if(typeof(Intl) !== 'undefined' && typeof(Intl.PluralRules) !== 'undefined'/* && false */) {\n return Promise.resolve();\n } else {\n return import('./pluralPolyfill').then((_Intl) => {\n (window as any).Intl = Object.assign(typeof(Intl) !== 'undefined' ? Intl : {}, _Intl.default);\n });\n }\n })();\n\n export function applyLangPack(langPack: LangPackDifference) {\n const currentLangCode = lastRequestedLangCode;\n if(langPack.lang_code !== currentLangCode) {\n return;\n }\n\n try {\n pluralRules = new Intl.PluralRules(lastRequestedNormalizedLangCode);\n } catch(err) {\n console.error('pluralRules error', err);\n pluralRules = new Intl.PluralRules(lastRequestedNormalizedLangCode.split('-', 1)[0]);\n }\n\n try {\n pluralRules = new Intl.PluralRules(langPack.lang_code);\n } catch(err) {\n console.error('pluralRules error', err);\n pluralRules = new Intl.PluralRules(langPack.lang_code.split('-', 1)[0]);\n }\n\n strings.clear();\n\n for(const string of langPack.strings) {\n strings.set(string.key as LangPackKey, string);\n }\n\n if(langPack.countries) {\n countriesList.length = 0;\n countriesList.push(...langPack.countries.countries);\n\n langPack.countries.countries.forEach((country) => {\n if(country.name) {\n const langPackKey: any = country.default_name;\n strings.set(langPackKey, {\n _: 'langPackString',\n key: langPackKey,\n value: country.name\n });\n }\n });\n }\n\n if(lastAppliedLangCode !== currentLangCode) {\n rootScope.dispatchEvent('language_change', currentLangCode);\n lastAppliedLangCode = currentLangCode;\n cachedDateTimeFormats.clear();\n updateAmPm();\n }\n\n const elements = Array.from(document.querySelectorAll(`.i18n`)) as HTMLElement[];\n elements.forEach((element) => {\n const instance = weakMap.get(element);\n\n if(instance) {\n instance.update();\n }\n });\n }\n\n function pushNextArgument(out: ReturnType, args: FormatterArguments, indexHolder: {i: number}) {\n const arg = args[indexHolder.i++];\n if(Array.isArray(arg)) {\n out.push(...arg as any);\n } else {\n out.push(arg);\n }\n }\n\n export function superFormatter(input: string, args?: FormatterArguments, indexHolder = {i: 0}): Exclude[] {\n const out: ReturnType = [];\n const regExp = /(\\*\\*|__)(.+?)\\1|(\\n)|(\\[.+?\\]\\(.*?\\))|un\\d|%\\d\\$.|%./g;\n\n let lastIndex = 0;\n input.replace(regExp, (match, p1: any, p2: any, p3: any, p4: string, offset: number, string: string) => {\n // console.table({match, p1, p2, offset, string});\n\n out.push(string.slice(lastIndex, offset));\n\n if(p1) {\n // offset += p1.length;\n let element: HTMLElement;\n switch(p1) {\n case '**': {\n element = document.createElement('b');\n break;\n }\n\n case '__': {\n element = document.createElement('i');\n break;\n }\n }\n\n element.append(...superFormatter(p2, args, indexHolder) as any);\n out.push(element);\n } else if(p3) {\n out.push(document.createElement('br'));\n } else if(p4) {\n const idx = p4.lastIndexOf(']');\n const text = p4.slice(1, idx);\n\n const url = p4.slice(idx + 2, p4.length - 1);\n let a: HTMLAnchorElement;\n if(url && matchUrlProtocol(url)) {\n a = document.createElement('a');\n const wrappedUrl = wrapUrl(url);\n a.href = wrappedUrl.url;\n if(wrappedUrl.onclick) a.setAttribute('onclick', wrappedUrl.onclick);\n a.target = '_blank';\n } else {\n a = args[indexHolder.i++] as HTMLAnchorElement;\n\n if(a instanceof DocumentFragment) { // right after wrapRichText\n a = a.firstChild as any;\n }\n\n if(typeof(a) !== 'string') {\n a.textContent = ''; // reset content\n }\n }\n\n const formatted = superFormatter(text, args, indexHolder) as any;\n if(typeof(a) === 'string') {\n out.push(...formatted);\n } else {\n a.append(...formatted);\n out.push(a);\n }\n } else if(args) {\n pushNextArgument(out, args, indexHolder);\n }\n\n lastIndex = offset + match.length;\n return '';\n });\n\n if(lastIndex !== input.length) {\n out.push(input.slice(lastIndex));\n }\n\n return out;\n }\n\n export function format(key: LangPackKey, plain: true, args?: FormatterArguments): string;\n export function format(key: LangPackKey, plain?: false, args?: FormatterArguments): ReturnType;\n export function format(key: LangPackKey, plain = false, args?: FormatterArguments): ReturnType | string {\n const str = strings.get(key);\n let input: string;\n if(str) {\n if(str._ === 'langPackStringPluralized' && args?.length) {\n let v = args[0] as number | string;\n if(typeof(v) === 'string') v = +v.replace(/\\D/g, '');\n const s = pluralRules.select(v);\n // @ts-ignore\n input = str[s + '_value'] || str['other_value'];\n } else if(str._ === 'langPackString') {\n input = str.value;\n } else {\n // input = '[' + key + ']';\n input = key;\n }\n } else {\n // input = '[' + key + ']';\n input = key;\n }\n\n const result = superFormatter(input, args);\n if(plain) { // * let's try a hack now... (don't want to replace []() entity)\n return result.map((item) => item instanceof Node ? item.textContent : item).join('');\n } else {\n return result;\n }\n\n /* if(plain) {\n if(args?.length) {\n const regExp = /un\\d|%\\d\\$.|%./g;\n let i = 0;\n input = input.replace(regExp, (match, offset, string) => {\n return '' + args[i++];\n });\n }\n\n return input;\n } else {\n return superFormatter(input, args);\n } */\n }\n\n export const weakMap: WeakMap> = new WeakMap();\n\n export type IntlElementBaseOptions = {\n element?: HTMLElement,\n property?: 'innerText' | 'innerHTML' | 'placeholder' | 'textContent',\n };\n\n abstract class IntlElementBase {\n public element: IntlElementBaseOptions['element'];\n public property: IntlElementBaseOptions['property'];\n\n constructor(options?: Options) {\n this.element = options?.element || document.createElement('span');\n this.element.classList.add('i18n');\n\n this.property = options?.property;\n if(options && ((options as any as IntlElementOptions).key || (options as any as IntlDateElementOptions).date)) {\n this.update(options);\n }\n\n weakMap.set(this.element, this);\n }\n\n abstract update(options?: Options): void;\n }\n\n export type IntlElementOptions = IntlElementBaseOptions & {\n key?: LangPackKey,\n args?: FormatterArguments\n };\n export class IntlElement extends IntlElementBase {\n public key: IntlElementOptions['key'];\n public args: IntlElementOptions['args'];\n\n constructor(options: IntlElementOptions = {}) {\n super({...options, property: options.property ?? 'innerHTML'});\n }\n\n public update(options?: IntlElementOptions) {\n safeAssign(this, options);\n\n if(this.property === 'innerHTML') {\n this.element.textContent = '';\n this.element.append(...format(this.key, false, this.args) as any);\n } else {\n // @ts-ignore\n const v = this.element[this.property];\n const formatted = format(this.key, true, this.args);\n\n // * hasOwnProperty won't work here\n if(v === undefined) this.element.dataset[this.property] = formatted;\n else (this.element as HTMLInputElement)[this.property] = formatted;\n }\n }\n\n public compareAndUpdate(options?: IntlElementOptions) {\n if(this.key === options.key && deepEqual(this.args, options.args)) {\n return;\n }\n\n return this.update(options);\n }\n }\n\n const cachedDateTimeFormats: Map = new Map();\n function getDateTimeFormat(options: Intl.DateTimeFormatOptions = {}) {\n const json = JSON.stringify(options);\n let dateTimeFormat = cachedDateTimeFormats.get(json);\n if(!dateTimeFormat) {\n dateTimeFormat = new Intl.DateTimeFormat(lastRequestedNormalizedLangCode + '-u-hc-' + timeFormat, options);\n cachedDateTimeFormats.set(json, dateTimeFormat);\n }\n\n return dateTimeFormat;\n }\n\n export let amPmCache = {am: 'AM', pm: 'PM'};\n export type IntlDateElementOptions = IntlElementBaseOptions & {\n date?: Date,\n options: Intl.DateTimeFormatOptions\n };\n export class IntlDateElement extends IntlElementBase {\n public date: IntlDateElementOptions['date'];\n public options: IntlDateElementOptions['options'];\n\n constructor(options: IntlDateElementOptions) {\n super({...options, property: options.property ?? 'textContent'});\n setDirection(this.element);\n }\n\n public update(options?: IntlDateElementOptions) {\n safeAssign(this, options);\n\n let text: string;\n if(this.options.hour && this.options.minute && Object.keys(this.options).length === 2/* && false */) {\n const hours = this.date.getHours();\n text = ('0' + (timeFormat === 'h12' ? (hours % 12) || 12 : hours)).slice(-2) + ':' + ('0' + this.date.getMinutes()).slice(-2);\n // if(this.options.second) {\n // text += ':' + ('0' + this.date.getSeconds()).slice(-2);\n // }\n\n if(timeFormat === 'h12') {\n text += ' ' + (hours < 12 ? amPmCache.am : amPmCache.pm);\n }\n } else {\n // * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle#adding_an_hour_cycle_via_the_locale_string\n const dateTimeFormat = getDateTimeFormat(this.options);\n text = capitalizeFirstLetter(dateTimeFormat.format(this.date));\n }\n\n (this.element as any)[this.property] = text;\n }\n }\n\n export function i18n(key: LangPackKey, args?: FormatterArguments) {\n return new IntlElement({key, args}).element;\n }\n\n export function i18n_(options: IntlElementOptions) {\n return new IntlElement(options).element;\n }\n\n export function _i18n(element: HTMLElement, key: LangPackKey, args?: FormatterArguments, property?: IntlElementOptions['property']) {\n return new IntlElement({element, key, args, property}).element;\n }\n}\n\nexport {I18n};\nexport default I18n;\n\nconst i18n = I18n.i18n;\nexport {i18n};\n\nconst i18n_ = I18n.i18n_;\nexport {i18n_};\n\nconst _i18n = I18n._i18n;\nexport {_i18n};\n\nexport function joinElementsWith(elements: (Node | string)[], joiner: typeof elements[0] | ((isLast: boolean) => typeof elements[0])) {\n const arr = elements.slice(0, 1);\n for(let i = 1; i < elements.length; ++i) {\n const isLast = (elements.length - 1) === i;\n arr.push(typeof(joiner) === 'function' ? joiner(isLast) : joiner);\n arr.push(elements[i]);\n }\n\n return arr;\n}\n\n\nexport function join(elements: (Node | string)[], useLast: boolean, plain: true): string;\nexport function join(elements: (Node | string)[], useLast?: boolean, plain?: false): (string | Node)[];\nexport function join(elements: (Node | string)[], useLast: boolean, plain: boolean): string | (string | Node)[];\nexport function join(elements: (Node | string)[], useLast = true, plain?: boolean): string | (string | Node)[] {\n const joined = joinElementsWith(elements, (isLast) => {\n const langPackKey: LangPackKey = isLast && useLast ? 'AutoDownloadSettings.LastDelimeter' : 'AutoDownloadSettings.Delimeter';\n return plain ? I18n.format(langPackKey, true) : i18n(langPackKey);\n });\n\n return plain ? joined.join('') : joined;\n}\n\nMOUNT_CLASS_TO.I18n = I18n;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type addAnchorListener from '../../helpers/addAnchorListener';\nimport {PHONE_NUMBER_REG_EXP} from '.';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport matchUrlProtocol from './matchUrlProtocol';\nimport {T_ME_PREFIXES} from '../mtproto/mtproto_config';\n\nexport default function wrapUrl(url: string, unsafe?: number | boolean) {\n if(!matchUrlProtocol(url)) {\n url = 'https://' + url;\n }\n\n const out: {url: string, onclick?: Parameters[0]['name']} = {url};\n let tgMeMatch, telescoPeMatch, tgMatch;\n let onclick: typeof out['onclick'];\n /* if(unsafe === 2) {\n url = 'tg://unsafe_url?url=' + encodeURIComponent(url);\n } else */if((tgMeMatch = url.match(/^(?:https?:\\/\\/)?(?:(.+?)\\.)?(?:(?:web|k|z)\\.)?t(?:elegram)?\\.me(?:\\/(.+))?/))) {\n const u = new URL(url);\n let prefix = tgMeMatch[1];\n if(prefix && T_ME_PREFIXES.has(tgMeMatch[1])) {\n prefix = undefined;\n }\n\n if(prefix) {\n u.pathname = prefix + (u.pathname === '/' ? '' : u.pathname);\n }\n\n const fullPath = u.pathname.slice(1);\n const path = fullPath.split('/');\n\n if(path[0] && path[0][0] === '$' && path[0].length > 1) {\n onclick = 'invoice';\n } else if(/^\\W/.test(fullPath) && !PHONE_NUMBER_REG_EXP.test(fullPath)) { // second regexp is for phone numbers (t.me/+38050...)\n onclick = 'joinchat';\n } else switch(path[0]) {\n case 'joinchat':\n case 'addstickers':\n case 'addemoji':\n case 'voicechat':\n case 'invoice':\n if(path.length !== 1 && !prefix) {\n onclick = path[0];\n break;\n }\n\n default:\n if((path[1] && path[1].match(/^\\d+(?:\\?(?:comment|thread)=\\d+)?$/)) || path.length === 1) {\n onclick = 'im';\n break;\n }\n\n break;\n }\n } else if((telescoPeMatch = url.match(/^(?:https?:\\/\\/)?telesco\\.pe\\/([^/?]+)\\/(\\d+)/))) {\n onclick = 'im';\n } else if((tgMatch = url.match(/tg:(?:\\/\\/)?(.+?)(?:\\?|$)/))) {\n onclick = 'tg_' + tgMatch[1] as any;\n }/* else if(unsafe) {\n url = 'tg://unsafe_url?url=' + encodeURIComponent(url);\n } */\n\n if(!(window as any)[onclick]) {\n onclick = undefined;\n }\n\n out.onclick = onclick;\n return out;\n}\n\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.wrapUrl = wrapUrl);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import I18n from '../../lib/langPack';\n\nexport default function setInnerHTML(elem: Element, html: string | DocumentFragment | Element) {\n setDirection(elem);\n if(typeof(html) === 'string') {\n if(!html) elem.replaceChildren();\n else elem.innerHTML = html;\n } else {\n elem.replaceChildren(html);\n }\n}\n\nexport function setDirection(elem: Element) {\n // if(!I18n.isRTL) {\n elem.setAttribute('dir', 'auto');\n // }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport I18n, {i18n} from '../lib/langPack';\n\nexport const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\nexport const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n\nexport const ONE_DAY = 86400;\n\n// https://stackoverflow.com/a/6117889\nexport const getWeekNumber = (date: Date) => {\n const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));\n const dayNum = d.getUTCDay() || 7;\n d.setUTCDate(d.getUTCDate() + 4 - dayNum);\n const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));\n return Math.ceil((((d.getTime() - yearStart.getTime()) / ONE_DAY) + 1) / 7);\n};\n\nexport function formatDateAccordingToTodayNew(time: Date) {\n const today = new Date();\n const now = today.getTime() / 1000 | 0;\n const timestamp = time.getTime() / 1000 | 0;\n\n const options: Intl.DateTimeFormatOptions = {};\n if((now - timestamp) < ONE_DAY && today.getDate() === time.getDate()) { // if the same day\n options.hour = options.minute = '2-digit';\n } else if(today.getFullYear() !== time.getFullYear()) { // different year\n options.year = options.day = 'numeric';\n options.month = '2-digit';\n } else if((now - timestamp) < (ONE_DAY * 7) && getWeekNumber(today) === getWeekNumber(time)) { // current week\n options.weekday = 'short';\n } else { // same year\n options.month = 'short';\n options.day = 'numeric';\n }\n\n return new I18n.IntlDateElement({\n date: time,\n options\n }).element;\n}\n\nexport function formatFullSentTimeRaw(timestamp: number, options: {\n capitalize?: boolean\n} = {}) {\n const date = new Date();\n const time = new Date(timestamp * 1000);\n const now = date.getTime() / 1000;\n\n const timeEl = formatTime(time);\n\n let dateEl: Node | string;\n if((now - timestamp) < ONE_DAY && date.getDate() === time.getDate()) { // if the same day\n dateEl = i18n(options.capitalize ? 'Date.Today' : 'Peer.Status.Today');\n } else if((now - timestamp) < (ONE_DAY * 2) && (date.getDate() - 1) === time.getDate()) { // yesterday\n dateEl = i18n(options.capitalize ? 'Yesterday' : 'Peer.Status.Yesterday');\n\n if(options.capitalize) {\n (dateEl as HTMLElement).style.textTransform = 'capitalize';\n }\n } else if(date.getFullYear() !== time.getFullYear()) { // different year\n dateEl = new I18n.IntlDateElement({\n date: time,\n options: {\n month: 'short',\n day: 'numeric',\n year: 'numeric'\n }\n }).element;\n // dateStr = months[time.getMonth()].slice(0, 3) + ' ' + time.getDate() + ', ' + time.getFullYear();\n } else {\n dateEl = new I18n.IntlDateElement({\n date: time,\n options: {\n month: 'short',\n day: 'numeric'\n }\n }).element;\n // dateStr = months[time.getMonth()].slice(0, 3) + ' ' + time.getDate();\n }\n\n return {dateEl, timeEl};\n}\n\nexport function formatFullSentTime(timestamp: number) {\n const {dateEl, timeEl} = formatFullSentTimeRaw(timestamp, {\n capitalize: true\n });\n\n const fragment = document.createDocumentFragment();\n fragment.append(dateEl, ' ', i18n('ScheduleController.at'), ' ', timeEl);\n return fragment;\n}\n\nexport function formatTime(date: Date) {\n return new I18n.IntlDateElement({\n date,\n options: {\n hour: '2-digit',\n minute: '2-digit'\n }\n }).element;\n}\n\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.formatDateAccordingToTodayNew = formatDateAccordingToTodayNew);\n\nexport const getFullDate = (date: Date, options: Partial<{\n noTime: true,\n noSeconds: true,\n monthAsNumber: true,\n leadingZero: true\n}> = {}) => {\n const joiner = options.monthAsNumber ? '.' : ' ';\n const time = ('0' + date.getHours()).slice(-2) + ':' + ('0' + date.getMinutes()).slice(-2) + (options.noSeconds ? '' : ':' + ('0' + date.getSeconds()).slice(-2));\n\n return (options.leadingZero ? ('0' + date.getDate()).slice(-2) : date.getDate()) +\n joiner + (options.monthAsNumber ? ('0' + (date.getMonth() + 1)).slice(-2) : months[date.getMonth()]) +\n joiner + date.getFullYear() +\n (options.noTime ? '' : ', ' + time);\n};\n\n// https://github.com/DrKLO/Telegram/blob/d52b2c921abd3c1e8d6368858313ad0cb0468c07/TMessagesProj/src/main/java/org/telegram/ui/Adapters/FiltersView.java\nconst minYear = 2013;\nconst yearPattern = new RegExp('20[0-9]{1,2}');\nconst monthYearOrDayPattern = new RegExp('(\\\\w{3,}) ([0-9]{0,4})', 'i');\nconst yearOrDayAndMonthPattern = new RegExp('([0-9]{0,4}) (\\\\w{2,})', 'i');\nconst shortDate = new RegExp('^([0-9]{1,4})(\\\\.| |/|\\\\-)([0-9]{1,4})$', 'i');\nconst longDate = new RegExp('^([0-9]{1,2})(\\\\.| |/|\\\\-)([0-9]{1,2})(\\\\.| |/|\\\\-)([0-9]{1,4})$', 'i');\nconst numberOfDaysEachMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nexport type DateData = {\n title: string,\n minDate: number,\n maxDate: number,\n};\nexport function fillTipDates(query: string, dates: DateData[]) {\n const q = query.trim().toLowerCase();\n\n if(q.length < 3) {\n return;\n }\n\n if('today'.indexOf(q) === 0) {\n const date = new Date();\n const year = date.getFullYear();\n const month = date.getMonth();\n const day = date.getDate();\n date.setFullYear(year, month, day);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: 'Today',\n minDate,\n maxDate\n });\n return;\n }\n\n if('yesterday'.indexOf(q) === 0) {\n const date = new Date();\n const year = date.getFullYear();\n const month = date.getMonth();\n const day = date.getDate();\n date.setFullYear(year, month, day);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime() - 86400000;\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 86400001;\n dates.push({\n title: 'Yesterday',\n minDate,\n maxDate\n });\n return;\n }\n\n const dayOfWeek = getDayOfWeek(q);\n if(dayOfWeek >= 0) {\n const date = new Date();\n const now = date.getTime();\n const currentDay = date.getDay();\n const distance = dayOfWeek - currentDay;\n date.setDate(date.getDate() + distance);\n if(date.getTime() > now) {\n date.setTime(date.getTime() - 604800000);\n }\n const year = date.getFullYear()\n const month = date.getMonth();\n const day = date.getDate();\n date.setFullYear(year, month, day);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: formatWeekLong(minDate),\n minDate,\n maxDate\n });\n return;\n }\n\n let matches: any[];\n if((matches = shortDate.exec(q)) !== null) {\n const g1 = matches[1];\n const g2 = matches[3];\n const k = parseInt(g1);\n const k1 = parseInt(g2);\n if(k > 0 && k <= 31) {\n if(k1 >= minYear && k <= 12) {\n const selectedYear = k1;\n const month = k - 1;\n createForMonthYear(dates, month, selectedYear);\n return;\n } else if(k1 <= 12) {\n const day = k - 1;\n const month = k1 - 1;\n createForDayMonth(dates, day, month);\n }\n } else if(k >= minYear && k1 <= 12) {\n const selectedYear = k;\n const month = k1 - 1;\n createForMonthYear(dates, month, selectedYear);\n }\n\n return;\n }\n\n if((matches = longDate.exec(q)) !== null) {\n const g1 = matches[1];\n const g2 = matches[3];\n const g3 = matches[5];\n if(!matches[2] === matches[4]) {\n return;\n }\n\n const day = parseInt(g1);\n const month = parseInt(g2) - 1;\n let year = parseInt(g3);\n if(year >= 10 && year <= 99) {\n year += 2000;\n }\n\n const currentYear = new Date().getFullYear();\n if(validDateForMonth(day - 1, month) && year >= minYear && year <= currentYear) {\n const date = new Date();\n date.setFullYear(year, month, day);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: formatterYearMax(minDate),\n minDate,\n maxDate\n });\n return;\n }\n\n return;\n }\n\n if((matches = yearPattern.exec(q)) !== null) {\n let selectedYear = +q;\n const currentYear = new Date().getFullYear();\n if(selectedYear < minYear) {\n selectedYear = minYear;\n for(let i = currentYear; i >= selectedYear; i--) {\n const date = new Date();\n date.setFullYear(i, 0, 1);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(i + 1, 0, 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: '' + i,\n minDate,\n maxDate\n });\n }\n } else if(selectedYear <= currentYear) {\n const date = new Date();\n date.setFullYear(selectedYear, 0, 1);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(selectedYear + 1, 0, 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: '' + selectedYear,\n minDate,\n maxDate\n });\n }\n\n return;\n }\n\n if((matches = monthYearOrDayPattern.exec(q)) !== null) {\n const g1 = matches[1];\n const g2 = matches[2];\n const month = getMonth(g1);\n if(month >= 0) {\n const k = +g2;\n if(k > 0 && k <= 31) {\n const day = k - 1;\n createForDayMonth(dates, day, month);\n return;\n } else if(k >= minYear) {\n const selectedYear = k;\n createForMonthYear(dates, month, selectedYear);\n return;\n }\n }\n }\n\n if((matches = yearOrDayAndMonthPattern.exec(q)) !== null) {\n const g1 = matches[1];\n const g2 = matches[2];\n const month = getMonth(g2);\n if(month >= 0) {\n const k = +g1;\n if(k > 0 && k <= 31) {\n const day = k - 1;\n createForDayMonth(dates, day, month);\n return;\n } else if(k >= minYear) {\n const selectedYear = k;\n createForMonthYear(dates, month, selectedYear);\n }\n }\n }\n}\n\nfunction createForMonthYear(dates: DateData[], month: number, selectedYear: number) {\n const currentYear = new Date().getFullYear();\n const today = Date.now();\n if(selectedYear >= minYear && selectedYear <= currentYear) {\n const date = new Date();\n date.setFullYear(selectedYear, month, 1);\n date.setHours(0, 0, 0);\n const minDate = date.getTime();\n if(minDate > today) {\n return;\n }\n date.setMonth(date.getMonth() + 1);\n const maxDate = date.getTime() - 1;\n\n dates.push({\n title: formatterMonthYear(minDate),\n minDate,\n maxDate\n });\n }\n}\n\nfunction createForDayMonth(dates: DateData[], day: number, month: number) {\n if(validDateForMonth(day, month)) {\n const currentYear = new Date().getFullYear();\n const today = Date.now();\n\n for(let i = currentYear; i >= minYear; i--) {\n if(month === 1 && day === 28 && !isLeapYear(i)) {\n continue;\n }\n\n const date = new Date();\n date.setFullYear(i, month, day + 1);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n if(minDate > today) {\n continue;\n }\n\n date.setFullYear(i, month, day + 2);\n date.setHours(0, 0, 0);\n const maxDate = date.getTime() - 1;\n if(i === currentYear) {\n dates.push({\n title: formatterDayMonth(minDate),\n minDate,\n maxDate\n });\n } else {\n dates.push({\n title: formatterYearMax(minDate),\n minDate,\n maxDate\n });\n }\n }\n }\n}\n\nfunction formatterMonthYear(timestamp: number) {\n const date = new Date(timestamp);\n return months[date.getMonth()].slice(0, 3) + ' ' + date.getFullYear();\n}\n\nfunction formatterDayMonth(timestamp: number) {\n const date = new Date(timestamp);\n return months[date.getMonth()].slice(0, 3) + ' ' + date.getDate();\n}\n\nfunction formatterYearMax(timestamp: number) {\n const date = new Date(timestamp);\n return ('0' + date.getDate()).slice(-2) + '.' + ('0' + (date.getMonth() + 1)).slice(-2) + '.' + date.getFullYear();\n}\n\nfunction formatWeekLong(timestamp: number) {\n const date = new Date(timestamp);\n return days[date.getDay()];\n}\n\nfunction validDateForMonth(day: number, month: number) {\n if(month >= 0 && month < 12) {\n if(day >= 0 && day < numberOfDaysEachMonth[month]) {\n return true;\n }\n }\n return false;\n}\n\nfunction isLeapYear(year: number) {\n return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0);\n}\n\nfunction getMonth(q: string) {\n /* String[] months = new String[]{\n LocaleController.getString(\"January\", R.string.January).toLowerCase(),\n LocaleController.getString(\"February\", R.string.February).toLowerCase(),\n LocaleController.getString(\"March\", R.string.March).toLowerCase(),\n LocaleController.getString(\"April\", R.string.April).toLowerCase(),\n LocaleController.getString(\"May\", R.string.May).toLowerCase(),\n LocaleController.getString(\"June\", R.string.June).toLowerCase(),\n LocaleController.getString(\"July\", R.string.July).toLowerCase(),\n LocaleController.getString(\"August\", R.string.August).toLowerCase(),\n LocaleController.getString(\"September\", R.string.September).toLowerCase(),\n LocaleController.getString(\"October\", R.string.October).toLowerCase(),\n LocaleController.getString(\"November\", R.string.November).toLowerCase(),\n LocaleController.getString(\"December\", R.string.December).toLowerCase()\n }; */\n\n /* String[] monthsEng = new String[12];\n Calendar c = Calendar.getInstance();\n for (int i = 1; i <= 12; i++) {\n c.set(0, 0, 0, 0, 0, 0);\n c.set(Calendar.MONTH, i);\n monthsEng[i - 1] = c.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.ENGLISH).toLowerCase();\n } */\n\n q = q.toLowerCase();\n for(let i = 0; i < 12; i++) {\n const month = months[i].toLowerCase();\n if(month.indexOf(q) === 0) {\n return i;\n }\n }\n return -1;\n}\n\nfunction getDayOfWeek(q: string) {\n const c = new Date();\n if(q.length <= 3) {\n return -1;\n }\n\n for(let i = 0; i < 7; i++) {\n c.setDate(c.getDate() + 1);\n\n if(formatWeekLong(c.getTime()).toLowerCase().indexOf(q) === 0) {\n return c.getDay();\n }\n }\n return -1;\n}\n\nMOUNT_CLASS_TO.fillTipDates = fillTipDates;\n","/**\n * Will be used for FILE_REFERENCE_EXPIRED\n * @param key\n * @param wasObject\n * @param newObject\n */\nexport default function safeReplaceArrayInObject(key: K, wasObject: any, newObject: any) {\n if('byteLength' in newObject[key]) { // Uint8Array\n newObject[key] = [...newObject[key]];\n }\n\n if(wasObject && wasObject[key] !== newObject[key]) {\n wasObject[key].length = newObject[key].length;\n (newObject[key] as any[]).forEach((v, i) => {\n wasObject[key][i] = v;\n });\n\n /* wasObject[key].set(newObject[key]); */\n newObject[key] = wasObject[key];\n }\n}\n","export const EXTENSION_MIME_TYPE_MAP: {[ext in MTFileExtension]: MTMimeType} = {\n pdf: 'application/pdf',\n tgv: 'application/x-tgwallpattern',\n tgs: 'application/x-tgsticker',\n json: 'application/json',\n wav: 'audio/wav',\n mp3: 'audio/mpeg',\n ogg: 'audio/ogg',\n jpeg: 'image/jpeg',\n jpg: 'image/jpeg',\n png: 'image/png',\n gif: 'image/gif',\n webp: 'image/webp',\n mp4: 'video/mp4',\n webm: 'video/webm',\n mov: 'video/quicktime',\n svg: 'image/svg+xml'\n};\n\nexport const MIME_TYPE_EXTENSION_MAP: {[mimeType in MTMimeType]?: MTFileExtension} = {};\n\nfor(const ext in EXTENSION_MIME_TYPE_MAP) {\n MIME_TYPE_EXTENSION_MAP[EXTENSION_MIME_TYPE_MAP[ext as MTFileExtension]] = ext as MTFileExtension;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {ThumbCache} from '../storages/thumbs';\nimport {AccountWallPapers, Document, DocumentAttribute, MessagesSavedGifs, PhotoSize, WallPaper} from '../../layer';\nimport {ReferenceContext} from '../mtproto/referenceDatabase';\nimport {getFullDate} from '../../helpers/date';\nimport isObject from '../../helpers/object/isObject';\nimport safeReplaceArrayInObject from '../../helpers/object/safeReplaceArrayInObject';\nimport {AppManager} from './manager';\nimport wrapPlainText from '../richTextProcessor/wrapPlainText';\nimport assumeType from '../../helpers/assumeType';\nimport {getEnvironment} from '../../environment/utils';\nimport {isServiceWorkerOnline} from '../mtproto/mtproto.worker';\nimport MTProtoMessagePort from '../mtproto/mtprotoMessagePort';\nimport getDocumentInputFileLocation from './utils/docs/getDocumentInputFileLocation';\nimport getDocumentURL from './utils/docs/getDocumentURL';\nimport makeError from '../../helpers/makeError';\nimport {EXTENSION_MIME_TYPE_MAP} from '../../environment/mimeTypeMap';\nimport {THUMB_TYPE_FULL} from '../mtproto/mtproto_config';\nimport tsNow from '../../helpers/tsNow';\n\nexport type MyDocument = Document.document;\n\n// TODO: если залить картинку файлом, а потом перезайти в диалог - превьюшка заново скачается\n\ntype WallPaperId = WallPaper.wallPaper['id'];\n\nlet uploadWallPaperTempId = 0;\n\nexport class AppDocsManager extends AppManager {\n private docs: {[docId: DocId]: MyDocument};\n\n private stickerCachedThumbs: {[docId: DocId]: {[toneIndex: number]: {url: string, w: number, h: number}}};\n\n private uploadingWallPapers: {[id: WallPaperId]: {cacheContext: ThumbCache, file: File}};\n\n protected after() {\n this.docs = {};\n this.stickerCachedThumbs = {};\n this.uploadingWallPapers = {};\n\n MTProtoMessagePort.getInstance().addEventListener('serviceWorkerOnline', (online) => {\n if(!online) {\n this.onServiceWorkerFail();\n }\n });\n }\n\n private onServiceWorkerFail = () => {\n for(const id in this.docs) {\n const doc = this.docs[id];\n\n if(doc.supportsStreaming) {\n delete doc.supportsStreaming;\n this.thumbsStorage.deleteCacheContext(doc);\n }\n }\n };\n\n public saveDoc(doc: Document, context?: ReferenceContext): MyDocument {\n if(!doc || doc._ === 'documentEmpty') {\n return;\n }\n\n const oldDoc = this.docs[doc.id];\n\n if(doc.file_reference) { // * because we can have a new object w/o the file_reference while sending\n safeReplaceArrayInObject('file_reference', oldDoc, doc);\n this.referenceDatabase.saveContext(doc.file_reference, context);\n }\n\n // console.log('saveDoc', apiDoc, this.docs[apiDoc.id]);\n // if(oldDoc) {\n // //if(doc._ !== 'documentEmpty' && doc._ === d._) {\n // if(doc.thumbs) {\n // if(!oldDoc.thumbs) oldDoc.thumbs = doc.thumbs;\n // /* else if(apiDoc.thumbs[0].bytes && !d.thumbs[0].bytes) {\n // d.thumbs.unshift(apiDoc.thumbs[0]);\n // } else if(d.thumbs[0].url) { // fix for converted thumb in safari\n // apiDoc.thumbs[0] = d.thumbs[0];\n // } */\n // }\n\n // //}\n\n // return oldDoc;\n\n // //return Object.assign(d, apiDoc, context);\n // //return context ? Object.assign(d, context) : d;\n // }\n\n if(!oldDoc) {\n this.docs[doc.id] = doc;\n }\n\n // * exclude from state\n // defineNotNumerableProperties(doc, [/* 'thumbs', */'type', 'h', 'w', 'file_name',\n // 'file', 'duration', 'downloaded', 'url', 'audioTitle',\n // 'audioPerformer', 'sticker', 'stickerEmoji', 'stickerEmojiRaw',\n // 'stickerSetInput', 'stickerThumbConverted', 'animated', 'supportsStreaming']);\n\n for(let i = 0, length = doc.attributes.length; i < length; ++i) {\n const attribute = doc.attributes[i];\n switch(attribute._) {\n case 'documentAttributeFilename': {\n doc.file_name = wrapPlainText(attribute.file_name);\n break;\n }\n\n case 'documentAttributeAudio': {\n if(doc.type === 'round') {\n break;\n }\n\n doc.duration = attribute.duration;\n doc.type = attribute.pFlags.voice && doc.mime_type === 'audio/ogg' ? 'voice' : 'audio';\n break;\n }\n\n case 'documentAttributeVideo': {\n doc.duration = attribute.duration;\n doc.w = attribute.w;\n doc.h = attribute.h;\n // apiDoc.supportsStreaming = attribute.pFlags?.supports_streaming/* && apiDoc.size > 524288 */;\n if(/* apiDoc.thumbs && */attribute.pFlags.round_message) {\n doc.type = 'round';\n } else /* if(apiDoc.thumbs) */ {\n doc.type = 'video';\n }\n break;\n }\n\n case 'documentAttributeCustomEmoji':\n case 'documentAttributeSticker': {\n if(attribute.alt !== undefined) {\n doc.stickerEmojiRaw = attribute.alt;\n }\n\n if(attribute.stickerset) {\n if(attribute.stickerset._ === 'inputStickerSetEmpty') {\n delete attribute.stickerset;\n } else if(attribute.stickerset._ === 'inputStickerSetID') {\n doc.stickerSetInput = attribute.stickerset;\n }\n }\n\n // * there can be no thumbs, then it is a document\n if(/* apiDoc.thumbs && */doc.mime_type === 'image/webp' && (doc.thumbs || getEnvironment().IS_WEBP_SUPPORTED)) {\n doc.type = 'sticker';\n doc.sticker = 1;\n } else if(doc.mime_type === 'video/webm') {\n if(!getEnvironment().IS_WEBM_SUPPORTED) {\n break;\n }\n\n doc.type = 'sticker';\n doc.sticker = 3;\n doc.animated = true;\n }\n break;\n }\n\n case 'documentAttributeImageSize': {\n doc.type = 'photo';\n doc.w = attribute.w;\n doc.h = attribute.h;\n break;\n }\n\n case 'documentAttributeAnimated': {\n if((doc.mime_type === 'image/gif' || doc.mime_type === 'video/mp4')/* && apiDoc.thumbs */) {\n doc.type = 'gif';\n }\n\n doc.animated = true;\n break;\n }\n }\n }\n\n if(!doc.mime_type) {\n const ext = (doc.file_name || '').split('.').pop();\n // @ts-ignore\n const mappedMimeType = ext && EXTENSION_MIME_TYPE_MAP[ext.toLowerCase()];\n if(mappedMimeType) {\n doc.mime_type = mappedMimeType;\n } else {\n switch(doc.type) {\n case 'gif':\n case 'video':\n case 'round':\n doc.mime_type = 'video/mp4';\n break;\n case 'sticker':\n doc.mime_type = 'image/webp';\n break;\n case 'audio':\n doc.mime_type = 'audio/mpeg';\n break;\n case 'voice':\n doc.mime_type = 'audio/ogg';\n break;\n default:\n doc.mime_type = 'application/octet-stream';\n break;\n }\n }\n } else if(doc.mime_type === EXTENSION_MIME_TYPE_MAP.pdf) {\n doc.type = 'pdf';\n } else if(doc.mime_type === EXTENSION_MIME_TYPE_MAP.gif) {\n doc.type = 'gif';\n } else if(doc.mime_type === 'application/x-tgsticker' && doc.file_name === 'AnimatedSticker.tgs') {\n doc.type = 'sticker';\n doc.animated = true;\n doc.sticker = 2;\n }\n\n if(doc.type === 'voice' || doc.type === 'round') {\n // browser will identify extension\n const attribute = doc.attributes.find((attribute) => attribute._ === 'documentAttributeFilename') as DocumentAttribute.documentAttributeFilename;\n const ext = attribute && attribute.file_name.split('.').pop();\n const date = getFullDate(new Date(doc.date * 1000), {monthAsNumber: true, leadingZero: true}).replace(/[:\\.]/g, '-').replace(', ', '_');\n doc.file_name = `${doc.type}_${date}${ext ? '.' + ext : ''}`;\n }\n\n if(isServiceWorkerOnline() && ((doc.type === 'gif' && doc.size > 8e6) || doc.type === 'audio' || doc.type === 'video')/* || doc.mime_type.indexOf('video/') === 0 */) {\n doc.supportsStreaming = true;\n\n const cacheContext = this.thumbsStorage.getCacheContext(doc);\n if(!cacheContext.url) {\n this.thumbsStorage.setCacheContextURL(doc, undefined, getDocumentURL(doc), 0);\n }\n } else {\n doc.supportsStreaming = false;\n }\n\n // for testing purposes\n // doc.supportsStreaming = false;\n // doc.url = ''; // * this will break upload urls\n\n doc.file_name ||= '';\n\n /* if(!doc.url) {\n doc.url = this.getFileURL(doc);\n } */\n\n if(oldDoc) {\n return Object.assign(oldDoc, doc);\n }\n\n return doc;\n }\n\n public getDoc(docId: DocId | MyDocument): MyDocument {\n return isObject(docId) ? docId : this.docs[docId];\n }\n\n public downloadDoc(doc: MyDocument, queueId?: number, onlyCache?: boolean) {\n return this.apiFileManager.downloadMedia({\n media: doc,\n queueId,\n onlyCache\n });\n }\n\n public getLottieCachedThumb(docId: DocId, toneIndex: number) {\n const cached = this.stickerCachedThumbs[docId];\n return cached && cached[toneIndex];\n }\n\n public saveLottiePreview(docId: DocId, blob: Blob, width: number, height: number, toneIndex: number) {\n const doc = this.getDoc(docId);\n if(!doc) {\n return;\n }\n\n const cached = this.stickerCachedThumbs[doc.id] ??= {};\n\n const thumb = cached[toneIndex];\n if(thumb && thumb.w >= width && thumb.h >= height) {\n return;\n }\n\n cached[toneIndex] = {\n url: URL.createObjectURL(blob),\n w: width,\n h: height\n };\n }\n\n public saveWebPConvertedStrippedThumb(docId: DocId, bytes: Uint8Array) {\n const doc = this.getDoc(docId);\n if(!doc) {\n return;\n }\n\n const thumb = doc.thumbs && doc.thumbs.find((thumb) => thumb._ === 'photoStrippedSize') as PhotoSize.photoStrippedSize;\n if(!thumb) {\n return;\n }\n\n doc.pFlags.stickerThumbConverted = true;\n thumb.bytes = bytes;\n }\n\n public prepareWallPaperUpload(file: File) {\n const id = 'wallpaper-upload-' + ++uploadWallPaperTempId;\n\n const thumb = {\n _: 'photoSize',\n h: 0,\n w: 0,\n location: {} as any,\n size: file.size,\n type: THUMB_TYPE_FULL\n } as PhotoSize.photoSize;\n let document: MyDocument = {\n _: 'document',\n access_hash: '',\n attributes: [],\n dc_id: 0,\n file_reference: [],\n id,\n mime_type: file.type as MTMimeType,\n size: file.size,\n date: tsNow(true),\n pFlags: {},\n thumbs: [thumb],\n file_name: file.name\n };\n\n document = this.saveDoc(document);\n\n const cacheContext = this.thumbsStorage.setCacheContextURL(document, undefined, URL.createObjectURL(file), file.size);\n\n const wallpaper: WallPaper.wallPaper = {\n _: 'wallPaper',\n access_hash: '',\n document: document,\n id,\n slug: id,\n pFlags: {}\n };\n\n this.uploadingWallPapers[id] = {\n cacheContext,\n file\n };\n\n return wallpaper;\n }\n\n public uploadWallPaper(id: WallPaperId) {\n const {cacheContext, file} = this.uploadingWallPapers[id];\n delete this.uploadingWallPapers[id];\n\n const upload = this.apiFileManager.upload({file, fileName: file.name});\n return upload.then((inputFile) => {\n return this.apiManager.invokeApi('account.uploadWallPaper', {\n file: inputFile,\n mime_type: file.type,\n settings: {\n _: 'wallPaperSettings',\n pFlags: {}\n }\n }).then((wallPaper) => {\n assumeType(wallPaper);\n wallPaper.document = this.saveDoc(wallPaper.document);\n this.thumbsStorage.setCacheContextURL(wallPaper.document, undefined, cacheContext.url, cacheContext.downloaded);\n\n return wallPaper;\n });\n });\n }\n\n public getGifs() {\n return this.apiManager.invokeApiHashable({\n method: 'messages.getSavedGifs',\n processResult: (res) => {\n assumeType(res);\n return res.gifs.map((doc) => this.saveDoc(doc));\n }\n });\n }\n\n public requestDocPart(docId: DocId, dcId: number, offset: number, limit: number) {\n const doc = this.getDoc(docId);\n if(!doc) return Promise.reject(makeError('NO_DOC'));\n return this.apiFileManager.requestFilePart(dcId, getDocumentInputFileLocation(doc), offset, limit);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {FileURLType, getFileURL} from '../../../../helpers/fileName';\nimport {Document, PhotoSize} from '../../../../layer';\nimport getDocumentDownloadOptions from './getDocumentDownloadOptions';\n\nexport default function getDocumentURL(doc: Document.document, download = false, thumb?: PhotoSize.photoSize) {\n let type: FileURLType;\n if(download) {\n type = 'download';\n } else if(thumb) {\n type = 'thumb';\n } else if(doc.supportsStreaming) {\n type = 'stream';\n } else {\n type = 'document';\n }\n\n return getFileURL(type, getDocumentDownloadOptions(doc, thumb));\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {MessageEntity, DraftMessage, MessagesSaveDraft} from '../../layer';\nimport tsNow from '../../helpers/tsNow';\nimport stateStorage from '../stateStorage';\nimport assumeType from '../../helpers/assumeType';\nimport {AppManager} from './manager';\nimport generateMessageId from './utils/messageId/generateMessageId';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\nimport draftsAreEqual from './utils/drafts/draftsAreEqual';\n\nexport type MyDraftMessage = DraftMessage.draftMessage;\n\nexport class AppDraftsManager extends AppManager {\n private drafts: {[peerIdAndThreadId: string]: MyDraftMessage} = {};\n private getAllDraftPromise: Promise;\n\n protected after() {\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateDraftMessage: (update) => {\n const peerId = this.appPeersManager.getPeerId(update.peer);\n this.saveDraft({\n peerId,\n threadId: update.threadId,\n draft: update.draft,\n notify: true\n });\n }\n });\n\n /* return */stateStorage.get('drafts').then((drafts) => {\n this.drafts = drafts || {};\n });\n }\n\n private getKey(peerId: PeerId, threadId?: number) {\n return '' + peerId + (threadId ? '_' + threadId : '');\n }\n\n public getDraft(peerId: PeerId, threadId?: number) {\n return this.drafts[this.getKey(peerId, threadId)];\n }\n\n public addMissedDialogs() {\n return this.getAllDrafts().then(() => {\n for(const key in this.drafts) {\n if(key.indexOf('_') !== -1) { // exclude threads\n continue;\n }\n\n const peerId = key.toPeerId();\n const dialog = this.appMessagesManager.getDialogOnly(peerId);\n if(!dialog) {\n this.appMessagesManager.reloadConversation(peerId);\n /* const dialog = appMessagesManager.generateDialog(peerId);\n dialog.draft = this.drafts[key];\n appMessagesManager.saveConversation(dialog);\n appMessagesManager.newDialogsToHandle[peerId] = dialog;\n appMessagesManager.scheduleHandleNewDialogs(); */\n }\n }\n });\n }\n\n private getAllDrafts() {\n return this.getAllDraftPromise ??= this.apiManager.invokeApi('messages.getAllDrafts')\n .then((updates) => {\n const p = this.apiUpdatesManager.updatesState.syncLoading || Promise.resolve();\n p.then(() => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n });\n });\n }\n\n public saveDraft({peerId, threadId, draft: apiDraft, notify, force}: {\n peerId: PeerId,\n threadId?: number,\n draft: DraftMessage,\n notify?: boolean,\n force?: boolean\n }) {\n const draft = this.processApiDraft(apiDraft);\n\n const key = this.getKey(peerId, threadId);\n if(draft) {\n this.drafts[key] = draft;\n } else {\n delete this.drafts[key];\n }\n\n stateStorage.set({\n drafts: this.drafts\n });\n\n if(notify) {\n // console.warn(dT(), 'save draft', peerId, apiDraft, options)\n this.rootScope.dispatchEvent('draft_updated', {\n peerId,\n threadId,\n draft,\n force\n });\n }\n\n return draft;\n }\n\n private isEmptyDraft(draft: DraftMessage) {\n if(draft?._ !== 'draftMessage') {\n return true;\n }\n\n if(draft.reply_to_msg_id !== undefined && draft.reply_to_msg_id > 0) {\n return false;\n }\n\n if(!draft.message.length) {\n return true;\n }\n\n return false;\n }\n\n private processApiDraft(draft: DraftMessage): MyDraftMessage {\n if(!draft || draft._ !== 'draftMessage') {\n return undefined;\n }\n\n if(draft.reply_to_msg_id) {\n draft.reply_to_msg_id = generateMessageId(draft.reply_to_msg_id);\n }\n\n return draft;\n }\n\n public syncDraft(peerId: PeerId, threadId: number, localDraft?: DraftMessage, saveOnServer = true, force = false) {\n // console.warn(dT(), 'sync draft', peerID)\n const serverDraft = this.getDraft(peerId, threadId);\n if(draftsAreEqual(serverDraft, localDraft)) {\n // console.warn(dT(), 'equal drafts', localDraft, serverDraft)\n return true;\n }\n\n // console.warn(dT(), 'changed draft', localDraft, serverDraft)\n const params: MessagesSaveDraft = {\n peer: this.appPeersManager.getInputPeerById(peerId),\n message: ''\n };\n\n let draftObj: DraftMessage;\n if(this.isEmptyDraft(localDraft)) {\n draftObj = {_: 'draftMessageEmpty'};\n } else {\n assumeType(localDraft);\n const message = localDraft.message;\n const entities: MessageEntity[] = localDraft.entities;\n\n if(localDraft.reply_to_msg_id) {\n params.reply_to_msg_id = getServerMessageId(localDraft.reply_to_msg_id);\n }\n\n if(entities?.length) {\n params.entities = this.appMessagesManager.getInputEntities(entities);\n }\n\n if(localDraft.pFlags.no_webpage) {\n params.no_webpage = localDraft.pFlags.no_webpage;\n }\n\n params.message = message;\n }\n\n if(threadId) {\n params.top_msg_id = getServerMessageId(threadId);\n }\n\n const saveLocalDraft = draftObj || localDraft;\n saveLocalDraft.date = tsNow(true) + this.timeManager.getServerTimeOffset();\n\n this.saveDraft({\n peerId,\n threadId,\n draft: saveLocalDraft,\n notify: true,\n force\n });\n\n if(saveOnServer) {\n return this.apiManager.invokeApi('messages.saveDraft', params);\n }\n\n return true;\n }\n\n public clearAllDrafts() {\n return this.apiManager.invokeApi('messages.clearAllDrafts').then((bool) => {\n if(!bool) {\n return;\n }\n\n for(const combined in this.drafts) {\n const [peerId, threadId] = combined.split('_');\n this.rootScope.dispatchEvent('draft_updated', {\n peerId: peerId.toPeerId(),\n threadId: threadId ? +threadId : undefined,\n draft: undefined\n });\n }\n });\n }\n\n public clearDraft(peerId: PeerId, threadId: number) {\n const emptyDraft: DraftMessage.draftMessageEmpty = {\n _: 'draftMessageEmpty'\n };\n\n if(threadId) {\n this.syncDraft(peerId, threadId, emptyDraft as any, false, true);\n } else {\n this.saveDraft({\n peerId,\n threadId,\n draft: emptyDraft,\n notify: true,\n force: true\n });\n }\n }\n\n public setDraft(peerId: PeerId, threadId: number, message: string, entities?: MessageEntity[]) {\n const draft: DraftMessage.draftMessage = {\n _: 'draftMessage',\n date: tsNow(true),\n message,\n pFlags: {},\n entities\n };\n\n if(threadId) {\n this.syncDraft(peerId, threadId, draft, false, true);\n } else {\n this.saveDraft({\n peerId,\n threadId,\n draft,\n notify: true,\n force: true\n });\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from './appDocsManager';\nimport App from '../../config/app';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport isObject from '../../helpers/object/isObject';\nimport validateInitObject from '../../helpers/object/validateInitObject';\nimport fixEmoji from '../richTextProcessor/fixEmoji';\nimport SearchIndex from '../searchIndex';\nimport stateStorage from '../stateStorage';\nimport {AppManager} from './manager';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport pause from '../../helpers/schedulers/pause';\n\ntype EmojiLangPack = {\n keywords: {\n [keyword: string]: string[],\n },\n version: number,\n langCode: string\n};\n\nconst EMOJI_LANG_PACK: EmojiLangPack = {\n keywords: {},\n version: 0,\n langCode: App.langPackCode\n};\n\nconst RECENT_MAX_LENGTH = 32;\n\ntype EmojiType = 'native' | 'custom';\n\nexport class AppEmojiManager extends AppManager {\n private static POPULAR_EMOJI = ['😂', '😘', '❤️', '😍', '😊', '😁', '👍', '☺️', '😔', '😄', '😭', '💋', '😒', '😳', '😜', '🙈', '😉', '😃', '😢', '😝', '😱', '😡', '😏', '😞', '😅', '😚', '🙊', '😌', '😀', '😋', '😆', '👌', '😐', '😕'];\n private keywordLangPacks: {\n [langCode: string]: EmojiLangPack\n } = {};\n\n private index: SearchIndex;\n private indexedLangPacks: {[langCode: string]: boolean} = {};\n\n private getKeywordsPromises: {[langCode: string]: Promise} = {};\n\n private recent: {native?: string[], custom?: DocId[]} = {};\n private getRecentEmojisPromises: {native?: Promise, custom?: Promise} = {};\n\n private getCustomEmojiDocumentsPromise: Promise;\n private getCustomEmojiDocumentPromises: Map> = new Map();\n\n /* public getPopularEmoji() {\n return stateStorage.get('emojis_popular').then((popEmojis) => {\n var result = []\n if (popEmojis && popEmojis.length) {\n for (var i = 0, len = popEmojis.length; i < len; i++) {\n result.push({code: popEmojis[i][0], rate: popEmojis[i][1]})\n }\n callback(result)\n return\n }\n\n return stateStorage.get('emojis_recent').then((recentEmojis) => {\n recentEmojis = recentEmojis || popular || []\n var shortcut\n var code\n for (var i = 0, len = recentEmojis.length; i < len; i++) {\n shortcut = recentEmojis[i]\n if (Array.isArray(shortcut)) {\n shortcut = shortcut[0]\n }\n if (shortcut && typeof shortcut === 'string') {\n if (shortcut.charAt(0) == ':') {\n shortcut = shortcut.substr(1, shortcut.length - 2)\n }\n if (code = shortcuts[shortcut]) {\n result.push({code: code, rate: 1})\n }\n }\n }\n callback(result)\n });\n });\n }\n\n function pushPopularEmoji (code) {\n getPopularEmoji(function (popularEmoji) {\n var exists = false\n var count = popularEmoji.length\n var result = []\n for (var i = 0; i < count; i++) {\n if (popularEmoji[i].code == code) {\n exists = true\n popularEmoji[i].rate++\n }\n result.push([popularEmoji[i].code, popularEmoji[i].rate])\n }\n if (exists) {\n result.sort(function (a, b) {\n return b[1] - a[1]\n })\n } else {\n if (result.length > 41) {\n result = result.slice(0, 41)\n }\n result.push([code, 1])\n }\n ConfigStorage.set({emojis_popular: result})\n })\n } */\n\n public getEmojiKeywords(langCode: string = App.langPackCode) {\n const promise = this.getKeywordsPromises[langCode];\n if(promise) {\n return promise;\n }\n\n const storageKey: any = 'emojiKeywords_' + langCode;\n return this.getKeywordsPromises[langCode] = stateStorage.get(storageKey).then((pack: EmojiLangPack) => {\n if(!isObject(pack)) {\n pack = {} as any;\n }\n\n validateInitObject(EMOJI_LANG_PACK, pack);\n\n // important\n pack.langCode = langCode;\n this.keywordLangPacks[langCode] = pack;\n\n return this.apiManager.invokeApi('messages.getEmojiKeywordsDifference', {\n lang_code: pack.langCode,\n from_version: pack.version\n }).then((keywordsDifference) => {\n pack.version = keywordsDifference.version;\n\n const packKeywords = pack.keywords;\n const keywords = keywordsDifference.keywords;\n for(let i = 0, length = keywords.length; i < length; ++i) {\n const {keyword, emoticons} = keywords[i];\n packKeywords[keyword] = emoticons;\n }\n\n stateStorage.set({\n [storageKey]: pack\n });\n\n return pack;\n }, () => {\n return pack;\n });\n });\n }\n\n public getBothEmojiKeywords() {\n const promises: Promise[] = [\n this.getEmojiKeywords()\n ];\n\n if(this.networkerFactory.language !== App.langPackCode) {\n promises.push(this.getEmojiKeywords(this.networkerFactory.language));\n }\n\n if(!this.recent.native) {\n promises.push(this.getRecentEmojis('native'));\n }\n\n return Promise.all(promises);\n }\n\n private indexEmojis() {\n if(!this.index) {\n this.index = new SearchIndex(undefined, 2);\n }\n\n for(const langCode in this.keywordLangPacks) {\n if(this.indexedLangPacks[langCode]) {\n continue;\n }\n\n const pack = this.keywordLangPacks[langCode];\n const keywords = pack.keywords;\n\n for(const keyword in keywords) {\n const emoticons = keywords[keyword];\n this.index.indexObject(emoticons, keyword);\n }\n\n this.indexedLangPacks[langCode] = true;\n }\n }\n\n public searchEmojis(q: string) {\n this.indexEmojis();\n\n q = q.toLowerCase().replace(/_/g, ' ');\n\n // const perf = performance.now();\n let emojis: Array;\n if(q.trim()) {\n const set = this.index.search(q);\n emojis = Array.from(set).reduce((acc, v) => acc.concat(v), []);\n } else {\n emojis = this.recent.native.concat(AppEmojiManager.POPULAR_EMOJI).slice(0, RECENT_MAX_LENGTH);\n }\n\n emojis = Array.from(new Set(emojis));\n // console.log('searchEmojis', q, 'time', performance.now() - perf);\n\n /* for(let i = 0, length = emojis.length; i < length; ++i) {\n if(emojis[i].includes(zeroWidthJoiner) && !emojis[i].includes('\\ufe0f')) {\n emojis[i] += '\\ufe0f';\n }\n } */\n\n return emojis;\n }\n\n public getRecentEmojis(type: 'custom'): Promise;\n public getRecentEmojis(type: 'native'): Promise;\n public getRecentEmojis(type: T): Promise {\n const promises = this.getRecentEmojisPromises;\n return promises[type] ??= this.appStateManager.getState().then((state) => {\n let recent: string[] | DocId[] = [];\n if(type === 'native') {\n const {recentEmoji} = state;\n recent = Array.isArray(recentEmoji) && recentEmoji.length ? recentEmoji : AppEmojiManager.POPULAR_EMOJI;\n } else {\n const {recentCustomEmoji} = state;\n recent = Array.isArray(recentCustomEmoji) && recentCustomEmoji.length ? recentCustomEmoji : [];\n }\n\n return this.recent[type] = recent as any;\n }) as any;\n }\n\n public pushRecentEmoji(emoji: AppEmoji) {\n const type: EmojiType = emoji.docId ? 'custom' : 'native';\n emoji.emoji = fixEmoji(emoji.emoji);\n // @ts-ignore\n this.getRecentEmojis(type).then((recent) => {\n const i = emoji.docId || emoji.emoji;\n indexOfAndSplice(recent, i);\n recent.unshift(i);\n recent.splice(RECENT_MAX_LENGTH, recent.length - RECENT_MAX_LENGTH);\n\n this.appStateManager.pushToState(type === 'custom' ? 'recentCustomEmoji' : 'recentEmoji', recent);\n this.rootScope.dispatchEvent('emoji_recent', emoji);\n });\n }\n\n public getCustomEmojiDocuments(docIds: DocId[]) {\n if(!docIds.length) return Promise.resolve([] as MyDocument[]);\n return this.apiManager.invokeApi('messages.getCustomEmojiDocuments', {document_id: docIds}).then((documents) => {\n return documents.map((doc) => {\n return this.appDocsManager.saveDoc(doc, {\n type: 'customEmoji',\n docId: doc.id\n });\n });\n });\n }\n\n public getCachedCustomEmojiDocuments(docIds: DocId[]) {\n return docIds.map((docId) => this.appDocsManager.getDoc(docId));\n }\n\n private setDebouncedGetCustomEmojiDocuments() {\n if(this.getCustomEmojiDocumentsPromise || !this.getCustomEmojiDocumentPromises.size) {\n return;\n }\n\n this.getCustomEmojiDocumentsPromise = pause(0).then(() => {\n const allIds = [...this.getCustomEmojiDocumentPromises.keys()];\n const promises: Promise[] = [];\n do {\n const ids = allIds.splice(0, 100);\n const promise = this.getCustomEmojiDocuments(ids).then((docs) => {\n docs.forEach((doc, idx) => {\n const docId = ids[idx];\n const deferred = this.getCustomEmojiDocumentPromises.get(docId);\n this.getCustomEmojiDocumentPromises.delete(docId);\n deferred.resolve(doc);\n });\n });\n\n promises.push(promise);\n } while(allIds.length);\n\n return Promise.all(promises);\n }).finally(() => {\n this.getCustomEmojiDocumentsPromise = undefined;\n this.setDebouncedGetCustomEmojiDocuments();\n });\n }\n\n public getCustomEmojiDocument(id: DocId) {\n let promise = this.getCustomEmojiDocumentPromises.get(id);\n if(promise) {\n return promise;\n }\n\n const doc = this.appDocsManager.getDoc(id);\n if(doc) {\n return doc;\n }\n\n promise = deferredPromise();\n this.getCustomEmojiDocumentPromises.set(id, promise);\n\n this.setDebouncedGetCustomEmojiDocuments();\n\n return promise;\n }\n\n public getCustomEmojis() {\n return this.appStickersManager.getEmojiStickers();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport type GroupCallConnectionInstance from '../calls/groupCallConnectionInstance';\nimport safeReplaceObject from '../../helpers/object/safeReplaceObject';\nimport {nextRandomUint} from '../../helpers/random';\nimport {DataJSON, GroupCall, GroupCallParticipant, GroupCallParticipantVideoSourceGroup, InputGroupCall, PhoneJoinGroupCall, PhoneJoinGroupCallPresentation, Update, Updates} from '../../layer';\nimport {logger} from '../logger';\nimport {NULL_PEER_ID} from '../mtproto/mtproto_config';\nimport {AppManager} from './manager';\nimport getPeerId from './utils/peers/getPeerId';\n\nexport type GroupCallId = GroupCall['id'];\nexport type MyGroupCall = GroupCall | InputGroupCall;\n\nexport type GroupCallConnectionType = 'main' | 'presentation';\n\nexport type JoinGroupCallJsonPayload = {\n fingerprints: {\n fingerprint: string;\n setup: string;\n hash: string;\n }[];\n pwd: string;\n ssrc: number;\n 'ssrc-groups': GroupCallParticipantVideoSourceGroup.groupCallParticipantVideoSourceGroup[];\n ufrag: string;\n};\n\nconst GET_PARTICIPANTS_LIMIT = 100;\n\nexport type GroupCallOutputSource = 'main' | 'presentation' | number;\n\nexport class AppGroupCallsManager extends AppManager {\n private log: ReturnType;\n\n private groupCalls: Map;\n private participants: Map>;\n private nextOffsets: Map;\n\n // private doNotDispatchParticipantUpdate: PeerId;\n\n protected after() {\n this.log = logger('GROUP-CALLS');\n\n this.groupCalls = new Map();\n this.participants = new Map();\n this.nextOffsets = new Map();\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateGroupCall: (update) => {\n this.saveGroupCall(update.call, update.chat_id);\n },\n\n updateGroupCallParticipants: (update) => {\n this.saveGroupCall(update.call);\n\n // this.getGroupCallFull(update.call.id, true); // ! WARNING TEMP\n\n const groupCallId = update.call.id;\n this.saveApiParticipants(groupCallId, update.participants);\n }\n });\n\n this.rootScope.addEventListener('group_call_update', (groupCall) => {\n if(groupCall._ === 'groupCallDiscarded') {\n this.participants.delete(groupCall.id);\n }\n });\n }\n\n public getCachedParticipants(groupCallId: GroupCallId) {\n let participants = this.participants.get(groupCallId);\n if(!participants) {\n this.participants.set(groupCallId, participants = new Map());\n }\n\n return participants;\n }\n\n private prepareToSavingNextOffset(groupCallId: GroupCallId) {\n const nextOffsetsMap = this.nextOffsets;\n\n const setNextOffset = (newNextOffset: string) => {\n if(nextOffsetsMap.get(groupCallId) === nextOffset) {\n nextOffsetsMap.set(groupCallId, newNextOffset);\n }\n };\n\n const nextOffset = nextOffsetsMap.get(groupCallId);\n return {\n nextOffset,\n setNextOffset\n };\n }\n\n public saveApiParticipant(groupCallId: GroupCallId, participant: GroupCallParticipant, skipCounterUpdating?: boolean) {\n const participants = this.getCachedParticipants(groupCallId);\n\n const peerId = getPeerId(participant.peer);\n\n const oldParticipant = participants.get(peerId);\n const hasLeft = participant.pFlags.left;\n if(!oldParticipant && hasLeft) {\n return;\n }\n\n // * fix missing flag\n if(!participant.pFlags.muted && !participant.pFlags.can_self_unmute) {\n participant.pFlags.can_self_unmute = true;\n }\n\n if(oldParticipant) {\n safeReplaceObject(oldParticipant, participant);\n participant = oldParticipant;\n } else {\n participants.set(peerId, participant);\n }\n\n // if(!skipCounterUpdating) {\n const groupCall = this.getGroupCall(groupCallId);\n if(groupCall?._ === 'groupCall') {\n let modified = false;\n if(hasLeft) {\n --groupCall.participants_count;\n modified = true;\n } else if(participant.pFlags.just_joined && !oldParticipant && !participant.pFlags.self) {\n ++groupCall.participants_count;\n modified = true;\n }\n\n if(modified) {\n this.rootScope.dispatchEvent('group_call_update', groupCall);\n }\n }\n // }\n\n if(hasLeft) {\n participants.delete(peerId);\n }\n\n if(oldParticipant || true/* && this.doNotDispatchParticipantUpdate !== peerId */) {\n this.rootScope.dispatchEvent('group_call_participant', {\n groupCallId,\n participant\n });\n }\n }\n\n public saveApiParticipants(groupCallId: GroupCallId, apiParticipants: GroupCallParticipant[], skipCounterUpdating?: boolean) {\n if((apiParticipants as any).saved) return;\n (apiParticipants as any).saved = true;\n apiParticipants.forEach((p) => this.saveApiParticipant(groupCallId, p, skipCounterUpdating));\n }\n\n public async editParticipant(groupCallId: GroupCallId, participant: GroupCallParticipant, options: Partial<{\n muted: boolean,\n volume: number,\n raiseHand: boolean,\n videoStopped: boolean,\n videoPaused: boolean,\n presentationPaused: boolean\n }>) {\n this.saveApiParticipant(groupCallId, participant);\n\n const peerId = participant.pFlags.self ? NULL_PEER_ID : getPeerId(participant.peer);\n const updates = await this.apiManager.invokeApiSingle('phone.editGroupCallParticipant', {\n call: this.getGroupCallInput(groupCallId),\n participant: peerId === NULL_PEER_ID ? this.appPeersManager.getInputPeerSelf() : this.appPeersManager.getInputPeerById(peerId),\n muted: options.muted,\n volume: options.volume,\n raise_hand: options.raiseHand,\n video_paused: options.videoPaused,\n video_stopped: options.videoStopped,\n presentation_paused: options.presentationPaused\n });\n\n // do not replace with peerId because it can be null\n // if(!processUpdate) this.doNotDispatchParticipantUpdate = getPeerId(participant.peer);\n this.apiUpdatesManager.processUpdateMessage(updates);\n // if(!processUpdate) this.doNotDispatchParticipantUpdate = undefined;\n }\n\n public getGroupCall(id: GroupCallId) {\n return this.groupCalls.get(id);\n }\n\n public async getGroupCallFull(id: GroupCallId, override?: boolean): Promise {\n const call = this.getGroupCall(id);\n if(call && call._ !== 'inputGroupCall' && !override) {\n return call;\n }\n\n const limit = this.getCachedParticipants(id).size ? 0 : GET_PARTICIPANTS_LIMIT;\n return this.apiManager.invokeApiSingleProcess({\n method: 'phone.getGroupCall',\n params: {\n call: this.getGroupCallInput(id),\n limit\n },\n processResult: (groupCall) => {\n // ? maybe I should save group call after participants so I can avoid passing the 'skipCounterUpdating' flag ?\n this.appUsersManager.saveApiUsers(groupCall.users);\n this.appChatsManager.saveApiChats(groupCall.chats);\n this.saveApiParticipants(id, groupCall.participants, true);\n const call = this.saveGroupCall(groupCall.call) as GroupCall;\n\n if(limit && this.nextOffsets.get(id) === undefined) {\n this.nextOffsets.set(id, groupCall.participants_next_offset);\n }\n\n return call;\n }\n });\n }\n\n public saveGroupCall(call: MyGroupCall, chatId?: ChatId) {\n const oldCall = this.groupCalls.get(call.id);\n const shouldUpdate = call._ !== 'inputGroupCall' && (!oldCall || oldCall._ !== 'groupCallDiscarded');\n if(oldCall) {\n if(shouldUpdate) {\n safeReplaceObject(oldCall, call);\n }\n\n call = oldCall;\n } else {\n this.groupCalls.set(call.id, call);\n }\n\n if(shouldUpdate) {\n this.rootScope.dispatchEvent('group_call_update', call as any);\n }\n\n return call;\n }\n\n public async createGroupCall(chatId: ChatId, scheduleDate?: number, title?: string) {\n const updates = await this.apiManager.invokeApi('phone.createGroupCall', {\n peer: this.appPeersManager.getInputPeerById(chatId.toPeerId(true)),\n random_id: nextRandomUint(32),\n schedule_date: scheduleDate,\n title\n });\n\n this.apiUpdatesManager.processUpdateMessage(updates);\n\n const update = (updates as Updates.updates).updates.find((update) => update._ === 'updateGroupCall') as Update.updateGroupCall;\n return update.call;\n }\n\n public getGroupCallInput(id: GroupCallId): InputGroupCall {\n const groupCall = this.getGroupCall(id);\n return {\n _: 'inputGroupCall',\n id: groupCall.id,\n access_hash: groupCall.access_hash\n };\n }\n\n // public generateSelfParticipant(): GroupCallParticipant {\n // const mainSources = this.currentGroupCall.connections.main.sources;\n // const presentationSources = this.currentGroupCall.connections.presentation?.sources;\n // return {\n // _: 'groupCallParticipant',\n // pFlags: {\n // can_self_unmute: true,\n // self: true\n // },\n // source: mainSources.audio.source,\n // video: this.generateSelfVideo(mainSources.video),\n // presentation: presentationSources && this.generateSelfVideo(presentationSources.video, presentationSources.audio?.source),\n // date: tsNow(true),\n // peer: this.appPeersManager.getOutputPeer(rootScope.myId)\n // };\n // }\n\n public async getGroupCallParticipants(id: GroupCallId) {\n const {nextOffset, setNextOffset} = this.prepareToSavingNextOffset(id);\n\n if(nextOffset !== '') {\n await this.apiManager.invokeApiSingleProcess({\n method: 'phone.getGroupParticipants',\n params: {\n call: this.getGroupCallInput(id),\n ids: [],\n sources: [],\n offset: nextOffset || '',\n limit: GET_PARTICIPANTS_LIMIT\n },\n processResult: (groupCallParticipants) => {\n const newNextOffset = groupCallParticipants.count === groupCallParticipants.participants.length ? '' : groupCallParticipants.next_offset;\n\n this.appChatsManager.saveApiChats(groupCallParticipants.chats);\n this.appUsersManager.saveApiUsers(groupCallParticipants.users);\n this.saveApiParticipants(id, groupCallParticipants.participants);\n\n setNextOffset(newNextOffset);\n }\n });\n }\n\n return {\n participants: this.getCachedParticipants(id),\n isEnd: this.nextOffsets.get(id) === ''\n };\n }\n\n public hangUp(id: GroupCallId, discard?: boolean | number) {\n const groupCallInput = this.getGroupCallInput(id);\n let promise: Promise;\n if(typeof(discard) === 'boolean' && discard) {\n promise = this.apiManager.invokeApi('phone.discardGroupCall', {\n call: groupCallInput\n });\n } else if(typeof(discard) === 'number') {\n promise = this.apiManager.invokeApi('phone.leaveGroupCall', {\n call: groupCallInput,\n source: discard\n });\n } else {\n promise = this.apiManager.invokeApi('phone.joinGroupCall', {\n call: groupCallInput,\n join_as: this.appPeersManager.getInputPeerSelf(),\n muted: true,\n video_stopped: true,\n params: {\n _: 'dataJSON',\n data: ''\n }\n });\n }\n\n return promise.then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n });\n }\n\n public async joinGroupCall(groupCallId: GroupCallId, params: DataJSON, options: GroupCallConnectionInstance['options']) {\n const groupCallInput = this.getGroupCallInput(groupCallId);\n let promise: Promise;\n if(options.type === 'main') {\n const request: PhoneJoinGroupCall = {\n call: groupCallInput,\n join_as: this.appPeersManager.getInputPeerSelf(),\n params,\n muted: options.isMuted,\n video_stopped: !options.joinVideo\n };\n\n promise = this.apiManager.invokeApi('phone.joinGroupCall', request);\n this.log(`[api] joinGroupCall id=${groupCallId}`, request);\n } else {\n const request: PhoneJoinGroupCallPresentation = {\n call: groupCallInput,\n params\n };\n\n promise = this.apiManager.invokeApi('phone.joinGroupCallPresentation', request);\n this.log(`[api] joinGroupCallPresentation id=${groupCallId}`, request);\n }\n\n const updates = await promise;\n this.apiUpdatesManager.processUpdateMessage(updates);\n\n const update = (updates as Updates.updates).updates.find((update) => update._ === 'updateGroupCallConnection') as Update.updateGroupCallConnection;\n return update;\n }\n\n public leaveGroupCallPresentation(groupCallId: GroupCallId) {\n return this.apiManager.invokeApi('phone.leaveGroupCallPresentation', {\n call: this.getGroupCallInput(groupCallId)\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {InputPhoto} from '../../../../layer';\nimport {MyPhoto} from '../../appPhotosManager';\n\nexport default function getPhotoInput(photo: MyPhoto): InputPhoto.inputPhoto {\n return {\n _: 'inputPhoto',\n id: photo.id,\n access_hash: photo.access_hash,\n file_reference: photo.file_reference\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {InputMedia} from '../../../../layer';\nimport {MyPhoto} from '../../appPhotosManager';\nimport getPhotoInput from './getPhotoInput';\n\nexport default function getPhotoMediaInput(photo: MyPhoto): InputMedia.inputMediaPhoto {\n return {\n _: 'inputMediaPhoto',\n id: getPhotoInput(photo),\n ttl_seconds: 0,\n pFlags: {}\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Document, InputMedia} from '../../../../layer';\n\nexport default function getMediaInput(doc: Document.document): InputMedia.inputMediaDocument {\n return {\n _: 'inputMediaDocument',\n id: {\n _: 'inputDocument',\n id: doc.id,\n access_hash: doc.access_hash,\n file_reference: doc.file_reference\n },\n ttl_seconds: 0,\n pFlags: {}\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {MyDocument} from './appDocsManager';\nimport type {MyPhoto} from './appPhotosManager';\nimport type {MyTopPeer} from './appUsersManager';\nimport type {AppMessagesManager, MessageSendingParams} from './appMessagesManager';\nimport {BotInlineResult, GeoPoint, InputGeoPoint, InputMedia, MessageEntity, MessageMedia, MessagesBotResults, ReplyMarkup} from '../../layer';\nimport insertInDescendSortedArray from '../../helpers/array/insertInDescendSortedArray';\nimport {AppManager} from './manager';\nimport getPhotoMediaInput from './utils/photos/getPhotoMediaInput';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\nimport generateQId from './utils/inlineBots/generateQId';\nimport getDocumentMediaInput from './utils/docs/getDocumentMediaInput';\n\nexport class AppInlineBotsManager extends AppManager {\n private inlineResults: {[queryAndResultIds: string]: BotInlineResult} = {};\n private setHash: {\n [botId: UserId]: {\n peerId: PeerId,\n time: number\n }\n } = {};\n\n public getGeoInput(geo: GeoPoint): InputGeoPoint {\n return geo._ === 'geoPoint' ? {\n _: 'inputGeoPoint',\n lat: geo.lat,\n long: geo.long,\n accuracy_radius: geo.accuracy_radius\n } : {\n _: 'inputGeoPointEmpty'\n };\n }\n\n public getInlineResults(peerId: PeerId, botId: BotId, query = '', offset = '', geo?: GeoPoint) {\n return this.apiManager.invokeApi('messages.getInlineBotResults', {\n bot: this.appUsersManager.getUserInput(botId),\n peer: this.appPeersManager.getInputPeerById(peerId),\n query,\n geo_point: geo ? this.getGeoInput(geo) : undefined,\n offset\n }, {/* timeout: 1, */stopTime: -1, noErrorBox: true}).then((botResults) => {\n const queryId = botResults.query_id;\n\n /* if(botResults.switch_pm) {\n botResults.switch_pm.rText = wrapRichText(botResults.switch_pm.text, {noLinebreaks: true, noLinks: true});\n } */\n\n botResults.results.forEach((result) => {\n if(result._ === 'botInlineMediaResult') {\n if(result.document) {\n result.document = this.appDocsManager.saveDoc(result.document);\n }\n\n if(result.photo) {\n result.photo = this.appPhotosManager.savePhoto(result.photo);\n }\n }\n\n this.inlineResults[generateQId(queryId, result.id)] = result;\n });\n\n return botResults;\n });\n }\n\n private pushPopularBot(botId: BotId) {\n this.appUsersManager.getTopPeers('bots_inline').then((topPeers) => {\n const botPeerId = botId.toPeerId();\n const index = topPeers.findIndex((topPeer) => topPeer.id === botPeerId);\n let topPeer: MyTopPeer;\n if(index !== -1) {\n topPeer = topPeers[index];\n } else {\n topPeer = {\n id: botPeerId,\n rating: 0\n };\n }\n\n ++topPeer.rating;\n insertInDescendSortedArray(topPeers, topPeer, 'rating');\n\n this.appStateManager.setKeyValueToStorage('topPeersCache');\n\n // rootScope.$broadcast('inline_bots_popular')\n });\n }\n\n public switchToPM(fromPeerId: PeerId, botId: BotId, startParam: string) {\n this.setHash[botId] = {peerId: fromPeerId, time: Date.now()};\n return this.appMessagesManager.startBot(botId, undefined, startParam);\n }\n\n /*\n function resolveInlineMention (username) {\n return AppPeersManager.resolveUsername(username).then(function (peerId) {\n if (peerId.isUser()) {\n var bot = AppUsersManager.getUser(peerId)\n if (bot.pFlags.bot && bot.bot_inline_placeholder !== undefined) {\n var resolvedBot = {\n username: username,\n id: peerId,\n placeholder: bot.bot_inline_placeholder\n }\n if (bot.pFlags.bot_inline_geo &&\n GeoLocationManager.isAvailable()) {\n return checkGeoLocationAccess(peerId).then(function () {\n return GeoLocationManager.getPosition().then(function (coords) {\n resolvedBot.geo = coords\n return qSync.when(resolvedBot)\n })\n })['catch'](function () {\n return qSync.when(resolvedBot)\n })\n }\n return qSync.when(resolvedBot)\n }\n }\n return $q.reject()\n }, function (error) {\n error.handled = true\n return $q.reject(error)\n })\n }\n\n function regroupWrappedResults (results, rowW, rowH) {\n if (!results ||\n !results[0] ||\n ['photo', 'gif', 'sticker'].indexOf(results[0].type) === -1) {\n return\n }\n var ratios = []\n angular.forEach(results, function (result) {\n var w\n var h, doc\n var photo\n if (result._ === 'botInlineMediaResult') {\n if (doc = result.document) {\n w = result.document.w\n h = result.document.h\n }\n else if (photo = result.photo) {\n var photoSize = (photo.sizes || [])[0]\n w = photoSize && photoSize.w\n h = photoSize && photoSize.h\n }\n }else {\n w = result.w\n h = result.h\n }\n if (!w || !h) {\n w = h = 1\n }\n ratios.push(w / h)\n })\n\n var rows = []\n var curCnt = 0\n var curW = 0\n angular.forEach(ratios, function (ratio) {\n var w = ratio * rowH\n curW += w\n if (!curCnt || curCnt < 4 && curW < (rowW * 1.1)) {\n curCnt++\n } else {\n rows.push(curCnt)\n curCnt = 1\n curW = w\n }\n })\n if (curCnt) {\n rows.push(curCnt)\n }\n\n var i = 0\n var thumbs = []\n var lastRowI = rows.length - 1\n angular.forEach(rows, function (rowCnt, rowI) {\n var lastRow = rowI === lastRowI\n var curRatios = ratios.slice(i, i + rowCnt)\n var sumRatios = 0\n angular.forEach(curRatios, function (ratio) {\n sumRatios += ratio\n })\n angular.forEach(curRatios, function (ratio, j) {\n var thumbH = rowH\n var thumbW = rowW * ratio / sumRatios\n var realW = thumbH * ratio\n if (lastRow && thumbW > realW) {\n thumbW = realW\n }\n var result = results[i + j]\n result.thumbW = Math.floor(thumbW) - 2\n result.thumbH = Math.floor(thumbH) - 2\n })\n\n i += rowCnt\n })\n } */\n\n public async checkSwitchReturn(botId: BotId) {\n const bot = this.appUsersManager.getUser(botId);\n if(!bot || !bot.pFlags.bot || !bot.bot_inline_placeholder) {\n return;\n }\n\n const peerData = this.setHash[botId];\n if(peerData) {\n delete this.setHash[botId];\n if((Date.now() - peerData.time) < 3600e3) {\n return peerData.peerId;\n }\n }\n }\n\n public switchInlineQuery(peerId: PeerId, threadId: number, botId: BotId, query: string) {\n this.appDraftsManager.setDraft(peerId, threadId, '@' + this.appPeersManager.getPeerUsername(botId.toPeerId()) + ' ' + query);\n }\n\n public callbackButtonClick(peerId: PeerId, mid: number, button: any) {\n return this.apiManager.invokeApi('messages.getBotCallbackAnswer', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n msg_id: getServerMessageId(mid),\n data: button.data\n }, {/* timeout: 1, */stopTime: -1, noErrorBox: true});\n }\n\n /* function gameButtonClick (id) {\n var message = AppMessagesManager.getMessage(id)\n var peerId = AppMessagesManager.getMessagePeer(message)\n\n return MtpApiManager.invokeApi('messages.getBotCallbackAnswer', {\n peer: AppPeersManager.getInputPeerByID(peerId),\n msg_id: AppMessagesIDsManager.getMessageLocalID(id)\n }, {timeout: 1, stopTime: -1, noErrorBox: true}).then(function (callbackAnswer) {\n if (typeof callbackAnswer.message === 'string' &&\n callbackAnswer.message.length) {\n showCallbackMessage(callbackAnswer.message, callbackAnswer.pFlags.alert)\n }\n else if (typeof callbackAnswer.url === 'string') {\n AppGamesManager.openGame(message.media.game.id, id, callbackAnswer.url)\n }\n })\n } */\n\n public sendInlineResult(peerId: PeerId, botId: BotId, queryAndResultIds: string, options: MessageSendingParams & Partial<{\n viaBotId: BotId,\n queryId: string,\n resultId: string,\n replyMarkup: ReplyMarkup,\n entities: MessageEntity[],\n clearDraft: true,\n geoPoint: GeoPoint\n }> = {}) {\n const inlineResult = this.inlineResults[queryAndResultIds];\n if(!inlineResult) {\n return;\n }\n\n this.pushPopularBot(botId);\n const splitted = queryAndResultIds.split('_');\n const queryID = splitted.shift();\n const resultID = splitted.join('_');\n options.viaBotId = botId;\n options.queryId = queryID;\n options.resultId = resultID;\n if(inlineResult.send_message.reply_markup) {\n options.replyMarkup = inlineResult.send_message.reply_markup;\n }\n\n if(inlineResult.send_message._ === 'botInlineMessageText') {\n options.entities = inlineResult.send_message.entities;\n this.appMessagesManager.sendText(peerId, inlineResult.send_message.message, options);\n } else {\n let caption = '';\n let inputMedia: Parameters[1], messageMedia: MessageMedia;\n const sendMessage = inlineResult.send_message;\n switch(sendMessage._) {\n case 'botInlineMessageMediaAuto': {\n caption = sendMessage.message;\n\n if(inlineResult._ === 'botInlineMediaResult') {\n const {document, photo} = inlineResult;\n if(document) {\n inputMedia = getDocumentMediaInput(document as MyDocument);\n } else {\n inputMedia = getPhotoMediaInput(photo as MyPhoto);\n }\n }\n\n break;\n }\n\n case 'botInlineMessageMediaGeo': {\n inputMedia = {\n _: 'inputMediaGeoPoint',\n geo_point: this.getGeoInput(sendMessage.geo)\n };\n\n options.geoPoint = sendMessage.geo;\n\n break;\n }\n\n case 'botInlineMessageMediaVenue': {\n inputMedia = {\n _: 'inputMediaVenue',\n geo_point: this.getGeoInput(sendMessage.geo),\n title: sendMessage.title,\n address: sendMessage.address,\n provider: sendMessage.provider,\n venue_id: sendMessage.venue_id,\n venue_type: sendMessage.venue_type\n };\n\n options.geoPoint = sendMessage.geo;\n\n break;\n }\n\n case 'botInlineMessageMediaContact': {\n inputMedia = {\n _: 'inputMediaContact',\n phone_number: sendMessage.phone_number,\n first_name: sendMessage.first_name,\n last_name: sendMessage.last_name,\n vcard: sendMessage.vcard\n };\n\n break;\n }\n\n case 'botInlineMessageMediaInvoice': {\n // const photo = sendMessage.photo;\n // inputMedia = {\n // _: 'inputMediaInvoice',\n // description: sendMessage.description,\n // title: sendMessage.title,\n // photo: photo && {\n // _: 'inputWebDocument',\n // attributes: photo.attributes,\n // mime_type: photo.mime_type,\n // size: photo.size,\n // url: photo.url\n // },\n // invoice: undefined,\n // payload: undefined,\n // provider: undefined,\n // provider_data: undefined,\n // start_param: undefined\n // };\n\n messageMedia = {\n _: 'messageMediaInvoice',\n title: sendMessage.title,\n description: sendMessage.description,\n photo: sendMessage.photo,\n currency: sendMessage.currency,\n total_amount: sendMessage.total_amount,\n pFlags: {\n shipping_address_requested: sendMessage.pFlags.shipping_address_requested,\n test: sendMessage.pFlags.test\n },\n start_param: undefined\n };\n\n break;\n }\n }\n\n if(!inputMedia && messageMedia) {\n inputMedia = {\n _: 'messageMediaPending',\n messageMedia\n };\n }\n\n this.appMessagesManager.sendOther(peerId, inputMedia, options);\n }\n }\n\n /* function checkGeoLocationAccess (botID) {\n var key = 'bot_access_geo' + botID\n return Storage.get(key).then(function (geoAccess) {\n if (geoAccess && geoAccess.granted) {\n return true\n }\n return ErrorService.confirm({\n type: 'BOT_ACCESS_GEO_INLINE'\n }).then(function () {\n var setHash = {}\n setHash[key] = {granted: true, time: tsNow()}\n Storage.set(setHash)\n return true\n }, function () {\n var setHash = {}\n setHash[key] = {denied: true, time: tsNow()}\n Storage.set(setHash)\n return $q.reject()\n })\n })\n } */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MESSAGE_ID_INCREMENT} from './utils/messageId';\nimport generateMessageId from './utils/messageId/generateMessageId';\n\nexport class AppMessagesIdsManager {\n private tempNum = 0;\n\n public generateTempMessageId(messageId: number) {\n const num = ++this.tempNum;\n return generateMessageId(messageId) + (num & (MESSAGE_ID_INCREMENT - 1));\n }\n}\n","export default function splitStringByLength(str: string, maxLength: number) {\n if(str.length < maxLength) return [str];\n let length = 0, lastSliceStartIndex = 0, arrayIndex = 0;\n const delimiter = ' ';// '\\n';\n const out: string[] = [];\n\n const cut = (end?: number) => {\n let part = str.slice(lastSliceStartIndex, end);\n const _arrayIndex = arrayIndex++;\n if(part.length > maxLength) {\n const overflowPart = part.slice(maxLength);\n const splitted = splitStringByLength(overflowPart, maxLength);\n splitted.forEach((part) => {\n out[arrayIndex++] = part;\n });\n\n part = part.slice(0, maxLength);\n }\n\n lastSliceStartIndex = end;\n length = 0;\n out[_arrayIndex] = (out[_arrayIndex] || '') + part;\n };\n\n let lastIndex = 0;\n do {\n let index = str.indexOf(delimiter, lastIndex);\n if(index === -1) {\n if(lastIndex !== (str.length - 1)) {\n cut();\n }\n\n break;\n }\n\n index += delimiter.length;\n\n const partLength = index - lastIndex;\n if((length + partLength) > maxLength) {\n cut(length);\n }\n\n lastIndex = index;\n length += partLength;\n } while(true);\n\n return out;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {TabState} from '../mtproto/mtprotoworker';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport MTProtoMessagePort from '../mtproto/mtprotoMessagePort';\n\ntype Tab = {\n source: MessageEventSource,\n state: TabState\n};\n\nexport class AppTabsManager {\n private tabs: Map;\n\n constructor() {\n this.tabs = new Map();\n }\n\n public start() {\n const port = MTProtoMessagePort.getInstance();\n\n port.addEventListener('tabState', (state, source) => {\n const tab = this.tabs.get(source);\n tab.state = state;\n });\n }\n\n public getTabs() {\n return [...this.tabs.values()].filter((tab) => !!tab.state);\n }\n\n public addTab(source: MessageEventSource) {\n const tab: Tab = {\n source,\n state: undefined\n };\n\n this.tabs.set(source, tab);\n }\n\n public deleteTab(source: MessageEventSource) {\n this.tabs.delete(source);\n }\n}\n\nconst appTabsManager = new AppTabsManager();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.appTabsManager = appTabsManager);\nexport default appTabsManager;\n","import {InputDocument} from '../../../../layer';\nimport type {MyDocument} from '../../appDocsManager';\n\nexport default function getDocumentInput(doc: MyDocument): InputDocument {\n return {\n _: 'inputDocument',\n id: doc.id,\n access_hash: doc.access_hash,\n file_reference: doc.file_reference\n };\n}\n","export default function setBooleanFlag(obj: T, key: keyof T, value: boolean) {\n // @ts-ignore\n if(value) obj[key] = true;\n else delete obj[key];\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {ApiFileManager} from '../mtproto/apiFileManager';\nimport type {MediaSize} from '../../helpers/mediaSize';\nimport type {Progress} from './appDownloadManager';\nimport type {VIDEO_MIME_TYPE} from '../../environment/videoMimeTypesSupport';\nimport LazyLoadQueueBase from '../../components/lazyLoadQueueBase';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport tsNow from '../../helpers/tsNow';\nimport {randomLong} from '../../helpers/random';\nimport {Chat, ChatFull, Dialog as MTDialog, DialogPeer, DocumentAttribute, InputMedia, InputMessage, InputPeerNotifySettings, InputSingleMedia, Message, MessageAction, MessageEntity, MessageFwdHeader, MessageMedia, MessageReplies, MessageReplyHeader, MessagesDialogs, MessagesFilter, MessagesMessages, MethodDeclMap, NotifyPeer, PeerNotifySettings, PhotoSize, SendMessageAction, Update, Photo, Updates, ReplyMarkup, InputPeer, InputPhoto, InputDocument, InputGeoPoint, WebPage, GeoPoint, ReportReason, MessagesGetDialogs, InputChannel, InputDialogPeer, ReactionCount, MessagePeerReaction, MessagesSearchCounter, Peer, MessageReactions, Document, InputFile, Reaction, ForumTopic as MTForumTopic, MessagesForumTopics, MessagesGetReplies, MessagesGetHistory, MessagesAffectedHistory, UrlAuthResult, MessagesTranscribedAudio} from '../../layer';\nimport {ArgumentTypes, InvokeApiOptions} from '../../types';\nimport {logger, LogTypes} from '../logger';\nimport {ReferenceContext} from '../mtproto/referenceDatabase';\nimport DialogsStorage, {GLOBAL_FOLDER_ID} from '../storages/dialogs';\nimport {ChatRights} from './appChatsManager';\nimport {MyDocument} from './appDocsManager';\nimport {MyPhoto} from './appPhotosManager';\nimport {getFileNameByLocation} from '../../helpers/fileName';\nimport DEBUG from '../../config/debug';\nimport SlicedArray, {Slice, SliceEnd} from '../../helpers/slicedArray';\nimport {FOLDER_ID_ALL, GENERAL_TOPIC_ID, MUTE_UNTIL, NULL_PEER_ID, REAL_FOLDER_ID, REPLIES_HIDDEN_CHANNEL_ID, REPLIES_PEER_ID, SERVICE_PEER_ID, THUMB_TYPE_FULL} from '../mtproto/mtproto_config';\n// import telegramMeWebManager from '../mtproto/telegramMeWebManager';\nimport {getMiddleware} from '../../helpers/middleware';\nimport assumeType from '../../helpers/assumeType';\nimport copy from '../../helpers/object/copy';\nimport getObjectKeysAndSort from '../../helpers/object/getObjectKeysAndSort';\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport deepEqual from '../../helpers/object/deepEqual';\nimport splitStringByLength from '../../helpers/string/splitStringByLength';\nimport debounce from '../../helpers/schedulers/debounce';\nimport {AppManager} from './manager';\nimport getPhotoMediaInput from './utils/photos/getPhotoMediaInput';\nimport getPhotoDownloadOptions from './utils/photos/getPhotoDownloadOptions';\nimport fixEmoji from '../richTextProcessor/fixEmoji';\nimport mergeEntities from '../richTextProcessor/mergeEntities';\nimport parseEntities from '../richTextProcessor/parseEntities';\nimport parseMarkdown from '../richTextProcessor/parseMarkdown';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\nimport generateMessageId from './utils/messageId/generateMessageId';\nimport filterMessagesByInputFilter from './utils/messages/filterMessagesByInputFilter';\nimport ctx from '../../environment/ctx';\nimport {getEnvironment} from '../../environment/utils';\nimport getDialogIndex from './utils/dialogs/getDialogIndex';\nimport defineNotNumerableProperties from '../../helpers/object/defineNotNumerableProperties';\nimport getDocumentMediaInput from './utils/docs/getDocumentMediaInput';\nimport getDocumentInputFileName from './utils/docs/getDocumentInputFileName';\nimport getFileNameForUpload from '../../helpers/getFileNameForUpload';\nimport noop from '../../helpers/noop';\nimport appTabsManager from './appTabsManager';\nimport MTProtoMessagePort from '../mtproto/mtprotoMessagePort';\nimport getAlbumText from './utils/messages/getAlbumText';\nimport pause from '../../helpers/schedulers/pause';\nimport makeError from '../../helpers/makeError';\nimport getStickerEffectThumb from './utils/stickers/getStickerEffectThumb';\nimport getDocumentInput from './utils/docs/getDocumentInput';\nimport reactionsEqual from './utils/reactions/reactionsEqual';\nimport getPeerActiveUsernames from './utils/peers/getPeerActiveUsernames';\nimport {BroadcastEvents} from '../rootScope';\nimport setBooleanFlag from '../../helpers/object/setBooleanFlag';\nimport getMessageThreadId from './utils/messages/getMessageThreadId';\n\n// console.trace('include');\n// TODO: если удалить диалог находясь в папке, то он не удалится из папки и будет виден в настройках\n\nconst APITIMEOUT = 0;\nconst DO_NOT_READ_HISTORY = false;\n\nexport type SendFileDetails = {\n file: File | Blob | MyDocument,\n} & Partial<{\n duration: number,\n width: number,\n height: number,\n objectURL: string,\n thumb: {\n blob: Blob,\n url: string,\n size: MediaSize\n },\n strippedBytes: PhotoSize.photoStrippedSize['bytes'],\n spoiler: boolean\n}>;\n\nexport type HistoryStorage = {\n count: number | null,\n history: SlicedArray,\n\n maxId?: number,\n readPromise?: Promise,\n readMaxId?: number,\n readOutboxMaxId?: number,\n triedToReadMaxId?: number,\n\n maxOutId?: number,\n replyMarkup?: Exclude\n};\n\nexport type HistoryResult = {\n count: number,\n history: number[],\n isEnd: ReturnType['getEnds']>,\n offsetIdOffset?: number,\n};\n\nexport type Dialog = MTDialog.dialog;\nexport type ForumTopic = MTForumTopic.forumTopic;\n\nexport type MyMessage = Message.message | Message.messageService;\nexport type MyInputMessagesFilter = 'inputMessagesFilterEmpty'\n | 'inputMessagesFilterPhotos'\n | 'inputMessagesFilterPhotoVideo'\n | 'inputMessagesFilterVideo'\n | 'inputMessagesFilterDocument'\n | 'inputMessagesFilterVoice'\n | 'inputMessagesFilterRoundVoice'\n | 'inputMessagesFilterRoundVideo'\n | 'inputMessagesFilterMusic'\n | 'inputMessagesFilterUrl'\n | 'inputMessagesFilterMyMentions'\n | 'inputMessagesFilterChatPhotos'\n | 'inputMessagesFilterPinned';\n\nexport type PinnedStorage = Partial<{\n promise: Promise,\n count: number,\n maxId: number\n}>;\nexport type MessagesStorage = Map & {peerId: PeerId, type: MessagesStorageType, key: MessagesStorageKey};\nexport type MessagesStorageType = 'scheduled' | 'history' | 'grouped';\nexport type MessagesStorageKey = `${PeerId}_${MessagesStorageType}`;\n\nexport type MyMessageActionType = Message.messageService['action']['_'];\n\ntype PendingAfterMsg = Partial;\n\ntype MapValueType = A extends Map ? V : never;\n\nexport type BatchUpdates = {\n 'messages_reactions': AppMessagesManager['batchUpdateReactions'],\n 'messages_views': AppMessagesManager['batchUpdateViews']\n};\n\ntype PendingMessageDetails = {\n peerId: PeerId,\n tempId: number,\n threadId: number,\n storage: MessagesStorage,\n sequential?: boolean\n};\n\nconst processAfter = (cb: () => void) => {\n // setTimeout(cb, 0);\n cb();\n};\n\nexport type MessageSendingParams = Partial<{\n threadId: number,\n replyToMsgId: number,\n scheduleDate: number,\n silent: boolean,\n sendAsPeerId: number,\n updateStickersetOrder: boolean\n}>;\n\nexport class AppMessagesManager extends AppManager {\n private messagesStorageByPeerId: {[peerId: string]: MessagesStorage};\n private groupedMessagesStorage: {[groupId: string]: MessagesStorage}; // will be used for albums\n private scheduledMessagesStorage: {[peerId: PeerId]: MessagesStorage};\n private historiesStorage: {\n [peerId: PeerId]: HistoryStorage\n };\n private threadsStorage: {\n [peerId: PeerId]: {\n [threadId: string]: HistoryStorage\n }\n };\n private searchesStorage: {\n [peerId: PeerId]: Partial<{\n [inputFilter in MyInputMessagesFilter]: {\n count?: number,\n history: number[]\n }\n }>\n };\n private pinnedMessages: {[key: string]: PinnedStorage};\n\n private threadsServiceMessagesIdsStorage: {[peerId_threadId: string]: number};\n private threadsToReplies: {\n [peerId_threadId: string]: string;\n };\n\n private pendingByRandomId: {\n [randomId: string]: PendingMessageDetails\n } = {};\n private pendingByMessageId: {[mid: string]: Long} = {};\n private pendingAfterMsgs: {[peerId: PeerId]: PendingAfterMsg} = {};\n public pendingTopMsgs: {[peerId: PeerId]: number} = {};\n private tempFinalizeCallbacks: {\n [tempId: string]: {\n [callbackName: string]: Partial<{\n deferred: CancellablePromise,\n callback: (message: MyMessage) => Promise\n }>\n }\n } = {};\n\n private sendSmthLazyLoadQueue = new LazyLoadQueueBase(10);\n\n private needSingleMessages: Map>> = new Map();\n private fetchSingleMessagesPromise: Promise;\n private extendedMedia: Map>> = new Map();\n\n private maxSeenId = 0;\n\n public migratedFromTo: {[peerId: PeerId]: PeerId} = {};\n public migratedToFrom: {[peerId: PeerId]: PeerId} = {};\n\n private newDialogsHandlePromise: Promise;\n private newDialogsToHandle: Map}> = new Map();\n public newUpdatesAfterReloadToHandle: {[key: string]: Set} = {};\n\n private notificationsHandlePromise: number;\n private notificationsToHandle: {[key: string]: {\n fwdCount: number,\n fromId: PeerId,\n topMessage?: MyMessage\n }} = {};\n\n private reloadConversationsPromise: Promise;\n private reloadConversationsPeers: Map}> = new Map();\n\n public log = logger('MESSAGES', LogTypes.Error | LogTypes.Debug | LogTypes.Log | LogTypes.Warn);\n\n private groupedTempId = 0;\n\n private typings: {[key: string]: {action: SendMessageAction, timeout?: number}} = {};\n\n private middleware: ReturnType;\n\n private unreadMentions: {[key: string]: SlicedArray} = {};\n private goToNextMentionPromises: {[key: string]: Promise} = {};\n\n private batchUpdates: {\n [k in keyof BatchUpdates]?: {\n callback: BatchUpdates[k],\n batch: ArgumentTypes[0]\n }\n } = {};\n private batchUpdatesDebounced: () => Promise;\n\n private uploadFilePromises: {[fileName: string]: CancellablePromise};\n\n protected after() {\n this.clear(true);\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateMessageID: this.onUpdateMessageId,\n\n updateNewDiscussionMessage: this.onUpdateNewMessage,\n updateNewMessage: this.onUpdateNewMessage,\n updateNewChannelMessage: this.onUpdateNewMessage,\n\n updateDialogUnreadMark: this.onUpdateDialogUnreadMark,\n\n updateEditMessage: this.onUpdateEditMessage,\n updateEditChannelMessage: this.onUpdateEditMessage,\n\n updateMessageReactions: this.onUpdateMessageReactions,\n\n updateReadChannelDiscussionInbox: this.onUpdateReadHistory,\n updateReadChannelDiscussionOutbox: this.onUpdateReadHistory,\n updateReadHistoryInbox: this.onUpdateReadHistory,\n updateReadHistoryOutbox: this.onUpdateReadHistory,\n updateReadChannelInbox: this.onUpdateReadHistory,\n updateReadChannelOutbox: this.onUpdateReadHistory,\n\n updateChannelReadMessagesContents: this.onUpdateReadMessagesContents,\n updateReadMessagesContents: this.onUpdateReadMessagesContents,\n\n updateChannelAvailableMessages: this.onUpdateChannelAvailableMessages,\n\n updateDeleteMessages: this.onUpdateDeleteMessages,\n updateDeleteChannelMessages: this.onUpdateDeleteMessages,\n\n updateChannel: this.onUpdateChannel,\n\n updateChannelReload: this.onUpdateChannelReload,\n\n updateChannelMessageViews: this.onUpdateChannelMessageViews,\n\n updateServiceNotification: this.onUpdateServiceNotification,\n\n updatePinnedMessages: this.onUpdatePinnedMessages,\n updatePinnedChannelMessages: this.onUpdatePinnedMessages,\n\n updateNotifySettings: this.onUpdateNotifySettings,\n\n updateNewScheduledMessage: this.onUpdateNewScheduledMessage,\n\n updateDeleteScheduledMessages: this.onUpdateDeleteScheduledMessages,\n\n updateMessageExtendedMedia: this.onUpdateMessageExtendedMedia,\n\n updateTranscribedAudio: this.onUpdateTranscribedAudio\n });\n\n // ! Invalidate notify settings, can optimize though\n this.rootScope.addEventListener('notify_peer_type_settings', ({key, settings}) => {\n const dialogs = this.dialogsStorage.getFolderDialogs(0).concat(this.dialogsStorage.getFolderDialogs(1));\n let filterFunc: (dialog: typeof dialogs[0]) => boolean;\n if(key === 'notifyUsers') filterFunc = (dialog) => dialog.peerId.isUser();\n else if(key === 'notifyBroadcasts') filterFunc = (dialog) => this.appPeersManager.isBroadcast(dialog.peerId);\n else filterFunc = (dialog) => this.appPeersManager.isAnyGroup(dialog.peerId);\n\n dialogs\n .filter(filterFunc)\n .forEach((dialog) => {\n this.rootScope.dispatchEvent('dialog_notify_settings', dialog);\n });\n });\n\n this.rootScope.addEventListener('webpage_updated', ({id, msgs}) => {\n msgs.forEach(({peerId, mid, isScheduled}) => {\n const storage = isScheduled ? this.getScheduledMessagesStorage(peerId) : this.getHistoryMessagesStorage(peerId);\n const message = this.getMessageFromStorage(storage, mid) as Message.message;\n if(!message) return;\n message.media = {\n _: 'messageMediaWebPage',\n webpage: this.appWebPagesManager.getCachedWebPage(id)\n };\n\n this.rootScope.dispatchEvent('message_edit', {\n storageKey: storage.key,\n peerId,\n mid,\n message\n });\n });\n });\n\n this.rootScope.addEventListener('draft_updated', ({peerId, threadId, draft}) => {\n const dialog = this.dialogsStorage.getDialogOrTopic(peerId, threadId);\n if(dialog) {\n dialog.draft = draft;\n\n let drop = false;\n if(!draft && !getServerMessageId(dialog.top_message)) {\n this.dialogsStorage.dropDialog(peerId);\n drop = true;\n } else {\n this.dialogsStorage.generateIndexForDialog(dialog);\n this.dialogsStorage.pushDialog({dialog});\n }\n\n this.rootScope.dispatchEvent('dialog_draft', {\n peerId,\n dialog,\n drop,\n draft\n });\n } else if(threadId) {\n const chat = this.appChatsManager.getChat(peerId.toChatId());\n if(!chat) {\n this.reloadConversation(peerId);\n } else if((chat as Chat.channel).pFlags.forum) {\n this.dialogsStorage.getForumTopicById(peerId, threadId);\n }\n } else {\n this.reloadConversation(peerId);\n }\n });\n\n this.rootScope.addEventListener('poll_update', ({poll}) => {\n const set = this.appPollsManager.pollToMessages[poll.id];\n if(set) {\n for(const key of set) {\n const [peerId, mid] = key.split('_');\n\n const message = this.getMessageByPeer(peerId.toPeerId(), +mid);\n if(message) {\n this.setDialogToStateIfMessageIsTop(message);\n }\n }\n }\n });\n\n // * clear forum cache\n this.rootScope.addEventListener('chat_toggle_forum', ({chatId, enabled}) => {\n const peerId = chatId.toPeerId(true);\n if(!enabled) {\n delete this.threadsStorage[peerId];\n\n for(const key in this.pinnedMessages) {\n if(+key === peerId && key.startsWith(peerId + '_')) {\n delete this.pinnedMessages[key];\n }\n }\n }\n });\n\n this.batchUpdatesDebounced = debounce(() => {\n for(const event in this.batchUpdates) {\n const details = this.batchUpdates[event as keyof BatchUpdates];\n delete this.batchUpdates[event as keyof BatchUpdates];\n\n // @ts-ignore\n const result = details.callback(details.batch);\n if(result && (!(result instanceof Array) || result.length)) {\n // @ts-ignore\n rootScope.dispatchEvent(event as keyof BatchUpdates, result);\n }\n }\n }, 33, false, true);\n\n return this.appStateManager.getState().then((state) => {\n if(state.maxSeenMsgId) {\n this.maxSeenId = state.maxSeenMsgId;\n }\n });\n }\n\n public clear = (init?: boolean) => {\n if(this.middleware) {\n this.middleware.clean();\n } else {\n this.middleware = getMiddleware();\n this.uploadFilePromises = {};\n }\n\n this.messagesStorageByPeerId = {};\n this.groupedMessagesStorage = {};\n this.scheduledMessagesStorage = {};\n this.historiesStorage = {};\n this.threadsStorage = {};\n this.searchesStorage = {};\n this.pinnedMessages = {};\n this.threadsServiceMessagesIdsStorage = {};\n this.threadsToReplies = {};\n\n this.dialogsStorage && this.dialogsStorage.clear(init);\n this.filtersStorage && this.filtersStorage.clear(init);\n };\n\n public getInputEntities(entities: MessageEntity[]) {\n const sendEntites = copy(entities);\n sendEntites.forEach((entity) => {\n if(entity._ === 'messageEntityMentionName') {\n (entity as any as MessageEntity.inputMessageEntityMentionName)._ = 'inputMessageEntityMentionName';\n (entity as any as MessageEntity.inputMessageEntityMentionName).user_id = this.appUsersManager.getUserInput(entity.user_id);\n }\n });\n return sendEntites;\n }\n\n public invokeAfterMessageIsSent(tempId: number, callbackName: string, callback: (message: MyMessage) => Promise) {\n const finalize = this.tempFinalizeCallbacks[tempId] ??= {};\n const obj = finalize[callbackName] ??= {deferred: deferredPromise()};\n\n obj.callback = callback;\n\n return obj.deferred;\n }\n\n public editMessage(message: any, text: string, options: Partial<{\n noWebPage: true,\n newMedia: any,\n scheduleDate: number,\n entities: MessageEntity[]\n }> = {}): Promise {\n /* if(!this.canEditMessage(messageId)) {\n return Promise.reject({type: 'MESSAGE_EDIT_FORBIDDEN'});\n } */\n\n const {mid, peerId} = message;\n\n if(message.pFlags.is_outgoing) {\n return this.invokeAfterMessageIsSent(mid, 'edit', (message) => {\n // this.log('invoke editMessage callback', message);\n return this.editMessage(message, text, options);\n });\n }\n\n const entities = options.entities || [];\n if(text) {\n text = parseMarkdown(text, entities);\n }\n\n const schedule_date = options.scheduleDate || (message.pFlags.is_scheduled ? message.date : undefined);\n return this.apiManager.invokeApi('messages.editMessage', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n id: message.id,\n message: text,\n media: options.newMedia,\n entities: entities.length ? this.getInputEntities(entities) : undefined,\n no_webpage: options.noWebPage,\n schedule_date\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n }, (error) => {\n this.log.error('editMessage error:', error);\n\n if(error && error.type === 'MESSAGE_NOT_MODIFIED') {\n error.handled = true;\n return;\n }\n if(error && error.type === 'MESSAGE_EMPTY') {\n error.handled = true;\n }\n return Promise.reject(error);\n });\n }\n\n public async transcribeAudio(message: Message.message): Promise {\n const {id, peerId} = message;\n\n const process = (result: MessagesTranscribedAudio) => {\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateTranscribedAudio',\n msg_id: message.id,\n peer: this.appPeersManager.getOutputPeer(peerId),\n pFlags: result.pFlags,\n text: result.text,\n transcription_id: result.transcription_id\n });\n };\n\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.transcribeAudio',\n params: {\n peer: this.appPeersManager.getInputPeerById(peerId),\n msg_id: id\n },\n processResult: (result) => {\n process(result);\n return result;\n },\n processError: (error) => {\n if(error.type === 'TRANSCRIPTION_FAILED' || error.type === 'MSG_VOICE_MISSING') {\n process({\n _: 'messages.transcribedAudio',\n transcription_id: 0,\n text: '',\n pFlags: {}\n });\n }\n\n throw error;\n }\n });\n }\n\n public async sendText(peerId: PeerId, text: string, options: MessageSendingParams & Partial<{\n entities: MessageEntity[],\n viaBotId: BotId,\n queryId: string,\n resultId: string,\n noWebPage: true,\n replyMarkup: ReplyMarkup,\n clearDraft: true,\n webPage: WebPage,\n }> = {}): Promise {\n if(!text.trim()) {\n return;\n }\n\n options.entities ??= [];\n\n // this.checkSendOptions(options);\n if(options.threadId && !options.replyToMsgId) {\n options.replyToMsgId = options.threadId;\n }\n\n const config = await this.apiManager.getConfig();\n const MAX_LENGTH = config.message_length_max;\n const splitted = splitStringByLength(text, MAX_LENGTH);\n text = splitted[0];\n if(splitted.length > 1) {\n if(options.webPage?._ === 'webPage' && !text.includes(options.webPage.url)) {\n delete options.webPage;\n }\n }\n\n peerId = this.appPeersManager.getPeerMigratedTo(peerId) || peerId;\n\n const entities = options.entities;\n if(!options.viaBotId) {\n text = parseMarkdown(text, entities);\n // entities = mergeEntities(entities, parseEntities(text));\n }\n\n let sendEntites = this.getInputEntities(entities);\n if(!sendEntites.length) {\n sendEntites = undefined;\n }\n\n const message = this.generateOutgoingMessage(peerId, options);\n message.entities = entities;\n message.message = text;\n\n const replyToMsgId = options.replyToMsgId ? getServerMessageId(options.replyToMsgId) : undefined;\n const isChannel = this.appPeersManager.isChannel(peerId);\n\n if(options.webPage) {\n message.media = {\n _: 'messageMediaWebPage',\n webpage: options.webPage\n };\n }\n\n const toggleError = (error?: ApiError) => {\n this.onMessagesSendError([message], error);\n this.rootScope.dispatchEvent('messages_pending');\n };\n\n message.send = () => {\n toggleError();\n const sentRequestOptions: PendingAfterMsg = {};\n if(this.pendingAfterMsgs[peerId]) {\n sentRequestOptions.afterMessageId = this.pendingAfterMsgs[peerId].messageId;\n }\n\n const sendAs = options.sendAsPeerId ? this.appPeersManager.getInputPeerById(options.sendAsPeerId) : undefined\n let apiPromise: any;\n if(options.viaBotId) {\n apiPromise = this.apiManager.invokeApiAfter('messages.sendInlineBotResult', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n random_id: message.random_id,\n reply_to_msg_id: replyToMsgId || undefined,\n query_id: options.queryId,\n id: options.resultId,\n clear_draft: options.clearDraft,\n send_as: sendAs\n }, sentRequestOptions);\n } else {\n apiPromise = this.apiManager.invokeApiAfter('messages.sendMessage', {\n no_webpage: options.noWebPage,\n peer: this.appPeersManager.getInputPeerById(peerId),\n message: text,\n random_id: message.random_id,\n reply_to_msg_id: replyToMsgId || undefined,\n entities: sendEntites,\n clear_draft: options.clearDraft,\n schedule_date: options.scheduleDate || undefined,\n silent: options.silent,\n send_as: sendAs,\n update_stickersets_order: options.updateStickersetOrder\n }, sentRequestOptions);\n }\n\n /* function is(value: any, condition: boolean): value is T {\n return condition;\n } */\n\n // this.log('sendText', message.mid);\n this.pendingAfterMsgs[peerId] = sentRequestOptions;\n\n return apiPromise.then((updates: Updates) => {\n // this.log('sendText sent', message.mid);\n // if(is(updates, updates._ === 'updateShortSentMessage')) {\n if(updates._ === 'updateShortSentMessage') {\n // assumeType(updates);\n\n // * fix copying object with promise\n const promise = message.promise;\n delete message.promise;\n const newMessage = copy(message);\n defineNotNumerableProperties(message, ['promise']);\n message.promise = promise;\n\n newMessage.date = updates.date;\n newMessage.id = updates.id;\n newMessage.media = updates.media;\n newMessage.entities = updates.entities;\n this.wrapMessageEntities(newMessage);\n if(updates.pFlags.out) {\n newMessage.pFlags.out = true;\n }\n\n // * override with new updates\n updates = {\n _: 'updates',\n users: [],\n chats: [],\n seq: 0,\n date: undefined,\n updates: [{\n _: 'updateMessageID',\n random_id: message.random_id,\n id: newMessage.id\n }, {\n _: options.scheduleDate ? 'updateNewScheduledMessage' : (isChannel ? 'updateNewChannelMessage' : 'updateNewMessage'),\n message: newMessage,\n pts: updates.pts,\n pts_count: updates.pts_count\n }]\n };\n } else if((updates as Updates.updates).updates) {\n (updates as Updates.updates).updates.forEach((update) => {\n if(update._ === 'updateDraftMessage') {\n update.local = true;\n }\n });\n }\n\n // this.reloadConversation(peerId);\n\n // setTimeout(() => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n // }, 5000);\n message.promise.resolve();\n }, (error: ApiError) => {\n toggleError(error);\n message.promise.reject(error);\n throw error;\n }).finally(() => {\n if(this.pendingAfterMsgs[peerId] === sentRequestOptions) {\n delete this.pendingAfterMsgs[peerId];\n }\n });\n };\n\n this.beforeMessageSending(message, {\n isScheduled: !!options.scheduleDate || undefined,\n threadId: options.threadId,\n clearDraft: options.clearDraft,\n sequential: true\n });\n\n const promises: ReturnType[] = [message.promise];\n for(let i = 1; i < splitted.length; ++i) {\n promises.push(this.sendText(peerId, splitted[i], options));\n }\n\n return Promise.all(promises).then(noop);\n }\n\n public sendFile(peerId: PeerId, options: MessageSendingParams & SendFileDetails & Partial<{\n isRoundMessage: boolean,\n isVoiceMessage: boolean,\n isGroupedItem: boolean,\n isMedia: boolean,\n\n groupId: string,\n caption: string,\n entities: MessageEntity[],\n background: boolean,\n clearDraft: boolean,\n noSound: boolean,\n\n waveform: Uint8Array,\n\n // ! only for internal use\n processAfter?: typeof processAfter\n }>) {\n const file = options.file;\n peerId = this.appPeersManager.getPeerMigratedTo(peerId) || peerId;\n\n // this.checkSendOptions(options);\n\n const message = this.generateOutgoingMessage(peerId, options);\n const replyToMsgId = options.replyToMsgId ? getServerMessageId(options.replyToMsgId) : undefined;\n\n let attachType: 'document' | 'audio' | 'video' | 'voice' | 'photo', apiFileName: string;\n\n const fileType = 'mime_type' in file ? file.mime_type : file.type;\n const fileName = file instanceof File ? file.name : '';\n const isDocument = !(file instanceof File) && !(file instanceof Blob);\n let caption = options.caption || '';\n\n this.log('sendFile', file, fileType);\n\n const entities = options.entities || [];\n if(caption) {\n caption = parseMarkdown(caption, entities);\n }\n\n const attributes: DocumentAttribute[] = [];\n\n const isPhoto = getEnvironment().IMAGE_MIME_TYPES_SUPPORTED.has(fileType);\n\n const strippedPhotoSize: PhotoSize.photoStrippedSize = options.strippedBytes && {\n _: 'photoStrippedSize',\n bytes: options.strippedBytes,\n type: 'i'\n };\n\n let photo: MyPhoto, document: MyDocument;\n\n let actionName: Extract;\n if(isDocument) { // maybe it's a sticker or gif\n attachType = 'document';\n apiFileName = '';\n } else if(fileType.indexOf('audio/') === 0 || ['video/ogg'].indexOf(fileType) >= 0) {\n attachType = 'audio';\n apiFileName = 'audio.' + (fileType.split('/')[1] === 'ogg' ? 'ogg' : 'mp3');\n actionName = 'sendMessageUploadAudioAction';\n\n if(options.isVoiceMessage) {\n attachType = 'voice';\n message.pFlags.media_unread = true;\n }\n\n const attribute: DocumentAttribute.documentAttributeAudio = {\n _: 'documentAttributeAudio',\n pFlags: {\n voice: options.isVoiceMessage || undefined\n },\n waveform: options.waveform,\n duration: options.duration || undefined\n };\n\n attributes.push(attribute);\n } else if(!options.isMedia) {\n attachType = 'document';\n apiFileName = 'document.' + fileType.split('/')[1];\n actionName = 'sendMessageUploadDocumentAction';\n } else if(isPhoto) {\n attachType = 'photo';\n apiFileName = 'photo.' + fileType.split('/')[1];\n actionName = 'sendMessageUploadPhotoAction';\n\n const photoSize = {\n _: 'photoSize',\n w: options.width,\n h: options.height,\n type: THUMB_TYPE_FULL,\n location: null,\n size: file.size\n } as PhotoSize.photoSize;\n\n photo = {\n _: 'photo',\n id: '' + message.id,\n sizes: [photoSize],\n w: options.width,\n h: options.height\n } as any;\n\n if(strippedPhotoSize) {\n photo.sizes.unshift(strippedPhotoSize);\n }\n\n const cacheContext = this.thumbsStorage.getCacheContext(photo, photoSize.type);\n cacheContext.downloaded = file.size;\n cacheContext.url = options.objectURL || '';\n\n photo = this.appPhotosManager.savePhoto(photo);\n } else if(getEnvironment().VIDEO_MIME_TYPES_SUPPORTED.has(fileType as VIDEO_MIME_TYPE)) {\n attachType = 'video';\n apiFileName = 'video.mp4';\n actionName = 'sendMessageUploadVideoAction';\n\n const videoAttribute: DocumentAttribute.documentAttributeVideo = {\n _: 'documentAttributeVideo',\n pFlags: {\n round_message: options.isRoundMessage || undefined,\n supports_streaming: true\n },\n duration: options.duration,\n w: options.width,\n h: options.height\n };\n\n attributes.push(videoAttribute);\n\n // * must follow after video attribute\n if(options.noSound &&\n file.size > (10 * 1024) &&\n file.size < (10 * 1024 * 1024)) {\n attributes.push({\n _: 'documentAttributeAnimated'\n });\n }\n } else {\n attachType = 'document';\n apiFileName = 'document.' + fileType.split('/')[1];\n actionName = 'sendMessageUploadDocumentAction';\n }\n\n attributes.push({_: 'documentAttributeFilename', file_name: fileName || apiFileName});\n\n if((['document', 'video', 'audio', 'voice'] as (typeof attachType)[]).indexOf(attachType) !== -1 && !isDocument) {\n const thumbs: PhotoSize[] = [];\n document = {\n _: 'document',\n id: '' + message.id,\n duration: options.duration,\n attributes,\n w: options.width,\n h: options.height,\n thumbs,\n mime_type: fileType,\n size: file.size\n } as any;\n\n if(options.objectURL) {\n const cacheContext = this.thumbsStorage.getCacheContext(document);\n cacheContext.downloaded = file.size;\n cacheContext.url = options.objectURL;\n }\n\n let thumb: PhotoSize.photoSize;\n if(isPhoto) {\n attributes.push({\n _: 'documentAttributeImageSize',\n w: options.width,\n h: options.height\n });\n\n thumb = {\n _: 'photoSize',\n w: options.width,\n h: options.height,\n type: THUMB_TYPE_FULL,\n size: file.size\n };\n } else if(attachType === 'video') {\n if(options.thumb) {\n thumb = {\n _: 'photoSize',\n w: options.thumb.size.width,\n h: options.thumb.size.height,\n type: 'local-thumb',\n size: options.thumb.blob.size\n };\n\n const thumbCacheContext = this.thumbsStorage.getCacheContext(document, thumb.type);\n thumbCacheContext.downloaded = thumb.size;\n thumbCacheContext.url = options.thumb.url;\n }\n }\n\n if(thumb) {\n thumbs.push(thumb);\n }\n\n if(strippedPhotoSize) {\n thumbs.unshift(strippedPhotoSize);\n }\n\n /* if(thumbs.length) {\n const thumb = thumbs[0] as PhotoSize.photoSize;\n const docThumb = appPhotosManager.getDocumentCachedThumb(document.id);\n docThumb.downloaded = thumb.size;\n docThumb.url = thumb.url;\n } */\n\n document = this.appDocsManager.saveDoc(document);\n }\n\n this.log('sendFile', attachType, apiFileName, file.type, options);\n\n const sentDeferred = deferredPromise();\n // sentDeferred.cancel = () => {\n // const error = new Error('Download canceled');\n // error.name = 'AbortError';\n // sentDeferred.reject(error);\n\n // if(uploadPromise?.cancel) {\n // uploadPromise.cancel();\n // }\n // };\n\n const media: MessageMedia = isDocument ? undefined : {\n _: photo ? 'messageMediaPhoto' : 'messageMediaDocument',\n pFlags: {},\n // preloader,\n photo,\n document\n };\n\n if(media) {\n defineNotNumerableProperties(media as any, ['promise']);\n (media as any).promise = sentDeferred;\n\n if(options.spoiler) {\n (media as MessageMedia.messageMediaPhoto).pFlags.spoiler = true;\n }\n }\n\n message.entities = entities;\n message.message = caption;\n message.media = isDocument ? {\n _: 'messageMediaDocument',\n pFlags: {},\n document: file\n } as MessageMedia.messageMediaDocument : media;\n\n const uploadingFileName = !isDocument ? getFileNameForUpload(file) : undefined;\n message.uploadingFileName = uploadingFileName;\n\n if(uploadingFileName) {\n this.uploadFilePromises[uploadingFileName] = sentDeferred;\n }\n\n const toggleError = (error?: ApiError) => {\n this.onMessagesSendError([message], error);\n this.rootScope.dispatchEvent('messages_pending');\n };\n\n let uploaded = false,\n uploadPromise: ReturnType = null;\n\n message.send = () => {\n if(isDocument) {\n const inputMedia: InputMedia = {\n _: 'inputMediaDocument',\n id: getDocumentInput(file),\n pFlags: {}\n };\n\n sentDeferred.resolve(inputMedia);\n } else if(file instanceof File || file instanceof Blob) {\n const load = () => {\n if(!uploaded || message.error) {\n uploaded = false;\n\n uploadPromise = this.apiFileManager.upload({file, fileName: uploadingFileName});\n uploadPromise.catch((err) => {\n if(!uploaded) {\n this.log('cancelling upload', media);\n\n this.cancelPendingMessage(message.random_id);\n this.setTyping(peerId, {_: 'sendMessageCancelAction'}, undefined, options.threadId);\n sentDeferred.reject(err);\n }\n });\n\n uploadPromise.addNotifyListener((progress: Progress) => {\n /* if(DEBUG) {\n this.log('upload progress', progress);\n } */\n\n const percents = Math.max(1, Math.floor(100 * progress.done / progress.total));\n if(actionName) {\n this.setTyping(peerId, {_: actionName, progress: percents | 0}, undefined, options.threadId);\n }\n sentDeferred.notifyAll(progress);\n });\n\n sentDeferred.notifyAll({done: 0, total: file.size});\n }\n\n let thumbUploadPromise: typeof uploadPromise;\n if(attachType === 'video' && options.objectURL && options.thumb?.blob) {\n thumbUploadPromise = this.apiFileManager.upload({file: options.thumb.blob});\n }\n\n uploadPromise && uploadPromise.then(async(inputFile) => {\n /* if(DEBUG) {\n this.log('appMessagesManager: sendFile uploaded:', inputFile);\n } */\n\n inputFile.name = apiFileName;\n uploaded = true;\n let inputMedia: InputMedia;\n switch(attachType) {\n case 'photo':\n inputMedia = {\n _: 'inputMediaUploadedPhoto',\n file: inputFile,\n pFlags: {\n spoiler: options.spoiler || undefined\n }\n };\n break;\n\n default:\n inputMedia = {\n _: 'inputMediaUploadedDocument',\n file: inputFile,\n mime_type: fileType,\n pFlags: {\n force_file: actionName === 'sendMessageUploadDocumentAction' || undefined,\n spoiler: options.spoiler || undefined\n // nosound_video: options.noSound ? true : undefined\n },\n attributes\n };\n }\n\n if(thumbUploadPromise) {\n try {\n const inputFile = await thumbUploadPromise;\n (inputMedia as InputMedia.inputMediaUploadedDocument).thumb = inputFile;\n } catch(err) {\n this.log.error('sendFile thumb upload error:', err);\n }\n }\n\n sentDeferred.resolve(inputMedia);\n }, (error: ApiError) => {\n toggleError(error);\n throw error;\n });\n\n return sentDeferred;\n };\n\n if(options.isGroupedItem) {\n load();\n } else {\n this.sendSmthLazyLoadQueue.push({\n load\n });\n }\n }\n\n return sentDeferred;\n };\n\n this.beforeMessageSending(message, {\n isGroupedItem: options.isGroupedItem,\n isScheduled: !!options.scheduleDate || undefined,\n threadId: options.threadId,\n clearDraft: options.clearDraft,\n processAfter: options.processAfter\n });\n\n if(!options.isGroupedItem) {\n sentDeferred.then((inputMedia) => {\n this.setTyping(peerId, {_: 'sendMessageCancelAction'}, undefined, options.threadId);\n\n return this.apiManager.invokeApi('messages.sendMedia', {\n background: options.background,\n peer: this.appPeersManager.getInputPeerById(peerId),\n media: inputMedia,\n message: caption,\n random_id: message.random_id,\n reply_to_msg_id: replyToMsgId,\n schedule_date: options.scheduleDate,\n silent: options.silent,\n entities,\n clear_draft: options.clearDraft,\n send_as: options.sendAsPeerId ? this.appPeersManager.getInputPeerById(options.sendAsPeerId) : undefined,\n update_stickersets_order: options.updateStickersetOrder\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n }, (error: ApiError) => {\n if(attachType === 'photo' &&\n error.code === 400 &&\n (error.type === 'PHOTO_INVALID_DIMENSIONS' ||\n error.type === 'PHOTO_SAVE_FILE_INVALID')) {\n error.handled = true;\n attachType = 'document';\n message.send();\n return;\n }\n\n toggleError(error);\n throw error;\n });\n });\n\n sentDeferred.then(message.promise.resolve, message.promise.reject);\n }\n\n const ret: {\n message: typeof message,\n promise: typeof sentDeferred\n } = {\n message\n } as any;\n\n defineNotNumerableProperties(ret, ['promise']);\n ret.promise = sentDeferred;\n\n return ret;\n }\n\n public async sendAlbum(peerId: PeerId, options: MessageSendingParams & {\n isMedia?: boolean,\n entities?: MessageEntity[],\n caption?: string,\n sendFileDetails: SendFileDetails[],\n clearDraft?: boolean\n }) {\n // this.checkSendOptions(options);\n\n if(options.threadId && !options.replyToMsgId) {\n options.replyToMsgId = options.threadId;\n }\n\n if(options.sendFileDetails.length === 1) {\n return this.sendFile(peerId, {...options, ...options.sendFileDetails[0]});\n }\n\n peerId = this.appPeersManager.getPeerMigratedTo(peerId) || peerId;\n const replyToMsgId = options.replyToMsgId ? getServerMessageId(options.replyToMsgId) : undefined;\n\n let caption = options.caption || '';\n let entities = options.entities || [];\n if(caption) {\n caption = parseMarkdown(caption, entities);\n }\n\n this.log('sendAlbum', options);\n\n const groupId = '' + ++this.groupedTempId;\n\n const callbacks: Array<() => void> = [];\n const processAfter = (cb: () => void) => {\n callbacks.push(cb);\n };\n\n const messages = options.sendFileDetails.map((details, idx) => {\n const o: Parameters[1] = {\n isGroupedItem: true,\n isMedia: options.isMedia,\n scheduleDate: options.scheduleDate,\n silent: options.silent,\n replyToMsgId,\n threadId: options.threadId,\n sendAsPeerId: options.sendAsPeerId,\n groupId,\n processAfter,\n ...details\n };\n\n if(idx === 0) {\n o.caption = caption;\n o.entities = entities;\n // o.replyToMsgId = replyToMsgId;\n }\n\n return this.sendFile(peerId, o).message;\n });\n\n if(options.clearDraft) {\n callbacks.push(() => {\n this.appDraftsManager.clearDraft(peerId, options.threadId);\n });\n }\n\n callbacks.forEach((callback) => {\n callback();\n });\n\n // * test pending\n // return;\n\n const toggleError = (message: Message.message, error?: ApiError) => {\n this.onMessagesSendError([message], error);\n this.rootScope.dispatchEvent('messages_pending');\n };\n\n const inputPeer = this.appPeersManager.getInputPeerById(peerId);\n const invoke = (multiMedia: InputSingleMedia[]) => {\n this.setTyping(peerId, {_: 'sendMessageCancelAction'}, undefined, options.threadId);\n\n const deferred = deferredPromise();\n this.sendSmthLazyLoadQueue.push({\n load: () => {\n return this.apiManager.invokeApi('messages.sendMultiMedia', {\n peer: inputPeer,\n multi_media: multiMedia,\n reply_to_msg_id: replyToMsgId,\n schedule_date: options.scheduleDate,\n silent: options.silent,\n clear_draft: options.clearDraft,\n send_as: options.sendAsPeerId ? this.appPeersManager.getInputPeerById(options.sendAsPeerId) : undefined,\n update_stickersets_order: options.updateStickersetOrder\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n deferred.resolve();\n }, (error: ApiError) => {\n messages.forEach((message) => toggleError(message, error));\n deferred.reject(error);\n });\n }\n });\n\n return deferred;\n };\n\n const promises: Promise[] = messages.map((message) => {\n return (message.send() as Promise).then((inputMedia) => {\n return Promise.all([\n inputMedia,\n this.apiManager.invokeApi('messages.uploadMedia', {\n peer: inputPeer,\n media: inputMedia\n })\n ]);\n })\n .then(([originalInputMedia, messageMedia]) => {\n let inputMedia: InputMedia;\n if(messageMedia._ === 'messageMediaPhoto') {\n const photo = this.appPhotosManager.savePhoto(messageMedia.photo);\n inputMedia = getPhotoMediaInput(photo);\n } else if(messageMedia._ === 'messageMediaDocument') {\n const doc = this.appDocsManager.saveDoc(messageMedia.document);\n inputMedia = getDocumentMediaInput(doc);\n }\n\n // copy original flags\n const copyProperties: (keyof InputMedia.inputMediaPhoto)[] = [\n 'pFlags',\n 'ttl_seconds'\n ];\n\n copyProperties.forEach((property) => {\n // @ts-ignore\n inputMedia[property] = originalInputMedia[property] ?? inputMedia[property];\n });\n\n const inputSingleMedia: InputSingleMedia = {\n _: 'inputSingleMedia',\n media: inputMedia,\n random_id: message.random_id,\n message: caption,\n entities\n };\n\n // * only 1 caption for all inputs\n if(caption) {\n caption = '';\n entities = [];\n }\n\n return inputSingleMedia;\n }).catch((err: ApiError) => {\n this.log.error('sendAlbum upload item error:', err, message);\n toggleError(message, err);\n throw err;\n });\n });\n\n return Promise.all(promises).then((inputs) => {\n return invoke(inputs.filter(Boolean));\n });\n }\n\n public sendContact(peerId: PeerId, contactPeerId: PeerId) {\n return this.sendOther(peerId, this.appUsersManager.getContactMediaInput(contactPeerId));\n }\n\n public sendOther(\n peerId: PeerId,\n inputMedia: InputMedia | {_: 'messageMediaPending', messageMedia: MessageMedia},\n options: MessageSendingParams & Partial<{\n viaBotId: BotId,\n replyMarkup: ReplyMarkup,\n clearDraft: true,\n queryId: string\n resultId: string,\n geoPoint: GeoPoint\n }> = {}\n ) {\n peerId = this.appPeersManager.getPeerMigratedTo(peerId) || peerId;\n\n // this.checkSendOptions(options);\n const message = this.generateOutgoingMessage(peerId, options);\n const replyToMsgId = options.replyToMsgId ? getServerMessageId(options.replyToMsgId) : undefined;\n\n let media: MessageMedia;\n switch(inputMedia._) {\n case 'inputMediaPoll': {\n const pollId = '' + message.id;\n inputMedia.poll.id = pollId;\n this.appPollsManager.savePoll(inputMedia.poll, {\n _: 'pollResults',\n flags: 4,\n total_voters: 0,\n pFlags: {},\n recent_voters: []\n });\n\n const {poll, results} = this.appPollsManager.getPoll(pollId);\n media = {\n _: 'messageMediaPoll',\n poll,\n results\n };\n\n break;\n }\n\n case 'inputMediaPhoto': {\n media = {\n _: 'messageMediaPhoto',\n photo: this.appPhotosManager.getPhoto((inputMedia.id as InputPhoto.inputPhoto).id),\n pFlags: {}\n };\n break;\n }\n\n case 'inputMediaDocument': {\n const doc = this.appDocsManager.getDoc((inputMedia.id as InputDocument.inputDocument).id);\n /* if(doc.sticker && doc.stickerSetInput) {\n appStickersManager.pushPopularSticker(doc.id);\n } */\n media = {\n _: 'messageMediaDocument',\n document: doc,\n pFlags: {}\n };\n break;\n }\n\n case 'inputMediaContact': {\n media = {\n _: 'messageMediaContact',\n phone_number: inputMedia.phone_number,\n first_name: inputMedia.first_name,\n last_name: inputMedia.last_name,\n user_id: inputMedia.user_id ?? '0',\n vcard: inputMedia.vcard\n };\n break;\n }\n\n case 'inputMediaGeoPoint': {\n media = {\n _: 'messageMediaGeo',\n geo: options.geoPoint\n };\n break;\n }\n\n case 'inputMediaVenue': {\n media = {\n _: 'messageMediaVenue',\n geo: options.geoPoint,\n title: inputMedia.title,\n address: inputMedia.address,\n provider: inputMedia.provider,\n venue_id: inputMedia.venue_id,\n venue_type: inputMedia.venue_type\n };\n break;\n }\n\n case 'messageMediaPending': {\n media = (inputMedia as any).messageMedia;\n break;\n }\n }\n\n message.media = media;\n\n const toggleError = (error?: ApiError) => {\n this.onMessagesSendError([message], error);\n this.rootScope.dispatchEvent('messages_pending');\n };\n\n message.send = () => {\n const sentRequestOptions: PendingAfterMsg = {};\n if(this.pendingAfterMsgs[peerId]) {\n sentRequestOptions.afterMessageId = this.pendingAfterMsgs[peerId].messageId;\n }\n\n const sendAs = options.sendAsPeerId ? this.appPeersManager.getInputPeerById(options.sendAsPeerId) : undefined;\n let apiPromise: Promise;\n if(options.viaBotId) {\n apiPromise = this.apiManager.invokeApiAfter('messages.sendInlineBotResult', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n random_id: message.random_id,\n reply_to_msg_id: replyToMsgId || undefined,\n query_id: options.queryId,\n id: options.resultId,\n clear_draft: options.clearDraft,\n schedule_date: options.scheduleDate,\n silent: options.silent,\n send_as: sendAs\n }, sentRequestOptions);\n } else {\n apiPromise = this.apiManager.invokeApiAfter('messages.sendMedia', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n media: inputMedia as InputMedia,\n random_id: message.random_id,\n reply_to_msg_id: replyToMsgId || undefined,\n message: '',\n clear_draft: options.clearDraft,\n schedule_date: options.scheduleDate,\n silent: options.silent,\n send_as: sendAs,\n update_stickersets_order: options.updateStickersetOrder\n }, sentRequestOptions);\n }\n\n this.pendingAfterMsgs[peerId] = sentRequestOptions;\n\n return apiPromise.then((updates) => {\n if(updates.updates) {\n updates.updates.forEach((update: Update) => {\n if(update._ === 'updateDraftMessage') {\n update.local = true;\n }\n });\n }\n\n this.apiUpdatesManager.processUpdateMessage(updates);\n }, (error: ApiError) => {\n toggleError(error);\n throw error;\n }).finally(() => {\n if(this.pendingAfterMsgs[peerId] === sentRequestOptions) {\n delete this.pendingAfterMsgs[peerId];\n }\n });\n };\n\n this.beforeMessageSending(message, {\n isScheduled: !!options.scheduleDate || undefined,\n threadId: options.threadId,\n clearDraft: options.clearDraft,\n sequential: true\n });\n\n return message.promise;\n }\n\n /* private checkSendOptions(options: Partial<{\n scheduleDate: number\n }>) {\n if(options.scheduleDate) {\n const minTimestamp = (Date.now() / 1000 | 0) + 10;\n if(options.scheduleDate <= minTimestamp) {\n delete options.scheduleDate;\n }\n }\n } */\n\n private beforeMessageSending(message: Message.message, options: Pick & Partial<{\n isGroupedItem: boolean,\n isScheduled: boolean,\n clearDraft: boolean,\n sequential: boolean,\n processAfter?: (cb: () => void) => void\n }> = {}) {\n const messageId = message.id;\n const peerId = this.getMessagePeer(message);\n const storage = options.isScheduled ? this.getScheduledMessagesStorage(peerId) : this.getHistoryMessagesStorage(peerId);\n message.storageKey = storage.key;\n const callbacks: Array<() => void> = [];\n if(options.isScheduled) {\n // if(!options.isGroupedItem) {\n this.saveMessages([message], {storage, isScheduled: true, isOutgoing: true});\n callbacks.push(() => {\n this.rootScope.dispatchEvent('scheduled_new', message);\n });\n } else {\n /* if(options.threadId && this.threadsStorage[peerId]) {\n delete this.threadsStorage[peerId][options.threadId];\n } */\n const storages: HistoryStorage[] = [\n this.getHistoryStorage(peerId),\n options.threadId ? this.getHistoryStorage(peerId, options.threadId) : undefined\n ];\n\n for(const storage of storages) {\n if(storage) {\n storage.history.unshift(messageId);\n }\n }\n\n this.saveMessages([message], {storage, isOutgoing: true});\n this.setDialogTopMessage(message);\n\n if(options.threadId) {\n const forumTopic = this.dialogsStorage.getForumTopic(peerId, options.threadId);\n if(forumTopic) {\n this.setDialogTopMessage(message, forumTopic);\n }\n }\n\n callbacks.push(() => {\n this.rootScope.dispatchEvent('history_append', {storageKey: storage.key, message});\n });\n }\n\n const pending: PendingMessageDetails = this.pendingByRandomId[message.random_id] = {\n peerId,\n tempId: messageId,\n threadId: options.threadId,\n storage,\n sequential: options.sequential\n };\n\n this.pendingTopMsgs[peerId] = messageId;\n\n if(!options.isGroupedItem && message.send) {\n callbacks.push(() => {\n if(options.clearDraft) {\n this.appDraftsManager.clearDraft(peerId, options.threadId);\n }\n\n message.send();\n });\n }\n\n if(callbacks.length) {\n (options.processAfter || processAfter)(() => {\n for(const callback of callbacks) {\n callback();\n }\n });\n }\n\n return pending;\n }\n\n private generateOutgoingMessage(peerId: PeerId, options: MessageSendingParams & Partial<{\n viaBotId: BotId,\n groupId: string,\n replyMarkup: ReplyMarkup,\n }>) {\n if(options.threadId && !options.replyToMsgId) {\n options.replyToMsgId = options.threadId;\n }\n\n let postAuthor: string;\n const isBroadcast = this.appPeersManager.isBroadcast(peerId);\n if(isBroadcast) {\n const chat = this.appPeersManager.getPeer(peerId) as Chat.channel;\n if(chat.pFlags.signatures) {\n const user = this.appUsersManager.getSelf();\n const fullName = user.first_name + (user.last_name ? ' ' + user.last_name : '');\n postAuthor = fullName;\n }\n }\n\n const message: Message.message = {\n _: 'message',\n id: this.generateTempMessageId(peerId),\n from_id: options.sendAsPeerId ? this.appPeersManager.getOutputPeer(options.sendAsPeerId) : this.generateFromId(peerId),\n peer_id: this.appPeersManager.getOutputPeer(peerId),\n post_author: postAuthor,\n pFlags: this.generateFlags(peerId),\n date: options.scheduleDate || (tsNow(true) + this.timeManager.getServerTimeOffset()),\n message: '',\n grouped_id: options.groupId,\n random_id: randomLong(),\n reply_to: this.generateReplyHeader(peerId, options.replyToMsgId, options.threadId),\n via_bot_id: options.viaBotId,\n reply_markup: options.replyMarkup,\n replies: this.generateReplies(peerId),\n views: isBroadcast && 1,\n pending: true\n };\n\n defineNotNumerableProperties(message, ['send', 'promise']);\n if(options.groupId === undefined) {\n message.promise = deferredPromise();\n }\n\n return message;\n }\n\n private generateReplyHeader(peerId: PeerId, replyToMsgId: number, replyToTopId?: number) {\n const isForum = this.appPeersManager.isForum(peerId);\n if(isForum && !replyToTopId) {\n const originalMessage = this.getMessageByPeer(peerId, replyToMsgId);\n if(originalMessage) {\n replyToTopId = getMessageThreadId(originalMessage, true);\n }\n }\n\n const header: MessageReplyHeader = {\n _: 'messageReplyHeader',\n reply_to_msg_id: replyToMsgId || replyToTopId,\n pFlags: {}\n };\n\n if(replyToTopId && isForum && GENERAL_TOPIC_ID !== replyToTopId) {\n header.pFlags.forum_topic = true;\n }\n\n if(replyToTopId && header.reply_to_msg_id !== replyToTopId) {\n header.reply_to_top_id = replyToTopId;\n }\n\n return header;\n }\n\n private generateReplies(peerId: PeerId) {\n let replies: MessageReplies.messageReplies;\n if(this.appPeersManager.isBroadcast(peerId)) {\n const channelFull = this.appProfileManager.getCachedFullChat(peerId.toChatId()) as ChatFull.channelFull;\n if(channelFull?.linked_chat_id) {\n replies = {\n _: 'messageReplies',\n flags: 1,\n pFlags: {\n comments: true\n },\n channel_id: channelFull.linked_chat_id,\n replies: 0,\n replies_pts: 0\n };\n }\n }\n\n return replies;\n }\n\n /**\n * Generate correct from_id according to anonymous or broadcast\n */\n private generateFromId(peerId: PeerId) {\n if(this.appPeersManager.isAnyChat(peerId) && (this.appPeersManager.isBroadcast(peerId) || this.isAnonymousSending(peerId))) {\n return undefined;\n } else {\n return this.appPeersManager.getOutputPeer(this.appUsersManager.getSelf().id.toPeerId());\n }\n }\n\n private generateFlags(peerId: PeerId) {\n const pFlags: Message.message['pFlags'] = {};\n const fromId = this.appUsersManager.getSelf().id;\n if(peerId !== fromId) {\n pFlags.out = true;\n\n if(!this.appPeersManager.isChannel(peerId) && !this.appUsersManager.isBot(peerId)) {\n pFlags.unread = true;\n }\n }\n\n if(this.appPeersManager.isBroadcast(peerId)) {\n pFlags.post = true;\n }\n\n return pFlags;\n }\n\n private generateForwardHeader(peerId: PeerId, originalMessage: Message.message) {\n const myId = this.appUsersManager.getSelf().id.toPeerId();\n const fromId = originalMessage.fromId;\n if(fromId === myId && originalMessage.peerId === myId && !originalMessage.fwd_from) {\n return;\n }\n\n const fwdHeader: MessageFwdHeader.messageFwdHeader = {\n _: 'messageFwdHeader',\n flags: 0,\n date: originalMessage.date,\n pFlags: {}\n };\n\n let isUserHidden = false;\n if(originalMessage.fwd_from) {\n fwdHeader.from_id = originalMessage.fwd_from.from_id;\n fwdHeader.from_name = originalMessage.fwd_from.from_name;\n fwdHeader.post_author = originalMessage.fwd_from.post_author;\n } else {\n fwdHeader.post_author = originalMessage.post_author;\n\n if(fromId.isUser()) {\n const userFull = this.appProfileManager.getCachedFullUser(fromId.toUserId());\n if(userFull?.private_forward_name) {\n fwdHeader.from_name = userFull.private_forward_name;\n isUserHidden = true;\n }\n }\n\n if(!isUserHidden) {\n fwdHeader.from_id = this.appPeersManager.getOutputPeer(fromId);\n }\n }\n\n if(this.appPeersManager.isBroadcast(originalMessage.peerId)) {\n if(originalMessage.post_author) {\n fwdHeader.post_author = originalMessage.post_author;\n }\n\n fwdHeader.channel_post = originalMessage.id;\n }\n\n if(peerId === myId && !isUserHidden) {\n fwdHeader.saved_from_msg_id = originalMessage.id;\n fwdHeader.saved_from_peer = this.appPeersManager.getOutputPeer(originalMessage.peerId);\n }\n\n return fwdHeader;\n }\n\n public generateFakeAvatarMessage(peerId: PeerId, photo: Photo) {\n const maxId = Number.MAX_SAFE_INTEGER;\n const message: Message.messageService = {\n _: 'messageService',\n pFlags: {},\n action: {\n _: 'messageActionChannelEditPhoto',\n photo\n },\n id: maxId,\n peer_id: this.appPeersManager.getOutputPeer(peerId),\n mid: maxId,\n peerId,\n date: (photo as Photo.photo).date,\n fromId: peerId\n };\n\n this.getHistoryMessagesStorage(peerId).set(maxId, message);\n return message;\n }\n\n public getUploadPromise(uploadFileName: string) {\n return this.uploadFilePromises[uploadFileName];\n }\n\n public isAnonymousSending(peerId: PeerId): boolean {\n if(!peerId.isAnyChat()) {\n return false;\n }\n\n const chat = this.appPeersManager.getPeer(peerId);\n return (chat as Chat.channel).admin_rights?.pFlags?.anonymous;\n }\n\n public setDialogTopMessage(\n message: MyMessage,\n dialog: MTDialog.dialog | ForumTopic = this.getDialogOnly(message.peerId)\n ) {\n if(!dialog) {\n return;\n }\n\n dialog.top_message = message.mid;\n\n const historyStorage = this.getHistoryStorage(message.peerId, dialog._ === 'forumTopic' ? dialog.id : undefined);\n historyStorage.maxId = message.mid;\n\n this.dialogsStorage.generateIndexForDialog(dialog, false, message);\n\n this.scheduleHandleNewDialogs(message.peerId, dialog);\n }\n\n public cancelPendingMessage(randomId: string) {\n const pendingData = this.pendingByRandomId[randomId];\n\n /* if(DEBUG) {\n this.log('cancelPendingMessage', randomId, pendingData);\n } */\n\n if(pendingData) {\n const {peerId, tempId, storage} = pendingData;\n const historyStorage = this.getHistoryStorage(peerId);\n\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateDeleteMessages',\n messages: [tempId],\n pts: undefined,\n pts_count: undefined\n });\n\n historyStorage.history.delete(tempId);\n\n delete this.pendingByRandomId[randomId];\n storage.delete(tempId);\n\n return true;\n }\n\n return false;\n }\n\n /* public async refreshConversations() {\n const limit = 200, outDialogs: Dialog[] = [];\n for(let folderId = 0; folderId < 2; ++folderId) {\n let offsetDate = 0;\n for(;;) {\n const {dialogs, isEnd} = await this.getTopMessages(limit, folderId, offsetDate);\n\n if(dialogs.length) {\n outDialogs.push(...dialogs as Dialog[]);\n const dialog = dialogs[dialogs.length - 1];\n\n // * get peerId and mid manually, because dialog can be migrated peer and it won't be saved\n const peerId = getPeerId(dialog.peer);\n const mid = generateMessageId(dialog.top_message);\n offsetDate = this.getMessageByPeer(peerId, mid).date;\n\n if(!offsetDate) {\n console.error('refreshConversations: got no offsetDate', dialog);\n break;\n }\n }\n\n if(isEnd) {\n break;\n }\n }\n }\n\n let obj: {[peerId: string]: Dialog} = {};\n outDialogs.forEach((dialog) => {\n obj[dialog.peerId] = dialog;\n });\n rootScope.dispatchEvent('dialogs_multiupdate', obj);\n\n return outDialogs;\n } */\n\n public async fillConversations(folderId = GLOBAL_FOLDER_ID): Promise {\n const middleware = this.middleware.get();\n while(!this.dialogsStorage.isDialogsLoaded(folderId)) {\n const result = await this.getTopMessages({limit: 100, folderId});\n if(!middleware() || result.isEnd) {\n break;\n }\n }\n }\n\n /* public async getConversationsAll(query = '', folderId = 0) {\n const limit = 200, outDialogs: Dialog[] = [];\n for(; folderId < 2; ++folderId) {\n let offsetIndex = 0;\n for(;;) {\n const {dialogs} = await appMessagesManager.getConversations(query, offsetIndex, limit, folderId).promise;\n\n if(dialogs.length) {\n outDialogs.push(...dialogs);\n offsetIndex = dialogs[dialogs.length - 1].index || 0;\n } else {\n break;\n }\n }\n }\n\n return outDialogs;\n } */\n\n public getReadMaxIdIfUnread(peerId: PeerId, threadId?: number) {\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n if(threadId && !this.appChatsManager.isForum(peerId.toChatId())) {\n const chatHistoryStorage = this.getHistoryStorage(peerId);\n const readMaxId = Math.max(chatHistoryStorage.readMaxId ?? 0, historyStorage.readMaxId);\n const message = this.getMessageByPeer(peerId, historyStorage.maxId); // usually message is missing, so pFlags.out won't be there anyway\n return !message?.pFlags?.out && readMaxId < historyStorage.maxId ? readMaxId : 0;\n } else {\n const message = this.getMessageByPeer(peerId, historyStorage.maxId);\n const readMaxId = peerId.isUser() ? Math.max(historyStorage.readMaxId, historyStorage.readOutboxMaxId) : historyStorage.readMaxId;\n // readMaxId can be 4294967295 (0)\n return !message?.pFlags?.out && readMaxId < historyStorage.maxId && getServerMessageId(readMaxId) ? readMaxId : 0;\n }\n }\n\n // public lolSet = new Set();\n public getTopMessages({limit, folderId}: {\n limit: number,\n folderId: number\n }) {\n // const dialogs = this.dialogsStorage.getFolder(folderId);\n const offsetId = 0;\n let offsetPeerId: PeerId;\n let offsetIndex = 0;\n\n let offsetDate = this.dialogsStorage.getOffsetDate(folderId);\n if(offsetDate) {\n offsetIndex = offsetDate * 0x10000;\n offsetDate += this.timeManager.getServerTimeOffset();\n }\n\n const useLimit = 100;\n const middleware = this.middleware.get();\n const peerId = this.dialogsStorage.isFilterIdForForum(folderId) ? folderId : undefined;\n\n const processResult = (result: MessagesDialogs | MessagesForumTopics) => {\n if(!middleware() || result._ === 'messages.dialogsNotModified') return null;\n\n if(DEBUG) {\n this.log('messages.getDialogs result:', result);\n }\n\n // can reset pinned order here\n if(!peerId && !offsetId && !offsetDate && !offsetPeerId && folderId !== GLOBAL_FOLDER_ID) {\n this.dialogsStorage.resetPinnedOrder(folderId);\n }\n\n if(!peerId && !offsetDate) {\n // telegramMeWebManager.setAuthorized(true);\n this.appDraftsManager.addMissedDialogs();\n }\n\n this.appUsersManager.saveApiUsers(result.users);\n this.appChatsManager.saveApiChats(result.chats);\n this.saveMessages(result.messages);\n\n let maxSeenIdIncremented = offsetDate ? true : false;\n let hasPrepend = false;\n const noIdsDialogs: BroadcastEvents['dialogs_multiupdate'] = new Map();\n const setFolderId: REAL_FOLDER_ID = folderId === GLOBAL_FOLDER_ID ? FOLDER_ID_ALL : folderId as REAL_FOLDER_ID;\n const saveGlobalOffset = !!peerId || folderId === GLOBAL_FOLDER_ID;\n const items: Array =\n (result as MessagesDialogs.messagesDialogsSlice).dialogs as Dialog[] ||\n (result as MessagesForumTopics).topics as ForumTopic[];\n forEachReverse(items, (dialog) => {\n if(!dialog) {\n return;\n }\n\n // const d = Object.assign({}, dialog);\n // ! нужно передавать folderId, так как по папке !== 0 нет свойства folder_id\n if(!peerId) {\n (dialog as Dialog).folder_id ??= setFolderId;\n }\n\n this.dialogsStorage.saveDialog({\n dialog,\n ignoreOffsetDate: true,\n saveGlobalOffset\n });\n\n if(dialog.peerId === undefined) {\n this.log.error('bugged dialog?', dialog);\n debugger;\n return;\n }\n\n if(!maxSeenIdIncremented &&\n !this.appPeersManager.isChannel(dialog.peerId || this.appPeersManager.getPeerId(dialog.peer))) {\n this.incrementMaxSeenId(dialog.top_message);\n maxSeenIdIncremented = true;\n }\n\n // if(!folderId && !dialog.folder_id) {\n // this.lolSet.add(dialog.peerId);\n // }\n\n if(offsetIndex && getDialogIndex(dialog) > offsetIndex) {\n this.scheduleHandleNewDialogs(dialog.peerId, dialog);\n hasPrepend = true;\n }\n\n // ! это может случиться, если запрос идёт не по папке 0, а по 1. почему-то read'ов нет\n // ! в итоге, чтобы получить 1 диалог, делается первый запрос по папке 0, потом запрос для архивных по папке 1, и потом ещё перезагрузка архивного диалога\n if(!peerId && !getServerMessageId(dialog.read_inbox_max_id) && !getServerMessageId(dialog.read_outbox_max_id)) {\n noIdsDialogs.set(dialog.peerId, {dialog: dialog as Dialog});\n\n this.log.error('noIdsDialogs', dialog, params);\n } else if(dialog.top_message) { // * fix sending status\n const topMessage = this.getMessageByPeer(dialog.peerId, dialog.top_message);\n if(topMessage) {\n this.setMessageUnreadByDialog(topMessage, dialog);\n this.dialogsStorage.setDialogToState(dialog);\n }\n }\n });\n\n if(noIdsDialogs.size) {\n // setTimeout(() => { // test bad situation\n const peerIds = [...noIdsDialogs.keys()];\n const promises = peerIds.map((peerId) => this.reloadConversation(peerId));\n Promise.all(promises).then(() => {\n this.rootScope.dispatchEvent('dialogs_multiupdate', noIdsDialogs);\n\n for(let i = 0; i < peerIds.length; ++i) {\n const peerId = peerIds[i];\n this.rootScope.dispatchEvent('dialog_unread', {\n peerId,\n dialog: this.getDialogOnly(peerId)\n });\n }\n });\n // }, 10e3);\n }\n\n const count = (result as MessagesDialogs.messagesDialogsSlice).count;\n\n // exclude empty draft dialogs\n const folderDialogs = this.dialogsStorage.getFolderDialogs(folderId, false);\n let dialogsLength = 0;\n for(let i = 0, length = folderDialogs.length; i < length; ++i) {\n const dialog = folderDialogs[i];\n if(getServerMessageId(dialog.top_message)) {\n ++dialogsLength;\n } else {\n this.log.error('something strange with dialog', dialog);\n }\n }\n\n const isEnd = /* limit > dialogsResult.dialogs.length || */\n !count ||\n dialogsLength >= count ||\n !items.length;\n if(isEnd) {\n this.dialogsStorage.setDialogsLoaded(folderId, true);\n }\n\n if(hasPrepend) {\n this.scheduleHandleNewDialogs();\n } else {\n this.rootScope.dispatchEvent('dialogs_multiupdate', new Map());\n }\n\n const dialogs = items;\n const slicedDialogs = limit === useLimit ? dialogs : dialogs.slice(0, limit);\n return {\n isEnd: isEnd && slicedDialogs[slicedDialogs.length - 1] === dialogs[dialogs.length - 1],\n count,\n dialogs: slicedDialogs\n };\n };\n\n let promise: Promise>, params: any;\n if(peerId) {\n promise = this.apiManager.invokeApiSingleProcess({\n method: 'channels.getForumTopics',\n params: params = {\n channel: this.appChatsManager.getChannelInput(peerId.toChatId()),\n limit: useLimit,\n offset_date: offsetDate,\n offset_id: offsetId,\n offset_topic: 0\n },\n options: {\n // timeout: APITIMEOUT,\n noErrorBox: true\n },\n processResult: (result) => {\n result = this.dialogsStorage.processTopics(peerId, result);\n return processResult(result);\n }\n });\n } else {\n // ! ВНИМАНИЕ: ОЧЕНЬ СЛОЖНАЯ ЛОГИКА:\n // ! если делать запрос сначала по папке 0, потом по папке 1, по индексу 0 в массиве будет один и тот же диалог, с dialog.pFlags.pinned, ЛОЛ???\n // ! т.е., с запросом folder_id: 1, и exclude_pinned: 0, в результате будут ещё и закреплённые с папки 0\n promise = this.apiManager.invokeApiSingleProcess({\n method: 'messages.getDialogs',\n params: params = {\n folder_id: folderId,\n offset_date: offsetDate,\n offset_id: offsetId,\n offset_peer: this.appPeersManager.getInputPeerById(offsetPeerId),\n limit: useLimit,\n hash: '0'\n },\n options: {\n // timeout: APITIMEOUT,\n noErrorBox: true\n },\n processResult\n });\n }\n\n return promise;\n }\n\n public async forwardMessages(peerId: PeerId, fromPeerId: PeerId, mids: number[], options: MessageSendingParams & Partial<{\n withMyScore: true,\n dropAuthor: boolean,\n dropCaptions: boolean\n }> = {}) {\n delete options.replyToMsgId;\n delete options.threadId;\n\n peerId = this.appPeersManager.getPeerMigratedTo(peerId) || peerId;\n mids = mids.slice().sort((a, b) => a - b);\n\n for(let i = 0, length = mids.length; i < length; ++i) {\n const mid = mids[i];\n const originalMessage = this.getMessageByPeer(fromPeerId, mid) as Message.message;\n if(originalMessage.pFlags.is_outgoing) { // this can happen when forwarding a changelog\n this.sendText(peerId, originalMessage.message, {\n entities: originalMessage.entities,\n scheduleDate: options.scheduleDate,\n silent: options.silent\n });\n\n mids.splice(i--, 1);\n --length;\n }\n }\n\n if(!mids.length) {\n return Promise.resolve();\n }\n\n const config = await this.apiManager.getConfig();\n const overflowMids = mids.splice(config.forwarded_count_max, mids.length - config.forwarded_count_max);\n\n if(options.dropCaptions) {\n options.dropAuthor = true;\n }\n\n const groups: {\n [groupId: string]: {\n tempId: string,\n messages: Message.message[]\n }\n } = {};\n\n const newMids: number[] = [];\n const newMessages = mids.map((mid) => {\n const originalMessage = this.getMessageByPeer(fromPeerId, mid) as Message.message;\n const message: Message.message = this.generateOutgoingMessage(peerId, options);\n newMids.push(message.id);\n\n const keys: Array = [\n 'entities',\n 'media'\n // 'reply_markup'\n ];\n\n if(!options.dropAuthor) {\n message.fwd_from = this.generateForwardHeader(peerId, originalMessage);\n keys.push('views', 'forwards');\n\n if(message.fwd_from?.from_name && peerId === this.appPeersManager.peerId) {\n delete message.from_id;\n }\n }\n\n if(!options.dropCaptions || !originalMessage.media) {\n keys.push('message');\n }\n\n const replyToMid = originalMessage.reply_to?.reply_to_msg_id;\n const replyToMessageIdx = mids.indexOf(replyToMid);\n if(replyToMid && replyToMessageIdx !== -1) {\n const newReplyToMid = newMids[replyToMessageIdx];\n message.reply_to = {\n _: 'messageReplyHeader',\n reply_to_msg_id: newReplyToMid,\n pFlags: {}\n };\n\n /* this.invokeAfterMessageIsSent(newReplyToMid, 'reply', async(originalMessage) => {\n message.reply_to.reply_to_msg_id = originalMessage.mid;\n }); */\n }\n\n keys.forEach((key) => {\n // @ts-ignore\n message[key] = copy(originalMessage[key]);\n });\n\n const document = (message.media as MessageMedia.messageMediaDocument)?.document as MyDocument;\n if(document) {\n const types: MyDocument['type'][] = ['round', 'voice'];\n if(types.includes(document.type)) {\n (message as MyMessage).pFlags.media_unread = true;\n }\n\n if(document.sticker && !this.rootScope.premium) {\n const effectThumb = getStickerEffectThumb(document);\n if(effectThumb) {\n (message.media as MessageMedia.messageMediaDocument).pFlags.nopremium = true;\n }\n }\n }\n\n if(originalMessage.grouped_id) {\n const group = groups[originalMessage.grouped_id] ??= {tempId: '' + ++this.groupedTempId, messages: []};\n group.messages.push(message);\n }\n\n return message;\n });\n\n for(const groupId in groups) {\n const group = groups[groupId];\n if(group.messages.length > 1) {\n group.messages.forEach((message) => {\n message.grouped_id = group.tempId;\n });\n }\n }\n\n newMessages.forEach((message) => {\n this.beforeMessageSending(message, {\n isScheduled: !!options.scheduleDate || undefined,\n sequential: true\n });\n });\n\n const sentRequestOptions: PendingAfterMsg = {};\n if(this.pendingAfterMsgs[peerId]) {\n sentRequestOptions.afterMessageId = this.pendingAfterMsgs[peerId].messageId;\n }\n\n const promise = /* true ? Promise.resolve() : */this.apiManager.invokeApiAfter('messages.forwardMessages', {\n from_peer: this.appPeersManager.getInputPeerById(fromPeerId),\n id: mids.map((mid) => getServerMessageId(mid)),\n random_id: newMessages.map((message) => message.random_id),\n to_peer: this.appPeersManager.getInputPeerById(peerId),\n with_my_score: options.withMyScore,\n silent: options.silent,\n schedule_date: options.scheduleDate,\n drop_author: options.dropAuthor,\n drop_media_captions: options.dropCaptions,\n send_as: options.sendAsPeerId ? this.appPeersManager.getInputPeerById(options.sendAsPeerId) : undefined\n }, sentRequestOptions).then((updates) => {\n this.log('forwardMessages updates:', updates);\n this.apiUpdatesManager.processUpdateMessage(updates);\n }, (error: ApiError) => {\n this.onMessagesSendError(newMessages, error);\n throw error;\n }).finally(() => {\n if(this.pendingAfterMsgs[peerId] === sentRequestOptions) {\n delete this.pendingAfterMsgs[peerId];\n }\n });\n\n this.pendingAfterMsgs[peerId] = sentRequestOptions;\n\n const promises: (typeof promise)[] = [promise];\n if(overflowMids.length) {\n promises.push(this.forwardMessages(peerId, fromPeerId, overflowMids, options));\n }\n\n return Promise.all(promises).then(noop);\n }\n\n public generateEmptyMessage(mid: number): Message.message | Message.messageService {\n return undefined;\n // return {\n // _: 'messageEmpty',\n // id: getServerMessageId(mid),\n // mid,\n // deleted: true,\n // pFlags: {}\n // };\n }\n\n private onMessagesSendError(messages: Message.message[], error?: ApiError) {\n messages.forEach((message) => {\n if(message.error === error) {\n return;\n }\n\n if(error) {\n message.error = error;\n this.rootScope.dispatchEvent('message_error', {storageKey: message.storageKey, tempId: message.mid, error});\n\n const dialog = this.getDialogOnly(message.peerId);\n if(dialog) {\n this.rootScope.dispatchEvent('dialog_unread', {peerId: message.peerId, dialog});\n }\n } else {\n delete message.error;\n }\n });\n }\n\n public getMessagesStorageByKey(key: MessagesStorageKey) {\n const s = key.split('_');\n const peerId: PeerId = +s[0];\n const type: MessagesStorageType = s[1] as any;\n return type === 'scheduled' ? this.getScheduledMessagesStorage(peerId) : this.getHistoryMessagesStorage(peerId);\n }\n\n public getMessageFromStorage(storage: MessagesStorage | MessagesStorageKey, mid: number) {\n if(typeof(storage) === 'string') {\n storage = this.getMessagesStorageByKey(storage);\n }\n\n return storage && storage.get(mid)/* || this.generateEmptyMessage(mid) */;\n }\n\n private createMessageStorage(peerId: PeerId, type: MessagesStorageType) {\n const storage: MessagesStorage = new Map() as any;\n storage.peerId = peerId;\n storage.type = type;\n storage.key = `${peerId}_${type}`;\n\n /* let num = 0;\n Object.defineProperty(storage, 'num', {\n get: () => ++num,\n set: (_num: number) => num = _num,\n enumerable: false\n });\n\n Object.defineProperty(storage, 'generateIndex', {\n value: (message: any) => {\n if(message.index === undefined) {\n message.index = (message.date * 0x10000) + (storage.num & 0xFFFF);\n }\n },\n enumerable: false\n }); */\n\n return storage;\n }\n\n public getHistoryMessagesStorage(peerId: PeerId) {\n return this.messagesStorageByPeerId[peerId] ??= this.createMessageStorage(peerId, 'history');\n }\n\n public getMessagesStorage(key: MessagesStorageKey | MessagesStorage): MessagesStorage {\n if(typeof(key) === 'object') {\n return key;\n } else {\n return this.getMessagesStorageByKey(key);\n }\n }\n\n public getMessageById(messageId: number) {\n for(const peerId in this.messagesStorageByPeerId) {\n if(this.appPeersManager.isChannel(peerId.toPeerId())) {\n continue;\n }\n\n const message = this.messagesStorageByPeerId[peerId].get(messageId);\n if(message) {\n return message;\n }\n }\n\n return this.getMessageFromStorage(null, messageId);\n }\n\n public getMessageByPeer(peerId: PeerId, messageId: number) {\n if(!peerId) {\n return this.getMessageById(messageId);\n }\n\n return this.getMessageFromStorage(this.getHistoryMessagesStorage(peerId), messageId);\n }\n\n public getMessagePeer(message: any): PeerId {\n const toId = message.peer_id && this.appPeersManager.getPeerId(message.peer_id) || NULL_PEER_ID;\n\n return toId;\n }\n\n public getDialogOnly(peerId: PeerId) {\n return this.dialogsStorage.getDialogOnly(peerId);\n }\n\n public cantForwardDeleteMids(storageKey: MessagesStorageKey, mids: number[]) {\n const storage = this.getMessagesStorage(storageKey);\n let cantForward = !mids.length, cantDelete = !mids.length;\n for(const mid of mids) {\n const message = this.getMessageFromStorage(storage, mid);\n if(!cantForward) {\n cantForward = !this.canForward(message);\n }\n\n if(!cantDelete) {\n cantDelete = !this.canDeleteMessage(message);\n }\n\n if(cantForward && cantDelete) break;\n }\n\n return {cantForward, cantDelete};\n }\n\n public reloadConversationOrTopic(peerId: PeerId, threadId?: number) {\n if(threadId) {\n this.dialogsStorage.getForumTopicById(peerId, threadId);\n } else {\n this.reloadConversation(peerId);\n }\n }\n\n public reloadConversation(inputPeer?: PeerId | InputPeer): CancellablePromise;\n public reloadConversation(inputPeer: PeerId | InputPeer) {\n let promise: CancellablePromise;\n if(inputPeer !== undefined) {\n const peerId = this.appPeersManager.getPeerId(inputPeer);\n this.log.warn('reloadConversation', peerId);\n\n let obj = this.reloadConversationsPeers.get(peerId);\n if(obj) {\n promise = obj.promise;\n }\n\n if(promise) {\n return promise;\n }\n\n promise = deferredPromise();\n this.reloadConversationsPeers.set(peerId, obj = {\n inputDialogPeer: this.appPeersManager.getInputDialogPeerById(inputPeer),\n promise\n });\n }\n\n if(this.reloadConversationsPromise) {\n return promise || this.reloadConversationsPromise;\n }\n\n this.reloadConversationsPromise = pause(0).then(() => {\n const inputDialogPeers: InputDialogPeer[] = [];\n const promises: {[peerId: string]: typeof promise} = {};\n for(const [peerId, {inputDialogPeer, promise}] of this.reloadConversationsPeers) {\n inputDialogPeers.push(inputDialogPeer);\n promises[peerId] = promise;\n }\n\n const fullfillLeft = () => {\n for(const peerId in promises) {\n this.reloadConversationsPeers.delete(+peerId);\n promises[peerId].resolve(undefined);\n }\n };\n\n const invoke = async() => {\n for(;;) {\n const result = await this.apiManager.invokeApi('messages.getPeerDialogs', {peers: inputDialogPeers});\n const currentState = this.apiUpdatesManager.updatesState;\n const {state} = result;\n if(currentState.pts && currentState.pts !== state.pts) {\n await pause(500);\n continue;\n }\n\n return result;\n }\n };\n\n return invoke().then((result) => {\n for(const peerId in promises) {\n this.reloadConversationsPeers.delete(+peerId);\n }\n\n this.dialogsStorage.applyDialogs(result);\n\n result.dialogs.forEach((dialog) => {\n const peerId = dialog.peerId;\n if(peerId) {\n promises[peerId].resolve(dialog as Dialog);\n delete promises[peerId];\n }\n });\n }, noop).then(() => {\n fullfillLeft();\n\n this.reloadConversationsPromise = null;\n if(this.reloadConversationsPeers.size) {\n this.reloadConversation();\n }\n });\n });\n\n return promise || this.reloadConversationsPromise;\n }\n\n private doFlushHistory(peerId: PeerId, just_clear?: boolean, revoke?: boolean, threadId?: number): Promise {\n let promise: Promise;\n const processResult = (affectedHistory: MessagesAffectedHistory) => {\n this.apiUpdatesManager.processUpdateMessage({\n _: 'updateShort',\n update: {\n _: 'updatePts',\n pts: affectedHistory.pts,\n pts_count: affectedHistory.pts_count\n }\n });\n\n if(!affectedHistory.offset) {\n return true;\n }\n\n return this.doFlushHistory(peerId, just_clear, revoke, threadId);\n };\n\n if(!threadId) {\n promise = this.apiManager.invokeApiSingleProcess({\n method: 'messages.deleteHistory',\n params: {\n just_clear,\n revoke,\n peer: this.appPeersManager.getInputPeerById(peerId),\n max_id: 0\n },\n processResult\n });\n } else {\n promise = this.apiManager.invokeApiSingleProcess({\n method: 'channels.deleteTopicHistory',\n params: {\n channel: this.appChatsManager.getChannelInput(peerId.toChatId()),\n top_msg_id: getServerMessageId(threadId)\n },\n processResult\n });\n }\n\n return promise;\n }\n\n public async flushHistory(peerId: PeerId, justClear?: boolean, revoke?: boolean, threadId?: number) {\n if(this.appPeersManager.isChannel(peerId) && !threadId) {\n const promise = this.getHistory(peerId, 0, 1);\n\n const historyResult = await promise;\n\n const channelId = peerId.toChatId();\n const maxId = historyResult.history[0] || 0;\n return this.apiManager.invokeApiSingle('channels.deleteHistory', {\n channel: this.appChatsManager.getChannelInput(channelId),\n max_id: getServerMessageId(maxId)\n }).then((bool) => {\n if(bool) {\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateChannelAvailableMessages',\n channel_id: channelId,\n available_min_id: maxId\n });\n }\n\n return bool;\n });\n }\n\n return this.doFlushHistory(peerId, justClear, revoke, threadId).then(() => {\n if(!threadId) {\n this.flushStoragesByPeerId(peerId);\n }\n\n if(justClear) {\n this.rootScope.dispatchEvent('dialog_flush', {peerId, dialog: this.getDialogOnly(peerId)});\n } else {\n const key = this.getTypingKey(peerId, threadId);\n delete this.notificationsToHandle[key];\n delete this.typings[key];\n\n if(!threadId) {\n const c = this.reloadConversationsPeers.get(peerId);\n if(c) {\n this.reloadConversationsPeers.delete(peerId);\n c.promise.resolve(undefined);\n }\n }\n\n this.dialogsStorage.dropDialogOnDeletion(peerId, threadId);\n }\n });\n }\n\n private flushStoragesByPeerId(peerId: PeerId) {\n [\n this.historiesStorage,\n this.threadsStorage,\n this.searchesStorage,\n this.pendingAfterMsgs,\n this.pendingTopMsgs\n ].forEach((s) => {\n delete s[peerId];\n });\n\n for(const key in this.pinnedMessages) {\n if(+key === peerId || key.startsWith(peerId + '_')) {\n delete this.pinnedMessages[key];\n }\n }\n\n const needSingleMessages = this.needSingleMessages.get(peerId);\n if(needSingleMessages) {\n for(const [mid, promise] of needSingleMessages) {\n promise.resolve(this.generateEmptyMessage(mid));\n }\n\n needSingleMessages.clear();\n }\n\n [\n this.messagesStorageByPeerId,\n this.scheduledMessagesStorage\n ].forEach((s) => {\n const ss = s[peerId];\n if(ss) {\n ss.clear();\n }\n });\n\n this.dialogsStorage.flushForumTopicsCache(peerId);\n }\n\n public hidePinnedMessages(peerId: PeerId) {\n return Promise.all([\n this.appStateManager.getState(),\n this.getPinnedMessage(peerId)\n ])\n .then(([state, pinned]) => {\n state.hiddenPinnedMessages[peerId] = pinned.maxId;\n this.rootScope.dispatchEvent('peer_pinned_hidden', {peerId, maxId: pinned.maxId});\n });\n }\n\n public getPinnedMessagesKey(peerId: PeerId, threadId?: number) {\n return peerId + (threadId ? '_' + threadId : '');\n }\n\n public getPinnedMessage(peerId: PeerId, threadId?: number) {\n const p = this.pinnedMessages[this.getPinnedMessagesKey(peerId, threadId)] ??= {};\n if(p.promise) return p.promise;\n else if(p.maxId) return Promise.resolve(p);\n\n return p.promise = this.getSearch({\n peerId,\n inputFilter: {_: 'inputMessagesFilterPinned'},\n maxId: 0,\n limit: 1,\n threadId\n }).then((result) => {\n p.count = result.count;\n p.maxId = result.history[0]?.mid;\n return p;\n }).finally(() => {\n delete p.promise;\n });\n }\n\n public getPinnedMessagesCount(peerId: PeerId, threadId?: number) {\n return this.pinnedMessages[this.getPinnedMessagesKey(peerId, threadId)]?.count;\n }\n\n public getPinnedMessagesMaxId(peerId: PeerId, threadId?: number) {\n return this.pinnedMessages[this.getPinnedMessagesKey(peerId, threadId)]?.maxId;\n }\n\n public updatePinnedMessage(peerId: PeerId, mid: number, unpin?: boolean, silent?: boolean, pm_oneside?: boolean) {\n return this.apiManager.invokeApi('messages.updatePinnedMessage', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n unpin,\n silent,\n pm_oneside,\n id: getServerMessageId(mid)\n }).then((updates) => {\n // this.log('pinned updates:', updates);\n this.apiUpdatesManager.processUpdateMessage(updates);\n });\n }\n\n public unpinAllMessages(peerId: PeerId): Promise {\n return this.apiManager.invokeApiSingle('messages.unpinAllMessages', {\n peer: this.appPeersManager.getInputPeerById(peerId)\n }).then((affectedHistory) => {\n this.apiUpdatesManager.processUpdateMessage({\n _: 'updateShort',\n update: {\n _: 'updatePts',\n pts: affectedHistory.pts,\n pts_count: affectedHistory.pts_count\n }\n });\n\n if(!affectedHistory.offset) {\n const storage = this.getHistoryMessagesStorage(peerId);\n storage.forEach((message) => {\n if((message as Message.message).pFlags.pinned) {\n delete (message as Message.message).pFlags.pinned;\n }\n });\n\n this.rootScope.dispatchEvent('peer_pinned_messages', {peerId, unpinAll: true});\n delete this.pinnedMessages[this.getPinnedMessagesKey(peerId)];\n\n return true;\n }\n\n return this.unpinAllMessages(peerId);\n });\n }\n\n public getAlbumText(grouped_id: string) {\n const group = this.groupedMessagesStorage[grouped_id];\n return getAlbumText(Array.from(group.values()) as Message.message[]);\n }\n\n public getGroupsFirstMessage(message: Message.message) {\n if(!message?.grouped_id) return message;\n\n const storage = this.groupedMessagesStorage[message.grouped_id];\n let minMid = Number.MAX_SAFE_INTEGER;\n for(const [mid, message] of storage) {\n if(message.mid < minMid) {\n minMid = message.mid;\n }\n }\n\n return this.getMessageFromStorage(storage, minMid) as Message.message;\n }\n\n public getMidsByAlbum(groupedId: string, sort: 'asc' | 'desc' = 'asc') {\n return getObjectKeysAndSort(this.groupedMessagesStorage[groupedId], sort);\n }\n\n public getMessagesByAlbum(groupedId: string) {\n const mids = this.getMidsByAlbum(groupedId, 'asc');\n const storage = this.groupedMessagesStorage[groupedId];\n return mids.map((mid) => this.getMessageFromStorage(storage, mid) as Message.message);\n }\n\n public getMidsByMessage(message: Message) {\n if(!message) return [];\n else if((message as Message.message).grouped_id) return this.getMidsByAlbum((message as Message.message).grouped_id);\n else return [message.mid];\n }\n\n public filterMessages(message: MyMessage, verify: (message: MyMessage) => boolean) {\n const out: MyMessage[] = [];\n if((message as Message.message).grouped_id) {\n const storage = this.groupedMessagesStorage[(message as Message.message).grouped_id];\n for(const [mid, message] of storage) {\n if(verify(message)) {\n out.push(message);\n }\n }\n } else {\n if(verify(message)) {\n out.push(message);\n }\n }\n\n return out;\n }\n\n public generateTempMessageId(peerId: PeerId) {\n const dialog = this.getDialogOnly(peerId);\n return this.appMessagesIdsManager.generateTempMessageId(dialog?.top_message || 0);\n }\n\n public setMessageUnreadByDialog(message: MyMessage, dialog: Dialog | ForumTopic = this.getDialogOnly(message.peerId)) {\n if(dialog && message.mid) {\n if(message.mid > dialog[message.pFlags.out ?\n 'read_outbox_max_id' :\n 'read_inbox_max_id']) {\n message.pFlags.unread = true;\n }\n }\n }\n\n public saveMessage(message: Message, options: Partial<{\n storage: MessagesStorage,\n isScheduled: true,\n isOutgoing: true,\n // isNew: boolean, // * new - from update\n }> = {}) {\n if(!message || message._ === 'messageEmpty') {\n return;\n }\n\n message.pFlags ??= {};\n\n // * exclude from state\n // defineNotNumerableProperties(message, ['rReply', 'mid', 'savedFrom', 'fwdFromId', 'fromId', 'peerId', 'reply_to_mid', 'viaBotId']);\n\n const peerId = this.getMessagePeer(message);\n const storage = options.storage || this.getHistoryMessagesStorage(peerId);\n const isChannel = message.peer_id._ === 'peerChannel';\n const isBroadcast = isChannel && this.appChatsManager.isBroadcast(peerId.toChatId());\n const isMessage = message._ === 'message';\n\n if(options.isOutgoing) {\n message.pFlags.is_outgoing = true;\n }\n\n const mid = generateMessageId(message.id);\n message.mid = mid;\n\n if(isMessage) {\n if(options.isScheduled) {\n message.pFlags.is_scheduled = true;\n }\n\n if(message.grouped_id) {\n const storage = this.groupedMessagesStorage[message.grouped_id] ??= this.createMessageStorage(peerId, 'grouped');\n storage.set(mid, message);\n }\n\n if(message.via_bot_id) {\n // ! WARNING\n message.viaBotId = message.via_bot_id as any;\n }\n }\n\n // this.log(dT(), 'msg unread', mid, apiMessage.pFlags.out, dialog && dialog[apiMessage.pFlags.out ? 'read_outbox_max_id' : 'read_inbox_max_id'])\n\n const replyTo = message.reply_to;\n if(replyTo) {\n if(replyTo.reply_to_msg_id) {\n replyTo.reply_to_msg_id = message.reply_to_mid = generateMessageId(replyTo.reply_to_msg_id);\n }\n\n if(replyTo.reply_to_top_id) {\n replyTo.reply_to_top_id = generateMessageId(replyTo.reply_to_top_id);\n }\n }\n\n const replies = isMessage && message.replies;\n if(replies) {\n if(replies.max_id) replies.max_id = generateMessageId(replies.max_id);\n if(replies.read_max_id) replies.read_max_id = generateMessageId(replies.read_max_id);\n }\n\n const overwriting = !!peerId;\n if(!overwriting) {\n message.date -= this.timeManager.getServerTimeOffset();\n }\n\n // storage.generateIndex(message);\n const myId = this.appPeersManager.peerId;\n\n const fwdHeader = isMessage && (message as Message.message).fwd_from;\n\n message.peerId = peerId;\n if(peerId === myId/* && !message.from_id && !message.fwd_from */) {\n message.fromId = fwdHeader ? (fwdHeader.from_id ? this.appPeersManager.getPeerId(fwdHeader.from_id) : NULL_PEER_ID) : myId;\n } else {\n // message.fromId = message.pFlags.post || (!message.pFlags.out && !message.from_id) ? peerId : appPeersManager.getPeerId(message.from_id);\n message.fromId = message.pFlags.post || !message.from_id ? peerId : this.appPeersManager.getPeerId(message.from_id);\n }\n\n this.setMessageUnreadByDialog(message);\n\n if(fwdHeader) {\n // if(peerId === myID) {\n if(fwdHeader.saved_from_msg_id) fwdHeader.saved_from_msg_id = generateMessageId(fwdHeader.saved_from_msg_id);\n if(fwdHeader.channel_post) fwdHeader.channel_post = generateMessageId(fwdHeader.channel_post);\n\n const peer = fwdHeader.saved_from_peer || fwdHeader.from_id;\n const msgId = fwdHeader.saved_from_msg_id || fwdHeader.channel_post;\n if(peer && msgId) {\n const savedFromPeerId = this.appPeersManager.getPeerId(peer);\n const savedFromMid = generateMessageId(msgId);\n message.savedFrom = savedFromPeerId + '_' + savedFromMid;\n }\n\n /* if(peerId.isAnyChat() || peerId === myID) {\n message.fromId = appPeersManager.getPeerID(!message.from_id || deepEqual(message.from_id, fwdHeader.from_id) ? fwdHeader.from_id : message.from_id);\n } */\n /* } else {\n apiMessage.fwdPostID = fwdHeader.channel_post;\n } */\n\n message.fwdFromId = this.appPeersManager.getPeerId(fwdHeader.from_id);\n\n if(!overwriting) {\n fwdHeader.date -= this.timeManager.getServerTimeOffset();\n }\n }\n\n const mediaContext: ReferenceContext = {\n type: 'message',\n peerId,\n messageId: mid\n };\n\n /* if(isMessage) {\n const entities = message.entities;\n if(entities && entities.find((entity) => entity._ === 'messageEntitySpoiler')) {\n message.media = {_: 'messageMediaUnsupported'};\n }\n } */\n\n let unsupported = false;\n const media = isMessage && message.media;\n if(media) {\n switch(media._) {\n case 'messageMediaEmpty': {\n delete message.media;\n break;\n }\n\n case 'messageMediaPhoto': {\n if(media.ttl_seconds) {\n unsupported = true;\n } else {\n media.photo = this.appPhotosManager.savePhoto(media.photo, mediaContext);\n }\n\n if(!(media as MessageMedia.messageMediaPhoto).photo) { // * found this bug on test DC\n delete message.media;\n }\n\n break;\n }\n\n case 'messageMediaPoll': {\n const result = this.appPollsManager.savePoll(media.poll, media.results, message);\n media.poll = result.poll;\n media.results = result.results;\n break;\n }\n\n case 'messageMediaDocument': {\n if(media.ttl_seconds) {\n unsupported = true;\n } else {\n const originalDoc = media.document;\n media.document = this.appDocsManager.saveDoc(originalDoc, mediaContext); // 11.04.2020 warning\n\n if(!media.document && originalDoc._ !== 'documentEmpty') {\n unsupported = true;\n }\n }\n\n break;\n }\n\n case 'messageMediaWebPage': {\n const messageKey = this.appWebPagesManager.getMessageKeyForPendingWebPage(peerId, mid, options.isScheduled);\n media.webpage = this.appWebPagesManager.saveWebPage(media.webpage, messageKey, mediaContext);\n\n if(!media.webpage) {\n delete message.media;\n }\n\n break;\n }\n\n /* case 'messageMediaGame':\n AppGamesManager.saveGame(apiMessage.media.game, apiMessage.mid, mediaContext);\n apiMessage.media.handleMessage = true;\n break; */\n\n case 'messageMediaInvoice': {\n media.photo = this.appWebDocsManager.saveWebDocument(media.photo);\n const extendedMedia = media.extended_media;\n if(extendedMedia?._ === 'messageExtendedMedia') {\n const extendedMediaMedia = extendedMedia.media;\n (extendedMediaMedia as MessageMedia.messageMediaPhoto).photo = this.appPhotosManager.savePhoto((extendedMediaMedia as MessageMedia.messageMediaPhoto).photo, mediaContext);\n (extendedMediaMedia as MessageMedia.messageMediaDocument).document = this.appDocsManager.saveDoc((extendedMediaMedia as MessageMedia.messageMediaDocument).document, mediaContext);\n }\n break;\n }\n\n case 'messageMediaUnsupported': {\n unsupported = true;\n break;\n }\n }\n }\n\n // if(isMessage && !unsupported && message.entities) {\n // unsupported = message.entities.some((entity) => entity._ === 'messageEntityCustomEmoji');\n // }\n\n if(isMessage && unsupported) {\n message.media = {_: 'messageMediaUnsupported'};\n message.message = '';\n delete message.entities;\n delete message.totalEntities;\n }\n\n if(!isMessage && message.action) {\n const action = message.action as MessageAction;\n const suffix = message.fromId === this.appUsersManager.getSelf().id ? 'You' : '';\n let migrateFrom: PeerId, migrateTo: PeerId;\n\n if((action as MessageAction.messageActionChatEditPhoto).photo) {\n (action as MessageAction.messageActionChatEditPhoto).photo = this.appPhotosManager.savePhoto((action as MessageAction.messageActionChatEditPhoto).photo, mediaContext);\n }\n\n if((action as any).document) {\n (action as any).document = this.appDocsManager.saveDoc((action as any).photo, mediaContext);\n }\n\n switch(action._) {\n // case 'messageActionChannelEditPhoto':\n case 'messageActionChatEditPhoto':\n // action.photo = appPhotosManager.savePhoto(action.photo, mediaContext);\n if((action.photo as Photo.photo)?.video_sizes) {\n // @ts-ignore\n action._ = isBroadcast ? 'messageActionChannelEditVideo' : 'messageActionChatEditVideo';\n } else {\n if(isBroadcast) { // ! messageActionChannelEditPhoto не существует в принципе, это используется для перевода.\n // @ts-ignore\n action._ = 'messageActionChannelEditPhoto';\n }\n }\n break;\n\n case 'messageActionGroupCall': {\n // assumeType(action);\n\n this.appGroupCallsManager.saveGroupCall(action.call);\n\n let type: string;\n if(action.duration === undefined) {\n type = 'started';\n } else {\n type = 'ended'\n }\n\n if(!isBroadcast) {\n type += '_by' + suffix;\n }\n\n // @ts-ignore\n action.type = type;\n\n break;\n }\n\n case 'messageActionChatEditTitle':\n /* if(options.isNew) {\n const chat = appChatsManager.getChat(peerId.toChatId());\n chat.title = action.title;\n appChatsManager.saveApiChat(chat, true);\n } */\n\n if(isBroadcast) {\n // @ts-ignore\n action._ = 'messageActionChannelEditTitle';\n }\n break;\n\n case 'messageActionChatDeletePhoto':\n if(isBroadcast) {\n // @ts-ignore\n action._ = 'messageActionChannelDeletePhoto';\n }\n break;\n\n case 'messageActionChatAddUser':\n if(action.users.length === 1) {\n // @ts-ignore\n action.user_id = action.users[0];\n // @ts-ignore\n if(message.fromId === action.user_id) {\n if(isChannel) {\n // @ts-ignore\n action._ = 'messageActionChatJoined' + suffix;\n } else {\n // @ts-ignore\n action._ = 'messageActionChatReturn' + suffix;\n }\n }\n } else if(action.users.length > 1) {\n // @ts-ignore\n action._ = 'messageActionChatAddUsers';\n }\n break;\n\n case 'messageActionChatDeleteUser':\n if(message.fromId === action.user_id) {\n // @ts-ignore\n action._ = 'messageActionChatLeave' + suffix;\n }\n break;\n\n case 'messageActionChannelMigrateFrom':\n migrateFrom = action.chat_id.toPeerId(true);\n migrateTo = peerId;\n break\n\n case 'messageActionChatMigrateTo':\n migrateFrom = peerId;\n migrateTo = action.channel_id.toPeerId(true);\n break;\n\n case 'messageActionHistoryClear':\n // apiMessage.deleted = true;\n message.clear_history = true;\n delete message.pFlags.out;\n delete message.pFlags.unread;\n break;\n\n case 'messageActionPhoneCall':\n // @ts-ignore\n action.type =\n (action.pFlags.video ? 'video_' : '') +\n (action.duration !== undefined ? (message.pFlags.out ? 'out_' : 'in_') : '') +\n (\n action.duration !== undefined ? 'ok' : (\n action.reason._ === 'phoneCallDiscardReasonMissed' ?\n 'missed' :\n 'cancelled'\n )\n );\n break;\n }\n\n if(migrateFrom &&\n migrateTo &&\n !this.migratedFromTo[migrateFrom] &&\n !this.migratedToFrom[migrateTo]) {\n this.migrateChecks(migrateFrom, migrateTo);\n }\n }\n\n /* if(message.grouped_id) {\n if(!groups) {\n groups = new Set();\n }\n\n groups.add(message.grouped_id);\n } else {\n message.rReply = this.getRichReplyText(message);\n } */\n\n if(isMessage && message.message.length && !message.totalEntities) {\n this.wrapMessageEntities(message);\n }\n\n storage.set(mid, message);\n\n return message;\n }\n\n public saveMessages(messages: any[], options: Partial<{\n storage: MessagesStorage,\n isScheduled: true,\n isOutgoing: true,\n // isNew: boolean, // * new - from update\n }> = {}): (Message.message | Message.messageService)[] {\n if((messages as any).saved) return messages;\n (messages as any).saved = true;\n messages.forEach((message, idx, arr) => {\n arr[idx] = this.saveMessage(message, options);\n });\n\n return messages;\n }\n\n public async getFirstMessageToEdit(peerId: PeerId, threadId?: number) {\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n const slice = historyStorage.history.slice;\n if(slice.isEnd(SliceEnd.Bottom) && slice.length) {\n let goodMessage: Message.message | Message.messageService;\n const myPeerId = this.appPeersManager.peerId;\n for(const mid of slice) {\n const message = this.getMessageByPeer(peerId, mid);\n const good = myPeerId === peerId ? message.fromId === myPeerId : message.pFlags.out;\n\n if(good) {\n if(await this.canEditMessage(message, 'text')) {\n goodMessage = message;\n break;\n }\n\n // * this check will allow editing only last message\n // break;\n }\n }\n\n return goodMessage;\n }\n }\n\n private wrapMessageEntities(message: Message.message) {\n const apiEntities = message.entities ? message.entities.slice() : [];\n message.message = fixEmoji(message.message, apiEntities);\n\n const myEntities = parseEntities(message.message);\n message.totalEntities = mergeEntities(apiEntities, myEntities); // ! only in this order, otherwise bold and emoji formatting won't work\n }\n\n public reportMessages(peerId: PeerId, mids: number[], reason: ReportReason['_'], message?: string) {\n return this.apiManager.invokeApiSingle('messages.report', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n id: mids.map((mid) => getServerMessageId(mid)),\n reason: {\n _: reason\n },\n message\n });\n }\n\n public startBot(botId: BotId, chatId?: ChatId, startParam?: string) {\n const peerId = chatId ? chatId.toPeerId(true) : botId.toPeerId();\n if(startParam) {\n const randomId = randomLong();\n\n return this.apiManager.invokeApi('messages.startBot', {\n bot: this.appUsersManager.getUserInput(botId),\n peer: this.appPeersManager.getInputPeerById(peerId),\n random_id: randomId,\n start_param: startParam\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n });\n }\n\n const str = '/start';\n if(chatId) {\n let promise: Promise;\n if(this.appChatsManager.isChannel(chatId)) {\n promise = this.appChatsManager.inviteToChannel(chatId, [botId]);\n } else {\n promise = this.appChatsManager.addChatUser(chatId, botId, 0);\n }\n\n return promise.catch((error: ApiError) => {\n if(error?.type == 'USER_ALREADY_PARTICIPANT') {\n error.handled = true;\n return;\n }\n\n throw error;\n }).then(() => {\n return this.sendText(peerId, str + '@' + this.appPeersManager.getPeerUsername(botId.toPeerId()));\n });\n }\n\n return this.sendText(peerId, str);\n }\n\n public editPeerFolders(peerIds: PeerId[], folderId: number) {\n this.apiManager.invokeApi('folders.editPeerFolders', {\n folder_peers: peerIds.map((peerId) => {\n return {\n _: 'inputFolderPeer',\n peer: this.appPeersManager.getInputPeerById(peerId),\n folder_id: folderId\n };\n })\n }).then((updates) => {\n // this.log('editPeerFolders updates:', updates);\n this.apiUpdatesManager.processUpdateMessage(updates); // WARNING! возможно тут нужно добавлять channelId, и вызывать апдейт для каждого канала отдельно\n });\n }\n\n public getFilter(filterId: number) {\n return this.filtersStorage.getFilter(filterId);\n }\n\n public async toggleDialogPin(options: {\n peerId: PeerId,\n filterId?: number,\n topicId?: number\n }) {\n const {peerId, topicId, filterId = topicId ? peerId : undefined} = options;\n if(filterId === undefined) {\n throw new Error('No filterId');\n }\n\n if(filterId > 1) {\n return this.filtersStorage.toggleDialogPin(peerId, filterId);\n }\n\n const dialog = this.dialogsStorage.getDialogOrTopic(peerId, topicId);\n if(!dialog) throw undefined;\n\n const pinned = dialog.pFlags?.pinned ? undefined : true;\n\n if(pinned) {\n const max = await this.apiManager.getLimit(topicId ? 'topicPin' : (filterId === 1 ? 'folderPin' : 'pin'));\n if(this.dialogsStorage.getPinnedOrders(filterId).length >= max) {\n throw makeError(topicId ? 'PINNED_TOO_MUCH' : 'PINNED_DIALOGS_TOO_MUCH');\n }\n }\n\n if(topicId) {\n return this.appChatsManager.updatePinnedForumTopic(peerId.toChatId(), topicId, pinned);\n }\n\n return this.apiManager.invokeApi('messages.toggleDialogPin', {\n peer: this.appPeersManager.getInputDialogPeerById(peerId),\n pinned\n }).then((bool) => {\n const pFlags: Update.updateDialogPinned['pFlags'] = pinned ? {pinned} : {};\n this.apiUpdatesManager.saveUpdate({\n _: 'updateDialogPinned',\n peer: this.appPeersManager.getDialogPeer(peerId),\n folder_id: filterId,\n pFlags\n });\n });\n }\n\n public markDialogUnread(peerId: PeerId, read?: true) {\n const dialog = this.getDialogOnly(peerId);\n if(!dialog) return Promise.reject();\n\n const unread = read || dialog.pFlags?.unread_mark ? undefined : true;\n return this.apiManager.invokeApi('messages.markDialogUnread', {\n peer: this.appPeersManager.getInputDialogPeerById(peerId),\n unread\n }).then((bool) => {\n if(bool) {\n const pFlags: Update.updateDialogUnreadMark['pFlags'] = unread ? {unread} : {};\n this.onUpdateDialogUnreadMark({\n _: 'updateDialogUnreadMark',\n peer: this.appPeersManager.getDialogPeer(peerId),\n pFlags\n });\n }\n });\n }\n\n public migrateChecks(migrateFrom: PeerId, migrateTo: PeerId) {\n if(!this.migratedFromTo[migrateFrom] &&\n !this.migratedToFrom[migrateTo] &&\n this.appChatsManager.hasChat(migrateTo.toChatId())) {\n const fromChat = this.appChatsManager.getChat(migrateFrom.toChatId()) as Chat.chat;\n if(fromChat?.migrated_to && (fromChat.migrated_to as InputChannel.inputChannel).channel_id === migrateTo.toChatId()) {\n this.migratedFromTo[migrateFrom] = migrateTo;\n this.migratedToFrom[migrateTo] = migrateFrom;\n\n this.rootScope.dispatchEvent('dialog_migrate', {migrateFrom, migrateTo});\n\n this.dialogsStorage.dropDialogWithEvent(migrateFrom);\n }\n }\n }\n\n private canMessageBeEdited(message: Message, kind: 'text' | 'poll') {\n if((message as Message.message)?.pFlags?.is_outgoing) {\n return false;\n }\n\n const goodMedias = [\n 'messageMediaPhoto',\n 'messageMediaDocument',\n 'messageMediaWebPage'\n ];\n\n if(kind === 'poll') {\n goodMedias.push('messageMediaPoll');\n }\n\n if(!message ||\n message._ !== 'message' ||\n message.deleted ||\n message.fwd_from ||\n message.via_bot_id ||\n message.media && goodMedias.indexOf(message.media._) === -1 ||\n message.fromId && this.appUsersManager.isBot(message.fromId)) {\n return false;\n }\n\n if(message.media?._ === 'messageMediaDocument' &&\n ((message.media.document as Document.document).sticker || (message.media.document as Document.document).type === 'round')) {\n return false;\n }\n\n return true;\n }\n\n public async canEditMessage(message: Message.message | Message.messageService, kind: 'text' | 'poll' = 'text') {\n if(!message || !this.canMessageBeEdited(message, kind)) {\n return false;\n }\n\n // * second rule for saved messages, because there is no 'out' flag\n if(/* message.pFlags.out || */this.getMessagePeer(message) === this.appUsersManager.getSelf().id) {\n return true;\n }\n\n const {peerId} = message;\n\n const canEditMessageInPeer = this.appPeersManager.isBroadcast(peerId) ?\n this.appChatsManager.hasRights(peerId.toChatId(), 'edit_messages') :\n (\n peerId.isAnyChat() && kind === 'text' ?\n this.appChatsManager.hasRights(peerId.toChatId(), 'send_plain') || this.appChatsManager.hasRights(peerId.toChatId(), 'send_media') :\n true\n ) && message.pFlags.out;\n\n if(\n !canEditMessageInPeer || (\n message.peer_id._ !== 'peerChannel' &&\n message.date < (tsNow(true) - (await this.apiManager.getConfig()).edit_time_limit) &&\n (message as Message.message).media?._ !== 'messageMediaPoll'\n )\n ) {\n return false;\n }\n\n return true;\n }\n\n public canDeleteMessage(message: MyMessage) {\n return message && (\n message.peerId.isUser() ||\n message.pFlags.out ||\n this.appChatsManager.getChat(message.peerId.toChatId())._ === 'chat' ||\n this.appChatsManager.hasRights(message.peerId.toChatId(), 'delete_messages')\n ) && (!message.pFlags.is_outgoing || !!message.error);\n }\n\n public getReplyKeyboard(peerId: PeerId) {\n return this.getHistoryStorage(peerId).replyMarkup;\n }\n\n public mergeReplyKeyboard(historyStorage: HistoryStorage, message: Message.messageService | Message.message) {\n // this.log('merge', message.mid, message.reply_markup, historyStorage.reply_markup)\n if(!message) {\n return false;\n }\n\n const messageReplyMarkup = (message as Message.message).reply_markup;\n if(!messageReplyMarkup &&\n !message.pFlags?.out &&\n !(message as Message.messageService).action) {\n return false;\n }\n\n if(messageReplyMarkup?._ === 'replyInlineMarkup') {\n return false;\n }\n\n const lastReplyMarkup = historyStorage.replyMarkup;\n if(messageReplyMarkup) {\n if(lastReplyMarkup && lastReplyMarkup.mid >= message.mid) {\n return false;\n }\n\n if(messageReplyMarkup.pFlags.selective) {\n return false;\n }\n\n if(historyStorage.maxOutId &&\n message.mid < historyStorage.maxOutId &&\n (messageReplyMarkup as ReplyMarkup.replyKeyboardMarkup | ReplyMarkup.replyKeyboardForceReply).pFlags.single_use) {\n (messageReplyMarkup as ReplyMarkup.replyKeyboardMarkup | ReplyMarkup.replyKeyboardForceReply).pFlags.hidden = true;\n }\n\n messageReplyMarkup.mid = message.mid;\n /* messageReplyMarkup = Object.assign({\n mid: message.mid\n }, messageReplyMarkup); */\n\n if(messageReplyMarkup._ !== 'replyKeyboardHide') {\n messageReplyMarkup.fromId = this.appPeersManager.getPeerId(message.from_id);\n }\n\n historyStorage.replyMarkup = messageReplyMarkup;\n // this.log('set', historyStorage.reply_markup)\n return true;\n }\n\n if(message.pFlags.out) {\n if(lastReplyMarkup) {\n assumeType(lastReplyMarkup);\n if(lastReplyMarkup.pFlags.single_use &&\n !lastReplyMarkup.pFlags.hidden &&\n (message.mid > lastReplyMarkup.mid || message.pFlags.is_outgoing) &&\n (message as Message.message).message) {\n lastReplyMarkup.pFlags.hidden = true;\n // this.log('set', historyStorage.reply_markup)\n return true;\n }\n } else if(!historyStorage.maxOutId ||\n message.mid > historyStorage.maxOutId) {\n historyStorage.maxOutId = message.mid;\n }\n }\n\n assumeType(message);\n if(message.action?._ === 'messageActionChatDeleteUser' &&\n (lastReplyMarkup ?\n message.action.user_id === (lastReplyMarkup as ReplyMarkup.replyKeyboardMarkup).fromId :\n this.appUsersManager.isBot(message.action.user_id)\n )\n ) {\n historyStorage.replyMarkup = {\n _: 'replyKeyboardHide',\n mid: message.mid,\n pFlags: {}\n };\n // this.log('set', historyStorage.reply_markup)\n return true;\n }\n\n return false;\n }\n\n public getSearchStorage(peerId: PeerId, inputFilter: MyInputMessagesFilter) {\n if(!this.searchesStorage[peerId]) this.searchesStorage[peerId] = {};\n if(!this.searchesStorage[peerId][inputFilter]) this.searchesStorage[peerId][inputFilter] = {history: []};\n return this.searchesStorage[peerId][inputFilter];\n }\n\n public getSearchCounters(\n peerId: PeerId,\n filters: MessagesFilter[],\n canCache = true,\n threadId?: number\n ): Promise {\n if(this.appPeersManager.isPeerRestricted(peerId)) {\n return Promise.resolve(filters.map((filter) => {\n return {\n _: 'messages.searchCounter',\n pFlags: {},\n filter: filter,\n count: 0\n };\n }));\n }\n\n const func = (canCache ? this.apiManager.invokeApiCacheable : this.apiManager.invokeApi).bind(this.apiManager);\n return func('messages.getSearchCounters', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n filters,\n top_msg_id: threadId ? getServerMessageId(threadId) : undefined\n });\n }\n\n public filterMessagesByInputFilterFromStorage(inputFilter: MyInputMessagesFilter, history: number[], storage: MessagesStorage | MessagesStorageKey, limit: number) {\n const _storage = this.getMessagesStorage(storage);\n return filterMessagesByInputFilter(inputFilter, history.map((mid) => _storage.get(mid)), limit);\n }\n\n public getSearch({peerId, query, inputFilter, maxId, limit, nextRate, backLimit, threadId, folderId, minDate, maxDate}: {\n peerId?: PeerId,\n maxId?: number,\n limit?: number,\n nextRate?: number,\n backLimit?: number,\n threadId?: number,\n folderId?: number,\n query?: string,\n inputFilter?: {\n _: MyInputMessagesFilter\n },\n minDate?: number,\n maxDate?: number\n }): Promise<{\n count: number,\n next_rate: number,\n offset_id_offset: number,\n history: MyMessage[]\n }> {\n if(this.appPeersManager.isPeerRestricted(peerId)/* || true */) {\n return Promise.resolve({\n count: 0,\n offset_id_offset: 0,\n next_rate: undefined,\n history: []\n });\n }\n\n if(!query) query = '';\n if(!inputFilter) inputFilter = {_: 'inputMessagesFilterEmpty'};\n if(limit === undefined) limit = 20;\n if(!nextRate) nextRate = 0;\n if(!backLimit) backLimit = 0;\n\n minDate = minDate ? minDate / 1000 | 0 : 0;\n maxDate = maxDate ? maxDate / 1000 | 0 : 0;\n\n let foundMsgs: MyMessage[] = [];\n\n // this.log('search', maxId);\n\n if(backLimit) {\n limit += backLimit;\n }\n\n // const beta = inputFilter._ === 'inputMessagesFilterPinned' && !backLimit;\n const beta = false;\n\n let storage: {\n count?: number;\n history: SlicedArray;\n };\n\n // * костыль для limit 1, если нужно и получить сообщение, и узнать количество сообщений\n if(peerId && !backLimit && !maxId && !query && limit !== 1 && !threadId/* && inputFilter._ !== 'inputMessagesFilterPinned' */) {\n storage = beta ?\n this.getSearchStorage(peerId, inputFilter._) as any :\n this.getHistoryStorage(peerId);\n foundMsgs = this.filterMessagesByInputFilterFromStorage(inputFilter._, storage.history.slice, this.getHistoryMessagesStorage(peerId), limit);\n }\n\n if(foundMsgs.length) {\n if(foundMsgs.length < limit && (beta ? storage.count !== storage.history.length : true)) {\n maxId = foundMsgs[foundMsgs.length - 1].mid;\n limit = limit - foundMsgs.length;\n } else {\n return Promise.resolve({\n count: beta ? storage.count : 0,\n next_rate: 0,\n offset_id_offset: 0,\n history: foundMsgs\n });\n }\n } else if(beta && storage?.count) {\n return Promise.resolve({\n count: storage.count,\n next_rate: 0,\n offset_id_offset: 0,\n history: []\n });\n }\n\n const canCache = false && (['inputMessagesFilterChatPhotos', 'inputMessagesFilterPinned'] as MyInputMessagesFilter[]).includes(inputFilter._);\n const method = (canCache ? this.apiManager.invokeApiCacheable : this.apiManager.invokeApi).bind(this.apiManager);\n\n let apiPromise: Promise;\n if(peerId && !nextRate && folderId === undefined/* || !query */) {\n apiPromise = method('messages.search', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n q: query || '',\n filter: inputFilter as any as MessagesFilter,\n min_date: minDate,\n max_date: maxDate,\n limit,\n offset_id: getServerMessageId(maxId) || 0,\n add_offset: backLimit ? -backLimit : 0,\n max_id: 0,\n min_id: 0,\n hash: '',\n top_msg_id: getServerMessageId(threadId) || 0\n }, {\n // timeout: APITIMEOUT,\n noErrorBox: true\n });\n } else {\n // var offsetDate = 0;\n let offsetPeerId: PeerId;\n let offsetId = 0;\n const offsetMessage = maxId && this.getMessageByPeer(peerId, maxId);\n\n if(offsetMessage && offsetMessage.date) {\n // offsetDate = offsetMessage.date + timeManager.getServerTimeOffset();\n offsetId = offsetMessage.id;\n offsetPeerId = this.getMessagePeer(offsetMessage);\n }\n\n apiPromise = method('messages.searchGlobal', {\n q: query,\n filter: inputFilter as any as MessagesFilter,\n min_date: minDate,\n max_date: maxDate,\n offset_rate: nextRate,\n offset_peer: this.appPeersManager.getInputPeerById(offsetPeerId),\n offset_id: offsetId,\n limit,\n folder_id: folderId\n }, {\n // timeout: APITIMEOUT,\n noErrorBox: true\n });\n }\n\n return apiPromise.then((searchResult: any) => {\n this.appUsersManager.saveApiUsers(searchResult.users);\n this.appChatsManager.saveApiChats(searchResult.chats);\n this.saveMessages(searchResult.messages);\n\n /* if(beta && storage && (!maxId || storage.history[storage.history.length - 1] === maxId)) {\n const storage = this.getSearchStorage(peerId, inputFilter._);\n const add = (searchResult.messages.map((m: any) => m.mid) as number[]).filter((mid) => storage.history.indexOf(mid) === -1);\n storage.history.push(...add);\n storage.history.sort((a, b) => b - a);\n storage.count = searchResult.count;\n } */\n\n if(DEBUG) {\n this.log('getSearch result:', inputFilter, searchResult);\n }\n\n const foundCount: number = searchResult.count || (foundMsgs.length + searchResult.messages.length);\n\n searchResult.messages.forEach((message: MyMessage) => {\n const peerId = this.getMessagePeer(message);\n if(peerId.isAnyChat()) {\n const chat = this.appChatsManager.getChat(peerId.toChatId()) as Chat.chat;\n if(chat.migrated_to) {\n this.migrateChecks(peerId, (chat.migrated_to as InputChannel.inputChannel).channel_id.toPeerId(true));\n }\n }\n\n foundMsgs.push(message);\n });\n\n return {\n count: foundCount,\n offset_id_offset: searchResult.offset_id_offset || 0,\n next_rate: searchResult.next_rate,\n history: foundMsgs\n };\n });\n }\n\n public subscribeRepliesThread(peerId: PeerId, mid: number) {\n const repliesKey = peerId + '_' + mid;\n for(const threadKey in this.threadsToReplies) {\n if(this.threadsToReplies[threadKey] === repliesKey) return;\n }\n\n this.getDiscussionMessage(peerId, mid);\n }\n\n public generateThreadServiceStartMessage(message: Message.message | Message.messageService) {\n const threadKey = message.peerId + '_' + message.mid;\n if(this.threadsServiceMessagesIdsStorage[threadKey]) return;\n\n const maxMessageId = getServerMessageId(Math.max(...this.getMidsByMessage(message)));\n const serviceStartMessage: Message.messageService = {\n _: 'messageService',\n pFlags: {\n is_single: true\n },\n id: this.appMessagesIdsManager.generateTempMessageId(maxMessageId),\n date: message.date,\n from_id: {_: 'peerUser', user_id: NULL_PEER_ID}/* message.from_id */,\n peer_id: message.peer_id,\n action: {\n _: 'messageActionDiscussionStarted'\n },\n reply_to: this.generateReplyHeader(message.peerId, message.id)\n };\n\n this.saveMessages([serviceStartMessage], {isOutgoing: true});\n this.threadsServiceMessagesIdsStorage[threadKey] = serviceStartMessage.mid;\n }\n\n public getThreadServiceMessageId(peerId: PeerId, threadId: number) {\n return this.threadsServiceMessagesIdsStorage[peerId + '_' + threadId];\n }\n\n public getDiscussionMessage(peerId: PeerId, mid: number) {\n return this.apiManager.invokeApiSingle('messages.getDiscussionMessage', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n msg_id: getServerMessageId(mid)\n }).then((result) => {\n this.appChatsManager.saveApiChats(result.chats);\n this.appUsersManager.saveApiUsers(result.users);\n this.saveMessages(result.messages);\n\n const message = this.getMessageWithReplies(result.messages[0] as Message.message);\n const threadKey = message.peerId + '_' + message.mid;\n\n this.generateThreadServiceStartMessage(message);\n\n const historyStorage = this.getHistoryStorage(message.peerId, message.mid);\n const newMaxId = result.max_id = generateMessageId(result.max_id) || 0;\n result.read_inbox_max_id = historyStorage.readMaxId = generateMessageId(result.read_inbox_max_id ?? message.mid);\n result.read_outbox_max_id = historyStorage.readOutboxMaxId = generateMessageId(result.read_outbox_max_id) || 0;\n\n const first = historyStorage.history.first;\n if(historyStorage.maxId && historyStorage.maxId < newMaxId && first.isEnd(SliceEnd.Bottom)) {\n first.unsetEnd(SliceEnd.Bottom);\n }\n historyStorage.maxId = newMaxId;\n\n this.threadsToReplies[threadKey] = peerId + '_' + mid;\n\n return message;\n });\n }\n\n private handleNewMessage(message: MyMessage) {\n this.rootScope.dispatchEvent('history_multiappend', message);\n }\n\n private handleNewDialogs = () => {\n let newMaxSeenId = 0;\n const updateMap: BroadcastEvents['dialogs_multiupdate']= new Map();\n\n const processDialog = (dialog: MTDialog.dialog | ForumTopic) => {\n const {peerId} = dialog;\n this.dialogsStorage.pushDialog({dialog});\n if(!this.appPeersManager.isChannel(peerId)) {\n newMaxSeenId = Math.max(newMaxSeenId, dialog.top_message || 0);\n }\n\n let cache = updateMap.get(peerId);\n if(!cache) {\n updateMap.set(peerId, cache = {});\n }\n\n if(dialog._ === 'forumTopic') {\n (cache.topics ??= new Map()).set(dialog.id, dialog);\n } else {\n cache.dialog = dialog;\n }\n };\n\n for(const [peerId, obj] of this.newDialogsToHandle) {\n const isDialogDefined = 'dialog' in obj;\n const {dialog, topics} = obj;\n\n if(isDialogDefined) {\n if(!dialog) {\n this.reloadConversation(peerId.toPeerId());\n } else if(this.dialogsStorage.getDialogOnly(peerId)) { // * can be already dropped\n processDialog(dialog);\n }\n }\n\n if(topics) {\n topics?.forEach((topic, id) => {\n if(!topic) {\n this.dialogsStorage.getForumTopicById(peerId, id);\n } else if(this.dialogsStorage.getForumTopic(peerId, id)) { // * can be already dropped\n processDialog(topic);\n }\n });\n }\n }\n\n // this.log('after order:', this.dialogsStorage[0].map((d) => d.peerId));\n\n if(newMaxSeenId !== 0) {\n this.incrementMaxSeenId(newMaxSeenId);\n }\n\n this.rootScope.dispatchEvent('dialogs_multiupdate', updateMap);\n this.newDialogsToHandle.clear();\n };\n\n public scheduleHandleNewDialogs(peerId?: PeerId, dialog?: Dialog | ForumTopic | ForumTopic['id']) {\n if(peerId !== undefined) {\n let obj = this.newDialogsToHandle.get(peerId);\n if(!obj) {\n this.newDialogsToHandle.set(peerId, obj = {});\n }\n\n const isObject = typeof(dialog) === 'object';\n if(!dialog || (isObject && dialog._ === 'dialog')) {\n obj.dialog = dialog as Dialog;\n } else {\n obj.topics ??= new Map();\n if(isObject) {\n obj.topics.set((dialog as ForumTopic).id, dialog as ForumTopic);\n } else {\n obj.topics.set(dialog as number, undefined);\n }\n }\n }\n\n return this.newDialogsHandlePromise ??= pause(0).then(() => {\n this.newDialogsHandlePromise = undefined;\n this.handleNewDialogs();\n });\n }\n\n public async deleteMessages(peerId: PeerId, mids: number[], revoke?: boolean, isRecursion?: boolean) {\n let promise: Promise;\n\n const isChannel = this.appPeersManager.isChannel(peerId);\n const channelId = isChannel && peerId.toChatId();\n if(isChannel && !isRecursion) {\n const channel = this.appChatsManager.getChat(channelId) as Chat.channel;\n if(!channel.pFlags.creator && !channel.admin_rights?.pFlags?.delete_messages) {\n mids = mids.filter((mid) => {\n const message = this.getMessageByPeer(peerId, mid);\n return !!message.pFlags.out;\n });\n\n if(!mids.length) {\n return;\n }\n }\n }\n\n const config = await this.apiManager.getConfig();\n const overflowMids = mids.splice(config.forwarded_count_max, mids.length - config.forwarded_count_max);\n\n const serverMessageIds = mids.map((mid) => {\n const messageId = getServerMessageId(mid);\n // filter outgoing messages\n return generateMessageId(messageId) === mid && messageId;\n }).filter(Boolean);\n\n if(isChannel) {\n promise = this.apiManager.invokeApi('channels.deleteMessages', {\n channel: this.appChatsManager.getChannelInput(channelId),\n id: serverMessageIds\n }).then((affectedMessages) => {\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateDeleteChannelMessages',\n channel_id: channelId,\n messages: mids,\n pts: affectedMessages.pts,\n pts_count: affectedMessages.pts_count\n });\n });\n } else {\n promise = this.apiManager.invokeApi('messages.deleteMessages', {\n revoke,\n id: serverMessageIds\n }).then((affectedMessages) => {\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateDeleteMessages',\n messages: mids,\n pts: affectedMessages.pts,\n pts_count: affectedMessages.pts_count\n });\n });\n }\n\n const promises: (typeof promise)[] = [promise];\n if(overflowMids.length) {\n promises.push(this.deleteMessages(peerId, overflowMids, revoke, true));\n }\n\n return Promise.all(promises).then(noop);\n }\n\n public readHistory(peerId: PeerId, maxId = 0, threadId?: number, force = false) {\n if(DO_NOT_READ_HISTORY) {\n return Promise.resolve();\n }\n\n // console.trace('start read')\n this.log('readHistory:', peerId, maxId, threadId);\n const readMaxId = this.getReadMaxIdIfUnread(peerId, threadId);\n if(!readMaxId) {\n if(threadId && !force) {\n const forumTopic = this.dialogsStorage.getForumTopic(peerId, threadId);\n if(!getServerMessageId(forumTopic.read_inbox_max_id)) {\n force = true;\n }\n }\n\n if(!force) {\n const dialog = this.appChatsManager.isForum(peerId.toChatId()) && threadId ?\n this.dialogsStorage.getForumTopic(peerId, threadId) :\n this.getDialogOnly(peerId);\n if(dialog && this.isDialogUnread(dialog)) {\n force = true;\n }\n }\n\n if(!force) {\n this.log('readHistory: isn\\'t unread');\n return Promise.resolve();\n }\n }\n\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n\n if(historyStorage.triedToReadMaxId >= maxId) {\n return Promise.resolve();\n }\n\n let apiPromise: Promise;\n if(threadId) {\n if(!historyStorage.readPromise) {\n apiPromise = this.apiManager.invokeApi('messages.readDiscussion', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n msg_id: getServerMessageId(threadId),\n read_max_id: getServerMessageId(maxId)\n });\n // apiPromise = new Promise((resolve) => resolve());\n }\n\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateReadChannelDiscussionInbox',\n channel_id: peerId.toChatId(),\n top_msg_id: threadId,\n read_max_id: maxId\n });\n } else if(this.appPeersManager.isChannel(peerId)) {\n if(!historyStorage.readPromise) {\n apiPromise = this.apiManager.invokeApi('channels.readHistory', {\n channel: this.appChatsManager.getChannelInput(peerId.toChatId()),\n max_id: getServerMessageId(maxId)\n });\n }\n\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateReadChannelInbox',\n max_id: maxId,\n channel_id: peerId.toChatId(),\n still_unread_count: undefined,\n pts: undefined\n });\n } else {\n if(!historyStorage.readPromise) {\n apiPromise = this.apiManager.invokeApi('messages.readHistory', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n max_id: getServerMessageId(maxId)\n }).then((affectedMessages) => {\n this.apiUpdatesManager.processUpdateMessage({\n _: 'updateShort',\n update: {\n _: 'updatePts',\n pts: affectedMessages.pts,\n pts_count: affectedMessages.pts_count\n }\n });\n });\n }\n\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateReadHistoryInbox',\n max_id: maxId,\n peer: this.appPeersManager.getOutputPeer(peerId),\n still_unread_count: undefined,\n pts: undefined,\n pts_count: undefined\n });\n }\n\n this.rootScope.dispatchEvent('notification_reset', this.appPeersManager.getPeerString(peerId));\n\n if(historyStorage.readPromise) {\n return historyStorage.readPromise;\n }\n\n historyStorage.triedToReadMaxId = maxId;\n\n apiPromise.finally(() => {\n delete historyStorage.readPromise;\n\n const {readMaxId} = historyStorage;\n this.log('readHistory: promise finally', maxId, readMaxId);\n\n if(readMaxId > maxId) {\n this.readHistory(peerId, readMaxId, threadId, true);\n }\n });\n\n return historyStorage.readPromise = apiPromise;\n }\n\n public readAllHistory(peerId: PeerId, threadId?: number, force = false) {\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n if(historyStorage.maxId) {\n this.readHistory(peerId, historyStorage.maxId, threadId, force); // lol\n }\n }\n\n private getUnreadMentionsKey(peerId: PeerId, threadId?: number) {\n return peerId + (threadId ? `_${threadId}` : '');\n }\n\n private fixDialogUnreadMentionsIfNoMessage(peerId: PeerId, threadId?: number) {\n const dialog = this.dialogsStorage.getDialogOrTopic(peerId, threadId);\n if(dialog?.unread_mentions_count) {\n this.reloadConversationOrTopic(peerId);\n }\n }\n\n private modifyCachedMentions(peerId: PeerId, mid: number, add: boolean, threadId?: number) {\n const slicedArray = this.unreadMentions[this.getUnreadMentionsKey(peerId, threadId)];\n if(!slicedArray) return;\n\n if(add) {\n if(slicedArray.first.isEnd(SliceEnd.Top)) {\n slicedArray.insertSlice([mid]);\n }\n } else {\n slicedArray.delete(mid);\n }\n }\n\n private fixUnreadMentionsCountIfNeeded(peerId: PeerId, slicedArray: SlicedArray, threadId?: number) {\n const dialog = this.dialogsStorage.getDialogOrTopic(peerId, threadId);\n if(!slicedArray.length && dialog?.unread_mentions_count) {\n this.reloadConversationOrTopic(peerId);\n }\n }\n\n public goToNextMention(peerId: PeerId, threadId?: number) {\n /* this.getUnreadMentions(peerId, 1, 2, 0).then((messages) => {\n console.log(messages);\n }); */\n\n const key = this.getUnreadMentionsKey(peerId, threadId);\n const promise = this.goToNextMentionPromises[key];\n if(promise) {\n return promise;\n }\n\n const slicedArray = this.unreadMentions[peerId] ??= new SlicedArray();\n const length = slicedArray.length;\n const isTopEnd = slicedArray.first.isEnd(SliceEnd.Top);\n if(!length && isTopEnd) {\n this.fixUnreadMentionsCountIfNeeded(peerId, slicedArray, threadId);\n return Promise.resolve();\n }\n\n let loadNextPromise = Promise.resolve();\n if(!isTopEnd && length < 25) {\n loadNextPromise = this.loadNextMentions(peerId, threadId);\n }\n\n return this.goToNextMentionPromises[key] = loadNextPromise.then(() => {\n const last = slicedArray.last;\n const mid = last && last[last.length - 1];\n if(mid) {\n slicedArray.delete(mid);\n return mid;\n } else {\n this.fixUnreadMentionsCountIfNeeded(peerId, slicedArray, threadId);\n }\n }).finally(() => {\n delete this.goToNextMentionPromises[key];\n });\n }\n\n private loadNextMentions(peerId: PeerId, threadId?: number) {\n const slicedArray = this.unreadMentions[peerId];\n const maxId = slicedArray.first[0] || 1;\n\n const backLimit = 50;\n const add_offset = -backLimit;\n const limit = backLimit;\n return this.getUnreadMentions(peerId, maxId, add_offset, limit, undefined, undefined, threadId)\n .then((messages) => {\n this.mergeHistoryResult(slicedArray, messages, maxId === 1 ? 0 : maxId, limit, add_offset);\n });\n }\n\n private getUnreadMentions(\n peerId: PeerId,\n offsetId: number,\n add_offset: number,\n limit: number,\n maxId = 0,\n minId = 0,\n threadId?: number\n ) {\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.getUnreadMentions',\n params: {\n peer: this.appPeersManager.getInputPeerById(peerId),\n offset_id: getServerMessageId(offsetId),\n add_offset,\n limit,\n max_id: getServerMessageId(maxId),\n min_id: getServerMessageId(minId),\n top_msg_id: threadId ? getServerMessageId(threadId) : undefined\n },\n processResult: (messagesMessages) => {\n assumeType>(messagesMessages);\n this.appUsersManager.saveApiUsers(messagesMessages.users);\n this.appChatsManager.saveApiChats(messagesMessages.chats);\n this.saveMessages(messagesMessages.messages);\n\n return messagesMessages;\n }\n });\n }\n\n public readMessages(peerId: PeerId, msgIds: number[]) {\n if(DO_NOT_READ_HISTORY) {\n return Promise.resolve();\n }\n\n if(!msgIds.length) {\n return Promise.resolve();\n }\n\n msgIds = msgIds.map((mid) => getServerMessageId(mid));\n let promise: Promise, update: Update.updateChannelReadMessagesContents | Update.updateReadMessagesContents;\n if(peerId.isAnyChat() && this.appPeersManager.isChannel(peerId)) {\n const channelId = peerId.toChatId();\n\n update = {\n _: 'updateChannelReadMessagesContents',\n channel_id: channelId,\n messages: msgIds\n };\n\n promise = this.apiManager.invokeApi('channels.readMessageContents', {\n channel: this.appChatsManager.getChannelInput(channelId),\n id: msgIds\n });\n } else {\n update = {\n _: 'updateReadMessagesContents',\n messages: msgIds,\n pts: undefined,\n pts_count: undefined\n };\n\n promise = this.apiManager.invokeApi('messages.readMessageContents', {\n id: msgIds\n }).then((affectedMessages) => {\n (update as Update.updateReadMessagesContents).pts = affectedMessages.pts;\n (update as Update.updateReadMessagesContents).pts_count = affectedMessages.pts_count;\n this.apiUpdatesManager.processLocalUpdate(update);\n });\n }\n\n this.apiUpdatesManager.processLocalUpdate(update);\n\n return promise;\n }\n\n public getHistoryStorage(peerId: PeerId, threadId?: number) {\n if(threadId) {\n // threadId = this.getLocalMessageId(threadId);\n return (this.threadsStorage[peerId] ??= {})[threadId] ??= {count: null, history: new SlicedArray()};\n }\n\n return this.historiesStorage[peerId] ??= {count: null, history: new SlicedArray()};\n }\n\n public getHistoryStorageTransferable(peerId: PeerId, threadId?: number) {\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n const {\n count,\n history,\n maxId,\n readMaxId,\n readOutboxMaxId,\n maxOutId,\n replyMarkup\n } = historyStorage;\n\n return {\n count,\n history: undefined as HistoryStorage,\n historySerialized: history.toJSON(),\n maxId,\n readMaxId,\n readOutboxMaxId,\n maxOutId,\n replyMarkup\n };\n }\n\n private getNotifyPeerSettings(peerId: PeerId, threadId?: number) {\n const inputNotifyPeer = this.appPeersManager.getInputNotifyPeerById({peerId, ignorePeerId: true, threadId});\n return Promise.all([\n this.appNotificationsManager.getNotifyPeerTypeSettings(),\n this.appNotificationsManager.getNotifySettings(inputNotifyPeer)\n ]).then(([_, peerTypeNotifySettings]) => {\n return {\n muted: this.appNotificationsManager.isPeerLocalMuted({peerId, respectType: true, threadId}),\n peerTypeNotifySettings\n };\n });\n }\n\n private handleNotifications = () => {\n ctx.clearTimeout(this.notificationsHandlePromise);\n this.notificationsHandlePromise = undefined;\n\n // var timeout = $rootScope.idle.isIDLE && StatusManager.isOtherDeviceActive() ? 30000 : 1000;\n // const timeout = 1000;\n\n for(const key in this.notificationsToHandle) {\n const [peerId, threadId] = key.split('_');\n // if(rootScope.peerId === peerId && !rootScope.idle.isIDLE) {\n // continue;\n // }\n\n const notifyPeerToHandle = this.notificationsToHandle[key];\n this.getNotifyPeerSettings(peerId.toPeerId(), threadId ? +threadId : undefined)\n .then(({muted, peerTypeNotifySettings}) => {\n const topMessage = notifyPeerToHandle.topMessage;\n if((muted && !topMessage.pFlags.mentioned) || !topMessage.pFlags.unread) {\n return;\n }\n\n // setTimeout(() => {\n if(topMessage.pFlags.unread) {\n this.notifyAboutMessage(topMessage, {\n fwdCount: notifyPeerToHandle.fwdCount,\n peerTypeNotifySettings\n });\n }\n // }, timeout);\n });\n }\n\n this.notificationsToHandle = {};\n };\n\n public getUpdateAfterReloadKey(peerId: PeerId, threadId?: number) {\n return peerId + (threadId ? '_' + threadId : '');\n }\n\n private handleNewUpdateAfterReload(peerId: PeerId, update: Update, threadId?: number) {\n const set = this.newUpdatesAfterReloadToHandle[this.getUpdateAfterReloadKey(peerId, threadId)] ??= new Set();\n if(set.has(update)) {\n this.log.error('here we go again', peerId);\n return;\n }\n\n (update as any).ignoreExisting = true;\n set.add(update);\n this.scheduleHandleNewDialogs(peerId, threadId);\n }\n\n private onUpdateMessageId = (update: Update.updateMessageID) => {\n const randomId = update.random_id;\n const pendingData = this.pendingByRandomId[randomId];\n if(!pendingData) {\n return;\n }\n\n const mid = generateMessageId(update.id);\n this.pendingByMessageId[mid] = randomId;\n // const {storage} = pendingData;\n // const message = this.getMessageFromStorage(storage, mid);\n // if(message) { // if message somehow already exists\n // this.checkPendingMessage(message);\n // }\n };\n\n private onUpdateNewMessage = (update: Update.updateNewDiscussionMessage | Update.updateNewMessage | Update.updateNewChannelMessage) => {\n const message = update.message as MyMessage;\n const peerId = this.getMessagePeer(message);\n const storage = this.getHistoryMessagesStorage(peerId);\n\n // * local update\n const isLocalThreadUpdate = update._ === 'updateNewDiscussionMessage';\n\n // * temporary save the message for info (peerId, reply mids...)\n this.saveMessages([message], {storage: this.createMessageStorage(peerId, 'history')});\n\n // * check if sent message is already in storage\n // const oldMessage = this.getMessageFromStorage(storage, message.mid);\n // if(\n // (message as Message.message).pFlags.is_outgoing &&\n // oldMessage &&\n // !(oldMessage as Message.message).pFlags.is_outgoing\n // ) {\n // this.checkPendingMessage(message);\n // return;\n // }\n\n const isForum = this.appPeersManager.isForum(peerId);\n const threadKey = this.getThreadKey(message);\n const threadId = threadKey ? +threadKey.split('_')[1] : undefined;\n const dialog = this.dialogsStorage.getDialogOrTopic(peerId, isLocalThreadUpdate ? threadId : undefined);\n\n if((!dialog || this.reloadConversationsPeers.has(peerId)) && !isLocalThreadUpdate) {\n let good = true;\n if(peerId.isAnyChat()) {\n good = this.appChatsManager.isInChat(peerId.toChatId());\n }\n\n if(good) {\n this.handleNewUpdateAfterReload(peerId, update);\n return;\n }\n\n // return;\n }\n\n if(threadId && !isLocalThreadUpdate) {\n const threadStorage = this.threadsStorage[peerId]?.[threadId];\n const update = {\n _: 'updateNewDiscussionMessage',\n message\n } as Update.updateNewDiscussionMessage;\n\n if(this.appChatsManager.isForum(peerId.toChatId()) && !this.dialogsStorage.getForumTopic(peerId, threadId)) {\n // this.dialogsStorage.getForumTopicById(peerId, threadId);\n this.handleNewUpdateAfterReload(peerId, update, threadId);\n } else if(threadStorage) {\n this.onUpdateNewMessage(update);\n }\n }\n\n if(message._ === 'messageService') {\n const {action} = message;\n if(action._ === 'messageActionPaymentSent' && message.reply_to) {\n this.rootScope.dispatchEvent('payment_sent', {\n peerId: message.reply_to.reply_to_peer_id ?\n this.appPeersManager.getPeerId(message.reply_to.reply_to_peer_id) :\n message.peerId,\n mid: message.reply_to_mid,\n receiptMessage: message\n });\n }\n\n if(action._ === 'messageActionTopicEdit' && !isLocalThreadUpdate) {\n const topic = this.dialogsStorage.getForumTopic(peerId, threadId);\n if(!topic) {\n this.dialogsStorage.getForumTopicById(peerId, threadId);\n } else {\n const oldTopic = copy(topic);\n\n if(action.title !== undefined) {\n topic.title = action.title;\n }\n\n if(action.closed !== undefined) {\n setBooleanFlag(topic.pFlags, 'closed', action.closed);\n }\n\n if(action.hidden !== undefined) {\n setBooleanFlag(topic.pFlags, 'hidden', action.hidden);\n }\n\n if(action.icon_emoji_id !== undefined) {\n topic.icon_emoji_id = action.icon_emoji_id;\n }\n\n this.scheduleHandleNewDialogs(peerId, topic);\n\n this.dialogsStorage.processTopicUpdate(topic, oldTopic);\n }\n }\n }\n\n /* if(update._ === 'updateNewChannelMessage') {\n const chat = appChatsManager.getChat(peerId.toChatId());\n if(chat.pFlags && (chat.pFlags.left || chat.pFlags.kicked)) {\n return;\n }\n } */\n\n this.saveMessages([message], {storage});\n // this.log.warn(dT(), 'message unread', message.mid, message.pFlags.unread)\n\n /* if((message as Message.message).grouped_id) {\n this.log('updateNewMessage', message);\n } */\n\n this.checkPendingMessage(message);\n const historyStorage = this.getHistoryStorage(peerId, isLocalThreadUpdate ? threadId : undefined);\n\n if(!isLocalThreadUpdate) {\n this.updateMessageRepliesIfNeeded(message);\n }\n\n // * so message can exist if reloadConversation came back earlier with mid\n const ignoreExisting: boolean = (update as any).ignoreExisting;\n const isExisting = !!historyStorage.history.findSlice(message.mid);\n if(isExisting) {\n if(!ignoreExisting) {\n return false;\n }\n } else {\n // * catch situation with disconnect. if message's id is lower than we already have (in bottom end slice), will sort it\n const firstSlice = historyStorage.history.first;\n if(firstSlice.isEnd(SliceEnd.Bottom)) {\n let i = 0;\n for(const length = firstSlice.length; i < length; ++i) {\n if(message.mid > firstSlice[i]) {\n break;\n }\n }\n\n firstSlice.splice(i, 0, message.mid);\n } else {\n historyStorage.history.unshift(message.mid);\n }\n\n if(historyStorage.count !== null) {\n ++historyStorage.count;\n }\n }\n\n if(!historyStorage.maxId || message.mid > historyStorage.maxId) {\n historyStorage.maxId = message.mid;\n }\n\n if(this.mergeReplyKeyboard(historyStorage, message)) {\n this.rootScope.dispatchEvent('history_reply_markup', {peerId});\n }\n\n const fromId = message.fromId;\n if(fromId.isUser() && !message.pFlags.out && message.from_id) {\n this.appUsersManager.forceUserOnline(fromId, message.date);\n\n const action: SendMessageAction = {\n _: 'sendMessageCancelAction'\n };\n\n let update: Update.updateUserTyping | Update.updateChatUserTyping | Update.updateChannelUserTyping;\n if(peerId.isUser()) {\n update = {\n _: 'updateUserTyping',\n action,\n user_id: fromId\n };\n } else if(this.appPeersManager.isChannel(peerId)) {\n update = {\n _: 'updateChannelUserTyping',\n action,\n channel_id: peerId.toChatId(),\n from_id: this.appPeersManager.getOutputPeer(fromId),\n top_msg_id: threadId ? getServerMessageId(threadId) : undefined\n };\n } else {\n update = {\n _: 'updateChatUserTyping',\n action,\n chat_id: peerId.toChatId(),\n from_id: this.appPeersManager.getOutputPeer(fromId)\n };\n }\n\n this.apiUpdatesManager.processLocalUpdate(update);\n }\n\n // commented to render the message if it's been sent faster than history_append came to main thread\n // if(!pendingMessage) {\n this.handleNewMessage(message);\n // }\n\n const isTopic = dialog?._ === 'forumTopic';\n if((isLocalThreadUpdate && !isTopic) || !dialog) {\n return;\n }\n\n const inboxUnread = !message.pFlags.out && message.pFlags.unread;\n\n {\n if(inboxUnread && message.mid > dialog.top_message) {\n const releaseUnreadCount = this.dialogsStorage.prepareDialogUnreadCountModifying(dialog);\n\n ++dialog.unread_count;\n if(message.pFlags.mentioned) {\n ++dialog.unread_mentions_count;\n this.modifyCachedMentions(peerId, message.mid, true, isTopic ? threadId : undefined);\n }\n\n releaseUnreadCount();\n }\n\n if(message.mid >= dialog.top_message) {\n this.setDialogTopMessage(message, dialog);\n }\n }\n\n if(((!isLocalThreadUpdate && !isForum) || isTopic) && inboxUnread) {\n const notifyPeer = threadKey || peerId;\n const notifyPeerToHandle = this.notificationsToHandle[notifyPeer] ??= {\n fwdCount: 0,\n fromId: NULL_PEER_ID\n };\n\n if(notifyPeerToHandle.fromId !== fromId) {\n notifyPeerToHandle.fromId = fromId;\n notifyPeerToHandle.fwdCount = 0;\n }\n\n if((message as Message.message).fwd_from) {\n ++notifyPeerToHandle.fwdCount;\n }\n\n notifyPeerToHandle.topMessage = message;\n\n this.notificationsHandlePromise ??= ctx.setTimeout(this.handleNotifications, 0);\n }\n };\n\n private onUpdateMessageReactions = (update: Update.updateMessageReactions) => {\n const {peer, msg_id, reactions} = update;\n const mid = generateMessageId(msg_id);\n const peerId = this.appPeersManager.getPeerId(peer);\n const message: MyMessage = this.getMessageByPeer(peerId, mid);\n\n if(message?._ !== 'message') {\n return;\n }\n\n const recentReactions = reactions?.recent_reactions;\n if(recentReactions?.length && message.pFlags.out) {\n const recentReaction = recentReactions[recentReactions.length - 1];\n const previousReactions = message.reactions;\n const previousRecentReactions = previousReactions?.recent_reactions;\n if(\n this.appPeersManager.getPeerId(recentReaction.peer_id) !== this.appPeersManager.peerId && (\n !previousRecentReactions ||\n previousRecentReactions.length <= recentReactions.length\n ) && (\n !previousRecentReactions ||\n !deepEqual(recentReaction, previousRecentReactions[previousRecentReactions.length - 1])\n )\n ) {\n this.getNotifyPeerSettings(peerId).then(({muted, peerTypeNotifySettings}) => {\n if(/* muted || */!peerTypeNotifySettings.show_previews) return;\n this.notifyAboutMessage(message, {\n peerReaction: recentReaction,\n peerTypeNotifySettings\n });\n });\n }\n }\n\n const key = message.peerId + '_' + message.mid;\n this.pushBatchUpdate('messages_reactions', this.batchUpdateReactions, key, () => copy(message.reactions));\n\n message.reactions = reactions;\n\n if(!update.local) {\n this.setDialogToStateIfMessageIsTop(message);\n }\n };\n\n private onUpdateDialogUnreadMark = (update: Update.updateDialogUnreadMark) => {\n // this.log('updateDialogUnreadMark', update);\n const peerId = this.appPeersManager.getPeerId((update.peer as DialogPeer.dialogPeer).peer);\n const dialog = this.getDialogOnly(peerId);\n\n if(!dialog) {\n this.scheduleHandleNewDialogs(peerId);\n } else {\n const releaseUnreadCount = this.dialogsStorage.prepareDialogUnreadCountModifying(dialog);\n\n if(!update.pFlags.unread) {\n delete dialog.pFlags.unread_mark;\n } else {\n dialog.pFlags.unread_mark = true;\n }\n\n releaseUnreadCount();\n this.dialogsStorage.setDialogToState(dialog);\n this.rootScope.dispatchEvent('dialogs_multiupdate', new Map([[peerId, {dialog}]]));\n }\n };\n\n private onUpdateEditMessage = (update: Update.updateEditMessage | Update.updateEditChannelMessage) => {\n const message = update.message as MyMessage;\n const peerId = this.getMessagePeer(message);\n const mid = generateMessageId(message.id);\n const storage = this.getHistoryMessagesStorage(peerId);\n if(!storage.has(mid)) {\n // this.fixDialogUnreadMentionsIfNoMessage(peerId);\n return;\n }\n\n // console.trace(dT(), 'edit message', message)\n\n const oldMessage: Message = this.getMessageFromStorage(storage, mid);\n this.saveMessages([message], {storage});\n const newMessage: Message = this.getMessageFromStorage(storage, mid);\n\n this.handleEditedMessage(oldMessage, newMessage, storage);\n\n const dialog = this.getDialogOnly(peerId);\n\n // if sender erased mention\n /* if(dialog.unread_mentions_count && (oldMessage as Message.message)?.pFlags?.mentioned && !message.pFlags.mentioned) {\n --dialog.unread_mentions_count;\n this.modifyCachedMentions(peerId, mid, false);\n } */\n\n const isTopMessage = dialog?.top_message === mid;\n if((message as Message.messageService).clear_history) {\n if(isTopMessage) {\n this.rootScope.dispatchEvent('dialog_flush', {peerId, dialog});\n }\n } else {\n let dispatchEditEvent = true;\n // no sense in dispatching message_edit since only reactions have changed\n if(oldMessage?._ === 'message' && !deepEqual(oldMessage.reactions, (newMessage as Message.message).reactions)) {\n const newReactions = (newMessage as Message.message).reactions;\n (newMessage as Message.message).reactions = oldMessage.reactions;\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateMessageReactions',\n peer: this.appPeersManager.getOutputPeer(peerId),\n msg_id: message.id,\n reactions: newReactions\n });\n\n dispatchEditEvent = false;\n }\n\n dispatchEditEvent && this.rootScope.dispatchEvent('message_edit', {\n storageKey: storage.key,\n peerId,\n mid,\n message\n });\n\n if(isTopMessage) {\n this.dialogsStorage.setDialogToState(dialog);\n }\n\n const map: BroadcastEvents['dialogs_multiupdate'] = new Map();\n const getUpdateCache = () => {\n let cache = map.get(peerId);\n if(!cache) {\n map.set(peerId, cache = {});\n }\n\n return cache;\n };\n\n if((isTopMessage || (message as Message.message).grouped_id) && dialog) {\n getUpdateCache().dialog = dialog;\n }\n\n const threadKey = this.getThreadKey(message);\n if(threadKey) {\n const topicId = +threadKey.split('_')[1];\n const topic = this.dialogsStorage.getForumTopic(peerId, topicId);\n if(topic) {\n (getUpdateCache().topics ??= new Map()).set(topicId, topic);\n }\n }\n\n if(map.size) {\n this.rootScope.dispatchEvent('dialogs_multiupdate', map);\n }\n }\n };\n\n private onUpdateReadHistory = (update: Update.updateReadChannelDiscussionInbox | Update.updateReadChannelDiscussionOutbox\n | Update.updateReadHistoryInbox | Update.updateReadHistoryOutbox\n | Update.updateReadChannelInbox | Update.updateReadChannelOutbox) => {\n const channelId = (update as Update.updateReadChannelInbox).channel_id;\n const maxId = generateMessageId((update as Update.updateReadChannelInbox).max_id || (update as Update.updateReadChannelDiscussionInbox).read_max_id);\n const threadId = generateMessageId((update as Update.updateReadChannelDiscussionInbox).top_msg_id);\n const peerId = channelId ? channelId.toPeerId(true) : this.appPeersManager.getPeerId((update as Update.updateReadHistoryInbox).peer);\n\n const isOut = update._ === 'updateReadHistoryOutbox' ||\n update._ === 'updateReadChannelOutbox' ||\n update._ === 'updateReadChannelDiscussionOutbox' ? true : undefined;\n\n const isForum = channelId ? this.appChatsManager.isForum(channelId) : false;\n const storage = this.getHistoryMessagesStorage(peerId);\n const history = getObjectKeysAndSort(storage, 'desc');\n const foundDialog = threadId && isForum ?\n this.dialogsStorage.getForumTopic(peerId, threadId) :\n this.getDialogOnly(peerId);\n const stillUnreadCount = (update as Update.updateReadChannelInbox).still_unread_count;\n let newUnreadCount = 0;\n let newUnreadMentionsCount = 0;\n let foundAffected = false;\n\n // this.log.warn(dT(), 'read', peerId, isOut ? 'out' : 'in', maxId)\n\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n\n if(peerId.isUser() && isOut) {\n this.appUsersManager.forceUserOnline(peerId.toUserId());\n }\n\n if(threadId) {\n const repliesKey = this.threadsToReplies[peerId + '_' + threadId];\n if(repliesKey) {\n const [peerId, mid] = repliesKey.split('_');\n this.updateMessage(peerId.toPeerId(), +mid, 'replies_updated');\n }\n }\n\n const releaseUnreadCount = foundDialog && this.dialogsStorage.prepareDialogUnreadCountModifying(foundDialog);\n const readMaxId = this.getReadMaxIdIfUnread(peerId, threadId);\n\n for(let i = 0, length = history.length; i < length; i++) {\n const mid = history[i];\n if(mid > maxId) {\n continue;\n }\n\n const message: MyMessage = storage.get(mid);\n\n if(message.pFlags.out !== isOut) {\n continue;\n }\n\n const messageThreadId = getMessageThreadId(message, isForum);\n if(threadId && messageThreadId !== threadId) {\n continue;\n }\n\n const isUnread = message.pFlags.unread || (readMaxId && readMaxId < mid);\n\n if(!isUnread) {\n break;\n }\n\n // this.log.warn('read', messageId, isUnread, message)\n delete message.pFlags.unread;\n foundAffected ||= true;\n\n if(!message.pFlags.out && foundDialog) {\n if(stillUnreadCount === undefined) {\n newUnreadCount = --foundDialog.unread_count;\n }\n\n if(message.pFlags.mentioned) {\n newUnreadMentionsCount = --foundDialog.unread_mentions_count;\n this.modifyCachedMentions(peerId, message.mid, false);\n }\n }\n\n this.rootScope.dispatchEvent('notification_cancel', 'msg' + mid);\n }\n\n if(isOut) historyStorage.readOutboxMaxId = maxId;\n else historyStorage.readMaxId = maxId;\n\n if(foundDialog) {\n if(isOut) foundDialog.read_outbox_max_id = maxId;\n else foundDialog.read_inbox_max_id = maxId;\n\n if(!isOut) {\n let setCount: number;\n if(stillUnreadCount !== undefined) {\n setCount = stillUnreadCount;\n } else if(\n newUnreadCount < 0 ||\n maxId >= foundDialog.top_message ||\n !readMaxId\n ) {\n setCount = 0;\n } else if(newUnreadCount && foundDialog.top_message > maxId) {\n setCount = newUnreadCount;\n }\n\n if(setCount !== undefined) {\n foundDialog.unread_count = setCount;\n }\n\n if(newUnreadMentionsCount < 0 || !foundDialog.unread_count) {\n foundDialog.unread_mentions_count = 0;\n }\n }\n\n releaseUnreadCount?.();\n\n this.dialogsStorage.processDialogForFilters(foundDialog);\n\n this.rootScope.dispatchEvent('dialog_unread', {peerId, dialog: foundDialog});\n this.dialogsStorage.setDialogToState(foundDialog);\n\n if(!foundAffected && stillUnreadCount === undefined && !isOut && foundDialog.unread_count) {\n if(foundDialog._ === 'forumTopic') {\n this.dialogsStorage.getForumTopicById(peerId, threadId);\n } else {\n this.reloadConversation(peerId);\n }\n }\n }\n\n if(foundAffected) {\n this.rootScope.dispatchEvent('messages_read');\n }\n\n if(!threadId && channelId) {\n const threadKeyPart = peerId + '_';\n for(const threadKey in this.threadsToReplies) {\n if(threadKey.indexOf(threadKeyPart) === 0) {\n const [peerId, mid] = this.threadsToReplies[threadKey].split('_');\n this.rootScope.dispatchEvent('replies_updated', this.getMessageByPeer(peerId.toPeerId(), +mid) as Message.message);\n }\n }\n }\n };\n\n private onUpdateReadMessagesContents = (update: Update.updateChannelReadMessagesContents | Update.updateReadMessagesContents) => {\n const channelId = (update as Update.updateChannelReadMessagesContents).channel_id;\n const topMsgId = (update as Update.updateChannelReadMessagesContents).top_msg_id;\n const threadId = topMsgId ? generateMessageId(topMsgId) : undefined;\n const mids = (update as Update.updateReadMessagesContents).messages.map((id) => generateMessageId(id));\n const peerId = channelId ? channelId.toPeerId(true) : this.findPeerIdByMids(mids);\n for(let i = 0, length = mids.length; i < length; ++i) {\n const mid = mids[i];\n const message: MyMessage = this.getMessageByPeer(peerId, mid);\n if(message) {\n if(message.pFlags.media_unread) {\n delete message.pFlags.media_unread;\n this.setDialogToStateIfMessageIsTop(message);\n\n if(!message.pFlags.out && message.pFlags.mentioned) {\n this.modifyCachedMentions(peerId, mid, false, threadId);\n }\n }\n } else {\n this.fixDialogUnreadMentionsIfNoMessage(peerId, threadId);\n }\n }\n\n this.rootScope.dispatchEvent('messages_media_read', {peerId, mids});\n };\n\n private onUpdateChannelAvailableMessages = (update: Update.updateChannelAvailableMessages) => {\n const peerId = update.channel_id.toPeerId(true);\n const history = this.getHistoryStorage(peerId).history.slice;\n const availableMinId = generateMessageId(update.available_min_id);\n const messages = history.filter((mid) => mid <= availableMinId);\n\n (update as any as Update.updateDeleteChannelMessages).messages = messages;\n this.onUpdateDeleteMessages(update as any as Update.updateDeleteChannelMessages);\n };\n\n private onUpdateDeleteMessages = (update: Update.updateDeleteMessages | Update.updateDeleteChannelMessages) => {\n const channelId = (update as Update.updateDeleteChannelMessages).channel_id;\n // const messages = (update as any as Update.updateDeleteChannelMessages).messages;\n const messages = (update as any as Update.updateDeleteChannelMessages).messages.map((id) => generateMessageId(id));\n const peerId: PeerId = channelId ? channelId.toPeerId(true) : this.findPeerIdByMids(messages);\n\n if(!peerId) {\n return;\n }\n\n this.apiManager.clearCache('messages.getSearchCounters', (params) => {\n return this.appPeersManager.getPeerId(params.peer) === peerId;\n });\n\n const threadKeys: Set = new Set(), topics: Map = new Map();\n for(const mid of messages) {\n const message = this.getMessageByPeer(peerId, mid);\n const threadKey = this.getThreadKey(message);\n if(!threadKey) {\n continue;\n }\n\n const threadId = +threadKey.split('_')[1];\n if(this.threadsStorage[peerId]?.[threadId]) {\n threadKeys.add(threadKey);\n\n if(!topics.has(threadId)) {\n const topic = this.dialogsStorage.getForumTopic(peerId, threadId);\n if(topic) {\n topics.set(threadId, topic);\n }\n }\n }\n }\n\n const historyUpdated = this.handleDeletedMessages(\n peerId,\n this.getHistoryMessagesStorage(peerId),\n messages\n );\n\n const threadsStorages = Array.from(threadKeys).map((threadKey) => {\n const [peerId, mid] = threadKey.split('_');\n return this.getHistoryStorage(peerId.toPeerId(), +mid);\n });\n\n const historyStorages = [\n this.getHistoryStorage(peerId),\n ...threadsStorages\n ];\n historyStorages.forEach((historyStorage) => {\n for(const mid of historyUpdated.msgs) {\n historyStorage.history.delete(mid);\n }\n\n if(historyUpdated.count && historyStorage.count) {\n historyStorage.count = Math.max(0, historyStorage.count - historyUpdated.count);\n }\n });\n\n this.rootScope.dispatchEvent('history_delete', {peerId, msgs: historyUpdated.msgs});\n\n const dialogs: (MTDialog.dialog | ForumTopic)[] = [\n ...topics.values()\n ];\n\n const dialog = this.getDialogOnly(peerId);\n if(dialog) {\n dialogs.unshift(dialog);\n }\n\n dialogs.forEach((dialog) => {\n const isTopic = dialog._ === 'forumTopic';\n const affected = historyUpdated.unreadMentions || historyUpdated.unread;\n const releaseUnreadCount = affected && this.dialogsStorage.prepareDialogUnreadCountModifying(dialog);\n\n if(historyUpdated.unread) {\n dialog.unread_count = Math.max(0, dialog.unread_count - historyUpdated.unread);\n }\n\n if(historyUpdated.unreadMentions) {\n dialog.unread_mentions_count = !dialog.unread_count ? 0 : Math.max(0, dialog.unread_mentions_count - historyUpdated.unreadMentions);\n }\n\n if(affected) {\n releaseUnreadCount();\n\n if(!isTopic) {\n this.rootScope.dispatchEvent('dialog_unread', {peerId, dialog});\n }\n }\n\n if(historyUpdated.msgs.has(dialog.top_message)) {\n const historyStorage = this.getHistoryStorage(dialog.peerId, isTopic ? dialog.id : undefined);\n const slice = historyStorage.history.first;\n if(slice.isEnd(SliceEnd.Bottom) && slice.length) {\n const mid = slice[0];\n const message = this.getMessageByPeer(peerId, mid);\n this.setDialogTopMessage(message, dialog);\n } else if(isTopic) {\n this.dialogsStorage.getForumTopicById(peerId, dialog.id);\n } else {\n this.reloadConversation(peerId);\n }\n }\n });\n };\n\n private onUpdateChannel = (update: Update.updateChannel) => {\n const channelId = update.channel_id;\n const peerId = channelId.toPeerId(true);\n const channel = this.appChatsManager.getChat(channelId) as Chat.channel;\n\n const needDialog = this.appChatsManager.isInChat(channelId);\n\n const canViewHistory = !!getPeerActiveUsernames(channel)[0] || !channel.pFlags.left;\n const hasHistory = this.historiesStorage[peerId] !== undefined;\n\n if(canViewHistory !== hasHistory) {\n delete this.historiesStorage[peerId];\n this.rootScope.dispatchEvent('history_forbidden', peerId);\n }\n\n const dialog = this.getDialogOnly(peerId);\n if(!!dialog !== needDialog) {\n if(needDialog) {\n this.reloadConversation(peerId);\n } else {\n this.dialogsStorage.dropDialogOnDeletion(peerId);\n }\n }\n\n this.rootScope.dispatchEvent('channel_update', channelId);\n };\n\n private onUpdateChannelReload = (update: Update.updateChannelReload) => {\n const peerId = update.channel_id.toPeerId(true);\n\n // if(this.appPeersManager.isForum(peerId)) {\n // const cache = this.dialogsStorage.getForumTopicsCache(peerId);\n // if(cache.topics.size) {\n\n // }\n // }\n\n this.flushStoragesByPeerId(peerId);\n Promise.all([\n this.reloadConversation(peerId)\n ]).then(() => {\n this.rootScope.dispatchEvent('history_reload', peerId);\n });\n };\n\n private onUpdateChannelMessageViews = (update: Update.updateChannelMessageViews) => {\n const views = update.views;\n const peerId = update.peerId ?? update.channel_id.toPeerId(true);\n const mid = generateMessageId(update.id);\n const message = this.getMessageByPeer(peerId, mid) as Message.message;\n if(message?.views !== undefined && message.views < views) {\n message.views = views;\n this.pushBatchUpdate('messages_views', this.batchUpdateViews, message.peerId + '_' + message.mid);\n this.setDialogToStateIfMessageIsTop(message);\n }\n };\n\n private onUpdateServiceNotification = (update: Update.updateServiceNotification) => {\n // this.log('updateServiceNotification', update);\n if(update.pFlags?.popup) {\n this.rootScope.dispatchEvent('service_notification', update);\n return;\n }\n\n const fromId = SERVICE_PEER_ID;\n const peerId = fromId;\n const messageId = this.generateTempMessageId(peerId);\n const message: Message.message = {\n _: 'message',\n id: messageId,\n from_id: this.appPeersManager.getOutputPeer(fromId),\n peer_id: this.appPeersManager.getOutputPeer(peerId),\n pFlags: {unread: true},\n date: (update.inbox_date || tsNow(true)) + this.timeManager.getServerTimeOffset(),\n message: update.message,\n media: update.media,\n entities: update.entities\n };\n if(!this.appUsersManager.hasUser(fromId)) {\n this.appUsersManager.saveApiUsers([{\n _: 'user',\n id: fromId,\n pFlags: {verified: true},\n access_hash: '0',\n first_name: 'Telegram',\n phone: '42777'\n }]);\n }\n this.saveMessages([message], {isOutgoing: true});\n\n if(update.inbox_date) {\n this.pendingTopMsgs[peerId] = messageId;\n this.onUpdateNewMessage({\n _: 'updateNewMessage',\n message,\n pts: undefined,\n pts_count: undefined\n });\n }\n };\n\n private onUpdatePinnedMessages = (update: Update.updatePinnedMessages | Update.updatePinnedChannelMessages) => {\n const channelId = update._ === 'updatePinnedChannelMessages' ? update.channel_id : undefined;\n const peerId = channelId ? channelId.toPeerId(true) : this.appPeersManager.getPeerId((update as Update.updatePinnedMessages).peer);\n\n /* const storage = this.getSearchStorage(peerId, 'inputMessagesFilterPinned');\n if(storage.count !== storage.history.length) {\n if(storage.count !== undefined) {\n delete this.searchesStorage[peerId]['inputMessagesFilterPinned'];\n }\n\n rootScope.broadcast('peer_pinned_messages', peerId);\n break;\n } */\n\n const messages = update.messages.map((id) => generateMessageId(id));\n\n const storage = this.getHistoryMessagesStorage(peerId);\n const missingMessages = messages.filter((mid) => !storage.has(mid));\n const getMissingPromise = missingMessages.length ? Promise.all(missingMessages.map((mid) => this.reloadMessages(peerId, mid))) : Promise.resolve();\n getMissingPromise.finally(() => {\n const werePinned = update.pFlags?.pinned;\n if(werePinned) {\n for(const mid of messages) {\n // storage.history.push(mid);\n const message = storage.get(mid) as Message.message;\n message.pFlags.pinned = true;\n }\n\n /* if(this.pinnedMessages[peerId]?.maxId) {\n const maxMid = Math.max(...messages);\n this.pinnedMessages\n } */\n\n // storage.history.sort((a, b) => b - a);\n } else {\n for(const mid of messages) {\n // storage.history.findAndSplice((_mid) => _mid === mid);\n const message = storage.get(mid) as Message.message;\n delete message.pFlags.pinned;\n }\n }\n\n /* const info = this.pinnedMessages[peerId];\n if(info) {\n info.count += messages.length * (werePinned ? 1 : -1);\n } */\n\n delete this.pinnedMessages[this.getPinnedMessagesKey(peerId)];\n this.appStateManager.getState().then((state) => {\n delete state.hiddenPinnedMessages[peerId];\n this.rootScope.dispatchEvent('peer_pinned_messages', {peerId, mids: messages, pinned: werePinned});\n });\n });\n };\n\n private onUpdateNotifySettings = (update: Update.updateNotifySettings) => {\n const {peer, notify_settings} = update;\n const isTopic = peer._ === 'notifyForumTopic';\n const isPeerType = peer._ === 'notifyPeer' || isTopic;\n if(!isPeerType) {\n return;\n }\n\n const peerId = this.appPeersManager.getPeerId(peer.peer);\n const dialog = this.dialogsStorage.getDialogOrTopic(peerId, isTopic ? generateMessageId(peer.top_msg_id) : undefined);\n if(!dialog) {\n return;\n }\n\n dialog.notify_settings = notify_settings;\n this.rootScope.dispatchEvent('dialog_notify_settings', dialog);\n this.dialogsStorage.setDialogToState(dialog);\n };\n\n private onUpdateNewScheduledMessage = (update: Update.updateNewScheduledMessage) => {\n const message = update.message as MyMessage;\n const peerId = this.getMessagePeer(message);\n\n const storage = this.scheduledMessagesStorage[peerId];\n if(!storage) {\n return;\n }\n\n const mid = generateMessageId(message.id);\n\n const oldMessage = this.getMessageFromStorage(storage, mid);\n this.saveMessages([message], {storage, isScheduled: true});\n const newMessage = this.getMessageFromStorage(storage, mid);\n\n if(oldMessage) {\n this.handleEditedMessage(oldMessage, newMessage, storage);\n this.rootScope.dispatchEvent('message_edit', {storageKey: storage.key, peerId, mid: message.mid, message});\n } else {\n const pendingMessage = this.checkPendingMessage(message);\n if(!pendingMessage) {\n this.rootScope.dispatchEvent('scheduled_new', message as Message.message);\n }\n }\n };\n\n private onUpdateDeleteScheduledMessages = (update: Update.updateDeleteScheduledMessages) => {\n const peerId = this.appPeersManager.getPeerId(update.peer);\n\n const storage = this.scheduledMessagesStorage[peerId];\n if(storage) {\n const mids = update.messages.map((id) => generateMessageId(id));\n this.handleDeletedMessages(peerId, storage, mids);\n\n this.rootScope.dispatchEvent('scheduled_delete', {peerId, mids});\n }\n };\n\n private onUpdateMessageExtendedMedia = (update: Update.updateMessageExtendedMedia) => {\n const peerId = this.appPeersManager.getPeerId(update.peer);\n const mid = generateMessageId(update.msg_id);\n const storage = this.getHistoryMessagesStorage(peerId);\n if(!storage.has(mid)) {\n // this.fixDialogUnreadMentionsIfNoMessage(peerId);\n return;\n }\n\n const message = this.getMessageFromStorage(storage, mid) as Message.message;\n const messageMedia = message.media as MessageMedia.messageMediaInvoice;\n if(messageMedia.extended_media?._ === 'messageExtendedMedia') {\n return;\n }\n\n messageMedia.extended_media = update.extended_media;\n this.onUpdateEditMessage({\n _: 'updateEditMessage',\n message,\n pts: 0,\n pts_count: 0\n });\n };\n\n private onUpdateTranscribedAudio = (update: Update.updateTranscribedAudio) => {\n const peerId = this.appPeersManager.getPeerId(update.peer);\n const text = update.text;\n const mid = generateMessageId(update.msg_id);\n\n this.rootScope.dispatchEvent('message_transcribed', {peerId, mid, text, pending: update.pFlags.pending});\n };\n\n public setDialogToStateIfMessageIsTop(message: MyMessage) {\n if(this.isMessageIsTopMessage(message)) {\n this.dialogsStorage.setDialogToState(this.getDialogOnly(message.peerId));\n }\n }\n\n public isMessageIsTopMessage(message: MyMessage) {\n const dialog = this.getDialogOnly(message.peerId);\n return dialog && dialog.top_message === message.mid;\n }\n\n private updateMessageRepliesIfNeeded(threadMessage: MyMessage) {\n try { // * на всякий случай, скорее всего это не понадобится\n const threadKey = this.getThreadKey(threadMessage);\n if(threadKey) {\n const repliesKey = this.threadsToReplies[threadKey];\n if(repliesKey) {\n const [peerId, mid] = repliesKey.split('_');\n\n this.updateMessage(peerId.toPeerId(), +mid, 'replies_updated');\n }\n }\n } catch(err) {\n this.log.error('incrementMessageReplies err', err, threadMessage);\n }\n }\n\n private getThreadKey(threadMessage: MyMessage) {\n let threadKey = '';\n if(threadMessage?.peerId?.isAnyChat()) {\n const threadId = getMessageThreadId(threadMessage, this.appChatsManager.isForum(threadMessage.peerId.toChatId()));\n if(threadId) {\n threadKey = threadMessage.peerId + '_' + threadId;\n }\n }\n\n return threadKey;\n }\n\n public updateMessage(peerId: PeerId, mid: number, broadcastEventName?: 'replies_updated'): Promise {\n const promise: Promise = this.reloadMessages(peerId, mid, true).then(() => {\n const message = this.getMessageByPeer(peerId, mid) as Message.message;\n if(!message) {\n return;\n }\n\n if(broadcastEventName) {\n this.rootScope.dispatchEvent(broadcastEventName, message);\n }\n\n return message;\n });\n\n return promise;\n }\n\n private checkPendingMessage(message: MyMessage) {\n const randomId = this.pendingByMessageId[message.mid];\n let pendingMessage: ReturnType;\n if(randomId) {\n const pendingData = this.pendingByRandomId[randomId];\n if(pendingMessage = this.finalizePendingMessage(randomId, message)) {\n this.rootScope.dispatchEvent('history_update', {\n storageKey: pendingData.storage.key,\n message,\n sequential: pendingData.sequential\n });\n }\n\n delete this.pendingByMessageId[message.mid];\n }\n\n return pendingMessage;\n }\n\n public mutePeer(options: {peerId: PeerId, muteUntil: number, threadId?: number}) {\n if(!(options = this.appNotificationsManager.validatePeerSettings(options))) {\n return;\n }\n\n const {peerId, muteUntil, threadId} = options;\n const settings: InputPeerNotifySettings = {\n _: 'inputPeerNotifySettings'\n };\n\n settings.mute_until = muteUntil;\n\n const peer = this.appPeersManager.getInputPeerById(peerId);\n return this.appNotificationsManager.updateNotifySettings(threadId ? {\n _: 'inputNotifyForumTopic',\n peer,\n top_msg_id: getServerMessageId(threadId)\n } : {\n _: 'inputNotifyPeer',\n peer\n }, settings);\n }\n\n public togglePeerMute({peerId, mute, threadId}: {peerId: PeerId, mute?: boolean, threadId?: number}) {\n if(mute === undefined) {\n mute = !this.appNotificationsManager.isPeerLocalMuted({peerId, respectType: false, threadId});\n }\n\n return this.mutePeer({peerId, muteUntil: mute ? MUTE_UNTIL : 0, threadId});\n }\n\n private findPeerIdByMids(mids: number[]) {\n for(let length = mids.length, i = length - 1; i >= 0; --i) {\n const mid = mids[i];\n const message = this.getMessageById(mid);\n if(message) {\n return message.peerId;\n }\n }\n }\n\n public canSendToPeer(peerId: PeerId, threadId?: number, action: ChatRights = 'send_messages') {\n if(this.appPeersManager.isPeerRestricted(peerId)) {\n return false;\n }\n\n if(peerId.isAnyChat()) {\n const chatId = peerId.toChatId();\n if(threadId) {\n const topic = this.dialogsStorage.getForumTopic(peerId, threadId);\n if(topic?.pFlags?.closed && !this.appChatsManager.hasRights(chatId, 'manage_topics')) {\n return false;\n }\n }\n\n // const isChannel = appPeersManager.isChannel(peerId);\n const chat = this.appChatsManager.getChat(chatId) as Chat.chat;\n const hasRights = /* isChannel && */this.appChatsManager.hasRights(chatId, action, undefined, !!threadId);\n return /* !isChannel || */hasRights && (!chat.pFlags.left || !!threadId);\n } else {\n return this.appUsersManager.canSendToUser(peerId);\n }\n }\n\n public finalizePendingMessage(randomId: Long, finalMessage: MyMessage) {\n const pendingData = this.pendingByRandomId[randomId];\n if(!pendingData) {\n return;\n }\n\n const {peerId, tempId, threadId, storage} = pendingData;\n\n [\n this.getHistoryStorage(peerId),\n threadId ? this.getHistoryStorage(peerId, threadId) : undefined\n ]\n .filter(Boolean)\n .forEach((storage) => {\n storage.history.delete(tempId);\n });\n\n // this.log('pending', randomID, historyStorage.pending)\n\n const tempMessage: MyMessage = this.getMessageFromStorage(storage, tempId);\n if(tempMessage) {\n delete finalMessage.pFlags.is_outgoing;\n delete finalMessage.pending;\n delete finalMessage.error;\n delete finalMessage.random_id;\n delete finalMessage.send;\n }\n\n this.rootScope.dispatchEvent('messages_pending');\n\n delete this.pendingByRandomId[randomId];\n\n this.finalizePendingMessageCallbacks(storage, tempId, finalMessage);\n\n return tempMessage;\n }\n\n public finalizePendingMessageCallbacks(storage: MessagesStorage, tempId: number, message: MyMessage) {\n const callbacks = this.tempFinalizeCallbacks[tempId];\n // this.log.warn(callbacks, tempId);\n if(callbacks !== undefined) {\n for(const name in callbacks) {\n const {deferred, callback} = callbacks[name];\n // this.log(`finalizePendingMessageCallbacks: will invoke ${name} callback`);\n callback(message).then(deferred.resolve, deferred.reject);\n }\n\n delete this.tempFinalizeCallbacks[tempId];\n }\n\n // set cached url to media\n if((message as Message.message).media) {\n assumeType(message);\n const {photo: newPhoto, document: newDoc} = message.media as any;\n if(newPhoto) {\n const photo = this.appPhotosManager.getPhoto('' + tempId);\n if(/* photo._ !== 'photoEmpty' */photo) {\n const newPhotoSize = newPhoto.sizes[newPhoto.sizes.length - 1];\n const cacheContext = this.thumbsStorage.getCacheContext(newPhoto, newPhotoSize.type);\n const oldCacheContext = this.thumbsStorage.getCacheContext(photo, THUMB_TYPE_FULL);\n Object.assign(cacheContext, oldCacheContext);\n\n const photoSize = newPhoto.sizes[newPhoto.sizes.length - 1] as PhotoSize.photoSize;\n\n const downloadOptions = getPhotoDownloadOptions(newPhoto, photoSize);\n const fileName = getFileNameByLocation(downloadOptions.location);\n // this.appDownloadManager.fakeDownload(fileName, oldCacheContext.url);\n }\n } else if(newDoc) {\n const oldDoc = this.appDocsManager.getDoc('' + tempId);\n if(oldDoc) {\n const oldCacheContext = this.thumbsStorage.getCacheContext(oldDoc);\n if(\n /* doc._ !== 'documentEmpty' && */\n oldDoc.type &&\n oldDoc.type !== 'sticker' &&\n oldDoc.mime_type !== 'image/gif' &&\n oldCacheContext.url\n ) {\n const cacheContext = this.thumbsStorage.getCacheContext(newDoc);\n Object.assign(cacheContext, oldCacheContext);\n\n const fileName = getDocumentInputFileName(newDoc);\n // this.appDownloadManager.fakeDownload(fileName, oldCacheContext.url);\n }\n }\n } else if((message.media as MessageMedia.messageMediaPoll).poll) {\n delete this.appPollsManager.polls[tempId];\n delete this.appPollsManager.results[tempId];\n }\n }\n\n const tempMessage = this.getMessageFromStorage(storage, tempId);\n storage.delete(tempId);\n\n if(!(tempMessage as Message.message).reply_markup && (message as Message.message).reply_markup) {\n setTimeout(() => { // TODO: refactor it to normal buttons adding\n if(!this.getMessageFromStorage(storage, message.mid)) {\n return;\n }\n\n this.rootScope.dispatchEvent('message_edit', {storageKey: storage.key, peerId: message.peerId, mid: message.mid, message});\n }, 0);\n }\n\n this.handleReleasingMessage(tempMessage, storage);\n\n this.rootScope.dispatchEvent('message_sent', {storageKey: storage.key, tempId, tempMessage, mid: message.mid, message});\n }\n\n public incrementMaxSeenId(maxId: number) {\n if(!maxId || !(!this.maxSeenId || maxId > this.maxSeenId)) {\n return false;\n }\n\n this.maxSeenId = maxId;\n this.appStateManager.pushToState('maxSeenMsgId', maxId);\n\n this.apiManager.invokeApi('messages.receivedMessages', {\n max_id: getServerMessageId(maxId)\n });\n }\n\n public async getMessageReactionsListAndReadParticipants(\n message: Message.message,\n limit?: number,\n reaction?: Reaction,\n offset?: string,\n skipReadParticipants?: boolean,\n skipReactionsList?: boolean\n ) {\n const emptyMessageReactionsList = {\n reactions: [] as MessagePeerReaction[],\n count: 0,\n next_offset: undefined as string\n };\n\n const canViewMessageReadParticipants = await this.canViewMessageReadParticipants(message);\n if(canViewMessageReadParticipants && limit === undefined) {\n limit = 100;\n } else if(limit === undefined) {\n limit = 50;\n }\n\n return Promise.all([\n canViewMessageReadParticipants && !reaction && !skipReadParticipants ? this.getMessageReadParticipants(message.peerId, message.mid).catch(() => [] as UserId[]) : [] as UserId[],\n\n message.reactions?.recent_reactions?.length && !skipReactionsList ? this.appReactionsManager.getMessageReactionsList(message.peerId, message.mid, limit, reaction, offset).catch((err) => emptyMessageReactionsList) : emptyMessageReactionsList\n ]).then(([userIds, messageReactionsList]) => {\n const readParticipantsPeerIds = userIds.map((userId) => userId.toPeerId());\n\n const filteredReadParticipants = readParticipantsPeerIds.slice();\n forEachReverse(filteredReadParticipants, (peerId, idx, arr) => {\n if(messageReactionsList.reactions.some((reaction) => this.appPeersManager.getPeerId(reaction.peer_id) === peerId)) {\n arr.splice(idx, 1);\n }\n });\n\n let combined: {peerId: PeerId, reaction?: Reaction}[] = messageReactionsList.reactions.map((reaction) => ({peerId: this.appPeersManager.getPeerId(reaction.peer_id), reaction: reaction.reaction}));\n combined = combined.concat(filteredReadParticipants.map((readPeerId) => ({peerId: readPeerId})));\n\n return {\n reactions: messageReactionsList.reactions,\n reactionsCount: messageReactionsList.count,\n readParticipants: readParticipantsPeerIds,\n combined: combined,\n nextOffset: messageReactionsList.next_offset\n };\n });\n }\n\n public getMessageReadParticipants(peerId: PeerId, mid: number): Promise {\n return this.apiManager.invokeApiSingle('messages.getMessageReadParticipants', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n msg_id: getServerMessageId(mid)\n }).then((userIds) => { // ! convert long to number\n return userIds.map((userId) => userId.toUserId());\n });\n }\n\n public async canViewMessageReadParticipants(message: Message) {\n if(\n message?._ !== 'message' ||\n message.pFlags.is_outgoing ||\n !message.pFlags.out ||\n !this.appPeersManager.isAnyGroup(message.peerId)\n ) {\n return false;\n }\n\n const chat = this.appChatsManager.getChat(message.peerId.toChatId()) as Chat.chat | Chat.channel;\n const appConfig = await this.apiManager.getAppConfig();\n return chat.participants_count <= appConfig.chat_read_mark_size_threshold &&\n (tsNow(true) - message.date) < appConfig.chat_read_mark_expire_period;\n }\n\n public incrementMessageViews(peerId: PeerId, mids: number[]) {\n if(!mids.length) {\n return;\n }\n\n return this.apiManager.invokeApiSingle('messages.getMessagesViews', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n id: mids.map((mid) => getServerMessageId(mid)),\n increment: true\n }).then((views) => {\n const updates: Update[] = new Array(mids.length);\n for(let i = 0, length = mids.length; i < length; ++i) {\n updates[i] = {\n _: 'updateChannelMessageViews',\n channel_id: NULL_PEER_ID,\n peerId,\n id: mids[i],\n views: views.views[i].views\n };\n }\n\n this.apiUpdatesManager.processUpdateMessage({\n _: 'updates',\n updates,\n chats: views.chats,\n users: views.users\n });\n });\n }\n\n private notifyAboutMessage(message: MyMessage, options: Partial<{\n fwdCount: number,\n peerReaction: MessagePeerReaction,\n peerTypeNotifySettings: PeerNotifySettings\n }> = {}) {\n const peerId = this.getMessagePeer(message);\n\n if(this.appPeersManager.isPeerRestricted(peerId)) {\n return;\n }\n\n const tabs = appTabsManager.getTabs();\n let tab = tabs.find((tab) => {\n const {chatPeerIds} = tab.state;\n return chatPeerIds[chatPeerIds.length - 1] === peerId;\n });\n\n if(!tab && tabs.length) {\n tabs.sort((a, b) => a.state.idleStartTime - b.state.idleStartTime);\n tab = !tabs[0].state.idleStartTime ? tabs[0] : tabs[tabs.length - 1];\n }\n\n const port = MTProtoMessagePort.getInstance();\n port.invokeVoid('notificationBuild', {\n message,\n ...options\n }, tab?.source);\n }\n\n public getScheduledMessagesStorage(peerId: PeerId) {\n return this.scheduledMessagesStorage[peerId] ??= this.createMessageStorage(peerId, 'scheduled');\n }\n\n public getScheduledMessageByPeer(peerId: PeerId, mid: number) {\n return this.getMessageFromStorage(this.getScheduledMessagesStorage(peerId), mid);\n }\n\n public getScheduledMessages(peerId: PeerId) {\n if(!this.canSendToPeer(peerId)) return;\n\n const storage = this.getScheduledMessagesStorage(peerId);\n if(storage.size) {\n return [...storage.keys()];\n }\n\n return this.apiManager.invokeApiSingle('messages.getScheduledHistory', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n hash: ''\n }).then((historyResult) => {\n if(historyResult._ !== 'messages.messagesNotModified') {\n this.appUsersManager.saveApiUsers(historyResult.users);\n this.appChatsManager.saveApiChats(historyResult.chats);\n\n const storage = this.getScheduledMessagesStorage(peerId);\n this.saveMessages(historyResult.messages, {storage, isScheduled: true});\n return [...storage.keys()];\n }\n\n return [];\n });\n }\n\n public sendScheduledMessages(peerId: PeerId, mids: number[]) {\n return this.apiManager.invokeApi('messages.sendScheduledMessages', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n id: mids.map((mid) => getServerMessageId(mid))\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n });\n }\n\n public deleteScheduledMessages(peerId: PeerId, mids: number[]) {\n return this.apiManager.invokeApi('messages.deleteScheduledMessages', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n id: mids.map((mid) => getServerMessageId(mid))\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n });\n }\n\n public getMessageWithReplies(message: Message.message) {\n return this.filterMessages(message, (message) => !!(message as Message.message).replies)[0] as any;\n }\n\n public getMessageWithCommentReplies(message: Message.message) {\n if(message.peerId !== REPLIES_PEER_ID) {\n message = this.getMessageWithReplies(message);\n const replies = message?.replies;\n if(!(replies && replies.pFlags.comments && replies.channel_id.toChatId() !== REPLIES_HIDDEN_CHANNEL_ID)) {\n return;\n }\n }\n\n return message;\n }\n\n public isFetchIntervalNeeded(peerId: PeerId) {\n return peerId.isAnyChat() && (\n !this.appChatsManager.isInChat(peerId.toChatId()) ||\n this.appChatsManager.isForum(peerId.toChatId())\n );\n }\n\n public async getNewHistory(peerId: PeerId, threadId?: number) {\n if(!this.isFetchIntervalNeeded(peerId)) {\n return;\n }\n\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n const slice = historyStorage.history.slice;\n if(!slice.isEnd(SliceEnd.Bottom)) {\n return;\n }\n\n delete historyStorage.maxId;\n slice.unsetEnd(SliceEnd.Bottom);\n\n // if there is no id - then request by first id because cannot request by id 0 with backLimit\n const historyResult = await this.getHistory(peerId, slice[0] ?? 1, 0, 50, threadId);\n for(let i = 0, length = historyResult.history.length; i < length; ++i) {\n this.handleNewMessage(this.getMessageByPeer(peerId, historyResult.history[i]));\n }\n\n return {isBottomEnd: historyStorage.history.slice.isEnd(SliceEnd.Bottom)};\n }\n\n /**\n * * https://core.telegram.org/api/offsets, offset_id is inclusive\n */\n // public getHistory(peerId: PeerId, maxId?: number, limit?: number, backLimit?: number, threadId?: number, onlyCache?: false): Promise | HistoryResult;\n // public getHistory(peerId: PeerId, maxId?: number, limit?: number, backLimit?: number, threadId?: number, onlyCache?: true): HistoryResult;\n public getHistory(peerId: PeerId, maxId: number = 0, limit?: number, backLimit?: number, threadId?: number/* , onlyCache?: boolean */): Promise | HistoryResult {\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n\n if(this.appPeersManager.isPeerRestricted(peerId)) {\n const first = historyStorage.history.first;\n first.setEnd(SliceEnd.Both);\n\n const slice = first.slice(0, 0);\n slice.setEnd(SliceEnd.Both);\n\n return {\n count: 0,\n history: Array.from(slice),\n isEnd: slice.getEnds(),\n offsetIdOffset: 0\n };\n }\n\n let offset = 0;\n /*\n let offsetFound = true;\n\n if(maxId) {\n offsetFound = false;\n for(; offset < historyStorage.history.length; offset++) {\n if(maxId > historyStorage.history.slice[offset]) {\n offsetFound = true;\n break;\n }\n }\n }\n\n if(offsetFound && (\n historyStorage.count !== null && historyStorage.history.length === historyStorage.count ||\n historyStorage.history.length >= offset + limit\n )) {\n if(backLimit) {\n backLimit = Math.min(offset, backLimit);\n offset = Math.max(0, offset - backLimit);\n limit += backLimit;\n } else {\n limit = limit;\n }\n\n const history = historyStorage.history.slice.slice(offset, offset + limit);\n return {\n count: historyStorage.count,\n history: history,\n offsetIdOffset: offset\n };\n }\n\n if(offsetFound) {\n offset = 0;\n } */\n\n if(backLimit) {\n offset = -backLimit;\n limit += backLimit;\n\n /* return this.requestHistory(reqPeerId, maxId, limit, offset, undefined, threadId).then((historyResult) => {\n historyStorage.count = (historyResult as MessagesMessages.messagesMessagesSlice).count || historyResult.messages.length;\n\n const history = (historyResult.messages as MyMessage[]).map((message) => message.mid);\n return {\n count: historyStorage.count,\n history,\n offsetIdOffset: (historyResult as MessagesMessages.messagesMessagesSlice).offset_id_offset || 0\n };\n }); */\n }\n\n const haveSlice = historyStorage.history.sliceMe(maxId, offset, limit);\n if(haveSlice && (haveSlice.slice.length === limit || (haveSlice.fulfilled & SliceEnd.Both) === SliceEnd.Both)) {\n return {\n count: historyStorage.count,\n history: Array.from(haveSlice.slice),\n isEnd: haveSlice.slice.getEnds(),\n offsetIdOffset: haveSlice.offsetIdOffset\n };\n }\n\n // if(onlyCache) {\n // return;\n // }\n\n return this.fillHistoryStorage(peerId, maxId, limit, offset, historyStorage, threadId).then(() => {\n const slice = historyStorage.history.sliceMe(maxId, offset, limit);\n const f = slice?.slice || historyStorage.history.constructSlice();\n return {\n count: historyStorage.count,\n history: Array.from(f),\n isEnd: f.getEnds(),\n offsetIdOffset: slice?.offsetIdOffset || historyStorage.count\n };\n });\n }\n\n public isHistoryResultEnd(historyResult: Exclude, limit: number, add_offset: number) {\n const {offset_id_offset, messages} = historyResult as MessagesMessages.messagesMessagesSlice;\n\n const count = (historyResult as MessagesMessages.messagesMessagesSlice).count || messages.length;\n const offsetIdOffset = offset_id_offset ?? count - 1;\n\n const topWasMeantToLoad = add_offset < 0 ? limit + add_offset : limit;\n\n const isTopEnd = offsetIdOffset >= (count - topWasMeantToLoad) || count < topWasMeantToLoad;\n const isBottomEnd = !offsetIdOffset || (add_offset < 0 && (offsetIdOffset + add_offset) <= 0);\n\n return {count, offsetIdOffset, isTopEnd, isBottomEnd};\n }\n\n public mergeHistoryResult(\n slicedArray: SlicedArray,\n historyResult: Parameters[0],\n offset_id: number,\n limit: number,\n add_offset: number\n ) {\n const {messages} = historyResult as MessagesMessages.messagesMessagesSlice;\n const isEnd = this.isHistoryResultEnd(historyResult, limit, add_offset);\n const {count, offsetIdOffset, isTopEnd, isBottomEnd} = isEnd;\n const mids = messages.map((message) => {\n return (message as MyMessage).mid;\n });\n\n // * add bound manually.\n // * offset_id will be inclusive only if there is 'add_offset' <= -1 (-1 - will only include the 'offset_id')\n // * check that offset_id is not 0\n if(offset_id && getServerMessageId(offset_id) && !mids.includes(offset_id) && offsetIdOffset < count) {\n let i = 0;\n for(const length = mids.length; i < length; ++i) {\n if(offset_id > mids[i]) {\n break;\n }\n }\n\n mids.splice(i, 0, offset_id);\n }\n\n const slice = slicedArray.insertSlice(mids) || slicedArray.slice;\n if(isTopEnd) {\n slice.setEnd(SliceEnd.Top);\n }\n\n if(isBottomEnd) {\n slice.setEnd(SliceEnd.Bottom);\n }\n\n return {slice, mids, messages, ...isEnd};\n }\n\n public fillHistoryStorage(peerId: PeerId, offset_id: number, limit: number, add_offset: number, historyStorage: HistoryStorage, threadId?: number): Promise {\n const wasMaxId = historyStorage.maxId;\n return this.requestHistory(peerId, offset_id, limit, add_offset, undefined, threadId).then((historyResult) => {\n const {count, isBottomEnd, slice, messages} = this.mergeHistoryResult(historyStorage.history, historyResult, offset_id, limit, add_offset);\n\n historyStorage.count = count;\n\n /* if(!maxId && historyResult.messages.length) {\n maxId = this.incrementMessageId((historyResult.messages[0] as MyMessage).mid, 1);\n }\n\n const wasTotalCount = historyStorage.history.length; */\n\n for(let i = 0, length = messages.length; i < length; ++i) {\n const message = messages[i] as MyMessage;\n if(this.mergeReplyKeyboard(historyStorage, message)) {\n this.rootScope.dispatchEvent('history_reply_markup', {peerId});\n }\n }\n\n if(isBottomEnd) {\n const newMaxId = slice[0];\n\n if(historyStorage.maxId === wasMaxId) {\n const first = historyStorage.history.first;\n if(first !== slice) {\n historyStorage.history.deleteSlice(first);\n }\n\n if(historyStorage.maxId !== newMaxId) {\n historyStorage.maxId = slice[0]; // ! WARNING\n\n this.reloadConversation(peerId); // when top_message is deleted but cached\n }\n }\n }\n\n /* const isBackLimit = offset < 0 && -offset !== fullLimit;\n if(isBackLimit) {\n return;\n }\n\n const totalCount = historyStorage.history.length;\n fullLimit -= (totalCount - wasTotalCount);\n\n const migratedNextPeer = this.migratedFromTo[peerId];\n const migratedPrevPeer = this.migratedToFrom[peerId]\n const isMigrated = migratedNextPeer !== undefined || migratedPrevPeer !== undefined;\n\n if(isMigrated) {\n historyStorage.count = Math.max(historyStorage.count, totalCount) + 1;\n }\n\n if(fullLimit > 0) {\n maxId = historyStorage.history.slice[totalCount - 1];\n if(isMigrated) {\n if(!historyResult.messages.length) {\n if(migratedPrevPeer) {\n maxId = 0;\n peerId = migratedPrevPeer;\n } else {\n historyStorage.count = totalCount;\n return true;\n }\n }\n\n return this.fillHistoryStorage(peerId, maxId, fullLimit, historyStorage, threadId);\n } else if(totalCount < historyStorage.count) {\n return this.fillHistoryStorage(peerId, maxId, fullLimit, offset, historyStorage, threadId);\n }\n } */\n });\n }\n\n public requestHistory(peerId: PeerId, maxId: number, limit = 0, offset = 0, offsetDate = 0, threadId = 0): Promise> {\n // console.trace('requestHistory', peerId, maxId, limit, offset);\n\n // rootScope.broadcast('history_request');\n\n const options: MessagesGetReplies | MessagesGetHistory = {\n peer: this.appPeersManager.getInputPeerById(peerId),\n offset_id: getServerMessageId(maxId) || 0,\n offset_date: offsetDate,\n add_offset: offset,\n limit,\n max_id: 0,\n min_id: 0,\n hash: 0\n };\n\n if(threadId) {\n (options as MessagesGetReplies).msg_id = getServerMessageId(threadId) || 0;\n }\n\n const promise: ReturnType = this.apiManager.invokeApiSingle(threadId ? 'messages.getReplies' : 'messages.getHistory', options, {\n // timeout: APITIMEOUT,\n noErrorBox: true\n }) as any;\n\n return promise.then((historyResult) => {\n if(DEBUG) {\n this.log('requestHistory result:', peerId, historyResult, maxId, limit, offset);\n }\n\n this.appUsersManager.saveApiUsers(historyResult.users);\n this.appChatsManager.saveApiChats(historyResult.chats);\n this.saveMessages(historyResult.messages);\n\n if('pts' in historyResult) {\n this.apiUpdatesManager.addChannelState(peerId.toChatId(), historyResult.pts);\n }\n\n let length = historyResult.messages.length, count = (historyResult as MessagesMessages.messagesMessagesSlice).count;\n if(length && !historyResult.messages[length - 1]) {\n historyResult.messages.splice(length - 1, 1);\n length--;\n count--;\n }\n\n // will load more history if last message is album grouped (because it can be not last item)\n // historyResult.messages: desc sorted\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n const oldestMessage: Message.message = historyResult.messages[length - 1] as any;\n if(length && oldestMessage.grouped_id) {\n const foundSlice = historyStorage.history.findSlice(oldestMessage.mid);\n if(foundSlice && (foundSlice.slice.length + historyResult.messages.length) < count) {\n return this.requestHistory(peerId, oldestMessage.mid, 10, 0, offsetDate, threadId).then((_historyResult) => {\n return historyResult;\n });\n }\n }\n\n return historyResult;\n }, (error) => {\n switch(error.type) {\n case 'CHANNEL_PRIVATE':\n let channel = this.appChatsManager.getChat(peerId.toChatId());\n if(channel._ === 'channel') {\n channel = {\n _: 'channelForbidden',\n id: peerId.toChatId(),\n access_hash: channel.access_hash,\n title: channel.title,\n pFlags: channel.pFlags\n };\n }\n\n this.apiUpdatesManager.processUpdateMessage({\n _: 'updates',\n updates: [{\n _: 'updateChannel',\n channel_id: peerId.toChatId()\n }],\n chats: [channel],\n users: []\n });\n break;\n }\n\n throw error;\n });\n }\n\n public fetchSingleMessages() {\n if(this.fetchSingleMessagesPromise) {\n return this.fetchSingleMessagesPromise;\n }\n\n return this.fetchSingleMessagesPromise = pause(0).then(() => {\n const requestPromises: Promise[] = [];\n\n for(const [peerId, map] of this.needSingleMessages) {\n const mids = [...map.keys()];\n const msgIds: InputMessage[] = mids.map((mid) => {\n return {\n _: 'inputMessageID',\n id: getServerMessageId(mid)\n };\n });\n\n let promise: Promise;\n if(peerId.isAnyChat() && this.appPeersManager.isChannel(peerId)) {\n promise = this.apiManager.invokeApiSingle('channels.getMessages', {\n channel: this.appChatsManager.getChannelInput(peerId.toChatId()),\n id: msgIds\n });\n } else {\n promise = this.apiManager.invokeApiSingle('messages.getMessages', {\n id: msgIds\n });\n }\n\n const after = promise.then((getMessagesResult) => {\n assumeType>(getMessagesResult);\n\n this.appUsersManager.saveApiUsers(getMessagesResult.users);\n this.appChatsManager.saveApiChats(getMessagesResult.chats);\n const messages = this.saveMessages(getMessagesResult.messages);\n\n for(let i = 0; i < messages.length; ++i) {\n const message = messages[i];\n if(!message) {\n continue;\n }\n\n const mid = generateMessageId(message.id);\n const promise = map.get(mid);\n promise.resolve(message);\n map.delete(mid);\n }\n\n if(map.size) {\n for(const [mid, promise] of map) {\n promise.resolve(this.generateEmptyMessage(mid));\n }\n }\n }).finally(() => {\n this.rootScope.dispatchEvent('messages_downloaded', {peerId, mids});\n });\n\n requestPromises.push(after);\n }\n\n this.needSingleMessages.clear();\n\n return Promise.all(requestPromises).then(noop, noop).then(() => {\n this.fetchSingleMessagesPromise = undefined;\n if(this.needSingleMessages.size) this.fetchSingleMessages();\n });\n });\n }\n\n public reloadMessages(peerId: PeerId, mid: number, overwrite?: boolean): Promise;\n public reloadMessages(peerId: PeerId, mid: number[], overwrite?: boolean): Promise;\n public reloadMessages(peerId: PeerId, mid: number | number[], overwrite?: boolean): Promise {\n if(Array.isArray(mid)) {\n return Promise.all(mid.map((mid) => {\n return this.reloadMessages(peerId, mid, overwrite);\n }));\n }\n\n const message = this.getMessageByPeer(peerId, mid);\n if(message && !overwrite) {\n this.rootScope.dispatchEvent('messages_downloaded', {peerId, mids: [mid]});\n return Promise.resolve(message);\n } else {\n let map = this.needSingleMessages.get(peerId);\n if(!map) {\n this.needSingleMessages.set(peerId, map = new Map());\n }\n\n let promise = map.get(mid);\n if(promise) {\n return promise;\n }\n\n promise = deferredPromise();\n map.set(mid, promise);\n this.fetchSingleMessages();\n return promise;\n }\n }\n\n public getExtendedMedia(peerId: PeerId, mids: number[]) {\n let map = this.extendedMedia.get(peerId);\n if(!map) {\n this.extendedMedia.set(peerId, map = new Map());\n }\n\n const deferred = deferredPromise();\n const toRequest: number[] = [];\n const promises = mids.map((mid) => {\n let promise = map.get(mid);\n if(!promise) {\n map.set(mid, promise = deferred);\n toRequest.push(mid);\n\n promise.then(() => {\n map.delete(mid);\n if(!map.size && this.extendedMedia.get(peerId) === map) {\n this.extendedMedia.delete(peerId);\n }\n });\n }\n\n return promise;\n });\n\n if(!toRequest.length) {\n deferred.resolve();\n } else {\n this.apiManager.invokeApi('messages.getExtendedMedia', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n id: toRequest.map((mid) => getServerMessageId(mid))\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n deferred.resolve();\n });\n }\n\n return Promise.all(promises);\n }\n\n public fetchMessageReplyTo(message: MyMessage) {\n if(!message.reply_to_mid) return Promise.resolve(this.generateEmptyMessage(0));\n const replyToPeerId = message.reply_to.reply_to_peer_id ? this.appPeersManager.getPeerId(message.reply_to.reply_to_peer_id) : message.peerId;\n return this.reloadMessages(replyToPeerId, message.reply_to_mid).then((originalMessage) => {\n if(!originalMessage) { // ! break the infinite loop\n message = this.getMessageByPeer(message.peerId, message.mid); // message can come from other thread\n delete message.reply_to_mid; // ! WARNING!\n }\n\n if(message._ === 'messageService') {\n const peerId = message.peerId;\n this.rootScope.dispatchEvent('message_edit', {\n storageKey: `${peerId}_history`,\n peerId: peerId,\n mid: message.mid,\n message\n });\n\n if(this.isMessageIsTopMessage(message)) {\n this.rootScope.dispatchEvent('dialogs_multiupdate', new Map([[peerId, {dialog: this.getDialogOnly(peerId)}]]));\n }\n }\n\n return originalMessage;\n });\n }\n\n private getTypingKey(peerId: PeerId, threadId?: number) {\n return threadId ? `${peerId}_${threadId}` : peerId;\n }\n\n public setTyping(\n peerId: PeerId,\n action: SendMessageAction,\n force?: boolean,\n threadId?: number\n ): Promise {\n if(threadId && !this.appPeersManager.isForum(peerId)) {\n threadId = undefined;\n }\n\n const key = this.getTypingKey(peerId, threadId);\n let typing = this.typings[key];\n if(\n !peerId ||\n !this.canSendToPeer(peerId) ||\n peerId === this.appPeersManager.peerId ||\n // (!force && deepEqual(typing?.action, action))\n (!force && typing?.action?._ === action._)\n ) {\n return Promise.resolve(false);\n }\n\n if(typing?.timeout) {\n clearTimeout(typing.timeout);\n }\n\n typing = this.typings[key] = {\n action\n };\n\n return this.apiManager.invokeApi('messages.setTyping', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n action,\n top_msg_id: threadId ? getServerMessageId(threadId) : undefined\n }).finally(() => {\n if(typing === this.typings[key]) {\n typing.timeout = ctx.setTimeout(() => {\n delete this.typings[key];\n }, 6000);\n }\n });\n }\n\n private handleReleasingMessage(message: MyMessage, storage: MessagesStorage) {\n const media = (message as Message.message).media;\n if(media) {\n const c = (media as MessageMedia.messageMediaWebPage).webpage as WebPage.webPage || media as MessageMedia.messageMediaPhoto | MessageMedia.messageMediaDocument;\n const smth: Photo.photo | MyDocument = (c as MessageMedia.messageMediaPhoto).photo as any || (c as MessageMedia.messageMediaDocument).document as any;\n\n if(smth?.file_reference) {\n this.referenceDatabase.deleteContext(smth.file_reference, {type: 'message', peerId: message.peerId, messageId: message.mid});\n }\n\n if('webpage' in media && media.webpage) {\n const isScheduled = this.getScheduledMessagesStorage(message.peerId) === storage;\n const messageKey = this.appWebPagesManager.getMessageKeyForPendingWebPage(message.peerId, message.mid, isScheduled);\n this.appWebPagesManager.deleteWebPageFromPending(media.webpage, messageKey);\n }\n\n if((media as MessageMedia.messageMediaPoll).poll) {\n this.appPollsManager.updatePollToMessage(message as Message.message, false);\n }\n }\n }\n\n private handleDeletedMessages(peerId: PeerId, storage: MessagesStorage, messages: number[]) {\n const history: {\n count: number,\n unread: number,\n unreadMentions: number,\n msgs: Set,\n albums?: {[groupId: string]: Set},\n } = {\n count: 0,\n unread: 0,\n unreadMentions: 0,\n msgs: new Set()\n };\n\n for(const mid of messages) {\n const message: MyMessage = this.getMessageFromStorage(storage, mid);\n if(!message) {\n this.fixDialogUnreadMentionsIfNoMessage(peerId);\n continue;\n }\n\n this.handleReleasingMessage(message, storage);\n\n this.updateMessageRepliesIfNeeded(message);\n\n if(!message.pFlags.out && !message.pFlags.is_outgoing && message.pFlags.unread) {\n ++history.unread;\n this.rootScope.dispatchEvent('notification_cancel', 'msg' + mid);\n\n if(message.pFlags.mentioned) {\n ++history.unreadMentions;\n this.modifyCachedMentions(peerId, mid, false);\n }\n }\n\n ++history.count;\n history.msgs.add(mid);\n\n message.deleted = true;\n\n const groupedId = (message as Message.message).grouped_id;\n if(groupedId) {\n const groupedStorage = this.groupedMessagesStorage[groupedId];\n if(groupedStorage) {\n groupedStorage.delete(mid);\n\n if(!history.albums) history.albums = {};\n (history.albums[groupedId] || (history.albums[groupedId] = new Set())).add(mid);\n\n if(!groupedStorage.size) {\n delete history.albums;\n delete this.groupedMessagesStorage[groupedId];\n }\n }\n }\n\n storage.delete(mid);\n }\n\n if(history.albums) {\n for(const groupedId in history.albums) {\n this.dispatchAlbumEdit(groupedId, storage, [...history.albums[groupedId]]);\n /* const mids = this.getMidsByAlbum(groupId);\n if(mids.length) {\n const mid = Math.max(...mids);\n rootScope.$broadcast('message_edit', {peerId, mid, justMedia: false});\n } */\n }\n }\n\n return history;\n }\n\n private handleEditedMessage(oldMessage: Message, newMessage: Message, storage: MessagesStorage) {\n if(oldMessage._ === 'message') {\n if((oldMessage.media as MessageMedia.messageMediaWebPage)?.webpage) {\n const messageKey = this.appWebPagesManager.getMessageKeyForPendingWebPage(oldMessage.peerId, oldMessage.mid, !!oldMessage.pFlags.is_scheduled);\n this.appWebPagesManager.deleteWebPageFromPending((oldMessage.media as MessageMedia.messageMediaWebPage).webpage, messageKey);\n }\n\n const groupedId = oldMessage.grouped_id;\n if(groupedId) {\n this.dispatchAlbumEdit(groupedId, storage, []);\n }\n }\n }\n\n private dispatchAlbumEdit(groupedId: string, storage: MessagesStorage, deletedMids?: number[]) {\n const mids = this.getMidsByAlbum(groupedId);\n const messages = mids.map((mid) => this.getMessageFromStorage(storage, mid)) as Message.message[];\n this.rootScope.dispatchEvent('album_edit', {peerId: messages[0].peerId, groupId: groupedId, deletedMids: deletedMids || [], messages});\n }\n\n public getDialogUnreadCount(dialog: Dialog | ForumTopic) {\n let unreadCount = dialog.unread_count;\n if(!this.dialogsStorage.isTopic(dialog) && this.appPeersManager.isForum(dialog.peerId)) {\n const forumUnreadCount = this.dialogsStorage.getForumUnreadCount(dialog.peerId);\n if(forumUnreadCount instanceof Promise) {\n unreadCount = 0;\n } else {\n unreadCount = forumUnreadCount.count;\n }\n }\n\n return unreadCount || +!!(dialog as Dialog).pFlags?.unread_mark;\n }\n\n public isDialogUnread(dialog: Dialog | ForumTopic) {\n return !!this.getDialogUnreadCount(dialog);\n }\n\n public canForward(message: Message.message | Message.messageService) {\n return message?._ === 'message' && !(message as Message.message).pFlags.noforwards && !this.appPeersManager.noForwards(message.peerId);\n }\n\n private pushBatchUpdate(\n event: E,\n callback: C,\n key: string,\n getElementCallback?: () => MapValueType[0]>\n ) {\n let details = this.batchUpdates[event];\n if(!details) {\n // @ts-ignore\n details = this.batchUpdates[event] = {\n callback,\n batch: new Map()\n };\n }\n\n if(!details.batch.has(key)) {\n // @ts-ignore\n details.batch.set(key, getElementCallback ? getElementCallback() : undefined);\n this.batchUpdatesDebounced();\n }\n }\n\n private getMessagesFromMap>(map: T) {\n const newMap: Map> = new Map();\n for(const [key, value] of map) {\n const [peerIdStr, mid] = key.split('_');\n const message = this.getMessageByPeer(peerIdStr.toPeerId(), +mid) as Message.message;\n if(!message) {\n continue;\n }\n\n newMap.set(message, value);\n }\n\n return newMap;\n }\n\n private batchUpdateViews = (batch: Map) => {\n const toDispatch: {peerId: PeerId, mid: number, views: number}[] = [];\n\n const map = this.getMessagesFromMap(batch);\n for(const [message] of map) {\n toDispatch.push({\n peerId: message.peerId,\n mid: message.mid,\n views: message.views\n })\n }\n\n return toDispatch;\n };\n\n private batchUpdateReactions = (batch: Map) => {\n const toDispatch: {message: Message.message, changedResults: ReactionCount.reactionCount[]}[] = [];\n\n const map = this.getMessagesFromMap(batch);\n for(const [message, previousReactions] of map) {\n const results = message.reactions?.results ?? [];\n const previousResults = previousReactions?.results ?? [];\n const changedResults = results.filter((reactionCount) => {\n const previousReactionCount = previousResults.find((_reactionCount) => reactionsEqual(_reactionCount.reaction, reactionCount.reaction));\n return (\n message.pFlags.out && (\n !previousReactionCount ||\n reactionCount.count > previousReactionCount.count\n )\n ) || (\n reactionCount.chosen_order !== undefined && (\n !previousReactionCount ||\n previousReactionCount.chosen_order === undefined\n )\n );\n });\n\n toDispatch.push({message, changedResults});\n }\n\n return toDispatch;\n };\n\n public saveDefaultSendAs(peerId: PeerId, sendAsPeerId: PeerId) {\n const channelFull = this.appProfileManager.getCachedFullChat(peerId.toChatId()) as ChatFull.channelFull;\n channelFull.default_send_as = this.appPeersManager.getOutputPeer(sendAsPeerId);\n return this.apiManager.invokeApi('messages.saveDefaultSendAs', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n send_as: this.appPeersManager.getInputPeerById(sendAsPeerId)\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {getFileNameByLocation} from '../../../../helpers/fileName';\nimport {Document} from '../../../../layer';\nimport getDocumentInputFileLocation from './getDocumentInputFileLocation';\n\nexport default function getDocumentInputFileName(doc: Document.document, thumbSize?: string) {\n return getFileNameByLocation(getDocumentInputFileLocation(doc, thumbSize), {fileName: doc.file_name});\n}\n","export default function convertInputKeyToKey(inputKey: string) {\n const str = inputKey.replace('input', '');\n return (str[0].toLowerCase() + str.slice(1)) as T;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport tsNow from '../../helpers/tsNow';\nimport {InputNotifyPeer, InputPeerNotifySettings, NotifyPeer, PeerNotifySettings, Update} from '../../layer';\nimport {MUTE_UNTIL} from '../mtproto/mtproto_config';\nimport throttle from '../../helpers/schedulers/throttle';\nimport convertInputKeyToKey from '../../helpers/string/convertInputKeyToKey';\nimport {AppManager} from './manager';\nimport ctx from '../../environment/ctx';\nimport assumeType from '../../helpers/assumeType';\nimport generateMessageId from './utils/messageId/generateMessageId';\n\ntype ImSadAboutIt = Promise | PeerNotifySettings;\ntype MyNotifyPeer = Exclude;\ntype MyInputNotifyPeer = Exclude;\nexport class AppNotificationsManager extends AppManager {\n private peerSettings = {\n notifyPeer: {} as {[peerId: string]: ImSadAboutIt},\n notifyUsers: null as ImSadAboutIt,\n notifyChats: null as ImSadAboutIt,\n notifyBroadcasts: null as ImSadAboutIt,\n notifyForumTopic: {} as {[peerId_threadId: string]: ImSadAboutIt}\n };\n // private exceptions: {[peerId: string]: PeerNotifySettings} = {};\n\n private getNotifyPeerTypePromise: Promise;\n\n private checkMuteUntilTimeout: number;\n private checkMuteUntilThrottled: () => void;\n\n private notifyContactsSignUp: Promise;\n\n protected after() {\n this.checkMuteUntilThrottled = throttle(this.checkMuteUntil, 1000, false);\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateNotifySettings: (update) => {\n const {peer} = update;\n const isTopic = peer._ === 'notifyForumTopic';\n const isPeerType = peer._ === 'notifyPeer' || isTopic;\n const peerId = isPeerType && this.appPeersManager.getPeerId(peer.peer);\n const key = !isPeerType ? peer._ : undefined;\n this.savePeerSettings({\n key,\n peerId,\n threadId: isTopic ? generateMessageId(peer.top_msg_id) : undefined,\n settings: update.notify_settings\n });\n this.rootScope.dispatchEvent('notify_settings', update);\n }\n });\n\n return this.appStateManager.getState().then((state) => {\n if(state.notifySettings) {\n for(const key in state.notifySettings) {\n assumeType(key);\n this.savePeerSettings({\n key,\n settings: state.notifySettings[key]\n });\n }\n }\n });\n }\n\n public getNotifySettings(peer: InputNotifyPeer): ImSadAboutIt {\n let key: any = convertInputKeyToKey(peer._);\n let obj: any = this.peerSettings[key as MyNotifyPeer];\n\n let peerId: PeerId;\n if(peer._ === 'inputNotifyPeer') {\n peerId = key = this.appPeersManager.getPeerId(peer.peer);\n obj = obj[key];\n }\n\n if(obj) {\n return obj;\n }\n\n return (obj || this.peerSettings)[key] = this.apiManager.invokeApi('account.getNotifySettings', {peer})\n .then((settings) => {\n this.savePeerSettings({\n key,\n peerId,\n settings\n });\n\n return settings;\n });\n }\n\n public getNotifyPeerTypeSettings() {\n if(this.getNotifyPeerTypePromise) return this.getNotifyPeerTypePromise;\n\n const promises = (['inputNotifyBroadcasts', 'inputNotifyUsers', 'inputNotifyChats'] as MyInputNotifyPeer[])\n .map((inputKey) => {\n return this.getNotifySettings({_: inputKey});\n });\n\n return this.getNotifyPeerTypePromise = Promise.all(promises);\n }\n\n public updateNotifySettings(peer: InputNotifyPeer, settings: InputPeerNotifySettings) {\n // this.savePeerSettings(peerId, settings);\n\n /* const inputSettings: InputPeerNotifySettings = copy(settings) as any;\n inputSettings._ = 'inputPeerNotifySettings'; */\n\n return this.apiManager.invokeApi('account.updateNotifySettings', {\n peer,\n settings\n }).then((value) => {\n if(value) {\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateNotifySettings',\n peer: {\n ...peer as any,\n _: convertInputKeyToKey(peer._)\n },\n notify_settings: { // ! WOW, IT WORKS !\n ...settings,\n _: 'peerNotifySettings'\n }\n });\n }\n });\n }\n\n // public getNotifyExceptions() {\n // apiManager.invokeApi('account.getNotifyExceptions', {compare_sound: true})\n // .then((updates) => {\n // apiUpdatesManager.processUpdateMessage(updates);\n // });\n // }\n\n public getContactSignUpNotification() {\n if(this.notifyContactsSignUp) return this.notifyContactsSignUp;\n return this.notifyContactsSignUp = this.apiManager.invokeApi('account.getContactSignUpNotification');\n }\n\n public setContactSignUpNotification(silent: boolean) {\n this.apiManager.invokeApi('account.setContactSignUpNotification', {silent})\n .then((value) => {\n this.notifyContactsSignUp = Promise.resolve(!silent);\n });\n }\n\n private checkMuteUntil = () => {\n if(this.checkMuteUntilTimeout !== undefined) {\n clearTimeout(this.checkMuteUntilTimeout);\n this.checkMuteUntilTimeout = undefined;\n }\n\n const timestamp = tsNow(true);\n let closestMuteUntil = MUTE_UNTIL;\n\n const p = (peerNotifySettings: ImSadAboutIt): peerNotifySettings is PeerNotifySettings => {\n if(peerNotifySettings instanceof Promise) {\n return false;\n }\n\n const muteUntil = peerNotifySettings.mute_until;\n if(!muteUntil) {\n return false;\n }\n\n if(muteUntil <= timestamp) {\n // ! do not delete it because peer's unique settings will be overwritten in getPeerLocalSettings with type's settings\n peerNotifySettings.mute_until = 0;\n return true;\n } else if(muteUntil < closestMuteUntil) {\n closestMuteUntil = muteUntil;\n }\n\n return false;\n };\n\n [\n 'notifyPeer' as const,\n 'notifyForumTopic' as const\n ].forEach((typeKey) => {\n for(const key in this.peerSettings[typeKey]) {\n const peerNotifySettings = this.peerSettings[typeKey][key];\n if(p(peerNotifySettings)) {\n const [peerId, topicId] = key.split('_');\n const peer = this.appPeersManager.getOutputPeer(peerId.toPeerId());\n this.apiUpdatesManager.saveUpdate({\n _: 'updateNotifySettings',\n peer: topicId ? {\n _: 'notifyForumTopic',\n peer,\n top_msg_id: +topicId\n } : {\n _: 'notifyPeer',\n peer\n },\n notify_settings: peerNotifySettings\n });\n }\n }\n });\n\n const timeout = Math.min(1800e3, (closestMuteUntil - timestamp) * 1000);\n this.checkMuteUntilTimeout = ctx.setTimeout(this.checkMuteUntil, timeout);\n };\n\n public getPeerKey(peerId: PeerId, threadId?: number) {\n return peerId + (threadId ? '_' + threadId : '');\n }\n\n public savePeerSettings({key, peerId, threadId, settings}: {\n key?: Exclude,\n peerId?: PeerId,\n threadId?: number,\n settings: PeerNotifySettings\n }) {\n let obj: any;\n if(peerId) {\n key = this.getPeerKey(peerId, threadId) as any;\n obj = this.peerSettings[threadId ? 'notifyForumTopic' : 'notifyPeer'];\n }\n\n (obj || this.peerSettings)[key] = settings;\n\n if(!peerId) {\n this.rootScope.dispatchEvent('notify_peer_type_settings', {key, settings});\n this.appStateManager.getState().then((state) => {\n const notifySettings = state.notifySettings;\n notifySettings[key] = settings;\n this.appStateManager.pushToState('notifySettings', notifySettings);\n });\n } else {\n this.checkMuteUntilThrottled();\n }\n\n // rootScope.broadcast('notify_settings', {peerId: peerId});\n }\n\n public isMuted(peerNotifySettings: PeerNotifySettings) {\n return peerNotifySettings._ === 'peerNotifySettings' &&\n (peerNotifySettings.silent || (peerNotifySettings.mute_until !== undefined && (peerNotifySettings.mute_until * 1000) > tsNow()));\n }\n\n private getPeerMuted(peerId: PeerId) {\n const ret = this.getNotifySettings({_: 'inputNotifyPeer', peer: this.appPeersManager.getInputPeerById(peerId)});\n return (ret instanceof Promise ? ret : Promise.resolve(ret))\n .then((peerNotifySettings) => this.isMuted(peerNotifySettings));\n }\n\n private getPeerLocalSettings({\n peerId,\n respectType = true,\n threadId\n }: {\n peerId: PeerId,\n respectType?: boolean,\n threadId?: number\n }): PeerNotifySettings {\n const n: PeerNotifySettings = {\n _: 'peerNotifySettings'\n };\n\n const peerKey = this.getPeerKey(peerId, threadId);\n const notifySettings = this.peerSettings[threadId ? 'notifyForumTopic' : 'notifyPeer'][peerKey];\n // if(!notifySettings || (notifySettings instanceof Promise)) return false;\n if(notifySettings && !(notifySettings instanceof Promise)) {\n Object.assign(n, notifySettings);\n }\n\n if(respectType) {\n const inputNotify = this.appPeersManager.getInputNotifyPeerById({peerId, ignorePeerId: true, threadId});\n const key = convertInputKeyToKey(inputNotify._);\n const typeNotifySettings = this.peerSettings[key as MyNotifyPeer];\n if(typeNotifySettings && !(typeNotifySettings instanceof Promise)) {\n for(const i in typeNotifySettings) {\n // @ts-ignore\n if(n[i] === undefined) {\n // @ts-ignore\n n[i] = typeNotifySettings[i];\n }\n }\n }\n }\n\n return n;\n }\n\n public validatePeerSettings[0]>(options: T): T {\n if(options.peerId === this.appPeersManager.peerId) return;\n if(options.threadId && !this.appPeersManager.isForum(options.peerId)) options.threadId = undefined;\n return options;\n }\n\n public isPeerLocalMuted(options: Parameters[0]): boolean {\n if(!(options = this.validatePeerSettings(options))) return false;\n\n if(options.threadId) {\n const notifySettings = this.getPeerLocalSettings({...options, respectType: false});\n if(notifySettings.silent !== undefined || notifySettings.mute_until !== undefined) {\n return this.isMuted(notifySettings);\n } else {\n return this.isPeerLocalMuted({...options, threadId: undefined});\n }\n }\n\n const notifySettings = this.getPeerLocalSettings(options);\n const isMuted = this.isMuted(notifySettings);\n return isMuted;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {Chat, ChatPhoto, DialogPeer, InputChannel, InputDialogPeer, InputNotifyPeer, InputPeer, Peer, Update, User, UserProfilePhoto} from '../../layer';\nimport type {LangPackKey} from '../langPack';\nimport {getRestrictionReason} from '../../helpers/restrictions';\nimport isObject from '../../helpers/object/isObject';\nimport {AppManager} from './manager';\nimport getPeerId from './utils/peers/getPeerId';\nimport isUser from './utils/peers/isUser';\nimport isAnyChat from './utils/peers/isAnyChat';\nimport {NULL_PEER_ID} from '../mtproto/mtproto_config';\nimport getPeerActiveUsernames from './utils/peers/getPeerActiveUsernames';\nimport isPeerRestricted from './utils/peers/isPeerRestricted';\nimport getPeerPhoto from './utils/peers/getPeerPhoto';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\n\nexport type PeerType = 'channel' | 'chat' | 'megagroup' | 'group' | 'saved';\nexport class AppPeersManager extends AppManager {\n public get peerId() {\n return this.appUsersManager.userId.toPeerId();\n }\n /* public savePeerInstance(peerId: PeerId, instance: any) {\n if(peerId < 0) appChatsManager.saveApiChat(instance);\n else appUsersManager.saveApiUser(instance);\n } */\n\n public canPinMessage(peerId: PeerId) {\n return peerId.isUser() || this.appChatsManager.hasRights(peerId.toChatId(), 'pin_messages');\n }\n\n public getPeerPhoto(peerId: PeerId) {\n const peer = this.getPeer(peerId) as User.user | Chat.channel;\n return getPeerPhoto(peer);\n }\n\n public getPeerMigratedTo(peerId: PeerId) {\n if(peerId.isUser()) {\n return false;\n }\n\n const chat = this.appChatsManager.getChat(peerId.toChatId()) as Chat.chat;\n const migratedTo = chat?.migrated_to;\n if(migratedTo && chat.pFlags.deactivated) {\n return getPeerId(migratedTo);\n }\n\n return false;\n }\n\n public getOutputPeer(peerId: PeerId): Peer {\n if(peerId.isUser()) {\n return {_: 'peerUser', user_id: peerId.toUserId()};\n }\n\n const chatId = peerId.toChatId();\n if(this.appChatsManager.isChannel(chatId)) {\n return {_: 'peerChannel', channel_id: chatId};\n }\n\n return {_: 'peerChat', chat_id: chatId};\n }\n\n public getPeerString(peerId: PeerId) {\n if(peerId.isUser()) {\n return this.appUsersManager.getUserString(peerId.toUserId());\n }\n return this.appChatsManager.getChatString(peerId.toChatId());\n }\n\n public getPeerUsername(peerId: PeerId) {\n return this.getPeerActiveUsernames(peerId)[0] || '';\n }\n\n public getPeerActiveUsernames(peerId: PeerId) {\n const peer = this.getPeer(peerId);\n return getPeerActiveUsernames(peer);\n }\n\n public getPeer(peerId: PeerId) {\n return peerId.isUser() ?\n this.appUsersManager.getUser(peerId.toUserId()) :\n this.appChatsManager.getChat(peerId.toChatId());\n }\n\n public getPeerId(peerId: Parameters[0]) {\n return getPeerId(peerId) || (isObject(peerId) && peerId._ === 'inputPeerSelf' && this.peerId) || NULL_PEER_ID;\n }\n\n public getDialogPeer(peerId: PeerId): DialogPeer {\n return {\n _: 'dialogPeer',\n peer: this.getOutputPeer(peerId)\n };\n }\n\n public isChannel(peerId: PeerId): boolean {\n return !peerId.isUser() && this.appChatsManager.isChannel(peerId.toChatId());\n }\n\n public isMegagroup(peerId: PeerId) {\n return !peerId.isUser() && this.appChatsManager.isMegagroup(peerId.toChatId());\n }\n\n public isForum(peerId: PeerId) {\n return !peerId.isUser() && this.appChatsManager.isForum(peerId.toChatId());\n }\n\n public isAnyGroup(peerId: PeerId): boolean {\n return !peerId.isUser() && !this.appChatsManager.isBroadcast(peerId.toChatId());\n }\n\n public isBroadcast(peerId: PeerId): boolean {\n return this.isChannel(peerId) && !this.isMegagroup(peerId);\n }\n\n public isBot(peerId: PeerId): boolean {\n return peerId.isUser() && this.appUsersManager.isBot(peerId.toUserId());\n }\n\n public isContact(peerId: PeerId): boolean {\n return peerId.isUser() && this.appUsersManager.isContact(peerId.toUserId());\n }\n\n public isUser(peerId: PeerId)/* : peerId is UserId */ {\n return isUser(peerId);\n }\n\n public isAnyChat(peerId: PeerId) {\n return isAnyChat(peerId);\n }\n\n public isPeerRestricted(peerId: PeerId) {\n return isPeerRestricted(this.getPeer(peerId));\n }\n\n public getRestrictionReasonText(peerId: PeerId) {\n const peer = this.getPeer(peerId) as Chat.channel | User.user;\n const reason = peer.restriction_reason ? getRestrictionReason(peer.restriction_reason) : undefined;\n if(reason) {\n return reason.text;\n } else {\n return peerId.isUser() ? 'This user is restricted' : 'This chat is restricted';\n }\n }\n\n /* public getInputPeer(peerString: string): InputPeer {\n var firstChar = peerString.charAt(0);\n var peerParams = peerString.substr(1).split('_');\n let id = +peerParams[0];\n\n if(firstChar === 'u') {\n //appUsersManager.saveUserAccess(id, peerParams[1]);\n\n return {\n _: 'inputPeerUser',\n user_id: id,\n access_hash: peerParams[1]\n };\n } else if(firstChar === 'c' || firstChar === 's') {\n //appChatsManager.saveChannelAccess(id, peerParams[1]);\n if(firstChar === 's') {\n appChatsManager.saveIsMegagroup(id);\n }\n\n return {\n _: 'inputPeerChannel',\n channel_id: id,\n access_hash: peerParams[1] || '0'\n };\n } else {\n return {\n _: 'inputPeerChat',\n chat_id: id\n };\n }\n } */\n\n // public getInputNotifyPeerById(peerId: PeerId, ignorePeerId: true): Exclude;\n // public getInputNotifyPeerById(peerId: PeerId, ignorePeerId?: false): InputNotifyPeer.inputNotifyPeer;\n // public getInputNotifyPeerById(peerId: PeerId, ignorePeerId?: boolean): InputNotifyPeer {\n public getInputNotifyPeerById({\n peerId,\n ignorePeerId,\n threadId\n }: T): T['ignorePeerId'] extends true ? Exclude : (T['threadId'] extends number ? InputNotifyPeer.inputNotifyForumTopic : InputNotifyPeer.inputNotifyPeer) {\n if(ignorePeerId) {\n if(peerId.isUser()) {\n return {_: 'inputNotifyUsers'} as any;\n } else {\n if(this.isBroadcast(peerId)) {\n return {_: 'inputNotifyBroadcasts'} as any;\n } else {\n return {_: 'inputNotifyChats'} as any;\n }\n }\n } else if(threadId) {\n return {\n _: 'inputNotifyForumTopic',\n peer: this.getInputPeerById(peerId),\n top_msg_id: getServerMessageId(threadId)\n } as any;\n } else {\n return {\n _: 'inputNotifyPeer',\n peer: this.getInputPeerById(peerId)\n } as any;\n }\n }\n\n public getInputPeerById(peerId: PeerId): InputPeer {\n if(!peerId) {\n return {_: 'inputPeerEmpty'};\n }\n\n if(!peerId.isUser()) {\n const chatId = peerId.toChatId();\n return this.appChatsManager.getInputPeer(chatId);\n }\n\n const userId = peerId.toUserId();\n return this.appUsersManager.getUserInputPeer(userId);\n }\n\n /**\n * ! use it only in safe places like requests\n */\n public getInputPeerSelf(): InputPeer.inputPeerSelf {\n return {_: 'inputPeerSelf'};\n }\n\n public getInputDialogPeerById(peerId: PeerId | InputPeer): InputDialogPeer {\n return {\n _: 'inputDialogPeer',\n peer: isObject(peerId) ? peerId : this.getInputPeerById(peerId)\n };\n }\n\n public getPeerSearchText(peerId: PeerId) {\n let text: string;\n if(this.isUser(peerId)) {\n text = '%pu ' + this.appUsersManager.getUserSearchText(peerId.toUserId());\n } else {\n const chat = this.appChatsManager.getChat(peerId.toChatId());\n text = '%pg ' + (chat.title || '');\n }\n\n return text;\n }\n\n public getDialogType(peerId: PeerId): PeerType {\n if(this.isMegagroup(peerId)) {\n return 'megagroup';\n } else if(this.isChannel(peerId)) {\n return 'channel';\n } else if(!this.isUser(peerId)) {\n return 'group';\n } else {\n return peerId === this.peerId ? 'saved' : 'chat';\n }\n }\n\n public getDeleteButtonText(peerId: PeerId): Extract {\n switch(this.getDialogType(peerId)) {\n case 'channel':\n return this.appChatsManager.hasRights(peerId.toChatId(), 'delete_chat') ? 'ChannelDelete' : 'ChatList.Context.LeaveChannel';\n\n case 'megagroup':\n case 'group':\n return this.appChatsManager.hasRights(peerId.toChatId(), 'delete_chat') ? 'DeleteMega' : 'ChatList.Context.LeaveGroup';\n\n default:\n return 'ChatList.Context.DeleteChat';\n }\n }\n\n public noForwards(peerId: PeerId) {\n if(peerId.isUser()) return false;\n else {\n const chat = this.appChatsManager.getChat(peerId.toChatId());\n return !!(chat as Chat.chat).pFlags?.noforwards;\n }\n }\n}\n\nexport type IsPeerType = 'isChannel' | 'isMegagroup' | 'isAnyGroup' | 'isBroadcast' | 'isBot' | 'isContact' | 'isUser' | 'isAnyChat';\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {Photo, PhotoSize, PhotosPhotos} from '../../layer';\nimport {ReferenceContext} from '../mtproto/referenceDatabase';\nimport isObject from '../../helpers/object/isObject';\nimport safeReplaceArrayInObject from '../../helpers/object/safeReplaceArrayInObject';\nimport {AppManager} from './manager';\n\nexport type MyPhoto = Photo.photo;\n\n// TIMES = 2 DUE TO SIDEBAR AND CHAT\n// let TEST_FILE_REFERENCE = \"5440692274120994569\", TEST_FILE_REFERENCE_TIMES = 2;\n\nexport class AppPhotosManager extends AppManager {\n private photos: {\n [id: string]: MyPhoto\n } = {};\n\n public savePhoto(photo: Photo, context?: ReferenceContext) {\n if(!photo || photo._ === 'photoEmpty') return;\n\n /* if(photo.id === TEST_FILE_REFERENCE) {\n console.warn('Testing FILE_REFERENCE_EXPIRED');\n const bytes = [2, 67, 175, 43, 190, 0, 0, 20, 62, 95, 111, 33, 45, 99, 220, 116, 218, 11, 167, 127, 213, 18, 127, 32, 243, 202, 117, 80, 30];\n //photo.file_reference = new Uint8Array(bytes);\n photo.file_reference = bytes;\n if(!--TEST_FILE_REFERENCE_TIMES) {\n TEST_FILE_REFERENCE = '';\n }\n } */\n\n const oldPhoto = this.photos[photo.id];\n if(photo.file_reference) { // * because we can have a new object w/o the file_reference while sending\n safeReplaceArrayInObject('file_reference', oldPhoto, photo);\n this.referenceDatabase.saveContext(photo.file_reference, context);\n }\n\n if(photo.sizes?.length) {\n // * sometimes photoStrippedSize can be the last item\n photo.sizes.sort((a, b) => {\n return ((a as PhotoSize.photoSize).size || ((a as PhotoSize.photoSizeProgressive).sizes ? Infinity : 0)) - ((b as PhotoSize.photoSize).size || ((b as PhotoSize.photoSizeProgressive).sizes ? Infinity : 0));\n });\n\n const size = photo.sizes[photo.sizes.length - 1];\n if(size._ === 'photoSizeProgressive') {\n size.size = size.sizes[size.sizes.length - 1];\n }\n }\n\n if(oldPhoto) {\n return Object.assign(oldPhoto, photo);\n }\n\n return this.photos[photo.id] = photo;\n }\n\n public getUserPhotos(userId: UserId, maxId: Photo.photo['id'] = '0', limit: number = 20) {\n const inputUser = this.appUsersManager.getUserInput(userId);\n return this.apiManager.invokeApiCacheable('photos.getUserPhotos', {\n user_id: inputUser,\n offset: 0,\n limit,\n max_id: maxId\n }, {cacheSeconds: 60}).then((photosResult) => {\n this.appUsersManager.saveApiUsers(photosResult.users);\n const photoIds = photosResult.photos.map((photo, idx) => {\n photosResult.photos[idx] = this.savePhoto(photo, {type: 'profilePhoto', peerId: userId.toPeerId()});\n return photo.id;\n });\n\n // ! WARNING !\n if(maxId !== '0' && maxId) {\n const idx = photoIds.indexOf(maxId);\n if(idx !== -1) {\n photoIds.splice(idx, 1);\n }\n }\n\n return {\n count: (photosResult as PhotosPhotos.photosPhotosSlice).count || photoIds.length,\n photos: photoIds\n };\n });\n }\n\n /* public getPhotoURL(photo: MTPhoto | MTMyDocument, photoSize: MTPhotoSize) {\n const downloadOptions = this.getPhotoDownloadOptions(photo, photoSize);\n\n return {url: getFileURL('photo', downloadOptions), location: downloadOptions.location};\n } */\n\n /* public isDownloaded(media: any) {\n const isPhoto = media._ === 'photo';\n const photo = isPhoto ? this.getPhoto(media.id) : null;\n let isDownloaded: boolean;\n if(photo) {\n isDownloaded = photo.downloaded > 0;\n } else {\n const cachedThumb = this.getDocumentCachedThumb(media.id);\n isDownloaded = cachedThumb?.downloaded > 0;\n }\n\n return isDownloaded;\n } */\n\n public getPhoto(photoId: any/* MyPhoto | string */): MyPhoto {\n return isObject(photoId) ? photoId as MyPhoto : this.photos[photoId as any as string];\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport copy from '../../helpers/object/copy';\nimport {InputMedia, Message, MessageEntity, MessageMedia, Poll, PollResults} from '../../layer';\nimport {logger, LogTypes} from '../logger';\nimport parseMarkdown from '../richTextProcessor/parseMarkdown';\nimport {AppManager} from './manager';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\n\ntype PollId = Poll['id'];\n\nexport class AppPollsManager extends AppManager {\n public polls: {[id: PollId]: Poll} = {};\n public results: {[id: PollId]: PollResults} = {};\n public pollToMessages: {[id: PollId]: Set} = {};\n\n private log = logger('POLLS', LogTypes.Error);\n\n protected after() {\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateMessagePoll: (update) => {\n this.log('updateMessagePoll:', update);\n\n let poll: Poll = update.poll || this.polls[update.poll_id];\n if(!poll) {\n return;\n }\n\n let results = update.results;\n const ret = this.savePoll(poll, results as any);\n poll = ret.poll;\n results = ret.results;\n\n this.rootScope.dispatchEvent('poll_update', {poll, results: results as any});\n }\n });\n }\n\n public savePoll(poll: Poll, results: PollResults, message?: Message.message) {\n if(message) {\n this.updatePollToMessage(message, true);\n }\n\n const id = poll.id;\n if(this.polls[id]) {\n poll = Object.assign(this.polls[id], poll);\n results = this.saveResults(poll, results);\n } else {\n this.polls[id] = poll;\n\n poll.chosenIndexes = [];\n results = this.saveResults(poll, results);\n }\n\n return {poll, results};\n }\n\n public saveResults(poll: Poll, results: PollResults) {\n if(this.results[poll.id]) {\n results = Object.assign(this.results[poll.id], results);\n } else {\n this.results[poll.id] = results;\n }\n\n if(!results.pFlags.min) { // ! https://core.telegram.org/constructor/pollResults - min\n poll.chosenIndexes.length = 0;\n if(results?.results?.length) {\n results.results.forEach((answer, idx) => {\n if(answer.pFlags?.chosen) {\n poll.chosenIndexes.push(idx);\n }\n });\n }\n }\n\n return results;\n }\n\n public getPoll(pollId: PollId): {poll: Poll, results: PollResults} {\n return {\n poll: this.polls[pollId],\n results: this.results[pollId]\n };\n }\n\n public getInputMediaPoll(poll: Poll, correctAnswers?: Uint8Array[], solution?: string, solutionEntities?: MessageEntity[]): InputMedia.inputMediaPoll {\n if(solution) {\n if(!solutionEntities) {\n solutionEntities = [];\n }\n\n solution = parseMarkdown(solution, solutionEntities);\n } else {\n solution = undefined; // can be string here\n }\n\n return {\n _: 'inputMediaPoll',\n poll,\n correct_answers: correctAnswers,\n solution,\n solution_entities: solution ? solutionEntities : undefined\n };\n }\n\n public updatePollToMessage(message: Message.message, add: boolean) {\n const {id} = (message.media as MessageMedia.messageMediaPoll).poll;\n let set = this.pollToMessages[id];\n\n if(!add && !set) {\n return;\n }\n\n if(!set) {\n set = this.pollToMessages[id] = new Set();\n }\n\n const key = message.peerId + '_' + message.mid;\n if(add) set.add(key);\n else set.delete(key);\n\n if(!add && !set.size) {\n delete this.polls[id];\n delete this.results[id];\n delete this.pollToMessages[id];\n }\n }\n\n public sendVote(message: Message.message, optionIds: number[]): Promise {\n const poll: Poll = (message.media as MessageMedia.messageMediaPoll).poll;\n\n const options: Uint8Array[] = optionIds.map((index) => {\n return poll.answers[index].option;\n });\n\n const messageId = message.mid;\n const peerId = message.peerId;\n const inputPeer = this.appPeersManager.getInputPeerById(peerId);\n\n if(message.pFlags.is_outgoing) {\n return this.appMessagesManager.invokeAfterMessageIsSent(messageId, 'sendVote', (message) => {\n this.log('invoke sendVote callback');\n return this.sendVote(message as Message.message, optionIds);\n });\n }\n\n return this.apiManager.invokeApi('messages.sendVote', {\n peer: inputPeer,\n msg_id: getServerMessageId(message.mid),\n options\n }).then((updates) => {\n this.log('sendVote updates:', updates);\n this.apiUpdatesManager.processUpdateMessage(updates);\n });\n }\n\n public getResults(message: Message.message) {\n const inputPeer = this.appPeersManager.getInputPeerById(message.peerId);\n\n return this.apiManager.invokeApi('messages.getPollResults', {\n peer: inputPeer,\n msg_id: getServerMessageId(message.mid)\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n this.log('getResults updates:', updates);\n });\n }\n\n public getVotes(message: Message.message, option?: Uint8Array, offset?: string, limit = 20) {\n return this.apiManager.invokeApi('messages.getPollVotes', {\n peer: this.appPeersManager.getInputPeerById(message.peerId),\n id: getServerMessageId(message.mid),\n option,\n offset,\n limit\n }).then((votesList) => {\n this.log('getPollVotes messages:', votesList);\n\n this.appUsersManager.saveApiUsers(votesList.users);\n\n return votesList;\n });\n }\n\n public stopPoll(message: Message.message) {\n const poll: Poll = (message.media as MessageMedia.messageMediaPoll).poll;\n\n if(poll.pFlags.closed) return Promise.resolve();\n\n const newPoll = copy(poll);\n newPoll.pFlags.closed = true;\n return this.appMessagesManager.editMessage(message, undefined, {\n newMedia: this.getInputMediaPoll(newPoll)\n }).then(() => {\n // console.log('stopped poll');\n }, err => {\n this.log.error('stopPoll error:', err);\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {InputPrivacyKey, InputPrivacyRule, PrivacyRule, PrivacyKey, GlobalPrivacySettings} from '../../layer';\nimport convertInputKeyToKey from '../../helpers/string/convertInputKeyToKey';\nimport {AppManager} from './manager';\n\nexport class AppPrivacyManager extends AppManager {\n private privacy: Partial<{\n [key in PrivacyKey['_']]: PrivacyRule[] | Promise\n }> = {};\n\n protected after() {\n this.apiUpdatesManager.addMultipleEventsListeners({\n updatePrivacy: (update) => {\n const key = update.key._;\n this.privacy[key] = update.rules;\n this.rootScope.dispatchEvent('privacy_update', update);\n }\n });\n }\n\n public setPrivacy(inputKey: InputPrivacyKey['_'], rules: InputPrivacyRule[]) {\n return this.apiManager.invokeApi('account.setPrivacy', {\n key: {\n _: inputKey\n },\n rules\n }).then((privacyRules) => {\n this.appUsersManager.saveApiUsers(privacyRules.users);\n this.appChatsManager.saveApiChats(privacyRules.chats);\n\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updatePrivacy',\n key: {\n _: convertInputKeyToKey(inputKey)\n },\n rules: rules.map((inputRule) => {\n const rule: PrivacyRule = {} as any;\n Object.assign(rule, inputRule);\n rule._ = convertInputKeyToKey(rule._) as any;\n return rule;\n })\n });\n\n // console.log('privacy rules', inputKey, privacyRules, privacyRules.rules);\n\n return privacyRules.rules;\n });\n }\n\n public getPrivacy(inputKey: InputPrivacyKey['_']) {\n const privacyKey: PrivacyKey['_'] = convertInputKeyToKey(inputKey) as any;\n const rules = this.privacy[privacyKey];\n if(rules) {\n return Promise.resolve(rules);\n }\n\n return this.privacy[privacyKey] = this.apiManager.invokeApi('account.getPrivacy', {\n key: {\n _: inputKey\n }\n }).then((privacyRules) => {\n this.appUsersManager.saveApiUsers(privacyRules.users);\n this.appChatsManager.saveApiChats(privacyRules.chats);\n\n // console.log('privacy rules', inputKey, privacyRules, privacyRules.rules);\n\n return this.privacy[privacyKey] = privacyRules.rules;\n });\n }\n\n public getGlobalPrivacySettings() {\n return this.apiManager.invokeApi('account.getGlobalPrivacySettings');\n }\n\n public setGlobalPrivacySettings(settings: GlobalPrivacySettings) {\n return this.apiManager.invokeApi('account.setGlobalPrivacySettings', {settings});\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {MyTopPeer} from './appUsersManager';\nimport tsNow from '../../helpers/tsNow';\nimport {ChannelParticipantsFilter, ChannelsChannelParticipants, ChannelParticipant, Chat, ChatFull, ChatParticipants, ChatPhoto, ExportedChatInvite, InputChannel, InputFile, SendMessageAction, Update, UserFull, Photo, PhotoSize, Updates} from '../../layer';\nimport SearchIndex from '../searchIndex';\nimport {AppManager} from './manager';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\nimport getPhotoInput from './utils/photos/getPhotoInput';\nimport getParticipantPeerId from './utils/chats/getParticipantPeerId';\nimport ctx from '../../environment/ctx';\nimport {ReferenceContext} from '../mtproto/referenceDatabase';\nimport generateMessageId from './utils/messageId/generateMessageId';\nimport assumeType from '../../helpers/assumeType';\nimport makeError from '../../helpers/makeError';\n\nexport type UserTyping = Partial<{userId: UserId, action: SendMessageAction, timeout: number}>;\n\nconst PEER_FULL_TTL = 3 * 60e3;\n\nexport class AppProfileManager extends AppManager {\n // private botInfos: any = {};\n private usersFull: {[id: UserId]: UserFull.userFull} = {};\n private chatsFull: {[id: ChatId]: ChatFull} = {};\n private fullExpiration: {[peerId: PeerId]: number} = {};\n private typingsInPeer: {[key: string]: UserTyping[]};\n\n protected after() {\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateChatParticipants: this.onUpdateChatParticipants,\n\n updateChatParticipantAdd: this.onUpdateChatParticipantAdd,\n\n updateChatParticipantDelete: this.onUpdateChatParticipantDelete,\n\n updateUserTyping: this.onUpdateUserTyping,\n updateChatUserTyping: this.onUpdateUserTyping,\n updateChannelUserTyping: this.onUpdateUserTyping,\n\n updatePeerBlocked: this.onUpdatePeerBlocked\n });\n\n this.rootScope.addEventListener('chat_update', (chatId) => {\n const fullChat = this.chatsFull[chatId];\n const chat: Chat.chat | Chat.channel | Chat.chatForbidden | Chat.channelForbidden = this.appChatsManager.getChat(chatId);\n if(!fullChat || !chat) {\n return;\n }\n\n let updated = false;\n if(!!fullChat.call !== !!(chat as Chat.chat).pFlags?.call_active) {\n updated = true;\n }\n\n const {photo} = chat as Chat.chat;\n if(photo) {\n const hasChatPhoto = photo._ !== 'chatPhotoEmpty';\n const hasFullChatPhoto = !!(fullChat.chat_photo && fullChat.chat_photo._ !== 'photoEmpty'); // chat_photo can be missing\n if(\n hasChatPhoto !== hasFullChatPhoto || (\n hasChatPhoto &&\n photo.photo_id !== fullChat.chat_photo?.id\n )\n ) {\n updated = true;\n }\n }\n\n if(updated) {\n this.refreshFullPeer(chatId.toPeerId(true));\n }\n });\n\n this.rootScope.addEventListener('channel_update', (chatId) => {\n this.refreshFullPeer(chatId.toPeerId(true));\n });\n\n // * genius\n this.rootScope.addEventListener('chat_full_update', (chatId) => {\n this.rootScope.dispatchEvent('peer_full_update', chatId.toPeerId(true));\n });\n\n // * genius\n this.rootScope.addEventListener('user_full_update', (userId) => {\n this.rootScope.dispatchEvent('peer_full_update', userId.toPeerId(false));\n });\n\n this.rootScope.addEventListener('invalidate_participants', (chatId) => {\n this.invalidateChannelParticipants(chatId);\n });\n\n this.typingsInPeer = {};\n }\n\n /* public saveBotInfo(botInfo: any) {\n const botId = botInfo && botInfo.user_id;\n if(!botId) {\n return null;\n }\n\n const commands: any = {};\n botInfo.commands.forEach((botCommand: any) => {\n commands[botCommand.command] = botCommand.description;\n });\n\n return this.botInfos[botId] = {\n id: botId,\n version: botInfo.version,\n shareText: botInfo.share_text,\n description: botInfo.description,\n commands: commands\n };\n } */\n\n public getProfile(id: UserId, override?: true) {\n if(this.usersFull[id] && !override && Date.now() < this.fullExpiration[id.toPeerId()]) {\n return this.usersFull[id];\n }\n\n return this.apiManager.invokeApiSingleProcess({\n method: 'users.getFullUser',\n params: {\n id: this.appUsersManager.getUserInput(id)\n },\n processResult: (usersUserFull) => {\n this.appChatsManager.saveApiChats(usersUserFull.chats, true);\n this.appUsersManager.saveApiUsers(usersUserFull.users);\n\n const userFull = usersUserFull.full_user;\n const peerId = id.toPeerId(false);\n if(userFull.profile_photo) {\n userFull.profile_photo = this.appPhotosManager.savePhoto(userFull.profile_photo, {type: 'profilePhoto', peerId});\n }\n\n const botInfo = userFull.bot_info;\n if(botInfo) {\n const referenceContext: ReferenceContext = {type: 'userFull', userId: id};\n botInfo.description_document = this.appDocsManager.saveDoc(botInfo.description_document, referenceContext);\n botInfo.description_photo = this.appPhotosManager.savePhoto(botInfo.description_photo, referenceContext);\n }\n\n this.appNotificationsManager.savePeerSettings({\n peerId,\n settings: userFull.notify_settings\n });\n\n this.usersFull[id] = userFull;\n this.fullExpiration[peerId] = Date.now() + PEER_FULL_TTL;\n\n /* if(userFull.bot_info) {\n userFull.bot_info = this.saveBotInfo(userFull.bot_info) as any;\n } */\n\n // appMessagesManager.savePinnedMessage(id, userFull.pinned_msg_id);\n\n this.rootScope.dispatchEvent('user_full_update', id);\n return userFull;\n }\n });\n }\n\n public getProfileByPeerId(peerId: PeerId, override?: true) {\n if(this.appPeersManager.isAnyChat(peerId)) return this.getChatFull(peerId.toChatId(), override);\n else return this.getProfile(peerId.toUserId(), override);\n }\n\n public getCachedFullChat(chatId: ChatId) {\n return this.chatsFull[chatId];\n }\n\n public getCachedFullUser(userId: UserId) {\n return this.usersFull[userId];\n }\n\n public getCachedProfileByPeerId(peerId: PeerId) {\n return peerId.isUser() ? this.getCachedFullUser(peerId.toUserId()) : this.getCachedFullChat(peerId.toChatId());\n }\n\n public async getFullPhoto(peerId: PeerId) {\n const profile = await this.getProfileByPeerId(peerId);\n switch(profile._) {\n case 'userFull':\n return profile.profile_photo;\n case 'channelFull':\n case 'chatFull':\n return profile.chat_photo;\n }\n }\n\n /* public getPeerBots(peerId: PeerId) {\n var peerBots: any[] = [];\n if(peerId >= 0 && !appUsersManager.isBot(peerId) ||\n (appPeersManager.isChannel(peerId) && !appPeersManager.isMegagroup(peerId))) {\n return Promise.resolve(peerBots);\n }\n if(peerId >= 0) {\n return this.getProfile(peerId).then((userFull: any) => {\n var botInfo = userFull.bot_info;\n if(botInfo && botInfo._ !== 'botInfoEmpty') {\n peerBots.push(botInfo);\n }\n return peerBots;\n });\n }\n\n return this.getChatFull(peerId.toChatId()).then((chatFull: any) => {\n chatFull.bot_info.forEach((botInfo: any) => {\n peerBots.push(this.saveBotInfo(botInfo))\n });\n return peerBots;\n });\n } */\n\n public getChatFull(id: ChatId, override?: true) {\n if(this.appChatsManager.isChannel(id)) {\n return this.getChannelFull(id, override);\n }\n\n const peerId = id.toPeerId(true);\n const fullChat = this.chatsFull[id] as ChatFull.chatFull;\n if(fullChat && !override && Date.now() < this.fullExpiration[peerId]) {\n const chat = this.appChatsManager.getChat(id) as Chat.chat;\n if(\n chat.pFlags.left ||\n chat.pFlags.deactivated ||\n chat.version === (fullChat.participants as ChatParticipants.chatParticipants).version\n ) {\n return fullChat as ChatFull;\n }\n }\n\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.getFullChat',\n params: {\n chat_id: id\n },\n processResult: (result) => {\n this.appChatsManager.saveApiChats(result.chats, true);\n this.appUsersManager.saveApiUsers(result.users);\n const chatFull = result.full_chat as ChatFull.chatFull;\n if(chatFull && chatFull.chat_photo && chatFull.chat_photo.id) {\n chatFull.chat_photo = this.appPhotosManager.savePhoto(chatFull.chat_photo, {type: 'profilePhoto', peerId});\n }\n\n if(chatFull.call) {\n this.appGroupCallsManager.saveGroupCall(chatFull.call, id);\n }\n\n // appMessagesManager.savePinnedMessage(peerId, fullChat.pinned_msg_id);\n this.appNotificationsManager.savePeerSettings({\n peerId,\n settings: chatFull.notify_settings\n });\n\n this.chatsFull[id] = chatFull;\n this.fullExpiration[peerId] = Date.now() + PEER_FULL_TTL;\n this.rootScope.dispatchEvent('chat_full_update', id);\n\n return chatFull;\n }\n });\n }\n\n public async getChatInviteLink(id: ChatId, force?: boolean) {\n const chatFull = await this.getChatFull(id);\n if(!force &&\n chatFull.exported_invite &&\n chatFull.exported_invite._ == 'chatInviteExported') {\n return chatFull.exported_invite.link;\n }\n\n return this.apiManager.invokeApi('messages.exportChatInvite', {\n peer: this.appPeersManager.getInputPeerById(id.toPeerId(true))\n }).then((exportedInvite) => {\n if(this.chatsFull[id] !== undefined) {\n this.chatsFull[id].exported_invite = exportedInvite;\n }\n\n return (exportedInvite as ExportedChatInvite.chatInviteExported).link;\n });\n }\n\n public getParticipants(\n id: ChatId,\n filter: ChannelParticipantsFilter = {_: 'channelParticipantsRecent'},\n limit = 200,\n offset = 0\n ) {\n if(this.appChatsManager.isChannel(id)) {\n return this.getChannelParticipants(id, filter, limit, offset);\n }\n\n return Promise.resolve(this.getChatFull(id)).then((chatFull) => {\n const chatParticipants = (chatFull as ChatFull.chatFull).participants;\n if(chatParticipants._ !== 'chatParticipants') {\n throw makeError('CHAT_PRIVATE');\n }\n\n if(filter._ === 'channelParticipantsSearch' && filter.q.trim()) {\n const index = this.appUsersManager.createSearchIndex();\n chatParticipants.participants.forEach((chatParticipant) => {\n const userId = chatParticipant.user_id;\n index.indexObject(userId, this.appUsersManager.getUserSearchText(userId));\n });\n\n const found = index.search(filter.q);\n const filteredParticipants = chatParticipants.participants.filter((chatParticipant) => {\n return found.has(chatParticipant.user_id);\n });\n\n return {...chatParticipants, participants: filteredParticipants};\n }\n\n return chatParticipants;\n });\n }\n\n public getParticipant(id: ChatId, peerId: PeerId) {\n if(this.appChatsManager.isChannel(id)) {\n return this.getChannelParticipant(id, peerId);\n }\n\n return this.getParticipants(id).then((chatParticipants) => {\n assumeType(chatParticipants);\n const found = chatParticipants.participants.find((chatParticipant) => {\n if(getParticipantPeerId(chatParticipant) === peerId) {\n return chatParticipant;\n }\n });\n\n if(!found) {\n throw makeError('USER_NOT_PARTICIPANT');\n }\n\n return found;\n });\n }\n\n public getChannelParticipants(\n id: ChatId,\n filter: ChannelParticipantsFilter = {_: 'channelParticipantsRecent'},\n limit = 200,\n offset = 0\n ) {\n if(filter._ === 'channelParticipantsRecent') {\n const chat = this.appChatsManager.getChat(id);\n if(chat?.pFlags && (\n // chat.pFlags.kicked ||\n (chat as Chat.channel).pFlags.broadcast &&\n !(chat as Chat.channel).pFlags.creator &&\n !(chat as Chat.channel).admin_rights\n )) {\n return Promise.reject();\n }\n }\n\n return this.apiManager.invokeApiCacheable('channels.getParticipants', {\n channel: this.appChatsManager.getChannelInput(id),\n filter,\n offset,\n limit,\n hash: '0'\n }, {cacheSeconds: 60}).then((result) => {\n this.appUsersManager.saveApiUsers((result as ChannelsChannelParticipants.channelsChannelParticipants).users);\n return result as ChannelsChannelParticipants.channelsChannelParticipants;\n });\n /* let maybeAddSelf = (participants: any[]) => {\n let chat = appChatsManager.getChat(id);\n let selfMustBeFirst = filter._ === 'channelParticipantsRecent' &&\n !offset &&\n !chat.pFlags.kicked &&\n !chat.pFlags.left;\n\n if(selfMustBeFirst) {\n participants = copy(participants);\n let myID = appUsersManager.getSelf().id;\n let myIndex = participants.findIndex((p) => p.user_id === myID);\n let myParticipant;\n\n if(myIndex !== -1) {\n myParticipant = participants[myIndex];\n participants.splice(myIndex, 1);\n } else {\n myParticipant = {_: 'channelParticipantSelf', user_id: myID};\n }\n\n participants.unshift(myParticipant);\n }\n\n return participants;\n } */\n }\n\n public getChannelParticipant(id: ChatId, peerId: PeerId) {\n return this.apiManager.invokeApiSingle('channels.getParticipant', {\n channel: this.appChatsManager.getChannelInput(id),\n participant: this.appPeersManager.getInputPeerById(peerId)\n }).then((channelParticipant) => {\n this.appUsersManager.saveApiUsers(channelParticipant.users);\n return channelParticipant.participant;\n });\n }\n\n public getChannelFull(id: ChatId, override?: true) {\n const peerId = id.toPeerId(true);\n if(this.chatsFull[id] !== undefined && !override && Date.now() < this.fullExpiration[peerId]) {\n return this.chatsFull[id] as ChatFull.channelFull;\n }\n\n return this.apiManager.invokeApiSingleProcess({\n method: 'channels.getFullChannel',\n params: {\n channel: this.appChatsManager.getChannelInput(id)\n },\n processResult: (result) => {\n this.appChatsManager.saveApiChats(result.chats, true);\n this.appUsersManager.saveApiUsers(result.users);\n const fullChannel = result.full_chat as ChatFull.channelFull;\n if(fullChannel && fullChannel.chat_photo.id) {\n fullChannel.chat_photo = this.appPhotosManager.savePhoto(fullChannel.chat_photo, {type: 'profilePhoto', peerId});\n // appPhotosManager.savePhoto(fullChannel.chat_photo);\n }\n\n if(fullChannel.call) {\n this.appGroupCallsManager.saveGroupCall(fullChannel.call, id);\n }\n\n this.appNotificationsManager.savePeerSettings({\n peerId,\n settings: fullChannel.notify_settings\n });\n\n this.chatsFull[id] = fullChannel;\n this.fullExpiration[peerId] = Date.now() + PEER_FULL_TTL;\n this.rootScope.dispatchEvent('chat_full_update', id);\n\n return fullChannel;\n },\n processError: (error) => {\n switch(error.type) {\n case 'CHANNEL_PRIVATE':\n const channel = this.appChatsManager.getChat(id) as Chat.channel | Chat.channelForbidden;\n this.apiUpdatesManager.processUpdateMessage({\n _: 'updates',\n updates: [{\n _: 'updateChannel',\n channel_id: id\n }],\n chats: [channel._ === 'channelForbidden' ? channel : {\n _: 'channelForbidden',\n id,\n access_hash: channel.access_hash,\n title: channel.title,\n pFlags: channel.pFlags\n }],\n users: []\n } as Updates.updates);\n break;\n }\n\n throw error;\n }\n });\n }\n\n public getMentions(chatId: ChatId, query: string, threadId?: number): Promise {\n const processUserIds = (topPeers: MyTopPeer[]) => {\n const startsWithAt = query.charAt(0) === '@';\n if(startsWithAt) query = query.slice(1);\n /* const startsWithAt = query.charAt(0) === '@';\n if(startsWithAt) query = query.slice(1);\n\n const index = new SearchIndex(!startsWithAt, !startsWithAt); */\n const index = new SearchIndex({\n ignoreCase: true\n });\n\n const ratingMap: Map = new Map();\n topPeers.forEach((peer) => {\n index.indexObject(peer.id, this.appUsersManager.getUserSearchText(peer.id));\n ratingMap.set(peer.id, peer.rating);\n });\n\n const peerIds = Array.from(index.search(query));\n peerIds.sort((a, b) => ratingMap.get(b) - ratingMap.get(a));\n return peerIds;\n };\n\n let promise: Promise;\n if(this.appChatsManager.isChannel(chatId)) {\n promise = this.getChannelParticipants(chatId, {\n _: 'channelParticipantsMentions',\n q: query,\n top_msg_id: getServerMessageId(threadId)\n }, 50, 0).then((cP) => {\n return cP.participants.map((p) => getParticipantPeerId(p));\n });\n } else if(chatId) {\n promise = Promise.resolve(this.getChatFull(chatId)).then((chatFull) => {\n return ((chatFull as ChatFull.chatFull).participants as ChatParticipants.chatParticipants).participants.map((p) => p.user_id.toPeerId());\n });\n } else {\n promise = Promise.resolve([]);\n }\n\n return Promise.all([\n // [],\n this.appUsersManager.getTopPeers('bots_inline').catch(() => [] as MyTopPeer[]),\n promise\n ]).then((results) => {\n const peers = results[0].concat(results[1].map((peerId) => ({id: peerId, rating: 0})));\n\n return processUserIds(peers);\n });\n }\n\n private invalidateChannelParticipants(id: ChatId) {\n this.apiManager.clearCache('channels.getParticipants', (params) => (params.channel as InputChannel.inputChannel).channel_id === id);\n this.refreshFullPeer(id.toPeerId(true));\n }\n\n private refreshFullPeer(peerId: PeerId) {\n if(peerId.isUser()) {\n const userId = peerId.toUserId();\n delete this.usersFull[userId];\n this.rootScope.dispatchEvent('user_full_update', userId);\n } else {\n const chatId = peerId.toChatId();\n delete this.chatsFull[chatId];\n this.rootScope.dispatchEvent('chat_full_update', chatId);\n }\n\n // ! эта строчка будет создавать race condition:\n // ! запрос вернёт chat с установленным флагом call_not_empty, хотя сам апдейт уже будет применён\n // this.getProfileByPeerId(peerId, true);\n }\n\n public updateProfile(first_name?: string, last_name?: string, about?: string) {\n return this.apiManager.invokeApi('account.updateProfile', {\n first_name,\n last_name,\n about\n }).then((user) => {\n this.appUsersManager.saveApiUser(user);\n\n if(about !== undefined) {\n const peerId = user.id.toPeerId();\n const userFull = this.usersFull[user.id];\n if(userFull) {\n userFull.about = about;\n }\n\n this.rootScope.dispatchEvent('peer_bio_edit', peerId);\n }\n\n return this.getProfile(user.id, true);\n });\n }\n\n public uploadProfilePhoto(inputFile: InputFile) {\n return this.apiManager.invokeApi('photos.uploadProfilePhoto', {\n file: inputFile\n }).then((updateResult) => {\n // ! sometimes can have no user in users\n const photo = updateResult.photo as Photo.photo;\n if(!updateResult.users.length) {\n const strippedThumb = photo.sizes.find((size) => size._ === 'photoStrippedSize') as PhotoSize.photoStrippedSize;\n updateResult.users.push({\n ...this.appUsersManager.getSelf(),\n photo: {\n _: 'userProfilePhoto',\n dc_id: photo.dc_id,\n photo_id: photo.id,\n stripped_thumb: strippedThumb?.bytes,\n pFlags: {\n\n }\n }\n });\n }\n this.appUsersManager.saveApiUsers(updateResult.users);\n\n const myId = this.appPeersManager.peerId;\n this.appPhotosManager.savePhoto(updateResult.photo, {\n type: 'profilePhoto',\n peerId: myId\n });\n\n const userId = myId.toUserId();\n // this.apiUpdatesManager.processLocalUpdate({\n // _: 'updateUserPhoto',\n // user_id: userId,\n // date: tsNow(true),\n // photo: this.appUsersManager.getUser(userId).photo,\n // previous: true\n // });\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateUser',\n user_id: userId\n });\n });\n }\n\n public deletePhotos(photoIds: string[]) {\n return this.apiManager.invokeApiSingle('photos.deletePhotos', {\n id: photoIds.map((photoId) => {\n const photo = this.appPhotosManager.getPhoto(photoId);\n return getPhotoInput(photo);\n })\n }).then((deletedList) => {\n\n });\n }\n\n private verifyParticipantForOnlineCount(participant: {user_id: UserId}) {\n const user = this.appUsersManager.getUser(participant.user_id);\n return !!(user && user.status && user.status._ === 'userStatusOnline');\n }\n\n private reduceParticipantsForOnlineCount(participants: {user_id: UserId}[]) {\n return participants.reduce((acc, participant) => {\n return acc + +this.verifyParticipantForOnlineCount(participant);\n }, 0);\n }\n\n public async getOnlines(id: ChatId): Promise {\n const minOnline = 1;\n if(this.appChatsManager.isBroadcast(id)) {\n return minOnline;\n }\n\n const chatInfo = await this.getChatFull(id);\n if(this.appChatsManager.isMegagroup(id)) {\n if((chatInfo as ChatFull.channelFull).participants_count <= 100) {\n const channelParticipants = await this.getChannelParticipants(id, {_: 'channelParticipantsRecent'}, 100);\n return this.reduceParticipantsForOnlineCount(channelParticipants.participants as ChannelParticipant.channelParticipant[]);\n }\n\n const res = await this.apiManager.invokeApiCacheable('messages.getOnlines', {\n peer: this.appChatsManager.getChannelInputPeer(id)\n }, {cacheSeconds: 60});\n\n const onlines = res.onlines ?? minOnline;\n return onlines;\n }\n\n const _participants = (chatInfo as ChatFull.chatFull).participants as ChatParticipants.chatParticipants;\n if(_participants?.participants) {\n return this.reduceParticipantsForOnlineCount(_participants.participants);\n } else {\n return minOnline;\n }\n }\n\n private getTypingsKey(peerId: PeerId, threadId?: number) {\n return peerId + (threadId ? `_${threadId}` : '');\n }\n\n public getPeerTypings(peerId: PeerId, threadId?: number) {\n return this.typingsInPeer[this.getTypingsKey(peerId, threadId)];\n }\n\n private onUpdateChatParticipants = (update: Update.updateChatParticipants) => {\n const participants = update.participants;\n if(participants._ !== 'chatParticipants') {\n return;\n }\n\n const chatId = participants.chat_id;\n const chatFull = this.chatsFull[chatId] as ChatFull.chatFull;\n if(chatFull !== undefined) {\n chatFull.participants = participants;\n this.rootScope.dispatchEvent('chat_full_update', chatId);\n }\n };\n\n private onUpdateChatParticipantAdd = (update: Update.updateChatParticipantAdd) => {\n const chatFull = this.chatsFull[update.chat_id] as ChatFull.chatFull;\n if(chatFull === undefined) {\n return;\n }\n\n const _participants = chatFull.participants as ChatParticipants.chatParticipants;\n const participants = _participants.participants || [];\n for(let i = 0, length = participants.length; i < length; i++) {\n if(participants[i].user_id === update.user_id) {\n return;\n }\n }\n\n participants.push({\n _: 'chatParticipant',\n user_id: update.user_id,\n inviter_id: update.inviter_id,\n date: tsNow(true)\n });\n\n _participants.version = update.version;\n this.rootScope.dispatchEvent('chat_full_update', update.chat_id);\n };\n\n private onUpdateChatParticipantDelete = (update: Update.updateChatParticipantDelete) => {\n const chatFull = this.chatsFull[update.chat_id] as ChatFull.chatFull;\n if(chatFull === undefined) {\n return;\n }\n\n const _participants = chatFull.participants as ChatParticipants.chatParticipants;\n const participants = _participants.participants || [];\n for(let i = 0, length = participants.length; i < length; i++) {\n if(participants[i].user_id === update.user_id) {\n participants.splice(i, 1);\n _participants.version = update.version;\n this.rootScope.dispatchEvent('chat_full_update', update.chat_id);\n return;\n }\n }\n };\n\n private onUpdateUserTyping = (update: Update.updateUserTyping | Update.updateChatUserTyping | Update.updateChannelUserTyping) => {\n const fromId = (update as Update.updateUserTyping).user_id ?\n (update as Update.updateUserTyping).user_id.toPeerId() :\n this.appPeersManager.getPeerId((update as Update.updateChatUserTyping).from_id);\n if(this.appPeersManager.peerId === fromId || update.action._ === 'speakingInGroupCallAction') {\n return;\n }\n\n const topMsgId = (update as Update.updateChannelUserTyping).top_msg_id;\n const threadId = topMsgId ? generateMessageId(topMsgId) : undefined;\n const peerId = this.appPeersManager.getPeerId(update);\n const key = this.getTypingsKey(peerId, threadId);\n const typings = this.typingsInPeer[key] ??= [];\n let typing = typings.find((t) => t.userId === fromId);\n\n const cancelAction = () => {\n delete typing.timeout;\n // typings.findAndSplice((t) => t === typing);\n const idx = typings.indexOf(typing);\n if(idx !== -1) {\n typings.splice(idx, 1);\n }\n\n this.rootScope.dispatchEvent('peer_typings', {peerId, threadId, typings});\n\n if(!typings.length) {\n delete this.typingsInPeer[key];\n }\n };\n\n if(typing?.timeout !== undefined) {\n clearTimeout(typing.timeout);\n }\n\n if(update.action._ === 'sendMessageCancelAction') {\n if(!typing) {\n return;\n }\n\n cancelAction();\n return;\n }\n\n if(!typing) {\n typing = {\n userId: fromId\n };\n\n typings.push(typing);\n }\n\n // console.log('updateChatUserTyping', update, typings);\n\n typing.action = update.action;\n\n const hasUser = this.appUsersManager.hasUser(fromId);\n if(!hasUser) {\n // let's load user here\n if(update._ === 'updateChatUserTyping') {\n if(update.chat_id && this.appChatsManager.hasChat(update.chat_id) && !this.appChatsManager.isChannel(update.chat_id)) {\n Promise.resolve(this.getChatFull(update.chat_id)).then(() => {\n if(typing.timeout !== undefined && this.appUsersManager.hasUser(fromId)) {\n this.rootScope.dispatchEvent('peer_typings', {peerId, threadId, typings});\n }\n });\n }\n }\n\n // return;\n } else {\n this.appUsersManager.forceUserOnline(fromId);\n }\n\n typing.timeout = ctx.setTimeout(cancelAction, 6000);\n if(hasUser) {\n this.rootScope.dispatchEvent('peer_typings', {peerId, threadId, typings});\n }\n };\n\n private onUpdatePeerBlocked = (update: Update.updatePeerBlocked) => {\n const peerId = this.appPeersManager.getPeerId(update.peer_id);\n if(this.appPeersManager.isUser(peerId)) {\n const userId = peerId.toUserId();\n const userFull = this.usersFull[userId];\n if(userFull) {\n if(update.blocked) userFull.pFlags.blocked = true;\n else delete userFull.pFlags.blocked;\n }\n\n this.rootScope.dispatchEvent('user_full_update', userId);\n }\n\n this.rootScope.dispatchEvent('peer_block', {peerId, blocked: update.blocked});\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Awaited} from '../types';\n\nexport default function callbackifyAll(\n values: T,\n callback: (result: { -readonly [P in keyof T]: Awaited }) => R\n): Promise> | R {\n if(values.some((value) => value instanceof Promise)) {\n return Promise.all(values).then(callback as any);\n } else {\n return callback(values as any);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport findAndSplice from '../../helpers/array/findAndSplice';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport assumeType from '../../helpers/assumeType';\nimport callbackify from '../../helpers/callbackify';\nimport callbackifyAll from '../../helpers/callbackifyAll';\nimport copy from '../../helpers/object/copy';\nimport pause from '../../helpers/schedulers/pause';\nimport {AvailableReaction, Message, MessagePeerReaction, MessagesAvailableReactions, Reaction, ReactionCount, Update, Updates} from '../../layer';\nimport {ReferenceContext} from '../mtproto/referenceDatabase';\nimport {AppManager} from './manager';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\nimport reactionsEqual from './utils/reactions/reactionsEqual';\n\nconst SAVE_DOC_KEYS = [\n 'static_icon' as const,\n 'appear_animation' as const,\n 'select_animation' as const,\n 'activate_animation' as const,\n 'effect_animation' as const,\n 'around_animation' as const,\n 'center_icon' as const\n];\n\nconst REFERENCE_CONTEXT: ReferenceContext = {\n type: 'reactions'\n};\n\nexport class AppReactionsManager extends AppManager {\n private availableReactions: AvailableReaction[];\n private sendReactionPromises: Map>;\n private lastSendingTimes: Map;\n\n protected after() {\n this.rootScope.addEventListener('language_change', () => {\n this.availableReactions = undefined;\n this.getAvailableReactions();\n });\n\n this.sendReactionPromises = new Map();\n this.lastSendingTimes = new Map();\n\n this.rootScope.addEventListener('user_auth', () => {\n setTimeout(() => {\n Promise.resolve(this.getAvailableReactions()).then(async(availableReactions) => {\n for(const availableReaction of availableReactions) {\n await Promise.all([\n availableReaction.around_animation && this.apiFileManager.downloadMedia({media: availableReaction.around_animation}),\n availableReaction.static_icon && this.apiFileManager.downloadMedia({media: availableReaction.static_icon}),\n availableReaction.appear_animation && this.apiFileManager.downloadMedia({media: availableReaction.appear_animation}),\n availableReaction.center_icon && this.apiFileManager.downloadMedia({media: availableReaction.center_icon})\n ]);\n\n await pause(1000);\n }\n });\n }, 7.5e3);\n });\n }\n\n public getAvailableReactions() {\n if(this.availableReactions) return this.availableReactions;\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.getAvailableReactions',\n processResult: (messagesAvailableReactions) => {\n assumeType(messagesAvailableReactions);\n\n const availableReactions = this.availableReactions = messagesAvailableReactions.reactions;\n for(const reaction of availableReactions) {\n for(const key of SAVE_DOC_KEYS) {\n if(!reaction[key]) {\n continue;\n }\n\n reaction[key] = this.appDocsManager.saveDoc(reaction[key], REFERENCE_CONTEXT);\n }\n }\n\n return availableReactions;\n },\n params: {\n hash: 0\n }\n });\n }\n\n public getActiveAvailableReactions() {\n return callbackify(this.getAvailableReactions(), (availableReactions) => {\n return availableReactions.filter((availableReaction) => !availableReaction.pFlags.inactive);\n });\n }\n\n public getAvailableReactionsForPeer(peerId: PeerId) {\n const activeAvailableReactions = this.getActiveAvailableReactions();\n if(peerId.isUser()) {\n return this.unshiftQuickReaction(activeAvailableReactions);\n }\n\n const chatFull = this.appProfileManager.getChatFull(peerId.toChatId());\n return callbackifyAll([activeAvailableReactions, chatFull, this.getQuickReaction()], ([activeAvailableReactions, chatFull, quickReaction]) => {\n const chatAvailableReactions = chatFull.available_reactions ?? {_: 'chatReactionsNone'};\n\n let filteredChatAvailableReactions: AvailableReaction[] = [];\n if(chatAvailableReactions._ === 'chatReactionsAll') {\n filteredChatAvailableReactions = activeAvailableReactions;\n } else if(chatAvailableReactions._ === 'chatReactionsSome') {\n filteredChatAvailableReactions = chatAvailableReactions.reactions.map((reaction) => {\n return activeAvailableReactions.find((availableReaction) => availableReaction.reaction === (reaction as Reaction.reactionEmoji).emoticon);\n }).filter(Boolean);\n }\n\n return this.unshiftQuickReactionInner(filteredChatAvailableReactions, quickReaction);\n });\n }\n\n private unshiftQuickReactionInner(availableReactions: AvailableReaction[], quickReaction: Reaction | AvailableReaction) {\n if(quickReaction && quickReaction._ !== 'reactionEmoji' && quickReaction._ !== 'availableReaction') return availableReactions;\n const emoticon = (quickReaction as Reaction.reactionEmoji).emoticon || (quickReaction as AvailableReaction).reaction;\n const availableReaction = findAndSplice(availableReactions, (availableReaction) => availableReaction.reaction === emoticon);\n if(availableReaction) {\n availableReactions.unshift(availableReaction);\n }\n\n return availableReactions;\n }\n\n private unshiftQuickReaction(\n availableReactions: AvailableReaction[] | PromiseLike,\n quickReaction: ReturnType = this.getQuickReaction()\n ) {\n return callbackifyAll([\n availableReactions,\n quickReaction\n ], ([availableReactions, quickReaction]) => {\n return this.unshiftQuickReactionInner(availableReactions, quickReaction);\n });\n }\n\n public getAvailableReactionsByMessage(message: Message.message) {\n if(!message) return [];\n const peerId = (message.fwd_from?.channel_post && this.appPeersManager.isMegagroup(message.peerId) && message.fwdFromId) || message.peerId;\n return this.getAvailableReactionsForPeer(peerId);\n }\n\n public isReactionActive(reaction: string) {\n if(!this.availableReactions) return false;\n return !!this.availableReactions.find((availableReaction) => availableReaction.reaction === reaction);\n }\n\n public getQuickReaction() {\n return callbackifyAll([\n this.apiManager.getConfig(),\n this.getAvailableReactions()\n ], ([config, availableReactions]) => {\n const reaction = config.reactions_default;\n if(reaction?._ === 'reactionEmoji') {\n return availableReactions.find((availableReaction) => availableReaction.reaction === reaction.emoticon);\n }\n\n return reaction as Reaction.reactionCustomEmoji;\n });\n }\n\n public getReactionCached(reaction: string) {\n return this.availableReactions.find((availableReaction) => availableReaction.reaction === reaction);\n }\n\n public getReaction(reaction: string) {\n return callbackify(this.getAvailableReactions(), () => {\n return this.getReactionCached(reaction);\n });\n }\n\n public getMessagesReactions(peerId: PeerId, mids: number[]) {\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.getMessagesReactions',\n params: {\n id: mids.map((mid) => getServerMessageId(mid)),\n peer: this.appPeersManager.getInputPeerById(peerId)\n },\n processResult: (updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n\n // const update = (updates as Updates.updates).updates.find((update) => update._ === 'updateMessageReactions') as Update.updateMessageReactions;\n // return update.reactions;\n }\n });\n }\n\n public getMessageReactionsList(peerId: PeerId, mid: number, limit: number, reaction?: Reaction, offset?: string) {\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.getMessageReactionsList',\n params: {\n peer: this.appPeersManager.getInputPeerById(peerId),\n id: getServerMessageId(mid),\n limit,\n reaction,\n offset\n },\n processResult: (messageReactionsList) => {\n this.appUsersManager.saveApiUsers(messageReactionsList.users);\n return messageReactionsList;\n }\n });\n }\n\n public setDefaultReaction(reaction: Reaction) {\n return this.apiManager.invokeApi('messages.setDefaultReaction', {reaction}).then(async(value) => {\n if(value) {\n const appConfig = await this.apiManager.getConfig();\n if(appConfig) {\n appConfig.reactions_default = reaction;\n }/* else { // if no config or loading it - overwrite\n this.apiManager.getAppConfig(true);\n } */\n\n this.rootScope.dispatchEvent('quick_reaction', reaction);\n }\n\n return value;\n });\n }\n\n public async sendReaction(message: Message.message, reaction?: Reaction | AvailableReaction, onlyLocal?: boolean) {\n if(reaction._ === 'availableReaction') {\n reaction = {\n _: 'reactionEmoji',\n emoticon: reaction.reaction\n };\n }\n\n const limit = await this.apiManager.getLimit('reactions');\n\n const lastSendingTimeKey = message.peerId + '_' + message.mid;\n const lastSendingTime = this.lastSendingTimes.get(lastSendingTimeKey);\n if(lastSendingTime) {\n return;\n } else {\n this.lastSendingTimes.set(lastSendingTimeKey, Date.now());\n setTimeout(() => {\n this.lastSendingTimes.delete(lastSendingTimeKey);\n }, 333);\n }\n\n const {peerId, mid} = message;\n const myPeerId = this.appPeersManager.peerId;\n\n const unsetReactionCount = (reactionCount: ReactionCount) => {\n --reactionCount.count;\n delete reactionCount.chosen_order;\n\n if(reactionsEqual(reaction as Reaction, reactionCount.reaction)) {\n reaction = undefined as Reaction;\n }\n\n if(!reactionCount.count) {\n indexOfAndSplice(reactions.results, reactionCount);\n }/* else {\n insertInDescendSortedArray(reactions.results, chosenReaction, 'count', chosenReactionIdx);\n } */\n\n if(reactions.recent_reactions) {\n findAndSplice(reactions.recent_reactions, (recentReaction) => reactionsEqual(recentReaction.reaction, reactionCount.reaction) && this.appPeersManager.getPeerId(recentReaction.peer_id) === myPeerId);\n }\n\n if(!reactions.results.length) {\n reactions = undefined;\n }\n };\n\n const canSeeList = message.reactions?.pFlags?.can_see_list || !this.appPeersManager.isBroadcast(message.peerId) || message.peerId.isUser();\n if(!message.reactions) {\n message.reactions = {\n _: 'messageReactions',\n results: [],\n recent_reactions: canSeeList ? [] : undefined,\n pFlags: {\n can_see_list: canSeeList || undefined\n }\n };\n }\n\n let reactions = onlyLocal ? message.reactions : copy(message.reactions);\n const chosenReactions = reactions.results.filter((reactionCount) => reactionCount.chosen_order !== undefined);\n chosenReactions.sort((a, b) => b.chosen_order - a.chosen_order);\n const unsetReactions: ReactionCount[] = [];\n const chosenReactionIdx = chosenReactions.findIndex((reactionCount) => reactionsEqual(reactionCount.reaction, reaction as Reaction));\n if(chosenReactionIdx !== -1) unsetReactions.push(...chosenReactions.splice(chosenReactionIdx, 1));\n unsetReactions.push(...chosenReactions.splice(limit - +(chosenReactionIdx === -1)));\n unsetReactions.forEach((reactionCount) => {\n chosenReactions.forEach((chosenReactionCount) => {\n if(chosenReactionCount.chosen_order > reactionCount.chosen_order) {\n --chosenReactionCount.chosen_order;\n }\n });\n\n unsetReactionCount(reactionCount);\n });\n\n const chosenReactionsLength = chosenReactions.length;\n chosenReactions.forEach((reactionCount, idx) => {\n reactionCount.chosen_order = chosenReactionsLength - 1 - idx;\n });\n\n if(reaction) {\n if(!reactions) {\n reactions/* = message.reactions */ = {\n _: 'messageReactions',\n results: [],\n pFlags: {}\n };\n\n if(canSeeList) {\n reactions.pFlags.can_see_list = true;\n }\n }\n\n let reactionCountIdx = reactions.results.findIndex((reactionCount) => reactionsEqual(reactionCount.reaction, reaction as Reaction));\n let reactionCount = reactionCountIdx !== -1 && reactions.results[reactionCountIdx];\n if(!reactionCount) {\n reactionCount = {\n _: 'reactionCount',\n count: 0,\n reaction\n };\n\n reactionCountIdx = reactions.results.push(reactionCount) - 1;\n }\n\n ++reactionCount.count;\n reactionCount.chosen_order = chosenReactions.length ? chosenReactions[0].chosen_order + 1 : 0;\n chosenReactions.unshift(reactionCount);\n\n if(!reactions.recent_reactions && canSeeList) {\n reactions.recent_reactions = [];\n }\n\n if(reactions.recent_reactions) {\n const peerReaction: MessagePeerReaction = {\n _: 'messagePeerReaction',\n reaction,\n peer_id: this.appPeersManager.getOutputPeer(myPeerId),\n pFlags: {}\n };\n\n if(!this.appPeersManager.isMegagroup(peerId) && false) {\n reactions.recent_reactions.push(peerReaction);\n reactions.recent_reactions = reactions.recent_reactions.slice(-3);\n } else {\n reactions.recent_reactions.unshift(peerReaction);\n reactions.recent_reactions = reactions.recent_reactions.slice(0, 3);\n }\n }\n\n // insertInDescendSortedArray(reactions.results, reactionCount, 'count', reactionCountIdx);\n }\n\n const availableReactions = this.availableReactions;\n if(reactions && availableReactions?.length) {\n const indexes: Map = new Map();\n availableReactions.forEach((availableReaction, idx) => {\n indexes.set(availableReaction.reaction, idx);\n });\n\n reactions.results.sort((a, b) => {\n const id1 = (a.reaction as Reaction.reactionCustomEmoji).document_id || (a.reaction as Reaction.reactionEmoji).emoticon;\n const id2 = (b.reaction as Reaction.reactionCustomEmoji).document_id || (b.reaction as Reaction.reactionEmoji).emoticon;\n return (b.count - a.count) || ((indexes.get(id1) ?? 0) - (indexes.get(id2) ?? 0));\n });\n }\n\n if(onlyLocal) {\n message.reactions = reactions;\n this.rootScope.dispatchEvent('messages_reactions', [{message, changedResults: []}]);\n return Promise.resolve();\n }\n\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateMessageReactions',\n peer: message.peer_id,\n msg_id: message.id,\n reactions: reactions,\n local: true\n });\n\n const promiseKey = [peerId, mid].join('-');\n const msgId = getServerMessageId(mid);\n const promise = this.apiManager.invokeApi('messages.sendReaction', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n msg_id: msgId,\n reaction: chosenReactions.map((reactionCount) => reactionCount.reaction)\n }).then((updates) => {\n assumeType(updates);\n\n const editMessageUpdateIdx = updates.updates.findIndex((update) => update._ === 'updateEditMessage' || update._ === 'updateEditChannelMessage');\n if(editMessageUpdateIdx !== -1) {\n const editMessageUpdate = updates.updates[editMessageUpdateIdx] as Update.updateEditMessage | Update.updateEditChannelMessage;\n updates.updates[editMessageUpdateIdx] = {\n _: 'updateMessageReactions',\n msg_id: msgId,\n peer: this.appPeersManager.getOutputPeer(peerId),\n reactions: (editMessageUpdate.message as Message.message).reactions,\n pts: editMessageUpdate.pts,\n pts_count: editMessageUpdate.pts_count\n };\n }\n\n this.apiUpdatesManager.processUpdateMessage(updates);\n }).catch((err) => {\n if(err.type === 'REACTION_INVALID' && this.sendReactionPromises.get(promiseKey) === promise) {\n this.sendReaction(message, chosenReactions[0]?.reaction, true);\n }\n }).finally(() => {\n if(this.sendReactionPromises.get(promiseKey) === promise) {\n this.sendReactionPromises.delete(promiseKey);\n }\n });\n\n this.sendReactionPromises.set(promiseKey, promise);\n return promise;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from './appDocsManager';\nimport type {DownloadOptions} from '../mtproto/apiFileManager';\nimport {Document, InputFileLocation, InputStickerSet, MessagesAllStickers, MessagesFavedStickers, MessagesFeaturedStickers, MessagesFoundStickerSets, MessagesRecentStickers, MessagesStickers, MessagesStickerSet, PhotoSize, StickerPack, StickerSet, StickerSetCovered, Update, VideoSize} from '../../layer';\nimport {Modify} from '../../types';\nimport AppStorage from '../storage';\nimport DATABASE_STATE from '../../config/databases/state';\nimport assumeType from '../../helpers/assumeType';\nimport fixBase64String from '../../helpers/fixBase64String';\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport findAndSplice from '../../helpers/array/findAndSplice';\nimport {AppManager} from './manager';\nimport fixEmoji from '../richTextProcessor/fixEmoji';\nimport ctx from '../../environment/ctx';\nimport {getEnvironment} from '../../environment/utils';\nimport getDocumentInput from './utils/docs/getDocumentInput';\nimport getStickerEffectThumb from './utils/stickers/getStickerEffectThumb';\nimport tsNow from '../../helpers/tsNow';\n\nconst CACHE_TIME = 3600e3;\n\ntype LOCAL_STICKER_SET_ID = Extract<\n InputStickerSet['_'],\n 'inputStickerSetAnimatedEmoji' | 'inputStickerSetAnimatedEmojiAnimations' |\n 'inputStickerSetPremiumGifts' | 'inputStickerSetEmojiGenericAnimations' |\n 'inputStickerSetEmojiDefaultStatuses' | 'inputStickerSetEmojiDefaultTopicIcons'\n>;\n\ntype LOCAL_ID = 'EMOJI' | 'EMOJI_ANIMATIONS' | 'PREMIUM_GIFTS' | 'GENERIC_ANIMATIONS' | 'DEFAULT_STATUSES' | 'DEFAULT_TOPIC_ICONS';\n\nconst LOCAL_IDS: {[key in LOCAL_ID]: LOCAL_STICKER_SET_ID} = {\n EMOJI: 'inputStickerSetAnimatedEmoji',\n EMOJI_ANIMATIONS: 'inputStickerSetAnimatedEmojiAnimations',\n PREMIUM_GIFTS: 'inputStickerSetPremiumGifts',\n GENERIC_ANIMATIONS: 'inputStickerSetEmojiGenericAnimations',\n DEFAULT_STATUSES: 'inputStickerSetEmojiDefaultStatuses',\n DEFAULT_TOPIC_ICONS: 'inputStickerSetEmojiDefaultTopicIcons'\n}\n\nconst LOCAL_IDS_SET: Set = new Set(Object.values(LOCAL_IDS) as any);\n\n// let TEST_FILE_REFERENCE_REFRESH = true;\n\nexport type MyStickerSetInput = {\n id: StickerSet.stickerSet['id'],\n access_hash?: StickerSet.stickerSet['access_hash']\n};\n\nexport type MyMessagesStickerSet = MessagesStickerSet.messagesStickerSet;\n\nexport class AppStickersManager extends AppManager {\n private storage = new AppStorage, typeof DATABASE_STATE>(DATABASE_STATE, 'stickerSets');\n\n private getStickerSetPromises: {[setId: Long]: Promise};\n private getStickersByEmoticonsPromises: {[emoticon: string]: Promise};\n\n private greetingStickers: MyDocument[];\n private getGreetingStickersTimeout: number;\n private getGreetingStickersPromise: Promise;\n\n private sounds: Record;\n private getAnimatedEmojiSoundsPromise: Promise;\n\n private favedStickers: MyDocument[];\n private recentStickers: MyDocument[];\n\n private names: Record;\n\n protected after() {\n this.clear(true);\n\n this.rootScope.addEventListener('user_auth', () => {\n setTimeout(() => {\n this.getAnimatedEmojiStickerSet();\n // this.getFavedStickersStickers();\n }, 1000);\n\n if(!this.getGreetingStickersPromise) {\n this.getGreetingStickersTimeout ??= ctx.setTimeout(() => {\n this.getGreetingStickersTimeout = undefined;\n this.getGreetingSticker(true);\n }, 5000);\n }\n });\n\n this.rootScope.addEventListener('app_config', () => this.onStickersUpdated('faved', true));\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateNewStickerSet: (update) => {\n const stickerSet = update.stickerset as MyMessagesStickerSet;\n this.saveStickerSet(stickerSet, stickerSet.set.id);\n this.rootScope.dispatchEvent('stickers_installed', stickerSet.set);\n },\n\n updateRecentStickers: () => this.onStickersUpdated('recent', true),\n\n updateFavedStickers: () => this.onStickersUpdated('faved', true),\n\n updateMoveStickerSetToTop: (update) => {\n this.rootScope.dispatchEvent('stickers_top', update.stickerset);\n },\n\n updateStickerSetsOrder: (update) => {\n this.rootScope.dispatchEvent('stickers_order', {\n type: update.pFlags.emojis ? 'emojis' : (update.pFlags.masks ? 'masks' : 'stickers'),\n order: update.order\n });\n }\n\n // updateStickerSets: (update) => {\n // if(update.pFlags.masks) {\n // return;\n // }\n\n // this.storage.clear(false);\n\n // if(update.pFlags.emojis) {\n\n // } else {\n // this.favedStickers = undefined;\n // this.recentStickers = undefined;\n // this.onStickersUpdated('recent', true);\n // this.onStickersUpdated('faved', true);\n // }\n // }\n });\n }\n\n public clear = (init?: boolean) => {\n this.getStickerSetPromises = {};\n this.getStickersByEmoticonsPromises = {};\n this.sounds = {};\n this.names = {};\n };\n\n private async onStickersUpdated(type: 'faved' | 'recent', overwrite: boolean) {\n const stickers = await (type === 'faved' ? this.getFavedStickersStickers(overwrite) : this.getRecentStickersStickers(overwrite));\n this.rootScope.dispatchEvent('stickers_updated', {\n type,\n stickers\n });\n }\n\n public getGreetingSticker(justPreload = false) {\n if(this.getGreetingStickersTimeout) {\n clearTimeout(this.getGreetingStickersTimeout);\n this.getGreetingStickersTimeout = undefined;\n }\n\n if(!this.getGreetingStickersPromise) {\n this.getGreetingStickersPromise = this.getStickersByEmoticon('👋⭐️', false).then((docs) => {\n if(!docs.length) throw 'NO_STICKERS';\n this.greetingStickers = docs.slice() as Document.document[];\n this.greetingStickers.sort((a, b) => Math.random() - Math.random());\n });\n }\n\n return this.getGreetingStickersPromise.then(() => {\n let doc: Document.document;\n if(!justPreload) {\n doc = this.greetingStickers.shift();\n this.greetingStickers.push(doc);\n }\n\n this.apiFileManager.downloadMedia({media: this.greetingStickers[0]}); // preload next sticker\n\n return doc;\n });\n }\n\n private saveStickers(docs: Document[]) {\n forEachReverse(docs, (doc, idx) => {\n doc = this.appDocsManager.saveDoc(doc);\n\n if(!doc) docs.splice(idx, 1);\n else docs[idx] = doc;\n });\n }\n\n private canUseStickerSetCache(set: MyMessagesStickerSet, useCache?: boolean) {\n return set && set.documents?.length && ((Date.now() - set.refreshTime) < CACHE_TIME || useCache);\n }\n\n public getStickerSet(set: MyStickerSetInput, params: Partial<{\n overwrite: boolean,\n useCache: boolean,\n saveById: boolean\n }> = {}): Promise | MyMessagesStickerSet {\n let {id} = set;\n if(!set.access_hash) {\n set = this.names[id] || set;\n id = set.id;\n }\n\n if(this.getStickerSetPromises[id]) {\n return this.getStickerSetPromises[id];\n }\n\n if(!params.overwrite) {\n const cachedSet = this.storage.getFromCache(id);\n if(this.canUseStickerSetCache(cachedSet, params.useCache)) {\n return cachedSet;\n }\n }\n\n const promise = this.getStickerSetPromises[id] = new Promise(async(resolve) => {\n if(!params.overwrite) {\n const cachedSet = await this.storage.get(id);\n if(this.canUseStickerSetCache(cachedSet, params.useCache)) {\n this.saveStickers(cachedSet.documents);\n resolve(cachedSet);\n\n if(this.getStickerSetPromises[id] === promise) {\n delete this.getStickerSetPromises[id];\n }\n\n return;\n }\n }\n\n try {\n const stickerSet = await this.apiManager.invokeApi('messages.getStickerSet', {\n stickerset: this.getStickerSetInput(set),\n hash: 0\n }) as MyMessagesStickerSet;\n\n const saveById = params.saveById ? id : stickerSet.set.id;\n this.saveStickerSet(stickerSet, saveById);\n\n resolve(stickerSet);\n } catch(err) {\n resolve(null);\n }\n\n if(this.getStickerSetPromises[id] === promise) {\n delete this.getStickerSetPromises[id];\n }\n });\n\n return promise;\n }\n\n public getLocalStickerSet(id: LOCAL_STICKER_SET_ID) {\n return this.getStickerSet({id}, {saveById: true});\n }\n\n public getAnimatedEmojiStickerSet() {\n return Promise.all([\n this.getLocalStickerSet(LOCAL_IDS.EMOJI),\n this.getLocalStickerSet(LOCAL_IDS.EMOJI_ANIMATIONS),\n this.getAnimatedEmojiSounds()\n ]).then(([emoji, animations]) => {\n return {emoji, animations};\n });\n }\n\n public getAnimatedEmojiSounds(overwrite?: boolean) {\n if(this.getAnimatedEmojiSoundsPromise && !overwrite) return this.getAnimatedEmojiSoundsPromise;\n const promise = this.getAnimatedEmojiSoundsPromise = Promise.all([\n this.apiManager.getAppConfig(overwrite),\n this.apiManager.getConfig()\n ]).then(([appConfig, config]) => {\n if(this.getAnimatedEmojiSoundsPromise !== promise) {\n return;\n }\n\n for(const emoji in appConfig.emojies_sounds) {\n const sound = appConfig.emojies_sounds[emoji];\n const bytesStr = atob(fixBase64String(sound.file_reference_base64, false));\n const bytes = new Uint8Array(bytesStr.length);\n for(let i = 0, length = bytes.length; i < length; ++i) {\n bytes[i] = bytesStr[i].charCodeAt(0);\n }\n\n // if(TEST_FILE_REFERENCE_REFRESH) {\n // bytes[0] = bytes[1] = bytes[2] = bytes[3] = bytes[4] = 0;\n // sound.access_hash += '999';\n // }\n\n const doc = this.appDocsManager.saveDoc({\n _: 'document',\n pFlags: {},\n flags: 0,\n id: sound.id,\n access_hash: sound.access_hash,\n attributes: [{\n _: 'documentAttributeAudio',\n duration: 1,\n pFlags: {\n voice: true\n }\n }],\n date: 0,\n dc_id: config.this_dc,\n file_reference: bytes,\n mime_type: 'audio/ogg'\n // size: 101010 // test loading everytime\n }, {\n type: 'emojiesSounds'\n });\n\n this.sounds[emoji] = doc;\n }\n\n // if(TEST_FILE_REFERENCE_REFRESH) {\n // TEST_FILE_REFERENCE_REFRESH = false;\n // }\n });\n\n return promise;\n }\n\n public async getRecentStickers(overwrite?: boolean): Promise> {\n const res = await this.apiManager.invokeApiHashable({\n method: 'messages.getRecentStickers',\n processResult: (res) => {\n assumeType(res);\n\n this.recentStickers = res.stickers as MyDocument[];\n this.saveStickers(res.stickers);\n return res;\n },\n overwrite\n });\n\n return res;\n }\n\n public getRecentStickersStickers(overwrite?: boolean) {\n if(overwrite) this.recentStickers = undefined;\n else if(this.recentStickers) return this.recentStickers;\n return this.getRecentStickers(overwrite).then(() => this.recentStickers);\n }\n\n public saveRecentSticker(docId: DocId, unsave?: boolean, attached?: boolean) {\n const doc = this.appDocsManager.getDoc(docId);\n\n findAndSplice(this.recentStickers, (_doc) => _doc.id === docId);\n if(!unsave) {\n this.recentStickers.unshift(doc);\n\n const docEmoticon = fixEmoji(doc.stickerEmojiRaw);\n for(const emoticon in this.getStickersByEmoticonsPromises) {\n const promise = this.getStickersByEmoticonsPromises[emoticon];\n promise.then((stickers) => {\n const _doc = findAndSplice(stickers, (_doc) => _doc.id === doc.id);\n if(_doc) {\n stickers.unshift(_doc);\n } else if(emoticon.includes(docEmoticon)) {\n stickers.unshift(doc);\n }\n });\n }\n }\n\n this.rootScope.dispatchEvent('sticker_updated', {type: 'recent', faved: !unsave, document: doc});\n\n if(unsave) {\n this.onStickersUpdated('recent', false);\n }\n\n return this.apiManager.invokeApi('messages.saveRecentSticker', {\n id: getDocumentInput(doc),\n unsave,\n attached\n });\n }\n\n private cleanEmoji(emoji: string) {\n return emoji.replace(/\\ufe0f/g, '').replace(/🏻|🏼|🏽|🏾|🏿/g, '');\n }\n\n public getAnimatedEmojiSticker(emoji: string, isAnimation?: boolean) {\n const id = isAnimation ? LOCAL_IDS.EMOJI_ANIMATIONS : LOCAL_IDS.EMOJI;\n const stickerSet = this.storage.getFromCache(id);\n // const stickerSet = await this.getStickerSet({id});\n if(!stickerSet?.documents) return;\n\n if(isAnimation) {\n if(['🧡', '💛', '💚', '💙', '💜', '🖤', '🤍', '🤎'].includes(emoji)) {\n emoji = '❤️';\n }\n }\n\n emoji = this.cleanEmoji(emoji);\n const pack = stickerSet.packs.find((p) => p.emoticon === emoji);\n return pack ? this.appDocsManager.getDoc(pack.documents[0]) : undefined;\n }\n\n public getAnimatedEmojiSoundDocument(emoji: string) {\n return this.sounds[this.cleanEmoji(emoji)];\n }\n\n public preloadAnimatedEmojiSticker(emoji: string) {\n const preloadEmojiPromise = this.getAnimatedEmojiStickerSet().then(() => {\n return this.getAnimatedEmojiSticker(emoji);\n });\n\n return Promise.all([\n preloadEmojiPromise,\n this.preloadAnimatedEmojiStickerAnimation(emoji)\n ]).then(([doc, a]) => {\n return {\n doc: doc,\n animation: a?.doc,\n sound: a?.sound\n };\n });\n }\n\n public preloadAnimatedEmojiStickerAnimation(emoji: string) {\n return this.getAnimatedEmojiStickerSet().then(() => {\n return this.getAnimatedEmojiSticker(emoji, true);\n }).then((doc) => {\n if(!doc) {\n return;\n }\n\n const sound = this.getAnimatedEmojiSoundDocument(emoji);\n return Promise.all([\n this.preloadSticker(doc.id),\n sound ? this.preloadSticker(sound.id) : undefined\n ]).then(() => {\n return {doc, sound};\n });\n });\n }\n\n public preloadSticker(docId: DocId, isPremiumEffect?: boolean) {\n const doc = this.appDocsManager.getDoc(docId);\n return this.apiFileManager.downloadMedia({media: doc, thumb: isPremiumEffect ? doc.video_thumbs?.[0] as Extract : undefined});\n }\n\n private saveStickerSet(res: Omit, id: DocId) {\n const newSet: MessagesStickerSet = {\n _: 'messages.stickerSet',\n set: res.set,\n packs: res.packs,\n documents: res.documents as Document[],\n keywords: res.keywords\n };\n\n let stickerSet = this.storage.getFromCache(id);\n if(stickerSet) {\n Object.assign(stickerSet, newSet);\n } else {\n stickerSet = this.storage.setToCache(id, newSet);\n }\n\n if(stickerSet.set.short_name) {\n this.names[stickerSet.set.short_name] = this.getStickerSetInput(newSet.set) as any;\n }\n\n this.saveStickers(res.documents);\n\n // console.log('stickers wrote', this.stickerSets);\n const needSave = stickerSet.set.installed_date || LOCAL_IDS_SET.has(id as any);\n stickerSet.refreshTime = Date.now();\n this.storage.set({[id]: stickerSet}, !needSave);\n }\n\n public getStickerSetThumbDownloadOptions(stickerSet: StickerSet.stickerSet): DownloadOptions {\n const thumb = stickerSet.thumbs.find((thumb) => thumb._ === 'photoSize') as PhotoSize.photoSize;\n const dcId = stickerSet.thumb_dc_id;\n\n const isAnimated = stickerSet.pFlags?.animated;\n\n const input: InputFileLocation.inputStickerSetThumb = {\n _: 'inputStickerSetThumb',\n stickerset: this.getStickerSetInput(stickerSet),\n thumb_version: stickerSet.thumb_version\n };\n\n return {dcId, location: input, size: thumb.size, mimeType: isAnimated ? 'application/x-tgsticker' : 'image/webp'};\n }\n\n /* public getStickerSetThumbURL(stickerSet: MTStickerSet) {\n const thumb = stickerSet.thumb;\n const dcId = stickerSet.thumb_dc_id;\n\n const isAnimated = stickerSet.pFlags?.animated;\n\n const input: inputStickerSetThumb = {\n _: 'inputStickerSetThumb',\n stickerset: this.getStickerSetInput(stickerSet),\n volume_id: thumb.location.volume_id,\n local_id: thumb.location.local_id\n };\n\n const url = getFileURL('document', this.getStickerSetThumbDownloadOptions(stickerSet));\n return url;\n\n //return promise;\n } */\n\n public getStickerSetInput(set: MyStickerSetInput): InputStickerSet {\n if(LOCAL_IDS_SET.has(set.id as any)) {\n return {\n _: set.id as any\n };\n } else if(!set.access_hash) {\n return {\n _: 'inputStickerSetShortName',\n short_name: '' + set.id\n };\n } else {\n return {\n _: 'inputStickerSetID',\n id: set.id,\n access_hash: set.access_hash\n };\n }\n }\n\n public async getFeaturedStickers() {\n const res = await this.apiManager.invokeApiHashable({\n method: 'messages.getFeaturedStickers',\n processResult: (res) => {\n assumeType(res);\n\n forEachReverse(res.sets, (covered, idx, arr) => {\n if(covered.set.pFlags.videos && !getEnvironment().IS_WEBM_SUPPORTED) {\n arr.splice(idx, 1);\n }\n });\n\n res.sets.forEach((covered) => {\n this.saveStickerSet({set: covered.set, documents: [], packs: [], keywords: []}, covered.set.id);\n });\n\n return res;\n }\n });\n\n return res.sets;\n }\n\n public getPromoPremiumStickers() {\n return this.getStickersByEmoticon('⭐️⭐️', false);\n }\n\n public getPremiumStickers() {\n return this.getStickersByEmoticon('📂⭐️', false);\n }\n\n public getFavedStickers(overwrite?: boolean) {\n return this.apiManager.invokeApiHashable({\n method: 'messages.getFavedStickers',\n processResult: (favedStickers) => {\n assumeType(favedStickers);\n this.saveStickers(favedStickers.stickers);\n this.favedStickers = favedStickers.stickers as MyDocument[];\n return favedStickers;\n },\n overwrite\n });\n }\n\n public getFavedStickersStickers(overwrite?: boolean) {\n if(overwrite) this.favedStickers = undefined;\n else if(this.favedStickers) return this.favedStickers;\n return this.getFavedStickers(overwrite).then(() => this.favedStickers);\n }\n\n public getFavedStickersLimit() {\n return this.apiManager.getLimit('favedStickers');\n }\n\n public async faveSticker(docId: DocId, unfave?: boolean) {\n if(!this.favedStickers) {\n await this.getFavedStickersStickers();\n }\n\n const limit = await this.getFavedStickersLimit();\n\n const doc = this.appDocsManager.getDoc(docId);\n findAndSplice(this.favedStickers, (_doc) => _doc.id === doc.id);\n\n if(!unfave) {\n this.favedStickers.unshift(doc);\n const spliced = this.favedStickers.splice(limit, this.favedStickers.length - limit);\n }\n\n this.rootScope.dispatchEvent('sticker_updated', {type: 'faved', faved: !unfave, document: doc});\n\n return this.apiManager.invokeApi('messages.faveSticker', {\n id: getDocumentInput(doc),\n unfave\n }).then(() => {\n if(unfave) {\n this.onStickersUpdated('faved', true);\n }\n });\n }\n\n public async toggleStickerSet(set: StickerSet.stickerSet) {\n set = this.storage.getFromCache(set.id).set;\n\n if(set.installed_date) {\n const res = await this.apiManager.invokeApi('messages.uninstallStickerSet', {\n stickerset: this.getStickerSetInput(set)\n });\n\n if(res) {\n delete set.installed_date;\n this.rootScope.dispatchEvent('stickers_deleted', set);\n this.storage.delete(set.id, true);\n return true;\n }\n } else {\n const res = await this.apiManager.invokeApi('messages.installStickerSet', {\n stickerset: this.getStickerSetInput(set),\n archived: false\n });\n\n if(res) {\n set.installed_date = tsNow(true);\n this.rootScope.dispatchEvent('stickers_installed', set);\n return true;\n }\n }\n\n return false;\n }\n\n public toggleStickerSets(sets: StickerSet.stickerSet[]) {\n return Promise.all(sets.map((set) => this.toggleStickerSet(set)));\n }\n\n public async searchStickerSets(query: string, excludeFeatured = true) {\n const flags = excludeFeatured ? 1 : 0;\n const res = await this.apiManager.invokeApiHashable({\n method: 'messages.searchStickerSets',\n params: {\n flags,\n exclude_featured: excludeFeatured || undefined,\n q: query\n },\n processResult: (res) => {\n assumeType(res);\n\n forEachReverse(res.sets, (covered, idx, arr) => {\n if(covered.set.pFlags.videos && !getEnvironment().IS_WEBM_SUPPORTED) {\n arr.splice(idx, 1);\n }\n });\n\n res.sets.forEach((covered) => {\n this.saveStickerSet({set: covered.set, documents: [], packs: [], keywords: []}, covered.set.id);\n });\n\n return res;\n }\n });\n\n const foundSaved: StickerSetCovered[] = [];\n const cache = this.storage.getCache();\n for(const id in cache) {\n const {set} = cache[id];\n\n if(set.title.toLowerCase().includes(query.toLowerCase()) && !res.sets.find((c) => c.set.id === set.id)) {\n foundSaved.push({_: 'stickerSetCovered', set, cover: null});\n }\n }\n\n return res.sets.concat(foundSaved);\n }\n\n private processAllStickersResult = (allStickers: MessagesAllStickers) => {\n assumeType(allStickers);\n\n forEachReverse(allStickers.sets, (stickerSet, idx, arr) => {\n if(stickerSet.pFlags.videos && !getEnvironment().IS_WEBM_SUPPORTED) {\n arr.splice(idx, 1);\n }\n });\n\n return allStickers;\n };\n\n public getAllStickers() {\n return this.apiManager.invokeApiHashable({\n method: 'messages.getAllStickers',\n processResult: this.processAllStickersResult\n });\n }\n\n public getEmojiStickers() {\n return this.apiManager.invokeApiHashable({\n method: 'messages.getEmojiStickers',\n processResult: this.processAllStickersResult\n });\n }\n\n public preloadStickerSets() {\n return this.getAllStickers().then((allStickers) => {\n const sets = (allStickers as MessagesAllStickers.messagesAllStickers).sets;\n return Promise.all(sets.map((set) => this.getStickerSet(set, {useCache: true})));\n });\n }\n\n // TODO: detect \"🤷\" by \"🤷‍♂️\"\n public getStickersByEmoticon(emoticon: string, includeOurStickers = true, includeServerStickers = true) {\n emoticon = fixEmoji(emoticon);\n const cacheKey = emoticon + (includeOurStickers ? '1' : '0') + (includeServerStickers ? '1' : '0');\n if(this.getStickersByEmoticonsPromises[cacheKey]) return this.getStickersByEmoticonsPromises[cacheKey];\n\n return this.getStickersByEmoticonsPromises[cacheKey] = Promise.all([\n includeServerStickers ? this.apiManager.invokeApiHashable({\n method: 'messages.getStickers',\n params: {\n emoticon\n },\n processResult: (stickers) => stickers\n }) : undefined,\n includeOurStickers ? this.preloadStickerSets() : [],\n includeOurStickers ? this.getRecentStickers() : undefined\n ]).then(([messagesStickers, installedSets, recentStickers]) => {\n const foundStickers = messagesStickers ? (messagesStickers as MessagesStickers.messagesStickers).stickers.map((sticker) => this.appDocsManager.saveDoc(sticker)) : [];\n const cachedStickersAnimated: Document.document[] = [], cachedStickersStatic: Document.document[] = [];\n\n // console.log('getStickersByEmoticon', messagesStickers, installedSets, recentStickers);\n\n const iteratePacks = (packs: StickerPack.stickerPack[]) => {\n for(const pack of packs) {\n const packEmoticon = fixEmoji(pack.emoticon);\n if(packEmoticon.includes(emoticon)) {\n for(const docId of pack.documents) {\n const doc = this.appDocsManager.getDoc(docId);\n (doc.animated ? cachedStickersAnimated : cachedStickersStatic).push(doc);\n }\n }\n }\n };\n\n if(recentStickers) {\n iteratePacks(recentStickers.packs);\n const stickers = recentStickers.stickers;\n [cachedStickersAnimated, cachedStickersStatic].forEach((s) => {\n s.sort((a, b) => stickers.indexOf(a) - stickers.indexOf(b));\n });\n }\n\n for(const set of installedSets) {\n iteratePacks(set.packs);\n }\n\n /* const entities = parseEntities(emoticon);\n if(entities.length === 1) {\n [cachedStickersAnimated, cachedStickersStatic].forEach((s) => {\n forEachReverse(s, (doc, idx) => {\n const docEmoticon = fixEmoji(doc.stickerEmojiRaw);\n if(docEmoticon !== emoticon) {\n s.splice(idx, 1);\n }\n });\n });\n } */\n\n const stickers = [...new Set(cachedStickersAnimated.concat(cachedStickersStatic, foundStickers))]/* .filter((doc) => !doc.animated) */;\n\n forEachReverse(stickers, (sticker, idx, arr) => {\n if((sticker.sticker === 3 && !getEnvironment().IS_WEBM_SUPPORTED) ||\n (!this.rootScope.premium && getStickerEffectThumb(sticker))) {\n arr.splice(idx, 1);\n }\n });\n\n return stickers;\n });\n }\n\n public clearRecentStickers() {\n if(this.recentStickers) {\n this.recentStickers.length = 0;\n this.onStickersUpdated('recent', false);\n }\n\n return this.apiManager.invokeApi('messages.clearRecentStickers');\n }\n\n public reorderStickerSets(order: StickerSet.stickerSet['id'][], emojis?: boolean, masks?: boolean) {\n return this.apiManager.invokeApi('messages.reorderStickerSets', {\n emojis,\n masks,\n order\n }).then(() => {\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateStickerSetsOrder',\n order,\n pFlags: {\n emojis: emojis || undefined,\n masks: masks || undefined\n }\n });\n });\n }\n}\n","export default function fixBase64String(str: string, toUrl: boolean) {\n if(toUrl) {\n return str.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/\\=+$/, '');\n } else {\n return str.replace(/-/g, '+').replace(/_/g, '/');\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport filterUnique from '../../helpers/array/filterUnique';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport cleanSearchText from '../../helpers/cleanSearchText';\nimport cleanUsername from '../../helpers/cleanUsername';\nimport tsNow from '../../helpers/tsNow';\nimport isObject from '../../helpers/object/isObject';\nimport safeReplaceObject from '../../helpers/object/safeReplaceObject';\nimport {isRestricted} from '../../helpers/restrictions';\nimport {Chat, ContactsResolvedPeer, InputContact, InputGeoPoint, InputMedia, InputPeer, InputUser, User as MTUser, UserProfilePhoto, UserStatus} from '../../layer';\nimport parseEntities from '../richTextProcessor/parseEntities';\nimport wrapUrl from '../richTextProcessor/wrapUrl';\nimport SearchIndex from '../searchIndex';\nimport {AppManager} from './manager';\nimport getPeerId from './utils/peers/getPeerId';\nimport canSendToUser from './utils/users/canSendToUser';\nimport {AppStoragesManager} from './appStoragesManager';\nimport deepEqual from '../../helpers/object/deepEqual';\nimport getPeerActiveUsernames from './utils/peers/getPeerActiveUsernames';\n\nexport type User = MTUser.user;\nexport type TopPeerType = 'correspondents' | 'bots_inline';\nexport type MyTopPeer = {id: PeerId, rating: number};\n\nexport class AppUsersManager extends AppManager {\n private storage: AppStoragesManager['storages']['users'];\n\n private users: {[userId: UserId]: User};\n private usernames: {[username: string]: PeerId};\n private contactsIndex: SearchIndex;\n private contactsFillPromise: CancellablePromise;\n private contactsList: Set;\n private updatedContactsList: boolean;\n\n private getTopPeersPromises: {[type in TopPeerType]?: Promise};\n\n protected after() {\n this.clear(true);\n\n setInterval(this.updateUsersStatuses, 60000);\n\n this.rootScope.addEventListener('state_synchronized', this.updateUsersStatuses);\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateUserStatus: (update) => {\n const userId = update.user_id;\n const user = this.users[userId];\n if(user) {\n user.status = update.status;\n if(user.status) {\n if('expires' in user.status) {\n user.status.expires -= this.timeManager.getServerTimeOffset();\n }\n\n if('was_online' in user.status) {\n user.status.was_online -= this.timeManager.getServerTimeOffset();\n }\n }\n\n // user.sortStatus = this.getUserStatusForSort(user.status);\n this.rootScope.dispatchEvent('user_update', userId);\n this.setUserToStateIfNeeded(user);\n } // ////else console.warn('No user by id:', userId);\n },\n\n // updateUserPhoto: (update) => {\n // const userId = update.user_id;\n // const user = this.users[userId];\n // if(user) {\n // if((user.photo as UserProfilePhoto.userProfilePhoto)?.photo_id === (update.photo as UserProfilePhoto.userProfilePhoto)?.photo_id) {\n // return;\n // }\n\n // this.forceUserOnline(userId, update.date);\n\n // if(update.photo._ === 'userProfilePhotoEmpty') {\n // delete user.photo;\n // } else {\n // user.photo = safeReplaceObject(user.photo, update.photo);\n // }\n\n // this.setUserToStateIfNeeded(user);\n\n // this.rootScope.dispatchEvent('user_update', userId);\n // this.rootScope.dispatchEvent('avatar_update', userId.toPeerId());\n // } else console.warn('No user by id:', userId);\n // },\n\n updateUserName: (update) => {\n const userId = update.user_id;\n const user = this.users[userId];\n if(user) {\n this.forceUserOnline(userId);\n\n this.saveApiUser({\n ...user,\n first_name: update.first_name,\n last_name: update.last_name,\n username: undefined,\n usernames: update.usernames\n }, true);\n }\n }\n });\n\n /* case 'updateContactLink':\n this.onContactUpdated(update.user_id, update.my_link._ === 'contactLinkContact');\n break; */\n\n this.rootScope.addEventListener('language_change', (e) => {\n const userId = this.getSelf().id;\n this.contactsIndex.indexObject(userId, this.getUserSearchText(userId));\n });\n\n return Promise.all([\n this.appStateManager.getState(),\n this.appStoragesManager.loadStorage('users')\n ]).then(([state, {results: users, storage}]) => {\n this.storage = storage;\n\n this.saveApiUsers(users);\n for(let i = 0, length = users.length; i < length; ++i) {\n const user = users[i];\n if(!user) {\n continue;\n }\n\n if(state.contactsListCachedTime && (user.pFlags.contact || user.pFlags.mutual_contact)) {\n this.pushContact(user.id);\n\n if(!this.contactsFillPromise) {\n this.contactsFillPromise = deferredPromise();\n this.contactsFillPromise.resolve(this.contactsList);\n }\n }\n }\n\n // const contactsList = state.contactsList;\n // if(Array.isArray(contactsList)) {\n // contactsList.forEach((userId) => {\n // this.pushContact(userId);\n // });\n\n // if(contactsList.length) {\n // this.contactsFillPromise = deferredPromise();\n // this.contactsFillPromise.resolve(this.contactsList);\n // }\n // }\n\n const recentSearch = state.recentSearch || [];\n for(let i = 0, length = recentSearch.length; i < length; ++i) {\n this.peersStorage.requestPeer(recentSearch[i], 'recentSearch');\n }\n\n this.peersStorage.addEventListener('peerNeeded', (peerId) => {\n if(!this.appPeersManager.isUser(peerId)) {\n return;\n }\n\n const userId = peerId.toUserId();\n if(!this.storage.getFromCache(userId)) {\n this.storage.set({\n [userId]: this.getUser(userId)\n });\n }\n });\n\n this.peersStorage.addEventListener('peerUnneeded', (peerId) => {\n if(!this.appPeersManager.isUser(peerId)) {\n return;\n }\n\n const userId = peerId.toUserId();\n if(this.storage.getFromCache(userId)) {\n this.storage.delete(userId);\n }\n });\n });\n }\n\n public clear = (init = false) => {\n if(!init) {\n for(const userId in this.users) {\n // const userId = +userId;\n if(!userId) continue;\n const peerId = userId.toPeerId();\n if(!this.peersStorage.isPeerNeeded(peerId)) {\n const user = this.users[userId];\n this.modifyUsernamesCache(user, false);\n\n this.storage.delete(userId);\n delete this.users[userId];\n }\n }\n } else {\n this.users = {};\n this.usernames = {};\n }\n\n this.getTopPeersPromises = {};\n this.contactsIndex = this.createSearchIndex();\n this.contactsFillPromise = undefined;\n this.contactsList = new Set();\n this.updatedContactsList = false;\n };\n\n public get userId() {\n return this.rootScope.myId.toUserId();\n }\n\n private onContactsModified(fromServer?: boolean) {\n // const contactsList = [...this.contactsList];\n // this.appStateManager.pushToState('contactsList', contactsList);\n\n if(fromServer) {\n this.appStateManager.pushToState('contactsListCachedTime', tsNow(true));\n }\n }\n\n public pushRecentSearch(peerId: PeerId) {\n return this.appStateManager.getState().then((state) => {\n const recentSearch = state.recentSearch || [];\n if(recentSearch[0] !== peerId) {\n indexOfAndSplice(recentSearch, peerId);\n recentSearch.unshift(peerId);\n if(recentSearch.length > 20) {\n recentSearch.length = 20;\n }\n\n this.appStateManager.pushToState('recentSearch', recentSearch);\n for(const peerId of recentSearch) {\n this.peersStorage.requestPeer(peerId, 'recentSearch');\n }\n }\n });\n }\n\n public clearRecentSearch() {\n return this.appStateManager.getState().then((state) => {\n const recentSearch = state.recentSearch || [];\n for(const peerId of recentSearch) {\n this.peersStorage.releasePeer(peerId, 'recentSearch');\n }\n\n recentSearch.length = 0;\n this.appStateManager.pushToState('recentSearch', recentSearch);\n });\n }\n\n public fillContacts() {\n if(this.contactsFillPromise && this.updatedContactsList) {\n return {\n cached: this.contactsFillPromise.isFulfilled,\n promise: this.contactsFillPromise\n };\n }\n\n this.updatedContactsList = true;\n\n const promise = deferredPromise>();\n this.apiManager.invokeApi('contacts.getContacts').then((result) => {\n if(result._ === 'contacts.contacts') {\n this.contactsList.clear();\n\n this.saveApiUsers(result.users);\n\n result.contacts.forEach((contact) => {\n this.pushContact(contact.user_id);\n });\n\n this.onContactsModified(true);\n\n this.contactsFillPromise = promise;\n }\n\n promise.resolve(this.contactsList);\n }, () => {\n this.updatedContactsList = false;\n });\n\n return {\n cached: this.contactsFillPromise?.isFulfilled,\n promise: this.contactsFillPromise ||= promise\n };\n }\n\n public resolveUsername(username: string): Promise | Chat | User {\n if(username[0] === '@') {\n username = username.slice(1);\n }\n\n username = username.toLowerCase();\n const peerId = this.usernames[username];\n if(peerId) {\n return this.appPeersManager.getPeer(peerId);\n }\n\n return this.apiManager.invokeApiSingleProcess({\n method: 'contacts.resolveUsername',\n params: {username},\n processResult: (resolvedPeer) => this.processResolvedPeer(resolvedPeer)\n });\n }\n\n private processResolvedPeer(resolvedPeer: ContactsResolvedPeer.contactsResolvedPeer) {\n this.saveApiUsers(resolvedPeer.users);\n this.appChatsManager.saveApiChats(resolvedPeer.chats);\n\n return this.appPeersManager.getPeer(getPeerId(resolvedPeer.peer)) as Chat | User;\n }\n\n public resolvePhone(phone: string) {\n return this.apiManager.invokeApi('contacts.resolvePhone', {phone}).then((resolvedPeer) => {\n return this.processResolvedPeer(resolvedPeer) as User;\n });\n }\n\n private pushContact(id: UserId) {\n this.contactsList.add(id);\n this.contactsIndex.indexObject(id, this.getUserSearchText(id));\n this.peersStorage.requestPeer(id.toPeerId(), 'contact');\n }\n\n private popContact(id: UserId) {\n this.contactsList.delete(id);\n this.contactsIndex.indexObject(id, ''); // delete search index\n this.peersStorage.releasePeer(id.toPeerId(), 'contact');\n }\n\n public getUserSearchText(id: UserId) {\n const user = this.users[id];\n if(!user) {\n return '';\n }\n\n const arr: string[] = [\n user.first_name,\n user.last_name,\n user.phone,\n ...getPeerActiveUsernames(user),\n // user.pFlags.self ? I18n.format('SavedMessages', true) : '',\n user.pFlags.self ? 'Saved Messages' : ''\n ];\n\n return arr.filter(Boolean).join(' ');\n }\n\n public getContacts(query?: string, includeSaved = false, sortBy: 'name' | 'online' | 'none' = 'name') {\n return this.fillContacts().promise.then((_contactsList) => {\n let contactsList = [..._contactsList];\n if(query) {\n const results = this.contactsIndex.search(query);\n const filteredContactsList = [...contactsList].filter((id) => results.has(id));\n\n contactsList = filteredContactsList;\n }\n\n if(sortBy === 'name') {\n contactsList.sort((userId1, userId2) => {\n const sortName1 = (this.users[userId1] || {}).sortName || '';\n const sortName2 = (this.users[userId2] || {}).sortName || '';\n return sortName1.localeCompare(sortName2);\n });\n } else if(sortBy === 'online') {\n contactsList.sort((userId1, userId2) => {\n const status1 = this.getUserStatusForSort(this.getUser(userId1).status);\n const status2 = this.getUserStatusForSort(this.getUser(userId2).status);\n return status2 - status1;\n });\n }\n\n const myUserId = this.userId;\n indexOfAndSplice(contactsList, myUserId);\n if(includeSaved) {\n if(this.testSelfSearch(query)) {\n contactsList.unshift(myUserId);\n }\n }\n\n return contactsList;\n });\n }\n\n public getContactsPeerIds(\n query?: Parameters[0],\n includeSaved?: Parameters[1],\n sortBy?: Parameters[2],\n limit?: number\n ) {\n return this.getContacts(query, includeSaved, sortBy).then((userIds) => {\n const peerIds = userIds.map((userId) => userId.toPeerId(false));\n if(limit) {\n return peerIds.slice(0, limit);\n }\n\n return peerIds;\n });\n }\n\n public toggleBlock(peerId: PeerId, block: boolean) {\n return this.apiManager.invokeApiSingle(block ? 'contacts.block' : 'contacts.unblock', {\n id: this.appPeersManager.getInputPeerById(peerId)\n }).then((value) => {\n if(value) {\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updatePeerBlocked',\n peer_id: this.appPeersManager.getOutputPeer(peerId),\n blocked: block\n });\n }\n\n return value;\n });\n }\n\n public testSelfSearch(query: string) {\n const user = this.getSelf();\n const index = this.createSearchIndex();\n index.indexObject(user.id, this.getUserSearchText(user.id));\n return index.search(query).has(user.id);\n }\n\n public createSearchIndex() {\n return new SearchIndex({\n clearBadChars: true,\n ignoreCase: true,\n latinize: true,\n includeTag: true\n });\n }\n\n public saveApiUsers(apiUsers: MTUser[], override?: boolean) {\n if((apiUsers as any).saved) return;\n (apiUsers as any).saved = true;\n apiUsers.forEach((user) => this.saveApiUser(user, override));\n }\n\n public modifyUsernamesCache(peer: Parameters[0], save: boolean) {\n const usernames = getPeerActiveUsernames(peer);\n if(!usernames.length) {\n return;\n }\n\n const cleanedUsernames = usernames.map((username) => cleanUsername(username));\n if(save) {\n cleanedUsernames.forEach((searchUsername) => {\n this.usernames[searchUsername] = peer.id.toPeerId(peer._ !== 'user');\n });\n } else {\n cleanedUsernames.forEach((searchUsername) => {\n delete this.usernames[searchUsername];\n });\n }\n }\n\n public setUsernameToCache(peer: Parameters[0], oldPeer?: typeof peer) {\n if(\n !oldPeer ||\n (oldPeer as MTUser.user).username !== (peer as MTUser.user).username ||\n !deepEqual((oldPeer as MTUser.user).usernames, (peer as MTUser.user).usernames)\n ) {\n this.modifyUsernamesCache(oldPeer, false);\n this.modifyUsernamesCache(peer, true);\n\n return true;\n }\n\n return false;\n }\n\n public saveApiUser(user: MTUser, override?: boolean) {\n if(!user || user._ === 'userEmpty') return;\n\n const userId = user.id;\n const oldUser = this.users[userId];\n\n // ! commented block can affect performance !\n // if(oldUser && !override) {\n // console.log('saveApiUser same');\n // return;\n // }\n\n user.pFlags ??= {};\n\n if(user.pFlags.min && oldUser !== undefined) {\n return;\n }\n\n // * exclude from state\n // defineNotNumerableProperties(user, ['initials', 'num', 'rFirstName', 'rFullName', 'rPhone', 'sortName', 'sortStatus']);\n\n const changedUsername = this.setUsernameToCache(user, oldUser);\n\n if(!oldUser ||\n oldUser.sortName === undefined ||\n oldUser.first_name !== user.first_name ||\n oldUser.last_name !== user.last_name) {\n const fullName = user.first_name + (user.last_name ? ' ' + user.last_name : '');\n\n user.sortName = user.pFlags.deleted ? '' : cleanSearchText(fullName, false);\n } else {\n user.sortName = oldUser.sortName;\n }\n\n if(user.status) {\n if((user.status as UserStatus.userStatusOnline).expires) {\n (user.status as UserStatus.userStatusOnline).expires -= this.timeManager.getServerTimeOffset();\n }\n\n if((user.status as UserStatus.userStatusOffline).was_online) {\n (user.status as UserStatus.userStatusOffline).was_online -= this.timeManager.getServerTimeOffset();\n }\n }\n\n if((user as User).photo?._ === 'userProfilePhotoEmpty') {\n delete (user as User).photo;\n }\n\n // user.sortStatus = user.pFlags.bot ? -1 : this.getUserStatusForSort(user.status);\n\n // if(!user.username && user.usernames) {\n // user.username = user.usernames.find((username) => username.pFlags.active).username;\n // }\n\n if(oldUser === undefined) {\n this.users[userId] = user;\n } else {\n const changedTitle = user.first_name !== oldUser.first_name ||\n user.last_name !== oldUser.last_name ||\n changedUsername;\n\n const oldPhotoId = (oldUser.photo as UserProfilePhoto.userProfilePhoto)?.photo_id;\n const newPhotoId = (user.photo as UserProfilePhoto.userProfilePhoto)?.photo_id;\n const changedPhoto = oldPhotoId !== newPhotoId;\n\n const changedAnyBadge = oldUser.pFlags.premium !== user.pFlags.premium ||\n oldUser.pFlags.verified !== user.pFlags.verified ||\n oldUser.pFlags.scam !== user.pFlags.scam ||\n oldUser.pFlags.fake !== user.pFlags.fake;\n\n /* if(user.pFlags.bot && user.bot_info_version !== oldUser.bot_info_version) {\n\n } */\n\n const wasContact = !!oldUser.pFlags.contact;\n const newContact = !!user.pFlags.contact;\n\n safeReplaceObject(oldUser, user);\n this.rootScope.dispatchEvent('user_update', userId);\n\n if(wasContact !== newContact) {\n this.onContactUpdated(userId, newContact, wasContact);\n }\n\n if(changedPhoto) {\n this.rootScope.dispatchEvent('avatar_update', {peerId: user.id.toPeerId()});\n }\n\n if(changedTitle || changedAnyBadge) {\n this.rootScope.dispatchEvent('peer_title_edit', {peerId: user.id.toPeerId()});\n }\n }\n\n this.checkPremium(user, oldUser);\n this.setUserToStateIfNeeded(user);\n }\n\n private checkPremium(user: User, oldUser: User) {\n if(user.pFlags.self) {\n const isPremium = !!user.pFlags.premium;\n if(this.rootScope.premium !== isPremium) {\n this.rootScope.dispatchEvent('premium_toggle_private', {isNew: !oldUser, isPremium});\n }\n }\n }\n\n private setUserToStateIfNeeded(user: User) {\n if(this.peersStorage.isPeerNeeded(user.id.toPeerId())) {\n this.storage.set({\n [user.id]: user\n });\n }\n }\n\n public isUserOnlineVisible(id: UserId) {\n return this.getUserStatusForSort(id) > 3;\n }\n\n public getUserStatusForSort(status: User['status'] | UserId) {\n if(typeof(status) !== 'object') {\n const user = this.getUser(status);\n status = user?.status;\n }\n\n if(status) {\n const expires = status._ === 'userStatusOnline' ? status.expires : (status._ === 'userStatusOffline' ? status.was_online : 0);\n if(expires) {\n return expires;\n }\n\n /* const timeNow = tsNow(true);\n switch(status._) {\n case 'userStatusRecently':\n return timeNow - 86400 * 3;\n case 'userStatusLastWeek':\n return timeNow - 86400 * 7;\n case 'userStatusLastMonth':\n return timeNow - 86400 * 30;\n } */\n switch(status._) {\n case 'userStatusRecently':\n return 3;\n case 'userStatusLastWeek':\n return 2;\n case 'userStatusLastMonth':\n return 1;\n }\n }\n\n return 0;\n }\n\n public getUser(id: User | UserId) {\n if(isObject(id)) {\n return id;\n }\n\n return this.users[id];\n }\n\n public getUserStatus(id: UserId) {\n return this.isRegularUser(id) && !this.users[id].pFlags.self && this.users[id].status;\n }\n\n public async getUserPhone(id: UserId) {\n const user = this.getUser(id);\n if(!user?.phone) {\n return;\n }\n\n const appConfig = await this.apiManager.getAppConfig();\n return {\n phone: user.phone,\n isAnonymous: appConfig.fragment_prefixes.some((prefix) => user.phone.startsWith(prefix))\n };\n }\n\n public getSelf() {\n return this.getUser(this.userId);\n }\n\n public isBot(id: UserId) {\n return this.users[id] && !!this.users[id].pFlags.bot;\n }\n\n public isAttachMenuBot(id: UserId) {\n return this.isBot(id) && !!this.users[id].pFlags.bot_attach_menu;\n }\n\n public isContact(id: UserId) {\n return this.contactsList.has(id) || !!(this.users[id] && this.users[id].pFlags.contact);\n }\n\n public isRegularUser(id: UserId) {\n const user = this.users[id];\n return user && !this.isBot(id) && !user.pFlags.deleted && !user.pFlags.support;\n }\n\n public isNonContactUser(id: UserId) {\n return this.isRegularUser(id) && !this.isContact(id) && id !== this.userId;\n }\n\n public hasUser(id: UserId, allowMin?: boolean) {\n const user = this.users[id];\n return isObject(user) && (allowMin || !user.pFlags.min);\n }\n\n public getUserString(id: UserId) {\n const user = this.getUser(id);\n return 'u' + id + (user.access_hash ? '_' + user.access_hash : '');\n }\n\n public getUserInput(id: UserId): InputUser {\n const user = this.getUser(id);\n if(user.pFlags && user.pFlags.self) {\n return {_: 'inputUserSelf'};\n }\n\n return {\n _: 'inputUser',\n user_id: id,\n access_hash: user.access_hash\n };\n }\n\n public getUserInputPeer(id: UserId): InputPeer.inputPeerSelf | InputPeer.inputPeerUser {\n const user = this.getUser(id);\n // ! do not use it, there are places that don't support it. need explicit peer id\n // if(user.pFlags?.self) {\n // return {_: 'inputPeerSelf'};\n // }\n\n return {\n _: 'inputPeerUser',\n user_id: id,\n access_hash: user.access_hash\n };\n }\n\n public getContactMediaInput(id: UserId): InputMedia.inputMediaContact {\n const user = this.getUser(id);\n\n return {\n _: 'inputMediaContact',\n first_name: user.first_name,\n last_name: user.last_name,\n phone_number: user.phone,\n vcard: '',\n user_id: id\n };\n }\n\n private updateUsersStatuses = () => {\n const timestampNow = tsNow(true);\n for(const i in this.users) {\n const user = this.users[i];\n this.updateUserStatus(user, timestampNow);\n }\n };\n\n private updateUserStatus(user: MTUser.user, timestampNow = tsNow(true)) {\n if(user.status &&\n user.status._ === 'userStatusOnline' &&\n user.status.expires < timestampNow) {\n user.status = {_: 'userStatusOffline', was_online: user.status.expires};\n this.rootScope.dispatchEvent('user_update', user.id);\n\n this.setUserToStateIfNeeded(user);\n }\n }\n\n public forceUserOnline(id: UserId, eventTimestamp?: number) {\n if(this.isBot(id)) {\n return;\n }\n\n const timestamp = tsNow(true);\n const onlineTimeFor = 60;\n if(eventTimestamp) {\n if((timestamp - eventTimestamp) >= onlineTimeFor) {\n return;\n }\n } else if(this.apiUpdatesManager.updatesState.syncLoading) {\n return;\n }\n\n const user = this.getUser(id);\n if(user?.status &&\n user.status._ !== 'userStatusOnline' &&\n user.status._ !== 'userStatusEmpty' &&\n !user.pFlags.support &&\n !user.pFlags.deleted) {\n user.status = {\n _: 'userStatusOnline',\n expires: timestamp + onlineTimeFor\n };\n\n // user.sortStatus = this.getUserStatusForSort(user.status);\n this.rootScope.dispatchEvent('user_update', id);\n\n this.setUserToStateIfNeeded(user);\n }\n }\n\n public importContact(first_name: string, last_name: string, phone: string) {\n return this.importContacts([{\n first_name,\n last_name,\n phones: [phone]\n }]).then((userIds) => {\n if(!userIds.length) {\n const error = new Error();\n (error as any).type = 'NO_USER';\n throw error;\n }\n\n return userIds[0];\n });\n }\n\n public importContacts(contacts: {phones: string[], first_name: string, last_name: string}[]) {\n const inputContacts: InputContact[] = [];\n\n for(let i = 0; i < contacts.length; ++i) {\n for(let j = 0; j < contacts[i].phones.length; ++j) {\n inputContacts.push({\n _: 'inputPhoneContact',\n client_id: (i << 16 | j).toString(10),\n phone: contacts[i].phones[j],\n first_name: contacts[i].first_name,\n last_name: contacts[i].last_name\n });\n }\n }\n\n return this.apiManager.invokeApi('contacts.importContacts', {\n contacts: inputContacts\n }).then((importedContactsResult) => {\n this.saveApiUsers(importedContactsResult.users);\n\n const userIds = importedContactsResult.imported.map((importedContact) => {\n this.onContactUpdated(importedContact.user_id, true);\n return importedContact.user_id;\n });\n\n return userIds;\n });\n }\n\n public getTopPeers(type: TopPeerType) {\n if(this.getTopPeersPromises[type]) return this.getTopPeersPromises[type];\n\n return this.getTopPeersPromises[type] = this.appStateManager.getState().then((state) => {\n const cached = state.topPeersCache[type];\n if(cached && (cached.cachedTime + 86400e3) > Date.now() && cached.peers) {\n return cached.peers;\n }\n\n return this.apiManager.invokeApi('contacts.getTopPeers', {\n [type]: true,\n offset: 0,\n limit: 15,\n hash: '0'\n }).then((result) => {\n let topPeers: MyTopPeer[] = [];\n if(result._ === 'contacts.topPeers') {\n // console.log(result);\n this.saveApiUsers(result.users);\n this.appChatsManager.saveApiChats(result.chats);\n\n if(result.categories.length) {\n topPeers = result.categories[0].peers.map((topPeer) => {\n const peerId = getPeerId(topPeer.peer);\n this.peersStorage.requestPeer(peerId, 'topPeer');\n return {id: peerId, rating: topPeer.rating};\n });\n }\n }\n\n state.topPeersCache[type] = {\n peers: topPeers,\n cachedTime: Date.now()\n };\n this.appStateManager.pushToState('topPeersCache', state.topPeersCache);\n\n return topPeers;\n });\n });\n }\n\n public getBlocked(offset = 0, limit = 0) {\n return this.apiManager.invokeApiSingle('contacts.getBlocked', {offset, limit}).then((contactsBlocked) => {\n this.saveApiUsers(contactsBlocked.users);\n this.appChatsManager.saveApiChats(contactsBlocked.chats);\n const count = contactsBlocked._ === 'contacts.blocked' ? contactsBlocked.users.length + contactsBlocked.chats.length : contactsBlocked.count;\n\n const peerIds: PeerId[] = contactsBlocked.users.map((u) => u.id.toPeerId()).concat(contactsBlocked.chats.map((c) => c.id.toPeerId(true)));\n\n return {count, peerIds};\n });\n }\n\n public getLocated(\n lat: number,\n long: number,\n accuracy_radius: number,\n background: boolean = false,\n self_expires: number = 0\n ) {\n const geo_point: InputGeoPoint = {\n _: 'inputGeoPoint',\n lat,\n long,\n accuracy_radius\n };\n\n return this.apiManager.invokeApi('contacts.getLocated', {\n geo_point,\n background\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n return updates;\n });\n }\n\n /* public searchContacts(query: string, limit = 20) {\n return Promise.all([\n this.getContacts(query),\n apiManager.invokeApi('contacts.search', {\n q: query,\n limit\n })\n ]).then((results) => {\n const [myContacts, peers] = results;\n\n this.saveApiUsers(peers.users);\n appChatsManager.saveApiChats(peers.chats);\n\n // * contacts.search returns duplicates in my_results\n const myResults = new Set(myContacts.concat(peers.my_results.map((p) => appPeersManager.getPeerID(p))));\n\n const out = {\n my_results: [...myResults].slice(0, limit),\n results: peers.results.map((p) => appPeersManager.getPeerID(p))\n };\n\n return out;\n });\n } */\n public searchContacts(query: string, limit = 20) {\n // handle 't.me/username' as 'username'\n const entities = parseEntities(query);\n if(entities.length && entities[0].length === query.trim().length && entities[0]._ === 'messageEntityUrl') {\n try {\n const url = new URL(wrapUrl(query).url);\n const path = url.pathname.slice(1);\n if(path) {\n query = path;\n }\n } catch(err) {}\n }\n\n return this.apiManager.invokeApiCacheable('contacts.search', {\n q: query,\n limit\n }, {cacheSeconds: 60}).then((peers) => {\n this.saveApiUsers(peers.users);\n this.appChatsManager.saveApiChats(peers.chats);\n\n const out = {\n my_results: filterUnique(peers.my_results.map((p) => getPeerId(p))), // ! contacts.search returns duplicates in my_results\n results: peers.results.map((p) => getPeerId(p))\n };\n\n return out;\n });\n }\n\n private onContactUpdated(userId: UserId, isContact: boolean, curIsContact = this.isContact(userId)) {\n if(isContact !== curIsContact) {\n if(isContact) {\n this.pushContact(userId);\n } else {\n this.popContact(userId);\n }\n\n this.onContactsModified();\n\n this.rootScope.dispatchEvent('contacts_update', userId);\n }\n }\n\n public updateUsername(username: string) {\n return this.apiManager.invokeApi('account.updateUsername', {\n username\n }).then((user) => {\n this.saveApiUser(user);\n });\n }\n\n public setUserStatus(userId: UserId, offline: boolean) {\n if(this.isBot(userId)) {\n return;\n }\n\n const user = this.users[userId];\n if(user) {\n const status: UserStatus = offline ? {\n _: 'userStatusOffline',\n was_online: tsNow(true)\n } : {\n _: 'userStatusOnline',\n expires: tsNow(true) + 50\n };\n\n user.status = status;\n // user.sortStatus = this.getUserStatusForSort(user.status);\n this.rootScope.dispatchEvent('user_update', userId);\n\n this.setUserToStateIfNeeded(user);\n }\n }\n\n public updateMyOnlineStatus(offline: boolean) {\n this.setUserStatus(this.getSelf().id, offline);\n return this.apiManager.invokeApiSingle('account.updateStatus', {offline});\n }\n\n public addContact(userId: UserId, first_name: string, last_name: string, phone: string, addPhonePrivacyException?: boolean) {\n /* if(!userId) {\n return this.importContacts([{\n first_name,\n last_name,\n phones: [phone]\n }]);\n } */\n\n return this.apiManager.invokeApi('contacts.addContact', {\n id: this.getUserInput(userId),\n first_name,\n last_name,\n phone,\n add_phone_privacy_exception: addPhonePrivacyException\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates, {override: true});\n\n this.onContactUpdated(userId, true);\n });\n }\n\n public deleteContacts(userIds: UserId[]) {\n return this.apiManager.invokeApi('contacts.deleteContacts', {\n id: userIds.map((userId) => this.getUserInput(userId))\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates, {override: true});\n\n userIds.forEach((userId) => {\n this.onContactUpdated(userId, false);\n });\n });\n }\n\n public checkUsername(username: string) {\n return this.apiManager.invokeApi('account.checkUsername', {username});\n }\n\n public toggleUsername(username: string, active: boolean) {\n return this.apiManager.invokeApi('account.toggleUsername', {username, active});\n }\n\n public reorderUsernames(usernames: string[]) {\n return this.apiManager.invokeApi('account.reorderUsernames', {order: usernames});\n }\n\n public canSendToUser(userId: UserId) {\n return canSendToUser(this.getUser(userId));\n }\n\n public getCommonChats(userId: UserId, limit = 100, maxId?: ChatId) {\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.getCommonChats',\n params: {\n user_id: this.getUserInput(userId),\n limit,\n max_id: maxId ?? 0\n },\n processResult: (messagesChats) => {\n this.appChatsManager.saveApiChats(messagesChats.chats);\n return messagesChats;\n }\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nexport default function cleanUsername(username: string) {\n return username && username.toLowerCase() || '';\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {ReferenceContext} from '../mtproto/referenceDatabase';\nimport {WebPage} from '../../layer';\nimport safeReplaceObject from '../../helpers/object/safeReplaceObject';\nimport {AppManager} from './manager';\n\nconst photoTypeSet = new Set(['photo', 'video', 'gif', 'document']);\n\ntype WebPageMessageKey = `${PeerId}_${number}`;\n\nexport class AppWebPagesManager extends AppManager {\n private webpages: {\n [webPageId: string]: WebPage\n } = {};\n private pendingWebPages: {\n [webPageId: string]: Set\n } = {};\n\n protected after() {\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateWebPage: (update) => {\n this.saveWebPage(update.webpage);\n }\n });\n }\n\n public saveWebPage(apiWebPage: WebPage, messageKey?: WebPageMessageKey, mediaContext?: ReferenceContext) {\n if(apiWebPage._ === 'webPageNotModified' || apiWebPage._ === 'webPageEmpty') return;\n const {id} = apiWebPage;\n\n const oldWebPage = this.webpages[id];\n const isUpdated = oldWebPage &&\n oldWebPage._ === apiWebPage._ &&\n (oldWebPage as WebPage.webPage).hash === (oldWebPage as WebPage.webPage).hash;\n\n if(apiWebPage._ === 'webPage') {\n if(apiWebPage.photo?._ === 'photo') {\n apiWebPage.photo = this.appPhotosManager.savePhoto(apiWebPage.photo, mediaContext);\n } else {\n delete apiWebPage.photo;\n }\n\n if(apiWebPage.document?._ === 'document') {\n apiWebPage.document = this.appDocsManager.saveDoc(apiWebPage.document, mediaContext);\n } else {\n if(apiWebPage.type === 'document') {\n delete apiWebPage.type;\n }\n\n delete apiWebPage.document;\n }\n\n const siteName = apiWebPage.site_name;\n const shortTitle = apiWebPage.title || apiWebPage.author || siteName || '';\n if(siteName && shortTitle === siteName) {\n delete apiWebPage.site_name;\n }\n\n // delete apiWebPage.description\n\n if(!photoTypeSet.has(apiWebPage.type) &&\n !apiWebPage.description &&\n apiWebPage.photo) {\n apiWebPage.type = 'photo';\n }\n }\n\n let pendingSet = this.pendingWebPages[id];\n if(messageKey) {\n if(!pendingSet) pendingSet = this.pendingWebPages[id] = new Set();\n pendingSet.add(messageKey);\n }\n\n if(oldWebPage === undefined) {\n this.webpages[id] = apiWebPage;\n } else {\n safeReplaceObject(oldWebPage, apiWebPage);\n }\n\n if(!messageKey && pendingSet !== undefined && isUpdated) {\n const msgs: {peerId: PeerId, mid: number, isScheduled: boolean}[] = [];\n pendingSet.forEach((value) => {\n const [peerId, mid, isScheduled] = value.split('_');\n msgs.push({\n peerId: peerId.toPeerId(),\n mid: +mid,\n isScheduled: !!isScheduled\n });\n });\n\n this.rootScope.dispatchEvent('webpage_updated', {\n id,\n msgs\n });\n }\n\n return apiWebPage;\n }\n\n public getMessageKeyForPendingWebPage(peerId: PeerId, mid: number, isScheduled?: boolean): WebPageMessageKey {\n return peerId + '_' + mid + (isScheduled ? '_s' : '') as any;\n }\n\n public deleteWebPageFromPending(webPage: WebPage, messageKey: WebPageMessageKey) {\n const id = (webPage as WebPage.webPage).id;\n if(!id) return;\n\n const set = this.pendingWebPages[id];\n if(set && set.has(messageKey)) {\n set.delete(messageKey);\n\n if(!set.size) {\n delete this.pendingWebPages[id];\n }\n }\n }\n\n public getCachedWebPage(id: WebPage.webPage['id']) {\n return this.webpages[id];\n }\n\n public getWebPage(url: string) {\n return this.apiManager.invokeApiHashable({\n method: 'messages.getWebPage',\n processResult: (webPage) => {\n return this.saveWebPage(webPage);\n },\n params: {\n url\n }\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport readBlobAs from './readBlobAs';\n\nexport default function readBlobAsArrayBuffer(blob: Blob) {\n return readBlobAs(blob, 'readAsArrayBuffer');\n}\n","export default function fileNameRFC(fileName: string) {\n // Make filename RFC5987 compatible\n return encodeURIComponent(fileName).replace(/['()]/g, escape).replace(/\\*/g, '%2A');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {getServiceMessagePort} from '../mtproto/mtproto.worker';\nimport ServiceMessagePort from '../serviceWorker/serviceMessagePort';\nimport StreamWriter from './streamWriter';\n\nexport default class DownloadWriter implements StreamWriter {\n constructor(\n private serviceMessagePort: ServiceMessagePort,\n private downloadId: string\n ) {\n this.serviceMessagePort = getServiceMessagePort();\n }\n\n public async write(part: Uint8Array, offset?: number) {\n return this.serviceMessagePort.invoke('downloadChunk', {\n id: this.downloadId,\n chunk: part\n });\n }\n\n public finalize(saveToStorage?: boolean): Promise {\n return this.serviceMessagePort.invoke('downloadFinalize', this.downloadId).then(() => undefined);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport deferredPromise from '../../helpers/cancellablePromise';\nimport makeError from '../../helpers/makeError';\nimport fileNameRFC from '../../helpers/string/fileNameRFC';\nimport {getServiceMessagePort} from '../mtproto/mtproto.worker';\nimport DownloadWriter from './downloadWriter';\nimport FileStorage from './fileStorage';\n\nexport default class DownloadStorage implements FileStorage {\n public getFile(fileName: string): Promise {\n return Promise.reject(makeError('NO_ENTRY_FOUND'));\n }\n\n public prepareWriting({fileName, downloadId, size}: {\n fileName: string,\n downloadId: string,\n size: number\n }) {\n const headers = {\n 'Content-Type': 'application/octet-stream; charset=utf-8',\n 'Content-Disposition': 'attachment; filename*=UTF-8\\'\\'' + fileNameRFC(fileName),\n ...(size ? {'Content-Length': size} : {})\n };\n\n const serviceMessagePort = getServiceMessagePort();\n const promise = serviceMessagePort.invoke('download', {\n headers,\n id: downloadId\n });\n\n const deferred = deferredPromise();\n deferred.cancel = () => {\n deferred.reject(makeError('DOWNLOAD_CANCELED'));\n };\n\n deferred.catch(() => {\n getServiceMessagePort().invoke('downloadCancel', downloadId);\n });\n\n promise.then(deferred.resolve, deferred.reject);\n\n return {\n deferred,\n getWriter: () => {\n return new DownloadWriter(serviceMessagePort, downloadId);\n }\n };\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {ReferenceBytes} from './referenceDatabase';\nimport Modes from '../../config/modes';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport {randomLong} from '../../helpers/random';\nimport {Document, InputFile, InputFileLocation, InputWebFileLocation, Photo, PhotoSize, UploadFile, UploadWebFile, VideoSize, WebDocument} from '../../layer';\nimport {DcId} from '../../types';\nimport CacheStorageController from '../files/cacheStorage';\nimport {logger, LogTypes} from '../logger';\nimport assumeType from '../../helpers/assumeType';\nimport noop from '../../helpers/noop';\nimport readBlobAsArrayBuffer from '../../helpers/blob/readBlobAsArrayBuffer';\nimport bytesToHex from '../../helpers/bytes/bytesToHex';\nimport findAndSplice from '../../helpers/array/findAndSplice';\nimport fixFirefoxSvg from '../../helpers/fixFirefoxSvg';\nimport {AppManager} from '../appManagers/manager';\nimport {getEnvironment} from '../../environment/utils';\nimport MTProtoMessagePort from './mtprotoMessagePort';\nimport getFileNameForUpload from '../../helpers/getFileNameForUpload';\nimport type {Progress} from '../appManagers/appDownloadManager';\nimport getDownloadMediaDetails from '../appManagers/utils/download/getDownloadMediaDetails';\n// import networkStats from './networkStats';\nimport getDownloadFileNameFromOptions from '../appManagers/utils/download/getDownloadFileNameFromOptions';\nimport StreamWriter from '../files/streamWriter';\nimport FileStorage from '../files/fileStorage';\nimport {MAX_FILE_SAVE_SIZE} from './mtproto_config';\nimport throttle from '../../helpers/schedulers/throttle';\nimport makeError from '../../helpers/makeError';\nimport readBlobAsUint8Array from '../../helpers/blob/readBlobAsUint8Array';\nimport DownloadStorage from '../files/downloadStorage';\nimport copy from '../../helpers/object/copy';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport {EXTENSION_MIME_TYPE_MAP, MIME_TYPE_EXTENSION_MAP} from '../../environment/mimeTypeMap';\nimport {getServiceMessagePort} from './mtproto.worker';\n\ntype Delayed = {\n offset: number,\n writePromise: CancellablePromise,\n writeDeferred: CancellablePromise\n};\n\nexport type DownloadOptions = {\n dcId: DcId,\n location: InputFileLocation | InputWebFileLocation,\n size?: number,\n fileName?: string,\n mimeType?: MTMimeType,\n limitPart?: number,\n queueId?: number,\n onlyCache?: boolean,\n downloadId?: string\n // getFileMethod: Parameters[1]\n};\n\nexport type DownloadMediaOptions = {\n media: Photo.photo | Document.document | WebDocument,\n thumb?: PhotoSize | Extract,\n queueId?: number,\n onlyCache?: boolean,\n downloadId?: string\n};\n\ntype DownloadPromise = CancellablePromise;\n\nexport type MyUploadFile = UploadFile.uploadFile | UploadWebFile.uploadWebFile;\n\n// export interface RefreshReferenceTask extends WorkerTaskVoidTemplate {\n// type: 'refreshReference',\n// payload: ReferenceBytes,\n// };\n\n// export interface RefreshReferenceTaskResponse extends WorkerTaskVoidTemplate {\n// type: 'refreshReference',\n// payload: ReferenceBytes,\n// originalPayload: ReferenceBytes\n// };\n\nconst MAX_DOWNLOAD_FILE_PART_SIZE = 1 * 1024 * 1024;\nconst MAX_UPLOAD_FILE_PART_SIZE = 512 * 1024;\nconst MIN_PART_SIZE = 128 * 1024;\nconst AVG_PART_SIZE = 512 * 1024;\n\nconst REGULAR_DOWNLOAD_DELTA = (9 * 512 * 1024) / MIN_PART_SIZE;\n// const PREMIUM_DOWNLOAD_DELTA = REGULAR_DOWNLOAD_DELTA * 2;\nconst PREMIUM_DOWNLOAD_DELTA = (56 * 512 * 1024) / MIN_PART_SIZE;\n\nconst IGNORE_ERRORS: Set = new Set([\n 'DOWNLOAD_CANCELED',\n 'UPLOAD_CANCELED',\n 'UNKNOWN',\n 'NO_NEW_CONTEXT'\n]);\n\nexport class ApiFileManager extends AppManager {\n private cacheStorage = new CacheStorageController('cachedFiles');\n private downloadStorage = new DownloadStorage();\n\n private downloadPromises: {\n [fileName: string]: DownloadPromise\n } = {};\n\n // private downloadToDiscPromises: {\n // [fileName: string]: DownloadPromise\n // } = {};\n\n private uploadPromises: {\n [fileName: string]: CancellablePromise\n } = {};\n\n private downloadPulls: {\n [dcId: string]: Array<{\n id: number,\n queueId: number,\n cb: () => Promise,\n deferred: {\n resolve: (...args: any[]) => void,\n reject: (...args: any[]) => void\n },\n activeDelta: number\n }>\n } = {};\n private downloadActives: {[dcId: string]: number} = {};\n\n public refreshReferencePromises: {\n [referenceHex: string]: {\n deferred: CancellablePromise,\n timeout?: number\n }\n } = {};\n\n private log: ReturnType = logger('AFM', LogTypes.Error | LogTypes.Log);\n private tempId = 0;\n private queueId = 0;\n private debug = Modes.debug;\n\n private maxUploadParts = 4000;\n private maxDownloadParts = 8000;\n private webFileDcId: DcId;\n\n protected after() {\n setInterval(() => { // clear old promises\n for(const hex in this.refreshReferencePromises) {\n const {deferred} = this.refreshReferencePromises[hex];\n if(deferred.isFulfilled || deferred.isRejected) {\n delete this.refreshReferencePromises[hex];\n }\n }\n }, 1800e3);\n\n this.rootScope.addEventListener('config', (config) => {\n this.webFileDcId = config.webfile_dc_id;\n });\n\n this.rootScope.addEventListener('app_config', (appConfig) => {\n this.maxUploadParts = this.rootScope.premium ? appConfig.upload_max_fileparts_premium : appConfig.upload_max_fileparts_default;\n this.maxDownloadParts = appConfig.upload_max_fileparts_premium;\n });\n }\n\n private downloadRequest(dcId: 'upload', id: number, cb: () => Promise, activeDelta: number, queueId?: number): Promise;\n private downloadRequest(dcId: number, id: number, cb: () => Promise, activeDelta: number, queueId?: number): Promise;\n private downloadRequest(dcId: number | string, id: number, cb: () => Promise, activeDelta: number, queueId: number = 0) {\n if(this.downloadPulls[dcId] === undefined) {\n this.downloadPulls[dcId] = [];\n this.downloadActives[dcId] = 0;\n }\n\n const downloadPull = this.downloadPulls[dcId];\n\n const promise = new Promise((resolve, reject) => {\n downloadPull.push({id, queueId, cb, deferred: {resolve, reject}, activeDelta});\n });\n\n setTimeout(() => {\n this.downloadCheck(dcId);\n }, 0);\n\n return promise;\n }\n\n private downloadCheck(dcId: string | number) {\n const downloadPull = this.downloadPulls[dcId];\n const downloadLimit = /* dcId === 'upload' ? 24 : */(this.rootScope.premium ? PREMIUM_DOWNLOAD_DELTA : REGULAR_DOWNLOAD_DELTA);\n // const downloadLimit = Infinity;\n\n if(this.downloadActives[dcId] >= downloadLimit || !downloadPull?.length) {\n return false;\n }\n\n // const data = downloadPull.shift();\n const data = findAndSplice(downloadPull, (d) => d.queueId === 0) || findAndSplice(downloadPull, (d) => d.queueId === this.queueId) || downloadPull.shift();\n const activeDelta = data.activeDelta || 1;\n\n this.downloadActives[dcId] += activeDelta;\n\n const promise = data.cb();\n // const networkPromise = networkStats.waitForChunk(dcId as DcId, activeDelta * MIN_PART_SIZE);\n /* Promise.race([\n promise\n // networkPromise\n ]) */promise.then(() => {\n this.downloadActives[dcId] -= activeDelta;\n this.downloadCheck(dcId);\n\n // networkPromise.resolve();\n }, (error: ApiError) => {\n if(!error?.type || !IGNORE_ERRORS.has(error.type)) {\n this.log.error('downloadCheck error:', error);\n }\n\n this.downloadActives[dcId] -= activeDelta;\n this.downloadCheck(dcId);\n\n // networkPromise.reject(error);\n }).finally(() => {\n promise.then(data.deferred.resolve, data.deferred.reject);\n });\n }\n\n public setQueueId(queueId: number) {\n // this.log.error('setQueueId', queueId);\n this.queueId = queueId;\n }\n\n private getFileStorage() {\n return this.cacheStorage;\n }\n\n public cancelDownload(fileName: string) {\n const promises = [this.downloadPromises[fileName], this.uploadPromises[fileName]].filter(Boolean);\n let canceled = false;\n for(let i = 0, length = promises.length; i < length; ++i) {\n const promise = promises[i];\n if(promise && !promise.isRejected && !promise.isFulfilled) {\n promise.cancel();\n canceled = true;\n }\n }\n\n return canceled;\n }\n\n public requestWebFilePart(\n dcId: DcId,\n location: InputWebFileLocation,\n offset: number,\n limit: number,\n id = 0,\n queueId = 0,\n checkCancel?: () => void\n ) {\n return this.downloadRequest(dcId, id, async() => { // do not remove async, because checkCancel will throw an error\n checkCancel?.();\n\n if('url' in location) {\n const url = location.url;\n if(this.isLocalWebFile(url)) {\n return fetch(url)\n .then((response) => response.arrayBuffer())\n .then((arrayBuffer) => {\n const extension = url.split('.').pop() as MTFileExtension;\n const mimeType = EXTENSION_MIME_TYPE_MAP[extension] || 'application/octet-stream';\n return {\n _: 'upload.webFile',\n size: arrayBuffer.byteLength,\n mime_type: mimeType,\n file_type: {_: 'storage.fileUnknown'},\n mtime: 0,\n bytes: new Uint8Array(arrayBuffer)\n };\n });\n }\n }\n\n return this.apiManager.invokeApi('upload.getWebFile', {\n location,\n offset,\n limit\n }, {\n dcId,\n fileDownload: true\n });\n }, this.getDelta(limit), queueId);\n }\n\n public requestFilePart(\n dcId: DcId,\n location: InputFileLocation,\n offset: number,\n limit: number,\n id = 0,\n queueId = 0,\n checkCancel?: () => void\n ) {\n return this.downloadRequest(dcId, id, async() => { // do not remove async, because checkCancel will throw an error\n checkCancel?.();\n\n const invoke = async(): Promise => {\n checkCancel?.(); // do not remove async, because checkCancel will throw an error\n\n // * IMPORTANT: reference can be changed in previous request\n const reference = (location as InputFileLocation.inputDocumentFileLocation).file_reference?.slice();\n\n const promise = // pause(offset > (100 * 1024 * 1024) ? 10000000 : 0).then(() =>\n this.apiManager.invokeApi('upload.getFile', {\n location,\n offset,\n limit\n }, {\n dcId,\n fileDownload: true\n }) as Promise/* ) */;\n\n return promise.catch((err: ApiError) => {\n checkCancel?.();\n\n if(err.type === 'FILE_REFERENCE_EXPIRED') {\n return this.refreshReference(location as InputFileLocation.inputDocumentFileLocation, reference).then(invoke);\n }\n\n throw err;\n });\n };\n\n assumeType(location);\n const reference = location.file_reference;\n if(reference && !location.checkedReference) { // check stream's location because it's new every call\n location.checkedReference = true;\n const hex = bytesToHex(reference);\n if(this.refreshReferencePromises[hex]) {\n return this.refreshReference(location, reference).then(invoke);\n }\n }\n\n return invoke();\n }, this.getDelta(limit), queueId);\n }\n\n /* private convertBlobToBytes(blob: Blob) {\n return blob.arrayBuffer().then((buffer) => new Uint8Array(buffer));\n } */\n\n private getDelta(bytes: number) {\n return bytes / MIN_PART_SIZE;\n }\n\n private getLimitPart(size: number, isUpload: boolean): number {\n if(!size) { // * sometimes size can be 0 (e.g. avatars, webDocuments)\n return AVG_PART_SIZE;\n }\n\n // return 1 * 1024 * 1024;\n\n let bytes = MIN_PART_SIZE;\n\n const maxParts = isUpload ? this.maxUploadParts : this.maxDownloadParts;\n const maxPartSize = isUpload ? MAX_UPLOAD_FILE_PART_SIZE : MAX_DOWNLOAD_FILE_PART_SIZE;\n // usually it will stick to 512Kb size if the file is too big\n while((size / bytes) > maxParts && bytes < maxPartSize) {\n bytes *= 2;\n }\n /* if(size < 1e6 || !size) bytes = 512;\n else if(size < 3e6) bytes = 256;\n else bytes = 128; */\n\n return bytes;\n }\n\n private uncompressTGS = (bytes: Uint8Array, fileName: string) => {\n // this.log('uncompressTGS', bytes, bytes.slice().buffer);\n // slice нужен потому что в uint8array - 5053 length, в arraybuffer - 5084\n return this.cryptoWorker.invokeCrypto('gzipUncompress', bytes.slice().buffer, false) as Promise;\n };\n\n private uncompressTGV = (bytes: Uint8Array, fileName: string) => {\n // this.log('uncompressTGS', bytes, bytes.slice().buffer);\n // slice нужен потому что в uint8array - 5053 length, в arraybuffer - 5084\n const buffer = bytes.slice().buffer;\n if(getEnvironment().IS_FIREFOX) {\n return this.cryptoWorker.invokeCrypto('gzipUncompress', buffer, true).then((text) => {\n return fixFirefoxSvg(text as string);\n }).then((text) => {\n const textEncoder = new TextEncoder();\n return textEncoder.encode(text);\n });\n }\n\n return this.cryptoWorker.invokeCrypto('gzipUncompress', buffer, false) as Promise;\n };\n\n private convertWebp = (bytes: Uint8Array, fileName: string) => {\n const instance = MTProtoMessagePort.getInstance();\n return instance.invoke('convertWebp', {fileName, bytes});\n };\n\n private convertOpus = (bytes: Uint8Array, fileName: string) => {\n const instance = MTProtoMessagePort.getInstance();\n return instance.invoke('convertOpus', {fileName, bytes});\n };\n\n private refreshReference(\n inputFileLocation: InputFileLocation.inputDocumentFileLocation,\n reference: typeof inputFileLocation['file_reference'],\n hex = bytesToHex(reference)\n ) {\n let r = this.refreshReferencePromises[hex];\n if(!r) {\n const deferred = deferredPromise();\n\n r = this.refreshReferencePromises[hex] = {\n deferred\n\n // ! I don't remember what it was for...\n // timeout: ctx.setTimeout(() => {\n // this.log.error('Didn\\'t refresh the reference:', inputFileLocation);\n // deferred.reject(makeError('REFERENCE_IS_NOT_REFRESHED'));\n // }, 60000)\n };\n\n // deferred.catch(noop).finally(() => {\n // clearTimeout(r.timeout);\n // });\n\n this.referenceDatabase.refreshReference(reference).then((reference) => {\n if(hex === bytesToHex(reference)) {\n deferred.reject(makeError('REFERENCE_IS_NOT_REFRESHED'));\n }\n\n deferred.resolve(reference);\n }, deferred.reject);\n }\n\n // have to replace file_reference in any way, because location can be different everytime if it's stream\n return r.deferred.then((reference) => {\n inputFileLocation.file_reference = reference;\n });\n }\n\n public isDownloading(fileName: string) {\n return !!this.downloadPromises[fileName];\n }\n\n public getDownload(fileName: string) {\n return this.downloadPromises[fileName];\n }\n\n public getUpload(fileName: string) {\n return this.uploadPromises[fileName];\n }\n\n private getConvertMethod(mimeType: MTMimeType) {\n let process: ApiFileManager['uncompressTGS'] | ApiFileManager['convertWebp'];\n if(mimeType === 'application/x-tgwallpattern') {\n process = this.uncompressTGV;\n mimeType = 'image/svg+xml';\n } else if(mimeType === 'image/webp' && !getEnvironment().IS_WEBP_SUPPORTED) {\n process = this.convertWebp;\n mimeType = 'image/png';\n } else if(mimeType === 'application/x-tgsticker') {\n process = this.uncompressTGS;\n mimeType = 'application/json';\n } else if(mimeType === 'audio/ogg' && !getEnvironment().IS_OPUS_SUPPORTED) {\n process = this.convertOpus;\n mimeType = 'audio/wav';\n }\n\n return {mimeType, process};\n }\n\n private allocateDeferredPromises(startOffset: number, size: number, limitPart: number) {\n const delayed: Delayed[] = [];\n let offset = startOffset;\n let writePromise: CancellablePromise = Promise.resolve(),\n writeDeferred: CancellablePromise;\n do {\n writeDeferred = deferredPromise();\n delayed.push({offset, writePromise, writeDeferred});\n writePromise = writeDeferred;\n offset += limitPart;\n } while(offset < size);\n\n return delayed;\n }\n\n private isLocalWebFile(url: string) {\n return url.startsWith('assets/');\n }\n\n public download(options: DownloadOptions): DownloadPromise {\n const size = options.size ?? 0;\n const {dcId, location} = options;\n let {downloadId} = options;\n if(downloadId && !getServiceMessagePort()) {\n this.log.error('download fallback to blob', options);\n downloadId = undefined;\n }\n\n const originalMimeType = options.mimeType;\n const convertMethod = this.getConvertMethod(originalMimeType);\n const {process} = convertMethod;\n options.mimeType = convertMethod.mimeType || 'image/jpeg';\n\n const fileName = getDownloadFileNameFromOptions(options);\n const cacheFileName = downloadId ? getDownloadFileNameFromOptions({...copy(options), downloadId: undefined}) : fileName;\n const cacheStorage: FileStorage = this.getFileStorage();\n const downloadStorage: FileStorage = downloadId ? this.downloadStorage : undefined;\n let deferred: DownloadPromise = downloadId ? undefined : this.downloadPromises[fileName];\n\n this.debug && this.log('downloadFile', fileName, options);\n\n if(deferred) {\n return deferred;\n }\n\n // if(deferred) {\n // if(size) {\n // return deferred.then(async(blob) => {\n // if(blob instanceof Blob && blob.size < size) {\n // this.debug && this.log('downloadFile need to deleteFile, wrong size:', blob.size, size);\n\n // try {\n // await this.delete(fileName);\n // } finally {\n // return this.download(options);\n // }\n // } else {\n // return blob;\n // }\n // });\n // } else {\n // return deferred;\n // }\n // }\n\n const errorHandler = (item: typeof cachePrepared, error: ApiError) => {\n if(item?.error) {\n return;\n }\n\n for(const p of prepared) {\n if(item && item !== p) {\n continue;\n }\n\n p.error = error;\n p.deferred.reject(error);\n }\n };\n\n const isWebFile = location._ === 'inputWebFileLocation';\n const isLocalWebFile = isWebFile && this.isLocalWebFile(location.url);\n const id = this.tempId++;\n const limitPart = isLocalWebFile ?\n size :\n options.limitPart || this.getLimitPart(size, false);\n\n let getFile: FileStorage['getFile'] = cacheStorage.getFile.bind(cacheStorage);\n\n let cachePrepared: ReturnType & {writer?: StreamWriter, error?: ApiError},\n downloadPrepared: typeof cachePrepared;\n const prepared: (typeof cachePrepared)[] = [];\n const possibleSize = size || limitPart;\n\n const getErrorsCount = () => prepared.reduce((acc, item) => acc + +!!item.error, 0);\n\n const attach = (item: typeof cachePrepared, fileName: string) => {\n const {deferred} = item;\n const _errorHandler = errorHandler.bind(null, item);\n\n deferred.cancel = () => deferred.reject(makeError('DOWNLOAD_CANCELED'));\n deferred.catch((error) => {\n _errorHandler(error);\n item.writer?.truncate?.();\n }).finally(() => {\n if(this.downloadPromises[fileName] === deferred) {\n delete this.downloadPromises[fileName];\n }\n\n delete item.writer;\n // indexOfAndSplice(prepared, item);\n });\n\n this.downloadPromises[fileName] = deferred;\n\n prepared.push(item);\n };\n\n if(cacheStorage && (!downloadStorage || possibleSize <= MAX_FILE_SAVE_SIZE)) {\n cachePrepared = cacheStorage.prepareWriting(cacheFileName, possibleSize, options.mimeType)\n attach(cachePrepared, cacheFileName);\n }\n\n if(downloadStorage) {\n let downloadFileName = options.fileName; // it's doc file_name\n if(!downloadFileName) {\n downloadFileName = cacheFileName;\n const ext = MIME_TYPE_EXTENSION_MAP[options.mimeType];\n if(ext) {\n downloadFileName += '.' + ext;\n }\n }\n\n downloadPrepared = downloadStorage.prepareWriting({\n fileName: downloadFileName,\n downloadId,\n size: possibleSize\n });\n attach(downloadPrepared, fileName);\n\n if(cachePrepared) { // cancel cache too\n downloadPrepared.deferred.catch((err) => cachePrepared.deferred.reject(err));\n }\n\n // this.downloadToDiscPromises[cacheFileName] = deferred;\n // deferred.catch(noop).finally(() => {\n // if(this.downloadToDiscPromises[cacheFileName] === deferred) {\n // delete this.downloadToDiscPromises[cacheFileName];\n // }\n // });\n }\n\n deferred = downloadPrepared?.deferred ?? cachePrepared.deferred;\n\n if(downloadStorage && process) { // then have to load file again\n getFile = downloadStorage.getFile.bind(downloadStorage);\n }\n\n getFile(cacheFileName).then(async(blob: Blob) => {\n checkCancel();\n\n // if(blob.size < size) {\n // if(!options.onlyCache) {\n // await this.delete(cacheFileName);\n // checkCancel();\n // }\n\n // throw makeError('NO_ENTRY_FOUND');\n // }\n\n if(downloadPrepared) {\n const writer = downloadPrepared.writer = downloadPrepared.getWriter();\n checkCancel();\n\n const arr = await readBlobAsUint8Array(blob);\n checkCancel();\n await writer.write(arr);\n checkCancel();\n\n downloadPrepared.deferred.resolve(await writer.finalize());\n }\n\n if(cachePrepared) {\n cachePrepared.deferred.resolve(blob);\n }\n }).catch(async(err: ApiError) => {\n if(options.onlyCache) {\n errorHandler(null, err);\n return;\n }\n\n prepared.forEach((p) => {\n p.writer = p.getWriter();\n });\n\n const maxRequests = Infinity;\n\n const requestPart = (isWebFile ? this.requestWebFilePart : this.requestFilePart).bind(this);\n\n if(isWebFile && this.webFileDcId === undefined && !isLocalWebFile) {\n await this.apiManager.getConfig();\n checkCancel();\n }\n\n const delayed = this.allocateDeferredPromises(0, size, limitPart);\n\n const progress: Progress = {done: 0, offset: 0, total: size, fileName};\n const dispatchProgress = () => {\n try {\n checkCancel();\n progress.done = done;\n this.rootScope.dispatchEvent('download_progress', progress);\n } catch(err) {}\n };\n\n const throttledDispatchProgress = throttle(dispatchProgress, 50, true);\n\n let done = 0;\n const superpuper = async() => {\n const {offset, writePromise, writeDeferred} = delayed.shift();\n try {\n checkCancel();\n\n const requestPerf = performance.now();\n const result = await requestPart(dcId, location as any, offset, limitPart, id, options.queueId, checkCancel);\n const requestTime = performance.now() - requestPerf;\n\n const bytes = result.bytes;\n\n if(delayed.length) {\n superpuper();\n }\n\n const byteLength = bytes.byteLength;\n this.debug && this.log('downloadFile requestFilePart result:', fileName, result);\n const isFinal = (offset + limitPart) >= size || !byteLength;\n if(byteLength) {\n done += byteLength;\n\n if(isFinal) {\n dispatchProgress();\n } else {\n throttledDispatchProgress();\n }\n\n const writeQueuePerf = performance.now();\n await writePromise;\n checkCancel();\n const writeQueueTime = performance.now() - writeQueuePerf;\n\n const perf = performance.now();\n await Promise.all(prepared.map(({writer}) => writer?.write(bytes, offset)));\n checkCancel();\n // downloadId && this.log('write time', performance.now() - perf, 'request time', requestTime, 'queue time', writeQueueTime);\n }\n\n if(isFinal) {\n if(!size || done < size) {\n prepared.forEach(({writer}) => writer?.trim?.(done));\n }\n }\n\n if(isFinal && process) {\n const promises = prepared\n .filter(({writer}) => writer?.getParts && writer.replaceParts)\n .map(async({writer}) => {\n const bytes = writer.getParts();\n const processedResult = await process(bytes, cacheFileName);\n writer.replaceParts(processedResult);\n });\n\n await Promise.all(promises);\n checkCancel();\n }\n\n writeDeferred.resolve();\n\n if(isFinal) {\n const saveToStorage = done <= MAX_FILE_SAVE_SIZE;\n prepared.forEach((item) => {\n const {deferred, writer} = item;\n if(deferred.isFulfilled || deferred.isRejected || !writer) {\n return;\n }\n\n const result = writer.finalize(saveToStorage);\n deferred.resolve(result);\n });\n }\n } catch(err) {\n errorHandler(null, err as ApiError);\n }\n };\n\n for(let i = 0, length = Math.min(maxRequests, delayed.length); i < length; ++i) {\n superpuper();\n }\n }).catch(noop);\n\n const checkCancel = () => {\n if(getErrorsCount() === prepared.length) {\n throw prepared[0].error;\n }\n };\n\n return deferred;\n }\n\n public downloadMedia(options: DownloadMediaOptions): DownloadPromise {\n let {media, thumb} = options;\n const isPhoto = media._ === 'photo';\n if(isPhoto && !thumb) {\n return Promise.reject('preloadPhoto photoEmpty!');\n }\n\n // get original instance with correct file_reference instead of using copies\n const isDocument = media._ === 'document';\n // const isWebDocument = media._ === 'webDocument';\n if(isDocument) media = this.appDocsManager.getDoc((media as Document.document).id);\n else if(isPhoto) media = this.appPhotosManager.getPhoto((media as Photo.photo).id);\n\n const {fileName, downloadOptions} = getDownloadMediaDetails(options);\n\n let promise = this.getDownload(fileName);\n if(!promise) {\n promise = this.download(downloadOptions);\n\n if(isDocument && !thumb) {\n this.rootScope.dispatchEvent('document_downloading', (media as Document.document).id);\n promise.then(() => {\n this.rootScope.dispatchEvent('document_downloaded', (media as Document.document).id);\n }).catch(noop);\n }\n }\n\n return promise;\n }\n\n public downloadMediaURL(options: DownloadMediaOptions): Promise {\n const {media, thumb} = options;\n\n let cacheContext = this.thumbsStorage.getCacheContext(media as any, thumb?.type);\n if((thumb ? (cacheContext.downloaded >= ('size' in thumb ? thumb.size : 0)) : true) && cacheContext.url) {\n return Promise.resolve(cacheContext.url);\n }\n\n return this.downloadMedia(options).then((blob) => {\n if(!cacheContext.downloaded || cacheContext.downloaded < blob.size) {\n const url = URL.createObjectURL(blob);\n cacheContext = this.thumbsStorage.setCacheContextURL(media as any, cacheContext.type, url, blob.size);\n }\n\n return cacheContext.url;\n });\n }\n\n public downloadMediaVoid(options: DownloadMediaOptions) {\n return this.downloadMedia(options).then(noop);\n }\n\n private delete(fileName: string) {\n delete this.downloadPromises[fileName];\n return this.getFileStorage().delete(fileName);\n }\n\n public upload({file, fileName}: {file: Blob | File, fileName?: string}) {\n fileName ||= getFileNameForUpload(file);\n\n const fileSize = file.size;\n const isBigFile = fileSize >= 10485760;\n const partSize = this.getLimitPart(fileSize, true);\n const activeDelta = this.getDelta(partSize);\n const totalParts = Math.ceil(fileSize / partSize);\n const fileId = randomLong();\n const resultInputFile: InputFile = {\n _: isBigFile ? 'inputFileBig' : 'inputFile',\n id: fileId as any,\n parts: totalParts,\n name: fileName,\n md5_checksum: ''\n };\n\n const deferred = deferredPromise();\n if(totalParts > this.maxUploadParts) {\n deferred.reject(makeError('FILE_TOO_BIG'));\n return deferred;\n }\n\n let canceled = false, resolved = false;\n let errorHandler = (error: ApiError) => {\n if(error?.type !== 'UPLOAD_CANCELED') {\n this.log.error('Up Error', error);\n }\n\n deferred.reject(error);\n canceled = true;\n errorHandler = noop;\n };\n\n const method = isBigFile ? 'upload.saveBigFilePart' : 'upload.saveFilePart';\n const id = this.tempId++;\n\n const self = this;\n function* generator() {\n let _part = 0, doneParts = 0;\n for(let offset = 0; offset < fileSize; offset += partSize) {\n const part = _part++; // 0, 1\n yield self.downloadRequest('upload', id, async() => {\n checkCancel();\n\n const blob = file.slice(offset, offset + partSize);\n const buffer = await readBlobAsArrayBuffer(blob);\n checkCancel();\n\n self.debug && self.log('Upload file part, isBig:', isBigFile, part, buffer.byteLength, new Uint8Array(buffer).length, new Uint8Array(buffer).slice().length);\n\n return self.apiManager.invokeApi(method, {\n file_id: fileId,\n file_part: part,\n file_total_parts: totalParts,\n bytes: buffer\n } as any, {\n fileUpload: true\n }).then(() => {\n if(canceled) {\n return;\n }\n\n ++doneParts;\n const progress: Progress = {done: doneParts * partSize, offset, total: fileSize, fileName};\n deferred.notify(progress);\n\n if(doneParts >= totalParts) {\n deferred.resolve(resultInputFile);\n resolved = true;\n }\n }, errorHandler);\n }, activeDelta).catch(errorHandler);\n }\n }\n\n const it = generator();\n const process = () => {\n if(canceled) return;\n const r = it.next();\n if(r.done || canceled) return;\n (r.value as Promise).then(process);\n };\n\n const maxRequests = Infinity;\n for(let i = 0, length = Math.min(maxRequests, totalParts); i < length; ++i) {\n process();\n }\n\n const checkCancel = () => {\n if(canceled) {\n throw makeError('UPLOAD_CANCELED');\n }\n };\n\n deferred.cancel = () => {\n if(!canceled && !resolved) {\n canceled = true;\n errorHandler(makeError('UPLOAD_CANCELED'));\n }\n };\n\n deferred.notify = (progress: Progress) => {\n this.rootScope.dispatchEvent('download_progress', progress);\n };\n\n deferred.finally(() => {\n if(this.uploadPromises[fileName] === deferred) {\n delete this.uploadPromises[fileName];\n }\n });\n\n return this.uploadPromises[fileName] = deferred;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function fixFirefoxSvg(text: string) {\n const svgIndex = text.indexOf('/, ` width=\"${width}\" height=\"${height}\">`).replace(/[^\\x00-\\x7F]/g, '');\n return text;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport readBlobAsArrayBuffer from './readBlobAsArrayBuffer';\n\nexport default function readBlobAsUint8Array(blob: Blob) {\n return readBlobAsArrayBuffer(blob).then((buffer) => new Uint8Array(buffer));\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ctx from '../../environment/ctx';\nimport callbackify from '../../helpers/callbackify';\nimport {ignoreRestrictionReasons} from '../../helpers/restrictions';\nimport {Config, MethodDeclMap, User} from '../../layer';\nimport {InvokeApiOptions} from '../../types';\nimport {AppManager} from '../appManagers/manager';\nimport {MTAppConfig} from './appConfig';\nimport {UserAuth} from './mtproto_config';\nimport {MTMessage} from './networker';\n\ntype HashResult = {\n hash: number,\n result: any\n};\n\ntype HashOptions = {\n [queryJSON: string]: HashResult\n};\n\nexport type ApiLimitType = 'pin' | 'folderPin' | 'folders' |\n 'favedStickers' | 'reactions' | 'bio' | 'topicPin' | 'caption';\n\nexport default abstract class ApiManagerMethods extends AppManager {\n private afterMessageIdTemp: number;\n private hashes: {[method: string]: HashOptions} = {};\n private apiPromisesSingleProcess: {\n [q: string]: Map>\n } = {};\n private apiPromisesSingle: {\n [q: string]: Promise\n } = {};\n private apiPromisesCacheable: {\n [method: string]: {\n [queryJSON: string]: {\n timestamp: number,\n promise: Promise,\n fulfilled: boolean,\n timeout?: number,\n params: any\n }\n }\n } = {};\n\n protected config: Config;\n protected appConfig: MTAppConfig;\n\n constructor() {\n super();\n this.afterMessageIdTemp = 0;\n }\n\n abstract setUserAuth(userAuth: UserAuth | UserId): Promise;\n\n public setUser(user: User) {\n // appUsersManager.saveApiUser(user);\n return this.setUserAuth(user.id);\n }\n\n abstract invokeApi(method: T, params?: MethodDeclMap[T]['req'], options?: InvokeApiOptions): Promise;\n\n public invokeApiAfter(method: T, params: MethodDeclMap[T]['req'] = {}, options: InvokeApiOptions = {}): Promise {\n let o = options;\n o.prepareTempMessageId = '' + ++this.afterMessageIdTemp;\n\n o = {...options};\n (options as MTMessage).messageId = o.prepareTempMessageId;\n\n // console.log('will invokeApi:', method, params, options);\n return this.invokeApi(method, params, o);\n }\n\n public invokeApiHashable(o: {\n method: T,\n processResult?: (response: MethodDeclMap[T]['res']) => R,\n processError?: (error: ApiError) => any,\n params?: Omit,\n options?: InvokeApiOptions & {cacheKey?: string},\n overwrite?: boolean\n }) {\n // @ts-ignore\n o.params ??= {};\n o.options ??= {};\n // console.log('will invokeApi:', method, params, options);\n\n const {params, options, method, overwrite} = o;\n\n const queryJSON = JSON.stringify(params);\n let cached: HashResult;\n if(this.hashes[method]) {\n cached = this.hashes[method][queryJSON];\n if(cached) {\n if(overwrite) {\n delete this.hashes[method][queryJSON];\n cached = undefined;\n } else {\n (params as any).hash = cached.hash;\n }\n }\n }\n\n return this.invokeApiSingleProcess({\n method,\n processResult: (result) => {\n if(result._.includes('NotModified')) {\n // this.debug && this.log.warn('NotModified saved!', method, queryJSON);\n return cached.result;\n }\n\n if(result.hash/* || result.messages */) {\n const hash = result.hash/* || this.computeHash(result.messages) */;\n\n if(!this.hashes[method]) this.hashes[method] = {};\n cached = this.hashes[method][queryJSON] = {\n hash,\n result\n };\n }\n\n if(o.processResult) {\n const newResult = o.processResult(result);\n return cached ? cached.result = newResult : newResult;\n }\n\n return result;\n },\n params,\n options\n });\n }\n\n public invokeApiSingle(method: T, params: MethodDeclMap[T]['req'] = {} as any, options: InvokeApiOptions = {}): Promise {\n const q = method + '-' + JSON.stringify(params);\n const cache = this.apiPromisesSingle;\n if(cache[q]) {\n return cache[q];\n }\n\n return cache[q] = this.invokeApi(method, params, options).finally(() => {\n delete cache[q];\n });\n }\n\n public invokeApiSingleProcess(o: {\n method: T,\n processResult: (response: MethodDeclMap[T]['res']) => R,\n processError?: (error: ApiError) => any,\n params?: MethodDeclMap[T]['req'],\n options?: InvokeApiOptions & {cacheKey?: string, overwrite?: boolean}\n }): Promise> {\n o.params ??= {};\n o.options ??= {};\n\n const {method, processResult, processError, params, options} = o;\n const cache = this.apiPromisesSingleProcess;\n const cacheKey = options.cacheKey || JSON.stringify(params);\n const map = cache[method] ?? (cache[method] = new Map());\n const oldPromise = map.get(cacheKey);\n if(oldPromise) {\n return oldPromise;\n }\n\n const getNewPromise = () => {\n const promise = map.get(cacheKey);\n return promise === p ? undefined : promise;\n }\n\n const originalPromise = this.invokeApi(method, params, options);\n const newPromise: Promise> = originalPromise.then((result) => {\n return getNewPromise() || processResult(result);\n }, (error) => {\n const promise = getNewPromise();\n if(promise) {\n return promise;\n }\n\n if(!processError) {\n throw error;\n }\n\n return processError(error);\n });\n\n const p = newPromise.finally(() => {\n if(map.get(cacheKey) !== p) {\n return;\n }\n\n map.delete(cacheKey);\n if(!map.size) {\n delete cache[method];\n }\n });\n\n map.set(cacheKey, p);\n return p;\n }\n\n public invokeApiCacheable(method: T, params: MethodDeclMap[T]['req'] = {} as any, options: InvokeApiOptions & Partial<{cacheSeconds: number, override: boolean}> = {}): Promise {\n const cache = this.apiPromisesCacheable[method] ?? (this.apiPromisesCacheable[method] = {});\n const queryJSON = JSON.stringify(params);\n const item = cache[queryJSON];\n if(item && (!options.override || !item.fulfilled)) {\n return item.promise;\n }\n\n if(options.override) {\n if(item && item.timeout) {\n clearTimeout(item.timeout);\n delete item.timeout;\n }\n\n delete options.override;\n }\n\n let timeout: number;\n if(options.cacheSeconds) {\n timeout = ctx.setTimeout(() => {\n delete cache[queryJSON];\n }, options.cacheSeconds * 1000);\n delete options.cacheSeconds;\n }\n\n const promise = this.invokeApi(method, params, options);\n\n cache[queryJSON] = {\n timestamp: Date.now(),\n fulfilled: false,\n timeout,\n promise,\n params\n };\n\n return promise;\n }\n\n public clearCache(method: T, verify: (params: MethodDeclMap[T]['req']) => boolean) {\n const cache = this.apiPromisesCacheable[method];\n if(cache) {\n for(const queryJSON in cache) {\n const item = cache[queryJSON];\n try {\n if(verify(item.params)) {\n if(item.timeout) {\n clearTimeout(item.timeout);\n }\n\n delete cache[queryJSON];\n }\n } catch(err) {\n // this.log.error('clearCache error:', err, queryJSON, item);\n }\n }\n }\n }\n\n public getConfig(overwrite?: boolean) {\n if(this.config && !overwrite) {\n return this.config;\n }\n\n return this.invokeApiSingleProcess({\n method: 'help.getConfig',\n params: {},\n processResult: (config) => {\n this.config = config;\n this.rootScope.dispatchEvent('config', config);\n return config;\n },\n options: {overwrite}\n });\n }\n\n public getAppConfig(overwrite?: boolean) {\n if(this.appConfig && !overwrite) {\n return this.appConfig;\n }\n\n return this.invokeApiSingleProcess({\n method: 'help.getAppConfig',\n params: {},\n processResult: (config: MTAppConfig) => {\n this.appConfig = config;\n ignoreRestrictionReasons(config.ignore_restriction_reasons ?? []);\n this.rootScope.dispatchEvent('app_config', config);\n return config;\n },\n options: {overwrite}\n });\n }\n\n public getLimit(type: ApiLimitType, isPremium?: boolean) {\n return callbackify(this.getAppConfig(), (appConfig) => {\n const map: {[type in ApiLimitType]: [keyof MTAppConfig, keyof MTAppConfig] | keyof MTAppConfig} = {\n pin: ['dialogs_pinned_limit_default', 'dialogs_pinned_limit_premium'],\n folderPin: ['dialogs_folder_pinned_limit_default', 'dialogs_folder_pinned_limit_premium'],\n folders: ['dialog_filters_limit_default', 'dialog_filters_limit_premium'],\n favedStickers: ['stickers_faved_limit_default', 'stickers_faved_limit_premium'],\n reactions: ['reactions_user_max_default', 'reactions_user_max_premium'],\n bio: ['about_length_limit_default', 'about_length_limit_premium'],\n topicPin: 'topics_pinned_limit',\n caption: ['caption_length_limit_default', 'caption_length_limit_premium']\n };\n\n isPremium ??= this.rootScope.premium;\n\n const a = map[type];\n const key = Array.isArray(a) ? a[isPremium ? 1 : 0] : a;\n return appConfig[key] as number;\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\n \nimport transportController from './transports/controller';\nimport MTTransport from './transports/transport';\n \n\nimport type {UserAuth} from './mtproto_config';\nimport type {DcAuthKey, DcId, DcServerSalt, InvokeApiOptions} from '../../types';\nimport type {MethodDeclMap} from '../../layer';\nimport type TcpObfuscated from './transports/tcpObfuscated';\nimport sessionStorage from '../sessionStorage';\nimport MTPNetworker, {MTMessage} from './networker';\nimport {ConnectionType, constructTelegramWebSocketUrl, DcConfigurator, TransportType} from './dcConfigurator';\nimport {logger} from '../logger';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport App from '../../config/app';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport {IDB} from '../files/idb';\nimport CryptoWorker from '../crypto/cryptoMessagePort';\nimport ctx from '../../environment/ctx';\nimport noop from '../../helpers/noop';\nimport Modes from '../../config/modes';\nimport bytesFromHex from '../../helpers/bytes/bytesFromHex';\nimport bytesToHex from '../../helpers/bytes/bytesToHex';\nimport isObject from '../../helpers/object/isObject';\nimport pause from '../../helpers/schedulers/pause';\nimport ApiManagerMethods from './api_methods';\nimport {getEnvironment} from '../../environment/utils';\nimport toggleStorages from '../../helpers/toggleStorages';\nimport tsNow from '../../helpers/tsNow';\n\n/* class RotatableArray {\n public array: Array = [];\n private lastIndex = -1;\n\n public get() {\n this.lastIndex = clamp(this.lastIndex + 1, 0, this.array.length - 1);\n return this.array[this.lastIndex];\n }\n} */\n\nconst PREMIUM_FILE_NETWORKERS_COUNT = 6;\nconst REGULAR_FILE_NETWORKERS_COUNT = 3;\n\nexport class ApiManager extends ApiManagerMethods {\n private cachedNetworkers: {\n [transportType in TransportType]: {\n [connectionType in ConnectionType]: {\n [dcId: DcId]: MTPNetworker[]\n }\n }\n };\n\n private cachedExportPromise: {[x: number]: Promise};\n private gettingNetworkers: {[dcIdAndType: string]: Promise};\n private baseDcId: DcId;\n\n // public telegramMeNotified = false;\n\n private log: ReturnType;\n\n private afterMessageTempIds: {\n [tempId: string]: {\n messageId: string,\n promise: Promise\n }\n };\n\n private transportType: TransportType;\n\n private updatesProcessor: (obj: any) => void;\n\n private loggingOut: boolean;\n\n constructor() {\n super();\n this.log = logger('API');\n\n this.cachedNetworkers = {} as any;\n this.cachedExportPromise = {};\n this.gettingNetworkers = {};\n this.baseDcId = 0;\n this.afterMessageTempIds = {};\n\n this.transportType = Modes.transport;\n\n \n transportController.addEventListener('transport', (transportType) => {\n this.changeTransportType(transportType);\n });\n \n\n // * Make sure that the used autologin_token is no more than 10000 seconds old\n // * https://core.telegram.org/api/url-authorization\n const REFRESH_APP_CONFIG_INTERVAL = (10000 - 30) * 1000;\n setInterval(() => {\n this.getAppConfig(true);\n }, REFRESH_APP_CONFIG_INTERVAL);\n }\n\n protected after() {\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateConfig: () => {\n this.getConfig(true);\n this.getAppConfig(true);\n }\n });\n\n this.rootScope.addEventListener('user_auth', () => {\n if(this.config) { // refresh configs if had a config during authorization\n this.apiUpdatesManager.processLocalUpdate({_: 'updateConfig'});\n }\n });\n\n this.rootScope.addEventListener('premium_toggle', (isPremium) => {\n this.iterateNetworkers(({networker, connectionType, dcId, transportType}) => {\n if(connectionType === 'client' || transportType !== 'websocket') {\n return;\n }\n\n const transport = networker.transport;\n if(!transport) {\n this.log.error('wow what, no transport?', networker);\n return;\n }\n\n if((transport as TcpObfuscated).connection) {\n const url = constructTelegramWebSocketUrl(dcId, connectionType, isPremium);\n (transport as TcpObfuscated).changeUrl(url);\n }\n });\n });\n }\n\n // private lol = false;\n\n // constructor() {\n // MtpSingleInstanceService.start();\n\n /* AppStorage.get('dc').then((dcId) => {\n if(dcId) {\n this.baseDcId = dcId;\n }\n }); */\n // }\n\n /* public telegramMeNotify(newValue: boolean) {\n if(this.telegramMeNotified !== newValue) {\n this.telegramMeNotified = newValue;\n //telegramMeWebService.setAuthorized(this.telegramMeNotified);\n }\n } */\n\n private getTransportType(connectionType: ConnectionType) {\n \n \n \n \n \n // @ts-ignore\n const transportType: TransportType = this.transportType;\n \n\n return transportType;\n }\n\n private iterateNetworkers(callback: (o: {networker: MTPNetworker, dcId: DcId, connectionType: ConnectionType, transportType: TransportType, index: number, array: MTPNetworker[]}) => void) {\n for(const transportType in this.cachedNetworkers) {\n const connections = this.cachedNetworkers[transportType as TransportType];\n for(const connectionType in connections) {\n const dcs = connections[connectionType as ConnectionType];\n for(const dcId in dcs) {\n const networkers = dcs[dcId as any as DcId];\n networkers.forEach((networker, idx, arr) => {\n callback({\n networker,\n dcId: +dcId as DcId,\n connectionType: connectionType as ConnectionType,\n transportType: transportType as TransportType,\n index: idx,\n array: arr\n });\n });\n }\n }\n }\n }\n\n private chooseServer(dcId: DcId, connectionType: ConnectionType, transportType: TransportType) {\n return this.dcConfigurator.chooseServer(dcId, connectionType, transportType, connectionType === 'client', this.rootScope.premium);\n }\n\n public changeTransportType(transportType: TransportType) {\n const oldTransportType = this.transportType;\n if(oldTransportType === transportType) {\n return;\n }\n\n this.log('changing transport from', oldTransportType, 'to', transportType);\n\n const oldObject = this.cachedNetworkers[oldTransportType];\n const newObject = this.cachedNetworkers[transportType];\n this.cachedNetworkers[transportType] = oldObject;\n this.cachedNetworkers[oldTransportType] = newObject;\n\n this.transportType = transportType;\n\n for(const oldGetKey in this.gettingNetworkers) {\n const promise = this.gettingNetworkers[oldGetKey];\n delete this.gettingNetworkers[oldGetKey];\n\n const newGetKey = oldGetKey.replace(oldTransportType, transportType);\n this.gettingNetworkers[newGetKey] = promise;\n\n this.log('changed networker getKey from', oldGetKey, 'to', newGetKey)\n }\n\n this.iterateNetworkers((info) => {\n const transportType = this.getTransportType(info.connectionType);\n const transport = this.chooseServer(info.dcId, info.connectionType, transportType);\n this.changeNetworkerTransport(info.networker, transport);\n });\n }\n\n public async getBaseDcId() {\n if(this.baseDcId) {\n return this.baseDcId;\n }\n\n const baseDcId = await sessionStorage.get('dc');\n if(!this.baseDcId) {\n if(!baseDcId) {\n this.setBaseDcId(App.baseDcId);\n } else {\n this.baseDcId = baseDcId;\n }\n }\n\n return this.baseDcId;\n }\n\n public async setUserAuth(userAuth: UserAuth | UserId) {\n if(typeof(userAuth) === 'string' || typeof(userAuth) === 'number') {\n userAuth = {dcID: 0, date: tsNow(true), id: userAuth.toPeerId(false)};\n }\n\n this.rootScope.dispatchEvent('user_auth', userAuth);\n\n if(!userAuth.dcID) {\n const baseDcId = await this.getBaseDcId();\n userAuth.dcID = baseDcId;\n }\n\n sessionStorage.set({\n user_auth: userAuth\n });\n\n // this.telegramMeNotify(true);\n }\n\n public setBaseDcId(dcId: DcId) {\n const wasDcId = this.baseDcId;\n if(wasDcId) { // if migrated set ondrain\n this.getNetworker(wasDcId).then((networker) => {\n this.setOnDrainIfNeeded(networker);\n });\n }\n\n this.baseDcId = dcId;\n\n sessionStorage.set({\n dc: this.baseDcId\n });\n }\n\n public async logOut() {\n if(this.loggingOut) {\n return;\n }\n\n this.loggingOut = true;\n const storageKeys: Array = [];\n\n const prefix = 'dc';\n for(let dcId = 1; dcId <= 5; dcId++) {\n storageKeys.push(prefix + dcId + '_auth_key' as any);\n }\n\n // WebPushApiManager.forceUnsubscribe(); // WARNING // moved to worker's master\n const storageResult = await Promise.all(storageKeys.map((key) => sessionStorage.get(key)));\n\n const logoutPromises: Promise[] = [];\n for(let i = 0; i < storageResult.length; i++) {\n if(storageResult[i]) {\n logoutPromises.push(this.invokeApi('auth.logOut', {}, {dcId: (i + 1) as DcId, ignoreErrors: true}));\n }\n }\n\n const clear = async() => {\n this.baseDcId = undefined;\n // this.telegramMeNotify(false);\n await toggleStorages(false, true);\n IDB.closeDatabases();\n this.rootScope.dispatchEvent('logging_out');\n };\n\n setTimeout(clear, 1e3);\n\n // return;\n\n return Promise.all(logoutPromises).catch((error) => {\n error.handled = true;\n }).finally(clear)/* .then(() => {\n location.pathname = '/';\n }) */;\n }\n\n private generateNetworkerGetKey(dcId: DcId, transportType: TransportType, connectionType: ConnectionType) {\n return [dcId, transportType, connectionType].join('-');\n }\n\n public getNetworker(dcId: DcId, options: InvokeApiOptions = {}): Promise {\n const connectionType: ConnectionType = options.fileDownload ? 'download' : (options.fileUpload ? 'upload' : 'client');\n // const connectionType: ConnectionType = 'client';\n\n const transportType = this.getTransportType(connectionType);\n if(!this.cachedNetworkers[transportType]) {\n this.cachedNetworkers[transportType] = {\n client: {},\n download: {},\n upload: {}\n };\n }\n\n const cache = this.cachedNetworkers[transportType][connectionType];\n if(!(dcId in cache)) {\n cache[dcId] = [];\n }\n\n const networkers = cache[dcId];\n // @ts-ignore\n const maxNetworkers = connectionType === 'client' || transportType === 'https' ? 1 : (this.rootScope.premium ? PREMIUM_FILE_NETWORKERS_COUNT : REGULAR_FILE_NETWORKERS_COUNT);\n if(networkers.length >= maxNetworkers) {\n let i = maxNetworkers - 1, found = false;\n for(; i >= 0; --i) {\n if(networkers[i].isOnline) {\n found = true;\n break;\n }\n }\n\n const networker = networkers.splice(found ? i : maxNetworkers - 1, 1)[0];\n networkers.unshift(networker);\n return Promise.resolve(networker);\n }\n\n let getKey = this.generateNetworkerGetKey(dcId, transportType, connectionType);\n if(this.gettingNetworkers[getKey]) {\n return this.gettingNetworkers[getKey];\n }\n\n const ak: DcAuthKey = `dc${dcId}_auth_key` as any;\n const ss: DcServerSalt = `dc${dcId}_server_salt` as any;\n\n let transport = this.chooseServer(dcId, connectionType, transportType);\n return this.gettingNetworkers[getKey] = Promise.all([ak, ss].map((key) => sessionStorage.get(key)))\n .then(async([authKeyHex, serverSaltHex]) => {\n let networker: MTPNetworker, error: any;\n if(authKeyHex && authKeyHex.length === 512) {\n if(!serverSaltHex || serverSaltHex.length !== 16) {\n serverSaltHex = 'AAAAAAAAAAAAAAAA';\n }\n\n const authKey = bytesFromHex(authKeyHex);\n const authKeyId = (await CryptoWorker.invokeCrypto('sha1', authKey)).slice(-8);\n const serverSalt = bytesFromHex(serverSaltHex);\n\n networker = this.networkerFactory.getNetworker(dcId, authKey, authKeyId, serverSalt, options);\n } else {\n try { // if no saved state\n const auth = await this.authorizer.auth(dcId);\n\n sessionStorage.set({\n [ak]: bytesToHex(auth.authKey),\n [ss]: bytesToHex(auth.serverSalt)\n });\n\n networker = this.networkerFactory.getNetworker(dcId, auth.authKey, auth.authKeyId, auth.serverSalt, options);\n } catch(_error) {\n error = _error;\n }\n }\n\n // ! cannot get it before this promise because simultaneous changeTransport will change nothing\n const newTransportType = this.getTransportType(connectionType);\n if(newTransportType !== transportType) {\n getKey = this.generateNetworkerGetKey(dcId, newTransportType, connectionType);\n transport.destroy();\n DcConfigurator.removeTransport(this.dcConfigurator.chosenServers, transport);\n\n if(networker) {\n transport = this.chooseServer(dcId, connectionType, newTransportType);\n }\n\n this.log('transport has been changed during authorization from', transportType, 'to', newTransportType);\n }\n\n /* networker.onConnectionStatusChange = (online) => {\n console.log('status:', online);\n }; */\n\n delete this.gettingNetworkers[getKey];\n\n if(error) {\n this.log('get networker error', error, (error as Error).stack);\n throw error;\n }\n\n this.changeNetworkerTransport(networker, transport);\n networkers.unshift(networker);\n this.setOnDrainIfNeeded(networker);\n return networker;\n });\n }\n\n public getNetworkerVoid(dcId: DcId) {\n return this.getNetworker(dcId).then(noop, noop);\n }\n\n private changeNetworkerTransport(networker: MTPNetworker, transport?: MTTransport) {\n const oldTransport = networker.transport;\n if(oldTransport) {\n DcConfigurator.removeTransport(this.dcConfigurator.chosenServers, oldTransport);\n }\n\n networker.changeTransport(transport);\n }\n\n private onNetworkerDrain(networker: MTPNetworker) {\n this.log('networker drain', networker.dcId);\n networker.onDrain = undefined;\n this.changeNetworkerTransport(networker);\n networker.destroy();\n this.networkerFactory.removeNetworker(networker);\n DcConfigurator.removeTransport(this.cachedNetworkers, networker);\n }\n\n public setOnDrainIfNeeded(networker: MTPNetworker) {\n if(networker.onDrain) {\n return;\n }\n\n const checkPromise: Promise = networker.isFileNetworker ?\n Promise.resolve(true) :\n this.getBaseDcId().then((baseDcId) => networker.dcId !== baseDcId);\n checkPromise.then((canRelease) => {\n if(networker.onDrain) {\n return;\n }\n\n if(canRelease) {\n networker.onDrain = () => this.onNetworkerDrain(networker);\n networker.setDrainTimeout();\n }\n });\n }\n\n public setUpdatesProcessor(callback: (obj: any) => void) {\n this.updatesProcessor = callback;\n this.networkerFactory.setUpdatesProcessor(callback);\n }\n\n public invokeApi(method: T, params: MethodDeclMap[T]['req'] = {}, options: InvokeApiOptions = {}): CancellablePromise {\n // /////this.log('Invoke api', method, params, options);\n\n /* if(!this.lol) {\n networkerFactory.updatesProcessor({_: 'new_session_created'}, true);\n this.lol = true;\n } */\n\n const deferred = deferredPromise();\n\n let {afterMessageId, prepareTempMessageId} = options;\n if(prepareTempMessageId) {\n deferred.then(() => {\n delete this.afterMessageTempIds[prepareTempMessageId];\n });\n }\n\n if(MOUNT_CLASS_TO) {\n const startTime = Date.now();\n const interval = ctx.setInterval(() => {\n if(!cachedNetworker || !cachedNetworker.isStopped()) {\n this.log.error('Request is still processing:', method, params, options, 'time:', (Date.now() - startTime) / 1000);\n }\n // this.cachedUploadNetworkers[2].requestMessageStatus();\n }, 5e3);\n\n deferred.catch(noop).finally(() => {\n clearInterval(interval);\n });\n }\n\n const rejectPromise = async(error: ApiError) => {\n if(!error) {\n error = {type: 'ERROR_EMPTY'};\n } else if(!isObject(error)) {\n error = {message: error};\n }\n\n if((error.code === 401 && error.type === 'SESSION_REVOKED') ||\n (error.code === 406 && error.type === 'AUTH_KEY_DUPLICATED')) {\n this.logOut();\n }\n\n if(options.ignoreErrors) {\n throw error;\n }\n\n if(error.code === 406) {\n error.handled = true;\n }\n\n if(!options.noErrorBox) {\n error.input = method;\n error.stack = stack || (error.originalError && error.originalError.stack) || error.stack || (new Error()).stack;\n setTimeout(() => {\n if(!error.handled) {\n if(error.code === 401) {\n this.logOut();\n } else {\n // ErrorService.show({error: error}); // WARNING\n }\n\n error.handled = true;\n }\n }, 100);\n }\n\n throw error;\n };\n\n let dcId: DcId;\n\n let cachedNetworker: MTPNetworker;\n const stack = (new Error()).stack || 'empty stack';\n const performRequest = (): Promise => {\n if(afterMessageId) {\n const after = this.afterMessageTempIds[afterMessageId];\n if(after) {\n options.afterMessageId = after.messageId;\n }\n }\n\n const promise = cachedNetworker.wrapApiCall(method, params, options);\n\n if(prepareTempMessageId) {\n this.afterMessageTempIds[prepareTempMessageId] = {\n messageId: (options as MTMessage).messageId,\n promise: deferred\n };\n }\n\n return promise.catch((error: ApiError) => {\n // if(!options.ignoreErrors) {\n if(error.type !== 'FILE_REFERENCE_EXPIRED'/* && error.type !== 'MSG_WAIT_FAILED' */) {\n this.log.error('Error', error.code, error.type, this.baseDcId, dcId, method, params);\n }\n\n if(error.code === 401 && this.baseDcId === dcId) {\n if(error.type !== 'SESSION_PASSWORD_NEEDED') {\n sessionStorage.delete('dc')\n sessionStorage.delete('user_auth'); // ! возможно тут вообще не нужно это делать, но нужно проверить случай с USER_DEACTIVATED (https://core.telegram.org/api/errors)\n // this.telegramMeNotify(false);\n }\n\n throw error;\n } else if(error.code === 401 && this.baseDcId && dcId !== this.baseDcId) {\n if(this.cachedExportPromise[dcId] === undefined) {\n const promise = new Promise((exportResolve, exportReject) => {\n this.invokeApi('auth.exportAuthorization', {dc_id: dcId}, {noErrorBox: true}).then((exportedAuth) => {\n this.invokeApi('auth.importAuthorization', {\n id: exportedAuth.id,\n bytes: exportedAuth.bytes\n }, {dcId, noErrorBox: true}).then(exportResolve, exportReject);\n }, exportReject);\n });\n\n this.cachedExportPromise[dcId] = promise;\n }\n\n return this.cachedExportPromise[dcId].then(() => performRequest());\n } else if(error.code === 303) {\n const newDcId = +error.type.match(/^(PHONE_MIGRATE_|NETWORK_MIGRATE_|USER_MIGRATE_)(\\d+)/)[2] as DcId;\n if(newDcId !== dcId) {\n if(options.dcId) {\n options.dcId = newDcId;\n } else {\n this.setBaseDcId(newDcId);\n }\n\n return this.invokeApi(method, params, options);\n }\n } else if(error.code === 400 && error.type.indexOf('FILE_MIGRATE') === 0) {\n const newDcId = +error.type.match(/^(FILE_MIGRATE_)(\\d+)/)[2] as DcId;\n if(newDcId !== dcId) {\n options.dcId = newDcId;\n return this.invokeApi(method, params, options);\n } else {\n throw error;\n }\n } else if(error.code === 400 && error.type === 'CONNECTION_NOT_INITED') {\n this.networkerFactory.unsetConnectionInited();\n return performRequest();\n } else if(!options.rawError && error.code === 420) {\n const waitTime = +error.type.match(/^FLOOD_WAIT_(\\d+)/)[1] || 1;\n\n if(waitTime > (options.floodMaxTimeout ?? 60) && !options.prepareTempMessageId) {\n throw error;\n }\n\n return pause(waitTime/* (waitTime + 5) */ * 1000).then(() => performRequest());\n } else if(!options.rawError && ['MSG_WAIT_FAILED', 'MSG_WAIT_TIMEOUT'].includes(error.type)) {\n const after = this.afterMessageTempIds[afterMessageId];\n\n afterMessageId = undefined;\n delete options.afterMessageId;\n\n if(after) return after.promise.then(() => performRequest());\n else return performRequest();\n } else if(!options.rawError && error.code === 500) {\n const now = Date.now();\n if(options.stopTime) {\n if(now >= options.stopTime) {\n throw error;\n }\n }\n\n options.waitTime = options.waitTime ? Math.min(60, options.waitTime * 1.5) : 1;\n return pause(options.waitTime * 1000).then(() => performRequest());\n } else if(error.type === 'UNKNOWN' || error.type === 'MTPROTO_CLUSTER_INVALID') { // cluster invalid - request from regular user to premium endpoint\n return pause(1000).then(() => performRequest());\n } else {\n throw error;\n }\n });\n }\n\n let p: Promise;\n if(dcId = (options.dcId || this.baseDcId)) {\n p = this.getNetworker(dcId, options);\n } else {\n p = this.getBaseDcId().then((baseDcId) => this.getNetworker(dcId = baseDcId, options));\n }\n\n p.then((networker) => {\n cachedNetworker = networker;\n const promise = performRequest();\n cachedNetworker.attachPromise(deferred, options as MTMessage);\n return promise;\n })\n .then(deferred.resolve)\n .catch(rejectPromise)\n .catch(deferred.reject);\n\n return deferred;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport applyMixins from '../../helpers/applyMixins';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport {AppManager} from '../appManagers/manager';\n\nexport type StatePeerType = 'recentSearch' | 'topPeer' | 'dialog' | 'contact' | 'topMessage' | 'self';\n\ntype PeersStorageKey = `${StatePeerType}_${string | PeerId}` | StatePeerType;\n\nclass PeersStorage {\n private neededPeers: Map> = new Map();\n private singlePeerMap: Map> = new Map();\n\n constructor() {\n this._constructor(false);\n }\n\n protected after() {\n this.rootScope.addEventListener('user_auth', () => {\n this.requestPeer(this.appPeersManager.peerId, 'self');\n });\n }\n\n public requestPeer(peerId: PeerId, key: PeersStorageKey) {\n let set = this.neededPeers.get(peerId);\n if(set && set.has(key)) {\n return;\n }\n\n if(!set) {\n set = new Set();\n this.neededPeers.set(peerId, set);\n }\n\n set.add(key);\n\n this.dispatchEvent('peerNeeded', peerId);\n }\n\n public releasePeer(peerId: PeerId, key: PeersStorageKey) {\n const set = this.neededPeers.get(peerId);\n if(!set) {\n return;\n }\n\n set.delete(key);\n\n if(!set.size) {\n this.neededPeers.delete(peerId);\n this.dispatchEvent('peerUnneeded', peerId);\n }\n }\n\n public requestPeersForKey(peerIds: Set | number[], key: PeersStorageKey) {\n if(Array.isArray(peerIds)) {\n peerIds = new Set(peerIds);\n }\n\n let set = this.singlePeerMap.get(key);\n if(set) {\n for(const peerId of set) {\n if(peerIds.has(peerId)) {\n continue;\n }\n\n this.releasePeer(peerId, key);\n set.delete(peerId);\n }\n\n if(!set.size && !peerIds.size) {\n this.singlePeerMap.delete(key);\n return;\n }\n }\n\n if(peerIds.size) {\n if(!set) {\n set = new Set();\n this.singlePeerMap.set(key, set);\n }\n\n for(const peerId of peerIds) {\n if(set.has(peerId)) {\n continue;\n }\n\n this.requestPeer(peerId, key);\n set.add(peerId);\n }\n }\n }\n\n public isPeerNeeded(peerId: PeerId) {\n return this.neededPeers.has(peerId);\n }\n}\n\ninterface PeersStorage extends EventListenerBase<{\n peerNeeded: (peerId: PeerId) => void,\n peerUnneeded: (peerId: PeerId) => void,\n}>, AppManager {}\napplyMixins(PeersStorage, [EventListenerBase, AppManager]);\n\nexport default PeersStorage;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {WebDocument} from '../../layer';\nimport type {MyDocument} from '../appManagers/appDocsManager';\nimport type {MyPhoto} from '../appManagers/appPhotosManager';\nimport {THUMB_TYPE_FULL} from '../mtproto/mtproto_config';\n\nexport type ThumbCache = {\n downloaded: number,\n url: string,\n type: string\n};\n\nexport type ThumbsCache = {\n [key: string]: {\n [size: string]: ThumbCache\n }\n};\n\nconst thumbFullSize = THUMB_TYPE_FULL;\n\nexport type ThumbStorageMedia = MyPhoto | MyDocument | WebDocument;\n\nexport default class ThumbsStorage {\n private thumbsCache: ThumbsCache = {};\n\n private getKey(media: ThumbStorageMedia) {\n return media._ + ((media as MyPhoto).id ?? (media as WebDocument).url);\n }\n\n public getCacheContext(media: ThumbStorageMedia, thumbSize: string = thumbFullSize): ThumbCache {\n /* if(media._ === 'photo' && thumbSize !== 'i') {\n thumbSize = thumbFullSize;\n } */\n\n const cache = this.thumbsCache[this.getKey(media)] ??= {};\n return cache[thumbSize] ??= {downloaded: 0, url: '', type: thumbSize};\n }\n\n public setCacheContextURL(media: ThumbStorageMedia, thumbSize: string = thumbFullSize, url: string, downloaded: number = 0) {\n const cacheContext = this.getCacheContext(media, thumbSize);\n cacheContext.url = url;\n cacheContext.downloaded = downloaded;\n return cacheContext;\n }\n\n public deleteCacheContext(media: ThumbStorageMedia, thumbSize: string = thumbFullSize) {\n const cache = this.thumbsCache[this.getKey(media)];\n if(cache) {\n delete cache[thumbSize];\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport type MTProtoConstructor = {\n id: number,\n predicate: string,\n params: Array<{\n name: string,\n type: string\n }>,\n type: string\n};\n\nexport type MTProtoMethod = {\n id: number,\n method: string,\n params: Array<{\n name: string,\n type: string\n }>,\n type: string\n};\n\n// eslint-disable-next-line quotes, comma-spacing\nexport default {\"MTProto\":{\"constructors\":[{\"id\":481674261,\"predicate\":\"vector\",\"params\":[],\"type\":\"Vector t\"},{\"id\":85337187,\"predicate\":\"resPQ\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"pq\",\"type\":\"bytes\"},{\"name\":\"server_public_key_fingerprints\",\"type\":\"Vector\"}],\"type\":\"ResPQ\"},{\"id\":-1443537003,\"predicate\":\"p_q_inner_data_dc\",\"params\":[{\"name\":\"pq\",\"type\":\"bytes\"},{\"name\":\"p\",\"type\":\"bytes\"},{\"name\":\"q\",\"type\":\"bytes\"},{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"new_nonce\",\"type\":\"int256\"},{\"name\":\"dc\",\"type\":\"int\"}],\"type\":\"P_Q_inner_data\"},{\"id\":1459478408,\"predicate\":\"p_q_inner_data_temp_dc\",\"params\":[{\"name\":\"pq\",\"type\":\"bytes\"},{\"name\":\"p\",\"type\":\"bytes\"},{\"name\":\"q\",\"type\":\"bytes\"},{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"new_nonce\",\"type\":\"int256\"},{\"name\":\"dc\",\"type\":\"int\"},{\"name\":\"expires_in\",\"type\":\"int\"}],\"type\":\"P_Q_inner_data\"},{\"id\":-790100132,\"predicate\":\"server_DH_params_ok\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"encrypted_answer\",\"type\":\"bytes\"}],\"type\":\"Server_DH_Params\"},{\"id\":-1249309254,\"predicate\":\"server_DH_inner_data\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"g\",\"type\":\"int\"},{\"name\":\"dh_prime\",\"type\":\"bytes\"},{\"name\":\"g_a\",\"type\":\"bytes\"},{\"name\":\"server_time\",\"type\":\"int\"}],\"type\":\"Server_DH_inner_data\"},{\"id\":1715713620,\"predicate\":\"client_DH_inner_data\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"retry_id\",\"type\":\"long\"},{\"name\":\"g_b\",\"type\":\"bytes\"}],\"type\":\"Client_DH_Inner_Data\"},{\"id\":1003222836,\"predicate\":\"dh_gen_ok\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"new_nonce_hash1\",\"type\":\"int128\"}],\"type\":\"Set_client_DH_params_answer\"},{\"id\":1188831161,\"predicate\":\"dh_gen_retry\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"new_nonce_hash2\",\"type\":\"int128\"}],\"type\":\"Set_client_DH_params_answer\"},{\"id\":-1499615742,\"predicate\":\"dh_gen_fail\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"new_nonce_hash3\",\"type\":\"int128\"}],\"type\":\"Set_client_DH_params_answer\"},{\"id\":1973679973,\"predicate\":\"bind_auth_key_inner\",\"params\":[{\"name\":\"nonce\",\"type\":\"long\"},{\"name\":\"temp_auth_key_id\",\"type\":\"long\"},{\"name\":\"perm_auth_key_id\",\"type\":\"long\"},{\"name\":\"temp_session_id\",\"type\":\"long\"},{\"name\":\"expires_at\",\"type\":\"int\"}],\"type\":\"BindAuthKeyInner\"},{\"id\":-212046591,\"predicate\":\"rpc_result\",\"params\":[{\"name\":\"req_msg_id\",\"type\":\"long\"},{\"name\":\"result\",\"type\":\"Object\"}],\"type\":\"RpcResult\"},{\"id\":558156313,\"predicate\":\"rpc_error\",\"params\":[{\"name\":\"error_code\",\"type\":\"int\"},{\"name\":\"error_message\",\"type\":\"string\"}],\"type\":\"RpcError\"},{\"id\":1579864942,\"predicate\":\"rpc_answer_unknown\",\"params\":[],\"type\":\"RpcDropAnswer\"},{\"id\":-847714938,\"predicate\":\"rpc_answer_dropped_running\",\"params\":[],\"type\":\"RpcDropAnswer\"},{\"id\":-1539647305,\"predicate\":\"rpc_answer_dropped\",\"params\":[{\"name\":\"msg_id\",\"type\":\"long\"},{\"name\":\"seq_no\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"int\"}],\"type\":\"RpcDropAnswer\"},{\"id\":155834844,\"predicate\":\"future_salt\",\"params\":[{\"name\":\"valid_since\",\"type\":\"int\"},{\"name\":\"valid_until\",\"type\":\"int\"},{\"name\":\"salt\",\"type\":\"long\"}],\"type\":\"FutureSalt\"},{\"id\":-1370486635,\"predicate\":\"future_salts\",\"params\":[{\"name\":\"req_msg_id\",\"type\":\"long\"},{\"name\":\"now\",\"type\":\"int\"},{\"name\":\"salts\",\"type\":\"vector\"}],\"type\":\"FutureSalts\"},{\"id\":880243653,\"predicate\":\"pong\",\"params\":[{\"name\":\"msg_id\",\"type\":\"long\"},{\"name\":\"ping_id\",\"type\":\"long\"}],\"type\":\"Pong\"},{\"id\":-501201412,\"predicate\":\"destroy_session_ok\",\"params\":[{\"name\":\"session_id\",\"type\":\"long\"}],\"type\":\"DestroySessionRes\"},{\"id\":1658015945,\"predicate\":\"destroy_session_none\",\"params\":[{\"name\":\"session_id\",\"type\":\"long\"}],\"type\":\"DestroySessionRes\"},{\"id\":-1631450872,\"predicate\":\"new_session_created\",\"params\":[{\"name\":\"first_msg_id\",\"type\":\"long\"},{\"name\":\"unique_id\",\"type\":\"long\"},{\"name\":\"server_salt\",\"type\":\"long\"}],\"type\":\"NewSession\"},{\"id\":1945237724,\"predicate\":\"msg_container\",\"params\":[{\"name\":\"messages\",\"type\":\"vector<%Message>\"}],\"type\":\"MessageContainer\"},{\"id\":1538843921,\"predicate\":\"message\",\"params\":[{\"name\":\"msg_id\",\"type\":\"long\"},{\"name\":\"seqno\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"int\"},{\"name\":\"body\",\"type\":\"Object\"}],\"type\":\"Message\"},{\"id\":-530561358,\"predicate\":\"msg_copy\",\"params\":[{\"name\":\"orig_message\",\"type\":\"Message\"}],\"type\":\"MessageCopy\"},{\"id\":812830625,\"predicate\":\"gzip_packed\",\"params\":[{\"name\":\"packed_data\",\"type\":\"bytes\"}],\"type\":\"Object\"},{\"id\":1658238041,\"predicate\":\"msgs_ack\",\"params\":[{\"name\":\"msg_ids\",\"type\":\"Vector\"}],\"type\":\"MsgsAck\"},{\"id\":-1477445615,\"predicate\":\"bad_msg_notification\",\"params\":[{\"name\":\"bad_msg_id\",\"type\":\"long\"},{\"name\":\"bad_msg_seqno\",\"type\":\"int\"},{\"name\":\"error_code\",\"type\":\"int\"}],\"type\":\"BadMsgNotification\"},{\"id\":-307542917,\"predicate\":\"bad_server_salt\",\"params\":[{\"name\":\"bad_msg_id\",\"type\":\"long\"},{\"name\":\"bad_msg_seqno\",\"type\":\"int\"},{\"name\":\"error_code\",\"type\":\"int\"},{\"name\":\"new_server_salt\",\"type\":\"long\"}],\"type\":\"BadMsgNotification\"},{\"id\":2105940488,\"predicate\":\"msg_resend_req\",\"params\":[{\"name\":\"msg_ids\",\"type\":\"Vector\"}],\"type\":\"MsgResendReq\"},{\"id\":-630588590,\"predicate\":\"msgs_state_req\",\"params\":[{\"name\":\"msg_ids\",\"type\":\"Vector\"}],\"type\":\"MsgsStateReq\"},{\"id\":81704317,\"predicate\":\"msgs_state_info\",\"params\":[{\"name\":\"req_msg_id\",\"type\":\"long\"},{\"name\":\"info\",\"type\":\"bytes\"}],\"type\":\"MsgsStateInfo\"},{\"id\":-1933520591,\"predicate\":\"msgs_all_info\",\"params\":[{\"name\":\"msg_ids\",\"type\":\"Vector\"},{\"name\":\"info\",\"type\":\"bytes\"}],\"type\":\"MsgsAllInfo\"},{\"id\":661470918,\"predicate\":\"msg_detailed_info\",\"params\":[{\"name\":\"msg_id\",\"type\":\"long\"},{\"name\":\"answer_msg_id\",\"type\":\"long\"},{\"name\":\"bytes\",\"type\":\"int\"},{\"name\":\"status\",\"type\":\"int\"}],\"type\":\"MsgDetailedInfo\"},{\"id\":-2137147681,\"predicate\":\"msg_new_detailed_info\",\"params\":[{\"name\":\"answer_msg_id\",\"type\":\"long\"},{\"name\":\"bytes\",\"type\":\"int\"},{\"name\":\"status\",\"type\":\"int\"}],\"type\":\"MsgDetailedInfo\"},{\"id\":-161422892,\"predicate\":\"destroy_auth_key_ok\",\"params\":[],\"type\":\"DestroyAuthKeyRes\"},{\"id\":178201177,\"predicate\":\"destroy_auth_key_none\",\"params\":[],\"type\":\"DestroyAuthKeyRes\"},{\"id\":-368010477,\"predicate\":\"destroy_auth_key_fail\",\"params\":[],\"type\":\"DestroyAuthKeyRes\"}],\"methods\":[{\"id\":-1099002127,\"method\":\"req_pq_multi\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"}],\"type\":\"ResPQ\"},{\"id\":-686627650,\"method\":\"req_DH_params\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"p\",\"type\":\"bytes\"},{\"name\":\"q\",\"type\":\"bytes\"},{\"name\":\"public_key_fingerprint\",\"type\":\"long\"},{\"name\":\"encrypted_data\",\"type\":\"bytes\"}],\"type\":\"Server_DH_Params\"},{\"id\":-184262881,\"method\":\"set_client_DH_params\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"encrypted_data\",\"type\":\"bytes\"}],\"type\":\"Set_client_DH_params_answer\"},{\"id\":1491380032,\"method\":\"rpc_drop_answer\",\"params\":[{\"name\":\"req_msg_id\",\"type\":\"long\"}],\"type\":\"RpcDropAnswer\"},{\"id\":-1188971260,\"method\":\"get_future_salts\",\"params\":[{\"name\":\"num\",\"type\":\"int\"}],\"type\":\"FutureSalts\"},{\"id\":2059302892,\"method\":\"ping\",\"params\":[{\"name\":\"ping_id\",\"type\":\"long\"}],\"type\":\"Pong\"},{\"id\":-213746804,\"method\":\"ping_delay_disconnect\",\"params\":[{\"name\":\"ping_id\",\"type\":\"long\"},{\"name\":\"disconnect_delay\",\"type\":\"int\"}],\"type\":\"Pong\"},{\"id\":-414113498,\"method\":\"destroy_session\",\"params\":[{\"name\":\"session_id\",\"type\":\"long\"}],\"type\":\"DestroySessionRes\"},{\"id\":-1835453025,\"method\":\"http_wait\",\"params\":[{\"name\":\"max_delay\",\"type\":\"int\"},{\"name\":\"wait_after\",\"type\":\"int\"},{\"name\":\"max_wait\",\"type\":\"int\"}],\"type\":\"HttpWait\"},{\"id\":-784117408,\"method\":\"destroy_auth_key\",\"params\":[],\"type\":\"DestroyAuthKeyRes\"}]},\"API\":{\"constructors\":[{\"id\":-1132882121,\"predicate\":\"boolFalse\",\"params\":[],\"type\":\"Bool\"},{\"id\":-1720552011,\"predicate\":\"boolTrue\",\"params\":[],\"type\":\"Bool\"},{\"id\":1072550713,\"predicate\":\"true\",\"params\":[],\"type\":\"True\"},{\"id\":481674261,\"predicate\":\"vector\",\"params\":[],\"type\":\"Vector t\"},{\"id\":-994444869,\"predicate\":\"error\",\"params\":[{\"name\":\"code\",\"type\":\"int\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"Error\"},{\"id\":1450380236,\"predicate\":\"null\",\"params\":[],\"type\":\"Null\"},{\"id\":2134579434,\"predicate\":\"inputPeerEmpty\",\"params\":[],\"type\":\"InputPeer\"},{\"id\":2107670217,\"predicate\":\"inputPeerSelf\",\"params\":[],\"type\":\"InputPeer\"},{\"id\":900291769,\"predicate\":\"inputPeerChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"}],\"type\":\"InputPeer\"},{\"id\":-1182234929,\"predicate\":\"inputUserEmpty\",\"params\":[],\"type\":\"InputUser\"},{\"id\":-138301121,\"predicate\":\"inputUserSelf\",\"params\":[],\"type\":\"InputUser\"},{\"id\":-208488460,\"predicate\":\"inputPhoneContact\",\"params\":[{\"name\":\"client_id\",\"type\":\"long\"},{\"name\":\"phone\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"}],\"type\":\"InputContact\"},{\"id\":-181407105,\"predicate\":\"inputFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"parts\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"md5_checksum\",\"type\":\"string\"}],\"type\":\"InputFile\"},{\"id\":-1771768449,\"predicate\":\"inputMediaEmpty\",\"params\":[],\"type\":\"InputMedia\"},{\"id\":505969924,\"predicate\":\"inputMediaUploadedPhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"spoiler\",\"type\":\"flags.2?true\"},{\"name\":\"file\",\"type\":\"InputFile\"},{\"name\":\"stickers\",\"type\":\"flags.0?Vector\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.1?int\"}],\"type\":\"InputMedia\"},{\"id\":-1279654347,\"predicate\":\"inputMediaPhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"spoiler\",\"type\":\"flags.1?true\"},{\"name\":\"id\",\"type\":\"InputPhoto\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.0?int\"}],\"type\":\"InputMedia\"},{\"id\":-104578748,\"predicate\":\"inputMediaGeoPoint\",\"params\":[{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"}],\"type\":\"InputMedia\"},{\"id\":-122978821,\"predicate\":\"inputMediaContact\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"vcard\",\"type\":\"string\"}],\"type\":\"InputMedia\"},{\"id\":480546647,\"predicate\":\"inputChatPhotoEmpty\",\"params\":[],\"type\":\"InputChatPhoto\"},{\"id\":-1110593856,\"predicate\":\"inputChatUploadedPhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"file\",\"type\":\"flags.0?InputFile\"},{\"name\":\"video\",\"type\":\"flags.1?InputFile\"},{\"name\":\"video_start_ts\",\"type\":\"flags.2?double\"},{\"name\":\"video_emoji_markup\",\"type\":\"flags.3?VideoSize\"}],\"type\":\"InputChatPhoto\"},{\"id\":-1991004873,\"predicate\":\"inputChatPhoto\",\"params\":[{\"name\":\"id\",\"type\":\"InputPhoto\"}],\"type\":\"InputChatPhoto\"},{\"id\":-457104426,\"predicate\":\"inputGeoPointEmpty\",\"params\":[],\"type\":\"InputGeoPoint\"},{\"id\":1210199983,\"predicate\":\"inputGeoPoint\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"lat\",\"type\":\"double\"},{\"name\":\"long\",\"type\":\"double\"},{\"name\":\"accuracy_radius\",\"type\":\"flags.0?int\"}],\"type\":\"InputGeoPoint\"},{\"id\":483901197,\"predicate\":\"inputPhotoEmpty\",\"params\":[],\"type\":\"InputPhoto\"},{\"id\":1001634122,\"predicate\":\"inputPhoto\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"}],\"type\":\"InputPhoto\"},{\"id\":-539317279,\"predicate\":\"inputFileLocation\",\"params\":[{\"name\":\"volume_id\",\"type\":\"long\"},{\"name\":\"local_id\",\"type\":\"int\"},{\"name\":\"secret\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"}],\"type\":\"InputFileLocation\"},{\"id\":1498486562,\"predicate\":\"peerUser\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"Peer\"},{\"id\":918946202,\"predicate\":\"peerChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"}],\"type\":\"Peer\"},{\"id\":-1432995067,\"predicate\":\"storage.fileUnknown\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":1086091090,\"predicate\":\"storage.filePartial\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":8322574,\"predicate\":\"storage.fileJpeg\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":-891180321,\"predicate\":\"storage.fileGif\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":172975040,\"predicate\":\"storage.filePng\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":-1373745011,\"predicate\":\"storage.filePdf\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":1384777335,\"predicate\":\"storage.fileMp3\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":1258941372,\"predicate\":\"storage.fileMov\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":-1278304028,\"predicate\":\"storage.fileMp4\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":276907596,\"predicate\":\"storage.fileWebp\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":-742634630,\"predicate\":\"userEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"User\"},{\"id\":1326562017,\"predicate\":\"userProfilePhotoEmpty\",\"params\":[],\"type\":\"UserProfilePhoto\"},{\"id\":-2100168954,\"predicate\":\"userProfilePhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"has_video\",\"type\":\"flags.0?true\"},{\"name\":\"personal\",\"type\":\"flags.2?true\"},{\"name\":\"photo_id\",\"type\":\"long\"},{\"name\":\"stripped_thumb\",\"type\":\"flags.1?bytes\"},{\"name\":\"dc_id\",\"type\":\"int\"}],\"type\":\"UserProfilePhoto\"},{\"id\":164646985,\"predicate\":\"userStatusEmpty\",\"params\":[],\"type\":\"UserStatus\"},{\"id\":-306628279,\"predicate\":\"userStatusOnline\",\"params\":[{\"name\":\"expires\",\"type\":\"int\"}],\"type\":\"UserStatus\"},{\"id\":9203775,\"predicate\":\"userStatusOffline\",\"params\":[{\"name\":\"was_online\",\"type\":\"int\"}],\"type\":\"UserStatus\"},{\"id\":693512293,\"predicate\":\"chatEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"Chat\"},{\"id\":1103884886,\"predicate\":\"chat\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"creator\",\"type\":\"flags.0?true\"},{\"name\":\"left\",\"type\":\"flags.2?true\"},{\"name\":\"deactivated\",\"type\":\"flags.5?true\"},{\"name\":\"call_active\",\"type\":\"flags.23?true\"},{\"name\":\"call_not_empty\",\"type\":\"flags.24?true\"},{\"name\":\"noforwards\",\"type\":\"flags.25?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"ChatPhoto\"},{\"name\":\"participants_count\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"int\"},{\"name\":\"migrated_to\",\"type\":\"flags.6?InputChannel\"},{\"name\":\"admin_rights\",\"type\":\"flags.14?ChatAdminRights\"},{\"name\":\"default_banned_rights\",\"type\":\"flags.18?ChatBannedRights\"}],\"type\":\"Chat\"},{\"id\":1704108455,\"predicate\":\"chatForbidden\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"Chat\"},{\"id\":-908914376,\"predicate\":\"chatFull\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"can_set_username\",\"type\":\"flags.7?true\"},{\"name\":\"has_scheduled\",\"type\":\"flags.8?true\"},{\"name\":\"translations_disabled\",\"type\":\"flags.19?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"about\",\"type\":\"string\"},{\"name\":\"participants\",\"type\":\"ChatParticipants\"},{\"name\":\"chat_photo\",\"type\":\"flags.2?Photo\"},{\"name\":\"notify_settings\",\"type\":\"PeerNotifySettings\"},{\"name\":\"exported_invite\",\"type\":\"flags.13?ExportedChatInvite\"},{\"name\":\"bot_info\",\"type\":\"flags.3?Vector\"},{\"name\":\"pinned_msg_id\",\"type\":\"flags.6?int\"},{\"name\":\"folder_id\",\"type\":\"flags.11?int\"},{\"name\":\"call\",\"type\":\"flags.12?InputGroupCall\"},{\"name\":\"ttl_period\",\"type\":\"flags.14?int\"},{\"name\":\"groupcall_default_join_as\",\"type\":\"flags.15?Peer\"},{\"name\":\"theme_emoticon\",\"type\":\"flags.16?string\"},{\"name\":\"requests_pending\",\"type\":\"flags.17?int\"},{\"name\":\"recent_requesters\",\"type\":\"flags.17?Vector\"},{\"name\":\"available_reactions\",\"type\":\"flags.18?ChatReactions\"}],\"type\":\"ChatFull\"},{\"id\":-1070776313,\"predicate\":\"chatParticipant\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"inviter_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"ChatParticipant\"},{\"id\":-2023500831,\"predicate\":\"chatParticipantsForbidden\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"self_participant\",\"type\":\"flags.0?ChatParticipant\"}],\"type\":\"ChatParticipants\"},{\"id\":1018991608,\"predicate\":\"chatParticipants\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"participants\",\"type\":\"Vector\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"ChatParticipants\"},{\"id\":935395612,\"predicate\":\"chatPhotoEmpty\",\"params\":[],\"type\":\"ChatPhoto\"},{\"id\":476978193,\"predicate\":\"chatPhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"has_video\",\"type\":\"flags.0?true\"},{\"name\":\"photo_id\",\"type\":\"long\"},{\"name\":\"stripped_thumb\",\"type\":\"flags.1?bytes\"},{\"name\":\"dc_id\",\"type\":\"int\"}],\"type\":\"ChatPhoto\"},{\"id\":-1868117372,\"predicate\":\"messageEmpty\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"peer_id\",\"type\":\"flags.0?Peer\"}],\"type\":\"Message\"},{\"id\":940666592,\"predicate\":\"message\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"out\",\"type\":\"flags.1?true\"},{\"name\":\"mentioned\",\"type\":\"flags.4?true\"},{\"name\":\"media_unread\",\"type\":\"flags.5?true\"},{\"name\":\"silent\",\"type\":\"flags.13?true\"},{\"name\":\"post\",\"type\":\"flags.14?true\"},{\"name\":\"from_scheduled\",\"type\":\"flags.18?true\"},{\"name\":\"legacy\",\"type\":\"flags.19?true\"},{\"name\":\"edit_hide\",\"type\":\"flags.21?true\"},{\"name\":\"pinned\",\"type\":\"flags.24?true\"},{\"name\":\"noforwards\",\"type\":\"flags.26?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"from_id\",\"type\":\"flags.8?Peer\"},{\"name\":\"peer_id\",\"type\":\"Peer\"},{\"name\":\"fwd_from\",\"type\":\"flags.2?MessageFwdHeader\"},{\"name\":\"via_bot_id\",\"type\":\"flags.11?long\"},{\"name\":\"reply_to\",\"type\":\"flags.3?MessageReplyHeader\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"media\",\"type\":\"flags.9?MessageMedia\"},{\"name\":\"reply_markup\",\"type\":\"flags.6?ReplyMarkup\"},{\"name\":\"entities\",\"type\":\"flags.7?Vector\"},{\"name\":\"views\",\"type\":\"flags.10?int\"},{\"name\":\"forwards\",\"type\":\"flags.10?int\"},{\"name\":\"replies\",\"type\":\"flags.23?MessageReplies\"},{\"name\":\"edit_date\",\"type\":\"flags.15?int\"},{\"name\":\"post_author\",\"type\":\"flags.16?string\"},{\"name\":\"grouped_id\",\"type\":\"flags.17?long\"},{\"name\":\"reactions\",\"type\":\"flags.20?MessageReactions\"},{\"name\":\"restriction_reason\",\"type\":\"flags.22?Vector\"},{\"name\":\"ttl_period\",\"type\":\"flags.25?int\"}],\"type\":\"Message\"},{\"id\":721967202,\"predicate\":\"messageService\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"out\",\"type\":\"flags.1?true\"},{\"name\":\"mentioned\",\"type\":\"flags.4?true\"},{\"name\":\"media_unread\",\"type\":\"flags.5?true\"},{\"name\":\"silent\",\"type\":\"flags.13?true\"},{\"name\":\"post\",\"type\":\"flags.14?true\"},{\"name\":\"legacy\",\"type\":\"flags.19?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"from_id\",\"type\":\"flags.8?Peer\"},{\"name\":\"peer_id\",\"type\":\"Peer\"},{\"name\":\"reply_to\",\"type\":\"flags.3?MessageReplyHeader\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"action\",\"type\":\"MessageAction\"},{\"name\":\"ttl_period\",\"type\":\"flags.25?int\"}],\"type\":\"Message\"},{\"id\":1038967584,\"predicate\":\"messageMediaEmpty\",\"params\":[],\"type\":\"MessageMedia\"},{\"id\":1766936791,\"predicate\":\"messageMediaPhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"spoiler\",\"type\":\"flags.3?true\"},{\"name\":\"photo\",\"type\":\"flags.0?Photo\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.2?int\"}],\"type\":\"MessageMedia\"},{\"id\":1457575028,\"predicate\":\"messageMediaGeo\",\"params\":[{\"name\":\"geo\",\"type\":\"GeoPoint\"}],\"type\":\"MessageMedia\"},{\"id\":1882335561,\"predicate\":\"messageMediaContact\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"vcard\",\"type\":\"string\"},{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"MessageMedia\"},{\"id\":-1618676578,\"predicate\":\"messageMediaUnsupported\",\"params\":[],\"type\":\"MessageMedia\"},{\"id\":-1230047312,\"predicate\":\"messageActionEmpty\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":-1119368275,\"predicate\":\"messageActionChatCreate\",\"params\":[{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"MessageAction\"},{\"id\":-1247687078,\"predicate\":\"messageActionChatEditTitle\",\"params\":[{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":2144015272,\"predicate\":\"messageActionChatEditPhoto\",\"params\":[{\"name\":\"photo\",\"type\":\"Photo\"}],\"type\":\"MessageAction\"},{\"id\":-1780220945,\"predicate\":\"messageActionChatDeletePhoto\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":365886720,\"predicate\":\"messageActionChatAddUser\",\"params\":[{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"MessageAction\"},{\"id\":-1539362612,\"predicate\":\"messageActionChatDeleteUser\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"MessageAction\"},{\"id\":-712374074,\"predicate\":\"dialog\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.2?true\"},{\"name\":\"unread_mark\",\"type\":\"flags.3?true\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"top_message\",\"type\":\"int\"},{\"name\":\"read_inbox_max_id\",\"type\":\"int\"},{\"name\":\"read_outbox_max_id\",\"type\":\"int\"},{\"name\":\"unread_count\",\"type\":\"int\"},{\"name\":\"unread_mentions_count\",\"type\":\"int\"},{\"name\":\"unread_reactions_count\",\"type\":\"int\"},{\"name\":\"notify_settings\",\"type\":\"PeerNotifySettings\"},{\"name\":\"pts\",\"type\":\"flags.0?int\"},{\"name\":\"draft\",\"type\":\"flags.1?DraftMessage\"},{\"name\":\"folder_id\",\"type\":\"flags.4?int\"},{\"name\":\"ttl_period\",\"type\":\"flags.5?int\"}],\"type\":\"Dialog\"},{\"id\":590459437,\"predicate\":\"photoEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"Photo\"},{\"id\":-82216347,\"predicate\":\"photo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"has_stickers\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"sizes\",\"type\":\"Vector\"},{\"name\":\"video_sizes\",\"type\":\"flags.1?Vector\"},{\"name\":\"dc_id\",\"type\":\"int\"}],\"type\":\"Photo\"},{\"id\":236446268,\"predicate\":\"photoSizeEmpty\",\"params\":[{\"name\":\"type\",\"type\":\"string\"}],\"type\":\"PhotoSize\"},{\"id\":1976012384,\"predicate\":\"photoSize\",\"params\":[{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"},{\"name\":\"size\",\"type\":\"int\"}],\"type\":\"PhotoSize\"},{\"id\":35527382,\"predicate\":\"photoCachedSize\",\"params\":[{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"PhotoSize\"},{\"id\":286776671,\"predicate\":\"geoPointEmpty\",\"params\":[],\"type\":\"GeoPoint\"},{\"id\":-1297942941,\"predicate\":\"geoPoint\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"long\",\"type\":\"double\"},{\"name\":\"lat\",\"type\":\"double\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"accuracy_radius\",\"type\":\"flags.0?int\"}],\"type\":\"GeoPoint\"},{\"id\":1577067778,\"predicate\":\"auth.sentCode\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"type\",\"type\":\"auth.SentCodeType\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"next_type\",\"type\":\"flags.1?auth.CodeType\"},{\"name\":\"timeout\",\"type\":\"flags.2?int\"}],\"type\":\"auth.SentCode\"},{\"id\":782418132,\"predicate\":\"auth.authorization\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"setup_password_required\",\"type\":\"flags.1?true\"},{\"name\":\"otherwise_relogin_days\",\"type\":\"flags.1?int\"},{\"name\":\"tmp_sessions\",\"type\":\"flags.0?int\"},{\"name\":\"future_auth_token\",\"type\":\"flags.2?bytes\"},{\"name\":\"user\",\"type\":\"User\"}],\"type\":\"auth.Authorization\"},{\"id\":-1271602504,\"predicate\":\"auth.exportedAuthorization\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"auth.ExportedAuthorization\"},{\"id\":-1195615476,\"predicate\":\"inputNotifyPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"InputNotifyPeer\"},{\"id\":423314455,\"predicate\":\"inputNotifyUsers\",\"params\":[],\"type\":\"InputNotifyPeer\"},{\"id\":1251338318,\"predicate\":\"inputNotifyChats\",\"params\":[],\"type\":\"InputNotifyPeer\"},{\"id\":-551616469,\"predicate\":\"inputPeerNotifySettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"show_previews\",\"type\":\"flags.0?Bool\"},{\"name\":\"silent\",\"type\":\"flags.1?Bool\"},{\"name\":\"mute_until\",\"type\":\"flags.2?int\"},{\"name\":\"sound\",\"type\":\"flags.3?NotificationSound\"}],\"type\":\"InputPeerNotifySettings\"},{\"id\":-1472527322,\"predicate\":\"peerNotifySettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"show_previews\",\"type\":\"flags.0?Bool\"},{\"name\":\"silent\",\"type\":\"flags.1?Bool\"},{\"name\":\"mute_until\",\"type\":\"flags.2?int\"},{\"name\":\"ios_sound\",\"type\":\"flags.3?NotificationSound\"},{\"name\":\"android_sound\",\"type\":\"flags.4?NotificationSound\"},{\"name\":\"other_sound\",\"type\":\"flags.5?NotificationSound\"}],\"type\":\"PeerNotifySettings\"},{\"id\":-1525149427,\"predicate\":\"peerSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"report_spam\",\"type\":\"flags.0?true\"},{\"name\":\"add_contact\",\"type\":\"flags.1?true\"},{\"name\":\"block_contact\",\"type\":\"flags.2?true\"},{\"name\":\"share_contact\",\"type\":\"flags.3?true\"},{\"name\":\"need_contacts_exception\",\"type\":\"flags.4?true\"},{\"name\":\"report_geo\",\"type\":\"flags.5?true\"},{\"name\":\"autoarchived\",\"type\":\"flags.7?true\"},{\"name\":\"invite_members\",\"type\":\"flags.8?true\"},{\"name\":\"request_chat_broadcast\",\"type\":\"flags.10?true\"},{\"name\":\"geo_distance\",\"type\":\"flags.6?int\"},{\"name\":\"request_chat_title\",\"type\":\"flags.9?string\"},{\"name\":\"request_chat_date\",\"type\":\"flags.9?int\"}],\"type\":\"PeerSettings\"},{\"id\":-1539849235,\"predicate\":\"wallPaper\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"creator\",\"type\":\"flags.0?true\"},{\"name\":\"default\",\"type\":\"flags.1?true\"},{\"name\":\"pattern\",\"type\":\"flags.3?true\"},{\"name\":\"dark\",\"type\":\"flags.4?true\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"slug\",\"type\":\"string\"},{\"name\":\"document\",\"type\":\"Document\"},{\"name\":\"settings\",\"type\":\"flags.2?WallPaperSettings\"}],\"type\":\"WallPaper\"},{\"id\":1490799288,\"predicate\":\"inputReportReasonSpam\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":505595789,\"predicate\":\"inputReportReasonViolence\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":777640226,\"predicate\":\"inputReportReasonPornography\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":-1376497949,\"predicate\":\"inputReportReasonChildAbuse\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":-1041980751,\"predicate\":\"inputReportReasonOther\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":-120378643,\"predicate\":\"userFull\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"blocked\",\"type\":\"flags.0?true\"},{\"name\":\"phone_calls_available\",\"type\":\"flags.4?true\"},{\"name\":\"phone_calls_private\",\"type\":\"flags.5?true\"},{\"name\":\"can_pin_message\",\"type\":\"flags.7?true\"},{\"name\":\"has_scheduled\",\"type\":\"flags.12?true\"},{\"name\":\"video_calls_available\",\"type\":\"flags.13?true\"},{\"name\":\"voice_messages_forbidden\",\"type\":\"flags.20?true\"},{\"name\":\"translations_disabled\",\"type\":\"flags.23?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"about\",\"type\":\"flags.1?string\"},{\"name\":\"settings\",\"type\":\"PeerSettings\"},{\"name\":\"personal_photo\",\"type\":\"flags.21?Photo\"},{\"name\":\"profile_photo\",\"type\":\"flags.2?Photo\"},{\"name\":\"fallback_photo\",\"type\":\"flags.22?Photo\"},{\"name\":\"notify_settings\",\"type\":\"PeerNotifySettings\"},{\"name\":\"bot_info\",\"type\":\"flags.3?BotInfo\"},{\"name\":\"pinned_msg_id\",\"type\":\"flags.6?int\"},{\"name\":\"common_chats_count\",\"type\":\"int\"},{\"name\":\"folder_id\",\"type\":\"flags.11?int\"},{\"name\":\"ttl_period\",\"type\":\"flags.14?int\"},{\"name\":\"theme_emoticon\",\"type\":\"flags.15?string\"},{\"name\":\"private_forward_name\",\"type\":\"flags.16?string\"},{\"name\":\"bot_group_admin_rights\",\"type\":\"flags.17?ChatAdminRights\"},{\"name\":\"bot_broadcast_admin_rights\",\"type\":\"flags.18?ChatAdminRights\"},{\"name\":\"premium_gifts\",\"type\":\"flags.19?Vector\"}],\"type\":\"UserFull\"},{\"id\":341499403,\"predicate\":\"contact\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"mutual\",\"type\":\"Bool\"}],\"type\":\"Contact\"},{\"id\":-1052885936,\"predicate\":\"importedContact\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"client_id\",\"type\":\"long\"}],\"type\":\"ImportedContact\"},{\"id\":383348795,\"predicate\":\"contactStatus\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"status\",\"type\":\"UserStatus\"}],\"type\":\"ContactStatus\"},{\"id\":-1219778094,\"predicate\":\"contacts.contactsNotModified\",\"params\":[],\"type\":\"contacts.Contacts\"},{\"id\":-353862078,\"predicate\":\"contacts.contacts\",\"params\":[{\"name\":\"contacts\",\"type\":\"Vector\"},{\"name\":\"saved_count\",\"type\":\"int\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.Contacts\"},{\"id\":2010127419,\"predicate\":\"contacts.importedContacts\",\"params\":[{\"name\":\"imported\",\"type\":\"Vector\"},{\"name\":\"popular_invites\",\"type\":\"Vector\"},{\"name\":\"retry_contacts\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.ImportedContacts\"},{\"id\":182326673,\"predicate\":\"contacts.blocked\",\"params\":[{\"name\":\"blocked\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.Blocked\"},{\"id\":-513392236,\"predicate\":\"contacts.blockedSlice\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"blocked\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.Blocked\"},{\"id\":364538944,\"predicate\":\"messages.dialogs\",\"params\":[{\"name\":\"dialogs\",\"type\":\"Vector\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.Dialogs\"},{\"id\":1910543603,\"predicate\":\"messages.dialogsSlice\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"dialogs\",\"type\":\"Vector\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.Dialogs\"},{\"id\":-1938715001,\"predicate\":\"messages.messages\",\"params\":[{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":978610270,\"predicate\":\"messages.messagesSlice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"inexact\",\"type\":\"flags.1?true\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"next_rate\",\"type\":\"flags.0?int\"},{\"name\":\"offset_id_offset\",\"type\":\"flags.2?int\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":1694474197,\"predicate\":\"messages.chats\",\"params\":[{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"messages.Chats\"},{\"id\":-438840932,\"predicate\":\"messages.chatFull\",\"params\":[{\"name\":\"full_chat\",\"type\":\"ChatFull\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.ChatFull\"},{\"id\":-1269012015,\"predicate\":\"messages.affectedHistory\",\"params\":[{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"},{\"name\":\"offset\",\"type\":\"int\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":1474492012,\"predicate\":\"inputMessagesFilterEmpty\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1777752804,\"predicate\":\"inputMessagesFilterPhotos\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1614803355,\"predicate\":\"inputMessagesFilterVideo\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":1458172132,\"predicate\":\"inputMessagesFilterPhotoVideo\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1629621880,\"predicate\":\"inputMessagesFilterDocument\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":2129714567,\"predicate\":\"inputMessagesFilterUrl\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-3644025,\"predicate\":\"inputMessagesFilterGif\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":522914557,\"predicate\":\"updateNewMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":1318109142,\"predicate\":\"updateMessageID\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"random_id\",\"type\":\"long\"}],\"type\":\"Update\"},{\"id\":-1576161051,\"predicate\":\"updateDeleteMessages\",\"params\":[{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1071741569,\"predicate\":\"updateUserTyping\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"action\",\"type\":\"SendMessageAction\"}],\"type\":\"Update\"},{\"id\":-2092401936,\"predicate\":\"updateChatUserTyping\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"from_id\",\"type\":\"Peer\"},{\"name\":\"action\",\"type\":\"SendMessageAction\"}],\"type\":\"Update\"},{\"id\":125178264,\"predicate\":\"updateChatParticipants\",\"params\":[{\"name\":\"participants\",\"type\":\"ChatParticipants\"}],\"type\":\"Update\"},{\"id\":-440534818,\"predicate\":\"updateUserStatus\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"status\",\"type\":\"UserStatus\"}],\"type\":\"Update\"},{\"id\":-1484486364,\"predicate\":\"updateUserName\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"usernames\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":-1519637954,\"predicate\":\"updates.state\",\"params\":[{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"qts\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"seq\",\"type\":\"int\"},{\"name\":\"unread_count\",\"type\":\"int\"}],\"type\":\"updates.State\"},{\"id\":1567990072,\"predicate\":\"updates.differenceEmpty\",\"params\":[{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"seq\",\"type\":\"int\"}],\"type\":\"updates.Difference\"},{\"id\":16030880,\"predicate\":\"updates.difference\",\"params\":[{\"name\":\"new_messages\",\"type\":\"Vector\"},{\"name\":\"new_encrypted_messages\",\"type\":\"Vector\"},{\"name\":\"other_updates\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"state\",\"type\":\"updates.State\"}],\"type\":\"updates.Difference\"},{\"id\":-1459938943,\"predicate\":\"updates.differenceSlice\",\"params\":[{\"name\":\"new_messages\",\"type\":\"Vector\"},{\"name\":\"new_encrypted_messages\",\"type\":\"Vector\"},{\"name\":\"other_updates\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"intermediate_state\",\"type\":\"updates.State\"}],\"type\":\"updates.Difference\"},{\"id\":-484987010,\"predicate\":\"updatesTooLong\",\"params\":[],\"type\":\"Updates\"},{\"id\":826001400,\"predicate\":\"updateShortMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"out\",\"type\":\"flags.1?true\"},{\"name\":\"mentioned\",\"type\":\"flags.4?true\"},{\"name\":\"media_unread\",\"type\":\"flags.5?true\"},{\"name\":\"silent\",\"type\":\"flags.13?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"fwd_from\",\"type\":\"flags.2?MessageFwdHeader\"},{\"name\":\"via_bot_id\",\"type\":\"flags.11?long\"},{\"name\":\"reply_to\",\"type\":\"flags.3?MessageReplyHeader\"},{\"name\":\"entities\",\"type\":\"flags.7?Vector\"},{\"name\":\"ttl_period\",\"type\":\"flags.25?int\"}],\"type\":\"Updates\"},{\"id\":1299050149,\"predicate\":\"updateShortChatMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"out\",\"type\":\"flags.1?true\"},{\"name\":\"mentioned\",\"type\":\"flags.4?true\"},{\"name\":\"media_unread\",\"type\":\"flags.5?true\"},{\"name\":\"silent\",\"type\":\"flags.13?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"from_id\",\"type\":\"long\"},{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"fwd_from\",\"type\":\"flags.2?MessageFwdHeader\"},{\"name\":\"via_bot_id\",\"type\":\"flags.11?long\"},{\"name\":\"reply_to\",\"type\":\"flags.3?MessageReplyHeader\"},{\"name\":\"entities\",\"type\":\"flags.7?Vector\"},{\"name\":\"ttl_period\",\"type\":\"flags.25?int\"}],\"type\":\"Updates\"},{\"id\":2027216577,\"predicate\":\"updateShort\",\"params\":[{\"name\":\"update\",\"type\":\"Update\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":1918567619,\"predicate\":\"updatesCombined\",\"params\":[{\"name\":\"updates\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"seq_start\",\"type\":\"int\"},{\"name\":\"seq\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":1957577280,\"predicate\":\"updates\",\"params\":[{\"name\":\"updates\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"seq\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":-1916114267,\"predicate\":\"photos.photos\",\"params\":[{\"name\":\"photos\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"photos.Photos\"},{\"id\":352657236,\"predicate\":\"photos.photosSlice\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"photos\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"photos.Photos\"},{\"id\":539045032,\"predicate\":\"photos.photo\",\"params\":[{\"name\":\"photo\",\"type\":\"Photo\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"photos.Photo\"},{\"id\":157948117,\"predicate\":\"upload.file\",\"params\":[{\"name\":\"type\",\"type\":\"storage.FileType\"},{\"name\":\"mtime\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"upload.File\"},{\"id\":414687501,\"predicate\":\"dcOption\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"ipv6\",\"type\":\"flags.0?true\"},{\"name\":\"media_only\",\"type\":\"flags.1?true\"},{\"name\":\"tcpo_only\",\"type\":\"flags.2?true\"},{\"name\":\"cdn\",\"type\":\"flags.3?true\"},{\"name\":\"static\",\"type\":\"flags.4?true\"},{\"name\":\"this_port_only\",\"type\":\"flags.5?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"ip_address\",\"type\":\"string\"},{\"name\":\"port\",\"type\":\"int\"},{\"name\":\"secret\",\"type\":\"flags.10?bytes\"}],\"type\":\"DcOption\"},{\"id\":589653676,\"predicate\":\"config\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"phonecalls_enabled\",\"type\":\"flags.1?true\"},{\"name\":\"default_p2p_contacts\",\"type\":\"flags.3?true\"},{\"name\":\"preload_featured_stickers\",\"type\":\"flags.4?true\"},{\"name\":\"ignore_phone_entities\",\"type\":\"flags.5?true\"},{\"name\":\"revoke_pm_inbox\",\"type\":\"flags.6?true\"},{\"name\":\"blocked_mode\",\"type\":\"flags.8?true\"},{\"name\":\"pfs_enabled\",\"type\":\"flags.13?true\"},{\"name\":\"force_try_ipv6\",\"type\":\"flags.14?true\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"expires\",\"type\":\"int\"},{\"name\":\"test_mode\",\"type\":\"Bool\"},{\"name\":\"this_dc\",\"type\":\"int\"},{\"name\":\"dc_options\",\"type\":\"Vector\"},{\"name\":\"dc_txt_domain_name\",\"type\":\"string\"},{\"name\":\"chat_size_max\",\"type\":\"int\"},{\"name\":\"megagroup_size_max\",\"type\":\"int\"},{\"name\":\"forwarded_count_max\",\"type\":\"int\"},{\"name\":\"online_update_period_ms\",\"type\":\"int\"},{\"name\":\"offline_blur_timeout_ms\",\"type\":\"int\"},{\"name\":\"offline_idle_timeout_ms\",\"type\":\"int\"},{\"name\":\"online_cloud_timeout_ms\",\"type\":\"int\"},{\"name\":\"notify_cloud_delay_ms\",\"type\":\"int\"},{\"name\":\"notify_default_delay_ms\",\"type\":\"int\"},{\"name\":\"push_chat_period_ms\",\"type\":\"int\"},{\"name\":\"push_chat_limit\",\"type\":\"int\"},{\"name\":\"saved_gifs_limit\",\"type\":\"int\"},{\"name\":\"edit_time_limit\",\"type\":\"int\"},{\"name\":\"revoke_time_limit\",\"type\":\"int\"},{\"name\":\"revoke_pm_time_limit\",\"type\":\"int\"},{\"name\":\"rating_e_decay\",\"type\":\"int\"},{\"name\":\"stickers_recent_limit\",\"type\":\"int\"},{\"name\":\"stickers_faved_limit\",\"type\":\"int\"},{\"name\":\"channels_read_media_period\",\"type\":\"int\"},{\"name\":\"tmp_sessions\",\"type\":\"flags.0?int\"},{\"name\":\"pinned_dialogs_count_max\",\"type\":\"int\"},{\"name\":\"pinned_infolder_count_max\",\"type\":\"int\"},{\"name\":\"call_receive_timeout_ms\",\"type\":\"int\"},{\"name\":\"call_ring_timeout_ms\",\"type\":\"int\"},{\"name\":\"call_connect_timeout_ms\",\"type\":\"int\"},{\"name\":\"call_packet_timeout_ms\",\"type\":\"int\"},{\"name\":\"me_url_prefix\",\"type\":\"string\"},{\"name\":\"autoupdate_url_prefix\",\"type\":\"flags.7?string\"},{\"name\":\"gif_search_username\",\"type\":\"flags.9?string\"},{\"name\":\"venue_search_username\",\"type\":\"flags.10?string\"},{\"name\":\"img_search_username\",\"type\":\"flags.11?string\"},{\"name\":\"static_maps_provider\",\"type\":\"flags.12?string\"},{\"name\":\"caption_length_max\",\"type\":\"int\"},{\"name\":\"message_length_max\",\"type\":\"int\"},{\"name\":\"webfile_dc_id\",\"type\":\"int\"},{\"name\":\"suggested_lang_code\",\"type\":\"flags.2?string\"},{\"name\":\"lang_pack_version\",\"type\":\"flags.2?int\"},{\"name\":\"base_lang_pack_version\",\"type\":\"flags.2?int\"},{\"name\":\"reactions_default\",\"type\":\"flags.15?Reaction\"}],\"type\":\"Config\"},{\"id\":-1910892683,\"predicate\":\"nearestDc\",\"params\":[{\"name\":\"country\",\"type\":\"string\"},{\"name\":\"this_dc\",\"type\":\"int\"},{\"name\":\"nearest_dc\",\"type\":\"int\"}],\"type\":\"NearestDc\"},{\"id\":-860107216,\"predicate\":\"help.appUpdate\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"can_not_skip\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"string\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"Vector\"},{\"name\":\"document\",\"type\":\"flags.1?Document\"},{\"name\":\"url\",\"type\":\"flags.2?string\"},{\"name\":\"sticker\",\"type\":\"flags.3?Document\"}],\"type\":\"help.AppUpdate\"},{\"id\":-1000708810,\"predicate\":\"help.noAppUpdate\",\"params\":[],\"type\":\"help.AppUpdate\"},{\"id\":415997816,\"predicate\":\"help.inviteText\",\"params\":[{\"name\":\"message\",\"type\":\"string\"}],\"type\":\"help.InviteText\"},{\"id\":314359194,\"predicate\":\"updateNewEncryptedMessage\",\"params\":[{\"name\":\"message\",\"type\":\"EncryptedMessage\"},{\"name\":\"qts\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":386986326,\"predicate\":\"updateEncryptedChatTyping\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1264392051,\"predicate\":\"updateEncryption\",\"params\":[{\"name\":\"chat\",\"type\":\"EncryptedChat\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":956179895,\"predicate\":\"updateEncryptedMessagesRead\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"max_date\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1417756512,\"predicate\":\"encryptedChatEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"EncryptedChat\"},{\"id\":1722964307,\"predicate\":\"encryptedChatWaiting\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"participant_id\",\"type\":\"long\"}],\"type\":\"EncryptedChat\"},{\"id\":1223809356,\"predicate\":\"encryptedChatRequested\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"folder_id\",\"type\":\"flags.0?int\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"participant_id\",\"type\":\"long\"},{\"name\":\"g_a\",\"type\":\"bytes\"}],\"type\":\"EncryptedChat\"},{\"id\":1643173063,\"predicate\":\"encryptedChat\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"participant_id\",\"type\":\"long\"},{\"name\":\"g_a_or_b\",\"type\":\"bytes\"},{\"name\":\"key_fingerprint\",\"type\":\"long\"}],\"type\":\"EncryptedChat\"},{\"id\":505183301,\"predicate\":\"encryptedChatDiscarded\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"history_deleted\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"EncryptedChat\"},{\"id\":-247351839,\"predicate\":\"inputEncryptedChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputEncryptedChat\"},{\"id\":-1038136962,\"predicate\":\"encryptedFileEmpty\",\"params\":[],\"type\":\"EncryptedFile\"},{\"id\":-1476358952,\"predicate\":\"encryptedFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"size\",\"type\":\"long\"},{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"key_fingerprint\",\"type\":\"int\"}],\"type\":\"EncryptedFile\"},{\"id\":406307684,\"predicate\":\"inputEncryptedFileEmpty\",\"params\":[],\"type\":\"InputEncryptedFile\"},{\"id\":1690108678,\"predicate\":\"inputEncryptedFileUploaded\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"parts\",\"type\":\"int\"},{\"name\":\"md5_checksum\",\"type\":\"string\"},{\"name\":\"key_fingerprint\",\"type\":\"int\"}],\"type\":\"InputEncryptedFile\"},{\"id\":1511503333,\"predicate\":\"inputEncryptedFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputEncryptedFile\"},{\"id\":-182231723,\"predicate\":\"inputEncryptedFileLocation\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputFileLocation\"},{\"id\":-317144808,\"predicate\":\"encryptedMessage\",\"params\":[{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"},{\"name\":\"file\",\"type\":\"EncryptedFile\"}],\"type\":\"EncryptedMessage\"},{\"id\":594758406,\"predicate\":\"encryptedMessageService\",\"params\":[{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"EncryptedMessage\"},{\"id\":-1058912715,\"predicate\":\"messages.dhConfigNotModified\",\"params\":[{\"name\":\"random\",\"type\":\"bytes\"}],\"type\":\"messages.DhConfig\"},{\"id\":740433629,\"predicate\":\"messages.dhConfig\",\"params\":[{\"name\":\"g\",\"type\":\"int\"},{\"name\":\"p\",\"type\":\"bytes\"},{\"name\":\"version\",\"type\":\"int\"},{\"name\":\"random\",\"type\":\"bytes\"}],\"type\":\"messages.DhConfig\"},{\"id\":1443858741,\"predicate\":\"messages.sentEncryptedMessage\",\"params\":[{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"messages.SentEncryptedMessage\"},{\"id\":-1802240206,\"predicate\":\"messages.sentEncryptedFile\",\"params\":[{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"file\",\"type\":\"EncryptedFile\"}],\"type\":\"messages.SentEncryptedMessage\"},{\"id\":-95482955,\"predicate\":\"inputFileBig\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"parts\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}],\"type\":\"InputFile\"},{\"id\":767652808,\"predicate\":\"inputEncryptedFileBigUploaded\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"parts\",\"type\":\"int\"},{\"name\":\"key_fingerprint\",\"type\":\"int\"}],\"type\":\"InputEncryptedFile\"},{\"id\":1037718609,\"predicate\":\"updateChatParticipantAdd\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"inviter_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-483443337,\"predicate\":\"updateChatParticipantDelete\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1906403213,\"predicate\":\"updateDcOptions\",\"params\":[{\"name\":\"dc_options\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":1530447553,\"predicate\":\"inputMediaUploadedDocument\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"nosound_video\",\"type\":\"flags.3?true\"},{\"name\":\"force_file\",\"type\":\"flags.4?true\"},{\"name\":\"spoiler\",\"type\":\"flags.5?true\"},{\"name\":\"file\",\"type\":\"InputFile\"},{\"name\":\"thumb\",\"type\":\"flags.2?InputFile\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"attributes\",\"type\":\"Vector\"},{\"name\":\"stickers\",\"type\":\"flags.0?Vector\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.1?int\"}],\"type\":\"InputMedia\"},{\"id\":860303448,\"predicate\":\"inputMediaDocument\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"spoiler\",\"type\":\"flags.2?true\"},{\"name\":\"id\",\"type\":\"InputDocument\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.0?int\"},{\"name\":\"query\",\"type\":\"flags.1?string\"}],\"type\":\"InputMedia\"},{\"id\":-1666158377,\"predicate\":\"messageMediaDocument\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"nopremium\",\"type\":\"flags.3?true\"},{\"name\":\"spoiler\",\"type\":\"flags.4?true\"},{\"name\":\"document\",\"type\":\"flags.0?Document\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.2?int\"}],\"type\":\"MessageMedia\"},{\"id\":1928391342,\"predicate\":\"inputDocumentEmpty\",\"params\":[],\"type\":\"InputDocument\"},{\"id\":448771445,\"predicate\":\"inputDocument\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"}],\"type\":\"InputDocument\"},{\"id\":-1160743548,\"predicate\":\"inputDocumentFileLocation\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"},{\"name\":\"thumb_size\",\"type\":\"string\"}],\"type\":\"InputFileLocation\"},{\"id\":922273905,\"predicate\":\"documentEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"Document\"},{\"id\":-1881881384,\"predicate\":\"document\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"size\",\"type\":\"long\"},{\"name\":\"thumbs\",\"type\":\"flags.0?Vector\"},{\"name\":\"video_thumbs\",\"type\":\"flags.1?Vector\"},{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"attributes\",\"type\":\"Vector\"}],\"type\":\"Document\"},{\"id\":398898678,\"predicate\":\"help.support\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"user\",\"type\":\"User\"}],\"type\":\"help.Support\"},{\"id\":-1613493288,\"predicate\":\"notifyPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"}],\"type\":\"NotifyPeer\"},{\"id\":-1261946036,\"predicate\":\"notifyUsers\",\"params\":[],\"type\":\"NotifyPeer\"},{\"id\":-1073230141,\"predicate\":\"notifyChats\",\"params\":[],\"type\":\"NotifyPeer\"},{\"id\":-1094555409,\"predicate\":\"updateNotifySettings\",\"params\":[{\"name\":\"peer\",\"type\":\"NotifyPeer\"},{\"name\":\"notify_settings\",\"type\":\"PeerNotifySettings\"}],\"type\":\"Update\"},{\"id\":381645902,\"predicate\":\"sendMessageTypingAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":-44119819,\"predicate\":\"sendMessageCancelAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":-1584933265,\"predicate\":\"sendMessageRecordVideoAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":-378127636,\"predicate\":\"sendMessageUploadVideoAction\",\"params\":[{\"name\":\"progress\",\"type\":\"int\"}],\"type\":\"SendMessageAction\"},{\"id\":-718310409,\"predicate\":\"sendMessageRecordAudioAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":-212740181,\"predicate\":\"sendMessageUploadAudioAction\",\"params\":[{\"name\":\"progress\",\"type\":\"int\"}],\"type\":\"SendMessageAction\"},{\"id\":-774682074,\"predicate\":\"sendMessageUploadPhotoAction\",\"params\":[{\"name\":\"progress\",\"type\":\"int\"}],\"type\":\"SendMessageAction\"},{\"id\":-1441998364,\"predicate\":\"sendMessageUploadDocumentAction\",\"params\":[{\"name\":\"progress\",\"type\":\"int\"}],\"type\":\"SendMessageAction\"},{\"id\":393186209,\"predicate\":\"sendMessageGeoLocationAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":1653390447,\"predicate\":\"sendMessageChooseContactAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":-1290580579,\"predicate\":\"contacts.found\",\"params\":[{\"name\":\"my_results\",\"type\":\"Vector\"},{\"name\":\"results\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.Found\"},{\"id\":-337352679,\"predicate\":\"updateServiceNotification\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"popup\",\"type\":\"flags.0?true\"},{\"name\":\"inbox_date\",\"type\":\"flags.1?int\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"media\",\"type\":\"MessageMedia\"},{\"name\":\"entities\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":-496024847,\"predicate\":\"userStatusRecently\",\"params\":[],\"type\":\"UserStatus\"},{\"id\":129960444,\"predicate\":\"userStatusLastWeek\",\"params\":[],\"type\":\"UserStatus\"},{\"id\":2011940674,\"predicate\":\"userStatusLastMonth\",\"params\":[],\"type\":\"UserStatus\"},{\"id\":-298113238,\"predicate\":\"updatePrivacy\",\"params\":[{\"name\":\"key\",\"type\":\"PrivacyKey\"},{\"name\":\"rules\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":1335282456,\"predicate\":\"inputPrivacyKeyStatusTimestamp\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":-1137792208,\"predicate\":\"privacyKeyStatusTimestamp\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":218751099,\"predicate\":\"inputPrivacyValueAllowContacts\",\"params\":[],\"type\":\"InputPrivacyRule\"},{\"id\":407582158,\"predicate\":\"inputPrivacyValueAllowAll\",\"params\":[],\"type\":\"InputPrivacyRule\"},{\"id\":320652927,\"predicate\":\"inputPrivacyValueAllowUsers\",\"params\":[{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"InputPrivacyRule\"},{\"id\":195371015,\"predicate\":\"inputPrivacyValueDisallowContacts\",\"params\":[],\"type\":\"InputPrivacyRule\"},{\"id\":-697604407,\"predicate\":\"inputPrivacyValueDisallowAll\",\"params\":[],\"type\":\"InputPrivacyRule\"},{\"id\":-1877932953,\"predicate\":\"inputPrivacyValueDisallowUsers\",\"params\":[{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"InputPrivacyRule\"},{\"id\":-123988,\"predicate\":\"privacyValueAllowContacts\",\"params\":[],\"type\":\"PrivacyRule\"},{\"id\":1698855810,\"predicate\":\"privacyValueAllowAll\",\"params\":[],\"type\":\"PrivacyRule\"},{\"id\":-1198497870,\"predicate\":\"privacyValueAllowUsers\",\"params\":[{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"PrivacyRule\"},{\"id\":-125240806,\"predicate\":\"privacyValueDisallowContacts\",\"params\":[],\"type\":\"PrivacyRule\"},{\"id\":-1955338397,\"predicate\":\"privacyValueDisallowAll\",\"params\":[],\"type\":\"PrivacyRule\"},{\"id\":-463335103,\"predicate\":\"privacyValueDisallowUsers\",\"params\":[{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"PrivacyRule\"},{\"id\":1352683077,\"predicate\":\"account.privacyRules\",\"params\":[{\"name\":\"rules\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"account.PrivacyRules\"},{\"id\":-1194283041,\"predicate\":\"accountDaysTTL\",\"params\":[{\"name\":\"days\",\"type\":\"int\"}],\"type\":\"AccountDaysTTL\"},{\"id\":88680979,\"predicate\":\"updateUserPhone\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"phone\",\"type\":\"string\"}],\"type\":\"Update\"},{\"id\":1815593308,\"predicate\":\"documentAttributeImageSize\",\"params\":[{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"}],\"type\":\"DocumentAttribute\"},{\"id\":297109817,\"predicate\":\"documentAttributeAnimated\",\"params\":[],\"type\":\"DocumentAttribute\"},{\"id\":1662637586,\"predicate\":\"documentAttributeSticker\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"mask\",\"type\":\"flags.1?true\"},{\"name\":\"alt\",\"type\":\"string\"},{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"mask_coords\",\"type\":\"flags.0?MaskCoords\"}],\"type\":\"DocumentAttribute\"},{\"id\":250621158,\"predicate\":\"documentAttributeVideo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"round_message\",\"type\":\"flags.0?true\"},{\"name\":\"supports_streaming\",\"type\":\"flags.1?true\"},{\"name\":\"duration\",\"type\":\"int\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"}],\"type\":\"DocumentAttribute\"},{\"id\":-1739392570,\"predicate\":\"documentAttributeAudio\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"voice\",\"type\":\"flags.10?true\"},{\"name\":\"duration\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"flags.0?string\"},{\"name\":\"performer\",\"type\":\"flags.1?string\"},{\"name\":\"waveform\",\"type\":\"flags.2?bytes\"}],\"type\":\"DocumentAttribute\"},{\"id\":358154344,\"predicate\":\"documentAttributeFilename\",\"params\":[{\"name\":\"file_name\",\"type\":\"string\"}],\"type\":\"DocumentAttribute\"},{\"id\":-244016606,\"predicate\":\"messages.stickersNotModified\",\"params\":[],\"type\":\"messages.Stickers\"},{\"id\":816245886,\"predicate\":\"messages.stickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"stickers\",\"type\":\"Vector\"}],\"type\":\"messages.Stickers\"},{\"id\":313694676,\"predicate\":\"stickerPack\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"},{\"name\":\"documents\",\"type\":\"Vector\"}],\"type\":\"StickerPack\"},{\"id\":-395967805,\"predicate\":\"messages.allStickersNotModified\",\"params\":[],\"type\":\"messages.AllStickers\"},{\"id\":-843329861,\"predicate\":\"messages.allStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"sets\",\"type\":\"Vector\"}],\"type\":\"messages.AllStickers\"},{\"id\":-1667805217,\"predicate\":\"updateReadHistoryInbox\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"folder_id\",\"type\":\"flags.0?int\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"still_unread_count\",\"type\":\"int\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":791617983,\"predicate\":\"updateReadHistoryOutbox\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-2066640507,\"predicate\":\"messages.affectedMessages\",\"params\":[{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"messages.AffectedMessages\"},{\"id\":2139689491,\"predicate\":\"updateWebPage\",\"params\":[{\"name\":\"webpage\",\"type\":\"WebPage\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-350980120,\"predicate\":\"webPageEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"WebPage\"},{\"id\":-981018084,\"predicate\":\"webPagePending\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"WebPage\"},{\"id\":-392411726,\"predicate\":\"webPage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"display_url\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"type\",\"type\":\"flags.0?string\"},{\"name\":\"site_name\",\"type\":\"flags.1?string\"},{\"name\":\"title\",\"type\":\"flags.2?string\"},{\"name\":\"description\",\"type\":\"flags.3?string\"},{\"name\":\"photo\",\"type\":\"flags.4?Photo\"},{\"name\":\"embed_url\",\"type\":\"flags.5?string\"},{\"name\":\"embed_type\",\"type\":\"flags.5?string\"},{\"name\":\"embed_width\",\"type\":\"flags.6?int\"},{\"name\":\"embed_height\",\"type\":\"flags.6?int\"},{\"name\":\"duration\",\"type\":\"flags.7?int\"},{\"name\":\"author\",\"type\":\"flags.8?string\"},{\"name\":\"document\",\"type\":\"flags.9?Document\"},{\"name\":\"cached_page\",\"type\":\"flags.10?Page\"},{\"name\":\"attributes\",\"type\":\"flags.12?Vector\"}],\"type\":\"WebPage\"},{\"id\":-1557277184,\"predicate\":\"messageMediaWebPage\",\"params\":[{\"name\":\"webpage\",\"type\":\"WebPage\"}],\"type\":\"MessageMedia\"},{\"id\":-1392388579,\"predicate\":\"authorization\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"current\",\"type\":\"flags.0?true\"},{\"name\":\"official_app\",\"type\":\"flags.1?true\"},{\"name\":\"password_pending\",\"type\":\"flags.2?true\"},{\"name\":\"encrypted_requests_disabled\",\"type\":\"flags.3?true\"},{\"name\":\"call_requests_disabled\",\"type\":\"flags.4?true\"},{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"device_model\",\"type\":\"string\"},{\"name\":\"platform\",\"type\":\"string\"},{\"name\":\"system_version\",\"type\":\"string\"},{\"name\":\"api_id\",\"type\":\"int\"},{\"name\":\"app_name\",\"type\":\"string\"},{\"name\":\"app_version\",\"type\":\"string\"},{\"name\":\"date_created\",\"type\":\"int\"},{\"name\":\"date_active\",\"type\":\"int\"},{\"name\":\"ip\",\"type\":\"string\"},{\"name\":\"country\",\"type\":\"string\"},{\"name\":\"region\",\"type\":\"string\"}],\"type\":\"Authorization\"},{\"id\":1275039392,\"predicate\":\"account.authorizations\",\"params\":[{\"name\":\"authorization_ttl_days\",\"type\":\"int\"},{\"name\":\"authorizations\",\"type\":\"Vector\"}],\"type\":\"account.Authorizations\"},{\"id\":-1787080453,\"predicate\":\"account.password\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"has_recovery\",\"type\":\"flags.0?true\"},{\"name\":\"has_secure_values\",\"type\":\"flags.1?true\"},{\"name\":\"has_password\",\"type\":\"flags.2?true\"},{\"name\":\"current_algo\",\"type\":\"flags.2?PasswordKdfAlgo\"},{\"name\":\"srp_B\",\"type\":\"flags.2?bytes\"},{\"name\":\"srp_id\",\"type\":\"flags.2?long\"},{\"name\":\"hint\",\"type\":\"flags.3?string\"},{\"name\":\"email_unconfirmed_pattern\",\"type\":\"flags.4?string\"},{\"name\":\"new_algo\",\"type\":\"PasswordKdfAlgo\"},{\"name\":\"new_secure_algo\",\"type\":\"SecurePasswordKdfAlgo\"},{\"name\":\"secure_random\",\"type\":\"bytes\"},{\"name\":\"pending_reset_date\",\"type\":\"flags.5?int\"},{\"name\":\"login_email_pattern\",\"type\":\"flags.6?string\"}],\"type\":\"account.Password\"},{\"id\":-1705233435,\"predicate\":\"account.passwordSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"email\",\"type\":\"flags.0?string\"},{\"name\":\"secure_settings\",\"type\":\"flags.1?SecureSecretSettings\"}],\"type\":\"account.PasswordSettings\"},{\"id\":-1036572727,\"predicate\":\"account.passwordInputSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"new_algo\",\"type\":\"flags.0?PasswordKdfAlgo\"},{\"name\":\"new_password_hash\",\"type\":\"flags.0?bytes\"},{\"name\":\"hint\",\"type\":\"flags.0?string\"},{\"name\":\"email\",\"type\":\"flags.1?string\"},{\"name\":\"new_secure_settings\",\"type\":\"flags.2?SecureSecretSettings\"}],\"type\":\"account.PasswordInputSettings\"},{\"id\":326715557,\"predicate\":\"auth.passwordRecovery\",\"params\":[{\"name\":\"email_pattern\",\"type\":\"string\"}],\"type\":\"auth.PasswordRecovery\"},{\"id\":-1052959727,\"predicate\":\"inputMediaVenue\",\"params\":[{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"string\"},{\"name\":\"provider\",\"type\":\"string\"},{\"name\":\"venue_id\",\"type\":\"string\"},{\"name\":\"venue_type\",\"type\":\"string\"}],\"type\":\"InputMedia\"},{\"id\":784356159,\"predicate\":\"messageMediaVenue\",\"params\":[{\"name\":\"geo\",\"type\":\"GeoPoint\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"string\"},{\"name\":\"provider\",\"type\":\"string\"},{\"name\":\"venue_id\",\"type\":\"string\"},{\"name\":\"venue_type\",\"type\":\"string\"}],\"type\":\"MessageMedia\"},{\"id\":-1551583367,\"predicate\":\"receivedNotifyMessage\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"flags\",\"type\":\"int\"}],\"type\":\"ReceivedNotifyMessage\"},{\"id\":179611673,\"predicate\":\"chatInviteExported\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"revoked\",\"type\":\"flags.0?true\"},{\"name\":\"permanent\",\"type\":\"flags.5?true\"},{\"name\":\"request_needed\",\"type\":\"flags.6?true\"},{\"name\":\"link\",\"type\":\"string\"},{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"start_date\",\"type\":\"flags.4?int\"},{\"name\":\"expire_date\",\"type\":\"flags.1?int\"},{\"name\":\"usage_limit\",\"type\":\"flags.2?int\"},{\"name\":\"usage\",\"type\":\"flags.3?int\"},{\"name\":\"requested\",\"type\":\"flags.7?int\"},{\"name\":\"title\",\"type\":\"flags.8?string\"}],\"type\":\"ExportedChatInvite\"},{\"id\":1516793212,\"predicate\":\"chatInviteAlready\",\"params\":[{\"name\":\"chat\",\"type\":\"Chat\"}],\"type\":\"ChatInvite\"},{\"id\":806110401,\"predicate\":\"chatInvite\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel\",\"type\":\"flags.0?true\"},{\"name\":\"broadcast\",\"type\":\"flags.1?true\"},{\"name\":\"public\",\"type\":\"flags.2?true\"},{\"name\":\"megagroup\",\"type\":\"flags.3?true\"},{\"name\":\"request_needed\",\"type\":\"flags.6?true\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"about\",\"type\":\"flags.5?string\"},{\"name\":\"photo\",\"type\":\"Photo\"},{\"name\":\"participants_count\",\"type\":\"int\"},{\"name\":\"participants\",\"type\":\"flags.4?Vector\"}],\"type\":\"ChatInvite\"},{\"id\":51520707,\"predicate\":\"messageActionChatJoinedByLink\",\"params\":[{\"name\":\"inviter_id\",\"type\":\"long\"}],\"type\":\"MessageAction\"},{\"id\":1757493555,\"predicate\":\"updateReadMessagesContents\",\"params\":[{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-4838507,\"predicate\":\"inputStickerSetEmpty\",\"params\":[],\"type\":\"InputStickerSet\"},{\"id\":-1645763991,\"predicate\":\"inputStickerSetID\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputStickerSet\"},{\"id\":-2044933984,\"predicate\":\"inputStickerSetShortName\",\"params\":[{\"name\":\"short_name\",\"type\":\"string\"}],\"type\":\"InputStickerSet\"},{\"id\":768691932,\"predicate\":\"stickerSet\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"archived\",\"type\":\"flags.1?true\"},{\"name\":\"official\",\"type\":\"flags.2?true\"},{\"name\":\"masks\",\"type\":\"flags.3?true\"},{\"name\":\"animated\",\"type\":\"flags.5?true\"},{\"name\":\"videos\",\"type\":\"flags.6?true\"},{\"name\":\"emojis\",\"type\":\"flags.7?true\"},{\"name\":\"installed_date\",\"type\":\"flags.0?int\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"short_name\",\"type\":\"string\"},{\"name\":\"thumbs\",\"type\":\"flags.4?Vector\"},{\"name\":\"thumb_dc_id\",\"type\":\"flags.4?int\"},{\"name\":\"thumb_version\",\"type\":\"flags.4?int\"},{\"name\":\"thumb_document_id\",\"type\":\"flags.8?long\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"StickerSet\"},{\"id\":1846886166,\"predicate\":\"messages.stickerSet\",\"params\":[{\"name\":\"set\",\"type\":\"StickerSet\"},{\"name\":\"packs\",\"type\":\"Vector\"},{\"name\":\"keywords\",\"type\":\"Vector\"},{\"name\":\"documents\",\"type\":\"Vector\"}],\"type\":\"messages.StickerSet\"},{\"id\":-1885878744,\"predicate\":\"user\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"self\",\"type\":\"flags.10?true\"},{\"name\":\"contact\",\"type\":\"flags.11?true\"},{\"name\":\"mutual_contact\",\"type\":\"flags.12?true\"},{\"name\":\"deleted\",\"type\":\"flags.13?true\"},{\"name\":\"bot\",\"type\":\"flags.14?true\"},{\"name\":\"bot_chat_history\",\"type\":\"flags.15?true\"},{\"name\":\"bot_nochats\",\"type\":\"flags.16?true\"},{\"name\":\"verified\",\"type\":\"flags.17?true\"},{\"name\":\"restricted\",\"type\":\"flags.18?true\"},{\"name\":\"min\",\"type\":\"flags.20?true\"},{\"name\":\"bot_inline_geo\",\"type\":\"flags.21?true\"},{\"name\":\"support\",\"type\":\"flags.23?true\"},{\"name\":\"scam\",\"type\":\"flags.24?true\"},{\"name\":\"apply_min_photo\",\"type\":\"flags.25?true\"},{\"name\":\"fake\",\"type\":\"flags.26?true\"},{\"name\":\"bot_attach_menu\",\"type\":\"flags.27?true\"},{\"name\":\"premium\",\"type\":\"flags.28?true\"},{\"name\":\"attach_menu_enabled\",\"type\":\"flags.29?true\"},{\"name\":\"flags2\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"flags.0?long\"},{\"name\":\"first_name\",\"type\":\"flags.1?string\"},{\"name\":\"last_name\",\"type\":\"flags.2?string\"},{\"name\":\"username\",\"type\":\"flags.3?string\"},{\"name\":\"phone\",\"type\":\"flags.4?string\"},{\"name\":\"photo\",\"type\":\"flags.5?UserProfilePhoto\"},{\"name\":\"status\",\"type\":\"flags.6?UserStatus\"},{\"name\":\"bot_info_version\",\"type\":\"flags.14?int\"},{\"name\":\"restriction_reason\",\"type\":\"flags.18?Vector\"},{\"name\":\"bot_inline_placeholder\",\"type\":\"flags.19?string\"},{\"name\":\"lang_code\",\"type\":\"flags.22?string\"},{\"name\":\"emoji_status\",\"type\":\"flags.30?EmojiStatus\"},{\"name\":\"usernames\",\"type\":\"flags2.0?Vector\"}],\"type\":\"User\"},{\"id\":-1032140601,\"predicate\":\"botCommand\",\"params\":[{\"name\":\"command\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"}],\"type\":\"BotCommand\"},{\"id\":-1892676777,\"predicate\":\"botInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"user_id\",\"type\":\"flags.0?long\"},{\"name\":\"description\",\"type\":\"flags.1?string\"},{\"name\":\"description_photo\",\"type\":\"flags.4?Photo\"},{\"name\":\"description_document\",\"type\":\"flags.5?Document\"},{\"name\":\"commands\",\"type\":\"flags.2?Vector\"},{\"name\":\"menu_button\",\"type\":\"flags.3?BotMenuButton\"}],\"type\":\"BotInfo\"},{\"id\":-1560655744,\"predicate\":\"keyboardButton\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":2002815875,\"predicate\":\"keyboardButtonRow\",\"params\":[{\"name\":\"buttons\",\"type\":\"Vector\"}],\"type\":\"KeyboardButtonRow\"},{\"id\":-1606526075,\"predicate\":\"replyKeyboardHide\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"selective\",\"type\":\"flags.2?true\"}],\"type\":\"ReplyMarkup\"},{\"id\":-2035021048,\"predicate\":\"replyKeyboardForceReply\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"single_use\",\"type\":\"flags.1?true\"},{\"name\":\"selective\",\"type\":\"flags.2?true\"},{\"name\":\"placeholder\",\"type\":\"flags.3?string\"}],\"type\":\"ReplyMarkup\"},{\"id\":-2049074735,\"predicate\":\"replyKeyboardMarkup\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"resize\",\"type\":\"flags.0?true\"},{\"name\":\"single_use\",\"type\":\"flags.1?true\"},{\"name\":\"selective\",\"type\":\"flags.2?true\"},{\"name\":\"persistent\",\"type\":\"flags.4?true\"},{\"name\":\"rows\",\"type\":\"Vector\"},{\"name\":\"placeholder\",\"type\":\"flags.3?string\"}],\"type\":\"ReplyMarkup\"},{\"id\":-571955892,\"predicate\":\"inputPeerUser\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputPeer\"},{\"id\":-233744186,\"predicate\":\"inputUser\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputUser\"},{\"id\":-1148011883,\"predicate\":\"messageEntityUnknown\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":-100378723,\"predicate\":\"messageEntityMention\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":1868782349,\"predicate\":\"messageEntityHashtag\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":1827637959,\"predicate\":\"messageEntityBotCommand\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":1859134776,\"predicate\":\"messageEntityUrl\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":1692693954,\"predicate\":\"messageEntityEmail\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":-1117713463,\"predicate\":\"messageEntityBold\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":-2106619040,\"predicate\":\"messageEntityItalic\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":681706865,\"predicate\":\"messageEntityCode\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":1938967520,\"predicate\":\"messageEntityPre\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"},{\"name\":\"language\",\"type\":\"string\"}],\"type\":\"MessageEntity\"},{\"id\":1990644519,\"predicate\":\"messageEntityTextUrl\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"},{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"MessageEntity\"},{\"id\":-1877614335,\"predicate\":\"updateShortSentMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"out\",\"type\":\"flags.1?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"media\",\"type\":\"flags.9?MessageMedia\"},{\"name\":\"entities\",\"type\":\"flags.7?Vector\"},{\"name\":\"ttl_period\",\"type\":\"flags.25?int\"}],\"type\":\"Updates\"},{\"id\":-292807034,\"predicate\":\"inputChannelEmpty\",\"params\":[],\"type\":\"InputChannel\"},{\"id\":-212145112,\"predicate\":\"inputChannel\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputChannel\"},{\"id\":-1566230754,\"predicate\":\"peerChannel\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"}],\"type\":\"Peer\"},{\"id\":666680316,\"predicate\":\"inputPeerChannel\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputPeer\"},{\"id\":-2094689180,\"predicate\":\"channel\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"creator\",\"type\":\"flags.0?true\"},{\"name\":\"left\",\"type\":\"flags.2?true\"},{\"name\":\"broadcast\",\"type\":\"flags.5?true\"},{\"name\":\"verified\",\"type\":\"flags.7?true\"},{\"name\":\"megagroup\",\"type\":\"flags.8?true\"},{\"name\":\"restricted\",\"type\":\"flags.9?true\"},{\"name\":\"signatures\",\"type\":\"flags.11?true\"},{\"name\":\"min\",\"type\":\"flags.12?true\"},{\"name\":\"scam\",\"type\":\"flags.19?true\"},{\"name\":\"has_link\",\"type\":\"flags.20?true\"},{\"name\":\"has_geo\",\"type\":\"flags.21?true\"},{\"name\":\"slowmode_enabled\",\"type\":\"flags.22?true\"},{\"name\":\"call_active\",\"type\":\"flags.23?true\"},{\"name\":\"call_not_empty\",\"type\":\"flags.24?true\"},{\"name\":\"fake\",\"type\":\"flags.25?true\"},{\"name\":\"gigagroup\",\"type\":\"flags.26?true\"},{\"name\":\"noforwards\",\"type\":\"flags.27?true\"},{\"name\":\"join_to_send\",\"type\":\"flags.28?true\"},{\"name\":\"join_request\",\"type\":\"flags.29?true\"},{\"name\":\"forum\",\"type\":\"flags.30?true\"},{\"name\":\"flags2\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"flags.13?long\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"username\",\"type\":\"flags.6?string\"},{\"name\":\"photo\",\"type\":\"ChatPhoto\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"restriction_reason\",\"type\":\"flags.9?Vector\"},{\"name\":\"admin_rights\",\"type\":\"flags.14?ChatAdminRights\"},{\"name\":\"banned_rights\",\"type\":\"flags.15?ChatBannedRights\"},{\"name\":\"default_banned_rights\",\"type\":\"flags.18?ChatBannedRights\"},{\"name\":\"participants_count\",\"type\":\"flags.17?int\"},{\"name\":\"usernames\",\"type\":\"flags2.0?Vector\"}],\"type\":\"Chat\"},{\"id\":399807445,\"predicate\":\"channelForbidden\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"broadcast\",\"type\":\"flags.5?true\"},{\"name\":\"megagroup\",\"type\":\"flags.8?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"until_date\",\"type\":\"flags.16?int\"}],\"type\":\"Chat\"},{\"id\":2131196633,\"predicate\":\"contacts.resolvedPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.ResolvedPeer\"},{\"id\":-231385849,\"predicate\":\"channelFull\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"can_view_participants\",\"type\":\"flags.3?true\"},{\"name\":\"can_set_username\",\"type\":\"flags.6?true\"},{\"name\":\"can_set_stickers\",\"type\":\"flags.7?true\"},{\"name\":\"hidden_prehistory\",\"type\":\"flags.10?true\"},{\"name\":\"can_set_location\",\"type\":\"flags.16?true\"},{\"name\":\"has_scheduled\",\"type\":\"flags.19?true\"},{\"name\":\"can_view_stats\",\"type\":\"flags.20?true\"},{\"name\":\"blocked\",\"type\":\"flags.22?true\"},{\"name\":\"flags2\",\"type\":\"#\"},{\"name\":\"can_delete_channel\",\"type\":\"flags2.0?true\"},{\"name\":\"antispam\",\"type\":\"flags2.1?true\"},{\"name\":\"participants_hidden\",\"type\":\"flags2.2?true\"},{\"name\":\"translations_disabled\",\"type\":\"flags2.3?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"about\",\"type\":\"string\"},{\"name\":\"participants_count\",\"type\":\"flags.0?int\"},{\"name\":\"admins_count\",\"type\":\"flags.1?int\"},{\"name\":\"kicked_count\",\"type\":\"flags.2?int\"},{\"name\":\"banned_count\",\"type\":\"flags.2?int\"},{\"name\":\"online_count\",\"type\":\"flags.13?int\"},{\"name\":\"read_inbox_max_id\",\"type\":\"int\"},{\"name\":\"read_outbox_max_id\",\"type\":\"int\"},{\"name\":\"unread_count\",\"type\":\"int\"},{\"name\":\"chat_photo\",\"type\":\"Photo\"},{\"name\":\"notify_settings\",\"type\":\"PeerNotifySettings\"},{\"name\":\"exported_invite\",\"type\":\"flags.23?ExportedChatInvite\"},{\"name\":\"bot_info\",\"type\":\"Vector\"},{\"name\":\"migrated_from_chat_id\",\"type\":\"flags.4?long\"},{\"name\":\"migrated_from_max_id\",\"type\":\"flags.4?int\"},{\"name\":\"pinned_msg_id\",\"type\":\"flags.5?int\"},{\"name\":\"stickerset\",\"type\":\"flags.8?StickerSet\"},{\"name\":\"available_min_id\",\"type\":\"flags.9?int\"},{\"name\":\"folder_id\",\"type\":\"flags.11?int\"},{\"name\":\"linked_chat_id\",\"type\":\"flags.14?long\"},{\"name\":\"location\",\"type\":\"flags.15?ChannelLocation\"},{\"name\":\"slowmode_seconds\",\"type\":\"flags.17?int\"},{\"name\":\"slowmode_next_send_date\",\"type\":\"flags.18?int\"},{\"name\":\"stats_dc\",\"type\":\"flags.12?int\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"call\",\"type\":\"flags.21?InputGroupCall\"},{\"name\":\"ttl_period\",\"type\":\"flags.24?int\"},{\"name\":\"pending_suggestions\",\"type\":\"flags.25?Vector\"},{\"name\":\"groupcall_default_join_as\",\"type\":\"flags.26?Peer\"},{\"name\":\"theme_emoticon\",\"type\":\"flags.27?string\"},{\"name\":\"requests_pending\",\"type\":\"flags.28?int\"},{\"name\":\"recent_requesters\",\"type\":\"flags.28?Vector\"},{\"name\":\"default_send_as\",\"type\":\"flags.29?Peer\"},{\"name\":\"available_reactions\",\"type\":\"flags.30?ChatReactions\"}],\"type\":\"ChatFull\"},{\"id\":182649427,\"predicate\":\"messageRange\",\"params\":[{\"name\":\"min_id\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"MessageRange\"},{\"id\":-948520370,\"predicate\":\"messages.channelMessages\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"inexact\",\"type\":\"flags.1?true\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"offset_id_offset\",\"type\":\"flags.2?int\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"topics\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":-1781355374,\"predicate\":\"messageActionChannelCreate\",\"params\":[{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":277713951,\"predicate\":\"updateChannelTooLong\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"pts\",\"type\":\"flags.0?int\"}],\"type\":\"Update\"},{\"id\":1666927625,\"predicate\":\"updateChannel\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"}],\"type\":\"Update\"},{\"id\":1656358105,\"predicate\":\"updateNewChannelMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1842450928,\"predicate\":\"updateReadChannelInbox\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"folder_id\",\"type\":\"flags.0?int\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"still_unread_count\",\"type\":\"int\"},{\"name\":\"pts\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1020437742,\"predicate\":\"updateDeleteChannelMessages\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-232346616,\"predicate\":\"updateChannelMessageViews\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"views\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":1041346555,\"predicate\":\"updates.channelDifferenceEmpty\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"final\",\"type\":\"flags.0?true\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"timeout\",\"type\":\"flags.1?int\"}],\"type\":\"updates.ChannelDifference\"},{\"id\":-1531132162,\"predicate\":\"updates.channelDifferenceTooLong\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"final\",\"type\":\"flags.0?true\"},{\"name\":\"timeout\",\"type\":\"flags.1?int\"},{\"name\":\"dialog\",\"type\":\"Dialog\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"updates.ChannelDifference\"},{\"id\":543450958,\"predicate\":\"updates.channelDifference\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"final\",\"type\":\"flags.0?true\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"timeout\",\"type\":\"flags.1?int\"},{\"name\":\"new_messages\",\"type\":\"Vector\"},{\"name\":\"other_updates\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"updates.ChannelDifference\"},{\"id\":-1798033689,\"predicate\":\"channelMessagesFilterEmpty\",\"params\":[],\"type\":\"ChannelMessagesFilter\"},{\"id\":-847783593,\"predicate\":\"channelMessagesFilter\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"exclude_new_messages\",\"type\":\"flags.1?true\"},{\"name\":\"ranges\",\"type\":\"Vector\"}],\"type\":\"ChannelMessagesFilter\"},{\"id\":-1072953408,\"predicate\":\"channelParticipant\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"ChannelParticipant\"},{\"id\":900251559,\"predicate\":\"channelParticipantSelf\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"via_request\",\"type\":\"flags.0?true\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"inviter_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"ChannelParticipant\"},{\"id\":803602899,\"predicate\":\"channelParticipantCreator\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"admin_rights\",\"type\":\"ChatAdminRights\"},{\"name\":\"rank\",\"type\":\"flags.0?string\"}],\"type\":\"ChannelParticipant\"},{\"id\":-566281095,\"predicate\":\"channelParticipantsRecent\",\"params\":[],\"type\":\"ChannelParticipantsFilter\"},{\"id\":-1268741783,\"predicate\":\"channelParticipantsAdmins\",\"params\":[],\"type\":\"ChannelParticipantsFilter\"},{\"id\":-1548400251,\"predicate\":\"channelParticipantsKicked\",\"params\":[{\"name\":\"q\",\"type\":\"string\"}],\"type\":\"ChannelParticipantsFilter\"},{\"id\":-1699676497,\"predicate\":\"channels.channelParticipants\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"participants\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"channels.ChannelParticipants\"},{\"id\":-541588713,\"predicate\":\"channels.channelParticipant\",\"params\":[{\"name\":\"participant\",\"type\":\"ChannelParticipant\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"channels.ChannelParticipant\"},{\"id\":-462696732,\"predicate\":\"chatParticipantCreator\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"ChatParticipant\"},{\"id\":-1600962725,\"predicate\":\"chatParticipantAdmin\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"inviter_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"ChatParticipant\"},{\"id\":-674602590,\"predicate\":\"updateChatParticipantAdmin\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"is_admin\",\"type\":\"Bool\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-519864430,\"predicate\":\"messageActionChatMigrateTo\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"}],\"type\":\"MessageAction\"},{\"id\":-365344535,\"predicate\":\"messageActionChannelMigrateFrom\",\"params\":[{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"chat_id\",\"type\":\"long\"}],\"type\":\"MessageAction\"},{\"id\":-1328445861,\"predicate\":\"channelParticipantsBots\",\"params\":[],\"type\":\"ChannelParticipantsFilter\"},{\"id\":2013922064,\"predicate\":\"help.termsOfService\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"popup\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"DataJSON\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"Vector\"},{\"name\":\"min_age_confirm\",\"type\":\"flags.1?int\"}],\"type\":\"help.TermsOfService\"},{\"id\":1753886890,\"predicate\":\"updateNewStickerSet\",\"params\":[{\"name\":\"stickerset\",\"type\":\"messages.StickerSet\"}],\"type\":\"Update\"},{\"id\":196268545,\"predicate\":\"updateStickerSetsOrder\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"masks\",\"type\":\"flags.0?true\"},{\"name\":\"emojis\",\"type\":\"flags.1?true\"},{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":834816008,\"predicate\":\"updateStickerSets\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"masks\",\"type\":\"flags.0?true\"},{\"name\":\"emojis\",\"type\":\"flags.1?true\"}],\"type\":\"Update\"},{\"id\":-402498398,\"predicate\":\"messages.savedGifsNotModified\",\"params\":[],\"type\":\"messages.SavedGifs\"},{\"id\":-2069878259,\"predicate\":\"messages.savedGifs\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"gifs\",\"type\":\"Vector\"}],\"type\":\"messages.SavedGifs\"},{\"id\":-1821035490,\"predicate\":\"updateSavedGifs\",\"params\":[],\"type\":\"Update\"},{\"id\":864077702,\"predicate\":\"inputBotInlineMessageMediaAuto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.1?Vector\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":1036876423,\"predicate\":\"inputBotInlineMessageText\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.0?true\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.1?Vector\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":-2000710887,\"predicate\":\"inputBotInlineResult\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"flags.1?string\"},{\"name\":\"description\",\"type\":\"flags.2?string\"},{\"name\":\"url\",\"type\":\"flags.3?string\"},{\"name\":\"thumb\",\"type\":\"flags.4?InputWebDocument\"},{\"name\":\"content\",\"type\":\"flags.5?InputWebDocument\"},{\"name\":\"send_message\",\"type\":\"InputBotInlineMessage\"}],\"type\":\"InputBotInlineResult\"},{\"id\":1984755728,\"predicate\":\"botInlineMessageMediaAuto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.1?Vector\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"BotInlineMessage\"},{\"id\":-1937807902,\"predicate\":\"botInlineMessageText\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.0?true\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.1?Vector\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"BotInlineMessage\"},{\"id\":295067450,\"predicate\":\"botInlineResult\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"flags.1?string\"},{\"name\":\"description\",\"type\":\"flags.2?string\"},{\"name\":\"url\",\"type\":\"flags.3?string\"},{\"name\":\"thumb\",\"type\":\"flags.4?WebDocument\"},{\"name\":\"content\",\"type\":\"flags.5?WebDocument\"},{\"name\":\"send_message\",\"type\":\"BotInlineMessage\"}],\"type\":\"BotInlineResult\"},{\"id\":-1803769784,\"predicate\":\"messages.botResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"gallery\",\"type\":\"flags.0?true\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"next_offset\",\"type\":\"flags.1?string\"},{\"name\":\"switch_pm\",\"type\":\"flags.2?InlineBotSwitchPM\"},{\"name\":\"results\",\"type\":\"Vector\"},{\"name\":\"cache_time\",\"type\":\"int\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.BotResults\"},{\"id\":1232025500,\"predicate\":\"updateBotInlineQuery\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"query\",\"type\":\"string\"},{\"name\":\"geo\",\"type\":\"flags.0?GeoPoint\"},{\"name\":\"peer_type\",\"type\":\"flags.1?InlineQueryPeerType\"},{\"name\":\"offset\",\"type\":\"string\"}],\"type\":\"Update\"},{\"id\":317794823,\"predicate\":\"updateBotInlineSend\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"query\",\"type\":\"string\"},{\"name\":\"geo\",\"type\":\"flags.0?GeoPoint\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"msg_id\",\"type\":\"flags.1?InputBotInlineMessageID\"}],\"type\":\"Update\"},{\"id\":1358283666,\"predicate\":\"inputMessagesFilterVoice\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":928101534,\"predicate\":\"inputMessagesFilterMusic\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1107622874,\"predicate\":\"inputPrivacyKeyChatInvite\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":1343122938,\"predicate\":\"privacyKeyChatInvite\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":1571494644,\"predicate\":\"exportedMessageLink\",\"params\":[{\"name\":\"link\",\"type\":\"string\"},{\"name\":\"html\",\"type\":\"string\"}],\"type\":\"ExportedMessageLink\"},{\"id\":1601666510,\"predicate\":\"messageFwdHeader\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"imported\",\"type\":\"flags.7?true\"},{\"name\":\"from_id\",\"type\":\"flags.0?Peer\"},{\"name\":\"from_name\",\"type\":\"flags.5?string\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"channel_post\",\"type\":\"flags.2?int\"},{\"name\":\"post_author\",\"type\":\"flags.3?string\"},{\"name\":\"saved_from_peer\",\"type\":\"flags.4?Peer\"},{\"name\":\"saved_from_msg_id\",\"type\":\"flags.4?int\"},{\"name\":\"psa_type\",\"type\":\"flags.6?string\"}],\"type\":\"MessageFwdHeader\"},{\"id\":457133559,\"predicate\":\"updateEditChannelMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1799538451,\"predicate\":\"messageActionPinMessage\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":1923290508,\"predicate\":\"auth.codeTypeSms\",\"params\":[],\"type\":\"auth.CodeType\"},{\"id\":1948046307,\"predicate\":\"auth.codeTypeCall\",\"params\":[],\"type\":\"auth.CodeType\"},{\"id\":577556219,\"predicate\":\"auth.codeTypeFlashCall\",\"params\":[],\"type\":\"auth.CodeType\"},{\"id\":1035688326,\"predicate\":\"auth.sentCodeTypeApp\",\"params\":[{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"auth.SentCodeType\"},{\"id\":-1073693790,\"predicate\":\"auth.sentCodeTypeSms\",\"params\":[{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"auth.SentCodeType\"},{\"id\":1398007207,\"predicate\":\"auth.sentCodeTypeCall\",\"params\":[{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"auth.SentCodeType\"},{\"id\":-1425815847,\"predicate\":\"auth.sentCodeTypeFlashCall\",\"params\":[{\"name\":\"pattern\",\"type\":\"string\"}],\"type\":\"auth.SentCodeType\"},{\"id\":629866245,\"predicate\":\"keyboardButtonUrl\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":901503851,\"predicate\":\"keyboardButtonCallback\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"requires_password\",\"type\":\"flags.0?true\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"type\":\"KeyboardButton\"},{\"id\":-1318425559,\"predicate\":\"keyboardButtonRequestPhone\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":-59151553,\"predicate\":\"keyboardButtonRequestGeoLocation\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":90744648,\"predicate\":\"keyboardButtonSwitchInline\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"same_peer\",\"type\":\"flags.0?true\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"query\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":1218642516,\"predicate\":\"replyInlineMarkup\",\"params\":[{\"name\":\"rows\",\"type\":\"Vector\"}],\"type\":\"ReplyMarkup\"},{\"id\":911761060,\"predicate\":\"messages.botCallbackAnswer\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"alert\",\"type\":\"flags.1?true\"},{\"name\":\"has_url\",\"type\":\"flags.3?true\"},{\"name\":\"native_ui\",\"type\":\"flags.4?true\"},{\"name\":\"message\",\"type\":\"flags.0?string\"},{\"name\":\"url\",\"type\":\"flags.2?string\"},{\"name\":\"cache_time\",\"type\":\"int\"}],\"type\":\"messages.BotCallbackAnswer\"},{\"id\":-1177566067,\"predicate\":\"updateBotCallbackQuery\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"chat_instance\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"flags.0?bytes\"},{\"name\":\"game_short_name\",\"type\":\"flags.1?string\"}],\"type\":\"Update\"},{\"id\":649453030,\"predicate\":\"messages.messageEditData\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"caption\",\"type\":\"flags.0?true\"}],\"type\":\"messages.MessageEditData\"},{\"id\":-469536605,\"predicate\":\"updateEditMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1768777083,\"predicate\":\"inputBotInlineMessageMediaGeo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"heading\",\"type\":\"flags.0?int\"},{\"name\":\"period\",\"type\":\"flags.1?int\"},{\"name\":\"proximity_notification_radius\",\"type\":\"flags.3?int\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":1098628881,\"predicate\":\"inputBotInlineMessageMediaVenue\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"string\"},{\"name\":\"provider\",\"type\":\"string\"},{\"name\":\"venue_id\",\"type\":\"string\"},{\"name\":\"venue_type\",\"type\":\"string\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":-1494368259,\"predicate\":\"inputBotInlineMessageMediaContact\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"vcard\",\"type\":\"string\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":85477117,\"predicate\":\"botInlineMessageMediaGeo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"geo\",\"type\":\"GeoPoint\"},{\"name\":\"heading\",\"type\":\"flags.0?int\"},{\"name\":\"period\",\"type\":\"flags.1?int\"},{\"name\":\"proximity_notification_radius\",\"type\":\"flags.3?int\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"BotInlineMessage\"},{\"id\":-1970903652,\"predicate\":\"botInlineMessageMediaVenue\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"geo\",\"type\":\"GeoPoint\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"string\"},{\"name\":\"provider\",\"type\":\"string\"},{\"name\":\"venue_id\",\"type\":\"string\"},{\"name\":\"venue_type\",\"type\":\"string\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"BotInlineMessage\"},{\"id\":416402882,\"predicate\":\"botInlineMessageMediaContact\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"vcard\",\"type\":\"string\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"BotInlineMessage\"},{\"id\":-1462213465,\"predicate\":\"inputBotInlineResultPhoto\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"InputPhoto\"},{\"name\":\"send_message\",\"type\":\"InputBotInlineMessage\"}],\"type\":\"InputBotInlineResult\"},{\"id\":-459324,\"predicate\":\"inputBotInlineResultDocument\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"flags.1?string\"},{\"name\":\"description\",\"type\":\"flags.2?string\"},{\"name\":\"document\",\"type\":\"InputDocument\"},{\"name\":\"send_message\",\"type\":\"InputBotInlineMessage\"}],\"type\":\"InputBotInlineResult\"},{\"id\":400266251,\"predicate\":\"botInlineMediaResult\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.0?Photo\"},{\"name\":\"document\",\"type\":\"flags.1?Document\"},{\"name\":\"title\",\"type\":\"flags.2?string\"},{\"name\":\"description\",\"type\":\"flags.3?string\"},{\"name\":\"send_message\",\"type\":\"BotInlineMessage\"}],\"type\":\"BotInlineResult\"},{\"id\":-1995686519,\"predicate\":\"inputBotInlineMessageID\",\"params\":[{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputBotInlineMessageID\"},{\"id\":1763610706,\"predicate\":\"updateInlineBotCallbackQuery\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"msg_id\",\"type\":\"InputBotInlineMessageID\"},{\"name\":\"chat_instance\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"flags.0?bytes\"},{\"name\":\"game_short_name\",\"type\":\"flags.1?string\"}],\"type\":\"Update\"},{\"id\":1008755359,\"predicate\":\"inlineBotSwitchPM\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"start_param\",\"type\":\"string\"}],\"type\":\"InlineBotSwitchPM\"},{\"id\":863093588,\"predicate\":\"messages.peerDialogs\",\"params\":[{\"name\":\"dialogs\",\"type\":\"Vector\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"state\",\"type\":\"updates.State\"}],\"type\":\"messages.PeerDialogs\"},{\"id\":-305282981,\"predicate\":\"topPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"rating\",\"type\":\"double\"}],\"type\":\"TopPeer\"},{\"id\":-1419371685,\"predicate\":\"topPeerCategoryBotsPM\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":344356834,\"predicate\":\"topPeerCategoryBotsInline\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":104314861,\"predicate\":\"topPeerCategoryCorrespondents\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":-1122524854,\"predicate\":\"topPeerCategoryGroups\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":371037736,\"predicate\":\"topPeerCategoryChannels\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":-75283823,\"predicate\":\"topPeerCategoryPeers\",\"params\":[{\"name\":\"category\",\"type\":\"TopPeerCategory\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"peers\",\"type\":\"Vector\"}],\"type\":\"TopPeerCategoryPeers\"},{\"id\":-567906571,\"predicate\":\"contacts.topPeersNotModified\",\"params\":[],\"type\":\"contacts.TopPeers\"},{\"id\":1891070632,\"predicate\":\"contacts.topPeers\",\"params\":[{\"name\":\"categories\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.TopPeers\"},{\"id\":-595914432,\"predicate\":\"messageEntityMentionName\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"MessageEntity\"},{\"id\":546203849,\"predicate\":\"inputMessageEntityMentionName\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"MessageEntity\"},{\"id\":975236280,\"predicate\":\"inputMessagesFilterChatPhotos\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1218471511,\"predicate\":\"updateReadChannelOutbox\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":457829485,\"predicate\":\"updateDraftMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"draft\",\"type\":\"DraftMessage\"}],\"type\":\"Update\"},{\"id\":453805082,\"predicate\":\"draftMessageEmpty\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"date\",\"type\":\"flags.0?int\"}],\"type\":\"DraftMessage\"},{\"id\":-40996577,\"predicate\":\"draftMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.1?true\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"DraftMessage\"},{\"id\":-1615153660,\"predicate\":\"messageActionHistoryClear\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":-958657434,\"predicate\":\"messages.featuredStickersNotModified\",\"params\":[{\"name\":\"count\",\"type\":\"int\"}],\"type\":\"messages.FeaturedStickers\"},{\"id\":-1103615738,\"predicate\":\"messages.featuredStickers\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"premium\",\"type\":\"flags.0?true\"},{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"sets\",\"type\":\"Vector\"},{\"name\":\"unread\",\"type\":\"Vector\"}],\"type\":\"messages.FeaturedStickers\"},{\"id\":1461528386,\"predicate\":\"updateReadFeaturedStickers\",\"params\":[],\"type\":\"Update\"},{\"id\":186120336,\"predicate\":\"messages.recentStickersNotModified\",\"params\":[],\"type\":\"messages.RecentStickers\"},{\"id\":-1999405994,\"predicate\":\"messages.recentStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"packs\",\"type\":\"Vector\"},{\"name\":\"stickers\",\"type\":\"Vector\"},{\"name\":\"dates\",\"type\":\"Vector\"}],\"type\":\"messages.RecentStickers\"},{\"id\":-1706939360,\"predicate\":\"updateRecentStickers\",\"params\":[],\"type\":\"Update\"},{\"id\":1338747336,\"predicate\":\"messages.archivedStickers\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"sets\",\"type\":\"Vector\"}],\"type\":\"messages.ArchivedStickers\"},{\"id\":946083368,\"predicate\":\"messages.stickerSetInstallResultSuccess\",\"params\":[],\"type\":\"messages.StickerSetInstallResult\"},{\"id\":904138920,\"predicate\":\"messages.stickerSetInstallResultArchive\",\"params\":[{\"name\":\"sets\",\"type\":\"Vector\"}],\"type\":\"messages.StickerSetInstallResult\"},{\"id\":1678812626,\"predicate\":\"stickerSetCovered\",\"params\":[{\"name\":\"set\",\"type\":\"StickerSet\"},{\"name\":\"cover\",\"type\":\"Document\"}],\"type\":\"StickerSetCovered\"},{\"id\":-1574314746,\"predicate\":\"updateConfig\",\"params\":[],\"type\":\"Update\"},{\"id\":861169551,\"predicate\":\"updatePtsChanged\",\"params\":[],\"type\":\"Update\"},{\"id\":-440664550,\"predicate\":\"inputMediaPhotoExternal\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"spoiler\",\"type\":\"flags.1?true\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.0?int\"}],\"type\":\"InputMedia\"},{\"id\":-78455655,\"predicate\":\"inputMediaDocumentExternal\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"spoiler\",\"type\":\"flags.1?true\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.0?int\"}],\"type\":\"InputMedia\"},{\"id\":872932635,\"predicate\":\"stickerSetMultiCovered\",\"params\":[{\"name\":\"set\",\"type\":\"StickerSet\"},{\"name\":\"covers\",\"type\":\"Vector\"}],\"type\":\"StickerSetCovered\"},{\"id\":-1361650766,\"predicate\":\"maskCoords\",\"params\":[{\"name\":\"n\",\"type\":\"int\"},{\"name\":\"x\",\"type\":\"double\"},{\"name\":\"y\",\"type\":\"double\"},{\"name\":\"zoom\",\"type\":\"double\"}],\"type\":\"MaskCoords\"},{\"id\":-1744710921,\"predicate\":\"documentAttributeHasStickers\",\"params\":[],\"type\":\"DocumentAttribute\"},{\"id\":1251549527,\"predicate\":\"inputStickeredMediaPhoto\",\"params\":[{\"name\":\"id\",\"type\":\"InputPhoto\"}],\"type\":\"InputStickeredMedia\"},{\"id\":70813275,\"predicate\":\"inputStickeredMediaDocument\",\"params\":[{\"name\":\"id\",\"type\":\"InputDocument\"}],\"type\":\"InputStickeredMedia\"},{\"id\":-1107729093,\"predicate\":\"game\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"short_name\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"Photo\"},{\"name\":\"document\",\"type\":\"flags.0?Document\"}],\"type\":\"Game\"},{\"id\":1336154098,\"predicate\":\"inputBotInlineResultGame\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"short_name\",\"type\":\"string\"},{\"name\":\"send_message\",\"type\":\"InputBotInlineMessage\"}],\"type\":\"InputBotInlineResult\"},{\"id\":1262639204,\"predicate\":\"inputBotInlineMessageGame\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":-38694904,\"predicate\":\"messageMediaGame\",\"params\":[{\"name\":\"game\",\"type\":\"Game\"}],\"type\":\"MessageMedia\"},{\"id\":-750828557,\"predicate\":\"inputMediaGame\",\"params\":[{\"name\":\"id\",\"type\":\"InputGame\"}],\"type\":\"InputMedia\"},{\"id\":53231223,\"predicate\":\"inputGameID\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputGame\"},{\"id\":-1020139510,\"predicate\":\"inputGameShortName\",\"params\":[{\"name\":\"bot_id\",\"type\":\"InputUser\"},{\"name\":\"short_name\",\"type\":\"string\"}],\"type\":\"InputGame\"},{\"id\":1358175439,\"predicate\":\"keyboardButtonGame\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":-1834538890,\"predicate\":\"messageActionGameScore\",\"params\":[{\"name\":\"game_id\",\"type\":\"long\"},{\"name\":\"score\",\"type\":\"int\"}],\"type\":\"MessageAction\"},{\"id\":1940093419,\"predicate\":\"highScore\",\"params\":[{\"name\":\"pos\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"score\",\"type\":\"int\"}],\"type\":\"HighScore\"},{\"id\":-1707344487,\"predicate\":\"messages.highScores\",\"params\":[{\"name\":\"scores\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.HighScores\"},{\"id\":1258196845,\"predicate\":\"updates.differenceTooLong\",\"params\":[{\"name\":\"pts\",\"type\":\"int\"}],\"type\":\"updates.Difference\"},{\"id\":791390623,\"predicate\":\"updateChannelWebPage\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"webpage\",\"type\":\"WebPage\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1663561404,\"predicate\":\"messages.chatsSlice\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"messages.Chats\"},{\"id\":-599948721,\"predicate\":\"textEmpty\",\"params\":[],\"type\":\"RichText\"},{\"id\":1950782688,\"predicate\":\"textPlain\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"RichText\"},{\"id\":1730456516,\"predicate\":\"textBold\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":-653089380,\"predicate\":\"textItalic\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":-1054465340,\"predicate\":\"textUnderline\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":-1678197867,\"predicate\":\"textStrike\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":1816074681,\"predicate\":\"textFixed\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":1009288385,\"predicate\":\"textUrl\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"webpage_id\",\"type\":\"long\"}],\"type\":\"RichText\"},{\"id\":-564523562,\"predicate\":\"textEmail\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"email\",\"type\":\"string\"}],\"type\":\"RichText\"},{\"id\":2120376535,\"predicate\":\"textConcat\",\"params\":[{\"name\":\"texts\",\"type\":\"Vector\"}],\"type\":\"RichText\"},{\"id\":324435594,\"predicate\":\"pageBlockUnsupported\",\"params\":[],\"type\":\"PageBlock\"},{\"id\":1890305021,\"predicate\":\"pageBlockTitle\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":-1879401953,\"predicate\":\"pageBlockSubtitle\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":-1162877472,\"predicate\":\"pageBlockAuthorDate\",\"params\":[{\"name\":\"author\",\"type\":\"RichText\"},{\"name\":\"published_date\",\"type\":\"int\"}],\"type\":\"PageBlock\"},{\"id\":-1076861716,\"predicate\":\"pageBlockHeader\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":-248793375,\"predicate\":\"pageBlockSubheader\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":1182402406,\"predicate\":\"pageBlockParagraph\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":-1066346178,\"predicate\":\"pageBlockPreformatted\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"language\",\"type\":\"string\"}],\"type\":\"PageBlock\"},{\"id\":1216809369,\"predicate\":\"pageBlockFooter\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":-618614392,\"predicate\":\"pageBlockDivider\",\"params\":[],\"type\":\"PageBlock\"},{\"id\":-837994576,\"predicate\":\"pageBlockAnchor\",\"params\":[{\"name\":\"name\",\"type\":\"string\"}],\"type\":\"PageBlock\"},{\"id\":-454524911,\"predicate\":\"pageBlockList\",\"params\":[{\"name\":\"items\",\"type\":\"Vector\"}],\"type\":\"PageBlock\"},{\"id\":641563686,\"predicate\":\"pageBlockBlockquote\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"caption\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":1329878739,\"predicate\":\"pageBlockPullquote\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"caption\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":391759200,\"predicate\":\"pageBlockPhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"photo_id\",\"type\":\"long\"},{\"name\":\"caption\",\"type\":\"PageCaption\"},{\"name\":\"url\",\"type\":\"flags.0?string\"},{\"name\":\"webpage_id\",\"type\":\"flags.0?long\"}],\"type\":\"PageBlock\"},{\"id\":2089805750,\"predicate\":\"pageBlockVideo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"autoplay\",\"type\":\"flags.0?true\"},{\"name\":\"loop\",\"type\":\"flags.1?true\"},{\"name\":\"video_id\",\"type\":\"long\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":972174080,\"predicate\":\"pageBlockCover\",\"params\":[{\"name\":\"cover\",\"type\":\"PageBlock\"}],\"type\":\"PageBlock\"},{\"id\":-1468953147,\"predicate\":\"pageBlockEmbed\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"full_width\",\"type\":\"flags.0?true\"},{\"name\":\"allow_scrolling\",\"type\":\"flags.3?true\"},{\"name\":\"url\",\"type\":\"flags.1?string\"},{\"name\":\"html\",\"type\":\"flags.2?string\"},{\"name\":\"poster_photo_id\",\"type\":\"flags.4?long\"},{\"name\":\"w\",\"type\":\"flags.5?int\"},{\"name\":\"h\",\"type\":\"flags.5?int\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":-229005301,\"predicate\":\"pageBlockEmbedPost\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"webpage_id\",\"type\":\"long\"},{\"name\":\"author_photo_id\",\"type\":\"long\"},{\"name\":\"author\",\"type\":\"string\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"blocks\",\"type\":\"Vector\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":1705048653,\"predicate\":\"pageBlockCollage\",\"params\":[{\"name\":\"items\",\"type\":\"Vector\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":52401552,\"predicate\":\"pageBlockSlideshow\",\"params\":[{\"name\":\"items\",\"type\":\"Vector\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":1930545681,\"predicate\":\"webPageNotModified\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"cached_page_views\",\"type\":\"flags.0?int\"}],\"type\":\"WebPage\"},{\"id\":-88417185,\"predicate\":\"inputPrivacyKeyPhoneCall\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":1030105979,\"predicate\":\"privacyKeyPhoneCall\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":-580219064,\"predicate\":\"sendMessageGamePlayAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":-2048646399,\"predicate\":\"phoneCallDiscardReasonMissed\",\"params\":[],\"type\":\"PhoneCallDiscardReason\"},{\"id\":-527056480,\"predicate\":\"phoneCallDiscardReasonDisconnect\",\"params\":[],\"type\":\"PhoneCallDiscardReason\"},{\"id\":1471006352,\"predicate\":\"phoneCallDiscardReasonHangup\",\"params\":[],\"type\":\"PhoneCallDiscardReason\"},{\"id\":-84416311,\"predicate\":\"phoneCallDiscardReasonBusy\",\"params\":[],\"type\":\"PhoneCallDiscardReason\"},{\"id\":1852826908,\"predicate\":\"updateDialogPinned\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.0?true\"},{\"name\":\"folder_id\",\"type\":\"flags.1?int\"},{\"name\":\"peer\",\"type\":\"DialogPeer\"}],\"type\":\"Update\"},{\"id\":-99664734,\"predicate\":\"updatePinnedDialogs\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"folder_id\",\"type\":\"flags.1?int\"},{\"name\":\"order\",\"type\":\"flags.0?Vector\"}],\"type\":\"Update\"},{\"id\":2104790276,\"predicate\":\"dataJSON\",\"params\":[{\"name\":\"data\",\"type\":\"string\"}],\"type\":\"DataJSON\"},{\"id\":-2095595325,\"predicate\":\"updateBotWebhookJSON\",\"params\":[{\"name\":\"data\",\"type\":\"DataJSON\"}],\"type\":\"Update\"},{\"id\":-1684914010,\"predicate\":\"updateBotWebhookJSONQuery\",\"params\":[{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"DataJSON\"},{\"name\":\"timeout\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-886477832,\"predicate\":\"labeledPrice\",\"params\":[{\"name\":\"label\",\"type\":\"string\"},{\"name\":\"amount\",\"type\":\"long\"}],\"type\":\"LabeledPrice\"},{\"id\":1048946971,\"predicate\":\"invoice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"test\",\"type\":\"flags.0?true\"},{\"name\":\"name_requested\",\"type\":\"flags.1?true\"},{\"name\":\"phone_requested\",\"type\":\"flags.2?true\"},{\"name\":\"email_requested\",\"type\":\"flags.3?true\"},{\"name\":\"shipping_address_requested\",\"type\":\"flags.4?true\"},{\"name\":\"flexible\",\"type\":\"flags.5?true\"},{\"name\":\"phone_to_provider\",\"type\":\"flags.6?true\"},{\"name\":\"email_to_provider\",\"type\":\"flags.7?true\"},{\"name\":\"recurring\",\"type\":\"flags.9?true\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"prices\",\"type\":\"Vector\"},{\"name\":\"max_tip_amount\",\"type\":\"flags.8?long\"},{\"name\":\"suggested_tip_amounts\",\"type\":\"flags.8?Vector\"},{\"name\":\"recurring_terms_url\",\"type\":\"flags.9?string\"}],\"type\":\"Invoice\"},{\"id\":-1900697899,\"predicate\":\"inputMediaInvoice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.0?InputWebDocument\"},{\"name\":\"invoice\",\"type\":\"Invoice\"},{\"name\":\"payload\",\"type\":\"bytes\"},{\"name\":\"provider\",\"type\":\"string\"},{\"name\":\"provider_data\",\"type\":\"DataJSON\"},{\"name\":\"start_param\",\"type\":\"flags.1?string\"},{\"name\":\"extended_media\",\"type\":\"flags.2?InputMedia\"}],\"type\":\"InputMedia\"},{\"id\":-368917890,\"predicate\":\"paymentCharge\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"provider_charge_id\",\"type\":\"string\"}],\"type\":\"PaymentCharge\"},{\"id\":-1892568281,\"predicate\":\"messageActionPaymentSentMe\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"recurring_init\",\"type\":\"flags.2?true\"},{\"name\":\"recurring_used\",\"type\":\"flags.3?true\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"total_amount\",\"type\":\"long\"},{\"name\":\"payload\",\"type\":\"bytes\"},{\"name\":\"info\",\"type\":\"flags.0?PaymentRequestedInfo\"},{\"name\":\"shipping_option_id\",\"type\":\"flags.1?string\"},{\"name\":\"charge\",\"type\":\"PaymentCharge\"}],\"type\":\"MessageAction\"},{\"id\":-156940077,\"predicate\":\"messageMediaInvoice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"shipping_address_requested\",\"type\":\"flags.1?true\"},{\"name\":\"test\",\"type\":\"flags.3?true\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.0?WebDocument\"},{\"name\":\"receipt_msg_id\",\"type\":\"flags.2?int\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"total_amount\",\"type\":\"long\"},{\"name\":\"start_param\",\"type\":\"string\"},{\"name\":\"extended_media\",\"type\":\"flags.4?MessageExtendedMedia\"}],\"type\":\"MessageMedia\"},{\"id\":512535275,\"predicate\":\"postAddress\",\"params\":[{\"name\":\"street_line1\",\"type\":\"string\"},{\"name\":\"street_line2\",\"type\":\"string\"},{\"name\":\"city\",\"type\":\"string\"},{\"name\":\"state\",\"type\":\"string\"},{\"name\":\"country_iso2\",\"type\":\"string\"},{\"name\":\"post_code\",\"type\":\"string\"}],\"type\":\"PostAddress\"},{\"id\":-1868808300,\"predicate\":\"paymentRequestedInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"name\",\"type\":\"flags.0?string\"},{\"name\":\"phone\",\"type\":\"flags.1?string\"},{\"name\":\"email\",\"type\":\"flags.2?string\"},{\"name\":\"shipping_address\",\"type\":\"flags.3?PostAddress\"}],\"type\":\"PaymentRequestedInfo\"},{\"id\":-1344716869,\"predicate\":\"keyboardButtonBuy\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":-1776926890,\"predicate\":\"messageActionPaymentSent\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"recurring_init\",\"type\":\"flags.2?true\"},{\"name\":\"recurring_used\",\"type\":\"flags.3?true\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"total_amount\",\"type\":\"long\"},{\"name\":\"invoice_slug\",\"type\":\"flags.0?string\"}],\"type\":\"MessageAction\"},{\"id\":-842892769,\"predicate\":\"paymentSavedCredentialsCard\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"PaymentSavedCredentials\"},{\"id\":475467473,\"predicate\":\"webDocument\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"attributes\",\"type\":\"Vector\"}],\"type\":\"WebDocument\"},{\"id\":-1678949555,\"predicate\":\"inputWebDocument\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"attributes\",\"type\":\"Vector\"}],\"type\":\"InputWebDocument\"},{\"id\":-1036396922,\"predicate\":\"inputWebFileLocation\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputWebFileLocation\"},{\"id\":568808380,\"predicate\":\"upload.webFile\",\"params\":[{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"file_type\",\"type\":\"storage.FileType\"},{\"name\":\"mtime\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"upload.WebFile\"},{\"id\":-1610250415,\"predicate\":\"payments.paymentForm\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"can_save_credentials\",\"type\":\"flags.2?true\"},{\"name\":\"password_missing\",\"type\":\"flags.3?true\"},{\"name\":\"form_id\",\"type\":\"long\"},{\"name\":\"bot_id\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.5?WebDocument\"},{\"name\":\"invoice\",\"type\":\"Invoice\"},{\"name\":\"provider_id\",\"type\":\"long\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"native_provider\",\"type\":\"flags.4?string\"},{\"name\":\"native_params\",\"type\":\"flags.4?DataJSON\"},{\"name\":\"additional_methods\",\"type\":\"flags.6?Vector\"},{\"name\":\"saved_info\",\"type\":\"flags.0?PaymentRequestedInfo\"},{\"name\":\"saved_credentials\",\"type\":\"flags.1?Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"payments.PaymentForm\"},{\"id\":-784000893,\"predicate\":\"payments.validatedRequestedInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"flags.0?string\"},{\"name\":\"shipping_options\",\"type\":\"flags.1?Vector\"}],\"type\":\"payments.ValidatedRequestedInfo\"},{\"id\":1314881805,\"predicate\":\"payments.paymentResult\",\"params\":[{\"name\":\"updates\",\"type\":\"Updates\"}],\"type\":\"payments.PaymentResult\"},{\"id\":1891958275,\"predicate\":\"payments.paymentReceipt\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"bot_id\",\"type\":\"long\"},{\"name\":\"provider_id\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.2?WebDocument\"},{\"name\":\"invoice\",\"type\":\"Invoice\"},{\"name\":\"info\",\"type\":\"flags.0?PaymentRequestedInfo\"},{\"name\":\"shipping\",\"type\":\"flags.1?ShippingOption\"},{\"name\":\"tip_amount\",\"type\":\"flags.3?long\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"total_amount\",\"type\":\"long\"},{\"name\":\"credentials_title\",\"type\":\"string\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"payments.PaymentReceipt\"},{\"id\":-74456004,\"predicate\":\"payments.savedInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"has_saved_credentials\",\"type\":\"flags.1?true\"},{\"name\":\"saved_info\",\"type\":\"flags.0?PaymentRequestedInfo\"}],\"type\":\"payments.SavedInfo\"},{\"id\":-1056001329,\"predicate\":\"inputPaymentCredentialsSaved\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"tmp_password\",\"type\":\"bytes\"}],\"type\":\"InputPaymentCredentials\"},{\"id\":873977640,\"predicate\":\"inputPaymentCredentials\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"save\",\"type\":\"flags.0?true\"},{\"name\":\"data\",\"type\":\"DataJSON\"}],\"type\":\"InputPaymentCredentials\"},{\"id\":-614138572,\"predicate\":\"account.tmpPassword\",\"params\":[{\"name\":\"tmp_password\",\"type\":\"bytes\"},{\"name\":\"valid_until\",\"type\":\"int\"}],\"type\":\"account.TmpPassword\"},{\"id\":-1239335713,\"predicate\":\"shippingOption\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"prices\",\"type\":\"Vector\"}],\"type\":\"ShippingOption\"},{\"id\":-1246823043,\"predicate\":\"updateBotShippingQuery\",\"params\":[{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"payload\",\"type\":\"bytes\"},{\"name\":\"shipping_address\",\"type\":\"PostAddress\"}],\"type\":\"Update\"},{\"id\":-1934976362,\"predicate\":\"updateBotPrecheckoutQuery\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"payload\",\"type\":\"bytes\"},{\"name\":\"info\",\"type\":\"flags.0?PaymentRequestedInfo\"},{\"name\":\"shipping_option_id\",\"type\":\"flags.1?string\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"total_amount\",\"type\":\"long\"}],\"type\":\"Update\"},{\"id\":-6249322,\"predicate\":\"inputStickerSetItem\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"document\",\"type\":\"InputDocument\"},{\"name\":\"emoji\",\"type\":\"string\"},{\"name\":\"mask_coords\",\"type\":\"flags.0?MaskCoords\"}],\"type\":\"InputStickerSetItem\"},{\"id\":-1425052898,\"predicate\":\"updatePhoneCall\",\"params\":[{\"name\":\"phone_call\",\"type\":\"PhoneCall\"}],\"type\":\"Update\"},{\"id\":506920429,\"predicate\":\"inputPhoneCall\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputPhoneCall\"},{\"id\":1399245077,\"predicate\":\"phoneCallEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"PhoneCall\"},{\"id\":-987599081,\"predicate\":\"phoneCallWaiting\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.6?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"participant_id\",\"type\":\"long\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"},{\"name\":\"receive_date\",\"type\":\"flags.0?int\"}],\"type\":\"PhoneCall\"},{\"id\":347139340,\"predicate\":\"phoneCallRequested\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.6?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"participant_id\",\"type\":\"long\"},{\"name\":\"g_a_hash\",\"type\":\"bytes\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"}],\"type\":\"PhoneCall\"},{\"id\":912311057,\"predicate\":\"phoneCallAccepted\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.6?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"participant_id\",\"type\":\"long\"},{\"name\":\"g_b\",\"type\":\"bytes\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"}],\"type\":\"PhoneCall\"},{\"id\":-1770029977,\"predicate\":\"phoneCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"p2p_allowed\",\"type\":\"flags.5?true\"},{\"name\":\"video\",\"type\":\"flags.6?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"participant_id\",\"type\":\"long\"},{\"name\":\"g_a_or_b\",\"type\":\"bytes\"},{\"name\":\"key_fingerprint\",\"type\":\"long\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"},{\"name\":\"connections\",\"type\":\"Vector\"},{\"name\":\"start_date\",\"type\":\"int\"}],\"type\":\"PhoneCall\"},{\"id\":1355435489,\"predicate\":\"phoneCallDiscarded\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"need_rating\",\"type\":\"flags.2?true\"},{\"name\":\"need_debug\",\"type\":\"flags.3?true\"},{\"name\":\"video\",\"type\":\"flags.6?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"reason\",\"type\":\"flags.0?PhoneCallDiscardReason\"},{\"name\":\"duration\",\"type\":\"flags.1?int\"}],\"type\":\"PhoneCall\"},{\"id\":-1665063993,\"predicate\":\"phoneConnection\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"tcp\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"ip\",\"type\":\"string\"},{\"name\":\"ipv6\",\"type\":\"string\"},{\"name\":\"port\",\"type\":\"int\"},{\"name\":\"peer_tag\",\"type\":\"bytes\"}],\"type\":\"PhoneConnection\"},{\"id\":-58224696,\"predicate\":\"phoneCallProtocol\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"udp_p2p\",\"type\":\"flags.0?true\"},{\"name\":\"udp_reflector\",\"type\":\"flags.1?true\"},{\"name\":\"min_layer\",\"type\":\"int\"},{\"name\":\"max_layer\",\"type\":\"int\"},{\"name\":\"library_versions\",\"type\":\"Vector\"}],\"type\":\"PhoneCallProtocol\"},{\"id\":-326966976,\"predicate\":\"phone.phoneCall\",\"params\":[{\"name\":\"phone_call\",\"type\":\"PhoneCall\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"phone.PhoneCall\"},{\"id\":-2134272152,\"predicate\":\"inputMessagesFilterPhoneCalls\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"missed\",\"type\":\"flags.0?true\"}],\"type\":\"MessagesFilter\"},{\"id\":-2132731265,\"predicate\":\"messageActionPhoneCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.2?true\"},{\"name\":\"call_id\",\"type\":\"long\"},{\"name\":\"reason\",\"type\":\"flags.0?PhoneCallDiscardReason\"},{\"name\":\"duration\",\"type\":\"flags.1?int\"}],\"type\":\"MessageAction\"},{\"id\":2054952868,\"predicate\":\"inputMessagesFilterRoundVoice\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1253451181,\"predicate\":\"inputMessagesFilterRoundVideo\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1997373508,\"predicate\":\"sendMessageRecordRoundAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":608050278,\"predicate\":\"sendMessageUploadRoundAction\",\"params\":[{\"name\":\"progress\",\"type\":\"int\"}],\"type\":\"SendMessageAction\"},{\"id\":-242427324,\"predicate\":\"upload.fileCdnRedirect\",\"params\":[{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"file_token\",\"type\":\"bytes\"},{\"name\":\"encryption_key\",\"type\":\"bytes\"},{\"name\":\"encryption_iv\",\"type\":\"bytes\"},{\"name\":\"file_hashes\",\"type\":\"Vector\"}],\"type\":\"upload.File\"},{\"id\":-290921362,\"predicate\":\"upload.cdnFileReuploadNeeded\",\"params\":[{\"name\":\"request_token\",\"type\":\"bytes\"}],\"type\":\"upload.CdnFile\"},{\"id\":-1449145777,\"predicate\":\"upload.cdnFile\",\"params\":[{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"upload.CdnFile\"},{\"id\":-914167110,\"predicate\":\"cdnPublicKey\",\"params\":[{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"public_key\",\"type\":\"string\"}],\"type\":\"CdnPublicKey\"},{\"id\":1462101002,\"predicate\":\"cdnConfig\",\"params\":[{\"name\":\"public_keys\",\"type\":\"Vector\"}],\"type\":\"CdnConfig\"},{\"id\":-283684427,\"predicate\":\"pageBlockChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"Chat\"}],\"type\":\"PageBlock\"},{\"id\":-892239370,\"predicate\":\"langPackString\",\"params\":[{\"name\":\"key\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"string\"}],\"type\":\"LangPackString\"},{\"id\":1816636575,\"predicate\":\"langPackStringPluralized\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"key\",\"type\":\"string\"},{\"name\":\"zero_value\",\"type\":\"flags.0?string\"},{\"name\":\"one_value\",\"type\":\"flags.1?string\"},{\"name\":\"two_value\",\"type\":\"flags.2?string\"},{\"name\":\"few_value\",\"type\":\"flags.3?string\"},{\"name\":\"many_value\",\"type\":\"flags.4?string\"},{\"name\":\"other_value\",\"type\":\"string\"}],\"type\":\"LangPackString\"},{\"id\":695856818,\"predicate\":\"langPackStringDeleted\",\"params\":[{\"name\":\"key\",\"type\":\"string\"}],\"type\":\"LangPackString\"},{\"id\":-209337866,\"predicate\":\"langPackDifference\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"from_version\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"int\"},{\"name\":\"strings\",\"type\":\"Vector\"}],\"type\":\"LangPackDifference\"},{\"id\":-288727837,\"predicate\":\"langPackLanguage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"official\",\"type\":\"flags.0?true\"},{\"name\":\"rtl\",\"type\":\"flags.2?true\"},{\"name\":\"beta\",\"type\":\"flags.3?true\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"native_name\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"base_lang_code\",\"type\":\"flags.1?string\"},{\"name\":\"plural_code\",\"type\":\"string\"},{\"name\":\"strings_count\",\"type\":\"int\"},{\"name\":\"translated_count\",\"type\":\"int\"},{\"name\":\"translations_url\",\"type\":\"string\"}],\"type\":\"LangPackLanguage\"},{\"id\":1180041828,\"predicate\":\"updateLangPackTooLong\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"Update\"},{\"id\":1442983757,\"predicate\":\"updateLangPack\",\"params\":[{\"name\":\"difference\",\"type\":\"LangPackDifference\"}],\"type\":\"Update\"},{\"id\":885242707,\"predicate\":\"channelParticipantAdmin\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"can_edit\",\"type\":\"flags.0?true\"},{\"name\":\"self\",\"type\":\"flags.1?true\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"inviter_id\",\"type\":\"flags.1?long\"},{\"name\":\"promoted_by\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_rights\",\"type\":\"ChatAdminRights\"},{\"name\":\"rank\",\"type\":\"flags.2?string\"}],\"type\":\"ChannelParticipant\"},{\"id\":1844969806,\"predicate\":\"channelParticipantBanned\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"left\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"kicked_by\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"banned_rights\",\"type\":\"ChatBannedRights\"}],\"type\":\"ChannelParticipant\"},{\"id\":338142689,\"predicate\":\"channelParticipantsBanned\",\"params\":[{\"name\":\"q\",\"type\":\"string\"}],\"type\":\"ChannelParticipantsFilter\"},{\"id\":106343499,\"predicate\":\"channelParticipantsSearch\",\"params\":[{\"name\":\"q\",\"type\":\"string\"}],\"type\":\"ChannelParticipantsFilter\"},{\"id\":-421545947,\"predicate\":\"channelAdminLogEventActionChangeTitle\",\"params\":[{\"name\":\"prev_value\",\"type\":\"string\"},{\"name\":\"new_value\",\"type\":\"string\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1427671598,\"predicate\":\"channelAdminLogEventActionChangeAbout\",\"params\":[{\"name\":\"prev_value\",\"type\":\"string\"},{\"name\":\"new_value\",\"type\":\"string\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1783299128,\"predicate\":\"channelAdminLogEventActionChangeUsername\",\"params\":[{\"name\":\"prev_value\",\"type\":\"string\"},{\"name\":\"new_value\",\"type\":\"string\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1129042607,\"predicate\":\"channelAdminLogEventActionChangePhoto\",\"params\":[{\"name\":\"prev_photo\",\"type\":\"Photo\"},{\"name\":\"new_photo\",\"type\":\"Photo\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":460916654,\"predicate\":\"channelAdminLogEventActionToggleInvites\",\"params\":[{\"name\":\"new_value\",\"type\":\"Bool\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":648939889,\"predicate\":\"channelAdminLogEventActionToggleSignatures\",\"params\":[{\"name\":\"new_value\",\"type\":\"Bool\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-370660328,\"predicate\":\"channelAdminLogEventActionUpdatePinned\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1889215493,\"predicate\":\"channelAdminLogEventActionEditMessage\",\"params\":[{\"name\":\"prev_message\",\"type\":\"Message\"},{\"name\":\"new_message\",\"type\":\"Message\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1121994683,\"predicate\":\"channelAdminLogEventActionDeleteMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":405815507,\"predicate\":\"channelAdminLogEventActionParticipantJoin\",\"params\":[],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-124291086,\"predicate\":\"channelAdminLogEventActionParticipantLeave\",\"params\":[],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-484690728,\"predicate\":\"channelAdminLogEventActionParticipantInvite\",\"params\":[{\"name\":\"participant\",\"type\":\"ChannelParticipant\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-422036098,\"predicate\":\"channelAdminLogEventActionParticipantToggleBan\",\"params\":[{\"name\":\"prev_participant\",\"type\":\"ChannelParticipant\"},{\"name\":\"new_participant\",\"type\":\"ChannelParticipant\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-714643696,\"predicate\":\"channelAdminLogEventActionParticipantToggleAdmin\",\"params\":[{\"name\":\"prev_participant\",\"type\":\"ChannelParticipant\"},{\"name\":\"new_participant\",\"type\":\"ChannelParticipant\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":531458253,\"predicate\":\"channelAdminLogEvent\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"action\",\"type\":\"ChannelAdminLogEventAction\"}],\"type\":\"ChannelAdminLogEvent\"},{\"id\":-309659827,\"predicate\":\"channels.adminLogResults\",\"params\":[{\"name\":\"events\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"channels.AdminLogResults\"},{\"id\":-368018716,\"predicate\":\"channelAdminLogEventsFilter\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"join\",\"type\":\"flags.0?true\"},{\"name\":\"leave\",\"type\":\"flags.1?true\"},{\"name\":\"invite\",\"type\":\"flags.2?true\"},{\"name\":\"ban\",\"type\":\"flags.3?true\"},{\"name\":\"unban\",\"type\":\"flags.4?true\"},{\"name\":\"kick\",\"type\":\"flags.5?true\"},{\"name\":\"unkick\",\"type\":\"flags.6?true\"},{\"name\":\"promote\",\"type\":\"flags.7?true\"},{\"name\":\"demote\",\"type\":\"flags.8?true\"},{\"name\":\"info\",\"type\":\"flags.9?true\"},{\"name\":\"settings\",\"type\":\"flags.10?true\"},{\"name\":\"pinned\",\"type\":\"flags.11?true\"},{\"name\":\"edit\",\"type\":\"flags.12?true\"},{\"name\":\"delete\",\"type\":\"flags.13?true\"},{\"name\":\"group_call\",\"type\":\"flags.14?true\"},{\"name\":\"invites\",\"type\":\"flags.15?true\"},{\"name\":\"send\",\"type\":\"flags.16?true\"},{\"name\":\"forums\",\"type\":\"flags.17?true\"}],\"type\":\"ChannelAdminLogEventsFilter\"},{\"id\":511092620,\"predicate\":\"topPeerCategoryPhoneCalls\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":-2143067670,\"predicate\":\"pageBlockAudio\",\"params\":[{\"name\":\"audio_id\",\"type\":\"long\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":1558266229,\"predicate\":\"popularContact\",\"params\":[{\"name\":\"client_id\",\"type\":\"long\"},{\"name\":\"importers\",\"type\":\"int\"}],\"type\":\"PopularContact\"},{\"id\":1200788123,\"predicate\":\"messageActionScreenshotTaken\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":-1634752813,\"predicate\":\"messages.favedStickersNotModified\",\"params\":[],\"type\":\"messages.FavedStickers\"},{\"id\":750063767,\"predicate\":\"messages.favedStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"packs\",\"type\":\"Vector\"},{\"name\":\"stickers\",\"type\":\"Vector\"}],\"type\":\"messages.FavedStickers\"},{\"id\":-451831443,\"predicate\":\"updateFavedStickers\",\"params\":[],\"type\":\"Update\"},{\"id\":-366410403,\"predicate\":\"updateChannelReadMessagesContents\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"messages\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":-1040652646,\"predicate\":\"inputMessagesFilterMyMentions\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":1887741886,\"predicate\":\"updateContactsReset\",\"params\":[],\"type\":\"Update\"},{\"id\":-1312568665,\"predicate\":\"channelAdminLogEventActionChangeStickerSet\",\"params\":[{\"name\":\"prev_stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"new_stickerset\",\"type\":\"InputStickerSet\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-85549226,\"predicate\":\"messageActionCustomAction\",\"params\":[{\"name\":\"message\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":178373535,\"predicate\":\"inputPaymentCredentialsApplePay\",\"params\":[{\"name\":\"payment_data\",\"type\":\"DataJSON\"}],\"type\":\"InputPaymentCredentials\"},{\"id\":-419271411,\"predicate\":\"inputMessagesFilterGeo\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-530392189,\"predicate\":\"inputMessagesFilterContacts\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1304443240,\"predicate\":\"updateChannelAvailableMessages\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"available_min_id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":1599903217,\"predicate\":\"channelAdminLogEventActionTogglePreHistoryHidden\",\"params\":[{\"name\":\"new_value\",\"type\":\"Bool\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-1759532989,\"predicate\":\"inputMediaGeoLive\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"stopped\",\"type\":\"flags.0?true\"},{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"heading\",\"type\":\"flags.2?int\"},{\"name\":\"period\",\"type\":\"flags.1?int\"},{\"name\":\"proximity_notification_radius\",\"type\":\"flags.3?int\"}],\"type\":\"InputMedia\"},{\"id\":-1186937242,\"predicate\":\"messageMediaGeoLive\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"geo\",\"type\":\"GeoPoint\"},{\"name\":\"heading\",\"type\":\"flags.0?int\"},{\"name\":\"period\",\"type\":\"int\"},{\"name\":\"proximity_notification_radius\",\"type\":\"flags.1?int\"}],\"type\":\"MessageMedia\"},{\"id\":1189204285,\"predicate\":\"recentMeUrlUnknown\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"RecentMeUrl\"},{\"id\":-1188296222,\"predicate\":\"recentMeUrlUser\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"RecentMeUrl\"},{\"id\":-1294306862,\"predicate\":\"recentMeUrlChat\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"chat_id\",\"type\":\"long\"}],\"type\":\"RecentMeUrl\"},{\"id\":-347535331,\"predicate\":\"recentMeUrlChatInvite\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"chat_invite\",\"type\":\"ChatInvite\"}],\"type\":\"RecentMeUrl\"},{\"id\":-1140172836,\"predicate\":\"recentMeUrlStickerSet\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"set\",\"type\":\"StickerSetCovered\"}],\"type\":\"RecentMeUrl\"},{\"id\":235081943,\"predicate\":\"help.recentMeUrls\",\"params\":[{\"name\":\"urls\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"help.RecentMeUrls\"},{\"id\":-266911767,\"predicate\":\"channels.channelParticipantsNotModified\",\"params\":[],\"type\":\"channels.ChannelParticipants\"},{\"id\":1951620897,\"predicate\":\"messages.messagesNotModified\",\"params\":[{\"name\":\"count\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":482797855,\"predicate\":\"inputSingleMedia\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"media\",\"type\":\"InputMedia\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.0?Vector\"}],\"type\":\"InputSingleMedia\"},{\"id\":-1493633966,\"predicate\":\"webAuthorization\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"bot_id\",\"type\":\"long\"},{\"name\":\"domain\",\"type\":\"string\"},{\"name\":\"browser\",\"type\":\"string\"},{\"name\":\"platform\",\"type\":\"string\"},{\"name\":\"date_created\",\"type\":\"int\"},{\"name\":\"date_active\",\"type\":\"int\"},{\"name\":\"ip\",\"type\":\"string\"},{\"name\":\"region\",\"type\":\"string\"}],\"type\":\"WebAuthorization\"},{\"id\":-313079300,\"predicate\":\"account.webAuthorizations\",\"params\":[{\"name\":\"authorizations\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"account.WebAuthorizations\"},{\"id\":-1502174430,\"predicate\":\"inputMessageID\",\"params\":[{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"InputMessage\"},{\"id\":-1160215659,\"predicate\":\"inputMessageReplyTo\",\"params\":[{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"InputMessage\"},{\"id\":-2037963464,\"predicate\":\"inputMessagePinned\",\"params\":[],\"type\":\"InputMessage\"},{\"id\":-1687559349,\"predicate\":\"messageEntityPhone\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":1280209983,\"predicate\":\"messageEntityCashtag\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":-1410748418,\"predicate\":\"messageActionBotAllowed\",\"params\":[{\"name\":\"domain\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":-55902537,\"predicate\":\"inputDialogPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"InputDialogPeer\"},{\"id\":-445792507,\"predicate\":\"dialogPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"}],\"type\":\"DialogPeer\"},{\"id\":223655517,\"predicate\":\"messages.foundStickerSetsNotModified\",\"params\":[],\"type\":\"messages.FoundStickerSets\"},{\"id\":-1963942446,\"predicate\":\"messages.foundStickerSets\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"sets\",\"type\":\"Vector\"}],\"type\":\"messages.FoundStickerSets\"},{\"id\":-207944868,\"predicate\":\"fileHash\",\"params\":[{\"name\":\"offset\",\"type\":\"long\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"bytes\"}],\"type\":\"FileHash\"},{\"id\":-104284986,\"predicate\":\"webDocumentNoProxy\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"attributes\",\"type\":\"Vector\"}],\"type\":\"WebDocument\"},{\"id\":1968737087,\"predicate\":\"inputClientProxy\",\"params\":[{\"name\":\"address\",\"type\":\"string\"},{\"name\":\"port\",\"type\":\"int\"}],\"type\":\"InputClientProxy\"},{\"id\":-483352705,\"predicate\":\"help.termsOfServiceUpdateEmpty\",\"params\":[{\"name\":\"expires\",\"type\":\"int\"}],\"type\":\"help.TermsOfServiceUpdate\"},{\"id\":686618977,\"predicate\":\"help.termsOfServiceUpdate\",\"params\":[{\"name\":\"expires\",\"type\":\"int\"},{\"name\":\"terms_of_service\",\"type\":\"help.TermsOfService\"}],\"type\":\"help.TermsOfServiceUpdate\"},{\"id\":859091184,\"predicate\":\"inputSecureFileUploaded\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"parts\",\"type\":\"int\"},{\"name\":\"md5_checksum\",\"type\":\"string\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"secret\",\"type\":\"bytes\"}],\"type\":\"InputSecureFile\"},{\"id\":1399317950,\"predicate\":\"inputSecureFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputSecureFile\"},{\"id\":-876089816,\"predicate\":\"inputSecureFileLocation\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputFileLocation\"},{\"id\":1679398724,\"predicate\":\"secureFileEmpty\",\"params\":[],\"type\":\"SecureFile\"},{\"id\":2097791614,\"predicate\":\"secureFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"size\",\"type\":\"long\"},{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"secret\",\"type\":\"bytes\"}],\"type\":\"SecureFile\"},{\"id\":-1964327229,\"predicate\":\"secureData\",\"params\":[{\"name\":\"data\",\"type\":\"bytes\"},{\"name\":\"data_hash\",\"type\":\"bytes\"},{\"name\":\"secret\",\"type\":\"bytes\"}],\"type\":\"SecureData\"},{\"id\":2103482845,\"predicate\":\"securePlainPhone\",\"params\":[{\"name\":\"phone\",\"type\":\"string\"}],\"type\":\"SecurePlainData\"},{\"id\":569137759,\"predicate\":\"securePlainEmail\",\"params\":[{\"name\":\"email\",\"type\":\"string\"}],\"type\":\"SecurePlainData\"},{\"id\":-1658158621,\"predicate\":\"secureValueTypePersonalDetails\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":1034709504,\"predicate\":\"secureValueTypePassport\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":115615172,\"predicate\":\"secureValueTypeDriverLicense\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-1596951477,\"predicate\":\"secureValueTypeIdentityCard\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-1717268701,\"predicate\":\"secureValueTypeInternalPassport\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-874308058,\"predicate\":\"secureValueTypeAddress\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-63531698,\"predicate\":\"secureValueTypeUtilityBill\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-1995211763,\"predicate\":\"secureValueTypeBankStatement\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-1954007928,\"predicate\":\"secureValueTypeRentalAgreement\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-1713143702,\"predicate\":\"secureValueTypePassportRegistration\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-368907213,\"predicate\":\"secureValueTypeTemporaryRegistration\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-1289704741,\"predicate\":\"secureValueTypePhone\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-1908627474,\"predicate\":\"secureValueTypeEmail\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":411017418,\"predicate\":\"secureValue\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"data\",\"type\":\"flags.0?SecureData\"},{\"name\":\"front_side\",\"type\":\"flags.1?SecureFile\"},{\"name\":\"reverse_side\",\"type\":\"flags.2?SecureFile\"},{\"name\":\"selfie\",\"type\":\"flags.3?SecureFile\"},{\"name\":\"translation\",\"type\":\"flags.6?Vector\"},{\"name\":\"files\",\"type\":\"flags.4?Vector\"},{\"name\":\"plain_data\",\"type\":\"flags.5?SecurePlainData\"},{\"name\":\"hash\",\"type\":\"bytes\"}],\"type\":\"SecureValue\"},{\"id\":-618540889,\"predicate\":\"inputSecureValue\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"data\",\"type\":\"flags.0?SecureData\"},{\"name\":\"front_side\",\"type\":\"flags.1?InputSecureFile\"},{\"name\":\"reverse_side\",\"type\":\"flags.2?InputSecureFile\"},{\"name\":\"selfie\",\"type\":\"flags.3?InputSecureFile\"},{\"name\":\"translation\",\"type\":\"flags.6?Vector\"},{\"name\":\"files\",\"type\":\"flags.4?Vector\"},{\"name\":\"plain_data\",\"type\":\"flags.5?SecurePlainData\"}],\"type\":\"InputSecureValue\"},{\"id\":-316748368,\"predicate\":\"secureValueHash\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"hash\",\"type\":\"bytes\"}],\"type\":\"SecureValueHash\"},{\"id\":-391902247,\"predicate\":\"secureValueErrorData\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"data_hash\",\"type\":\"bytes\"},{\"name\":\"field\",\"type\":\"string\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":12467706,\"predicate\":\"secureValueErrorFrontSide\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":-2037765467,\"predicate\":\"secureValueErrorReverseSide\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":-449327402,\"predicate\":\"secureValueErrorSelfie\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":2054162547,\"predicate\":\"secureValueErrorFile\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":1717706985,\"predicate\":\"secureValueErrorFiles\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"Vector\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":871426631,\"predicate\":\"secureCredentialsEncrypted\",\"params\":[{\"name\":\"data\",\"type\":\"bytes\"},{\"name\":\"hash\",\"type\":\"bytes\"},{\"name\":\"secret\",\"type\":\"bytes\"}],\"type\":\"SecureCredentialsEncrypted\"},{\"id\":-1389486888,\"predicate\":\"account.authorizationForm\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"required_types\",\"type\":\"Vector\"},{\"name\":\"values\",\"type\":\"Vector\"},{\"name\":\"errors\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"privacy_policy_url\",\"type\":\"flags.0?string\"}],\"type\":\"account.AuthorizationForm\"},{\"id\":-2128640689,\"predicate\":\"account.sentEmailCode\",\"params\":[{\"name\":\"email_pattern\",\"type\":\"string\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"account.SentEmailCode\"},{\"id\":455635795,\"predicate\":\"messageActionSecureValuesSentMe\",\"params\":[{\"name\":\"values\",\"type\":\"Vector\"},{\"name\":\"credentials\",\"type\":\"SecureCredentialsEncrypted\"}],\"type\":\"MessageAction\"},{\"id\":-648257196,\"predicate\":\"messageActionSecureValuesSent\",\"params\":[{\"name\":\"types\",\"type\":\"Vector\"}],\"type\":\"MessageAction\"},{\"id\":1722786150,\"predicate\":\"help.deepLinkInfoEmpty\",\"params\":[],\"type\":\"help.DeepLinkInfo\"},{\"id\":1783556146,\"predicate\":\"help.deepLinkInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"update_app\",\"type\":\"flags.0?true\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.1?Vector\"}],\"type\":\"help.DeepLinkInfo\"},{\"id\":289586518,\"predicate\":\"savedPhoneContact\",\"params\":[{\"name\":\"phone\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"SavedContact\"},{\"id\":1304052993,\"predicate\":\"account.takeout\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"account.Takeout\"},{\"id\":700340377,\"predicate\":\"inputTakeoutFileLocation\",\"params\":[],\"type\":\"InputFileLocation\"},{\"id\":-513517117,\"predicate\":\"updateDialogUnreadMark\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"unread\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"DialogPeer\"}],\"type\":\"Update\"},{\"id\":-253500010,\"predicate\":\"messages.dialogsNotModified\",\"params\":[{\"name\":\"count\",\"type\":\"int\"}],\"type\":\"messages.Dialogs\"},{\"id\":-1625153079,\"predicate\":\"inputWebFileGeoPointLocation\",\"params\":[{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"},{\"name\":\"zoom\",\"type\":\"int\"},{\"name\":\"scale\",\"type\":\"int\"}],\"type\":\"InputWebFileLocation\"},{\"id\":-1255369827,\"predicate\":\"contacts.topPeersDisabled\",\"params\":[],\"type\":\"contacts.TopPeers\"},{\"id\":-1685456582,\"predicate\":\"inputReportReasonCopyright\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":-732254058,\"predicate\":\"passwordKdfAlgoUnknown\",\"params\":[],\"type\":\"PasswordKdfAlgo\"},{\"id\":4883767,\"predicate\":\"securePasswordKdfAlgoUnknown\",\"params\":[],\"type\":\"SecurePasswordKdfAlgo\"},{\"id\":-1141711456,\"predicate\":\"securePasswordKdfAlgoPBKDF2HMACSHA512iter100000\",\"params\":[{\"name\":\"salt\",\"type\":\"bytes\"}],\"type\":\"SecurePasswordKdfAlgo\"},{\"id\":-2042159726,\"predicate\":\"securePasswordKdfAlgoSHA512\",\"params\":[{\"name\":\"salt\",\"type\":\"bytes\"}],\"type\":\"SecurePasswordKdfAlgo\"},{\"id\":354925740,\"predicate\":\"secureSecretSettings\",\"params\":[{\"name\":\"secure_algo\",\"type\":\"SecurePasswordKdfAlgo\"},{\"name\":\"secure_secret\",\"type\":\"bytes\"},{\"name\":\"secure_secret_id\",\"type\":\"long\"}],\"type\":\"SecureSecretSettings\"},{\"id\":982592842,\"predicate\":\"passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow\",\"params\":[{\"name\":\"salt1\",\"type\":\"bytes\"},{\"name\":\"salt2\",\"type\":\"bytes\"},{\"name\":\"g\",\"type\":\"int\"},{\"name\":\"p\",\"type\":\"bytes\"}],\"type\":\"PasswordKdfAlgo\"},{\"id\":-1736378792,\"predicate\":\"inputCheckPasswordEmpty\",\"params\":[],\"type\":\"InputCheckPasswordSRP\"},{\"id\":-763367294,\"predicate\":\"inputCheckPasswordSRP\",\"params\":[{\"name\":\"srp_id\",\"type\":\"long\"},{\"name\":\"A\",\"type\":\"bytes\"},{\"name\":\"M1\",\"type\":\"bytes\"}],\"type\":\"InputCheckPasswordSRP\"},{\"id\":-2036501105,\"predicate\":\"secureValueError\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":-1592506512,\"predicate\":\"secureValueErrorTranslationFile\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":878931416,\"predicate\":\"secureValueErrorTranslationFiles\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"Vector\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":-2103600678,\"predicate\":\"secureRequiredType\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"native_names\",\"type\":\"flags.0?true\"},{\"name\":\"selfie_required\",\"type\":\"flags.1?true\"},{\"name\":\"translation_required\",\"type\":\"flags.2?true\"},{\"name\":\"type\",\"type\":\"SecureValueType\"}],\"type\":\"SecureRequiredType\"},{\"id\":41187252,\"predicate\":\"secureRequiredTypeOneOf\",\"params\":[{\"name\":\"types\",\"type\":\"Vector\"}],\"type\":\"SecureRequiredType\"},{\"id\":-1078332329,\"predicate\":\"help.passportConfigNotModified\",\"params\":[],\"type\":\"help.PassportConfig\"},{\"id\":-1600596305,\"predicate\":\"help.passportConfig\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"countries_langs\",\"type\":\"DataJSON\"}],\"type\":\"help.PassportConfig\"},{\"id\":488313413,\"predicate\":\"inputAppEvent\",\"params\":[{\"name\":\"time\",\"type\":\"double\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"peer\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"JSONValue\"}],\"type\":\"InputAppEvent\"},{\"id\":-1059185703,\"predicate\":\"jsonObjectValue\",\"params\":[{\"name\":\"key\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"JSONValue\"}],\"type\":\"JSONObjectValue\"},{\"id\":1064139624,\"predicate\":\"jsonNull\",\"params\":[],\"type\":\"JSONValue\"},{\"id\":-952869270,\"predicate\":\"jsonBool\",\"params\":[{\"name\":\"value\",\"type\":\"Bool\"}],\"type\":\"JSONValue\"},{\"id\":736157604,\"predicate\":\"jsonNumber\",\"params\":[{\"name\":\"value\",\"type\":\"double\"}],\"type\":\"JSONValue\"},{\"id\":-1222740358,\"predicate\":\"jsonString\",\"params\":[{\"name\":\"value\",\"type\":\"string\"}],\"type\":\"JSONValue\"},{\"id\":-146520221,\"predicate\":\"jsonArray\",\"params\":[{\"name\":\"value\",\"type\":\"Vector\"}],\"type\":\"JSONValue\"},{\"id\":-1715350371,\"predicate\":\"jsonObject\",\"params\":[{\"name\":\"value\",\"type\":\"Vector\"}],\"type\":\"JSONValue\"},{\"id\":-1311015810,\"predicate\":\"inputNotifyBroadcasts\",\"params\":[],\"type\":\"InputNotifyPeer\"},{\"id\":-703403793,\"predicate\":\"notifyBroadcasts\",\"params\":[],\"type\":\"NotifyPeer\"},{\"id\":-311786236,\"predicate\":\"textSubscript\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":-939827711,\"predicate\":\"textSuperscript\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":55281185,\"predicate\":\"textMarked\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":483104362,\"predicate\":\"textPhone\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"phone\",\"type\":\"string\"}],\"type\":\"RichText\"},{\"id\":136105807,\"predicate\":\"textImage\",\"params\":[{\"name\":\"document_id\",\"type\":\"long\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"}],\"type\":\"RichText\"},{\"id\":504660880,\"predicate\":\"pageBlockKicker\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":878078826,\"predicate\":\"pageTableCell\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"header\",\"type\":\"flags.0?true\"},{\"name\":\"align_center\",\"type\":\"flags.3?true\"},{\"name\":\"align_right\",\"type\":\"flags.4?true\"},{\"name\":\"valign_middle\",\"type\":\"flags.5?true\"},{\"name\":\"valign_bottom\",\"type\":\"flags.6?true\"},{\"name\":\"text\",\"type\":\"flags.7?RichText\"},{\"name\":\"colspan\",\"type\":\"flags.1?int\"},{\"name\":\"rowspan\",\"type\":\"flags.2?int\"}],\"type\":\"PageTableCell\"},{\"id\":-524237339,\"predicate\":\"pageTableRow\",\"params\":[{\"name\":\"cells\",\"type\":\"Vector\"}],\"type\":\"PageTableRow\"},{\"id\":-1085412734,\"predicate\":\"pageBlockTable\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"bordered\",\"type\":\"flags.0?true\"},{\"name\":\"striped\",\"type\":\"flags.1?true\"},{\"name\":\"title\",\"type\":\"RichText\"},{\"name\":\"rows\",\"type\":\"Vector\"}],\"type\":\"PageBlock\"},{\"id\":1869903447,\"predicate\":\"pageCaption\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"credit\",\"type\":\"RichText\"}],\"type\":\"PageCaption\"},{\"id\":-1188055347,\"predicate\":\"pageListItemText\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageListItem\"},{\"id\":635466748,\"predicate\":\"pageListItemBlocks\",\"params\":[{\"name\":\"blocks\",\"type\":\"Vector\"}],\"type\":\"PageListItem\"},{\"id\":1577484359,\"predicate\":\"pageListOrderedItemText\",\"params\":[{\"name\":\"num\",\"type\":\"string\"},{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageListOrderedItem\"},{\"id\":-1730311882,\"predicate\":\"pageListOrderedItemBlocks\",\"params\":[{\"name\":\"num\",\"type\":\"string\"},{\"name\":\"blocks\",\"type\":\"Vector\"}],\"type\":\"PageListOrderedItem\"},{\"id\":-1702174239,\"predicate\":\"pageBlockOrderedList\",\"params\":[{\"name\":\"items\",\"type\":\"Vector\"}],\"type\":\"PageBlock\"},{\"id\":1987480557,\"predicate\":\"pageBlockDetails\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"open\",\"type\":\"flags.0?true\"},{\"name\":\"blocks\",\"type\":\"Vector\"},{\"name\":\"title\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":-1282352120,\"predicate\":\"pageRelatedArticle\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"webpage_id\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"flags.0?string\"},{\"name\":\"description\",\"type\":\"flags.1?string\"},{\"name\":\"photo_id\",\"type\":\"flags.2?long\"},{\"name\":\"author\",\"type\":\"flags.3?string\"},{\"name\":\"published_date\",\"type\":\"flags.4?int\"}],\"type\":\"PageRelatedArticle\"},{\"id\":370236054,\"predicate\":\"pageBlockRelatedArticles\",\"params\":[{\"name\":\"title\",\"type\":\"RichText\"},{\"name\":\"articles\",\"type\":\"Vector\"}],\"type\":\"PageBlock\"},{\"id\":-1538310410,\"predicate\":\"pageBlockMap\",\"params\":[{\"name\":\"geo\",\"type\":\"GeoPoint\"},{\"name\":\"zoom\",\"type\":\"int\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":-1738178803,\"predicate\":\"page\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"part\",\"type\":\"flags.0?true\"},{\"name\":\"rtl\",\"type\":\"flags.1?true\"},{\"name\":\"v2\",\"type\":\"flags.2?true\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"blocks\",\"type\":\"Vector\"},{\"name\":\"photos\",\"type\":\"Vector\"},{\"name\":\"documents\",\"type\":\"Vector\"},{\"name\":\"views\",\"type\":\"flags.3?int\"}],\"type\":\"Page\"},{\"id\":-610373422,\"predicate\":\"inputPrivacyKeyPhoneP2P\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":961092808,\"predicate\":\"privacyKeyPhoneP2P\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":894777186,\"predicate\":\"textAnchor\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"name\",\"type\":\"string\"}],\"type\":\"RichText\"},{\"id\":-1945767479,\"predicate\":\"help.supportName\",\"params\":[{\"name\":\"name\",\"type\":\"string\"}],\"type\":\"help.SupportName\"},{\"id\":-206688531,\"predicate\":\"help.userInfoEmpty\",\"params\":[],\"type\":\"help.UserInfo\"},{\"id\":32192344,\"predicate\":\"help.userInfo\",\"params\":[{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"Vector\"},{\"name\":\"author\",\"type\":\"string\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"help.UserInfo\"},{\"id\":-202219658,\"predicate\":\"messageActionContactSignUp\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":-1398708869,\"predicate\":\"updateMessagePoll\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"poll_id\",\"type\":\"long\"},{\"name\":\"poll\",\"type\":\"flags.0?Poll\"},{\"name\":\"results\",\"type\":\"PollResults\"}],\"type\":\"Update\"},{\"id\":1823064809,\"predicate\":\"pollAnswer\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"option\",\"type\":\"bytes\"}],\"type\":\"PollAnswer\"},{\"id\":-2032041631,\"predicate\":\"poll\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"closed\",\"type\":\"flags.0?true\"},{\"name\":\"public_voters\",\"type\":\"flags.1?true\"},{\"name\":\"multiple_choice\",\"type\":\"flags.2?true\"},{\"name\":\"quiz\",\"type\":\"flags.3?true\"},{\"name\":\"question\",\"type\":\"string\"},{\"name\":\"answers\",\"type\":\"Vector\"},{\"name\":\"close_period\",\"type\":\"flags.4?int\"},{\"name\":\"close_date\",\"type\":\"flags.5?int\"}],\"type\":\"Poll\"},{\"id\":997055186,\"predicate\":\"pollAnswerVoters\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"chosen\",\"type\":\"flags.0?true\"},{\"name\":\"correct\",\"type\":\"flags.1?true\"},{\"name\":\"option\",\"type\":\"bytes\"},{\"name\":\"voters\",\"type\":\"int\"}],\"type\":\"PollAnswerVoters\"},{\"id\":-591909213,\"predicate\":\"pollResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"min\",\"type\":\"flags.0?true\"},{\"name\":\"results\",\"type\":\"flags.1?Vector\"},{\"name\":\"total_voters\",\"type\":\"flags.2?int\"},{\"name\":\"recent_voters\",\"type\":\"flags.3?Vector\"},{\"name\":\"solution\",\"type\":\"flags.4?string\"},{\"name\":\"solution_entities\",\"type\":\"flags.4?Vector\"}],\"type\":\"PollResults\"},{\"id\":261416433,\"predicate\":\"inputMediaPoll\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"poll\",\"type\":\"Poll\"},{\"name\":\"correct_answers\",\"type\":\"flags.0?Vector\"},{\"name\":\"solution\",\"type\":\"flags.1?string\"},{\"name\":\"solution_entities\",\"type\":\"flags.1?Vector\"}],\"type\":\"InputMedia\"},{\"id\":1272375192,\"predicate\":\"messageMediaPoll\",\"params\":[{\"name\":\"poll\",\"type\":\"Poll\"},{\"name\":\"results\",\"type\":\"PollResults\"}],\"type\":\"MessageMedia\"},{\"id\":-264117680,\"predicate\":\"chatOnlines\",\"params\":[{\"name\":\"onlines\",\"type\":\"int\"}],\"type\":\"ChatOnlines\"},{\"id\":1202287072,\"predicate\":\"statsURL\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"StatsURL\"},{\"id\":-525288402,\"predicate\":\"photoStrippedSize\",\"params\":[{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"PhotoSize\"},{\"id\":1605510357,\"predicate\":\"chatAdminRights\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"change_info\",\"type\":\"flags.0?true\"},{\"name\":\"post_messages\",\"type\":\"flags.1?true\"},{\"name\":\"edit_messages\",\"type\":\"flags.2?true\"},{\"name\":\"delete_messages\",\"type\":\"flags.3?true\"},{\"name\":\"ban_users\",\"type\":\"flags.4?true\"},{\"name\":\"invite_users\",\"type\":\"flags.5?true\"},{\"name\":\"pin_messages\",\"type\":\"flags.7?true\"},{\"name\":\"add_admins\",\"type\":\"flags.9?true\"},{\"name\":\"anonymous\",\"type\":\"flags.10?true\"},{\"name\":\"manage_call\",\"type\":\"flags.11?true\"},{\"name\":\"other\",\"type\":\"flags.12?true\"},{\"name\":\"manage_topics\",\"type\":\"flags.13?true\"}],\"type\":\"ChatAdminRights\"},{\"id\":-1626209256,\"predicate\":\"chatBannedRights\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"view_messages\",\"type\":\"flags.0?true\"},{\"name\":\"send_messages\",\"type\":\"flags.1?true\"},{\"name\":\"send_media\",\"type\":\"flags.2?true\"},{\"name\":\"send_stickers\",\"type\":\"flags.3?true\"},{\"name\":\"send_gifs\",\"type\":\"flags.4?true\"},{\"name\":\"send_games\",\"type\":\"flags.5?true\"},{\"name\":\"send_inline\",\"type\":\"flags.6?true\"},{\"name\":\"embed_links\",\"type\":\"flags.7?true\"},{\"name\":\"send_polls\",\"type\":\"flags.8?true\"},{\"name\":\"change_info\",\"type\":\"flags.10?true\"},{\"name\":\"invite_users\",\"type\":\"flags.15?true\"},{\"name\":\"pin_messages\",\"type\":\"flags.17?true\"},{\"name\":\"manage_topics\",\"type\":\"flags.18?true\"},{\"name\":\"send_photos\",\"type\":\"flags.19?true\"},{\"name\":\"send_videos\",\"type\":\"flags.20?true\"},{\"name\":\"send_roundvideos\",\"type\":\"flags.21?true\"},{\"name\":\"send_audios\",\"type\":\"flags.22?true\"},{\"name\":\"send_voices\",\"type\":\"flags.23?true\"},{\"name\":\"send_docs\",\"type\":\"flags.24?true\"},{\"name\":\"send_plain\",\"type\":\"flags.25?true\"},{\"name\":\"until_date\",\"type\":\"int\"}],\"type\":\"ChatBannedRights\"},{\"id\":1421875280,\"predicate\":\"updateChatDefaultBannedRights\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"default_banned_rights\",\"type\":\"ChatBannedRights\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-433014407,\"predicate\":\"inputWallPaper\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputWallPaper\"},{\"id\":1913199744,\"predicate\":\"inputWallPaperSlug\",\"params\":[{\"name\":\"slug\",\"type\":\"string\"}],\"type\":\"InputWallPaper\"},{\"id\":-1150621555,\"predicate\":\"channelParticipantsContacts\",\"params\":[{\"name\":\"q\",\"type\":\"string\"}],\"type\":\"ChannelParticipantsFilter\"},{\"id\":771095562,\"predicate\":\"channelAdminLogEventActionDefaultBannedRights\",\"params\":[{\"name\":\"prev_banned_rights\",\"type\":\"ChatBannedRights\"},{\"name\":\"new_banned_rights\",\"type\":\"ChatBannedRights\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-1895328189,\"predicate\":\"channelAdminLogEventActionStopPoll\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":471437699,\"predicate\":\"account.wallPapersNotModified\",\"params\":[],\"type\":\"account.WallPapers\"},{\"id\":-842824308,\"predicate\":\"account.wallPapers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"wallpapers\",\"type\":\"Vector\"}],\"type\":\"account.WallPapers\"},{\"id\":-1390068360,\"predicate\":\"codeSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"allow_flashcall\",\"type\":\"flags.0?true\"},{\"name\":\"current_number\",\"type\":\"flags.1?true\"},{\"name\":\"allow_app_hash\",\"type\":\"flags.4?true\"},{\"name\":\"allow_missed_call\",\"type\":\"flags.5?true\"},{\"name\":\"allow_firebase\",\"type\":\"flags.7?true\"},{\"name\":\"logout_tokens\",\"type\":\"flags.6?Vector\"},{\"name\":\"token\",\"type\":\"flags.8?string\"},{\"name\":\"app_sandbox\",\"type\":\"flags.8?Bool\"}],\"type\":\"CodeSettings\"},{\"id\":499236004,\"predicate\":\"wallPaperSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"blur\",\"type\":\"flags.1?true\"},{\"name\":\"motion\",\"type\":\"flags.2?true\"},{\"name\":\"background_color\",\"type\":\"flags.0?int\"},{\"name\":\"second_background_color\",\"type\":\"flags.4?int\"},{\"name\":\"third_background_color\",\"type\":\"flags.5?int\"},{\"name\":\"fourth_background_color\",\"type\":\"flags.6?int\"},{\"name\":\"intensity\",\"type\":\"flags.3?int\"},{\"name\":\"rotation\",\"type\":\"flags.4?int\"}],\"type\":\"WallPaperSettings\"},{\"id\":-1896171181,\"predicate\":\"autoDownloadSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"disabled\",\"type\":\"flags.0?true\"},{\"name\":\"video_preload_large\",\"type\":\"flags.1?true\"},{\"name\":\"audio_preload_next\",\"type\":\"flags.2?true\"},{\"name\":\"phonecalls_less_data\",\"type\":\"flags.3?true\"},{\"name\":\"photo_size_max\",\"type\":\"int\"},{\"name\":\"video_size_max\",\"type\":\"long\"},{\"name\":\"file_size_max\",\"type\":\"long\"},{\"name\":\"video_upload_maxbitrate\",\"type\":\"int\"}],\"type\":\"AutoDownloadSettings\"},{\"id\":1674235686,\"predicate\":\"account.autoDownloadSettings\",\"params\":[{\"name\":\"low\",\"type\":\"AutoDownloadSettings\"},{\"name\":\"medium\",\"type\":\"AutoDownloadSettings\"},{\"name\":\"high\",\"type\":\"AutoDownloadSettings\"}],\"type\":\"account.AutoDownloadSettings\"},{\"id\":-709641735,\"predicate\":\"emojiKeyword\",\"params\":[{\"name\":\"keyword\",\"type\":\"string\"},{\"name\":\"emoticons\",\"type\":\"Vector\"}],\"type\":\"EmojiKeyword\"},{\"id\":594408994,\"predicate\":\"emojiKeywordDeleted\",\"params\":[{\"name\":\"keyword\",\"type\":\"string\"},{\"name\":\"emoticons\",\"type\":\"Vector\"}],\"type\":\"EmojiKeyword\"},{\"id\":1556570557,\"predicate\":\"emojiKeywordsDifference\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"from_version\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"int\"},{\"name\":\"keywords\",\"type\":\"Vector\"}],\"type\":\"EmojiKeywordsDifference\"},{\"id\":-1519029347,\"predicate\":\"emojiURL\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"EmojiURL\"},{\"id\":-1275374751,\"predicate\":\"emojiLanguage\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"EmojiLanguage\"},{\"id\":-1529000952,\"predicate\":\"inputPrivacyKeyForwards\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":1777096355,\"predicate\":\"privacyKeyForwards\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":1461304012,\"predicate\":\"inputPrivacyKeyProfilePhoto\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":-1777000467,\"predicate\":\"privacyKeyProfilePhoto\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":1075322878,\"predicate\":\"inputPhotoFileLocation\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"},{\"name\":\"thumb_size\",\"type\":\"string\"}],\"type\":\"InputFileLocation\"},{\"id\":-667654413,\"predicate\":\"inputPhotoLegacyFileLocation\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"},{\"name\":\"volume_id\",\"type\":\"long\"},{\"name\":\"local_id\",\"type\":\"int\"},{\"name\":\"secret\",\"type\":\"long\"}],\"type\":\"InputFileLocation\"},{\"id\":925204121,\"predicate\":\"inputPeerPhotoFileLocation\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"big\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"photo_id\",\"type\":\"long\"}],\"type\":\"InputFileLocation\"},{\"id\":-1652231205,\"predicate\":\"inputStickerSetThumb\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"thumb_version\",\"type\":\"int\"}],\"type\":\"InputFileLocation\"},{\"id\":-11252123,\"predicate\":\"folder\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"autofill_new_broadcasts\",\"type\":\"flags.0?true\"},{\"name\":\"autofill_public_groups\",\"type\":\"flags.1?true\"},{\"name\":\"autofill_new_correspondents\",\"type\":\"flags.2?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.3?ChatPhoto\"}],\"type\":\"Folder\"},{\"id\":1908216652,\"predicate\":\"dialogFolder\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.2?true\"},{\"name\":\"folder\",\"type\":\"Folder\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"top_message\",\"type\":\"int\"},{\"name\":\"unread_muted_peers_count\",\"type\":\"int\"},{\"name\":\"unread_unmuted_peers_count\",\"type\":\"int\"},{\"name\":\"unread_muted_messages_count\",\"type\":\"int\"},{\"name\":\"unread_unmuted_messages_count\",\"type\":\"int\"}],\"type\":\"Dialog\"},{\"id\":1684014375,\"predicate\":\"inputDialogPeerFolder\",\"params\":[{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"InputDialogPeer\"},{\"id\":1363483106,\"predicate\":\"dialogPeerFolder\",\"params\":[{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"DialogPeer\"},{\"id\":-70073706,\"predicate\":\"inputFolderPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"InputFolderPeer\"},{\"id\":-373643672,\"predicate\":\"folderPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"FolderPeer\"},{\"id\":422972864,\"predicate\":\"updateFolderPeers\",\"params\":[{\"name\":\"folder_peers\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":497305826,\"predicate\":\"inputUserFromMessage\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"InputUser\"},{\"id\":1536380829,\"predicate\":\"inputChannelFromMessage\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"channel_id\",\"type\":\"long\"}],\"type\":\"InputChannel\"},{\"id\":-1468331492,\"predicate\":\"inputPeerUserFromMessage\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"InputPeer\"},{\"id\":-1121318848,\"predicate\":\"inputPeerChannelFromMessage\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"channel_id\",\"type\":\"long\"}],\"type\":\"InputPeer\"},{\"id\":55761658,\"predicate\":\"inputPrivacyKeyPhoneNumber\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":-778378131,\"predicate\":\"privacyKeyPhoneNumber\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":-1472172887,\"predicate\":\"topPeerCategoryForwardUsers\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":-68239120,\"predicate\":\"topPeerCategoryForwardChats\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":84703944,\"predicate\":\"channelAdminLogEventActionChangeLinkedChat\",\"params\":[{\"name\":\"prev_value\",\"type\":\"long\"},{\"name\":\"new_value\",\"type\":\"long\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-398136321,\"predicate\":\"messages.searchCounter\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"inexact\",\"type\":\"flags.1?true\"},{\"name\":\"filter\",\"type\":\"MessagesFilter\"},{\"name\":\"count\",\"type\":\"int\"}],\"type\":\"messages.SearchCounter\"},{\"id\":280464681,\"predicate\":\"keyboardButtonUrlAuth\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"fwd_text\",\"type\":\"flags.0?string\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"button_id\",\"type\":\"int\"}],\"type\":\"KeyboardButton\"},{\"id\":-802258988,\"predicate\":\"inputKeyboardButtonUrlAuth\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"request_write_access\",\"type\":\"flags.0?true\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"fwd_text\",\"type\":\"flags.1?string\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"bot\",\"type\":\"InputUser\"}],\"type\":\"KeyboardButton\"},{\"id\":-1831650802,\"predicate\":\"urlAuthResultRequest\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"request_write_access\",\"type\":\"flags.0?true\"},{\"name\":\"bot\",\"type\":\"User\"},{\"name\":\"domain\",\"type\":\"string\"}],\"type\":\"UrlAuthResult\"},{\"id\":-1886646706,\"predicate\":\"urlAuthResultAccepted\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"UrlAuthResult\"},{\"id\":-1445536993,\"predicate\":\"urlAuthResultDefault\",\"params\":[],\"type\":\"UrlAuthResult\"},{\"id\":-2079962673,\"predicate\":\"inputPrivacyValueAllowChatParticipants\",\"params\":[{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"InputPrivacyRule\"},{\"id\":-380694650,\"predicate\":\"inputPrivacyValueDisallowChatParticipants\",\"params\":[{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"InputPrivacyRule\"},{\"id\":1796427406,\"predicate\":\"privacyValueAllowChatParticipants\",\"params\":[{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"PrivacyRule\"},{\"id\":1103656293,\"predicate\":\"privacyValueDisallowChatParticipants\",\"params\":[{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"PrivacyRule\"},{\"id\":-1672577397,\"predicate\":\"messageEntityUnderline\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":-1090087980,\"predicate\":\"messageEntityStrike\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":34469328,\"predicate\":\"messageEntityBlockquote\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":1786671974,\"predicate\":\"updatePeerSettings\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"settings\",\"type\":\"PeerSettings\"}],\"type\":\"Update\"},{\"id\":-1078612597,\"predicate\":\"channelLocationEmpty\",\"params\":[],\"type\":\"ChannelLocation\"},{\"id\":547062491,\"predicate\":\"channelLocation\",\"params\":[{\"name\":\"geo_point\",\"type\":\"GeoPoint\"},{\"name\":\"address\",\"type\":\"string\"}],\"type\":\"ChannelLocation\"},{\"id\":-901375139,\"predicate\":\"peerLocated\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"expires\",\"type\":\"int\"},{\"name\":\"distance\",\"type\":\"int\"}],\"type\":\"PeerLocated\"},{\"id\":-1263546448,\"predicate\":\"updatePeerLocated\",\"params\":[{\"name\":\"peers\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":241923758,\"predicate\":\"channelAdminLogEventActionChangeLocation\",\"params\":[{\"name\":\"prev_value\",\"type\":\"ChannelLocation\"},{\"name\":\"new_value\",\"type\":\"ChannelLocation\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-606798099,\"predicate\":\"inputReportReasonGeoIrrelevant\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":1401984889,\"predicate\":\"channelAdminLogEventActionToggleSlowMode\",\"params\":[{\"name\":\"prev_value\",\"type\":\"int\"},{\"name\":\"new_value\",\"type\":\"int\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1148485274,\"predicate\":\"auth.authorizationSignUpRequired\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"terms_of_service\",\"type\":\"flags.0?help.TermsOfService\"}],\"type\":\"auth.Authorization\"},{\"id\":-666824391,\"predicate\":\"payments.paymentVerificationNeeded\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"payments.PaymentResult\"},{\"id\":42402760,\"predicate\":\"inputStickerSetAnimatedEmoji\",\"params\":[],\"type\":\"InputStickerSet\"},{\"id\":967122427,\"predicate\":\"updateNewScheduledMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"}],\"type\":\"Update\"},{\"id\":-1870238482,\"predicate\":\"updateDeleteScheduledMessages\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"messages\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":-797791052,\"predicate\":\"restrictionReason\",\"params\":[{\"name\":\"platform\",\"type\":\"string\"},{\"name\":\"reason\",\"type\":\"string\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"RestrictionReason\"},{\"id\":1012306921,\"predicate\":\"inputTheme\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputTheme\"},{\"id\":-175567375,\"predicate\":\"inputThemeSlug\",\"params\":[{\"name\":\"slug\",\"type\":\"string\"}],\"type\":\"InputTheme\"},{\"id\":-1609668650,\"predicate\":\"theme\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"creator\",\"type\":\"flags.0?true\"},{\"name\":\"default\",\"type\":\"flags.1?true\"},{\"name\":\"for_chat\",\"type\":\"flags.5?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"slug\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"document\",\"type\":\"flags.2?Document\"},{\"name\":\"settings\",\"type\":\"flags.3?Vector\"},{\"name\":\"emoticon\",\"type\":\"flags.6?string\"},{\"name\":\"installs_count\",\"type\":\"flags.4?int\"}],\"type\":\"Theme\"},{\"id\":-199313886,\"predicate\":\"account.themesNotModified\",\"params\":[],\"type\":\"account.Themes\"},{\"id\":-1707242387,\"predicate\":\"account.themes\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"themes\",\"type\":\"Vector\"}],\"type\":\"account.Themes\"},{\"id\":-2112423005,\"predicate\":\"updateTheme\",\"params\":[{\"name\":\"theme\",\"type\":\"Theme\"}],\"type\":\"Update\"},{\"id\":-786326563,\"predicate\":\"inputPrivacyKeyAddedByPhone\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":1124062251,\"predicate\":\"privacyKeyAddedByPhone\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":-2027964103,\"predicate\":\"updateGeoLiveViewed\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":1448076945,\"predicate\":\"updateLoginToken\",\"params\":[],\"type\":\"Update\"},{\"id\":1654593920,\"predicate\":\"auth.loginToken\",\"params\":[{\"name\":\"expires\",\"type\":\"int\"},{\"name\":\"token\",\"type\":\"bytes\"}],\"type\":\"auth.LoginToken\"},{\"id\":110008598,\"predicate\":\"auth.loginTokenMigrateTo\",\"params\":[{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"token\",\"type\":\"bytes\"}],\"type\":\"auth.LoginToken\"},{\"id\":957176926,\"predicate\":\"auth.loginTokenSuccess\",\"params\":[{\"name\":\"authorization\",\"type\":\"auth.Authorization\"}],\"type\":\"auth.LoginToken\"},{\"id\":1474462241,\"predicate\":\"account.contentSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"sensitive_enabled\",\"type\":\"flags.0?true\"},{\"name\":\"sensitive_can_change\",\"type\":\"flags.1?true\"}],\"type\":\"account.ContentSettings\"},{\"id\":-1456996667,\"predicate\":\"messages.inactiveChats\",\"params\":[{\"name\":\"dates\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.InactiveChats\"},{\"id\":-1012849566,\"predicate\":\"baseThemeClassic\",\"params\":[],\"type\":\"BaseTheme\"},{\"id\":-69724536,\"predicate\":\"baseThemeDay\",\"params\":[],\"type\":\"BaseTheme\"},{\"id\":-1212997976,\"predicate\":\"baseThemeNight\",\"params\":[],\"type\":\"BaseTheme\"},{\"id\":1834973166,\"predicate\":\"baseThemeTinted\",\"params\":[],\"type\":\"BaseTheme\"},{\"id\":1527845466,\"predicate\":\"baseThemeArctic\",\"params\":[],\"type\":\"BaseTheme\"},{\"id\":-1770371538,\"predicate\":\"inputWallPaperNoFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"InputWallPaper\"},{\"id\":-528465642,\"predicate\":\"wallPaperNoFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"default\",\"type\":\"flags.1?true\"},{\"name\":\"dark\",\"type\":\"flags.4?true\"},{\"name\":\"settings\",\"type\":\"flags.2?WallPaperSettings\"}],\"type\":\"WallPaper\"},{\"id\":-1881255857,\"predicate\":\"inputThemeSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"message_colors_animated\",\"type\":\"flags.2?true\"},{\"name\":\"base_theme\",\"type\":\"BaseTheme\"},{\"name\":\"accent_color\",\"type\":\"int\"},{\"name\":\"outbox_accent_color\",\"type\":\"flags.3?int\"},{\"name\":\"message_colors\",\"type\":\"flags.0?Vector\"},{\"name\":\"wallpaper\",\"type\":\"flags.1?InputWallPaper\"},{\"name\":\"wallpaper_settings\",\"type\":\"flags.1?WallPaperSettings\"}],\"type\":\"InputThemeSettings\"},{\"id\":-94849324,\"predicate\":\"themeSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"message_colors_animated\",\"type\":\"flags.2?true\"},{\"name\":\"base_theme\",\"type\":\"BaseTheme\"},{\"name\":\"accent_color\",\"type\":\"int\"},{\"name\":\"outbox_accent_color\",\"type\":\"flags.3?int\"},{\"name\":\"message_colors\",\"type\":\"flags.0?Vector\"},{\"name\":\"wallpaper\",\"type\":\"flags.1?WallPaper\"}],\"type\":\"ThemeSettings\"},{\"id\":1421174295,\"predicate\":\"webPageAttributeTheme\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"documents\",\"type\":\"flags.0?Vector\"},{\"name\":\"settings\",\"type\":\"flags.1?ThemeSettings\"}],\"type\":\"WebPageAttribute\"},{\"id\":274961865,\"predicate\":\"updateMessagePollVote\",\"params\":[{\"name\":\"poll_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"options\",\"type\":\"Vector\"},{\"name\":\"qts\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":886196148,\"predicate\":\"messageUserVote\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"option\",\"type\":\"bytes\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"MessageUserVote\"},{\"id\":1017491692,\"predicate\":\"messageUserVoteInputOption\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"MessageUserVote\"},{\"id\":-1973033641,\"predicate\":\"messageUserVoteMultiple\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"options\",\"type\":\"Vector\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"MessageUserVote\"},{\"id\":136574537,\"predicate\":\"messages.votesList\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"votes\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"next_offset\",\"type\":\"flags.0?string\"}],\"type\":\"messages.VotesList\"},{\"id\":-1144565411,\"predicate\":\"keyboardButtonRequestPoll\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"quiz\",\"type\":\"flags.0?Bool\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":1981704948,\"predicate\":\"messageEntityBankCard\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":-177732982,\"predicate\":\"bankCardOpenUrl\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"name\",\"type\":\"string\"}],\"type\":\"BankCardOpenUrl\"},{\"id\":1042605427,\"predicate\":\"payments.bankCardData\",\"params\":[{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"open_urls\",\"type\":\"Vector\"}],\"type\":\"payments.BankCardData\"},{\"id\":-118740917,\"predicate\":\"peerSelfLocated\",\"params\":[{\"name\":\"expires\",\"type\":\"int\"}],\"type\":\"PeerLocated\"},{\"id\":1949890536,\"predicate\":\"dialogFilter\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"contacts\",\"type\":\"flags.0?true\"},{\"name\":\"non_contacts\",\"type\":\"flags.1?true\"},{\"name\":\"groups\",\"type\":\"flags.2?true\"},{\"name\":\"broadcasts\",\"type\":\"flags.3?true\"},{\"name\":\"bots\",\"type\":\"flags.4?true\"},{\"name\":\"exclude_muted\",\"type\":\"flags.11?true\"},{\"name\":\"exclude_read\",\"type\":\"flags.12?true\"},{\"name\":\"exclude_archived\",\"type\":\"flags.13?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"emoticon\",\"type\":\"flags.25?string\"},{\"name\":\"pinned_peers\",\"type\":\"Vector\"},{\"name\":\"include_peers\",\"type\":\"Vector\"},{\"name\":\"exclude_peers\",\"type\":\"Vector\"}],\"type\":\"DialogFilter\"},{\"id\":2004110666,\"predicate\":\"dialogFilterSuggested\",\"params\":[{\"name\":\"filter\",\"type\":\"DialogFilter\"},{\"name\":\"description\",\"type\":\"string\"}],\"type\":\"DialogFilterSuggested\"},{\"id\":654302845,\"predicate\":\"updateDialogFilter\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"filter\",\"type\":\"flags.0?DialogFilter\"}],\"type\":\"Update\"},{\"id\":-1512627963,\"predicate\":\"updateDialogFilterOrder\",\"params\":[{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":889491791,\"predicate\":\"updateDialogFilters\",\"params\":[],\"type\":\"Update\"},{\"id\":-1237848657,\"predicate\":\"statsDateRangeDays\",\"params\":[{\"name\":\"min_date\",\"type\":\"int\"},{\"name\":\"max_date\",\"type\":\"int\"}],\"type\":\"StatsDateRangeDays\"},{\"id\":-884757282,\"predicate\":\"statsAbsValueAndPrev\",\"params\":[{\"name\":\"current\",\"type\":\"double\"},{\"name\":\"previous\",\"type\":\"double\"}],\"type\":\"StatsAbsValueAndPrev\"},{\"id\":-875679776,\"predicate\":\"statsPercentValue\",\"params\":[{\"name\":\"part\",\"type\":\"double\"},{\"name\":\"total\",\"type\":\"double\"}],\"type\":\"StatsPercentValue\"},{\"id\":1244130093,\"predicate\":\"statsGraphAsync\",\"params\":[{\"name\":\"token\",\"type\":\"string\"}],\"type\":\"StatsGraph\"},{\"id\":-1092839390,\"predicate\":\"statsGraphError\",\"params\":[{\"name\":\"error\",\"type\":\"string\"}],\"type\":\"StatsGraph\"},{\"id\":-1901828938,\"predicate\":\"statsGraph\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"json\",\"type\":\"DataJSON\"},{\"name\":\"zoom_token\",\"type\":\"flags.0?string\"}],\"type\":\"StatsGraph\"},{\"id\":-1387279939,\"predicate\":\"messageInteractionCounters\",\"params\":[{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"views\",\"type\":\"int\"},{\"name\":\"forwards\",\"type\":\"int\"}],\"type\":\"MessageInteractionCounters\"},{\"id\":-1107852396,\"predicate\":\"stats.broadcastStats\",\"params\":[{\"name\":\"period\",\"type\":\"StatsDateRangeDays\"},{\"name\":\"followers\",\"type\":\"StatsAbsValueAndPrev\"},{\"name\":\"views_per_post\",\"type\":\"StatsAbsValueAndPrev\"},{\"name\":\"shares_per_post\",\"type\":\"StatsAbsValueAndPrev\"},{\"name\":\"enabled_notifications\",\"type\":\"StatsPercentValue\"},{\"name\":\"growth_graph\",\"type\":\"StatsGraph\"},{\"name\":\"followers_graph\",\"type\":\"StatsGraph\"},{\"name\":\"mute_graph\",\"type\":\"StatsGraph\"},{\"name\":\"top_hours_graph\",\"type\":\"StatsGraph\"},{\"name\":\"interactions_graph\",\"type\":\"StatsGraph\"},{\"name\":\"iv_interactions_graph\",\"type\":\"StatsGraph\"},{\"name\":\"views_by_source_graph\",\"type\":\"StatsGraph\"},{\"name\":\"new_followers_by_source_graph\",\"type\":\"StatsGraph\"},{\"name\":\"languages_graph\",\"type\":\"StatsGraph\"},{\"name\":\"recent_message_interactions\",\"type\":\"Vector\"}],\"type\":\"stats.BroadcastStats\"},{\"id\":-428884101,\"predicate\":\"inputMediaDice\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"}],\"type\":\"InputMedia\"},{\"id\":1065280907,\"predicate\":\"messageMediaDice\",\"params\":[{\"name\":\"value\",\"type\":\"int\"},{\"name\":\"emoticon\",\"type\":\"string\"}],\"type\":\"MessageMedia\"},{\"id\":-427863538,\"predicate\":\"inputStickerSetDice\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"}],\"type\":\"InputStickerSet\"},{\"id\":-1728664459,\"predicate\":\"help.promoDataEmpty\",\"params\":[{\"name\":\"expires\",\"type\":\"int\"}],\"type\":\"help.PromoData\"},{\"id\":-1942390465,\"predicate\":\"help.promoData\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"proxy\",\"type\":\"flags.0?true\"},{\"name\":\"expires\",\"type\":\"int\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"psa_type\",\"type\":\"flags.1?string\"},{\"name\":\"psa_message\",\"type\":\"flags.2?string\"}],\"type\":\"help.PromoData\"},{\"id\":-567037804,\"predicate\":\"videoSize\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"},{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"video_start_ts\",\"type\":\"flags.0?double\"}],\"type\":\"VideoSize\"},{\"id\":643940105,\"predicate\":\"updatePhoneCallSignalingData\",\"params\":[{\"name\":\"phone_call_id\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"type\":\"Update\"},{\"id\":1634294960,\"predicate\":\"chatInvitePeek\",\"params\":[{\"name\":\"chat\",\"type\":\"Chat\"},{\"name\":\"expires\",\"type\":\"int\"}],\"type\":\"ChatInvite\"},{\"id\":-1660637285,\"predicate\":\"statsGroupTopPoster\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"messages\",\"type\":\"int\"},{\"name\":\"avg_chars\",\"type\":\"int\"}],\"type\":\"StatsGroupTopPoster\"},{\"id\":-682079097,\"predicate\":\"statsGroupTopAdmin\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"deleted\",\"type\":\"int\"},{\"name\":\"kicked\",\"type\":\"int\"},{\"name\":\"banned\",\"type\":\"int\"}],\"type\":\"StatsGroupTopAdmin\"},{\"id\":1398765469,\"predicate\":\"statsGroupTopInviter\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"invitations\",\"type\":\"int\"}],\"type\":\"StatsGroupTopInviter\"},{\"id\":-276825834,\"predicate\":\"stats.megagroupStats\",\"params\":[{\"name\":\"period\",\"type\":\"StatsDateRangeDays\"},{\"name\":\"members\",\"type\":\"StatsAbsValueAndPrev\"},{\"name\":\"messages\",\"type\":\"StatsAbsValueAndPrev\"},{\"name\":\"viewers\",\"type\":\"StatsAbsValueAndPrev\"},{\"name\":\"posters\",\"type\":\"StatsAbsValueAndPrev\"},{\"name\":\"growth_graph\",\"type\":\"StatsGraph\"},{\"name\":\"members_graph\",\"type\":\"StatsGraph\"},{\"name\":\"new_members_by_source_graph\",\"type\":\"StatsGraph\"},{\"name\":\"languages_graph\",\"type\":\"StatsGraph\"},{\"name\":\"messages_graph\",\"type\":\"StatsGraph\"},{\"name\":\"actions_graph\",\"type\":\"StatsGraph\"},{\"name\":\"top_hours_graph\",\"type\":\"StatsGraph\"},{\"name\":\"weekdays_graph\",\"type\":\"StatsGraph\"},{\"name\":\"top_posters\",\"type\":\"Vector\"},{\"name\":\"top_admins\",\"type\":\"Vector\"},{\"name\":\"top_inviters\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"stats.MegagroupStats\"},{\"id\":-1096616924,\"predicate\":\"globalPrivacySettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"archive_and_mute_new_noncontact_peers\",\"type\":\"flags.0?Bool\"}],\"type\":\"GlobalPrivacySettings\"},{\"id\":1667228533,\"predicate\":\"phoneConnectionWebrtc\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"turn\",\"type\":\"flags.0?true\"},{\"name\":\"stun\",\"type\":\"flags.1?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"ip\",\"type\":\"string\"},{\"name\":\"ipv6\",\"type\":\"string\"},{\"name\":\"port\",\"type\":\"int\"},{\"name\":\"username\",\"type\":\"string\"},{\"name\":\"password\",\"type\":\"string\"}],\"type\":\"PhoneConnection\"},{\"id\":1107543535,\"predicate\":\"help.countryCode\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"country_code\",\"type\":\"string\"},{\"name\":\"prefixes\",\"type\":\"flags.0?Vector\"},{\"name\":\"patterns\",\"type\":\"flags.1?Vector\"}],\"type\":\"help.CountryCode\"},{\"id\":-1014526429,\"predicate\":\"help.country\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"hidden\",\"type\":\"flags.0?true\"},{\"name\":\"iso2\",\"type\":\"string\"},{\"name\":\"default_name\",\"type\":\"string\"},{\"name\":\"name\",\"type\":\"flags.1?string\"},{\"name\":\"country_codes\",\"type\":\"Vector\"}],\"type\":\"help.Country\"},{\"id\":-1815339214,\"predicate\":\"help.countriesListNotModified\",\"params\":[],\"type\":\"help.CountriesList\"},{\"id\":-2016381538,\"predicate\":\"help.countriesList\",\"params\":[{\"name\":\"countries\",\"type\":\"Vector\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"help.CountriesList\"},{\"id\":1163625789,\"predicate\":\"messageViews\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"views\",\"type\":\"flags.0?int\"},{\"name\":\"forwards\",\"type\":\"flags.1?int\"},{\"name\":\"replies\",\"type\":\"flags.2?MessageReplies\"}],\"type\":\"MessageViews\"},{\"id\":-761649164,\"predicate\":\"updateChannelMessageForwards\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"forwards\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-96535659,\"predicate\":\"photoSizeProgressive\",\"params\":[{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"},{\"name\":\"sizes\",\"type\":\"Vector\"}],\"type\":\"PhotoSize\"},{\"id\":-1228606141,\"predicate\":\"messages.messageViews\",\"params\":[{\"name\":\"views\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.MessageViews\"},{\"id\":-693004986,\"predicate\":\"updateReadChannelDiscussionInbox\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"top_msg_id\",\"type\":\"int\"},{\"name\":\"read_max_id\",\"type\":\"int\"},{\"name\":\"broadcast_id\",\"type\":\"flags.0?long\"},{\"name\":\"broadcast_post\",\"type\":\"flags.0?int\"}],\"type\":\"Update\"},{\"id\":1767677564,\"predicate\":\"updateReadChannelDiscussionOutbox\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"top_msg_id\",\"type\":\"int\"},{\"name\":\"read_max_id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1506535550,\"predicate\":\"messages.discussionMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"max_id\",\"type\":\"flags.0?int\"},{\"name\":\"read_inbox_max_id\",\"type\":\"flags.1?int\"},{\"name\":\"read_outbox_max_id\",\"type\":\"flags.2?int\"},{\"name\":\"unread_count\",\"type\":\"int\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.DiscussionMessage\"},{\"id\":-1495959709,\"predicate\":\"messageReplyHeader\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"reply_to_scheduled\",\"type\":\"flags.2?true\"},{\"name\":\"forum_topic\",\"type\":\"flags.3?true\"},{\"name\":\"reply_to_msg_id\",\"type\":\"int\"},{\"name\":\"reply_to_peer_id\",\"type\":\"flags.0?Peer\"},{\"name\":\"reply_to_top_id\",\"type\":\"flags.1?int\"}],\"type\":\"MessageReplyHeader\"},{\"id\":-2083123262,\"predicate\":\"messageReplies\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"comments\",\"type\":\"flags.0?true\"},{\"name\":\"replies\",\"type\":\"int\"},{\"name\":\"replies_pts\",\"type\":\"int\"},{\"name\":\"recent_repliers\",\"type\":\"flags.1?Vector\"},{\"name\":\"channel_id\",\"type\":\"flags.0?long\"},{\"name\":\"max_id\",\"type\":\"flags.2?int\"},{\"name\":\"read_max_id\",\"type\":\"flags.3?int\"}],\"type\":\"MessageReplies\"},{\"id\":610945826,\"predicate\":\"updatePeerBlocked\",\"params\":[{\"name\":\"peer_id\",\"type\":\"Peer\"},{\"name\":\"blocked\",\"type\":\"Bool\"}],\"type\":\"Update\"},{\"id\":-386039788,\"predicate\":\"peerBlocked\",\"params\":[{\"name\":\"peer_id\",\"type\":\"Peer\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"PeerBlocked\"},{\"id\":-1937192669,\"predicate\":\"updateChannelUserTyping\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"from_id\",\"type\":\"Peer\"},{\"name\":\"action\",\"type\":\"SendMessageAction\"}],\"type\":\"Update\"},{\"id\":-1392895362,\"predicate\":\"inputMessageCallbackQuery\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"query_id\",\"type\":\"long\"}],\"type\":\"InputMessage\"},{\"id\":453242886,\"predicate\":\"channelParticipantLeft\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"}],\"type\":\"ChannelParticipant\"},{\"id\":-531931925,\"predicate\":\"channelParticipantsMentions\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"q\",\"type\":\"flags.0?string\"},{\"name\":\"top_msg_id\",\"type\":\"flags.1?int\"}],\"type\":\"ChannelParticipantsFilter\"},{\"id\":-309990731,\"predicate\":\"updatePinnedMessages\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":1538885128,\"predicate\":\"updatePinnedChannelMessages\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.0?true\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":464520273,\"predicate\":\"inputMessagesFilterPinned\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1986399595,\"predicate\":\"stats.messageStats\",\"params\":[{\"name\":\"views_graph\",\"type\":\"StatsGraph\"}],\"type\":\"stats.MessageStats\"},{\"id\":-1730095465,\"predicate\":\"messageActionGeoProximityReached\",\"params\":[{\"name\":\"from_id\",\"type\":\"Peer\"},{\"name\":\"to_id\",\"type\":\"Peer\"},{\"name\":\"distance\",\"type\":\"int\"}],\"type\":\"MessageAction\"},{\"id\":-668906175,\"predicate\":\"photoPathSize\",\"params\":[{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"PhotoSize\"},{\"id\":-651419003,\"predicate\":\"speakingInGroupCallAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":2004925620,\"predicate\":\"groupCallDiscarded\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"duration\",\"type\":\"int\"}],\"type\":\"GroupCall\"},{\"id\":-711498484,\"predicate\":\"groupCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"join_muted\",\"type\":\"flags.1?true\"},{\"name\":\"can_change_join_muted\",\"type\":\"flags.2?true\"},{\"name\":\"join_date_asc\",\"type\":\"flags.6?true\"},{\"name\":\"schedule_start_subscribed\",\"type\":\"flags.8?true\"},{\"name\":\"can_start_video\",\"type\":\"flags.9?true\"},{\"name\":\"record_video_active\",\"type\":\"flags.11?true\"},{\"name\":\"rtmp_stream\",\"type\":\"flags.12?true\"},{\"name\":\"listeners_hidden\",\"type\":\"flags.13?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"participants_count\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"flags.3?string\"},{\"name\":\"stream_dc_id\",\"type\":\"flags.4?int\"},{\"name\":\"record_start_date\",\"type\":\"flags.5?int\"},{\"name\":\"schedule_date\",\"type\":\"flags.7?int\"},{\"name\":\"unmuted_video_count\",\"type\":\"flags.10?int\"},{\"name\":\"unmuted_video_limit\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"GroupCall\"},{\"id\":-659913713,\"predicate\":\"inputGroupCall\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputGroupCall\"},{\"id\":2047704898,\"predicate\":\"messageActionGroupCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"duration\",\"type\":\"flags.0?int\"}],\"type\":\"MessageAction\"},{\"id\":1345295095,\"predicate\":\"messageActionInviteToGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"MessageAction\"},{\"id\":-341428482,\"predicate\":\"groupCallParticipant\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"muted\",\"type\":\"flags.0?true\"},{\"name\":\"left\",\"type\":\"flags.1?true\"},{\"name\":\"can_self_unmute\",\"type\":\"flags.2?true\"},{\"name\":\"just_joined\",\"type\":\"flags.4?true\"},{\"name\":\"versioned\",\"type\":\"flags.5?true\"},{\"name\":\"min\",\"type\":\"flags.8?true\"},{\"name\":\"muted_by_you\",\"type\":\"flags.9?true\"},{\"name\":\"volume_by_admin\",\"type\":\"flags.10?true\"},{\"name\":\"self\",\"type\":\"flags.12?true\"},{\"name\":\"video_joined\",\"type\":\"flags.15?true\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"active_date\",\"type\":\"flags.3?int\"},{\"name\":\"source\",\"type\":\"int\"},{\"name\":\"volume\",\"type\":\"flags.7?int\"},{\"name\":\"about\",\"type\":\"flags.11?string\"},{\"name\":\"raise_hand_rating\",\"type\":\"flags.13?long\"},{\"name\":\"video\",\"type\":\"flags.6?GroupCallParticipantVideo\"},{\"name\":\"presentation\",\"type\":\"flags.14?GroupCallParticipantVideo\"}],\"type\":\"GroupCallParticipant\"},{\"id\":-124097970,\"predicate\":\"updateChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"}],\"type\":\"Update\"},{\"id\":-219423922,\"predicate\":\"updateGroupCallParticipants\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"participants\",\"type\":\"Vector\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":347227392,\"predicate\":\"updateGroupCall\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"call\",\"type\":\"GroupCall\"}],\"type\":\"Update\"},{\"id\":-1636664659,\"predicate\":\"phone.groupCall\",\"params\":[{\"name\":\"call\",\"type\":\"GroupCall\"},{\"name\":\"participants\",\"type\":\"Vector\"},{\"name\":\"participants_next_offset\",\"type\":\"string\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"phone.GroupCall\"},{\"id\":-193506890,\"predicate\":\"phone.groupParticipants\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"participants\",\"type\":\"Vector\"},{\"name\":\"next_offset\",\"type\":\"string\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"phone.GroupParticipants\"},{\"id\":813821341,\"predicate\":\"inlineQueryPeerTypeSameBotPM\",\"params\":[],\"type\":\"InlineQueryPeerType\"},{\"id\":-2093215828,\"predicate\":\"inlineQueryPeerTypePM\",\"params\":[],\"type\":\"InlineQueryPeerType\"},{\"id\":-681130742,\"predicate\":\"inlineQueryPeerTypeChat\",\"params\":[],\"type\":\"InlineQueryPeerType\"},{\"id\":1589952067,\"predicate\":\"inlineQueryPeerTypeMegagroup\",\"params\":[],\"type\":\"InlineQueryPeerType\"},{\"id\":1664413338,\"predicate\":\"inlineQueryPeerTypeBroadcast\",\"params\":[],\"type\":\"InlineQueryPeerType\"},{\"id\":589338437,\"predicate\":\"channelAdminLogEventActionStartGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-610299584,\"predicate\":\"channelAdminLogEventActionDiscardGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-115071790,\"predicate\":\"channelAdminLogEventActionParticipantMute\",\"params\":[{\"name\":\"participant\",\"type\":\"GroupCallParticipant\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-431740480,\"predicate\":\"channelAdminLogEventActionParticipantUnmute\",\"params\":[{\"name\":\"participant\",\"type\":\"GroupCallParticipant\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1456906823,\"predicate\":\"channelAdminLogEventActionToggleGroupCallSetting\",\"params\":[{\"name\":\"join_muted\",\"type\":\"Bool\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-1966921727,\"predicate\":\"inputPaymentCredentialsGooglePay\",\"params\":[{\"name\":\"payment_token\",\"type\":\"DataJSON\"}],\"type\":\"InputPaymentCredentials\"},{\"id\":375566091,\"predicate\":\"messages.historyImport\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"messages.HistoryImport\"},{\"id\":-606432698,\"predicate\":\"sendMessageHistoryImportAction\",\"params\":[{\"name\":\"progress\",\"type\":\"int\"}],\"type\":\"SendMessageAction\"},{\"id\":1578088377,\"predicate\":\"messages.historyImportParsed\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pm\",\"type\":\"flags.0?true\"},{\"name\":\"group\",\"type\":\"flags.1?true\"},{\"name\":\"title\",\"type\":\"flags.2?string\"}],\"type\":\"messages.HistoryImportParsed\"},{\"id\":-170010905,\"predicate\":\"inputReportReasonFake\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":-275956116,\"predicate\":\"messages.affectedFoundMessages\",\"params\":[{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"},{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"messages\",\"type\":\"Vector\"}],\"type\":\"messages.AffectedFoundMessages\"},{\"id\":1007897979,\"predicate\":\"messageActionSetMessagesTTL\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"period\",\"type\":\"int\"},{\"name\":\"auto_setting_from\",\"type\":\"flags.0?long\"}],\"type\":\"MessageAction\"},{\"id\":-1147422299,\"predicate\":\"updatePeerHistoryTTL\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"ttl_period\",\"type\":\"flags.0?int\"}],\"type\":\"Update\"},{\"id\":-796432838,\"predicate\":\"updateChatParticipant\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"actor_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"prev_participant\",\"type\":\"flags.0?ChatParticipant\"},{\"name\":\"new_participant\",\"type\":\"flags.1?ChatParticipant\"},{\"name\":\"invite\",\"type\":\"flags.2?ExportedChatInvite\"},{\"name\":\"qts\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1738720581,\"predicate\":\"updateChannelParticipant\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"actor_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"prev_participant\",\"type\":\"flags.0?ChannelParticipant\"},{\"name\":\"new_participant\",\"type\":\"flags.1?ChannelParticipant\"},{\"name\":\"invite\",\"type\":\"flags.2?ExportedChatInvite\"},{\"name\":\"qts\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-997782967,\"predicate\":\"updateBotStopped\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"stopped\",\"type\":\"Bool\"},{\"name\":\"qts\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1940201511,\"predicate\":\"chatInviteImporter\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"requested\",\"type\":\"flags.0?true\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"about\",\"type\":\"flags.2?string\"},{\"name\":\"approved_by\",\"type\":\"flags.1?long\"}],\"type\":\"ChatInviteImporter\"},{\"id\":-1111085620,\"predicate\":\"messages.exportedChatInvites\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"invites\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.ExportedChatInvites\"},{\"id\":410107472,\"predicate\":\"messages.exportedChatInvite\",\"params\":[{\"name\":\"invite\",\"type\":\"ExportedChatInvite\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.ExportedChatInvite\"},{\"id\":572915951,\"predicate\":\"messages.exportedChatInviteReplaced\",\"params\":[{\"name\":\"invite\",\"type\":\"ExportedChatInvite\"},{\"name\":\"new_invite\",\"type\":\"ExportedChatInvite\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.ExportedChatInvite\"},{\"id\":-2118733814,\"predicate\":\"messages.chatInviteImporters\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"importers\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.ChatInviteImporters\"},{\"id\":-219353309,\"predicate\":\"chatAdminWithInvites\",\"params\":[{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"invites_count\",\"type\":\"int\"},{\"name\":\"revoked_invites_count\",\"type\":\"int\"}],\"type\":\"ChatAdminWithInvites\"},{\"id\":-1231326505,\"predicate\":\"messages.chatAdminsWithInvites\",\"params\":[{\"name\":\"admins\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.ChatAdminsWithInvites\"},{\"id\":1557846647,\"predicate\":\"channelAdminLogEventActionParticipantJoinByInvite\",\"params\":[{\"name\":\"invite\",\"type\":\"ExportedChatInvite\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1515256996,\"predicate\":\"channelAdminLogEventActionExportedInviteDelete\",\"params\":[{\"name\":\"invite\",\"type\":\"ExportedChatInvite\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1091179342,\"predicate\":\"channelAdminLogEventActionExportedInviteRevoke\",\"params\":[{\"name\":\"invite\",\"type\":\"ExportedChatInvite\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-384910503,\"predicate\":\"channelAdminLogEventActionExportedInviteEdit\",\"params\":[{\"name\":\"prev_invite\",\"type\":\"ExportedChatInvite\"},{\"name\":\"new_invite\",\"type\":\"ExportedChatInvite\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1048537159,\"predicate\":\"channelAdminLogEventActionParticipantVolume\",\"params\":[{\"name\":\"participant\",\"type\":\"GroupCallParticipant\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1855199800,\"predicate\":\"channelAdminLogEventActionChangeHistoryTTL\",\"params\":[{\"name\":\"prev_value\",\"type\":\"int\"},{\"name\":\"new_value\",\"type\":\"int\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-1571952873,\"predicate\":\"messages.checkedHistoryImportPeer\",\"params\":[{\"name\":\"confirm_text\",\"type\":\"string\"}],\"type\":\"messages.CheckedHistoryImportPeer\"},{\"id\":93890858,\"predicate\":\"inputGroupCallStream\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"time_ms\",\"type\":\"long\"},{\"name\":\"scale\",\"type\":\"int\"},{\"name\":\"video_channel\",\"type\":\"flags.0?int\"},{\"name\":\"video_quality\",\"type\":\"flags.0?int\"}],\"type\":\"InputFileLocation\"},{\"id\":-1343921601,\"predicate\":\"phone.joinAsPeers\",\"params\":[{\"name\":\"peers\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"phone.JoinAsPeers\"},{\"id\":541839704,\"predicate\":\"phone.exportedGroupCallInvite\",\"params\":[{\"name\":\"link\",\"type\":\"string\"}],\"type\":\"phone.ExportedGroupCallInvite\"},{\"id\":-672693723,\"predicate\":\"inputBotInlineMessageMediaInvoice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.0?InputWebDocument\"},{\"name\":\"invoice\",\"type\":\"Invoice\"},{\"name\":\"payload\",\"type\":\"bytes\"},{\"name\":\"provider\",\"type\":\"string\"},{\"name\":\"provider_data\",\"type\":\"DataJSON\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":894081801,\"predicate\":\"botInlineMessageMediaInvoice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"shipping_address_requested\",\"type\":\"flags.1?true\"},{\"name\":\"test\",\"type\":\"flags.3?true\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.0?WebDocument\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"total_amount\",\"type\":\"long\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"BotInlineMessage\"},{\"id\":-1281329567,\"predicate\":\"messageActionGroupCallScheduled\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"schedule_date\",\"type\":\"int\"}],\"type\":\"MessageAction\"},{\"id\":-592373577,\"predicate\":\"groupCallParticipantVideoSourceGroup\",\"params\":[{\"name\":\"semantics\",\"type\":\"string\"},{\"name\":\"sources\",\"type\":\"Vector\"}],\"type\":\"GroupCallParticipantVideoSourceGroup\"},{\"id\":1735736008,\"predicate\":\"groupCallParticipantVideo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"paused\",\"type\":\"flags.0?true\"},{\"name\":\"endpoint\",\"type\":\"string\"},{\"name\":\"source_groups\",\"type\":\"Vector\"},{\"name\":\"audio_source\",\"type\":\"flags.1?int\"}],\"type\":\"GroupCallParticipantVideo\"},{\"id\":192428418,\"predicate\":\"updateGroupCallConnection\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"presentation\",\"type\":\"flags.0?true\"},{\"name\":\"params\",\"type\":\"DataJSON\"}],\"type\":\"Update\"},{\"id\":-2046910401,\"predicate\":\"stickers.suggestedShortName\",\"params\":[{\"name\":\"short_name\",\"type\":\"string\"}],\"type\":\"stickers.SuggestedShortName\"},{\"id\":795652779,\"predicate\":\"botCommandScopeDefault\",\"params\":[],\"type\":\"BotCommandScope\"},{\"id\":1011811544,\"predicate\":\"botCommandScopeUsers\",\"params\":[],\"type\":\"BotCommandScope\"},{\"id\":1877059713,\"predicate\":\"botCommandScopeChats\",\"params\":[],\"type\":\"BotCommandScope\"},{\"id\":-1180016534,\"predicate\":\"botCommandScopeChatAdmins\",\"params\":[],\"type\":\"BotCommandScope\"},{\"id\":-610432643,\"predicate\":\"botCommandScopePeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"BotCommandScope\"},{\"id\":1071145937,\"predicate\":\"botCommandScopePeerAdmins\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"BotCommandScope\"},{\"id\":169026035,\"predicate\":\"botCommandScopePeerUser\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"BotCommandScope\"},{\"id\":-478701471,\"predicate\":\"account.resetPasswordFailedWait\",\"params\":[{\"name\":\"retry_date\",\"type\":\"int\"}],\"type\":\"account.ResetPasswordResult\"},{\"id\":-370148227,\"predicate\":\"account.resetPasswordRequestedWait\",\"params\":[{\"name\":\"until_date\",\"type\":\"int\"}],\"type\":\"account.ResetPasswordResult\"},{\"id\":-383330754,\"predicate\":\"account.resetPasswordOk\",\"params\":[],\"type\":\"account.ResetPasswordResult\"},{\"id\":1299263278,\"predicate\":\"updateBotCommands\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"bot_id\",\"type\":\"long\"},{\"name\":\"commands\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":-1434950843,\"predicate\":\"messageActionSetChatTheme\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":-1336228175,\"predicate\":\"sendMessageChooseStickerAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":981691896,\"predicate\":\"sponsoredMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"recommended\",\"type\":\"flags.5?true\"},{\"name\":\"show_peer_photo\",\"type\":\"flags.6?true\"},{\"name\":\"random_id\",\"type\":\"bytes\"},{\"name\":\"from_id\",\"type\":\"flags.3?Peer\"},{\"name\":\"chat_invite\",\"type\":\"flags.4?ChatInvite\"},{\"name\":\"chat_invite_hash\",\"type\":\"flags.4?string\"},{\"name\":\"channel_post\",\"type\":\"flags.2?int\"},{\"name\":\"start_param\",\"type\":\"flags.0?string\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.1?Vector\"}],\"type\":\"SponsoredMessage\"},{\"id\":-907141753,\"predicate\":\"messages.sponsoredMessages\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"posts_between\",\"type\":\"flags.0?int\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.SponsoredMessages\"},{\"id\":215889721,\"predicate\":\"inputStickerSetAnimatedEmojiAnimations\",\"params\":[],\"type\":\"InputStickerSet\"},{\"id\":630664139,\"predicate\":\"sendMessageEmojiInteraction\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"interaction\",\"type\":\"DataJSON\"}],\"type\":\"SendMessageAction\"},{\"id\":-1234857938,\"predicate\":\"sendMessageEmojiInteractionSeen\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"}],\"type\":\"SendMessageAction\"},{\"id\":-1227287081,\"predicate\":\"inputBotInlineMessageID64\",\"params\":[{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"owner_id\",\"type\":\"long\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputBotInlineMessageID\"},{\"id\":-911191137,\"predicate\":\"searchResultsCalendarPeriod\",\"params\":[{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"min_msg_id\",\"type\":\"int\"},{\"name\":\"max_msg_id\",\"type\":\"int\"},{\"name\":\"count\",\"type\":\"int\"}],\"type\":\"SearchResultsCalendarPeriod\"},{\"id\":343859772,\"predicate\":\"messages.searchResultsCalendar\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"inexact\",\"type\":\"flags.0?true\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"min_date\",\"type\":\"int\"},{\"name\":\"min_msg_id\",\"type\":\"int\"},{\"name\":\"offset_id_offset\",\"type\":\"flags.1?int\"},{\"name\":\"periods\",\"type\":\"Vector\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.SearchResultsCalendar\"},{\"id\":2137295719,\"predicate\":\"searchResultPosition\",\"params\":[{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"offset\",\"type\":\"int\"}],\"type\":\"SearchResultsPosition\"},{\"id\":1404185519,\"predicate\":\"messages.searchResultsPositions\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"positions\",\"type\":\"Vector\"}],\"type\":\"messages.SearchResultsPositions\"},{\"id\":-339958837,\"predicate\":\"messageActionChatJoinedByRequest\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":1885586395,\"predicate\":\"updatePendingJoinRequests\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"requests_pending\",\"type\":\"int\"},{\"name\":\"recent_requesters\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":299870598,\"predicate\":\"updateBotChatInviteRequester\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"about\",\"type\":\"string\"},{\"name\":\"invite\",\"type\":\"ExportedChatInvite\"},{\"name\":\"qts\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1347021750,\"predicate\":\"channelAdminLogEventActionParticipantJoinByRequest\",\"params\":[{\"name\":\"invite\",\"type\":\"ExportedChatInvite\"},{\"name\":\"approved_by\",\"type\":\"long\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-376962181,\"predicate\":\"inputKeyboardButtonUserProfile\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"KeyboardButton\"},{\"id\":814112961,\"predicate\":\"keyboardButtonUserProfile\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"KeyboardButton\"},{\"id\":-191450938,\"predicate\":\"channels.sendAsPeers\",\"params\":[{\"name\":\"peers\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"channels.SendAsPeers\"},{\"id\":-886388890,\"predicate\":\"channelAdminLogEventActionToggleNoForwards\",\"params\":[{\"name\":\"new_value\",\"type\":\"Bool\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-738646805,\"predicate\":\"messages.stickerSetNotModified\",\"params\":[],\"type\":\"messages.StickerSet\"},{\"id\":997004590,\"predicate\":\"users.userFull\",\"params\":[{\"name\":\"full_user\",\"type\":\"UserFull\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"users.UserFull\"},{\"id\":1753266509,\"predicate\":\"messages.peerSettings\",\"params\":[{\"name\":\"settings\",\"type\":\"PeerSettings\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.PeerSettings\"},{\"id\":663693416,\"predicate\":\"channelAdminLogEventActionSendMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-702884114,\"predicate\":\"auth.codeTypeMissedCall\",\"params\":[],\"type\":\"auth.CodeType\"},{\"id\":-2113903484,\"predicate\":\"auth.sentCodeTypeMissedCall\",\"params\":[{\"name\":\"prefix\",\"type\":\"string\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"auth.SentCodeType\"},{\"id\":-1012759713,\"predicate\":\"auth.loggedOut\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"future_auth_token\",\"type\":\"flags.0?bytes\"}],\"type\":\"auth.LoggedOut\"},{\"id\":1578843320,\"predicate\":\"updateMessageReactions\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"reactions\",\"type\":\"MessageReactions\"}],\"type\":\"Update\"},{\"id\":-1546531968,\"predicate\":\"reactionCount\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"chosen_order\",\"type\":\"flags.0?int\"},{\"name\":\"reaction\",\"type\":\"Reaction\"},{\"name\":\"count\",\"type\":\"int\"}],\"type\":\"ReactionCount\"},{\"id\":1328256121,\"predicate\":\"messageReactions\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"min\",\"type\":\"flags.0?true\"},{\"name\":\"can_see_list\",\"type\":\"flags.2?true\"},{\"name\":\"results\",\"type\":\"Vector\"},{\"name\":\"recent_reactions\",\"type\":\"flags.1?Vector\"}],\"type\":\"MessageReactions\"},{\"id\":834488621,\"predicate\":\"messages.messageReactionsList\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"reactions\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"next_offset\",\"type\":\"flags.0?string\"}],\"type\":\"messages.MessageReactionsList\"},{\"id\":-1065882623,\"predicate\":\"availableReaction\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"inactive\",\"type\":\"flags.0?true\"},{\"name\":\"premium\",\"type\":\"flags.2?true\"},{\"name\":\"reaction\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"static_icon\",\"type\":\"Document\"},{\"name\":\"appear_animation\",\"type\":\"Document\"},{\"name\":\"select_animation\",\"type\":\"Document\"},{\"name\":\"activate_animation\",\"type\":\"Document\"},{\"name\":\"effect_animation\",\"type\":\"Document\"},{\"name\":\"around_animation\",\"type\":\"flags.1?Document\"},{\"name\":\"center_icon\",\"type\":\"flags.1?Document\"}],\"type\":\"AvailableReaction\"},{\"id\":-1626924713,\"predicate\":\"messages.availableReactionsNotModified\",\"params\":[],\"type\":\"messages.AvailableReactions\"},{\"id\":1989032621,\"predicate\":\"messages.availableReactions\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"reactions\",\"type\":\"Vector\"}],\"type\":\"messages.AvailableReactions\"},{\"id\":852137487,\"predicate\":\"messageEntitySpoiler\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":-1102180616,\"predicate\":\"channelAdminLogEventActionChangeAvailableReactions\",\"params\":[{\"name\":\"prev_value\",\"type\":\"ChatReactions\"},{\"name\":\"new_value\",\"type\":\"ChatReactions\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-1319698788,\"predicate\":\"messagePeerReaction\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"big\",\"type\":\"flags.0?true\"},{\"name\":\"unread\",\"type\":\"flags.1?true\"},{\"name\":\"peer_id\",\"type\":\"Peer\"},{\"name\":\"reaction\",\"type\":\"Reaction\"}],\"type\":\"MessagePeerReaction\"},{\"id\":-2132064081,\"predicate\":\"groupCallStreamChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"int\"},{\"name\":\"scale\",\"type\":\"int\"},{\"name\":\"last_timestamp_ms\",\"type\":\"long\"}],\"type\":\"GroupCallStreamChannel\"},{\"id\":-790330702,\"predicate\":\"phone.groupCallStreamChannels\",\"params\":[{\"name\":\"channels\",\"type\":\"Vector\"}],\"type\":\"phone.GroupCallStreamChannels\"},{\"id\":177124030,\"predicate\":\"inputReportReasonIllegalDrugs\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":-1631091139,\"predicate\":\"inputReportReasonPersonalDetails\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":767505458,\"predicate\":\"phone.groupCallStreamRtmpUrl\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"key\",\"type\":\"string\"}],\"type\":\"phone.GroupCallStreamRtmpUrl\"},{\"id\":1165423600,\"predicate\":\"attachMenuBotIconColor\",\"params\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"color\",\"type\":\"int\"}],\"type\":\"AttachMenuBotIconColor\"},{\"id\":-1297663893,\"predicate\":\"attachMenuBotIcon\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"icon\",\"type\":\"Document\"},{\"name\":\"colors\",\"type\":\"flags.0?Vector\"}],\"type\":\"AttachMenuBotIcon\"},{\"id\":-928371502,\"predicate\":\"attachMenuBot\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"inactive\",\"type\":\"flags.0?true\"},{\"name\":\"has_settings\",\"type\":\"flags.1?true\"},{\"name\":\"request_write_access\",\"type\":\"flags.2?true\"},{\"name\":\"bot_id\",\"type\":\"long\"},{\"name\":\"short_name\",\"type\":\"string\"},{\"name\":\"peer_types\",\"type\":\"Vector\"},{\"name\":\"icons\",\"type\":\"Vector\"}],\"type\":\"AttachMenuBot\"},{\"id\":-237467044,\"predicate\":\"attachMenuBotsNotModified\",\"params\":[],\"type\":\"AttachMenuBots\"},{\"id\":1011024320,\"predicate\":\"attachMenuBots\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"bots\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"AttachMenuBots\"},{\"id\":-1816172929,\"predicate\":\"attachMenuBotsBot\",\"params\":[{\"name\":\"bot\",\"type\":\"AttachMenuBot\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"AttachMenuBotsBot\"},{\"id\":397910539,\"predicate\":\"updateAttachMenuBots\",\"params\":[],\"type\":\"Update\"},{\"id\":202659196,\"predicate\":\"webViewResultUrl\",\"params\":[{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"WebViewResult\"},{\"id\":-2010155333,\"predicate\":\"simpleWebViewResultUrl\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"SimpleWebViewResult\"},{\"id\":211046684,\"predicate\":\"webViewMessageSent\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"msg_id\",\"type\":\"flags.0?InputBotInlineMessageID\"}],\"type\":\"WebViewMessageSent\"},{\"id\":361936797,\"predicate\":\"updateWebViewResultSent\",\"params\":[{\"name\":\"query_id\",\"type\":\"long\"}],\"type\":\"Update\"},{\"id\":326529584,\"predicate\":\"keyboardButtonWebView\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":-1598009252,\"predicate\":\"keyboardButtonSimpleWebView\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":1205698681,\"predicate\":\"messageActionWebViewDataSentMe\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"data\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":-1262252875,\"predicate\":\"messageActionWebViewDataSent\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":347625491,\"predicate\":\"updateBotMenuButton\",\"params\":[{\"name\":\"bot_id\",\"type\":\"long\"},{\"name\":\"button\",\"type\":\"BotMenuButton\"}],\"type\":\"Update\"},{\"id\":1966318984,\"predicate\":\"botMenuButtonDefault\",\"params\":[],\"type\":\"BotMenuButton\"},{\"id\":1113113093,\"predicate\":\"botMenuButtonCommands\",\"params\":[],\"type\":\"BotMenuButton\"},{\"id\":-944407322,\"predicate\":\"botMenuButton\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"BotMenuButton\"},{\"id\":-67704655,\"predicate\":\"account.savedRingtonesNotModified\",\"params\":[],\"type\":\"account.SavedRingtones\"},{\"id\":-1041683259,\"predicate\":\"account.savedRingtones\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"ringtones\",\"type\":\"Vector\"}],\"type\":\"account.SavedRingtones\"},{\"id\":1960361625,\"predicate\":\"updateSavedRingtones\",\"params\":[],\"type\":\"Update\"},{\"id\":-1746354498,\"predicate\":\"notificationSoundDefault\",\"params\":[],\"type\":\"NotificationSound\"},{\"id\":1863070943,\"predicate\":\"notificationSoundNone\",\"params\":[],\"type\":\"NotificationSound\"},{\"id\":-2096391452,\"predicate\":\"notificationSoundLocal\",\"params\":[{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"data\",\"type\":\"string\"}],\"type\":\"NotificationSound\"},{\"id\":-9666487,\"predicate\":\"notificationSoundRingtone\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"NotificationSound\"},{\"id\":-1222230163,\"predicate\":\"account.savedRingtone\",\"params\":[],\"type\":\"account.SavedRingtone\"},{\"id\":523271863,\"predicate\":\"account.savedRingtoneConverted\",\"params\":[{\"name\":\"document\",\"type\":\"Document\"}],\"type\":\"account.SavedRingtone\"},{\"id\":2104224014,\"predicate\":\"attachMenuPeerTypeSameBotPM\",\"params\":[],\"type\":\"AttachMenuPeerType\"},{\"id\":-1020528102,\"predicate\":\"attachMenuPeerTypeBotPM\",\"params\":[],\"type\":\"AttachMenuPeerType\"},{\"id\":-247016673,\"predicate\":\"attachMenuPeerTypePM\",\"params\":[],\"type\":\"AttachMenuPeerType\"},{\"id\":84480319,\"predicate\":\"attachMenuPeerTypeChat\",\"params\":[],\"type\":\"AttachMenuPeerType\"},{\"id\":2080104188,\"predicate\":\"attachMenuPeerTypeBroadcast\",\"params\":[],\"type\":\"AttachMenuPeerType\"},{\"id\":-317687113,\"predicate\":\"chatInvitePublicJoinRequests\",\"params\":[],\"type\":\"ExportedChatInvite\"},{\"id\":-977967015,\"predicate\":\"inputInvoiceMessage\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"InputInvoice\"},{\"id\":-1020867857,\"predicate\":\"inputInvoiceSlug\",\"params\":[{\"name\":\"slug\",\"type\":\"string\"}],\"type\":\"InputInvoice\"},{\"id\":-1362048039,\"predicate\":\"payments.exportedInvoice\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"payments.ExportedInvoice\"},{\"id\":8703322,\"predicate\":\"updateTranscribedAudio\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pending\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"transcription_id\",\"type\":\"long\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"Update\"},{\"id\":-1821037486,\"predicate\":\"messages.transcribedAudio\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pending\",\"type\":\"flags.0?true\"},{\"name\":\"transcription_id\",\"type\":\"long\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"messages.TranscribedAudio\"},{\"id\":909284270,\"predicate\":\"dialogFilterDefault\",\"params\":[],\"type\":\"DialogFilter\"},{\"id\":1395946908,\"predicate\":\"help.premiumPromo\",\"params\":[{\"name\":\"status_text\",\"type\":\"string\"},{\"name\":\"status_entities\",\"type\":\"Vector\"},{\"name\":\"video_sections\",\"type\":\"Vector\"},{\"name\":\"videos\",\"type\":\"Vector\"},{\"name\":\"period_options\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"help.PremiumPromo\"},{\"id\":-925956616,\"predicate\":\"messageEntityCustomEmoji\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"},{\"name\":\"document_id\",\"type\":\"long\"}],\"type\":\"MessageEntity\"},{\"id\":-48981863,\"predicate\":\"documentAttributeCustomEmoji\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"free\",\"type\":\"flags.0?true\"},{\"name\":\"text_color\",\"type\":\"flags.1?true\"},{\"name\":\"alt\",\"type\":\"string\"},{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"}],\"type\":\"DocumentAttribute\"},{\"id\":1087454222,\"predicate\":\"stickerSetFullCovered\",\"params\":[{\"name\":\"set\",\"type\":\"StickerSet\"},{\"name\":\"packs\",\"type\":\"Vector\"},{\"name\":\"keywords\",\"type\":\"Vector\"},{\"name\":\"documents\",\"type\":\"Vector\"}],\"type\":\"StickerSetCovered\"},{\"id\":-1502273946,\"predicate\":\"inputStorePaymentPremiumSubscription\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"restore\",\"type\":\"flags.0?true\"},{\"name\":\"upgrade\",\"type\":\"flags.1?true\"}],\"type\":\"InputStorePaymentPurpose\"},{\"id\":1634697192,\"predicate\":\"inputStorePaymentGiftPremium\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"amount\",\"type\":\"long\"}],\"type\":\"InputStorePaymentPurpose\"},{\"id\":-1415514682,\"predicate\":\"messageActionGiftPremium\",\"params\":[{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"amount\",\"type\":\"long\"},{\"name\":\"months\",\"type\":\"int\"}],\"type\":\"MessageAction\"},{\"id\":1958953753,\"predicate\":\"premiumGiftOption\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"months\",\"type\":\"int\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"amount\",\"type\":\"long\"},{\"name\":\"bot_url\",\"type\":\"string\"},{\"name\":\"store_product\",\"type\":\"flags.0?string\"}],\"type\":\"PremiumGiftOption\"},{\"id\":-930399486,\"predicate\":\"inputStickerSetPremiumGifts\",\"params\":[],\"type\":\"InputStickerSet\"},{\"id\":-78886548,\"predicate\":\"updateReadFeaturedEmojiStickers\",\"params\":[],\"type\":\"Update\"},{\"id\":-1360618136,\"predicate\":\"inputPrivacyKeyVoiceMessages\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":110621716,\"predicate\":\"privacyKeyVoiceMessages\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":-1996951013,\"predicate\":\"paymentFormMethod\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"PaymentFormMethod\"},{\"id\":-193992412,\"predicate\":\"inputWebFileAudioAlbumThumbLocation\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"small\",\"type\":\"flags.2?true\"},{\"name\":\"document\",\"type\":\"flags.0?InputDocument\"},{\"name\":\"title\",\"type\":\"flags.1?string\"},{\"name\":\"performer\",\"type\":\"flags.1?string\"}],\"type\":\"InputWebFileLocation\"},{\"id\":183518013,\"predicate\":\"bots.premiumGiftsOptions\",\"params\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"gifts\",\"type\":\"Vector\"}],\"type\":\"bots.PremiumGiftsOptions\"},{\"id\":769727150,\"predicate\":\"emojiStatusEmpty\",\"params\":[],\"type\":\"EmojiStatus\"},{\"id\":-1835310691,\"predicate\":\"emojiStatus\",\"params\":[{\"name\":\"document_id\",\"type\":\"long\"}],\"type\":\"EmojiStatus\"},{\"id\":-97474361,\"predicate\":\"emojiStatusUntil\",\"params\":[{\"name\":\"document_id\",\"type\":\"long\"},{\"name\":\"until\",\"type\":\"int\"}],\"type\":\"EmojiStatus\"},{\"id\":674706841,\"predicate\":\"updateUserEmojiStatus\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"emoji_status\",\"type\":\"EmojiStatus\"}],\"type\":\"Update\"},{\"id\":821314523,\"predicate\":\"updateRecentEmojiStatuses\",\"params\":[],\"type\":\"Update\"},{\"id\":-796072379,\"predicate\":\"account.emojiStatusesNotModified\",\"params\":[],\"type\":\"account.EmojiStatuses\"},{\"id\":-1866176559,\"predicate\":\"account.emojiStatuses\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"statuses\",\"type\":\"Vector\"}],\"type\":\"account.EmojiStatuses\"},{\"id\":2046153753,\"predicate\":\"reactionEmpty\",\"params\":[],\"type\":\"Reaction\"},{\"id\":455247544,\"predicate\":\"reactionEmoji\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"}],\"type\":\"Reaction\"},{\"id\":-1992950669,\"predicate\":\"reactionCustomEmoji\",\"params\":[{\"name\":\"document_id\",\"type\":\"long\"}],\"type\":\"Reaction\"},{\"id\":-352570692,\"predicate\":\"chatReactionsNone\",\"params\":[],\"type\":\"ChatReactions\"},{\"id\":1385335754,\"predicate\":\"chatReactionsAll\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"allow_custom\",\"type\":\"flags.0?true\"}],\"type\":\"ChatReactions\"},{\"id\":1713193015,\"predicate\":\"chatReactionsSome\",\"params\":[{\"name\":\"reactions\",\"type\":\"Vector\"}],\"type\":\"ChatReactions\"},{\"id\":-1334846497,\"predicate\":\"messages.reactionsNotModified\",\"params\":[],\"type\":\"messages.Reactions\"},{\"id\":-352454890,\"predicate\":\"messages.reactions\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"reactions\",\"type\":\"Vector\"}],\"type\":\"messages.Reactions\"},{\"id\":1870160884,\"predicate\":\"updateRecentReactions\",\"params\":[],\"type\":\"Update\"},{\"id\":-2030252155,\"predicate\":\"updateMoveStickerSetToTop\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"masks\",\"type\":\"flags.0?true\"},{\"name\":\"emojis\",\"type\":\"flags.1?true\"},{\"name\":\"stickerset\",\"type\":\"long\"}],\"type\":\"Update\"},{\"id\":1511364673,\"predicate\":\"auth.sentCodeTypeEmailCode\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"apple_signin_allowed\",\"type\":\"flags.0?true\"},{\"name\":\"google_signin_allowed\",\"type\":\"flags.1?true\"},{\"name\":\"email_pattern\",\"type\":\"string\"},{\"name\":\"length\",\"type\":\"int\"},{\"name\":\"next_phone_login_date\",\"type\":\"flags.2?int\"}],\"type\":\"auth.SentCodeType\"},{\"id\":-1521934870,\"predicate\":\"auth.sentCodeTypeSetUpEmailRequired\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"apple_signin_allowed\",\"type\":\"flags.0?true\"},{\"name\":\"google_signin_allowed\",\"type\":\"flags.1?true\"}],\"type\":\"auth.SentCodeType\"},{\"id\":1128644211,\"predicate\":\"emailVerifyPurposeLoginSetup\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"}],\"type\":\"EmailVerifyPurpose\"},{\"id\":1383932651,\"predicate\":\"emailVerifyPurposeLoginChange\",\"params\":[],\"type\":\"EmailVerifyPurpose\"},{\"id\":-1141565819,\"predicate\":\"emailVerifyPurposePassport\",\"params\":[],\"type\":\"EmailVerifyPurpose\"},{\"id\":-1842457175,\"predicate\":\"emailVerificationCode\",\"params\":[{\"name\":\"code\",\"type\":\"string\"}],\"type\":\"EmailVerification\"},{\"id\":-611279166,\"predicate\":\"emailVerificationGoogle\",\"params\":[{\"name\":\"token\",\"type\":\"string\"}],\"type\":\"EmailVerification\"},{\"id\":-1764723459,\"predicate\":\"emailVerificationApple\",\"params\":[{\"name\":\"token\",\"type\":\"string\"}],\"type\":\"EmailVerification\"},{\"id\":731303195,\"predicate\":\"account.emailVerified\",\"params\":[{\"name\":\"email\",\"type\":\"string\"}],\"type\":\"account.EmailVerified\"},{\"id\":-507835039,\"predicate\":\"account.emailVerifiedLogin\",\"params\":[{\"name\":\"email\",\"type\":\"string\"},{\"name\":\"sent_code\",\"type\":\"auth.SentCode\"}],\"type\":\"account.EmailVerified\"},{\"id\":1596792306,\"predicate\":\"premiumSubscriptionOption\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"current\",\"type\":\"flags.1?true\"},{\"name\":\"can_purchase_upgrade\",\"type\":\"flags.2?true\"},{\"name\":\"transaction\",\"type\":\"flags.3?string\"},{\"name\":\"months\",\"type\":\"int\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"amount\",\"type\":\"long\"},{\"name\":\"bot_url\",\"type\":\"string\"},{\"name\":\"store_product\",\"type\":\"flags.0?string\"}],\"type\":\"PremiumSubscriptionOption\"},{\"id\":80008398,\"predicate\":\"inputStickerSetEmojiGenericAnimations\",\"params\":[],\"type\":\"InputStickerSet\"},{\"id\":701560302,\"predicate\":\"inputStickerSetEmojiDefaultStatuses\",\"params\":[],\"type\":\"InputStickerSet\"},{\"id\":-1206095820,\"predicate\":\"sendAsPeer\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"premium_required\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"Peer\"}],\"type\":\"SendAsPeer\"},{\"id\":-1386050360,\"predicate\":\"messageExtendedMediaPreview\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"w\",\"type\":\"flags.0?int\"},{\"name\":\"h\",\"type\":\"flags.0?int\"},{\"name\":\"thumb\",\"type\":\"flags.1?PhotoSize\"},{\"name\":\"video_duration\",\"type\":\"flags.2?int\"}],\"type\":\"MessageExtendedMedia\"},{\"id\":-297296796,\"predicate\":\"messageExtendedMedia\",\"params\":[{\"name\":\"media\",\"type\":\"MessageMedia\"}],\"type\":\"MessageExtendedMedia\"},{\"id\":1517529484,\"predicate\":\"updateMessageExtendedMedia\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"extended_media\",\"type\":\"MessageExtendedMedia\"}],\"type\":\"Update\"},{\"id\":-50416996,\"predicate\":\"stickerKeyword\",\"params\":[{\"name\":\"document_id\",\"type\":\"long\"},{\"name\":\"keyword\",\"type\":\"Vector\"}],\"type\":\"StickerKeyword\"},{\"id\":-1274595769,\"predicate\":\"username\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"editable\",\"type\":\"flags.0?true\"},{\"name\":\"active\",\"type\":\"flags.1?true\"},{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"Username\"},{\"id\":-263212119,\"predicate\":\"channelAdminLogEventActionChangeUsernames\",\"params\":[{\"name\":\"prev_value\",\"type\":\"Vector\"},{\"name\":\"new_value\",\"type\":\"Vector\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":46949251,\"predicate\":\"channelAdminLogEventActionToggleForum\",\"params\":[{\"name\":\"new_value\",\"type\":\"Bool\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1483767080,\"predicate\":\"channelAdminLogEventActionCreateTopic\",\"params\":[{\"name\":\"topic\",\"type\":\"ForumTopic\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-261103096,\"predicate\":\"channelAdminLogEventActionEditTopic\",\"params\":[{\"name\":\"prev_topic\",\"type\":\"ForumTopic\"},{\"name\":\"new_topic\",\"type\":\"ForumTopic\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-1374254839,\"predicate\":\"channelAdminLogEventActionDeleteTopic\",\"params\":[{\"name\":\"topic\",\"type\":\"ForumTopic\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1569535291,\"predicate\":\"channelAdminLogEventActionPinTopic\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"prev_topic\",\"type\":\"flags.0?ForumTopic\"},{\"name\":\"new_topic\",\"type\":\"flags.1?ForumTopic\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":37687451,\"predicate\":\"forumTopicDeleted\",\"params\":[{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"ForumTopic\"},{\"id\":1903173033,\"predicate\":\"forumTopic\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"my\",\"type\":\"flags.1?true\"},{\"name\":\"closed\",\"type\":\"flags.2?true\"},{\"name\":\"pinned\",\"type\":\"flags.3?true\"},{\"name\":\"short\",\"type\":\"flags.5?true\"},{\"name\":\"hidden\",\"type\":\"flags.6?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"icon_color\",\"type\":\"int\"},{\"name\":\"icon_emoji_id\",\"type\":\"flags.0?long\"},{\"name\":\"top_message\",\"type\":\"int\"},{\"name\":\"read_inbox_max_id\",\"type\":\"int\"},{\"name\":\"read_outbox_max_id\",\"type\":\"int\"},{\"name\":\"unread_count\",\"type\":\"int\"},{\"name\":\"unread_mentions_count\",\"type\":\"int\"},{\"name\":\"unread_reactions_count\",\"type\":\"int\"},{\"name\":\"from_id\",\"type\":\"Peer\"},{\"name\":\"notify_settings\",\"type\":\"PeerNotifySettings\"},{\"name\":\"draft\",\"type\":\"flags.4?DraftMessage\"}],\"type\":\"ForumTopic\"},{\"id\":913709011,\"predicate\":\"messages.forumTopics\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"order_by_create_date\",\"type\":\"flags.0?true\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"topics\",\"type\":\"Vector\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"}],\"type\":\"messages.ForumTopics\"},{\"id\":228168278,\"predicate\":\"messageActionTopicCreate\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"icon_color\",\"type\":\"int\"},{\"name\":\"icon_emoji_id\",\"type\":\"flags.0?long\"}],\"type\":\"MessageAction\"},{\"id\":-1064024032,\"predicate\":\"messageActionTopicEdit\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"title\",\"type\":\"flags.0?string\"},{\"name\":\"icon_emoji_id\",\"type\":\"flags.1?long\"},{\"name\":\"closed\",\"type\":\"flags.2?Bool\"},{\"name\":\"hidden\",\"type\":\"flags.3?Bool\"}],\"type\":\"MessageAction\"},{\"id\":422509539,\"predicate\":\"updateChannelPinnedTopic\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.0?true\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"topic_id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":1548122514,\"predicate\":\"inputNotifyForumTopic\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"int\"}],\"type\":\"InputNotifyPeer\"},{\"id\":577659656,\"predicate\":\"notifyForumTopic\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"top_msg_id\",\"type\":\"int\"}],\"type\":\"NotifyPeer\"},{\"id\":1153562857,\"predicate\":\"inputStickerSetEmojiDefaultTopicIcons\",\"params\":[],\"type\":\"InputStickerSet\"},{\"id\":406407439,\"predicate\":\"messages.sponsoredMessagesEmpty\",\"params\":[],\"type\":\"messages.SponsoredMessages\"},{\"id\":-31881726,\"predicate\":\"updateChannelPinnedTopics\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"order\",\"type\":\"flags.0?Vector\"}],\"type\":\"Update\"},{\"id\":1135897376,\"predicate\":\"defaultHistoryTTL\",\"params\":[{\"name\":\"period\",\"type\":\"int\"}],\"type\":\"DefaultHistoryTTL\"},{\"id\":116234636,\"predicate\":\"auth.codeTypeFragmentSms\",\"params\":[],\"type\":\"auth.CodeType\"},{\"id\":-648651719,\"predicate\":\"auth.sentCodeTypeFragmentSms\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"auth.SentCodeType\"},{\"id\":1103040667,\"predicate\":\"exportedContactToken\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"expires\",\"type\":\"int\"}],\"type\":\"ExportedContactToken\"},{\"id\":1693675004,\"predicate\":\"channelAdminLogEventActionToggleAntiSpam\",\"params\":[{\"name\":\"new_value\",\"type\":\"Bool\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1474192222,\"predicate\":\"messageActionSuggestProfilePhoto\",\"params\":[{\"name\":\"photo\",\"type\":\"Photo\"}],\"type\":\"MessageAction\"},{\"id\":-404267113,\"predicate\":\"messageActionAttachMenuBotAllowed\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":2008112412,\"predicate\":\"stickerSetNoCovered\",\"params\":[{\"name\":\"set\",\"type\":\"StickerSet\"}],\"type\":\"StickerSetCovered\"},{\"id\":542282808,\"predicate\":\"updateUser\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"Update\"},{\"id\":596704836,\"predicate\":\"auth.sentCodeSuccess\",\"params\":[{\"name\":\"authorization\",\"type\":\"auth.Authorization\"}],\"type\":\"auth.SentCode\"},{\"id\":-25742243,\"predicate\":\"messageActionRequestedPeer\",\"params\":[{\"name\":\"button_id\",\"type\":\"int\"},{\"name\":\"peer\",\"type\":\"Peer\"}],\"type\":\"MessageAction\"},{\"id\":1597737472,\"predicate\":\"requestPeerTypeUser\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"bot\",\"type\":\"flags.0?Bool\"},{\"name\":\"premium\",\"type\":\"flags.1?Bool\"}],\"type\":\"RequestPeerType\"},{\"id\":-906990053,\"predicate\":\"requestPeerTypeChat\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"creator\",\"type\":\"flags.0?true\"},{\"name\":\"bot_participant\",\"type\":\"flags.5?true\"},{\"name\":\"has_username\",\"type\":\"flags.3?Bool\"},{\"name\":\"forum\",\"type\":\"flags.4?Bool\"},{\"name\":\"user_admin_rights\",\"type\":\"flags.1?ChatAdminRights\"},{\"name\":\"bot_admin_rights\",\"type\":\"flags.2?ChatAdminRights\"}],\"type\":\"RequestPeerType\"},{\"id\":865857388,\"predicate\":\"requestPeerTypeBroadcast\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"creator\",\"type\":\"flags.0?true\"},{\"name\":\"has_username\",\"type\":\"flags.3?Bool\"},{\"name\":\"user_admin_rights\",\"type\":\"flags.1?ChatAdminRights\"},{\"name\":\"bot_admin_rights\",\"type\":\"flags.2?ChatAdminRights\"}],\"type\":\"RequestPeerType\"},{\"id\":218842764,\"predicate\":\"keyboardButtonRequestPeer\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"button_id\",\"type\":\"int\"},{\"name\":\"peer_type\",\"type\":\"RequestPeerType\"}],\"type\":\"KeyboardButton\"},{\"id\":1209970170,\"predicate\":\"emojiListNotModified\",\"params\":[],\"type\":\"EmojiList\"},{\"id\":2048790993,\"predicate\":\"emojiList\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"document_id\",\"type\":\"Vector\"}],\"type\":\"EmojiList\"},{\"id\":-444918734,\"predicate\":\"auth.sentCodeTypeFirebaseSms\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"nonce\",\"type\":\"flags.0?bytes\"},{\"name\":\"receipt\",\"type\":\"flags.1?string\"},{\"name\":\"push_timeout\",\"type\":\"flags.1?int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"auth.SentCodeType\"},{\"id\":2056961449,\"predicate\":\"emojiGroup\",\"params\":[{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"icon_emoji_id\",\"type\":\"long\"},{\"name\":\"emoticons\",\"type\":\"Vector\"}],\"type\":\"EmojiGroup\"},{\"id\":1874111879,\"predicate\":\"messages.emojiGroupsNotModified\",\"params\":[],\"type\":\"messages.EmojiGroups\"},{\"id\":-2011186869,\"predicate\":\"messages.emojiGroups\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"groups\",\"type\":\"Vector\"}],\"type\":\"messages.EmojiGroups\"},{\"id\":-128171716,\"predicate\":\"videoSizeEmojiMarkup\",\"params\":[{\"name\":\"emoji_id\",\"type\":\"long\"},{\"name\":\"background_colors\",\"type\":\"Vector\"}],\"type\":\"VideoSize\"},{\"id\":228623102,\"predicate\":\"videoSizeStickerMarkup\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"sticker_id\",\"type\":\"long\"},{\"name\":\"background_colors\",\"type\":\"Vector\"}],\"type\":\"VideoSize\"},{\"id\":1964978502,\"predicate\":\"textWithEntities\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"Vector\"}],\"type\":\"TextWithEntities\"},{\"id\":870003448,\"predicate\":\"messages.translateResult\",\"params\":[{\"name\":\"result\",\"type\":\"Vector\"}],\"type\":\"messages.TranslatedText\"},{\"id\":-934791986,\"predicate\":\"autoSaveSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"photos\",\"type\":\"flags.0?true\"},{\"name\":\"videos\",\"type\":\"flags.1?true\"},{\"name\":\"video_max_size\",\"type\":\"flags.2?long\"}],\"type\":\"AutoSaveSettings\"},{\"id\":-2124403385,\"predicate\":\"autoSaveException\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"settings\",\"type\":\"AutoSaveSettings\"}],\"type\":\"AutoSaveException\"},{\"id\":1279133341,\"predicate\":\"account.autoSaveSettings\",\"params\":[{\"name\":\"users_settings\",\"type\":\"AutoSaveSettings\"},{\"name\":\"chats_settings\",\"type\":\"AutoSaveSettings\"},{\"name\":\"broadcasts_settings\",\"type\":\"AutoSaveSettings\"},{\"name\":\"exceptions\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"account.AutoSaveSettings\"},{\"id\":-335171433,\"predicate\":\"updateAutoSaveSettings\",\"params\":[],\"type\":\"Update\"}],\"methods\":[{\"id\":-878758099,\"method\":\"invokeAfterMsg\",\"params\":[{\"name\":\"msg_id\",\"type\":\"long\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":1036301552,\"method\":\"invokeAfterMsgs\",\"params\":[{\"name\":\"msg_ids\",\"type\":\"Vector\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":-1502141361,\"method\":\"auth.sendCode\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"api_id\",\"type\":\"int\"},{\"name\":\"api_hash\",\"type\":\"string\"},{\"name\":\"settings\",\"type\":\"CodeSettings\"}],\"type\":\"auth.SentCode\"},{\"id\":-2131827673,\"method\":\"auth.signUp\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"}],\"type\":\"auth.Authorization\"},{\"id\":-1923962543,\"method\":\"auth.signIn\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"phone_code\",\"type\":\"flags.0?string\"},{\"name\":\"email_verification\",\"type\":\"flags.1?EmailVerification\"}],\"type\":\"auth.Authorization\"},{\"id\":1047706137,\"method\":\"auth.logOut\",\"params\":[],\"type\":\"auth.LoggedOut\"},{\"id\":-1616179942,\"method\":\"auth.resetAuthorizations\",\"params\":[],\"type\":\"Bool\"},{\"id\":-440401971,\"method\":\"auth.exportAuthorization\",\"params\":[{\"name\":\"dc_id\",\"type\":\"int\"}],\"type\":\"auth.ExportedAuthorization\"},{\"id\":-1518699091,\"method\":\"auth.importAuthorization\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"auth.Authorization\"},{\"id\":-841733627,\"method\":\"auth.bindTempAuthKey\",\"params\":[{\"name\":\"perm_auth_key_id\",\"type\":\"long\"},{\"name\":\"nonce\",\"type\":\"long\"},{\"name\":\"expires_at\",\"type\":\"int\"},{\"name\":\"encrypted_message\",\"type\":\"bytes\"}],\"type\":\"Bool\"},{\"id\":-326762118,\"method\":\"account.registerDevice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_muted\",\"type\":\"flags.0?true\"},{\"name\":\"token_type\",\"type\":\"int\"},{\"name\":\"token\",\"type\":\"string\"},{\"name\":\"app_sandbox\",\"type\":\"Bool\"},{\"name\":\"secret\",\"type\":\"bytes\"},{\"name\":\"other_uids\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":1779249670,\"method\":\"account.unregisterDevice\",\"params\":[{\"name\":\"token_type\",\"type\":\"int\"},{\"name\":\"token\",\"type\":\"string\"},{\"name\":\"other_uids\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-2067899501,\"method\":\"account.updateNotifySettings\",\"params\":[{\"name\":\"peer\",\"type\":\"InputNotifyPeer\"},{\"name\":\"settings\",\"type\":\"InputPeerNotifySettings\"}],\"type\":\"Bool\"},{\"id\":313765169,\"method\":\"account.getNotifySettings\",\"params\":[{\"name\":\"peer\",\"type\":\"InputNotifyPeer\"}],\"type\":\"PeerNotifySettings\"},{\"id\":-612493497,\"method\":\"account.resetNotifySettings\",\"params\":[],\"type\":\"Bool\"},{\"id\":2018596725,\"method\":\"account.updateProfile\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"first_name\",\"type\":\"flags.0?string\"},{\"name\":\"last_name\",\"type\":\"flags.1?string\"},{\"name\":\"about\",\"type\":\"flags.2?string\"}],\"type\":\"User\"},{\"id\":1713919532,\"method\":\"account.updateStatus\",\"params\":[{\"name\":\"offline\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":127302966,\"method\":\"account.getWallPapers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"account.WallPapers\"},{\"id\":-977650298,\"method\":\"account.reportPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reason\",\"type\":\"ReportReason\"},{\"name\":\"message\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":227648840,\"method\":\"users.getUsers\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":-1240508136,\"method\":\"users.getFullUser\",\"params\":[{\"name\":\"id\",\"type\":\"InputUser\"}],\"type\":\"users.UserFull\"},{\"id\":2061264541,\"method\":\"contacts.getContactIDs\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"Vector\"},{\"id\":-995929106,\"method\":\"contacts.getStatuses\",\"params\":[],\"type\":\"Vector\"},{\"id\":1574346258,\"method\":\"contacts.getContacts\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"contacts.Contacts\"},{\"id\":746589157,\"method\":\"contacts.importContacts\",\"params\":[{\"name\":\"contacts\",\"type\":\"Vector\"}],\"type\":\"contacts.ImportedContacts\"},{\"id\":157945344,\"method\":\"contacts.deleteContacts\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":269745566,\"method\":\"contacts.deleteByPhones\",\"params\":[{\"name\":\"phones\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":1758204945,\"method\":\"contacts.block\",\"params\":[{\"name\":\"id\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-1096393392,\"method\":\"contacts.unblock\",\"params\":[{\"name\":\"id\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-176409329,\"method\":\"contacts.getBlocked\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"contacts.Blocked\"},{\"id\":1673946374,\"method\":\"messages.getMessages\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":-1594569905,\"method\":\"messages.getDialogs\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"exclude_pinned\",\"type\":\"flags.0?true\"},{\"name\":\"folder_id\",\"type\":\"flags.1?int\"},{\"name\":\"offset_date\",\"type\":\"int\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"offset_peer\",\"type\":\"InputPeer\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Dialogs\"},{\"id\":1143203525,\"method\":\"messages.getHistory\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"offset_date\",\"type\":\"int\"},{\"name\":\"add_offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"min_id\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Messages\"},{\"id\":-1593989278,\"method\":\"messages.search\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"from_id\",\"type\":\"flags.0?InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.1?int\"},{\"name\":\"filter\",\"type\":\"MessagesFilter\"},{\"name\":\"min_date\",\"type\":\"int\"},{\"name\":\"max_date\",\"type\":\"int\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"add_offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"min_id\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Messages\"},{\"id\":238054714,\"method\":\"messages.readHistory\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"messages.AffectedMessages\"},{\"id\":-1332768214,\"method\":\"messages.deleteHistory\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"just_clear\",\"type\":\"flags.0?true\"},{\"name\":\"revoke\",\"type\":\"flags.1?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"min_date\",\"type\":\"flags.2?int\"},{\"name\":\"max_date\",\"type\":\"flags.3?int\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":-443640366,\"method\":\"messages.deleteMessages\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"revoke\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.AffectedMessages\"},{\"id\":94983360,\"method\":\"messages.receivedMessages\",\"params\":[{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"Vector\"},{\"id\":1486110434,\"method\":\"messages.setTyping\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"action\",\"type\":\"SendMessageAction\"}],\"type\":\"Bool\"},{\"id\":482476935,\"method\":\"messages.sendMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.1?true\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"background\",\"type\":\"flags.6?true\"},{\"name\":\"clear_draft\",\"type\":\"flags.7?true\"},{\"name\":\"noforwards\",\"type\":\"flags.14?true\"},{\"name\":\"update_stickersets_order\",\"type\":\"flags.15?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"top_msg_id\",\"type\":\"flags.9?int\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"},{\"name\":\"schedule_date\",\"type\":\"flags.10?int\"},{\"name\":\"send_as\",\"type\":\"flags.13?InputPeer\"}],\"type\":\"Updates\"},{\"id\":1967638886,\"method\":\"messages.sendMedia\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"background\",\"type\":\"flags.6?true\"},{\"name\":\"clear_draft\",\"type\":\"flags.7?true\"},{\"name\":\"noforwards\",\"type\":\"flags.14?true\"},{\"name\":\"update_stickersets_order\",\"type\":\"flags.15?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"top_msg_id\",\"type\":\"flags.9?int\"},{\"name\":\"media\",\"type\":\"InputMedia\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"},{\"name\":\"schedule_date\",\"type\":\"flags.10?int\"},{\"name\":\"send_as\",\"type\":\"flags.13?InputPeer\"}],\"type\":\"Updates\"},{\"id\":-966673468,\"method\":\"messages.forwardMessages\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"background\",\"type\":\"flags.6?true\"},{\"name\":\"with_my_score\",\"type\":\"flags.8?true\"},{\"name\":\"drop_author\",\"type\":\"flags.11?true\"},{\"name\":\"drop_media_captions\",\"type\":\"flags.12?true\"},{\"name\":\"noforwards\",\"type\":\"flags.14?true\"},{\"name\":\"from_peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"},{\"name\":\"random_id\",\"type\":\"Vector\"},{\"name\":\"to_peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.9?int\"},{\"name\":\"schedule_date\",\"type\":\"flags.10?int\"},{\"name\":\"send_as\",\"type\":\"flags.13?InputPeer\"}],\"type\":\"Updates\"},{\"id\":-820669733,\"method\":\"messages.reportSpam\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-270948702,\"method\":\"messages.getPeerSettings\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"messages.PeerSettings\"},{\"id\":-1991005362,\"method\":\"messages.report\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"},{\"name\":\"reason\",\"type\":\"ReportReason\"},{\"name\":\"message\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":1240027791,\"method\":\"messages.getChats\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.Chats\"},{\"id\":-1364194508,\"method\":\"messages.getFullChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"}],\"type\":\"messages.ChatFull\"},{\"id\":1937260541,\"method\":\"messages.editChatTitle\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":903730804,\"method\":\"messages.editChatPhoto\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"photo\",\"type\":\"InputChatPhoto\"}],\"type\":\"Updates\"},{\"id\":-230206493,\"method\":\"messages.addChatUser\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"fwd_limit\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":-1575461717,\"method\":\"messages.deleteChatUser\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"revoke_history\",\"type\":\"flags.0?true\"},{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"Updates\"},{\"id\":3450904,\"method\":\"messages.createChat\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"ttl_period\",\"type\":\"flags.0?int\"}],\"type\":\"Updates\"},{\"id\":-304838614,\"method\":\"updates.getState\",\"params\":[],\"type\":\"updates.State\"},{\"id\":630429265,\"method\":\"updates.getDifference\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_total_limit\",\"type\":\"flags.0?int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"qts\",\"type\":\"int\"}],\"type\":\"updates.Difference\"},{\"id\":473782614,\"method\":\"photos.updateProfilePhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"fallback\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"InputPhoto\"}],\"type\":\"photos.Photo\"},{\"id\":154966609,\"method\":\"photos.uploadProfilePhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"fallback\",\"type\":\"flags.3?true\"},{\"name\":\"file\",\"type\":\"flags.0?InputFile\"},{\"name\":\"video\",\"type\":\"flags.1?InputFile\"},{\"name\":\"video_start_ts\",\"type\":\"flags.2?double\"},{\"name\":\"video_emoji_markup\",\"type\":\"flags.4?VideoSize\"}],\"type\":\"photos.Photo\"},{\"id\":-2016444625,\"method\":\"photos.deletePhotos\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":-1291540959,\"method\":\"upload.saveFilePart\",\"params\":[{\"name\":\"file_id\",\"type\":\"long\"},{\"name\":\"file_part\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"Bool\"},{\"id\":-1101843010,\"method\":\"upload.getFile\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"precise\",\"type\":\"flags.0?true\"},{\"name\":\"cdn_supported\",\"type\":\"flags.1?true\"},{\"name\":\"location\",\"type\":\"InputFileLocation\"},{\"name\":\"offset\",\"type\":\"long\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"upload.File\"},{\"id\":-990308245,\"method\":\"help.getConfig\",\"params\":[],\"type\":\"Config\"},{\"id\":531836966,\"method\":\"help.getNearestDc\",\"params\":[],\"type\":\"NearestDc\"},{\"id\":1378703997,\"method\":\"help.getAppUpdate\",\"params\":[{\"name\":\"source\",\"type\":\"string\"}],\"type\":\"help.AppUpdate\"},{\"id\":1295590211,\"method\":\"help.getInviteText\",\"params\":[],\"type\":\"help.InviteText\"},{\"id\":-1848823128,\"method\":\"photos.getUserPhotos\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"long\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"photos.Photos\"},{\"id\":651135312,\"method\":\"messages.getDhConfig\",\"params\":[{\"name\":\"version\",\"type\":\"int\"},{\"name\":\"random_length\",\"type\":\"int\"}],\"type\":\"messages.DhConfig\"},{\"id\":-162681021,\"method\":\"messages.requestEncryption\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"random_id\",\"type\":\"int\"},{\"name\":\"g_a\",\"type\":\"bytes\"}],\"type\":\"EncryptedChat\"},{\"id\":1035731989,\"method\":\"messages.acceptEncryption\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"g_b\",\"type\":\"bytes\"},{\"name\":\"key_fingerprint\",\"type\":\"long\"}],\"type\":\"EncryptedChat\"},{\"id\":-208425312,\"method\":\"messages.discardEncryption\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"delete_history\",\"type\":\"flags.0?true\"},{\"name\":\"chat_id\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":2031374829,\"method\":\"messages.setEncryptedTyping\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"typing\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":2135648522,\"method\":\"messages.readEncryptedHistory\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"max_date\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":1157265941,\"method\":\"messages.sendEncrypted\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"type\":\"messages.SentEncryptedMessage\"},{\"id\":1431914525,\"method\":\"messages.sendEncryptedFile\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"bytes\"},{\"name\":\"file\",\"type\":\"InputEncryptedFile\"}],\"type\":\"messages.SentEncryptedMessage\"},{\"id\":852769188,\"method\":\"messages.sendEncryptedService\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"type\":\"messages.SentEncryptedMessage\"},{\"id\":1436924774,\"method\":\"messages.receivedQueue\",\"params\":[{\"name\":\"max_qts\",\"type\":\"int\"}],\"type\":\"Vector\"},{\"id\":1259113487,\"method\":\"messages.reportEncryptedSpam\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"}],\"type\":\"Bool\"},{\"id\":-562337987,\"method\":\"upload.saveBigFilePart\",\"params\":[{\"name\":\"file_id\",\"type\":\"long\"},{\"name\":\"file_part\",\"type\":\"int\"},{\"name\":\"file_total_parts\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"Bool\"},{\"id\":-1043505495,\"method\":\"initConnection\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"api_id\",\"type\":\"int\"},{\"name\":\"device_model\",\"type\":\"string\"},{\"name\":\"system_version\",\"type\":\"string\"},{\"name\":\"app_version\",\"type\":\"string\"},{\"name\":\"system_lang_code\",\"type\":\"string\"},{\"name\":\"lang_pack\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"proxy\",\"type\":\"flags.0?InputClientProxy\"},{\"name\":\"params\",\"type\":\"flags.1?JSONValue\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":-1663104819,\"method\":\"help.getSupport\",\"params\":[],\"type\":\"help.Support\"},{\"id\":916930423,\"method\":\"messages.readMessageContents\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.AffectedMessages\"},{\"id\":655677548,\"method\":\"account.checkUsername\",\"params\":[{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":1040964988,\"method\":\"account.updateUsername\",\"params\":[{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"User\"},{\"id\":301470424,\"method\":\"contacts.search\",\"params\":[{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"contacts.Found\"},{\"id\":-623130288,\"method\":\"account.getPrivacy\",\"params\":[{\"name\":\"key\",\"type\":\"InputPrivacyKey\"}],\"type\":\"account.PrivacyRules\"},{\"id\":-906486552,\"method\":\"account.setPrivacy\",\"params\":[{\"name\":\"key\",\"type\":\"InputPrivacyKey\"},{\"name\":\"rules\",\"type\":\"Vector\"}],\"type\":\"account.PrivacyRules\"},{\"id\":-1564422284,\"method\":\"account.deleteAccount\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"reason\",\"type\":\"string\"},{\"name\":\"password\",\"type\":\"flags.0?InputCheckPasswordSRP\"}],\"type\":\"Bool\"},{\"id\":150761757,\"method\":\"account.getAccountTTL\",\"params\":[],\"type\":\"AccountDaysTTL\"},{\"id\":608323678,\"method\":\"account.setAccountTTL\",\"params\":[{\"name\":\"ttl\",\"type\":\"AccountDaysTTL\"}],\"type\":\"Bool\"},{\"id\":-627372787,\"method\":\"invokeWithLayer\",\"params\":[{\"name\":\"layer\",\"type\":\"int\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":-113456221,\"method\":\"contacts.resolveUsername\",\"params\":[{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"contacts.ResolvedPeer\"},{\"id\":-2108208411,\"method\":\"account.sendChangePhoneCode\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"settings\",\"type\":\"CodeSettings\"}],\"type\":\"auth.SentCode\"},{\"id\":1891839707,\"method\":\"account.changePhone\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"phone_code\",\"type\":\"string\"}],\"type\":\"User\"},{\"id\":-710552671,\"method\":\"messages.getStickers\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Stickers\"},{\"id\":-1197432408,\"method\":\"messages.getAllStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.AllStickers\"},{\"id\":954152242,\"method\":\"account.updateDeviceLocked\",\"params\":[{\"name\":\"period\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":1738800940,\"method\":\"auth.importBotAuthorization\",\"params\":[{\"name\":\"flags\",\"type\":\"int\"},{\"name\":\"api_id\",\"type\":\"int\"},{\"name\":\"api_hash\",\"type\":\"string\"},{\"name\":\"bot_auth_token\",\"type\":\"string\"}],\"type\":\"auth.Authorization\"},{\"id\":-1956073268,\"method\":\"messages.getWebPagePreview\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"}],\"type\":\"MessageMedia\"},{\"id\":-484392616,\"method\":\"account.getAuthorizations\",\"params\":[],\"type\":\"account.Authorizations\"},{\"id\":-545786948,\"method\":\"account.resetAuthorization\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"Bool\"},{\"id\":1418342645,\"method\":\"account.getPassword\",\"params\":[],\"type\":\"account.Password\"},{\"id\":-1663767815,\"method\":\"account.getPasswordSettings\",\"params\":[{\"name\":\"password\",\"type\":\"InputCheckPasswordSRP\"}],\"type\":\"account.PasswordSettings\"},{\"id\":-1516564433,\"method\":\"account.updatePasswordSettings\",\"params\":[{\"name\":\"password\",\"type\":\"InputCheckPasswordSRP\"},{\"name\":\"new_settings\",\"type\":\"account.PasswordInputSettings\"}],\"type\":\"Bool\"},{\"id\":-779399914,\"method\":\"auth.checkPassword\",\"params\":[{\"name\":\"password\",\"type\":\"InputCheckPasswordSRP\"}],\"type\":\"auth.Authorization\"},{\"id\":-661144474,\"method\":\"auth.requestPasswordRecovery\",\"params\":[],\"type\":\"auth.PasswordRecovery\"},{\"id\":923364464,\"method\":\"auth.recoverPassword\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"code\",\"type\":\"string\"},{\"name\":\"new_settings\",\"type\":\"flags.0?account.PasswordInputSettings\"}],\"type\":\"auth.Authorization\"},{\"id\":-1080796745,\"method\":\"invokeWithoutUpdates\",\"params\":[{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":-1607670315,\"method\":\"messages.exportChatInvite\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"legacy_revoke_permanent\",\"type\":\"flags.2?true\"},{\"name\":\"request_needed\",\"type\":\"flags.3?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"expire_date\",\"type\":\"flags.0?int\"},{\"name\":\"usage_limit\",\"type\":\"flags.1?int\"},{\"name\":\"title\",\"type\":\"flags.4?string\"}],\"type\":\"ExportedChatInvite\"},{\"id\":1051570619,\"method\":\"messages.checkChatInvite\",\"params\":[{\"name\":\"hash\",\"type\":\"string\"}],\"type\":\"ChatInvite\"},{\"id\":1817183516,\"method\":\"messages.importChatInvite\",\"params\":[{\"name\":\"hash\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":-928977804,\"method\":\"messages.getStickerSet\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.StickerSet\"},{\"id\":-946871200,\"method\":\"messages.installStickerSet\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"archived\",\"type\":\"Bool\"}],\"type\":\"messages.StickerSetInstallResult\"},{\"id\":-110209570,\"method\":\"messages.uninstallStickerSet\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"}],\"type\":\"Bool\"},{\"id\":-421563528,\"method\":\"messages.startBot\",\"params\":[{\"name\":\"bot\",\"type\":\"InputUser\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"start_param\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":-1877938321,\"method\":\"help.getAppChangelog\",\"params\":[{\"name\":\"prev_app_version\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":1468322785,\"method\":\"messages.getMessagesViews\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"},{\"name\":\"increment\",\"type\":\"Bool\"}],\"type\":\"messages.MessageViews\"},{\"id\":-871347913,\"method\":\"channels.readHistory\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":-2067661490,\"method\":\"channels.deleteMessages\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.AffectedMessages\"},{\"id\":-196443371,\"method\":\"channels.reportSpam\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"participant\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-1383294429,\"method\":\"channels.getMessages\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":2010044880,\"method\":\"channels.getParticipants\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"filter\",\"type\":\"ChannelParticipantsFilter\"},{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"channels.ChannelParticipants\"},{\"id\":-1599378234,\"method\":\"channels.getParticipant\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"participant\",\"type\":\"InputPeer\"}],\"type\":\"channels.ChannelParticipant\"},{\"id\":176122811,\"method\":\"channels.getChannels\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.Chats\"},{\"id\":141781513,\"method\":\"channels.getFullChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"messages.ChatFull\"},{\"id\":-1862244601,\"method\":\"channels.createChannel\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"broadcast\",\"type\":\"flags.0?true\"},{\"name\":\"megagroup\",\"type\":\"flags.1?true\"},{\"name\":\"for_import\",\"type\":\"flags.3?true\"},{\"name\":\"forum\",\"type\":\"flags.5?true\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"about\",\"type\":\"string\"},{\"name\":\"geo_point\",\"type\":\"flags.2?InputGeoPoint\"},{\"name\":\"address\",\"type\":\"flags.2?string\"},{\"name\":\"ttl_period\",\"type\":\"flags.4?int\"}],\"type\":\"Updates\"},{\"id\":-751007486,\"method\":\"channels.editAdmin\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"admin_rights\",\"type\":\"ChatAdminRights\"},{\"name\":\"rank\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":1450044624,\"method\":\"channels.editTitle\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":-248621111,\"method\":\"channels.editPhoto\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"photo\",\"type\":\"InputChatPhoto\"}],\"type\":\"Updates\"},{\"id\":283557164,\"method\":\"channels.checkUsername\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":890549214,\"method\":\"channels.updateUsername\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":615851205,\"method\":\"channels.joinChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"Updates\"},{\"id\":-130635115,\"method\":\"channels.leaveChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"Updates\"},{\"id\":429865580,\"method\":\"channels.inviteToChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":-1072619549,\"method\":\"channels.deleteChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"Updates\"},{\"id\":51854712,\"method\":\"updates.getChannelDifference\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"force\",\"type\":\"flags.0?true\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"filter\",\"type\":\"ChannelMessagesFilter\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"updates.ChannelDifference\"},{\"id\":-1470377534,\"method\":\"messages.editChatAdmin\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"is_admin\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":-1568189671,\"method\":\"messages.migrateChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"}],\"type\":\"Updates\"},{\"id\":1271290010,\"method\":\"messages.searchGlobal\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"folder_id\",\"type\":\"flags.0?int\"},{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"filter\",\"type\":\"MessagesFilter\"},{\"name\":\"min_date\",\"type\":\"int\"},{\"name\":\"max_date\",\"type\":\"int\"},{\"name\":\"offset_rate\",\"type\":\"int\"},{\"name\":\"offset_peer\",\"type\":\"InputPeer\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":2016638777,\"method\":\"messages.reorderStickerSets\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"masks\",\"type\":\"flags.0?true\"},{\"name\":\"emojis\",\"type\":\"flags.1?true\"},{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-1309538785,\"method\":\"messages.getDocumentByHash\",\"params\":[{\"name\":\"sha256\",\"type\":\"bytes\"},{\"name\":\"size\",\"type\":\"long\"},{\"name\":\"mime_type\",\"type\":\"string\"}],\"type\":\"Document\"},{\"id\":1559270965,\"method\":\"messages.getSavedGifs\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.SavedGifs\"},{\"id\":846868683,\"method\":\"messages.saveGif\",\"params\":[{\"name\":\"id\",\"type\":\"InputDocument\"},{\"name\":\"unsave\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":1364105629,\"method\":\"messages.getInlineBotResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"bot\",\"type\":\"InputUser\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"geo_point\",\"type\":\"flags.0?InputGeoPoint\"},{\"name\":\"query\",\"type\":\"string\"},{\"name\":\"offset\",\"type\":\"string\"}],\"type\":\"messages.BotResults\"},{\"id\":-346119674,\"method\":\"messages.setInlineBotResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"gallery\",\"type\":\"flags.0?true\"},{\"name\":\"private\",\"type\":\"flags.1?true\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"results\",\"type\":\"Vector\"},{\"name\":\"cache_time\",\"type\":\"int\"},{\"name\":\"next_offset\",\"type\":\"flags.2?string\"},{\"name\":\"switch_pm\",\"type\":\"flags.3?InlineBotSwitchPM\"}],\"type\":\"Bool\"},{\"id\":-738468661,\"method\":\"messages.sendInlineBotResult\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"background\",\"type\":\"flags.6?true\"},{\"name\":\"clear_draft\",\"type\":\"flags.7?true\"},{\"name\":\"hide_via\",\"type\":\"flags.11?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"top_msg_id\",\"type\":\"flags.9?int\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"schedule_date\",\"type\":\"flags.10?int\"},{\"name\":\"send_as\",\"type\":\"flags.13?InputPeer\"}],\"type\":\"Updates\"},{\"id\":-432034325,\"method\":\"channels.exportMessageLink\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"grouped\",\"type\":\"flags.0?true\"},{\"name\":\"thread\",\"type\":\"flags.1?true\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"ExportedMessageLink\"},{\"id\":527021574,\"method\":\"channels.toggleSignatures\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":1056025023,\"method\":\"auth.resendCode\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"}],\"type\":\"auth.SentCode\"},{\"id\":520357240,\"method\":\"auth.cancelCode\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":-39416522,\"method\":\"messages.getMessageEditData\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"messages.MessageEditData\"},{\"id\":1224152952,\"method\":\"messages.editMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.1?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"message\",\"type\":\"flags.11?string\"},{\"name\":\"media\",\"type\":\"flags.14?InputMedia\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"},{\"name\":\"schedule_date\",\"type\":\"flags.15?int\"}],\"type\":\"Updates\"},{\"id\":-2091549254,\"method\":\"messages.editInlineBotMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.1?true\"},{\"name\":\"id\",\"type\":\"InputBotInlineMessageID\"},{\"name\":\"message\",\"type\":\"flags.11?string\"},{\"name\":\"media\",\"type\":\"flags.14?InputMedia\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"}],\"type\":\"Bool\"},{\"id\":-1824339449,\"method\":\"messages.getBotCallbackAnswer\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"game\",\"type\":\"flags.1?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"data\",\"type\":\"flags.0?bytes\"},{\"name\":\"password\",\"type\":\"flags.2?InputCheckPasswordSRP\"}],\"type\":\"messages.BotCallbackAnswer\"},{\"id\":-712043766,\"method\":\"messages.setBotCallbackAnswer\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"alert\",\"type\":\"flags.1?true\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"message\",\"type\":\"flags.0?string\"},{\"name\":\"url\",\"type\":\"flags.2?string\"},{\"name\":\"cache_time\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":-1758168906,\"method\":\"contacts.getTopPeers\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"correspondents\",\"type\":\"flags.0?true\"},{\"name\":\"bots_pm\",\"type\":\"flags.1?true\"},{\"name\":\"bots_inline\",\"type\":\"flags.2?true\"},{\"name\":\"phone_calls\",\"type\":\"flags.3?true\"},{\"name\":\"forward_users\",\"type\":\"flags.4?true\"},{\"name\":\"forward_chats\",\"type\":\"flags.5?true\"},{\"name\":\"groups\",\"type\":\"flags.10?true\"},{\"name\":\"channels\",\"type\":\"flags.15?true\"},{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"contacts.TopPeers\"},{\"id\":451113900,\"method\":\"contacts.resetTopPeerRating\",\"params\":[{\"name\":\"category\",\"type\":\"TopPeerCategory\"},{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-462373635,\"method\":\"messages.getPeerDialogs\",\"params\":[{\"name\":\"peers\",\"type\":\"Vector\"}],\"type\":\"messages.PeerDialogs\"},{\"id\":-1271718337,\"method\":\"messages.saveDraft\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.1?true\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"top_msg_id\",\"type\":\"flags.2?int\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"}],\"type\":\"Bool\"},{\"id\":1782549861,\"method\":\"messages.getAllDrafts\",\"params\":[],\"type\":\"Updates\"},{\"id\":1685588756,\"method\":\"messages.getFeaturedStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.FeaturedStickers\"},{\"id\":1527873830,\"method\":\"messages.readFeaturedStickers\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-1649852357,\"method\":\"messages.getRecentStickers\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"attached\",\"type\":\"flags.0?true\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.RecentStickers\"},{\"id\":958863608,\"method\":\"messages.saveRecentSticker\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"attached\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"InputDocument\"},{\"name\":\"unsave\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":-1986437075,\"method\":\"messages.clearRecentStickers\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"attached\",\"type\":\"flags.0?true\"}],\"type\":\"Bool\"},{\"id\":1475442322,\"method\":\"messages.getArchivedStickers\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"masks\",\"type\":\"flags.0?true\"},{\"name\":\"emojis\",\"type\":\"flags.1?true\"},{\"name\":\"offset_id\",\"type\":\"long\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.ArchivedStickers\"},{\"id\":457157256,\"method\":\"account.sendConfirmPhoneCode\",\"params\":[{\"name\":\"hash\",\"type\":\"string\"},{\"name\":\"settings\",\"type\":\"CodeSettings\"}],\"type\":\"auth.SentCode\"},{\"id\":1596029123,\"method\":\"account.confirmPhone\",\"params\":[{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"phone_code\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":-122669393,\"method\":\"channels.getAdminedPublicChannels\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"by_location\",\"type\":\"flags.0?true\"},{\"name\":\"check_limit\",\"type\":\"flags.1?true\"}],\"type\":\"messages.Chats\"},{\"id\":1678738104,\"method\":\"messages.getMaskStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.AllStickers\"},{\"id\":-866424884,\"method\":\"messages.getAttachedStickers\",\"params\":[{\"name\":\"media\",\"type\":\"InputStickeredMedia\"}],\"type\":\"Vector\"},{\"id\":-1907842680,\"method\":\"auth.dropTempAuthKeys\",\"params\":[{\"name\":\"except_auth_keys\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-1896289088,\"method\":\"messages.setGameScore\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"edit_message\",\"type\":\"flags.0?true\"},{\"name\":\"force\",\"type\":\"flags.1?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"score\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":363700068,\"method\":\"messages.setInlineGameScore\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"edit_message\",\"type\":\"flags.0?true\"},{\"name\":\"force\",\"type\":\"flags.1?true\"},{\"name\":\"id\",\"type\":\"InputBotInlineMessageID\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"score\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":-400399203,\"method\":\"messages.getGameHighScores\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"messages.HighScores\"},{\"id\":258170395,\"method\":\"messages.getInlineGameHighScores\",\"params\":[{\"name\":\"id\",\"type\":\"InputBotInlineMessageID\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"messages.HighScores\"},{\"id\":-468934396,\"method\":\"messages.getCommonChats\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"max_id\",\"type\":\"long\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.Chats\"},{\"id\":-2023787330,\"method\":\"messages.getAllChats\",\"params\":[{\"name\":\"except_ids\",\"type\":\"Vector\"}],\"type\":\"messages.Chats\"},{\"id\":-333262899,\"method\":\"help.setBotUpdatesStatus\",\"params\":[{\"name\":\"pending_updates_count\",\"type\":\"int\"},{\"name\":\"message\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":852135825,\"method\":\"messages.getWebPage\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"WebPage\"},{\"id\":-1489903017,\"method\":\"messages.toggleDialogPin\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputDialogPeer\"}],\"type\":\"Bool\"},{\"id\":991616823,\"method\":\"messages.reorderPinnedDialogs\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"force\",\"type\":\"flags.0?true\"},{\"name\":\"folder_id\",\"type\":\"int\"},{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-692498958,\"method\":\"messages.getPinnedDialogs\",\"params\":[{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"messages.PeerDialogs\"},{\"id\":-1440257555,\"method\":\"bots.sendCustomRequest\",\"params\":[{\"name\":\"custom_method\",\"type\":\"string\"},{\"name\":\"params\",\"type\":\"DataJSON\"}],\"type\":\"DataJSON\"},{\"id\":-434028723,\"method\":\"bots.answerWebhookJSONQuery\",\"params\":[{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"DataJSON\"}],\"type\":\"Bool\"},{\"id\":619086221,\"method\":\"upload.getWebFile\",\"params\":[{\"name\":\"location\",\"type\":\"InputWebFileLocation\"},{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"upload.WebFile\"},{\"id\":924093883,\"method\":\"payments.getPaymentForm\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"invoice\",\"type\":\"InputInvoice\"},{\"name\":\"theme_params\",\"type\":\"flags.0?DataJSON\"}],\"type\":\"payments.PaymentForm\"},{\"id\":611897804,\"method\":\"payments.getPaymentReceipt\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"payments.PaymentReceipt\"},{\"id\":-1228345045,\"method\":\"payments.validateRequestedInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"save\",\"type\":\"flags.0?true\"},{\"name\":\"invoice\",\"type\":\"InputInvoice\"},{\"name\":\"info\",\"type\":\"PaymentRequestedInfo\"}],\"type\":\"payments.ValidatedRequestedInfo\"},{\"id\":755192367,\"method\":\"payments.sendPaymentForm\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"form_id\",\"type\":\"long\"},{\"name\":\"invoice\",\"type\":\"InputInvoice\"},{\"name\":\"requested_info_id\",\"type\":\"flags.0?string\"},{\"name\":\"shipping_option_id\",\"type\":\"flags.1?string\"},{\"name\":\"credentials\",\"type\":\"InputPaymentCredentials\"},{\"name\":\"tip_amount\",\"type\":\"flags.2?long\"}],\"type\":\"payments.PaymentResult\"},{\"id\":1151208273,\"method\":\"account.getTmpPassword\",\"params\":[{\"name\":\"password\",\"type\":\"InputCheckPasswordSRP\"},{\"name\":\"period\",\"type\":\"int\"}],\"type\":\"account.TmpPassword\"},{\"id\":578650699,\"method\":\"payments.getSavedInfo\",\"params\":[],\"type\":\"payments.SavedInfo\"},{\"id\":-667062079,\"method\":\"payments.clearSavedInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"credentials\",\"type\":\"flags.0?true\"},{\"name\":\"info\",\"type\":\"flags.1?true\"}],\"type\":\"Bool\"},{\"id\":-436833542,\"method\":\"messages.setBotShippingResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"error\",\"type\":\"flags.0?string\"},{\"name\":\"shipping_options\",\"type\":\"flags.1?Vector\"}],\"type\":\"Bool\"},{\"id\":163765653,\"method\":\"messages.setBotPrecheckoutResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"success\",\"type\":\"flags.1?true\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"error\",\"type\":\"flags.0?string\"}],\"type\":\"Bool\"},{\"id\":-1876841625,\"method\":\"stickers.createStickerSet\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"masks\",\"type\":\"flags.0?true\"},{\"name\":\"animated\",\"type\":\"flags.1?true\"},{\"name\":\"videos\",\"type\":\"flags.4?true\"},{\"name\":\"emojis\",\"type\":\"flags.5?true\"},{\"name\":\"text_color\",\"type\":\"flags.6?true\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"short_name\",\"type\":\"string\"},{\"name\":\"thumb\",\"type\":\"flags.2?InputDocument\"},{\"name\":\"stickers\",\"type\":\"Vector\"},{\"name\":\"software\",\"type\":\"flags.3?string\"}],\"type\":\"messages.StickerSet\"},{\"id\":-143257775,\"method\":\"stickers.removeStickerFromSet\",\"params\":[{\"name\":\"sticker\",\"type\":\"InputDocument\"}],\"type\":\"messages.StickerSet\"},{\"id\":-4795190,\"method\":\"stickers.changeStickerPosition\",\"params\":[{\"name\":\"sticker\",\"type\":\"InputDocument\"},{\"name\":\"position\",\"type\":\"int\"}],\"type\":\"messages.StickerSet\"},{\"id\":-2041315650,\"method\":\"stickers.addStickerToSet\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"sticker\",\"type\":\"InputStickerSetItem\"}],\"type\":\"messages.StickerSet\"},{\"id\":1369162417,\"method\":\"messages.uploadMedia\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"media\",\"type\":\"InputMedia\"}],\"type\":\"MessageMedia\"},{\"id\":1430593449,\"method\":\"phone.getCallConfig\",\"params\":[],\"type\":\"DataJSON\"},{\"id\":1124046573,\"method\":\"phone.requestCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.0?true\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"random_id\",\"type\":\"int\"},{\"name\":\"g_a_hash\",\"type\":\"bytes\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"}],\"type\":\"phone.PhoneCall\"},{\"id\":1003664544,\"method\":\"phone.acceptCall\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"g_b\",\"type\":\"bytes\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"}],\"type\":\"phone.PhoneCall\"},{\"id\":788404002,\"method\":\"phone.confirmCall\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"g_a\",\"type\":\"bytes\"},{\"name\":\"key_fingerprint\",\"type\":\"long\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"}],\"type\":\"phone.PhoneCall\"},{\"id\":399855457,\"method\":\"phone.receivedCall\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPhoneCall\"}],\"type\":\"Bool\"},{\"id\":-1295269440,\"method\":\"phone.discardCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"duration\",\"type\":\"int\"},{\"name\":\"reason\",\"type\":\"PhoneCallDiscardReason\"},{\"name\":\"connection_id\",\"type\":\"long\"}],\"type\":\"Updates\"},{\"id\":1508562471,\"method\":\"phone.setCallRating\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"user_initiative\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"rating\",\"type\":\"int\"},{\"name\":\"comment\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":662363518,\"method\":\"phone.saveCallDebug\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"debug\",\"type\":\"DataJSON\"}],\"type\":\"Bool\"},{\"id\":962554330,\"method\":\"upload.getCdnFile\",\"params\":[{\"name\":\"file_token\",\"type\":\"bytes\"},{\"name\":\"offset\",\"type\":\"long\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"upload.CdnFile\"},{\"id\":-1691921240,\"method\":\"upload.reuploadCdnFile\",\"params\":[{\"name\":\"file_token\",\"type\":\"bytes\"},{\"name\":\"request_token\",\"type\":\"bytes\"}],\"type\":\"Vector\"},{\"id\":1375900482,\"method\":\"help.getCdnConfig\",\"params\":[],\"type\":\"CdnConfig\"},{\"id\":-219008246,\"method\":\"langpack.getLangPack\",\"params\":[{\"name\":\"lang_pack\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"LangPackDifference\"},{\"id\":-269862909,\"method\":\"langpack.getStrings\",\"params\":[{\"name\":\"lang_pack\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"keys\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":-845657435,\"method\":\"langpack.getDifference\",\"params\":[{\"name\":\"lang_pack\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"from_version\",\"type\":\"int\"}],\"type\":\"LangPackDifference\"},{\"id\":1120311183,\"method\":\"langpack.getLanguages\",\"params\":[{\"name\":\"lang_pack\",\"type\":\"string\"}],\"type\":\"Vector\"},{\"id\":-1763259007,\"method\":\"channels.editBanned\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"participant\",\"type\":\"InputPeer\"},{\"name\":\"banned_rights\",\"type\":\"ChatBannedRights\"}],\"type\":\"Updates\"},{\"id\":870184064,\"method\":\"channels.getAdminLog\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"events_filter\",\"type\":\"flags.0?ChannelAdminLogEventsFilter\"},{\"name\":\"admins\",\"type\":\"flags.1?Vector\"},{\"name\":\"max_id\",\"type\":\"long\"},{\"name\":\"min_id\",\"type\":\"long\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"channels.AdminLogResults\"},{\"id\":-1847836879,\"method\":\"upload.getCdnFileHashes\",\"params\":[{\"name\":\"file_token\",\"type\":\"bytes\"},{\"name\":\"offset\",\"type\":\"long\"}],\"type\":\"Vector\"},{\"id\":-914493408,\"method\":\"messages.sendScreenshotNotification\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reply_to_msg_id\",\"type\":\"int\"},{\"name\":\"random_id\",\"type\":\"long\"}],\"type\":\"Updates\"},{\"id\":-359881479,\"method\":\"channels.setStickers\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"}],\"type\":\"Bool\"},{\"id\":82946729,\"method\":\"messages.getFavedStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.FavedStickers\"},{\"id\":-1174420133,\"method\":\"messages.faveSticker\",\"params\":[{\"name\":\"id\",\"type\":\"InputDocument\"},{\"name\":\"unfave\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":-357180360,\"method\":\"channels.readMessageContents\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-2020263951,\"method\":\"contacts.resetSaved\",\"params\":[],\"type\":\"Bool\"},{\"id\":-251140208,\"method\":\"messages.getUnreadMentions\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"add_offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"min_id\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":-1683319225,\"method\":\"channels.deleteHistory\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"for_everyone\",\"type\":\"flags.0?true\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":1036054804,\"method\":\"help.getRecentMeUrls\",\"params\":[{\"name\":\"referer\",\"type\":\"string\"}],\"type\":\"help.RecentMeUrls\"},{\"id\":-356796084,\"method\":\"channels.togglePreHistoryHidden\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":921026381,\"method\":\"messages.readMentions\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":1881817312,\"method\":\"messages.getRecentLocations\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Messages\"},{\"id\":-1225713124,\"method\":\"messages.sendMultiMedia\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"background\",\"type\":\"flags.6?true\"},{\"name\":\"clear_draft\",\"type\":\"flags.7?true\"},{\"name\":\"noforwards\",\"type\":\"flags.14?true\"},{\"name\":\"update_stickersets_order\",\"type\":\"flags.15?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"top_msg_id\",\"type\":\"flags.9?int\"},{\"name\":\"multi_media\",\"type\":\"Vector\"},{\"name\":\"schedule_date\",\"type\":\"flags.10?int\"},{\"name\":\"send_as\",\"type\":\"flags.13?InputPeer\"}],\"type\":\"Updates\"},{\"id\":1347929239,\"method\":\"messages.uploadEncryptedFile\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"file\",\"type\":\"InputEncryptedFile\"}],\"type\":\"EncryptedFile\"},{\"id\":405695855,\"method\":\"account.getWebAuthorizations\",\"params\":[],\"type\":\"account.WebAuthorizations\"},{\"id\":755087855,\"method\":\"account.resetWebAuthorization\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"Bool\"},{\"id\":1747789204,\"method\":\"account.resetWebAuthorizations\",\"params\":[],\"type\":\"Bool\"},{\"id\":896555914,\"method\":\"messages.searchStickerSets\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"exclude_featured\",\"type\":\"flags.0?true\"},{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.FoundStickerSets\"},{\"id\":-1856595926,\"method\":\"upload.getFileHashes\",\"params\":[{\"name\":\"location\",\"type\":\"InputFileLocation\"},{\"name\":\"offset\",\"type\":\"long\"}],\"type\":\"Vector\"},{\"id\":749019089,\"method\":\"help.getTermsOfServiceUpdate\",\"params\":[],\"type\":\"help.TermsOfServiceUpdate\"},{\"id\":-294455398,\"method\":\"help.acceptTermsOfService\",\"params\":[{\"name\":\"id\",\"type\":\"DataJSON\"}],\"type\":\"Bool\"},{\"id\":-1299661699,\"method\":\"account.getAllSecureValues\",\"params\":[],\"type\":\"Vector\"},{\"id\":1936088002,\"method\":\"account.getSecureValue\",\"params\":[{\"name\":\"types\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":-1986010339,\"method\":\"account.saveSecureValue\",\"params\":[{\"name\":\"value\",\"type\":\"InputSecureValue\"},{\"name\":\"secure_secret_id\",\"type\":\"long\"}],\"type\":\"SecureValue\"},{\"id\":-1199522741,\"method\":\"account.deleteSecureValue\",\"params\":[{\"name\":\"types\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-1865902923,\"method\":\"users.setSecureValueErrors\",\"params\":[{\"name\":\"id\",\"type\":\"InputUser\"},{\"name\":\"errors\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-1456907910,\"method\":\"account.getAuthorizationForm\",\"params\":[{\"name\":\"bot_id\",\"type\":\"long\"},{\"name\":\"scope\",\"type\":\"string\"},{\"name\":\"public_key\",\"type\":\"string\"}],\"type\":\"account.AuthorizationForm\"},{\"id\":-202552205,\"method\":\"account.acceptAuthorization\",\"params\":[{\"name\":\"bot_id\",\"type\":\"long\"},{\"name\":\"scope\",\"type\":\"string\"},{\"name\":\"public_key\",\"type\":\"string\"},{\"name\":\"value_hashes\",\"type\":\"Vector\"},{\"name\":\"credentials\",\"type\":\"SecureCredentialsEncrypted\"}],\"type\":\"Bool\"},{\"id\":-1516022023,\"method\":\"account.sendVerifyPhoneCode\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"settings\",\"type\":\"CodeSettings\"}],\"type\":\"auth.SentCode\"},{\"id\":1305716726,\"method\":\"account.verifyPhone\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"phone_code\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":-1730136133,\"method\":\"account.sendVerifyEmailCode\",\"params\":[{\"name\":\"purpose\",\"type\":\"EmailVerifyPurpose\"},{\"name\":\"email\",\"type\":\"string\"}],\"type\":\"account.SentEmailCode\"},{\"id\":53322959,\"method\":\"account.verifyEmail\",\"params\":[{\"name\":\"purpose\",\"type\":\"EmailVerifyPurpose\"},{\"name\":\"verification\",\"type\":\"EmailVerification\"}],\"type\":\"account.EmailVerified\"},{\"id\":1072547679,\"method\":\"help.getDeepLinkInfo\",\"params\":[{\"name\":\"path\",\"type\":\"string\"}],\"type\":\"help.DeepLinkInfo\"},{\"id\":-2098076769,\"method\":\"contacts.getSaved\",\"params\":[],\"type\":\"Vector\"},{\"id\":-2092831552,\"method\":\"channels.getLeftChannels\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"}],\"type\":\"messages.Chats\"},{\"id\":-1896617296,\"method\":\"account.initTakeoutSession\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"contacts\",\"type\":\"flags.0?true\"},{\"name\":\"message_users\",\"type\":\"flags.1?true\"},{\"name\":\"message_chats\",\"type\":\"flags.2?true\"},{\"name\":\"message_megagroups\",\"type\":\"flags.3?true\"},{\"name\":\"message_channels\",\"type\":\"flags.4?true\"},{\"name\":\"files\",\"type\":\"flags.5?true\"},{\"name\":\"file_max_size\",\"type\":\"flags.5?long\"}],\"type\":\"account.Takeout\"},{\"id\":489050862,\"method\":\"account.finishTakeoutSession\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"success\",\"type\":\"flags.0?true\"}],\"type\":\"Bool\"},{\"id\":486505992,\"method\":\"messages.getSplitRanges\",\"params\":[],\"type\":\"Vector\"},{\"id\":911373810,\"method\":\"invokeWithMessagesRange\",\"params\":[{\"name\":\"range\",\"type\":\"MessageRange\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":-1398145746,\"method\":\"invokeWithTakeout\",\"params\":[{\"name\":\"takeout_id\",\"type\":\"long\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":-1031349873,\"method\":\"messages.markDialogUnread\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"unread\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputDialogPeer\"}],\"type\":\"Bool\"},{\"id\":585256482,\"method\":\"messages.getDialogUnreadMarks\",\"params\":[],\"type\":\"Vector\"},{\"id\":-2062238246,\"method\":\"contacts.toggleTopPeers\",\"params\":[{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":2119757468,\"method\":\"messages.clearAllDrafts\",\"params\":[],\"type\":\"Bool\"},{\"id\":-1735311088,\"method\":\"help.getAppConfig\",\"params\":[],\"type\":\"JSONValue\"},{\"id\":1862465352,\"method\":\"help.saveAppLog\",\"params\":[{\"name\":\"events\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-966677240,\"method\":\"help.getPassportConfig\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"help.PassportConfig\"},{\"id\":1784243458,\"method\":\"langpack.getLanguage\",\"params\":[{\"name\":\"lang_pack\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"LangPackLanguage\"},{\"id\":-760547348,\"method\":\"messages.updatePinnedMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.0?true\"},{\"name\":\"unpin\",\"type\":\"flags.1?true\"},{\"name\":\"pm_oneside\",\"type\":\"flags.2?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":-1881204448,\"method\":\"account.confirmPasswordEmail\",\"params\":[{\"name\":\"code\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":2055154197,\"method\":\"account.resendPasswordEmail\",\"params\":[],\"type\":\"Bool\"},{\"id\":-1043606090,\"method\":\"account.cancelPasswordEmail\",\"params\":[],\"type\":\"Bool\"},{\"id\":-748624084,\"method\":\"help.getSupportName\",\"params\":[],\"type\":\"help.SupportName\"},{\"id\":59377875,\"method\":\"help.getUserInfo\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"help.UserInfo\"},{\"id\":1723407216,\"method\":\"help.editUserInfo\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"Vector\"}],\"type\":\"help.UserInfo\"},{\"id\":-1626880216,\"method\":\"account.getContactSignUpNotification\",\"params\":[],\"type\":\"Bool\"},{\"id\":-806076575,\"method\":\"account.setContactSignUpNotification\",\"params\":[{\"name\":\"silent\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":1398240377,\"method\":\"account.getNotifyExceptions\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"compare_sound\",\"type\":\"flags.1?true\"},{\"name\":\"peer\",\"type\":\"flags.0?InputNotifyPeer\"}],\"type\":\"Updates\"},{\"id\":283795844,\"method\":\"messages.sendVote\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"options\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":1941660731,\"method\":\"messages.getPollResults\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":1848369232,\"method\":\"messages.getOnlines\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"ChatOnlines\"},{\"id\":-554301545,\"method\":\"messages.editChatAbout\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"about\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":-1517917375,\"method\":\"messages.editChatDefaultBannedRights\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"banned_rights\",\"type\":\"ChatBannedRights\"}],\"type\":\"Updates\"},{\"id\":-57811990,\"method\":\"account.getWallPaper\",\"params\":[{\"name\":\"wallpaper\",\"type\":\"InputWallPaper\"}],\"type\":\"WallPaper\"},{\"id\":-578472351,\"method\":\"account.uploadWallPaper\",\"params\":[{\"name\":\"file\",\"type\":\"InputFile\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"settings\",\"type\":\"WallPaperSettings\"}],\"type\":\"WallPaper\"},{\"id\":1817860919,\"method\":\"account.saveWallPaper\",\"params\":[{\"name\":\"wallpaper\",\"type\":\"InputWallPaper\"},{\"name\":\"unsave\",\"type\":\"Bool\"},{\"name\":\"settings\",\"type\":\"WallPaperSettings\"}],\"type\":\"Bool\"},{\"id\":-18000023,\"method\":\"account.installWallPaper\",\"params\":[{\"name\":\"wallpaper\",\"type\":\"InputWallPaper\"},{\"name\":\"settings\",\"type\":\"WallPaperSettings\"}],\"type\":\"Bool\"},{\"id\":-1153722364,\"method\":\"account.resetWallPapers\",\"params\":[],\"type\":\"Bool\"},{\"id\":1457130303,\"method\":\"account.getAutoDownloadSettings\",\"params\":[],\"type\":\"account.AutoDownloadSettings\"},{\"id\":1995661875,\"method\":\"account.saveAutoDownloadSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"low\",\"type\":\"flags.0?true\"},{\"name\":\"high\",\"type\":\"flags.1?true\"},{\"name\":\"settings\",\"type\":\"AutoDownloadSettings\"}],\"type\":\"Bool\"},{\"id\":899735650,\"method\":\"messages.getEmojiKeywords\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"EmojiKeywordsDifference\"},{\"id\":352892591,\"method\":\"messages.getEmojiKeywordsDifference\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"from_version\",\"type\":\"int\"}],\"type\":\"EmojiKeywordsDifference\"},{\"id\":1318675378,\"method\":\"messages.getEmojiKeywordsLanguages\",\"params\":[{\"name\":\"lang_codes\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":-709817306,\"method\":\"messages.getEmojiURL\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"EmojiURL\"},{\"id\":1749536939,\"method\":\"folders.editPeerFolders\",\"params\":[{\"name\":\"folder_peers\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":472471681,\"method\":\"folders.deleteFolder\",\"params\":[{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":11435201,\"method\":\"messages.getSearchCounters\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"filters\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":-170208392,\"method\":\"channels.getGroupsForDiscussion\",\"params\":[],\"type\":\"messages.Chats\"},{\"id\":1079520178,\"method\":\"channels.setDiscussionGroup\",\"params\":[{\"name\":\"broadcast\",\"type\":\"InputChannel\"},{\"name\":\"group\",\"type\":\"InputChannel\"}],\"type\":\"Bool\"},{\"id\":428848198,\"method\":\"messages.requestUrlAuth\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"flags.1?InputPeer\"},{\"name\":\"msg_id\",\"type\":\"flags.1?int\"},{\"name\":\"button_id\",\"type\":\"flags.1?int\"},{\"name\":\"url\",\"type\":\"flags.2?string\"}],\"type\":\"UrlAuthResult\"},{\"id\":-1322487515,\"method\":\"messages.acceptUrlAuth\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"write_allowed\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"flags.1?InputPeer\"},{\"name\":\"msg_id\",\"type\":\"flags.1?int\"},{\"name\":\"button_id\",\"type\":\"flags.1?int\"},{\"name\":\"url\",\"type\":\"flags.2?string\"}],\"type\":\"UrlAuthResult\"},{\"id\":1336717624,\"method\":\"messages.hidePeerSettingsBar\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-386636848,\"method\":\"contacts.addContact\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"add_phone_privacy_exception\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"InputUser\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"phone\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":-130964977,\"method\":\"contacts.acceptContact\",\"params\":[{\"name\":\"id\",\"type\":\"InputUser\"}],\"type\":\"Updates\"},{\"id\":-1892102881,\"method\":\"channels.editCreator\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"password\",\"type\":\"InputCheckPasswordSRP\"}],\"type\":\"Updates\"},{\"id\":-750207932,\"method\":\"contacts.getLocated\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"background\",\"type\":\"flags.1?true\"},{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"self_expires\",\"type\":\"flags.0?int\"}],\"type\":\"Updates\"},{\"id\":1491484525,\"method\":\"channels.editLocation\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"address\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":-304832784,\"method\":\"channels.toggleSlowMode\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"seconds\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":-183077365,\"method\":\"messages.getScheduledHistory\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Messages\"},{\"id\":-1111817116,\"method\":\"messages.getScheduledMessages\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":-1120369398,\"method\":\"messages.sendScheduledMessages\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":1504586518,\"method\":\"messages.deleteScheduledMessages\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":473805619,\"method\":\"account.uploadTheme\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"file\",\"type\":\"InputFile\"},{\"name\":\"thumb\",\"type\":\"flags.0?InputFile\"},{\"name\":\"file_name\",\"type\":\"string\"},{\"name\":\"mime_type\",\"type\":\"string\"}],\"type\":\"Document\"},{\"id\":1697530880,\"method\":\"account.createTheme\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"slug\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"document\",\"type\":\"flags.2?InputDocument\"},{\"name\":\"settings\",\"type\":\"flags.3?Vector\"}],\"type\":\"Theme\"},{\"id\":737414348,\"method\":\"account.updateTheme\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"format\",\"type\":\"string\"},{\"name\":\"theme\",\"type\":\"InputTheme\"},{\"name\":\"slug\",\"type\":\"flags.0?string\"},{\"name\":\"title\",\"type\":\"flags.1?string\"},{\"name\":\"document\",\"type\":\"flags.2?InputDocument\"},{\"name\":\"settings\",\"type\":\"flags.3?Vector\"}],\"type\":\"Theme\"},{\"id\":-229175188,\"method\":\"account.saveTheme\",\"params\":[{\"name\":\"theme\",\"type\":\"InputTheme\"},{\"name\":\"unsave\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":-953697477,\"method\":\"account.installTheme\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"dark\",\"type\":\"flags.0?true\"},{\"name\":\"theme\",\"type\":\"flags.1?InputTheme\"},{\"name\":\"format\",\"type\":\"flags.2?string\"},{\"name\":\"base_theme\",\"type\":\"flags.3?BaseTheme\"}],\"type\":\"Bool\"},{\"id\":978872812,\"method\":\"account.getTheme\",\"params\":[{\"name\":\"format\",\"type\":\"string\"},{\"name\":\"theme\",\"type\":\"InputTheme\"}],\"type\":\"Theme\"},{\"id\":1913054296,\"method\":\"account.getThemes\",\"params\":[{\"name\":\"format\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"account.Themes\"},{\"id\":-1210022402,\"method\":\"auth.exportLoginToken\",\"params\":[{\"name\":\"api_id\",\"type\":\"int\"},{\"name\":\"api_hash\",\"type\":\"string\"},{\"name\":\"except_ids\",\"type\":\"Vector\"}],\"type\":\"auth.LoginToken\"},{\"id\":-1783866140,\"method\":\"auth.importLoginToken\",\"params\":[{\"name\":\"token\",\"type\":\"bytes\"}],\"type\":\"auth.LoginToken\"},{\"id\":-392909491,\"method\":\"auth.acceptLoginToken\",\"params\":[{\"name\":\"token\",\"type\":\"bytes\"}],\"type\":\"Authorization\"},{\"id\":-1250643605,\"method\":\"account.setContentSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"sensitive_enabled\",\"type\":\"flags.0?true\"}],\"type\":\"Bool\"},{\"id\":-1952756306,\"method\":\"account.getContentSettings\",\"params\":[],\"type\":\"account.ContentSettings\"},{\"id\":300429806,\"method\":\"channels.getInactiveChannels\",\"params\":[],\"type\":\"messages.InactiveChats\"},{\"id\":1705865692,\"method\":\"account.getMultiWallPapers\",\"params\":[{\"name\":\"wallpapers\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":-1200736242,\"method\":\"messages.getPollVotes\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"option\",\"type\":\"flags.0?bytes\"},{\"name\":\"offset\",\"type\":\"flags.1?string\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.VotesList\"},{\"id\":-1257951254,\"method\":\"messages.toggleStickerSets\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"uninstall\",\"type\":\"flags.0?true\"},{\"name\":\"archive\",\"type\":\"flags.1?true\"},{\"name\":\"unarchive\",\"type\":\"flags.2?true\"},{\"name\":\"stickersets\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":779736953,\"method\":\"payments.getBankCardData\",\"params\":[{\"name\":\"number\",\"type\":\"string\"}],\"type\":\"payments.BankCardData\"},{\"id\":-241247891,\"method\":\"messages.getDialogFilters\",\"params\":[],\"type\":\"Vector\"},{\"id\":-1566780372,\"method\":\"messages.getSuggestedDialogFilters\",\"params\":[],\"type\":\"Vector\"},{\"id\":450142282,\"method\":\"messages.updateDialogFilter\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"filter\",\"type\":\"flags.0?DialogFilter\"}],\"type\":\"Bool\"},{\"id\":-983318044,\"method\":\"messages.updateDialogFiltersOrder\",\"params\":[{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-1421720550,\"method\":\"stats.getBroadcastStats\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"dark\",\"type\":\"flags.0?true\"},{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"stats.BroadcastStats\"},{\"id\":1646092192,\"method\":\"stats.loadAsyncGraph\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"token\",\"type\":\"string\"},{\"name\":\"x\",\"type\":\"flags.0?long\"}],\"type\":\"StatsGraph\"},{\"id\":-1707717072,\"method\":\"stickers.setStickerSetThumb\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"thumb\",\"type\":\"InputDocument\"}],\"type\":\"messages.StickerSet\"},{\"id\":85399130,\"method\":\"bots.setBotCommands\",\"params\":[{\"name\":\"scope\",\"type\":\"BotCommandScope\"},{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"commands\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":2127598753,\"method\":\"messages.getOldFeaturedStickers\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.FeaturedStickers\"},{\"id\":-1063816159,\"method\":\"help.getPromoData\",\"params\":[],\"type\":\"help.PromoData\"},{\"id\":505748629,\"method\":\"help.hidePromoData\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-8744061,\"method\":\"phone.sendSignalingData\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"type\":\"Bool\"},{\"id\":-589330937,\"method\":\"stats.getMegagroupStats\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"dark\",\"type\":\"flags.0?true\"},{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"stats.MegagroupStats\"},{\"id\":-349483786,\"method\":\"account.getGlobalPrivacySettings\",\"params\":[],\"type\":\"GlobalPrivacySettings\"},{\"id\":517647042,\"method\":\"account.setGlobalPrivacySettings\",\"params\":[{\"name\":\"settings\",\"type\":\"GlobalPrivacySettings\"}],\"type\":\"GlobalPrivacySettings\"},{\"id\":-183649631,\"method\":\"help.dismissSuggestion\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"suggestion\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":1935116200,\"method\":\"help.getCountriesList\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"help.CountriesList\"},{\"id\":584962828,\"method\":\"messages.getReplies\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"offset_date\",\"type\":\"int\"},{\"name\":\"add_offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"min_id\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Messages\"},{\"id\":1147761405,\"method\":\"messages.getDiscussionMessage\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"messages.DiscussionMessage\"},{\"id\":-147740172,\"method\":\"messages.readDiscussion\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"read_max_id\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":698914348,\"method\":\"contacts.blockFromReplies\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"delete_message\",\"type\":\"flags.0?true\"},{\"name\":\"delete_history\",\"type\":\"flags.1?true\"},{\"name\":\"report_spam\",\"type\":\"flags.2?true\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":1445996571,\"method\":\"stats.getMessagePublicForwards\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"offset_rate\",\"type\":\"int\"},{\"name\":\"offset_peer\",\"type\":\"InputPeer\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":-1226791947,\"method\":\"stats.getMessageStats\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"dark\",\"type\":\"flags.0?true\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"stats.MessageStats\"},{\"id\":-299714136,\"method\":\"messages.unpinAllMessages\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":1221445336,\"method\":\"phone.createGroupCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"rtmp_stream\",\"type\":\"flags.2?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"random_id\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"flags.0?string\"},{\"name\":\"schedule_date\",\"type\":\"flags.1?int\"}],\"type\":\"Updates\"},{\"id\":-1322057861,\"method\":\"phone.joinGroupCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"muted\",\"type\":\"flags.0?true\"},{\"name\":\"video_stopped\",\"type\":\"flags.2?true\"},{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"join_as\",\"type\":\"InputPeer\"},{\"name\":\"invite_hash\",\"type\":\"flags.1?string\"},{\"name\":\"params\",\"type\":\"DataJSON\"}],\"type\":\"Updates\"},{\"id\":1342404601,\"method\":\"phone.leaveGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"source\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":2067345760,\"method\":\"phone.inviteToGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":2054648117,\"method\":\"phone.discardGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"}],\"type\":\"Updates\"},{\"id\":1958458429,\"method\":\"phone.toggleGroupCallSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"reset_invite_hash\",\"type\":\"flags.1?true\"},{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"join_muted\",\"type\":\"flags.0?Bool\"}],\"type\":\"Updates\"},{\"id\":68699611,\"method\":\"phone.getGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"phone.GroupCall\"},{\"id\":-984033109,\"method\":\"phone.getGroupParticipants\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"ids\",\"type\":\"Vector\"},{\"name\":\"sources\",\"type\":\"Vector\"},{\"name\":\"offset\",\"type\":\"string\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"phone.GroupParticipants\"},{\"id\":-1248003721,\"method\":\"phone.checkGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"sources\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":1540419152,\"method\":\"messages.deleteChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"}],\"type\":\"Bool\"},{\"id\":-104078327,\"method\":\"messages.deletePhoneCallHistory\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"revoke\",\"type\":\"flags.0?true\"}],\"type\":\"messages.AffectedFoundMessages\"},{\"id\":1140726259,\"method\":\"messages.checkHistoryImport\",\"params\":[{\"name\":\"import_head\",\"type\":\"string\"}],\"type\":\"messages.HistoryImportParsed\"},{\"id\":873008187,\"method\":\"messages.initHistoryImport\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"file\",\"type\":\"InputFile\"},{\"name\":\"media_count\",\"type\":\"int\"}],\"type\":\"messages.HistoryImport\"},{\"id\":713433234,\"method\":\"messages.uploadImportedMedia\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"import_id\",\"type\":\"long\"},{\"name\":\"file_name\",\"type\":\"string\"},{\"name\":\"media\",\"type\":\"InputMedia\"}],\"type\":\"MessageMedia\"},{\"id\":-1271008444,\"method\":\"messages.startHistoryImport\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"import_id\",\"type\":\"long\"}],\"type\":\"Bool\"},{\"id\":-1565154314,\"method\":\"messages.getExportedChatInvites\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"revoked\",\"type\":\"flags.3?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"admin_id\",\"type\":\"InputUser\"},{\"name\":\"offset_date\",\"type\":\"flags.2?int\"},{\"name\":\"offset_link\",\"type\":\"flags.2?string\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.ExportedChatInvites\"},{\"id\":1937010524,\"method\":\"messages.getExportedChatInvite\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"link\",\"type\":\"string\"}],\"type\":\"messages.ExportedChatInvite\"},{\"id\":-1110823051,\"method\":\"messages.editExportedChatInvite\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"revoked\",\"type\":\"flags.2?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"link\",\"type\":\"string\"},{\"name\":\"expire_date\",\"type\":\"flags.0?int\"},{\"name\":\"usage_limit\",\"type\":\"flags.1?int\"},{\"name\":\"request_needed\",\"type\":\"flags.3?Bool\"},{\"name\":\"title\",\"type\":\"flags.4?string\"}],\"type\":\"messages.ExportedChatInvite\"},{\"id\":1452833749,\"method\":\"messages.deleteRevokedExportedChatInvites\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"admin_id\",\"type\":\"InputUser\"}],\"type\":\"Bool\"},{\"id\":-731601877,\"method\":\"messages.deleteExportedChatInvite\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"link\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":958457583,\"method\":\"messages.getAdminsWithInvites\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"messages.ChatAdminsWithInvites\"},{\"id\":-553329330,\"method\":\"messages.getChatInviteImporters\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"requested\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"link\",\"type\":\"flags.1?string\"},{\"name\":\"q\",\"type\":\"flags.2?string\"},{\"name\":\"offset_date\",\"type\":\"int\"},{\"name\":\"offset_user\",\"type\":\"InputUser\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.ChatInviteImporters\"},{\"id\":-1207017500,\"method\":\"messages.setHistoryTTL\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"period\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":-91437323,\"method\":\"account.reportProfilePhoto\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"photo_id\",\"type\":\"InputPhoto\"},{\"name\":\"reason\",\"type\":\"ReportReason\"},{\"name\":\"message\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":187239529,\"method\":\"channels.convertToGigagroup\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"Updates\"},{\"id\":1573261059,\"method\":\"messages.checkHistoryImportPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"messages.CheckedHistoryImportPeer\"},{\"id\":-248985848,\"method\":\"phone.toggleGroupCallRecord\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"start\",\"type\":\"flags.0?true\"},{\"name\":\"video\",\"type\":\"flags.2?true\"},{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"title\",\"type\":\"flags.1?string\"},{\"name\":\"video_portrait\",\"type\":\"flags.2?Bool\"}],\"type\":\"Updates\"},{\"id\":-1524155713,\"method\":\"phone.editGroupCallParticipant\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"participant\",\"type\":\"InputPeer\"},{\"name\":\"muted\",\"type\":\"flags.0?Bool\"},{\"name\":\"volume\",\"type\":\"flags.1?int\"},{\"name\":\"raise_hand\",\"type\":\"flags.2?Bool\"},{\"name\":\"video_stopped\",\"type\":\"flags.3?Bool\"},{\"name\":\"video_paused\",\"type\":\"flags.4?Bool\"},{\"name\":\"presentation_paused\",\"type\":\"flags.5?Bool\"}],\"type\":\"Updates\"},{\"id\":480685066,\"method\":\"phone.editGroupCallTitle\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":-277077702,\"method\":\"phone.getGroupCallJoinAs\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"phone.JoinAsPeers\"},{\"id\":-425040769,\"method\":\"phone.exportGroupCallInvite\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"can_self_unmute\",\"type\":\"flags.0?true\"},{\"name\":\"call\",\"type\":\"InputGroupCall\"}],\"type\":\"phone.ExportedGroupCallInvite\"},{\"id\":563885286,\"method\":\"phone.toggleGroupCallStartSubscription\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"subscribed\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":1451287362,\"method\":\"phone.startScheduledGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"}],\"type\":\"Updates\"},{\"id\":1465786252,\"method\":\"phone.saveDefaultGroupCallJoinAs\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"join_as\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-873829436,\"method\":\"phone.joinGroupCallPresentation\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"params\",\"type\":\"DataJSON\"}],\"type\":\"Updates\"},{\"id\":475058500,\"method\":\"phone.leaveGroupCallPresentation\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"}],\"type\":\"Updates\"},{\"id\":676017721,\"method\":\"stickers.checkShortName\",\"params\":[{\"name\":\"short_name\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":1303364867,\"method\":\"stickers.suggestShortName\",\"params\":[{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"stickers.SuggestedShortName\"},{\"id\":1032708345,\"method\":\"bots.resetBotCommands\",\"params\":[{\"name\":\"scope\",\"type\":\"BotCommandScope\"},{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":-481554986,\"method\":\"bots.getBotCommands\",\"params\":[{\"name\":\"scope\",\"type\":\"BotCommandScope\"},{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"Vector\"},{\"id\":-1828139493,\"method\":\"account.resetPassword\",\"params\":[],\"type\":\"account.ResetPasswordResult\"},{\"id\":1284770294,\"method\":\"account.declinePasswordReset\",\"params\":[],\"type\":\"Bool\"},{\"id\":221691769,\"method\":\"auth.checkRecoveryPassword\",\"params\":[{\"name\":\"code\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":-700916087,\"method\":\"account.getChatThemes\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"account.Themes\"},{\"id\":-432283329,\"method\":\"messages.setChatTheme\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"emoticon\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":-1095836780,\"method\":\"channels.viewSponsoredMessage\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"random_id\",\"type\":\"bytes\"}],\"type\":\"Bool\"},{\"id\":-333377601,\"method\":\"channels.getSponsoredMessages\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"messages.SponsoredMessages\"},{\"id\":745510839,\"method\":\"messages.getMessageReadParticipants\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"Vector\"},{\"id\":1240514025,\"method\":\"messages.getSearchResultsCalendar\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"filter\",\"type\":\"MessagesFilter\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"offset_date\",\"type\":\"int\"}],\"type\":\"messages.SearchResultsCalendar\"},{\"id\":1855292323,\"method\":\"messages.getSearchResultsPositions\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"filter\",\"type\":\"MessagesFilter\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.SearchResultsPositions\"},{\"id\":2145904661,\"method\":\"messages.hideChatJoinRequest\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"approved\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"Updates\"},{\"id\":-528091926,\"method\":\"messages.hideAllChatJoinRequests\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"approved\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"link\",\"type\":\"flags.1?string\"}],\"type\":\"Updates\"},{\"id\":-1323389022,\"method\":\"messages.toggleNoForwards\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":-855777386,\"method\":\"messages.saveDefaultSendAs\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"send_as\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":231174382,\"method\":\"channels.getSendAs\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"channels.SendAsPeers\"},{\"id\":-1081501024,\"method\":\"account.setAuthorizationTTL\",\"params\":[{\"name\":\"authorization_ttl_days\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":1089766498,\"method\":\"account.changeAuthorizationSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"encrypted_requests_disabled\",\"type\":\"flags.0?Bool\"},{\"name\":\"call_requests_disabled\",\"type\":\"flags.1?Bool\"}],\"type\":\"Bool\"},{\"id\":913655003,\"method\":\"channels.deleteParticipantHistory\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"participant\",\"type\":\"InputPeer\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":-754091820,\"method\":\"messages.sendReaction\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"big\",\"type\":\"flags.1?true\"},{\"name\":\"add_to_recent\",\"type\":\"flags.2?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"reaction\",\"type\":\"flags.0?Vector\"}],\"type\":\"Updates\"},{\"id\":-1950707482,\"method\":\"messages.getMessagesReactions\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":1176190792,\"method\":\"messages.getMessageReactionsList\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"reaction\",\"type\":\"flags.0?Reaction\"},{\"name\":\"offset\",\"type\":\"flags.1?string\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.MessageReactionsList\"},{\"id\":-21928079,\"method\":\"messages.setChatAvailableReactions\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"available_reactions\",\"type\":\"ChatReactions\"}],\"type\":\"Updates\"},{\"id\":417243308,\"method\":\"messages.getAvailableReactions\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.AvailableReactions\"},{\"id\":1330094102,\"method\":\"messages.setDefaultReaction\",\"params\":[{\"name\":\"reaction\",\"type\":\"Reaction\"}],\"type\":\"Bool\"},{\"id\":1662529584,\"method\":\"messages.translateText\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"flags.0?InputPeer\"},{\"name\":\"id\",\"type\":\"flags.0?Vector\"},{\"name\":\"text\",\"type\":\"flags.1?Vector\"},{\"name\":\"to_lang\",\"type\":\"string\"}],\"type\":\"messages.TranslatedText\"},{\"id\":841173339,\"method\":\"messages.getUnreadReactions\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"add_offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"min_id\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":1420459918,\"method\":\"messages.readReactions\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":-1963375804,\"method\":\"contacts.resolvePhone\",\"params\":[{\"name\":\"phone\",\"type\":\"string\"}],\"type\":\"contacts.ResolvedPeer\"},{\"id\":447879488,\"method\":\"phone.getGroupCallStreamChannels\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"}],\"type\":\"phone.GroupCallStreamChannels\"},{\"id\":-558650433,\"method\":\"phone.getGroupCallStreamRtmpUrl\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"revoke\",\"type\":\"Bool\"}],\"type\":\"phone.GroupCallStreamRtmpUrl\"},{\"id\":276705696,\"method\":\"messages.searchSentMedia\",\"params\":[{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"filter\",\"type\":\"MessagesFilter\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":385663691,\"method\":\"messages.getAttachMenuBots\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"AttachMenuBots\"},{\"id\":1998676370,\"method\":\"messages.getAttachMenuBot\",\"params\":[{\"name\":\"bot\",\"type\":\"InputUser\"}],\"type\":\"AttachMenuBotsBot\"},{\"id\":1777704297,\"method\":\"messages.toggleBotInAttachMenu\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"write_allowed\",\"type\":\"flags.0?true\"},{\"name\":\"bot\",\"type\":\"InputUser\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":395003915,\"method\":\"messages.requestWebView\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"from_bot_menu\",\"type\":\"flags.4?true\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"bot\",\"type\":\"InputUser\"},{\"name\":\"url\",\"type\":\"flags.1?string\"},{\"name\":\"start_param\",\"type\":\"flags.3?string\"},{\"name\":\"theme_params\",\"type\":\"flags.2?DataJSON\"},{\"name\":\"platform\",\"type\":\"string\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"top_msg_id\",\"type\":\"flags.9?int\"},{\"name\":\"send_as\",\"type\":\"flags.13?InputPeer\"}],\"type\":\"WebViewResult\"},{\"id\":2146648841,\"method\":\"messages.prolongWebView\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"bot\",\"type\":\"InputUser\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"top_msg_id\",\"type\":\"flags.9?int\"},{\"name\":\"send_as\",\"type\":\"flags.13?InputPeer\"}],\"type\":\"Bool\"},{\"id\":698084494,\"method\":\"messages.requestSimpleWebView\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"bot\",\"type\":\"InputUser\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"theme_params\",\"type\":\"flags.0?DataJSON\"},{\"name\":\"platform\",\"type\":\"string\"}],\"type\":\"SimpleWebViewResult\"},{\"id\":172168437,\"method\":\"messages.sendWebViewResultMessage\",\"params\":[{\"name\":\"bot_query_id\",\"type\":\"string\"},{\"name\":\"result\",\"type\":\"InputBotInlineResult\"}],\"type\":\"WebViewMessageSent\"},{\"id\":-603831608,\"method\":\"messages.sendWebViewData\",\"params\":[{\"name\":\"bot\",\"type\":\"InputUser\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"button_text\",\"type\":\"string\"},{\"name\":\"data\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":1157944655,\"method\":\"bots.setBotMenuButton\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"button\",\"type\":\"BotMenuButton\"}],\"type\":\"Bool\"},{\"id\":-1671369944,\"method\":\"bots.getBotMenuButton\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"BotMenuButton\"},{\"id\":-510647672,\"method\":\"account.getSavedRingtones\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"account.SavedRingtones\"},{\"id\":1038768899,\"method\":\"account.saveRingtone\",\"params\":[{\"name\":\"id\",\"type\":\"InputDocument\"},{\"name\":\"unsave\",\"type\":\"Bool\"}],\"type\":\"account.SavedRingtone\"},{\"id\":-2095414366,\"method\":\"account.uploadRingtone\",\"params\":[{\"name\":\"file\",\"type\":\"InputFile\"},{\"name\":\"file_name\",\"type\":\"string\"},{\"name\":\"mime_type\",\"type\":\"string\"}],\"type\":\"Document\"},{\"id\":2021942497,\"method\":\"bots.setBotBroadcastDefaultAdminRights\",\"params\":[{\"name\":\"admin_rights\",\"type\":\"ChatAdminRights\"}],\"type\":\"Bool\"},{\"id\":-1839281686,\"method\":\"bots.setBotGroupDefaultAdminRights\",\"params\":[{\"name\":\"admin_rights\",\"type\":\"ChatAdminRights\"}],\"type\":\"Bool\"},{\"id\":1092913030,\"method\":\"phone.saveCallLog\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"file\",\"type\":\"InputFile\"}],\"type\":\"Bool\"},{\"id\":-456419968,\"method\":\"channels.toggleJoinToSend\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":1277789622,\"method\":\"channels.toggleJoinRequest\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":261206117,\"method\":\"payments.exportInvoice\",\"params\":[{\"name\":\"invoice_media\",\"type\":\"InputMedia\"}],\"type\":\"payments.ExportedInvoice\"},{\"id\":647928393,\"method\":\"messages.transcribeAudio\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"messages.TranscribedAudio\"},{\"id\":2132608815,\"method\":\"messages.rateTranscribedAudio\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"transcription_id\",\"type\":\"long\"},{\"name\":\"good\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":-2131921795,\"method\":\"payments.assignAppStoreTransaction\",\"params\":[{\"name\":\"receipt\",\"type\":\"bytes\"},{\"name\":\"purpose\",\"type\":\"InputStorePaymentPurpose\"}],\"type\":\"Updates\"},{\"id\":-537046829,\"method\":\"payments.assignPlayMarketTransaction\",\"params\":[{\"name\":\"receipt\",\"type\":\"DataJSON\"},{\"name\":\"purpose\",\"type\":\"InputStorePaymentPurpose\"}],\"type\":\"Updates\"},{\"id\":-1614700874,\"method\":\"payments.canPurchasePremium\",\"params\":[{\"name\":\"purpose\",\"type\":\"InputStorePaymentPurpose\"}],\"type\":\"Bool\"},{\"id\":-1206152236,\"method\":\"help.getPremiumPromo\",\"params\":[],\"type\":\"help.PremiumPromo\"},{\"id\":-643100844,\"method\":\"messages.getCustomEmojiDocuments\",\"params\":[{\"name\":\"document_id\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":-67329649,\"method\":\"messages.getEmojiStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.AllStickers\"},{\"id\":248473398,\"method\":\"messages.getFeaturedEmojiStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.FeaturedStickers\"},{\"id\":-70001045,\"method\":\"account.updateEmojiStatus\",\"params\":[{\"name\":\"emoji_status\",\"type\":\"EmojiStatus\"}],\"type\":\"Bool\"},{\"id\":-696962170,\"method\":\"account.getDefaultEmojiStatuses\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"account.EmojiStatuses\"},{\"id\":257392901,\"method\":\"account.getRecentEmojiStatuses\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"account.EmojiStatuses\"},{\"id\":404757166,\"method\":\"account.clearRecentEmojiStatuses\",\"params\":[],\"type\":\"Bool\"},{\"id\":1063567478,\"method\":\"messages.reportReaction\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"reaction_peer\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-1149164102,\"method\":\"messages.getTopReactions\",\"params\":[{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Reactions\"},{\"id\":960896434,\"method\":\"messages.getRecentReactions\",\"params\":[{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Reactions\"},{\"id\":-1644236876,\"method\":\"messages.clearRecentReactions\",\"params\":[],\"type\":\"Bool\"},{\"id\":-2064119788,\"method\":\"messages.getExtendedMedia\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":767062953,\"method\":\"auth.importWebTokenAuthorization\",\"params\":[{\"name\":\"api_id\",\"type\":\"int\"},{\"name\":\"api_hash\",\"type\":\"string\"},{\"name\":\"web_auth_token\",\"type\":\"string\"}],\"type\":\"auth.Authorization\"},{\"id\":-279966037,\"method\":\"account.reorderUsernames\",\"params\":[{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":1490465654,\"method\":\"account.toggleUsername\",\"params\":[{\"name\":\"username\",\"type\":\"string\"},{\"name\":\"active\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":-1268978403,\"method\":\"channels.reorderUsernames\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":1358053637,\"method\":\"channels.toggleUsername\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"username\",\"type\":\"string\"},{\"name\":\"active\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":170155475,\"method\":\"channels.deactivateAllUsernames\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"Bool\"},{\"id\":-1540781271,\"method\":\"channels.toggleForum\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":-200539612,\"method\":\"channels.createForumTopic\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"icon_color\",\"type\":\"flags.0?int\"},{\"name\":\"icon_emoji_id\",\"type\":\"flags.3?long\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"send_as\",\"type\":\"flags.2?InputPeer\"}],\"type\":\"Updates\"},{\"id\":233136337,\"method\":\"channels.getForumTopics\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"q\",\"type\":\"flags.0?string\"},{\"name\":\"offset_date\",\"type\":\"int\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"offset_topic\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.ForumTopics\"},{\"id\":-1333584199,\"method\":\"channels.getForumTopicsByID\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"topics\",\"type\":\"Vector\"}],\"type\":\"messages.ForumTopics\"},{\"id\":-186670715,\"method\":\"channels.editForumTopic\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"topic_id\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"flags.0?string\"},{\"name\":\"icon_emoji_id\",\"type\":\"flags.1?long\"},{\"name\":\"closed\",\"type\":\"flags.2?Bool\"},{\"name\":\"hidden\",\"type\":\"flags.3?Bool\"}],\"type\":\"Updates\"},{\"id\":1814925350,\"method\":\"channels.updatePinnedForumTopic\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"topic_id\",\"type\":\"int\"},{\"name\":\"pinned\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":876830509,\"method\":\"channels.deleteTopicHistory\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"top_msg_id\",\"type\":\"int\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":693150095,\"method\":\"channels.reorderPinnedForumTopics\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"force\",\"type\":\"flags.0?true\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":1760814315,\"method\":\"channels.toggleAntiSpam\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":-1471109485,\"method\":\"channels.reportAntiSpamFalsePositive\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":-1632299963,\"method\":\"messages.setDefaultHistoryTTL\",\"params\":[{\"name\":\"period\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":1703637384,\"method\":\"messages.getDefaultHistoryTTL\",\"params\":[],\"type\":\"DefaultHistoryTTL\"},{\"id\":-127582169,\"method\":\"contacts.exportContactToken\",\"params\":[],\"type\":\"ExportedContactToken\"},{\"id\":318789512,\"method\":\"contacts.importContactToken\",\"params\":[{\"name\":\"token\",\"type\":\"string\"}],\"type\":\"User\"},{\"id\":-515093903,\"method\":\"photos.uploadContactProfilePhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"suggest\",\"type\":\"flags.3?true\"},{\"name\":\"save\",\"type\":\"flags.4?true\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"file\",\"type\":\"flags.0?InputFile\"},{\"name\":\"video\",\"type\":\"flags.1?InputFile\"},{\"name\":\"video_start_ts\",\"type\":\"flags.2?double\"},{\"name\":\"video_emoji_markup\",\"type\":\"flags.5?VideoSize\"}],\"type\":\"photos.Photo\"},{\"id\":1785624660,\"method\":\"channels.toggleParticipantsHidden\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":-29831141,\"method\":\"messages.sendBotRequestedPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"button_id\",\"type\":\"int\"},{\"name\":\"requested_peer\",\"type\":\"InputPeer\"}],\"type\":\"Updates\"},{\"id\":-495647960,\"method\":\"account.getDefaultProfilePhotoEmojis\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"EmojiList\"},{\"id\":-1856479058,\"method\":\"account.getDefaultGroupPhotoEmojis\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"EmojiList\"},{\"id\":-1991881904,\"method\":\"auth.requestFirebaseSms\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"safety_net_token\",\"type\":\"flags.0?string\"},{\"name\":\"ios_push_secret\",\"type\":\"flags.1?string\"}],\"type\":\"Bool\"},{\"id\":1955122779,\"method\":\"messages.getEmojiGroups\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.EmojiGroups\"},{\"id\":785209037,\"method\":\"messages.getEmojiStatusGroups\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.EmojiGroups\"},{\"id\":564480243,\"method\":\"messages.getEmojiProfilePhotoGroups\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.EmojiGroups\"},{\"id\":739360983,\"method\":\"messages.searchCustomEmoji\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"EmojiList\"},{\"id\":-461589127,\"method\":\"messages.togglePeerTranslations\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"disabled\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-1379156774,\"method\":\"account.getAutoSaveSettings\",\"params\":[],\"type\":\"account.AutoSaveSettings\"},{\"id\":-694451359,\"method\":\"account.saveAutoSaveSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"users\",\"type\":\"flags.0?true\"},{\"name\":\"chats\",\"type\":\"flags.1?true\"},{\"name\":\"broadcasts\",\"type\":\"flags.2?true\"},{\"name\":\"peer\",\"type\":\"flags.3?InputPeer\"},{\"name\":\"settings\",\"type\":\"AutoSaveSettings\"}],\"type\":\"Bool\"},{\"id\":1404829728,\"method\":\"account.deleteAutoSaveExceptions\",\"params\":[],\"type\":\"Bool\"}]},\"layer\":152} as {\n MTProto: {\n constructors: MTProtoConstructor[],\n methods: MTProtoMethod[],\n constructorsIndex?: {[id: number]: number}\n },\n API: {\n constructors: MTProtoConstructor[],\n methods: MTProtoMethod[],\n constructorsIndex?: {[id: number]: number}\n },\n layer: number,\n};\n","export default function intToUint(val: number) {\n // return val < 0 ? val + 4294967296 : val; // 0 <= val <= Infinity\n return val >>> 0; // (4294967296 >>> 0) === 0; 0 <= val <= 4294967295\n}\n","import bigInt from 'big-integer';\nimport intToUint from '../number/intToUint';\n\nexport default function ulongFromInts(high: number, low: number) {\n high = intToUint(high), low = intToUint(low);\n return bigInt(high).shiftLeft(32).add(bigInt(low));\n}\n","import bigInt from 'big-integer';\n\nexport const safeBigInt = bigInt(Number.MAX_SAFE_INTEGER);\nexport const ulongBigInt = bigInt(bigInt[2]).pow(64);\nexport const longBigInt = ulongBigInt.divide(bigInt[2]);\n","import bigInt from 'big-integer';\nimport { longBigInt, ulongBigInt } from './bigIntConstants';\n\nexport function bigIntFromBytes(bytes: Uint8Array | number[], base = 256) {\n return bigInt.fromArray(bytes instanceof Uint8Array ? [...bytes] : bytes, base);\n}\n\nexport function bigIntToBytes(bigInt: bigInt.BigInteger) {\n return new Uint8Array(bigInt.toArray(256).value);\n}\n\nexport function bigIntToSigned(bigInt: bigInt.BigInteger) {\n return bigInt.greater(longBigInt) ? bigInt.minus(ulongBigInt) : bigInt;\n}\n\nexport function bigIntToUnsigned(bigInt: bigInt.BigInteger) {\n return bigInt.isNegative() ? ulongBigInt.add(bigInt) : bigInt;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport Schema, {MTProtoConstructor} from './schema';\nimport {JSONValue} from '../../layer';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport bytesToHex from '../../helpers/bytes/bytesToHex';\nimport isObject from '../../helpers/object/isObject';\nimport gzipUncompress from '../../helpers/gzipUncompress';\nimport bigInt from 'big-integer';\nimport ulongFromInts from '../../helpers/long/ulongFromInts';\nimport {safeBigInt} from '../../helpers/bigInt/bigIntConstants';\nimport {bigIntToSigned, bigIntToUnsigned} from '../../helpers/bigInt/bigIntConversion';\n\nconst boolFalse = +Schema.API.constructors.find((c) => c.predicate === 'boolFalse').id;\nconst boolTrue = +Schema.API.constructors.find((c) => c.predicate === 'boolTrue').id;\nconst vector = +Schema.API.constructors.find((c) => c.predicate === 'vector').id;\nconst gzipPacked = +Schema.MTProto.constructors.find((c) => c.predicate === 'gzip_packed').id;\n\n// * using slice to have a new buffer, otherwise the buffer will be copied to main thread\nconst sliceMethod: 'slice' | 'subarray' = 'slice'; // subarray\n\nclass TLSerialization {\n private maxLength = 2048; // 2Kb\n private offset = 0; // in bytes\n private mtproto = false;\n private debug = false;// Modes.debug;\n\n private buffer: ArrayBuffer;\n private intView: Int32Array;\n private byteView: Uint8Array;\n\n constructor(options: Partial<{startMaxLength: number, mtproto: true}> = {}) {\n this.maxLength = options.startMaxLength || 2048; // 2Kb\n this.mtproto = options.mtproto || false;\n this.createBuffer();\n }\n\n public createBuffer() {\n this.buffer = new ArrayBuffer(this.maxLength);\n this.intView = new Int32Array(this.buffer);\n this.byteView = new Uint8Array(this.buffer);\n }\n\n public getArray() {\n const resultBuffer = new ArrayBuffer(this.offset);\n\n // let perf = performance.now();\n /* const resultUint8: any = new Uint8Array(resultBuffer);\n resultUint8.set(this.byteView.subarray(0, this.offset)); */\n // console.log('perf uint8', performance.now() - perf);\n\n // perf = performance.now();\n const resultInt32 = new Int32Array(resultBuffer);\n resultInt32.set(this.intView.subarray(0, this.offset / 4));\n // console.log('perf int32', performance.now() - perf);\n\n /* if(resultUint8.buffer.byteLength !== resultInt32.buffer.byteLength) {\n console.error(resultUint8, resultInt32);\n } */\n\n return resultInt32;\n }\n\n public getBuffer() {\n return this.getArray().buffer;\n }\n\n public getBytes(typed: true): Uint8Array;\n public getBytes(typed?: false): number[];\n public getBytes(typed: boolean = true): number[] | Uint8Array {\n if(typed) {\n const resultBuffer = new ArrayBuffer(this.offset);\n const resultArray = new Uint8Array(resultBuffer);\n\n resultArray.set(this.byteView.subarray(0, this.offset));\n\n return resultArray;\n }\n\n const bytes: number[] = new Array(this.offset);\n for(let i = 0; i < this.offset; ++i) {\n bytes[i] = this.byteView[i];\n }\n return bytes;\n }\n\n public getOffset() {\n return this.offset;\n }\n\n public checkLength(needBytes: number) {\n if(this.offset + needBytes < this.maxLength) {\n return;\n }\n\n // console.log('Increase buffer start', this.offset, needBytes, this.maxLength, this.byteView.slice(0, 32));\n this.maxLength = Math.ceil(Math.max(this.maxLength * 2, this.offset + needBytes + 16) / 4) * 4;\n const previousBuffer = this.buffer;\n // const previousByteView = this.byteView;\n const previousArray = new Int32Array(previousBuffer);\n\n this.createBuffer();\n\n new Int32Array(this.buffer).set(previousArray);\n /* console.log('Increase buffer end', this.offset, needBytes, this.maxLength, this.byteView.slice(0, 32),\n bytesCmp(previousByteView, this.byteView.slice(0, previousByteView.length))); */\n }\n\n public writeInt(i: number, field: string) {\n this.debug && console.log('>>>', i.toString(16), i, field);\n\n const offset = this.offset / 4;\n this.checkLength(4);\n this.intView[offset] = i;\n this.offset += 4;\n\n return offset;\n }\n\n public storeInt(i: number, field?: string) {\n return this.writeInt(i, (field || '') + ':int');\n }\n\n public storeBool(i: boolean, field?: string) {\n if(i) {\n this.writeInt(boolTrue, (field || '') + ':bool');\n } else {\n this.writeInt(boolFalse, (field || '') + ':bool');\n }\n }\n\n public storeLongP(iHigh: number, iLow: number, field?: string) {\n this.writeInt(iLow, (field || '') + ':long[low]');\n this.writeInt(iHigh, (field || '') + ':long[high]');\n }\n\n public storeLong(sLong: Array | string | number, field?: string) {\n if(Array.isArray(sLong)) {\n if(sLong.length === 2) {\n return this.storeLongP(sLong[0], sLong[1], field);\n } else {\n return this.storeIntBytes(sLong, 64, field);\n }\n }\n\n const _bigInt = bigIntToUnsigned(bigInt(sLong as string));\n const {quotient, remainder} = _bigInt.divmod(0x100000000);\n const high = quotient.toJSNumber();\n const low = remainder.toJSNumber();\n\n this.writeInt(low, (field || '') + ':long[low]');\n this.writeInt(high, (field || '') + ':long[high]');\n }\n\n public storeDouble(f: any, field?: string) {\n const buffer = new ArrayBuffer(8);\n const intView = new Int32Array(buffer);\n const doubleView = new Float64Array(buffer);\n\n doubleView[0] = f;\n\n this.writeInt(intView[0], (field || '') + ':double[low]');\n this.writeInt(intView[1], (field || '') + ':double[high]');\n }\n\n public storeString(s: string, field?: string) {\n this.debug && console.log('>>>', s, (field || '') + ':string');\n\n if(s === undefined) {\n s = '';\n }\n const sUTF8 = unescape(encodeURIComponent(s));\n\n this.checkLength(sUTF8.length + 8);\n\n const len = sUTF8.length;\n if(len <= 253) {\n this.byteView[this.offset++] = len;\n } else {\n this.byteView[this.offset++] = 254;\n this.byteView[this.offset++] = len & 0xFF;\n this.byteView[this.offset++] = (len & 0xFF00) >> 8;\n this.byteView[this.offset++] = (len & 0xFF0000) >> 16;\n }\n for(let i = 0; i < len; ++i) {\n this.byteView[this.offset++] = sUTF8.charCodeAt(i);\n }\n\n // Padding\n while(this.offset % 4) {\n this.byteView[this.offset++] = 0;\n }\n }\n\n public storeBytes(bytes: ArrayBuffer | Uint8Array | number[], field?: string) {\n if(bytes instanceof ArrayBuffer) {\n bytes = new Uint8Array(bytes);\n } else if(bytes === undefined) {\n bytes = [];\n }\n\n this.debug && console.log('>>>', bytesToHex(bytes as number[]), (field || '') + ':bytes');\n\n // if uint8array was json.stringified, then will be: {'0': 123, '1': 123}\n const len = (bytes as Uint8Array).length;\n this.checkLength(len + 8);\n if(len <= 253) {\n this.byteView[this.offset++] = len;\n } else {\n this.byteView[this.offset++] = 254;\n this.byteView[this.offset++] = len & 0xFF;\n this.byteView[this.offset++] = (len & 0xFF00) >> 8;\n this.byteView[this.offset++] = (len & 0xFF0000) >> 16;\n }\n\n this.byteView.set(bytes as Uint8Array, this.offset);\n this.offset += len;\n\n // Padding\n while(this.offset % 4) {\n this.byteView[this.offset++] = 0;\n }\n }\n\n public storeIntBytes(bytes: ArrayBuffer | Uint8Array | number[], bits: number, field?: string) {\n if(bytes instanceof ArrayBuffer) {\n bytes = new Uint8Array(bytes);\n }\n\n const len = (bytes as Uint8Array).length;\n if((bits % 32) || (len * 8) !== bits) {\n const error = new Error('Invalid bits: ' + bits + ', ' + len);\n console.error(error, bytes, field);\n throw error;\n }\n\n this.debug && console.log('>>>', bytesToHex(bytes as Uint8Array), (field || '') + ':int' + bits);\n this.checkLength(len);\n\n this.byteView.set(bytes as Uint8Array, this.offset);\n this.offset += len;\n }\n\n public storeRawBytes(bytes: ArrayLike, field?: string) {\n if(bytes instanceof ArrayBuffer) {\n bytes = new Uint8Array(bytes);\n }\n\n const len = bytes.length;\n\n this.debug && console.log('>>>', bytesToHex(bytes), (field || ''));\n this.checkLength(len);\n\n this.byteView.set(bytes, this.offset);\n this.offset += len;\n }\n\n public storeMethod(methodName: string, params: any) {\n const schema = this.mtproto ? Schema.MTProto : Schema.API;\n const methodData = schema.methods.find((m) => m.method === methodName);\n\n if(!methodData) {\n throw new Error('No method ' + methodName + ' found');\n }\n\n this.storeInt(methodData.id, methodName + '[id]');\n\n const pFlags = params.pFlags || params; // * support pFlags, though am not expecting it to be there\n const flagsOffsets: {[paramName: string]: number} = {};\n // console.log('storeMethod', len, methodData);\n for(const param of methodData.params) {\n let type = param.type;\n\n if(type.indexOf('?') !== -1) {\n const condType = type.split('?');\n const fieldBit = condType[0].split('.');\n\n if(!(params[fieldBit[0]] & (1 << +fieldBit[1]))) {\n if(condType[1] === 'true' ? pFlags[param.name] : params[param.name] !== undefined) {\n // console.log('storeMethod autocompleting', methodName, param.name, params[param.name], type);\n params[fieldBit[0]] |= 1 << +fieldBit[1];\n } else {\n continue;\n }\n }\n\n // console.log('storeMethod', methodName, fieldBit, params[fieldBit[0]], params, param, condType, !!(params[fieldBit[0]] & (1 << +fieldBit[1])));\n type = condType[1];\n }\n\n // console.log('storeMethod', methodName, param.name, params[param.name], type);\n const result = this.storeObject(params[param.name], type, methodName + '[' + param.name + ']');\n\n if(type === '#') {\n params[param.name] = params[param.name] || 0;\n flagsOffsets[param.name] = result as number;\n }\n }\n\n for(const paramName in flagsOffsets) {\n this.intView[flagsOffsets[paramName]] = params[paramName];\n }\n\n return methodData.type;\n }\n\n public storeObject(obj: any, type: string, field?: string) {\n // console.log('storeObject', obj, type, field, this.offset, this.getBytes(true).hex);\n switch(type) {\n case '#':\n obj = obj || 0;\n case 'int':\n return this.storeInt(obj, field);\n case 'long':\n return this.storeLong(obj, field);\n case 'int128':\n return this.storeIntBytes(obj, 128, field);\n case 'int256':\n return this.storeIntBytes(obj, 256, field);\n case 'int512':\n return this.storeIntBytes(obj, 512, field);\n case 'string':\n return this.storeString(obj, field);\n case 'bytes':\n return this.storeBytes(obj, field);\n case 'double':\n return this.storeDouble(obj, field);\n case 'Bool':\n return this.storeBool(obj, field);\n case 'true':\n return\n }\n\n if(Array.isArray(obj)) {\n if(type.substr(0, 6) === 'Vector') {\n this.writeInt(vector, field + '[id]');\n } else if(type.substr(0, 6) !== 'vector') {\n throw new Error('Invalid vector type ' + type);\n }\n\n const itemType = type.substr(7, type.length - 8); // for \"Vector\"\n this.writeInt(obj.length, field + '[count]');\n for(let i = 0; i < obj.length; ++i) {\n this.storeObject(obj[i], itemType, field + '[' + i + ']');\n }\n\n return true;\n } else if(type.substr(0, 6).toLowerCase() === 'vector') {\n throw new Error('Invalid vector object');\n }\n\n if(!isObject(obj)) {\n throw new Error('Invalid object for type ' + type);\n }\n\n const schema = this.mtproto ? Schema.MTProto : Schema.API;\n const predicate = obj['_'];\n let isBare = false;\n const constructorData: MTProtoConstructor = schema.constructors.find((c) => c.predicate === predicate);\n\n if(isBare = (type.charAt(0) === '%')) {\n type = type.substr(1);\n }\n\n if(!constructorData) {\n throw new Error('No predicate ' + predicate + ' found');\n }\n\n if(predicate === type) {\n isBare = true;\n }\n\n if(!isBare) {\n this.writeInt(constructorData.id, field + '[' + predicate + '][id]');\n }\n\n const pFlags = obj.pFlags;\n const flagsOffsets: {[paramName: string]: number} = {};\n // console.log('storeObject', len, constructorData);\n for(const param of constructorData.params) {\n let type = param.type;\n\n // console.log('storeObject', param, type);\n if(type.indexOf('?') !== -1) {\n const condType = type.split('?');\n const fieldBit = condType[0].split('.');\n\n // console.log('storeObject fieldBit', fieldBit, obj[fieldBit[0]]);\n\n if(!(obj[fieldBit[0]] & (1 << +fieldBit[1]))) {\n if(condType[1] === 'true' ? pFlags && pFlags[param.name] : obj[param.name] !== undefined) {\n // console.log('storeObject autocompleting', param.name, obj[param.name], type);\n obj[fieldBit[0]] |= 1 << +fieldBit[1];\n } else {\n continue;\n }\n }\n\n type = condType[1];\n }\n // console.log('storeObject', param, type);\n\n const result = this.storeObject(obj[param.name], type, field + '[' + predicate + '][' + param.name + ']');\n\n if(type === '#') {\n obj[param.name] = obj[param.name] || 0;\n flagsOffsets[param.name] = result as number;\n }\n }\n\n for(const paramName in flagsOffsets) {\n this.intView[flagsOffsets[paramName]] = obj[paramName];\n }\n\n return constructorData.type;\n }\n}\n\nclass TLDeserialization {\n private offset = 0; // in bytes\n private override: {[key: string]: (result: any, field: string) => void};\n\n private buffer: ArrayBuffer;\n private intView: Int32Array;\n private byteView: Uint8Array;\n\n // this.debug =\n private mtproto: boolean = false;\n private debug: boolean;\n\n constructor(buffer: ArrayBuffer | Uint8Array, options: Partial<{override: any, mtproto: true, debug: true}> = {}) {\n // buffer = addPadding(buffer, 4, true); // fix 21.01.2020 for wss\n if(buffer instanceof ArrayBuffer) {\n this.buffer = buffer;\n this.intView = new Int32Array(buffer);\n this.byteView = new Uint8Array(this.buffer);\n } else {\n this.buffer = buffer.buffer;\n this.intView = new Int32Array(buffer.buffer);\n this.byteView = buffer;\n }\n\n // console.log(this.intView);\n\n this.override = options.override || {};\n this.mtproto = !!options.mtproto;\n this.debug = options.debug !== undefined ? options.debug : /* Modes.debug */false;\n }\n\n /* public setMtproto(mtproto: boolean) {\n this.mtproto = mtproto;\n } */\n\n private readInt(field: string) {\n // if(this.offset >= this.intView.length * 4) {\n if((this.byteView.length - this.offset) < 4) {\n console.error(this.byteView, this.offset);\n throw new Error('Nothing to fetch: ' + field);\n }\n\n const i = this.intView[this.offset / 4];\n // const i = new Uint32Array(this.byteView.buffer.slice(this.offset, this.offset + 4))[0];\n\n this.debug &&/* || field.includes('[dialog][read_outbox_max_id]') */\n console.log('<<<', i.toString(16), i, field,\n this.byteView.slice(this.offset - 16, this.offset + 16),\n bytesToHex(this.byteView.slice(this.offset - 16, this.offset + 16)));\n\n this.offset += 4;\n\n return i;\n }\n\n public fetchInt(field?: string) {\n return this.readInt((field || '') + ':int');\n }\n\n public fetchDouble(field?: string) {\n const buffer = new ArrayBuffer(8);\n const intView = new Int32Array(buffer);\n const doubleView = new Float64Array(buffer);\n\n intView[0] = this.readInt((field || '') + ':double[low]'),\n intView[1] = this.readInt((field || '') + ':double[high]');\n\n return doubleView[0];\n }\n\n // ! it should've been signed\n public fetchLong(field?: string): FetchLongAs {\n const iLow = this.readInt((field || '') + ':long[low]');\n const iHigh = this.readInt((field || '') + ':long[high]');\n\n let ulong = ulongFromInts(iHigh, iLow);\n if(/* !unsigned && */!this.mtproto) { // make it signed\n ulong = bigIntToSigned(ulong);\n }\n\n if(!this.mtproto) {\n if(safeBigInt.greaterOrEquals(ulong.abs())) {\n // @ts-ignore\n return ulong.toJSNumber();\n }\n }\n\n // @ts-ignore\n return ulong.toString(10);\n }\n\n public fetchBool(field?: string): boolean {\n const i = this.readInt((field || '') + ':bool');\n if(i === boolTrue) {\n return true;\n } else if(i === boolFalse) {\n return false;\n }\n\n this.offset -= 4;\n return this.fetchObject('Object', field);\n }\n\n public fetchString(field?: string): string {\n let len = this.byteView[this.offset++];\n\n if(len === 254) {\n len = this.byteView[this.offset++] |\n (this.byteView[this.offset++] << 8) |\n (this.byteView[this.offset++] << 16);\n }\n\n let sUTF8 = '';\n for(let i = 0; i < len; ++i) {\n sUTF8 += String.fromCharCode(this.byteView[this.offset++]);\n }\n\n // Padding\n while(this.offset % 4) {\n ++this.offset;\n }\n\n let s: string;\n try {\n s = decodeURIComponent(escape(sUTF8));\n } catch(e) {\n s = sUTF8;\n }\n\n this.debug && console.log('<<<', s, (field || '') + ':string');\n\n return s;\n }\n\n public fetchBytes(field?: string) {\n let len = this.byteView[this.offset++];\n\n if(len === 254) {\n len = this.byteView[this.offset++] |\n (this.byteView[this.offset++] << 8) |\n (this.byteView[this.offset++] << 16);\n }\n\n const bytes = this.byteView[sliceMethod](this.offset, this.offset + len);\n this.offset += len;\n\n // Padding\n while(this.offset % 4) {\n ++this.offset;\n }\n\n this.debug && console.log('<<<', bytesToHex(bytes), (field || '') + ':bytes');\n\n return bytes;\n }\n\n public fetchIntBytes(bits: number, typed: true, field?: string): Uint8Array;\n public fetchIntBytes(bits: number, typed?: false, field?: string): number[];\n public fetchIntBytes(bits: number, typed: boolean = true, field?: string) {\n if(bits % 32) {\n throw new Error('Invalid bits: ' + bits);\n }\n\n const len = bits / 8;\n if(typed) {\n const result = this.byteView[sliceMethod](this.offset, this.offset + len);\n this.offset += len;\n return result;\n }\n\n const bytes: number[] = new Array(len);\n for(let i = 0; i < len; ++i) {\n bytes[i] = this.byteView[this.offset++];\n }\n\n this.debug && console.log('<<<', bytesToHex(bytes), (field || '') + ':int' + bits);\n\n return bytes;\n }\n\n public fetchRawBytes(len: number | false, typed: true, field: string): Uint8Array;\n public fetchRawBytes(len: number | false, typed: false, field: string): number[];\n public fetchRawBytes(len: number | false, typed: boolean = true, field: string) {\n if(len === false) {\n len = this.readInt((field || '') + '_length');\n if(len > this.byteView.byteLength) {\n throw new Error('Invalid raw bytes length: ' + len + ', buffer len: ' + this.byteView.byteLength);\n }\n }\n\n if(typed) {\n const bytes = new Uint8Array(len);\n bytes.set(this.byteView[sliceMethod](this.offset, this.offset + len));\n this.offset += len;\n return bytes;\n }\n\n const bytes: number[] = new Array(len);\n for(let i = 0; i < len; ++i) {\n bytes[i] = this.byteView[this.offset++];\n }\n\n this.debug && console.log('<<<', bytesToHex(bytes), (field || ''));\n\n return bytes;\n }\n\n private fetchVector(type: string, field?: string) {\n const len = this.readInt(field + '[count]');\n const result: any[] = new Array(len);\n if(len > 0) {\n const itemType = type.substr(7, type.length - 8); // for \"Vector\"\n for(let i = 0; i < len; ++i) {\n result[i] = this.fetchObject(itemType, field + '[' + i + ']');\n }\n }\n\n return result;\n }\n\n public fetchObject(type: string, field?: string): any {\n switch(type) {\n case '#':\n case 'int':\n return this.fetchInt(field);\n case 'long':\n return this.fetchLong(field);\n case 'int128':\n return this.fetchIntBytes(128, true, field);\n case 'int256':\n return this.fetchIntBytes(256, true, field);\n case 'int512':\n return this.fetchIntBytes(512, true, field);\n case 'string':\n return this.fetchString(field);\n case 'bytes':\n return this.fetchBytes(field);\n case 'double':\n return this.fetchDouble(field);\n case 'Bool':\n return this.fetchBool(field);\n case 'true':\n return true;\n }\n\n field = field || type || 'Object';\n\n if(type.charAt(0) === 'v' && type.substr(1, 5) === 'ector') {\n return this.fetchVector(type, field);\n }\n\n const schema = this.mtproto ? Schema.MTProto : Schema.API;\n let constructorData: MTProtoConstructor = null;\n let fallback = false;\n\n if(type.charAt(0) === '%') {\n const checkType = type.substr(1);\n constructorData = schema.constructors.find((c) => c.type === checkType);\n if(!constructorData) {\n throw new Error('Constructor not found for type: ' + type);\n }\n }/* else if(type.charAt(0) >= 97 && type.charAt(0) <= 122) {\n constructorData = schema.constructors.find((c) => c.predicate === type);\n if(!constructorData) {\n throw new Error('Constructor not found for predicate: ' + type);\n }\n } */ else {\n const constructorCmp = this.readInt(field + '[id]');\n\n if(constructorCmp === gzipPacked) { // Gzip packed\n const compressed = this.fetchBytes(field + '[packed_string]');\n const uncompressed = gzipUncompress(compressed) as Uint8Array;\n const newDeserializer = new TLDeserialization(uncompressed); // rpc_result is packed here\n\n return newDeserializer.fetchObject(type, field);\n }\n\n if(constructorCmp === vector) {\n return this.fetchVector(type, field);\n }\n\n let index = schema.constructorsIndex;\n if(!index) {\n schema.constructorsIndex = index = {};\n for(let i = 0, len = schema.constructors.length; i < len; ++i) {\n index[schema.constructors[i].id] = i;\n }\n }\n\n const i = index[constructorCmp];\n if(i !== undefined) {\n constructorData = schema.constructors[i];\n }\n\n if(!constructorData && this.mtproto) {\n const schemaFallback = Schema.API;\n for(let i = 0, len = schemaFallback.constructors.length; i < len; ++i) {\n if(+schemaFallback.constructors[i].id === constructorCmp) {\n constructorData = schemaFallback.constructors[i];\n\n delete this.mtproto;\n fallback = true;\n break;\n }\n }\n }\n\n if(!constructorData) {\n console.error('Constructor not found:', constructorCmp);\n\n let int1: number, int2: number;\n try {\n int1 = this.fetchInt(field);\n int2 = this.fetchInt(field);\n } catch(err) {\n\n }\n\n throw new Error('Constructor not found: ' + constructorCmp + ' ' + int1 + ' ' + int2 + ' ' + field);\n }\n }\n\n const predicate = constructorData.predicate;\n\n const result: any = {'_': predicate};\n const overrideKey = (this.mtproto ? 'mt_' : '') + predicate;\n if(this.override[overrideKey]) {\n this.override[overrideKey](result, field + '[' + predicate + ']');\n } else {\n for(let i = 0, len = constructorData.params.length; i < len; ++i) {\n const param = constructorData.params[i];\n let type = param.type;\n\n if(type === '#' && result.pFlags === undefined) {\n result.pFlags = {};\n }\n\n const isCond = type.indexOf('?') !== -1;\n if(isCond) {\n const condType = type.split('?');\n const fieldBit = condType[0].split('.');\n\n if(!(result[fieldBit[0]] & (1 << +fieldBit[1]))) {\n continue;\n }\n\n type = condType[1];\n }\n\n const value = this.fetchObject(type, field + '[' + predicate + '][' + param.name + ']');\n\n if(isCond && type === 'true') {\n result.pFlags[param.name] = value;\n } else {\n result[param.name] = value;\n }\n }\n }\n\n if(fallback) {\n this.mtproto = true;\n }\n\n if(type === 'JSONValue') {\n return this.formatJSONValue(result);\n }\n\n return result;\n }\n\n private formatJSONValue(jsonValue: JSONValue): any {\n if(!jsonValue._) return jsonValue;\n switch(jsonValue._) {\n case 'jsonNull':\n return null;\n case 'jsonObject': {\n const out: any = {};\n const objectValues = jsonValue.value;\n for(let i = 0, length = objectValues.length; i < length; ++i) {\n const objectValue = objectValues[i];\n out[objectValue.key] = this.formatJSONValue(objectValue.value);\n }\n return out;\n }\n default:\n return jsonValue.value;\n }\n }\n\n public getOffset() {\n return this.offset;\n }\n\n public setOffset(offset: number) {\n this.offset = offset;\n }\n\n /* public fetchEnd() {\n if(this.offset !== this.byteView.length) {\n throw new Error('Fetch end with non-empty buffer');\n }\n\n return true;\n } */\n}\n\nMOUNT_CLASS_TO.TLDeserialization = TLDeserialization;\nMOUNT_CLASS_TO.TLSerialization = TLSerialization;\nexport {TLDeserialization, TLSerialization};\n","// export function gzipUncompress(bytes: ArrayBuffer, toString: true): string;\n\n// @ts-ignore\nimport pako from 'pako/dist/pako_inflate.min.js';\n// import dT from './dT';\n\n// export function gzipUncompress(bytes: ArrayBuffer, toString?: false): Uint8Array;\nexport default function gzipUncompress(bytes: ArrayBuffer, toString?: boolean): string | Uint8Array {\n // console.log(dT(), 'Gzip uncompress start');\n const result = pako.inflate(bytes, toString ? {to: 'string'} : undefined);\n // console.log(dT(), 'Gzip uncompress finish'/* , result */);\n return result;\n}\n","import randomize from '../array/randomize';\nimport bufferConcats from './bufferConcats';\n\nexport default function addPadding(\n bytes: T,\n blockSize: number = 16,\n zeroes?: boolean,\n blockSizeAsTotalLength = false,\n prepend = false\n): T {\n const len = (bytes as ArrayBuffer).byteLength || (bytes as Uint8Array).length;\n const needPadding = blockSizeAsTotalLength ? blockSize - len : blockSize - (len % blockSize);\n if(needPadding > 0 && needPadding < blockSize) {\n // //console.log('addPadding()', len, blockSize, needPadding);\n const padding = new Uint8Array(needPadding);\n if(zeroes) {\n for(let i = 0; i < needPadding; ++i) {\n padding[i] = 0;\n }\n } else {\n randomize(padding);\n }\n\n if(bytes instanceof ArrayBuffer) {\n return (prepend ? bufferConcats(padding, bytes) : bufferConcats(bytes, padding)).buffer as T;\n } else if(bytes instanceof Uint8Array) {\n return (prepend ? bufferConcats(padding, bytes) : bufferConcats(bytes, padding)) as T;\n } else {\n // @ts-ignore\n return (prepend ? [...padding].concat(bytes) : bytes.concat([...padding])) as T;\n }\n }\n\n return bytes;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {TLDeserialization, TLSerialization} from './tl_utils';\nimport CryptoWorker from '../crypto/cryptoMessagePort';\nimport sessionStorage from '../sessionStorage';\nimport Schema from './schema';\nimport {NetworkerFactory} from './networkerFactory';\nimport {logger, LogTypes} from '../logger';\nimport {InvokeApiOptions} from '../../types';\nimport longToBytes from '../../helpers/long/longToBytes';\nimport MTTransport from './transports/transport';\nimport {nextRandomUint, randomLong} from '../../helpers/random';\nimport App from '../../config/app';\nimport DEBUG from '../../config/debug';\nimport Modes from '../../config/modes';\nimport noop from '../../helpers/noop';\n\n \nimport HTTP from './transports/http';\n \n\nimport type TcpObfuscated from './transports/tcpObfuscated';\nimport bigInt from 'big-integer';\nimport {ConnectionStatus} from './connectionStatus';\nimport ctx from '../../environment/ctx';\nimport bufferConcats from '../../helpers/bytes/bufferConcats';\nimport bytesCmp from '../../helpers/bytes/bytesCmp';\nimport bytesToHex from '../../helpers/bytes/bytesToHex';\nimport convertToUint8Array from '../../helpers/bytes/convertToUint8Array';\nimport isObject from '../../helpers/object/isObject';\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport sortLongsArray from '../../helpers/long/sortLongsArray';\nimport randomize from '../../helpers/array/randomize';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport pause from '../../helpers/schedulers/pause';\nimport {getEnvironment} from '../../environment/utils';\nimport {TimeManager} from './timeManager';\n\n// console.error('networker included!', new Error().stack);\n\nexport type MTMessageOptions = InvokeApiOptions & Partial<{\n noResponse: true, // http_wait\n longPoll: true,\n\n notContentRelated: true, // ACK\n noSchedule: true,\n // withResult: true,\n messageId: MTLong,\n}>;\n\nexport type MTMessage = InvokeApiOptions & MTMessageOptions & {\n msg_id: MTLong,\n seq_no: number,\n body?: Uint8Array | number[],\n isAPI?: boolean,\n // only these four are important\n\n acked?: boolean,\n\n deferred?: CancellablePromise,\n\n container?: boolean,\n inner?: MTLong[],\n\n // below - options\n\n notContentRelated?: true,\n noSchedule?: true,\n\n resultType?: string,\n\n longPoll?: true,\n noResponse?: true, // only with http (http_wait for longPoll)\n};\n\nconst DRAIN_TIMEOUT = 10000;\nconst delays: {\n [k in 'client' | 'file']: {\n disconnectDelayMin: number,\n disconnectDelayMax: number,\n pingInterval: number,\n pingMaxTime: number,\n connectionTimeout: number\n }\n} = {\n client: {\n disconnectDelayMin: 7,\n disconnectDelayMax: 20,\n pingInterval: 2000,\n pingMaxTime: 5,\n connectionTimeout: 5000\n },\n file: {\n disconnectDelayMin: 10,\n disconnectDelayMax: 24,\n pingInterval: 3000,\n pingMaxTime: 7,\n connectionTimeout: 7500\n }\n};\nconst RESEND_OPTIONS: MTMessageOptions = {\n noSchedule: true,\n notContentRelated: true\n};\nlet invokeAfterMsgConstructor: number;\nlet networkerTempId = 0;\n\nexport default class MTPNetworker {\n private authKeyUint8: Uint8Array;\n\n public isFileNetworker: boolean;\n private isFileUpload: boolean;\n private isFileDownload: boolean;\n\n private lastServerMessages: Array = [];\n\n private sentMessages: {\n [msgId: MTLong]: MTMessage\n } = {};\n\n private pendingMessages: {[msgId: MTLong]: number} = {};\n private pendingAcks: Array = [];\n private pendingResendReq: MTLong[] = [];\n // private pendingResendAnsReq: MTLong[] = [];\n public connectionInited: boolean;\n\n private nextReqTimeout: number;\n private nextReq: number = 0;\n\n \n private longPollInterval: number;\n private longPollPending: number;\n private checkConnectionRetryAt: number;\n private checkConnectionTimeout: number;\n private checkConnectionPeriod = 0;\n private sleepAfter: number;\n private offline = false;\n private sendingLongPoll: boolean;\n \n\n private seqNo: number;\n private prevSessionId: Uint8Array;\n private sessionId: Uint8Array;\n private serverSalt: Uint8Array;\n\n private lastResendReq: {\n reqMsgId: MTLong,\n msgIds: MTPNetworker['pendingResendReq']\n };\n // private lastResendAnsReq: MTPNetworker['lastResendReq'];\n\n private name: string;\n private log: ReturnType;\n\n public isOnline = false;\n private status: ConnectionStatus = ConnectionStatus.Closed;\n private lastResponseTime = 0;\n\n private debug = DEBUG /* && false */ || Modes.debug;\n\n public activeRequests = 0;\n\n public onDrain: () => void;\n private onDrainTimeout: number;\n\n public transport: MTTransport;\n\n \n private pingDelayDisconnectDeferred: CancellablePromise;\n private pingPromise: Promise;\n // private pingInterval: number;\n private lastPingTime: number;\n private lastPingStartTime: number;\n private lastPingDelayDisconnectId: string;\n \n // public onConnectionStatusChange: (online: boolean) => void;\n\n // private debugRequests: Array<{before: Uint8Array, after: Uint8Array}> = [];\n\n private delays: typeof delays[keyof typeof delays];\n // private getNewTimeOffset: boolean;\n\n constructor(\n private networkerFactory: NetworkerFactory,\n private timeManager: TimeManager,\n public dcId: number,\n private authKey: Uint8Array,\n private authKeyId: Uint8Array,\n serverSalt: Uint8Array,\n options: InvokeApiOptions = {}\n ) {\n this.authKeyUint8 = convertToUint8Array(this.authKey);\n this.serverSalt = convertToUint8Array(serverSalt);\n\n this.isFileUpload = !!options.fileUpload;\n this.isFileDownload = !!options.fileDownload;\n this.isFileNetworker = this.isFileUpload || this.isFileDownload;\n this.delays = this.isFileNetworker ? delays.file : delays.client;\n\n const suffix = this.isFileUpload ? '-U' : this.isFileDownload ? '-D' : '';\n this.name = 'NET-' + dcId + suffix;\n // this.log = logger(this.name, this.upload && this.dcId === 2 ? LogLevels.debug | LogLevels.warn | LogLevels.log | LogLevels.error : LogLevels.error);\n this.log = logger(this.name + (suffix ? '' : '-C') + '-' + networkerTempId++, LogTypes.Log/* | LogTypes.Debug */ | LogTypes.Error | LogTypes.Warn);\n this.log('constructor'/* , this.authKey, this.authKeyID, this.serverSalt */);\n\n // Test resend after bad_server_salt\n /* if(this.dcId === 2 && this.upload) {\n //timeManager.applyServerTime((Date.now() / 1000 - 86400) | 0);\n this.serverSalt[0] = 0;\n } */\n\n this.updateSession();\n\n // if(!NetworkerFactory.offlineInited) {\n // NetworkerFactory.offlineInited = true;\n // /* rootScope.offline = true\n // rootScope.offlineConnecting = true */\n // }\n }\n\n private updateSession() {\n this.seqNo = 0;\n this.prevSessionId = this.sessionId;\n this.sessionId = randomize(new Uint8Array(8));\n }\n\n /* private clearContainers() {\n for(const messageId in this.sentMessages) {\n const message = this.sentMessages[messageId];\n if(message.container) {\n delete this.sentMessages[messageId];\n }\n }\n } */\n\n private updateSentMessage(sentMessageId: string) {\n const sentMessage = this.sentMessages[sentMessageId];\n if(!sentMessage) {\n return false;\n }\n\n if(sentMessage.container) {\n forEachReverse(sentMessage.inner, (innerSentMessageId, idx) => {\n const innerSentMessage = this.updateSentMessage(innerSentMessageId);\n if(!innerSentMessage) {\n sentMessage.inner.splice(idx, 1);\n } else {\n sentMessage.inner[idx] = innerSentMessage.msg_id;\n }\n });\n }\n\n sentMessage.msg_id = this.timeManager.generateId();\n sentMessage.seq_no = this.generateSeqNo(sentMessage.notContentRelated || sentMessage.container);\n\n if(this.debug) {\n this.log(`updateSentMessage, old=${sentMessageId}, new=${sentMessage.msg_id}`);\n }\n\n this.sentMessages[sentMessage.msg_id] = sentMessage;\n delete this.sentMessages[sentMessageId];\n\n return sentMessage;\n }\n\n private generateSeqNo(notContentRelated?: boolean) {\n let seqNo = this.seqNo * 2;\n\n if(!notContentRelated) {\n seqNo++;\n this.seqNo++;\n }\n\n return seqNo;\n }\n\n public wrapMtpCall(method: string, params: any, options: MTMessageOptions) {\n const serializer = new TLSerialization({mtproto: true});\n\n serializer.storeMethod(method, params);\n\n const messageId = this.timeManager.generateId();\n const seqNo = this.generateSeqNo();\n const message = {\n msg_id: messageId,\n seq_no: seqNo,\n body: serializer.getBytes(true)\n };\n\n if(Modes.debug) {\n this.log('MT call', method, params, messageId, seqNo);\n }\n\n return this.pushMessage(message, options);\n }\n\n public wrapMtpMessage(object: any, options: MTMessageOptions) {\n const serializer = new TLSerialization({mtproto: true});\n serializer.storeObject(object, 'Object');\n\n const messageId = this.timeManager.generateId();\n const seqNo = this.generateSeqNo(options.notContentRelated);\n const message = {\n msg_id: messageId,\n seq_no: seqNo,\n body: serializer.getBytes(true)\n };\n\n if(Modes.debug) {\n this.log('MT message', object, messageId, seqNo);\n }\n\n return this.pushMessage(message, options);\n }\n\n public wrapApiCall(method: string, params: any = {}, options: InvokeApiOptions = {}) {\n const serializer = new TLSerialization(options);\n\n if(!this.connectionInited) { // this will call once for each new session\n // /////this.log('Wrap api call !this.connectionInited');\n\n const invokeWithLayer = Schema.API.methods.find((m) => m.method === 'invokeWithLayer');\n if(!invokeWithLayer) throw new Error('no invokeWithLayer!');\n serializer.storeInt(+invokeWithLayer.id, 'invokeWithLayer');\n\n // @ts-ignore\n serializer.storeInt(Schema.layer, 'layer');\n\n const initConnection = Schema.API.methods.find((m) => m.method === 'initConnection');\n if(!initConnection) throw new Error('no initConnection!');\n\n serializer.storeInt(+initConnection.id, 'initConnection');\n serializer.storeInt(0x0, 'flags');\n serializer.storeInt(App.id, 'api_id');\n serializer.storeString(getEnvironment().USER_AGENT || 'Unknown UserAgent', 'device_model');\n serializer.storeString(navigator.platform || 'Unknown Platform', 'system_version');\n serializer.storeString(App.version + (App.isMainDomain ? ' ' + App.suffix : ''), 'app_version');\n serializer.storeString(navigator.language || 'en', 'system_lang_code');\n serializer.storeString(App.langPack, 'lang_pack');\n serializer.storeString(this.networkerFactory.language, 'lang_code');\n // serializer.storeInt(0x0, 'proxy');\n /* serializer.storeMethod('initConnection', {\n 'flags': 0,\n 'api_id': App.id,\n 'device_model': navigator.userAgent || 'Unknown UserAgent',\n 'system_version': navigator.platform || 'Unknown Platform',\n 'app_version': App.version,\n 'system_lang_code': navigator.language || 'en',\n 'lang_pack': '',\n 'lang_code': navigator.language || 'en'\n }); */\n }\n\n if(options.afterMessageId) {\n if(invokeAfterMsgConstructor === undefined) {\n const m = Schema.API.methods.find((m) => m.method === 'invokeAfterMsg');\n invokeAfterMsgConstructor = m ? +m.id : 0;\n }\n\n if(invokeAfterMsgConstructor) {\n // if(this.debug) {\n // this.log('invokeApi: store invokeAfterMsg');\n // }\n\n serializer.storeInt(invokeAfterMsgConstructor, 'invokeAfterMsg');\n serializer.storeLong(options.afterMessageId, 'msg_id');\n } else {\n this.log.error('no invokeAfterMsg!');\n }\n }\n\n options.resultType = serializer.storeMethod(method, params);\n\n /* if(method === 'account.updateNotifySettings') {\n this.log('api call body:', serializer.getBytes(true));\n } */\n\n const messageId = this.timeManager.generateId();\n const seqNo = this.generateSeqNo();\n const message = {\n msg_id: messageId,\n seq_no: seqNo,\n body: serializer.getBytes(true),\n isAPI: true\n };\n\n if(Modes.debug/* || true */) {\n this.log('Api call', method, message, params, options);\n } else if(this.debug) {\n this.log('Api call', method, params, options);\n }\n\n return this.pushMessage(message, options);\n }\n\n public changeTransport(transport?: MTTransport) {\n const oldTransport = this.transport;\n if(oldTransport) {\n oldTransport.destroy();\n\n if(this.nextReqTimeout) {\n clearTimeout(this.nextReqTimeout);\n this.nextReqTimeout = 0;\n this.nextReq = 0;\n }\n\n this.connectionInited = false;\n\n \n if(this.longPollInterval !== undefined) {\n clearInterval(this.longPollInterval);\n this.longPollInterval = undefined;\n }\n\n this.clearCheckConnectionTimeout();\n \n }\n\n this.log('change transport', transport, oldTransport);\n\n \n this.clearPingDelayDisconnect();\n\n // if(this.pingInterval !== undefined) {\n // clearInterval(this.pingInterval);\n // this.pingInterval = undefined;\n // }\n\n // this.clearPing();\n \n\n this.transport = transport;\n if(!transport) {\n return;\n }\n\n transport.networker = this;\n\n \n \n if(transport instanceof HTTP) {\n \n this.longPollInterval = ctx.setInterval(this.checkLongPoll, 10000);\n this.checkLongPoll();\n this.checkConnection('changed transport');\n \n }\n \n \n\n \n // * handle outcoming dead socket, server will close the connection\n if((transport as TcpObfuscated).connection) {\n // this.sendPingDelayDisconnect();\n\n if(transport.connected) {\n this.setConnectionStatus(ConnectionStatus.Connected);\n }\n\n // this.pingInterval = ctx.setInterval(this.sendPing, PING_INTERVAL);\n // this.sendPing();\n }\n \n\n this.resend();\n }\n\n public destroy() {\n this.log('destroy');\n }\n\n public forceReconnectTimeout() {\n if((this.transport as TcpObfuscated).reconnect) {\n (this.transport as TcpObfuscated).reconnect();\n } else {\n this.resend();\n }\n }\n\n public forceReconnect() {\n if((this.transport as TcpObfuscated).forceReconnect) {\n (this.transport as TcpObfuscated).forceReconnect();\n } else {\n this.checkConnection('force reconnect');\n }\n }\n\n /* private clearPing() {\n if(this.pingPromise) {\n this.pingPromise = undefined;\n }\n\n this.lastPingTime = undefined;\n }\n\n private sendPing = () => {\n // return;\n\n // if(!(this.transport as TcpObfuscated).connected) {\n // this.clearPing();\n // return;\n // }\n\n if(this.pingPromise) {\n return;\n }\n\n const startTime = Date.now();\n this.log('sendPing: ping', startTime);\n const promise = this.pingPromise = this.wrapMtpCall('ping', {\n ping_id: randomLong()\n }, {\n notContentRelated: true\n }).then(() => {\n const elapsedTime = Date.now() - startTime;\n this.lastPingTime = elapsedTime / 1000;\n this.log('sendPing: pong', elapsedTime);\n\n setTimeout(() => {\n if(this.pingPromise !== promise) {\n return;\n }\n\n this.pingPromise = undefined;\n this.sendPing();\n }, Math.max(0, PING_INTERVAL - elapsedTime));\n });\n }; */\n\n private clearPingDelayDisconnect() {\n const deferred = this.pingDelayDisconnectDeferred;\n this.pingDelayDisconnectDeferred = undefined;\n this.lastPingDelayDisconnectId = undefined;\n\n if(deferred) {\n deferred.reject();\n }\n }\n\n private sendPingDelayDisconnect = () => {\n // return;\n\n if(this.pingDelayDisconnectDeferred || !this.transport || !this.transport.connected) return;\n\n /* if(!this.isOnline) {\n if((this.transport as TcpObfuscated).connected) {\n (this.transport as TcpObfuscated).connection.close();\n }\n\n return;\n } */\n\n const deferred = this.pingDelayDisconnectDeferred = deferredPromise();\n const delays = this.delays;\n const pingMaxTime = this.delays.pingMaxTime;\n const lastPingTime = Math.min(this.lastPingTime ?? 0, pingMaxTime);\n const disconnectDelay = Math.round(delays.disconnectDelayMin + lastPingTime / pingMaxTime * (delays.disconnectDelayMax - delays.disconnectDelayMin));\n const timeoutTime = disconnectDelay * 1000;\n const startTime = this.lastPingStartTime = Date.now();\n const pingId = this.lastPingDelayDisconnectId = randomLong();\n const options: MTMessageOptions = {notContentRelated: true};\n this.wrapMtpCall('ping_delay_disconnect', {\n ping_id: pingId,\n disconnect_delay: disconnectDelay\n }, options);\n\n const log = this.log.bindPrefix('sendPingDelayDisconnect');\n this.debug && log.debug(`ping, timeout=${timeoutTime}, lastPingTime=${this.lastPingTime}, msgId=${options.messageId}, pingId=${pingId}`);\n const rejectTimeout = ctx.setTimeout(deferred.reject, timeoutTime);\n\n const onResolved = (reason: string) => {\n clearTimeout(rejectTimeout);\n const elapsedTime = Date.now() - startTime;\n this.lastPingTime = elapsedTime / 1000;\n this.debug && log.debug(`pong, reason='${reason}', time=${lastPingTime}, msgId=${options.messageId}`);\n if(elapsedTime > timeoutTime) {\n throw undefined;\n } else {\n return pause(Math.max(0, this.delays.pingInterval - elapsedTime/* timeoutTime - elapsedTime - PING_INTERVAL */));\n }\n };\n\n const onTimeout = () => {\n clearTimeout(rejectTimeout);\n const transport = this.transport as TcpObfuscated;\n if(this.pingDelayDisconnectDeferred !== deferred || !transport?.connection) {\n return;\n }\n\n log.error('catch, closing connection', this.lastPingTime, options.messageId);\n transport.connection.close();\n };\n\n const onFinally = () => {\n if(this.pingDelayDisconnectDeferred !== deferred) {\n return;\n }\n\n this.pingDelayDisconnectDeferred = undefined;\n this.sendPingDelayDisconnect();\n };\n\n deferred\n .then(onResolved)\n .catch(onTimeout)\n .finally(onFinally);\n };\n\n \n private checkLongPoll = () => {\n const isClean = this.cleanupSent();\n // this.log.error('Check lp', this.longPollPending, this.dcId, isClean, this);\n if((this.longPollPending && Date.now() < this.longPollPending) ||\n this.offline ||\n this.isStopped() ||\n this.isFileNetworker) {\n // this.log('No lp this time');\n return false;\n }\n\n sessionStorage.get('dc').then((baseDcId) => {\n if(isClean && (\n baseDcId !== this.dcId ||\n (this.sleepAfter && Date.now() > this.sleepAfter)\n )) {\n // console.warn(dT(), 'Send long-poll for DC is delayed', this.dcId, this.sleepAfter);\n return;\n }\n\n this.sendLongPoll();\n });\n };\n\n private sendLongPoll() {\n if(this.sendingLongPoll) return;\n this.sendingLongPoll = true;\n const maxWait = 25000;\n\n this.longPollPending = Date.now() + maxWait;\n this.debug && this.log.debug('sendLongPoll', this.longPollPending);\n\n this.wrapMtpCall('http_wait', {\n max_delay: 500,\n wait_after: 150,\n max_wait: maxWait\n }, {\n noResponse: true,\n // notContentRelated: true,\n longPoll: true\n }).then(() => {\n this.longPollPending = undefined;\n setTimeout(this.checkLongPoll, 0);\n }, (error: ErrorEvent) => {\n this.log('Long-poll failed', error);\n }).finally(() => {\n this.sendingLongPoll = undefined;\n });\n }\n\n private checkConnection = (event: Event | string) => {\n this.debug && this.log('Check connection', event);\n this.clearCheckConnectionTimeout();\n\n if(!this.transport) {\n this.log.warn('No transport for checkConnection');\n return;\n }\n\n const serializer = new TLSerialization({mtproto: true});\n const pingId = randomLong();\n\n serializer.storeMethod('ping', {\n ping_id: pingId\n });\n\n const pingMessage = {\n msg_id: this.timeManager.generateId(),\n seq_no: this.generateSeqNo(true),\n body: serializer.getBytes(true)\n };\n\n if(this.offline) {\n this.setConnectionStatus(ConnectionStatus.Connecting);\n }\n\n this.sendEncryptedRequest(pingMessage).then(() => {\n this.toggleOffline(false);\n }, () => {\n this.debug && this.log('Delay', this.checkConnectionPeriod * 1000);\n this.checkConnectionTimeout = ctx.setTimeout(() => this.checkConnection('from failed checkConnection request'), this.checkConnectionPeriod * 1000 | 0);\n this.checkConnectionPeriod = Math.min(60, this.checkConnectionPeriod * 1.5);\n });\n };\n\n private clearCheckConnectionTimeout() {\n if(this.checkConnectionTimeout !== undefined) {\n clearTimeout(this.checkConnectionTimeout);\n this.checkConnectionTimeout = undefined;\n }\n }\n\n private toggleOffline(offline: boolean) {\n if(this.offline !== offline) {\n this.offline = offline;\n\n this.clearCheckConnectionTimeout();\n if(offline) {\n clearTimeout(this.nextReqTimeout);\n this.nextReqTimeout = 0;\n this.nextReq = 0;\n\n if(this.checkConnectionPeriod < 1.5) {\n this.checkConnectionPeriod = 0;\n }\n\n const delay = this.checkConnectionPeriod * 1000 | 0;\n this.checkConnectionRetryAt = Date.now() + delay;\n this.setConnectionStatus(ConnectionStatus.Closed, this.checkConnectionRetryAt);\n this.checkConnectionTimeout = ctx.setTimeout(() => this.checkConnection('from toggleOfline'), delay);\n this.checkConnectionPeriod = Math.min(30, (1 + this.checkConnectionPeriod) * 1.5);\n\n \n \n \n \n } else {\n this.setConnectionStatus(ConnectionStatus.Connected);\n this.checkLongPoll();\n\n this.scheduleRequest();\n\n \n \n \n \n }\n }\n\n this.setConnectionStatus(offline ? ConnectionStatus.Closed : ConnectionStatus.Connected, offline ? this.checkConnectionRetryAt : undefined);\n }\n\n private handleSentEncryptedRequestHTTP(promise: ReturnType, message: MTMessage, noResponseMsgs: string[]) {\n // let timeout = setTimeout(() => {\n // this.log.error('handleSentEncryptedRequestHTTP timeout', promise, message, noResponseMsgs);\n // }, 5e3);\n\n promise.then((result) => {\n this.toggleOffline(false);\n // this.log('parse for', message);\n return this.parseResponse(result).then((response) => {\n this.debug && this.log.debug('Server response', response);\n\n this.processMessage(response.response, response.messageId, response.sessionId);\n\n this.checkLongPoll();\n this.checkConnectionPeriod = Math.max(1.1, Math.sqrt(this.checkConnectionPeriod));\n\n return true;\n });\n }, (error) => {\n this.log.error('Encrypted request failed', error, message);\n\n this.pushResend(message.msg_id);\n this.toggleOffline(true);\n\n return false;\n }).then((shouldResolve) => {\n // clearTimeout(timeout);\n const sentMessages = this.sentMessages;\n noResponseMsgs.forEach((msgId) => {\n const sentMessage = sentMessages[msgId];\n if(sentMessage) {\n const deferred = sentMessage.deferred;\n delete sentMessages[msgId];\n delete this.pendingMessages[msgId];\n shouldResolve ? deferred.resolve() : deferred.reject();\n }\n });\n });\n }\n \n\n // тут можно сделать таймаут и выводить дисконнект\n private pushMessage(message: {\n msg_id: string,\n seq_no: number,\n body: Uint8Array | number[],\n isAPI?: boolean\n }, options: MTMessageOptions) {\n let promise: CancellablePromise;\n if(!options.notContentRelated || options.noResponse) {\n promise = deferredPromise();\n }\n\n this.sentMessages[message.msg_id] = Object.assign(\n message,\n options,\n promise ? {deferred: promise} : undefined\n );\n\n // this.log.error('Networker pushMessage:', this.sentMessages[message.msg_id]);\n\n this.pendingMessages[message.msg_id] = 0;\n\n if(!options.noSchedule) {\n this.scheduleRequest();\n }\n\n if(isObject(options)) {\n options.messageId = message.msg_id;\n }\n\n return promise;\n }\n\n public attachPromise(promise: Promise, message: MTMessage) {\n const canIncrement = true;\n const timeout = setTimeout(() => {\n if(this.lastResponseTime && (Date.now() - this.lastResponseTime) < this.delays.connectionTimeout) {\n return;\n }\n\n this.log.error('timeout', message);\n if(this.isOnline) {\n this.setConnectionStatus(ConnectionStatus.TimedOut);\n }\n\n /* this.getEncryptedOutput(message).then((bytes) => {\n this.log.error('timeout encrypted', bytes);\n }); */\n }, this.delays.connectionTimeout);\n\n promise.catch(noop).finally(() => {\n clearTimeout(timeout);\n this.setConnectionStatus(ConnectionStatus.Connected);\n\n if(canIncrement) {\n --this.activeRequests;\n this.setDrainTimeout();\n }\n });\n\n if(canIncrement) {\n ++this.activeRequests;\n if(this.onDrainTimeout !== undefined) {\n clearTimeout(this.onDrainTimeout);\n this.onDrainTimeout = undefined;\n }\n }\n }\n\n public setDrainTimeout() {\n if(!this.activeRequests && this.onDrain && this.onDrainTimeout === undefined) {\n this.onDrainTimeout = ctx.setTimeout(() => {\n this.onDrainTimeout = undefined;\n this.log('drain');\n this.onDrain();\n }, DRAIN_TIMEOUT);\n }\n }\n\n public setConnectionStatus(status: ConnectionStatus, retryAt?: number) {\n const isOnline = status === ConnectionStatus.Connected;\n const willChange = this.status !== status;\n this.isOnline = isOnline;\n this.status = status;\n\n if(willChange) {\n if(this.networkerFactory.onConnectionStatusChange) {\n this.networkerFactory.onConnectionStatusChange({\n _: 'networkerStatus',\n status,\n dcId: this.dcId,\n name: this.name,\n isFileNetworker: this.isFileNetworker,\n isFileDownload: this.isFileDownload,\n isFileUpload: this.isFileUpload,\n retryAt\n });\n }\n\n if(this.isOnline) {\n this.scheduleRequest();\n }\n\n if((this.transport as TcpObfuscated)?.connection) {\n this.clearPingDelayDisconnect();\n this.sendPingDelayDisconnect();\n }\n\n // this.getNewTimeOffset = true;\n }\n /* if(this.onConnectionStatusChange) {\n this.onConnectionStatusChange(this.isOnline);\n } */\n }\n\n private pushResend(messageId: string, delay = 100) {\n const value = delay ? Date.now() + delay : 0;\n const sentMessage = this.sentMessages[messageId];\n if(sentMessage.container) {\n for(const innerMsgId of sentMessage.inner) {\n this.pendingMessages[innerMsgId] = value;\n }\n } else {\n this.pendingMessages[messageId] = value;\n }\n\n if(sentMessage.acked) {\n this.log.error('pushResend: acked message?', sentMessage);\n }\n\n if(this.debug) {\n this.log.debug('pushResend:', messageId, sentMessage, this.pendingMessages, delay);\n }\n\n this.scheduleRequest(delay);\n }\n\n // * correct, fully checked\n private async getMsgKey(dataWithPadding: Uint8Array, isOut: boolean) {\n const x = isOut ? 0 : 8;\n const msgKeyLargePlain = bufferConcats(this.authKeyUint8.subarray(88 + x, 88 + x + 32), dataWithPadding);\n\n const msgKeyLarge = await CryptoWorker.invokeCrypto('sha256', msgKeyLargePlain);\n const msgKey = new Uint8Array(msgKeyLarge).subarray(8, 24);\n return msgKey;\n };\n\n // * correct, fully checked\n private getAesKeyIv(msgKey: Uint8Array, isOut: boolean): Promise<[Uint8Array, Uint8Array]> {\n const x = isOut ? 0 : 8;\n const sha2aText = new Uint8Array(52);\n const sha2bText = new Uint8Array(52);\n const promises: Array> = [];\n\n sha2aText.set(msgKey, 0);\n sha2aText.set(this.authKeyUint8.subarray(x, x + 36), 16);\n promises.push(CryptoWorker.invokeCrypto('sha256', sha2aText));\n\n sha2bText.set(this.authKeyUint8.subarray(40 + x, 40 + x + 36), 0);\n sha2bText.set(msgKey, 36);\n promises.push(CryptoWorker.invokeCrypto('sha256', sha2bText));\n\n return Promise.all(promises).then((results) => {\n const aesKey = new Uint8Array(32);\n const aesIv = new Uint8Array(32);\n const sha2a = new Uint8Array(results[0]);\n const sha2b = new Uint8Array(results[1]);\n\n aesKey.set(sha2a.subarray(0, 8));\n aesKey.set(sha2b.subarray(8, 24), 8);\n aesKey.set(sha2a.subarray(24, 32), 24);\n\n aesIv.set(sha2b.subarray(0, 8));\n aesIv.set(sha2a.subarray(8, 24), 8);\n aesIv.set(sha2b.subarray(24, 32), 24);\n\n return [aesKey, aesIv];\n });\n }\n\n public isStopped() {\n return this.networkerFactory.akStopped && !this.isFileNetworker;\n }\n\n private performScheduledRequest() {\n if(this.isStopped()) {\n return false;\n }\n\n if(this.pendingAcks.length) {\n const ackMsgIds = this.pendingAcks.slice();\n\n // this.log('acking messages', ackMsgIDs)\n this.wrapMtpMessage({\n _: 'msgs_ack',\n msg_ids: ackMsgIds\n }, {\n notContentRelated: true,\n noSchedule: true\n });\n }\n\n const pendingResendReqLength = this.pendingResendReq.length;\n if(pendingResendReqLength) {\n const options: MTMessageOptions = {...RESEND_OPTIONS};\n const msgIds = this.pendingResendReq.splice(0, pendingResendReqLength);\n this.wrapMtpMessage({\n _: 'msg_resend_req',\n msg_ids: msgIds\n }, options);\n\n this.log('resend: resending requests', options.messageId, msgIds);\n /* this.lastResendReq = {\n reqMsgId: options.messageId,\n msgIds: msgIds\n }; */\n\n // this.pendingResendReq.length = 0;\n }\n\n // if(this.pendingResendAnsReq.length) {\n // const options: MTMessageOptions = {...RESEND_OPTIONS};\n // const msgIds = this.pendingResendAnsReq.slice();\n // this.wrapMtpMessage({\n // _: 'msg_resend_ans_req',\n // msg_ids: msgIds\n // }, options);\n\n // this.log('resend: requesting answers', options.messageId, msgIds);\n // this.lastResendAnsReq = {\n // reqMsgId: options.messageId,\n // msgIds: msgIds\n // };\n\n // // this.pendingResendAnsReq.length = 0;\n // }\n\n let outMessage: MTMessage;\n const messages: typeof outMessage[] = [];\n\n // const currentTime = Date.now();\n let messagesByteLen = 0;\n\n \n let hasApiCall = false;\n let hasHttpWait = false;\n \n\n let lengthOverflow = false;\n\n // * Сюда никогда не попадут контейнеры, так как их не будет в pendingMessages\n const keys = sortLongsArray(Object.keys(this.pendingMessages));\n for(const messageId of keys) {\n // const value = this.pendingMessages[messageId];\n\n // if(!value || value <= currentTime) {\n const message = this.sentMessages[messageId];\n if(message && message.body) {\n /* if(message.fileUpload) {\n this.log('performScheduledRequest message:', message, message.body.length, (message.body as Uint8Array).byteLength, (message.body as Uint8Array).buffer.byteLength);\n } */\n\n const messageByteLength = message.body.length + 32;\n\n if((messagesByteLen + messageByteLength) > 655360) { // 640 Kb\n this.log.warn('lengthOverflow', message, messages);\n lengthOverflow = true;\n\n if(outMessage) { // if it's not a first message\n break;\n }\n }\n\n messages.push(message);\n messagesByteLen += messageByteLength;\n\n \n if(message.isAPI) {\n hasApiCall = true;\n } else if(message.longPoll) {\n hasHttpWait = true;\n }\n \n\n outMessage = message;\n } else {\n // this.log(message, messageId)\n }\n\n delete this.pendingMessages[messageId];\n // }\n }\n\n \n \n if(this.transport instanceof HTTP)\n \n if(hasApiCall && !hasHttpWait) {\n const serializer = new TLSerialization({mtproto: true});\n serializer.storeMethod('http_wait', {\n max_delay: 500,\n wait_after: 150,\n max_wait: 3000\n });\n\n messages.push({\n msg_id: this.timeManager.generateId(),\n seq_no: this.generateSeqNo(),\n body: serializer.getBytes(true)\n });\n }\n \n\n if(!messages.length) {\n // this.log('no scheduled messages')\n return;\n }\n\n \n const noResponseMsgs: Array = messages.filter((message) => message.noResponse).map((message) => message.msg_id);\n \n\n if(messages.length > 1) {\n const container = this.generateContainerMessage(messagesByteLen, messages);\n outMessage = container.messageWithBody;\n\n this.sentMessages[outMessage.msg_id] = container.message;\n } else {\n this.sentMessages[outMessage.msg_id] = outMessage;\n }\n\n this.pendingAcks = [];\n\n const promise = this.sendEncryptedRequest(outMessage);\n\n \n \n if(this.transport instanceof HTTP)\n \n this.handleSentEncryptedRequestHTTP(promise, outMessage, noResponseMsgs);\n \n\n \n \n if(!(this.transport instanceof HTTP))\n \n this.cleanupSent(); // ! WARNING\n \n\n if(lengthOverflow) {\n this.scheduleRequest();\n }\n }\n\n private generateContainerMessage(messagesByteLen: number, messages: MTMessage[]) {\n const container = new TLSerialization({\n mtproto: true,\n startMaxLength: messagesByteLen + 64\n });\n\n container.storeInt(0x73f1f8dc, 'CONTAINER[id]');\n container.storeInt(messages.length, 'CONTAINER[count]');\n\n const innerMessages: string[] = [];\n messages.forEach((message, i) => {\n innerMessages.push(message.msg_id);\n // this.log('Pushing to container:', message.msg_id);\n container.storeLong(message.msg_id, 'CONTAINER[' + i + '][msg_id]');\n container.storeInt(message.seq_no, 'CONTAINER[' + i + '][seq_no]');\n container.storeInt(message.body.length, 'CONTAINER[' + i + '][bytes]');\n container.storeRawBytes(message.body, 'CONTAINER[' + i + '][body]');\n });\n\n const message: MTMessage = {\n msg_id: this.timeManager.generateId(),\n seq_no: this.generateSeqNo(true),\n container: true,\n inner: innerMessages\n };\n\n if(Modes.debug/* || true */) {\n this.log.warn('Container', innerMessages, message.msg_id, message.seq_no);\n }\n\n return {\n message,\n messageWithBody: Object.assign({body: container.getBytes(true)}, message)\n };\n }\n\n private async getEncryptedMessage(dataWithPadding: Uint8Array) {\n const msgKey = await this.getMsgKey(dataWithPadding, true);\n const keyIv = await this.getAesKeyIv(msgKey, true);\n // this.log('after msg key iv')\n\n const encryptedBytes = await CryptoWorker.invokeCrypto('aes-encrypt', dataWithPadding, keyIv[0], keyIv[1]);\n // this.log('Finish encrypt')\n\n return {\n bytes: encryptedBytes,\n msgKey\n };\n }\n\n private getDecryptedMessage(msgKey: Uint8Array, encryptedData: Uint8Array) {\n // this.log('get decrypted start')\n return this.getAesKeyIv(msgKey, false).then((keyIv) => {\n // this.log('after msg key iv')\n return CryptoWorker.invokeCrypto('aes-decrypt', encryptedData, keyIv[0], keyIv[1]);\n });\n }\n\n private getEncryptedOutput(message: MTMessage) {\n /* if(DEBUG) {\n this.log.debug('Send encrypted', message, this.authKeyId);\n } */\n /* if(!this.isOnline) {\n this.log('trying to send message when offline:', Object.assign({}, message));\n //debugger;\n } */\n\n const data = new TLSerialization({\n startMaxLength: message.body.length + 2048\n });\n\n data.storeIntBytes(this.serverSalt, 64, 'salt');\n data.storeIntBytes(this.sessionId, 64, 'session_id');\n\n data.storeLong(message.msg_id, 'message_id');\n data.storeInt(message.seq_no, 'seq_no');\n\n data.storeInt(message.body.length, 'message_data_length');\n data.storeRawBytes(message.body, 'message_data');\n\n /* const des = new TLDeserialization(data.getBuffer().slice(16));\n const desSalt = des.fetchLong();\n const desSessionId = des.fetchLong();\n\n if(!this.isOnline) {\n this.log.error('trying to send message when offline', message, new Uint8Array(des.buffer), desSalt, desSessionId);\n } */\n\n /* const messageDataLength = message.body.length;\n let canBeLength = 0; // bytes\n canBeLength += 8;\n canBeLength += 8;\n canBeLength += 8;\n canBeLength += 4;\n canBeLength += 4;\n canBeLength += message.body.length; */\n\n const dataBuffer = data.getBuffer();\n\n /* if(dataBuffer.byteLength !== canBeLength || !bytesCmp(new Uint8Array(dataBuffer.slice(dataBuffer.byteLength - message.body.length)), new Uint8Array(message.body))) {\n this.log.error('wrong length', dataBuffer, canBeLength, message.msg_id);\n } */\n\n const paddingLength = (16 - (data.getOffset() % 16)) + 16 * (1 + nextRandomUint(8) % 5);\n const padding = /* (message as any).padding || */randomize(new Uint8Array(paddingLength))/* .fill(0) */;\n /* const padding = [167, 148, 207, 226, 86, 192, 193, 57, 124, 153, 174, 145, 159, 1, 5, 70, 127, 157,\n 51, 241, 46, 85, 141, 212, 139, 234, 213, 164, 197, 116, 245, 70, 184, 40, 40, 201, 233, 211, 150,\n 94, 57, 84, 1, 135, 108, 253, 34, 139, 222, 208, 71, 214, 90, 67, 36, 28, 167, 148, 207, 226, 86, 192, 193, 57, 124, 153, 174, 145, 159, 1, 5, 70, 127, 157,\n 51, 241, 46, 85, 141, 212, 139, 234, 213, 164, 197, 116, 245, 70, 184, 40, 40, 201, 233, 211, 150,\n 94, 57, 84, 1, 135, 108, 253, 34, 139, 222, 208, 71, 214, 90, 67, 36, 28].slice(0, paddingLength); */\n\n // (message as any).padding = padding;\n\n const dataWithPadding = bufferConcats(dataBuffer, padding);\n // this.log('Adding padding', dataBuffer, padding, dataWithPadding)\n // this.log('auth_key_id', bytesToHex(self.authKeyID))\n\n /* if(dataWithPadding.byteLength % 16) {\n this.log.error('aaa', dataWithPadding, paddingLength);\n }\n\n if(message.fileUpload) {\n this.log('Send encrypted: body length:', (message.body as ArrayBuffer).byteLength, paddingLength, dataWithPadding);\n } */\n\n // * full next block is correct\n return this.getEncryptedMessage(dataWithPadding).then((encryptedResult) => {\n /* if(DEBUG) {\n this.log('Got encrypted out message', encryptedResult);\n } */\n\n const request = new TLSerialization({\n startMaxLength: encryptedResult.bytes.length + 256\n });\n request.storeIntBytes(this.authKeyId, 64, 'auth_key_id');\n request.storeIntBytes(encryptedResult.msgKey, 128, 'msg_key');\n request.storeRawBytes(encryptedResult.bytes, 'encrypted_data');\n\n const requestData = request.getBytes(true);\n\n // if(this.isFileNetworker) {\n // //this.log('Send encrypted: requestData length:', requestData.length, requestData.length % 16, paddingLength % 16, paddingLength, data.offset, encryptedResult.msgKey.length % 16, encryptedResult.bytes.length % 16);\n // //this.log('Send encrypted: messageId:', message.msg_id, requestData.length);\n // //this.log('Send encrypted:', message, new Uint8Array(bufferConcat(des.buffer, padding)), requestData, this.serverSalt.hex, this.sessionId.hex/* new Uint8Array(des.buffer) */);\n // this.debugRequests.push({before: new Uint8Array(bufferConcat(des.buffer, padding)), after: requestData});\n // }\n\n return requestData;\n });\n }\n\n private async sendEncryptedRequest(message: MTMessage) {\n const requestData = await this.getEncryptedOutput(message);\n\n if(!this.transport) {\n this.log.error('trying to send something when offline', this.transport, this);\n }\n\n this.debug && this.log.debug('sending:', message, [message.msg_id].concat(message.inner || []), requestData.length);\n const promise: Promise = this.transport ? this.transport.send(requestData) as any : Promise.reject({});\n // this.debug && this.log.debug('sendEncryptedRequest: launched message into space:', message, promise);\n\n \n \n \n\n \n if(!(this.transport instanceof HTTP)) return promise;\n \n\n const baseError: ApiError = {\n code: 406,\n type: 'NETWORK_BAD_RESPONSE',\n // @ts-ignore\n transport: this.transport\n };\n\n return promise.then((result) => {\n if(!result?.byteLength) {\n throw baseError;\n }\n\n // this.debug && this.log.debug('sendEncryptedRequest: got response for:', message, [message.msg_id].concat(message.inner || []));\n return result;\n }, (error) => {\n if(!error.message && !error.type) {\n error = Object.assign(baseError, {\n type: 'NETWORK_BAD_REQUEST',\n originalError: error\n });\n }\n\n throw error;\n });\n \n }\n\n public parseResponse(responseBuffer: Uint8Array) {\n // const perf = performance.now();\n /* if(this.debug) {\n this.log.debug('Start parsing response', responseBuffer);\n } */\n\n this.lastResponseTime = Date.now();\n\n const deserializer = new TLDeserialization(responseBuffer);\n\n const authKeyId = deserializer.fetchIntBytes(64, true, 'auth_key_id');\n if(!bytesCmp(authKeyId, this.authKeyId)) {\n throw new Error('[MT] Invalid server auth_key_id: ' + bytesToHex(authKeyId));\n }\n\n const msgKey = deserializer.fetchIntBytes(128, true, 'msg_key');\n const encryptedData = deserializer.fetchRawBytes(responseBuffer.byteLength - deserializer.getOffset(), true, 'encrypted_data');\n\n return this.getDecryptedMessage(msgKey, encryptedData).then((dataWithPadding) => {\n // this.log('after decrypt')\n return this.getMsgKey(dataWithPadding, false).then((calcMsgKey) => {\n if(!bytesCmp(msgKey, calcMsgKey)) {\n this.log.warn('[MT] msg_keys', msgKey, calcMsgKey);\n this.updateSession(); // fix 28.01.2020\n throw new Error('[MT] server msgKey mismatch, updating session');\n }\n // this.log('after msgKey check')\n\n let deserializer = new TLDeserialization(dataWithPadding, {mtproto: true});\n\n /* const salt = */deserializer.fetchIntBytes(64, true, 'salt'); // need\n const sessionId = deserializer.fetchIntBytes(64, true, 'session_id');\n const messageId = deserializer.fetchLong('message_id');\n\n if(!bytesCmp(sessionId, this.sessionId) &&\n (!this.prevSessionId || !bytesCmp(sessionId, this.prevSessionId))) {\n this.log.warn('Sessions', sessionId, this.sessionId, this.prevSessionId, dataWithPadding);\n // this.updateSession();\n // this.sessionID = sessionID;\n throw new Error('[MT] Invalid server session_id: ' + bytesToHex(sessionId));\n }\n\n const seqNo = deserializer.fetchInt('seq_no');\n\n const totalLength = dataWithPadding.byteLength;\n\n const messageBodyLength = deserializer.fetchInt('message_data[length]');\n let offset = deserializer.getOffset();\n\n if((messageBodyLength % 4) ||\n messageBodyLength > totalLength - offset) {\n throw new Error('[MT] Invalid body length: ' + messageBodyLength);\n }\n const messageBody = deserializer.fetchRawBytes(messageBodyLength, true, 'message_data');\n\n offset = deserializer.getOffset();\n const paddingLength = totalLength - offset;\n if(paddingLength < 12 || paddingLength > 1024) {\n throw new Error('[MT] Invalid padding length: ' + paddingLength);\n }\n\n // let buffer = bytesToArrayBuffer(messageBody);\n deserializer = new TLDeserialization(/* buffer */messageBody, {\n mtproto: true,\n override: {\n mt_message: (result: any, field: string) => {\n result.msg_id = deserializer.fetchLong(field + '[msg_id]');\n result.seqno = deserializer.fetchInt(field + '[seqno]');\n result.bytes = deserializer.fetchInt(field + '[bytes]');\n\n const offset = deserializer.getOffset();\n\n // self.log('mt_message!!!!!', result, field);\n\n try {\n result.body = deserializer.fetchObject('Object', field + '[body]');\n } catch(e) {\n this.log.error('parse error', (e as Error).message, (e as Error).stack);\n result.body = {\n _: 'parse_error',\n error: e\n };\n }\n\n if(deserializer.getOffset() !== offset + result.bytes) {\n // console.warn(dT(), 'set offset', this.offset, offset, result.bytes)\n // this.log(result)\n deserializer.setOffset(offset + result.bytes);\n }\n // this.log('override message', result)\n },\n mt_rpc_result: (result: any, field: any) => {\n result.req_msg_id = deserializer.fetchLong(field + '[req_msg_id]');\n\n const sentMessage = this.sentMessages[result.req_msg_id];\n const type = sentMessage && sentMessage.resultType || 'Object';\n\n if(result.req_msg_id && !sentMessage) {\n // console.warn(dT(), 'Result for unknown message', result);\n return;\n }\n\n // deserializer.setMtproto(false);\n result.result = deserializer.fetchObject(type, field + '[result]');\n // deserializer.setMtproto(true);\n // self.log(dT(), 'override rpc_result', sentMessage, type, result);\n }\n }\n });\n\n const response = deserializer.fetchObject('', 'INPUT');\n // this.log.error('Parse response time:', performance.now() - perf);\n return {\n response,\n messageId,\n sessionId,\n seqNo\n };\n });\n });\n }\n\n private applyServerSalt(newServerSalt: string) {\n const serverSalt = longToBytes(newServerSalt);\n\n sessionStorage.set({\n ['dc' + this.dcId + '_server_salt']: bytesToHex(serverSalt)\n });\n\n this.serverSalt = new Uint8Array(serverSalt);\n }\n\n // ! таймаут очень сильно тормозит скорость работы сокета (даже нулевой)\n public scheduleRequest(delay?: number) {\n /* if(!this.isOnline) {\n return;\n } */\n\n \n \n if(this.transport instanceof HTTP) {\n \n if(this.offline) {\n this.checkConnection('forced schedule');\n }\n\n delay ||= 0; // set zero timeout to pack other messages too\n \n }\n \n \n\n const nextReq = Date.now() + (delay || 0);\n if(this.nextReq && (delay === undefined || this.nextReq <= nextReq)) {\n // this.debug && this.log('scheduleRequest: nextReq', this.nextReq, nextReq);\n return;\n }\n\n // this.debug && this.log('scheduleRequest: delay', delay);\n\n /* if(this.nextReqTimeout) {\n return;\n } */\n\n // const perf = performance.now();\n if(this.nextReqTimeout) {\n clearTimeout(this.nextReqTimeout);\n }\n\n const cb = () => {\n // this.debug && this.log('scheduleRequest: timeout delay was:', performance.now() - perf);\n\n this.nextReqTimeout = 0;\n this.nextReq = 0;\n\n \n \n if(this.transport instanceof HTTP)\n \n if(this.offline) {\n // this.log('Cancel scheduled');\n return;\n }\n \n\n this.performScheduledRequest();\n };\n\n this.nextReq = nextReq;\n\n if(delay !== undefined) {\n this.nextReqTimeout = ctx.setTimeout(cb, delay);\n } else {\n cb();\n }\n }\n\n private ackMessage(msgId: MTLong) {\n // this.log('ack message', msgID)\n this.pendingAcks.push(msgId);\n\n let delay: number;\n\n \n \n if(this.transport instanceof HTTP)\n \n delay = 30000;\n \n\n this.scheduleRequest(delay);\n }\n\n private reqResend(msgId: MTLong/* , isAnswer?: boolean */) {\n if(this.debug) {\n this.log.debug('Req resend', msgId/* , isAnswer */);\n }\n\n // (isAnswer ? this.pendingResendAnsReq : this.pendingResendReq).push(msgId);\n this.pendingResendReq.push(msgId);\n this.scheduleRequest(100);\n }\n\n public cleanupSent() {\n let notEmpty = false;\n const sentMessages = this.sentMessages;\n // this.log('clean start', this.dcId/*, sentMessages*/)\n Object.keys(sentMessages).forEach((msgId) => {\n const message = sentMessages[msgId];\n\n // this.log('clean iter', msgID, message)\n if(message.notContentRelated && this.pendingMessages[msgId] === undefined) {\n // this.log('clean notContentRelated', msgID)\n delete sentMessages[msgId];\n } else if(message.container) {\n for(const innerMsgId of message.inner) {\n if(sentMessages[innerMsgId] !== undefined) {\n // this.log('clean failed, found', msgID, message.inner[i], sentMessages[message.inner[i]].seq_no)\n notEmpty = true;\n return;\n }\n }\n // this.log('clean container', msgID)\n delete sentMessages[msgId];\n } else {\n notEmpty = true;\n }\n });\n\n return !notEmpty;\n }\n\n private processMessageAck(messageId: Long) {\n const sentMessage = this.sentMessages[messageId];\n if(sentMessage && !sentMessage.acked) {\n // delete sentMessage.body;\n sentMessage.acked = true;\n }\n }\n\n private processError(rawError: {error_message: string, error_code: number}): ApiError {\n const matches = (rawError.error_message || '').match(/^([A-Z_0-9]+\\b)(: (.+))?/) || [];\n rawError.error_code = rawError.error_code;\n\n return {\n code: !rawError.error_code || rawError.error_code <= 0 ? 500 : rawError.error_code,\n type: matches[1] as any || 'UNKNOWN',\n description: matches[3] || ('CODE#' + rawError.error_code + ' ' + rawError.error_message),\n originalError: rawError\n };\n }\n\n /**\n * * только для сокета\n * TODO: consider about containers resend\n */\n public resend() {\n const sentMessages = this.sentMessages;\n for(const id in sentMessages) {\n const msg = sentMessages[id];\n if(msg.body || msg.container) {\n this.pushResend(id);\n }\n }\n\n if((this.transport as TcpObfuscated).connection) {\n this.clearPingDelayDisconnect();\n this.sendPingDelayDisconnect();\n }\n }\n\n /* public requestMessageStatus() {\n const ids: string[] = [];\n for(const id in this.sentMessages) {\n const message = this.sentMessages[id];\n if(message.isAPI && message.fileUpload) {\n ids.push(message.msg_id);\n }\n }\n\n this.wrapMtpMessage({\n _: 'msgs_state_req',\n msg_ids: ids\n }, {\n notContentRelated: true\n }).then((res) => {\n this.log('status', res);\n });\n } */\n\n private applyServerTime(messageId: string) {\n const serverTime = bigInt(messageId).shiftRight(32).toJSNumber();\n this.log('applying server time', serverTime);\n return this.timeManager.applyServerTime(serverTime);\n }\n\n // * https://core.telegram.org/mtproto/service_messages_about_messages#notice-of-ignored-error-message\n public processMessage(message: any, messageId: MTLong, sessionId: Uint8Array | number[]) {\n if(message._ === 'messageEmpty') {\n this.log.warn('processMessage: messageEmpty', message, messageId);\n return;\n }\n\n // messageId = messageId.toString();\n\n const msgidInt = parseInt(messageId.substr(0, -10), 10);\n if(msgidInt % 2) {\n this.log.warn('Server even message id: ', messageId, message);\n return;\n }\n\n if(this.debug) {\n this.log.debug('process message', message, messageId);\n }\n\n if(this.pingDelayDisconnectDeferred) {\n this.pingDelayDisconnectDeferred.resolve('any message');\n }\n\n // let changedTimeOffset: boolean;\n // if(this.getNewTimeOffset) {\n // changedTimeOffset = this.applyServerTime(messageId);\n // this.getNewTimeOffset = undefined;\n // }\n\n switch(message._) {\n case 'msg_container': {\n for(const innerMessage of message.messages) {\n this.processMessage(innerMessage, innerMessage.msg_id, sessionId);\n }\n\n break;\n }\n\n case 'bad_server_salt': {\n this.log('Bad server salt', message);\n\n this.applyServerSalt(message.new_server_salt);\n\n if(this.sentMessages[message.bad_msg_id]) {\n this.pushResend(message.bad_msg_id);\n }\n\n this.ackMessage(messageId);\n\n // simulate disconnect\n /* try {\n this.log('networker state:', this);\n // @ts-ignore\n this.transport.ws.close(1000);\n } catch(err) {\n this.log.error('transport', this.transport, err);\n } */\n\n break;\n }\n\n case 'bad_msg_notification': {\n this.log.error('Bad msg notification', message);\n\n switch(message.error_code) {\n case 16: // * msg_id too low\n case 17: // * msg_id too high\n case 32: // * msg_seqno too low\n case 33: // * msg_seqno too high\n case 64: { // * invalid container\n // if(changedTimeOffset === undefined) {\n // changedTimeOffset = this.applyServerTime(messageId);\n // }\n\n const changedTimeOffset = this.applyServerTime(messageId);\n if(message.error_code === 17 || changedTimeOffset) {\n this.log('Update session');\n this.updateSession();\n }\n\n const badMessage = this.updateSentMessage(message.bad_msg_id);\n if(badMessage) this.pushResend(badMessage.msg_id); // fix 23.01.2020\n // this.ackMessage(messageId);\n }\n\n // * invalid container\n /* case 64: {\n const badMessage = this.sentMessages[message.bad_msg_id];\n if(badMessage) {\n for(const msgId of badMessage.inner) {\n if(this.sentMessages[msgId] !== undefined) {\n this.updateSentMessage\n }\n }\n const inner = badMessage.inner;\n }\n } */\n }\n\n break;\n }\n\n case 'message': {\n if(this.lastServerMessages.indexOf(messageId) !== -1) {\n // console.warn('[MT] Server same messageId: ', messageId)\n this.ackMessage(messageId);\n return;\n }\n\n this.lastServerMessages.push(messageId);\n if(this.lastServerMessages.length > 100) {\n this.lastServerMessages.shift();\n }\n\n this.processMessage(message.body, message.msg_id, sessionId);\n break;\n }\n\n case 'new_session_created': {\n this.ackMessage(messageId);\n\n if(this.debug) {\n this.log.debug('new_session_created', message);\n }\n // this.updateSession();\n\n this.processMessageAck(message.first_msg_id);\n this.applyServerSalt(message.server_salt);\n\n sessionStorage.get('dc').then((baseDcId) => {\n if(baseDcId === this.dcId && !this.isFileNetworker && this.networkerFactory.updatesProcessor) {\n this.networkerFactory.updatesProcessor(message);\n }\n });\n break;\n }\n\n case 'msgs_ack': {\n this.debug && this.log('got acks', message.msg_ids);\n for(const msgId of message.msg_ids) {\n this.processMessageAck(msgId);\n }\n\n break;\n }\n\n case 'msg_detailed_info': {\n const sentMessage = this.sentMessages[message.msg_id];\n if(!sentMessage) {\n this.ackMessage(message.answer_msg_id);\n break;\n }/* else if(sentMessage.acked) {\n this.reqResend(message.answer_msg_id, true);\n }\n\n break; */\n }\n\n case 'msg_new_detailed_info': {\n if(this.pendingAcks.indexOf(message.answer_msg_id) !== -1) {\n break;\n }\n\n this.reqResend(message.answer_msg_id);\n break;\n }\n\n case 'msgs_state_info': {\n this.ackMessage(message.answer_msg_id);\n const arr = [\n [this.lastResendReq, this.pendingResendReq] as const\n // [this.lastResendAnsReq, this.pendingResendAnsReq] as const\n ];\n\n for(const [lastResend, pendingResend] of arr) {\n if(lastResend?.reqMsgId === message.req_msg_id && pendingResend.length) {\n for(const badMsgId of lastResend.msgIds) {\n const pos = pendingResend.indexOf(badMsgId);\n if(pos !== -1) {\n pendingResend.splice(pos, 1);\n }\n }\n }\n }\n\n break;\n }\n\n case 'rpc_result': {\n this.ackMessage(messageId);\n\n const sentMessageId = message.req_msg_id;\n const sentMessage = this.sentMessages[sentMessageId];\n\n if(this.debug) {\n this.log('Rpc response', message.result, sentMessage);\n }\n\n this.processMessageAck(sentMessageId);\n if(sentMessage) {\n const deferred = sentMessage.deferred;\n if(message.result._ === 'rpc_error') {\n const error = this.processError(message.result);\n this.log('Rpc error', error);\n if(deferred) {\n deferred.reject(error);\n }\n } else {\n if(deferred) {\n deferred.resolve(message.result);\n }\n\n if(sentMessage.isAPI && !this.connectionInited) {\n this.connectionInited = true;\n }\n }\n\n delete this.sentMessages[sentMessageId];\n } else {\n if(this.debug) {\n this.log('Rpc result for unknown message:', sentMessageId, message);\n }\n }\n\n break;\n }\n\n case 'pong': { // * https://core.telegram.org/mtproto/service_messages#ping-messages-pingpong - These messages don't require acknowledgments\n /* const sentMessageId = message.msg_id;\n const sentMessage = this.sentMessages[sentMessageId];\n\n if(sentMessage) {\n sentMessage.deferred.resolve(message);\n delete this.sentMessages[sentMessageId];\n } */\n const pingId = message.ping_id;\n if(this.lastPingDelayDisconnectId === pingId) {\n const deferred = this.pingDelayDisconnectDeferred;\n if(deferred) {\n deferred.resolve('pong');\n } else {\n this.log('ping deferred deleted', pingId);\n }\n }\n\n break;\n }\n\n default:\n this.ackMessage(messageId);\n\n /* if(this.debug) {\n this.log.debug('Update', message);\n } */\n\n if(this.networkerFactory.updatesProcessor !== null) {\n this.networkerFactory.updatesProcessor(message);\n }\n break;\n }\n }\n}\n","import bigInt from 'big-integer';\n\nexport default function sortLongsArray(arr: string[]) {\n return arr.map((long) => {\n return bigInt(long);\n }).sort((a, b) => {\n return a.compare(b);\n }).map((bigInt) => {\n return bigInt.toString(10);\n });\n}\n","import addPadding from '../bytes/addPadding';\nimport bigInt from 'big-integer';\nimport {bigIntToBytes} from '../bigInt/bigIntConversion';\n\nexport default function longToBytes(sLong: string) {\n const bigIntBytes = bigIntToBytes(bigInt(sLong)).reverse();\n const bytes = addPadding(bigIntBytes, 8, true, false, false);\n // console.log('longToBytes', bytes, bigIntBytes);\n\n return bytes;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {ConnectionStatusChange} from './connectionStatus';\nimport MTPNetworker from './networker';\nimport {InvokeApiOptions} from '../../types';\nimport App from '../../config/app';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport {AppManager} from '../appManagers/manager';\n\nexport class NetworkerFactory extends AppManager {\n private networkers: MTPNetworker[] = [];\n public language = navigator.language || App.langPackCode;\n public updatesProcessor: (obj: any) => void = null;\n // public onConnectionStatusChange: (status: ConnectionStatusChange) => void = null;\n public akStopped = false;\n\n public onConnectionStatusChange(status: ConnectionStatusChange) {\n this.rootScope.dispatchEvent('connection_status_change', status);\n // ({type: 'connectionStatusChange', payload: status});\n }\n\n public removeNetworker(networker: MTPNetworker) {\n indexOfAndSplice(this.networkers, networker);\n }\n\n public setUpdatesProcessor(callback: (obj: any) => void) {\n this.updatesProcessor = callback;\n }\n\n public getNetworker(dcId: number, authKey: Uint8Array, authKeyId: Uint8Array, serverSalt: Uint8Array, options: InvokeApiOptions) {\n // console.log('NetworkerFactory: creating new instance of MTPNetworker:', dcId, options);\n const networker = new MTPNetworker(this, this.timeManager, dcId, authKey, authKeyId, serverSalt, options);\n this.networkers.push(networker);\n return networker;\n }\n\n public startAll() {\n if(this.akStopped) {\n const stoppedNetworkers = this.networkers.filter((networker) => networker.isStopped());\n\n this.akStopped = false;\n this.updatesProcessor && this.updatesProcessor({_: 'new_session_created'});\n\n for(const networker of stoppedNetworkers) {\n networker.scheduleRequest();\n }\n }\n }\n\n public stopAll() {\n this.akStopped = true;\n }\n\n public setLanguage(langCode: string) {\n this.language = langCode;\n for(const networker of this.networkers) {\n if(!networker.isFileNetworker) {\n networker.connectionInited = false;\n }\n }\n }\n\n public unsetConnectionInited() {\n for(const networker of this.networkers) {\n networker.connectionInited = false;\n }\n }\n\n public forceReconnectTimeout() {\n for(const networker of this.networkers) {\n networker.forceReconnectTimeout();\n }\n }\n\n public forceReconnect() {\n for(const networker of this.networkers) {\n if(!networker.isFileNetworker) {\n networker.forceReconnect();\n break;\n }\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {TLSerialization} from './tl_utils';\nimport cryptoWorker from '../crypto/cryptoMessagePort';\nimport Modes from '../../config/modes';\nimport bytesFromHex from '../../helpers/bytes/bytesFromHex';\nimport bytesToHex from '../../helpers/bytes/bytesToHex';\nimport bigInt from 'big-integer';\n\nexport type RSAPublicKeyHex = {\n modulus: string,\n exponent: string\n};\n\nexport class RSAKeysManager {\n /**\n * Server public key, obtained from here: https://core.telegram.org/api/obtaining_api_id\n *\n *\n * -----BEGIN RSA PUBLIC KEY-----\n * MIIBCgKCAQEA6LszBcC1LGzyr992NzE0ieY+BSaOW622Aa9Bd4ZHLl+TuFQ4lo4g\n * 5nKaMBwK/BIb9xUfg0Q29/2mgIR6Zr9krM7HjuIcCzFvDtr+L0GQjae9H0pRB2OO\n * 62cECs5HKhT5DZ98K33vmWiLowc621dQuwKWSQKjWf50XYFw42h21P2KXUGyp2y/\n * +aEyZ+uVgLLQbRA1dEjSDZ2iGRy12Mk5gpYc397aYp438fsJoHIgJ2lgMv5h7WY9\n * t6N/byY9Nw9p21Og3AoXSL2q/2IJ1WRUhebgAdGVMlV1fkuOQoEzR7EdpqtQD9Cs\n * 5+bfo3Nhmcyvk5ftB0WkJ9z6bNZ7yxrP8wIDAQAB\n * -----END RSA PUBLIC KEY-----\n *\n * -----BEGIN RSA PUBLIC KEY-----\n * MIIBCgKCAQEBadMIUYSKhyznMh+Pg+OxTLyDZrWEjQIPZC3oJCtuZX7qUxgcWqFX\n * Q1952TSY8S8NYuz12sK9Fvp+lil1hIG0U/cuPsK08VB1hB4VA+p0S46fGwVsRovq\n * 4qUiUIzQSjSHDASuXTOinlYEHwmg/GaLc5G7qhePWa0p9YmqYR5Ha3xHJywcXZrn\n * yE3nC9igL96Aanqv+Prbu1N+r9vAgZeHh9cfbtbV8WWwruOANOTEv2ctQLR0dfr9\n * MwQXNePTPQlYsO9HNIGS1LWe7hZFtGBAVJH92F7Kig68WqHM3PIZ6Sq7N0VSzfzL\n * b11Z/YHz2UXYtXADwL/m5pTpKBUtJBXkOQIDAQAB\n * -----END RSA PUBLIC KEY-----\n *\n * Bytes can be got via\n * $ openssl rsa -in rsa.pem -RSAPublicKey_in -pubout > pub.pem\n * $ openssl rsa -pubin -in pub.pem -text -noout\n */\n\n /* private publisKeysHex = [{\n modulus: 'c150023e2f70db7985ded064759cfecf0af328e69a41daf4d6f01b538135a6f91f8f8b2a0ec9ba9720ce352efcf6c5680ffc424bd634864902de0b4bd6d49f4e580230e3ae97d95c8b19442b3c0a10d8f5633fecedd6926a7f6dab0ddb7d457f9ea81b8465fcd6fffeed114011df91c059caedaf97625f6c96ecc74725556934ef781d866b34f011fce4d835a090196e9a5f0e4449af7eb697ddb9076494ca5f81104a305b6dd27665722c46b60e5df680fb16b210607ef217652e60236c255f6a28315f4083a96791d7214bf64c1df4fd0db1944fb26a2a57031b32eee64ad15a8ba68885cde74a5bfc920f6abf59ba5c75506373e7130f9042da922179251f',\n exponent: '010001'\n }, {\n modulus: 'aeec36c8ffc109cb099624685b97815415657bd76d8c9c3e398103d7ad16c9bba6f525ed0412d7ae2c2de2b44e77d72cbf4b7438709a4e646a05c43427c7f184debf72947519680e651500890c6832796dd11f772c25ff8f576755afe055b0a3752c696eb7d8da0d8be1faf38c9bdd97ce0a77d3916230c4032167100edd0f9e7a3a9b602d04367b689536af0d64b613ccba7962939d3b57682beb6dae5b608130b2e52aca78ba023cf6ce806b1dc49c72cf928a7199d22e3d7ac84e47bc9427d0236945d10dbd15177bab413fbf0edfda09f014c7a7da088dde9759702ca760af2b8e4e97cc055c617bd74c3d97008635b98dc4d621b4891da9fb0473047927',\n exponent: '010001'\n }, {\n modulus: 'bdf2c77d81f6afd47bd30f29ac76e55adfe70e487e5e48297e5a9055c9c07d2b93b4ed3994d3eca5098bf18d978d54f8b7c713eb10247607e69af9ef44f38e28f8b439f257a11572945cc0406fe3f37bb92b79112db69eedf2dc71584a661638ea5becb9e23585074b80d57d9f5710dd30d2da940e0ada2f1b878397dc1a72b5ce2531b6f7dd158e09c828d03450ca0ff8a174deacebcaa22dde84ef66ad370f259d18af806638012da0ca4a70baa83d9c158f3552bc9158e69bf332a45809e1c36905a5caa12348dd57941a482131be7b2355a5f4635374f3bd3ddf5ff925bf4809ee27c1e67d9120c5fe08a9de458b1b4a3c5d0a428437f2beca81f4e2d5ff',\n exponent: '010001'\n }, {\n modulus: 'b3f762b739be98f343eb1921cf0148cfa27ff7af02b6471213fed9daa0098976e667750324f1abcea4c31e43b7d11f1579133f2b3d9fe27474e462058884e5e1b123be9cbbc6a443b2925c08520e7325e6f1a6d50e117eb61ea49d2534c8bb4d2ae4153fabe832b9edf4c5755fdd8b19940b81d1d96cf433d19e6a22968a85dc80f0312f596bd2530c1cfb28b5fe019ac9bc25cd9c2a5d8a0f3a1c0c79bcca524d315b5e21b5c26b46babe3d75d06d1cd33329ec782a0f22891ed1db42a1d6c0dea431428bc4d7aabdcf3e0eb6fda4e23eb7733e7727e9a1915580796c55188d2596d2665ad1182ba7abf15aaa5a8b779ea996317a20ae044b820bff35b6e8a1',\n exponent: '010001'\n }, {\n modulus: 'be6a71558ee577ff03023cfa17aab4e6c86383cff8a7ad38edb9fafe6f323f2d5106cbc8cafb83b869cffd1ccf121cd743d509e589e68765c96601e813dc5b9dfc4be415c7a6526132d0035ca33d6d6075d4f535122a1cdfe017041f1088d1419f65c8e5490ee613e16dbf662698c0f54870f0475fa893fc41eb55b08ff1ac211bc045ded31be27d12c96d8d3cfc6a7ae8aa50bf2ee0f30ed507cc2581e3dec56de94f5dc0a7abee0be990b893f2887bd2c6310a1e0a9e3e38bd34fded2541508dc102a9c9b4c95effd9dd2dfe96c29be647d6c69d66ca500843cfaed6e440196f1dbe0e2e22163c61ca48c79116fa77216726749a976a1c4b0944b5121e8c01',\n exponent: '010001'\n }]; */\n\n private testPublicKeysHex: RSAPublicKeyHex[] = [{\n modulus: 'c8c11d635691fac091dd9489aedced2932aa8a0bcefef05fa800892d9b52ed03200865c9e97211cb2ee6c7ae96d3fb0e15aeffd66019b44a08a240cfdd2868a85e1f54d6fa5deaa041f6941ddf302690d61dc476385c2fa655142353cb4e4b59f6e5b6584db76fe8b1370263246c010c93d011014113ebdf987d093f9d37c2be48352d69a1683f8f6e6c2167983c761e3ab169fde5daaa12123fa1beab621e4da5935e9c198f82f35eae583a99386d8110ea6bd1abb0f568759f62694419ea5f69847c43462abef858b4cb5edc84e7b9226cd7bd7e183aa974a712c079dde85b9dc063b8a5c08e8f859c0ee5dcd824c7807f20153361a7f63cfd2a433a1be7f5',\n exponent: '010001'\n }];\n\n private publisKeysHex: RSAPublicKeyHex[] = [{\n // modulus: '00e8bb3305c0b52c6cf2afdf7637313489e63e05268e5badb601af417786472e5f93b85438968e20e6729a301c0afc121bf7151f834436f7fda680847a66bf64accec78ee21c0b316f0edafe2f41908da7bd1f4a5107638eeb67040ace472a14f90d9f7c2b7def99688ba3073adb5750bb02964902a359fe745d8170e36876d4fd8a5d41b2a76cbff9a13267eb9580b2d06d10357448d20d9da2191cb5d8c93982961cdfdeda629e37f1fb09a0722027696032fe61ed663db7a37f6f263d370f69db53a0dc0a1748bdaaff6209d5645485e6e001d1953255757e4b8e42813347b11da6ab500fd0ace7e6dfa3736199ccaf9397ed0745a427dcfa6cd67bcb1acff3',\n modulus: 'e8bb3305c0b52c6cf2afdf7637313489e63e05268e5badb601af417786472e5f93b85438968e20e6729a301c0afc121bf7151f834436f7fda680847a66bf64accec78ee21c0b316f0edafe2f41908da7bd1f4a5107638eeb67040ace472a14f90d9f7c2b7def99688ba3073adb5750bb02964902a359fe745d8170e36876d4fd8a5d41b2a76cbff9a13267eb9580b2d06d10357448d20d9da2191cb5d8c93982961cdfdeda629e37f1fb09a0722027696032fe61ed663db7a37f6f263d370f69db53a0dc0a1748bdaaff6209d5645485e6e001d1953255757e4b8e42813347b11da6ab500fd0ace7e6dfa3736199ccaf9397ed0745a427dcfa6cd67bcb1acff3',\n exponent: '010001'\n }];\n\n private publicKeysParsed: {\n [hex: string]: RSAPublicKeyHex\n } = {};\n private prepared = false;\n private preparePromise: Promise = null;\n\n constructor() {\n if(Modes.test) {\n this.publisKeysHex = this.testPublicKeysHex;\n }\n }\n\n public prepare(): Promise {\n if(this.preparePromise) return this.preparePromise;\n else if(this.prepared) {\n return Promise.resolve();\n }\n\n return this.preparePromise = Promise.all(this.publisKeysHex.map((keyParsed) => {\n const RSAPublicKey = new TLSerialization();\n RSAPublicKey.storeBytes(bytesFromHex(keyParsed.modulus), 'n');\n RSAPublicKey.storeBytes(bytesFromHex(keyParsed.exponent), 'e');\n\n const buffer = RSAPublicKey.getBuffer();\n\n return cryptoWorker.invokeCrypto('sha1', buffer).then((bytes) => {\n const fingerprintBytes = bytes.slice(-8);\n fingerprintBytes.reverse();\n\n this.publicKeysParsed[bytesToHex(fingerprintBytes).toLowerCase()] = {\n modulus: keyParsed.modulus,\n exponent: keyParsed.exponent\n };\n });\n })).then(() => {\n this.prepared = true;\n\n // console.log('[MT] Prepared keys');\n this.preparePromise = null;\n });\n }\n\n public async select(fingerprints: Array) {\n await this.prepare();\n\n for(let i = 0; i < fingerprints.length; ++i) {\n let fingerprintHex = bigInt(fingerprints[i]).toString(16).toLowerCase();\n\n if(fingerprintHex.length < 16) {\n fingerprintHex = new Array(16 - fingerprintHex.length).fill('0').join('') + fingerprintHex;\n }\n\n // console.log(fingerprintHex, this.publicKeysParsed);\n const foundKey = this.publicKeysParsed[fingerprintHex];\n if(foundKey) {\n return Object.assign({\n fingerprint: fingerprints[i]\n }, foundKey);\n }\n }\n }\n}\n\nexport default new RSAKeysManager();\n","export default function bytesXor(bytes1: Uint8Array, bytes2: Uint8Array) {\n const len = bytes1.length;\n const bytes = new Uint8Array(len);\n\n for(let i = 0; i < len; ++i) {\n bytes[i] = bytes1[i] ^ bytes2[i];\n }\n\n return bytes;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\n \nimport transportController from './transports/controller';\n \n\nimport {TLSerialization, TLDeserialization} from './tl_utils';\nimport {TransportType} from './dcConfigurator';\nimport rsaKeysManager from './rsaKeysManager';\n\nimport CryptoWorker from '../crypto/cryptoMessagePort';\n\nimport {logger, LogTypes} from '../logger';\nimport DEBUG from '../../config/debug';\nimport {Awaited, DcId} from '../../types';\nimport addPadding from '../../helpers/bytes/addPadding';\nimport bytesCmp from '../../helpers/bytes/bytesCmp';\nimport bytesFromHex from '../../helpers/bytes/bytesFromHex';\nimport bytesToHex from '../../helpers/bytes/bytesToHex';\nimport bytesXor from '../../helpers/bytes/bytesXor';\nimport {bigIntFromBytes} from '../../helpers/bigInt/bigIntConversion';\nimport bigInt from 'big-integer';\nimport randomize from '../../helpers/array/randomize';\nimport {AppManager} from '../appManagers/manager';\n\n/* let fNewNonce: any = bytesFromHex('8761970c24cb2329b5b2459752c502f3057cb7e8dbab200e526e8767fdc73b3c').reverse();\nlet fNonce: any = bytesFromHex('b597720d11faa5914ef485c529cde414').reverse();\nlet fResult: any = new Uint8Array(bytesFromHex('000000000000000001b473a0661b285e480000006324160514e4cd29c585f44e91a5fa110d7297b5c0c4134c84893db5715ecd56af5ed618082182053cc5de91cd00000015c4b51c02000000a5b7f709355fc30b216be86c022bb4c3'));\n\nfNewNonce = false;\nfNonce = false;\nfResult = false; */\n\ntype AuthOptions = {\n dcId: number,\n nonce: Uint8Array,\n\n serverNonce?: Uint8Array,\n pq?: Uint8Array,\n fingerprints?: string[],\n publicKey?: {\n modulus: string,\n exponent: string,\n fingerprint: string\n },\n\n // good\n p?: Uint8Array,\n q?: Uint8Array,\n\n newNonce?: Uint8Array,\n\n retry?: number,\n\n b?: Uint8Array,\n g?: number,\n gA?: Uint8Array,\n dhPrime?: Uint8Array,\n\n tmpAesKey?: Uint8Array,\n tmpAesIv?: Uint8Array,\n\n authKeyId?: Uint8Array,\n authKey?: Uint8Array,\n serverSalt?: Uint8Array,\n\n localTime?: number,\n serverTime?: any,\n};\n\ntype ResPQ = {\n _: 'resPQ';\n nonce: Uint8Array;\n pq: Uint8Array;\n server_nonce: Uint8Array;\n server_public_key_fingerprints: string[];\n};\n\ntype P_Q_inner_data = {\n _: 'p_q_inner_data_dc';\n pq: Uint8Array;\n p: Uint8Array;\n q: Uint8Array;\n nonce: Uint8Array;\n server_nonce: Uint8Array;\n new_nonce: Uint8Array;\n dc: number;\n};\n\ntype req_DH_params = {\n nonce: Uint8Array;\n server_nonce: Uint8Array;\n p: Uint8Array;\n q: Uint8Array;\n public_key_fingerprint: string;\n encrypted_data: Uint8Array;\n};\n\nexport class Authorizer extends AppManager {\n private cached: {\n [dcId: DcId]: Promise\n };\n\n private log: ReturnType;\n\n private transportType: TransportType;\n\n \n private getTransportTypePromise: Promise;\n \n\n protected after() {\n this.cached = {};\n this.log = logger(`AUTHORIZER`, LogTypes.Error | LogTypes.Log);\n }\n\n private sendPlainRequest(dcId: DcId, requestArray: Uint8Array) {\n const requestLength = requestArray.byteLength;\n\n const header = new TLSerialization();\n header.storeLongP(0, 0, 'auth_key_id');\n header.storeLong(this.timeManager.generateId(), 'msg_id');\n header.storeInt(requestLength, 'request_length');\n\n const headerArray = header.getBytes(true) as Uint8Array;\n const resultArray = new Uint8Array(headerArray.byteLength + requestLength);\n resultArray.set(headerArray);\n resultArray.set(requestArray, headerArray.length);\n\n const transport = this.dcConfigurator.chooseServer(dcId, 'client', this.transportType);\n const baseError = {\n code: 406,\n type: 'NETWORK_BAD_RESPONSE'\n };\n\n if(DEBUG) {\n this.log('mtpSendPlainRequest: creating requestPromise');\n }\n\n const promise = transport.send(resultArray) as any as Promise;\n return promise.then((result) => {\n if(DEBUG) {\n this.log('mtpSendPlainRequest: in good sector', result);\n }\n\n if(!result || !result.byteLength) {\n throw baseError;\n }\n\n try {\n /* result = fResult ? fResult : result;\n fResult = new Uint8Array(0); */\n\n const deserializer = new TLDeserialization(result, {mtproto: true});\n\n if(result.length === 4) {\n const errorCode = deserializer.fetchInt();\n this.log.error('mtpSendPlainRequest: wrong response, error code:', errorCode);\n throw errorCode;\n }\n\n const auth_key_id = deserializer.fetchLong('auth_key_id');\n if(auth_key_id !== '0') this.log.error('auth_key_id !== 0', auth_key_id);\n\n const msg_id = deserializer.fetchLong('msg_id');\n if(msg_id === '0') this.log.error('msg_id === 0', msg_id);\n\n const msg_len = deserializer.fetchInt('msg_len');\n if(!msg_len) this.log.error('no msg_len', msg_len);\n\n return deserializer;\n } catch(e) {\n this.log.error('mtpSendPlainRequest: deserialization went bad', e);\n const error = Object.assign(baseError, {originalError: e});\n throw error;\n }\n }, (error) => {\n if(!error.message && !error.type) {\n error = Object.assign(baseError, {\n originalError: error\n });\n }\n\n throw error;\n });\n }\n\n private async sendReqPQ(auth: AuthOptions) {\n const request = new TLSerialization({mtproto: true});\n\n request.storeMethod('req_pq_multi', {nonce: auth.nonce});\n\n if(DEBUG) {\n this.log('Send req_pq', bytesToHex(auth.nonce));\n }\n\n let deserializer: Awaited>;\n try {\n const promise = this.sendPlainRequest(auth.dcId, request.getBytes(true));\n rsaKeysManager.prepare();\n deserializer = await promise;\n } catch(error) {\n this.log.error('req_pq error', (error as Error).message);\n throw error;\n }\n\n const response: ResPQ = deserializer.fetchObject('ResPQ');\n\n if(response._ !== 'resPQ') {\n throw new Error('[MT] resPQ response invalid: ' + response._);\n }\n\n if(!bytesCmp(auth.nonce, response.nonce)) {\n this.log.error(auth.nonce, response.nonce);\n throw new Error('[MT] resPQ nonce mismatch');\n }\n\n auth.serverNonce = response.server_nonce; // need\n auth.pq = response.pq;\n auth.fingerprints = response.server_public_key_fingerprints;\n\n if(DEBUG) {\n this.log('Got ResPQ', bytesToHex(auth.serverNonce), bytesToHex(auth.pq), auth.fingerprints);\n }\n\n const publicKey = await rsaKeysManager.select(auth.fingerprints);\n if(!publicKey) {\n throw new Error('[MT] No public key found');\n }\n\n auth.publicKey = publicKey;\n\n if(DEBUG) {\n this.log('PQ factorization start', auth.pq);\n }\n\n // let pAndQ: Awaited>;\n try {\n var pAndQ = await CryptoWorker.invokeCrypto('factorize', auth.pq);\n } catch(error) {\n this.log.error('worker error factorize', error);\n throw error;\n }\n\n auth.p = pAndQ[0];\n auth.q = pAndQ[1];\n\n if(DEBUG) {\n this.log('PQ factorization done', pAndQ);\n }\n\n return this.sendReqDhParams(auth);\n }\n\n private async sendReqDhParams(auth: AuthOptions): Promise {\n auth.newNonce = randomize(new Uint8Array(32));\n\n const p_q_inner_data_dc: P_Q_inner_data = {\n _: 'p_q_inner_data_dc',\n pq: auth.pq,\n p: auth.p,\n q: auth.q,\n nonce: auth.nonce,\n server_nonce: auth.serverNonce,\n new_nonce: auth.newNonce,\n dc: 0\n };\n\n const pQInnerDataSerialization = new TLSerialization({mtproto: true});\n pQInnerDataSerialization.storeObject(p_q_inner_data_dc, 'P_Q_inner_data', 'DECRYPTED_DATA');\n\n const data = pQInnerDataSerialization.getBytes(true);\n if(data.length > 144) {\n throw 'DH_params: data is more than 144 bytes!';\n }\n\n const dataWithPadding = addPadding(data, 192, false, true, false);\n const dataPadReversed = dataWithPadding.slice().reverse();\n\n const getKeyAesEncrypted = async() => {\n for(;;) {\n const tempKey = randomize(new Uint8Array(32));\n const dataWithHash = dataPadReversed.concat(await CryptoWorker.invokeCrypto('sha256', tempKey.concat(dataWithPadding)));\n if(dataWithHash.length !== 224) {\n throw 'DH_params: dataWithHash !== 224 bytes!';\n }\n\n const aesEncrypted = await CryptoWorker.invokeCrypto('aes-encrypt', dataWithHash, tempKey, new Uint8Array([0]));\n const tempKeyXor = bytesXor(tempKey, await CryptoWorker.invokeCrypto('sha256', aesEncrypted));\n const keyAesEncrypted = tempKeyXor.concat(aesEncrypted);\n\n const keyAesEncryptedBigInt = bigIntFromBytes(keyAesEncrypted);\n const publicKeyModulusBigInt = bigInt(auth.publicKey.modulus, 16);\n\n if(keyAesEncryptedBigInt.compare(publicKeyModulusBigInt) === -1) {\n return keyAesEncrypted;\n }\n }\n };\n\n const keyAesEncrypted = await getKeyAesEncrypted();\n const encryptedData = addPadding(await CryptoWorker.invokeCrypto('rsa-encrypt', keyAesEncrypted, auth.publicKey), 256, true, true, true);\n\n const req_DH_params: req_DH_params = {\n nonce: auth.nonce,\n server_nonce: auth.serverNonce,\n p: auth.p,\n q: auth.q,\n public_key_fingerprint: auth.publicKey.fingerprint,\n encrypted_data: encryptedData\n };\n\n const request = new TLSerialization({mtproto: true});\n request.storeMethod('req_DH_params', req_DH_params);\n\n const requestBytes = request.getBytes(true);\n\n if(DEBUG) {\n this.log('Send req_DH_params', req_DH_params/* , requestBytes.hex */);\n }\n\n let deserializer: Awaited>;\n try {\n deserializer = await this.sendPlainRequest(auth.dcId, requestBytes);\n } catch(error) {\n this.log.error('Send req_DH_params FAIL!', error);\n throw error;\n }\n\n const response = deserializer.fetchObject('Server_DH_Params', 'RESPONSE');\n\n if(DEBUG) {\n this.log('Sent req_DH_params, response:', response);\n }\n\n if(response._ !== 'server_DH_params_fail' && response._ !== 'server_DH_params_ok') {\n throw new Error('[MT] Server_DH_Params response invalid: ' + response._);\n }\n\n if(!bytesCmp(auth.nonce, response.nonce)) {\n throw new Error('[MT] Server_DH_Params nonce mismatch');\n }\n\n if(!bytesCmp(auth.serverNonce, response.server_nonce)) {\n throw new Error('[MT] Server_DH_Params server_nonce mismatch');\n }\n\n if(response._ === 'server_DH_params_fail') {\n const newNonceHash = (await CryptoWorker.invokeCrypto('sha1', auth.newNonce)).slice(-16);\n if(!bytesCmp(newNonceHash, response.new_nonce_hash)) {\n throw new Error('[MT] server_DH_params_fail new_nonce_hash mismatch');\n }\n\n throw new Error('[MT] server_DH_params_fail');\n }\n\n // fill auth object\n try {\n await this.decryptServerDhDataAnswer(auth, response.encrypted_answer);\n } catch(e) {\n this.log.error('mtpDecryptServerDhDataAnswer FAILED!', e);\n throw e;\n }\n\n // console.log(dT(), 'mtpSendReqDhParams: executing mtpSendSetClientDhParams...');\n\n return this.sendSetClientDhParams(auth);\n }\n\n private async decryptServerDhDataAnswer(auth: AuthOptions, encryptedAnswer: any) {\n auth.localTime = Date.now();\n\n // ! can't concat Array with Uint8Array!\n auth.tmpAesKey = (await CryptoWorker.invokeCrypto('sha1', auth.newNonce.concat(auth.serverNonce)))\n .concat((await CryptoWorker.invokeCrypto('sha1', auth.serverNonce.concat(auth.newNonce))).slice(0, 12));\n\n auth.tmpAesIv = (await CryptoWorker.invokeCrypto('sha1', auth.serverNonce.concat(auth.newNonce))).slice(12)\n .concat(await CryptoWorker.invokeCrypto('sha1', auth.newNonce.concat(auth.newNonce)), auth.newNonce.slice(0, 4));\n\n const answerWithHash = new Uint8Array(await CryptoWorker.invokeCrypto('aes-decrypt', encryptedAnswer, auth.tmpAesKey, auth.tmpAesIv));\n\n const hash = answerWithHash.slice(0, 20);\n const answerWithPadding = answerWithHash.slice(20);\n\n const deserializer = new TLDeserialization(answerWithPadding, {mtproto: true});\n const response = deserializer.fetchObject('Server_DH_inner_data');\n\n if(response._ !== 'server_DH_inner_data') {\n throw new Error('[MT] server_DH_inner_data response invalid: ' + response);\n }\n\n if(!bytesCmp(auth.nonce, response.nonce)) {\n throw new Error('[MT] server_DH_inner_data nonce mismatch');\n }\n\n if(!bytesCmp(auth.serverNonce, response.server_nonce)) {\n throw new Error('[MT] server_DH_inner_data serverNonce mismatch');\n }\n\n if(DEBUG) {\n this.log('Done decrypting answer');\n }\n auth.g = response.g;\n auth.dhPrime = response.dh_prime;\n auth.gA = response.g_a;\n auth.serverTime = response.server_time;\n auth.retry = 0;\n\n this.verifyDhParams(auth.g, auth.dhPrime, auth.gA);\n\n const offset = deserializer.getOffset();\n\n if(!bytesCmp(hash, await CryptoWorker.invokeCrypto('sha1', answerWithPadding.slice(0, offset)))) {\n throw new Error('[MT] server_DH_inner_data SHA1 mismatch');\n }\n\n this.timeManager.applyServerTime(auth.serverTime, auth.localTime);\n }\n\n private verifyDhParams(g: number, dhPrime: Uint8Array, gA: Uint8Array) {\n if(DEBUG) {\n this.log('Verifying DH params', g, dhPrime, gA);\n }\n\n const dhPrimeHex = bytesToHex(dhPrime);\n if(g !== 3 || dhPrimeHex !== 'c71caeb9c6b1c9048e6c522f70f13f73980d40238e3e21c14934d037563d930f48198a0aa7c14058229493d22530f4dbfa336f6e0ac925139543aed44cce7c3720fd51f69458705ac68cd4fe6b6b13abdc9746512969328454f18faf8c595f642477fe96bb2a941d5bcd1d4ac8cc49880708fa9b378e3c4f3a9060bee67cf9a4a4a695811051907e162753b56b0f6b410dba74d8a84b2a14b3144e0ef1284754fd17ed950d5965b4b9dd46582db1178d169c6bc465b0d6ff9ca3928fef5b9ae4e418fc15e83ebea0f87fa9ff5eed70050ded2849f47bf959d956850ce929851f0d8115f635b105ee2e4e15d04b2454bf6f4fadf034b10403119cd8e3b92fcc5b') {\n // The verified value is from https://core.telegram.org/mtproto/security_guidelines\n throw new Error('[MT] DH params are not verified: unknown dhPrime');\n }\n\n if(DEBUG) {\n this.log('dhPrime cmp OK');\n }\n\n const gABigInt = bigIntFromBytes(gA);\n const dhPrimeBigInt = bigInt(dhPrimeHex, 16);\n\n if(gABigInt.compare(bigInt.one) <= 0) {\n throw new Error('[MT] DH params are not verified: gA <= 1');\n }\n\n if(gABigInt.compare(dhPrimeBigInt.subtract(bigInt.one)) >= 0) {\n throw new Error('[MT] DH params are not verified: gA >= dhPrime - 1');\n }\n\n if(DEBUG) {\n this.log('1 < gA < dhPrime-1 OK');\n }\n\n const twoPow = bigInt(2).pow(2048 - 64);\n\n if(gABigInt.compare(twoPow) < 0) {\n throw new Error('[MT] DH params are not verified: gA < 2^{2048-64}');\n }\n if(gABigInt.compare(dhPrimeBigInt.subtract(twoPow)) >= 0) {\n throw new Error('[MT] DH params are not verified: gA > dhPrime - 2^{2048-64}');\n }\n\n if(DEBUG) {\n this.log('2^{2048-64} < gA < dhPrime-2^{2048-64} OK');\n }\n\n return true;\n }\n\n private async sendSetClientDhParams(auth: AuthOptions): Promise {\n const gBytes = bytesFromHex(auth.g.toString(16));\n\n auth.b = randomize(new Uint8Array(256));\n // MTProto.secureRandom.nextBytes(auth.b);\n\n // let gB: Awaited>;\n try {\n var gB = await CryptoWorker.invokeCrypto('mod-pow', gBytes, auth.b, auth.dhPrime);\n } catch(error) {\n throw error;\n }\n\n const data = new TLSerialization({mtproto: true});\n data.storeObject({\n _: 'client_DH_inner_data',\n nonce: auth.nonce,\n server_nonce: auth.serverNonce,\n retry_id: [0, auth.retry++],\n g_b: gB\n }, 'Client_DH_Inner_Data');\n\n const dataWithHash = (await CryptoWorker.invokeCrypto('sha1', data.getBuffer())).concat(data.getBytes(true));\n const encryptedData = await CryptoWorker.invokeCrypto('aes-encrypt', dataWithHash, auth.tmpAesKey, auth.tmpAesIv);\n\n const request = new TLSerialization({mtproto: true});\n request.storeMethod('set_client_DH_params', {\n nonce: auth.nonce,\n server_nonce: auth.serverNonce,\n encrypted_data: encryptedData\n });\n\n if(DEBUG) {\n this.log('Send set_client_DH_params');\n }\n\n let deserializer: Awaited>;\n try {\n deserializer = await this.sendPlainRequest(auth.dcId, request.getBytes(true));\n } catch(err) {\n throw err;\n }\n\n const response = deserializer.fetchObject('Set_client_DH_params_answer');\n\n if(response._ !== 'dh_gen_ok' && response._ !== 'dh_gen_retry' && response._ !== 'dh_gen_fail') {\n throw new Error('[MT] Set_client_DH_params_answer response invalid: ' + response._);\n }\n\n if(!bytesCmp(auth.nonce, response.nonce)) {\n throw new Error('[MT] Set_client_DH_params_answer nonce mismatch');\n }\n\n if(!bytesCmp(auth.serverNonce, response.server_nonce)) {\n throw new Error('[MT] Set_client_DH_params_answer server_nonce mismatch');\n }\n\n // let authKey: Uint8Array;\n try {\n var authKey = await CryptoWorker.invokeCrypto('mod-pow', auth.gA, auth.b, auth.dhPrime);\n } catch(err) {\n throw authKey;\n }\n\n const authKeyHash = await CryptoWorker.invokeCrypto('sha1', authKey),\n authKeyAux = authKeyHash.slice(0, 8),\n authKeyId = authKeyHash.slice(-8);\n\n if(DEBUG) {\n this.log('Got Set_client_DH_params_answer', response._, authKey);\n }\n switch(response._) {\n case 'dh_gen_ok': {\n const newNonceHash1 = (await CryptoWorker.invokeCrypto('sha1', auth.newNonce.concat([1], authKeyAux))).slice(-16);\n\n if(!bytesCmp(newNonceHash1, response.new_nonce_hash1)) {\n this.log.error('Set_client_DH_params_answer new_nonce_hash1 mismatch', newNonceHash1, response);\n throw new Error('new_nonce_hash1 mismatch');\n }\n\n const serverSalt = bytesXor(auth.newNonce.slice(0, 8), auth.serverNonce.slice(0, 8));\n if(DEBUG) {\n this.log('Auth successfull!', authKeyId, authKey, serverSalt);\n }\n\n auth.authKeyId = authKeyId;\n auth.authKey = authKey;\n auth.serverSalt = serverSalt;\n\n return auth;\n }\n\n case 'dh_gen_retry': {\n const newNonceHash2 = (await CryptoWorker.invokeCrypto('sha1', auth.newNonce.concat([2], authKeyAux))).slice(-16);\n if(!bytesCmp(newNonceHash2, response.new_nonce_hash2)) {\n throw new Error('[MT] Set_client_DH_params_answer new_nonce_hash2 mismatch');\n }\n\n return this.sendSetClientDhParams(auth);\n }\n\n case 'dh_gen_fail': {\n const newNonceHash3 = (await CryptoWorker.invokeCrypto('sha1', auth.newNonce.concat([3], authKeyAux))).slice(-16);\n if(!bytesCmp(newNonceHash3, response.new_nonce_hash3)) {\n throw new Error('[MT] Set_client_DH_params_answer new_nonce_hash3 mismatch');\n }\n\n throw new Error('[MT] Set_client_DH_params_answer fail');\n }\n }\n }\n\n \n private getTransportType() {\n if(this.getTransportTypePromise) return this.getTransportTypePromise;\n return this.getTransportTypePromise = transportController.pingTransports().then(({websocket}) => {\n this.transportType = websocket ? 'websocket' : 'https';\n this.log('will use transport:', this.transportType);\n });\n }\n \n\n public auth(dcId: DcId) {\n let promise = this.cached[dcId];\n if(promise) {\n return promise;\n }\n\n promise = new Promise(async(resolve, reject) => {\n \n await this.getTransportType();\n \n\n let error: ApiError;\n let _try = 1;\n while(_try++ <= 3) {\n try {\n const auth: AuthOptions = {\n dcId,\n nonce: randomize(new Uint8Array(16))\n };\n\n const promise = this.sendReqPQ(auth);\n resolve(await promise);\n return;\n } catch(err) {\n error = err;\n }\n }\n\n reject(error);\n });\n\n return this.cached[dcId] = promise;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport sessionStorage from '../sessionStorage';\nimport {nextRandomUint} from '../../helpers/random';\nimport {WorkerTaskVoidTemplate} from '../../types';\nimport ulongFromInts from '../../helpers/long/ulongFromInts';\nimport {AppManager} from '../appManagers/manager';\n\n/*\nlet lol: any = {};\nfor(var i = 0; i < 100; i++) {\n timeManager.generateId();\n}\n*/\n\nexport interface ApplyServerTimeOffsetTask extends WorkerTaskVoidTemplate {\n type: 'applyServerTimeOffset',\n payload: TimeManager['timeOffset']\n};\n\nexport class TimeManager extends AppManager {\n private lastMessageId: [number, number];\n private timeOffset: number;\n\n /* private midnightNoOffset: number;\n private midnightOffseted: Date;\n\n private midnightOffset: number; */\n\n /* private timeParams: {\n midnightOffset: number,\n serverTimeOffset: number\n }; */\n\n protected after() {\n this.lastMessageId = [0, 0];\n this.timeOffset = 0;\n\n sessionStorage.get('server_time_offset').then((to) => {\n if(to) {\n this.timeOffset = to;\n }\n });\n\n\n // * migrated from ServerTimeManager\n /* const timestampNow = tsNow(true);\n this.midnightNoOffset = timestampNow - (timestampNow % 86400);\n this.midnightOffseted = new Date();\n this.midnightOffseted.setHours(0, 0, 0, 0);\n\n this.midnightOffset = this.midnightNoOffset - (Math.floor(+this.midnightOffseted / 1000)); */\n\n /* this.timeParams = {\n midnightOffset: this.midnightOffset,\n serverTimeOffset: this.serverTimeOffset\n }; */\n }\n\n public getServerTimeOffset() {\n return this.timeOffset;\n }\n\n public generateId(): string {\n const timeTicks = Date.now(),\n timeSec = Math.floor(timeTicks / 1000) + this.timeOffset,\n timeMSec = timeTicks % 1000,\n random = nextRandomUint(16);\n\n let messageId: TimeManager['lastMessageId'] = [timeSec, (timeMSec << 21) | (random << 3) | 4];\n if(this.lastMessageId[0] > messageId[0] ||\n this.lastMessageId[0] === messageId[0] && this.lastMessageId[1] >= messageId[1]) {\n messageId = [this.lastMessageId[0], this.lastMessageId[1] + 4];\n }\n\n this.lastMessageId = messageId;\n\n const ret = ulongFromInts(messageId[0], messageId[1]).toString(10);\n\n // if(lol[ret]) {\n // console.error('[TimeManager]: Generated SAME msg id', messageId, this.timeOffset, ret);\n // }\n // lol[ret] = true;\n\n // console.log('[TimeManager]: Generated msg id', messageId, this.timeOffset, ret);\n\n return ret\n }\n\n public applyServerTime(serverTime: number, localTime?: number) {\n localTime = (localTime || Date.now()) / 1000 | 0;\n const newTimeOffset = serverTime - localTime;\n const changed = Math.abs(this.timeOffset - newTimeOffset) > 10;\n this.lastMessageId = [0, 0];\n\n if(this.timeOffset !== newTimeOffset) {\n sessionStorage.set({\n server_time_offset: newTimeOffset\n });\n\n this.timeOffset = newTimeOffset;\n }\n\n // console.log('[TimeManager]: Apply server time', serverTime, localTime, newTimeOffset, changed);\n\n return changed;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {DocumentAttribute, WebDocument} from '../../layer';\n\nexport default class AppWebDocsManager {\n public saveWebDocument(webDocument: WebDocument) {\n if(!webDocument) {\n return;\n }\n\n const attribute: DocumentAttribute.documentAttributeImageSize = webDocument.attributes.find((attribute) => attribute._ === 'documentAttributeImageSize') as any;\n if(attribute) {\n webDocument.w = attribute.w;\n webDocument.h = attribute.h;\n }\n\n return webDocument;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {InputInvoice, InputPaymentCredentials, PaymentRequestedInfo, PaymentsPaymentForm} from '../../layer';\nimport {AppManager} from './manager';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\n\nexport default class AppPaymentsManager extends AppManager {\n public getInputInvoiceBySlug(slug: string): InputInvoice.inputInvoiceSlug {\n return {\n _: 'inputInvoiceSlug',\n slug\n };\n }\n\n public getInputInvoiceByPeerId(peerId: PeerId, mid: number): InputInvoice.inputInvoiceMessage {\n return {\n _: 'inputInvoiceMessage',\n peer: this.appPeersManager.getInputPeerById(peerId),\n msg_id: getServerMessageId(mid)\n };\n }\n\n public getPaymentForm(invoice: InputInvoice) {\n return this.apiManager.invokeApi('payments.getPaymentForm', {\n invoice\n }).then((paymentForm) => {\n this.appUsersManager.saveApiUsers(paymentForm.users);\n\n return paymentForm;\n });\n }\n\n public getPaymentReceipt(peerId: PeerId, mid: number) {\n return this.apiManager.invokeApi('payments.getPaymentReceipt', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n msg_id: getServerMessageId(mid)\n }).then((paymentForm) => {\n this.appUsersManager.saveApiUsers(paymentForm.users);\n\n return paymentForm;\n });\n }\n\n public validateRequestedInfo(invoice: InputInvoice, info: PaymentRequestedInfo, save?: boolean) {\n return this.apiManager.invokeApi('payments.validateRequestedInfo', {\n save,\n invoice,\n info\n });\n }\n\n public sendPaymentForm(\n invoice: InputInvoice,\n formId: PaymentsPaymentForm['form_id'],\n requestedInfoId: string,\n shippingOptionId: string,\n credentials: InputPaymentCredentials,\n tipAmount?: number\n ) {\n return this.apiManager.invokeApi('payments.sendPaymentForm', {\n form_id: formId,\n invoice,\n requested_info_id: requestedInfoId,\n shipping_option_id: shippingOptionId,\n credentials,\n tip_amount: tipAmount || undefined\n }).then((result) => {\n if(result._ === 'payments.paymentResult') {\n this.apiUpdatesManager.processUpdateMessage(result.updates);\n }\n\n return result;\n });\n }\n\n public clearSavedInfo(info?: boolean, credentials?: boolean) {\n return this.apiManager.invokeApi('payments.clearSavedInfo', {\n info,\n credentials\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MessageSendingParams} from './appMessagesManager';\nimport {AppManager} from './manager';\nimport {AttachMenuBots, AttachMenuBot, Update, DataJSON} from '../../layer';\nimport assumeType from '../../helpers/assumeType';\nimport makeError from '../../helpers/makeError';\nimport getAttachMenuBotIcon from './utils/attachMenuBots/getAttachMenuBotIcon';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\n\nexport default class AppAttachMenuBotsManager extends AppManager {\n private attachMenuBots: Map;\n private attachMenuBotsArr: AttachMenuBot[];\n\n protected after() {\n this.clear(true);\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateAttachMenuBots: this.onUpdateAttachMenuBots\n });\n }\n\n public clear = (init = false) => {\n if(!init) {\n this.attachMenuBots.clear();\n this.attachMenuBotsArr = undefined;\n } else {\n this.attachMenuBots = new Map();\n }\n };\n\n private onUpdateAttachMenuBots = (update: Update.updateAttachMenuBots) => {\n this.clear();\n this.getAttachMenuBots();\n };\n\n public saveAttachMenuBot(attachMenuBot: AttachMenuBot) {\n this.attachMenuBots.set(attachMenuBot.bot_id, attachMenuBot);\n const icon = getAttachMenuBotIcon(attachMenuBot);\n icon.icon = this.appDocsManager.saveDoc(icon.icon, {type: 'attachMenuBotIcon', botId: attachMenuBot.bot_id});\n return attachMenuBot;\n }\n\n public saveAttachMenuBots(attachMenuBots: AttachMenuBot[]) {\n if((attachMenuBots as any).saved) return;\n (attachMenuBots as any).saved = true;\n attachMenuBots.forEach((user) => this.saveAttachMenuBot(user));\n }\n\n public getAttachMenuBots() {\n return this.attachMenuBotsArr ?? this.apiManager.invokeApiSingleProcess({\n method: 'messages.getAttachMenuBots',\n processResult: (attachMenuBots) => {\n assumeType(attachMenuBots);\n this.appUsersManager.saveApiUsers(attachMenuBots.users);\n this.saveAttachMenuBots(attachMenuBots.bots);\n // ! temporary\n return this.attachMenuBotsArr = attachMenuBots.bots.slice(0, 0);\n }\n });\n }\n\n public getAttachMenuBotCached(botId: BotId) {\n return this.attachMenuBots.get(botId);\n }\n\n public getAttachMenuBot(botId: BotId, overwrite?: boolean) {\n if(!this.appUsersManager.isAttachMenuBot(botId) || true) {\n throw makeError('BOT_INVALID');\n }\n\n return (!overwrite && this.getAttachMenuBotCached(botId)) ?? this.apiManager.invokeApiSingleProcess({\n method: 'messages.getAttachMenuBot',\n params: {\n bot: this.appUsersManager.getUserInput(botId)\n },\n processResult: (attachMenuBotsBot) => {\n this.appUsersManager.saveApiUsers(attachMenuBotsBot.users);\n const attachMenuBot = this.saveAttachMenuBot(attachMenuBotsBot.bot);\n return attachMenuBot;\n }\n });\n }\n\n public requestWebView(options: MessageSendingParams & {\n botId: BotId,\n peerId: PeerId,\n // platform: string,\n startParam?: string,\n fromBotMenu?: boolean,\n url?: string,\n themeParams?: DataJSON\n }) {\n const {\n botId,\n peerId,\n url,\n fromBotMenu,\n themeParams,\n // platform,\n replyToMsgId,\n silent,\n sendAsPeerId,\n startParam,\n threadId\n } = options;\n\n const platform = 'web';\n\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.requestWebView',\n params: {\n peer: this.appPeersManager.getInputPeerById(peerId),\n bot: this.appUsersManager.getUserInput(botId),\n silent,\n platform,\n url,\n reply_to_msg_id: replyToMsgId ? getServerMessageId(replyToMsgId) : undefined,\n from_bot_menu: fromBotMenu,\n theme_params: themeParams,\n send_as: sendAsPeerId ? this.appPeersManager.getInputPeerById(sendAsPeerId) : undefined,\n start_param: startParam,\n top_msg_id: threadId ? getServerMessageId(threadId) : undefined\n },\n processResult: (result) => {\n console.log(result);\n return result;\n }\n });\n }\n\n public prolongWebView(options: MessageSendingParams & {\n peerId: PeerId,\n botId: BotId,\n queryId: string | number\n }) {\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.prolongWebView',\n params: {\n peer: this.appPeersManager.getInputPeerById(options.peerId),\n bot: this.appUsersManager.getUserInput(options.botId),\n query_id: options.queryId,\n silent: options.silent,\n reply_to_msg_id: options.replyToMsgId ? getServerMessageId(options.replyToMsgId) : undefined,\n send_as: options.sendAsPeerId ? this.appPeersManager.getInputPeerById(options.sendAsPeerId) : undefined,\n top_msg_id: options.threadId ? getServerMessageId(options.threadId) : undefined\n },\n processResult: (result) => {\n console.log(result);\n }\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {UrlAuthResult} from '../../layer';\nimport {AppManager} from './manager';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\n\nexport default class AppSeamlessLoginManager extends AppManager {\n public requestUrlAuth(url: string, peerId?: PeerId, mid?: number, buttonId?: number) {\n return this.apiManager.invokeApi('messages.requestUrlAuth', {\n button_id: buttonId,\n msg_id: mid ? getServerMessageId(mid) : undefined,\n peer: peerId ? this.appPeersManager.getInputPeerById(peerId) : undefined,\n url\n }).then((urlAuthResult) => {\n if(urlAuthResult._ === 'urlAuthResultRequest') {\n this.appUsersManager.saveApiUser(urlAuthResult.bot);\n }\n\n return urlAuthResult;\n });\n }\n\n public acceptUrlAuth(url: string, peerId?: PeerId, mid?: number, buttonId?: number, writeAllowed?: boolean) {\n return this.apiManager.invokeApi('messages.acceptUrlAuth', {\n button_id: buttonId,\n msg_id: mid ? getServerMessageId(mid) : undefined,\n peer: peerId ? this.appPeersManager.getInputPeerById(peerId) : undefined,\n url,\n write_allowed: writeAllowed\n }).then((urlAuthResult) => {\n return urlAuthResult as Exclude;\n });\n }\n\n public getWebAuthorizations() {\n return this.apiManager.invokeApi('account.getWebAuthorizations').then((webAuthorizations) => {\n this.appUsersManager.saveApiUsers(webAuthorizations.users);\n return webAuthorizations.authorizations;\n });\n }\n\n public resetWebAuthorization(hash: Long) {\n return this.apiManager.invokeApi('account.resetWebAuthorization', {\n hash\n });\n }\n\n public resetWebAuthorizations() {\n return this.apiManager.invokeApi('account.resetWebAuthorizations');\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport assumeType from '../../helpers/assumeType';\nimport {AccountThemes, AccountWallPapers, InputWallPaper, WallPaper} from '../../layer';\nimport {AppManager} from './manager';\n\ntype WallPaperId = WallPaper['id'];\n\nexport default class AppThemesManager extends AppManager {\n private wallPapers: {[id: WallPaperId]: WallPaper};\n\n protected after() {\n this.wallPapers = {};\n }\n\n private saveWallPaper(wallPaper: WallPaper) {\n if(!wallPaper) {\n return wallPaper;\n }\n // const oldWallPaper = this.wallPapers[wallPaper.id];\n\n // ! IT'S BROKEN NOW. SERVER RETURNS SAME ID FOR DIFFERENT WALLPAPERS\n // if(oldWallPaper) {\n // console.log('rewrite', {...oldWallPaper}, {...wallPaper});\n // }\n\n if(wallPaper._ !== 'wallPaperNoFile') {\n wallPaper.document = this.appDocsManager.saveDoc(wallPaper.document, {type: 'wallPaper', wallPaperId: wallPaper.id});\n }\n\n // if(oldWallPaper) {\n // return Object.assign(oldWallPaper, wallPaper);\n // } else {\n this.wallPapers[wallPaper.id] = wallPaper;\n // }\n\n return wallPaper;\n }\n\n public getWallPaper(inputWallPaper: InputWallPaper) {\n return this.apiManager.invokeApiSingleProcess({\n method: 'account.getWallPaper',\n params: {wallpaper: inputWallPaper},\n processResult: (wallPaper) => {\n return this.saveWallPaper(wallPaper);\n }\n });\n }\n\n public getInputWallPaper(wallPaper: WallPaper | string): InputWallPaper {\n if(typeof(wallPaper) === 'string') {\n return {_: 'inputWallPaperSlug', slug: wallPaper};\n } else if(wallPaper._ === 'wallPaperNoFile') {\n return {_: 'inputWallPaperNoFile', id: wallPaper.id};\n } else {\n return {_: 'inputWallPaper', id: wallPaper.id, access_hash: wallPaper.access_hash};\n }\n }\n\n public getWallPaperById(id: WallPaperId) {\n const wallPaper = this.wallPapers[id];\n return this.getWallPaper(this.getInputWallPaper(wallPaper));\n }\n\n public getThemes() {\n return this.apiManager.invokeApiSingleProcess({\n method: 'account.getThemes',\n params: {format: 'macos', hash: 0},\n processResult: (accountThemes) => {\n assumeType(accountThemes);\n\n accountThemes.themes.forEach((theme) => {\n if(!theme.settings) {\n return;\n }\n\n theme.settings.forEach((themeSettings) => {\n themeSettings.wallpaper = this.saveWallPaper(themeSettings.wallpaper);\n });\n });\n\n return accountThemes.themes;\n }\n });\n }\n\n public getWallPapers() {\n return this.apiManager.invokeApiHashable({method: 'account.getWallPapers'}).then((accountWallpapers) => {\n const wallPapers = (accountWallpapers as AccountWallPapers.accountWallPapers).wallpapers;\n wallPapers.forEach((wallPaper, idx, arr) => {\n arr[idx] = this.saveWallPaper(wallPaper);\n });\n\n return wallPapers;\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport App from '../../config/app';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport callbackify from '../../helpers/callbackify';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport cryptoMessagePort from '../crypto/cryptoMessagePort';\nimport MTProtoMessagePort from '../mtproto/mtprotoMessagePort';\nimport appStateManager from './appStateManager';\nimport {AppStoragesManager} from './appStoragesManager';\nimport createManagers from './createManagers';\n\ntype Managers = Awaited>;\n\nexport class AppManagersManager {\n private managers: Managers | Promise;\n private cryptoWorkersURLs: string[];\n private cryptoPortsAttached: number;\n private cryptoPortPromise: CancellablePromise;\n\n constructor() {\n this.cryptoWorkersURLs = [];\n this.cryptoPortsAttached = 0;\n this.cryptoPortPromise = deferredPromise();\n this.cryptoPortPromise.then(() => {\n this.cryptoPortPromise = undefined;\n });\n }\n\n public start() {\n const port = MTProtoMessagePort.getInstance();\n\n port.addEventListener('manager', ({name, method, args}) => {\n return callbackify(this.getManagers(), (managers) => {\n // @ts-ignore\n const manager = managers[name];\n return manager[method].apply(manager, args);\n });\n });\n\n port.addEventListener('cryptoPort', (payload, source, event) => {\n const port = event.ports[0];\n if(this.cryptoPortsAttached >= this.cryptoWorkersURLs.length) {\n port.close();\n return;\n }\n\n ++this.cryptoPortsAttached;\n cryptoMessagePort.attachPort(port);\n this.cryptoPortPromise?.resolve();\n });\n\n port.addEventListener('createProxyWorkerURLs', ({originalUrl, blob}) => {\n let length = this.cryptoWorkersURLs.length;\n if(!length) {\n this.cryptoWorkersURLs.push(originalUrl);\n ++length;\n }\n\n const maxLength = App.cryptoWorkers;\n if(length === maxLength) {\n return this.cryptoWorkersURLs;\n }\n\n const newURLs = new Array(maxLength - length).fill(undefined).map(() => URL.createObjectURL(blob));\n this.cryptoWorkersURLs.push(...newURLs);\n return this.cryptoWorkersURLs;\n });\n }\n\n public async createManagers() {\n const appStoragesManager = new AppStoragesManager();\n\n await Promise.all([\n // new Promise(() => {}),\n appStoragesManager.loadStorages(),\n this.cryptoPortPromise\n ]);\n\n const managers = await createManagers(appStoragesManager, appStateManager.userId);\n return this.managers = managers;\n }\n\n public getManagers() {\n return this.managers ??= this.createManagers();\n }\n}\n\nconst appManagersManager = new AppManagersManager();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.appManagersManager = appManagersManager);\nexport default appManagersManager;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {PasswordManager} from '../mtproto/passwordManager';\nimport {ReferenceDatabase} from '../mtproto/referenceDatabase';\nimport DialogsStorage from '../storages/dialogs';\nimport FiltersStorage from '../storages/filters';\nimport {ApiUpdatesManager} from './apiUpdatesManager';\nimport {AppAvatarsManager} from './appAvatarsManager';\nimport {AppCallsManager} from './appCallsManager';\nimport {AppChatsManager} from './appChatsManager';\nimport {AppDocsManager} from './appDocsManager';\nimport {AppDraftsManager} from './appDraftsManager';\nimport {AppEmojiManager} from './appEmojiManager';\nimport {AppGroupCallsManager} from './appGroupCallsManager';\nimport {AppInlineBotsManager} from './appInlineBotsManager';\nimport {AppMessagesIdsManager} from './appMessagesIdsManager';\nimport {AppMessagesManager} from './appMessagesManager';\nimport {AppNotificationsManager} from './appNotificationsManager';\nimport {AppPeersManager} from './appPeersManager';\nimport {AppPhotosManager} from './appPhotosManager';\nimport {AppPollsManager} from './appPollsManager';\nimport {AppPrivacyManager} from './appPrivacyManager';\nimport {AppProfileManager} from './appProfileManager';\nimport {AppReactionsManager} from './appReactionsManager';\nimport {AppStickersManager} from './appStickersManager';\nimport {AppUsersManager} from './appUsersManager';\nimport {AppWebPagesManager} from './appWebPagesManager';\nimport {ApiFileManager} from '../mtproto/apiFileManager';\nimport {ApiManager} from '../mtproto/apiManager';\nimport ctx from '../../environment/ctx';\nimport PeersStorage from '../storages/peers';\nimport ThumbsStorage from '../storages/thumbs';\nimport {NetworkerFactory} from '../mtproto/networkerFactory';\nimport {RootScope} from '../rootScope';\nimport {Authorizer} from '../mtproto/authorizer';\nimport {DcConfigurator} from '../mtproto/dcConfigurator';\nimport {TimeManager} from '../mtproto/timeManager';\nimport {AppStoragesManager} from './appStoragesManager';\nimport cryptoMessagePort from '../crypto/cryptoMessagePort';\nimport appStateManager from './appStateManager';\nimport filterUnique from '../../helpers/array/filterUnique';\nimport AppWebDocsManager from './appWebDocsManager';\nimport AppPaymentsManager from './appPaymentsManager';\nimport AppAttachMenuBotsManager from './appAttachMenuBotsManager';\nimport AppSeamlessLoginManager from './appSeamlessLoginManager';\nimport AppThemesManager from './appThemesManager';\n\nexport default function createManagers(appStoragesManager: AppStoragesManager, userId: UserId) {\n const managers = {\n appPeersManager: new AppPeersManager,\n appChatsManager: new AppChatsManager,\n appDocsManager: new AppDocsManager,\n appPhotosManager: new AppPhotosManager,\n appPollsManager: new AppPollsManager,\n appUsersManager: new AppUsersManager,\n appWebPagesManager: new AppWebPagesManager,\n appDraftsManager: new AppDraftsManager,\n appProfileManager: new AppProfileManager,\n appNotificationsManager: new AppNotificationsManager,\n apiUpdatesManager: new ApiUpdatesManager,\n appAvatarsManager: new AppAvatarsManager,\n appGroupCallsManager: new AppGroupCallsManager,\n appCallsManager: new AppCallsManager,\n appReactionsManager: new AppReactionsManager,\n appMessagesManager: new AppMessagesManager,\n appMessagesIdsManager: new AppMessagesIdsManager,\n appPrivacyManager: new AppPrivacyManager,\n appInlineBotsManager: new AppInlineBotsManager,\n appStickersManager: new AppStickersManager,\n referenceDatabase: new ReferenceDatabase,\n appEmojiManager: new AppEmojiManager,\n filtersStorage: new FiltersStorage,\n dialogsStorage: new DialogsStorage,\n apiManager: new ApiManager,\n cryptoWorker: cryptoMessagePort,\n passwordManager: new PasswordManager,\n apiFileManager: new ApiFileManager,\n peersStorage: new PeersStorage,\n thumbsStorage: new ThumbsStorage,\n networkerFactory: new NetworkerFactory,\n rootScope: new RootScope,\n authorizer: new Authorizer,\n dcConfigurator: new DcConfigurator,\n timeManager: new TimeManager,\n appStoragesManager: appStoragesManager,\n appStateManager: appStateManager,\n appWebDocsManager: new AppWebDocsManager,\n appPaymentsManager: new AppPaymentsManager,\n appAttachMenuBotsManager: new AppAttachMenuBotsManager,\n appSeamlessLoginManager: new AppSeamlessLoginManager,\n appThemesManager: new AppThemesManager\n };\n\n type T = typeof managers;\n\n for(const name in managers) {\n const manager = managers[name as keyof T];\n if(!manager) {\n continue;\n }\n\n if((manager as AppMessagesManager).setManagers) {\n (manager as AppMessagesManager).setManagers(managers as any);\n delete (manager as AppMessagesManager).setManagers;\n }\n\n // @ts-ignore\n ctx[name] = manager;\n }\n\n const promises: Array void) | void> | void>[] = [];\n let names = Object.keys(managers) as (keyof T)[];\n names.unshift('appUsersManager', 'appChatsManager', 'appNotificationsManager', 'appMessagesManager', 'dialogsStorage');\n names = filterUnique(names);\n for(const name of names) {\n const manager = managers[name];\n if((manager as any)?.after) {\n // console.log('injecting after', name);\n const result = (manager as any).after();\n promises.push(result);\n\n // if(result instanceof Promise) {\n // result.then(() => {\n // console.log('injected after', name);\n // });\n // }\n }\n }\n\n if(userId) {\n managers.apiManager.setUserAuth(userId);\n }\n\n return Promise.all(promises).then(() => managers);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// just to include\nimport '../polyfill';\nimport '../../helpers/peerIdPolyfill';\n\nimport cryptoWorker from '../crypto/cryptoMessagePort';\nimport {setEnvironment} from '../../environment/utils';\nimport appStateManager from '../appManagers/appStateManager';\nimport transportController from './transports/controller';\nimport MTProtoMessagePort from './mtprotoMessagePort';\nimport RESET_STORAGES_PROMISE from '../appManagers/utils/storages/resetStoragesPromise';\nimport appManagersManager from '../appManagers/appManagersManager';\nimport listenMessagePort from '../../helpers/listenMessagePort';\nimport {logger} from '../logger';\nimport {State} from '../../config/state';\nimport toggleStorages from '../../helpers/toggleStorages';\nimport appTabsManager from '../appManagers/appTabsManager';\nimport ServiceMessagePort from '../serviceWorker/serviceMessagePort';\nimport callbackify from '../../helpers/callbackify';\n\nlet _isServiceWorkerOnline = true;\nexport function isServiceWorkerOnline() {\n return _isServiceWorkerOnline;\n}\n\nlet serviceMessagePort: ServiceMessagePort, _serviceMessagePort: MessagePort;\nexport function getServiceMessagePort() {\n return _isServiceWorkerOnline ? serviceMessagePort : undefined;\n}\n\nconst log = logger('MTPROTO');\n// let haveState = false;\n\nconst port = new MTProtoMessagePort();\nport.addMultipleEventsListeners({\n environment: (environment) => {\n setEnvironment(environment);\n\n transportController.waitForWebSocket();\n },\n\n crypto: ({method, args}) => {\n return cryptoWorker.invokeCrypto(method as any, ...args as any);\n },\n\n state: ({state, resetStorages, pushedKeys, newVersion, oldVersion, userId}) => {\n // if(haveState) {\n // return;\n // }\n\n log('got state', state, pushedKeys);\n\n appStateManager.userId = userId;\n appStateManager.newVersion = newVersion;\n appStateManager.oldVersion = oldVersion;\n\n (Object.keys(state) as any as (keyof State)[]).forEach((key) => {\n appStateManager.pushToState(key, state[key], true, !pushedKeys.includes(key));\n });\n\n RESET_STORAGES_PROMISE.resolve(resetStorages);\n // haveState = true;\n },\n\n toggleStorages: ({enabled, clearWrite}) => {\n return toggleStorages(enabled, clearWrite);\n },\n\n event: (payload, source) => {\n log('will redirect event', payload, source);\n port.invokeExceptSource('event', payload, source);\n },\n\n serviceWorkerOnline: (online) => {\n _isServiceWorkerOnline = online;\n },\n\n serviceWorkerPort: (payload, source, event) => {\n if(serviceMessagePort) {\n serviceMessagePort.detachPort(_serviceMessagePort);\n _serviceMessagePort = undefined;\n } else {\n serviceMessagePort = new ServiceMessagePort();\n serviceMessagePort.addMultipleEventsListeners({\n requestFilePart: (payload) => {\n return callbackify(appManagersManager.getManagers(), (managers) => {\n const {docId, dcId, offset, limit} = payload;\n return managers.appDocsManager.requestDocPart(docId, dcId, offset, limit);\n });\n }\n });\n }\n\n // * port can be undefined in the future\n if(_serviceMessagePort = event.ports[0]) {\n serviceMessagePort.attachPort(_serviceMessagePort);\n }\n },\n\n createObjectURL: (blob) => {\n return URL.createObjectURL(blob);\n }\n\n // socketProxy: (task) => {\n // const socketTask = task.payload;\n // const id = socketTask.id;\n\n // const socketProxied = socketsProxied.get(id);\n // if(socketTask.type === 'message') {\n // socketProxied.dispatchEvent('message', socketTask.payload);\n // } else if(socketTask.type === 'open') {\n // socketProxied.dispatchEvent('open');\n // } else if(socketTask.type === 'close') {\n // socketProxied.dispatchEvent('close');\n // socketsProxied.delete(id);\n // }\n // },\n});\n\nlog('MTProto start');\n\nappManagersManager.start();\nappManagersManager.getManagers();\nappTabsManager.start();\n\n// let sentHello = false;\nlistenMessagePort(port, (source) => {\n appTabsManager.addTab(source);\n\n // port.invokeVoid('hello', undefined, source);\n // if(!sentHello) {\n // port.invokeVoid('hello', undefined, source);\n // sentHello = true;\n // }\n}, (source) => {\n appTabsManager.deleteTab(source);\n});\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type SuperMessagePort from '../lib/mtproto/superMessagePort';\nimport ctx from '../environment/ctx';\n\nexport default function listenMessagePort(\n messagePort: SuperMessagePort,\n onConnect?: (source: MessageEventSource) => void,\n onDisconnect?: (source: MessageEventSource) => void\n) {\n const attachPort = (listenPort: any, sendPort: any) => {\n messagePort.attachListenPort(listenPort);\n sendPort && messagePort.attachSendPort(sendPort);\n onConnect?.(listenPort);\n };\n\n messagePort.setOnPortDisconnect(onDisconnect);\n\n if(typeof(SharedWorkerGlobalScope) !== 'undefined') {\n (ctx as any as SharedWorkerGlobalScope).addEventListener('connect', (e) => attachPort(e.source, e.source));\n } else if(typeof(ServiceWorkerGlobalScope) !== 'undefined') {\n attachPort(ctx, null);\n } else {\n attachPort(ctx, ctx);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDialogFilter} from '../storages/filters';\n\n/**\n * Legacy Webogram's format, don't change dcID to camelCase. date is timestamp\n */\nexport type UserAuth = {dcID: number | string, date: number, id: PeerId};\nexport type REAL_FOLDER_ID = 0 | 1;\n\nexport const NULL_PEER_ID: PeerId = 0;\nexport const REPLIES_PEER_ID: PeerId = 1271266957;\nexport const REPLIES_HIDDEN_CHANNEL_ID: ChatId = 777;\nexport const SERVICE_PEER_ID: PeerId = 777000;\nexport const MUTE_UNTIL = 0x7FFFFFFF;\nexport const BOT_START_PARAM = '';\nexport const MAX_FILE_SAVE_SIZE = 20 * 1024 * 1024;\nexport const THUMB_TYPE_FULL = '';\nexport const TOPIC_COLORS = [0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, 0xFB6F5F];\nexport const ATTACH_MENU_BOT_ICON_NAME = 'default_static';\nexport const GENERAL_TOPIC_ID = 4295032831;\nexport const T_ME_PREFIXES = new Set(['web', 'k', 'z']);\n\nexport const FOLDER_ID_ALL: REAL_FOLDER_ID = 0;\nexport const FOLDER_ID_ARCHIVE: REAL_FOLDER_ID = 1;\nexport const REAL_FOLDERS: Set = new Set([FOLDER_ID_ALL, FOLDER_ID_ARCHIVE]);\nexport const START_LOCAL_ID = Math.max(...Array.from(REAL_FOLDERS)) + 1 as MyDialogFilter['localId'];\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport emojiRegExp from '../../vendor/emoji/regex';\nimport {MessageEntity} from '../../layer';\n\nconst EmojiHelper = {\n emojiMap: (code: string) => { return code; },\n shortcuts: [] as any,\n emojis: [] as any\n};\n\nexport const ALPHA_CHARS_REG_EXP = 'a-z' +\n '\\\\u00c0-\\\\u00d6\\\\u00d8-\\\\u00f6\\\\u00f8-\\\\u00ff' + // Latin-1\n '\\\\u0100-\\\\u024f' + // Latin Extended A and B\n '\\\\u0253\\\\u0254\\\\u0256\\\\u0257\\\\u0259\\\\u025b\\\\u0263\\\\u0268\\\\u026f\\\\u0272\\\\u0289\\\\u028b' + // IPA Extensions\n '\\\\u02bb' + // Hawaiian\n '\\\\u0300-\\\\u036f' + // Combining diacritics\n '\\\\u1e00-\\\\u1eff' + // Latin Extended Additional (mostly for Vietnamese)\n '\\\\u0400-\\\\u04ff\\\\u0500-\\\\u0527' + // Cyrillic\n '\\\\u2de0-\\\\u2dff\\\\ua640-\\\\ua69f' + // Cyrillic Extended A/B\n '\\\\u0591-\\\\u05bf\\\\u05c1-\\\\u05c2\\\\u05c4-\\\\u05c5\\\\u05c7' +\n '\\\\u05d0-\\\\u05ea\\\\u05f0-\\\\u05f4' + // Hebrew\n '\\\\ufb1d-\\\\ufb28\\\\ufb2a-\\\\ufb36\\\\ufb38-\\\\ufb3c\\\\ufb3e\\\\ufb40-\\\\ufb41' +\n '\\\\ufb43-\\\\ufb44\\\\ufb46-\\\\ufb4f' + // Hebrew Pres. Forms\n '\\\\u0610-\\\\u061a\\\\u0620-\\\\u065f\\\\u066e-\\\\u06d3\\\\u06d5-\\\\u06dc' +\n '\\\\u06de-\\\\u06e8\\\\u06ea-\\\\u06ef\\\\u06fa-\\\\u06fc\\\\u06ff' + // Arabic\n '\\\\u0750-\\\\u077f\\\\u08a0\\\\u08a2-\\\\u08ac\\\\u08e4-\\\\u08fe' + // Arabic Supplement and Extended A\n '\\\\ufb50-\\\\ufbb1\\\\ufbd3-\\\\ufd3d\\\\ufd50-\\\\ufd8f\\\\ufd92-\\\\ufdc7\\\\ufdf0-\\\\ufdfb' + // Pres. Forms A\n '\\\\ufe70-\\\\ufe74\\\\ufe76-\\\\ufefc' + // Pres. Forms B\n '\\\\u200c' + // Zero-Width Non-Joiner\n '\\\\u0e01-\\\\u0e3a\\\\u0e40-\\\\u0e4e' + // Thai\n '\\\\u1100-\\\\u11ff\\\\u3130-\\\\u3185\\\\uA960-\\\\uA97F\\\\uAC00-\\\\uD7AF\\\\uD7B0-\\\\uD7FF' + // Hangul (Korean)\n '\\\\u3003\\\\u3005\\\\u303b' + // Kanji/Han iteration marks\n '\\\\uff21-\\\\uff3a\\\\uff41-\\\\uff5a' + // full width Alphabet\n '\\\\uff66-\\\\uff9f' + // half width Katakana\n '\\\\uffa1-\\\\uffdc'; // half width Hangul (Korean)\nexport const ALPHA_NUMERIC_REG_EXP = '0-9\\_' + ALPHA_CHARS_REG_EXP;\nexport const DOMAIN_ADD_CHARS = '\\u00b7';\n// Based on Regular Expression for URL validation by Diego Perini\nexport const URL_ALPHANUMERIC_REG_EXP_PART = '[' + ALPHA_CHARS_REG_EXP + '0-9]';\nexport const URL_PROTOCOL_REG_EXP_PART = '((?:https?|ftp)://|mailto:)?';\nexport const URL_REG_EXP = URL_PROTOCOL_REG_EXP_PART +\n // user:pass authentication\n '(?:' + URL_ALPHANUMERIC_REG_EXP_PART + '{1,64}(?::' + URL_ALPHANUMERIC_REG_EXP_PART + '{0,64})?@)?' +\n '(?:' +\n // sindresorhus/ip-regexp\n '(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}' +\n '|' +\n // host name\n URL_ALPHANUMERIC_REG_EXP_PART + '[' + ALPHA_CHARS_REG_EXP + DOMAIN_ADD_CHARS + '0-9\\-]{0,64}' +\n // domain name\n '(?:\\\\.' + URL_ALPHANUMERIC_REG_EXP_PART + '[' + ALPHA_CHARS_REG_EXP + DOMAIN_ADD_CHARS + '0-9\\-]{0,64}){0,10}' +\n // TLD identifier\n '(?:\\\\.(xn--[0-9a-z]{2,16}|[' + ALPHA_CHARS_REG_EXP + ']{2,24}))' +\n ')' +\n // port number\n '(?::\\\\d{2,5})?' +\n // resource path\n '(?:/(?:\\\\S{0,255}[^\\\\s.;,(\\\\[\\\\]{}<>\"\\'])?)?';\nexport const URL_PROTOCOL_REG_EXP = new RegExp('^' + URL_PROTOCOL_REG_EXP_PART.slice(0, -1), 'i');\nexport const URL_ANY_PROTOCOL_REG_EXP = /^((?:[^\\/]+?):\\/\\/|mailto:)/;\nexport const USERNAME_REG_EXP = '[a-zA-Z\\\\d_]{5,32}';\nexport const TIMESTAMP_REG_EXP = '(?:\\\\s|^)((?:\\\\d{1,2}:)?(?:[0-5]?[0-9]):(?:[0-5][0-9]))(?:\\\\s|$)';\nexport const BOT_COMMAND_REG_EXP = '\\\\/([a-zA-Z\\\\d_]{1,32})(?:@(' + USERNAME_REG_EXP + '))?(\\\\b|$)';\nexport const FULL_REG_EXP = new RegExp('(^| )(@)(' + USERNAME_REG_EXP + ')|(' + URL_REG_EXP + ')|(\\\\n)|(' + emojiRegExp + ')|(^|[\\\\s\\\\(\\\\]])(#[' + ALPHA_NUMERIC_REG_EXP + ']{2,64})|(^|\\\\s)' + BOT_COMMAND_REG_EXP + '|' + TIMESTAMP_REG_EXP + '', 'i');\nexport const EMAIL_REG_EXP = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n// const markdownTestRegExp = /[`_*@~]/;\nexport const MARKDOWN_REG_EXP = /(^|\\s|\\n)(````?)([\\s\\S]+?)(````?)([\\s\\n\\.,:?!;]|$)|(^|\\s|\\x01)(`|~~|\\*\\*|__|_-_|\\|\\|)([^\\n]+?)\\7([\\x01\\s\\.,:?!;]|$)|@(\\d+)\\s*\\((.+?)\\)|(\\[(.+?)\\]\\((.+?)\\))/m;\nexport const SITE_HASHTAGS: {[siteName: string]: string} = {\n 'Telegram': 'tg://search_hashtag?hashtag={1}',\n 'Twitter': 'https://twitter.com/hashtag/{1}',\n 'Instagram': 'https://instagram.com/explore/tags/{1}/',\n 'Google Plus': 'https://plus.google.com/explore/{1}'\n};\n\n// export const SITE_MENTIONS: {[siteName in 'Telegram' | 'Twitter' | 'Instagram' | 'GitHub']: string} = {\n// Telegram: '#{1}',\n// Twitter: 'https://twitter.com/{1}',\n// Instagram: 'https://instagram.com/{1}/',\n// GitHub: 'https://github.com/{1}'\n// };\n\nexport const MARKDOWN_ENTITIES: {[markdown: string]: MessageEntity['_']} = {\n '`': 'messageEntityCode',\n '``': 'messageEntityPre',\n '**': 'messageEntityBold',\n '__': 'messageEntityItalic',\n '~~': 'messageEntityStrike',\n '_-_': 'messageEntityUnderline',\n '||': 'messageEntitySpoiler'\n};\n\nexport const PASS_CONFLICTING_ENTITIES: Set = new Set([\n 'messageEntityEmoji',\n 'messageEntityLinebreak',\n 'messageEntityCaret'\n]);\nfor(const i in MARKDOWN_ENTITIES) {\n PASS_CONFLICTING_ENTITIES.add(MARKDOWN_ENTITIES[i]);\n}\n\nexport const PHONE_NUMBER_REG_EXP = /^\\+\\d+$/;\n\n/* export function parseEmojis(text: string) {\n return text.replace(/:([a-z0-9\\-\\+\\*_]+?):/gi, function (all, shortcut) {\n var emojiCode = EmojiHelper.shortcuts[shortcut]\n if (emojiCode !== undefined) {\n return EmojiHelper.emojis[emojiCode][0]\n }\n return all\n })\n} */\n\n\n/* export function replaceUrlEncodings(urlWithEncoded: string) {\n return urlWithEncoded.replace(/(%[A-Z\\d]{2})+/g, (str) => {\n try {\n return decodeURIComponent(str);\n } catch (e) {\n return str;\n }\n });\n} */\n","// https://github.com/twitter/twemoji-parser/blob/master/src/lib/regex.js\n\nexport function encodeEmoji(emojiText: string) {\n const codepoints = toCodePoints(removeVS16s(emojiText)).join('-');\n return codepoints;\n}\n\nconst vs16RegExp = /\\uFE0F/g;\n// avoid using a string literal like '\\u200D' here because minifiers expand it inline\nconst zeroWidthJoiner = String.fromCharCode(0x200d);\n\nconst removeVS16s = (rawEmoji: string) => (rawEmoji.indexOf(zeroWidthJoiner) < 0 ? rawEmoji.replace(vs16RegExp, '') : rawEmoji);\n\nexport function toCodePoints(unicodeSurrogates: string): Array {\n const points = [];\n let char = 0;\n let previous = 0;\n let i = 0;\n while(i < unicodeSurrogates.length) {\n char = unicodeSurrogates.charCodeAt(i++);\n if(previous) {\n points.push((0x10000 + ((previous - 0xd800) << 10) + (char - 0xdc00)).toString(16));\n previous = 0;\n } else if(char > 0xd800 && char <= 0xdbff) {\n previous = char;\n } else {\n points.push(char.toString(16));\n }\n }\n\n if(points.length && points[0].length === 2) {\n points[0] = '00' + points[0];\n }\n\n return points;\n}\n\nexport function getEmojiToneIndex(input: string) {\n const match = input.match(/[\\uDFFB-\\uDFFF]/);\n return match ? 5 - (57343 - match[0].charCodeAt(0)) : 0;\n}\n\nconst VIRTUAL_COUNTRIES_EMOJIS: Map = new Map([\n ['FT', '🏴‍☠']\n]);\n\nexport function getCountryEmoji(iso2: string) {\n return VIRTUAL_COUNTRIES_EMOJIS.get(iso2) ??\n String.fromCharCode(55356, 56741 + iso2.charCodeAt(0), 55356, 56741 + iso2.charCodeAt(1));\n}\n\nexport function emojiFromCodePoints(codePoints: string) {\n return codePoints.split('-').reduce((prev, curr) => prev + String.fromCodePoint(parseInt(curr, 16)), '');\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [699,211,147,85,110], () => (__webpack_require__(9092)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames not based on template\n\tif (chunkId === 85) return \"85.887945ef5f43bc205112.bundle.js\";\n\tif (chunkId === 110) return \"110.b39868e78bf4adf7dd36.bundle.js\";\n\t// return url for filenames based on template\n\treturn \"\" + ({\"211\":\"npm.big-integer\",\"699\":\"npm.pako\"}[chunkId] || chunkId) + \".\" + {\"8\":\"93d2f33af815eb0455aa\",\"104\":\"f1b4b4be86382aaf84f5\",\"147\":\"bb5274ee5cc526f48754\",\"211\":\"363d763daad0ee4e2741\",\"301\":\"95838a8203f23dd1ce8f\",\"642\":\"be93122d1116ecdc9322\",\"699\":\"89deb457201f16c93925\"}[chunkId] + \".chunk.js\";\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","(() => {\n if (typeof __webpack_require__ !== 'undefined') {\n var oldGetScript = __webpack_require__.u;\n var oldLoadScript = __webpack_require__.e;\n var queryMap = {};\n var countMap = {};\n var getRetryDelay = function () {\n return 3000;\n };\n __webpack_require__.u = function (chunkId) {\n var result = oldGetScript(chunkId);\n return (\n result +\n (queryMap.hasOwnProperty(chunkId) ? '?' + queryMap[chunkId] : '')\n );\n };\n __webpack_require__.e = function (chunkId) {\n var result = oldLoadScript(chunkId);\n return result.catch(function (error) {\n var retries = countMap.hasOwnProperty(chunkId)\n ? countMap[chunkId]\n : 999999;\n if (retries < 1) {\n var realSrc = oldGetScript(chunkId);\n error.message =\n 'Loading chunk ' +\n chunkId +\n ' failed after 999999 retries.\\n(' +\n realSrc +\n ')';\n error.request = realSrc;\n throw error;\n }\n return new Promise(function (resolve) {\n var retryAttempt = 999999 - retries + 1;\n setTimeout(function () {\n var retryAttemptString = '&retry-attempt=' + retryAttempt;\n var cacheBust = (function () {\n return Date.now();\n })();\n +retryAttemptString;\n queryMap[chunkId] = cacheBust;\n countMap[chunkId] = retries - 1;\n resolve(__webpack_require__.e(chunkId));\n }, getRetryDelay(retryAttempt));\n });\n });\n };\n }\n})();\n","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t678: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = this[\"webpackChunktweb\"] = this[\"webpackChunktweb\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","next","DEBUG","MOUNT_CLASS_TO","window","self","EmojiVersions","Emoji","version","Object","assign","USER_AGENT","navigator","userAgent","IS_SAFARI","search","toLowerCase","indexOf","test","vendor","platform","maxTouchPoints","match","IS_FIREFOX","undefined","badCharsRe","trimRe","C2L","cleanSearchText","text","latinize","processSearchText","clearBadChars","ignoreCase","options","hasTag","includeTag","charAt","originalText","replace","clearBadCharsAndTrim","ch","latinizeCh","latinizeString","fixCyrillic","FILENAME_JOINER","getFileNameByLocation","location","ext","length","str","_","id","thumb_size","filter","Boolean","join","photo_id","pFlags","big","stickerset","short_name","emoticon","thumb_version","volume_id","local_id","url","console","error","downloadId","getFileURL","type","encodeURIComponent","JSON","stringify","platforms","Set","ignore","getRestrictionReason","reasons","find","reason","has","isRestricted","ignoreRestrictionReasons","clear","forEach","add","getPeerId","peerId","isPeerId","userId","user_id","toPeerId","chatId","channel_id","chat_id","isUser","peerParams","substr","split","IDB","constructor","db","this","name","storageIsAvailable","log","openDatabase","INSTANCES","push","isAvailable","createNew","openDbPromise","createIndexes","os","store","indexNames","Array","from","indexName","deleteIndex","indexes","index","contains","createIndex","keyPath","objectParameters","request","indexedDB","open","Promise","reject","message","finished","setTimeout","onerror","resolve","onsuccess","event","result","calledNew","onclose","e","onabort","transaction","target","close","onversionchange","onupgradeneeded","warn","oldVersion","newVersion","stores","objectStoreNames","objectStore","createObjectStore","static","instance","preserve","storage","IDBStorage","storeName","idb","create","delete","entryName","isArray","concat","getObjectStore","promises","map","save","value","idx","put","get","mode","callback","perf","performance","now","then","onError","clearTimeout","timeout","onComplete","results","requests","r","waitForTransactionComplete","oncomplete","callbackResult","left","onRequestFinished","i","getAll","environment","getEnvironment","setEnvironment","env","RootScope","super","myId","connectionStatus","premium","addEventListener","isNew","isPremium","dispatchEventSingle","status","dispatchEvent","args","invokeVoid","settings","getConnectionStatus","getPremium","state","stateStorage","getState","setByKey","key","object","splitted","getDeepProperty","slice","pop","setDeepProperty","first","pushToState","direct","onlyLocal","setKeyValueToStorage","set","HTTP","dcId","logSuffix","pending","debug","logTypes","Log","logger","connected","_send","body","fetch","method","response","arrayBuffer","buffer","TextDecoder","decode","Uint8Array","setConnected","err","destroyed","destroy","send","networker","promise","releasePending","releasing","splice","pause","Socket","handleOpen","handleError","handleClose","removeListeners","handleMessage","data","byteLength","ws","connect","removeEventListener","WebSocket","binaryType","randomize","arr","crypto","Error","getRandomValues","Obfuscation","_process","operation","cryptoMessagePort","transfer","init","codec","idPromise","release","initPayload","val","val2","reversedPayload","reverse","encKey","encIv","decKey","decIv","process","obfuscateTag","encrypted","encode","payload","tag","encodePacket","len","header","readPacket","bytesToHex","bytes","toString","TcpObfuscated","Connection","retryTimeout","abridged","obfuscation","autoReconnect","onOpen","connection","setConnectionStatus","cleanupSent","resend","onMessage","parseResponse","processMessage","messageId","sessionId","catch","shift","onClose","needTimeout","retryAt","time","Date","diff","lastCloseTime","isNaN","reconnectTimeout","ctx","reconnect","bodySent","forceReconnect","setAutoReconnect","once","enable","changeUrl","encodeBody","toEncode","encoded","releasingPending","sent","TEST_SUFFIX","getTelegramConnectionSuffix","connectionType","constructTelegramWebSocketUrl","suffix","path","DcConfigurator","sslSubdomains","dcOptions","host","port","chosenServers","transportSocket","chosenServer","oooohLetMeLive","transportHTTP","dcOption","chooseServer","transportType","reuse","hasOwnProperty","client","download","upload","servers","transports","transport","obj","indexOfAndSplice","MTTransportController","opened","Map","waitForWebSocket","pingTransports","dcConfigurator","https","websocket","httpPromise","websocketPromise","socket","isFulfilled","isRejected","isHttpAvailable","isWebSocketAvailable","all","pinging","setTransportValue","setTransportOpened","setTransportClosed","AppManager","setManagers","managers","loadStorages","storages","recordPromise","storagesKeys","keys","storagesPromises","storagesResults","resetStorages","size","loadStoragesInner","AppStoragesManager","names","createStorages","loadStorage","PasswordManager","apiManager","invokeApi","updateSettings","currentHashPromise","newHashPromise","params","password","new_settings","hint","email","currentPassword","cryptoWorker","invokeCrypto","newAlgo","new_algo","salt1","newPassword","hashes","new_password_hash","getInputCheckPassword","check","inputCheckPassword","auth","setUser","user","confirmPasswordEmail","code","resendPasswordEmail","cancelPasswordEmail","ReferenceDatabase","contexts","links","saveContext","reference","context","getContexts","_context","deepEqual","getReferenceByLink","getContext","values","deleteContext","refreshReference","c","appMessagesManager","reloadMessages","refreshEmojiesSoundsPromise","appStickersManager","getAnimatedEmojiSounds","appProfileManager","getProfile","appEmojiManager","getCustomEmojiDocuments","docId","appAttachMenuBotsManager","getAttachMenuBot","botId","appThemesManager","getWallPaperById","wallPaperId","hex","newHex","newContext","makeError","safeReplaceObject","wasObject","newObject","getPeerIdsFromMessage","peerIds","fromId","viaBotId","fwdFromId","media","contactUserId","recentVoters","recent_voters","recentReactions","recent_reactions","reaction","peer_id","action","userIds","users","inviter_id","chatIds","recentRepliers","recent_repliers","reply","setDialogIndex","dialog","indexKey","GLOBAL_FOLDER_ID","DialogsStorage","allDialogsLoaded","pinnedOrders","folderId","saveAllDialogsLoaded","resetPinnedOrder","savePinnedOrders","forumTopics","folders","dialogsOffsetDate","dialogsNum","dialogsIndex","cachedResults","query","count","dialogs","onUpdateFolderPeers","update","folder_peers","folderPeer","folder_id","peer","appPeersManager","dropDialog","pinned","handleDialogUnpinning","generateIndexForDialog","pushDialog","scheduleHandleNewDialogs","onUpdateDialogPinned","getDialogOnly","handleDialogTogglePinned","onUpdateChannelPinnedTopic","topicId","generateMessageId","topic_id","topic","getForumTopic","getFilterIdForForum","onUpdatePinnedDialogs","order","handleDialogsPinned","dialogsResult","applyDialogs","d","onUpdateChannelPinnedTopics","filterId","limit","getLimit","channel","appChatsManager","getChannelInput","toChatId","offset_date","offset_id","offset_topic","processTopics","topics","after","rootScope","appUsersManager","getSelf","peerText","getPeerSearchText","indexObject","onFilterUpdate","getCachedDialogs","processDialogForFilter","processDialogForFilters","getDialogIndexKeyByFilterId","processChangedUnreadOrUnmuted","chat","getChat","dropDialogOnDeletion","enabled","flushForumTopicsCache","apiUpdatesManager","addMultipleEventsListeners","updateFolderPeers","updateDialogPinned","updateChannelPinnedTopic","updatePinnedDialogs","updateChannelPinnedTopics","appStateManager","appStoragesManager","getCache","_order","getPinnedOrders","setDialogsFromState","bind","appDraftsManager","addMissedDialogs","top_message","getServerMessageId","topMessage","saveMessages","saveDialog","ignoreOffsetDate","getMessageByPeer","reloadConversation","isDialogsLoaded","setDialogsLoaded","loaded","isForum","isFilterIdForForum","defineNotNumerableProperties","every","orders","isDialogPinned","filtersStorage","getFilter","isPinned","pinnedPeerIds","getOffsetDate","offsetDate","Math","min","sort","a","b","generateFolder","folder","unreadMessagesCount","unreadPeerIds","unreadUnmutedPeerIds","getFolder","forumTopic","getDialogKey","isTopic","getFolderDialogs","skipMigrated","hidden","migratedTo","getNextDialog","currentPeerId","findIndex","getDialogIndexKey","localId","isDialogUnmuted","appNotificationsManager","isPeerLocalMuted","respectType","threadId","getFolderUnreadCount","unreadUnmutedCount","unreadCount","arrays","setDialogIndexInFilter","isRealFolder","testDialogForFilter","pinnedIds","pinnedKey","pinnedIndex","generateDialogIndex","generateDialogPinnedDateByIndex","getDialogIndex","getDialog","verify","skipped","getDialogOrTopic","isObject","date","tsNow","timeManager","getServerTimeOffset","noIndex","filters","getFilters","cmp","wasIndex","wasDialog","wasDialogIndex","newDialogIndex","prepareFolderUnreadCountModifyingByDialog","insertInDescendSortedArray","prepareDialogUnreadCountModifying","toggle","callbacks","wasUnreadCount","getDialogUnreadCount","wasUnmuted","newUnreadCount","newUnmuted","addMessagesCount","modifyFolderUnreadCount","toggleDialog","toggleUnmuted","forumUnreadCount","getForumUnreadCount","hasUnmuted","some","max","dispatchUnreadTimeout","_folder","justReturn","noPinnedOrderUpdate","topDate","generateDialogPinnedDate","channelId","isChannel","draft","dialogKey","unshift","setDialogToState","pts","historyStorage","getHistoryStorage","messagesStorage","getHistoryMessagesStorage","history","incomingMessage","mid","getMessageFromStorage","is_outgoing","peersStorage","requestPeersForKey","isAnyChat","newPts","getChannelState","requestPeer","saveGlobalOffset","getForumTopicsCache","getDialogOffsetDate","savedGlobalOffsetDate","savedOffsetDate","dropDialogFromFolders","foundDialog","wasPinned","keepLocal","clearDialogFromState","releasePeer","dropDialogWithEvent","dropped","items","forEachReverse","assumeType","saveApiUsers","saveApiChats","chats","messages","updatedDialogs","topMid","topPendingMid","pendingTopMsgs","topPendingMessage","maxId","cache","getUpdateCache","getUpdateAfterReloadKey","updates","newUpdatesAfterReloadToHandle","saveUpdate","canSaveDialogByPeerId","isDialog","wasDialogBefore","wasTopMessage","generateTempMessageId","from_id","getOutputPeer","deleted","out","isOutgoing","migrated_to","deactivated","migratedToPeer","migratedFromTo","migratedToFrom","read_inbox_max_id","read_outbox_max_id","saveDraft","isOut","unread","unread_count","isEnd","insertSlice","setEnd","mergeReplyKeyboard","readMaxId","readOutboxMaxId","savePeerSettings","notify_settings","addChannelState","releaseUnreadCount","dialogsStorage","processTopicUpdate","oldTopic","isIconChanged","icon_emoji_id","isTitleChanged","title","isChanged","getDialogs","offsetIndex","fillContactsResult","fillContacts","cached","reloadMissingDialogsPromise","reloadMissingPeerIds","realFolderId","curDialogStorage","d1","d2","offset","loadedAll","isEnoughDialogs","isTopEnd","getTopMessages","deletedTopics","getTopicPromises","getForumTopicById","getTopicsPromise","ids","fullfillLeft","messagesForumTopics","getForumTopicOrReload","callbackify","processTopicsPromise","f","reduce","acc","v","newPinned","convertment","PREPENDED_FILTERS","LOCAL_FILTER","flags","exclude_peers","include_peers","pinned_peers","excludePeerIds","includePeerIds","FiltersStorage","filtersArr","reloadedPeerIds","localFilters","generateLocalFilter","clearFilters","onUpdateDialogFilter","saveDialogFilter","findAndSplice","onUpdateDialogFilters","oldFilters","copy","getDialogFilters","_filterId","onUpdateDialogFilterOrder","includes","setLocalId","updateDialogFilter","updateDialogFilters","updateDialogFilterOrder","prependFilters","allChatsFilter","archiveFilter","allChatsFilterIndex","exclude_archived","exclude_unarchived","exclude_read","isDialogUnread","exclude_muted","unread_mentions_count","broadcasts","isBroadcast","groups","isAnyGroup","toUserId","isBot","bots","non_contacts","isContact","contacts","testDialogForFilterId","toggleDialogPin","getConfig","pinned_infolder_count_max","getInputPeerById","createDialogFilter","prepend","remove","getOutputDialogFilter","bool","updateDialogFiltersOrder","filterIncludedPinnedPeers","peers","reloadDialogs","inputPeer","isAlreadyReloaded","reloadPromises","missingPeerIds","overwrite","invokeApiSingle","getSuggestedDialogsFilters","silent","to","oldFilter","_filter","isFilterIdAvailable","applyMixins","derivedCtor","constructors","baseCtor","getOwnPropertyNames","prototype","getOwnPropertyDescriptor","defineProperty","ApiUpdatesManager","updatesState","pendingPtsUpdates","pendingSeqUpdates","syncPending","syncLoading","channelStates","attached","subscriptions","processUpdateMessage","updateMessage","processOpts","seq","seqStart","seq_start","forceGetDifference","processUpdate","toId","fwd_from","reply_to","entities","pts_count","override","_constructor","setProxy","Proxy","saveUpdatesState","us","popPendingSeqUpdate","nextSeq","pendingUpdatesData","seqAwaiting","ptsAwaiting","clearStatePendingSync","popPendingPtsUpdate","curState","curPts","goodPts","goodIndex","getDifference","processLocalUpdate","wasSyncing","pts_total_limit","qts","differenceResult","other_updates","new_messages","apiMessage","nextState","intermediate_state","onDifferenceTooLong","justAName","getChannelDifference","channelState","bindPrefix","lastDifferenceTime","final","lastPtsUpdateTime","fwdHeader","hasUser","post","hasChat","popPts","popSeq","subscribeToChannelUpdates","subscription","cb","interval","unsubscribeFromChannelUpdates","force","clearInterval","attach","langCode","noErrorBox","stateResult","setUpdatesProcessor","strs","en","ru","getChangelog","lang","res","ok","langStr","parseMarkdown","inbox_date","languages","filterUnique","language","AppAvatarsManager","savedAvatarURLs","removeFromAvatarsCache","isAvatarCached","saved","loadAvatar","photo","peerPhotoFileLocation","downloadOptions","dc_id","limitPart","apiFileManager","blob","URL","createObjectURL","AppCallsManager","calls","IS_CALL_SUPPORTED","updatePhoneCall","saveCall","phone_call","updatePhoneCallSignalingData","callId","phone_call_id","computeKey","g_b","p","call","isDiscarded","oldCall","getCall","getCallInput","access_hash","savePhonePhoneCall","phonePhoneCall","generateDh","random_length","dhConfig","requestCall","protocol","g_a_hash","video","getUserInput","random_id","discardCall","duration","connection_id","AppChatsManager","isPeerNeeded","modifyUsernamesCache","onChatUpdated","onUpdateChannelParticipant","clearCache","onUpdateChatDefaultBannedRights","default_banned_rights","updateChannelParticipant","updateChatDefaultBannedRights","getFromCache","apiChats","saveApiChat","oldChat","participants_count","changedUsername","setUsernameToCache","oldPhotoId","newPhotoId","toggledForum","forum","changedPhoto","changedTitle","changedAnyBadge","verified","scam","fake","hasRights","rights","isThread","editChatDefaultBannedRights","banned_rights","until_date","isMegagroup","megagroup","isInChat","good","getInputPeer","getChannelInputPeer","getChatInputPeer","allowMin","getChatString","createChannel","inviteToChannel","input","usersInputs","u","createChat","leaveChannel","joinChannel","addChatUser","fwdLimit","fwd_limit","deleteChatUser","leaveChat","leave","deleteChannel","deleteChat","migrateChat","updateUsername","username","doNotRefresh","refreshChatAfterRequest","editPhoto","inputFile","inputChatPhoto","file","editTitle","editAbout","about","editBanned","participant","getParticipantPeerId","wasChannel","timestamp","actor_id","prev_participant","new_participant","kicked_by","clearChannelParticipantBannedRights","kickFromChannel","view_messages","kickFromChat","resolveChannel","messagesChats","togglePreHistoryHidden","toggleSignatures","toggleNoForwards","setChatAvailableReactions","reactions","chatFull","getCachedFullChat","available_reactions","getSendAs","invokeApiSingleProcess","processResult","sendAsPeers","importChatInvite","hash","checkUsername","getSponsoredMessage","invokeApiCacheable","cacheSeconds","sponsoredMessages","sponsoredMessage","viewSponsoredMessage","randomId","checkChatInvite","chatInvite","toggleUsername","active","reorderUsernames","deactivateAllUsernames","makeChannelPrivate","getChannels","toggleForum","editForumTopic","iconEmojiId","closed","createForumTopic","iconColor","channelFull","getChannelFull","sendAsInputPeer","default_send_as","icon_color","send_as","updatePinnedForumTopic","wrapUrl","unsafe","matchUrlProtocol","tgMeMatch","telescoPeMatch","tgMatch","onclick","prefix","pathname","fullPath","I18n","pluralRules","cacheLangPackPromise","setLangCode","lastRequestedLangCode","lastRequestedNormalizedLangCode","updateAmPm","timeFormat","dateTimeFormat","getDateTimeFormat","hour","minute","hour12","setHours","amText","format","amPmCache","am","pmText","pm","loadLocalLangPack","defaultCode","langSign","countries","strings","formatLocalStrings","default","saveLangPack","from_version","lang_code","local","loadLangPack","web","requestedServerLanguage","lang_pack","polyfillPromise","pushTo","langPack","appVersion","applyLangPack","currentLangCode","Intl","PluralRules","string","countriesList","country","langPackKey","default_name","lastAppliedLangCode","cachedDateTimeFormats","document","querySelectorAll","element","weakMap","superFormatter","indexHolder","lastIndex","p1","p2","p3","p4","createElement","append","lastIndexOf","wrappedUrl","href","setAttribute","DocumentFragment","firstChild","textContent","formatted","arg","pushNextArgument","plain","select","item","Node","isRTL","setRTL","rtl","getCacheLangPack","finally","setTimeFormat","haveToUpdate","IntlDateElement","getStrings","getLangPack","langPack1","langPack2","localLangPack1","localLangPack2","l","_Intl","WeakMap","IntlElementBase","classList","property","IntlElement","safeAssign","dataset","compareAndUpdate","json","DateTimeFormat","hours","getHours","getMinutes","capitalizeFirstLetter","i18n","i18n_","_i18n","months","days","getWeekNumber","UTC","getFullYear","getMonth","getDate","dayNum","getUTCDay","setUTCDate","getUTCDate","yearStart","getUTCFullYear","ceil","getTime","today","year","day","month","weekday","minYear","yearPattern","RegExp","monthYearOrDayPattern","yearOrDayAndMonthPattern","shortDate","longDate","numberOfDaysEachMonth","createForMonthYear","dates","selectedYear","currentYear","setFullYear","minDate","setMonth","maxDate","formatterMonthYear","createForDayMonth","validDateForMonth","formatterDayMonth","formatterYearMax","formatWeekLong","getDay","q","safeReplaceArrayInObject","trim","dayOfWeek","setDate","getDayOfWeek","distance","setTime","matches","exec","g1","g2","k","g3","parseInt","k1","EXTENSION_MIME_TYPE_MAP","pdf","tgv","tgs","wav","mp3","ogg","jpeg","jpg","png","gif","webp","mp4","webm","mov","svg","MIME_TYPE_EXTENSION_MAP","uploadWallPaperTempId","AppDocsManager","onServiceWorkerFail","docs","doc","supportsStreaming","thumbsStorage","deleteCacheContext","stickerCachedThumbs","uploadingWallPapers","online","saveDoc","oldDoc","file_reference","referenceDatabase","attributes","attribute","file_name","wrapPlainText","voice","mime_type","w","h","round_message","alt","stickerEmojiRaw","stickerSetInput","thumbs","IS_WEBP_SUPPORTED","sticker","IS_WEBM_SUPPORTED","animated","mappedMimeType","joiner","monthAsNumber","noSeconds","getSeconds","leadingZero","noTime","getFullDate","isServiceWorkerOnline","getCacheContext","setCacheContextURL","thumb","getDocumentDownloadOptions","getDocumentURL","getDoc","downloadDoc","queueId","onlyCache","downloadMedia","getLottieCachedThumb","toneIndex","saveLottiePreview","width","height","saveWebPConvertedStrippedThumb","stickerThumbConverted","prepareWallPaperUpload","cacheContext","wallpaper","slug","uploadWallPaper","fileName","wallPaper","downloaded","getGifs","invokeApiHashable","gifs","requestDocPart","requestFilePart","getDocumentInputFileLocation","AppDraftsManager","drafts","updateDraftMessage","notify","getKey","getDraft","getAllDrafts","getAllDraftPromise","apiDraft","processApiDraft","isEmptyDraft","reply_to_msg_id","syncDraft","localDraft","saveOnServer","serverDraft","draftsAreEqual","draftObj","getInputEntities","no_webpage","top_msg_id","saveLocalDraft","clearAllDrafts","combined","clearDraft","emptyDraft","setDraft","EMOJI_LANG_PACK","keywords","AppEmojiManager","keywordLangPacks","indexedLangPacks","getKeywordsPromises","recent","getRecentEmojisPromises","getCustomEmojiDocumentPromises","getEmojiKeywords","storageKey","pack","validateInitObject","keywordsDifference","packKeywords","keyword","emoticons","getBothEmojiKeywords","networkerFactory","native","getRecentEmojis","indexEmojis","searchEmojis","emojis","POPULAR_EMOJI","recentEmoji","recentCustomEmoji","pushRecentEmoji","emoji","fixEmoji","docIds","document_id","documents","appDocsManager","getCachedCustomEmojiDocuments","setDebouncedGetCustomEmojiDocuments","getCustomEmojiDocumentsPromise","allIds","getCustomEmojiDocument","getCustomEmojis","getEmojiStickers","AppGroupCallsManager","groupCalls","participants","nextOffsets","updateGroupCall","saveGroupCall","updateGroupCallParticipants","groupCallId","saveApiParticipants","groupCall","getCachedParticipants","prepareToSavingNextOffset","nextOffsetsMap","nextOffset","setNextOffset","newNextOffset","saveApiParticipant","skipCounterUpdating","oldParticipant","hasLeft","muted","can_self_unmute","getGroupCall","modified","just_joined","apiParticipants","editParticipant","getGroupCallInput","getInputPeerSelf","volume","raise_hand","raiseHand","video_paused","videoPaused","video_stopped","videoStopped","presentation_paused","presentationPaused","getGroupCallFull","participants_next_offset","shouldUpdate","createGroupCall","scheduleDate","schedule_date","getGroupCallParticipants","sources","groupCallParticipants","next_offset","hangUp","discard","groupCallInput","source","join_as","joinGroupCall","isMuted","joinVideo","leaveGroupCallPresentation","getPhotoInput","getPhotoMediaInput","ttl_seconds","getMediaInput","AppInlineBotsManager","inlineResults","setHash","getGeoInput","geo","lat","long","accuracy_radius","getInlineResults","bot","geo_point","stopTime","botResults","queryId","query_id","appPhotosManager","savePhoto","generateQId","pushPopularBot","getTopPeers","topPeers","botPeerId","topPeer","rating","switchToPM","fromPeerId","startParam","startBot","checkSwitchReturn","getUser","bot_inline_placeholder","peerData","switchInlineQuery","getPeerUsername","callbackButtonClick","button","msg_id","sendInlineResult","queryAndResultIds","inlineResult","queryID","resultID","resultId","send_message","reply_markup","replyMarkup","sendText","inputMedia","messageMedia","caption","sendMessage","geoPoint","address","provider","venue_id","venue_type","phone_number","first_name","last_name","vcard","description","currency","total_amount","shipping_address_requested","start_param","sendOther","AppMessagesIdsManager","tempNum","num","splitStringByLength","maxLength","lastSliceStartIndex","arrayIndex","cut","end","part","_arrayIndex","partLength","appTabsManager","tabs","start","getTabs","tab","addTab","deleteTab","getDocumentInput","setBooleanFlag","processAfter","AppMessagesManager","pendingByRandomId","pendingByMessageId","pendingAfterMsgs","tempFinalizeCallbacks","sendSmthLazyLoadQueue","needSingleMessages","extendedMedia","maxSeenId","newDialogsToHandle","notificationsToHandle","reloadConversationsPeers","groupedTempId","typings","unreadMentions","goToNextMentionPromises","batchUpdates","middleware","clean","uploadFilePromises","messagesStorageByPeerId","groupedMessagesStorage","scheduledMessagesStorage","historiesStorage","threadsStorage","searchesStorage","pinnedMessages","threadsServiceMessagesIdsStorage","threadsToReplies","handleNewDialogs","newMaxSeenId","updateMap","processDialog","isDialogDefined","incrementMaxSeenId","handleNotifications","notificationsHandlePromise","notifyPeerToHandle","getNotifyPeerSettings","peerTypeNotifySettings","mentioned","notifyAboutMessage","fwdCount","onUpdateMessageId","onUpdateNewMessage","getMessagePeer","isLocalThreadUpdate","createMessageStorage","threadKey","getThreadKey","handleNewUpdateAfterReload","threadStorage","reply_to_peer_id","reply_to_mid","receiptMessage","checkPendingMessage","updateMessageRepliesIfNeeded","ignoreExisting","findSlice","firstSlice","forceUserOnline","handleNewMessage","inboxUnread","modifyCachedMentions","setDialogTopMessage","notifyPeer","onUpdateMessageReactions","recentReaction","previousReactions","previousRecentReactions","show_previews","peerReaction","pushBatchUpdate","batchUpdateReactions","setDialogToStateIfMessageIsTop","onUpdateDialogUnreadMark","unread_mark","onUpdateEditMessage","oldMessage","newMessage","handleEditedMessage","isTopMessage","clear_history","dispatchEditEvent","newReactions","grouped_id","onUpdateReadHistory","max_id","read_max_id","getObjectKeysAndSort","stillUnreadCount","still_unread_count","newUnreadMentionsCount","foundAffected","repliesKey","getReadMaxIdIfUnread","messageThreadId","getMessageThreadId","setCount","threadKeyPart","onUpdateReadMessagesContents","topMsgId","mids","findPeerIdByMids","media_unread","fixDialogUnreadMentionsIfNoMessage","onUpdateChannelAvailableMessages","availableMinId","available_min_id","onUpdateDeleteMessages","threadKeys","historyUpdated","handleDeletedMessages","threadsStorages","msgs","affected","onUpdateChannel","needDialog","getPeerActiveUsernames","onUpdateChannelReload","flushStoragesByPeerId","onUpdateChannelMessageViews","views","batchUpdateViews","onUpdateServiceNotification","popup","phone","onUpdatePinnedMessages","missingMessages","werePinned","getPinnedMessagesKey","hiddenPinnedMessages","onUpdateNotifySettings","onUpdateNewScheduledMessage","isScheduled","onUpdateDeleteScheduledMessages","onUpdateMessageExtendedMedia","extended_media","onUpdateTranscribedAudio","batch","toDispatch","getMessagesFromMap","previousResults","changedResults","reactionCount","previousReactionCount","_reactionCount","reactionsEqual","chosen_order","updateMessageID","updateNewDiscussionMessage","updateNewMessage","updateNewChannelMessage","updateDialogUnreadMark","updateEditMessage","updateEditChannelMessage","updateMessageReactions","updateReadChannelDiscussionInbox","updateReadChannelDiscussionOutbox","updateReadHistoryInbox","updateReadHistoryOutbox","updateReadChannelInbox","updateReadChannelOutbox","updateChannelReadMessagesContents","updateReadMessagesContents","updateChannelAvailableMessages","updateDeleteMessages","updateDeleteChannelMessages","updateChannel","updateChannelReload","updateChannelMessageViews","updateServiceNotification","updatePinnedMessages","updatePinnedChannelMessages","updateNotifySettings","updateNewScheduledMessage","updateDeleteScheduledMessages","updateMessageExtendedMedia","updateTranscribedAudio","filterFunc","getScheduledMessagesStorage","webpage","appWebPagesManager","getCachedWebPage","drop","poll","appPollsManager","pollToMessages","startsWith","batchUpdatesDebounced","debounce","details","maxSeenMsgId","sendEntites","entity","invokeAfterMessageIsSent","tempId","callbackName","finalize","editMessage","is_scheduled","newMedia","noWebPage","handled","transcribeAudio","transcription_id","processError","replyToMsgId","MAX_LENGTH","message_length_max","webPage","getPeerMigratedTo","generateOutgoingMessage","toggleError","onMessagesSendError","sentRequestOptions","afterMessageId","sendAs","sendAsPeerId","apiPromise","invokeApiAfter","clear_draft","update_stickersets_order","updateStickersetOrder","wrapMessageEntities","beforeMessageSending","sequential","noop","sendFile","attachType","apiFileName","fileType","File","isDocument","Blob","isPhoto","IMAGE_MIME_TYPES_SUPPORTED","strippedPhotoSize","strippedBytes","actionName","isVoiceMessage","waveform","isMedia","photoSize","sizes","objectURL","VIDEO_MIME_TYPES_SUPPORTED","videoAttribute","isRoundMessage","supports_streaming","noSound","thumbCacheContext","sentDeferred","spoiler","uploadingFileName","getFileNameForUpload","uploaded","uploadPromise","load","thumbUploadPromise","cancelPendingMessage","setTyping","addNotifyListener","progress","percents","floor","done","total","notifyAll","force_file","isGroupedItem","background","ret","sendAlbum","sendFileDetails","groupId","o","invoke","multiMedia","multi_media","originalInputMedia","inputSingleMedia","inputs","sendContact","contactPeerId","getContactMediaInput","pollId","savePoll","total_voters","getPoll","getPhoto","postAuthor","getPeer","signatures","generateFromId","post_author","generateFlags","generateReplyHeader","via_bot_id","replies","generateReplies","replyToTopId","originalMessage","forum_topic","reply_to_top_id","linked_chat_id","comments","replies_pts","isAnonymousSending","generateForwardHeader","isUserHidden","from_name","userFull","getCachedFullUser","private_forward_name","channel_post","saved_from_msg_id","saved_from_peer","generateFakeAvatarMessage","Number","MAX_SAFE_INTEGER","getUploadPromise","uploadFileName","admin_rights","anonymous","pendingData","fillConversations","chatHistoryStorage","maxSeenIdIncremented","hasPrepend","noIdsDialogs","setFolderId","setMessageUnreadByDialog","folderDialogs","dialogsLength","slicedDialogs","offset_peer","offsetPeerId","forwardMessages","config","overflowMids","forwarded_count_max","dropCaptions","dropAuthor","newMids","newMessages","replyToMid","replyToMessageIdx","newReplyToMid","getStickerEffectThumb","nopremium","group","from_peer","to_peer","with_my_score","withMyScore","drop_author","drop_media_captions","generateEmptyMessage","getMessagesStorageByKey","s","getMessagesStorage","getMessageById","cantForwardDeleteMids","cantForward","cantDelete","canForward","canDeleteMessage","reloadConversationOrTopic","inputDialogPeer","getInputDialogPeerById","reloadConversationsPromise","inputDialogPeers","currentState","doFlushHistory","just_clear","revoke","affectedHistory","flushHistory","justClear","getHistory","historyResult","getTypingKey","ss","hidePinnedMessages","getPinnedMessage","getSearch","inputFilter","getPinnedMessagesCount","getPinnedMessagesMaxId","updatePinnedMessage","unpin","pm_oneside","unpinAllMessages","unpinAll","getAlbumText","getGroupsFirstMessage","minMid","getMidsByAlbum","groupedId","getMessagesByAlbum","getMidsByMessage","filterMessages","appMessagesIdsManager","saveMessage","isMessage","replyTo","overwriting","msgId","savedFromPeerId","savedFromMid","savedFrom","mediaContext","unsupported","originalDoc","messageKey","getMessageKeyForPendingWebPage","saveWebPage","appWebDocsManager","saveWebDocument","extendedMediaMedia","totalEntities","migrateFrom","migrateTo","video_sizes","appGroupCallsManager","migrateChecks","getFirstMessageToEdit","goodMessage","myPeerId","canEditMessage","apiEntities","myEntities","parseEntities","mergeEntities","reportMessages","editPeerFolders","getDialogPeer","markDialogUnread","read","fromChat","canMessageBeEdited","kind","goodMedias","edit_time_limit","getReplyKeyboard","messageReplyMarkup","lastReplyMarkup","selective","maxOutId","single_use","getSearchStorage","getSearchCounters","canCache","isPeerRestricted","func","filterMessagesByInputFilterFromStorage","_storage","filterMessagesByInputFilter","nextRate","backLimit","offset_id_offset","next_rate","foundMsgs","min_date","max_date","add_offset","min_id","offsetId","offsetMessage","offset_rate","searchResult","foundCount","subscribeRepliesThread","getDiscussionMessage","generateThreadServiceStartMessage","maxMessageId","serviceStartMessage","is_single","getThreadServiceMessageId","getMessageWithReplies","newMaxId","unsetEnd","newDialogsHandlePromise","deleteMessages","isRecursion","creator","delete_messages","serverMessageIds","affectedMessages","readHistory","triedToReadMaxId","readPromise","getPeerString","readAllHistory","getUnreadMentionsKey","slicedArray","fixUnreadMentionsCountIfNeeded","goToNextMention","loadNextPromise","loadNextMentions","last","getUnreadMentions","mergeHistoryResult","minId","messagesMessages","readMessages","msgIds","getHistoryStorageTransferable","historySerialized","toJSON","inputNotifyPeer","getInputNotifyPeerById","ignorePeerId","getNotifyPeerTypeSettings","getNotifySettings","isMessageIsTopMessage","threadMessage","broadcastEventName","pendingMessage","finalizePendingMessage","mutePeer","validatePeerSettings","muteUntil","mute_until","togglePeerMute","mute","canSendToPeer","canSendToUser","finalMessage","tempMessage","finalizePendingMessageCallbacks","newPhoto","newDoc","newPhotoSize","oldCacheContext","getPhotoDownloadOptions","thumbSize","polls","handleReleasingMessage","getMessageReactionsListAndReadParticipants","skipReadParticipants","skipReactionsList","emptyMessageReactionsList","canViewMessageReadParticipants","getMessageReadParticipants","appReactionsManager","getMessageReactionsList","messageReactionsList","readParticipantsPeerIds","filteredReadParticipants","readPeerId","reactionsCount","readParticipants","appConfig","getAppConfig","chat_read_mark_size_threshold","chat_read_mark_expire_period","incrementMessageViews","increment","chatPeerIds","idleStartTime","getScheduledMessageByPeer","getScheduledMessages","sendScheduledMessages","deleteScheduledMessages","getMessageWithCommentReplies","isFetchIntervalNeeded","getNewHistory","isBottomEnd","getEnds","offsetIdOffset","haveSlice","sliceMe","fulfilled","fillHistoryStorage","constructSlice","isHistoryResultEnd","topWasMeantToLoad","wasMaxId","requestHistory","deleteSlice","oldestMessage","foundSlice","_historyResult","fetchSingleMessages","fetchSingleMessagesPromise","requestPromises","getMessagesResult","getExtendedMedia","toRequest","fetchMessageReplyTo","replyToPeerId","typing","smth","deleteWebPageFromPending","updatePollToMessage","groupedStorage","albums","dispatchAlbumEdit","deletedMids","noforwards","noForwards","getElementCallback","newMap","peerIdStr","saveDefaultSendAs","convertInputKeyToKey","inputKey","AppNotificationsManager","peerSettings","notifyUsers","notifyChats","notifyBroadcasts","notifyForumTopic","checkMuteUntil","checkMuteUntilTimeout","closestMuteUntil","peerNotifySettings","typeKey","checkMuteUntilThrottled","throttle","isPeerType","notifySettings","getNotifyPeerTypePromise","getContactSignUpNotification","notifyContactsSignUp","setContactSignUpNotification","getPeerKey","getPeerMuted","getPeerLocalSettings","n","peerKey","typeNotifySettings","AppPeersManager","canPinMessage","getPeerPhoto","getUserString","getRestrictionReasonText","restriction_reason","getUserInputPeer","getUserSearchText","getDialogType","getDeleteButtonText","AppPhotosManager","photos","oldPhoto","Infinity","getUserPhotos","inputUser","photosResult","photoIds","photoId","AppPollsManager","updateMessagePoll","poll_id","saveResults","chosenIndexes","answer","chosen","getInputMediaPoll","correctAnswers","solution","solutionEntities","correct_answers","solution_entities","sendVote","optionIds","answers","option","getResults","getVotes","votesList","stopPoll","newPoll","AppPrivacyManager","privacy","updatePrivacy","rules","setPrivacy","privacyRules","inputRule","rule","getPrivacy","privacyKey","getGlobalPrivacySettings","setGlobalPrivacySettings","PEER_FULL_TTL","AppProfileManager","usersFull","chatsFull","fullExpiration","onUpdateChatParticipants","onUpdateChatParticipantAdd","_participants","onUpdateChatParticipantDelete","onUpdateUserTyping","getTypingsKey","typingsInPeer","t","cancelAction","getChatFull","onUpdatePeerBlocked","blocked","updateChatParticipants","updateChatParticipantAdd","updateChatParticipantDelete","updateUserTyping","updateChatUserTyping","updateChannelUserTyping","updatePeerBlocked","fullChat","updated","call_active","hasChatPhoto","chat_photo","refreshFullPeer","invalidateChannelParticipants","usersUserFull","full_user","profile_photo","botInfo","bot_info","referenceContext","description_document","description_photo","getProfileByPeerId","getCachedProfileByPeerId","getFullPhoto","profile","full_chat","getChatInviteLink","exported_invite","link","exportedInvite","getParticipants","getChannelParticipants","chatParticipants","createSearchIndex","chatParticipant","found","filteredParticipants","getParticipant","getChannelParticipant","broadcast","channelParticipant","fullChannel","getMentions","processUserIds","ratingMap","cP","updateProfile","saveApiUser","uploadProfilePhoto","updateResult","strippedThumb","stripped_thumb","deletePhotos","deletedList","verifyParticipantForOnlineCount","reduceParticipantsForOnlineCount","getOnlines","chatInfo","channelParticipants","onlines","getPeerTypings","callbackifyAll","SAVE_DOC_KEYS","REFERENCE_CONTEXT","AppReactionsManager","availableReactions","getAvailableReactions","sendReactionPromises","lastSendingTimes","availableReaction","around_animation","static_icon","appear_animation","center_icon","messagesAvailableReactions","getActiveAvailableReactions","inactive","getAvailableReactionsForPeer","activeAvailableReactions","unshiftQuickReaction","getQuickReaction","quickReaction","chatAvailableReactions","filteredChatAvailableReactions","unshiftQuickReactionInner","getAvailableReactionsByMessage","isReactionActive","reactions_default","getReactionCached","getReaction","getMessagesReactions","setDefaultReaction","sendReaction","lastSendingTimeKey","unsetReactionCount","canSeeList","can_see_list","chosenReactions","unsetReactions","chosenReactionIdx","chosenReactionCount","chosenReactionsLength","reactionCountIdx","id1","id2","promiseKey","editMessageUpdateIdx","editMessageUpdate","LOCAL_IDS","EMOJI","EMOJI_ANIMATIONS","PREMIUM_GIFTS","GENERIC_ANIMATIONS","DEFAULT_STATUSES","DEFAULT_TOPIC_ICONS","LOCAL_IDS_SET","AppStickersManager","getStickerSetPromises","getStickersByEmoticonsPromises","sounds","processAllStickersResult","allStickers","sets","stickerSet","videos","getAnimatedEmojiStickerSet","getGreetingStickersPromise","getGreetingStickersTimeout","getGreetingSticker","onStickersUpdated","updateNewStickerSet","saveStickerSet","updateRecentStickers","updateFavedStickers","updateMoveStickerSetToTop","updateStickerSetsOrder","masks","stickers","getFavedStickersStickers","getRecentStickersStickers","justPreload","getStickersByEmoticon","greetingStickers","random","saveStickers","canUseStickerSetCache","useCache","refreshTime","getStickerSet","cachedSet","getStickerSetInput","saveById","getLocalStickerSet","animations","getAnimatedEmojiSoundsPromise","emojies_sounds","sound","bytesStr","atob","file_reference_base64","charCodeAt","this_dc","getRecentStickers","recentStickers","saveRecentSticker","unsave","_doc","docEmoticon","faved","cleanEmoji","getAnimatedEmojiSticker","isAnimation","packs","getAnimatedEmojiSoundDocument","preloadAnimatedEmojiSticker","preloadEmojiPromise","preloadAnimatedEmojiStickerAnimation","animation","preloadSticker","isPremiumEffect","video_thumbs","newSet","setToCache","needSave","installed_date","getStickerSetThumbDownloadOptions","thumb_dc_id","isAnimated","mimeType","getFeaturedStickers","covered","getPromoPremiumStickers","getPremiumStickers","getFavedStickers","favedStickers","getFavedStickersLimit","faveSticker","unfave","toggleStickerSet","archived","toggleStickerSets","searchStickerSets","excludeFeatured","exclude_featured","foundSaved","cover","getAllStickers","preloadStickerSets","includeOurStickers","includeServerStickers","cacheKey","messagesStickers","installedSets","foundStickers","cachedStickersAnimated","cachedStickersStatic","iteratePacks","clearRecentStickers","reorderStickerSets","AppUsersManager","usernames","getTopPeersPromises","contactsIndex","contactsFillPromise","contactsList","updatedContactsList","updateUsersStatuses","timestampNow","updateUserStatus","setInterval","expires","was_online","setUserToStateIfNeeded","updateUserName","contactsListCachedTime","contact","mutual_contact","pushContact","recentSearch","onContactsModified","fromServer","pushRecentSearch","clearRecentSearch","resolveUsername","resolvedPeer","processResolvedPeer","resolvePhone","popContact","getContacts","includeSaved","sortBy","_contactsList","userId1","userId2","sortName1","sortName","sortName2","localeCompare","status1","getUserStatusForSort","myUserId","testSelfSearch","getContactsPeerIds","toggleBlock","block","apiUsers","cleanedUsernames","cleanUsername","searchUsername","oldPeer","oldUser","fullName","wasContact","newContact","onContactUpdated","checkPremium","isUserOnlineVisible","getUserStatus","isRegularUser","getUserPhone","isAnonymous","fragment_prefixes","isAttachMenuBot","bot_attach_menu","support","isNonContactUser","eventTimestamp","importContact","importContacts","phones","inputContacts","j","client_id","importedContactsResult","imported","importedContact","topPeersCache","cachedTime","categories","getBlocked","contactsBlocked","getLocated","self_expires","searchContacts","my_results","curIsContact","setUserStatus","offline","updateMyOnlineStatus","addContact","addPhonePrivacyException","add_phone_privacy_exception","deleteContacts","getCommonChats","photoTypeSet","AppWebPagesManager","webpages","pendingWebPages","updateWebPage","apiWebPage","oldWebPage","isUpdated","siteName","site_name","shortTitle","author","pendingSet","getWebPage","readBlobAsArrayBuffer","readBlobAs","fileNameRFC","escape","DownloadWriter","serviceMessagePort","getServiceMessagePort","write","chunk","saveToStorage","DownloadStorage","getFile","prepareWriting","headers","cancel","getWriter","MIN_PART_SIZE","IGNORE_ERRORS","ApiFileManager","cacheStorage","downloadStorage","downloadPromises","uploadPromises","downloadPulls","downloadActives","refreshReferencePromises","maxUploadParts","maxDownloadParts","uncompressTGS","uncompressTGV","svgIndex","__","fixFirefoxSvg","TextEncoder","convertWebp","convertOpus","webFileDcId","webfile_dc_id","upload_max_fileparts_premium","upload_max_fileparts_default","downloadRequest","activeDelta","downloadPull","downloadCheck","downloadLimit","setQueueId","getFileStorage","cancelDownload","canceled","requestWebFilePart","checkCancel","isLocalWebFile","extension","file_type","mtime","fileDownload","getDelta","checkedReference","getLimitPart","isUpload","maxParts","maxPartSize","inputFileLocation","isDownloading","getDownload","getUpload","getConvertMethod","IS_OPUS_SUPPORTED","allocateDeferredPromises","startOffset","delayed","writeDeferred","writePromise","originalMimeType","convertMethod","getDownloadFileNameFromOptions","cacheFileName","errorHandler","prepared","isWebFile","cachePrepared","downloadPrepared","possibleSize","_errorHandler","writer","truncate","downloadFileName","readBlobAsUint8Array","requestPart","dispatchProgress","throttledDispatchProgress","superpuper","isFinal","getParts","replaceParts","processedResult","getDownloadMediaDetails","downloadMediaURL","downloadMediaVoid","fileSize","isBigFile","partSize","totalParts","fileId","resultInputFile","parts","md5_checksum","resolved","it","_part","doneParts","file_id","file_part","file_total_parts","fileUpload","generator","ApiManagerMethods","apiPromisesSingleProcess","apiPromisesSingle","apiPromisesCacheable","afterMessageIdTemp","setUserAuth","prepareTempMessageId","queryJSON","newResult","oldPromise","getNewPromise","newPromise","ignore_restriction_reasons","pin","folderPin","bio","topicPin","ApiManager","cachedNetworkers","cachedExportPromise","gettingNetworkers","baseDcId","afterMessageTempIds","changeTransportType","updateConfig","iterateNetworkers","getTransportType","connections","dcs","array","oldTransportType","oldObject","oldGetKey","newGetKey","info","changeNetworkerTransport","getBaseDcId","sessionStorage","setBaseDcId","userAuth","dcID","user_auth","wasDcId","getNetworker","setOnDrainIfNeeded","dc","logOut","loggingOut","storageKeys","storageResult","logoutPromises","ignoreErrors","toggleStorages","generateNetworkerGetKey","networkers","maxNetworkers","isOnline","ak","authKeyHex","serverSaltHex","authKey","bytesFromHex","authKeyId","serverSalt","authorizer","_error","newTransportType","removeTransport","stack","getNetworkerVoid","oldTransport","changeTransport","onNetworkerDrain","onDrain","removeNetworker","isFileNetworker","canRelease","setDrainTimeout","updatesProcessor","cachedNetworker","startTime","isStopped","performRequest","wrapApiCall","exportResolve","exportReject","exportedAuth","newDcId","unsetConnectionInited","rawError","waitTime","floodMaxTimeout","attachPromise","originalError","PeersStorage","neededPeers","singlePeerMap","thumbFullSize","ThumbsStorage","thumbsCache","intToUint","ulongFromInts","high","low","shiftLeft","safeBigInt","ulongBigInt","pow","longBigInt","divide","bigIntFromBytes","base","boolFalse","predicate","boolTrue","vector","gzipPacked","sliceMethod","TLSerialization","mtproto","startMaxLength","createBuffer","ArrayBuffer","intView","Int32Array","byteView","getArray","resultBuffer","resultInt32","subarray","getBuffer","getBytes","typed","resultArray","getOffset","checkLength","needBytes","previousBuffer","previousArray","writeInt","field","storeInt","storeBool","storeLongP","iHigh","iLow","storeLong","sLong","storeIntBytes","_bigInt","bigInt","isNegative","quotient","remainder","divmod","toJSNumber","storeDouble","Float64Array","storeString","sUTF8","unescape","storeBytes","bits","storeRawBytes","storeMethod","methodName","methodData","methods","m","flagsOffsets","param","condType","fieldBit","storeObject","paramName","itemType","schema","isBare","constructorData","TLDeserialization","readInt","fetchInt","fetchDouble","doubleView","fetchLong","ulong","greater","minus","greaterOrEquals","abs","fetchBool","fetchObject","fetchString","String","fromCharCode","decodeURIComponent","fetchBytes","fetchIntBytes","fetchRawBytes","fetchVector","fallback","checkType","constructorCmp","uncompressed","constructorsIndex","schemaFallback","int1","int2","overrideKey","isCond","formatJSONValue","jsonValue","objectValues","objectValue","setOffset","addPadding","blockSize","zeroes","blockSizeAsTotalLength","needPadding","padding","bufferConcats","delays","disconnectDelayMin","disconnectDelayMax","pingInterval","pingMaxTime","connectionTimeout","RESEND_OPTIONS","noSchedule","notContentRelated","invokeAfterMsgConstructor","networkerTempId","MTPNetworker","lastServerMessages","sentMessages","pendingMessages","pendingAcks","pendingResendReq","nextReq","checkConnectionPeriod","lastResponseTime","activeRequests","sendPingDelayDisconnect","pingDelayDisconnectDeferred","lastPingTime","disconnectDelay","round","timeoutTime","lastPingStartTime","pingId","lastPingDelayDisconnectId","wrapMtpCall","ping_id","disconnect_delay","rejectTimeout","elapsedTime","checkLongPoll","isClean","longPollPending","sleepAfter","sendLongPoll","checkConnection","clearCheckConnectionTimeout","serializer","pingMessage","generateId","seq_no","generateSeqNo","sendEncryptedRequest","toggleOffline","checkConnectionTimeout","authKeyUint8","convertToUint8Array","isFileUpload","isFileDownload","updateSession","seqNo","prevSessionId","updateSentMessage","sentMessageId","sentMessage","container","inner","innerSentMessageId","innerSentMessage","pushMessage","wrapMtpMessage","connectionInited","invokeWithLayer","initConnection","resultType","isAPI","nextReqTimeout","longPollInterval","clearPingDelayDisconnect","forceReconnectTimeout","sendingLongPoll","max_delay","wait_after","max_wait","noResponse","longPoll","delay","checkConnectionRetryAt","scheduleRequest","handleSentEncryptedRequestHTTP","noResponseMsgs","sqrt","pushResend","shouldResolve","onDrainTimeout","willChange","onConnectionStatusChange","innerMsgId","acked","getMsgKey","dataWithPadding","x","msgKeyLargePlain","msgKeyLarge","getAesKeyIv","msgKey","sha2aText","sha2bText","aesKey","aesIv","sha2a","sha2b","akStopped","performScheduledRequest","ackMsgIds","msg_ids","pendingResendReqLength","outMessage","messagesByteLen","hasApiCall","hasHttpWait","lengthOverflow","compare","messageByteLength","generateContainerMessage","messageWithBody","innerMessages","getEncryptedMessage","keyIv","getDecryptedMessage","encryptedData","getEncryptedOutput","dataBuffer","paddingLength","encryptedResult","requestData","baseError","responseBuffer","deserializer","bytesCmp","calcMsgKey","totalLength","messageBodyLength","messageBody","mt_message","seqno","mt_rpc_result","req_msg_id","applyServerSalt","newServerSalt","toArray","ackMessage","reqResend","notEmpty","processMessageAck","error_message","error_code","msg","applyServerTime","serverTime","shiftRight","innerMessage","new_server_salt","bad_msg_id","changedTimeOffset","badMessage","first_msg_id","server_salt","answer_msg_id","lastResendReq","lastResend","pendingResend","reqMsgId","badMsgId","pos","NetworkerFactory","startAll","stoppedNetworkers","stopAll","setLanguage","testPublicKeysHex","modulus","exponent","publisKeysHex","publicKeysParsed","preparePromise","prepare","keyParsed","RSAPublicKey","fingerprintBytes","fingerprints","fingerprintHex","fill","foundKey","fingerprint","bytesXor","bytes1","bytes2","Authorizer","sendPlainRequest","requestArray","requestLength","headerArray","errorCode","auth_key_id","msg_len","sendReqPQ","nonce","rsaKeysManager","serverNonce","server_nonce","pq","server_public_key_fingerprints","publicKey","pAndQ","sendReqDhParams","newNonce","p_q_inner_data_dc","new_nonce","pQInnerDataSerialization","dataPadReversed","keyAesEncrypted","tempKey","dataWithHash","aesEncrypted","keyAesEncryptedBigInt","publicKeyModulusBigInt","getKeyAesEncrypted","req_DH_params","public_key_fingerprint","encrypted_data","requestBytes","newNonceHash","new_nonce_hash","decryptServerDhDataAnswer","encrypted_answer","sendSetClientDhParams","encryptedAnswer","localTime","tmpAesKey","tmpAesIv","answerWithHash","answerWithPadding","g","dhPrime","dh_prime","gA","g_a","server_time","retry","verifyDhParams","dhPrimeHex","gABigInt","dhPrimeBigInt","subtract","twoPow","gBytes","gB","retry_id","authKeyHash","authKeyAux","newNonceHash1","new_nonce_hash1","newNonceHash2","new_nonce_hash2","newNonceHash3","new_nonce_hash3","getTransportTypePromise","_try","TimeManager","lastMessageId","timeOffset","timeTicks","newTimeOffset","changed","server_time_offset","AppWebDocsManager","webDocument","AppPaymentsManager","getInputInvoiceBySlug","getInputInvoiceByPeerId","getPaymentForm","invoice","paymentForm","getPaymentReceipt","validateRequestedInfo","sendPaymentForm","formId","requestedInfoId","shippingOptionId","credentials","tipAmount","form_id","requested_info_id","shipping_option_id","tip_amount","clearSavedInfo","AppAttachMenuBotsManager","attachMenuBots","attachMenuBotsArr","onUpdateAttachMenuBots","getAttachMenuBots","updateAttachMenuBots","saveAttachMenuBot","attachMenuBot","bot_id","icon","getAttachMenuBotIcon","saveAttachMenuBots","getAttachMenuBotCached","requestWebView","fromBotMenu","themeParams","from_bot_menu","theme_params","prolongWebView","AppSeamlessLoginManager","requestUrlAuth","buttonId","button_id","urlAuthResult","acceptUrlAuth","writeAllowed","write_allowed","getWebAuthorizations","webAuthorizations","authorizations","resetWebAuthorization","resetWebAuthorizations","AppThemesManager","wallPapers","saveWallPaper","getWallPaper","inputWallPaper","getInputWallPaper","getThemes","accountThemes","themes","theme","themeSettings","getWallPapers","accountWallpapers","wallpapers","appManagersManager","cryptoWorkersURLs","cryptoPortsAttached","cryptoPortPromise","getManagers","manager","apply","ports","originalUrl","newURLs","createManagers","appAvatarsManager","appCallsManager","appPrivacyManager","appInlineBotsManager","passwordManager","appPaymentsManager","appSeamlessLoginManager","_serviceMessagePort","_isServiceWorkerOnline","pushedKeys","clearWrite","invokeExceptSource","serviceWorkerOnline","serviceWorkerPort","detachPort","attachPort","messagePort","onConnect","onDisconnect","listenPort","sendPort","attachListenPort","attachSendPort","setOnPortDisconnect","listenMessagePort","NULL_PEER_ID","REPLIES_PEER_ID","REPLIES_HIDDEN_CHANNEL_ID","SERVICE_PEER_ID","MUTE_UNTIL","MAX_FILE_SAVE_SIZE","THUMB_TYPE_FULL","ATTACH_MENU_BOT_ICON_NAME","GENERAL_TOPIC_ID","T_ME_PREFIXES","FOLDER_ID_ALL","FOLDER_ID_ARCHIVE","REAL_FOLDERS","START_LOCAL_ID","ALPHA_CHARS_REG_EXP","ALPHA_NUMERIC_REG_EXP","URL_ALPHANUMERIC_REG_EXP_PART","URL_PROTOCOL_REG_EXP_PART","URL_REG_EXP","URL_ANY_PROTOCOL_REG_EXP","USERNAME_REG_EXP","BOT_COMMAND_REG_EXP","FULL_REG_EXP","EMAIL_REG_EXP","MARKDOWN_REG_EXP","MARKDOWN_ENTITIES","PASS_CONFLICTING_ENTITIES","PHONE_NUMBER_REG_EXP","encodeEmoji","emojiText","unicodeSurrogates","points","char","previous","toCodePoints","removeVS16s","vs16RegExp","zeroWidthJoiner","rawEmoji","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","__webpack_exports__","O","chunkIds","fn","priority","notFulfilled","getter","__esModule","definition","enumerable","chunkId","miniCssF","globalThis","Function","prop","Symbol","toStringTag","nmd","paths","children","scriptUrl","importScripts","currentScript","src","scripts","getElementsByTagName","oldGetScript","oldLoadScript","queryMap","countMap","retries","realSrc","cacheBust","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","moreModules","runtime"],"sourceRoot":""} \ No newline at end of file diff --git a/public/mtproto.worker.c9d58d1702ff11ef9b30.chunk.js b/public/mtproto.worker.c9d58d1702ff11ef9b30.chunk.js new file mode 100644 index 00000000..40f0b5db --- /dev/null +++ b/public/mtproto.worker.c9d58d1702ff11ef9b30.chunk.js @@ -0,0 +1,2 @@ +(()=>{"use strict";var e,t,a={410:(e,t,a)=>{a.d(t,{GO:()=>n,ZP:()=>i});const s=a(1267).Z.debug,n="undefined"!=typeof window?window:self,i=s},3447:(e,t,a)=>{a.d(t,{Z:()=>i});const s={14:{"1f6dd":4867,"1f6de":4916,"1f6df":4923,"1f7f0":62832,"1f979":183,"1f9cc":1557,"1fa7b":61332,"1fa7c":61330,"1faa9":51093,"1faaa":61364,"1faab":61189,"1faac":51085,"1fab7":2651,"1fab8":2631,"1fab9":2672,"1faba":2673,"1fac3":1520,"1fac4":1521,"1fac5":1505,"1fad7":3793,"1fad8":3707,"1fad9":3804,"1fae0":111,"1fae1":136,"1fae2":132,"1fae3":133,"1fae4":174,"1fae5":142,"1fae6":1385,"1fae7":61353,"1faf0":1341,"1faf1":1332,"1faf2":1333,"1faf3":1334,"1faf4":1335,"1faf5":1351,"1faf6":1360,"1faf1-1f3fb-200d-1faf2-1f3fc":0,"1faf1-1f3fb-200d-1faf2-1f3fd":0,"1faf1-1f3fb-200d-1faf2-1f3fe":0,"1faf1-1f3fb-200d-1faf2-1f3ff":0,"1faf1-1f3fc-200d-1faf2-1f3fb":0,"1faf1-1f3fc-200d-1faf2-1f3fd":0,"1faf1-1f3fc-200d-1faf2-1f3fe":0,"1faf1-1f3fc-200d-1faf2-1f3ff":0,"1faf1-1f3fd-200d-1faf2-1f3fb":0,"1faf1-1f3fd-200d-1faf2-1f3fc":0,"1faf1-1f3fd-200d-1faf2-1f3fe":0,"1faf1-1f3fd-200d-1faf2-1f3ff":0,"1faf1-1f3fe-200d-1faf2-1f3fb":0,"1faf1-1f3fe-200d-1faf2-1f3fc":0,"1faf1-1f3fe-200d-1faf2-1f3fd":0,"1faf1-1f3fe-200d-1faf2-1f3ff":0,"1faf1-1f3ff-200d-1faf2-1f3fb":0,"1faf1-1f3ff-200d-1faf2-1f3fc":0,"1faf1-1f3ff-200d-1faf2-1f3fd":0,"1faf1-1f3ff-200d-1faf2-1f3fe":0,"1fac3-1f3fb":0,"1fac3-1f3fc":0,"1fac3-1f3fd":0,"1fac3-1f3fe":0,"1fac3-1f3ff":0,"1fac4-1f3fb":0,"1fac4-1f3fc":0,"1fac4-1f3fd":0,"1fac4-1f3fe":0,"1fac4-1f3ff":0,"1fac5-1f3fb":0,"1fac5-1f3fc":0,"1fac5-1f3fd":0,"1fac5-1f3fe":0,"1fac5-1f3ff":0,"1faf0-1f3fb":0,"1faf0-1f3fc":0,"1faf0-1f3fd":0,"1faf0-1f3fe":0,"1faf0-1f3ff":0,"1faf1-1f3fb":0,"1faf1-1f3fc":0,"1faf1-1f3fd":0,"1faf1-1f3fe":0,"1faf1-1f3ff":0,"1faf2-1f3fb":0,"1faf2-1f3fc":0,"1faf2-1f3fd":0,"1faf2-1f3fe":0,"1faf2-1f3ff":0,"1faf3-1f3fb":0,"1faf3-1f3fc":0,"1faf3-1f3fd":0,"1faf3-1f3fe":0,"1faf3-1f3ff":0,"1faf4-1f3fb":0,"1faf4-1f3fc":0,"1faf4-1f3fd":0,"1faf4-1f3fe":0,"1faf4-1f3ff":0,"1faf5-1f3fb":0,"1faf5-1f3fc":0,"1faf5-1f3fd":0,"1faf5-1f3fe":0,"1faf5-1f3ff":0,"1faf6-1f3fb":0,"1faf6-1f3fc":0,"1faf6-1f3fd":0,"1faf6-1f3fe":0,"1faf6-1f3ff":0},"":{2049:62835,2122:62863,2139:62888,2194:62764,2195:62763,2196:62762,2197:62756,2198:62758,2199:62760,2328:61194,2600:4990,2601:4998,2602:41013,2603:41018,2604:41020,2611:62851,2614:41014,2615:3781,2618:2667,2620:1106,2622:62753,2623:62754,2626:62783,2638:62780,2639:177,2648:62788,2649:62789,2650:62796,2651:62797,2652:62798,2653:62799,2660:51095,2663:51098,2665:51096,2666:51097,2668:4865,2692:61297,2693:4922,2694:61300,2696:61311,2697:61319,2699:61309,2702:61284,2705:62850,2708:4931,2709:61245,2712:61259,2714:62852,2716:62828,2721:62779,2728:51029,2733:62858,2734:62859,2744:41017,2747:62860,2753:62836,2754:62837,2755:62838,2757:62839,2763:1137,2764:1141,2795:62829,2796:62830,2797:62831,2934:62767,2935:62768,3030:62840,3297:62912,3299:62913,"0023-20e3":62864,"002a-20e3":62865,"0030-20e3":62866,"0031-20e3":62867,"0032-20e3":62868,"0033-20e3":62869,"0034-20e3":62870,"0035-20e3":62871,"0036-20e3":62872,"0037-20e3":62873,"0038-20e3":62874,"0039-20e3":62875,"00a9":62861,"00ae":62862,"1f004":51101,"1f0cf":51100,"1f170":62882,"1f171":62884,"1f17e":62893,"1f17f":62895,"1f18e":62883,"1f191":62885,"1f192":62886,"1f193":62887,"1f194":62889,"1f195":62891,"1f196":62892,"1f197":62894,"1f198":62896,"1f199":62897,"1f19a":62898,"1f1e6-1f1e8":71594,"1f1e6-1f1e9":71595,"1f1e6-1f1ea":71596,"1f1e6-1f1eb":71597,"1f1e6-1f1ec":71598,"1f1e6-1f1ee":71599,"1f1e6-1f1f1":71600,"1f1e6-1f1f2":71601,"1f1e6-1f1f4":71602,"1f1e6-1f1f6":71603,"1f1e6-1f1f7":71604,"1f1e6-1f1f8":71605,"1f1e6-1f1f9":71606,"1f1e6-1f1fa":71607,"1f1e6-1f1fc":71608,"1f1e6-1f1fd":71609,"1f1e6-1f1ff":71610,"1f1e7-1f1e6":71611,"1f1e7-1f1e7":71612,"1f1e7-1f1e9":71613,"1f1e7-1f1ea":71614,"1f1e7-1f1eb":71615,"1f1e7-1f1ec":71616,"1f1e7-1f1ed":71617,"1f1e7-1f1ee":71618,"1f1e7-1f1ef":71619,"1f1e7-1f1f1":71620,"1f1e7-1f1f2":71621,"1f1e7-1f1f3":71622,"1f1e7-1f1f4":71623,"1f1e7-1f1f6":71624,"1f1e7-1f1f7":71625,"1f1e7-1f1f8":71626,"1f1e7-1f1f9":71627,"1f1e7-1f1fb":71628,"1f1e7-1f1fc":71629,"1f1e7-1f1fe":71630,"1f1e7-1f1ff":71631,"1f1e8-1f1e6":71632,"1f1e8-1f1e8":71633,"1f1e8-1f1e9":71634,"1f1e8-1f1eb":71635,"1f1e8-1f1ec":71636,"1f1e8-1f1ed":71637,"1f1e8-1f1ee":71638,"1f1e8-1f1f0":71639,"1f1e8-1f1f1":71640,"1f1e8-1f1f2":71641,"1f1e8-1f1f3":71642,"1f1e8-1f1f4":71643,"1f1e8-1f1f5":71644,"1f1e8-1f1f7":71645,"1f1e8-1f1fa":71646,"1f1e8-1f1fb":71647,"1f1e8-1f1fc":71648,"1f1e8-1f1fd":71649,"1f1e8-1f1fe":71650,"1f1e8-1f1ff":71651,"1f1e9-1f1ea":71652,"1f1e9-1f1ec":71653,"1f1e9-1f1ef":71654,"1f1e9-1f1f0":71655,"1f1e9-1f1f2":71656,"1f1e9-1f1f4":71657,"1f1e9-1f1ff":71658,"1f1ea-1f1e6":71659,"1f1ea-1f1e8":71660,"1f1ea-1f1ea":71661,"1f1ea-1f1ec":71662,"1f1ea-1f1ed":71663,"1f1ea-1f1f7":71664,"1f1ea-1f1f8":71665,"1f1ea-1f1f9":71666,"1f1ea-1f1fa":71667,"1f1eb-1f1ee":71668,"1f1eb-1f1ef":71669,"1f1eb-1f1f0":71670,"1f1eb-1f1f2":71671,"1f1eb-1f1f4":71672,"1f1eb-1f1f7":71673,"1f1ec-1f1e6":71674,"1f1ec-1f1e7":71675,"1f1ec-1f1e9":71676,"1f1ec-1f1ea":71677,"1f1ec-1f1eb":71678,"1f1ec-1f1ec":71679,"1f1ec-1f1ed":71680,"1f1ec-1f1ee":71681,"1f1ec-1f1f1":71682,"1f1ec-1f1f2":71683,"1f1ec-1f1f3":71684,"1f1ec-1f1f5":71685,"1f1ec-1f1f6":71686,"1f1ec-1f1f7":71687,"1f1ec-1f1f8":71688,"1f1ec-1f1f9":71689,"1f1ec-1f1fa":71690,"1f1ec-1f1fc":71691,"1f1ec-1f1fe":71692,"1f1ed-1f1f0":71693,"1f1ed-1f1f2":71694,"1f1ed-1f1f3":71695,"1f1ed-1f1f7":71696,"1f1ed-1f1f9":71697,"1f1ed-1f1fa":71698,"1f1ee-1f1e8":71699,"1f1ee-1f1e9":71700,"1f1ee-1f1ea":71701,"1f1ee-1f1f1":71702,"1f1ee-1f1f2":71703,"1f1ee-1f1f3":71704,"1f1ee-1f1f4":71705,"1f1ee-1f1f6":71706,"1f1ee-1f1f7":71707,"1f1ee-1f1f8":71708,"1f1ee-1f1f9":71709,"1f1ef-1f1ea":71710,"1f1ef-1f1f2":71711,"1f1ef-1f1f4":71712,"1f1ef-1f1f5":71713,"1f1f0-1f1ea":71714,"1f1f0-1f1ec":71715,"1f1f0-1f1ed":71716,"1f1f0-1f1ee":71717,"1f1f0-1f1f2":71718,"1f1f0-1f1f3":71719,"1f1f0-1f1f5":71720,"1f1f0-1f1f7":71721,"1f1f0-1f1fc":71722,"1f1f0-1f1fe":71723,"1f1f0-1f1ff":71724,"1f1f1-1f1e6":71725,"1f1f1-1f1e7":71726,"1f1f1-1f1e8":71727,"1f1f1-1f1ee":71728,"1f1f1-1f1f0":71729,"1f1f1-1f1f7":71730,"1f1f1-1f1f8":71731,"1f1f1-1f1f9":71732,"1f1f1-1f1fa":71733,"1f1f1-1f1fb":71734,"1f1f1-1f1fe":71735,"1f1f2-1f1e6":71736,"1f1f2-1f1e8":71737,"1f1f2-1f1e9":71738,"1f1f2-1f1ea":71739,"1f1f2-1f1eb":71740,"1f1f2-1f1ec":71741,"1f1f2-1f1ed":71742,"1f1f2-1f1f0":71743,"1f1f2-1f1f1":71744,"1f1f2-1f1f2":71745,"1f1f2-1f1f3":71746,"1f1f2-1f1f4":71747,"1f1f2-1f1f5":71748,"1f1f2-1f1f6":71749,"1f1f2-1f1f7":71750,"1f1f2-1f1f8":71751,"1f1f2-1f1f9":71752,"1f1f2-1f1fa":71753,"1f1f2-1f1fb":71754,"1f1f2-1f1fc":71755,"1f1f2-1f1fd":71756,"1f1f2-1f1fe":71757,"1f1f2-1f1ff":71758,"1f1f3-1f1e6":71759,"1f1f3-1f1e8":71760,"1f1f3-1f1ea":71761,"1f1f3-1f1eb":71762,"1f1f3-1f1ec":71763,"1f1f3-1f1ee":71764,"1f1f3-1f1f1":71765,"1f1f3-1f1f4":71766,"1f1f3-1f1f5":71767,"1f1f3-1f1f7":71768,"1f1f3-1f1fa":71769,"1f1f3-1f1ff":71770,"1f1f4-1f1f2":71771,"1f1f5-1f1e6":71772,"1f1f5-1f1ea":71773,"1f1f5-1f1eb":71774,"1f1f5-1f1ec":71775,"1f1f5-1f1ed":71776,"1f1f5-1f1f0":71777,"1f1f5-1f1f1":71778,"1f1f5-1f1f2":71779,"1f1f5-1f1f3":71780,"1f1f5-1f1f7":71781,"1f1f5-1f1f8":71782,"1f1f5-1f1f9":71783,"1f1f5-1f1fc":71784,"1f1f5-1f1fe":71785,"1f1f6-1f1e6":71786,"1f1f7-1f1ea":71787,"1f1f7-1f1f4":71788,"1f1f7-1f1f8":71789,"1f1f7-1f1fa":71790,"1f1f7-1f1fc":71791,"1f1f8-1f1e6":71792,"1f1f8-1f1e7":71793,"1f1f8-1f1e8":71794,"1f1f8-1f1e9":71795,"1f1f8-1f1ea":71796,"1f1f8-1f1ec":71797,"1f1f8-1f1ed":71798,"1f1f8-1f1ee":71799,"1f1f8-1f1ef":71800,"1f1f8-1f1f0":71801,"1f1f8-1f1f1":71802,"1f1f8-1f1f2":71803,"1f1f8-1f1f3":71804,"1f1f8-1f1f4":71805,"1f1f8-1f1f7":71806,"1f1f8-1f1f8":71807,"1f1f8-1f1f9":71808,"1f1f8-1f1fb":71809,"1f1f8-1f1fd":71810,"1f1f8-1f1fe":71811,"1f1f8-1f1ff":71812,"1f1f9-1f1e6":71813,"1f1f9-1f1e8":71814,"1f1f9-1f1e9":71815,"1f1f9-1f1eb":71816,"1f1f9-1f1ec":71817,"1f1f9-1f1ed":71818,"1f1f9-1f1ef":71819,"1f1f9-1f1f0":71820,"1f1f9-1f1f1":71821,"1f1f9-1f1f2":71822,"1f1f9-1f1f3":71823,"1f1f9-1f1f4":71824,"1f1f9-1f1f7":71825,"1f1f9-1f1f9":71826,"1f1f9-1f1fb":71827,"1f1f9-1f1fc":71828,"1f1f9-1f1ff":71829,"1f1fa-1f1e6":71830,"1f1fa-1f1ec":71831,"1f1fa-1f1f2":71832,"1f1fa-1f1f3":71833,"1f1fa-1f1f8":71834,"1f1fa-1f1fe":71835,"1f1fa-1f1ff":71836,"1f1fb-1f1e6":71837,"1f1fb-1f1e8":71838,"1f1fb-1f1ea":71839,"1f1fb-1f1ec":71840,"1f1fb-1f1ee":71841,"1f1fb-1f1f3":71842,"1f1fb-1f1fa":71843,"1f1fc-1f1eb":71844,"1f1fc-1f1f8":71845,"1f1fd-1f1f0":71846,"1f1fe-1f1ea":71847,"1f1fe-1f1f9":71848,"1f1ff-1f1e6":71849,"1f1ff-1f1f2":71850,"1f1ff-1f1fc":71851,"1f201":62899,"1f202":62900,"1f21a":62906,"1f22f":62903,"1f232":62907,"1f233":62911,"1f234":62910,"1f235":62915,"1f236":62902,"1f237":62901,"1f238":62909,"1f239":62905,"1f23a":62914,"1f250":62904,"1f251":62908,"1f300":41010,"1f301":4857,"1f302":41012,"1f303":4858,"1f304":4860,"1f305":4861,"1f306":4862,"1f307":4863,"1f308":41011,"1f309":4864,"1f30a":41023,"1f30b":4815,"1f30c":4997,"1f30d":4806,"1f30e":4807,"1f30f":4808,"1f310":4809,"1f311":4977,"1f312":4978,"1f313":4979,"1f314":4980,"1f315":4981,"1f316":4982,"1f317":4983,"1f318":4984,"1f319":4985,"1f31a":4986,"1f31b":4987,"1f31c":4988,"1f31d":4991,"1f31e":4992,"1f31f":4995,"1f320":4996,"1f321":4989,"1f324":41001,"1f325":41002,"1f326":41003,"1f327":41004,"1f328":41005,"1f329":41006,"1f32a":41007,"1f32b":41008,"1f32c":41009,"1f32d":3725,"1f32e":3727,"1f32f":3728,"1f330":3708,"1f331":2659,"1f332":2661,"1f333":2662,"1f334":2663,"1f335":2664,"1f336":3698,"1f337":2658,"1f338":2649,"1f339":2653,"1f33a":2655,"1f33b":2656,"1f33c":2657,"1f33d":3697,"1f33e":2665,"1f33f":2666,"1f340":2668,"1f341":2669,"1f342":2670,"1f343":2671,"1f344":3705,"1f345":3690,"1f346":3694,"1f347":3674,"1f348":3675,"1f349":3676,"1f34a":3677,"1f34b":3678,"1f34c":3679,"1f34d":3680,"1f34e":3682,"1f34f":3683,"1f350":3684,"1f351":3685,"1f352":3686,"1f353":3687,"1f354":3722,"1f355":3724,"1f356":3718,"1f357":3719,"1f358":3744,"1f359":3745,"1f35a":3746,"1f35b":3747,"1f35c":3748,"1f35d":3749,"1f35e":3709,"1f35f":3723,"1f360":3750,"1f361":3756,"1f362":3751,"1f363":3752,"1f364":3753,"1f365":3754,"1f366":3765,"1f367":3766,"1f368":3767,"1f369":3768,"1f36a":3769,"1f36b":3774,"1f36c":3775,"1f36d":3776,"1f36e":3777,"1f36f":3778,"1f370":3771,"1f371":3743,"1f372":3735,"1f373":3733,"1f374":3801,"1f375":3783,"1f376":3784,"1f377":3786,"1f378":3787,"1f379":3788,"1f37a":3789,"1f37b":3790,"1f37c":3779,"1f37d":3800,"1f37e":3785,"1f37f":3739,"1f380":51040,"1f381":51041,"1f382":3770,"1f383":51024,"1f384":51025,"1f385":1527,"1f386":51026,"1f387":51027,"1f388":51030,"1f389":51031,"1f38a":51032,"1f38b":51033,"1f38c":71588,"1f38d":51034,"1f38e":51035,"1f38f":51036,"1f390":51037,"1f391":51038,"1f392":61134,"1f393":61147,"1f396":51045,"1f397":51042,"1f399":61167,"1f39a":61168,"1f39b":61169,"1f39e":61203,"1f39f":51043,"1f3a0":4866,"1f3a1":4868,"1f3a2":4869,"1f3a3":51072,"1f3a4":61170,"1f3a5":61202,"1f3a6":62819,"1f3a7":61171,"1f3a8":51105,"1f3a9":61146,"1f3aa":4871,"1f3ab":51044,"1f3ac":61205,"1f3ad":51103,"1f3ae":51086,"1f3af":51078,"1f3b0":51088,"1f3b1":51081,"1f3b2":51089,"1f3b3":51060,"1f3b4":51102,"1f3b5":61165,"1f3b6":61166,"1f3b7":61173,"1f3b8":61175,"1f3b9":61176,"1f3ba":61177,"1f3bb":61178,"1f3bc":61164,"1f3bd":51074,"1f3be":51058,"1f3bf":51075,"1f3c0":51054,"1f3c1":71586,"1f3c2":1600,"1f3c3-200d-2640":1584,"1f3c3-200d-2642":1583,"1f3c3":1582,"1f3c4-200d-2640":1606,"1f3c4-200d-2642":1605,"1f3c4":1604,"1f3c5":51047,"1f3c6":51046,"1f3c7":1598,"1f3c8":51056,"1f3c9":51057,"1f3ca-200d-2640":1612,"1f3ca-200d-2642":1611,"1f3ca":1610,"1f3cb-200d-2640":1618,"1f3cb-200d-2642":1617,"1f3cb":1616,"1f3cc-200d-2640":1603,"1f3cc-200d-2642":1602,"1f3cc":1601,"1f3cd":4902,"1f3ce":4901,"1f3cf":51061,"1f3d0":51055,"1f3d1":51062,"1f3d2":51063,"1f3d3":51065,"1f3d4":4813,"1f3d5":4817,"1f3d6":4818,"1f3d7":4824,"1f3d8":4829,"1f3d9":4859,"1f3da":4830,"1f3db":4823,"1f3dc":4819,"1f3dd":4820,"1f3de":4821,"1f3df":4822,"1f3e0":4831,"1f3e1":4832,"1f3e2":4833,"1f3e3":4834,"1f3e4":4835,"1f3e5":4836,"1f3e6":4837,"1f3e7":62729,"1f3e8":4838,"1f3e9":4839,"1f3ea":4840,"1f3eb":4841,"1f3ec":4842,"1f3ed":4843,"1f3ee":61216,"1f3ef":4844,"1f3f0":4845,"1f3f3-200d-1f308":71591,"1f3f3-200d-26a7":71592,"1f3f3":71590,"1f3f4-200d-2620":71593,"1f3f4-e0067-e0062-e0065-e006e-e0067-e007f":71852,"1f3f4-e0067-e0062-e0073-e0063-e0074-e007f":71853,"1f3f4-e0067-e0062-e0077-e006c-e0073-e007f":71854,"1f3f4":71589,"1f3f5":2652,"1f3f7":61234,"1f3f8":51066,"1f3f9":61303,"1f3fa":3805,"1f3fb":9525,"1f3fc":9526,"1f3fd":9527,"1f3fe":9528,"1f3ff":9529,"1f400":2576,"1f401":2575,"1f402":2556,"1f403":2557,"1f404":2558,"1f405":2547,"1f406":2548,"1f407":2579,"1f408-200d-2b1b":2544,"1f408":2543,"1f409":2618,"1f40a":2613,"1f40b":2622,"1f40c":2632,"1f40d":2616,"1f40e":2550,"1f40f":2563,"1f410":2565,"1f411":2564,"1f412":2531,"1f413":2596,"1f414":2595,"1f415-200d-1f9ba":2537,"1f415":2535,"1f416":2560,"1f417":2561,"1f418":2570,"1f419":2629,"1f41a":2630,"1f41b":2634,"1f41c":2635,"1f41d":2636,"1f41e":2638,"1f41f":2625,"1f420":2626,"1f421":2627,"1f422":2614,"1f423":2597,"1f424":2598,"1f425":2599,"1f426":2600,"1f427":2601,"1f428":2586,"1f429":2538,"1f42a":2566,"1f42b":2567,"1f42c":2623,"1f42d":2574,"1f42e":2555,"1f42f":2546,"1f430":2578,"1f431":2542,"1f432":2617,"1f433":2621,"1f434":2549,"1f435":2530,"1f436":2534,"1f437":2559,"1f438":2612,"1f439":2577,"1f43a":2539,"1f43b-200d-2744":2585,"1f43b":2584,"1f43c":2587,"1f43d":2562,"1f43e":2593,"1f43f":2580,"1f440":1381,"1f441-200d-1f5e8":1159,"1f441":1382,"1f442":1373,"1f443":1375,"1f444":1384,"1f445":1383,"1f446":1347,"1f447":1349,"1f448":1345,"1f449":1346,"1f44a":1355,"1f44b":1327,"1f44c":1336,"1f44d":1352,"1f44e":1353,"1f44f":1358,"1f450":1361,"1f451":61144,"1f452":61145,"1f453":61110,"1f454":61115,"1f455":61116,"1f456":61117,"1f457":61122,"1f458":61123,"1f459":61128,"1f45a":61129,"1f45b":61130,"1f45c":61131,"1f45d":61132,"1f45e":61136,"1f45f":61137,"1f460":61140,"1f461":61141,"1f462":61143,"1f463":1687,"1f464":1684,"1f465":1685,"1f466":1388,"1f467":1389,"1f468-200d-1f33e":1457,"1f468-200d-1f373":1460,"1f468-200d-1f37c":1524,"1f468-200d-1f393":1448,"1f468-200d-1f3a4":1478,"1f468-200d-1f3a8":1481,"1f468-200d-1f3eb":1451,"1f468-200d-1f3ed":1466,"1f468-200d-1f466-200d-1f466":1674,"1f468-200d-1f466":1673,"1f468-200d-1f467-200d-1f466":1676,"1f468-200d-1f467-200d-1f467":1677,"1f468-200d-1f467":1675,"1f468-200d-1f468-200d-1f466":1663,"1f468-200d-1f468-200d-1f466-200d-1f466":1666,"1f468-200d-1f468-200d-1f467":1664,"1f468-200d-1f468-200d-1f467-200d-1f466":1665,"1f468-200d-1f468-200d-1f467-200d-1f467":1667,"1f468-200d-1f469-200d-1f466":1658,"1f468-200d-1f469-200d-1f466-200d-1f466":1661,"1f468-200d-1f469-200d-1f467":1659,"1f468-200d-1f469-200d-1f467-200d-1f466":1660,"1f468-200d-1f469-200d-1f467-200d-1f467":1662,"1f468-200d-1f4bb":1475,"1f468-200d-1f4bc":1469,"1f468-200d-1f527":1463,"1f468-200d-1f52c":1472,"1f468-200d-1f680":1487,"1f468-200d-1f692":1490,"1f468-200d-1f9af":1574,"1f468-200d-1f9b0":1396,"1f468-200d-1f9b1":1397,"1f468-200d-1f9b2":1399,"1f468-200d-1f9b3":1398,"1f468-200d-1f9bc":1577,"1f468-200d-1f9bd":1580,"1f468-200d-2695":1445,"1f468-200d-2696":1454,"1f468-200d-2708":1484,"1f468-200d-2764-200d-1f468":1655,"1f468-200d-2764-200d-1f48b-200d-1f468":1651,"1f468":1392,"1f469-200d-1f33e":1458,"1f469-200d-1f373":1461,"1f469-200d-1f37c":1523,"1f469-200d-1f393":1449,"1f469-200d-1f3a4":1479,"1f469-200d-1f3a8":1482,"1f469-200d-1f3eb":1452,"1f469-200d-1f3ed":1467,"1f469-200d-1f466-200d-1f466":1679,"1f469-200d-1f466":1678,"1f469-200d-1f467-200d-1f466":1681,"1f469-200d-1f467-200d-1f467":1682,"1f469-200d-1f467":1680,"1f469-200d-1f469-200d-1f466":1668,"1f469-200d-1f469-200d-1f466-200d-1f466":1671,"1f469-200d-1f469-200d-1f467":1669,"1f469-200d-1f469-200d-1f467-200d-1f466":1670,"1f469-200d-1f469-200d-1f467-200d-1f467":1672,"1f469-200d-1f4bb":1476,"1f469-200d-1f4bc":1470,"1f469-200d-1f527":1464,"1f469-200d-1f52c":1473,"1f469-200d-1f680":1488,"1f469-200d-1f692":1491,"1f469-200d-1f9af":1575,"1f469-200d-1f9b0":1401,"1f469-200d-1f9b1":1403,"1f469-200d-1f9b2":1407,"1f469-200d-1f9b3":1405,"1f469-200d-1f9bc":1578,"1f469-200d-1f9bd":1581,"1f469-200d-2695":1446,"1f469-200d-2696":1455,"1f469-200d-2708":1485,"1f469-200d-2764-200d-1f468":1654,"1f469-200d-2764-200d-1f469":1656,"1f469-200d-2764-200d-1f48b-200d-1f468":1650,"1f469-200d-2764-200d-1f48b-200d-1f469":1652,"1f469":1400,"1f46a":1657,"1f46b":1647,"1f46c":1648,"1f46d":1646,"1f46e-200d-2640":1494,"1f46e-200d-2642":1493,"1f46e":1492,"1f46f-200d-2640":1590,"1f46f-200d-2642":1589,"1f46f":1588,"1f470-200d-2640":1518,"1f470-200d-2642":1517,"1f470":1516,"1f471-200d-2640":1409,"1f471-200d-2642":1410,"1f471":1391,"1f472":1511,"1f473-200d-2640":1510,"1f473-200d-2642":1509,"1f473":1508,"1f474":1412,"1f475":1413,"1f476":1386,"1f477-200d-2640":1504,"1f477-200d-2642":1503,"1f477":1502,"1f478":1507,"1f479":1109,"1f47a":1110,"1f47b":1111,"1f47c":1526,"1f47d":1112,"1f47e":1113,"1f47f":1104,"1f480":1105,"1f481-200d-2640":1428,"1f481-200d-2642":1427,"1f481":1426,"1f482-200d-2640":1500,"1f482-200d-2642":1499,"1f482":1498,"1f483":1585,"1f484":61152,"1f485":1366,"1f486-200d-2640":1560,"1f486-200d-2642":1559,"1f486":1558,"1f487-200d-2640":1563,"1f487-200d-2642":1562,"1f487":1561,"1f488":4870,"1f489":61326,"1f48a":61328,"1f48b":1127,"1f48c":1128,"1f48d":61153,"1f48e":61154,"1f48f":1649,"1f490":2648,"1f491":1653,"1f492":4846,"1f493":1133,"1f494":1138,"1f495":1135,"1f496":1131,"1f497":1132,"1f498":1129,"1f499":1145,"1f49a":1144,"1f49b":1143,"1f49c":1146,"1f49d":1130,"1f49e":1134,"1f49f":1136,"1f4a0":62946,"1f4a1":61214,"1f4a2":1151,"1f4a3":1157,"1f4a4":1163,"1f4a5":1152,"1f4a6":1154,"1f4a7":41022,"1f4a8":1155,"1f4a9":1107,"1f4aa":1368,"1f4ab":1153,"1f4ac":1158,"1f4ad":1162,"1f4ae":2650,"1f4af":1150,"1f4b0":61235,"1f4b1":62841,"1f4b2":62842,"1f4b3":61242,"1f4b4":61237,"1f4b5":61238,"1f4b6":61239,"1f4b7":61240,"1f4b8":61241,"1f4b9":61244,"1f4ba":4936,"1f4bb":61191,"1f4bc":61265,"1f4bd":61197,"1f4be":61198,"1f4bf":61199,"1f4c0":61200,"1f4c1":61266,"1f4c2":61267,"1f4c3":61227,"1f4c4":61229,"1f4c5":61269,"1f4c6":61270,"1f4c7":61273,"1f4c8":61274,"1f4c9":61275,"1f4ca":61276,"1f4cb":61277,"1f4cc":61278,"1f4cd":61279,"1f4ce":61280,"1f4cf":61282,"1f4d0":61283,"1f4d1":61232,"1f4d2":61226,"1f4d3":61225,"1f4d4":61218,"1f4d5":61219,"1f4d6":61220,"1f4d7":61221,"1f4d8":61222,"1f4d9":61223,"1f4da":61224,"1f4db":62847,"1f4dc":61228,"1f4dd":61264,"1f4de":61185,"1f4df":61186,"1f4e0":61187,"1f4e1":61325,"1f4e2":61159,"1f4e3":61160,"1f4e4":61249,"1f4e5":61250,"1f4e6":61251,"1f4e7":61246,"1f4e8":61247,"1f4e9":61248,"1f4ea":61253,"1f4eb":61252,"1f4ec":61254,"1f4ed":61255,"1f4ee":61256,"1f4ef":61161,"1f4f0":61230,"1f4f1":61182,"1f4f2":61183,"1f4f3":62823,"1f4f4":62824,"1f4f5":62751,"1f4f6":62822,"1f4f7":61207,"1f4f8":61208,"1f4f9":61209,"1f4fa":61206,"1f4fb":61172,"1f4fc":61210,"1f4fd":61204,"1f4ff":61151,"1f500":62801,"1f501":62802,"1f502":62803,"1f503":62769,"1f504":62770,"1f505":62820,"1f506":62821,"1f507":61155,"1f508":61156,"1f509":61157,"1f50a":61158,"1f50b":61188,"1f50c":61190,"1f50d":61211,"1f50e":61212,"1f50f":61290,"1f510":61291,"1f511":61292,"1f512":61288,"1f513":61289,"1f514":61162,"1f515":61163,"1f516":61233,"1f517":61313,"1f518":62947,"1f519":62771,"1f51a":62772,"1f51b":62773,"1f51c":62774,"1f51d":62775,"1f51e":62752,"1f51f":62876,"1f520":62877,"1f521":62878,"1f522":62879,"1f523":62880,"1f524":62881,"1f525":41021,"1f526":61215,"1f527":61306,"1f528":61294,"1f529":61308,"1f52a":3803,"1f52b":61301,"1f52c":61323,"1f52d":61324,"1f52e":51082,"1f52f":62787,"1f530":62848,"1f531":62846,"1f532":62949,"1f533":62948,"1f534":62916,"1f535":62920,"1f536":62940,"1f537":62941,"1f538":62942,"1f539":62943,"1f53a":62944,"1f53b":62945,"1f53c":62811,"1f53d":62813,"1f549":62778,"1f54a":2602,"1f54b":4854,"1f54c":4850,"1f54d":4852,"1f54e":62786,"1f550":4955,"1f551":4957,"1f552":4959,"1f553":4961,"1f554":4963,"1f555":4965,"1f556":4967,"1f557":4969,"1f558":4971,"1f559":4973,"1f55a":4975,"1f55b":4953,"1f55c":4956,"1f55d":4958,"1f55e":4960,"1f55f":4962,"1f560":4964,"1f561":4966,"1f562":4968,"1f563":4970,"1f564":4972,"1f565":4974,"1f566":4976,"1f567":4954,"1f56f":61213,"1f570":4952,"1f573":1156,"1f574":1587,"1f575-200d-2640":1497,"1f575-200d-2642":1496,"1f575":1495,"1f576":61111,"1f577":2641,"1f578":2642,"1f579":51087,"1f57a":1586,"1f587":61281,"1f58a":61261,"1f58b":61260,"1f58c":61262,"1f58d":61263,"1f590":1329,"1f595":1348,"1f596":1331,"1f5a4":1148,"1f5a5":61192,"1f5a8":61193,"1f5b1":61195,"1f5b2":61196,"1f5bc":51104,"1f5c2":61268,"1f5c3":61285,"1f5c4":61286,"1f5d1":61287,"1f5d2":61271,"1f5d3":61272,"1f5dc":61310,"1f5dd":61293,"1f5de":61231,"1f5e1":61299,"1f5e3":1683,"1f5e8":1160,"1f5ef":1161,"1f5f3":61257,"1f5fa":4810,"1f5fb":4816,"1f5fc":4847,"1f5fd":4848,"1f5fe":4811,"1f5ff":61362,"1f600":11,"1f601":14,"1f602":18,"1f603":12,"1f604":13,"1f605":16,"1f606":15,"1f607":114,"1f608":1103,"1f609":112,"1f60a":113,"1f60b":124,"1f60c":150,"1f60d":116,"1f60e":170,"1f60f":144,"1f610":139,"1f611":140,"1f612":145,"1f613":195,"1f614":151,"1f615":173,"1f616":192,"1f617":119,"1f618":118,"1f619":122,"1f61a":121,"1f61b":125,"1f61c":126,"1f61d":128,"1f61e":194,"1f61f":175,"1f620":1101,"1f621":1100,"1f622":189,"1f623":193,"1f624":199,"1f625":188,"1f626":184,"1f627":185,"1f628":186,"1f629":196,"1f62a":152,"1f62b":197,"1f62c":147,"1f62d":190,"1f62e-200d-1f4a8":148,"1f62e":178,"1f62f":179,"1f630":187,"1f631":191,"1f632":180,"1f633":181,"1f634":154,"1f635-200d-1f4ab":165,"1f635":164,"1f636-200d-1f32b":143,"1f636":141,"1f637":155,"1f638":1116,"1f639":1117,"1f63a":1115,"1f63b":1118,"1f63c":1119,"1f63d":1120,"1f63e":1123,"1f63f":1122,"1f640":1121,"1f641":176,"1f642":19,"1f643":110,"1f644":146,"1f645-200d-2640":1422,"1f645-200d-2642":1421,"1f645":1420,"1f646-200d-2640":1425,"1f646-200d-2642":1424,"1f646":1423,"1f647-200d-2640":1437,"1f647-200d-2642":1436,"1f647":1435,"1f648":1124,"1f649":1125,"1f64a":1126,"1f64b-200d-2640":1431,"1f64b-200d-2642":1430,"1f64b":1429,"1f64c":1359,"1f64d-200d-2640":1416,"1f64d-200d-2642":1415,"1f64d":1414,"1f64e-200d-2640":1419,"1f64e-200d-2642":1418,"1f64e":1417,"1f64f":1364,"1f680":4942,"1f681":4937,"1f682":4872,"1f683":4873,"1f684":4874,"1f685":4875,"1f686":4876,"1f687":4877,"1f688":4878,"1f689":4879,"1f68a":4880,"1f68b":4883,"1f68c":4884,"1f68d":4885,"1f68e":4886,"1f68f":4911,"1f690":4887,"1f691":4888,"1f692":4889,"1f693":4890,"1f694":4891,"1f695":4892,"1f696":4893,"1f697":4894,"1f698":4895,"1f699":4896,"1f69a":4898,"1f69b":4899,"1f69c":4900,"1f69d":4881,"1f69e":4882,"1f69f":4938,"1f6a0":4939,"1f6a1":4940,"1f6a2":4930,"1f6a3-200d-2640":1609,"1f6a3-200d-2642":1608,"1f6a3":1607,"1f6a4":4926,"1f6a5":4918,"1f6a6":4919,"1f6a7":4921,"1f6a8":4917,"1f6a9":71587,"1f6aa":61333,"1f6ab":62745,"1f6ac":61358,"1f6ad":62747,"1f6ae":62730,"1f6af":62748,"1f6b0":62731,"1f6b1":62749,"1f6b2":4907,"1f6b3":62746,"1f6b4-200d-2640":1621,"1f6b4-200d-2642":1620,"1f6b4":1619,"1f6b5-200d-2640":1624,"1f6b5-200d-2642":1623,"1f6b5":1622,"1f6b6-200d-2640":1566,"1f6b6-200d-2642":1565,"1f6b6":1564,"1f6b7":62750,"1f6b8":62743,"1f6b9":62733,"1f6ba":62734,"1f6bb":62735,"1f6bc":62736,"1f6bd":61340,"1f6be":62737,"1f6bf":61342,"1f6c0":1643,"1f6c1":61343,"1f6c2":62738,"1f6c3":62739,"1f6c4":62740,"1f6c5":62741,"1f6cb":61338,"1f6cc":1644,"1f6cd":61133,"1f6ce":4944,"1f6cf":61337,"1f6d0":62776,"1f6d1":4920,"1f6d2":61357,"1f6d5":4851,"1f6d6":4828,"1f6d7":61334,"1f6e0":61298,"1f6e1":61304,"1f6e2":4914,"1f6e3":4912,"1f6e4":4913,"1f6e5":4929,"1f6e9":4932,"1f6eb":4933,"1f6ec":4934,"1f6f0":4941,"1f6f3":4927,"1f6f4":4908,"1f6f5":4903,"1f6f6":4925,"1f6f7":51076,"1f6f8":4943,"1f6f9":4909,"1f6fa":4906,"1f6fb":4897,"1f6fc":4910,"1f7e0":62917,"1f7e1":62918,"1f7e2":62919,"1f7e3":62921,"1f7e4":62922,"1f7e5":62925,"1f7e6":62929,"1f7e7":62926,"1f7e8":62927,"1f7e9":62928,"1f7ea":62930,"1f7eb":62931,"1f90c":1337,"1f90d":1149,"1f90e":1147,"1f90f":1338,"1f910":137,"1f911":129,"1f912":156,"1f913":171,"1f914":135,"1f915":157,"1f916":1114,"1f917":130,"1f918":1343,"1f919":1344,"1f91a":1328,"1f91b":1356,"1f91c":1357,"1f91d":1363,"1f91e":1340,"1f91f":1342,"1f920":167,"1f921":1108,"1f922":158,"1f923":17,"1f924":153,"1f925":149,"1f926-200d-2640":1440,"1f926-200d-2642":1439,"1f926":1438,"1f927":160,"1f928":138,"1f929":117,"1f92a":127,"1f92b":134,"1f92c":1102,"1f92d":131,"1f92e":159,"1f92f":166,"1f930":1519,"1f931":1522,"1f932":1362,"1f933":1367,"1f934":1506,"1f935-200d-2640":1515,"1f935-200d-2642":1514,"1f935":1513,"1f936":1528,"1f937-200d-2640":1443,"1f937-200d-2642":1442,"1f937":1441,"1f938-200d-2640":1627,"1f938-200d-2642":1626,"1f938":1625,"1f939-200d-2640":1639,"1f939-200d-2642":1638,"1f939":1637,"1f93a":1597,"1f93c-200d-2640":1630,"1f93c-200d-2642":1629,"1f93c":1628,"1f93d-200d-2640":1633,"1f93d-200d-2642":1632,"1f93d":1631,"1f93e-200d-2640":1636,"1f93e-200d-2642":1635,"1f93e":1634,"1f93f":51073,"1f940":2654,"1f941":61180,"1f942":3791,"1f943":3792,"1f944":3802,"1f945":51069,"1f947":51048,"1f948":51049,"1f949":51050,"1f94a":51067,"1f94b":51068,"1f94c":51077,"1f94d":51064,"1f94e":51053,"1f94f":51059,"1f950":3710,"1f951":3693,"1f952":3700,"1f953":3721,"1f954":3695,"1f955":3696,"1f956":3711,"1f957":3738,"1f958":3734,"1f959":3730,"1f95a":3732,"1f95b":3780,"1f95c":3706,"1f95d":3689,"1f95e":3715,"1f95f":3757,"1f960":3758,"1f961":3759,"1f962":3799,"1f963":3737,"1f964":3794,"1f965":3692,"1f966":3702,"1f967":3773,"1f968":3713,"1f969":3720,"1f96a":3726,"1f96b":3742,"1f96c":3701,"1f96d":3681,"1f96e":3755,"1f96f":3714,"1f970":115,"1f971":198,"1f972":123,"1f973":168,"1f974":163,"1f975":161,"1f976":162,"1f977":1501,"1f978":169,"1f97a":182,"1f97b":61124,"1f97c":61113,"1f97d":61112,"1f97e":61138,"1f97f":61139,"1f980":3760,"1f981":2545,"1f982":2643,"1f983":2594,"1f984":2551,"1f985":2603,"1f986":2604,"1f987":2583,"1f988":2628,"1f989":2606,"1f98a":2540,"1f98b":2633,"1f98c":2553,"1f98d":2532,"1f98e":2615,"1f98f":2572,"1f990":3762,"1f991":3763,"1f992":2569,"1f993":2552,"1f994":2582,"1f995":2619,"1f996":2620,"1f997":2639,"1f998":2591,"1f999":2568,"1f99a":2610,"1f99b":2573,"1f99c":2611,"1f99d":2541,"1f99e":3761,"1f99f":2644,"1f9a0":2647,"1f9a1":2592,"1f9a2":2605,"1f9a3":2571,"1f9a4":2607,"1f9a5":2588,"1f9a6":2589,"1f9a7":2533,"1f9a8":2590,"1f9a9":2609,"1f9aa":3764,"1f9ab":2581,"1f9ac":2554,"1f9ad":2624,"1f9ae":2536,"1f9af":61312,"1f9b4":1380,"1f9b5":1371,"1f9b6":1372,"1f9b7":1379,"1f9b8-200d-2640":1532,"1f9b8-200d-2642":1531,"1f9b8":1530,"1f9b9-200d-2640":1535,"1f9b9-200d-2642":1534,"1f9b9":1533,"1f9ba":61114,"1f9bb":1374,"1f9bc":4905,"1f9bd":4904,"1f9be":1369,"1f9bf":1370,"1f9c0":3717,"1f9c1":3772,"1f9c2":3741,"1f9c3":3796,"1f9c4":3703,"1f9c5":3704,"1f9c6":3731,"1f9c7":3716,"1f9c8":3740,"1f9c9":3797,"1f9ca":3798,"1f9cb":3795,"1f9cd-200d-2640":1569,"1f9cd-200d-2642":1568,"1f9cd":1567,"1f9ce-200d-2640":1572,"1f9ce-200d-2642":1571,"1f9ce":1570,"1f9cf-200d-2640":1434,"1f9cf-200d-2642":1433,"1f9cf":1432,"1f9d0":172,"1f9d1-200d-1f33e":1456,"1f9d1-200d-1f373":1459,"1f9d1-200d-1f37c":1525,"1f9d1-200d-1f384":1529,"1f9d1-200d-1f393":1447,"1f9d1-200d-1f3a4":1477,"1f9d1-200d-1f3a8":1480,"1f9d1-200d-1f3eb":1450,"1f9d1-200d-1f3ed":1465,"1f9d1-200d-1f4bb":1474,"1f9d1-200d-1f4bc":1468,"1f9d1-200d-1f527":1462,"1f9d1-200d-1f52c":1471,"1f9d1-200d-1f680":1486,"1f9d1-200d-1f692":1489,"1f9d1-200d-1f91d-200d-1f9d1":1645,"1f9d1-200d-1f9af":1573,"1f9d1-200d-1f9b0":1402,"1f9d1-200d-1f9b1":1404,"1f9d1-200d-1f9b2":1408,"1f9d1-200d-1f9b3":1406,"1f9d1-200d-1f9bc":1576,"1f9d1-200d-1f9bd":1579,"1f9d1-200d-2695":1444,"1f9d1-200d-2696":1453,"1f9d1-200d-2708":1483,"1f9d1":1390,"1f9d2":1387,"1f9d3":1411,"1f9d4-200d-2640":1395,"1f9d4-200d-2642":1394,"1f9d4":1393,"1f9d5":1512,"1f9d6-200d-2640":1593,"1f9d6-200d-2642":1592,"1f9d6":1591,"1f9d7-200d-2640":1596,"1f9d7-200d-2642":1595,"1f9d7":1594,"1f9d8-200d-2640":1642,"1f9d8-200d-2642":1641,"1f9d8":1640,"1f9d9-200d-2640":1538,"1f9d9-200d-2642":1537,"1f9d9":1536,"1f9da-200d-2640":1541,"1f9da-200d-2642":1540,"1f9da":1539,"1f9db-200d-2640":1544,"1f9db-200d-2642":1543,"1f9db":1542,"1f9dc-200d-2640":1547,"1f9dc-200d-2642":1546,"1f9dc":1545,"1f9dd-200d-2640":1550,"1f9dd-200d-2642":1549,"1f9dd":1548,"1f9de-200d-2640":1553,"1f9de-200d-2642":1552,"1f9de":1551,"1f9df-200d-2640":1556,"1f9df-200d-2642":1555,"1f9df":1554,"1f9e0":1376,"1f9e1":1142,"1f9e2":61148,"1f9e3":61118,"1f9e4":61119,"1f9e5":61120,"1f9e6":61121,"1f9e7":51039,"1f9e8":51028,"1f9e9":51090,"1f9ea":61320,"1f9eb":61321,"1f9ec":61322,"1f9ed":4812,"1f9ee":61201,"1f9ef":61356,"1f9f0":61316,"1f9f1":4825,"1f9f2":61317,"1f9f3":4945,"1f9f4":61346,"1f9f5":51106,"1f9f6":51108,"1f9f7":61347,"1f9f8":51091,"1f9f9":61348,"1f9fa":61349,"1f9fb":61350,"1f9fc":61352,"1f9fd":61355,"1f9fe":61243,"1f9ff":51084,"1fa70":61142,"1fa71":61125,"1fa72":61126,"1fa73":61127,"1fa74":61135,"1fa78":61327,"1fa79":61329,"1fa7a":61331,"1fa80":51079,"1fa81":51080,"1fa82":4935,"1fa83":61302,"1fa84":51083,"1fa85":51092,"1fa86":51094,"1fa90":4993,"1fa91":61339,"1fa92":61345,"1fa93":61295,"1fa94":61217,"1fa95":61179,"1fa96":61149,"1fa97":61174,"1fa98":61181,"1fa99":61236,"1fa9a":61305,"1fa9b":61307,"1fa9c":61318,"1fa9d":61315,"1fa9e":61335,"1fa9f":61336,"1faa0":61341,"1faa1":51107,"1faa2":51109,"1faa3":61351,"1faa4":61344,"1faa5":61354,"1faa6":61360,"1faa7":61363,"1faa8":4826,"1fab0":2645,"1fab1":2646,"1fab2":2637,"1fab3":2640,"1fab4":2660,"1fab5":4827,"1fab6":2608,"1fac0":1377,"1fac1":1378,"1fac2":1686,"1fad0":3688,"1fad1":3699,"1fad2":3691,"1fad3":3712,"1fad4":3729,"1fad5":3736,"1fad6":3782,"203c":62834,"21a9":62765,"21aa":62766,"231a":4948,"231b":4946,"23cf":62818,"23e9":62805,"23ea":62809,"23eb":62812,"23ec":62814,"23ed":62806,"23ee":62810,"23ef":62807,"23f0":4949,"23f1":4950,"23f2":4951,"23f3":4947,"23f8":62815,"23f9":62816,"23fa":62817,"24c2":62890,"25aa":62938,"25ab":62939,"25b6":62804,"25c0":62808,"25fb":62935,"25fc":62934,"25fd":62937,"25fe":62936,"260e":61184,"261d":1350,"262a":62784,"262e":62785,"262f":62781,"263a":120,"264a":62790,"264b":62791,"264c":62792,"264d":62793,"264e":62794,"264f":62795,"265f":51099,"267b":62844,"267e":62833,"267f":62732,"269b":62777,"269c":62845,"26a0":62742,"26a1":41016,"26a7":62827,"26aa":62924,"26ab":62923,"26b0":61359,"26b1":61361,"26bd":51051,"26be":51052,"26c4":41019,"26c5":4999,"26c8":41e3,"26ce":62800,"26cf":61296,"26d1":61150,"26d3":61314,"26d4":62744,"26e9":4853,"26ea":4849,"26f0":4814,"26f1":41015,"26f2":4855,"26f3":51070,"26f4":4928,"26f5":4924,"26f7":1599,"26f8":51071,"26f9-200d-2640":1615,"26f9-200d-2642":1614,"26f9":1613,"26fa":4856,"26fd":4915,"270a":1354,"270b":1330,"270c":1339,"270d":1365,"270f":61258,"271d":62782,"274c":62853,"274e":62854,"2764-200d-1f525":1139,"2764-200d-1fa79":1140,"27a1":62757,"27b0":62855,"27bf":62856,"2b05":62761,"2b06":62755,"2b07":62759,"2b1b":62932,"2b1c":62933,"2b50":4994,"2b55":62849,"303d":62857,"1f385-1f3fb":0,"1f385-1f3fc":0,"1f385-1f3fd":0,"1f385-1f3fe":0,"1f385-1f3ff":0,"1f3c2-1f3fb":0,"1f3c2-1f3fc":0,"1f3c2-1f3fd":0,"1f3c2-1f3fe":0,"1f3c2-1f3ff":0,"1f3c3-1f3fb-200d-2640":0,"1f3c3-1f3fc-200d-2640":0,"1f3c3-1f3fd-200d-2640":0,"1f3c3-1f3fe-200d-2640":0,"1f3c3-1f3ff-200d-2640":0,"1f3c3-1f3fb-200d-2642":0,"1f3c3-1f3fc-200d-2642":0,"1f3c3-1f3fd-200d-2642":0,"1f3c3-1f3fe-200d-2642":0,"1f3c3-1f3ff-200d-2642":0,"1f3c3-1f3fb":0,"1f3c3-1f3fc":0,"1f3c3-1f3fd":0,"1f3c3-1f3fe":0,"1f3c3-1f3ff":0,"1f3c4-1f3fb-200d-2640":0,"1f3c4-1f3fc-200d-2640":0,"1f3c4-1f3fd-200d-2640":0,"1f3c4-1f3fe-200d-2640":0,"1f3c4-1f3ff-200d-2640":0,"1f3c4-1f3fb-200d-2642":0,"1f3c4-1f3fc-200d-2642":0,"1f3c4-1f3fd-200d-2642":0,"1f3c4-1f3fe-200d-2642":0,"1f3c4-1f3ff-200d-2642":0,"1f3c4-1f3fb":0,"1f3c4-1f3fc":0,"1f3c4-1f3fd":0,"1f3c4-1f3fe":0,"1f3c4-1f3ff":0,"1f3c7-1f3fb":0,"1f3c7-1f3fc":0,"1f3c7-1f3fd":0,"1f3c7-1f3fe":0,"1f3c7-1f3ff":0,"1f3ca-1f3fb-200d-2640":0,"1f3ca-1f3fc-200d-2640":0,"1f3ca-1f3fd-200d-2640":0,"1f3ca-1f3fe-200d-2640":0,"1f3ca-1f3ff-200d-2640":0,"1f3ca-1f3fb-200d-2642":0,"1f3ca-1f3fc-200d-2642":0,"1f3ca-1f3fd-200d-2642":0,"1f3ca-1f3fe-200d-2642":0,"1f3ca-1f3ff-200d-2642":0,"1f3ca-1f3fb":0,"1f3ca-1f3fc":0,"1f3ca-1f3fd":0,"1f3ca-1f3fe":0,"1f3ca-1f3ff":0,"1f3cb-1f3fb-200d-2640":0,"1f3cb-1f3fc-200d-2640":0,"1f3cb-1f3fd-200d-2640":0,"1f3cb-1f3fe-200d-2640":0,"1f3cb-1f3ff-200d-2640":0,"1f3cb-1f3fb-200d-2642":0,"1f3cb-1f3fc-200d-2642":0,"1f3cb-1f3fd-200d-2642":0,"1f3cb-1f3fe-200d-2642":0,"1f3cb-1f3ff-200d-2642":0,"1f3cb-1f3fb":0,"1f3cb-1f3fc":0,"1f3cb-1f3fd":0,"1f3cb-1f3fe":0,"1f3cb-1f3ff":0,"1f3cc-1f3fb-200d-2640":0,"1f3cc-1f3fc-200d-2640":0,"1f3cc-1f3fd-200d-2640":0,"1f3cc-1f3fe-200d-2640":0,"1f3cc-1f3ff-200d-2640":0,"1f3cc-1f3fb-200d-2642":0,"1f3cc-1f3fc-200d-2642":0,"1f3cc-1f3fd-200d-2642":0,"1f3cc-1f3fe-200d-2642":0,"1f3cc-1f3ff-200d-2642":0,"1f3cc-1f3fb":0,"1f3cc-1f3fc":0,"1f3cc-1f3fd":0,"1f3cc-1f3fe":0,"1f3cc-1f3ff":0,"1f442-1f3fb":0,"1f442-1f3fc":0,"1f442-1f3fd":0,"1f442-1f3fe":0,"1f442-1f3ff":0,"1f443-1f3fb":0,"1f443-1f3fc":0,"1f443-1f3fd":0,"1f443-1f3fe":0,"1f443-1f3ff":0,"1f446-1f3fb":0,"1f446-1f3fc":0,"1f446-1f3fd":0,"1f446-1f3fe":0,"1f446-1f3ff":0,"1f447-1f3fb":0,"1f447-1f3fc":0,"1f447-1f3fd":0,"1f447-1f3fe":0,"1f447-1f3ff":0,"1f448-1f3fb":0,"1f448-1f3fc":0,"1f448-1f3fd":0,"1f448-1f3fe":0,"1f448-1f3ff":0,"1f449-1f3fb":0,"1f449-1f3fc":0,"1f449-1f3fd":0,"1f449-1f3fe":0,"1f449-1f3ff":0,"1f44a-1f3fb":0,"1f44a-1f3fc":0,"1f44a-1f3fd":0,"1f44a-1f3fe":0,"1f44a-1f3ff":0,"1f44b-1f3fb":0,"1f44b-1f3fc":0,"1f44b-1f3fd":0,"1f44b-1f3fe":0,"1f44b-1f3ff":0,"1f44c-1f3fb":0,"1f44c-1f3fc":0,"1f44c-1f3fd":0,"1f44c-1f3fe":0,"1f44c-1f3ff":0,"1f44d-1f3fb":0,"1f44d-1f3fc":0,"1f44d-1f3fd":0,"1f44d-1f3fe":0,"1f44d-1f3ff":0,"1f44e-1f3fb":0,"1f44e-1f3fc":0,"1f44e-1f3fd":0,"1f44e-1f3fe":0,"1f44e-1f3ff":0,"1f44f-1f3fb":0,"1f44f-1f3fc":0,"1f44f-1f3fd":0,"1f44f-1f3fe":0,"1f44f-1f3ff":0,"1f450-1f3fb":0,"1f450-1f3fc":0,"1f450-1f3fd":0,"1f450-1f3fe":0,"1f450-1f3ff":0,"1f466-1f3fb":0,"1f466-1f3fc":0,"1f466-1f3fd":0,"1f466-1f3fe":0,"1f466-1f3ff":0,"1f467-1f3fb":0,"1f467-1f3fc":0,"1f467-1f3fd":0,"1f467-1f3fe":0,"1f467-1f3ff":0,"1f468-1f3fb-200d-1f33e":0,"1f468-1f3fc-200d-1f33e":0,"1f468-1f3fd-200d-1f33e":0,"1f468-1f3fe-200d-1f33e":0,"1f468-1f3ff-200d-1f33e":0,"1f468-1f3fb-200d-1f373":0,"1f468-1f3fc-200d-1f373":0,"1f468-1f3fd-200d-1f373":0,"1f468-1f3fe-200d-1f373":0,"1f468-1f3ff-200d-1f373":0,"1f468-1f3fb-200d-1f37c":0,"1f468-1f3fc-200d-1f37c":0,"1f468-1f3fd-200d-1f37c":0,"1f468-1f3fe-200d-1f37c":0,"1f468-1f3ff-200d-1f37c":0,"1f468-1f3fb-200d-1f393":0,"1f468-1f3fc-200d-1f393":0,"1f468-1f3fd-200d-1f393":0,"1f468-1f3fe-200d-1f393":0,"1f468-1f3ff-200d-1f393":0,"1f468-1f3fb-200d-1f3a4":0,"1f468-1f3fc-200d-1f3a4":0,"1f468-1f3fd-200d-1f3a4":0,"1f468-1f3fe-200d-1f3a4":0,"1f468-1f3ff-200d-1f3a4":0,"1f468-1f3fb-200d-1f3a8":0,"1f468-1f3fc-200d-1f3a8":0,"1f468-1f3fd-200d-1f3a8":0,"1f468-1f3fe-200d-1f3a8":0,"1f468-1f3ff-200d-1f3a8":0,"1f468-1f3fb-200d-1f3eb":0,"1f468-1f3fc-200d-1f3eb":0,"1f468-1f3fd-200d-1f3eb":0,"1f468-1f3fe-200d-1f3eb":0,"1f468-1f3ff-200d-1f3eb":0,"1f468-1f3fb-200d-1f3ed":0,"1f468-1f3fc-200d-1f3ed":0,"1f468-1f3fd-200d-1f3ed":0,"1f468-1f3fe-200d-1f3ed":0,"1f468-1f3ff-200d-1f3ed":0,"1f468-1f3fb-200d-1f4bb":0,"1f468-1f3fc-200d-1f4bb":0,"1f468-1f3fd-200d-1f4bb":0,"1f468-1f3fe-200d-1f4bb":0,"1f468-1f3ff-200d-1f4bb":0,"1f468-1f3fb-200d-1f4bc":0,"1f468-1f3fc-200d-1f4bc":0,"1f468-1f3fd-200d-1f4bc":0,"1f468-1f3fe-200d-1f4bc":0,"1f468-1f3ff-200d-1f4bc":0,"1f468-1f3fb-200d-1f527":0,"1f468-1f3fc-200d-1f527":0,"1f468-1f3fd-200d-1f527":0,"1f468-1f3fe-200d-1f527":0,"1f468-1f3ff-200d-1f527":0,"1f468-1f3fb-200d-1f52c":0,"1f468-1f3fc-200d-1f52c":0,"1f468-1f3fd-200d-1f52c":0,"1f468-1f3fe-200d-1f52c":0,"1f468-1f3ff-200d-1f52c":0,"1f468-1f3fb-200d-1f680":0,"1f468-1f3fc-200d-1f680":0,"1f468-1f3fd-200d-1f680":0,"1f468-1f3fe-200d-1f680":0,"1f468-1f3ff-200d-1f680":0,"1f468-1f3fb-200d-1f692":0,"1f468-1f3fc-200d-1f692":0,"1f468-1f3fd-200d-1f692":0,"1f468-1f3fe-200d-1f692":0,"1f468-1f3ff-200d-1f692":0,"1f468-1f3fb-200d-1f9af":0,"1f468-1f3fc-200d-1f9af":0,"1f468-1f3fd-200d-1f9af":0,"1f468-1f3fe-200d-1f9af":0,"1f468-1f3ff-200d-1f9af":0,"1f468-1f3fb-200d-1f9b0":0,"1f468-1f3fc-200d-1f9b0":0,"1f468-1f3fd-200d-1f9b0":0,"1f468-1f3fe-200d-1f9b0":0,"1f468-1f3ff-200d-1f9b0":0,"1f468-1f3fb-200d-1f9b1":0,"1f468-1f3fc-200d-1f9b1":0,"1f468-1f3fd-200d-1f9b1":0,"1f468-1f3fe-200d-1f9b1":0,"1f468-1f3ff-200d-1f9b1":0,"1f468-1f3fb-200d-1f9b2":0,"1f468-1f3fc-200d-1f9b2":0,"1f468-1f3fd-200d-1f9b2":0,"1f468-1f3fe-200d-1f9b2":0,"1f468-1f3ff-200d-1f9b2":0,"1f468-1f3fb-200d-1f9b3":0,"1f468-1f3fc-200d-1f9b3":0,"1f468-1f3fd-200d-1f9b3":0,"1f468-1f3fe-200d-1f9b3":0,"1f468-1f3ff-200d-1f9b3":0,"1f468-1f3fb-200d-1f9bc":0,"1f468-1f3fc-200d-1f9bc":0,"1f468-1f3fd-200d-1f9bc":0,"1f468-1f3fe-200d-1f9bc":0,"1f468-1f3ff-200d-1f9bc":0,"1f468-1f3fb-200d-1f9bd":0,"1f468-1f3fc-200d-1f9bd":0,"1f468-1f3fd-200d-1f9bd":0,"1f468-1f3fe-200d-1f9bd":0,"1f468-1f3ff-200d-1f9bd":0,"1f468-1f3fb-200d-2695":0,"1f468-1f3fc-200d-2695":0,"1f468-1f3fd-200d-2695":0,"1f468-1f3fe-200d-2695":0,"1f468-1f3ff-200d-2695":0,"1f468-1f3fb-200d-2696":0,"1f468-1f3fc-200d-2696":0,"1f468-1f3fd-200d-2696":0,"1f468-1f3fe-200d-2696":0,"1f468-1f3ff-200d-2696":0,"1f468-1f3fb-200d-2708":0,"1f468-1f3fc-200d-2708":0,"1f468-1f3fd-200d-2708":0,"1f468-1f3fe-200d-2708":0,"1f468-1f3ff-200d-2708":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fb":0,"1f468-1f3fc":0,"1f468-1f3fd":0,"1f468-1f3fe":0,"1f468-1f3ff":0,"1f469-1f3fb-200d-1f33e":0,"1f469-1f3fc-200d-1f33e":0,"1f469-1f3fd-200d-1f33e":0,"1f469-1f3fe-200d-1f33e":0,"1f469-1f3ff-200d-1f33e":0,"1f469-1f3fb-200d-1f373":0,"1f469-1f3fc-200d-1f373":0,"1f469-1f3fd-200d-1f373":0,"1f469-1f3fe-200d-1f373":0,"1f469-1f3ff-200d-1f373":0,"1f469-1f3fb-200d-1f37c":0,"1f469-1f3fc-200d-1f37c":0,"1f469-1f3fd-200d-1f37c":0,"1f469-1f3fe-200d-1f37c":0,"1f469-1f3ff-200d-1f37c":0,"1f469-1f3fb-200d-1f393":0,"1f469-1f3fc-200d-1f393":0,"1f469-1f3fd-200d-1f393":0,"1f469-1f3fe-200d-1f393":0,"1f469-1f3ff-200d-1f393":0,"1f469-1f3fb-200d-1f3a4":0,"1f469-1f3fc-200d-1f3a4":0,"1f469-1f3fd-200d-1f3a4":0,"1f469-1f3fe-200d-1f3a4":0,"1f469-1f3ff-200d-1f3a4":0,"1f469-1f3fb-200d-1f3a8":0,"1f469-1f3fc-200d-1f3a8":0,"1f469-1f3fd-200d-1f3a8":0,"1f469-1f3fe-200d-1f3a8":0,"1f469-1f3ff-200d-1f3a8":0,"1f469-1f3fb-200d-1f3eb":0,"1f469-1f3fc-200d-1f3eb":0,"1f469-1f3fd-200d-1f3eb":0,"1f469-1f3fe-200d-1f3eb":0,"1f469-1f3ff-200d-1f3eb":0,"1f469-1f3fb-200d-1f3ed":0,"1f469-1f3fc-200d-1f3ed":0,"1f469-1f3fd-200d-1f3ed":0,"1f469-1f3fe-200d-1f3ed":0,"1f469-1f3ff-200d-1f3ed":0,"1f469-1f3fb-200d-1f4bb":0,"1f469-1f3fc-200d-1f4bb":0,"1f469-1f3fd-200d-1f4bb":0,"1f469-1f3fe-200d-1f4bb":0,"1f469-1f3ff-200d-1f4bb":0,"1f469-1f3fb-200d-1f4bc":0,"1f469-1f3fc-200d-1f4bc":0,"1f469-1f3fd-200d-1f4bc":0,"1f469-1f3fe-200d-1f4bc":0,"1f469-1f3ff-200d-1f4bc":0,"1f469-1f3fb-200d-1f527":0,"1f469-1f3fc-200d-1f527":0,"1f469-1f3fd-200d-1f527":0,"1f469-1f3fe-200d-1f527":0,"1f469-1f3ff-200d-1f527":0,"1f469-1f3fb-200d-1f52c":0,"1f469-1f3fc-200d-1f52c":0,"1f469-1f3fd-200d-1f52c":0,"1f469-1f3fe-200d-1f52c":0,"1f469-1f3ff-200d-1f52c":0,"1f469-1f3fb-200d-1f680":0,"1f469-1f3fc-200d-1f680":0,"1f469-1f3fd-200d-1f680":0,"1f469-1f3fe-200d-1f680":0,"1f469-1f3ff-200d-1f680":0,"1f469-1f3fb-200d-1f692":0,"1f469-1f3fc-200d-1f692":0,"1f469-1f3fd-200d-1f692":0,"1f469-1f3fe-200d-1f692":0,"1f469-1f3ff-200d-1f692":0,"1f469-1f3fb-200d-1f9af":0,"1f469-1f3fc-200d-1f9af":0,"1f469-1f3fd-200d-1f9af":0,"1f469-1f3fe-200d-1f9af":0,"1f469-1f3ff-200d-1f9af":0,"1f469-1f3fb-200d-1f9b0":0,"1f469-1f3fc-200d-1f9b0":0,"1f469-1f3fd-200d-1f9b0":0,"1f469-1f3fe-200d-1f9b0":0,"1f469-1f3ff-200d-1f9b0":0,"1f469-1f3fb-200d-1f9b1":0,"1f469-1f3fc-200d-1f9b1":0,"1f469-1f3fd-200d-1f9b1":0,"1f469-1f3fe-200d-1f9b1":0,"1f469-1f3ff-200d-1f9b1":0,"1f469-1f3fb-200d-1f9b2":0,"1f469-1f3fc-200d-1f9b2":0,"1f469-1f3fd-200d-1f9b2":0,"1f469-1f3fe-200d-1f9b2":0,"1f469-1f3ff-200d-1f9b2":0,"1f469-1f3fb-200d-1f9b3":0,"1f469-1f3fc-200d-1f9b3":0,"1f469-1f3fd-200d-1f9b3":0,"1f469-1f3fe-200d-1f9b3":0,"1f469-1f3ff-200d-1f9b3":0,"1f469-1f3fb-200d-1f9bc":0,"1f469-1f3fc-200d-1f9bc":0,"1f469-1f3fd-200d-1f9bc":0,"1f469-1f3fe-200d-1f9bc":0,"1f469-1f3ff-200d-1f9bc":0,"1f469-1f3fb-200d-1f9bd":0,"1f469-1f3fc-200d-1f9bd":0,"1f469-1f3fd-200d-1f9bd":0,"1f469-1f3fe-200d-1f9bd":0,"1f469-1f3ff-200d-1f9bd":0,"1f469-1f3fb-200d-2695":0,"1f469-1f3fc-200d-2695":0,"1f469-1f3fd-200d-2695":0,"1f469-1f3fe-200d-2695":0,"1f469-1f3ff-200d-2695":0,"1f469-1f3fb-200d-2696":0,"1f469-1f3fc-200d-2696":0,"1f469-1f3fd-200d-2696":0,"1f469-1f3fe-200d-2696":0,"1f469-1f3ff-200d-2696":0,"1f469-1f3fb-200d-2708":0,"1f469-1f3fc-200d-2708":0,"1f469-1f3fd-200d-2708":0,"1f469-1f3fe-200d-2708":0,"1f469-1f3ff-200d-2708":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fb":0,"1f469-1f3fc":0,"1f469-1f3fd":0,"1f469-1f3fe":0,"1f469-1f3ff":0,"1f46b-1f3fb":0,"1f46b-1f3fc":0,"1f46b-1f3fd":0,"1f46b-1f3fe":0,"1f46b-1f3ff":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3fe":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3fe":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3fe":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fe":0,"1f46c-1f3fb":0,"1f46c-1f3fc":0,"1f46c-1f3fd":0,"1f46c-1f3fe":0,"1f46c-1f3ff":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3fe":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3fe":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3fe":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fe":0,"1f46d-1f3fb":0,"1f46d-1f3fc":0,"1f46d-1f3fd":0,"1f46d-1f3fe":0,"1f46d-1f3ff":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3fe":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3fe":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3fe":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fe":0,"1f46e-1f3fb-200d-2640":0,"1f46e-1f3fc-200d-2640":0,"1f46e-1f3fd-200d-2640":0,"1f46e-1f3fe-200d-2640":0,"1f46e-1f3ff-200d-2640":0,"1f46e-1f3fb-200d-2642":0,"1f46e-1f3fc-200d-2642":0,"1f46e-1f3fd-200d-2642":0,"1f46e-1f3fe-200d-2642":0,"1f46e-1f3ff-200d-2642":0,"1f46e-1f3fb":0,"1f46e-1f3fc":0,"1f46e-1f3fd":0,"1f46e-1f3fe":0,"1f46e-1f3ff":0,"1f470-1f3fb-200d-2640":0,"1f470-1f3fc-200d-2640":0,"1f470-1f3fd-200d-2640":0,"1f470-1f3fe-200d-2640":0,"1f470-1f3ff-200d-2640":0,"1f470-1f3fb-200d-2642":0,"1f470-1f3fc-200d-2642":0,"1f470-1f3fd-200d-2642":0,"1f470-1f3fe-200d-2642":0,"1f470-1f3ff-200d-2642":0,"1f470-1f3fb":0,"1f470-1f3fc":0,"1f470-1f3fd":0,"1f470-1f3fe":0,"1f470-1f3ff":0,"1f471-1f3fb-200d-2640":0,"1f471-1f3fc-200d-2640":0,"1f471-1f3fd-200d-2640":0,"1f471-1f3fe-200d-2640":0,"1f471-1f3ff-200d-2640":0,"1f471-1f3fb-200d-2642":0,"1f471-1f3fc-200d-2642":0,"1f471-1f3fd-200d-2642":0,"1f471-1f3fe-200d-2642":0,"1f471-1f3ff-200d-2642":0,"1f471-1f3fb":0,"1f471-1f3fc":0,"1f471-1f3fd":0,"1f471-1f3fe":0,"1f471-1f3ff":0,"1f472-1f3fb":0,"1f472-1f3fc":0,"1f472-1f3fd":0,"1f472-1f3fe":0,"1f472-1f3ff":0,"1f473-1f3fb-200d-2640":0,"1f473-1f3fc-200d-2640":0,"1f473-1f3fd-200d-2640":0,"1f473-1f3fe-200d-2640":0,"1f473-1f3ff-200d-2640":0,"1f473-1f3fb-200d-2642":0,"1f473-1f3fc-200d-2642":0,"1f473-1f3fd-200d-2642":0,"1f473-1f3fe-200d-2642":0,"1f473-1f3ff-200d-2642":0,"1f473-1f3fb":0,"1f473-1f3fc":0,"1f473-1f3fd":0,"1f473-1f3fe":0,"1f473-1f3ff":0,"1f474-1f3fb":0,"1f474-1f3fc":0,"1f474-1f3fd":0,"1f474-1f3fe":0,"1f474-1f3ff":0,"1f475-1f3fb":0,"1f475-1f3fc":0,"1f475-1f3fd":0,"1f475-1f3fe":0,"1f475-1f3ff":0,"1f476-1f3fb":0,"1f476-1f3fc":0,"1f476-1f3fd":0,"1f476-1f3fe":0,"1f476-1f3ff":0,"1f477-1f3fb-200d-2640":0,"1f477-1f3fc-200d-2640":0,"1f477-1f3fd-200d-2640":0,"1f477-1f3fe-200d-2640":0,"1f477-1f3ff-200d-2640":0,"1f477-1f3fb-200d-2642":0,"1f477-1f3fc-200d-2642":0,"1f477-1f3fd-200d-2642":0,"1f477-1f3fe-200d-2642":0,"1f477-1f3ff-200d-2642":0,"1f477-1f3fb":0,"1f477-1f3fc":0,"1f477-1f3fd":0,"1f477-1f3fe":0,"1f477-1f3ff":0,"1f478-1f3fb":0,"1f478-1f3fc":0,"1f478-1f3fd":0,"1f478-1f3fe":0,"1f478-1f3ff":0,"1f47c-1f3fb":0,"1f47c-1f3fc":0,"1f47c-1f3fd":0,"1f47c-1f3fe":0,"1f47c-1f3ff":0,"1f481-1f3fb-200d-2640":0,"1f481-1f3fc-200d-2640":0,"1f481-1f3fd-200d-2640":0,"1f481-1f3fe-200d-2640":0,"1f481-1f3ff-200d-2640":0,"1f481-1f3fb-200d-2642":0,"1f481-1f3fc-200d-2642":0,"1f481-1f3fd-200d-2642":0,"1f481-1f3fe-200d-2642":0,"1f481-1f3ff-200d-2642":0,"1f481-1f3fb":0,"1f481-1f3fc":0,"1f481-1f3fd":0,"1f481-1f3fe":0,"1f481-1f3ff":0,"1f482-1f3fb-200d-2640":0,"1f482-1f3fc-200d-2640":0,"1f482-1f3fd-200d-2640":0,"1f482-1f3fe-200d-2640":0,"1f482-1f3ff-200d-2640":0,"1f482-1f3fb-200d-2642":0,"1f482-1f3fc-200d-2642":0,"1f482-1f3fd-200d-2642":0,"1f482-1f3fe-200d-2642":0,"1f482-1f3ff-200d-2642":0,"1f482-1f3fb":0,"1f482-1f3fc":0,"1f482-1f3fd":0,"1f482-1f3fe":0,"1f482-1f3ff":0,"1f483-1f3fb":0,"1f483-1f3fc":0,"1f483-1f3fd":0,"1f483-1f3fe":0,"1f483-1f3ff":0,"1f485-1f3fb":0,"1f485-1f3fc":0,"1f485-1f3fd":0,"1f485-1f3fe":0,"1f485-1f3ff":0,"1f486-1f3fb-200d-2640":0,"1f486-1f3fc-200d-2640":0,"1f486-1f3fd-200d-2640":0,"1f486-1f3fe-200d-2640":0,"1f486-1f3ff-200d-2640":0,"1f486-1f3fb-200d-2642":0,"1f486-1f3fc-200d-2642":0,"1f486-1f3fd-200d-2642":0,"1f486-1f3fe-200d-2642":0,"1f486-1f3ff-200d-2642":0,"1f486-1f3fb":0,"1f486-1f3fc":0,"1f486-1f3fd":0,"1f486-1f3fe":0,"1f486-1f3ff":0,"1f487-1f3fb-200d-2640":0,"1f487-1f3fc-200d-2640":0,"1f487-1f3fd-200d-2640":0,"1f487-1f3fe-200d-2640":0,"1f487-1f3ff-200d-2640":0,"1f487-1f3fb-200d-2642":0,"1f487-1f3fc-200d-2642":0,"1f487-1f3fd-200d-2642":0,"1f487-1f3fe-200d-2642":0,"1f487-1f3ff-200d-2642":0,"1f487-1f3fb":0,"1f487-1f3fc":0,"1f487-1f3fd":0,"1f487-1f3fe":0,"1f487-1f3ff":0,"1f48f-1f3fb":0,"1f48f-1f3fc":0,"1f48f-1f3fd":0,"1f48f-1f3fe":0,"1f48f-1f3ff":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f491-1f3fb":0,"1f491-1f3fc":0,"1f491-1f3fd":0,"1f491-1f3fe":0,"1f491-1f3ff":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fe":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fe":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fe":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fe":0,"1f4aa-1f3fb":0,"1f4aa-1f3fc":0,"1f4aa-1f3fd":0,"1f4aa-1f3fe":0,"1f4aa-1f3ff":0,"1f574-1f3fb":0,"1f574-1f3fc":0,"1f574-1f3fd":0,"1f574-1f3fe":0,"1f574-1f3ff":0,"1f575-1f3fb-200d-2640":0,"1f575-1f3fc-200d-2640":0,"1f575-1f3fd-200d-2640":0,"1f575-1f3fe-200d-2640":0,"1f575-1f3ff-200d-2640":0,"1f575-1f3fb-200d-2642":0,"1f575-1f3fc-200d-2642":0,"1f575-1f3fd-200d-2642":0,"1f575-1f3fe-200d-2642":0,"1f575-1f3ff-200d-2642":0,"1f575-1f3fb":0,"1f575-1f3fc":0,"1f575-1f3fd":0,"1f575-1f3fe":0,"1f575-1f3ff":0,"1f57a-1f3fb":0,"1f57a-1f3fc":0,"1f57a-1f3fd":0,"1f57a-1f3fe":0,"1f57a-1f3ff":0,"1f590-1f3fb":0,"1f590-1f3fc":0,"1f590-1f3fd":0,"1f590-1f3fe":0,"1f590-1f3ff":0,"1f595-1f3fb":0,"1f595-1f3fc":0,"1f595-1f3fd":0,"1f595-1f3fe":0,"1f595-1f3ff":0,"1f596-1f3fb":0,"1f596-1f3fc":0,"1f596-1f3fd":0,"1f596-1f3fe":0,"1f596-1f3ff":0,"1f645-1f3fb-200d-2640":0,"1f645-1f3fc-200d-2640":0,"1f645-1f3fd-200d-2640":0,"1f645-1f3fe-200d-2640":0,"1f645-1f3ff-200d-2640":0,"1f645-1f3fb-200d-2642":0,"1f645-1f3fc-200d-2642":0,"1f645-1f3fd-200d-2642":0,"1f645-1f3fe-200d-2642":0,"1f645-1f3ff-200d-2642":0,"1f645-1f3fb":0,"1f645-1f3fc":0,"1f645-1f3fd":0,"1f645-1f3fe":0,"1f645-1f3ff":0,"1f646-1f3fb-200d-2640":0,"1f646-1f3fc-200d-2640":0,"1f646-1f3fd-200d-2640":0,"1f646-1f3fe-200d-2640":0,"1f646-1f3ff-200d-2640":0,"1f646-1f3fb-200d-2642":0,"1f646-1f3fc-200d-2642":0,"1f646-1f3fd-200d-2642":0,"1f646-1f3fe-200d-2642":0,"1f646-1f3ff-200d-2642":0,"1f646-1f3fb":0,"1f646-1f3fc":0,"1f646-1f3fd":0,"1f646-1f3fe":0,"1f646-1f3ff":0,"1f647-1f3fb-200d-2640":0,"1f647-1f3fc-200d-2640":0,"1f647-1f3fd-200d-2640":0,"1f647-1f3fe-200d-2640":0,"1f647-1f3ff-200d-2640":0,"1f647-1f3fb-200d-2642":0,"1f647-1f3fc-200d-2642":0,"1f647-1f3fd-200d-2642":0,"1f647-1f3fe-200d-2642":0,"1f647-1f3ff-200d-2642":0,"1f647-1f3fb":0,"1f647-1f3fc":0,"1f647-1f3fd":0,"1f647-1f3fe":0,"1f647-1f3ff":0,"1f64b-1f3fb-200d-2640":0,"1f64b-1f3fc-200d-2640":0,"1f64b-1f3fd-200d-2640":0,"1f64b-1f3fe-200d-2640":0,"1f64b-1f3ff-200d-2640":0,"1f64b-1f3fb-200d-2642":0,"1f64b-1f3fc-200d-2642":0,"1f64b-1f3fd-200d-2642":0,"1f64b-1f3fe-200d-2642":0,"1f64b-1f3ff-200d-2642":0,"1f64b-1f3fb":0,"1f64b-1f3fc":0,"1f64b-1f3fd":0,"1f64b-1f3fe":0,"1f64b-1f3ff":0,"1f64c-1f3fb":0,"1f64c-1f3fc":0,"1f64c-1f3fd":0,"1f64c-1f3fe":0,"1f64c-1f3ff":0,"1f64d-1f3fb-200d-2640":0,"1f64d-1f3fc-200d-2640":0,"1f64d-1f3fd-200d-2640":0,"1f64d-1f3fe-200d-2640":0,"1f64d-1f3ff-200d-2640":0,"1f64d-1f3fb-200d-2642":0,"1f64d-1f3fc-200d-2642":0,"1f64d-1f3fd-200d-2642":0,"1f64d-1f3fe-200d-2642":0,"1f64d-1f3ff-200d-2642":0,"1f64d-1f3fb":0,"1f64d-1f3fc":0,"1f64d-1f3fd":0,"1f64d-1f3fe":0,"1f64d-1f3ff":0,"1f64e-1f3fb-200d-2640":0,"1f64e-1f3fc-200d-2640":0,"1f64e-1f3fd-200d-2640":0,"1f64e-1f3fe-200d-2640":0,"1f64e-1f3ff-200d-2640":0,"1f64e-1f3fb-200d-2642":0,"1f64e-1f3fc-200d-2642":0,"1f64e-1f3fd-200d-2642":0,"1f64e-1f3fe-200d-2642":0,"1f64e-1f3ff-200d-2642":0,"1f64e-1f3fb":0,"1f64e-1f3fc":0,"1f64e-1f3fd":0,"1f64e-1f3fe":0,"1f64e-1f3ff":0,"1f64f-1f3fb":0,"1f64f-1f3fc":0,"1f64f-1f3fd":0,"1f64f-1f3fe":0,"1f64f-1f3ff":0,"1f6a3-1f3fb-200d-2640":0,"1f6a3-1f3fc-200d-2640":0,"1f6a3-1f3fd-200d-2640":0,"1f6a3-1f3fe-200d-2640":0,"1f6a3-1f3ff-200d-2640":0,"1f6a3-1f3fb-200d-2642":0,"1f6a3-1f3fc-200d-2642":0,"1f6a3-1f3fd-200d-2642":0,"1f6a3-1f3fe-200d-2642":0,"1f6a3-1f3ff-200d-2642":0,"1f6a3-1f3fb":0,"1f6a3-1f3fc":0,"1f6a3-1f3fd":0,"1f6a3-1f3fe":0,"1f6a3-1f3ff":0,"1f6b4-1f3fb-200d-2640":0,"1f6b4-1f3fc-200d-2640":0,"1f6b4-1f3fd-200d-2640":0,"1f6b4-1f3fe-200d-2640":0,"1f6b4-1f3ff-200d-2640":0,"1f6b4-1f3fb-200d-2642":0,"1f6b4-1f3fc-200d-2642":0,"1f6b4-1f3fd-200d-2642":0,"1f6b4-1f3fe-200d-2642":0,"1f6b4-1f3ff-200d-2642":0,"1f6b4-1f3fb":0,"1f6b4-1f3fc":0,"1f6b4-1f3fd":0,"1f6b4-1f3fe":0,"1f6b4-1f3ff":0,"1f6b5-1f3fb-200d-2640":0,"1f6b5-1f3fc-200d-2640":0,"1f6b5-1f3fd-200d-2640":0,"1f6b5-1f3fe-200d-2640":0,"1f6b5-1f3ff-200d-2640":0,"1f6b5-1f3fb-200d-2642":0,"1f6b5-1f3fc-200d-2642":0,"1f6b5-1f3fd-200d-2642":0,"1f6b5-1f3fe-200d-2642":0,"1f6b5-1f3ff-200d-2642":0,"1f6b5-1f3fb":0,"1f6b5-1f3fc":0,"1f6b5-1f3fd":0,"1f6b5-1f3fe":0,"1f6b5-1f3ff":0,"1f6b6-1f3fb-200d-2640":0,"1f6b6-1f3fc-200d-2640":0,"1f6b6-1f3fd-200d-2640":0,"1f6b6-1f3fe-200d-2640":0,"1f6b6-1f3ff-200d-2640":0,"1f6b6-1f3fb-200d-2642":0,"1f6b6-1f3fc-200d-2642":0,"1f6b6-1f3fd-200d-2642":0,"1f6b6-1f3fe-200d-2642":0,"1f6b6-1f3ff-200d-2642":0,"1f6b6-1f3fb":0,"1f6b6-1f3fc":0,"1f6b6-1f3fd":0,"1f6b6-1f3fe":0,"1f6b6-1f3ff":0,"1f6c0-1f3fb":0,"1f6c0-1f3fc":0,"1f6c0-1f3fd":0,"1f6c0-1f3fe":0,"1f6c0-1f3ff":0,"1f6cc-1f3fb":0,"1f6cc-1f3fc":0,"1f6cc-1f3fd":0,"1f6cc-1f3fe":0,"1f6cc-1f3ff":0,"1f90c-1f3fb":0,"1f90c-1f3fc":0,"1f90c-1f3fd":0,"1f90c-1f3fe":0,"1f90c-1f3ff":0,"1f90f-1f3fb":0,"1f90f-1f3fc":0,"1f90f-1f3fd":0,"1f90f-1f3fe":0,"1f90f-1f3ff":0,"1f918-1f3fb":0,"1f918-1f3fc":0,"1f918-1f3fd":0,"1f918-1f3fe":0,"1f918-1f3ff":0,"1f919-1f3fb":0,"1f919-1f3fc":0,"1f919-1f3fd":0,"1f919-1f3fe":0,"1f919-1f3ff":0,"1f91a-1f3fb":0,"1f91a-1f3fc":0,"1f91a-1f3fd":0,"1f91a-1f3fe":0,"1f91a-1f3ff":0,"1f91b-1f3fb":0,"1f91b-1f3fc":0,"1f91b-1f3fd":0,"1f91b-1f3fe":0,"1f91b-1f3ff":0,"1f91c-1f3fb":0,"1f91c-1f3fc":0,"1f91c-1f3fd":0,"1f91c-1f3fe":0,"1f91c-1f3ff":0,"1f91d-1f3fb":0,"1f91d-1f3fc":0,"1f91d-1f3fd":0,"1f91d-1f3fe":0,"1f91d-1f3ff":0,"1f91e-1f3fb":0,"1f91e-1f3fc":0,"1f91e-1f3fd":0,"1f91e-1f3fe":0,"1f91e-1f3ff":0,"1f91f-1f3fb":0,"1f91f-1f3fc":0,"1f91f-1f3fd":0,"1f91f-1f3fe":0,"1f91f-1f3ff":0,"1f926-1f3fb-200d-2640":0,"1f926-1f3fc-200d-2640":0,"1f926-1f3fd-200d-2640":0,"1f926-1f3fe-200d-2640":0,"1f926-1f3ff-200d-2640":0,"1f926-1f3fb-200d-2642":0,"1f926-1f3fc-200d-2642":0,"1f926-1f3fd-200d-2642":0,"1f926-1f3fe-200d-2642":0,"1f926-1f3ff-200d-2642":0,"1f926-1f3fb":0,"1f926-1f3fc":0,"1f926-1f3fd":0,"1f926-1f3fe":0,"1f926-1f3ff":0,"1f930-1f3fb":0,"1f930-1f3fc":0,"1f930-1f3fd":0,"1f930-1f3fe":0,"1f930-1f3ff":0,"1f931-1f3fb":0,"1f931-1f3fc":0,"1f931-1f3fd":0,"1f931-1f3fe":0,"1f931-1f3ff":0,"1f932-1f3fb":0,"1f932-1f3fc":0,"1f932-1f3fd":0,"1f932-1f3fe":0,"1f932-1f3ff":0,"1f933-1f3fb":0,"1f933-1f3fc":0,"1f933-1f3fd":0,"1f933-1f3fe":0,"1f933-1f3ff":0,"1f934-1f3fb":0,"1f934-1f3fc":0,"1f934-1f3fd":0,"1f934-1f3fe":0,"1f934-1f3ff":0,"1f935-1f3fb-200d-2640":0,"1f935-1f3fc-200d-2640":0,"1f935-1f3fd-200d-2640":0,"1f935-1f3fe-200d-2640":0,"1f935-1f3ff-200d-2640":0,"1f935-1f3fb-200d-2642":0,"1f935-1f3fc-200d-2642":0,"1f935-1f3fd-200d-2642":0,"1f935-1f3fe-200d-2642":0,"1f935-1f3ff-200d-2642":0,"1f935-1f3fb":0,"1f935-1f3fc":0,"1f935-1f3fd":0,"1f935-1f3fe":0,"1f935-1f3ff":0,"1f936-1f3fb":0,"1f936-1f3fc":0,"1f936-1f3fd":0,"1f936-1f3fe":0,"1f936-1f3ff":0,"1f937-1f3fb-200d-2640":0,"1f937-1f3fc-200d-2640":0,"1f937-1f3fd-200d-2640":0,"1f937-1f3fe-200d-2640":0,"1f937-1f3ff-200d-2640":0,"1f937-1f3fb-200d-2642":0,"1f937-1f3fc-200d-2642":0,"1f937-1f3fd-200d-2642":0,"1f937-1f3fe-200d-2642":0,"1f937-1f3ff-200d-2642":0,"1f937-1f3fb":0,"1f937-1f3fc":0,"1f937-1f3fd":0,"1f937-1f3fe":0,"1f937-1f3ff":0,"1f938-1f3fb-200d-2640":0,"1f938-1f3fc-200d-2640":0,"1f938-1f3fd-200d-2640":0,"1f938-1f3fe-200d-2640":0,"1f938-1f3ff-200d-2640":0,"1f938-1f3fb-200d-2642":0,"1f938-1f3fc-200d-2642":0,"1f938-1f3fd-200d-2642":0,"1f938-1f3fe-200d-2642":0,"1f938-1f3ff-200d-2642":0,"1f938-1f3fb":0,"1f938-1f3fc":0,"1f938-1f3fd":0,"1f938-1f3fe":0,"1f938-1f3ff":0,"1f939-1f3fb-200d-2640":0,"1f939-1f3fc-200d-2640":0,"1f939-1f3fd-200d-2640":0,"1f939-1f3fe-200d-2640":0,"1f939-1f3ff-200d-2640":0,"1f939-1f3fb-200d-2642":0,"1f939-1f3fc-200d-2642":0,"1f939-1f3fd-200d-2642":0,"1f939-1f3fe-200d-2642":0,"1f939-1f3ff-200d-2642":0,"1f939-1f3fb":0,"1f939-1f3fc":0,"1f939-1f3fd":0,"1f939-1f3fe":0,"1f939-1f3ff":0,"1f93d-1f3fb-200d-2640":0,"1f93d-1f3fc-200d-2640":0,"1f93d-1f3fd-200d-2640":0,"1f93d-1f3fe-200d-2640":0,"1f93d-1f3ff-200d-2640":0,"1f93d-1f3fb-200d-2642":0,"1f93d-1f3fc-200d-2642":0,"1f93d-1f3fd-200d-2642":0,"1f93d-1f3fe-200d-2642":0,"1f93d-1f3ff-200d-2642":0,"1f93d-1f3fb":0,"1f93d-1f3fc":0,"1f93d-1f3fd":0,"1f93d-1f3fe":0,"1f93d-1f3ff":0,"1f93e-1f3fb-200d-2640":0,"1f93e-1f3fc-200d-2640":0,"1f93e-1f3fd-200d-2640":0,"1f93e-1f3fe-200d-2640":0,"1f93e-1f3ff-200d-2640":0,"1f93e-1f3fb-200d-2642":0,"1f93e-1f3fc-200d-2642":0,"1f93e-1f3fd-200d-2642":0,"1f93e-1f3fe-200d-2642":0,"1f93e-1f3ff-200d-2642":0,"1f93e-1f3fb":0,"1f93e-1f3fc":0,"1f93e-1f3fd":0,"1f93e-1f3fe":0,"1f93e-1f3ff":0,"1f977-1f3fb":0,"1f977-1f3fc":0,"1f977-1f3fd":0,"1f977-1f3fe":0,"1f977-1f3ff":0,"1f9b5-1f3fb":0,"1f9b5-1f3fc":0,"1f9b5-1f3fd":0,"1f9b5-1f3fe":0,"1f9b5-1f3ff":0,"1f9b6-1f3fb":0,"1f9b6-1f3fc":0,"1f9b6-1f3fd":0,"1f9b6-1f3fe":0,"1f9b6-1f3ff":0,"1f9b8-1f3fb-200d-2640":0,"1f9b8-1f3fc-200d-2640":0,"1f9b8-1f3fd-200d-2640":0,"1f9b8-1f3fe-200d-2640":0,"1f9b8-1f3ff-200d-2640":0,"1f9b8-1f3fb-200d-2642":0,"1f9b8-1f3fc-200d-2642":0,"1f9b8-1f3fd-200d-2642":0,"1f9b8-1f3fe-200d-2642":0,"1f9b8-1f3ff-200d-2642":0,"1f9b8-1f3fb":0,"1f9b8-1f3fc":0,"1f9b8-1f3fd":0,"1f9b8-1f3fe":0,"1f9b8-1f3ff":0,"1f9b9-1f3fb-200d-2640":0,"1f9b9-1f3fc-200d-2640":0,"1f9b9-1f3fd-200d-2640":0,"1f9b9-1f3fe-200d-2640":0,"1f9b9-1f3ff-200d-2640":0,"1f9b9-1f3fb-200d-2642":0,"1f9b9-1f3fc-200d-2642":0,"1f9b9-1f3fd-200d-2642":0,"1f9b9-1f3fe-200d-2642":0,"1f9b9-1f3ff-200d-2642":0,"1f9b9-1f3fb":0,"1f9b9-1f3fc":0,"1f9b9-1f3fd":0,"1f9b9-1f3fe":0,"1f9b9-1f3ff":0,"1f9bb-1f3fb":0,"1f9bb-1f3fc":0,"1f9bb-1f3fd":0,"1f9bb-1f3fe":0,"1f9bb-1f3ff":0,"1f9cd-1f3fb-200d-2640":0,"1f9cd-1f3fc-200d-2640":0,"1f9cd-1f3fd-200d-2640":0,"1f9cd-1f3fe-200d-2640":0,"1f9cd-1f3ff-200d-2640":0,"1f9cd-1f3fb-200d-2642":0,"1f9cd-1f3fc-200d-2642":0,"1f9cd-1f3fd-200d-2642":0,"1f9cd-1f3fe-200d-2642":0,"1f9cd-1f3ff-200d-2642":0,"1f9cd-1f3fb":0,"1f9cd-1f3fc":0,"1f9cd-1f3fd":0,"1f9cd-1f3fe":0,"1f9cd-1f3ff":0,"1f9ce-1f3fb-200d-2640":0,"1f9ce-1f3fc-200d-2640":0,"1f9ce-1f3fd-200d-2640":0,"1f9ce-1f3fe-200d-2640":0,"1f9ce-1f3ff-200d-2640":0,"1f9ce-1f3fb-200d-2642":0,"1f9ce-1f3fc-200d-2642":0,"1f9ce-1f3fd-200d-2642":0,"1f9ce-1f3fe-200d-2642":0,"1f9ce-1f3ff-200d-2642":0,"1f9ce-1f3fb":0,"1f9ce-1f3fc":0,"1f9ce-1f3fd":0,"1f9ce-1f3fe":0,"1f9ce-1f3ff":0,"1f9cf-1f3fb-200d-2640":0,"1f9cf-1f3fc-200d-2640":0,"1f9cf-1f3fd-200d-2640":0,"1f9cf-1f3fe-200d-2640":0,"1f9cf-1f3ff-200d-2640":0,"1f9cf-1f3fb-200d-2642":0,"1f9cf-1f3fc-200d-2642":0,"1f9cf-1f3fd-200d-2642":0,"1f9cf-1f3fe-200d-2642":0,"1f9cf-1f3ff-200d-2642":0,"1f9cf-1f3fb":0,"1f9cf-1f3fc":0,"1f9cf-1f3fd":0,"1f9cf-1f3fe":0,"1f9cf-1f3ff":0,"1f9d1-1f3fb-200d-1f33e":0,"1f9d1-1f3fc-200d-1f33e":0,"1f9d1-1f3fd-200d-1f33e":0,"1f9d1-1f3fe-200d-1f33e":0,"1f9d1-1f3ff-200d-1f33e":0,"1f9d1-1f3fb-200d-1f373":0,"1f9d1-1f3fc-200d-1f373":0,"1f9d1-1f3fd-200d-1f373":0,"1f9d1-1f3fe-200d-1f373":0,"1f9d1-1f3ff-200d-1f373":0,"1f9d1-1f3fb-200d-1f37c":0,"1f9d1-1f3fc-200d-1f37c":0,"1f9d1-1f3fd-200d-1f37c":0,"1f9d1-1f3fe-200d-1f37c":0,"1f9d1-1f3ff-200d-1f37c":0,"1f9d1-1f3fb-200d-1f384":0,"1f9d1-1f3fc-200d-1f384":0,"1f9d1-1f3fd-200d-1f384":0,"1f9d1-1f3fe-200d-1f384":0,"1f9d1-1f3ff-200d-1f384":0,"1f9d1-1f3fb-200d-1f393":0,"1f9d1-1f3fc-200d-1f393":0,"1f9d1-1f3fd-200d-1f393":0,"1f9d1-1f3fe-200d-1f393":0,"1f9d1-1f3ff-200d-1f393":0,"1f9d1-1f3fb-200d-1f3a4":0,"1f9d1-1f3fc-200d-1f3a4":0,"1f9d1-1f3fd-200d-1f3a4":0,"1f9d1-1f3fe-200d-1f3a4":0,"1f9d1-1f3ff-200d-1f3a4":0,"1f9d1-1f3fb-200d-1f3a8":0,"1f9d1-1f3fc-200d-1f3a8":0,"1f9d1-1f3fd-200d-1f3a8":0,"1f9d1-1f3fe-200d-1f3a8":0,"1f9d1-1f3ff-200d-1f3a8":0,"1f9d1-1f3fb-200d-1f3eb":0,"1f9d1-1f3fc-200d-1f3eb":0,"1f9d1-1f3fd-200d-1f3eb":0,"1f9d1-1f3fe-200d-1f3eb":0,"1f9d1-1f3ff-200d-1f3eb":0,"1f9d1-1f3fb-200d-1f3ed":0,"1f9d1-1f3fc-200d-1f3ed":0,"1f9d1-1f3fd-200d-1f3ed":0,"1f9d1-1f3fe-200d-1f3ed":0,"1f9d1-1f3ff-200d-1f3ed":0,"1f9d1-1f3fb-200d-1f4bb":0,"1f9d1-1f3fc-200d-1f4bb":0,"1f9d1-1f3fd-200d-1f4bb":0,"1f9d1-1f3fe-200d-1f4bb":0,"1f9d1-1f3ff-200d-1f4bb":0,"1f9d1-1f3fb-200d-1f4bc":0,"1f9d1-1f3fc-200d-1f4bc":0,"1f9d1-1f3fd-200d-1f4bc":0,"1f9d1-1f3fe-200d-1f4bc":0,"1f9d1-1f3ff-200d-1f4bc":0,"1f9d1-1f3fb-200d-1f527":0,"1f9d1-1f3fc-200d-1f527":0,"1f9d1-1f3fd-200d-1f527":0,"1f9d1-1f3fe-200d-1f527":0,"1f9d1-1f3ff-200d-1f527":0,"1f9d1-1f3fb-200d-1f52c":0,"1f9d1-1f3fc-200d-1f52c":0,"1f9d1-1f3fd-200d-1f52c":0,"1f9d1-1f3fe-200d-1f52c":0,"1f9d1-1f3ff-200d-1f52c":0,"1f9d1-1f3fb-200d-1f680":0,"1f9d1-1f3fc-200d-1f680":0,"1f9d1-1f3fd-200d-1f680":0,"1f9d1-1f3fe-200d-1f680":0,"1f9d1-1f3ff-200d-1f680":0,"1f9d1-1f3fb-200d-1f692":0,"1f9d1-1f3fc-200d-1f692":0,"1f9d1-1f3fd-200d-1f692":0,"1f9d1-1f3fe-200d-1f692":0,"1f9d1-1f3ff-200d-1f692":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fb-200d-1f9af":0,"1f9d1-1f3fc-200d-1f9af":0,"1f9d1-1f3fd-200d-1f9af":0,"1f9d1-1f3fe-200d-1f9af":0,"1f9d1-1f3ff-200d-1f9af":0,"1f9d1-1f3fb-200d-1f9b0":0,"1f9d1-1f3fc-200d-1f9b0":0,"1f9d1-1f3fd-200d-1f9b0":0,"1f9d1-1f3fe-200d-1f9b0":0,"1f9d1-1f3ff-200d-1f9b0":0,"1f9d1-1f3fb-200d-1f9b1":0,"1f9d1-1f3fc-200d-1f9b1":0,"1f9d1-1f3fd-200d-1f9b1":0,"1f9d1-1f3fe-200d-1f9b1":0,"1f9d1-1f3ff-200d-1f9b1":0,"1f9d1-1f3fb-200d-1f9b2":0,"1f9d1-1f3fc-200d-1f9b2":0,"1f9d1-1f3fd-200d-1f9b2":0,"1f9d1-1f3fe-200d-1f9b2":0,"1f9d1-1f3ff-200d-1f9b2":0,"1f9d1-1f3fb-200d-1f9b3":0,"1f9d1-1f3fc-200d-1f9b3":0,"1f9d1-1f3fd-200d-1f9b3":0,"1f9d1-1f3fe-200d-1f9b3":0,"1f9d1-1f3ff-200d-1f9b3":0,"1f9d1-1f3fb-200d-1f9bc":0,"1f9d1-1f3fc-200d-1f9bc":0,"1f9d1-1f3fd-200d-1f9bc":0,"1f9d1-1f3fe-200d-1f9bc":0,"1f9d1-1f3ff-200d-1f9bc":0,"1f9d1-1f3fb-200d-1f9bd":0,"1f9d1-1f3fc-200d-1f9bd":0,"1f9d1-1f3fd-200d-1f9bd":0,"1f9d1-1f3fe-200d-1f9bd":0,"1f9d1-1f3ff-200d-1f9bd":0,"1f9d1-1f3fb-200d-2695":0,"1f9d1-1f3fc-200d-2695":0,"1f9d1-1f3fd-200d-2695":0,"1f9d1-1f3fe-200d-2695":0,"1f9d1-1f3ff-200d-2695":0,"1f9d1-1f3fb-200d-2696":0,"1f9d1-1f3fc-200d-2696":0,"1f9d1-1f3fd-200d-2696":0,"1f9d1-1f3fe-200d-2696":0,"1f9d1-1f3ff-200d-2696":0,"1f9d1-1f3fb-200d-2708":0,"1f9d1-1f3fc-200d-2708":0,"1f9d1-1f3fd-200d-2708":0,"1f9d1-1f3fe-200d-2708":0,"1f9d1-1f3ff-200d-2708":0,"1f9d1-1f3fb":0,"1f9d1-1f3fc":0,"1f9d1-1f3fd":0,"1f9d1-1f3fe":0,"1f9d1-1f3ff":0,"1f9d2-1f3fb":0,"1f9d2-1f3fc":0,"1f9d2-1f3fd":0,"1f9d2-1f3fe":0,"1f9d2-1f3ff":0,"1f9d3-1f3fb":0,"1f9d3-1f3fc":0,"1f9d3-1f3fd":0,"1f9d3-1f3fe":0,"1f9d3-1f3ff":0,"1f9d4-1f3fb-200d-2640":0,"1f9d4-1f3fc-200d-2640":0,"1f9d4-1f3fd-200d-2640":0,"1f9d4-1f3fe-200d-2640":0,"1f9d4-1f3ff-200d-2640":0,"1f9d4-1f3fb-200d-2642":0,"1f9d4-1f3fc-200d-2642":0,"1f9d4-1f3fd-200d-2642":0,"1f9d4-1f3fe-200d-2642":0,"1f9d4-1f3ff-200d-2642":0,"1f9d4-1f3fb":0,"1f9d4-1f3fc":0,"1f9d4-1f3fd":0,"1f9d4-1f3fe":0,"1f9d4-1f3ff":0,"1f9d5-1f3fb":0,"1f9d5-1f3fc":0,"1f9d5-1f3fd":0,"1f9d5-1f3fe":0,"1f9d5-1f3ff":0,"1f9d6-1f3fb-200d-2640":0,"1f9d6-1f3fc-200d-2640":0,"1f9d6-1f3fd-200d-2640":0,"1f9d6-1f3fe-200d-2640":0,"1f9d6-1f3ff-200d-2640":0,"1f9d6-1f3fb-200d-2642":0,"1f9d6-1f3fc-200d-2642":0,"1f9d6-1f3fd-200d-2642":0,"1f9d6-1f3fe-200d-2642":0,"1f9d6-1f3ff-200d-2642":0,"1f9d6-1f3fb":0,"1f9d6-1f3fc":0,"1f9d6-1f3fd":0,"1f9d6-1f3fe":0,"1f9d6-1f3ff":0,"1f9d7-1f3fb-200d-2640":0,"1f9d7-1f3fc-200d-2640":0,"1f9d7-1f3fd-200d-2640":0,"1f9d7-1f3fe-200d-2640":0,"1f9d7-1f3ff-200d-2640":0,"1f9d7-1f3fb-200d-2642":0,"1f9d7-1f3fc-200d-2642":0,"1f9d7-1f3fd-200d-2642":0,"1f9d7-1f3fe-200d-2642":0,"1f9d7-1f3ff-200d-2642":0,"1f9d7-1f3fb":0,"1f9d7-1f3fc":0,"1f9d7-1f3fd":0,"1f9d7-1f3fe":0,"1f9d7-1f3ff":0,"1f9d8-1f3fb-200d-2640":0,"1f9d8-1f3fc-200d-2640":0,"1f9d8-1f3fd-200d-2640":0,"1f9d8-1f3fe-200d-2640":0,"1f9d8-1f3ff-200d-2640":0,"1f9d8-1f3fb-200d-2642":0,"1f9d8-1f3fc-200d-2642":0,"1f9d8-1f3fd-200d-2642":0,"1f9d8-1f3fe-200d-2642":0,"1f9d8-1f3ff-200d-2642":0,"1f9d8-1f3fb":0,"1f9d8-1f3fc":0,"1f9d8-1f3fd":0,"1f9d8-1f3fe":0,"1f9d8-1f3ff":0,"1f9d9-1f3fb-200d-2640":0,"1f9d9-1f3fc-200d-2640":0,"1f9d9-1f3fd-200d-2640":0,"1f9d9-1f3fe-200d-2640":0,"1f9d9-1f3ff-200d-2640":0,"1f9d9-1f3fb-200d-2642":0,"1f9d9-1f3fc-200d-2642":0,"1f9d9-1f3fd-200d-2642":0,"1f9d9-1f3fe-200d-2642":0,"1f9d9-1f3ff-200d-2642":0,"1f9d9-1f3fb":0,"1f9d9-1f3fc":0,"1f9d9-1f3fd":0,"1f9d9-1f3fe":0,"1f9d9-1f3ff":0,"1f9da-1f3fb-200d-2640":0,"1f9da-1f3fc-200d-2640":0,"1f9da-1f3fd-200d-2640":0,"1f9da-1f3fe-200d-2640":0,"1f9da-1f3ff-200d-2640":0,"1f9da-1f3fb-200d-2642":0,"1f9da-1f3fc-200d-2642":0,"1f9da-1f3fd-200d-2642":0,"1f9da-1f3fe-200d-2642":0,"1f9da-1f3ff-200d-2642":0,"1f9da-1f3fb":0,"1f9da-1f3fc":0,"1f9da-1f3fd":0,"1f9da-1f3fe":0,"1f9da-1f3ff":0,"1f9db-1f3fb-200d-2640":0,"1f9db-1f3fc-200d-2640":0,"1f9db-1f3fd-200d-2640":0,"1f9db-1f3fe-200d-2640":0,"1f9db-1f3ff-200d-2640":0,"1f9db-1f3fb-200d-2642":0,"1f9db-1f3fc-200d-2642":0,"1f9db-1f3fd-200d-2642":0,"1f9db-1f3fe-200d-2642":0,"1f9db-1f3ff-200d-2642":0,"1f9db-1f3fb":0,"1f9db-1f3fc":0,"1f9db-1f3fd":0,"1f9db-1f3fe":0,"1f9db-1f3ff":0,"1f9dc-1f3fb-200d-2640":0,"1f9dc-1f3fc-200d-2640":0,"1f9dc-1f3fd-200d-2640":0,"1f9dc-1f3fe-200d-2640":0,"1f9dc-1f3ff-200d-2640":0,"1f9dc-1f3fb-200d-2642":0,"1f9dc-1f3fc-200d-2642":0,"1f9dc-1f3fd-200d-2642":0,"1f9dc-1f3fe-200d-2642":0,"1f9dc-1f3ff-200d-2642":0,"1f9dc-1f3fb":0,"1f9dc-1f3fc":0,"1f9dc-1f3fd":0,"1f9dc-1f3fe":0,"1f9dc-1f3ff":0,"1f9dd-1f3fb-200d-2640":0,"1f9dd-1f3fc-200d-2640":0,"1f9dd-1f3fd-200d-2640":0,"1f9dd-1f3fe-200d-2640":0,"1f9dd-1f3ff-200d-2640":0,"1f9dd-1f3fb-200d-2642":0,"1f9dd-1f3fc-200d-2642":0,"1f9dd-1f3fd-200d-2642":0,"1f9dd-1f3fe-200d-2642":0,"1f9dd-1f3ff-200d-2642":0,"1f9dd-1f3fb":0,"1f9dd-1f3fc":0,"1f9dd-1f3fd":0,"1f9dd-1f3fe":0,"1f9dd-1f3ff":0,"261d-1f3fb":0,"261d-1f3fc":0,"261d-1f3fd":0,"261d-1f3fe":0,"261d-1f3ff":0,"26f9-1f3fb-200d-2640":0,"26f9-1f3fc-200d-2640":0,"26f9-1f3fd-200d-2640":0,"26f9-1f3fe-200d-2640":0,"26f9-1f3ff-200d-2640":0,"26f9-1f3fb-200d-2642":0,"26f9-1f3fc-200d-2642":0,"26f9-1f3fd-200d-2642":0,"26f9-1f3fe-200d-2642":0,"26f9-1f3ff-200d-2642":0,"26f9-1f3fb":0,"26f9-1f3fc":0,"26f9-1f3fd":0,"26f9-1f3fe":0,"26f9-1f3ff":0,"270a-1f3fb":0,"270a-1f3fc":0,"270a-1f3fd":0,"270a-1f3fe":0,"270a-1f3ff":0,"270b-1f3fb":0,"270b-1f3fc":0,"270b-1f3fd":0,"270b-1f3fe":0,"270b-1f3ff":0,"270c-1f3fb":0,"270c-1f3fc":0,"270c-1f3fd":0,"270c-1f3fe":0,"270c-1f3ff":0,"270d-1f3fb":0,"270d-1f3fc":0,"270d-1f3fd":0,"270d-1f3fe":0,"270d-1f3ff":0}},n=s[""];for(const e in s)e&&Object.assign(n,s[e]);const i=n},4762:(e,t,a)=>{a.d(t,{IS_FIREFOX:()=>r,IS_SAFARI:()=>i});var s=a(6761);const n=navigator?navigator.userAgent:null,i=(navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i),navigator.userAgent.toLowerCase().indexOf("android"),/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor),(/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&s.Z.MSStream,!!("safari"in s.Z)||!(!n||!(/\b(iPad|iPhone|iPod)\b/.test(n)||n.match("Safari")&&!n.match("Chrome")))),r=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;(void 0===navigator.maxTouchPoints||navigator.maxTouchPoints>0)&&navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i)},467:(e,t,a)=>{a.d(t,{ZP:()=>o,gV:()=>p});var s=a(5813);const n=/[`~!@#$%^&*()\-_=+\[\]\\|{}'";:\/?.>,<]+/g,i=/^\s+|\s$/g,r={й:"q",ц:"w",у:"e",к:"r",е:"t",н:"y",г:"u",ш:"i",щ:"o",з:"p",х:"[",ъ:"]",ф:"a",ы:"s",в:"d",а:"f",п:"g",р:"h",о:"j",л:"k",д:"l",ж:";",э:"'",я:"z",ч:"x",с:"c",м:"v",и:"b",т:"n",ь:"m",б:",",ю:".",".":"/"};function o(e,t=!0){return p(e,{clearBadChars:!0,latinize:t,ignoreCase:!0})}function p(e,t={}){const a=t.includeTag&&"%"===e.charAt(0),o=e;return t.clearBadChars&&(e=function(e){return e.replace(n,"").replace(i,"")}(e)),t.latinize&&(e=function(e){return e.replace(/[^A-Za-z0-9]/g,(e=>{const t=s.Z[e];return null!=t?t:e}))}(e)),t.ignoreCase&&(e=e.toLowerCase()),a&&(e="%"+e),t.latinize&&(e+=""+function(e){return e.toLowerCase().replace(/[\wа-я]/g,(e=>{const t=r[e];return null!=t?t:e}))}(o)),e}},8801:(e,t,a)=>{a.d(t,{P:()=>n,q:()=>i});const s="_";function n(e,t){const a=""["".length-1]||"";let n;switch(e._){case"inputPhotoFileLocation":n=["photo",""[0],e.id,e.thumb_size].filter(Boolean).join(s);break;case"inputDocumentFileLocation":n=["document",""[0],e.id,e.thumb_size].filter(Boolean).join(s);break;case"inputPeerPhotoFileLocation":n=["peerPhoto",e.photo_id,e.pFlags.big?"big":"small"].join(s);break;case"inputStickerSetThumb":n=["stickerSetThumb",e.stickerset.id||e.stickerset.short_name||e.stickerset.emoticon||e.stickerset._,e.thumb_version].join(s);break;case"inputFileLocation":n=[e.volume_id,e.local_id].join(s);break;case"inputWebFileLocation":n=["webFile",e.url].join(s);break;default:console.error("Unrecognized location:",e),n=""}return n+((null==t?void 0:t.downloadId)?"_download":"")+(a?"."+a:a)}function i(e,t){return e+"/"+encodeURIComponent(JSON.stringify(t))}},677:(e,t,a)=>{a.d(t,{Ki:()=>o,RP:()=>i,X:()=>r});const s=new Set(["all","web","webk"]),n=new Set;function i(e){return e.find((e=>s.has(e.platform)&&!n.has(e.reason)))}function r(e){return!!i(e)}function o(e){n.clear(),e.forEach((e=>{n.add(e)}))}},2946:(e,t,a)=>{a.d(t,{Z:()=>i});var s=a(5880),n=a(1507);function i(e){if(void 0!==e&&e.isPeerId&&e.isPeerId())return e;if((0,s.Z)(e)){const t=e.user_id;if(void 0!==t)return t.toPeerId(!1);const a=e.channel_id||e.chat_id;return void 0!==a?a.toPeerId(!0):n.NM}if(!e)return n.NM;const t="u"===e.charAt(0),a=e.substr(1).split("_");return t?a[0].toPeerId():(a[0]||"").toPeerId(!0)}},6666:(e,t,a)=>{a.d(t,{C:()=>o,Z:()=>p});var s=a(1267),n=a(5471),i=a(5953),r=a(5003);class o{constructor(e){(0,i.Z)(this,e),s.Z.test&&(this.name+="_test"),this.storageIsAvailable=!0,this.log=(0,r.kg)(["IDB",e.name].join("-")),this.log("constructor"),this.openDatabase(!0),o.INSTANCES.push(this)}isAvailable(){return this.storageIsAvailable}openDatabase(e=!1){if(this.openDbPromise&&!e)return this.openDbPromise;const t=(e,t)=>{var a;const s=Array.from(e.indexNames);for(const t of s)e.deleteIndex(t);if(null===(a=t.indexes)||void 0===a?void 0:a.length)for(const a of t.indexes)e.indexNames.contains(a.indexName)||e.createIndex(a.indexName,a.keyPath,a.objectParameters)};try{var a=indexedDB.open(this.name,this.version);if(!a)return Promise.reject()}catch(e){return this.log.error("error opening db",e.message),this.storageIsAvailable=!1,Promise.reject(e)}let s=!1;return setTimeout((()=>{s||a.onerror((0,n.Z)("IDB_CREATE_TIMEOUT"))}),3e3),this.openDbPromise=new Promise(((e,n)=>{a.onsuccess=t=>{s=!0;const i=a.result;let r=!1;this.log("Opened"),i.onerror=e=>{this.storageIsAvailable=!1,this.log.error("Error creating/accessing IndexedDB database",e),n(e)},i.onclose=e=>{this.log.error("closed:",e),!r&&this.openDatabase()},i.onabort=e=>{this.log.error("abort:",e);const t=e.target;this.openDatabase(r=!0),t.onerror&&t.onerror(e),i.close()},i.onversionchange=e=>{this.log.error("onversionchange, lol?")},e(this.db=i)},a.onerror=e=>{s=!0,this.storageIsAvailable=!1,this.log.error("Error creating/accessing IndexedDB database",e),n(e)},a.onupgradeneeded=e=>{s=!0,this.log.warn("performing idb upgrade from",e.oldVersion,"to",e.newVersion);const a=e.target,n=a.result;this.stores.forEach((e=>{if(n.objectStoreNames.contains(e.name)){const s=a.transaction.objectStore(e.name);t(s,e)}else((e,a)=>{const s=e.createObjectStore(a.name);t(s,a)})(n,e)}))}}))}static create(e){var t;return null!==(t=this.INSTANCES.find((t=>t.name===e.name)))&&void 0!==t?t:new o(e)}static closeDatabases(e){this.INSTANCES.forEach((t=>{if(e&&e===t)return;const a=t.db;a&&(a.onclose=()=>{},a.close())}))}}o.INSTANCES=[];class p{constructor(e,t){this.storeName=t,this.log=(0,r.kg)(["IDB",e.name,t].join("-")),this.idb=o.create(e)}delete(e,t){const a=Array.isArray(e);return a||(e=[].concat(e)),this.getObjectStore("readwrite",(t=>{const s=e.map((e=>t.delete(e)));return a?s:s[0]}),"",t)}clear(e){return this.getObjectStore("readwrite",(e=>e.clear()),"",e)}save(e,t,a){const s=Array.isArray(e);return s||(e=[].concat(e),t=[].concat(t)),this.getObjectStore("readwrite",(a=>{const n=e.map(((e,s)=>a.put(t[s],e)));return s?n:n[0]}),"",a)}get(e,t){const a=Array.isArray(e);if(a){if(!e.length)return Promise.resolve([])}else{if(!e)return;e=[].concat(e)}return this.getObjectStore("readonly",(t=>{const s=e.map((e=>t.get(e)));return a?s:s[0]}),"",t)}getObjectStore(e,t,a,s=this.storeName){let n;return a&&(n=performance.now(),this.log(a+": start")),this.idb.openDatabase().then((i=>new Promise(((r,o)=>{const p=i.transaction([s],e),d=()=>{clearTimeout(l),o(p.error)},f=()=>{clearTimeout(l),a&&this.log(a+": end",performance.now()-n);const e=h.map((e=>e.result));r(g?e:e[0])};p.onerror=d;const c="readwrite"===e;c&&(p.oncomplete=()=>f());const l=setTimeout((()=>{this.log.error("transaction not finished",p,a)}),1e4),m=t(p.objectStore(s)),g=Array.isArray(m),h=g?m:[].concat(m);if(c)return;const u=h.length;let y=u;const _=()=>{p.error||--y||f()};for(let e=0;ee.getAll()),"",e)}}},9092:(e,t,a)=>{a.d(t,{r:()=>zs,H:()=>Ws}),a(690),a(4110);var s=a(8630);let n;function i(){return n}function r(e){return n=e}var o=a(1507),p=a(3241),d=a(410),f=a(3206),c=a(1352);class l extends p.Z{constructor(){super(),this.myId=o.NM,this.connectionStatus={},this.premium=!1,this.addEventListener("user_auth",(({id:e})=>{this.myId=e.toPeerId()})),this.addEventListener("premium_toggle_private",(({isNew:e,isPremium:t})=>{this.premium=t,this.dispatchEventSingle("premium_toggle",t)})),this.addEventListener("connection_status_change",(e=>{this.connectionStatus[e.name]=e})),this.dispatchEvent=(e,...t)=>{super.dispatchEvent(e,...t),f.Z.getInstance().invokeVoid("event",{name:e,args:t})},c.kC||this.addEventListener("settings_updated",(({settings:e})=>{this.settings=e}))}getConnectionStatus(){return this.connectionStatus}getPremium(){return this.premium}dispatchEventSingle(...e){super.dispatchEvent(...e)}}const m=new l;d.GO.rootScope=m;const g=m;var h=a(7922),u=a(9750);const y=new class{constructor(){this.state={},this.storage=h.Z}getState(){return Promise.resolve(this.state)}setByKey(e,t){!function(e,t,a){const s=t.split(".");(0,u.Z)(e,s.slice(0,-1).join("."))[s.pop()]=a}(this.state,e,t);const a=e.split(".")[0];"settings"===a&&g.dispatchEvent("settings_updated",{key:e,value:t,settings:this.state.settings}),this.pushToState(a,this.state[a])}pushToState(e,t,a=!0,s){a&&(this.state[e]=t),this.setKeyValueToStorage(e,t,s)}setKeyValueToStorage(e,t=this.state[e],a){f.Z.getInstance().invokeVoid("mirror",{name:"state",key:e,value:t}),this.storage.set({[e]:t},a)}};var _=a(4159),v=a(3725),P=a(5418),b=a(1267),M=a(1655),S=a(5003);class I{constructor(e,t,a){this.dcId=e,this.url=t,this.pending=[],this.debug=b.Z.debug&&!1;let s=S.v9.Error|S.v9.Log;this.debug&&(s|=S.v9.Debug),this.log=(0,S.kg)(`HTTP-${e}`+a,s),this.log("constructor"),this.connected=!1}_send(e,t){const a=e.length;return this.debug&&this.log.debug("-> body length to send:",a),fetch(this.url,{method:"POST",body:e,mode:t}).then((e=>{if(200!==e.status&&!t)throw e.arrayBuffer().then((e=>{this.log.error("not 200",new TextDecoder("utf-8").decode(new Uint8Array(e)))})),e;return this.setConnected(!0),e.arrayBuffer().then((e=>new Uint8Array(e)))}),(e=>{throw this.setConnected(!1),e}))}setConnected(e){this.connected===e||this.destroyed||(this.connected=e,Z.setTransportValue("https",e))}destroy(){this.setConnected(!1),this.destroyed=!0,this.pending.forEach((e=>e.reject())),this.pending.length=0}send(e){if(this.networker)return this._send(e);{const t=new Promise(((t,a)=>{this.pending.push({resolve:t,reject:a,body:e})}));return this.releasePending(),t}}releasePending(){return e=this,t=void 0,s=function*(){if(!this.releasing){this.releasing=!0;for(let e=0;e{this.log("opened"),this.debug&&this.log.debug("sending init packet"),this.dispatchEvent("open")},this.handleError=e=>{this.log.error("handleError",e),this.close()},this.handleClose=e=>{this.log("closed",e),this.removeListeners(),this.dispatchEvent("close")},this.handleMessage=e=>{this.debug&&this.log.debug("<-","handleMessage",e.data.byteLength),this.dispatchEvent("message",e.data)},this.send=e=>{this.debug&&this.log.debug("-> body length to send:",e.length),this.ws.send(e)};let s=S.v9.Error|S.v9.Log;return this.debug&&(s|=S.v9.Debug),this.log=(0,S.kg)(`WS-${e}`+a,s),this.log("constructor"),this.connect(),this}removeListeners(){this.ws&&(this.ws.removeEventListener("open",this.handleOpen),this.ws.removeEventListener("close",this.handleClose),this.ws.removeEventListener("error",this.handleError),this.ws.removeEventListener("message",this.handleMessage),this.ws=void 0)}connect(){this.ws=new WebSocket(this.url,"binary"),this.ws.binaryType="arraybuffer",this.ws.addEventListener("open",this.handleOpen),this.ws.addEventListener("close",this.handleClose),this.ws.addEventListener("error",this.handleError),this.ws.addEventListener("message",this.handleMessage)}close(){if(this.ws){this.log("close execution");try{this.ws.close()}catch(e){}this.handleClose()}}}function k(e){if(!crypto||!("getRandomValues"in crypto))throw new Error("NO_SECURE_RANDOM");return crypto.getRandomValues(e),e}var w=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};class A{constructor(){this._process=(e,t)=>s.Z.invokeCryptoNew({method:"aes-ctr-process",args:[{id:this.id,data:e,operation:t}],transfer:[e.buffer]})}init(e){return w(this,void 0,void 0,(function*(){void 0!==this.idPromise&&this.release();const t=new Uint8Array(64);for(k(t);;){const e=t[3]<<24|t[2]<<16|t[1]<<8|t[0],a=t[7]<<24|t[6]<<16|t[5]<<8|t[4];if(239!==t[0]&&1145128264!==e&&1414745936!==e&&542393671!==e&&1230262351!==e&&4008636142!==e&&3722304989!==e&&0!==a)break;k(t)}const a=t.slice().reverse(),n=t.slice(8,40),i=t.slice(40,56),r=a.slice(8,40),o=a.slice(40,56),p=this.idPromise=s.Z.invokeCrypto("aes-ctr-prepare",{encKey:n,encIv:i,decKey:r,decIv:o});this.process=(e,t)=>w(this,void 0,void 0,(function*(){return yield p,this._process(e,t)})),this.id=yield p,this.process=this._process,t.set(e.obfuscateTag,56);const d=yield this.encode(t.slice());return t.set(d.slice(56,64),56),t}))}encode(e){return this.process(e,"encrypt")}decode(e){return this.process(e,"decrypt")}release(){return w(this,void 0,void 0,(function*(){const e=this.idPromise;if(void 0===e)return;this.id=void 0,this.idPromise=void 0;const t=yield e;s.Z.invokeCrypto("aes-ctr-destroy",t)}))}destroy(){this.release()}}const U=new class{constructor(){this.tag=239,this.obfuscateTag=new Uint8Array([this.tag,this.tag,this.tag,this.tag])}encodePacket(e){const t=e.byteLength>>2;let a;return a=t<127?new Uint8Array([t]):new Uint8Array([127,255&t,t>>8&255,t>>16&255]),a.concat(e)}readPacket(e){let t=e[0];return t>=127?(t=e[1]|e[2]<<8|e[3]<<16,e.slice(4,t<<3)):e.slice(1,t<<3)}};var D=a(9174);function E(e){const t=e.length,a=new Array(t);for(let s=0;sF(this,void 0,void 0,(function*(){this.connected=!0,Z.setTransportOpened("websocket");const e=yield this.obfuscation.init(this.codec);this.connected&&(this.connection.send(e),this.networker&&(this.pending.length=0,this.networker.setConnectionStatus(D.Q.Connected),this.networker.cleanupSent(),this.networker.resend()),setTimeout((()=>{this.releasePending()}),0))})),this.onMessage=e=>F(this,void 0,void 0,(function*(){let t=yield this.obfuscation.decode(new Uint8Array(e));if(t=this.codec.readPacket(t),this.networker)return this.debug&&this.log.debug("redirecting to networker",t.length),void this.networker.parseResponse(t).then((e=>{this.debug&&this.log.debug("redirecting to networker response:",e);try{this.networker.processMessage(e.response,e.messageId,e.sessionId)}catch(e){this.log.error("handleMessage networker processMessage error",e)}})).catch((e=>{this.log.error("handleMessage networker parseResponse error",e)}));const a=this.pending.shift();a?a.resolve(t):this.debug&&this.log.debug("no pending for res:",E(t))})),this.onClose=()=>{let e,t;if(this.clear(),this.autoReconnect){const a=Date.now(),s=a-this.lastCloseTime;e=!isNaN(s)&&s{if(void 0!==this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0),!this.connection){if(this.log("trying to reconnect..."),this.lastCloseTime=Date.now(),this.networker)this.networker.setConnectionStatus(D.Q.Connecting);else for(const e of this.pending)e.bodySent&&(e.bodySent=!1);this.connect()}};let i=S.v9.Error|S.v9.Log;this.debug&&(i|=S.v9.Debug),this.log=(0,S.kg)(`TCP-${t}`+s,i),this.log("constructor"),this.connect()}clear(){this.connected&&Z.setTransportClosed("websocket"),this.connected=!1,this.connection&&(this.connection.removeEventListener("open",this.onOpen),this.connection.removeEventListener("close",this.onClose),this.connection.removeEventListener("message",this.onMessage),this.connection=void 0)}forceReconnect(){this.close(),this.reconnect()}destroy(){this.setAutoReconnect(!1),this.close(),this.obfuscation&&this.obfuscation.destroy(),this.pending.forEach((e=>{e.reject&&e.reject()})),this.pending.length=0}close(){const e=this.connection;if(e){const t=this.connected;this.clear(),t&&(e.addEventListener("message",this.onMessage),e.addEventListener("close",(()=>{e.removeEventListener("message",this.onMessage)}),{once:!0}),e.close())}}setAutoReconnect(e){this.autoReconnect=e,e?this.connection||void 0!==this.reconnectTimeout||this.reconnect():void 0!==this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0)}connect(){this.connection&&this.close(),this.connection=new this.Connection(this.dcId,this.url,this.logSuffix),this.connection.addEventListener("open",this.onOpen),this.connection.addEventListener("close",this.onClose),this.connection.addEventListener("message",this.onMessage)}changeUrl(e){this.url!==e&&(this.url=e,this.forceReconnect())}encodeBody(e){const t=this.codec.encodePacket(e);return this.obfuscation.encode(t)}send(e){this.debug&&this.log.debug("-> body length to pending:",e.length);const t=void 0;if(!this.networker){const a=new Promise(((a,s)=>{this.pending.push({resolve:a,reject:s,body:e,encoded:t})}));return this.releasePending(),a}this.pending.push({body:e,encoded:t}),this.releasePending()}releasePending(){var e;return F(this,void 0,void 0,(function*(){if(!this.connected||this.releasingPending)return;this.releasingPending=!0;let t=this.pending.length,a=!1;for(let s=0;s body length to send:",i.length);const r=null!==(e=n.encoded)&&void 0!==e?e:n.encoded=yield this.encodeBody(i);if(!this.connected)break;this.connection.send(r),n.resolve?n.bodySent=!0:(this.pending.splice(s--,1),t--),a=!0}}this.releasingPending=void 0,this.pending.length&&a&&this.releasePending()}))}}const x=b.Z.test?"_test":"";function B(e){return"client"===e?"":"-1"}function V(e,t,a){const s=B(t),n="client"!==t?"apiws"+x+(a?"_premium":""):"apiws"+x;return`wss://${_.Z.suffix.toLowerCase()}ws${e}${s}.web.telegram.org/${n}`}class O{constructor(){this.sslSubdomains=["pluto","venus","aurora","vesta","flora"],this.dcOptions=b.Z.test?[{id:1,host:"149.154.175.10",port:80},{id:2,host:"149.154.167.40",port:80},{id:3,host:"149.154.175.117",port:80}]:[{id:1,host:"149.154.175.50",port:80},{id:2,host:"149.154.167.50",port:80},{id:3,host:"149.154.175.100",port:80},{id:4,host:"149.154.167.91",port:80},{id:5,host:"149.154.171.5",port:80}],this.chosenServers={},this.transportSocket=(e,t,a)=>{const s=V(e,t,a);let n;return n=C,new R(n,e,s,"upload"===t?"-U":"download"===t?"-D":"",1e4)},this.transportHTTP=(e,t,a)=>{let s;if(b.Z.ssl||!b.Z.http){const a=B(t);s="https://"+(this.sslSubdomains[e-1]+a)+".web.telegram.org/"+(b.Z.test?"apiw_test1":"apiw1")}else for(const t of this.dcOptions)if(t.id===e){s="http://"+t.host+(80!==t.port?":"+t.port:"")+"/apiw1";break}return new I(e,s,"upload"===t?"-U":"download"===t?"-D":"")}}chooseServer(e,t="client",a=b.Z.transport,s=!0,n){this.chosenServers.hasOwnProperty(a)||(this.chosenServers[a]={client:{},download:{},upload:{}});const i=this.chosenServers[a][t];e in i||(i[e]=[]);const r=i[e];if(!r.length||!s){let i;return i=("websocket"===a?this.transportSocket:this.transportHTTP)(e,t,n),i?(s&&r.push(i),i):(console.error("No chosenServer!",e),null)}return r[0]}static removeTransport(e,t){for(const a in e)for(const s in e[a])for(const n in e[a][s]){const i=e[a][s][n];(0,M.Z)(i,t)}}}var L=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};class N extends p.Z{constructor(){super(!0),this.opened=new Map,this.addEventListener("change",(e=>{e.get("websocket")||this.waitForWebSocket()}))}pingTransports(){var e;return L(this,void 0,void 0,(function*(){const t=null!==(e=this.dcConfigurator)&&void 0!==e?e:this.dcConfigurator=new O,a=this.transports={https:t.chooseServer(_.Z.baseDcId,"client","https",!1),websocket:t.chooseServer(_.Z.baseDcId,"client","websocket",!1)},s=(0,v.Z)();this.transports.https._send(new Uint8Array,"no-cors").then((()=>s.resolve(!0)),(()=>s.resolve(!1))),setTimeout((()=>s.resolve(!1)),2e3);const n=(0,v.Z)(),i=a.websocket;i.setAutoReconnect(!1),i.connection.addEventListener("close",(()=>n.resolve(!1)),{once:!0}),i.connection.addEventListener("open",(()=>n.resolve(!0)),{once:!0}),setTimeout((()=>{n.isFulfilled||n.isRejected||(i.connection&&i.connection.close(),n.resolve(!1))}),2e3);const[r,o]=yield Promise.all([s,n]);for(const e in a)a[e].destroy();return{https:r||this.opened.get("https")>0,websocket:o||this.opened.get("websocket")>0}}))}waitForWebSocket(){return L(this,void 0,void 0,(function*(){if(!this.pinging){for(this.pinging=!0;;){const{https:e,websocket:t}=yield this.pingTransports();if((e||t)&&this.dispatchEvent("transport",t||!e?"websocket":"https"),t)break;yield(0,P.Z)(1e4)}this.pinging=!1}}))}setTransportValue(e,t){let a=this.opened.get(e)||0;a+=t?1:-1,this.opened.set(e,a),this.dispatchEvent("change",this.opened)}setTransportOpened(e){return this.setTransportValue(e,!0)}setTransportClosed(e){return this.setTransportValue(e,!1)}}const Z=new N,j=(0,v.Z)();var q=a(6654);class G{setManagers(e){Object.assign(this,e)}}var H=a(3127),W=a(3989),z=a(5466);let K;function J(e){return null!=K?K:K=function(e){return t=this,a=void 0,n=function*(){const t=(0,z.$)((0,S.kg)("STORAGES-LOADER")),a=Object.keys(e),s=a.map((a=>{const s=e[a].getAll();return t(s,"storage "+a)})),n={},i=yield Promise.all(s);for(let e=0,t=a.length;e({storage:this.storages[e],results:t[e]})))},new((s=void 0)||(s=Promise))((function(e,i){function r(e){try{p(n.next(e))}catch(e){i(e)}}function o(e){try{p(n.throw(e))}catch(e){i(e)}}function p(t){var a;t.done?e(t.value):(a=t.value,a instanceof s?a:new s((function(e){e(a)}))).then(r,o)}p((n=n.apply(t,a||[])).next())}));var t,a,s,n}}class Q extends G{getState(){return this.apiManager.invokeApi("account.getPassword").then((e=>e))}updateSettings(e={}){return this.getState().then((t=>{let a,s;const n={password:null,new_settings:{_:"account.passwordInputSettings",hint:e.hint,email:e.email}};a=e.currentPassword?this.cryptoWorker.invokeCrypto("computeSRP",e.currentPassword,t,!1):Promise.resolve({_:"inputCheckPasswordEmpty"});const i=t.new_algo,r=new Uint8Array(i.salt1.length+32);return k(r),r.set(i.salt1,0),i.salt1=r,s=e.newPassword?this.cryptoWorker.invokeCrypto("computeSRP",e.newPassword,t,!0):Promise.resolve(new Uint8Array),Promise.all([a,s]).then((e=>(n.password=e[0],n.new_settings.new_algo=i,n.new_settings.new_password_hash=e[1],this.apiManager.invokeApi("account.updatePasswordSettings",n))))}))}getInputCheckPassword(e,t){return this.cryptoWorker.invokeCrypto("computeSRP",e,t,!1)}check(e,t,a={}){return this.getInputCheckPassword(e,t).then((e=>this.apiManager.invokeApi("auth.checkPassword",{password:e},a).then((e=>("auth.authorization"===e._&&this.apiManager.setUser(e.user),e)))))}confirmPasswordEmail(e){return this.apiManager.invokeApi("account.confirmPasswordEmail",{code:e})}resendPasswordEmail(){return this.apiManager.invokeApi("account.resendPasswordEmail")}cancelPasswordEmail(){return this.apiManager.invokeApi("account.cancelPasswordEmail")}}var Y=a(6848),X=a(5471);class ee extends G{constructor(){super(...arguments),this.contexts=new Map,this.links={},this.log=(0,S.kg)("RD",void 0,!0)}saveContext(e,t,a){[a,e]=this.getContexts(e),a||(a=new Set,this.contexts.set(e,a)),this.links[E(e)]=e;for(const e of a)if((0,Y.Z)(e,t))return;a.add(t)}getReferenceByLink(e){return this.links[E(e)]}getContexts(e){return[this.contexts.get(e)||(e=this.getReferenceByLink(e)||e,this.contexts.get(e)),e]}getContext(e){const t=this.getContexts(e);return t[0]?[t[0].values().next().value,t[1]]:void 0}deleteContext(e,t,a){if([a,e]=this.getContexts(e),a)for(const s of a)if((0,Y.Z)(s,t))return a.delete(s),a.size||(this.contexts.delete(e),delete this.links[E(e)]),!0;return!1}refreshReference(e,t){if(this.log("refreshReference: start",e.slice(),t),!t){const a=this.getContext(e);if(!a)return this.log("refreshReference: got no context for reference:",e.slice()),Promise.reject("NO_CONTEXT");[t,e]=a}let a;switch(null==t?void 0:t.type){case"message":a=this.appMessagesManager.reloadMessages(t.peerId,t.messageId,!0);break;case"emojiesSounds":a=this.refreshEmojiesSoundsPromise||this.appStickersManager.getAnimatedEmojiSounds(!0).then((()=>{this.refreshEmojiesSoundsPromise=void 0}));break;case"userFull":a=Promise.resolve(this.appProfileManager.getProfile(t.userId,!0));break;case"customEmoji":a=this.appEmojiManager.getCustomEmojiDocuments([t.docId]);break;case"attachMenuBotIcon":a=this.appAttachMenuBotsManager.getAttachMenuBot(t.botId,!0);break;case"wallPaper":a=this.appThemesManager.getWallPaperById(t.wallPaperId);break;default:return this.log.warn("refreshReference: not implemented context",t),Promise.reject()}const s=E(e);return this.log("refreshReference: refreshing reference:",s),a.then((()=>{const a=E(e);if(this.log("refreshReference: refreshed, reference before:",s,"after:",a),s!==a)return e;this.deleteContext(e,t);const n=this.getContext(e);if(n)return this.refreshReference(e,n[0]);throw this.log.error("refreshReference: no new context, reference before:",s,"after:",a,t),(0,X.Z)("NO_NEW_CONTEXT")}))}}var te=a(7298),ae=a(7381),se=a(252),ne=a(7625),ie=a(6519);function re(e,t){if(!e)return t;for(var a in e)t.hasOwnProperty(a)||delete e[a];for(var a in t)e[a]=t[a];return e}var oe=a(2790),pe=a(3781),de=a(3385),fe=a(5880),ce=a(8050),le=a(2946);function me(e){var t,a;const s=[e.fromId,e.viaBotId,e.fwdFromId],n=e.media;if(n){const e=n.user_id;void 0!==e&&s.push(e.toPeerId());const t=n.results,a=null==t?void 0:t.recent_voters;(null==a?void 0:a.length)&&s.push(...a.map((e=>e.toPeerId())))}const i=null===(t=e.reactions)||void 0===t?void 0:t.recent_reactions;(null==i?void 0:i.length)&&s.push(...i.map((e=>(0,le.Z)(e.peer_id))));const r=e.action;if(r){const e=[...r.users||[],r.user_id,r.inviter_id];s.push(...e.filter(Boolean).map((e=>e.toPeerId())));const t=[r.channel_id,r.chat_id];s.push(...t.filter(Boolean).map((e=>e.toPeerId(!0))))}const o=null===(a=e.replies)||void 0===a?void 0:a.recent_repliers;return(null==o?void 0:o.length)&&s.push(...o.map((e=>(0,le.Z)(e)))),new Set(s.filter(Boolean))}var ge=a(8027);function he(e,t,a){return e[t]=a}var ue=a(8938);const ye=void 0;class _e extends G{constructor(){super(...arguments),this.clear=(e=!1)=>{if(e){this.allDialogsLoaded={},this.pinnedOrders={};for(const e of o.DZ)this.pinnedOrders[e]=[]}else{this.storage.clear(),this.allDialogsLoaded={},this.saveAllDialogsLoaded(),this.pinnedOrders=Object.assign({},this.pinnedOrders);for(const e of o.DZ)this.resetPinnedOrder(e);this.savePinnedOrders()}this.forumTopics=new Map,this.folders={},this.dialogsOffsetDate={},this.dialogsNum=0,this.dialogsIndex=new ae.Z({clearBadChars:!0,ignoreCase:!0,latinize:!0,includeTag:!0}),this.cachedResults={query:"",count:0,dialogs:[],folderId:0}},this.onUpdateFolderPeers=e=>{e.folder_peers.forEach((e=>{var t;const{folder_id:a,peer:s}=e,n=this.appPeersManager.getPeerId(s),i=this.dropDialog(n)[0];i&&((null===(t=i.pFlags)||void 0===t?void 0:t.pinned)&&this.handleDialogUnpinning(i,a),i.folder_id=a,this.generateIndexForDialog(i),this.pushDialog({dialog:i})),this.appMessagesManager.scheduleHandleNewDialogs(n,i)}))},this.onUpdateDialogPinned=e=>{var t;const a=null!==(t=e.folder_id)&&void 0!==t?t:o.J$,s=this.appPeersManager.getPeerId(e.peer.peer),n=this.getDialogOnly(s);this.handleDialogTogglePinned(n,e.pFlags.pinned,a)},this.onUpdateChannelPinnedTopic=e=>{const t=e.channel_id.toPeerId(!0),a=(0,pe.Z)(e.topic_id),s=this.getForumTopic(t,a);s&&this.handleDialogTogglePinned(s,e.pFlags.pinned,this.getFilterIdForForum(s))},this.onUpdatePinnedDialogs=e=>{var t;const a=null!==(t=e.folder_id)&&void 0!==t?t:o.J$;e.order?this.handleDialogsPinned(a,e.order.map((e=>this.appPeersManager.getPeerId(e.peer)))):this.apiManager.invokeApi("messages.getPinnedDialogs",{folder_id:a}).then((e=>{this.applyDialogs(e),this.handleDialogsPinned(a,e.dialogs.map((e=>e.peerId)))}))},this.onUpdateChannelPinnedTopics=e=>{return t=this,a=void 0,n=function*(){const t=e.channel_id.toPeerId(!0);if(!this.forumTopics.get(t))return;const a=t;if(e.order){const t=e.order.map((e=>(0,pe.Z)(e)));this.handleDialogsPinned(a,t)}else{const e=yield this.apiManager.getLimit("topicPin",!0),s=this.apiManager.invokeApi("channels.getForumTopics",{channel:this.appChatsManager.getChannelInput(t.toChatId()),limit:e,offset_date:0,offset_id:0,offset_topic:0}),n=(yield this.processTopics(t,s)).topics.filter((e=>e.pFlags.pinned));this.handleDialogsPinned(a,n.map((e=>e.id)))}},new((s=void 0)||(s=Promise))((function(e,i){function r(e){try{p(n.next(e))}catch(e){i(e)}}function o(e){try{p(n.throw(e))}catch(e){i(e)}}function p(t){var a;t.done?e(t.value):(a=t.value,a instanceof s?a:new s((function(e){e(a)}))).then(r,o)}p((n=n.apply(t,a||[])).next())}));var t,a,s,n}}after(){this.clear(!0),this.rootScope.addEventListener("language_change",(()=>{const e=this.appUsersManager.getSelf().id.toPeerId(!1);if(this.getDialogOnly(e)){const t=this.appPeersManager.getPeerSearchText(e);this.dialogsIndex.indexObject(e,t)}}));const e=e=>{const t=this.getCachedDialogs(!1);for(let a=0;a{const e=this.getCachedDialogs(!1);for(const e in this.folders)+e>1&&delete this.folders[e];for(let t=0;t{const t=this.getCachedDialogs(!1),a=this.getDialogIndexKeyByFilterId(e.id);for(let e=0;e{this.processChangedUnreadOrUnmuted(e.peerId)})),this.rootScope.addEventListener("chat_update",(e=>{const t=this.appChatsManager.getChat(e),a=e.toPeerId(!0);t.pFlags.left&&this.getDialogOnly(a)&&this.dropDialogOnDeletion(a)})),this.rootScope.addEventListener("chat_toggle_forum",(({chatId:e,enabled:t})=>{const a=e.toPeerId(!0);t||this.flushForumTopicsCache(a),this.processChangedUnreadOrUnmuted(a)})),this.apiUpdatesManager.addMultipleEventsListeners({updateFolderPeers:this.onUpdateFolderPeers,updateDialogPinned:this.onUpdateDialogPinned,updateChannelPinnedTopic:this.onUpdateChannelPinnedTopic,updatePinnedDialogs:this.onUpdatePinnedDialogs,updateChannelPinnedTopics:this.onUpdateChannelPinnedTopics}),Promise.all([this.appStateManager.getState(),this.appStoragesManager.loadStorage("dialogs")]).then((([e,{results:t,storage:a}])=>{this.storage=a,this.dialogs=this.storage.getCache();for(const t of o.DZ){const a=e.pinnedOrders[t];if(!a)continue;const s=this.getPinnedOrders(t);s.splice(0,s.length,...a)}t.length&&W.Z.freezeSaving(this.setDialogsFromState.bind(this,t),["chats","dialogs","messages","users"]),this.allDialogsLoaded=e.allDialogsLoaded||{},t.length&&this.appDraftsManager.addMissedDialogs()}))}setDialogsFromState(e){for(let t=0,a=e.length;tthis.allDialogsLoaded[e]))&&(this.allDialogsLoaded[void 0]=!0),this.saveAllDialogsLoaded())}saveAllDialogsLoaded(){this.appStateManager.pushToState("allDialogsLoaded",this.allDialogsLoaded)}handleDialogUnpinning(e,t){delete e.pFlags.pinned,(0,M.Z)(this.getPinnedOrders(t),this.isFilterIdForForum(t)?e.id:e.peerId),this.savePinnedOrders()}savePinnedOrders(){this.appStateManager.pushToState("pinnedOrders",this.pinnedOrders)}resetPinnedOrder(e){this.getPinnedOrders(e).length=0}getPinnedOrders(e){let t=this.pinnedOrders[e];return!t&&this.isFilterIdForForum(e)&&((0,ge.Z)(this.pinnedOrders,[e]),t=this.pinnedOrders[e]=[]),t}isDialogPinned(e,t){const a=this.filtersStorage.getFilter(t);let s;return s=a?-1!==a.pinnedPeerIds.indexOf(e):!!this.getDialogOnly(e).pFlags.pinned,s}getOffsetDate(e){const t=this.dialogsOffsetDate[e]||0;return e!==ye||t?t:Math.min(...Array.from(o.DZ).sort(((e,t)=>e-t)))}generateFolder(e){const t={dialogs:[],id:e,unreadMessagesCount:0,unreadPeerIds:new Set,unreadUnmutedPeerIds:new Set};return(0,ge.Z)(t,["dispatchUnreadTimeout"]),t}getFolder(e){var t,a;return null!==(t=(a=this.folders)[e])&&void 0!==t?t:a[e]=this.generateFolder(e)}isFilterIdForForum(e){return e&&e<0}getFilterIdForForum(e){return e.peerId}getDialogKey(e){return this.isTopic(e)?e.id:e.peerId}getFolderDialogs(e,t=!0){if(e===ye)return this.getCachedDialogs(t);const a=this.getFolder(e);return this.isFilterIdForForum(e)?t?a.dialogs.filter((e=>!e.pFlags.hidden)):a.dialogs:t?a.dialogs.filter((e=>void 0===e.migratedTo)):a.dialogs}getNextDialog(e,t,a){const s=this.getFolderDialogs(a,!0);let n;if(e){const a=s.findIndex((t=>t.peerId===e));-1!==a&&(n=s[t?a+1:a-1])}else t&&(n=s[0]);return n}getDialogIndexKeyByFilterId(e){if(this.isFilterIdForForum(e))return(0,de.Z)();if(o.DZ.has(e))return(0,de.Z)(e);const t=this.filtersStorage.getFilter(e);return(0,de.Z)(t.localId)}isDialogUnmuted(e){return!this.appNotificationsManager.isPeerLocalMuted({peerId:e.peerId,respectType:!0,threadId:this.isTopic(e)?e.id:void 0})}getFolderUnreadCount(e){const t=this.getFolder(e);return{unreadUnmutedCount:t.unreadUnmutedPeerIds.size,unreadCount:t.unreadPeerIds.size}}getCachedDialogs(e){const t=Array.from(o.DZ).map((t=>this.getFolderDialogs(t,e)));return[].concat(...t)}setDialogIndexInFilter(e,t,a){var s,n;let i;const r=this.isTopic(e),p=r||o.DZ.has(a.id);if(this.filtersStorage.testDialogForFilter(e,a)){const t=r?this.getPinnedOrders(this.getFilterIdForForum(e)):a.pinnedPeerIds,o=this.getDialogKey(e),d=t.indexOf(o);i=-1!==d?this.generateDialogIndex(this.generateDialogPinnedDateByIndex(t.length-1-d),!0):(null===(s=e.pFlags)||void 0===s?void 0:s.pinned)||p?this.generateIndexForDialog(e,!0,void 0,!p):null!==(n=(0,ce.Z)(e))&&void 0!==n?n:this.generateIndexForDialog(e,!0)}return he(e,t,i)}getDialog(e,t,a,s=!0){const n=[];a&&(t=e),void 0===t?n.push(...Array.from(o.DZ).map((e=>this.getFolder(e).dialogs))):n.push(this.getFolderDialogs(t,!1));const i=a?e=>e.id===a:t=>t.peerId===e;for(const e of n){let t=0,a=0;for(let n=e.length;tt.id===e.id:t=>t.peerId===e.peerId,d=r.findIndex(p),f=r[d],c=this.getDialogIndex(f,i);a&&n>o.Zi&&(a=void 0);const l=a?void 0:this.setDialogIndexInFilter(e,i,t);return c!==l&&(!!c!=!!l&&this.prepareFolderUnreadCountModifyingByDialog(n,e,!!l),-1!==d&&r.splice(d,1),l&&(0,ie.Z)(r,e,(e=>this.getDialogIndex(e,i)),-1),!0)}prepareDialogUnreadCountModifying(e,t){const a=this.isTopic(e),s=[],n=a?this.getFilterIdForForum(e):e.folder_id;if(s.push(this.prepareFolderUnreadCountModifyingByDialog(n,e,t)),!a){const a=this.filtersStorage.getFilters();for(const n in a){const i=a[n];this.filtersStorage.testDialogForFilter(e,i)&&s.push(this.prepareFolderUnreadCountModifyingByDialog(i.id,e,t))}}return()=>!t&&s.forEach((e=>e()))}prepareFolderUnreadCountModifyingByDialog(e,t,a){const s=this.appMessagesManager.getDialogUnreadCount(t),n=this.isDialogUnmuted(t);if(void 0===a)return()=>{const a=this.appMessagesManager.getDialogUnreadCount(t),n=this.isDialogUnmuted(t),i=a-s;this.modifyFolderUnreadCount(e,i,!!a,a&&n,t)};{const i=a?s:-s;this.modifyFolderUnreadCount(e,i,!!s,s&&n,t)}}modifyFolderUnreadCount(e,t,a,s,n){var i;const{peerId:r}=n,o=this.appPeersManager.isForum(r),p=this.isTopic(n);if(o&&!p){const i=this.getForumUnreadCount(r);if(i instanceof Promise)return void i.then((({count:t,hasUnmuted:a})=>{n=this.getDialogOnly(r);const s=this.getFolder(e);n&&this.appPeersManager.isForum(r)&&s&&s.dialogs.some((e=>e.peerId===r))&&this.modifyFolderUnreadCount(e,0,!1,!1,n)}));t=0,a=i.count>0,s=i.hasUnmuted}const d=this.getFolder(e);t&&(d.unreadMessagesCount=Math.max(0,d.unreadMessagesCount+t));const f=this.getDialogKey(n);a?d.unreadPeerIds.add(f):d.unreadPeerIds.delete(f),s?d.unreadUnmutedPeerIds.add(f):d.unreadUnmutedPeerIds.delete(f),null!==(i=d.dispatchUnreadTimeout)&&void 0!==i||(d.dispatchUnreadTimeout=T.Z.setTimeout((()=>{d.dispatchUnreadTimeout=void 0;const e=Object.assign({},d);delete e.dialogs,this.rootScope.dispatchEvent("folder_unread",e),p&&this.processChangedUnreadOrUnmuted(r)}),0))}processChangedUnreadOrUnmuted(e){const t=this.getDialogOnly(e);t&&(this.processDialogForFilters(t),this.prepareDialogUnreadCountModifying(t)(),this.rootScope.dispatchEvent("dialog_unread",{peerId:e,dialog:t}))}generateIndexForDialog(e,t,a,s){var n;if(!t)return;const i=this.isTopic(e);let r,o=0;if(e.pFlags.hidden)o=this.generateDialogPinnedDateByIndex(4095),r=!0;else if(e.pFlags.pinned&&!s)o=this.generateDialogPinnedDate(e),r=!0;else{if(a||(a=this.appMessagesManager.getMessageByPeer(e.peerId,e.top_message)),o=(null==a?void 0:a.date)||o,!i){const t=this.appPeersManager.isChannel(e.peerId)&&e.peerId.toChatId();if(t){const e=this.appChatsManager.getChat(t);(!o||e.date&&e.date>o)&&(o=e.date)}}"draftMessage"===(null===(n=e.draft)||void 0===n?void 0:n._)&&e.draft.date>o&&(o=e.draft.date)}o||(o=(0,te.Z)(!0));const p=this.generateDialogIndex(o,r);if(t)return p;he(e,(0,de.Z)(e.folder_id),p)}generateDialogPinnedDateByIndex(e){return 2147418112+(65535&e)}generateDialogPinnedDate(e){const t=this.isTopic(e),a=this.getPinnedOrders(t?this.getFilterIdForForum(e):e.folder_id),s=this.getDialogKey(e);let n=a.indexOf(s);return-1===n&&(a.unshift(s),n=0,t||this.savePinnedOrders()),this.generateDialogPinnedDateByIndex(a.length-1-n)}setDialogToState(e){if(this.isTopic(e))return;const{peerId:t,pts:a}=e,s=this.appMessagesManager.getHistoryStorage(t),n=this.appMessagesManager.getHistoryMessagesStorage(t),i=s.history.slice;let r;for(let e=0,a=i.length;e{"dialogFolder"===t._&&e.dialogs.splice(a,1)})),(0,ue.Z)(s),this.appUsersManager.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats),this.appMessagesManager.saveMessages(e.messages);const n=new Map;s.forEach((e=>{var t,s;const i=this.appPeersManager.getPeerId(e.peer);let r=e.top_message;const o=this.appMessagesManager.pendingTopMsgs[i];if(o){const t=this.appMessagesManager.getMessageByPeer(i,o),a=this.appMessagesManager.getMessageByPeer(i,r);(!r||t&&(!a||(null==t?void 0:t.date)>(null==a?void 0:a.date)))&&(e.top_message=r=o,this.appMessagesManager.getHistoryStorage(i).maxId=o)}if(r||"draftMessage"===(null===(t=e.draft)||void 0===t?void 0:t._)){if(this.saveDialog({dialog:e})){const t=(e=>{let t=n.get(e);return t||n.set(e,t={}),t})(i);a?(null!==(s=t.topics)&&void 0!==s?s:t.topics=new Map).set(e.id,e):t.dialog=e}}else this.dropDialogWithEvent(i,a?this.getDialogKey(e):void 0);const p=this.appMessagesManager.getUpdateAfterReloadKey(i,a?this.getDialogKey(e):void 0),d=this.appMessagesManager.newUpdatesAfterReloadToHandle[p];if(void 0!==d){for(const e of d)d.delete(e),this.apiUpdatesManager.saveUpdate(e);d.size||delete this.appMessagesManager.newUpdatesAfterReloadToHandle[p]}})),n.size&&this.rootScope.dispatchEvent("dialogs_multiupdate",n)}getDialogOffsetDate(e){const t=this.appMessagesManager.getMessageByPeer(e.peerId,e.top_message);return(null==t?void 0:t.date)||0}canSaveDialogByPeerId(e){if(e.isAnyChat()){const t=this.appChatsManager.getChat(e.toChatId());if("channelForbidden"===t._||t.pFlags.left)return!1}return!0}saveDialog({dialog:e,folderId:t,ignoreOffsetDate:a,saveGlobalOffset:s}){var n,i;const r=this.isTopic(e),p=!r,d=r?e.id=(0,pe.Z)(e.id):void 0;r||null!=t||(t=null!==(n=e.folder_id)&&void 0!==n?n:o.J$);const f=this.appPeersManager.getPeerId(e.peer);if(!f)return console.error("saveConversation no peerId???",e,t),!1;if(r||"dialog"===e._||console.error("saveConversation not regular dialog",e,Object.assign({},e)),p&&!this.canSaveDialogByPeerId(f))return!1;const c=this.appPeersManager.isChannel(f)?f.toChatId():o.NM;if(p){const e=this.appPeersManager.getPeerSearchText(f);this.dialogsIndex.indexObject(f,e)}const l=this.getDialogOrTopic(f,d);let m,g;if(e.top_message){m=(0,pe.Z)(e.top_message);const t=(null==l?void 0:l.top_message)&&this.appMessagesManager.getMessageByPeer(f,l.top_message);(null===(i=null==t?void 0:t.pFlags)||void 0===i?void 0:i.is_outgoing)&&l.top_message>=m&&(m=l.top_message),g=this.appMessagesManager.getMessageByPeer(f,m)}else m=this.appMessagesManager.generateTempMessageId(f),g={_:"message",id:m,mid:m,from_id:this.appPeersManager.getOutputPeer(this.appUsersManager.getSelf().id.toPeerId(!1)),peer_id:this.appPeersManager.getOutputPeer(f),deleted:!0,pFlags:{out:!0},date:0,message:""},this.appMessagesManager.saveMessages([g],{isOutgoing:!0});if((null==g?void 0:g.pFlags)||this.appMessagesManager.log.error("saveConversation no message:",e,g),p&&!c&&f.isAnyChat()){const t=this.appChatsManager.getChat(f.toChatId());if(t&&t.migrated_to&&t.pFlags.deactivated){const a=this.appPeersManager.getPeerId(t.migrated_to);this.appMessagesManager.migratedFromTo[f]=a,this.appMessagesManager.migratedToFrom[a]=f,e.migratedTo=a}}if(e.top_message=m,e.read_inbox_max_id=(0,pe.Z)(l&&!e.read_inbox_max_id?l.read_inbox_max_id:e.read_inbox_max_id),e.read_outbox_max_id=(0,pe.Z)(l&&!e.read_outbox_max_id?l.read_outbox_max_id:e.read_outbox_max_id),p&&void 0===e.folder_id&&"dialog"===e._&&(e.folder_id=l?l.folder_id:t),e.draft=this.appDraftsManager.saveDraft({peerId:f,threadId:d,draft:e.draft}),e.peerId=f,g&&g.pFlags.is_outgoing){const t=g.pFlags.out;m>e[t?"read_outbox_max_id":"read_inbox_max_id"]?(g.pFlags.unread=!0,e.unread_count||t||++e.unread_count):delete g.pFlags.unread}const h=this.appMessagesManager.getHistoryStorage(f,d),u=h.history.slice;if(u.length?u.isEnd(se.D.Bottom)||(h.history.insertSlice([m]).setEnd(se.D.Bottom),h.count||(h.count=1),this.appMessagesManager.mergeReplyKeyboard(h,g)&&this.rootScope.dispatchEvent("history_reply_markup",{peerId:f})):(h.history.unshift(m),h.count||(h.count=1),this.appMessagesManager.mergeReplyKeyboard(h,g)&&this.rootScope.dispatchEvent("history_reply_markup",{peerId:f})),h.maxId=m,h.readMaxId=e.read_inbox_max_id,h.readOutboxMaxId=e.read_outbox_max_id,this.appNotificationsManager.savePeerSettings({peerId:f,threadId:r?e.id:void 0,settings:e.notify_settings}),p&&c&&e.pts&&this.apiUpdatesManager.addChannelState(c,e.pts),this.generateIndexForDialog(e),l){const t=this.dialogsStorage.prepareDialogUnreadCountModifying(l);re(l,e),t()}return this.pushDialog({dialog:e,offsetDate:null==g?void 0:g.date,ignoreOffsetDate:a,saveGlobalOffset:s}),r&&this.processTopicUpdate(e,l),!0}processTopicUpdate(e,t){if(!t)return;const{peerId:a,id:s}=e,n=e.icon_emoji_id!==t.icon_emoji_id,i=e.title!==t.title,r=n||i;n&&this.rootScope.dispatchEvent("avatar_update",{peerId:a,threadId:s}),r&&this.rootScope.dispatchEvent("peer_title_edit",{peerId:a,threadId:s})}getDialogs(e){const{query:t="",offsetIndex:a,limit:s=20,filterId:n=o.J$,skipMigrated:i=!1}=e,r=this.isFilterIdForForum(n);if(!r&&!o.DZ.has(n)){const t=[],a=this.appUsersManager.fillContacts();a.cached||t.push(a.promise);const s=this.filtersStorage.reloadMissingPeerIds(n);if(s&&t.push(s),t.length)return Promise.all(t).then((()=>this.getDialogs(e)))}const p=o.DZ.has(n)&&!this.getOffsetDate(n)||r?n:ye;let d=this.getFolderDialogs(n,i);const f=this.getDialogIndexKeyByFilterId(n);if(t&&!r){if(!s||this.cachedResults.query!==t||this.cachedResults.folderId!==n){this.cachedResults.query=t,this.cachedResults.folderId=n;const e=this.dialogsIndex.search(t),a=[];for(const t in this.dialogs){const s=this.dialogs[t];e.has(s.peerId)&&s.folder_id===n&&a.push(s)}a.sort(((e,t)=>this.getDialogIndex(t,f)-this.getDialogIndex(e,f))),this.cachedResults.dialogs=a,this.cachedResults.count=a.length}d=this.cachedResults.dialogs}else this.cachedResults.query="";let c=0;if(a>0)for(let e=d.length;cthis.getDialogIndex(d[c],f));++c);const l=this.isDialogsLoaded(p),m=d.length>=c+s;if(t||l||m){const e=d.slice(c,c+s);return{dialogs:e,count:l?d.length:null,isTopEnd:d.length&&(e[0]&&e[0]===d[0]||this.getDialogIndex(d[0],f)=d.length}}return this.appMessagesManager.getTopMessages({limit:s,folderId:p}).then((e=>{if(i&&(d=this.getFolderDialogs(n,i)),c=0,a>0)for(let e=d.length;cthis.getDialogIndex(d[c],f));++c);const t=d.slice(c,c+s);return{dialogs:t,count:void 0===e.count?d.length:e.count,isTopEnd:d.length&&(t[0]&&t[0]===d[0]||this.getDialogIndex(d[0],f){const t={},a=[];for(const[e,n]of s.getTopicPromises)t[e]=n,a.push((0,oe.Z)(e));s.getTopicPromises.clear();const n=()=>{for(const e in t)t[e].resolve(void 0),s.deletedTopics.add(+e)};if(this.getForumTopicsCache(e)===s)return this.apiManager.invokeApi("channels.getForumTopicsByID",{channel:this.appChatsManager.getChannelInput(e.toChatId()),topics:a}).then((a=>{if(this.getForumTopicsCache(e)===s)return this.applyDialogs(a,e),a.topics.forEach((a=>{"forumTopic"===a._&&(t[a.id].resolve(a),delete t[e])})),a}),(()=>{})).then((()=>{n(),s.getTopicsPromise=void 0,s.getTopicPromises.size&&this.getForumTopicById(e)}));n()}))),n||s.getTopicsPromise}getForumTopic(e,t){var a;const s=this.forumTopics.get(e);return null===(a=null==s?void 0:s.topics)||void 0===a?void 0:a.get(t)}getForumTopicOrReload(e,t){var a;const s=this.getForumTopic(e,t);if(s)return s;const n=this.getForumTopicsCache(e);return(null===(a=null==n?void 0:n.deletedTopics)||void 0===a?void 0:a.has(t))?void 0:this.getForumTopicById(e,t)}processTopics(e,t){return(0,q.Z)(t,(t=>{"pts"in t&&this.apiUpdatesManager.addChannelState(e.toChatId(),t.pts);const a=this.appPeersManager.getOutputPeer(e);return t.topics=t.topics.map((e=>{if("forumTopicDeleted"!==e._)return e.peer=a,e.id=(0,pe.Z)(e.id),e})).filter(Boolean),t}))}processTopicsPromise(e,t){return t.then((t=>(this.processTopics(e,t),t)))}getForumUnreadCount(e){if(!this.appPeersManager.isForum(e))return;const t=this.getFolder(e),a=t.dialogs.length>=20||this.isDialogsLoaded(e)?t.dialogs.slice(0,20):(0,q.Z)(this.getDialogs({filterId:e,limit:20}),(e=>e.dialogs));return(0,q.Z)(a,(e=>({count:e.reduce(((e,t)=>e+ +!!t.unread_count),0),hasUnmuted:e.some((e=>e.unread_count&&this.isDialogUnmuted(e)))})))}handleDialogTogglePinned(e,t,a){e&&(t?e.pFlags.pinned=!0:this.handleDialogUnpinning(e,a),this.generateIndexForDialog(e)),this.appMessagesManager.scheduleHandleNewDialogs(e.peerId,e)}handleDialogsPinned(e,t){const a=this.isFilterIdForForum(e);this.resetPinnedOrder(e),this.getPinnedOrders(e).push(...t),this.savePinnedOrders(),t.reverse();const s={};t.forEach((t=>{s[t]=!0;const n=a?e:t,i=a?t:void 0,r=this.getDialogOrTopic(n,i);this.appMessagesManager.scheduleHandleNewDialogs(n,r),r&&(r.pFlags.pinned=!0,this.generateIndexForDialog(r))}));const n=this.getFolderDialogs(e,!1);for(const e of n){if(!e.pFlags.pinned)break;s[this.getDialogKey(e)]||(delete e.pFlags.pinned,this.generateIndexForDialog(e),this.appMessagesManager.scheduleHandleNewDialogs(e.peerId,e))}}}var ve=a(8479),Pe=a(4064),be=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};const Me=[["pinned_peers","pinnedPeerIds"],["exclude_peers","excludePeerIds"],["include_peers","includePeerIds"]],Se=o.DZ.size,Ie={_:"dialogFilter",pFlags:{},flags:0,id:0,title:"",exclude_peers:[],include_peers:[],pinned_peers:[],excludePeerIds:[],includePeerIds:[],pinnedPeerIds:[]};class Ce extends G{constructor(){super(...arguments),this.clear=e=>{if(e){this.filters={},this.filtersArr=[],this.reloadedPeerIds=new Set,this.localFilters={};for(const e of o.DZ)this.localFilters[e]=this.generateLocalFilter(e)}else this.reloadedPeerIds.clear(),this.clearFilters();this.localId=o.Gu},this.onUpdateDialogFilter=e=>{e.filter?this.saveDialogFilter(e.filter):this.filters[e.id]&&(this.rootScope.dispatchEvent("filter_delete",this.filters[e.id]),delete this.filters[e.id],(0,Pe.Z)(this.filtersArr,(t=>t.id===e.id))),this.pushToState()},this.onUpdateDialogFilters=e=>{const t=(0,ve.Z)(this.filters);this.getDialogFilters(!0).then((e=>{for(const a in t){const t=+a;e.find((e=>e.id===t))||this.onUpdateDialogFilter({_:"updateDialogFilter",id:t})}this.onUpdateDialogFilterOrder({_:"updateDialogFilterOrder",order:e.map((e=>e.id))})}))},this.onUpdateDialogFilterOrder=e=>{const t=e.order.slice();t.includes(o.Zi)||t.splice(t[0]===o.J$?1:0,0,o.Zi),this.localId=o.Gu,t.forEach((e=>{const t=this.filters[e];delete t.localId,this.setLocalId(t)})),this.rootScope.dispatchEvent("filter_order",t),this.pushToState()}}after(){return this.clear(!0),this.apiUpdatesManager.addMultipleEventsListeners({updateDialogFilter:this.onUpdateDialogFilter,updateDialogFilters:this.onUpdateDialogFilters,updateDialogFilterOrder:this.onUpdateDialogFilterOrder}),this.rootScope.addEventListener("premium_toggle",(()=>{this.onUpdateDialogFilters({_:"updateDialogFilters"})})),this.appStateManager.getState().then((e=>{this.prependFilters(e.filtersArr).map((e=>{this.saveDialogFilter(e,!1,!0)}))}))}prependFilters(e){e=e.slice();const t=this.localFilters[o.J$],a=this.localFilters[o.Zi],s=e.findIndex((e=>"dialogFilterDefault"===e._||e.id===o.J$));return-1!==s?e[s]=t:e.unshift(t),(0,Pe.Z)(e,(e=>e.id===o.Zi)),e.splice(e[0]===t?1:0,0,a),this.localId=o.Gu,e.forEach((e=>{delete e.localId})),e}generateLocalFilter(e){const t=Object.assign(Object.assign({},(0,ve.Z)(Ie)),{id:e});return e===o.J$?t.pFlags.exclude_archived=!0:e===o.Zi&&(t.pFlags.exclude_unarchived=!0),o.DZ.has(e)&&(t.pinnedPeerIds=this.dialogsStorage.getPinnedOrders(e)),t}pushToState(){this.appStateManager.pushToState("filtersArr",this.filtersArr)}testDialogForFilter(e,t){if(!t)return!0;if(o.DZ.has(t.id))return e.folder_id===t.id&&this.dialogsStorage.canSaveDialogByPeerId(e.peerId);const a=e.peerId;if(!this.appMessagesManager.getDialogOnly(a))return!1;if(t.excludePeerIds.includes(a))return!1;if(t.includePeerIds.includes(a))return!0;const s=t.pFlags;if(s.exclude_archived&&e.folder_id===o.Zi)return!1;if(s.exclude_read&&!this.appMessagesManager.isDialogUnread(e))return!1;if(s.exclude_muted&&this.appNotificationsManager.isPeerLocalMuted({peerId:a})&&(!e.unread_mentions_count||!e.unread_count))return!1;if(this.appPeersManager.isAnyChat(a)){if(s.broadcasts&&this.appPeersManager.isBroadcast(a))return!0;if(s.groups&&this.appPeersManager.isAnyGroup(a))return!0}else{const e=a.toUserId();if(this.appUsersManager.isBot(e))return!!s.bots;if(s.non_contacts&&!this.appUsersManager.isContact(e))return!0;if(s.contacts&&this.appUsersManager.isContact(e))return!0}return!1}testDialogForFilterId(e,t){return this.testDialogForFilter(e,this.filters[t])}getFilter(e){return this.filters[e]}getFilters(){return this.filters}clearFilters(){const e=this.getFilters();for(const t in e)o.DZ.has(+t)||this.onUpdateDialogFilter({_:"updateDialogFilter",id:+t})}toggleDialogPin(e,t){return be(this,void 0,void 0,(function*(){const a=this.filters[t],s=a.pinnedPeerIds.indexOf(e),n=-1!==s;if(n&&(a.pinned_peers.splice(s,1),a.pinnedPeerIds.splice(s,1)),!n){if(a.pinned_peers.length>=(yield this.apiManager.getConfig()).pinned_infolder_count_max)return Promise.reject((0,X.Z)("PINNED_DIALOGS_TOO_MUCH"));a.pinned_peers.unshift(this.appPeersManager.getInputPeerById(e)),a.pinnedPeerIds.unshift(e)}return this.updateDialogFilter(a)}))}createDialogFilter(e,t){const a=Math.max(1,...Object.keys(this.filters).map((e=>+e)));return(e=(0,ve.Z)(e)).id=a+1,this.updateDialogFilter(e,void 0,t)}updateDialogFilter(e,t=!1,a=!1){const s=t?0:1;return this.apiManager.invokeApi("messages.updateDialogFilter",{flags:s,id:e.id,filter:t?void 0:this.getOutputDialogFilter(e)}).then((s=>{if(this.onUpdateDialogFilter({_:"updateDialogFilter",id:e.id,filter:t?void 0:e}),a){const t=[];for(const e in this.filters){const a=this.filters[e];++a.localId,t.push(a)}e.localId=o.Gu;const a=t.sort(((e,t)=>e.localId-t.localId)).map((e=>e.id));this.onUpdateDialogFilterOrder({_:"updateDialogFilterOrder",order:a})}}))}updateDialogFiltersOrder(e){return this.apiManager.invokeApi("messages.updateDialogFiltersOrder",{order:e}).then((()=>{this.onUpdateDialogFilterOrder({_:"updateDialogFilterOrder",order:e})}))}getOutputDialogFilter(e){const t=(0,ve.Z)(e);return this.filterIncludedPinnedPeers(e),t}filterIncludedPinnedPeers(e){(0,ne.Z)(e.includePeerIds,((t,a)=>{e.pinnedPeerIds.includes(t)&&(e.include_peers.splice(a,1),e.includePeerIds.splice(a,1))}))}reloadMissingPeerIds(e,t="pinned_peers"){const a=this.getFilter(e),s=null==a?void 0:a[t];if(!(null==s?void 0:s.length))return;const n=s.filter((e=>{const t=this.appPeersManager.getPeerId(e),a=this.reloadedPeerIds.has(t),s=this.appMessagesManager.getDialogOnly(t);return!a&&!s}));if(!n.length)return;const i=n.map((e=>{const t=this.appPeersManager.getPeerId(e);return this.appMessagesManager.reloadConversation(e).then((e=>(this.reloadedPeerIds.add(t),e?void 0:t)))}));return Promise.all(i).then((e=>{(e=e.filter(Boolean)).length}))}getDialogFilters(e=!1){return be(this,void 0,void 0,(function*(){const t=Object.keys(this.filters);if(t.length>Se&&!e)return t.map((e=>this.filters[e])).sort(((e,t)=>e.localId-t.localId));const a=yield this.apiManager.invokeApiSingle("messages.getDialogFilters");return this.prependFilters(a).map((t=>this.saveDialogFilter(t,e))).filter(Boolean)}))}getSuggestedDialogsFilters(){return this.apiManager.invokeApi("messages.getSuggestedDialogFilters")}saveDialogFilter(e,t=!0,a){"dialogFilterDefault"===e._&&(e=this.localFilters[o.J$]),(0,ue.Z)(e),o.DZ.has(e.id)||(Me.forEach((([t,a])=>{(0,ue.Z)(e),e[a]=e[t].map((e=>this.appPeersManager.getPeerId(e)))})),this.filterIncludedPinnedPeers(e),e.include_peers=e.pinned_peers.concat(e.include_peers),e.includePeerIds=e.pinnedPeerIds.concat(e.includePeerIds));const s=this.filters[e.id];return s?Object.assign(s,e):this.filters[e.id]=e,this.setLocalId(e),a||(t?this.rootScope.dispatchEvent("filter_update",e):s||this.rootScope.dispatchEvent("filter_new",e)),e}setLocalId(e){void 0!==e.localId?e.localId>=this.localId&&(this.localId=e.localId+1):(e.localId=this.localId++,(0,Pe.Z)(this.filtersArr,(t=>t.id===e.id)),this.filtersArr.push(e),this.pushToState())}isFilterIdAvailable(e){return be(this,void 0,void 0,(function*(){if(o.DZ.has(e))return!0;const t=yield this.apiManager.getLimit("folders");return this.filtersArr.filter((e=>!o.DZ.has(e.id))).slice(0,t).some((t=>t.id===e))}))}}var ke=a(6690),we=a(2821);function Ae(e,t){t.forEach((t=>{Object.getOwnPropertyNames(t.prototype).forEach((a=>{const s=Object.getOwnPropertyDescriptor(t.prototype,a)||Object.create(null);"constructor"!==a&&Object.defineProperty(e.prototype,a,s)}))}))}class Ue{constructor(){this.updatesState={pendingPtsUpdates:[],pendingSeqUpdates:{},syncPending:null,syncLoading:null},this.channelStates={},this.attached=!1,this.log=(0,S.kg)("UPDATES",S.v9.Error|S.v9.Warn|S.v9.Log),this.debug=d.ZP,this.subscriptions={},this.processUpdateMessage=(e,t={})=>{const a={date:e.date,seq:e.seq,seqStart:e.seq_start};switch(this.debug&&this.log.debug("processUpdateMessage",e),e._){case"updatesTooLong":case"new_session_created":this.forceGetDifference();break;case"updateShort":this.processUpdate(e.update,a);break;case"updateShortMessage":case"updateShortChatMessage":{(0,ue.Z)(e),this.debug&&this.log.debug("updateShortMessage | updateShortChatMessage",Object.assign({},e));const t=e.pFlags.out,s=e.from_id||(t?this.appPeersManager.peerId:e.user_id),n=e.chat_id?e.chat_id.toPeerId(!0):e.user_id.toPeerId(!1)||this.appPeersManager.peerId;this.processUpdate({_:"updateNewMessage",message:{_:"message",pFlags:e.pFlags,id:e.id,from_id:this.appPeersManager.getOutputPeer(s.toPeerId()),peer_id:this.appPeersManager.getOutputPeer(n),date:e.date,message:e.message,fwd_from:e.fwd_from,reply_to:e.reply_to,entities:e.entities},pts:e.pts,pts_count:e.pts_count},a);break}case"updatesCombined":case"updates":this.appUsersManager.saveApiUsers(e.users,t.override),this.appChatsManager.saveApiChats(e.chats,t.override),e.updates.forEach((e=>{this.processUpdate(e,a)}));break;default:this.log.warn("Unknown update message",e)}},this._constructor(!1)}setProxy(){const e=this;this.updatesState=new Proxy(this.updatesState,{set:function(t,a,s){return t[a]=s,e.saveUpdatesState(),!0}})}saveUpdatesState(){const e=this.updatesState;this.appStateManager.pushToState("updates",{seq:e.seq,pts:e.pts,date:e.date})}popPendingSeqUpdate(){var e;const t=this.updatesState,a=t.seq+1,s=t.pendingSeqUpdates[a];if(!s)return!1;const n=s.updates;for(let e=0,t=n.length;e=t.syncPending.seqAwaiting&&(t.syncPending.ptsAwaiting?delete t.syncPending.seqAwaiting:this.clearStatePendingSync(t)),!0}popPendingPtsUpdate(e){const t=e?this.getChannelState(e):this.updatesState;if(!t.pendingPtsUpdates.length)return!1;t.pendingPtsUpdates.sort(((e,t)=>e.pts-t.pts));let a=t.pts,s=0,n=0;for(let e=0,i=t.pendingPtsUpdates.length;e=i.pts&&(s=i.pts,n=e)}if(!s)return!1;this.debug&&this.log.debug("pop pending pts updates",s,t.pendingPtsUpdates.slice(0,n+1)),t.pts=s;for(let e=0;e<=n;++e){const a=t.pendingPtsUpdates[e];this.saveUpdate(a)}return t.pendingPtsUpdates.splice(0,n+1),!t.pendingPtsUpdates.length&&t.syncPending&&(t.syncPending.seqAwaiting?delete t.syncPending.ptsAwaiting:this.clearStatePendingSync(t)),!0}forceGetDifference(){this.updatesState.syncLoading||this.getDifference()}processLocalUpdate(e){this.processUpdateMessage({_:"updateShort",update:e})}getDifference(e=!1){const t=this.updatesState,a=t.syncLoading;a||(t.pendingSeqUpdates={},t.pendingPtsUpdates=[]),this.clearStatePendingSync(t);const s=this.apiManager.invokeApi("updates.getDifference",{pts:t.pts,pts_total_limit:e?1200:void 0,date:t.date,qts:-1},{timeout:2147483647}).then((a=>{if(this.debug&&this.log.debug("Get diff result",a),"updates.differenceEmpty"===a._)return this.debug&&this.log.debug("apply empty diff",a.seq),t.date=a.date,void(t.seq=a.seq);if(e&&this.rootScope.dispatchEvent("state_synchronizing"),"updates.differenceTooLong"!==a._){this.appUsersManager.saveApiUsers(a.users),this.appChatsManager.saveApiChats(a.chats),a.other_updates.forEach((e=>{switch(e._){case"updateChannelTooLong":case"updateNewChannelMessage":case"updateEditChannelMessage":return void this.processUpdate(e)}this.saveUpdate(e)})),a.new_messages.forEach((e=>{this.saveUpdate({_:"updateNewMessage",message:e,pts:t.pts,pts_count:0})}));const e="updates.difference"===a._?a.state:a.intermediate_state;t.seq=e.seq,t.pts=e.pts,t.date=e.date}else t.pts=a.pts,t.date=(0,te.Z)(!0)+this.timeManager.getServerTimeOffset(),delete t.seq,this.channelStates={},this.log.warn("getDifference:",a._),this.onDifferenceTooLong();if("updates.differenceSlice"===a._)return this.getDifference();this.debug&&this.log.debug("finished get diff")}));return a||this.justAName(t,s),s}clearStatePendingSync(e){e.syncPending&&(clearTimeout(e.syncPending.timeout),e.syncPending=null)}getChannelDifference(e){const t=this.getChannelState(e),a=t.syncLoading;a||(t.pendingPtsUpdates=[]),this.clearStatePendingSync(t);const s=this.debug?this.log.bindPrefix("getChannelDifference-"+e):void 0,n=this.apiManager.invokeApi("updates.getChannelDifference",{channel:this.appChatsManager.getChannelInput(e),filter:{_:"channelMessagesFilterEmpty"},pts:t.pts,limit:1e3},{timeout:2147483647}).then((a=>{if(null==s||s.debug("diff result",a),t.pts="pts"in a?a.pts:void 0,t.lastDifferenceTime=Date.now(),"updates.channelDifferenceEmpty"!==a._){if("updates.channelDifferenceTooLong"===a._)return delete this.channelStates[e],void this.saveUpdate({_:"updateChannelReload",channel_id:e});if(this.appUsersManager.saveApiUsers(a.users),this.appChatsManager.saveApiChats(a.chats),null==s||s.debug("applying",a.other_updates.length,"channel other updates"),a.other_updates.forEach((e=>{this.saveUpdate(e)})),null==s||s.debug("applying",a.new_messages.length,"channel new messages"),a.new_messages.forEach((e=>{this.saveUpdate({_:"updateNewChannelMessage",message:e,pts:t.pts,pts_count:0})})),null==s||s.debug("apply channel diff",t.pts),"updates.channelDifference"===a._&&!a.pFlags.final)return this.getChannelDifference(e);null==s||s.debug("finished channel get diff")}}));return a||this.justAName(t,n,e),n}onDifferenceTooLong(){this.appUsersManager.clear(),this.appChatsManager.clear(),this.appMessagesManager.clear(),this.rootScope.dispatchEvent("state_cleared")}justAName(e,t,a){e.syncLoading=t,this.rootScope.dispatchEvent("state_synchronizing",a),t.then((()=>{e.syncLoading=null,this.rootScope.dispatchEvent("state_synchronized",a)}),(()=>{e.syncLoading=null}))}addChannelState(e,t){var a,s;if(!t)throw new Error("Add channel state without pts "+e);return null!==(a=(s=this.channelStates)[e])&&void 0!==a?a:s[e]={pts:t,pendingPtsUpdates:[],syncPending:null,syncLoading:null}}getChannelState(e,t){return void 0===this.channelStates[e]&&this.addChannelState(e,t),this.channelStates[e]}processUpdate(e,t={}){var a,s,n,i;let r;switch(e._){case"updateNewChannelMessage":case"updateEditChannelMessage":r=this.appPeersManager.getPeerId(e.message.peer_id).toChatId();break;case"updateChannelTooLong":if(r=e.channel_id,!(r in this.channelStates))return!1;break;default:"channel_id"in e&&"pts"in e&&(r=e.channel_id)}const{pts:o,pts_count:p}=e,d=r?this.getChannelState(r,o):this.updatesState;if(d.syncLoading)return!1;if("updateChannelTooLong"===e._)return(!d.lastPtsUpdateTime||d.lastPtsUpdateTime{d.syncPending=null,d.syncLoading||(r?this.getChannelDifference(r):this.getDifference())}),6)}),d.syncPending.ptsAwaiting=!0,!1;if(o>d.pts)d.pts=o,f=!0,d.lastPtsUpdateTime=Date.now();else if(p)return!1;r&&t.date&&this.updatesState.date0){const a=t.seq,r=t.seqStart||a;if(r!==d.seq+1&&r>d.seq)return this.debug&&this.log.warn("Seq hole",d,null===(s=d.syncPending)||void 0===s?void 0:s.seqAwaiting),null!==(n=(i=d.pendingSeqUpdates)[r])&&void 0!==n||(i[r]={seq:a,date:t.date,updates:[]}),d.pendingSeqUpdates[r].updates.push(e),d.syncPending||(d.syncPending={timeout:T.Z.setTimeout((()=>{d.syncPending=null,d.syncLoading||this.getDifference()}),6)}),(!d.syncPending.seqAwaiting||d.syncPending.seqAwaiting{const t=this.getChannelState(e);t.syncLoading||t.lastDifferenceTime&&!(Date.now()-t.lastDifferenceTime>2500)||this.getChannelDifference(e)};null!==(a=n.interval)&&void 0!==a||(n.interval=T.Z.setInterval(i,3e3)),i()}unsubscribeFromChannelUpdates(e,t){const a=this.subscriptions[e];!(null==a?void 0:a.interval)||--a.count&&!t||(clearInterval(a.interval),a.interval=void 0,delete this.subscriptions[e])}attach(e){this.attached||(this.log("attach"),this.attached=!0,this.appStateManager.getState().then((({updates:t})=>{const a=this.appStateManager.newVersion;t&&t.pts&&t.date?(Object.assign(this.updatesState,t),this.log("will get difference",Object.assign({},t)),this.getDifference(!0)):(this.log("will get new state"),this.updatesState.syncLoading=new Promise((e=>{this.apiManager.invokeApi("updates.getState",{},{noErrorBox:!0}).then((t=>{this.updatesState.seq=t.seq,this.updatesState.pts=t.pts,this.updatesState.date=t.date,this.saveUpdatesState(),this.updatesState.syncLoading=null,e()}))}))),this.apiManager.setUpdatesProcessor(this.processUpdateMessage),this.setProxy(),a&&this.updatesState.syncLoading.then((()=>{return t=this,s=void 0,i=function*(){const t={en:"was updated to version",ru:"обновлён до версии"},s=e=>{fetch(`changelogs/${e}_${a.split(" ")[0]}.md`).then((e=>200===e.status&&e.ok&&e.text()||Promise.reject())).then((s=>{const n=t[e]||t.en;s=`**Telegram Web${_.Z.suffix} ${n} ${a}**\n\n`+s;const i=[],r={_:"updateServiceNotification",entities:i,message:(0,we.Z)(s,i),type:"local",pFlags:{},inbox_date:(0,te.Z)(!0),media:void 0};this.processLocalUpdate(r)}))},n=(0,ke.Z)([e,"en"]);for(const e of n)try{yield s(e);break}catch(e){}},new((n=void 0)||(n=Promise))((function(e,a){function r(e){try{p(i.next(e))}catch(e){a(e)}}function o(e){try{p(i.throw(e))}catch(e){a(e)}}function p(t){var a;t.done?e(t.value):(a=t.value,a instanceof n?a:new n((function(e){e(a)}))).then(r,o)}p((i=i.apply(t,s||[])).next())}));var t,s,n,i}))})))}}Ae(Ue,[p.Z,G]);class De extends G{constructor(){super(...arguments),this.savedAvatarURLs={}}after(){this.rootScope.addEventListener("avatar_update",(({peerId:e,threadId:t})=>{t||this.removeFromAvatarsCache(e)}))}isAvatarCached(e,t){const a=this.savedAvatarURLs[e];return void 0===t?!!a:!(!a||!a[t]||a[t]instanceof Promise)}removeFromAvatarsCache(e){this.savedAvatarURLs[e]&&delete this.savedAvatarURLs[e]}loadAvatar(e,t,a){var s,n;const i=null!==(s=(n=this.savedAvatarURLs)[e])&&void 0!==s?s:n[e]={};if(i[a])return i[a];{const s={_:"inputPeerPhotoFileLocation",pFlags:{},peer:this.appPeersManager.getInputPeerById(e),photo_id:t.photo_id},n={dcId:t.dc_id,location:s};"photo_big"===a&&(s.pFlags.big=!0,n.limitPart=524288);const r=this.apiFileManager.download(n);return i[a]=r.then((e=>i[a]=URL.createObjectURL(e)))}}}var Ee=a(144),Te=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};class Fe extends G{after(){this.calls=new Map,i().IS_CALL_SUPPORTED&&this.apiUpdatesManager.addMultipleEventsListeners({updatePhoneCall:e=>{this.saveCall(e.phone_call)},updatePhoneCallSignalingData:e=>{this.rootScope.dispatchEvent("call_signaling",{callId:e.phone_call_id,data:e.data})}})}computeKey(e,t,a){return this.cryptoWorker.invokeCrypto("compute-dh-key",e,t,a)}saveCall(e){const t="phoneCallDiscarded"===e._,a=this.calls.get(e.id);return a?(re(a,e),t&&this.calls.delete(e.id),e=a):t||this.calls.set(e.id,e),this.rootScope.dispatchEvent("call_update",e),e}getCall(e){return this.calls.get(e)}getCallInput(e){const t=this.getCall(e);return{_:"inputPhoneCall",id:t.id,access_hash:t.access_hash}}savePhonePhoneCall(e){return this.appUsersManager.saveApiUsers(e.users),this.saveCall(e.phone_call)}generateDh(){return this.apiManager.invokeApi("messages.getDhConfig",{version:0,random_length:256}).then((e=>this.cryptoWorker.invokeCrypto("generate-dh",e)))}requestCall(e,t,a,s){return Te(this,void 0,void 0,(function*(){const n=yield this.apiManager.invokeApi("phone.requestCall",{user_id:this.appUsersManager.getUserInput(e),protocol:t,video:s,random_id:(0,Ee.d)(32),g_a_hash:a});return this.savePhonePhoneCall(n)}))}discardCall(e,t,a,s){return Te(this,void 0,void 0,(function*(){if(!this.getCall(e))return;const n=yield this.apiManager.invokeApi("phone.discardCall",{video:s,peer:this.getCallInput(e),duration:t,reason:{_:a},connection_id:"0"});this.apiUpdatesManager.processUpdateMessage(n)}))}}var Re=a(7120),xe=a(2566),Be=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};class Ve extends G{constructor(){super(...arguments),this.clear=(e=!1)=>{if(e)this.chats={};else for(const e in this.chats)if(e&&!this.peersStorage.isPeerNeeded(e.toPeerId(!0))){const t=this.chats[e];this.appUsersManager.modifyUsernamesCache(t,!1),this.storage.delete(e),delete this.chats[e]}},this.onChatUpdated=(e,t)=>{var a;this.apiUpdatesManager.processUpdateMessage(t),(null===(a=null==t?void 0:t.updates)||void 0===a?void 0:a.length)&&this.isChannel(e)&&this.rootScope.dispatchEvent("invalidate_participants",e)},this.onUpdateChannelParticipant=e=>{this.apiManager.clearCache("channels.getParticipants",(t=>t.channel.channel_id===e.channel_id)),this.rootScope.dispatchEvent("chat_participant",e)},this.onUpdateChatDefaultBannedRights=e=>{const t=this.appPeersManager.getPeerId(e.peer).toChatId(),a=this.chats[t];a&&(a.default_banned_rights=e.default_banned_rights,this.rootScope.dispatchEvent("chat_update",t))}}after(){return this.clear(!0),this.apiUpdatesManager.addMultipleEventsListeners({updateChannelParticipant:this.onUpdateChannelParticipant,updateChatDefaultBannedRights:this.onUpdateChatDefaultBannedRights}),Promise.all([this.appStateManager.getState(),this.appStoragesManager.loadStorage("chats")]).then((([e,{results:t,storage:a}])=>{this.storage=a,this.saveApiChats(t),this.peersStorage.addEventListener("peerNeeded",(e=>{e.isUser()||this.storage.getFromCache(e.toChatId())||this.storage.set({[e.toChatId()]:this.getChat(e.toChatId())})})),this.peersStorage.addEventListener("peerUnneeded",(e=>{!e.isUser()&&this.storage.getFromCache(e.toChatId())&&this.storage.delete(e.toChatId())}))}))}saveApiChats(e,t){e.saved||(e.saved=!0,e.forEach((e=>this.saveApiChat(e,t))))}saveApiChat(e,t){var a,s,n,i,r;if(!e||"chatEmpty"===e._)return;const o=this.chats[e.id];if(null!==(a=(r=e).pFlags)&&void 0!==a||(r.pFlags={}),e.pFlags.min&&void 0!==o)return;"channel"===e._&&void 0===e.participants_count&&void 0!==o&&o.participants_count&&(e.participants_count=o.participants_count),"chatPhotoEmpty"===(null===(s=e.photo)||void 0===s?void 0:s._)&&delete e.photo;const p=this.appUsersManager.setUsernameToCache(e,o),d=e.id.toPeerId(!0);if(void 0===o)this.chats[e.id]=e;else{const t=null===(n=o.photo)||void 0===n?void 0:n.photo_id,a=null===(i=e.photo)||void 0===i?void 0:i.photo_id,s=o.pFlags.forum!==e.pFlags.forum,r=t!==a||s,f=o.title!==e.title||p,c=o.pFlags.verified!==e.pFlags.verified||o.pFlags.scam!==e.pFlags.scam||o.pFlags.fake!==e.pFlags.fake;re(o,e),this.rootScope.dispatchEvent("chat_update",e.id),r&&this.rootScope.dispatchEvent("avatar_update",{peerId:d}),(f||c)&&this.rootScope.dispatchEvent("peer_title_edit",{peerId:d}),s&&this.rootScope.dispatchEvent("chat_toggle_forum",{chatId:e.id,enabled:!!e.pFlags.forum})}this.peersStorage.isPeerNeeded(d)&&this.storage.set({[e.id]:e})}getChat(e){return this.chats[e]}hasRights(e,t,a,s){return(0,Re.Z)(this.getChat(e),t,a,s)}editChatDefaultBannedRights(e,t){const a=this.getChat(e);return a.default_banned_rights&&a.default_banned_rights.until_date===t.until_date&&(0,Y.Z)(a.default_banned_rights.pFlags,t.pFlags)?Promise.resolve():this.apiManager.invokeApi("messages.editChatDefaultBannedRights",{peer:this.appPeersManager.getInputPeerById(e.toPeerId(!0)),banned_rights:t}).then(this.onChatUpdated.bind(this,e))}isChannel(e){const t=this.chats[e];return!(!t||"channel"!==t._&&"channelForbidden"!==t._)}isMegagroup(e){var t;const a=this.chats[e];return!!(null===(t=null==a?void 0:a.pFlags)||void 0===t?void 0:t.megagroup)}isForum(e){var t;const a=this.chats[e];return!!(null===(t=null==a?void 0:a.pFlags)||void 0===t?void 0:t.forum)}isBroadcast(e){return this.isChannel(e)&&!this.isMegagroup(e)}isInChat(e){let t=!0;const a=this.getChat(e);return(!a||"channelForbidden"===a._||"chatForbidden"===a._||"chatEmpty"===a._||a.pFlags.left||a.pFlags.deactivated)&&(t=!1),t}getChannelInput(e){const t=this.getChat(e);return t&&t.access_hash?{_:"inputChannel",channel_id:e,access_hash:t.access_hash||"0"}:{_:"inputChannelEmpty"}}getInputPeer(e){return this.isChannel(e)?this.getChannelInputPeer(e):this.getChatInputPeer(e)}getChatInputPeer(e){return{_:"inputPeerChat",chat_id:e}}getChannelInputPeer(e){return{_:"inputPeerChannel",channel_id:e,access_hash:this.getChat(e).access_hash||0}}hasChat(e,t){const a=this.chats[e];return(0,fe.Z)(a)&&(t||!a.pFlags.min)}getChatString(e){const t=this.getChat(e);return this.isChannel(e)?(this.isMegagroup(e)?"s":"c")+e+"_"+t.access_hash:"g"+e}createChannel(e){return this.apiManager.invokeApi("channels.createChannel",e).then((e=>(this.apiUpdatesManager.processUpdateMessage(e),e.chats[0].id)))}inviteToChannel(e,t){const a=this.getChannelInput(e),s=t.map((e=>this.appUsersManager.getUserInput(e)));return this.apiManager.invokeApi("channels.inviteToChannel",{channel:a,users:s}).then(this.onChatUpdated.bind(this,e))}createChat(e,t){return this.apiManager.invokeApi("messages.createChat",{users:t.map((e=>this.appUsersManager.getUserInput(e))),title:e}).then((e=>(this.apiUpdatesManager.processUpdateMessage(e),e.chats[0].id)))}leaveChannel(e){return this.apiManager.invokeApi("channels.leaveChannel",{channel:this.getChannelInput(e)}).then(this.onChatUpdated.bind(this,e))}joinChannel(e){return this.apiManager.invokeApi("channels.joinChannel",{channel:this.getChannelInput(e)}).then(this.onChatUpdated.bind(this,e))}addChatUser(e,t,a=100){return this.apiManager.invokeApi("messages.addChatUser",{chat_id:e,user_id:this.appUsersManager.getUserInput(t),fwd_limit:a}).then(this.onChatUpdated.bind(this,e))}deleteChatUser(e,t){return this.apiManager.invokeApi("messages.deleteChatUser",{chat_id:e,user_id:this.appUsersManager.getUserInput(t)}).then(this.onChatUpdated.bind(this,e))}leaveChat(e){return this.deleteChatUser(e,this.appUsersManager.getSelf().id)}leave(e){return this.isChannel(e)?this.leaveChannel(e):this.leaveChat(e)}delete(e){return this.isChannel(e)?this.deleteChannel(e):this.deleteChat(e)}deleteChannel(e){return this.apiManager.invokeApi("channels.deleteChannel",{channel:this.getChannelInput(e)}).then(this.onChatUpdated.bind(this,e))}deleteChat(e){return this.apiManager.invokeApi("messages.deleteChat",{chat_id:e})}migrateChat(e){const t=this.getChat(e);return"channel"===t._?Promise.resolve(t.id):this.apiManager.invokeApi("messages.migrateChat",{chat_id:e}).then((t=>(this.onChatUpdated(e,t),t.updates.find((e=>"updateChannel"===e._)).channel_id)))}updateUsername(e,t,a){const s=this.apiManager.invokeApi("channels.updateUsername",{channel:this.getChannelInput(e),username:t});return this.refreshChatAfterRequest(e,s,a)}editPhoto(e,t){const a={_:"inputChatUploadedPhoto",file:t};let s;return s=this.isChannel(e)?this.apiManager.invokeApi("channels.editPhoto",{channel:this.getChannelInput(e),photo:a}):this.apiManager.invokeApi("messages.editChatPhoto",{chat_id:e,photo:a}),s.then(this.onChatUpdated.bind(this,e))}editTitle(e,t){let a;return a=this.isChannel(e)?this.apiManager.invokeApi("channels.editTitle",{channel:this.getChannelInput(e),title:t}):this.apiManager.invokeApi("messages.editChatTitle",{chat_id:e,title:t}),a.then(this.onChatUpdated.bind(this,e))}editAbout(e,t){const a=e.toPeerId(!0);return this.apiManager.invokeApi("messages.editChatAbout",{peer:this.appPeersManager.getInputPeerById(a),about:t}).then((e=>(e&&this.rootScope.dispatchEvent("peer_bio_edit",a),e)))}editBanned(e,t,a){return Be(this,void 0,void 0,(function*(){const s="object"!=typeof t?t:(0,xe.Z)(t),n=this.isChannel(e);if(!n){const t=yield this.migrateChat(e);e=t}return this.apiManager.invokeApi("channels.editBanned",{channel:this.getChannelInput(e),participant:this.appPeersManager.getInputPeerById(s),banned_rights:a}).then((i=>{if(this.onChatUpdated(e,i),"object"==typeof t){const i=(0,te.Z)(!0);this.apiUpdatesManager.processLocalUpdate({_:"updateChannelParticipant",channel_id:e,date:i,actor_id:void 0,qts:void 0,user_id:s,prev_participant:n?t:void 0,new_participant:Object.keys(a.pFlags).length?{_:"channelParticipantBanned",date:i,banned_rights:a,kicked_by:this.appUsersManager.getSelf().id,peer:this.appPeersManager.getOutputPeer(s),pFlags:{}}:void 0})}}))}))}clearChannelParticipantBannedRights(e,t){return this.editBanned(e,t,{_:"chatBannedRights",until_date:0,pFlags:{}})}kickFromChannel(e,t){return this.editBanned(e,t,{_:"chatBannedRights",until_date:0,pFlags:{view_messages:!0}})}kickFromChat(e,t){return this.isChannel(e)?this.kickFromChannel(e,t):this.deleteChatUser(e,(0,fe.Z)(t)?(0,xe.Z)(t):t.toUserId())}resolveChannel(e){return this.apiManager.invokeApiSingle("channels.getChannels",{id:[{_:"inputChannel",channel_id:e,access_hash:"0"}]}).then((e=>{this.saveApiChats(e.chats)}))}togglePreHistoryHidden(e,t){return this.migrateChat(e).then((e=>this.apiManager.invokeApi("channels.togglePreHistoryHidden",{channel:this.getChannelInput(e),enabled:t}).then(this.onChatUpdated.bind(this,e))))}toggleSignatures(e,t){return this.apiManager.invokeApi("channels.toggleSignatures",{channel:this.getChannelInput(e),enabled:t}).then(this.onChatUpdated.bind(this,e))}toggleNoForwards(e,t){return this.apiManager.invokeApi("messages.toggleNoForwards",{peer:this.getInputPeer(e),enabled:t}).then(this.onChatUpdated.bind(this,e))}setChatAvailableReactions(e,t){const a=this.appProfileManager.getCachedFullChat(e);return a&&(a.available_reactions=t,this.rootScope.dispatchEvent("chat_full_update",e)),this.apiManager.invokeApi("messages.setChatAvailableReactions",{peer:this.getInputPeer(e),available_reactions:t}).then(this.onChatUpdated.bind(this,e))}getSendAs(e){return this.apiManager.invokeApiSingleProcess({method:"channels.getSendAs",params:{peer:this.getChannelInputPeer(e)},processResult:e=>(this.appUsersManager.saveApiUsers(e.users),this.saveApiChats(e.chats),e.peers)})}importChatInvite(e){return this.apiManager.invokeApi("messages.importChatInvite",{hash:e}).then((e=>(this.apiUpdatesManager.processUpdateMessage(e),e.chats[0].id)))}checkUsername(e,t){return this.apiManager.invokeApi("channels.checkUsername",{channel:this.getChannelInput(e),username:t})}getSponsoredMessage(e){return this.apiManager.invokeApiCacheable("channels.getSponsoredMessages",{channel:this.getChannelInput(e)},{cacheSeconds:300}).then((e=>{if("messages.sponsoredMessages"===e._){this.appUsersManager.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats);const t=e.messages.shift();e.messages.push(t)}return e}))}viewSponsoredMessage(e,t){return this.apiManager.invokeApiSingle("channels.viewSponsoredMessage",{channel:this.getChannelInput(e),random_id:t})}checkChatInvite(e){return this.apiManager.invokeApi("messages.checkChatInvite",{hash:e}).then((e=>(e.chat&&this.saveApiChat(e.chat,!0),e)))}toggleUsername(e,t,a){const s=this.apiManager.invokeApi("channels.toggleUsername",{channel:this.getChannelInput(e),username:t,active:a});return this.refreshChatAfterRequest(e,s)}reorderUsernames(e,t){const a=this.apiManager.invokeApi("channels.reorderUsernames",{channel:this.getChannelInput(e),order:t});return this.refreshChatAfterRequest(e,a)}deactivateAllUsernames(e,t){const a=this.apiManager.invokeApi("channels.deactivateAllUsernames",{channel:this.getChannelInput(e)});return this.refreshChatAfterRequest(e,a,t)}makeChannelPrivate(e){const t=[this.updateUsername(e,"",!0),this.deactivateAllUsernames(e,!0)],a=Promise.all(t).then((()=>!0));return this.refreshChatAfterRequest(e,a)}refreshChatAfterRequest(e,t,a){return a?t:t.then((t=>this.getChannels([e]).then((()=>t))))}getChannels(e){return this.apiManager.invokeApi("channels.getChannels",{id:e.map((e=>this.getChannelInput(e)))}).then((e=>{this.saveApiChats(e.chats)}))}toggleForum(e,t){return this.migrateChat(e).then((e=>this.apiManager.invokeApi("channels.toggleForum",{channel:this.getChannelInput(e),enabled:t}).then(this.onChatUpdated.bind(this,e))))}editForumTopic(e){const{chatId:t,topicId:a,title:s,iconEmojiId:n,closed:i,hidden:r}=e;return this.apiManager.invokeApi("channels.editForumTopic",{channel:this.getChannelInput(t),topic_id:(0,oe.Z)(a),title:s,icon_emoji_id:n,closed:i,hidden:r}).then(this.onChatUpdated.bind(this,t))}createForumTopic(e){return Be(this,void 0,void 0,(function*(){const{chatId:t,title:a,iconColor:s,iconEmojiId:n}=e,i=yield this.appProfileManager.getChannelFull(t),r=i.default_send_as&&this.appPeersManager.getInputPeerById(this.appPeersManager.getPeerId(i.default_send_as));return this.apiManager.invokeApi("channels.createForumTopic",{channel:this.getChannelInput(t),title:a,icon_color:s,icon_emoji_id:n,random_id:(0,Ee.a)(),send_as:r}).then((e=>{this.onChatUpdated(t,e);const a=e.updates.find((e=>"updateNewChannelMessage"===e._));return(0,pe.Z)(a.message.id)}))}))}updatePinnedForumTopic(e,t,a){return this.apiManager.invokeApi("channels.updatePinnedForumTopic",{channel:this.getChannelInput(e),topic_id:(0,oe.Z)(t),pinned:a}).then(this.onChatUpdated.bind(this,e))}}a(4762);var Oe,Le=a(5953),Ne=a(9005),Ze=a(6637),je=a(2423);function qe(e,t){(0,Ze.Z)(e)||(e="https://"+e);const a={url:e};let s,n,i,r;if(s=e.match(/^(?:https?:\/\/)?(?:(.+?)\.)?(?:(?:web|k|z)\.)?t(?:elegram)?\.me(?:\/(.+))?/)){const t=new URL(e);let a=s[1];a&&o.BX.has(s[1])&&(a=void 0),a&&(t.pathname=a+("/"===t.pathname?"":t.pathname));const n=t.pathname.slice(1),i=n.split("/");if(i[0]&&"$"===i[0][0]&&i[0].length>1)r="invoice";else if(/^\W/.test(n)&&!je.kO.test(n))r="joinchat";else switch(i[0]){case"joinchat":case"addstickers":case"addemoji":case"voicechat":case"invoice":if(1!==i.length&&!a){r=i[0];break}default:if(i[1]&&i[1].match(/^\d+(?:\?(?:comment|thread)=\d+)?$/)||1===i.length){r="im";break}}}else(n=e.match(/^(?:https?:\/\/)?telesco\.pe\/([^/?]+)\/(\d+)/))?r="im":(i=e.match(/tg:(?:\/\/)?(.+?)(?:\?|$)/))&&(r="tg_"+i[1]);return window[r]||(r=void 0),a.onclick=r,a}d.GO&&(d.GO.wrapUrl=qe),function(e){let t,s;function n(t){e.lastRequestedLangCode=t,e.lastRequestedNormalizedLangCode=t.split("-")[0]}function i(){if("h12"===e.timeFormat)try{const t=P({hour:"numeric",minute:"numeric",hour12:!0}),a=new Date;a.setHours(0);const s=t.format(a);e.amPmCache.am=s.split(/\s/)[1],a.setHours(12);const n=t.format(a);e.amPmCache.pm=n.split(/\s/)[1]}catch(t){console.error("cannot get am/pm",t),e.amPmCache={am:"AM",pm:"PM"}}}function r(){const e=_.Z.langPackCode;return n(e),Promise.all([a.e(104).then(a.bind(a,9104)),a.e(301).then(a.bind(a,9301)),a.e(8).then(a.bind(a,9179))]).then((([t,a,s])=>{const n=[];return p(t.default,n),p(a.default,n),f({_:"langPackDifference",from_version:0,lang_code:e,strings:n,version:0,local:!0,countries:s.default})}))}function o(t,s){e.requestedServerLanguage=!0;const n=g.managers;return Promise.all([n.apiManager.invokeApiCacheable("langpack.getLangPack",{lang_code:t,lang_pack:"web"}),!1,a.e(104).then(a.bind(a,9104)),a.e(301).then(a.bind(a,9301)),n.apiManager.invokeApiCacheable("help.getCountriesList",{lang_code:t,hash:0}),e.polyfillPromise])}function p(e,t=[]){for(const a in e){const s=e[a];"string"==typeof s?t.push({_:"langPackString",key:a,value:s}):t.push(Object.assign({_:"langPackStringPluralized",key:a},s))}return t}function f(e){return e.appVersion=_.Z.langPackVersion,h.Z.set({langPack:e}).then((()=>(c(e),e)))}function c(a){const s=e.lastRequestedLangCode;if(a.lang_code===s){try{t=new Intl.PluralRules(e.lastRequestedNormalizedLangCode)}catch(a){console.error("pluralRules error",a),t=new Intl.PluralRules(e.lastRequestedNormalizedLangCode.split("-",1)[0])}try{t=new Intl.PluralRules(a.lang_code)}catch(e){console.error("pluralRules error",e),t=new Intl.PluralRules(a.lang_code.split("-",1)[0])}e.strings.clear();for(const t of a.strings)e.strings.set(t.key,t);a.countries&&(e.countriesList.length=0,e.countriesList.push(...a.countries.countries),a.countries.countries.forEach((t=>{if(t.name){const a=t.default_name;e.strings.set(a,{_:"langPackString",key:a,value:t.name})}}))),e.lastAppliedLangCode!==s&&(g.dispatchEvent("language_change",s),e.lastAppliedLangCode=s,v.clear(),i()),Array.from(document.querySelectorAll(".i18n")).forEach((t=>{const a=e.weakMap.get(t);a&&a.update()}))}}function l(e,t,a={i:0}){const s=[];let n=0;return e.replace(/(\*\*|__)(.+?)\1|(\n)|(\[.+?\]\(.*?\))|un\d|%\d\$.|%./g,((e,i,r,o,p,d,f)=>{if(s.push(f.slice(n,d)),i){let e;switch(i){case"**":e=document.createElement("b");break;case"__":e=document.createElement("i")}e.append(...l(r,t,a)),s.push(e)}else if(o)s.push(document.createElement("br"));else if(p){const e=p.lastIndexOf("]"),n=p.slice(1,e),i=p.slice(e+2,p.length-1);let r;if(i&&(0,Ze.Z)(i)){r=document.createElement("a");const e=qe(i);r.href=e.url,e.onclick&&r.setAttribute("onclick",e.onclick),r.target="_blank"}else r=t[a.i++],r instanceof DocumentFragment&&(r=r.firstChild),"string"!=typeof r&&(r.textContent="");const o=l(n,t,a);"string"==typeof r?s.push(...o):(r.append(...o),s.push(r))}else t&&function(e,t,a){const s=t[a.i++];Array.isArray(s)?e.push(...s):e.push(s)}(s,t,a);return n=d+e.length,""})),n!==e.length&&s.push(e.slice(n)),s}function m(a,s=!1,n){const i=e.strings.get(a);let r;if(i)if("langPackStringPluralized"===i._&&(null==n?void 0:n.length)){let e=n[0];"string"==typeof e&&(e=+e.replace(/\D/g,"")),r=i[t.select(e)+"_value"]||i.other_value}else r="langPackString"===i._?i.value:a;else r=a;const o=l(r,n);return s?o.map((e=>e instanceof Node?e.textContent:e)).join(""):o}e.strings=new Map,e.countriesList=[],e.requestedServerLanguage=!1,e.isRTL=!1,e.setRTL=function(t){e.isRTL=t},e.getCacheLangPack=function(){return s||(s=Promise.all([h.Z.get("langPack"),e.polyfillPromise]).then((([t])=>t?(d.ZP,e.lastRequestedLangCode||n(t.lang_code),c(t),t):r())).finally((()=>{s=void 0})))},e.setTimeFormat=function(t,a=!!e.timeFormat&&e.timeFormat!==t){e.timeFormat=t,i(),a&&(v.clear(),Array.from(document.querySelectorAll(".i18n")).forEach((t=>{const a=e.weakMap.get(t);a instanceof b&&a.update()})))},e.loadLocalLangPack=r,e.loadLangPack=o,e.getStrings=function(e,t){return g.managers.apiManager.invokeApi("langpack.getStrings",{lang_pack:_.Z.langPack,lang_code:e,keys:t})},e.formatLocalStrings=p,e.getLangPack=function(e,t){return n(e),o(e).then((([e,t,a,s,n,i])=>{let r=[];return[a,s].forEach((e=>{p(e.default,r)})),r=r.concat(...[e.strings,t.strings].filter(Boolean)),e.strings=r,e.countries=n,f(e)}))},e.saveLangPack=f,e.polyfillPromise="undefined"!=typeof Intl&&void 0!==Intl.PluralRules?Promise.resolve():a.e(642).then(a.bind(a,4642)).then((e=>{window.Intl=Object.assign("undefined"!=typeof Intl?Intl:{},e.default)})),e.applyLangPack=c,e.superFormatter=l,e.format=m,e.weakMap=new WeakMap;class u{constructor(t){this.element=(null==t?void 0:t.element)||document.createElement("span"),this.element.classList.add("i18n"),this.property=null==t?void 0:t.property,t&&(t.key||t.date)&&this.update(t),e.weakMap.set(this.element,this)}}class y extends u{constructor(e={}){var t;super(Object.assign(Object.assign({},e),{property:null!==(t=e.property)&&void 0!==t?t:"innerHTML"}))}update(e){if((0,Le.Z)(this,e),"innerHTML"===this.property)this.element.textContent="",this.element.append(...m(this.key,!1,this.args));else{const e=this.element[this.property],t=m(this.key,!0,this.args);void 0===e?this.element.dataset[this.property]=t:this.element[this.property]=t}}compareAndUpdate(e){if(this.key!==e.key||!(0,Y.Z)(this.args,e.args))return this.update(e)}}e.IntlElement=y;const v=new Map;function P(t={}){const a=JSON.stringify(t);let s=v.get(a);return s||(s=new Intl.DateTimeFormat(e.lastRequestedNormalizedLangCode+"-u-hc-"+e.timeFormat,t),v.set(a,s)),s}e.amPmCache={am:"AM",pm:"PM"};class b extends u{constructor(e){var t;super(Object.assign(Object.assign({},e),{property:null!==(t=e.property)&&void 0!==t?t:"textContent"})),this.element.setAttribute("dir","auto")}update(t){let a;if((0,Le.Z)(this,t),this.options.hour&&this.options.minute&&2===Object.keys(this.options).length){const t=this.date.getHours();a=("0"+("h12"===e.timeFormat?t%12||12:t)).slice(-2)+":"+("0"+this.date.getMinutes()).slice(-2),"h12"===e.timeFormat&&(a+=" "+(t<12?e.amPmCache.am:e.amPmCache.pm))}else{const e=P(this.options);a=(0,Ne.Z)(e.format(this.date))}this.element[this.property]=a}}e.IntlDateElement=b,e.i18n=function(e,t){return new y({key:e,args:t}).element},e.i18n_=function(e){return new y(e).element},e._i18n=function(e,t,a,s){return new y({element:e,key:t,args:a,property:s}).element}}(Oe||(Oe={}));const Ge=Oe;Oe.i18n,Oe.i18n_,Oe._i18n,d.GO.I18n=Oe;const He=["January","February","March","April","May","June","July","August","September","October","November","December"],We=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ze=e=>{const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),a=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-a);const s=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-s.getTime())/86400+1)/7)};d.GO&&(d.GO.formatDateAccordingToTodayNew=function(e){const t=new Date,a=t.getTime()/1e3|0,s=e.getTime()/1e3|0,n={};return a-s<86400&&t.getDate()===e.getDate()?n.hour=n.minute="2-digit":t.getFullYear()!==e.getFullYear()?(n.year=n.day="numeric",n.month="2-digit"):a-s<604800&&ze(t)===ze(e)?n.weekday="short":(n.month="short",n.day="numeric"),new Ge.IntlDateElement({date:e,options:n}).element});const Ke=2013,Je=new RegExp("20[0-9]{1,2}"),$e=new RegExp("(\\w{3,}) ([0-9]{0,4})","i"),Qe=new RegExp("([0-9]{0,4}) (\\w{2,})","i"),Ye=new RegExp("^([0-9]{1,4})(\\.| |/|\\-)([0-9]{1,4})$","i"),Xe=new RegExp("^([0-9]{1,2})(\\.| |/|\\-)([0-9]{1,2})(\\.| |/|\\-)([0-9]{1,4})$","i"),et=[31,29,31,30,31,30,31,31,30,31,30,31];function tt(e,t,a){const s=(new Date).getFullYear(),n=Date.now();if(a>=Ke&&a<=s){const s=new Date;s.setFullYear(a,t,1),s.setHours(0,0,0);const i=s.getTime();if(i>n)return;s.setMonth(s.getMonth()+1);const r=s.getTime()-1;e.push({title:st(i),minDate:i,maxDate:r})}}function at(e,t,a){if(ot(t,a)){const n=(new Date).getFullYear(),i=Date.now();for(let r=n;r>=Ke;r--){if(1===a&&28===t&&((s=r)%4!=0||s%100==0)&&s%400!=0)continue;const o=new Date;o.setFullYear(r,a,t+1),o.setHours(0,0,0);const p=o.getTime();if(p>i)continue;o.setFullYear(r,a,t+2),o.setHours(0,0,0);const d=o.getTime()-1;r===n?e.push({title:nt(p),minDate:p,maxDate:d}):e.push({title:it(p),minDate:p,maxDate:d})}}var s}function st(e){const t=new Date(e);return He[t.getMonth()].slice(0,3)+" "+t.getFullYear()}function nt(e){const t=new Date(e);return He[t.getMonth()].slice(0,3)+" "+t.getDate()}function it(e){const t=new Date(e);return("0"+t.getDate()).slice(-2)+"."+("0"+(t.getMonth()+1)).slice(-2)+"."+t.getFullYear()}function rt(e){const t=new Date(e);return We[t.getDay()]}function ot(e,t){return t>=0&&t<12&&e>=0&&e{t[e][s]=a})),a[e]=t[e])}d.GO.fillTipDates=function(e,t){const a=e.trim().toLowerCase();if(a.length<3)return;if(0==="today".indexOf(a)){const e=new Date,a=e.getFullYear(),s=e.getMonth(),n=e.getDate();e.setFullYear(a,s,n),e.setHours(0,0,0);const i=e.getTime();e.setFullYear(a,s,n+1),e.setHours(0,0,0);const r=e.getTime()-1;return void t.push({title:"Today",minDate:i,maxDate:r})}if(0==="yesterday".indexOf(a)){const e=new Date,a=e.getFullYear(),s=e.getMonth(),n=e.getDate();e.setFullYear(a,s,n),e.setHours(0,0,0);const i=e.getTime()-864e5;e.setFullYear(a,s,n+1),e.setHours(0,0,0);const r=e.getTime()-86400001;return void t.push({title:"Yesterday",minDate:i,maxDate:r})}const s=function(e){const t=new Date;if(e.length<=3)return-1;for(let a=0;a<7;a++)if(t.setDate(t.getDate()+1),0===rt(t.getTime()).toLowerCase().indexOf(e))return t.getDay();return-1}(a);if(s>=0){const e=new Date,a=e.getTime(),n=s-e.getDay();e.setDate(e.getDate()+n),e.getTime()>a&&e.setTime(e.getTime()-6048e5);const i=e.getFullYear(),r=e.getMonth(),o=e.getDate();e.setFullYear(i,r,o),e.setHours(0,0,0);const p=e.getTime();e.setFullYear(i,r,o+1),e.setHours(0,0,0);const d=e.getTime()-1;return void t.push({title:rt(p),minDate:p,maxDate:d})}let n;if(null===(n=Ye.exec(a)))if(null===(n=Xe.exec(a)))if(null===(n=Je.exec(a))){if(null!==(n=$e.exec(a))){const e=n[1],a=n[2],s=pt(e);if(s>=0){const e=+a;if(e>0&&e<=31)return void at(t,e-1,s);if(e>=Ke)return void tt(t,s,e)}}if(null!==(n=Qe.exec(a))){const e=n[1],a=pt(n[2]);if(a>=0){const s=+e;if(s>0&&s<=31)return void at(t,s-1,a);s>=Ke&&tt(t,a,s)}}}else{let e=+a;const s=(new Date).getFullYear();if(e=e;a--){const e=new Date;e.setFullYear(a,0,1),e.setHours(0,0,0);const s=e.getTime();e.setFullYear(a+1,0,1),e.setHours(0,0,0);const n=e.getTime()-1;t.push({title:""+a,minDate:s,maxDate:n})}}else if(e<=s){const a=new Date;a.setFullYear(e,0,1),a.setHours(0,0,0);const s=a.getTime();a.setFullYear(e+1,0,1),a.setHours(0,0,0);const n=a.getTime()-1;t.push({title:""+e,minDate:s,maxDate:n})}}else{const e=n[1],a=n[3],s=n[5];if(!n[2]===n[4])return;const i=parseInt(e),r=parseInt(a)-1;let o=parseInt(s);o>=10&&o<=99&&(o+=2e3);const p=(new Date).getFullYear();if(ot(i-1,r)&&o>=Ke&&o<=p){const e=new Date;e.setFullYear(o,r,i),e.setHours(0,0,0);const a=e.getTime();e.setFullYear(o,r,i+1),e.setHours(0,0,0);const s=e.getTime()-1;return void t.push({title:it(a),minDate:a,maxDate:s})}}else{const e=n[1],a=n[3],s=parseInt(e),i=parseInt(a);if(s>0&&s<=31){if(i>=Ke&&s<=12)return void tt(t,s-1,i);i<=12&&at(t,s-1,i-1)}else s>=Ke&&i<=12&&tt(t,i-1,s)}};var ft=a(2491),ct=a(7072),lt=a(8801),mt=a(6658);const gt={pdf:"application/pdf",tgv:"application/x-tgwallpattern",tgs:"application/x-tgsticker",json:"application/json",wav:"audio/wav",mp3:"audio/mpeg",ogg:"audio/ogg",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",mp4:"video/mp4",webm:"video/webm",mov:"video/quicktime",svg:"image/svg+xml"},ht={};for(const e in gt)ht[gt[e]]=e;let ut=0;class yt extends G{constructor(){super(...arguments),this.onServiceWorkerFail=()=>{for(const e in this.docs){const t=this.docs[e];t.supportsStreaming&&(delete t.supportsStreaming,this.thumbsStorage.deleteCacheContext(t))}}}after(){this.docs={},this.stickerCachedThumbs={},this.uploadingWallPapers={},f.Z.getInstance().addEventListener("serviceWorkerOnline",(e=>{e||this.onServiceWorkerFail()}))}saveDoc(e,t){if(!e||"documentEmpty"===e._)return;const a=this.docs[e.id];e.file_reference&&(dt("file_reference",a,e),this.referenceDatabase.saveContext(e.file_reference,t)),a||(this.docs[e.id]=e);for(let t=0,a=e.attributes.length;t"documentAttributeFilename"===e._)),a=t&&t.file_name.split(".").pop(),s=((e,t={})=>{const a=t.monthAsNumber?".":" ",s=("0"+e.getHours()).slice(-2)+":"+("0"+e.getMinutes()).slice(-2)+(t.noSeconds?"":":"+("0"+e.getSeconds()).slice(-2));return(t.leadingZero?("0"+e.getDate()).slice(-2):e.getDate())+a+(t.monthAsNumber?("0"+(e.getMonth()+1)).slice(-2):He[e.getMonth()])+a+e.getFullYear()+(t.noTime?"":", "+s)})(new Date(1e3*e.date),{monthAsNumber:!0,leadingZero:!0}).replace(/[:\.]/g,"-").replace(", ","_");e.file_name=`${e.type}_${s}${a?"."+a:""}`}return Ws()&&("gif"===e.type&&e.size>8e6||"audio"===e.type||"video"===e.type)?(e.supportsStreaming=!0,this.thumbsStorage.getCacheContext(e).url||this.thumbsStorage.setCacheContextURL(e,void 0,function(e,t=!1,a){let s;return s=t?"download":a?"thumb":e.supportsStreaming?"stream":"document",(0,lt.q)(s,(0,mt.Z)(e,a))}(e),0)):e.supportsStreaming=!1,e.file_name||(e.file_name=""),a?Object.assign(a,e):e}getDoc(e){return(0,fe.Z)(e)?e:this.docs[e]}downloadDoc(e,t,a){return this.apiFileManager.downloadMedia({media:e,queueId:t,onlyCache:a})}getLottieCachedThumb(e,t){const a=this.stickerCachedThumbs[e];return a&&a[t]}saveLottiePreview(e,t,a,s,n){var i,r,o;const p=this.getDoc(e);if(!p)return;const d=null!==(i=(r=this.stickerCachedThumbs)[o=p.id])&&void 0!==i?i:r[o]={},f=d[n];f&&f.w>=a&&f.h>=s||(d[n]={url:URL.createObjectURL(t),w:a,h:s})}saveWebPConvertedStrippedThumb(e,t){const a=this.getDoc(e);if(!a)return;const s=a.thumbs&&a.thumbs.find((e=>"photoStrippedSize"===e._));s&&(a.pFlags.stickerThumbConverted=!0,s.bytes=t)}prepareWallPaperUpload(e){const t="wallpaper-upload-"+ ++ut,a={_:"photoSize",h:0,w:0,location:{},size:e.size,type:o.Pt};let s={_:"document",access_hash:"",attributes:[],dc_id:0,file_reference:[],id:t,mime_type:e.type,size:e.size,date:(0,te.Z)(!0),pFlags:{},thumbs:[a],file_name:e.name};s=this.saveDoc(s);const n=this.thumbsStorage.setCacheContextURL(s,void 0,URL.createObjectURL(e),e.size),i={_:"wallPaper",access_hash:"",document:s,id:t,slug:t,pFlags:{}};return this.uploadingWallPapers[t]={cacheContext:n,file:e},i}uploadWallPaper(e){const{cacheContext:t,file:a}=this.uploadingWallPapers[e];return delete this.uploadingWallPapers[e],this.apiFileManager.upload({file:a,fileName:a.name}).then((e=>this.apiManager.invokeApi("account.uploadWallPaper",{file:e,mime_type:a.type,settings:{_:"wallPaperSettings",pFlags:{}}}).then((e=>((0,ue.Z)(e),e.document=this.saveDoc(e.document),this.thumbsStorage.setCacheContextURL(e.document,void 0,t.url,t.downloaded),e)))))}getGifs(){return this.apiManager.invokeApiHashable({method:"messages.getSavedGifs",processResult:e=>((0,ue.Z)(e),e.gifs.map((e=>this.saveDoc(e))))})}requestDocPart(e,t,a,s){const n=this.getDoc(e);return n?this.apiFileManager.requestFilePart(t,(0,ct.Z)(n),a,s):Promise.reject((0,X.Z)("NO_DOC"))}}var _t=a(6034);class vt extends G{constructor(){super(...arguments),this.drafts={}}after(){this.apiUpdatesManager.addMultipleEventsListeners({updateDraftMessage:e=>{const t=this.appPeersManager.getPeerId(e.peer);this.saveDraft({peerId:t,threadId:e.threadId,draft:e.draft,notify:!0})}}),h.Z.get("drafts").then((e=>{this.drafts=e||{}}))}getKey(e,t){return e+(t?"_"+t:"")}getDraft(e,t){return this.drafts[this.getKey(e,t)]}addMissedDialogs(){return this.getAllDrafts().then((()=>{for(const e in this.drafts){if(-1!==e.indexOf("_"))continue;const t=e.toPeerId();this.appMessagesManager.getDialogOnly(t)||this.appMessagesManager.reloadConversation(t)}}))}getAllDrafts(){var e;return null!==(e=this.getAllDraftPromise)&&void 0!==e?e:this.getAllDraftPromise=this.apiManager.invokeApi("messages.getAllDrafts").then((e=>{(this.apiUpdatesManager.updatesState.syncLoading||Promise.resolve()).then((()=>{this.apiUpdatesManager.processUpdateMessage(e)}))}))}saveDraft({peerId:e,threadId:t,draft:a,notify:s,force:n}){const i=this.processApiDraft(a),r=this.getKey(e,t);return i?this.drafts[r]=i:delete this.drafts[r],h.Z.set({drafts:this.drafts}),s&&this.rootScope.dispatchEvent("draft_updated",{peerId:e,threadId:t,draft:i,force:n}),i}isEmptyDraft(e){return"draftMessage"!==(null==e?void 0:e._)||!(void 0!==e.reply_to_msg_id&&e.reply_to_msg_id>0)&&!e.message.length}processApiDraft(e){if(e&&"draftMessage"===e._)return e.reply_to_msg_id&&(e.reply_to_msg_id=(0,pe.Z)(e.reply_to_msg_id)),e}syncDraft(e,t,a,s=!0,n=!1){const i=this.getDraft(e,t);if((0,_t.Z)(i,a))return!0;const r={peer:this.appPeersManager.getInputPeerById(e),message:""};let o;if(this.isEmptyDraft(a))o={_:"draftMessageEmpty"};else{(0,ue.Z)(a);const e=a.message,t=a.entities;a.reply_to_msg_id&&(r.reply_to_msg_id=(0,oe.Z)(a.reply_to_msg_id)),(null==t?void 0:t.length)&&(r.entities=this.appMessagesManager.getInputEntities(t)),a.pFlags.no_webpage&&(r.no_webpage=a.pFlags.no_webpage),r.message=e}t&&(r.top_msg_id=(0,oe.Z)(t));const p=o||a;return p.date=(0,te.Z)(!0)+this.timeManager.getServerTimeOffset(),this.saveDraft({peerId:e,threadId:t,draft:p,notify:!0,force:n}),!s||this.apiManager.invokeApi("messages.saveDraft",r)}clearAllDrafts(){return this.apiManager.invokeApi("messages.clearAllDrafts").then((e=>{if(e)for(const e in this.drafts){const[t,a]=e.split("_");this.rootScope.dispatchEvent("draft_updated",{peerId:t.toPeerId(),threadId:a?+a:void 0,draft:void 0})}}))}clearDraft(e,t){const a={_:"draftMessageEmpty"};t?this.syncDraft(e,t,a,!1,!0):this.saveDraft({peerId:e,threadId:t,draft:a,notify:!0,force:!0})}setDraft(e,t,a,s){const n={_:"draftMessage",date:(0,te.Z)(!0),message:a,pFlags:{},entities:s};t?this.syncDraft(e,t,n,!1,!0):this.saveDraft({peerId:e,threadId:t,draft:n,notify:!0,force:!0})}}var Pt=a(946),bt=a(7746);const Mt={keywords:{},version:0,langCode:_.Z.langPackCode};class St extends G{constructor(){super(...arguments),this.keywordLangPacks={},this.indexedLangPacks={},this.getKeywordsPromises={},this.recent={},this.getRecentEmojisPromises={},this.getCustomEmojiDocumentPromises=new Map}getEmojiKeywords(e=_.Z.langPackCode){const t=this.getKeywordsPromises[e];if(t)return t;const a="emojiKeywords_"+e;return this.getKeywordsPromises[e]=h.Z.get(a).then((t=>((0,fe.Z)(t)||(t={}),(0,Pt.Z)(Mt,t),t.langCode=e,this.keywordLangPacks[e]=t,this.apiManager.invokeApi("messages.getEmojiKeywordsDifference",{lang_code:t.langCode,from_version:t.version}).then((e=>{t.version=e.version;const s=t.keywords,n=e.keywords;for(let e=0,t=n.length;et)))))}getBothEmojiKeywords(){const e=[this.getEmojiKeywords()];return this.networkerFactory.language!==_.Z.langPackCode&&e.push(this.getEmojiKeywords(this.networkerFactory.language)),this.recent.native||e.push(this.getRecentEmojis("native")),Promise.all(e)}indexEmojis(){this.index||(this.index=new ae.Z(void 0,2));for(const e in this.keywordLangPacks){if(this.indexedLangPacks[e])continue;const t=this.keywordLangPacks[e].keywords;for(const e in t){const a=t[e];this.index.indexObject(a,e)}this.indexedLangPacks[e]=!0}}searchEmojis(e){let t;if(this.indexEmojis(),(e=e.toLowerCase().replace(/_/g," ")).trim()){const a=this.index.search(e);t=Array.from(a).reduce(((e,t)=>e.concat(t)),[])}else t=this.recent.native.concat(St.POPULAR_EMOJI).slice(0,32);return t=Array.from(new Set(t)),t}getRecentEmojis(e){var t;const a=this.getRecentEmojisPromises;return null!==(t=a[e])&&void 0!==t?t:a[e]=this.appStateManager.getState().then((t=>{let a=[];if("native"===e){const{recentEmoji:e}=t;a=Array.isArray(e)&&e.length?e:St.POPULAR_EMOJI}else{const{recentCustomEmoji:e}=t;a=Array.isArray(e)&&e.length?e:[]}return this.recent[e]=a}))}pushRecentEmoji(e){const t=e.docId?"custom":"native";e.emoji=(0,bt.Z)(e.emoji),this.getRecentEmojis(t).then((a=>{const s=e.docId||e.emoji;(0,M.Z)(a,s),a.unshift(s),a.splice(32,a.length-32),this.appStateManager.pushToState("custom"===t?"recentCustomEmoji":"recentEmoji",a),this.rootScope.dispatchEvent("emoji_recent",e)}))}getCustomEmojiDocuments(e){return e.length?this.apiManager.invokeApi("messages.getCustomEmojiDocuments",{document_id:e}).then((e=>e.map((e=>this.appDocsManager.saveDoc(e,{type:"customEmoji",docId:e.id}))))):Promise.resolve([])}getCachedCustomEmojiDocuments(e){return e.map((e=>this.appDocsManager.getDoc(e)))}setDebouncedGetCustomEmojiDocuments(){!this.getCustomEmojiDocumentsPromise&&this.getCustomEmojiDocumentPromises.size&&(this.getCustomEmojiDocumentsPromise=(0,P.Z)(0).then((()=>{const e=[...this.getCustomEmojiDocumentPromises.keys()],t=[];do{const a=e.splice(0,100),s=this.getCustomEmojiDocuments(a).then((e=>{e.forEach(((e,t)=>{const s=a[t],n=this.getCustomEmojiDocumentPromises.get(s);this.getCustomEmojiDocumentPromises.delete(s),n.resolve(e)}))}));t.push(s)}while(e.length);return Promise.all(t)})).finally((()=>{this.getCustomEmojiDocumentsPromise=void 0,this.setDebouncedGetCustomEmojiDocuments()})))}getCustomEmojiDocument(e){let t=this.getCustomEmojiDocumentPromises.get(e);if(t)return t;return this.appDocsManager.getDoc(e)||(t=(0,v.Z)(),this.getCustomEmojiDocumentPromises.set(e,t),this.setDebouncedGetCustomEmojiDocuments(),t)}getCustomEmojis(){return this.appStickersManager.getEmojiStickers()}}St.POPULAR_EMOJI=["😂","😘","❤️","😍","😊","😁","👍","☺️","😔","😄","😭","💋","😒","😳","😜","🙈","😉","😃","😢","😝","😱","😡","😏","😞","😅","😚","🙊","😌","😀","😋","😆","👌","😐","😕"];var It=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};class Ct extends G{after(){this.log=(0,S.kg)("GROUP-CALLS"),this.groupCalls=new Map,this.participants=new Map,this.nextOffsets=new Map,this.apiUpdatesManager.addMultipleEventsListeners({updateGroupCall:e=>{this.saveGroupCall(e.call,e.chat_id)},updateGroupCallParticipants:e=>{this.saveGroupCall(e.call);const t=e.call.id;this.saveApiParticipants(t,e.participants)}}),this.rootScope.addEventListener("group_call_update",(e=>{"groupCallDiscarded"===e._&&this.participants.delete(e.id)}))}getCachedParticipants(e){let t=this.participants.get(e);return t||this.participants.set(e,t=new Map),t}prepareToSavingNextOffset(e){const t=this.nextOffsets,a=t.get(e);return{nextOffset:a,setNextOffset:s=>{t.get(e)===a&&t.set(e,s)}}}saveApiParticipant(e,t,a){const s=this.getCachedParticipants(e),n=(0,le.Z)(t.peer),i=s.get(n),r=t.pFlags.left;if(!i&&r)return;t.pFlags.muted||t.pFlags.can_self_unmute||(t.pFlags.can_self_unmute=!0),i?(re(i,t),t=i):s.set(n,t);const o=this.getGroupCall(e);if("groupCall"===(null==o?void 0:o._)){let e=!1;r?(--o.participants_count,e=!0):!t.pFlags.just_joined||i||t.pFlags.self||(++o.participants_count,e=!0),e&&this.rootScope.dispatchEvent("group_call_update",o)}r&&s.delete(n),this.rootScope.dispatchEvent("group_call_participant",{groupCallId:e,participant:t})}saveApiParticipants(e,t,a){t.saved||(t.saved=!0,t.forEach((t=>this.saveApiParticipant(e,t,a))))}editParticipant(e,t,a){return It(this,void 0,void 0,(function*(){this.saveApiParticipant(e,t);const s=t.pFlags.self?o.NM:(0,le.Z)(t.peer),n=yield this.apiManager.invokeApiSingle("phone.editGroupCallParticipant",{call:this.getGroupCallInput(e),participant:s===o.NM?this.appPeersManager.getInputPeerSelf():this.appPeersManager.getInputPeerById(s),muted:a.muted,volume:a.volume,raise_hand:a.raiseHand,video_paused:a.videoPaused,video_stopped:a.videoStopped,presentation_paused:a.presentationPaused});this.apiUpdatesManager.processUpdateMessage(n)}))}getGroupCall(e){return this.groupCalls.get(e)}getGroupCallFull(e,t){return It(this,void 0,void 0,(function*(){const a=this.getGroupCall(e);if(a&&"inputGroupCall"!==a._&&!t)return a;const s=this.getCachedParticipants(e).size?0:100;return this.apiManager.invokeApiSingleProcess({method:"phone.getGroupCall",params:{call:this.getGroupCallInput(e),limit:s},processResult:t=>{this.appUsersManager.saveApiUsers(t.users),this.appChatsManager.saveApiChats(t.chats),this.saveApiParticipants(e,t.participants,!0);const a=this.saveGroupCall(t.call);return s&&void 0===this.nextOffsets.get(e)&&this.nextOffsets.set(e,t.participants_next_offset),a}})}))}saveGroupCall(e,t){const a=this.groupCalls.get(e.id),s="inputGroupCall"!==e._&&(!a||"groupCallDiscarded"!==a._);return a?(s&&re(a,e),e=a):this.groupCalls.set(e.id,e),s&&this.rootScope.dispatchEvent("group_call_update",e),e}createGroupCall(e,t,a){return It(this,void 0,void 0,(function*(){const s=yield this.apiManager.invokeApi("phone.createGroupCall",{peer:this.appPeersManager.getInputPeerById(e.toPeerId(!0)),random_id:(0,Ee.d)(32),schedule_date:t,title:a});return this.apiUpdatesManager.processUpdateMessage(s),s.updates.find((e=>"updateGroupCall"===e._)).call}))}getGroupCallInput(e){const t=this.getGroupCall(e);return{_:"inputGroupCall",id:t.id,access_hash:t.access_hash}}getGroupCallParticipants(e){return It(this,void 0,void 0,(function*(){const{nextOffset:t,setNextOffset:a}=this.prepareToSavingNextOffset(e);return""!==t&&(yield this.apiManager.invokeApiSingleProcess({method:"phone.getGroupParticipants",params:{call:this.getGroupCallInput(e),ids:[],sources:[],offset:t||"",limit:100},processResult:t=>{const s=t.count===t.participants.length?"":t.next_offset;this.appChatsManager.saveApiChats(t.chats),this.appUsersManager.saveApiUsers(t.users),this.saveApiParticipants(e,t.participants),a(s)}})),{participants:this.getCachedParticipants(e),isEnd:""===this.nextOffsets.get(e)}}))}hangUp(e,t){const a=this.getGroupCallInput(e);let s;return s="boolean"==typeof t&&t?this.apiManager.invokeApi("phone.discardGroupCall",{call:a}):"number"==typeof t?this.apiManager.invokeApi("phone.leaveGroupCall",{call:a,source:t}):this.apiManager.invokeApi("phone.joinGroupCall",{call:a,join_as:this.appPeersManager.getInputPeerSelf(),muted:!0,video_stopped:!0,params:{_:"dataJSON",data:""}}),s.then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}))}joinGroupCall(e,t,a){return It(this,void 0,void 0,(function*(){const s=this.getGroupCallInput(e);let n;if("main"===a.type){const i={call:s,join_as:this.appPeersManager.getInputPeerSelf(),params:t,muted:a.isMuted,video_stopped:!a.joinVideo};n=this.apiManager.invokeApi("phone.joinGroupCall",i),this.log(`[api] joinGroupCall id=${e}`,i)}else{const a={call:s,params:t};n=this.apiManager.invokeApi("phone.joinGroupCallPresentation",a),this.log(`[api] joinGroupCallPresentation id=${e}`,a)}const i=yield n;return this.apiUpdatesManager.processUpdateMessage(i),i.updates.find((e=>"updateGroupCallConnection"===e._))}))}leaveGroupCallPresentation(e){return this.apiManager.invokeApi("phone.leaveGroupCallPresentation",{call:this.getGroupCallInput(e)}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}))}}function kt(e){return{_:"inputPhoto",id:e.id,access_hash:e.access_hash,file_reference:e.file_reference}}function wt(e){return{_:"inputMediaPhoto",id:kt(e),ttl_seconds:0,pFlags:{}}}var At=a(515);function Ut(e){return{_:"inputMediaDocument",id:{_:"inputDocument",id:e.id,access_hash:e.access_hash,file_reference:e.file_reference},ttl_seconds:0,pFlags:{}}}class Dt extends G{constructor(){super(...arguments),this.inlineResults={},this.setHash={}}getGeoInput(e){return"geoPoint"===e._?{_:"inputGeoPoint",lat:e.lat,long:e.long,accuracy_radius:e.accuracy_radius}:{_:"inputGeoPointEmpty"}}getInlineResults(e,t,a="",s="",n){return this.apiManager.invokeApi("messages.getInlineBotResults",{bot:this.appUsersManager.getUserInput(t),peer:this.appPeersManager.getInputPeerById(e),query:a,geo_point:n?this.getGeoInput(n):void 0,offset:s},{stopTime:-1,noErrorBox:!0}).then((e=>{const t=e.query_id;return e.results.forEach((e=>{"botInlineMediaResult"===e._&&(e.document&&(e.document=this.appDocsManager.saveDoc(e.document)),e.photo&&(e.photo=this.appPhotosManager.savePhoto(e.photo))),this.inlineResults[(0,At.Z)(t,e.id)]=e})),e}))}pushPopularBot(e){this.appUsersManager.getTopPeers("bots_inline").then((t=>{const a=e.toPeerId(),s=t.findIndex((e=>e.id===a));let n;n=-1!==s?t[s]:{id:a,rating:0},++n.rating,(0,ie.Z)(t,n,"rating"),this.appStateManager.setKeyValueToStorage("topPeersCache")}))}switchToPM(e,t,a){return this.setHash[t]={peerId:e,time:Date.now()},this.appMessagesManager.startBot(t,void 0,a)}checkSwitchReturn(e){return t=this,a=void 0,n=function*(){const t=this.appUsersManager.getUser(e);if(!t||!t.pFlags.bot||!t.bot_inline_placeholder)return;const a=this.setHash[e];return a&&(delete this.setHash[e],Date.now()-a.time<36e5)?a.peerId:void 0},new((s=void 0)||(s=Promise))((function(e,i){function r(e){try{p(n.next(e))}catch(e){i(e)}}function o(e){try{p(n.throw(e))}catch(e){i(e)}}function p(t){var a;t.done?e(t.value):(a=t.value,a instanceof s?a:new s((function(e){e(a)}))).then(r,o)}p((n=n.apply(t,a||[])).next())}));var t,a,s,n}switchInlineQuery(e,t,a,s){this.appDraftsManager.setDraft(e,t,"@"+this.appPeersManager.getPeerUsername(a.toPeerId())+" "+s)}callbackButtonClick(e,t,a){return this.apiManager.invokeApi("messages.getBotCallbackAnswer",{peer:this.appPeersManager.getInputPeerById(e),msg_id:(0,oe.Z)(t),data:a.data},{stopTime:-1,noErrorBox:!0})}sendInlineResult(e,t,a,s={}){const n=this.inlineResults[a];if(!n)return;this.pushPopularBot(t);const i=a.split("_"),r=i.shift(),o=i.join("_");if(s.viaBotId=t,s.queryId=r,s.resultId=o,n.send_message.reply_markup&&(s.replyMarkup=n.send_message.reply_markup),"botInlineMessageText"===n.send_message._)s.entities=n.send_message.entities,this.appMessagesManager.sendText(e,n.send_message.message,s);else{let t,a,i="";const r=n.send_message;switch(r._){case"botInlineMessageMediaAuto":if(i=r.message,"botInlineMediaResult"===n._){const{document:e,photo:a}=n;t=e?Ut(e):wt(a)}break;case"botInlineMessageMediaGeo":t={_:"inputMediaGeoPoint",geo_point:this.getGeoInput(r.geo)},s.geoPoint=r.geo;break;case"botInlineMessageMediaVenue":t={_:"inputMediaVenue",geo_point:this.getGeoInput(r.geo),title:r.title,address:r.address,provider:r.provider,venue_id:r.venue_id,venue_type:r.venue_type},s.geoPoint=r.geo;break;case"botInlineMessageMediaContact":t={_:"inputMediaContact",phone_number:r.phone_number,first_name:r.first_name,last_name:r.last_name,vcard:r.vcard};break;case"botInlineMessageMediaInvoice":a={_:"messageMediaInvoice",title:r.title,description:r.description,photo:r.photo,currency:r.currency,total_amount:r.total_amount,pFlags:{shipping_address_requested:r.pFlags.shipping_address_requested,test:r.pFlags.test},start_param:void 0}}!t&&a&&(t={_:"messageMediaPending",messageMedia:a}),this.appMessagesManager.sendOther(e,t,s)}}}var Et=a(7082);class Tt{constructor(){this.tempNum=0}generateTempMessageId(e){const t=++this.tempNum;return(0,pe.Z)(e)+(t&Et.o-1)}}var Ft=a(4421),Rt=a(3624),xt=a(7401);function Bt(e,t){if(e.length{let o=e.slice(s,r);const p=n++;o.length>t&&(Bt(o.slice(t),t).forEach((e=>{i[n++]=e})),o=o.slice(0,t)),s=r,a=0,i[p]=(i[p]||"")+o};let o=0;for(;;){let s=e.indexOf(" ",o);if(-1===s){o!==e.length-1&&r();break}s+=" ".length;const n=s-o;a+n>t&&r(a),o=s,a+=n}return i}var Vt=a(5701),Ot=a(7667),Lt=a(6241),Nt=a(6535),Zt=a(6566),jt=a(2202),qt=a(319);const Gt=new class{constructor(){this.tabs=new Map}start(){f.Z.getInstance().addEventListener("tabState",((e,t)=>{this.tabs.get(t).state=e}))}getTabs(){return[...this.tabs.values()].filter((e=>!!e.state))}addTab(e){const t={source:e,state:void 0};this.tabs.set(e,t)}deleteTab(e){this.tabs.delete(e)}};d.GO&&(d.GO.appTabsManager=Gt);const Ht=Gt;var Wt=a(2381),zt=a(13);function Kt(e){return{_:"inputDocument",id:e.id,access_hash:e.access_hash,file_reference:e.file_reference}}var Jt=a(5285),$t=a(5102);function Qt(e,t,a){a?e[t]=!0:delete e[t]}var Yt=a(4993),Xt=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};const ea=e=>{e()};class ta extends G{constructor(){super(...arguments),this.pendingByRandomId={},this.pendingByMessageId={},this.pendingAfterMsgs={},this.pendingTopMsgs={},this.tempFinalizeCallbacks={},this.sendSmthLazyLoadQueue=new Ft.Z(10),this.needSingleMessages=new Map,this.extendedMedia=new Map,this.maxSeenId=0,this.migratedFromTo={},this.migratedToFrom={},this.newDialogsToHandle=new Map,this.newUpdatesAfterReloadToHandle={},this.notificationsToHandle={},this.reloadConversationsPeers=new Map,this.log=(0,S.kg)("MESSAGES",S.v9.Error|S.v9.Debug|S.v9.Log|S.v9.Warn),this.groupedTempId=0,this.typings={},this.unreadMentions={},this.goToNextMentionPromises={},this.batchUpdates={},this.clear=e=>{this.middleware?this.middleware.clean():(this.middleware=(0,Rt.k)(),this.uploadFilePromises={}),this.messagesStorageByPeerId={},this.groupedMessagesStorage={},this.scheduledMessagesStorage={},this.historiesStorage={},this.threadsStorage={},this.searchesStorage={},this.pinnedMessages={},this.threadsServiceMessagesIdsStorage={},this.threadsToReplies={},this.dialogsStorage&&this.dialogsStorage.clear(e),this.filtersStorage&&this.filtersStorage.clear(e)},this.handleNewDialogs=()=>{let e=0;const t=new Map,a=a=>{var s;const{peerId:n}=a;this.dialogsStorage.pushDialog({dialog:a}),this.appPeersManager.isChannel(n)||(e=Math.max(e,a.top_message||0));let i=t.get(n);i||t.set(n,i={}),"forumTopic"===a._?(null!==(s=i.topics)&&void 0!==s?s:i.topics=new Map).set(a.id,a):i.dialog=a};for(const[e,t]of this.newDialogsToHandle){const s="dialog"in t,{dialog:n,topics:i}=t;s&&(n?this.dialogsStorage.getDialogOnly(e)&&a(n):this.reloadConversation(e.toPeerId())),i&&(null==i||i.forEach(((t,s)=>{t?this.dialogsStorage.getForumTopic(e,s)&&a(t):this.dialogsStorage.getForumTopicById(e,s)})))}0!==e&&this.incrementMaxSeenId(e),this.rootScope.dispatchEvent("dialogs_multiupdate",t),this.newDialogsToHandle.clear()},this.handleNotifications=()=>{T.Z.clearTimeout(this.notificationsHandlePromise),this.notificationsHandlePromise=void 0;for(const e in this.notificationsToHandle){const[t,a]=e.split("_"),s=this.notificationsToHandle[e];this.getNotifyPeerSettings(t.toPeerId(),a?+a:void 0).then((({muted:e,peerTypeNotifySettings:t})=>{const a=s.topMessage;e&&!a.pFlags.mentioned||!a.pFlags.unread||a.pFlags.unread&&this.notifyAboutMessage(a,{fwdCount:s.fwdCount,peerTypeNotifySettings:t})}))}this.notificationsToHandle={}},this.onUpdateMessageId=e=>{const t=e.random_id;if(!this.pendingByRandomId[t])return;const a=(0,pe.Z)(e.id);this.pendingByMessageId[a]=t},this.onUpdateNewMessage=e=>{var t,a,s,n;const i=e.message,r=this.getMessagePeer(i),p=this.getHistoryMessagesStorage(r),d="updateNewDiscussionMessage"===e._;this.saveMessages([i],{storage:this.createMessageStorage(r,"history")});const f=this.appPeersManager.isForum(r),c=this.getThreadKey(i),l=c?+c.split("_")[1]:void 0,m=this.dialogsStorage.getDialogOrTopic(r,d?l:void 0);if((!m||this.reloadConversationsPeers.has(r))&&!d){let t=!0;if(r.isAnyChat()&&(t=this.appChatsManager.isInChat(r.toChatId())),t)return void this.handleNewUpdateAfterReload(r,e)}if(l&&!d){const e=null===(t=this.threadsStorage[r])||void 0===t?void 0:t[l],a={_:"updateNewDiscussionMessage",message:i};this.appChatsManager.isForum(r.toChatId())&&!this.dialogsStorage.getForumTopic(r,l)?this.handleNewUpdateAfterReload(r,a,l):e&&this.onUpdateNewMessage(a)}if("messageService"===i._){const{action:e}=i;if("messageActionPaymentSent"===e._&&i.reply_to&&this.rootScope.dispatchEvent("payment_sent",{peerId:i.reply_to.reply_to_peer_id?this.appPeersManager.getPeerId(i.reply_to.reply_to_peer_id):i.peerId,mid:i.reply_to_mid,receiptMessage:i}),"messageActionTopicEdit"===e._&&!d){const t=this.dialogsStorage.getForumTopic(r,l);if(t){const a=(0,ve.Z)(t);void 0!==e.title&&(t.title=e.title),void 0!==e.closed&&Qt(t.pFlags,"closed",e.closed),void 0!==e.hidden&&Qt(t.pFlags,"hidden",e.hidden),void 0!==e.icon_emoji_id&&(t.icon_emoji_id=e.icon_emoji_id),this.scheduleHandleNewDialogs(r,t),this.dialogsStorage.processTopicUpdate(t,a)}else this.dialogsStorage.getForumTopicById(r,l)}}this.saveMessages([i],{storage:p}),this.checkPendingMessage(i);const g=this.getHistoryStorage(r,d?l:void 0);d||this.updateMessageRepliesIfNeeded(i);const h=e.ignoreExisting;if(g.history.findSlice(i.mid)){if(!h)return!1}else{const e=g.history.first;if(e.isEnd(se.D.Bottom)){let t=0;for(const a=e.length;te[t]);++t);e.splice(t,0,i.mid)}else g.history.unshift(i.mid);null!==g.count&&++g.count}(!g.maxId||i.mid>g.maxId)&&(g.maxId=i.mid),this.mergeReplyKeyboard(g,i)&&this.rootScope.dispatchEvent("history_reply_markup",{peerId:r});const u=i.fromId;if(u.isUser()&&!i.pFlags.out&&i.from_id){this.appUsersManager.forceUserOnline(u,i.date);const e={_:"sendMessageCancelAction"};let t;t=r.isUser()?{_:"updateUserTyping",action:e,user_id:u}:this.appPeersManager.isChannel(r)?{_:"updateChannelUserTyping",action:e,channel_id:r.toChatId(),from_id:this.appPeersManager.getOutputPeer(u),top_msg_id:l?(0,oe.Z)(l):void 0}:{_:"updateChatUserTyping",action:e,chat_id:r.toChatId(),from_id:this.appPeersManager.getOutputPeer(u)},this.apiUpdatesManager.processLocalUpdate(t)}this.handleNewMessage(i);const y="forumTopic"===(null==m?void 0:m._);if(d&&!y||!m)return;const _=!i.pFlags.out&&i.pFlags.unread;if(_&&i.mid>m.top_message){const e=this.dialogsStorage.prepareDialogUnreadCountModifying(m);++m.unread_count,i.pFlags.mentioned&&(++m.unread_mentions_count,this.modifyCachedMentions(r,i.mid,!0,y?l:void 0)),e()}if(i.mid>=m.top_message&&this.setDialogTopMessage(i,m),(!d&&!f||y)&&_){const e=c||r,t=null!==(a=(n=this.notificationsToHandle)[e])&&void 0!==a?a:n[e]={fwdCount:0,fromId:o.NM};t.fromId!==u&&(t.fromId=u,t.fwdCount=0),i.fwd_from&&++t.fwdCount,t.topMessage=i,null!==(s=this.notificationsHandlePromise)&&void 0!==s||(this.notificationsHandlePromise=T.Z.setTimeout(this.handleNotifications,0))}},this.onUpdateMessageReactions=e=>{const{peer:t,msg_id:a,reactions:s}=e,n=(0,pe.Z)(a),i=this.appPeersManager.getPeerId(t),r=this.getMessageByPeer(i,n);if("message"!==(null==r?void 0:r._))return;const o=null==s?void 0:s.recent_reactions;if((null==o?void 0:o.length)&&r.pFlags.out){const e=o[o.length-1],t=r.reactions,a=null==t?void 0:t.recent_reactions;this.appPeersManager.getPeerId(e.peer_id)===this.appPeersManager.peerId||a&&!(a.length<=o.length)||a&&(0,Y.Z)(e,a[a.length-1])||this.getNotifyPeerSettings(i).then((({muted:t,peerTypeNotifySettings:a})=>{a.show_previews&&this.notifyAboutMessage(r,{peerReaction:e,peerTypeNotifySettings:a})}))}const p=r.peerId+"_"+r.mid;this.pushBatchUpdate("messages_reactions",this.batchUpdateReactions,p,(()=>(0,ve.Z)(r.reactions))),r.reactions=s,e.local||this.setDialogToStateIfMessageIsTop(r)},this.onUpdateDialogUnreadMark=e=>{const t=this.appPeersManager.getPeerId(e.peer.peer),a=this.getDialogOnly(t);if(a){const s=this.dialogsStorage.prepareDialogUnreadCountModifying(a);e.pFlags.unread?a.pFlags.unread_mark=!0:delete a.pFlags.unread_mark,s(),this.dialogsStorage.setDialogToState(a),this.rootScope.dispatchEvent("dialogs_multiupdate",new Map([[t,{dialog:a}]]))}else this.scheduleHandleNewDialogs(t)},this.onUpdateEditMessage=e=>{var t,a;const s=e.message,n=this.getMessagePeer(s),i=(0,pe.Z)(s.id),r=this.getHistoryMessagesStorage(n);if(!r.has(i))return;const o=this.getMessageFromStorage(r,i);this.saveMessages([s],{storage:r});const p=this.getMessageFromStorage(r,i);this.handleEditedMessage(o,p,r);const d=this.getDialogOnly(n),f=(null==d?void 0:d.top_message)===i;if(s.clear_history)f&&this.rootScope.dispatchEvent("dialog_flush",{peerId:n,dialog:d});else{let e=!0;if("message"===(null==o?void 0:o._)&&!(0,Y.Z)(o.reactions,p.reactions)){const t=p.reactions;p.reactions=o.reactions,this.apiUpdatesManager.processLocalUpdate({_:"updateMessageReactions",peer:this.appPeersManager.getOutputPeer(n),msg_id:s.id,reactions:t}),e=!1}e&&this.rootScope.dispatchEvent("message_edit",{storageKey:r.key,peerId:n,mid:i,message:s}),f&&this.dialogsStorage.setDialogToState(d);const c=new Map,l=()=>{let e=c.get(n);return e||c.set(n,e={}),e};(f||s.grouped_id)&&d&&(l().dialog=d);const m=this.getThreadKey(s);if(m){const e=+m.split("_")[1],s=this.dialogsStorage.getForumTopic(n,e);s&&(null!==(t=(a=l()).topics)&&void 0!==t?t:a.topics=new Map).set(e,s)}c.size&&this.rootScope.dispatchEvent("dialogs_multiupdate",c)}},this.onUpdateReadHistory=e=>{const t=e.channel_id,a=(0,pe.Z)(e.max_id||e.read_max_id),s=(0,pe.Z)(e.top_msg_id),n=t?t.toPeerId(!0):this.appPeersManager.getPeerId(e.peer),i="updateReadHistoryOutbox"===e._||"updateReadChannelOutbox"===e._||"updateReadChannelDiscussionOutbox"===e._||void 0,r=!!t&&this.appChatsManager.isForum(t),o=this.getHistoryMessagesStorage(n),p=(0,xt.Z)(o,"desc"),d=s&&r?this.dialogsStorage.getForumTopic(n,s):this.getDialogOnly(n),f=e.still_unread_count;let c=0,l=0,m=!1;const g=this.getHistoryStorage(n,s);if(n.isUser()&&i&&this.appUsersManager.forceUserOnline(n.toUserId()),s){const e=this.threadsToReplies[n+"_"+s];if(e){const[t,a]=e.split("_");this.updateMessage(t.toPeerId(),+a,"replies_updated")}}const h=d&&this.dialogsStorage.prepareDialogUnreadCountModifying(d),u=this.getReadMaxIdIfUnread(n,s);for(let e=0,t=p.length;ea)continue;const g=o.get(t);if(g.pFlags.out!==i)continue;const h=(0,Yt.Z)(g,r);if(!s||h===s){if(!(g.pFlags.unread||u&&u=d.top_message||!u?e=0:c&&d.top_message>a&&(e=c),void 0!==e&&(d.unread_count=e),(l<0||!d.unread_count)&&(d.unread_mentions_count=0)}null==h||h(),this.dialogsStorage.processDialogForFilters(d),this.rootScope.dispatchEvent("dialog_unread",{peerId:n,dialog:d}),this.dialogsStorage.setDialogToState(d),m||void 0!==f||i||!d.unread_count||("forumTopic"===d._?this.dialogsStorage.getForumTopicById(n,s):this.reloadConversation(n))}if(m&&this.rootScope.dispatchEvent("messages_read"),!s&&t){const e=n+"_";for(const t in this.threadsToReplies)if(0===t.indexOf(e)){const[e,a]=this.threadsToReplies[t].split("_");this.rootScope.dispatchEvent("replies_updated",this.getMessageByPeer(e.toPeerId(),+a))}}},this.onUpdateReadMessagesContents=e=>{const t=e.channel_id,a=e.top_msg_id,s=a?(0,pe.Z)(a):void 0,n=e.messages.map((e=>(0,pe.Z)(e))),i=t?t.toPeerId(!0):this.findPeerIdByMids(n);for(let e=0,t=n.length;e{const t=e.channel_id.toPeerId(!0),a=this.getHistoryStorage(t).history.slice,s=(0,pe.Z)(e.available_min_id),n=a.filter((e=>e<=s));e.messages=n,this.onUpdateDeleteMessages(e)},this.onUpdateDeleteMessages=e=>{var t;const a=e.channel_id,s=e.messages.map((e=>(0,pe.Z)(e))),n=a?a.toPeerId(!0):this.findPeerIdByMids(s);if(!n)return;this.apiManager.clearCache("messages.getSearchCounters",(e=>this.appPeersManager.getPeerId(e.peer)===n));const i=new Set,r=new Map;for(const e of s){const a=this.getMessageByPeer(n,e),s=this.getThreadKey(a);if(!s)continue;const o=+s.split("_")[1];if((null===(t=this.threadsStorage[n])||void 0===t?void 0:t[o])&&(i.add(s),!r.has(o))){const e=this.dialogsStorage.getForumTopic(n,o);e&&r.set(o,e)}}const o=this.handleDeletedMessages(n,this.getHistoryMessagesStorage(n),s),p=Array.from(i).map((e=>{const[t,a]=e.split("_");return this.getHistoryStorage(t.toPeerId(),+a)}));[this.getHistoryStorage(n),...p].forEach((e=>{for(const t of o.msgs)e.history.delete(t);o.count&&e.count&&(e.count=Math.max(0,e.count-o.count))})),this.rootScope.dispatchEvent("history_delete",{peerId:n,msgs:o.msgs});const d=[...r.values()],f=this.getDialogOnly(n);f&&d.unshift(f),d.forEach((e=>{const t="forumTopic"===e._,a=o.unreadMentions||o.unread,s=a&&this.dialogsStorage.prepareDialogUnreadCountModifying(e);if(o.unread&&(e.unread_count=Math.max(0,e.unread_count-o.unread)),o.unreadMentions&&(e.unread_mentions_count=e.unread_count?Math.max(0,e.unread_mentions_count-o.unreadMentions):0),a&&(s(),t||this.rootScope.dispatchEvent("dialog_unread",{peerId:n,dialog:e})),o.msgs.has(e.top_message)){const a=this.getHistoryStorage(e.peerId,t?e.id:void 0).history.first;if(a.isEnd(se.D.Bottom)&&a.length){const t=a[0],s=this.getMessageByPeer(n,t);this.setDialogTopMessage(s,e)}else t?this.dialogsStorage.getForumTopicById(n,e.id):this.reloadConversation(n)}}))},this.onUpdateChannel=e=>{const t=e.channel_id,a=t.toPeerId(!0),s=this.appChatsManager.getChat(t),n=this.appChatsManager.isInChat(t);(!!(0,$t.Z)(s)[0]||!s.pFlags.left)!=(void 0!==this.historiesStorage[a])&&(delete this.historiesStorage[a],this.rootScope.dispatchEvent("history_forbidden",a)),!!this.getDialogOnly(a)!==n&&(n?this.reloadConversation(a):this.dialogsStorage.dropDialogOnDeletion(a)),this.rootScope.dispatchEvent("channel_update",t)},this.onUpdateChannelReload=e=>{const t=e.channel_id.toPeerId(!0);this.flushStoragesByPeerId(t),Promise.all([this.reloadConversation(t)]).then((()=>{this.rootScope.dispatchEvent("history_reload",t)}))},this.onUpdateChannelMessageViews=e=>{var t;const a=e.views,s=null!==(t=e.peerId)&&void 0!==t?t:e.channel_id.toPeerId(!0),n=(0,pe.Z)(e.id),i=this.getMessageByPeer(s,n);void 0!==(null==i?void 0:i.views)&&i.views{var t;if(null===(t=e.pFlags)||void 0===t?void 0:t.popup)return void this.rootScope.dispatchEvent("service_notification",e);const a=o.yF,s=a,n=this.generateTempMessageId(s),i={_:"message",id:n,from_id:this.appPeersManager.getOutputPeer(a),peer_id:this.appPeersManager.getOutputPeer(s),pFlags:{unread:!0},date:(e.inbox_date||(0,te.Z)(!0))+this.timeManager.getServerTimeOffset(),message:e.message,media:e.media,entities:e.entities};this.appUsersManager.hasUser(a)||this.appUsersManager.saveApiUsers([{_:"user",id:a,pFlags:{verified:!0},access_hash:"0",first_name:"Telegram",phone:"42777"}]),this.saveMessages([i],{isOutgoing:!0}),e.inbox_date&&(this.pendingTopMsgs[s]=n,this.onUpdateNewMessage({_:"updateNewMessage",message:i,pts:void 0,pts_count:void 0}))},this.onUpdatePinnedMessages=e=>{const t="updatePinnedChannelMessages"===e._?e.channel_id:void 0,a=t?t.toPeerId(!0):this.appPeersManager.getPeerId(e.peer),s=e.messages.map((e=>(0,pe.Z)(e))),n=this.getHistoryMessagesStorage(a),i=s.filter((e=>!n.has(e)));(i.length?Promise.all(i.map((e=>this.reloadMessages(a,e)))):Promise.resolve()).finally((()=>{var t;const i=null===(t=e.pFlags)||void 0===t?void 0:t.pinned;if(i)for(const e of s)n.get(e).pFlags.pinned=!0;else for(const e of s)delete n.get(e).pFlags.pinned;delete this.pinnedMessages[this.getPinnedMessagesKey(a)],this.appStateManager.getState().then((e=>{delete e.hiddenPinnedMessages[a],this.rootScope.dispatchEvent("peer_pinned_messages",{peerId:a,mids:s,pinned:i})}))}))},this.onUpdateNotifySettings=e=>{const{peer:t,notify_settings:a}=e,s="notifyForumTopic"===t._;if("notifyPeer"!==t._&&!s)return;const n=this.appPeersManager.getPeerId(t.peer),i=this.dialogsStorage.getDialogOrTopic(n,s?(0,pe.Z)(t.top_msg_id):void 0);i&&(i.notify_settings=a,this.rootScope.dispatchEvent("dialog_notify_settings",i),this.dialogsStorage.setDialogToState(i))},this.onUpdateNewScheduledMessage=e=>{const t=e.message,a=this.getMessagePeer(t),s=this.scheduledMessagesStorage[a];if(!s)return;const n=(0,pe.Z)(t.id),i=this.getMessageFromStorage(s,n);this.saveMessages([t],{storage:s,isScheduled:!0});const r=this.getMessageFromStorage(s,n);i?(this.handleEditedMessage(i,r,s),this.rootScope.dispatchEvent("message_edit",{storageKey:s.key,peerId:a,mid:t.mid,message:t})):this.checkPendingMessage(t)||this.rootScope.dispatchEvent("scheduled_new",t)},this.onUpdateDeleteScheduledMessages=e=>{const t=this.appPeersManager.getPeerId(e.peer),a=this.scheduledMessagesStorage[t];if(a){const s=e.messages.map((e=>(0,pe.Z)(e)));this.handleDeletedMessages(t,a,s),this.rootScope.dispatchEvent("scheduled_delete",{peerId:t,mids:s})}},this.onUpdateMessageExtendedMedia=e=>{var t;const a=this.appPeersManager.getPeerId(e.peer),s=(0,pe.Z)(e.msg_id),n=this.getHistoryMessagesStorage(a);if(!n.has(s))return;const i=this.getMessageFromStorage(n,s),r=i.media;"messageExtendedMedia"!==(null===(t=r.extended_media)||void 0===t?void 0:t._)&&(r.extended_media=e.extended_media,this.onUpdateEditMessage({_:"updateEditMessage",message:i,pts:0,pts_count:0}))},this.onUpdateTranscribedAudio=e=>{const t=this.appPeersManager.getPeerId(e.peer),a=e.text,s=(0,pe.Z)(e.msg_id);this.rootScope.dispatchEvent("message_transcribed",{peerId:t,mid:s,text:a,pending:e.pFlags.pending})},this.batchUpdateViews=e=>{const t=[],a=this.getMessagesFromMap(e);for(const[e]of a)t.push({peerId:e.peerId,mid:e.mid,views:e.views});return t},this.batchUpdateReactions=e=>{var t,a,s;const n=[],i=this.getMessagesFromMap(e);for(const[e,r]of i){const i=null!==(a=null===(t=e.reactions)||void 0===t?void 0:t.results)&&void 0!==a?a:[],o=null!==(s=null==r?void 0:r.results)&&void 0!==s?s:[],p=i.filter((t=>{const a=o.find((e=>(0,Jt.Z)(e.reaction,t.reaction)));return e.pFlags.out&&(!a||t.count>a.count)||void 0!==t.chosen_order&&(!a||void 0===a.chosen_order)}));n.push({message:e,changedResults:p})}return n}}after(){return this.clear(!0),this.apiUpdatesManager.addMultipleEventsListeners({updateMessageID:this.onUpdateMessageId,updateNewDiscussionMessage:this.onUpdateNewMessage,updateNewMessage:this.onUpdateNewMessage,updateNewChannelMessage:this.onUpdateNewMessage,updateDialogUnreadMark:this.onUpdateDialogUnreadMark,updateEditMessage:this.onUpdateEditMessage,updateEditChannelMessage:this.onUpdateEditMessage,updateMessageReactions:this.onUpdateMessageReactions,updateReadChannelDiscussionInbox:this.onUpdateReadHistory,updateReadChannelDiscussionOutbox:this.onUpdateReadHistory,updateReadHistoryInbox:this.onUpdateReadHistory,updateReadHistoryOutbox:this.onUpdateReadHistory,updateReadChannelInbox:this.onUpdateReadHistory,updateReadChannelOutbox:this.onUpdateReadHistory,updateChannelReadMessagesContents:this.onUpdateReadMessagesContents,updateReadMessagesContents:this.onUpdateReadMessagesContents,updateChannelAvailableMessages:this.onUpdateChannelAvailableMessages,updateDeleteMessages:this.onUpdateDeleteMessages,updateDeleteChannelMessages:this.onUpdateDeleteMessages,updateChannel:this.onUpdateChannel,updateChannelReload:this.onUpdateChannelReload,updateChannelMessageViews:this.onUpdateChannelMessageViews,updateServiceNotification:this.onUpdateServiceNotification,updatePinnedMessages:this.onUpdatePinnedMessages,updatePinnedChannelMessages:this.onUpdatePinnedMessages,updateNotifySettings:this.onUpdateNotifySettings,updateNewScheduledMessage:this.onUpdateNewScheduledMessage,updateDeleteScheduledMessages:this.onUpdateDeleteScheduledMessages,updateMessageExtendedMedia:this.onUpdateMessageExtendedMedia,updateTranscribedAudio:this.onUpdateTranscribedAudio}),this.rootScope.addEventListener("notify_peer_type_settings",(({key:e,settings:t})=>{let a;a="notifyUsers"===e?e=>e.peerId.isUser():"notifyBroadcasts"===e?e=>this.appPeersManager.isBroadcast(e.peerId):e=>this.appPeersManager.isAnyGroup(e.peerId),this.dialogsStorage.getFolderDialogs(0).concat(this.dialogsStorage.getFolderDialogs(1)).filter(a).forEach((e=>{this.rootScope.dispatchEvent("dialog_notify_settings",e)}))})),this.rootScope.addEventListener("webpage_updated",(({id:e,msgs:t})=>{t.forEach((({peerId:t,mid:a,isScheduled:s})=>{const n=s?this.getScheduledMessagesStorage(t):this.getHistoryMessagesStorage(t),i=this.getMessageFromStorage(n,a);i&&(i.media={_:"messageMediaWebPage",webpage:this.appWebPagesManager.getCachedWebPage(e)},this.rootScope.dispatchEvent("message_edit",{storageKey:n.key,peerId:t,mid:a,message:i}))}))})),this.rootScope.addEventListener("draft_updated",(({peerId:e,threadId:t,draft:a})=>{const s=this.dialogsStorage.getDialogOrTopic(e,t);if(s){s.draft=a;let t=!1;a||(0,oe.Z)(s.top_message)?(this.dialogsStorage.generateIndexForDialog(s),this.dialogsStorage.pushDialog({dialog:s})):(this.dialogsStorage.dropDialog(e),t=!0),this.rootScope.dispatchEvent("dialog_draft",{peerId:e,dialog:s,drop:t,draft:a})}else if(t){const a=this.appChatsManager.getChat(e.toChatId());a?a.pFlags.forum&&this.dialogsStorage.getForumTopicById(e,t):this.reloadConversation(e)}else this.reloadConversation(e)})),this.rootScope.addEventListener("poll_update",(({poll:e})=>{const t=this.appPollsManager.pollToMessages[e.id];if(t)for(const e of t){const[t,a]=e.split("_"),s=this.getMessageByPeer(t.toPeerId(),+a);s&&this.setDialogToStateIfMessageIsTop(s)}})),this.rootScope.addEventListener("chat_toggle_forum",(({chatId:e,enabled:t})=>{const a=e.toPeerId(!0);if(!t){delete this.threadsStorage[a];for(const e in this.pinnedMessages)+e===a&&e.startsWith(a+"_")&&delete this.pinnedMessages[e]}})),this.batchUpdatesDebounced=(0,Vt.Z)((()=>{for(const e in this.batchUpdates){const t=this.batchUpdates[e];delete this.batchUpdates[e];const a=t.callback(t.batch);!a||a instanceof Array&&!a.length||rootScope.dispatchEvent(e,a)}}),33,!1,!0),this.appStateManager.getState().then((e=>{e.maxSeenMsgId&&(this.maxSeenId=e.maxSeenMsgId)}))}getInputEntities(e){const t=(0,ve.Z)(e);return t.forEach((e=>{"messageEntityMentionName"===e._&&(e._="inputMessageEntityMentionName",e.user_id=this.appUsersManager.getUserInput(e.user_id))})),t}invokeAfterMessageIsSent(e,t,a){var s,n,i;const r=null!==(s=(i=this.tempFinalizeCallbacks)[e])&&void 0!==s?s:i[e]={},o=null!==(n=r[t])&&void 0!==n?n:r[t]={deferred:(0,v.Z)()};return o.callback=a,o.deferred}editMessage(e,t,a={}){const{mid:s,peerId:n}=e;if(e.pFlags.is_outgoing)return this.invokeAfterMessageIsSent(s,"edit",(e=>this.editMessage(e,t,a)));const i=a.entities||[];t&&(t=(0,we.Z)(t,i));const r=a.scheduleDate||(e.pFlags.is_scheduled?e.date:void 0);return this.apiManager.invokeApi("messages.editMessage",{peer:this.appPeersManager.getInputPeerById(n),id:e.id,message:t,media:a.newMedia,entities:i.length?this.getInputEntities(i):void 0,no_webpage:a.noWebPage,schedule_date:r}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}),(e=>{if(this.log.error("editMessage error:",e),!e||"MESSAGE_NOT_MODIFIED"!==e.type)return e&&"MESSAGE_EMPTY"===e.type&&(e.handled=!0),Promise.reject(e);e.handled=!0}))}transcribeAudio(e){return Xt(this,void 0,void 0,(function*(){const{id:t,peerId:a}=e,s=t=>{this.apiUpdatesManager.processLocalUpdate({_:"updateTranscribedAudio",msg_id:e.id,peer:this.appPeersManager.getOutputPeer(a),pFlags:t.pFlags,text:t.text,transcription_id:t.transcription_id})};return this.apiManager.invokeApiSingleProcess({method:"messages.transcribeAudio",params:{peer:this.appPeersManager.getInputPeerById(a),msg_id:t},processResult:e=>(s(e),e),processError:e=>{throw"TRANSCRIPTION_FAILED"!==e.type&&"MSG_VOICE_MISSING"!==e.type||s({_:"messages.transcribedAudio",transcription_id:0,text:"",pFlags:{}}),e}})}))}sendText(e,t,a={}){var s,n;return Xt(this,void 0,void 0,(function*(){if(!t.trim())return;null!==(s=a.entities)&&void 0!==s||(a.entities=[]),a.threadId&&!a.replyToMsgId&&(a.replyToMsgId=a.threadId);const i=(yield this.apiManager.getConfig()).message_length_max,r=Bt(t,i);t=r[0],r.length>1&&("webPage"!==(null===(n=a.webPage)||void 0===n?void 0:n._)||t.includes(a.webPage.url)||delete a.webPage),e=this.appPeersManager.getPeerMigratedTo(e)||e;const o=a.entities;a.viaBotId||(t=(0,we.Z)(t,o));let p=this.getInputEntities(o);p.length||(p=void 0);const d=this.generateOutgoingMessage(e,a);d.entities=o,d.message=t;const f=a.replyToMsgId?(0,oe.Z)(a.replyToMsgId):void 0,c=this.appPeersManager.isChannel(e);a.webPage&&(d.media={_:"messageMediaWebPage",webpage:a.webPage});const l=e=>{this.onMessagesSendError([d],e),this.rootScope.dispatchEvent("messages_pending")};d.send=()=>{l();const s={};this.pendingAfterMsgs[e]&&(s.afterMessageId=this.pendingAfterMsgs[e].messageId);const n=a.sendAsPeerId?this.appPeersManager.getInputPeerById(a.sendAsPeerId):void 0;let i;return i=a.viaBotId?this.apiManager.invokeApiAfter("messages.sendInlineBotResult",{peer:this.appPeersManager.getInputPeerById(e),random_id:d.random_id,reply_to_msg_id:f||void 0,query_id:a.queryId,id:a.resultId,clear_draft:a.clearDraft,send_as:n},s):this.apiManager.invokeApiAfter("messages.sendMessage",{no_webpage:a.noWebPage,peer:this.appPeersManager.getInputPeerById(e),message:t,random_id:d.random_id,reply_to_msg_id:f||void 0,entities:p,clear_draft:a.clearDraft,schedule_date:a.scheduleDate||void 0,silent:a.silent,send_as:n,update_stickersets_order:a.updateStickersetOrder},s),this.pendingAfterMsgs[e]=s,i.then((e=>{if("updateShortSentMessage"===e._){const t=d.promise;delete d.promise;const s=(0,ve.Z)(d);(0,ge.Z)(d,["promise"]),d.promise=t,s.date=e.date,s.id=e.id,s.media=e.media,s.entities=e.entities,this.wrapMessageEntities(s),e.pFlags.out&&(s.pFlags.out=!0),e={_:"updates",users:[],chats:[],seq:0,date:void 0,updates:[{_:"updateMessageID",random_id:d.random_id,id:s.id},{_:a.scheduleDate?"updateNewScheduledMessage":c?"updateNewChannelMessage":"updateNewMessage",message:s,pts:e.pts,pts_count:e.pts_count}]}}else e.updates&&e.updates.forEach((e=>{"updateDraftMessage"===e._&&(e.local=!0)}));this.apiUpdatesManager.processUpdateMessage(e),d.promise.resolve()}),(e=>{throw l(e),d.promise.reject(e),e})).finally((()=>{this.pendingAfterMsgs[e]===s&&delete this.pendingAfterMsgs[e]}))},this.beforeMessageSending(d,{isScheduled:!!a.scheduleDate||void 0,threadId:a.threadId,clearDraft:a.clearDraft,sequential:!0});const m=[d.promise];for(let t=1;t=0){r="audio",p="audio."+("ogg"===d.split("/")[1]?"ogg":"mp3"),P="sendMessageUploadAudioAction",t.isVoiceMessage&&(r="voice",s.pFlags.media_unread=!0);const e={_:"documentAttributeAudio",pFlags:{voice:t.isVoiceMessage||void 0},waveform:t.waveform,duration:t.duration||void 0};g.push(e)}else if(t.isMedia)if(h){r="photo",p="photo."+d.split("/")[1],P="sendMessageUploadPhotoAction";const e={_:"photoSize",w:t.width,h:t.height,type:o.Pt,location:null,size:a.size};y={_:"photo",id:""+s.id,sizes:[e],w:t.width,h:t.height},u&&y.sizes.unshift(u);const n=this.thumbsStorage.getCacheContext(y,e.type);n.downloaded=a.size,n.url=t.objectURL||"",y=this.appPhotosManager.savePhoto(y)}else if(i().VIDEO_MIME_TYPES_SUPPORTED.has(d)){r="video",p="video.mp4",P="sendMessageUploadVideoAction";const e={_:"documentAttributeVideo",pFlags:{round_message:t.isRoundMessage||void 0,supports_streaming:!0},duration:t.duration,w:t.width,h:t.height};g.push(e),t.noSound&&a.size>10240&&a.size<10485760&&g.push({_:"documentAttributeAnimated"})}else r="document",p="document."+d.split("/")[1],P="sendMessageUploadDocumentAction";else r="document",p="document."+d.split("/")[1],P="sendMessageUploadDocumentAction";if(g.push({_:"documentAttributeFilename",file_name:f||p}),-1!==["document","video","audio","voice"].indexOf(r)&&!c){const e=[];if(_={_:"document",id:""+s.id,duration:t.duration,attributes:g,w:t.width,h:t.height,thumbs:e,mime_type:d,size:a.size},t.objectURL){const e=this.thumbsStorage.getCacheContext(_);e.downloaded=a.size,e.url=t.objectURL}let n;if(h)g.push({_:"documentAttributeImageSize",w:t.width,h:t.height}),n={_:"photoSize",w:t.width,h:t.height,type:o.Pt,size:a.size};else if("video"===r&&t.thumb){n={_:"photoSize",w:t.thumb.size.width,h:t.thumb.size.height,type:"local-thumb",size:t.thumb.blob.size};const e=this.thumbsStorage.getCacheContext(_,n.type);e.downloaded=n.size,e.url=t.thumb.url}n&&e.push(n),u&&e.unshift(u),_=this.appDocsManager.saveDoc(_)}this.log("sendFile",r,p,a.type,t);const b=(0,v.Z)(),M=c?void 0:{_:y?"messageMediaPhoto":"messageMediaDocument",pFlags:{},photo:y,document:_};M&&((0,ge.Z)(M,["promise"]),M.promise=b,t.spoiler&&(M.pFlags.spoiler=!0)),s.entities=m,s.message=l,s.media=c?{_:"messageMediaDocument",pFlags:{},document:a}:M;const S=c?void 0:(0,jt.Z)(a);s.uploadingFileName=S,S&&(this.uploadFilePromises[S]=b);const I=e=>{this.onMessagesSendError([s],e),this.rootScope.dispatchEvent("messages_pending")};let C=!1,k=null;s.send=()=>{if(c){const e={_:"inputMediaDocument",id:Kt(a),pFlags:{}};b.resolve(e)}else if(a instanceof File||a instanceof Blob){const n=()=>{var n;let i;return C&&!s.error||(C=!1,k=this.apiFileManager.upload({file:a,fileName:S}),k.catch((a=>{C||(this.log("cancelling upload",M),this.cancelPendingMessage(s.random_id),this.setTyping(e,{_:"sendMessageCancelAction"},void 0,t.threadId),b.reject(a))})),k.addNotifyListener((a=>{const s=Math.max(1,Math.floor(100*a.done/a.total));P&&this.setTyping(e,{_:P,progress:0|s},void 0,t.threadId),b.notifyAll(a)})),b.notifyAll({done:0,total:a.size})),"video"===r&&t.objectURL&&(null===(n=t.thumb)||void 0===n?void 0:n.blob)&&(i=this.apiFileManager.upload({file:t.thumb.blob})),k&&k.then((e=>Xt(this,void 0,void 0,(function*(){let a;if(e.name=p,C=!0,a="photo"===r?{_:"inputMediaUploadedPhoto",file:e,pFlags:{spoiler:t.spoiler||void 0}}:{_:"inputMediaUploadedDocument",file:e,mime_type:d,pFlags:{force_file:"sendMessageUploadDocumentAction"===P||void 0,spoiler:t.spoiler||void 0},attributes:g},i)try{const e=yield i;a.thumb=e}catch(e){this.log.error("sendFile thumb upload error:",e)}b.resolve(a)}))),(e=>{throw I(e),e})),b};t.isGroupedItem?n():this.sendSmthLazyLoadQueue.push({load:n})}return b},this.beforeMessageSending(s,{isGroupedItem:t.isGroupedItem,isScheduled:!!t.scheduleDate||void 0,threadId:t.threadId,clearDraft:t.clearDraft,processAfter:t.processAfter}),t.isGroupedItem||(b.then((a=>(this.setTyping(e,{_:"sendMessageCancelAction"},void 0,t.threadId),this.apiManager.invokeApi("messages.sendMedia",{background:t.background,peer:this.appPeersManager.getInputPeerById(e),media:a,message:l,random_id:s.random_id,reply_to_msg_id:n,schedule_date:t.scheduleDate,silent:t.silent,entities:m,clear_draft:t.clearDraft,send_as:t.sendAsPeerId?this.appPeersManager.getInputPeerById(t.sendAsPeerId):void 0,update_stickersets_order:t.updateStickersetOrder}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}),(e=>{if("photo"===r&&400===e.code&&("PHOTO_INVALID_DIMENSIONS"===e.type||"PHOTO_SAVE_FILE_INVALID"===e.type))return e.handled=!0,r="document",void s.send();throw I(e),e}))))),b.then(s.promise.resolve,s.promise.reject));const w={message:s};return(0,ge.Z)(w,["promise"]),w.promise=b,w}sendAlbum(e,t){return Xt(this,void 0,void 0,(function*(){if(t.threadId&&!t.replyToMsgId&&(t.replyToMsgId=t.threadId),1===t.sendFileDetails.length)return this.sendFile(e,Object.assign(Object.assign({},t),t.sendFileDetails[0]));e=this.appPeersManager.getPeerMigratedTo(e)||e;const a=t.replyToMsgId?(0,oe.Z)(t.replyToMsgId):void 0;let s=t.caption||"",n=t.entities||[];s&&(s=(0,we.Z)(s,n)),this.log("sendAlbum",t);const i=""+ ++this.groupedTempId,r=[],o=e=>{r.push(e)},p=t.sendFileDetails.map(((r,p)=>{const d=Object.assign({isGroupedItem:!0,isMedia:t.isMedia,scheduleDate:t.scheduleDate,silent:t.silent,replyToMsgId:a,threadId:t.threadId,sendAsPeerId:t.sendAsPeerId,groupId:i,processAfter:o},r);return 0===p&&(d.caption=s,d.entities=n),this.sendFile(e,d).message}));t.clearDraft&&r.push((()=>{this.appDraftsManager.clearDraft(e,t.threadId)})),r.forEach((e=>{e()}));const d=(e,t)=>{this.onMessagesSendError([e],t),this.rootScope.dispatchEvent("messages_pending")},f=this.appPeersManager.getInputPeerById(e),c=s=>{this.setTyping(e,{_:"sendMessageCancelAction"},void 0,t.threadId);const n=(0,v.Z)();return this.sendSmthLazyLoadQueue.push({load:()=>this.apiManager.invokeApi("messages.sendMultiMedia",{peer:f,multi_media:s,reply_to_msg_id:a,schedule_date:t.scheduleDate,silent:t.silent,clear_draft:t.clearDraft,send_as:t.sendAsPeerId?this.appPeersManager.getInputPeerById(t.sendAsPeerId):void 0,update_stickersets_order:t.updateStickersetOrder}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e),n.resolve()}),(e=>{p.forEach((t=>d(t,e))),n.reject(e)}))}),n},l=p.map((e=>e.send().then((e=>Promise.all([e,this.apiManager.invokeApi("messages.uploadMedia",{peer:f,media:e})]))).then((([t,a])=>{let i;if("messageMediaPhoto"===a._){const e=this.appPhotosManager.savePhoto(a.photo);i=wt(e)}else if("messageMediaDocument"===a._){const e=this.appDocsManager.saveDoc(a.document);i=Ut(e)}["pFlags","ttl_seconds"].forEach((e=>{var a;i[e]=null!==(a=t[e])&&void 0!==a?a:i[e]}));const r={_:"inputSingleMedia",media:i,random_id:e.random_id,message:s,entities:n};return s&&(s="",n=[]),r})).catch((t=>{throw this.log.error("sendAlbum upload item error:",t,e),d(e,t),t}))));return Promise.all(l).then((e=>c(e.filter(Boolean))))}))}sendContact(e,t){return this.sendOther(e,this.appUsersManager.getContactMediaInput(t))}sendOther(e,t,a={}){var s;e=this.appPeersManager.getPeerMigratedTo(e)||e;const n=this.generateOutgoingMessage(e,a),i=a.replyToMsgId?(0,oe.Z)(a.replyToMsgId):void 0;let r;switch(t._){case"inputMediaPoll":{const e=""+n.id;t.poll.id=e,this.appPollsManager.savePoll(t.poll,{_:"pollResults",flags:4,total_voters:0,pFlags:{},recent_voters:[]});const{poll:a,results:s}=this.appPollsManager.getPoll(e);r={_:"messageMediaPoll",poll:a,results:s};break}case"inputMediaPhoto":r={_:"messageMediaPhoto",photo:this.appPhotosManager.getPhoto(t.id.id),pFlags:{}};break;case"inputMediaDocument":r={_:"messageMediaDocument",document:this.appDocsManager.getDoc(t.id.id),pFlags:{}};break;case"inputMediaContact":r={_:"messageMediaContact",phone_number:t.phone_number,first_name:t.first_name,last_name:t.last_name,user_id:null!==(s=t.user_id)&&void 0!==s?s:"0",vcard:t.vcard};break;case"inputMediaGeoPoint":r={_:"messageMediaGeo",geo:a.geoPoint};break;case"inputMediaVenue":r={_:"messageMediaVenue",geo:a.geoPoint,title:t.title,address:t.address,provider:t.provider,venue_id:t.venue_id,venue_type:t.venue_type};break;case"messageMediaPending":r=t.messageMedia}n.media=r;const o=e=>{this.onMessagesSendError([n],e),this.rootScope.dispatchEvent("messages_pending")};return n.send=()=>{const s={};this.pendingAfterMsgs[e]&&(s.afterMessageId=this.pendingAfterMsgs[e].messageId);const r=a.sendAsPeerId?this.appPeersManager.getInputPeerById(a.sendAsPeerId):void 0;let p;return p=a.viaBotId?this.apiManager.invokeApiAfter("messages.sendInlineBotResult",{peer:this.appPeersManager.getInputPeerById(e),random_id:n.random_id,reply_to_msg_id:i||void 0,query_id:a.queryId,id:a.resultId,clear_draft:a.clearDraft,schedule_date:a.scheduleDate,silent:a.silent,send_as:r},s):this.apiManager.invokeApiAfter("messages.sendMedia",{peer:this.appPeersManager.getInputPeerById(e),media:t,random_id:n.random_id,reply_to_msg_id:i||void 0,message:"",clear_draft:a.clearDraft,schedule_date:a.scheduleDate,silent:a.silent,send_as:r,update_stickersets_order:a.updateStickersetOrder},s),this.pendingAfterMsgs[e]=s,p.then((e=>{e.updates&&e.updates.forEach((e=>{"updateDraftMessage"===e._&&(e.local=!0)})),this.apiUpdatesManager.processUpdateMessage(e)}),(e=>{throw o(e),e})).finally((()=>{this.pendingAfterMsgs[e]===s&&delete this.pendingAfterMsgs[e]}))},this.beforeMessageSending(n,{isScheduled:!!a.scheduleDate||void 0,threadId:a.threadId,clearDraft:a.clearDraft,sequential:!0}),n.promise}beforeMessageSending(e,t={}){const a=e.id,s=this.getMessagePeer(e),n=t.isScheduled?this.getScheduledMessagesStorage(s):this.getHistoryMessagesStorage(s);e.storageKey=n.key;const i=[];if(t.isScheduled)this.saveMessages([e],{storage:n,isScheduled:!0,isOutgoing:!0}),i.push((()=>{this.rootScope.dispatchEvent("scheduled_new",e)}));else{const r=[this.getHistoryStorage(s),t.threadId?this.getHistoryStorage(s,t.threadId):void 0];for(const e of r)e&&e.history.unshift(a);if(this.saveMessages([e],{storage:n,isOutgoing:!0}),this.setDialogTopMessage(e),t.threadId){const a=this.dialogsStorage.getForumTopic(s,t.threadId);a&&this.setDialogTopMessage(e,a)}i.push((()=>{this.rootScope.dispatchEvent("history_append",{storageKey:n.key,message:e})}))}const r=this.pendingByRandomId[e.random_id]={peerId:s,tempId:a,threadId:t.threadId,storage:n,sequential:t.sequential};return this.pendingTopMsgs[s]=a,!t.isGroupedItem&&e.send&&i.push((()=>{t.clearDraft&&this.appDraftsManager.clearDraft(s,t.threadId),e.send()})),i.length&&(t.processAfter||ea)((()=>{for(const e of i)e()})),r}generateOutgoingMessage(e,t){let a;t.threadId&&!t.replyToMsgId&&(t.replyToMsgId=t.threadId);const s=this.appPeersManager.isBroadcast(e);if(s&&this.appPeersManager.getPeer(e).pFlags.signatures){const e=this.appUsersManager.getSelf();a=e.first_name+(e.last_name?" "+e.last_name:"")}const n={_:"message",id:this.generateTempMessageId(e),from_id:t.sendAsPeerId?this.appPeersManager.getOutputPeer(t.sendAsPeerId):this.generateFromId(e),peer_id:this.appPeersManager.getOutputPeer(e),post_author:a,pFlags:this.generateFlags(e),date:t.scheduleDate||(0,te.Z)(!0)+this.timeManager.getServerTimeOffset(),message:"",grouped_id:t.groupId,random_id:(0,Ee.a)(),reply_to:this.generateReplyHeader(e,t.replyToMsgId,t.threadId),via_bot_id:t.viaBotId,reply_markup:t.replyMarkup,replies:this.generateReplies(e),views:s&&1,pending:!0};return(0,ge.Z)(n,["send","promise"]),void 0===t.groupId&&(n.promise=(0,v.Z)()),n}generateReplyHeader(e,t,a){const s=this.appPeersManager.isForum(e);if(s&&!a){const s=this.getMessageByPeer(e,t);s&&(a=(0,Yt.Z)(s,!0))}const n={_:"messageReplyHeader",reply_to_msg_id:t||a,pFlags:{}};return a&&s&&o.Ox!==a&&(n.pFlags.forum_topic=!0),a&&n.reply_to_msg_id!==a&&(n.reply_to_top_id=a),n}generateReplies(e){let t;if(this.appPeersManager.isBroadcast(e)){const a=this.appProfileManager.getCachedFullChat(e.toChatId());(null==a?void 0:a.linked_chat_id)&&(t={_:"messageReplies",flags:1,pFlags:{comments:!0},channel_id:a.linked_chat_id,replies:0,replies_pts:0})}return t}generateFromId(e){return this.appPeersManager.isAnyChat(e)&&(this.appPeersManager.isBroadcast(e)||this.isAnonymousSending(e))?void 0:this.appPeersManager.getOutputPeer(this.appUsersManager.getSelf().id.toPeerId())}generateFlags(e){const t={};return e!==this.appUsersManager.getSelf().id&&(t.out=!0,this.appPeersManager.isChannel(e)||this.appUsersManager.isBot(e)||(t.unread=!0)),this.appPeersManager.isBroadcast(e)&&(t.post=!0),t}generateForwardHeader(e,t){const a=this.appUsersManager.getSelf().id.toPeerId(),s=t.fromId;if(s===a&&t.peerId===a&&!t.fwd_from)return;const n={_:"messageFwdHeader",flags:0,date:t.date,pFlags:{}};let i=!1;if(t.fwd_from)n.from_id=t.fwd_from.from_id,n.from_name=t.fwd_from.from_name,n.post_author=t.fwd_from.post_author;else{if(n.post_author=t.post_author,s.isUser()){const e=this.appProfileManager.getCachedFullUser(s.toUserId());(null==e?void 0:e.private_forward_name)&&(n.from_name=e.private_forward_name,i=!0)}i||(n.from_id=this.appPeersManager.getOutputPeer(s))}return this.appPeersManager.isBroadcast(t.peerId)&&(t.post_author&&(n.post_author=t.post_author),n.channel_post=t.id),e!==a||i||(n.saved_from_msg_id=t.id,n.saved_from_peer=this.appPeersManager.getOutputPeer(t.peerId)),n}generateFakeAvatarMessage(e,t){const a=Number.MAX_SAFE_INTEGER,s={_:"messageService",pFlags:{},action:{_:"messageActionChannelEditPhoto",photo:t},id:a,peer_id:this.appPeersManager.getOutputPeer(e),mid:a,peerId:e,date:t.date,fromId:e};return this.getHistoryMessagesStorage(e).set(a,s),s}getUploadPromise(e){return this.uploadFilePromises[e]}isAnonymousSending(e){var t,a;return!!e.isAnyChat()&&(null===(a=null===(t=this.appPeersManager.getPeer(e).admin_rights)||void 0===t?void 0:t.pFlags)||void 0===a?void 0:a.anonymous)}setDialogTopMessage(e,t=this.getDialogOnly(e.peerId)){t&&(t.top_message=e.mid,this.getHistoryStorage(e.peerId,"forumTopic"===t._?t.id:void 0).maxId=e.mid,this.dialogsStorage.generateIndexForDialog(t,!1,e),this.scheduleHandleNewDialogs(e.peerId,t))}cancelPendingMessage(e){const t=this.pendingByRandomId[e];if(t){const{peerId:a,tempId:s,storage:n}=t,i=this.getHistoryStorage(a);return this.apiUpdatesManager.processLocalUpdate({_:"updateDeleteMessages",messages:[s],pts:void 0,pts_count:void 0}),i.history.delete(s),delete this.pendingByRandomId[e],n.delete(s),!0}return!1}fillConversations(e){return Xt(this,void 0,void 0,(function*(){const t=this.middleware.get();for(;!this.dialogsStorage.isDialogsLoaded(e);){const a=yield this.getTopMessages({limit:100,folderId:e});if(!t()||a.isEnd)break}}))}getReadMaxIdIfUnread(e,t){var a,s,n;const i=this.getHistoryStorage(e,t);if(t&&!this.appChatsManager.isForum(e.toChatId())){const t=this.getHistoryStorage(e),n=Math.max(null!==(a=t.readMaxId)&&void 0!==a?a:0,i.readMaxId),r=this.getMessageByPeer(e,i.maxId);return!(null===(s=null==r?void 0:r.pFlags)||void 0===s?void 0:s.out)&&n{if(!n()||"messages.dialogsNotModified"===r._)return null;d.ZP&&this.log("messages.getDialogs result:",r),i||s||t===ye||this.dialogsStorage.resetPinnedOrder(t),i||s||this.appDraftsManager.addMissedDialogs(),this.appUsersManager.saveApiUsers(r.users),this.appChatsManager.saveApiChats(r.chats),this.saveMessages(r.messages);let p=!!s,c=!1;const l=new Map,m=t===ye?o.J$:t,g=!!i||t===ye,h=r.dialogs||r.topics;if((0,ne.Z)(h,(e=>{var t,s;if(e)if(i||null!==(t=(s=e).folder_id)&&void 0!==t||(s.folder_id=m),this.dialogsStorage.saveDialog({dialog:e,ignoreOffsetDate:!0,saveGlobalOffset:g}),void 0!==e.peerId)if(p||this.appPeersManager.isChannel(e.peerId||this.appPeersManager.getPeerId(e.peer))||(this.incrementMaxSeenId(e.top_message),p=!0),a&&(0,ce.Z)(e)>a&&(this.scheduleHandleNewDialogs(e.peerId,e),c=!0),i||(0,oe.Z)(e.read_inbox_max_id)||(0,oe.Z)(e.read_outbox_max_id)){if(e.top_message){const t=this.getMessageByPeer(e.peerId,e.top_message);t&&(this.setMessageUnreadByDialog(t,e),this.dialogsStorage.setDialogToState(e))}}else l.set(e.peerId,{dialog:e}),this.log.error("noIdsDialogs",e,f);else this.log.error("bugged dialog?",e)})),l.size){const e=[...l.keys()],t=e.map((e=>this.reloadConversation(e)));Promise.all(t).then((()=>{this.rootScope.dispatchEvent("dialogs_multiupdate",l);for(let t=0;t=u||!h.length;v&&this.dialogsStorage.setDialogsLoaded(t,!0),c?this.scheduleHandleNewDialogs():this.rootScope.dispatchEvent("dialogs_multiupdate",new Map);const P=h,b=100===e?P:P.slice(0,e);return{isEnd:v&&b[b.length-1]===P[P.length-1],count:u,dialogs:b}};let p,f;return p=i?this.apiManager.invokeApiSingleProcess({method:"channels.getForumTopics",params:f={channel:this.appChatsManager.getChannelInput(i.toChatId()),limit:100,offset_date:s,offset_id:0,offset_topic:0},options:{noErrorBox:!0},processResult:e=>(e=this.dialogsStorage.processTopics(i,e),r(e))}):this.apiManager.invokeApiSingleProcess({method:"messages.getDialogs",params:f={folder_id:t,offset_date:s,offset_id:0,offset_peer:this.appPeersManager.getInputPeerById(undefined),limit:100,hash:"0"},options:{noErrorBox:!0},processResult:r}),p}forwardMessages(e,t,a,s={}){return Xt(this,void 0,void 0,(function*(){delete s.replyToMsgId,delete s.threadId,e=this.appPeersManager.getPeerMigratedTo(e)||e;for(let n=0,i=(a=a.slice().sort(((e,t)=>e-t))).length;n{var i,p,d,f,c;const l=this.getMessageByPeer(t,n),m=this.generateOutgoingMessage(e,s);o.push(m.id);const g=["entities","media"];s.dropAuthor||(m.fwd_from=this.generateForwardHeader(e,l),g.push("views","forwards"),(null===(i=m.fwd_from)||void 0===i?void 0:i.from_name)&&e===this.appPeersManager.peerId&&delete m.from_id),s.dropCaptions&&l.media||g.push("message");const h=null===(p=l.reply_to)||void 0===p?void 0:p.reply_to_msg_id,u=a.indexOf(h);if(h&&-1!==u){const e=o[u];m.reply_to={_:"messageReplyHeader",reply_to_msg_id:e,pFlags:{}}}g.forEach((e=>{m[e]=(0,ve.Z)(l[e])}));const y=null===(d=m.media)||void 0===d?void 0:d.document;return y&&(["round","voice"].includes(y.type)&&(m.pFlags.media_unread=!0),y.sticker&&!this.rootScope.premium&&(0,zt.Z)(y)&&(m.media.pFlags.nopremium=!0)),l.grouped_id&&(null!==(f=r[c=l.grouped_id])&&void 0!==f?f:r[c]={tempId:""+ ++this.groupedTempId,messages:[]}).messages.push(m),m}));for(const e in r){const t=r[e];t.messages.length>1&&t.messages.forEach((e=>{e.grouped_id=t.tempId}))}p.forEach((e=>{this.beforeMessageSending(e,{isScheduled:!!s.scheduleDate||void 0,sequential:!0})}));const d={};this.pendingAfterMsgs[e]&&(d.afterMessageId=this.pendingAfterMsgs[e].messageId);const f=this.apiManager.invokeApiAfter("messages.forwardMessages",{from_peer:this.appPeersManager.getInputPeerById(t),id:a.map((e=>(0,oe.Z)(e))),random_id:p.map((e=>e.random_id)),to_peer:this.appPeersManager.getInputPeerById(e),with_my_score:s.withMyScore,silent:s.silent,schedule_date:s.scheduleDate,drop_author:s.dropAuthor,drop_media_captions:s.dropCaptions,send_as:s.sendAsPeerId?this.appPeersManager.getInputPeerById(s.sendAsPeerId):void 0},d).then((e=>{this.log("forwardMessages updates:",e),this.apiUpdatesManager.processUpdateMessage(e)}),(e=>{throw this.onMessagesSendError(p,e),e})).finally((()=>{this.pendingAfterMsgs[e]===d&&delete this.pendingAfterMsgs[e]}));this.pendingAfterMsgs[e]=d;const c=[f];return i.length&&c.push(this.forwardMessages(e,t,i,s)),Promise.all(c).then(qt.Z)}))}generateEmptyMessage(e){}onMessagesSendError(e,t){e.forEach((e=>{if(e.error!==t)if(t){e.error=t,this.rootScope.dispatchEvent("message_error",{storageKey:e.storageKey,tempId:e.mid,error:t});const a=this.getDialogOnly(e.peerId);a&&this.rootScope.dispatchEvent("dialog_unread",{peerId:e.peerId,dialog:a})}else delete e.error}))}getMessagesStorageByKey(e){const t=e.split("_"),a=+t[0];return"scheduled"===t[1]?this.getScheduledMessagesStorage(a):this.getHistoryMessagesStorage(a)}getMessageFromStorage(e,t){return"string"==typeof e&&(e=this.getMessagesStorageByKey(e)),e&&e.get(t)}createMessageStorage(e,t){const a=new Map;return a.peerId=e,a.type=t,a.key=`${e}_${t}`,a}getHistoryMessagesStorage(e){var t,a;return null!==(t=(a=this.messagesStorageByPeerId)[e])&&void 0!==t?t:a[e]=this.createMessageStorage(e,"history")}getMessagesStorage(e){return"object"==typeof e?e:this.getMessagesStorageByKey(e)}getMessageById(e){for(const t in this.messagesStorageByPeerId){if(this.appPeersManager.isChannel(t.toPeerId()))continue;const a=this.messagesStorageByPeerId[t].get(e);if(a)return a}return this.getMessageFromStorage(null,e)}getMessageByPeer(e,t){return e?this.getMessageFromStorage(this.getHistoryMessagesStorage(e),t):this.getMessageById(t)}getMessagePeer(e){return e.peer_id&&this.appPeersManager.getPeerId(e.peer_id)||o.NM}getDialogOnly(e){return this.dialogsStorage.getDialogOnly(e)}cantForwardDeleteMids(e,t){const a=this.getMessagesStorage(e);let s=!t.length,n=!t.length;for(const e of t){const t=this.getMessageFromStorage(a,e);if(s||(s=!this.canForward(t)),n||(n=!this.canDeleteMessage(t)),s&&n)break}return{cantForward:s,cantDelete:n}}reloadConversationOrTopic(e,t){t?this.dialogsStorage.getForumTopicById(e,t):this.reloadConversation(e)}reloadConversation(e){let t;if(void 0!==e){const a=this.appPeersManager.getPeerId(e);this.log.warn("reloadConversation",a);let s=this.reloadConversationsPeers.get(a);if(s&&(t=s.promise),t)return t;t=(0,v.Z)(),this.reloadConversationsPeers.set(a,s={inputDialogPeer:this.appPeersManager.getInputDialogPeerById(e),promise:t})}return this.reloadConversationsPromise||(this.reloadConversationsPromise=(0,P.Z)(0).then((()=>{const e=[],t={};for(const[a,{inputDialogPeer:s,promise:n}]of this.reloadConversationsPeers)e.push(s),t[a]=n;const a=()=>{for(const e in t)this.reloadConversationsPeers.delete(+e),t[e].resolve(void 0)};return(()=>Xt(this,void 0,void 0,(function*(){for(;;){const t=yield this.apiManager.invokeApi("messages.getPeerDialogs",{peers:e}),a=this.apiUpdatesManager.updatesState,{state:s}=t;if(!a.pts||a.pts===s.pts)return t;yield(0,P.Z)(500)}})))().then((e=>{for(const e in t)this.reloadConversationsPeers.delete(+e);this.dialogsStorage.applyDialogs(e),e.dialogs.forEach((e=>{const a=e.peerId;a&&(t[a].resolve(e),delete t[a])}))}),qt.Z).then((()=>{a(),this.reloadConversationsPromise=null,this.reloadConversationsPeers.size&&this.reloadConversation()}))}))),t||this.reloadConversationsPromise}doFlushHistory(e,t,a,s){let n;const i=n=>(this.apiUpdatesManager.processUpdateMessage({_:"updateShort",update:{_:"updatePts",pts:n.pts,pts_count:n.pts_count}}),!n.offset||this.doFlushHistory(e,t,a,s));return n=s?this.apiManager.invokeApiSingleProcess({method:"channels.deleteTopicHistory",params:{channel:this.appChatsManager.getChannelInput(e.toChatId()),top_msg_id:(0,oe.Z)(s)},processResult:i}):this.apiManager.invokeApiSingleProcess({method:"messages.deleteHistory",params:{just_clear:t,revoke:a,peer:this.appPeersManager.getInputPeerById(e),max_id:0},processResult:i}),n}flushHistory(e,t,a,s){return Xt(this,void 0,void 0,(function*(){if(this.appPeersManager.isChannel(e)&&!s){const t=this.getHistory(e,0,1),a=yield t,s=e.toChatId(),n=a.history[0]||0;return this.apiManager.invokeApiSingle("channels.deleteHistory",{channel:this.appChatsManager.getChannelInput(s),max_id:(0,oe.Z)(n)}).then((e=>(e&&this.apiUpdatesManager.processLocalUpdate({_:"updateChannelAvailableMessages",channel_id:s,available_min_id:n}),e)))}return this.doFlushHistory(e,t,a,s).then((()=>{if(s||this.flushStoragesByPeerId(e),t)this.rootScope.dispatchEvent("dialog_flush",{peerId:e,dialog:this.getDialogOnly(e)});else{const t=this.getTypingKey(e,s);if(delete this.notificationsToHandle[t],delete this.typings[t],!s){const t=this.reloadConversationsPeers.get(e);t&&(this.reloadConversationsPeers.delete(e),t.promise.resolve(void 0))}this.dialogsStorage.dropDialogOnDeletion(e,s)}}))}))}flushStoragesByPeerId(e){[this.historiesStorage,this.threadsStorage,this.searchesStorage,this.pendingAfterMsgs,this.pendingTopMsgs].forEach((t=>{delete t[e]}));for(const t in this.pinnedMessages)(+t===e||t.startsWith(e+"_"))&&delete this.pinnedMessages[t];const t=this.needSingleMessages.get(e);if(t){for(const[e,a]of t)a.resolve(this.generateEmptyMessage(e));t.clear()}[this.messagesStorageByPeerId,this.scheduledMessagesStorage].forEach((t=>{const a=t[e];a&&a.clear()})),this.dialogsStorage.flushForumTopicsCache(e)}hidePinnedMessages(e){return Promise.all([this.appStateManager.getState(),this.getPinnedMessage(e)]).then((([t,a])=>{t.hiddenPinnedMessages[e]=a.maxId,this.rootScope.dispatchEvent("peer_pinned_hidden",{peerId:e,maxId:a.maxId})}))}getPinnedMessagesKey(e,t){return e+(t?"_"+t:"")}getPinnedMessage(e,t){var a,s,n;const i=null!==(a=(s=this.pinnedMessages)[n=this.getPinnedMessagesKey(e,t)])&&void 0!==a?a:s[n]={};return i.promise?i.promise:i.maxId?Promise.resolve(i):i.promise=this.getSearch({peerId:e,inputFilter:{_:"inputMessagesFilterPinned"},maxId:0,limit:1,threadId:t}).then((e=>{var t;return i.count=e.count,i.maxId=null===(t=e.history[0])||void 0===t?void 0:t.mid,i})).finally((()=>{delete i.promise}))}getPinnedMessagesCount(e,t){var a;return null===(a=this.pinnedMessages[this.getPinnedMessagesKey(e,t)])||void 0===a?void 0:a.count}getPinnedMessagesMaxId(e,t){var a;return null===(a=this.pinnedMessages[this.getPinnedMessagesKey(e,t)])||void 0===a?void 0:a.maxId}updatePinnedMessage(e,t,a,s,n){return this.apiManager.invokeApi("messages.updatePinnedMessage",{peer:this.appPeersManager.getInputPeerById(e),unpin:a,silent:s,pm_oneside:n,id:(0,oe.Z)(t)}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}))}unpinAllMessages(e){return this.apiManager.invokeApiSingle("messages.unpinAllMessages",{peer:this.appPeersManager.getInputPeerById(e)}).then((t=>(this.apiUpdatesManager.processUpdateMessage({_:"updateShort",update:{_:"updatePts",pts:t.pts,pts_count:t.pts_count}}),t.offset?this.unpinAllMessages(e):(this.getHistoryMessagesStorage(e).forEach((e=>{e.pFlags.pinned&&delete e.pFlags.pinned})),this.rootScope.dispatchEvent("peer_pinned_messages",{peerId:e,unpinAll:!0}),delete this.pinnedMessages[this.getPinnedMessagesKey(e)],!0))))}getAlbumText(e){const t=this.groupedMessagesStorage[e];return(0,Wt.Z)(Array.from(t.values()))}getGroupsFirstMessage(e){if(!(null==e?void 0:e.grouped_id))return e;const t=this.groupedMessagesStorage[e.grouped_id];let a=Number.MAX_SAFE_INTEGER;for(const[e,s]of t)s.midthis.getMessageFromStorage(a,e)))}getMidsByMessage(e){return e?e.grouped_id?this.getMidsByAlbum(e.grouped_id):[e.mid]:[]}filterMessages(e,t){const a=[];if(e.grouped_id){const s=this.groupedMessagesStorage[e.grouped_id];for(const[e,n]of s)t(n)&&a.push(n)}else t(e)&&a.push(e);return a}generateTempMessageId(e){const t=this.getDialogOnly(e);return this.appMessagesIdsManager.generateTempMessageId((null==t?void 0:t.top_message)||0)}setMessageUnreadByDialog(e,t=this.getDialogOnly(e.peerId)){t&&e.mid&&e.mid>t[e.pFlags.out?"read_outbox_max_id":"read_inbox_max_id"]&&(e.pFlags.unread=!0)}saveMessage(e,t={}){var a,s,n,i,r;if(!e||"messageEmpty"===e._)return;null!==(a=e.pFlags)&&void 0!==a||(e.pFlags={});const p=this.getMessagePeer(e),d=t.storage||this.getHistoryMessagesStorage(p),f="peerChannel"===e.peer_id._,c=f&&this.appChatsManager.isBroadcast(p.toChatId()),l="message"===e._;t.isOutgoing&&(e.pFlags.is_outgoing=!0);const m=(0,pe.Z)(e.id);e.mid=m,l&&(t.isScheduled&&(e.pFlags.is_scheduled=!0),e.grouped_id&&(null!==(s=(i=this.groupedMessagesStorage)[r=e.grouped_id])&&void 0!==s?s:i[r]=this.createMessageStorage(p,"grouped")).set(m,e),e.via_bot_id&&(e.viaBotId=e.via_bot_id));const g=e.reply_to;g&&(g.reply_to_msg_id&&(g.reply_to_msg_id=e.reply_to_mid=(0,pe.Z)(g.reply_to_msg_id)),g.reply_to_top_id&&(g.reply_to_top_id=(0,pe.Z)(g.reply_to_top_id)));const h=l&&e.replies;h&&(h.max_id&&(h.max_id=(0,pe.Z)(h.max_id)),h.read_max_id&&(h.read_max_id=(0,pe.Z)(h.read_max_id)));const u=!!p;u||(e.date-=this.timeManager.getServerTimeOffset());const y=this.appPeersManager.peerId,_=l&&e.fwd_from;if(e.peerId=p,e.fromId=p===y?_?_.from_id?this.appPeersManager.getPeerId(_.from_id):o.NM:y:e.pFlags.post||!e.from_id?p:this.appPeersManager.getPeerId(e.from_id),this.setMessageUnreadByDialog(e),_){_.saved_from_msg_id&&(_.saved_from_msg_id=(0,pe.Z)(_.saved_from_msg_id)),_.channel_post&&(_.channel_post=(0,pe.Z)(_.channel_post));const t=_.saved_from_peer||_.from_id,a=_.saved_from_msg_id||_.channel_post;if(t&&a){const s=this.appPeersManager.getPeerId(t),n=(0,pe.Z)(a);e.savedFrom=s+"_"+n}e.fwdFromId=this.appPeersManager.getPeerId(_.from_id),u||(_.date-=this.timeManager.getServerTimeOffset())}const v={type:"message",peerId:p,messageId:m};let P=!1;const b=l&&e.media;if(b)switch(b._){case"messageMediaEmpty":delete e.media;break;case"messageMediaPhoto":b.ttl_seconds?P=!0:b.photo=this.appPhotosManager.savePhoto(b.photo,v),b.photo||delete e.media;break;case"messageMediaPoll":{const t=this.appPollsManager.savePoll(b.poll,b.results,e);b.poll=t.poll,b.results=t.results;break}case"messageMediaDocument":if(b.ttl_seconds)P=!0;else{const e=b.document;b.document=this.appDocsManager.saveDoc(e,v),b.document||"documentEmpty"===e._||(P=!0)}break;case"messageMediaWebPage":{const a=this.appWebPagesManager.getMessageKeyForPendingWebPage(p,m,t.isScheduled);b.webpage=this.appWebPagesManager.saveWebPage(b.webpage,a,v),b.webpage||delete e.media;break}case"messageMediaInvoice":{b.photo=this.appWebDocsManager.saveWebDocument(b.photo);const e=b.extended_media;if("messageExtendedMedia"===(null==e?void 0:e._)){const t=e.media;t.photo=this.appPhotosManager.savePhoto(t.photo,v),t.document=this.appDocsManager.saveDoc(t.document,v)}break}case"messageMediaUnsupported":P=!0}if(l&&P&&(e.media={_:"messageMediaUnsupported"},e.message="",delete e.entities,delete e.totalEntities),!l&&e.action){const t=e.action,a=e.fromId===this.appUsersManager.getSelf().id?"You":"";let s,i;switch(t.photo&&(t.photo=this.appPhotosManager.savePhoto(t.photo,v)),t.document&&(t.document=this.appDocsManager.saveDoc(t.photo,v)),t._){case"messageActionChatEditPhoto":(null===(n=t.photo)||void 0===n?void 0:n.video_sizes)?t._=c?"messageActionChannelEditVideo":"messageActionChatEditVideo":c&&(t._="messageActionChannelEditPhoto");break;case"messageActionGroupCall":{let e;this.appGroupCallsManager.saveGroupCall(t.call),e=void 0===t.duration?"started":"ended",c||(e+="_by"+a),t.type=e;break}case"messageActionChatEditTitle":c&&(t._="messageActionChannelEditTitle");break;case"messageActionChatDeletePhoto":c&&(t._="messageActionChannelDeletePhoto");break;case"messageActionChatAddUser":1===t.users.length?(t.user_id=t.users[0],e.fromId===t.user_id&&(t._=f?"messageActionChatJoined"+a:"messageActionChatReturn"+a)):t.users.length>1&&(t._="messageActionChatAddUsers");break;case"messageActionChatDeleteUser":e.fromId===t.user_id&&(t._="messageActionChatLeave"+a);break;case"messageActionChannelMigrateFrom":s=t.chat_id.toPeerId(!0),i=p;break;case"messageActionChatMigrateTo":s=p,i=t.channel_id.toPeerId(!0);break;case"messageActionHistoryClear":e.clear_history=!0,delete e.pFlags.out,delete e.pFlags.unread;break;case"messageActionPhoneCall":t.type=(t.pFlags.video?"video_":"")+(void 0!==t.duration?e.pFlags.out?"out_":"in_":"")+(void 0!==t.duration?"ok":"phoneCallDiscardReasonMissed"===t.reason._?"missed":"cancelled")}s&&i&&!this.migratedFromTo[s]&&!this.migratedToFrom[i]&&this.migrateChecks(s,i)}return l&&e.message.length&&!e.totalEntities&&this.wrapMessageEntities(e),d.set(m,e),e}saveMessages(e,t={}){return e.saved||(e.saved=!0,e.forEach(((e,a,s)=>{s[a]=this.saveMessage(e,t)}))),e}getFirstMessageToEdit(e,t){return Xt(this,void 0,void 0,(function*(){const a=this.getHistoryStorage(e,t).history.slice;if(a.isEnd(se.D.Bottom)&&a.length){let t;const s=this.appPeersManager.peerId;for(const n of a){const a=this.getMessageByPeer(e,n);if((s===e?a.fromId===s:a.pFlags.out)&&(yield this.canEditMessage(a,"text"))){t=a;break}}return t}}))}wrapMessageEntities(e){const t=e.entities?e.entities.slice():[];e.message=(0,bt.Z)(e.message,t);const a=(0,Nt.Z)(e.message);e.totalEntities=(0,Lt.Z)(t,a)}reportMessages(e,t,a,s){return this.apiManager.invokeApiSingle("messages.report",{peer:this.appPeersManager.getInputPeerById(e),id:t.map((e=>(0,oe.Z)(e))),reason:{_:a},message:s})}startBot(e,t,a){const s=t?t.toPeerId(!0):e.toPeerId();if(a){const t=(0,Ee.a)();return this.apiManager.invokeApi("messages.startBot",{bot:this.appUsersManager.getUserInput(e),peer:this.appPeersManager.getInputPeerById(s),random_id:t,start_param:a}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}))}const n="/start";if(t){let a;return a=this.appChatsManager.isChannel(t)?this.appChatsManager.inviteToChannel(t,[e]):this.appChatsManager.addChatUser(t,e,0),a.catch((e=>{if("USER_ALREADY_PARTICIPANT"!=(null==e?void 0:e.type))throw e;e.handled=!0})).then((()=>this.sendText(s,n+"@"+this.appPeersManager.getPeerUsername(e.toPeerId()))))}return this.sendText(s,n)}editPeerFolders(e,t){this.apiManager.invokeApi("folders.editPeerFolders",{folder_peers:e.map((e=>({_:"inputFolderPeer",peer:this.appPeersManager.getInputPeerById(e),folder_id:t})))}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}))}getFilter(e){return this.filtersStorage.getFilter(e)}toggleDialogPin(e){var t;return Xt(this,void 0,void 0,(function*(){const{peerId:a,topicId:s,filterId:n=(s?a:void 0)}=e;if(void 0===n)throw new Error("No filterId");if(n>1)return this.filtersStorage.toggleDialogPin(a,n);const i=this.dialogsStorage.getDialogOrTopic(a,s);if(!i)throw void 0;const r=!(null===(t=i.pFlags)||void 0===t?void 0:t.pinned)||void 0;if(r){const e=yield this.apiManager.getLimit(s?"topicPin":1===n?"folderPin":"pin");if(this.dialogsStorage.getPinnedOrders(n).length>=e)throw(0,X.Z)(s?"PINNED_TOO_MUCH":"PINNED_DIALOGS_TOO_MUCH")}return s?this.appChatsManager.updatePinnedForumTopic(a.toChatId(),s,r):this.apiManager.invokeApi("messages.toggleDialogPin",{peer:this.appPeersManager.getInputDialogPeerById(a),pinned:r}).then((e=>{const t=r?{pinned:r}:{};this.apiUpdatesManager.saveUpdate({_:"updateDialogPinned",peer:this.appPeersManager.getDialogPeer(a),folder_id:n,pFlags:t})}))}))}markDialogUnread(e,t){var a;const s=this.getDialogOnly(e);if(!s)return Promise.reject();const n=!t&&!(null===(a=s.pFlags)||void 0===a?void 0:a.unread_mark)||void 0;return this.apiManager.invokeApi("messages.markDialogUnread",{peer:this.appPeersManager.getInputDialogPeerById(e),unread:n}).then((t=>{if(t){const t=n?{unread:n}:{};this.onUpdateDialogUnreadMark({_:"updateDialogUnreadMark",peer:this.appPeersManager.getDialogPeer(e),pFlags:t})}}))}migrateChecks(e,t){if(!this.migratedFromTo[e]&&!this.migratedToFrom[t]&&this.appChatsManager.hasChat(t.toChatId())){const a=this.appChatsManager.getChat(e.toChatId());(null==a?void 0:a.migrated_to)&&a.migrated_to.channel_id===t.toChatId()&&(this.migratedFromTo[e]=t,this.migratedToFrom[t]=e,this.rootScope.dispatchEvent("dialog_migrate",{migrateFrom:e,migrateTo:t}),this.dialogsStorage.dropDialogWithEvent(e))}}canMessageBeEdited(e,t){var a,s;if(null===(a=null==e?void 0:e.pFlags)||void 0===a?void 0:a.is_outgoing)return!1;const n=["messageMediaPhoto","messageMediaDocument","messageMediaWebPage"];return"poll"===t&&n.push("messageMediaPoll"),!(!e||"message"!==e._||e.deleted||e.fwd_from||e.via_bot_id||e.media&&-1===n.indexOf(e.media._)||e.fromId&&this.appUsersManager.isBot(e.fromId)||"messageMediaDocument"===(null===(s=e.media)||void 0===s?void 0:s._)&&(e.media.document.sticker||"round"===e.media.document.type))}canEditMessage(e,t="text"){var a;return Xt(this,void 0,void 0,(function*(){if(!e||!this.canMessageBeEdited(e,t))return!1;if(this.getMessagePeer(e)===this.appUsersManager.getSelf().id)return!0;const{peerId:s}=e;return!(!(this.appPeersManager.isBroadcast(s)?this.appChatsManager.hasRights(s.toChatId(),"edit_messages"):(!s.isAnyChat()||"text"!==t||this.appChatsManager.hasRights(s.toChatId(),"send_plain")||this.appChatsManager.hasRights(s.toChatId(),"send_media"))&&e.pFlags.out)||"peerChannel"!==e.peer_id._&&e.date<(0,te.Z)(!0)-(yield this.apiManager.getConfig()).edit_time_limit&&"messageMediaPoll"!==(null===(a=e.media)||void 0===a?void 0:a._))}))}canDeleteMessage(e){return e&&(e.peerId.isUser()||e.pFlags.out||"chat"===this.appChatsManager.getChat(e.peerId.toChatId())._||this.appChatsManager.hasRights(e.peerId.toChatId(),"delete_messages"))&&(!e.pFlags.is_outgoing||!!e.error)}getReplyKeyboard(e){return this.getHistoryStorage(e).replyMarkup}mergeReplyKeyboard(e,t){var a,s;if(!t)return!1;const n=t.reply_markup;if(!n&&!(null===(a=t.pFlags)||void 0===a?void 0:a.out)&&!t.action)return!1;if("replyInlineMarkup"===(null==n?void 0:n._))return!1;const i=e.replyMarkup;if(n)return!(i&&i.mid>=t.mid||n.pFlags.selective||(e.maxOutId&&t.midi.mid||t.pFlags.is_outgoing)&&t.message)return i.pFlags.hidden=!0,!0}else(!e.maxOutId||t.mid>e.maxOutId)&&(e.maxOutId=t.mid);return(0,ue.Z)(t),!("messageActionChatDeleteUser"!==(null===(s=t.action)||void 0===s?void 0:s._)||!(i?t.action.user_id===i.fromId:this.appUsersManager.isBot(t.action.user_id))||(e.replyMarkup={_:"replyKeyboardHide",mid:t.mid,pFlags:{}},0))}getSearchStorage(e,t){return this.searchesStorage[e]||(this.searchesStorage[e]={}),this.searchesStorage[e][t]||(this.searchesStorage[e][t]={history:[]}),this.searchesStorage[e][t]}getSearchCounters(e,t,a=!0,s){return this.appPeersManager.isPeerRestricted(e)?Promise.resolve(t.map((e=>({_:"messages.searchCounter",pFlags:{},filter:e,count:0})))):(a?this.apiManager.invokeApiCacheable:this.apiManager.invokeApi).bind(this.apiManager)("messages.getSearchCounters",{peer:this.appPeersManager.getInputPeerById(e),filters:t,top_msg_id:s?(0,oe.Z)(s):void 0})}filterMessagesByInputFilterFromStorage(e,t,a,s){const n=this.getMessagesStorage(a);return(0,Zt.Z)(e,t.map((e=>n.get(e))),s)}getSearch({peerId:e,query:t,inputFilter:a,maxId:s,limit:n,nextRate:i,backLimit:r,threadId:o,folderId:p,minDate:f,maxDate:c}){if(this.appPeersManager.isPeerRestricted(e))return Promise.resolve({count:0,offset_id_offset:0,next_rate:void 0,history:[]});t||(t=""),a||(a={_:"inputMessagesFilterEmpty"}),void 0===n&&(n=20),i||(i=0),r||(r=0),f=f?f/1e3|0:0,c=c?c/1e3|0:0;let l=[];r&&(n+=r);let m;if(!e||r||s||t||1===n||o||(m=this.getHistoryStorage(e),l=this.filterMessagesByInputFilterFromStorage(a._,m.history.slice,this.getHistoryMessagesStorage(e),n)),l.length){if(!(l.length{this.appUsersManager.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats),this.saveMessages(e.messages),d.ZP&&this.log("getSearch result:",a,e);const t=e.count||l.length+e.messages.length;return e.messages.forEach((e=>{const t=this.getMessagePeer(e);if(t.isAnyChat()){const e=this.appChatsManager.getChat(t.toChatId());e.migrated_to&&this.migrateChecks(t,e.migrated_to.channel_id.toPeerId(!0))}l.push(e)})),{count:t,offset_id_offset:e.offset_id_offset||0,next_rate:e.next_rate,history:l}}))}subscribeRepliesThread(e,t){const a=e+"_"+t;for(const e in this.threadsToReplies)if(this.threadsToReplies[e]===a)return;this.getDiscussionMessage(e,t)}generateThreadServiceStartMessage(e){const t=e.peerId+"_"+e.mid;if(this.threadsServiceMessagesIdsStorage[t])return;const a=(0,oe.Z)(Math.max(...this.getMidsByMessage(e))),s={_:"messageService",pFlags:{is_single:!0},id:this.appMessagesIdsManager.generateTempMessageId(a),date:e.date,from_id:{_:"peerUser",user_id:o.NM},peer_id:e.peer_id,action:{_:"messageActionDiscussionStarted"},reply_to:this.generateReplyHeader(e.peerId,e.id)};this.saveMessages([s],{isOutgoing:!0}),this.threadsServiceMessagesIdsStorage[t]=s.mid}getThreadServiceMessageId(e,t){return this.threadsServiceMessagesIdsStorage[e+"_"+t]}getDiscussionMessage(e,t){return this.apiManager.invokeApiSingle("messages.getDiscussionMessage",{peer:this.appPeersManager.getInputPeerById(e),msg_id:(0,oe.Z)(t)}).then((a=>{var s;this.appChatsManager.saveApiChats(a.chats),this.appUsersManager.saveApiUsers(a.users),this.saveMessages(a.messages);const n=this.getMessageWithReplies(a.messages[0]),i=n.peerId+"_"+n.mid;this.generateThreadServiceStartMessage(n);const r=this.getHistoryStorage(n.peerId,n.mid),o=a.max_id=(0,pe.Z)(a.max_id)||0;a.read_inbox_max_id=r.readMaxId=(0,pe.Z)(null!==(s=a.read_inbox_max_id)&&void 0!==s?s:n.mid),a.read_outbox_max_id=r.readOutboxMaxId=(0,pe.Z)(a.read_outbox_max_id)||0;const p=r.history.first;return r.maxId&&r.maxId{this.newDialogsHandlePromise=void 0,this.handleNewDialogs()}))}deleteMessages(e,t,a,s){var n,i;return Xt(this,void 0,void 0,(function*(){let r;const o=this.appPeersManager.isChannel(e),p=o&&e.toChatId();if(o&&!s){const a=this.appChatsManager.getChat(p);if(!a.pFlags.creator&&!(null===(i=null===(n=a.admin_rights)||void 0===n?void 0:n.pFlags)||void 0===i?void 0:i.delete_messages)&&!(t=t.filter((t=>!!this.getMessageByPeer(e,t).pFlags.out))).length)return}const d=yield this.apiManager.getConfig(),f=t.splice(d.forwarded_count_max,t.length-d.forwarded_count_max),c=t.map((e=>{const t=(0,oe.Z)(e);return(0,pe.Z)(t)===e&&t})).filter(Boolean);r=o?this.apiManager.invokeApi("channels.deleteMessages",{channel:this.appChatsManager.getChannelInput(p),id:c}).then((e=>{this.apiUpdatesManager.processLocalUpdate({_:"updateDeleteChannelMessages",channel_id:p,messages:t,pts:e.pts,pts_count:e.pts_count})})):this.apiManager.invokeApi("messages.deleteMessages",{revoke:a,id:c}).then((e=>{this.apiUpdatesManager.processLocalUpdate({_:"updateDeleteMessages",messages:t,pts:e.pts,pts_count:e.pts_count})}));const l=[r];return f.length&&l.push(this.deleteMessages(e,f,a,!0)),Promise.all(l).then(qt.Z)}))}readHistory(e,t=0,a,s=!1){if(this.log("readHistory:",e,t,a),!this.getReadMaxIdIfUnread(e,a)){if(a&&!s){const t=this.dialogsStorage.getForumTopic(e,a);(0,oe.Z)(t.read_inbox_max_id)||(s=!0)}if(!s){const t=this.appChatsManager.isForum(e.toChatId())&&a?this.dialogsStorage.getForumTopic(e,a):this.getDialogOnly(e);t&&this.isDialogUnread(t)&&(s=!0)}if(!s)return this.log("readHistory: isn't unread"),Promise.resolve()}const n=this.getHistoryStorage(e,a);if(n.triedToReadMaxId>=t)return Promise.resolve();let i;return a?(n.readPromise||(i=this.apiManager.invokeApi("messages.readDiscussion",{peer:this.appPeersManager.getInputPeerById(e),msg_id:(0,oe.Z)(a),read_max_id:(0,oe.Z)(t)})),this.apiUpdatesManager.processLocalUpdate({_:"updateReadChannelDiscussionInbox",channel_id:e.toChatId(),top_msg_id:a,read_max_id:t})):this.appPeersManager.isChannel(e)?(n.readPromise||(i=this.apiManager.invokeApi("channels.readHistory",{channel:this.appChatsManager.getChannelInput(e.toChatId()),max_id:(0,oe.Z)(t)})),this.apiUpdatesManager.processLocalUpdate({_:"updateReadChannelInbox",max_id:t,channel_id:e.toChatId(),still_unread_count:void 0,pts:void 0})):(n.readPromise||(i=this.apiManager.invokeApi("messages.readHistory",{peer:this.appPeersManager.getInputPeerById(e),max_id:(0,oe.Z)(t)}).then((e=>{this.apiUpdatesManager.processUpdateMessage({_:"updateShort",update:{_:"updatePts",pts:e.pts,pts_count:e.pts_count}})}))),this.apiUpdatesManager.processLocalUpdate({_:"updateReadHistoryInbox",max_id:t,peer:this.appPeersManager.getOutputPeer(e),still_unread_count:void 0,pts:void 0,pts_count:void 0})),this.rootScope.dispatchEvent("notification_reset",this.appPeersManager.getPeerString(e)),n.readPromise?n.readPromise:(n.triedToReadMaxId=t,i.finally((()=>{delete n.readPromise;const{readMaxId:s}=n;this.log("readHistory: promise finally",t,s),s>t&&this.readHistory(e,s,a,!0)})),n.readPromise=i)}readAllHistory(e,t,a=!1){const s=this.getHistoryStorage(e,t);s.maxId&&this.readHistory(e,s.maxId,t,a)}getUnreadMentionsKey(e,t){return e+(t?`_${t}`:"")}fixDialogUnreadMentionsIfNoMessage(e,t){const a=this.dialogsStorage.getDialogOrTopic(e,t);(null==a?void 0:a.unread_mentions_count)&&this.reloadConversationOrTopic(e)}modifyCachedMentions(e,t,a,s){const n=this.unreadMentions[this.getUnreadMentionsKey(e,s)];n&&(a?n.first.isEnd(se.D.Top)&&n.insertSlice([t]):n.delete(t))}fixUnreadMentionsCountIfNeeded(e,t,a){const s=this.dialogsStorage.getDialogOrTopic(e,a);!t.length&&(null==s?void 0:s.unread_mentions_count)&&this.reloadConversationOrTopic(e)}goToNextMention(e,t){var a,s;const n=this.getUnreadMentionsKey(e,t),i=this.goToNextMentionPromises[n];if(i)return i;const r=null!==(a=(s=this.unreadMentions)[e])&&void 0!==a?a:s[e]=new se.Z,o=r.length,p=r.first.isEnd(se.D.Top);if(!o&&p)return this.fixUnreadMentionsCountIfNeeded(e,r,t),Promise.resolve();let d=Promise.resolve();return!p&&o<25&&(d=this.loadNextMentions(e,t)),this.goToNextMentionPromises[n]=d.then((()=>{const a=r.last,s=a&&a[a.length-1];if(s)return r.delete(s),s;this.fixUnreadMentionsCountIfNeeded(e,r,t)})).finally((()=>{delete this.goToNextMentionPromises[n]}))}loadNextMentions(e,t){const a=this.unreadMentions[e],s=a.first[0]||1;return this.getUnreadMentions(e,s,-50,50,void 0,void 0,t).then((e=>{this.mergeHistoryResult(a,e,1===s?0:s,50,-50)}))}getUnreadMentions(e,t,a,s,n=0,i=0,r){return this.apiManager.invokeApiSingleProcess({method:"messages.getUnreadMentions",params:{peer:this.appPeersManager.getInputPeerById(e),offset_id:(0,oe.Z)(t),add_offset:a,limit:s,max_id:(0,oe.Z)(n),min_id:(0,oe.Z)(i),top_msg_id:r?(0,oe.Z)(r):void 0},processResult:e=>((0,ue.Z)(e),this.appUsersManager.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats),this.saveMessages(e.messages),e)})}readMessages(e,t){if(!t.length)return Promise.resolve();let a,s;if(t=t.map((e=>(0,oe.Z)(e))),e.isAnyChat()&&this.appPeersManager.isChannel(e)){const n=e.toChatId();s={_:"updateChannelReadMessagesContents",channel_id:n,messages:t},a=this.apiManager.invokeApi("channels.readMessageContents",{channel:this.appChatsManager.getChannelInput(n),id:t})}else s={_:"updateReadMessagesContents",messages:t,pts:void 0,pts_count:void 0},a=this.apiManager.invokeApi("messages.readMessageContents",{id:t}).then((e=>{s.pts=e.pts,s.pts_count=e.pts_count,this.apiUpdatesManager.processLocalUpdate(s)}));return this.apiUpdatesManager.processLocalUpdate(s),a}getHistoryStorage(e,t){var a,s,n,i,r,o;return t?null!==(s=(r=null!==(a=(i=this.threadsStorage)[e])&&void 0!==a?a:i[e]={})[t])&&void 0!==s?s:r[t]={count:null,history:new se.Z}:null!==(n=(o=this.historiesStorage)[e])&&void 0!==n?n:o[e]={count:null,history:new se.Z}}getHistoryStorageTransferable(e,t){const a=this.getHistoryStorage(e,t),{count:s,history:n,maxId:i,readMaxId:r,readOutboxMaxId:o,maxOutId:p,replyMarkup:d}=a;return{count:s,history:void 0,historySerialized:n.toJSON(),maxId:i,readMaxId:r,readOutboxMaxId:o,maxOutId:p,replyMarkup:d}}getNotifyPeerSettings(e,t){const a=this.appPeersManager.getInputNotifyPeerById({peerId:e,ignorePeerId:!0,threadId:t});return Promise.all([this.appNotificationsManager.getNotifyPeerTypeSettings(),this.appNotificationsManager.getNotifySettings(a)]).then((([a,s])=>({muted:this.appNotificationsManager.isPeerLocalMuted({peerId:e,respectType:!0,threadId:t}),peerTypeNotifySettings:s})))}getUpdateAfterReloadKey(e,t){return e+(t?"_"+t:"")}handleNewUpdateAfterReload(e,t,a){var s,n,i;const r=null!==(s=(n=this.newUpdatesAfterReloadToHandle)[i=this.getUpdateAfterReloadKey(e,a)])&&void 0!==s?s:n[i]=new Set;r.has(t)?this.log.error("here we go again",e):(t.ignoreExisting=!0,r.add(t),this.scheduleHandleNewDialogs(e,a))}setDialogToStateIfMessageIsTop(e){this.isMessageIsTopMessage(e)&&this.dialogsStorage.setDialogToState(this.getDialogOnly(e.peerId))}isMessageIsTopMessage(e){const t=this.getDialogOnly(e.peerId);return t&&t.top_message===e.mid}updateMessageRepliesIfNeeded(e){try{const t=this.getThreadKey(e);if(t){const e=this.threadsToReplies[t];if(e){const[t,a]=e.split("_");this.updateMessage(t.toPeerId(),+a,"replies_updated")}}}catch(t){this.log.error("incrementMessageReplies err",t,e)}}getThreadKey(e){var t;let a="";if(null===(t=null==e?void 0:e.peerId)||void 0===t?void 0:t.isAnyChat()){const t=(0,Yt.Z)(e,this.appChatsManager.isForum(e.peerId.toChatId()));t&&(a=e.peerId+"_"+t)}return a}updateMessage(e,t,a){return this.reloadMessages(e,t,!0).then((()=>{const s=this.getMessageByPeer(e,t);if(s)return a&&this.rootScope.dispatchEvent(a,s),s}))}checkPendingMessage(e){const t=this.pendingByMessageId[e.mid];let a;if(t){const s=this.pendingByRandomId[t];(a=this.finalizePendingMessage(t,e))&&this.rootScope.dispatchEvent("history_update",{storageKey:s.storage.key,message:e,sequential:s.sequential}),delete this.pendingByMessageId[e.mid]}return a}mutePeer(e){if(!(e=this.appNotificationsManager.validatePeerSettings(e)))return;const{peerId:t,muteUntil:a,threadId:s}=e,n={_:"inputPeerNotifySettings"};n.mute_until=a;const i=this.appPeersManager.getInputPeerById(t);return this.appNotificationsManager.updateNotifySettings(s?{_:"inputNotifyForumTopic",peer:i,top_msg_id:(0,oe.Z)(s)}:{_:"inputNotifyPeer",peer:i},n)}togglePeerMute({peerId:e,mute:t,threadId:a}){return void 0===t&&(t=!this.appNotificationsManager.isPeerLocalMuted({peerId:e,respectType:!1,threadId:a})),this.mutePeer({peerId:e,muteUntil:t?o.rU:0,threadId:a})}findPeerIdByMids(e){for(let t=e.length-1;t>=0;--t){const a=e[t],s=this.getMessageById(a);if(s)return s.peerId}}canSendToPeer(e,t,a="send_messages"){var s;if(this.appPeersManager.isPeerRestricted(e))return!1;if(e.isAnyChat()){const n=e.toChatId();if(t){const a=this.dialogsStorage.getForumTopic(e,t);if((null===(s=null==a?void 0:a.pFlags)||void 0===s?void 0:s.closed)&&!this.appChatsManager.hasRights(n,"manage_topics"))return!1}const i=this.appChatsManager.getChat(n);return this.appChatsManager.hasRights(n,a,void 0,!!t)&&(!i.pFlags.left||!!t)}return this.appUsersManager.canSendToUser(e)}finalizePendingMessage(e,t){const a=this.pendingByRandomId[e];if(!a)return;const{peerId:s,tempId:n,threadId:i,storage:r}=a;[this.getHistoryStorage(s),i?this.getHistoryStorage(s,i):void 0].filter(Boolean).forEach((e=>{e.history.delete(n)}));const o=this.getMessageFromStorage(r,n);return o&&(delete t.pFlags.is_outgoing,delete t.pending,delete t.error,delete t.random_id,delete t.send),this.rootScope.dispatchEvent("messages_pending"),delete this.pendingByRandomId[e],this.finalizePendingMessageCallbacks(r,n,t),o}finalizePendingMessageCallbacks(e,t,a){const s=this.tempFinalizeCallbacks[t];if(void 0!==s){for(const e in s){const{deferred:t,callback:n}=s[e];n(a).then(t.resolve,t.reject)}delete this.tempFinalizeCallbacks[t]}if(a.media){(0,ue.Z)(a);const{photo:e,document:s}=a.media;if(e){const a=this.appPhotosManager.getPhoto(""+t);if(a){const t=e.sizes[e.sizes.length-1],s=this.thumbsStorage.getCacheContext(e,t.type),n=this.thumbsStorage.getCacheContext(a,o.Pt);Object.assign(s,n);const i=e.sizes[e.sizes.length-1],r=(0,Ot.Z)(e,i);(0,lt.P)(r.location)}}else if(s){const e=this.appDocsManager.getDoc(""+t);if(e){const t=this.thumbsStorage.getCacheContext(e);if(e.type&&"sticker"!==e.type&&"image/gif"!==e.mime_type&&t.url){const e=this.thumbsStorage.getCacheContext(s);Object.assign(e,t),n=s,(0,lt.P)((0,ct.Z)(n,undefined),{fileName:n.file_name})}}}else a.media.poll&&(delete this.appPollsManager.polls[t],delete this.appPollsManager.results[t])}var n;const i=this.getMessageFromStorage(e,t);e.delete(t),!i.reply_markup&&a.reply_markup&&setTimeout((()=>{this.getMessageFromStorage(e,a.mid)&&this.rootScope.dispatchEvent("message_edit",{storageKey:e.key,peerId:a.peerId,mid:a.mid,message:a})}),0),this.handleReleasingMessage(i,e),this.rootScope.dispatchEvent("message_sent",{storageKey:e.key,tempId:t,tempMessage:i,mid:a.mid,message:a})}incrementMaxSeenId(e){if(!e||this.maxSeenId&&!(e>this.maxSeenId))return!1;this.maxSeenId=e,this.appStateManager.pushToState("maxSeenMsgId",e),this.apiManager.invokeApi("messages.receivedMessages",{max_id:(0,oe.Z)(e)})}getMessageReactionsListAndReadParticipants(e,t,a,s,n,i){var r,o;return Xt(this,void 0,void 0,(function*(){const p={reactions:[],count:0,next_offset:void 0},d=yield this.canViewMessageReadParticipants(e);return d&&void 0===t?t=100:void 0===t&&(t=50),Promise.all([!d||a||n?[]:this.getMessageReadParticipants(e.peerId,e.mid).catch((()=>[])),(null===(o=null===(r=e.reactions)||void 0===r?void 0:r.recent_reactions)||void 0===o?void 0:o.length)&&!i?this.appReactionsManager.getMessageReactionsList(e.peerId,e.mid,t,a,s).catch((e=>p)):p]).then((([e,t])=>{const a=e.map((e=>e.toPeerId())),s=a.slice();(0,ne.Z)(s,((e,a,s)=>{t.reactions.some((t=>this.appPeersManager.getPeerId(t.peer_id)===e))&&s.splice(a,1)}));let n=t.reactions.map((e=>({peerId:this.appPeersManager.getPeerId(e.peer_id),reaction:e.reaction})));return n=n.concat(s.map((e=>({peerId:e})))),{reactions:t.reactions,reactionsCount:t.count,readParticipants:a,combined:n,nextOffset:t.next_offset}}))}))}getMessageReadParticipants(e,t){return this.apiManager.invokeApiSingle("messages.getMessageReadParticipants",{peer:this.appPeersManager.getInputPeerById(e),msg_id:(0,oe.Z)(t)}).then((e=>e.map((e=>e.toUserId()))))}canViewMessageReadParticipants(e){return Xt(this,void 0,void 0,(function*(){if("message"!==(null==e?void 0:e._)||e.pFlags.is_outgoing||!e.pFlags.out||!this.appPeersManager.isAnyGroup(e.peerId))return!1;const t=this.appChatsManager.getChat(e.peerId.toChatId()),a=yield this.apiManager.getAppConfig();return t.participants_count<=a.chat_read_mark_size_threshold&&(0,te.Z)(!0)-e.date(0,oe.Z)(e))),increment:!0}).then((a=>{const s=new Array(t.length);for(let n=0,i=t.length;n{const{chatPeerIds:t}=e.state;return t[t.length-1]===a}));!n&&s.length&&(s.sort(((e,t)=>e.state.idleStartTime-t.state.idleStartTime)),n=s[0].state.idleStartTime?s[s.length-1]:s[0]),f.Z.getInstance().invokeVoid("notificationBuild",Object.assign({message:e},t),null==n?void 0:n.source)}getScheduledMessagesStorage(e){var t,a;return null!==(t=(a=this.scheduledMessagesStorage)[e])&&void 0!==t?t:a[e]=this.createMessageStorage(e,"scheduled")}getScheduledMessageByPeer(e,t){return this.getMessageFromStorage(this.getScheduledMessagesStorage(e),t)}getScheduledMessages(e){if(!this.canSendToPeer(e))return;const t=this.getScheduledMessagesStorage(e);return t.size?[...t.keys()]:this.apiManager.invokeApiSingle("messages.getScheduledHistory",{peer:this.appPeersManager.getInputPeerById(e),hash:""}).then((t=>{if("messages.messagesNotModified"!==t._){this.appUsersManager.saveApiUsers(t.users),this.appChatsManager.saveApiChats(t.chats);const a=this.getScheduledMessagesStorage(e);return this.saveMessages(t.messages,{storage:a,isScheduled:!0}),[...a.keys()]}return[]}))}sendScheduledMessages(e,t){return this.apiManager.invokeApi("messages.sendScheduledMessages",{peer:this.appPeersManager.getInputPeerById(e),id:t.map((e=>(0,oe.Z)(e)))}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}))}deleteScheduledMessages(e,t){return this.apiManager.invokeApi("messages.deleteScheduledMessages",{peer:this.appPeersManager.getInputPeerById(e),id:t.map((e=>(0,oe.Z)(e)))}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e)}))}getMessageWithReplies(e){return this.filterMessages(e,(e=>!!e.replies))[0]}getMessageWithCommentReplies(e){if(e.peerId!==o.hj){const t=null==(e=this.getMessageWithReplies(e))?void 0:e.replies;if(!t||!t.pFlags.comments||t.channel_id.toChatId()===o.IA)return}return e}isFetchIntervalNeeded(e){return e.isAnyChat()&&(!this.appChatsManager.isInChat(e.toChatId())||this.appChatsManager.isForum(e.toChatId()))}getNewHistory(e,t){var a;return Xt(this,void 0,void 0,(function*(){if(!this.isFetchIntervalNeeded(e))return;const s=this.getHistoryStorage(e,t),n=s.history.slice;if(!n.isEnd(se.D.Bottom))return;delete s.maxId,n.unsetEnd(se.D.Bottom);const i=yield this.getHistory(e,null!==(a=n[0])&&void 0!==a?a:1,0,50,t);for(let t=0,a=i.history.length;t{const e=i.history.sliceMe(t,r,a),s=(null==e?void 0:e.slice)||i.history.constructSlice();return{count:i.count,history:Array.from(s),isEnd:s.getEnds(),offsetIdOffset:(null==e?void 0:e.offsetIdOffset)||i.count}})):{count:i.count,history:Array.from(o.slice),isEnd:o.slice.getEnds(),offsetIdOffset:o.offsetIdOffset}}isHistoryResultEnd(e,t,a,s){const{offset_id_offset:n,messages:i}=e,r=i.map((e=>e.mid)),o=e.count||i.length,p=a<0?t+a:t,d=Math.abs(a);let f=n,c=!1,l=!1;if(void 0!==f)c=f>=o-p||or[e]);++e);const t=i.length-e,a=r.includes(s)?e-1:e;p&&(c=tc[e]);++e);c.splice(e,0,a)}const l=e.insertSlice(c)||e.slice;return d&&l.setEnd(se.D.Top),f&&l.setEnd(se.D.Bottom),Object.assign({slice:l,mids:c,messages:i},r)}fillHistoryStorage(e,t,a,s,n,i){const r=n.maxId;return this.requestHistory(e,t,a,s,void 0,i).then((i=>{const{count:o,isBottomEnd:p,slice:d,messages:f}=this.mergeHistoryResult(n.history,i,t,a,s);n.count=o;for(let t=0,a=f.length;t{d.ZP&&this.log("requestHistory result:",e,r,t,a,s),this.appUsersManager.saveApiUsers(r.users),this.appChatsManager.saveApiChats(r.chats),this.saveMessages(r.messages),"pts"in r&&this.apiUpdatesManager.addChannelState(e.toChatId(),r.pts);let o=r.messages.length,p=r.count;o&&!r.messages[o-1]&&(r.messages.splice(o-1,1),o--,p--);const f=this.getHistoryStorage(e,i),c=r.messages[o-1];if(o&&c.grouped_id){const t=f.history.findSlice(c.mid);if(t&&t.slice.length+r.messages.lengthr))}return r}),(t=>{if("CHANNEL_PRIVATE"===t.type){let t=this.appChatsManager.getChat(e.toChatId());"channel"===t._&&(t={_:"channelForbidden",id:e.toChatId(),access_hash:t.access_hash,title:t.title,pFlags:t.pFlags}),this.apiUpdatesManager.processUpdateMessage({_:"updates",updates:[{_:"updateChannel",channel_id:e.toChatId()}],chats:[t],users:[]})}throw t}))}fetchSingleMessages(){return this.fetchSingleMessagesPromise?this.fetchSingleMessagesPromise:this.fetchSingleMessagesPromise=(0,P.Z)(0).then((()=>{const e=[];for(const[t,a]of this.needSingleMessages){const s=[...a.keys()],n=s.map((e=>({_:"inputMessageID",id:(0,oe.Z)(e)})));let i;i=t.isAnyChat()&&this.appPeersManager.isChannel(t)?this.apiManager.invokeApiSingle("channels.getMessages",{channel:this.appChatsManager.getChannelInput(t.toChatId()),id:n}):this.apiManager.invokeApiSingle("messages.getMessages",{id:n});const r=i.then((e=>{(0,ue.Z)(e),this.appUsersManager.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats);const t=this.saveMessages(e.messages);for(let e=0;e{this.rootScope.dispatchEvent("messages_downloaded",{peerId:t,mids:s})}));e.push(r)}return this.needSingleMessages.clear(),Promise.all(e).then(qt.Z,qt.Z).then((()=>{this.fetchSingleMessagesPromise=void 0,this.needSingleMessages.size&&this.fetchSingleMessages()}))}))}reloadMessages(e,t,a){if(Array.isArray(t))return Promise.all(t.map((t=>this.reloadMessages(e,t,a))));const s=this.getMessageByPeer(e,t);if(s&&!a)return this.rootScope.dispatchEvent("messages_downloaded",{peerId:e,mids:[t]}),Promise.resolve(s);{let a=this.needSingleMessages.get(e);a||this.needSingleMessages.set(e,a=new Map);let s=a.get(t);return s||(s=(0,v.Z)(),a.set(t,s),this.fetchSingleMessages(),s)}}getExtendedMedia(e,t){let a=this.extendedMedia.get(e);a||this.extendedMedia.set(e,a=new Map);const s=(0,v.Z)(),n=[],i=t.map((t=>{let i=a.get(t);return i||(a.set(t,i=s),n.push(t),i.then((()=>{a.delete(t),a.size||this.extendedMedia.get(e)!==a||this.extendedMedia.delete(e)}))),i}));return n.length?this.apiManager.invokeApi("messages.getExtendedMedia",{peer:this.appPeersManager.getInputPeerById(e),id:n.map((e=>(0,oe.Z)(e)))}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e),s.resolve()})):s.resolve(),Promise.all(i)}fetchMessageReplyTo(e){if(!e.reply_to_mid)return Promise.resolve(this.generateEmptyMessage(0));const t=e.reply_to.reply_to_peer_id?this.appPeersManager.getPeerId(e.reply_to.reply_to_peer_id):e.peerId;return this.reloadMessages(t,e.reply_to_mid).then((t=>{if(t||delete(e=this.getMessageByPeer(e.peerId,e.mid)).reply_to_mid,"messageService"===e._){const t=e.peerId;this.rootScope.dispatchEvent("message_edit",{storageKey:`${t}_history`,peerId:t,mid:e.mid,message:e}),this.isMessageIsTopMessage(e)&&this.rootScope.dispatchEvent("dialogs_multiupdate",new Map([[t,{dialog:this.getDialogOnly(t)}]]))}return t}))}getTypingKey(e,t){return t?`${e}_${t}`:e}setTyping(e,t,a,s){var n;s&&!this.appPeersManager.isForum(e)&&(s=void 0);const i=this.getTypingKey(e,s);let r=this.typings[i];return e&&this.canSendToPeer(e)&&e!==this.appPeersManager.peerId&&(a||(null===(n=null==r?void 0:r.action)||void 0===n?void 0:n._)!==t._)?((null==r?void 0:r.timeout)&&clearTimeout(r.timeout),r=this.typings[i]={action:t},this.apiManager.invokeApi("messages.setTyping",{peer:this.appPeersManager.getInputPeerById(e),action:t,top_msg_id:s?(0,oe.Z)(s):void 0}).finally((()=>{r===this.typings[i]&&(r.timeout=T.Z.setTimeout((()=>{delete this.typings[i]}),6e3))}))):Promise.resolve(!1)}handleReleasingMessage(e,t){const a=e.media;if(a){const s=a.webpage||a,n=s.photo||s.document;if((null==n?void 0:n.file_reference)&&this.referenceDatabase.deleteContext(n.file_reference,{type:"message",peerId:e.peerId,messageId:e.mid}),"webpage"in a&&a.webpage){const s=this.getScheduledMessagesStorage(e.peerId)===t,n=this.appWebPagesManager.getMessageKeyForPendingWebPage(e.peerId,e.mid,s);this.appWebPagesManager.deleteWebPageFromPending(a.webpage,n)}a.poll&&this.appPollsManager.updatePollToMessage(e,!1)}}handleDeletedMessages(e,t,a){const s={count:0,unread:0,unreadMentions:0,msgs:new Set};for(const n of a){const a=this.getMessageFromStorage(t,n);if(!a){this.fixDialogUnreadMentionsIfNoMessage(e);continue}this.handleReleasingMessage(a,t),this.updateMessageRepliesIfNeeded(a),a.pFlags.out||a.pFlags.is_outgoing||!a.pFlags.unread||(++s.unread,this.rootScope.dispatchEvent("notification_cancel","msg"+n),a.pFlags.mentioned&&(++s.unreadMentions,this.modifyCachedMentions(e,n,!1))),++s.count,s.msgs.add(n),a.deleted=!0;const i=a.grouped_id;if(i){const e=this.groupedMessagesStorage[i];e&&(e.delete(n),s.albums||(s.albums={}),(s.albums[i]||(s.albums[i]=new Set)).add(n),e.size||(delete s.albums,delete this.groupedMessagesStorage[i]))}t.delete(n)}if(s.albums)for(const e in s.albums)this.dispatchAlbumEdit(e,t,[...s.albums[e]]);return s}handleEditedMessage(e,t,a){var s;if("message"===e._){if(null===(s=e.media)||void 0===s?void 0:s.webpage){const t=this.appWebPagesManager.getMessageKeyForPendingWebPage(e.peerId,e.mid,!!e.pFlags.is_scheduled);this.appWebPagesManager.deleteWebPageFromPending(e.media.webpage,t)}const t=e.grouped_id;t&&this.dispatchAlbumEdit(t,a,[])}}dispatchAlbumEdit(e,t,a){const s=this.getMidsByAlbum(e).map((e=>this.getMessageFromStorage(t,e)));this.rootScope.dispatchEvent("album_edit",{peerId:s[0].peerId,groupId:e,deletedMids:a||[],messages:s})}getDialogUnreadCount(e){var t;let a=e.unread_count;if(!this.dialogsStorage.isTopic(e)&&this.appPeersManager.isForum(e.peerId)){const t=this.dialogsStorage.getForumUnreadCount(e.peerId);a=t instanceof Promise?0:t.count}return a||+!!(null===(t=e.pFlags)||void 0===t?void 0:t.unread_mark)}isDialogUnread(e){return!!this.getDialogUnreadCount(e)}canForward(e){return"message"===(null==e?void 0:e._)&&!e.pFlags.noforwards&&!this.appPeersManager.noForwards(e.peerId)}pushBatchUpdate(e,t,a,s){let n=this.batchUpdates[e];n||(n=this.batchUpdates[e]={callback:t,batch:new Map}),n.batch.has(a)||(n.batch.set(a,s?s():void 0),this.batchUpdatesDebounced())}getMessagesFromMap(e){const t=new Map;for(const[a,s]of e){const[e,n]=a.split("_"),i=this.getMessageByPeer(e.toPeerId(),+n);i&&t.set(i,s)}return t}saveDefaultSendAs(e,t){return this.appProfileManager.getCachedFullChat(e.toChatId()).default_send_as=this.appPeersManager.getOutputPeer(t),this.apiManager.invokeApi("messages.saveDefaultSendAs",{peer:this.appPeersManager.getInputPeerById(e),send_as:this.appPeersManager.getInputPeerById(t)})}}var aa=a(6724);function sa(e){const t=e.replace("input","");return t[0].toLowerCase()+t.slice(1)}class na extends G{constructor(){super(...arguments),this.peerSettings={notifyPeer:{},notifyUsers:null,notifyChats:null,notifyBroadcasts:null,notifyForumTopic:{}},this.checkMuteUntil=()=>{void 0!==this.checkMuteUntilTimeout&&(clearTimeout(this.checkMuteUntilTimeout),this.checkMuteUntilTimeout=void 0);const e=(0,te.Z)(!0);let t=o.rU;const a=a=>{if(a instanceof Promise)return!1;const s=a.mute_until;return!!s&&(s<=e?(a.mute_until=0,!0):(s{for(const t in this.peerSettings[e]){const s=this.peerSettings[e][t];if(a(s)){const[e,a]=t.split("_"),n=this.appPeersManager.getOutputPeer(e.toPeerId());this.apiUpdatesManager.saveUpdate({_:"updateNotifySettings",peer:a?{_:"notifyForumTopic",peer:n,top_msg_id:+a}:{_:"notifyPeer",peer:n},notify_settings:s})}}}));const s=Math.min(18e5,1e3*(t-e));this.checkMuteUntilTimeout=T.Z.setTimeout(this.checkMuteUntil,s)}}after(){return this.checkMuteUntilThrottled=(0,aa.Z)(this.checkMuteUntil,1e3,!1),this.apiUpdatesManager.addMultipleEventsListeners({updateNotifySettings:e=>{const{peer:t}=e,a="notifyForumTopic"===t._,s="notifyPeer"===t._||a,n=s&&this.appPeersManager.getPeerId(t.peer),i=s?void 0:t._;this.savePeerSettings({key:i,peerId:n,threadId:a?(0,pe.Z)(t.top_msg_id):void 0,settings:e.notify_settings}),this.rootScope.dispatchEvent("notify_settings",e)}}),this.appStateManager.getState().then((e=>{if(e.notifySettings)for(const t in e.notifySettings)(0,ue.Z)(t),this.savePeerSettings({key:t,settings:e.notifySettings[t]})}))}getNotifySettings(e){let t,a=sa(e._),s=this.peerSettings[a];return"inputNotifyPeer"===e._&&(t=a=this.appPeersManager.getPeerId(e.peer),s=s[a]),s||((s||this.peerSettings)[a]=this.apiManager.invokeApi("account.getNotifySettings",{peer:e}).then((e=>(this.savePeerSettings({key:a,peerId:t,settings:e}),e))))}getNotifyPeerTypeSettings(){if(this.getNotifyPeerTypePromise)return this.getNotifyPeerTypePromise;const e=["inputNotifyBroadcasts","inputNotifyUsers","inputNotifyChats"].map((e=>this.getNotifySettings({_:e})));return this.getNotifyPeerTypePromise=Promise.all(e)}updateNotifySettings(e,t){return this.apiManager.invokeApi("account.updateNotifySettings",{peer:e,settings:t}).then((a=>{a&&this.apiUpdatesManager.processLocalUpdate({_:"updateNotifySettings",peer:Object.assign(Object.assign({},e),{_:sa(e._)}),notify_settings:Object.assign(Object.assign({},t),{_:"peerNotifySettings"})})}))}getContactSignUpNotification(){return this.notifyContactsSignUp?this.notifyContactsSignUp:this.notifyContactsSignUp=this.apiManager.invokeApi("account.getContactSignUpNotification")}setContactSignUpNotification(e){this.apiManager.invokeApi("account.setContactSignUpNotification",{silent:e}).then((t=>{this.notifyContactsSignUp=Promise.resolve(!e)}))}getPeerKey(e,t){return e+(t?"_"+t:"")}savePeerSettings({key:e,peerId:t,threadId:a,settings:s}){let n;t&&(e=this.getPeerKey(t,a),n=this.peerSettings[a?"notifyForumTopic":"notifyPeer"]),(n||this.peerSettings)[e]=s,t?this.checkMuteUntilThrottled():(this.rootScope.dispatchEvent("notify_peer_type_settings",{key:e,settings:s}),this.appStateManager.getState().then((t=>{const a=t.notifySettings;a[e]=s,this.appStateManager.pushToState("notifySettings",a)})))}isMuted(e){return"peerNotifySettings"===e._&&(e.silent||void 0!==e.mute_until&&1e3*e.mute_until>(0,te.Z)())}getPeerMuted(e){const t=this.getNotifySettings({_:"inputNotifyPeer",peer:this.appPeersManager.getInputPeerById(e)});return(t instanceof Promise?t:Promise.resolve(t)).then((e=>this.isMuted(e)))}getPeerLocalSettings({peerId:e,respectType:t=!0,threadId:a}){const s={_:"peerNotifySettings"},n=this.getPeerKey(e,a),i=this.peerSettings[a?"notifyForumTopic":"notifyPeer"][n];if(!i||i instanceof Promise||Object.assign(s,i),t){const t=sa(this.appPeersManager.getInputNotifyPeerById({peerId:e,ignorePeerId:!0,threadId:a})._),n=this.peerSettings[t];if(n&&!(n instanceof Promise))for(const e in n)void 0===s[e]&&(s[e]=n[e])}return s}validatePeerSettings(e){if(e.peerId!==this.appPeersManager.peerId)return e.threadId&&!this.appPeersManager.isForum(e.peerId)&&(e.threadId=void 0),e}isPeerLocalMuted(e){if(!(e=this.validatePeerSettings(e)))return!1;if(e.threadId){const t=this.getPeerLocalSettings(Object.assign(Object.assign({},e),{respectType:!1}));return void 0!==t.silent||void 0!==t.mute_until?this.isMuted(t):this.isPeerLocalMuted(Object.assign(Object.assign({},e),{threadId:void 0}))}const t=this.getPeerLocalSettings(e);return this.isMuted(t)}}var ia=a(677),ra=a(617),oa=a(7361),pa=a(7419),da=a(7256);class fa extends G{get peerId(){return this.appUsersManager.userId.toPeerId()}canPinMessage(e){return e.isUser()||this.appChatsManager.hasRights(e.toChatId(),"pin_messages")}getPeerPhoto(e){const t=this.getPeer(e);return(0,da.Z)(t)}getPeerMigratedTo(e){if(e.isUser())return!1;const t=this.appChatsManager.getChat(e.toChatId()),a=null==t?void 0:t.migrated_to;return!(!a||!t.pFlags.deactivated)&&(0,le.Z)(a)}getOutputPeer(e){if(e.isUser())return{_:"peerUser",user_id:e.toUserId()};const t=e.toChatId();return this.appChatsManager.isChannel(t)?{_:"peerChannel",channel_id:t}:{_:"peerChat",chat_id:t}}getPeerString(e){return e.isUser()?this.appUsersManager.getUserString(e.toUserId()):this.appChatsManager.getChatString(e.toChatId())}getPeerUsername(e){return this.getPeerActiveUsernames(e)[0]||""}getPeerActiveUsernames(e){const t=this.getPeer(e);return(0,$t.Z)(t)}getPeer(e){return e.isUser()?this.appUsersManager.getUser(e.toUserId()):this.appChatsManager.getChat(e.toChatId())}getPeerId(e){return(0,le.Z)(e)||(0,fe.Z)(e)&&"inputPeerSelf"===e._&&this.peerId||o.NM}getDialogPeer(e){return{_:"dialogPeer",peer:this.getOutputPeer(e)}}isChannel(e){return!e.isUser()&&this.appChatsManager.isChannel(e.toChatId())}isMegagroup(e){return!e.isUser()&&this.appChatsManager.isMegagroup(e.toChatId())}isForum(e){return!e.isUser()&&this.appChatsManager.isForum(e.toChatId())}isAnyGroup(e){return!e.isUser()&&!this.appChatsManager.isBroadcast(e.toChatId())}isBroadcast(e){return this.isChannel(e)&&!this.isMegagroup(e)}isBot(e){return e.isUser()&&this.appUsersManager.isBot(e.toUserId())}isContact(e){return e.isUser()&&this.appUsersManager.isContact(e.toUserId())}isUser(e){return(0,ra.Z)(e)}isAnyChat(e){return(0,oa.Z)(e)}isPeerRestricted(e){return(0,pa.Z)(this.getPeer(e))}getRestrictionReasonText(e){const t=this.getPeer(e),a=t.restriction_reason?(0,ia.RP)(t.restriction_reason):void 0;return a?a.text:e.isUser()?"This user is restricted":"This chat is restricted"}getInputNotifyPeerById({peerId:e,ignorePeerId:t,threadId:a}){return t?e.isUser()?{_:"inputNotifyUsers"}:this.isBroadcast(e)?{_:"inputNotifyBroadcasts"}:{_:"inputNotifyChats"}:a?{_:"inputNotifyForumTopic",peer:this.getInputPeerById(e),top_msg_id:(0,oe.Z)(a)}:{_:"inputNotifyPeer",peer:this.getInputPeerById(e)}}getInputPeerById(e){if(!e)return{_:"inputPeerEmpty"};if(!e.isUser()){const t=e.toChatId();return this.appChatsManager.getInputPeer(t)}const t=e.toUserId();return this.appUsersManager.getUserInputPeer(t)}getInputPeerSelf(){return{_:"inputPeerSelf"}}getInputDialogPeerById(e){return{_:"inputDialogPeer",peer:(0,fe.Z)(e)?e:this.getInputPeerById(e)}}getPeerSearchText(e){let t;return t=this.isUser(e)?"%pu "+this.appUsersManager.getUserSearchText(e.toUserId()):"%pg "+(this.appChatsManager.getChat(e.toChatId()).title||""),t}getDialogType(e){return this.isMegagroup(e)?"megagroup":this.isChannel(e)?"channel":this.isUser(e)?e===this.peerId?"saved":"chat":"group"}getDeleteButtonText(e){switch(this.getDialogType(e)){case"channel":return this.appChatsManager.hasRights(e.toChatId(),"delete_chat")?"ChannelDelete":"ChatList.Context.LeaveChannel";case"megagroup":case"group":return this.appChatsManager.hasRights(e.toChatId(),"delete_chat")?"DeleteMega":"ChatList.Context.LeaveGroup";default:return"ChatList.Context.DeleteChat"}}noForwards(e){var t;return!e.isUser()&&!!(null===(t=this.appChatsManager.getChat(e.toChatId()).pFlags)||void 0===t?void 0:t.noforwards)}}class ca extends G{constructor(){super(...arguments),this.photos={}}savePhoto(e,t){var a;if(!e||"photoEmpty"===e._)return;const s=this.photos[e.id];if(e.file_reference&&(dt("file_reference",s,e),this.referenceDatabase.saveContext(e.file_reference,t)),null===(a=e.sizes)||void 0===a?void 0:a.length){e.sizes.sort(((e,t)=>(e.size||(e.sizes?1/0:0))-(t.size||(t.sizes?1/0:0))));const t=e.sizes[e.sizes.length-1];"photoSizeProgressive"===t._&&(t.size=t.sizes[t.sizes.length-1])}return s?Object.assign(s,e):this.photos[e.id]=e}getUserPhotos(e,t="0",a=20){const s=this.appUsersManager.getUserInput(e);return this.apiManager.invokeApiCacheable("photos.getUserPhotos",{user_id:s,offset:0,limit:a,max_id:t},{cacheSeconds:60}).then((a=>{this.appUsersManager.saveApiUsers(a.users);const s=a.photos.map(((t,s)=>(a.photos[s]=this.savePhoto(t,{type:"profilePhoto",peerId:e.toPeerId()}),t.id)));if("0"!==t&&t){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}return{count:a.count||s.length,photos:s}}))}getPhoto(e){return(0,fe.Z)(e)?e:this.photos[e]}}class la extends G{constructor(){super(...arguments),this.polls={},this.results={},this.pollToMessages={},this.log=(0,S.kg)("POLLS",S.v9.Error)}after(){this.apiUpdatesManager.addMultipleEventsListeners({updateMessagePoll:e=>{this.log("updateMessagePoll:",e);let t=e.poll||this.polls[e.poll_id];if(!t)return;let a=e.results;const s=this.savePoll(t,a);t=s.poll,a=s.results,this.rootScope.dispatchEvent("poll_update",{poll:t,results:a})}})}savePoll(e,t,a){a&&this.updatePollToMessage(a,!0);const s=e.id;return this.polls[s]?(e=Object.assign(this.polls[s],e),t=this.saveResults(e,t)):(this.polls[s]=e,e.chosenIndexes=[],t=this.saveResults(e,t)),{poll:e,results:t}}saveResults(e,t){var a;return this.results[e.id]?t=Object.assign(this.results[e.id],t):this.results[e.id]=t,t.pFlags.min||(e.chosenIndexes.length=0,(null===(a=null==t?void 0:t.results)||void 0===a?void 0:a.length)&&t.results.forEach(((t,a)=>{var s;(null===(s=t.pFlags)||void 0===s?void 0:s.chosen)&&e.chosenIndexes.push(a)}))),t}getPoll(e){return{poll:this.polls[e],results:this.results[e]}}getInputMediaPoll(e,t,a,s){return a?(s||(s=[]),a=(0,we.Z)(a,s)):a=void 0,{_:"inputMediaPoll",poll:e,correct_answers:t,solution:a,solution_entities:a?s:void 0}}updatePollToMessage(e,t){const{id:a}=e.media.poll;let s=this.pollToMessages[a];if(!t&&!s)return;s||(s=this.pollToMessages[a]=new Set);const n=e.peerId+"_"+e.mid;t?s.add(n):s.delete(n),t||s.size||(delete this.polls[a],delete this.results[a],delete this.pollToMessages[a])}sendVote(e,t){const a=e.media.poll,s=t.map((e=>a.answers[e].option)),n=e.mid,i=e.peerId,r=this.appPeersManager.getInputPeerById(i);return e.pFlags.is_outgoing?this.appMessagesManager.invokeAfterMessageIsSent(n,"sendVote",(e=>(this.log("invoke sendVote callback"),this.sendVote(e,t)))):this.apiManager.invokeApi("messages.sendVote",{peer:r,msg_id:(0,oe.Z)(e.mid),options:s}).then((e=>{this.log("sendVote updates:",e),this.apiUpdatesManager.processUpdateMessage(e)}))}getResults(e){const t=this.appPeersManager.getInputPeerById(e.peerId);return this.apiManager.invokeApi("messages.getPollResults",{peer:t,msg_id:(0,oe.Z)(e.mid)}).then((e=>{this.apiUpdatesManager.processUpdateMessage(e),this.log("getResults updates:",e)}))}getVotes(e,t,a,s=20){return this.apiManager.invokeApi("messages.getPollVotes",{peer:this.appPeersManager.getInputPeerById(e.peerId),id:(0,oe.Z)(e.mid),option:t,offset:a,limit:s}).then((e=>(this.log("getPollVotes messages:",e),this.appUsersManager.saveApiUsers(e.users),e)))}stopPoll(e){const t=e.media.poll;if(t.pFlags.closed)return Promise.resolve();const a=(0,ve.Z)(t);return a.pFlags.closed=!0,this.appMessagesManager.editMessage(e,void 0,{newMedia:this.getInputMediaPoll(a)}).then((()=>{}),(e=>{this.log.error("stopPoll error:",e)}))}}class ma extends G{constructor(){super(...arguments),this.privacy={}}after(){this.apiUpdatesManager.addMultipleEventsListeners({updatePrivacy:e=>{const t=e.key._;this.privacy[t]=e.rules,this.rootScope.dispatchEvent("privacy_update",e)}})}setPrivacy(e,t){return this.apiManager.invokeApi("account.setPrivacy",{key:{_:e},rules:t}).then((a=>(this.appUsersManager.saveApiUsers(a.users),this.appChatsManager.saveApiChats(a.chats),this.apiUpdatesManager.processLocalUpdate({_:"updatePrivacy",key:{_:sa(e)},rules:t.map((e=>{const t={};return Object.assign(t,e),t._=sa(t._),t}))}),a.rules)))}getPrivacy(e){const t=sa(e),a=this.privacy[t];return a?Promise.resolve(a):this.privacy[t]=this.apiManager.invokeApi("account.getPrivacy",{key:{_:e}}).then((e=>(this.appUsersManager.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats),this.privacy[t]=e.rules)))}getGlobalPrivacySettings(){return this.apiManager.invokeApi("account.getGlobalPrivacySettings")}setGlobalPrivacySettings(e){return this.apiManager.invokeApi("account.setGlobalPrivacySettings",{settings:e})}}var ga=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};const ha=18e4;class ua extends G{constructor(){super(...arguments),this.usersFull={},this.chatsFull={},this.fullExpiration={},this.onUpdateChatParticipants=e=>{const t=e.participants;if("chatParticipants"!==t._)return;const a=t.chat_id,s=this.chatsFull[a];void 0!==s&&(s.participants=t,this.rootScope.dispatchEvent("chat_full_update",a))},this.onUpdateChatParticipantAdd=e=>{const t=this.chatsFull[e.chat_id];if(void 0===t)return;const a=t.participants,s=a.participants||[];for(let t=0,a=s.length;t{const t=this.chatsFull[e.chat_id];if(void 0===t)return;const a=t.participants,s=a.participants||[];for(let t=0,n=s.length;t{var t,a;const s=e.user_id?e.user_id.toPeerId():this.appPeersManager.getPeerId(e.from_id);if(this.appPeersManager.peerId===s||"speakingInGroupCallAction"===e.action._)return;const n=e.top_msg_id,i=n?(0,pe.Z)(n):void 0,r=this.appPeersManager.getPeerId(e),o=this.getTypingsKey(r,i),p=null!==(t=(a=this.typingsInPeer)[o])&&void 0!==t?t:a[o]=[];let d=p.find((e=>e.userId===s));const f=()=>{delete d.timeout;const e=p.indexOf(d);-1!==e&&p.splice(e,1),this.rootScope.dispatchEvent("peer_typings",{peerId:r,threadId:i,typings:p}),p.length||delete this.typingsInPeer[o]};if(void 0!==(null==d?void 0:d.timeout)&&clearTimeout(d.timeout),"sendMessageCancelAction"===e.action._){if(!d)return;return void f()}d||(d={userId:s},p.push(d)),d.action=e.action;const c=this.appUsersManager.hasUser(s);c?this.appUsersManager.forceUserOnline(s):"updateChatUserTyping"===e._&&e.chat_id&&this.appChatsManager.hasChat(e.chat_id)&&!this.appChatsManager.isChannel(e.chat_id)&&Promise.resolve(this.getChatFull(e.chat_id)).then((()=>{void 0!==d.timeout&&this.appUsersManager.hasUser(s)&&this.rootScope.dispatchEvent("peer_typings",{peerId:r,threadId:i,typings:p})})),d.timeout=T.Z.setTimeout(f,6e3),c&&this.rootScope.dispatchEvent("peer_typings",{peerId:r,threadId:i,typings:p})},this.onUpdatePeerBlocked=e=>{const t=this.appPeersManager.getPeerId(e.peer_id);if(this.appPeersManager.isUser(t)){const a=t.toUserId(),s=this.usersFull[a];s&&(e.blocked?s.pFlags.blocked=!0:delete s.pFlags.blocked),this.rootScope.dispatchEvent("user_full_update",a)}this.rootScope.dispatchEvent("peer_block",{peerId:t,blocked:e.blocked})}}after(){this.apiUpdatesManager.addMultipleEventsListeners({updateChatParticipants:this.onUpdateChatParticipants,updateChatParticipantAdd:this.onUpdateChatParticipantAdd,updateChatParticipantDelete:this.onUpdateChatParticipantDelete,updateUserTyping:this.onUpdateUserTyping,updateChatUserTyping:this.onUpdateUserTyping,updateChannelUserTyping:this.onUpdateUserTyping,updatePeerBlocked:this.onUpdatePeerBlocked}),this.rootScope.addEventListener("chat_update",(e=>{var t,a;const s=this.chatsFull[e],n=this.appChatsManager.getChat(e);if(!s||!n)return;let i=!1;!!s.call!=!!(null===(t=n.pFlags)||void 0===t?void 0:t.call_active)&&(i=!0);const{photo:r}=n;if(r){const e="chatPhotoEmpty"!==r._;(e!==!(!s.chat_photo||"photoEmpty"===s.chat_photo._)||e&&r.photo_id!==(null===(a=s.chat_photo)||void 0===a?void 0:a.id))&&(i=!0)}i&&this.refreshFullPeer(e.toPeerId(!0))})),this.rootScope.addEventListener("channel_update",(e=>{this.refreshFullPeer(e.toPeerId(!0))})),this.rootScope.addEventListener("chat_full_update",(e=>{this.rootScope.dispatchEvent("peer_full_update",e.toPeerId(!0))})),this.rootScope.addEventListener("user_full_update",(e=>{this.rootScope.dispatchEvent("peer_full_update",e.toPeerId(!1))})),this.rootScope.addEventListener("invalidate_participants",(e=>{this.invalidateChannelParticipants(e)})),this.typingsInPeer={}}getProfile(e,t){return this.usersFull[e]&&!t&&Date.now(){this.appChatsManager.saveApiChats(t.chats,!0),this.appUsersManager.saveApiUsers(t.users);const a=t.full_user,s=e.toPeerId(!1);a.profile_photo&&(a.profile_photo=this.appPhotosManager.savePhoto(a.profile_photo,{type:"profilePhoto",peerId:s}));const n=a.bot_info;if(n){const t={type:"userFull",userId:e};n.description_document=this.appDocsManager.saveDoc(n.description_document,t),n.description_photo=this.appPhotosManager.savePhoto(n.description_photo,t)}return this.appNotificationsManager.savePeerSettings({peerId:s,settings:a.notify_settings}),this.usersFull[e]=a,this.fullExpiration[s]=Date.now()+ha,this.rootScope.dispatchEvent("user_full_update",e),a}})}getProfileByPeerId(e,t){return this.appPeersManager.isAnyChat(e)?this.getChatFull(e.toChatId(),t):this.getProfile(e.toUserId(),t)}getCachedFullChat(e){return this.chatsFull[e]}getCachedFullUser(e){return this.usersFull[e]}getCachedProfileByPeerId(e){return e.isUser()?this.getCachedFullUser(e.toUserId()):this.getCachedFullChat(e.toChatId())}getFullPhoto(e){return ga(this,void 0,void 0,(function*(){const t=yield this.getProfileByPeerId(e);switch(t._){case"userFull":return t.profile_photo;case"channelFull":case"chatFull":return t.chat_photo}}))}getChatFull(e,t){if(this.appChatsManager.isChannel(e))return this.getChannelFull(e,t);const a=e.toPeerId(!0),s=this.chatsFull[e];if(s&&!t&&Date.now(){this.appChatsManager.saveApiChats(t.chats,!0),this.appUsersManager.saveApiUsers(t.users);const s=t.full_chat;return s&&s.chat_photo&&s.chat_photo.id&&(s.chat_photo=this.appPhotosManager.savePhoto(s.chat_photo,{type:"profilePhoto",peerId:a})),s.call&&this.appGroupCallsManager.saveGroupCall(s.call,e),this.appNotificationsManager.savePeerSettings({peerId:a,settings:s.notify_settings}),this.chatsFull[e]=s,this.fullExpiration[a]=Date.now()+ha,this.rootScope.dispatchEvent("chat_full_update",e),s}})}getChatInviteLink(e,t){return ga(this,void 0,void 0,(function*(){const a=yield this.getChatFull(e);return!t&&a.exported_invite&&"chatInviteExported"==a.exported_invite._?a.exported_invite.link:this.apiManager.invokeApi("messages.exportChatInvite",{peer:this.appPeersManager.getInputPeerById(e.toPeerId(!0))}).then((t=>(void 0!==this.chatsFull[e]&&(this.chatsFull[e].exported_invite=t),t.link)))}))}getParticipants(e,t={_:"channelParticipantsRecent"},a=200,s=0){return this.appChatsManager.isChannel(e)?this.getChannelParticipants(e,t,a,s):Promise.resolve(this.getChatFull(e)).then((e=>{const a=e.participants;if("chatParticipants"!==a._)throw(0,X.Z)("CHAT_PRIVATE");if("channelParticipantsSearch"===t._&&t.q.trim()){const e=this.appUsersManager.createSearchIndex();a.participants.forEach((t=>{const a=t.user_id;e.indexObject(a,this.appUsersManager.getUserSearchText(a))}));const s=e.search(t.q),n=a.participants.filter((e=>s.has(e.user_id)));return Object.assign(Object.assign({},a),{participants:n})}return a}))}getParticipant(e,t){return this.appChatsManager.isChannel(e)?this.getChannelParticipant(e,t):this.getParticipants(e).then((e=>{(0,ue.Z)(e);const a=e.participants.find((e=>{if((0,xe.Z)(e)===t)return e}));if(!a)throw(0,X.Z)("USER_NOT_PARTICIPANT");return a}))}getChannelParticipants(e,t={_:"channelParticipantsRecent"},a=200,s=0){if("channelParticipantsRecent"===t._){const t=this.appChatsManager.getChat(e);if((null==t?void 0:t.pFlags)&&t.pFlags.broadcast&&!t.pFlags.creator&&!t.admin_rights)return Promise.reject()}return this.apiManager.invokeApiCacheable("channels.getParticipants",{channel:this.appChatsManager.getChannelInput(e),filter:t,offset:s,limit:a,hash:"0"},{cacheSeconds:60}).then((e=>(this.appUsersManager.saveApiUsers(e.users),e)))}getChannelParticipant(e,t){return this.apiManager.invokeApiSingle("channels.getParticipant",{channel:this.appChatsManager.getChannelInput(e),participant:this.appPeersManager.getInputPeerById(t)}).then((e=>(this.appUsersManager.saveApiUsers(e.users),e.participant)))}getChannelFull(e,t){const a=e.toPeerId(!0);return void 0!==this.chatsFull[e]&&!t&&Date.now(){this.appChatsManager.saveApiChats(t.chats,!0),this.appUsersManager.saveApiUsers(t.users);const s=t.full_chat;return s&&s.chat_photo.id&&(s.chat_photo=this.appPhotosManager.savePhoto(s.chat_photo,{type:"profilePhoto",peerId:a})),s.call&&this.appGroupCallsManager.saveGroupCall(s.call,e),this.appNotificationsManager.savePeerSettings({peerId:a,settings:s.notify_settings}),this.chatsFull[e]=s,this.fullExpiration[a]=Date.now()+ha,this.rootScope.dispatchEvent("chat_full_update",e),s},processError:t=>{if("CHANNEL_PRIVATE"===t.type){const t=this.appChatsManager.getChat(e);this.apiUpdatesManager.processUpdateMessage({_:"updates",updates:[{_:"updateChannel",channel_id:e}],chats:["channelForbidden"===t._?t:{_:"channelForbidden",id:e,access_hash:t.access_hash,title:t.title,pFlags:t.pFlags}],users:[]})}throw t}})}getMentions(e,t,a){const s=e=>{"@"===t.charAt(0)&&(t=t.slice(1));const a=new ae.Z({ignoreCase:!0}),s=new Map;e.forEach((e=>{a.indexObject(e.id,this.appUsersManager.getUserSearchText(e.id)),s.set(e.id,e.rating)}));const n=Array.from(a.search(t));return n.sort(((e,t)=>s.get(t)-s.get(e))),n};let n;return n=this.appChatsManager.isChannel(e)?this.getChannelParticipants(e,{_:"channelParticipantsMentions",q:t,top_msg_id:(0,oe.Z)(a)},50,0).then((e=>e.participants.map((e=>(0,xe.Z)(e))))):e?Promise.resolve(this.getChatFull(e)).then((e=>e.participants.participants.map((e=>e.user_id.toPeerId())))):Promise.resolve([]),Promise.all([this.appUsersManager.getTopPeers("bots_inline").catch((()=>[])),n]).then((e=>{const t=e[0].concat(e[1].map((e=>({id:e,rating:0}))));return s(t)}))}invalidateChannelParticipants(e){this.apiManager.clearCache("channels.getParticipants",(t=>t.channel.channel_id===e)),this.refreshFullPeer(e.toPeerId(!0))}refreshFullPeer(e){if(e.isUser()){const t=e.toUserId();delete this.usersFull[t],this.rootScope.dispatchEvent("user_full_update",t)}else{const t=e.toChatId();delete this.chatsFull[t],this.rootScope.dispatchEvent("chat_full_update",t)}}updateProfile(e,t,a){return this.apiManager.invokeApi("account.updateProfile",{first_name:e,last_name:t,about:a}).then((e=>{if(this.appUsersManager.saveApiUser(e),void 0!==a){const t=e.id.toPeerId(),s=this.usersFull[e.id];s&&(s.about=a),this.rootScope.dispatchEvent("peer_bio_edit",t)}return this.getProfile(e.id,!0)}))}uploadProfilePhoto(e){return this.apiManager.invokeApi("photos.uploadProfilePhoto",{file:e}).then((e=>{const t=e.photo;if(!e.users.length){const a=t.sizes.find((e=>"photoStrippedSize"===e._));e.users.push(Object.assign(Object.assign({},this.appUsersManager.getSelf()),{photo:{_:"userProfilePhoto",dc_id:t.dc_id,photo_id:t.id,stripped_thumb:null==a?void 0:a.bytes,pFlags:{}}}))}this.appUsersManager.saveApiUsers(e.users);const a=this.appPeersManager.peerId;this.appPhotosManager.savePhoto(e.photo,{type:"profilePhoto",peerId:a});const s=a.toUserId();this.apiUpdatesManager.processLocalUpdate({_:"updateUser",user_id:s})}))}deletePhotos(e){return this.apiManager.invokeApiSingle("photos.deletePhotos",{id:e.map((e=>kt(this.appPhotosManager.getPhoto(e))))}).then((e=>{}))}verifyParticipantForOnlineCount(e){const t=this.appUsersManager.getUser(e.user_id);return!(!t||!t.status||"userStatusOnline"!==t.status._)}reduceParticipantsForOnlineCount(e){return e.reduce(((e,t)=>e+ +this.verifyParticipantForOnlineCount(t)),0)}getOnlines(e){var t;return ga(this,void 0,void 0,(function*(){if(this.appChatsManager.isBroadcast(e))return 1;const a=yield this.getChatFull(e);if(this.appChatsManager.isMegagroup(e)){if(a.participants_count<=100){const t=yield this.getChannelParticipants(e,{_:"channelParticipantsRecent"},100);return this.reduceParticipantsForOnlineCount(t.participants)}const s=yield this.apiManager.invokeApiCacheable("messages.getOnlines",{peer:this.appChatsManager.getChannelInputPeer(e)},{cacheSeconds:60});return null!==(t=s.onlines)&&void 0!==t?t:1}const s=a.participants;return(null==s?void 0:s.participants)?this.reduceParticipantsForOnlineCount(s.participants):1}))}getTypingsKey(e,t){return e+(t?`_${t}`:"")}getPeerTypings(e,t){return this.typingsInPeer[this.getTypingsKey(e,t)]}canGiftPremium(e){var t;const a=this.appUsersManager.getUser(e);return null===(t=null==a?void 0:a.pFlags)||void 0===t||t.premium,!1}}function ya(e,t){return e.some((e=>e instanceof Promise))?Promise.all(e).then(t):t(e)}var _a=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};const va=["static_icon","appear_animation","select_animation","activate_animation","effect_animation","around_animation","center_icon"],Pa={type:"reactions"};class ba extends G{after(){this.rootScope.addEventListener("language_change",(()=>{this.availableReactions=void 0,this.getAvailableReactions()})),this.sendReactionPromises=new Map,this.lastSendingTimes=new Map,this.rootScope.addEventListener("user_auth",(()=>{setTimeout((()=>{Promise.resolve(this.getAvailableReactions()).then((e=>_a(this,void 0,void 0,(function*(){for(const t of e)yield Promise.all([t.around_animation&&this.apiFileManager.downloadMedia({media:t.around_animation}),t.static_icon&&this.apiFileManager.downloadMedia({media:t.static_icon}),t.appear_animation&&this.apiFileManager.downloadMedia({media:t.appear_animation}),t.center_icon&&this.apiFileManager.downloadMedia({media:t.center_icon})]),yield(0,P.Z)(1e3)}))))}),7500)}))}getAvailableReactions(){return this.availableReactions?this.availableReactions:this.apiManager.invokeApiSingleProcess({method:"messages.getAvailableReactions",processResult:e=>{(0,ue.Z)(e);const t=this.availableReactions=e.reactions;for(const e of t)for(const t of va)e[t]&&(e[t]=this.appDocsManager.saveDoc(e[t],Pa));return t},params:{hash:0}})}getActiveAvailableReactions(){return(0,q.Z)(this.getAvailableReactions(),(e=>e.filter((e=>!e.pFlags.inactive))))}getAvailableReactionsForPeer(e){const t=this.getActiveAvailableReactions();return e.isUser()?this.unshiftQuickReaction(t):ya([t,this.appProfileManager.getChatFull(e.toChatId()),this.getQuickReaction()],(([e,t,a])=>{var s;const n=null!==(s=t.available_reactions)&&void 0!==s?s:{_:"chatReactionsNone"};let i=[];return"chatReactionsAll"===n._?i=e:"chatReactionsSome"===n._&&(i=n.reactions.map((t=>e.find((e=>e.reaction===t.emoticon)))).filter(Boolean)),this.unshiftQuickReactionInner(i,a)}))}unshiftQuickReactionInner(e,t){if(t&&"reactionEmoji"!==t._&&"availableReaction"!==t._)return e;const a=t.emoticon||t.reaction,s=(0,Pe.Z)(e,(e=>e.reaction===a));return s&&e.unshift(s),e}unshiftQuickReaction(e,t=this.getQuickReaction()){return ya([e,t],(([e,t])=>this.unshiftQuickReactionInner(e,t)))}getAvailableReactionsByMessage(e){var t;if(!e)return[];const a=(null===(t=e.fwd_from)||void 0===t?void 0:t.channel_post)&&this.appPeersManager.isMegagroup(e.peerId)&&e.fwdFromId||e.peerId;return this.getAvailableReactionsForPeer(a)}isReactionActive(e){return!!this.availableReactions&&!!this.availableReactions.find((t=>t.reaction===e))}getQuickReaction(){return ya([this.apiManager.getConfig(),this.getAvailableReactions()],(([e,t])=>{const a=e.reactions_default;return"reactionEmoji"===(null==a?void 0:a._)?t.find((e=>e.reaction===a.emoticon)):a}))}getReactionCached(e){return this.availableReactions.find((t=>t.reaction===e))}getReaction(e){return(0,q.Z)(this.getAvailableReactions(),(()=>this.getReactionCached(e)))}getMessagesReactions(e,t){return this.apiManager.invokeApiSingleProcess({method:"messages.getMessagesReactions",params:{id:t.map((e=>(0,oe.Z)(e))),peer:this.appPeersManager.getInputPeerById(e)},processResult:e=>{this.apiUpdatesManager.processUpdateMessage(e)}})}getMessageReactionsList(e,t,a,s,n){return this.apiManager.invokeApiSingleProcess({method:"messages.getMessageReactionsList",params:{peer:this.appPeersManager.getInputPeerById(e),id:(0,oe.Z)(t),limit:a,reaction:s,offset:n},processResult:e=>(this.appUsersManager.saveApiUsers(e.users),e)})}setDefaultReaction(e){return this.apiManager.invokeApi("messages.setDefaultReaction",{reaction:e}).then((t=>_a(this,void 0,void 0,(function*(){if(t){const t=yield this.apiManager.getConfig();t&&(t.reactions_default=e),this.rootScope.dispatchEvent("quick_reaction",e)}return t}))))}sendReaction(e,t,a){var s,n;return _a(this,void 0,void 0,(function*(){"availableReaction"===t._&&(t={_:"reactionEmoji",emoticon:t.reaction});const i=yield this.apiManager.getLimit("reactions"),r=e.peerId+"_"+e.mid;if(this.lastSendingTimes.get(r))return;this.lastSendingTimes.set(r,Date.now()),setTimeout((()=>{this.lastSendingTimes.delete(r)}),333);const{peerId:o,mid:p}=e,d=this.appPeersManager.peerId,f=e=>{--e.count,delete e.chosen_order,(0,Jt.Z)(t,e.reaction)&&(t=void 0),e.count||(0,M.Z)(l.results,e),l.recent_reactions&&(0,Pe.Z)(l.recent_reactions,(t=>(0,Jt.Z)(t.reaction,e.reaction)&&this.appPeersManager.getPeerId(t.peer_id)===d)),l.results.length||(l=void 0)},c=(null===(n=null===(s=e.reactions)||void 0===s?void 0:s.pFlags)||void 0===n?void 0:n.can_see_list)||!this.appPeersManager.isBroadcast(e.peerId)||e.peerId.isUser();e.reactions||(e.reactions={_:"messageReactions",results:[],recent_reactions:c?[]:void 0,pFlags:{can_see_list:c||void 0}});let l=a?e.reactions:(0,ve.Z)(e.reactions);const m=l.results.filter((e=>void 0!==e.chosen_order));m.sort(((e,t)=>t.chosen_order-e.chosen_order));const g=[],h=m.findIndex((e=>(0,Jt.Z)(e.reaction,t)));-1!==h&&g.push(...m.splice(h,1)),g.push(...m.splice(i-+(-1===h))),g.forEach((e=>{m.forEach((t=>{t.chosen_order>e.chosen_order&&--t.chosen_order})),f(e)}));const u=m.length;if(m.forEach(((e,t)=>{e.chosen_order=u-1-t})),t){l||(l={_:"messageReactions",results:[],pFlags:{}},c&&(l.pFlags.can_see_list=!0));let e=l.results.findIndex((e=>(0,Jt.Z)(e.reaction,t))),a=-1!==e&&l.results[e];if(a||(a={_:"reactionCount",count:0,reaction:t},e=l.results.push(a)-1),++a.count,a.chosen_order=m.length?m[0].chosen_order+1:0,m.unshift(a),!l.recent_reactions&&c&&(l.recent_reactions=[]),l.recent_reactions){const e={_:"messagePeerReaction",reaction:t,peer_id:this.appPeersManager.getOutputPeer(d),pFlags:{}};this.appPeersManager.isMegagroup(o),l.recent_reactions.unshift(e),l.recent_reactions=l.recent_reactions.slice(0,3)}}const y=this.availableReactions;if(l&&(null==y?void 0:y.length)){const e=new Map;y.forEach(((t,a)=>{e.set(t.reaction,a)})),l.results.sort(((t,a)=>{var s,n;const i=t.reaction.document_id||t.reaction.emoticon,r=a.reaction.document_id||a.reaction.emoticon;return a.count-t.count||(null!==(s=e.get(i))&&void 0!==s?s:0)-(null!==(n=e.get(r))&&void 0!==n?n:0)}))}if(a)return e.reactions=l,this.rootScope.dispatchEvent("messages_reactions",[{message:e,changedResults:[]}]),Promise.resolve();this.apiUpdatesManager.processLocalUpdate({_:"updateMessageReactions",peer:e.peer_id,msg_id:e.id,reactions:l,local:!0});const _=[o,p].join("-"),v=(0,oe.Z)(p),P=this.apiManager.invokeApi("messages.sendReaction",{peer:this.appPeersManager.getInputPeerById(o),msg_id:v,reaction:m.map((e=>e.reaction))}).then((e=>{(0,ue.Z)(e);const t=e.updates.findIndex((e=>"updateEditMessage"===e._||"updateEditChannelMessage"===e._));if(-1!==t){const a=e.updates[t];e.updates[t]={_:"updateMessageReactions",msg_id:v,peer:this.appPeersManager.getOutputPeer(o),reactions:a.message.reactions,pts:a.pts,pts_count:a.pts_count}}this.apiUpdatesManager.processUpdateMessage(e)})).catch((t=>{var a;"REACTION_INVALID"===t.type&&this.sendReactionPromises.get(_)===P&&this.sendReaction(e,null===(a=m[0])||void 0===a?void 0:a.reaction,!0)})).finally((()=>{this.sendReactionPromises.get(_)===P&&this.sendReactionPromises.delete(_)}));return this.sendReactionPromises.set(_,P),P}))}}var Ma=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};const Sa={EMOJI:"inputStickerSetAnimatedEmoji",EMOJI_ANIMATIONS:"inputStickerSetAnimatedEmojiAnimations",PREMIUM_GIFTS:"inputStickerSetPremiumGifts",GENERIC_ANIMATIONS:"inputStickerSetEmojiGenericAnimations",DEFAULT_STATUSES:"inputStickerSetEmojiDefaultStatuses",DEFAULT_TOPIC_ICONS:"inputStickerSetEmojiDefaultTopicIcons"},Ia=new Set(Object.values(Sa));class Ca extends G{constructor(){super(...arguments),this.storage=new W.Z(H.Z,"stickerSets"),this.clear=e=>{this.getStickerSetPromises={},this.getStickersByEmoticonsPromises={},this.sounds={},this.names={}},this.processAllStickersResult=e=>((0,ue.Z)(e),(0,ne.Z)(e.sets,((e,t,a)=>{e.pFlags.videos&&!i().IS_WEBM_SUPPORTED&&a.splice(t,1)})),e)}after(){this.clear(!0),this.rootScope.addEventListener("user_auth",(()=>{var e;setTimeout((()=>{this.getAnimatedEmojiStickerSet()}),1e3),this.getGreetingStickersPromise||null!==(e=this.getGreetingStickersTimeout)&&void 0!==e||(this.getGreetingStickersTimeout=T.Z.setTimeout((()=>{this.getGreetingStickersTimeout=void 0,this.getGreetingSticker(!0)}),5e3))})),this.rootScope.addEventListener("app_config",(()=>this.onStickersUpdated("faved",!0))),this.apiUpdatesManager.addMultipleEventsListeners({updateNewStickerSet:e=>{const t=e.stickerset;this.saveStickerSet(t,t.set.id),this.rootScope.dispatchEvent("stickers_installed",t.set)},updateRecentStickers:()=>this.onStickersUpdated("recent",!0),updateFavedStickers:()=>this.onStickersUpdated("faved",!0),updateMoveStickerSetToTop:e=>{this.rootScope.dispatchEvent("stickers_top",e.stickerset)},updateStickerSetsOrder:e=>{this.rootScope.dispatchEvent("stickers_order",{type:e.pFlags.emojis?"emojis":e.pFlags.masks?"masks":"stickers",order:e.order})}})}onStickersUpdated(e,t){return Ma(this,void 0,void 0,(function*(){const a=yield"faved"===e?this.getFavedStickersStickers(t):this.getRecentStickersStickers(t);this.rootScope.dispatchEvent("stickers_updated",{type:e,stickers:a})}))}getGreetingSticker(e=!1){return this.getGreetingStickersTimeout&&(clearTimeout(this.getGreetingStickersTimeout),this.getGreetingStickersTimeout=void 0),this.getGreetingStickersPromise||(this.getGreetingStickersPromise=this.getStickersByEmoticon("👋⭐️",!1).then((e=>{if(!e.length)throw"NO_STICKERS";this.greetingStickers=e.slice(),this.greetingStickers.sort(((e,t)=>Math.random()-Math.random()))}))),this.getGreetingStickersPromise.then((()=>{let t;return e||(t=this.greetingStickers.shift(),this.greetingStickers.push(t)),this.apiFileManager.downloadMedia({media:this.greetingStickers[0]}),t}))}saveStickers(e){(0,ne.Z)(e,((t,a)=>{(t=this.appDocsManager.saveDoc(t))?e[a]=t:e.splice(a,1)}))}canUseStickerSetCache(e,t){var a;return e&&(null===(a=e.documents)||void 0===a?void 0:a.length)&&(Date.now()-e.refreshTime<36e5||t)}getStickerSet(e,t={}){let{id:a}=e;if(e.access_hash||(e=this.names[a]||e,a=e.id),this.getStickerSetPromises[a])return this.getStickerSetPromises[a];if(!t.overwrite){const e=this.storage.getFromCache(a);if(this.canUseStickerSetCache(e,t.useCache))return e}const s=this.getStickerSetPromises[a]=new Promise((n=>Ma(this,void 0,void 0,(function*(){if(!t.overwrite){const e=yield this.storage.get(a);if(this.canUseStickerSetCache(e,t.useCache))return this.saveStickers(e.documents),n(e),void(this.getStickerSetPromises[a]===s&&delete this.getStickerSetPromises[a])}try{const s=yield this.apiManager.invokeApi("messages.getStickerSet",{stickerset:this.getStickerSetInput(e),hash:0}),i=t.saveById?a:s.set.id;this.saveStickerSet(s,i),n(s)}catch(e){n(null)}this.getStickerSetPromises[a]===s&&delete this.getStickerSetPromises[a]}))));return s}getLocalStickerSet(e){return this.getStickerSet({id:e},{saveById:!0})}getAnimatedEmojiStickerSet(){return Promise.all([this.getLocalStickerSet(Sa.EMOJI),this.getLocalStickerSet(Sa.EMOJI_ANIMATIONS),this.getAnimatedEmojiSounds()]).then((([e,t])=>({emoji:e,animations:t})))}getAnimatedEmojiSounds(e){if(this.getAnimatedEmojiSoundsPromise&&!e)return this.getAnimatedEmojiSoundsPromise;const t=this.getAnimatedEmojiSoundsPromise=Promise.all([this.apiManager.getAppConfig(e),this.apiManager.getConfig()]).then((([e,a])=>{if(this.getAnimatedEmojiSoundsPromise===t)for(const t in e.emojies_sounds){const s=e.emojies_sounds[t],n=atob(s.file_reference_base64.replace(/-/g,"+").replace(/_/g,"/")),i=new Uint8Array(n.length);for(let e=0,t=i.length;e((0,ue.Z)(e),this.recentStickers=e.stickers,this.saveStickers(e.stickers),e),overwrite:e})}))}getRecentStickersStickers(e){if(e)this.recentStickers=void 0;else if(this.recentStickers)return this.recentStickers;return this.getRecentStickers(e).then((()=>this.recentStickers))}saveRecentSticker(e,t,a){const s=this.appDocsManager.getDoc(e);if((0,Pe.Z)(this.recentStickers,(t=>t.id===e)),!t){this.recentStickers.unshift(s);const e=(0,bt.Z)(s.stickerEmojiRaw);for(const t in this.getStickersByEmoticonsPromises)this.getStickersByEmoticonsPromises[t].then((a=>{const n=(0,Pe.Z)(a,(e=>e.id===s.id));n?a.unshift(n):t.includes(e)&&a.unshift(s)}))}return this.rootScope.dispatchEvent("sticker_updated",{type:"recent",faved:!t,document:s}),t&&this.onStickersUpdated("recent",!1),this.apiManager.invokeApi("messages.saveRecentSticker",{id:Kt(s),unsave:t,attached:a})}cleanEmoji(e){return e.replace(/\ufe0f/g,"").replace(/🏻|🏼|🏽|🏾|🏿/g,"")}getAnimatedEmojiSticker(e,t){const a=t?Sa.EMOJI_ANIMATIONS:Sa.EMOJI,s=this.storage.getFromCache(a);if(!(null==s?void 0:s.documents))return;t&&["🧡","💛","💚","💙","💜","🖤","🤍","🤎"].includes(e)&&(e="❤️"),e=this.cleanEmoji(e);const n=s.packs.find((t=>t.emoticon===e));return n?this.appDocsManager.getDoc(n.documents[0]):void 0}getAnimatedEmojiSoundDocument(e){return this.sounds[this.cleanEmoji(e)]}preloadAnimatedEmojiSticker(e){const t=this.getAnimatedEmojiStickerSet().then((()=>this.getAnimatedEmojiSticker(e)));return Promise.all([t,this.preloadAnimatedEmojiStickerAnimation(e)]).then((([e,t])=>({doc:e,animation:null==t?void 0:t.doc,sound:null==t?void 0:t.sound})))}preloadAnimatedEmojiStickerAnimation(e){return this.getAnimatedEmojiStickerSet().then((()=>this.getAnimatedEmojiSticker(e,!0))).then((t=>{if(!t)return;const a=this.getAnimatedEmojiSoundDocument(e);return Promise.all([this.preloadSticker(t.id),a?this.preloadSticker(a.id):void 0]).then((()=>({doc:t,sound:a})))}))}preloadSticker(e,t){var a;const s=this.appDocsManager.getDoc(e);return this.apiFileManager.downloadMedia({media:s,thumb:t?null===(a=s.video_thumbs)||void 0===a?void 0:a[0]:void 0})}saveStickerSet(e,t){const a={_:"messages.stickerSet",set:e.set,packs:e.packs,documents:e.documents,keywords:e.keywords};let s=this.storage.getFromCache(t);s?Object.assign(s,a):s=this.storage.setToCache(t,a),s.set.short_name&&(this.names[s.set.short_name]=this.getStickerSetInput(a.set)),this.saveStickers(e.documents);const n=s.set.installed_date||Ia.has(t);s.refreshTime=Date.now(),this.storage.set({[t]:s},!n)}getStickerSetThumbDownloadOptions(e){var t;const a=e.thumbs.find((e=>"photoSize"===e._)),s=e.thumb_dc_id,n=null===(t=e.pFlags)||void 0===t?void 0:t.animated;return{dcId:s,location:{_:"inputStickerSetThumb",stickerset:this.getStickerSetInput(e),thumb_version:e.thumb_version},size:a.size,mimeType:n?"application/x-tgsticker":"image/webp"}}getStickerSetInput(e){return Ia.has(e.id)?{_:e.id}:e.access_hash?{_:"inputStickerSetID",id:e.id,access_hash:e.access_hash}:{_:"inputStickerSetShortName",short_name:""+e.id}}getFeaturedStickers(){return Ma(this,void 0,void 0,(function*(){return(yield this.apiManager.invokeApiHashable({method:"messages.getFeaturedStickers",processResult:e=>((0,ue.Z)(e),(0,ne.Z)(e.sets,((e,t,a)=>{e.set.pFlags.videos&&!i().IS_WEBM_SUPPORTED&&a.splice(t,1)})),e.sets.forEach((e=>{this.saveStickerSet({set:e.set,documents:[],packs:[],keywords:[]},e.set.id)})),e)})).sets}))}getPromoPremiumStickers(){return this.getStickersByEmoticon("⭐️⭐️",!1)}getPremiumStickers(){return this.getStickersByEmoticon("📂⭐️",!1)}getFavedStickers(e){return this.apiManager.invokeApiHashable({method:"messages.getFavedStickers",processResult:e=>((0,ue.Z)(e),this.saveStickers(e.stickers),this.favedStickers=e.stickers,e),overwrite:e})}getFavedStickersStickers(e){if(e)this.favedStickers=void 0;else if(this.favedStickers)return this.favedStickers;return this.getFavedStickers(e).then((()=>this.favedStickers))}getFavedStickersLimit(){return this.apiManager.getLimit("favedStickers")}faveSticker(e,t){return Ma(this,void 0,void 0,(function*(){this.favedStickers||(yield this.getFavedStickersStickers());const a=yield this.getFavedStickersLimit(),s=this.appDocsManager.getDoc(e);return(0,Pe.Z)(this.favedStickers,(e=>e.id===s.id)),t||(this.favedStickers.unshift(s),this.favedStickers.splice(a,this.favedStickers.length-a)),this.rootScope.dispatchEvent("sticker_updated",{type:"faved",faved:!t,document:s}),this.apiManager.invokeApi("messages.faveSticker",{id:Kt(s),unfave:t}).then((()=>{t&&this.onStickersUpdated("faved",!0)}))}))}toggleStickerSet(e){return Ma(this,void 0,void 0,(function*(){if((e=this.storage.getFromCache(e.id).set).installed_date){if(yield this.apiManager.invokeApi("messages.uninstallStickerSet",{stickerset:this.getStickerSetInput(e)}))return delete e.installed_date,this.rootScope.dispatchEvent("stickers_deleted",e),this.storage.delete(e.id,!0),!0}else if(yield this.apiManager.invokeApi("messages.installStickerSet",{stickerset:this.getStickerSetInput(e),archived:!1}))return e.installed_date=(0,te.Z)(!0),this.rootScope.dispatchEvent("stickers_installed",e),!0;return!1}))}toggleStickerSets(e){return Promise.all(e.map((e=>this.toggleStickerSet(e))))}searchStickerSets(e,t=!0){return Ma(this,void 0,void 0,(function*(){const a=t?1:0,s=yield this.apiManager.invokeApiHashable({method:"messages.searchStickerSets",params:{flags:a,exclude_featured:t||void 0,q:e},processResult:e=>((0,ue.Z)(e),(0,ne.Z)(e.sets,((e,t,a)=>{e.set.pFlags.videos&&!i().IS_WEBM_SUPPORTED&&a.splice(t,1)})),e.sets.forEach((e=>{this.saveStickerSet({set:e.set,documents:[],packs:[],keywords:[]},e.set.id)})),e)}),n=[],r=this.storage.getCache();for(const t in r){const{set:a}=r[t];a.title.toLowerCase().includes(e.toLowerCase())&&!s.sets.find((e=>e.set.id===a.id))&&n.push({_:"stickerSetCovered",set:a,cover:null})}return s.sets.concat(n)}))}getAllStickers(){return this.apiManager.invokeApiHashable({method:"messages.getAllStickers",processResult:this.processAllStickersResult})}getEmojiStickers(){return this.apiManager.invokeApiHashable({method:"messages.getEmojiStickers",processResult:this.processAllStickersResult})}preloadStickerSets(){return this.getAllStickers().then((e=>{const t=e.sets;return Promise.all(t.map((e=>this.getStickerSet(e,{useCache:!0}))))}))}getStickersByEmoticon(e,t=!0,a=!0){const s=(e=(0,bt.Z)(e))+(t?"1":"0")+(a?"1":"0");return this.getStickersByEmoticonsPromises[s]?this.getStickersByEmoticonsPromises[s]:this.getStickersByEmoticonsPromises[s]=Promise.all([a?this.apiManager.invokeApiHashable({method:"messages.getStickers",params:{emoticon:e},processResult:e=>e}):void 0,t?this.preloadStickerSets():[],t?this.getRecentStickers():void 0]).then((([t,a,s])=>{const n=t?t.stickers.map((e=>this.appDocsManager.saveDoc(e))):[],r=[],o=[],p=t=>{for(const a of t)if((0,bt.Z)(a.emoticon).includes(e))for(const e of a.documents){const t=this.appDocsManager.getDoc(e);(t.animated?r:o).push(t)}};if(s){p(s.packs);const e=s.stickers;[r,o].forEach((t=>{t.sort(((t,a)=>e.indexOf(t)-e.indexOf(a)))}))}for(const e of a)p(e.packs);const d=[...new Set(r.concat(o,n))];return(0,ne.Z)(d,((e,t,a)=>{(3===e.sticker&&!i().IS_WEBM_SUPPORTED||!this.rootScope.premium&&(0,zt.Z)(e))&&a.splice(t,1)})),d}))}clearRecentStickers(){return this.recentStickers&&(this.recentStickers.length=0,this.onStickersUpdated("recent",!1)),this.apiManager.invokeApi("messages.clearRecentStickers")}reorderStickerSets(e,t,a){return this.apiManager.invokeApi("messages.reorderStickerSets",{emojis:t,masks:a,order:e}).then((()=>{this.apiUpdatesManager.processLocalUpdate({_:"updateStickerSetsOrder",order:e,pFlags:{emojis:t||void 0,masks:a||void 0}})}))}}var ka=a(467),wa=a(8493);class Aa extends G{constructor(){super(...arguments),this.clear=(e=!1)=>{if(e)this.users={},this.usernames={};else for(const e in this.users){if(!e)continue;const t=e.toPeerId();if(!this.peersStorage.isPeerNeeded(t)){const t=this.users[e];this.modifyUsernamesCache(t,!1),this.storage.delete(e),delete this.users[e]}}this.getTopPeersPromises={},this.contactsIndex=this.createSearchIndex(),this.contactsFillPromise=void 0,this.contactsList=new Set,this.updatedContactsList=!1},this.updateUsersStatuses=()=>{const e=(0,te.Z)(!0);for(const t in this.users){const a=this.users[t];this.updateUserStatus(a,e)}}}after(){return this.clear(!0),setInterval(this.updateUsersStatuses,6e4),this.rootScope.addEventListener("state_synchronized",this.updateUsersStatuses),this.apiUpdatesManager.addMultipleEventsListeners({updateUserStatus:e=>{const t=e.user_id,a=this.users[t];a&&(a.status=e.status,a.status&&("expires"in a.status&&(a.status.expires-=this.timeManager.getServerTimeOffset()),"was_online"in a.status&&(a.status.was_online-=this.timeManager.getServerTimeOffset())),this.rootScope.dispatchEvent("user_update",t),this.setUserToStateIfNeeded(a))},updateUserName:e=>{const t=e.user_id,a=this.users[t];a&&(this.forceUserOnline(t),this.saveApiUser(Object.assign(Object.assign({},a),{first_name:e.first_name,last_name:e.last_name,username:void 0,usernames:e.usernames}),!0))}}),this.rootScope.addEventListener("language_change",(e=>{const t=this.getSelf().id;this.contactsIndex.indexObject(t,this.getUserSearchText(t))})),Promise.all([this.appStateManager.getState(),this.appStoragesManager.loadStorage("users")]).then((([e,{results:t,storage:a}])=>{this.storage=a,this.saveApiUsers(t);for(let a=0,s=t.length;a{if(!this.appPeersManager.isUser(e))return;const t=e.toUserId();this.storage.getFromCache(t)||this.storage.set({[t]:this.getUser(t)})})),this.peersStorage.addEventListener("peerUnneeded",(e=>{if(!this.appPeersManager.isUser(e))return;const t=e.toUserId();this.storage.getFromCache(t)&&this.storage.delete(t)}))}))}get userId(){return this.rootScope.myId.toUserId()}onContactsModified(e){e&&this.appStateManager.pushToState("contactsListCachedTime",(0,te.Z)(!0))}pushRecentSearch(e){return this.appStateManager.getState().then((t=>{const a=t.recentSearch||[];if(a[0]!==e){(0,M.Z)(a,e),a.unshift(e),a.length>20&&(a.length=20),this.appStateManager.pushToState("recentSearch",a);for(const e of a)this.peersStorage.requestPeer(e,"recentSearch")}}))}clearRecentSearch(){return this.appStateManager.getState().then((e=>{const t=e.recentSearch||[];for(const e of t)this.peersStorage.releasePeer(e,"recentSearch");t.length=0,this.appStateManager.pushToState("recentSearch",t)}))}fillContacts(){var e;if(this.contactsFillPromise&&this.updatedContactsList)return{cached:this.contactsFillPromise.isFulfilled,promise:this.contactsFillPromise};this.updatedContactsList=!0;const t=(0,v.Z)();return this.apiManager.invokeApi("contacts.getContacts").then((e=>{"contacts.contacts"===e._&&(this.contactsList.clear(),this.saveApiUsers(e.users),e.contacts.forEach((e=>{this.pushContact(e.user_id)})),this.onContactsModified(!0),this.contactsFillPromise=t),t.resolve(this.contactsList)}),(()=>{this.updatedContactsList=!1})),{cached:null===(e=this.contactsFillPromise)||void 0===e?void 0:e.isFulfilled,promise:this.contactsFillPromise||(this.contactsFillPromise=t)}}resolveUsername(e){"@"===e[0]&&(e=e.slice(1)),e=e.toLowerCase();const t=this.usernames[e];return t?this.appPeersManager.getPeer(t):this.apiManager.invokeApiSingleProcess({method:"contacts.resolveUsername",params:{username:e},processResult:e=>this.processResolvedPeer(e)})}processResolvedPeer(e){return this.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats),this.appPeersManager.getPeer((0,le.Z)(e.peer))}resolvePhone(e){return this.apiManager.invokeApi("contacts.resolvePhone",{phone:e}).then((e=>this.processResolvedPeer(e)))}pushContact(e){this.contactsList.add(e),this.contactsIndex.indexObject(e,this.getUserSearchText(e)),this.peersStorage.requestPeer(e.toPeerId(),"contact")}popContact(e){this.contactsList.delete(e),this.contactsIndex.indexObject(e,""),this.peersStorage.releasePeer(e.toPeerId(),"contact")}getUserSearchText(e){const t=this.users[e];return t?[t.first_name,t.last_name,t.phone,...(0,$t.Z)(t),t.pFlags.self?"Saved Messages":""].filter(Boolean).join(" "):""}getContacts(e,t=!1,a="name"){return this.fillContacts().promise.then((s=>{let n=[...s];if(e){const t=this.contactsIndex.search(e);n=[...n].filter((e=>t.has(e)))}"name"===a?n.sort(((e,t)=>{const a=(this.users[e]||{}).sortName||"",s=(this.users[t]||{}).sortName||"";return a.localeCompare(s)})):"online"===a&&n.sort(((e,t)=>{const a=this.getUserStatusForSort(this.getUser(e).status);return this.getUserStatusForSort(this.getUser(t).status)-a}));const i=this.userId;return(0,M.Z)(n,i),t&&this.testSelfSearch(e)&&n.unshift(i),n}))}getContactsPeerIds(e,t,a,s){return this.getContacts(e,t,a).then((e=>{const t=e.map((e=>e.toPeerId(!1)));return s?t.slice(0,s):t}))}toggleBlock(e,t){return this.apiManager.invokeApiSingle(t?"contacts.block":"contacts.unblock",{id:this.appPeersManager.getInputPeerById(e)}).then((a=>(a&&this.apiUpdatesManager.processLocalUpdate({_:"updatePeerBlocked",peer_id:this.appPeersManager.getOutputPeer(e),blocked:t}),a)))}testSelfSearch(e){const t=this.getSelf(),a=this.createSearchIndex();return a.indexObject(t.id,this.getUserSearchText(t.id)),a.search(e).has(t.id)}createSearchIndex(){return new ae.Z({clearBadChars:!0,ignoreCase:!0,latinize:!0,includeTag:!0})}saveApiUsers(e,t){e.saved||(e.saved=!0,e.forEach((e=>this.saveApiUser(e,t))))}modifyUsernamesCache(e,t){const a=(0,$t.Z)(e);if(!a.length)return;const s=a.map((e=>function(e){return e&&e.toLowerCase()||""}(e)));t?s.forEach((t=>{this.usernames[t]=e.id.toPeerId("user"!==e._)})):s.forEach((e=>{delete this.usernames[e]}))}setUsernameToCache(e,t){return!(t&&t.username===e.username&&(0,Y.Z)(t.usernames,e.usernames)||(this.modifyUsernamesCache(t,!1),this.modifyUsernamesCache(e,!0),0))}saveApiUser(e,t){var a,s,n,i;if(!e||"userEmpty"===e._)return;const r=e.id,o=this.users[r];if(null!==(a=e.pFlags)&&void 0!==a||(e.pFlags={}),e.pFlags.min&&void 0!==o)return;const p=this.setUsernameToCache(e,o);if(o&&void 0!==o.sortName&&o.first_name===e.first_name&&o.last_name===e.last_name)e.sortName=o.sortName;else{const t=e.first_name+(e.last_name?" "+e.last_name:"");e.sortName=e.pFlags.deleted?"":(0,ka.ZP)(t,!1)}if(e.status&&(e.status.expires&&(e.status.expires-=this.timeManager.getServerTimeOffset()),e.status.was_online&&(e.status.was_online-=this.timeManager.getServerTimeOffset())),"userProfilePhotoEmpty"===(null===(s=e.photo)||void 0===s?void 0:s._)&&delete e.photo,void 0===o)this.users[r]=e;else{const t=e.first_name!==o.first_name||e.last_name!==o.last_name||p,a=(null===(n=o.photo)||void 0===n?void 0:n.photo_id)!==(null===(i=e.photo)||void 0===i?void 0:i.photo_id),s=o.pFlags.premium!==e.pFlags.premium||o.pFlags.verified!==e.pFlags.verified||o.pFlags.scam!==e.pFlags.scam||o.pFlags.fake!==e.pFlags.fake,d=!!o.pFlags.contact,f=!!e.pFlags.contact;re(o,e),this.rootScope.dispatchEvent("user_update",r),d!==f&&this.onContactUpdated(r,f,d),a&&this.rootScope.dispatchEvent("avatar_update",{peerId:e.id.toPeerId()}),(t||s)&&this.rootScope.dispatchEvent("peer_title_edit",{peerId:e.id.toPeerId()})}this.checkPremium(e,o),this.setUserToStateIfNeeded(e)}checkPremium(e,t){if(e.pFlags.self){const a=!!e.pFlags.premium;this.rootScope.premium!==a&&this.rootScope.dispatchEvent("premium_toggle_private",{isNew:!t,isPremium:a})}}setUserToStateIfNeeded(e){this.peersStorage.isPeerNeeded(e.id.toPeerId())&&this.storage.set({[e.id]:e})}isUserOnlineVisible(e){return this.getUserStatusForSort(e)>3}getUserStatusForSort(e){if("object"!=typeof e){const t=this.getUser(e);e=null==t?void 0:t.status}if(e){const t="userStatusOnline"===e._?e.expires:"userStatusOffline"===e._?e.was_online:0;if(t)return t;switch(e._){case"userStatusRecently":return 3;case"userStatusLastWeek":return 2;case"userStatusLastMonth":return 1}}return 0}getUser(e){return(0,fe.Z)(e)?e:this.users[e]}getUserStatus(e){return this.isRegularUser(e)&&!this.users[e].pFlags.self&&this.users[e].status}getUserPhone(e){return t=this,a=void 0,n=function*(){const t=this.getUser(e);if(!(null==t?void 0:t.phone))return;const a=yield this.apiManager.getAppConfig();return{phone:t.phone,isAnonymous:a.fragment_prefixes.some((e=>t.phone.startsWith(e)))}},new((s=void 0)||(s=Promise))((function(e,i){function r(e){try{p(n.next(e))}catch(e){i(e)}}function o(e){try{p(n.throw(e))}catch(e){i(e)}}function p(t){var a;t.done?e(t.value):(a=t.value,a instanceof s?a:new s((function(e){e(a)}))).then(r,o)}p((n=n.apply(t,a||[])).next())}));var t,a,s,n}getSelf(){return this.getUser(this.userId)}isBot(e){return this.users[e]&&!!this.users[e].pFlags.bot}isAttachMenuBot(e){return this.isBot(e)&&!!this.users[e].pFlags.bot_attach_menu}isContact(e){return this.contactsList.has(e)||!(!this.users[e]||!this.users[e].pFlags.contact)}isRegularUser(e){const t=this.users[e];return t&&!this.isBot(e)&&!t.pFlags.deleted&&!t.pFlags.support}isNonContactUser(e){return this.isRegularUser(e)&&!this.isContact(e)&&e!==this.userId}hasUser(e,t){const a=this.users[e];return(0,fe.Z)(a)&&(t||!a.pFlags.min)}getUserString(e){const t=this.getUser(e);return"u"+e+(t.access_hash?"_"+t.access_hash:"")}getUserInput(e){const t=this.getUser(e);return t.pFlags&&t.pFlags.self?{_:"inputUserSelf"}:{_:"inputUser",user_id:e,access_hash:t.access_hash}}getUserInputPeer(e){return{_:"inputPeerUser",user_id:e,access_hash:this.getUser(e).access_hash}}getContactMediaInput(e){const t=this.getUser(e);return{_:"inputMediaContact",first_name:t.first_name,last_name:t.last_name,phone_number:t.phone,vcard:"",user_id:e}}updateUserStatus(e,t=(0,te.Z)(!0)){e.status&&"userStatusOnline"===e.status._&&e.status.expires=60)return}else if(this.apiUpdatesManager.updatesState.syncLoading)return;const s=this.getUser(e);!(null==s?void 0:s.status)||"userStatusOnline"===s.status._||"userStatusEmpty"===s.status._||s.pFlags.support||s.pFlags.deleted||(s.status={_:"userStatusOnline",expires:a+60},this.rootScope.dispatchEvent("user_update",e),this.setUserToStateIfNeeded(s))}importContact(e,t,a){return this.importContacts([{first_name:e,last_name:t,phones:[a]}]).then((e=>{if(!e.length){const e=new Error;throw e.type="NO_USER",e}return e[0]}))}importContacts(e){const t=[];for(let a=0;a(this.saveApiUsers(e.users),e.imported.map((e=>(this.onContactUpdated(e.user_id,!0),e.user_id))))))}getTopPeers(e){return this.getTopPeersPromises[e]?this.getTopPeersPromises[e]:this.getTopPeersPromises[e]=this.appStateManager.getState().then((t=>{const a=t.topPeersCache[e];return a&&a.cachedTime+864e5>Date.now()&&a.peers?a.peers:this.apiManager.invokeApi("contacts.getTopPeers",{[e]:!0,offset:0,limit:15,hash:"0"}).then((a=>{let s=[];return"contacts.topPeers"===a._&&(this.saveApiUsers(a.users),this.appChatsManager.saveApiChats(a.chats),a.categories.length&&(s=a.categories[0].peers.map((e=>{const t=(0,le.Z)(e.peer);return this.peersStorage.requestPeer(t,"topPeer"),{id:t,rating:e.rating}})))),t.topPeersCache[e]={peers:s,cachedTime:Date.now()},this.appStateManager.pushToState("topPeersCache",t.topPeersCache),s}))}))}getBlocked(e=0,t=0){return this.apiManager.invokeApiSingle("contacts.getBlocked",{offset:e,limit:t}).then((e=>(this.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats),{count:"contacts.blocked"===e._?e.users.length+e.chats.length:e.count,peerIds:e.users.map((e=>e.id.toPeerId())).concat(e.chats.map((e=>e.id.toPeerId(!0))))})))}getLocated(e,t,a,s=!1,n=0){const i={_:"inputGeoPoint",lat:e,long:t,accuracy_radius:a};return this.apiManager.invokeApi("contacts.getLocated",{geo_point:i,background:s}).then((e=>(this.apiUpdatesManager.processUpdateMessage(e),e)))}searchContacts(e,t=20){const a=(0,Nt.Z)(e);if(a.length&&a[0].length===e.trim().length&&"messageEntityUrl"===a[0]._)try{const t=new URL(qe(e).url).pathname.slice(1);t&&(e=t)}catch(e){}return this.apiManager.invokeApiCacheable("contacts.search",{q:e,limit:t},{cacheSeconds:60}).then((e=>(this.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats),{my_results:(0,ke.Z)(e.my_results.map((e=>(0,le.Z)(e)))),results:e.results.map((e=>(0,le.Z)(e)))})))}onContactUpdated(e,t,a=this.isContact(e)){t!==a&&(t?this.pushContact(e):this.popContact(e),this.onContactsModified(),this.rootScope.dispatchEvent("contacts_update",e))}updateUsername(e){return this.apiManager.invokeApi("account.updateUsername",{username:e}).then((e=>{this.saveApiUser(e)}))}setUserStatus(e,t){if(this.isBot(e))return;const a=this.users[e];if(a){const s=t?{_:"userStatusOffline",was_online:(0,te.Z)(!0)}:{_:"userStatusOnline",expires:(0,te.Z)(!0)+50};a.status=s,this.rootScope.dispatchEvent("user_update",e),this.setUserToStateIfNeeded(a)}}updateMyOnlineStatus(e){return this.setUserStatus(this.getSelf().id,e),this.apiManager.invokeApiSingle("account.updateStatus",{offline:e})}addContact(e,t,a,s,n){return this.apiManager.invokeApi("contacts.addContact",{id:this.getUserInput(e),first_name:t,last_name:a,phone:s,add_phone_privacy_exception:n}).then((t=>{this.apiUpdatesManager.processUpdateMessage(t,{override:!0}),this.onContactUpdated(e,!0)}))}deleteContacts(e){return this.apiManager.invokeApi("contacts.deleteContacts",{id:e.map((e=>this.getUserInput(e)))}).then((t=>{this.apiUpdatesManager.processUpdateMessage(t,{override:!0}),e.forEach((e=>{this.onContactUpdated(e,!1)}))}))}checkUsername(e){return this.apiManager.invokeApi("account.checkUsername",{username:e})}toggleUsername(e,t){return this.apiManager.invokeApi("account.toggleUsername",{username:e,active:t})}reorderUsernames(e){return this.apiManager.invokeApi("account.reorderUsernames",{order:e})}canSendToUser(e){return(0,wa.Z)(this.getUser(e))}getCommonChats(e,t=100,a){return this.apiManager.invokeApiSingleProcess({method:"messages.getCommonChats",params:{user_id:this.getUserInput(e),limit:t,max_id:null!=a?a:0},processResult:e=>(this.appChatsManager.saveApiChats(e.chats),e)})}}const Ua=new Set(["photo","video","gif","document"]);class Da extends G{constructor(){super(...arguments),this.webpages={},this.pendingWebPages={}}after(){this.apiUpdatesManager.addMultipleEventsListeners({updateWebPage:e=>{this.saveWebPage(e.webpage)}})}saveWebPage(e,t,a){var s,n;if("webPageNotModified"===e._||"webPageEmpty"===e._)return;const{id:i}=e,r=this.webpages[i],o=r&&r._===e._&&r.hash==r.hash;if("webPage"===e._){"photo"===(null===(s=e.photo)||void 0===s?void 0:s._)?e.photo=this.appPhotosManager.savePhoto(e.photo,a):delete e.photo,"document"===(null===(n=e.document)||void 0===n?void 0:n._)?e.document=this.appDocsManager.saveDoc(e.document,a):("document"===e.type&&delete e.type,delete e.document);const t=e.site_name,i=e.title||e.author||t||"";t&&i===t&&delete e.site_name,Ua.has(e.type)||e.description||!e.photo||(e.type="photo")}let p=this.pendingWebPages[i];if(t&&(p||(p=this.pendingWebPages[i]=new Set),p.add(t)),void 0===r?this.webpages[i]=e:re(r,e),!t&&void 0!==p&&o){const e=[];p.forEach((t=>{const[a,s,n]=t.split("_");e.push({peerId:a.toPeerId(),mid:+s,isScheduled:!!n})})),this.rootScope.dispatchEvent("webpage_updated",{id:i,msgs:e})}return e}getMessageKeyForPendingWebPage(e,t,a){return e+"_"+t+(a?"_s":"")}deleteWebPageFromPending(e,t){const a=e.id;if(!a)return;const s=this.pendingWebPages[a];s&&s.has(t)&&(s.delete(t),s.size||delete this.pendingWebPages[a])}getCachedWebPage(e){return this.webpages[e]}getWebPage(e){return this.apiManager.invokeApiHashable({method:"messages.getWebPage",processResult:e=>this.saveWebPage(e),params:{url:e}})}}var Ea=a(5936),Ta=a(3019);function Fa(e){return(0,Ta.Z)(e,"readAsArrayBuffer")}var Ra=a(1243),xa=a(7086);function Ba(e){return encodeURIComponent(e).replace(/['()]/g,escape).replace(/\*/g,"%2A")}class Va{constructor(e,t){this.serviceMessagePort=e,this.downloadId=t,this.serviceMessagePort=zs()}write(e,t){return a=this,s=void 0,i=function*(){return this.serviceMessagePort.invoke("downloadChunk",{id:this.downloadId,chunk:e})},new((n=void 0)||(n=Promise))((function(e,t){function r(e){try{p(i.next(e))}catch(e){t(e)}}function o(e){try{p(i.throw(e))}catch(e){t(e)}}function p(t){var a;t.done?e(t.value):(a=t.value,a instanceof n?a:new n((function(e){e(a)}))).then(r,o)}p((i=i.apply(a,s||[])).next())}));var a,s,n,i}finalize(e){return this.serviceMessagePort.invoke("downloadFinalize",this.downloadId).then((()=>{}))}}class Oa{getFile(e){return Promise.reject((0,X.Z)("NO_ENTRY_FOUND"))}prepareWriting({fileName:e,downloadId:t,size:a}){const s=Object.assign({"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+Ba(e)},a?{"Content-Length":a}:{}),n=zs(),i=n.invoke("download",{headers:s,id:t}),r=(0,v.Z)();return r.cancel=()=>{r.reject((0,X.Z)("DOWNLOAD_CANCELED"))},r.catch((()=>{zs().invoke("downloadCancel",t)})),i.then(r.resolve,r.reject),{deferred:r,getWriter:()=>new Va(n,t)}}}var La=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};const Na=131072,Za=new Set(["DOWNLOAD_CANCELED","UPLOAD_CANCELED","UNKNOWN","NO_NEW_CONTEXT"]);class ja extends G{constructor(){super(...arguments),this.cacheStorage=new Ea.Z("cachedFiles"),this.downloadStorage=new Oa,this.downloadPromises={},this.uploadPromises={},this.downloadPulls={},this.downloadActives={},this.refreshReferencePromises={},this.log=(0,S.kg)("AFM",S.v9.Error|S.v9.Log),this.tempId=0,this.queueId=0,this.debug=b.Z.debug,this.maxUploadParts=4e3,this.maxDownloadParts=8e3,this.uncompressTGS=(e,t)=>this.cryptoWorker.invokeCrypto("gzipUncompress",e.slice().buffer,!1),this.uncompressTGV=(e,t)=>{const a=e.slice().buffer;return i().IS_FIREFOX?this.cryptoWorker.invokeCrypto("gzipUncompress",a,!0).then((e=>function(e){const t=e.indexOf("/,` width="${n}" height="${i}">`).replace(/[^\x00-\x7F]/g,"")}(e))).then((e=>(new TextEncoder).encode(e))):this.cryptoWorker.invokeCrypto("gzipUncompress",a,!1)},this.convertWebp=(e,t)=>f.Z.getInstance().invoke("convertWebp",{fileName:t,bytes:e}),this.convertOpus=(e,t)=>f.Z.getInstance().invoke("convertOpus",{fileName:t,bytes:e})}after(){setInterval((()=>{for(const e in this.refreshReferencePromises){const{deferred:t}=this.refreshReferencePromises[e];(t.isFulfilled||t.isRejected)&&delete this.refreshReferencePromises[e]}}),18e5),this.rootScope.addEventListener("config",(e=>{this.webFileDcId=e.webfile_dc_id})),this.rootScope.addEventListener("app_config",(e=>{this.maxUploadParts=this.rootScope.premium?e.upload_max_fileparts_premium:e.upload_max_fileparts_default,this.maxDownloadParts=e.upload_max_fileparts_premium}))}downloadRequest(e,t,a,s,n=0){void 0===this.downloadPulls[e]&&(this.downloadPulls[e]=[],this.downloadActives[e]=0);const i=this.downloadPulls[e],r=new Promise(((e,r)=>{i.push({id:t,queueId:n,cb:a,deferred:{resolve:e,reject:r},activeDelta:s})}));return setTimeout((()=>{this.downloadCheck(e)}),0),r}downloadCheck(e){const t=this.downloadPulls[e],a=this.rootScope.premium?224:36;if(this.downloadActives[e]>=a||!(null==t?void 0:t.length))return!1;const s=(0,Pe.Z)(t,(e=>0===e.queueId))||(0,Pe.Z)(t,(e=>e.queueId===this.queueId))||t.shift(),n=s.activeDelta||1;this.downloadActives[e]+=n;const i=s.cb();i.then((()=>{this.downloadActives[e]-=n,this.downloadCheck(e)}),(t=>{(null==t?void 0:t.type)&&Za.has(t.type)||this.log.error("downloadCheck error:",t),this.downloadActives[e]-=n,this.downloadCheck(e)})).finally((()=>{i.then(s.deferred.resolve,s.deferred.reject)}))}setQueueId(e){this.queueId=e}getFileStorage(){return this.cacheStorage}cancelDownload(e){const t=[this.downloadPromises[e],this.uploadPromises[e]].filter(Boolean);let a=!1;for(let e=0,s=t.length;eLa(this,void 0,void 0,(function*(){if(null==r||r(),"url"in t){const e=t.url;if(this.isLocalWebFile(e))return fetch(e).then((e=>e.arrayBuffer())).then((t=>{const a=e.split(".").pop(),s=gt[a]||"application/octet-stream";return{_:"upload.webFile",size:t.byteLength,mime_type:s,file_type:{_:"storage.fileUnknown"},mtime:0,bytes:new Uint8Array(t)}}))}return this.apiManager.invokeApi("upload.getWebFile",{location:t,offset:a,limit:s},{dcId:e,fileDownload:!0})}))),this.getDelta(s),i)}requestFilePart(e,t,a,s,n=0,i=0,r){return this.downloadRequest(e,n,(()=>La(this,void 0,void 0,(function*(){null==r||r();const n=()=>La(this,void 0,void 0,(function*(){var i;null==r||r();const o=null===(i=t.file_reference)||void 0===i?void 0:i.slice();return this.apiManager.invokeApi("upload.getFile",{location:t,offset:a,limit:s},{dcId:e,fileDownload:!0}).catch((e=>{if(null==r||r(),"FILE_REFERENCE_EXPIRED"===e.type)return this.refreshReference(t,o).then(n);throw e}))}));(0,ue.Z)(t);const i=t.file_reference;if(i&&!t.checkedReference){t.checkedReference=!0;const e=E(i);if(this.refreshReferencePromises[e])return this.refreshReference(t,i).then(n)}return n()}))),this.getDelta(s),i)}getDelta(e){return e/Na}getLimitPart(e,t){if(!e)return 524288;let a=Na;const s=t?this.maxUploadParts:this.maxDownloadParts,n=t?524288:1048576;for(;e/a>s&&a{a===E(t)&&e.reject((0,X.Z)("REFERENCE_IS_NOT_REFRESHED")),e.resolve(t)}),e.reject)}return s.deferred.then((t=>{e.file_reference=t}))}isDownloading(e){return!!this.downloadPromises[e]}getDownload(e){return this.downloadPromises[e]}getUpload(e){return this.uploadPromises[e]}getConvertMethod(e){let t;return"application/x-tgwallpattern"===e?(t=this.uncompressTGV,e="image/svg+xml"):"image/webp"!==e||i().IS_WEBP_SUPPORTED?"application/x-tgsticker"===e?(t=this.uncompressTGS,e="application/json"):"audio/ogg"!==e||i().IS_OPUS_SUPPORTED||(t=this.convertOpus,e="audio/wav"):(t=this.convertWebp,e="image/png"),{mimeType:e,process:t}}allocateDeferredPromises(e,t,a){const s=[];let n,i=e,r=Promise.resolve();do{n=(0,v.Z)(),s.push({offset:i,writePromise:r,writeDeferred:n}),r=n,i+=a}while(i{if(!(null==e?void 0:e.error))for(const a of I)e&&e!==a||(a.error=t,a.deferred.reject(t))},y="inputWebFileLocation"===i._,_=y&&this.isLocalWebFile(i.url),v=this.tempId++,P=_?s:e.limitPart||this.getLimitPart(s,!1);let b,M,S=m.getFile.bind(m);const I=[],C=s||P,k=(e,t)=>{const{deferred:a}=e,s=u.bind(null,e);a.cancel=()=>a.reject((0,X.Z)("DOWNLOAD_CANCELED")),a.catch((t=>{var a,n;s(t),null===(n=null===(a=e.writer)||void 0===a?void 0:a.truncate)||void 0===n||n.call(a)})).finally((()=>{this.downloadPromises[t]===a&&delete this.downloadPromises[t],delete e.writer})),this.downloadPromises[t]=a,I.push(e)};if(m&&(!g||C<=o.Iw)&&(b=m.prepareWriting(l,C,e.mimeType),k(b,l)),g){let t=e.fileName;if(!t){t=l;const a=ht[e.mimeType];a&&(t+="."+a)}M=g.prepareWriting({fileName:t,downloadId:r,size:C}),k(M,c),b&&M.deferred.catch((e=>b.deferred.reject(e)))}h=null!==(a=null==M?void 0:M.deferred)&&void 0!==a?a:b.deferred,g&&f&&(S=g.getFile.bind(g)),S(l).then((e=>La(this,void 0,void 0,(function*(){if(w(),M){const t=M.writer=M.getWriter();w();const a=yield function(e){return Fa(e).then((e=>new Uint8Array(e)))}(e);w(),yield t.write(a),w(),M.deferred.resolve(yield t.finalize())}b&&b.deferred.resolve(e)})))).catch((t=>La(this,void 0,void 0,(function*(){if(e.onlyCache)return void u(null,t);I.forEach((e=>{e.writer=e.getWriter()}));const a=(y?this.requestWebFilePart:this.requestFilePart).bind(this);y&&void 0===this.webFileDcId&&!_&&(yield this.apiManager.getConfig(),w());const r=this.allocateDeferredPromises(0,s,P),p={done:0,offset:0,total:s,fileName:c},d=()=>{try{w(),p.done=g,this.rootScope.dispatchEvent("download_progress",p)}catch(e){}},m=(0,aa.Z)(d,50,!0);let g=0;const h=()=>La(this,void 0,void 0,(function*(){const{offset:t,writePromise:p,writeDeferred:y}=r.shift();try{w();performance.now();const u=yield a(n,i,t,P,v,e.queueId,w),_=(performance.now(),u.bytes);r.length&&h();const b=_.byteLength;this.debug&&this.log("downloadFile requestFilePart result:",c,u);const M=t+P>=s||!b;if(b){g+=b,M?d():m();performance.now();yield p,w(),performance.now(),performance.now(),yield Promise.all(I.map((({writer:e})=>null==e?void 0:e.write(_,t)))),w()}if(M&&(!s||g{var t;return null===(t=null==e?void 0:e.trim)||void 0===t?void 0:t.call(e,g)})),M&&f){const e=I.filter((({writer:e})=>(null==e?void 0:e.getParts)&&e.replaceParts)).map((({writer:e})=>La(this,void 0,void 0,(function*(){const t=e.getParts(),a=yield f(t,l);e.replaceParts(a)}))));yield Promise.all(e),w()}if(y.resolve(),M){const e=g<=o.Iw;I.forEach((t=>{const{deferred:a,writer:s}=t;if(a.isFulfilled||a.isRejected||!s)return;const n=s.finalize(e);a.resolve(n)}))}}catch(e){u(null,e)}}));for(let e=0,t=Math.min(1/0,r.length);e{if(I.reduce(((e,t)=>e+ +!!t.error),0)===I.length)throw I[0].error};return h}downloadMedia(e){let{media:t,thumb:a}=e;const s="photo"===t._;if(s&&!a)return Promise.reject("preloadPhoto photoEmpty!");const n="document"===t._;n?t=this.appDocsManager.getDoc(t.id):s&&(t=this.appPhotosManager.getPhoto(t.id));const{fileName:i,downloadOptions:r}=(0,Ra.Z)(e);let o=this.getDownload(i);return o||(o=this.download(r),n&&!a&&(this.rootScope.dispatchEvent("document_downloading",t.id),o.then((()=>{this.rootScope.dispatchEvent("document_downloaded",t.id)})).catch(qt.Z))),o}downloadMediaURL(e){const{media:t,thumb:a}=e;let s=this.thumbsStorage.getCacheContext(t,null==a?void 0:a.type);return(!a||s.downloaded>=("size"in a?a.size:0))&&s.url?Promise.resolve(s.url):this.downloadMedia(e).then((e=>{if(!s.downloaded||s.downloaded=10485760,n=this.getLimitPart(a,!0),i=this.getDelta(n),r=Math.ceil(a/n),o=(0,Ee.a)(),p={_:s?"inputFileBig":"inputFile",id:o,parts:r,name:t,md5_checksum:""},d=(0,v.Z)();if(r>this.maxUploadParts)return d.reject((0,X.Z)("FILE_TOO_BIG")),d;let f=!1,c=!1,l=e=>{"UPLOAD_CANCELED"!==(null==e?void 0:e.type)&&this.log.error("Up Error",e),d.reject(e),f=!0,l=qt.Z};const m=s?"upload.saveBigFilePart":"upload.saveFilePart",g=this.tempId++,h=this,u=function*(){let u=0,y=0;for(let v=0;vLa(this,void 0,void 0,(function*(){_();const i=e.slice(v,v+n),g=yield Fa(i);return _(),h.debug&&h.log("Upload file part, isBig:",s,P,g.byteLength,new Uint8Array(g).length,new Uint8Array(g).slice().length),h.apiManager.invokeApi(m,{file_id:o,file_part:P,file_total_parts:r,bytes:g},{fileUpload:!0}).then((()=>{if(f)return;++y;const e={done:y*n,offset:v,total:a,fileName:t};d.notify(e),y>=r&&(d.resolve(p),c=!0)}),l)}))),i).catch(l)}}(),y=()=>{if(f)return;const e=u.next();e.done||f||e.value.then(y)};for(let e=0,t=Math.min(1/0,r);e{if(f)throw(0,X.Z)("UPLOAD_CANCELED")};return d.cancel=()=>{f||c||(f=!0,l((0,X.Z)("UPLOAD_CANCELED")))},d.notify=e=>{this.rootScope.dispatchEvent("download_progress",e)},d.finally((()=>{this.uploadPromises[t]===d&&delete this.uploadPromises[t]})),this.uploadPromises[t]=d}}var qa=a(7487),Ga=a(6666),Ha=a(3306);class Wa extends G{constructor(){super(),this.hashes={},this.apiPromisesSingleProcess={},this.apiPromisesSingle={},this.apiPromisesCacheable={},this.afterMessageIdTemp=0}setUser(e){return this.setUserAuth(e.id)}invokeApiAfter(e,t={},a={}){let s=a;return s.prepareTempMessageId=""+ ++this.afterMessageIdTemp,s=Object.assign({},a),a.messageId=s.prepareTempMessageId,this.invokeApi(e,t,s)}invokeApiHashable(e){var t,a;null!==(t=e.params)&&void 0!==t||(e.params={}),null!==(a=e.options)&&void 0!==a||(e.options={});const{params:s,options:n,method:i,overwrite:r}=e,o=JSON.stringify(s);let p;return this.hashes[i]&&(p=this.hashes[i][o],p&&(r?(delete this.hashes[i][o],p=void 0):s.hash=p.hash)),this.invokeApiSingleProcess({method:i,processResult:t=>{if(t._.includes("NotModified"))return p.result;if(t.hash){const e=t.hash;this.hashes[i]||(this.hashes[i]={}),p=this.hashes[i][o]={hash:e,result:t}}if(e.processResult){const a=e.processResult(t);return p?p.result=a:a}return t},params:s,options:n})}invokeApiSingle(e,t={},a={}){const s=e+"-"+JSON.stringify(t),n=this.apiPromisesSingle;return n[s]?n[s]:n[s]=this.invokeApi(e,t,a).finally((()=>{delete n[s]}))}invokeApiSingleProcess(e){var t,a,s;null!==(t=e.params)&&void 0!==t||(e.params={}),null!==(a=e.options)&&void 0!==a||(e.options={});const{method:n,processResult:i,processError:r,params:o,options:p}=e,d=this.apiPromisesSingleProcess,f=p.cacheKey||JSON.stringify(o),c=null!==(s=d[n])&&void 0!==s?s:d[n]=new Map,l=c.get(f);if(l)return l;const m=()=>{const e=c.get(f);return e===h?void 0:e},g=this.invokeApi(n,o,p).then((e=>m()||i(e)),(e=>{const t=m();if(t)return t;if(!r)throw e;return r(e)})),h=g.finally((()=>{c.get(f)===h&&(c.delete(f),c.size||delete d[n])}));return c.set(f,h),h}invokeApiCacheable(e,t={},a={}){var s;const n=null!==(s=this.apiPromisesCacheable[e])&&void 0!==s?s:this.apiPromisesCacheable[e]={},i=JSON.stringify(t),r=n[i];if(r&&(!a.override||!r.fulfilled))return r.promise;let o;a.override&&(r&&r.timeout&&(clearTimeout(r.timeout),delete r.timeout),delete a.override),a.cacheSeconds&&(o=T.Z.setTimeout((()=>{delete n[i]}),1e3*a.cacheSeconds),delete a.cacheSeconds);const p=this.invokeApi(e,t,a);return n[i]={timestamp:Date.now(),fulfilled:!1,timeout:o,promise:p,params:t},p}clearCache(e,t){const a=this.apiPromisesCacheable[e];if(a)for(const e in a){const s=a[e];try{t(s.params)&&(s.timeout&&clearTimeout(s.timeout),delete a[e])}catch(e){}}}getConfig(e){return this.config&&!e?this.config:this.invokeApiSingleProcess({method:"help.getConfig",params:{},processResult:e=>(this.config=e,this.rootScope.dispatchEvent("config",e),e),options:{overwrite:e}})}getAppConfig(e){return this.appConfig&&!e?this.appConfig:this.invokeApiSingleProcess({method:"help.getAppConfig",params:{},processResult:e=>{var t;return this.appConfig=e,(0,ia.Ki)(null!==(t=e.ignore_restriction_reasons)&&void 0!==t?t:[]),this.rootScope.dispatchEvent("app_config",e),e},options:{overwrite:e}})}getLimit(e,t){return(0,q.Z)(this.getAppConfig(),(a=>{null!=t||(t=this.rootScope.premium);const s={pin:["dialogs_pinned_limit_default","dialogs_pinned_limit_premium"],folderPin:["dialogs_folder_pinned_limit_default","dialogs_folder_pinned_limit_premium"],folders:["dialog_filters_limit_default","dialog_filters_limit_premium"],favedStickers:["stickers_faved_limit_default","stickers_faved_limit_premium"],reactions:["reactions_user_max_default","reactions_user_max_premium"],bio:["about_length_limit_default","about_length_limit_premium"],topicPin:"topics_pinned_limit",caption:["caption_length_limit_default","caption_length_limit_premium"]}[e];return a[Array.isArray(s)?s[t?1:0]:s]}))}}var za=a(8453),Ka=function(e,t,a,s){return new(a||(a=Promise))((function(n,i){function r(e){try{p(s.next(e))}catch(e){i(e)}}function o(e){try{p(s.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((s=s.apply(e,t||[])).next())}))};class Ja extends Wa{constructor(){super(),this.log=(0,S.kg)("API"),this.cachedNetworkers={},this.cachedExportPromise={},this.gettingNetworkers={},this.baseDcId=0,this.afterMessageTempIds={},this.transportType=b.Z.transport,Z.addEventListener("transport",(e=>{this.changeTransportType(e)})),setInterval((()=>{this.getAppConfig(!0)}),997e4)}after(){this.apiUpdatesManager.addMultipleEventsListeners({updateConfig:()=>{this.getConfig(!0),this.getAppConfig(!0)}}),this.rootScope.addEventListener("user_auth",(()=>{this.config&&this.apiUpdatesManager.processLocalUpdate({_:"updateConfig"})})),this.rootScope.addEventListener("premium_toggle",(e=>{this.iterateNetworkers((({networker:t,connectionType:a,dcId:s,transportType:n})=>{if("client"===a||"websocket"!==n)return;const i=t.transport;if(i){if(i.connection){const t=V(s,a,e);i.changeUrl(t)}}else this.log.error("wow what, no transport?",t)}))}))}getTransportType(e){return this.transportType}iterateNetworkers(e){for(const t in this.cachedNetworkers){const a=this.cachedNetworkers[t];for(const s in a){const n=a[s];for(const a in n)n[a].forEach(((n,i,r)=>{e({networker:n,dcId:+a,connectionType:s,transportType:t,index:i,array:r})}))}}}chooseServer(e,t,a){return this.dcConfigurator.chooseServer(e,t,a,"client"===t,this.rootScope.premium)}changeTransportType(e){const t=this.transportType;if(t===e)return;this.log("changing transport from",t,"to",e);const a=this.cachedNetworkers[t],s=this.cachedNetworkers[e];this.cachedNetworkers[e]=a,this.cachedNetworkers[t]=s,this.transportType=e;for(const a in this.gettingNetworkers){const s=this.gettingNetworkers[a];delete this.gettingNetworkers[a];const n=a.replace(t,e);this.gettingNetworkers[n]=s,this.log("changed networker getKey from",a,"to",n)}this.iterateNetworkers((e=>{const t=this.getTransportType(e.connectionType),a=this.chooseServer(e.dcId,e.connectionType,t);this.changeNetworkerTransport(e.networker,a)}))}getBaseDcId(){return Ka(this,void 0,void 0,(function*(){if(this.baseDcId)return this.baseDcId;const e=yield qa.Z.get("dc");return this.baseDcId||(e?this.baseDcId=e:this.setBaseDcId(_.Z.baseDcId)),this.baseDcId}))}setUserAuth(e){return Ka(this,void 0,void 0,(function*(){if("string"!=typeof e&&"number"!=typeof e||(e={dcID:0,date:(0,te.Z)(!0),id:e.toPeerId(!1)}),this.rootScope.dispatchEvent("user_auth",e),!e.dcID){const t=yield this.getBaseDcId();e.dcID=t}qa.Z.set({user_auth:e})}))}setBaseDcId(e){const t=this.baseDcId;t&&this.getNetworker(t).then((e=>{this.setOnDrainIfNeeded(e)})),this.baseDcId=e,qa.Z.set({dc:this.baseDcId})}logOut(){return Ka(this,void 0,void 0,(function*(){if(this.loggingOut)return;this.loggingOut=!0;const e=[];for(let t=1;t<=5;t++)e.push("dc"+t+"_auth_key");const t=yield Promise.all(e.map((e=>qa.Z.get(e)))),a=[];for(let e=0;eKa(this,void 0,void 0,(function*(){this.baseDcId=void 0,yield(0,za.Z)(!1,!0),Ga.C.closeDatabases(),this.rootScope.dispatchEvent("logging_out")}));return setTimeout(s,1e3),Promise.all(a).catch((e=>{e.handled=!0})).finally(s)}))}generateNetworkerGetKey(e,t,a){return[e,t,a].join("-")}getNetworker(e,t={}){const a=t.fileDownload?"download":t.fileUpload?"upload":"client",n=this.getTransportType(a);this.cachedNetworkers[n]||(this.cachedNetworkers[n]={client:{},download:{},upload:{}});const i=this.cachedNetworkers[n][a];e in i||(i[e]=[]);const r=i[e],o="client"===a||"https"===n?1:this.rootScope.premium?6:3;if(r.length>=o){let e=o-1,t=!1;for(;e>=0;--e)if(r[e].isOnline){t=!0;break}const a=r.splice(t?e:o-1,1)[0];return r.unshift(a),Promise.resolve(a)}let p=this.generateNetworkerGetKey(e,n,a);if(this.gettingNetworkers[p])return this.gettingNetworkers[p];const d=`dc${e}_auth_key`,f=`dc${e}_server_salt`;let c=this.chooseServer(e,a,n);return this.gettingNetworkers[p]=Promise.all([d,f].map((e=>qa.Z.get(e)))).then((([i,o])=>Ka(this,void 0,void 0,(function*(){let l,m;if(i&&512===i.length){o&&16===o.length||(o="AAAAAAAAAAAAAAAA");const a=(0,Ha.Z)(i),n=(yield s.Z.invokeCrypto("sha1",a)).slice(-8),r=(0,Ha.Z)(o);l=this.networkerFactory.getNetworker(e,a,n,r,t)}else try{const a=yield this.authorizer.auth(e);qa.Z.set({[d]:E(a.authKey),[f]:E(a.serverSalt)}),l=this.networkerFactory.getNetworker(e,a.authKey,a.authKeyId,a.serverSalt,t)}catch(e){m=e}const g=this.getTransportType(a);if(g!==n&&(p=this.generateNetworkerGetKey(e,g,a),c.destroy(),O.removeTransport(this.dcConfigurator.chosenServers,c),l&&(c=this.chooseServer(e,a,g)),this.log("transport has been changed during authorization from",n,"to",g)),delete this.gettingNetworkers[p],m)throw this.log("get networker error",m,m.stack),m;return this.changeNetworkerTransport(l,c),r.unshift(l),this.setOnDrainIfNeeded(l),l}))))}getNetworkerVoid(e){return this.getNetworker(e).then(qt.Z,qt.Z)}changeNetworkerTransport(e,t){const a=e.transport;a&&O.removeTransport(this.dcConfigurator.chosenServers,a),e.changeTransport(t)}onNetworkerDrain(e){this.log("networker drain",e.dcId),e.onDrain=void 0,this.changeNetworkerTransport(e),e.destroy(),this.networkerFactory.removeNetworker(e),O.removeTransport(this.cachedNetworkers,e)}setOnDrainIfNeeded(e){e.onDrain||(e.isFileNetworker?Promise.resolve(!0):this.getBaseDcId().then((t=>e.dcId!==t))).then((t=>{e.onDrain||t&&(e.onDrain=()=>this.onNetworkerDrain(e),e.setDrainTimeout())}))}setUpdatesProcessor(e){this.updatesProcessor=e,this.networkerFactory.setUpdatesProcessor(e)}invokeApi(e,t={},a={}){const s=(0,v.Z)();let n,i,{afterMessageId:r,prepareTempMessageId:o}=a;if(o&&s.then((()=>{delete this.afterMessageTempIds[o]})),d.GO){const n=Date.now(),r=T.Z.setInterval((()=>{i&&i.isStopped()||this.log.error("Request is still processing:",e,t,a,"time:",(Date.now()-n)/1e3)}),5e3);s.catch(qt.Z).finally((()=>{clearInterval(r)}))}const p=(new Error).stack||"empty stack",f=()=>{if(r){const e=this.afterMessageTempIds[r];e&&(a.afterMessageId=e.messageId)}const p=i.wrapApiCall(e,t,a);return o&&(this.afterMessageTempIds[o]={messageId:a.messageId,promise:s}),p.catch((s=>{var i;if("FILE_REFERENCE_EXPIRED"!==s.type&&this.log.error("Error",s.code,s.type,this.baseDcId,n,e,t),401===s.code&&this.baseDcId===n)throw"SESSION_PASSWORD_NEEDED"!==s.type&&(qa.Z.delete("dc"),qa.Z.delete("user_auth")),s;if(401===s.code&&this.baseDcId&&n!==this.baseDcId){if(void 0===this.cachedExportPromise[n]){const e=new Promise(((e,t)=>{this.invokeApi("auth.exportAuthorization",{dc_id:n},{noErrorBox:!0}).then((a=>{this.invokeApi("auth.importAuthorization",{id:a.id,bytes:a.bytes},{dcId:n,noErrorBox:!0}).then(e,t)}),t)}));this.cachedExportPromise[n]=e}return this.cachedExportPromise[n].then((()=>f()))}if(303!==s.code){if(400===s.code&&0===s.type.indexOf("FILE_MIGRATE")){const i=+s.type.match(/^(FILE_MIGRATE_)(\d+)/)[2];if(i!==n)return a.dcId=i,this.invokeApi(e,t,a);throw s}if(400===s.code&&"CONNECTION_NOT_INITED"===s.type)return this.networkerFactory.unsetConnectionInited(),f();if(a.rawError||420!==s.code){if(!a.rawError&&["MSG_WAIT_FAILED","MSG_WAIT_TIMEOUT"].includes(s.type)){const e=this.afterMessageTempIds[r];return r=void 0,delete a.afterMessageId,e?e.promise.then((()=>f())):f()}if(a.rawError||500!==s.code){if("UNKNOWN"===s.type||"MTPROTO_CLUSTER_INVALID"===s.type)return(0,P.Z)(1e3).then((()=>f()));throw s}{const e=Date.now();if(a.stopTime&&e>=a.stopTime)throw s;return a.waitTime=a.waitTime?Math.min(60,1.5*a.waitTime):1,(0,P.Z)(1e3*a.waitTime).then((()=>f()))}}{const e=+s.type.match(/^FLOOD_WAIT_(\d+)/)[1]||1;if(e>(null!==(i=a.floodMaxTimeout)&&void 0!==i?i:60)&&!a.prepareTempMessageId)throw s;return(0,P.Z)(1e3*e).then((()=>f()))}}{const i=+s.type.match(/^(PHONE_MIGRATE_|NETWORK_MIGRATE_|USER_MIGRATE_)(\d+)/)[2];if(i!==n)return a.dcId?a.dcId=i:this.setBaseDcId(i),this.invokeApi(e,t,a)}}))};let c;return c=(n=a.dcId||this.baseDcId)?this.getNetworker(n,a):this.getBaseDcId().then((e=>this.getNetworker(n=e,a))),c.then((e=>{i=e;const t=f();return i.attachPromise(s,a),t})).then(s.resolve).catch((t=>Ka(this,void 0,void 0,(function*(){if(t?(0,fe.Z)(t)||(t={message:t}):t={type:"ERROR_EMPTY"},(401===t.code&&"SESSION_REVOKED"===t.type||406===t.code&&"AUTH_KEY_DUPLICATED"===t.type)&&this.logOut(),a.ignoreErrors)throw t;throw 406===t.code&&(t.handled=!0),a.noErrorBox||(t.input=e,t.stack=p||t.originalError&&t.originalError.stack||t.stack||(new Error).stack,setTimeout((()=>{t.handled||(401===t.code&&this.logOut(),t.handled=!0)}),100)),t})))).catch(s.reject),s}}class $a{constructor(){this.neededPeers=new Map,this.singlePeerMap=new Map,this._constructor(!1)}after(){this.rootScope.addEventListener("user_auth",(()=>{this.requestPeer(this.appPeersManager.peerId,"self")}))}requestPeer(e,t){let a=this.neededPeers.get(e);a&&a.has(t)||(a||(a=new Set,this.neededPeers.set(e,a)),a.add(t),this.dispatchEvent("peerNeeded",e))}releasePeer(e,t){const a=this.neededPeers.get(e);a&&(a.delete(t),a.size||(this.neededPeers.delete(e),this.dispatchEvent("peerUnneeded",e)))}requestPeersForKey(e,t){Array.isArray(e)&&(e=new Set(e));let a=this.singlePeerMap.get(t);if(a){for(const s of a)e.has(s)||(this.releasePeer(s,t),a.delete(s));if(!a.size&&!e.size)return void this.singlePeerMap.delete(t)}if(e.size){a||(a=new Set,this.singlePeerMap.set(t,a));for(const s of e)a.has(s)||(this.requestPeer(s,t),a.add(s))}}isPeerNeeded(e){return this.neededPeers.has(e)}}Ae($a,[p.Z,G]);const Qa=$a,Ya=o.Pt;class Xa{constructor(){this.thumbsCache={}}getKey(e){var t;return e._+(null!==(t=e.id)&&void 0!==t?t:e.url)}getCacheContext(e,t=Ya){var a,s,n,i;const r=null!==(a=(n=this.thumbsCache)[i=this.getKey(e)])&&void 0!==a?a:n[i]={};return null!==(s=r[t])&&void 0!==s?s:r[t]={downloaded:0,url:"",type:t}}setCacheContextURL(e,t=Ya,a,s=0){const n=this.getCacheContext(e,t);return n.url=a,n.downloaded=s,n}deleteCacheContext(e,t=Ya){const a=this.thumbsCache[this.getKey(e)];a&&delete a[t]}}const es={MTProto:{constructors:[{id:481674261,predicate:"vector",params:[],type:"Vector t"},{id:85337187,predicate:"resPQ",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"pq",type:"bytes"},{name:"server_public_key_fingerprints",type:"Vector"}],type:"ResPQ"},{id:-1443537003,predicate:"p_q_inner_data_dc",params:[{name:"pq",type:"bytes"},{name:"p",type:"bytes"},{name:"q",type:"bytes"},{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"new_nonce",type:"int256"},{name:"dc",type:"int"}],type:"P_Q_inner_data"},{id:1459478408,predicate:"p_q_inner_data_temp_dc",params:[{name:"pq",type:"bytes"},{name:"p",type:"bytes"},{name:"q",type:"bytes"},{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"new_nonce",type:"int256"},{name:"dc",type:"int"},{name:"expires_in",type:"int"}],type:"P_Q_inner_data"},{id:-790100132,predicate:"server_DH_params_ok",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"encrypted_answer",type:"bytes"}],type:"Server_DH_Params"},{id:-1249309254,predicate:"server_DH_inner_data",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"g",type:"int"},{name:"dh_prime",type:"bytes"},{name:"g_a",type:"bytes"},{name:"server_time",type:"int"}],type:"Server_DH_inner_data"},{id:1715713620,predicate:"client_DH_inner_data",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"retry_id",type:"long"},{name:"g_b",type:"bytes"}],type:"Client_DH_Inner_Data"},{id:1003222836,predicate:"dh_gen_ok",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"new_nonce_hash1",type:"int128"}],type:"Set_client_DH_params_answer"},{id:1188831161,predicate:"dh_gen_retry",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"new_nonce_hash2",type:"int128"}],type:"Set_client_DH_params_answer"},{id:-1499615742,predicate:"dh_gen_fail",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"new_nonce_hash3",type:"int128"}],type:"Set_client_DH_params_answer"},{id:1973679973,predicate:"bind_auth_key_inner",params:[{name:"nonce",type:"long"},{name:"temp_auth_key_id",type:"long"},{name:"perm_auth_key_id",type:"long"},{name:"temp_session_id",type:"long"},{name:"expires_at",type:"int"}],type:"BindAuthKeyInner"},{id:-212046591,predicate:"rpc_result",params:[{name:"req_msg_id",type:"long"},{name:"result",type:"Object"}],type:"RpcResult"},{id:558156313,predicate:"rpc_error",params:[{name:"error_code",type:"int"},{name:"error_message",type:"string"}],type:"RpcError"},{id:1579864942,predicate:"rpc_answer_unknown",params:[],type:"RpcDropAnswer"},{id:-847714938,predicate:"rpc_answer_dropped_running",params:[],type:"RpcDropAnswer"},{id:-1539647305,predicate:"rpc_answer_dropped",params:[{name:"msg_id",type:"long"},{name:"seq_no",type:"int"},{name:"bytes",type:"int"}],type:"RpcDropAnswer"},{id:155834844,predicate:"future_salt",params:[{name:"valid_since",type:"int"},{name:"valid_until",type:"int"},{name:"salt",type:"long"}],type:"FutureSalt"},{id:-1370486635,predicate:"future_salts",params:[{name:"req_msg_id",type:"long"},{name:"now",type:"int"},{name:"salts",type:"vector"}],type:"FutureSalts"},{id:880243653,predicate:"pong",params:[{name:"msg_id",type:"long"},{name:"ping_id",type:"long"}],type:"Pong"},{id:-501201412,predicate:"destroy_session_ok",params:[{name:"session_id",type:"long"}],type:"DestroySessionRes"},{id:1658015945,predicate:"destroy_session_none",params:[{name:"session_id",type:"long"}],type:"DestroySessionRes"},{id:-1631450872,predicate:"new_session_created",params:[{name:"first_msg_id",type:"long"},{name:"unique_id",type:"long"},{name:"server_salt",type:"long"}],type:"NewSession"},{id:1945237724,predicate:"msg_container",params:[{name:"messages",type:"vector<%Message>"}],type:"MessageContainer"},{id:1538843921,predicate:"message",params:[{name:"msg_id",type:"long"},{name:"seqno",type:"int"},{name:"bytes",type:"int"},{name:"body",type:"Object"}],type:"Message"},{id:-530561358,predicate:"msg_copy",params:[{name:"orig_message",type:"Message"}],type:"MessageCopy"},{id:812830625,predicate:"gzip_packed",params:[{name:"packed_data",type:"bytes"}],type:"Object"},{id:1658238041,predicate:"msgs_ack",params:[{name:"msg_ids",type:"Vector"}],type:"MsgsAck"},{id:-1477445615,predicate:"bad_msg_notification",params:[{name:"bad_msg_id",type:"long"},{name:"bad_msg_seqno",type:"int"},{name:"error_code",type:"int"}],type:"BadMsgNotification"},{id:-307542917,predicate:"bad_server_salt",params:[{name:"bad_msg_id",type:"long"},{name:"bad_msg_seqno",type:"int"},{name:"error_code",type:"int"},{name:"new_server_salt",type:"long"}],type:"BadMsgNotification"},{id:2105940488,predicate:"msg_resend_req",params:[{name:"msg_ids",type:"Vector"}],type:"MsgResendReq"},{id:-630588590,predicate:"msgs_state_req",params:[{name:"msg_ids",type:"Vector"}],type:"MsgsStateReq"},{id:81704317,predicate:"msgs_state_info",params:[{name:"req_msg_id",type:"long"},{name:"info",type:"bytes"}],type:"MsgsStateInfo"},{id:-1933520591,predicate:"msgs_all_info",params:[{name:"msg_ids",type:"Vector"},{name:"info",type:"bytes"}],type:"MsgsAllInfo"},{id:661470918,predicate:"msg_detailed_info",params:[{name:"msg_id",type:"long"},{name:"answer_msg_id",type:"long"},{name:"bytes",type:"int"},{name:"status",type:"int"}],type:"MsgDetailedInfo"},{id:-2137147681,predicate:"msg_new_detailed_info",params:[{name:"answer_msg_id",type:"long"},{name:"bytes",type:"int"},{name:"status",type:"int"}],type:"MsgDetailedInfo"},{id:-161422892,predicate:"destroy_auth_key_ok",params:[],type:"DestroyAuthKeyRes"},{id:178201177,predicate:"destroy_auth_key_none",params:[],type:"DestroyAuthKeyRes"},{id:-368010477,predicate:"destroy_auth_key_fail",params:[],type:"DestroyAuthKeyRes"}],methods:[{id:-1099002127,method:"req_pq_multi",params:[{name:"nonce",type:"int128"}],type:"ResPQ"},{id:-686627650,method:"req_DH_params",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"p",type:"bytes"},{name:"q",type:"bytes"},{name:"public_key_fingerprint",type:"long"},{name:"encrypted_data",type:"bytes"}],type:"Server_DH_Params"},{id:-184262881,method:"set_client_DH_params",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"encrypted_data",type:"bytes"}],type:"Set_client_DH_params_answer"},{id:1491380032,method:"rpc_drop_answer",params:[{name:"req_msg_id",type:"long"}],type:"RpcDropAnswer"},{id:-1188971260,method:"get_future_salts",params:[{name:"num",type:"int"}],type:"FutureSalts"},{id:2059302892,method:"ping",params:[{name:"ping_id",type:"long"}],type:"Pong"},{id:-213746804,method:"ping_delay_disconnect",params:[{name:"ping_id",type:"long"},{name:"disconnect_delay",type:"int"}],type:"Pong"},{id:-414113498,method:"destroy_session",params:[{name:"session_id",type:"long"}],type:"DestroySessionRes"},{id:-1835453025,method:"http_wait",params:[{name:"max_delay",type:"int"},{name:"wait_after",type:"int"},{name:"max_wait",type:"int"}],type:"HttpWait"},{id:-784117408,method:"destroy_auth_key",params:[],type:"DestroyAuthKeyRes"}]},API:{constructors:[{id:-1132882121,predicate:"boolFalse",params:[],type:"Bool"},{id:-1720552011,predicate:"boolTrue",params:[],type:"Bool"},{id:1072550713,predicate:"true",params:[],type:"True"},{id:481674261,predicate:"vector",params:[],type:"Vector t"},{id:-994444869,predicate:"error",params:[{name:"code",type:"int"},{name:"text",type:"string"}],type:"Error"},{id:1450380236,predicate:"null",params:[],type:"Null"},{id:2134579434,predicate:"inputPeerEmpty",params:[],type:"InputPeer"},{id:2107670217,predicate:"inputPeerSelf",params:[],type:"InputPeer"},{id:900291769,predicate:"inputPeerChat",params:[{name:"chat_id",type:"long"}],type:"InputPeer"},{id:-1182234929,predicate:"inputUserEmpty",params:[],type:"InputUser"},{id:-138301121,predicate:"inputUserSelf",params:[],type:"InputUser"},{id:-208488460,predicate:"inputPhoneContact",params:[{name:"client_id",type:"long"},{name:"phone",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"}],type:"InputContact"},{id:-181407105,predicate:"inputFile",params:[{name:"id",type:"long"},{name:"parts",type:"int"},{name:"name",type:"string"},{name:"md5_checksum",type:"string"}],type:"InputFile"},{id:-1771768449,predicate:"inputMediaEmpty",params:[],type:"InputMedia"},{id:505969924,predicate:"inputMediaUploadedPhoto",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.2?true"},{name:"file",type:"InputFile"},{name:"stickers",type:"flags.0?Vector"},{name:"ttl_seconds",type:"flags.1?int"}],type:"InputMedia"},{id:-1279654347,predicate:"inputMediaPhoto",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.1?true"},{name:"id",type:"InputPhoto"},{name:"ttl_seconds",type:"flags.0?int"}],type:"InputMedia"},{id:-104578748,predicate:"inputMediaGeoPoint",params:[{name:"geo_point",type:"InputGeoPoint"}],type:"InputMedia"},{id:-122978821,predicate:"inputMediaContact",params:[{name:"phone_number",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"vcard",type:"string"}],type:"InputMedia"},{id:480546647,predicate:"inputChatPhotoEmpty",params:[],type:"InputChatPhoto"},{id:-1110593856,predicate:"inputChatUploadedPhoto",params:[{name:"flags",type:"#"},{name:"file",type:"flags.0?InputFile"},{name:"video",type:"flags.1?InputFile"},{name:"video_start_ts",type:"flags.2?double"},{name:"video_emoji_markup",type:"flags.3?VideoSize"}],type:"InputChatPhoto"},{id:-1991004873,predicate:"inputChatPhoto",params:[{name:"id",type:"InputPhoto"}],type:"InputChatPhoto"},{id:-457104426,predicate:"inputGeoPointEmpty",params:[],type:"InputGeoPoint"},{id:1210199983,predicate:"inputGeoPoint",params:[{name:"flags",type:"#"},{name:"lat",type:"double"},{name:"long",type:"double"},{name:"accuracy_radius",type:"flags.0?int"}],type:"InputGeoPoint"},{id:483901197,predicate:"inputPhotoEmpty",params:[],type:"InputPhoto"},{id:1001634122,predicate:"inputPhoto",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"}],type:"InputPhoto"},{id:-539317279,predicate:"inputFileLocation",params:[{name:"volume_id",type:"long"},{name:"local_id",type:"int"},{name:"secret",type:"long"},{name:"file_reference",type:"bytes"}],type:"InputFileLocation"},{id:1498486562,predicate:"peerUser",params:[{name:"user_id",type:"long"}],type:"Peer"},{id:918946202,predicate:"peerChat",params:[{name:"chat_id",type:"long"}],type:"Peer"},{id:-1432995067,predicate:"storage.fileUnknown",params:[],type:"storage.FileType"},{id:1086091090,predicate:"storage.filePartial",params:[],type:"storage.FileType"},{id:8322574,predicate:"storage.fileJpeg",params:[],type:"storage.FileType"},{id:-891180321,predicate:"storage.fileGif",params:[],type:"storage.FileType"},{id:172975040,predicate:"storage.filePng",params:[],type:"storage.FileType"},{id:-1373745011,predicate:"storage.filePdf",params:[],type:"storage.FileType"},{id:1384777335,predicate:"storage.fileMp3",params:[],type:"storage.FileType"},{id:1258941372,predicate:"storage.fileMov",params:[],type:"storage.FileType"},{id:-1278304028,predicate:"storage.fileMp4",params:[],type:"storage.FileType"},{id:276907596,predicate:"storage.fileWebp",params:[],type:"storage.FileType"},{id:-742634630,predicate:"userEmpty",params:[{name:"id",type:"long"}],type:"User"},{id:1326562017,predicate:"userProfilePhotoEmpty",params:[],type:"UserProfilePhoto"},{id:-2100168954,predicate:"userProfilePhoto",params:[{name:"flags",type:"#"},{name:"has_video",type:"flags.0?true"},{name:"personal",type:"flags.2?true"},{name:"photo_id",type:"long"},{name:"stripped_thumb",type:"flags.1?bytes"},{name:"dc_id",type:"int"}],type:"UserProfilePhoto"},{id:164646985,predicate:"userStatusEmpty",params:[],type:"UserStatus"},{id:-306628279,predicate:"userStatusOnline",params:[{name:"expires",type:"int"}],type:"UserStatus"},{id:9203775,predicate:"userStatusOffline",params:[{name:"was_online",type:"int"}],type:"UserStatus"},{id:693512293,predicate:"chatEmpty",params:[{name:"id",type:"long"}],type:"Chat"},{id:1103884886,predicate:"chat",params:[{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"left",type:"flags.2?true"},{name:"deactivated",type:"flags.5?true"},{name:"call_active",type:"flags.23?true"},{name:"call_not_empty",type:"flags.24?true"},{name:"noforwards",type:"flags.25?true"},{name:"id",type:"long"},{name:"title",type:"string"},{name:"photo",type:"ChatPhoto"},{name:"participants_count",type:"int"},{name:"date",type:"int"},{name:"version",type:"int"},{name:"migrated_to",type:"flags.6?InputChannel"},{name:"admin_rights",type:"flags.14?ChatAdminRights"},{name:"default_banned_rights",type:"flags.18?ChatBannedRights"}],type:"Chat"},{id:1704108455,predicate:"chatForbidden",params:[{name:"id",type:"long"},{name:"title",type:"string"}],type:"Chat"},{id:-908914376,predicate:"chatFull",params:[{name:"flags",type:"#"},{name:"can_set_username",type:"flags.7?true"},{name:"has_scheduled",type:"flags.8?true"},{name:"translations_disabled",type:"flags.19?true"},{name:"id",type:"long"},{name:"about",type:"string"},{name:"participants",type:"ChatParticipants"},{name:"chat_photo",type:"flags.2?Photo"},{name:"notify_settings",type:"PeerNotifySettings"},{name:"exported_invite",type:"flags.13?ExportedChatInvite"},{name:"bot_info",type:"flags.3?Vector"},{name:"pinned_msg_id",type:"flags.6?int"},{name:"folder_id",type:"flags.11?int"},{name:"call",type:"flags.12?InputGroupCall"},{name:"ttl_period",type:"flags.14?int"},{name:"groupcall_default_join_as",type:"flags.15?Peer"},{name:"theme_emoticon",type:"flags.16?string"},{name:"requests_pending",type:"flags.17?int"},{name:"recent_requesters",type:"flags.17?Vector"},{name:"available_reactions",type:"flags.18?ChatReactions"}],type:"ChatFull"},{id:-1070776313,predicate:"chatParticipant",params:[{name:"user_id",type:"long"},{name:"inviter_id",type:"long"},{name:"date",type:"int"}],type:"ChatParticipant"},{id:-2023500831,predicate:"chatParticipantsForbidden",params:[{name:"flags",type:"#"},{name:"chat_id",type:"long"},{name:"self_participant",type:"flags.0?ChatParticipant"}],type:"ChatParticipants"},{id:1018991608,predicate:"chatParticipants",params:[{name:"chat_id",type:"long"},{name:"participants",type:"Vector"},{name:"version",type:"int"}],type:"ChatParticipants"},{id:935395612,predicate:"chatPhotoEmpty",params:[],type:"ChatPhoto"},{id:476978193,predicate:"chatPhoto",params:[{name:"flags",type:"#"},{name:"has_video",type:"flags.0?true"},{name:"photo_id",type:"long"},{name:"stripped_thumb",type:"flags.1?bytes"},{name:"dc_id",type:"int"}],type:"ChatPhoto"},{id:-1868117372,predicate:"messageEmpty",params:[{name:"flags",type:"#"},{name:"id",type:"int"},{name:"peer_id",type:"flags.0?Peer"}],type:"Message"},{id:940666592,predicate:"message",params:[{name:"flags",type:"#"},{name:"out",type:"flags.1?true"},{name:"mentioned",type:"flags.4?true"},{name:"media_unread",type:"flags.5?true"},{name:"silent",type:"flags.13?true"},{name:"post",type:"flags.14?true"},{name:"from_scheduled",type:"flags.18?true"},{name:"legacy",type:"flags.19?true"},{name:"edit_hide",type:"flags.21?true"},{name:"pinned",type:"flags.24?true"},{name:"noforwards",type:"flags.26?true"},{name:"id",type:"int"},{name:"from_id",type:"flags.8?Peer"},{name:"peer_id",type:"Peer"},{name:"fwd_from",type:"flags.2?MessageFwdHeader"},{name:"via_bot_id",type:"flags.11?long"},{name:"reply_to",type:"flags.3?MessageReplyHeader"},{name:"date",type:"int"},{name:"message",type:"string"},{name:"media",type:"flags.9?MessageMedia"},{name:"reply_markup",type:"flags.6?ReplyMarkup"},{name:"entities",type:"flags.7?Vector"},{name:"views",type:"flags.10?int"},{name:"forwards",type:"flags.10?int"},{name:"replies",type:"flags.23?MessageReplies"},{name:"edit_date",type:"flags.15?int"},{name:"post_author",type:"flags.16?string"},{name:"grouped_id",type:"flags.17?long"},{name:"reactions",type:"flags.20?MessageReactions"},{name:"restriction_reason",type:"flags.22?Vector"},{name:"ttl_period",type:"flags.25?int"}],type:"Message"},{id:721967202,predicate:"messageService",params:[{name:"flags",type:"#"},{name:"out",type:"flags.1?true"},{name:"mentioned",type:"flags.4?true"},{name:"media_unread",type:"flags.5?true"},{name:"silent",type:"flags.13?true"},{name:"post",type:"flags.14?true"},{name:"legacy",type:"flags.19?true"},{name:"id",type:"int"},{name:"from_id",type:"flags.8?Peer"},{name:"peer_id",type:"Peer"},{name:"reply_to",type:"flags.3?MessageReplyHeader"},{name:"date",type:"int"},{name:"action",type:"MessageAction"},{name:"ttl_period",type:"flags.25?int"}],type:"Message"},{id:1038967584,predicate:"messageMediaEmpty",params:[],type:"MessageMedia"},{id:1766936791,predicate:"messageMediaPhoto",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.3?true"},{name:"photo",type:"flags.0?Photo"},{name:"ttl_seconds",type:"flags.2?int"}],type:"MessageMedia"},{id:1457575028,predicate:"messageMediaGeo",params:[{name:"geo",type:"GeoPoint"}],type:"MessageMedia"},{id:1882335561,predicate:"messageMediaContact",params:[{name:"phone_number",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"vcard",type:"string"},{name:"user_id",type:"long"}],type:"MessageMedia"},{id:-1618676578,predicate:"messageMediaUnsupported",params:[],type:"MessageMedia"},{id:-1230047312,predicate:"messageActionEmpty",params:[],type:"MessageAction"},{id:-1119368275,predicate:"messageActionChatCreate",params:[{name:"title",type:"string"},{name:"users",type:"Vector"}],type:"MessageAction"},{id:-1247687078,predicate:"messageActionChatEditTitle",params:[{name:"title",type:"string"}],type:"MessageAction"},{id:2144015272,predicate:"messageActionChatEditPhoto",params:[{name:"photo",type:"Photo"}],type:"MessageAction"},{id:-1780220945,predicate:"messageActionChatDeletePhoto",params:[],type:"MessageAction"},{id:365886720,predicate:"messageActionChatAddUser",params:[{name:"users",type:"Vector"}],type:"MessageAction"},{id:-1539362612,predicate:"messageActionChatDeleteUser",params:[{name:"user_id",type:"long"}],type:"MessageAction"},{id:-712374074,predicate:"dialog",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.2?true"},{name:"unread_mark",type:"flags.3?true"},{name:"peer",type:"Peer"},{name:"top_message",type:"int"},{name:"read_inbox_max_id",type:"int"},{name:"read_outbox_max_id",type:"int"},{name:"unread_count",type:"int"},{name:"unread_mentions_count",type:"int"},{name:"unread_reactions_count",type:"int"},{name:"notify_settings",type:"PeerNotifySettings"},{name:"pts",type:"flags.0?int"},{name:"draft",type:"flags.1?DraftMessage"},{name:"folder_id",type:"flags.4?int"},{name:"ttl_period",type:"flags.5?int"}],type:"Dialog"},{id:590459437,predicate:"photoEmpty",params:[{name:"id",type:"long"}],type:"Photo"},{id:-82216347,predicate:"photo",params:[{name:"flags",type:"#"},{name:"has_stickers",type:"flags.0?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"},{name:"date",type:"int"},{name:"sizes",type:"Vector"},{name:"video_sizes",type:"flags.1?Vector"},{name:"dc_id",type:"int"}],type:"Photo"},{id:236446268,predicate:"photoSizeEmpty",params:[{name:"type",type:"string"}],type:"PhotoSize"},{id:1976012384,predicate:"photoSize",params:[{name:"type",type:"string"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"size",type:"int"}],type:"PhotoSize"},{id:35527382,predicate:"photoCachedSize",params:[{name:"type",type:"string"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"bytes",type:"bytes"}],type:"PhotoSize"},{id:286776671,predicate:"geoPointEmpty",params:[],type:"GeoPoint"},{id:-1297942941,predicate:"geoPoint",params:[{name:"flags",type:"#"},{name:"long",type:"double"},{name:"lat",type:"double"},{name:"access_hash",type:"long"},{name:"accuracy_radius",type:"flags.0?int"}],type:"GeoPoint"},{id:1577067778,predicate:"auth.sentCode",params:[{name:"flags",type:"#"},{name:"type",type:"auth.SentCodeType"},{name:"phone_code_hash",type:"string"},{name:"next_type",type:"flags.1?auth.CodeType"},{name:"timeout",type:"flags.2?int"}],type:"auth.SentCode"},{id:782418132,predicate:"auth.authorization",params:[{name:"flags",type:"#"},{name:"setup_password_required",type:"flags.1?true"},{name:"otherwise_relogin_days",type:"flags.1?int"},{name:"tmp_sessions",type:"flags.0?int"},{name:"future_auth_token",type:"flags.2?bytes"},{name:"user",type:"User"}],type:"auth.Authorization"},{id:-1271602504,predicate:"auth.exportedAuthorization",params:[{name:"id",type:"long"},{name:"bytes",type:"bytes"}],type:"auth.ExportedAuthorization"},{id:-1195615476,predicate:"inputNotifyPeer",params:[{name:"peer",type:"InputPeer"}],type:"InputNotifyPeer"},{id:423314455,predicate:"inputNotifyUsers",params:[],type:"InputNotifyPeer"},{id:1251338318,predicate:"inputNotifyChats",params:[],type:"InputNotifyPeer"},{id:-551616469,predicate:"inputPeerNotifySettings",params:[{name:"flags",type:"#"},{name:"show_previews",type:"flags.0?Bool"},{name:"silent",type:"flags.1?Bool"},{name:"mute_until",type:"flags.2?int"},{name:"sound",type:"flags.3?NotificationSound"}],type:"InputPeerNotifySettings"},{id:-1472527322,predicate:"peerNotifySettings",params:[{name:"flags",type:"#"},{name:"show_previews",type:"flags.0?Bool"},{name:"silent",type:"flags.1?Bool"},{name:"mute_until",type:"flags.2?int"},{name:"ios_sound",type:"flags.3?NotificationSound"},{name:"android_sound",type:"flags.4?NotificationSound"},{name:"other_sound",type:"flags.5?NotificationSound"}],type:"PeerNotifySettings"},{id:-1525149427,predicate:"peerSettings",params:[{name:"flags",type:"#"},{name:"report_spam",type:"flags.0?true"},{name:"add_contact",type:"flags.1?true"},{name:"block_contact",type:"flags.2?true"},{name:"share_contact",type:"flags.3?true"},{name:"need_contacts_exception",type:"flags.4?true"},{name:"report_geo",type:"flags.5?true"},{name:"autoarchived",type:"flags.7?true"},{name:"invite_members",type:"flags.8?true"},{name:"request_chat_broadcast",type:"flags.10?true"},{name:"geo_distance",type:"flags.6?int"},{name:"request_chat_title",type:"flags.9?string"},{name:"request_chat_date",type:"flags.9?int"}],type:"PeerSettings"},{id:-1539849235,predicate:"wallPaper",params:[{name:"id",type:"long"},{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"default",type:"flags.1?true"},{name:"pattern",type:"flags.3?true"},{name:"dark",type:"flags.4?true"},{name:"access_hash",type:"long"},{name:"slug",type:"string"},{name:"document",type:"Document"},{name:"settings",type:"flags.2?WallPaperSettings"}],type:"WallPaper"},{id:1490799288,predicate:"inputReportReasonSpam",params:[],type:"ReportReason"},{id:505595789,predicate:"inputReportReasonViolence",params:[],type:"ReportReason"},{id:777640226,predicate:"inputReportReasonPornography",params:[],type:"ReportReason"},{id:-1376497949,predicate:"inputReportReasonChildAbuse",params:[],type:"ReportReason"},{id:-1041980751,predicate:"inputReportReasonOther",params:[],type:"ReportReason"},{id:-120378643,predicate:"userFull",params:[{name:"flags",type:"#"},{name:"blocked",type:"flags.0?true"},{name:"phone_calls_available",type:"flags.4?true"},{name:"phone_calls_private",type:"flags.5?true"},{name:"can_pin_message",type:"flags.7?true"},{name:"has_scheduled",type:"flags.12?true"},{name:"video_calls_available",type:"flags.13?true"},{name:"voice_messages_forbidden",type:"flags.20?true"},{name:"translations_disabled",type:"flags.23?true"},{name:"id",type:"long"},{name:"about",type:"flags.1?string"},{name:"settings",type:"PeerSettings"},{name:"personal_photo",type:"flags.21?Photo"},{name:"profile_photo",type:"flags.2?Photo"},{name:"fallback_photo",type:"flags.22?Photo"},{name:"notify_settings",type:"PeerNotifySettings"},{name:"bot_info",type:"flags.3?BotInfo"},{name:"pinned_msg_id",type:"flags.6?int"},{name:"common_chats_count",type:"int"},{name:"folder_id",type:"flags.11?int"},{name:"ttl_period",type:"flags.14?int"},{name:"theme_emoticon",type:"flags.15?string"},{name:"private_forward_name",type:"flags.16?string"},{name:"bot_group_admin_rights",type:"flags.17?ChatAdminRights"},{name:"bot_broadcast_admin_rights",type:"flags.18?ChatAdminRights"},{name:"premium_gifts",type:"flags.19?Vector"}],type:"UserFull"},{id:341499403,predicate:"contact",params:[{name:"user_id",type:"long"},{name:"mutual",type:"Bool"}],type:"Contact"},{id:-1052885936,predicate:"importedContact",params:[{name:"user_id",type:"long"},{name:"client_id",type:"long"}],type:"ImportedContact"},{id:383348795,predicate:"contactStatus",params:[{name:"user_id",type:"long"},{name:"status",type:"UserStatus"}],type:"ContactStatus"},{id:-1219778094,predicate:"contacts.contactsNotModified",params:[],type:"contacts.Contacts"},{id:-353862078,predicate:"contacts.contacts",params:[{name:"contacts",type:"Vector"},{name:"saved_count",type:"int"},{name:"users",type:"Vector"}],type:"contacts.Contacts"},{id:2010127419,predicate:"contacts.importedContacts",params:[{name:"imported",type:"Vector"},{name:"popular_invites",type:"Vector"},{name:"retry_contacts",type:"Vector"},{name:"users",type:"Vector"}],type:"contacts.ImportedContacts"},{id:182326673,predicate:"contacts.blocked",params:[{name:"blocked",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"contacts.Blocked"},{id:-513392236,predicate:"contacts.blockedSlice",params:[{name:"count",type:"int"},{name:"blocked",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"contacts.Blocked"},{id:364538944,predicate:"messages.dialogs",params:[{name:"dialogs",type:"Vector"},{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.Dialogs"},{id:1910543603,predicate:"messages.dialogsSlice",params:[{name:"count",type:"int"},{name:"dialogs",type:"Vector"},{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.Dialogs"},{id:-1938715001,predicate:"messages.messages",params:[{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.Messages"},{id:978610270,predicate:"messages.messagesSlice",params:[{name:"flags",type:"#"},{name:"inexact",type:"flags.1?true"},{name:"count",type:"int"},{name:"next_rate",type:"flags.0?int"},{name:"offset_id_offset",type:"flags.2?int"},{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.Messages"},{id:1694474197,predicate:"messages.chats",params:[{name:"chats",type:"Vector"}],type:"messages.Chats"},{id:-438840932,predicate:"messages.chatFull",params:[{name:"full_chat",type:"ChatFull"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.ChatFull"},{id:-1269012015,predicate:"messages.affectedHistory",params:[{name:"pts",type:"int"},{name:"pts_count",type:"int"},{name:"offset",type:"int"}],type:"messages.AffectedHistory"},{id:1474492012,predicate:"inputMessagesFilterEmpty",params:[],type:"MessagesFilter"},{id:-1777752804,predicate:"inputMessagesFilterPhotos",params:[],type:"MessagesFilter"},{id:-1614803355,predicate:"inputMessagesFilterVideo",params:[],type:"MessagesFilter"},{id:1458172132,predicate:"inputMessagesFilterPhotoVideo",params:[],type:"MessagesFilter"},{id:-1629621880,predicate:"inputMessagesFilterDocument",params:[],type:"MessagesFilter"},{id:2129714567,predicate:"inputMessagesFilterUrl",params:[],type:"MessagesFilter"},{id:-3644025,predicate:"inputMessagesFilterGif",params:[],type:"MessagesFilter"},{id:522914557,predicate:"updateNewMessage",params:[{name:"message",type:"Message"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:1318109142,predicate:"updateMessageID",params:[{name:"id",type:"int"},{name:"random_id",type:"long"}],type:"Update"},{id:-1576161051,predicate:"updateDeleteMessages",params:[{name:"messages",type:"Vector"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-1071741569,predicate:"updateUserTyping",params:[{name:"user_id",type:"long"},{name:"action",type:"SendMessageAction"}],type:"Update"},{id:-2092401936,predicate:"updateChatUserTyping",params:[{name:"chat_id",type:"long"},{name:"from_id",type:"Peer"},{name:"action",type:"SendMessageAction"}],type:"Update"},{id:125178264,predicate:"updateChatParticipants",params:[{name:"participants",type:"ChatParticipants"}],type:"Update"},{id:-440534818,predicate:"updateUserStatus",params:[{name:"user_id",type:"long"},{name:"status",type:"UserStatus"}],type:"Update"},{id:-1484486364,predicate:"updateUserName",params:[{name:"user_id",type:"long"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"usernames",type:"Vector"}],type:"Update"},{id:-1519637954,predicate:"updates.state",params:[{name:"pts",type:"int"},{name:"qts",type:"int"},{name:"date",type:"int"},{name:"seq",type:"int"},{name:"unread_count",type:"int"}],type:"updates.State"},{id:1567990072,predicate:"updates.differenceEmpty",params:[{name:"date",type:"int"},{name:"seq",type:"int"}],type:"updates.Difference"},{id:16030880,predicate:"updates.difference",params:[{name:"new_messages",type:"Vector"},{name:"new_encrypted_messages",type:"Vector"},{name:"other_updates",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"},{name:"state",type:"updates.State"}],type:"updates.Difference"},{id:-1459938943,predicate:"updates.differenceSlice",params:[{name:"new_messages",type:"Vector"},{name:"new_encrypted_messages",type:"Vector"},{name:"other_updates",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"},{name:"intermediate_state",type:"updates.State"}],type:"updates.Difference"},{id:-484987010,predicate:"updatesTooLong",params:[],type:"Updates"},{id:826001400,predicate:"updateShortMessage",params:[{name:"flags",type:"#"},{name:"out",type:"flags.1?true"},{name:"mentioned",type:"flags.4?true"},{name:"media_unread",type:"flags.5?true"},{name:"silent",type:"flags.13?true"},{name:"id",type:"int"},{name:"user_id",type:"long"},{name:"message",type:"string"},{name:"pts",type:"int"},{name:"pts_count",type:"int"},{name:"date",type:"int"},{name:"fwd_from",type:"flags.2?MessageFwdHeader"},{name:"via_bot_id",type:"flags.11?long"},{name:"reply_to",type:"flags.3?MessageReplyHeader"},{name:"entities",type:"flags.7?Vector"},{name:"ttl_period",type:"flags.25?int"}],type:"Updates"},{id:1299050149,predicate:"updateShortChatMessage",params:[{name:"flags",type:"#"},{name:"out",type:"flags.1?true"},{name:"mentioned",type:"flags.4?true"},{name:"media_unread",type:"flags.5?true"},{name:"silent",type:"flags.13?true"},{name:"id",type:"int"},{name:"from_id",type:"long"},{name:"chat_id",type:"long"},{name:"message",type:"string"},{name:"pts",type:"int"},{name:"pts_count",type:"int"},{name:"date",type:"int"},{name:"fwd_from",type:"flags.2?MessageFwdHeader"},{name:"via_bot_id",type:"flags.11?long"},{name:"reply_to",type:"flags.3?MessageReplyHeader"},{name:"entities",type:"flags.7?Vector"},{name:"ttl_period",type:"flags.25?int"}],type:"Updates"},{id:2027216577,predicate:"updateShort",params:[{name:"update",type:"Update"},{name:"date",type:"int"}],type:"Updates"},{id:1918567619,predicate:"updatesCombined",params:[{name:"updates",type:"Vector"},{name:"users",type:"Vector"},{name:"chats",type:"Vector"},{name:"date",type:"int"},{name:"seq_start",type:"int"},{name:"seq",type:"int"}],type:"Updates"},{id:1957577280,predicate:"updates",params:[{name:"updates",type:"Vector"},{name:"users",type:"Vector"},{name:"chats",type:"Vector"},{name:"date",type:"int"},{name:"seq",type:"int"}],type:"Updates"},{id:-1916114267,predicate:"photos.photos",params:[{name:"photos",type:"Vector"},{name:"users",type:"Vector"}],type:"photos.Photos"},{id:352657236,predicate:"photos.photosSlice",params:[{name:"count",type:"int"},{name:"photos",type:"Vector"},{name:"users",type:"Vector"}],type:"photos.Photos"},{id:539045032,predicate:"photos.photo",params:[{name:"photo",type:"Photo"},{name:"users",type:"Vector"}],type:"photos.Photo"},{id:157948117,predicate:"upload.file",params:[{name:"type",type:"storage.FileType"},{name:"mtime",type:"int"},{name:"bytes",type:"bytes"}],type:"upload.File"},{id:414687501,predicate:"dcOption",params:[{name:"flags",type:"#"},{name:"ipv6",type:"flags.0?true"},{name:"media_only",type:"flags.1?true"},{name:"tcpo_only",type:"flags.2?true"},{name:"cdn",type:"flags.3?true"},{name:"static",type:"flags.4?true"},{name:"this_port_only",type:"flags.5?true"},{name:"id",type:"int"},{name:"ip_address",type:"string"},{name:"port",type:"int"},{name:"secret",type:"flags.10?bytes"}],type:"DcOption"},{id:589653676,predicate:"config",params:[{name:"flags",type:"#"},{name:"phonecalls_enabled",type:"flags.1?true"},{name:"default_p2p_contacts",type:"flags.3?true"},{name:"preload_featured_stickers",type:"flags.4?true"},{name:"ignore_phone_entities",type:"flags.5?true"},{name:"revoke_pm_inbox",type:"flags.6?true"},{name:"blocked_mode",type:"flags.8?true"},{name:"pfs_enabled",type:"flags.13?true"},{name:"force_try_ipv6",type:"flags.14?true"},{name:"date",type:"int"},{name:"expires",type:"int"},{name:"test_mode",type:"Bool"},{name:"this_dc",type:"int"},{name:"dc_options",type:"Vector"},{name:"dc_txt_domain_name",type:"string"},{name:"chat_size_max",type:"int"},{name:"megagroup_size_max",type:"int"},{name:"forwarded_count_max",type:"int"},{name:"online_update_period_ms",type:"int"},{name:"offline_blur_timeout_ms",type:"int"},{name:"offline_idle_timeout_ms",type:"int"},{name:"online_cloud_timeout_ms",type:"int"},{name:"notify_cloud_delay_ms",type:"int"},{name:"notify_default_delay_ms",type:"int"},{name:"push_chat_period_ms",type:"int"},{name:"push_chat_limit",type:"int"},{name:"saved_gifs_limit",type:"int"},{name:"edit_time_limit",type:"int"},{name:"revoke_time_limit",type:"int"},{name:"revoke_pm_time_limit",type:"int"},{name:"rating_e_decay",type:"int"},{name:"stickers_recent_limit",type:"int"},{name:"stickers_faved_limit",type:"int"},{name:"channels_read_media_period",type:"int"},{name:"tmp_sessions",type:"flags.0?int"},{name:"pinned_dialogs_count_max",type:"int"},{name:"pinned_infolder_count_max",type:"int"},{name:"call_receive_timeout_ms",type:"int"},{name:"call_ring_timeout_ms",type:"int"},{name:"call_connect_timeout_ms",type:"int"},{name:"call_packet_timeout_ms",type:"int"},{name:"me_url_prefix",type:"string"},{name:"autoupdate_url_prefix",type:"flags.7?string"},{name:"gif_search_username",type:"flags.9?string"},{name:"venue_search_username",type:"flags.10?string"},{name:"img_search_username",type:"flags.11?string"},{name:"static_maps_provider",type:"flags.12?string"},{name:"caption_length_max",type:"int"},{name:"message_length_max",type:"int"},{name:"webfile_dc_id",type:"int"},{name:"suggested_lang_code",type:"flags.2?string"},{name:"lang_pack_version",type:"flags.2?int"},{name:"base_lang_pack_version",type:"flags.2?int"},{name:"reactions_default",type:"flags.15?Reaction"}],type:"Config"},{id:-1910892683,predicate:"nearestDc",params:[{name:"country",type:"string"},{name:"this_dc",type:"int"},{name:"nearest_dc",type:"int"}],type:"NearestDc"},{id:-860107216,predicate:"help.appUpdate",params:[{name:"flags",type:"#"},{name:"can_not_skip",type:"flags.0?true"},{name:"id",type:"int"},{name:"version",type:"string"},{name:"text",type:"string"},{name:"entities",type:"Vector"},{name:"document",type:"flags.1?Document"},{name:"url",type:"flags.2?string"},{name:"sticker",type:"flags.3?Document"}],type:"help.AppUpdate"},{id:-1000708810,predicate:"help.noAppUpdate",params:[],type:"help.AppUpdate"},{id:415997816,predicate:"help.inviteText",params:[{name:"message",type:"string"}],type:"help.InviteText"},{id:314359194,predicate:"updateNewEncryptedMessage",params:[{name:"message",type:"EncryptedMessage"},{name:"qts",type:"int"}],type:"Update"},{id:386986326,predicate:"updateEncryptedChatTyping",params:[{name:"chat_id",type:"int"}],type:"Update"},{id:-1264392051,predicate:"updateEncryption",params:[{name:"chat",type:"EncryptedChat"},{name:"date",type:"int"}],type:"Update"},{id:956179895,predicate:"updateEncryptedMessagesRead",params:[{name:"chat_id",type:"int"},{name:"max_date",type:"int"},{name:"date",type:"int"}],type:"Update"},{id:-1417756512,predicate:"encryptedChatEmpty",params:[{name:"id",type:"int"}],type:"EncryptedChat"},{id:1722964307,predicate:"encryptedChatWaiting",params:[{name:"id",type:"int"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"}],type:"EncryptedChat"},{id:1223809356,predicate:"encryptedChatRequested",params:[{name:"flags",type:"#"},{name:"folder_id",type:"flags.0?int"},{name:"id",type:"int"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"g_a",type:"bytes"}],type:"EncryptedChat"},{id:1643173063,predicate:"encryptedChat",params:[{name:"id",type:"int"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"g_a_or_b",type:"bytes"},{name:"key_fingerprint",type:"long"}],type:"EncryptedChat"},{id:505183301,predicate:"encryptedChatDiscarded",params:[{name:"flags",type:"#"},{name:"history_deleted",type:"flags.0?true"},{name:"id",type:"int"}],type:"EncryptedChat"},{id:-247351839,predicate:"inputEncryptedChat",params:[{name:"chat_id",type:"int"},{name:"access_hash",type:"long"}],type:"InputEncryptedChat"},{id:-1038136962,predicate:"encryptedFileEmpty",params:[],type:"EncryptedFile"},{id:-1476358952,predicate:"encryptedFile",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"size",type:"long"},{name:"dc_id",type:"int"},{name:"key_fingerprint",type:"int"}],type:"EncryptedFile"},{id:406307684,predicate:"inputEncryptedFileEmpty",params:[],type:"InputEncryptedFile"},{id:1690108678,predicate:"inputEncryptedFileUploaded",params:[{name:"id",type:"long"},{name:"parts",type:"int"},{name:"md5_checksum",type:"string"},{name:"key_fingerprint",type:"int"}],type:"InputEncryptedFile"},{id:1511503333,predicate:"inputEncryptedFile",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputEncryptedFile"},{id:-182231723,predicate:"inputEncryptedFileLocation",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputFileLocation"},{id:-317144808,predicate:"encryptedMessage",params:[{name:"random_id",type:"long"},{name:"chat_id",type:"int"},{name:"date",type:"int"},{name:"bytes",type:"bytes"},{name:"file",type:"EncryptedFile"}],type:"EncryptedMessage"},{id:594758406,predicate:"encryptedMessageService",params:[{name:"random_id",type:"long"},{name:"chat_id",type:"int"},{name:"date",type:"int"},{name:"bytes",type:"bytes"}],type:"EncryptedMessage"},{id:-1058912715,predicate:"messages.dhConfigNotModified",params:[{name:"random",type:"bytes"}],type:"messages.DhConfig"},{id:740433629,predicate:"messages.dhConfig",params:[{name:"g",type:"int"},{name:"p",type:"bytes"},{name:"version",type:"int"},{name:"random",type:"bytes"}],type:"messages.DhConfig"},{id:1443858741,predicate:"messages.sentEncryptedMessage",params:[{name:"date",type:"int"}],type:"messages.SentEncryptedMessage"},{id:-1802240206,predicate:"messages.sentEncryptedFile",params:[{name:"date",type:"int"},{name:"file",type:"EncryptedFile"}],type:"messages.SentEncryptedMessage"},{id:-95482955,predicate:"inputFileBig",params:[{name:"id",type:"long"},{name:"parts",type:"int"},{name:"name",type:"string"}],type:"InputFile"},{id:767652808,predicate:"inputEncryptedFileBigUploaded",params:[{name:"id",type:"long"},{name:"parts",type:"int"},{name:"key_fingerprint",type:"int"}],type:"InputEncryptedFile"},{id:1037718609,predicate:"updateChatParticipantAdd",params:[{name:"chat_id",type:"long"},{name:"user_id",type:"long"},{name:"inviter_id",type:"long"},{name:"date",type:"int"},{name:"version",type:"int"}],type:"Update"},{id:-483443337,predicate:"updateChatParticipantDelete",params:[{name:"chat_id",type:"long"},{name:"user_id",type:"long"},{name:"version",type:"int"}],type:"Update"},{id:-1906403213,predicate:"updateDcOptions",params:[{name:"dc_options",type:"Vector"}],type:"Update"},{id:1530447553,predicate:"inputMediaUploadedDocument",params:[{name:"flags",type:"#"},{name:"nosound_video",type:"flags.3?true"},{name:"force_file",type:"flags.4?true"},{name:"spoiler",type:"flags.5?true"},{name:"file",type:"InputFile"},{name:"thumb",type:"flags.2?InputFile"},{name:"mime_type",type:"string"},{name:"attributes",type:"Vector"},{name:"stickers",type:"flags.0?Vector"},{name:"ttl_seconds",type:"flags.1?int"}],type:"InputMedia"},{id:860303448,predicate:"inputMediaDocument",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.2?true"},{name:"id",type:"InputDocument"},{name:"ttl_seconds",type:"flags.0?int"},{name:"query",type:"flags.1?string"}],type:"InputMedia"},{id:-1666158377,predicate:"messageMediaDocument",params:[{name:"flags",type:"#"},{name:"nopremium",type:"flags.3?true"},{name:"spoiler",type:"flags.4?true"},{name:"document",type:"flags.0?Document"},{name:"ttl_seconds",type:"flags.2?int"}],type:"MessageMedia"},{id:1928391342,predicate:"inputDocumentEmpty",params:[],type:"InputDocument"},{id:448771445,predicate:"inputDocument",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"}],type:"InputDocument"},{id:-1160743548,predicate:"inputDocumentFileLocation",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"},{name:"thumb_size",type:"string"}],type:"InputFileLocation"},{id:922273905,predicate:"documentEmpty",params:[{name:"id",type:"long"}],type:"Document"},{id:-1881881384,predicate:"document",params:[{name:"flags",type:"#"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"},{name:"date",type:"int"},{name:"mime_type",type:"string"},{name:"size",type:"long"},{name:"thumbs",type:"flags.0?Vector"},{name:"video_thumbs",type:"flags.1?Vector"},{name:"dc_id",type:"int"},{name:"attributes",type:"Vector"}],type:"Document"},{id:398898678,predicate:"help.support",params:[{name:"phone_number",type:"string"},{name:"user",type:"User"}],type:"help.Support"},{id:-1613493288,predicate:"notifyPeer",params:[{name:"peer",type:"Peer"}],type:"NotifyPeer"},{id:-1261946036,predicate:"notifyUsers",params:[],type:"NotifyPeer"},{id:-1073230141,predicate:"notifyChats",params:[],type:"NotifyPeer"},{id:-1094555409,predicate:"updateNotifySettings",params:[{name:"peer",type:"NotifyPeer"},{name:"notify_settings",type:"PeerNotifySettings"}],type:"Update"},{id:381645902,predicate:"sendMessageTypingAction",params:[],type:"SendMessageAction"},{id:-44119819,predicate:"sendMessageCancelAction",params:[],type:"SendMessageAction"},{id:-1584933265,predicate:"sendMessageRecordVideoAction",params:[],type:"SendMessageAction"},{id:-378127636,predicate:"sendMessageUploadVideoAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:-718310409,predicate:"sendMessageRecordAudioAction",params:[],type:"SendMessageAction"},{id:-212740181,predicate:"sendMessageUploadAudioAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:-774682074,predicate:"sendMessageUploadPhotoAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:-1441998364,predicate:"sendMessageUploadDocumentAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:393186209,predicate:"sendMessageGeoLocationAction",params:[],type:"SendMessageAction"},{id:1653390447,predicate:"sendMessageChooseContactAction",params:[],type:"SendMessageAction"},{id:-1290580579,predicate:"contacts.found",params:[{name:"my_results",type:"Vector"},{name:"results",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"contacts.Found"},{id:-337352679,predicate:"updateServiceNotification",params:[{name:"flags",type:"#"},{name:"popup",type:"flags.0?true"},{name:"inbox_date",type:"flags.1?int"},{name:"type",type:"string"},{name:"message",type:"string"},{name:"media",type:"MessageMedia"},{name:"entities",type:"Vector"}],type:"Update"},{id:-496024847,predicate:"userStatusRecently",params:[],type:"UserStatus"},{id:129960444,predicate:"userStatusLastWeek",params:[],type:"UserStatus"},{id:2011940674,predicate:"userStatusLastMonth",params:[],type:"UserStatus"},{id:-298113238,predicate:"updatePrivacy",params:[{name:"key",type:"PrivacyKey"},{name:"rules",type:"Vector"}],type:"Update"},{id:1335282456,predicate:"inputPrivacyKeyStatusTimestamp",params:[],type:"InputPrivacyKey"},{id:-1137792208,predicate:"privacyKeyStatusTimestamp",params:[],type:"PrivacyKey"},{id:218751099,predicate:"inputPrivacyValueAllowContacts",params:[],type:"InputPrivacyRule"},{id:407582158,predicate:"inputPrivacyValueAllowAll",params:[],type:"InputPrivacyRule"},{id:320652927,predicate:"inputPrivacyValueAllowUsers",params:[{name:"users",type:"Vector"}],type:"InputPrivacyRule"},{id:195371015,predicate:"inputPrivacyValueDisallowContacts",params:[],type:"InputPrivacyRule"},{id:-697604407,predicate:"inputPrivacyValueDisallowAll",params:[],type:"InputPrivacyRule"},{id:-1877932953,predicate:"inputPrivacyValueDisallowUsers",params:[{name:"users",type:"Vector"}],type:"InputPrivacyRule"},{id:-123988,predicate:"privacyValueAllowContacts",params:[],type:"PrivacyRule"},{id:1698855810,predicate:"privacyValueAllowAll",params:[],type:"PrivacyRule"},{id:-1198497870,predicate:"privacyValueAllowUsers",params:[{name:"users",type:"Vector"}],type:"PrivacyRule"},{id:-125240806,predicate:"privacyValueDisallowContacts",params:[],type:"PrivacyRule"},{id:-1955338397,predicate:"privacyValueDisallowAll",params:[],type:"PrivacyRule"},{id:-463335103,predicate:"privacyValueDisallowUsers",params:[{name:"users",type:"Vector"}],type:"PrivacyRule"},{id:1352683077,predicate:"account.privacyRules",params:[{name:"rules",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"account.PrivacyRules"},{id:-1194283041,predicate:"accountDaysTTL",params:[{name:"days",type:"int"}],type:"AccountDaysTTL"},{id:88680979,predicate:"updateUserPhone",params:[{name:"user_id",type:"long"},{name:"phone",type:"string"}],type:"Update"},{id:1815593308,predicate:"documentAttributeImageSize",params:[{name:"w",type:"int"},{name:"h",type:"int"}],type:"DocumentAttribute"},{id:297109817,predicate:"documentAttributeAnimated",params:[],type:"DocumentAttribute"},{id:1662637586,predicate:"documentAttributeSticker",params:[{name:"flags",type:"#"},{name:"mask",type:"flags.1?true"},{name:"alt",type:"string"},{name:"stickerset",type:"InputStickerSet"},{name:"mask_coords",type:"flags.0?MaskCoords"}],type:"DocumentAttribute"},{id:250621158,predicate:"documentAttributeVideo",params:[{name:"flags",type:"#"},{name:"round_message",type:"flags.0?true"},{name:"supports_streaming",type:"flags.1?true"},{name:"duration",type:"int"},{name:"w",type:"int"},{name:"h",type:"int"}],type:"DocumentAttribute"},{id:-1739392570,predicate:"documentAttributeAudio",params:[{name:"flags",type:"#"},{name:"voice",type:"flags.10?true"},{name:"duration",type:"int"},{name:"title",type:"flags.0?string"},{name:"performer",type:"flags.1?string"},{name:"waveform",type:"flags.2?bytes"}],type:"DocumentAttribute"},{id:358154344,predicate:"documentAttributeFilename",params:[{name:"file_name",type:"string"}],type:"DocumentAttribute"},{id:-244016606,predicate:"messages.stickersNotModified",params:[],type:"messages.Stickers"},{id:816245886,predicate:"messages.stickers",params:[{name:"hash",type:"long"},{name:"stickers",type:"Vector"}],type:"messages.Stickers"},{id:313694676,predicate:"stickerPack",params:[{name:"emoticon",type:"string"},{name:"documents",type:"Vector"}],type:"StickerPack"},{id:-395967805,predicate:"messages.allStickersNotModified",params:[],type:"messages.AllStickers"},{id:-843329861,predicate:"messages.allStickers",params:[{name:"hash",type:"long"},{name:"sets",type:"Vector"}],type:"messages.AllStickers"},{id:-1667805217,predicate:"updateReadHistoryInbox",params:[{name:"flags",type:"#"},{name:"folder_id",type:"flags.0?int"},{name:"peer",type:"Peer"},{name:"max_id",type:"int"},{name:"still_unread_count",type:"int"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:791617983,predicate:"updateReadHistoryOutbox",params:[{name:"peer",type:"Peer"},{name:"max_id",type:"int"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-2066640507,predicate:"messages.affectedMessages",params:[{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"messages.AffectedMessages"},{id:2139689491,predicate:"updateWebPage",params:[{name:"webpage",type:"WebPage"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-350980120,predicate:"webPageEmpty",params:[{name:"id",type:"long"}],type:"WebPage"},{id:-981018084,predicate:"webPagePending",params:[{name:"id",type:"long"},{name:"date",type:"int"}],type:"WebPage"},{id:-392411726,predicate:"webPage",params:[{name:"flags",type:"#"},{name:"id",type:"long"},{name:"url",type:"string"},{name:"display_url",type:"string"},{name:"hash",type:"int"},{name:"type",type:"flags.0?string"},{name:"site_name",type:"flags.1?string"},{name:"title",type:"flags.2?string"},{name:"description",type:"flags.3?string"},{name:"photo",type:"flags.4?Photo"},{name:"embed_url",type:"flags.5?string"},{name:"embed_type",type:"flags.5?string"},{name:"embed_width",type:"flags.6?int"},{name:"embed_height",type:"flags.6?int"},{name:"duration",type:"flags.7?int"},{name:"author",type:"flags.8?string"},{name:"document",type:"flags.9?Document"},{name:"cached_page",type:"flags.10?Page"},{name:"attributes",type:"flags.12?Vector"}],type:"WebPage"},{id:-1557277184,predicate:"messageMediaWebPage",params:[{name:"webpage",type:"WebPage"}],type:"MessageMedia"},{id:-1392388579,predicate:"authorization",params:[{name:"flags",type:"#"},{name:"current",type:"flags.0?true"},{name:"official_app",type:"flags.1?true"},{name:"password_pending",type:"flags.2?true"},{name:"encrypted_requests_disabled",type:"flags.3?true"},{name:"call_requests_disabled",type:"flags.4?true"},{name:"hash",type:"long"},{name:"device_model",type:"string"},{name:"platform",type:"string"},{name:"system_version",type:"string"},{name:"api_id",type:"int"},{name:"app_name",type:"string"},{name:"app_version",type:"string"},{name:"date_created",type:"int"},{name:"date_active",type:"int"},{name:"ip",type:"string"},{name:"country",type:"string"},{name:"region",type:"string"}],type:"Authorization"},{id:1275039392,predicate:"account.authorizations",params:[{name:"authorization_ttl_days",type:"int"},{name:"authorizations",type:"Vector"}],type:"account.Authorizations"},{id:-1787080453,predicate:"account.password",params:[{name:"flags",type:"#"},{name:"has_recovery",type:"flags.0?true"},{name:"has_secure_values",type:"flags.1?true"},{name:"has_password",type:"flags.2?true"},{name:"current_algo",type:"flags.2?PasswordKdfAlgo"},{name:"srp_B",type:"flags.2?bytes"},{name:"srp_id",type:"flags.2?long"},{name:"hint",type:"flags.3?string"},{name:"email_unconfirmed_pattern",type:"flags.4?string"},{name:"new_algo",type:"PasswordKdfAlgo"},{name:"new_secure_algo",type:"SecurePasswordKdfAlgo"},{name:"secure_random",type:"bytes"},{name:"pending_reset_date",type:"flags.5?int"},{name:"login_email_pattern",type:"flags.6?string"}],type:"account.Password"},{id:-1705233435,predicate:"account.passwordSettings",params:[{name:"flags",type:"#"},{name:"email",type:"flags.0?string"},{name:"secure_settings",type:"flags.1?SecureSecretSettings"}],type:"account.PasswordSettings"},{id:-1036572727,predicate:"account.passwordInputSettings",params:[{name:"flags",type:"#"},{name:"new_algo",type:"flags.0?PasswordKdfAlgo"},{name:"new_password_hash",type:"flags.0?bytes"},{name:"hint",type:"flags.0?string"},{name:"email",type:"flags.1?string"},{name:"new_secure_settings",type:"flags.2?SecureSecretSettings"}],type:"account.PasswordInputSettings"},{id:326715557,predicate:"auth.passwordRecovery",params:[{name:"email_pattern",type:"string"}],type:"auth.PasswordRecovery"},{id:-1052959727,predicate:"inputMediaVenue",params:[{name:"geo_point",type:"InputGeoPoint"},{name:"title",type:"string"},{name:"address",type:"string"},{name:"provider",type:"string"},{name:"venue_id",type:"string"},{name:"venue_type",type:"string"}],type:"InputMedia"},{id:784356159,predicate:"messageMediaVenue",params:[{name:"geo",type:"GeoPoint"},{name:"title",type:"string"},{name:"address",type:"string"},{name:"provider",type:"string"},{name:"venue_id",type:"string"},{name:"venue_type",type:"string"}],type:"MessageMedia"},{id:-1551583367,predicate:"receivedNotifyMessage",params:[{name:"id",type:"int"},{name:"flags",type:"int"}],type:"ReceivedNotifyMessage"},{id:179611673,predicate:"chatInviteExported",params:[{name:"flags",type:"#"},{name:"revoked",type:"flags.0?true"},{name:"permanent",type:"flags.5?true"},{name:"request_needed",type:"flags.6?true"},{name:"link",type:"string"},{name:"admin_id",type:"long"},{name:"date",type:"int"},{name:"start_date",type:"flags.4?int"},{name:"expire_date",type:"flags.1?int"},{name:"usage_limit",type:"flags.2?int"},{name:"usage",type:"flags.3?int"},{name:"requested",type:"flags.7?int"},{name:"title",type:"flags.8?string"}],type:"ExportedChatInvite"},{id:1516793212,predicate:"chatInviteAlready",params:[{name:"chat",type:"Chat"}],type:"ChatInvite"},{id:806110401,predicate:"chatInvite",params:[{name:"flags",type:"#"},{name:"channel",type:"flags.0?true"},{name:"broadcast",type:"flags.1?true"},{name:"public",type:"flags.2?true"},{name:"megagroup",type:"flags.3?true"},{name:"request_needed",type:"flags.6?true"},{name:"title",type:"string"},{name:"about",type:"flags.5?string"},{name:"photo",type:"Photo"},{name:"participants_count",type:"int"},{name:"participants",type:"flags.4?Vector"}],type:"ChatInvite"},{id:51520707,predicate:"messageActionChatJoinedByLink",params:[{name:"inviter_id",type:"long"}],type:"MessageAction"},{id:1757493555,predicate:"updateReadMessagesContents",params:[{name:"messages",type:"Vector"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-4838507,predicate:"inputStickerSetEmpty",params:[],type:"InputStickerSet"},{id:-1645763991,predicate:"inputStickerSetID",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputStickerSet"},{id:-2044933984,predicate:"inputStickerSetShortName",params:[{name:"short_name",type:"string"}],type:"InputStickerSet"},{id:768691932,predicate:"stickerSet",params:[{name:"flags",type:"#"},{name:"archived",type:"flags.1?true"},{name:"official",type:"flags.2?true"},{name:"masks",type:"flags.3?true"},{name:"animated",type:"flags.5?true"},{name:"videos",type:"flags.6?true"},{name:"emojis",type:"flags.7?true"},{name:"installed_date",type:"flags.0?int"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"title",type:"string"},{name:"short_name",type:"string"},{name:"thumbs",type:"flags.4?Vector"},{name:"thumb_dc_id",type:"flags.4?int"},{name:"thumb_version",type:"flags.4?int"},{name:"thumb_document_id",type:"flags.8?long"},{name:"count",type:"int"},{name:"hash",type:"int"}],type:"StickerSet"},{id:1846886166,predicate:"messages.stickerSet",params:[{name:"set",type:"StickerSet"},{name:"packs",type:"Vector"},{name:"keywords",type:"Vector"},{name:"documents",type:"Vector"}],type:"messages.StickerSet"},{id:-1885878744,predicate:"user",params:[{name:"flags",type:"#"},{name:"self",type:"flags.10?true"},{name:"contact",type:"flags.11?true"},{name:"mutual_contact",type:"flags.12?true"},{name:"deleted",type:"flags.13?true"},{name:"bot",type:"flags.14?true"},{name:"bot_chat_history",type:"flags.15?true"},{name:"bot_nochats",type:"flags.16?true"},{name:"verified",type:"flags.17?true"},{name:"restricted",type:"flags.18?true"},{name:"min",type:"flags.20?true"},{name:"bot_inline_geo",type:"flags.21?true"},{name:"support",type:"flags.23?true"},{name:"scam",type:"flags.24?true"},{name:"apply_min_photo",type:"flags.25?true"},{name:"fake",type:"flags.26?true"},{name:"bot_attach_menu",type:"flags.27?true"},{name:"premium",type:"flags.28?true"},{name:"attach_menu_enabled",type:"flags.29?true"},{name:"flags2",type:"#"},{name:"id",type:"long"},{name:"access_hash",type:"flags.0?long"},{name:"first_name",type:"flags.1?string"},{name:"last_name",type:"flags.2?string"},{name:"username",type:"flags.3?string"},{name:"phone",type:"flags.4?string"},{name:"photo",type:"flags.5?UserProfilePhoto"},{name:"status",type:"flags.6?UserStatus"},{name:"bot_info_version",type:"flags.14?int"},{name:"restriction_reason",type:"flags.18?Vector"},{name:"bot_inline_placeholder",type:"flags.19?string"},{name:"lang_code",type:"flags.22?string"},{name:"emoji_status",type:"flags.30?EmojiStatus"},{name:"usernames",type:"flags2.0?Vector"}],type:"User"},{id:-1032140601,predicate:"botCommand",params:[{name:"command",type:"string"},{name:"description",type:"string"}],type:"BotCommand"},{id:-1892676777,predicate:"botInfo",params:[{name:"flags",type:"#"},{name:"user_id",type:"flags.0?long"},{name:"description",type:"flags.1?string"},{name:"description_photo",type:"flags.4?Photo"},{name:"description_document",type:"flags.5?Document"},{name:"commands",type:"flags.2?Vector"},{name:"menu_button",type:"flags.3?BotMenuButton"}],type:"BotInfo"},{id:-1560655744,predicate:"keyboardButton",params:[{name:"text",type:"string"}],type:"KeyboardButton"},{id:2002815875,predicate:"keyboardButtonRow",params:[{name:"buttons",type:"Vector"}],type:"KeyboardButtonRow"},{id:-1606526075,predicate:"replyKeyboardHide",params:[{name:"flags",type:"#"},{name:"selective",type:"flags.2?true"}],type:"ReplyMarkup"},{id:-2035021048,predicate:"replyKeyboardForceReply",params:[{name:"flags",type:"#"},{name:"single_use",type:"flags.1?true"},{name:"selective",type:"flags.2?true"},{name:"placeholder",type:"flags.3?string"}],type:"ReplyMarkup"},{id:-2049074735,predicate:"replyKeyboardMarkup",params:[{name:"flags",type:"#"},{name:"resize",type:"flags.0?true"},{name:"single_use",type:"flags.1?true"},{name:"selective",type:"flags.2?true"},{name:"persistent",type:"flags.4?true"},{name:"rows",type:"Vector"},{name:"placeholder",type:"flags.3?string"}],type:"ReplyMarkup"},{id:-571955892,predicate:"inputPeerUser",params:[{name:"user_id",type:"long"},{name:"access_hash",type:"long"}],type:"InputPeer"},{id:-233744186,predicate:"inputUser",params:[{name:"user_id",type:"long"},{name:"access_hash",type:"long"}],type:"InputUser"},{id:-1148011883,predicate:"messageEntityUnknown",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-100378723,predicate:"messageEntityMention",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1868782349,predicate:"messageEntityHashtag",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1827637959,predicate:"messageEntityBotCommand",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1859134776,predicate:"messageEntityUrl",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1692693954,predicate:"messageEntityEmail",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-1117713463,predicate:"messageEntityBold",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-2106619040,predicate:"messageEntityItalic",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:681706865,predicate:"messageEntityCode",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1938967520,predicate:"messageEntityPre",params:[{name:"offset",type:"int"},{name:"length",type:"int"},{name:"language",type:"string"}],type:"MessageEntity"},{id:1990644519,predicate:"messageEntityTextUrl",params:[{name:"offset",type:"int"},{name:"length",type:"int"},{name:"url",type:"string"}],type:"MessageEntity"},{id:-1877614335,predicate:"updateShortSentMessage",params:[{name:"flags",type:"#"},{name:"out",type:"flags.1?true"},{name:"id",type:"int"},{name:"pts",type:"int"},{name:"pts_count",type:"int"},{name:"date",type:"int"},{name:"media",type:"flags.9?MessageMedia"},{name:"entities",type:"flags.7?Vector"},{name:"ttl_period",type:"flags.25?int"}],type:"Updates"},{id:-292807034,predicate:"inputChannelEmpty",params:[],type:"InputChannel"},{id:-212145112,predicate:"inputChannel",params:[{name:"channel_id",type:"long"},{name:"access_hash",type:"long"}],type:"InputChannel"},{id:-1566230754,predicate:"peerChannel",params:[{name:"channel_id",type:"long"}],type:"Peer"},{id:666680316,predicate:"inputPeerChannel",params:[{name:"channel_id",type:"long"},{name:"access_hash",type:"long"}],type:"InputPeer"},{id:-2094689180,predicate:"channel",params:[{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"left",type:"flags.2?true"},{name:"broadcast",type:"flags.5?true"},{name:"verified",type:"flags.7?true"},{name:"megagroup",type:"flags.8?true"},{name:"restricted",type:"flags.9?true"},{name:"signatures",type:"flags.11?true"},{name:"min",type:"flags.12?true"},{name:"scam",type:"flags.19?true"},{name:"has_link",type:"flags.20?true"},{name:"has_geo",type:"flags.21?true"},{name:"slowmode_enabled",type:"flags.22?true"},{name:"call_active",type:"flags.23?true"},{name:"call_not_empty",type:"flags.24?true"},{name:"fake",type:"flags.25?true"},{name:"gigagroup",type:"flags.26?true"},{name:"noforwards",type:"flags.27?true"},{name:"join_to_send",type:"flags.28?true"},{name:"join_request",type:"flags.29?true"},{name:"forum",type:"flags.30?true"},{name:"flags2",type:"#"},{name:"id",type:"long"},{name:"access_hash",type:"flags.13?long"},{name:"title",type:"string"},{name:"username",type:"flags.6?string"},{name:"photo",type:"ChatPhoto"},{name:"date",type:"int"},{name:"restriction_reason",type:"flags.9?Vector"},{name:"admin_rights",type:"flags.14?ChatAdminRights"},{name:"banned_rights",type:"flags.15?ChatBannedRights"},{name:"default_banned_rights",type:"flags.18?ChatBannedRights"},{name:"participants_count",type:"flags.17?int"},{name:"usernames",type:"flags2.0?Vector"}],type:"Chat"},{id:399807445,predicate:"channelForbidden",params:[{name:"flags",type:"#"},{name:"broadcast",type:"flags.5?true"},{name:"megagroup",type:"flags.8?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"title",type:"string"},{name:"until_date",type:"flags.16?int"}],type:"Chat"},{id:2131196633,predicate:"contacts.resolvedPeer",params:[{name:"peer",type:"Peer"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"contacts.ResolvedPeer"},{id:-231385849,predicate:"channelFull",params:[{name:"flags",type:"#"},{name:"can_view_participants",type:"flags.3?true"},{name:"can_set_username",type:"flags.6?true"},{name:"can_set_stickers",type:"flags.7?true"},{name:"hidden_prehistory",type:"flags.10?true"},{name:"can_set_location",type:"flags.16?true"},{name:"has_scheduled",type:"flags.19?true"},{name:"can_view_stats",type:"flags.20?true"},{name:"blocked",type:"flags.22?true"},{name:"flags2",type:"#"},{name:"can_delete_channel",type:"flags2.0?true"},{name:"antispam",type:"flags2.1?true"},{name:"participants_hidden",type:"flags2.2?true"},{name:"translations_disabled",type:"flags2.3?true"},{name:"id",type:"long"},{name:"about",type:"string"},{name:"participants_count",type:"flags.0?int"},{name:"admins_count",type:"flags.1?int"},{name:"kicked_count",type:"flags.2?int"},{name:"banned_count",type:"flags.2?int"},{name:"online_count",type:"flags.13?int"},{name:"read_inbox_max_id",type:"int"},{name:"read_outbox_max_id",type:"int"},{name:"unread_count",type:"int"},{name:"chat_photo",type:"Photo"},{name:"notify_settings",type:"PeerNotifySettings"},{name:"exported_invite",type:"flags.23?ExportedChatInvite"},{name:"bot_info",type:"Vector"},{name:"migrated_from_chat_id",type:"flags.4?long"},{name:"migrated_from_max_id",type:"flags.4?int"},{name:"pinned_msg_id",type:"flags.5?int"},{name:"stickerset",type:"flags.8?StickerSet"},{name:"available_min_id",type:"flags.9?int"},{name:"folder_id",type:"flags.11?int"},{name:"linked_chat_id",type:"flags.14?long"},{name:"location",type:"flags.15?ChannelLocation"},{name:"slowmode_seconds",type:"flags.17?int"},{name:"slowmode_next_send_date",type:"flags.18?int"},{name:"stats_dc",type:"flags.12?int"},{name:"pts",type:"int"},{name:"call",type:"flags.21?InputGroupCall"},{name:"ttl_period",type:"flags.24?int"},{name:"pending_suggestions",type:"flags.25?Vector"},{name:"groupcall_default_join_as",type:"flags.26?Peer"},{name:"theme_emoticon",type:"flags.27?string"},{name:"requests_pending",type:"flags.28?int"},{name:"recent_requesters",type:"flags.28?Vector"},{name:"default_send_as",type:"flags.29?Peer"},{name:"available_reactions",type:"flags.30?ChatReactions"}],type:"ChatFull"},{id:182649427,predicate:"messageRange",params:[{name:"min_id",type:"int"},{name:"max_id",type:"int"}],type:"MessageRange"},{id:-948520370,predicate:"messages.channelMessages",params:[{name:"flags",type:"#"},{name:"inexact",type:"flags.1?true"},{name:"pts",type:"int"},{name:"count",type:"int"},{name:"offset_id_offset",type:"flags.2?int"},{name:"messages",type:"Vector"},{name:"topics",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.Messages"},{id:-1781355374,predicate:"messageActionChannelCreate",params:[{name:"title",type:"string"}],type:"MessageAction"},{id:277713951,predicate:"updateChannelTooLong",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"pts",type:"flags.0?int"}],type:"Update"},{id:1666927625,predicate:"updateChannel",params:[{name:"channel_id",type:"long"}],type:"Update"},{id:1656358105,predicate:"updateNewChannelMessage",params:[{name:"message",type:"Message"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-1842450928,predicate:"updateReadChannelInbox",params:[{name:"flags",type:"#"},{name:"folder_id",type:"flags.0?int"},{name:"channel_id",type:"long"},{name:"max_id",type:"int"},{name:"still_unread_count",type:"int"},{name:"pts",type:"int"}],type:"Update"},{id:-1020437742,predicate:"updateDeleteChannelMessages",params:[{name:"channel_id",type:"long"},{name:"messages",type:"Vector"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-232346616,predicate:"updateChannelMessageViews",params:[{name:"channel_id",type:"long"},{name:"id",type:"int"},{name:"views",type:"int"}],type:"Update"},{id:1041346555,predicate:"updates.channelDifferenceEmpty",params:[{name:"flags",type:"#"},{name:"final",type:"flags.0?true"},{name:"pts",type:"int"},{name:"timeout",type:"flags.1?int"}],type:"updates.ChannelDifference"},{id:-1531132162,predicate:"updates.channelDifferenceTooLong",params:[{name:"flags",type:"#"},{name:"final",type:"flags.0?true"},{name:"timeout",type:"flags.1?int"},{name:"dialog",type:"Dialog"},{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"updates.ChannelDifference"},{id:543450958,predicate:"updates.channelDifference",params:[{name:"flags",type:"#"},{name:"final",type:"flags.0?true"},{name:"pts",type:"int"},{name:"timeout",type:"flags.1?int"},{name:"new_messages",type:"Vector"},{name:"other_updates",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"updates.ChannelDifference"},{id:-1798033689,predicate:"channelMessagesFilterEmpty",params:[],type:"ChannelMessagesFilter"},{id:-847783593,predicate:"channelMessagesFilter",params:[{name:"flags",type:"#"},{name:"exclude_new_messages",type:"flags.1?true"},{name:"ranges",type:"Vector"}],type:"ChannelMessagesFilter"},{id:-1072953408,predicate:"channelParticipant",params:[{name:"user_id",type:"long"},{name:"date",type:"int"}],type:"ChannelParticipant"},{id:900251559,predicate:"channelParticipantSelf",params:[{name:"flags",type:"#"},{name:"via_request",type:"flags.0?true"},{name:"user_id",type:"long"},{name:"inviter_id",type:"long"},{name:"date",type:"int"}],type:"ChannelParticipant"},{id:803602899,predicate:"channelParticipantCreator",params:[{name:"flags",type:"#"},{name:"user_id",type:"long"},{name:"admin_rights",type:"ChatAdminRights"},{name:"rank",type:"flags.0?string"}],type:"ChannelParticipant"},{id:-566281095,predicate:"channelParticipantsRecent",params:[],type:"ChannelParticipantsFilter"},{id:-1268741783,predicate:"channelParticipantsAdmins",params:[],type:"ChannelParticipantsFilter"},{id:-1548400251,predicate:"channelParticipantsKicked",params:[{name:"q",type:"string"}],type:"ChannelParticipantsFilter"},{id:-1699676497,predicate:"channels.channelParticipants",params:[{name:"count",type:"int"},{name:"participants",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"channels.ChannelParticipants"},{id:-541588713,predicate:"channels.channelParticipant",params:[{name:"participant",type:"ChannelParticipant"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"channels.ChannelParticipant"},{id:-462696732,predicate:"chatParticipantCreator",params:[{name:"user_id",type:"long"}],type:"ChatParticipant"},{id:-1600962725,predicate:"chatParticipantAdmin",params:[{name:"user_id",type:"long"},{name:"inviter_id",type:"long"},{name:"date",type:"int"}],type:"ChatParticipant"},{id:-674602590,predicate:"updateChatParticipantAdmin",params:[{name:"chat_id",type:"long"},{name:"user_id",type:"long"},{name:"is_admin",type:"Bool"},{name:"version",type:"int"}],type:"Update"},{id:-519864430,predicate:"messageActionChatMigrateTo",params:[{name:"channel_id",type:"long"}],type:"MessageAction"},{id:-365344535,predicate:"messageActionChannelMigrateFrom",params:[{name:"title",type:"string"},{name:"chat_id",type:"long"}],type:"MessageAction"},{id:-1328445861,predicate:"channelParticipantsBots",params:[],type:"ChannelParticipantsFilter"},{id:2013922064,predicate:"help.termsOfService",params:[{name:"flags",type:"#"},{name:"popup",type:"flags.0?true"},{name:"id",type:"DataJSON"},{name:"text",type:"string"},{name:"entities",type:"Vector"},{name:"min_age_confirm",type:"flags.1?int"}],type:"help.TermsOfService"},{id:1753886890,predicate:"updateNewStickerSet",params:[{name:"stickerset",type:"messages.StickerSet"}],type:"Update"},{id:196268545,predicate:"updateStickerSetsOrder",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"emojis",type:"flags.1?true"},{name:"order",type:"Vector"}],type:"Update"},{id:834816008,predicate:"updateStickerSets",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"emojis",type:"flags.1?true"}],type:"Update"},{id:-402498398,predicate:"messages.savedGifsNotModified",params:[],type:"messages.SavedGifs"},{id:-2069878259,predicate:"messages.savedGifs",params:[{name:"hash",type:"long"},{name:"gifs",type:"Vector"}],type:"messages.SavedGifs"},{id:-1821035490,predicate:"updateSavedGifs",params:[],type:"Update"},{id:864077702,predicate:"inputBotInlineMessageMediaAuto",params:[{name:"flags",type:"#"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:1036876423,predicate:"inputBotInlineMessageText",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.0?true"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:-2000710887,predicate:"inputBotInlineResult",params:[{name:"flags",type:"#"},{name:"id",type:"string"},{name:"type",type:"string"},{name:"title",type:"flags.1?string"},{name:"description",type:"flags.2?string"},{name:"url",type:"flags.3?string"},{name:"thumb",type:"flags.4?InputWebDocument"},{name:"content",type:"flags.5?InputWebDocument"},{name:"send_message",type:"InputBotInlineMessage"}],type:"InputBotInlineResult"},{id:1984755728,predicate:"botInlineMessageMediaAuto",params:[{name:"flags",type:"#"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:-1937807902,predicate:"botInlineMessageText",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.0?true"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:295067450,predicate:"botInlineResult",params:[{name:"flags",type:"#"},{name:"id",type:"string"},{name:"type",type:"string"},{name:"title",type:"flags.1?string"},{name:"description",type:"flags.2?string"},{name:"url",type:"flags.3?string"},{name:"thumb",type:"flags.4?WebDocument"},{name:"content",type:"flags.5?WebDocument"},{name:"send_message",type:"BotInlineMessage"}],type:"BotInlineResult"},{id:-1803769784,predicate:"messages.botResults",params:[{name:"flags",type:"#"},{name:"gallery",type:"flags.0?true"},{name:"query_id",type:"long"},{name:"next_offset",type:"flags.1?string"},{name:"switch_pm",type:"flags.2?InlineBotSwitchPM"},{name:"results",type:"Vector"},{name:"cache_time",type:"int"},{name:"users",type:"Vector"}],type:"messages.BotResults"},{id:1232025500,predicate:"updateBotInlineQuery",params:[{name:"flags",type:"#"},{name:"query_id",type:"long"},{name:"user_id",type:"long"},{name:"query",type:"string"},{name:"geo",type:"flags.0?GeoPoint"},{name:"peer_type",type:"flags.1?InlineQueryPeerType"},{name:"offset",type:"string"}],type:"Update"},{id:317794823,predicate:"updateBotInlineSend",params:[{name:"flags",type:"#"},{name:"user_id",type:"long"},{name:"query",type:"string"},{name:"geo",type:"flags.0?GeoPoint"},{name:"id",type:"string"},{name:"msg_id",type:"flags.1?InputBotInlineMessageID"}],type:"Update"},{id:1358283666,predicate:"inputMessagesFilterVoice",params:[],type:"MessagesFilter"},{id:928101534,predicate:"inputMessagesFilterMusic",params:[],type:"MessagesFilter"},{id:-1107622874,predicate:"inputPrivacyKeyChatInvite",params:[],type:"InputPrivacyKey"},{id:1343122938,predicate:"privacyKeyChatInvite",params:[],type:"PrivacyKey"},{id:1571494644,predicate:"exportedMessageLink",params:[{name:"link",type:"string"},{name:"html",type:"string"}],type:"ExportedMessageLink"},{id:1601666510,predicate:"messageFwdHeader",params:[{name:"flags",type:"#"},{name:"imported",type:"flags.7?true"},{name:"from_id",type:"flags.0?Peer"},{name:"from_name",type:"flags.5?string"},{name:"date",type:"int"},{name:"channel_post",type:"flags.2?int"},{name:"post_author",type:"flags.3?string"},{name:"saved_from_peer",type:"flags.4?Peer"},{name:"saved_from_msg_id",type:"flags.4?int"},{name:"psa_type",type:"flags.6?string"}],type:"MessageFwdHeader"},{id:457133559,predicate:"updateEditChannelMessage",params:[{name:"message",type:"Message"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-1799538451,predicate:"messageActionPinMessage",params:[],type:"MessageAction"},{id:1923290508,predicate:"auth.codeTypeSms",params:[],type:"auth.CodeType"},{id:1948046307,predicate:"auth.codeTypeCall",params:[],type:"auth.CodeType"},{id:577556219,predicate:"auth.codeTypeFlashCall",params:[],type:"auth.CodeType"},{id:1035688326,predicate:"auth.sentCodeTypeApp",params:[{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:-1073693790,predicate:"auth.sentCodeTypeSms",params:[{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:1398007207,predicate:"auth.sentCodeTypeCall",params:[{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:-1425815847,predicate:"auth.sentCodeTypeFlashCall",params:[{name:"pattern",type:"string"}],type:"auth.SentCodeType"},{id:629866245,predicate:"keyboardButtonUrl",params:[{name:"text",type:"string"},{name:"url",type:"string"}],type:"KeyboardButton"},{id:901503851,predicate:"keyboardButtonCallback",params:[{name:"flags",type:"#"},{name:"requires_password",type:"flags.0?true"},{name:"text",type:"string"},{name:"data",type:"bytes"}],type:"KeyboardButton"},{id:-1318425559,predicate:"keyboardButtonRequestPhone",params:[{name:"text",type:"string"}],type:"KeyboardButton"},{id:-59151553,predicate:"keyboardButtonRequestGeoLocation",params:[{name:"text",type:"string"}],type:"KeyboardButton"},{id:90744648,predicate:"keyboardButtonSwitchInline",params:[{name:"flags",type:"#"},{name:"same_peer",type:"flags.0?true"},{name:"text",type:"string"},{name:"query",type:"string"}],type:"KeyboardButton"},{id:1218642516,predicate:"replyInlineMarkup",params:[{name:"rows",type:"Vector"}],type:"ReplyMarkup"},{id:911761060,predicate:"messages.botCallbackAnswer",params:[{name:"flags",type:"#"},{name:"alert",type:"flags.1?true"},{name:"has_url",type:"flags.3?true"},{name:"native_ui",type:"flags.4?true"},{name:"message",type:"flags.0?string"},{name:"url",type:"flags.2?string"},{name:"cache_time",type:"int"}],type:"messages.BotCallbackAnswer"},{id:-1177566067,predicate:"updateBotCallbackQuery",params:[{name:"flags",type:"#"},{name:"query_id",type:"long"},{name:"user_id",type:"long"},{name:"peer",type:"Peer"},{name:"msg_id",type:"int"},{name:"chat_instance",type:"long"},{name:"data",type:"flags.0?bytes"},{name:"game_short_name",type:"flags.1?string"}],type:"Update"},{id:649453030,predicate:"messages.messageEditData",params:[{name:"flags",type:"#"},{name:"caption",type:"flags.0?true"}],type:"messages.MessageEditData"},{id:-469536605,predicate:"updateEditMessage",params:[{name:"message",type:"Message"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-1768777083,predicate:"inputBotInlineMessageMediaGeo",params:[{name:"flags",type:"#"},{name:"geo_point",type:"InputGeoPoint"},{name:"heading",type:"flags.0?int"},{name:"period",type:"flags.1?int"},{name:"proximity_notification_radius",type:"flags.3?int"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:1098628881,predicate:"inputBotInlineMessageMediaVenue",params:[{name:"flags",type:"#"},{name:"geo_point",type:"InputGeoPoint"},{name:"title",type:"string"},{name:"address",type:"string"},{name:"provider",type:"string"},{name:"venue_id",type:"string"},{name:"venue_type",type:"string"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:-1494368259,predicate:"inputBotInlineMessageMediaContact",params:[{name:"flags",type:"#"},{name:"phone_number",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"vcard",type:"string"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:85477117,predicate:"botInlineMessageMediaGeo",params:[{name:"flags",type:"#"},{name:"geo",type:"GeoPoint"},{name:"heading",type:"flags.0?int"},{name:"period",type:"flags.1?int"},{name:"proximity_notification_radius",type:"flags.3?int"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:-1970903652,predicate:"botInlineMessageMediaVenue",params:[{name:"flags",type:"#"},{name:"geo",type:"GeoPoint"},{name:"title",type:"string"},{name:"address",type:"string"},{name:"provider",type:"string"},{name:"venue_id",type:"string"},{name:"venue_type",type:"string"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:416402882,predicate:"botInlineMessageMediaContact",params:[{name:"flags",type:"#"},{name:"phone_number",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"vcard",type:"string"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:-1462213465,predicate:"inputBotInlineResultPhoto",params:[{name:"id",type:"string"},{name:"type",type:"string"},{name:"photo",type:"InputPhoto"},{name:"send_message",type:"InputBotInlineMessage"}],type:"InputBotInlineResult"},{id:-459324,predicate:"inputBotInlineResultDocument",params:[{name:"flags",type:"#"},{name:"id",type:"string"},{name:"type",type:"string"},{name:"title",type:"flags.1?string"},{name:"description",type:"flags.2?string"},{name:"document",type:"InputDocument"},{name:"send_message",type:"InputBotInlineMessage"}],type:"InputBotInlineResult"},{id:400266251,predicate:"botInlineMediaResult",params:[{name:"flags",type:"#"},{name:"id",type:"string"},{name:"type",type:"string"},{name:"photo",type:"flags.0?Photo"},{name:"document",type:"flags.1?Document"},{name:"title",type:"flags.2?string"},{name:"description",type:"flags.3?string"},{name:"send_message",type:"BotInlineMessage"}],type:"BotInlineResult"},{id:-1995686519,predicate:"inputBotInlineMessageID",params:[{name:"dc_id",type:"int"},{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputBotInlineMessageID"},{id:1763610706,predicate:"updateInlineBotCallbackQuery",params:[{name:"flags",type:"#"},{name:"query_id",type:"long"},{name:"user_id",type:"long"},{name:"msg_id",type:"InputBotInlineMessageID"},{name:"chat_instance",type:"long"},{name:"data",type:"flags.0?bytes"},{name:"game_short_name",type:"flags.1?string"}],type:"Update"},{id:1008755359,predicate:"inlineBotSwitchPM",params:[{name:"text",type:"string"},{name:"start_param",type:"string"}],type:"InlineBotSwitchPM"},{id:863093588,predicate:"messages.peerDialogs",params:[{name:"dialogs",type:"Vector"},{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"},{name:"state",type:"updates.State"}],type:"messages.PeerDialogs"},{id:-305282981,predicate:"topPeer",params:[{name:"peer",type:"Peer"},{name:"rating",type:"double"}],type:"TopPeer"},{id:-1419371685,predicate:"topPeerCategoryBotsPM",params:[],type:"TopPeerCategory"},{id:344356834,predicate:"topPeerCategoryBotsInline",params:[],type:"TopPeerCategory"},{id:104314861,predicate:"topPeerCategoryCorrespondents",params:[],type:"TopPeerCategory"},{id:-1122524854,predicate:"topPeerCategoryGroups",params:[],type:"TopPeerCategory"},{id:371037736,predicate:"topPeerCategoryChannels",params:[],type:"TopPeerCategory"},{id:-75283823,predicate:"topPeerCategoryPeers",params:[{name:"category",type:"TopPeerCategory"},{name:"count",type:"int"},{name:"peers",type:"Vector"}],type:"TopPeerCategoryPeers"},{id:-567906571,predicate:"contacts.topPeersNotModified",params:[],type:"contacts.TopPeers"},{id:1891070632,predicate:"contacts.topPeers",params:[{name:"categories",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"contacts.TopPeers"},{id:-595914432,predicate:"messageEntityMentionName",params:[{name:"offset",type:"int"},{name:"length",type:"int"},{name:"user_id",type:"long"}],type:"MessageEntity"},{id:546203849,predicate:"inputMessageEntityMentionName",params:[{name:"offset",type:"int"},{name:"length",type:"int"},{name:"user_id",type:"InputUser"}],type:"MessageEntity"},{id:975236280,predicate:"inputMessagesFilterChatPhotos",params:[],type:"MessagesFilter"},{id:-1218471511,predicate:"updateReadChannelOutbox",params:[{name:"channel_id",type:"long"},{name:"max_id",type:"int"}],type:"Update"},{id:457829485,predicate:"updateDraftMessage",params:[{name:"flags",type:"#"},{name:"peer",type:"Peer"},{name:"top_msg_id",type:"flags.0?int"},{name:"draft",type:"DraftMessage"}],type:"Update"},{id:453805082,predicate:"draftMessageEmpty",params:[{name:"flags",type:"#"},{name:"date",type:"flags.0?int"}],type:"DraftMessage"},{id:-40996577,predicate:"draftMessage",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.1?true"},{name:"reply_to_msg_id",type:"flags.0?int"},{name:"message",type:"string"},{name:"entities",type:"flags.3?Vector"},{name:"date",type:"int"}],type:"DraftMessage"},{id:-1615153660,predicate:"messageActionHistoryClear",params:[],type:"MessageAction"},{id:-958657434,predicate:"messages.featuredStickersNotModified",params:[{name:"count",type:"int"}],type:"messages.FeaturedStickers"},{id:-1103615738,predicate:"messages.featuredStickers",params:[{name:"flags",type:"#"},{name:"premium",type:"flags.0?true"},{name:"hash",type:"long"},{name:"count",type:"int"},{name:"sets",type:"Vector"},{name:"unread",type:"Vector"}],type:"messages.FeaturedStickers"},{id:1461528386,predicate:"updateReadFeaturedStickers",params:[],type:"Update"},{id:186120336,predicate:"messages.recentStickersNotModified",params:[],type:"messages.RecentStickers"},{id:-1999405994,predicate:"messages.recentStickers",params:[{name:"hash",type:"long"},{name:"packs",type:"Vector"},{name:"stickers",type:"Vector"},{name:"dates",type:"Vector"}],type:"messages.RecentStickers"},{id:-1706939360,predicate:"updateRecentStickers",params:[],type:"Update"},{id:1338747336,predicate:"messages.archivedStickers",params:[{name:"count",type:"int"},{name:"sets",type:"Vector"}],type:"messages.ArchivedStickers"},{id:946083368,predicate:"messages.stickerSetInstallResultSuccess",params:[],type:"messages.StickerSetInstallResult"},{id:904138920,predicate:"messages.stickerSetInstallResultArchive",params:[{name:"sets",type:"Vector"}],type:"messages.StickerSetInstallResult"},{id:1678812626,predicate:"stickerSetCovered",params:[{name:"set",type:"StickerSet"},{name:"cover",type:"Document"}],type:"StickerSetCovered"},{id:-1574314746,predicate:"updateConfig",params:[],type:"Update"},{id:861169551,predicate:"updatePtsChanged",params:[],type:"Update"},{id:-440664550,predicate:"inputMediaPhotoExternal",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.1?true"},{name:"url",type:"string"},{name:"ttl_seconds",type:"flags.0?int"}],type:"InputMedia"},{id:-78455655,predicate:"inputMediaDocumentExternal",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.1?true"},{name:"url",type:"string"},{name:"ttl_seconds",type:"flags.0?int"}],type:"InputMedia"},{id:872932635,predicate:"stickerSetMultiCovered",params:[{name:"set",type:"StickerSet"},{name:"covers",type:"Vector"}],type:"StickerSetCovered"},{id:-1361650766,predicate:"maskCoords",params:[{name:"n",type:"int"},{name:"x",type:"double"},{name:"y",type:"double"},{name:"zoom",type:"double"}],type:"MaskCoords"},{id:-1744710921,predicate:"documentAttributeHasStickers",params:[],type:"DocumentAttribute"},{id:1251549527,predicate:"inputStickeredMediaPhoto",params:[{name:"id",type:"InputPhoto"}],type:"InputStickeredMedia"},{id:70813275,predicate:"inputStickeredMediaDocument",params:[{name:"id",type:"InputDocument"}],type:"InputStickeredMedia"},{id:-1107729093,predicate:"game",params:[{name:"flags",type:"#"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"short_name",type:"string"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"Photo"},{name:"document",type:"flags.0?Document"}],type:"Game"},{id:1336154098,predicate:"inputBotInlineResultGame",params:[{name:"id",type:"string"},{name:"short_name",type:"string"},{name:"send_message",type:"InputBotInlineMessage"}],type:"InputBotInlineResult"},{id:1262639204,predicate:"inputBotInlineMessageGame",params:[{name:"flags",type:"#"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:-38694904,predicate:"messageMediaGame",params:[{name:"game",type:"Game"}],type:"MessageMedia"},{id:-750828557,predicate:"inputMediaGame",params:[{name:"id",type:"InputGame"}],type:"InputMedia"},{id:53231223,predicate:"inputGameID",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputGame"},{id:-1020139510,predicate:"inputGameShortName",params:[{name:"bot_id",type:"InputUser"},{name:"short_name",type:"string"}],type:"InputGame"},{id:1358175439,predicate:"keyboardButtonGame",params:[{name:"text",type:"string"}],type:"KeyboardButton"},{id:-1834538890,predicate:"messageActionGameScore",params:[{name:"game_id",type:"long"},{name:"score",type:"int"}],type:"MessageAction"},{id:1940093419,predicate:"highScore",params:[{name:"pos",type:"int"},{name:"user_id",type:"long"},{name:"score",type:"int"}],type:"HighScore"},{id:-1707344487,predicate:"messages.highScores",params:[{name:"scores",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.HighScores"},{id:1258196845,predicate:"updates.differenceTooLong",params:[{name:"pts",type:"int"}],type:"updates.Difference"},{id:791390623,predicate:"updateChannelWebPage",params:[{name:"channel_id",type:"long"},{name:"webpage",type:"WebPage"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-1663561404,predicate:"messages.chatsSlice",params:[{name:"count",type:"int"},{name:"chats",type:"Vector"}],type:"messages.Chats"},{id:-599948721,predicate:"textEmpty",params:[],type:"RichText"},{id:1950782688,predicate:"textPlain",params:[{name:"text",type:"string"}],type:"RichText"},{id:1730456516,predicate:"textBold",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:-653089380,predicate:"textItalic",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:-1054465340,predicate:"textUnderline",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:-1678197867,predicate:"textStrike",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:1816074681,predicate:"textFixed",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:1009288385,predicate:"textUrl",params:[{name:"text",type:"RichText"},{name:"url",type:"string"},{name:"webpage_id",type:"long"}],type:"RichText"},{id:-564523562,predicate:"textEmail",params:[{name:"text",type:"RichText"},{name:"email",type:"string"}],type:"RichText"},{id:2120376535,predicate:"textConcat",params:[{name:"texts",type:"Vector"}],type:"RichText"},{id:324435594,predicate:"pageBlockUnsupported",params:[],type:"PageBlock"},{id:1890305021,predicate:"pageBlockTitle",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:-1879401953,predicate:"pageBlockSubtitle",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:-1162877472,predicate:"pageBlockAuthorDate",params:[{name:"author",type:"RichText"},{name:"published_date",type:"int"}],type:"PageBlock"},{id:-1076861716,predicate:"pageBlockHeader",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:-248793375,predicate:"pageBlockSubheader",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:1182402406,predicate:"pageBlockParagraph",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:-1066346178,predicate:"pageBlockPreformatted",params:[{name:"text",type:"RichText"},{name:"language",type:"string"}],type:"PageBlock"},{id:1216809369,predicate:"pageBlockFooter",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:-618614392,predicate:"pageBlockDivider",params:[],type:"PageBlock"},{id:-837994576,predicate:"pageBlockAnchor",params:[{name:"name",type:"string"}],type:"PageBlock"},{id:-454524911,predicate:"pageBlockList",params:[{name:"items",type:"Vector"}],type:"PageBlock"},{id:641563686,predicate:"pageBlockBlockquote",params:[{name:"text",type:"RichText"},{name:"caption",type:"RichText"}],type:"PageBlock"},{id:1329878739,predicate:"pageBlockPullquote",params:[{name:"text",type:"RichText"},{name:"caption",type:"RichText"}],type:"PageBlock"},{id:391759200,predicate:"pageBlockPhoto",params:[{name:"flags",type:"#"},{name:"photo_id",type:"long"},{name:"caption",type:"PageCaption"},{name:"url",type:"flags.0?string"},{name:"webpage_id",type:"flags.0?long"}],type:"PageBlock"},{id:2089805750,predicate:"pageBlockVideo",params:[{name:"flags",type:"#"},{name:"autoplay",type:"flags.0?true"},{name:"loop",type:"flags.1?true"},{name:"video_id",type:"long"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:972174080,predicate:"pageBlockCover",params:[{name:"cover",type:"PageBlock"}],type:"PageBlock"},{id:-1468953147,predicate:"pageBlockEmbed",params:[{name:"flags",type:"#"},{name:"full_width",type:"flags.0?true"},{name:"allow_scrolling",type:"flags.3?true"},{name:"url",type:"flags.1?string"},{name:"html",type:"flags.2?string"},{name:"poster_photo_id",type:"flags.4?long"},{name:"w",type:"flags.5?int"},{name:"h",type:"flags.5?int"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:-229005301,predicate:"pageBlockEmbedPost",params:[{name:"url",type:"string"},{name:"webpage_id",type:"long"},{name:"author_photo_id",type:"long"},{name:"author",type:"string"},{name:"date",type:"int"},{name:"blocks",type:"Vector"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:1705048653,predicate:"pageBlockCollage",params:[{name:"items",type:"Vector"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:52401552,predicate:"pageBlockSlideshow",params:[{name:"items",type:"Vector"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:1930545681,predicate:"webPageNotModified",params:[{name:"flags",type:"#"},{name:"cached_page_views",type:"flags.0?int"}],type:"WebPage"},{id:-88417185,predicate:"inputPrivacyKeyPhoneCall",params:[],type:"InputPrivacyKey"},{id:1030105979,predicate:"privacyKeyPhoneCall",params:[],type:"PrivacyKey"},{id:-580219064,predicate:"sendMessageGamePlayAction",params:[],type:"SendMessageAction"},{id:-2048646399,predicate:"phoneCallDiscardReasonMissed",params:[],type:"PhoneCallDiscardReason"},{id:-527056480,predicate:"phoneCallDiscardReasonDisconnect",params:[],type:"PhoneCallDiscardReason"},{id:1471006352,predicate:"phoneCallDiscardReasonHangup",params:[],type:"PhoneCallDiscardReason"},{id:-84416311,predicate:"phoneCallDiscardReasonBusy",params:[],type:"PhoneCallDiscardReason"},{id:1852826908,predicate:"updateDialogPinned",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.0?true"},{name:"folder_id",type:"flags.1?int"},{name:"peer",type:"DialogPeer"}],type:"Update"},{id:-99664734,predicate:"updatePinnedDialogs",params:[{name:"flags",type:"#"},{name:"folder_id",type:"flags.1?int"},{name:"order",type:"flags.0?Vector"}],type:"Update"},{id:2104790276,predicate:"dataJSON",params:[{name:"data",type:"string"}],type:"DataJSON"},{id:-2095595325,predicate:"updateBotWebhookJSON",params:[{name:"data",type:"DataJSON"}],type:"Update"},{id:-1684914010,predicate:"updateBotWebhookJSONQuery",params:[{name:"query_id",type:"long"},{name:"data",type:"DataJSON"},{name:"timeout",type:"int"}],type:"Update"},{id:-886477832,predicate:"labeledPrice",params:[{name:"label",type:"string"},{name:"amount",type:"long"}],type:"LabeledPrice"},{id:1048946971,predicate:"invoice",params:[{name:"flags",type:"#"},{name:"test",type:"flags.0?true"},{name:"name_requested",type:"flags.1?true"},{name:"phone_requested",type:"flags.2?true"},{name:"email_requested",type:"flags.3?true"},{name:"shipping_address_requested",type:"flags.4?true"},{name:"flexible",type:"flags.5?true"},{name:"phone_to_provider",type:"flags.6?true"},{name:"email_to_provider",type:"flags.7?true"},{name:"recurring",type:"flags.9?true"},{name:"currency",type:"string"},{name:"prices",type:"Vector"},{name:"max_tip_amount",type:"flags.8?long"},{name:"suggested_tip_amounts",type:"flags.8?Vector"},{name:"recurring_terms_url",type:"flags.9?string"}],type:"Invoice"},{id:-1900697899,predicate:"inputMediaInvoice",params:[{name:"flags",type:"#"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.0?InputWebDocument"},{name:"invoice",type:"Invoice"},{name:"payload",type:"bytes"},{name:"provider",type:"string"},{name:"provider_data",type:"DataJSON"},{name:"start_param",type:"flags.1?string"},{name:"extended_media",type:"flags.2?InputMedia"}],type:"InputMedia"},{id:-368917890,predicate:"paymentCharge",params:[{name:"id",type:"string"},{name:"provider_charge_id",type:"string"}],type:"PaymentCharge"},{id:-1892568281,predicate:"messageActionPaymentSentMe",params:[{name:"flags",type:"#"},{name:"recurring_init",type:"flags.2?true"},{name:"recurring_used",type:"flags.3?true"},{name:"currency",type:"string"},{name:"total_amount",type:"long"},{name:"payload",type:"bytes"},{name:"info",type:"flags.0?PaymentRequestedInfo"},{name:"shipping_option_id",type:"flags.1?string"},{name:"charge",type:"PaymentCharge"}],type:"MessageAction"},{id:-156940077,predicate:"messageMediaInvoice",params:[{name:"flags",type:"#"},{name:"shipping_address_requested",type:"flags.1?true"},{name:"test",type:"flags.3?true"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.0?WebDocument"},{name:"receipt_msg_id",type:"flags.2?int"},{name:"currency",type:"string"},{name:"total_amount",type:"long"},{name:"start_param",type:"string"},{name:"extended_media",type:"flags.4?MessageExtendedMedia"}],type:"MessageMedia"},{id:512535275,predicate:"postAddress",params:[{name:"street_line1",type:"string"},{name:"street_line2",type:"string"},{name:"city",type:"string"},{name:"state",type:"string"},{name:"country_iso2",type:"string"},{name:"post_code",type:"string"}],type:"PostAddress"},{id:-1868808300,predicate:"paymentRequestedInfo",params:[{name:"flags",type:"#"},{name:"name",type:"flags.0?string"},{name:"phone",type:"flags.1?string"},{name:"email",type:"flags.2?string"},{name:"shipping_address",type:"flags.3?PostAddress"}],type:"PaymentRequestedInfo"},{id:-1344716869,predicate:"keyboardButtonBuy",params:[{name:"text",type:"string"}],type:"KeyboardButton"},{id:-1776926890,predicate:"messageActionPaymentSent",params:[{name:"flags",type:"#"},{name:"recurring_init",type:"flags.2?true"},{name:"recurring_used",type:"flags.3?true"},{name:"currency",type:"string"},{name:"total_amount",type:"long"},{name:"invoice_slug",type:"flags.0?string"}],type:"MessageAction"},{id:-842892769,predicate:"paymentSavedCredentialsCard",params:[{name:"id",type:"string"},{name:"title",type:"string"}],type:"PaymentSavedCredentials"},{id:475467473,predicate:"webDocument",params:[{name:"url",type:"string"},{name:"access_hash",type:"long"},{name:"size",type:"int"},{name:"mime_type",type:"string"},{name:"attributes",type:"Vector"}],type:"WebDocument"},{id:-1678949555,predicate:"inputWebDocument",params:[{name:"url",type:"string"},{name:"size",type:"int"},{name:"mime_type",type:"string"},{name:"attributes",type:"Vector"}],type:"InputWebDocument"},{id:-1036396922,predicate:"inputWebFileLocation",params:[{name:"url",type:"string"},{name:"access_hash",type:"long"}],type:"InputWebFileLocation"},{id:568808380,predicate:"upload.webFile",params:[{name:"size",type:"int"},{name:"mime_type",type:"string"},{name:"file_type",type:"storage.FileType"},{name:"mtime",type:"int"},{name:"bytes",type:"bytes"}],type:"upload.WebFile"},{id:-1610250415,predicate:"payments.paymentForm",params:[{name:"flags",type:"#"},{name:"can_save_credentials",type:"flags.2?true"},{name:"password_missing",type:"flags.3?true"},{name:"form_id",type:"long"},{name:"bot_id",type:"long"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.5?WebDocument"},{name:"invoice",type:"Invoice"},{name:"provider_id",type:"long"},{name:"url",type:"string"},{name:"native_provider",type:"flags.4?string"},{name:"native_params",type:"flags.4?DataJSON"},{name:"additional_methods",type:"flags.6?Vector"},{name:"saved_info",type:"flags.0?PaymentRequestedInfo"},{name:"saved_credentials",type:"flags.1?Vector"},{name:"users",type:"Vector"}],type:"payments.PaymentForm"},{id:-784000893,predicate:"payments.validatedRequestedInfo",params:[{name:"flags",type:"#"},{name:"id",type:"flags.0?string"},{name:"shipping_options",type:"flags.1?Vector"}],type:"payments.ValidatedRequestedInfo"},{id:1314881805,predicate:"payments.paymentResult",params:[{name:"updates",type:"Updates"}],type:"payments.PaymentResult"},{id:1891958275,predicate:"payments.paymentReceipt",params:[{name:"flags",type:"#"},{name:"date",type:"int"},{name:"bot_id",type:"long"},{name:"provider_id",type:"long"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.2?WebDocument"},{name:"invoice",type:"Invoice"},{name:"info",type:"flags.0?PaymentRequestedInfo"},{name:"shipping",type:"flags.1?ShippingOption"},{name:"tip_amount",type:"flags.3?long"},{name:"currency",type:"string"},{name:"total_amount",type:"long"},{name:"credentials_title",type:"string"},{name:"users",type:"Vector"}],type:"payments.PaymentReceipt"},{id:-74456004,predicate:"payments.savedInfo",params:[{name:"flags",type:"#"},{name:"has_saved_credentials",type:"flags.1?true"},{name:"saved_info",type:"flags.0?PaymentRequestedInfo"}],type:"payments.SavedInfo"},{id:-1056001329,predicate:"inputPaymentCredentialsSaved",params:[{name:"id",type:"string"},{name:"tmp_password",type:"bytes"}],type:"InputPaymentCredentials"},{id:873977640,predicate:"inputPaymentCredentials",params:[{name:"flags",type:"#"},{name:"save",type:"flags.0?true"},{name:"data",type:"DataJSON"}],type:"InputPaymentCredentials"},{id:-614138572,predicate:"account.tmpPassword",params:[{name:"tmp_password",type:"bytes"},{name:"valid_until",type:"int"}],type:"account.TmpPassword"},{id:-1239335713,predicate:"shippingOption",params:[{name:"id",type:"string"},{name:"title",type:"string"},{name:"prices",type:"Vector"}],type:"ShippingOption"},{id:-1246823043,predicate:"updateBotShippingQuery",params:[{name:"query_id",type:"long"},{name:"user_id",type:"long"},{name:"payload",type:"bytes"},{name:"shipping_address",type:"PostAddress"}],type:"Update"},{id:-1934976362,predicate:"updateBotPrecheckoutQuery",params:[{name:"flags",type:"#"},{name:"query_id",type:"long"},{name:"user_id",type:"long"},{name:"payload",type:"bytes"},{name:"info",type:"flags.0?PaymentRequestedInfo"},{name:"shipping_option_id",type:"flags.1?string"},{name:"currency",type:"string"},{name:"total_amount",type:"long"}],type:"Update"},{id:-6249322,predicate:"inputStickerSetItem",params:[{name:"flags",type:"#"},{name:"document",type:"InputDocument"},{name:"emoji",type:"string"},{name:"mask_coords",type:"flags.0?MaskCoords"}],type:"InputStickerSetItem"},{id:-1425052898,predicate:"updatePhoneCall",params:[{name:"phone_call",type:"PhoneCall"}],type:"Update"},{id:506920429,predicate:"inputPhoneCall",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputPhoneCall"},{id:1399245077,predicate:"phoneCallEmpty",params:[{name:"id",type:"long"}],type:"PhoneCall"},{id:-987599081,predicate:"phoneCallWaiting",params:[{name:"flags",type:"#"},{name:"video",type:"flags.6?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"protocol",type:"PhoneCallProtocol"},{name:"receive_date",type:"flags.0?int"}],type:"PhoneCall"},{id:347139340,predicate:"phoneCallRequested",params:[{name:"flags",type:"#"},{name:"video",type:"flags.6?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"g_a_hash",type:"bytes"},{name:"protocol",type:"PhoneCallProtocol"}],type:"PhoneCall"},{id:912311057,predicate:"phoneCallAccepted",params:[{name:"flags",type:"#"},{name:"video",type:"flags.6?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"g_b",type:"bytes"},{name:"protocol",type:"PhoneCallProtocol"}],type:"PhoneCall"},{id:-1770029977,predicate:"phoneCall",params:[{name:"flags",type:"#"},{name:"p2p_allowed",type:"flags.5?true"},{name:"video",type:"flags.6?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"g_a_or_b",type:"bytes"},{name:"key_fingerprint",type:"long"},{name:"protocol",type:"PhoneCallProtocol"},{name:"connections",type:"Vector"},{name:"start_date",type:"int"}],type:"PhoneCall"},{id:1355435489,predicate:"phoneCallDiscarded",params:[{name:"flags",type:"#"},{name:"need_rating",type:"flags.2?true"},{name:"need_debug",type:"flags.3?true"},{name:"video",type:"flags.6?true"},{name:"id",type:"long"},{name:"reason",type:"flags.0?PhoneCallDiscardReason"},{name:"duration",type:"flags.1?int"}],type:"PhoneCall"},{id:-1665063993,predicate:"phoneConnection",params:[{name:"flags",type:"#"},{name:"tcp",type:"flags.0?true"},{name:"id",type:"long"},{name:"ip",type:"string"},{name:"ipv6",type:"string"},{name:"port",type:"int"},{name:"peer_tag",type:"bytes"}],type:"PhoneConnection"},{id:-58224696,predicate:"phoneCallProtocol",params:[{name:"flags",type:"#"},{name:"udp_p2p",type:"flags.0?true"},{name:"udp_reflector",type:"flags.1?true"},{name:"min_layer",type:"int"},{name:"max_layer",type:"int"},{name:"library_versions",type:"Vector"}],type:"PhoneCallProtocol"},{id:-326966976,predicate:"phone.phoneCall",params:[{name:"phone_call",type:"PhoneCall"},{name:"users",type:"Vector"}],type:"phone.PhoneCall"},{id:-2134272152,predicate:"inputMessagesFilterPhoneCalls",params:[{name:"flags",type:"#"},{name:"missed",type:"flags.0?true"}],type:"MessagesFilter"},{id:-2132731265,predicate:"messageActionPhoneCall",params:[{name:"flags",type:"#"},{name:"video",type:"flags.2?true"},{name:"call_id",type:"long"},{name:"reason",type:"flags.0?PhoneCallDiscardReason"},{name:"duration",type:"flags.1?int"}],type:"MessageAction"},{id:2054952868,predicate:"inputMessagesFilterRoundVoice",params:[],type:"MessagesFilter"},{id:-1253451181,predicate:"inputMessagesFilterRoundVideo",params:[],type:"MessagesFilter"},{id:-1997373508,predicate:"sendMessageRecordRoundAction",params:[],type:"SendMessageAction"},{id:608050278,predicate:"sendMessageUploadRoundAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:-242427324,predicate:"upload.fileCdnRedirect",params:[{name:"dc_id",type:"int"},{name:"file_token",type:"bytes"},{name:"encryption_key",type:"bytes"},{name:"encryption_iv",type:"bytes"},{name:"file_hashes",type:"Vector"}],type:"upload.File"},{id:-290921362,predicate:"upload.cdnFileReuploadNeeded",params:[{name:"request_token",type:"bytes"}],type:"upload.CdnFile"},{id:-1449145777,predicate:"upload.cdnFile",params:[{name:"bytes",type:"bytes"}],type:"upload.CdnFile"},{id:-914167110,predicate:"cdnPublicKey",params:[{name:"dc_id",type:"int"},{name:"public_key",type:"string"}],type:"CdnPublicKey"},{id:1462101002,predicate:"cdnConfig",params:[{name:"public_keys",type:"Vector"}],type:"CdnConfig"},{id:-283684427,predicate:"pageBlockChannel",params:[{name:"channel",type:"Chat"}],type:"PageBlock"},{id:-892239370,predicate:"langPackString",params:[{name:"key",type:"string"},{name:"value",type:"string"}],type:"LangPackString"},{id:1816636575,predicate:"langPackStringPluralized",params:[{name:"flags",type:"#"},{name:"key",type:"string"},{name:"zero_value",type:"flags.0?string"},{name:"one_value",type:"flags.1?string"},{name:"two_value",type:"flags.2?string"},{name:"few_value",type:"flags.3?string"},{name:"many_value",type:"flags.4?string"},{name:"other_value",type:"string"}],type:"LangPackString"},{id:695856818,predicate:"langPackStringDeleted",params:[{name:"key",type:"string"}],type:"LangPackString"},{id:-209337866,predicate:"langPackDifference",params:[{name:"lang_code",type:"string"},{name:"from_version",type:"int"},{name:"version",type:"int"},{name:"strings",type:"Vector"}],type:"LangPackDifference"},{id:-288727837,predicate:"langPackLanguage",params:[{name:"flags",type:"#"},{name:"official",type:"flags.0?true"},{name:"rtl",type:"flags.2?true"},{name:"beta",type:"flags.3?true"},{name:"name",type:"string"},{name:"native_name",type:"string"},{name:"lang_code",type:"string"},{name:"base_lang_code",type:"flags.1?string"},{name:"plural_code",type:"string"},{name:"strings_count",type:"int"},{name:"translated_count",type:"int"},{name:"translations_url",type:"string"}],type:"LangPackLanguage"},{id:1180041828,predicate:"updateLangPackTooLong",params:[{name:"lang_code",type:"string"}],type:"Update"},{id:1442983757,predicate:"updateLangPack",params:[{name:"difference",type:"LangPackDifference"}],type:"Update"},{id:885242707,predicate:"channelParticipantAdmin",params:[{name:"flags",type:"#"},{name:"can_edit",type:"flags.0?true"},{name:"self",type:"flags.1?true"},{name:"user_id",type:"long"},{name:"inviter_id",type:"flags.1?long"},{name:"promoted_by",type:"long"},{name:"date",type:"int"},{name:"admin_rights",type:"ChatAdminRights"},{name:"rank",type:"flags.2?string"}],type:"ChannelParticipant"},{id:1844969806,predicate:"channelParticipantBanned",params:[{name:"flags",type:"#"},{name:"left",type:"flags.0?true"},{name:"peer",type:"Peer"},{name:"kicked_by",type:"long"},{name:"date",type:"int"},{name:"banned_rights",type:"ChatBannedRights"}],type:"ChannelParticipant"},{id:338142689,predicate:"channelParticipantsBanned",params:[{name:"q",type:"string"}],type:"ChannelParticipantsFilter"},{id:106343499,predicate:"channelParticipantsSearch",params:[{name:"q",type:"string"}],type:"ChannelParticipantsFilter"},{id:-421545947,predicate:"channelAdminLogEventActionChangeTitle",params:[{name:"prev_value",type:"string"},{name:"new_value",type:"string"}],type:"ChannelAdminLogEventAction"},{id:1427671598,predicate:"channelAdminLogEventActionChangeAbout",params:[{name:"prev_value",type:"string"},{name:"new_value",type:"string"}],type:"ChannelAdminLogEventAction"},{id:1783299128,predicate:"channelAdminLogEventActionChangeUsername",params:[{name:"prev_value",type:"string"},{name:"new_value",type:"string"}],type:"ChannelAdminLogEventAction"},{id:1129042607,predicate:"channelAdminLogEventActionChangePhoto",params:[{name:"prev_photo",type:"Photo"},{name:"new_photo",type:"Photo"}],type:"ChannelAdminLogEventAction"},{id:460916654,predicate:"channelAdminLogEventActionToggleInvites",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:648939889,predicate:"channelAdminLogEventActionToggleSignatures",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:-370660328,predicate:"channelAdminLogEventActionUpdatePinned",params:[{name:"message",type:"Message"}],type:"ChannelAdminLogEventAction"},{id:1889215493,predicate:"channelAdminLogEventActionEditMessage",params:[{name:"prev_message",type:"Message"},{name:"new_message",type:"Message"}],type:"ChannelAdminLogEventAction"},{id:1121994683,predicate:"channelAdminLogEventActionDeleteMessage",params:[{name:"message",type:"Message"}],type:"ChannelAdminLogEventAction"},{id:405815507,predicate:"channelAdminLogEventActionParticipantJoin",params:[],type:"ChannelAdminLogEventAction"},{id:-124291086,predicate:"channelAdminLogEventActionParticipantLeave",params:[],type:"ChannelAdminLogEventAction"},{id:-484690728,predicate:"channelAdminLogEventActionParticipantInvite",params:[{name:"participant",type:"ChannelParticipant"}],type:"ChannelAdminLogEventAction"},{id:-422036098,predicate:"channelAdminLogEventActionParticipantToggleBan",params:[{name:"prev_participant",type:"ChannelParticipant"},{name:"new_participant",type:"ChannelParticipant"}],type:"ChannelAdminLogEventAction"},{id:-714643696,predicate:"channelAdminLogEventActionParticipantToggleAdmin",params:[{name:"prev_participant",type:"ChannelParticipant"},{name:"new_participant",type:"ChannelParticipant"}],type:"ChannelAdminLogEventAction"},{id:531458253,predicate:"channelAdminLogEvent",params:[{name:"id",type:"long"},{name:"date",type:"int"},{name:"user_id",type:"long"},{name:"action",type:"ChannelAdminLogEventAction"}],type:"ChannelAdminLogEvent"},{id:-309659827,predicate:"channels.adminLogResults",params:[{name:"events",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"channels.AdminLogResults"},{id:-368018716,predicate:"channelAdminLogEventsFilter",params:[{name:"flags",type:"#"},{name:"join",type:"flags.0?true"},{name:"leave",type:"flags.1?true"},{name:"invite",type:"flags.2?true"},{name:"ban",type:"flags.3?true"},{name:"unban",type:"flags.4?true"},{name:"kick",type:"flags.5?true"},{name:"unkick",type:"flags.6?true"},{name:"promote",type:"flags.7?true"},{name:"demote",type:"flags.8?true"},{name:"info",type:"flags.9?true"},{name:"settings",type:"flags.10?true"},{name:"pinned",type:"flags.11?true"},{name:"edit",type:"flags.12?true"},{name:"delete",type:"flags.13?true"},{name:"group_call",type:"flags.14?true"},{name:"invites",type:"flags.15?true"},{name:"send",type:"flags.16?true"},{name:"forums",type:"flags.17?true"}],type:"ChannelAdminLogEventsFilter"},{id:511092620,predicate:"topPeerCategoryPhoneCalls",params:[],type:"TopPeerCategory"},{id:-2143067670,predicate:"pageBlockAudio",params:[{name:"audio_id",type:"long"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:1558266229,predicate:"popularContact",params:[{name:"client_id",type:"long"},{name:"importers",type:"int"}],type:"PopularContact"},{id:1200788123,predicate:"messageActionScreenshotTaken",params:[],type:"MessageAction"},{id:-1634752813,predicate:"messages.favedStickersNotModified",params:[],type:"messages.FavedStickers"},{id:750063767,predicate:"messages.favedStickers",params:[{name:"hash",type:"long"},{name:"packs",type:"Vector"},{name:"stickers",type:"Vector"}],type:"messages.FavedStickers"},{id:-451831443,predicate:"updateFavedStickers",params:[],type:"Update"},{id:-366410403,predicate:"updateChannelReadMessagesContents",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"top_msg_id",type:"flags.0?int"},{name:"messages",type:"Vector"}],type:"Update"},{id:-1040652646,predicate:"inputMessagesFilterMyMentions",params:[],type:"MessagesFilter"},{id:1887741886,predicate:"updateContactsReset",params:[],type:"Update"},{id:-1312568665,predicate:"channelAdminLogEventActionChangeStickerSet",params:[{name:"prev_stickerset",type:"InputStickerSet"},{name:"new_stickerset",type:"InputStickerSet"}],type:"ChannelAdminLogEventAction"},{id:-85549226,predicate:"messageActionCustomAction",params:[{name:"message",type:"string"}],type:"MessageAction"},{id:178373535,predicate:"inputPaymentCredentialsApplePay",params:[{name:"payment_data",type:"DataJSON"}],type:"InputPaymentCredentials"},{id:-419271411,predicate:"inputMessagesFilterGeo",params:[],type:"MessagesFilter"},{id:-530392189,predicate:"inputMessagesFilterContacts",params:[],type:"MessagesFilter"},{id:-1304443240,predicate:"updateChannelAvailableMessages",params:[{name:"channel_id",type:"long"},{name:"available_min_id",type:"int"}],type:"Update"},{id:1599903217,predicate:"channelAdminLogEventActionTogglePreHistoryHidden",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:-1759532989,predicate:"inputMediaGeoLive",params:[{name:"flags",type:"#"},{name:"stopped",type:"flags.0?true"},{name:"geo_point",type:"InputGeoPoint"},{name:"heading",type:"flags.2?int"},{name:"period",type:"flags.1?int"},{name:"proximity_notification_radius",type:"flags.3?int"}],type:"InputMedia"},{id:-1186937242,predicate:"messageMediaGeoLive",params:[{name:"flags",type:"#"},{name:"geo",type:"GeoPoint"},{name:"heading",type:"flags.0?int"},{name:"period",type:"int"},{name:"proximity_notification_radius",type:"flags.1?int"}],type:"MessageMedia"},{id:1189204285,predicate:"recentMeUrlUnknown",params:[{name:"url",type:"string"}],type:"RecentMeUrl"},{id:-1188296222,predicate:"recentMeUrlUser",params:[{name:"url",type:"string"},{name:"user_id",type:"long"}],type:"RecentMeUrl"},{id:-1294306862,predicate:"recentMeUrlChat",params:[{name:"url",type:"string"},{name:"chat_id",type:"long"}],type:"RecentMeUrl"},{id:-347535331,predicate:"recentMeUrlChatInvite",params:[{name:"url",type:"string"},{name:"chat_invite",type:"ChatInvite"}],type:"RecentMeUrl"},{id:-1140172836,predicate:"recentMeUrlStickerSet",params:[{name:"url",type:"string"},{name:"set",type:"StickerSetCovered"}],type:"RecentMeUrl"},{id:235081943,predicate:"help.recentMeUrls",params:[{name:"urls",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"help.RecentMeUrls"},{id:-266911767,predicate:"channels.channelParticipantsNotModified",params:[],type:"channels.ChannelParticipants"},{id:1951620897,predicate:"messages.messagesNotModified",params:[{name:"count",type:"int"}],type:"messages.Messages"},{id:482797855,predicate:"inputSingleMedia",params:[{name:"flags",type:"#"},{name:"media",type:"InputMedia"},{name:"random_id",type:"long"},{name:"message",type:"string"},{name:"entities",type:"flags.0?Vector"}],type:"InputSingleMedia"},{id:-1493633966,predicate:"webAuthorization",params:[{name:"hash",type:"long"},{name:"bot_id",type:"long"},{name:"domain",type:"string"},{name:"browser",type:"string"},{name:"platform",type:"string"},{name:"date_created",type:"int"},{name:"date_active",type:"int"},{name:"ip",type:"string"},{name:"region",type:"string"}],type:"WebAuthorization"},{id:-313079300,predicate:"account.webAuthorizations",params:[{name:"authorizations",type:"Vector"},{name:"users",type:"Vector"}],type:"account.WebAuthorizations"},{id:-1502174430,predicate:"inputMessageID",params:[{name:"id",type:"int"}],type:"InputMessage"},{id:-1160215659,predicate:"inputMessageReplyTo",params:[{name:"id",type:"int"}],type:"InputMessage"},{id:-2037963464,predicate:"inputMessagePinned",params:[],type:"InputMessage"},{id:-1687559349,predicate:"messageEntityPhone",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1280209983,predicate:"messageEntityCashtag",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-1410748418,predicate:"messageActionBotAllowed",params:[{name:"domain",type:"string"}],type:"MessageAction"},{id:-55902537,predicate:"inputDialogPeer",params:[{name:"peer",type:"InputPeer"}],type:"InputDialogPeer"},{id:-445792507,predicate:"dialogPeer",params:[{name:"peer",type:"Peer"}],type:"DialogPeer"},{id:223655517,predicate:"messages.foundStickerSetsNotModified",params:[],type:"messages.FoundStickerSets"},{id:-1963942446,predicate:"messages.foundStickerSets",params:[{name:"hash",type:"long"},{name:"sets",type:"Vector"}],type:"messages.FoundStickerSets"},{id:-207944868,predicate:"fileHash",params:[{name:"offset",type:"long"},{name:"limit",type:"int"},{name:"hash",type:"bytes"}],type:"FileHash"},{id:-104284986,predicate:"webDocumentNoProxy",params:[{name:"url",type:"string"},{name:"size",type:"int"},{name:"mime_type",type:"string"},{name:"attributes",type:"Vector"}],type:"WebDocument"},{id:1968737087,predicate:"inputClientProxy",params:[{name:"address",type:"string"},{name:"port",type:"int"}],type:"InputClientProxy"},{id:-483352705,predicate:"help.termsOfServiceUpdateEmpty",params:[{name:"expires",type:"int"}],type:"help.TermsOfServiceUpdate"},{id:686618977,predicate:"help.termsOfServiceUpdate",params:[{name:"expires",type:"int"},{name:"terms_of_service",type:"help.TermsOfService"}],type:"help.TermsOfServiceUpdate"},{id:859091184,predicate:"inputSecureFileUploaded",params:[{name:"id",type:"long"},{name:"parts",type:"int"},{name:"md5_checksum",type:"string"},{name:"file_hash",type:"bytes"},{name:"secret",type:"bytes"}],type:"InputSecureFile"},{id:1399317950,predicate:"inputSecureFile",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputSecureFile"},{id:-876089816,predicate:"inputSecureFileLocation",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputFileLocation"},{id:1679398724,predicate:"secureFileEmpty",params:[],type:"SecureFile"},{id:2097791614,predicate:"secureFile",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"size",type:"long"},{name:"dc_id",type:"int"},{name:"date",type:"int"},{name:"file_hash",type:"bytes"},{name:"secret",type:"bytes"}],type:"SecureFile"},{id:-1964327229,predicate:"secureData",params:[{name:"data",type:"bytes"},{name:"data_hash",type:"bytes"},{name:"secret",type:"bytes"}],type:"SecureData"},{id:2103482845,predicate:"securePlainPhone",params:[{name:"phone",type:"string"}],type:"SecurePlainData"},{id:569137759,predicate:"securePlainEmail",params:[{name:"email",type:"string"}],type:"SecurePlainData"},{id:-1658158621,predicate:"secureValueTypePersonalDetails",params:[],type:"SecureValueType"},{id:1034709504,predicate:"secureValueTypePassport",params:[],type:"SecureValueType"},{id:115615172,predicate:"secureValueTypeDriverLicense",params:[],type:"SecureValueType"},{id:-1596951477,predicate:"secureValueTypeIdentityCard",params:[],type:"SecureValueType"},{id:-1717268701,predicate:"secureValueTypeInternalPassport",params:[],type:"SecureValueType"},{id:-874308058,predicate:"secureValueTypeAddress",params:[],type:"SecureValueType"},{id:-63531698,predicate:"secureValueTypeUtilityBill",params:[],type:"SecureValueType"},{id:-1995211763,predicate:"secureValueTypeBankStatement",params:[],type:"SecureValueType"},{id:-1954007928,predicate:"secureValueTypeRentalAgreement",params:[],type:"SecureValueType"},{id:-1713143702,predicate:"secureValueTypePassportRegistration",params:[],type:"SecureValueType"},{id:-368907213,predicate:"secureValueTypeTemporaryRegistration",params:[],type:"SecureValueType"},{id:-1289704741,predicate:"secureValueTypePhone",params:[],type:"SecureValueType"},{id:-1908627474,predicate:"secureValueTypeEmail",params:[],type:"SecureValueType"},{id:411017418,predicate:"secureValue",params:[{name:"flags",type:"#"},{name:"type",type:"SecureValueType"},{name:"data",type:"flags.0?SecureData"},{name:"front_side",type:"flags.1?SecureFile"},{name:"reverse_side",type:"flags.2?SecureFile"},{name:"selfie",type:"flags.3?SecureFile"},{name:"translation",type:"flags.6?Vector"},{name:"files",type:"flags.4?Vector"},{name:"plain_data",type:"flags.5?SecurePlainData"},{name:"hash",type:"bytes"}],type:"SecureValue"},{id:-618540889,predicate:"inputSecureValue",params:[{name:"flags",type:"#"},{name:"type",type:"SecureValueType"},{name:"data",type:"flags.0?SecureData"},{name:"front_side",type:"flags.1?InputSecureFile"},{name:"reverse_side",type:"flags.2?InputSecureFile"},{name:"selfie",type:"flags.3?InputSecureFile"},{name:"translation",type:"flags.6?Vector"},{name:"files",type:"flags.4?Vector"},{name:"plain_data",type:"flags.5?SecurePlainData"}],type:"InputSecureValue"},{id:-316748368,predicate:"secureValueHash",params:[{name:"type",type:"SecureValueType"},{name:"hash",type:"bytes"}],type:"SecureValueHash"},{id:-391902247,predicate:"secureValueErrorData",params:[{name:"type",type:"SecureValueType"},{name:"data_hash",type:"bytes"},{name:"field",type:"string"},{name:"text",type:"string"}],type:"SecureValueError"},{id:12467706,predicate:"secureValueErrorFrontSide",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:-2037765467,predicate:"secureValueErrorReverseSide",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:-449327402,predicate:"secureValueErrorSelfie",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:2054162547,predicate:"secureValueErrorFile",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:1717706985,predicate:"secureValueErrorFiles",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"Vector"},{name:"text",type:"string"}],type:"SecureValueError"},{id:871426631,predicate:"secureCredentialsEncrypted",params:[{name:"data",type:"bytes"},{name:"hash",type:"bytes"},{name:"secret",type:"bytes"}],type:"SecureCredentialsEncrypted"},{id:-1389486888,predicate:"account.authorizationForm",params:[{name:"flags",type:"#"},{name:"required_types",type:"Vector"},{name:"values",type:"Vector"},{name:"errors",type:"Vector"},{name:"users",type:"Vector"},{name:"privacy_policy_url",type:"flags.0?string"}],type:"account.AuthorizationForm"},{id:-2128640689,predicate:"account.sentEmailCode",params:[{name:"email_pattern",type:"string"},{name:"length",type:"int"}],type:"account.SentEmailCode"},{id:455635795,predicate:"messageActionSecureValuesSentMe",params:[{name:"values",type:"Vector"},{name:"credentials",type:"SecureCredentialsEncrypted"}],type:"MessageAction"},{id:-648257196,predicate:"messageActionSecureValuesSent",params:[{name:"types",type:"Vector"}],type:"MessageAction"},{id:1722786150,predicate:"help.deepLinkInfoEmpty",params:[],type:"help.DeepLinkInfo"},{id:1783556146,predicate:"help.deepLinkInfo",params:[{name:"flags",type:"#"},{name:"update_app",type:"flags.0?true"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector"}],type:"help.DeepLinkInfo"},{id:289586518,predicate:"savedPhoneContact",params:[{name:"phone",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"date",type:"int"}],type:"SavedContact"},{id:1304052993,predicate:"account.takeout",params:[{name:"id",type:"long"}],type:"account.Takeout"},{id:700340377,predicate:"inputTakeoutFileLocation",params:[],type:"InputFileLocation"},{id:-513517117,predicate:"updateDialogUnreadMark",params:[{name:"flags",type:"#"},{name:"unread",type:"flags.0?true"},{name:"peer",type:"DialogPeer"}],type:"Update"},{id:-253500010,predicate:"messages.dialogsNotModified",params:[{name:"count",type:"int"}],type:"messages.Dialogs"},{id:-1625153079,predicate:"inputWebFileGeoPointLocation",params:[{name:"geo_point",type:"InputGeoPoint"},{name:"access_hash",type:"long"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"zoom",type:"int"},{name:"scale",type:"int"}],type:"InputWebFileLocation"},{id:-1255369827,predicate:"contacts.topPeersDisabled",params:[],type:"contacts.TopPeers"},{id:-1685456582,predicate:"inputReportReasonCopyright",params:[],type:"ReportReason"},{id:-732254058,predicate:"passwordKdfAlgoUnknown",params:[],type:"PasswordKdfAlgo"},{id:4883767,predicate:"securePasswordKdfAlgoUnknown",params:[],type:"SecurePasswordKdfAlgo"},{id:-1141711456,predicate:"securePasswordKdfAlgoPBKDF2HMACSHA512iter100000",params:[{name:"salt",type:"bytes"}],type:"SecurePasswordKdfAlgo"},{id:-2042159726,predicate:"securePasswordKdfAlgoSHA512",params:[{name:"salt",type:"bytes"}],type:"SecurePasswordKdfAlgo"},{id:354925740,predicate:"secureSecretSettings",params:[{name:"secure_algo",type:"SecurePasswordKdfAlgo"},{name:"secure_secret",type:"bytes"},{name:"secure_secret_id",type:"long"}],type:"SecureSecretSettings"},{id:982592842,predicate:"passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow",params:[{name:"salt1",type:"bytes"},{name:"salt2",type:"bytes"},{name:"g",type:"int"},{name:"p",type:"bytes"}],type:"PasswordKdfAlgo"},{id:-1736378792,predicate:"inputCheckPasswordEmpty",params:[],type:"InputCheckPasswordSRP"},{id:-763367294,predicate:"inputCheckPasswordSRP",params:[{name:"srp_id",type:"long"},{name:"A",type:"bytes"},{name:"M1",type:"bytes"}],type:"InputCheckPasswordSRP"},{id:-2036501105,predicate:"secureValueError",params:[{name:"type",type:"SecureValueType"},{name:"hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:-1592506512,predicate:"secureValueErrorTranslationFile",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:878931416,predicate:"secureValueErrorTranslationFiles",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"Vector"},{name:"text",type:"string"}],type:"SecureValueError"},{id:-2103600678,predicate:"secureRequiredType",params:[{name:"flags",type:"#"},{name:"native_names",type:"flags.0?true"},{name:"selfie_required",type:"flags.1?true"},{name:"translation_required",type:"flags.2?true"},{name:"type",type:"SecureValueType"}],type:"SecureRequiredType"},{id:41187252,predicate:"secureRequiredTypeOneOf",params:[{name:"types",type:"Vector"}],type:"SecureRequiredType"},{id:-1078332329,predicate:"help.passportConfigNotModified",params:[],type:"help.PassportConfig"},{id:-1600596305,predicate:"help.passportConfig",params:[{name:"hash",type:"int"},{name:"countries_langs",type:"DataJSON"}],type:"help.PassportConfig"},{id:488313413,predicate:"inputAppEvent",params:[{name:"time",type:"double"},{name:"type",type:"string"},{name:"peer",type:"long"},{name:"data",type:"JSONValue"}],type:"InputAppEvent"},{id:-1059185703,predicate:"jsonObjectValue",params:[{name:"key",type:"string"},{name:"value",type:"JSONValue"}],type:"JSONObjectValue"},{id:1064139624,predicate:"jsonNull",params:[],type:"JSONValue"},{id:-952869270,predicate:"jsonBool",params:[{name:"value",type:"Bool"}],type:"JSONValue"},{id:736157604,predicate:"jsonNumber",params:[{name:"value",type:"double"}],type:"JSONValue"},{id:-1222740358,predicate:"jsonString",params:[{name:"value",type:"string"}],type:"JSONValue"},{id:-146520221,predicate:"jsonArray",params:[{name:"value",type:"Vector"}],type:"JSONValue"},{id:-1715350371,predicate:"jsonObject",params:[{name:"value",type:"Vector"}],type:"JSONValue"},{id:-1311015810,predicate:"inputNotifyBroadcasts",params:[],type:"InputNotifyPeer"},{id:-703403793,predicate:"notifyBroadcasts",params:[],type:"NotifyPeer"},{id:-311786236,predicate:"textSubscript",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:-939827711,predicate:"textSuperscript",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:55281185,predicate:"textMarked",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:483104362,predicate:"textPhone",params:[{name:"text",type:"RichText"},{name:"phone",type:"string"}],type:"RichText"},{id:136105807,predicate:"textImage",params:[{name:"document_id",type:"long"},{name:"w",type:"int"},{name:"h",type:"int"}],type:"RichText"},{id:504660880,predicate:"pageBlockKicker",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:878078826,predicate:"pageTableCell",params:[{name:"flags",type:"#"},{name:"header",type:"flags.0?true"},{name:"align_center",type:"flags.3?true"},{name:"align_right",type:"flags.4?true"},{name:"valign_middle",type:"flags.5?true"},{name:"valign_bottom",type:"flags.6?true"},{name:"text",type:"flags.7?RichText"},{name:"colspan",type:"flags.1?int"},{name:"rowspan",type:"flags.2?int"}],type:"PageTableCell"},{id:-524237339,predicate:"pageTableRow",params:[{name:"cells",type:"Vector"}],type:"PageTableRow"},{id:-1085412734,predicate:"pageBlockTable",params:[{name:"flags",type:"#"},{name:"bordered",type:"flags.0?true"},{name:"striped",type:"flags.1?true"},{name:"title",type:"RichText"},{name:"rows",type:"Vector"}],type:"PageBlock"},{id:1869903447,predicate:"pageCaption",params:[{name:"text",type:"RichText"},{name:"credit",type:"RichText"}],type:"PageCaption"},{id:-1188055347,predicate:"pageListItemText",params:[{name:"text",type:"RichText"}],type:"PageListItem"},{id:635466748,predicate:"pageListItemBlocks",params:[{name:"blocks",type:"Vector"}],type:"PageListItem"},{id:1577484359,predicate:"pageListOrderedItemText",params:[{name:"num",type:"string"},{name:"text",type:"RichText"}],type:"PageListOrderedItem"},{id:-1730311882,predicate:"pageListOrderedItemBlocks",params:[{name:"num",type:"string"},{name:"blocks",type:"Vector"}],type:"PageListOrderedItem"},{id:-1702174239,predicate:"pageBlockOrderedList",params:[{name:"items",type:"Vector"}],type:"PageBlock"},{id:1987480557,predicate:"pageBlockDetails",params:[{name:"flags",type:"#"},{name:"open",type:"flags.0?true"},{name:"blocks",type:"Vector"},{name:"title",type:"RichText"}],type:"PageBlock"},{id:-1282352120,predicate:"pageRelatedArticle",params:[{name:"flags",type:"#"},{name:"url",type:"string"},{name:"webpage_id",type:"long"},{name:"title",type:"flags.0?string"},{name:"description",type:"flags.1?string"},{name:"photo_id",type:"flags.2?long"},{name:"author",type:"flags.3?string"},{name:"published_date",type:"flags.4?int"}],type:"PageRelatedArticle"},{id:370236054,predicate:"pageBlockRelatedArticles",params:[{name:"title",type:"RichText"},{name:"articles",type:"Vector"}],type:"PageBlock"},{id:-1538310410,predicate:"pageBlockMap",params:[{name:"geo",type:"GeoPoint"},{name:"zoom",type:"int"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:-1738178803,predicate:"page",params:[{name:"flags",type:"#"},{name:"part",type:"flags.0?true"},{name:"rtl",type:"flags.1?true"},{name:"v2",type:"flags.2?true"},{name:"url",type:"string"},{name:"blocks",type:"Vector"},{name:"photos",type:"Vector"},{name:"documents",type:"Vector"},{name:"views",type:"flags.3?int"}],type:"Page"},{id:-610373422,predicate:"inputPrivacyKeyPhoneP2P",params:[],type:"InputPrivacyKey"},{id:961092808,predicate:"privacyKeyPhoneP2P",params:[],type:"PrivacyKey"},{id:894777186,predicate:"textAnchor",params:[{name:"text",type:"RichText"},{name:"name",type:"string"}],type:"RichText"},{id:-1945767479,predicate:"help.supportName",params:[{name:"name",type:"string"}],type:"help.SupportName"},{id:-206688531,predicate:"help.userInfoEmpty",params:[],type:"help.UserInfo"},{id:32192344,predicate:"help.userInfo",params:[{name:"message",type:"string"},{name:"entities",type:"Vector"},{name:"author",type:"string"},{name:"date",type:"int"}],type:"help.UserInfo"},{id:-202219658,predicate:"messageActionContactSignUp",params:[],type:"MessageAction"},{id:-1398708869,predicate:"updateMessagePoll",params:[{name:"flags",type:"#"},{name:"poll_id",type:"long"},{name:"poll",type:"flags.0?Poll"},{name:"results",type:"PollResults"}],type:"Update"},{id:1823064809,predicate:"pollAnswer",params:[{name:"text",type:"string"},{name:"option",type:"bytes"}],type:"PollAnswer"},{id:-2032041631,predicate:"poll",params:[{name:"id",type:"long"},{name:"flags",type:"#"},{name:"closed",type:"flags.0?true"},{name:"public_voters",type:"flags.1?true"},{name:"multiple_choice",type:"flags.2?true"},{name:"quiz",type:"flags.3?true"},{name:"question",type:"string"},{name:"answers",type:"Vector"},{name:"close_period",type:"flags.4?int"},{name:"close_date",type:"flags.5?int"}],type:"Poll"},{id:997055186,predicate:"pollAnswerVoters",params:[{name:"flags",type:"#"},{name:"chosen",type:"flags.0?true"},{name:"correct",type:"flags.1?true"},{name:"option",type:"bytes"},{name:"voters",type:"int"}],type:"PollAnswerVoters"},{id:-591909213,predicate:"pollResults",params:[{name:"flags",type:"#"},{name:"min",type:"flags.0?true"},{name:"results",type:"flags.1?Vector"},{name:"total_voters",type:"flags.2?int"},{name:"recent_voters",type:"flags.3?Vector"},{name:"solution",type:"flags.4?string"},{name:"solution_entities",type:"flags.4?Vector"}],type:"PollResults"},{id:261416433,predicate:"inputMediaPoll",params:[{name:"flags",type:"#"},{name:"poll",type:"Poll"},{name:"correct_answers",type:"flags.0?Vector"},{name:"solution",type:"flags.1?string"},{name:"solution_entities",type:"flags.1?Vector"}],type:"InputMedia"},{id:1272375192,predicate:"messageMediaPoll",params:[{name:"poll",type:"Poll"},{name:"results",type:"PollResults"}],type:"MessageMedia"},{id:-264117680,predicate:"chatOnlines",params:[{name:"onlines",type:"int"}],type:"ChatOnlines"},{id:1202287072,predicate:"statsURL",params:[{name:"url",type:"string"}],type:"StatsURL"},{id:-525288402,predicate:"photoStrippedSize",params:[{name:"type",type:"string"},{name:"bytes",type:"bytes"}],type:"PhotoSize"},{id:1605510357,predicate:"chatAdminRights",params:[{name:"flags",type:"#"},{name:"change_info",type:"flags.0?true"},{name:"post_messages",type:"flags.1?true"},{name:"edit_messages",type:"flags.2?true"},{name:"delete_messages",type:"flags.3?true"},{name:"ban_users",type:"flags.4?true"},{name:"invite_users",type:"flags.5?true"},{name:"pin_messages",type:"flags.7?true"},{name:"add_admins",type:"flags.9?true"},{name:"anonymous",type:"flags.10?true"},{name:"manage_call",type:"flags.11?true"},{name:"other",type:"flags.12?true"},{name:"manage_topics",type:"flags.13?true"}],type:"ChatAdminRights"},{id:-1626209256,predicate:"chatBannedRights",params:[{name:"flags",type:"#"},{name:"view_messages",type:"flags.0?true"},{name:"send_messages",type:"flags.1?true"},{name:"send_media",type:"flags.2?true"},{name:"send_stickers",type:"flags.3?true"},{name:"send_gifs",type:"flags.4?true"},{name:"send_games",type:"flags.5?true"},{name:"send_inline",type:"flags.6?true"},{name:"embed_links",type:"flags.7?true"},{name:"send_polls",type:"flags.8?true"},{name:"change_info",type:"flags.10?true"},{name:"invite_users",type:"flags.15?true"},{name:"pin_messages",type:"flags.17?true"},{name:"manage_topics",type:"flags.18?true"},{name:"send_photos",type:"flags.19?true"},{name:"send_videos",type:"flags.20?true"},{name:"send_roundvideos",type:"flags.21?true"},{name:"send_audios",type:"flags.22?true"},{name:"send_voices",type:"flags.23?true"},{name:"send_docs",type:"flags.24?true"},{name:"send_plain",type:"flags.25?true"},{name:"until_date",type:"int"}],type:"ChatBannedRights"},{id:1421875280,predicate:"updateChatDefaultBannedRights",params:[{name:"peer",type:"Peer"},{name:"default_banned_rights",type:"ChatBannedRights"},{name:"version",type:"int"}],type:"Update"},{id:-433014407,predicate:"inputWallPaper",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputWallPaper"},{id:1913199744,predicate:"inputWallPaperSlug",params:[{name:"slug",type:"string"}],type:"InputWallPaper"},{id:-1150621555,predicate:"channelParticipantsContacts",params:[{name:"q",type:"string"}],type:"ChannelParticipantsFilter"},{id:771095562,predicate:"channelAdminLogEventActionDefaultBannedRights",params:[{name:"prev_banned_rights",type:"ChatBannedRights"},{name:"new_banned_rights",type:"ChatBannedRights"}],type:"ChannelAdminLogEventAction"},{id:-1895328189,predicate:"channelAdminLogEventActionStopPoll",params:[{name:"message",type:"Message"}],type:"ChannelAdminLogEventAction"},{id:471437699,predicate:"account.wallPapersNotModified",params:[],type:"account.WallPapers"},{id:-842824308,predicate:"account.wallPapers",params:[{name:"hash",type:"long"},{name:"wallpapers",type:"Vector"}],type:"account.WallPapers"},{id:-1390068360,predicate:"codeSettings",params:[{name:"flags",type:"#"},{name:"allow_flashcall",type:"flags.0?true"},{name:"current_number",type:"flags.1?true"},{name:"allow_app_hash",type:"flags.4?true"},{name:"allow_missed_call",type:"flags.5?true"},{name:"allow_firebase",type:"flags.7?true"},{name:"logout_tokens",type:"flags.6?Vector"},{name:"token",type:"flags.8?string"},{name:"app_sandbox",type:"flags.8?Bool"}],type:"CodeSettings"},{id:499236004,predicate:"wallPaperSettings",params:[{name:"flags",type:"#"},{name:"blur",type:"flags.1?true"},{name:"motion",type:"flags.2?true"},{name:"background_color",type:"flags.0?int"},{name:"second_background_color",type:"flags.4?int"},{name:"third_background_color",type:"flags.5?int"},{name:"fourth_background_color",type:"flags.6?int"},{name:"intensity",type:"flags.3?int"},{name:"rotation",type:"flags.4?int"}],type:"WallPaperSettings"},{id:-1896171181,predicate:"autoDownloadSettings",params:[{name:"flags",type:"#"},{name:"disabled",type:"flags.0?true"},{name:"video_preload_large",type:"flags.1?true"},{name:"audio_preload_next",type:"flags.2?true"},{name:"phonecalls_less_data",type:"flags.3?true"},{name:"photo_size_max",type:"int"},{name:"video_size_max",type:"long"},{name:"file_size_max",type:"long"},{name:"video_upload_maxbitrate",type:"int"}],type:"AutoDownloadSettings"},{id:1674235686,predicate:"account.autoDownloadSettings",params:[{name:"low",type:"AutoDownloadSettings"},{name:"medium",type:"AutoDownloadSettings"},{name:"high",type:"AutoDownloadSettings"}],type:"account.AutoDownloadSettings"},{id:-709641735,predicate:"emojiKeyword",params:[{name:"keyword",type:"string"},{name:"emoticons",type:"Vector"}],type:"EmojiKeyword"},{id:594408994,predicate:"emojiKeywordDeleted",params:[{name:"keyword",type:"string"},{name:"emoticons",type:"Vector"}],type:"EmojiKeyword"},{id:1556570557,predicate:"emojiKeywordsDifference",params:[{name:"lang_code",type:"string"},{name:"from_version",type:"int"},{name:"version",type:"int"},{name:"keywords",type:"Vector"}],type:"EmojiKeywordsDifference"},{id:-1519029347,predicate:"emojiURL",params:[{name:"url",type:"string"}],type:"EmojiURL"},{id:-1275374751,predicate:"emojiLanguage",params:[{name:"lang_code",type:"string"}],type:"EmojiLanguage"},{id:-1529000952,predicate:"inputPrivacyKeyForwards",params:[],type:"InputPrivacyKey"},{id:1777096355,predicate:"privacyKeyForwards",params:[],type:"PrivacyKey"},{id:1461304012,predicate:"inputPrivacyKeyProfilePhoto",params:[],type:"InputPrivacyKey"},{id:-1777000467,predicate:"privacyKeyProfilePhoto",params:[],type:"PrivacyKey"},{id:1075322878,predicate:"inputPhotoFileLocation",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"},{name:"thumb_size",type:"string"}],type:"InputFileLocation"},{id:-667654413,predicate:"inputPhotoLegacyFileLocation",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"},{name:"volume_id",type:"long"},{name:"local_id",type:"int"},{name:"secret",type:"long"}],type:"InputFileLocation"},{id:925204121,predicate:"inputPeerPhotoFileLocation",params:[{name:"flags",type:"#"},{name:"big",type:"flags.0?true"},{name:"peer",type:"InputPeer"},{name:"photo_id",type:"long"}],type:"InputFileLocation"},{id:-1652231205,predicate:"inputStickerSetThumb",params:[{name:"stickerset",type:"InputStickerSet"},{name:"thumb_version",type:"int"}],type:"InputFileLocation"},{id:-11252123,predicate:"folder",params:[{name:"flags",type:"#"},{name:"autofill_new_broadcasts",type:"flags.0?true"},{name:"autofill_public_groups",type:"flags.1?true"},{name:"autofill_new_correspondents",type:"flags.2?true"},{name:"id",type:"int"},{name:"title",type:"string"},{name:"photo",type:"flags.3?ChatPhoto"}],type:"Folder"},{id:1908216652,predicate:"dialogFolder",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.2?true"},{name:"folder",type:"Folder"},{name:"peer",type:"Peer"},{name:"top_message",type:"int"},{name:"unread_muted_peers_count",type:"int"},{name:"unread_unmuted_peers_count",type:"int"},{name:"unread_muted_messages_count",type:"int"},{name:"unread_unmuted_messages_count",type:"int"}],type:"Dialog"},{id:1684014375,predicate:"inputDialogPeerFolder",params:[{name:"folder_id",type:"int"}],type:"InputDialogPeer"},{id:1363483106,predicate:"dialogPeerFolder",params:[{name:"folder_id",type:"int"}],type:"DialogPeer"},{id:-70073706,predicate:"inputFolderPeer",params:[{name:"peer",type:"InputPeer"},{name:"folder_id",type:"int"}],type:"InputFolderPeer"},{id:-373643672,predicate:"folderPeer",params:[{name:"peer",type:"Peer"},{name:"folder_id",type:"int"}],type:"FolderPeer"},{id:422972864,predicate:"updateFolderPeers",params:[{name:"folder_peers",type:"Vector"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:497305826,predicate:"inputUserFromMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"user_id",type:"long"}],type:"InputUser"},{id:1536380829,predicate:"inputChannelFromMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"channel_id",type:"long"}],type:"InputChannel"},{id:-1468331492,predicate:"inputPeerUserFromMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"user_id",type:"long"}],type:"InputPeer"},{id:-1121318848,predicate:"inputPeerChannelFromMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"channel_id",type:"long"}],type:"InputPeer"},{id:55761658,predicate:"inputPrivacyKeyPhoneNumber",params:[],type:"InputPrivacyKey"},{id:-778378131,predicate:"privacyKeyPhoneNumber",params:[],type:"PrivacyKey"},{id:-1472172887,predicate:"topPeerCategoryForwardUsers",params:[],type:"TopPeerCategory"},{id:-68239120,predicate:"topPeerCategoryForwardChats",params:[],type:"TopPeerCategory"},{id:84703944,predicate:"channelAdminLogEventActionChangeLinkedChat",params:[{name:"prev_value",type:"long"},{name:"new_value",type:"long"}],type:"ChannelAdminLogEventAction"},{id:-398136321,predicate:"messages.searchCounter",params:[{name:"flags",type:"#"},{name:"inexact",type:"flags.1?true"},{name:"filter",type:"MessagesFilter"},{name:"count",type:"int"}],type:"messages.SearchCounter"},{id:280464681,predicate:"keyboardButtonUrlAuth",params:[{name:"flags",type:"#"},{name:"text",type:"string"},{name:"fwd_text",type:"flags.0?string"},{name:"url",type:"string"},{name:"button_id",type:"int"}],type:"KeyboardButton"},{id:-802258988,predicate:"inputKeyboardButtonUrlAuth",params:[{name:"flags",type:"#"},{name:"request_write_access",type:"flags.0?true"},{name:"text",type:"string"},{name:"fwd_text",type:"flags.1?string"},{name:"url",type:"string"},{name:"bot",type:"InputUser"}],type:"KeyboardButton"},{id:-1831650802,predicate:"urlAuthResultRequest",params:[{name:"flags",type:"#"},{name:"request_write_access",type:"flags.0?true"},{name:"bot",type:"User"},{name:"domain",type:"string"}],type:"UrlAuthResult"},{id:-1886646706,predicate:"urlAuthResultAccepted",params:[{name:"url",type:"string"}],type:"UrlAuthResult"},{id:-1445536993,predicate:"urlAuthResultDefault",params:[],type:"UrlAuthResult"},{id:-2079962673,predicate:"inputPrivacyValueAllowChatParticipants",params:[{name:"chats",type:"Vector"}],type:"InputPrivacyRule"},{id:-380694650,predicate:"inputPrivacyValueDisallowChatParticipants",params:[{name:"chats",type:"Vector"}],type:"InputPrivacyRule"},{id:1796427406,predicate:"privacyValueAllowChatParticipants",params:[{name:"chats",type:"Vector"}],type:"PrivacyRule"},{id:1103656293,predicate:"privacyValueDisallowChatParticipants",params:[{name:"chats",type:"Vector"}],type:"PrivacyRule"},{id:-1672577397,predicate:"messageEntityUnderline",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-1090087980,predicate:"messageEntityStrike",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:34469328,predicate:"messageEntityBlockquote",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1786671974,predicate:"updatePeerSettings",params:[{name:"peer",type:"Peer"},{name:"settings",type:"PeerSettings"}],type:"Update"},{id:-1078612597,predicate:"channelLocationEmpty",params:[],type:"ChannelLocation"},{id:547062491,predicate:"channelLocation",params:[{name:"geo_point",type:"GeoPoint"},{name:"address",type:"string"}],type:"ChannelLocation"},{id:-901375139,predicate:"peerLocated",params:[{name:"peer",type:"Peer"},{name:"expires",type:"int"},{name:"distance",type:"int"}],type:"PeerLocated"},{id:-1263546448,predicate:"updatePeerLocated",params:[{name:"peers",type:"Vector"}],type:"Update"},{id:241923758,predicate:"channelAdminLogEventActionChangeLocation",params:[{name:"prev_value",type:"ChannelLocation"},{name:"new_value",type:"ChannelLocation"}],type:"ChannelAdminLogEventAction"},{id:-606798099,predicate:"inputReportReasonGeoIrrelevant",params:[],type:"ReportReason"},{id:1401984889,predicate:"channelAdminLogEventActionToggleSlowMode",params:[{name:"prev_value",type:"int"},{name:"new_value",type:"int"}],type:"ChannelAdminLogEventAction"},{id:1148485274,predicate:"auth.authorizationSignUpRequired",params:[{name:"flags",type:"#"},{name:"terms_of_service",type:"flags.0?help.TermsOfService"}],type:"auth.Authorization"},{id:-666824391,predicate:"payments.paymentVerificationNeeded",params:[{name:"url",type:"string"}],type:"payments.PaymentResult"},{id:42402760,predicate:"inputStickerSetAnimatedEmoji",params:[],type:"InputStickerSet"},{id:967122427,predicate:"updateNewScheduledMessage",params:[{name:"message",type:"Message"}],type:"Update"},{id:-1870238482,predicate:"updateDeleteScheduledMessages",params:[{name:"peer",type:"Peer"},{name:"messages",type:"Vector"}],type:"Update"},{id:-797791052,predicate:"restrictionReason",params:[{name:"platform",type:"string"},{name:"reason",type:"string"},{name:"text",type:"string"}],type:"RestrictionReason"},{id:1012306921,predicate:"inputTheme",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputTheme"},{id:-175567375,predicate:"inputThemeSlug",params:[{name:"slug",type:"string"}],type:"InputTheme"},{id:-1609668650,predicate:"theme",params:[{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"default",type:"flags.1?true"},{name:"for_chat",type:"flags.5?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"slug",type:"string"},{name:"title",type:"string"},{name:"document",type:"flags.2?Document"},{name:"settings",type:"flags.3?Vector"},{name:"emoticon",type:"flags.6?string"},{name:"installs_count",type:"flags.4?int"}],type:"Theme"},{id:-199313886,predicate:"account.themesNotModified",params:[],type:"account.Themes"},{id:-1707242387,predicate:"account.themes",params:[{name:"hash",type:"long"},{name:"themes",type:"Vector"}],type:"account.Themes"},{id:-2112423005,predicate:"updateTheme",params:[{name:"theme",type:"Theme"}],type:"Update"},{id:-786326563,predicate:"inputPrivacyKeyAddedByPhone",params:[],type:"InputPrivacyKey"},{id:1124062251,predicate:"privacyKeyAddedByPhone",params:[],type:"PrivacyKey"},{id:-2027964103,predicate:"updateGeoLiveViewed",params:[{name:"peer",type:"Peer"},{name:"msg_id",type:"int"}],type:"Update"},{id:1448076945,predicate:"updateLoginToken",params:[],type:"Update"},{id:1654593920,predicate:"auth.loginToken",params:[{name:"expires",type:"int"},{name:"token",type:"bytes"}],type:"auth.LoginToken"},{id:110008598,predicate:"auth.loginTokenMigrateTo",params:[{name:"dc_id",type:"int"},{name:"token",type:"bytes"}],type:"auth.LoginToken"},{id:957176926,predicate:"auth.loginTokenSuccess",params:[{name:"authorization",type:"auth.Authorization"}],type:"auth.LoginToken"},{id:1474462241,predicate:"account.contentSettings",params:[{name:"flags",type:"#"},{name:"sensitive_enabled",type:"flags.0?true"},{name:"sensitive_can_change",type:"flags.1?true"}],type:"account.ContentSettings"},{id:-1456996667,predicate:"messages.inactiveChats",params:[{name:"dates",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.InactiveChats"},{id:-1012849566,predicate:"baseThemeClassic",params:[],type:"BaseTheme"},{id:-69724536,predicate:"baseThemeDay",params:[],type:"BaseTheme"},{id:-1212997976,predicate:"baseThemeNight",params:[],type:"BaseTheme"},{id:1834973166,predicate:"baseThemeTinted",params:[],type:"BaseTheme"},{id:1527845466,predicate:"baseThemeArctic",params:[],type:"BaseTheme"},{id:-1770371538,predicate:"inputWallPaperNoFile",params:[{name:"id",type:"long"}],type:"InputWallPaper"},{id:-528465642,predicate:"wallPaperNoFile",params:[{name:"id",type:"long"},{name:"flags",type:"#"},{name:"default",type:"flags.1?true"},{name:"dark",type:"flags.4?true"},{name:"settings",type:"flags.2?WallPaperSettings"}],type:"WallPaper"},{id:-1881255857,predicate:"inputThemeSettings",params:[{name:"flags",type:"#"},{name:"message_colors_animated",type:"flags.2?true"},{name:"base_theme",type:"BaseTheme"},{name:"accent_color",type:"int"},{name:"outbox_accent_color",type:"flags.3?int"},{name:"message_colors",type:"flags.0?Vector"},{name:"wallpaper",type:"flags.1?InputWallPaper"},{name:"wallpaper_settings",type:"flags.1?WallPaperSettings"}],type:"InputThemeSettings"},{id:-94849324,predicate:"themeSettings",params:[{name:"flags",type:"#"},{name:"message_colors_animated",type:"flags.2?true"},{name:"base_theme",type:"BaseTheme"},{name:"accent_color",type:"int"},{name:"outbox_accent_color",type:"flags.3?int"},{name:"message_colors",type:"flags.0?Vector"},{name:"wallpaper",type:"flags.1?WallPaper"}],type:"ThemeSettings"},{id:1421174295,predicate:"webPageAttributeTheme",params:[{name:"flags",type:"#"},{name:"documents",type:"flags.0?Vector"},{name:"settings",type:"flags.1?ThemeSettings"}],type:"WebPageAttribute"},{id:274961865,predicate:"updateMessagePollVote",params:[{name:"poll_id",type:"long"},{name:"user_id",type:"long"},{name:"options",type:"Vector"},{name:"qts",type:"int"}],type:"Update"},{id:886196148,predicate:"messageUserVote",params:[{name:"user_id",type:"long"},{name:"option",type:"bytes"},{name:"date",type:"int"}],type:"MessageUserVote"},{id:1017491692,predicate:"messageUserVoteInputOption",params:[{name:"user_id",type:"long"},{name:"date",type:"int"}],type:"MessageUserVote"},{id:-1973033641,predicate:"messageUserVoteMultiple",params:[{name:"user_id",type:"long"},{name:"options",type:"Vector"},{name:"date",type:"int"}],type:"MessageUserVote"},{id:136574537,predicate:"messages.votesList",params:[{name:"flags",type:"#"},{name:"count",type:"int"},{name:"votes",type:"Vector"},{name:"users",type:"Vector"},{name:"next_offset",type:"flags.0?string"}],type:"messages.VotesList"},{id:-1144565411,predicate:"keyboardButtonRequestPoll",params:[{name:"flags",type:"#"},{name:"quiz",type:"flags.0?Bool"},{name:"text",type:"string"}],type:"KeyboardButton"},{id:1981704948,predicate:"messageEntityBankCard",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-177732982,predicate:"bankCardOpenUrl",params:[{name:"url",type:"string"},{name:"name",type:"string"}],type:"BankCardOpenUrl"},{id:1042605427,predicate:"payments.bankCardData",params:[{name:"title",type:"string"},{name:"open_urls",type:"Vector"}],type:"payments.BankCardData"},{id:-118740917,predicate:"peerSelfLocated",params:[{name:"expires",type:"int"}],type:"PeerLocated"},{id:1949890536,predicate:"dialogFilter",params:[{name:"flags",type:"#"},{name:"contacts",type:"flags.0?true"},{name:"non_contacts",type:"flags.1?true"},{name:"groups",type:"flags.2?true"},{name:"broadcasts",type:"flags.3?true"},{name:"bots",type:"flags.4?true"},{name:"exclude_muted",type:"flags.11?true"},{name:"exclude_read",type:"flags.12?true"},{name:"exclude_archived",type:"flags.13?true"},{name:"id",type:"int"},{name:"title",type:"string"},{name:"emoticon",type:"flags.25?string"},{name:"pinned_peers",type:"Vector"},{name:"include_peers",type:"Vector"},{name:"exclude_peers",type:"Vector"}],type:"DialogFilter"},{id:2004110666,predicate:"dialogFilterSuggested",params:[{name:"filter",type:"DialogFilter"},{name:"description",type:"string"}],type:"DialogFilterSuggested"},{id:654302845,predicate:"updateDialogFilter",params:[{name:"flags",type:"#"},{name:"id",type:"int"},{name:"filter",type:"flags.0?DialogFilter"}],type:"Update"},{id:-1512627963,predicate:"updateDialogFilterOrder",params:[{name:"order",type:"Vector"}],type:"Update"},{id:889491791,predicate:"updateDialogFilters",params:[],type:"Update"},{id:-1237848657,predicate:"statsDateRangeDays",params:[{name:"min_date",type:"int"},{name:"max_date",type:"int"}],type:"StatsDateRangeDays"},{id:-884757282,predicate:"statsAbsValueAndPrev",params:[{name:"current",type:"double"},{name:"previous",type:"double"}],type:"StatsAbsValueAndPrev"},{id:-875679776,predicate:"statsPercentValue",params:[{name:"part",type:"double"},{name:"total",type:"double"}],type:"StatsPercentValue"},{id:1244130093,predicate:"statsGraphAsync",params:[{name:"token",type:"string"}],type:"StatsGraph"},{id:-1092839390,predicate:"statsGraphError",params:[{name:"error",type:"string"}],type:"StatsGraph"},{id:-1901828938,predicate:"statsGraph",params:[{name:"flags",type:"#"},{name:"json",type:"DataJSON"},{name:"zoom_token",type:"flags.0?string"}],type:"StatsGraph"},{id:-1387279939,predicate:"messageInteractionCounters",params:[{name:"msg_id",type:"int"},{name:"views",type:"int"},{name:"forwards",type:"int"}],type:"MessageInteractionCounters"},{id:-1107852396,predicate:"stats.broadcastStats",params:[{name:"period",type:"StatsDateRangeDays"},{name:"followers",type:"StatsAbsValueAndPrev"},{name:"views_per_post",type:"StatsAbsValueAndPrev"},{name:"shares_per_post",type:"StatsAbsValueAndPrev"},{name:"enabled_notifications",type:"StatsPercentValue"},{name:"growth_graph",type:"StatsGraph"},{name:"followers_graph",type:"StatsGraph"},{name:"mute_graph",type:"StatsGraph"},{name:"top_hours_graph",type:"StatsGraph"},{name:"interactions_graph",type:"StatsGraph"},{name:"iv_interactions_graph",type:"StatsGraph"},{name:"views_by_source_graph",type:"StatsGraph"},{name:"new_followers_by_source_graph",type:"StatsGraph"},{name:"languages_graph",type:"StatsGraph"},{name:"recent_message_interactions",type:"Vector"}],type:"stats.BroadcastStats"},{id:-428884101,predicate:"inputMediaDice",params:[{name:"emoticon",type:"string"}],type:"InputMedia"},{id:1065280907,predicate:"messageMediaDice",params:[{name:"value",type:"int"},{name:"emoticon",type:"string"}],type:"MessageMedia"},{id:-427863538,predicate:"inputStickerSetDice",params:[{name:"emoticon",type:"string"}],type:"InputStickerSet"},{id:-1728664459,predicate:"help.promoDataEmpty",params:[{name:"expires",type:"int"}],type:"help.PromoData"},{id:-1942390465,predicate:"help.promoData",params:[{name:"flags",type:"#"},{name:"proxy",type:"flags.0?true"},{name:"expires",type:"int"},{name:"peer",type:"Peer"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"},{name:"psa_type",type:"flags.1?string"},{name:"psa_message",type:"flags.2?string"}],type:"help.PromoData"},{id:-567037804,predicate:"videoSize",params:[{name:"flags",type:"#"},{name:"type",type:"string"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"size",type:"int"},{name:"video_start_ts",type:"flags.0?double"}],type:"VideoSize"},{id:643940105,predicate:"updatePhoneCallSignalingData",params:[{name:"phone_call_id",type:"long"},{name:"data",type:"bytes"}],type:"Update"},{id:1634294960,predicate:"chatInvitePeek",params:[{name:"chat",type:"Chat"},{name:"expires",type:"int"}],type:"ChatInvite"},{id:-1660637285,predicate:"statsGroupTopPoster",params:[{name:"user_id",type:"long"},{name:"messages",type:"int"},{name:"avg_chars",type:"int"}],type:"StatsGroupTopPoster"},{id:-682079097,predicate:"statsGroupTopAdmin",params:[{name:"user_id",type:"long"},{name:"deleted",type:"int"},{name:"kicked",type:"int"},{name:"banned",type:"int"}],type:"StatsGroupTopAdmin"},{id:1398765469,predicate:"statsGroupTopInviter",params:[{name:"user_id",type:"long"},{name:"invitations",type:"int"}],type:"StatsGroupTopInviter"},{id:-276825834,predicate:"stats.megagroupStats",params:[{name:"period",type:"StatsDateRangeDays"},{name:"members",type:"StatsAbsValueAndPrev"},{name:"messages",type:"StatsAbsValueAndPrev"},{name:"viewers",type:"StatsAbsValueAndPrev"},{name:"posters",type:"StatsAbsValueAndPrev"},{name:"growth_graph",type:"StatsGraph"},{name:"members_graph",type:"StatsGraph"},{name:"new_members_by_source_graph",type:"StatsGraph"},{name:"languages_graph",type:"StatsGraph"},{name:"messages_graph",type:"StatsGraph"},{name:"actions_graph",type:"StatsGraph"},{name:"top_hours_graph",type:"StatsGraph"},{name:"weekdays_graph",type:"StatsGraph"},{name:"top_posters",type:"Vector"},{name:"top_admins",type:"Vector"},{name:"top_inviters",type:"Vector"},{name:"users",type:"Vector"}],type:"stats.MegagroupStats"},{id:-1096616924,predicate:"globalPrivacySettings",params:[{name:"flags",type:"#"},{name:"archive_and_mute_new_noncontact_peers",type:"flags.0?Bool"}],type:"GlobalPrivacySettings"},{id:1667228533,predicate:"phoneConnectionWebrtc",params:[{name:"flags",type:"#"},{name:"turn",type:"flags.0?true"},{name:"stun",type:"flags.1?true"},{name:"id",type:"long"},{name:"ip",type:"string"},{name:"ipv6",type:"string"},{name:"port",type:"int"},{name:"username",type:"string"},{name:"password",type:"string"}],type:"PhoneConnection"},{id:1107543535,predicate:"help.countryCode",params:[{name:"flags",type:"#"},{name:"country_code",type:"string"},{name:"prefixes",type:"flags.0?Vector"},{name:"patterns",type:"flags.1?Vector"}],type:"help.CountryCode"},{id:-1014526429,predicate:"help.country",params:[{name:"flags",type:"#"},{name:"hidden",type:"flags.0?true"},{name:"iso2",type:"string"},{name:"default_name",type:"string"},{name:"name",type:"flags.1?string"},{name:"country_codes",type:"Vector"}],type:"help.Country"},{id:-1815339214,predicate:"help.countriesListNotModified",params:[],type:"help.CountriesList"},{id:-2016381538,predicate:"help.countriesList",params:[{name:"countries",type:"Vector"},{name:"hash",type:"int"}],type:"help.CountriesList"},{id:1163625789,predicate:"messageViews",params:[{name:"flags",type:"#"},{name:"views",type:"flags.0?int"},{name:"forwards",type:"flags.1?int"},{name:"replies",type:"flags.2?MessageReplies"}],type:"MessageViews"},{id:-761649164,predicate:"updateChannelMessageForwards",params:[{name:"channel_id",type:"long"},{name:"id",type:"int"},{name:"forwards",type:"int"}],type:"Update"},{id:-96535659,predicate:"photoSizeProgressive",params:[{name:"type",type:"string"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"sizes",type:"Vector"}],type:"PhotoSize"},{id:-1228606141,predicate:"messages.messageViews",params:[{name:"views",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.MessageViews"},{id:-693004986,predicate:"updateReadChannelDiscussionInbox",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"top_msg_id",type:"int"},{name:"read_max_id",type:"int"},{name:"broadcast_id",type:"flags.0?long"},{name:"broadcast_post",type:"flags.0?int"}],type:"Update"},{id:1767677564,predicate:"updateReadChannelDiscussionOutbox",params:[{name:"channel_id",type:"long"},{name:"top_msg_id",type:"int"},{name:"read_max_id",type:"int"}],type:"Update"},{id:-1506535550,predicate:"messages.discussionMessage",params:[{name:"flags",type:"#"},{name:"messages",type:"Vector"},{name:"max_id",type:"flags.0?int"},{name:"read_inbox_max_id",type:"flags.1?int"},{name:"read_outbox_max_id",type:"flags.2?int"},{name:"unread_count",type:"int"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.DiscussionMessage"},{id:-1495959709,predicate:"messageReplyHeader",params:[{name:"flags",type:"#"},{name:"reply_to_scheduled",type:"flags.2?true"},{name:"forum_topic",type:"flags.3?true"},{name:"reply_to_msg_id",type:"int"},{name:"reply_to_peer_id",type:"flags.0?Peer"},{name:"reply_to_top_id",type:"flags.1?int"}],type:"MessageReplyHeader"},{id:-2083123262,predicate:"messageReplies",params:[{name:"flags",type:"#"},{name:"comments",type:"flags.0?true"},{name:"replies",type:"int"},{name:"replies_pts",type:"int"},{name:"recent_repliers",type:"flags.1?Vector"},{name:"channel_id",type:"flags.0?long"},{name:"max_id",type:"flags.2?int"},{name:"read_max_id",type:"flags.3?int"}],type:"MessageReplies"},{id:610945826,predicate:"updatePeerBlocked",params:[{name:"peer_id",type:"Peer"},{name:"blocked",type:"Bool"}],type:"Update"},{id:-386039788,predicate:"peerBlocked",params:[{name:"peer_id",type:"Peer"},{name:"date",type:"int"}],type:"PeerBlocked"},{id:-1937192669,predicate:"updateChannelUserTyping",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"top_msg_id",type:"flags.0?int"},{name:"from_id",type:"Peer"},{name:"action",type:"SendMessageAction"}],type:"Update"},{id:-1392895362,predicate:"inputMessageCallbackQuery",params:[{name:"id",type:"int"},{name:"query_id",type:"long"}],type:"InputMessage"},{id:453242886,predicate:"channelParticipantLeft",params:[{name:"peer",type:"Peer"}],type:"ChannelParticipant"},{id:-531931925,predicate:"channelParticipantsMentions",params:[{name:"flags",type:"#"},{name:"q",type:"flags.0?string"},{name:"top_msg_id",type:"flags.1?int"}],type:"ChannelParticipantsFilter"},{id:-309990731,predicate:"updatePinnedMessages",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.0?true"},{name:"peer",type:"Peer"},{name:"messages",type:"Vector"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:1538885128,predicate:"updatePinnedChannelMessages",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.0?true"},{name:"channel_id",type:"long"},{name:"messages",type:"Vector"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:464520273,predicate:"inputMessagesFilterPinned",params:[],type:"MessagesFilter"},{id:-1986399595,predicate:"stats.messageStats",params:[{name:"views_graph",type:"StatsGraph"}],type:"stats.MessageStats"},{id:-1730095465,predicate:"messageActionGeoProximityReached",params:[{name:"from_id",type:"Peer"},{name:"to_id",type:"Peer"},{name:"distance",type:"int"}],type:"MessageAction"},{id:-668906175,predicate:"photoPathSize",params:[{name:"type",type:"string"},{name:"bytes",type:"bytes"}],type:"PhotoSize"},{id:-651419003,predicate:"speakingInGroupCallAction",params:[],type:"SendMessageAction"},{id:2004925620,predicate:"groupCallDiscarded",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"duration",type:"int"}],type:"GroupCall"},{id:-711498484,predicate:"groupCall",params:[{name:"flags",type:"#"},{name:"join_muted",type:"flags.1?true"},{name:"can_change_join_muted",type:"flags.2?true"},{name:"join_date_asc",type:"flags.6?true"},{name:"schedule_start_subscribed",type:"flags.8?true"},{name:"can_start_video",type:"flags.9?true"},{name:"record_video_active",type:"flags.11?true"},{name:"rtmp_stream",type:"flags.12?true"},{name:"listeners_hidden",type:"flags.13?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"participants_count",type:"int"},{name:"title",type:"flags.3?string"},{name:"stream_dc_id",type:"flags.4?int"},{name:"record_start_date",type:"flags.5?int"},{name:"schedule_date",type:"flags.7?int"},{name:"unmuted_video_count",type:"flags.10?int"},{name:"unmuted_video_limit",type:"int"},{name:"version",type:"int"}],type:"GroupCall"},{id:-659913713,predicate:"inputGroupCall",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputGroupCall"},{id:2047704898,predicate:"messageActionGroupCall",params:[{name:"flags",type:"#"},{name:"call",type:"InputGroupCall"},{name:"duration",type:"flags.0?int"}],type:"MessageAction"},{id:1345295095,predicate:"messageActionInviteToGroupCall",params:[{name:"call",type:"InputGroupCall"},{name:"users",type:"Vector"}],type:"MessageAction"},{id:-341428482,predicate:"groupCallParticipant",params:[{name:"flags",type:"#"},{name:"muted",type:"flags.0?true"},{name:"left",type:"flags.1?true"},{name:"can_self_unmute",type:"flags.2?true"},{name:"just_joined",type:"flags.4?true"},{name:"versioned",type:"flags.5?true"},{name:"min",type:"flags.8?true"},{name:"muted_by_you",type:"flags.9?true"},{name:"volume_by_admin",type:"flags.10?true"},{name:"self",type:"flags.12?true"},{name:"video_joined",type:"flags.15?true"},{name:"peer",type:"Peer"},{name:"date",type:"int"},{name:"active_date",type:"flags.3?int"},{name:"source",type:"int"},{name:"volume",type:"flags.7?int"},{name:"about",type:"flags.11?string"},{name:"raise_hand_rating",type:"flags.13?long"},{name:"video",type:"flags.6?GroupCallParticipantVideo"},{name:"presentation",type:"flags.14?GroupCallParticipantVideo"}],type:"GroupCallParticipant"},{id:-124097970,predicate:"updateChat",params:[{name:"chat_id",type:"long"}],type:"Update"},{id:-219423922,predicate:"updateGroupCallParticipants",params:[{name:"call",type:"InputGroupCall"},{name:"participants",type:"Vector"},{name:"version",type:"int"}],type:"Update"},{id:347227392,predicate:"updateGroupCall",params:[{name:"chat_id",type:"long"},{name:"call",type:"GroupCall"}],type:"Update"},{id:-1636664659,predicate:"phone.groupCall",params:[{name:"call",type:"GroupCall"},{name:"participants",type:"Vector"},{name:"participants_next_offset",type:"string"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"phone.GroupCall"},{id:-193506890,predicate:"phone.groupParticipants",params:[{name:"count",type:"int"},{name:"participants",type:"Vector"},{name:"next_offset",type:"string"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"},{name:"version",type:"int"}],type:"phone.GroupParticipants"},{id:813821341,predicate:"inlineQueryPeerTypeSameBotPM",params:[],type:"InlineQueryPeerType"},{id:-2093215828,predicate:"inlineQueryPeerTypePM",params:[],type:"InlineQueryPeerType"},{id:-681130742,predicate:"inlineQueryPeerTypeChat",params:[],type:"InlineQueryPeerType"},{id:1589952067,predicate:"inlineQueryPeerTypeMegagroup",params:[],type:"InlineQueryPeerType"},{id:1664413338,predicate:"inlineQueryPeerTypeBroadcast",params:[],type:"InlineQueryPeerType"},{id:589338437,predicate:"channelAdminLogEventActionStartGroupCall",params:[{name:"call",type:"InputGroupCall"}],type:"ChannelAdminLogEventAction"},{id:-610299584,predicate:"channelAdminLogEventActionDiscardGroupCall",params:[{name:"call",type:"InputGroupCall"}],type:"ChannelAdminLogEventAction"},{id:-115071790,predicate:"channelAdminLogEventActionParticipantMute",params:[{name:"participant",type:"GroupCallParticipant"}],type:"ChannelAdminLogEventAction"},{id:-431740480,predicate:"channelAdminLogEventActionParticipantUnmute",params:[{name:"participant",type:"GroupCallParticipant"}],type:"ChannelAdminLogEventAction"},{id:1456906823,predicate:"channelAdminLogEventActionToggleGroupCallSetting",params:[{name:"join_muted",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:-1966921727,predicate:"inputPaymentCredentialsGooglePay",params:[{name:"payment_token",type:"DataJSON"}],type:"InputPaymentCredentials"},{id:375566091,predicate:"messages.historyImport",params:[{name:"id",type:"long"}],type:"messages.HistoryImport"},{id:-606432698,predicate:"sendMessageHistoryImportAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:1578088377,predicate:"messages.historyImportParsed",params:[{name:"flags",type:"#"},{name:"pm",type:"flags.0?true"},{name:"group",type:"flags.1?true"},{name:"title",type:"flags.2?string"}],type:"messages.HistoryImportParsed"},{id:-170010905,predicate:"inputReportReasonFake",params:[],type:"ReportReason"},{id:-275956116,predicate:"messages.affectedFoundMessages",params:[{name:"pts",type:"int"},{name:"pts_count",type:"int"},{name:"offset",type:"int"},{name:"messages",type:"Vector"}],type:"messages.AffectedFoundMessages"},{id:1007897979,predicate:"messageActionSetMessagesTTL",params:[{name:"flags",type:"#"},{name:"period",type:"int"},{name:"auto_setting_from",type:"flags.0?long"}],type:"MessageAction"},{id:-1147422299,predicate:"updatePeerHistoryTTL",params:[{name:"flags",type:"#"},{name:"peer",type:"Peer"},{name:"ttl_period",type:"flags.0?int"}],type:"Update"},{id:-796432838,predicate:"updateChatParticipant",params:[{name:"flags",type:"#"},{name:"chat_id",type:"long"},{name:"date",type:"int"},{name:"actor_id",type:"long"},{name:"user_id",type:"long"},{name:"prev_participant",type:"flags.0?ChatParticipant"},{name:"new_participant",type:"flags.1?ChatParticipant"},{name:"invite",type:"flags.2?ExportedChatInvite"},{name:"qts",type:"int"}],type:"Update"},{id:-1738720581,predicate:"updateChannelParticipant",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"date",type:"int"},{name:"actor_id",type:"long"},{name:"user_id",type:"long"},{name:"prev_participant",type:"flags.0?ChannelParticipant"},{name:"new_participant",type:"flags.1?ChannelParticipant"},{name:"invite",type:"flags.2?ExportedChatInvite"},{name:"qts",type:"int"}],type:"Update"},{id:-997782967,predicate:"updateBotStopped",params:[{name:"user_id",type:"long"},{name:"date",type:"int"},{name:"stopped",type:"Bool"},{name:"qts",type:"int"}],type:"Update"},{id:-1940201511,predicate:"chatInviteImporter",params:[{name:"flags",type:"#"},{name:"requested",type:"flags.0?true"},{name:"user_id",type:"long"},{name:"date",type:"int"},{name:"about",type:"flags.2?string"},{name:"approved_by",type:"flags.1?long"}],type:"ChatInviteImporter"},{id:-1111085620,predicate:"messages.exportedChatInvites",params:[{name:"count",type:"int"},{name:"invites",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.ExportedChatInvites"},{id:410107472,predicate:"messages.exportedChatInvite",params:[{name:"invite",type:"ExportedChatInvite"},{name:"users",type:"Vector"}],type:"messages.ExportedChatInvite"},{id:572915951,predicate:"messages.exportedChatInviteReplaced",params:[{name:"invite",type:"ExportedChatInvite"},{name:"new_invite",type:"ExportedChatInvite"},{name:"users",type:"Vector"}],type:"messages.ExportedChatInvite"},{id:-2118733814,predicate:"messages.chatInviteImporters",params:[{name:"count",type:"int"},{name:"importers",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.ChatInviteImporters"},{id:-219353309,predicate:"chatAdminWithInvites",params:[{name:"admin_id",type:"long"},{name:"invites_count",type:"int"},{name:"revoked_invites_count",type:"int"}],type:"ChatAdminWithInvites"},{id:-1231326505,predicate:"messages.chatAdminsWithInvites",params:[{name:"admins",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.ChatAdminsWithInvites"},{id:1557846647,predicate:"channelAdminLogEventActionParticipantJoinByInvite",params:[{name:"invite",type:"ExportedChatInvite"}],type:"ChannelAdminLogEventAction"},{id:1515256996,predicate:"channelAdminLogEventActionExportedInviteDelete",params:[{name:"invite",type:"ExportedChatInvite"}],type:"ChannelAdminLogEventAction"},{id:1091179342,predicate:"channelAdminLogEventActionExportedInviteRevoke",params:[{name:"invite",type:"ExportedChatInvite"}],type:"ChannelAdminLogEventAction"},{id:-384910503,predicate:"channelAdminLogEventActionExportedInviteEdit",params:[{name:"prev_invite",type:"ExportedChatInvite"},{name:"new_invite",type:"ExportedChatInvite"}],type:"ChannelAdminLogEventAction"},{id:1048537159,predicate:"channelAdminLogEventActionParticipantVolume",params:[{name:"participant",type:"GroupCallParticipant"}],type:"ChannelAdminLogEventAction"},{id:1855199800,predicate:"channelAdminLogEventActionChangeHistoryTTL",params:[{name:"prev_value",type:"int"},{name:"new_value",type:"int"}],type:"ChannelAdminLogEventAction"},{id:-1571952873,predicate:"messages.checkedHistoryImportPeer",params:[{name:"confirm_text",type:"string"}],type:"messages.CheckedHistoryImportPeer"},{id:93890858,predicate:"inputGroupCallStream",params:[{name:"flags",type:"#"},{name:"call",type:"InputGroupCall"},{name:"time_ms",type:"long"},{name:"scale",type:"int"},{name:"video_channel",type:"flags.0?int"},{name:"video_quality",type:"flags.0?int"}],type:"InputFileLocation"},{id:-1343921601,predicate:"phone.joinAsPeers",params:[{name:"peers",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"phone.JoinAsPeers"},{id:541839704,predicate:"phone.exportedGroupCallInvite",params:[{name:"link",type:"string"}],type:"phone.ExportedGroupCallInvite"},{id:-672693723,predicate:"inputBotInlineMessageMediaInvoice",params:[{name:"flags",type:"#"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.0?InputWebDocument"},{name:"invoice",type:"Invoice"},{name:"payload",type:"bytes"},{name:"provider",type:"string"},{name:"provider_data",type:"DataJSON"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:894081801,predicate:"botInlineMessageMediaInvoice",params:[{name:"flags",type:"#"},{name:"shipping_address_requested",type:"flags.1?true"},{name:"test",type:"flags.3?true"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.0?WebDocument"},{name:"currency",type:"string"},{name:"total_amount",type:"long"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:-1281329567,predicate:"messageActionGroupCallScheduled",params:[{name:"call",type:"InputGroupCall"},{name:"schedule_date",type:"int"}],type:"MessageAction"},{id:-592373577,predicate:"groupCallParticipantVideoSourceGroup",params:[{name:"semantics",type:"string"},{name:"sources",type:"Vector"}],type:"GroupCallParticipantVideoSourceGroup"},{id:1735736008,predicate:"groupCallParticipantVideo",params:[{name:"flags",type:"#"},{name:"paused",type:"flags.0?true"},{name:"endpoint",type:"string"},{name:"source_groups",type:"Vector"},{name:"audio_source",type:"flags.1?int"}],type:"GroupCallParticipantVideo"},{id:192428418,predicate:"updateGroupCallConnection",params:[{name:"flags",type:"#"},{name:"presentation",type:"flags.0?true"},{name:"params",type:"DataJSON"}],type:"Update"},{id:-2046910401,predicate:"stickers.suggestedShortName",params:[{name:"short_name",type:"string"}],type:"stickers.SuggestedShortName"},{id:795652779,predicate:"botCommandScopeDefault",params:[],type:"BotCommandScope"},{id:1011811544,predicate:"botCommandScopeUsers",params:[],type:"BotCommandScope"},{id:1877059713,predicate:"botCommandScopeChats",params:[],type:"BotCommandScope"},{id:-1180016534,predicate:"botCommandScopeChatAdmins",params:[],type:"BotCommandScope"},{id:-610432643,predicate:"botCommandScopePeer",params:[{name:"peer",type:"InputPeer"}],type:"BotCommandScope"},{id:1071145937,predicate:"botCommandScopePeerAdmins",params:[{name:"peer",type:"InputPeer"}],type:"BotCommandScope"},{id:169026035,predicate:"botCommandScopePeerUser",params:[{name:"peer",type:"InputPeer"},{name:"user_id",type:"InputUser"}],type:"BotCommandScope"},{id:-478701471,predicate:"account.resetPasswordFailedWait",params:[{name:"retry_date",type:"int"}],type:"account.ResetPasswordResult"},{id:-370148227,predicate:"account.resetPasswordRequestedWait",params:[{name:"until_date",type:"int"}],type:"account.ResetPasswordResult"},{id:-383330754,predicate:"account.resetPasswordOk",params:[],type:"account.ResetPasswordResult"},{id:1299263278,predicate:"updateBotCommands",params:[{name:"peer",type:"Peer"},{name:"bot_id",type:"long"},{name:"commands",type:"Vector"}],type:"Update"},{id:-1434950843,predicate:"messageActionSetChatTheme",params:[{name:"emoticon",type:"string"}],type:"MessageAction"},{id:-1336228175,predicate:"sendMessageChooseStickerAction",params:[],type:"SendMessageAction"},{id:981691896,predicate:"sponsoredMessage",params:[{name:"flags",type:"#"},{name:"recommended",type:"flags.5?true"},{name:"show_peer_photo",type:"flags.6?true"},{name:"random_id",type:"bytes"},{name:"from_id",type:"flags.3?Peer"},{name:"chat_invite",type:"flags.4?ChatInvite"},{name:"chat_invite_hash",type:"flags.4?string"},{name:"channel_post",type:"flags.2?int"},{name:"start_param",type:"flags.0?string"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector"}],type:"SponsoredMessage"},{id:-907141753,predicate:"messages.sponsoredMessages",params:[{name:"flags",type:"#"},{name:"posts_between",type:"flags.0?int"},{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.SponsoredMessages"},{id:215889721,predicate:"inputStickerSetAnimatedEmojiAnimations",params:[],type:"InputStickerSet"},{id:630664139,predicate:"sendMessageEmojiInteraction",params:[{name:"emoticon",type:"string"},{name:"msg_id",type:"int"},{name:"interaction",type:"DataJSON"}],type:"SendMessageAction"},{id:-1234857938,predicate:"sendMessageEmojiInteractionSeen",params:[{name:"emoticon",type:"string"}],type:"SendMessageAction"},{id:-1227287081,predicate:"inputBotInlineMessageID64",params:[{name:"dc_id",type:"int"},{name:"owner_id",type:"long"},{name:"id",type:"int"},{name:"access_hash",type:"long"}],type:"InputBotInlineMessageID"},{id:-911191137,predicate:"searchResultsCalendarPeriod",params:[{name:"date",type:"int"},{name:"min_msg_id",type:"int"},{name:"max_msg_id",type:"int"},{name:"count",type:"int"}],type:"SearchResultsCalendarPeriod"},{id:343859772,predicate:"messages.searchResultsCalendar",params:[{name:"flags",type:"#"},{name:"inexact",type:"flags.0?true"},{name:"count",type:"int"},{name:"min_date",type:"int"},{name:"min_msg_id",type:"int"},{name:"offset_id_offset",type:"flags.1?int"},{name:"periods",type:"Vector"},{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.SearchResultsCalendar"},{id:2137295719,predicate:"searchResultPosition",params:[{name:"msg_id",type:"int"},{name:"date",type:"int"},{name:"offset",type:"int"}],type:"SearchResultsPosition"},{id:1404185519,predicate:"messages.searchResultsPositions",params:[{name:"count",type:"int"},{name:"positions",type:"Vector"}],type:"messages.SearchResultsPositions"},{id:-339958837,predicate:"messageActionChatJoinedByRequest",params:[],type:"MessageAction"},{id:1885586395,predicate:"updatePendingJoinRequests",params:[{name:"peer",type:"Peer"},{name:"requests_pending",type:"int"},{name:"recent_requesters",type:"Vector"}],type:"Update"},{id:299870598,predicate:"updateBotChatInviteRequester",params:[{name:"peer",type:"Peer"},{name:"date",type:"int"},{name:"user_id",type:"long"},{name:"about",type:"string"},{name:"invite",type:"ExportedChatInvite"},{name:"qts",type:"int"}],type:"Update"},{id:-1347021750,predicate:"channelAdminLogEventActionParticipantJoinByRequest",params:[{name:"invite",type:"ExportedChatInvite"},{name:"approved_by",type:"long"}],type:"ChannelAdminLogEventAction"},{id:-376962181,predicate:"inputKeyboardButtonUserProfile",params:[{name:"text",type:"string"},{name:"user_id",type:"InputUser"}],type:"KeyboardButton"},{id:814112961,predicate:"keyboardButtonUserProfile",params:[{name:"text",type:"string"},{name:"user_id",type:"long"}],type:"KeyboardButton"},{id:-191450938,predicate:"channels.sendAsPeers",params:[{name:"peers",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"channels.SendAsPeers"},{id:-886388890,predicate:"channelAdminLogEventActionToggleNoForwards",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:-738646805,predicate:"messages.stickerSetNotModified",params:[],type:"messages.StickerSet"},{id:997004590,predicate:"users.userFull",params:[{name:"full_user",type:"UserFull"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"users.UserFull"},{id:1753266509,predicate:"messages.peerSettings",params:[{name:"settings",type:"PeerSettings"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"messages.PeerSettings"},{id:663693416,predicate:"channelAdminLogEventActionSendMessage",params:[{name:"message",type:"Message"}],type:"ChannelAdminLogEventAction"},{id:-702884114,predicate:"auth.codeTypeMissedCall",params:[],type:"auth.CodeType"},{id:-2113903484,predicate:"auth.sentCodeTypeMissedCall",params:[{name:"prefix",type:"string"},{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:-1012759713,predicate:"auth.loggedOut",params:[{name:"flags",type:"#"},{name:"future_auth_token",type:"flags.0?bytes"}],type:"auth.LoggedOut"},{id:1578843320,predicate:"updateMessageReactions",params:[{name:"flags",type:"#"},{name:"peer",type:"Peer"},{name:"msg_id",type:"int"},{name:"top_msg_id",type:"flags.0?int"},{name:"reactions",type:"MessageReactions"}],type:"Update"},{id:-1546531968,predicate:"reactionCount",params:[{name:"flags",type:"#"},{name:"chosen_order",type:"flags.0?int"},{name:"reaction",type:"Reaction"},{name:"count",type:"int"}],type:"ReactionCount"},{id:1328256121,predicate:"messageReactions",params:[{name:"flags",type:"#"},{name:"min",type:"flags.0?true"},{name:"can_see_list",type:"flags.2?true"},{name:"results",type:"Vector"},{name:"recent_reactions",type:"flags.1?Vector"}],type:"MessageReactions"},{id:834488621,predicate:"messages.messageReactionsList",params:[{name:"flags",type:"#"},{name:"count",type:"int"},{name:"reactions",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"},{name:"next_offset",type:"flags.0?string"}],type:"messages.MessageReactionsList"},{id:-1065882623,predicate:"availableReaction",params:[{name:"flags",type:"#"},{name:"inactive",type:"flags.0?true"},{name:"premium",type:"flags.2?true"},{name:"reaction",type:"string"},{name:"title",type:"string"},{name:"static_icon",type:"Document"},{name:"appear_animation",type:"Document"},{name:"select_animation",type:"Document"},{name:"activate_animation",type:"Document"},{name:"effect_animation",type:"Document"},{name:"around_animation",type:"flags.1?Document"},{name:"center_icon",type:"flags.1?Document"}],type:"AvailableReaction"},{id:-1626924713,predicate:"messages.availableReactionsNotModified",params:[],type:"messages.AvailableReactions"},{id:1989032621,predicate:"messages.availableReactions",params:[{name:"hash",type:"int"},{name:"reactions",type:"Vector"}],type:"messages.AvailableReactions"},{id:852137487,predicate:"messageEntitySpoiler",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-1102180616,predicate:"channelAdminLogEventActionChangeAvailableReactions",params:[{name:"prev_value",type:"ChatReactions"},{name:"new_value",type:"ChatReactions"}],type:"ChannelAdminLogEventAction"},{id:-1319698788,predicate:"messagePeerReaction",params:[{name:"flags",type:"#"},{name:"big",type:"flags.0?true"},{name:"unread",type:"flags.1?true"},{name:"peer_id",type:"Peer"},{name:"reaction",type:"Reaction"}],type:"MessagePeerReaction"},{id:-2132064081,predicate:"groupCallStreamChannel",params:[{name:"channel",type:"int"},{name:"scale",type:"int"},{name:"last_timestamp_ms",type:"long"}],type:"GroupCallStreamChannel"},{id:-790330702,predicate:"phone.groupCallStreamChannels",params:[{name:"channels",type:"Vector"}],type:"phone.GroupCallStreamChannels"},{id:177124030,predicate:"inputReportReasonIllegalDrugs",params:[],type:"ReportReason"},{id:-1631091139,predicate:"inputReportReasonPersonalDetails",params:[],type:"ReportReason"},{id:767505458,predicate:"phone.groupCallStreamRtmpUrl",params:[{name:"url",type:"string"},{name:"key",type:"string"}],type:"phone.GroupCallStreamRtmpUrl"},{id:1165423600,predicate:"attachMenuBotIconColor",params:[{name:"name",type:"string"},{name:"color",type:"int"}],type:"AttachMenuBotIconColor"},{id:-1297663893,predicate:"attachMenuBotIcon",params:[{name:"flags",type:"#"},{name:"name",type:"string"},{name:"icon",type:"Document"},{name:"colors",type:"flags.0?Vector"}],type:"AttachMenuBotIcon"},{id:-928371502,predicate:"attachMenuBot",params:[{name:"flags",type:"#"},{name:"inactive",type:"flags.0?true"},{name:"has_settings",type:"flags.1?true"},{name:"request_write_access",type:"flags.2?true"},{name:"bot_id",type:"long"},{name:"short_name",type:"string"},{name:"peer_types",type:"Vector"},{name:"icons",type:"Vector"}],type:"AttachMenuBot"},{id:-237467044,predicate:"attachMenuBotsNotModified",params:[],type:"AttachMenuBots"},{id:1011024320,predicate:"attachMenuBots",params:[{name:"hash",type:"long"},{name:"bots",type:"Vector"},{name:"users",type:"Vector"}],type:"AttachMenuBots"},{id:-1816172929,predicate:"attachMenuBotsBot",params:[{name:"bot",type:"AttachMenuBot"},{name:"users",type:"Vector"}],type:"AttachMenuBotsBot"},{id:397910539,predicate:"updateAttachMenuBots",params:[],type:"Update"},{id:202659196,predicate:"webViewResultUrl",params:[{name:"query_id",type:"long"},{name:"url",type:"string"}],type:"WebViewResult"},{id:-2010155333,predicate:"simpleWebViewResultUrl",params:[{name:"url",type:"string"}],type:"SimpleWebViewResult"},{id:211046684,predicate:"webViewMessageSent",params:[{name:"flags",type:"#"},{name:"msg_id",type:"flags.0?InputBotInlineMessageID"}],type:"WebViewMessageSent"},{id:361936797,predicate:"updateWebViewResultSent",params:[{name:"query_id",type:"long"}],type:"Update"},{id:326529584,predicate:"keyboardButtonWebView",params:[{name:"text",type:"string"},{name:"url",type:"string"}],type:"KeyboardButton"},{id:-1598009252,predicate:"keyboardButtonSimpleWebView",params:[{name:"text",type:"string"},{name:"url",type:"string"}],type:"KeyboardButton"},{id:1205698681,predicate:"messageActionWebViewDataSentMe",params:[{name:"text",type:"string"},{name:"data",type:"string"}],type:"MessageAction"},{id:-1262252875,predicate:"messageActionWebViewDataSent",params:[{name:"text",type:"string"}],type:"MessageAction"},{id:347625491,predicate:"updateBotMenuButton",params:[{name:"bot_id",type:"long"},{name:"button",type:"BotMenuButton"}],type:"Update"},{id:1966318984,predicate:"botMenuButtonDefault",params:[],type:"BotMenuButton"},{id:1113113093,predicate:"botMenuButtonCommands",params:[],type:"BotMenuButton"},{id:-944407322,predicate:"botMenuButton",params:[{name:"text",type:"string"},{name:"url",type:"string"}],type:"BotMenuButton"},{id:-67704655,predicate:"account.savedRingtonesNotModified",params:[],type:"account.SavedRingtones"},{id:-1041683259,predicate:"account.savedRingtones",params:[{name:"hash",type:"long"},{name:"ringtones",type:"Vector"}],type:"account.SavedRingtones"},{id:1960361625,predicate:"updateSavedRingtones",params:[],type:"Update"},{id:-1746354498,predicate:"notificationSoundDefault",params:[],type:"NotificationSound"},{id:1863070943,predicate:"notificationSoundNone",params:[],type:"NotificationSound"},{id:-2096391452,predicate:"notificationSoundLocal",params:[{name:"title",type:"string"},{name:"data",type:"string"}],type:"NotificationSound"},{id:-9666487,predicate:"notificationSoundRingtone",params:[{name:"id",type:"long"}],type:"NotificationSound"},{id:-1222230163,predicate:"account.savedRingtone",params:[],type:"account.SavedRingtone"},{id:523271863,predicate:"account.savedRingtoneConverted",params:[{name:"document",type:"Document"}],type:"account.SavedRingtone"},{id:2104224014,predicate:"attachMenuPeerTypeSameBotPM",params:[],type:"AttachMenuPeerType"},{id:-1020528102,predicate:"attachMenuPeerTypeBotPM",params:[],type:"AttachMenuPeerType"},{id:-247016673,predicate:"attachMenuPeerTypePM",params:[],type:"AttachMenuPeerType"},{id:84480319,predicate:"attachMenuPeerTypeChat",params:[],type:"AttachMenuPeerType"},{id:2080104188,predicate:"attachMenuPeerTypeBroadcast",params:[],type:"AttachMenuPeerType"},{id:-317687113,predicate:"chatInvitePublicJoinRequests",params:[],type:"ExportedChatInvite"},{id:-977967015,predicate:"inputInvoiceMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"InputInvoice"},{id:-1020867857,predicate:"inputInvoiceSlug",params:[{name:"slug",type:"string"}],type:"InputInvoice"},{id:-1362048039,predicate:"payments.exportedInvoice",params:[{name:"url",type:"string"}],type:"payments.ExportedInvoice"},{id:8703322,predicate:"updateTranscribedAudio",params:[{name:"flags",type:"#"},{name:"pending",type:"flags.0?true"},{name:"peer",type:"Peer"},{name:"msg_id",type:"int"},{name:"transcription_id",type:"long"},{name:"text",type:"string"}],type:"Update"},{id:-1821037486,predicate:"messages.transcribedAudio",params:[{name:"flags",type:"#"},{name:"pending",type:"flags.0?true"},{name:"transcription_id",type:"long"},{name:"text",type:"string"}],type:"messages.TranscribedAudio"},{id:909284270,predicate:"dialogFilterDefault",params:[],type:"DialogFilter"},{id:1395946908,predicate:"help.premiumPromo",params:[{name:"status_text",type:"string"},{name:"status_entities",type:"Vector"},{name:"video_sections",type:"Vector"},{name:"videos",type:"Vector"},{name:"period_options",type:"Vector"},{name:"users",type:"Vector"}],type:"help.PremiumPromo"},{id:-925956616,predicate:"messageEntityCustomEmoji",params:[{name:"offset",type:"int"},{name:"length",type:"int"},{name:"document_id",type:"long"}],type:"MessageEntity"},{id:-48981863,predicate:"documentAttributeCustomEmoji",params:[{name:"flags",type:"#"},{name:"free",type:"flags.0?true"},{name:"text_color",type:"flags.1?true"},{name:"alt",type:"string"},{name:"stickerset",type:"InputStickerSet"}],type:"DocumentAttribute"},{id:1087454222,predicate:"stickerSetFullCovered",params:[{name:"set",type:"StickerSet"},{name:"packs",type:"Vector"},{name:"keywords",type:"Vector"},{name:"documents",type:"Vector"}],type:"StickerSetCovered"},{id:-1502273946,predicate:"inputStorePaymentPremiumSubscription",params:[{name:"flags",type:"#"},{name:"restore",type:"flags.0?true"},{name:"upgrade",type:"flags.1?true"}],type:"InputStorePaymentPurpose"},{id:1634697192,predicate:"inputStorePaymentGiftPremium",params:[{name:"user_id",type:"InputUser"},{name:"currency",type:"string"},{name:"amount",type:"long"}],type:"InputStorePaymentPurpose"},{id:-1415514682,predicate:"messageActionGiftPremium",params:[{name:"currency",type:"string"},{name:"amount",type:"long"},{name:"months",type:"int"}],type:"MessageAction"},{id:1958953753,predicate:"premiumGiftOption",params:[{name:"flags",type:"#"},{name:"months",type:"int"},{name:"currency",type:"string"},{name:"amount",type:"long"},{name:"bot_url",type:"string"},{name:"store_product",type:"flags.0?string"}],type:"PremiumGiftOption"},{id:-930399486,predicate:"inputStickerSetPremiumGifts",params:[],type:"InputStickerSet"},{id:-78886548,predicate:"updateReadFeaturedEmojiStickers",params:[],type:"Update"},{id:-1360618136,predicate:"inputPrivacyKeyVoiceMessages",params:[],type:"InputPrivacyKey"},{id:110621716,predicate:"privacyKeyVoiceMessages",params:[],type:"PrivacyKey"},{id:-1996951013,predicate:"paymentFormMethod",params:[{name:"url",type:"string"},{name:"title",type:"string"}],type:"PaymentFormMethod"},{id:-193992412,predicate:"inputWebFileAudioAlbumThumbLocation",params:[{name:"flags",type:"#"},{name:"small",type:"flags.2?true"},{name:"document",type:"flags.0?InputDocument"},{name:"title",type:"flags.1?string"},{name:"performer",type:"flags.1?string"}],type:"InputWebFileLocation"},{id:183518013,predicate:"bots.premiumGiftsOptions",params:[{name:"name",type:"string"},{name:"gifts",type:"Vector"}],type:"bots.PremiumGiftsOptions"},{id:769727150,predicate:"emojiStatusEmpty",params:[],type:"EmojiStatus"},{id:-1835310691,predicate:"emojiStatus",params:[{name:"document_id",type:"long"}],type:"EmojiStatus"},{id:-97474361,predicate:"emojiStatusUntil",params:[{name:"document_id",type:"long"},{name:"until",type:"int"}],type:"EmojiStatus"},{id:674706841,predicate:"updateUserEmojiStatus",params:[{name:"user_id",type:"long"},{name:"emoji_status",type:"EmojiStatus"}],type:"Update"},{id:821314523,predicate:"updateRecentEmojiStatuses",params:[],type:"Update"},{id:-796072379,predicate:"account.emojiStatusesNotModified",params:[],type:"account.EmojiStatuses"},{id:-1866176559,predicate:"account.emojiStatuses",params:[{name:"hash",type:"long"},{name:"statuses",type:"Vector"}],type:"account.EmojiStatuses"},{id:2046153753,predicate:"reactionEmpty",params:[],type:"Reaction"},{id:455247544,predicate:"reactionEmoji",params:[{name:"emoticon",type:"string"}],type:"Reaction"},{id:-1992950669,predicate:"reactionCustomEmoji",params:[{name:"document_id",type:"long"}],type:"Reaction"},{id:-352570692,predicate:"chatReactionsNone",params:[],type:"ChatReactions"},{id:1385335754,predicate:"chatReactionsAll",params:[{name:"flags",type:"#"},{name:"allow_custom",type:"flags.0?true"}],type:"ChatReactions"},{id:1713193015,predicate:"chatReactionsSome",params:[{name:"reactions",type:"Vector"}],type:"ChatReactions"},{id:-1334846497,predicate:"messages.reactionsNotModified",params:[],type:"messages.Reactions"},{id:-352454890,predicate:"messages.reactions",params:[{name:"hash",type:"long"},{name:"reactions",type:"Vector"}],type:"messages.Reactions"},{id:1870160884,predicate:"updateRecentReactions",params:[],type:"Update"},{id:-2030252155,predicate:"updateMoveStickerSetToTop",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"emojis",type:"flags.1?true"},{name:"stickerset",type:"long"}],type:"Update"},{id:1511364673,predicate:"auth.sentCodeTypeEmailCode",params:[{name:"flags",type:"#"},{name:"apple_signin_allowed",type:"flags.0?true"},{name:"google_signin_allowed",type:"flags.1?true"},{name:"email_pattern",type:"string"},{name:"length",type:"int"},{name:"next_phone_login_date",type:"flags.2?int"}],type:"auth.SentCodeType"},{id:-1521934870,predicate:"auth.sentCodeTypeSetUpEmailRequired",params:[{name:"flags",type:"#"},{name:"apple_signin_allowed",type:"flags.0?true"},{name:"google_signin_allowed",type:"flags.1?true"}],type:"auth.SentCodeType"},{id:1128644211,predicate:"emailVerifyPurposeLoginSetup",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"}],type:"EmailVerifyPurpose"},{id:1383932651,predicate:"emailVerifyPurposeLoginChange",params:[],type:"EmailVerifyPurpose"},{id:-1141565819,predicate:"emailVerifyPurposePassport",params:[],type:"EmailVerifyPurpose"},{id:-1842457175,predicate:"emailVerificationCode",params:[{name:"code",type:"string"}],type:"EmailVerification"},{id:-611279166,predicate:"emailVerificationGoogle",params:[{name:"token",type:"string"}],type:"EmailVerification"},{id:-1764723459,predicate:"emailVerificationApple",params:[{name:"token",type:"string"}],type:"EmailVerification"},{id:731303195,predicate:"account.emailVerified",params:[{name:"email",type:"string"}],type:"account.EmailVerified"},{id:-507835039,predicate:"account.emailVerifiedLogin",params:[{name:"email",type:"string"},{name:"sent_code",type:"auth.SentCode"}],type:"account.EmailVerified"},{id:1596792306,predicate:"premiumSubscriptionOption",params:[{name:"flags",type:"#"},{name:"current",type:"flags.1?true"},{name:"can_purchase_upgrade",type:"flags.2?true"},{name:"transaction",type:"flags.3?string"},{name:"months",type:"int"},{name:"currency",type:"string"},{name:"amount",type:"long"},{name:"bot_url",type:"string"},{name:"store_product",type:"flags.0?string"}],type:"PremiumSubscriptionOption"},{id:80008398,predicate:"inputStickerSetEmojiGenericAnimations",params:[],type:"InputStickerSet"},{id:701560302,predicate:"inputStickerSetEmojiDefaultStatuses",params:[],type:"InputStickerSet"},{id:-1206095820,predicate:"sendAsPeer",params:[{name:"flags",type:"#"},{name:"premium_required",type:"flags.0?true"},{name:"peer",type:"Peer"}],type:"SendAsPeer"},{id:-1386050360,predicate:"messageExtendedMediaPreview",params:[{name:"flags",type:"#"},{name:"w",type:"flags.0?int"},{name:"h",type:"flags.0?int"},{name:"thumb",type:"flags.1?PhotoSize"},{name:"video_duration",type:"flags.2?int"}],type:"MessageExtendedMedia"},{id:-297296796,predicate:"messageExtendedMedia",params:[{name:"media",type:"MessageMedia"}],type:"MessageExtendedMedia"},{id:1517529484,predicate:"updateMessageExtendedMedia",params:[{name:"peer",type:"Peer"},{name:"msg_id",type:"int"},{name:"extended_media",type:"MessageExtendedMedia"}],type:"Update"},{id:-50416996,predicate:"stickerKeyword",params:[{name:"document_id",type:"long"},{name:"keyword",type:"Vector"}],type:"StickerKeyword"},{id:-1274595769,predicate:"username",params:[{name:"flags",type:"#"},{name:"editable",type:"flags.0?true"},{name:"active",type:"flags.1?true"},{name:"username",type:"string"}],type:"Username"},{id:-263212119,predicate:"channelAdminLogEventActionChangeUsernames",params:[{name:"prev_value",type:"Vector"},{name:"new_value",type:"Vector"}],type:"ChannelAdminLogEventAction"},{id:46949251,predicate:"channelAdminLogEventActionToggleForum",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:1483767080,predicate:"channelAdminLogEventActionCreateTopic",params:[{name:"topic",type:"ForumTopic"}],type:"ChannelAdminLogEventAction"},{id:-261103096,predicate:"channelAdminLogEventActionEditTopic",params:[{name:"prev_topic",type:"ForumTopic"},{name:"new_topic",type:"ForumTopic"}],type:"ChannelAdminLogEventAction"},{id:-1374254839,predicate:"channelAdminLogEventActionDeleteTopic",params:[{name:"topic",type:"ForumTopic"}],type:"ChannelAdminLogEventAction"},{id:1569535291,predicate:"channelAdminLogEventActionPinTopic",params:[{name:"flags",type:"#"},{name:"prev_topic",type:"flags.0?ForumTopic"},{name:"new_topic",type:"flags.1?ForumTopic"}],type:"ChannelAdminLogEventAction"},{id:37687451,predicate:"forumTopicDeleted",params:[{name:"id",type:"int"}],type:"ForumTopic"},{id:1903173033,predicate:"forumTopic",params:[{name:"flags",type:"#"},{name:"my",type:"flags.1?true"},{name:"closed",type:"flags.2?true"},{name:"pinned",type:"flags.3?true"},{name:"short",type:"flags.5?true"},{name:"hidden",type:"flags.6?true"},{name:"id",type:"int"},{name:"date",type:"int"},{name:"title",type:"string"},{name:"icon_color",type:"int"},{name:"icon_emoji_id",type:"flags.0?long"},{name:"top_message",type:"int"},{name:"read_inbox_max_id",type:"int"},{name:"read_outbox_max_id",type:"int"},{name:"unread_count",type:"int"},{name:"unread_mentions_count",type:"int"},{name:"unread_reactions_count",type:"int"},{name:"from_id",type:"Peer"},{name:"notify_settings",type:"PeerNotifySettings"},{name:"draft",type:"flags.4?DraftMessage"}],type:"ForumTopic"},{id:913709011,predicate:"messages.forumTopics",params:[{name:"flags",type:"#"},{name:"order_by_create_date",type:"flags.0?true"},{name:"count",type:"int"},{name:"topics",type:"Vector"},{name:"messages",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"},{name:"pts",type:"int"}],type:"messages.ForumTopics"},{id:228168278,predicate:"messageActionTopicCreate",params:[{name:"flags",type:"#"},{name:"title",type:"string"},{name:"icon_color",type:"int"},{name:"icon_emoji_id",type:"flags.0?long"}],type:"MessageAction"},{id:-1064024032,predicate:"messageActionTopicEdit",params:[{name:"flags",type:"#"},{name:"title",type:"flags.0?string"},{name:"icon_emoji_id",type:"flags.1?long"},{name:"closed",type:"flags.2?Bool"},{name:"hidden",type:"flags.3?Bool"}],type:"MessageAction"},{id:422509539,predicate:"updateChannelPinnedTopic",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.0?true"},{name:"channel_id",type:"long"},{name:"topic_id",type:"int"}],type:"Update"},{id:1548122514,predicate:"inputNotifyForumTopic",params:[{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"int"}],type:"InputNotifyPeer"},{id:577659656,predicate:"notifyForumTopic",params:[{name:"peer",type:"Peer"},{name:"top_msg_id",type:"int"}],type:"NotifyPeer"},{id:1153562857,predicate:"inputStickerSetEmojiDefaultTopicIcons",params:[],type:"InputStickerSet"},{id:406407439,predicate:"messages.sponsoredMessagesEmpty",params:[],type:"messages.SponsoredMessages"},{id:-31881726,predicate:"updateChannelPinnedTopics",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"order",type:"flags.0?Vector"}],type:"Update"},{id:1135897376,predicate:"defaultHistoryTTL",params:[{name:"period",type:"int"}],type:"DefaultHistoryTTL"},{id:116234636,predicate:"auth.codeTypeFragmentSms",params:[],type:"auth.CodeType"},{id:-648651719,predicate:"auth.sentCodeTypeFragmentSms",params:[{name:"url",type:"string"},{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:1103040667,predicate:"exportedContactToken",params:[{name:"url",type:"string"},{name:"expires",type:"int"}],type:"ExportedContactToken"},{id:1693675004,predicate:"channelAdminLogEventActionToggleAntiSpam",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:1474192222,predicate:"messageActionSuggestProfilePhoto",params:[{name:"photo",type:"Photo"}],type:"MessageAction"},{id:-404267113,predicate:"messageActionAttachMenuBotAllowed",params:[],type:"MessageAction"},{id:2008112412,predicate:"stickerSetNoCovered",params:[{name:"set",type:"StickerSet"}],type:"StickerSetCovered"},{id:542282808,predicate:"updateUser",params:[{name:"user_id",type:"long"}],type:"Update"},{id:596704836,predicate:"auth.sentCodeSuccess",params:[{name:"authorization",type:"auth.Authorization"}],type:"auth.SentCode"},{id:-25742243,predicate:"messageActionRequestedPeer",params:[{name:"button_id",type:"int"},{name:"peer",type:"Peer"}],type:"MessageAction"},{id:1597737472,predicate:"requestPeerTypeUser",params:[{name:"flags",type:"#"},{name:"bot",type:"flags.0?Bool"},{name:"premium",type:"flags.1?Bool"}],type:"RequestPeerType"},{id:-906990053,predicate:"requestPeerTypeChat",params:[{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"bot_participant",type:"flags.5?true"},{name:"has_username",type:"flags.3?Bool"},{name:"forum",type:"flags.4?Bool"},{name:"user_admin_rights",type:"flags.1?ChatAdminRights"},{name:"bot_admin_rights",type:"flags.2?ChatAdminRights"}],type:"RequestPeerType"},{id:865857388,predicate:"requestPeerTypeBroadcast",params:[{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"has_username",type:"flags.3?Bool"},{name:"user_admin_rights",type:"flags.1?ChatAdminRights"},{name:"bot_admin_rights",type:"flags.2?ChatAdminRights"}],type:"RequestPeerType"},{id:218842764,predicate:"keyboardButtonRequestPeer",params:[{name:"text",type:"string"},{name:"button_id",type:"int"},{name:"peer_type",type:"RequestPeerType"}],type:"KeyboardButton"},{id:1209970170,predicate:"emojiListNotModified",params:[],type:"EmojiList"},{id:2048790993,predicate:"emojiList",params:[{name:"hash",type:"long"},{name:"document_id",type:"Vector"}],type:"EmojiList"},{id:-444918734,predicate:"auth.sentCodeTypeFirebaseSms",params:[{name:"flags",type:"#"},{name:"nonce",type:"flags.0?bytes"},{name:"receipt",type:"flags.1?string"},{name:"push_timeout",type:"flags.1?int"},{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:2056961449,predicate:"emojiGroup",params:[{name:"title",type:"string"},{name:"icon_emoji_id",type:"long"},{name:"emoticons",type:"Vector"}],type:"EmojiGroup"},{id:1874111879,predicate:"messages.emojiGroupsNotModified",params:[],type:"messages.EmojiGroups"},{id:-2011186869,predicate:"messages.emojiGroups",params:[{name:"hash",type:"int"},{name:"groups",type:"Vector"}],type:"messages.EmojiGroups"},{id:-128171716,predicate:"videoSizeEmojiMarkup",params:[{name:"emoji_id",type:"long"},{name:"background_colors",type:"Vector"}],type:"VideoSize"},{id:228623102,predicate:"videoSizeStickerMarkup",params:[{name:"stickerset",type:"InputStickerSet"},{name:"sticker_id",type:"long"},{name:"background_colors",type:"Vector"}],type:"VideoSize"},{id:1964978502,predicate:"textWithEntities",params:[{name:"text",type:"string"},{name:"entities",type:"Vector"}],type:"TextWithEntities"},{id:870003448,predicate:"messages.translateResult",params:[{name:"result",type:"Vector"}],type:"messages.TranslatedText"},{id:-934791986,predicate:"autoSaveSettings",params:[{name:"flags",type:"#"},{name:"photos",type:"flags.0?true"},{name:"videos",type:"flags.1?true"},{name:"video_max_size",type:"flags.2?long"}],type:"AutoSaveSettings"},{id:-2124403385,predicate:"autoSaveException",params:[{name:"peer",type:"Peer"},{name:"settings",type:"AutoSaveSettings"}],type:"AutoSaveException"},{id:1279133341,predicate:"account.autoSaveSettings",params:[{name:"users_settings",type:"AutoSaveSettings"},{name:"chats_settings",type:"AutoSaveSettings"},{name:"broadcasts_settings",type:"AutoSaveSettings"},{name:"exceptions",type:"Vector"},{name:"chats",type:"Vector"},{name:"users",type:"Vector"}],type:"account.AutoSaveSettings"},{id:-335171433,predicate:"updateAutoSaveSettings",params:[],type:"Update"}],methods:[{id:-878758099,method:"invokeAfterMsg",params:[{name:"msg_id",type:"long"},{name:"query",type:"!X"}],type:"X"},{id:1036301552,method:"invokeAfterMsgs",params:[{name:"msg_ids",type:"Vector"},{name:"query",type:"!X"}],type:"X"},{id:-1502141361,method:"auth.sendCode",params:[{name:"phone_number",type:"string"},{name:"api_id",type:"int"},{name:"api_hash",type:"string"},{name:"settings",type:"CodeSettings"}],type:"auth.SentCode"},{id:-2131827673,method:"auth.signUp",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"}],type:"auth.Authorization"},{id:-1923962543,method:"auth.signIn",params:[{name:"flags",type:"#"},{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"},{name:"phone_code",type:"flags.0?string"},{name:"email_verification",type:"flags.1?EmailVerification"}],type:"auth.Authorization"},{id:1047706137,method:"auth.logOut",params:[],type:"auth.LoggedOut"},{id:-1616179942,method:"auth.resetAuthorizations",params:[],type:"Bool"},{id:-440401971,method:"auth.exportAuthorization",params:[{name:"dc_id",type:"int"}],type:"auth.ExportedAuthorization"},{id:-1518699091,method:"auth.importAuthorization",params:[{name:"id",type:"long"},{name:"bytes",type:"bytes"}],type:"auth.Authorization"},{id:-841733627,method:"auth.bindTempAuthKey",params:[{name:"perm_auth_key_id",type:"long"},{name:"nonce",type:"long"},{name:"expires_at",type:"int"},{name:"encrypted_message",type:"bytes"}],type:"Bool"},{id:-326762118,method:"account.registerDevice",params:[{name:"flags",type:"#"},{name:"no_muted",type:"flags.0?true"},{name:"token_type",type:"int"},{name:"token",type:"string"},{name:"app_sandbox",type:"Bool"},{name:"secret",type:"bytes"},{name:"other_uids",type:"Vector"}],type:"Bool"},{id:1779249670,method:"account.unregisterDevice",params:[{name:"token_type",type:"int"},{name:"token",type:"string"},{name:"other_uids",type:"Vector"}],type:"Bool"},{id:-2067899501,method:"account.updateNotifySettings",params:[{name:"peer",type:"InputNotifyPeer"},{name:"settings",type:"InputPeerNotifySettings"}],type:"Bool"},{id:313765169,method:"account.getNotifySettings",params:[{name:"peer",type:"InputNotifyPeer"}],type:"PeerNotifySettings"},{id:-612493497,method:"account.resetNotifySettings",params:[],type:"Bool"},{id:2018596725,method:"account.updateProfile",params:[{name:"flags",type:"#"},{name:"first_name",type:"flags.0?string"},{name:"last_name",type:"flags.1?string"},{name:"about",type:"flags.2?string"}],type:"User"},{id:1713919532,method:"account.updateStatus",params:[{name:"offline",type:"Bool"}],type:"Bool"},{id:127302966,method:"account.getWallPapers",params:[{name:"hash",type:"long"}],type:"account.WallPapers"},{id:-977650298,method:"account.reportPeer",params:[{name:"peer",type:"InputPeer"},{name:"reason",type:"ReportReason"},{name:"message",type:"string"}],type:"Bool"},{id:227648840,method:"users.getUsers",params:[{name:"id",type:"Vector"}],type:"Vector"},{id:-1240508136,method:"users.getFullUser",params:[{name:"id",type:"InputUser"}],type:"users.UserFull"},{id:2061264541,method:"contacts.getContactIDs",params:[{name:"hash",type:"long"}],type:"Vector"},{id:-995929106,method:"contacts.getStatuses",params:[],type:"Vector"},{id:1574346258,method:"contacts.getContacts",params:[{name:"hash",type:"long"}],type:"contacts.Contacts"},{id:746589157,method:"contacts.importContacts",params:[{name:"contacts",type:"Vector"}],type:"contacts.ImportedContacts"},{id:157945344,method:"contacts.deleteContacts",params:[{name:"id",type:"Vector"}],type:"Updates"},{id:269745566,method:"contacts.deleteByPhones",params:[{name:"phones",type:"Vector"}],type:"Bool"},{id:1758204945,method:"contacts.block",params:[{name:"id",type:"InputPeer"}],type:"Bool"},{id:-1096393392,method:"contacts.unblock",params:[{name:"id",type:"InputPeer"}],type:"Bool"},{id:-176409329,method:"contacts.getBlocked",params:[{name:"offset",type:"int"},{name:"limit",type:"int"}],type:"contacts.Blocked"},{id:1673946374,method:"messages.getMessages",params:[{name:"id",type:"Vector"}],type:"messages.Messages"},{id:-1594569905,method:"messages.getDialogs",params:[{name:"flags",type:"#"},{name:"exclude_pinned",type:"flags.0?true"},{name:"folder_id",type:"flags.1?int"},{name:"offset_date",type:"int"},{name:"offset_id",type:"int"},{name:"offset_peer",type:"InputPeer"},{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"messages.Dialogs"},{id:1143203525,method:"messages.getHistory",params:[{name:"peer",type:"InputPeer"},{name:"offset_id",type:"int"},{name:"offset_date",type:"int"},{name:"add_offset",type:"int"},{name:"limit",type:"int"},{name:"max_id",type:"int"},{name:"min_id",type:"int"},{name:"hash",type:"long"}],type:"messages.Messages"},{id:-1593989278,method:"messages.search",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"q",type:"string"},{name:"from_id",type:"flags.0?InputPeer"},{name:"top_msg_id",type:"flags.1?int"},{name:"filter",type:"MessagesFilter"},{name:"min_date",type:"int"},{name:"max_date",type:"int"},{name:"offset_id",type:"int"},{name:"add_offset",type:"int"},{name:"limit",type:"int"},{name:"max_id",type:"int"},{name:"min_id",type:"int"},{name:"hash",type:"long"}],type:"messages.Messages"},{id:238054714,method:"messages.readHistory",params:[{name:"peer",type:"InputPeer"},{name:"max_id",type:"int"}],type:"messages.AffectedMessages"},{id:-1332768214,method:"messages.deleteHistory",params:[{name:"flags",type:"#"},{name:"just_clear",type:"flags.0?true"},{name:"revoke",type:"flags.1?true"},{name:"peer",type:"InputPeer"},{name:"max_id",type:"int"},{name:"min_date",type:"flags.2?int"},{name:"max_date",type:"flags.3?int"}],type:"messages.AffectedHistory"},{id:-443640366,method:"messages.deleteMessages",params:[{name:"flags",type:"#"},{name:"revoke",type:"flags.0?true"},{name:"id",type:"Vector"}],type:"messages.AffectedMessages"},{id:94983360,method:"messages.receivedMessages",params:[{name:"max_id",type:"int"}],type:"Vector"},{id:1486110434,method:"messages.setTyping",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"},{name:"action",type:"SendMessageAction"}],type:"Bool"},{id:482476935,method:"messages.sendMessage",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.1?true"},{name:"silent",type:"flags.5?true"},{name:"background",type:"flags.6?true"},{name:"clear_draft",type:"flags.7?true"},{name:"noforwards",type:"flags.14?true"},{name:"update_stickersets_order",type:"flags.15?true"},{name:"peer",type:"InputPeer"},{name:"reply_to_msg_id",type:"flags.0?int"},{name:"top_msg_id",type:"flags.9?int"},{name:"message",type:"string"},{name:"random_id",type:"long"},{name:"reply_markup",type:"flags.2?ReplyMarkup"},{name:"entities",type:"flags.3?Vector"},{name:"schedule_date",type:"flags.10?int"},{name:"send_as",type:"flags.13?InputPeer"}],type:"Updates"},{id:1967638886,method:"messages.sendMedia",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.5?true"},{name:"background",type:"flags.6?true"},{name:"clear_draft",type:"flags.7?true"},{name:"noforwards",type:"flags.14?true"},{name:"update_stickersets_order",type:"flags.15?true"},{name:"peer",type:"InputPeer"},{name:"reply_to_msg_id",type:"flags.0?int"},{name:"top_msg_id",type:"flags.9?int"},{name:"media",type:"InputMedia"},{name:"message",type:"string"},{name:"random_id",type:"long"},{name:"reply_markup",type:"flags.2?ReplyMarkup"},{name:"entities",type:"flags.3?Vector"},{name:"schedule_date",type:"flags.10?int"},{name:"send_as",type:"flags.13?InputPeer"}],type:"Updates"},{id:-966673468,method:"messages.forwardMessages",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.5?true"},{name:"background",type:"flags.6?true"},{name:"with_my_score",type:"flags.8?true"},{name:"drop_author",type:"flags.11?true"},{name:"drop_media_captions",type:"flags.12?true"},{name:"noforwards",type:"flags.14?true"},{name:"from_peer",type:"InputPeer"},{name:"id",type:"Vector"},{name:"random_id",type:"Vector"},{name:"to_peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.9?int"},{name:"schedule_date",type:"flags.10?int"},{name:"send_as",type:"flags.13?InputPeer"}],type:"Updates"},{id:-820669733,method:"messages.reportSpam",params:[{name:"peer",type:"InputPeer"}],type:"Bool"},{id:-270948702,method:"messages.getPeerSettings",params:[{name:"peer",type:"InputPeer"}],type:"messages.PeerSettings"},{id:-1991005362,method:"messages.report",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector"},{name:"reason",type:"ReportReason"},{name:"message",type:"string"}],type:"Bool"},{id:1240027791,method:"messages.getChats",params:[{name:"id",type:"Vector"}],type:"messages.Chats"},{id:-1364194508,method:"messages.getFullChat",params:[{name:"chat_id",type:"long"}],type:"messages.ChatFull"},{id:1937260541,method:"messages.editChatTitle",params:[{name:"chat_id",type:"long"},{name:"title",type:"string"}],type:"Updates"},{id:903730804,method:"messages.editChatPhoto",params:[{name:"chat_id",type:"long"},{name:"photo",type:"InputChatPhoto"}],type:"Updates"},{id:-230206493,method:"messages.addChatUser",params:[{name:"chat_id",type:"long"},{name:"user_id",type:"InputUser"},{name:"fwd_limit",type:"int"}],type:"Updates"},{id:-1575461717,method:"messages.deleteChatUser",params:[{name:"flags",type:"#"},{name:"revoke_history",type:"flags.0?true"},{name:"chat_id",type:"long"},{name:"user_id",type:"InputUser"}],type:"Updates"},{id:3450904,method:"messages.createChat",params:[{name:"flags",type:"#"},{name:"users",type:"Vector"},{name:"title",type:"string"},{name:"ttl_period",type:"flags.0?int"}],type:"Updates"},{id:-304838614,method:"updates.getState",params:[],type:"updates.State"},{id:630429265,method:"updates.getDifference",params:[{name:"flags",type:"#"},{name:"pts",type:"int"},{name:"pts_total_limit",type:"flags.0?int"},{name:"date",type:"int"},{name:"qts",type:"int"}],type:"updates.Difference"},{id:473782614,method:"photos.updateProfilePhoto",params:[{name:"flags",type:"#"},{name:"fallback",type:"flags.0?true"},{name:"id",type:"InputPhoto"}],type:"photos.Photo"},{id:154966609,method:"photos.uploadProfilePhoto",params:[{name:"flags",type:"#"},{name:"fallback",type:"flags.3?true"},{name:"file",type:"flags.0?InputFile"},{name:"video",type:"flags.1?InputFile"},{name:"video_start_ts",type:"flags.2?double"},{name:"video_emoji_markup",type:"flags.4?VideoSize"}],type:"photos.Photo"},{id:-2016444625,method:"photos.deletePhotos",params:[{name:"id",type:"Vector"}],type:"Vector"},{id:-1291540959,method:"upload.saveFilePart",params:[{name:"file_id",type:"long"},{name:"file_part",type:"int"},{name:"bytes",type:"bytes"}],type:"Bool"},{id:-1101843010,method:"upload.getFile",params:[{name:"flags",type:"#"},{name:"precise",type:"flags.0?true"},{name:"cdn_supported",type:"flags.1?true"},{name:"location",type:"InputFileLocation"},{name:"offset",type:"long"},{name:"limit",type:"int"}],type:"upload.File"},{id:-990308245,method:"help.getConfig",params:[],type:"Config"},{id:531836966,method:"help.getNearestDc",params:[],type:"NearestDc"},{id:1378703997,method:"help.getAppUpdate",params:[{name:"source",type:"string"}],type:"help.AppUpdate"},{id:1295590211,method:"help.getInviteText",params:[],type:"help.InviteText"},{id:-1848823128,method:"photos.getUserPhotos",params:[{name:"user_id",type:"InputUser"},{name:"offset",type:"int"},{name:"max_id",type:"long"},{name:"limit",type:"int"}],type:"photos.Photos"},{id:651135312,method:"messages.getDhConfig",params:[{name:"version",type:"int"},{name:"random_length",type:"int"}],type:"messages.DhConfig"},{id:-162681021,method:"messages.requestEncryption",params:[{name:"user_id",type:"InputUser"},{name:"random_id",type:"int"},{name:"g_a",type:"bytes"}],type:"EncryptedChat"},{id:1035731989,method:"messages.acceptEncryption",params:[{name:"peer",type:"InputEncryptedChat"},{name:"g_b",type:"bytes"},{name:"key_fingerprint",type:"long"}],type:"EncryptedChat"},{id:-208425312,method:"messages.discardEncryption",params:[{name:"flags",type:"#"},{name:"delete_history",type:"flags.0?true"},{name:"chat_id",type:"int"}],type:"Bool"},{id:2031374829,method:"messages.setEncryptedTyping",params:[{name:"peer",type:"InputEncryptedChat"},{name:"typing",type:"Bool"}],type:"Bool"},{id:2135648522,method:"messages.readEncryptedHistory",params:[{name:"peer",type:"InputEncryptedChat"},{name:"max_date",type:"int"}],type:"Bool"},{id:1157265941,method:"messages.sendEncrypted",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.0?true"},{name:"peer",type:"InputEncryptedChat"},{name:"random_id",type:"long"},{name:"data",type:"bytes"}],type:"messages.SentEncryptedMessage"},{id:1431914525,method:"messages.sendEncryptedFile",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.0?true"},{name:"peer",type:"InputEncryptedChat"},{name:"random_id",type:"long"},{name:"data",type:"bytes"},{name:"file",type:"InputEncryptedFile"}],type:"messages.SentEncryptedMessage"},{id:852769188,method:"messages.sendEncryptedService",params:[{name:"peer",type:"InputEncryptedChat"},{name:"random_id",type:"long"},{name:"data",type:"bytes"}],type:"messages.SentEncryptedMessage"},{id:1436924774,method:"messages.receivedQueue",params:[{name:"max_qts",type:"int"}],type:"Vector"},{id:1259113487,method:"messages.reportEncryptedSpam",params:[{name:"peer",type:"InputEncryptedChat"}],type:"Bool"},{id:-562337987,method:"upload.saveBigFilePart",params:[{name:"file_id",type:"long"},{name:"file_part",type:"int"},{name:"file_total_parts",type:"int"},{name:"bytes",type:"bytes"}],type:"Bool"},{id:-1043505495,method:"initConnection",params:[{name:"flags",type:"#"},{name:"api_id",type:"int"},{name:"device_model",type:"string"},{name:"system_version",type:"string"},{name:"app_version",type:"string"},{name:"system_lang_code",type:"string"},{name:"lang_pack",type:"string"},{name:"lang_code",type:"string"},{name:"proxy",type:"flags.0?InputClientProxy"},{name:"params",type:"flags.1?JSONValue"},{name:"query",type:"!X"}],type:"X"},{id:-1663104819,method:"help.getSupport",params:[],type:"help.Support"},{id:916930423,method:"messages.readMessageContents",params:[{name:"id",type:"Vector"}],type:"messages.AffectedMessages"},{id:655677548,method:"account.checkUsername",params:[{name:"username",type:"string"}],type:"Bool"},{id:1040964988,method:"account.updateUsername",params:[{name:"username",type:"string"}],type:"User"},{id:301470424,method:"contacts.search",params:[{name:"q",type:"string"},{name:"limit",type:"int"}],type:"contacts.Found"},{id:-623130288,method:"account.getPrivacy",params:[{name:"key",type:"InputPrivacyKey"}],type:"account.PrivacyRules"},{id:-906486552,method:"account.setPrivacy",params:[{name:"key",type:"InputPrivacyKey"},{name:"rules",type:"Vector"}],type:"account.PrivacyRules"},{id:-1564422284,method:"account.deleteAccount",params:[{name:"flags",type:"#"},{name:"reason",type:"string"},{name:"password",type:"flags.0?InputCheckPasswordSRP"}],type:"Bool"},{id:150761757,method:"account.getAccountTTL",params:[],type:"AccountDaysTTL"},{id:608323678,method:"account.setAccountTTL",params:[{name:"ttl",type:"AccountDaysTTL"}],type:"Bool"},{id:-627372787,method:"invokeWithLayer",params:[{name:"layer",type:"int"},{name:"query",type:"!X"}],type:"X"},{id:-113456221,method:"contacts.resolveUsername",params:[{name:"username",type:"string"}],type:"contacts.ResolvedPeer"},{id:-2108208411,method:"account.sendChangePhoneCode",params:[{name:"phone_number",type:"string"},{name:"settings",type:"CodeSettings"}],type:"auth.SentCode"},{id:1891839707,method:"account.changePhone",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"},{name:"phone_code",type:"string"}],type:"User"},{id:-710552671,method:"messages.getStickers",params:[{name:"emoticon",type:"string"},{name:"hash",type:"long"}],type:"messages.Stickers"},{id:-1197432408,method:"messages.getAllStickers",params:[{name:"hash",type:"long"}],type:"messages.AllStickers"},{id:954152242,method:"account.updateDeviceLocked",params:[{name:"period",type:"int"}],type:"Bool"},{id:1738800940,method:"auth.importBotAuthorization",params:[{name:"flags",type:"int"},{name:"api_id",type:"int"},{name:"api_hash",type:"string"},{name:"bot_auth_token",type:"string"}],type:"auth.Authorization"},{id:-1956073268,method:"messages.getWebPagePreview",params:[{name:"flags",type:"#"},{name:"message",type:"string"},{name:"entities",type:"flags.3?Vector"}],type:"MessageMedia"},{id:-484392616,method:"account.getAuthorizations",params:[],type:"account.Authorizations"},{id:-545786948,method:"account.resetAuthorization",params:[{name:"hash",type:"long"}],type:"Bool"},{id:1418342645,method:"account.getPassword",params:[],type:"account.Password"},{id:-1663767815,method:"account.getPasswordSettings",params:[{name:"password",type:"InputCheckPasswordSRP"}],type:"account.PasswordSettings"},{id:-1516564433,method:"account.updatePasswordSettings",params:[{name:"password",type:"InputCheckPasswordSRP"},{name:"new_settings",type:"account.PasswordInputSettings"}],type:"Bool"},{id:-779399914,method:"auth.checkPassword",params:[{name:"password",type:"InputCheckPasswordSRP"}],type:"auth.Authorization"},{id:-661144474,method:"auth.requestPasswordRecovery",params:[],type:"auth.PasswordRecovery"},{id:923364464,method:"auth.recoverPassword",params:[{name:"flags",type:"#"},{name:"code",type:"string"},{name:"new_settings",type:"flags.0?account.PasswordInputSettings"}],type:"auth.Authorization"},{id:-1080796745,method:"invokeWithoutUpdates",params:[{name:"query",type:"!X"}],type:"X"},{id:-1607670315,method:"messages.exportChatInvite",params:[{name:"flags",type:"#"},{name:"legacy_revoke_permanent",type:"flags.2?true"},{name:"request_needed",type:"flags.3?true"},{name:"peer",type:"InputPeer"},{name:"expire_date",type:"flags.0?int"},{name:"usage_limit",type:"flags.1?int"},{name:"title",type:"flags.4?string"}],type:"ExportedChatInvite"},{id:1051570619,method:"messages.checkChatInvite",params:[{name:"hash",type:"string"}],type:"ChatInvite"},{id:1817183516,method:"messages.importChatInvite",params:[{name:"hash",type:"string"}],type:"Updates"},{id:-928977804,method:"messages.getStickerSet",params:[{name:"stickerset",type:"InputStickerSet"},{name:"hash",type:"int"}],type:"messages.StickerSet"},{id:-946871200,method:"messages.installStickerSet",params:[{name:"stickerset",type:"InputStickerSet"},{name:"archived",type:"Bool"}],type:"messages.StickerSetInstallResult"},{id:-110209570,method:"messages.uninstallStickerSet",params:[{name:"stickerset",type:"InputStickerSet"}],type:"Bool"},{id:-421563528,method:"messages.startBot",params:[{name:"bot",type:"InputUser"},{name:"peer",type:"InputPeer"},{name:"random_id",type:"long"},{name:"start_param",type:"string"}],type:"Updates"},{id:-1877938321,method:"help.getAppChangelog",params:[{name:"prev_app_version",type:"string"}],type:"Updates"},{id:1468322785,method:"messages.getMessagesViews",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector"},{name:"increment",type:"Bool"}],type:"messages.MessageViews"},{id:-871347913,method:"channels.readHistory",params:[{name:"channel",type:"InputChannel"},{name:"max_id",type:"int"}],type:"Bool"},{id:-2067661490,method:"channels.deleteMessages",params:[{name:"channel",type:"InputChannel"},{name:"id",type:"Vector"}],type:"messages.AffectedMessages"},{id:-196443371,method:"channels.reportSpam",params:[{name:"channel",type:"InputChannel"},{name:"participant",type:"InputPeer"},{name:"id",type:"Vector"}],type:"Bool"},{id:-1383294429,method:"channels.getMessages",params:[{name:"channel",type:"InputChannel"},{name:"id",type:"Vector"}],type:"messages.Messages"},{id:2010044880,method:"channels.getParticipants",params:[{name:"channel",type:"InputChannel"},{name:"filter",type:"ChannelParticipantsFilter"},{name:"offset",type:"int"},{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"channels.ChannelParticipants"},{id:-1599378234,method:"channels.getParticipant",params:[{name:"channel",type:"InputChannel"},{name:"participant",type:"InputPeer"}],type:"channels.ChannelParticipant"},{id:176122811,method:"channels.getChannels",params:[{name:"id",type:"Vector"}],type:"messages.Chats"},{id:141781513,method:"channels.getFullChannel",params:[{name:"channel",type:"InputChannel"}],type:"messages.ChatFull"},{id:-1862244601,method:"channels.createChannel",params:[{name:"flags",type:"#"},{name:"broadcast",type:"flags.0?true"},{name:"megagroup",type:"flags.1?true"},{name:"for_import",type:"flags.3?true"},{name:"forum",type:"flags.5?true"},{name:"title",type:"string"},{name:"about",type:"string"},{name:"geo_point",type:"flags.2?InputGeoPoint"},{name:"address",type:"flags.2?string"},{name:"ttl_period",type:"flags.4?int"}],type:"Updates"},{id:-751007486,method:"channels.editAdmin",params:[{name:"channel",type:"InputChannel"},{name:"user_id",type:"InputUser"},{name:"admin_rights",type:"ChatAdminRights"},{name:"rank",type:"string"}],type:"Updates"},{id:1450044624,method:"channels.editTitle",params:[{name:"channel",type:"InputChannel"},{name:"title",type:"string"}],type:"Updates"},{id:-248621111,method:"channels.editPhoto",params:[{name:"channel",type:"InputChannel"},{name:"photo",type:"InputChatPhoto"}],type:"Updates"},{id:283557164,method:"channels.checkUsername",params:[{name:"channel",type:"InputChannel"},{name:"username",type:"string"}],type:"Bool"},{id:890549214,method:"channels.updateUsername",params:[{name:"channel",type:"InputChannel"},{name:"username",type:"string"}],type:"Bool"},{id:615851205,method:"channels.joinChannel",params:[{name:"channel",type:"InputChannel"}],type:"Updates"},{id:-130635115,method:"channels.leaveChannel",params:[{name:"channel",type:"InputChannel"}],type:"Updates"},{id:429865580,method:"channels.inviteToChannel",params:[{name:"channel",type:"InputChannel"},{name:"users",type:"Vector"}],type:"Updates"},{id:-1072619549,method:"channels.deleteChannel",params:[{name:"channel",type:"InputChannel"}],type:"Updates"},{id:51854712,method:"updates.getChannelDifference",params:[{name:"flags",type:"#"},{name:"force",type:"flags.0?true"},{name:"channel",type:"InputChannel"},{name:"filter",type:"ChannelMessagesFilter"},{name:"pts",type:"int"},{name:"limit",type:"int"}],type:"updates.ChannelDifference"},{id:-1470377534,method:"messages.editChatAdmin",params:[{name:"chat_id",type:"long"},{name:"user_id",type:"InputUser"},{name:"is_admin",type:"Bool"}],type:"Bool"},{id:-1568189671,method:"messages.migrateChat",params:[{name:"chat_id",type:"long"}],type:"Updates"},{id:1271290010,method:"messages.searchGlobal",params:[{name:"flags",type:"#"},{name:"folder_id",type:"flags.0?int"},{name:"q",type:"string"},{name:"filter",type:"MessagesFilter"},{name:"min_date",type:"int"},{name:"max_date",type:"int"},{name:"offset_rate",type:"int"},{name:"offset_peer",type:"InputPeer"},{name:"offset_id",type:"int"},{name:"limit",type:"int"}],type:"messages.Messages"},{id:2016638777,method:"messages.reorderStickerSets",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"emojis",type:"flags.1?true"},{name:"order",type:"Vector"}],type:"Bool"},{id:-1309538785,method:"messages.getDocumentByHash",params:[{name:"sha256",type:"bytes"},{name:"size",type:"long"},{name:"mime_type",type:"string"}],type:"Document"},{id:1559270965,method:"messages.getSavedGifs",params:[{name:"hash",type:"long"}],type:"messages.SavedGifs"},{id:846868683,method:"messages.saveGif",params:[{name:"id",type:"InputDocument"},{name:"unsave",type:"Bool"}],type:"Bool"},{id:1364105629,method:"messages.getInlineBotResults",params:[{name:"flags",type:"#"},{name:"bot",type:"InputUser"},{name:"peer",type:"InputPeer"},{name:"geo_point",type:"flags.0?InputGeoPoint"},{name:"query",type:"string"},{name:"offset",type:"string"}],type:"messages.BotResults"},{id:-346119674,method:"messages.setInlineBotResults",params:[{name:"flags",type:"#"},{name:"gallery",type:"flags.0?true"},{name:"private",type:"flags.1?true"},{name:"query_id",type:"long"},{name:"results",type:"Vector"},{name:"cache_time",type:"int"},{name:"next_offset",type:"flags.2?string"},{name:"switch_pm",type:"flags.3?InlineBotSwitchPM"}],type:"Bool"},{id:-738468661,method:"messages.sendInlineBotResult",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.5?true"},{name:"background",type:"flags.6?true"},{name:"clear_draft",type:"flags.7?true"},{name:"hide_via",type:"flags.11?true"},{name:"peer",type:"InputPeer"},{name:"reply_to_msg_id",type:"flags.0?int"},{name:"top_msg_id",type:"flags.9?int"},{name:"random_id",type:"long"},{name:"query_id",type:"long"},{name:"id",type:"string"},{name:"schedule_date",type:"flags.10?int"},{name:"send_as",type:"flags.13?InputPeer"}],type:"Updates"},{id:-432034325,method:"channels.exportMessageLink",params:[{name:"flags",type:"#"},{name:"grouped",type:"flags.0?true"},{name:"thread",type:"flags.1?true"},{name:"channel",type:"InputChannel"},{name:"id",type:"int"}],type:"ExportedMessageLink"},{id:527021574,method:"channels.toggleSignatures",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:1056025023,method:"auth.resendCode",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"}],type:"auth.SentCode"},{id:520357240,method:"auth.cancelCode",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"}],type:"Bool"},{id:-39416522,method:"messages.getMessageEditData",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"int"}],type:"messages.MessageEditData"},{id:1224152952,method:"messages.editMessage",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.1?true"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"message",type:"flags.11?string"},{name:"media",type:"flags.14?InputMedia"},{name:"reply_markup",type:"flags.2?ReplyMarkup"},{name:"entities",type:"flags.3?Vector"},{name:"schedule_date",type:"flags.15?int"}],type:"Updates"},{id:-2091549254,method:"messages.editInlineBotMessage",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.1?true"},{name:"id",type:"InputBotInlineMessageID"},{name:"message",type:"flags.11?string"},{name:"media",type:"flags.14?InputMedia"},{name:"reply_markup",type:"flags.2?ReplyMarkup"},{name:"entities",type:"flags.3?Vector"}],type:"Bool"},{id:-1824339449,method:"messages.getBotCallbackAnswer",params:[{name:"flags",type:"#"},{name:"game",type:"flags.1?true"},{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"data",type:"flags.0?bytes"},{name:"password",type:"flags.2?InputCheckPasswordSRP"}],type:"messages.BotCallbackAnswer"},{id:-712043766,method:"messages.setBotCallbackAnswer",params:[{name:"flags",type:"#"},{name:"alert",type:"flags.1?true"},{name:"query_id",type:"long"},{name:"message",type:"flags.0?string"},{name:"url",type:"flags.2?string"},{name:"cache_time",type:"int"}],type:"Bool"},{id:-1758168906,method:"contacts.getTopPeers",params:[{name:"flags",type:"#"},{name:"correspondents",type:"flags.0?true"},{name:"bots_pm",type:"flags.1?true"},{name:"bots_inline",type:"flags.2?true"},{name:"phone_calls",type:"flags.3?true"},{name:"forward_users",type:"flags.4?true"},{name:"forward_chats",type:"flags.5?true"},{name:"groups",type:"flags.10?true"},{name:"channels",type:"flags.15?true"},{name:"offset",type:"int"},{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"contacts.TopPeers"},{id:451113900,method:"contacts.resetTopPeerRating",params:[{name:"category",type:"TopPeerCategory"},{name:"peer",type:"InputPeer"}],type:"Bool"},{id:-462373635,method:"messages.getPeerDialogs",params:[{name:"peers",type:"Vector"}],type:"messages.PeerDialogs"},{id:-1271718337,method:"messages.saveDraft",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.1?true"},{name:"reply_to_msg_id",type:"flags.0?int"},{name:"top_msg_id",type:"flags.2?int"},{name:"peer",type:"InputPeer"},{name:"message",type:"string"},{name:"entities",type:"flags.3?Vector"}],type:"Bool"},{id:1782549861,method:"messages.getAllDrafts",params:[],type:"Updates"},{id:1685588756,method:"messages.getFeaturedStickers",params:[{name:"hash",type:"long"}],type:"messages.FeaturedStickers"},{id:1527873830,method:"messages.readFeaturedStickers",params:[{name:"id",type:"Vector"}],type:"Bool"},{id:-1649852357,method:"messages.getRecentStickers",params:[{name:"flags",type:"#"},{name:"attached",type:"flags.0?true"},{name:"hash",type:"long"}],type:"messages.RecentStickers"},{id:958863608,method:"messages.saveRecentSticker",params:[{name:"flags",type:"#"},{name:"attached",type:"flags.0?true"},{name:"id",type:"InputDocument"},{name:"unsave",type:"Bool"}],type:"Bool"},{id:-1986437075,method:"messages.clearRecentStickers",params:[{name:"flags",type:"#"},{name:"attached",type:"flags.0?true"}],type:"Bool"},{id:1475442322,method:"messages.getArchivedStickers",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"emojis",type:"flags.1?true"},{name:"offset_id",type:"long"},{name:"limit",type:"int"}],type:"messages.ArchivedStickers"},{id:457157256,method:"account.sendConfirmPhoneCode",params:[{name:"hash",type:"string"},{name:"settings",type:"CodeSettings"}],type:"auth.SentCode"},{id:1596029123,method:"account.confirmPhone",params:[{name:"phone_code_hash",type:"string"},{name:"phone_code",type:"string"}],type:"Bool"},{id:-122669393,method:"channels.getAdminedPublicChannels",params:[{name:"flags",type:"#"},{name:"by_location",type:"flags.0?true"},{name:"check_limit",type:"flags.1?true"}],type:"messages.Chats"},{id:1678738104,method:"messages.getMaskStickers",params:[{name:"hash",type:"long"}],type:"messages.AllStickers"},{id:-866424884,method:"messages.getAttachedStickers",params:[{name:"media",type:"InputStickeredMedia"}],type:"Vector"},{id:-1907842680,method:"auth.dropTempAuthKeys",params:[{name:"except_auth_keys",type:"Vector"}],type:"Bool"},{id:-1896289088,method:"messages.setGameScore",params:[{name:"flags",type:"#"},{name:"edit_message",type:"flags.0?true"},{name:"force",type:"flags.1?true"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"user_id",type:"InputUser"},{name:"score",type:"int"}],type:"Updates"},{id:363700068,method:"messages.setInlineGameScore",params:[{name:"flags",type:"#"},{name:"edit_message",type:"flags.0?true"},{name:"force",type:"flags.1?true"},{name:"id",type:"InputBotInlineMessageID"},{name:"user_id",type:"InputUser"},{name:"score",type:"int"}],type:"Bool"},{id:-400399203,method:"messages.getGameHighScores",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"user_id",type:"InputUser"}],type:"messages.HighScores"},{id:258170395,method:"messages.getInlineGameHighScores",params:[{name:"id",type:"InputBotInlineMessageID"},{name:"user_id",type:"InputUser"}],type:"messages.HighScores"},{id:-468934396,method:"messages.getCommonChats",params:[{name:"user_id",type:"InputUser"},{name:"max_id",type:"long"},{name:"limit",type:"int"}],type:"messages.Chats"},{id:-2023787330,method:"messages.getAllChats",params:[{name:"except_ids",type:"Vector"}],type:"messages.Chats"},{id:-333262899,method:"help.setBotUpdatesStatus",params:[{name:"pending_updates_count",type:"int"},{name:"message",type:"string"}],type:"Bool"},{id:852135825,method:"messages.getWebPage",params:[{name:"url",type:"string"},{name:"hash",type:"int"}],type:"WebPage"},{id:-1489903017,method:"messages.toggleDialogPin",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.0?true"},{name:"peer",type:"InputDialogPeer"}],type:"Bool"},{id:991616823,method:"messages.reorderPinnedDialogs",params:[{name:"flags",type:"#"},{name:"force",type:"flags.0?true"},{name:"folder_id",type:"int"},{name:"order",type:"Vector"}],type:"Bool"},{id:-692498958,method:"messages.getPinnedDialogs",params:[{name:"folder_id",type:"int"}],type:"messages.PeerDialogs"},{id:-1440257555,method:"bots.sendCustomRequest",params:[{name:"custom_method",type:"string"},{name:"params",type:"DataJSON"}],type:"DataJSON"},{id:-434028723,method:"bots.answerWebhookJSONQuery",params:[{name:"query_id",type:"long"},{name:"data",type:"DataJSON"}],type:"Bool"},{id:619086221,method:"upload.getWebFile",params:[{name:"location",type:"InputWebFileLocation"},{name:"offset",type:"int"},{name:"limit",type:"int"}],type:"upload.WebFile"},{id:924093883,method:"payments.getPaymentForm",params:[{name:"flags",type:"#"},{name:"invoice",type:"InputInvoice"},{name:"theme_params",type:"flags.0?DataJSON"}],type:"payments.PaymentForm"},{id:611897804,method:"payments.getPaymentReceipt",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"payments.PaymentReceipt"},{id:-1228345045,method:"payments.validateRequestedInfo",params:[{name:"flags",type:"#"},{name:"save",type:"flags.0?true"},{name:"invoice",type:"InputInvoice"},{name:"info",type:"PaymentRequestedInfo"}],type:"payments.ValidatedRequestedInfo"},{id:755192367,method:"payments.sendPaymentForm",params:[{name:"flags",type:"#"},{name:"form_id",type:"long"},{name:"invoice",type:"InputInvoice"},{name:"requested_info_id",type:"flags.0?string"},{name:"shipping_option_id",type:"flags.1?string"},{name:"credentials",type:"InputPaymentCredentials"},{name:"tip_amount",type:"flags.2?long"}],type:"payments.PaymentResult"},{id:1151208273,method:"account.getTmpPassword",params:[{name:"password",type:"InputCheckPasswordSRP"},{name:"period",type:"int"}],type:"account.TmpPassword"},{id:578650699,method:"payments.getSavedInfo",params:[],type:"payments.SavedInfo"},{id:-667062079,method:"payments.clearSavedInfo",params:[{name:"flags",type:"#"},{name:"credentials",type:"flags.0?true"},{name:"info",type:"flags.1?true"}],type:"Bool"},{id:-436833542,method:"messages.setBotShippingResults",params:[{name:"flags",type:"#"},{name:"query_id",type:"long"},{name:"error",type:"flags.0?string"},{name:"shipping_options",type:"flags.1?Vector"}],type:"Bool"},{id:163765653,method:"messages.setBotPrecheckoutResults",params:[{name:"flags",type:"#"},{name:"success",type:"flags.1?true"},{name:"query_id",type:"long"},{name:"error",type:"flags.0?string"}],type:"Bool"},{id:-1876841625,method:"stickers.createStickerSet",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"animated",type:"flags.1?true"},{name:"videos",type:"flags.4?true"},{name:"emojis",type:"flags.5?true"},{name:"text_color",type:"flags.6?true"},{name:"user_id",type:"InputUser"},{name:"title",type:"string"},{name:"short_name",type:"string"},{name:"thumb",type:"flags.2?InputDocument"},{name:"stickers",type:"Vector"},{name:"software",type:"flags.3?string"}],type:"messages.StickerSet"},{id:-143257775,method:"stickers.removeStickerFromSet",params:[{name:"sticker",type:"InputDocument"}],type:"messages.StickerSet"},{id:-4795190,method:"stickers.changeStickerPosition",params:[{name:"sticker",type:"InputDocument"},{name:"position",type:"int"}],type:"messages.StickerSet"},{id:-2041315650,method:"stickers.addStickerToSet",params:[{name:"stickerset",type:"InputStickerSet"},{name:"sticker",type:"InputStickerSetItem"}],type:"messages.StickerSet"},{id:1369162417,method:"messages.uploadMedia",params:[{name:"peer",type:"InputPeer"},{name:"media",type:"InputMedia"}],type:"MessageMedia"},{id:1430593449,method:"phone.getCallConfig",params:[],type:"DataJSON"},{id:1124046573,method:"phone.requestCall",params:[{name:"flags",type:"#"},{name:"video",type:"flags.0?true"},{name:"user_id",type:"InputUser"},{name:"random_id",type:"int"},{name:"g_a_hash",type:"bytes"},{name:"protocol",type:"PhoneCallProtocol"}],type:"phone.PhoneCall"},{id:1003664544,method:"phone.acceptCall",params:[{name:"peer",type:"InputPhoneCall"},{name:"g_b",type:"bytes"},{name:"protocol",type:"PhoneCallProtocol"}],type:"phone.PhoneCall"},{id:788404002,method:"phone.confirmCall",params:[{name:"peer",type:"InputPhoneCall"},{name:"g_a",type:"bytes"},{name:"key_fingerprint",type:"long"},{name:"protocol",type:"PhoneCallProtocol"}],type:"phone.PhoneCall"},{id:399855457,method:"phone.receivedCall",params:[{name:"peer",type:"InputPhoneCall"}],type:"Bool"},{id:-1295269440,method:"phone.discardCall",params:[{name:"flags",type:"#"},{name:"video",type:"flags.0?true"},{name:"peer",type:"InputPhoneCall"},{name:"duration",type:"int"},{name:"reason",type:"PhoneCallDiscardReason"},{name:"connection_id",type:"long"}],type:"Updates"},{id:1508562471,method:"phone.setCallRating",params:[{name:"flags",type:"#"},{name:"user_initiative",type:"flags.0?true"},{name:"peer",type:"InputPhoneCall"},{name:"rating",type:"int"},{name:"comment",type:"string"}],type:"Updates"},{id:662363518,method:"phone.saveCallDebug",params:[{name:"peer",type:"InputPhoneCall"},{name:"debug",type:"DataJSON"}],type:"Bool"},{id:962554330,method:"upload.getCdnFile",params:[{name:"file_token",type:"bytes"},{name:"offset",type:"long"},{name:"limit",type:"int"}],type:"upload.CdnFile"},{id:-1691921240,method:"upload.reuploadCdnFile",params:[{name:"file_token",type:"bytes"},{name:"request_token",type:"bytes"}],type:"Vector"},{id:1375900482,method:"help.getCdnConfig",params:[],type:"CdnConfig"},{id:-219008246,method:"langpack.getLangPack",params:[{name:"lang_pack",type:"string"},{name:"lang_code",type:"string"}],type:"LangPackDifference"},{id:-269862909,method:"langpack.getStrings",params:[{name:"lang_pack",type:"string"},{name:"lang_code",type:"string"},{name:"keys",type:"Vector"}],type:"Vector"},{id:-845657435,method:"langpack.getDifference",params:[{name:"lang_pack",type:"string"},{name:"lang_code",type:"string"},{name:"from_version",type:"int"}],type:"LangPackDifference"},{id:1120311183,method:"langpack.getLanguages",params:[{name:"lang_pack",type:"string"}],type:"Vector"},{id:-1763259007,method:"channels.editBanned",params:[{name:"channel",type:"InputChannel"},{name:"participant",type:"InputPeer"},{name:"banned_rights",type:"ChatBannedRights"}],type:"Updates"},{id:870184064,method:"channels.getAdminLog",params:[{name:"flags",type:"#"},{name:"channel",type:"InputChannel"},{name:"q",type:"string"},{name:"events_filter",type:"flags.0?ChannelAdminLogEventsFilter"},{name:"admins",type:"flags.1?Vector"},{name:"max_id",type:"long"},{name:"min_id",type:"long"},{name:"limit",type:"int"}],type:"channels.AdminLogResults"},{id:-1847836879,method:"upload.getCdnFileHashes",params:[{name:"file_token",type:"bytes"},{name:"offset",type:"long"}],type:"Vector"},{id:-914493408,method:"messages.sendScreenshotNotification",params:[{name:"peer",type:"InputPeer"},{name:"reply_to_msg_id",type:"int"},{name:"random_id",type:"long"}],type:"Updates"},{id:-359881479,method:"channels.setStickers",params:[{name:"channel",type:"InputChannel"},{name:"stickerset",type:"InputStickerSet"}],type:"Bool"},{id:82946729,method:"messages.getFavedStickers",params:[{name:"hash",type:"long"}],type:"messages.FavedStickers"},{id:-1174420133,method:"messages.faveSticker",params:[{name:"id",type:"InputDocument"},{name:"unfave",type:"Bool"}],type:"Bool"},{id:-357180360,method:"channels.readMessageContents",params:[{name:"channel",type:"InputChannel"},{name:"id",type:"Vector"}],type:"Bool"},{id:-2020263951,method:"contacts.resetSaved",params:[],type:"Bool"},{id:-251140208,method:"messages.getUnreadMentions",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"},{name:"offset_id",type:"int"},{name:"add_offset",type:"int"},{name:"limit",type:"int"},{name:"max_id",type:"int"},{name:"min_id",type:"int"}],type:"messages.Messages"},{id:-1683319225,method:"channels.deleteHistory",params:[{name:"flags",type:"#"},{name:"for_everyone",type:"flags.0?true"},{name:"channel",type:"InputChannel"},{name:"max_id",type:"int"}],type:"Updates"},{id:1036054804,method:"help.getRecentMeUrls",params:[{name:"referer",type:"string"}],type:"help.RecentMeUrls"},{id:-356796084,method:"channels.togglePreHistoryHidden",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:921026381,method:"messages.readMentions",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"}],type:"messages.AffectedHistory"},{id:1881817312,method:"messages.getRecentLocations",params:[{name:"peer",type:"InputPeer"},{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"messages.Messages"},{id:-1225713124,method:"messages.sendMultiMedia",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.5?true"},{name:"background",type:"flags.6?true"},{name:"clear_draft",type:"flags.7?true"},{name:"noforwards",type:"flags.14?true"},{name:"update_stickersets_order",type:"flags.15?true"},{name:"peer",type:"InputPeer"},{name:"reply_to_msg_id",type:"flags.0?int"},{name:"top_msg_id",type:"flags.9?int"},{name:"multi_media",type:"Vector"},{name:"schedule_date",type:"flags.10?int"},{name:"send_as",type:"flags.13?InputPeer"}],type:"Updates"},{id:1347929239,method:"messages.uploadEncryptedFile",params:[{name:"peer",type:"InputEncryptedChat"},{name:"file",type:"InputEncryptedFile"}],type:"EncryptedFile"},{id:405695855,method:"account.getWebAuthorizations",params:[],type:"account.WebAuthorizations"},{id:755087855,method:"account.resetWebAuthorization",params:[{name:"hash",type:"long"}],type:"Bool"},{id:1747789204,method:"account.resetWebAuthorizations",params:[],type:"Bool"},{id:896555914,method:"messages.searchStickerSets",params:[{name:"flags",type:"#"},{name:"exclude_featured",type:"flags.0?true"},{name:"q",type:"string"},{name:"hash",type:"long"}],type:"messages.FoundStickerSets"},{id:-1856595926,method:"upload.getFileHashes",params:[{name:"location",type:"InputFileLocation"},{name:"offset",type:"long"}],type:"Vector"},{id:749019089,method:"help.getTermsOfServiceUpdate",params:[],type:"help.TermsOfServiceUpdate"},{id:-294455398,method:"help.acceptTermsOfService",params:[{name:"id",type:"DataJSON"}],type:"Bool"},{id:-1299661699,method:"account.getAllSecureValues",params:[],type:"Vector"},{id:1936088002,method:"account.getSecureValue",params:[{name:"types",type:"Vector"}],type:"Vector"},{id:-1986010339,method:"account.saveSecureValue",params:[{name:"value",type:"InputSecureValue"},{name:"secure_secret_id",type:"long"}],type:"SecureValue"},{id:-1199522741,method:"account.deleteSecureValue",params:[{name:"types",type:"Vector"}],type:"Bool"},{id:-1865902923,method:"users.setSecureValueErrors",params:[{name:"id",type:"InputUser"},{name:"errors",type:"Vector"}],type:"Bool"},{id:-1456907910,method:"account.getAuthorizationForm",params:[{name:"bot_id",type:"long"},{name:"scope",type:"string"},{name:"public_key",type:"string"}],type:"account.AuthorizationForm"},{id:-202552205,method:"account.acceptAuthorization",params:[{name:"bot_id",type:"long"},{name:"scope",type:"string"},{name:"public_key",type:"string"},{name:"value_hashes",type:"Vector"},{name:"credentials",type:"SecureCredentialsEncrypted"}],type:"Bool"},{id:-1516022023,method:"account.sendVerifyPhoneCode",params:[{name:"phone_number",type:"string"},{name:"settings",type:"CodeSettings"}],type:"auth.SentCode"},{id:1305716726,method:"account.verifyPhone",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"},{name:"phone_code",type:"string"}],type:"Bool"},{id:-1730136133,method:"account.sendVerifyEmailCode",params:[{name:"purpose",type:"EmailVerifyPurpose"},{name:"email",type:"string"}],type:"account.SentEmailCode"},{id:53322959,method:"account.verifyEmail",params:[{name:"purpose",type:"EmailVerifyPurpose"},{name:"verification",type:"EmailVerification"}],type:"account.EmailVerified"},{id:1072547679,method:"help.getDeepLinkInfo",params:[{name:"path",type:"string"}],type:"help.DeepLinkInfo"},{id:-2098076769,method:"contacts.getSaved",params:[],type:"Vector"},{id:-2092831552,method:"channels.getLeftChannels",params:[{name:"offset",type:"int"}],type:"messages.Chats"},{id:-1896617296,method:"account.initTakeoutSession",params:[{name:"flags",type:"#"},{name:"contacts",type:"flags.0?true"},{name:"message_users",type:"flags.1?true"},{name:"message_chats",type:"flags.2?true"},{name:"message_megagroups",type:"flags.3?true"},{name:"message_channels",type:"flags.4?true"},{name:"files",type:"flags.5?true"},{name:"file_max_size",type:"flags.5?long"}],type:"account.Takeout"},{id:489050862,method:"account.finishTakeoutSession",params:[{name:"flags",type:"#"},{name:"success",type:"flags.0?true"}],type:"Bool"},{id:486505992,method:"messages.getSplitRanges",params:[],type:"Vector"},{id:911373810,method:"invokeWithMessagesRange",params:[{name:"range",type:"MessageRange"},{name:"query",type:"!X"}],type:"X"},{id:-1398145746,method:"invokeWithTakeout",params:[{name:"takeout_id",type:"long"},{name:"query",type:"!X"}],type:"X"},{id:-1031349873,method:"messages.markDialogUnread",params:[{name:"flags",type:"#"},{name:"unread",type:"flags.0?true"},{name:"peer",type:"InputDialogPeer"}],type:"Bool"},{id:585256482,method:"messages.getDialogUnreadMarks",params:[],type:"Vector"},{id:-2062238246,method:"contacts.toggleTopPeers",params:[{name:"enabled",type:"Bool"}],type:"Bool"},{id:2119757468,method:"messages.clearAllDrafts",params:[],type:"Bool"},{id:-1735311088,method:"help.getAppConfig",params:[],type:"JSONValue"},{id:1862465352,method:"help.saveAppLog",params:[{name:"events",type:"Vector"}],type:"Bool"},{id:-966677240,method:"help.getPassportConfig",params:[{name:"hash",type:"int"}],type:"help.PassportConfig"},{id:1784243458,method:"langpack.getLanguage",params:[{name:"lang_pack",type:"string"},{name:"lang_code",type:"string"}],type:"LangPackLanguage"},{id:-760547348,method:"messages.updatePinnedMessage",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.0?true"},{name:"unpin",type:"flags.1?true"},{name:"pm_oneside",type:"flags.2?true"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"}],type:"Updates"},{id:-1881204448,method:"account.confirmPasswordEmail",params:[{name:"code",type:"string"}],type:"Bool"},{id:2055154197,method:"account.resendPasswordEmail",params:[],type:"Bool"},{id:-1043606090,method:"account.cancelPasswordEmail",params:[],type:"Bool"},{id:-748624084,method:"help.getSupportName",params:[],type:"help.SupportName"},{id:59377875,method:"help.getUserInfo",params:[{name:"user_id",type:"InputUser"}],type:"help.UserInfo"},{id:1723407216,method:"help.editUserInfo",params:[{name:"user_id",type:"InputUser"},{name:"message",type:"string"},{name:"entities",type:"Vector"}],type:"help.UserInfo"},{id:-1626880216,method:"account.getContactSignUpNotification",params:[],type:"Bool"},{id:-806076575,method:"account.setContactSignUpNotification",params:[{name:"silent",type:"Bool"}],type:"Bool"},{id:1398240377,method:"account.getNotifyExceptions",params:[{name:"flags",type:"#"},{name:"compare_sound",type:"flags.1?true"},{name:"peer",type:"flags.0?InputNotifyPeer"}],type:"Updates"},{id:283795844,method:"messages.sendVote",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"options",type:"Vector"}],type:"Updates"},{id:1941660731,method:"messages.getPollResults",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"Updates"},{id:1848369232,method:"messages.getOnlines",params:[{name:"peer",type:"InputPeer"}],type:"ChatOnlines"},{id:-554301545,method:"messages.editChatAbout",params:[{name:"peer",type:"InputPeer"},{name:"about",type:"string"}],type:"Bool"},{id:-1517917375,method:"messages.editChatDefaultBannedRights",params:[{name:"peer",type:"InputPeer"},{name:"banned_rights",type:"ChatBannedRights"}],type:"Updates"},{id:-57811990,method:"account.getWallPaper",params:[{name:"wallpaper",type:"InputWallPaper"}],type:"WallPaper"},{id:-578472351,method:"account.uploadWallPaper",params:[{name:"file",type:"InputFile"},{name:"mime_type",type:"string"},{name:"settings",type:"WallPaperSettings"}],type:"WallPaper"},{id:1817860919,method:"account.saveWallPaper",params:[{name:"wallpaper",type:"InputWallPaper"},{name:"unsave",type:"Bool"},{name:"settings",type:"WallPaperSettings"}],type:"Bool"},{id:-18000023,method:"account.installWallPaper",params:[{name:"wallpaper",type:"InputWallPaper"},{name:"settings",type:"WallPaperSettings"}],type:"Bool"},{id:-1153722364,method:"account.resetWallPapers",params:[],type:"Bool"},{id:1457130303,method:"account.getAutoDownloadSettings",params:[],type:"account.AutoDownloadSettings"},{id:1995661875,method:"account.saveAutoDownloadSettings",params:[{name:"flags",type:"#"},{name:"low",type:"flags.0?true"},{name:"high",type:"flags.1?true"},{name:"settings",type:"AutoDownloadSettings"}],type:"Bool"},{id:899735650,method:"messages.getEmojiKeywords",params:[{name:"lang_code",type:"string"}],type:"EmojiKeywordsDifference"},{id:352892591,method:"messages.getEmojiKeywordsDifference",params:[{name:"lang_code",type:"string"},{name:"from_version",type:"int"}],type:"EmojiKeywordsDifference"},{id:1318675378,method:"messages.getEmojiKeywordsLanguages",params:[{name:"lang_codes",type:"Vector"}],type:"Vector"},{id:-709817306,method:"messages.getEmojiURL",params:[{name:"lang_code",type:"string"}],type:"EmojiURL"},{id:1749536939,method:"folders.editPeerFolders",params:[{name:"folder_peers",type:"Vector"}],type:"Updates"},{id:472471681,method:"folders.deleteFolder",params:[{name:"folder_id",type:"int"}],type:"Updates"},{id:11435201,method:"messages.getSearchCounters",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"},{name:"filters",type:"Vector"}],type:"Vector"},{id:-170208392,method:"channels.getGroupsForDiscussion",params:[],type:"messages.Chats"},{id:1079520178,method:"channels.setDiscussionGroup",params:[{name:"broadcast",type:"InputChannel"},{name:"group",type:"InputChannel"}],type:"Bool"},{id:428848198,method:"messages.requestUrlAuth",params:[{name:"flags",type:"#"},{name:"peer",type:"flags.1?InputPeer"},{name:"msg_id",type:"flags.1?int"},{name:"button_id",type:"flags.1?int"},{name:"url",type:"flags.2?string"}],type:"UrlAuthResult"},{id:-1322487515,method:"messages.acceptUrlAuth",params:[{name:"flags",type:"#"},{name:"write_allowed",type:"flags.0?true"},{name:"peer",type:"flags.1?InputPeer"},{name:"msg_id",type:"flags.1?int"},{name:"button_id",type:"flags.1?int"},{name:"url",type:"flags.2?string"}],type:"UrlAuthResult"},{id:1336717624,method:"messages.hidePeerSettingsBar",params:[{name:"peer",type:"InputPeer"}],type:"Bool"},{id:-386636848,method:"contacts.addContact",params:[{name:"flags",type:"#"},{name:"add_phone_privacy_exception",type:"flags.0?true"},{name:"id",type:"InputUser"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"phone",type:"string"}],type:"Updates"},{id:-130964977,method:"contacts.acceptContact",params:[{name:"id",type:"InputUser"}],type:"Updates"},{id:-1892102881,method:"channels.editCreator",params:[{name:"channel",type:"InputChannel"},{name:"user_id",type:"InputUser"},{name:"password",type:"InputCheckPasswordSRP"}],type:"Updates"},{id:-750207932,method:"contacts.getLocated",params:[{name:"flags",type:"#"},{name:"background",type:"flags.1?true"},{name:"geo_point",type:"InputGeoPoint"},{name:"self_expires",type:"flags.0?int"}],type:"Updates"},{id:1491484525,method:"channels.editLocation",params:[{name:"channel",type:"InputChannel"},{name:"geo_point",type:"InputGeoPoint"},{name:"address",type:"string"}],type:"Bool"},{id:-304832784,method:"channels.toggleSlowMode",params:[{name:"channel",type:"InputChannel"},{name:"seconds",type:"int"}],type:"Updates"},{id:-183077365,method:"messages.getScheduledHistory",params:[{name:"peer",type:"InputPeer"},{name:"hash",type:"long"}],type:"messages.Messages"},{id:-1111817116,method:"messages.getScheduledMessages",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector"}],type:"messages.Messages"},{id:-1120369398,method:"messages.sendScheduledMessages",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector"}],type:"Updates"},{id:1504586518,method:"messages.deleteScheduledMessages",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector"}],type:"Updates"},{id:473805619,method:"account.uploadTheme",params:[{name:"flags",type:"#"},{name:"file",type:"InputFile"},{name:"thumb",type:"flags.0?InputFile"},{name:"file_name",type:"string"},{name:"mime_type",type:"string"}],type:"Document"},{id:1697530880,method:"account.createTheme",params:[{name:"flags",type:"#"},{name:"slug",type:"string"},{name:"title",type:"string"},{name:"document",type:"flags.2?InputDocument"},{name:"settings",type:"flags.3?Vector"}],type:"Theme"},{id:737414348,method:"account.updateTheme",params:[{name:"flags",type:"#"},{name:"format",type:"string"},{name:"theme",type:"InputTheme"},{name:"slug",type:"flags.0?string"},{name:"title",type:"flags.1?string"},{name:"document",type:"flags.2?InputDocument"},{name:"settings",type:"flags.3?Vector"}],type:"Theme"},{id:-229175188,method:"account.saveTheme",params:[{name:"theme",type:"InputTheme"},{name:"unsave",type:"Bool"}],type:"Bool"},{id:-953697477,method:"account.installTheme",params:[{name:"flags",type:"#"},{name:"dark",type:"flags.0?true"},{name:"theme",type:"flags.1?InputTheme"},{name:"format",type:"flags.2?string"},{name:"base_theme",type:"flags.3?BaseTheme"}],type:"Bool"},{id:978872812,method:"account.getTheme",params:[{name:"format",type:"string"},{name:"theme",type:"InputTheme"}],type:"Theme"},{id:1913054296,method:"account.getThemes",params:[{name:"format",type:"string"},{name:"hash",type:"long"}],type:"account.Themes"},{id:-1210022402,method:"auth.exportLoginToken",params:[{name:"api_id",type:"int"},{name:"api_hash",type:"string"},{name:"except_ids",type:"Vector"}],type:"auth.LoginToken"},{id:-1783866140,method:"auth.importLoginToken",params:[{name:"token",type:"bytes"}],type:"auth.LoginToken"},{id:-392909491,method:"auth.acceptLoginToken",params:[{name:"token",type:"bytes"}],type:"Authorization"},{id:-1250643605,method:"account.setContentSettings",params:[{name:"flags",type:"#"},{name:"sensitive_enabled",type:"flags.0?true"}],type:"Bool"},{id:-1952756306,method:"account.getContentSettings",params:[],type:"account.ContentSettings"},{id:300429806,method:"channels.getInactiveChannels",params:[],type:"messages.InactiveChats"},{id:1705865692,method:"account.getMultiWallPapers",params:[{name:"wallpapers",type:"Vector"}],type:"Vector"},{id:-1200736242,method:"messages.getPollVotes",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"option",type:"flags.0?bytes"},{name:"offset",type:"flags.1?string"},{name:"limit",type:"int"}],type:"messages.VotesList"},{id:-1257951254,method:"messages.toggleStickerSets",params:[{name:"flags",type:"#"},{name:"uninstall",type:"flags.0?true"},{name:"archive",type:"flags.1?true"},{name:"unarchive",type:"flags.2?true"},{name:"stickersets",type:"Vector"}],type:"Bool"},{id:779736953,method:"payments.getBankCardData",params:[{name:"number",type:"string"}],type:"payments.BankCardData"},{id:-241247891,method:"messages.getDialogFilters",params:[],type:"Vector"},{id:-1566780372,method:"messages.getSuggestedDialogFilters",params:[],type:"Vector"},{id:450142282,method:"messages.updateDialogFilter",params:[{name:"flags",type:"#"},{name:"id",type:"int"},{name:"filter",type:"flags.0?DialogFilter"}],type:"Bool"},{id:-983318044,method:"messages.updateDialogFiltersOrder",params:[{name:"order",type:"Vector"}],type:"Bool"},{id:-1421720550,method:"stats.getBroadcastStats",params:[{name:"flags",type:"#"},{name:"dark",type:"flags.0?true"},{name:"channel",type:"InputChannel"}],type:"stats.BroadcastStats"},{id:1646092192,method:"stats.loadAsyncGraph",params:[{name:"flags",type:"#"},{name:"token",type:"string"},{name:"x",type:"flags.0?long"}],type:"StatsGraph"},{id:-1707717072,method:"stickers.setStickerSetThumb",params:[{name:"stickerset",type:"InputStickerSet"},{name:"thumb",type:"InputDocument"}],type:"messages.StickerSet"},{id:85399130,method:"bots.setBotCommands",params:[{name:"scope",type:"BotCommandScope"},{name:"lang_code",type:"string"},{name:"commands",type:"Vector"}],type:"Bool"},{id:2127598753,method:"messages.getOldFeaturedStickers",params:[{name:"offset",type:"int"},{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"messages.FeaturedStickers"},{id:-1063816159,method:"help.getPromoData",params:[],type:"help.PromoData"},{id:505748629,method:"help.hidePromoData",params:[{name:"peer",type:"InputPeer"}],type:"Bool"},{id:-8744061,method:"phone.sendSignalingData",params:[{name:"peer",type:"InputPhoneCall"},{name:"data",type:"bytes"}],type:"Bool"},{id:-589330937,method:"stats.getMegagroupStats",params:[{name:"flags",type:"#"},{name:"dark",type:"flags.0?true"},{name:"channel",type:"InputChannel"}],type:"stats.MegagroupStats"},{id:-349483786,method:"account.getGlobalPrivacySettings",params:[],type:"GlobalPrivacySettings"},{id:517647042,method:"account.setGlobalPrivacySettings",params:[{name:"settings",type:"GlobalPrivacySettings"}],type:"GlobalPrivacySettings"},{id:-183649631,method:"help.dismissSuggestion",params:[{name:"peer",type:"InputPeer"},{name:"suggestion",type:"string"}],type:"Bool"},{id:1935116200,method:"help.getCountriesList",params:[{name:"lang_code",type:"string"},{name:"hash",type:"int"}],type:"help.CountriesList"},{id:584962828,method:"messages.getReplies",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"offset_id",type:"int"},{name:"offset_date",type:"int"},{name:"add_offset",type:"int"},{name:"limit",type:"int"},{name:"max_id",type:"int"},{name:"min_id",type:"int"},{name:"hash",type:"long"}],type:"messages.Messages"},{id:1147761405,method:"messages.getDiscussionMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"messages.DiscussionMessage"},{id:-147740172,method:"messages.readDiscussion",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"read_max_id",type:"int"}],type:"Bool"},{id:698914348,method:"contacts.blockFromReplies",params:[{name:"flags",type:"#"},{name:"delete_message",type:"flags.0?true"},{name:"delete_history",type:"flags.1?true"},{name:"report_spam",type:"flags.2?true"},{name:"msg_id",type:"int"}],type:"Updates"},{id:1445996571,method:"stats.getMessagePublicForwards",params:[{name:"channel",type:"InputChannel"},{name:"msg_id",type:"int"},{name:"offset_rate",type:"int"},{name:"offset_peer",type:"InputPeer"},{name:"offset_id",type:"int"},{name:"limit",type:"int"}],type:"messages.Messages"},{id:-1226791947,method:"stats.getMessageStats",params:[{name:"flags",type:"#"},{name:"dark",type:"flags.0?true"},{name:"channel",type:"InputChannel"},{name:"msg_id",type:"int"}],type:"stats.MessageStats"},{id:-299714136,method:"messages.unpinAllMessages",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"}],type:"messages.AffectedHistory"},{id:1221445336,method:"phone.createGroupCall",params:[{name:"flags",type:"#"},{name:"rtmp_stream",type:"flags.2?true"},{name:"peer",type:"InputPeer"},{name:"random_id",type:"int"},{name:"title",type:"flags.0?string"},{name:"schedule_date",type:"flags.1?int"}],type:"Updates"},{id:-1322057861,method:"phone.joinGroupCall",params:[{name:"flags",type:"#"},{name:"muted",type:"flags.0?true"},{name:"video_stopped",type:"flags.2?true"},{name:"call",type:"InputGroupCall"},{name:"join_as",type:"InputPeer"},{name:"invite_hash",type:"flags.1?string"},{name:"params",type:"DataJSON"}],type:"Updates"},{id:1342404601,method:"phone.leaveGroupCall",params:[{name:"call",type:"InputGroupCall"},{name:"source",type:"int"}],type:"Updates"},{id:2067345760,method:"phone.inviteToGroupCall",params:[{name:"call",type:"InputGroupCall"},{name:"users",type:"Vector"}],type:"Updates"},{id:2054648117,method:"phone.discardGroupCall",params:[{name:"call",type:"InputGroupCall"}],type:"Updates"},{id:1958458429,method:"phone.toggleGroupCallSettings",params:[{name:"flags",type:"#"},{name:"reset_invite_hash",type:"flags.1?true"},{name:"call",type:"InputGroupCall"},{name:"join_muted",type:"flags.0?Bool"}],type:"Updates"},{id:68699611,method:"phone.getGroupCall",params:[{name:"call",type:"InputGroupCall"},{name:"limit",type:"int"}],type:"phone.GroupCall"},{id:-984033109,method:"phone.getGroupParticipants",params:[{name:"call",type:"InputGroupCall"},{name:"ids",type:"Vector"},{name:"sources",type:"Vector"},{name:"offset",type:"string"},{name:"limit",type:"int"}],type:"phone.GroupParticipants"},{id:-1248003721,method:"phone.checkGroupCall",params:[{name:"call",type:"InputGroupCall"},{name:"sources",type:"Vector"}],type:"Vector"},{id:1540419152,method:"messages.deleteChat",params:[{name:"chat_id",type:"long"}],type:"Bool"},{id:-104078327,method:"messages.deletePhoneCallHistory",params:[{name:"flags",type:"#"},{name:"revoke",type:"flags.0?true"}],type:"messages.AffectedFoundMessages"},{id:1140726259,method:"messages.checkHistoryImport",params:[{name:"import_head",type:"string"}],type:"messages.HistoryImportParsed"},{id:873008187,method:"messages.initHistoryImport",params:[{name:"peer",type:"InputPeer"},{name:"file",type:"InputFile"},{name:"media_count",type:"int"}],type:"messages.HistoryImport"},{id:713433234,method:"messages.uploadImportedMedia",params:[{name:"peer",type:"InputPeer"},{name:"import_id",type:"long"},{name:"file_name",type:"string"},{name:"media",type:"InputMedia"}],type:"MessageMedia"},{id:-1271008444,method:"messages.startHistoryImport",params:[{name:"peer",type:"InputPeer"},{name:"import_id",type:"long"}],type:"Bool"},{id:-1565154314,method:"messages.getExportedChatInvites",params:[{name:"flags",type:"#"},{name:"revoked",type:"flags.3?true"},{name:"peer",type:"InputPeer"},{name:"admin_id",type:"InputUser"},{name:"offset_date",type:"flags.2?int"},{name:"offset_link",type:"flags.2?string"},{name:"limit",type:"int"}],type:"messages.ExportedChatInvites"},{id:1937010524,method:"messages.getExportedChatInvite",params:[{name:"peer",type:"InputPeer"},{name:"link",type:"string"}],type:"messages.ExportedChatInvite"},{id:-1110823051,method:"messages.editExportedChatInvite",params:[{name:"flags",type:"#"},{name:"revoked",type:"flags.2?true"},{name:"peer",type:"InputPeer"},{name:"link",type:"string"},{name:"expire_date",type:"flags.0?int"},{name:"usage_limit",type:"flags.1?int"},{name:"request_needed",type:"flags.3?Bool"},{name:"title",type:"flags.4?string"}],type:"messages.ExportedChatInvite"},{id:1452833749,method:"messages.deleteRevokedExportedChatInvites",params:[{name:"peer",type:"InputPeer"},{name:"admin_id",type:"InputUser"}],type:"Bool"},{id:-731601877,method:"messages.deleteExportedChatInvite",params:[{name:"peer",type:"InputPeer"},{name:"link",type:"string"}],type:"Bool"},{id:958457583,method:"messages.getAdminsWithInvites",params:[{name:"peer",type:"InputPeer"}],type:"messages.ChatAdminsWithInvites"},{id:-553329330,method:"messages.getChatInviteImporters",params:[{name:"flags",type:"#"},{name:"requested",type:"flags.0?true"},{name:"peer",type:"InputPeer"},{name:"link",type:"flags.1?string"},{name:"q",type:"flags.2?string"},{name:"offset_date",type:"int"},{name:"offset_user",type:"InputUser"},{name:"limit",type:"int"}],type:"messages.ChatInviteImporters"},{id:-1207017500,method:"messages.setHistoryTTL",params:[{name:"peer",type:"InputPeer"},{name:"period",type:"int"}],type:"Updates"},{id:-91437323,method:"account.reportProfilePhoto",params:[{name:"peer",type:"InputPeer"},{name:"photo_id",type:"InputPhoto"},{name:"reason",type:"ReportReason"},{name:"message",type:"string"}],type:"Bool"},{id:187239529,method:"channels.convertToGigagroup",params:[{name:"channel",type:"InputChannel"}],type:"Updates"},{id:1573261059,method:"messages.checkHistoryImportPeer",params:[{name:"peer",type:"InputPeer"}],type:"messages.CheckedHistoryImportPeer"},{id:-248985848,method:"phone.toggleGroupCallRecord",params:[{name:"flags",type:"#"},{name:"start",type:"flags.0?true"},{name:"video",type:"flags.2?true"},{name:"call",type:"InputGroupCall"},{name:"title",type:"flags.1?string"},{name:"video_portrait",type:"flags.2?Bool"}],type:"Updates"},{id:-1524155713,method:"phone.editGroupCallParticipant",params:[{name:"flags",type:"#"},{name:"call",type:"InputGroupCall"},{name:"participant",type:"InputPeer"},{name:"muted",type:"flags.0?Bool"},{name:"volume",type:"flags.1?int"},{name:"raise_hand",type:"flags.2?Bool"},{name:"video_stopped",type:"flags.3?Bool"},{name:"video_paused",type:"flags.4?Bool"},{name:"presentation_paused",type:"flags.5?Bool"}],type:"Updates"},{id:480685066,method:"phone.editGroupCallTitle",params:[{name:"call",type:"InputGroupCall"},{name:"title",type:"string"}],type:"Updates"},{id:-277077702,method:"phone.getGroupCallJoinAs",params:[{name:"peer",type:"InputPeer"}],type:"phone.JoinAsPeers"},{id:-425040769,method:"phone.exportGroupCallInvite",params:[{name:"flags",type:"#"},{name:"can_self_unmute",type:"flags.0?true"},{name:"call",type:"InputGroupCall"}],type:"phone.ExportedGroupCallInvite"},{id:563885286,method:"phone.toggleGroupCallStartSubscription",params:[{name:"call",type:"InputGroupCall"},{name:"subscribed",type:"Bool"}],type:"Updates"},{id:1451287362,method:"phone.startScheduledGroupCall",params:[{name:"call",type:"InputGroupCall"}],type:"Updates"},{id:1465786252,method:"phone.saveDefaultGroupCallJoinAs",params:[{name:"peer",type:"InputPeer"},{name:"join_as",type:"InputPeer"}],type:"Bool"},{id:-873829436,method:"phone.joinGroupCallPresentation",params:[{name:"call",type:"InputGroupCall"},{name:"params",type:"DataJSON"}],type:"Updates"},{id:475058500,method:"phone.leaveGroupCallPresentation",params:[{name:"call",type:"InputGroupCall"}],type:"Updates"},{id:676017721,method:"stickers.checkShortName",params:[{name:"short_name",type:"string"}],type:"Bool"},{id:1303364867,method:"stickers.suggestShortName",params:[{name:"title",type:"string"}],type:"stickers.SuggestedShortName"},{id:1032708345,method:"bots.resetBotCommands",params:[{name:"scope",type:"BotCommandScope"},{name:"lang_code",type:"string"}],type:"Bool"},{id:-481554986,method:"bots.getBotCommands",params:[{name:"scope",type:"BotCommandScope"},{name:"lang_code",type:"string"}],type:"Vector"},{id:-1828139493,method:"account.resetPassword",params:[],type:"account.ResetPasswordResult"},{id:1284770294,method:"account.declinePasswordReset",params:[],type:"Bool"},{id:221691769,method:"auth.checkRecoveryPassword",params:[{name:"code",type:"string"}],type:"Bool"},{id:-700916087,method:"account.getChatThemes",params:[{name:"hash",type:"long"}],type:"account.Themes"},{id:-432283329,method:"messages.setChatTheme",params:[{name:"peer",type:"InputPeer"},{name:"emoticon",type:"string"}],type:"Updates"},{id:-1095836780,method:"channels.viewSponsoredMessage",params:[{name:"channel",type:"InputChannel"},{name:"random_id",type:"bytes"}],type:"Bool"},{id:-333377601,method:"channels.getSponsoredMessages",params:[{name:"channel",type:"InputChannel"}],type:"messages.SponsoredMessages"},{id:745510839,method:"messages.getMessageReadParticipants",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"Vector"},{id:1240514025,method:"messages.getSearchResultsCalendar",params:[{name:"peer",type:"InputPeer"},{name:"filter",type:"MessagesFilter"},{name:"offset_id",type:"int"},{name:"offset_date",type:"int"}],type:"messages.SearchResultsCalendar"},{id:1855292323,method:"messages.getSearchResultsPositions",params:[{name:"peer",type:"InputPeer"},{name:"filter",type:"MessagesFilter"},{name:"offset_id",type:"int"},{name:"limit",type:"int"}],type:"messages.SearchResultsPositions"},{id:2145904661,method:"messages.hideChatJoinRequest",params:[{name:"flags",type:"#"},{name:"approved",type:"flags.0?true"},{name:"peer",type:"InputPeer"},{name:"user_id",type:"InputUser"}],type:"Updates"},{id:-528091926,method:"messages.hideAllChatJoinRequests",params:[{name:"flags",type:"#"},{name:"approved",type:"flags.0?true"},{name:"peer",type:"InputPeer"},{name:"link",type:"flags.1?string"}],type:"Updates"},{id:-1323389022,method:"messages.toggleNoForwards",params:[{name:"peer",type:"InputPeer"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:-855777386,method:"messages.saveDefaultSendAs",params:[{name:"peer",type:"InputPeer"},{name:"send_as",type:"InputPeer"}],type:"Bool"},{id:231174382,method:"channels.getSendAs",params:[{name:"peer",type:"InputPeer"}],type:"channels.SendAsPeers"},{id:-1081501024,method:"account.setAuthorizationTTL",params:[{name:"authorization_ttl_days",type:"int"}],type:"Bool"},{id:1089766498,method:"account.changeAuthorizationSettings",params:[{name:"flags",type:"#"},{name:"hash",type:"long"},{name:"encrypted_requests_disabled",type:"flags.0?Bool"},{name:"call_requests_disabled",type:"flags.1?Bool"}],type:"Bool"},{id:913655003,method:"channels.deleteParticipantHistory",params:[{name:"channel",type:"InputChannel"},{name:"participant",type:"InputPeer"}],type:"messages.AffectedHistory"},{id:-754091820,method:"messages.sendReaction",params:[{name:"flags",type:"#"},{name:"big",type:"flags.1?true"},{name:"add_to_recent",type:"flags.2?true"},{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"reaction",type:"flags.0?Vector"}],type:"Updates"},{id:-1950707482,method:"messages.getMessagesReactions",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector"}],type:"Updates"},{id:1176190792,method:"messages.getMessageReactionsList",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"reaction",type:"flags.0?Reaction"},{name:"offset",type:"flags.1?string"},{name:"limit",type:"int"}],type:"messages.MessageReactionsList"},{id:-21928079,method:"messages.setChatAvailableReactions",params:[{name:"peer",type:"InputPeer"},{name:"available_reactions",type:"ChatReactions"}],type:"Updates"},{id:417243308,method:"messages.getAvailableReactions",params:[{name:"hash",type:"int"}],type:"messages.AvailableReactions"},{id:1330094102,method:"messages.setDefaultReaction",params:[{name:"reaction",type:"Reaction"}],type:"Bool"},{id:1662529584,method:"messages.translateText",params:[{name:"flags",type:"#"},{name:"peer",type:"flags.0?InputPeer"},{name:"id",type:"flags.0?Vector"},{name:"text",type:"flags.1?Vector"},{name:"to_lang",type:"string"}],type:"messages.TranslatedText"},{id:841173339,method:"messages.getUnreadReactions",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"},{name:"offset_id",type:"int"},{name:"add_offset",type:"int"},{name:"limit",type:"int"},{name:"max_id",type:"int"},{name:"min_id",type:"int"}],type:"messages.Messages"},{id:1420459918,method:"messages.readReactions",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"}],type:"messages.AffectedHistory"},{id:-1963375804,method:"contacts.resolvePhone",params:[{name:"phone",type:"string"}],type:"contacts.ResolvedPeer"},{id:447879488,method:"phone.getGroupCallStreamChannels",params:[{name:"call",type:"InputGroupCall"}],type:"phone.GroupCallStreamChannels"},{id:-558650433,method:"phone.getGroupCallStreamRtmpUrl",params:[{name:"peer",type:"InputPeer"},{name:"revoke",type:"Bool"}],type:"phone.GroupCallStreamRtmpUrl"},{id:276705696,method:"messages.searchSentMedia",params:[{name:"q",type:"string"},{name:"filter",type:"MessagesFilter"},{name:"limit",type:"int"}],type:"messages.Messages"},{id:385663691,method:"messages.getAttachMenuBots",params:[{name:"hash",type:"long"}],type:"AttachMenuBots"},{id:1998676370,method:"messages.getAttachMenuBot",params:[{name:"bot",type:"InputUser"}],type:"AttachMenuBotsBot"},{id:1777704297,method:"messages.toggleBotInAttachMenu",params:[{name:"flags",type:"#"},{name:"write_allowed",type:"flags.0?true"},{name:"bot",type:"InputUser"},{name:"enabled",type:"Bool"}],type:"Bool"},{id:395003915,method:"messages.requestWebView",params:[{name:"flags",type:"#"},{name:"from_bot_menu",type:"flags.4?true"},{name:"silent",type:"flags.5?true"},{name:"peer",type:"InputPeer"},{name:"bot",type:"InputUser"},{name:"url",type:"flags.1?string"},{name:"start_param",type:"flags.3?string"},{name:"theme_params",type:"flags.2?DataJSON"},{name:"platform",type:"string"},{name:"reply_to_msg_id",type:"flags.0?int"},{name:"top_msg_id",type:"flags.9?int"},{name:"send_as",type:"flags.13?InputPeer"}],type:"WebViewResult"},{id:2146648841,method:"messages.prolongWebView",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.5?true"},{name:"peer",type:"InputPeer"},{name:"bot",type:"InputUser"},{name:"query_id",type:"long"},{name:"reply_to_msg_id",type:"flags.0?int"},{name:"top_msg_id",type:"flags.9?int"},{name:"send_as",type:"flags.13?InputPeer"}],type:"Bool"},{id:698084494,method:"messages.requestSimpleWebView",params:[{name:"flags",type:"#"},{name:"bot",type:"InputUser"},{name:"url",type:"string"},{name:"theme_params",type:"flags.0?DataJSON"},{name:"platform",type:"string"}],type:"SimpleWebViewResult"},{id:172168437,method:"messages.sendWebViewResultMessage",params:[{name:"bot_query_id",type:"string"},{name:"result",type:"InputBotInlineResult"}],type:"WebViewMessageSent"},{id:-603831608,method:"messages.sendWebViewData",params:[{name:"bot",type:"InputUser"},{name:"random_id",type:"long"},{name:"button_text",type:"string"},{name:"data",type:"string"}],type:"Updates"},{id:1157944655,method:"bots.setBotMenuButton",params:[{name:"user_id",type:"InputUser"},{name:"button",type:"BotMenuButton"}],type:"Bool"},{id:-1671369944,method:"bots.getBotMenuButton",params:[{name:"user_id",type:"InputUser"}],type:"BotMenuButton"},{id:-510647672,method:"account.getSavedRingtones",params:[{name:"hash",type:"long"}],type:"account.SavedRingtones"},{id:1038768899,method:"account.saveRingtone",params:[{name:"id",type:"InputDocument"},{name:"unsave",type:"Bool"}],type:"account.SavedRingtone"},{id:-2095414366,method:"account.uploadRingtone",params:[{name:"file",type:"InputFile"},{name:"file_name",type:"string"},{name:"mime_type",type:"string"}],type:"Document"},{id:2021942497,method:"bots.setBotBroadcastDefaultAdminRights",params:[{name:"admin_rights",type:"ChatAdminRights"}],type:"Bool"},{id:-1839281686,method:"bots.setBotGroupDefaultAdminRights",params:[{name:"admin_rights",type:"ChatAdminRights"}],type:"Bool"},{id:1092913030,method:"phone.saveCallLog",params:[{name:"peer",type:"InputPhoneCall"},{name:"file",type:"InputFile"}],type:"Bool"},{id:-456419968,method:"channels.toggleJoinToSend",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:1277789622,method:"channels.toggleJoinRequest",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:261206117,method:"payments.exportInvoice",params:[{name:"invoice_media",type:"InputMedia"}],type:"payments.ExportedInvoice"},{id:647928393,method:"messages.transcribeAudio",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"messages.TranscribedAudio"},{id:2132608815,method:"messages.rateTranscribedAudio",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"transcription_id",type:"long"},{name:"good",type:"Bool"}],type:"Bool"},{id:-2131921795,method:"payments.assignAppStoreTransaction",params:[{name:"receipt",type:"bytes"},{name:"purpose",type:"InputStorePaymentPurpose"}],type:"Updates"},{id:-537046829,method:"payments.assignPlayMarketTransaction",params:[{name:"receipt",type:"DataJSON"},{name:"purpose",type:"InputStorePaymentPurpose"}],type:"Updates"},{id:-1614700874,method:"payments.canPurchasePremium",params:[{name:"purpose",type:"InputStorePaymentPurpose"}],type:"Bool"},{id:-1206152236,method:"help.getPremiumPromo",params:[],type:"help.PremiumPromo"},{id:-643100844,method:"messages.getCustomEmojiDocuments",params:[{name:"document_id",type:"Vector"}],type:"Vector"},{id:-67329649,method:"messages.getEmojiStickers",params:[{name:"hash",type:"long"}],type:"messages.AllStickers"},{id:248473398,method:"messages.getFeaturedEmojiStickers",params:[{name:"hash",type:"long"}],type:"messages.FeaturedStickers"},{id:-70001045,method:"account.updateEmojiStatus",params:[{name:"emoji_status",type:"EmojiStatus"}],type:"Bool"},{id:-696962170,method:"account.getDefaultEmojiStatuses",params:[{name:"hash",type:"long"}],type:"account.EmojiStatuses"},{id:257392901,method:"account.getRecentEmojiStatuses",params:[{name:"hash",type:"long"}],type:"account.EmojiStatuses"},{id:404757166,method:"account.clearRecentEmojiStatuses",params:[],type:"Bool"},{id:1063567478,method:"messages.reportReaction",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"reaction_peer",type:"InputPeer"}],type:"Bool"},{id:-1149164102,method:"messages.getTopReactions",params:[{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"messages.Reactions"},{id:960896434,method:"messages.getRecentReactions",params:[{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"messages.Reactions"},{id:-1644236876,method:"messages.clearRecentReactions",params:[],type:"Bool"},{id:-2064119788,method:"messages.getExtendedMedia",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector"}],type:"Updates"},{id:767062953,method:"auth.importWebTokenAuthorization",params:[{name:"api_id",type:"int"},{name:"api_hash",type:"string"},{name:"web_auth_token",type:"string"}],type:"auth.Authorization"},{id:-279966037,method:"account.reorderUsernames",params:[{name:"order",type:"Vector"}],type:"Bool"},{id:1490465654,method:"account.toggleUsername",params:[{name:"username",type:"string"},{name:"active",type:"Bool"}],type:"Bool"},{id:-1268978403,method:"channels.reorderUsernames",params:[{name:"channel",type:"InputChannel"},{name:"order",type:"Vector"}],type:"Bool"},{id:1358053637,method:"channels.toggleUsername",params:[{name:"channel",type:"InputChannel"},{name:"username",type:"string"},{name:"active",type:"Bool"}],type:"Bool"},{id:170155475,method:"channels.deactivateAllUsernames",params:[{name:"channel",type:"InputChannel"}],type:"Bool"},{id:-1540781271,method:"channels.toggleForum",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:-200539612,method:"channels.createForumTopic",params:[{name:"flags",type:"#"},{name:"channel",type:"InputChannel"},{name:"title",type:"string"},{name:"icon_color",type:"flags.0?int"},{name:"icon_emoji_id",type:"flags.3?long"},{name:"random_id",type:"long"},{name:"send_as",type:"flags.2?InputPeer"}],type:"Updates"},{id:233136337,method:"channels.getForumTopics",params:[{name:"flags",type:"#"},{name:"channel",type:"InputChannel"},{name:"q",type:"flags.0?string"},{name:"offset_date",type:"int"},{name:"offset_id",type:"int"},{name:"offset_topic",type:"int"},{name:"limit",type:"int"}],type:"messages.ForumTopics"},{id:-1333584199,method:"channels.getForumTopicsByID",params:[{name:"channel",type:"InputChannel"},{name:"topics",type:"Vector"}],type:"messages.ForumTopics"},{id:-186670715,method:"channels.editForumTopic",params:[{name:"flags",type:"#"},{name:"channel",type:"InputChannel"},{name:"topic_id",type:"int"},{name:"title",type:"flags.0?string"},{name:"icon_emoji_id",type:"flags.1?long"},{name:"closed",type:"flags.2?Bool"},{name:"hidden",type:"flags.3?Bool"}],type:"Updates"},{id:1814925350,method:"channels.updatePinnedForumTopic",params:[{name:"channel",type:"InputChannel"},{name:"topic_id",type:"int"},{name:"pinned",type:"Bool"}],type:"Updates"},{id:876830509,method:"channels.deleteTopicHistory",params:[{name:"channel",type:"InputChannel"},{name:"top_msg_id",type:"int"}],type:"messages.AffectedHistory"},{id:693150095,method:"channels.reorderPinnedForumTopics",params:[{name:"flags",type:"#"},{name:"force",type:"flags.0?true"},{name:"channel",type:"InputChannel"},{name:"order",type:"Vector"}],type:"Updates"},{id:1760814315,method:"channels.toggleAntiSpam",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:-1471109485,method:"channels.reportAntiSpamFalsePositive",params:[{name:"channel",type:"InputChannel"},{name:"msg_id",type:"int"}],type:"Bool"},{id:-1632299963,method:"messages.setDefaultHistoryTTL",params:[{name:"period",type:"int"}],type:"Bool"},{id:1703637384,method:"messages.getDefaultHistoryTTL",params:[],type:"DefaultHistoryTTL"},{id:-127582169,method:"contacts.exportContactToken",params:[],type:"ExportedContactToken"},{id:318789512,method:"contacts.importContactToken",params:[{name:"token",type:"string"}],type:"User"},{id:-515093903,method:"photos.uploadContactProfilePhoto",params:[{name:"flags",type:"#"},{name:"suggest",type:"flags.3?true"},{name:"save",type:"flags.4?true"},{name:"user_id",type:"InputUser"},{name:"file",type:"flags.0?InputFile"},{name:"video",type:"flags.1?InputFile"},{name:"video_start_ts",type:"flags.2?double"},{name:"video_emoji_markup",type:"flags.5?VideoSize"}],type:"photos.Photo"},{id:1785624660,method:"channels.toggleParticipantsHidden",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:-29831141,method:"messages.sendBotRequestedPeer",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"button_id",type:"int"},{name:"requested_peer",type:"InputPeer"}],type:"Updates"},{id:-495647960,method:"account.getDefaultProfilePhotoEmojis",params:[{name:"hash",type:"long"}],type:"EmojiList"},{id:-1856479058,method:"account.getDefaultGroupPhotoEmojis",params:[{name:"hash",type:"long"}],type:"EmojiList"},{id:-1991881904,method:"auth.requestFirebaseSms",params:[{name:"flags",type:"#"},{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"},{name:"safety_net_token",type:"flags.0?string"},{name:"ios_push_secret",type:"flags.1?string"}],type:"Bool"},{id:1955122779,method:"messages.getEmojiGroups",params:[{name:"hash",type:"int"}],type:"messages.EmojiGroups"},{id:785209037,method:"messages.getEmojiStatusGroups",params:[{name:"hash",type:"int"}],type:"messages.EmojiGroups"},{id:564480243,method:"messages.getEmojiProfilePhotoGroups",params:[{name:"hash",type:"int"}],type:"messages.EmojiGroups"},{id:739360983,method:"messages.searchCustomEmoji",params:[{name:"emoticon",type:"string"},{name:"hash",type:"long"}],type:"EmojiList"},{id:-461589127,method:"messages.togglePeerTranslations",params:[{name:"flags",type:"#"},{name:"disabled",type:"flags.0?true"},{name:"peer",type:"InputPeer"}],type:"Bool"},{id:-1379156774,method:"account.getAutoSaveSettings",params:[],type:"account.AutoSaveSettings"},{id:-694451359,method:"account.saveAutoSaveSettings",params:[{name:"flags",type:"#"},{name:"users",type:"flags.0?true"},{name:"chats",type:"flags.1?true"},{name:"broadcasts",type:"flags.2?true"},{name:"peer",type:"flags.3?InputPeer"},{name:"settings",type:"AutoSaveSettings"}],type:"Bool"},{id:1404829728,method:"account.deleteAutoSaveExceptions",params:[],type:"Bool"}]},layer:152};var ts=a(745),as=a.n(ts),ss=a(4736),ns=a.n(ss);function is(e){return e>>>0}function rs(e,t){return e=is(e),t=is(t),ns()(e).shiftLeft(32).add(ns()(t))}const os=ns()(Number.MAX_SAFE_INTEGER),ps=ns()(ns()[2]).pow(64),ds=ps.divide(ns()[2]);function fs(e,t=256){return ns().fromArray(e instanceof Uint8Array?[...e]:e,t)}const cs=+es.API.constructors.find((e=>"boolFalse"===e.predicate)).id,ls=+es.API.constructors.find((e=>"boolTrue"===e.predicate)).id,ms=+es.API.constructors.find((e=>"vector"===e.predicate)).id,gs=+es.MTProto.constructors.find((e=>"gzip_packed"===e.predicate)).id,hs="slice";class us{constructor(e={}){this.maxLength=2048,this.offset=0,this.mtproto=!1,this.debug=!1,this.maxLength=e.startMaxLength||2048,this.mtproto=e.mtproto||!1,this.createBuffer()}createBuffer(){this.buffer=new ArrayBuffer(this.maxLength),this.intView=new Int32Array(this.buffer),this.byteView=new Uint8Array(this.buffer)}getArray(){const e=new ArrayBuffer(this.offset),t=new Int32Array(e);return t.set(this.intView.subarray(0,this.offset/4)),t}getBuffer(){return this.getArray().buffer}getBytes(e=!0){if(e){const e=new ArrayBuffer(this.offset),t=new Uint8Array(e);return t.set(this.byteView.subarray(0,this.offset)),t}const t=new Array(this.offset);for(let e=0;e>>",e.toString(16),e,t);const a=this.offset/4;return this.checkLength(4),this.intView[a]=e,this.offset+=4,a}storeInt(e,t){return this.writeInt(e,(t||"")+":int")}storeBool(e,t){e?this.writeInt(ls,(t||"")+":bool"):this.writeInt(cs,(t||"")+":bool")}storeLongP(e,t,a){this.writeInt(t,(a||"")+":long[low]"),this.writeInt(e,(a||"")+":long[high]")}storeLong(e,t){if(Array.isArray(e))return 2===e.length?this.storeLongP(e[0],e[1],t):this.storeIntBytes(e,64,t);const a=(s=ns()(e)).isNegative()?ps.add(s):s;var s;const{quotient:n,remainder:i}=a.divmod(4294967296),r=n.toJSNumber(),o=i.toJSNumber();this.writeInt(o,(t||"")+":long[low]"),this.writeInt(r,(t||"")+":long[high]")}storeDouble(e,t){const a=new ArrayBuffer(8),s=new Int32Array(a);new Float64Array(a)[0]=e,this.writeInt(s[0],(t||"")+":double[low]"),this.writeInt(s[1],(t||"")+":double[high]")}storeString(e,t){this.debug&&console.log(">>>",e,(t||"")+":string"),void 0===e&&(e="");const a=unescape(encodeURIComponent(e));this.checkLength(a.length+8);const s=a.length;s<=253?this.byteView[this.offset++]=s:(this.byteView[this.offset++]=254,this.byteView[this.offset++]=255&s,this.byteView[this.offset++]=(65280&s)>>8,this.byteView[this.offset++]=(16711680&s)>>16);for(let e=0;e>>",E(e),(t||"")+":bytes");const a=e.length;for(this.checkLength(a+8),a<=253?this.byteView[this.offset++]=a:(this.byteView[this.offset++]=254,this.byteView[this.offset++]=255&a,this.byteView[this.offset++]=(65280&a)>>8,this.byteView[this.offset++]=(16711680&a)>>16),this.byteView.set(e,this.offset),this.offset+=a;this.offset%4;)this.byteView[this.offset++]=0}storeIntBytes(e,t,a){e instanceof ArrayBuffer&&(e=new Uint8Array(e));const s=e.length;if(t%32||8*s!==t){const n=new Error("Invalid bits: "+t+", "+s);throw console.error(n,e,a),n}this.debug&&console.log(">>>",E(e),(a||"")+":int"+t),this.checkLength(s),this.byteView.set(e,this.offset),this.offset+=s}storeRawBytes(e,t){e instanceof ArrayBuffer&&(e=new Uint8Array(e));const a=e.length;this.debug&&console.log(">>>",E(e),t||""),this.checkLength(a),this.byteView.set(e,this.offset),this.offset+=a}storeMethod(e,t){const a=(this.mtproto?es.MTProto:es.API).methods.find((t=>t.method===e));if(!a)throw new Error("No method "+e+" found");this.storeInt(a.id,e+"[id]");const s=t.pFlags||t,n={};for(const i of a.params){let a=i.type;if(-1!==a.indexOf("?")){const e=a.split("?"),n=e[0].split(".");if(!(t[n[0]]&1<<+n[1])){if(!("true"===e[1]?s[i.name]:void 0!==t[i.name]))continue;t[n[0]]|=1<<+n[1]}a=e[1]}const r=this.storeObject(t[i.name],a,e+"["+i.name+"]");"#"===a&&(t[i.name]=t[i.name]||0,n[i.name]=r)}for(const e in n)this.intView[n[e]]=t[e];return a.type}storeObject(e,t,a){switch(t){case"#":e=e||0;case"int":return this.storeInt(e,a);case"long":return this.storeLong(e,a);case"int128":return this.storeIntBytes(e,128,a);case"int256":return this.storeIntBytes(e,256,a);case"int512":return this.storeIntBytes(e,512,a);case"string":return this.storeString(e,a);case"bytes":return this.storeBytes(e,a);case"double":return this.storeDouble(e,a);case"Bool":return this.storeBool(e,a);case"true":return}if(Array.isArray(e)){if("Vector"===t.substr(0,6))this.writeInt(ms,a+"[id]");else if("vector"!==t.substr(0,6))throw new Error("Invalid vector type "+t);const s=t.substr(7,t.length-8);this.writeInt(e.length,a+"[count]");for(let t=0;te.predicate===n));if((i="%"===t.charAt(0))&&(t=t.substr(1)),!r)throw new Error("No predicate "+n+" found");n===t&&(i=!0),i||this.writeInt(r.id,a+"["+n+"][id]");const o=e.pFlags,p={};for(const t of r.params){let s=t.type;if(-1!==s.indexOf("?")){const a=s.split("?"),n=a[0].split(".");if(!(e[n[0]]&1<<+n[1])){if(!("true"===a[1]?o&&o[t.name]:void 0!==e[t.name]))continue;e[n[0]]|=1<<+n[1]}s=a[1]}const i=this.storeObject(e[t.name],s,a+"["+n+"]["+t.name+"]");"#"===s&&(e[t.name]=e[t.name]||0,p[t.name]=i)}for(const t in p)this.intView[p[t]]=e[t];return r.type}}class ys{constructor(e,t={}){this.offset=0,this.mtproto=!1,e instanceof ArrayBuffer?(this.buffer=e,this.intView=new Int32Array(e),this.byteView=new Uint8Array(this.buffer)):(this.buffer=e.buffer,this.intView=new Int32Array(e.buffer),this.byteView=e),this.override=t.override||{},this.mtproto=!!t.mtproto,this.debug=void 0!==t.debug&&t.debug}readInt(e){if(this.byteView.length-this.offset<4)throw console.error(this.byteView,this.offset),new Error("Nothing to fetch: "+e);const t=this.intView[this.offset/4];return this.debug&&console.log("<<<",t.toString(16),t,e,this.byteView.slice(this.offset-16,this.offset+16),E(this.byteView.slice(this.offset-16,this.offset+16))),this.offset+=4,t}fetchInt(e){return this.readInt((e||"")+":int")}fetchDouble(e){const t=new ArrayBuffer(8),a=new Int32Array(t),s=new Float64Array(t);return a[0]=this.readInt((e||"")+":double[low]"),a[1]=this.readInt((e||"")+":double[high]"),s[0]}fetchLong(e){const t=this.readInt((e||"")+":long[low]");let a=rs(this.readInt((e||"")+":long[high]"),t);var s;return this.mtproto||(a=(s=a).greater(ds)?s.minus(ps):s),!this.mtproto&&os.greaterOrEquals(a.abs())?a.toJSNumber():a.toString(10)}fetchBool(e){const t=this.readInt((e||"")+":bool");return t===ls||t!==cs&&(this.offset-=4,this.fetchObject("Object",e))}fetchString(e){let t=this.byteView[this.offset++];254===t&&(t=this.byteView[this.offset++]|this.byteView[this.offset++]<<8|this.byteView[this.offset++]<<16);let a,s="";for(let e=0;ethis.byteView.byteLength)throw new Error("Invalid raw bytes length: "+e+", buffer len: "+this.byteView.byteLength);if(t){const t=new Uint8Array(e);return t.set(this.byteView[hs](this.offset,this.offset+e)),this.offset+=e,t}const s=new Array(e);for(let t=0;t0){const n=e.substr(7,e.length-8);for(let e=0;ee.type===t)),!s)throw new Error("Constructor not found for type: "+e)}else{const r=this.readInt(t+"[id]");if(r===gs){const a=(i=this.fetchBytes(t+"[packed_string]"),as().inflate(i,void 0));return new ys(a).fetchObject(e,t)}if(r===ms)return this.fetchVector(e,t);let o=a.constructorsIndex;if(!o){a.constructorsIndex=o={};for(let e=0,t=a.constructors.length;e0&&r{var e;if(this.pingDelayDisconnectDeferred||!this.transport||!this.transport.connected)return;const t=this.pingDelayDisconnectDeferred=(0,v.Z)(),a=this.delays,s=this.delays.pingMaxTime,n=Math.min(null!==(e=this.lastPingTime)&&void 0!==e?e:0,s),i=Math.round(a.disconnectDelayMin+n/s*(a.disconnectDelayMax-a.disconnectDelayMin)),r=1e3*i,o=this.lastPingStartTime=Date.now(),p=this.lastPingDelayDisconnectId=(0,Ee.a)(),d={notContentRelated:!0};this.wrapMtpCall("ping_delay_disconnect",{ping_id:p,disconnect_delay:i},d);const f=this.log.bindPrefix("sendPingDelayDisconnect");this.debug&&f.debug(`ping, timeout=${r}, lastPingTime=${this.lastPingTime}, msgId=${d.messageId}, pingId=${p}`);const c=T.Z.setTimeout(t.reject,r);t.then((e=>{clearTimeout(c);const t=Date.now()-o;if(this.lastPingTime=t/1e3,this.debug&&f.debug(`pong, reason='${e}', time=${n}, msgId=${d.messageId}`),t>r)throw void 0;return(0,P.Z)(Math.max(0,this.delays.pingInterval-t))})).catch((()=>{clearTimeout(c);const e=this.transport;this.pingDelayDisconnectDeferred===t&&(null==e?void 0:e.connection)&&(f.error("catch, closing connection",this.lastPingTime,d.messageId),e.connection.close())})).finally((()=>{this.pingDelayDisconnectDeferred===t&&(this.pingDelayDisconnectDeferred=void 0,this.sendPingDelayDisconnect())}))},this.checkLongPoll=()=>{const e=this.cleanupSent();if(this.longPollPending&&Date.now(){e&&(t!==this.dcId||this.sleepAfter&&Date.now()>this.sleepAfter)||this.sendLongPoll()}))},this.checkConnection=e=>{if(this.debug&&this.log("Check connection",e),this.clearCheckConnectionTimeout(),!this.transport)return void this.log.warn("No transport for checkConnection");const t=new us({mtproto:!0}),a=(0,Ee.a)();t.storeMethod("ping",{ping_id:a});const s={msg_id:this.timeManager.generateId(),seq_no:this.generateSeqNo(!0),body:t.getBytes(!0)};this.offline&&this.setConnectionStatus(D.Q.Connecting),this.sendEncryptedRequest(s).then((()=>{this.toggleOffline(!1)}),(()=>{this.debug&&this.log("Delay",1e3*this.checkConnectionPeriod),this.checkConnectionTimeout=T.Z.setTimeout((()=>this.checkConnection("from failed checkConnection request")),1e3*this.checkConnectionPeriod|0),this.checkConnectionPeriod=Math.min(60,1.5*this.checkConnectionPeriod)}))},this.authKeyUint8=(0,bs.Z)(this.authKey),this.serverSalt=(0,bs.Z)(i),this.isFileUpload=!!r.fileUpload,this.isFileDownload=!!r.fileDownload,this.isFileNetworker=this.isFileUpload||this.isFileDownload,this.delays=this.isFileNetworker?Ss.file:Ss.client;const o=this.isFileUpload?"-U":this.isFileDownload?"-D":"";this.name="NET-"+a+o,this.log=(0,S.kg)(this.name+(o?"":"-C")+"-"+ks++,S.v9.Log|S.v9.Error|S.v9.Warn),this.log("constructor"),this.updateSession()}updateSession(){this.seqNo=0,this.prevSessionId=this.sessionId,this.sessionId=k(new Uint8Array(8))}updateSentMessage(e){const t=this.sentMessages[e];return!!t&&(t.container&&(0,ne.Z)(t.inner,((e,a)=>{const s=this.updateSentMessage(e);s?t.inner[a]=s.msg_id:t.inner.splice(a,1)})),t.msg_id=this.timeManager.generateId(),t.seq_no=this.generateSeqNo(t.notContentRelated||t.container),this.debug&&this.log(`updateSentMessage, old=${e}, new=${t.msg_id}`),this.sentMessages[t.msg_id]=t,delete this.sentMessages[e],t)}generateSeqNo(e){let t=2*this.seqNo;return e||(t++,this.seqNo++),t}wrapMtpCall(e,t,a){const s=new us({mtproto:!0});s.storeMethod(e,t);const n=this.timeManager.generateId(),i=this.generateSeqNo(),r={msg_id:n,seq_no:i,body:s.getBytes(!0)};return b.Z.debug&&this.log("MT call",e,t,n,i),this.pushMessage(r,a)}wrapMtpMessage(e,t){const a=new us({mtproto:!0});a.storeObject(e,"Object");const s=this.timeManager.generateId(),n=this.generateSeqNo(t.notContentRelated),i={msg_id:s,seq_no:n,body:a.getBytes(!0)};return b.Z.debug&&this.log("MT message",e,s,n),this.pushMessage(i,t)}wrapApiCall(e,t={},a={}){const s=new us(a);if(!this.connectionInited){const e=es.API.methods.find((e=>"invokeWithLayer"===e.method));if(!e)throw new Error("no invokeWithLayer!");s.storeInt(+e.id,"invokeWithLayer"),s.storeInt(es.layer,"layer");const t=es.API.methods.find((e=>"initConnection"===e.method));if(!t)throw new Error("no initConnection!");s.storeInt(+t.id,"initConnection"),s.storeInt(0,"flags"),s.storeInt(_.Z.id,"api_id"),s.storeString(i().USER_AGENT||"Unknown UserAgent","device_model"),s.storeString(navigator.platform||"Unknown Platform","system_version"),s.storeString(_.Z.version+(_.Z.isMainDomain?" "+_.Z.suffix:""),"app_version"),s.storeString(navigator.language||"en","system_lang_code"),s.storeString(_.Z.langPack,"lang_pack"),s.storeString(this.networkerFactory.language,"lang_code")}if(a.afterMessageId){if(void 0===Cs){const e=es.API.methods.find((e=>"invokeAfterMsg"===e.method));Cs=e?+e.id:0}Cs?(s.storeInt(Cs,"invokeAfterMsg"),s.storeLong(a.afterMessageId,"msg_id")):this.log.error("no invokeAfterMsg!")}a.resultType=s.storeMethod(e,t);const n={msg_id:this.timeManager.generateId(),seq_no:this.generateSeqNo(),body:s.getBytes(!0),isAPI:!0};return b.Z.debug?this.log("Api call",e,n,t,a):this.debug&&this.log("Api call",e,t,a),this.pushMessage(n,a)}changeTransport(e){const t=this.transport;t&&(t.destroy(),this.nextReqTimeout&&(clearTimeout(this.nextReqTimeout),this.nextReqTimeout=0,this.nextReq=0),this.connectionInited=!1,void 0!==this.longPollInterval&&(clearInterval(this.longPollInterval),this.longPollInterval=void 0),this.clearCheckConnectionTimeout()),this.log("change transport",e,t),this.clearPingDelayDisconnect(),this.transport=e,e&&(e.networker=this,e instanceof I&&(this.longPollInterval=T.Z.setInterval(this.checkLongPoll,1e4),this.checkLongPoll(),this.checkConnection("changed transport")),e.connection&&e.connected&&this.setConnectionStatus(D.Q.Connected),this.resend())}destroy(){this.log("destroy")}forceReconnectTimeout(){this.transport.reconnect?this.transport.reconnect():this.resend()}forceReconnect(){this.transport.forceReconnect?this.transport.forceReconnect():this.checkConnection("force reconnect")}clearPingDelayDisconnect(){const e=this.pingDelayDisconnectDeferred;this.pingDelayDisconnectDeferred=void 0,this.lastPingDelayDisconnectId=void 0,e&&e.reject()}sendLongPoll(){this.sendingLongPoll||(this.sendingLongPoll=!0,this.longPollPending=Date.now()+25e3,this.debug&&this.log.debug("sendLongPoll",this.longPollPending),this.wrapMtpCall("http_wait",{max_delay:500,wait_after:150,max_wait:25e3},{noResponse:!0,longPoll:!0}).then((()=>{this.longPollPending=void 0,setTimeout(this.checkLongPoll,0)}),(e=>{this.log("Long-poll failed",e)})).finally((()=>{this.sendingLongPoll=void 0})))}clearCheckConnectionTimeout(){void 0!==this.checkConnectionTimeout&&(clearTimeout(this.checkConnectionTimeout),this.checkConnectionTimeout=void 0)}toggleOffline(e){if(this.offline!==e)if(this.offline=e,this.clearCheckConnectionTimeout(),e){clearTimeout(this.nextReqTimeout),this.nextReqTimeout=0,this.nextReq=0,this.checkConnectionPeriod<1.5&&(this.checkConnectionPeriod=0);const e=1e3*this.checkConnectionPeriod|0;this.checkConnectionRetryAt=Date.now()+e,this.setConnectionStatus(D.Q.Closed,this.checkConnectionRetryAt),this.checkConnectionTimeout=T.Z.setTimeout((()=>this.checkConnection("from toggleOfline")),e),this.checkConnectionPeriod=Math.min(30,1.5*(1+this.checkConnectionPeriod))}else this.setConnectionStatus(D.Q.Connected),this.checkLongPoll(),this.scheduleRequest();this.setConnectionStatus(e?D.Q.Closed:D.Q.Connected,e?this.checkConnectionRetryAt:void 0)}handleSentEncryptedRequestHTTP(e,t,a){e.then((e=>(this.toggleOffline(!1),this.parseResponse(e).then((e=>(this.debug&&this.log.debug("Server response",e),this.processMessage(e.response,e.messageId,e.sessionId),this.checkLongPoll(),this.checkConnectionPeriod=Math.max(1.1,Math.sqrt(this.checkConnectionPeriod)),!0))))),(e=>(this.log.error("Encrypted request failed",e,t),this.pushResend(t.msg_id),this.toggleOffline(!0),!1))).then((e=>{const t=this.sentMessages;a.forEach((a=>{const s=t[a];if(s){const n=s.deferred;delete t[a],delete this.pendingMessages[a],e?n.resolve():n.reject()}}))}))}pushMessage(e,t){let a;return t.notContentRelated&&!t.noResponse||(a=(0,v.Z)()),this.sentMessages[e.msg_id]=Object.assign(e,t,a?{deferred:a}:void 0),this.pendingMessages[e.msg_id]=0,t.noSchedule||this.scheduleRequest(),(0,fe.Z)(t)&&(t.messageId=e.msg_id),a}attachPromise(e,t){const a=setTimeout((()=>{this.lastResponseTime&&Date.now()-this.lastResponseTime{clearTimeout(a),this.setConnectionStatus(D.Q.Connected),--this.activeRequests,this.setDrainTimeout()})),++this.activeRequests,void 0!==this.onDrainTimeout&&(clearTimeout(this.onDrainTimeout),this.onDrainTimeout=void 0)}setDrainTimeout(){!this.activeRequests&&this.onDrain&&void 0===this.onDrainTimeout&&(this.onDrainTimeout=T.Z.setTimeout((()=>{this.onDrainTimeout=void 0,this.log("drain"),this.onDrain()}),1e4))}setConnectionStatus(e,t){var a;const s=e===D.Q.Connected,n=this.status!==e;this.isOnline=s,this.status=e,n&&(this.networkerFactory.onConnectionStatusChange&&this.networkerFactory.onConnectionStatusChange({_:"networkerStatus",status:e,dcId:this.dcId,name:this.name,isFileNetworker:this.isFileNetworker,isFileDownload:this.isFileDownload,isFileUpload:this.isFileUpload,retryAt:t}),this.isOnline&&this.scheduleRequest(),(null===(a=this.transport)||void 0===a?void 0:a.connection)&&(this.clearPingDelayDisconnect(),this.sendPingDelayDisconnect()))}pushResend(e,t=100){const a=t?Date.now()+t:0,s=this.sentMessages[e];if(s.container)for(const e of s.inner)this.pendingMessages[e]=a;else this.pendingMessages[e]=a;s.acked&&this.log.error("pushResend: acked message?",s),this.debug&&this.log.debug("pushResend:",e,s,this.pendingMessages,t),this.scheduleRequest(t)}getMsgKey(e,t){return Ms(this,void 0,void 0,(function*(){const a=t?0:8,n=(0,_s.Z)(this.authKeyUint8.subarray(88+a,88+a+32),e),i=yield s.Z.invokeCrypto("sha256",n);return new Uint8Array(i).subarray(8,24)}))}getAesKeyIv(e,t){const a=t?0:8,n=new Uint8Array(52),i=new Uint8Array(52),r=[];return n.set(e,0),n.set(this.authKeyUint8.subarray(a,a+36),16),r.push(s.Z.invokeCrypto("sha256",n)),i.set(this.authKeyUint8.subarray(40+a,40+a+36),0),i.set(e,36),r.push(s.Z.invokeCrypto("sha256",i)),Promise.all(r).then((e=>{const t=new Uint8Array(32),a=new Uint8Array(32),s=new Uint8Array(e[0]),n=new Uint8Array(e[1]);return t.set(s.subarray(0,8)),t.set(n.subarray(8,24),8),t.set(s.subarray(24,32),24),a.set(n.subarray(0,8)),a.set(s.subarray(8,24),8),a.set(n.subarray(24,32),24),[t,a]}))}isStopped(){return this.networkerFactory.akStopped&&!this.isFileNetworker}performScheduledRequest(){if(this.isStopped())return!1;if(this.pendingAcks.length){const e=this.pendingAcks.slice();this.wrapMtpMessage({_:"msgs_ack",msg_ids:e},{notContentRelated:!0,noSchedule:!0})}const e=this.pendingResendReq.length;if(e){const t=Object.assign({},Is),a=this.pendingResendReq.splice(0,e);this.wrapMtpMessage({_:"msg_resend_req",msg_ids:a},t),this.log("resend: resending requests",t.messageId,a)}let t;const a=[];let s=0,n=!1,i=!1,r=!1;const o=Object.keys(this.pendingMessages).map((e=>ns()(e))).sort(((e,t)=>e.compare(t))).map((e=>e.toString(10)));for(const e of o){const o=this.sentMessages[e];if(o&&o.body){const e=o.body.length+32;if(s+e>655360&&(this.log.warn("lengthOverflow",o,a),r=!0,t))break;a.push(o),s+=e,o.isAPI?n=!0:o.longPoll&&(i=!0),t=o}delete this.pendingMessages[e]}if(this.transport instanceof I&&n&&!i){const e=new us({mtproto:!0});e.storeMethod("http_wait",{max_delay:500,wait_after:150,max_wait:3e3}),a.push({msg_id:this.timeManager.generateId(),seq_no:this.generateSeqNo(),body:e.getBytes(!0)})}if(!a.length)return;const p=a.filter((e=>e.noResponse)).map((e=>e.msg_id));if(a.length>1){const e=this.generateContainerMessage(s,a);t=e.messageWithBody,this.sentMessages[t.msg_id]=e.message}else this.sentMessages[t.msg_id]=t;this.pendingAcks=[];const d=this.sendEncryptedRequest(t);this.transport instanceof I&&this.handleSentEncryptedRequestHTTP(d,t,p),this.transport instanceof I||this.cleanupSent(),r&&this.scheduleRequest()}generateContainerMessage(e,t){const a=new us({mtproto:!0,startMaxLength:e+64});a.storeInt(1945237724,"CONTAINER[id]"),a.storeInt(t.length,"CONTAINER[count]");const s=[];t.forEach(((e,t)=>{s.push(e.msg_id),a.storeLong(e.msg_id,"CONTAINER["+t+"][msg_id]"),a.storeInt(e.seq_no,"CONTAINER["+t+"][seq_no]"),a.storeInt(e.body.length,"CONTAINER["+t+"][bytes]"),a.storeRawBytes(e.body,"CONTAINER["+t+"][body]")}));const n={msg_id:this.timeManager.generateId(),seq_no:this.generateSeqNo(!0),container:!0,inner:s};return b.Z.debug&&this.log.warn("Container",s,n.msg_id,n.seq_no),{message:n,messageWithBody:Object.assign({body:a.getBytes(!0)},n)}}getEncryptedMessage(e){return Ms(this,void 0,void 0,(function*(){const t=yield this.getMsgKey(e,!0),a=yield this.getAesKeyIv(t,!0);return{bytes:yield s.Z.invokeCrypto("aes-encrypt",e,a[0],a[1]),msgKey:t}}))}getDecryptedMessage(e,t){return this.getAesKeyIv(e,!1).then((e=>s.Z.invokeCrypto("aes-decrypt",t,e[0],e[1])))}getEncryptedOutput(e){const t=new us({startMaxLength:e.body.length+2048});t.storeIntBytes(this.serverSalt,64,"salt"),t.storeIntBytes(this.sessionId,64,"session_id"),t.storeLong(e.msg_id,"message_id"),t.storeInt(e.seq_no,"seq_no"),t.storeInt(e.body.length,"message_data_length"),t.storeRawBytes(e.body,"message_data");const a=t.getBuffer(),s=16-t.getOffset()%16+16*(1+(0,Ee.d)(8)%5),n=k(new Uint8Array(s)),i=(0,_s.Z)(a,n);return this.getEncryptedMessage(i).then((e=>{const t=new us({startMaxLength:e.bytes.length+256});return t.storeIntBytes(this.authKeyId,64,"auth_key_id"),t.storeIntBytes(e.msgKey,128,"msg_key"),t.storeRawBytes(e.bytes,"encrypted_data"),t.getBytes(!0)}))}sendEncryptedRequest(e){return Ms(this,void 0,void 0,(function*(){const t=yield this.getEncryptedOutput(e);this.transport||this.log.error("trying to send something when offline",this.transport,this),this.debug&&this.log.debug("sending:",e,[e.msg_id].concat(e.inner||[]),t.length);const a=this.transport?this.transport.send(t):Promise.reject({});if(!(this.transport instanceof I))return a;const s={code:406,type:"NETWORK_BAD_RESPONSE",transport:this.transport};return a.then((e=>{if(!(null==e?void 0:e.byteLength))throw s;return e}),(e=>{throw e.message||e.type||(e=Object.assign(s,{type:"NETWORK_BAD_REQUEST",originalError:e})),e}))}))}parseResponse(e){this.lastResponseTime=Date.now();const t=new ys(e),a=t.fetchIntBytes(64,!0,"auth_key_id");if(!(0,Ps.Z)(a,this.authKeyId))throw new Error("[MT] Invalid server auth_key_id: "+E(a));const s=t.fetchIntBytes(128,!0,"msg_key"),n=t.fetchRawBytes(e.byteLength-t.getOffset(),!0,"encrypted_data");return this.getDecryptedMessage(s,n).then((e=>this.getMsgKey(e,!1).then((t=>{if(!(0,Ps.Z)(s,t))throw this.log.warn("[MT] msg_keys",s,t),this.updateSession(),new Error("[MT] server msgKey mismatch, updating session");let a=new ys(e,{mtproto:!0});a.fetchIntBytes(64,!0,"salt");const n=a.fetchIntBytes(64,!0,"session_id"),i=a.fetchLong("message_id");if(!((0,Ps.Z)(n,this.sessionId)||this.prevSessionId&&(0,Ps.Z)(n,this.prevSessionId)))throw this.log.warn("Sessions",n,this.sessionId,this.prevSessionId,e),new Error("[MT] Invalid server session_id: "+E(n));const r=a.fetchInt("seq_no"),o=e.byteLength,p=a.fetchInt("message_data[length]");let d=a.getOffset();if(p%4||p>o-d)throw new Error("[MT] Invalid body length: "+p);const f=a.fetchRawBytes(p,!0,"message_data");d=a.getOffset();const c=o-d;if(c<12||c>1024)throw new Error("[MT] Invalid padding length: "+c);return a=new ys(f,{mtproto:!0,override:{mt_message:(e,t)=>{e.msg_id=a.fetchLong(t+"[msg_id]"),e.seqno=a.fetchInt(t+"[seqno]"),e.bytes=a.fetchInt(t+"[bytes]");const s=a.getOffset();try{e.body=a.fetchObject("Object",t+"[body]")}catch(t){this.log.error("parse error",t.message,t.stack),e.body={_:"parse_error",error:t}}a.getOffset()!==s+e.bytes&&a.setOffset(s+e.bytes)},mt_rpc_result:(e,t)=>{e.req_msg_id=a.fetchLong(t+"[req_msg_id]");const s=this.sentMessages[e.req_msg_id],n=s&&s.resultType||"Object";e.req_msg_id&&!s||(e.result=a.fetchObject(n,t+"[result]"))}}}),{response:a.fetchObject("","INPUT"),messageId:i,sessionId:n,seqNo:r}}))))}applyServerSalt(e){const t=(a=e,vs((s=ns()(a),new Uint8Array(s.toArray(256).value)).reverse(),8,!0,!1,!1));var a,s;qa.Z.set({["dc"+this.dcId+"_server_salt"]:E(t)}),this.serverSalt=new Uint8Array(t)}scheduleRequest(e){this.transport instanceof I&&(this.offline&&this.checkConnection("forced schedule"),e||(e=0));const t=Date.now()+(e||0);if(this.nextReq&&(void 0===e||this.nextReq<=t))return;this.nextReqTimeout&&clearTimeout(this.nextReqTimeout);const a=()=>{this.nextReqTimeout=0,this.nextReq=0,this.transport instanceof I&&this.offline||this.performScheduledRequest()};this.nextReq=t,void 0!==e?this.nextReqTimeout=T.Z.setTimeout(a,e):a()}ackMessage(e){let t;this.pendingAcks.push(e),this.transport instanceof I&&(t=3e4),this.scheduleRequest(t)}reqResend(e){this.debug&&this.log.debug("Req resend",e),this.pendingResendReq.push(e),this.scheduleRequest(100)}cleanupSent(){let e=!1;const t=this.sentMessages;return Object.keys(t).forEach((a=>{const s=t[a];if(s.notContentRelated&&void 0===this.pendingMessages[a])delete t[a];else if(s.container){for(const a of s.inner)if(void 0!==t[a])return void(e=!0);delete t[a]}else e=!0})),!e}processMessageAck(e){const t=this.sentMessages[e];t&&!t.acked&&(t.acked=!0)}processError(e){const t=(e.error_message||"").match(/^([A-Z_0-9]+\b)(: (.+))?/)||[];return e.error_code=e.error_code,{code:!e.error_code||e.error_code<=0?500:e.error_code,type:t[1]||"UNKNOWN",description:t[3]||"CODE#"+e.error_code+" "+e.error_message,originalError:e}}resend(){const e=this.sentMessages;for(const t in e){const a=e[t];(a.body||a.container)&&this.pushResend(t)}this.transport.connection&&(this.clearPingDelayDisconnect(),this.sendPingDelayDisconnect())}applyServerTime(e){const t=ns()(e).shiftRight(32).toJSNumber();return this.log("applying server time",t),this.timeManager.applyServerTime(t)}processMessage(e,t,a){if("messageEmpty"!==e._)if(parseInt(t.substr(0,-10),10)%2)this.log.warn("Server even message id: ",t,e);else switch(this.debug&&this.log.debug("process message",e,t),this.pingDelayDisconnectDeferred&&this.pingDelayDisconnectDeferred.resolve("any message"),e._){case"msg_container":for(const t of e.messages)this.processMessage(t,t.msg_id,a);break;case"bad_server_salt":this.log("Bad server salt",e),this.applyServerSalt(e.new_server_salt),this.sentMessages[e.bad_msg_id]&&this.pushResend(e.bad_msg_id),this.ackMessage(t);break;case"bad_msg_notification":switch(this.log.error("Bad msg notification",e),e.error_code){case 16:case 17:case 32:case 33:case 64:{const a=this.applyServerTime(t);(17===e.error_code||a)&&(this.log("Update session"),this.updateSession());const s=this.updateSentMessage(e.bad_msg_id);s&&this.pushResend(s.msg_id)}}break;case"message":if(-1!==this.lastServerMessages.indexOf(t))return void this.ackMessage(t);this.lastServerMessages.push(t),this.lastServerMessages.length>100&&this.lastServerMessages.shift(),this.processMessage(e.body,e.msg_id,a);break;case"new_session_created":this.ackMessage(t),this.debug&&this.log.debug("new_session_created",e),this.processMessageAck(e.first_msg_id),this.applyServerSalt(e.server_salt),qa.Z.get("dc").then((t=>{t===this.dcId&&!this.isFileNetworker&&this.networkerFactory.updatesProcessor&&this.networkerFactory.updatesProcessor(e)}));break;case"msgs_ack":this.debug&&this.log("got acks",e.msg_ids);for(const t of e.msg_ids)this.processMessageAck(t);break;case"msg_detailed_info":if(!this.sentMessages[e.msg_id]){this.ackMessage(e.answer_msg_id);break}case"msg_new_detailed_info":if(-1!==this.pendingAcks.indexOf(e.answer_msg_id))break;this.reqResend(e.answer_msg_id);break;case"msgs_state_info":{this.ackMessage(e.answer_msg_id);const t=[[this.lastResendReq,this.pendingResendReq]];for(const[a,s]of t)if((null==a?void 0:a.reqMsgId)===e.req_msg_id&&s.length)for(const e of a.msgIds){const t=s.indexOf(e);-1!==t&&s.splice(t,1)}break}case"rpc_result":{this.ackMessage(t);const a=e.req_msg_id,s=this.sentMessages[a];if(this.debug&&this.log("Rpc response",e.result,s),this.processMessageAck(a),s){const t=s.deferred;if("rpc_error"===e.result._){const a=this.processError(e.result);this.log("Rpc error",a),t&&t.reject(a)}else t&&t.resolve(e.result),s.isAPI&&!this.connectionInited&&(this.connectionInited=!0);delete this.sentMessages[a]}else this.debug&&this.log("Rpc result for unknown message:",a,e);break}case"pong":{const t=e.ping_id;if(this.lastPingDelayDisconnectId===t){const e=this.pingDelayDisconnectDeferred;e?e.resolve("pong"):this.log("ping deferred deleted",t)}break}default:this.ackMessage(t),null!==this.networkerFactory.updatesProcessor&&this.networkerFactory.updatesProcessor(e)}else this.log.warn("processMessage: messageEmpty",e,t)}}class As extends G{constructor(){super(...arguments),this.networkers=[],this.language=navigator.language||_.Z.langPackCode,this.updatesProcessor=null,this.akStopped=!1}onConnectionStatusChange(e){this.rootScope.dispatchEvent("connection_status_change",e)}removeNetworker(e){(0,M.Z)(this.networkers,e)}setUpdatesProcessor(e){this.updatesProcessor=e}getNetworker(e,t,a,s,n){const i=new ws(this,this.timeManager,e,t,a,s,n);return this.networkers.push(i),i}startAll(){if(this.akStopped){const e=this.networkers.filter((e=>e.isStopped()));this.akStopped=!1,this.updatesProcessor&&this.updatesProcessor({_:"new_session_created"});for(const t of e)t.scheduleRequest()}}stopAll(){this.akStopped=!0}setLanguage(e){this.language=e;for(const e of this.networkers)e.isFileNetworker||(e.connectionInited=!1)}unsetConnectionInited(){for(const e of this.networkers)e.connectionInited=!1}forceReconnectTimeout(){for(const e of this.networkers)e.forceReconnectTimeout()}forceReconnect(){for(const e of this.networkers)if(!e.isFileNetworker){e.forceReconnect();break}}}const Us=new class{constructor(){this.testPublicKeysHex=[{modulus:"c8c11d635691fac091dd9489aedced2932aa8a0bcefef05fa800892d9b52ed03200865c9e97211cb2ee6c7ae96d3fb0e15aeffd66019b44a08a240cfdd2868a85e1f54d6fa5deaa041f6941ddf302690d61dc476385c2fa655142353cb4e4b59f6e5b6584db76fe8b1370263246c010c93d011014113ebdf987d093f9d37c2be48352d69a1683f8f6e6c2167983c761e3ab169fde5daaa12123fa1beab621e4da5935e9c198f82f35eae583a99386d8110ea6bd1abb0f568759f62694419ea5f69847c43462abef858b4cb5edc84e7b9226cd7bd7e183aa974a712c079dde85b9dc063b8a5c08e8f859c0ee5dcd824c7807f20153361a7f63cfd2a433a1be7f5",exponent:"010001"}],this.publisKeysHex=[{modulus:"e8bb3305c0b52c6cf2afdf7637313489e63e05268e5badb601af417786472e5f93b85438968e20e6729a301c0afc121bf7151f834436f7fda680847a66bf64accec78ee21c0b316f0edafe2f41908da7bd1f4a5107638eeb67040ace472a14f90d9f7c2b7def99688ba3073adb5750bb02964902a359fe745d8170e36876d4fd8a5d41b2a76cbff9a13267eb9580b2d06d10357448d20d9da2191cb5d8c93982961cdfdeda629e37f1fb09a0722027696032fe61ed663db7a37f6f263d370f69db53a0dc0a1748bdaaff6209d5645485e6e001d1953255757e4b8e42813347b11da6ab500fd0ace7e6dfa3736199ccaf9397ed0745a427dcfa6cd67bcb1acff3",exponent:"010001"}],this.publicKeysParsed={},this.prepared=!1,this.preparePromise=null,b.Z.test&&(this.publisKeysHex=this.testPublicKeysHex)}prepare(){return this.preparePromise?this.preparePromise:this.prepared?Promise.resolve():this.preparePromise=Promise.all(this.publisKeysHex.map((e=>{const t=new us;t.storeBytes((0,Ha.Z)(e.modulus),"n"),t.storeBytes((0,Ha.Z)(e.exponent),"e");const a=t.getBuffer();return s.Z.invokeCrypto("sha1",a).then((t=>{const a=t.slice(-8);a.reverse(),this.publicKeysParsed[E(a).toLowerCase()]={modulus:e.modulus,exponent:e.exponent}}))}))).then((()=>{this.prepared=!0,this.preparePromise=null}))}select(e){return t=this,a=void 0,n=function*(){yield this.prepare();for(let t=0;t{if(d.ZP&&this.log("mtpSendPlainRequest: in good sector",e),!e||!e.byteLength)throw o;try{const t=new ys(e,{mtproto:!0});if(4===e.length){const e=t.fetchInt();throw this.log.error("mtpSendPlainRequest: wrong response, error code:",e),e}const a=t.fetchLong("auth_key_id");"0"!==a&&this.log.error("auth_key_id !== 0",a);const s=t.fetchLong("msg_id");"0"===s&&this.log.error("msg_id === 0",s);const n=t.fetchInt("msg_len");return n||this.log.error("no msg_len",n),t}catch(e){throw this.log.error("mtpSendPlainRequest: deserialization went bad",e),Object.assign(o,{originalError:e})}}),(e=>{throw e.message||e.type||(e=Object.assign(o,{originalError:e})),e}))}sendReqPQ(e){return Es(this,void 0,void 0,(function*(){const t=new us({mtproto:!0});let a;t.storeMethod("req_pq_multi",{nonce:e.nonce}),d.ZP&&this.log("Send req_pq",E(e.nonce));try{const s=this.sendPlainRequest(e.dcId,t.getBytes(!0));Us.prepare(),a=yield s}catch(e){throw this.log.error("req_pq error",e.message),e}const n=a.fetchObject("ResPQ");if("resPQ"!==n._)throw new Error("[MT] resPQ response invalid: "+n._);if(!(0,Ps.Z)(e.nonce,n.nonce))throw this.log.error(e.nonce,n.nonce),new Error("[MT] resPQ nonce mismatch");e.serverNonce=n.server_nonce,e.pq=n.pq,e.fingerprints=n.server_public_key_fingerprints,d.ZP&&this.log("Got ResPQ",E(e.serverNonce),E(e.pq),e.fingerprints);const i=yield Us.select(e.fingerprints);if(!i)throw new Error("[MT] No public key found");e.publicKey=i,d.ZP&&this.log("PQ factorization start",e.pq);try{var r=yield s.Z.invokeCrypto("factorize",e.pq)}catch(e){throw this.log.error("worker error factorize",e),e}return e.p=r[0],e.q=r[1],d.ZP&&this.log("PQ factorization done",r),this.sendReqDhParams(e)}))}sendReqDhParams(e){return Es(this,void 0,void 0,(function*(){e.newNonce=k(new Uint8Array(32));const t={_:"p_q_inner_data_dc",pq:e.pq,p:e.p,q:e.q,nonce:e.nonce,server_nonce:e.serverNonce,new_nonce:e.newNonce,dc:0},a=new us({mtproto:!0});a.storeObject(t,"P_Q_inner_data","DECRYPTED_DATA");const n=a.getBytes(!0);if(n.length>144)throw"DH_params: data is more than 144 bytes!";const i=vs(n,192,!1,!0,!1),r=i.slice().reverse(),o=yield(()=>Es(this,void 0,void 0,(function*(){for(;;){const t=k(new Uint8Array(32)),a=r.concat(yield s.Z.invokeCrypto("sha256",t.concat(i)));if(224!==a.length)throw"DH_params: dataWithHash !== 224 bytes!";const n=yield s.Z.invokeCrypto("aes-encrypt",a,t,new Uint8Array([0])),o=Ds(t,yield s.Z.invokeCrypto("sha256",n)).concat(n),p=fs(o),d=ns()(e.publicKey.modulus,16);if(-1===p.compare(d))return o}})))(),p=vs(yield s.Z.invokeCrypto("rsa-encrypt",o,e.publicKey),256,!0,!0,!0),f={nonce:e.nonce,server_nonce:e.serverNonce,p:e.p,q:e.q,public_key_fingerprint:e.publicKey.fingerprint,encrypted_data:p},c=new us({mtproto:!0});c.storeMethod("req_DH_params",f);const l=c.getBytes(!0);let m;d.ZP&&this.log("Send req_DH_params",f);try{m=yield this.sendPlainRequest(e.dcId,l)}catch(e){throw this.log.error("Send req_DH_params FAIL!",e),e}const g=m.fetchObject("Server_DH_Params","RESPONSE");if(d.ZP&&this.log("Sent req_DH_params, response:",g),"server_DH_params_fail"!==g._&&"server_DH_params_ok"!==g._)throw new Error("[MT] Server_DH_Params response invalid: "+g._);if(!(0,Ps.Z)(e.nonce,g.nonce))throw new Error("[MT] Server_DH_Params nonce mismatch");if(!(0,Ps.Z)(e.serverNonce,g.server_nonce))throw new Error("[MT] Server_DH_Params server_nonce mismatch");if("server_DH_params_fail"===g._){const t=(yield s.Z.invokeCrypto("sha1",e.newNonce)).slice(-16);if(!(0,Ps.Z)(t,g.new_nonce_hash))throw new Error("[MT] server_DH_params_fail new_nonce_hash mismatch");throw new Error("[MT] server_DH_params_fail")}try{yield this.decryptServerDhDataAnswer(e,g.encrypted_answer)}catch(e){throw this.log.error("mtpDecryptServerDhDataAnswer FAILED!",e),e}return this.sendSetClientDhParams(e)}))}decryptServerDhDataAnswer(e,t){return Es(this,void 0,void 0,(function*(){e.localTime=Date.now(),e.tmpAesKey=(yield s.Z.invokeCrypto("sha1",e.newNonce.concat(e.serverNonce))).concat((yield s.Z.invokeCrypto("sha1",e.serverNonce.concat(e.newNonce))).slice(0,12)),e.tmpAesIv=(yield s.Z.invokeCrypto("sha1",e.serverNonce.concat(e.newNonce))).slice(12).concat(yield s.Z.invokeCrypto("sha1",e.newNonce.concat(e.newNonce)),e.newNonce.slice(0,4));const a=new Uint8Array(yield s.Z.invokeCrypto("aes-decrypt",t,e.tmpAesKey,e.tmpAesIv)),n=a.slice(0,20),i=a.slice(20),r=new ys(i,{mtproto:!0}),o=r.fetchObject("Server_DH_inner_data");if("server_DH_inner_data"!==o._)throw new Error("[MT] server_DH_inner_data response invalid: "+o);if(!(0,Ps.Z)(e.nonce,o.nonce))throw new Error("[MT] server_DH_inner_data nonce mismatch");if(!(0,Ps.Z)(e.serverNonce,o.server_nonce))throw new Error("[MT] server_DH_inner_data serverNonce mismatch");d.ZP&&this.log("Done decrypting answer"),e.g=o.g,e.dhPrime=o.dh_prime,e.gA=o.g_a,e.serverTime=o.server_time,e.retry=0,this.verifyDhParams(e.g,e.dhPrime,e.gA);const p=r.getOffset();if(!(0,Ps.Z)(n,yield s.Z.invokeCrypto("sha1",i.slice(0,p))))throw new Error("[MT] server_DH_inner_data SHA1 mismatch");this.timeManager.applyServerTime(e.serverTime,e.localTime)}))}verifyDhParams(e,t,a){d.ZP&&this.log("Verifying DH params",e,t,a);const s=E(t);if(3!==e||"c71caeb9c6b1c9048e6c522f70f13f73980d40238e3e21c14934d037563d930f48198a0aa7c14058229493d22530f4dbfa336f6e0ac925139543aed44cce7c3720fd51f69458705ac68cd4fe6b6b13abdc9746512969328454f18faf8c595f642477fe96bb2a941d5bcd1d4ac8cc49880708fa9b378e3c4f3a9060bee67cf9a4a4a695811051907e162753b56b0f6b410dba74d8a84b2a14b3144e0ef1284754fd17ed950d5965b4b9dd46582db1178d169c6bc465b0d6ff9ca3928fef5b9ae4e418fc15e83ebea0f87fa9ff5eed70050ded2849f47bf959d956850ce929851f0d8115f635b105ee2e4e15d04b2454bf6f4fadf034b10403119cd8e3b92fcc5b"!==s)throw new Error("[MT] DH params are not verified: unknown dhPrime");d.ZP&&this.log("dhPrime cmp OK");const n=fs(a),i=ns()(s,16);if(n.compare(ns().one)<=0)throw new Error("[MT] DH params are not verified: gA <= 1");if(n.compare(i.subtract(ns().one))>=0)throw new Error("[MT] DH params are not verified: gA >= dhPrime - 1");d.ZP&&this.log("1 < gA < dhPrime-1 OK");const r=ns()(2).pow(1984);if(n.compare(r)<0)throw new Error("[MT] DH params are not verified: gA < 2^{2048-64}");if(n.compare(i.subtract(r))>=0)throw new Error("[MT] DH params are not verified: gA > dhPrime - 2^{2048-64}");return d.ZP&&this.log("2^{2048-64} < gA < dhPrime-2^{2048-64} OK"),!0}sendSetClientDhParams(e){return Es(this,void 0,void 0,(function*(){const t=(0,Ha.Z)(e.g.toString(16));e.b=k(new Uint8Array(256));try{var a=yield s.Z.invokeCrypto("mod-pow",t,e.b,e.dhPrime)}catch(e){throw e}const n=new us({mtproto:!0});n.storeObject({_:"client_DH_inner_data",nonce:e.nonce,server_nonce:e.serverNonce,retry_id:[0,e.retry++],g_b:a},"Client_DH_Inner_Data");const i=(yield s.Z.invokeCrypto("sha1",n.getBuffer())).concat(n.getBytes(!0)),r=yield s.Z.invokeCrypto("aes-encrypt",i,e.tmpAesKey,e.tmpAesIv),o=new us({mtproto:!0});let p;o.storeMethod("set_client_DH_params",{nonce:e.nonce,server_nonce:e.serverNonce,encrypted_data:r}),d.ZP&&this.log("Send set_client_DH_params");try{p=yield this.sendPlainRequest(e.dcId,o.getBytes(!0))}catch(e){throw e}const f=p.fetchObject("Set_client_DH_params_answer");if("dh_gen_ok"!==f._&&"dh_gen_retry"!==f._&&"dh_gen_fail"!==f._)throw new Error("[MT] Set_client_DH_params_answer response invalid: "+f._);if(!(0,Ps.Z)(e.nonce,f.nonce))throw new Error("[MT] Set_client_DH_params_answer nonce mismatch");if(!(0,Ps.Z)(e.serverNonce,f.server_nonce))throw new Error("[MT] Set_client_DH_params_answer server_nonce mismatch");try{var c=yield s.Z.invokeCrypto("mod-pow",e.gA,e.b,e.dhPrime)}catch(e){throw c}const l=yield s.Z.invokeCrypto("sha1",c),m=l.slice(0,8),g=l.slice(-8);switch(d.ZP&&this.log("Got Set_client_DH_params_answer",f._,c),f._){case"dh_gen_ok":{const t=(yield s.Z.invokeCrypto("sha1",e.newNonce.concat([1],m))).slice(-16);if(!(0,Ps.Z)(t,f.new_nonce_hash1))throw this.log.error("Set_client_DH_params_answer new_nonce_hash1 mismatch",t,f),new Error("new_nonce_hash1 mismatch");const a=Ds(e.newNonce.slice(0,8),e.serverNonce.slice(0,8));return d.ZP&&this.log("Auth successfull!",g,c,a),e.authKeyId=g,e.authKey=c,e.serverSalt=a,e}case"dh_gen_retry":{const t=(yield s.Z.invokeCrypto("sha1",e.newNonce.concat([2],m))).slice(-16);if(!(0,Ps.Z)(t,f.new_nonce_hash2))throw new Error("[MT] Set_client_DH_params_answer new_nonce_hash2 mismatch");return this.sendSetClientDhParams(e)}case"dh_gen_fail":{const t=(yield s.Z.invokeCrypto("sha1",e.newNonce.concat([3],m))).slice(-16);if(!(0,Ps.Z)(t,f.new_nonce_hash3))throw new Error("[MT] Set_client_DH_params_answer new_nonce_hash3 mismatch");throw new Error("[MT] Set_client_DH_params_answer fail")}}}))}getTransportType(){return this.getTransportTypePromise?this.getTransportTypePromise:this.getTransportTypePromise=Z.pingTransports().then((({websocket:e})=>{this.transportType=e?"websocket":"https",this.log("will use transport:",this.transportType)}))}auth(e){let t=this.cached[e];return t||(t=new Promise(((t,a)=>Es(this,void 0,void 0,(function*(){let s;yield this.getTransportType();let n=1;for(;n++<=3;)try{const a={dcId:e,nonce:k(new Uint8Array(16))},s=this.sendReqPQ(a);return void t(yield s)}catch(e){s=e}a(s)})))),this.cached[e]=t)}}class Fs extends G{after(){this.lastMessageId=[0,0],this.timeOffset=0,qa.Z.get("server_time_offset").then((e=>{e&&(this.timeOffset=e)}))}getServerTimeOffset(){return this.timeOffset}generateId(){const e=Date.now();let t=[Math.floor(e/1e3)+this.timeOffset,e%1e3<<21|(0,Ee.d)(16)<<3|4];return(this.lastMessageId[0]>t[0]||this.lastMessageId[0]===t[0]&&this.lastMessageId[1]>=t[1])&&(t=[this.lastMessageId[0],this.lastMessageId[1]+4]),this.lastMessageId=t,rs(t[0],t[1]).toString(10)}applyServerTime(e,t){const a=e-(t=(t||Date.now())/1e3|0),s=Math.abs(this.timeOffset-a)>10;return this.lastMessageId=[0,0],this.timeOffset!==a&&(qa.Z.set({server_time_offset:a}),this.timeOffset=a),s}}class Rs{saveWebDocument(e){if(!e)return;const t=e.attributes.find((e=>"documentAttributeImageSize"===e._));return t&&(e.w=t.w,e.h=t.h),e}}class xs extends G{getInputInvoiceBySlug(e){return{_:"inputInvoiceSlug",slug:e}}getInputInvoiceByPeerId(e,t){return{_:"inputInvoiceMessage",peer:this.appPeersManager.getInputPeerById(e),msg_id:(0,oe.Z)(t)}}getPaymentForm(e){return this.apiManager.invokeApi("payments.getPaymentForm",{invoice:e}).then((e=>(this.appUsersManager.saveApiUsers(e.users),e)))}getPaymentReceipt(e,t){return this.apiManager.invokeApi("payments.getPaymentReceipt",{peer:this.appPeersManager.getInputPeerById(e),msg_id:(0,oe.Z)(t)}).then((e=>(this.appUsersManager.saveApiUsers(e.users),e)))}validateRequestedInfo(e,t,a){return this.apiManager.invokeApi("payments.validateRequestedInfo",{save:a,invoice:e,info:t})}sendPaymentForm(e,t,a,s,n,i){return this.apiManager.invokeApi("payments.sendPaymentForm",{form_id:t,invoice:e,requested_info_id:a,shipping_option_id:s,credentials:n,tip_amount:i||void 0}).then((e=>("payments.paymentResult"===e._&&this.apiUpdatesManager.processUpdateMessage(e.updates),e)))}clearSavedInfo(e,t){return this.apiManager.invokeApi("payments.clearSavedInfo",{info:e,credentials:t})}}var Bs=a(8794);class Vs extends G{constructor(){super(...arguments),this.clear=(e=!1)=>{e?this.attachMenuBots=new Map:(this.attachMenuBots.clear(),this.attachMenuBotsArr=void 0)},this.onUpdateAttachMenuBots=e=>{this.clear(),this.getAttachMenuBots()}}after(){this.clear(!0),this.apiUpdatesManager.addMultipleEventsListeners({updateAttachMenuBots:this.onUpdateAttachMenuBots})}saveAttachMenuBot(e){this.attachMenuBots.set(e.bot_id,e);const t=(0,Bs.Z)(e);return t.icon=this.appDocsManager.saveDoc(t.icon,{type:"attachMenuBotIcon",botId:e.bot_id}),e}saveAttachMenuBots(e){e.saved||(e.saved=!0,e.forEach((e=>this.saveAttachMenuBot(e))))}getAttachMenuBots(){var e;return null!==(e=this.attachMenuBotsArr)&&void 0!==e?e:this.apiManager.invokeApiSingleProcess({method:"messages.getAttachMenuBots",processResult:e=>((0,ue.Z)(e),this.appUsersManager.saveApiUsers(e.users),this.saveAttachMenuBots(e.bots),this.attachMenuBotsArr=e.bots.slice(0,0))})}getAttachMenuBotCached(e){return this.attachMenuBots.get(e)}getAttachMenuBot(e,t){throw this.appUsersManager.isAttachMenuBot(e),(0,X.Z)("BOT_INVALID")}requestWebView(e){const{botId:t,peerId:a,url:s,fromBotMenu:n,themeParams:i,replyToMsgId:r,silent:o,sendAsPeerId:p,startParam:d,threadId:f}=e;return this.apiManager.invokeApiSingleProcess({method:"messages.requestWebView",params:{peer:this.appPeersManager.getInputPeerById(a),bot:this.appUsersManager.getUserInput(t),silent:o,platform:"web",url:s,reply_to_msg_id:r?(0,oe.Z)(r):void 0,from_bot_menu:n,theme_params:i,send_as:p?this.appPeersManager.getInputPeerById(p):void 0,start_param:d,top_msg_id:f?(0,oe.Z)(f):void 0},processResult:e=>(console.log(e),e)})}prolongWebView(e){return this.apiManager.invokeApiSingleProcess({method:"messages.prolongWebView",params:{peer:this.appPeersManager.getInputPeerById(e.peerId),bot:this.appUsersManager.getUserInput(e.botId),query_id:e.queryId,silent:e.silent,reply_to_msg_id:e.replyToMsgId?(0,oe.Z)(e.replyToMsgId):void 0,send_as:e.sendAsPeerId?this.appPeersManager.getInputPeerById(e.sendAsPeerId):void 0,top_msg_id:e.threadId?(0,oe.Z)(e.threadId):void 0},processResult:e=>{console.log(e)}})}}class Os extends G{requestUrlAuth(e,t,a,s){return this.apiManager.invokeApi("messages.requestUrlAuth",{button_id:s,msg_id:a?(0,oe.Z)(a):void 0,peer:t?this.appPeersManager.getInputPeerById(t):void 0,url:e}).then((e=>("urlAuthResultRequest"===e._&&this.appUsersManager.saveApiUser(e.bot),e)))}acceptUrlAuth(e,t,a,s,n){return this.apiManager.invokeApi("messages.acceptUrlAuth",{button_id:s,msg_id:a?(0,oe.Z)(a):void 0,peer:t?this.appPeersManager.getInputPeerById(t):void 0,url:e,write_allowed:n}).then((e=>e))}getWebAuthorizations(){return this.apiManager.invokeApi("account.getWebAuthorizations").then((e=>(this.appUsersManager.saveApiUsers(e.users),e.authorizations)))}resetWebAuthorization(e){return this.apiManager.invokeApi("account.resetWebAuthorization",{hash:e})}resetWebAuthorizations(){return this.apiManager.invokeApi("account.resetWebAuthorizations")}}class Ls extends G{after(){this.wallPapers={}}saveWallPaper(e){return e?("wallPaperNoFile"!==e._&&(e.document=this.appDocsManager.saveDoc(e.document,{type:"wallPaper",wallPaperId:e.id})),this.wallPapers[e.id]=e,e):e}getWallPaper(e){return this.apiManager.invokeApiSingleProcess({method:"account.getWallPaper",params:{wallpaper:e},processResult:e=>this.saveWallPaper(e)})}getInputWallPaper(e){return"string"==typeof e?{_:"inputWallPaperSlug",slug:e}:"wallPaperNoFile"===e._?{_:"inputWallPaperNoFile",id:e.id}:{_:"inputWallPaper",id:e.id,access_hash:e.access_hash}}getWallPaperById(e){const t=this.wallPapers[e];return this.getWallPaper(this.getInputWallPaper(t))}getThemes(){return this.apiManager.invokeApiSingleProcess({method:"account.getThemes",params:{format:"macos",hash:0},processResult:e=>((0,ue.Z)(e),e.themes.forEach((e=>{e.settings&&e.settings.forEach((e=>{e.wallpaper=this.saveWallPaper(e.wallpaper)}))})),e.themes)})}getWallPapers(){return this.apiManager.invokeApiHashable({method:"account.getWallPapers"}).then((e=>{const t=e.wallpapers;return t.forEach(((e,t,a)=>{a[t]=this.saveWallPaper(e)})),t}))}}const Ns=new class{constructor(){this.cryptoWorkersURLs=[],this.cryptoPortsAttached=0,this.cryptoPortPromise=(0,v.Z)(),this.cryptoPortPromise.then((()=>{this.cryptoPortPromise=void 0}))}start(){const e=f.Z.getInstance();e.addEventListener("manager",(({name:e,method:t,args:a})=>(0,q.Z)(this.getManagers(),(s=>{const n=s[e];return n[t].apply(n,a)})))),e.addEventListener("cryptoPort",((e,t,a)=>{var n;const i=a.ports[0];this.cryptoPortsAttached>=this.cryptoWorkersURLs.length?i.close():(++this.cryptoPortsAttached,s.Z.attachPort(i),null===(n=this.cryptoPortPromise)||void 0===n||n.resolve())})),e.addEventListener("createProxyWorkerURLs",(({originalUrl:e,blob:t})=>{let a=this.cryptoWorkersURLs.length;a||(this.cryptoWorkersURLs.push(e),++a);const s=_.Z.cryptoWorkers;if(a===s)return this.cryptoWorkersURLs;const n=new Array(s-a).fill(void 0).map((()=>URL.createObjectURL(t)));return this.cryptoWorkersURLs.push(...n),this.cryptoWorkersURLs}))}createManagers(){return e=this,t=void 0,n=function*(){const e=new $;yield Promise.all([e.loadStorages(),this.cryptoPortPromise]);const t=yield function(e,t){const a={appPeersManager:new fa,appChatsManager:new Ve,appDocsManager:new yt,appPhotosManager:new ca,appPollsManager:new la,appUsersManager:new Aa,appWebPagesManager:new Da,appDraftsManager:new vt,appProfileManager:new ua,appNotificationsManager:new na,apiUpdatesManager:new Ue,appAvatarsManager:new De,appGroupCallsManager:new Ct,appCallsManager:new Fe,appReactionsManager:new ba,appMessagesManager:new ta,appMessagesIdsManager:new Tt,appPrivacyManager:new ma,appInlineBotsManager:new Dt,appStickersManager:new Ca,referenceDatabase:new ee,appEmojiManager:new St,filtersStorage:new Ce,dialogsStorage:new _e,apiManager:new Ja,cryptoWorker:s.Z,passwordManager:new Q,apiFileManager:new ja,peersStorage:new Qa,thumbsStorage:new Xa,networkerFactory:new As,rootScope:new l,authorizer:new Ts,dcConfigurator:new O,timeManager:new Fs,appStoragesManager:e,appStateManager:y,appWebDocsManager:new Rs,appPaymentsManager:new xs,appAttachMenuBotsManager:new Vs,appSeamlessLoginManager:new Os,appThemesManager:new Ls};for(const e in a){const t=a[e];t&&(t.setManagers&&(t.setManagers(a),delete t.setManagers),T.Z[e]=t)}const n=[];let i=Object.keys(a);i.unshift("appUsersManager","appChatsManager","appNotificationsManager","appMessagesManager","dialogsStorage"),i=(0,ke.Z)(i);for(const e of i){const t=a[e];if(null==t?void 0:t.after){const e=t.after();n.push(e)}}return t&&a.apiManager.setUserAuth(t),Promise.all(n).then((()=>a))}(e,y.userId);return this.managers=t},new((a=void 0)||(a=Promise))((function(s,i){function r(e){try{p(n.next(e))}catch(e){i(e)}}function o(e){try{p(n.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?s(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}p((n=n.apply(e,t||[])).next())}));var e,t,a,n}getManagers(){var e;return null!==(e=this.managers)&&void 0!==e?e:this.managers=this.createManagers()}};d.GO&&(d.GO.appManagersManager=Ns);const Zs=Ns;var js=a(3655);let qs,Gs,Hs=!0;function Ws(){return Hs}function zs(){return Hs?qs:void 0}const Ks=(0,S.kg)("MTPROTO"),Js=new f.Z;Js.addMultipleEventsListeners({environment:e=>{r(e),Z.waitForWebSocket()},crypto:({method:e,args:t})=>s.Z.invokeCrypto(e,...t),state:({state:e,resetStorages:t,pushedKeys:a,newVersion:s,oldVersion:n,userId:i})=>{Ks("got state",e,a),y.userId=i,y.newVersion=s,y.oldVersion=n,Object.keys(e).forEach((t=>{y.pushToState(t,e[t],!0,!a.includes(t))})),j.resolve(t)},toggleStorages:({enabled:e,clearWrite:t})=>(0,za.Z)(e,t),event:(e,t)=>{Ks("will redirect event",e,t),Js.invokeExceptSource("event",e,t)},serviceWorkerOnline:e=>{Hs=e},serviceWorkerPort:(e,t,a)=>{qs?(qs.detachPort(Gs),Gs=void 0):(qs=new js.Z,qs.addMultipleEventsListeners({requestFilePart:e=>(0,q.Z)(Zs.getManagers(),(t=>{const{docId:a,dcId:s,offset:n,limit:i}=e;return t.appDocsManager.requestDocPart(a,s,n,i)}))})),(Gs=a.ports[0])&&qs.attachPort(Gs)},createObjectURL:e=>URL.createObjectURL(e)}),Ks("MTProto start"),Zs.start(),Zs.getManagers(),Ht.start(),function(e,t,a){const s=(a,s)=>{e.attachListenPort(a),s&&e.attachSendPort(s),null==t||t(a)};e.setOnPortDisconnect((e=>{Ht.deleteTab(e)})),"undefined"!=typeof SharedWorkerGlobalScope?T.Z.addEventListener("connect",(e=>s(e.source,e.source))):"undefined"!=typeof ServiceWorkerGlobalScope?s(T.Z,null):s(T.Z,T.Z)}(Js,(e=>{Ht.addTab(e)}))},1507:(e,t,a)=>{a.d(t,{BP:()=>f,BX:()=>l,DZ:()=>h,Gu:()=>u,IA:()=>i,Iw:()=>p,J$:()=>m,NM:()=>s,Ox:()=>c,Pt:()=>d,Zi:()=>g,hj:()=>n,rU:()=>o,yF:()=>r});const s=0,n=1271266957,i=777,r=777e3,o=2147483647,p=20971520,d="",f="default_static",c=4295032831,l=new Set(["web","k","z"]),m=0,g=1,h=new Set([m,g]),u=Math.max(...Array.from(h))+1},2423:(e,t,a)=>{a.d(t,{$2:()=>l,E:()=>m,QB:()=>g,SC:()=>h,bu:()=>d,c$:()=>u,it:()=>p,kO:()=>_,tY:()=>y});var s=a(1229);const n="a-z\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u00ff\\u0100-\\u024f\\u0253\\u0254\\u0256\\u0257\\u0259\\u025b\\u0263\\u0268\\u026f\\u0272\\u0289\\u028b\\u02bb\\u0300-\\u036f\\u1e00-\\u1eff\\u0400-\\u04ff\\u0500-\\u0527\\u2de0-\\u2dff\\ua640-\\ua69f\\u0591-\\u05bf\\u05c1-\\u05c2\\u05c4-\\u05c5\\u05c7\\u05d0-\\u05ea\\u05f0-\\u05f4\\ufb1d-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40-\\ufb41\\ufb43-\\ufb44\\ufb46-\\ufb4f\\u0610-\\u061a\\u0620-\\u065f\\u066e-\\u06d3\\u06d5-\\u06dc\\u06de-\\u06e8\\u06ea-\\u06ef\\u06fa-\\u06fc\\u06ff\\u0750-\\u077f\\u08a0\\u08a2-\\u08ac\\u08e4-\\u08fe\\ufb50-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\u200c\\u0e01-\\u0e3a\\u0e40-\\u0e4e\\u1100-\\u11ff\\u3130-\\u3185\\uA960-\\uA97F\\uAC00-\\uD7AF\\uD7B0-\\uD7FF\\u3003\\u3005\\u303b\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uff9f\\uffa1-\\uffdc",i="0-9_"+n,r="["+n+"0-9]",o="((?:https?|ftp)://|mailto:)?",p=o+"(?:"+r+"{1,64}(?::"+r+"{0,64})?@)?(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}|"+r+"["+n+"·0-9-]{0,64}(?:\\."+r+"["+n+"·0-9-]{0,64}){0,10}(?:\\.(xn--[0-9a-z]{2,16}|["+n+"]{2,24})))(?::\\d{2,5})?(?:/(?:\\S{0,255}[^\\s.;,(\\[\\]{}<>\"'])?)?",d=(new RegExp("^"+o.slice(0,-1),"i"),/^((?:[^\/]+?):\/\/|mailto:)/),f="[a-zA-Z\\d_]{5,32}",c="\\/([a-zA-Z\\d_]{1,32})(?:@("+f+"))?(\\b|$)",l=new RegExp("(^| )(@)("+f+")|("+p+")|(\\n)|("+s.Z+")|(^|[\\s\\(\\]])(#["+i+"]{2,64})|(^|\\s)"+c+"|(?:\\s|^)((?:\\d{1,2}:)?(?:[0-5]?[0-9]):(?:[0-5][0-9]))(?:\\s|$)","i"),m=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,g=/(^|\s|\n)(````?)([\s\S]+?)(````?)([\s\n\.,:?!;]|$)|(^|\s|\x01)(`|~~|\*\*|__|_-_|\|\|)([^\n]+?)\7([\x01\s\.,:?!;]|$)|@(\d+)\s*\((.+?)\)|(\[(.+?)\]\((.+?)\))/m,h={"`":"messageEntityCode","``":"messageEntityPre","**":"messageEntityBold",__:"messageEntityItalic","~~":"messageEntityStrike","_-_":"messageEntityUnderline","||":"messageEntitySpoiler"},u=new Set(Object.values(h)),y=new Set(["messageEntityEmoji","messageEntityLinebreak","messageEntityCaret"]);for(const e in h)y.add(h[e]);const _=/^\+\d+$/},671:(e,t,a)=>{function s(e){return function(e){const t=[];let a=0,s=0,n=0;for(;n55296&&a<=56319?s=a:t.push(a.toString(16));return t.length&&2===t[0].length&&(t[0]="00"+t[0]),t}(r(e)).join("-")}a.d(t,{N0:()=>s});const n=/\uFE0F/g,i=String.fromCharCode(8205),r=e=>e.indexOf(i)<0?e.replace(n,""):e;new Map([["FT","🏴‍☠"]])}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var i=s[e]={id:e,loaded:!1,exports:{}};return a[e].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.m=a,n.x=()=>{var e=n.O(void 0,[699,211,147,85,110],(()=>n(9092)));return n.O(e)},e=[],n.O=(t,a,s,i)=>{if(!a){var r=1/0;for(f=0;f=i)&&Object.keys(n.O).every((e=>n.O[e](a[p])))?a.splice(p--,1):(o=!1,i0&&e[f-1][2]>i;f--)e[f]=e[f-1];e[f]=[a,s,i]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,a)=>(n.f[a](e,t),t)),[])),n.u=e=>85===e?"85.887945ef5f43bc205112.bundle.js":110===e?"110.109af56006a419549840.bundle.js":({211:"npm.big-integer",699:"npm.pako"}[e]||e)+"."+{8:"93d2f33af815eb0455aa",104:"be090b1ee184fa23f913",147:"52e5e3f41bb7eb15ae10",211:"363d763daad0ee4e2741",301:"95838a8203f23dd1ce8f",642:"be93122d1116ecdc9322",699:"89deb457201f16c93925"}[e]+".chunk.js",n.miniCssF=e=>{},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var a=t.getElementsByTagName("script");a.length&&(e=a[a.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{if(void 0!==n){var e=n.u,t=n.e,a={},s={};n.u=function(t){return e(t)+(a.hasOwnProperty(t)?"?"+a[t]:"")},n.e=function(i){return t(i).catch((function(t){var r=s.hasOwnProperty(i)?s[i]:999999;if(r<1){var o=e(i);throw t.message="Loading chunk "+i+" failed after 999999 retries.\n("+o+")",t.request=o,t}return new Promise((function(e){setTimeout((function(){var t=Date.now();a[i]=t,s[i]=r-1,e(n.e(i))}),3e3)}))}))}}})(),(()=>{var e={678:1};n.f.i=(t,a)=>{e[t]||importScripts(n.p+n.u(t))};var t=this.webpackChunktweb=this.webpackChunktweb||[],a=t.push.bind(t);t.push=t=>{var[s,i,r]=t;for(var o in i)n.o(i,o)&&(n.m[o]=i[o]);for(r&&r(n);s.length;)e[s.pop()]=1;a(t)}})(),t=n.x,n.x=()=>Promise.all([699,211,147,85,110].map(n.e,n)).then(t),n.x()})(); +//# sourceMappingURL=mtproto.worker.c9d58d1702ff11ef9b30.chunk.js.map \ No newline at end of file diff --git a/public/mtproto.worker.c9d58d1702ff11ef9b30.chunk.js.map b/public/mtproto.worker.c9d58d1702ff11ef9b30.chunk.js.map new file mode 100644 index 00000000..f66032b5 --- /dev/null +++ b/public/mtproto.worker.c9d58d1702ff11ef9b30.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mtproto.worker.c9d58d1702ff11ef9b30.chunk.js","mappings":"uBAAIA,ECAAC,E,4CCQG,MACMC,E,QAAoB,QAEpBC,EADuB,oBAAb,OAA2BC,OAASC,KAE3D,G,kCCJO,MAAMC,EAAyE,CAAC,GAAK,CAAC,QAAQ,KAAM,QAAQ,KAAM,QAAQ,KAAM,QAAQ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EAAI,CAAC6sG,EAAStuG,KAE/B6vG,EAAgBvB,IAElBW,cAAc3B,EAAoBx3E,EAAIw3E,EAAoBrzE,EAAEq0E,GAE9D,EAGD,IAAIwB,EAAqBh0G,KAAuB,iBAAIA,KAAuB,kBAAK,GAC5Ei0G,EAA6BD,EAAmB1zG,KAAK2e,KAAK+0F,GAC9DA,EAAmB1zG,KAvBCgK,IACnB,IAAK0nG,EAAUkC,EAAaC,GAAW7pG,EACvC,IAAI,IAAImnG,KAAYyC,EAChB1C,EAAoB1+C,EAAEohD,EAAazC,KACrCD,EAAoBpd,EAAEqd,GAAYyC,EAAYzC,IAIhD,IADG0C,GAASA,EAAQ3C,GACdQ,EAASv1G,QACds3G,EAAgB/B,EAAStqG,OAAS,EACnCusG,EAA2B3pG,EAAK,C,K9HnB7B7Q,EAAO+3G,EAAoB/T,EAC/B+T,EAAoB/T,EAAI,IAChB97F,QAAQ0Q,IAAI,CAAC,IAAI,IAAI,IAAI,GAAG,KAAKlO,IAAIqtG,EAAoBjvG,EAAGivG,IAAsB1sG,KAAKrL,G+HDrE+3G,EAAoB/T,G","sources":["webpack://tweb/webpack/runtime/chunk loaded","webpack://tweb/webpack/runtime/startup chunk dependencies","webpack://tweb/./src/config/debug.ts","webpack://tweb/./src/config/emoji.ts","webpack://tweb/./src/environment/userAgent.ts","webpack://tweb/./src/helpers/cleanSearchText.ts","webpack://tweb/./src/helpers/fileName.ts","webpack://tweb/./src/helpers/restrictions.ts","webpack://tweb/./src/lib/appManagers/utils/peers/getPeerId.ts","webpack://tweb/./src/lib/files/idb.ts","webpack://tweb/./src/environment/utils.ts","webpack://tweb/./src/lib/rootScope.ts","webpack://tweb/./src/lib/appManagers/appStateManager.ts","webpack://tweb/./src/helpers/object/setDeepProperty.ts","webpack://tweb/./src/lib/mtproto/transports/http.ts","webpack://tweb/./src/lib/mtproto/transports/websocket.ts","webpack://tweb/./src/helpers/array/randomize.ts","webpack://tweb/./src/lib/mtproto/transports/obfuscation.ts","webpack://tweb/./src/lib/mtproto/transports/abridged.ts","webpack://tweb/./src/helpers/bytes/bytesToHex.ts","webpack://tweb/./src/lib/mtproto/transports/tcpObfuscated.ts","webpack://tweb/./src/lib/mtproto/dcConfigurator.ts","webpack://tweb/./src/lib/mtproto/transports/controller.ts","webpack://tweb/./src/lib/appManagers/utils/storages/resetStoragesPromise.ts","webpack://tweb/./src/lib/appManagers/manager.ts","webpack://tweb/./src/lib/appManagers/utils/storages/loadStorages.ts","webpack://tweb/./src/lib/appManagers/appStoragesManager.ts","webpack://tweb/./src/lib/appManagers/utils/storages/createStorages.ts","webpack://tweb/./src/lib/mtproto/passwordManager.ts","webpack://tweb/./src/lib/mtproto/referenceDatabase.ts","webpack://tweb/./src/helpers/object/safeReplaceObject.ts","webpack://tweb/./src/lib/appManagers/utils/messages/getPeerIdsFromMessage.ts","webpack://tweb/./src/lib/appManagers/utils/dialogs/setDialogIndex.ts","webpack://tweb/./src/lib/storages/dialogs.ts","webpack://tweb/./src/lib/storages/filters.ts","webpack://tweb/./src/helpers/applyMixins.ts","webpack://tweb/./src/lib/appManagers/apiUpdatesManager.ts","webpack://tweb/./src/lib/appManagers/appAvatarsManager.ts","webpack://tweb/./src/lib/appManagers/appCallsManager.ts","webpack://tweb/./src/lib/appManagers/appChatsManager.ts","webpack://tweb/./src/lib/langPack.ts","webpack://tweb/./src/lib/richTextProcessor/wrapUrl.ts","webpack://tweb/./src/helpers/dom/setInnerHTML.ts","webpack://tweb/./src/helpers/date.ts","webpack://tweb/./src/helpers/object/safeReplaceArrayInObject.ts","webpack://tweb/./src/environment/mimeTypeMap.ts","webpack://tweb/./src/lib/appManagers/appDocsManager.ts","webpack://tweb/./src/lib/appManagers/utils/docs/getDocumentURL.ts","webpack://tweb/./src/lib/appManagers/appDraftsManager.ts","webpack://tweb/./src/lib/appManagers/appEmojiManager.ts","webpack://tweb/./src/lib/appManagers/appGroupCallsManager.ts","webpack://tweb/./src/lib/appManagers/utils/photos/getPhotoInput.ts","webpack://tweb/./src/lib/appManagers/utils/photos/getPhotoMediaInput.ts","webpack://tweb/./src/lib/appManagers/utils/docs/getDocumentMediaInput.ts","webpack://tweb/./src/lib/appManagers/appInlineBotsManager.ts","webpack://tweb/./src/lib/appManagers/appMessagesIdsManager.ts","webpack://tweb/./src/helpers/string/splitStringByLength.ts","webpack://tweb/./src/lib/appManagers/appTabsManager.ts","webpack://tweb/./src/lib/appManagers/utils/docs/getDocumentInput.ts","webpack://tweb/./src/helpers/object/setBooleanFlag.ts","webpack://tweb/./src/lib/appManagers/appMessagesManager.ts","webpack://tweb/./src/lib/appManagers/utils/docs/getDocumentInputFileName.ts","webpack://tweb/./src/helpers/string/convertInputKeyToKey.ts","webpack://tweb/./src/lib/appManagers/appNotificationsManager.ts","webpack://tweb/./src/lib/appManagers/appPeersManager.ts","webpack://tweb/./src/lib/appManagers/appPhotosManager.ts","webpack://tweb/./src/lib/appManagers/appPollsManager.ts","webpack://tweb/./src/lib/appManagers/appPrivacyManager.ts","webpack://tweb/./src/lib/appManagers/appProfileManager.ts","webpack://tweb/./src/helpers/callbackifyAll.ts","webpack://tweb/./src/lib/appManagers/appReactionsManager.ts","webpack://tweb/./src/lib/appManagers/appStickersManager.ts","webpack://tweb/./src/helpers/fixBase64String.ts","webpack://tweb/./src/lib/appManagers/appUsersManager.ts","webpack://tweb/./src/helpers/cleanUsername.ts","webpack://tweb/./src/lib/appManagers/appWebPagesManager.ts","webpack://tweb/./src/helpers/blob/readBlobAsArrayBuffer.ts","webpack://tweb/./src/helpers/string/fileNameRFC.ts","webpack://tweb/./src/lib/files/downloadWriter.ts","webpack://tweb/./src/lib/files/downloadStorage.ts","webpack://tweb/./src/lib/mtproto/apiFileManager.ts","webpack://tweb/./src/helpers/fixFirefoxSvg.ts","webpack://tweb/./src/helpers/blob/readBlobAsUint8Array.ts","webpack://tweb/./src/lib/mtproto/api_methods.ts","webpack://tweb/./src/lib/mtproto/apiManager.ts","webpack://tweb/./src/lib/storages/peers.ts","webpack://tweb/./src/lib/storages/thumbs.ts","webpack://tweb/./src/lib/mtproto/schema.ts","webpack://tweb/./src/helpers/number/intToUint.ts","webpack://tweb/./src/helpers/long/ulongFromInts.ts","webpack://tweb/./src/helpers/bigInt/bigIntConstants.ts","webpack://tweb/./src/helpers/bigInt/bigIntConversion.ts","webpack://tweb/./src/lib/mtproto/tl_utils.ts","webpack://tweb/./src/helpers/gzipUncompress.ts","webpack://tweb/./src/helpers/bytes/addPadding.ts","webpack://tweb/./src/lib/mtproto/networker.ts","webpack://tweb/./src/helpers/long/sortLongsArray.ts","webpack://tweb/./src/helpers/long/longToBytes.ts","webpack://tweb/./src/lib/mtproto/networkerFactory.ts","webpack://tweb/./src/lib/mtproto/rsaKeysManager.ts","webpack://tweb/./src/helpers/bytes/bytesXor.ts","webpack://tweb/./src/lib/mtproto/authorizer.ts","webpack://tweb/./src/lib/mtproto/timeManager.ts","webpack://tweb/./src/lib/appManagers/appWebDocsManager.ts","webpack://tweb/./src/lib/appManagers/appPaymentsManager.ts","webpack://tweb/./src/lib/appManagers/appAttachMenuBotsManager.ts","webpack://tweb/./src/lib/appManagers/appSeamlessLoginManager.ts","webpack://tweb/./src/lib/appManagers/appThemesManager.ts","webpack://tweb/./src/lib/appManagers/appManagersManager.ts","webpack://tweb/./src/lib/appManagers/createManagers.ts","webpack://tweb/./src/lib/mtproto/mtproto.worker.ts","webpack://tweb/./src/helpers/listenMessagePort.ts","webpack://tweb/./src/lib/mtproto/mtproto_config.ts","webpack://tweb/./src/lib/richTextProcessor/index.ts","webpack://tweb/./src/vendor/emoji/index.ts","webpack://tweb/webpack/bootstrap","webpack://tweb/webpack/runtime/compat get default export","webpack://tweb/webpack/runtime/define property getters","webpack://tweb/webpack/runtime/ensure chunk","webpack://tweb/webpack/runtime/get javascript chunk filename","webpack://tweb/webpack/runtime/get mini-css chunk filename","webpack://tweb/webpack/runtime/global","webpack://tweb/webpack/runtime/hasOwnProperty shorthand","webpack://tweb/webpack/runtime/make namespace object","webpack://tweb/webpack/runtime/node module decorator","webpack://tweb/webpack/runtime/publicPath","webpack://tweb/webpack/runtime/compat","webpack://tweb/webpack/runtime/importScripts chunk loading","webpack://tweb/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn Promise.all([699,211,147,85,110].map(__webpack_require__.e, __webpack_require__)).then(next);\n};","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Modes from './modes';\n\nexport const IS_BETA = process.env.NODE_ENV !== 'production';\nexport const DEBUG = (IS_BETA || Modes.debug)/* && false */;\nconst ctx: any = typeof(window) !== 'undefined' ? window : self;\nexport const MOUNT_CLASS_TO: any = DEBUG || true/* && false */ ? ctx : {};\nexport default DEBUG;\n\n// let m = DEBUG;\n/* if(!DEBUG) {\n ctx.sandpitTurtle = () => {\n //if(!m) {\n for(let i in MOUNT_CLASS_TO) {\n ctx[i] = MOUNT_CLASS_TO[i];\n }\n //m = true;\n //}\n\n //DEBUG = !DEBUG;\n };\n} */\n\n/* export const superDebug = (object: any, key: string) => {\n var d = object[key];\n var beforeStr = '', afterStr = '';\n for(var r of d) {\n beforeStr += r.before.hex + '\\n';\n afterStr += r.after.hex + '\\n';\n }\n\n beforeStr = beforeStr.trim();\n afterStr = afterStr.trim();\n //var beforeStr = d.map((r) => r.before.hex).join('\\n');\n //var afterStr = d.map((r) => r.after.hex).join('\\n');\n\n var dada = (name: string, str: string) => {\n var a = document.createElement('a');\n a.target = '_blank';\n a.download = name + '.txt';\n a.href = URL.createObjectURL(new Blob([str], {\n type: 'text/plain'\n }));\n document.body.append(a);\n a.click();\n };\n\n dada(key + '_' + 'before', beforeStr);\n dada(key + '_' + 'after', afterStr);\n}\n\nMOUNT_CLASS_TO.superDebug = superDebug; */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {EMOJI_VERSION} from '../environment/emojiVersionsSupport';\n\nexport const EmojiVersions: {[version in EMOJI_VERSION]: {[emoji: string]: number}} = {'14':{'1f6dd':4867, '1f6de':4916, '1f6df':4923, '1f7f0':62832, '1f979':183, '1f9cc':1557, '1fa7b':61332, '1fa7c':61330, '1faa9':51093, '1faaa':61364, '1faab':61189, '1faac':51085, '1fab7':2651, '1fab8':2631, '1fab9':2672, '1faba':2673, '1fac3':1520, '1fac4':1521, '1fac5':1505, '1fad7':3793, '1fad8':3707, '1fad9':3804, '1fae0':111, '1fae1':136, '1fae2':132, '1fae3':133, '1fae4':174, '1fae5':142, '1fae6':1385, '1fae7':61353, '1faf0':1341, '1faf1':1332, '1faf2':1333, '1faf3':1334, '1faf4':1335, '1faf5':1351, '1faf6':1360, '1faf1-1f3fb-200d-1faf2-1f3fc':0, '1faf1-1f3fb-200d-1faf2-1f3fd':0, '1faf1-1f3fb-200d-1faf2-1f3fe':0, '1faf1-1f3fb-200d-1faf2-1f3ff':0, '1faf1-1f3fc-200d-1faf2-1f3fb':0, '1faf1-1f3fc-200d-1faf2-1f3fd':0, '1faf1-1f3fc-200d-1faf2-1f3fe':0, '1faf1-1f3fc-200d-1faf2-1f3ff':0, '1faf1-1f3fd-200d-1faf2-1f3fb':0, '1faf1-1f3fd-200d-1faf2-1f3fc':0, '1faf1-1f3fd-200d-1faf2-1f3fe':0, '1faf1-1f3fd-200d-1faf2-1f3ff':0, '1faf1-1f3fe-200d-1faf2-1f3fb':0, '1faf1-1f3fe-200d-1faf2-1f3fc':0, '1faf1-1f3fe-200d-1faf2-1f3fd':0, '1faf1-1f3fe-200d-1faf2-1f3ff':0, '1faf1-1f3ff-200d-1faf2-1f3fb':0, '1faf1-1f3ff-200d-1faf2-1f3fc':0, '1faf1-1f3ff-200d-1faf2-1f3fd':0, '1faf1-1f3ff-200d-1faf2-1f3fe':0, '1fac3-1f3fb':0, '1fac3-1f3fc':0, '1fac3-1f3fd':0, '1fac3-1f3fe':0, '1fac3-1f3ff':0, '1fac4-1f3fb':0, '1fac4-1f3fc':0, '1fac4-1f3fd':0, '1fac4-1f3fe':0, '1fac4-1f3ff':0, '1fac5-1f3fb':0, '1fac5-1f3fc':0, '1fac5-1f3fd':0, '1fac5-1f3fe':0, '1fac5-1f3ff':0, '1faf0-1f3fb':0, '1faf0-1f3fc':0, '1faf0-1f3fd':0, '1faf0-1f3fe':0, '1faf0-1f3ff':0, '1faf1-1f3fb':0, '1faf1-1f3fc':0, '1faf1-1f3fd':0, '1faf1-1f3fe':0, '1faf1-1f3ff':0, '1faf2-1f3fb':0, '1faf2-1f3fc':0, '1faf2-1f3fd':0, '1faf2-1f3fe':0, '1faf2-1f3ff':0, '1faf3-1f3fb':0, '1faf3-1f3fc':0, '1faf3-1f3fd':0, '1faf3-1f3fe':0, '1faf3-1f3ff':0, '1faf4-1f3fb':0, '1faf4-1f3fc':0, '1faf4-1f3fd':0, '1faf4-1f3fe':0, '1faf4-1f3ff':0, '1faf5-1f3fb':0, '1faf5-1f3fc':0, '1faf5-1f3fd':0, '1faf5-1f3fe':0, '1faf5-1f3ff':0, '1faf6-1f3fb':0, '1faf6-1f3fc':0, '1faf6-1f3fd':0, '1faf6-1f3fe':0, '1faf6-1f3ff':0}, '':{'2049':62835, '2122':62863, '2139':62888, '2194':62764, '2195':62763, '2196':62762, '2197':62756, '2198':62758, '2199':62760, '2328':61194, '2600':4990, '2601':4998, '2602':41013, '2603':41018, '2604':41020, '2611':62851, '2614':41014, '2615':3781, '2618':2667, '2620':1106, '2622':62753, '2623':62754, '2626':62783, '2638':62780, '2639':177, '2648':62788, '2649':62789, '2650':62796, '2651':62797, '2652':62798, '2653':62799, '2660':51095, '2663':51098, '2665':51096, '2666':51097, '2668':4865, '2692':61297, '2693':4922, '2694':61300, '2696':61311, '2697':61319, '2699':61309, '2702':61284, '2705':62850, '2708':4931, '2709':61245, '2712':61259, '2714':62852, '2716':62828, '2721':62779, '2728':51029, '2733':62858, '2734':62859, '2744':41017, '2747':62860, '2753':62836, '2754':62837, '2755':62838, '2757':62839, '2763':1137, '2764':1141, '2795':62829, '2796':62830, '2797':62831, '2934':62767, '2935':62768, '3030':62840, '3297':62912, '3299':62913, '0023-20e3':62864, '002a-20e3':62865, '0030-20e3':62866, '0031-20e3':62867, '0032-20e3':62868, '0033-20e3':62869, '0034-20e3':62870, '0035-20e3':62871, '0036-20e3':62872, '0037-20e3':62873, '0038-20e3':62874, '0039-20e3':62875, '00a9':62861, '00ae':62862, '1f004':51101, '1f0cf':51100, '1f170':62882, '1f171':62884, '1f17e':62893, '1f17f':62895, '1f18e':62883, '1f191':62885, '1f192':62886, '1f193':62887, '1f194':62889, '1f195':62891, '1f196':62892, '1f197':62894, '1f198':62896, '1f199':62897, '1f19a':62898, '1f1e6-1f1e8':71594, '1f1e6-1f1e9':71595, '1f1e6-1f1ea':71596, '1f1e6-1f1eb':71597, '1f1e6-1f1ec':71598, '1f1e6-1f1ee':71599, '1f1e6-1f1f1':71600, '1f1e6-1f1f2':71601, '1f1e6-1f1f4':71602, '1f1e6-1f1f6':71603, '1f1e6-1f1f7':71604, '1f1e6-1f1f8':71605, '1f1e6-1f1f9':71606, '1f1e6-1f1fa':71607, '1f1e6-1f1fc':71608, '1f1e6-1f1fd':71609, '1f1e6-1f1ff':71610, '1f1e7-1f1e6':71611, '1f1e7-1f1e7':71612, '1f1e7-1f1e9':71613, '1f1e7-1f1ea':71614, '1f1e7-1f1eb':71615, '1f1e7-1f1ec':71616, '1f1e7-1f1ed':71617, '1f1e7-1f1ee':71618, '1f1e7-1f1ef':71619, '1f1e7-1f1f1':71620, '1f1e7-1f1f2':71621, '1f1e7-1f1f3':71622, '1f1e7-1f1f4':71623, '1f1e7-1f1f6':71624, '1f1e7-1f1f7':71625, '1f1e7-1f1f8':71626, '1f1e7-1f1f9':71627, '1f1e7-1f1fb':71628, '1f1e7-1f1fc':71629, '1f1e7-1f1fe':71630, '1f1e7-1f1ff':71631, '1f1e8-1f1e6':71632, '1f1e8-1f1e8':71633, '1f1e8-1f1e9':71634, '1f1e8-1f1eb':71635, '1f1e8-1f1ec':71636, '1f1e8-1f1ed':71637, '1f1e8-1f1ee':71638, '1f1e8-1f1f0':71639, '1f1e8-1f1f1':71640, '1f1e8-1f1f2':71641, '1f1e8-1f1f3':71642, '1f1e8-1f1f4':71643, '1f1e8-1f1f5':71644, '1f1e8-1f1f7':71645, '1f1e8-1f1fa':71646, '1f1e8-1f1fb':71647, '1f1e8-1f1fc':71648, '1f1e8-1f1fd':71649, '1f1e8-1f1fe':71650, '1f1e8-1f1ff':71651, '1f1e9-1f1ea':71652, '1f1e9-1f1ec':71653, '1f1e9-1f1ef':71654, '1f1e9-1f1f0':71655, '1f1e9-1f1f2':71656, '1f1e9-1f1f4':71657, '1f1e9-1f1ff':71658, '1f1ea-1f1e6':71659, '1f1ea-1f1e8':71660, '1f1ea-1f1ea':71661, '1f1ea-1f1ec':71662, '1f1ea-1f1ed':71663, '1f1ea-1f1f7':71664, '1f1ea-1f1f8':71665, '1f1ea-1f1f9':71666, '1f1ea-1f1fa':71667, '1f1eb-1f1ee':71668, '1f1eb-1f1ef':71669, '1f1eb-1f1f0':71670, '1f1eb-1f1f2':71671, '1f1eb-1f1f4':71672, '1f1eb-1f1f7':71673, '1f1ec-1f1e6':71674, '1f1ec-1f1e7':71675, '1f1ec-1f1e9':71676, '1f1ec-1f1ea':71677, '1f1ec-1f1eb':71678, '1f1ec-1f1ec':71679, '1f1ec-1f1ed':71680, '1f1ec-1f1ee':71681, '1f1ec-1f1f1':71682, '1f1ec-1f1f2':71683, '1f1ec-1f1f3':71684, '1f1ec-1f1f5':71685, '1f1ec-1f1f6':71686, '1f1ec-1f1f7':71687, '1f1ec-1f1f8':71688, '1f1ec-1f1f9':71689, '1f1ec-1f1fa':71690, '1f1ec-1f1fc':71691, '1f1ec-1f1fe':71692, '1f1ed-1f1f0':71693, '1f1ed-1f1f2':71694, '1f1ed-1f1f3':71695, '1f1ed-1f1f7':71696, '1f1ed-1f1f9':71697, '1f1ed-1f1fa':71698, '1f1ee-1f1e8':71699, '1f1ee-1f1e9':71700, '1f1ee-1f1ea':71701, '1f1ee-1f1f1':71702, '1f1ee-1f1f2':71703, '1f1ee-1f1f3':71704, '1f1ee-1f1f4':71705, '1f1ee-1f1f6':71706, '1f1ee-1f1f7':71707, '1f1ee-1f1f8':71708, '1f1ee-1f1f9':71709, '1f1ef-1f1ea':71710, '1f1ef-1f1f2':71711, '1f1ef-1f1f4':71712, '1f1ef-1f1f5':71713, '1f1f0-1f1ea':71714, '1f1f0-1f1ec':71715, '1f1f0-1f1ed':71716, '1f1f0-1f1ee':71717, '1f1f0-1f1f2':71718, '1f1f0-1f1f3':71719, '1f1f0-1f1f5':71720, '1f1f0-1f1f7':71721, '1f1f0-1f1fc':71722, '1f1f0-1f1fe':71723, '1f1f0-1f1ff':71724, '1f1f1-1f1e6':71725, '1f1f1-1f1e7':71726, '1f1f1-1f1e8':71727, '1f1f1-1f1ee':71728, '1f1f1-1f1f0':71729, '1f1f1-1f1f7':71730, '1f1f1-1f1f8':71731, '1f1f1-1f1f9':71732, '1f1f1-1f1fa':71733, '1f1f1-1f1fb':71734, '1f1f1-1f1fe':71735, '1f1f2-1f1e6':71736, '1f1f2-1f1e8':71737, '1f1f2-1f1e9':71738, '1f1f2-1f1ea':71739, '1f1f2-1f1eb':71740, '1f1f2-1f1ec':71741, '1f1f2-1f1ed':71742, '1f1f2-1f1f0':71743, '1f1f2-1f1f1':71744, '1f1f2-1f1f2':71745, '1f1f2-1f1f3':71746, '1f1f2-1f1f4':71747, '1f1f2-1f1f5':71748, '1f1f2-1f1f6':71749, '1f1f2-1f1f7':71750, '1f1f2-1f1f8':71751, '1f1f2-1f1f9':71752, '1f1f2-1f1fa':71753, '1f1f2-1f1fb':71754, '1f1f2-1f1fc':71755, '1f1f2-1f1fd':71756, '1f1f2-1f1fe':71757, '1f1f2-1f1ff':71758, '1f1f3-1f1e6':71759, '1f1f3-1f1e8':71760, '1f1f3-1f1ea':71761, '1f1f3-1f1eb':71762, '1f1f3-1f1ec':71763, '1f1f3-1f1ee':71764, '1f1f3-1f1f1':71765, '1f1f3-1f1f4':71766, '1f1f3-1f1f5':71767, '1f1f3-1f1f7':71768, '1f1f3-1f1fa':71769, '1f1f3-1f1ff':71770, '1f1f4-1f1f2':71771, '1f1f5-1f1e6':71772, '1f1f5-1f1ea':71773, '1f1f5-1f1eb':71774, '1f1f5-1f1ec':71775, '1f1f5-1f1ed':71776, '1f1f5-1f1f0':71777, '1f1f5-1f1f1':71778, '1f1f5-1f1f2':71779, '1f1f5-1f1f3':71780, '1f1f5-1f1f7':71781, '1f1f5-1f1f8':71782, '1f1f5-1f1f9':71783, '1f1f5-1f1fc':71784, '1f1f5-1f1fe':71785, '1f1f6-1f1e6':71786, '1f1f7-1f1ea':71787, '1f1f7-1f1f4':71788, '1f1f7-1f1f8':71789, '1f1f7-1f1fa':71790, '1f1f7-1f1fc':71791, '1f1f8-1f1e6':71792, '1f1f8-1f1e7':71793, '1f1f8-1f1e8':71794, '1f1f8-1f1e9':71795, '1f1f8-1f1ea':71796, '1f1f8-1f1ec':71797, '1f1f8-1f1ed':71798, '1f1f8-1f1ee':71799, '1f1f8-1f1ef':71800, '1f1f8-1f1f0':71801, '1f1f8-1f1f1':71802, '1f1f8-1f1f2':71803, '1f1f8-1f1f3':71804, '1f1f8-1f1f4':71805, '1f1f8-1f1f7':71806, '1f1f8-1f1f8':71807, '1f1f8-1f1f9':71808, '1f1f8-1f1fb':71809, '1f1f8-1f1fd':71810, '1f1f8-1f1fe':71811, '1f1f8-1f1ff':71812, '1f1f9-1f1e6':71813, '1f1f9-1f1e8':71814, '1f1f9-1f1e9':71815, '1f1f9-1f1eb':71816, '1f1f9-1f1ec':71817, '1f1f9-1f1ed':71818, '1f1f9-1f1ef':71819, '1f1f9-1f1f0':71820, '1f1f9-1f1f1':71821, '1f1f9-1f1f2':71822, '1f1f9-1f1f3':71823, '1f1f9-1f1f4':71824, '1f1f9-1f1f7':71825, '1f1f9-1f1f9':71826, '1f1f9-1f1fb':71827, '1f1f9-1f1fc':71828, '1f1f9-1f1ff':71829, '1f1fa-1f1e6':71830, '1f1fa-1f1ec':71831, '1f1fa-1f1f2':71832, '1f1fa-1f1f3':71833, '1f1fa-1f1f8':71834, '1f1fa-1f1fe':71835, '1f1fa-1f1ff':71836, '1f1fb-1f1e6':71837, '1f1fb-1f1e8':71838, '1f1fb-1f1ea':71839, '1f1fb-1f1ec':71840, '1f1fb-1f1ee':71841, '1f1fb-1f1f3':71842, '1f1fb-1f1fa':71843, '1f1fc-1f1eb':71844, '1f1fc-1f1f8':71845, '1f1fd-1f1f0':71846, '1f1fe-1f1ea':71847, '1f1fe-1f1f9':71848, '1f1ff-1f1e6':71849, '1f1ff-1f1f2':71850, '1f1ff-1f1fc':71851, '1f201':62899, '1f202':62900, '1f21a':62906, '1f22f':62903, '1f232':62907, '1f233':62911, '1f234':62910, '1f235':62915, '1f236':62902, '1f237':62901, '1f238':62909, '1f239':62905, '1f23a':62914, '1f250':62904, '1f251':62908, '1f300':41010, '1f301':4857, '1f302':41012, '1f303':4858, '1f304':4860, '1f305':4861, '1f306':4862, '1f307':4863, '1f308':41011, '1f309':4864, '1f30a':41023, '1f30b':4815, '1f30c':4997, '1f30d':4806, '1f30e':4807, '1f30f':4808, '1f310':4809, '1f311':4977, '1f312':4978, '1f313':4979, '1f314':4980, '1f315':4981, '1f316':4982, '1f317':4983, '1f318':4984, '1f319':4985, '1f31a':4986, '1f31b':4987, '1f31c':4988, '1f31d':4991, '1f31e':4992, '1f31f':4995, '1f320':4996, '1f321':4989, '1f324':41001, '1f325':41002, '1f326':41003, '1f327':41004, '1f328':41005, '1f329':41006, '1f32a':41007, '1f32b':41008, '1f32c':41009, '1f32d':3725, '1f32e':3727, '1f32f':3728, '1f330':3708, '1f331':2659, '1f332':2661, '1f333':2662, '1f334':2663, '1f335':2664, '1f336':3698, '1f337':2658, '1f338':2649, '1f339':2653, '1f33a':2655, '1f33b':2656, '1f33c':2657, '1f33d':3697, '1f33e':2665, '1f33f':2666, '1f340':2668, '1f341':2669, '1f342':2670, '1f343':2671, '1f344':3705, '1f345':3690, '1f346':3694, '1f347':3674, '1f348':3675, '1f349':3676, '1f34a':3677, '1f34b':3678, '1f34c':3679, '1f34d':3680, '1f34e':3682, '1f34f':3683, '1f350':3684, '1f351':3685, '1f352':3686, '1f353':3687, '1f354':3722, '1f355':3724, '1f356':3718, '1f357':3719, '1f358':3744, '1f359':3745, '1f35a':3746, '1f35b':3747, '1f35c':3748, '1f35d':3749, '1f35e':3709, '1f35f':3723, '1f360':3750, '1f361':3756, '1f362':3751, '1f363':3752, '1f364':3753, '1f365':3754, '1f366':3765, '1f367':3766, '1f368':3767, '1f369':3768, '1f36a':3769, '1f36b':3774, '1f36c':3775, '1f36d':3776, '1f36e':3777, '1f36f':3778, '1f370':3771, '1f371':3743, '1f372':3735, '1f373':3733, '1f374':3801, '1f375':3783, '1f376':3784, '1f377':3786, '1f378':3787, '1f379':3788, '1f37a':3789, '1f37b':3790, '1f37c':3779, '1f37d':3800, '1f37e':3785, '1f37f':3739, '1f380':51040, '1f381':51041, '1f382':3770, '1f383':51024, '1f384':51025, '1f385':1527, '1f386':51026, '1f387':51027, '1f388':51030, '1f389':51031, '1f38a':51032, '1f38b':51033, '1f38c':71588, '1f38d':51034, '1f38e':51035, '1f38f':51036, '1f390':51037, '1f391':51038, '1f392':61134, '1f393':61147, '1f396':51045, '1f397':51042, '1f399':61167, '1f39a':61168, '1f39b':61169, '1f39e':61203, '1f39f':51043, '1f3a0':4866, '1f3a1':4868, '1f3a2':4869, '1f3a3':51072, '1f3a4':61170, '1f3a5':61202, '1f3a6':62819, '1f3a7':61171, '1f3a8':51105, '1f3a9':61146, '1f3aa':4871, '1f3ab':51044, '1f3ac':61205, '1f3ad':51103, '1f3ae':51086, '1f3af':51078, '1f3b0':51088, '1f3b1':51081, '1f3b2':51089, '1f3b3':51060, '1f3b4':51102, '1f3b5':61165, '1f3b6':61166, '1f3b7':61173, '1f3b8':61175, '1f3b9':61176, '1f3ba':61177, '1f3bb':61178, '1f3bc':61164, '1f3bd':51074, '1f3be':51058, '1f3bf':51075, '1f3c0':51054, '1f3c1':71586, '1f3c2':1600, '1f3c3-200d-2640':1584, '1f3c3-200d-2642':1583, '1f3c3':1582, '1f3c4-200d-2640':1606, '1f3c4-200d-2642':1605, '1f3c4':1604, '1f3c5':51047, '1f3c6':51046, '1f3c7':1598, '1f3c8':51056, '1f3c9':51057, '1f3ca-200d-2640':1612, '1f3ca-200d-2642':1611, '1f3ca':1610, '1f3cb-200d-2640':1618, '1f3cb-200d-2642':1617, '1f3cb':1616, '1f3cc-200d-2640':1603, '1f3cc-200d-2642':1602, '1f3cc':1601, '1f3cd':4902, '1f3ce':4901, '1f3cf':51061, '1f3d0':51055, '1f3d1':51062, '1f3d2':51063, '1f3d3':51065, '1f3d4':4813, '1f3d5':4817, '1f3d6':4818, '1f3d7':4824, '1f3d8':4829, '1f3d9':4859, '1f3da':4830, '1f3db':4823, '1f3dc':4819, '1f3dd':4820, '1f3de':4821, '1f3df':4822, '1f3e0':4831, '1f3e1':4832, '1f3e2':4833, '1f3e3':4834, '1f3e4':4835, '1f3e5':4836, '1f3e6':4837, '1f3e7':62729, '1f3e8':4838, '1f3e9':4839, '1f3ea':4840, '1f3eb':4841, '1f3ec':4842, '1f3ed':4843, '1f3ee':61216, '1f3ef':4844, '1f3f0':4845, '1f3f3-200d-1f308':71591, '1f3f3-200d-26a7':71592, '1f3f3':71590, '1f3f4-200d-2620':71593, '1f3f4-e0067-e0062-e0065-e006e-e0067-e007f':71852, '1f3f4-e0067-e0062-e0073-e0063-e0074-e007f':71853, '1f3f4-e0067-e0062-e0077-e006c-e0073-e007f':71854, '1f3f4':71589, '1f3f5':2652, '1f3f7':61234, '1f3f8':51066, '1f3f9':61303, '1f3fa':3805, '1f3fb':9525, '1f3fc':9526, '1f3fd':9527, '1f3fe':9528, '1f3ff':9529, '1f400':2576, '1f401':2575, '1f402':2556, '1f403':2557, '1f404':2558, '1f405':2547, '1f406':2548, '1f407':2579, '1f408-200d-2b1b':2544, '1f408':2543, '1f409':2618, '1f40a':2613, '1f40b':2622, '1f40c':2632, '1f40d':2616, '1f40e':2550, '1f40f':2563, '1f410':2565, '1f411':2564, '1f412':2531, '1f413':2596, '1f414':2595, '1f415-200d-1f9ba':2537, '1f415':2535, '1f416':2560, '1f417':2561, '1f418':2570, '1f419':2629, '1f41a':2630, '1f41b':2634, '1f41c':2635, '1f41d':2636, '1f41e':2638, '1f41f':2625, '1f420':2626, '1f421':2627, '1f422':2614, '1f423':2597, '1f424':2598, '1f425':2599, '1f426':2600, '1f427':2601, '1f428':2586, '1f429':2538, '1f42a':2566, '1f42b':2567, '1f42c':2623, '1f42d':2574, '1f42e':2555, '1f42f':2546, '1f430':2578, '1f431':2542, '1f432':2617, '1f433':2621, '1f434':2549, '1f435':2530, '1f436':2534, '1f437':2559, '1f438':2612, '1f439':2577, '1f43a':2539, '1f43b-200d-2744':2585, '1f43b':2584, '1f43c':2587, '1f43d':2562, '1f43e':2593, '1f43f':2580, '1f440':1381, '1f441-200d-1f5e8':1159, '1f441':1382, '1f442':1373, '1f443':1375, '1f444':1384, '1f445':1383, '1f446':1347, '1f447':1349, '1f448':1345, '1f449':1346, '1f44a':1355, '1f44b':1327, '1f44c':1336, '1f44d':1352, '1f44e':1353, '1f44f':1358, '1f450':1361, '1f451':61144, '1f452':61145, '1f453':61110, '1f454':61115, '1f455':61116, '1f456':61117, '1f457':61122, '1f458':61123, '1f459':61128, '1f45a':61129, '1f45b':61130, '1f45c':61131, '1f45d':61132, '1f45e':61136, '1f45f':61137, '1f460':61140, '1f461':61141, '1f462':61143, '1f463':1687, '1f464':1684, '1f465':1685, '1f466':1388, '1f467':1389, '1f468-200d-1f33e':1457, '1f468-200d-1f373':1460, '1f468-200d-1f37c':1524, '1f468-200d-1f393':1448, '1f468-200d-1f3a4':1478, '1f468-200d-1f3a8':1481, '1f468-200d-1f3eb':1451, '1f468-200d-1f3ed':1466, '1f468-200d-1f466-200d-1f466':1674, '1f468-200d-1f466':1673, '1f468-200d-1f467-200d-1f466':1676, '1f468-200d-1f467-200d-1f467':1677, '1f468-200d-1f467':1675, '1f468-200d-1f468-200d-1f466':1663, '1f468-200d-1f468-200d-1f466-200d-1f466':1666, '1f468-200d-1f468-200d-1f467':1664, '1f468-200d-1f468-200d-1f467-200d-1f466':1665, '1f468-200d-1f468-200d-1f467-200d-1f467':1667, '1f468-200d-1f469-200d-1f466':1658, '1f468-200d-1f469-200d-1f466-200d-1f466':1661, '1f468-200d-1f469-200d-1f467':1659, '1f468-200d-1f469-200d-1f467-200d-1f466':1660, '1f468-200d-1f469-200d-1f467-200d-1f467':1662, '1f468-200d-1f4bb':1475, '1f468-200d-1f4bc':1469, '1f468-200d-1f527':1463, '1f468-200d-1f52c':1472, '1f468-200d-1f680':1487, '1f468-200d-1f692':1490, '1f468-200d-1f9af':1574, '1f468-200d-1f9b0':1396, '1f468-200d-1f9b1':1397, '1f468-200d-1f9b2':1399, '1f468-200d-1f9b3':1398, '1f468-200d-1f9bc':1577, '1f468-200d-1f9bd':1580, '1f468-200d-2695':1445, '1f468-200d-2696':1454, '1f468-200d-2708':1484, '1f468-200d-2764-200d-1f468':1655, '1f468-200d-2764-200d-1f48b-200d-1f468':1651, '1f468':1392, '1f469-200d-1f33e':1458, '1f469-200d-1f373':1461, '1f469-200d-1f37c':1523, '1f469-200d-1f393':1449, '1f469-200d-1f3a4':1479, '1f469-200d-1f3a8':1482, '1f469-200d-1f3eb':1452, '1f469-200d-1f3ed':1467, '1f469-200d-1f466-200d-1f466':1679, '1f469-200d-1f466':1678, '1f469-200d-1f467-200d-1f466':1681, '1f469-200d-1f467-200d-1f467':1682, '1f469-200d-1f467':1680, '1f469-200d-1f469-200d-1f466':1668, '1f469-200d-1f469-200d-1f466-200d-1f466':1671, '1f469-200d-1f469-200d-1f467':1669, '1f469-200d-1f469-200d-1f467-200d-1f466':1670, '1f469-200d-1f469-200d-1f467-200d-1f467':1672, '1f469-200d-1f4bb':1476, '1f469-200d-1f4bc':1470, '1f469-200d-1f527':1464, '1f469-200d-1f52c':1473, '1f469-200d-1f680':1488, '1f469-200d-1f692':1491, '1f469-200d-1f9af':1575, '1f469-200d-1f9b0':1401, '1f469-200d-1f9b1':1403, '1f469-200d-1f9b2':1407, '1f469-200d-1f9b3':1405, '1f469-200d-1f9bc':1578, '1f469-200d-1f9bd':1581, '1f469-200d-2695':1446, '1f469-200d-2696':1455, '1f469-200d-2708':1485, '1f469-200d-2764-200d-1f468':1654, '1f469-200d-2764-200d-1f469':1656, '1f469-200d-2764-200d-1f48b-200d-1f468':1650, '1f469-200d-2764-200d-1f48b-200d-1f469':1652, '1f469':1400, '1f46a':1657, '1f46b':1647, '1f46c':1648, '1f46d':1646, '1f46e-200d-2640':1494, '1f46e-200d-2642':1493, '1f46e':1492, '1f46f-200d-2640':1590, '1f46f-200d-2642':1589, '1f46f':1588, '1f470-200d-2640':1518, '1f470-200d-2642':1517, '1f470':1516, '1f471-200d-2640':1409, '1f471-200d-2642':1410, '1f471':1391, '1f472':1511, '1f473-200d-2640':1510, '1f473-200d-2642':1509, '1f473':1508, '1f474':1412, '1f475':1413, '1f476':1386, '1f477-200d-2640':1504, '1f477-200d-2642':1503, '1f477':1502, '1f478':1507, '1f479':1109, '1f47a':1110, '1f47b':1111, '1f47c':1526, '1f47d':1112, '1f47e':1113, '1f47f':1104, '1f480':1105, '1f481-200d-2640':1428, '1f481-200d-2642':1427, '1f481':1426, '1f482-200d-2640':1500, '1f482-200d-2642':1499, '1f482':1498, '1f483':1585, '1f484':61152, '1f485':1366, '1f486-200d-2640':1560, '1f486-200d-2642':1559, '1f486':1558, '1f487-200d-2640':1563, '1f487-200d-2642':1562, '1f487':1561, '1f488':4870, '1f489':61326, '1f48a':61328, '1f48b':1127, '1f48c':1128, '1f48d':61153, '1f48e':61154, '1f48f':1649, '1f490':2648, '1f491':1653, '1f492':4846, '1f493':1133, '1f494':1138, '1f495':1135, '1f496':1131, '1f497':1132, '1f498':1129, '1f499':1145, '1f49a':1144, '1f49b':1143, '1f49c':1146, '1f49d':1130, '1f49e':1134, '1f49f':1136, '1f4a0':62946, '1f4a1':61214, '1f4a2':1151, '1f4a3':1157, '1f4a4':1163, '1f4a5':1152, '1f4a6':1154, '1f4a7':41022, '1f4a8':1155, '1f4a9':1107, '1f4aa':1368, '1f4ab':1153, '1f4ac':1158, '1f4ad':1162, '1f4ae':2650, '1f4af':1150, '1f4b0':61235, '1f4b1':62841, '1f4b2':62842, '1f4b3':61242, '1f4b4':61237, '1f4b5':61238, '1f4b6':61239, '1f4b7':61240, '1f4b8':61241, '1f4b9':61244, '1f4ba':4936, '1f4bb':61191, '1f4bc':61265, '1f4bd':61197, '1f4be':61198, '1f4bf':61199, '1f4c0':61200, '1f4c1':61266, '1f4c2':61267, '1f4c3':61227, '1f4c4':61229, '1f4c5':61269, '1f4c6':61270, '1f4c7':61273, '1f4c8':61274, '1f4c9':61275, '1f4ca':61276, '1f4cb':61277, '1f4cc':61278, '1f4cd':61279, '1f4ce':61280, '1f4cf':61282, '1f4d0':61283, '1f4d1':61232, '1f4d2':61226, '1f4d3':61225, '1f4d4':61218, '1f4d5':61219, '1f4d6':61220, '1f4d7':61221, '1f4d8':61222, '1f4d9':61223, '1f4da':61224, '1f4db':62847, '1f4dc':61228, '1f4dd':61264, '1f4de':61185, '1f4df':61186, '1f4e0':61187, '1f4e1':61325, '1f4e2':61159, '1f4e3':61160, '1f4e4':61249, '1f4e5':61250, '1f4e6':61251, '1f4e7':61246, '1f4e8':61247, '1f4e9':61248, '1f4ea':61253, '1f4eb':61252, '1f4ec':61254, '1f4ed':61255, '1f4ee':61256, '1f4ef':61161, '1f4f0':61230, '1f4f1':61182, '1f4f2':61183, '1f4f3':62823, '1f4f4':62824, '1f4f5':62751, '1f4f6':62822, '1f4f7':61207, '1f4f8':61208, '1f4f9':61209, '1f4fa':61206, '1f4fb':61172, '1f4fc':61210, '1f4fd':61204, '1f4ff':61151, '1f500':62801, '1f501':62802, '1f502':62803, '1f503':62769, '1f504':62770, '1f505':62820, '1f506':62821, '1f507':61155, '1f508':61156, '1f509':61157, '1f50a':61158, '1f50b':61188, '1f50c':61190, '1f50d':61211, '1f50e':61212, '1f50f':61290, '1f510':61291, '1f511':61292, '1f512':61288, '1f513':61289, '1f514':61162, '1f515':61163, '1f516':61233, '1f517':61313, '1f518':62947, '1f519':62771, '1f51a':62772, '1f51b':62773, '1f51c':62774, '1f51d':62775, '1f51e':62752, '1f51f':62876, '1f520':62877, '1f521':62878, '1f522':62879, '1f523':62880, '1f524':62881, '1f525':41021, '1f526':61215, '1f527':61306, '1f528':61294, '1f529':61308, '1f52a':3803, '1f52b':61301, '1f52c':61323, '1f52d':61324, '1f52e':51082, '1f52f':62787, '1f530':62848, '1f531':62846, '1f532':62949, '1f533':62948, '1f534':62916, '1f535':62920, '1f536':62940, '1f537':62941, '1f538':62942, '1f539':62943, '1f53a':62944, '1f53b':62945, '1f53c':62811, '1f53d':62813, '1f549':62778, '1f54a':2602, '1f54b':4854, '1f54c':4850, '1f54d':4852, '1f54e':62786, '1f550':4955, '1f551':4957, '1f552':4959, '1f553':4961, '1f554':4963, '1f555':4965, '1f556':4967, '1f557':4969, '1f558':4971, '1f559':4973, '1f55a':4975, '1f55b':4953, '1f55c':4956, '1f55d':4958, '1f55e':4960, '1f55f':4962, '1f560':4964, '1f561':4966, '1f562':4968, '1f563':4970, '1f564':4972, '1f565':4974, '1f566':4976, '1f567':4954, '1f56f':61213, '1f570':4952, '1f573':1156, '1f574':1587, '1f575-200d-2640':1497, '1f575-200d-2642':1496, '1f575':1495, '1f576':61111, '1f577':2641, '1f578':2642, '1f579':51087, '1f57a':1586, '1f587':61281, '1f58a':61261, '1f58b':61260, '1f58c':61262, '1f58d':61263, '1f590':1329, '1f595':1348, '1f596':1331, '1f5a4':1148, '1f5a5':61192, '1f5a8':61193, '1f5b1':61195, '1f5b2':61196, '1f5bc':51104, '1f5c2':61268, '1f5c3':61285, '1f5c4':61286, '1f5d1':61287, '1f5d2':61271, '1f5d3':61272, '1f5dc':61310, '1f5dd':61293, '1f5de':61231, '1f5e1':61299, '1f5e3':1683, '1f5e8':1160, '1f5ef':1161, '1f5f3':61257, '1f5fa':4810, '1f5fb':4816, '1f5fc':4847, '1f5fd':4848, '1f5fe':4811, '1f5ff':61362, '1f600':11, '1f601':14, '1f602':18, '1f603':12, '1f604':13, '1f605':16, '1f606':15, '1f607':114, '1f608':1103, '1f609':112, '1f60a':113, '1f60b':124, '1f60c':150, '1f60d':116, '1f60e':170, '1f60f':144, '1f610':139, '1f611':140, '1f612':145, '1f613':195, '1f614':151, '1f615':173, '1f616':192, '1f617':119, '1f618':118, '1f619':122, '1f61a':121, '1f61b':125, '1f61c':126, '1f61d':128, '1f61e':194, '1f61f':175, '1f620':1101, '1f621':1100, '1f622':189, '1f623':193, '1f624':199, '1f625':188, '1f626':184, '1f627':185, '1f628':186, '1f629':196, '1f62a':152, '1f62b':197, '1f62c':147, '1f62d':190, '1f62e-200d-1f4a8':148, '1f62e':178, '1f62f':179, '1f630':187, '1f631':191, '1f632':180, '1f633':181, '1f634':154, '1f635-200d-1f4ab':165, '1f635':164, '1f636-200d-1f32b':143, '1f636':141, '1f637':155, '1f638':1116, '1f639':1117, '1f63a':1115, '1f63b':1118, '1f63c':1119, '1f63d':1120, '1f63e':1123, '1f63f':1122, '1f640':1121, '1f641':176, '1f642':19, '1f643':110, '1f644':146, '1f645-200d-2640':1422, '1f645-200d-2642':1421, '1f645':1420, '1f646-200d-2640':1425, '1f646-200d-2642':1424, '1f646':1423, '1f647-200d-2640':1437, '1f647-200d-2642':1436, '1f647':1435, '1f648':1124, '1f649':1125, '1f64a':1126, '1f64b-200d-2640':1431, '1f64b-200d-2642':1430, '1f64b':1429, '1f64c':1359, '1f64d-200d-2640':1416, '1f64d-200d-2642':1415, '1f64d':1414, '1f64e-200d-2640':1419, '1f64e-200d-2642':1418, '1f64e':1417, '1f64f':1364, '1f680':4942, '1f681':4937, '1f682':4872, '1f683':4873, '1f684':4874, '1f685':4875, '1f686':4876, '1f687':4877, '1f688':4878, '1f689':4879, '1f68a':4880, '1f68b':4883, '1f68c':4884, '1f68d':4885, '1f68e':4886, '1f68f':4911, '1f690':4887, '1f691':4888, '1f692':4889, '1f693':4890, '1f694':4891, '1f695':4892, '1f696':4893, '1f697':4894, '1f698':4895, '1f699':4896, '1f69a':4898, '1f69b':4899, '1f69c':4900, '1f69d':4881, '1f69e':4882, '1f69f':4938, '1f6a0':4939, '1f6a1':4940, '1f6a2':4930, '1f6a3-200d-2640':1609, '1f6a3-200d-2642':1608, '1f6a3':1607, '1f6a4':4926, '1f6a5':4918, '1f6a6':4919, '1f6a7':4921, '1f6a8':4917, '1f6a9':71587, '1f6aa':61333, '1f6ab':62745, '1f6ac':61358, '1f6ad':62747, '1f6ae':62730, '1f6af':62748, '1f6b0':62731, '1f6b1':62749, '1f6b2':4907, '1f6b3':62746, '1f6b4-200d-2640':1621, '1f6b4-200d-2642':1620, '1f6b4':1619, '1f6b5-200d-2640':1624, '1f6b5-200d-2642':1623, '1f6b5':1622, '1f6b6-200d-2640':1566, '1f6b6-200d-2642':1565, '1f6b6':1564, '1f6b7':62750, '1f6b8':62743, '1f6b9':62733, '1f6ba':62734, '1f6bb':62735, '1f6bc':62736, '1f6bd':61340, '1f6be':62737, '1f6bf':61342, '1f6c0':1643, '1f6c1':61343, '1f6c2':62738, '1f6c3':62739, '1f6c4':62740, '1f6c5':62741, '1f6cb':61338, '1f6cc':1644, '1f6cd':61133, '1f6ce':4944, '1f6cf':61337, '1f6d0':62776, '1f6d1':4920, '1f6d2':61357, '1f6d5':4851, '1f6d6':4828, '1f6d7':61334, '1f6e0':61298, '1f6e1':61304, '1f6e2':4914, '1f6e3':4912, '1f6e4':4913, '1f6e5':4929, '1f6e9':4932, '1f6eb':4933, '1f6ec':4934, '1f6f0':4941, '1f6f3':4927, '1f6f4':4908, '1f6f5':4903, '1f6f6':4925, '1f6f7':51076, '1f6f8':4943, '1f6f9':4909, '1f6fa':4906, '1f6fb':4897, '1f6fc':4910, '1f7e0':62917, '1f7e1':62918, '1f7e2':62919, '1f7e3':62921, '1f7e4':62922, '1f7e5':62925, '1f7e6':62929, '1f7e7':62926, '1f7e8':62927, '1f7e9':62928, '1f7ea':62930, '1f7eb':62931, '1f90c':1337, '1f90d':1149, '1f90e':1147, '1f90f':1338, '1f910':137, '1f911':129, '1f912':156, '1f913':171, '1f914':135, '1f915':157, '1f916':1114, '1f917':130, '1f918':1343, '1f919':1344, '1f91a':1328, '1f91b':1356, '1f91c':1357, '1f91d':1363, '1f91e':1340, '1f91f':1342, '1f920':167, '1f921':1108, '1f922':158, '1f923':17, '1f924':153, '1f925':149, '1f926-200d-2640':1440, '1f926-200d-2642':1439, '1f926':1438, '1f927':160, '1f928':138, '1f929':117, '1f92a':127, '1f92b':134, '1f92c':1102, '1f92d':131, '1f92e':159, '1f92f':166, '1f930':1519, '1f931':1522, '1f932':1362, '1f933':1367, '1f934':1506, '1f935-200d-2640':1515, '1f935-200d-2642':1514, '1f935':1513, '1f936':1528, '1f937-200d-2640':1443, '1f937-200d-2642':1442, '1f937':1441, '1f938-200d-2640':1627, '1f938-200d-2642':1626, '1f938':1625, '1f939-200d-2640':1639, '1f939-200d-2642':1638, '1f939':1637, '1f93a':1597, '1f93c-200d-2640':1630, '1f93c-200d-2642':1629, '1f93c':1628, '1f93d-200d-2640':1633, '1f93d-200d-2642':1632, '1f93d':1631, '1f93e-200d-2640':1636, '1f93e-200d-2642':1635, '1f93e':1634, '1f93f':51073, '1f940':2654, '1f941':61180, '1f942':3791, '1f943':3792, '1f944':3802, '1f945':51069, '1f947':51048, '1f948':51049, '1f949':51050, '1f94a':51067, '1f94b':51068, '1f94c':51077, '1f94d':51064, '1f94e':51053, '1f94f':51059, '1f950':3710, '1f951':3693, '1f952':3700, '1f953':3721, '1f954':3695, '1f955':3696, '1f956':3711, '1f957':3738, '1f958':3734, '1f959':3730, '1f95a':3732, '1f95b':3780, '1f95c':3706, '1f95d':3689, '1f95e':3715, '1f95f':3757, '1f960':3758, '1f961':3759, '1f962':3799, '1f963':3737, '1f964':3794, '1f965':3692, '1f966':3702, '1f967':3773, '1f968':3713, '1f969':3720, '1f96a':3726, '1f96b':3742, '1f96c':3701, '1f96d':3681, '1f96e':3755, '1f96f':3714, '1f970':115, '1f971':198, '1f972':123, '1f973':168, '1f974':163, '1f975':161, '1f976':162, '1f977':1501, '1f978':169, '1f97a':182, '1f97b':61124, '1f97c':61113, '1f97d':61112, '1f97e':61138, '1f97f':61139, '1f980':3760, '1f981':2545, '1f982':2643, '1f983':2594, '1f984':2551, '1f985':2603, '1f986':2604, '1f987':2583, '1f988':2628, '1f989':2606, '1f98a':2540, '1f98b':2633, '1f98c':2553, '1f98d':2532, '1f98e':2615, '1f98f':2572, '1f990':3762, '1f991':3763, '1f992':2569, '1f993':2552, '1f994':2582, '1f995':2619, '1f996':2620, '1f997':2639, '1f998':2591, '1f999':2568, '1f99a':2610, '1f99b':2573, '1f99c':2611, '1f99d':2541, '1f99e':3761, '1f99f':2644, '1f9a0':2647, '1f9a1':2592, '1f9a2':2605, '1f9a3':2571, '1f9a4':2607, '1f9a5':2588, '1f9a6':2589, '1f9a7':2533, '1f9a8':2590, '1f9a9':2609, '1f9aa':3764, '1f9ab':2581, '1f9ac':2554, '1f9ad':2624, '1f9ae':2536, '1f9af':61312, '1f9b4':1380, '1f9b5':1371, '1f9b6':1372, '1f9b7':1379, '1f9b8-200d-2640':1532, '1f9b8-200d-2642':1531, '1f9b8':1530, '1f9b9-200d-2640':1535, '1f9b9-200d-2642':1534, '1f9b9':1533, '1f9ba':61114, '1f9bb':1374, '1f9bc':4905, '1f9bd':4904, '1f9be':1369, '1f9bf':1370, '1f9c0':3717, '1f9c1':3772, '1f9c2':3741, '1f9c3':3796, '1f9c4':3703, '1f9c5':3704, '1f9c6':3731, '1f9c7':3716, '1f9c8':3740, '1f9c9':3797, '1f9ca':3798, '1f9cb':3795, '1f9cd-200d-2640':1569, '1f9cd-200d-2642':1568, '1f9cd':1567, '1f9ce-200d-2640':1572, '1f9ce-200d-2642':1571, '1f9ce':1570, '1f9cf-200d-2640':1434, '1f9cf-200d-2642':1433, '1f9cf':1432, '1f9d0':172, '1f9d1-200d-1f33e':1456, '1f9d1-200d-1f373':1459, '1f9d1-200d-1f37c':1525, '1f9d1-200d-1f384':1529, '1f9d1-200d-1f393':1447, '1f9d1-200d-1f3a4':1477, '1f9d1-200d-1f3a8':1480, '1f9d1-200d-1f3eb':1450, '1f9d1-200d-1f3ed':1465, '1f9d1-200d-1f4bb':1474, '1f9d1-200d-1f4bc':1468, '1f9d1-200d-1f527':1462, '1f9d1-200d-1f52c':1471, '1f9d1-200d-1f680':1486, '1f9d1-200d-1f692':1489, '1f9d1-200d-1f91d-200d-1f9d1':1645, '1f9d1-200d-1f9af':1573, '1f9d1-200d-1f9b0':1402, '1f9d1-200d-1f9b1':1404, '1f9d1-200d-1f9b2':1408, '1f9d1-200d-1f9b3':1406, '1f9d1-200d-1f9bc':1576, '1f9d1-200d-1f9bd':1579, '1f9d1-200d-2695':1444, '1f9d1-200d-2696':1453, '1f9d1-200d-2708':1483, '1f9d1':1390, '1f9d2':1387, '1f9d3':1411, '1f9d4-200d-2640':1395, '1f9d4-200d-2642':1394, '1f9d4':1393, '1f9d5':1512, '1f9d6-200d-2640':1593, '1f9d6-200d-2642':1592, '1f9d6':1591, '1f9d7-200d-2640':1596, '1f9d7-200d-2642':1595, '1f9d7':1594, '1f9d8-200d-2640':1642, '1f9d8-200d-2642':1641, '1f9d8':1640, '1f9d9-200d-2640':1538, '1f9d9-200d-2642':1537, '1f9d9':1536, '1f9da-200d-2640':1541, '1f9da-200d-2642':1540, '1f9da':1539, '1f9db-200d-2640':1544, '1f9db-200d-2642':1543, '1f9db':1542, '1f9dc-200d-2640':1547, '1f9dc-200d-2642':1546, '1f9dc':1545, '1f9dd-200d-2640':1550, '1f9dd-200d-2642':1549, '1f9dd':1548, '1f9de-200d-2640':1553, '1f9de-200d-2642':1552, '1f9de':1551, '1f9df-200d-2640':1556, '1f9df-200d-2642':1555, '1f9df':1554, '1f9e0':1376, '1f9e1':1142, '1f9e2':61148, '1f9e3':61118, '1f9e4':61119, '1f9e5':61120, '1f9e6':61121, '1f9e7':51039, '1f9e8':51028, '1f9e9':51090, '1f9ea':61320, '1f9eb':61321, '1f9ec':61322, '1f9ed':4812, '1f9ee':61201, '1f9ef':61356, '1f9f0':61316, '1f9f1':4825, '1f9f2':61317, '1f9f3':4945, '1f9f4':61346, '1f9f5':51106, '1f9f6':51108, '1f9f7':61347, '1f9f8':51091, '1f9f9':61348, '1f9fa':61349, '1f9fb':61350, '1f9fc':61352, '1f9fd':61355, '1f9fe':61243, '1f9ff':51084, '1fa70':61142, '1fa71':61125, '1fa72':61126, '1fa73':61127, '1fa74':61135, '1fa78':61327, '1fa79':61329, '1fa7a':61331, '1fa80':51079, '1fa81':51080, '1fa82':4935, '1fa83':61302, '1fa84':51083, '1fa85':51092, '1fa86':51094, '1fa90':4993, '1fa91':61339, '1fa92':61345, '1fa93':61295, '1fa94':61217, '1fa95':61179, '1fa96':61149, '1fa97':61174, '1fa98':61181, '1fa99':61236, '1fa9a':61305, '1fa9b':61307, '1fa9c':61318, '1fa9d':61315, '1fa9e':61335, '1fa9f':61336, '1faa0':61341, '1faa1':51107, '1faa2':51109, '1faa3':61351, '1faa4':61344, '1faa5':61354, '1faa6':61360, '1faa7':61363, '1faa8':4826, '1fab0':2645, '1fab1':2646, '1fab2':2637, '1fab3':2640, '1fab4':2660, '1fab5':4827, '1fab6':2608, '1fac0':1377, '1fac1':1378, '1fac2':1686, '1fad0':3688, '1fad1':3699, '1fad2':3691, '1fad3':3712, '1fad4':3729, '1fad5':3736, '1fad6':3782, '203c':62834, '21a9':62765, '21aa':62766, '231a':4948, '231b':4946, '23cf':62818, '23e9':62805, '23ea':62809, '23eb':62812, '23ec':62814, '23ed':62806, '23ee':62810, '23ef':62807, '23f0':4949, '23f1':4950, '23f2':4951, '23f3':4947, '23f8':62815, '23f9':62816, '23fa':62817, '24c2':62890, '25aa':62938, '25ab':62939, '25b6':62804, '25c0':62808, '25fb':62935, '25fc':62934, '25fd':62937, '25fe':62936, '260e':61184, '261d':1350, '262a':62784, '262e':62785, '262f':62781, '263a':120, '264a':62790, '264b':62791, '264c':62792, '264d':62793, '264e':62794, '264f':62795, '265f':51099, '267b':62844, '267e':62833, '267f':62732, '269b':62777, '269c':62845, '26a0':62742, '26a1':41016, '26a7':62827, '26aa':62924, '26ab':62923, '26b0':61359, '26b1':61361, '26bd':51051, '26be':51052, '26c4':41019, '26c5':4999, '26c8':41000, '26ce':62800, '26cf':61296, '26d1':61150, '26d3':61314, '26d4':62744, '26e9':4853, '26ea':4849, '26f0':4814, '26f1':41015, '26f2':4855, '26f3':51070, '26f4':4928, '26f5':4924, '26f7':1599, '26f8':51071, '26f9-200d-2640':1615, '26f9-200d-2642':1614, '26f9':1613, '26fa':4856, '26fd':4915, '270a':1354, '270b':1330, '270c':1339, '270d':1365, '270f':61258, '271d':62782, '274c':62853, '274e':62854, '2764-200d-1f525':1139, '2764-200d-1fa79':1140, '27a1':62757, '27b0':62855, '27bf':62856, '2b05':62761, '2b06':62755, '2b07':62759, '2b1b':62932, '2b1c':62933, '2b50':4994, '2b55':62849, '303d':62857, '1f385-1f3fb':0, '1f385-1f3fc':0, '1f385-1f3fd':0, '1f385-1f3fe':0, '1f385-1f3ff':0, '1f3c2-1f3fb':0, '1f3c2-1f3fc':0, '1f3c2-1f3fd':0, '1f3c2-1f3fe':0, '1f3c2-1f3ff':0, '1f3c3-1f3fb-200d-2640':0, '1f3c3-1f3fc-200d-2640':0, '1f3c3-1f3fd-200d-2640':0, '1f3c3-1f3fe-200d-2640':0, '1f3c3-1f3ff-200d-2640':0, '1f3c3-1f3fb-200d-2642':0, '1f3c3-1f3fc-200d-2642':0, '1f3c3-1f3fd-200d-2642':0, '1f3c3-1f3fe-200d-2642':0, '1f3c3-1f3ff-200d-2642':0, '1f3c3-1f3fb':0, '1f3c3-1f3fc':0, '1f3c3-1f3fd':0, '1f3c3-1f3fe':0, '1f3c3-1f3ff':0, '1f3c4-1f3fb-200d-2640':0, '1f3c4-1f3fc-200d-2640':0, '1f3c4-1f3fd-200d-2640':0, '1f3c4-1f3fe-200d-2640':0, '1f3c4-1f3ff-200d-2640':0, '1f3c4-1f3fb-200d-2642':0, '1f3c4-1f3fc-200d-2642':0, '1f3c4-1f3fd-200d-2642':0, '1f3c4-1f3fe-200d-2642':0, '1f3c4-1f3ff-200d-2642':0, '1f3c4-1f3fb':0, '1f3c4-1f3fc':0, '1f3c4-1f3fd':0, '1f3c4-1f3fe':0, '1f3c4-1f3ff':0, '1f3c7-1f3fb':0, '1f3c7-1f3fc':0, '1f3c7-1f3fd':0, '1f3c7-1f3fe':0, '1f3c7-1f3ff':0, '1f3ca-1f3fb-200d-2640':0, '1f3ca-1f3fc-200d-2640':0, '1f3ca-1f3fd-200d-2640':0, '1f3ca-1f3fe-200d-2640':0, '1f3ca-1f3ff-200d-2640':0, '1f3ca-1f3fb-200d-2642':0, '1f3ca-1f3fc-200d-2642':0, '1f3ca-1f3fd-200d-2642':0, '1f3ca-1f3fe-200d-2642':0, '1f3ca-1f3ff-200d-2642':0, '1f3ca-1f3fb':0, '1f3ca-1f3fc':0, '1f3ca-1f3fd':0, '1f3ca-1f3fe':0, '1f3ca-1f3ff':0, '1f3cb-1f3fb-200d-2640':0, '1f3cb-1f3fc-200d-2640':0, '1f3cb-1f3fd-200d-2640':0, '1f3cb-1f3fe-200d-2640':0, '1f3cb-1f3ff-200d-2640':0, '1f3cb-1f3fb-200d-2642':0, '1f3cb-1f3fc-200d-2642':0, '1f3cb-1f3fd-200d-2642':0, '1f3cb-1f3fe-200d-2642':0, '1f3cb-1f3ff-200d-2642':0, '1f3cb-1f3fb':0, '1f3cb-1f3fc':0, '1f3cb-1f3fd':0, '1f3cb-1f3fe':0, '1f3cb-1f3ff':0, '1f3cc-1f3fb-200d-2640':0, '1f3cc-1f3fc-200d-2640':0, '1f3cc-1f3fd-200d-2640':0, '1f3cc-1f3fe-200d-2640':0, '1f3cc-1f3ff-200d-2640':0, '1f3cc-1f3fb-200d-2642':0, '1f3cc-1f3fc-200d-2642':0, '1f3cc-1f3fd-200d-2642':0, '1f3cc-1f3fe-200d-2642':0, '1f3cc-1f3ff-200d-2642':0, '1f3cc-1f3fb':0, '1f3cc-1f3fc':0, '1f3cc-1f3fd':0, '1f3cc-1f3fe':0, '1f3cc-1f3ff':0, '1f442-1f3fb':0, '1f442-1f3fc':0, '1f442-1f3fd':0, '1f442-1f3fe':0, '1f442-1f3ff':0, '1f443-1f3fb':0, '1f443-1f3fc':0, '1f443-1f3fd':0, '1f443-1f3fe':0, '1f443-1f3ff':0, '1f446-1f3fb':0, '1f446-1f3fc':0, '1f446-1f3fd':0, '1f446-1f3fe':0, '1f446-1f3ff':0, '1f447-1f3fb':0, '1f447-1f3fc':0, '1f447-1f3fd':0, '1f447-1f3fe':0, '1f447-1f3ff':0, '1f448-1f3fb':0, '1f448-1f3fc':0, '1f448-1f3fd':0, '1f448-1f3fe':0, '1f448-1f3ff':0, '1f449-1f3fb':0, '1f449-1f3fc':0, '1f449-1f3fd':0, '1f449-1f3fe':0, '1f449-1f3ff':0, '1f44a-1f3fb':0, '1f44a-1f3fc':0, '1f44a-1f3fd':0, '1f44a-1f3fe':0, '1f44a-1f3ff':0, '1f44b-1f3fb':0, '1f44b-1f3fc':0, '1f44b-1f3fd':0, '1f44b-1f3fe':0, '1f44b-1f3ff':0, '1f44c-1f3fb':0, '1f44c-1f3fc':0, '1f44c-1f3fd':0, '1f44c-1f3fe':0, '1f44c-1f3ff':0, '1f44d-1f3fb':0, '1f44d-1f3fc':0, '1f44d-1f3fd':0, '1f44d-1f3fe':0, '1f44d-1f3ff':0, '1f44e-1f3fb':0, '1f44e-1f3fc':0, '1f44e-1f3fd':0, '1f44e-1f3fe':0, '1f44e-1f3ff':0, '1f44f-1f3fb':0, '1f44f-1f3fc':0, '1f44f-1f3fd':0, '1f44f-1f3fe':0, '1f44f-1f3ff':0, '1f450-1f3fb':0, '1f450-1f3fc':0, '1f450-1f3fd':0, '1f450-1f3fe':0, '1f450-1f3ff':0, '1f466-1f3fb':0, '1f466-1f3fc':0, '1f466-1f3fd':0, '1f466-1f3fe':0, '1f466-1f3ff':0, '1f467-1f3fb':0, '1f467-1f3fc':0, '1f467-1f3fd':0, '1f467-1f3fe':0, '1f467-1f3ff':0, '1f468-1f3fb-200d-1f33e':0, '1f468-1f3fc-200d-1f33e':0, '1f468-1f3fd-200d-1f33e':0, '1f468-1f3fe-200d-1f33e':0, '1f468-1f3ff-200d-1f33e':0, '1f468-1f3fb-200d-1f373':0, '1f468-1f3fc-200d-1f373':0, '1f468-1f3fd-200d-1f373':0, '1f468-1f3fe-200d-1f373':0, '1f468-1f3ff-200d-1f373':0, '1f468-1f3fb-200d-1f37c':0, '1f468-1f3fc-200d-1f37c':0, '1f468-1f3fd-200d-1f37c':0, '1f468-1f3fe-200d-1f37c':0, '1f468-1f3ff-200d-1f37c':0, '1f468-1f3fb-200d-1f393':0, '1f468-1f3fc-200d-1f393':0, '1f468-1f3fd-200d-1f393':0, '1f468-1f3fe-200d-1f393':0, '1f468-1f3ff-200d-1f393':0, '1f468-1f3fb-200d-1f3a4':0, '1f468-1f3fc-200d-1f3a4':0, '1f468-1f3fd-200d-1f3a4':0, '1f468-1f3fe-200d-1f3a4':0, '1f468-1f3ff-200d-1f3a4':0, '1f468-1f3fb-200d-1f3a8':0, '1f468-1f3fc-200d-1f3a8':0, '1f468-1f3fd-200d-1f3a8':0, '1f468-1f3fe-200d-1f3a8':0, '1f468-1f3ff-200d-1f3a8':0, '1f468-1f3fb-200d-1f3eb':0, '1f468-1f3fc-200d-1f3eb':0, '1f468-1f3fd-200d-1f3eb':0, '1f468-1f3fe-200d-1f3eb':0, '1f468-1f3ff-200d-1f3eb':0, '1f468-1f3fb-200d-1f3ed':0, '1f468-1f3fc-200d-1f3ed':0, '1f468-1f3fd-200d-1f3ed':0, '1f468-1f3fe-200d-1f3ed':0, '1f468-1f3ff-200d-1f3ed':0, '1f468-1f3fb-200d-1f4bb':0, '1f468-1f3fc-200d-1f4bb':0, '1f468-1f3fd-200d-1f4bb':0, '1f468-1f3fe-200d-1f4bb':0, '1f468-1f3ff-200d-1f4bb':0, '1f468-1f3fb-200d-1f4bc':0, '1f468-1f3fc-200d-1f4bc':0, '1f468-1f3fd-200d-1f4bc':0, '1f468-1f3fe-200d-1f4bc':0, '1f468-1f3ff-200d-1f4bc':0, '1f468-1f3fb-200d-1f527':0, '1f468-1f3fc-200d-1f527':0, '1f468-1f3fd-200d-1f527':0, '1f468-1f3fe-200d-1f527':0, '1f468-1f3ff-200d-1f527':0, '1f468-1f3fb-200d-1f52c':0, '1f468-1f3fc-200d-1f52c':0, '1f468-1f3fd-200d-1f52c':0, '1f468-1f3fe-200d-1f52c':0, '1f468-1f3ff-200d-1f52c':0, '1f468-1f3fb-200d-1f680':0, '1f468-1f3fc-200d-1f680':0, '1f468-1f3fd-200d-1f680':0, '1f468-1f3fe-200d-1f680':0, '1f468-1f3ff-200d-1f680':0, '1f468-1f3fb-200d-1f692':0, '1f468-1f3fc-200d-1f692':0, '1f468-1f3fd-200d-1f692':0, '1f468-1f3fe-200d-1f692':0, '1f468-1f3ff-200d-1f692':0, '1f468-1f3fb-200d-1f9af':0, '1f468-1f3fc-200d-1f9af':0, '1f468-1f3fd-200d-1f9af':0, '1f468-1f3fe-200d-1f9af':0, '1f468-1f3ff-200d-1f9af':0, '1f468-1f3fb-200d-1f9b0':0, '1f468-1f3fc-200d-1f9b0':0, '1f468-1f3fd-200d-1f9b0':0, '1f468-1f3fe-200d-1f9b0':0, '1f468-1f3ff-200d-1f9b0':0, '1f468-1f3fb-200d-1f9b1':0, '1f468-1f3fc-200d-1f9b1':0, '1f468-1f3fd-200d-1f9b1':0, '1f468-1f3fe-200d-1f9b1':0, '1f468-1f3ff-200d-1f9b1':0, '1f468-1f3fb-200d-1f9b2':0, '1f468-1f3fc-200d-1f9b2':0, '1f468-1f3fd-200d-1f9b2':0, '1f468-1f3fe-200d-1f9b2':0, '1f468-1f3ff-200d-1f9b2':0, '1f468-1f3fb-200d-1f9b3':0, '1f468-1f3fc-200d-1f9b3':0, '1f468-1f3fd-200d-1f9b3':0, '1f468-1f3fe-200d-1f9b3':0, '1f468-1f3ff-200d-1f9b3':0, '1f468-1f3fb-200d-1f9bc':0, '1f468-1f3fc-200d-1f9bc':0, '1f468-1f3fd-200d-1f9bc':0, '1f468-1f3fe-200d-1f9bc':0, '1f468-1f3ff-200d-1f9bc':0, '1f468-1f3fb-200d-1f9bd':0, '1f468-1f3fc-200d-1f9bd':0, '1f468-1f3fd-200d-1f9bd':0, '1f468-1f3fe-200d-1f9bd':0, '1f468-1f3ff-200d-1f9bd':0, '1f468-1f3fb-200d-2695':0, '1f468-1f3fc-200d-2695':0, '1f468-1f3fd-200d-2695':0, '1f468-1f3fe-200d-2695':0, '1f468-1f3ff-200d-2695':0, '1f468-1f3fb-200d-2696':0, '1f468-1f3fc-200d-2696':0, '1f468-1f3fd-200d-2696':0, '1f468-1f3fe-200d-2696':0, '1f468-1f3ff-200d-2696':0, '1f468-1f3fb-200d-2708':0, '1f468-1f3fc-200d-2708':0, '1f468-1f3fd-200d-2708':0, '1f468-1f3fe-200d-2708':0, '1f468-1f3ff-200d-2708':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3fb-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3fc-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3fd-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3fe-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3fb':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3fc':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3fd':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3fe':0, '1f468-1f3ff-200d-2764-200d-1f468-1f3ff':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f468-1f3fb':0, '1f468-1f3fc':0, '1f468-1f3fd':0, '1f468-1f3fe':0, '1f468-1f3ff':0, '1f469-1f3fb-200d-1f33e':0, '1f469-1f3fc-200d-1f33e':0, '1f469-1f3fd-200d-1f33e':0, '1f469-1f3fe-200d-1f33e':0, '1f469-1f3ff-200d-1f33e':0, '1f469-1f3fb-200d-1f373':0, '1f469-1f3fc-200d-1f373':0, '1f469-1f3fd-200d-1f373':0, '1f469-1f3fe-200d-1f373':0, '1f469-1f3ff-200d-1f373':0, '1f469-1f3fb-200d-1f37c':0, '1f469-1f3fc-200d-1f37c':0, '1f469-1f3fd-200d-1f37c':0, '1f469-1f3fe-200d-1f37c':0, '1f469-1f3ff-200d-1f37c':0, '1f469-1f3fb-200d-1f393':0, '1f469-1f3fc-200d-1f393':0, '1f469-1f3fd-200d-1f393':0, '1f469-1f3fe-200d-1f393':0, '1f469-1f3ff-200d-1f393':0, '1f469-1f3fb-200d-1f3a4':0, '1f469-1f3fc-200d-1f3a4':0, '1f469-1f3fd-200d-1f3a4':0, '1f469-1f3fe-200d-1f3a4':0, '1f469-1f3ff-200d-1f3a4':0, '1f469-1f3fb-200d-1f3a8':0, '1f469-1f3fc-200d-1f3a8':0, '1f469-1f3fd-200d-1f3a8':0, '1f469-1f3fe-200d-1f3a8':0, '1f469-1f3ff-200d-1f3a8':0, '1f469-1f3fb-200d-1f3eb':0, '1f469-1f3fc-200d-1f3eb':0, '1f469-1f3fd-200d-1f3eb':0, '1f469-1f3fe-200d-1f3eb':0, '1f469-1f3ff-200d-1f3eb':0, '1f469-1f3fb-200d-1f3ed':0, '1f469-1f3fc-200d-1f3ed':0, '1f469-1f3fd-200d-1f3ed':0, '1f469-1f3fe-200d-1f3ed':0, '1f469-1f3ff-200d-1f3ed':0, '1f469-1f3fb-200d-1f4bb':0, '1f469-1f3fc-200d-1f4bb':0, '1f469-1f3fd-200d-1f4bb':0, '1f469-1f3fe-200d-1f4bb':0, '1f469-1f3ff-200d-1f4bb':0, '1f469-1f3fb-200d-1f4bc':0, '1f469-1f3fc-200d-1f4bc':0, '1f469-1f3fd-200d-1f4bc':0, '1f469-1f3fe-200d-1f4bc':0, '1f469-1f3ff-200d-1f4bc':0, '1f469-1f3fb-200d-1f527':0, '1f469-1f3fc-200d-1f527':0, '1f469-1f3fd-200d-1f527':0, '1f469-1f3fe-200d-1f527':0, '1f469-1f3ff-200d-1f527':0, '1f469-1f3fb-200d-1f52c':0, '1f469-1f3fc-200d-1f52c':0, '1f469-1f3fd-200d-1f52c':0, '1f469-1f3fe-200d-1f52c':0, '1f469-1f3ff-200d-1f52c':0, '1f469-1f3fb-200d-1f680':0, '1f469-1f3fc-200d-1f680':0, '1f469-1f3fd-200d-1f680':0, '1f469-1f3fe-200d-1f680':0, '1f469-1f3ff-200d-1f680':0, '1f469-1f3fb-200d-1f692':0, '1f469-1f3fc-200d-1f692':0, '1f469-1f3fd-200d-1f692':0, '1f469-1f3fe-200d-1f692':0, '1f469-1f3ff-200d-1f692':0, '1f469-1f3fb-200d-1f9af':0, '1f469-1f3fc-200d-1f9af':0, '1f469-1f3fd-200d-1f9af':0, '1f469-1f3fe-200d-1f9af':0, '1f469-1f3ff-200d-1f9af':0, '1f469-1f3fb-200d-1f9b0':0, '1f469-1f3fc-200d-1f9b0':0, '1f469-1f3fd-200d-1f9b0':0, '1f469-1f3fe-200d-1f9b0':0, '1f469-1f3ff-200d-1f9b0':0, '1f469-1f3fb-200d-1f9b1':0, '1f469-1f3fc-200d-1f9b1':0, '1f469-1f3fd-200d-1f9b1':0, '1f469-1f3fe-200d-1f9b1':0, '1f469-1f3ff-200d-1f9b1':0, '1f469-1f3fb-200d-1f9b2':0, '1f469-1f3fc-200d-1f9b2':0, '1f469-1f3fd-200d-1f9b2':0, '1f469-1f3fe-200d-1f9b2':0, '1f469-1f3ff-200d-1f9b2':0, '1f469-1f3fb-200d-1f9b3':0, '1f469-1f3fc-200d-1f9b3':0, '1f469-1f3fd-200d-1f9b3':0, '1f469-1f3fe-200d-1f9b3':0, '1f469-1f3ff-200d-1f9b3':0, '1f469-1f3fb-200d-1f9bc':0, '1f469-1f3fc-200d-1f9bc':0, '1f469-1f3fd-200d-1f9bc':0, '1f469-1f3fe-200d-1f9bc':0, '1f469-1f3ff-200d-1f9bc':0, '1f469-1f3fb-200d-1f9bd':0, '1f469-1f3fc-200d-1f9bd':0, '1f469-1f3fd-200d-1f9bd':0, '1f469-1f3fe-200d-1f9bd':0, '1f469-1f3ff-200d-1f9bd':0, '1f469-1f3fb-200d-2695':0, '1f469-1f3fc-200d-2695':0, '1f469-1f3fd-200d-2695':0, '1f469-1f3fe-200d-2695':0, '1f469-1f3ff-200d-2695':0, '1f469-1f3fb-200d-2696':0, '1f469-1f3fc-200d-2696':0, '1f469-1f3fd-200d-2696':0, '1f469-1f3fe-200d-2696':0, '1f469-1f3ff-200d-2696':0, '1f469-1f3fb-200d-2708':0, '1f469-1f3fc-200d-2708':0, '1f469-1f3fd-200d-2708':0, '1f469-1f3fe-200d-2708':0, '1f469-1f3ff-200d-2708':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3fb-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3fc-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3fd-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3fe-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3fb':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3fc':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3fd':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3fe':0, '1f469-1f3ff-200d-2764-200d-1f468-1f3ff':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3fb-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3fc-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3fd-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3fe-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3fb':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3fc':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3fd':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3fe':0, '1f469-1f3ff-200d-2764-200d-1f469-1f3ff':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fb':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fc':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fd':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fe':0, '1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3ff':0, '1f469-1f3fb':0, '1f469-1f3fc':0, '1f469-1f3fd':0, '1f469-1f3fe':0, '1f469-1f3ff':0, '1f46b-1f3fb':0, '1f46b-1f3fc':0, '1f46b-1f3fd':0, '1f46b-1f3fe':0, '1f46b-1f3ff':0, '1f469-1f3fb-200d-1f91d-200d-1f468-1f3fc':0, '1f469-1f3fb-200d-1f91d-200d-1f468-1f3fd':0, '1f469-1f3fb-200d-1f91d-200d-1f468-1f3fe':0, '1f469-1f3fb-200d-1f91d-200d-1f468-1f3ff':0, '1f469-1f3fc-200d-1f91d-200d-1f468-1f3fb':0, '1f469-1f3fc-200d-1f91d-200d-1f468-1f3fd':0, '1f469-1f3fc-200d-1f91d-200d-1f468-1f3fe':0, '1f469-1f3fc-200d-1f91d-200d-1f468-1f3ff':0, '1f469-1f3fd-200d-1f91d-200d-1f468-1f3fb':0, '1f469-1f3fd-200d-1f91d-200d-1f468-1f3fc':0, '1f469-1f3fd-200d-1f91d-200d-1f468-1f3fe':0, '1f469-1f3fd-200d-1f91d-200d-1f468-1f3ff':0, '1f469-1f3fe-200d-1f91d-200d-1f468-1f3fb':0, '1f469-1f3fe-200d-1f91d-200d-1f468-1f3fc':0, '1f469-1f3fe-200d-1f91d-200d-1f468-1f3fd':0, '1f469-1f3fe-200d-1f91d-200d-1f468-1f3ff':0, '1f469-1f3ff-200d-1f91d-200d-1f468-1f3fb':0, '1f469-1f3ff-200d-1f91d-200d-1f468-1f3fc':0, '1f469-1f3ff-200d-1f91d-200d-1f468-1f3fd':0, '1f469-1f3ff-200d-1f91d-200d-1f468-1f3fe':0, '1f46c-1f3fb':0, '1f46c-1f3fc':0, '1f46c-1f3fd':0, '1f46c-1f3fe':0, '1f46c-1f3ff':0, '1f468-1f3fb-200d-1f91d-200d-1f468-1f3fc':0, '1f468-1f3fb-200d-1f91d-200d-1f468-1f3fd':0, '1f468-1f3fb-200d-1f91d-200d-1f468-1f3fe':0, '1f468-1f3fb-200d-1f91d-200d-1f468-1f3ff':0, '1f468-1f3fc-200d-1f91d-200d-1f468-1f3fb':0, '1f468-1f3fc-200d-1f91d-200d-1f468-1f3fd':0, '1f468-1f3fc-200d-1f91d-200d-1f468-1f3fe':0, '1f468-1f3fc-200d-1f91d-200d-1f468-1f3ff':0, '1f468-1f3fd-200d-1f91d-200d-1f468-1f3fb':0, '1f468-1f3fd-200d-1f91d-200d-1f468-1f3fc':0, '1f468-1f3fd-200d-1f91d-200d-1f468-1f3fe':0, '1f468-1f3fd-200d-1f91d-200d-1f468-1f3ff':0, '1f468-1f3fe-200d-1f91d-200d-1f468-1f3fb':0, '1f468-1f3fe-200d-1f91d-200d-1f468-1f3fc':0, '1f468-1f3fe-200d-1f91d-200d-1f468-1f3fd':0, '1f468-1f3fe-200d-1f91d-200d-1f468-1f3ff':0, '1f468-1f3ff-200d-1f91d-200d-1f468-1f3fb':0, '1f468-1f3ff-200d-1f91d-200d-1f468-1f3fc':0, '1f468-1f3ff-200d-1f91d-200d-1f468-1f3fd':0, '1f468-1f3ff-200d-1f91d-200d-1f468-1f3fe':0, '1f46d-1f3fb':0, '1f46d-1f3fc':0, '1f46d-1f3fd':0, '1f46d-1f3fe':0, '1f46d-1f3ff':0, '1f469-1f3fb-200d-1f91d-200d-1f469-1f3fc':0, '1f469-1f3fb-200d-1f91d-200d-1f469-1f3fd':0, '1f469-1f3fb-200d-1f91d-200d-1f469-1f3fe':0, '1f469-1f3fb-200d-1f91d-200d-1f469-1f3ff':0, '1f469-1f3fc-200d-1f91d-200d-1f469-1f3fb':0, '1f469-1f3fc-200d-1f91d-200d-1f469-1f3fd':0, '1f469-1f3fc-200d-1f91d-200d-1f469-1f3fe':0, '1f469-1f3fc-200d-1f91d-200d-1f469-1f3ff':0, '1f469-1f3fd-200d-1f91d-200d-1f469-1f3fb':0, '1f469-1f3fd-200d-1f91d-200d-1f469-1f3fc':0, '1f469-1f3fd-200d-1f91d-200d-1f469-1f3fe':0, '1f469-1f3fd-200d-1f91d-200d-1f469-1f3ff':0, '1f469-1f3fe-200d-1f91d-200d-1f469-1f3fb':0, '1f469-1f3fe-200d-1f91d-200d-1f469-1f3fc':0, '1f469-1f3fe-200d-1f91d-200d-1f469-1f3fd':0, '1f469-1f3fe-200d-1f91d-200d-1f469-1f3ff':0, '1f469-1f3ff-200d-1f91d-200d-1f469-1f3fb':0, '1f469-1f3ff-200d-1f91d-200d-1f469-1f3fc':0, '1f469-1f3ff-200d-1f91d-200d-1f469-1f3fd':0, '1f469-1f3ff-200d-1f91d-200d-1f469-1f3fe':0, '1f46e-1f3fb-200d-2640':0, '1f46e-1f3fc-200d-2640':0, '1f46e-1f3fd-200d-2640':0, '1f46e-1f3fe-200d-2640':0, '1f46e-1f3ff-200d-2640':0, '1f46e-1f3fb-200d-2642':0, '1f46e-1f3fc-200d-2642':0, '1f46e-1f3fd-200d-2642':0, '1f46e-1f3fe-200d-2642':0, '1f46e-1f3ff-200d-2642':0, '1f46e-1f3fb':0, '1f46e-1f3fc':0, '1f46e-1f3fd':0, '1f46e-1f3fe':0, '1f46e-1f3ff':0, '1f470-1f3fb-200d-2640':0, '1f470-1f3fc-200d-2640':0, '1f470-1f3fd-200d-2640':0, '1f470-1f3fe-200d-2640':0, '1f470-1f3ff-200d-2640':0, '1f470-1f3fb-200d-2642':0, '1f470-1f3fc-200d-2642':0, '1f470-1f3fd-200d-2642':0, '1f470-1f3fe-200d-2642':0, '1f470-1f3ff-200d-2642':0, '1f470-1f3fb':0, '1f470-1f3fc':0, '1f470-1f3fd':0, '1f470-1f3fe':0, '1f470-1f3ff':0, '1f471-1f3fb-200d-2640':0, '1f471-1f3fc-200d-2640':0, '1f471-1f3fd-200d-2640':0, '1f471-1f3fe-200d-2640':0, '1f471-1f3ff-200d-2640':0, '1f471-1f3fb-200d-2642':0, '1f471-1f3fc-200d-2642':0, '1f471-1f3fd-200d-2642':0, '1f471-1f3fe-200d-2642':0, '1f471-1f3ff-200d-2642':0, '1f471-1f3fb':0, '1f471-1f3fc':0, '1f471-1f3fd':0, '1f471-1f3fe':0, '1f471-1f3ff':0, '1f472-1f3fb':0, '1f472-1f3fc':0, '1f472-1f3fd':0, '1f472-1f3fe':0, '1f472-1f3ff':0, '1f473-1f3fb-200d-2640':0, '1f473-1f3fc-200d-2640':0, '1f473-1f3fd-200d-2640':0, '1f473-1f3fe-200d-2640':0, '1f473-1f3ff-200d-2640':0, '1f473-1f3fb-200d-2642':0, '1f473-1f3fc-200d-2642':0, '1f473-1f3fd-200d-2642':0, '1f473-1f3fe-200d-2642':0, '1f473-1f3ff-200d-2642':0, '1f473-1f3fb':0, '1f473-1f3fc':0, '1f473-1f3fd':0, '1f473-1f3fe':0, '1f473-1f3ff':0, '1f474-1f3fb':0, '1f474-1f3fc':0, '1f474-1f3fd':0, '1f474-1f3fe':0, '1f474-1f3ff':0, '1f475-1f3fb':0, '1f475-1f3fc':0, '1f475-1f3fd':0, '1f475-1f3fe':0, '1f475-1f3ff':0, '1f476-1f3fb':0, '1f476-1f3fc':0, '1f476-1f3fd':0, '1f476-1f3fe':0, '1f476-1f3ff':0, '1f477-1f3fb-200d-2640':0, '1f477-1f3fc-200d-2640':0, '1f477-1f3fd-200d-2640':0, '1f477-1f3fe-200d-2640':0, '1f477-1f3ff-200d-2640':0, '1f477-1f3fb-200d-2642':0, '1f477-1f3fc-200d-2642':0, '1f477-1f3fd-200d-2642':0, '1f477-1f3fe-200d-2642':0, '1f477-1f3ff-200d-2642':0, '1f477-1f3fb':0, '1f477-1f3fc':0, '1f477-1f3fd':0, '1f477-1f3fe':0, '1f477-1f3ff':0, '1f478-1f3fb':0, '1f478-1f3fc':0, '1f478-1f3fd':0, '1f478-1f3fe':0, '1f478-1f3ff':0, '1f47c-1f3fb':0, '1f47c-1f3fc':0, '1f47c-1f3fd':0, '1f47c-1f3fe':0, '1f47c-1f3ff':0, '1f481-1f3fb-200d-2640':0, '1f481-1f3fc-200d-2640':0, '1f481-1f3fd-200d-2640':0, '1f481-1f3fe-200d-2640':0, '1f481-1f3ff-200d-2640':0, '1f481-1f3fb-200d-2642':0, '1f481-1f3fc-200d-2642':0, '1f481-1f3fd-200d-2642':0, '1f481-1f3fe-200d-2642':0, '1f481-1f3ff-200d-2642':0, '1f481-1f3fb':0, '1f481-1f3fc':0, '1f481-1f3fd':0, '1f481-1f3fe':0, '1f481-1f3ff':0, '1f482-1f3fb-200d-2640':0, '1f482-1f3fc-200d-2640':0, '1f482-1f3fd-200d-2640':0, '1f482-1f3fe-200d-2640':0, '1f482-1f3ff-200d-2640':0, '1f482-1f3fb-200d-2642':0, '1f482-1f3fc-200d-2642':0, '1f482-1f3fd-200d-2642':0, '1f482-1f3fe-200d-2642':0, '1f482-1f3ff-200d-2642':0, '1f482-1f3fb':0, '1f482-1f3fc':0, '1f482-1f3fd':0, '1f482-1f3fe':0, '1f482-1f3ff':0, '1f483-1f3fb':0, '1f483-1f3fc':0, '1f483-1f3fd':0, '1f483-1f3fe':0, '1f483-1f3ff':0, '1f485-1f3fb':0, '1f485-1f3fc':0, '1f485-1f3fd':0, '1f485-1f3fe':0, '1f485-1f3ff':0, '1f486-1f3fb-200d-2640':0, '1f486-1f3fc-200d-2640':0, '1f486-1f3fd-200d-2640':0, '1f486-1f3fe-200d-2640':0, '1f486-1f3ff-200d-2640':0, '1f486-1f3fb-200d-2642':0, '1f486-1f3fc-200d-2642':0, '1f486-1f3fd-200d-2642':0, '1f486-1f3fe-200d-2642':0, '1f486-1f3ff-200d-2642':0, '1f486-1f3fb':0, '1f486-1f3fc':0, '1f486-1f3fd':0, '1f486-1f3fe':0, '1f486-1f3ff':0, '1f487-1f3fb-200d-2640':0, '1f487-1f3fc-200d-2640':0, '1f487-1f3fd-200d-2640':0, '1f487-1f3fe-200d-2640':0, '1f487-1f3ff-200d-2640':0, '1f487-1f3fb-200d-2642':0, '1f487-1f3fc-200d-2642':0, '1f487-1f3fd-200d-2642':0, '1f487-1f3fe-200d-2642':0, '1f487-1f3ff-200d-2642':0, '1f487-1f3fb':0, '1f487-1f3fc':0, '1f487-1f3fd':0, '1f487-1f3fe':0, '1f487-1f3ff':0, '1f48f-1f3fb':0, '1f48f-1f3fc':0, '1f48f-1f3fd':0, '1f48f-1f3fe':0, '1f48f-1f3ff':0, '1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fc':0, '1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fd':0, '1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fe':0, '1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3ff':0, '1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fb':0, '1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fd':0, '1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fe':0, '1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3ff':0, '1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fb':0, '1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fc':0, '1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fe':0, '1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3ff':0, '1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fb':0, '1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fc':0, '1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fd':0, '1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3ff':0, '1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fb':0, '1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fc':0, '1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fd':0, '1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fe':0, '1f491-1f3fb':0, '1f491-1f3fc':0, '1f491-1f3fd':0, '1f491-1f3fe':0, '1f491-1f3ff':0, '1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fc':0, '1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fd':0, '1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fe':0, '1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3ff':0, '1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fb':0, '1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fd':0, '1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fe':0, '1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3ff':0, '1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fb':0, '1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fc':0, '1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fe':0, '1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3ff':0, '1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fb':0, '1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fc':0, '1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fd':0, '1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3ff':0, '1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fb':0, '1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fc':0, '1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fd':0, '1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fe':0, '1f4aa-1f3fb':0, '1f4aa-1f3fc':0, '1f4aa-1f3fd':0, '1f4aa-1f3fe':0, '1f4aa-1f3ff':0, '1f574-1f3fb':0, '1f574-1f3fc':0, '1f574-1f3fd':0, '1f574-1f3fe':0, '1f574-1f3ff':0, '1f575-1f3fb-200d-2640':0, '1f575-1f3fc-200d-2640':0, '1f575-1f3fd-200d-2640':0, '1f575-1f3fe-200d-2640':0, '1f575-1f3ff-200d-2640':0, '1f575-1f3fb-200d-2642':0, '1f575-1f3fc-200d-2642':0, '1f575-1f3fd-200d-2642':0, '1f575-1f3fe-200d-2642':0, '1f575-1f3ff-200d-2642':0, '1f575-1f3fb':0, '1f575-1f3fc':0, '1f575-1f3fd':0, '1f575-1f3fe':0, '1f575-1f3ff':0, '1f57a-1f3fb':0, '1f57a-1f3fc':0, '1f57a-1f3fd':0, '1f57a-1f3fe':0, '1f57a-1f3ff':0, '1f590-1f3fb':0, '1f590-1f3fc':0, '1f590-1f3fd':0, '1f590-1f3fe':0, '1f590-1f3ff':0, '1f595-1f3fb':0, '1f595-1f3fc':0, '1f595-1f3fd':0, '1f595-1f3fe':0, '1f595-1f3ff':0, '1f596-1f3fb':0, '1f596-1f3fc':0, '1f596-1f3fd':0, '1f596-1f3fe':0, '1f596-1f3ff':0, '1f645-1f3fb-200d-2640':0, '1f645-1f3fc-200d-2640':0, '1f645-1f3fd-200d-2640':0, '1f645-1f3fe-200d-2640':0, '1f645-1f3ff-200d-2640':0, '1f645-1f3fb-200d-2642':0, '1f645-1f3fc-200d-2642':0, '1f645-1f3fd-200d-2642':0, '1f645-1f3fe-200d-2642':0, '1f645-1f3ff-200d-2642':0, '1f645-1f3fb':0, '1f645-1f3fc':0, '1f645-1f3fd':0, '1f645-1f3fe':0, '1f645-1f3ff':0, '1f646-1f3fb-200d-2640':0, '1f646-1f3fc-200d-2640':0, '1f646-1f3fd-200d-2640':0, '1f646-1f3fe-200d-2640':0, '1f646-1f3ff-200d-2640':0, '1f646-1f3fb-200d-2642':0, '1f646-1f3fc-200d-2642':0, '1f646-1f3fd-200d-2642':0, '1f646-1f3fe-200d-2642':0, '1f646-1f3ff-200d-2642':0, '1f646-1f3fb':0, '1f646-1f3fc':0, '1f646-1f3fd':0, '1f646-1f3fe':0, '1f646-1f3ff':0, '1f647-1f3fb-200d-2640':0, '1f647-1f3fc-200d-2640':0, '1f647-1f3fd-200d-2640':0, '1f647-1f3fe-200d-2640':0, '1f647-1f3ff-200d-2640':0, '1f647-1f3fb-200d-2642':0, '1f647-1f3fc-200d-2642':0, '1f647-1f3fd-200d-2642':0, '1f647-1f3fe-200d-2642':0, '1f647-1f3ff-200d-2642':0, '1f647-1f3fb':0, '1f647-1f3fc':0, '1f647-1f3fd':0, '1f647-1f3fe':0, '1f647-1f3ff':0, '1f64b-1f3fb-200d-2640':0, '1f64b-1f3fc-200d-2640':0, '1f64b-1f3fd-200d-2640':0, '1f64b-1f3fe-200d-2640':0, '1f64b-1f3ff-200d-2640':0, '1f64b-1f3fb-200d-2642':0, '1f64b-1f3fc-200d-2642':0, '1f64b-1f3fd-200d-2642':0, '1f64b-1f3fe-200d-2642':0, '1f64b-1f3ff-200d-2642':0, '1f64b-1f3fb':0, '1f64b-1f3fc':0, '1f64b-1f3fd':0, '1f64b-1f3fe':0, '1f64b-1f3ff':0, '1f64c-1f3fb':0, '1f64c-1f3fc':0, '1f64c-1f3fd':0, '1f64c-1f3fe':0, '1f64c-1f3ff':0, '1f64d-1f3fb-200d-2640':0, '1f64d-1f3fc-200d-2640':0, '1f64d-1f3fd-200d-2640':0, '1f64d-1f3fe-200d-2640':0, '1f64d-1f3ff-200d-2640':0, '1f64d-1f3fb-200d-2642':0, '1f64d-1f3fc-200d-2642':0, '1f64d-1f3fd-200d-2642':0, '1f64d-1f3fe-200d-2642':0, '1f64d-1f3ff-200d-2642':0, '1f64d-1f3fb':0, '1f64d-1f3fc':0, '1f64d-1f3fd':0, '1f64d-1f3fe':0, '1f64d-1f3ff':0, '1f64e-1f3fb-200d-2640':0, '1f64e-1f3fc-200d-2640':0, '1f64e-1f3fd-200d-2640':0, '1f64e-1f3fe-200d-2640':0, '1f64e-1f3ff-200d-2640':0, '1f64e-1f3fb-200d-2642':0, '1f64e-1f3fc-200d-2642':0, '1f64e-1f3fd-200d-2642':0, '1f64e-1f3fe-200d-2642':0, '1f64e-1f3ff-200d-2642':0, '1f64e-1f3fb':0, '1f64e-1f3fc':0, '1f64e-1f3fd':0, '1f64e-1f3fe':0, '1f64e-1f3ff':0, '1f64f-1f3fb':0, '1f64f-1f3fc':0, '1f64f-1f3fd':0, '1f64f-1f3fe':0, '1f64f-1f3ff':0, '1f6a3-1f3fb-200d-2640':0, '1f6a3-1f3fc-200d-2640':0, '1f6a3-1f3fd-200d-2640':0, '1f6a3-1f3fe-200d-2640':0, '1f6a3-1f3ff-200d-2640':0, '1f6a3-1f3fb-200d-2642':0, '1f6a3-1f3fc-200d-2642':0, '1f6a3-1f3fd-200d-2642':0, '1f6a3-1f3fe-200d-2642':0, '1f6a3-1f3ff-200d-2642':0, '1f6a3-1f3fb':0, '1f6a3-1f3fc':0, '1f6a3-1f3fd':0, '1f6a3-1f3fe':0, '1f6a3-1f3ff':0, '1f6b4-1f3fb-200d-2640':0, '1f6b4-1f3fc-200d-2640':0, '1f6b4-1f3fd-200d-2640':0, '1f6b4-1f3fe-200d-2640':0, '1f6b4-1f3ff-200d-2640':0, '1f6b4-1f3fb-200d-2642':0, '1f6b4-1f3fc-200d-2642':0, '1f6b4-1f3fd-200d-2642':0, '1f6b4-1f3fe-200d-2642':0, '1f6b4-1f3ff-200d-2642':0, '1f6b4-1f3fb':0, '1f6b4-1f3fc':0, '1f6b4-1f3fd':0, '1f6b4-1f3fe':0, '1f6b4-1f3ff':0, '1f6b5-1f3fb-200d-2640':0, '1f6b5-1f3fc-200d-2640':0, '1f6b5-1f3fd-200d-2640':0, '1f6b5-1f3fe-200d-2640':0, '1f6b5-1f3ff-200d-2640':0, '1f6b5-1f3fb-200d-2642':0, '1f6b5-1f3fc-200d-2642':0, '1f6b5-1f3fd-200d-2642':0, '1f6b5-1f3fe-200d-2642':0, '1f6b5-1f3ff-200d-2642':0, '1f6b5-1f3fb':0, '1f6b5-1f3fc':0, '1f6b5-1f3fd':0, '1f6b5-1f3fe':0, '1f6b5-1f3ff':0, '1f6b6-1f3fb-200d-2640':0, '1f6b6-1f3fc-200d-2640':0, '1f6b6-1f3fd-200d-2640':0, '1f6b6-1f3fe-200d-2640':0, '1f6b6-1f3ff-200d-2640':0, '1f6b6-1f3fb-200d-2642':0, '1f6b6-1f3fc-200d-2642':0, '1f6b6-1f3fd-200d-2642':0, '1f6b6-1f3fe-200d-2642':0, '1f6b6-1f3ff-200d-2642':0, '1f6b6-1f3fb':0, '1f6b6-1f3fc':0, '1f6b6-1f3fd':0, '1f6b6-1f3fe':0, '1f6b6-1f3ff':0, '1f6c0-1f3fb':0, '1f6c0-1f3fc':0, '1f6c0-1f3fd':0, '1f6c0-1f3fe':0, '1f6c0-1f3ff':0, '1f6cc-1f3fb':0, '1f6cc-1f3fc':0, '1f6cc-1f3fd':0, '1f6cc-1f3fe':0, '1f6cc-1f3ff':0, '1f90c-1f3fb':0, '1f90c-1f3fc':0, '1f90c-1f3fd':0, '1f90c-1f3fe':0, '1f90c-1f3ff':0, '1f90f-1f3fb':0, '1f90f-1f3fc':0, '1f90f-1f3fd':0, '1f90f-1f3fe':0, '1f90f-1f3ff':0, '1f918-1f3fb':0, '1f918-1f3fc':0, '1f918-1f3fd':0, '1f918-1f3fe':0, '1f918-1f3ff':0, '1f919-1f3fb':0, '1f919-1f3fc':0, '1f919-1f3fd':0, '1f919-1f3fe':0, '1f919-1f3ff':0, '1f91a-1f3fb':0, '1f91a-1f3fc':0, '1f91a-1f3fd':0, '1f91a-1f3fe':0, '1f91a-1f3ff':0, '1f91b-1f3fb':0, '1f91b-1f3fc':0, '1f91b-1f3fd':0, '1f91b-1f3fe':0, '1f91b-1f3ff':0, '1f91c-1f3fb':0, '1f91c-1f3fc':0, '1f91c-1f3fd':0, '1f91c-1f3fe':0, '1f91c-1f3ff':0, '1f91d-1f3fb':0, '1f91d-1f3fc':0, '1f91d-1f3fd':0, '1f91d-1f3fe':0, '1f91d-1f3ff':0, '1f91e-1f3fb':0, '1f91e-1f3fc':0, '1f91e-1f3fd':0, '1f91e-1f3fe':0, '1f91e-1f3ff':0, '1f91f-1f3fb':0, '1f91f-1f3fc':0, '1f91f-1f3fd':0, '1f91f-1f3fe':0, '1f91f-1f3ff':0, '1f926-1f3fb-200d-2640':0, '1f926-1f3fc-200d-2640':0, '1f926-1f3fd-200d-2640':0, '1f926-1f3fe-200d-2640':0, '1f926-1f3ff-200d-2640':0, '1f926-1f3fb-200d-2642':0, '1f926-1f3fc-200d-2642':0, '1f926-1f3fd-200d-2642':0, '1f926-1f3fe-200d-2642':0, '1f926-1f3ff-200d-2642':0, '1f926-1f3fb':0, '1f926-1f3fc':0, '1f926-1f3fd':0, '1f926-1f3fe':0, '1f926-1f3ff':0, '1f930-1f3fb':0, '1f930-1f3fc':0, '1f930-1f3fd':0, '1f930-1f3fe':0, '1f930-1f3ff':0, '1f931-1f3fb':0, '1f931-1f3fc':0, '1f931-1f3fd':0, '1f931-1f3fe':0, '1f931-1f3ff':0, '1f932-1f3fb':0, '1f932-1f3fc':0, '1f932-1f3fd':0, '1f932-1f3fe':0, '1f932-1f3ff':0, '1f933-1f3fb':0, '1f933-1f3fc':0, '1f933-1f3fd':0, '1f933-1f3fe':0, '1f933-1f3ff':0, '1f934-1f3fb':0, '1f934-1f3fc':0, '1f934-1f3fd':0, '1f934-1f3fe':0, '1f934-1f3ff':0, '1f935-1f3fb-200d-2640':0, '1f935-1f3fc-200d-2640':0, '1f935-1f3fd-200d-2640':0, '1f935-1f3fe-200d-2640':0, '1f935-1f3ff-200d-2640':0, '1f935-1f3fb-200d-2642':0, '1f935-1f3fc-200d-2642':0, '1f935-1f3fd-200d-2642':0, '1f935-1f3fe-200d-2642':0, '1f935-1f3ff-200d-2642':0, '1f935-1f3fb':0, '1f935-1f3fc':0, '1f935-1f3fd':0, '1f935-1f3fe':0, '1f935-1f3ff':0, '1f936-1f3fb':0, '1f936-1f3fc':0, '1f936-1f3fd':0, '1f936-1f3fe':0, '1f936-1f3ff':0, '1f937-1f3fb-200d-2640':0, '1f937-1f3fc-200d-2640':0, '1f937-1f3fd-200d-2640':0, '1f937-1f3fe-200d-2640':0, '1f937-1f3ff-200d-2640':0, '1f937-1f3fb-200d-2642':0, '1f937-1f3fc-200d-2642':0, '1f937-1f3fd-200d-2642':0, '1f937-1f3fe-200d-2642':0, '1f937-1f3ff-200d-2642':0, '1f937-1f3fb':0, '1f937-1f3fc':0, '1f937-1f3fd':0, '1f937-1f3fe':0, '1f937-1f3ff':0, '1f938-1f3fb-200d-2640':0, '1f938-1f3fc-200d-2640':0, '1f938-1f3fd-200d-2640':0, '1f938-1f3fe-200d-2640':0, '1f938-1f3ff-200d-2640':0, '1f938-1f3fb-200d-2642':0, '1f938-1f3fc-200d-2642':0, '1f938-1f3fd-200d-2642':0, '1f938-1f3fe-200d-2642':0, '1f938-1f3ff-200d-2642':0, '1f938-1f3fb':0, '1f938-1f3fc':0, '1f938-1f3fd':0, '1f938-1f3fe':0, '1f938-1f3ff':0, '1f939-1f3fb-200d-2640':0, '1f939-1f3fc-200d-2640':0, '1f939-1f3fd-200d-2640':0, '1f939-1f3fe-200d-2640':0, '1f939-1f3ff-200d-2640':0, '1f939-1f3fb-200d-2642':0, '1f939-1f3fc-200d-2642':0, '1f939-1f3fd-200d-2642':0, '1f939-1f3fe-200d-2642':0, '1f939-1f3ff-200d-2642':0, '1f939-1f3fb':0, '1f939-1f3fc':0, '1f939-1f3fd':0, '1f939-1f3fe':0, '1f939-1f3ff':0, '1f93d-1f3fb-200d-2640':0, '1f93d-1f3fc-200d-2640':0, '1f93d-1f3fd-200d-2640':0, '1f93d-1f3fe-200d-2640':0, '1f93d-1f3ff-200d-2640':0, '1f93d-1f3fb-200d-2642':0, '1f93d-1f3fc-200d-2642':0, '1f93d-1f3fd-200d-2642':0, '1f93d-1f3fe-200d-2642':0, '1f93d-1f3ff-200d-2642':0, '1f93d-1f3fb':0, '1f93d-1f3fc':0, '1f93d-1f3fd':0, '1f93d-1f3fe':0, '1f93d-1f3ff':0, '1f93e-1f3fb-200d-2640':0, '1f93e-1f3fc-200d-2640':0, '1f93e-1f3fd-200d-2640':0, '1f93e-1f3fe-200d-2640':0, '1f93e-1f3ff-200d-2640':0, '1f93e-1f3fb-200d-2642':0, '1f93e-1f3fc-200d-2642':0, '1f93e-1f3fd-200d-2642':0, '1f93e-1f3fe-200d-2642':0, '1f93e-1f3ff-200d-2642':0, '1f93e-1f3fb':0, '1f93e-1f3fc':0, '1f93e-1f3fd':0, '1f93e-1f3fe':0, '1f93e-1f3ff':0, '1f977-1f3fb':0, '1f977-1f3fc':0, '1f977-1f3fd':0, '1f977-1f3fe':0, '1f977-1f3ff':0, '1f9b5-1f3fb':0, '1f9b5-1f3fc':0, '1f9b5-1f3fd':0, '1f9b5-1f3fe':0, '1f9b5-1f3ff':0, '1f9b6-1f3fb':0, '1f9b6-1f3fc':0, '1f9b6-1f3fd':0, '1f9b6-1f3fe':0, '1f9b6-1f3ff':0, '1f9b8-1f3fb-200d-2640':0, '1f9b8-1f3fc-200d-2640':0, '1f9b8-1f3fd-200d-2640':0, '1f9b8-1f3fe-200d-2640':0, '1f9b8-1f3ff-200d-2640':0, '1f9b8-1f3fb-200d-2642':0, '1f9b8-1f3fc-200d-2642':0, '1f9b8-1f3fd-200d-2642':0, '1f9b8-1f3fe-200d-2642':0, '1f9b8-1f3ff-200d-2642':0, '1f9b8-1f3fb':0, '1f9b8-1f3fc':0, '1f9b8-1f3fd':0, '1f9b8-1f3fe':0, '1f9b8-1f3ff':0, '1f9b9-1f3fb-200d-2640':0, '1f9b9-1f3fc-200d-2640':0, '1f9b9-1f3fd-200d-2640':0, '1f9b9-1f3fe-200d-2640':0, '1f9b9-1f3ff-200d-2640':0, '1f9b9-1f3fb-200d-2642':0, '1f9b9-1f3fc-200d-2642':0, '1f9b9-1f3fd-200d-2642':0, '1f9b9-1f3fe-200d-2642':0, '1f9b9-1f3ff-200d-2642':0, '1f9b9-1f3fb':0, '1f9b9-1f3fc':0, '1f9b9-1f3fd':0, '1f9b9-1f3fe':0, '1f9b9-1f3ff':0, '1f9bb-1f3fb':0, '1f9bb-1f3fc':0, '1f9bb-1f3fd':0, '1f9bb-1f3fe':0, '1f9bb-1f3ff':0, '1f9cd-1f3fb-200d-2640':0, '1f9cd-1f3fc-200d-2640':0, '1f9cd-1f3fd-200d-2640':0, '1f9cd-1f3fe-200d-2640':0, '1f9cd-1f3ff-200d-2640':0, '1f9cd-1f3fb-200d-2642':0, '1f9cd-1f3fc-200d-2642':0, '1f9cd-1f3fd-200d-2642':0, '1f9cd-1f3fe-200d-2642':0, '1f9cd-1f3ff-200d-2642':0, '1f9cd-1f3fb':0, '1f9cd-1f3fc':0, '1f9cd-1f3fd':0, '1f9cd-1f3fe':0, '1f9cd-1f3ff':0, '1f9ce-1f3fb-200d-2640':0, '1f9ce-1f3fc-200d-2640':0, '1f9ce-1f3fd-200d-2640':0, '1f9ce-1f3fe-200d-2640':0, '1f9ce-1f3ff-200d-2640':0, '1f9ce-1f3fb-200d-2642':0, '1f9ce-1f3fc-200d-2642':0, '1f9ce-1f3fd-200d-2642':0, '1f9ce-1f3fe-200d-2642':0, '1f9ce-1f3ff-200d-2642':0, '1f9ce-1f3fb':0, '1f9ce-1f3fc':0, '1f9ce-1f3fd':0, '1f9ce-1f3fe':0, '1f9ce-1f3ff':0, '1f9cf-1f3fb-200d-2640':0, '1f9cf-1f3fc-200d-2640':0, '1f9cf-1f3fd-200d-2640':0, '1f9cf-1f3fe-200d-2640':0, '1f9cf-1f3ff-200d-2640':0, '1f9cf-1f3fb-200d-2642':0, '1f9cf-1f3fc-200d-2642':0, '1f9cf-1f3fd-200d-2642':0, '1f9cf-1f3fe-200d-2642':0, '1f9cf-1f3ff-200d-2642':0, '1f9cf-1f3fb':0, '1f9cf-1f3fc':0, '1f9cf-1f3fd':0, '1f9cf-1f3fe':0, '1f9cf-1f3ff':0, '1f9d1-1f3fb-200d-1f33e':0, '1f9d1-1f3fc-200d-1f33e':0, '1f9d1-1f3fd-200d-1f33e':0, '1f9d1-1f3fe-200d-1f33e':0, '1f9d1-1f3ff-200d-1f33e':0, '1f9d1-1f3fb-200d-1f373':0, '1f9d1-1f3fc-200d-1f373':0, '1f9d1-1f3fd-200d-1f373':0, '1f9d1-1f3fe-200d-1f373':0, '1f9d1-1f3ff-200d-1f373':0, '1f9d1-1f3fb-200d-1f37c':0, '1f9d1-1f3fc-200d-1f37c':0, '1f9d1-1f3fd-200d-1f37c':0, '1f9d1-1f3fe-200d-1f37c':0, '1f9d1-1f3ff-200d-1f37c':0, '1f9d1-1f3fb-200d-1f384':0, '1f9d1-1f3fc-200d-1f384':0, '1f9d1-1f3fd-200d-1f384':0, '1f9d1-1f3fe-200d-1f384':0, '1f9d1-1f3ff-200d-1f384':0, '1f9d1-1f3fb-200d-1f393':0, '1f9d1-1f3fc-200d-1f393':0, '1f9d1-1f3fd-200d-1f393':0, '1f9d1-1f3fe-200d-1f393':0, '1f9d1-1f3ff-200d-1f393':0, '1f9d1-1f3fb-200d-1f3a4':0, '1f9d1-1f3fc-200d-1f3a4':0, '1f9d1-1f3fd-200d-1f3a4':0, '1f9d1-1f3fe-200d-1f3a4':0, '1f9d1-1f3ff-200d-1f3a4':0, '1f9d1-1f3fb-200d-1f3a8':0, '1f9d1-1f3fc-200d-1f3a8':0, '1f9d1-1f3fd-200d-1f3a8':0, '1f9d1-1f3fe-200d-1f3a8':0, '1f9d1-1f3ff-200d-1f3a8':0, '1f9d1-1f3fb-200d-1f3eb':0, '1f9d1-1f3fc-200d-1f3eb':0, '1f9d1-1f3fd-200d-1f3eb':0, '1f9d1-1f3fe-200d-1f3eb':0, '1f9d1-1f3ff-200d-1f3eb':0, '1f9d1-1f3fb-200d-1f3ed':0, '1f9d1-1f3fc-200d-1f3ed':0, '1f9d1-1f3fd-200d-1f3ed':0, '1f9d1-1f3fe-200d-1f3ed':0, '1f9d1-1f3ff-200d-1f3ed':0, '1f9d1-1f3fb-200d-1f4bb':0, '1f9d1-1f3fc-200d-1f4bb':0, '1f9d1-1f3fd-200d-1f4bb':0, '1f9d1-1f3fe-200d-1f4bb':0, '1f9d1-1f3ff-200d-1f4bb':0, '1f9d1-1f3fb-200d-1f4bc':0, '1f9d1-1f3fc-200d-1f4bc':0, '1f9d1-1f3fd-200d-1f4bc':0, '1f9d1-1f3fe-200d-1f4bc':0, '1f9d1-1f3ff-200d-1f4bc':0, '1f9d1-1f3fb-200d-1f527':0, '1f9d1-1f3fc-200d-1f527':0, '1f9d1-1f3fd-200d-1f527':0, '1f9d1-1f3fe-200d-1f527':0, '1f9d1-1f3ff-200d-1f527':0, '1f9d1-1f3fb-200d-1f52c':0, '1f9d1-1f3fc-200d-1f52c':0, '1f9d1-1f3fd-200d-1f52c':0, '1f9d1-1f3fe-200d-1f52c':0, '1f9d1-1f3ff-200d-1f52c':0, '1f9d1-1f3fb-200d-1f680':0, '1f9d1-1f3fc-200d-1f680':0, '1f9d1-1f3fd-200d-1f680':0, '1f9d1-1f3fe-200d-1f680':0, '1f9d1-1f3ff-200d-1f680':0, '1f9d1-1f3fb-200d-1f692':0, '1f9d1-1f3fc-200d-1f692':0, '1f9d1-1f3fd-200d-1f692':0, '1f9d1-1f3fe-200d-1f692':0, '1f9d1-1f3ff-200d-1f692':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fb':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fc':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fd':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fe':0, '1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3ff':0, '1f9d1-1f3fb-200d-1f9af':0, '1f9d1-1f3fc-200d-1f9af':0, '1f9d1-1f3fd-200d-1f9af':0, '1f9d1-1f3fe-200d-1f9af':0, '1f9d1-1f3ff-200d-1f9af':0, '1f9d1-1f3fb-200d-1f9b0':0, '1f9d1-1f3fc-200d-1f9b0':0, '1f9d1-1f3fd-200d-1f9b0':0, '1f9d1-1f3fe-200d-1f9b0':0, '1f9d1-1f3ff-200d-1f9b0':0, '1f9d1-1f3fb-200d-1f9b1':0, '1f9d1-1f3fc-200d-1f9b1':0, '1f9d1-1f3fd-200d-1f9b1':0, '1f9d1-1f3fe-200d-1f9b1':0, '1f9d1-1f3ff-200d-1f9b1':0, '1f9d1-1f3fb-200d-1f9b2':0, '1f9d1-1f3fc-200d-1f9b2':0, '1f9d1-1f3fd-200d-1f9b2':0, '1f9d1-1f3fe-200d-1f9b2':0, '1f9d1-1f3ff-200d-1f9b2':0, '1f9d1-1f3fb-200d-1f9b3':0, '1f9d1-1f3fc-200d-1f9b3':0, '1f9d1-1f3fd-200d-1f9b3':0, '1f9d1-1f3fe-200d-1f9b3':0, '1f9d1-1f3ff-200d-1f9b3':0, '1f9d1-1f3fb-200d-1f9bc':0, '1f9d1-1f3fc-200d-1f9bc':0, '1f9d1-1f3fd-200d-1f9bc':0, '1f9d1-1f3fe-200d-1f9bc':0, '1f9d1-1f3ff-200d-1f9bc':0, '1f9d1-1f3fb-200d-1f9bd':0, '1f9d1-1f3fc-200d-1f9bd':0, '1f9d1-1f3fd-200d-1f9bd':0, '1f9d1-1f3fe-200d-1f9bd':0, '1f9d1-1f3ff-200d-1f9bd':0, '1f9d1-1f3fb-200d-2695':0, '1f9d1-1f3fc-200d-2695':0, '1f9d1-1f3fd-200d-2695':0, '1f9d1-1f3fe-200d-2695':0, '1f9d1-1f3ff-200d-2695':0, '1f9d1-1f3fb-200d-2696':0, '1f9d1-1f3fc-200d-2696':0, '1f9d1-1f3fd-200d-2696':0, '1f9d1-1f3fe-200d-2696':0, '1f9d1-1f3ff-200d-2696':0, '1f9d1-1f3fb-200d-2708':0, '1f9d1-1f3fc-200d-2708':0, '1f9d1-1f3fd-200d-2708':0, '1f9d1-1f3fe-200d-2708':0, '1f9d1-1f3ff-200d-2708':0, '1f9d1-1f3fb':0, '1f9d1-1f3fc':0, '1f9d1-1f3fd':0, '1f9d1-1f3fe':0, '1f9d1-1f3ff':0, '1f9d2-1f3fb':0, '1f9d2-1f3fc':0, '1f9d2-1f3fd':0, '1f9d2-1f3fe':0, '1f9d2-1f3ff':0, '1f9d3-1f3fb':0, '1f9d3-1f3fc':0, '1f9d3-1f3fd':0, '1f9d3-1f3fe':0, '1f9d3-1f3ff':0, '1f9d4-1f3fb-200d-2640':0, '1f9d4-1f3fc-200d-2640':0, '1f9d4-1f3fd-200d-2640':0, '1f9d4-1f3fe-200d-2640':0, '1f9d4-1f3ff-200d-2640':0, '1f9d4-1f3fb-200d-2642':0, '1f9d4-1f3fc-200d-2642':0, '1f9d4-1f3fd-200d-2642':0, '1f9d4-1f3fe-200d-2642':0, '1f9d4-1f3ff-200d-2642':0, '1f9d4-1f3fb':0, '1f9d4-1f3fc':0, '1f9d4-1f3fd':0, '1f9d4-1f3fe':0, '1f9d4-1f3ff':0, '1f9d5-1f3fb':0, '1f9d5-1f3fc':0, '1f9d5-1f3fd':0, '1f9d5-1f3fe':0, '1f9d5-1f3ff':0, '1f9d6-1f3fb-200d-2640':0, '1f9d6-1f3fc-200d-2640':0, '1f9d6-1f3fd-200d-2640':0, '1f9d6-1f3fe-200d-2640':0, '1f9d6-1f3ff-200d-2640':0, '1f9d6-1f3fb-200d-2642':0, '1f9d6-1f3fc-200d-2642':0, '1f9d6-1f3fd-200d-2642':0, '1f9d6-1f3fe-200d-2642':0, '1f9d6-1f3ff-200d-2642':0, '1f9d6-1f3fb':0, '1f9d6-1f3fc':0, '1f9d6-1f3fd':0, '1f9d6-1f3fe':0, '1f9d6-1f3ff':0, '1f9d7-1f3fb-200d-2640':0, '1f9d7-1f3fc-200d-2640':0, '1f9d7-1f3fd-200d-2640':0, '1f9d7-1f3fe-200d-2640':0, '1f9d7-1f3ff-200d-2640':0, '1f9d7-1f3fb-200d-2642':0, '1f9d7-1f3fc-200d-2642':0, '1f9d7-1f3fd-200d-2642':0, '1f9d7-1f3fe-200d-2642':0, '1f9d7-1f3ff-200d-2642':0, '1f9d7-1f3fb':0, '1f9d7-1f3fc':0, '1f9d7-1f3fd':0, '1f9d7-1f3fe':0, '1f9d7-1f3ff':0, '1f9d8-1f3fb-200d-2640':0, '1f9d8-1f3fc-200d-2640':0, '1f9d8-1f3fd-200d-2640':0, '1f9d8-1f3fe-200d-2640':0, '1f9d8-1f3ff-200d-2640':0, '1f9d8-1f3fb-200d-2642':0, '1f9d8-1f3fc-200d-2642':0, '1f9d8-1f3fd-200d-2642':0, '1f9d8-1f3fe-200d-2642':0, '1f9d8-1f3ff-200d-2642':0, '1f9d8-1f3fb':0, '1f9d8-1f3fc':0, '1f9d8-1f3fd':0, '1f9d8-1f3fe':0, '1f9d8-1f3ff':0, '1f9d9-1f3fb-200d-2640':0, '1f9d9-1f3fc-200d-2640':0, '1f9d9-1f3fd-200d-2640':0, '1f9d9-1f3fe-200d-2640':0, '1f9d9-1f3ff-200d-2640':0, '1f9d9-1f3fb-200d-2642':0, '1f9d9-1f3fc-200d-2642':0, '1f9d9-1f3fd-200d-2642':0, '1f9d9-1f3fe-200d-2642':0, '1f9d9-1f3ff-200d-2642':0, '1f9d9-1f3fb':0, '1f9d9-1f3fc':0, '1f9d9-1f3fd':0, '1f9d9-1f3fe':0, '1f9d9-1f3ff':0, '1f9da-1f3fb-200d-2640':0, '1f9da-1f3fc-200d-2640':0, '1f9da-1f3fd-200d-2640':0, '1f9da-1f3fe-200d-2640':0, '1f9da-1f3ff-200d-2640':0, '1f9da-1f3fb-200d-2642':0, '1f9da-1f3fc-200d-2642':0, '1f9da-1f3fd-200d-2642':0, '1f9da-1f3fe-200d-2642':0, '1f9da-1f3ff-200d-2642':0, '1f9da-1f3fb':0, '1f9da-1f3fc':0, '1f9da-1f3fd':0, '1f9da-1f3fe':0, '1f9da-1f3ff':0, '1f9db-1f3fb-200d-2640':0, '1f9db-1f3fc-200d-2640':0, '1f9db-1f3fd-200d-2640':0, '1f9db-1f3fe-200d-2640':0, '1f9db-1f3ff-200d-2640':0, '1f9db-1f3fb-200d-2642':0, '1f9db-1f3fc-200d-2642':0, '1f9db-1f3fd-200d-2642':0, '1f9db-1f3fe-200d-2642':0, '1f9db-1f3ff-200d-2642':0, '1f9db-1f3fb':0, '1f9db-1f3fc':0, '1f9db-1f3fd':0, '1f9db-1f3fe':0, '1f9db-1f3ff':0, '1f9dc-1f3fb-200d-2640':0, '1f9dc-1f3fc-200d-2640':0, '1f9dc-1f3fd-200d-2640':0, '1f9dc-1f3fe-200d-2640':0, '1f9dc-1f3ff-200d-2640':0, '1f9dc-1f3fb-200d-2642':0, '1f9dc-1f3fc-200d-2642':0, '1f9dc-1f3fd-200d-2642':0, '1f9dc-1f3fe-200d-2642':0, '1f9dc-1f3ff-200d-2642':0, '1f9dc-1f3fb':0, '1f9dc-1f3fc':0, '1f9dc-1f3fd':0, '1f9dc-1f3fe':0, '1f9dc-1f3ff':0, '1f9dd-1f3fb-200d-2640':0, '1f9dd-1f3fc-200d-2640':0, '1f9dd-1f3fd-200d-2640':0, '1f9dd-1f3fe-200d-2640':0, '1f9dd-1f3ff-200d-2640':0, '1f9dd-1f3fb-200d-2642':0, '1f9dd-1f3fc-200d-2642':0, '1f9dd-1f3fd-200d-2642':0, '1f9dd-1f3fe-200d-2642':0, '1f9dd-1f3ff-200d-2642':0, '1f9dd-1f3fb':0, '1f9dd-1f3fc':0, '1f9dd-1f3fd':0, '1f9dd-1f3fe':0, '1f9dd-1f3ff':0, '261d-1f3fb':0, '261d-1f3fc':0, '261d-1f3fd':0, '261d-1f3fe':0, '261d-1f3ff':0, '26f9-1f3fb-200d-2640':0, '26f9-1f3fc-200d-2640':0, '26f9-1f3fd-200d-2640':0, '26f9-1f3fe-200d-2640':0, '26f9-1f3ff-200d-2640':0, '26f9-1f3fb-200d-2642':0, '26f9-1f3fc-200d-2642':0, '26f9-1f3fd-200d-2642':0, '26f9-1f3fe-200d-2642':0, '26f9-1f3ff-200d-2642':0, '26f9-1f3fb':0, '26f9-1f3fc':0, '26f9-1f3fd':0, '26f9-1f3fe':0, '26f9-1f3ff':0, '270a-1f3fb':0, '270a-1f3fc':0, '270a-1f3fd':0, '270a-1f3fe':0, '270a-1f3ff':0, '270b-1f3fb':0, '270b-1f3fc':0, '270b-1f3fd':0, '270b-1f3fe':0, '270b-1f3ff':0, '270c-1f3fb':0, '270c-1f3fc':0, '270c-1f3fd':0, '270c-1f3fe':0, '270c-1f3ff':0, '270d-1f3fb':0, '270d-1f3fc':0, '270d-1f3fd':0, '270d-1f3fe':0, '270d-1f3ff':0}};\n\nconst Emoji: {[emoji: string]: number} = EmojiVersions[''];\nfor(const version in EmojiVersions) {\n if(version) {\n Object.assign(Emoji, EmojiVersions[version as EMOJI_VERSION]);\n }\n}\n\nexport default Emoji;\n\n/* Emoji[\"00a9-fe0f\"] = 6362;\nEmoji[\"00ae-fe0f\"] = 6363;\nEmoji[\"2122-fe0f\"] = 6364; */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ctx from './ctx';\n\nexport const USER_AGENT = navigator ? navigator.userAgent : null;\nexport const IS_APPLE = navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i) !== -1;\nexport const IS_ANDROID = navigator.userAgent.toLowerCase().indexOf('android') !== -1;\nexport const IS_CHROMIUM = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);\n\n// https://stackoverflow.com/a/58065241\nexport const IS_APPLE_MOBILE = (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&\n !(ctx as any).MSStream;\n\nexport const IS_SAFARI = !!('safari' in ctx) || !!(USER_AGENT && (/\\b(iPad|iPhone|iPod)\\b/.test(USER_AGENT) || (!!USER_AGENT.match('Safari') && !USER_AGENT.match('Chrome'))))/* || true */;\nexport const IS_FIREFOX = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n\nexport const IS_MOBILE_SAFARI = IS_SAFARI && IS_APPLE_MOBILE;\n\nexport const IS_MOBILE = (navigator.maxTouchPoints === undefined || navigator.maxTouchPoints > 0) && navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i) != -1;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport LatinizeMap from '../config/latinizeMap';\n\nexport const badCharsRe = /[`~!@#$%^&*()\\-_=+\\[\\]\\\\|{}'\";:\\/?.>,<]+/g;\nconst trimRe = /^\\s+|\\s$/g;\n\nconst C2L: {[k: string]: string} = {\n 'й': 'q',\n 'ц': 'w',\n 'у': 'e',\n 'к': 'r',\n 'е': 't',\n 'н': 'y',\n 'г': 'u',\n 'ш': 'i',\n 'щ': 'o',\n 'з': 'p',\n 'х': '[',\n 'ъ': ']',\n 'ф': 'a',\n 'ы': 's',\n 'в': 'd',\n 'а': 'f',\n 'п': 'g',\n 'р': 'h',\n 'о': 'j',\n 'л': 'k',\n 'д': 'l',\n 'ж': ';',\n 'э': '\\'',\n 'я': 'z',\n 'ч': 'x',\n 'с': 'c',\n 'м': 'v',\n 'и': 'b',\n 'т': 'n',\n 'ь': 'm',\n 'б': ',',\n 'ю': '.',\n '.': '/'\n};\n\nexport function clearBadCharsAndTrim(text: string) {\n return text.replace(badCharsRe, '').replace(trimRe, '');\n}\n\nexport function fixCyrillic(text: string) {\n return text.toLowerCase().replace(/[\\wа-я]/g, (ch) => {\n const latinizeCh = C2L[ch];\n return latinizeCh ?? ch;\n });\n}\n\nexport function latinizeString(text: string) {\n return text.replace(/[^A-Za-z0-9]/g, (ch) => {\n const latinizeCh = LatinizeMap[ch];\n return latinizeCh ?? ch;\n });\n}\n\nexport default function cleanSearchText(text: string, latinize = true) {\n return processSearchText(text, {\n clearBadChars: true,\n latinize,\n ignoreCase: true\n });\n}\n\nexport type ProcessSearchTextOptions = Partial<{\n clearBadChars: boolean,\n latinize: boolean,\n ignoreCase: boolean,\n includeTag: boolean\n}>;\n\nexport function processSearchText(text: string, options: ProcessSearchTextOptions = {}) {\n const hasTag = options.includeTag && text.charAt(0) === '%';\n const originalText = text;\n if(options.clearBadChars) text = clearBadCharsAndTrim(text);\n if(options.latinize) text = latinizeString(text);\n if(options.ignoreCase) text = text.toLowerCase();\n if(hasTag) text = '%' + text;\n if(options.latinize) text += '\\x01' + fixCyrillic(originalText);\n return text;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {InputFileLocation, InputStickerSet, InputWebFileLocation} from '../layer';\nimport type {DownloadOptions} from '../lib/mtproto/apiFileManager';\n\nconst FILENAME_JOINER = '_';\n\nexport function getFileNameByLocation(location: InputFileLocation | InputWebFileLocation, options?: Partial<{\n fileName: string,\n downloadId: string\n}>) {\n const fileName = '';// (options?.fileName || '').split('.');\n const ext = fileName[fileName.length - 1] || '';\n\n let str: string;\n switch(location._) {\n case 'inputPhotoFileLocation': {\n str = ['photo', fileName[0], location.id, location.thumb_size].filter(Boolean).join(FILENAME_JOINER);\n break;\n }\n\n case 'inputDocumentFileLocation': {\n str = ['document', fileName[0], location.id, location.thumb_size].filter(Boolean).join(FILENAME_JOINER);\n break;\n }\n\n case 'inputPeerPhotoFileLocation':\n str = ['peerPhoto', location.photo_id, location.pFlags.big ? 'big' : 'small'].join(FILENAME_JOINER);\n break;\n\n case 'inputStickerSetThumb': {\n const id = (location.stickerset as InputStickerSet.inputStickerSetID).id ||\n (location.stickerset as InputStickerSet.inputStickerSetShortName).short_name ||\n (location.stickerset as InputStickerSet.inputStickerSetDice).emoticon ||\n location.stickerset._;\n str = ['stickerSetThumb', id, location.thumb_version].join(FILENAME_JOINER);\n break;\n }\n\n case 'inputFileLocation': {\n str = [location.volume_id, location.local_id].join(FILENAME_JOINER);\n break;\n }\n\n case 'inputWebFileLocation': {\n str = ['webFile', location.url].join(FILENAME_JOINER);\n break;\n }\n\n default: {\n console.error('Unrecognized location:', location);\n str = '';\n break;\n }\n }\n\n return str + (options?.downloadId ? '_download' : '') + (ext ? '.' + ext : ext);\n}\n\nexport type FileURLType = 'photo' | 'thumb' | 'document' | 'stream' | 'download';\nexport function getFileURL(type: FileURLType, options: DownloadOptions) {\n // console.log('getFileURL', location);\n // const perf = performance.now();\n const encoded = encodeURIComponent(JSON.stringify(options));\n // console.log('getFileURL encode:', performance.now() - perf, encoded);\n\n return /* '/' + */type + '/' + encoded;\n}\n","import {RestrictionReason} from '../layer';\n\nconst platforms = new Set([\n 'all',\n 'web',\n 'webk'\n]);\n\nconst ignore = new Set();\n\nexport function getRestrictionReason(reasons: RestrictionReason[]) {\n // return reasons[0];\n return reasons.find((reason) => platforms.has(reason.platform) && !ignore.has(reason.reason));\n}\n\nexport function isRestricted(reasons: RestrictionReason[]) {\n return !!getRestrictionReason(reasons);\n}\n\nexport function ignoreRestrictionReasons(reasons: string[]) {\n ignore.clear();\n reasons.forEach((reason) => {\n ignore.add(reason);\n });\n}\n","import isObject from '../../../../helpers/object/isObject';\nimport {InputChannel, InputPeer, Peer} from '../../../../layer';\nimport {NULL_PEER_ID} from '../../../mtproto/mtproto_config';\n\nexport default function getPeerId(peerId: {user_id: UserId} | {channel_id: ChatId} | {chat_id: ChatId} | InputPeer | InputChannel | PeerId | string): PeerId {\n if(peerId !== undefined && ((peerId as string).isPeerId ? (peerId as string).isPeerId() : false)) return peerId as PeerId;\n // if(typeof(peerId) === 'string' && /^[uc]/.test(peerId)) return peerId as PeerId;\n // if(typeof(peerId) === 'number') return peerId;\n else if(isObject(peerId)) {\n const userId = (peerId as Peer.peerUser).user_id;\n if(userId !== undefined) {\n return userId.toPeerId(false);\n }\n\n const chatId = (peerId as Peer.peerChannel).channel_id || (peerId as Peer.peerChat).chat_id;\n if(chatId !== undefined) {\n return chatId.toPeerId(true);\n }\n\n return NULL_PEER_ID; // maybe it is an inputPeerSelf\n // } else if(!peerId) return 'u0';\n } else if(!peerId) return NULL_PEER_ID;\n\n const isUser = (peerId as string).charAt(0) === 'u';\n const peerParams = (peerId as string).substr(1).split('_');\n\n return isUser ? peerParams[0].toPeerId() : (peerParams[0] || '').toPeerId(true);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {Database} from '../../config/databases';\nimport Modes from '../../config/modes';\nimport makeError from '../../helpers/makeError';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport {logger} from '../logger';\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/createIndex\n */\nexport type IDBIndex = {\n indexName: string,\n keyPath: string,\n objectParameters: IDBIndexParameters\n};\n\nexport type IDBStore = {\n name: string,\n indexes?: IDBIndex[]\n};\n\nexport type IDBOptions = {\n name?: string,\n storeName: string,\n stores?: IDBStore[],\n version?: number\n};\n\nconst DEBUG = false;\n\nexport class IDB {\n private static INSTANCES: IDB[] = [];\n private openDbPromise: Promise;\n private db: IDBDatabase;\n private storageIsAvailable: boolean;\n private log: ReturnType;\n private name: string;\n private version: number;\n private stores: IDBStore[];\n\n constructor(db: Database) {\n safeAssign(this, db);\n\n if(Modes.test) {\n this.name += '_test';\n }\n\n this.storageIsAvailable = true;\n this.log = logger(['IDB', db.name].join('-'));\n this.log('constructor');\n\n this.openDatabase(true);\n\n IDB.INSTANCES.push(this);\n }\n\n public isAvailable() {\n return this.storageIsAvailable;\n }\n\n public openDatabase(createNew = false): Promise {\n if(this.openDbPromise && !createNew) {\n return this.openDbPromise;\n }\n\n const createIndexes = (os: IDBObjectStore, store: IDBStore) => {\n const indexNames = Array.from(os.indexNames);\n for(const indexName of indexNames) {\n os.deleteIndex(indexName);\n }\n\n if(!store.indexes?.length) {\n return;\n }\n\n for(const index of store.indexes) {\n if(os.indexNames.contains(index.indexName)) {\n continue;\n }\n\n os.createIndex(index.indexName, index.keyPath, index.objectParameters);\n }\n };\n\n const createObjectStore = (db: IDBDatabase, store: IDBStore) => {\n const os = db.createObjectStore(store.name);\n createIndexes(os, store);\n };\n\n try {\n var request = indexedDB.open(this.name, this.version);\n\n if(!request) {\n return Promise.reject();\n }\n } catch(error) {\n this.log.error('error opening db', (error as Error).message);\n this.storageIsAvailable = false;\n return Promise.reject(error);\n }\n\n let finished = false;\n setTimeout(() => {\n if(!finished) {\n request.onerror(makeError('IDB_CREATE_TIMEOUT') as Event);\n }\n }, 3000);\n\n return this.openDbPromise = new Promise((resolve, reject) => {\n request.onsuccess = (event) => {\n finished = true;\n const db = request.result;\n let calledNew = false;\n\n this.log('Opened');\n\n db.onerror = (error) => {\n this.storageIsAvailable = false;\n this.log.error('Error creating/accessing IndexedDB database', error);\n reject(error);\n };\n\n db.onclose = (e) => {\n this.log.error('closed:', e);\n !calledNew && this.openDatabase();\n };\n\n db.onabort = (e) => {\n this.log.error('abort:', e);\n const transaction = e.target as IDBTransaction;\n\n this.openDatabase(calledNew = true);\n\n if(transaction.onerror) {\n transaction.onerror(e);\n }\n\n db.close();\n };\n\n db.onversionchange = (e) => {\n this.log.error('onversionchange, lol?');\n };\n\n resolve(this.db = db);\n };\n\n request.onerror = (event) => {\n finished = true;\n this.storageIsAvailable = false;\n this.log.error('Error creating/accessing IndexedDB database', event);\n reject(event);\n };\n\n request.onupgradeneeded = (event) => {\n finished = true;\n this.log.warn('performing idb upgrade from', event.oldVersion, 'to', event.newVersion);\n\n const target = event.target as IDBOpenDBRequest;\n const db = target.result;\n this.stores.forEach((store) => {\n /* if(db.objectStoreNames.contains(store.name)) {\n //if(event.oldVersion === 1) {\n db.deleteObjectStore(store.name);\n //}\n } */\n\n if(!db.objectStoreNames.contains(store.name)) {\n createObjectStore(db, store);\n } else {\n const txn = target.transaction;\n const os = txn.objectStore(store.name);\n createIndexes(os, store);\n }\n });\n };\n });\n }\n\n public static create>(db: T) {\n return this.INSTANCES.find((instance) => instance.name === db.name) ?? new IDB(db);\n }\n\n public static closeDatabases(preserve?: IDB) {\n this.INSTANCES.forEach((storage) => {\n if(preserve && preserve === storage) {\n return;\n }\n\n const db = storage.db;\n if(db) {\n db.onclose = () => {};\n db.close();\n }\n });\n }\n}\n\nexport default class IDBStorage, StoreName extends string = T['stores'][0]['name']> {\n private log: ReturnType;\n private storeName: T['stores'][0]['name'];\n private idb: IDB;\n\n constructor(db: T, storeName: typeof db['stores'][0]['name']) {\n this.storeName = storeName;\n this.log = logger(['IDB', db.name, storeName].join('-'));\n this.idb = IDB.create(db);\n }\n\n /**\n * ! WARNING ! function requires at least one opened connection\n */\n /* public static clearObjectStores() {\n const storage = this.STORAGES[0];\n this.closeDatabases(storage);\n\n const names = Array.from(storage.db.objectStoreNames);\n const promises = names.map((name) => storage.clear(name));\n return Promise.all(promises);\n } */\n\n /* public static deleteDatabase() {\n this.closeDatabases();\n\n const storages = this.STORAGES;\n const dbNames = Array.from(new Set(storages.map((storage) => storage.name)));\n const promises = dbNames.map((dbName) => {\n return new Promise((resolve, reject) => {\n const deleteRequest = indexedDB.deleteDatabase(dbName);\n\n deleteRequest.onerror = () => {\n reject();\n };\n\n deleteRequest.onsuccess = () => {\n resolve();\n };\n });\n });\n\n return Promise.all(promises);\n } */\n\n public delete(entryName: string | string[], storeName?: StoreName): Promise {\n // return Promise.resolve();\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n entryName = [].concat(entryName);\n }\n\n return this.getObjectStore('readwrite', (objectStore) => {\n const promises = (entryName as string[]).map((entryName) => objectStore.delete(entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'delete: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n public clear(storeName?: StoreName): Promise {\n return this.getObjectStore('readwrite', (objectStore) => objectStore.clear(), DEBUG ? 'clear' : '', storeName);\n }\n\n public save(entryName: string | string[], value: any | any[], storeName?: StoreName) {\n // const handleError = (error: Error) => {\n // this.log.error('save: transaction error:', entryName, value, db, error, error && error.name);\n // if((!error || error.name === 'InvalidStateError')/* && false */) {\n // setTimeout(() => {\n // this.save(entryName, value);\n // }, 2e3);\n // } else {\n // //console.error('IndexedDB saveFile transaction error:', error, error && error.name);\n // }\n // };\n\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n entryName = [].concat(entryName);\n value = [].concat(value);\n }\n\n return this.getObjectStore('readwrite', (objectStore) => {\n const promises = (entryName as string[]).map((entryName, idx) => objectStore.put(value[idx], entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'save: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n // public saveFile(fileName: string, blob: Blob | Uint8Array) {\n // //return Promise.resolve(blobConstruct([blob]));\n // if(!(blob instanceof Blob)) {\n // blob = blobConstruct(blob);\n // }\n\n // return this.save(fileName, blob);\n // }\n\n /* public saveFileBase64(db: IDBDatabase, fileName: string, blob: Blob | any): Promise {\n if(this.getBlobSize(blob) > 10 * 1024 * 1024) {\n return Promise.reject();\n }\n\n if(!(blob instanceof Blob)) {\n var safeMimeType = blobSafeMimeType(blob.type || 'image/jpeg');\n var address = 'data:' + safeMimeType + ';base64,' + bytesToBase64(blob);\n return this.storagePutB64String(db, fileName, address).then(() => {\n return blob;\n });\n }\n\n try {\n var reader = new FileReader();\n } catch (e) {\n this.storageIsAvailable = false;\n return Promise.reject();\n }\n\n let promise = new Promise((resolve, reject) => {\n reader.onloadend = () => {\n this.storagePutB64String(db, fileName, reader.result as string).then(() => {\n resolve(blob);\n }, reject);\n }\n\n reader.onerror = reject;\n });\n\n\n try {\n reader.readAsDataURL(blob);\n } catch (e) {\n this.storageIsAvailable = false;\n return Promise.reject();\n }\n\n return promise;\n }\n\n public storagePutB64String(db: IDBDatabase, fileName: string, b64string: string) {\n try {\n var objectStore = db.transaction([this.storeName], 'readwrite')\n .objectStore(this.storeName);\n var request = objectStore.put(b64string, fileName);\n } catch(error) {\n this.storageIsAvailable = false;\n return Promise.reject(error);\n }\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n resolve();\n };\n\n request.onerror = reject;\n });\n }\n\n public getBlobSize(blob: any) {\n return blob.size || blob.byteLength || blob.length;\n } */\n\n public get(entryName: string[], storeName?: StoreName): Promise;\n public get(entryName: string, storeName?: StoreName): Promise;\n public get(entryName: string | string[], storeName?: StoreName): Promise | Promise {\n // return Promise.reject();\n\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n if(!entryName) {\n return undefined;\n }\n\n entryName = [].concat(entryName);\n } else if(!entryName.length) {\n return Promise.resolve([]) as any;\n }\n\n return this.getObjectStore('readonly', (objectStore) => {\n const promises = (entryName as string[]).map((entryName) => objectStore.get(entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'get: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n private getObjectStore(\n mode: IDBTransactionMode,\n callback: (objectStore: IDBObjectStore) => IDBRequest | IDBRequest[],\n log?: string,\n storeName = this.storeName\n ) {\n let perf: number;\n\n if(log) {\n perf = performance.now();\n this.log(log + ': start');\n }\n\n return this.idb.openDatabase().then((db) => {\n return new Promise((resolve, reject) => {\n /* if(mode === 'readwrite') {\n return;\n } */\n\n const transaction = db.transaction([storeName], mode);\n\n const onError = () => {\n clearTimeout(timeout);\n reject(transaction.error);\n };\n\n // let resolved = false;\n const onComplete = (/* what: string */) => {\n clearTimeout(timeout);\n\n if(log) {\n this.log(log + ': end', performance.now() - perf/* , what */);\n }\n\n // if(resolved) {\n // return;\n // }\n\n // resolved = true;\n const results = requests.map((r) => r.result);\n resolve(isArray ? results : results[0]);\n };\n\n transaction.onerror = onError;\n\n // * have to wait while clearing or setting something\n const waitForTransactionComplete = mode === 'readwrite';\n if(waitForTransactionComplete) {\n transaction.oncomplete = () => onComplete(/* 'transaction' */);\n }\n\n const timeout = setTimeout(() => {\n this.log.error('transaction not finished', transaction, log);\n }, 10000);\n\n /* transaction.addEventListener('abort', (e) => {\n //handleError();\n this.log.error('IndexedDB: transaction abort!', transaction.error);\n }); */\n\n const callbackResult = callback(transaction.objectStore(storeName));\n\n const isArray = Array.isArray(callbackResult);\n const requests: IDBRequest[] = isArray ? callbackResult : [].concat(callbackResult) as any;\n\n if(waitForTransactionComplete) {\n return;\n }\n\n const length = requests.length;\n let left = length;\n\n const onRequestFinished = () => {\n if(transaction.error) {\n return;\n }\n\n if(!--left) {\n onComplete(/* 'requests' */);\n }\n };\n\n for(let i = 0; i < length; ++i) {\n const request = requests[i];\n request.onerror = onError;\n request.onsuccess = onRequestFinished;\n }\n });\n });\n }\n\n public getAll(storeName?: StoreName): Promise {\n return this.getObjectStore('readonly', (objectStore) => objectStore.getAll(), DEBUG ? 'getAll' : '', storeName);\n }\n\n /* public getAllKeys(): Promise> {\n console.time('getAllEntries');\n return this.openDatabase().then((db) => {\n var objectStore = db.transaction([this.storeName], 'readonly')\n .objectStore(this.storeName);\n var request = objectStore.getAllKeys();\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n // @ts-ignore\n var result = event.target.result;\n resolve(result);\n console.timeEnd('getAllEntries');\n }\n\n request.onerror = reject;\n });\n });\n } */\n\n /* public isFileExists(fileName: string): Promise {\n console.time('isFileExists');\n return this.openDatabase().then((db) => {\n var objectStore = db.transaction([this.storeName], 'readonly')\n .objectStore(this.storeName);\n var request = objectStore.openCursor(fileName);\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n // @ts-ignore\n var cursor = event.target.result;\n resolve(!!cursor);\n console.timeEnd('isFileExists');\n }\n\n request.onerror = reject;\n });\n });\n } */\n\n /* public getFileWriter(fileName: string, mimeType: string) {\n var fakeWriter = FileManager.getFakeFileWriter(mimeType, (blob) => {\n return this.saveFile(fileName, blob);\n });\n\n return Promise.resolve(fakeWriter);\n } */\n}\n","import type ENVIRONMENT from '.';\n\nlet environment: typeof ENVIRONMENT;\nexport function getEnvironment() {\n return environment;\n}\n\nexport function setEnvironment(env: typeof environment) {\n return environment = env;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Message, StickerSet, Update, NotifyPeer, PeerNotifySettings, PollResults, Poll, WebPage, GroupCall, GroupCallParticipant, ReactionCount, MessagePeerReaction, PhoneCall, Config, Reaction} from '../layer';\nimport type {Dialog, ForumTopic, MessagesStorageKey, MyMessage} from './appManagers/appMessagesManager';\nimport type {MyDialogFilter} from './storages/filters';\nimport type {Folder} from './storages/dialogs';\nimport type {UserTyping} from './appManagers/appProfileManager';\nimport type {MyDraftMessage} from './appManagers/appDraftsManager';\nimport type {ConnectionStatusChange} from './mtproto/connectionStatus';\nimport type {GroupCallId} from './appManagers/appGroupCallsManager';\nimport type {AppManagers} from './appManagers/managers';\nimport type {State} from '../config/state';\nimport type {Progress} from './appManagers/appDownloadManager';\nimport type {CallId} from './appManagers/appCallsManager';\nimport type {MyDocument} from './appManagers/appDocsManager';\nimport type {MTAppConfig} from './mtproto/appConfig';\nimport {NULL_PEER_ID, UserAuth} from './mtproto/mtproto_config';\nimport EventListenerBase from '../helpers/eventListenerBase';\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport MTProtoMessagePort from './mtproto/mtprotoMessagePort';\nimport {IS_WORKER} from '../helpers/context';\n\nexport type BroadcastEvents = {\n 'chat_full_update': ChatId,\n 'chat_update': ChatId,\n 'chat_toggle_forum': {chatId: ChatId, enabled: boolean},\n 'chat_participant': Update.updateChannelParticipant,\n\n 'channel_update': ChatId,\n\n 'user_update': UserId,\n 'user_auth': UserAuth,\n 'user_full_update': UserId,\n\n 'peer_pinned_messages': {peerId: PeerId, mids?: number[], pinned?: boolean, unpinAll?: true},\n 'peer_pinned_hidden': {peerId: PeerId, maxId: number},\n 'peer_typings': {peerId: PeerId, threadId?: number, typings: UserTyping[]},\n 'peer_block': {peerId: PeerId, blocked: boolean},\n 'peer_title_edit': {peerId: PeerId, threadId?: number},\n 'peer_bio_edit': PeerId,\n 'peer_deleted': PeerId, // left chat, deleted user dialog, left channel\n 'peer_full_update': PeerId,\n\n 'filter_delete': MyDialogFilter,\n 'filter_update': MyDialogFilter,\n 'filter_new': MyDialogFilter,\n 'filter_order': number[],\n\n 'folder_unread': Omit,\n\n 'dialog_draft': {peerId: PeerId, dialog: Dialog | ForumTopic, drop: boolean, draft: MyDraftMessage | undefined},\n 'dialog_unread': {peerId: PeerId, dialog: Dialog | ForumTopic},\n 'dialog_flush': {peerId: PeerId, dialog: Dialog},\n 'dialog_drop': Dialog | ForumTopic,\n 'dialog_migrate': {migrateFrom: PeerId, migrateTo: PeerId},\n // 'dialog_top': Dialog,\n 'dialog_notify_settings': Dialog | ForumTopic,\n // 'dialog_order': {dialog: Dialog, pos: number},\n 'dialogs_multiupdate': Map}>,\n\n 'history_append': {storageKey: MessagesStorageKey, message: Message.message},\n 'history_update': {storageKey: MessagesStorageKey, message: MyMessage, sequential?: boolean},\n 'history_reply_markup': {peerId: PeerId},\n 'history_multiappend': MyMessage,\n 'history_delete': {peerId: PeerId, msgs: Set},\n 'history_forbidden': PeerId,\n 'history_reload': PeerId,\n // 'history_request': void,\n\n 'message_edit': {storageKey: MessagesStorageKey, peerId: PeerId, mid: number, message: MyMessage},\n 'message_sent': {storageKey: MessagesStorageKey, tempId: number, tempMessage: any, mid: number, message: MyMessage},\n 'message_error': {storageKey: MessagesStorageKey, tempId: number, error: ApiError},\n 'message_transcribed': {peerId: PeerId, mid: number, text: string, pending?: boolean},\n 'messages_views': {peerId: PeerId, mid: number, views: number}[],\n 'messages_reactions': {message: Message.message, changedResults: ReactionCount[]}[],\n 'messages_pending': void,\n 'messages_read': void,\n 'messages_downloaded': {peerId: PeerId, mids: number[]},\n 'messages_media_read': {peerId: PeerId, mids: number[]},\n\n 'replies_updated': Message.message,\n\n 'scheduled_new': Message.message,\n 'scheduled_delete': {peerId: PeerId, mids: number[]},\n\n 'album_edit': {peerId: PeerId, groupId: string, deletedMids: number[], messages: Message.message[]},\n\n 'stickers_installed': StickerSet.stickerSet,\n 'stickers_deleted': StickerSet.stickerSet,\n 'stickers_updated': {type: 'recent' | 'faved', stickers: MyDocument[]},\n 'stickers_top': Long,\n 'stickers_order': {type: 'masks' | 'emojis' | 'stickers', order: Long[]},\n 'sticker_updated': {type: 'recent' | 'faved', document: MyDocument, faved: boolean},\n\n 'state_cleared': void,\n 'state_synchronized': ChatId | void,\n 'state_synchronizing': ChatId | void,\n\n 'contacts_update': UserId,\n 'avatar_update': {peerId: PeerId, threadId?: number},\n 'poll_update': {poll: Poll, results: PollResults},\n 'invalidate_participants': ChatId,\n // 'channel_settings': {channelId: number},\n 'webpage_updated': {id: WebPage.webPage['id'], msgs: {peerId: PeerId, mid: number, isScheduled: boolean}[]},\n\n 'connection_status_change': ConnectionStatusChange,\n 'settings_updated': {key: string, value: any, settings: State['settings']},\n 'draft_updated': {peerId: PeerId, threadId: number, draft: MyDraftMessage | undefined, force?: boolean},\n\n 'background_change': void,\n\n 'privacy_update': Update.updatePrivacy,\n\n 'notify_settings': Update.updateNotifySettings,\n 'notify_peer_type_settings': {key: Exclude, settings: PeerNotifySettings},\n\n 'notification_reset': string,\n 'notification_cancel': string,\n\n 'language_change': string,\n\n 'theme_change': void,\n\n 'media_play': void,\n\n 'emoji_recent': AppEmoji,\n\n 'download_progress': Progress,\n 'document_downloading': DocId,\n 'document_downloaded': DocId,\n\n 'choosing_sticker': boolean\n\n 'group_call_update': GroupCall,\n 'group_call_participant': {groupCallId: GroupCallId, participant: GroupCallParticipant},\n // 'group_call_video_track_added': {instance: GroupCallInstance}\n\n 'call_update': PhoneCall,\n 'call_signaling': {callId: CallId, data: Uint8Array},\n\n 'quick_reaction': Reaction,\n\n 'service_notification': Update.updateServiceNotification,\n\n 'logging_out': void,\n\n 'payment_sent': {peerId: PeerId, mid: number, receiptMessage: Message.messageService}\n\n 'premium_toggle': boolean,\n 'premium_toggle_private': {isNew: boolean, isPremium: boolean},\n\n 'config': Config,\n 'app_config': MTAppConfig\n};\n\nexport type BroadcastEventsListeners = {\n [name in keyof BroadcastEvents]: (e: BroadcastEvents[name]) => void\n};\n\nexport class RootScope extends EventListenerBase {\n public myId: PeerId;\n private connectionStatus: {[name: string]: ConnectionStatusChange};\n public settings: State['settings'];\n public managers: AppManagers;\n public premium: boolean;\n\n constructor() {\n super();\n\n this.myId = NULL_PEER_ID;\n this.connectionStatus = {};\n this.premium = false;\n\n this.addEventListener('user_auth', ({id}) => {\n this.myId = id.toPeerId();\n });\n\n this.addEventListener('premium_toggle_private', ({isNew, isPremium}) => {\n this.premium = isPremium;\n this.dispatchEventSingle('premium_toggle', isPremium);\n });\n\n this.addEventListener('connection_status_change', (status) => {\n this.connectionStatus[status.name] = status;\n });\n\n this.dispatchEvent = (e, ...args) => {\n super.dispatchEvent(e, ...args);\n MTProtoMessagePort.getInstance().invokeVoid('event', {name: e as string, args});\n };\n\n if(!IS_WORKER) {\n this.addEventListener('settings_updated', ({settings}) => {\n this.settings = settings;\n });\n }\n }\n\n public getConnectionStatus() {\n return this.connectionStatus;\n }\n\n public getPremium() {\n return this.premium;\n }\n\n public dispatchEventSingle(...args: any[]) {\n // @ts-ignore\n super.dispatchEvent(...args);\n }\n}\n\nconst rootScope = new RootScope();\nMOUNT_CLASS_TO.rootScope = rootScope;\nexport default rootScope;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {State} from '../../config/state';\nimport rootScope from '../rootScope';\nimport stateStorage from '../stateStorage';\nimport setDeepProperty from '../../helpers/object/setDeepProperty';\nimport MTProtoMessagePort from '../mtproto/mtprotoMessagePort';\n\nexport class AppStateManager {\n private state: State = {} as any;\n private storage = stateStorage;\n\n // ! for mtproto worker use only\n public newVersion: string;\n public oldVersion: string;\n public userId: UserId;\n\n public getState() {\n return Promise.resolve(this.state);\n }\n\n public setByKey(key: string, value: any) {\n setDeepProperty(this.state, key, value);\n\n const first = key.split('.')[0] as keyof State;\n if(first === 'settings') {\n rootScope.dispatchEvent('settings_updated', {key, value, settings: this.state.settings});\n }\n\n this.pushToState(first, this.state[first]);\n }\n\n public pushToState(key: T, value: State[T], direct = true, onlyLocal?: boolean) {\n if(direct) {\n this.state[key] = value;\n }\n\n this.setKeyValueToStorage(key, value, onlyLocal);\n }\n\n public setKeyValueToStorage(key: T, value: State[T] = this.state[key], onlyLocal?: boolean) {\n MTProtoMessagePort.getInstance().invokeVoid('mirror', {name: 'state', key, value});\n\n this.storage.set({\n [key]: value\n }, onlyLocal);\n }\n\n /* public resetState() {\n for(let i in this.state) {\n // @ts-ignore\n this.state[i] = false;\n }\n sessionStorage.set(this.state).then(() => {\n location.reload();\n });\n } */\n}\n\nconst appStateManager = new AppStateManager();\nexport default appStateManager;\n","import getDeepProperty from './getDeepProperty';\n\nexport default function setDeepProperty(object: any, key: string, value: any) {\n const splitted = key.split('.');\n getDeepProperty(object, splitted.slice(0, -1).join('.'))[splitted.pop()] = value;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport pause from '../../../helpers/schedulers/pause';\nimport {DcId} from '../../../types';\nimport {logger, LogTypes} from '../../logger';\nimport type MTPNetworker from '../networker';\nimport MTTransport from './transport';\nimport Modes from '../../../config/modes';\n\n \nimport transportController from './controller';\n// import networkStats from '../networkStats';\n \n\nexport default class HTTP implements MTTransport {\n public networker: MTPNetworker;\n private log: ReturnType;\n\n private pending: Array<{\n resolve: (body: Uint8Array) => void,\n reject: any,\n body: Uint8Array\n }> = [];\n private releasing: boolean;\n\n public connected: boolean;\n private destroyed: boolean;\n private debug: boolean;\n\n constructor(protected dcId: DcId, protected url: string, logSuffix: string) {\n this.debug = Modes.debug && false;\n\n let logTypes = LogTypes.Error | LogTypes.Log;\n if(this.debug) logTypes |= LogTypes.Debug;\n\n this.log = logger(`HTTP-${dcId}` + logSuffix, logTypes);\n this.log('constructor');\n\n this.connected = false;\n }\n\n public _send(body: Uint8Array, mode?: RequestMode) {\n const length = body.length;\n this.debug && this.log.debug('-> body length to send:', length);\n\n // networkStats.addSent(this.dcId, length);\n return fetch(this.url, {method: 'POST', body, mode}).then((response) => {\n if(response.status !== 200 && !mode) {\n response.arrayBuffer().then((buffer) => {\n this.log.error('not 200',\n new TextDecoder('utf-8').decode(new Uint8Array(buffer)));\n });\n\n throw response;\n }\n\n this.setConnected(true);\n\n // * test resending by dropping random request\n // if(Math.random() > .5) {\n // throw 'asd';\n // }\n\n return response.arrayBuffer().then((buffer) => {\n // networkStats.addReceived(this.dcId, buffer.byteLength);\n return new Uint8Array(buffer);\n });\n }, (err) => {\n this.setConnected(false);\n throw err;\n });\n }\n\n private setConnected(connected: boolean) {\n if(this.connected === connected || this.destroyed) {\n return;\n }\n\n this.connected = connected;\n\n \n transportController.setTransportValue('https', connected);\n \n }\n\n public destroy() {\n this.setConnected(false);\n this.destroyed = true;\n this.pending.forEach((pending) => pending.reject());\n this.pending.length = 0;\n }\n\n public send(body: Uint8Array) {\n if(this.networker) {\n return this._send(body);\n } else {\n const promise = new Promise((resolve, reject) => {\n this.pending.push({resolve, reject, body});\n });\n\n this.releasePending();\n\n return promise;\n }\n }\n\n private async releasePending() {\n if(this.releasing) return;\n\n this.releasing = true;\n // this.log('-> messages to send:', this.pending.length);\n for(let i = 0; i < this.pending.length; ++i) {\n const pending = this.pending[i];\n const {body, resolve} = pending;\n\n try {\n const result = await this._send(body);\n resolve(result);\n this.pending.splice(i, 1);\n } catch(err) {\n this.log.error('Send plain request error:', err);\n await pause(5000);\n }\n\n --i;\n }\n\n this.releasing = false;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {logger, LogTypes} from '../../logger';\nimport Modes from '../../../config/modes';\nimport EventListenerBase from '../../../helpers/eventListenerBase';\nimport {MTConnection} from './transport';\n\n// let closeSocketBefore = Date.now() + 30e3;\n// let closeSocketAfter = Date.now() + 10e3;\n\nexport default class Socket extends EventListenerBase<{\n open: () => void,\n message: (buffer: ArrayBuffer) => any,\n close: () => void,\n}> implements MTConnection {\n private ws: WebSocket;\n private log: ReturnType;\n private debug = Modes.debug && false;\n\n constructor(protected dcId: number, protected url: string, logSuffix: string) {\n super();\n\n let logTypes = LogTypes.Error | LogTypes.Log;\n if(this.debug) logTypes |= LogTypes.Debug;\n this.log = logger(`WS-${dcId}` + logSuffix, logTypes);\n this.log('constructor');\n this.connect();\n\n return this;\n }\n\n private removeListeners() {\n if(!this.ws) {\n return;\n }\n\n this.ws.removeEventListener('open', this.handleOpen);\n this.ws.removeEventListener('close', this.handleClose);\n this.ws.removeEventListener('error', this.handleError);\n this.ws.removeEventListener('message', this.handleMessage);\n this.ws = undefined;\n }\n\n private connect() {\n this.ws = new WebSocket(this.url, 'binary');\n this.ws.binaryType = 'arraybuffer';\n this.ws.addEventListener('open', this.handleOpen);\n this.ws.addEventListener('close', this.handleClose);\n this.ws.addEventListener('error', this.handleError);\n this.ws.addEventListener('message', this.handleMessage);\n\n // if(Date.now() < closeSocketBefore) {\n // if(Date.now() >= closeSocketAfter) {\n // this.ws.close();\n // }\n }\n\n public close() {\n if(!this.ws) {\n return;\n }\n\n this.log('close execution');\n\n try {\n this.ws.close();\n } catch(err) {\n\n }\n this.handleClose();\n }\n\n private handleOpen = () => {\n this.log('opened');\n\n this.debug && this.log.debug('sending init packet');\n this.dispatchEvent('open');\n };\n\n private handleError = (e: Event) => {\n this.log.error('handleError', e);\n this.close();\n };\n\n private handleClose = (e?: CloseEvent) => {\n this.log('closed', e/* , this.pending, this.ws.bufferedAmount */);\n\n this.removeListeners();\n this.dispatchEvent('close');\n };\n\n private handleMessage = (event: MessageEvent) => {\n this.debug && this.log.debug('<-', 'handleMessage', /* event, */event.data.byteLength);\n\n this.dispatchEvent('message', event.data as ArrayBuffer);\n };\n\n public send = (body: Uint8Array) => {\n this.debug && this.log.debug('-> body length to send:', body.length);\n\n this.ws.send(body);\n };\n}\n","export default function randomize(arr: T) {\n if(crypto && 'getRandomValues' in crypto) {\n crypto.getRandomValues(arr);\n } else {\n throw new Error('NO_SECURE_RANDOM');\n }\n\n return arr;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import aesjs from 'aes-js';\nimport randomize from '../../../helpers/array/randomize';\nimport cryptoMessagePort from '../../crypto/cryptoMessagePort';\nimport {Codec} from './codec';\n\n/*\n@cryptography/aes не работает с массивами которые не кратны 4, поэтому использую intermediate а не abridged\n*/\nexport default class Obfuscation {\n /* private enc: aesjs.ModeOfOperation.ModeOfOperationCTR;\n private dec: aesjs.ModeOfOperation.ModeOfOperationCTR; */\n\n private id: number;\n private idPromise: Promise;\n private process: (data: Uint8Array, operation: 'encrypt' | 'decrypt') => ReturnType;\n\n // private cryptoEncKey: CryptoKey;\n // private cryptoDecKey: CryptoKey;\n // private cryptoKey: CryptoKey;\n\n // private encIv: Uint8Array;\n // private decIv: Uint8Array;\n\n // private decIvCounter: Counter;\n\n public async init(codec: Codec) {\n if(this.idPromise !== undefined) {\n this.release();\n }\n\n const initPayload = new Uint8Array(64);\n randomize(initPayload);\n\n while(true) {\n const val = (initPayload[3] << 24) | (initPayload[2] << 16) | (initPayload[1] << 8) | initPayload[0];\n const val2 = (initPayload[7] << 24) | (initPayload[6] << 16) | (initPayload[5] << 8) | initPayload[4];\n if(initPayload[0] !== 0xef &&\n val !== 0x44414548 &&\n val !== 0x54534f50 &&\n val !== 0x20544547 &&\n val !== 0x4954504f &&\n val !== 0xeeeeeeee &&\n val !== 0xdddddddd &&\n val2 !== 0x00000000) {\n // initPayload[56] = initPayload[57] = initPayload[58] = initPayload[59] = transport;\n break;\n }\n randomize(initPayload);\n }\n\n // //////////////////////initPayload.subarray(60, 62).hex = dcId;\n /* initPayload.set(new Uint8Array([161, 208, 67, 71, 118, 109, 20, 111, 113, 255, 134, 10, 159, 241, 7, 44, 217, 82, 187, 76, 108, 131, 200, 186, 33, 57, 177, 251, 52, 34, 18, 54, 65, 105, 37, 89, 38, 20, 47, 168, 126, 181, 24, 138, 212, 68, 60, 150, 225, 37, 181, 4, 201, 50, 72, 151, 168, 143, 204, 169, 81, 187, 241, 23]));\n console.log('initPayload', initPayload); */\n\n const reversedPayload = initPayload.slice().reverse();\n\n const encKey = initPayload.slice(8, 40);\n const encIv = /* this.encIv = */initPayload.slice(40, 56);\n const decKey = reversedPayload.slice(8, 40);\n const decIv = /* this.decIv = */reversedPayload.slice(40, 56);\n\n /* this.enc = new aesjs.ModeOfOperation.ctr(encKey, new aesjs.Counter(encIv as any));\n this.dec = new aesjs.ModeOfOperation.ctr(decKey, new aesjs.Counter(decIv as any)); */\n\n // console.log('encKey', encKey.hex, encIv.hex);\n // console.log('decKey', decKey.hex, decIv.hex);\n\n const idPromise = this.idPromise = cryptoMessagePort.invokeCrypto('aes-ctr-prepare', {\n encKey,\n encIv,\n decKey,\n decIv\n });\n\n this.process = async(data, operation) => {\n await idPromise;\n return this._process(data, operation);\n };\n\n this.id = await idPromise;\n\n this.process = this._process;\n\n // this.decIvCounter = new Counter(this.decIv);\n /* const key = this.cryptoEncKey = await subtle.importKey(\n 'raw',\n encKey,\n {name: 'AES-CTR'},\n false,\n ['encrypt']\n ); */\n\n // this.cryptoDecKey = await subtle.importKey(\n // 'raw',\n // decKey,\n // {name: 'AES-CTR'},\n // false,\n // ['encrypt']\n // );\n\n // this.cryptoKey = await subtle.importKey(\n // 'raw',\n // encKey,\n // {name: 'AES-CTR'},\n // false,\n // ['encrypt', 'decrypt']\n // );\n\n initPayload.set(codec.obfuscateTag, 56);\n const encrypted = await this.encode(initPayload.slice());\n\n // console.log('encrypted', encrypted);\n\n initPayload.set(encrypted.slice(56, 64), 56);\n\n return initPayload;\n }\n\n /* public encode(payload: Uint8Array) {\n let startTime = performance.now();\n let res = this.enc.encrypt(payload);\n let time = performance.now() - startTime;\n\n try {\n startTime = performance.now();\n let arr = this.encNew.encrypt(payload);\n //let resNew = bytesFromWords({words: arr, sigBytes: arr.length});\n let resNew = new Uint8Array(bytesFromWordss(arr));\n let time2 = performance.now() - startTime;\n console.log('Obfuscation: encode comparison:', res, arr, resNew, res.hex === resNew.hex, time2 < time);\n } catch(err) {\n console.error('Obfuscation: error:', err);\n }\n\n return res;\n }\n\n public decode(payload: Uint8Array) {\n let res = this.dec.encrypt(payload);\n\n try {\n let arr = this.decNew.decrypt(payload);\n //let resNew = bytesFromWords({words: arr, sigBytes: arr.length});\n let resNew = new Uint8Array(bytesFromWordss(arr));\n console.log('Obfuscation: decode comparison:', res, arr, resNew, res.hex === resNew.hex);\n } catch(err) {\n console.error('Obfuscation: error:', err);\n }\n\n return res;\n } */\n\n private _process = (data: Uint8Array, operation: 'encrypt' | 'decrypt') => {\n return cryptoMessagePort.invokeCryptoNew({\n method: 'aes-ctr-process',\n args: [{id: this.id, data, operation}],\n transfer: [data.buffer]\n }) as Promise;\n };\n\n public encode(payload: Uint8Array) {\n /* return subtle.encrypt({\n name: 'AES-CTR',\n counter: this.encIv,\n length: 64\n },\n this.cryptoEncKey,\n payload\n ); */\n return this.process(payload, 'encrypt');\n }\n\n public decode(payload: Uint8Array) {\n return this.process(payload, 'decrypt');\n }\n\n public async release() {\n const idPromise = this.idPromise;\n if(idPromise === undefined) {\n return;\n }\n\n this.id = undefined;\n this.idPromise = undefined;\n\n const id = await idPromise;\n cryptoMessagePort.invokeCrypto('aes-ctr-destroy', id);\n }\n\n public destroy() {\n this.release();\n }\n\n // public encode(payload: Uint8Array) {\n // let res = this.encNew.encrypt(payload);\n // let bytes = new Uint8Array(bytesFromWordss(res));\n\n // return bytes;\n // }\n\n // public async decode(payload: Uint8Array) {\n // const counter = this.decIvCounter.counter.slice();\n // this.decIvCounter.increment();\n\n // const n: ArrayBuffer = await subtle.encrypt({\n // name: 'AES-CTR',\n // counter: counter,\n // length: 64\n // },\n // this.cryptoDecKey,\n // payload\n // );\n\n // const decoded = this.decNew.update(payload);\n\n // console.log('decode', bytesToHex(decoded), 'new', n, bytesToHex(new Uint8Array(n)));\n\n // return decoded;\n // }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import { bytesFromHex, addPadding } from \"../../bin_utils\";\nimport {Codec} from './codec';\n\nclass AbridgedPacketCodec implements Codec {\n public tag = 0xef;\n public obfuscateTag = new Uint8Array([this.tag, this.tag, this.tag, this.tag]);\n\n public encodePacket(data: Uint8Array) {\n const len = data.byteLength >> 2;\n let header: Uint8Array;\n if(len < 127) {\n header = new Uint8Array([len]);\n } else { // Length: payload length, divided by four, and encoded as 3 length bytes (little endian)\n // header = new Uint8Array([0x7f, ...addPadding(bytesFromHex(len.toString(16)).reverse(), 3, true)/* .reverse() */]);\n header = new Uint8Array([0x7f, len & 0xFF, (len >> 8) & 0xFF, (len >> 16) & 0xFF]);\n // console.log('got nobody cause im braindead', header, len);\n }\n\n return header.concat(data);\n // return new Uint8Array([...header, ...data]);\n }\n\n public readPacket(data: Uint8Array) {\n let length = data[0];\n if(length >= 127) { // 0x7f\n length = data[1] | (data[2] << 8) | (data[3] << 16);\n\n return data.slice(4, length << 2 + 1); // need +1\n }\n\n return data.slice(1, length << 2 + 1); // need +1\n }\n}\n\nexport default new AbridgedPacketCodec();\n","export default function bytesToHex(bytes: ArrayLike) {\n const length = bytes.length;\n const arr: string[] = new Array(length);\n for(let i = 0; i < length; ++i) {\n arr[i] = (bytes[i] < 16 ? '0' : '') + (bytes[i] || 0).toString(16);\n }\n return arr.join('');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Modes from '../../../config/modes';\nimport {logger, LogTypes} from '../../logger';\nimport MTPNetworker from '../networker';\nimport Obfuscation from './obfuscation';\nimport MTTransport, {MTConnection, MTConnectionConstructable} from './transport';\n// import intermediatePacketCodec from './intermediate';\nimport abridgedPacketCodec from './abridged';\n// import paddedIntermediatePacketCodec from './padded';\nimport {ConnectionStatus} from '../connectionStatus';\n\n \nimport transportController from './controller';\nimport bytesToHex from '../../../helpers/bytes/bytesToHex';\n// import networkStats from '../networkStats';\nimport ctx from '../../../environment/ctx';\n \n\nexport default class TcpObfuscated implements MTTransport {\n private codec = abridgedPacketCodec;\n private obfuscation = new Obfuscation();\n public networker: MTPNetworker;\n\n private pending: Array> = [];\n\n private debug = Modes.debug && false/* true */;\n private log: ReturnType;\n public connected = false;\n private lastCloseTime: number;\n public connection: MTConnection;\n\n private autoReconnect = true;\n private reconnectTimeout: number;\n private releasingPending: boolean;\n\n // private debugPayloads: MTPNetworker['debugRequests'] = [];\n\n constructor(\n private Connection: MTConnectionConstructable,\n private dcId: number,\n private url: string,\n private logSuffix: string,\n private retryTimeout: number\n ) {\n let logTypes = LogTypes.Error | LogTypes.Log;\n if(this.debug) logTypes |= LogTypes.Debug;\n this.log = logger(`TCP-${dcId}` + logSuffix, logTypes);\n this.log('constructor');\n\n this.connect();\n }\n\n private onOpen = async() => {\n this.connected = true;\n\n \n transportController.setTransportOpened('websocket');\n \n\n const initPayload = await this.obfuscation.init(this.codec);\n if(!this.connected) {\n return;\n }\n\n this.connection.send(initPayload);\n\n if(this.networker) {\n this.pending.length = 0; // ! clear queue and reformat messages to container, because if sending simultaneously 10+ messages, connection will die\n this.networker.setConnectionStatus(ConnectionStatus.Connected);\n this.networker.cleanupSent();\n this.networker.resend();\n }/* else {\n for(const pending of this.pending) {\n if(pending.encoded && pending.body) {\n pending.encoded = this.encodeBody(pending.body);\n }\n }\n } */\n\n setTimeout(() => {\n this.releasePending();\n }, 0);\n };\n\n private onMessage = async(buffer: ArrayBuffer) => {\n // networkStats.addReceived(this.dcId, buffer.byteLength);\n\n let data = await this.obfuscation.decode(new Uint8Array(buffer));\n data = this.codec.readPacket(data);\n\n if(this.networker) { // authenticated!\n // this.pending = this.pending.filter((p) => p.body); // clear pending\n\n this.debug && this.log.debug('redirecting to networker', data.length);\n this.networker.parseResponse(data).then((response) => {\n this.debug && this.log.debug('redirecting to networker response:', response);\n\n try {\n this.networker.processMessage(response.response, response.messageId, response.sessionId);\n } catch(err) {\n this.log.error('handleMessage networker processMessage error', err);\n }\n\n // this.releasePending();\n }).catch((err) => {\n this.log.error('handleMessage networker parseResponse error', err);\n });\n\n // this.dd();\n return;\n }\n\n // console.log('got hex:', data.hex);\n const pending = this.pending.shift();\n if(!pending) {\n this.debug && this.log.debug('no pending for res:', bytesToHex(data));\n return;\n }\n\n pending.resolve(data);\n };\n\n private onClose = () => {\n this.clear();\n\n let needTimeout: number, retryAt: number;\n if(this.autoReconnect) {\n const time = Date.now();\n const diff = time - this.lastCloseTime;\n needTimeout = !isNaN(diff) && diff < this.retryTimeout ? this.retryTimeout - diff : 0;\n retryAt = time + needTimeout;\n }\n\n if(this.networker) {\n this.networker.setConnectionStatus(ConnectionStatus.Closed, retryAt);\n this.pending.length = 0;\n }\n\n if(this.autoReconnect) {\n this.log('will try to reconnect after timeout:', needTimeout / 1000);\n this.reconnectTimeout = ctx.setTimeout(this.reconnect, needTimeout);\n } else {\n this.log('reconnect isn\\'t needed');\n }\n };\n\n public clear() {\n \n if(this.connected) {\n transportController.setTransportClosed('websocket');\n }\n \n\n this.connected = false;\n\n if(this.connection) {\n this.connection.removeEventListener('open', this.onOpen);\n this.connection.removeEventListener('close', this.onClose);\n this.connection.removeEventListener('message', this.onMessage);\n this.connection = undefined;\n }\n }\n\n /**\n * invoke only when closed\n */\n public reconnect = () => {\n if(this.reconnectTimeout !== undefined) {\n clearTimeout(this.reconnectTimeout);\n this.reconnectTimeout = undefined;\n }\n\n if(this.connection) {\n return;\n }\n\n this.log('trying to reconnect...');\n this.lastCloseTime = Date.now();\n\n if(!this.networker) {\n for(const pending of this.pending) {\n if(pending.bodySent) {\n pending.bodySent = false;\n }\n }\n } else {\n this.networker.setConnectionStatus(ConnectionStatus.Connecting);\n }\n\n this.connect();\n }\n\n public forceReconnect() {\n this.close();\n this.reconnect();\n }\n\n public destroy() {\n this.setAutoReconnect(false);\n this.close();\n\n if(this.obfuscation) {\n this.obfuscation.destroy();\n }\n\n this.pending.forEach((pending) => {\n if(pending.reject) {\n pending.reject();\n }\n });\n this.pending.length = 0;\n }\n\n public close() {\n const connection = this.connection;\n if(connection) {\n const connected = this.connected;\n this.clear();\n if(connected) { // wait for buffered messages if they are there\n connection.addEventListener('message', this.onMessage);\n connection.addEventListener('close', () => {\n connection.removeEventListener('message', this.onMessage);\n }, {once: true});\n connection.close();\n }\n }\n }\n\n /**\n * Will connect if enable and disconnected \\\n * Will reset reconnection timeout if disable\n */\n public setAutoReconnect(enable: boolean) {\n this.autoReconnect = enable;\n\n if(!enable) {\n if(this.reconnectTimeout !== undefined) {\n clearTimeout(this.reconnectTimeout);\n this.reconnectTimeout = undefined;\n }\n } else if(!this.connection && this.reconnectTimeout === undefined) {\n this.reconnect();\n }\n }\n\n private connect() {\n if(this.connection) {\n this.close();\n }\n\n this.connection = new this.Connection(this.dcId, this.url, this.logSuffix);\n this.connection.addEventListener('open', this.onOpen);\n this.connection.addEventListener('close', this.onClose);\n this.connection.addEventListener('message', this.onMessage);\n }\n\n public changeUrl(url: string) {\n if(this.url === url) {\n return;\n }\n\n this.url = url;\n this.forceReconnect();\n }\n\n private encodeBody(body: Uint8Array) {\n const toEncode = this.codec.encodePacket(body);\n\n // this.log('send before obf:', /* body.hex, nonce.hex, */ toEncode.hex);\n const encoded = this.obfuscation.encode(toEncode);\n // this.log('send after obf:', enc.hex);\n\n return encoded;\n }\n\n public send(body: Uint8Array) {\n this.debug && this.log.debug('-> body length to pending:', body.length);\n\n const encoded: typeof body = /* this.connected ? this.encodeBody(body) : */undefined;\n\n // return;\n\n if(this.networker) {\n this.pending.push({body, encoded});\n this.releasePending();\n } else {\n const promise = new Promise((resolve, reject) => {\n this.pending.push({resolve, reject, body, encoded});\n });\n\n this.releasePending();\n\n return promise;\n }\n }\n\n private async releasePending(/* tt = false */) {\n if(!this.connected || this.releasingPending) {\n // this.connect();\n return;\n }\n\n this.releasingPending = true;\n\n /* if(!tt) {\n this.releasePendingDebounced();\n return;\n } */\n\n // this.log('-> messages to send:', this.pending.length);\n let length = this.pending.length;\n let sent = false;\n // for(let i = length - 1; i >= 0; --i) {\n for(let i = 0; i < length; ++i) {\n const pending = this.pending[i];\n if(!pending) {\n break;\n }\n\n const {body, bodySent} = pending;\n if(body && !bodySent) {\n // this.debugPayloads.push({before: body.slice(), after: enc});\n\n this.debug && this.log.debug('-> body length to send:', body.length);\n\n // if(!encoded) {\n // encoded = pending.encoded = this.encodeBody(body);\n // }\n\n const encoded = pending.encoded ??= await this.encodeBody(body);\n if(!this.connected) {\n break;\n }\n\n // networkStats.addSent(this.dcId, encoded.byteLength);\n this.connection.send(encoded);\n\n if(!pending.resolve) { // remove if no response needed\n this.pending.splice(i--, 1);\n length--;\n } else {\n pending.bodySent = true;\n }\n\n sent = true;\n // delete pending.body;\n }\n }\n\n this.releasingPending = undefined;\n\n if(this.pending.length && sent) {\n this.releasePending();\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport MTTransport, {MTConnectionConstructable} from './transports/transport';\nimport Modes from '../../config/modes';\nimport App from '../../config/app';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\n\n \nimport HTTP from './transports/http';\n \n\n \nimport Socket from './transports/websocket';\nimport TcpObfuscated from './transports/tcpObfuscated';\nimport {IS_WEB_WORKER} from '../../helpers/context';\nimport {DcId} from '../../types';\nimport {getEnvironment} from '../../environment/utils';\n\n \n \n \n\n \n\nexport type TransportType = 'websocket' | 'https' | 'http';\nexport type ConnectionType = 'client' | 'download' | 'upload';\ntype Servers = {\n [transportType in TransportType]: {\n [connectionType in ConnectionType]: {\n [dcId: DcId]: MTTransport[]\n }\n }\n};\n\nconst TEST_SUFFIX = Modes.test ? '_test' : '';\nconst PREMIUM_SUFFIX = '_premium';\n\nexport function getTelegramConnectionSuffix(connectionType: ConnectionType) {\n return connectionType === 'client' ? '' : '-1';\n}\n\n \nexport function constructTelegramWebSocketUrl(dcId: DcId, connectionType: ConnectionType, premium?: boolean) {\n const suffix = getTelegramConnectionSuffix(connectionType);\n const path = connectionType !== 'client' ? 'apiws' + TEST_SUFFIX + (premium ? PREMIUM_SUFFIX : '') : ('apiws' + TEST_SUFFIX);\n const chosenServer = `wss://${App.suffix.toLowerCase()}ws${dcId}${suffix}.web.telegram.org/${path}`;\n\n return chosenServer;\n}\n \n\nexport class DcConfigurator {\n private sslSubdomains = ['pluto', 'venus', 'aurora', 'vesta', 'flora'];\n\n private dcOptions = Modes.test ?\n [\n {id: 1, host: '149.154.175.10', port: 80},\n {id: 2, host: '149.154.167.40', port: 80},\n {id: 3, host: '149.154.175.117', port: 80}\n ] :\n [\n {id: 1, host: '149.154.175.50', port: 80},\n {id: 2, host: '149.154.167.50', port: 80},\n {id: 3, host: '149.154.175.100', port: 80},\n {id: 4, host: '149.154.167.91', port: 80},\n {id: 5, host: '149.154.171.5', port: 80}\n ];\n\n public chosenServers: Servers = {} as any;\n\n \n private transportSocket = (dcId: DcId, connectionType: ConnectionType, premium?: boolean) => {\n const chosenServer = constructTelegramWebSocketUrl(dcId, connectionType, premium);\n const logSuffix = connectionType === 'upload' ? '-U' : connectionType === 'download' ? '-D' : '';\n\n const retryTimeout = connectionType === 'client' ? 10000 : 10000;\n\n let oooohLetMeLive: MTConnectionConstructable;\n \n oooohLetMeLive = Socket;\n \n \n \n\n return new TcpObfuscated(oooohLetMeLive, dcId, chosenServer, logSuffix, retryTimeout);\n };\n \n\n \n private transportHTTP = (dcId: DcId, connectionType: ConnectionType, premium?: boolean) => {\n let chosenServer: string;\n if(Modes.ssl || !Modes.http) {\n const suffix = getTelegramConnectionSuffix(connectionType);\n const subdomain = this.sslSubdomains[dcId - 1] + suffix;\n const path = Modes.test ? 'apiw_test1' : 'apiw1';\n chosenServer = 'https://' + subdomain + '.web.telegram.org/' + path;\n } else {\n for(const dcOption of this.dcOptions) {\n if(dcOption.id === dcId) {\n chosenServer = 'http://' + dcOption.host + (dcOption.port !== 80 ? ':' + dcOption.port : '') + '/apiw1';\n break;\n }\n }\n }\n\n const logSuffix = connectionType === 'upload' ? '-U' : connectionType === 'download' ? '-D' : '';\n return new HTTP(dcId, chosenServer, logSuffix);\n };\n \n\n public chooseServer(\n dcId: DcId,\n connectionType: ConnectionType = 'client',\n transportType: TransportType = Modes.transport,\n reuse = true,\n premium?: boolean\n ) {\n /* if(transportType === 'websocket' && !Modes.multipleConnections) {\n connectionType = 'client';\n } */\n\n if(!this.chosenServers.hasOwnProperty(transportType)) {\n this.chosenServers[transportType] = {\n client: {},\n download: {},\n upload: {}\n };\n }\n\n const servers = this.chosenServers[transportType][connectionType];\n\n if(!(dcId in servers)) {\n servers[dcId] = [];\n }\n\n const transports = servers[dcId];\n\n if(!transports.length || !reuse/* || (upload && transports.length < 1) */) {\n let transport: MTTransport;\n\n \n transport = (transportType === 'websocket' ? this.transportSocket : this.transportHTTP)(dcId, connectionType, premium);\n \n \n \n \n \n\n if(!transport) {\n console.error('No chosenServer!', dcId);\n return null;\n }\n\n if(reuse) {\n transports.push(transport);\n }\n\n return transport;\n }\n\n return transports[0];\n }\n\n public static removeTransport(obj: any, transport: T) {\n for(const transportType in obj) {\n // @ts-ignore\n for(const connectionType in obj[transportType]) {\n // @ts-ignore\n for(const dcId in obj[transportType][connectionType]) {\n // @ts-ignore\n const transports: T[] = obj[transportType][connectionType][dcId];\n indexOfAndSplice(transports, transport);\n }\n }\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport App from '../../../config/app';\nimport deferredPromise from '../../../helpers/cancellablePromise';\nimport EventListenerBase from '../../../helpers/eventListenerBase';\nimport pause from '../../../helpers/schedulers/pause';\nimport {TransportType, DcConfigurator} from '../dcConfigurator';\nimport type HTTP from './http';\nimport type TcpObfuscated from './tcpObfuscated';\nimport MTTransport from './transport';\n\nexport class MTTransportController extends EventListenerBase<{\n change: (opened: MTTransportController['opened']) => void,\n transport: (type: TransportType) => void\n}> {\n private opened: Map;\n private transports: {[k in TransportType]?: MTTransport};\n private pinging: boolean;\n private dcConfigurator: DcConfigurator;\n\n constructor() {\n super(true);\n\n this.opened = new Map();\n /* this.addEventListener('change', (opened) => {\n this.dispatchEvent('transport', opened.get('websocket') || !opened.get('https') ? 'websocket' : 'https');\n }); */\n\n this.addEventListener('change', (opened) => {\n if(!opened.get('websocket')) {\n this.waitForWebSocket();\n }\n });\n\n // setTimeout(() => {\n // this.waitForWebSocket();\n // }, 200); // wait for first transport so won't have delay for first WS\n }\n\n public async pingTransports() {\n const dcConfigurator = this.dcConfigurator ??= new DcConfigurator();\n const timeout = 2000;\n const transports: {[k in TransportType]?: MTTransport} = this.transports = {\n https: dcConfigurator.chooseServer(App.baseDcId, 'client', 'https', false),\n websocket: dcConfigurator.chooseServer(App.baseDcId, 'client', 'websocket', false)\n };\n\n const httpPromise = deferredPromise();\n ((this.transports.https as HTTP)._send(new Uint8Array(), 'no-cors') as any as Promise)\n .then(() => httpPromise.resolve(true), () => httpPromise.resolve(false));\n setTimeout(() => httpPromise.resolve(false), timeout);\n\n const websocketPromise = deferredPromise();\n const socket = transports.websocket as TcpObfuscated;\n socket.setAutoReconnect(false);\n socket.connection.addEventListener('close', () => websocketPromise.resolve(false), {once: true});\n socket.connection.addEventListener('open', () => websocketPromise.resolve(true), {once: true});\n setTimeout(() => {\n if(websocketPromise.isFulfilled || websocketPromise.isRejected) {\n return;\n }\n\n if(socket.connection) {\n socket.connection.close();\n }\n\n websocketPromise.resolve(false);\n }, timeout);\n\n const [isHttpAvailable, isWebSocketAvailable] = await Promise.all([httpPromise, websocketPromise]);\n\n for(const transportType in transports) {\n const transport = transports[transportType as TransportType];\n transport.destroy();\n }\n\n const result = {\n https: isHttpAvailable || this.opened.get('https') > 0,\n websocket: isWebSocketAvailable || this.opened.get('websocket') > 0\n };\n\n // result.websocket = false;\n return result;\n }\n\n public async waitForWebSocket() {\n if(this.pinging) return;\n this.pinging = true;\n\n while(true) {\n const {https, websocket} = await this.pingTransports();\n if(https || websocket) {\n this.dispatchEvent('transport', websocket || !https ? 'websocket' : 'https');\n }\n\n if(websocket) {\n break;\n }\n\n await pause(10000);\n }\n\n this.pinging = false;\n }\n\n public setTransportValue(type: TransportType, value: boolean) {\n let length = this.opened.get(type) || 0;\n length += value ? 1 : -1;\n\n this.opened.set(type, length);\n this.dispatchEvent('change', this.opened);\n }\n\n public setTransportOpened(type: TransportType) {\n return this.setTransportValue(type, true);\n }\n\n public setTransportClosed(type: TransportType) {\n return this.setTransportValue(type, false);\n }\n}\n\nconst transportController = new MTTransportController();\nexport default transportController;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport deferredPromise, {CancellablePromise} from '../../../../helpers/cancellablePromise';\nimport type {StoragesResults} from './loadStorages';\n\nconst RESET_STORAGES_PROMISE: CancellablePromise> = deferredPromise();\nexport default RESET_STORAGES_PROMISE;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {CryptoMessagePort} from '../crypto/cryptoMessagePort';\nimport type {ApiFileManager} from '../mtproto/apiFileManager';\nimport type {ApiManager} from '../mtproto/apiManager';\nimport type {Authorizer} from '../mtproto/authorizer';\nimport type {DcConfigurator} from '../mtproto/dcConfigurator';\nimport type {NetworkerFactory} from '../mtproto/networkerFactory';\nimport type {PasswordManager} from '../mtproto/passwordManager';\nimport type {ReferenceDatabase} from '../mtproto/referenceDatabase';\nimport type {TimeManager} from '../mtproto/timeManager';\nimport type {RootScope} from '../rootScope';\nimport type DialogsStorage from '../storages/dialogs';\nimport type FiltersStorage from '../storages/filters';\nimport type PeersStorage from '../storages/peers';\nimport type ThumbsStorage from '../storages/thumbs';\nimport type {ApiUpdatesManager} from './apiUpdatesManager';\nimport type {AppAvatarsManager} from './appAvatarsManager';\nimport type {AppCallsManager} from './appCallsManager';\nimport type {AppChatsManager} from './appChatsManager';\nimport type {AppDocsManager} from './appDocsManager';\nimport type {AppDraftsManager} from './appDraftsManager';\nimport type {AppEmojiManager} from './appEmojiManager';\nimport type {AppGroupCallsManager} from './appGroupCallsManager';\nimport type {AppInlineBotsManager} from './appInlineBotsManager';\nimport type {AppMessagesIdsManager} from './appMessagesIdsManager';\nimport type {AppMessagesManager} from './appMessagesManager';\nimport type {AppNotificationsManager} from './appNotificationsManager';\nimport type AppPaymentsManager from './appPaymentsManager';\nimport type {AppPeersManager} from './appPeersManager';\nimport type {AppPhotosManager} from './appPhotosManager';\nimport type {AppPollsManager} from './appPollsManager';\nimport type {AppPrivacyManager} from './appPrivacyManager';\nimport type {AppProfileManager} from './appProfileManager';\nimport type {AppReactionsManager} from './appReactionsManager';\nimport type {AppStateManager} from './appStateManager';\nimport type {AppStickersManager} from './appStickersManager';\nimport type {AppStoragesManager} from './appStoragesManager';\nimport type {AppUsersManager} from './appUsersManager';\nimport type AppWebDocsManager from './appWebDocsManager';\nimport type {AppWebPagesManager} from './appWebPagesManager';\nimport type AppAttachMenuBotsManager from './appAttachMenuBotsManager';\nimport type AppSeamlessLoginManager from './appSeamlessLoginManager';\nimport type AppThemesManager from './appThemesManager';\nimport type {AppManagers} from './managers';\n\nexport class AppManager {\n protected appPeersManager: AppPeersManager;\n protected appChatsManager: AppChatsManager;\n protected appDocsManager: AppDocsManager;\n protected appPhotosManager: AppPhotosManager;\n protected appPollsManager: AppPollsManager;\n protected appUsersManager: AppUsersManager;\n protected appWebPagesManager: AppWebPagesManager;\n protected appDraftsManager: AppDraftsManager;\n protected appProfileManager: AppProfileManager;\n protected appNotificationsManager: AppNotificationsManager;\n protected apiUpdatesManager: ApiUpdatesManager;\n protected appAvatarsManager: AppAvatarsManager;\n protected appGroupCallsManager: AppGroupCallsManager;\n protected appCallsManager: AppCallsManager;\n protected appReactionsManager: AppReactionsManager;\n protected appMessagesManager: AppMessagesManager;\n protected appMessagesIdsManager: AppMessagesIdsManager;\n protected appPrivacyManager: AppPrivacyManager;\n protected appInlineBotsManager: AppInlineBotsManager;\n protected appStickersManager: AppStickersManager;\n protected referenceDatabase: ReferenceDatabase;\n protected appEmojiManager: AppEmojiManager;\n protected dialogsStorage: DialogsStorage;\n protected filtersStorage: FiltersStorage;\n protected apiManager: ApiManager;\n // protected apiManager: ApiManagerProxy;\n protected passwordManager: PasswordManager;\n protected cryptoWorker: CryptoMessagePort;\n protected apiFileManager: ApiFileManager;\n protected peersStorage: PeersStorage;\n protected thumbsStorage: ThumbsStorage;\n protected networkerFactory: NetworkerFactory;\n protected rootScope: RootScope;\n protected authorizer: Authorizer;\n protected dcConfigurator: DcConfigurator;\n protected timeManager: TimeManager;\n protected appStoragesManager: AppStoragesManager;\n protected appStateManager: AppStateManager;\n protected appWebDocsManager: AppWebDocsManager;\n protected appPaymentsManager: AppPaymentsManager;\n protected appAttachMenuBotsManager: AppAttachMenuBotsManager;\n protected appSeamlessLoginManager: AppSeamlessLoginManager;\n protected appThemesManager: AppThemesManager;\n\n public clear: (init?: boolean) => void;\n\n public setManagers(managers: AppManagers) {\n Object.assign(this, managers);\n // this.after();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type{Chat} from '../../../../layer';\nimport type{Dialog} from '../../appMessagesManager';\nimport type{User} from '../../appUsersManager';\nimport type {StoragesStorages} from './createStorages';\nimport {recordPromiseBound} from '../../../../helpers/recordPromise';\nimport {Awaited} from '../../../../types';\nimport {logger} from '../../../logger';\nimport RESET_STORAGES_PROMISE from './resetStoragesPromise';\n\nexport type StoragesResults = Awaited>;\n\nasync function loadStoragesInner(storages: StoragesStorages) {\n const recordPromise = recordPromiseBound(logger('STORAGES-LOADER'));\n const storagesKeys = Object.keys(storages) as Array;\n const storagesPromises: Promise[] = storagesKeys.map((key) => {\n const promise = storages[key].getAll();\n return recordPromise(promise, 'storage ' + (key as any as string));\n });\n\n const storagesResults: {\n users: User[],\n chats: Chat[],\n dialogs: Dialog[]\n } = {} as any;\n const arr = await Promise.all(storagesPromises);\n for(let i = 0, length = storagesKeys.length; i < length; ++i) {\n storagesResults[storagesKeys[i]] = arr[i] as any;\n }\n\n arr.splice(0, storagesKeys.length);\n\n const resetStorages = await RESET_STORAGES_PROMISE;\n if(resetStorages.size) {\n for(const key of resetStorages) {\n storagesResults[key].length = 0;\n }\n\n resetStorages.clear();\n }\n\n return storagesResults;\n}\n\nlet promise: ReturnType;\nexport default function loadStorages(storages: StoragesStorages) {\n return promise ??= loadStoragesInner(storages);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {logger} from '../logger';\nimport {AppManager} from './manager';\nimport createStorages from './utils/storages/createStorages';\nimport loadStorages from './utils/storages/loadStorages';\n\nexport class AppStoragesManager extends AppManager {\n private storages: ReturnType;\n\n // private loadPromise: CancellablePromise;\n\n private log: ReturnType;\n\n constructor() {\n super();\n\n this.log = logger('STORAGES');\n this.storages = createStorages();\n // this.loadPromise = deferredPromise();\n }\n\n public loadStorages() {\n return loadStorages(this.storages);\n // loadStorages(this.storages).then((storagesResults) => {\n // this.loadPromise.resolve(storagesResults);\n // });\n\n // return this.loadPromise;\n }\n\n // public setStoragesResults(storagesResults: StoragesResults) {\n // this.loadPromise.resolve(storagesResults);\n // }\n\n public async loadStorage(name: T) {\n return this.loadStorages().then((storagesResults) => {\n return {\n storage: this.storages[name],\n results: storagesResults[name]\n };\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Chat} from '../../../../layer';\nimport type {Dialog} from '../../appMessagesManager';\nimport type {User} from '../../appUsersManager';\nimport DATABASE_STATE from '../../../../config/databases/state';\nimport AppStorage from '../../../storage';\n\nexport type StoragesStorages = {\n users: AppStorage, typeof DATABASE_STATE>,\n chats: AppStorage, typeof DATABASE_STATE>,\n dialogs: AppStorage, typeof DATABASE_STATE>\n};\n\nexport default function createStorages() {\n const names: (keyof StoragesStorages)[] = ['users', 'chats', 'dialogs'];\n const storages: StoragesStorages = {} as any;\n for(const name of names) {\n // @ts-ignore\n storages[name] = new AppStorage(DATABASE_STATE, name);\n }\n\n return storages;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {AccountPassword, AccountUpdatePasswordSettings, InputCheckPasswordSRP, PasswordKdfAlgo} from '../../layer';\nimport randomize from '../../helpers/array/randomize';\nimport {AppManager} from '../appManagers/manager';\n\nexport class PasswordManager extends AppManager {\n public getState(): Promise {\n return this.apiManager.invokeApi('account.getPassword').then((result) => {\n return result;\n });\n }\n\n public updateSettings(settings: {\n hint?: string,\n email?: string,\n newPassword?: string,\n currentPassword?: string\n } = {}) {\n // state = Object.assign({}, state);\n // state.new_algo = Object.assign({}, state.new_algo);\n\n return this.getState().then((state) => {\n let currentHashPromise: Promise;\n let newHashPromise: Promise;\n const params: AccountUpdatePasswordSettings = {\n password: null,\n new_settings: {\n _: 'account.passwordInputSettings',\n hint: settings.hint,\n email: settings.email\n }\n };\n\n if(settings.currentPassword) {\n currentHashPromise = this.cryptoWorker.invokeCrypto('computeSRP', settings.currentPassword, state, false) as any;\n } else {\n currentHashPromise = Promise.resolve({\n _: 'inputCheckPasswordEmpty'\n });\n }\n\n // * https://core.telegram.org/api/srp#setting-a-new-2fa-password, but still there is a mistake, TDesktop passes 'new_algo' everytime\n const newAlgo = state.new_algo as PasswordKdfAlgo.passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow;\n const salt1 = new Uint8Array(newAlgo.salt1.length + 32);\n randomize(salt1);\n salt1.set(newAlgo.salt1, 0);\n newAlgo.salt1 = salt1;\n\n if(settings.newPassword) {\n newHashPromise = this.cryptoWorker.invokeCrypto('computeSRP', settings.newPassword, state, true) as any;\n } else {\n newHashPromise = Promise.resolve(new Uint8Array());\n }\n\n return Promise.all([currentHashPromise, newHashPromise]).then((hashes) => {\n params.password = hashes[0];\n params.new_settings.new_algo = newAlgo;\n params.new_settings.new_password_hash = hashes[1];\n\n return this.apiManager.invokeApi('account.updatePasswordSettings', params);\n });\n });\n }\n\n public getInputCheckPassword(password: string, state: AccountPassword) {\n return this.cryptoWorker.invokeCrypto('computeSRP', password, state, false) as Promise;\n }\n\n public check(password: string, state: AccountPassword, options: any = {}) {\n return this.getInputCheckPassword(password, state).then((inputCheckPassword) => {\n // console.log('SRP', inputCheckPassword);\n return this.apiManager.invokeApi('auth.checkPassword', {\n password: inputCheckPassword as InputCheckPasswordSRP.inputCheckPasswordSRP\n }, options).then((auth) => {\n if(auth._ === 'auth.authorization') {\n this.apiManager.setUser(auth.user);\n }\n\n return auth;\n });\n });\n }\n\n public confirmPasswordEmail(code: string) {\n return this.apiManager.invokeApi('account.confirmPasswordEmail', {code});\n }\n\n public resendPasswordEmail() {\n return this.apiManager.invokeApi('account.resendPasswordEmail');\n }\n\n public cancelPasswordEmail() {\n return this.apiManager.invokeApi('account.cancelPasswordEmail');\n }\n\n /* public requestRecovery(options: any = {}) {\n return apiManager.invokeApi('auth.requestPasswordRecovery', {}, options);\n }\n\n public recover(code: any, options: any = {}) {\n return apiManager.invokeApi('auth.recoverPassword', {\n code\n }, options);\n } */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Photo, WallPaper} from '../../layer';\nimport {logger} from '../logger';\nimport bytesToHex from '../../helpers/bytes/bytesToHex';\nimport deepEqual from '../../helpers/object/deepEqual';\nimport {AppManager} from '../appManagers/manager';\nimport makeError from '../../helpers/makeError';\n\nexport type ReferenceContext = ReferenceContext.referenceContextProfilePhoto | ReferenceContext.referenceContextMessage | ReferenceContext.referenceContextEmojiesSounds | ReferenceContext.referenceContextReactions | ReferenceContext.referenceContextUserFull | ReferenceContext.referenceContextCustomEmoji | ReferenceContext.referenceContextAttachMenuBotIcon | ReferenceContext.referenceContextWallPaper;\nexport namespace ReferenceContext {\n export type referenceContextProfilePhoto = {\n type: 'profilePhoto',\n peerId: PeerId\n };\n\n export type referenceContextMessage = {\n type: 'message',\n peerId: PeerId,\n messageId: number\n };\n\n export type referenceContextEmojiesSounds = {\n type: 'emojiesSounds'\n };\n\n export type referenceContextReactions = {\n type: 'reactions'\n };\n\n export type referenceContextUserFull = {\n type: 'userFull',\n userId: UserId\n };\n\n export type referenceContextCustomEmoji = {\n type: 'customEmoji',\n docId: DocId\n };\n\n export type referenceContextAttachMenuBotIcon = {\n type: 'attachMenuBotIcon',\n botId: BotId\n };\n\n export type referenceContextWallPaper = {\n type: 'wallPaper',\n wallPaperId: WallPaper['id']\n };\n}\n\nexport type ReferenceBytes = Photo.photo['file_reference'];\nexport type ReferenceContexts = Set;\n\n// type ReferenceBytes = Uint8Array;\n\nexport class ReferenceDatabase extends AppManager {\n private contexts: Map = new Map();\n // private references: Map = new Map();\n private links: {[hex: string]: ReferenceBytes} = {};\n private log = logger('RD', undefined, true);\n private refreshEmojiesSoundsPromise: Promise;\n\n // constructor() {\n // super();\n\n // apiManager.addTaskListener('refreshReference', (task: RefreshReferenceTask) => {\n // const originalPayload = task.payload;\n\n // assumeType(task);\n // task.originalPayload = originalPayload;\n\n // this.refreshReference(originalPayload).then((bytes) => {\n // task.payload = bytes;\n // }, (err) => {\n // task.error = err;\n // }).then(() => apiManager.postMessage(task));\n // });\n // }\n\n public saveContext(reference: ReferenceBytes, context: ReferenceContext, contexts?: ReferenceContexts) {\n [contexts, reference] = this.getContexts(reference);\n if(!contexts) {\n contexts = new Set();\n this.contexts.set(reference, contexts);\n }\n\n this.links[bytesToHex(reference)] = reference;\n for(const _context of contexts) {\n if(deepEqual(_context, context)) {\n return;\n }\n }\n\n contexts.add(context);\n }\n\n public getReferenceByLink(reference: ReferenceBytes) {\n return this.links[bytesToHex(reference)];\n }\n\n public getContexts(reference: ReferenceBytes): [ReferenceContexts, ReferenceBytes] {\n const contexts = this.contexts.get(reference) || (reference = this.getReferenceByLink(reference) || reference, this.contexts.get(reference));\n return [contexts, reference];\n }\n\n public getContext(reference: ReferenceBytes): [ReferenceContext, ReferenceBytes] {\n const contexts = this.getContexts(reference);\n return contexts[0] ? [contexts[0].values().next().value, contexts[1]] : undefined;\n }\n\n public deleteContext(reference: ReferenceBytes, context: ReferenceContext, contexts?: ReferenceContexts) {\n [contexts, reference] = this.getContexts(reference);\n if(contexts) {\n for(const _context of contexts) {\n if(deepEqual(_context, context)) {\n contexts.delete(_context);\n if(!contexts.size) {\n this.contexts.delete(reference);\n delete this.links[bytesToHex(reference)];\n }\n return true;\n }\n }\n }\n\n return false;\n }\n\n public refreshReference(reference: ReferenceBytes, context?: ReferenceContext): Promise {\n this.log('refreshReference: start', reference.slice(), context);\n if(!context) {\n const c = this.getContext(reference);\n if(!c) {\n this.log('refreshReference: got no context for reference:', reference.slice());\n return Promise.reject('NO_CONTEXT');\n }\n\n [context, reference] = c;\n }\n\n let promise: Promise;\n switch(context?.type) {\n case 'message': {\n promise = this.appMessagesManager.reloadMessages(context.peerId, context.messageId, true);\n break;\n // .then(() => {\n // console.log('FILE_REFERENCE_EXPIRED: got message', context, appMessagesManager.getMessage((context as ReferenceContext.referenceContextMessage).messageId).media, reference);\n // });\n }\n\n case 'emojiesSounds': {\n promise = this.refreshEmojiesSoundsPromise || this.appStickersManager.getAnimatedEmojiSounds(true).then(() => {\n this.refreshEmojiesSoundsPromise = undefined;\n });\n break;\n }\n\n case 'userFull': {\n promise = Promise.resolve(this.appProfileManager.getProfile(context.userId, true));\n break;\n }\n\n case 'customEmoji': {\n promise = this.appEmojiManager.getCustomEmojiDocuments([context.docId]);\n break;\n }\n\n case 'attachMenuBotIcon': {\n promise = this.appAttachMenuBotsManager.getAttachMenuBot(context.botId, true) as any;\n break;\n }\n\n case 'wallPaper': {\n promise = this.appThemesManager.getWallPaperById(context.wallPaperId);\n break;\n }\n\n default: {\n this.log.warn('refreshReference: not implemented context', context);\n return Promise.reject();\n }\n }\n\n const hex = bytesToHex(reference);\n this.log('refreshReference: refreshing reference:', hex);\n return promise.then(() => {\n const newHex = bytesToHex(reference);\n this.log('refreshReference: refreshed, reference before:', hex, 'after:', newHex);\n if(hex !== newHex) {\n return reference;\n }\n\n this.deleteContext(reference, context);\n\n const newContext = this.getContext(reference);\n if(newContext) {\n return this.refreshReference(reference, newContext[0]);\n }\n\n this.log.error('refreshReference: no new context, reference before:', hex, 'after:', newHex, context);\n\n throw makeError('NO_NEW_CONTEXT');\n });\n }\n\n /* public replaceReference(oldReference: ReferenceBytes, newReference: ReferenceBytes) {\n const contexts = this.contexts.get(oldReference);\n if(contexts) {\n this.contexts.delete(oldReference);\n this.contexts.set(newReference, contexts);\n }\n } */\n}\n","export default function safeReplaceObject(wasObject: any, newObject: any) {\n if(!wasObject) {\n return newObject;\n }\n\n for(var key in wasObject) {\n if(!newObject.hasOwnProperty(key)) {\n delete wasObject[key];\n }\n }\n\n for(var key in newObject) {\n // if (newObject.hasOwnProperty(key)) { // useless\n wasObject[key] = newObject[key];\n // }\n }\n\n return wasObject;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Message, MessageAction, MessageMedia} from '../../../../layer';\nimport getPeerId from '../peers/getPeerId';\n\nexport default function getPeerIdsFromMessage(message: Message.message | Message.messageService) {\n const peerIds: number[] = [\n message.fromId,\n message.viaBotId,\n (message as Message.message).fwdFromId\n ];\n\n const media = (message as Message.message).media;\n if(media) {\n const contactUserId = (media as MessageMedia.messageMediaContact).user_id;\n if(contactUserId !== undefined) {\n peerIds.push(contactUserId.toPeerId());\n }\n\n const results = (media as MessageMedia.messageMediaPoll).results;\n const recentVoters = results?.recent_voters;\n if(recentVoters?.length) {\n peerIds.push(...recentVoters.map((userId) => userId.toPeerId()));\n }\n }\n\n const recentReactions = ((message as Message.message).reactions)?.recent_reactions;\n if(recentReactions?.length) {\n peerIds.push(...recentReactions.map((reaction) => getPeerId(reaction.peer_id)));\n }\n\n const action = (message as Message.messageService).action;\n if(action) {\n const userIds: UserId[] = [\n ...((action as MessageAction.messageActionChatAddUser).users || []),\n (action as MessageAction.messageActionChatDeleteUser).user_id,\n (action as MessageAction.messageActionChatJoinedByLink).inviter_id\n ];\n peerIds.push(...userIds.filter(Boolean).map((userId) => userId.toPeerId()));\n\n const chatIds: ChatId[] = [\n (action as MessageAction.messageActionChatMigrateTo).channel_id,\n (action as MessageAction.messageActionChannelMigrateFrom).chat_id\n ];\n peerIds.push(...chatIds.filter(Boolean).map((chatId) => chatId.toPeerId(true)));\n }\n\n const recentRepliers = ((message as Message.message).replies)?.recent_repliers;\n if(recentRepliers?.length) {\n peerIds.push(...recentRepliers.map((reply) => getPeerId(reply)));\n }\n\n return new Set(peerIds.filter(Boolean));\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {ForumTopic} from '../../../../layer';\nimport type {Dialog} from '../../appMessagesManager';\nimport type getDialogIndexKey from './getDialogIndexKey';\n\nexport default function setDialogIndex(\n dialog: Dialog | ForumTopic.forumTopic,\n indexKey: ReturnType,\n index: number\n) {\n return (dialog as Dialog)[indexKey] = index;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {Chat, ForumTopic as MTForumTopic, DialogPeer, Message, MessageAction, MessageMedia, MessagesForumTopics, MessagesPeerDialogs, Update} from '../../layer';\nimport type {Dialog, ForumTopic, MyMessage} from '../appManagers/appMessagesManager';\nimport tsNow from '../../helpers/tsNow';\nimport SearchIndex from '../searchIndex';\nimport {SliceEnd} from '../../helpers/slicedArray';\nimport {MyDialogFilter} from './filters';\nimport {FOLDER_ID_ALL, FOLDER_ID_ARCHIVE, NULL_PEER_ID, REAL_FOLDERS, REAL_FOLDER_ID} from '../mtproto/mtproto_config';\nimport {MaybePromise, NoneToVoidFunction} from '../../types';\nimport ctx from '../../environment/ctx';\nimport AppStorage from '../storage';\nimport type DATABASE_STATE from '../../config/databases/state';\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport insertInDescendSortedArray from '../../helpers/array/insertInDescendSortedArray';\nimport safeReplaceObject from '../../helpers/object/safeReplaceObject';\nimport getServerMessageId from '../appManagers/utils/messageId/getServerMessageId';\nimport generateMessageId from '../appManagers/utils/messageId/generateMessageId';\nimport {AppManager} from '../appManagers/manager';\nimport getDialogIndexKey from '../appManagers/utils/dialogs/getDialogIndexKey';\nimport isObject from '../../helpers/object/isObject';\nimport getDialogIndex from '../appManagers/utils/dialogs/getDialogIndex';\nimport getPeerIdsFromMessage from '../appManagers/utils/messages/getPeerIdsFromMessage';\nimport {AppStoragesManager} from '../appManagers/appStoragesManager';\nimport defineNotNumerableProperties from '../../helpers/object/defineNotNumerableProperties';\nimport setDialogIndex from '../appManagers/utils/dialogs/setDialogIndex';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport pause from '../../helpers/schedulers/pause';\nimport {BroadcastEvents} from '../rootScope';\nimport assumeType from '../../helpers/assumeType';\nimport makeError from '../../helpers/makeError';\nimport callbackify from '../../helpers/callbackify';\n\nexport type FolderDialog = {\n dialog: Dialog,\n index: number\n};\n\nexport type Folder = {\n dialogs: (Dialog | ForumTopic)[],\n id: number,\n unreadMessagesCount: number,\n unreadPeerIds: Set,\n unreadUnmutedPeerIds: Set,\n dispatchUnreadTimeout?: number\n};\n\nexport const GLOBAL_FOLDER_ID: REAL_FOLDER_ID = undefined;\n\n// let spentTime = 0;\nexport default class DialogsStorage extends AppManager {\n private storage: AppStoragesManager['storages']['dialogs'];\n\n private dialogs: {[peerId: PeerId]: Dialog};\n\n private folders: {[folderId: number]: Folder};\n\n private allDialogsLoaded: {[folder_id: number]: boolean};\n private dialogsOffsetDate: {[folder_id: number]: number};\n private pinnedOrders: {[folder_id: number]: PeerId[]};\n private dialogsNum: number;\n\n private dialogsIndex: SearchIndex;\n\n private cachedResults: {\n query: string,\n count: number,\n dialogs: Dialog[],\n folderId: number\n };\n\n private forumTopics: Map,\n deletedTopics: Set,\n getTopicPromises: Map>,\n getTopicsPromise?: Promise\n }>;\n\n protected after() {\n this.clear(true);\n\n this.rootScope.addEventListener('language_change', () => {\n const peerId = this.appUsersManager.getSelf().id.toPeerId(false);\n const dialog = this.getDialogOnly(peerId);\n if(dialog) {\n const peerText = this.appPeersManager.getPeerSearchText(peerId);\n this.dialogsIndex.indexObject(peerId, peerText);\n }\n });\n\n const onFilterUpdate = (filter: MyDialogFilter) => {\n const dialogs = this.getCachedDialogs(false);\n for(let i = 0; i < dialogs.length; ++i) {\n this.processDialogForFilter(dialogs[i], filter);\n }\n };\n\n this.rootScope.addEventListener('filter_order', () => {\n const dialogs = this.getCachedDialogs(false);\n // const indexKeys: ReturnType[] = [];\n for(const filterId in this.folders) {\n if(+filterId > 1) {\n delete this.folders[filterId];\n }\n\n // indexKeys.push(this.getDialogIndexKey(+filterId));\n }\n\n for(let i = 0; i < dialogs.length; ++i) {\n const dialog = dialogs[i];\n // for(const indexKey of indexKeys) {\n // delete dialog[indexKey];\n // }\n\n this.processDialogForFilters(dialog);\n }\n });\n\n this.rootScope.addEventListener('filter_update', onFilterUpdate);\n this.rootScope.addEventListener('filter_new', onFilterUpdate);\n\n this.rootScope.addEventListener('filter_delete', (filter) => {\n const dialogs = this.getCachedDialogs(false);\n\n const indexKey = this.getDialogIndexKeyByFilterId(filter.id);\n for(let i = 0; i < dialogs.length; ++i) {\n const dialog = dialogs[i];\n delete dialog[indexKey];\n }\n\n delete this.folders[filter.id];\n });\n\n this.rootScope.addEventListener('dialog_notify_settings', (dialog) => {\n this.processChangedUnreadOrUnmuted(dialog.peerId);\n });\n\n this.rootScope.addEventListener('chat_update', (chatId) => {\n const chat = this.appChatsManager.getChat(chatId);\n\n const peerId = chatId.toPeerId(true);\n if((chat as Chat.chat).pFlags.left && this.getDialogOnly(peerId)) {\n this.dropDialogOnDeletion(peerId);\n }\n });\n\n this.rootScope.addEventListener('chat_toggle_forum', ({chatId, enabled}) => {\n const peerId = chatId.toPeerId(true);\n if(!enabled) {\n this.flushForumTopicsCache(peerId);\n }\n\n this.processChangedUnreadOrUnmuted(peerId);\n });\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateFolderPeers: this.onUpdateFolderPeers,\n\n updateDialogPinned: this.onUpdateDialogPinned,\n\n updateChannelPinnedTopic: this.onUpdateChannelPinnedTopic,\n\n updatePinnedDialogs: this.onUpdatePinnedDialogs,\n\n updateChannelPinnedTopics: this.onUpdateChannelPinnedTopics\n });\n\n return Promise.all([\n this.appStateManager.getState(),\n this.appStoragesManager.loadStorage('dialogs')\n ]).then(([state, {results: dialogs, storage}]) => {\n this.storage = storage;\n this.dialogs = this.storage.getCache();\n\n for(const folderId of REAL_FOLDERS) {\n const order = state.pinnedOrders[folderId];\n if(!order) {\n continue;\n }\n\n const _order = this.getPinnedOrders(folderId);\n _order.splice(0, _order.length, ...order);\n }\n\n if(dialogs.length) {\n AppStorage.freezeSaving(this.setDialogsFromState.bind(this, dialogs), ['chats', 'dialogs', 'messages', 'users']);\n }\n\n this.allDialogsLoaded = state.allDialogsLoaded || {};\n\n if(dialogs.length) {\n this.appDraftsManager.addMissedDialogs();\n }\n });\n }\n\n private setDialogsFromState(dialogs: Dialog[]) {\n for(let i = 0, length = dialogs.length; i < length; ++i) {\n const dialog = dialogs[i];\n if(!dialog) {\n continue;\n }\n\n // if(dialog.peerId !== SERVICE_PEER_ID) {\n dialog.top_message = getServerMessageId(dialog.top_message); // * fix outgoing message to avoid copying dialog\n // }\n\n if(dialog.topMessage) {\n this.appMessagesManager.saveMessages([dialog.topMessage]);\n }\n\n for(let i = 0; i <= 21; ++i) {\n const indexKey: ReturnType = `index_${i}` as any;\n delete dialog[indexKey];\n }\n // delete dialog.indexes;\n\n this.saveDialog({\n dialog,\n ignoreOffsetDate: true\n });\n\n // ! WARNING, убрать это когда нужно будет делать чтобы pending сообщения сохранялись\n const message = this.appMessagesManager.getMessageByPeer(dialog.peerId, dialog.top_message);\n if(!message) {\n this.appMessagesManager.reloadConversation(dialog.peerId);\n }\n }\n }\n\n public isDialogsLoaded(folderId: number) {\n return !!this.allDialogsLoaded[folderId];\n }\n\n public setDialogsLoaded(folderId: number, loaded: boolean) {\n const isForum = this.isFilterIdForForum(folderId);\n\n if(folderId === GLOBAL_FOLDER_ID && loaded) {\n this.allDialogsLoaded[FOLDER_ID_ALL] = loaded;\n this.allDialogsLoaded[FOLDER_ID_ARCHIVE] = loaded;\n } else {\n if(isForum) {\n defineNotNumerableProperties(this.allDialogsLoaded, [folderId]);\n }\n\n this.allDialogsLoaded[folderId] = loaded;\n }\n\n if(isForum) {\n return;\n }\n\n if(Array.from(REAL_FOLDERS).every((folderId) => this.allDialogsLoaded[folderId])) {\n this.allDialogsLoaded[GLOBAL_FOLDER_ID] = true;\n }\n\n this.saveAllDialogsLoaded();\n }\n\n private saveAllDialogsLoaded() {\n this.appStateManager.pushToState('allDialogsLoaded', this.allDialogsLoaded);\n }\n\n public clear = (init = false) => {\n if(!init) {\n this.storage.clear();\n\n this.allDialogsLoaded = {};\n this.saveAllDialogsLoaded();\n\n // * clear not numerable properties\n this.pinnedOrders = Object.assign({}, this.pinnedOrders);\n for(const folderId of REAL_FOLDERS) {\n this.resetPinnedOrder(folderId);\n }\n this.savePinnedOrders();\n } else {\n this.allDialogsLoaded = {};\n this.pinnedOrders = {};\n for(const folderId of REAL_FOLDERS) {\n this.pinnedOrders[folderId] = [];\n }\n }\n\n this.forumTopics = new Map();\n this.folders = {};\n this.dialogsOffsetDate = {};\n this.dialogsNum = 0;\n this.dialogsIndex = new SearchIndex({\n clearBadChars: true,\n ignoreCase: true,\n latinize: true,\n includeTag: true\n });\n this.cachedResults = {\n query: '',\n count: 0,\n dialogs: [],\n folderId: 0\n };\n };\n\n public handleDialogUnpinning(dialog: Dialog | ForumTopic, folderId: number) {\n delete dialog.pFlags.pinned;\n indexOfAndSplice(this.getPinnedOrders(folderId), this.isFilterIdForForum(folderId) ? (dialog as ForumTopic).id : dialog.peerId);\n this.savePinnedOrders();\n }\n\n public savePinnedOrders() {\n this.appStateManager.pushToState('pinnedOrders', this.pinnedOrders);\n }\n\n public resetPinnedOrder(folderId: number) {\n this.getPinnedOrders(folderId).length = 0;\n }\n\n public getPinnedOrders(folderId: number) {\n let orders = this.pinnedOrders[folderId];\n if(!orders && this.isFilterIdForForum(folderId)) {\n defineNotNumerableProperties(this.pinnedOrders, [folderId]);\n orders = this.pinnedOrders[folderId] = [];\n }\n\n return orders;\n }\n\n public isDialogPinned(peerId: PeerId, folderId: number) {\n const filter = this.filtersStorage.getFilter(folderId);\n let isPinned: boolean;\n if(filter) {\n isPinned = filter.pinnedPeerIds.indexOf(peerId) !== -1;\n } else {\n isPinned = !!this.getDialogOnly(peerId).pFlags.pinned;\n }\n\n return isPinned;\n }\n\n public getOffsetDate(folderId: number): number {\n const offsetDate = this.dialogsOffsetDate[folderId] || 0;\n if(folderId === GLOBAL_FOLDER_ID && !offsetDate) { // make request not from beginning if we have loaded some dialogs\n return Math.min(...Array.from(REAL_FOLDERS).sort((a, b) => a - b));\n }\n\n return offsetDate;\n }\n\n private generateFolder(id: number) {\n const folder: Folder = {\n dialogs: [],\n id,\n unreadMessagesCount: 0,\n unreadPeerIds: new Set(),\n unreadUnmutedPeerIds: new Set()\n };\n\n defineNotNumerableProperties(folder, ['dispatchUnreadTimeout']);\n\n return folder;\n }\n\n public getFolder(id: number) {\n return this.folders[id] ??= this.generateFolder(id);\n }\n\n public isFilterIdForForum(filterId: number) {\n return filterId && filterId < 0;\n }\n\n public getFilterIdForForum(forumTopic: ForumTopic) {\n return forumTopic.peerId;\n }\n\n public getDialogKey(dialog: Dialog | ForumTopic) {\n return this.isTopic(dialog) ? dialog.id : dialog.peerId;\n }\n\n public getFolderDialogs(id: number, skipMigrated = true): Folder['dialogs'] {\n if(id === GLOBAL_FOLDER_ID) { // * it won't be sorted\n return this.getCachedDialogs(skipMigrated);\n }\n\n const folder = this.getFolder(id);\n if(this.isFilterIdForForum(id)) {\n return skipMigrated ? folder.dialogs.filter((forumTopic) => !(forumTopic as ForumTopic).pFlags.hidden) : folder.dialogs;\n }\n\n return skipMigrated ? folder.dialogs.filter((dialog) => (dialog as Dialog).migratedTo === undefined) : folder.dialogs;\n }\n\n public getNextDialog(currentPeerId: PeerId, next: boolean, filterId: number) {\n const folder = this.getFolderDialogs(filterId, true);\n let dialog: Folder['dialogs'][0];\n if(!currentPeerId) {\n if(next) {\n dialog = folder[0];\n }\n } else {\n const idx = folder.findIndex((dialog) => dialog.peerId === currentPeerId);\n if(idx !== -1) {\n const nextIndex = next ? idx + 1 : idx - 1;\n dialog = folder[nextIndex];\n }\n }\n\n return dialog;\n }\n\n public getDialogIndexKeyByFilterId(filterId: number) {\n if(this.isFilterIdForForum(filterId)) return getDialogIndexKey();\n if(REAL_FOLDERS.has(filterId)) return getDialogIndexKey(filterId as REAL_FOLDER_ID);\n const filter = this.filtersStorage.getFilter(filterId);\n return getDialogIndexKey(filter.localId);\n }\n\n private isDialogUnmuted(dialog: Dialog | ForumTopic) {\n return !this.appNotificationsManager.isPeerLocalMuted({\n peerId: dialog.peerId,\n respectType: true,\n threadId: this.isTopic(dialog) ? (dialog as ForumTopic).id : undefined\n });\n }\n\n public getFolderUnreadCount(filterId: number) {\n const folder = this.getFolder(filterId);\n return {unreadUnmutedCount: folder.unreadUnmutedPeerIds.size, unreadCount: folder.unreadPeerIds.size};\n }\n\n public getCachedDialogs(skipMigrated?: boolean) {\n const arrays = Array.from(REAL_FOLDERS).map((folderId) => this.getFolderDialogs(folderId, skipMigrated));\n return [].concat(...arrays) as Dialog[];\n }\n\n private setDialogIndexInFilter(\n dialog: Dialog | ForumTopic,\n indexKey: ReturnType,\n filter?: MyDialogFilter\n ) {\n // if(this.isTopic(dialog)) {\n // return dialog['index_0'];\n // }\n\n let index: number;\n\n const isTopic = this.isTopic(dialog);\n const isRealFolder = isTopic || REAL_FOLDERS.has(filter.id);\n /* if(isRealFolder) {\n // index = getDialogIndex(dialog, indexKey);\n index = this.generateIndexForDialog(dialog, true);\n } else */if(this.filtersStorage.testDialogForFilter(dialog, filter)) {\n const pinnedIds = isTopic ?\n this.getPinnedOrders(this.getFilterIdForForum(dialog)) :\n filter.pinnedPeerIds;\n\n const pinnedKey = this.getDialogKey(dialog);\n const pinnedIndex = pinnedIds.indexOf(pinnedKey);\n\n if(pinnedIndex !== -1) {\n index = this.generateDialogIndex(this.generateDialogPinnedDateByIndex(pinnedIds.length - 1 - pinnedIndex), true);\n } else if(dialog.pFlags?.pinned || isRealFolder) {\n index = this.generateIndexForDialog(dialog, true, undefined, !isRealFolder);\n } else {\n index = getDialogIndex(dialog) ?? this.generateIndexForDialog(dialog, true);\n }\n }\n\n // if(!dialog.hasOwnProperty(indexKey)) {\n // defineNotNumerableProperties(dialog, [indexKey]);\n // }\n\n return setDialogIndex(dialog, indexKey, index);\n }\n\n public getDialog(peerId: PeerId, folderId?: number, topicId?: number, skipMigrated = true): [Folder['dialogs'][0], number] | [] {\n const folders: Folder['dialogs'][] = [];\n\n if(topicId) {\n folderId = peerId;\n // skipMigrated = false;\n }\n\n if(folderId === undefined) {\n folders.push(...Array.from(REAL_FOLDERS).map((folderId) => this.getFolder(folderId).dialogs as Dialog[]));\n } else {\n folders.push(this.getFolderDialogs(folderId, false) as Dialog[]);\n }\n\n const verify: (d: Folder['dialogs'][0]) => boolean = topicId ?\n (d) => (d as ForumTopic).id === topicId :\n (d) => (d as Dialog).peerId === peerId;\n for(const folder of folders) {\n let i = 0, skipped = 0;\n for(let length = folder.length; i < length; ++i) {\n const dialog = folder[i];\n if(verify(dialog)) {\n return [dialog, i - skipped];\n } else if(skipMigrated && ((dialog as ForumTopic).pFlags.hidden || (dialog as Dialog).migratedTo !== undefined)) {\n ++skipped;\n }\n }\n }\n\n return [];\n }\n\n public getDialogOnly(peerId: PeerId) {\n return this.dialogs[peerId];\n }\n\n public getDialogOrTopic(peerId: PeerId, topicId?: number) {\n return topicId ? this.getForumTopic(peerId, topicId) : this.dialogs[peerId];\n }\n\n public getDialogIndex(\n peerId: PeerId | Parameters[0],\n indexKey: ReturnType,\n topicId?: number\n ) {\n const dialog = isObject(peerId) ? peerId : this.getDialogOrTopic(peerId, topicId);\n return getDialogIndex(dialog, indexKey);\n }\n\n /*\n var date = Date.now() / 1000 | 0;\n var m = date * 0x10000;\n\n var k = (date + 1) * 0x10000;\n k - m;\n 65536\n */\n public generateDialogIndex(date?: number, isPinned?: boolean) {\n date ??= tsNow(true) + this.timeManager.getServerTimeOffset();\n return (date * 0x10000) + (isPinned ? 0 : (++this.dialogsNum & 0xFFFF));\n }\n\n // public makeFilterForTopics(id: number): MyDialogFilter {\n // return {\n // _: 'dialogFilter',\n // id,\n\n // };\n // }\n\n public isTopic(dialog: Dialog | ForumTopic): dialog is ForumTopic {\n return 'id' in dialog;\n }\n\n public processDialogForFilters(dialog: Dialog | ForumTopic, noIndex?: boolean) {\n // let perf = performance.now();\n if(this.isTopic(dialog)) {\n this.processDialogForFilter(dialog, undefined, noIndex);\n return;\n }\n\n const filters = this.filtersStorage.getFilters();\n for(const id in filters) {\n const filter = filters[id];\n this.processDialogForFilter(dialog, filter, noIndex);\n }\n // spentTime += (performance.now() - perf);\n // console.log('generate index time:', spentTime);\n }\n\n public processDialogForFilter(\n dialog: Dialog | ForumTopic,\n filter?: MyDialogFilter,\n noIndex?: boolean\n ) {\n const isTopic = this.isTopic(dialog);\n const folderId = isTopic ? this.getFilterIdForForum(dialog) : filter.id;\n\n const indexKey = isTopic ? 'index_0' : this.getDialogIndexKeyByFilterId(folderId);\n const folder = this.getFolder(folderId);\n const dialogs = folder.dialogs;\n\n const cmp: (d: typeof dialog) => boolean = isTopic ?\n ((d: ForumTopic) => d.id === dialog.id) as any :\n ((d: Dialog) => d.peerId === dialog.peerId) as any;\n const wasIndex = dialogs.findIndex(cmp);\n const wasDialog = dialogs[wasIndex];\n const wasDialogIndex = this.getDialogIndex(wasDialog, indexKey);\n\n if(noIndex && folderId > FOLDER_ID_ARCHIVE) {\n noIndex = undefined;\n }\n\n const newDialogIndex = noIndex ? undefined : this.setDialogIndexInFilter(dialog, indexKey, filter);\n\n if(wasDialogIndex === newDialogIndex) {\n return false;\n }\n\n if(!!wasDialogIndex !== !!newDialogIndex) {\n this.prepareFolderUnreadCountModifyingByDialog(folderId, dialog, !!newDialogIndex);\n }\n\n if(wasIndex !== -1) {\n dialogs.splice(wasIndex, 1);\n }\n\n if(newDialogIndex) {\n insertInDescendSortedArray(dialogs, dialog, (dialog) => this.getDialogIndex(dialog, indexKey), -1);\n }\n\n return true;\n }\n\n public prepareDialogUnreadCountModifying(dialog: Dialog | ForumTopic, toggle?: boolean) {\n const isTopic = this.isTopic(dialog);\n const callbacks: NoneToVoidFunction[] = [];\n\n const folderId = isTopic ? this.getFilterIdForForum(dialog) : dialog.folder_id;\n callbacks.push(this.prepareFolderUnreadCountModifyingByDialog(folderId, dialog, toggle));\n\n if(!isTopic) {\n const filters = this.filtersStorage.getFilters();\n for(const id in filters) {\n const filter = filters[id];\n if(this.filtersStorage.testDialogForFilter(dialog, filter)) {\n callbacks.push(this.prepareFolderUnreadCountModifyingByDialog(filter.id, dialog, toggle));\n }\n }\n }\n\n return () => !toggle && callbacks.forEach((callback) => callback());\n }\n\n public prepareFolderUnreadCountModifyingByDialog(folderId: number, dialog: Dialog | ForumTopic, toggle?: boolean) {\n const wasUnreadCount = this.appMessagesManager.getDialogUnreadCount(dialog);\n const wasUnmuted = this.isDialogUnmuted(dialog);\n\n if(toggle !== undefined) {\n const addMessagesCount = toggle ? wasUnreadCount : -wasUnreadCount;\n this.modifyFolderUnreadCount(folderId, addMessagesCount, !!wasUnreadCount, wasUnreadCount && wasUnmuted, dialog);\n return;\n }\n\n return () => {\n const newUnreadCount = this.appMessagesManager.getDialogUnreadCount(dialog);\n const newUnmuted = this.isDialogUnmuted(dialog);\n\n const addMessagesCount = newUnreadCount - wasUnreadCount;\n this.modifyFolderUnreadCount(folderId, addMessagesCount, !!newUnreadCount, newUnreadCount && newUnmuted, dialog);\n };\n }\n\n public modifyFolderUnreadCount(\n folderId: number,\n addMessagesCount: number,\n toggleDialog: boolean,\n toggleUnmuted: boolean,\n dialog: Dialog | ForumTopic\n ) {\n const {peerId} = dialog;\n const isForum = this.appPeersManager.isForum(peerId);\n const isTopic = this.isTopic(dialog);\n if(isForum && !isTopic) {\n const forumUnreadCount = this.getForumUnreadCount(peerId);\n if(forumUnreadCount instanceof Promise) {\n forumUnreadCount.then(({count, hasUnmuted}) => {\n dialog = this.getDialogOnly(peerId);\n const folder = this.getFolder(folderId);\n if(\n !dialog ||\n !this.appPeersManager.isForum(peerId) ||\n !folder ||\n !folder.dialogs.some((dialog) => dialog.peerId === peerId)\n ) {\n return;\n }\n\n this.modifyFolderUnreadCount(folderId, 0, false, false, dialog);\n });\n\n return;\n } else {\n addMessagesCount = 0;\n toggleDialog = forumUnreadCount.count > 0;\n toggleUnmuted = forumUnreadCount.hasUnmuted;\n }\n }\n\n const folder = this.getFolder(folderId);\n if(addMessagesCount) {\n folder.unreadMessagesCount = Math.max(0, folder.unreadMessagesCount + addMessagesCount);\n }\n\n const key = this.getDialogKey(dialog);\n if(toggleDialog) {\n folder.unreadPeerIds.add(key);\n } else {\n folder.unreadPeerIds.delete(key);\n }\n\n if(toggleUnmuted) {\n folder.unreadUnmutedPeerIds.add(key);\n } else {\n folder.unreadUnmutedPeerIds.delete(key);\n }\n\n folder.dispatchUnreadTimeout ??= ctx.setTimeout(() => {\n folder.dispatchUnreadTimeout = undefined;\n const _folder = {...folder};\n delete _folder.dialogs;\n this.rootScope.dispatchEvent('folder_unread', _folder);\n\n if(isTopic) { // * refresh forum dialog unread count\n this.processChangedUnreadOrUnmuted(peerId);\n }\n }, 0);\n }\n\n public processChangedUnreadOrUnmuted(peerId: PeerId) {\n const dialog = this.getDialogOnly(peerId);\n if(dialog) {\n this.processDialogForFilters(dialog);\n this.prepareDialogUnreadCountModifying(dialog)();\n this.rootScope.dispatchEvent('dialog_unread', {\n peerId,\n dialog\n });\n }\n }\n\n public generateIndexForDialog(\n dialog: Dialog | ForumTopic,\n justReturn?: boolean,\n message?: MyMessage,\n noPinnedOrderUpdate?: boolean\n ) {\n if(!justReturn/* && !isTopic */) {\n return;\n }\n\n const isTopic = this.isTopic(dialog);\n let topDate = 0, isPinned: boolean;\n if((dialog as ForumTopic).pFlags.hidden) { // general topic must be first\n topDate = this.generateDialogPinnedDateByIndex(0xFFF);\n isPinned = true;\n } else if(dialog.pFlags.pinned && !noPinnedOrderUpdate) {\n topDate = this.generateDialogPinnedDate(dialog);\n isPinned = true;\n } else {\n message ||= this.appMessagesManager.getMessageByPeer(dialog.peerId, dialog.top_message);\n\n topDate = (message as Message.message)?.date || topDate;\n\n if(!isTopic) {\n const channelId = this.appPeersManager.isChannel(dialog.peerId) && dialog.peerId.toChatId();\n if(channelId) {\n const channel = this.appChatsManager.getChat(channelId) as Chat.channel;\n if(!topDate || (channel.date && channel.date > topDate)) {\n topDate = channel.date;\n }\n }\n }\n\n if(dialog.draft?._ === 'draftMessage' && dialog.draft.date > topDate) {\n topDate = dialog.draft.date;\n }\n }\n\n topDate ||= tsNow(true);\n\n const index = this.generateDialogIndex(topDate, isPinned);\n if(justReturn) {\n return index;\n }\n\n const indexKey = getDialogIndexKey((dialog as Dialog).folder_id);\n setDialogIndex(dialog, indexKey, index);\n }\n\n public generateDialogPinnedDateByIndex(pinnedIndex: number) {\n return 0x7fff0000 + (pinnedIndex & 0xFFFF); // 0xFFFF - потому что в папках может быть бесконечное число пиннедов\n }\n\n public generateDialogPinnedDate(dialog: Dialog | ForumTopic) {\n const isTopic = this.isTopic(dialog);\n const order = this.getPinnedOrders(isTopic ? this.getFilterIdForForum(dialog) : dialog.folder_id);\n\n const dialogKey = this.getDialogKey(dialog);\n let pinnedIndex = order.indexOf(dialogKey);\n if(pinnedIndex === -1) {\n order.unshift(dialogKey);\n pinnedIndex = 0;\n\n if(!isTopic) {\n this.savePinnedOrders();\n }\n }\n\n return this.generateDialogPinnedDateByIndex(order.length - 1 - pinnedIndex);\n }\n\n /* public generateDialog(peerId: PeerId) {\n const dialog: Dialog = {\n _: 'dialog',\n pFlags: {},\n peer: this.appPeersManager.getOutputPeer(peerId),\n top_message: 0,\n read_inbox_max_id: 0,\n read_outbox_max_id: 0,\n unread_count: 0,\n unread_mentions_count: 0,\n notify_settings: {\n _: 'peerNotifySettings',\n },\n };\n\n return dialog;\n } */\n\n public setDialogToState(dialog: Dialog | ForumTopic) {\n if(this.isTopic(dialog)) {\n return;\n }\n\n const {peerId, pts} = dialog;\n const historyStorage = this.appMessagesManager.getHistoryStorage(peerId);\n const messagesStorage = this.appMessagesManager.getHistoryMessagesStorage(peerId);\n const history = historyStorage.history.slice;\n let incomingMessage: MyMessage;\n for(let i = 0, length = history.length; i < length; ++i) {\n const mid = history[i];\n const message: MyMessage = this.appMessagesManager.getMessageFromStorage(messagesStorage, mid);\n if(message && !message.pFlags.is_outgoing/* || peerId === SERVICE_PEER_ID */) {\n incomingMessage = message;\n\n const peerIds = getPeerIdsFromMessage(message);\n this.peersStorage.requestPeersForKey(peerIds, `topMessage_${peerId}`);\n\n break;\n }\n }\n\n dialog.topMessage = incomingMessage;\n\n // DO NOT TOUCH THESE LINES, SOME REAL MAGIC HERE.\n // * Read service chat when refreshing page with outgoing & getting new service outgoing message\n /* if(incomingMessage && dialog.read_inbox_max_id >= dialog.top_message) {\n dialog.unread_count = 0;\n }\n\n dialog.read_inbox_max_id = this.appMessagesIdsManager.clearMessageId(dialog.read_inbox_max_id);\n dialog.read_outbox_max_id = this.appMessagesIdsManager.clearMessageId(dialog.read_outbox_max_id); */\n // CAN TOUCH NOW\n\n if(peerId.isAnyChat() && pts) {\n const newPts = this.apiUpdatesManager.getChannelState(peerId.toChatId(), pts).pts;\n dialog.pts = newPts;\n }\n\n this.storage.set({\n [peerId]: dialog\n });\n\n this.peersStorage.requestPeer(peerId, 'dialog');\n\n /* for(let id in this.filtersStorage.filters) {\n const filter = this.filtersStorage.filters[id];\n\n if(this.filtersStorage.testDialogForFilter(dialog, filter)) {\n\n }\n } */\n }\n\n public pushDialog({dialog, offsetDate, ignoreOffsetDate, saveGlobalOffset}: {\n dialog: Dialog | ForumTopic,\n offsetDate?: number,\n ignoreOffsetDate?: boolean,\n saveGlobalOffset?: boolean\n }) {\n const isTopic = this.isTopic(dialog);\n const {folder_id, peerId} = dialog as Dialog;\n\n if(isTopic) {\n const forumTopics = this.getForumTopicsCache(peerId);\n forumTopics.topics.set(dialog.id, dialog);\n } else {\n this.dialogs[peerId] = dialog;\n }\n\n offsetDate ??= this.getDialogOffsetDate(dialog);\n\n // if(!isTopic) {\n this.processDialogForFilters(dialog);\n // }\n\n if(offsetDate && !dialog.pFlags.pinned) {\n if(!isTopic && saveGlobalOffset) {\n const savedGlobalOffsetDate = this.dialogsOffsetDate[GLOBAL_FOLDER_ID];\n if(!savedGlobalOffsetDate || offsetDate < savedGlobalOffsetDate) {\n this.dialogsOffsetDate[GLOBAL_FOLDER_ID] = offsetDate;\n }\n }\n\n const folderId = isTopic ? this.getFilterIdForForum(dialog) : folder_id;\n const savedOffsetDate = this.dialogsOffsetDate[folderId];\n if(!savedOffsetDate || offsetDate < savedOffsetDate) {\n // if(pos !== -1) {\n if(!ignoreOffsetDate && !this.isDialogsLoaded(folderId)) {\n this.dropDialog(peerId, isTopic ? this.getDialogKey(dialog) : undefined, true);\n return;\n }\n\n this.dialogsOffsetDate[folderId] = offsetDate;\n }\n }\n\n this.setDialogToState(dialog);\n\n // if(pos === -1) {\n // this.prepareFolderUnreadCountModifyingByDialog(folder_id, dialog, true);\n // }\n\n // const indexKey = getDialogIndexKey(folder_id);\n // /* const newPos = */insertInDescendSortedArray(dialogs, dialog, (dialog) => getDialogIndex(dialog, indexKey), -1);\n /* if(pos !== -1 && pos !== newPos) {\n rootScope.dispatchEvent('dialog_order', {dialog, pos: newPos});\n } */\n }\n\n public dropDialogFromFolders(peerId: PeerId, topicId?: number) {\n const foundDialog = this.getDialog(peerId, undefined, topicId, false);\n const [dialog, index] = foundDialog;\n if(dialog) {\n const filterId = topicId ?\n this.getFilterIdForForum(dialog as ForumTopic) :\n (dialog as Dialog).folder_id;\n\n // const folder = this.getFolder(filterId);\n // folder.dialogs.splice(index, 1);\n const wasPinned = indexOfAndSplice(this.getPinnedOrders(filterId), this.getDialogKey(dialog)) !== undefined;\n\n this.processDialogForFilters(dialog, true);\n\n this.dialogsIndex.indexObject(peerId, '');\n\n if(wasPinned) {\n this.savePinnedOrders();\n }\n }\n\n return foundDialog;\n }\n\n public dropDialog(peerId: PeerId, topicId?: number, keepLocal?: boolean) {\n const dialog = this.getDialogOrTopic(peerId, topicId);\n const foundDialog = this.dropDialogFromFolders(peerId, topicId);\n if(dialog) {\n if(!keepLocal) {\n if(topicId) {\n this.getForumTopicsCache(peerId).topics.delete(topicId);\n } else {\n delete this.dialogs[peerId];\n }\n }\n\n this.clearDialogFromState(dialog, keepLocal);\n }\n\n return foundDialog;\n }\n\n public clearDialogFromState(dialog: Dialog | ForumTopic, keepLocal: boolean) {\n if(dialog._ === 'forumTopic') {\n return;\n }\n\n const {peerId} = dialog;\n this.peersStorage.requestPeersForKey([], `topMessage_${peerId}`);\n this.peersStorage.releasePeer(peerId, 'dialog');\n this.storage.delete(peerId, keepLocal);\n }\n\n public dropDialogWithEvent(peerId: PeerId, topicId?: number) {\n const dropped = this.dropDialog(peerId, topicId);\n if(dropped.length) {\n this.rootScope.dispatchEvent('dialog_drop', dropped[0]);\n }\n\n return dropped;\n }\n\n /**\n * leaving chat, leaving channel, deleting private dialog\n */\n public dropDialogOnDeletion(peerId: PeerId, topicId?: number) {\n this.dropDialogWithEvent(peerId, topicId);\n this.rootScope.dispatchEvent('peer_deleted', peerId);\n }\n\n public applyDialogs(result: MessagesPeerDialogs | MessagesForumTopics, peerId?: PeerId) {\n // * В эту функцию попадут только те диалоги, в которых есть read_inbox_max_id и read_outbox_max_id, в отличие от тех, что будут в getTopMessages\n\n const isForum = result._ === 'messages.forumTopics';\n const items = (result as MessagesPeerDialogs).dialogs || (result as MessagesForumTopics).topics;\n if(!isForum) {\n // ! fix 'dialogFolder', maybe there is better way to do it, this only can happen by 'messages.getPinnedDialogs' by folder_id: 0\n forEachReverse(result.dialogs, (dialog, idx) => {\n if(dialog._ === 'dialogFolder') {\n result.dialogs.splice(idx, 1);\n }\n });\n } else {\n this.processTopics(peerId, result);\n }\n\n assumeType(items);\n\n this.appUsersManager.saveApiUsers(result.users);\n this.appChatsManager.saveApiChats(result.chats);\n this.appMessagesManager.saveMessages(result.messages);\n\n // this.appMessagesManager.log('applyConversation', dialogsResult);\n\n const updatedDialogs: BroadcastEvents['dialogs_multiupdate'] = new Map();\n const getUpdateCache = (peerId: PeerId) => {\n let cache = updatedDialogs.get(peerId);\n if(!cache) {\n updatedDialogs.set(peerId, cache = {});\n }\n\n return cache;\n };\n\n items.forEach((dialog) => {\n const peerId = this.appPeersManager.getPeerId(dialog.peer);\n let topMid = dialog.top_message;\n\n const topPendingMid = this.appMessagesManager.pendingTopMsgs[peerId];\n if(topPendingMid) {\n const topPendingMessage = this.appMessagesManager.getMessageByPeer(peerId, topPendingMid) as MyMessage;\n const topMessage = this.appMessagesManager.getMessageByPeer(peerId, topMid) as MyMessage;\n if(!topMid || (topPendingMessage && (!topMessage || topPendingMessage?.date > topMessage?.date))) {\n dialog.top_message = topMid = topPendingMid;\n this.appMessagesManager.getHistoryStorage(peerId).maxId = topPendingMid;\n }\n }\n\n /* const d = Object.assign({}, dialog);\n if(peerId === 239602833) {\n this.log.error('applyConversation lun', dialog, d);\n } */\n\n if(topMid || dialog.draft?._ === 'draftMessage') {\n if(this.saveDialog({dialog})) {\n const cache = getUpdateCache(peerId);\n\n if(isForum) {\n (cache.topics ??= new Map()).set(\n (dialog as ForumTopic).id,\n dialog as ForumTopic\n );\n } else {\n cache.dialog = dialog as Dialog;\n }\n }\n } else {\n this.dropDialogWithEvent(peerId, isForum ? this.getDialogKey(dialog) : undefined);\n }\n\n const key = this.appMessagesManager.getUpdateAfterReloadKey(peerId, isForum ? this.getDialogKey(dialog) : undefined);\n const updates = this.appMessagesManager.newUpdatesAfterReloadToHandle[key];\n if(updates !== undefined) {\n for(const update of updates) {\n updates.delete(update);\n this.apiUpdatesManager.saveUpdate(update);\n }\n\n if(!updates.size) {\n delete this.appMessagesManager.newUpdatesAfterReloadToHandle[key];\n }\n }\n });\n\n if(updatedDialogs.size) {\n this.rootScope.dispatchEvent('dialogs_multiupdate', updatedDialogs);\n }\n }\n\n private getDialogOffsetDate(dialog: Dialog | ForumTopic) {\n const message = this.appMessagesManager.getMessageByPeer(dialog.peerId, dialog.top_message);\n return message?.date || 0;\n }\n\n public canSaveDialogByPeerId(peerId: PeerId) {\n if(peerId.isAnyChat()) {\n const chat: Chat = this.appChatsManager.getChat(peerId.toChatId());\n // ! chatForbidden stays for chat where you're kicked\n if(\n chat._ === 'channelForbidden' ||\n // || chat._ === 'chatForbidden'\n (chat as Chat.chat).pFlags.left\n // || (chat as any).pFlags.kicked\n ) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Won't save migrated from peer, forbidden peers, left and kicked\n */\n public saveDialog({\n dialog,\n folderId,\n ignoreOffsetDate,\n saveGlobalOffset\n }: {\n dialog: Dialog | ForumTopic,\n folderId?: REAL_FOLDER_ID,\n ignoreOffsetDate?: boolean,\n saveGlobalOffset?: boolean\n }) {\n const isTopic = this.isTopic(dialog);\n const isDialog = !isTopic;\n\n const topicId = isTopic ? dialog.id = generateMessageId(dialog.id) : undefined;\n if(!isTopic) {\n folderId ??= dialog.folder_id ?? FOLDER_ID_ALL;\n }\n\n const peerId = this.appPeersManager.getPeerId(dialog.peer);\n if(!peerId) {\n console.error('saveConversation no peerId???', dialog, folderId);\n return false;\n }\n\n if(!isTopic && dialog._ !== 'dialog'/* || peerId === 239602833 */) {\n console.error('saveConversation not regular dialog', dialog, Object.assign({}, dialog));\n }\n\n if(isDialog && !this.canSaveDialogByPeerId(peerId)) {\n return false;\n }\n\n const channelId = this.appPeersManager.isChannel(peerId) ? peerId.toChatId() : NULL_PEER_ID;\n\n if(isDialog) {\n const peerText = this.appPeersManager.getPeerSearchText(peerId);\n this.dialogsIndex.indexObject(peerId, peerText);\n }\n\n const wasDialogBefore = this.getDialogOrTopic(peerId, topicId);\n\n let mid: number, message: MyMessage;\n if(dialog.top_message) {\n mid = generateMessageId(dialog.top_message);// dialog.top_message;\n\n // preserve outgoing message\n const wasTopMessage = wasDialogBefore?.top_message && this.appMessagesManager.getMessageByPeer(peerId, wasDialogBefore.top_message) as MyMessage;\n if(wasTopMessage?.pFlags?.is_outgoing && wasDialogBefore.top_message >= mid) {\n mid = wasDialogBefore.top_message;\n }\n\n message = this.appMessagesManager.getMessageByPeer(peerId, mid);\n } else {\n mid = this.appMessagesManager.generateTempMessageId(peerId);\n message = {\n _: 'message',\n id: mid,\n mid,\n from_id: this.appPeersManager.getOutputPeer(this.appUsersManager.getSelf().id.toPeerId(false)),\n peer_id: this.appPeersManager.getOutputPeer(peerId),\n deleted: true,\n pFlags: {out: true},\n date: 0,\n message: ''\n };\n this.appMessagesManager.saveMessages([message], {isOutgoing: true});\n }\n\n if(!message?.pFlags) {\n this.appMessagesManager.log.error('saveConversation no message:', dialog, message);\n }\n\n if(isDialog && !channelId && peerId.isAnyChat()) {\n const chat = this.appChatsManager.getChat(peerId.toChatId()) as Chat.chat;\n if(chat && chat.migrated_to && chat.pFlags.deactivated) {\n const migratedToPeer = this.appPeersManager.getPeerId(chat.migrated_to);\n this.appMessagesManager.migratedFromTo[peerId] = migratedToPeer;\n this.appMessagesManager.migratedToFrom[migratedToPeer] = peerId;\n dialog.migratedTo = migratedToPeer;\n // return;\n }\n }\n\n dialog.top_message = mid;\n // dialog.unread_count = wasDialogBefore && dialog.read_inbox_max_id === getServerMessageId(wasDialogBefore.read_inbox_max_id) ? wasDialogBefore.unread_count : dialog.unread_count;\n dialog.read_inbox_max_id = generateMessageId(wasDialogBefore && !dialog.read_inbox_max_id ? wasDialogBefore.read_inbox_max_id : dialog.read_inbox_max_id);\n dialog.read_outbox_max_id = generateMessageId(wasDialogBefore && !dialog.read_outbox_max_id ? wasDialogBefore.read_outbox_max_id : dialog.read_outbox_max_id);\n\n if(isDialog && dialog.folder_id === undefined) {\n if(dialog._ === 'dialog') {\n // ! СЛОЖНО ! СМОТРИ В getTopMessages\n dialog.folder_id = wasDialogBefore ? (wasDialogBefore as typeof dialog).folder_id : folderId;\n }/* else if(dialog._ === 'dialogFolder') {\n dialog.folder_id = dialog.folder.id;\n } */\n }\n\n dialog.draft = this.appDraftsManager.saveDraft({peerId, threadId: topicId, draft: dialog.draft});\n dialog.peerId = peerId;\n // dialog.indexes ??= {} as any;\n\n // Because we saved message without dialog present\n if(message && message.pFlags.is_outgoing) {\n const isOut = message.pFlags.out;\n if(mid > dialog[isOut ? 'read_outbox_max_id' : 'read_inbox_max_id']) {\n message.pFlags.unread = true;\n\n if(!dialog.unread_count && !isOut) {\n ++dialog.unread_count;\n }\n } else {\n delete message.pFlags.unread;\n }\n }\n\n const historyStorage = this.appMessagesManager.getHistoryStorage(peerId, topicId);\n const slice = historyStorage.history.slice;\n /* if(historyStorage === undefined) { // warning\n historyStorage.history.push(mid);\n } else */if(!slice.length) {\n historyStorage.history.unshift(mid);\n historyStorage.count ||= 1;\n if(this.appMessagesManager.mergeReplyKeyboard(historyStorage, message)) {\n this.rootScope.dispatchEvent('history_reply_markup', {peerId});\n }\n } else if(!slice.isEnd(SliceEnd.Bottom)) { // * this will probably never happen, however, if it does, then it will fix slice with top_message\n const slice = historyStorage.history.insertSlice([mid]);\n slice.setEnd(SliceEnd.Bottom);\n historyStorage.count ||= 1;\n if(this.appMessagesManager.mergeReplyKeyboard(historyStorage, message)) {\n this.rootScope.dispatchEvent('history_reply_markup', {peerId});\n }\n }\n\n historyStorage.maxId = mid;\n historyStorage.readMaxId = dialog.read_inbox_max_id;\n historyStorage.readOutboxMaxId = dialog.read_outbox_max_id;\n\n this.appNotificationsManager.savePeerSettings({\n peerId,\n threadId: isTopic ? dialog.id : undefined,\n settings: dialog.notify_settings\n });\n\n if(isDialog && channelId && dialog.pts) {\n this.apiUpdatesManager.addChannelState(channelId, dialog.pts);\n }\n\n this.generateIndexForDialog(dialog);\n\n if(wasDialogBefore) {\n // fix unread count\n const releaseUnreadCount = this.dialogsStorage.prepareDialogUnreadCountModifying(wasDialogBefore);\n safeReplaceObject(wasDialogBefore, dialog);\n releaseUnreadCount();\n }\n\n this.pushDialog({\n dialog,\n offsetDate: message?.date,\n ignoreOffsetDate,\n saveGlobalOffset\n });\n\n if(isTopic) {\n this.processTopicUpdate(dialog, wasDialogBefore as ForumTopic);\n }\n\n return true;\n }\n\n public processTopicUpdate(topic: ForumTopic, oldTopic?: ForumTopic) {\n if(!oldTopic) {\n return;\n }\n\n const {peerId, id: threadId} = topic;\n const isIconChanged = topic.icon_emoji_id !== (oldTopic as ForumTopic).icon_emoji_id;\n const isTitleChanged = topic.title !== (oldTopic as ForumTopic).title;\n const isChanged = isIconChanged || isTitleChanged;\n\n if(isIconChanged) {\n this.rootScope.dispatchEvent('avatar_update', {peerId, threadId});\n }\n\n if(isChanged) {\n this.rootScope.dispatchEvent('peer_title_edit', {peerId, threadId});\n }\n }\n\n public getDialogs(options: {\n query?: string,\n offsetIndex?: number,\n limit?: number,\n filterId?: number,\n skipMigrated?: boolean\n }): MaybePromise<{\n dialogs: Folder['dialogs'],\n count: number,\n isTopEnd: boolean,\n isEnd: boolean\n }> {\n const {\n query = '',\n offsetIndex,\n limit = 20,\n filterId = FOLDER_ID_ALL,\n skipMigrated = false\n } = options;\n\n const isForum = this.isFilterIdForForum(filterId);\n if(!isForum && !REAL_FOLDERS.has(filterId)) {\n const promises: Promise[] = [];\n\n const fillContactsResult = this.appUsersManager.fillContacts();\n if(!fillContactsResult.cached) {\n promises.push(fillContactsResult.promise);\n }\n\n const reloadMissingDialogsPromise = this.filtersStorage.reloadMissingPeerIds(filterId);\n if(reloadMissingDialogsPromise) {\n promises.push(reloadMissingDialogsPromise);\n }\n\n if(promises.length) {\n return Promise.all(promises).then(() => {\n return this.getDialogs(options);\n });\n }\n }\n\n // let's load only first pages by certain folderId. next pages will load without folder filtering\n const realFolderId/* : REAL_FOLDER_ID */ =\n (!REAL_FOLDERS.has(filterId) || this.getOffsetDate(filterId)) && !isForum ?\n GLOBAL_FOLDER_ID :\n filterId/* as REAL_FOLDER_ID */;\n let curDialogStorage = this.getFolderDialogs(filterId, skipMigrated);\n\n const indexKey = this.getDialogIndexKeyByFilterId(filterId);\n\n if(query && !isForum) {\n if(!limit || this.cachedResults.query !== query || this.cachedResults.folderId !== filterId) {\n this.cachedResults.query = query;\n this.cachedResults.folderId = filterId;\n\n const results = this.dialogsIndex.search(query);\n\n const dialogs: Dialog[] = [];\n for(const peerId in this.dialogs) {\n const dialog = this.dialogs[peerId];\n if(results.has(dialog.peerId) && dialog.folder_id === filterId) {\n dialogs.push(dialog);\n }\n }\n\n dialogs.sort((d1, d2) => this.getDialogIndex(d2, indexKey) - this.getDialogIndex(d1, indexKey));\n this.cachedResults.dialogs = dialogs;\n this.cachedResults.count = dialogs.length;\n }\n\n curDialogStorage = this.cachedResults.dialogs;\n } else {\n this.cachedResults.query = '';\n }\n\n let offset = 0;\n if(offsetIndex > 0) {\n for(let length = curDialogStorage.length; offset < length; ++offset) {\n if(offsetIndex > this.getDialogIndex(curDialogStorage[offset], indexKey)) {\n break;\n }\n }\n }\n\n const loadedAll = this.isDialogsLoaded(realFolderId);\n const isEnoughDialogs = curDialogStorage.length >= (offset + limit);\n if(query || loadedAll || isEnoughDialogs) {\n const dialogs = curDialogStorage.slice(offset, offset + limit);\n return {\n dialogs,\n count: loadedAll ? curDialogStorage.length : null,\n isTopEnd: curDialogStorage.length && ((dialogs[0] && dialogs[0] === curDialogStorage[0]) || this.getDialogIndex(curDialogStorage[0], indexKey) < offsetIndex),\n isEnd: (query || loadedAll) && (offset + limit) >= curDialogStorage.length\n };\n }\n\n return this.appMessagesManager.getTopMessages({limit, folderId: realFolderId}).then((result) => {\n // const curDialogStorage = this[folderId];\n if(skipMigrated) {\n curDialogStorage = this.getFolderDialogs(filterId, skipMigrated);\n }\n\n offset = 0;\n if(offsetIndex > 0) {\n for(let length = curDialogStorage.length; offset < length; ++offset) {\n if(offsetIndex > this.getDialogIndex(curDialogStorage[offset], indexKey)) {\n break;\n }\n }\n }\n\n // this.log.warn(offset, offset + limit, curDialogStorage.dialogs.length, this.dialogs.length);\n\n const dialogs = curDialogStorage.slice(offset, offset + limit);\n return {\n dialogs,\n count: result.count === undefined ? curDialogStorage.length : result.count,\n isTopEnd: curDialogStorage.length && ((dialogs[0] && dialogs[0] === curDialogStorage[0]) || this.getDialogIndex(curDialogStorage[0], indexKey) < offsetIndex),\n // isEnd: this.isDialogsLoaded(realFolderId) && (offset + limit) >= curDialogStorage.length\n isEnd: result.isEnd\n };\n });\n }\n\n // * FORUMS SECTION\n\n public flushForumTopicsCache(peerId: PeerId) {\n const cache = this.forumTopics.get(peerId);\n if(!cache) {\n return;\n }\n\n const folder = this.folders[peerId];\n if(folder) {\n if(folder.dispatchUnreadTimeout) {\n clearTimeout(folder.dispatchUnreadTimeout);\n }\n\n delete this.allDialogsLoaded[peerId];\n delete this.pinnedOrders[peerId];\n delete this.dialogsOffsetDate[peerId];\n delete this.folders[peerId];\n }\n\n cache.topics.clear();\n\n // for permanent delete\n // this.forumTopics.delete(peerId);\n }\n\n public getForumTopicsCache(peerId: PeerId) {\n let forumTopics = this.forumTopics.get(peerId);\n if(!forumTopics) {\n forumTopics = {\n topics: new Map(),\n deletedTopics: new Set(),\n getTopicPromises: new Map()\n };\n\n this.forumTopics.set(peerId, forumTopics);\n }\n\n return forumTopics;\n }\n\n public getForumTopicById(peerId: PeerId, topicId?: number): Promise {\n if(!this.appPeersManager.isForum(peerId)) {\n return Promise.reject(makeError('CHANNEL_FORUM_MISSING'));\n }\n\n const cache = this.getForumTopicsCache(peerId);\n let promise: CancellablePromise;\n if(topicId) {\n promise = cache.getTopicPromises.get(topicId);\n if(promise) {\n return promise;\n }\n\n if(cache.deletedTopics.has(topicId)) {\n return Promise.resolve(undefined);\n }\n\n cache.getTopicPromises.set(topicId, promise = deferredPromise());\n }\n\n cache.getTopicsPromise ??= pause(0).then(() => {\n const promises: {[topicId: number]: typeof promise} = {};\n const ids: number[] = [];\n for(const [topicId, promise] of cache.getTopicPromises) {\n promises[topicId] = promise;\n ids.push(getServerMessageId(topicId));\n }\n\n cache.getTopicPromises.clear();\n\n const fullfillLeft = () => {\n for(const topicId in promises) {\n promises[topicId].resolve(undefined);\n cache.deletedTopics.add(+topicId);\n }\n };\n\n if(this.getForumTopicsCache(peerId) !== cache) {\n fullfillLeft();\n return;\n }\n\n return this.apiManager.invokeApi('channels.getForumTopicsByID', {\n channel: this.appChatsManager.getChannelInput(peerId.toChatId()),\n topics: ids\n }).then((messagesForumTopics) => {\n if(this.getForumTopicsCache(peerId) !== cache) {\n return;\n }\n\n this.applyDialogs(messagesForumTopics, peerId);\n\n messagesForumTopics.topics.forEach((forumTopic) => {\n if(forumTopic._ === 'forumTopic') {\n promises[forumTopic.id].resolve(forumTopic);\n delete promises[peerId];\n }\n });\n\n return messagesForumTopics;\n }, () => {}).then(() => {\n fullfillLeft();\n\n cache.getTopicsPromise = undefined;\n if(cache.getTopicPromises.size) {\n this.getForumTopicById(peerId);\n }\n });\n });\n\n return promise || cache.getTopicsPromise;\n }\n\n // public getForumTopicById(peerId: PeerId, topicId: number) {\n // return this.getForumTopicsByID(peerId, topicId).then((result) => result.topics[0]);\n // }\n\n public getForumTopic(peerId: PeerId, topicId: number) {\n const forumTopics = this.forumTopics.get(peerId);\n return forumTopics?.topics?.get(topicId);\n }\n\n public getForumTopicOrReload(peerId: PeerId, topicId: number) {\n const forumTopic = this.getForumTopic(peerId, topicId);\n if(forumTopic) {\n return forumTopic;\n }\n\n const cache = this.getForumTopicsCache(peerId);\n return cache?.deletedTopics?.has(topicId) ? undefined : this.getForumTopicById(peerId, topicId);\n }\n\n public processTopics>(peerId: PeerId, result: T) {\n return callbackify(result, (result) => {\n if('pts' in result) {\n this.apiUpdatesManager.addChannelState(peerId.toChatId(), result.pts);\n }\n\n const peer = this.appPeersManager.getOutputPeer(peerId);\n result.topics = result.topics.map((topic) => {\n if(topic._ === 'forumTopicDeleted') {\n return;\n }\n\n (topic as ForumTopic).peer = peer;\n topic.id = generateMessageId(topic.id);\n return topic;\n }).filter(Boolean);\n\n return result;\n });\n }\n\n public processTopicsPromise[1]>>(peerId: PeerId, promise: T): T {\n return promise.then((result) => {\n this.processTopics(peerId, result);\n return result;\n }) as any;\n }\n\n public getForumUnreadCount(peerId: PeerId) {\n if(!this.appPeersManager.isForum(peerId)) {\n return;\n }\n\n const folder = this.getFolder(peerId);\n\n const f = folder.dialogs.length >= 20 || this.isDialogsLoaded(peerId) ?\n folder.dialogs.slice(0, 20) :\n callbackify(this.getDialogs({filterId: peerId, limit: 20}), (result) => {\n return result.dialogs;\n });\n\n return callbackify(f, (dialogs) => {\n return {\n count: dialogs.reduce((acc, v) => acc + +!!v.unread_count, 0),\n hasUnmuted: dialogs.some((dialog) => dialog.unread_count && this.isDialogUnmuted(dialog))\n };\n });\n }\n\n // * FORUMS SECTION END\n\n private handleDialogTogglePinned(dialog: Dialog | ForumTopic, pinned: boolean, folderId: number) {\n if(dialog) {\n if(!pinned) {\n this.handleDialogUnpinning(dialog, folderId);\n } else { // means set\n dialog.pFlags.pinned = true;\n }\n\n this.generateIndexForDialog(dialog);\n }\n\n this.appMessagesManager.scheduleHandleNewDialogs(dialog.peerId, dialog);\n }\n\n private handleDialogsPinned(folderId: number, order: (Dialog['peerId'] | ForumTopic['id'])[]) {\n const isForum = this.isFilterIdForForum(folderId);\n this.resetPinnedOrder(folderId);\n this.getPinnedOrders(folderId).push(...order);\n this.savePinnedOrders();\n order.reverse(); // index must be higher\n const newPinned: {[id: typeof order[0]]: true} = {};\n order.forEach((id) => {\n newPinned[id] = true;\n\n const peerId = isForum ? folderId : id;\n const topicId = isForum ? id : undefined;\n\n const dialog = this.getDialogOrTopic(peerId, topicId);\n this.appMessagesManager.scheduleHandleNewDialogs(peerId, dialog);\n if(!dialog) {\n return;\n }\n\n dialog.pFlags.pinned = true;\n this.generateIndexForDialog(dialog);\n });\n\n const dialogs = this.getFolderDialogs(folderId, false);\n for(const dialog of dialogs) {\n if(!dialog.pFlags.pinned) {\n break;\n }\n\n if(!newPinned[this.getDialogKey(dialog)]) {\n delete dialog.pFlags.pinned;\n this.generateIndexForDialog(dialog);\n this.appMessagesManager.scheduleHandleNewDialogs(dialog.peerId, dialog);\n }\n }\n }\n\n // only 0 and 1 folders\n private onUpdateFolderPeers = (update: Update.updateFolderPeers) => {\n // this.log('updateFolderPeers', update);\n const peers = update.folder_peers;\n\n peers.forEach((folderPeer) => {\n const {folder_id, peer} = folderPeer;\n\n const peerId = this.appPeersManager.getPeerId(peer);\n const dialog = this.dropDialog(peerId)[0];\n if(dialog) {\n if(dialog.pFlags?.pinned) {\n this.handleDialogUnpinning(dialog, folder_id);\n }\n\n (dialog as Dialog).folder_id = folder_id as REAL_FOLDER_ID;\n this.generateIndexForDialog(dialog);\n this.pushDialog({dialog}); // need for simultaneously updatePinnedDialogs\n }\n\n this.appMessagesManager.scheduleHandleNewDialogs(peerId, dialog);\n });\n };\n\n private onUpdateDialogPinned = (update: Update.updateDialogPinned) => {\n const folderId = update.folder_id ?? FOLDER_ID_ALL;\n // this.log('updateDialogPinned', update);\n const peerId = this.appPeersManager.getPeerId((update.peer as DialogPeer.dialogPeer).peer);\n const dialog = this.getDialogOnly(peerId);\n\n // этот код внизу никогда не сработает, в папках за пиннед отвечает updateDialogFilter\n /* if(update.folder_id > 1) {\n const filter = this.filtersStorage.filters[update.folder_id];\n if(update.pFlags.pinned) {\n filter.pinned_peers.unshift(peerId);\n } else {\n filter.pinned_peers.findAndSplice((p) => p === peerId);\n }\n } */\n\n this.handleDialogTogglePinned(dialog, update.pFlags.pinned, folderId);\n };\n\n private onUpdateChannelPinnedTopic = (update: Update.updateChannelPinnedTopic) => {\n const peerId = update.channel_id.toPeerId(true);\n const topicId = generateMessageId(update.topic_id);\n const topic = this.getForumTopic(peerId, topicId);\n if(!topic) {\n return;\n }\n\n this.handleDialogTogglePinned(topic, update.pFlags.pinned, this.getFilterIdForForum(topic));\n };\n\n private onUpdatePinnedDialogs = (update: Update.updatePinnedDialogs) => {\n const folderId = update.folder_id ?? FOLDER_ID_ALL;\n\n if(update.order) {\n this.handleDialogsPinned(folderId, update.order.map((peer) => this.appPeersManager.getPeerId((peer as DialogPeer.dialogPeer).peer)));\n } else {\n this.apiManager.invokeApi('messages.getPinnedDialogs', {\n folder_id: folderId\n }).then((dialogsResult) => {\n // * for test reordering and rendering\n // dialogsResult.dialogs.reverse();\n\n this.applyDialogs(dialogsResult);\n\n this.handleDialogsPinned(folderId, dialogsResult.dialogs.map((d) => d.peerId));\n });\n }\n };\n\n private onUpdateChannelPinnedTopics = async(update: Update.updateChannelPinnedTopics) => {\n const peerId = update.channel_id.toPeerId(true);\n const forumTopics = this.forumTopics.get(peerId);\n if(!forumTopics) {\n return;\n }\n\n const filterId = peerId;\n if(update.order) {\n const order = update.order.map((topicId) => generateMessageId(topicId));\n this.handleDialogsPinned(filterId, order);\n } else {\n const limit = await this.apiManager.getLimit('topicPin', true);\n\n const promise = this.apiManager.invokeApi('channels.getForumTopics', {\n channel: this.appChatsManager.getChannelInput(peerId.toChatId()),\n limit,\n offset_date: 0,\n offset_id: 0,\n offset_topic: 0\n });\n\n const result = await this.processTopics(peerId, promise);\n\n const topics = result.topics as ForumTopic[];\n const pinned = topics.filter((topic) => topic.pFlags.pinned);\n this.handleDialogsPinned(filterId, pinned.map((topic) => topic.id));\n }\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {DialogFilter, ForumTopic, Update} from '../../layer';\nimport type {Dialog} from '../appManagers/appMessagesManager';\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport copy from '../../helpers/object/copy';\nimport {AppManager} from '../appManagers/manager';\nimport findAndSplice from '../../helpers/array/findAndSplice';\nimport assumeType from '../../helpers/assumeType';\nimport {FOLDER_ID_ALL, FOLDER_ID_ARCHIVE, REAL_FOLDERS, REAL_FOLDER_ID, START_LOCAL_ID} from '../mtproto/mtproto_config';\nimport makeError from '../../helpers/makeError';\n\nexport type MyDialogFilter = DialogFilter.dialogFilter;\n\nconst convertment = [\n ['pinned_peers', 'pinnedPeerIds'],\n ['exclude_peers', 'excludePeerIds'],\n ['include_peers', 'includePeerIds']\n] as ['pinned_peers' | 'exclude_peers' | 'include_peers', 'pinnedPeerIds' | 'excludePeerIds' | 'includePeerIds'][];\n\nconst PREPENDED_FILTERS = REAL_FOLDERS.size;\n\nconst LOCAL_FILTER: MyDialogFilter = {\n _: 'dialogFilter',\n pFlags: {},\n flags: 0,\n id: 0,\n title: '',\n exclude_peers: [],\n include_peers: [],\n pinned_peers: [],\n excludePeerIds: [],\n includePeerIds: [],\n pinnedPeerIds: []\n};\n\nexport default class FiltersStorage extends AppManager {\n private filters: {[filterId: string]: MyDialogFilter};\n private filtersArr: Array;\n private localFilters: {[filterId: string]: MyDialogFilter};\n private localId: number;\n private reloadedPeerIds: Set;\n\n protected after() {\n this.clear(true);\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateDialogFilter: this.onUpdateDialogFilter,\n\n updateDialogFilters: this.onUpdateDialogFilters,\n\n updateDialogFilterOrder: this.onUpdateDialogFilterOrder\n });\n\n // delete peers when dialog is being dropped\n /* rootScope.addEventListener('peer_deleted', (peerId) => {\n for(const filterId in this.filters) {\n const filter = this.filters[filterId];\n let modified = false;\n [filter.pinned_peers, filter.include_peers, filter.exclude_peers].forEach((arr) => {\n forEachReverse(arr, (inputPeer, idx) => {\n if(getPeerId(inputPeer) === peerId) {\n arr.splice(idx, 1);\n modified = true;\n }\n });\n });\n\n if(modified) {\n this.saveDialogFilter(filter, true);\n }\n }\n }); */\n\n this.rootScope.addEventListener('premium_toggle', () => {\n this.onUpdateDialogFilters({_: 'updateDialogFilters'});\n });\n\n return this.appStateManager.getState().then((state) => {\n const filtersArr = this.prependFilters(state.filtersArr);\n filtersArr.map((filter) => {\n this.saveDialogFilter(filter, false, true);\n });\n });\n }\n\n /**\n * ! use it only with saving\n */\n private prependFilters(filters: DialogFilter[]) {\n filters = filters.slice();\n\n const allChatsFilter = this.localFilters[FOLDER_ID_ALL];\n const archiveFilter = this.localFilters[FOLDER_ID_ARCHIVE];\n\n const allChatsFilterIndex = filters.findIndex((filter) => filter._ === 'dialogFilterDefault' || filter.id === FOLDER_ID_ALL);\n if(allChatsFilterIndex !== -1) filters[allChatsFilterIndex] = allChatsFilter;\n else filters.unshift(allChatsFilter);\n\n findAndSplice(filters, (filter) => (filter as MyDialogFilter).id === FOLDER_ID_ARCHIVE);\n filters.splice(/* 1 */filters[0] === allChatsFilter ? 1 : 0, 0, archiveFilter);\n\n this.localId = START_LOCAL_ID;\n filters.forEach((filter) => {\n delete filter.localId;\n });\n\n return filters;\n }\n\n private generateLocalFilter(id: REAL_FOLDER_ID) {\n const filter: MyDialogFilter = {...copy(LOCAL_FILTER), id};\n if(id === FOLDER_ID_ALL) {\n filter.pFlags.exclude_archived = true;\n } else if(id === FOLDER_ID_ARCHIVE) {\n filter.pFlags.exclude_unarchived = true;\n }\n\n if(REAL_FOLDERS.has(id)) {\n filter.pinnedPeerIds = this.dialogsStorage.getPinnedOrders(id);\n }\n\n return filter;\n }\n\n // private getLocalFilter(id: number) {\n // return this.filters[id] ??= this.generateLocalFilter(id);\n // }\n\n public clear = (init?: boolean) => {\n if(!init) {\n // safeReplaceObject(this.filters, {});\n this.reloadedPeerIds.clear();\n this.clearFilters();\n } else {\n this.filters = {};\n this.filtersArr = [];\n this.reloadedPeerIds = new Set();\n\n this.localFilters = {};\n for(const filterId of REAL_FOLDERS) {\n this.localFilters[filterId] = this.generateLocalFilter(filterId as REAL_FOLDER_ID);\n }\n }\n\n this.localId = START_LOCAL_ID;\n };\n\n private onUpdateDialogFilter = (update: Update.updateDialogFilter) => {\n if(update.filter) {\n this.saveDialogFilter(update.filter as any);\n } else if(this.filters[update.id]) { // Папка удалена\n // this.getDialogFilters(true);\n this.rootScope.dispatchEvent('filter_delete', this.filters[update.id]);\n delete this.filters[update.id];\n findAndSplice(this.filtersArr, (filter) => (filter as DialogFilter.dialogFilter).id === update.id);\n }\n\n this.pushToState();\n };\n\n private onUpdateDialogFilters = (update: Update.updateDialogFilters) => {\n // console.warn('updateDialogFilters', update);\n\n const oldFilters = copy(this.filters);\n\n this.getDialogFilters(true).then((filters) => {\n for(const _filterId in oldFilters) {\n const filterId = +_filterId;\n if(!filters.find((filter) => filter.id === filterId)) { // * deleted\n this.onUpdateDialogFilter({_: 'updateDialogFilter', id: filterId});\n }\n }\n\n this.onUpdateDialogFilterOrder({_: 'updateDialogFilterOrder', order: filters.map((filter) => filter.id)});\n });\n };\n\n private onUpdateDialogFilterOrder = (update: Update.updateDialogFilterOrder) => {\n // console.log('updateDialogFilterOrder', update);\n\n const order = update.order.slice();\n if(!order.includes(FOLDER_ID_ARCHIVE)) {\n order.splice(order[0] === FOLDER_ID_ALL ? 1 : 0, 0, FOLDER_ID_ARCHIVE);\n }\n\n this.localId = START_LOCAL_ID;\n order.forEach((filterId) => {\n const filter = this.filters[filterId];\n delete filter.localId;\n this.setLocalId(filter);\n });\n\n this.rootScope.dispatchEvent('filter_order', order);\n\n this.pushToState();\n };\n\n private pushToState() {\n this.appStateManager.pushToState('filtersArr', this.filtersArr);\n }\n\n public testDialogForFilter(dialog: Dialog | ForumTopic.forumTopic, filter?: MyDialogFilter) {\n if(!filter) {\n return true;\n }\n\n if(REAL_FOLDERS.has(filter.id)) {\n return (dialog as Dialog).folder_id === filter.id && this.dialogsStorage.canSaveDialogByPeerId(dialog.peerId);\n }\n\n const peerId = dialog.peerId;\n\n // * check whether dialog exists\n if(!this.appMessagesManager.getDialogOnly(peerId)) {\n return false;\n }\n\n // exclude_peers\n if(filter.excludePeerIds.includes(peerId)) {\n return false;\n }\n\n // include_peers\n if(filter.includePeerIds.includes(peerId)) {\n return true;\n }\n\n const pFlags = filter.pFlags;\n\n // exclude_archived\n if(pFlags.exclude_archived && (dialog as Dialog).folder_id === FOLDER_ID_ARCHIVE) {\n return false;\n }\n\n // exclude_read\n if(pFlags.exclude_read && !this.appMessagesManager.isDialogUnread(dialog)) {\n return false;\n }\n\n // exclude_muted\n if(pFlags.exclude_muted && this.appNotificationsManager.isPeerLocalMuted({peerId}) && !(dialog.unread_mentions_count && dialog.unread_count)) {\n return false;\n }\n\n if(this.appPeersManager.isAnyChat(peerId)) {\n // broadcasts\n if(pFlags.broadcasts && this.appPeersManager.isBroadcast(peerId)) {\n return true;\n }\n\n // groups\n if(pFlags.groups && this.appPeersManager.isAnyGroup(peerId)) {\n return true;\n }\n } else {\n const userId = peerId.toUserId();\n\n // bots\n if(this.appUsersManager.isBot(userId)) {\n return !!pFlags.bots;\n }\n\n // non_contacts\n if(pFlags.non_contacts && !this.appUsersManager.isContact(userId)) {\n return true;\n }\n\n // contacts\n if(pFlags.contacts && this.appUsersManager.isContact(userId)) {\n return true;\n }\n }\n\n return false;\n }\n\n public testDialogForFilterId(dialog: Dialog, filterId: number) {\n return this.testDialogForFilter(dialog, this.filters[filterId]);\n }\n\n public getFilter(filterId: number) {\n return this.filters[filterId];\n }\n\n public getFilters() {\n return this.filters;\n }\n\n public clearFilters() {\n const filters = this.getFilters();\n for(const filterId in filters) { // delete filters\n if(REAL_FOLDERS.has(+filterId)) {\n continue;\n }\n\n this.onUpdateDialogFilter({\n _: 'updateDialogFilter',\n id: +filterId\n });\n }\n }\n\n public async toggleDialogPin(peerId: PeerId, filterId: number) {\n const filter = this.filters[filterId];\n\n const index = filter.pinnedPeerIds.indexOf(peerId);\n const wasPinned = index !== -1;\n\n if(wasPinned) {\n filter.pinned_peers.splice(index, 1);\n filter.pinnedPeerIds.splice(index, 1);\n }\n\n if(!wasPinned) {\n if(filter.pinned_peers.length >= (await this.apiManager.getConfig()).pinned_infolder_count_max) {\n return Promise.reject(makeError('PINNED_DIALOGS_TOO_MUCH'));\n }\n\n filter.pinned_peers.unshift(this.appPeersManager.getInputPeerById(peerId));\n filter.pinnedPeerIds.unshift(peerId);\n }\n\n return this.updateDialogFilter(filter);\n }\n\n public createDialogFilter(filter: MyDialogFilter, prepend?: boolean) {\n const maxId = Math.max(1, ...Object.keys(this.filters).map((i) => +i));\n filter = copy(filter);\n filter.id = maxId + 1;\n return this.updateDialogFilter(filter, undefined, prepend);\n }\n\n public updateDialogFilter(filter: MyDialogFilter, remove = false, prepend = false) {\n const flags = remove ? 0 : 1;\n\n return this.apiManager.invokeApi('messages.updateDialogFilter', {\n flags,\n id: filter.id,\n filter: remove ? undefined : this.getOutputDialogFilter(filter)\n }).then((bool) => { // возможно нужна проверка и откат, если результат не ТРУ\n // console.log('updateDialogFilter bool:', bool);\n\n /* if(!this.filters[filter.id]) {\n this.saveDialogFilter(filter);\n }\n\n rootScope.$broadcast('filter_update', filter); */\n\n this.onUpdateDialogFilter({\n _: 'updateDialogFilter',\n id: filter.id,\n filter: remove ? undefined : filter as any\n });\n\n if(prepend) {\n const f: MyDialogFilter[] = [];\n for(const filterId in this.filters) {\n const filter = this.filters[filterId];\n ++filter.localId;\n f.push(filter);\n }\n\n filter.localId = START_LOCAL_ID;\n\n const order = f.sort((a, b) => a.localId - b.localId).map((filter) => filter.id);\n this.onUpdateDialogFilterOrder({\n _: 'updateDialogFilterOrder',\n order\n });\n }\n });\n }\n\n public updateDialogFiltersOrder(order: number[]) {\n return this.apiManager.invokeApi('messages.updateDialogFiltersOrder', {\n order\n }).then(() => {\n this.onUpdateDialogFilterOrder({\n _: 'updateDialogFilterOrder',\n order\n });\n });\n }\n\n public getOutputDialogFilter(filter: MyDialogFilter) {\n const c = copy(filter);\n /* convertment.forEach(([from, to]) => {\n c[from] = c[to].map((peerId) => this.appPeersManager.getInputPeerById(peerId));\n }); */\n\n this.filterIncludedPinnedPeers(filter);\n\n return c;\n }\n\n private filterIncludedPinnedPeers(filter: MyDialogFilter) {\n forEachReverse(filter.includePeerIds, (peerId, idx) => {\n if(filter.pinnedPeerIds.includes(peerId)) {\n filter.include_peers.splice(idx, 1);\n filter.includePeerIds.splice(idx, 1);\n }\n });\n }\n\n // private spliceMissingPeerIds(filterId: number, type: ArgumentTypes[1], missingPeerIds: PeerId[]) {\n // const filter = this.getFilter(filterId);\n // const peers = filter && filter[type];\n // if(!peers?.length) {\n // return;\n // }\n\n // let spliced = false;\n // missingPeerIds.forEach((peerId) => {\n // const inputPeer = findAndSplice(peers, (inputPeer) => getPeerId(inputPeer) === peerId);\n // if(inputPeer) {\n // spliced = true;\n // }\n // });\n\n // if(spliced) {\n // this.onUpdateDialogFilter({\n // _: 'updateDialogFilter',\n // id: filterId,\n // filter\n // });\n // }\n // }\n\n public reloadMissingPeerIds(\n filterId: number,\n type: 'pinned_peers' | 'include_peers' | 'exclude_peers' = 'pinned_peers'\n ) {\n const filter = this.getFilter(filterId);\n const peers = filter?.[type];\n if(!peers?.length) {\n return;\n }\n\n // const missingPeerIds: PeerId[] = [];\n const reloadDialogs = peers.filter((inputPeer) => {\n const peerId = this.appPeersManager.getPeerId(inputPeer);\n const isAlreadyReloaded = this.reloadedPeerIds.has(peerId);\n const dialog = this.appMessagesManager.getDialogOnly(peerId);\n // if(isAlreadyReloaded && !dialog) {\n // missingPeerIds.push(peerId);\n // }\n\n const reload = !isAlreadyReloaded && !dialog;\n return reload;\n });\n\n if(!reloadDialogs.length) {\n // if(missingPeerIds.length) {\n // this.spliceMissingPeerIds(filterId, type, missingPeerIds);\n // }\n\n return;\n }\n\n const reloadPromises = reloadDialogs.map((inputPeer) => {\n const peerId = this.appPeersManager.getPeerId(inputPeer);\n const promise = this.appMessagesManager.reloadConversation(inputPeer)\n .then((dialog) => {\n this.reloadedPeerIds.add(peerId);\n\n return dialog ? undefined : peerId;\n });\n\n return promise;\n });\n\n const reloadPromise = Promise.all(reloadPromises).then((missingPeerIds) => {\n missingPeerIds = missingPeerIds.filter(Boolean);\n if(!missingPeerIds.length) {\n return;\n }\n\n // this.spliceMissingPeerIds(filterId, type, missingPeerIds);\n });\n\n return reloadPromise;\n }\n\n public async getDialogFilters(overwrite = false): Promise {\n const keys = Object.keys(this.filters);\n if(keys.length > PREPENDED_FILTERS && !overwrite) {\n return keys.map((filterId) => this.filters[filterId]).sort((a, b) => a.localId - b.localId);\n }\n\n const filters = await this.apiManager.invokeApiSingle('messages.getDialogFilters');\n const prepended = this.prependFilters(filters);\n return prepended.map((filter) => this.saveDialogFilter(filter, overwrite)).filter(Boolean);\n }\n\n public getSuggestedDialogsFilters() {\n return this.apiManager.invokeApi('messages.getSuggestedDialogFilters');\n }\n\n public saveDialogFilter(filter: DialogFilter, update = true, silent?: boolean) {\n // defineNotNumerableProperties(filter, ['includePeerIds', 'excludePeerIds', 'pinnedPeerIds']);\n\n if(filter._ === 'dialogFilterDefault') {\n filter = this.localFilters[FOLDER_ID_ALL];\n }\n\n assumeType(filter);\n if(!REAL_FOLDERS.has(filter.id)) {\n convertment.forEach(([from, to]) => {\n assumeType(filter);\n filter[to] = filter[from].map((peer) => this.appPeersManager.getPeerId(peer));\n });\n\n this.filterIncludedPinnedPeers(filter);\n\n filter.include_peers = filter.pinned_peers.concat(filter.include_peers);\n filter.includePeerIds = filter.pinnedPeerIds.concat(filter.includePeerIds);\n }\n\n const oldFilter = this.filters[filter.id];\n if(oldFilter) {\n Object.assign(oldFilter, filter);\n } else {\n this.filters[filter.id] = filter;\n }\n\n this.setLocalId(filter);\n\n if(!silent) {\n if(update) {\n this.rootScope.dispatchEvent('filter_update', filter);\n } else if(!oldFilter) {\n this.rootScope.dispatchEvent('filter_new', filter);\n }\n }\n\n return filter;\n }\n\n private setLocalId(filter: MyDialogFilter) {\n if(filter.localId !== undefined) {\n if(filter.localId >= this.localId) {\n this.localId = filter.localId + 1;\n }\n } else {\n filter.localId = this.localId++ as MyDialogFilter['localId'];\n findAndSplice(this.filtersArr, (_filter) => _filter.id === filter.id);\n this.filtersArr.push(filter);\n this.pushToState();\n }\n }\n\n public async isFilterIdAvailable(filterId: number) {\n if(REAL_FOLDERS.has(filterId)) {\n return true;\n }\n\n const limit = await this.apiManager.getLimit('folders');\n const isFolderAvailable = this.filtersArr.filter((filter) => !REAL_FOLDERS.has(filter.id)).slice(0, limit).some((filter) => filter.id === filterId);\n\n return isFolderAvailable;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function applyMixins(derivedCtor: any, constructors: any[]) {\n // const callbacks: Array<(...args: any[]) => any> = [];\n\n constructors.forEach((baseCtor) => {\n Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => {\n const value: PropertyDescriptor = Object.getOwnPropertyDescriptor(baseCtor.prototype, name) || Object.create(null);\n /* if(name === '_constructor') {\n callbacks.push(value.value);\n return;\n } else */if(name === 'constructor') {\n return;\n }\n\n Object.defineProperty(\n derivedCtor.prototype,\n name,\n value\n );\n });\n });\n\n // if(callbacks.length) {\n // function c(...args: any[]): any {\n // callbacks.forEach((cb, idx) => {\n // // @ts-ignore\n // cb.apply(this, args[idx] || []);\n // });\n // };\n\n // Object.defineProperty(derivedCtor.prototype, 'superConstructor', {\n // configurable: true,\n // enumerable: true,\n // value: c,\n // writable: true\n // });\n // }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport DEBUG from '../../config/debug';\nimport {ConstructorDeclMap, Message, MessageEntity, MessageFwdHeader, Peer, Update, Updates} from '../../layer';\nimport {logger, LogTypes} from '../logger';\nimport assumeType from '../../helpers/assumeType';\nimport App from '../../config/app';\nimport filterUnique from '../../helpers/array/filterUnique';\nimport {AppManager} from './manager';\nimport parseMarkdown from '../richTextProcessor/parseMarkdown';\nimport ctx from '../../environment/ctx';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport applyMixins from '../../helpers/applyMixins';\nimport tsNow from '../../helpers/tsNow';\n\ntype UpdatesState = {\n pendingPtsUpdates: (Update & {pts: number, pts_count: number})[],\n pendingSeqUpdates?: {[seq: number]: {seq: number, date: number, updates: any[]}},\n syncPending: {\n seqAwaiting?: number,\n ptsAwaiting?: boolean,\n timeout: number\n },\n syncLoading: Promise,\n\n seq?: number,\n pts?: number,\n date?: number,\n lastPtsUpdateTime?: number,\n lastDifferenceTime?: number\n};\n\nconst SYNC_DELAY = 6;\n\nclass ApiUpdatesManager {\n public updatesState: UpdatesState = {\n pendingPtsUpdates: [],\n pendingSeqUpdates: {},\n syncPending: null,\n syncLoading: null\n };\n\n private channelStates: {[channelId: ChatId]: UpdatesState} = {};\n private attached = false;\n\n private log = logger('UPDATES', LogTypes.Error | LogTypes.Warn | LogTypes.Log/* | LogTypes.Debug */);\n private debug = DEBUG;\n\n private subscriptions: {[channelId: ChatId]: {count: number, interval?: number}} = {};\n\n constructor() {\n this._constructor(false);\n }\n\n private setProxy() {\n const self = this;\n this.updatesState = new Proxy(this.updatesState, {\n set: function(target: ApiUpdatesManager['updatesState'], key: keyof ApiUpdatesManager['updatesState'], value: ApiUpdatesManager['updatesState'][typeof key]) {\n // @ts-ignore\n target[key] = value;\n self.saveUpdatesState();\n return true;\n }\n });\n }\n\n public saveUpdatesState() {\n const us = this.updatesState;\n this.appStateManager.pushToState('updates', {\n seq: us.seq,\n pts: us.pts,\n date: us.date\n });\n }\n\n private popPendingSeqUpdate() {\n const state = this.updatesState;\n const nextSeq = state.seq + 1;\n const pendingUpdatesData = state.pendingSeqUpdates[nextSeq];\n if(!pendingUpdatesData) {\n return false;\n }\n\n const updates = pendingUpdatesData.updates;\n for(let i = 0, length = updates.length; i < length; ++i) {\n this.saveUpdate(updates[i]);\n }\n\n state.seq = pendingUpdatesData.seq;\n if(pendingUpdatesData.date && state.date < pendingUpdatesData.date) {\n state.date = pendingUpdatesData.date;\n }\n delete state.pendingSeqUpdates[nextSeq];\n\n if(!this.popPendingSeqUpdate() &&\n state.syncPending?.seqAwaiting &&\n state.seq >= state.syncPending.seqAwaiting) {\n if(!state.syncPending.ptsAwaiting) {\n this.clearStatePendingSync(state);\n } else {\n delete state.syncPending.seqAwaiting;\n }\n }\n\n return true;\n }\n\n private popPendingPtsUpdate(channelId: ChatId) {\n const curState = channelId ? this.getChannelState(channelId) : this.updatesState;\n if(!curState.pendingPtsUpdates.length) {\n return false;\n }\n\n curState.pendingPtsUpdates.sort((a, b) => {\n return a.pts - b.pts;\n });\n // this.log('pop update', channelId, curState.pendingPtsUpdates)\n\n let curPts = curState.pts;\n let goodPts = 0;\n let goodIndex = 0;\n for(let i = 0, length = curState.pendingPtsUpdates.length; i < length; ++i) {\n const update = curState.pendingPtsUpdates[i];\n curPts += update.pts_count;\n if(curPts >= update.pts) {\n goodPts = update.pts;\n goodIndex = i;\n }\n }\n\n if(!goodPts) {\n return false;\n }\n\n this.debug && this.log.debug('pop pending pts updates', goodPts, curState.pendingPtsUpdates.slice(0, goodIndex + 1));\n\n curState.pts = goodPts;\n for(let i = 0; i <= goodIndex; ++i) {\n const update = curState.pendingPtsUpdates[i];\n\n // @ts-ignore\n this.saveUpdate(update);\n }\n curState.pendingPtsUpdates.splice(0, goodIndex + 1);\n\n if(!curState.pendingPtsUpdates.length && curState.syncPending) {\n if(!curState.syncPending.seqAwaiting) {\n this.clearStatePendingSync(curState);\n } else {\n delete curState.syncPending.ptsAwaiting;\n }\n }\n\n return true;\n }\n\n public forceGetDifference() {\n if(!this.updatesState.syncLoading) {\n this.getDifference();\n }\n }\n\n public processLocalUpdate(update: Update) {\n this.processUpdateMessage({\n _: 'updateShort',\n update\n } as Updates);\n }\n\n public processUpdateMessage = (updateMessage: any, options: Partial<{\n override: boolean\n }> = {}) => {\n // return forceGetDifference()\n const processOpts = {\n date: updateMessage.date,\n seq: updateMessage.seq,\n seqStart: updateMessage.seq_start\n // ignoreSyncLoading: options.ignoreSyncLoading\n };\n\n this.debug && this.log.debug('processUpdateMessage', updateMessage);\n\n switch(updateMessage._) {\n case 'updatesTooLong':\n case 'new_session_created':\n this.forceGetDifference();\n break;\n\n case 'updateShort':\n this.processUpdate(updateMessage.update, processOpts);\n break;\n\n case 'updateShortMessage':\n case 'updateShortChatMessage': {\n assumeType(updateMessage);\n this.debug && this.log.debug('updateShortMessage | updateShortChatMessage', {...updateMessage});\n const isOut = updateMessage.pFlags.out;\n const fromId = (updateMessage as Updates.updateShortChatMessage).from_id || (isOut ? this.appPeersManager.peerId : (updateMessage as Updates.updateShortMessage).user_id);\n const toId = (updateMessage as Updates.updateShortChatMessage).chat_id ?\n (updateMessage as Updates.updateShortChatMessage).chat_id.toPeerId(true) :\n ((updateMessage as Updates.updateShortMessage).user_id.toPeerId(false) || this.appPeersManager.peerId);\n\n this.processUpdate({\n _: 'updateNewMessage',\n message: {\n _: 'message',\n pFlags: updateMessage.pFlags,\n id: updateMessage.id,\n from_id: this.appPeersManager.getOutputPeer(fromId.toPeerId()),\n peer_id: this.appPeersManager.getOutputPeer(toId),\n date: updateMessage.date,\n message: updateMessage.message,\n fwd_from: updateMessage.fwd_from,\n reply_to: updateMessage.reply_to,\n entities: updateMessage.entities\n },\n pts: updateMessage.pts,\n pts_count: updateMessage.pts_count\n }, processOpts);\n break;\n }\n\n case 'updatesCombined':\n case 'updates':\n this.appUsersManager.saveApiUsers(updateMessage.users, options.override);\n this.appChatsManager.saveApiChats(updateMessage.chats, options.override);\n\n updateMessage.updates.forEach((update: Update) => {\n this.processUpdate(update, processOpts);\n });\n break;\n\n default:\n this.log.warn('Unknown update message', updateMessage);\n }\n };\n\n private getDifference(first = false): Promise {\n // this.trace('Get full diff')\n const updatesState = this.updatesState;\n const wasSyncing = updatesState.syncLoading;\n if(!wasSyncing) {\n updatesState.pendingSeqUpdates = {};\n updatesState.pendingPtsUpdates = [];\n }\n\n this.clearStatePendingSync(updatesState);\n\n const promise = this.apiManager.invokeApi('updates.getDifference', {\n pts: updatesState.pts,\n pts_total_limit: first /* && false */? /* 50 */1200 : undefined,\n date: updatesState.date,\n qts: -1\n }, {\n timeout: 0x7fffffff\n }).then((differenceResult) => {\n this.debug && this.log.debug('Get diff result', differenceResult);\n\n if(differenceResult._ === 'updates.differenceEmpty') {\n this.debug && this.log.debug('apply empty diff', differenceResult.seq);\n updatesState.date = differenceResult.date;\n updatesState.seq = differenceResult.seq;\n return;\n }\n\n // ! SORRY I'M SORRY I'M SORRY\n if(first) {\n this.rootScope.dispatchEvent('state_synchronizing');\n }\n\n if(differenceResult._ !== 'updates.differenceTooLong') {\n this.appUsersManager.saveApiUsers(differenceResult.users);\n this.appChatsManager.saveApiChats(differenceResult.chats);\n\n // Should be first because of updateMessageID\n // this.log('applying', differenceResult.other_updates.length, 'other updates')\n\n differenceResult.other_updates.forEach((update) => {\n switch(update._) {\n case 'updateChannelTooLong':\n case 'updateNewChannelMessage':\n case 'updateEditChannelMessage':\n this.processUpdate(update);\n return;\n }\n\n this.saveUpdate(update);\n });\n\n // this.log('applying', differenceResult.new_messages.length, 'new messages')\n differenceResult.new_messages.forEach((apiMessage) => {\n this.saveUpdate({\n _: 'updateNewMessage',\n message: apiMessage,\n pts: updatesState.pts,\n pts_count: 0\n });\n });\n\n const nextState = differenceResult._ === 'updates.difference' ? differenceResult.state : differenceResult.intermediate_state;\n updatesState.seq = nextState.seq;\n updatesState.pts = nextState.pts;\n updatesState.date = nextState.date;\n } else {\n updatesState.pts = differenceResult.pts;\n updatesState.date = tsNow(true) + this.timeManager.getServerTimeOffset();\n delete updatesState.seq;\n\n this.channelStates = {};\n\n this.log.warn('getDifference:', differenceResult._);\n this.onDifferenceTooLong();\n }\n\n // this.log('apply diff', updatesState.seq, updatesState.pts)\n\n if(differenceResult._ === 'updates.differenceSlice') {\n return this.getDifference();\n } else {\n this.debug && this.log.debug('finished get diff');\n }\n });\n\n if(!wasSyncing) {\n this.justAName(updatesState, promise);\n }\n\n return promise;\n }\n\n private clearStatePendingSync(state: UpdatesState) {\n if(state.syncPending) {\n clearTimeout(state.syncPending.timeout);\n state.syncPending = null;\n }\n }\n\n private getChannelDifference(channelId: ChatId): Promise {\n const channelState = this.getChannelState(channelId);\n const wasSyncing = channelState.syncLoading;\n if(!wasSyncing) {\n channelState.pendingPtsUpdates = [];\n }\n\n this.clearStatePendingSync(channelState);\n\n const log = this.debug ? this.log.bindPrefix('getChannelDifference-' + channelId) : undefined;\n // this.log.trace('Get channel diff', appChatsManager.getChat(channelId), channelState.pts);\n const promise = this.apiManager.invokeApi('updates.getChannelDifference', {\n channel: this.appChatsManager.getChannelInput(channelId),\n filter: {_: 'channelMessagesFilterEmpty'},\n pts: channelState.pts,\n limit: 1000\n }, {timeout: 0x7fffffff}).then((differenceResult) => {\n log?.debug('diff result', differenceResult)\n channelState.pts = 'pts' in differenceResult ? differenceResult.pts : undefined;\n channelState.lastDifferenceTime = Date.now();\n\n if(differenceResult._ === 'updates.channelDifferenceEmpty') {\n // log?.debug('apply channel empty diff', differenceResult);\n return;\n }\n\n if(differenceResult._ === 'updates.channelDifferenceTooLong') {\n // log?.debug('channel diff too long', differenceResult);\n delete this.channelStates[channelId];\n\n this.saveUpdate({_: 'updateChannelReload', channel_id: channelId});\n return;\n }\n\n this.appUsersManager.saveApiUsers(differenceResult.users);\n this.appChatsManager.saveApiChats(differenceResult.chats);\n\n // Should be first because of updateMessageID\n log?.debug('applying', differenceResult.other_updates.length, 'channel other updates');\n differenceResult.other_updates.forEach((update) => {\n this.saveUpdate(update);\n });\n\n log?.debug('applying', differenceResult.new_messages.length, 'channel new messages');\n differenceResult.new_messages.forEach((apiMessage) => {\n this.saveUpdate({\n _: 'updateNewChannelMessage',\n message: apiMessage,\n pts: channelState.pts,\n pts_count: 0\n });\n });\n\n log?.debug('apply channel diff', channelState.pts);\n\n if(differenceResult._ === 'updates.channelDifference' &&\n !differenceResult.pFlags.final) {\n return this.getChannelDifference(channelId);\n } else {\n log?.debug('finished channel get diff');\n }\n });\n\n if(!wasSyncing) {\n this.justAName(channelState, promise, channelId);\n }\n\n return promise;\n }\n\n private onDifferenceTooLong() {\n this.appUsersManager.clear();\n this.appChatsManager.clear();\n this.appMessagesManager.clear();\n\n this.rootScope.dispatchEvent('state_cleared');\n }\n\n private justAName(state: UpdatesState, promise: UpdatesState['syncLoading'], channelId?: ChatId) {\n state.syncLoading = promise;\n this.rootScope.dispatchEvent('state_synchronizing', channelId);\n\n promise.then(() => {\n state.syncLoading = null;\n this.rootScope.dispatchEvent('state_synchronized', channelId);\n }, () => {\n state.syncLoading = null;\n });\n }\n\n public addChannelState(channelId: ChatId, pts: number) {\n if(!pts) {\n throw new Error('Add channel state without pts ' + channelId);\n }\n\n return this.channelStates[channelId] ??= {\n pts,\n pendingPtsUpdates: [],\n syncPending: null,\n syncLoading: null\n };\n }\n\n public getChannelState(channelId: ChatId, pts?: number) {\n if(this.channelStates[channelId] === undefined) {\n this.addChannelState(channelId, pts);\n }\n\n return this.channelStates[channelId];\n }\n\n private processUpdate(update: Update, options: Partial<{\n date: number,\n seq: number,\n seqStart: number/* ,\n ignoreSyncLoading: boolean */\n }> = {}) {\n let channelId: ChatId;\n switch(update._) {\n case 'updateNewChannelMessage':\n case 'updateEditChannelMessage':\n channelId = this.appPeersManager.getPeerId(update.message.peer_id).toChatId();\n break;\n /* case 'updateDeleteChannelMessages':\n channelId = update.channel_id;\n break; */\n case 'updateChannelTooLong':\n channelId = update.channel_id;\n if(!(channelId in this.channelStates)) {\n return false;\n }\n break;\n default:\n if('channel_id' in update && 'pts' in update) {\n channelId = update.channel_id;\n }\n break;\n }\n\n const {pts, pts_count} = update as Update.updateNewMessage;\n const curState = channelId ? this.getChannelState(channelId, pts) : this.updatesState;\n\n // this.log.log('process', channelId, curState.pts, update)\n\n if(curState.syncLoading/* && !options.ignoreSyncLoading */) {\n return false;\n }\n\n if(update._ === 'updateChannelTooLong') {\n if(!curState.lastPtsUpdateTime ||\n curState.lastPtsUpdateTime < (Date.now() - SYNC_DELAY)) {\n // this.log.trace('channel too long, get diff', channelId, update)\n this.getChannelDifference(channelId);\n }\n return false;\n }\n\n if(update._ === 'updateNewMessage' ||\n update._ === 'updateEditMessage' ||\n update._ === 'updateNewChannelMessage' ||\n update._ === 'updateEditChannelMessage') {\n const message = update.message as Message.message;\n const toPeerId = this.appPeersManager.getPeerId(message.peer_id);\n const fwdHeader: MessageFwdHeader.messageFwdHeader = message.fwd_from || {} as any;\n let reason: string;\n if(message.from_id && !this.appUsersManager.hasUser(this.appPeersManager.getPeerId(message.from_id), message.pFlags.post/* || channelId*/) && (reason = 'author') ||\n fwdHeader.from_id && !this.appUsersManager.hasUser(this.appPeersManager.getPeerId(fwdHeader.from_id), !!(fwdHeader.from_id as Peer.peerChannel).channel_id) && (reason = 'fwdAuthor') ||\n (fwdHeader.from_id as Peer.peerChannel)?.channel_id && !this.appChatsManager.hasChat((fwdHeader.from_id as Peer.peerChannel).channel_id, true) && (reason = 'fwdChannel') ||\n toPeerId.isUser() && !this.appUsersManager.hasUser(toPeerId) && (reason = 'toPeer User') ||\n toPeerId.isAnyChat() && !this.appChatsManager.hasChat(toPeerId.toChatId()) && (reason = 'toPeer Chat')) {\n this.log.warn('Not enough data for message update', toPeerId, reason, message);\n if(channelId && this.appChatsManager.hasChat(channelId)) {\n this.getChannelDifference(channelId);\n } else {\n this.forceGetDifference();\n }\n return false;\n }\n } else if(channelId && !this.appChatsManager.hasChat(channelId)) {\n // this.log.log('skip update, missing channel', channelId, update)\n return false;\n }\n\n let popPts: boolean;\n let popSeq: boolean;\n\n if(pts) {\n const newPts = curState.pts + (pts_count || 0);\n if(newPts < pts) {\n this.debug && this.log.warn('Pts hole', curState, update, channelId && this.appChatsManager.getChat(channelId));\n curState.pendingPtsUpdates.push(update as Update.updateNewMessage);\n if(!curState.syncPending && !curState.syncLoading) {\n curState.syncPending = {\n timeout: ctx.setTimeout(() => {\n curState.syncPending = null;\n\n if(curState.syncLoading) {\n return;\n }\n\n if(channelId) {\n this.getChannelDifference(channelId);\n } else {\n this.getDifference();\n }\n }, SYNC_DELAY)\n };\n }\n\n curState.syncPending.ptsAwaiting = true;\n return false;\n }\n\n if(pts > curState.pts) {\n curState.pts = pts;\n popPts = true;\n\n curState.lastPtsUpdateTime = Date.now();\n } else if(pts_count) {\n // this.log.warn('Duplicate update', update)\n return false;\n }\n\n if(channelId && options.date && this.updatesState.date < options.date) {\n this.updatesState.date = options.date;\n }\n } else if(!channelId && options.seq > 0) {\n const seq = options.seq;\n const seqStart = options.seqStart || seq;\n\n if(seqStart !== curState.seq + 1) {\n if(seqStart > curState.seq) {\n this.debug && this.log.warn('Seq hole', curState, curState.syncPending?.seqAwaiting);\n\n curState.pendingSeqUpdates[seqStart] ??= {seq, date: options.date, updates: []};\n curState.pendingSeqUpdates[seqStart].updates.push(update);\n\n if(!curState.syncPending) {\n curState.syncPending = {\n timeout: ctx.setTimeout(() => {\n curState.syncPending = null;\n\n if(curState.syncLoading) {\n return;\n }\n\n this.getDifference();\n }, SYNC_DELAY)\n };\n }\n\n if(!curState.syncPending.seqAwaiting ||\n curState.syncPending.seqAwaiting < seqStart) {\n curState.syncPending.seqAwaiting = seqStart;\n }\n return false;\n }\n }\n\n if(curState.seq !== seq) {\n curState.seq = seq;\n if(options.date && curState.date < options.date) {\n curState.date = options.date;\n }\n\n popSeq = true;\n }\n }\n\n this.saveUpdate(update);\n\n if(popPts) {\n this.popPendingPtsUpdate(channelId);\n } else if(popSeq) {\n this.popPendingSeqUpdate();\n }\n }\n\n public saveUpdate(update: Update) {\n // this.debug && this.log('saveUpdate', update);\n this.dispatchEvent(update._, update as any);\n }\n\n public subscribeToChannelUpdates(channelId: ChatId) {\n const subscription = this.subscriptions[channelId] ??= {count: 0};\n ++subscription.count;\n\n const cb = () => {\n const state = this.getChannelState(channelId);\n if(!state.syncLoading && (!state.lastDifferenceTime || (Date.now() - state.lastDifferenceTime) > 2500)) {\n this.getChannelDifference(channelId);\n }\n };\n\n subscription.interval ??= ctx.setInterval(cb, 3000);\n cb();\n }\n\n public unsubscribeFromChannelUpdates(channelId: ChatId, force?: boolean) {\n const subscription = this.subscriptions[channelId];\n if(!subscription?.interval || (--subscription.count && !force)) {\n return;\n }\n\n clearInterval(subscription.interval);\n subscription.interval = undefined;\n delete this.subscriptions[channelId];\n }\n\n public attach(langCode?: string) {\n if(this.attached) return;\n\n // return;\n\n this.log('attach');\n\n this.attached = true;\n\n this.appStateManager.getState().then(({updates: state}) => {\n const newVersion = this.appStateManager.newVersion/* || '1.6.0' */;\n\n // rootScope.broadcast('state_synchronizing');\n if(!state || !state.pts || !state.date/* || !state.seq */) { // seq can be undefined because of updates.differenceTooLong\n this.log('will get new state');\n\n this.updatesState.syncLoading = new Promise((resolve) => {\n this.apiManager.invokeApi('updates.getState', {}, {noErrorBox: true}).then((stateResult) => {\n this.updatesState.seq = stateResult.seq;\n this.updatesState.pts = stateResult.pts;\n this.updatesState.date = stateResult.date;\n this.saveUpdatesState();\n // setTimeout(() => {\n this.updatesState.syncLoading = null;\n resolve();\n // rootScope.broadcast('state_synchronized');\n // }, 1000);\n\n // ! for testing\n // updatesState.seq = 1\n // updatesState.pts = stateResult.pts - 5000\n // updatesState.date = 1\n // getDifference()\n });\n });\n } else {\n // ! for testing\n /* state.seq = 1;\n state.pts = state.pts - 15;\n state.date = 1; */\n // state.pts -= 100;\n\n // state.date = 1628623682;\n // state.pts = 2007500;\n // state.seq = 503;\n\n Object.assign(this.updatesState, state);\n\n this.log('will get difference', Object.assign({}, state));\n\n this.getDifference(true)/* .finally(() => {\n if(this.updatesState.syncLoading) {\n rootScope.broadcast('state_synchronizing');\n }\n }) */;\n }\n\n this.apiManager.setUpdatesProcessor(this.processUpdateMessage);\n\n // this.updatesState.syncLoading.then(() => {\n this.setProxy();\n // });\n\n if(newVersion) {\n this.updatesState.syncLoading.then(async() => {\n const strs: Record = {\n en: 'was updated to version',\n ru: 'обновлён до версии'\n };\n\n const getChangelog = (lang: string) => {\n fetch(`changelogs/${lang}_${newVersion.split(' ')[0]}.md`)\n .then((res) => (res.status === 200 && res.ok && res.text()) || Promise.reject())\n .then((text) => {\n const langStr = strs[lang] || strs.en;\n const pre = `**Telegram Web${App.suffix} ${langStr} ${newVersion}**\\n\\n`;\n\n text = pre + text;\n\n const entities: MessageEntity[] = [];\n const message = parseMarkdown(text, entities);\n\n const update: Update.updateServiceNotification = {\n _: 'updateServiceNotification',\n entities,\n message,\n type: 'local',\n pFlags: {},\n inbox_date: tsNow(true),\n media: undefined\n };\n\n this.processLocalUpdate(update);\n });\n };\n\n const languages = filterUnique([langCode, 'en']);\n for(const language of languages) {\n try {\n await getChangelog(language);\n break;\n } catch(err) {\n\n }\n }\n });\n }\n });\n }\n}\n\ninterface ApiUpdatesManager extends EventListenerBase<{\n [name in Update['_']]: (update: ConstructorDeclMap[name]) => void\n}>, AppManager {}\napplyMixins(ApiUpdatesManager, [EventListenerBase, AppManager]);\n\nexport {ApiUpdatesManager};\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {UserProfilePhoto, ChatPhoto, InputFileLocation} from '../../layer';\nimport {DownloadOptions} from '../mtproto/apiFileManager';\nimport {AppManager} from './manager';\n\nexport type PeerPhotoSize = 'photo_small' | 'photo_big';\n\nexport class AppAvatarsManager extends AppManager {\n private savedAvatarURLs: {\n [peerId: PeerId]: {\n [size in PeerPhotoSize]?: string | Promise\n }\n } = {};\n\n protected after() {\n this.rootScope.addEventListener('avatar_update', ({peerId, threadId}) => {\n if(threadId) {\n return;\n }\n\n this.removeFromAvatarsCache(peerId);\n });\n }\n\n public isAvatarCached(peerId: PeerId, size?: PeerPhotoSize) {\n const saved = this.savedAvatarURLs[peerId];\n if(size === undefined) {\n return !!saved;\n }\n\n return !!(saved && saved[size] && !(saved[size] instanceof Promise));\n }\n\n public removeFromAvatarsCache(peerId: PeerId) {\n if(this.savedAvatarURLs[peerId]) {\n delete this.savedAvatarURLs[peerId];\n }\n }\n\n public loadAvatar(peerId: PeerId, photo: UserProfilePhoto.userProfilePhoto | ChatPhoto.chatPhoto, size: PeerPhotoSize) {\n const saved = this.savedAvatarURLs[peerId] ??= {};\n if(!saved[size]) {\n // console.warn('will invoke downloadSmallFile:', peerId);\n const peerPhotoFileLocation: InputFileLocation.inputPeerPhotoFileLocation = {\n _: 'inputPeerPhotoFileLocation',\n pFlags: {},\n peer: this.appPeersManager.getInputPeerById(peerId),\n photo_id: photo.photo_id\n };\n\n const downloadOptions: DownloadOptions = {dcId: photo.dc_id, location: peerPhotoFileLocation};\n if(size === 'photo_big') {\n peerPhotoFileLocation.pFlags.big = true;\n downloadOptions.limitPart = 512 * 1024;\n }\n\n /* let str: string;\n const time = Date.now();\n if(peerId === 0) {\n str = `download avatar ${peerId}`;\n } */\n\n const promise = this.apiFileManager.download(downloadOptions);\n return saved[size] = promise.then((blob) => {\n return saved[size] = URL.createObjectURL(blob);\n\n /* if(str) {\n console.log(str, Date.now() / 1000, Date.now() - time);\n } */\n });\n } else {\n return saved[size];\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {getEnvironment} from '../../environment/utils';\nimport safeReplaceObject from '../../helpers/object/safeReplaceObject';\nimport {nextRandomUint} from '../../helpers/random';\nimport {InputPhoneCall, MessagesDhConfig, PhoneCall, PhoneCallDiscardReason, PhoneCallProtocol, PhonePhoneCall} from '../../layer';\nimport {AppManager} from './manager';\n\nexport type CallId = PhoneCall['id'];\n\nexport type MyPhoneCall = Exclude;\n\nexport class AppCallsManager extends AppManager {\n private calls: Map;\n\n protected after() {\n this.calls = new Map();\n\n if(!getEnvironment().IS_CALL_SUPPORTED) {\n return;\n }\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updatePhoneCall: (update) => {\n this.saveCall(update.phone_call);\n },\n\n updatePhoneCallSignalingData: (update) => {\n this.rootScope.dispatchEvent('call_signaling', {callId: update.phone_call_id, data: update.data});\n }\n });\n }\n\n public computeKey(g_b: Uint8Array, a: Uint8Array, p: Uint8Array) {\n return this.cryptoWorker.invokeCrypto('compute-dh-key', g_b, a, p);\n }\n\n public saveCall(call: PhoneCall) {\n const isDiscarded = call._ === 'phoneCallDiscarded';\n const oldCall = this.calls.get(call.id);\n if(oldCall) {\n // if(shouldUpdate) {\n safeReplaceObject(oldCall, call);\n // }\n\n if(isDiscarded) {\n this.calls.delete(call.id);\n }\n\n call = oldCall;\n } else if(!isDiscarded) {\n this.calls.set(call.id, call as any);\n }\n\n this.rootScope.dispatchEvent('call_update', call);\n\n return call;\n }\n\n public getCall(callId: CallId) {\n return this.calls.get(callId);\n }\n\n public getCallInput(id: CallId): InputPhoneCall {\n const call = this.getCall(id);\n return {\n _: 'inputPhoneCall',\n id: call.id,\n access_hash: call.access_hash\n };\n }\n\n public savePhonePhoneCall(phonePhoneCall: PhonePhoneCall) {\n this.appUsersManager.saveApiUsers(phonePhoneCall.users);\n return this.saveCall(phonePhoneCall.phone_call);\n }\n\n public generateDh() {\n return this.apiManager.invokeApi('messages.getDhConfig', {\n version: 0,\n random_length: 256\n }).then((dhConfig) => {\n return this.cryptoWorker.invokeCrypto('generate-dh', dhConfig as MessagesDhConfig.messagesDhConfig);\n });\n }\n\n // private verifyProtocolCompatibility(protocol: PhoneCallProtocol) {\n // const my = getCallProtocol();\n // const myVersion = my.library_versions[0];\n // return !protocol.library_versions.find((version) => {\n // return compareVersion(myVersion, version) > 0;\n // });\n // }\n\n public async requestCall(userId: UserId, protocol: PhoneCallProtocol, g_a_hash: Uint8Array, video?: boolean) {\n const phonePhoneCall = await this.apiManager.invokeApi('phone.requestCall', {\n user_id: this.appUsersManager.getUserInput(userId),\n protocol: protocol,\n video: video,\n random_id: nextRandomUint(32),\n g_a_hash: g_a_hash\n });\n\n return this.savePhonePhoneCall(phonePhoneCall);\n }\n\n public async discardCall(callId: CallId, duration: number, reason: PhoneCallDiscardReason['_'], video?: boolean) {\n if(!this.getCall(callId)) {\n return;\n }\n\n const updates = await this.apiManager.invokeApi('phone.discardCall', {\n video,\n peer: this.getCallInput(callId),\n duration,\n reason: {\n _: reason\n },\n connection_id: '0'\n });\n\n this.apiUpdatesManager.processUpdateMessage(updates);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport deepEqual from '../../helpers/object/deepEqual';\nimport isObject from '../../helpers/object/isObject';\nimport safeReplaceObject from '../../helpers/object/safeReplaceObject';\nimport {ChannelParticipant, ChannelsCreateChannel, Chat, ChatAdminRights, ChatBannedRights, ChatInvite, ChatParticipant, ChatPhoto, ChatReactions, InputChannel, InputChatPhoto, InputFile, InputPeer, MessagesSponsoredMessages, SponsoredMessage, Update, Updates} from '../../layer';\nimport {isRestricted} from '../../helpers/restrictions';\nimport {AppManager} from './manager';\nimport hasRights from './utils/chats/hasRights';\nimport getParticipantPeerId from './utils/chats/getParticipantPeerId';\nimport {AppStoragesManager} from './appStoragesManager';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\nimport {randomLong} from '../../helpers/random';\nimport generateMessageId from './utils/messageId/generateMessageId';\nimport tsNow from '../../helpers/tsNow';\n\nexport type Channel = Chat.channel;\nexport type ChatRights = keyof ChatBannedRights['pFlags'] | keyof ChatAdminRights['pFlags'] | 'change_type' | 'change_permissions' | 'delete_chat' | 'view_participants';\n\nexport class AppChatsManager extends AppManager {\n private storage: AppStoragesManager['storages']['chats'];\n\n private chats: {[id: ChatId]: Exclude};\n // private usernames: any;\n // private channelAccess: any;\n // private megagroups: {[id: number]: true};\n\n protected after() {\n this.clear(true);\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateChannelParticipant: this.onUpdateChannelParticipant,\n\n updateChatDefaultBannedRights: this.onUpdateChatDefaultBannedRights\n });\n\n return Promise.all([\n this.appStateManager.getState(),\n this.appStoragesManager.loadStorage('chats')\n ]).then(([state, {results: chats, storage}]) => {\n this.storage = storage;\n\n this.saveApiChats(chats);\n\n this.peersStorage.addEventListener('peerNeeded', (peerId) => {\n if(peerId.isUser() || this.storage.getFromCache(peerId.toChatId())) {\n return;\n }\n\n this.storage.set({\n [peerId.toChatId()]: this.getChat(peerId.toChatId())\n });\n });\n\n this.peersStorage.addEventListener('peerUnneeded', (peerId) => {\n if(peerId.isUser() || !this.storage.getFromCache(peerId.toChatId())) {\n return;\n }\n\n this.storage.delete(peerId.toChatId());\n });\n });\n }\n\n public clear = (init = false) => {\n if(!init) {\n for(const chatId in this.chats) {\n if(!chatId) continue;\n if(!this.peersStorage.isPeerNeeded(chatId.toPeerId(true))) {\n const chat = this.chats[chatId];\n this.appUsersManager.modifyUsernamesCache(chat, false);\n\n this.storage.delete(chatId);\n delete this.chats[chatId];\n }\n }\n } else {\n this.chats = {};\n }\n };\n\n public saveApiChats(apiChats: any[], override?: boolean) {\n if((apiChats as any).saved) return;\n (apiChats as any).saved = true;\n apiChats.forEach((chat) => this.saveApiChat(chat, override));\n }\n\n public saveApiChat(chat: Chat, override?: boolean) {\n if(!chat || chat._ === 'chatEmpty') return;\n /* if(chat._ !== 'chat' && chat._ !== 'channel') {\n return;\n } */\n\n // * exclude from state\n // defineNotNumerableProperties(chat, ['rTitle', 'initials']);\n\n const oldChat = this.chats[chat.id];\n\n /* if(oldChat && !override) {\n return;\n } */\n\n (chat as Chat.chat).pFlags ??= {};\n\n if((chat as Chat.channel).pFlags.min && oldChat !== undefined) {\n return;\n }\n\n if(chat._ === 'channel' &&\n chat.participants_count === undefined &&\n oldChat !== undefined &&\n (oldChat as Chat.channel).participants_count) {\n chat.participants_count = (oldChat as Chat.channel).participants_count;\n }\n\n if((chat as Chat.channel).photo?._ === 'chatPhotoEmpty') {\n delete (chat as Chat.channel).photo;\n }\n\n const changedUsername = this.appUsersManager.setUsernameToCache(chat, oldChat);\n\n /* if(chat.username) {\n let searchUsername = searchIndexManager.cleanUsername(chat.username);\n this.usernames[searchUsername] = chat.id;\n } */\n\n const peerId = chat.id.toPeerId(true);\n if(oldChat === undefined) {\n this.chats[chat.id] = chat;\n } else {\n const oldPhotoId = ((oldChat as Chat.chat).photo as ChatPhoto.chatPhoto)?.photo_id;\n const newPhotoId = ((chat as Chat.chat).photo as ChatPhoto.chatPhoto)?.photo_id;\n const toggledForum = (oldChat as Chat.channel).pFlags.forum !== (chat as Chat.channel).pFlags.forum;\n const changedPhoto = oldPhotoId !== newPhotoId || toggledForum;\n\n const changedTitle = oldChat.title !== chat.title || changedUsername;\n\n const changedAnyBadge = (oldChat as Chat.channel).pFlags.verified !== (chat as Chat.channel).pFlags.verified ||\n (oldChat as Chat.channel).pFlags.scam !== (chat as Chat.channel).pFlags.scam ||\n (oldChat as Chat.channel).pFlags.fake !== (chat as Chat.channel).pFlags.fake;\n\n safeReplaceObject(oldChat, chat);\n this.rootScope.dispatchEvent('chat_update', chat.id);\n\n if(changedPhoto) {\n this.rootScope.dispatchEvent('avatar_update', {peerId});\n }\n\n if(changedTitle || changedAnyBadge) {\n this.rootScope.dispatchEvent('peer_title_edit', {peerId});\n }\n\n if(toggledForum) {\n this.rootScope.dispatchEvent('chat_toggle_forum', {chatId: chat.id, enabled: !!(chat as Chat.channel).pFlags.forum});\n }\n }\n\n if(this.peersStorage.isPeerNeeded(peerId)) {\n this.storage.set({\n [chat.id]: chat\n });\n }\n }\n\n public getChat(id: ChatId) {\n return this.chats[id];\n }\n\n /**\n * Check the user's ability to do an action in chat\n * @param id\n * @param action creator can still send messages to left channel. so this function shows server rights. see canSendToPeer for local rights in messages manager.\n * @param rights do not provide this parameter when checking rights for self\n * @param isThread\n * @returns\n */\n public hasRights(id: ChatId, action: ChatRights, rights?: ChatAdminRights | ChatBannedRights, isThread?: boolean) {\n return hasRights(this.getChat(id), action, rights, isThread);\n }\n\n public editChatDefaultBannedRights(id: ChatId, banned_rights: ChatBannedRights) {\n const chat = this.getChat(id) as Chat.chat;\n if(chat.default_banned_rights) {\n if(chat.default_banned_rights.until_date === banned_rights.until_date && deepEqual(chat.default_banned_rights.pFlags, banned_rights.pFlags)) {\n return Promise.resolve();\n }\n }\n\n return this.apiManager.invokeApi('messages.editChatDefaultBannedRights', {\n peer: this.appPeersManager.getInputPeerById(id.toPeerId(true)),\n banned_rights\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n /* public resolveUsername(username: string) {\n return this.usernames[username] || 0;\n } */\n\n /* public saveChannelAccess(id: ChatId, accessHash: string) {\n this.channelAccess[id] = accessHash;\n } */\n\n /* public saveIsMegagroup(id: ChatId) {\n this.megagroups[id] = true;\n } */\n\n public isChannel(id: ChatId) {\n const chat = this.chats[id];\n return !!(chat && (chat._ === 'channel' || chat._ === 'channelForbidden')/* || this.channelAccess[id] */);\n }\n\n public isMegagroup(id: ChatId) {\n /* if(this.megagroups[id]) {\n return true;\n } */\n\n const chat: Chat = this.chats[id];\n return !!(chat as Chat.channel)?.pFlags?.megagroup;\n }\n\n public isForum(id: ChatId) {\n const chat = this.chats[id];\n return !!(chat as Chat.channel)?.pFlags?.forum;\n }\n\n public isBroadcast(id: ChatId) {\n return this.isChannel(id) && !this.isMegagroup(id);\n }\n\n public isInChat(id: ChatId) {\n let good = true;\n const chat: Chat = this.getChat(id);\n if(!chat ||\n chat._ === 'channelForbidden' ||\n chat._ === 'chatForbidden' ||\n (chat as any as Chat.chatEmpty)._ === 'chatEmpty' ||\n (chat as Chat.chat).pFlags.left ||\n // || (chat as any).pFlags.kicked\n (chat as Chat.chat).pFlags.deactivated) {\n good = false;\n }\n\n return good;\n }\n\n public getChannelInput(id: ChatId): InputChannel {\n const chat: Chat = this.getChat(id);\n if(!chat || !(chat as Chat.channel).access_hash) {\n return {\n _: 'inputChannelEmpty'\n };\n } else {\n return {\n _: 'inputChannel',\n channel_id: id,\n access_hash: (chat as Chat.channel).access_hash/* || this.channelAccess[id] */ || '0'\n };\n }\n }\n\n public getInputPeer(id: ChatId) {\n return this.isChannel(id) ? this.getChannelInputPeer(id) : this.getChatInputPeer(id);\n }\n\n public getChatInputPeer(id: ChatId): InputPeer.inputPeerChat {\n return {\n _: 'inputPeerChat',\n chat_id: id\n };\n }\n\n public getChannelInputPeer(id: ChatId): InputPeer.inputPeerChannel {\n return {\n _: 'inputPeerChannel',\n channel_id: id,\n access_hash: (this.getChat(id) as Chat.channel).access_hash/* || this.channelAccess[id] */ || 0\n };\n }\n\n public hasChat(id: ChatId, allowMin?: true) {\n const chat = this.chats[id];\n return isObject(chat) && (allowMin || !(chat as Chat.channel).pFlags.min);\n }\n\n public getChatString(id: ChatId) {\n const chat = this.getChat(id);\n if(this.isChannel(id)) {\n return (this.isMegagroup(id) ? 's' : 'c') + id + '_' + (chat as Chat.channel).access_hash;\n }\n return 'g' + id;\n }\n\n /* public wrapForFull(id: number, fullChat: any) {\n const chatFull = copy(fullChat);\n const chat = this.getChat(id);\n\n if(!chatFull.participants_count) {\n chatFull.participants_count = chat.participants_count;\n }\n\n if(chatFull.participants &&\n chatFull.participants._ === 'chatParticipants') {\n chatFull.participants.participants = this.wrapParticipants(id, chatFull.participants.participants);\n }\n\n if(chatFull.about) {\n chatFull.rAbout = wrapRichText(chatFull.about, {noLinebreaks: true});\n }\n\n //chatFull.peerString = this.getChatString(id);\n chatFull.chat = chat;\n\n return chatFull;\n }\n\n public wrapParticipants(id: number, participants: any[]) {\n const chat = this.getChat(id);\n const myId = appUsersManager.getSelf().id;\n if(this.isChannel(id)) {\n const isAdmin = chat.pFlags.creator;\n participants.forEach((participant) => {\n participant.canLeave = myId === participant.user_id;\n participant.canKick = isAdmin && participant._ === 'channelParticipant';\n\n // just for order by last seen\n participant.user = appUsersManager.getUser(participant.user_id);\n });\n } else {\n const isAdmin = chat.pFlags.creator || chat.pFlags.admins_enabled && chat.pFlags.admin;\n participants.forEach((participant) => {\n participant.canLeave = myId === participant.user_id;\n participant.canKick = !participant.canLeave && (\n chat.pFlags.creator ||\n participant._ === 'chatParticipant' && (isAdmin || myId === participant.inviter_id)\n );\n\n // just for order by last seen\n participant.user = appUsersManager.getUser(participant.user_id);\n });\n }\n\n return participants;\n } */\n\n public createChannel(options: ChannelsCreateChannel): Promise {\n return this.apiManager.invokeApi('channels.createChannel', options).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n\n const channelId = (updates as any).chats[0].id;\n return channelId;\n });\n }\n\n public inviteToChannel(id: ChatId, userIds: UserId[]) {\n const input = this.getChannelInput(id);\n const usersInputs = userIds.map((u) => this.appUsersManager.getUserInput(u));\n\n return this.apiManager.invokeApi('channels.inviteToChannel', {\n channel: input,\n users: usersInputs\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public createChat(title: string, userIds: UserId[]): Promise {\n return this.apiManager.invokeApi('messages.createChat', {\n users: userIds.map((u) => this.appUsersManager.getUserInput(u)),\n title\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n\n const chatId = (updates as any as Updates.updates).chats[0].id;\n return chatId;\n });\n }\n\n private onChatUpdated = (chatId: ChatId, updates?: Updates) => {\n // console.log('onChatUpdated', chatId, updates);\n\n this.apiUpdatesManager.processUpdateMessage(updates);\n if((updates as Updates.updates)?.updates?.length && this.isChannel(chatId)) {\n this.rootScope.dispatchEvent('invalidate_participants', chatId);\n }\n };\n\n public leaveChannel(id: ChatId) {\n return this.apiManager.invokeApi('channels.leaveChannel', {\n channel: this.getChannelInput(id)\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public joinChannel(id: ChatId) {\n return this.apiManager.invokeApi('channels.joinChannel', {\n channel: this.getChannelInput(id)\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public addChatUser(id: ChatId, userId: UserId, fwdLimit = 100) {\n return this.apiManager.invokeApi('messages.addChatUser', {\n chat_id: id,\n user_id: this.appUsersManager.getUserInput(userId),\n fwd_limit: fwdLimit\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public deleteChatUser(id: ChatId, userId: UserId) {\n return this.apiManager.invokeApi('messages.deleteChatUser', {\n chat_id: id,\n user_id: this.appUsersManager.getUserInput(userId)\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public leaveChat(id: ChatId) {\n return this.deleteChatUser(id, this.appUsersManager.getSelf().id);\n }\n\n public leave(id: ChatId) {\n return this.isChannel(id) ? this.leaveChannel(id) : this.leaveChat(id);\n }\n\n public delete(id: ChatId) {\n return this.isChannel(id) ? this.deleteChannel(id) : this.deleteChat(id);\n }\n\n public deleteChannel(id: ChatId) {\n return this.apiManager.invokeApi('channels.deleteChannel', {\n channel: this.getChannelInput(id)\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public deleteChat(id: ChatId) {\n // return this.leaveChat(id).then(() => {\n return this.apiManager.invokeApi('messages.deleteChat', {\n chat_id: id\n });\n // });\n }\n\n public migrateChat(id: ChatId): Promise {\n const chat: Chat = this.getChat(id);\n if(chat._ === 'channel') return Promise.resolve(chat.id);\n return this.apiManager.invokeApi('messages.migrateChat', {\n chat_id: id\n }).then((updates) => {\n this.onChatUpdated(id, updates);\n const update: Update.updateChannel = (updates as Updates.updates).updates.find((u) => u._ === 'updateChannel') as any;\n return update.channel_id;\n });\n }\n\n public updateUsername(id: ChatId, username: string, doNotRefresh?: boolean) {\n const promise = this.apiManager.invokeApi('channels.updateUsername', {\n channel: this.getChannelInput(id),\n username\n });\n\n return this.refreshChatAfterRequest(id, promise, doNotRefresh);\n }\n\n public editPhoto(id: ChatId, inputFile: InputFile) {\n const inputChatPhoto: InputChatPhoto = {\n _: 'inputChatUploadedPhoto',\n file: inputFile\n };\n\n let promise: any;\n if(this.isChannel(id)) {\n promise = this.apiManager.invokeApi('channels.editPhoto', {\n channel: this.getChannelInput(id),\n photo: inputChatPhoto\n });\n } else {\n promise = this.apiManager.invokeApi('messages.editChatPhoto', {\n chat_id: id,\n photo: inputChatPhoto\n });\n }\n\n return promise.then(this.onChatUpdated.bind(this, id));\n }\n\n public editTitle(id: ChatId, title: string) {\n let promise: any;\n\n if(this.isChannel(id)) {\n promise = this.apiManager.invokeApi('channels.editTitle', {\n channel: this.getChannelInput(id),\n title\n });\n } else {\n promise = this.apiManager.invokeApi('messages.editChatTitle', {\n chat_id: id,\n title\n });\n }\n\n return promise.then(this.onChatUpdated.bind(this, id));\n }\n\n public editAbout(id: ChatId, about: string) {\n const peerId = id.toPeerId(true);\n return this.apiManager.invokeApi('messages.editChatAbout', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n about\n }).then((bool) => {\n if(bool) {\n this.rootScope.dispatchEvent('peer_bio_edit', peerId);\n }\n\n return bool;\n });\n }\n\n public async editBanned(id: ChatId, participant: PeerId | ChannelParticipant | ChatParticipant, banned_rights: ChatBannedRights) {\n const peerId = typeof(participant) !== 'object' ? participant : getParticipantPeerId(participant);\n const wasChannel = this.isChannel(id);\n if(!wasChannel) {\n const channelId = await this.migrateChat(id);\n id = channelId;\n }\n\n return this.apiManager.invokeApi('channels.editBanned', {\n channel: this.getChannelInput(id),\n participant: this.appPeersManager.getInputPeerById(peerId),\n banned_rights\n }).then((updates) => {\n this.onChatUpdated(id, updates);\n\n if(typeof(participant) === 'object') {\n const timestamp = tsNow(true);\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateChannelParticipant',\n channel_id: id,\n date: timestamp,\n actor_id: undefined,\n qts: undefined,\n user_id: peerId,\n prev_participant: wasChannel ? participant as ChannelParticipant : undefined,\n new_participant: Object.keys(banned_rights.pFlags).length ? {\n _: 'channelParticipantBanned',\n date: timestamp,\n banned_rights,\n kicked_by: this.appUsersManager.getSelf().id,\n peer: this.appPeersManager.getOutputPeer(peerId),\n pFlags: {}\n } : undefined\n });\n }\n });\n }\n\n public clearChannelParticipantBannedRights(id: ChatId, participant: PeerId | ChannelParticipant) {\n return this.editBanned(id, participant, {\n _: 'chatBannedRights',\n until_date: 0,\n pFlags: {}\n });\n }\n\n public kickFromChannel(id: ChatId, participant: PeerId | ChannelParticipant) {\n return this.editBanned(id, participant, {\n _: 'chatBannedRights',\n until_date: 0,\n pFlags: {\n view_messages: true\n }\n });\n }\n\n public kickFromChat(id: ChatId, participant: PeerId | ChannelParticipant | ChatParticipant) {\n if(this.isChannel(id)) return this.kickFromChannel(id, participant as ChannelParticipant);\n else return this.deleteChatUser(id, isObject(participant) ? getParticipantPeerId(participant) : (participant as PeerId).toUserId());\n }\n\n public resolveChannel(id: ChatId) {\n return this.apiManager.invokeApiSingle('channels.getChannels', {\n id: [{\n _: 'inputChannel',\n channel_id: id,\n access_hash: '0'\n }]\n }).then((messagesChats) => {\n this.saveApiChats(messagesChats.chats);\n });\n }\n\n public togglePreHistoryHidden(id: ChatId, enabled: boolean) {\n return this.migrateChat(id).then((channelId) => {\n return this.apiManager.invokeApi('channels.togglePreHistoryHidden', {\n channel: this.getChannelInput(channelId),\n enabled\n }).then(this.onChatUpdated.bind(this, channelId));\n });\n }\n\n public toggleSignatures(id: ChatId, enabled: boolean) {\n return this.apiManager.invokeApi('channels.toggleSignatures', {\n channel: this.getChannelInput(id),\n enabled\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public toggleNoForwards(id: ChatId, enabled: boolean) {\n return this.apiManager.invokeApi('messages.toggleNoForwards', {\n peer: this.getInputPeer(id),\n enabled\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public setChatAvailableReactions(id: ChatId, reactions: ChatReactions) {\n const chatFull = this.appProfileManager.getCachedFullChat(id);\n if(chatFull) {\n chatFull.available_reactions = reactions;\n this.rootScope.dispatchEvent('chat_full_update', id);\n }\n\n return this.apiManager.invokeApi('messages.setChatAvailableReactions', {\n peer: this.getInputPeer(id),\n available_reactions: reactions\n }).then(this.onChatUpdated.bind(this, id));\n }\n\n public getSendAs(channelId: ChatId) {\n return this.apiManager.invokeApiSingleProcess({\n method: 'channels.getSendAs',\n params: {\n peer: this.getChannelInputPeer(channelId)\n },\n processResult: (sendAsPeers) => {\n this.appUsersManager.saveApiUsers(sendAsPeers.users);\n this.saveApiChats(sendAsPeers.chats);\n\n return sendAsPeers.peers;\n }\n });\n }\n\n public importChatInvite(hash: string) {\n return this.apiManager.invokeApi('messages.importChatInvite', {hash})\n .then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n const chat = (updates as Updates.updates).chats[0];\n return chat.id;\n });\n }\n\n public checkUsername(chatId: ChatId, username: string) {\n return this.apiManager.invokeApi('channels.checkUsername', {\n channel: this.getChannelInput(chatId),\n username\n });\n }\n\n public getSponsoredMessage(chatId: ChatId) {\n // const s: MessagesSponsoredMessages.messagesSponsoredMessages = {\n // '_': 'messages.sponsoredMessages',\n // 'messages': [\n // {\n // '_': 'sponsoredMessage',\n // 'pFlags': {},\n // 'flags': 9,\n // 'random_id': new Uint8Array([\n // 80,\n // 5,\n // 249,\n // 174,\n // 44,\n // 73,\n // 173,\n // 14,\n // 246,\n // 81,\n // 187,\n // 182,\n // 223,\n // 5,\n // 4,\n // 128\n // ]),\n // 'from_id': {\n // '_': 'peerUser',\n // 'user_id': 983000232\n // },\n // 'start_param': 'GreatMinds',\n // 'message': 'This is a long sponsored message. In fact, it has the maximum length allowed on the platform – 160 characters 😬😬. It\\'s promoting a bot with a start parameter.' + chatId\n // }\n // ],\n // 'chats': [],\n // 'users': [\n // {\n // '_': 'user',\n // 'pFlags': {\n // 'bot': true,\n // 'verified': true,\n // 'apply_min_photo': true\n // },\n // 'flags': 34226219,\n // 'id': 983000232,\n // 'access_hash': '-294959558742535650',\n // 'first_name': 'Quiz Bot',\n // 'username': 'QuizBot',\n // 'photo': {\n // '_': 'userProfilePhoto',\n // 'pFlags': {},\n // 'flags': 2,\n // 'photo_id': '4221953848856651689',\n // 'stripped_thumb': new Uint8Array([\n // 1,\n // 8,\n // 8,\n // 155,\n // 247,\n // 95,\n // 103,\n // 255,\n // 0,\n // 110,\n // 138,\n // 40,\n // 174,\n // 132,\n // 142,\n // 6,\n // 238,\n // 127\n // ]),\n // 'dc_id': 2\n // },\n // 'bot_info_version': 11,\n // 'bot_inline_placeholder': 'Search a quiz...',\n // 'sortName': 'quiz bot'\n // }\n // ]\n // };\n\n // const promise = Promise.resolve(s);\n const promise = this.apiManager.invokeApiCacheable('channels.getSponsoredMessages', {\n channel: this.getChannelInput(chatId)\n }, {cacheSeconds: 300});\n\n return promise.then((sponsoredMessages) => {\n if(sponsoredMessages._ === 'messages.sponsoredMessages') {\n this.appUsersManager.saveApiUsers(sponsoredMessages.users);\n this.appChatsManager.saveApiChats(sponsoredMessages.chats);\n\n const sponsoredMessage = sponsoredMessages.messages.shift();\n sponsoredMessages.messages.push(sponsoredMessage);\n }\n\n return sponsoredMessages;\n });\n }\n\n public viewSponsoredMessage(chatId: ChatId, randomId: SponsoredMessage['random_id']) {\n return this.apiManager.invokeApiSingle('channels.viewSponsoredMessage', {\n channel: this.getChannelInput(chatId),\n random_id: randomId\n });\n }\n\n public checkChatInvite(hash: string) {\n return this.apiManager.invokeApi('messages.checkChatInvite', {\n hash: hash\n }).then((chatInvite) => {\n if((chatInvite as ChatInvite.chatInvitePeek).chat) {\n this.saveApiChat((chatInvite as ChatInvite.chatInvitePeek).chat, true);\n }\n\n return chatInvite;\n });\n }\n\n public toggleUsername(chatId: ChatId, username: string, active: boolean) {\n const promise = this.apiManager.invokeApi('channels.toggleUsername', {\n channel: this.getChannelInput(chatId),\n username,\n active\n });\n\n return this.refreshChatAfterRequest(chatId, promise);\n }\n\n public reorderUsernames(chatId: ChatId, order: string[]) {\n const promise = this.apiManager.invokeApi('channels.reorderUsernames', {\n channel: this.getChannelInput(chatId),\n order\n });\n\n return this.refreshChatAfterRequest(chatId, promise);\n }\n\n public deactivateAllUsernames(chatId: ChatId, doNotRefresh?: boolean) {\n const promise = this.apiManager.invokeApi('channels.deactivateAllUsernames', {\n channel: this.getChannelInput(chatId)\n });\n\n return this.refreshChatAfterRequest(chatId, promise, doNotRefresh);\n }\n\n public makeChannelPrivate(chatId: ChatId) {\n const promises: Promise[] = [\n this.updateUsername(chatId, '', true),\n this.deactivateAllUsernames(chatId, true)\n ];\n\n const promise = Promise.all(promises).then(() => true);\n return this.refreshChatAfterRequest(chatId, promise);\n }\n\n public refreshChatAfterRequest>(chatId: ChatId, promise: T, doNotRefresh?: boolean): T {\n if(doNotRefresh) {\n return promise;\n }\n\n return promise.then((value) => {\n return this.getChannels([chatId]).then(() => value);\n }) as T;\n }\n\n public getChannels(chatIds: ChatId[]) {\n return this.apiManager.invokeApi('channels.getChannels', {\n id: chatIds.map((chatId) => this.getChannelInput(chatId))\n }).then((messagesChats) => {\n this.saveApiChats(messagesChats.chats);\n });\n }\n\n public toggleForum(chatId: ChatId, enabled: boolean) {\n return this.migrateChat(chatId).then((channelId) => {\n return this.apiManager.invokeApi('channels.toggleForum', {\n channel: this.getChannelInput(channelId),\n enabled\n }).then(this.onChatUpdated.bind(this, channelId));\n });\n }\n\n public editForumTopic(options: {\n chatId: ChatId,\n topicId: number,\n title?: string,\n iconEmojiId?: DocId,\n closed?: boolean,\n hidden?: boolean\n }) {\n const {chatId, topicId, title, iconEmojiId, closed, hidden} = options;\n return this.apiManager.invokeApi('channels.editForumTopic', {\n channel: this.getChannelInput(chatId),\n topic_id: getServerMessageId(topicId),\n title,\n icon_emoji_id: iconEmojiId,\n closed,\n hidden\n }).then(this.onChatUpdated.bind(this, chatId));\n }\n\n public async createForumTopic(options: {\n chatId: ChatId,\n title: string,\n iconColor: number,\n iconEmojiId: DocId\n }) {\n const {chatId, title, iconColor, iconEmojiId} = options;\n\n const channelFull = await this.appProfileManager.getChannelFull(chatId);\n const sendAsInputPeer = channelFull.default_send_as && this.appPeersManager.getInputPeerById(this.appPeersManager.getPeerId(channelFull.default_send_as));\n\n return this.apiManager.invokeApi('channels.createForumTopic', {\n channel: this.getChannelInput(chatId),\n title,\n icon_color: iconColor,\n icon_emoji_id: iconEmojiId,\n random_id: randomLong(),\n send_as: sendAsInputPeer\n }).then((updates) => {\n this.onChatUpdated(chatId, updates);\n\n const update = (updates as Updates.updates).updates.find((update) => update._ === 'updateNewChannelMessage') as Update.updateNewChannelMessage;\n return generateMessageId(update.message.id);\n });\n }\n\n public updatePinnedForumTopic(chatId: ChatId, topicId: number, pinned: boolean) {\n return this.apiManager.invokeApi('channels.updatePinnedForumTopic', {\n channel: this.getChannelInput(chatId),\n topic_id: getServerMessageId(topicId),\n pinned\n }).then(this.onChatUpdated.bind(this, chatId));\n }\n\n private onUpdateChannelParticipant = (update: Update.updateChannelParticipant) => {\n this.apiManager.clearCache('channels.getParticipants', (params) => {\n return (params.channel as InputChannel.inputChannel).channel_id === update.channel_id;\n });\n\n this.rootScope.dispatchEvent('chat_participant', update);\n };\n\n private onUpdateChatDefaultBannedRights = (update: Update.updateChatDefaultBannedRights) => {\n const chatId = this.appPeersManager.getPeerId(update.peer).toChatId();\n const chat = this.chats[chatId] as Chat.chat;\n if(chat) {\n chat.default_banned_rights = update.default_banned_rights;\n this.rootScope.dispatchEvent('chat_update', chatId);\n }\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type lang from '../lang';\nimport type langSign from '../langSign';\nimport type {State} from '../config/state';\nimport DEBUG, {MOUNT_CLASS_TO} from '../config/debug';\nimport {HelpCountriesList, HelpCountry, LangPackDifference, LangPackString} from '../layer';\nimport stateStorage from './stateStorage';\nimport App from '../config/app';\nimport rootScope from './rootScope';\nimport {IS_MOBILE} from '../environment/userAgent';\nimport deepEqual from '../helpers/object/deepEqual';\nimport safeAssign from '../helpers/object/safeAssign';\nimport capitalizeFirstLetter from '../helpers/string/capitalizeFirstLetter';\nimport matchUrlProtocol from './richTextProcessor/matchUrlProtocol';\nimport wrapUrl from './richTextProcessor/wrapUrl';\nimport {setDirection} from '../helpers/dom/setInnerHTML';\n\nexport const langPack: {[actionType: string]: LangPackKey} = {\n 'messageActionChatCreate': 'ActionCreateGroup',\n 'messageActionChatCreateYou': 'ActionYouCreateGroup',\n 'messageActionChatEditTitle': 'ActionChangedTitle',\n 'messageActionChatEditPhoto': 'ActionChangedPhoto',\n 'messageActionChatEditVideo': 'ActionChangedVideo',\n 'messageActionChatDeletePhoto': 'ActionRemovedPhoto',\n 'messageActionChatReturn': 'ActionAddUserSelf',\n 'messageActionChatReturnYou': 'ActionAddUserSelfYou',\n 'messageActionChatJoined': 'ActionAddUserSelfMega',\n 'messageActionChatJoinedYou': 'ChannelMegaJoined',\n 'messageActionChatAddUser': 'ActionAddUser',\n 'messageActionChatAddUsers': 'ActionAddUser',\n 'messageActionChatLeave': 'ActionLeftUser',\n 'messageActionChatLeaveYou': 'YouLeft',\n 'messageActionChatDeleteUser': 'ActionKickUser',\n 'messageActionChatJoinedByLink': 'ActionInviteUser',\n 'messageActionPinMessage': 'Chat.Service.Group.UpdatedPinnedMessage',\n 'messageActionContactSignUp': 'Chat.Service.PeerJoinedTelegram',\n 'messageActionChannelCreate': 'ActionCreateChannel',\n 'messageActionChannelEditTitle': 'Chat.Service.Channel.UpdatedTitle',\n 'messageActionChannelEditPhoto': 'Chat.Service.Channel.UpdatedPhoto',\n 'messageActionChannelEditVideo': 'Chat.Service.Channel.UpdatedVideo',\n 'messageActionChannelDeletePhoto': 'Chat.Service.Channel.RemovedPhoto',\n 'messageActionHistoryClear': 'HistoryCleared',\n 'messageActionDiscussionStarted': 'DiscussionStarted',\n\n 'messageActionChannelMigrateFrom': 'ActionMigrateFromGroup',\n\n 'messageActionPhoneCall.video_in_ok': 'ChatList.Service.VideoCall.incoming',\n 'messageActionPhoneCall.video_out_ok': 'ChatList.Service.VideoCall.outgoing',\n 'messageActionPhoneCall.video_missed': 'ChatList.Service.VideoCall.Missed',\n 'messageActionPhoneCall.video_cancelled': 'ChatList.Service.VideoCall.Cancelled',\n 'messageActionPhoneCall.in_ok': 'ChatList.Service.Call.incoming',\n 'messageActionPhoneCall.out_ok': 'ChatList.Service.Call.outgoing',\n 'messageActionPhoneCall.missed': 'ChatList.Service.Call.Missed',\n 'messageActionPhoneCall.cancelled': 'ChatList.Service.Call.Cancelled',\n\n 'messageActionGroupCall.started': 'Chat.Service.VoiceChatStarted.Channel',\n 'messageActionGroupCall.started_by': 'Chat.Service.VoiceChatStarted',\n 'messageActionGroupCall.started_byYou': 'Chat.Service.VoiceChatStartedYou',\n 'messageActionGroupCall.ended': 'Chat.Service.VoiceChatFinished.Channel',\n 'messageActionGroupCall.ended_by': 'Chat.Service.VoiceChatFinished',\n 'messageActionGroupCall.ended_byYou': 'Chat.Service.VoiceChatFinishedYou',\n\n 'messageActionBotAllowed': 'Chat.Service.BotPermissionAllowed'\n};\n\nexport type LangPackKey = /* string | */keyof typeof lang | keyof typeof langSign;\n\nexport type FormatterArgument = string | number | Node | FormatterArgument[];\nexport type FormatterArguments = FormatterArgument[];\n\nexport const UNSUPPORTED_LANG_PACK_KEY: LangPackKey = IS_MOBILE ? 'Message.Unsupported.Mobile' : 'Message.Unsupported.Desktop';\n\nnamespace I18n {\n export const strings: Map = new Map();\n export const countriesList: HelpCountry[] = [];\n let pluralRules: Intl.PluralRules;\n\n let cacheLangPackPromise: Promise;\n export let lastRequestedLangCode: string;\n export let lastRequestedNormalizedLangCode: string;\n export let lastAppliedLangCode: string;\n export let requestedServerLanguage = false;\n export let timeFormat: State['settings']['timeFormat'];\n export let isRTL = false;\n\n export function setRTL(rtl: boolean) {\n isRTL = rtl;\n }\n\n function setLangCode(langCode: string) {\n lastRequestedLangCode = langCode;\n lastRequestedNormalizedLangCode = langCode.split('-')[0];\n }\n\n export function getCacheLangPack(): Promise {\n if(cacheLangPackPromise) return cacheLangPackPromise;\n return cacheLangPackPromise = Promise.all([\n stateStorage.get('langPack') as Promise,\n polyfillPromise\n ]).then(([langPack]) => {\n if(!langPack/* || true */) {\n return loadLocalLangPack();\n } else if(DEBUG && false) {\n return getLangPack(langPack.lang_code);\n }/* else if(langPack.appVersion !== App.langPackVersion) {\n return getLangPack(langPack.lang_code);\n } */\n\n if(!lastRequestedLangCode) {\n setLangCode(langPack.lang_code);\n }\n\n applyLangPack(langPack);\n return langPack;\n }).finally(() => {\n cacheLangPackPromise = undefined;\n });\n }\n\n function updateAmPm() {\n if(timeFormat === 'h12') {\n try {\n const dateTimeFormat = getDateTimeFormat({hour: 'numeric', minute: 'numeric', hour12: true});\n const date = new Date();\n date.setHours(0);\n const amText = dateTimeFormat.format(date);\n amPmCache.am = amText.split(/\\s/)[1];\n date.setHours(12);\n const pmText = dateTimeFormat.format(date);\n amPmCache.pm = pmText.split(/\\s/)[1];\n } catch(err) {\n console.error('cannot get am/pm', err);\n amPmCache = {am: 'AM', pm: 'PM'};\n }\n }\n }\n\n export function setTimeFormat(\n format: State['settings']['timeFormat'],\n haveToUpdate = !!timeFormat && timeFormat !== format\n ) {\n timeFormat = format;\n\n updateAmPm();\n\n if(haveToUpdate) {\n cachedDateTimeFormats.clear();\n const elements = Array.from(document.querySelectorAll(`.i18n`)) as HTMLElement[];\n elements.forEach((element) => {\n const instance = weakMap.get(element);\n\n if(instance instanceof IntlDateElement) {\n instance.update();\n }\n });\n }\n }\n\n export function loadLocalLangPack() {\n const defaultCode = App.langPackCode;\n setLangCode(defaultCode);\n return Promise.all([\n import('../lang'),\n import('../langSign'),\n import('../countries')\n ]).then(([lang, langSign, countries]) => {\n const strings: LangPackString[] = [];\n formatLocalStrings(lang.default, strings);\n formatLocalStrings(langSign.default, strings);\n\n const langPack: LangPackDifference = {\n _: 'langPackDifference',\n from_version: 0,\n lang_code: defaultCode,\n strings,\n version: 0,\n local: true,\n countries: countries.default\n };\n return saveLangPack(langPack);\n });\n }\n\n export function loadLangPack(langCode: string, web?: boolean) {\n web = true;\n requestedServerLanguage = true;\n const managers = rootScope.managers;\n return Promise.all([\n managers.apiManager.invokeApiCacheable('langpack.getLangPack', {\n lang_code: langCode,\n lang_pack: web ? 'web' : App.langPack\n }),\n !web && managers.apiManager.invokeApiCacheable('langpack.getLangPack', {\n lang_code: langCode,\n lang_pack: 'android'\n }),\n import('../lang'),\n import('../langSign'),\n managers.apiManager.invokeApiCacheable('help.getCountriesList', {\n lang_code: langCode,\n hash: 0\n }) as Promise,\n polyfillPromise\n ]);\n }\n\n export function getStrings(langCode: string, strings: string[]) {\n return rootScope.managers.apiManager.invokeApi('langpack.getStrings', {\n lang_pack: App.langPack,\n lang_code: langCode,\n keys: strings\n });\n }\n\n export function formatLocalStrings(strings: any, pushTo: LangPackString[] = []) {\n for(const i in strings) {\n // @ts-ignore\n const v = strings[i];\n if(typeof(v) === 'string') {\n pushTo.push({\n _: 'langPackString',\n key: i,\n value: v\n });\n } else {\n pushTo.push({\n _: 'langPackStringPluralized',\n key: i,\n ...v\n });\n }\n }\n\n return pushTo;\n }\n\n export function getLangPack(langCode: string, web?: boolean) {\n setLangCode(langCode);\n return loadLangPack(langCode, web).then(([langPack1, langPack2, localLangPack1, localLangPack2, countries, _]) => {\n let strings: LangPackString[] = [];\n\n [localLangPack1, localLangPack2].forEach((l) => {\n formatLocalStrings(l.default as any, strings);\n });\n\n strings = strings.concat(...[langPack1.strings, langPack2.strings].filter(Boolean));\n\n langPack1.strings = strings;\n langPack1.countries = countries;\n return saveLangPack(langPack1);\n });\n }\n\n export function saveLangPack(langPack: LangPackDifference) {\n langPack.appVersion = App.langPackVersion;\n\n return stateStorage.set({langPack}).then(() => {\n applyLangPack(langPack);\n return langPack;\n });\n }\n\n export const polyfillPromise = (function checkIfPolyfillNeeded() {\n if(typeof(Intl) !== 'undefined' && typeof(Intl.PluralRules) !== 'undefined'/* && false */) {\n return Promise.resolve();\n } else {\n return import('./pluralPolyfill').then((_Intl) => {\n (window as any).Intl = Object.assign(typeof(Intl) !== 'undefined' ? Intl : {}, _Intl.default);\n });\n }\n })();\n\n export function applyLangPack(langPack: LangPackDifference) {\n const currentLangCode = lastRequestedLangCode;\n if(langPack.lang_code !== currentLangCode) {\n return;\n }\n\n try {\n pluralRules = new Intl.PluralRules(lastRequestedNormalizedLangCode);\n } catch(err) {\n console.error('pluralRules error', err);\n pluralRules = new Intl.PluralRules(lastRequestedNormalizedLangCode.split('-', 1)[0]);\n }\n\n try {\n pluralRules = new Intl.PluralRules(langPack.lang_code);\n } catch(err) {\n console.error('pluralRules error', err);\n pluralRules = new Intl.PluralRules(langPack.lang_code.split('-', 1)[0]);\n }\n\n strings.clear();\n\n for(const string of langPack.strings) {\n strings.set(string.key as LangPackKey, string);\n }\n\n if(langPack.countries) {\n countriesList.length = 0;\n countriesList.push(...langPack.countries.countries);\n\n langPack.countries.countries.forEach((country) => {\n if(country.name) {\n const langPackKey: any = country.default_name;\n strings.set(langPackKey, {\n _: 'langPackString',\n key: langPackKey,\n value: country.name\n });\n }\n });\n }\n\n if(lastAppliedLangCode !== currentLangCode) {\n rootScope.dispatchEvent('language_change', currentLangCode);\n lastAppliedLangCode = currentLangCode;\n cachedDateTimeFormats.clear();\n updateAmPm();\n }\n\n const elements = Array.from(document.querySelectorAll(`.i18n`)) as HTMLElement[];\n elements.forEach((element) => {\n const instance = weakMap.get(element);\n\n if(instance) {\n instance.update();\n }\n });\n }\n\n function pushNextArgument(out: ReturnType, args: FormatterArguments, indexHolder: {i: number}) {\n const arg = args[indexHolder.i++];\n if(Array.isArray(arg)) {\n out.push(...arg as any);\n } else {\n out.push(arg);\n }\n }\n\n export function superFormatter(input: string, args?: FormatterArguments, indexHolder = {i: 0}): Exclude[] {\n const out: ReturnType = [];\n const regExp = /(\\*\\*|__)(.+?)\\1|(\\n)|(\\[.+?\\]\\(.*?\\))|un\\d|%\\d\\$.|%./g;\n\n let lastIndex = 0;\n input.replace(regExp, (match, p1: any, p2: any, p3: any, p4: string, offset: number, string: string) => {\n // console.table({match, p1, p2, offset, string});\n\n out.push(string.slice(lastIndex, offset));\n\n if(p1) {\n // offset += p1.length;\n let element: HTMLElement;\n switch(p1) {\n case '**': {\n element = document.createElement('b');\n break;\n }\n\n case '__': {\n element = document.createElement('i');\n break;\n }\n }\n\n element.append(...superFormatter(p2, args, indexHolder) as any);\n out.push(element);\n } else if(p3) {\n out.push(document.createElement('br'));\n } else if(p4) {\n const idx = p4.lastIndexOf(']');\n const text = p4.slice(1, idx);\n\n const url = p4.slice(idx + 2, p4.length - 1);\n let a: HTMLAnchorElement;\n if(url && matchUrlProtocol(url)) {\n a = document.createElement('a');\n const wrappedUrl = wrapUrl(url);\n a.href = wrappedUrl.url;\n if(wrappedUrl.onclick) a.setAttribute('onclick', wrappedUrl.onclick);\n a.target = '_blank';\n } else {\n a = args[indexHolder.i++] as HTMLAnchorElement;\n\n if(a instanceof DocumentFragment) { // right after wrapRichText\n a = a.firstChild as any;\n }\n\n if(typeof(a) !== 'string') {\n a.textContent = ''; // reset content\n }\n }\n\n const formatted = superFormatter(text, args, indexHolder) as any;\n if(typeof(a) === 'string') {\n out.push(...formatted);\n } else {\n a.append(...formatted);\n out.push(a);\n }\n } else if(args) {\n pushNextArgument(out, args, indexHolder);\n }\n\n lastIndex = offset + match.length;\n return '';\n });\n\n if(lastIndex !== input.length) {\n out.push(input.slice(lastIndex));\n }\n\n return out;\n }\n\n export function format(key: LangPackKey, plain: true, args?: FormatterArguments): string;\n export function format(key: LangPackKey, plain?: false, args?: FormatterArguments): ReturnType;\n export function format(key: LangPackKey, plain = false, args?: FormatterArguments): ReturnType | string {\n const str = strings.get(key);\n let input: string;\n if(str) {\n if(str._ === 'langPackStringPluralized' && args?.length) {\n let v = args[0] as number | string;\n if(typeof(v) === 'string') v = +v.replace(/\\D/g, '');\n const s = pluralRules.select(v);\n // @ts-ignore\n input = str[s + '_value'] || str['other_value'];\n } else if(str._ === 'langPackString') {\n input = str.value;\n } else {\n // input = '[' + key + ']';\n input = key;\n }\n } else {\n // input = '[' + key + ']';\n input = key;\n }\n\n const result = superFormatter(input, args);\n if(plain) { // * let's try a hack now... (don't want to replace []() entity)\n return result.map((item) => item instanceof Node ? item.textContent : item).join('');\n } else {\n return result;\n }\n\n /* if(plain) {\n if(args?.length) {\n const regExp = /un\\d|%\\d\\$.|%./g;\n let i = 0;\n input = input.replace(regExp, (match, offset, string) => {\n return '' + args[i++];\n });\n }\n\n return input;\n } else {\n return superFormatter(input, args);\n } */\n }\n\n export const weakMap: WeakMap> = new WeakMap();\n\n export type IntlElementBaseOptions = {\n element?: HTMLElement,\n property?: 'innerText' | 'innerHTML' | 'placeholder' | 'textContent',\n };\n\n abstract class IntlElementBase {\n public element: IntlElementBaseOptions['element'];\n public property: IntlElementBaseOptions['property'];\n\n constructor(options?: Options) {\n this.element = options?.element || document.createElement('span');\n this.element.classList.add('i18n');\n\n this.property = options?.property;\n if(options && ((options as any as IntlElementOptions).key || (options as any as IntlDateElementOptions).date)) {\n this.update(options);\n }\n\n weakMap.set(this.element, this);\n }\n\n abstract update(options?: Options): void;\n }\n\n export type IntlElementOptions = IntlElementBaseOptions & {\n key?: LangPackKey,\n args?: FormatterArguments\n };\n export class IntlElement extends IntlElementBase {\n public key: IntlElementOptions['key'];\n public args: IntlElementOptions['args'];\n\n constructor(options: IntlElementOptions = {}) {\n super({...options, property: options.property ?? 'innerHTML'});\n }\n\n public update(options?: IntlElementOptions) {\n safeAssign(this, options);\n\n if(this.property === 'innerHTML') {\n this.element.textContent = '';\n this.element.append(...format(this.key, false, this.args) as any);\n } else {\n // @ts-ignore\n const v = this.element[this.property];\n const formatted = format(this.key, true, this.args);\n\n // * hasOwnProperty won't work here\n if(v === undefined) this.element.dataset[this.property] = formatted;\n else (this.element as HTMLInputElement)[this.property] = formatted;\n }\n }\n\n public compareAndUpdate(options?: IntlElementOptions) {\n if(this.key === options.key && deepEqual(this.args, options.args)) {\n return;\n }\n\n return this.update(options);\n }\n }\n\n const cachedDateTimeFormats: Map = new Map();\n function getDateTimeFormat(options: Intl.DateTimeFormatOptions = {}) {\n const json = JSON.stringify(options);\n let dateTimeFormat = cachedDateTimeFormats.get(json);\n if(!dateTimeFormat) {\n dateTimeFormat = new Intl.DateTimeFormat(lastRequestedNormalizedLangCode + '-u-hc-' + timeFormat, options);\n cachedDateTimeFormats.set(json, dateTimeFormat);\n }\n\n return dateTimeFormat;\n }\n\n export let amPmCache = {am: 'AM', pm: 'PM'};\n export type IntlDateElementOptions = IntlElementBaseOptions & {\n date?: Date,\n options: Intl.DateTimeFormatOptions\n };\n export class IntlDateElement extends IntlElementBase {\n public date: IntlDateElementOptions['date'];\n public options: IntlDateElementOptions['options'];\n\n constructor(options: IntlDateElementOptions) {\n super({...options, property: options.property ?? 'textContent'});\n setDirection(this.element);\n }\n\n public update(options?: IntlDateElementOptions) {\n safeAssign(this, options);\n\n let text: string;\n if(this.options.hour && this.options.minute && Object.keys(this.options).length === 2/* && false */) {\n const hours = this.date.getHours();\n text = ('0' + (timeFormat === 'h12' ? (hours % 12) || 12 : hours)).slice(-2) + ':' + ('0' + this.date.getMinutes()).slice(-2);\n // if(this.options.second) {\n // text += ':' + ('0' + this.date.getSeconds()).slice(-2);\n // }\n\n if(timeFormat === 'h12') {\n text += ' ' + (hours < 12 ? amPmCache.am : amPmCache.pm);\n }\n } else {\n // * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle#adding_an_hour_cycle_via_the_locale_string\n const dateTimeFormat = getDateTimeFormat(this.options);\n text = capitalizeFirstLetter(dateTimeFormat.format(this.date));\n }\n\n (this.element as any)[this.property] = text;\n }\n }\n\n export function i18n(key: LangPackKey, args?: FormatterArguments) {\n return new IntlElement({key, args}).element;\n }\n\n export function i18n_(options: IntlElementOptions) {\n return new IntlElement(options).element;\n }\n\n export function _i18n(element: HTMLElement, key: LangPackKey, args?: FormatterArguments, property?: IntlElementOptions['property']) {\n return new IntlElement({element, key, args, property}).element;\n }\n}\n\nexport {I18n};\nexport default I18n;\n\nconst i18n = I18n.i18n;\nexport {i18n};\n\nconst i18n_ = I18n.i18n_;\nexport {i18n_};\n\nconst _i18n = I18n._i18n;\nexport {_i18n};\n\nexport function joinElementsWith(elements: (Node | string)[], joiner: typeof elements[0] | ((isLast: boolean) => typeof elements[0])) {\n const arr = elements.slice(0, 1);\n for(let i = 1; i < elements.length; ++i) {\n const isLast = (elements.length - 1) === i;\n arr.push(typeof(joiner) === 'function' ? joiner(isLast) : joiner);\n arr.push(elements[i]);\n }\n\n return arr;\n}\n\n\nexport function join(elements: (Node | string)[], useLast: boolean, plain: true): string;\nexport function join(elements: (Node | string)[], useLast?: boolean, plain?: false): (string | Node)[];\nexport function join(elements: (Node | string)[], useLast: boolean, plain: boolean): string | (string | Node)[];\nexport function join(elements: (Node | string)[], useLast = true, plain?: boolean): string | (string | Node)[] {\n const joined = joinElementsWith(elements, (isLast) => {\n const langPackKey: LangPackKey = isLast && useLast ? 'AutoDownloadSettings.LastDelimeter' : 'AutoDownloadSettings.Delimeter';\n return plain ? I18n.format(langPackKey, true) : i18n(langPackKey);\n });\n\n return plain ? joined.join('') : joined;\n}\n\nMOUNT_CLASS_TO.I18n = I18n;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type addAnchorListener from '../../helpers/addAnchorListener';\nimport {PHONE_NUMBER_REG_EXP} from '.';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport matchUrlProtocol from './matchUrlProtocol';\nimport {T_ME_PREFIXES} from '../mtproto/mtproto_config';\n\nexport default function wrapUrl(url: string, unsafe?: number | boolean) {\n if(!matchUrlProtocol(url)) {\n url = 'https://' + url;\n }\n\n const out: {url: string, onclick?: Parameters[0]['name']} = {url};\n let tgMeMatch, telescoPeMatch, tgMatch;\n let onclick: typeof out['onclick'];\n /* if(unsafe === 2) {\n url = 'tg://unsafe_url?url=' + encodeURIComponent(url);\n } else */if((tgMeMatch = url.match(/^(?:https?:\\/\\/)?(?:(.+?)\\.)?(?:(?:web|k|z)\\.)?t(?:elegram)?\\.me(?:\\/(.+))?/))) {\n const u = new URL(url);\n let prefix = tgMeMatch[1];\n if(prefix && T_ME_PREFIXES.has(tgMeMatch[1])) {\n prefix = undefined;\n }\n\n if(prefix) {\n u.pathname = prefix + (u.pathname === '/' ? '' : u.pathname);\n }\n\n const fullPath = u.pathname.slice(1);\n const path = fullPath.split('/');\n\n if(path[0] && path[0][0] === '$' && path[0].length > 1) {\n onclick = 'invoice';\n } else if(/^\\W/.test(fullPath) && !PHONE_NUMBER_REG_EXP.test(fullPath)) { // second regexp is for phone numbers (t.me/+38050...)\n onclick = 'joinchat';\n } else switch(path[0]) {\n case 'joinchat':\n case 'addstickers':\n case 'addemoji':\n case 'voicechat':\n case 'invoice':\n if(path.length !== 1 && !prefix) {\n onclick = path[0];\n break;\n }\n\n default:\n if((path[1] && path[1].match(/^\\d+(?:\\?(?:comment|thread)=\\d+)?$/)) || path.length === 1) {\n onclick = 'im';\n break;\n }\n\n break;\n }\n } else if((telescoPeMatch = url.match(/^(?:https?:\\/\\/)?telesco\\.pe\\/([^/?]+)\\/(\\d+)/))) {\n onclick = 'im';\n } else if((tgMatch = url.match(/tg:(?:\\/\\/)?(.+?)(?:\\?|$)/))) {\n onclick = 'tg_' + tgMatch[1] as any;\n }/* else if(unsafe) {\n url = 'tg://unsafe_url?url=' + encodeURIComponent(url);\n } */\n\n if(!(window as any)[onclick]) {\n onclick = undefined;\n }\n\n out.onclick = onclick;\n return out;\n}\n\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.wrapUrl = wrapUrl);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import I18n from '../../lib/langPack';\n\nexport default function setInnerHTML(elem: Element, html: string | DocumentFragment | Element) {\n setDirection(elem);\n if(typeof(html) === 'string') {\n if(!html) elem.replaceChildren();\n else elem.innerHTML = html;\n } else {\n elem.replaceChildren(html);\n }\n}\n\nexport function setDirection(elem: Element) {\n // if(!I18n.isRTL) {\n elem.setAttribute('dir', 'auto');\n // }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MOUNT_CLASS_TO} from '../config/debug';\nimport I18n, {i18n} from '../lib/langPack';\n\nexport const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\nexport const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n\nexport const ONE_DAY = 86400;\n\n// https://stackoverflow.com/a/6117889\nexport const getWeekNumber = (date: Date) => {\n const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));\n const dayNum = d.getUTCDay() || 7;\n d.setUTCDate(d.getUTCDate() + 4 - dayNum);\n const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));\n return Math.ceil((((d.getTime() - yearStart.getTime()) / ONE_DAY) + 1) / 7);\n};\n\nexport function formatDateAccordingToTodayNew(time: Date) {\n const today = new Date();\n const now = today.getTime() / 1000 | 0;\n const timestamp = time.getTime() / 1000 | 0;\n\n const options: Intl.DateTimeFormatOptions = {};\n if((now - timestamp) < ONE_DAY && today.getDate() === time.getDate()) { // if the same day\n options.hour = options.minute = '2-digit';\n } else if(today.getFullYear() !== time.getFullYear()) { // different year\n options.year = options.day = 'numeric';\n options.month = '2-digit';\n } else if((now - timestamp) < (ONE_DAY * 7) && getWeekNumber(today) === getWeekNumber(time)) { // current week\n options.weekday = 'short';\n } else { // same year\n options.month = 'short';\n options.day = 'numeric';\n }\n\n return new I18n.IntlDateElement({\n date: time,\n options\n }).element;\n}\n\nexport function formatFullSentTimeRaw(timestamp: number, options: {\n capitalize?: boolean\n} = {}) {\n const date = new Date();\n const time = new Date(timestamp * 1000);\n const now = date.getTime() / 1000;\n\n const timeEl = formatTime(time);\n\n let dateEl: Node | string;\n if((now - timestamp) < ONE_DAY && date.getDate() === time.getDate()) { // if the same day\n dateEl = i18n(options.capitalize ? 'Date.Today' : 'Peer.Status.Today');\n } else if((now - timestamp) < (ONE_DAY * 2) && (date.getDate() - 1) === time.getDate()) { // yesterday\n dateEl = i18n(options.capitalize ? 'Yesterday' : 'Peer.Status.Yesterday');\n\n if(options.capitalize) {\n (dateEl as HTMLElement).style.textTransform = 'capitalize';\n }\n } else if(date.getFullYear() !== time.getFullYear()) { // different year\n dateEl = new I18n.IntlDateElement({\n date: time,\n options: {\n month: 'short',\n day: 'numeric',\n year: 'numeric'\n }\n }).element;\n // dateStr = months[time.getMonth()].slice(0, 3) + ' ' + time.getDate() + ', ' + time.getFullYear();\n } else {\n dateEl = new I18n.IntlDateElement({\n date: time,\n options: {\n month: 'short',\n day: 'numeric'\n }\n }).element;\n // dateStr = months[time.getMonth()].slice(0, 3) + ' ' + time.getDate();\n }\n\n return {dateEl, timeEl};\n}\n\nexport function formatFullSentTime(timestamp: number) {\n const {dateEl, timeEl} = formatFullSentTimeRaw(timestamp, {\n capitalize: true\n });\n\n const fragment = document.createDocumentFragment();\n fragment.append(dateEl, ' ', i18n('ScheduleController.at'), ' ', timeEl);\n return fragment;\n}\n\nexport function formatTime(date: Date) {\n return new I18n.IntlDateElement({\n date,\n options: {\n hour: '2-digit',\n minute: '2-digit'\n }\n }).element;\n}\n\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.formatDateAccordingToTodayNew = formatDateAccordingToTodayNew);\n\nexport const getFullDate = (date: Date, options: Partial<{\n noTime: true,\n noSeconds: true,\n monthAsNumber: true,\n leadingZero: true\n}> = {}) => {\n const joiner = options.monthAsNumber ? '.' : ' ';\n const time = ('0' + date.getHours()).slice(-2) + ':' + ('0' + date.getMinutes()).slice(-2) + (options.noSeconds ? '' : ':' + ('0' + date.getSeconds()).slice(-2));\n\n return (options.leadingZero ? ('0' + date.getDate()).slice(-2) : date.getDate()) +\n joiner + (options.monthAsNumber ? ('0' + (date.getMonth() + 1)).slice(-2) : months[date.getMonth()]) +\n joiner + date.getFullYear() +\n (options.noTime ? '' : ', ' + time);\n};\n\n// https://github.com/DrKLO/Telegram/blob/d52b2c921abd3c1e8d6368858313ad0cb0468c07/TMessagesProj/src/main/java/org/telegram/ui/Adapters/FiltersView.java\nconst minYear = 2013;\nconst yearPattern = new RegExp('20[0-9]{1,2}');\nconst monthYearOrDayPattern = new RegExp('(\\\\w{3,}) ([0-9]{0,4})', 'i');\nconst yearOrDayAndMonthPattern = new RegExp('([0-9]{0,4}) (\\\\w{2,})', 'i');\nconst shortDate = new RegExp('^([0-9]{1,4})(\\\\.| |/|\\\\-)([0-9]{1,4})$', 'i');\nconst longDate = new RegExp('^([0-9]{1,2})(\\\\.| |/|\\\\-)([0-9]{1,2})(\\\\.| |/|\\\\-)([0-9]{1,4})$', 'i');\nconst numberOfDaysEachMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nexport type DateData = {\n title: string,\n minDate: number,\n maxDate: number,\n};\nexport function fillTipDates(query: string, dates: DateData[]) {\n const q = query.trim().toLowerCase();\n\n if(q.length < 3) {\n return;\n }\n\n if('today'.indexOf(q) === 0) {\n const date = new Date();\n const year = date.getFullYear();\n const month = date.getMonth();\n const day = date.getDate();\n date.setFullYear(year, month, day);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: 'Today',\n minDate,\n maxDate\n });\n return;\n }\n\n if('yesterday'.indexOf(q) === 0) {\n const date = new Date();\n const year = date.getFullYear();\n const month = date.getMonth();\n const day = date.getDate();\n date.setFullYear(year, month, day);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime() - 86400000;\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 86400001;\n dates.push({\n title: 'Yesterday',\n minDate,\n maxDate\n });\n return;\n }\n\n const dayOfWeek = getDayOfWeek(q);\n if(dayOfWeek >= 0) {\n const date = new Date();\n const now = date.getTime();\n const currentDay = date.getDay();\n const distance = dayOfWeek - currentDay;\n date.setDate(date.getDate() + distance);\n if(date.getTime() > now) {\n date.setTime(date.getTime() - 604800000);\n }\n const year = date.getFullYear()\n const month = date.getMonth();\n const day = date.getDate();\n date.setFullYear(year, month, day);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: formatWeekLong(minDate),\n minDate,\n maxDate\n });\n return;\n }\n\n let matches: any[];\n if((matches = shortDate.exec(q)) !== null) {\n const g1 = matches[1];\n const g2 = matches[3];\n const k = parseInt(g1);\n const k1 = parseInt(g2);\n if(k > 0 && k <= 31) {\n if(k1 >= minYear && k <= 12) {\n const selectedYear = k1;\n const month = k - 1;\n createForMonthYear(dates, month, selectedYear);\n return;\n } else if(k1 <= 12) {\n const day = k - 1;\n const month = k1 - 1;\n createForDayMonth(dates, day, month);\n }\n } else if(k >= minYear && k1 <= 12) {\n const selectedYear = k;\n const month = k1 - 1;\n createForMonthYear(dates, month, selectedYear);\n }\n\n return;\n }\n\n if((matches = longDate.exec(q)) !== null) {\n const g1 = matches[1];\n const g2 = matches[3];\n const g3 = matches[5];\n if(!matches[2] === matches[4]) {\n return;\n }\n\n const day = parseInt(g1);\n const month = parseInt(g2) - 1;\n let year = parseInt(g3);\n if(year >= 10 && year <= 99) {\n year += 2000;\n }\n\n const currentYear = new Date().getFullYear();\n if(validDateForMonth(day - 1, month) && year >= minYear && year <= currentYear) {\n const date = new Date();\n date.setFullYear(year, month, day);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: formatterYearMax(minDate),\n minDate,\n maxDate\n });\n return;\n }\n\n return;\n }\n\n if((matches = yearPattern.exec(q)) !== null) {\n let selectedYear = +q;\n const currentYear = new Date().getFullYear();\n if(selectedYear < minYear) {\n selectedYear = minYear;\n for(let i = currentYear; i >= selectedYear; i--) {\n const date = new Date();\n date.setFullYear(i, 0, 1);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(i + 1, 0, 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: '' + i,\n minDate,\n maxDate\n });\n }\n } else if(selectedYear <= currentYear) {\n const date = new Date();\n date.setFullYear(selectedYear, 0, 1);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n date.setFullYear(selectedYear + 1, 0, 1);\n date.setHours(0, 0, 0);\n\n const maxDate = date.getTime() - 1;\n dates.push({\n title: '' + selectedYear,\n minDate,\n maxDate\n });\n }\n\n return;\n }\n\n if((matches = monthYearOrDayPattern.exec(q)) !== null) {\n const g1 = matches[1];\n const g2 = matches[2];\n const month = getMonth(g1);\n if(month >= 0) {\n const k = +g2;\n if(k > 0 && k <= 31) {\n const day = k - 1;\n createForDayMonth(dates, day, month);\n return;\n } else if(k >= minYear) {\n const selectedYear = k;\n createForMonthYear(dates, month, selectedYear);\n return;\n }\n }\n }\n\n if((matches = yearOrDayAndMonthPattern.exec(q)) !== null) {\n const g1 = matches[1];\n const g2 = matches[2];\n const month = getMonth(g2);\n if(month >= 0) {\n const k = +g1;\n if(k > 0 && k <= 31) {\n const day = k - 1;\n createForDayMonth(dates, day, month);\n return;\n } else if(k >= minYear) {\n const selectedYear = k;\n createForMonthYear(dates, month, selectedYear);\n }\n }\n }\n}\n\nfunction createForMonthYear(dates: DateData[], month: number, selectedYear: number) {\n const currentYear = new Date().getFullYear();\n const today = Date.now();\n if(selectedYear >= minYear && selectedYear <= currentYear) {\n const date = new Date();\n date.setFullYear(selectedYear, month, 1);\n date.setHours(0, 0, 0);\n const minDate = date.getTime();\n if(minDate > today) {\n return;\n }\n date.setMonth(date.getMonth() + 1);\n const maxDate = date.getTime() - 1;\n\n dates.push({\n title: formatterMonthYear(minDate),\n minDate,\n maxDate\n });\n }\n}\n\nfunction createForDayMonth(dates: DateData[], day: number, month: number) {\n if(validDateForMonth(day, month)) {\n const currentYear = new Date().getFullYear();\n const today = Date.now();\n\n for(let i = currentYear; i >= minYear; i--) {\n if(month === 1 && day === 28 && !isLeapYear(i)) {\n continue;\n }\n\n const date = new Date();\n date.setFullYear(i, month, day + 1);\n date.setHours(0, 0, 0);\n\n const minDate = date.getTime();\n if(minDate > today) {\n continue;\n }\n\n date.setFullYear(i, month, day + 2);\n date.setHours(0, 0, 0);\n const maxDate = date.getTime() - 1;\n if(i === currentYear) {\n dates.push({\n title: formatterDayMonth(minDate),\n minDate,\n maxDate\n });\n } else {\n dates.push({\n title: formatterYearMax(minDate),\n minDate,\n maxDate\n });\n }\n }\n }\n}\n\nfunction formatterMonthYear(timestamp: number) {\n const date = new Date(timestamp);\n return months[date.getMonth()].slice(0, 3) + ' ' + date.getFullYear();\n}\n\nfunction formatterDayMonth(timestamp: number) {\n const date = new Date(timestamp);\n return months[date.getMonth()].slice(0, 3) + ' ' + date.getDate();\n}\n\nfunction formatterYearMax(timestamp: number) {\n const date = new Date(timestamp);\n return ('0' + date.getDate()).slice(-2) + '.' + ('0' + (date.getMonth() + 1)).slice(-2) + '.' + date.getFullYear();\n}\n\nfunction formatWeekLong(timestamp: number) {\n const date = new Date(timestamp);\n return days[date.getDay()];\n}\n\nfunction validDateForMonth(day: number, month: number) {\n if(month >= 0 && month < 12) {\n if(day >= 0 && day < numberOfDaysEachMonth[month]) {\n return true;\n }\n }\n return false;\n}\n\nfunction isLeapYear(year: number) {\n return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0);\n}\n\nfunction getMonth(q: string) {\n /* String[] months = new String[]{\n LocaleController.getString(\"January\", R.string.January).toLowerCase(),\n LocaleController.getString(\"February\", R.string.February).toLowerCase(),\n LocaleController.getString(\"March\", R.string.March).toLowerCase(),\n LocaleController.getString(\"April\", R.string.April).toLowerCase(),\n LocaleController.getString(\"May\", R.string.May).toLowerCase(),\n LocaleController.getString(\"June\", R.string.June).toLowerCase(),\n LocaleController.getString(\"July\", R.string.July).toLowerCase(),\n LocaleController.getString(\"August\", R.string.August).toLowerCase(),\n LocaleController.getString(\"September\", R.string.September).toLowerCase(),\n LocaleController.getString(\"October\", R.string.October).toLowerCase(),\n LocaleController.getString(\"November\", R.string.November).toLowerCase(),\n LocaleController.getString(\"December\", R.string.December).toLowerCase()\n }; */\n\n /* String[] monthsEng = new String[12];\n Calendar c = Calendar.getInstance();\n for (int i = 1; i <= 12; i++) {\n c.set(0, 0, 0, 0, 0, 0);\n c.set(Calendar.MONTH, i);\n monthsEng[i - 1] = c.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.ENGLISH).toLowerCase();\n } */\n\n q = q.toLowerCase();\n for(let i = 0; i < 12; i++) {\n const month = months[i].toLowerCase();\n if(month.indexOf(q) === 0) {\n return i;\n }\n }\n return -1;\n}\n\nfunction getDayOfWeek(q: string) {\n const c = new Date();\n if(q.length <= 3) {\n return -1;\n }\n\n for(let i = 0; i < 7; i++) {\n c.setDate(c.getDate() + 1);\n\n if(formatWeekLong(c.getTime()).toLowerCase().indexOf(q) === 0) {\n return c.getDay();\n }\n }\n return -1;\n}\n\nMOUNT_CLASS_TO.fillTipDates = fillTipDates;\n","/**\n * Will be used for FILE_REFERENCE_EXPIRED\n * @param key\n * @param wasObject\n * @param newObject\n */\nexport default function safeReplaceArrayInObject(key: K, wasObject: any, newObject: any) {\n if('byteLength' in newObject[key]) { // Uint8Array\n newObject[key] = [...newObject[key]];\n }\n\n if(wasObject && wasObject[key] !== newObject[key]) {\n wasObject[key].length = newObject[key].length;\n (newObject[key] as any[]).forEach((v, i) => {\n wasObject[key][i] = v;\n });\n\n /* wasObject[key].set(newObject[key]); */\n newObject[key] = wasObject[key];\n }\n}\n","export const EXTENSION_MIME_TYPE_MAP: {[ext in MTFileExtension]: MTMimeType} = {\n pdf: 'application/pdf',\n tgv: 'application/x-tgwallpattern',\n tgs: 'application/x-tgsticker',\n json: 'application/json',\n wav: 'audio/wav',\n mp3: 'audio/mpeg',\n ogg: 'audio/ogg',\n jpeg: 'image/jpeg',\n jpg: 'image/jpeg',\n png: 'image/png',\n gif: 'image/gif',\n webp: 'image/webp',\n mp4: 'video/mp4',\n webm: 'video/webm',\n mov: 'video/quicktime',\n svg: 'image/svg+xml'\n};\n\nexport const MIME_TYPE_EXTENSION_MAP: {[mimeType in MTMimeType]?: MTFileExtension} = {};\n\nfor(const ext in EXTENSION_MIME_TYPE_MAP) {\n MIME_TYPE_EXTENSION_MAP[EXTENSION_MIME_TYPE_MAP[ext as MTFileExtension]] = ext as MTFileExtension;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {ThumbCache} from '../storages/thumbs';\nimport {AccountWallPapers, Document, DocumentAttribute, MessagesSavedGifs, PhotoSize, WallPaper} from '../../layer';\nimport {ReferenceContext} from '../mtproto/referenceDatabase';\nimport {getFullDate} from '../../helpers/date';\nimport isObject from '../../helpers/object/isObject';\nimport safeReplaceArrayInObject from '../../helpers/object/safeReplaceArrayInObject';\nimport {AppManager} from './manager';\nimport wrapPlainText from '../richTextProcessor/wrapPlainText';\nimport assumeType from '../../helpers/assumeType';\nimport {getEnvironment} from '../../environment/utils';\nimport {isServiceWorkerOnline} from '../mtproto/mtproto.worker';\nimport MTProtoMessagePort from '../mtproto/mtprotoMessagePort';\nimport getDocumentInputFileLocation from './utils/docs/getDocumentInputFileLocation';\nimport getDocumentURL from './utils/docs/getDocumentURL';\nimport makeError from '../../helpers/makeError';\nimport {EXTENSION_MIME_TYPE_MAP} from '../../environment/mimeTypeMap';\nimport {THUMB_TYPE_FULL} from '../mtproto/mtproto_config';\nimport tsNow from '../../helpers/tsNow';\n\nexport type MyDocument = Document.document;\n\n// TODO: если залить картинку файлом, а потом перезайти в диалог - превьюшка заново скачается\n\ntype WallPaperId = WallPaper.wallPaper['id'];\n\nlet uploadWallPaperTempId = 0;\n\nexport class AppDocsManager extends AppManager {\n private docs: {[docId: DocId]: MyDocument};\n\n private stickerCachedThumbs: {[docId: DocId]: {[toneIndex: number]: {url: string, w: number, h: number}}};\n\n private uploadingWallPapers: {[id: WallPaperId]: {cacheContext: ThumbCache, file: File}};\n\n protected after() {\n this.docs = {};\n this.stickerCachedThumbs = {};\n this.uploadingWallPapers = {};\n\n MTProtoMessagePort.getInstance().addEventListener('serviceWorkerOnline', (online) => {\n if(!online) {\n this.onServiceWorkerFail();\n }\n });\n }\n\n private onServiceWorkerFail = () => {\n for(const id in this.docs) {\n const doc = this.docs[id];\n\n if(doc.supportsStreaming) {\n delete doc.supportsStreaming;\n this.thumbsStorage.deleteCacheContext(doc);\n }\n }\n };\n\n public saveDoc(doc: Document, context?: ReferenceContext): MyDocument {\n if(!doc || doc._ === 'documentEmpty') {\n return;\n }\n\n const oldDoc = this.docs[doc.id];\n\n if(doc.file_reference) { // * because we can have a new object w/o the file_reference while sending\n safeReplaceArrayInObject('file_reference', oldDoc, doc);\n this.referenceDatabase.saveContext(doc.file_reference, context);\n }\n\n // console.log('saveDoc', apiDoc, this.docs[apiDoc.id]);\n // if(oldDoc) {\n // //if(doc._ !== 'documentEmpty' && doc._ === d._) {\n // if(doc.thumbs) {\n // if(!oldDoc.thumbs) oldDoc.thumbs = doc.thumbs;\n // /* else if(apiDoc.thumbs[0].bytes && !d.thumbs[0].bytes) {\n // d.thumbs.unshift(apiDoc.thumbs[0]);\n // } else if(d.thumbs[0].url) { // fix for converted thumb in safari\n // apiDoc.thumbs[0] = d.thumbs[0];\n // } */\n // }\n\n // //}\n\n // return oldDoc;\n\n // //return Object.assign(d, apiDoc, context);\n // //return context ? Object.assign(d, context) : d;\n // }\n\n if(!oldDoc) {\n this.docs[doc.id] = doc;\n }\n\n // * exclude from state\n // defineNotNumerableProperties(doc, [/* 'thumbs', */'type', 'h', 'w', 'file_name',\n // 'file', 'duration', 'downloaded', 'url', 'audioTitle',\n // 'audioPerformer', 'sticker', 'stickerEmoji', 'stickerEmojiRaw',\n // 'stickerSetInput', 'stickerThumbConverted', 'animated', 'supportsStreaming']);\n\n for(let i = 0, length = doc.attributes.length; i < length; ++i) {\n const attribute = doc.attributes[i];\n switch(attribute._) {\n case 'documentAttributeFilename': {\n doc.file_name = wrapPlainText(attribute.file_name);\n break;\n }\n\n case 'documentAttributeAudio': {\n if(doc.type === 'round') {\n break;\n }\n\n doc.duration = attribute.duration;\n doc.type = attribute.pFlags.voice && doc.mime_type === 'audio/ogg' ? 'voice' : 'audio';\n break;\n }\n\n case 'documentAttributeVideo': {\n doc.duration = attribute.duration;\n doc.w = attribute.w;\n doc.h = attribute.h;\n // apiDoc.supportsStreaming = attribute.pFlags?.supports_streaming/* && apiDoc.size > 524288 */;\n if(/* apiDoc.thumbs && */attribute.pFlags.round_message) {\n doc.type = 'round';\n } else /* if(apiDoc.thumbs) */ {\n doc.type = 'video';\n }\n break;\n }\n\n case 'documentAttributeCustomEmoji':\n case 'documentAttributeSticker': {\n if(attribute.alt !== undefined) {\n doc.stickerEmojiRaw = attribute.alt;\n }\n\n if(attribute.stickerset) {\n if(attribute.stickerset._ === 'inputStickerSetEmpty') {\n delete attribute.stickerset;\n } else if(attribute.stickerset._ === 'inputStickerSetID') {\n doc.stickerSetInput = attribute.stickerset;\n }\n }\n\n // * there can be no thumbs, then it is a document\n if(/* apiDoc.thumbs && */doc.mime_type === 'image/webp' && (doc.thumbs || getEnvironment().IS_WEBP_SUPPORTED)) {\n doc.type = 'sticker';\n doc.sticker = 1;\n } else if(doc.mime_type === 'video/webm') {\n if(!getEnvironment().IS_WEBM_SUPPORTED) {\n break;\n }\n\n doc.type = 'sticker';\n doc.sticker = 3;\n doc.animated = true;\n }\n break;\n }\n\n case 'documentAttributeImageSize': {\n doc.type = 'photo';\n doc.w = attribute.w;\n doc.h = attribute.h;\n break;\n }\n\n case 'documentAttributeAnimated': {\n if((doc.mime_type === 'image/gif' || doc.mime_type === 'video/mp4')/* && apiDoc.thumbs */) {\n doc.type = 'gif';\n }\n\n doc.animated = true;\n break;\n }\n }\n }\n\n if(!doc.mime_type) {\n const ext = (doc.file_name || '').split('.').pop();\n // @ts-ignore\n const mappedMimeType = ext && EXTENSION_MIME_TYPE_MAP[ext.toLowerCase()];\n if(mappedMimeType) {\n doc.mime_type = mappedMimeType;\n } else {\n switch(doc.type) {\n case 'gif':\n case 'video':\n case 'round':\n doc.mime_type = 'video/mp4';\n break;\n case 'sticker':\n doc.mime_type = 'image/webp';\n break;\n case 'audio':\n doc.mime_type = 'audio/mpeg';\n break;\n case 'voice':\n doc.mime_type = 'audio/ogg';\n break;\n default:\n doc.mime_type = 'application/octet-stream';\n break;\n }\n }\n } else if(doc.mime_type === EXTENSION_MIME_TYPE_MAP.pdf) {\n doc.type = 'pdf';\n } else if(doc.mime_type === EXTENSION_MIME_TYPE_MAP.gif) {\n doc.type = 'gif';\n } else if(doc.mime_type === 'application/x-tgsticker' && doc.file_name === 'AnimatedSticker.tgs') {\n doc.type = 'sticker';\n doc.animated = true;\n doc.sticker = 2;\n }\n\n if(doc.type === 'voice' || doc.type === 'round') {\n // browser will identify extension\n const attribute = doc.attributes.find((attribute) => attribute._ === 'documentAttributeFilename') as DocumentAttribute.documentAttributeFilename;\n const ext = attribute && attribute.file_name.split('.').pop();\n const date = getFullDate(new Date(doc.date * 1000), {monthAsNumber: true, leadingZero: true}).replace(/[:\\.]/g, '-').replace(', ', '_');\n doc.file_name = `${doc.type}_${date}${ext ? '.' + ext : ''}`;\n }\n\n if(isServiceWorkerOnline() && ((doc.type === 'gif' && doc.size > 8e6) || doc.type === 'audio' || doc.type === 'video')/* || doc.mime_type.indexOf('video/') === 0 */) {\n doc.supportsStreaming = true;\n\n const cacheContext = this.thumbsStorage.getCacheContext(doc);\n if(!cacheContext.url) {\n this.thumbsStorage.setCacheContextURL(doc, undefined, getDocumentURL(doc), 0);\n }\n } else {\n doc.supportsStreaming = false;\n }\n\n // for testing purposes\n // doc.supportsStreaming = false;\n // doc.url = ''; // * this will break upload urls\n\n doc.file_name ||= '';\n\n /* if(!doc.url) {\n doc.url = this.getFileURL(doc);\n } */\n\n if(oldDoc) {\n return Object.assign(oldDoc, doc);\n }\n\n return doc;\n }\n\n public getDoc(docId: DocId | MyDocument): MyDocument {\n return isObject(docId) ? docId : this.docs[docId];\n }\n\n public downloadDoc(doc: MyDocument, queueId?: number, onlyCache?: boolean) {\n return this.apiFileManager.downloadMedia({\n media: doc,\n queueId,\n onlyCache\n });\n }\n\n public getLottieCachedThumb(docId: DocId, toneIndex: number) {\n const cached = this.stickerCachedThumbs[docId];\n return cached && cached[toneIndex];\n }\n\n public saveLottiePreview(docId: DocId, blob: Blob, width: number, height: number, toneIndex: number) {\n const doc = this.getDoc(docId);\n if(!doc) {\n return;\n }\n\n const cached = this.stickerCachedThumbs[doc.id] ??= {};\n\n const thumb = cached[toneIndex];\n if(thumb && thumb.w >= width && thumb.h >= height) {\n return;\n }\n\n cached[toneIndex] = {\n url: URL.createObjectURL(blob),\n w: width,\n h: height\n };\n }\n\n public saveWebPConvertedStrippedThumb(docId: DocId, bytes: Uint8Array) {\n const doc = this.getDoc(docId);\n if(!doc) {\n return;\n }\n\n const thumb = doc.thumbs && doc.thumbs.find((thumb) => thumb._ === 'photoStrippedSize') as PhotoSize.photoStrippedSize;\n if(!thumb) {\n return;\n }\n\n doc.pFlags.stickerThumbConverted = true;\n thumb.bytes = bytes;\n }\n\n public prepareWallPaperUpload(file: File) {\n const id = 'wallpaper-upload-' + ++uploadWallPaperTempId;\n\n const thumb = {\n _: 'photoSize',\n h: 0,\n w: 0,\n location: {} as any,\n size: file.size,\n type: THUMB_TYPE_FULL\n } as PhotoSize.photoSize;\n let document: MyDocument = {\n _: 'document',\n access_hash: '',\n attributes: [],\n dc_id: 0,\n file_reference: [],\n id,\n mime_type: file.type as MTMimeType,\n size: file.size,\n date: tsNow(true),\n pFlags: {},\n thumbs: [thumb],\n file_name: file.name\n };\n\n document = this.saveDoc(document);\n\n const cacheContext = this.thumbsStorage.setCacheContextURL(document, undefined, URL.createObjectURL(file), file.size);\n\n const wallpaper: WallPaper.wallPaper = {\n _: 'wallPaper',\n access_hash: '',\n document: document,\n id,\n slug: id,\n pFlags: {}\n };\n\n this.uploadingWallPapers[id] = {\n cacheContext,\n file\n };\n\n return wallpaper;\n }\n\n public uploadWallPaper(id: WallPaperId) {\n const {cacheContext, file} = this.uploadingWallPapers[id];\n delete this.uploadingWallPapers[id];\n\n const upload = this.apiFileManager.upload({file, fileName: file.name});\n return upload.then((inputFile) => {\n return this.apiManager.invokeApi('account.uploadWallPaper', {\n file: inputFile,\n mime_type: file.type,\n settings: {\n _: 'wallPaperSettings',\n pFlags: {}\n }\n }).then((wallPaper) => {\n assumeType(wallPaper);\n wallPaper.document = this.saveDoc(wallPaper.document);\n this.thumbsStorage.setCacheContextURL(wallPaper.document, undefined, cacheContext.url, cacheContext.downloaded);\n\n return wallPaper;\n });\n });\n }\n\n public getGifs() {\n return this.apiManager.invokeApiHashable({\n method: 'messages.getSavedGifs',\n processResult: (res) => {\n assumeType(res);\n return res.gifs.map((doc) => this.saveDoc(doc));\n }\n });\n }\n\n public requestDocPart(docId: DocId, dcId: number, offset: number, limit: number) {\n const doc = this.getDoc(docId);\n if(!doc) return Promise.reject(makeError('NO_DOC'));\n return this.apiFileManager.requestFilePart(dcId, getDocumentInputFileLocation(doc), offset, limit);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {FileURLType, getFileURL} from '../../../../helpers/fileName';\nimport {Document, PhotoSize} from '../../../../layer';\nimport getDocumentDownloadOptions from './getDocumentDownloadOptions';\n\nexport default function getDocumentURL(doc: Document.document, download = false, thumb?: PhotoSize.photoSize) {\n let type: FileURLType;\n if(download) {\n type = 'download';\n } else if(thumb) {\n type = 'thumb';\n } else if(doc.supportsStreaming) {\n type = 'stream';\n } else {\n type = 'document';\n }\n\n return getFileURL(type, getDocumentDownloadOptions(doc, thumb));\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {MessageEntity, DraftMessage, MessagesSaveDraft} from '../../layer';\nimport tsNow from '../../helpers/tsNow';\nimport stateStorage from '../stateStorage';\nimport assumeType from '../../helpers/assumeType';\nimport {AppManager} from './manager';\nimport generateMessageId from './utils/messageId/generateMessageId';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\nimport draftsAreEqual from './utils/drafts/draftsAreEqual';\n\nexport type MyDraftMessage = DraftMessage.draftMessage;\n\nexport class AppDraftsManager extends AppManager {\n private drafts: {[peerIdAndThreadId: string]: MyDraftMessage} = {};\n private getAllDraftPromise: Promise;\n\n protected after() {\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateDraftMessage: (update) => {\n const peerId = this.appPeersManager.getPeerId(update.peer);\n this.saveDraft({\n peerId,\n threadId: update.threadId,\n draft: update.draft,\n notify: true\n });\n }\n });\n\n /* return */stateStorage.get('drafts').then((drafts) => {\n this.drafts = drafts || {};\n });\n }\n\n private getKey(peerId: PeerId, threadId?: number) {\n return '' + peerId + (threadId ? '_' + threadId : '');\n }\n\n public getDraft(peerId: PeerId, threadId?: number) {\n return this.drafts[this.getKey(peerId, threadId)];\n }\n\n public addMissedDialogs() {\n return this.getAllDrafts().then(() => {\n for(const key in this.drafts) {\n if(key.indexOf('_') !== -1) { // exclude threads\n continue;\n }\n\n const peerId = key.toPeerId();\n const dialog = this.appMessagesManager.getDialogOnly(peerId);\n if(!dialog) {\n this.appMessagesManager.reloadConversation(peerId);\n /* const dialog = appMessagesManager.generateDialog(peerId);\n dialog.draft = this.drafts[key];\n appMessagesManager.saveConversation(dialog);\n appMessagesManager.newDialogsToHandle[peerId] = dialog;\n appMessagesManager.scheduleHandleNewDialogs(); */\n }\n }\n });\n }\n\n private getAllDrafts() {\n return this.getAllDraftPromise ??= this.apiManager.invokeApi('messages.getAllDrafts')\n .then((updates) => {\n const p = this.apiUpdatesManager.updatesState.syncLoading || Promise.resolve();\n p.then(() => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n });\n });\n }\n\n public saveDraft({peerId, threadId, draft: apiDraft, notify, force}: {\n peerId: PeerId,\n threadId?: number,\n draft: DraftMessage,\n notify?: boolean,\n force?: boolean\n }) {\n const draft = this.processApiDraft(apiDraft);\n\n const key = this.getKey(peerId, threadId);\n if(draft) {\n this.drafts[key] = draft;\n } else {\n delete this.drafts[key];\n }\n\n stateStorage.set({\n drafts: this.drafts\n });\n\n if(notify) {\n // console.warn(dT(), 'save draft', peerId, apiDraft, options)\n this.rootScope.dispatchEvent('draft_updated', {\n peerId,\n threadId,\n draft,\n force\n });\n }\n\n return draft;\n }\n\n private isEmptyDraft(draft: DraftMessage) {\n if(draft?._ !== 'draftMessage') {\n return true;\n }\n\n if(draft.reply_to_msg_id !== undefined && draft.reply_to_msg_id > 0) {\n return false;\n }\n\n if(!draft.message.length) {\n return true;\n }\n\n return false;\n }\n\n private processApiDraft(draft: DraftMessage): MyDraftMessage {\n if(!draft || draft._ !== 'draftMessage') {\n return undefined;\n }\n\n if(draft.reply_to_msg_id) {\n draft.reply_to_msg_id = generateMessageId(draft.reply_to_msg_id);\n }\n\n return draft;\n }\n\n public syncDraft(peerId: PeerId, threadId: number, localDraft?: DraftMessage, saveOnServer = true, force = false) {\n // console.warn(dT(), 'sync draft', peerID)\n const serverDraft = this.getDraft(peerId, threadId);\n if(draftsAreEqual(serverDraft, localDraft)) {\n // console.warn(dT(), 'equal drafts', localDraft, serverDraft)\n return true;\n }\n\n // console.warn(dT(), 'changed draft', localDraft, serverDraft)\n const params: MessagesSaveDraft = {\n peer: this.appPeersManager.getInputPeerById(peerId),\n message: ''\n };\n\n let draftObj: DraftMessage;\n if(this.isEmptyDraft(localDraft)) {\n draftObj = {_: 'draftMessageEmpty'};\n } else {\n assumeType(localDraft);\n const message = localDraft.message;\n const entities: MessageEntity[] = localDraft.entities;\n\n if(localDraft.reply_to_msg_id) {\n params.reply_to_msg_id = getServerMessageId(localDraft.reply_to_msg_id);\n }\n\n if(entities?.length) {\n params.entities = this.appMessagesManager.getInputEntities(entities);\n }\n\n if(localDraft.pFlags.no_webpage) {\n params.no_webpage = localDraft.pFlags.no_webpage;\n }\n\n params.message = message;\n }\n\n if(threadId) {\n params.top_msg_id = getServerMessageId(threadId);\n }\n\n const saveLocalDraft = draftObj || localDraft;\n saveLocalDraft.date = tsNow(true) + this.timeManager.getServerTimeOffset();\n\n this.saveDraft({\n peerId,\n threadId,\n draft: saveLocalDraft,\n notify: true,\n force\n });\n\n if(saveOnServer) {\n return this.apiManager.invokeApi('messages.saveDraft', params);\n }\n\n return true;\n }\n\n public clearAllDrafts() {\n return this.apiManager.invokeApi('messages.clearAllDrafts').then((bool) => {\n if(!bool) {\n return;\n }\n\n for(const combined in this.drafts) {\n const [peerId, threadId] = combined.split('_');\n this.rootScope.dispatchEvent('draft_updated', {\n peerId: peerId.toPeerId(),\n threadId: threadId ? +threadId : undefined,\n draft: undefined\n });\n }\n });\n }\n\n public clearDraft(peerId: PeerId, threadId: number) {\n const emptyDraft: DraftMessage.draftMessageEmpty = {\n _: 'draftMessageEmpty'\n };\n\n if(threadId) {\n this.syncDraft(peerId, threadId, emptyDraft as any, false, true);\n } else {\n this.saveDraft({\n peerId,\n threadId,\n draft: emptyDraft,\n notify: true,\n force: true\n });\n }\n }\n\n public setDraft(peerId: PeerId, threadId: number, message: string, entities?: MessageEntity[]) {\n const draft: DraftMessage.draftMessage = {\n _: 'draftMessage',\n date: tsNow(true),\n message,\n pFlags: {},\n entities\n };\n\n if(threadId) {\n this.syncDraft(peerId, threadId, draft, false, true);\n } else {\n this.saveDraft({\n peerId,\n threadId,\n draft,\n notify: true,\n force: true\n });\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from './appDocsManager';\nimport App from '../../config/app';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport isObject from '../../helpers/object/isObject';\nimport validateInitObject from '../../helpers/object/validateInitObject';\nimport fixEmoji from '../richTextProcessor/fixEmoji';\nimport SearchIndex from '../searchIndex';\nimport stateStorage from '../stateStorage';\nimport {AppManager} from './manager';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport pause from '../../helpers/schedulers/pause';\n\ntype EmojiLangPack = {\n keywords: {\n [keyword: string]: string[],\n },\n version: number,\n langCode: string\n};\n\nconst EMOJI_LANG_PACK: EmojiLangPack = {\n keywords: {},\n version: 0,\n langCode: App.langPackCode\n};\n\nconst RECENT_MAX_LENGTH = 32;\n\ntype EmojiType = 'native' | 'custom';\n\nexport class AppEmojiManager extends AppManager {\n private static POPULAR_EMOJI = ['😂', '😘', '❤️', '😍', '😊', '😁', '👍', '☺️', '😔', '😄', '😭', '💋', '😒', '😳', '😜', '🙈', '😉', '😃', '😢', '😝', '😱', '😡', '😏', '😞', '😅', '😚', '🙊', '😌', '😀', '😋', '😆', '👌', '😐', '😕'];\n private keywordLangPacks: {\n [langCode: string]: EmojiLangPack\n } = {};\n\n private index: SearchIndex;\n private indexedLangPacks: {[langCode: string]: boolean} = {};\n\n private getKeywordsPromises: {[langCode: string]: Promise} = {};\n\n private recent: {native?: string[], custom?: DocId[]} = {};\n private getRecentEmojisPromises: {native?: Promise, custom?: Promise} = {};\n\n private getCustomEmojiDocumentsPromise: Promise;\n private getCustomEmojiDocumentPromises: Map> = new Map();\n\n /* public getPopularEmoji() {\n return stateStorage.get('emojis_popular').then((popEmojis) => {\n var result = []\n if (popEmojis && popEmojis.length) {\n for (var i = 0, len = popEmojis.length; i < len; i++) {\n result.push({code: popEmojis[i][0], rate: popEmojis[i][1]})\n }\n callback(result)\n return\n }\n\n return stateStorage.get('emojis_recent').then((recentEmojis) => {\n recentEmojis = recentEmojis || popular || []\n var shortcut\n var code\n for (var i = 0, len = recentEmojis.length; i < len; i++) {\n shortcut = recentEmojis[i]\n if (Array.isArray(shortcut)) {\n shortcut = shortcut[0]\n }\n if (shortcut && typeof shortcut === 'string') {\n if (shortcut.charAt(0) == ':') {\n shortcut = shortcut.substr(1, shortcut.length - 2)\n }\n if (code = shortcuts[shortcut]) {\n result.push({code: code, rate: 1})\n }\n }\n }\n callback(result)\n });\n });\n }\n\n function pushPopularEmoji (code) {\n getPopularEmoji(function (popularEmoji) {\n var exists = false\n var count = popularEmoji.length\n var result = []\n for (var i = 0; i < count; i++) {\n if (popularEmoji[i].code == code) {\n exists = true\n popularEmoji[i].rate++\n }\n result.push([popularEmoji[i].code, popularEmoji[i].rate])\n }\n if (exists) {\n result.sort(function (a, b) {\n return b[1] - a[1]\n })\n } else {\n if (result.length > 41) {\n result = result.slice(0, 41)\n }\n result.push([code, 1])\n }\n ConfigStorage.set({emojis_popular: result})\n })\n } */\n\n public getEmojiKeywords(langCode: string = App.langPackCode) {\n const promise = this.getKeywordsPromises[langCode];\n if(promise) {\n return promise;\n }\n\n const storageKey: any = 'emojiKeywords_' + langCode;\n return this.getKeywordsPromises[langCode] = stateStorage.get(storageKey).then((pack: EmojiLangPack) => {\n if(!isObject(pack)) {\n pack = {} as any;\n }\n\n validateInitObject(EMOJI_LANG_PACK, pack);\n\n // important\n pack.langCode = langCode;\n this.keywordLangPacks[langCode] = pack;\n\n return this.apiManager.invokeApi('messages.getEmojiKeywordsDifference', {\n lang_code: pack.langCode,\n from_version: pack.version\n }).then((keywordsDifference) => {\n pack.version = keywordsDifference.version;\n\n const packKeywords = pack.keywords;\n const keywords = keywordsDifference.keywords;\n for(let i = 0, length = keywords.length; i < length; ++i) {\n const {keyword, emoticons} = keywords[i];\n packKeywords[keyword] = emoticons;\n }\n\n stateStorage.set({\n [storageKey]: pack\n });\n\n return pack;\n }, () => {\n return pack;\n });\n });\n }\n\n public getBothEmojiKeywords() {\n const promises: Promise[] = [\n this.getEmojiKeywords()\n ];\n\n if(this.networkerFactory.language !== App.langPackCode) {\n promises.push(this.getEmojiKeywords(this.networkerFactory.language));\n }\n\n if(!this.recent.native) {\n promises.push(this.getRecentEmojis('native'));\n }\n\n return Promise.all(promises);\n }\n\n private indexEmojis() {\n if(!this.index) {\n this.index = new SearchIndex(undefined, 2);\n }\n\n for(const langCode in this.keywordLangPacks) {\n if(this.indexedLangPacks[langCode]) {\n continue;\n }\n\n const pack = this.keywordLangPacks[langCode];\n const keywords = pack.keywords;\n\n for(const keyword in keywords) {\n const emoticons = keywords[keyword];\n this.index.indexObject(emoticons, keyword);\n }\n\n this.indexedLangPacks[langCode] = true;\n }\n }\n\n public searchEmojis(q: string) {\n this.indexEmojis();\n\n q = q.toLowerCase().replace(/_/g, ' ');\n\n // const perf = performance.now();\n let emojis: Array;\n if(q.trim()) {\n const set = this.index.search(q);\n emojis = Array.from(set).reduce((acc, v) => acc.concat(v), []);\n } else {\n emojis = this.recent.native.concat(AppEmojiManager.POPULAR_EMOJI).slice(0, RECENT_MAX_LENGTH);\n }\n\n emojis = Array.from(new Set(emojis));\n // console.log('searchEmojis', q, 'time', performance.now() - perf);\n\n /* for(let i = 0, length = emojis.length; i < length; ++i) {\n if(emojis[i].includes(zeroWidthJoiner) && !emojis[i].includes('\\ufe0f')) {\n emojis[i] += '\\ufe0f';\n }\n } */\n\n return emojis;\n }\n\n public getRecentEmojis(type: 'custom'): Promise;\n public getRecentEmojis(type: 'native'): Promise;\n public getRecentEmojis(type: T): Promise {\n const promises = this.getRecentEmojisPromises;\n return promises[type] ??= this.appStateManager.getState().then((state) => {\n let recent: string[] | DocId[] = [];\n if(type === 'native') {\n const {recentEmoji} = state;\n recent = Array.isArray(recentEmoji) && recentEmoji.length ? recentEmoji : AppEmojiManager.POPULAR_EMOJI;\n } else {\n const {recentCustomEmoji} = state;\n recent = Array.isArray(recentCustomEmoji) && recentCustomEmoji.length ? recentCustomEmoji : [];\n }\n\n return this.recent[type] = recent as any;\n }) as any;\n }\n\n public pushRecentEmoji(emoji: AppEmoji) {\n const type: EmojiType = emoji.docId ? 'custom' : 'native';\n emoji.emoji = fixEmoji(emoji.emoji);\n // @ts-ignore\n this.getRecentEmojis(type).then((recent) => {\n const i = emoji.docId || emoji.emoji;\n indexOfAndSplice(recent, i);\n recent.unshift(i);\n recent.splice(RECENT_MAX_LENGTH, recent.length - RECENT_MAX_LENGTH);\n\n this.appStateManager.pushToState(type === 'custom' ? 'recentCustomEmoji' : 'recentEmoji', recent);\n this.rootScope.dispatchEvent('emoji_recent', emoji);\n });\n }\n\n public getCustomEmojiDocuments(docIds: DocId[]) {\n if(!docIds.length) return Promise.resolve([] as MyDocument[]);\n return this.apiManager.invokeApi('messages.getCustomEmojiDocuments', {document_id: docIds}).then((documents) => {\n return documents.map((doc) => {\n return this.appDocsManager.saveDoc(doc, {\n type: 'customEmoji',\n docId: doc.id\n });\n });\n });\n }\n\n public getCachedCustomEmojiDocuments(docIds: DocId[]) {\n return docIds.map((docId) => this.appDocsManager.getDoc(docId));\n }\n\n private setDebouncedGetCustomEmojiDocuments() {\n if(this.getCustomEmojiDocumentsPromise || !this.getCustomEmojiDocumentPromises.size) {\n return;\n }\n\n this.getCustomEmojiDocumentsPromise = pause(0).then(() => {\n const allIds = [...this.getCustomEmojiDocumentPromises.keys()];\n const promises: Promise[] = [];\n do {\n const ids = allIds.splice(0, 100);\n const promise = this.getCustomEmojiDocuments(ids).then((docs) => {\n docs.forEach((doc, idx) => {\n const docId = ids[idx];\n const deferred = this.getCustomEmojiDocumentPromises.get(docId);\n this.getCustomEmojiDocumentPromises.delete(docId);\n deferred.resolve(doc);\n });\n });\n\n promises.push(promise);\n } while(allIds.length);\n\n return Promise.all(promises);\n }).finally(() => {\n this.getCustomEmojiDocumentsPromise = undefined;\n this.setDebouncedGetCustomEmojiDocuments();\n });\n }\n\n public getCustomEmojiDocument(id: DocId) {\n let promise = this.getCustomEmojiDocumentPromises.get(id);\n if(promise) {\n return promise;\n }\n\n const doc = this.appDocsManager.getDoc(id);\n if(doc) {\n return doc;\n }\n\n promise = deferredPromise();\n this.getCustomEmojiDocumentPromises.set(id, promise);\n\n this.setDebouncedGetCustomEmojiDocuments();\n\n return promise;\n }\n\n public getCustomEmojis() {\n return this.appStickersManager.getEmojiStickers();\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/evgeny-nadymov/telegram-react\n * Copyright (C) 2018 Evgeny Nadymov\n * https://github.com/evgeny-nadymov/telegram-react/blob/master/LICENSE\n */\n\nimport type GroupCallConnectionInstance from '../calls/groupCallConnectionInstance';\nimport safeReplaceObject from '../../helpers/object/safeReplaceObject';\nimport {nextRandomUint} from '../../helpers/random';\nimport {DataJSON, GroupCall, GroupCallParticipant, GroupCallParticipantVideoSourceGroup, InputGroupCall, PhoneJoinGroupCall, PhoneJoinGroupCallPresentation, Update, Updates} from '../../layer';\nimport {logger} from '../logger';\nimport {NULL_PEER_ID} from '../mtproto/mtproto_config';\nimport {AppManager} from './manager';\nimport getPeerId from './utils/peers/getPeerId';\n\nexport type GroupCallId = GroupCall['id'];\nexport type MyGroupCall = GroupCall | InputGroupCall;\n\nexport type GroupCallConnectionType = 'main' | 'presentation';\n\nexport type JoinGroupCallJsonPayload = {\n fingerprints: {\n fingerprint: string;\n setup: string;\n hash: string;\n }[];\n pwd: string;\n ssrc: number;\n 'ssrc-groups': GroupCallParticipantVideoSourceGroup.groupCallParticipantVideoSourceGroup[];\n ufrag: string;\n};\n\nconst GET_PARTICIPANTS_LIMIT = 100;\n\nexport type GroupCallOutputSource = 'main' | 'presentation' | number;\n\nexport class AppGroupCallsManager extends AppManager {\n private log: ReturnType;\n\n private groupCalls: Map;\n private participants: Map>;\n private nextOffsets: Map;\n\n // private doNotDispatchParticipantUpdate: PeerId;\n\n protected after() {\n this.log = logger('GROUP-CALLS');\n\n this.groupCalls = new Map();\n this.participants = new Map();\n this.nextOffsets = new Map();\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateGroupCall: (update) => {\n this.saveGroupCall(update.call, update.chat_id);\n },\n\n updateGroupCallParticipants: (update) => {\n this.saveGroupCall(update.call);\n\n // this.getGroupCallFull(update.call.id, true); // ! WARNING TEMP\n\n const groupCallId = update.call.id;\n this.saveApiParticipants(groupCallId, update.participants);\n }\n });\n\n this.rootScope.addEventListener('group_call_update', (groupCall) => {\n if(groupCall._ === 'groupCallDiscarded') {\n this.participants.delete(groupCall.id);\n }\n });\n }\n\n public getCachedParticipants(groupCallId: GroupCallId) {\n let participants = this.participants.get(groupCallId);\n if(!participants) {\n this.participants.set(groupCallId, participants = new Map());\n }\n\n return participants;\n }\n\n private prepareToSavingNextOffset(groupCallId: GroupCallId) {\n const nextOffsetsMap = this.nextOffsets;\n\n const setNextOffset = (newNextOffset: string) => {\n if(nextOffsetsMap.get(groupCallId) === nextOffset) {\n nextOffsetsMap.set(groupCallId, newNextOffset);\n }\n };\n\n const nextOffset = nextOffsetsMap.get(groupCallId);\n return {\n nextOffset,\n setNextOffset\n };\n }\n\n public saveApiParticipant(groupCallId: GroupCallId, participant: GroupCallParticipant, skipCounterUpdating?: boolean) {\n const participants = this.getCachedParticipants(groupCallId);\n\n const peerId = getPeerId(participant.peer);\n\n const oldParticipant = participants.get(peerId);\n const hasLeft = participant.pFlags.left;\n if(!oldParticipant && hasLeft) {\n return;\n }\n\n // * fix missing flag\n if(!participant.pFlags.muted && !participant.pFlags.can_self_unmute) {\n participant.pFlags.can_self_unmute = true;\n }\n\n if(oldParticipant) {\n safeReplaceObject(oldParticipant, participant);\n participant = oldParticipant;\n } else {\n participants.set(peerId, participant);\n }\n\n // if(!skipCounterUpdating) {\n const groupCall = this.getGroupCall(groupCallId);\n if(groupCall?._ === 'groupCall') {\n let modified = false;\n if(hasLeft) {\n --groupCall.participants_count;\n modified = true;\n } else if(participant.pFlags.just_joined && !oldParticipant && !participant.pFlags.self) {\n ++groupCall.participants_count;\n modified = true;\n }\n\n if(modified) {\n this.rootScope.dispatchEvent('group_call_update', groupCall);\n }\n }\n // }\n\n if(hasLeft) {\n participants.delete(peerId);\n }\n\n if(oldParticipant || true/* && this.doNotDispatchParticipantUpdate !== peerId */) {\n this.rootScope.dispatchEvent('group_call_participant', {\n groupCallId,\n participant\n });\n }\n }\n\n public saveApiParticipants(groupCallId: GroupCallId, apiParticipants: GroupCallParticipant[], skipCounterUpdating?: boolean) {\n if((apiParticipants as any).saved) return;\n (apiParticipants as any).saved = true;\n apiParticipants.forEach((p) => this.saveApiParticipant(groupCallId, p, skipCounterUpdating));\n }\n\n public async editParticipant(groupCallId: GroupCallId, participant: GroupCallParticipant, options: Partial<{\n muted: boolean,\n volume: number,\n raiseHand: boolean,\n videoStopped: boolean,\n videoPaused: boolean,\n presentationPaused: boolean\n }>) {\n this.saveApiParticipant(groupCallId, participant);\n\n const peerId = participant.pFlags.self ? NULL_PEER_ID : getPeerId(participant.peer);\n const updates = await this.apiManager.invokeApiSingle('phone.editGroupCallParticipant', {\n call: this.getGroupCallInput(groupCallId),\n participant: peerId === NULL_PEER_ID ? this.appPeersManager.getInputPeerSelf() : this.appPeersManager.getInputPeerById(peerId),\n muted: options.muted,\n volume: options.volume,\n raise_hand: options.raiseHand,\n video_paused: options.videoPaused,\n video_stopped: options.videoStopped,\n presentation_paused: options.presentationPaused\n });\n\n // do not replace with peerId because it can be null\n // if(!processUpdate) this.doNotDispatchParticipantUpdate = getPeerId(participant.peer);\n this.apiUpdatesManager.processUpdateMessage(updates);\n // if(!processUpdate) this.doNotDispatchParticipantUpdate = undefined;\n }\n\n public getGroupCall(id: GroupCallId) {\n return this.groupCalls.get(id);\n }\n\n public async getGroupCallFull(id: GroupCallId, override?: boolean): Promise {\n const call = this.getGroupCall(id);\n if(call && call._ !== 'inputGroupCall' && !override) {\n return call;\n }\n\n const limit = this.getCachedParticipants(id).size ? 0 : GET_PARTICIPANTS_LIMIT;\n return this.apiManager.invokeApiSingleProcess({\n method: 'phone.getGroupCall',\n params: {\n call: this.getGroupCallInput(id),\n limit\n },\n processResult: (groupCall) => {\n // ? maybe I should save group call after participants so I can avoid passing the 'skipCounterUpdating' flag ?\n this.appUsersManager.saveApiUsers(groupCall.users);\n this.appChatsManager.saveApiChats(groupCall.chats);\n this.saveApiParticipants(id, groupCall.participants, true);\n const call = this.saveGroupCall(groupCall.call) as GroupCall;\n\n if(limit && this.nextOffsets.get(id) === undefined) {\n this.nextOffsets.set(id, groupCall.participants_next_offset);\n }\n\n return call;\n }\n });\n }\n\n public saveGroupCall(call: MyGroupCall, chatId?: ChatId) {\n const oldCall = this.groupCalls.get(call.id);\n const shouldUpdate = call._ !== 'inputGroupCall' && (!oldCall || oldCall._ !== 'groupCallDiscarded');\n if(oldCall) {\n if(shouldUpdate) {\n safeReplaceObject(oldCall, call);\n }\n\n call = oldCall;\n } else {\n this.groupCalls.set(call.id, call);\n }\n\n if(shouldUpdate) {\n this.rootScope.dispatchEvent('group_call_update', call as any);\n }\n\n return call;\n }\n\n public async createGroupCall(chatId: ChatId, scheduleDate?: number, title?: string) {\n const updates = await this.apiManager.invokeApi('phone.createGroupCall', {\n peer: this.appPeersManager.getInputPeerById(chatId.toPeerId(true)),\n random_id: nextRandomUint(32),\n schedule_date: scheduleDate,\n title\n });\n\n this.apiUpdatesManager.processUpdateMessage(updates);\n\n const update = (updates as Updates.updates).updates.find((update) => update._ === 'updateGroupCall') as Update.updateGroupCall;\n return update.call;\n }\n\n public getGroupCallInput(id: GroupCallId): InputGroupCall {\n const groupCall = this.getGroupCall(id);\n return {\n _: 'inputGroupCall',\n id: groupCall.id,\n access_hash: groupCall.access_hash\n };\n }\n\n // public generateSelfParticipant(): GroupCallParticipant {\n // const mainSources = this.currentGroupCall.connections.main.sources;\n // const presentationSources = this.currentGroupCall.connections.presentation?.sources;\n // return {\n // _: 'groupCallParticipant',\n // pFlags: {\n // can_self_unmute: true,\n // self: true\n // },\n // source: mainSources.audio.source,\n // video: this.generateSelfVideo(mainSources.video),\n // presentation: presentationSources && this.generateSelfVideo(presentationSources.video, presentationSources.audio?.source),\n // date: tsNow(true),\n // peer: this.appPeersManager.getOutputPeer(rootScope.myId)\n // };\n // }\n\n public async getGroupCallParticipants(id: GroupCallId) {\n const {nextOffset, setNextOffset} = this.prepareToSavingNextOffset(id);\n\n if(nextOffset !== '') {\n await this.apiManager.invokeApiSingleProcess({\n method: 'phone.getGroupParticipants',\n params: {\n call: this.getGroupCallInput(id),\n ids: [],\n sources: [],\n offset: nextOffset || '',\n limit: GET_PARTICIPANTS_LIMIT\n },\n processResult: (groupCallParticipants) => {\n const newNextOffset = groupCallParticipants.count === groupCallParticipants.participants.length ? '' : groupCallParticipants.next_offset;\n\n this.appChatsManager.saveApiChats(groupCallParticipants.chats);\n this.appUsersManager.saveApiUsers(groupCallParticipants.users);\n this.saveApiParticipants(id, groupCallParticipants.participants);\n\n setNextOffset(newNextOffset);\n }\n });\n }\n\n return {\n participants: this.getCachedParticipants(id),\n isEnd: this.nextOffsets.get(id) === ''\n };\n }\n\n public hangUp(id: GroupCallId, discard?: boolean | number) {\n const groupCallInput = this.getGroupCallInput(id);\n let promise: Promise;\n if(typeof(discard) === 'boolean' && discard) {\n promise = this.apiManager.invokeApi('phone.discardGroupCall', {\n call: groupCallInput\n });\n } else if(typeof(discard) === 'number') {\n promise = this.apiManager.invokeApi('phone.leaveGroupCall', {\n call: groupCallInput,\n source: discard\n });\n } else {\n promise = this.apiManager.invokeApi('phone.joinGroupCall', {\n call: groupCallInput,\n join_as: this.appPeersManager.getInputPeerSelf(),\n muted: true,\n video_stopped: true,\n params: {\n _: 'dataJSON',\n data: ''\n }\n });\n }\n\n return promise.then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n });\n }\n\n public async joinGroupCall(groupCallId: GroupCallId, params: DataJSON, options: GroupCallConnectionInstance['options']) {\n const groupCallInput = this.getGroupCallInput(groupCallId);\n let promise: Promise;\n if(options.type === 'main') {\n const request: PhoneJoinGroupCall = {\n call: groupCallInput,\n join_as: this.appPeersManager.getInputPeerSelf(),\n params,\n muted: options.isMuted,\n video_stopped: !options.joinVideo\n };\n\n promise = this.apiManager.invokeApi('phone.joinGroupCall', request);\n this.log(`[api] joinGroupCall id=${groupCallId}`, request);\n } else {\n const request: PhoneJoinGroupCallPresentation = {\n call: groupCallInput,\n params\n };\n\n promise = this.apiManager.invokeApi('phone.joinGroupCallPresentation', request);\n this.log(`[api] joinGroupCallPresentation id=${groupCallId}`, request);\n }\n\n const updates = await promise;\n this.apiUpdatesManager.processUpdateMessage(updates);\n\n const update = (updates as Updates.updates).updates.find((update) => update._ === 'updateGroupCallConnection') as Update.updateGroupCallConnection;\n return update;\n }\n\n public leaveGroupCallPresentation(groupCallId: GroupCallId) {\n return this.apiManager.invokeApi('phone.leaveGroupCallPresentation', {\n call: this.getGroupCallInput(groupCallId)\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {InputPhoto} from '../../../../layer';\nimport {MyPhoto} from '../../appPhotosManager';\n\nexport default function getPhotoInput(photo: MyPhoto): InputPhoto.inputPhoto {\n return {\n _: 'inputPhoto',\n id: photo.id,\n access_hash: photo.access_hash,\n file_reference: photo.file_reference\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {InputMedia} from '../../../../layer';\nimport {MyPhoto} from '../../appPhotosManager';\nimport getPhotoInput from './getPhotoInput';\n\nexport default function getPhotoMediaInput(photo: MyPhoto): InputMedia.inputMediaPhoto {\n return {\n _: 'inputMediaPhoto',\n id: getPhotoInput(photo),\n ttl_seconds: 0,\n pFlags: {}\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Document, InputMedia} from '../../../../layer';\n\nexport default function getMediaInput(doc: Document.document): InputMedia.inputMediaDocument {\n return {\n _: 'inputMediaDocument',\n id: {\n _: 'inputDocument',\n id: doc.id,\n access_hash: doc.access_hash,\n file_reference: doc.file_reference\n },\n ttl_seconds: 0,\n pFlags: {}\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {MyDocument} from './appDocsManager';\nimport type {MyPhoto} from './appPhotosManager';\nimport type {MyTopPeer} from './appUsersManager';\nimport type {AppMessagesManager, MessageSendingParams} from './appMessagesManager';\nimport {BotInlineResult, GeoPoint, InputGeoPoint, InputMedia, MessageEntity, MessageMedia, MessagesBotResults, ReplyMarkup} from '../../layer';\nimport insertInDescendSortedArray from '../../helpers/array/insertInDescendSortedArray';\nimport {AppManager} from './manager';\nimport getPhotoMediaInput from './utils/photos/getPhotoMediaInput';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\nimport generateQId from './utils/inlineBots/generateQId';\nimport getDocumentMediaInput from './utils/docs/getDocumentMediaInput';\n\nexport class AppInlineBotsManager extends AppManager {\n private inlineResults: {[queryAndResultIds: string]: BotInlineResult} = {};\n private setHash: {\n [botId: UserId]: {\n peerId: PeerId,\n time: number\n }\n } = {};\n\n public getGeoInput(geo: GeoPoint): InputGeoPoint {\n return geo._ === 'geoPoint' ? {\n _: 'inputGeoPoint',\n lat: geo.lat,\n long: geo.long,\n accuracy_radius: geo.accuracy_radius\n } : {\n _: 'inputGeoPointEmpty'\n };\n }\n\n public getInlineResults(peerId: PeerId, botId: BotId, query = '', offset = '', geo?: GeoPoint) {\n return this.apiManager.invokeApi('messages.getInlineBotResults', {\n bot: this.appUsersManager.getUserInput(botId),\n peer: this.appPeersManager.getInputPeerById(peerId),\n query,\n geo_point: geo ? this.getGeoInput(geo) : undefined,\n offset\n }, {/* timeout: 1, */stopTime: -1, noErrorBox: true}).then((botResults) => {\n const queryId = botResults.query_id;\n\n /* if(botResults.switch_pm) {\n botResults.switch_pm.rText = wrapRichText(botResults.switch_pm.text, {noLinebreaks: true, noLinks: true});\n } */\n\n botResults.results.forEach((result) => {\n if(result._ === 'botInlineMediaResult') {\n if(result.document) {\n result.document = this.appDocsManager.saveDoc(result.document);\n }\n\n if(result.photo) {\n result.photo = this.appPhotosManager.savePhoto(result.photo);\n }\n }\n\n this.inlineResults[generateQId(queryId, result.id)] = result;\n });\n\n return botResults;\n });\n }\n\n private pushPopularBot(botId: BotId) {\n this.appUsersManager.getTopPeers('bots_inline').then((topPeers) => {\n const botPeerId = botId.toPeerId();\n const index = topPeers.findIndex((topPeer) => topPeer.id === botPeerId);\n let topPeer: MyTopPeer;\n if(index !== -1) {\n topPeer = topPeers[index];\n } else {\n topPeer = {\n id: botPeerId,\n rating: 0\n };\n }\n\n ++topPeer.rating;\n insertInDescendSortedArray(topPeers, topPeer, 'rating');\n\n this.appStateManager.setKeyValueToStorage('topPeersCache');\n\n // rootScope.$broadcast('inline_bots_popular')\n });\n }\n\n public switchToPM(fromPeerId: PeerId, botId: BotId, startParam: string) {\n this.setHash[botId] = {peerId: fromPeerId, time: Date.now()};\n return this.appMessagesManager.startBot(botId, undefined, startParam);\n }\n\n /*\n function resolveInlineMention (username) {\n return AppPeersManager.resolveUsername(username).then(function (peerId) {\n if (peerId.isUser()) {\n var bot = AppUsersManager.getUser(peerId)\n if (bot.pFlags.bot && bot.bot_inline_placeholder !== undefined) {\n var resolvedBot = {\n username: username,\n id: peerId,\n placeholder: bot.bot_inline_placeholder\n }\n if (bot.pFlags.bot_inline_geo &&\n GeoLocationManager.isAvailable()) {\n return checkGeoLocationAccess(peerId).then(function () {\n return GeoLocationManager.getPosition().then(function (coords) {\n resolvedBot.geo = coords\n return qSync.when(resolvedBot)\n })\n })['catch'](function () {\n return qSync.when(resolvedBot)\n })\n }\n return qSync.when(resolvedBot)\n }\n }\n return $q.reject()\n }, function (error) {\n error.handled = true\n return $q.reject(error)\n })\n }\n\n function regroupWrappedResults (results, rowW, rowH) {\n if (!results ||\n !results[0] ||\n ['photo', 'gif', 'sticker'].indexOf(results[0].type) === -1) {\n return\n }\n var ratios = []\n angular.forEach(results, function (result) {\n var w\n var h, doc\n var photo\n if (result._ === 'botInlineMediaResult') {\n if (doc = result.document) {\n w = result.document.w\n h = result.document.h\n }\n else if (photo = result.photo) {\n var photoSize = (photo.sizes || [])[0]\n w = photoSize && photoSize.w\n h = photoSize && photoSize.h\n }\n }else {\n w = result.w\n h = result.h\n }\n if (!w || !h) {\n w = h = 1\n }\n ratios.push(w / h)\n })\n\n var rows = []\n var curCnt = 0\n var curW = 0\n angular.forEach(ratios, function (ratio) {\n var w = ratio * rowH\n curW += w\n if (!curCnt || curCnt < 4 && curW < (rowW * 1.1)) {\n curCnt++\n } else {\n rows.push(curCnt)\n curCnt = 1\n curW = w\n }\n })\n if (curCnt) {\n rows.push(curCnt)\n }\n\n var i = 0\n var thumbs = []\n var lastRowI = rows.length - 1\n angular.forEach(rows, function (rowCnt, rowI) {\n var lastRow = rowI === lastRowI\n var curRatios = ratios.slice(i, i + rowCnt)\n var sumRatios = 0\n angular.forEach(curRatios, function (ratio) {\n sumRatios += ratio\n })\n angular.forEach(curRatios, function (ratio, j) {\n var thumbH = rowH\n var thumbW = rowW * ratio / sumRatios\n var realW = thumbH * ratio\n if (lastRow && thumbW > realW) {\n thumbW = realW\n }\n var result = results[i + j]\n result.thumbW = Math.floor(thumbW) - 2\n result.thumbH = Math.floor(thumbH) - 2\n })\n\n i += rowCnt\n })\n } */\n\n public async checkSwitchReturn(botId: BotId) {\n const bot = this.appUsersManager.getUser(botId);\n if(!bot || !bot.pFlags.bot || !bot.bot_inline_placeholder) {\n return;\n }\n\n const peerData = this.setHash[botId];\n if(peerData) {\n delete this.setHash[botId];\n if((Date.now() - peerData.time) < 3600e3) {\n return peerData.peerId;\n }\n }\n }\n\n public switchInlineQuery(peerId: PeerId, threadId: number, botId: BotId, query: string) {\n this.appDraftsManager.setDraft(peerId, threadId, '@' + this.appPeersManager.getPeerUsername(botId.toPeerId()) + ' ' + query);\n }\n\n public callbackButtonClick(peerId: PeerId, mid: number, button: any) {\n return this.apiManager.invokeApi('messages.getBotCallbackAnswer', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n msg_id: getServerMessageId(mid),\n data: button.data\n }, {/* timeout: 1, */stopTime: -1, noErrorBox: true});\n }\n\n /* function gameButtonClick (id) {\n var message = AppMessagesManager.getMessage(id)\n var peerId = AppMessagesManager.getMessagePeer(message)\n\n return MtpApiManager.invokeApi('messages.getBotCallbackAnswer', {\n peer: AppPeersManager.getInputPeerByID(peerId),\n msg_id: AppMessagesIDsManager.getMessageLocalID(id)\n }, {timeout: 1, stopTime: -1, noErrorBox: true}).then(function (callbackAnswer) {\n if (typeof callbackAnswer.message === 'string' &&\n callbackAnswer.message.length) {\n showCallbackMessage(callbackAnswer.message, callbackAnswer.pFlags.alert)\n }\n else if (typeof callbackAnswer.url === 'string') {\n AppGamesManager.openGame(message.media.game.id, id, callbackAnswer.url)\n }\n })\n } */\n\n public sendInlineResult(peerId: PeerId, botId: BotId, queryAndResultIds: string, options: MessageSendingParams & Partial<{\n viaBotId: BotId,\n queryId: string,\n resultId: string,\n replyMarkup: ReplyMarkup,\n entities: MessageEntity[],\n clearDraft: true,\n geoPoint: GeoPoint\n }> = {}) {\n const inlineResult = this.inlineResults[queryAndResultIds];\n if(!inlineResult) {\n return;\n }\n\n this.pushPopularBot(botId);\n const splitted = queryAndResultIds.split('_');\n const queryID = splitted.shift();\n const resultID = splitted.join('_');\n options.viaBotId = botId;\n options.queryId = queryID;\n options.resultId = resultID;\n if(inlineResult.send_message.reply_markup) {\n options.replyMarkup = inlineResult.send_message.reply_markup;\n }\n\n if(inlineResult.send_message._ === 'botInlineMessageText') {\n options.entities = inlineResult.send_message.entities;\n this.appMessagesManager.sendText(peerId, inlineResult.send_message.message, options);\n } else {\n let caption = '';\n let inputMedia: Parameters[1], messageMedia: MessageMedia;\n const sendMessage = inlineResult.send_message;\n switch(sendMessage._) {\n case 'botInlineMessageMediaAuto': {\n caption = sendMessage.message;\n\n if(inlineResult._ === 'botInlineMediaResult') {\n const {document, photo} = inlineResult;\n if(document) {\n inputMedia = getDocumentMediaInput(document as MyDocument);\n } else {\n inputMedia = getPhotoMediaInput(photo as MyPhoto);\n }\n }\n\n break;\n }\n\n case 'botInlineMessageMediaGeo': {\n inputMedia = {\n _: 'inputMediaGeoPoint',\n geo_point: this.getGeoInput(sendMessage.geo)\n };\n\n options.geoPoint = sendMessage.geo;\n\n break;\n }\n\n case 'botInlineMessageMediaVenue': {\n inputMedia = {\n _: 'inputMediaVenue',\n geo_point: this.getGeoInput(sendMessage.geo),\n title: sendMessage.title,\n address: sendMessage.address,\n provider: sendMessage.provider,\n venue_id: sendMessage.venue_id,\n venue_type: sendMessage.venue_type\n };\n\n options.geoPoint = sendMessage.geo;\n\n break;\n }\n\n case 'botInlineMessageMediaContact': {\n inputMedia = {\n _: 'inputMediaContact',\n phone_number: sendMessage.phone_number,\n first_name: sendMessage.first_name,\n last_name: sendMessage.last_name,\n vcard: sendMessage.vcard\n };\n\n break;\n }\n\n case 'botInlineMessageMediaInvoice': {\n // const photo = sendMessage.photo;\n // inputMedia = {\n // _: 'inputMediaInvoice',\n // description: sendMessage.description,\n // title: sendMessage.title,\n // photo: photo && {\n // _: 'inputWebDocument',\n // attributes: photo.attributes,\n // mime_type: photo.mime_type,\n // size: photo.size,\n // url: photo.url\n // },\n // invoice: undefined,\n // payload: undefined,\n // provider: undefined,\n // provider_data: undefined,\n // start_param: undefined\n // };\n\n messageMedia = {\n _: 'messageMediaInvoice',\n title: sendMessage.title,\n description: sendMessage.description,\n photo: sendMessage.photo,\n currency: sendMessage.currency,\n total_amount: sendMessage.total_amount,\n pFlags: {\n shipping_address_requested: sendMessage.pFlags.shipping_address_requested,\n test: sendMessage.pFlags.test\n },\n start_param: undefined\n };\n\n break;\n }\n }\n\n if(!inputMedia && messageMedia) {\n inputMedia = {\n _: 'messageMediaPending',\n messageMedia\n };\n }\n\n this.appMessagesManager.sendOther(peerId, inputMedia, options);\n }\n }\n\n /* function checkGeoLocationAccess (botID) {\n var key = 'bot_access_geo' + botID\n return Storage.get(key).then(function (geoAccess) {\n if (geoAccess && geoAccess.granted) {\n return true\n }\n return ErrorService.confirm({\n type: 'BOT_ACCESS_GEO_INLINE'\n }).then(function () {\n var setHash = {}\n setHash[key] = {granted: true, time: tsNow()}\n Storage.set(setHash)\n return true\n }, function () {\n var setHash = {}\n setHash[key] = {denied: true, time: tsNow()}\n Storage.set(setHash)\n return $q.reject()\n })\n })\n } */\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {MESSAGE_ID_INCREMENT} from './utils/messageId';\nimport generateMessageId from './utils/messageId/generateMessageId';\n\nexport class AppMessagesIdsManager {\n private tempNum = 0;\n\n public generateTempMessageId(messageId: number) {\n const num = ++this.tempNum;\n return generateMessageId(messageId) + (num & (MESSAGE_ID_INCREMENT - 1));\n }\n}\n","export default function splitStringByLength(str: string, maxLength: number) {\n if(str.length < maxLength) return [str];\n let length = 0, lastSliceStartIndex = 0, arrayIndex = 0;\n const delimiter = ' ';// '\\n';\n const out: string[] = [];\n\n const cut = (end?: number) => {\n let part = str.slice(lastSliceStartIndex, end);\n const _arrayIndex = arrayIndex++;\n if(part.length > maxLength) {\n const overflowPart = part.slice(maxLength);\n const splitted = splitStringByLength(overflowPart, maxLength);\n splitted.forEach((part) => {\n out[arrayIndex++] = part;\n });\n\n part = part.slice(0, maxLength);\n }\n\n lastSliceStartIndex = end;\n length = 0;\n out[_arrayIndex] = (out[_arrayIndex] || '') + part;\n };\n\n let lastIndex = 0;\n do {\n let index = str.indexOf(delimiter, lastIndex);\n if(index === -1) {\n if(lastIndex !== (str.length - 1)) {\n cut();\n }\n\n break;\n }\n\n index += delimiter.length;\n\n const partLength = index - lastIndex;\n if((length + partLength) > maxLength) {\n cut(length);\n }\n\n lastIndex = index;\n length += partLength;\n } while(true);\n\n return out;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {TabState} from '../mtproto/mtprotoworker';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport MTProtoMessagePort from '../mtproto/mtprotoMessagePort';\n\ntype Tab = {\n source: MessageEventSource,\n state: TabState\n};\n\nexport class AppTabsManager {\n private tabs: Map;\n\n constructor() {\n this.tabs = new Map();\n }\n\n public start() {\n const port = MTProtoMessagePort.getInstance();\n\n port.addEventListener('tabState', (state, source) => {\n const tab = this.tabs.get(source);\n tab.state = state;\n });\n }\n\n public getTabs() {\n return [...this.tabs.values()].filter((tab) => !!tab.state);\n }\n\n public addTab(source: MessageEventSource) {\n const tab: Tab = {\n source,\n state: undefined\n };\n\n this.tabs.set(source, tab);\n }\n\n public deleteTab(source: MessageEventSource) {\n this.tabs.delete(source);\n }\n}\n\nconst appTabsManager = new AppTabsManager();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.appTabsManager = appTabsManager);\nexport default appTabsManager;\n","import {InputDocument} from '../../../../layer';\nimport type {MyDocument} from '../../appDocsManager';\n\nexport default function getDocumentInput(doc: MyDocument): InputDocument {\n return {\n _: 'inputDocument',\n id: doc.id,\n access_hash: doc.access_hash,\n file_reference: doc.file_reference\n };\n}\n","export default function setBooleanFlag(obj: T, key: keyof T, value: boolean) {\n // @ts-ignore\n if(value) obj[key] = true;\n else delete obj[key];\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {ApiFileManager} from '../mtproto/apiFileManager';\nimport type {MediaSize} from '../../helpers/mediaSize';\nimport type {Progress} from './appDownloadManager';\nimport type {VIDEO_MIME_TYPE} from '../../environment/videoMimeTypesSupport';\nimport LazyLoadQueueBase from '../../components/lazyLoadQueueBase';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport tsNow from '../../helpers/tsNow';\nimport {randomLong} from '../../helpers/random';\nimport {Chat, ChatFull, Dialog as MTDialog, DialogPeer, DocumentAttribute, InputMedia, InputMessage, InputPeerNotifySettings, InputSingleMedia, Message, MessageAction, MessageEntity, MessageFwdHeader, MessageMedia, MessageReplies, MessageReplyHeader, MessagesDialogs, MessagesFilter, MessagesMessages, MethodDeclMap, NotifyPeer, PeerNotifySettings, PhotoSize, SendMessageAction, Update, Photo, Updates, ReplyMarkup, InputPeer, InputPhoto, InputDocument, InputGeoPoint, WebPage, GeoPoint, ReportReason, MessagesGetDialogs, InputChannel, InputDialogPeer, ReactionCount, MessagePeerReaction, MessagesSearchCounter, Peer, MessageReactions, Document, InputFile, Reaction, ForumTopic as MTForumTopic, MessagesForumTopics, MessagesGetReplies, MessagesGetHistory, MessagesAffectedHistory, UrlAuthResult, MessagesTranscribedAudio} from '../../layer';\nimport {ArgumentTypes, InvokeApiOptions} from '../../types';\nimport {logger, LogTypes} from '../logger';\nimport {ReferenceContext} from '../mtproto/referenceDatabase';\nimport DialogsStorage, {GLOBAL_FOLDER_ID} from '../storages/dialogs';\nimport {ChatRights} from './appChatsManager';\nimport {MyDocument} from './appDocsManager';\nimport {MyPhoto} from './appPhotosManager';\nimport {getFileNameByLocation} from '../../helpers/fileName';\nimport DEBUG from '../../config/debug';\nimport SlicedArray, {Slice, SliceEnd} from '../../helpers/slicedArray';\nimport {FOLDER_ID_ALL, GENERAL_TOPIC_ID, MUTE_UNTIL, NULL_PEER_ID, REAL_FOLDER_ID, REPLIES_HIDDEN_CHANNEL_ID, REPLIES_PEER_ID, SERVICE_PEER_ID, THUMB_TYPE_FULL} from '../mtproto/mtproto_config';\n// import telegramMeWebManager from '../mtproto/telegramMeWebManager';\nimport {getMiddleware} from '../../helpers/middleware';\nimport assumeType from '../../helpers/assumeType';\nimport copy from '../../helpers/object/copy';\nimport getObjectKeysAndSort from '../../helpers/object/getObjectKeysAndSort';\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport deepEqual from '../../helpers/object/deepEqual';\nimport splitStringByLength from '../../helpers/string/splitStringByLength';\nimport debounce from '../../helpers/schedulers/debounce';\nimport {AppManager} from './manager';\nimport getPhotoMediaInput from './utils/photos/getPhotoMediaInput';\nimport getPhotoDownloadOptions from './utils/photos/getPhotoDownloadOptions';\nimport fixEmoji from '../richTextProcessor/fixEmoji';\nimport mergeEntities from '../richTextProcessor/mergeEntities';\nimport parseEntities from '../richTextProcessor/parseEntities';\nimport parseMarkdown from '../richTextProcessor/parseMarkdown';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\nimport generateMessageId from './utils/messageId/generateMessageId';\nimport filterMessagesByInputFilter from './utils/messages/filterMessagesByInputFilter';\nimport ctx from '../../environment/ctx';\nimport {getEnvironment} from '../../environment/utils';\nimport getDialogIndex from './utils/dialogs/getDialogIndex';\nimport defineNotNumerableProperties from '../../helpers/object/defineNotNumerableProperties';\nimport getDocumentMediaInput from './utils/docs/getDocumentMediaInput';\nimport getDocumentInputFileName from './utils/docs/getDocumentInputFileName';\nimport getFileNameForUpload from '../../helpers/getFileNameForUpload';\nimport noop from '../../helpers/noop';\nimport appTabsManager from './appTabsManager';\nimport MTProtoMessagePort from '../mtproto/mtprotoMessagePort';\nimport getAlbumText from './utils/messages/getAlbumText';\nimport pause from '../../helpers/schedulers/pause';\nimport makeError from '../../helpers/makeError';\nimport getStickerEffectThumb from './utils/stickers/getStickerEffectThumb';\nimport getDocumentInput from './utils/docs/getDocumentInput';\nimport reactionsEqual from './utils/reactions/reactionsEqual';\nimport getPeerActiveUsernames from './utils/peers/getPeerActiveUsernames';\nimport {BroadcastEvents} from '../rootScope';\nimport setBooleanFlag from '../../helpers/object/setBooleanFlag';\nimport getMessageThreadId from './utils/messages/getMessageThreadId';\n\n// console.trace('include');\n// TODO: если удалить диалог находясь в папке, то он не удалится из папки и будет виден в настройках\n\nconst APITIMEOUT = 0;\nconst DO_NOT_READ_HISTORY = false;\n\nexport type SendFileDetails = {\n file: File | Blob | MyDocument,\n} & Partial<{\n duration: number,\n width: number,\n height: number,\n objectURL: string,\n thumb: {\n blob: Blob,\n url: string,\n size: MediaSize\n },\n strippedBytes: PhotoSize.photoStrippedSize['bytes'],\n spoiler: boolean\n}>;\n\nexport type HistoryStorage = {\n count: number | null,\n history: SlicedArray,\n\n maxId?: number,\n readPromise?: Promise,\n readMaxId?: number,\n readOutboxMaxId?: number,\n triedToReadMaxId?: number,\n\n maxOutId?: number,\n replyMarkup?: Exclude\n};\n\nexport type HistoryResult = {\n count: number,\n history: number[],\n isEnd: ReturnType['getEnds']>,\n offsetIdOffset?: number,\n};\n\nexport type Dialog = MTDialog.dialog;\nexport type ForumTopic = MTForumTopic.forumTopic;\n\nexport type MyMessage = Message.message | Message.messageService;\nexport type MyInputMessagesFilter = 'inputMessagesFilterEmpty'\n | 'inputMessagesFilterPhotos'\n | 'inputMessagesFilterPhotoVideo'\n | 'inputMessagesFilterVideo'\n | 'inputMessagesFilterDocument'\n | 'inputMessagesFilterVoice'\n | 'inputMessagesFilterRoundVoice'\n | 'inputMessagesFilterRoundVideo'\n | 'inputMessagesFilterMusic'\n | 'inputMessagesFilterUrl'\n | 'inputMessagesFilterMyMentions'\n | 'inputMessagesFilterChatPhotos'\n | 'inputMessagesFilterPinned';\n\nexport type PinnedStorage = Partial<{\n promise: Promise,\n count: number,\n maxId: number\n}>;\nexport type MessagesStorage = Map & {peerId: PeerId, type: MessagesStorageType, key: MessagesStorageKey};\nexport type MessagesStorageType = 'scheduled' | 'history' | 'grouped';\nexport type MessagesStorageKey = `${PeerId}_${MessagesStorageType}`;\n\nexport type MyMessageActionType = Message.messageService['action']['_'];\n\ntype PendingAfterMsg = Partial;\n\ntype MapValueType = A extends Map ? V : never;\n\nexport type BatchUpdates = {\n 'messages_reactions': AppMessagesManager['batchUpdateReactions'],\n 'messages_views': AppMessagesManager['batchUpdateViews']\n};\n\ntype PendingMessageDetails = {\n peerId: PeerId,\n tempId: number,\n threadId: number,\n storage: MessagesStorage,\n sequential?: boolean\n};\n\nconst processAfter = (cb: () => void) => {\n // setTimeout(cb, 0);\n cb();\n};\n\nexport type MessageSendingParams = Partial<{\n threadId: number,\n replyToMsgId: number,\n scheduleDate: number,\n silent: boolean,\n sendAsPeerId: number,\n updateStickersetOrder: boolean\n}>;\n\nexport class AppMessagesManager extends AppManager {\n private messagesStorageByPeerId: {[peerId: string]: MessagesStorage};\n private groupedMessagesStorage: {[groupId: string]: MessagesStorage}; // will be used for albums\n private scheduledMessagesStorage: {[peerId: PeerId]: MessagesStorage};\n private historiesStorage: {\n [peerId: PeerId]: HistoryStorage\n };\n private threadsStorage: {\n [peerId: PeerId]: {\n [threadId: string]: HistoryStorage\n }\n };\n private searchesStorage: {\n [peerId: PeerId]: Partial<{\n [inputFilter in MyInputMessagesFilter]: {\n count?: number,\n history: number[]\n }\n }>\n };\n private pinnedMessages: {[key: string]: PinnedStorage};\n\n private threadsServiceMessagesIdsStorage: {[peerId_threadId: string]: number};\n private threadsToReplies: {\n [peerId_threadId: string]: string;\n };\n\n private pendingByRandomId: {\n [randomId: string]: PendingMessageDetails\n } = {};\n private pendingByMessageId: {[mid: string]: Long} = {};\n private pendingAfterMsgs: {[peerId: PeerId]: PendingAfterMsg} = {};\n public pendingTopMsgs: {[peerId: PeerId]: number} = {};\n private tempFinalizeCallbacks: {\n [tempId: string]: {\n [callbackName: string]: Partial<{\n deferred: CancellablePromise,\n callback: (message: MyMessage) => Promise\n }>\n }\n } = {};\n\n private sendSmthLazyLoadQueue = new LazyLoadQueueBase(10);\n\n private needSingleMessages: Map>> = new Map();\n private fetchSingleMessagesPromise: Promise;\n private extendedMedia: Map>> = new Map();\n\n private maxSeenId = 0;\n\n public migratedFromTo: {[peerId: PeerId]: PeerId} = {};\n public migratedToFrom: {[peerId: PeerId]: PeerId} = {};\n\n private newDialogsHandlePromise: Promise;\n private newDialogsToHandle: Map}> = new Map();\n public newUpdatesAfterReloadToHandle: {[key: string]: Set} = {};\n\n private notificationsHandlePromise: number;\n private notificationsToHandle: {[key: string]: {\n fwdCount: number,\n fromId: PeerId,\n topMessage?: MyMessage\n }} = {};\n\n private reloadConversationsPromise: Promise;\n private reloadConversationsPeers: Map}> = new Map();\n\n public log = logger('MESSAGES', LogTypes.Error | LogTypes.Debug | LogTypes.Log | LogTypes.Warn);\n\n private groupedTempId = 0;\n\n private typings: {[key: string]: {action: SendMessageAction, timeout?: number}} = {};\n\n private middleware: ReturnType;\n\n private unreadMentions: {[key: string]: SlicedArray} = {};\n private goToNextMentionPromises: {[key: string]: Promise} = {};\n\n private batchUpdates: {\n [k in keyof BatchUpdates]?: {\n callback: BatchUpdates[k],\n batch: ArgumentTypes[0]\n }\n } = {};\n private batchUpdatesDebounced: () => Promise;\n\n private uploadFilePromises: {[fileName: string]: CancellablePromise};\n\n protected after() {\n this.clear(true);\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateMessageID: this.onUpdateMessageId,\n\n updateNewDiscussionMessage: this.onUpdateNewMessage,\n updateNewMessage: this.onUpdateNewMessage,\n updateNewChannelMessage: this.onUpdateNewMessage,\n\n updateDialogUnreadMark: this.onUpdateDialogUnreadMark,\n\n updateEditMessage: this.onUpdateEditMessage,\n updateEditChannelMessage: this.onUpdateEditMessage,\n\n updateMessageReactions: this.onUpdateMessageReactions,\n\n updateReadChannelDiscussionInbox: this.onUpdateReadHistory,\n updateReadChannelDiscussionOutbox: this.onUpdateReadHistory,\n updateReadHistoryInbox: this.onUpdateReadHistory,\n updateReadHistoryOutbox: this.onUpdateReadHistory,\n updateReadChannelInbox: this.onUpdateReadHistory,\n updateReadChannelOutbox: this.onUpdateReadHistory,\n\n updateChannelReadMessagesContents: this.onUpdateReadMessagesContents,\n updateReadMessagesContents: this.onUpdateReadMessagesContents,\n\n updateChannelAvailableMessages: this.onUpdateChannelAvailableMessages,\n\n updateDeleteMessages: this.onUpdateDeleteMessages,\n updateDeleteChannelMessages: this.onUpdateDeleteMessages,\n\n updateChannel: this.onUpdateChannel,\n\n updateChannelReload: this.onUpdateChannelReload,\n\n updateChannelMessageViews: this.onUpdateChannelMessageViews,\n\n updateServiceNotification: this.onUpdateServiceNotification,\n\n updatePinnedMessages: this.onUpdatePinnedMessages,\n updatePinnedChannelMessages: this.onUpdatePinnedMessages,\n\n updateNotifySettings: this.onUpdateNotifySettings,\n\n updateNewScheduledMessage: this.onUpdateNewScheduledMessage,\n\n updateDeleteScheduledMessages: this.onUpdateDeleteScheduledMessages,\n\n updateMessageExtendedMedia: this.onUpdateMessageExtendedMedia,\n\n updateTranscribedAudio: this.onUpdateTranscribedAudio\n });\n\n // ! Invalidate notify settings, can optimize though\n this.rootScope.addEventListener('notify_peer_type_settings', ({key, settings}) => {\n const dialogs = this.dialogsStorage.getFolderDialogs(0).concat(this.dialogsStorage.getFolderDialogs(1));\n let filterFunc: (dialog: typeof dialogs[0]) => boolean;\n if(key === 'notifyUsers') filterFunc = (dialog) => dialog.peerId.isUser();\n else if(key === 'notifyBroadcasts') filterFunc = (dialog) => this.appPeersManager.isBroadcast(dialog.peerId);\n else filterFunc = (dialog) => this.appPeersManager.isAnyGroup(dialog.peerId);\n\n dialogs\n .filter(filterFunc)\n .forEach((dialog) => {\n this.rootScope.dispatchEvent('dialog_notify_settings', dialog);\n });\n });\n\n this.rootScope.addEventListener('webpage_updated', ({id, msgs}) => {\n msgs.forEach(({peerId, mid, isScheduled}) => {\n const storage = isScheduled ? this.getScheduledMessagesStorage(peerId) : this.getHistoryMessagesStorage(peerId);\n const message = this.getMessageFromStorage(storage, mid) as Message.message;\n if(!message) return;\n message.media = {\n _: 'messageMediaWebPage',\n webpage: this.appWebPagesManager.getCachedWebPage(id)\n };\n\n this.rootScope.dispatchEvent('message_edit', {\n storageKey: storage.key,\n peerId,\n mid,\n message\n });\n });\n });\n\n this.rootScope.addEventListener('draft_updated', ({peerId, threadId, draft}) => {\n const dialog = this.dialogsStorage.getDialogOrTopic(peerId, threadId);\n if(dialog) {\n dialog.draft = draft;\n\n let drop = false;\n if(!draft && !getServerMessageId(dialog.top_message)) {\n this.dialogsStorage.dropDialog(peerId);\n drop = true;\n } else {\n this.dialogsStorage.generateIndexForDialog(dialog);\n this.dialogsStorage.pushDialog({dialog});\n }\n\n this.rootScope.dispatchEvent('dialog_draft', {\n peerId,\n dialog,\n drop,\n draft\n });\n } else if(threadId) {\n const chat = this.appChatsManager.getChat(peerId.toChatId());\n if(!chat) {\n this.reloadConversation(peerId);\n } else if((chat as Chat.channel).pFlags.forum) {\n this.dialogsStorage.getForumTopicById(peerId, threadId);\n }\n } else {\n this.reloadConversation(peerId);\n }\n });\n\n this.rootScope.addEventListener('poll_update', ({poll}) => {\n const set = this.appPollsManager.pollToMessages[poll.id];\n if(set) {\n for(const key of set) {\n const [peerId, mid] = key.split('_');\n\n const message = this.getMessageByPeer(peerId.toPeerId(), +mid);\n if(message) {\n this.setDialogToStateIfMessageIsTop(message);\n }\n }\n }\n });\n\n // * clear forum cache\n this.rootScope.addEventListener('chat_toggle_forum', ({chatId, enabled}) => {\n const peerId = chatId.toPeerId(true);\n if(!enabled) {\n delete this.threadsStorage[peerId];\n\n for(const key in this.pinnedMessages) {\n if(+key === peerId && key.startsWith(peerId + '_')) {\n delete this.pinnedMessages[key];\n }\n }\n }\n });\n\n this.batchUpdatesDebounced = debounce(() => {\n for(const event in this.batchUpdates) {\n const details = this.batchUpdates[event as keyof BatchUpdates];\n delete this.batchUpdates[event as keyof BatchUpdates];\n\n // @ts-ignore\n const result = details.callback(details.batch);\n if(result && (!(result instanceof Array) || result.length)) {\n // @ts-ignore\n rootScope.dispatchEvent(event as keyof BatchUpdates, result);\n }\n }\n }, 33, false, true);\n\n return this.appStateManager.getState().then((state) => {\n if(state.maxSeenMsgId) {\n this.maxSeenId = state.maxSeenMsgId;\n }\n });\n }\n\n public clear = (init?: boolean) => {\n if(this.middleware) {\n this.middleware.clean();\n } else {\n this.middleware = getMiddleware();\n this.uploadFilePromises = {};\n }\n\n this.messagesStorageByPeerId = {};\n this.groupedMessagesStorage = {};\n this.scheduledMessagesStorage = {};\n this.historiesStorage = {};\n this.threadsStorage = {};\n this.searchesStorage = {};\n this.pinnedMessages = {};\n this.threadsServiceMessagesIdsStorage = {};\n this.threadsToReplies = {};\n\n this.dialogsStorage && this.dialogsStorage.clear(init);\n this.filtersStorage && this.filtersStorage.clear(init);\n };\n\n public getInputEntities(entities: MessageEntity[]) {\n const sendEntites = copy(entities);\n sendEntites.forEach((entity) => {\n if(entity._ === 'messageEntityMentionName') {\n (entity as any as MessageEntity.inputMessageEntityMentionName)._ = 'inputMessageEntityMentionName';\n (entity as any as MessageEntity.inputMessageEntityMentionName).user_id = this.appUsersManager.getUserInput(entity.user_id);\n }\n });\n return sendEntites;\n }\n\n public invokeAfterMessageIsSent(tempId: number, callbackName: string, callback: (message: MyMessage) => Promise) {\n const finalize = this.tempFinalizeCallbacks[tempId] ??= {};\n const obj = finalize[callbackName] ??= {deferred: deferredPromise()};\n\n obj.callback = callback;\n\n return obj.deferred;\n }\n\n public editMessage(message: any, text: string, options: Partial<{\n noWebPage: true,\n newMedia: any,\n scheduleDate: number,\n entities: MessageEntity[]\n }> = {}): Promise {\n /* if(!this.canEditMessage(messageId)) {\n return Promise.reject({type: 'MESSAGE_EDIT_FORBIDDEN'});\n } */\n\n const {mid, peerId} = message;\n\n if(message.pFlags.is_outgoing) {\n return this.invokeAfterMessageIsSent(mid, 'edit', (message) => {\n // this.log('invoke editMessage callback', message);\n return this.editMessage(message, text, options);\n });\n }\n\n const entities = options.entities || [];\n if(text) {\n text = parseMarkdown(text, entities);\n }\n\n const schedule_date = options.scheduleDate || (message.pFlags.is_scheduled ? message.date : undefined);\n return this.apiManager.invokeApi('messages.editMessage', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n id: message.id,\n message: text,\n media: options.newMedia,\n entities: entities.length ? this.getInputEntities(entities) : undefined,\n no_webpage: options.noWebPage,\n schedule_date\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n }, (error) => {\n this.log.error('editMessage error:', error);\n\n if(error && error.type === 'MESSAGE_NOT_MODIFIED') {\n error.handled = true;\n return;\n }\n if(error && error.type === 'MESSAGE_EMPTY') {\n error.handled = true;\n }\n return Promise.reject(error);\n });\n }\n\n public async transcribeAudio(message: Message.message): Promise {\n const {id, peerId} = message;\n\n const process = (result: MessagesTranscribedAudio) => {\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateTranscribedAudio',\n msg_id: message.id,\n peer: this.appPeersManager.getOutputPeer(peerId),\n pFlags: result.pFlags,\n text: result.text,\n transcription_id: result.transcription_id\n });\n };\n\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.transcribeAudio',\n params: {\n peer: this.appPeersManager.getInputPeerById(peerId),\n msg_id: id\n },\n processResult: (result) => {\n process(result);\n return result;\n },\n processError: (error) => {\n if(error.type === 'TRANSCRIPTION_FAILED' || error.type === 'MSG_VOICE_MISSING') {\n process({\n _: 'messages.transcribedAudio',\n transcription_id: 0,\n text: '',\n pFlags: {}\n });\n }\n\n throw error;\n }\n });\n }\n\n public async sendText(peerId: PeerId, text: string, options: MessageSendingParams & Partial<{\n entities: MessageEntity[],\n viaBotId: BotId,\n queryId: string,\n resultId: string,\n noWebPage: true,\n replyMarkup: ReplyMarkup,\n clearDraft: true,\n webPage: WebPage,\n }> = {}): Promise {\n if(!text.trim()) {\n return;\n }\n\n options.entities ??= [];\n\n // this.checkSendOptions(options);\n if(options.threadId && !options.replyToMsgId) {\n options.replyToMsgId = options.threadId;\n }\n\n const config = await this.apiManager.getConfig();\n const MAX_LENGTH = config.message_length_max;\n const splitted = splitStringByLength(text, MAX_LENGTH);\n text = splitted[0];\n if(splitted.length > 1) {\n if(options.webPage?._ === 'webPage' && !text.includes(options.webPage.url)) {\n delete options.webPage;\n }\n }\n\n peerId = this.appPeersManager.getPeerMigratedTo(peerId) || peerId;\n\n const entities = options.entities;\n if(!options.viaBotId) {\n text = parseMarkdown(text, entities);\n // entities = mergeEntities(entities, parseEntities(text));\n }\n\n let sendEntites = this.getInputEntities(entities);\n if(!sendEntites.length) {\n sendEntites = undefined;\n }\n\n const message = this.generateOutgoingMessage(peerId, options);\n message.entities = entities;\n message.message = text;\n\n const replyToMsgId = options.replyToMsgId ? getServerMessageId(options.replyToMsgId) : undefined;\n const isChannel = this.appPeersManager.isChannel(peerId);\n\n if(options.webPage) {\n message.media = {\n _: 'messageMediaWebPage',\n webpage: options.webPage\n };\n }\n\n const toggleError = (error?: ApiError) => {\n this.onMessagesSendError([message], error);\n this.rootScope.dispatchEvent('messages_pending');\n };\n\n message.send = () => {\n toggleError();\n const sentRequestOptions: PendingAfterMsg = {};\n if(this.pendingAfterMsgs[peerId]) {\n sentRequestOptions.afterMessageId = this.pendingAfterMsgs[peerId].messageId;\n }\n\n const sendAs = options.sendAsPeerId ? this.appPeersManager.getInputPeerById(options.sendAsPeerId) : undefined\n let apiPromise: any;\n if(options.viaBotId) {\n apiPromise = this.apiManager.invokeApiAfter('messages.sendInlineBotResult', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n random_id: message.random_id,\n reply_to_msg_id: replyToMsgId || undefined,\n query_id: options.queryId,\n id: options.resultId,\n clear_draft: options.clearDraft,\n send_as: sendAs\n }, sentRequestOptions);\n } else {\n apiPromise = this.apiManager.invokeApiAfter('messages.sendMessage', {\n no_webpage: options.noWebPage,\n peer: this.appPeersManager.getInputPeerById(peerId),\n message: text,\n random_id: message.random_id,\n reply_to_msg_id: replyToMsgId || undefined,\n entities: sendEntites,\n clear_draft: options.clearDraft,\n schedule_date: options.scheduleDate || undefined,\n silent: options.silent,\n send_as: sendAs,\n update_stickersets_order: options.updateStickersetOrder\n }, sentRequestOptions);\n }\n\n /* function is(value: any, condition: boolean): value is T {\n return condition;\n } */\n\n // this.log('sendText', message.mid);\n this.pendingAfterMsgs[peerId] = sentRequestOptions;\n\n return apiPromise.then((updates: Updates) => {\n // this.log('sendText sent', message.mid);\n // if(is(updates, updates._ === 'updateShortSentMessage')) {\n if(updates._ === 'updateShortSentMessage') {\n // assumeType(updates);\n\n // * fix copying object with promise\n const promise = message.promise;\n delete message.promise;\n const newMessage = copy(message);\n defineNotNumerableProperties(message, ['promise']);\n message.promise = promise;\n\n newMessage.date = updates.date;\n newMessage.id = updates.id;\n newMessage.media = updates.media;\n newMessage.entities = updates.entities;\n this.wrapMessageEntities(newMessage);\n if(updates.pFlags.out) {\n newMessage.pFlags.out = true;\n }\n\n // * override with new updates\n updates = {\n _: 'updates',\n users: [],\n chats: [],\n seq: 0,\n date: undefined,\n updates: [{\n _: 'updateMessageID',\n random_id: message.random_id,\n id: newMessage.id\n }, {\n _: options.scheduleDate ? 'updateNewScheduledMessage' : (isChannel ? 'updateNewChannelMessage' : 'updateNewMessage'),\n message: newMessage,\n pts: updates.pts,\n pts_count: updates.pts_count\n }]\n };\n } else if((updates as Updates.updates).updates) {\n (updates as Updates.updates).updates.forEach((update) => {\n if(update._ === 'updateDraftMessage') {\n update.local = true;\n }\n });\n }\n\n // this.reloadConversation(peerId);\n\n // setTimeout(() => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n // }, 5000);\n message.promise.resolve();\n }, (error: ApiError) => {\n toggleError(error);\n message.promise.reject(error);\n throw error;\n }).finally(() => {\n if(this.pendingAfterMsgs[peerId] === sentRequestOptions) {\n delete this.pendingAfterMsgs[peerId];\n }\n });\n };\n\n this.beforeMessageSending(message, {\n isScheduled: !!options.scheduleDate || undefined,\n threadId: options.threadId,\n clearDraft: options.clearDraft,\n sequential: true\n });\n\n const promises: ReturnType[] = [message.promise];\n for(let i = 1; i < splitted.length; ++i) {\n promises.push(this.sendText(peerId, splitted[i], options));\n }\n\n return Promise.all(promises).then(noop);\n }\n\n public sendFile(peerId: PeerId, options: MessageSendingParams & SendFileDetails & Partial<{\n isRoundMessage: boolean,\n isVoiceMessage: boolean,\n isGroupedItem: boolean,\n isMedia: boolean,\n\n groupId: string,\n caption: string,\n entities: MessageEntity[],\n background: boolean,\n clearDraft: boolean,\n noSound: boolean,\n\n waveform: Uint8Array,\n\n // ! only for internal use\n processAfter?: typeof processAfter\n }>) {\n const file = options.file;\n peerId = this.appPeersManager.getPeerMigratedTo(peerId) || peerId;\n\n // this.checkSendOptions(options);\n\n const message = this.generateOutgoingMessage(peerId, options);\n const replyToMsgId = options.replyToMsgId ? getServerMessageId(options.replyToMsgId) : undefined;\n\n let attachType: 'document' | 'audio' | 'video' | 'voice' | 'photo', apiFileName: string;\n\n const fileType = 'mime_type' in file ? file.mime_type : file.type;\n const fileName = file instanceof File ? file.name : '';\n const isDocument = !(file instanceof File) && !(file instanceof Blob);\n let caption = options.caption || '';\n\n this.log('sendFile', file, fileType);\n\n const entities = options.entities || [];\n if(caption) {\n caption = parseMarkdown(caption, entities);\n }\n\n const attributes: DocumentAttribute[] = [];\n\n const isPhoto = getEnvironment().IMAGE_MIME_TYPES_SUPPORTED.has(fileType);\n\n const strippedPhotoSize: PhotoSize.photoStrippedSize = options.strippedBytes && {\n _: 'photoStrippedSize',\n bytes: options.strippedBytes,\n type: 'i'\n };\n\n let photo: MyPhoto, document: MyDocument;\n\n let actionName: Extract;\n if(isDocument) { // maybe it's a sticker or gif\n attachType = 'document';\n apiFileName = '';\n } else if(fileType.indexOf('audio/') === 0 || ['video/ogg'].indexOf(fileType) >= 0) {\n attachType = 'audio';\n apiFileName = 'audio.' + (fileType.split('/')[1] === 'ogg' ? 'ogg' : 'mp3');\n actionName = 'sendMessageUploadAudioAction';\n\n if(options.isVoiceMessage) {\n attachType = 'voice';\n message.pFlags.media_unread = true;\n }\n\n const attribute: DocumentAttribute.documentAttributeAudio = {\n _: 'documentAttributeAudio',\n pFlags: {\n voice: options.isVoiceMessage || undefined\n },\n waveform: options.waveform,\n duration: options.duration || undefined\n };\n\n attributes.push(attribute);\n } else if(!options.isMedia) {\n attachType = 'document';\n apiFileName = 'document.' + fileType.split('/')[1];\n actionName = 'sendMessageUploadDocumentAction';\n } else if(isPhoto) {\n attachType = 'photo';\n apiFileName = 'photo.' + fileType.split('/')[1];\n actionName = 'sendMessageUploadPhotoAction';\n\n const photoSize = {\n _: 'photoSize',\n w: options.width,\n h: options.height,\n type: THUMB_TYPE_FULL,\n location: null,\n size: file.size\n } as PhotoSize.photoSize;\n\n photo = {\n _: 'photo',\n id: '' + message.id,\n sizes: [photoSize],\n w: options.width,\n h: options.height\n } as any;\n\n if(strippedPhotoSize) {\n photo.sizes.unshift(strippedPhotoSize);\n }\n\n const cacheContext = this.thumbsStorage.getCacheContext(photo, photoSize.type);\n cacheContext.downloaded = file.size;\n cacheContext.url = options.objectURL || '';\n\n photo = this.appPhotosManager.savePhoto(photo);\n } else if(getEnvironment().VIDEO_MIME_TYPES_SUPPORTED.has(fileType as VIDEO_MIME_TYPE)) {\n attachType = 'video';\n apiFileName = 'video.mp4';\n actionName = 'sendMessageUploadVideoAction';\n\n const videoAttribute: DocumentAttribute.documentAttributeVideo = {\n _: 'documentAttributeVideo',\n pFlags: {\n round_message: options.isRoundMessage || undefined,\n supports_streaming: true\n },\n duration: options.duration,\n w: options.width,\n h: options.height\n };\n\n attributes.push(videoAttribute);\n\n // * must follow after video attribute\n if(options.noSound &&\n file.size > (10 * 1024) &&\n file.size < (10 * 1024 * 1024)) {\n attributes.push({\n _: 'documentAttributeAnimated'\n });\n }\n } else {\n attachType = 'document';\n apiFileName = 'document.' + fileType.split('/')[1];\n actionName = 'sendMessageUploadDocumentAction';\n }\n\n attributes.push({_: 'documentAttributeFilename', file_name: fileName || apiFileName});\n\n if((['document', 'video', 'audio', 'voice'] as (typeof attachType)[]).indexOf(attachType) !== -1 && !isDocument) {\n const thumbs: PhotoSize[] = [];\n document = {\n _: 'document',\n id: '' + message.id,\n duration: options.duration,\n attributes,\n w: options.width,\n h: options.height,\n thumbs,\n mime_type: fileType,\n size: file.size\n } as any;\n\n if(options.objectURL) {\n const cacheContext = this.thumbsStorage.getCacheContext(document);\n cacheContext.downloaded = file.size;\n cacheContext.url = options.objectURL;\n }\n\n let thumb: PhotoSize.photoSize;\n if(isPhoto) {\n attributes.push({\n _: 'documentAttributeImageSize',\n w: options.width,\n h: options.height\n });\n\n thumb = {\n _: 'photoSize',\n w: options.width,\n h: options.height,\n type: THUMB_TYPE_FULL,\n size: file.size\n };\n } else if(attachType === 'video') {\n if(options.thumb) {\n thumb = {\n _: 'photoSize',\n w: options.thumb.size.width,\n h: options.thumb.size.height,\n type: 'local-thumb',\n size: options.thumb.blob.size\n };\n\n const thumbCacheContext = this.thumbsStorage.getCacheContext(document, thumb.type);\n thumbCacheContext.downloaded = thumb.size;\n thumbCacheContext.url = options.thumb.url;\n }\n }\n\n if(thumb) {\n thumbs.push(thumb);\n }\n\n if(strippedPhotoSize) {\n thumbs.unshift(strippedPhotoSize);\n }\n\n /* if(thumbs.length) {\n const thumb = thumbs[0] as PhotoSize.photoSize;\n const docThumb = appPhotosManager.getDocumentCachedThumb(document.id);\n docThumb.downloaded = thumb.size;\n docThumb.url = thumb.url;\n } */\n\n document = this.appDocsManager.saveDoc(document);\n }\n\n this.log('sendFile', attachType, apiFileName, file.type, options);\n\n const sentDeferred = deferredPromise();\n // sentDeferred.cancel = () => {\n // const error = new Error('Download canceled');\n // error.name = 'AbortError';\n // sentDeferred.reject(error);\n\n // if(uploadPromise?.cancel) {\n // uploadPromise.cancel();\n // }\n // };\n\n const media: MessageMedia = isDocument ? undefined : {\n _: photo ? 'messageMediaPhoto' : 'messageMediaDocument',\n pFlags: {},\n // preloader,\n photo,\n document\n };\n\n if(media) {\n defineNotNumerableProperties(media as any, ['promise']);\n (media as any).promise = sentDeferred;\n\n if(options.spoiler) {\n (media as MessageMedia.messageMediaPhoto).pFlags.spoiler = true;\n }\n }\n\n message.entities = entities;\n message.message = caption;\n message.media = isDocument ? {\n _: 'messageMediaDocument',\n pFlags: {},\n document: file\n } as MessageMedia.messageMediaDocument : media;\n\n const uploadingFileName = !isDocument ? getFileNameForUpload(file) : undefined;\n message.uploadingFileName = uploadingFileName;\n\n if(uploadingFileName) {\n this.uploadFilePromises[uploadingFileName] = sentDeferred;\n }\n\n const toggleError = (error?: ApiError) => {\n this.onMessagesSendError([message], error);\n this.rootScope.dispatchEvent('messages_pending');\n };\n\n let uploaded = false,\n uploadPromise: ReturnType = null;\n\n message.send = () => {\n if(isDocument) {\n const inputMedia: InputMedia = {\n _: 'inputMediaDocument',\n id: getDocumentInput(file),\n pFlags: {}\n };\n\n sentDeferred.resolve(inputMedia);\n } else if(file instanceof File || file instanceof Blob) {\n const load = () => {\n if(!uploaded || message.error) {\n uploaded = false;\n\n uploadPromise = this.apiFileManager.upload({file, fileName: uploadingFileName});\n uploadPromise.catch((err) => {\n if(!uploaded) {\n this.log('cancelling upload', media);\n\n this.cancelPendingMessage(message.random_id);\n this.setTyping(peerId, {_: 'sendMessageCancelAction'}, undefined, options.threadId);\n sentDeferred.reject(err);\n }\n });\n\n uploadPromise.addNotifyListener((progress: Progress) => {\n /* if(DEBUG) {\n this.log('upload progress', progress);\n } */\n\n const percents = Math.max(1, Math.floor(100 * progress.done / progress.total));\n if(actionName) {\n this.setTyping(peerId, {_: actionName, progress: percents | 0}, undefined, options.threadId);\n }\n sentDeferred.notifyAll(progress);\n });\n\n sentDeferred.notifyAll({done: 0, total: file.size});\n }\n\n let thumbUploadPromise: typeof uploadPromise;\n if(attachType === 'video' && options.objectURL && options.thumb?.blob) {\n thumbUploadPromise = this.apiFileManager.upload({file: options.thumb.blob});\n }\n\n uploadPromise && uploadPromise.then(async(inputFile) => {\n /* if(DEBUG) {\n this.log('appMessagesManager: sendFile uploaded:', inputFile);\n } */\n\n inputFile.name = apiFileName;\n uploaded = true;\n let inputMedia: InputMedia;\n switch(attachType) {\n case 'photo':\n inputMedia = {\n _: 'inputMediaUploadedPhoto',\n file: inputFile,\n pFlags: {\n spoiler: options.spoiler || undefined\n }\n };\n break;\n\n default:\n inputMedia = {\n _: 'inputMediaUploadedDocument',\n file: inputFile,\n mime_type: fileType,\n pFlags: {\n force_file: actionName === 'sendMessageUploadDocumentAction' || undefined,\n spoiler: options.spoiler || undefined\n // nosound_video: options.noSound ? true : undefined\n },\n attributes\n };\n }\n\n if(thumbUploadPromise) {\n try {\n const inputFile = await thumbUploadPromise;\n (inputMedia as InputMedia.inputMediaUploadedDocument).thumb = inputFile;\n } catch(err) {\n this.log.error('sendFile thumb upload error:', err);\n }\n }\n\n sentDeferred.resolve(inputMedia);\n }, (error: ApiError) => {\n toggleError(error);\n throw error;\n });\n\n return sentDeferred;\n };\n\n if(options.isGroupedItem) {\n load();\n } else {\n this.sendSmthLazyLoadQueue.push({\n load\n });\n }\n }\n\n return sentDeferred;\n };\n\n this.beforeMessageSending(message, {\n isGroupedItem: options.isGroupedItem,\n isScheduled: !!options.scheduleDate || undefined,\n threadId: options.threadId,\n clearDraft: options.clearDraft,\n processAfter: options.processAfter\n });\n\n if(!options.isGroupedItem) {\n sentDeferred.then((inputMedia) => {\n this.setTyping(peerId, {_: 'sendMessageCancelAction'}, undefined, options.threadId);\n\n return this.apiManager.invokeApi('messages.sendMedia', {\n background: options.background,\n peer: this.appPeersManager.getInputPeerById(peerId),\n media: inputMedia,\n message: caption,\n random_id: message.random_id,\n reply_to_msg_id: replyToMsgId,\n schedule_date: options.scheduleDate,\n silent: options.silent,\n entities,\n clear_draft: options.clearDraft,\n send_as: options.sendAsPeerId ? this.appPeersManager.getInputPeerById(options.sendAsPeerId) : undefined,\n update_stickersets_order: options.updateStickersetOrder\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n }, (error: ApiError) => {\n if(attachType === 'photo' &&\n error.code === 400 &&\n (error.type === 'PHOTO_INVALID_DIMENSIONS' ||\n error.type === 'PHOTO_SAVE_FILE_INVALID')) {\n error.handled = true;\n attachType = 'document';\n message.send();\n return;\n }\n\n toggleError(error);\n throw error;\n });\n });\n\n sentDeferred.then(message.promise.resolve, message.promise.reject);\n }\n\n const ret: {\n message: typeof message,\n promise: typeof sentDeferred\n } = {\n message\n } as any;\n\n defineNotNumerableProperties(ret, ['promise']);\n ret.promise = sentDeferred;\n\n return ret;\n }\n\n public async sendAlbum(peerId: PeerId, options: MessageSendingParams & {\n isMedia?: boolean,\n entities?: MessageEntity[],\n caption?: string,\n sendFileDetails: SendFileDetails[],\n clearDraft?: boolean\n }) {\n // this.checkSendOptions(options);\n\n if(options.threadId && !options.replyToMsgId) {\n options.replyToMsgId = options.threadId;\n }\n\n if(options.sendFileDetails.length === 1) {\n return this.sendFile(peerId, {...options, ...options.sendFileDetails[0]});\n }\n\n peerId = this.appPeersManager.getPeerMigratedTo(peerId) || peerId;\n const replyToMsgId = options.replyToMsgId ? getServerMessageId(options.replyToMsgId) : undefined;\n\n let caption = options.caption || '';\n let entities = options.entities || [];\n if(caption) {\n caption = parseMarkdown(caption, entities);\n }\n\n this.log('sendAlbum', options);\n\n const groupId = '' + ++this.groupedTempId;\n\n const callbacks: Array<() => void> = [];\n const processAfter = (cb: () => void) => {\n callbacks.push(cb);\n };\n\n const messages = options.sendFileDetails.map((details, idx) => {\n const o: Parameters[1] = {\n isGroupedItem: true,\n isMedia: options.isMedia,\n scheduleDate: options.scheduleDate,\n silent: options.silent,\n replyToMsgId,\n threadId: options.threadId,\n sendAsPeerId: options.sendAsPeerId,\n groupId,\n processAfter,\n ...details\n };\n\n if(idx === 0) {\n o.caption = caption;\n o.entities = entities;\n // o.replyToMsgId = replyToMsgId;\n }\n\n return this.sendFile(peerId, o).message;\n });\n\n if(options.clearDraft) {\n callbacks.push(() => {\n this.appDraftsManager.clearDraft(peerId, options.threadId);\n });\n }\n\n callbacks.forEach((callback) => {\n callback();\n });\n\n // * test pending\n // return;\n\n const toggleError = (message: Message.message, error?: ApiError) => {\n this.onMessagesSendError([message], error);\n this.rootScope.dispatchEvent('messages_pending');\n };\n\n const inputPeer = this.appPeersManager.getInputPeerById(peerId);\n const invoke = (multiMedia: InputSingleMedia[]) => {\n this.setTyping(peerId, {_: 'sendMessageCancelAction'}, undefined, options.threadId);\n\n const deferred = deferredPromise();\n this.sendSmthLazyLoadQueue.push({\n load: () => {\n return this.apiManager.invokeApi('messages.sendMultiMedia', {\n peer: inputPeer,\n multi_media: multiMedia,\n reply_to_msg_id: replyToMsgId,\n schedule_date: options.scheduleDate,\n silent: options.silent,\n clear_draft: options.clearDraft,\n send_as: options.sendAsPeerId ? this.appPeersManager.getInputPeerById(options.sendAsPeerId) : undefined,\n update_stickersets_order: options.updateStickersetOrder\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n deferred.resolve();\n }, (error: ApiError) => {\n messages.forEach((message) => toggleError(message, error));\n deferred.reject(error);\n });\n }\n });\n\n return deferred;\n };\n\n const promises: Promise[] = messages.map((message) => {\n return (message.send() as Promise).then((inputMedia) => {\n return Promise.all([\n inputMedia,\n this.apiManager.invokeApi('messages.uploadMedia', {\n peer: inputPeer,\n media: inputMedia\n })\n ]);\n })\n .then(([originalInputMedia, messageMedia]) => {\n let inputMedia: InputMedia;\n if(messageMedia._ === 'messageMediaPhoto') {\n const photo = this.appPhotosManager.savePhoto(messageMedia.photo);\n inputMedia = getPhotoMediaInput(photo);\n } else if(messageMedia._ === 'messageMediaDocument') {\n const doc = this.appDocsManager.saveDoc(messageMedia.document);\n inputMedia = getDocumentMediaInput(doc);\n }\n\n // copy original flags\n const copyProperties: (keyof InputMedia.inputMediaPhoto)[] = [\n 'pFlags',\n 'ttl_seconds'\n ];\n\n copyProperties.forEach((property) => {\n // @ts-ignore\n inputMedia[property] = originalInputMedia[property] ?? inputMedia[property];\n });\n\n const inputSingleMedia: InputSingleMedia = {\n _: 'inputSingleMedia',\n media: inputMedia,\n random_id: message.random_id,\n message: caption,\n entities\n };\n\n // * only 1 caption for all inputs\n if(caption) {\n caption = '';\n entities = [];\n }\n\n return inputSingleMedia;\n }).catch((err: ApiError) => {\n this.log.error('sendAlbum upload item error:', err, message);\n toggleError(message, err);\n throw err;\n });\n });\n\n return Promise.all(promises).then((inputs) => {\n return invoke(inputs.filter(Boolean));\n });\n }\n\n public sendContact(peerId: PeerId, contactPeerId: PeerId) {\n return this.sendOther(peerId, this.appUsersManager.getContactMediaInput(contactPeerId));\n }\n\n public sendOther(\n peerId: PeerId,\n inputMedia: InputMedia | {_: 'messageMediaPending', messageMedia: MessageMedia},\n options: MessageSendingParams & Partial<{\n viaBotId: BotId,\n replyMarkup: ReplyMarkup,\n clearDraft: true,\n queryId: string\n resultId: string,\n geoPoint: GeoPoint\n }> = {}\n ) {\n peerId = this.appPeersManager.getPeerMigratedTo(peerId) || peerId;\n\n // this.checkSendOptions(options);\n const message = this.generateOutgoingMessage(peerId, options);\n const replyToMsgId = options.replyToMsgId ? getServerMessageId(options.replyToMsgId) : undefined;\n\n let media: MessageMedia;\n switch(inputMedia._) {\n case 'inputMediaPoll': {\n const pollId = '' + message.id;\n inputMedia.poll.id = pollId;\n this.appPollsManager.savePoll(inputMedia.poll, {\n _: 'pollResults',\n flags: 4,\n total_voters: 0,\n pFlags: {},\n recent_voters: []\n });\n\n const {poll, results} = this.appPollsManager.getPoll(pollId);\n media = {\n _: 'messageMediaPoll',\n poll,\n results\n };\n\n break;\n }\n\n case 'inputMediaPhoto': {\n media = {\n _: 'messageMediaPhoto',\n photo: this.appPhotosManager.getPhoto((inputMedia.id as InputPhoto.inputPhoto).id),\n pFlags: {}\n };\n break;\n }\n\n case 'inputMediaDocument': {\n const doc = this.appDocsManager.getDoc((inputMedia.id as InputDocument.inputDocument).id);\n /* if(doc.sticker && doc.stickerSetInput) {\n appStickersManager.pushPopularSticker(doc.id);\n } */\n media = {\n _: 'messageMediaDocument',\n document: doc,\n pFlags: {}\n };\n break;\n }\n\n case 'inputMediaContact': {\n media = {\n _: 'messageMediaContact',\n phone_number: inputMedia.phone_number,\n first_name: inputMedia.first_name,\n last_name: inputMedia.last_name,\n user_id: inputMedia.user_id ?? '0',\n vcard: inputMedia.vcard\n };\n break;\n }\n\n case 'inputMediaGeoPoint': {\n media = {\n _: 'messageMediaGeo',\n geo: options.geoPoint\n };\n break;\n }\n\n case 'inputMediaVenue': {\n media = {\n _: 'messageMediaVenue',\n geo: options.geoPoint,\n title: inputMedia.title,\n address: inputMedia.address,\n provider: inputMedia.provider,\n venue_id: inputMedia.venue_id,\n venue_type: inputMedia.venue_type\n };\n break;\n }\n\n case 'messageMediaPending': {\n media = (inputMedia as any).messageMedia;\n break;\n }\n }\n\n message.media = media;\n\n const toggleError = (error?: ApiError) => {\n this.onMessagesSendError([message], error);\n this.rootScope.dispatchEvent('messages_pending');\n };\n\n message.send = () => {\n const sentRequestOptions: PendingAfterMsg = {};\n if(this.pendingAfterMsgs[peerId]) {\n sentRequestOptions.afterMessageId = this.pendingAfterMsgs[peerId].messageId;\n }\n\n const sendAs = options.sendAsPeerId ? this.appPeersManager.getInputPeerById(options.sendAsPeerId) : undefined;\n let apiPromise: Promise;\n if(options.viaBotId) {\n apiPromise = this.apiManager.invokeApiAfter('messages.sendInlineBotResult', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n random_id: message.random_id,\n reply_to_msg_id: replyToMsgId || undefined,\n query_id: options.queryId,\n id: options.resultId,\n clear_draft: options.clearDraft,\n schedule_date: options.scheduleDate,\n silent: options.silent,\n send_as: sendAs\n }, sentRequestOptions);\n } else {\n apiPromise = this.apiManager.invokeApiAfter('messages.sendMedia', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n media: inputMedia as InputMedia,\n random_id: message.random_id,\n reply_to_msg_id: replyToMsgId || undefined,\n message: '',\n clear_draft: options.clearDraft,\n schedule_date: options.scheduleDate,\n silent: options.silent,\n send_as: sendAs,\n update_stickersets_order: options.updateStickersetOrder\n }, sentRequestOptions);\n }\n\n this.pendingAfterMsgs[peerId] = sentRequestOptions;\n\n return apiPromise.then((updates) => {\n if(updates.updates) {\n updates.updates.forEach((update: Update) => {\n if(update._ === 'updateDraftMessage') {\n update.local = true;\n }\n });\n }\n\n this.apiUpdatesManager.processUpdateMessage(updates);\n }, (error: ApiError) => {\n toggleError(error);\n throw error;\n }).finally(() => {\n if(this.pendingAfterMsgs[peerId] === sentRequestOptions) {\n delete this.pendingAfterMsgs[peerId];\n }\n });\n };\n\n this.beforeMessageSending(message, {\n isScheduled: !!options.scheduleDate || undefined,\n threadId: options.threadId,\n clearDraft: options.clearDraft,\n sequential: true\n });\n\n return message.promise;\n }\n\n /* private checkSendOptions(options: Partial<{\n scheduleDate: number\n }>) {\n if(options.scheduleDate) {\n const minTimestamp = (Date.now() / 1000 | 0) + 10;\n if(options.scheduleDate <= minTimestamp) {\n delete options.scheduleDate;\n }\n }\n } */\n\n private beforeMessageSending(message: Message.message, options: Pick & Partial<{\n isGroupedItem: boolean,\n isScheduled: boolean,\n clearDraft: boolean,\n sequential: boolean,\n processAfter?: (cb: () => void) => void\n }> = {}) {\n const messageId = message.id;\n const peerId = this.getMessagePeer(message);\n const storage = options.isScheduled ? this.getScheduledMessagesStorage(peerId) : this.getHistoryMessagesStorage(peerId);\n message.storageKey = storage.key;\n const callbacks: Array<() => void> = [];\n if(options.isScheduled) {\n // if(!options.isGroupedItem) {\n this.saveMessages([message], {storage, isScheduled: true, isOutgoing: true});\n callbacks.push(() => {\n this.rootScope.dispatchEvent('scheduled_new', message);\n });\n } else {\n /* if(options.threadId && this.threadsStorage[peerId]) {\n delete this.threadsStorage[peerId][options.threadId];\n } */\n const storages: HistoryStorage[] = [\n this.getHistoryStorage(peerId),\n options.threadId ? this.getHistoryStorage(peerId, options.threadId) : undefined\n ];\n\n for(const storage of storages) {\n if(storage) {\n storage.history.unshift(messageId);\n }\n }\n\n this.saveMessages([message], {storage, isOutgoing: true});\n this.setDialogTopMessage(message);\n\n if(options.threadId) {\n const forumTopic = this.dialogsStorage.getForumTopic(peerId, options.threadId);\n if(forumTopic) {\n this.setDialogTopMessage(message, forumTopic);\n }\n }\n\n callbacks.push(() => {\n this.rootScope.dispatchEvent('history_append', {storageKey: storage.key, message});\n });\n }\n\n const pending: PendingMessageDetails = this.pendingByRandomId[message.random_id] = {\n peerId,\n tempId: messageId,\n threadId: options.threadId,\n storage,\n sequential: options.sequential\n };\n\n this.pendingTopMsgs[peerId] = messageId;\n\n if(!options.isGroupedItem && message.send) {\n callbacks.push(() => {\n if(options.clearDraft) {\n this.appDraftsManager.clearDraft(peerId, options.threadId);\n }\n\n message.send();\n });\n }\n\n if(callbacks.length) {\n (options.processAfter || processAfter)(() => {\n for(const callback of callbacks) {\n callback();\n }\n });\n }\n\n return pending;\n }\n\n private generateOutgoingMessage(peerId: PeerId, options: MessageSendingParams & Partial<{\n viaBotId: BotId,\n groupId: string,\n replyMarkup: ReplyMarkup,\n }>) {\n if(options.threadId && !options.replyToMsgId) {\n options.replyToMsgId = options.threadId;\n }\n\n let postAuthor: string;\n const isBroadcast = this.appPeersManager.isBroadcast(peerId);\n if(isBroadcast) {\n const chat = this.appPeersManager.getPeer(peerId) as Chat.channel;\n if(chat.pFlags.signatures) {\n const user = this.appUsersManager.getSelf();\n const fullName = user.first_name + (user.last_name ? ' ' + user.last_name : '');\n postAuthor = fullName;\n }\n }\n\n const message: Message.message = {\n _: 'message',\n id: this.generateTempMessageId(peerId),\n from_id: options.sendAsPeerId ? this.appPeersManager.getOutputPeer(options.sendAsPeerId) : this.generateFromId(peerId),\n peer_id: this.appPeersManager.getOutputPeer(peerId),\n post_author: postAuthor,\n pFlags: this.generateFlags(peerId),\n date: options.scheduleDate || (tsNow(true) + this.timeManager.getServerTimeOffset()),\n message: '',\n grouped_id: options.groupId,\n random_id: randomLong(),\n reply_to: this.generateReplyHeader(peerId, options.replyToMsgId, options.threadId),\n via_bot_id: options.viaBotId,\n reply_markup: options.replyMarkup,\n replies: this.generateReplies(peerId),\n views: isBroadcast && 1,\n pending: true\n };\n\n defineNotNumerableProperties(message, ['send', 'promise']);\n if(options.groupId === undefined) {\n message.promise = deferredPromise();\n }\n\n return message;\n }\n\n private generateReplyHeader(peerId: PeerId, replyToMsgId: number, replyToTopId?: number) {\n const isForum = this.appPeersManager.isForum(peerId);\n if(isForum && !replyToTopId) {\n const originalMessage = this.getMessageByPeer(peerId, replyToMsgId);\n if(originalMessage) {\n replyToTopId = getMessageThreadId(originalMessage, true);\n }\n }\n\n const header: MessageReplyHeader = {\n _: 'messageReplyHeader',\n reply_to_msg_id: replyToMsgId || replyToTopId,\n pFlags: {}\n };\n\n if(replyToTopId && isForum && GENERAL_TOPIC_ID !== replyToTopId) {\n header.pFlags.forum_topic = true;\n }\n\n if(replyToTopId && header.reply_to_msg_id !== replyToTopId) {\n header.reply_to_top_id = replyToTopId;\n }\n\n return header;\n }\n\n private generateReplies(peerId: PeerId) {\n let replies: MessageReplies.messageReplies;\n if(this.appPeersManager.isBroadcast(peerId)) {\n const channelFull = this.appProfileManager.getCachedFullChat(peerId.toChatId()) as ChatFull.channelFull;\n if(channelFull?.linked_chat_id) {\n replies = {\n _: 'messageReplies',\n flags: 1,\n pFlags: {\n comments: true\n },\n channel_id: channelFull.linked_chat_id,\n replies: 0,\n replies_pts: 0\n };\n }\n }\n\n return replies;\n }\n\n /**\n * Generate correct from_id according to anonymous or broadcast\n */\n private generateFromId(peerId: PeerId) {\n if(this.appPeersManager.isAnyChat(peerId) && (this.appPeersManager.isBroadcast(peerId) || this.isAnonymousSending(peerId))) {\n return undefined;\n } else {\n return this.appPeersManager.getOutputPeer(this.appUsersManager.getSelf().id.toPeerId());\n }\n }\n\n private generateFlags(peerId: PeerId) {\n const pFlags: Message.message['pFlags'] = {};\n const fromId = this.appUsersManager.getSelf().id;\n if(peerId !== fromId) {\n pFlags.out = true;\n\n if(!this.appPeersManager.isChannel(peerId) && !this.appUsersManager.isBot(peerId)) {\n pFlags.unread = true;\n }\n }\n\n if(this.appPeersManager.isBroadcast(peerId)) {\n pFlags.post = true;\n }\n\n return pFlags;\n }\n\n private generateForwardHeader(peerId: PeerId, originalMessage: Message.message) {\n const myId = this.appUsersManager.getSelf().id.toPeerId();\n const fromId = originalMessage.fromId;\n if(fromId === myId && originalMessage.peerId === myId && !originalMessage.fwd_from) {\n return;\n }\n\n const fwdHeader: MessageFwdHeader.messageFwdHeader = {\n _: 'messageFwdHeader',\n flags: 0,\n date: originalMessage.date,\n pFlags: {}\n };\n\n let isUserHidden = false;\n if(originalMessage.fwd_from) {\n fwdHeader.from_id = originalMessage.fwd_from.from_id;\n fwdHeader.from_name = originalMessage.fwd_from.from_name;\n fwdHeader.post_author = originalMessage.fwd_from.post_author;\n } else {\n fwdHeader.post_author = originalMessage.post_author;\n\n if(fromId.isUser()) {\n const userFull = this.appProfileManager.getCachedFullUser(fromId.toUserId());\n if(userFull?.private_forward_name) {\n fwdHeader.from_name = userFull.private_forward_name;\n isUserHidden = true;\n }\n }\n\n if(!isUserHidden) {\n fwdHeader.from_id = this.appPeersManager.getOutputPeer(fromId);\n }\n }\n\n if(this.appPeersManager.isBroadcast(originalMessage.peerId)) {\n if(originalMessage.post_author) {\n fwdHeader.post_author = originalMessage.post_author;\n }\n\n fwdHeader.channel_post = originalMessage.id;\n }\n\n if(peerId === myId && !isUserHidden) {\n fwdHeader.saved_from_msg_id = originalMessage.id;\n fwdHeader.saved_from_peer = this.appPeersManager.getOutputPeer(originalMessage.peerId);\n }\n\n return fwdHeader;\n }\n\n public generateFakeAvatarMessage(peerId: PeerId, photo: Photo) {\n const maxId = Number.MAX_SAFE_INTEGER;\n const message: Message.messageService = {\n _: 'messageService',\n pFlags: {},\n action: {\n _: 'messageActionChannelEditPhoto',\n photo\n },\n id: maxId,\n peer_id: this.appPeersManager.getOutputPeer(peerId),\n mid: maxId,\n peerId,\n date: (photo as Photo.photo).date,\n fromId: peerId\n };\n\n this.getHistoryMessagesStorage(peerId).set(maxId, message);\n return message;\n }\n\n public getUploadPromise(uploadFileName: string) {\n return this.uploadFilePromises[uploadFileName];\n }\n\n public isAnonymousSending(peerId: PeerId): boolean {\n if(!peerId.isAnyChat()) {\n return false;\n }\n\n const chat = this.appPeersManager.getPeer(peerId);\n return (chat as Chat.channel).admin_rights?.pFlags?.anonymous;\n }\n\n public setDialogTopMessage(\n message: MyMessage,\n dialog: MTDialog.dialog | ForumTopic = this.getDialogOnly(message.peerId)\n ) {\n if(!dialog) {\n return;\n }\n\n dialog.top_message = message.mid;\n\n const historyStorage = this.getHistoryStorage(message.peerId, dialog._ === 'forumTopic' ? dialog.id : undefined);\n historyStorage.maxId = message.mid;\n\n this.dialogsStorage.generateIndexForDialog(dialog, false, message);\n\n this.scheduleHandleNewDialogs(message.peerId, dialog);\n }\n\n public cancelPendingMessage(randomId: string) {\n const pendingData = this.pendingByRandomId[randomId];\n\n /* if(DEBUG) {\n this.log('cancelPendingMessage', randomId, pendingData);\n } */\n\n if(pendingData) {\n const {peerId, tempId, storage} = pendingData;\n const historyStorage = this.getHistoryStorage(peerId);\n\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateDeleteMessages',\n messages: [tempId],\n pts: undefined,\n pts_count: undefined\n });\n\n historyStorage.history.delete(tempId);\n\n delete this.pendingByRandomId[randomId];\n storage.delete(tempId);\n\n return true;\n }\n\n return false;\n }\n\n /* public async refreshConversations() {\n const limit = 200, outDialogs: Dialog[] = [];\n for(let folderId = 0; folderId < 2; ++folderId) {\n let offsetDate = 0;\n for(;;) {\n const {dialogs, isEnd} = await this.getTopMessages(limit, folderId, offsetDate);\n\n if(dialogs.length) {\n outDialogs.push(...dialogs as Dialog[]);\n const dialog = dialogs[dialogs.length - 1];\n\n // * get peerId and mid manually, because dialog can be migrated peer and it won't be saved\n const peerId = getPeerId(dialog.peer);\n const mid = generateMessageId(dialog.top_message);\n offsetDate = this.getMessageByPeer(peerId, mid).date;\n\n if(!offsetDate) {\n console.error('refreshConversations: got no offsetDate', dialog);\n break;\n }\n }\n\n if(isEnd) {\n break;\n }\n }\n }\n\n let obj: {[peerId: string]: Dialog} = {};\n outDialogs.forEach((dialog) => {\n obj[dialog.peerId] = dialog;\n });\n rootScope.dispatchEvent('dialogs_multiupdate', obj);\n\n return outDialogs;\n } */\n\n public async fillConversations(folderId = GLOBAL_FOLDER_ID): Promise {\n const middleware = this.middleware.get();\n while(!this.dialogsStorage.isDialogsLoaded(folderId)) {\n const result = await this.getTopMessages({limit: 100, folderId});\n if(!middleware() || result.isEnd) {\n break;\n }\n }\n }\n\n /* public async getConversationsAll(query = '', folderId = 0) {\n const limit = 200, outDialogs: Dialog[] = [];\n for(; folderId < 2; ++folderId) {\n let offsetIndex = 0;\n for(;;) {\n const {dialogs} = await appMessagesManager.getConversations(query, offsetIndex, limit, folderId).promise;\n\n if(dialogs.length) {\n outDialogs.push(...dialogs);\n offsetIndex = dialogs[dialogs.length - 1].index || 0;\n } else {\n break;\n }\n }\n }\n\n return outDialogs;\n } */\n\n public getReadMaxIdIfUnread(peerId: PeerId, threadId?: number) {\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n if(threadId && !this.appChatsManager.isForum(peerId.toChatId())) {\n const chatHistoryStorage = this.getHistoryStorage(peerId);\n const readMaxId = Math.max(chatHistoryStorage.readMaxId ?? 0, historyStorage.readMaxId);\n const message = this.getMessageByPeer(peerId, historyStorage.maxId); // usually message is missing, so pFlags.out won't be there anyway\n return !message?.pFlags?.out && readMaxId < historyStorage.maxId ? readMaxId : 0;\n } else {\n const message = this.getMessageByPeer(peerId, historyStorage.maxId);\n const readMaxId = peerId.isUser() ? Math.max(historyStorage.readMaxId, historyStorage.readOutboxMaxId) : historyStorage.readMaxId;\n // readMaxId can be 4294967295 (0)\n return !message?.pFlags?.out && readMaxId < historyStorage.maxId && getServerMessageId(readMaxId) ? readMaxId : 0;\n }\n }\n\n // public lolSet = new Set();\n public getTopMessages({limit, folderId}: {\n limit: number,\n folderId: number\n }) {\n // const dialogs = this.dialogsStorage.getFolder(folderId);\n const offsetId = 0;\n let offsetPeerId: PeerId;\n let offsetIndex = 0;\n\n let offsetDate = this.dialogsStorage.getOffsetDate(folderId);\n if(offsetDate) {\n offsetIndex = offsetDate * 0x10000;\n offsetDate += this.timeManager.getServerTimeOffset();\n }\n\n const useLimit = 100;\n const middleware = this.middleware.get();\n const peerId = this.dialogsStorage.isFilterIdForForum(folderId) ? folderId : undefined;\n\n const processResult = (result: MessagesDialogs | MessagesForumTopics) => {\n if(!middleware() || result._ === 'messages.dialogsNotModified') return null;\n\n if(DEBUG) {\n this.log('messages.getDialogs result:', result);\n }\n\n // can reset pinned order here\n if(!peerId && !offsetId && !offsetDate && !offsetPeerId && folderId !== GLOBAL_FOLDER_ID) {\n this.dialogsStorage.resetPinnedOrder(folderId);\n }\n\n if(!peerId && !offsetDate) {\n // telegramMeWebManager.setAuthorized(true);\n this.appDraftsManager.addMissedDialogs();\n }\n\n this.appUsersManager.saveApiUsers(result.users);\n this.appChatsManager.saveApiChats(result.chats);\n this.saveMessages(result.messages);\n\n let maxSeenIdIncremented = offsetDate ? true : false;\n let hasPrepend = false;\n const noIdsDialogs: BroadcastEvents['dialogs_multiupdate'] = new Map();\n const setFolderId: REAL_FOLDER_ID = folderId === GLOBAL_FOLDER_ID ? FOLDER_ID_ALL : folderId as REAL_FOLDER_ID;\n const saveGlobalOffset = !!peerId || folderId === GLOBAL_FOLDER_ID;\n const items: Array =\n (result as MessagesDialogs.messagesDialogsSlice).dialogs as Dialog[] ||\n (result as MessagesForumTopics).topics as ForumTopic[];\n forEachReverse(items, (dialog) => {\n if(!dialog) {\n return;\n }\n\n // const d = Object.assign({}, dialog);\n // ! нужно передавать folderId, так как по папке !== 0 нет свойства folder_id\n if(!peerId) {\n (dialog as Dialog).folder_id ??= setFolderId;\n }\n\n this.dialogsStorage.saveDialog({\n dialog,\n ignoreOffsetDate: true,\n saveGlobalOffset\n });\n\n if(dialog.peerId === undefined) {\n this.log.error('bugged dialog?', dialog);\n debugger;\n return;\n }\n\n if(!maxSeenIdIncremented &&\n !this.appPeersManager.isChannel(dialog.peerId || this.appPeersManager.getPeerId(dialog.peer))) {\n this.incrementMaxSeenId(dialog.top_message);\n maxSeenIdIncremented = true;\n }\n\n // if(!folderId && !dialog.folder_id) {\n // this.lolSet.add(dialog.peerId);\n // }\n\n if(offsetIndex && getDialogIndex(dialog) > offsetIndex) {\n this.scheduleHandleNewDialogs(dialog.peerId, dialog);\n hasPrepend = true;\n }\n\n // ! это может случиться, если запрос идёт не по папке 0, а по 1. почему-то read'ов нет\n // ! в итоге, чтобы получить 1 диалог, делается первый запрос по папке 0, потом запрос для архивных по папке 1, и потом ещё перезагрузка архивного диалога\n if(!peerId && !getServerMessageId(dialog.read_inbox_max_id) && !getServerMessageId(dialog.read_outbox_max_id)) {\n noIdsDialogs.set(dialog.peerId, {dialog: dialog as Dialog});\n\n this.log.error('noIdsDialogs', dialog, params);\n } else if(dialog.top_message) { // * fix sending status\n const topMessage = this.getMessageByPeer(dialog.peerId, dialog.top_message);\n if(topMessage) {\n this.setMessageUnreadByDialog(topMessage, dialog);\n this.dialogsStorage.setDialogToState(dialog);\n }\n }\n });\n\n if(noIdsDialogs.size) {\n // setTimeout(() => { // test bad situation\n const peerIds = [...noIdsDialogs.keys()];\n const promises = peerIds.map((peerId) => this.reloadConversation(peerId));\n Promise.all(promises).then(() => {\n this.rootScope.dispatchEvent('dialogs_multiupdate', noIdsDialogs);\n\n for(let i = 0; i < peerIds.length; ++i) {\n const peerId = peerIds[i];\n this.rootScope.dispatchEvent('dialog_unread', {\n peerId,\n dialog: this.getDialogOnly(peerId)\n });\n }\n });\n // }, 10e3);\n }\n\n const count = (result as MessagesDialogs.messagesDialogsSlice).count;\n\n // exclude empty draft dialogs\n const folderDialogs = this.dialogsStorage.getFolderDialogs(folderId, false);\n let dialogsLength = 0;\n for(let i = 0, length = folderDialogs.length; i < length; ++i) {\n const dialog = folderDialogs[i];\n if(getServerMessageId(dialog.top_message)) {\n ++dialogsLength;\n } else {\n this.log.error('something strange with dialog', dialog);\n }\n }\n\n const isEnd = /* limit > dialogsResult.dialogs.length || */\n !count ||\n dialogsLength >= count ||\n !items.length;\n if(isEnd) {\n this.dialogsStorage.setDialogsLoaded(folderId, true);\n }\n\n if(hasPrepend) {\n this.scheduleHandleNewDialogs();\n } else {\n this.rootScope.dispatchEvent('dialogs_multiupdate', new Map());\n }\n\n const dialogs = items;\n const slicedDialogs = limit === useLimit ? dialogs : dialogs.slice(0, limit);\n return {\n isEnd: isEnd && slicedDialogs[slicedDialogs.length - 1] === dialogs[dialogs.length - 1],\n count,\n dialogs: slicedDialogs\n };\n };\n\n let promise: Promise>, params: any;\n if(peerId) {\n promise = this.apiManager.invokeApiSingleProcess({\n method: 'channels.getForumTopics',\n params: params = {\n channel: this.appChatsManager.getChannelInput(peerId.toChatId()),\n limit: useLimit,\n offset_date: offsetDate,\n offset_id: offsetId,\n offset_topic: 0\n },\n options: {\n // timeout: APITIMEOUT,\n noErrorBox: true\n },\n processResult: (result) => {\n result = this.dialogsStorage.processTopics(peerId, result);\n return processResult(result);\n }\n });\n } else {\n // ! ВНИМАНИЕ: ОЧЕНЬ СЛОЖНАЯ ЛОГИКА:\n // ! если делать запрос сначала по папке 0, потом по папке 1, по индексу 0 в массиве будет один и тот же диалог, с dialog.pFlags.pinned, ЛОЛ???\n // ! т.е., с запросом folder_id: 1, и exclude_pinned: 0, в результате будут ещё и закреплённые с папки 0\n promise = this.apiManager.invokeApiSingleProcess({\n method: 'messages.getDialogs',\n params: params = {\n folder_id: folderId,\n offset_date: offsetDate,\n offset_id: offsetId,\n offset_peer: this.appPeersManager.getInputPeerById(offsetPeerId),\n limit: useLimit,\n hash: '0'\n },\n options: {\n // timeout: APITIMEOUT,\n noErrorBox: true\n },\n processResult\n });\n }\n\n return promise;\n }\n\n public async forwardMessages(peerId: PeerId, fromPeerId: PeerId, mids: number[], options: MessageSendingParams & Partial<{\n withMyScore: true,\n dropAuthor: boolean,\n dropCaptions: boolean\n }> = {}) {\n delete options.replyToMsgId;\n delete options.threadId;\n\n peerId = this.appPeersManager.getPeerMigratedTo(peerId) || peerId;\n mids = mids.slice().sort((a, b) => a - b);\n\n for(let i = 0, length = mids.length; i < length; ++i) {\n const mid = mids[i];\n const originalMessage = this.getMessageByPeer(fromPeerId, mid) as Message.message;\n if(originalMessage.pFlags.is_outgoing) { // this can happen when forwarding a changelog\n this.sendText(peerId, originalMessage.message, {\n entities: originalMessage.entities,\n scheduleDate: options.scheduleDate,\n silent: options.silent\n });\n\n mids.splice(i--, 1);\n --length;\n }\n }\n\n if(!mids.length) {\n return Promise.resolve();\n }\n\n const config = await this.apiManager.getConfig();\n const overflowMids = mids.splice(config.forwarded_count_max, mids.length - config.forwarded_count_max);\n\n if(options.dropCaptions) {\n options.dropAuthor = true;\n }\n\n const groups: {\n [groupId: string]: {\n tempId: string,\n messages: Message.message[]\n }\n } = {};\n\n const newMids: number[] = [];\n const newMessages = mids.map((mid) => {\n const originalMessage = this.getMessageByPeer(fromPeerId, mid) as Message.message;\n const message: Message.message = this.generateOutgoingMessage(peerId, options);\n newMids.push(message.id);\n\n const keys: Array = [\n 'entities',\n 'media'\n // 'reply_markup'\n ];\n\n if(!options.dropAuthor) {\n message.fwd_from = this.generateForwardHeader(peerId, originalMessage);\n keys.push('views', 'forwards');\n\n if(message.fwd_from?.from_name && peerId === this.appPeersManager.peerId) {\n delete message.from_id;\n }\n }\n\n if(!options.dropCaptions || !originalMessage.media) {\n keys.push('message');\n }\n\n const replyToMid = originalMessage.reply_to?.reply_to_msg_id;\n const replyToMessageIdx = mids.indexOf(replyToMid);\n if(replyToMid && replyToMessageIdx !== -1) {\n const newReplyToMid = newMids[replyToMessageIdx];\n message.reply_to = {\n _: 'messageReplyHeader',\n reply_to_msg_id: newReplyToMid,\n pFlags: {}\n };\n\n /* this.invokeAfterMessageIsSent(newReplyToMid, 'reply', async(originalMessage) => {\n message.reply_to.reply_to_msg_id = originalMessage.mid;\n }); */\n }\n\n keys.forEach((key) => {\n // @ts-ignore\n message[key] = copy(originalMessage[key]);\n });\n\n const document = (message.media as MessageMedia.messageMediaDocument)?.document as MyDocument;\n if(document) {\n const types: MyDocument['type'][] = ['round', 'voice'];\n if(types.includes(document.type)) {\n (message as MyMessage).pFlags.media_unread = true;\n }\n\n if(document.sticker && !this.rootScope.premium) {\n const effectThumb = getStickerEffectThumb(document);\n if(effectThumb) {\n (message.media as MessageMedia.messageMediaDocument).pFlags.nopremium = true;\n }\n }\n }\n\n if(originalMessage.grouped_id) {\n const group = groups[originalMessage.grouped_id] ??= {tempId: '' + ++this.groupedTempId, messages: []};\n group.messages.push(message);\n }\n\n return message;\n });\n\n for(const groupId in groups) {\n const group = groups[groupId];\n if(group.messages.length > 1) {\n group.messages.forEach((message) => {\n message.grouped_id = group.tempId;\n });\n }\n }\n\n newMessages.forEach((message) => {\n this.beforeMessageSending(message, {\n isScheduled: !!options.scheduleDate || undefined,\n sequential: true\n });\n });\n\n const sentRequestOptions: PendingAfterMsg = {};\n if(this.pendingAfterMsgs[peerId]) {\n sentRequestOptions.afterMessageId = this.pendingAfterMsgs[peerId].messageId;\n }\n\n const promise = /* true ? Promise.resolve() : */this.apiManager.invokeApiAfter('messages.forwardMessages', {\n from_peer: this.appPeersManager.getInputPeerById(fromPeerId),\n id: mids.map((mid) => getServerMessageId(mid)),\n random_id: newMessages.map((message) => message.random_id),\n to_peer: this.appPeersManager.getInputPeerById(peerId),\n with_my_score: options.withMyScore,\n silent: options.silent,\n schedule_date: options.scheduleDate,\n drop_author: options.dropAuthor,\n drop_media_captions: options.dropCaptions,\n send_as: options.sendAsPeerId ? this.appPeersManager.getInputPeerById(options.sendAsPeerId) : undefined\n }, sentRequestOptions).then((updates) => {\n this.log('forwardMessages updates:', updates);\n this.apiUpdatesManager.processUpdateMessage(updates);\n }, (error: ApiError) => {\n this.onMessagesSendError(newMessages, error);\n throw error;\n }).finally(() => {\n if(this.pendingAfterMsgs[peerId] === sentRequestOptions) {\n delete this.pendingAfterMsgs[peerId];\n }\n });\n\n this.pendingAfterMsgs[peerId] = sentRequestOptions;\n\n const promises: (typeof promise)[] = [promise];\n if(overflowMids.length) {\n promises.push(this.forwardMessages(peerId, fromPeerId, overflowMids, options));\n }\n\n return Promise.all(promises).then(noop);\n }\n\n public generateEmptyMessage(mid: number): Message.message | Message.messageService {\n return undefined;\n // return {\n // _: 'messageEmpty',\n // id: getServerMessageId(mid),\n // mid,\n // deleted: true,\n // pFlags: {}\n // };\n }\n\n private onMessagesSendError(messages: Message.message[], error?: ApiError) {\n messages.forEach((message) => {\n if(message.error === error) {\n return;\n }\n\n if(error) {\n message.error = error;\n this.rootScope.dispatchEvent('message_error', {storageKey: message.storageKey, tempId: message.mid, error});\n\n const dialog = this.getDialogOnly(message.peerId);\n if(dialog) {\n this.rootScope.dispatchEvent('dialog_unread', {peerId: message.peerId, dialog});\n }\n } else {\n delete message.error;\n }\n });\n }\n\n public getMessagesStorageByKey(key: MessagesStorageKey) {\n const s = key.split('_');\n const peerId: PeerId = +s[0];\n const type: MessagesStorageType = s[1] as any;\n return type === 'scheduled' ? this.getScheduledMessagesStorage(peerId) : this.getHistoryMessagesStorage(peerId);\n }\n\n public getMessageFromStorage(storage: MessagesStorage | MessagesStorageKey, mid: number) {\n if(typeof(storage) === 'string') {\n storage = this.getMessagesStorageByKey(storage);\n }\n\n return storage && storage.get(mid)/* || this.generateEmptyMessage(mid) */;\n }\n\n private createMessageStorage(peerId: PeerId, type: MessagesStorageType) {\n const storage: MessagesStorage = new Map() as any;\n storage.peerId = peerId;\n storage.type = type;\n storage.key = `${peerId}_${type}`;\n\n /* let num = 0;\n Object.defineProperty(storage, 'num', {\n get: () => ++num,\n set: (_num: number) => num = _num,\n enumerable: false\n });\n\n Object.defineProperty(storage, 'generateIndex', {\n value: (message: any) => {\n if(message.index === undefined) {\n message.index = (message.date * 0x10000) + (storage.num & 0xFFFF);\n }\n },\n enumerable: false\n }); */\n\n return storage;\n }\n\n public getHistoryMessagesStorage(peerId: PeerId) {\n return this.messagesStorageByPeerId[peerId] ??= this.createMessageStorage(peerId, 'history');\n }\n\n public getMessagesStorage(key: MessagesStorageKey | MessagesStorage): MessagesStorage {\n if(typeof(key) === 'object') {\n return key;\n } else {\n return this.getMessagesStorageByKey(key);\n }\n }\n\n public getMessageById(messageId: number) {\n for(const peerId in this.messagesStorageByPeerId) {\n if(this.appPeersManager.isChannel(peerId.toPeerId())) {\n continue;\n }\n\n const message = this.messagesStorageByPeerId[peerId].get(messageId);\n if(message) {\n return message;\n }\n }\n\n return this.getMessageFromStorage(null, messageId);\n }\n\n public getMessageByPeer(peerId: PeerId, messageId: number) {\n if(!peerId) {\n return this.getMessageById(messageId);\n }\n\n return this.getMessageFromStorage(this.getHistoryMessagesStorage(peerId), messageId);\n }\n\n public getMessagePeer(message: any): PeerId {\n const toId = message.peer_id && this.appPeersManager.getPeerId(message.peer_id) || NULL_PEER_ID;\n\n return toId;\n }\n\n public getDialogOnly(peerId: PeerId) {\n return this.dialogsStorage.getDialogOnly(peerId);\n }\n\n public cantForwardDeleteMids(storageKey: MessagesStorageKey, mids: number[]) {\n const storage = this.getMessagesStorage(storageKey);\n let cantForward = !mids.length, cantDelete = !mids.length;\n for(const mid of mids) {\n const message = this.getMessageFromStorage(storage, mid);\n if(!cantForward) {\n cantForward = !this.canForward(message);\n }\n\n if(!cantDelete) {\n cantDelete = !this.canDeleteMessage(message);\n }\n\n if(cantForward && cantDelete) break;\n }\n\n return {cantForward, cantDelete};\n }\n\n public reloadConversationOrTopic(peerId: PeerId, threadId?: number) {\n if(threadId) {\n this.dialogsStorage.getForumTopicById(peerId, threadId);\n } else {\n this.reloadConversation(peerId);\n }\n }\n\n public reloadConversation(inputPeer?: PeerId | InputPeer): CancellablePromise;\n public reloadConversation(inputPeer: PeerId | InputPeer) {\n let promise: CancellablePromise;\n if(inputPeer !== undefined) {\n const peerId = this.appPeersManager.getPeerId(inputPeer);\n this.log.warn('reloadConversation', peerId);\n\n let obj = this.reloadConversationsPeers.get(peerId);\n if(obj) {\n promise = obj.promise;\n }\n\n if(promise) {\n return promise;\n }\n\n promise = deferredPromise();\n this.reloadConversationsPeers.set(peerId, obj = {\n inputDialogPeer: this.appPeersManager.getInputDialogPeerById(inputPeer),\n promise\n });\n }\n\n if(this.reloadConversationsPromise) {\n return promise || this.reloadConversationsPromise;\n }\n\n this.reloadConversationsPromise = pause(0).then(() => {\n const inputDialogPeers: InputDialogPeer[] = [];\n const promises: {[peerId: string]: typeof promise} = {};\n for(const [peerId, {inputDialogPeer, promise}] of this.reloadConversationsPeers) {\n inputDialogPeers.push(inputDialogPeer);\n promises[peerId] = promise;\n }\n\n const fullfillLeft = () => {\n for(const peerId in promises) {\n this.reloadConversationsPeers.delete(+peerId);\n promises[peerId].resolve(undefined);\n }\n };\n\n const invoke = async() => {\n for(;;) {\n const result = await this.apiManager.invokeApi('messages.getPeerDialogs', {peers: inputDialogPeers});\n const currentState = this.apiUpdatesManager.updatesState;\n const {state} = result;\n if(currentState.pts && currentState.pts !== state.pts) {\n await pause(500);\n continue;\n }\n\n return result;\n }\n };\n\n return invoke().then((result) => {\n for(const peerId in promises) {\n this.reloadConversationsPeers.delete(+peerId);\n }\n\n this.dialogsStorage.applyDialogs(result);\n\n result.dialogs.forEach((dialog) => {\n const peerId = dialog.peerId;\n if(peerId) {\n promises[peerId].resolve(dialog as Dialog);\n delete promises[peerId];\n }\n });\n }, noop).then(() => {\n fullfillLeft();\n\n this.reloadConversationsPromise = null;\n if(this.reloadConversationsPeers.size) {\n this.reloadConversation();\n }\n });\n });\n\n return promise || this.reloadConversationsPromise;\n }\n\n private doFlushHistory(peerId: PeerId, just_clear?: boolean, revoke?: boolean, threadId?: number): Promise {\n let promise: Promise;\n const processResult = (affectedHistory: MessagesAffectedHistory) => {\n this.apiUpdatesManager.processUpdateMessage({\n _: 'updateShort',\n update: {\n _: 'updatePts',\n pts: affectedHistory.pts,\n pts_count: affectedHistory.pts_count\n }\n });\n\n if(!affectedHistory.offset) {\n return true;\n }\n\n return this.doFlushHistory(peerId, just_clear, revoke, threadId);\n };\n\n if(!threadId) {\n promise = this.apiManager.invokeApiSingleProcess({\n method: 'messages.deleteHistory',\n params: {\n just_clear,\n revoke,\n peer: this.appPeersManager.getInputPeerById(peerId),\n max_id: 0\n },\n processResult\n });\n } else {\n promise = this.apiManager.invokeApiSingleProcess({\n method: 'channels.deleteTopicHistory',\n params: {\n channel: this.appChatsManager.getChannelInput(peerId.toChatId()),\n top_msg_id: getServerMessageId(threadId)\n },\n processResult\n });\n }\n\n return promise;\n }\n\n public async flushHistory(peerId: PeerId, justClear?: boolean, revoke?: boolean, threadId?: number) {\n if(this.appPeersManager.isChannel(peerId) && !threadId) {\n const promise = this.getHistory(peerId, 0, 1);\n\n const historyResult = await promise;\n\n const channelId = peerId.toChatId();\n const maxId = historyResult.history[0] || 0;\n return this.apiManager.invokeApiSingle('channels.deleteHistory', {\n channel: this.appChatsManager.getChannelInput(channelId),\n max_id: getServerMessageId(maxId)\n }).then((bool) => {\n if(bool) {\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateChannelAvailableMessages',\n channel_id: channelId,\n available_min_id: maxId\n });\n }\n\n return bool;\n });\n }\n\n return this.doFlushHistory(peerId, justClear, revoke, threadId).then(() => {\n if(!threadId) {\n this.flushStoragesByPeerId(peerId);\n }\n\n if(justClear) {\n this.rootScope.dispatchEvent('dialog_flush', {peerId, dialog: this.getDialogOnly(peerId)});\n } else {\n const key = this.getTypingKey(peerId, threadId);\n delete this.notificationsToHandle[key];\n delete this.typings[key];\n\n if(!threadId) {\n const c = this.reloadConversationsPeers.get(peerId);\n if(c) {\n this.reloadConversationsPeers.delete(peerId);\n c.promise.resolve(undefined);\n }\n }\n\n this.dialogsStorage.dropDialogOnDeletion(peerId, threadId);\n }\n });\n }\n\n private flushStoragesByPeerId(peerId: PeerId) {\n [\n this.historiesStorage,\n this.threadsStorage,\n this.searchesStorage,\n this.pendingAfterMsgs,\n this.pendingTopMsgs\n ].forEach((s) => {\n delete s[peerId];\n });\n\n for(const key in this.pinnedMessages) {\n if(+key === peerId || key.startsWith(peerId + '_')) {\n delete this.pinnedMessages[key];\n }\n }\n\n const needSingleMessages = this.needSingleMessages.get(peerId);\n if(needSingleMessages) {\n for(const [mid, promise] of needSingleMessages) {\n promise.resolve(this.generateEmptyMessage(mid));\n }\n\n needSingleMessages.clear();\n }\n\n [\n this.messagesStorageByPeerId,\n this.scheduledMessagesStorage\n ].forEach((s) => {\n const ss = s[peerId];\n if(ss) {\n ss.clear();\n }\n });\n\n this.dialogsStorage.flushForumTopicsCache(peerId);\n }\n\n public hidePinnedMessages(peerId: PeerId) {\n return Promise.all([\n this.appStateManager.getState(),\n this.getPinnedMessage(peerId)\n ])\n .then(([state, pinned]) => {\n state.hiddenPinnedMessages[peerId] = pinned.maxId;\n this.rootScope.dispatchEvent('peer_pinned_hidden', {peerId, maxId: pinned.maxId});\n });\n }\n\n public getPinnedMessagesKey(peerId: PeerId, threadId?: number) {\n return peerId + (threadId ? '_' + threadId : '');\n }\n\n public getPinnedMessage(peerId: PeerId, threadId?: number) {\n const p = this.pinnedMessages[this.getPinnedMessagesKey(peerId, threadId)] ??= {};\n if(p.promise) return p.promise;\n else if(p.maxId) return Promise.resolve(p);\n\n return p.promise = this.getSearch({\n peerId,\n inputFilter: {_: 'inputMessagesFilterPinned'},\n maxId: 0,\n limit: 1,\n threadId\n }).then((result) => {\n p.count = result.count;\n p.maxId = result.history[0]?.mid;\n return p;\n }).finally(() => {\n delete p.promise;\n });\n }\n\n public getPinnedMessagesCount(peerId: PeerId, threadId?: number) {\n return this.pinnedMessages[this.getPinnedMessagesKey(peerId, threadId)]?.count;\n }\n\n public getPinnedMessagesMaxId(peerId: PeerId, threadId?: number) {\n return this.pinnedMessages[this.getPinnedMessagesKey(peerId, threadId)]?.maxId;\n }\n\n public updatePinnedMessage(peerId: PeerId, mid: number, unpin?: boolean, silent?: boolean, pm_oneside?: boolean) {\n return this.apiManager.invokeApi('messages.updatePinnedMessage', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n unpin,\n silent,\n pm_oneside,\n id: getServerMessageId(mid)\n }).then((updates) => {\n // this.log('pinned updates:', updates);\n this.apiUpdatesManager.processUpdateMessage(updates);\n });\n }\n\n public unpinAllMessages(peerId: PeerId): Promise {\n return this.apiManager.invokeApiSingle('messages.unpinAllMessages', {\n peer: this.appPeersManager.getInputPeerById(peerId)\n }).then((affectedHistory) => {\n this.apiUpdatesManager.processUpdateMessage({\n _: 'updateShort',\n update: {\n _: 'updatePts',\n pts: affectedHistory.pts,\n pts_count: affectedHistory.pts_count\n }\n });\n\n if(!affectedHistory.offset) {\n const storage = this.getHistoryMessagesStorage(peerId);\n storage.forEach((message) => {\n if((message as Message.message).pFlags.pinned) {\n delete (message as Message.message).pFlags.pinned;\n }\n });\n\n this.rootScope.dispatchEvent('peer_pinned_messages', {peerId, unpinAll: true});\n delete this.pinnedMessages[this.getPinnedMessagesKey(peerId)];\n\n return true;\n }\n\n return this.unpinAllMessages(peerId);\n });\n }\n\n public getAlbumText(grouped_id: string) {\n const group = this.groupedMessagesStorage[grouped_id];\n return getAlbumText(Array.from(group.values()) as Message.message[]);\n }\n\n public getGroupsFirstMessage(message: Message.message) {\n if(!message?.grouped_id) return message;\n\n const storage = this.groupedMessagesStorage[message.grouped_id];\n let minMid = Number.MAX_SAFE_INTEGER;\n for(const [mid, message] of storage) {\n if(message.mid < minMid) {\n minMid = message.mid;\n }\n }\n\n return this.getMessageFromStorage(storage, minMid) as Message.message;\n }\n\n public getMidsByAlbum(groupedId: string, sort: 'asc' | 'desc' = 'asc') {\n return getObjectKeysAndSort(this.groupedMessagesStorage[groupedId], sort);\n }\n\n public getMessagesByAlbum(groupedId: string) {\n const mids = this.getMidsByAlbum(groupedId, 'asc');\n const storage = this.groupedMessagesStorage[groupedId];\n return mids.map((mid) => this.getMessageFromStorage(storage, mid) as Message.message);\n }\n\n public getMidsByMessage(message: Message) {\n if(!message) return [];\n else if((message as Message.message).grouped_id) return this.getMidsByAlbum((message as Message.message).grouped_id);\n else return [message.mid];\n }\n\n public filterMessages(message: MyMessage, verify: (message: MyMessage) => boolean) {\n const out: MyMessage[] = [];\n if((message as Message.message).grouped_id) {\n const storage = this.groupedMessagesStorage[(message as Message.message).grouped_id];\n for(const [mid, message] of storage) {\n if(verify(message)) {\n out.push(message);\n }\n }\n } else {\n if(verify(message)) {\n out.push(message);\n }\n }\n\n return out;\n }\n\n public generateTempMessageId(peerId: PeerId) {\n const dialog = this.getDialogOnly(peerId);\n return this.appMessagesIdsManager.generateTempMessageId(dialog?.top_message || 0);\n }\n\n public setMessageUnreadByDialog(message: MyMessage, dialog: Dialog | ForumTopic = this.getDialogOnly(message.peerId)) {\n if(dialog && message.mid) {\n if(message.mid > dialog[message.pFlags.out ?\n 'read_outbox_max_id' :\n 'read_inbox_max_id']) {\n message.pFlags.unread = true;\n }\n }\n }\n\n public saveMessage(message: Message, options: Partial<{\n storage: MessagesStorage,\n isScheduled: true,\n isOutgoing: true,\n // isNew: boolean, // * new - from update\n }> = {}) {\n if(!message || message._ === 'messageEmpty') {\n return;\n }\n\n message.pFlags ??= {};\n\n // * exclude from state\n // defineNotNumerableProperties(message, ['rReply', 'mid', 'savedFrom', 'fwdFromId', 'fromId', 'peerId', 'reply_to_mid', 'viaBotId']);\n\n const peerId = this.getMessagePeer(message);\n const storage = options.storage || this.getHistoryMessagesStorage(peerId);\n const isChannel = message.peer_id._ === 'peerChannel';\n const isBroadcast = isChannel && this.appChatsManager.isBroadcast(peerId.toChatId());\n const isMessage = message._ === 'message';\n\n if(options.isOutgoing) {\n message.pFlags.is_outgoing = true;\n }\n\n const mid = generateMessageId(message.id);\n message.mid = mid;\n\n if(isMessage) {\n if(options.isScheduled) {\n message.pFlags.is_scheduled = true;\n }\n\n if(message.grouped_id) {\n const storage = this.groupedMessagesStorage[message.grouped_id] ??= this.createMessageStorage(peerId, 'grouped');\n storage.set(mid, message);\n }\n\n if(message.via_bot_id) {\n // ! WARNING\n message.viaBotId = message.via_bot_id as any;\n }\n }\n\n // this.log(dT(), 'msg unread', mid, apiMessage.pFlags.out, dialog && dialog[apiMessage.pFlags.out ? 'read_outbox_max_id' : 'read_inbox_max_id'])\n\n const replyTo = message.reply_to;\n if(replyTo) {\n if(replyTo.reply_to_msg_id) {\n replyTo.reply_to_msg_id = message.reply_to_mid = generateMessageId(replyTo.reply_to_msg_id);\n }\n\n if(replyTo.reply_to_top_id) {\n replyTo.reply_to_top_id = generateMessageId(replyTo.reply_to_top_id);\n }\n }\n\n const replies = isMessage && message.replies;\n if(replies) {\n if(replies.max_id) replies.max_id = generateMessageId(replies.max_id);\n if(replies.read_max_id) replies.read_max_id = generateMessageId(replies.read_max_id);\n }\n\n const overwriting = !!peerId;\n if(!overwriting) {\n message.date -= this.timeManager.getServerTimeOffset();\n }\n\n // storage.generateIndex(message);\n const myId = this.appPeersManager.peerId;\n\n const fwdHeader = isMessage && (message as Message.message).fwd_from;\n\n message.peerId = peerId;\n if(peerId === myId/* && !message.from_id && !message.fwd_from */) {\n message.fromId = fwdHeader ? (fwdHeader.from_id ? this.appPeersManager.getPeerId(fwdHeader.from_id) : NULL_PEER_ID) : myId;\n } else {\n // message.fromId = message.pFlags.post || (!message.pFlags.out && !message.from_id) ? peerId : appPeersManager.getPeerId(message.from_id);\n message.fromId = message.pFlags.post || !message.from_id ? peerId : this.appPeersManager.getPeerId(message.from_id);\n }\n\n this.setMessageUnreadByDialog(message);\n\n if(fwdHeader) {\n // if(peerId === myID) {\n if(fwdHeader.saved_from_msg_id) fwdHeader.saved_from_msg_id = generateMessageId(fwdHeader.saved_from_msg_id);\n if(fwdHeader.channel_post) fwdHeader.channel_post = generateMessageId(fwdHeader.channel_post);\n\n const peer = fwdHeader.saved_from_peer || fwdHeader.from_id;\n const msgId = fwdHeader.saved_from_msg_id || fwdHeader.channel_post;\n if(peer && msgId) {\n const savedFromPeerId = this.appPeersManager.getPeerId(peer);\n const savedFromMid = generateMessageId(msgId);\n message.savedFrom = savedFromPeerId + '_' + savedFromMid;\n }\n\n /* if(peerId.isAnyChat() || peerId === myID) {\n message.fromId = appPeersManager.getPeerID(!message.from_id || deepEqual(message.from_id, fwdHeader.from_id) ? fwdHeader.from_id : message.from_id);\n } */\n /* } else {\n apiMessage.fwdPostID = fwdHeader.channel_post;\n } */\n\n message.fwdFromId = this.appPeersManager.getPeerId(fwdHeader.from_id);\n\n if(!overwriting) {\n fwdHeader.date -= this.timeManager.getServerTimeOffset();\n }\n }\n\n const mediaContext: ReferenceContext = {\n type: 'message',\n peerId,\n messageId: mid\n };\n\n /* if(isMessage) {\n const entities = message.entities;\n if(entities && entities.find((entity) => entity._ === 'messageEntitySpoiler')) {\n message.media = {_: 'messageMediaUnsupported'};\n }\n } */\n\n let unsupported = false;\n const media = isMessage && message.media;\n if(media) {\n switch(media._) {\n case 'messageMediaEmpty': {\n delete message.media;\n break;\n }\n\n case 'messageMediaPhoto': {\n if(media.ttl_seconds) {\n unsupported = true;\n } else {\n media.photo = this.appPhotosManager.savePhoto(media.photo, mediaContext);\n }\n\n if(!(media as MessageMedia.messageMediaPhoto).photo) { // * found this bug on test DC\n delete message.media;\n }\n\n break;\n }\n\n case 'messageMediaPoll': {\n const result = this.appPollsManager.savePoll(media.poll, media.results, message);\n media.poll = result.poll;\n media.results = result.results;\n break;\n }\n\n case 'messageMediaDocument': {\n if(media.ttl_seconds) {\n unsupported = true;\n } else {\n const originalDoc = media.document;\n media.document = this.appDocsManager.saveDoc(originalDoc, mediaContext); // 11.04.2020 warning\n\n if(!media.document && originalDoc._ !== 'documentEmpty') {\n unsupported = true;\n }\n }\n\n break;\n }\n\n case 'messageMediaWebPage': {\n const messageKey = this.appWebPagesManager.getMessageKeyForPendingWebPage(peerId, mid, options.isScheduled);\n media.webpage = this.appWebPagesManager.saveWebPage(media.webpage, messageKey, mediaContext);\n\n if(!media.webpage) {\n delete message.media;\n }\n\n break;\n }\n\n /* case 'messageMediaGame':\n AppGamesManager.saveGame(apiMessage.media.game, apiMessage.mid, mediaContext);\n apiMessage.media.handleMessage = true;\n break; */\n\n case 'messageMediaInvoice': {\n media.photo = this.appWebDocsManager.saveWebDocument(media.photo);\n const extendedMedia = media.extended_media;\n if(extendedMedia?._ === 'messageExtendedMedia') {\n const extendedMediaMedia = extendedMedia.media;\n (extendedMediaMedia as MessageMedia.messageMediaPhoto).photo = this.appPhotosManager.savePhoto((extendedMediaMedia as MessageMedia.messageMediaPhoto).photo, mediaContext);\n (extendedMediaMedia as MessageMedia.messageMediaDocument).document = this.appDocsManager.saveDoc((extendedMediaMedia as MessageMedia.messageMediaDocument).document, mediaContext);\n }\n break;\n }\n\n case 'messageMediaUnsupported': {\n unsupported = true;\n break;\n }\n }\n }\n\n // if(isMessage && !unsupported && message.entities) {\n // unsupported = message.entities.some((entity) => entity._ === 'messageEntityCustomEmoji');\n // }\n\n if(isMessage && unsupported) {\n message.media = {_: 'messageMediaUnsupported'};\n message.message = '';\n delete message.entities;\n delete message.totalEntities;\n }\n\n if(!isMessage && message.action) {\n const action = message.action as MessageAction;\n const suffix = message.fromId === this.appUsersManager.getSelf().id ? 'You' : '';\n let migrateFrom: PeerId, migrateTo: PeerId;\n\n if((action as MessageAction.messageActionChatEditPhoto).photo) {\n (action as MessageAction.messageActionChatEditPhoto).photo = this.appPhotosManager.savePhoto((action as MessageAction.messageActionChatEditPhoto).photo, mediaContext);\n }\n\n if((action as any).document) {\n (action as any).document = this.appDocsManager.saveDoc((action as any).photo, mediaContext);\n }\n\n switch(action._) {\n // case 'messageActionChannelEditPhoto':\n case 'messageActionChatEditPhoto':\n // action.photo = appPhotosManager.savePhoto(action.photo, mediaContext);\n if((action.photo as Photo.photo)?.video_sizes) {\n // @ts-ignore\n action._ = isBroadcast ? 'messageActionChannelEditVideo' : 'messageActionChatEditVideo';\n } else {\n if(isBroadcast) { // ! messageActionChannelEditPhoto не существует в принципе, это используется для перевода.\n // @ts-ignore\n action._ = 'messageActionChannelEditPhoto';\n }\n }\n break;\n\n case 'messageActionGroupCall': {\n // assumeType(action);\n\n this.appGroupCallsManager.saveGroupCall(action.call);\n\n let type: string;\n if(action.duration === undefined) {\n type = 'started';\n } else {\n type = 'ended'\n }\n\n if(!isBroadcast) {\n type += '_by' + suffix;\n }\n\n // @ts-ignore\n action.type = type;\n\n break;\n }\n\n case 'messageActionChatEditTitle':\n /* if(options.isNew) {\n const chat = appChatsManager.getChat(peerId.toChatId());\n chat.title = action.title;\n appChatsManager.saveApiChat(chat, true);\n } */\n\n if(isBroadcast) {\n // @ts-ignore\n action._ = 'messageActionChannelEditTitle';\n }\n break;\n\n case 'messageActionChatDeletePhoto':\n if(isBroadcast) {\n // @ts-ignore\n action._ = 'messageActionChannelDeletePhoto';\n }\n break;\n\n case 'messageActionChatAddUser':\n if(action.users.length === 1) {\n // @ts-ignore\n action.user_id = action.users[0];\n // @ts-ignore\n if(message.fromId === action.user_id) {\n if(isChannel) {\n // @ts-ignore\n action._ = 'messageActionChatJoined' + suffix;\n } else {\n // @ts-ignore\n action._ = 'messageActionChatReturn' + suffix;\n }\n }\n } else if(action.users.length > 1) {\n // @ts-ignore\n action._ = 'messageActionChatAddUsers';\n }\n break;\n\n case 'messageActionChatDeleteUser':\n if(message.fromId === action.user_id) {\n // @ts-ignore\n action._ = 'messageActionChatLeave' + suffix;\n }\n break;\n\n case 'messageActionChannelMigrateFrom':\n migrateFrom = action.chat_id.toPeerId(true);\n migrateTo = peerId;\n break\n\n case 'messageActionChatMigrateTo':\n migrateFrom = peerId;\n migrateTo = action.channel_id.toPeerId(true);\n break;\n\n case 'messageActionHistoryClear':\n // apiMessage.deleted = true;\n message.clear_history = true;\n delete message.pFlags.out;\n delete message.pFlags.unread;\n break;\n\n case 'messageActionPhoneCall':\n // @ts-ignore\n action.type =\n (action.pFlags.video ? 'video_' : '') +\n (action.duration !== undefined ? (message.pFlags.out ? 'out_' : 'in_') : '') +\n (\n action.duration !== undefined ? 'ok' : (\n action.reason._ === 'phoneCallDiscardReasonMissed' ?\n 'missed' :\n 'cancelled'\n )\n );\n break;\n }\n\n if(migrateFrom &&\n migrateTo &&\n !this.migratedFromTo[migrateFrom] &&\n !this.migratedToFrom[migrateTo]) {\n this.migrateChecks(migrateFrom, migrateTo);\n }\n }\n\n /* if(message.grouped_id) {\n if(!groups) {\n groups = new Set();\n }\n\n groups.add(message.grouped_id);\n } else {\n message.rReply = this.getRichReplyText(message);\n } */\n\n if(isMessage && message.message.length && !message.totalEntities) {\n this.wrapMessageEntities(message);\n }\n\n storage.set(mid, message);\n\n return message;\n }\n\n public saveMessages(messages: any[], options: Partial<{\n storage: MessagesStorage,\n isScheduled: true,\n isOutgoing: true,\n // isNew: boolean, // * new - from update\n }> = {}): (Message.message | Message.messageService)[] {\n if((messages as any).saved) return messages;\n (messages as any).saved = true;\n messages.forEach((message, idx, arr) => {\n arr[idx] = this.saveMessage(message, options);\n });\n\n return messages;\n }\n\n public async getFirstMessageToEdit(peerId: PeerId, threadId?: number) {\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n const slice = historyStorage.history.slice;\n if(slice.isEnd(SliceEnd.Bottom) && slice.length) {\n let goodMessage: Message.message | Message.messageService;\n const myPeerId = this.appPeersManager.peerId;\n for(const mid of slice) {\n const message = this.getMessageByPeer(peerId, mid);\n const good = myPeerId === peerId ? message.fromId === myPeerId : message.pFlags.out;\n\n if(good) {\n if(await this.canEditMessage(message, 'text')) {\n goodMessage = message;\n break;\n }\n\n // * this check will allow editing only last message\n // break;\n }\n }\n\n return goodMessage;\n }\n }\n\n private wrapMessageEntities(message: Message.message) {\n const apiEntities = message.entities ? message.entities.slice() : [];\n message.message = fixEmoji(message.message, apiEntities);\n\n const myEntities = parseEntities(message.message);\n message.totalEntities = mergeEntities(apiEntities, myEntities); // ! only in this order, otherwise bold and emoji formatting won't work\n }\n\n public reportMessages(peerId: PeerId, mids: number[], reason: ReportReason['_'], message?: string) {\n return this.apiManager.invokeApiSingle('messages.report', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n id: mids.map((mid) => getServerMessageId(mid)),\n reason: {\n _: reason\n },\n message\n });\n }\n\n public startBot(botId: BotId, chatId?: ChatId, startParam?: string) {\n const peerId = chatId ? chatId.toPeerId(true) : botId.toPeerId();\n if(startParam) {\n const randomId = randomLong();\n\n return this.apiManager.invokeApi('messages.startBot', {\n bot: this.appUsersManager.getUserInput(botId),\n peer: this.appPeersManager.getInputPeerById(peerId),\n random_id: randomId,\n start_param: startParam\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n });\n }\n\n const str = '/start';\n if(chatId) {\n let promise: Promise;\n if(this.appChatsManager.isChannel(chatId)) {\n promise = this.appChatsManager.inviteToChannel(chatId, [botId]);\n } else {\n promise = this.appChatsManager.addChatUser(chatId, botId, 0);\n }\n\n return promise.catch((error: ApiError) => {\n if(error?.type == 'USER_ALREADY_PARTICIPANT') {\n error.handled = true;\n return;\n }\n\n throw error;\n }).then(() => {\n return this.sendText(peerId, str + '@' + this.appPeersManager.getPeerUsername(botId.toPeerId()));\n });\n }\n\n return this.sendText(peerId, str);\n }\n\n public editPeerFolders(peerIds: PeerId[], folderId: number) {\n this.apiManager.invokeApi('folders.editPeerFolders', {\n folder_peers: peerIds.map((peerId) => {\n return {\n _: 'inputFolderPeer',\n peer: this.appPeersManager.getInputPeerById(peerId),\n folder_id: folderId\n };\n })\n }).then((updates) => {\n // this.log('editPeerFolders updates:', updates);\n this.apiUpdatesManager.processUpdateMessage(updates); // WARNING! возможно тут нужно добавлять channelId, и вызывать апдейт для каждого канала отдельно\n });\n }\n\n public getFilter(filterId: number) {\n return this.filtersStorage.getFilter(filterId);\n }\n\n public async toggleDialogPin(options: {\n peerId: PeerId,\n filterId?: number,\n topicId?: number\n }) {\n const {peerId, topicId, filterId = topicId ? peerId : undefined} = options;\n if(filterId === undefined) {\n throw new Error('No filterId');\n }\n\n if(filterId > 1) {\n return this.filtersStorage.toggleDialogPin(peerId, filterId);\n }\n\n const dialog = this.dialogsStorage.getDialogOrTopic(peerId, topicId);\n if(!dialog) throw undefined;\n\n const pinned = dialog.pFlags?.pinned ? undefined : true;\n\n if(pinned) {\n const max = await this.apiManager.getLimit(topicId ? 'topicPin' : (filterId === 1 ? 'folderPin' : 'pin'));\n if(this.dialogsStorage.getPinnedOrders(filterId).length >= max) {\n throw makeError(topicId ? 'PINNED_TOO_MUCH' : 'PINNED_DIALOGS_TOO_MUCH');\n }\n }\n\n if(topicId) {\n return this.appChatsManager.updatePinnedForumTopic(peerId.toChatId(), topicId, pinned);\n }\n\n return this.apiManager.invokeApi('messages.toggleDialogPin', {\n peer: this.appPeersManager.getInputDialogPeerById(peerId),\n pinned\n }).then((bool) => {\n const pFlags: Update.updateDialogPinned['pFlags'] = pinned ? {pinned} : {};\n this.apiUpdatesManager.saveUpdate({\n _: 'updateDialogPinned',\n peer: this.appPeersManager.getDialogPeer(peerId),\n folder_id: filterId,\n pFlags\n });\n });\n }\n\n public markDialogUnread(peerId: PeerId, read?: true) {\n const dialog = this.getDialogOnly(peerId);\n if(!dialog) return Promise.reject();\n\n const unread = read || dialog.pFlags?.unread_mark ? undefined : true;\n return this.apiManager.invokeApi('messages.markDialogUnread', {\n peer: this.appPeersManager.getInputDialogPeerById(peerId),\n unread\n }).then((bool) => {\n if(bool) {\n const pFlags: Update.updateDialogUnreadMark['pFlags'] = unread ? {unread} : {};\n this.onUpdateDialogUnreadMark({\n _: 'updateDialogUnreadMark',\n peer: this.appPeersManager.getDialogPeer(peerId),\n pFlags\n });\n }\n });\n }\n\n public migrateChecks(migrateFrom: PeerId, migrateTo: PeerId) {\n if(!this.migratedFromTo[migrateFrom] &&\n !this.migratedToFrom[migrateTo] &&\n this.appChatsManager.hasChat(migrateTo.toChatId())) {\n const fromChat = this.appChatsManager.getChat(migrateFrom.toChatId()) as Chat.chat;\n if(fromChat?.migrated_to && (fromChat.migrated_to as InputChannel.inputChannel).channel_id === migrateTo.toChatId()) {\n this.migratedFromTo[migrateFrom] = migrateTo;\n this.migratedToFrom[migrateTo] = migrateFrom;\n\n this.rootScope.dispatchEvent('dialog_migrate', {migrateFrom, migrateTo});\n\n this.dialogsStorage.dropDialogWithEvent(migrateFrom);\n }\n }\n }\n\n private canMessageBeEdited(message: Message, kind: 'text' | 'poll') {\n if((message as Message.message)?.pFlags?.is_outgoing) {\n return false;\n }\n\n const goodMedias = [\n 'messageMediaPhoto',\n 'messageMediaDocument',\n 'messageMediaWebPage'\n ];\n\n if(kind === 'poll') {\n goodMedias.push('messageMediaPoll');\n }\n\n if(!message ||\n message._ !== 'message' ||\n message.deleted ||\n message.fwd_from ||\n message.via_bot_id ||\n message.media && goodMedias.indexOf(message.media._) === -1 ||\n message.fromId && this.appUsersManager.isBot(message.fromId)) {\n return false;\n }\n\n if(message.media?._ === 'messageMediaDocument' &&\n ((message.media.document as Document.document).sticker || (message.media.document as Document.document).type === 'round')) {\n return false;\n }\n\n return true;\n }\n\n public async canEditMessage(message: Message.message | Message.messageService, kind: 'text' | 'poll' = 'text') {\n if(!message || !this.canMessageBeEdited(message, kind)) {\n return false;\n }\n\n // * second rule for saved messages, because there is no 'out' flag\n if(/* message.pFlags.out || */this.getMessagePeer(message) === this.appUsersManager.getSelf().id) {\n return true;\n }\n\n const {peerId} = message;\n\n const canEditMessageInPeer = this.appPeersManager.isBroadcast(peerId) ?\n this.appChatsManager.hasRights(peerId.toChatId(), 'edit_messages') :\n (\n peerId.isAnyChat() && kind === 'text' ?\n this.appChatsManager.hasRights(peerId.toChatId(), 'send_plain') || this.appChatsManager.hasRights(peerId.toChatId(), 'send_media') :\n true\n ) && message.pFlags.out;\n\n if(\n !canEditMessageInPeer || (\n message.peer_id._ !== 'peerChannel' &&\n message.date < (tsNow(true) - (await this.apiManager.getConfig()).edit_time_limit) &&\n (message as Message.message).media?._ !== 'messageMediaPoll'\n )\n ) {\n return false;\n }\n\n return true;\n }\n\n public canDeleteMessage(message: MyMessage) {\n return message && (\n message.peerId.isUser() ||\n message.pFlags.out ||\n this.appChatsManager.getChat(message.peerId.toChatId())._ === 'chat' ||\n this.appChatsManager.hasRights(message.peerId.toChatId(), 'delete_messages')\n ) && (!message.pFlags.is_outgoing || !!message.error);\n }\n\n public getReplyKeyboard(peerId: PeerId) {\n return this.getHistoryStorage(peerId).replyMarkup;\n }\n\n public mergeReplyKeyboard(historyStorage: HistoryStorage, message: Message.messageService | Message.message) {\n // this.log('merge', message.mid, message.reply_markup, historyStorage.reply_markup)\n if(!message) {\n return false;\n }\n\n const messageReplyMarkup = (message as Message.message).reply_markup;\n if(!messageReplyMarkup &&\n !message.pFlags?.out &&\n !(message as Message.messageService).action) {\n return false;\n }\n\n if(messageReplyMarkup?._ === 'replyInlineMarkup') {\n return false;\n }\n\n const lastReplyMarkup = historyStorage.replyMarkup;\n if(messageReplyMarkup) {\n if(lastReplyMarkup && lastReplyMarkup.mid >= message.mid) {\n return false;\n }\n\n if(messageReplyMarkup.pFlags.selective) {\n return false;\n }\n\n if(historyStorage.maxOutId &&\n message.mid < historyStorage.maxOutId &&\n (messageReplyMarkup as ReplyMarkup.replyKeyboardMarkup | ReplyMarkup.replyKeyboardForceReply).pFlags.single_use) {\n (messageReplyMarkup as ReplyMarkup.replyKeyboardMarkup | ReplyMarkup.replyKeyboardForceReply).pFlags.hidden = true;\n }\n\n messageReplyMarkup.mid = message.mid;\n /* messageReplyMarkup = Object.assign({\n mid: message.mid\n }, messageReplyMarkup); */\n\n if(messageReplyMarkup._ !== 'replyKeyboardHide') {\n messageReplyMarkup.fromId = this.appPeersManager.getPeerId(message.from_id);\n }\n\n historyStorage.replyMarkup = messageReplyMarkup;\n // this.log('set', historyStorage.reply_markup)\n return true;\n }\n\n if(message.pFlags.out) {\n if(lastReplyMarkup) {\n assumeType(lastReplyMarkup);\n if(lastReplyMarkup.pFlags.single_use &&\n !lastReplyMarkup.pFlags.hidden &&\n (message.mid > lastReplyMarkup.mid || message.pFlags.is_outgoing) &&\n (message as Message.message).message) {\n lastReplyMarkup.pFlags.hidden = true;\n // this.log('set', historyStorage.reply_markup)\n return true;\n }\n } else if(!historyStorage.maxOutId ||\n message.mid > historyStorage.maxOutId) {\n historyStorage.maxOutId = message.mid;\n }\n }\n\n assumeType(message);\n if(message.action?._ === 'messageActionChatDeleteUser' &&\n (lastReplyMarkup ?\n message.action.user_id === (lastReplyMarkup as ReplyMarkup.replyKeyboardMarkup).fromId :\n this.appUsersManager.isBot(message.action.user_id)\n )\n ) {\n historyStorage.replyMarkup = {\n _: 'replyKeyboardHide',\n mid: message.mid,\n pFlags: {}\n };\n // this.log('set', historyStorage.reply_markup)\n return true;\n }\n\n return false;\n }\n\n public getSearchStorage(peerId: PeerId, inputFilter: MyInputMessagesFilter) {\n if(!this.searchesStorage[peerId]) this.searchesStorage[peerId] = {};\n if(!this.searchesStorage[peerId][inputFilter]) this.searchesStorage[peerId][inputFilter] = {history: []};\n return this.searchesStorage[peerId][inputFilter];\n }\n\n public getSearchCounters(\n peerId: PeerId,\n filters: MessagesFilter[],\n canCache = true,\n threadId?: number\n ): Promise {\n if(this.appPeersManager.isPeerRestricted(peerId)) {\n return Promise.resolve(filters.map((filter) => {\n return {\n _: 'messages.searchCounter',\n pFlags: {},\n filter: filter,\n count: 0\n };\n }));\n }\n\n const func = (canCache ? this.apiManager.invokeApiCacheable : this.apiManager.invokeApi).bind(this.apiManager);\n return func('messages.getSearchCounters', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n filters,\n top_msg_id: threadId ? getServerMessageId(threadId) : undefined\n });\n }\n\n public filterMessagesByInputFilterFromStorage(inputFilter: MyInputMessagesFilter, history: number[], storage: MessagesStorage | MessagesStorageKey, limit: number) {\n const _storage = this.getMessagesStorage(storage);\n return filterMessagesByInputFilter(inputFilter, history.map((mid) => _storage.get(mid)), limit);\n }\n\n public getSearch({peerId, query, inputFilter, maxId, limit, nextRate, backLimit, threadId, folderId, minDate, maxDate}: {\n peerId?: PeerId,\n maxId?: number,\n limit?: number,\n nextRate?: number,\n backLimit?: number,\n threadId?: number,\n folderId?: number,\n query?: string,\n inputFilter?: {\n _: MyInputMessagesFilter\n },\n minDate?: number,\n maxDate?: number\n }): Promise<{\n count: number,\n next_rate: number,\n offset_id_offset: number,\n history: MyMessage[]\n }> {\n if(this.appPeersManager.isPeerRestricted(peerId)/* || true */) {\n return Promise.resolve({\n count: 0,\n offset_id_offset: 0,\n next_rate: undefined,\n history: []\n });\n }\n\n if(!query) query = '';\n if(!inputFilter) inputFilter = {_: 'inputMessagesFilterEmpty'};\n if(limit === undefined) limit = 20;\n if(!nextRate) nextRate = 0;\n if(!backLimit) backLimit = 0;\n\n minDate = minDate ? minDate / 1000 | 0 : 0;\n maxDate = maxDate ? maxDate / 1000 | 0 : 0;\n\n let foundMsgs: MyMessage[] = [];\n\n // this.log('search', maxId);\n\n if(backLimit) {\n limit += backLimit;\n }\n\n // const beta = inputFilter._ === 'inputMessagesFilterPinned' && !backLimit;\n const beta = false;\n\n let storage: {\n count?: number;\n history: SlicedArray;\n };\n\n // * костыль для limit 1, если нужно и получить сообщение, и узнать количество сообщений\n if(peerId && !backLimit && !maxId && !query && limit !== 1 && !threadId/* && inputFilter._ !== 'inputMessagesFilterPinned' */) {\n storage = beta ?\n this.getSearchStorage(peerId, inputFilter._) as any :\n this.getHistoryStorage(peerId);\n foundMsgs = this.filterMessagesByInputFilterFromStorage(inputFilter._, storage.history.slice, this.getHistoryMessagesStorage(peerId), limit);\n }\n\n if(foundMsgs.length) {\n if(foundMsgs.length < limit && (beta ? storage.count !== storage.history.length : true)) {\n maxId = foundMsgs[foundMsgs.length - 1].mid;\n limit = limit - foundMsgs.length;\n } else {\n return Promise.resolve({\n count: beta ? storage.count : 0,\n next_rate: 0,\n offset_id_offset: 0,\n history: foundMsgs\n });\n }\n } else if(beta && storage?.count) {\n return Promise.resolve({\n count: storage.count,\n next_rate: 0,\n offset_id_offset: 0,\n history: []\n });\n }\n\n const canCache = false && (['inputMessagesFilterChatPhotos', 'inputMessagesFilterPinned'] as MyInputMessagesFilter[]).includes(inputFilter._);\n const method = (canCache ? this.apiManager.invokeApiCacheable : this.apiManager.invokeApi).bind(this.apiManager);\n\n let apiPromise: Promise;\n if(peerId && !nextRate && folderId === undefined/* || !query */) {\n apiPromise = method('messages.search', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n q: query || '',\n filter: inputFilter as any as MessagesFilter,\n min_date: minDate,\n max_date: maxDate,\n limit,\n offset_id: getServerMessageId(maxId) || 0,\n add_offset: backLimit ? -backLimit : 0,\n max_id: 0,\n min_id: 0,\n hash: '',\n top_msg_id: getServerMessageId(threadId) || 0\n }, {\n // timeout: APITIMEOUT,\n noErrorBox: true\n });\n } else {\n // var offsetDate = 0;\n let offsetPeerId: PeerId;\n let offsetId = 0;\n const offsetMessage = maxId && this.getMessageByPeer(peerId, maxId);\n\n if(offsetMessage && offsetMessage.date) {\n // offsetDate = offsetMessage.date + timeManager.getServerTimeOffset();\n offsetId = offsetMessage.id;\n offsetPeerId = this.getMessagePeer(offsetMessage);\n }\n\n apiPromise = method('messages.searchGlobal', {\n q: query,\n filter: inputFilter as any as MessagesFilter,\n min_date: minDate,\n max_date: maxDate,\n offset_rate: nextRate,\n offset_peer: this.appPeersManager.getInputPeerById(offsetPeerId),\n offset_id: offsetId,\n limit,\n folder_id: folderId\n }, {\n // timeout: APITIMEOUT,\n noErrorBox: true\n });\n }\n\n return apiPromise.then((searchResult: any) => {\n this.appUsersManager.saveApiUsers(searchResult.users);\n this.appChatsManager.saveApiChats(searchResult.chats);\n this.saveMessages(searchResult.messages);\n\n /* if(beta && storage && (!maxId || storage.history[storage.history.length - 1] === maxId)) {\n const storage = this.getSearchStorage(peerId, inputFilter._);\n const add = (searchResult.messages.map((m: any) => m.mid) as number[]).filter((mid) => storage.history.indexOf(mid) === -1);\n storage.history.push(...add);\n storage.history.sort((a, b) => b - a);\n storage.count = searchResult.count;\n } */\n\n if(DEBUG) {\n this.log('getSearch result:', inputFilter, searchResult);\n }\n\n const foundCount: number = searchResult.count || (foundMsgs.length + searchResult.messages.length);\n\n searchResult.messages.forEach((message: MyMessage) => {\n const peerId = this.getMessagePeer(message);\n if(peerId.isAnyChat()) {\n const chat = this.appChatsManager.getChat(peerId.toChatId()) as Chat.chat;\n if(chat.migrated_to) {\n this.migrateChecks(peerId, (chat.migrated_to as InputChannel.inputChannel).channel_id.toPeerId(true));\n }\n }\n\n foundMsgs.push(message);\n });\n\n return {\n count: foundCount,\n offset_id_offset: searchResult.offset_id_offset || 0,\n next_rate: searchResult.next_rate,\n history: foundMsgs\n };\n });\n }\n\n public subscribeRepliesThread(peerId: PeerId, mid: number) {\n const repliesKey = peerId + '_' + mid;\n for(const threadKey in this.threadsToReplies) {\n if(this.threadsToReplies[threadKey] === repliesKey) return;\n }\n\n this.getDiscussionMessage(peerId, mid);\n }\n\n public generateThreadServiceStartMessage(message: Message.message | Message.messageService) {\n const threadKey = message.peerId + '_' + message.mid;\n if(this.threadsServiceMessagesIdsStorage[threadKey]) return;\n\n const maxMessageId = getServerMessageId(Math.max(...this.getMidsByMessage(message)));\n const serviceStartMessage: Message.messageService = {\n _: 'messageService',\n pFlags: {\n is_single: true\n },\n id: this.appMessagesIdsManager.generateTempMessageId(maxMessageId),\n date: message.date,\n from_id: {_: 'peerUser', user_id: NULL_PEER_ID}/* message.from_id */,\n peer_id: message.peer_id,\n action: {\n _: 'messageActionDiscussionStarted'\n },\n reply_to: this.generateReplyHeader(message.peerId, message.id)\n };\n\n this.saveMessages([serviceStartMessage], {isOutgoing: true});\n this.threadsServiceMessagesIdsStorage[threadKey] = serviceStartMessage.mid;\n }\n\n public getThreadServiceMessageId(peerId: PeerId, threadId: number) {\n return this.threadsServiceMessagesIdsStorage[peerId + '_' + threadId];\n }\n\n public getDiscussionMessage(peerId: PeerId, mid: number) {\n return this.apiManager.invokeApiSingle('messages.getDiscussionMessage', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n msg_id: getServerMessageId(mid)\n }).then((result) => {\n this.appChatsManager.saveApiChats(result.chats);\n this.appUsersManager.saveApiUsers(result.users);\n this.saveMessages(result.messages);\n\n const message = this.getMessageWithReplies(result.messages[0] as Message.message);\n const threadKey = message.peerId + '_' + message.mid;\n\n this.generateThreadServiceStartMessage(message);\n\n const historyStorage = this.getHistoryStorage(message.peerId, message.mid);\n const newMaxId = result.max_id = generateMessageId(result.max_id) || 0;\n result.read_inbox_max_id = historyStorage.readMaxId = generateMessageId(result.read_inbox_max_id ?? message.mid);\n result.read_outbox_max_id = historyStorage.readOutboxMaxId = generateMessageId(result.read_outbox_max_id) || 0;\n\n const first = historyStorage.history.first;\n if(historyStorage.maxId && historyStorage.maxId < newMaxId && first.isEnd(SliceEnd.Bottom)) {\n first.unsetEnd(SliceEnd.Bottom);\n }\n historyStorage.maxId = newMaxId;\n\n this.threadsToReplies[threadKey] = peerId + '_' + mid;\n\n return message;\n });\n }\n\n private handleNewMessage(message: MyMessage) {\n this.rootScope.dispatchEvent('history_multiappend', message);\n }\n\n private handleNewDialogs = () => {\n let newMaxSeenId = 0;\n const updateMap: BroadcastEvents['dialogs_multiupdate']= new Map();\n\n const processDialog = (dialog: MTDialog.dialog | ForumTopic) => {\n const {peerId} = dialog;\n this.dialogsStorage.pushDialog({dialog});\n if(!this.appPeersManager.isChannel(peerId)) {\n newMaxSeenId = Math.max(newMaxSeenId, dialog.top_message || 0);\n }\n\n let cache = updateMap.get(peerId);\n if(!cache) {\n updateMap.set(peerId, cache = {});\n }\n\n if(dialog._ === 'forumTopic') {\n (cache.topics ??= new Map()).set(dialog.id, dialog);\n } else {\n cache.dialog = dialog;\n }\n };\n\n for(const [peerId, obj] of this.newDialogsToHandle) {\n const isDialogDefined = 'dialog' in obj;\n const {dialog, topics} = obj;\n\n if(isDialogDefined) {\n if(!dialog) {\n this.reloadConversation(peerId.toPeerId());\n } else if(this.dialogsStorage.getDialogOnly(peerId)) { // * can be already dropped\n processDialog(dialog);\n }\n }\n\n if(topics) {\n topics?.forEach((topic, id) => {\n if(!topic) {\n this.dialogsStorage.getForumTopicById(peerId, id);\n } else if(this.dialogsStorage.getForumTopic(peerId, id)) { // * can be already dropped\n processDialog(topic);\n }\n });\n }\n }\n\n // this.log('after order:', this.dialogsStorage[0].map((d) => d.peerId));\n\n if(newMaxSeenId !== 0) {\n this.incrementMaxSeenId(newMaxSeenId);\n }\n\n this.rootScope.dispatchEvent('dialogs_multiupdate', updateMap);\n this.newDialogsToHandle.clear();\n };\n\n public scheduleHandleNewDialogs(peerId?: PeerId, dialog?: Dialog | ForumTopic | ForumTopic['id']) {\n if(peerId !== undefined) {\n let obj = this.newDialogsToHandle.get(peerId);\n if(!obj) {\n this.newDialogsToHandle.set(peerId, obj = {});\n }\n\n const isObject = typeof(dialog) === 'object';\n if(!dialog || (isObject && dialog._ === 'dialog')) {\n obj.dialog = dialog as Dialog;\n } else {\n obj.topics ??= new Map();\n if(isObject) {\n obj.topics.set((dialog as ForumTopic).id, dialog as ForumTopic);\n } else {\n obj.topics.set(dialog as number, undefined);\n }\n }\n }\n\n return this.newDialogsHandlePromise ??= pause(0).then(() => {\n this.newDialogsHandlePromise = undefined;\n this.handleNewDialogs();\n });\n }\n\n public async deleteMessages(peerId: PeerId, mids: number[], revoke?: boolean, isRecursion?: boolean) {\n let promise: Promise;\n\n const isChannel = this.appPeersManager.isChannel(peerId);\n const channelId = isChannel && peerId.toChatId();\n if(isChannel && !isRecursion) {\n const channel = this.appChatsManager.getChat(channelId) as Chat.channel;\n if(!channel.pFlags.creator && !channel.admin_rights?.pFlags?.delete_messages) {\n mids = mids.filter((mid) => {\n const message = this.getMessageByPeer(peerId, mid);\n return !!message.pFlags.out;\n });\n\n if(!mids.length) {\n return;\n }\n }\n }\n\n const config = await this.apiManager.getConfig();\n const overflowMids = mids.splice(config.forwarded_count_max, mids.length - config.forwarded_count_max);\n\n const serverMessageIds = mids.map((mid) => {\n const messageId = getServerMessageId(mid);\n // filter outgoing messages\n return generateMessageId(messageId) === mid && messageId;\n }).filter(Boolean);\n\n if(isChannel) {\n promise = this.apiManager.invokeApi('channels.deleteMessages', {\n channel: this.appChatsManager.getChannelInput(channelId),\n id: serverMessageIds\n }).then((affectedMessages) => {\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateDeleteChannelMessages',\n channel_id: channelId,\n messages: mids,\n pts: affectedMessages.pts,\n pts_count: affectedMessages.pts_count\n });\n });\n } else {\n promise = this.apiManager.invokeApi('messages.deleteMessages', {\n revoke,\n id: serverMessageIds\n }).then((affectedMessages) => {\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateDeleteMessages',\n messages: mids,\n pts: affectedMessages.pts,\n pts_count: affectedMessages.pts_count\n });\n });\n }\n\n const promises: (typeof promise)[] = [promise];\n if(overflowMids.length) {\n promises.push(this.deleteMessages(peerId, overflowMids, revoke, true));\n }\n\n return Promise.all(promises).then(noop);\n }\n\n public readHistory(peerId: PeerId, maxId = 0, threadId?: number, force = false) {\n if(DO_NOT_READ_HISTORY) {\n return Promise.resolve();\n }\n\n // console.trace('start read')\n this.log('readHistory:', peerId, maxId, threadId);\n const readMaxId = this.getReadMaxIdIfUnread(peerId, threadId);\n if(!readMaxId) {\n if(threadId && !force) {\n const forumTopic = this.dialogsStorage.getForumTopic(peerId, threadId);\n if(!getServerMessageId(forumTopic.read_inbox_max_id)) {\n force = true;\n }\n }\n\n if(!force) {\n const dialog = this.appChatsManager.isForum(peerId.toChatId()) && threadId ?\n this.dialogsStorage.getForumTopic(peerId, threadId) :\n this.getDialogOnly(peerId);\n if(dialog && this.isDialogUnread(dialog)) {\n force = true;\n }\n }\n\n if(!force) {\n this.log('readHistory: isn\\'t unread');\n return Promise.resolve();\n }\n }\n\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n\n if(historyStorage.triedToReadMaxId >= maxId) {\n return Promise.resolve();\n }\n\n let apiPromise: Promise;\n if(threadId) {\n if(!historyStorage.readPromise) {\n apiPromise = this.apiManager.invokeApi('messages.readDiscussion', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n msg_id: getServerMessageId(threadId),\n read_max_id: getServerMessageId(maxId)\n });\n // apiPromise = new Promise((resolve) => resolve());\n }\n\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateReadChannelDiscussionInbox',\n channel_id: peerId.toChatId(),\n top_msg_id: threadId,\n read_max_id: maxId\n });\n } else if(this.appPeersManager.isChannel(peerId)) {\n if(!historyStorage.readPromise) {\n apiPromise = this.apiManager.invokeApi('channels.readHistory', {\n channel: this.appChatsManager.getChannelInput(peerId.toChatId()),\n max_id: getServerMessageId(maxId)\n });\n }\n\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateReadChannelInbox',\n max_id: maxId,\n channel_id: peerId.toChatId(),\n still_unread_count: undefined,\n pts: undefined\n });\n } else {\n if(!historyStorage.readPromise) {\n apiPromise = this.apiManager.invokeApi('messages.readHistory', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n max_id: getServerMessageId(maxId)\n }).then((affectedMessages) => {\n this.apiUpdatesManager.processUpdateMessage({\n _: 'updateShort',\n update: {\n _: 'updatePts',\n pts: affectedMessages.pts,\n pts_count: affectedMessages.pts_count\n }\n });\n });\n }\n\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateReadHistoryInbox',\n max_id: maxId,\n peer: this.appPeersManager.getOutputPeer(peerId),\n still_unread_count: undefined,\n pts: undefined,\n pts_count: undefined\n });\n }\n\n this.rootScope.dispatchEvent('notification_reset', this.appPeersManager.getPeerString(peerId));\n\n if(historyStorage.readPromise) {\n return historyStorage.readPromise;\n }\n\n historyStorage.triedToReadMaxId = maxId;\n\n apiPromise.finally(() => {\n delete historyStorage.readPromise;\n\n const {readMaxId} = historyStorage;\n this.log('readHistory: promise finally', maxId, readMaxId);\n\n if(readMaxId > maxId) {\n this.readHistory(peerId, readMaxId, threadId, true);\n }\n });\n\n return historyStorage.readPromise = apiPromise;\n }\n\n public readAllHistory(peerId: PeerId, threadId?: number, force = false) {\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n if(historyStorage.maxId) {\n this.readHistory(peerId, historyStorage.maxId, threadId, force); // lol\n }\n }\n\n private getUnreadMentionsKey(peerId: PeerId, threadId?: number) {\n return peerId + (threadId ? `_${threadId}` : '');\n }\n\n private fixDialogUnreadMentionsIfNoMessage(peerId: PeerId, threadId?: number) {\n const dialog = this.dialogsStorage.getDialogOrTopic(peerId, threadId);\n if(dialog?.unread_mentions_count) {\n this.reloadConversationOrTopic(peerId);\n }\n }\n\n private modifyCachedMentions(peerId: PeerId, mid: number, add: boolean, threadId?: number) {\n const slicedArray = this.unreadMentions[this.getUnreadMentionsKey(peerId, threadId)];\n if(!slicedArray) return;\n\n if(add) {\n if(slicedArray.first.isEnd(SliceEnd.Top)) {\n slicedArray.insertSlice([mid]);\n }\n } else {\n slicedArray.delete(mid);\n }\n }\n\n private fixUnreadMentionsCountIfNeeded(peerId: PeerId, slicedArray: SlicedArray, threadId?: number) {\n const dialog = this.dialogsStorage.getDialogOrTopic(peerId, threadId);\n if(!slicedArray.length && dialog?.unread_mentions_count) {\n this.reloadConversationOrTopic(peerId);\n }\n }\n\n public goToNextMention(peerId: PeerId, threadId?: number) {\n /* this.getUnreadMentions(peerId, 1, 2, 0).then((messages) => {\n console.log(messages);\n }); */\n\n const key = this.getUnreadMentionsKey(peerId, threadId);\n const promise = this.goToNextMentionPromises[key];\n if(promise) {\n return promise;\n }\n\n const slicedArray = this.unreadMentions[peerId] ??= new SlicedArray();\n const length = slicedArray.length;\n const isTopEnd = slicedArray.first.isEnd(SliceEnd.Top);\n if(!length && isTopEnd) {\n this.fixUnreadMentionsCountIfNeeded(peerId, slicedArray, threadId);\n return Promise.resolve();\n }\n\n let loadNextPromise = Promise.resolve();\n if(!isTopEnd && length < 25) {\n loadNextPromise = this.loadNextMentions(peerId, threadId);\n }\n\n return this.goToNextMentionPromises[key] = loadNextPromise.then(() => {\n const last = slicedArray.last;\n const mid = last && last[last.length - 1];\n if(mid) {\n slicedArray.delete(mid);\n return mid;\n } else {\n this.fixUnreadMentionsCountIfNeeded(peerId, slicedArray, threadId);\n }\n }).finally(() => {\n delete this.goToNextMentionPromises[key];\n });\n }\n\n private loadNextMentions(peerId: PeerId, threadId?: number) {\n const slicedArray = this.unreadMentions[peerId];\n const maxId = slicedArray.first[0] || 1;\n\n const backLimit = 50;\n const add_offset = -backLimit;\n const limit = backLimit;\n return this.getUnreadMentions(peerId, maxId, add_offset, limit, undefined, undefined, threadId)\n .then((messages) => {\n this.mergeHistoryResult(slicedArray, messages, maxId === 1 ? 0 : maxId, limit, add_offset);\n });\n }\n\n private getUnreadMentions(\n peerId: PeerId,\n offsetId: number,\n add_offset: number,\n limit: number,\n maxId = 0,\n minId = 0,\n threadId?: number\n ) {\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.getUnreadMentions',\n params: {\n peer: this.appPeersManager.getInputPeerById(peerId),\n offset_id: getServerMessageId(offsetId),\n add_offset,\n limit,\n max_id: getServerMessageId(maxId),\n min_id: getServerMessageId(minId),\n top_msg_id: threadId ? getServerMessageId(threadId) : undefined\n },\n processResult: (messagesMessages) => {\n assumeType>(messagesMessages);\n this.appUsersManager.saveApiUsers(messagesMessages.users);\n this.appChatsManager.saveApiChats(messagesMessages.chats);\n this.saveMessages(messagesMessages.messages);\n\n return messagesMessages;\n }\n });\n }\n\n public readMessages(peerId: PeerId, msgIds: number[]) {\n if(DO_NOT_READ_HISTORY) {\n return Promise.resolve();\n }\n\n if(!msgIds.length) {\n return Promise.resolve();\n }\n\n msgIds = msgIds.map((mid) => getServerMessageId(mid));\n let promise: Promise, update: Update.updateChannelReadMessagesContents | Update.updateReadMessagesContents;\n if(peerId.isAnyChat() && this.appPeersManager.isChannel(peerId)) {\n const channelId = peerId.toChatId();\n\n update = {\n _: 'updateChannelReadMessagesContents',\n channel_id: channelId,\n messages: msgIds\n };\n\n promise = this.apiManager.invokeApi('channels.readMessageContents', {\n channel: this.appChatsManager.getChannelInput(channelId),\n id: msgIds\n });\n } else {\n update = {\n _: 'updateReadMessagesContents',\n messages: msgIds,\n pts: undefined,\n pts_count: undefined\n };\n\n promise = this.apiManager.invokeApi('messages.readMessageContents', {\n id: msgIds\n }).then((affectedMessages) => {\n (update as Update.updateReadMessagesContents).pts = affectedMessages.pts;\n (update as Update.updateReadMessagesContents).pts_count = affectedMessages.pts_count;\n this.apiUpdatesManager.processLocalUpdate(update);\n });\n }\n\n this.apiUpdatesManager.processLocalUpdate(update);\n\n return promise;\n }\n\n public getHistoryStorage(peerId: PeerId, threadId?: number) {\n if(threadId) {\n // threadId = this.getLocalMessageId(threadId);\n return (this.threadsStorage[peerId] ??= {})[threadId] ??= {count: null, history: new SlicedArray()};\n }\n\n return this.historiesStorage[peerId] ??= {count: null, history: new SlicedArray()};\n }\n\n public getHistoryStorageTransferable(peerId: PeerId, threadId?: number) {\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n const {\n count,\n history,\n maxId,\n readMaxId,\n readOutboxMaxId,\n maxOutId,\n replyMarkup\n } = historyStorage;\n\n return {\n count,\n history: undefined as HistoryStorage,\n historySerialized: history.toJSON(),\n maxId,\n readMaxId,\n readOutboxMaxId,\n maxOutId,\n replyMarkup\n };\n }\n\n private getNotifyPeerSettings(peerId: PeerId, threadId?: number) {\n const inputNotifyPeer = this.appPeersManager.getInputNotifyPeerById({peerId, ignorePeerId: true, threadId});\n return Promise.all([\n this.appNotificationsManager.getNotifyPeerTypeSettings(),\n this.appNotificationsManager.getNotifySettings(inputNotifyPeer)\n ]).then(([_, peerTypeNotifySettings]) => {\n return {\n muted: this.appNotificationsManager.isPeerLocalMuted({peerId, respectType: true, threadId}),\n peerTypeNotifySettings\n };\n });\n }\n\n private handleNotifications = () => {\n ctx.clearTimeout(this.notificationsHandlePromise);\n this.notificationsHandlePromise = undefined;\n\n // var timeout = $rootScope.idle.isIDLE && StatusManager.isOtherDeviceActive() ? 30000 : 1000;\n // const timeout = 1000;\n\n for(const key in this.notificationsToHandle) {\n const [peerId, threadId] = key.split('_');\n // if(rootScope.peerId === peerId && !rootScope.idle.isIDLE) {\n // continue;\n // }\n\n const notifyPeerToHandle = this.notificationsToHandle[key];\n this.getNotifyPeerSettings(peerId.toPeerId(), threadId ? +threadId : undefined)\n .then(({muted, peerTypeNotifySettings}) => {\n const topMessage = notifyPeerToHandle.topMessage;\n if((muted && !topMessage.pFlags.mentioned) || !topMessage.pFlags.unread) {\n return;\n }\n\n // setTimeout(() => {\n if(topMessage.pFlags.unread) {\n this.notifyAboutMessage(topMessage, {\n fwdCount: notifyPeerToHandle.fwdCount,\n peerTypeNotifySettings\n });\n }\n // }, timeout);\n });\n }\n\n this.notificationsToHandle = {};\n };\n\n public getUpdateAfterReloadKey(peerId: PeerId, threadId?: number) {\n return peerId + (threadId ? '_' + threadId : '');\n }\n\n private handleNewUpdateAfterReload(peerId: PeerId, update: Update, threadId?: number) {\n const set = this.newUpdatesAfterReloadToHandle[this.getUpdateAfterReloadKey(peerId, threadId)] ??= new Set();\n if(set.has(update)) {\n this.log.error('here we go again', peerId);\n return;\n }\n\n (update as any).ignoreExisting = true;\n set.add(update);\n this.scheduleHandleNewDialogs(peerId, threadId);\n }\n\n private onUpdateMessageId = (update: Update.updateMessageID) => {\n const randomId = update.random_id;\n const pendingData = this.pendingByRandomId[randomId];\n if(!pendingData) {\n return;\n }\n\n const mid = generateMessageId(update.id);\n this.pendingByMessageId[mid] = randomId;\n // const {storage} = pendingData;\n // const message = this.getMessageFromStorage(storage, mid);\n // if(message) { // if message somehow already exists\n // this.checkPendingMessage(message);\n // }\n };\n\n private onUpdateNewMessage = (update: Update.updateNewDiscussionMessage | Update.updateNewMessage | Update.updateNewChannelMessage) => {\n const message = update.message as MyMessage;\n const peerId = this.getMessagePeer(message);\n const storage = this.getHistoryMessagesStorage(peerId);\n\n // * local update\n const isLocalThreadUpdate = update._ === 'updateNewDiscussionMessage';\n\n // * temporary save the message for info (peerId, reply mids...)\n this.saveMessages([message], {storage: this.createMessageStorage(peerId, 'history')});\n\n // * check if sent message is already in storage\n // const oldMessage = this.getMessageFromStorage(storage, message.mid);\n // if(\n // (message as Message.message).pFlags.is_outgoing &&\n // oldMessage &&\n // !(oldMessage as Message.message).pFlags.is_outgoing\n // ) {\n // this.checkPendingMessage(message);\n // return;\n // }\n\n const isForum = this.appPeersManager.isForum(peerId);\n const threadKey = this.getThreadKey(message);\n const threadId = threadKey ? +threadKey.split('_')[1] : undefined;\n const dialog = this.dialogsStorage.getDialogOrTopic(peerId, isLocalThreadUpdate ? threadId : undefined);\n\n if((!dialog || this.reloadConversationsPeers.has(peerId)) && !isLocalThreadUpdate) {\n let good = true;\n if(peerId.isAnyChat()) {\n good = this.appChatsManager.isInChat(peerId.toChatId());\n }\n\n if(good) {\n this.handleNewUpdateAfterReload(peerId, update);\n return;\n }\n\n // return;\n }\n\n if(threadId && !isLocalThreadUpdate) {\n const threadStorage = this.threadsStorage[peerId]?.[threadId];\n const update = {\n _: 'updateNewDiscussionMessage',\n message\n } as Update.updateNewDiscussionMessage;\n\n if(this.appChatsManager.isForum(peerId.toChatId()) && !this.dialogsStorage.getForumTopic(peerId, threadId)) {\n // this.dialogsStorage.getForumTopicById(peerId, threadId);\n this.handleNewUpdateAfterReload(peerId, update, threadId);\n } else if(threadStorage) {\n this.onUpdateNewMessage(update);\n }\n }\n\n if(message._ === 'messageService') {\n const {action} = message;\n if(action._ === 'messageActionPaymentSent' && message.reply_to) {\n this.rootScope.dispatchEvent('payment_sent', {\n peerId: message.reply_to.reply_to_peer_id ?\n this.appPeersManager.getPeerId(message.reply_to.reply_to_peer_id) :\n message.peerId,\n mid: message.reply_to_mid,\n receiptMessage: message\n });\n }\n\n if(action._ === 'messageActionTopicEdit' && !isLocalThreadUpdate) {\n const topic = this.dialogsStorage.getForumTopic(peerId, threadId);\n if(!topic) {\n this.dialogsStorage.getForumTopicById(peerId, threadId);\n } else {\n const oldTopic = copy(topic);\n\n if(action.title !== undefined) {\n topic.title = action.title;\n }\n\n if(action.closed !== undefined) {\n setBooleanFlag(topic.pFlags, 'closed', action.closed);\n }\n\n if(action.hidden !== undefined) {\n setBooleanFlag(topic.pFlags, 'hidden', action.hidden);\n }\n\n if(action.icon_emoji_id !== undefined) {\n topic.icon_emoji_id = action.icon_emoji_id;\n }\n\n this.scheduleHandleNewDialogs(peerId, topic);\n\n this.dialogsStorage.processTopicUpdate(topic, oldTopic);\n }\n }\n }\n\n /* if(update._ === 'updateNewChannelMessage') {\n const chat = appChatsManager.getChat(peerId.toChatId());\n if(chat.pFlags && (chat.pFlags.left || chat.pFlags.kicked)) {\n return;\n }\n } */\n\n this.saveMessages([message], {storage});\n // this.log.warn(dT(), 'message unread', message.mid, message.pFlags.unread)\n\n /* if((message as Message.message).grouped_id) {\n this.log('updateNewMessage', message);\n } */\n\n this.checkPendingMessage(message);\n const historyStorage = this.getHistoryStorage(peerId, isLocalThreadUpdate ? threadId : undefined);\n\n if(!isLocalThreadUpdate) {\n this.updateMessageRepliesIfNeeded(message);\n }\n\n // * so message can exist if reloadConversation came back earlier with mid\n const ignoreExisting: boolean = (update as any).ignoreExisting;\n const isExisting = !!historyStorage.history.findSlice(message.mid);\n if(isExisting) {\n if(!ignoreExisting) {\n return false;\n }\n } else {\n // * catch situation with disconnect. if message's id is lower than we already have (in bottom end slice), will sort it\n const firstSlice = historyStorage.history.first;\n if(firstSlice.isEnd(SliceEnd.Bottom)) {\n let i = 0;\n for(const length = firstSlice.length; i < length; ++i) {\n if(message.mid > firstSlice[i]) {\n break;\n }\n }\n\n firstSlice.splice(i, 0, message.mid);\n } else {\n historyStorage.history.unshift(message.mid);\n }\n\n if(historyStorage.count !== null) {\n ++historyStorage.count;\n }\n }\n\n if(!historyStorage.maxId || message.mid > historyStorage.maxId) {\n historyStorage.maxId = message.mid;\n }\n\n if(this.mergeReplyKeyboard(historyStorage, message)) {\n this.rootScope.dispatchEvent('history_reply_markup', {peerId});\n }\n\n const fromId = message.fromId;\n if(fromId.isUser() && !message.pFlags.out && message.from_id) {\n this.appUsersManager.forceUserOnline(fromId, message.date);\n\n const action: SendMessageAction = {\n _: 'sendMessageCancelAction'\n };\n\n let update: Update.updateUserTyping | Update.updateChatUserTyping | Update.updateChannelUserTyping;\n if(peerId.isUser()) {\n update = {\n _: 'updateUserTyping',\n action,\n user_id: fromId\n };\n } else if(this.appPeersManager.isChannel(peerId)) {\n update = {\n _: 'updateChannelUserTyping',\n action,\n channel_id: peerId.toChatId(),\n from_id: this.appPeersManager.getOutputPeer(fromId),\n top_msg_id: threadId ? getServerMessageId(threadId) : undefined\n };\n } else {\n update = {\n _: 'updateChatUserTyping',\n action,\n chat_id: peerId.toChatId(),\n from_id: this.appPeersManager.getOutputPeer(fromId)\n };\n }\n\n this.apiUpdatesManager.processLocalUpdate(update);\n }\n\n // commented to render the message if it's been sent faster than history_append came to main thread\n // if(!pendingMessage) {\n this.handleNewMessage(message);\n // }\n\n const isTopic = dialog?._ === 'forumTopic';\n if((isLocalThreadUpdate && !isTopic) || !dialog) {\n return;\n }\n\n const inboxUnread = !message.pFlags.out && message.pFlags.unread;\n\n {\n if(inboxUnread && message.mid > dialog.top_message) {\n const releaseUnreadCount = this.dialogsStorage.prepareDialogUnreadCountModifying(dialog);\n\n ++dialog.unread_count;\n if(message.pFlags.mentioned) {\n ++dialog.unread_mentions_count;\n this.modifyCachedMentions(peerId, message.mid, true, isTopic ? threadId : undefined);\n }\n\n releaseUnreadCount();\n }\n\n if(message.mid >= dialog.top_message) {\n this.setDialogTopMessage(message, dialog);\n }\n }\n\n if(((!isLocalThreadUpdate && !isForum) || isTopic) && inboxUnread) {\n const notifyPeer = threadKey || peerId;\n const notifyPeerToHandle = this.notificationsToHandle[notifyPeer] ??= {\n fwdCount: 0,\n fromId: NULL_PEER_ID\n };\n\n if(notifyPeerToHandle.fromId !== fromId) {\n notifyPeerToHandle.fromId = fromId;\n notifyPeerToHandle.fwdCount = 0;\n }\n\n if((message as Message.message).fwd_from) {\n ++notifyPeerToHandle.fwdCount;\n }\n\n notifyPeerToHandle.topMessage = message;\n\n this.notificationsHandlePromise ??= ctx.setTimeout(this.handleNotifications, 0);\n }\n };\n\n private onUpdateMessageReactions = (update: Update.updateMessageReactions) => {\n const {peer, msg_id, reactions} = update;\n const mid = generateMessageId(msg_id);\n const peerId = this.appPeersManager.getPeerId(peer);\n const message: MyMessage = this.getMessageByPeer(peerId, mid);\n\n if(message?._ !== 'message') {\n return;\n }\n\n const recentReactions = reactions?.recent_reactions;\n if(recentReactions?.length && message.pFlags.out) {\n const recentReaction = recentReactions[recentReactions.length - 1];\n const previousReactions = message.reactions;\n const previousRecentReactions = previousReactions?.recent_reactions;\n if(\n this.appPeersManager.getPeerId(recentReaction.peer_id) !== this.appPeersManager.peerId && (\n !previousRecentReactions ||\n previousRecentReactions.length <= recentReactions.length\n ) && (\n !previousRecentReactions ||\n !deepEqual(recentReaction, previousRecentReactions[previousRecentReactions.length - 1])\n )\n ) {\n this.getNotifyPeerSettings(peerId).then(({muted, peerTypeNotifySettings}) => {\n if(/* muted || */!peerTypeNotifySettings.show_previews) return;\n this.notifyAboutMessage(message, {\n peerReaction: recentReaction,\n peerTypeNotifySettings\n });\n });\n }\n }\n\n const key = message.peerId + '_' + message.mid;\n this.pushBatchUpdate('messages_reactions', this.batchUpdateReactions, key, () => copy(message.reactions));\n\n message.reactions = reactions;\n\n if(!update.local) {\n this.setDialogToStateIfMessageIsTop(message);\n }\n };\n\n private onUpdateDialogUnreadMark = (update: Update.updateDialogUnreadMark) => {\n // this.log('updateDialogUnreadMark', update);\n const peerId = this.appPeersManager.getPeerId((update.peer as DialogPeer.dialogPeer).peer);\n const dialog = this.getDialogOnly(peerId);\n\n if(!dialog) {\n this.scheduleHandleNewDialogs(peerId);\n } else {\n const releaseUnreadCount = this.dialogsStorage.prepareDialogUnreadCountModifying(dialog);\n\n if(!update.pFlags.unread) {\n delete dialog.pFlags.unread_mark;\n } else {\n dialog.pFlags.unread_mark = true;\n }\n\n releaseUnreadCount();\n this.dialogsStorage.setDialogToState(dialog);\n this.rootScope.dispatchEvent('dialogs_multiupdate', new Map([[peerId, {dialog}]]));\n }\n };\n\n private onUpdateEditMessage = (update: Update.updateEditMessage | Update.updateEditChannelMessage) => {\n const message = update.message as MyMessage;\n const peerId = this.getMessagePeer(message);\n const mid = generateMessageId(message.id);\n const storage = this.getHistoryMessagesStorage(peerId);\n if(!storage.has(mid)) {\n // this.fixDialogUnreadMentionsIfNoMessage(peerId);\n return;\n }\n\n // console.trace(dT(), 'edit message', message)\n\n const oldMessage: Message = this.getMessageFromStorage(storage, mid);\n this.saveMessages([message], {storage});\n const newMessage: Message = this.getMessageFromStorage(storage, mid);\n\n this.handleEditedMessage(oldMessage, newMessage, storage);\n\n const dialog = this.getDialogOnly(peerId);\n\n // if sender erased mention\n /* if(dialog.unread_mentions_count && (oldMessage as Message.message)?.pFlags?.mentioned && !message.pFlags.mentioned) {\n --dialog.unread_mentions_count;\n this.modifyCachedMentions(peerId, mid, false);\n } */\n\n const isTopMessage = dialog?.top_message === mid;\n if((message as Message.messageService).clear_history) {\n if(isTopMessage) {\n this.rootScope.dispatchEvent('dialog_flush', {peerId, dialog});\n }\n } else {\n let dispatchEditEvent = true;\n // no sense in dispatching message_edit since only reactions have changed\n if(oldMessage?._ === 'message' && !deepEqual(oldMessage.reactions, (newMessage as Message.message).reactions)) {\n const newReactions = (newMessage as Message.message).reactions;\n (newMessage as Message.message).reactions = oldMessage.reactions;\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateMessageReactions',\n peer: this.appPeersManager.getOutputPeer(peerId),\n msg_id: message.id,\n reactions: newReactions\n });\n\n dispatchEditEvent = false;\n }\n\n dispatchEditEvent && this.rootScope.dispatchEvent('message_edit', {\n storageKey: storage.key,\n peerId,\n mid,\n message\n });\n\n if(isTopMessage) {\n this.dialogsStorage.setDialogToState(dialog);\n }\n\n const map: BroadcastEvents['dialogs_multiupdate'] = new Map();\n const getUpdateCache = () => {\n let cache = map.get(peerId);\n if(!cache) {\n map.set(peerId, cache = {});\n }\n\n return cache;\n };\n\n if((isTopMessage || (message as Message.message).grouped_id) && dialog) {\n getUpdateCache().dialog = dialog;\n }\n\n const threadKey = this.getThreadKey(message);\n if(threadKey) {\n const topicId = +threadKey.split('_')[1];\n const topic = this.dialogsStorage.getForumTopic(peerId, topicId);\n if(topic) {\n (getUpdateCache().topics ??= new Map()).set(topicId, topic);\n }\n }\n\n if(map.size) {\n this.rootScope.dispatchEvent('dialogs_multiupdate', map);\n }\n }\n };\n\n private onUpdateReadHistory = (update: Update.updateReadChannelDiscussionInbox | Update.updateReadChannelDiscussionOutbox\n | Update.updateReadHistoryInbox | Update.updateReadHistoryOutbox\n | Update.updateReadChannelInbox | Update.updateReadChannelOutbox) => {\n const channelId = (update as Update.updateReadChannelInbox).channel_id;\n const maxId = generateMessageId((update as Update.updateReadChannelInbox).max_id || (update as Update.updateReadChannelDiscussionInbox).read_max_id);\n const threadId = generateMessageId((update as Update.updateReadChannelDiscussionInbox).top_msg_id);\n const peerId = channelId ? channelId.toPeerId(true) : this.appPeersManager.getPeerId((update as Update.updateReadHistoryInbox).peer);\n\n const isOut = update._ === 'updateReadHistoryOutbox' ||\n update._ === 'updateReadChannelOutbox' ||\n update._ === 'updateReadChannelDiscussionOutbox' ? true : undefined;\n\n const isForum = channelId ? this.appChatsManager.isForum(channelId) : false;\n const storage = this.getHistoryMessagesStorage(peerId);\n const history = getObjectKeysAndSort(storage, 'desc');\n const foundDialog = threadId && isForum ?\n this.dialogsStorage.getForumTopic(peerId, threadId) :\n this.getDialogOnly(peerId);\n const stillUnreadCount = (update as Update.updateReadChannelInbox).still_unread_count;\n let newUnreadCount = 0;\n let newUnreadMentionsCount = 0;\n let foundAffected = false;\n\n // this.log.warn(dT(), 'read', peerId, isOut ? 'out' : 'in', maxId)\n\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n\n if(peerId.isUser() && isOut) {\n this.appUsersManager.forceUserOnline(peerId.toUserId());\n }\n\n if(threadId) {\n const repliesKey = this.threadsToReplies[peerId + '_' + threadId];\n if(repliesKey) {\n const [peerId, mid] = repliesKey.split('_');\n this.updateMessage(peerId.toPeerId(), +mid, 'replies_updated');\n }\n }\n\n const releaseUnreadCount = foundDialog && this.dialogsStorage.prepareDialogUnreadCountModifying(foundDialog);\n const readMaxId = this.getReadMaxIdIfUnread(peerId, threadId);\n\n for(let i = 0, length = history.length; i < length; i++) {\n const mid = history[i];\n if(mid > maxId) {\n continue;\n }\n\n const message: MyMessage = storage.get(mid);\n\n if(message.pFlags.out !== isOut) {\n continue;\n }\n\n const messageThreadId = getMessageThreadId(message, isForum);\n if(threadId && messageThreadId !== threadId) {\n continue;\n }\n\n const isUnread = message.pFlags.unread || (readMaxId && readMaxId < mid);\n\n if(!isUnread) {\n break;\n }\n\n // this.log.warn('read', messageId, isUnread, message)\n delete message.pFlags.unread;\n foundAffected ||= true;\n\n if(!message.pFlags.out && foundDialog) {\n if(stillUnreadCount === undefined) {\n newUnreadCount = --foundDialog.unread_count;\n }\n\n if(message.pFlags.mentioned) {\n newUnreadMentionsCount = --foundDialog.unread_mentions_count;\n this.modifyCachedMentions(peerId, message.mid, false);\n }\n }\n\n this.rootScope.dispatchEvent('notification_cancel', 'msg' + mid);\n }\n\n if(isOut) historyStorage.readOutboxMaxId = maxId;\n else historyStorage.readMaxId = maxId;\n\n if(foundDialog) {\n if(isOut) foundDialog.read_outbox_max_id = maxId;\n else foundDialog.read_inbox_max_id = maxId;\n\n if(!isOut) {\n let setCount: number;\n if(stillUnreadCount !== undefined) {\n setCount = stillUnreadCount;\n } else if(\n newUnreadCount < 0 ||\n maxId >= foundDialog.top_message ||\n !readMaxId\n ) {\n setCount = 0;\n } else if(newUnreadCount && foundDialog.top_message > maxId) {\n setCount = newUnreadCount;\n }\n\n if(setCount !== undefined) {\n foundDialog.unread_count = setCount;\n }\n\n if(newUnreadMentionsCount < 0 || !foundDialog.unread_count) {\n foundDialog.unread_mentions_count = 0;\n }\n }\n\n releaseUnreadCount?.();\n\n this.dialogsStorage.processDialogForFilters(foundDialog);\n\n this.rootScope.dispatchEvent('dialog_unread', {peerId, dialog: foundDialog});\n this.dialogsStorage.setDialogToState(foundDialog);\n\n if(!foundAffected && stillUnreadCount === undefined && !isOut && foundDialog.unread_count) {\n if(foundDialog._ === 'forumTopic') {\n this.dialogsStorage.getForumTopicById(peerId, threadId);\n } else {\n this.reloadConversation(peerId);\n }\n }\n }\n\n if(foundAffected) {\n this.rootScope.dispatchEvent('messages_read');\n }\n\n if(!threadId && channelId) {\n const threadKeyPart = peerId + '_';\n for(const threadKey in this.threadsToReplies) {\n if(threadKey.indexOf(threadKeyPart) === 0) {\n const [peerId, mid] = this.threadsToReplies[threadKey].split('_');\n this.rootScope.dispatchEvent('replies_updated', this.getMessageByPeer(peerId.toPeerId(), +mid) as Message.message);\n }\n }\n }\n };\n\n private onUpdateReadMessagesContents = (update: Update.updateChannelReadMessagesContents | Update.updateReadMessagesContents) => {\n const channelId = (update as Update.updateChannelReadMessagesContents).channel_id;\n const topMsgId = (update as Update.updateChannelReadMessagesContents).top_msg_id;\n const threadId = topMsgId ? generateMessageId(topMsgId) : undefined;\n const mids = (update as Update.updateReadMessagesContents).messages.map((id) => generateMessageId(id));\n const peerId = channelId ? channelId.toPeerId(true) : this.findPeerIdByMids(mids);\n for(let i = 0, length = mids.length; i < length; ++i) {\n const mid = mids[i];\n const message: MyMessage = this.getMessageByPeer(peerId, mid);\n if(message) {\n if(message.pFlags.media_unread) {\n delete message.pFlags.media_unread;\n this.setDialogToStateIfMessageIsTop(message);\n\n if(!message.pFlags.out && message.pFlags.mentioned) {\n this.modifyCachedMentions(peerId, mid, false, threadId);\n }\n }\n } else {\n this.fixDialogUnreadMentionsIfNoMessage(peerId, threadId);\n }\n }\n\n this.rootScope.dispatchEvent('messages_media_read', {peerId, mids});\n };\n\n private onUpdateChannelAvailableMessages = (update: Update.updateChannelAvailableMessages) => {\n const peerId = update.channel_id.toPeerId(true);\n const history = this.getHistoryStorage(peerId).history.slice;\n const availableMinId = generateMessageId(update.available_min_id);\n const messages = history.filter((mid) => mid <= availableMinId);\n\n (update as any as Update.updateDeleteChannelMessages).messages = messages;\n this.onUpdateDeleteMessages(update as any as Update.updateDeleteChannelMessages);\n };\n\n private onUpdateDeleteMessages = (update: Update.updateDeleteMessages | Update.updateDeleteChannelMessages) => {\n const channelId = (update as Update.updateDeleteChannelMessages).channel_id;\n // const messages = (update as any as Update.updateDeleteChannelMessages).messages;\n const messages = (update as any as Update.updateDeleteChannelMessages).messages.map((id) => generateMessageId(id));\n const peerId: PeerId = channelId ? channelId.toPeerId(true) : this.findPeerIdByMids(messages);\n\n if(!peerId) {\n return;\n }\n\n this.apiManager.clearCache('messages.getSearchCounters', (params) => {\n return this.appPeersManager.getPeerId(params.peer) === peerId;\n });\n\n const threadKeys: Set = new Set(), topics: Map = new Map();\n for(const mid of messages) {\n const message = this.getMessageByPeer(peerId, mid);\n const threadKey = this.getThreadKey(message);\n if(!threadKey) {\n continue;\n }\n\n const threadId = +threadKey.split('_')[1];\n if(this.threadsStorage[peerId]?.[threadId]) {\n threadKeys.add(threadKey);\n\n if(!topics.has(threadId)) {\n const topic = this.dialogsStorage.getForumTopic(peerId, threadId);\n if(topic) {\n topics.set(threadId, topic);\n }\n }\n }\n }\n\n const historyUpdated = this.handleDeletedMessages(\n peerId,\n this.getHistoryMessagesStorage(peerId),\n messages\n );\n\n const threadsStorages = Array.from(threadKeys).map((threadKey) => {\n const [peerId, mid] = threadKey.split('_');\n return this.getHistoryStorage(peerId.toPeerId(), +mid);\n });\n\n const historyStorages = [\n this.getHistoryStorage(peerId),\n ...threadsStorages\n ];\n historyStorages.forEach((historyStorage) => {\n for(const mid of historyUpdated.msgs) {\n historyStorage.history.delete(mid);\n }\n\n if(historyUpdated.count && historyStorage.count) {\n historyStorage.count = Math.max(0, historyStorage.count - historyUpdated.count);\n }\n });\n\n this.rootScope.dispatchEvent('history_delete', {peerId, msgs: historyUpdated.msgs});\n\n const dialogs: (MTDialog.dialog | ForumTopic)[] = [\n ...topics.values()\n ];\n\n const dialog = this.getDialogOnly(peerId);\n if(dialog) {\n dialogs.unshift(dialog);\n }\n\n dialogs.forEach((dialog) => {\n const isTopic = dialog._ === 'forumTopic';\n const affected = historyUpdated.unreadMentions || historyUpdated.unread;\n const releaseUnreadCount = affected && this.dialogsStorage.prepareDialogUnreadCountModifying(dialog);\n\n if(historyUpdated.unread) {\n dialog.unread_count = Math.max(0, dialog.unread_count - historyUpdated.unread);\n }\n\n if(historyUpdated.unreadMentions) {\n dialog.unread_mentions_count = !dialog.unread_count ? 0 : Math.max(0, dialog.unread_mentions_count - historyUpdated.unreadMentions);\n }\n\n if(affected) {\n releaseUnreadCount();\n\n if(!isTopic) {\n this.rootScope.dispatchEvent('dialog_unread', {peerId, dialog});\n }\n }\n\n if(historyUpdated.msgs.has(dialog.top_message)) {\n const historyStorage = this.getHistoryStorage(dialog.peerId, isTopic ? dialog.id : undefined);\n const slice = historyStorage.history.first;\n if(slice.isEnd(SliceEnd.Bottom) && slice.length) {\n const mid = slice[0];\n const message = this.getMessageByPeer(peerId, mid);\n this.setDialogTopMessage(message, dialog);\n } else if(isTopic) {\n this.dialogsStorage.getForumTopicById(peerId, dialog.id);\n } else {\n this.reloadConversation(peerId);\n }\n }\n });\n };\n\n private onUpdateChannel = (update: Update.updateChannel) => {\n const channelId = update.channel_id;\n const peerId = channelId.toPeerId(true);\n const channel = this.appChatsManager.getChat(channelId) as Chat.channel;\n\n const needDialog = this.appChatsManager.isInChat(channelId);\n\n const canViewHistory = !!getPeerActiveUsernames(channel)[0] || !channel.pFlags.left;\n const hasHistory = this.historiesStorage[peerId] !== undefined;\n\n if(canViewHistory !== hasHistory) {\n delete this.historiesStorage[peerId];\n this.rootScope.dispatchEvent('history_forbidden', peerId);\n }\n\n const dialog = this.getDialogOnly(peerId);\n if(!!dialog !== needDialog) {\n if(needDialog) {\n this.reloadConversation(peerId);\n } else {\n this.dialogsStorage.dropDialogOnDeletion(peerId);\n }\n }\n\n this.rootScope.dispatchEvent('channel_update', channelId);\n };\n\n private onUpdateChannelReload = (update: Update.updateChannelReload) => {\n const peerId = update.channel_id.toPeerId(true);\n\n // if(this.appPeersManager.isForum(peerId)) {\n // const cache = this.dialogsStorage.getForumTopicsCache(peerId);\n // if(cache.topics.size) {\n\n // }\n // }\n\n this.flushStoragesByPeerId(peerId);\n Promise.all([\n this.reloadConversation(peerId)\n ]).then(() => {\n this.rootScope.dispatchEvent('history_reload', peerId);\n });\n };\n\n private onUpdateChannelMessageViews = (update: Update.updateChannelMessageViews) => {\n const views = update.views;\n const peerId = update.peerId ?? update.channel_id.toPeerId(true);\n const mid = generateMessageId(update.id);\n const message = this.getMessageByPeer(peerId, mid) as Message.message;\n if(message?.views !== undefined && message.views < views) {\n message.views = views;\n this.pushBatchUpdate('messages_views', this.batchUpdateViews, message.peerId + '_' + message.mid);\n this.setDialogToStateIfMessageIsTop(message);\n }\n };\n\n private onUpdateServiceNotification = (update: Update.updateServiceNotification) => {\n // this.log('updateServiceNotification', update);\n if(update.pFlags?.popup) {\n this.rootScope.dispatchEvent('service_notification', update);\n return;\n }\n\n const fromId = SERVICE_PEER_ID;\n const peerId = fromId;\n const messageId = this.generateTempMessageId(peerId);\n const message: Message.message = {\n _: 'message',\n id: messageId,\n from_id: this.appPeersManager.getOutputPeer(fromId),\n peer_id: this.appPeersManager.getOutputPeer(peerId),\n pFlags: {unread: true},\n date: (update.inbox_date || tsNow(true)) + this.timeManager.getServerTimeOffset(),\n message: update.message,\n media: update.media,\n entities: update.entities\n };\n if(!this.appUsersManager.hasUser(fromId)) {\n this.appUsersManager.saveApiUsers([{\n _: 'user',\n id: fromId,\n pFlags: {verified: true},\n access_hash: '0',\n first_name: 'Telegram',\n phone: '42777'\n }]);\n }\n this.saveMessages([message], {isOutgoing: true});\n\n if(update.inbox_date) {\n this.pendingTopMsgs[peerId] = messageId;\n this.onUpdateNewMessage({\n _: 'updateNewMessage',\n message,\n pts: undefined,\n pts_count: undefined\n });\n }\n };\n\n private onUpdatePinnedMessages = (update: Update.updatePinnedMessages | Update.updatePinnedChannelMessages) => {\n const channelId = update._ === 'updatePinnedChannelMessages' ? update.channel_id : undefined;\n const peerId = channelId ? channelId.toPeerId(true) : this.appPeersManager.getPeerId((update as Update.updatePinnedMessages).peer);\n\n /* const storage = this.getSearchStorage(peerId, 'inputMessagesFilterPinned');\n if(storage.count !== storage.history.length) {\n if(storage.count !== undefined) {\n delete this.searchesStorage[peerId]['inputMessagesFilterPinned'];\n }\n\n rootScope.broadcast('peer_pinned_messages', peerId);\n break;\n } */\n\n const messages = update.messages.map((id) => generateMessageId(id));\n\n const storage = this.getHistoryMessagesStorage(peerId);\n const missingMessages = messages.filter((mid) => !storage.has(mid));\n const getMissingPromise = missingMessages.length ? Promise.all(missingMessages.map((mid) => this.reloadMessages(peerId, mid))) : Promise.resolve();\n getMissingPromise.finally(() => {\n const werePinned = update.pFlags?.pinned;\n if(werePinned) {\n for(const mid of messages) {\n // storage.history.push(mid);\n const message = storage.get(mid) as Message.message;\n message.pFlags.pinned = true;\n }\n\n /* if(this.pinnedMessages[peerId]?.maxId) {\n const maxMid = Math.max(...messages);\n this.pinnedMessages\n } */\n\n // storage.history.sort((a, b) => b - a);\n } else {\n for(const mid of messages) {\n // storage.history.findAndSplice((_mid) => _mid === mid);\n const message = storage.get(mid) as Message.message;\n delete message.pFlags.pinned;\n }\n }\n\n /* const info = this.pinnedMessages[peerId];\n if(info) {\n info.count += messages.length * (werePinned ? 1 : -1);\n } */\n\n delete this.pinnedMessages[this.getPinnedMessagesKey(peerId)];\n this.appStateManager.getState().then((state) => {\n delete state.hiddenPinnedMessages[peerId];\n this.rootScope.dispatchEvent('peer_pinned_messages', {peerId, mids: messages, pinned: werePinned});\n });\n });\n };\n\n private onUpdateNotifySettings = (update: Update.updateNotifySettings) => {\n const {peer, notify_settings} = update;\n const isTopic = peer._ === 'notifyForumTopic';\n const isPeerType = peer._ === 'notifyPeer' || isTopic;\n if(!isPeerType) {\n return;\n }\n\n const peerId = this.appPeersManager.getPeerId(peer.peer);\n const dialog = this.dialogsStorage.getDialogOrTopic(peerId, isTopic ? generateMessageId(peer.top_msg_id) : undefined);\n if(!dialog) {\n return;\n }\n\n dialog.notify_settings = notify_settings;\n this.rootScope.dispatchEvent('dialog_notify_settings', dialog);\n this.dialogsStorage.setDialogToState(dialog);\n };\n\n private onUpdateNewScheduledMessage = (update: Update.updateNewScheduledMessage) => {\n const message = update.message as MyMessage;\n const peerId = this.getMessagePeer(message);\n\n const storage = this.scheduledMessagesStorage[peerId];\n if(!storage) {\n return;\n }\n\n const mid = generateMessageId(message.id);\n\n const oldMessage = this.getMessageFromStorage(storage, mid);\n this.saveMessages([message], {storage, isScheduled: true});\n const newMessage = this.getMessageFromStorage(storage, mid);\n\n if(oldMessage) {\n this.handleEditedMessage(oldMessage, newMessage, storage);\n this.rootScope.dispatchEvent('message_edit', {storageKey: storage.key, peerId, mid: message.mid, message});\n } else {\n const pendingMessage = this.checkPendingMessage(message);\n if(!pendingMessage) {\n this.rootScope.dispatchEvent('scheduled_new', message as Message.message);\n }\n }\n };\n\n private onUpdateDeleteScheduledMessages = (update: Update.updateDeleteScheduledMessages) => {\n const peerId = this.appPeersManager.getPeerId(update.peer);\n\n const storage = this.scheduledMessagesStorage[peerId];\n if(storage) {\n const mids = update.messages.map((id) => generateMessageId(id));\n this.handleDeletedMessages(peerId, storage, mids);\n\n this.rootScope.dispatchEvent('scheduled_delete', {peerId, mids});\n }\n };\n\n private onUpdateMessageExtendedMedia = (update: Update.updateMessageExtendedMedia) => {\n const peerId = this.appPeersManager.getPeerId(update.peer);\n const mid = generateMessageId(update.msg_id);\n const storage = this.getHistoryMessagesStorage(peerId);\n if(!storage.has(mid)) {\n // this.fixDialogUnreadMentionsIfNoMessage(peerId);\n return;\n }\n\n const message = this.getMessageFromStorage(storage, mid) as Message.message;\n const messageMedia = message.media as MessageMedia.messageMediaInvoice;\n if(messageMedia.extended_media?._ === 'messageExtendedMedia') {\n return;\n }\n\n messageMedia.extended_media = update.extended_media;\n this.onUpdateEditMessage({\n _: 'updateEditMessage',\n message,\n pts: 0,\n pts_count: 0\n });\n };\n\n private onUpdateTranscribedAudio = (update: Update.updateTranscribedAudio) => {\n const peerId = this.appPeersManager.getPeerId(update.peer);\n const text = update.text;\n const mid = generateMessageId(update.msg_id);\n\n this.rootScope.dispatchEvent('message_transcribed', {peerId, mid, text, pending: update.pFlags.pending});\n };\n\n public setDialogToStateIfMessageIsTop(message: MyMessage) {\n if(this.isMessageIsTopMessage(message)) {\n this.dialogsStorage.setDialogToState(this.getDialogOnly(message.peerId));\n }\n }\n\n public isMessageIsTopMessage(message: MyMessage) {\n const dialog = this.getDialogOnly(message.peerId);\n return dialog && dialog.top_message === message.mid;\n }\n\n private updateMessageRepliesIfNeeded(threadMessage: MyMessage) {\n try { // * на всякий случай, скорее всего это не понадобится\n const threadKey = this.getThreadKey(threadMessage);\n if(threadKey) {\n const repliesKey = this.threadsToReplies[threadKey];\n if(repliesKey) {\n const [peerId, mid] = repliesKey.split('_');\n\n this.updateMessage(peerId.toPeerId(), +mid, 'replies_updated');\n }\n }\n } catch(err) {\n this.log.error('incrementMessageReplies err', err, threadMessage);\n }\n }\n\n private getThreadKey(threadMessage: MyMessage) {\n let threadKey = '';\n if(threadMessage?.peerId?.isAnyChat()) {\n const threadId = getMessageThreadId(threadMessage, this.appChatsManager.isForum(threadMessage.peerId.toChatId()));\n if(threadId) {\n threadKey = threadMessage.peerId + '_' + threadId;\n }\n }\n\n return threadKey;\n }\n\n public updateMessage(peerId: PeerId, mid: number, broadcastEventName?: 'replies_updated'): Promise {\n const promise: Promise = this.reloadMessages(peerId, mid, true).then(() => {\n const message = this.getMessageByPeer(peerId, mid) as Message.message;\n if(!message) {\n return;\n }\n\n if(broadcastEventName) {\n this.rootScope.dispatchEvent(broadcastEventName, message);\n }\n\n return message;\n });\n\n return promise;\n }\n\n private checkPendingMessage(message: MyMessage) {\n const randomId = this.pendingByMessageId[message.mid];\n let pendingMessage: ReturnType;\n if(randomId) {\n const pendingData = this.pendingByRandomId[randomId];\n if(pendingMessage = this.finalizePendingMessage(randomId, message)) {\n this.rootScope.dispatchEvent('history_update', {\n storageKey: pendingData.storage.key,\n message,\n sequential: pendingData.sequential\n });\n }\n\n delete this.pendingByMessageId[message.mid];\n }\n\n return pendingMessage;\n }\n\n public mutePeer(options: {peerId: PeerId, muteUntil: number, threadId?: number}) {\n if(!(options = this.appNotificationsManager.validatePeerSettings(options))) {\n return;\n }\n\n const {peerId, muteUntil, threadId} = options;\n const settings: InputPeerNotifySettings = {\n _: 'inputPeerNotifySettings'\n };\n\n settings.mute_until = muteUntil;\n\n const peer = this.appPeersManager.getInputPeerById(peerId);\n return this.appNotificationsManager.updateNotifySettings(threadId ? {\n _: 'inputNotifyForumTopic',\n peer,\n top_msg_id: getServerMessageId(threadId)\n } : {\n _: 'inputNotifyPeer',\n peer\n }, settings);\n }\n\n public togglePeerMute({peerId, mute, threadId}: {peerId: PeerId, mute?: boolean, threadId?: number}) {\n if(mute === undefined) {\n mute = !this.appNotificationsManager.isPeerLocalMuted({peerId, respectType: false, threadId});\n }\n\n return this.mutePeer({peerId, muteUntil: mute ? MUTE_UNTIL : 0, threadId});\n }\n\n private findPeerIdByMids(mids: number[]) {\n for(let length = mids.length, i = length - 1; i >= 0; --i) {\n const mid = mids[i];\n const message = this.getMessageById(mid);\n if(message) {\n return message.peerId;\n }\n }\n }\n\n public canSendToPeer(peerId: PeerId, threadId?: number, action: ChatRights = 'send_messages') {\n if(this.appPeersManager.isPeerRestricted(peerId)) {\n return false;\n }\n\n if(peerId.isAnyChat()) {\n const chatId = peerId.toChatId();\n if(threadId) {\n const topic = this.dialogsStorage.getForumTopic(peerId, threadId);\n if(topic?.pFlags?.closed && !this.appChatsManager.hasRights(chatId, 'manage_topics')) {\n return false;\n }\n }\n\n // const isChannel = appPeersManager.isChannel(peerId);\n const chat = this.appChatsManager.getChat(chatId) as Chat.chat;\n const hasRights = /* isChannel && */this.appChatsManager.hasRights(chatId, action, undefined, !!threadId);\n return /* !isChannel || */hasRights && (!chat.pFlags.left || !!threadId);\n } else {\n return this.appUsersManager.canSendToUser(peerId);\n }\n }\n\n public finalizePendingMessage(randomId: Long, finalMessage: MyMessage) {\n const pendingData = this.pendingByRandomId[randomId];\n if(!pendingData) {\n return;\n }\n\n const {peerId, tempId, threadId, storage} = pendingData;\n\n [\n this.getHistoryStorage(peerId),\n threadId ? this.getHistoryStorage(peerId, threadId) : undefined\n ]\n .filter(Boolean)\n .forEach((storage) => {\n storage.history.delete(tempId);\n });\n\n // this.log('pending', randomID, historyStorage.pending)\n\n const tempMessage: MyMessage = this.getMessageFromStorage(storage, tempId);\n if(tempMessage) {\n delete finalMessage.pFlags.is_outgoing;\n delete finalMessage.pending;\n delete finalMessage.error;\n delete finalMessage.random_id;\n delete finalMessage.send;\n }\n\n this.rootScope.dispatchEvent('messages_pending');\n\n delete this.pendingByRandomId[randomId];\n\n this.finalizePendingMessageCallbacks(storage, tempId, finalMessage);\n\n return tempMessage;\n }\n\n public finalizePendingMessageCallbacks(storage: MessagesStorage, tempId: number, message: MyMessage) {\n const callbacks = this.tempFinalizeCallbacks[tempId];\n // this.log.warn(callbacks, tempId);\n if(callbacks !== undefined) {\n for(const name in callbacks) {\n const {deferred, callback} = callbacks[name];\n // this.log(`finalizePendingMessageCallbacks: will invoke ${name} callback`);\n callback(message).then(deferred.resolve, deferred.reject);\n }\n\n delete this.tempFinalizeCallbacks[tempId];\n }\n\n // set cached url to media\n if((message as Message.message).media) {\n assumeType(message);\n const {photo: newPhoto, document: newDoc} = message.media as any;\n if(newPhoto) {\n const photo = this.appPhotosManager.getPhoto('' + tempId);\n if(/* photo._ !== 'photoEmpty' */photo) {\n const newPhotoSize = newPhoto.sizes[newPhoto.sizes.length - 1];\n const cacheContext = this.thumbsStorage.getCacheContext(newPhoto, newPhotoSize.type);\n const oldCacheContext = this.thumbsStorage.getCacheContext(photo, THUMB_TYPE_FULL);\n Object.assign(cacheContext, oldCacheContext);\n\n const photoSize = newPhoto.sizes[newPhoto.sizes.length - 1] as PhotoSize.photoSize;\n\n const downloadOptions = getPhotoDownloadOptions(newPhoto, photoSize);\n const fileName = getFileNameByLocation(downloadOptions.location);\n // this.appDownloadManager.fakeDownload(fileName, oldCacheContext.url);\n }\n } else if(newDoc) {\n const oldDoc = this.appDocsManager.getDoc('' + tempId);\n if(oldDoc) {\n const oldCacheContext = this.thumbsStorage.getCacheContext(oldDoc);\n if(\n /* doc._ !== 'documentEmpty' && */\n oldDoc.type &&\n oldDoc.type !== 'sticker' &&\n oldDoc.mime_type !== 'image/gif' &&\n oldCacheContext.url\n ) {\n const cacheContext = this.thumbsStorage.getCacheContext(newDoc);\n Object.assign(cacheContext, oldCacheContext);\n\n const fileName = getDocumentInputFileName(newDoc);\n // this.appDownloadManager.fakeDownload(fileName, oldCacheContext.url);\n }\n }\n } else if((message.media as MessageMedia.messageMediaPoll).poll) {\n delete this.appPollsManager.polls[tempId];\n delete this.appPollsManager.results[tempId];\n }\n }\n\n const tempMessage = this.getMessageFromStorage(storage, tempId);\n storage.delete(tempId);\n\n if(!(tempMessage as Message.message).reply_markup && (message as Message.message).reply_markup) {\n setTimeout(() => { // TODO: refactor it to normal buttons adding\n if(!this.getMessageFromStorage(storage, message.mid)) {\n return;\n }\n\n this.rootScope.dispatchEvent('message_edit', {storageKey: storage.key, peerId: message.peerId, mid: message.mid, message});\n }, 0);\n }\n\n this.handleReleasingMessage(tempMessage, storage);\n\n this.rootScope.dispatchEvent('message_sent', {storageKey: storage.key, tempId, tempMessage, mid: message.mid, message});\n }\n\n public incrementMaxSeenId(maxId: number) {\n if(!maxId || !(!this.maxSeenId || maxId > this.maxSeenId)) {\n return false;\n }\n\n this.maxSeenId = maxId;\n this.appStateManager.pushToState('maxSeenMsgId', maxId);\n\n this.apiManager.invokeApi('messages.receivedMessages', {\n max_id: getServerMessageId(maxId)\n });\n }\n\n public async getMessageReactionsListAndReadParticipants(\n message: Message.message,\n limit?: number,\n reaction?: Reaction,\n offset?: string,\n skipReadParticipants?: boolean,\n skipReactionsList?: boolean\n ) {\n const emptyMessageReactionsList = {\n reactions: [] as MessagePeerReaction[],\n count: 0,\n next_offset: undefined as string\n };\n\n const canViewMessageReadParticipants = await this.canViewMessageReadParticipants(message);\n if(canViewMessageReadParticipants && limit === undefined) {\n limit = 100;\n } else if(limit === undefined) {\n limit = 50;\n }\n\n return Promise.all([\n canViewMessageReadParticipants && !reaction && !skipReadParticipants ? this.getMessageReadParticipants(message.peerId, message.mid).catch(() => [] as UserId[]) : [] as UserId[],\n\n message.reactions?.recent_reactions?.length && !skipReactionsList ? this.appReactionsManager.getMessageReactionsList(message.peerId, message.mid, limit, reaction, offset).catch((err) => emptyMessageReactionsList) : emptyMessageReactionsList\n ]).then(([userIds, messageReactionsList]) => {\n const readParticipantsPeerIds = userIds.map((userId) => userId.toPeerId());\n\n const filteredReadParticipants = readParticipantsPeerIds.slice();\n forEachReverse(filteredReadParticipants, (peerId, idx, arr) => {\n if(messageReactionsList.reactions.some((reaction) => this.appPeersManager.getPeerId(reaction.peer_id) === peerId)) {\n arr.splice(idx, 1);\n }\n });\n\n let combined: {peerId: PeerId, reaction?: Reaction}[] = messageReactionsList.reactions.map((reaction) => ({peerId: this.appPeersManager.getPeerId(reaction.peer_id), reaction: reaction.reaction}));\n combined = combined.concat(filteredReadParticipants.map((readPeerId) => ({peerId: readPeerId})));\n\n return {\n reactions: messageReactionsList.reactions,\n reactionsCount: messageReactionsList.count,\n readParticipants: readParticipantsPeerIds,\n combined: combined,\n nextOffset: messageReactionsList.next_offset\n };\n });\n }\n\n public getMessageReadParticipants(peerId: PeerId, mid: number): Promise {\n return this.apiManager.invokeApiSingle('messages.getMessageReadParticipants', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n msg_id: getServerMessageId(mid)\n }).then((userIds) => { // ! convert long to number\n return userIds.map((userId) => userId.toUserId());\n });\n }\n\n public async canViewMessageReadParticipants(message: Message) {\n if(\n message?._ !== 'message' ||\n message.pFlags.is_outgoing ||\n !message.pFlags.out ||\n !this.appPeersManager.isAnyGroup(message.peerId)\n ) {\n return false;\n }\n\n const chat = this.appChatsManager.getChat(message.peerId.toChatId()) as Chat.chat | Chat.channel;\n const appConfig = await this.apiManager.getAppConfig();\n return chat.participants_count <= appConfig.chat_read_mark_size_threshold &&\n (tsNow(true) - message.date) < appConfig.chat_read_mark_expire_period;\n }\n\n public incrementMessageViews(peerId: PeerId, mids: number[]) {\n if(!mids.length) {\n return;\n }\n\n return this.apiManager.invokeApiSingle('messages.getMessagesViews', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n id: mids.map((mid) => getServerMessageId(mid)),\n increment: true\n }).then((views) => {\n const updates: Update[] = new Array(mids.length);\n for(let i = 0, length = mids.length; i < length; ++i) {\n updates[i] = {\n _: 'updateChannelMessageViews',\n channel_id: NULL_PEER_ID,\n peerId,\n id: mids[i],\n views: views.views[i].views\n };\n }\n\n this.apiUpdatesManager.processUpdateMessage({\n _: 'updates',\n updates,\n chats: views.chats,\n users: views.users\n });\n });\n }\n\n private notifyAboutMessage(message: MyMessage, options: Partial<{\n fwdCount: number,\n peerReaction: MessagePeerReaction,\n peerTypeNotifySettings: PeerNotifySettings\n }> = {}) {\n const peerId = this.getMessagePeer(message);\n\n if(this.appPeersManager.isPeerRestricted(peerId)) {\n return;\n }\n\n const tabs = appTabsManager.getTabs();\n let tab = tabs.find((tab) => {\n const {chatPeerIds} = tab.state;\n return chatPeerIds[chatPeerIds.length - 1] === peerId;\n });\n\n if(!tab && tabs.length) {\n tabs.sort((a, b) => a.state.idleStartTime - b.state.idleStartTime);\n tab = !tabs[0].state.idleStartTime ? tabs[0] : tabs[tabs.length - 1];\n }\n\n const port = MTProtoMessagePort.getInstance();\n port.invokeVoid('notificationBuild', {\n message,\n ...options\n }, tab?.source);\n }\n\n public getScheduledMessagesStorage(peerId: PeerId) {\n return this.scheduledMessagesStorage[peerId] ??= this.createMessageStorage(peerId, 'scheduled');\n }\n\n public getScheduledMessageByPeer(peerId: PeerId, mid: number) {\n return this.getMessageFromStorage(this.getScheduledMessagesStorage(peerId), mid);\n }\n\n public getScheduledMessages(peerId: PeerId) {\n if(!this.canSendToPeer(peerId)) return;\n\n const storage = this.getScheduledMessagesStorage(peerId);\n if(storage.size) {\n return [...storage.keys()];\n }\n\n return this.apiManager.invokeApiSingle('messages.getScheduledHistory', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n hash: ''\n }).then((historyResult) => {\n if(historyResult._ !== 'messages.messagesNotModified') {\n this.appUsersManager.saveApiUsers(historyResult.users);\n this.appChatsManager.saveApiChats(historyResult.chats);\n\n const storage = this.getScheduledMessagesStorage(peerId);\n this.saveMessages(historyResult.messages, {storage, isScheduled: true});\n return [...storage.keys()];\n }\n\n return [];\n });\n }\n\n public sendScheduledMessages(peerId: PeerId, mids: number[]) {\n return this.apiManager.invokeApi('messages.sendScheduledMessages', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n id: mids.map((mid) => getServerMessageId(mid))\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n });\n }\n\n public deleteScheduledMessages(peerId: PeerId, mids: number[]) {\n return this.apiManager.invokeApi('messages.deleteScheduledMessages', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n id: mids.map((mid) => getServerMessageId(mid))\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n });\n }\n\n public getMessageWithReplies(message: Message.message) {\n return this.filterMessages(message, (message) => !!(message as Message.message).replies)[0] as any;\n }\n\n public getMessageWithCommentReplies(message: Message.message) {\n if(message.peerId !== REPLIES_PEER_ID) {\n message = this.getMessageWithReplies(message);\n const replies = message?.replies;\n if(!(replies && replies.pFlags.comments && replies.channel_id.toChatId() !== REPLIES_HIDDEN_CHANNEL_ID)) {\n return;\n }\n }\n\n return message;\n }\n\n public isFetchIntervalNeeded(peerId: PeerId) {\n return peerId.isAnyChat() && (\n !this.appChatsManager.isInChat(peerId.toChatId()) ||\n this.appChatsManager.isForum(peerId.toChatId())\n );\n }\n\n public async getNewHistory(peerId: PeerId, threadId?: number) {\n if(!this.isFetchIntervalNeeded(peerId)) {\n return;\n }\n\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n const slice = historyStorage.history.slice;\n if(!slice.isEnd(SliceEnd.Bottom)) {\n return;\n }\n\n delete historyStorage.maxId;\n slice.unsetEnd(SliceEnd.Bottom);\n\n // if there is no id - then request by first id because cannot request by id 0 with backLimit\n const historyResult = await this.getHistory(peerId, slice[0] ?? 1, 0, 50, threadId);\n for(let i = 0, length = historyResult.history.length; i < length; ++i) {\n this.handleNewMessage(this.getMessageByPeer(peerId, historyResult.history[i]));\n }\n\n return {isBottomEnd: historyStorage.history.slice.isEnd(SliceEnd.Bottom)};\n }\n\n /**\n * * https://core.telegram.org/api/offsets, offset_id is inclusive\n */\n // public getHistory(peerId: PeerId, maxId?: number, limit?: number, backLimit?: number, threadId?: number, onlyCache?: false): Promise | HistoryResult;\n // public getHistory(peerId: PeerId, maxId?: number, limit?: number, backLimit?: number, threadId?: number, onlyCache?: true): HistoryResult;\n public getHistory(peerId: PeerId, maxId: number = 0, limit?: number, backLimit?: number, threadId?: number/* , onlyCache?: boolean */): Promise | HistoryResult {\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n\n if(this.appPeersManager.isPeerRestricted(peerId)) {\n const first = historyStorage.history.first;\n first.setEnd(SliceEnd.Both);\n\n const slice = first.slice(0, 0);\n slice.setEnd(SliceEnd.Both);\n\n return {\n count: 0,\n history: Array.from(slice),\n isEnd: slice.getEnds(),\n offsetIdOffset: 0\n };\n }\n\n let offset = 0;\n /*\n let offsetFound = true;\n\n if(maxId) {\n offsetFound = false;\n for(; offset < historyStorage.history.length; offset++) {\n if(maxId > historyStorage.history.slice[offset]) {\n offsetFound = true;\n break;\n }\n }\n }\n\n if(offsetFound && (\n historyStorage.count !== null && historyStorage.history.length === historyStorage.count ||\n historyStorage.history.length >= offset + limit\n )) {\n if(backLimit) {\n backLimit = Math.min(offset, backLimit);\n offset = Math.max(0, offset - backLimit);\n limit += backLimit;\n } else {\n limit = limit;\n }\n\n const history = historyStorage.history.slice.slice(offset, offset + limit);\n return {\n count: historyStorage.count,\n history: history,\n offsetIdOffset: offset\n };\n }\n\n if(offsetFound) {\n offset = 0;\n } */\n\n if(backLimit) {\n offset = -backLimit;\n limit += backLimit;\n\n /* return this.requestHistory(reqPeerId, maxId, limit, offset, undefined, threadId).then((historyResult) => {\n historyStorage.count = (historyResult as MessagesMessages.messagesMessagesSlice).count || historyResult.messages.length;\n\n const history = (historyResult.messages as MyMessage[]).map((message) => message.mid);\n return {\n count: historyStorage.count,\n history,\n offsetIdOffset: (historyResult as MessagesMessages.messagesMessagesSlice).offset_id_offset || 0\n };\n }); */\n }\n\n const haveSlice = historyStorage.history.sliceMe(maxId, offset, limit);\n if(haveSlice && (haveSlice.slice.length === limit || (haveSlice.fulfilled & SliceEnd.Both) === SliceEnd.Both)) {\n return {\n count: historyStorage.count,\n history: Array.from(haveSlice.slice),\n isEnd: haveSlice.slice.getEnds(),\n offsetIdOffset: haveSlice.offsetIdOffset\n };\n }\n\n // if(onlyCache) {\n // return;\n // }\n\n return this.fillHistoryStorage(peerId, maxId, limit, offset, historyStorage, threadId).then(() => {\n const slice = historyStorage.history.sliceMe(maxId, offset, limit);\n const f = slice?.slice || historyStorage.history.constructSlice();\n return {\n count: historyStorage.count,\n history: Array.from(f),\n isEnd: f.getEnds(),\n offsetIdOffset: slice?.offsetIdOffset || historyStorage.count\n };\n });\n }\n\n public isHistoryResultEnd(\n historyResult: Exclude,\n limit: number,\n add_offset: number,\n offset_id: number\n ) {\n const {offset_id_offset, messages} = historyResult as MessagesMessages.messagesMessagesSlice;\n\n const mids = messages.map((message) => {\n return (message as MyMessage).mid;\n });\n\n const count = (historyResult as MessagesMessages.messagesMessagesSlice).count || messages.length;\n\n const topWasMeantToLoad = add_offset < 0 ? limit + add_offset : limit;\n const bottomWasMeantToLoad = Math.abs(add_offset);\n\n let offsetIdOffset = offset_id_offset;\n let isTopEnd = false, isBottomEnd = false;\n\n // if(offsetIdOffset === undefined && !bottomWasMeantToLoad) {\n // offsetIdOffset = 0;\n // }\n\n if(offsetIdOffset !== undefined) {\n isTopEnd = offsetIdOffset >= (count - topWasMeantToLoad) || count < topWasMeantToLoad;\n isBottomEnd = !offsetIdOffset || (add_offset < 0 && (offsetIdOffset + add_offset) <= 0);\n } else if(offset_id && getServerMessageId(offset_id)) {\n let i = 0;\n for(const length = mids.length; i < length; ++i) {\n if(offset_id > mids[i]) {\n break;\n }\n }\n\n const topLoaded = messages.length - i;\n const bottomLoaded = mids.includes(offset_id) ? i - 1 : i;\n if(topWasMeantToLoad) isTopEnd = topLoaded < topWasMeantToLoad;\n if(bottomWasMeantToLoad) isBottomEnd = bottomLoaded < bottomWasMeantToLoad;\n\n if(isTopEnd || isBottomEnd) {\n offsetIdOffset = isTopEnd ? count - topLoaded : bottomLoaded;\n }\n }\n\n offsetIdOffset ??= 0;\n\n return {count, offsetIdOffset, isTopEnd, isBottomEnd, mids};\n }\n\n public mergeHistoryResult(\n slicedArray: SlicedArray,\n historyResult: Parameters[0],\n offset_id: number,\n limit: number,\n add_offset: number\n ) {\n const {messages} = historyResult as MessagesMessages.messagesMessagesSlice;\n const isEnd = this.isHistoryResultEnd(historyResult, limit, add_offset, offset_id);\n const {count, offsetIdOffset, isTopEnd, isBottomEnd, mids} = isEnd;\n\n // * add bound manually.\n // * offset_id will be inclusive only if there is 'add_offset' <= -1 (-1 - will only include the 'offset_id')\n // * check that offset_id is not 0\n if(offset_id && getServerMessageId(offset_id) && !mids.includes(offset_id) && offsetIdOffset < count) {\n let i = 0;\n for(const length = mids.length; i < length; ++i) {\n if(offset_id > mids[i]) {\n break;\n }\n }\n\n mids.splice(i, 0, offset_id);\n }\n\n const slice = slicedArray.insertSlice(mids) || slicedArray.slice;\n if(isTopEnd) {\n slice.setEnd(SliceEnd.Top);\n }\n\n if(isBottomEnd) {\n slice.setEnd(SliceEnd.Bottom);\n }\n\n return {slice, mids, messages, ...isEnd};\n }\n\n public fillHistoryStorage(peerId: PeerId, offset_id: number, limit: number, add_offset: number, historyStorage: HistoryStorage, threadId?: number): Promise {\n const wasMaxId = historyStorage.maxId;\n return this.requestHistory(peerId, offset_id, limit, add_offset, undefined, threadId).then((historyResult) => {\n const {count, isBottomEnd, slice, messages} = this.mergeHistoryResult(historyStorage.history, historyResult, offset_id, limit, add_offset);\n\n historyStorage.count = count;\n\n /* if(!maxId && historyResult.messages.length) {\n maxId = this.incrementMessageId((historyResult.messages[0] as MyMessage).mid, 1);\n }\n\n const wasTotalCount = historyStorage.history.length; */\n\n for(let i = 0, length = messages.length; i < length; ++i) {\n const message = messages[i] as MyMessage;\n if(this.mergeReplyKeyboard(historyStorage, message)) {\n this.rootScope.dispatchEvent('history_reply_markup', {peerId});\n }\n }\n\n if(isBottomEnd) {\n const newMaxId = slice[0];\n\n if(historyStorage.maxId === wasMaxId) {\n const first = historyStorage.history.first;\n if(first !== slice) {\n historyStorage.history.deleteSlice(first);\n }\n\n if(historyStorage.maxId !== newMaxId) {\n historyStorage.maxId = slice[0]; // ! WARNING\n\n this.reloadConversation(peerId); // when top_message is deleted but cached\n }\n }\n }\n\n /* const isBackLimit = offset < 0 && -offset !== fullLimit;\n if(isBackLimit) {\n return;\n }\n\n const totalCount = historyStorage.history.length;\n fullLimit -= (totalCount - wasTotalCount);\n\n const migratedNextPeer = this.migratedFromTo[peerId];\n const migratedPrevPeer = this.migratedToFrom[peerId]\n const isMigrated = migratedNextPeer !== undefined || migratedPrevPeer !== undefined;\n\n if(isMigrated) {\n historyStorage.count = Math.max(historyStorage.count, totalCount) + 1;\n }\n\n if(fullLimit > 0) {\n maxId = historyStorage.history.slice[totalCount - 1];\n if(isMigrated) {\n if(!historyResult.messages.length) {\n if(migratedPrevPeer) {\n maxId = 0;\n peerId = migratedPrevPeer;\n } else {\n historyStorage.count = totalCount;\n return true;\n }\n }\n\n return this.fillHistoryStorage(peerId, maxId, fullLimit, historyStorage, threadId);\n } else if(totalCount < historyStorage.count) {\n return this.fillHistoryStorage(peerId, maxId, fullLimit, offset, historyStorage, threadId);\n }\n } */\n });\n }\n\n public requestHistory(peerId: PeerId, maxId: number, limit = 0, offset = 0, offsetDate = 0, threadId = 0): Promise> {\n // console.trace('requestHistory', peerId, maxId, limit, offset);\n\n // rootScope.broadcast('history_request');\n\n const options: MessagesGetReplies | MessagesGetHistory = {\n peer: this.appPeersManager.getInputPeerById(peerId),\n offset_id: getServerMessageId(maxId) || 0,\n offset_date: offsetDate,\n add_offset: offset,\n limit,\n max_id: 0,\n min_id: 0,\n hash: 0\n };\n\n if(threadId) {\n (options as MessagesGetReplies).msg_id = getServerMessageId(threadId) || 0;\n }\n\n const promise: ReturnType = this.apiManager.invokeApiSingle(threadId ? 'messages.getReplies' : 'messages.getHistory', options, {\n // timeout: APITIMEOUT,\n noErrorBox: true\n }) as any;\n\n return promise.then((historyResult) => {\n if(DEBUG) {\n this.log('requestHistory result:', peerId, historyResult, maxId, limit, offset);\n }\n\n this.appUsersManager.saveApiUsers(historyResult.users);\n this.appChatsManager.saveApiChats(historyResult.chats);\n this.saveMessages(historyResult.messages);\n\n if('pts' in historyResult) {\n this.apiUpdatesManager.addChannelState(peerId.toChatId(), historyResult.pts);\n }\n\n let length = historyResult.messages.length, count = (historyResult as MessagesMessages.messagesMessagesSlice).count;\n if(length && !historyResult.messages[length - 1]) {\n historyResult.messages.splice(length - 1, 1);\n length--;\n count--;\n }\n\n // will load more history if last message is album grouped (because it can be not last item)\n // historyResult.messages: desc sorted\n const historyStorage = this.getHistoryStorage(peerId, threadId);\n const oldestMessage: Message.message = historyResult.messages[length - 1] as any;\n if(length && oldestMessage.grouped_id) {\n const foundSlice = historyStorage.history.findSlice(oldestMessage.mid);\n if(foundSlice && (foundSlice.slice.length + historyResult.messages.length) < count) {\n return this.requestHistory(peerId, oldestMessage.mid, 10, 0, offsetDate, threadId).then((_historyResult) => {\n return historyResult;\n });\n }\n }\n\n return historyResult;\n }, (error) => {\n switch(error.type) {\n case 'CHANNEL_PRIVATE':\n let channel = this.appChatsManager.getChat(peerId.toChatId());\n if(channel._ === 'channel') {\n channel = {\n _: 'channelForbidden',\n id: peerId.toChatId(),\n access_hash: channel.access_hash,\n title: channel.title,\n pFlags: channel.pFlags\n };\n }\n\n this.apiUpdatesManager.processUpdateMessage({\n _: 'updates',\n updates: [{\n _: 'updateChannel',\n channel_id: peerId.toChatId()\n }],\n chats: [channel],\n users: []\n });\n break;\n }\n\n throw error;\n });\n }\n\n public fetchSingleMessages() {\n if(this.fetchSingleMessagesPromise) {\n return this.fetchSingleMessagesPromise;\n }\n\n return this.fetchSingleMessagesPromise = pause(0).then(() => {\n const requestPromises: Promise[] = [];\n\n for(const [peerId, map] of this.needSingleMessages) {\n const mids = [...map.keys()];\n const msgIds: InputMessage[] = mids.map((mid) => {\n return {\n _: 'inputMessageID',\n id: getServerMessageId(mid)\n };\n });\n\n let promise: Promise;\n if(peerId.isAnyChat() && this.appPeersManager.isChannel(peerId)) {\n promise = this.apiManager.invokeApiSingle('channels.getMessages', {\n channel: this.appChatsManager.getChannelInput(peerId.toChatId()),\n id: msgIds\n });\n } else {\n promise = this.apiManager.invokeApiSingle('messages.getMessages', {\n id: msgIds\n });\n }\n\n const after = promise.then((getMessagesResult) => {\n assumeType>(getMessagesResult);\n\n this.appUsersManager.saveApiUsers(getMessagesResult.users);\n this.appChatsManager.saveApiChats(getMessagesResult.chats);\n const messages = this.saveMessages(getMessagesResult.messages);\n\n for(let i = 0; i < messages.length; ++i) {\n const message = messages[i];\n if(!message) {\n continue;\n }\n\n const mid = generateMessageId(message.id);\n const promise = map.get(mid);\n promise.resolve(message);\n map.delete(mid);\n }\n\n if(map.size) {\n for(const [mid, promise] of map) {\n promise.resolve(this.generateEmptyMessage(mid));\n }\n }\n }).finally(() => {\n this.rootScope.dispatchEvent('messages_downloaded', {peerId, mids});\n });\n\n requestPromises.push(after);\n }\n\n this.needSingleMessages.clear();\n\n return Promise.all(requestPromises).then(noop, noop).then(() => {\n this.fetchSingleMessagesPromise = undefined;\n if(this.needSingleMessages.size) this.fetchSingleMessages();\n });\n });\n }\n\n public reloadMessages(peerId: PeerId, mid: number, overwrite?: boolean): Promise;\n public reloadMessages(peerId: PeerId, mid: number[], overwrite?: boolean): Promise;\n public reloadMessages(peerId: PeerId, mid: number | number[], overwrite?: boolean): Promise {\n if(Array.isArray(mid)) {\n return Promise.all(mid.map((mid) => {\n return this.reloadMessages(peerId, mid, overwrite);\n }));\n }\n\n const message = this.getMessageByPeer(peerId, mid);\n if(message && !overwrite) {\n this.rootScope.dispatchEvent('messages_downloaded', {peerId, mids: [mid]});\n return Promise.resolve(message);\n } else {\n let map = this.needSingleMessages.get(peerId);\n if(!map) {\n this.needSingleMessages.set(peerId, map = new Map());\n }\n\n let promise = map.get(mid);\n if(promise) {\n return promise;\n }\n\n promise = deferredPromise();\n map.set(mid, promise);\n this.fetchSingleMessages();\n return promise;\n }\n }\n\n public getExtendedMedia(peerId: PeerId, mids: number[]) {\n let map = this.extendedMedia.get(peerId);\n if(!map) {\n this.extendedMedia.set(peerId, map = new Map());\n }\n\n const deferred = deferredPromise();\n const toRequest: number[] = [];\n const promises = mids.map((mid) => {\n let promise = map.get(mid);\n if(!promise) {\n map.set(mid, promise = deferred);\n toRequest.push(mid);\n\n promise.then(() => {\n map.delete(mid);\n if(!map.size && this.extendedMedia.get(peerId) === map) {\n this.extendedMedia.delete(peerId);\n }\n });\n }\n\n return promise;\n });\n\n if(!toRequest.length) {\n deferred.resolve();\n } else {\n this.apiManager.invokeApi('messages.getExtendedMedia', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n id: toRequest.map((mid) => getServerMessageId(mid))\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n deferred.resolve();\n });\n }\n\n return Promise.all(promises);\n }\n\n public fetchMessageReplyTo(message: MyMessage) {\n if(!message.reply_to_mid) return Promise.resolve(this.generateEmptyMessage(0));\n const replyToPeerId = message.reply_to.reply_to_peer_id ? this.appPeersManager.getPeerId(message.reply_to.reply_to_peer_id) : message.peerId;\n return this.reloadMessages(replyToPeerId, message.reply_to_mid).then((originalMessage) => {\n if(!originalMessage) { // ! break the infinite loop\n message = this.getMessageByPeer(message.peerId, message.mid); // message can come from other thread\n delete message.reply_to_mid; // ! WARNING!\n }\n\n if(message._ === 'messageService') {\n const peerId = message.peerId;\n this.rootScope.dispatchEvent('message_edit', {\n storageKey: `${peerId}_history`,\n peerId: peerId,\n mid: message.mid,\n message\n });\n\n if(this.isMessageIsTopMessage(message)) {\n this.rootScope.dispatchEvent('dialogs_multiupdate', new Map([[peerId, {dialog: this.getDialogOnly(peerId)}]]));\n }\n }\n\n return originalMessage;\n });\n }\n\n private getTypingKey(peerId: PeerId, threadId?: number) {\n return threadId ? `${peerId}_${threadId}` : peerId;\n }\n\n public setTyping(\n peerId: PeerId,\n action: SendMessageAction,\n force?: boolean,\n threadId?: number\n ): Promise {\n if(threadId && !this.appPeersManager.isForum(peerId)) {\n threadId = undefined;\n }\n\n const key = this.getTypingKey(peerId, threadId);\n let typing = this.typings[key];\n if(\n !peerId ||\n !this.canSendToPeer(peerId) ||\n peerId === this.appPeersManager.peerId ||\n // (!force && deepEqual(typing?.action, action))\n (!force && typing?.action?._ === action._)\n ) {\n return Promise.resolve(false);\n }\n\n if(typing?.timeout) {\n clearTimeout(typing.timeout);\n }\n\n typing = this.typings[key] = {\n action\n };\n\n return this.apiManager.invokeApi('messages.setTyping', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n action,\n top_msg_id: threadId ? getServerMessageId(threadId) : undefined\n }).finally(() => {\n if(typing === this.typings[key]) {\n typing.timeout = ctx.setTimeout(() => {\n delete this.typings[key];\n }, 6000);\n }\n });\n }\n\n private handleReleasingMessage(message: MyMessage, storage: MessagesStorage) {\n const media = (message as Message.message).media;\n if(media) {\n const c = (media as MessageMedia.messageMediaWebPage).webpage as WebPage.webPage || media as MessageMedia.messageMediaPhoto | MessageMedia.messageMediaDocument;\n const smth: Photo.photo | MyDocument = (c as MessageMedia.messageMediaPhoto).photo as any || (c as MessageMedia.messageMediaDocument).document as any;\n\n if(smth?.file_reference) {\n this.referenceDatabase.deleteContext(smth.file_reference, {type: 'message', peerId: message.peerId, messageId: message.mid});\n }\n\n if('webpage' in media && media.webpage) {\n const isScheduled = this.getScheduledMessagesStorage(message.peerId) === storage;\n const messageKey = this.appWebPagesManager.getMessageKeyForPendingWebPage(message.peerId, message.mid, isScheduled);\n this.appWebPagesManager.deleteWebPageFromPending(media.webpage, messageKey);\n }\n\n if((media as MessageMedia.messageMediaPoll).poll) {\n this.appPollsManager.updatePollToMessage(message as Message.message, false);\n }\n }\n }\n\n private handleDeletedMessages(peerId: PeerId, storage: MessagesStorage, messages: number[]) {\n const history: {\n count: number,\n unread: number,\n unreadMentions: number,\n msgs: Set,\n albums?: {[groupId: string]: Set},\n } = {\n count: 0,\n unread: 0,\n unreadMentions: 0,\n msgs: new Set()\n };\n\n for(const mid of messages) {\n const message: MyMessage = this.getMessageFromStorage(storage, mid);\n if(!message) {\n this.fixDialogUnreadMentionsIfNoMessage(peerId);\n continue;\n }\n\n this.handleReleasingMessage(message, storage);\n\n this.updateMessageRepliesIfNeeded(message);\n\n if(!message.pFlags.out && !message.pFlags.is_outgoing && message.pFlags.unread) {\n ++history.unread;\n this.rootScope.dispatchEvent('notification_cancel', 'msg' + mid);\n\n if(message.pFlags.mentioned) {\n ++history.unreadMentions;\n this.modifyCachedMentions(peerId, mid, false);\n }\n }\n\n ++history.count;\n history.msgs.add(mid);\n\n message.deleted = true;\n\n const groupedId = (message as Message.message).grouped_id;\n if(groupedId) {\n const groupedStorage = this.groupedMessagesStorage[groupedId];\n if(groupedStorage) {\n groupedStorage.delete(mid);\n\n if(!history.albums) history.albums = {};\n (history.albums[groupedId] || (history.albums[groupedId] = new Set())).add(mid);\n\n if(!groupedStorage.size) {\n delete history.albums;\n delete this.groupedMessagesStorage[groupedId];\n }\n }\n }\n\n storage.delete(mid);\n }\n\n if(history.albums) {\n for(const groupedId in history.albums) {\n this.dispatchAlbumEdit(groupedId, storage, [...history.albums[groupedId]]);\n /* const mids = this.getMidsByAlbum(groupId);\n if(mids.length) {\n const mid = Math.max(...mids);\n rootScope.$broadcast('message_edit', {peerId, mid, justMedia: false});\n } */\n }\n }\n\n return history;\n }\n\n private handleEditedMessage(oldMessage: Message, newMessage: Message, storage: MessagesStorage) {\n if(oldMessage._ === 'message') {\n if((oldMessage.media as MessageMedia.messageMediaWebPage)?.webpage) {\n const messageKey = this.appWebPagesManager.getMessageKeyForPendingWebPage(oldMessage.peerId, oldMessage.mid, !!oldMessage.pFlags.is_scheduled);\n this.appWebPagesManager.deleteWebPageFromPending((oldMessage.media as MessageMedia.messageMediaWebPage).webpage, messageKey);\n }\n\n const groupedId = oldMessage.grouped_id;\n if(groupedId) {\n this.dispatchAlbumEdit(groupedId, storage, []);\n }\n }\n }\n\n private dispatchAlbumEdit(groupedId: string, storage: MessagesStorage, deletedMids?: number[]) {\n const mids = this.getMidsByAlbum(groupedId);\n const messages = mids.map((mid) => this.getMessageFromStorage(storage, mid)) as Message.message[];\n this.rootScope.dispatchEvent('album_edit', {peerId: messages[0].peerId, groupId: groupedId, deletedMids: deletedMids || [], messages});\n }\n\n public getDialogUnreadCount(dialog: Dialog | ForumTopic) {\n let unreadCount = dialog.unread_count;\n if(!this.dialogsStorage.isTopic(dialog) && this.appPeersManager.isForum(dialog.peerId)) {\n const forumUnreadCount = this.dialogsStorage.getForumUnreadCount(dialog.peerId);\n if(forumUnreadCount instanceof Promise) {\n unreadCount = 0;\n } else {\n unreadCount = forumUnreadCount.count;\n }\n }\n\n return unreadCount || +!!(dialog as Dialog).pFlags?.unread_mark;\n }\n\n public isDialogUnread(dialog: Dialog | ForumTopic) {\n return !!this.getDialogUnreadCount(dialog);\n }\n\n public canForward(message: Message.message | Message.messageService) {\n return message?._ === 'message' && !(message as Message.message).pFlags.noforwards && !this.appPeersManager.noForwards(message.peerId);\n }\n\n private pushBatchUpdate(\n event: E,\n callback: C,\n key: string,\n getElementCallback?: () => MapValueType[0]>\n ) {\n let details = this.batchUpdates[event];\n if(!details) {\n // @ts-ignore\n details = this.batchUpdates[event] = {\n callback,\n batch: new Map()\n };\n }\n\n if(!details.batch.has(key)) {\n // @ts-ignore\n details.batch.set(key, getElementCallback ? getElementCallback() : undefined);\n this.batchUpdatesDebounced();\n }\n }\n\n private getMessagesFromMap>(map: T) {\n const newMap: Map> = new Map();\n for(const [key, value] of map) {\n const [peerIdStr, mid] = key.split('_');\n const message = this.getMessageByPeer(peerIdStr.toPeerId(), +mid) as Message.message;\n if(!message) {\n continue;\n }\n\n newMap.set(message, value);\n }\n\n return newMap;\n }\n\n private batchUpdateViews = (batch: Map) => {\n const toDispatch: {peerId: PeerId, mid: number, views: number}[] = [];\n\n const map = this.getMessagesFromMap(batch);\n for(const [message] of map) {\n toDispatch.push({\n peerId: message.peerId,\n mid: message.mid,\n views: message.views\n })\n }\n\n return toDispatch;\n };\n\n private batchUpdateReactions = (batch: Map) => {\n const toDispatch: {message: Message.message, changedResults: ReactionCount.reactionCount[]}[] = [];\n\n const map = this.getMessagesFromMap(batch);\n for(const [message, previousReactions] of map) {\n const results = message.reactions?.results ?? [];\n const previousResults = previousReactions?.results ?? [];\n const changedResults = results.filter((reactionCount) => {\n const previousReactionCount = previousResults.find((_reactionCount) => reactionsEqual(_reactionCount.reaction, reactionCount.reaction));\n return (\n message.pFlags.out && (\n !previousReactionCount ||\n reactionCount.count > previousReactionCount.count\n )\n ) || (\n reactionCount.chosen_order !== undefined && (\n !previousReactionCount ||\n previousReactionCount.chosen_order === undefined\n )\n );\n });\n\n toDispatch.push({message, changedResults});\n }\n\n return toDispatch;\n };\n\n public saveDefaultSendAs(peerId: PeerId, sendAsPeerId: PeerId) {\n const channelFull = this.appProfileManager.getCachedFullChat(peerId.toChatId()) as ChatFull.channelFull;\n channelFull.default_send_as = this.appPeersManager.getOutputPeer(sendAsPeerId);\n return this.apiManager.invokeApi('messages.saveDefaultSendAs', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n send_as: this.appPeersManager.getInputPeerById(sendAsPeerId)\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {getFileNameByLocation} from '../../../../helpers/fileName';\nimport {Document} from '../../../../layer';\nimport getDocumentInputFileLocation from './getDocumentInputFileLocation';\n\nexport default function getDocumentInputFileName(doc: Document.document, thumbSize?: string) {\n return getFileNameByLocation(getDocumentInputFileLocation(doc, thumbSize), {fileName: doc.file_name});\n}\n","export default function convertInputKeyToKey(inputKey: string) {\n const str = inputKey.replace('input', '');\n return (str[0].toLowerCase() + str.slice(1)) as T;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport tsNow from '../../helpers/tsNow';\nimport {InputNotifyPeer, InputPeerNotifySettings, NotifyPeer, PeerNotifySettings, Update} from '../../layer';\nimport {MUTE_UNTIL} from '../mtproto/mtproto_config';\nimport throttle from '../../helpers/schedulers/throttle';\nimport convertInputKeyToKey from '../../helpers/string/convertInputKeyToKey';\nimport {AppManager} from './manager';\nimport ctx from '../../environment/ctx';\nimport assumeType from '../../helpers/assumeType';\nimport generateMessageId from './utils/messageId/generateMessageId';\n\ntype ImSadAboutIt = Promise | PeerNotifySettings;\ntype MyNotifyPeer = Exclude;\ntype MyInputNotifyPeer = Exclude;\nexport class AppNotificationsManager extends AppManager {\n private peerSettings = {\n notifyPeer: {} as {[peerId: string]: ImSadAboutIt},\n notifyUsers: null as ImSadAboutIt,\n notifyChats: null as ImSadAboutIt,\n notifyBroadcasts: null as ImSadAboutIt,\n notifyForumTopic: {} as {[peerId_threadId: string]: ImSadAboutIt}\n };\n // private exceptions: {[peerId: string]: PeerNotifySettings} = {};\n\n private getNotifyPeerTypePromise: Promise;\n\n private checkMuteUntilTimeout: number;\n private checkMuteUntilThrottled: () => void;\n\n private notifyContactsSignUp: Promise;\n\n protected after() {\n this.checkMuteUntilThrottled = throttle(this.checkMuteUntil, 1000, false);\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateNotifySettings: (update) => {\n const {peer} = update;\n const isTopic = peer._ === 'notifyForumTopic';\n const isPeerType = peer._ === 'notifyPeer' || isTopic;\n const peerId = isPeerType && this.appPeersManager.getPeerId(peer.peer);\n const key = !isPeerType ? peer._ : undefined;\n this.savePeerSettings({\n key,\n peerId,\n threadId: isTopic ? generateMessageId(peer.top_msg_id) : undefined,\n settings: update.notify_settings\n });\n this.rootScope.dispatchEvent('notify_settings', update);\n }\n });\n\n return this.appStateManager.getState().then((state) => {\n if(state.notifySettings) {\n for(const key in state.notifySettings) {\n assumeType(key);\n this.savePeerSettings({\n key,\n settings: state.notifySettings[key]\n });\n }\n }\n });\n }\n\n public getNotifySettings(peer: InputNotifyPeer): ImSadAboutIt {\n let key: any = convertInputKeyToKey(peer._);\n let obj: any = this.peerSettings[key as MyNotifyPeer];\n\n let peerId: PeerId;\n if(peer._ === 'inputNotifyPeer') {\n peerId = key = this.appPeersManager.getPeerId(peer.peer);\n obj = obj[key];\n }\n\n if(obj) {\n return obj;\n }\n\n return (obj || this.peerSettings)[key] = this.apiManager.invokeApi('account.getNotifySettings', {peer})\n .then((settings) => {\n this.savePeerSettings({\n key,\n peerId,\n settings\n });\n\n return settings;\n });\n }\n\n public getNotifyPeerTypeSettings() {\n if(this.getNotifyPeerTypePromise) return this.getNotifyPeerTypePromise;\n\n const promises = (['inputNotifyBroadcasts', 'inputNotifyUsers', 'inputNotifyChats'] as MyInputNotifyPeer[])\n .map((inputKey) => {\n return this.getNotifySettings({_: inputKey});\n });\n\n return this.getNotifyPeerTypePromise = Promise.all(promises);\n }\n\n public updateNotifySettings(peer: InputNotifyPeer, settings: InputPeerNotifySettings) {\n // this.savePeerSettings(peerId, settings);\n\n /* const inputSettings: InputPeerNotifySettings = copy(settings) as any;\n inputSettings._ = 'inputPeerNotifySettings'; */\n\n return this.apiManager.invokeApi('account.updateNotifySettings', {\n peer,\n settings\n }).then((value) => {\n if(value) {\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateNotifySettings',\n peer: {\n ...peer as any,\n _: convertInputKeyToKey(peer._)\n },\n notify_settings: { // ! WOW, IT WORKS !\n ...settings,\n _: 'peerNotifySettings'\n }\n });\n }\n });\n }\n\n // public getNotifyExceptions() {\n // apiManager.invokeApi('account.getNotifyExceptions', {compare_sound: true})\n // .then((updates) => {\n // apiUpdatesManager.processUpdateMessage(updates);\n // });\n // }\n\n public getContactSignUpNotification() {\n if(this.notifyContactsSignUp) return this.notifyContactsSignUp;\n return this.notifyContactsSignUp = this.apiManager.invokeApi('account.getContactSignUpNotification');\n }\n\n public setContactSignUpNotification(silent: boolean) {\n this.apiManager.invokeApi('account.setContactSignUpNotification', {silent})\n .then((value) => {\n this.notifyContactsSignUp = Promise.resolve(!silent);\n });\n }\n\n private checkMuteUntil = () => {\n if(this.checkMuteUntilTimeout !== undefined) {\n clearTimeout(this.checkMuteUntilTimeout);\n this.checkMuteUntilTimeout = undefined;\n }\n\n const timestamp = tsNow(true);\n let closestMuteUntil = MUTE_UNTIL;\n\n const p = (peerNotifySettings: ImSadAboutIt): peerNotifySettings is PeerNotifySettings => {\n if(peerNotifySettings instanceof Promise) {\n return false;\n }\n\n const muteUntil = peerNotifySettings.mute_until;\n if(!muteUntil) {\n return false;\n }\n\n if(muteUntil <= timestamp) {\n // ! do not delete it because peer's unique settings will be overwritten in getPeerLocalSettings with type's settings\n peerNotifySettings.mute_until = 0;\n return true;\n } else if(muteUntil < closestMuteUntil) {\n closestMuteUntil = muteUntil;\n }\n\n return false;\n };\n\n [\n 'notifyPeer' as const,\n 'notifyForumTopic' as const\n ].forEach((typeKey) => {\n for(const key in this.peerSettings[typeKey]) {\n const peerNotifySettings = this.peerSettings[typeKey][key];\n if(p(peerNotifySettings)) {\n const [peerId, topicId] = key.split('_');\n const peer = this.appPeersManager.getOutputPeer(peerId.toPeerId());\n this.apiUpdatesManager.saveUpdate({\n _: 'updateNotifySettings',\n peer: topicId ? {\n _: 'notifyForumTopic',\n peer,\n top_msg_id: +topicId\n } : {\n _: 'notifyPeer',\n peer\n },\n notify_settings: peerNotifySettings\n });\n }\n }\n });\n\n const timeout = Math.min(1800e3, (closestMuteUntil - timestamp) * 1000);\n this.checkMuteUntilTimeout = ctx.setTimeout(this.checkMuteUntil, timeout);\n };\n\n public getPeerKey(peerId: PeerId, threadId?: number) {\n return peerId + (threadId ? '_' + threadId : '');\n }\n\n public savePeerSettings({key, peerId, threadId, settings}: {\n key?: Exclude,\n peerId?: PeerId,\n threadId?: number,\n settings: PeerNotifySettings\n }) {\n let obj: any;\n if(peerId) {\n key = this.getPeerKey(peerId, threadId) as any;\n obj = this.peerSettings[threadId ? 'notifyForumTopic' : 'notifyPeer'];\n }\n\n (obj || this.peerSettings)[key] = settings;\n\n if(!peerId) {\n this.rootScope.dispatchEvent('notify_peer_type_settings', {key, settings});\n this.appStateManager.getState().then((state) => {\n const notifySettings = state.notifySettings;\n notifySettings[key] = settings;\n this.appStateManager.pushToState('notifySettings', notifySettings);\n });\n } else {\n this.checkMuteUntilThrottled();\n }\n\n // rootScope.broadcast('notify_settings', {peerId: peerId});\n }\n\n public isMuted(peerNotifySettings: PeerNotifySettings) {\n return peerNotifySettings._ === 'peerNotifySettings' &&\n (peerNotifySettings.silent || (peerNotifySettings.mute_until !== undefined && (peerNotifySettings.mute_until * 1000) > tsNow()));\n }\n\n private getPeerMuted(peerId: PeerId) {\n const ret = this.getNotifySettings({_: 'inputNotifyPeer', peer: this.appPeersManager.getInputPeerById(peerId)});\n return (ret instanceof Promise ? ret : Promise.resolve(ret))\n .then((peerNotifySettings) => this.isMuted(peerNotifySettings));\n }\n\n private getPeerLocalSettings({\n peerId,\n respectType = true,\n threadId\n }: {\n peerId: PeerId,\n respectType?: boolean,\n threadId?: number\n }): PeerNotifySettings {\n const n: PeerNotifySettings = {\n _: 'peerNotifySettings'\n };\n\n const peerKey = this.getPeerKey(peerId, threadId);\n const notifySettings = this.peerSettings[threadId ? 'notifyForumTopic' : 'notifyPeer'][peerKey];\n // if(!notifySettings || (notifySettings instanceof Promise)) return false;\n if(notifySettings && !(notifySettings instanceof Promise)) {\n Object.assign(n, notifySettings);\n }\n\n if(respectType) {\n const inputNotify = this.appPeersManager.getInputNotifyPeerById({peerId, ignorePeerId: true, threadId});\n const key = convertInputKeyToKey(inputNotify._);\n const typeNotifySettings = this.peerSettings[key as MyNotifyPeer];\n if(typeNotifySettings && !(typeNotifySettings instanceof Promise)) {\n for(const i in typeNotifySettings) {\n // @ts-ignore\n if(n[i] === undefined) {\n // @ts-ignore\n n[i] = typeNotifySettings[i];\n }\n }\n }\n }\n\n return n;\n }\n\n public validatePeerSettings[0]>(options: T): T {\n if(options.peerId === this.appPeersManager.peerId) return;\n if(options.threadId && !this.appPeersManager.isForum(options.peerId)) options.threadId = undefined;\n return options;\n }\n\n public isPeerLocalMuted(options: Parameters[0]): boolean {\n if(!(options = this.validatePeerSettings(options))) return false;\n\n if(options.threadId) {\n const notifySettings = this.getPeerLocalSettings({...options, respectType: false});\n if(notifySettings.silent !== undefined || notifySettings.mute_until !== undefined) {\n return this.isMuted(notifySettings);\n } else {\n return this.isPeerLocalMuted({...options, threadId: undefined});\n }\n }\n\n const notifySettings = this.getPeerLocalSettings(options);\n const isMuted = this.isMuted(notifySettings);\n return isMuted;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {Chat, ChatPhoto, DialogPeer, InputChannel, InputDialogPeer, InputNotifyPeer, InputPeer, Peer, Update, User, UserProfilePhoto} from '../../layer';\nimport type {LangPackKey} from '../langPack';\nimport {getRestrictionReason} from '../../helpers/restrictions';\nimport isObject from '../../helpers/object/isObject';\nimport {AppManager} from './manager';\nimport getPeerId from './utils/peers/getPeerId';\nimport isUser from './utils/peers/isUser';\nimport isAnyChat from './utils/peers/isAnyChat';\nimport {NULL_PEER_ID} from '../mtproto/mtproto_config';\nimport getPeerActiveUsernames from './utils/peers/getPeerActiveUsernames';\nimport isPeerRestricted from './utils/peers/isPeerRestricted';\nimport getPeerPhoto from './utils/peers/getPeerPhoto';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\n\nexport type PeerType = 'channel' | 'chat' | 'megagroup' | 'group' | 'saved';\nexport class AppPeersManager extends AppManager {\n public get peerId() {\n return this.appUsersManager.userId.toPeerId();\n }\n /* public savePeerInstance(peerId: PeerId, instance: any) {\n if(peerId < 0) appChatsManager.saveApiChat(instance);\n else appUsersManager.saveApiUser(instance);\n } */\n\n public canPinMessage(peerId: PeerId) {\n return peerId.isUser() || this.appChatsManager.hasRights(peerId.toChatId(), 'pin_messages');\n }\n\n public getPeerPhoto(peerId: PeerId) {\n const peer = this.getPeer(peerId) as User.user | Chat.channel;\n return getPeerPhoto(peer);\n }\n\n public getPeerMigratedTo(peerId: PeerId) {\n if(peerId.isUser()) {\n return false;\n }\n\n const chat = this.appChatsManager.getChat(peerId.toChatId()) as Chat.chat;\n const migratedTo = chat?.migrated_to;\n if(migratedTo && chat.pFlags.deactivated) {\n return getPeerId(migratedTo);\n }\n\n return false;\n }\n\n public getOutputPeer(peerId: PeerId): Peer {\n if(peerId.isUser()) {\n return {_: 'peerUser', user_id: peerId.toUserId()};\n }\n\n const chatId = peerId.toChatId();\n if(this.appChatsManager.isChannel(chatId)) {\n return {_: 'peerChannel', channel_id: chatId};\n }\n\n return {_: 'peerChat', chat_id: chatId};\n }\n\n public getPeerString(peerId: PeerId) {\n if(peerId.isUser()) {\n return this.appUsersManager.getUserString(peerId.toUserId());\n }\n return this.appChatsManager.getChatString(peerId.toChatId());\n }\n\n public getPeerUsername(peerId: PeerId) {\n return this.getPeerActiveUsernames(peerId)[0] || '';\n }\n\n public getPeerActiveUsernames(peerId: PeerId) {\n const peer = this.getPeer(peerId);\n return getPeerActiveUsernames(peer);\n }\n\n public getPeer(peerId: PeerId) {\n return peerId.isUser() ?\n this.appUsersManager.getUser(peerId.toUserId()) :\n this.appChatsManager.getChat(peerId.toChatId());\n }\n\n public getPeerId(peerId: Parameters[0]) {\n return getPeerId(peerId) || (isObject(peerId) && peerId._ === 'inputPeerSelf' && this.peerId) || NULL_PEER_ID;\n }\n\n public getDialogPeer(peerId: PeerId): DialogPeer {\n return {\n _: 'dialogPeer',\n peer: this.getOutputPeer(peerId)\n };\n }\n\n public isChannel(peerId: PeerId): boolean {\n return !peerId.isUser() && this.appChatsManager.isChannel(peerId.toChatId());\n }\n\n public isMegagroup(peerId: PeerId) {\n return !peerId.isUser() && this.appChatsManager.isMegagroup(peerId.toChatId());\n }\n\n public isForum(peerId: PeerId) {\n return !peerId.isUser() && this.appChatsManager.isForum(peerId.toChatId());\n }\n\n public isAnyGroup(peerId: PeerId): boolean {\n return !peerId.isUser() && !this.appChatsManager.isBroadcast(peerId.toChatId());\n }\n\n public isBroadcast(peerId: PeerId): boolean {\n return this.isChannel(peerId) && !this.isMegagroup(peerId);\n }\n\n public isBot(peerId: PeerId): boolean {\n return peerId.isUser() && this.appUsersManager.isBot(peerId.toUserId());\n }\n\n public isContact(peerId: PeerId): boolean {\n return peerId.isUser() && this.appUsersManager.isContact(peerId.toUserId());\n }\n\n public isUser(peerId: PeerId)/* : peerId is UserId */ {\n return isUser(peerId);\n }\n\n public isAnyChat(peerId: PeerId) {\n return isAnyChat(peerId);\n }\n\n public isPeerRestricted(peerId: PeerId) {\n return isPeerRestricted(this.getPeer(peerId));\n }\n\n public getRestrictionReasonText(peerId: PeerId) {\n const peer = this.getPeer(peerId) as Chat.channel | User.user;\n const reason = peer.restriction_reason ? getRestrictionReason(peer.restriction_reason) : undefined;\n if(reason) {\n return reason.text;\n } else {\n return peerId.isUser() ? 'This user is restricted' : 'This chat is restricted';\n }\n }\n\n /* public getInputPeer(peerString: string): InputPeer {\n var firstChar = peerString.charAt(0);\n var peerParams = peerString.substr(1).split('_');\n let id = +peerParams[0];\n\n if(firstChar === 'u') {\n //appUsersManager.saveUserAccess(id, peerParams[1]);\n\n return {\n _: 'inputPeerUser',\n user_id: id,\n access_hash: peerParams[1]\n };\n } else if(firstChar === 'c' || firstChar === 's') {\n //appChatsManager.saveChannelAccess(id, peerParams[1]);\n if(firstChar === 's') {\n appChatsManager.saveIsMegagroup(id);\n }\n\n return {\n _: 'inputPeerChannel',\n channel_id: id,\n access_hash: peerParams[1] || '0'\n };\n } else {\n return {\n _: 'inputPeerChat',\n chat_id: id\n };\n }\n } */\n\n // public getInputNotifyPeerById(peerId: PeerId, ignorePeerId: true): Exclude;\n // public getInputNotifyPeerById(peerId: PeerId, ignorePeerId?: false): InputNotifyPeer.inputNotifyPeer;\n // public getInputNotifyPeerById(peerId: PeerId, ignorePeerId?: boolean): InputNotifyPeer {\n public getInputNotifyPeerById({\n peerId,\n ignorePeerId,\n threadId\n }: T): T['ignorePeerId'] extends true ? Exclude : (T['threadId'] extends number ? InputNotifyPeer.inputNotifyForumTopic : InputNotifyPeer.inputNotifyPeer) {\n if(ignorePeerId) {\n if(peerId.isUser()) {\n return {_: 'inputNotifyUsers'} as any;\n } else {\n if(this.isBroadcast(peerId)) {\n return {_: 'inputNotifyBroadcasts'} as any;\n } else {\n return {_: 'inputNotifyChats'} as any;\n }\n }\n } else if(threadId) {\n return {\n _: 'inputNotifyForumTopic',\n peer: this.getInputPeerById(peerId),\n top_msg_id: getServerMessageId(threadId)\n } as any;\n } else {\n return {\n _: 'inputNotifyPeer',\n peer: this.getInputPeerById(peerId)\n } as any;\n }\n }\n\n public getInputPeerById(peerId: PeerId): InputPeer {\n if(!peerId) {\n return {_: 'inputPeerEmpty'};\n }\n\n if(!peerId.isUser()) {\n const chatId = peerId.toChatId();\n return this.appChatsManager.getInputPeer(chatId);\n }\n\n const userId = peerId.toUserId();\n return this.appUsersManager.getUserInputPeer(userId);\n }\n\n /**\n * ! use it only in safe places like requests\n */\n public getInputPeerSelf(): InputPeer.inputPeerSelf {\n return {_: 'inputPeerSelf'};\n }\n\n public getInputDialogPeerById(peerId: PeerId | InputPeer): InputDialogPeer {\n return {\n _: 'inputDialogPeer',\n peer: isObject(peerId) ? peerId : this.getInputPeerById(peerId)\n };\n }\n\n public getPeerSearchText(peerId: PeerId) {\n let text: string;\n if(this.isUser(peerId)) {\n text = '%pu ' + this.appUsersManager.getUserSearchText(peerId.toUserId());\n } else {\n const chat = this.appChatsManager.getChat(peerId.toChatId());\n text = '%pg ' + (chat.title || '');\n }\n\n return text;\n }\n\n public getDialogType(peerId: PeerId): PeerType {\n if(this.isMegagroup(peerId)) {\n return 'megagroup';\n } else if(this.isChannel(peerId)) {\n return 'channel';\n } else if(!this.isUser(peerId)) {\n return 'group';\n } else {\n return peerId === this.peerId ? 'saved' : 'chat';\n }\n }\n\n public getDeleteButtonText(peerId: PeerId): Extract {\n switch(this.getDialogType(peerId)) {\n case 'channel':\n return this.appChatsManager.hasRights(peerId.toChatId(), 'delete_chat') ? 'ChannelDelete' : 'ChatList.Context.LeaveChannel';\n\n case 'megagroup':\n case 'group':\n return this.appChatsManager.hasRights(peerId.toChatId(), 'delete_chat') ? 'DeleteMega' : 'ChatList.Context.LeaveGroup';\n\n default:\n return 'ChatList.Context.DeleteChat';\n }\n }\n\n public noForwards(peerId: PeerId) {\n if(peerId.isUser()) return false;\n else {\n const chat = this.appChatsManager.getChat(peerId.toChatId());\n return !!(chat as Chat.chat).pFlags?.noforwards;\n }\n }\n}\n\nexport type IsPeerType = 'isChannel' | 'isMegagroup' | 'isAnyGroup' | 'isBroadcast' | 'isBot' | 'isContact' | 'isUser' | 'isAnyChat';\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {Photo, PhotoSize, PhotosPhotos} from '../../layer';\nimport {ReferenceContext} from '../mtproto/referenceDatabase';\nimport isObject from '../../helpers/object/isObject';\nimport safeReplaceArrayInObject from '../../helpers/object/safeReplaceArrayInObject';\nimport {AppManager} from './manager';\n\nexport type MyPhoto = Photo.photo;\n\n// TIMES = 2 DUE TO SIDEBAR AND CHAT\n// let TEST_FILE_REFERENCE = \"5440692274120994569\", TEST_FILE_REFERENCE_TIMES = 2;\n\nexport class AppPhotosManager extends AppManager {\n private photos: {\n [id: string]: MyPhoto\n } = {};\n\n public savePhoto(photo: Photo, context?: ReferenceContext) {\n if(!photo || photo._ === 'photoEmpty') return;\n\n /* if(photo.id === TEST_FILE_REFERENCE) {\n console.warn('Testing FILE_REFERENCE_EXPIRED');\n const bytes = [2, 67, 175, 43, 190, 0, 0, 20, 62, 95, 111, 33, 45, 99, 220, 116, 218, 11, 167, 127, 213, 18, 127, 32, 243, 202, 117, 80, 30];\n //photo.file_reference = new Uint8Array(bytes);\n photo.file_reference = bytes;\n if(!--TEST_FILE_REFERENCE_TIMES) {\n TEST_FILE_REFERENCE = '';\n }\n } */\n\n const oldPhoto = this.photos[photo.id];\n if(photo.file_reference) { // * because we can have a new object w/o the file_reference while sending\n safeReplaceArrayInObject('file_reference', oldPhoto, photo);\n this.referenceDatabase.saveContext(photo.file_reference, context);\n }\n\n if(photo.sizes?.length) {\n // * sometimes photoStrippedSize can be the last item\n photo.sizes.sort((a, b) => {\n return ((a as PhotoSize.photoSize).size || ((a as PhotoSize.photoSizeProgressive).sizes ? Infinity : 0)) - ((b as PhotoSize.photoSize).size || ((b as PhotoSize.photoSizeProgressive).sizes ? Infinity : 0));\n });\n\n const size = photo.sizes[photo.sizes.length - 1];\n if(size._ === 'photoSizeProgressive') {\n size.size = size.sizes[size.sizes.length - 1];\n }\n }\n\n if(oldPhoto) {\n return Object.assign(oldPhoto, photo);\n }\n\n return this.photos[photo.id] = photo;\n }\n\n public getUserPhotos(userId: UserId, maxId: Photo.photo['id'] = '0', limit: number = 20) {\n const inputUser = this.appUsersManager.getUserInput(userId);\n return this.apiManager.invokeApiCacheable('photos.getUserPhotos', {\n user_id: inputUser,\n offset: 0,\n limit,\n max_id: maxId\n }, {cacheSeconds: 60}).then((photosResult) => {\n this.appUsersManager.saveApiUsers(photosResult.users);\n const photoIds = photosResult.photos.map((photo, idx) => {\n photosResult.photos[idx] = this.savePhoto(photo, {type: 'profilePhoto', peerId: userId.toPeerId()});\n return photo.id;\n });\n\n // ! WARNING !\n if(maxId !== '0' && maxId) {\n const idx = photoIds.indexOf(maxId);\n if(idx !== -1) {\n photoIds.splice(idx, 1);\n }\n }\n\n return {\n count: (photosResult as PhotosPhotos.photosPhotosSlice).count || photoIds.length,\n photos: photoIds\n };\n });\n }\n\n /* public getPhotoURL(photo: MTPhoto | MTMyDocument, photoSize: MTPhotoSize) {\n const downloadOptions = this.getPhotoDownloadOptions(photo, photoSize);\n\n return {url: getFileURL('photo', downloadOptions), location: downloadOptions.location};\n } */\n\n /* public isDownloaded(media: any) {\n const isPhoto = media._ === 'photo';\n const photo = isPhoto ? this.getPhoto(media.id) : null;\n let isDownloaded: boolean;\n if(photo) {\n isDownloaded = photo.downloaded > 0;\n } else {\n const cachedThumb = this.getDocumentCachedThumb(media.id);\n isDownloaded = cachedThumb?.downloaded > 0;\n }\n\n return isDownloaded;\n } */\n\n public getPhoto(photoId: any/* MyPhoto | string */): MyPhoto {\n return isObject(photoId) ? photoId as MyPhoto : this.photos[photoId as any as string];\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport copy from '../../helpers/object/copy';\nimport {InputMedia, Message, MessageEntity, MessageMedia, Poll, PollResults} from '../../layer';\nimport {logger, LogTypes} from '../logger';\nimport parseMarkdown from '../richTextProcessor/parseMarkdown';\nimport {AppManager} from './manager';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\n\ntype PollId = Poll['id'];\n\nexport class AppPollsManager extends AppManager {\n public polls: {[id: PollId]: Poll} = {};\n public results: {[id: PollId]: PollResults} = {};\n public pollToMessages: {[id: PollId]: Set} = {};\n\n private log = logger('POLLS', LogTypes.Error);\n\n protected after() {\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateMessagePoll: (update) => {\n this.log('updateMessagePoll:', update);\n\n let poll: Poll = update.poll || this.polls[update.poll_id];\n if(!poll) {\n return;\n }\n\n let results = update.results;\n const ret = this.savePoll(poll, results as any);\n poll = ret.poll;\n results = ret.results;\n\n this.rootScope.dispatchEvent('poll_update', {poll, results: results as any});\n }\n });\n }\n\n public savePoll(poll: Poll, results: PollResults, message?: Message.message) {\n if(message) {\n this.updatePollToMessage(message, true);\n }\n\n const id = poll.id;\n if(this.polls[id]) {\n poll = Object.assign(this.polls[id], poll);\n results = this.saveResults(poll, results);\n } else {\n this.polls[id] = poll;\n\n poll.chosenIndexes = [];\n results = this.saveResults(poll, results);\n }\n\n return {poll, results};\n }\n\n public saveResults(poll: Poll, results: PollResults) {\n if(this.results[poll.id]) {\n results = Object.assign(this.results[poll.id], results);\n } else {\n this.results[poll.id] = results;\n }\n\n if(!results.pFlags.min) { // ! https://core.telegram.org/constructor/pollResults - min\n poll.chosenIndexes.length = 0;\n if(results?.results?.length) {\n results.results.forEach((answer, idx) => {\n if(answer.pFlags?.chosen) {\n poll.chosenIndexes.push(idx);\n }\n });\n }\n }\n\n return results;\n }\n\n public getPoll(pollId: PollId): {poll: Poll, results: PollResults} {\n return {\n poll: this.polls[pollId],\n results: this.results[pollId]\n };\n }\n\n public getInputMediaPoll(poll: Poll, correctAnswers?: Uint8Array[], solution?: string, solutionEntities?: MessageEntity[]): InputMedia.inputMediaPoll {\n if(solution) {\n if(!solutionEntities) {\n solutionEntities = [];\n }\n\n solution = parseMarkdown(solution, solutionEntities);\n } else {\n solution = undefined; // can be string here\n }\n\n return {\n _: 'inputMediaPoll',\n poll,\n correct_answers: correctAnswers,\n solution,\n solution_entities: solution ? solutionEntities : undefined\n };\n }\n\n public updatePollToMessage(message: Message.message, add: boolean) {\n const {id} = (message.media as MessageMedia.messageMediaPoll).poll;\n let set = this.pollToMessages[id];\n\n if(!add && !set) {\n return;\n }\n\n if(!set) {\n set = this.pollToMessages[id] = new Set();\n }\n\n const key = message.peerId + '_' + message.mid;\n if(add) set.add(key);\n else set.delete(key);\n\n if(!add && !set.size) {\n delete this.polls[id];\n delete this.results[id];\n delete this.pollToMessages[id];\n }\n }\n\n public sendVote(message: Message.message, optionIds: number[]): Promise {\n const poll: Poll = (message.media as MessageMedia.messageMediaPoll).poll;\n\n const options: Uint8Array[] = optionIds.map((index) => {\n return poll.answers[index].option;\n });\n\n const messageId = message.mid;\n const peerId = message.peerId;\n const inputPeer = this.appPeersManager.getInputPeerById(peerId);\n\n if(message.pFlags.is_outgoing) {\n return this.appMessagesManager.invokeAfterMessageIsSent(messageId, 'sendVote', (message) => {\n this.log('invoke sendVote callback');\n return this.sendVote(message as Message.message, optionIds);\n });\n }\n\n return this.apiManager.invokeApi('messages.sendVote', {\n peer: inputPeer,\n msg_id: getServerMessageId(message.mid),\n options\n }).then((updates) => {\n this.log('sendVote updates:', updates);\n this.apiUpdatesManager.processUpdateMessage(updates);\n });\n }\n\n public getResults(message: Message.message) {\n const inputPeer = this.appPeersManager.getInputPeerById(message.peerId);\n\n return this.apiManager.invokeApi('messages.getPollResults', {\n peer: inputPeer,\n msg_id: getServerMessageId(message.mid)\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n this.log('getResults updates:', updates);\n });\n }\n\n public getVotes(message: Message.message, option?: Uint8Array, offset?: string, limit = 20) {\n return this.apiManager.invokeApi('messages.getPollVotes', {\n peer: this.appPeersManager.getInputPeerById(message.peerId),\n id: getServerMessageId(message.mid),\n option,\n offset,\n limit\n }).then((votesList) => {\n this.log('getPollVotes messages:', votesList);\n\n this.appUsersManager.saveApiUsers(votesList.users);\n\n return votesList;\n });\n }\n\n public stopPoll(message: Message.message) {\n const poll: Poll = (message.media as MessageMedia.messageMediaPoll).poll;\n\n if(poll.pFlags.closed) return Promise.resolve();\n\n const newPoll = copy(poll);\n newPoll.pFlags.closed = true;\n return this.appMessagesManager.editMessage(message, undefined, {\n newMedia: this.getInputMediaPoll(newPoll)\n }).then(() => {\n // console.log('stopped poll');\n }, err => {\n this.log.error('stopPoll error:', err);\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {InputPrivacyKey, InputPrivacyRule, PrivacyRule, PrivacyKey, GlobalPrivacySettings} from '../../layer';\nimport convertInputKeyToKey from '../../helpers/string/convertInputKeyToKey';\nimport {AppManager} from './manager';\n\nexport class AppPrivacyManager extends AppManager {\n private privacy: Partial<{\n [key in PrivacyKey['_']]: PrivacyRule[] | Promise\n }> = {};\n\n protected after() {\n this.apiUpdatesManager.addMultipleEventsListeners({\n updatePrivacy: (update) => {\n const key = update.key._;\n this.privacy[key] = update.rules;\n this.rootScope.dispatchEvent('privacy_update', update);\n }\n });\n }\n\n public setPrivacy(inputKey: InputPrivacyKey['_'], rules: InputPrivacyRule[]) {\n return this.apiManager.invokeApi('account.setPrivacy', {\n key: {\n _: inputKey\n },\n rules\n }).then((privacyRules) => {\n this.appUsersManager.saveApiUsers(privacyRules.users);\n this.appChatsManager.saveApiChats(privacyRules.chats);\n\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updatePrivacy',\n key: {\n _: convertInputKeyToKey(inputKey)\n },\n rules: rules.map((inputRule) => {\n const rule: PrivacyRule = {} as any;\n Object.assign(rule, inputRule);\n rule._ = convertInputKeyToKey(rule._) as any;\n return rule;\n })\n });\n\n // console.log('privacy rules', inputKey, privacyRules, privacyRules.rules);\n\n return privacyRules.rules;\n });\n }\n\n public getPrivacy(inputKey: InputPrivacyKey['_']) {\n const privacyKey: PrivacyKey['_'] = convertInputKeyToKey(inputKey) as any;\n const rules = this.privacy[privacyKey];\n if(rules) {\n return Promise.resolve(rules);\n }\n\n return this.privacy[privacyKey] = this.apiManager.invokeApi('account.getPrivacy', {\n key: {\n _: inputKey\n }\n }).then((privacyRules) => {\n this.appUsersManager.saveApiUsers(privacyRules.users);\n this.appChatsManager.saveApiChats(privacyRules.chats);\n\n // console.log('privacy rules', inputKey, privacyRules, privacyRules.rules);\n\n return this.privacy[privacyKey] = privacyRules.rules;\n });\n }\n\n public getGlobalPrivacySettings() {\n return this.apiManager.invokeApi('account.getGlobalPrivacySettings');\n }\n\n public setGlobalPrivacySettings(settings: GlobalPrivacySettings) {\n return this.apiManager.invokeApi('account.setGlobalPrivacySettings', {settings});\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {MyTopPeer} from './appUsersManager';\nimport tsNow from '../../helpers/tsNow';\nimport {ChannelParticipantsFilter, ChannelsChannelParticipants, ChannelParticipant, Chat, ChatFull, ChatParticipants, ChatPhoto, ExportedChatInvite, InputChannel, InputFile, SendMessageAction, Update, UserFull, Photo, PhotoSize, Updates} from '../../layer';\nimport SearchIndex from '../searchIndex';\nimport {AppManager} from './manager';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\nimport getPhotoInput from './utils/photos/getPhotoInput';\nimport getParticipantPeerId from './utils/chats/getParticipantPeerId';\nimport ctx from '../../environment/ctx';\nimport {ReferenceContext} from '../mtproto/referenceDatabase';\nimport generateMessageId from './utils/messageId/generateMessageId';\nimport assumeType from '../../helpers/assumeType';\nimport makeError from '../../helpers/makeError';\nimport callbackify from '../../helpers/callbackify';\n\nexport type UserTyping = Partial<{userId: UserId, action: SendMessageAction, timeout: number}>;\n\nconst PEER_FULL_TTL = 3 * 60e3;\n\nexport class AppProfileManager extends AppManager {\n // private botInfos: any = {};\n private usersFull: {[id: UserId]: UserFull.userFull} = {};\n private chatsFull: {[id: ChatId]: ChatFull} = {};\n private fullExpiration: {[peerId: PeerId]: number} = {};\n private typingsInPeer: {[key: string]: UserTyping[]};\n\n protected after() {\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateChatParticipants: this.onUpdateChatParticipants,\n\n updateChatParticipantAdd: this.onUpdateChatParticipantAdd,\n\n updateChatParticipantDelete: this.onUpdateChatParticipantDelete,\n\n updateUserTyping: this.onUpdateUserTyping,\n updateChatUserTyping: this.onUpdateUserTyping,\n updateChannelUserTyping: this.onUpdateUserTyping,\n\n updatePeerBlocked: this.onUpdatePeerBlocked\n });\n\n this.rootScope.addEventListener('chat_update', (chatId) => {\n const fullChat = this.chatsFull[chatId];\n const chat: Chat.chat | Chat.channel | Chat.chatForbidden | Chat.channelForbidden = this.appChatsManager.getChat(chatId);\n if(!fullChat || !chat) {\n return;\n }\n\n let updated = false;\n if(!!fullChat.call !== !!(chat as Chat.chat).pFlags?.call_active) {\n updated = true;\n }\n\n const {photo} = chat as Chat.chat;\n if(photo) {\n const hasChatPhoto = photo._ !== 'chatPhotoEmpty';\n const hasFullChatPhoto = !!(fullChat.chat_photo && fullChat.chat_photo._ !== 'photoEmpty'); // chat_photo can be missing\n if(\n hasChatPhoto !== hasFullChatPhoto || (\n hasChatPhoto &&\n photo.photo_id !== fullChat.chat_photo?.id\n )\n ) {\n updated = true;\n }\n }\n\n if(updated) {\n this.refreshFullPeer(chatId.toPeerId(true));\n }\n });\n\n this.rootScope.addEventListener('channel_update', (chatId) => {\n this.refreshFullPeer(chatId.toPeerId(true));\n });\n\n // * genius\n this.rootScope.addEventListener('chat_full_update', (chatId) => {\n this.rootScope.dispatchEvent('peer_full_update', chatId.toPeerId(true));\n });\n\n // * genius\n this.rootScope.addEventListener('user_full_update', (userId) => {\n this.rootScope.dispatchEvent('peer_full_update', userId.toPeerId(false));\n });\n\n this.rootScope.addEventListener('invalidate_participants', (chatId) => {\n this.invalidateChannelParticipants(chatId);\n });\n\n this.typingsInPeer = {};\n }\n\n /* public saveBotInfo(botInfo: any) {\n const botId = botInfo && botInfo.user_id;\n if(!botId) {\n return null;\n }\n\n const commands: any = {};\n botInfo.commands.forEach((botCommand: any) => {\n commands[botCommand.command] = botCommand.description;\n });\n\n return this.botInfos[botId] = {\n id: botId,\n version: botInfo.version,\n shareText: botInfo.share_text,\n description: botInfo.description,\n commands: commands\n };\n } */\n\n public getProfile(id: UserId, override?: true) {\n if(this.usersFull[id] && !override && Date.now() < this.fullExpiration[id.toPeerId()]) {\n return this.usersFull[id];\n }\n\n return this.apiManager.invokeApiSingleProcess({\n method: 'users.getFullUser',\n params: {\n id: this.appUsersManager.getUserInput(id)\n },\n processResult: (usersUserFull) => {\n this.appChatsManager.saveApiChats(usersUserFull.chats, true);\n this.appUsersManager.saveApiUsers(usersUserFull.users);\n\n const userFull = usersUserFull.full_user;\n const peerId = id.toPeerId(false);\n if(userFull.profile_photo) {\n userFull.profile_photo = this.appPhotosManager.savePhoto(userFull.profile_photo, {type: 'profilePhoto', peerId});\n }\n\n const botInfo = userFull.bot_info;\n if(botInfo) {\n const referenceContext: ReferenceContext = {type: 'userFull', userId: id};\n botInfo.description_document = this.appDocsManager.saveDoc(botInfo.description_document, referenceContext);\n botInfo.description_photo = this.appPhotosManager.savePhoto(botInfo.description_photo, referenceContext);\n }\n\n this.appNotificationsManager.savePeerSettings({\n peerId,\n settings: userFull.notify_settings\n });\n\n this.usersFull[id] = userFull;\n this.fullExpiration[peerId] = Date.now() + PEER_FULL_TTL;\n\n /* if(userFull.bot_info) {\n userFull.bot_info = this.saveBotInfo(userFull.bot_info) as any;\n } */\n\n // appMessagesManager.savePinnedMessage(id, userFull.pinned_msg_id);\n\n this.rootScope.dispatchEvent('user_full_update', id);\n return userFull;\n }\n });\n }\n\n public getProfileByPeerId(peerId: PeerId, override?: true) {\n if(this.appPeersManager.isAnyChat(peerId)) return this.getChatFull(peerId.toChatId(), override);\n else return this.getProfile(peerId.toUserId(), override);\n }\n\n public getCachedFullChat(chatId: ChatId) {\n return this.chatsFull[chatId];\n }\n\n public getCachedFullUser(userId: UserId) {\n return this.usersFull[userId];\n }\n\n public getCachedProfileByPeerId(peerId: PeerId) {\n return peerId.isUser() ? this.getCachedFullUser(peerId.toUserId()) : this.getCachedFullChat(peerId.toChatId());\n }\n\n public async getFullPhoto(peerId: PeerId) {\n const profile = await this.getProfileByPeerId(peerId);\n switch(profile._) {\n case 'userFull':\n return profile.profile_photo;\n case 'channelFull':\n case 'chatFull':\n return profile.chat_photo;\n }\n }\n\n /* public getPeerBots(peerId: PeerId) {\n var peerBots: any[] = [];\n if(peerId >= 0 && !appUsersManager.isBot(peerId) ||\n (appPeersManager.isChannel(peerId) && !appPeersManager.isMegagroup(peerId))) {\n return Promise.resolve(peerBots);\n }\n if(peerId >= 0) {\n return this.getProfile(peerId).then((userFull: any) => {\n var botInfo = userFull.bot_info;\n if(botInfo && botInfo._ !== 'botInfoEmpty') {\n peerBots.push(botInfo);\n }\n return peerBots;\n });\n }\n\n return this.getChatFull(peerId.toChatId()).then((chatFull: any) => {\n chatFull.bot_info.forEach((botInfo: any) => {\n peerBots.push(this.saveBotInfo(botInfo))\n });\n return peerBots;\n });\n } */\n\n public getChatFull(id: ChatId, override?: true) {\n if(this.appChatsManager.isChannel(id)) {\n return this.getChannelFull(id, override);\n }\n\n const peerId = id.toPeerId(true);\n const fullChat = this.chatsFull[id] as ChatFull.chatFull;\n if(fullChat && !override && Date.now() < this.fullExpiration[peerId]) {\n const chat = this.appChatsManager.getChat(id) as Chat.chat;\n if(\n chat.pFlags.left ||\n chat.pFlags.deactivated ||\n chat.version === (fullChat.participants as ChatParticipants.chatParticipants).version\n ) {\n return fullChat as ChatFull;\n }\n }\n\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.getFullChat',\n params: {\n chat_id: id\n },\n processResult: (result) => {\n this.appChatsManager.saveApiChats(result.chats, true);\n this.appUsersManager.saveApiUsers(result.users);\n const chatFull = result.full_chat as ChatFull.chatFull;\n if(chatFull && chatFull.chat_photo && chatFull.chat_photo.id) {\n chatFull.chat_photo = this.appPhotosManager.savePhoto(chatFull.chat_photo, {type: 'profilePhoto', peerId});\n }\n\n if(chatFull.call) {\n this.appGroupCallsManager.saveGroupCall(chatFull.call, id);\n }\n\n // appMessagesManager.savePinnedMessage(peerId, fullChat.pinned_msg_id);\n this.appNotificationsManager.savePeerSettings({\n peerId,\n settings: chatFull.notify_settings\n });\n\n this.chatsFull[id] = chatFull;\n this.fullExpiration[peerId] = Date.now() + PEER_FULL_TTL;\n this.rootScope.dispatchEvent('chat_full_update', id);\n\n return chatFull;\n }\n });\n }\n\n public async getChatInviteLink(id: ChatId, force?: boolean) {\n const chatFull = await this.getChatFull(id);\n if(!force &&\n chatFull.exported_invite &&\n chatFull.exported_invite._ == 'chatInviteExported') {\n return chatFull.exported_invite.link;\n }\n\n return this.apiManager.invokeApi('messages.exportChatInvite', {\n peer: this.appPeersManager.getInputPeerById(id.toPeerId(true))\n }).then((exportedInvite) => {\n if(this.chatsFull[id] !== undefined) {\n this.chatsFull[id].exported_invite = exportedInvite;\n }\n\n return (exportedInvite as ExportedChatInvite.chatInviteExported).link;\n });\n }\n\n public getParticipants(\n id: ChatId,\n filter: ChannelParticipantsFilter = {_: 'channelParticipantsRecent'},\n limit = 200,\n offset = 0\n ) {\n if(this.appChatsManager.isChannel(id)) {\n return this.getChannelParticipants(id, filter, limit, offset);\n }\n\n return Promise.resolve(this.getChatFull(id)).then((chatFull) => {\n const chatParticipants = (chatFull as ChatFull.chatFull).participants;\n if(chatParticipants._ !== 'chatParticipants') {\n throw makeError('CHAT_PRIVATE');\n }\n\n if(filter._ === 'channelParticipantsSearch' && filter.q.trim()) {\n const index = this.appUsersManager.createSearchIndex();\n chatParticipants.participants.forEach((chatParticipant) => {\n const userId = chatParticipant.user_id;\n index.indexObject(userId, this.appUsersManager.getUserSearchText(userId));\n });\n\n const found = index.search(filter.q);\n const filteredParticipants = chatParticipants.participants.filter((chatParticipant) => {\n return found.has(chatParticipant.user_id);\n });\n\n return {...chatParticipants, participants: filteredParticipants};\n }\n\n return chatParticipants;\n });\n }\n\n public getParticipant(id: ChatId, peerId: PeerId) {\n if(this.appChatsManager.isChannel(id)) {\n return this.getChannelParticipant(id, peerId);\n }\n\n return this.getParticipants(id).then((chatParticipants) => {\n assumeType(chatParticipants);\n const found = chatParticipants.participants.find((chatParticipant) => {\n if(getParticipantPeerId(chatParticipant) === peerId) {\n return chatParticipant;\n }\n });\n\n if(!found) {\n throw makeError('USER_NOT_PARTICIPANT');\n }\n\n return found;\n });\n }\n\n public getChannelParticipants(\n id: ChatId,\n filter: ChannelParticipantsFilter = {_: 'channelParticipantsRecent'},\n limit = 200,\n offset = 0\n ) {\n if(filter._ === 'channelParticipantsRecent') {\n const chat = this.appChatsManager.getChat(id);\n if(chat?.pFlags && (\n // chat.pFlags.kicked ||\n (chat as Chat.channel).pFlags.broadcast &&\n !(chat as Chat.channel).pFlags.creator &&\n !(chat as Chat.channel).admin_rights\n )) {\n return Promise.reject();\n }\n }\n\n return this.apiManager.invokeApiCacheable('channels.getParticipants', {\n channel: this.appChatsManager.getChannelInput(id),\n filter,\n offset,\n limit,\n hash: '0'\n }, {cacheSeconds: 60}).then((result) => {\n this.appUsersManager.saveApiUsers((result as ChannelsChannelParticipants.channelsChannelParticipants).users);\n return result as ChannelsChannelParticipants.channelsChannelParticipants;\n });\n /* let maybeAddSelf = (participants: any[]) => {\n let chat = appChatsManager.getChat(id);\n let selfMustBeFirst = filter._ === 'channelParticipantsRecent' &&\n !offset &&\n !chat.pFlags.kicked &&\n !chat.pFlags.left;\n\n if(selfMustBeFirst) {\n participants = copy(participants);\n let myID = appUsersManager.getSelf().id;\n let myIndex = participants.findIndex((p) => p.user_id === myID);\n let myParticipant;\n\n if(myIndex !== -1) {\n myParticipant = participants[myIndex];\n participants.splice(myIndex, 1);\n } else {\n myParticipant = {_: 'channelParticipantSelf', user_id: myID};\n }\n\n participants.unshift(myParticipant);\n }\n\n return participants;\n } */\n }\n\n public getChannelParticipant(id: ChatId, peerId: PeerId) {\n return this.apiManager.invokeApiSingle('channels.getParticipant', {\n channel: this.appChatsManager.getChannelInput(id),\n participant: this.appPeersManager.getInputPeerById(peerId)\n }).then((channelParticipant) => {\n this.appUsersManager.saveApiUsers(channelParticipant.users);\n return channelParticipant.participant;\n });\n }\n\n public getChannelFull(id: ChatId, override?: true) {\n const peerId = id.toPeerId(true);\n if(this.chatsFull[id] !== undefined && !override && Date.now() < this.fullExpiration[peerId]) {\n return this.chatsFull[id] as ChatFull.channelFull;\n }\n\n return this.apiManager.invokeApiSingleProcess({\n method: 'channels.getFullChannel',\n params: {\n channel: this.appChatsManager.getChannelInput(id)\n },\n processResult: (result) => {\n this.appChatsManager.saveApiChats(result.chats, true);\n this.appUsersManager.saveApiUsers(result.users);\n const fullChannel = result.full_chat as ChatFull.channelFull;\n if(fullChannel && fullChannel.chat_photo.id) {\n fullChannel.chat_photo = this.appPhotosManager.savePhoto(fullChannel.chat_photo, {type: 'profilePhoto', peerId});\n // appPhotosManager.savePhoto(fullChannel.chat_photo);\n }\n\n if(fullChannel.call) {\n this.appGroupCallsManager.saveGroupCall(fullChannel.call, id);\n }\n\n this.appNotificationsManager.savePeerSettings({\n peerId,\n settings: fullChannel.notify_settings\n });\n\n this.chatsFull[id] = fullChannel;\n this.fullExpiration[peerId] = Date.now() + PEER_FULL_TTL;\n this.rootScope.dispatchEvent('chat_full_update', id);\n\n return fullChannel;\n },\n processError: (error) => {\n switch(error.type) {\n case 'CHANNEL_PRIVATE':\n const channel = this.appChatsManager.getChat(id) as Chat.channel | Chat.channelForbidden;\n this.apiUpdatesManager.processUpdateMessage({\n _: 'updates',\n updates: [{\n _: 'updateChannel',\n channel_id: id\n }],\n chats: [channel._ === 'channelForbidden' ? channel : {\n _: 'channelForbidden',\n id,\n access_hash: channel.access_hash,\n title: channel.title,\n pFlags: channel.pFlags\n }],\n users: []\n } as Updates.updates);\n break;\n }\n\n throw error;\n }\n });\n }\n\n public getMentions(chatId: ChatId, query: string, threadId?: number): Promise {\n const processUserIds = (topPeers: MyTopPeer[]) => {\n const startsWithAt = query.charAt(0) === '@';\n if(startsWithAt) query = query.slice(1);\n /* const startsWithAt = query.charAt(0) === '@';\n if(startsWithAt) query = query.slice(1);\n\n const index = new SearchIndex(!startsWithAt, !startsWithAt); */\n const index = new SearchIndex({\n ignoreCase: true\n });\n\n const ratingMap: Map = new Map();\n topPeers.forEach((peer) => {\n index.indexObject(peer.id, this.appUsersManager.getUserSearchText(peer.id));\n ratingMap.set(peer.id, peer.rating);\n });\n\n const peerIds = Array.from(index.search(query));\n peerIds.sort((a, b) => ratingMap.get(b) - ratingMap.get(a));\n return peerIds;\n };\n\n let promise: Promise;\n if(this.appChatsManager.isChannel(chatId)) {\n promise = this.getChannelParticipants(chatId, {\n _: 'channelParticipantsMentions',\n q: query,\n top_msg_id: getServerMessageId(threadId)\n }, 50, 0).then((cP) => {\n return cP.participants.map((p) => getParticipantPeerId(p));\n });\n } else if(chatId) {\n promise = Promise.resolve(this.getChatFull(chatId)).then((chatFull) => {\n return ((chatFull as ChatFull.chatFull).participants as ChatParticipants.chatParticipants).participants.map((p) => p.user_id.toPeerId());\n });\n } else {\n promise = Promise.resolve([]);\n }\n\n return Promise.all([\n // [],\n this.appUsersManager.getTopPeers('bots_inline').catch(() => [] as MyTopPeer[]),\n promise\n ]).then((results) => {\n const peers = results[0].concat(results[1].map((peerId) => ({id: peerId, rating: 0})));\n\n return processUserIds(peers);\n });\n }\n\n private invalidateChannelParticipants(id: ChatId) {\n this.apiManager.clearCache('channels.getParticipants', (params) => (params.channel as InputChannel.inputChannel).channel_id === id);\n this.refreshFullPeer(id.toPeerId(true));\n }\n\n private refreshFullPeer(peerId: PeerId) {\n if(peerId.isUser()) {\n const userId = peerId.toUserId();\n delete this.usersFull[userId];\n this.rootScope.dispatchEvent('user_full_update', userId);\n } else {\n const chatId = peerId.toChatId();\n delete this.chatsFull[chatId];\n this.rootScope.dispatchEvent('chat_full_update', chatId);\n }\n\n // ! эта строчка будет создавать race condition:\n // ! запрос вернёт chat с установленным флагом call_not_empty, хотя сам апдейт уже будет применён\n // this.getProfileByPeerId(peerId, true);\n }\n\n public updateProfile(first_name?: string, last_name?: string, about?: string) {\n return this.apiManager.invokeApi('account.updateProfile', {\n first_name,\n last_name,\n about\n }).then((user) => {\n this.appUsersManager.saveApiUser(user);\n\n if(about !== undefined) {\n const peerId = user.id.toPeerId();\n const userFull = this.usersFull[user.id];\n if(userFull) {\n userFull.about = about;\n }\n\n this.rootScope.dispatchEvent('peer_bio_edit', peerId);\n }\n\n return this.getProfile(user.id, true);\n });\n }\n\n public uploadProfilePhoto(inputFile: InputFile) {\n return this.apiManager.invokeApi('photos.uploadProfilePhoto', {\n file: inputFile\n }).then((updateResult) => {\n // ! sometimes can have no user in users\n const photo = updateResult.photo as Photo.photo;\n if(!updateResult.users.length) {\n const strippedThumb = photo.sizes.find((size) => size._ === 'photoStrippedSize') as PhotoSize.photoStrippedSize;\n updateResult.users.push({\n ...this.appUsersManager.getSelf(),\n photo: {\n _: 'userProfilePhoto',\n dc_id: photo.dc_id,\n photo_id: photo.id,\n stripped_thumb: strippedThumb?.bytes,\n pFlags: {\n\n }\n }\n });\n }\n this.appUsersManager.saveApiUsers(updateResult.users);\n\n const myId = this.appPeersManager.peerId;\n this.appPhotosManager.savePhoto(updateResult.photo, {\n type: 'profilePhoto',\n peerId: myId\n });\n\n const userId = myId.toUserId();\n // this.apiUpdatesManager.processLocalUpdate({\n // _: 'updateUserPhoto',\n // user_id: userId,\n // date: tsNow(true),\n // photo: this.appUsersManager.getUser(userId).photo,\n // previous: true\n // });\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateUser',\n user_id: userId\n });\n });\n }\n\n public deletePhotos(photoIds: string[]) {\n return this.apiManager.invokeApiSingle('photos.deletePhotos', {\n id: photoIds.map((photoId) => {\n const photo = this.appPhotosManager.getPhoto(photoId);\n return getPhotoInput(photo);\n })\n }).then((deletedList) => {\n\n });\n }\n\n private verifyParticipantForOnlineCount(participant: {user_id: UserId}) {\n const user = this.appUsersManager.getUser(participant.user_id);\n return !!(user && user.status && user.status._ === 'userStatusOnline');\n }\n\n private reduceParticipantsForOnlineCount(participants: {user_id: UserId}[]) {\n return participants.reduce((acc, participant) => {\n return acc + +this.verifyParticipantForOnlineCount(participant);\n }, 0);\n }\n\n public async getOnlines(id: ChatId): Promise {\n const minOnline = 1;\n if(this.appChatsManager.isBroadcast(id)) {\n return minOnline;\n }\n\n const chatInfo = await this.getChatFull(id);\n if(this.appChatsManager.isMegagroup(id)) {\n if((chatInfo as ChatFull.channelFull).participants_count <= 100) {\n const channelParticipants = await this.getChannelParticipants(id, {_: 'channelParticipantsRecent'}, 100);\n return this.reduceParticipantsForOnlineCount(channelParticipants.participants as ChannelParticipant.channelParticipant[]);\n }\n\n const res = await this.apiManager.invokeApiCacheable('messages.getOnlines', {\n peer: this.appChatsManager.getChannelInputPeer(id)\n }, {cacheSeconds: 60});\n\n const onlines = res.onlines ?? minOnline;\n return onlines;\n }\n\n const _participants = (chatInfo as ChatFull.chatFull).participants as ChatParticipants.chatParticipants;\n if(_participants?.participants) {\n return this.reduceParticipantsForOnlineCount(_participants.participants);\n } else {\n return minOnline;\n }\n }\n\n private getTypingsKey(peerId: PeerId, threadId?: number) {\n return peerId + (threadId ? `_${threadId}` : '');\n }\n\n public getPeerTypings(peerId: PeerId, threadId?: number) {\n return this.typingsInPeer[this.getTypingsKey(peerId, threadId)];\n }\n\n public canGiftPremium(userId: UserId) {\n const user = this.appUsersManager.getUser(userId);\n if(user?.pFlags?.premium || true) {\n return false;\n }\n\n return callbackify(this.getProfile(userId), (userFull) => {\n const user = this.appUsersManager.getUser(userId);\n return !!userFull.premium_gifts && !user?.pFlags?.premium;\n });\n }\n\n private onUpdateChatParticipants = (update: Update.updateChatParticipants) => {\n const participants = update.participants;\n if(participants._ !== 'chatParticipants') {\n return;\n }\n\n const chatId = participants.chat_id;\n const chatFull = this.chatsFull[chatId] as ChatFull.chatFull;\n if(chatFull !== undefined) {\n chatFull.participants = participants;\n this.rootScope.dispatchEvent('chat_full_update', chatId);\n }\n };\n\n private onUpdateChatParticipantAdd = (update: Update.updateChatParticipantAdd) => {\n const chatFull = this.chatsFull[update.chat_id] as ChatFull.chatFull;\n if(chatFull === undefined) {\n return;\n }\n\n const _participants = chatFull.participants as ChatParticipants.chatParticipants;\n const participants = _participants.participants || [];\n for(let i = 0, length = participants.length; i < length; i++) {\n if(participants[i].user_id === update.user_id) {\n return;\n }\n }\n\n participants.push({\n _: 'chatParticipant',\n user_id: update.user_id,\n inviter_id: update.inviter_id,\n date: tsNow(true)\n });\n\n _participants.version = update.version;\n this.rootScope.dispatchEvent('chat_full_update', update.chat_id);\n };\n\n private onUpdateChatParticipantDelete = (update: Update.updateChatParticipantDelete) => {\n const chatFull = this.chatsFull[update.chat_id] as ChatFull.chatFull;\n if(chatFull === undefined) {\n return;\n }\n\n const _participants = chatFull.participants as ChatParticipants.chatParticipants;\n const participants = _participants.participants || [];\n for(let i = 0, length = participants.length; i < length; i++) {\n if(participants[i].user_id === update.user_id) {\n participants.splice(i, 1);\n _participants.version = update.version;\n this.rootScope.dispatchEvent('chat_full_update', update.chat_id);\n return;\n }\n }\n };\n\n private onUpdateUserTyping = (update: Update.updateUserTyping | Update.updateChatUserTyping | Update.updateChannelUserTyping) => {\n const fromId = (update as Update.updateUserTyping).user_id ?\n (update as Update.updateUserTyping).user_id.toPeerId() :\n this.appPeersManager.getPeerId((update as Update.updateChatUserTyping).from_id);\n if(this.appPeersManager.peerId === fromId || update.action._ === 'speakingInGroupCallAction') {\n return;\n }\n\n const topMsgId = (update as Update.updateChannelUserTyping).top_msg_id;\n const threadId = topMsgId ? generateMessageId(topMsgId) : undefined;\n const peerId = this.appPeersManager.getPeerId(update);\n const key = this.getTypingsKey(peerId, threadId);\n const typings = this.typingsInPeer[key] ??= [];\n let typing = typings.find((t) => t.userId === fromId);\n\n const cancelAction = () => {\n delete typing.timeout;\n // typings.findAndSplice((t) => t === typing);\n const idx = typings.indexOf(typing);\n if(idx !== -1) {\n typings.splice(idx, 1);\n }\n\n this.rootScope.dispatchEvent('peer_typings', {peerId, threadId, typings});\n\n if(!typings.length) {\n delete this.typingsInPeer[key];\n }\n };\n\n if(typing?.timeout !== undefined) {\n clearTimeout(typing.timeout);\n }\n\n if(update.action._ === 'sendMessageCancelAction') {\n if(!typing) {\n return;\n }\n\n cancelAction();\n return;\n }\n\n if(!typing) {\n typing = {\n userId: fromId\n };\n\n typings.push(typing);\n }\n\n // console.log('updateChatUserTyping', update, typings);\n\n typing.action = update.action;\n\n const hasUser = this.appUsersManager.hasUser(fromId);\n if(!hasUser) {\n // let's load user here\n if(update._ === 'updateChatUserTyping') {\n if(update.chat_id && this.appChatsManager.hasChat(update.chat_id) && !this.appChatsManager.isChannel(update.chat_id)) {\n Promise.resolve(this.getChatFull(update.chat_id)).then(() => {\n if(typing.timeout !== undefined && this.appUsersManager.hasUser(fromId)) {\n this.rootScope.dispatchEvent('peer_typings', {peerId, threadId, typings});\n }\n });\n }\n }\n\n // return;\n } else {\n this.appUsersManager.forceUserOnline(fromId);\n }\n\n typing.timeout = ctx.setTimeout(cancelAction, 6000);\n if(hasUser) {\n this.rootScope.dispatchEvent('peer_typings', {peerId, threadId, typings});\n }\n };\n\n private onUpdatePeerBlocked = (update: Update.updatePeerBlocked) => {\n const peerId = this.appPeersManager.getPeerId(update.peer_id);\n if(this.appPeersManager.isUser(peerId)) {\n const userId = peerId.toUserId();\n const userFull = this.usersFull[userId];\n if(userFull) {\n if(update.blocked) userFull.pFlags.blocked = true;\n else delete userFull.pFlags.blocked;\n }\n\n this.rootScope.dispatchEvent('user_full_update', userId);\n }\n\n this.rootScope.dispatchEvent('peer_block', {peerId, blocked: update.blocked});\n };\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {Awaited} from '../types';\n\nexport default function callbackifyAll(\n values: T,\n callback: (result: { -readonly [P in keyof T]: Awaited }) => R\n): Promise> | R {\n if(values.some((value) => value instanceof Promise)) {\n return Promise.all(values).then(callback as any);\n } else {\n return callback(values as any);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport findAndSplice from '../../helpers/array/findAndSplice';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport assumeType from '../../helpers/assumeType';\nimport callbackify from '../../helpers/callbackify';\nimport callbackifyAll from '../../helpers/callbackifyAll';\nimport copy from '../../helpers/object/copy';\nimport pause from '../../helpers/schedulers/pause';\nimport {AvailableReaction, Message, MessagePeerReaction, MessagesAvailableReactions, Reaction, ReactionCount, Update, Updates} from '../../layer';\nimport {ReferenceContext} from '../mtproto/referenceDatabase';\nimport {AppManager} from './manager';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\nimport reactionsEqual from './utils/reactions/reactionsEqual';\n\nconst SAVE_DOC_KEYS = [\n 'static_icon' as const,\n 'appear_animation' as const,\n 'select_animation' as const,\n 'activate_animation' as const,\n 'effect_animation' as const,\n 'around_animation' as const,\n 'center_icon' as const\n];\n\nconst REFERENCE_CONTEXT: ReferenceContext = {\n type: 'reactions'\n};\n\nexport class AppReactionsManager extends AppManager {\n private availableReactions: AvailableReaction[];\n private sendReactionPromises: Map>;\n private lastSendingTimes: Map;\n\n protected after() {\n this.rootScope.addEventListener('language_change', () => {\n this.availableReactions = undefined;\n this.getAvailableReactions();\n });\n\n this.sendReactionPromises = new Map();\n this.lastSendingTimes = new Map();\n\n this.rootScope.addEventListener('user_auth', () => {\n setTimeout(() => {\n Promise.resolve(this.getAvailableReactions()).then(async(availableReactions) => {\n for(const availableReaction of availableReactions) {\n await Promise.all([\n availableReaction.around_animation && this.apiFileManager.downloadMedia({media: availableReaction.around_animation}),\n availableReaction.static_icon && this.apiFileManager.downloadMedia({media: availableReaction.static_icon}),\n availableReaction.appear_animation && this.apiFileManager.downloadMedia({media: availableReaction.appear_animation}),\n availableReaction.center_icon && this.apiFileManager.downloadMedia({media: availableReaction.center_icon})\n ]);\n\n await pause(1000);\n }\n });\n }, 7.5e3);\n });\n }\n\n public getAvailableReactions() {\n if(this.availableReactions) return this.availableReactions;\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.getAvailableReactions',\n processResult: (messagesAvailableReactions) => {\n assumeType(messagesAvailableReactions);\n\n const availableReactions = this.availableReactions = messagesAvailableReactions.reactions;\n for(const reaction of availableReactions) {\n for(const key of SAVE_DOC_KEYS) {\n if(!reaction[key]) {\n continue;\n }\n\n reaction[key] = this.appDocsManager.saveDoc(reaction[key], REFERENCE_CONTEXT);\n }\n }\n\n return availableReactions;\n },\n params: {\n hash: 0\n }\n });\n }\n\n public getActiveAvailableReactions() {\n return callbackify(this.getAvailableReactions(), (availableReactions) => {\n return availableReactions.filter((availableReaction) => !availableReaction.pFlags.inactive);\n });\n }\n\n public getAvailableReactionsForPeer(peerId: PeerId) {\n const activeAvailableReactions = this.getActiveAvailableReactions();\n if(peerId.isUser()) {\n return this.unshiftQuickReaction(activeAvailableReactions);\n }\n\n const chatFull = this.appProfileManager.getChatFull(peerId.toChatId());\n return callbackifyAll([activeAvailableReactions, chatFull, this.getQuickReaction()], ([activeAvailableReactions, chatFull, quickReaction]) => {\n const chatAvailableReactions = chatFull.available_reactions ?? {_: 'chatReactionsNone'};\n\n let filteredChatAvailableReactions: AvailableReaction[] = [];\n if(chatAvailableReactions._ === 'chatReactionsAll') {\n filteredChatAvailableReactions = activeAvailableReactions;\n } else if(chatAvailableReactions._ === 'chatReactionsSome') {\n filteredChatAvailableReactions = chatAvailableReactions.reactions.map((reaction) => {\n return activeAvailableReactions.find((availableReaction) => availableReaction.reaction === (reaction as Reaction.reactionEmoji).emoticon);\n }).filter(Boolean);\n }\n\n return this.unshiftQuickReactionInner(filteredChatAvailableReactions, quickReaction);\n });\n }\n\n private unshiftQuickReactionInner(availableReactions: AvailableReaction[], quickReaction: Reaction | AvailableReaction) {\n if(quickReaction && quickReaction._ !== 'reactionEmoji' && quickReaction._ !== 'availableReaction') return availableReactions;\n const emoticon = (quickReaction as Reaction.reactionEmoji).emoticon || (quickReaction as AvailableReaction).reaction;\n const availableReaction = findAndSplice(availableReactions, (availableReaction) => availableReaction.reaction === emoticon);\n if(availableReaction) {\n availableReactions.unshift(availableReaction);\n }\n\n return availableReactions;\n }\n\n private unshiftQuickReaction(\n availableReactions: AvailableReaction[] | PromiseLike,\n quickReaction: ReturnType = this.getQuickReaction()\n ) {\n return callbackifyAll([\n availableReactions,\n quickReaction\n ], ([availableReactions, quickReaction]) => {\n return this.unshiftQuickReactionInner(availableReactions, quickReaction);\n });\n }\n\n public getAvailableReactionsByMessage(message: Message.message) {\n if(!message) return [];\n const peerId = (message.fwd_from?.channel_post && this.appPeersManager.isMegagroup(message.peerId) && message.fwdFromId) || message.peerId;\n return this.getAvailableReactionsForPeer(peerId);\n }\n\n public isReactionActive(reaction: string) {\n if(!this.availableReactions) return false;\n return !!this.availableReactions.find((availableReaction) => availableReaction.reaction === reaction);\n }\n\n public getQuickReaction() {\n return callbackifyAll([\n this.apiManager.getConfig(),\n this.getAvailableReactions()\n ], ([config, availableReactions]) => {\n const reaction = config.reactions_default;\n if(reaction?._ === 'reactionEmoji') {\n return availableReactions.find((availableReaction) => availableReaction.reaction === reaction.emoticon);\n }\n\n return reaction as Reaction.reactionCustomEmoji;\n });\n }\n\n public getReactionCached(reaction: string) {\n return this.availableReactions.find((availableReaction) => availableReaction.reaction === reaction);\n }\n\n public getReaction(reaction: string) {\n return callbackify(this.getAvailableReactions(), () => {\n return this.getReactionCached(reaction);\n });\n }\n\n public getMessagesReactions(peerId: PeerId, mids: number[]) {\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.getMessagesReactions',\n params: {\n id: mids.map((mid) => getServerMessageId(mid)),\n peer: this.appPeersManager.getInputPeerById(peerId)\n },\n processResult: (updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n\n // const update = (updates as Updates.updates).updates.find((update) => update._ === 'updateMessageReactions') as Update.updateMessageReactions;\n // return update.reactions;\n }\n });\n }\n\n public getMessageReactionsList(peerId: PeerId, mid: number, limit: number, reaction?: Reaction, offset?: string) {\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.getMessageReactionsList',\n params: {\n peer: this.appPeersManager.getInputPeerById(peerId),\n id: getServerMessageId(mid),\n limit,\n reaction,\n offset\n },\n processResult: (messageReactionsList) => {\n this.appUsersManager.saveApiUsers(messageReactionsList.users);\n return messageReactionsList;\n }\n });\n }\n\n public setDefaultReaction(reaction: Reaction) {\n return this.apiManager.invokeApi('messages.setDefaultReaction', {reaction}).then(async(value) => {\n if(value) {\n const appConfig = await this.apiManager.getConfig();\n if(appConfig) {\n appConfig.reactions_default = reaction;\n }/* else { // if no config or loading it - overwrite\n this.apiManager.getAppConfig(true);\n } */\n\n this.rootScope.dispatchEvent('quick_reaction', reaction);\n }\n\n return value;\n });\n }\n\n public async sendReaction(message: Message.message, reaction?: Reaction | AvailableReaction, onlyLocal?: boolean) {\n if(reaction._ === 'availableReaction') {\n reaction = {\n _: 'reactionEmoji',\n emoticon: reaction.reaction\n };\n }\n\n const limit = await this.apiManager.getLimit('reactions');\n\n const lastSendingTimeKey = message.peerId + '_' + message.mid;\n const lastSendingTime = this.lastSendingTimes.get(lastSendingTimeKey);\n if(lastSendingTime) {\n return;\n } else {\n this.lastSendingTimes.set(lastSendingTimeKey, Date.now());\n setTimeout(() => {\n this.lastSendingTimes.delete(lastSendingTimeKey);\n }, 333);\n }\n\n const {peerId, mid} = message;\n const myPeerId = this.appPeersManager.peerId;\n\n const unsetReactionCount = (reactionCount: ReactionCount) => {\n --reactionCount.count;\n delete reactionCount.chosen_order;\n\n if(reactionsEqual(reaction as Reaction, reactionCount.reaction)) {\n reaction = undefined as Reaction;\n }\n\n if(!reactionCount.count) {\n indexOfAndSplice(reactions.results, reactionCount);\n }/* else {\n insertInDescendSortedArray(reactions.results, chosenReaction, 'count', chosenReactionIdx);\n } */\n\n if(reactions.recent_reactions) {\n findAndSplice(reactions.recent_reactions, (recentReaction) => reactionsEqual(recentReaction.reaction, reactionCount.reaction) && this.appPeersManager.getPeerId(recentReaction.peer_id) === myPeerId);\n }\n\n if(!reactions.results.length) {\n reactions = undefined;\n }\n };\n\n const canSeeList = message.reactions?.pFlags?.can_see_list || !this.appPeersManager.isBroadcast(message.peerId) || message.peerId.isUser();\n if(!message.reactions) {\n message.reactions = {\n _: 'messageReactions',\n results: [],\n recent_reactions: canSeeList ? [] : undefined,\n pFlags: {\n can_see_list: canSeeList || undefined\n }\n };\n }\n\n let reactions = onlyLocal ? message.reactions : copy(message.reactions);\n const chosenReactions = reactions.results.filter((reactionCount) => reactionCount.chosen_order !== undefined);\n chosenReactions.sort((a, b) => b.chosen_order - a.chosen_order);\n const unsetReactions: ReactionCount[] = [];\n const chosenReactionIdx = chosenReactions.findIndex((reactionCount) => reactionsEqual(reactionCount.reaction, reaction as Reaction));\n if(chosenReactionIdx !== -1) unsetReactions.push(...chosenReactions.splice(chosenReactionIdx, 1));\n unsetReactions.push(...chosenReactions.splice(limit - +(chosenReactionIdx === -1)));\n unsetReactions.forEach((reactionCount) => {\n chosenReactions.forEach((chosenReactionCount) => {\n if(chosenReactionCount.chosen_order > reactionCount.chosen_order) {\n --chosenReactionCount.chosen_order;\n }\n });\n\n unsetReactionCount(reactionCount);\n });\n\n const chosenReactionsLength = chosenReactions.length;\n chosenReactions.forEach((reactionCount, idx) => {\n reactionCount.chosen_order = chosenReactionsLength - 1 - idx;\n });\n\n if(reaction) {\n if(!reactions) {\n reactions/* = message.reactions */ = {\n _: 'messageReactions',\n results: [],\n pFlags: {}\n };\n\n if(canSeeList) {\n reactions.pFlags.can_see_list = true;\n }\n }\n\n let reactionCountIdx = reactions.results.findIndex((reactionCount) => reactionsEqual(reactionCount.reaction, reaction as Reaction));\n let reactionCount = reactionCountIdx !== -1 && reactions.results[reactionCountIdx];\n if(!reactionCount) {\n reactionCount = {\n _: 'reactionCount',\n count: 0,\n reaction\n };\n\n reactionCountIdx = reactions.results.push(reactionCount) - 1;\n }\n\n ++reactionCount.count;\n reactionCount.chosen_order = chosenReactions.length ? chosenReactions[0].chosen_order + 1 : 0;\n chosenReactions.unshift(reactionCount);\n\n if(!reactions.recent_reactions && canSeeList) {\n reactions.recent_reactions = [];\n }\n\n if(reactions.recent_reactions) {\n const peerReaction: MessagePeerReaction = {\n _: 'messagePeerReaction',\n reaction,\n peer_id: this.appPeersManager.getOutputPeer(myPeerId),\n pFlags: {}\n };\n\n if(!this.appPeersManager.isMegagroup(peerId) && false) {\n reactions.recent_reactions.push(peerReaction);\n reactions.recent_reactions = reactions.recent_reactions.slice(-3);\n } else {\n reactions.recent_reactions.unshift(peerReaction);\n reactions.recent_reactions = reactions.recent_reactions.slice(0, 3);\n }\n }\n\n // insertInDescendSortedArray(reactions.results, reactionCount, 'count', reactionCountIdx);\n }\n\n const availableReactions = this.availableReactions;\n if(reactions && availableReactions?.length) {\n const indexes: Map = new Map();\n availableReactions.forEach((availableReaction, idx) => {\n indexes.set(availableReaction.reaction, idx);\n });\n\n reactions.results.sort((a, b) => {\n const id1 = (a.reaction as Reaction.reactionCustomEmoji).document_id || (a.reaction as Reaction.reactionEmoji).emoticon;\n const id2 = (b.reaction as Reaction.reactionCustomEmoji).document_id || (b.reaction as Reaction.reactionEmoji).emoticon;\n return (b.count - a.count) || ((indexes.get(id1) ?? 0) - (indexes.get(id2) ?? 0));\n });\n }\n\n if(onlyLocal) {\n message.reactions = reactions;\n this.rootScope.dispatchEvent('messages_reactions', [{message, changedResults: []}]);\n return Promise.resolve();\n }\n\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateMessageReactions',\n peer: message.peer_id,\n msg_id: message.id,\n reactions: reactions,\n local: true\n });\n\n const promiseKey = [peerId, mid].join('-');\n const msgId = getServerMessageId(mid);\n const promise = this.apiManager.invokeApi('messages.sendReaction', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n msg_id: msgId,\n reaction: chosenReactions.map((reactionCount) => reactionCount.reaction)\n }).then((updates) => {\n assumeType(updates);\n\n const editMessageUpdateIdx = updates.updates.findIndex((update) => update._ === 'updateEditMessage' || update._ === 'updateEditChannelMessage');\n if(editMessageUpdateIdx !== -1) {\n const editMessageUpdate = updates.updates[editMessageUpdateIdx] as Update.updateEditMessage | Update.updateEditChannelMessage;\n updates.updates[editMessageUpdateIdx] = {\n _: 'updateMessageReactions',\n msg_id: msgId,\n peer: this.appPeersManager.getOutputPeer(peerId),\n reactions: (editMessageUpdate.message as Message.message).reactions,\n pts: editMessageUpdate.pts,\n pts_count: editMessageUpdate.pts_count\n };\n }\n\n this.apiUpdatesManager.processUpdateMessage(updates);\n }).catch((err) => {\n if(err.type === 'REACTION_INVALID' && this.sendReactionPromises.get(promiseKey) === promise) {\n this.sendReaction(message, chosenReactions[0]?.reaction, true);\n }\n }).finally(() => {\n if(this.sendReactionPromises.get(promiseKey) === promise) {\n this.sendReactionPromises.delete(promiseKey);\n }\n });\n\n this.sendReactionPromises.set(promiseKey, promise);\n return promise;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDocument} from './appDocsManager';\nimport type {DownloadOptions} from '../mtproto/apiFileManager';\nimport {Document, InputFileLocation, InputStickerSet, MessagesAllStickers, MessagesFavedStickers, MessagesFeaturedStickers, MessagesFoundStickerSets, MessagesRecentStickers, MessagesStickers, MessagesStickerSet, PhotoSize, StickerPack, StickerSet, StickerSetCovered, Update, VideoSize} from '../../layer';\nimport {Modify} from '../../types';\nimport AppStorage from '../storage';\nimport DATABASE_STATE from '../../config/databases/state';\nimport assumeType from '../../helpers/assumeType';\nimport fixBase64String from '../../helpers/fixBase64String';\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport findAndSplice from '../../helpers/array/findAndSplice';\nimport {AppManager} from './manager';\nimport fixEmoji from '../richTextProcessor/fixEmoji';\nimport ctx from '../../environment/ctx';\nimport {getEnvironment} from '../../environment/utils';\nimport getDocumentInput from './utils/docs/getDocumentInput';\nimport getStickerEffectThumb from './utils/stickers/getStickerEffectThumb';\nimport tsNow from '../../helpers/tsNow';\n\nconst CACHE_TIME = 3600e3;\n\ntype LOCAL_STICKER_SET_ID = Extract<\n InputStickerSet['_'],\n 'inputStickerSetAnimatedEmoji' | 'inputStickerSetAnimatedEmojiAnimations' |\n 'inputStickerSetPremiumGifts' | 'inputStickerSetEmojiGenericAnimations' |\n 'inputStickerSetEmojiDefaultStatuses' | 'inputStickerSetEmojiDefaultTopicIcons'\n>;\n\ntype LOCAL_ID = 'EMOJI' | 'EMOJI_ANIMATIONS' | 'PREMIUM_GIFTS' | 'GENERIC_ANIMATIONS' | 'DEFAULT_STATUSES' | 'DEFAULT_TOPIC_ICONS';\n\nconst LOCAL_IDS: {[key in LOCAL_ID]: LOCAL_STICKER_SET_ID} = {\n EMOJI: 'inputStickerSetAnimatedEmoji',\n EMOJI_ANIMATIONS: 'inputStickerSetAnimatedEmojiAnimations',\n PREMIUM_GIFTS: 'inputStickerSetPremiumGifts',\n GENERIC_ANIMATIONS: 'inputStickerSetEmojiGenericAnimations',\n DEFAULT_STATUSES: 'inputStickerSetEmojiDefaultStatuses',\n DEFAULT_TOPIC_ICONS: 'inputStickerSetEmojiDefaultTopicIcons'\n}\n\nconst LOCAL_IDS_SET: Set = new Set(Object.values(LOCAL_IDS) as any);\n\n// let TEST_FILE_REFERENCE_REFRESH = true;\n\nexport type MyStickerSetInput = {\n id: StickerSet.stickerSet['id'],\n access_hash?: StickerSet.stickerSet['access_hash']\n};\n\nexport type MyMessagesStickerSet = MessagesStickerSet.messagesStickerSet;\n\nexport class AppStickersManager extends AppManager {\n private storage = new AppStorage, typeof DATABASE_STATE>(DATABASE_STATE, 'stickerSets');\n\n private getStickerSetPromises: {[setId: Long]: Promise};\n private getStickersByEmoticonsPromises: {[emoticon: string]: Promise};\n\n private greetingStickers: MyDocument[];\n private getGreetingStickersTimeout: number;\n private getGreetingStickersPromise: Promise;\n\n private sounds: Record;\n private getAnimatedEmojiSoundsPromise: Promise;\n\n private favedStickers: MyDocument[];\n private recentStickers: MyDocument[];\n\n private names: Record;\n\n protected after() {\n this.clear(true);\n\n this.rootScope.addEventListener('user_auth', () => {\n setTimeout(() => {\n this.getAnimatedEmojiStickerSet();\n // this.getFavedStickersStickers();\n }, 1000);\n\n if(!this.getGreetingStickersPromise) {\n this.getGreetingStickersTimeout ??= ctx.setTimeout(() => {\n this.getGreetingStickersTimeout = undefined;\n this.getGreetingSticker(true);\n }, 5000);\n }\n });\n\n this.rootScope.addEventListener('app_config', () => this.onStickersUpdated('faved', true));\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateNewStickerSet: (update) => {\n const stickerSet = update.stickerset as MyMessagesStickerSet;\n this.saveStickerSet(stickerSet, stickerSet.set.id);\n this.rootScope.dispatchEvent('stickers_installed', stickerSet.set);\n },\n\n updateRecentStickers: () => this.onStickersUpdated('recent', true),\n\n updateFavedStickers: () => this.onStickersUpdated('faved', true),\n\n updateMoveStickerSetToTop: (update) => {\n this.rootScope.dispatchEvent('stickers_top', update.stickerset);\n },\n\n updateStickerSetsOrder: (update) => {\n this.rootScope.dispatchEvent('stickers_order', {\n type: update.pFlags.emojis ? 'emojis' : (update.pFlags.masks ? 'masks' : 'stickers'),\n order: update.order\n });\n }\n\n // updateStickerSets: (update) => {\n // if(update.pFlags.masks) {\n // return;\n // }\n\n // this.storage.clear(false);\n\n // if(update.pFlags.emojis) {\n\n // } else {\n // this.favedStickers = undefined;\n // this.recentStickers = undefined;\n // this.onStickersUpdated('recent', true);\n // this.onStickersUpdated('faved', true);\n // }\n // }\n });\n }\n\n public clear = (init?: boolean) => {\n this.getStickerSetPromises = {};\n this.getStickersByEmoticonsPromises = {};\n this.sounds = {};\n this.names = {};\n };\n\n private async onStickersUpdated(type: 'faved' | 'recent', overwrite: boolean) {\n const stickers = await (type === 'faved' ? this.getFavedStickersStickers(overwrite) : this.getRecentStickersStickers(overwrite));\n this.rootScope.dispatchEvent('stickers_updated', {\n type,\n stickers\n });\n }\n\n public getGreetingSticker(justPreload = false) {\n if(this.getGreetingStickersTimeout) {\n clearTimeout(this.getGreetingStickersTimeout);\n this.getGreetingStickersTimeout = undefined;\n }\n\n if(!this.getGreetingStickersPromise) {\n this.getGreetingStickersPromise = this.getStickersByEmoticon('👋⭐️', false).then((docs) => {\n if(!docs.length) throw 'NO_STICKERS';\n this.greetingStickers = docs.slice() as Document.document[];\n this.greetingStickers.sort((a, b) => Math.random() - Math.random());\n });\n }\n\n return this.getGreetingStickersPromise.then(() => {\n let doc: Document.document;\n if(!justPreload) {\n doc = this.greetingStickers.shift();\n this.greetingStickers.push(doc);\n }\n\n this.apiFileManager.downloadMedia({media: this.greetingStickers[0]}); // preload next sticker\n\n return doc;\n });\n }\n\n private saveStickers(docs: Document[]) {\n forEachReverse(docs, (doc, idx) => {\n doc = this.appDocsManager.saveDoc(doc);\n\n if(!doc) docs.splice(idx, 1);\n else docs[idx] = doc;\n });\n }\n\n private canUseStickerSetCache(set: MyMessagesStickerSet, useCache?: boolean) {\n return set && set.documents?.length && ((Date.now() - set.refreshTime) < CACHE_TIME || useCache);\n }\n\n public getStickerSet(set: MyStickerSetInput, params: Partial<{\n overwrite: boolean,\n useCache: boolean,\n saveById: boolean\n }> = {}): Promise | MyMessagesStickerSet {\n let {id} = set;\n if(!set.access_hash) {\n set = this.names[id] || set;\n id = set.id;\n }\n\n if(this.getStickerSetPromises[id]) {\n return this.getStickerSetPromises[id];\n }\n\n if(!params.overwrite) {\n const cachedSet = this.storage.getFromCache(id);\n if(this.canUseStickerSetCache(cachedSet, params.useCache)) {\n return cachedSet;\n }\n }\n\n const promise = this.getStickerSetPromises[id] = new Promise(async(resolve) => {\n if(!params.overwrite) {\n const cachedSet = await this.storage.get(id);\n if(this.canUseStickerSetCache(cachedSet, params.useCache)) {\n this.saveStickers(cachedSet.documents);\n resolve(cachedSet);\n\n if(this.getStickerSetPromises[id] === promise) {\n delete this.getStickerSetPromises[id];\n }\n\n return;\n }\n }\n\n try {\n const stickerSet = await this.apiManager.invokeApi('messages.getStickerSet', {\n stickerset: this.getStickerSetInput(set),\n hash: 0\n }) as MyMessagesStickerSet;\n\n const saveById = params.saveById ? id : stickerSet.set.id;\n this.saveStickerSet(stickerSet, saveById);\n\n resolve(stickerSet);\n } catch(err) {\n resolve(null);\n }\n\n if(this.getStickerSetPromises[id] === promise) {\n delete this.getStickerSetPromises[id];\n }\n });\n\n return promise;\n }\n\n public getLocalStickerSet(id: LOCAL_STICKER_SET_ID) {\n return this.getStickerSet({id}, {saveById: true});\n }\n\n public getAnimatedEmojiStickerSet() {\n return Promise.all([\n this.getLocalStickerSet(LOCAL_IDS.EMOJI),\n this.getLocalStickerSet(LOCAL_IDS.EMOJI_ANIMATIONS),\n this.getAnimatedEmojiSounds()\n ]).then(([emoji, animations]) => {\n return {emoji, animations};\n });\n }\n\n public getAnimatedEmojiSounds(overwrite?: boolean) {\n if(this.getAnimatedEmojiSoundsPromise && !overwrite) return this.getAnimatedEmojiSoundsPromise;\n const promise = this.getAnimatedEmojiSoundsPromise = Promise.all([\n this.apiManager.getAppConfig(overwrite),\n this.apiManager.getConfig()\n ]).then(([appConfig, config]) => {\n if(this.getAnimatedEmojiSoundsPromise !== promise) {\n return;\n }\n\n for(const emoji in appConfig.emojies_sounds) {\n const sound = appConfig.emojies_sounds[emoji];\n const bytesStr = atob(fixBase64String(sound.file_reference_base64, false));\n const bytes = new Uint8Array(bytesStr.length);\n for(let i = 0, length = bytes.length; i < length; ++i) {\n bytes[i] = bytesStr[i].charCodeAt(0);\n }\n\n // if(TEST_FILE_REFERENCE_REFRESH) {\n // bytes[0] = bytes[1] = bytes[2] = bytes[3] = bytes[4] = 0;\n // sound.access_hash += '999';\n // }\n\n const doc = this.appDocsManager.saveDoc({\n _: 'document',\n pFlags: {},\n flags: 0,\n id: sound.id,\n access_hash: sound.access_hash,\n attributes: [{\n _: 'documentAttributeAudio',\n duration: 1,\n pFlags: {\n voice: true\n }\n }],\n date: 0,\n dc_id: config.this_dc,\n file_reference: bytes,\n mime_type: 'audio/ogg'\n // size: 101010 // test loading everytime\n }, {\n type: 'emojiesSounds'\n });\n\n this.sounds[emoji] = doc;\n }\n\n // if(TEST_FILE_REFERENCE_REFRESH) {\n // TEST_FILE_REFERENCE_REFRESH = false;\n // }\n });\n\n return promise;\n }\n\n public async getRecentStickers(overwrite?: boolean): Promise> {\n const res = await this.apiManager.invokeApiHashable({\n method: 'messages.getRecentStickers',\n processResult: (res) => {\n assumeType(res);\n\n this.recentStickers = res.stickers as MyDocument[];\n this.saveStickers(res.stickers);\n return res;\n },\n overwrite\n });\n\n return res;\n }\n\n public getRecentStickersStickers(overwrite?: boolean) {\n if(overwrite) this.recentStickers = undefined;\n else if(this.recentStickers) return this.recentStickers;\n return this.getRecentStickers(overwrite).then(() => this.recentStickers);\n }\n\n public saveRecentSticker(docId: DocId, unsave?: boolean, attached?: boolean) {\n const doc = this.appDocsManager.getDoc(docId);\n\n findAndSplice(this.recentStickers, (_doc) => _doc.id === docId);\n if(!unsave) {\n this.recentStickers.unshift(doc);\n\n const docEmoticon = fixEmoji(doc.stickerEmojiRaw);\n for(const emoticon in this.getStickersByEmoticonsPromises) {\n const promise = this.getStickersByEmoticonsPromises[emoticon];\n promise.then((stickers) => {\n const _doc = findAndSplice(stickers, (_doc) => _doc.id === doc.id);\n if(_doc) {\n stickers.unshift(_doc);\n } else if(emoticon.includes(docEmoticon)) {\n stickers.unshift(doc);\n }\n });\n }\n }\n\n this.rootScope.dispatchEvent('sticker_updated', {type: 'recent', faved: !unsave, document: doc});\n\n if(unsave) {\n this.onStickersUpdated('recent', false);\n }\n\n return this.apiManager.invokeApi('messages.saveRecentSticker', {\n id: getDocumentInput(doc),\n unsave,\n attached\n });\n }\n\n private cleanEmoji(emoji: string) {\n return emoji.replace(/\\ufe0f/g, '').replace(/🏻|🏼|🏽|🏾|🏿/g, '');\n }\n\n public getAnimatedEmojiSticker(emoji: string, isAnimation?: boolean) {\n const id = isAnimation ? LOCAL_IDS.EMOJI_ANIMATIONS : LOCAL_IDS.EMOJI;\n const stickerSet = this.storage.getFromCache(id);\n // const stickerSet = await this.getStickerSet({id});\n if(!stickerSet?.documents) return;\n\n if(isAnimation) {\n if(['🧡', '💛', '💚', '💙', '💜', '🖤', '🤍', '🤎'].includes(emoji)) {\n emoji = '❤️';\n }\n }\n\n emoji = this.cleanEmoji(emoji);\n const pack = stickerSet.packs.find((p) => p.emoticon === emoji);\n return pack ? this.appDocsManager.getDoc(pack.documents[0]) : undefined;\n }\n\n public getAnimatedEmojiSoundDocument(emoji: string) {\n return this.sounds[this.cleanEmoji(emoji)];\n }\n\n public preloadAnimatedEmojiSticker(emoji: string) {\n const preloadEmojiPromise = this.getAnimatedEmojiStickerSet().then(() => {\n return this.getAnimatedEmojiSticker(emoji);\n });\n\n return Promise.all([\n preloadEmojiPromise,\n this.preloadAnimatedEmojiStickerAnimation(emoji)\n ]).then(([doc, a]) => {\n return {\n doc: doc,\n animation: a?.doc,\n sound: a?.sound\n };\n });\n }\n\n public preloadAnimatedEmojiStickerAnimation(emoji: string) {\n return this.getAnimatedEmojiStickerSet().then(() => {\n return this.getAnimatedEmojiSticker(emoji, true);\n }).then((doc) => {\n if(!doc) {\n return;\n }\n\n const sound = this.getAnimatedEmojiSoundDocument(emoji);\n return Promise.all([\n this.preloadSticker(doc.id),\n sound ? this.preloadSticker(sound.id) : undefined\n ]).then(() => {\n return {doc, sound};\n });\n });\n }\n\n public preloadSticker(docId: DocId, isPremiumEffect?: boolean) {\n const doc = this.appDocsManager.getDoc(docId);\n return this.apiFileManager.downloadMedia({media: doc, thumb: isPremiumEffect ? doc.video_thumbs?.[0] as Extract : undefined});\n }\n\n private saveStickerSet(res: Omit, id: DocId) {\n const newSet: MessagesStickerSet = {\n _: 'messages.stickerSet',\n set: res.set,\n packs: res.packs,\n documents: res.documents as Document[],\n keywords: res.keywords\n };\n\n let stickerSet = this.storage.getFromCache(id);\n if(stickerSet) {\n Object.assign(stickerSet, newSet);\n } else {\n stickerSet = this.storage.setToCache(id, newSet);\n }\n\n if(stickerSet.set.short_name) {\n this.names[stickerSet.set.short_name] = this.getStickerSetInput(newSet.set) as any;\n }\n\n this.saveStickers(res.documents);\n\n // console.log('stickers wrote', this.stickerSets);\n const needSave = stickerSet.set.installed_date || LOCAL_IDS_SET.has(id as any);\n stickerSet.refreshTime = Date.now();\n this.storage.set({[id]: stickerSet}, !needSave);\n }\n\n public getStickerSetThumbDownloadOptions(stickerSet: StickerSet.stickerSet): DownloadOptions {\n const thumb = stickerSet.thumbs.find((thumb) => thumb._ === 'photoSize') as PhotoSize.photoSize;\n const dcId = stickerSet.thumb_dc_id;\n\n const isAnimated = stickerSet.pFlags?.animated;\n\n const input: InputFileLocation.inputStickerSetThumb = {\n _: 'inputStickerSetThumb',\n stickerset: this.getStickerSetInput(stickerSet),\n thumb_version: stickerSet.thumb_version\n };\n\n return {dcId, location: input, size: thumb.size, mimeType: isAnimated ? 'application/x-tgsticker' : 'image/webp'};\n }\n\n /* public getStickerSetThumbURL(stickerSet: MTStickerSet) {\n const thumb = stickerSet.thumb;\n const dcId = stickerSet.thumb_dc_id;\n\n const isAnimated = stickerSet.pFlags?.animated;\n\n const input: inputStickerSetThumb = {\n _: 'inputStickerSetThumb',\n stickerset: this.getStickerSetInput(stickerSet),\n volume_id: thumb.location.volume_id,\n local_id: thumb.location.local_id\n };\n\n const url = getFileURL('document', this.getStickerSetThumbDownloadOptions(stickerSet));\n return url;\n\n //return promise;\n } */\n\n public getStickerSetInput(set: MyStickerSetInput): InputStickerSet {\n if(LOCAL_IDS_SET.has(set.id as any)) {\n return {\n _: set.id as any\n };\n } else if(!set.access_hash) {\n return {\n _: 'inputStickerSetShortName',\n short_name: '' + set.id\n };\n } else {\n return {\n _: 'inputStickerSetID',\n id: set.id,\n access_hash: set.access_hash\n };\n }\n }\n\n public async getFeaturedStickers() {\n const res = await this.apiManager.invokeApiHashable({\n method: 'messages.getFeaturedStickers',\n processResult: (res) => {\n assumeType(res);\n\n forEachReverse(res.sets, (covered, idx, arr) => {\n if(covered.set.pFlags.videos && !getEnvironment().IS_WEBM_SUPPORTED) {\n arr.splice(idx, 1);\n }\n });\n\n res.sets.forEach((covered) => {\n this.saveStickerSet({set: covered.set, documents: [], packs: [], keywords: []}, covered.set.id);\n });\n\n return res;\n }\n });\n\n return res.sets;\n }\n\n public getPromoPremiumStickers() {\n return this.getStickersByEmoticon('⭐️⭐️', false);\n }\n\n public getPremiumStickers() {\n return this.getStickersByEmoticon('📂⭐️', false);\n }\n\n public getFavedStickers(overwrite?: boolean) {\n return this.apiManager.invokeApiHashable({\n method: 'messages.getFavedStickers',\n processResult: (favedStickers) => {\n assumeType(favedStickers);\n this.saveStickers(favedStickers.stickers);\n this.favedStickers = favedStickers.stickers as MyDocument[];\n return favedStickers;\n },\n overwrite\n });\n }\n\n public getFavedStickersStickers(overwrite?: boolean) {\n if(overwrite) this.favedStickers = undefined;\n else if(this.favedStickers) return this.favedStickers;\n return this.getFavedStickers(overwrite).then(() => this.favedStickers);\n }\n\n public getFavedStickersLimit() {\n return this.apiManager.getLimit('favedStickers');\n }\n\n public async faveSticker(docId: DocId, unfave?: boolean) {\n if(!this.favedStickers) {\n await this.getFavedStickersStickers();\n }\n\n const limit = await this.getFavedStickersLimit();\n\n const doc = this.appDocsManager.getDoc(docId);\n findAndSplice(this.favedStickers, (_doc) => _doc.id === doc.id);\n\n if(!unfave) {\n this.favedStickers.unshift(doc);\n const spliced = this.favedStickers.splice(limit, this.favedStickers.length - limit);\n }\n\n this.rootScope.dispatchEvent('sticker_updated', {type: 'faved', faved: !unfave, document: doc});\n\n return this.apiManager.invokeApi('messages.faveSticker', {\n id: getDocumentInput(doc),\n unfave\n }).then(() => {\n if(unfave) {\n this.onStickersUpdated('faved', true);\n }\n });\n }\n\n public async toggleStickerSet(set: StickerSet.stickerSet) {\n set = this.storage.getFromCache(set.id).set;\n\n if(set.installed_date) {\n const res = await this.apiManager.invokeApi('messages.uninstallStickerSet', {\n stickerset: this.getStickerSetInput(set)\n });\n\n if(res) {\n delete set.installed_date;\n this.rootScope.dispatchEvent('stickers_deleted', set);\n this.storage.delete(set.id, true);\n return true;\n }\n } else {\n const res = await this.apiManager.invokeApi('messages.installStickerSet', {\n stickerset: this.getStickerSetInput(set),\n archived: false\n });\n\n if(res) {\n set.installed_date = tsNow(true);\n this.rootScope.dispatchEvent('stickers_installed', set);\n return true;\n }\n }\n\n return false;\n }\n\n public toggleStickerSets(sets: StickerSet.stickerSet[]) {\n return Promise.all(sets.map((set) => this.toggleStickerSet(set)));\n }\n\n public async searchStickerSets(query: string, excludeFeatured = true) {\n const flags = excludeFeatured ? 1 : 0;\n const res = await this.apiManager.invokeApiHashable({\n method: 'messages.searchStickerSets',\n params: {\n flags,\n exclude_featured: excludeFeatured || undefined,\n q: query\n },\n processResult: (res) => {\n assumeType(res);\n\n forEachReverse(res.sets, (covered, idx, arr) => {\n if(covered.set.pFlags.videos && !getEnvironment().IS_WEBM_SUPPORTED) {\n arr.splice(idx, 1);\n }\n });\n\n res.sets.forEach((covered) => {\n this.saveStickerSet({set: covered.set, documents: [], packs: [], keywords: []}, covered.set.id);\n });\n\n return res;\n }\n });\n\n const foundSaved: StickerSetCovered[] = [];\n const cache = this.storage.getCache();\n for(const id in cache) {\n const {set} = cache[id];\n\n if(set.title.toLowerCase().includes(query.toLowerCase()) && !res.sets.find((c) => c.set.id === set.id)) {\n foundSaved.push({_: 'stickerSetCovered', set, cover: null});\n }\n }\n\n return res.sets.concat(foundSaved);\n }\n\n private processAllStickersResult = (allStickers: MessagesAllStickers) => {\n assumeType(allStickers);\n\n forEachReverse(allStickers.sets, (stickerSet, idx, arr) => {\n if(stickerSet.pFlags.videos && !getEnvironment().IS_WEBM_SUPPORTED) {\n arr.splice(idx, 1);\n }\n });\n\n return allStickers;\n };\n\n public getAllStickers() {\n return this.apiManager.invokeApiHashable({\n method: 'messages.getAllStickers',\n processResult: this.processAllStickersResult\n });\n }\n\n public getEmojiStickers() {\n return this.apiManager.invokeApiHashable({\n method: 'messages.getEmojiStickers',\n processResult: this.processAllStickersResult\n });\n }\n\n public preloadStickerSets() {\n return this.getAllStickers().then((allStickers) => {\n const sets = (allStickers as MessagesAllStickers.messagesAllStickers).sets;\n return Promise.all(sets.map((set) => this.getStickerSet(set, {useCache: true})));\n });\n }\n\n // TODO: detect \"🤷\" by \"🤷‍♂️\"\n public getStickersByEmoticon(emoticon: string, includeOurStickers = true, includeServerStickers = true) {\n emoticon = fixEmoji(emoticon);\n const cacheKey = emoticon + (includeOurStickers ? '1' : '0') + (includeServerStickers ? '1' : '0');\n if(this.getStickersByEmoticonsPromises[cacheKey]) return this.getStickersByEmoticonsPromises[cacheKey];\n\n return this.getStickersByEmoticonsPromises[cacheKey] = Promise.all([\n includeServerStickers ? this.apiManager.invokeApiHashable({\n method: 'messages.getStickers',\n params: {\n emoticon\n },\n processResult: (stickers) => stickers\n }) : undefined,\n includeOurStickers ? this.preloadStickerSets() : [],\n includeOurStickers ? this.getRecentStickers() : undefined\n ]).then(([messagesStickers, installedSets, recentStickers]) => {\n const foundStickers = messagesStickers ? (messagesStickers as MessagesStickers.messagesStickers).stickers.map((sticker) => this.appDocsManager.saveDoc(sticker)) : [];\n const cachedStickersAnimated: Document.document[] = [], cachedStickersStatic: Document.document[] = [];\n\n // console.log('getStickersByEmoticon', messagesStickers, installedSets, recentStickers);\n\n const iteratePacks = (packs: StickerPack.stickerPack[]) => {\n for(const pack of packs) {\n const packEmoticon = fixEmoji(pack.emoticon);\n if(packEmoticon.includes(emoticon)) {\n for(const docId of pack.documents) {\n const doc = this.appDocsManager.getDoc(docId);\n (doc.animated ? cachedStickersAnimated : cachedStickersStatic).push(doc);\n }\n }\n }\n };\n\n if(recentStickers) {\n iteratePacks(recentStickers.packs);\n const stickers = recentStickers.stickers;\n [cachedStickersAnimated, cachedStickersStatic].forEach((s) => {\n s.sort((a, b) => stickers.indexOf(a) - stickers.indexOf(b));\n });\n }\n\n for(const set of installedSets) {\n iteratePacks(set.packs);\n }\n\n /* const entities = parseEntities(emoticon);\n if(entities.length === 1) {\n [cachedStickersAnimated, cachedStickersStatic].forEach((s) => {\n forEachReverse(s, (doc, idx) => {\n const docEmoticon = fixEmoji(doc.stickerEmojiRaw);\n if(docEmoticon !== emoticon) {\n s.splice(idx, 1);\n }\n });\n });\n } */\n\n const stickers = [...new Set(cachedStickersAnimated.concat(cachedStickersStatic, foundStickers))]/* .filter((doc) => !doc.animated) */;\n\n forEachReverse(stickers, (sticker, idx, arr) => {\n if((sticker.sticker === 3 && !getEnvironment().IS_WEBM_SUPPORTED) ||\n (!this.rootScope.premium && getStickerEffectThumb(sticker))) {\n arr.splice(idx, 1);\n }\n });\n\n return stickers;\n });\n }\n\n public clearRecentStickers() {\n if(this.recentStickers) {\n this.recentStickers.length = 0;\n this.onStickersUpdated('recent', false);\n }\n\n return this.apiManager.invokeApi('messages.clearRecentStickers');\n }\n\n public reorderStickerSets(order: StickerSet.stickerSet['id'][], emojis?: boolean, masks?: boolean) {\n return this.apiManager.invokeApi('messages.reorderStickerSets', {\n emojis,\n masks,\n order\n }).then(() => {\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updateStickerSetsOrder',\n order,\n pFlags: {\n emojis: emojis || undefined,\n masks: masks || undefined\n }\n });\n });\n }\n}\n","export default function fixBase64String(str: string, toUrl: boolean) {\n if(toUrl) {\n return str.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/\\=+$/, '');\n } else {\n return str.replace(/-/g, '+').replace(/_/g, '/');\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport filterUnique from '../../helpers/array/filterUnique';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport cleanSearchText from '../../helpers/cleanSearchText';\nimport cleanUsername from '../../helpers/cleanUsername';\nimport tsNow from '../../helpers/tsNow';\nimport isObject from '../../helpers/object/isObject';\nimport safeReplaceObject from '../../helpers/object/safeReplaceObject';\nimport {isRestricted} from '../../helpers/restrictions';\nimport {Chat, ContactsResolvedPeer, InputContact, InputGeoPoint, InputMedia, InputPeer, InputUser, User as MTUser, UserProfilePhoto, UserStatus} from '../../layer';\nimport parseEntities from '../richTextProcessor/parseEntities';\nimport wrapUrl from '../richTextProcessor/wrapUrl';\nimport SearchIndex from '../searchIndex';\nimport {AppManager} from './manager';\nimport getPeerId from './utils/peers/getPeerId';\nimport canSendToUser from './utils/users/canSendToUser';\nimport {AppStoragesManager} from './appStoragesManager';\nimport deepEqual from '../../helpers/object/deepEqual';\nimport getPeerActiveUsernames from './utils/peers/getPeerActiveUsernames';\n\nexport type User = MTUser.user;\nexport type TopPeerType = 'correspondents' | 'bots_inline';\nexport type MyTopPeer = {id: PeerId, rating: number};\n\nexport class AppUsersManager extends AppManager {\n private storage: AppStoragesManager['storages']['users'];\n\n private users: {[userId: UserId]: User};\n private usernames: {[username: string]: PeerId};\n private contactsIndex: SearchIndex;\n private contactsFillPromise: CancellablePromise;\n private contactsList: Set;\n private updatedContactsList: boolean;\n\n private getTopPeersPromises: {[type in TopPeerType]?: Promise};\n\n protected after() {\n this.clear(true);\n\n setInterval(this.updateUsersStatuses, 60000);\n\n this.rootScope.addEventListener('state_synchronized', this.updateUsersStatuses);\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateUserStatus: (update) => {\n const userId = update.user_id;\n const user = this.users[userId];\n if(user) {\n user.status = update.status;\n if(user.status) {\n if('expires' in user.status) {\n user.status.expires -= this.timeManager.getServerTimeOffset();\n }\n\n if('was_online' in user.status) {\n user.status.was_online -= this.timeManager.getServerTimeOffset();\n }\n }\n\n // user.sortStatus = this.getUserStatusForSort(user.status);\n this.rootScope.dispatchEvent('user_update', userId);\n this.setUserToStateIfNeeded(user);\n } // ////else console.warn('No user by id:', userId);\n },\n\n // updateUserPhoto: (update) => {\n // const userId = update.user_id;\n // const user = this.users[userId];\n // if(user) {\n // if((user.photo as UserProfilePhoto.userProfilePhoto)?.photo_id === (update.photo as UserProfilePhoto.userProfilePhoto)?.photo_id) {\n // return;\n // }\n\n // this.forceUserOnline(userId, update.date);\n\n // if(update.photo._ === 'userProfilePhotoEmpty') {\n // delete user.photo;\n // } else {\n // user.photo = safeReplaceObject(user.photo, update.photo);\n // }\n\n // this.setUserToStateIfNeeded(user);\n\n // this.rootScope.dispatchEvent('user_update', userId);\n // this.rootScope.dispatchEvent('avatar_update', userId.toPeerId());\n // } else console.warn('No user by id:', userId);\n // },\n\n updateUserName: (update) => {\n const userId = update.user_id;\n const user = this.users[userId];\n if(user) {\n this.forceUserOnline(userId);\n\n this.saveApiUser({\n ...user,\n first_name: update.first_name,\n last_name: update.last_name,\n username: undefined,\n usernames: update.usernames\n }, true);\n }\n }\n });\n\n /* case 'updateContactLink':\n this.onContactUpdated(update.user_id, update.my_link._ === 'contactLinkContact');\n break; */\n\n this.rootScope.addEventListener('language_change', (e) => {\n const userId = this.getSelf().id;\n this.contactsIndex.indexObject(userId, this.getUserSearchText(userId));\n });\n\n return Promise.all([\n this.appStateManager.getState(),\n this.appStoragesManager.loadStorage('users')\n ]).then(([state, {results: users, storage}]) => {\n this.storage = storage;\n\n this.saveApiUsers(users);\n for(let i = 0, length = users.length; i < length; ++i) {\n const user = users[i];\n if(!user) {\n continue;\n }\n\n if(state.contactsListCachedTime && (user.pFlags.contact || user.pFlags.mutual_contact)) {\n this.pushContact(user.id);\n\n if(!this.contactsFillPromise) {\n this.contactsFillPromise = deferredPromise();\n this.contactsFillPromise.resolve(this.contactsList);\n }\n }\n }\n\n // const contactsList = state.contactsList;\n // if(Array.isArray(contactsList)) {\n // contactsList.forEach((userId) => {\n // this.pushContact(userId);\n // });\n\n // if(contactsList.length) {\n // this.contactsFillPromise = deferredPromise();\n // this.contactsFillPromise.resolve(this.contactsList);\n // }\n // }\n\n const recentSearch = state.recentSearch || [];\n for(let i = 0, length = recentSearch.length; i < length; ++i) {\n this.peersStorage.requestPeer(recentSearch[i], 'recentSearch');\n }\n\n this.peersStorage.addEventListener('peerNeeded', (peerId) => {\n if(!this.appPeersManager.isUser(peerId)) {\n return;\n }\n\n const userId = peerId.toUserId();\n if(!this.storage.getFromCache(userId)) {\n this.storage.set({\n [userId]: this.getUser(userId)\n });\n }\n });\n\n this.peersStorage.addEventListener('peerUnneeded', (peerId) => {\n if(!this.appPeersManager.isUser(peerId)) {\n return;\n }\n\n const userId = peerId.toUserId();\n if(this.storage.getFromCache(userId)) {\n this.storage.delete(userId);\n }\n });\n });\n }\n\n public clear = (init = false) => {\n if(!init) {\n for(const userId in this.users) {\n // const userId = +userId;\n if(!userId) continue;\n const peerId = userId.toPeerId();\n if(!this.peersStorage.isPeerNeeded(peerId)) {\n const user = this.users[userId];\n this.modifyUsernamesCache(user, false);\n\n this.storage.delete(userId);\n delete this.users[userId];\n }\n }\n } else {\n this.users = {};\n this.usernames = {};\n }\n\n this.getTopPeersPromises = {};\n this.contactsIndex = this.createSearchIndex();\n this.contactsFillPromise = undefined;\n this.contactsList = new Set();\n this.updatedContactsList = false;\n };\n\n public get userId() {\n return this.rootScope.myId.toUserId();\n }\n\n private onContactsModified(fromServer?: boolean) {\n // const contactsList = [...this.contactsList];\n // this.appStateManager.pushToState('contactsList', contactsList);\n\n if(fromServer) {\n this.appStateManager.pushToState('contactsListCachedTime', tsNow(true));\n }\n }\n\n public pushRecentSearch(peerId: PeerId) {\n return this.appStateManager.getState().then((state) => {\n const recentSearch = state.recentSearch || [];\n if(recentSearch[0] !== peerId) {\n indexOfAndSplice(recentSearch, peerId);\n recentSearch.unshift(peerId);\n if(recentSearch.length > 20) {\n recentSearch.length = 20;\n }\n\n this.appStateManager.pushToState('recentSearch', recentSearch);\n for(const peerId of recentSearch) {\n this.peersStorage.requestPeer(peerId, 'recentSearch');\n }\n }\n });\n }\n\n public clearRecentSearch() {\n return this.appStateManager.getState().then((state) => {\n const recentSearch = state.recentSearch || [];\n for(const peerId of recentSearch) {\n this.peersStorage.releasePeer(peerId, 'recentSearch');\n }\n\n recentSearch.length = 0;\n this.appStateManager.pushToState('recentSearch', recentSearch);\n });\n }\n\n public fillContacts() {\n if(this.contactsFillPromise && this.updatedContactsList) {\n return {\n cached: this.contactsFillPromise.isFulfilled,\n promise: this.contactsFillPromise\n };\n }\n\n this.updatedContactsList = true;\n\n const promise = deferredPromise>();\n this.apiManager.invokeApi('contacts.getContacts').then((result) => {\n if(result._ === 'contacts.contacts') {\n this.contactsList.clear();\n\n this.saveApiUsers(result.users);\n\n result.contacts.forEach((contact) => {\n this.pushContact(contact.user_id);\n });\n\n this.onContactsModified(true);\n\n this.contactsFillPromise = promise;\n }\n\n promise.resolve(this.contactsList);\n }, () => {\n this.updatedContactsList = false;\n });\n\n return {\n cached: this.contactsFillPromise?.isFulfilled,\n promise: this.contactsFillPromise ||= promise\n };\n }\n\n public resolveUsername(username: string): Promise | Chat | User {\n if(username[0] === '@') {\n username = username.slice(1);\n }\n\n username = username.toLowerCase();\n const peerId = this.usernames[username];\n if(peerId) {\n return this.appPeersManager.getPeer(peerId);\n }\n\n return this.apiManager.invokeApiSingleProcess({\n method: 'contacts.resolveUsername',\n params: {username},\n processResult: (resolvedPeer) => this.processResolvedPeer(resolvedPeer)\n });\n }\n\n private processResolvedPeer(resolvedPeer: ContactsResolvedPeer.contactsResolvedPeer) {\n this.saveApiUsers(resolvedPeer.users);\n this.appChatsManager.saveApiChats(resolvedPeer.chats);\n\n return this.appPeersManager.getPeer(getPeerId(resolvedPeer.peer)) as Chat | User;\n }\n\n public resolvePhone(phone: string) {\n return this.apiManager.invokeApi('contacts.resolvePhone', {phone}).then((resolvedPeer) => {\n return this.processResolvedPeer(resolvedPeer) as User;\n });\n }\n\n private pushContact(id: UserId) {\n this.contactsList.add(id);\n this.contactsIndex.indexObject(id, this.getUserSearchText(id));\n this.peersStorage.requestPeer(id.toPeerId(), 'contact');\n }\n\n private popContact(id: UserId) {\n this.contactsList.delete(id);\n this.contactsIndex.indexObject(id, ''); // delete search index\n this.peersStorage.releasePeer(id.toPeerId(), 'contact');\n }\n\n public getUserSearchText(id: UserId) {\n const user = this.users[id];\n if(!user) {\n return '';\n }\n\n const arr: string[] = [\n user.first_name,\n user.last_name,\n user.phone,\n ...getPeerActiveUsernames(user),\n // user.pFlags.self ? I18n.format('SavedMessages', true) : '',\n user.pFlags.self ? 'Saved Messages' : ''\n ];\n\n return arr.filter(Boolean).join(' ');\n }\n\n public getContacts(query?: string, includeSaved = false, sortBy: 'name' | 'online' | 'none' = 'name') {\n return this.fillContacts().promise.then((_contactsList) => {\n let contactsList = [..._contactsList];\n if(query) {\n const results = this.contactsIndex.search(query);\n const filteredContactsList = [...contactsList].filter((id) => results.has(id));\n\n contactsList = filteredContactsList;\n }\n\n if(sortBy === 'name') {\n contactsList.sort((userId1, userId2) => {\n const sortName1 = (this.users[userId1] || {}).sortName || '';\n const sortName2 = (this.users[userId2] || {}).sortName || '';\n return sortName1.localeCompare(sortName2);\n });\n } else if(sortBy === 'online') {\n contactsList.sort((userId1, userId2) => {\n const status1 = this.getUserStatusForSort(this.getUser(userId1).status);\n const status2 = this.getUserStatusForSort(this.getUser(userId2).status);\n return status2 - status1;\n });\n }\n\n const myUserId = this.userId;\n indexOfAndSplice(contactsList, myUserId);\n if(includeSaved) {\n if(this.testSelfSearch(query)) {\n contactsList.unshift(myUserId);\n }\n }\n\n return contactsList;\n });\n }\n\n public getContactsPeerIds(\n query?: Parameters[0],\n includeSaved?: Parameters[1],\n sortBy?: Parameters[2],\n limit?: number\n ) {\n return this.getContacts(query, includeSaved, sortBy).then((userIds) => {\n const peerIds = userIds.map((userId) => userId.toPeerId(false));\n if(limit) {\n return peerIds.slice(0, limit);\n }\n\n return peerIds;\n });\n }\n\n public toggleBlock(peerId: PeerId, block: boolean) {\n return this.apiManager.invokeApiSingle(block ? 'contacts.block' : 'contacts.unblock', {\n id: this.appPeersManager.getInputPeerById(peerId)\n }).then((value) => {\n if(value) {\n this.apiUpdatesManager.processLocalUpdate({\n _: 'updatePeerBlocked',\n peer_id: this.appPeersManager.getOutputPeer(peerId),\n blocked: block\n });\n }\n\n return value;\n });\n }\n\n public testSelfSearch(query: string) {\n const user = this.getSelf();\n const index = this.createSearchIndex();\n index.indexObject(user.id, this.getUserSearchText(user.id));\n return index.search(query).has(user.id);\n }\n\n public createSearchIndex() {\n return new SearchIndex({\n clearBadChars: true,\n ignoreCase: true,\n latinize: true,\n includeTag: true\n });\n }\n\n public saveApiUsers(apiUsers: MTUser[], override?: boolean) {\n if((apiUsers as any).saved) return;\n (apiUsers as any).saved = true;\n apiUsers.forEach((user) => this.saveApiUser(user, override));\n }\n\n public modifyUsernamesCache(peer: Parameters[0], save: boolean) {\n const usernames = getPeerActiveUsernames(peer);\n if(!usernames.length) {\n return;\n }\n\n const cleanedUsernames = usernames.map((username) => cleanUsername(username));\n if(save) {\n cleanedUsernames.forEach((searchUsername) => {\n this.usernames[searchUsername] = peer.id.toPeerId(peer._ !== 'user');\n });\n } else {\n cleanedUsernames.forEach((searchUsername) => {\n delete this.usernames[searchUsername];\n });\n }\n }\n\n public setUsernameToCache(peer: Parameters[0], oldPeer?: typeof peer) {\n if(\n !oldPeer ||\n (oldPeer as MTUser.user).username !== (peer as MTUser.user).username ||\n !deepEqual((oldPeer as MTUser.user).usernames, (peer as MTUser.user).usernames)\n ) {\n this.modifyUsernamesCache(oldPeer, false);\n this.modifyUsernamesCache(peer, true);\n\n return true;\n }\n\n return false;\n }\n\n public saveApiUser(user: MTUser, override?: boolean) {\n if(!user || user._ === 'userEmpty') return;\n\n const userId = user.id;\n const oldUser = this.users[userId];\n\n // ! commented block can affect performance !\n // if(oldUser && !override) {\n // console.log('saveApiUser same');\n // return;\n // }\n\n user.pFlags ??= {};\n\n if(user.pFlags.min && oldUser !== undefined) {\n return;\n }\n\n // * exclude from state\n // defineNotNumerableProperties(user, ['initials', 'num', 'rFirstName', 'rFullName', 'rPhone', 'sortName', 'sortStatus']);\n\n const changedUsername = this.setUsernameToCache(user, oldUser);\n\n if(!oldUser ||\n oldUser.sortName === undefined ||\n oldUser.first_name !== user.first_name ||\n oldUser.last_name !== user.last_name) {\n const fullName = user.first_name + (user.last_name ? ' ' + user.last_name : '');\n\n user.sortName = user.pFlags.deleted ? '' : cleanSearchText(fullName, false);\n } else {\n user.sortName = oldUser.sortName;\n }\n\n if(user.status) {\n if((user.status as UserStatus.userStatusOnline).expires) {\n (user.status as UserStatus.userStatusOnline).expires -= this.timeManager.getServerTimeOffset();\n }\n\n if((user.status as UserStatus.userStatusOffline).was_online) {\n (user.status as UserStatus.userStatusOffline).was_online -= this.timeManager.getServerTimeOffset();\n }\n }\n\n if((user as User).photo?._ === 'userProfilePhotoEmpty') {\n delete (user as User).photo;\n }\n\n // user.sortStatus = user.pFlags.bot ? -1 : this.getUserStatusForSort(user.status);\n\n // if(!user.username && user.usernames) {\n // user.username = user.usernames.find((username) => username.pFlags.active).username;\n // }\n\n if(oldUser === undefined) {\n this.users[userId] = user;\n } else {\n const changedTitle = user.first_name !== oldUser.first_name ||\n user.last_name !== oldUser.last_name ||\n changedUsername;\n\n const oldPhotoId = (oldUser.photo as UserProfilePhoto.userProfilePhoto)?.photo_id;\n const newPhotoId = (user.photo as UserProfilePhoto.userProfilePhoto)?.photo_id;\n const changedPhoto = oldPhotoId !== newPhotoId;\n\n const changedAnyBadge = oldUser.pFlags.premium !== user.pFlags.premium ||\n oldUser.pFlags.verified !== user.pFlags.verified ||\n oldUser.pFlags.scam !== user.pFlags.scam ||\n oldUser.pFlags.fake !== user.pFlags.fake;\n\n /* if(user.pFlags.bot && user.bot_info_version !== oldUser.bot_info_version) {\n\n } */\n\n const wasContact = !!oldUser.pFlags.contact;\n const newContact = !!user.pFlags.contact;\n\n safeReplaceObject(oldUser, user);\n this.rootScope.dispatchEvent('user_update', userId);\n\n if(wasContact !== newContact) {\n this.onContactUpdated(userId, newContact, wasContact);\n }\n\n if(changedPhoto) {\n this.rootScope.dispatchEvent('avatar_update', {peerId: user.id.toPeerId()});\n }\n\n if(changedTitle || changedAnyBadge) {\n this.rootScope.dispatchEvent('peer_title_edit', {peerId: user.id.toPeerId()});\n }\n }\n\n this.checkPremium(user, oldUser);\n this.setUserToStateIfNeeded(user);\n }\n\n private checkPremium(user: User, oldUser: User) {\n if(user.pFlags.self) {\n const isPremium = !!user.pFlags.premium;\n if(this.rootScope.premium !== isPremium) {\n this.rootScope.dispatchEvent('premium_toggle_private', {isNew: !oldUser, isPremium});\n }\n }\n }\n\n private setUserToStateIfNeeded(user: User) {\n if(this.peersStorage.isPeerNeeded(user.id.toPeerId())) {\n this.storage.set({\n [user.id]: user\n });\n }\n }\n\n public isUserOnlineVisible(id: UserId) {\n return this.getUserStatusForSort(id) > 3;\n }\n\n public getUserStatusForSort(status: User['status'] | UserId) {\n if(typeof(status) !== 'object') {\n const user = this.getUser(status);\n status = user?.status;\n }\n\n if(status) {\n const expires = status._ === 'userStatusOnline' ? status.expires : (status._ === 'userStatusOffline' ? status.was_online : 0);\n if(expires) {\n return expires;\n }\n\n /* const timeNow = tsNow(true);\n switch(status._) {\n case 'userStatusRecently':\n return timeNow - 86400 * 3;\n case 'userStatusLastWeek':\n return timeNow - 86400 * 7;\n case 'userStatusLastMonth':\n return timeNow - 86400 * 30;\n } */\n switch(status._) {\n case 'userStatusRecently':\n return 3;\n case 'userStatusLastWeek':\n return 2;\n case 'userStatusLastMonth':\n return 1;\n }\n }\n\n return 0;\n }\n\n public getUser(id: User | UserId) {\n if(isObject(id)) {\n return id;\n }\n\n return this.users[id];\n }\n\n public getUserStatus(id: UserId) {\n return this.isRegularUser(id) && !this.users[id].pFlags.self && this.users[id].status;\n }\n\n public async getUserPhone(id: UserId) {\n const user = this.getUser(id);\n if(!user?.phone) {\n return;\n }\n\n const appConfig = await this.apiManager.getAppConfig();\n return {\n phone: user.phone,\n isAnonymous: appConfig.fragment_prefixes.some((prefix) => user.phone.startsWith(prefix))\n };\n }\n\n public getSelf() {\n return this.getUser(this.userId);\n }\n\n public isBot(id: UserId) {\n return this.users[id] && !!this.users[id].pFlags.bot;\n }\n\n public isAttachMenuBot(id: UserId) {\n return this.isBot(id) && !!this.users[id].pFlags.bot_attach_menu;\n }\n\n public isContact(id: UserId) {\n return this.contactsList.has(id) || !!(this.users[id] && this.users[id].pFlags.contact);\n }\n\n public isRegularUser(id: UserId) {\n const user = this.users[id];\n return user && !this.isBot(id) && !user.pFlags.deleted && !user.pFlags.support;\n }\n\n public isNonContactUser(id: UserId) {\n return this.isRegularUser(id) && !this.isContact(id) && id !== this.userId;\n }\n\n public hasUser(id: UserId, allowMin?: boolean) {\n const user = this.users[id];\n return isObject(user) && (allowMin || !user.pFlags.min);\n }\n\n public getUserString(id: UserId) {\n const user = this.getUser(id);\n return 'u' + id + (user.access_hash ? '_' + user.access_hash : '');\n }\n\n public getUserInput(id: UserId): InputUser {\n const user = this.getUser(id);\n if(user.pFlags && user.pFlags.self) {\n return {_: 'inputUserSelf'};\n }\n\n return {\n _: 'inputUser',\n user_id: id,\n access_hash: user.access_hash\n };\n }\n\n public getUserInputPeer(id: UserId): InputPeer.inputPeerSelf | InputPeer.inputPeerUser {\n const user = this.getUser(id);\n // ! do not use it, there are places that don't support it. need explicit peer id\n // if(user.pFlags?.self) {\n // return {_: 'inputPeerSelf'};\n // }\n\n return {\n _: 'inputPeerUser',\n user_id: id,\n access_hash: user.access_hash\n };\n }\n\n public getContactMediaInput(id: UserId): InputMedia.inputMediaContact {\n const user = this.getUser(id);\n\n return {\n _: 'inputMediaContact',\n first_name: user.first_name,\n last_name: user.last_name,\n phone_number: user.phone,\n vcard: '',\n user_id: id\n };\n }\n\n private updateUsersStatuses = () => {\n const timestampNow = tsNow(true);\n for(const i in this.users) {\n const user = this.users[i];\n this.updateUserStatus(user, timestampNow);\n }\n };\n\n private updateUserStatus(user: MTUser.user, timestampNow = tsNow(true)) {\n if(user.status &&\n user.status._ === 'userStatusOnline' &&\n user.status.expires < timestampNow) {\n user.status = {_: 'userStatusOffline', was_online: user.status.expires};\n this.rootScope.dispatchEvent('user_update', user.id);\n\n this.setUserToStateIfNeeded(user);\n }\n }\n\n public forceUserOnline(id: UserId, eventTimestamp?: number) {\n if(this.isBot(id)) {\n return;\n }\n\n const timestamp = tsNow(true);\n const onlineTimeFor = 60;\n if(eventTimestamp) {\n if((timestamp - eventTimestamp) >= onlineTimeFor) {\n return;\n }\n } else if(this.apiUpdatesManager.updatesState.syncLoading) {\n return;\n }\n\n const user = this.getUser(id);\n if(user?.status &&\n user.status._ !== 'userStatusOnline' &&\n user.status._ !== 'userStatusEmpty' &&\n !user.pFlags.support &&\n !user.pFlags.deleted) {\n user.status = {\n _: 'userStatusOnline',\n expires: timestamp + onlineTimeFor\n };\n\n // user.sortStatus = this.getUserStatusForSort(user.status);\n this.rootScope.dispatchEvent('user_update', id);\n\n this.setUserToStateIfNeeded(user);\n }\n }\n\n public importContact(first_name: string, last_name: string, phone: string) {\n return this.importContacts([{\n first_name,\n last_name,\n phones: [phone]\n }]).then((userIds) => {\n if(!userIds.length) {\n const error = new Error();\n (error as any).type = 'NO_USER';\n throw error;\n }\n\n return userIds[0];\n });\n }\n\n public importContacts(contacts: {phones: string[], first_name: string, last_name: string}[]) {\n const inputContacts: InputContact[] = [];\n\n for(let i = 0; i < contacts.length; ++i) {\n for(let j = 0; j < contacts[i].phones.length; ++j) {\n inputContacts.push({\n _: 'inputPhoneContact',\n client_id: (i << 16 | j).toString(10),\n phone: contacts[i].phones[j],\n first_name: contacts[i].first_name,\n last_name: contacts[i].last_name\n });\n }\n }\n\n return this.apiManager.invokeApi('contacts.importContacts', {\n contacts: inputContacts\n }).then((importedContactsResult) => {\n this.saveApiUsers(importedContactsResult.users);\n\n const userIds = importedContactsResult.imported.map((importedContact) => {\n this.onContactUpdated(importedContact.user_id, true);\n return importedContact.user_id;\n });\n\n return userIds;\n });\n }\n\n public getTopPeers(type: TopPeerType) {\n if(this.getTopPeersPromises[type]) return this.getTopPeersPromises[type];\n\n return this.getTopPeersPromises[type] = this.appStateManager.getState().then((state) => {\n const cached = state.topPeersCache[type];\n if(cached && (cached.cachedTime + 86400e3) > Date.now() && cached.peers) {\n return cached.peers;\n }\n\n return this.apiManager.invokeApi('contacts.getTopPeers', {\n [type]: true,\n offset: 0,\n limit: 15,\n hash: '0'\n }).then((result) => {\n let topPeers: MyTopPeer[] = [];\n if(result._ === 'contacts.topPeers') {\n // console.log(result);\n this.saveApiUsers(result.users);\n this.appChatsManager.saveApiChats(result.chats);\n\n if(result.categories.length) {\n topPeers = result.categories[0].peers.map((topPeer) => {\n const peerId = getPeerId(topPeer.peer);\n this.peersStorage.requestPeer(peerId, 'topPeer');\n return {id: peerId, rating: topPeer.rating};\n });\n }\n }\n\n state.topPeersCache[type] = {\n peers: topPeers,\n cachedTime: Date.now()\n };\n this.appStateManager.pushToState('topPeersCache', state.topPeersCache);\n\n return topPeers;\n });\n });\n }\n\n public getBlocked(offset = 0, limit = 0) {\n return this.apiManager.invokeApiSingle('contacts.getBlocked', {offset, limit}).then((contactsBlocked) => {\n this.saveApiUsers(contactsBlocked.users);\n this.appChatsManager.saveApiChats(contactsBlocked.chats);\n const count = contactsBlocked._ === 'contacts.blocked' ? contactsBlocked.users.length + contactsBlocked.chats.length : contactsBlocked.count;\n\n const peerIds: PeerId[] = contactsBlocked.users.map((u) => u.id.toPeerId()).concat(contactsBlocked.chats.map((c) => c.id.toPeerId(true)));\n\n return {count, peerIds};\n });\n }\n\n public getLocated(\n lat: number,\n long: number,\n accuracy_radius: number,\n background: boolean = false,\n self_expires: number = 0\n ) {\n const geo_point: InputGeoPoint = {\n _: 'inputGeoPoint',\n lat,\n long,\n accuracy_radius\n };\n\n return this.apiManager.invokeApi('contacts.getLocated', {\n geo_point,\n background\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates);\n return updates;\n });\n }\n\n /* public searchContacts(query: string, limit = 20) {\n return Promise.all([\n this.getContacts(query),\n apiManager.invokeApi('contacts.search', {\n q: query,\n limit\n })\n ]).then((results) => {\n const [myContacts, peers] = results;\n\n this.saveApiUsers(peers.users);\n appChatsManager.saveApiChats(peers.chats);\n\n // * contacts.search returns duplicates in my_results\n const myResults = new Set(myContacts.concat(peers.my_results.map((p) => appPeersManager.getPeerID(p))));\n\n const out = {\n my_results: [...myResults].slice(0, limit),\n results: peers.results.map((p) => appPeersManager.getPeerID(p))\n };\n\n return out;\n });\n } */\n public searchContacts(query: string, limit = 20) {\n // handle 't.me/username' as 'username'\n const entities = parseEntities(query);\n if(entities.length && entities[0].length === query.trim().length && entities[0]._ === 'messageEntityUrl') {\n try {\n const url = new URL(wrapUrl(query).url);\n const path = url.pathname.slice(1);\n if(path) {\n query = path;\n }\n } catch(err) {}\n }\n\n return this.apiManager.invokeApiCacheable('contacts.search', {\n q: query,\n limit\n }, {cacheSeconds: 60}).then((peers) => {\n this.saveApiUsers(peers.users);\n this.appChatsManager.saveApiChats(peers.chats);\n\n const out = {\n my_results: filterUnique(peers.my_results.map((p) => getPeerId(p))), // ! contacts.search returns duplicates in my_results\n results: peers.results.map((p) => getPeerId(p))\n };\n\n return out;\n });\n }\n\n private onContactUpdated(userId: UserId, isContact: boolean, curIsContact = this.isContact(userId)) {\n if(isContact !== curIsContact) {\n if(isContact) {\n this.pushContact(userId);\n } else {\n this.popContact(userId);\n }\n\n this.onContactsModified();\n\n this.rootScope.dispatchEvent('contacts_update', userId);\n }\n }\n\n public updateUsername(username: string) {\n return this.apiManager.invokeApi('account.updateUsername', {\n username\n }).then((user) => {\n this.saveApiUser(user);\n });\n }\n\n public setUserStatus(userId: UserId, offline: boolean) {\n if(this.isBot(userId)) {\n return;\n }\n\n const user = this.users[userId];\n if(user) {\n const status: UserStatus = offline ? {\n _: 'userStatusOffline',\n was_online: tsNow(true)\n } : {\n _: 'userStatusOnline',\n expires: tsNow(true) + 50\n };\n\n user.status = status;\n // user.sortStatus = this.getUserStatusForSort(user.status);\n this.rootScope.dispatchEvent('user_update', userId);\n\n this.setUserToStateIfNeeded(user);\n }\n }\n\n public updateMyOnlineStatus(offline: boolean) {\n this.setUserStatus(this.getSelf().id, offline);\n return this.apiManager.invokeApiSingle('account.updateStatus', {offline});\n }\n\n public addContact(userId: UserId, first_name: string, last_name: string, phone: string, addPhonePrivacyException?: boolean) {\n /* if(!userId) {\n return this.importContacts([{\n first_name,\n last_name,\n phones: [phone]\n }]);\n } */\n\n return this.apiManager.invokeApi('contacts.addContact', {\n id: this.getUserInput(userId),\n first_name,\n last_name,\n phone,\n add_phone_privacy_exception: addPhonePrivacyException\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates, {override: true});\n\n this.onContactUpdated(userId, true);\n });\n }\n\n public deleteContacts(userIds: UserId[]) {\n return this.apiManager.invokeApi('contacts.deleteContacts', {\n id: userIds.map((userId) => this.getUserInput(userId))\n }).then((updates) => {\n this.apiUpdatesManager.processUpdateMessage(updates, {override: true});\n\n userIds.forEach((userId) => {\n this.onContactUpdated(userId, false);\n });\n });\n }\n\n public checkUsername(username: string) {\n return this.apiManager.invokeApi('account.checkUsername', {username});\n }\n\n public toggleUsername(username: string, active: boolean) {\n return this.apiManager.invokeApi('account.toggleUsername', {username, active});\n }\n\n public reorderUsernames(usernames: string[]) {\n return this.apiManager.invokeApi('account.reorderUsernames', {order: usernames});\n }\n\n public canSendToUser(userId: UserId) {\n return canSendToUser(this.getUser(userId));\n }\n\n public getCommonChats(userId: UserId, limit = 100, maxId?: ChatId) {\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.getCommonChats',\n params: {\n user_id: this.getUserInput(userId),\n limit,\n max_id: maxId ?? 0\n },\n processResult: (messagesChats) => {\n this.appChatsManager.saveApiChats(messagesChats.chats);\n return messagesChats;\n }\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nexport default function cleanUsername(username: string) {\n return username && username.toLowerCase() || '';\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {ReferenceContext} from '../mtproto/referenceDatabase';\nimport {WebPage} from '../../layer';\nimport safeReplaceObject from '../../helpers/object/safeReplaceObject';\nimport {AppManager} from './manager';\n\nconst photoTypeSet = new Set(['photo', 'video', 'gif', 'document']);\n\ntype WebPageMessageKey = `${PeerId}_${number}`;\n\nexport class AppWebPagesManager extends AppManager {\n private webpages: {\n [webPageId: string]: WebPage\n } = {};\n private pendingWebPages: {\n [webPageId: string]: Set\n } = {};\n\n protected after() {\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateWebPage: (update) => {\n this.saveWebPage(update.webpage);\n }\n });\n }\n\n public saveWebPage(apiWebPage: WebPage, messageKey?: WebPageMessageKey, mediaContext?: ReferenceContext) {\n if(apiWebPage._ === 'webPageNotModified' || apiWebPage._ === 'webPageEmpty') return;\n const {id} = apiWebPage;\n\n const oldWebPage = this.webpages[id];\n const isUpdated = oldWebPage &&\n oldWebPage._ === apiWebPage._ &&\n (oldWebPage as WebPage.webPage).hash === (oldWebPage as WebPage.webPage).hash;\n\n if(apiWebPage._ === 'webPage') {\n if(apiWebPage.photo?._ === 'photo') {\n apiWebPage.photo = this.appPhotosManager.savePhoto(apiWebPage.photo, mediaContext);\n } else {\n delete apiWebPage.photo;\n }\n\n if(apiWebPage.document?._ === 'document') {\n apiWebPage.document = this.appDocsManager.saveDoc(apiWebPage.document, mediaContext);\n } else {\n if(apiWebPage.type === 'document') {\n delete apiWebPage.type;\n }\n\n delete apiWebPage.document;\n }\n\n const siteName = apiWebPage.site_name;\n const shortTitle = apiWebPage.title || apiWebPage.author || siteName || '';\n if(siteName && shortTitle === siteName) {\n delete apiWebPage.site_name;\n }\n\n // delete apiWebPage.description\n\n if(!photoTypeSet.has(apiWebPage.type) &&\n !apiWebPage.description &&\n apiWebPage.photo) {\n apiWebPage.type = 'photo';\n }\n }\n\n let pendingSet = this.pendingWebPages[id];\n if(messageKey) {\n if(!pendingSet) pendingSet = this.pendingWebPages[id] = new Set();\n pendingSet.add(messageKey);\n }\n\n if(oldWebPage === undefined) {\n this.webpages[id] = apiWebPage;\n } else {\n safeReplaceObject(oldWebPage, apiWebPage);\n }\n\n if(!messageKey && pendingSet !== undefined && isUpdated) {\n const msgs: {peerId: PeerId, mid: number, isScheduled: boolean}[] = [];\n pendingSet.forEach((value) => {\n const [peerId, mid, isScheduled] = value.split('_');\n msgs.push({\n peerId: peerId.toPeerId(),\n mid: +mid,\n isScheduled: !!isScheduled\n });\n });\n\n this.rootScope.dispatchEvent('webpage_updated', {\n id,\n msgs\n });\n }\n\n return apiWebPage;\n }\n\n public getMessageKeyForPendingWebPage(peerId: PeerId, mid: number, isScheduled?: boolean): WebPageMessageKey {\n return peerId + '_' + mid + (isScheduled ? '_s' : '') as any;\n }\n\n public deleteWebPageFromPending(webPage: WebPage, messageKey: WebPageMessageKey) {\n const id = (webPage as WebPage.webPage).id;\n if(!id) return;\n\n const set = this.pendingWebPages[id];\n if(set && set.has(messageKey)) {\n set.delete(messageKey);\n\n if(!set.size) {\n delete this.pendingWebPages[id];\n }\n }\n }\n\n public getCachedWebPage(id: WebPage.webPage['id']) {\n return this.webpages[id];\n }\n\n public getWebPage(url: string) {\n return this.apiManager.invokeApiHashable({\n method: 'messages.getWebPage',\n processResult: (webPage) => {\n return this.saveWebPage(webPage);\n },\n params: {\n url\n }\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport readBlobAs from './readBlobAs';\n\nexport default function readBlobAsArrayBuffer(blob: Blob) {\n return readBlobAs(blob, 'readAsArrayBuffer');\n}\n","export default function fileNameRFC(fileName: string) {\n // Make filename RFC5987 compatible\n return encodeURIComponent(fileName).replace(/['()]/g, escape).replace(/\\*/g, '%2A');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {getServiceMessagePort} from '../mtproto/mtproto.worker';\nimport ServiceMessagePort from '../serviceWorker/serviceMessagePort';\nimport StreamWriter from './streamWriter';\n\nexport default class DownloadWriter implements StreamWriter {\n constructor(\n private serviceMessagePort: ServiceMessagePort,\n private downloadId: string\n ) {\n this.serviceMessagePort = getServiceMessagePort();\n }\n\n public async write(part: Uint8Array, offset?: number) {\n return this.serviceMessagePort.invoke('downloadChunk', {\n id: this.downloadId,\n chunk: part\n });\n }\n\n public finalize(saveToStorage?: boolean): Promise {\n return this.serviceMessagePort.invoke('downloadFinalize', this.downloadId).then(() => undefined);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport deferredPromise from '../../helpers/cancellablePromise';\nimport makeError from '../../helpers/makeError';\nimport fileNameRFC from '../../helpers/string/fileNameRFC';\nimport {getServiceMessagePort} from '../mtproto/mtproto.worker';\nimport DownloadWriter from './downloadWriter';\nimport FileStorage from './fileStorage';\n\nexport default class DownloadStorage implements FileStorage {\n public getFile(fileName: string): Promise {\n return Promise.reject(makeError('NO_ENTRY_FOUND'));\n }\n\n public prepareWriting({fileName, downloadId, size}: {\n fileName: string,\n downloadId: string,\n size: number\n }) {\n const headers = {\n 'Content-Type': 'application/octet-stream; charset=utf-8',\n 'Content-Disposition': 'attachment; filename*=UTF-8\\'\\'' + fileNameRFC(fileName),\n ...(size ? {'Content-Length': size} : {})\n };\n\n const serviceMessagePort = getServiceMessagePort();\n const promise = serviceMessagePort.invoke('download', {\n headers,\n id: downloadId\n });\n\n const deferred = deferredPromise();\n deferred.cancel = () => {\n deferred.reject(makeError('DOWNLOAD_CANCELED'));\n };\n\n deferred.catch(() => {\n getServiceMessagePort().invoke('downloadCancel', downloadId);\n });\n\n promise.then(deferred.resolve, deferred.reject);\n\n return {\n deferred,\n getWriter: () => {\n return new DownloadWriter(serviceMessagePort, downloadId);\n }\n };\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {ReferenceBytes} from './referenceDatabase';\nimport Modes from '../../config/modes';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport {randomLong} from '../../helpers/random';\nimport {Document, InputFile, InputFileLocation, InputWebFileLocation, Photo, PhotoSize, UploadFile, UploadWebFile, VideoSize, WebDocument} from '../../layer';\nimport {DcId} from '../../types';\nimport CacheStorageController from '../files/cacheStorage';\nimport {logger, LogTypes} from '../logger';\nimport assumeType from '../../helpers/assumeType';\nimport noop from '../../helpers/noop';\nimport readBlobAsArrayBuffer from '../../helpers/blob/readBlobAsArrayBuffer';\nimport bytesToHex from '../../helpers/bytes/bytesToHex';\nimport findAndSplice from '../../helpers/array/findAndSplice';\nimport fixFirefoxSvg from '../../helpers/fixFirefoxSvg';\nimport {AppManager} from '../appManagers/manager';\nimport {getEnvironment} from '../../environment/utils';\nimport MTProtoMessagePort from './mtprotoMessagePort';\nimport getFileNameForUpload from '../../helpers/getFileNameForUpload';\nimport type {Progress} from '../appManagers/appDownloadManager';\nimport getDownloadMediaDetails from '../appManagers/utils/download/getDownloadMediaDetails';\n// import networkStats from './networkStats';\nimport getDownloadFileNameFromOptions from '../appManagers/utils/download/getDownloadFileNameFromOptions';\nimport StreamWriter from '../files/streamWriter';\nimport FileStorage from '../files/fileStorage';\nimport {MAX_FILE_SAVE_SIZE} from './mtproto_config';\nimport throttle from '../../helpers/schedulers/throttle';\nimport makeError from '../../helpers/makeError';\nimport readBlobAsUint8Array from '../../helpers/blob/readBlobAsUint8Array';\nimport DownloadStorage from '../files/downloadStorage';\nimport copy from '../../helpers/object/copy';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport {EXTENSION_MIME_TYPE_MAP, MIME_TYPE_EXTENSION_MAP} from '../../environment/mimeTypeMap';\nimport {getServiceMessagePort} from './mtproto.worker';\n\ntype Delayed = {\n offset: number,\n writePromise: CancellablePromise,\n writeDeferred: CancellablePromise\n};\n\nexport type DownloadOptions = {\n dcId: DcId,\n location: InputFileLocation | InputWebFileLocation,\n size?: number,\n fileName?: string,\n mimeType?: MTMimeType,\n limitPart?: number,\n queueId?: number,\n onlyCache?: boolean,\n downloadId?: string\n // getFileMethod: Parameters[1]\n};\n\nexport type DownloadMediaOptions = {\n media: Photo.photo | Document.document | WebDocument,\n thumb?: PhotoSize | Extract,\n queueId?: number,\n onlyCache?: boolean,\n downloadId?: string\n};\n\ntype DownloadPromise = CancellablePromise;\n\nexport type MyUploadFile = UploadFile.uploadFile | UploadWebFile.uploadWebFile;\n\n// export interface RefreshReferenceTask extends WorkerTaskVoidTemplate {\n// type: 'refreshReference',\n// payload: ReferenceBytes,\n// };\n\n// export interface RefreshReferenceTaskResponse extends WorkerTaskVoidTemplate {\n// type: 'refreshReference',\n// payload: ReferenceBytes,\n// originalPayload: ReferenceBytes\n// };\n\nconst MAX_DOWNLOAD_FILE_PART_SIZE = 1 * 1024 * 1024;\nconst MAX_UPLOAD_FILE_PART_SIZE = 512 * 1024;\nconst MIN_PART_SIZE = 128 * 1024;\nconst AVG_PART_SIZE = 512 * 1024;\n\nconst REGULAR_DOWNLOAD_DELTA = (9 * 512 * 1024) / MIN_PART_SIZE;\n// const PREMIUM_DOWNLOAD_DELTA = REGULAR_DOWNLOAD_DELTA * 2;\nconst PREMIUM_DOWNLOAD_DELTA = (56 * 512 * 1024) / MIN_PART_SIZE;\n\nconst IGNORE_ERRORS: Set = new Set([\n 'DOWNLOAD_CANCELED',\n 'UPLOAD_CANCELED',\n 'UNKNOWN',\n 'NO_NEW_CONTEXT'\n]);\n\nexport class ApiFileManager extends AppManager {\n private cacheStorage = new CacheStorageController('cachedFiles');\n private downloadStorage = new DownloadStorage();\n\n private downloadPromises: {\n [fileName: string]: DownloadPromise\n } = {};\n\n // private downloadToDiscPromises: {\n // [fileName: string]: DownloadPromise\n // } = {};\n\n private uploadPromises: {\n [fileName: string]: CancellablePromise\n } = {};\n\n private downloadPulls: {\n [dcId: string]: Array<{\n id: number,\n queueId: number,\n cb: () => Promise,\n deferred: {\n resolve: (...args: any[]) => void,\n reject: (...args: any[]) => void\n },\n activeDelta: number\n }>\n } = {};\n private downloadActives: {[dcId: string]: number} = {};\n\n public refreshReferencePromises: {\n [referenceHex: string]: {\n deferred: CancellablePromise,\n timeout?: number\n }\n } = {};\n\n private log: ReturnType = logger('AFM', LogTypes.Error | LogTypes.Log);\n private tempId = 0;\n private queueId = 0;\n private debug = Modes.debug;\n\n private maxUploadParts = 4000;\n private maxDownloadParts = 8000;\n private webFileDcId: DcId;\n\n protected after() {\n setInterval(() => { // clear old promises\n for(const hex in this.refreshReferencePromises) {\n const {deferred} = this.refreshReferencePromises[hex];\n if(deferred.isFulfilled || deferred.isRejected) {\n delete this.refreshReferencePromises[hex];\n }\n }\n }, 1800e3);\n\n this.rootScope.addEventListener('config', (config) => {\n this.webFileDcId = config.webfile_dc_id;\n });\n\n this.rootScope.addEventListener('app_config', (appConfig) => {\n this.maxUploadParts = this.rootScope.premium ? appConfig.upload_max_fileparts_premium : appConfig.upload_max_fileparts_default;\n this.maxDownloadParts = appConfig.upload_max_fileparts_premium;\n });\n }\n\n private downloadRequest(dcId: 'upload', id: number, cb: () => Promise, activeDelta: number, queueId?: number): Promise;\n private downloadRequest(dcId: number, id: number, cb: () => Promise, activeDelta: number, queueId?: number): Promise;\n private downloadRequest(dcId: number | string, id: number, cb: () => Promise, activeDelta: number, queueId: number = 0) {\n if(this.downloadPulls[dcId] === undefined) {\n this.downloadPulls[dcId] = [];\n this.downloadActives[dcId] = 0;\n }\n\n const downloadPull = this.downloadPulls[dcId];\n\n const promise = new Promise((resolve, reject) => {\n downloadPull.push({id, queueId, cb, deferred: {resolve, reject}, activeDelta});\n });\n\n setTimeout(() => {\n this.downloadCheck(dcId);\n }, 0);\n\n return promise;\n }\n\n private downloadCheck(dcId: string | number) {\n const downloadPull = this.downloadPulls[dcId];\n const downloadLimit = /* dcId === 'upload' ? 24 : */(this.rootScope.premium ? PREMIUM_DOWNLOAD_DELTA : REGULAR_DOWNLOAD_DELTA);\n // const downloadLimit = Infinity;\n\n if(this.downloadActives[dcId] >= downloadLimit || !downloadPull?.length) {\n return false;\n }\n\n // const data = downloadPull.shift();\n const data = findAndSplice(downloadPull, (d) => d.queueId === 0) || findAndSplice(downloadPull, (d) => d.queueId === this.queueId) || downloadPull.shift();\n const activeDelta = data.activeDelta || 1;\n\n this.downloadActives[dcId] += activeDelta;\n\n const promise = data.cb();\n // const networkPromise = networkStats.waitForChunk(dcId as DcId, activeDelta * MIN_PART_SIZE);\n /* Promise.race([\n promise\n // networkPromise\n ]) */promise.then(() => {\n this.downloadActives[dcId] -= activeDelta;\n this.downloadCheck(dcId);\n\n // networkPromise.resolve();\n }, (error: ApiError) => {\n if(!error?.type || !IGNORE_ERRORS.has(error.type)) {\n this.log.error('downloadCheck error:', error);\n }\n\n this.downloadActives[dcId] -= activeDelta;\n this.downloadCheck(dcId);\n\n // networkPromise.reject(error);\n }).finally(() => {\n promise.then(data.deferred.resolve, data.deferred.reject);\n });\n }\n\n public setQueueId(queueId: number) {\n // this.log.error('setQueueId', queueId);\n this.queueId = queueId;\n }\n\n private getFileStorage() {\n return this.cacheStorage;\n }\n\n public cancelDownload(fileName: string) {\n const promises = [this.downloadPromises[fileName], this.uploadPromises[fileName]].filter(Boolean);\n let canceled = false;\n for(let i = 0, length = promises.length; i < length; ++i) {\n const promise = promises[i];\n if(promise && !promise.isRejected && !promise.isFulfilled) {\n promise.cancel();\n canceled = true;\n }\n }\n\n return canceled;\n }\n\n public requestWebFilePart(\n dcId: DcId,\n location: InputWebFileLocation,\n offset: number,\n limit: number,\n id = 0,\n queueId = 0,\n checkCancel?: () => void\n ) {\n return this.downloadRequest(dcId, id, async() => { // do not remove async, because checkCancel will throw an error\n checkCancel?.();\n\n if('url' in location) {\n const url = location.url;\n if(this.isLocalWebFile(url)) {\n return fetch(url)\n .then((response) => response.arrayBuffer())\n .then((arrayBuffer) => {\n const extension = url.split('.').pop() as MTFileExtension;\n const mimeType = EXTENSION_MIME_TYPE_MAP[extension] || 'application/octet-stream';\n return {\n _: 'upload.webFile',\n size: arrayBuffer.byteLength,\n mime_type: mimeType,\n file_type: {_: 'storage.fileUnknown'},\n mtime: 0,\n bytes: new Uint8Array(arrayBuffer)\n };\n });\n }\n }\n\n return this.apiManager.invokeApi('upload.getWebFile', {\n location,\n offset,\n limit\n }, {\n dcId,\n fileDownload: true\n });\n }, this.getDelta(limit), queueId);\n }\n\n public requestFilePart(\n dcId: DcId,\n location: InputFileLocation,\n offset: number,\n limit: number,\n id = 0,\n queueId = 0,\n checkCancel?: () => void\n ) {\n return this.downloadRequest(dcId, id, async() => { // do not remove async, because checkCancel will throw an error\n checkCancel?.();\n\n const invoke = async(): Promise => {\n checkCancel?.(); // do not remove async, because checkCancel will throw an error\n\n // * IMPORTANT: reference can be changed in previous request\n const reference = (location as InputFileLocation.inputDocumentFileLocation).file_reference?.slice();\n\n const promise = // pause(offset > (100 * 1024 * 1024) ? 10000000 : 0).then(() =>\n this.apiManager.invokeApi('upload.getFile', {\n location,\n offset,\n limit\n }, {\n dcId,\n fileDownload: true\n }) as Promise/* ) */;\n\n return promise.catch((err: ApiError) => {\n checkCancel?.();\n\n if(err.type === 'FILE_REFERENCE_EXPIRED') {\n return this.refreshReference(location as InputFileLocation.inputDocumentFileLocation, reference).then(invoke);\n }\n\n throw err;\n });\n };\n\n assumeType(location);\n const reference = location.file_reference;\n if(reference && !location.checkedReference) { // check stream's location because it's new every call\n location.checkedReference = true;\n const hex = bytesToHex(reference);\n if(this.refreshReferencePromises[hex]) {\n return this.refreshReference(location, reference).then(invoke);\n }\n }\n\n return invoke();\n }, this.getDelta(limit), queueId);\n }\n\n /* private convertBlobToBytes(blob: Blob) {\n return blob.arrayBuffer().then((buffer) => new Uint8Array(buffer));\n } */\n\n private getDelta(bytes: number) {\n return bytes / MIN_PART_SIZE;\n }\n\n private getLimitPart(size: number, isUpload: boolean): number {\n if(!size) { // * sometimes size can be 0 (e.g. avatars, webDocuments)\n return AVG_PART_SIZE;\n }\n\n // return 1 * 1024 * 1024;\n\n let bytes = MIN_PART_SIZE;\n\n const maxParts = isUpload ? this.maxUploadParts : this.maxDownloadParts;\n const maxPartSize = isUpload ? MAX_UPLOAD_FILE_PART_SIZE : MAX_DOWNLOAD_FILE_PART_SIZE;\n // usually it will stick to 512Kb size if the file is too big\n while((size / bytes) > maxParts && bytes < maxPartSize) {\n bytes *= 2;\n }\n /* if(size < 1e6 || !size) bytes = 512;\n else if(size < 3e6) bytes = 256;\n else bytes = 128; */\n\n return bytes;\n }\n\n private uncompressTGS = (bytes: Uint8Array, fileName: string) => {\n // this.log('uncompressTGS', bytes, bytes.slice().buffer);\n // slice нужен потому что в uint8array - 5053 length, в arraybuffer - 5084\n return this.cryptoWorker.invokeCrypto('gzipUncompress', bytes.slice().buffer, false) as Promise;\n };\n\n private uncompressTGV = (bytes: Uint8Array, fileName: string) => {\n // this.log('uncompressTGS', bytes, bytes.slice().buffer);\n // slice нужен потому что в uint8array - 5053 length, в arraybuffer - 5084\n const buffer = bytes.slice().buffer;\n if(getEnvironment().IS_FIREFOX) {\n return this.cryptoWorker.invokeCrypto('gzipUncompress', buffer, true).then((text) => {\n return fixFirefoxSvg(text as string);\n }).then((text) => {\n const textEncoder = new TextEncoder();\n return textEncoder.encode(text);\n });\n }\n\n return this.cryptoWorker.invokeCrypto('gzipUncompress', buffer, false) as Promise;\n };\n\n private convertWebp = (bytes: Uint8Array, fileName: string) => {\n const instance = MTProtoMessagePort.getInstance();\n return instance.invoke('convertWebp', {fileName, bytes});\n };\n\n private convertOpus = (bytes: Uint8Array, fileName: string) => {\n const instance = MTProtoMessagePort.getInstance();\n return instance.invoke('convertOpus', {fileName, bytes});\n };\n\n private refreshReference(\n inputFileLocation: InputFileLocation.inputDocumentFileLocation,\n reference: typeof inputFileLocation['file_reference'],\n hex = bytesToHex(reference)\n ) {\n let r = this.refreshReferencePromises[hex];\n if(!r) {\n const deferred = deferredPromise();\n\n r = this.refreshReferencePromises[hex] = {\n deferred\n\n // ! I don't remember what it was for...\n // timeout: ctx.setTimeout(() => {\n // this.log.error('Didn\\'t refresh the reference:', inputFileLocation);\n // deferred.reject(makeError('REFERENCE_IS_NOT_REFRESHED'));\n // }, 60000)\n };\n\n // deferred.catch(noop).finally(() => {\n // clearTimeout(r.timeout);\n // });\n\n this.referenceDatabase.refreshReference(reference).then((reference) => {\n if(hex === bytesToHex(reference)) {\n deferred.reject(makeError('REFERENCE_IS_NOT_REFRESHED'));\n }\n\n deferred.resolve(reference);\n }, deferred.reject);\n }\n\n // have to replace file_reference in any way, because location can be different everytime if it's stream\n return r.deferred.then((reference) => {\n inputFileLocation.file_reference = reference;\n });\n }\n\n public isDownloading(fileName: string) {\n return !!this.downloadPromises[fileName];\n }\n\n public getDownload(fileName: string) {\n return this.downloadPromises[fileName];\n }\n\n public getUpload(fileName: string) {\n return this.uploadPromises[fileName];\n }\n\n private getConvertMethod(mimeType: MTMimeType) {\n let process: ApiFileManager['uncompressTGS'] | ApiFileManager['convertWebp'];\n if(mimeType === 'application/x-tgwallpattern') {\n process = this.uncompressTGV;\n mimeType = 'image/svg+xml';\n } else if(mimeType === 'image/webp' && !getEnvironment().IS_WEBP_SUPPORTED) {\n process = this.convertWebp;\n mimeType = 'image/png';\n } else if(mimeType === 'application/x-tgsticker') {\n process = this.uncompressTGS;\n mimeType = 'application/json';\n } else if(mimeType === 'audio/ogg' && !getEnvironment().IS_OPUS_SUPPORTED) {\n process = this.convertOpus;\n mimeType = 'audio/wav';\n }\n\n return {mimeType, process};\n }\n\n private allocateDeferredPromises(startOffset: number, size: number, limitPart: number) {\n const delayed: Delayed[] = [];\n let offset = startOffset;\n let writePromise: CancellablePromise = Promise.resolve(),\n writeDeferred: CancellablePromise;\n do {\n writeDeferred = deferredPromise();\n delayed.push({offset, writePromise, writeDeferred});\n writePromise = writeDeferred;\n offset += limitPart;\n } while(offset < size);\n\n return delayed;\n }\n\n private isLocalWebFile(url: string) {\n return url.startsWith('assets/');\n }\n\n public download(options: DownloadOptions): DownloadPromise {\n const size = options.size ?? 0;\n const {dcId, location} = options;\n let {downloadId} = options;\n if(downloadId && !getServiceMessagePort()) {\n this.log.error('download fallback to blob', options);\n downloadId = undefined;\n }\n\n const originalMimeType = options.mimeType;\n const convertMethod = this.getConvertMethod(originalMimeType);\n const {process} = convertMethod;\n options.mimeType = convertMethod.mimeType || 'image/jpeg';\n\n const fileName = getDownloadFileNameFromOptions(options);\n const cacheFileName = downloadId ? getDownloadFileNameFromOptions({...copy(options), downloadId: undefined}) : fileName;\n const cacheStorage: FileStorage = this.getFileStorage();\n const downloadStorage: FileStorage = downloadId ? this.downloadStorage : undefined;\n let deferred: DownloadPromise = downloadId ? undefined : this.downloadPromises[fileName];\n\n this.debug && this.log('downloadFile', fileName, options);\n\n if(deferred) {\n return deferred;\n }\n\n // if(deferred) {\n // if(size) {\n // return deferred.then(async(blob) => {\n // if(blob instanceof Blob && blob.size < size) {\n // this.debug && this.log('downloadFile need to deleteFile, wrong size:', blob.size, size);\n\n // try {\n // await this.delete(fileName);\n // } finally {\n // return this.download(options);\n // }\n // } else {\n // return blob;\n // }\n // });\n // } else {\n // return deferred;\n // }\n // }\n\n const errorHandler = (item: typeof cachePrepared, error: ApiError) => {\n if(item?.error) {\n return;\n }\n\n for(const p of prepared) {\n if(item && item !== p) {\n continue;\n }\n\n p.error = error;\n p.deferred.reject(error);\n }\n };\n\n const isWebFile = location._ === 'inputWebFileLocation';\n const isLocalWebFile = isWebFile && this.isLocalWebFile(location.url);\n const id = this.tempId++;\n const limitPart = isLocalWebFile ?\n size :\n options.limitPart || this.getLimitPart(size, false);\n\n let getFile: FileStorage['getFile'] = cacheStorage.getFile.bind(cacheStorage);\n\n let cachePrepared: ReturnType & {writer?: StreamWriter, error?: ApiError},\n downloadPrepared: typeof cachePrepared;\n const prepared: (typeof cachePrepared)[] = [];\n const possibleSize = size || limitPart;\n\n const getErrorsCount = () => prepared.reduce((acc, item) => acc + +!!item.error, 0);\n\n const attach = (item: typeof cachePrepared, fileName: string) => {\n const {deferred} = item;\n const _errorHandler = errorHandler.bind(null, item);\n\n deferred.cancel = () => deferred.reject(makeError('DOWNLOAD_CANCELED'));\n deferred.catch((error) => {\n _errorHandler(error);\n item.writer?.truncate?.();\n }).finally(() => {\n if(this.downloadPromises[fileName] === deferred) {\n delete this.downloadPromises[fileName];\n }\n\n delete item.writer;\n // indexOfAndSplice(prepared, item);\n });\n\n this.downloadPromises[fileName] = deferred;\n\n prepared.push(item);\n };\n\n if(cacheStorage && (!downloadStorage || possibleSize <= MAX_FILE_SAVE_SIZE)) {\n cachePrepared = cacheStorage.prepareWriting(cacheFileName, possibleSize, options.mimeType)\n attach(cachePrepared, cacheFileName);\n }\n\n if(downloadStorage) {\n let downloadFileName = options.fileName; // it's doc file_name\n if(!downloadFileName) {\n downloadFileName = cacheFileName;\n const ext = MIME_TYPE_EXTENSION_MAP[options.mimeType];\n if(ext) {\n downloadFileName += '.' + ext;\n }\n }\n\n downloadPrepared = downloadStorage.prepareWriting({\n fileName: downloadFileName,\n downloadId,\n size: possibleSize\n });\n attach(downloadPrepared, fileName);\n\n if(cachePrepared) { // cancel cache too\n downloadPrepared.deferred.catch((err) => cachePrepared.deferred.reject(err));\n }\n\n // this.downloadToDiscPromises[cacheFileName] = deferred;\n // deferred.catch(noop).finally(() => {\n // if(this.downloadToDiscPromises[cacheFileName] === deferred) {\n // delete this.downloadToDiscPromises[cacheFileName];\n // }\n // });\n }\n\n deferred = downloadPrepared?.deferred ?? cachePrepared.deferred;\n\n if(downloadStorage && process) { // then have to load file again\n getFile = downloadStorage.getFile.bind(downloadStorage);\n }\n\n getFile(cacheFileName).then(async(blob: Blob) => {\n checkCancel();\n\n // if(blob.size < size) {\n // if(!options.onlyCache) {\n // await this.delete(cacheFileName);\n // checkCancel();\n // }\n\n // throw makeError('NO_ENTRY_FOUND');\n // }\n\n if(downloadPrepared) {\n const writer = downloadPrepared.writer = downloadPrepared.getWriter();\n checkCancel();\n\n const arr = await readBlobAsUint8Array(blob);\n checkCancel();\n await writer.write(arr);\n checkCancel();\n\n downloadPrepared.deferred.resolve(await writer.finalize());\n }\n\n if(cachePrepared) {\n cachePrepared.deferred.resolve(blob);\n }\n }).catch(async(err: ApiError) => {\n if(options.onlyCache) {\n errorHandler(null, err);\n return;\n }\n\n prepared.forEach((p) => {\n p.writer = p.getWriter();\n });\n\n const maxRequests = Infinity;\n\n const requestPart = (isWebFile ? this.requestWebFilePart : this.requestFilePart).bind(this);\n\n if(isWebFile && this.webFileDcId === undefined && !isLocalWebFile) {\n await this.apiManager.getConfig();\n checkCancel();\n }\n\n const delayed = this.allocateDeferredPromises(0, size, limitPart);\n\n const progress: Progress = {done: 0, offset: 0, total: size, fileName};\n const dispatchProgress = () => {\n try {\n checkCancel();\n progress.done = done;\n this.rootScope.dispatchEvent('download_progress', progress);\n } catch(err) {}\n };\n\n const throttledDispatchProgress = throttle(dispatchProgress, 50, true);\n\n let done = 0;\n const superpuper = async() => {\n const {offset, writePromise, writeDeferred} = delayed.shift();\n try {\n checkCancel();\n\n const requestPerf = performance.now();\n const result = await requestPart(dcId, location as any, offset, limitPart, id, options.queueId, checkCancel);\n const requestTime = performance.now() - requestPerf;\n\n const bytes = result.bytes;\n\n if(delayed.length) {\n superpuper();\n }\n\n const byteLength = bytes.byteLength;\n this.debug && this.log('downloadFile requestFilePart result:', fileName, result);\n const isFinal = (offset + limitPart) >= size || !byteLength;\n if(byteLength) {\n done += byteLength;\n\n if(isFinal) {\n dispatchProgress();\n } else {\n throttledDispatchProgress();\n }\n\n const writeQueuePerf = performance.now();\n await writePromise;\n checkCancel();\n const writeQueueTime = performance.now() - writeQueuePerf;\n\n const perf = performance.now();\n await Promise.all(prepared.map(({writer}) => writer?.write(bytes, offset)));\n checkCancel();\n // downloadId && this.log('write time', performance.now() - perf, 'request time', requestTime, 'queue time', writeQueueTime);\n }\n\n if(isFinal) {\n if(!size || done < size) {\n prepared.forEach(({writer}) => writer?.trim?.(done));\n }\n }\n\n if(isFinal && process) {\n const promises = prepared\n .filter(({writer}) => writer?.getParts && writer.replaceParts)\n .map(async({writer}) => {\n const bytes = writer.getParts();\n const processedResult = await process(bytes, cacheFileName);\n writer.replaceParts(processedResult);\n });\n\n await Promise.all(promises);\n checkCancel();\n }\n\n writeDeferred.resolve();\n\n if(isFinal) {\n const saveToStorage = done <= MAX_FILE_SAVE_SIZE;\n prepared.forEach((item) => {\n const {deferred, writer} = item;\n if(deferred.isFulfilled || deferred.isRejected || !writer) {\n return;\n }\n\n const result = writer.finalize(saveToStorage);\n deferred.resolve(result);\n });\n }\n } catch(err) {\n errorHandler(null, err as ApiError);\n }\n };\n\n for(let i = 0, length = Math.min(maxRequests, delayed.length); i < length; ++i) {\n superpuper();\n }\n }).catch(noop);\n\n const checkCancel = () => {\n if(getErrorsCount() === prepared.length) {\n throw prepared[0].error;\n }\n };\n\n return deferred;\n }\n\n public downloadMedia(options: DownloadMediaOptions): DownloadPromise {\n let {media, thumb} = options;\n const isPhoto = media._ === 'photo';\n if(isPhoto && !thumb) {\n return Promise.reject('preloadPhoto photoEmpty!');\n }\n\n // get original instance with correct file_reference instead of using copies\n const isDocument = media._ === 'document';\n // const isWebDocument = media._ === 'webDocument';\n if(isDocument) media = this.appDocsManager.getDoc((media as Document.document).id);\n else if(isPhoto) media = this.appPhotosManager.getPhoto((media as Photo.photo).id);\n\n const {fileName, downloadOptions} = getDownloadMediaDetails(options);\n\n let promise = this.getDownload(fileName);\n if(!promise) {\n promise = this.download(downloadOptions);\n\n if(isDocument && !thumb) {\n this.rootScope.dispatchEvent('document_downloading', (media as Document.document).id);\n promise.then(() => {\n this.rootScope.dispatchEvent('document_downloaded', (media as Document.document).id);\n }).catch(noop);\n }\n }\n\n return promise;\n }\n\n public downloadMediaURL(options: DownloadMediaOptions): Promise {\n const {media, thumb} = options;\n\n let cacheContext = this.thumbsStorage.getCacheContext(media as any, thumb?.type);\n if((thumb ? (cacheContext.downloaded >= ('size' in thumb ? thumb.size : 0)) : true) && cacheContext.url) {\n return Promise.resolve(cacheContext.url);\n }\n\n return this.downloadMedia(options).then((blob) => {\n if(!cacheContext.downloaded || cacheContext.downloaded < blob.size) {\n const url = URL.createObjectURL(blob);\n cacheContext = this.thumbsStorage.setCacheContextURL(media as any, cacheContext.type, url, blob.size);\n }\n\n return cacheContext.url;\n });\n }\n\n public downloadMediaVoid(options: DownloadMediaOptions) {\n return this.downloadMedia(options).then(noop);\n }\n\n private delete(fileName: string) {\n delete this.downloadPromises[fileName];\n return this.getFileStorage().delete(fileName);\n }\n\n public upload({file, fileName}: {file: Blob | File, fileName?: string}) {\n fileName ||= getFileNameForUpload(file);\n\n const fileSize = file.size;\n const isBigFile = fileSize >= 10485760;\n const partSize = this.getLimitPart(fileSize, true);\n const activeDelta = this.getDelta(partSize);\n const totalParts = Math.ceil(fileSize / partSize);\n const fileId = randomLong();\n const resultInputFile: InputFile = {\n _: isBigFile ? 'inputFileBig' : 'inputFile',\n id: fileId as any,\n parts: totalParts,\n name: fileName,\n md5_checksum: ''\n };\n\n const deferred = deferredPromise();\n if(totalParts > this.maxUploadParts) {\n deferred.reject(makeError('FILE_TOO_BIG'));\n return deferred;\n }\n\n let canceled = false, resolved = false;\n let errorHandler = (error: ApiError) => {\n if(error?.type !== 'UPLOAD_CANCELED') {\n this.log.error('Up Error', error);\n }\n\n deferred.reject(error);\n canceled = true;\n errorHandler = noop;\n };\n\n const method = isBigFile ? 'upload.saveBigFilePart' : 'upload.saveFilePart';\n const id = this.tempId++;\n\n const self = this;\n function* generator() {\n let _part = 0, doneParts = 0;\n for(let offset = 0; offset < fileSize; offset += partSize) {\n const part = _part++; // 0, 1\n yield self.downloadRequest('upload', id, async() => {\n checkCancel();\n\n const blob = file.slice(offset, offset + partSize);\n const buffer = await readBlobAsArrayBuffer(blob);\n checkCancel();\n\n self.debug && self.log('Upload file part, isBig:', isBigFile, part, buffer.byteLength, new Uint8Array(buffer).length, new Uint8Array(buffer).slice().length);\n\n return self.apiManager.invokeApi(method, {\n file_id: fileId,\n file_part: part,\n file_total_parts: totalParts,\n bytes: buffer\n } as any, {\n fileUpload: true\n }).then(() => {\n if(canceled) {\n return;\n }\n\n ++doneParts;\n const progress: Progress = {done: doneParts * partSize, offset, total: fileSize, fileName};\n deferred.notify(progress);\n\n if(doneParts >= totalParts) {\n deferred.resolve(resultInputFile);\n resolved = true;\n }\n }, errorHandler);\n }, activeDelta).catch(errorHandler);\n }\n }\n\n const it = generator();\n const process = () => {\n if(canceled) return;\n const r = it.next();\n if(r.done || canceled) return;\n (r.value as Promise).then(process);\n };\n\n const maxRequests = Infinity;\n for(let i = 0, length = Math.min(maxRequests, totalParts); i < length; ++i) {\n process();\n }\n\n const checkCancel = () => {\n if(canceled) {\n throw makeError('UPLOAD_CANCELED');\n }\n };\n\n deferred.cancel = () => {\n if(!canceled && !resolved) {\n canceled = true;\n errorHandler(makeError('UPLOAD_CANCELED'));\n }\n };\n\n deferred.notify = (progress: Progress) => {\n this.rootScope.dispatchEvent('download_progress', progress);\n };\n\n deferred.finally(() => {\n if(this.uploadPromises[fileName] === deferred) {\n delete this.uploadPromises[fileName];\n }\n });\n\n return this.uploadPromises[fileName] = deferred;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport default function fixFirefoxSvg(text: string) {\n const svgIndex = text.indexOf('/, ` width=\"${width}\" height=\"${height}\">`).replace(/[^\\x00-\\x7F]/g, '');\n return text;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport readBlobAsArrayBuffer from './readBlobAsArrayBuffer';\n\nexport default function readBlobAsUint8Array(blob: Blob) {\n return readBlobAsArrayBuffer(blob).then((buffer) => new Uint8Array(buffer));\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ctx from '../../environment/ctx';\nimport callbackify from '../../helpers/callbackify';\nimport {ignoreRestrictionReasons} from '../../helpers/restrictions';\nimport {Config, MethodDeclMap, User} from '../../layer';\nimport {InvokeApiOptions} from '../../types';\nimport {AppManager} from '../appManagers/manager';\nimport {MTAppConfig} from './appConfig';\nimport {UserAuth} from './mtproto_config';\nimport {MTMessage} from './networker';\n\ntype HashResult = {\n hash: number,\n result: any\n};\n\ntype HashOptions = {\n [queryJSON: string]: HashResult\n};\n\nexport type ApiLimitType = 'pin' | 'folderPin' | 'folders' |\n 'favedStickers' | 'reactions' | 'bio' | 'topicPin' | 'caption';\n\nexport default abstract class ApiManagerMethods extends AppManager {\n private afterMessageIdTemp: number;\n private hashes: {[method: string]: HashOptions} = {};\n private apiPromisesSingleProcess: {\n [q: string]: Map>\n } = {};\n private apiPromisesSingle: {\n [q: string]: Promise\n } = {};\n private apiPromisesCacheable: {\n [method: string]: {\n [queryJSON: string]: {\n timestamp: number,\n promise: Promise,\n fulfilled: boolean,\n timeout?: number,\n params: any\n }\n }\n } = {};\n\n protected config: Config;\n protected appConfig: MTAppConfig;\n\n constructor() {\n super();\n this.afterMessageIdTemp = 0;\n }\n\n abstract setUserAuth(userAuth: UserAuth | UserId): Promise;\n\n public setUser(user: User) {\n // appUsersManager.saveApiUser(user);\n return this.setUserAuth(user.id);\n }\n\n abstract invokeApi(method: T, params?: MethodDeclMap[T]['req'], options?: InvokeApiOptions): Promise;\n\n public invokeApiAfter(method: T, params: MethodDeclMap[T]['req'] = {}, options: InvokeApiOptions = {}): Promise {\n let o = options;\n o.prepareTempMessageId = '' + ++this.afterMessageIdTemp;\n\n o = {...options};\n (options as MTMessage).messageId = o.prepareTempMessageId;\n\n // console.log('will invokeApi:', method, params, options);\n return this.invokeApi(method, params, o);\n }\n\n public invokeApiHashable(o: {\n method: T,\n processResult?: (response: MethodDeclMap[T]['res']) => R,\n processError?: (error: ApiError) => any,\n params?: Omit,\n options?: InvokeApiOptions & {cacheKey?: string},\n overwrite?: boolean\n }) {\n // @ts-ignore\n o.params ??= {};\n o.options ??= {};\n // console.log('will invokeApi:', method, params, options);\n\n const {params, options, method, overwrite} = o;\n\n const queryJSON = JSON.stringify(params);\n let cached: HashResult;\n if(this.hashes[method]) {\n cached = this.hashes[method][queryJSON];\n if(cached) {\n if(overwrite) {\n delete this.hashes[method][queryJSON];\n cached = undefined;\n } else {\n (params as any).hash = cached.hash;\n }\n }\n }\n\n return this.invokeApiSingleProcess({\n method,\n processResult: (result) => {\n if(result._.includes('NotModified')) {\n // this.debug && this.log.warn('NotModified saved!', method, queryJSON);\n return cached.result;\n }\n\n if(result.hash/* || result.messages */) {\n const hash = result.hash/* || this.computeHash(result.messages) */;\n\n if(!this.hashes[method]) this.hashes[method] = {};\n cached = this.hashes[method][queryJSON] = {\n hash,\n result\n };\n }\n\n if(o.processResult) {\n const newResult = o.processResult(result);\n return cached ? cached.result = newResult : newResult;\n }\n\n return result;\n },\n params,\n options\n });\n }\n\n public invokeApiSingle(method: T, params: MethodDeclMap[T]['req'] = {} as any, options: InvokeApiOptions = {}): Promise {\n const q = method + '-' + JSON.stringify(params);\n const cache = this.apiPromisesSingle;\n if(cache[q]) {\n return cache[q];\n }\n\n return cache[q] = this.invokeApi(method, params, options).finally(() => {\n delete cache[q];\n });\n }\n\n public invokeApiSingleProcess(o: {\n method: T,\n processResult: (response: MethodDeclMap[T]['res']) => R,\n processError?: (error: ApiError) => any,\n params?: MethodDeclMap[T]['req'],\n options?: InvokeApiOptions & {cacheKey?: string, overwrite?: boolean}\n }): Promise> {\n o.params ??= {};\n o.options ??= {};\n\n const {method, processResult, processError, params, options} = o;\n const cache = this.apiPromisesSingleProcess;\n const cacheKey = options.cacheKey || JSON.stringify(params);\n const map = cache[method] ?? (cache[method] = new Map());\n const oldPromise = map.get(cacheKey);\n if(oldPromise) {\n return oldPromise;\n }\n\n const getNewPromise = () => {\n const promise = map.get(cacheKey);\n return promise === p ? undefined : promise;\n }\n\n const originalPromise = this.invokeApi(method, params, options);\n const newPromise: Promise> = originalPromise.then((result) => {\n return getNewPromise() || processResult(result);\n }, (error) => {\n const promise = getNewPromise();\n if(promise) {\n return promise;\n }\n\n if(!processError) {\n throw error;\n }\n\n return processError(error);\n });\n\n const p = newPromise.finally(() => {\n if(map.get(cacheKey) !== p) {\n return;\n }\n\n map.delete(cacheKey);\n if(!map.size) {\n delete cache[method];\n }\n });\n\n map.set(cacheKey, p);\n return p;\n }\n\n public invokeApiCacheable(method: T, params: MethodDeclMap[T]['req'] = {} as any, options: InvokeApiOptions & Partial<{cacheSeconds: number, override: boolean}> = {}): Promise {\n const cache = this.apiPromisesCacheable[method] ?? (this.apiPromisesCacheable[method] = {});\n const queryJSON = JSON.stringify(params);\n const item = cache[queryJSON];\n if(item && (!options.override || !item.fulfilled)) {\n return item.promise;\n }\n\n if(options.override) {\n if(item && item.timeout) {\n clearTimeout(item.timeout);\n delete item.timeout;\n }\n\n delete options.override;\n }\n\n let timeout: number;\n if(options.cacheSeconds) {\n timeout = ctx.setTimeout(() => {\n delete cache[queryJSON];\n }, options.cacheSeconds * 1000);\n delete options.cacheSeconds;\n }\n\n const promise = this.invokeApi(method, params, options);\n\n cache[queryJSON] = {\n timestamp: Date.now(),\n fulfilled: false,\n timeout,\n promise,\n params\n };\n\n return promise;\n }\n\n public clearCache(method: T, verify: (params: MethodDeclMap[T]['req']) => boolean) {\n const cache = this.apiPromisesCacheable[method];\n if(cache) {\n for(const queryJSON in cache) {\n const item = cache[queryJSON];\n try {\n if(verify(item.params)) {\n if(item.timeout) {\n clearTimeout(item.timeout);\n }\n\n delete cache[queryJSON];\n }\n } catch(err) {\n // this.log.error('clearCache error:', err, queryJSON, item);\n }\n }\n }\n }\n\n public getConfig(overwrite?: boolean) {\n if(this.config && !overwrite) {\n return this.config;\n }\n\n return this.invokeApiSingleProcess({\n method: 'help.getConfig',\n params: {},\n processResult: (config) => {\n this.config = config;\n this.rootScope.dispatchEvent('config', config);\n return config;\n },\n options: {overwrite}\n });\n }\n\n public getAppConfig(overwrite?: boolean) {\n if(this.appConfig && !overwrite) {\n return this.appConfig;\n }\n\n return this.invokeApiSingleProcess({\n method: 'help.getAppConfig',\n params: {},\n processResult: (config: MTAppConfig) => {\n this.appConfig = config;\n ignoreRestrictionReasons(config.ignore_restriction_reasons ?? []);\n this.rootScope.dispatchEvent('app_config', config);\n return config;\n },\n options: {overwrite}\n });\n }\n\n public getLimit(type: ApiLimitType, isPremium?: boolean) {\n return callbackify(this.getAppConfig(), (appConfig) => {\n const map: {[type in ApiLimitType]: [keyof MTAppConfig, keyof MTAppConfig] | keyof MTAppConfig} = {\n pin: ['dialogs_pinned_limit_default', 'dialogs_pinned_limit_premium'],\n folderPin: ['dialogs_folder_pinned_limit_default', 'dialogs_folder_pinned_limit_premium'],\n folders: ['dialog_filters_limit_default', 'dialog_filters_limit_premium'],\n favedStickers: ['stickers_faved_limit_default', 'stickers_faved_limit_premium'],\n reactions: ['reactions_user_max_default', 'reactions_user_max_premium'],\n bio: ['about_length_limit_default', 'about_length_limit_premium'],\n topicPin: 'topics_pinned_limit',\n caption: ['caption_length_limit_default', 'caption_length_limit_premium']\n };\n\n isPremium ??= this.rootScope.premium;\n\n const a = map[type];\n const key = Array.isArray(a) ? a[isPremium ? 1 : 0] : a;\n return appConfig[key] as number;\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\n \nimport transportController from './transports/controller';\nimport MTTransport from './transports/transport';\n \n\nimport type {UserAuth} from './mtproto_config';\nimport type {DcAuthKey, DcId, DcServerSalt, InvokeApiOptions} from '../../types';\nimport type {MethodDeclMap} from '../../layer';\nimport type TcpObfuscated from './transports/tcpObfuscated';\nimport sessionStorage from '../sessionStorage';\nimport MTPNetworker, {MTMessage} from './networker';\nimport {ConnectionType, constructTelegramWebSocketUrl, DcConfigurator, TransportType} from './dcConfigurator';\nimport {logger} from '../logger';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport App from '../../config/app';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport {IDB} from '../files/idb';\nimport CryptoWorker from '../crypto/cryptoMessagePort';\nimport ctx from '../../environment/ctx';\nimport noop from '../../helpers/noop';\nimport Modes from '../../config/modes';\nimport bytesFromHex from '../../helpers/bytes/bytesFromHex';\nimport bytesToHex from '../../helpers/bytes/bytesToHex';\nimport isObject from '../../helpers/object/isObject';\nimport pause from '../../helpers/schedulers/pause';\nimport ApiManagerMethods from './api_methods';\nimport {getEnvironment} from '../../environment/utils';\nimport toggleStorages from '../../helpers/toggleStorages';\nimport tsNow from '../../helpers/tsNow';\n\n/* class RotatableArray {\n public array: Array = [];\n private lastIndex = -1;\n\n public get() {\n this.lastIndex = clamp(this.lastIndex + 1, 0, this.array.length - 1);\n return this.array[this.lastIndex];\n }\n} */\n\nconst PREMIUM_FILE_NETWORKERS_COUNT = 6;\nconst REGULAR_FILE_NETWORKERS_COUNT = 3;\n\nexport class ApiManager extends ApiManagerMethods {\n private cachedNetworkers: {\n [transportType in TransportType]: {\n [connectionType in ConnectionType]: {\n [dcId: DcId]: MTPNetworker[]\n }\n }\n };\n\n private cachedExportPromise: {[x: number]: Promise};\n private gettingNetworkers: {[dcIdAndType: string]: Promise};\n private baseDcId: DcId;\n\n // public telegramMeNotified = false;\n\n private log: ReturnType;\n\n private afterMessageTempIds: {\n [tempId: string]: {\n messageId: string,\n promise: Promise\n }\n };\n\n private transportType: TransportType;\n\n private updatesProcessor: (obj: any) => void;\n\n private loggingOut: boolean;\n\n constructor() {\n super();\n this.log = logger('API');\n\n this.cachedNetworkers = {} as any;\n this.cachedExportPromise = {};\n this.gettingNetworkers = {};\n this.baseDcId = 0;\n this.afterMessageTempIds = {};\n\n this.transportType = Modes.transport;\n\n \n transportController.addEventListener('transport', (transportType) => {\n this.changeTransportType(transportType);\n });\n \n\n // * Make sure that the used autologin_token is no more than 10000 seconds old\n // * https://core.telegram.org/api/url-authorization\n const REFRESH_APP_CONFIG_INTERVAL = (10000 - 30) * 1000;\n setInterval(() => {\n this.getAppConfig(true);\n }, REFRESH_APP_CONFIG_INTERVAL);\n }\n\n protected after() {\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateConfig: () => {\n this.getConfig(true);\n this.getAppConfig(true);\n }\n });\n\n this.rootScope.addEventListener('user_auth', () => {\n if(this.config) { // refresh configs if had a config during authorization\n this.apiUpdatesManager.processLocalUpdate({_: 'updateConfig'});\n }\n });\n\n this.rootScope.addEventListener('premium_toggle', (isPremium) => {\n this.iterateNetworkers(({networker, connectionType, dcId, transportType}) => {\n if(connectionType === 'client' || transportType !== 'websocket') {\n return;\n }\n\n const transport = networker.transport;\n if(!transport) {\n this.log.error('wow what, no transport?', networker);\n return;\n }\n\n if((transport as TcpObfuscated).connection) {\n const url = constructTelegramWebSocketUrl(dcId, connectionType, isPremium);\n (transport as TcpObfuscated).changeUrl(url);\n }\n });\n });\n }\n\n // private lol = false;\n\n // constructor() {\n // MtpSingleInstanceService.start();\n\n /* AppStorage.get('dc').then((dcId) => {\n if(dcId) {\n this.baseDcId = dcId;\n }\n }); */\n // }\n\n /* public telegramMeNotify(newValue: boolean) {\n if(this.telegramMeNotified !== newValue) {\n this.telegramMeNotified = newValue;\n //telegramMeWebService.setAuthorized(this.telegramMeNotified);\n }\n } */\n\n private getTransportType(connectionType: ConnectionType) {\n \n \n \n \n \n // @ts-ignore\n const transportType: TransportType = this.transportType;\n \n\n return transportType;\n }\n\n private iterateNetworkers(callback: (o: {networker: MTPNetworker, dcId: DcId, connectionType: ConnectionType, transportType: TransportType, index: number, array: MTPNetworker[]}) => void) {\n for(const transportType in this.cachedNetworkers) {\n const connections = this.cachedNetworkers[transportType as TransportType];\n for(const connectionType in connections) {\n const dcs = connections[connectionType as ConnectionType];\n for(const dcId in dcs) {\n const networkers = dcs[dcId as any as DcId];\n networkers.forEach((networker, idx, arr) => {\n callback({\n networker,\n dcId: +dcId as DcId,\n connectionType: connectionType as ConnectionType,\n transportType: transportType as TransportType,\n index: idx,\n array: arr\n });\n });\n }\n }\n }\n }\n\n private chooseServer(dcId: DcId, connectionType: ConnectionType, transportType: TransportType) {\n return this.dcConfigurator.chooseServer(dcId, connectionType, transportType, connectionType === 'client', this.rootScope.premium);\n }\n\n public changeTransportType(transportType: TransportType) {\n const oldTransportType = this.transportType;\n if(oldTransportType === transportType) {\n return;\n }\n\n this.log('changing transport from', oldTransportType, 'to', transportType);\n\n const oldObject = this.cachedNetworkers[oldTransportType];\n const newObject = this.cachedNetworkers[transportType];\n this.cachedNetworkers[transportType] = oldObject;\n this.cachedNetworkers[oldTransportType] = newObject;\n\n this.transportType = transportType;\n\n for(const oldGetKey in this.gettingNetworkers) {\n const promise = this.gettingNetworkers[oldGetKey];\n delete this.gettingNetworkers[oldGetKey];\n\n const newGetKey = oldGetKey.replace(oldTransportType, transportType);\n this.gettingNetworkers[newGetKey] = promise;\n\n this.log('changed networker getKey from', oldGetKey, 'to', newGetKey)\n }\n\n this.iterateNetworkers((info) => {\n const transportType = this.getTransportType(info.connectionType);\n const transport = this.chooseServer(info.dcId, info.connectionType, transportType);\n this.changeNetworkerTransport(info.networker, transport);\n });\n }\n\n public async getBaseDcId() {\n if(this.baseDcId) {\n return this.baseDcId;\n }\n\n const baseDcId = await sessionStorage.get('dc');\n if(!this.baseDcId) {\n if(!baseDcId) {\n this.setBaseDcId(App.baseDcId);\n } else {\n this.baseDcId = baseDcId;\n }\n }\n\n return this.baseDcId;\n }\n\n public async setUserAuth(userAuth: UserAuth | UserId) {\n if(typeof(userAuth) === 'string' || typeof(userAuth) === 'number') {\n userAuth = {dcID: 0, date: tsNow(true), id: userAuth.toPeerId(false)};\n }\n\n this.rootScope.dispatchEvent('user_auth', userAuth);\n\n if(!userAuth.dcID) {\n const baseDcId = await this.getBaseDcId();\n userAuth.dcID = baseDcId;\n }\n\n sessionStorage.set({\n user_auth: userAuth\n });\n\n // this.telegramMeNotify(true);\n }\n\n public setBaseDcId(dcId: DcId) {\n const wasDcId = this.baseDcId;\n if(wasDcId) { // if migrated set ondrain\n this.getNetworker(wasDcId).then((networker) => {\n this.setOnDrainIfNeeded(networker);\n });\n }\n\n this.baseDcId = dcId;\n\n sessionStorage.set({\n dc: this.baseDcId\n });\n }\n\n public async logOut() {\n if(this.loggingOut) {\n return;\n }\n\n this.loggingOut = true;\n const storageKeys: Array = [];\n\n const prefix = 'dc';\n for(let dcId = 1; dcId <= 5; dcId++) {\n storageKeys.push(prefix + dcId + '_auth_key' as any);\n }\n\n // WebPushApiManager.forceUnsubscribe(); // WARNING // moved to worker's master\n const storageResult = await Promise.all(storageKeys.map((key) => sessionStorage.get(key)));\n\n const logoutPromises: Promise[] = [];\n for(let i = 0; i < storageResult.length; i++) {\n if(storageResult[i]) {\n logoutPromises.push(this.invokeApi('auth.logOut', {}, {dcId: (i + 1) as DcId, ignoreErrors: true}));\n }\n }\n\n const clear = async() => {\n this.baseDcId = undefined;\n // this.telegramMeNotify(false);\n await toggleStorages(false, true);\n IDB.closeDatabases();\n this.rootScope.dispatchEvent('logging_out');\n };\n\n setTimeout(clear, 1e3);\n\n // return;\n\n return Promise.all(logoutPromises).catch((error) => {\n error.handled = true;\n }).finally(clear)/* .then(() => {\n location.pathname = '/';\n }) */;\n }\n\n private generateNetworkerGetKey(dcId: DcId, transportType: TransportType, connectionType: ConnectionType) {\n return [dcId, transportType, connectionType].join('-');\n }\n\n public getNetworker(dcId: DcId, options: InvokeApiOptions = {}): Promise {\n const connectionType: ConnectionType = options.fileDownload ? 'download' : (options.fileUpload ? 'upload' : 'client');\n // const connectionType: ConnectionType = 'client';\n\n const transportType = this.getTransportType(connectionType);\n if(!this.cachedNetworkers[transportType]) {\n this.cachedNetworkers[transportType] = {\n client: {},\n download: {},\n upload: {}\n };\n }\n\n const cache = this.cachedNetworkers[transportType][connectionType];\n if(!(dcId in cache)) {\n cache[dcId] = [];\n }\n\n const networkers = cache[dcId];\n // @ts-ignore\n const maxNetworkers = connectionType === 'client' || transportType === 'https' ? 1 : (this.rootScope.premium ? PREMIUM_FILE_NETWORKERS_COUNT : REGULAR_FILE_NETWORKERS_COUNT);\n if(networkers.length >= maxNetworkers) {\n let i = maxNetworkers - 1, found = false;\n for(; i >= 0; --i) {\n if(networkers[i].isOnline) {\n found = true;\n break;\n }\n }\n\n const networker = networkers.splice(found ? i : maxNetworkers - 1, 1)[0];\n networkers.unshift(networker);\n return Promise.resolve(networker);\n }\n\n let getKey = this.generateNetworkerGetKey(dcId, transportType, connectionType);\n if(this.gettingNetworkers[getKey]) {\n return this.gettingNetworkers[getKey];\n }\n\n const ak: DcAuthKey = `dc${dcId}_auth_key` as any;\n const ss: DcServerSalt = `dc${dcId}_server_salt` as any;\n\n let transport = this.chooseServer(dcId, connectionType, transportType);\n return this.gettingNetworkers[getKey] = Promise.all([ak, ss].map((key) => sessionStorage.get(key)))\n .then(async([authKeyHex, serverSaltHex]) => {\n let networker: MTPNetworker, error: any;\n if(authKeyHex && authKeyHex.length === 512) {\n if(!serverSaltHex || serverSaltHex.length !== 16) {\n serverSaltHex = 'AAAAAAAAAAAAAAAA';\n }\n\n const authKey = bytesFromHex(authKeyHex);\n const authKeyId = (await CryptoWorker.invokeCrypto('sha1', authKey)).slice(-8);\n const serverSalt = bytesFromHex(serverSaltHex);\n\n networker = this.networkerFactory.getNetworker(dcId, authKey, authKeyId, serverSalt, options);\n } else {\n try { // if no saved state\n const auth = await this.authorizer.auth(dcId);\n\n sessionStorage.set({\n [ak]: bytesToHex(auth.authKey),\n [ss]: bytesToHex(auth.serverSalt)\n });\n\n networker = this.networkerFactory.getNetworker(dcId, auth.authKey, auth.authKeyId, auth.serverSalt, options);\n } catch(_error) {\n error = _error;\n }\n }\n\n // ! cannot get it before this promise because simultaneous changeTransport will change nothing\n const newTransportType = this.getTransportType(connectionType);\n if(newTransportType !== transportType) {\n getKey = this.generateNetworkerGetKey(dcId, newTransportType, connectionType);\n transport.destroy();\n DcConfigurator.removeTransport(this.dcConfigurator.chosenServers, transport);\n\n if(networker) {\n transport = this.chooseServer(dcId, connectionType, newTransportType);\n }\n\n this.log('transport has been changed during authorization from', transportType, 'to', newTransportType);\n }\n\n /* networker.onConnectionStatusChange = (online) => {\n console.log('status:', online);\n }; */\n\n delete this.gettingNetworkers[getKey];\n\n if(error) {\n this.log('get networker error', error, (error as Error).stack);\n throw error;\n }\n\n this.changeNetworkerTransport(networker, transport);\n networkers.unshift(networker);\n this.setOnDrainIfNeeded(networker);\n return networker;\n });\n }\n\n public getNetworkerVoid(dcId: DcId) {\n return this.getNetworker(dcId).then(noop, noop);\n }\n\n private changeNetworkerTransport(networker: MTPNetworker, transport?: MTTransport) {\n const oldTransport = networker.transport;\n if(oldTransport) {\n DcConfigurator.removeTransport(this.dcConfigurator.chosenServers, oldTransport);\n }\n\n networker.changeTransport(transport);\n }\n\n private onNetworkerDrain(networker: MTPNetworker) {\n this.log('networker drain', networker.dcId);\n networker.onDrain = undefined;\n this.changeNetworkerTransport(networker);\n networker.destroy();\n this.networkerFactory.removeNetworker(networker);\n DcConfigurator.removeTransport(this.cachedNetworkers, networker);\n }\n\n public setOnDrainIfNeeded(networker: MTPNetworker) {\n if(networker.onDrain) {\n return;\n }\n\n const checkPromise: Promise = networker.isFileNetworker ?\n Promise.resolve(true) :\n this.getBaseDcId().then((baseDcId) => networker.dcId !== baseDcId);\n checkPromise.then((canRelease) => {\n if(networker.onDrain) {\n return;\n }\n\n if(canRelease) {\n networker.onDrain = () => this.onNetworkerDrain(networker);\n networker.setDrainTimeout();\n }\n });\n }\n\n public setUpdatesProcessor(callback: (obj: any) => void) {\n this.updatesProcessor = callback;\n this.networkerFactory.setUpdatesProcessor(callback);\n }\n\n public invokeApi(method: T, params: MethodDeclMap[T]['req'] = {}, options: InvokeApiOptions = {}): CancellablePromise {\n // /////this.log('Invoke api', method, params, options);\n\n /* if(!this.lol) {\n networkerFactory.updatesProcessor({_: 'new_session_created'}, true);\n this.lol = true;\n } */\n\n const deferred = deferredPromise();\n\n let {afterMessageId, prepareTempMessageId} = options;\n if(prepareTempMessageId) {\n deferred.then(() => {\n delete this.afterMessageTempIds[prepareTempMessageId];\n });\n }\n\n if(MOUNT_CLASS_TO) {\n const startTime = Date.now();\n const interval = ctx.setInterval(() => {\n if(!cachedNetworker || !cachedNetworker.isStopped()) {\n this.log.error('Request is still processing:', method, params, options, 'time:', (Date.now() - startTime) / 1000);\n }\n // this.cachedUploadNetworkers[2].requestMessageStatus();\n }, 5e3);\n\n deferred.catch(noop).finally(() => {\n clearInterval(interval);\n });\n }\n\n const rejectPromise = async(error: ApiError) => {\n if(!error) {\n error = {type: 'ERROR_EMPTY'};\n } else if(!isObject(error)) {\n error = {message: error};\n }\n\n if((error.code === 401 && error.type === 'SESSION_REVOKED') ||\n (error.code === 406 && error.type === 'AUTH_KEY_DUPLICATED')) {\n this.logOut();\n }\n\n if(options.ignoreErrors) {\n throw error;\n }\n\n if(error.code === 406) {\n error.handled = true;\n }\n\n if(!options.noErrorBox) {\n error.input = method;\n error.stack = stack || (error.originalError && error.originalError.stack) || error.stack || (new Error()).stack;\n setTimeout(() => {\n if(!error.handled) {\n if(error.code === 401) {\n this.logOut();\n } else {\n // ErrorService.show({error: error}); // WARNING\n }\n\n error.handled = true;\n }\n }, 100);\n }\n\n throw error;\n };\n\n let dcId: DcId;\n\n let cachedNetworker: MTPNetworker;\n const stack = (new Error()).stack || 'empty stack';\n const performRequest = (): Promise => {\n if(afterMessageId) {\n const after = this.afterMessageTempIds[afterMessageId];\n if(after) {\n options.afterMessageId = after.messageId;\n }\n }\n\n const promise = cachedNetworker.wrapApiCall(method, params, options);\n\n if(prepareTempMessageId) {\n this.afterMessageTempIds[prepareTempMessageId] = {\n messageId: (options as MTMessage).messageId,\n promise: deferred\n };\n }\n\n return promise.catch((error: ApiError) => {\n // if(!options.ignoreErrors) {\n if(error.type !== 'FILE_REFERENCE_EXPIRED'/* && error.type !== 'MSG_WAIT_FAILED' */) {\n this.log.error('Error', error.code, error.type, this.baseDcId, dcId, method, params);\n }\n\n if(error.code === 401 && this.baseDcId === dcId) {\n if(error.type !== 'SESSION_PASSWORD_NEEDED') {\n sessionStorage.delete('dc')\n sessionStorage.delete('user_auth'); // ! возможно тут вообще не нужно это делать, но нужно проверить случай с USER_DEACTIVATED (https://core.telegram.org/api/errors)\n // this.telegramMeNotify(false);\n }\n\n throw error;\n } else if(error.code === 401 && this.baseDcId && dcId !== this.baseDcId) {\n if(this.cachedExportPromise[dcId] === undefined) {\n const promise = new Promise((exportResolve, exportReject) => {\n this.invokeApi('auth.exportAuthorization', {dc_id: dcId}, {noErrorBox: true}).then((exportedAuth) => {\n this.invokeApi('auth.importAuthorization', {\n id: exportedAuth.id,\n bytes: exportedAuth.bytes\n }, {dcId, noErrorBox: true}).then(exportResolve, exportReject);\n }, exportReject);\n });\n\n this.cachedExportPromise[dcId] = promise;\n }\n\n return this.cachedExportPromise[dcId].then(() => performRequest());\n } else if(error.code === 303) {\n const newDcId = +error.type.match(/^(PHONE_MIGRATE_|NETWORK_MIGRATE_|USER_MIGRATE_)(\\d+)/)[2] as DcId;\n if(newDcId !== dcId) {\n if(options.dcId) {\n options.dcId = newDcId;\n } else {\n this.setBaseDcId(newDcId);\n }\n\n return this.invokeApi(method, params, options);\n }\n } else if(error.code === 400 && error.type.indexOf('FILE_MIGRATE') === 0) {\n const newDcId = +error.type.match(/^(FILE_MIGRATE_)(\\d+)/)[2] as DcId;\n if(newDcId !== dcId) {\n options.dcId = newDcId;\n return this.invokeApi(method, params, options);\n } else {\n throw error;\n }\n } else if(error.code === 400 && error.type === 'CONNECTION_NOT_INITED') {\n this.networkerFactory.unsetConnectionInited();\n return performRequest();\n } else if(!options.rawError && error.code === 420) {\n const waitTime = +error.type.match(/^FLOOD_WAIT_(\\d+)/)[1] || 1;\n\n if(waitTime > (options.floodMaxTimeout ?? 60) && !options.prepareTempMessageId) {\n throw error;\n }\n\n return pause(waitTime/* (waitTime + 5) */ * 1000).then(() => performRequest());\n } else if(!options.rawError && ['MSG_WAIT_FAILED', 'MSG_WAIT_TIMEOUT'].includes(error.type)) {\n const after = this.afterMessageTempIds[afterMessageId];\n\n afterMessageId = undefined;\n delete options.afterMessageId;\n\n if(after) return after.promise.then(() => performRequest());\n else return performRequest();\n } else if(!options.rawError && error.code === 500) {\n const now = Date.now();\n if(options.stopTime) {\n if(now >= options.stopTime) {\n throw error;\n }\n }\n\n options.waitTime = options.waitTime ? Math.min(60, options.waitTime * 1.5) : 1;\n return pause(options.waitTime * 1000).then(() => performRequest());\n } else if(error.type === 'UNKNOWN' || error.type === 'MTPROTO_CLUSTER_INVALID') { // cluster invalid - request from regular user to premium endpoint\n return pause(1000).then(() => performRequest());\n } else {\n throw error;\n }\n });\n }\n\n let p: Promise;\n if(dcId = (options.dcId || this.baseDcId)) {\n p = this.getNetworker(dcId, options);\n } else {\n p = this.getBaseDcId().then((baseDcId) => this.getNetworker(dcId = baseDcId, options));\n }\n\n p.then((networker) => {\n cachedNetworker = networker;\n const promise = performRequest();\n cachedNetworker.attachPromise(deferred, options as MTMessage);\n return promise;\n })\n .then(deferred.resolve)\n .catch(rejectPromise)\n .catch(deferred.reject);\n\n return deferred;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport applyMixins from '../../helpers/applyMixins';\nimport EventListenerBase from '../../helpers/eventListenerBase';\nimport {AppManager} from '../appManagers/manager';\n\nexport type StatePeerType = 'recentSearch' | 'topPeer' | 'dialog' | 'contact' | 'topMessage' | 'self';\n\ntype PeersStorageKey = `${StatePeerType}_${string | PeerId}` | StatePeerType;\n\nclass PeersStorage {\n private neededPeers: Map> = new Map();\n private singlePeerMap: Map> = new Map();\n\n constructor() {\n this._constructor(false);\n }\n\n protected after() {\n this.rootScope.addEventListener('user_auth', () => {\n this.requestPeer(this.appPeersManager.peerId, 'self');\n });\n }\n\n public requestPeer(peerId: PeerId, key: PeersStorageKey) {\n let set = this.neededPeers.get(peerId);\n if(set && set.has(key)) {\n return;\n }\n\n if(!set) {\n set = new Set();\n this.neededPeers.set(peerId, set);\n }\n\n set.add(key);\n\n this.dispatchEvent('peerNeeded', peerId);\n }\n\n public releasePeer(peerId: PeerId, key: PeersStorageKey) {\n const set = this.neededPeers.get(peerId);\n if(!set) {\n return;\n }\n\n set.delete(key);\n\n if(!set.size) {\n this.neededPeers.delete(peerId);\n this.dispatchEvent('peerUnneeded', peerId);\n }\n }\n\n public requestPeersForKey(peerIds: Set | number[], key: PeersStorageKey) {\n if(Array.isArray(peerIds)) {\n peerIds = new Set(peerIds);\n }\n\n let set = this.singlePeerMap.get(key);\n if(set) {\n for(const peerId of set) {\n if(peerIds.has(peerId)) {\n continue;\n }\n\n this.releasePeer(peerId, key);\n set.delete(peerId);\n }\n\n if(!set.size && !peerIds.size) {\n this.singlePeerMap.delete(key);\n return;\n }\n }\n\n if(peerIds.size) {\n if(!set) {\n set = new Set();\n this.singlePeerMap.set(key, set);\n }\n\n for(const peerId of peerIds) {\n if(set.has(peerId)) {\n continue;\n }\n\n this.requestPeer(peerId, key);\n set.add(peerId);\n }\n }\n }\n\n public isPeerNeeded(peerId: PeerId) {\n return this.neededPeers.has(peerId);\n }\n}\n\ninterface PeersStorage extends EventListenerBase<{\n peerNeeded: (peerId: PeerId) => void,\n peerUnneeded: (peerId: PeerId) => void,\n}>, AppManager {}\napplyMixins(PeersStorage, [EventListenerBase, AppManager]);\n\nexport default PeersStorage;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {WebDocument} from '../../layer';\nimport type {MyDocument} from '../appManagers/appDocsManager';\nimport type {MyPhoto} from '../appManagers/appPhotosManager';\nimport {THUMB_TYPE_FULL} from '../mtproto/mtproto_config';\n\nexport type ThumbCache = {\n downloaded: number,\n url: string,\n type: string\n};\n\nexport type ThumbsCache = {\n [key: string]: {\n [size: string]: ThumbCache\n }\n};\n\nconst thumbFullSize = THUMB_TYPE_FULL;\n\nexport type ThumbStorageMedia = MyPhoto | MyDocument | WebDocument;\n\nexport default class ThumbsStorage {\n private thumbsCache: ThumbsCache = {};\n\n private getKey(media: ThumbStorageMedia) {\n return media._ + ((media as MyPhoto).id ?? (media as WebDocument).url);\n }\n\n public getCacheContext(media: ThumbStorageMedia, thumbSize: string = thumbFullSize): ThumbCache {\n /* if(media._ === 'photo' && thumbSize !== 'i') {\n thumbSize = thumbFullSize;\n } */\n\n const cache = this.thumbsCache[this.getKey(media)] ??= {};\n return cache[thumbSize] ??= {downloaded: 0, url: '', type: thumbSize};\n }\n\n public setCacheContextURL(media: ThumbStorageMedia, thumbSize: string = thumbFullSize, url: string, downloaded: number = 0) {\n const cacheContext = this.getCacheContext(media, thumbSize);\n cacheContext.url = url;\n cacheContext.downloaded = downloaded;\n return cacheContext;\n }\n\n public deleteCacheContext(media: ThumbStorageMedia, thumbSize: string = thumbFullSize) {\n const cache = this.thumbsCache[this.getKey(media)];\n if(cache) {\n delete cache[thumbSize];\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nexport type MTProtoConstructor = {\n id: number,\n predicate: string,\n params: Array<{\n name: string,\n type: string\n }>,\n type: string\n};\n\nexport type MTProtoMethod = {\n id: number,\n method: string,\n params: Array<{\n name: string,\n type: string\n }>,\n type: string\n};\n\n// eslint-disable-next-line quotes, comma-spacing\nexport default {\"MTProto\":{\"constructors\":[{\"id\":481674261,\"predicate\":\"vector\",\"params\":[],\"type\":\"Vector t\"},{\"id\":85337187,\"predicate\":\"resPQ\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"pq\",\"type\":\"bytes\"},{\"name\":\"server_public_key_fingerprints\",\"type\":\"Vector\"}],\"type\":\"ResPQ\"},{\"id\":-1443537003,\"predicate\":\"p_q_inner_data_dc\",\"params\":[{\"name\":\"pq\",\"type\":\"bytes\"},{\"name\":\"p\",\"type\":\"bytes\"},{\"name\":\"q\",\"type\":\"bytes\"},{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"new_nonce\",\"type\":\"int256\"},{\"name\":\"dc\",\"type\":\"int\"}],\"type\":\"P_Q_inner_data\"},{\"id\":1459478408,\"predicate\":\"p_q_inner_data_temp_dc\",\"params\":[{\"name\":\"pq\",\"type\":\"bytes\"},{\"name\":\"p\",\"type\":\"bytes\"},{\"name\":\"q\",\"type\":\"bytes\"},{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"new_nonce\",\"type\":\"int256\"},{\"name\":\"dc\",\"type\":\"int\"},{\"name\":\"expires_in\",\"type\":\"int\"}],\"type\":\"P_Q_inner_data\"},{\"id\":-790100132,\"predicate\":\"server_DH_params_ok\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"encrypted_answer\",\"type\":\"bytes\"}],\"type\":\"Server_DH_Params\"},{\"id\":-1249309254,\"predicate\":\"server_DH_inner_data\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"g\",\"type\":\"int\"},{\"name\":\"dh_prime\",\"type\":\"bytes\"},{\"name\":\"g_a\",\"type\":\"bytes\"},{\"name\":\"server_time\",\"type\":\"int\"}],\"type\":\"Server_DH_inner_data\"},{\"id\":1715713620,\"predicate\":\"client_DH_inner_data\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"retry_id\",\"type\":\"long\"},{\"name\":\"g_b\",\"type\":\"bytes\"}],\"type\":\"Client_DH_Inner_Data\"},{\"id\":1003222836,\"predicate\":\"dh_gen_ok\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"new_nonce_hash1\",\"type\":\"int128\"}],\"type\":\"Set_client_DH_params_answer\"},{\"id\":1188831161,\"predicate\":\"dh_gen_retry\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"new_nonce_hash2\",\"type\":\"int128\"}],\"type\":\"Set_client_DH_params_answer\"},{\"id\":-1499615742,\"predicate\":\"dh_gen_fail\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"new_nonce_hash3\",\"type\":\"int128\"}],\"type\":\"Set_client_DH_params_answer\"},{\"id\":1973679973,\"predicate\":\"bind_auth_key_inner\",\"params\":[{\"name\":\"nonce\",\"type\":\"long\"},{\"name\":\"temp_auth_key_id\",\"type\":\"long\"},{\"name\":\"perm_auth_key_id\",\"type\":\"long\"},{\"name\":\"temp_session_id\",\"type\":\"long\"},{\"name\":\"expires_at\",\"type\":\"int\"}],\"type\":\"BindAuthKeyInner\"},{\"id\":-212046591,\"predicate\":\"rpc_result\",\"params\":[{\"name\":\"req_msg_id\",\"type\":\"long\"},{\"name\":\"result\",\"type\":\"Object\"}],\"type\":\"RpcResult\"},{\"id\":558156313,\"predicate\":\"rpc_error\",\"params\":[{\"name\":\"error_code\",\"type\":\"int\"},{\"name\":\"error_message\",\"type\":\"string\"}],\"type\":\"RpcError\"},{\"id\":1579864942,\"predicate\":\"rpc_answer_unknown\",\"params\":[],\"type\":\"RpcDropAnswer\"},{\"id\":-847714938,\"predicate\":\"rpc_answer_dropped_running\",\"params\":[],\"type\":\"RpcDropAnswer\"},{\"id\":-1539647305,\"predicate\":\"rpc_answer_dropped\",\"params\":[{\"name\":\"msg_id\",\"type\":\"long\"},{\"name\":\"seq_no\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"int\"}],\"type\":\"RpcDropAnswer\"},{\"id\":155834844,\"predicate\":\"future_salt\",\"params\":[{\"name\":\"valid_since\",\"type\":\"int\"},{\"name\":\"valid_until\",\"type\":\"int\"},{\"name\":\"salt\",\"type\":\"long\"}],\"type\":\"FutureSalt\"},{\"id\":-1370486635,\"predicate\":\"future_salts\",\"params\":[{\"name\":\"req_msg_id\",\"type\":\"long\"},{\"name\":\"now\",\"type\":\"int\"},{\"name\":\"salts\",\"type\":\"vector\"}],\"type\":\"FutureSalts\"},{\"id\":880243653,\"predicate\":\"pong\",\"params\":[{\"name\":\"msg_id\",\"type\":\"long\"},{\"name\":\"ping_id\",\"type\":\"long\"}],\"type\":\"Pong\"},{\"id\":-501201412,\"predicate\":\"destroy_session_ok\",\"params\":[{\"name\":\"session_id\",\"type\":\"long\"}],\"type\":\"DestroySessionRes\"},{\"id\":1658015945,\"predicate\":\"destroy_session_none\",\"params\":[{\"name\":\"session_id\",\"type\":\"long\"}],\"type\":\"DestroySessionRes\"},{\"id\":-1631450872,\"predicate\":\"new_session_created\",\"params\":[{\"name\":\"first_msg_id\",\"type\":\"long\"},{\"name\":\"unique_id\",\"type\":\"long\"},{\"name\":\"server_salt\",\"type\":\"long\"}],\"type\":\"NewSession\"},{\"id\":1945237724,\"predicate\":\"msg_container\",\"params\":[{\"name\":\"messages\",\"type\":\"vector<%Message>\"}],\"type\":\"MessageContainer\"},{\"id\":1538843921,\"predicate\":\"message\",\"params\":[{\"name\":\"msg_id\",\"type\":\"long\"},{\"name\":\"seqno\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"int\"},{\"name\":\"body\",\"type\":\"Object\"}],\"type\":\"Message\"},{\"id\":-530561358,\"predicate\":\"msg_copy\",\"params\":[{\"name\":\"orig_message\",\"type\":\"Message\"}],\"type\":\"MessageCopy\"},{\"id\":812830625,\"predicate\":\"gzip_packed\",\"params\":[{\"name\":\"packed_data\",\"type\":\"bytes\"}],\"type\":\"Object\"},{\"id\":1658238041,\"predicate\":\"msgs_ack\",\"params\":[{\"name\":\"msg_ids\",\"type\":\"Vector\"}],\"type\":\"MsgsAck\"},{\"id\":-1477445615,\"predicate\":\"bad_msg_notification\",\"params\":[{\"name\":\"bad_msg_id\",\"type\":\"long\"},{\"name\":\"bad_msg_seqno\",\"type\":\"int\"},{\"name\":\"error_code\",\"type\":\"int\"}],\"type\":\"BadMsgNotification\"},{\"id\":-307542917,\"predicate\":\"bad_server_salt\",\"params\":[{\"name\":\"bad_msg_id\",\"type\":\"long\"},{\"name\":\"bad_msg_seqno\",\"type\":\"int\"},{\"name\":\"error_code\",\"type\":\"int\"},{\"name\":\"new_server_salt\",\"type\":\"long\"}],\"type\":\"BadMsgNotification\"},{\"id\":2105940488,\"predicate\":\"msg_resend_req\",\"params\":[{\"name\":\"msg_ids\",\"type\":\"Vector\"}],\"type\":\"MsgResendReq\"},{\"id\":-630588590,\"predicate\":\"msgs_state_req\",\"params\":[{\"name\":\"msg_ids\",\"type\":\"Vector\"}],\"type\":\"MsgsStateReq\"},{\"id\":81704317,\"predicate\":\"msgs_state_info\",\"params\":[{\"name\":\"req_msg_id\",\"type\":\"long\"},{\"name\":\"info\",\"type\":\"bytes\"}],\"type\":\"MsgsStateInfo\"},{\"id\":-1933520591,\"predicate\":\"msgs_all_info\",\"params\":[{\"name\":\"msg_ids\",\"type\":\"Vector\"},{\"name\":\"info\",\"type\":\"bytes\"}],\"type\":\"MsgsAllInfo\"},{\"id\":661470918,\"predicate\":\"msg_detailed_info\",\"params\":[{\"name\":\"msg_id\",\"type\":\"long\"},{\"name\":\"answer_msg_id\",\"type\":\"long\"},{\"name\":\"bytes\",\"type\":\"int\"},{\"name\":\"status\",\"type\":\"int\"}],\"type\":\"MsgDetailedInfo\"},{\"id\":-2137147681,\"predicate\":\"msg_new_detailed_info\",\"params\":[{\"name\":\"answer_msg_id\",\"type\":\"long\"},{\"name\":\"bytes\",\"type\":\"int\"},{\"name\":\"status\",\"type\":\"int\"}],\"type\":\"MsgDetailedInfo\"},{\"id\":-161422892,\"predicate\":\"destroy_auth_key_ok\",\"params\":[],\"type\":\"DestroyAuthKeyRes\"},{\"id\":178201177,\"predicate\":\"destroy_auth_key_none\",\"params\":[],\"type\":\"DestroyAuthKeyRes\"},{\"id\":-368010477,\"predicate\":\"destroy_auth_key_fail\",\"params\":[],\"type\":\"DestroyAuthKeyRes\"}],\"methods\":[{\"id\":-1099002127,\"method\":\"req_pq_multi\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"}],\"type\":\"ResPQ\"},{\"id\":-686627650,\"method\":\"req_DH_params\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"p\",\"type\":\"bytes\"},{\"name\":\"q\",\"type\":\"bytes\"},{\"name\":\"public_key_fingerprint\",\"type\":\"long\"},{\"name\":\"encrypted_data\",\"type\":\"bytes\"}],\"type\":\"Server_DH_Params\"},{\"id\":-184262881,\"method\":\"set_client_DH_params\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"encrypted_data\",\"type\":\"bytes\"}],\"type\":\"Set_client_DH_params_answer\"},{\"id\":1491380032,\"method\":\"rpc_drop_answer\",\"params\":[{\"name\":\"req_msg_id\",\"type\":\"long\"}],\"type\":\"RpcDropAnswer\"},{\"id\":-1188971260,\"method\":\"get_future_salts\",\"params\":[{\"name\":\"num\",\"type\":\"int\"}],\"type\":\"FutureSalts\"},{\"id\":2059302892,\"method\":\"ping\",\"params\":[{\"name\":\"ping_id\",\"type\":\"long\"}],\"type\":\"Pong\"},{\"id\":-213746804,\"method\":\"ping_delay_disconnect\",\"params\":[{\"name\":\"ping_id\",\"type\":\"long\"},{\"name\":\"disconnect_delay\",\"type\":\"int\"}],\"type\":\"Pong\"},{\"id\":-414113498,\"method\":\"destroy_session\",\"params\":[{\"name\":\"session_id\",\"type\":\"long\"}],\"type\":\"DestroySessionRes\"},{\"id\":-1835453025,\"method\":\"http_wait\",\"params\":[{\"name\":\"max_delay\",\"type\":\"int\"},{\"name\":\"wait_after\",\"type\":\"int\"},{\"name\":\"max_wait\",\"type\":\"int\"}],\"type\":\"HttpWait\"},{\"id\":-784117408,\"method\":\"destroy_auth_key\",\"params\":[],\"type\":\"DestroyAuthKeyRes\"}]},\"API\":{\"constructors\":[{\"id\":-1132882121,\"predicate\":\"boolFalse\",\"params\":[],\"type\":\"Bool\"},{\"id\":-1720552011,\"predicate\":\"boolTrue\",\"params\":[],\"type\":\"Bool\"},{\"id\":1072550713,\"predicate\":\"true\",\"params\":[],\"type\":\"True\"},{\"id\":481674261,\"predicate\":\"vector\",\"params\":[],\"type\":\"Vector t\"},{\"id\":-994444869,\"predicate\":\"error\",\"params\":[{\"name\":\"code\",\"type\":\"int\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"Error\"},{\"id\":1450380236,\"predicate\":\"null\",\"params\":[],\"type\":\"Null\"},{\"id\":2134579434,\"predicate\":\"inputPeerEmpty\",\"params\":[],\"type\":\"InputPeer\"},{\"id\":2107670217,\"predicate\":\"inputPeerSelf\",\"params\":[],\"type\":\"InputPeer\"},{\"id\":900291769,\"predicate\":\"inputPeerChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"}],\"type\":\"InputPeer\"},{\"id\":-1182234929,\"predicate\":\"inputUserEmpty\",\"params\":[],\"type\":\"InputUser\"},{\"id\":-138301121,\"predicate\":\"inputUserSelf\",\"params\":[],\"type\":\"InputUser\"},{\"id\":-208488460,\"predicate\":\"inputPhoneContact\",\"params\":[{\"name\":\"client_id\",\"type\":\"long\"},{\"name\":\"phone\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"}],\"type\":\"InputContact\"},{\"id\":-181407105,\"predicate\":\"inputFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"parts\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"md5_checksum\",\"type\":\"string\"}],\"type\":\"InputFile\"},{\"id\":-1771768449,\"predicate\":\"inputMediaEmpty\",\"params\":[],\"type\":\"InputMedia\"},{\"id\":505969924,\"predicate\":\"inputMediaUploadedPhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"spoiler\",\"type\":\"flags.2?true\"},{\"name\":\"file\",\"type\":\"InputFile\"},{\"name\":\"stickers\",\"type\":\"flags.0?Vector\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.1?int\"}],\"type\":\"InputMedia\"},{\"id\":-1279654347,\"predicate\":\"inputMediaPhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"spoiler\",\"type\":\"flags.1?true\"},{\"name\":\"id\",\"type\":\"InputPhoto\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.0?int\"}],\"type\":\"InputMedia\"},{\"id\":-104578748,\"predicate\":\"inputMediaGeoPoint\",\"params\":[{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"}],\"type\":\"InputMedia\"},{\"id\":-122978821,\"predicate\":\"inputMediaContact\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"vcard\",\"type\":\"string\"}],\"type\":\"InputMedia\"},{\"id\":480546647,\"predicate\":\"inputChatPhotoEmpty\",\"params\":[],\"type\":\"InputChatPhoto\"},{\"id\":-1110593856,\"predicate\":\"inputChatUploadedPhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"file\",\"type\":\"flags.0?InputFile\"},{\"name\":\"video\",\"type\":\"flags.1?InputFile\"},{\"name\":\"video_start_ts\",\"type\":\"flags.2?double\"},{\"name\":\"video_emoji_markup\",\"type\":\"flags.3?VideoSize\"}],\"type\":\"InputChatPhoto\"},{\"id\":-1991004873,\"predicate\":\"inputChatPhoto\",\"params\":[{\"name\":\"id\",\"type\":\"InputPhoto\"}],\"type\":\"InputChatPhoto\"},{\"id\":-457104426,\"predicate\":\"inputGeoPointEmpty\",\"params\":[],\"type\":\"InputGeoPoint\"},{\"id\":1210199983,\"predicate\":\"inputGeoPoint\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"lat\",\"type\":\"double\"},{\"name\":\"long\",\"type\":\"double\"},{\"name\":\"accuracy_radius\",\"type\":\"flags.0?int\"}],\"type\":\"InputGeoPoint\"},{\"id\":483901197,\"predicate\":\"inputPhotoEmpty\",\"params\":[],\"type\":\"InputPhoto\"},{\"id\":1001634122,\"predicate\":\"inputPhoto\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"}],\"type\":\"InputPhoto\"},{\"id\":-539317279,\"predicate\":\"inputFileLocation\",\"params\":[{\"name\":\"volume_id\",\"type\":\"long\"},{\"name\":\"local_id\",\"type\":\"int\"},{\"name\":\"secret\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"}],\"type\":\"InputFileLocation\"},{\"id\":1498486562,\"predicate\":\"peerUser\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"Peer\"},{\"id\":918946202,\"predicate\":\"peerChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"}],\"type\":\"Peer\"},{\"id\":-1432995067,\"predicate\":\"storage.fileUnknown\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":1086091090,\"predicate\":\"storage.filePartial\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":8322574,\"predicate\":\"storage.fileJpeg\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":-891180321,\"predicate\":\"storage.fileGif\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":172975040,\"predicate\":\"storage.filePng\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":-1373745011,\"predicate\":\"storage.filePdf\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":1384777335,\"predicate\":\"storage.fileMp3\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":1258941372,\"predicate\":\"storage.fileMov\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":-1278304028,\"predicate\":\"storage.fileMp4\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":276907596,\"predicate\":\"storage.fileWebp\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":-742634630,\"predicate\":\"userEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"User\"},{\"id\":1326562017,\"predicate\":\"userProfilePhotoEmpty\",\"params\":[],\"type\":\"UserProfilePhoto\"},{\"id\":-2100168954,\"predicate\":\"userProfilePhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"has_video\",\"type\":\"flags.0?true\"},{\"name\":\"personal\",\"type\":\"flags.2?true\"},{\"name\":\"photo_id\",\"type\":\"long\"},{\"name\":\"stripped_thumb\",\"type\":\"flags.1?bytes\"},{\"name\":\"dc_id\",\"type\":\"int\"}],\"type\":\"UserProfilePhoto\"},{\"id\":164646985,\"predicate\":\"userStatusEmpty\",\"params\":[],\"type\":\"UserStatus\"},{\"id\":-306628279,\"predicate\":\"userStatusOnline\",\"params\":[{\"name\":\"expires\",\"type\":\"int\"}],\"type\":\"UserStatus\"},{\"id\":9203775,\"predicate\":\"userStatusOffline\",\"params\":[{\"name\":\"was_online\",\"type\":\"int\"}],\"type\":\"UserStatus\"},{\"id\":693512293,\"predicate\":\"chatEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"Chat\"},{\"id\":1103884886,\"predicate\":\"chat\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"creator\",\"type\":\"flags.0?true\"},{\"name\":\"left\",\"type\":\"flags.2?true\"},{\"name\":\"deactivated\",\"type\":\"flags.5?true\"},{\"name\":\"call_active\",\"type\":\"flags.23?true\"},{\"name\":\"call_not_empty\",\"type\":\"flags.24?true\"},{\"name\":\"noforwards\",\"type\":\"flags.25?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"ChatPhoto\"},{\"name\":\"participants_count\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"int\"},{\"name\":\"migrated_to\",\"type\":\"flags.6?InputChannel\"},{\"name\":\"admin_rights\",\"type\":\"flags.14?ChatAdminRights\"},{\"name\":\"default_banned_rights\",\"type\":\"flags.18?ChatBannedRights\"}],\"type\":\"Chat\"},{\"id\":1704108455,\"predicate\":\"chatForbidden\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"Chat\"},{\"id\":-908914376,\"predicate\":\"chatFull\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"can_set_username\",\"type\":\"flags.7?true\"},{\"name\":\"has_scheduled\",\"type\":\"flags.8?true\"},{\"name\":\"translations_disabled\",\"type\":\"flags.19?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"about\",\"type\":\"string\"},{\"name\":\"participants\",\"type\":\"ChatParticipants\"},{\"name\":\"chat_photo\",\"type\":\"flags.2?Photo\"},{\"name\":\"notify_settings\",\"type\":\"PeerNotifySettings\"},{\"name\":\"exported_invite\",\"type\":\"flags.13?ExportedChatInvite\"},{\"name\":\"bot_info\",\"type\":\"flags.3?Vector\"},{\"name\":\"pinned_msg_id\",\"type\":\"flags.6?int\"},{\"name\":\"folder_id\",\"type\":\"flags.11?int\"},{\"name\":\"call\",\"type\":\"flags.12?InputGroupCall\"},{\"name\":\"ttl_period\",\"type\":\"flags.14?int\"},{\"name\":\"groupcall_default_join_as\",\"type\":\"flags.15?Peer\"},{\"name\":\"theme_emoticon\",\"type\":\"flags.16?string\"},{\"name\":\"requests_pending\",\"type\":\"flags.17?int\"},{\"name\":\"recent_requesters\",\"type\":\"flags.17?Vector\"},{\"name\":\"available_reactions\",\"type\":\"flags.18?ChatReactions\"}],\"type\":\"ChatFull\"},{\"id\":-1070776313,\"predicate\":\"chatParticipant\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"inviter_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"ChatParticipant\"},{\"id\":-2023500831,\"predicate\":\"chatParticipantsForbidden\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"self_participant\",\"type\":\"flags.0?ChatParticipant\"}],\"type\":\"ChatParticipants\"},{\"id\":1018991608,\"predicate\":\"chatParticipants\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"participants\",\"type\":\"Vector\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"ChatParticipants\"},{\"id\":935395612,\"predicate\":\"chatPhotoEmpty\",\"params\":[],\"type\":\"ChatPhoto\"},{\"id\":476978193,\"predicate\":\"chatPhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"has_video\",\"type\":\"flags.0?true\"},{\"name\":\"photo_id\",\"type\":\"long\"},{\"name\":\"stripped_thumb\",\"type\":\"flags.1?bytes\"},{\"name\":\"dc_id\",\"type\":\"int\"}],\"type\":\"ChatPhoto\"},{\"id\":-1868117372,\"predicate\":\"messageEmpty\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"peer_id\",\"type\":\"flags.0?Peer\"}],\"type\":\"Message\"},{\"id\":940666592,\"predicate\":\"message\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"out\",\"type\":\"flags.1?true\"},{\"name\":\"mentioned\",\"type\":\"flags.4?true\"},{\"name\":\"media_unread\",\"type\":\"flags.5?true\"},{\"name\":\"silent\",\"type\":\"flags.13?true\"},{\"name\":\"post\",\"type\":\"flags.14?true\"},{\"name\":\"from_scheduled\",\"type\":\"flags.18?true\"},{\"name\":\"legacy\",\"type\":\"flags.19?true\"},{\"name\":\"edit_hide\",\"type\":\"flags.21?true\"},{\"name\":\"pinned\",\"type\":\"flags.24?true\"},{\"name\":\"noforwards\",\"type\":\"flags.26?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"from_id\",\"type\":\"flags.8?Peer\"},{\"name\":\"peer_id\",\"type\":\"Peer\"},{\"name\":\"fwd_from\",\"type\":\"flags.2?MessageFwdHeader\"},{\"name\":\"via_bot_id\",\"type\":\"flags.11?long\"},{\"name\":\"reply_to\",\"type\":\"flags.3?MessageReplyHeader\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"media\",\"type\":\"flags.9?MessageMedia\"},{\"name\":\"reply_markup\",\"type\":\"flags.6?ReplyMarkup\"},{\"name\":\"entities\",\"type\":\"flags.7?Vector\"},{\"name\":\"views\",\"type\":\"flags.10?int\"},{\"name\":\"forwards\",\"type\":\"flags.10?int\"},{\"name\":\"replies\",\"type\":\"flags.23?MessageReplies\"},{\"name\":\"edit_date\",\"type\":\"flags.15?int\"},{\"name\":\"post_author\",\"type\":\"flags.16?string\"},{\"name\":\"grouped_id\",\"type\":\"flags.17?long\"},{\"name\":\"reactions\",\"type\":\"flags.20?MessageReactions\"},{\"name\":\"restriction_reason\",\"type\":\"flags.22?Vector\"},{\"name\":\"ttl_period\",\"type\":\"flags.25?int\"}],\"type\":\"Message\"},{\"id\":721967202,\"predicate\":\"messageService\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"out\",\"type\":\"flags.1?true\"},{\"name\":\"mentioned\",\"type\":\"flags.4?true\"},{\"name\":\"media_unread\",\"type\":\"flags.5?true\"},{\"name\":\"silent\",\"type\":\"flags.13?true\"},{\"name\":\"post\",\"type\":\"flags.14?true\"},{\"name\":\"legacy\",\"type\":\"flags.19?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"from_id\",\"type\":\"flags.8?Peer\"},{\"name\":\"peer_id\",\"type\":\"Peer\"},{\"name\":\"reply_to\",\"type\":\"flags.3?MessageReplyHeader\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"action\",\"type\":\"MessageAction\"},{\"name\":\"ttl_period\",\"type\":\"flags.25?int\"}],\"type\":\"Message\"},{\"id\":1038967584,\"predicate\":\"messageMediaEmpty\",\"params\":[],\"type\":\"MessageMedia\"},{\"id\":1766936791,\"predicate\":\"messageMediaPhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"spoiler\",\"type\":\"flags.3?true\"},{\"name\":\"photo\",\"type\":\"flags.0?Photo\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.2?int\"}],\"type\":\"MessageMedia\"},{\"id\":1457575028,\"predicate\":\"messageMediaGeo\",\"params\":[{\"name\":\"geo\",\"type\":\"GeoPoint\"}],\"type\":\"MessageMedia\"},{\"id\":1882335561,\"predicate\":\"messageMediaContact\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"vcard\",\"type\":\"string\"},{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"MessageMedia\"},{\"id\":-1618676578,\"predicate\":\"messageMediaUnsupported\",\"params\":[],\"type\":\"MessageMedia\"},{\"id\":-1230047312,\"predicate\":\"messageActionEmpty\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":-1119368275,\"predicate\":\"messageActionChatCreate\",\"params\":[{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"MessageAction\"},{\"id\":-1247687078,\"predicate\":\"messageActionChatEditTitle\",\"params\":[{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":2144015272,\"predicate\":\"messageActionChatEditPhoto\",\"params\":[{\"name\":\"photo\",\"type\":\"Photo\"}],\"type\":\"MessageAction\"},{\"id\":-1780220945,\"predicate\":\"messageActionChatDeletePhoto\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":365886720,\"predicate\":\"messageActionChatAddUser\",\"params\":[{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"MessageAction\"},{\"id\":-1539362612,\"predicate\":\"messageActionChatDeleteUser\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"MessageAction\"},{\"id\":-712374074,\"predicate\":\"dialog\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.2?true\"},{\"name\":\"unread_mark\",\"type\":\"flags.3?true\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"top_message\",\"type\":\"int\"},{\"name\":\"read_inbox_max_id\",\"type\":\"int\"},{\"name\":\"read_outbox_max_id\",\"type\":\"int\"},{\"name\":\"unread_count\",\"type\":\"int\"},{\"name\":\"unread_mentions_count\",\"type\":\"int\"},{\"name\":\"unread_reactions_count\",\"type\":\"int\"},{\"name\":\"notify_settings\",\"type\":\"PeerNotifySettings\"},{\"name\":\"pts\",\"type\":\"flags.0?int\"},{\"name\":\"draft\",\"type\":\"flags.1?DraftMessage\"},{\"name\":\"folder_id\",\"type\":\"flags.4?int\"},{\"name\":\"ttl_period\",\"type\":\"flags.5?int\"}],\"type\":\"Dialog\"},{\"id\":590459437,\"predicate\":\"photoEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"Photo\"},{\"id\":-82216347,\"predicate\":\"photo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"has_stickers\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"sizes\",\"type\":\"Vector\"},{\"name\":\"video_sizes\",\"type\":\"flags.1?Vector\"},{\"name\":\"dc_id\",\"type\":\"int\"}],\"type\":\"Photo\"},{\"id\":236446268,\"predicate\":\"photoSizeEmpty\",\"params\":[{\"name\":\"type\",\"type\":\"string\"}],\"type\":\"PhotoSize\"},{\"id\":1976012384,\"predicate\":\"photoSize\",\"params\":[{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"},{\"name\":\"size\",\"type\":\"int\"}],\"type\":\"PhotoSize\"},{\"id\":35527382,\"predicate\":\"photoCachedSize\",\"params\":[{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"PhotoSize\"},{\"id\":286776671,\"predicate\":\"geoPointEmpty\",\"params\":[],\"type\":\"GeoPoint\"},{\"id\":-1297942941,\"predicate\":\"geoPoint\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"long\",\"type\":\"double\"},{\"name\":\"lat\",\"type\":\"double\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"accuracy_radius\",\"type\":\"flags.0?int\"}],\"type\":\"GeoPoint\"},{\"id\":1577067778,\"predicate\":\"auth.sentCode\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"type\",\"type\":\"auth.SentCodeType\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"next_type\",\"type\":\"flags.1?auth.CodeType\"},{\"name\":\"timeout\",\"type\":\"flags.2?int\"}],\"type\":\"auth.SentCode\"},{\"id\":782418132,\"predicate\":\"auth.authorization\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"setup_password_required\",\"type\":\"flags.1?true\"},{\"name\":\"otherwise_relogin_days\",\"type\":\"flags.1?int\"},{\"name\":\"tmp_sessions\",\"type\":\"flags.0?int\"},{\"name\":\"future_auth_token\",\"type\":\"flags.2?bytes\"},{\"name\":\"user\",\"type\":\"User\"}],\"type\":\"auth.Authorization\"},{\"id\":-1271602504,\"predicate\":\"auth.exportedAuthorization\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"auth.ExportedAuthorization\"},{\"id\":-1195615476,\"predicate\":\"inputNotifyPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"InputNotifyPeer\"},{\"id\":423314455,\"predicate\":\"inputNotifyUsers\",\"params\":[],\"type\":\"InputNotifyPeer\"},{\"id\":1251338318,\"predicate\":\"inputNotifyChats\",\"params\":[],\"type\":\"InputNotifyPeer\"},{\"id\":-551616469,\"predicate\":\"inputPeerNotifySettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"show_previews\",\"type\":\"flags.0?Bool\"},{\"name\":\"silent\",\"type\":\"flags.1?Bool\"},{\"name\":\"mute_until\",\"type\":\"flags.2?int\"},{\"name\":\"sound\",\"type\":\"flags.3?NotificationSound\"}],\"type\":\"InputPeerNotifySettings\"},{\"id\":-1472527322,\"predicate\":\"peerNotifySettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"show_previews\",\"type\":\"flags.0?Bool\"},{\"name\":\"silent\",\"type\":\"flags.1?Bool\"},{\"name\":\"mute_until\",\"type\":\"flags.2?int\"},{\"name\":\"ios_sound\",\"type\":\"flags.3?NotificationSound\"},{\"name\":\"android_sound\",\"type\":\"flags.4?NotificationSound\"},{\"name\":\"other_sound\",\"type\":\"flags.5?NotificationSound\"}],\"type\":\"PeerNotifySettings\"},{\"id\":-1525149427,\"predicate\":\"peerSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"report_spam\",\"type\":\"flags.0?true\"},{\"name\":\"add_contact\",\"type\":\"flags.1?true\"},{\"name\":\"block_contact\",\"type\":\"flags.2?true\"},{\"name\":\"share_contact\",\"type\":\"flags.3?true\"},{\"name\":\"need_contacts_exception\",\"type\":\"flags.4?true\"},{\"name\":\"report_geo\",\"type\":\"flags.5?true\"},{\"name\":\"autoarchived\",\"type\":\"flags.7?true\"},{\"name\":\"invite_members\",\"type\":\"flags.8?true\"},{\"name\":\"request_chat_broadcast\",\"type\":\"flags.10?true\"},{\"name\":\"geo_distance\",\"type\":\"flags.6?int\"},{\"name\":\"request_chat_title\",\"type\":\"flags.9?string\"},{\"name\":\"request_chat_date\",\"type\":\"flags.9?int\"}],\"type\":\"PeerSettings\"},{\"id\":-1539849235,\"predicate\":\"wallPaper\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"creator\",\"type\":\"flags.0?true\"},{\"name\":\"default\",\"type\":\"flags.1?true\"},{\"name\":\"pattern\",\"type\":\"flags.3?true\"},{\"name\":\"dark\",\"type\":\"flags.4?true\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"slug\",\"type\":\"string\"},{\"name\":\"document\",\"type\":\"Document\"},{\"name\":\"settings\",\"type\":\"flags.2?WallPaperSettings\"}],\"type\":\"WallPaper\"},{\"id\":1490799288,\"predicate\":\"inputReportReasonSpam\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":505595789,\"predicate\":\"inputReportReasonViolence\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":777640226,\"predicate\":\"inputReportReasonPornography\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":-1376497949,\"predicate\":\"inputReportReasonChildAbuse\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":-1041980751,\"predicate\":\"inputReportReasonOther\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":-120378643,\"predicate\":\"userFull\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"blocked\",\"type\":\"flags.0?true\"},{\"name\":\"phone_calls_available\",\"type\":\"flags.4?true\"},{\"name\":\"phone_calls_private\",\"type\":\"flags.5?true\"},{\"name\":\"can_pin_message\",\"type\":\"flags.7?true\"},{\"name\":\"has_scheduled\",\"type\":\"flags.12?true\"},{\"name\":\"video_calls_available\",\"type\":\"flags.13?true\"},{\"name\":\"voice_messages_forbidden\",\"type\":\"flags.20?true\"},{\"name\":\"translations_disabled\",\"type\":\"flags.23?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"about\",\"type\":\"flags.1?string\"},{\"name\":\"settings\",\"type\":\"PeerSettings\"},{\"name\":\"personal_photo\",\"type\":\"flags.21?Photo\"},{\"name\":\"profile_photo\",\"type\":\"flags.2?Photo\"},{\"name\":\"fallback_photo\",\"type\":\"flags.22?Photo\"},{\"name\":\"notify_settings\",\"type\":\"PeerNotifySettings\"},{\"name\":\"bot_info\",\"type\":\"flags.3?BotInfo\"},{\"name\":\"pinned_msg_id\",\"type\":\"flags.6?int\"},{\"name\":\"common_chats_count\",\"type\":\"int\"},{\"name\":\"folder_id\",\"type\":\"flags.11?int\"},{\"name\":\"ttl_period\",\"type\":\"flags.14?int\"},{\"name\":\"theme_emoticon\",\"type\":\"flags.15?string\"},{\"name\":\"private_forward_name\",\"type\":\"flags.16?string\"},{\"name\":\"bot_group_admin_rights\",\"type\":\"flags.17?ChatAdminRights\"},{\"name\":\"bot_broadcast_admin_rights\",\"type\":\"flags.18?ChatAdminRights\"},{\"name\":\"premium_gifts\",\"type\":\"flags.19?Vector\"}],\"type\":\"UserFull\"},{\"id\":341499403,\"predicate\":\"contact\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"mutual\",\"type\":\"Bool\"}],\"type\":\"Contact\"},{\"id\":-1052885936,\"predicate\":\"importedContact\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"client_id\",\"type\":\"long\"}],\"type\":\"ImportedContact\"},{\"id\":383348795,\"predicate\":\"contactStatus\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"status\",\"type\":\"UserStatus\"}],\"type\":\"ContactStatus\"},{\"id\":-1219778094,\"predicate\":\"contacts.contactsNotModified\",\"params\":[],\"type\":\"contacts.Contacts\"},{\"id\":-353862078,\"predicate\":\"contacts.contacts\",\"params\":[{\"name\":\"contacts\",\"type\":\"Vector\"},{\"name\":\"saved_count\",\"type\":\"int\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.Contacts\"},{\"id\":2010127419,\"predicate\":\"contacts.importedContacts\",\"params\":[{\"name\":\"imported\",\"type\":\"Vector\"},{\"name\":\"popular_invites\",\"type\":\"Vector\"},{\"name\":\"retry_contacts\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.ImportedContacts\"},{\"id\":182326673,\"predicate\":\"contacts.blocked\",\"params\":[{\"name\":\"blocked\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.Blocked\"},{\"id\":-513392236,\"predicate\":\"contacts.blockedSlice\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"blocked\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.Blocked\"},{\"id\":364538944,\"predicate\":\"messages.dialogs\",\"params\":[{\"name\":\"dialogs\",\"type\":\"Vector\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.Dialogs\"},{\"id\":1910543603,\"predicate\":\"messages.dialogsSlice\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"dialogs\",\"type\":\"Vector\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.Dialogs\"},{\"id\":-1938715001,\"predicate\":\"messages.messages\",\"params\":[{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":978610270,\"predicate\":\"messages.messagesSlice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"inexact\",\"type\":\"flags.1?true\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"next_rate\",\"type\":\"flags.0?int\"},{\"name\":\"offset_id_offset\",\"type\":\"flags.2?int\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":1694474197,\"predicate\":\"messages.chats\",\"params\":[{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"messages.Chats\"},{\"id\":-438840932,\"predicate\":\"messages.chatFull\",\"params\":[{\"name\":\"full_chat\",\"type\":\"ChatFull\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.ChatFull\"},{\"id\":-1269012015,\"predicate\":\"messages.affectedHistory\",\"params\":[{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"},{\"name\":\"offset\",\"type\":\"int\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":1474492012,\"predicate\":\"inputMessagesFilterEmpty\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1777752804,\"predicate\":\"inputMessagesFilterPhotos\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1614803355,\"predicate\":\"inputMessagesFilterVideo\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":1458172132,\"predicate\":\"inputMessagesFilterPhotoVideo\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1629621880,\"predicate\":\"inputMessagesFilterDocument\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":2129714567,\"predicate\":\"inputMessagesFilterUrl\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-3644025,\"predicate\":\"inputMessagesFilterGif\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":522914557,\"predicate\":\"updateNewMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":1318109142,\"predicate\":\"updateMessageID\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"random_id\",\"type\":\"long\"}],\"type\":\"Update\"},{\"id\":-1576161051,\"predicate\":\"updateDeleteMessages\",\"params\":[{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1071741569,\"predicate\":\"updateUserTyping\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"action\",\"type\":\"SendMessageAction\"}],\"type\":\"Update\"},{\"id\":-2092401936,\"predicate\":\"updateChatUserTyping\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"from_id\",\"type\":\"Peer\"},{\"name\":\"action\",\"type\":\"SendMessageAction\"}],\"type\":\"Update\"},{\"id\":125178264,\"predicate\":\"updateChatParticipants\",\"params\":[{\"name\":\"participants\",\"type\":\"ChatParticipants\"}],\"type\":\"Update\"},{\"id\":-440534818,\"predicate\":\"updateUserStatus\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"status\",\"type\":\"UserStatus\"}],\"type\":\"Update\"},{\"id\":-1484486364,\"predicate\":\"updateUserName\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"usernames\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":-1519637954,\"predicate\":\"updates.state\",\"params\":[{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"qts\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"seq\",\"type\":\"int\"},{\"name\":\"unread_count\",\"type\":\"int\"}],\"type\":\"updates.State\"},{\"id\":1567990072,\"predicate\":\"updates.differenceEmpty\",\"params\":[{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"seq\",\"type\":\"int\"}],\"type\":\"updates.Difference\"},{\"id\":16030880,\"predicate\":\"updates.difference\",\"params\":[{\"name\":\"new_messages\",\"type\":\"Vector\"},{\"name\":\"new_encrypted_messages\",\"type\":\"Vector\"},{\"name\":\"other_updates\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"state\",\"type\":\"updates.State\"}],\"type\":\"updates.Difference\"},{\"id\":-1459938943,\"predicate\":\"updates.differenceSlice\",\"params\":[{\"name\":\"new_messages\",\"type\":\"Vector\"},{\"name\":\"new_encrypted_messages\",\"type\":\"Vector\"},{\"name\":\"other_updates\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"intermediate_state\",\"type\":\"updates.State\"}],\"type\":\"updates.Difference\"},{\"id\":-484987010,\"predicate\":\"updatesTooLong\",\"params\":[],\"type\":\"Updates\"},{\"id\":826001400,\"predicate\":\"updateShortMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"out\",\"type\":\"flags.1?true\"},{\"name\":\"mentioned\",\"type\":\"flags.4?true\"},{\"name\":\"media_unread\",\"type\":\"flags.5?true\"},{\"name\":\"silent\",\"type\":\"flags.13?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"fwd_from\",\"type\":\"flags.2?MessageFwdHeader\"},{\"name\":\"via_bot_id\",\"type\":\"flags.11?long\"},{\"name\":\"reply_to\",\"type\":\"flags.3?MessageReplyHeader\"},{\"name\":\"entities\",\"type\":\"flags.7?Vector\"},{\"name\":\"ttl_period\",\"type\":\"flags.25?int\"}],\"type\":\"Updates\"},{\"id\":1299050149,\"predicate\":\"updateShortChatMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"out\",\"type\":\"flags.1?true\"},{\"name\":\"mentioned\",\"type\":\"flags.4?true\"},{\"name\":\"media_unread\",\"type\":\"flags.5?true\"},{\"name\":\"silent\",\"type\":\"flags.13?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"from_id\",\"type\":\"long\"},{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"fwd_from\",\"type\":\"flags.2?MessageFwdHeader\"},{\"name\":\"via_bot_id\",\"type\":\"flags.11?long\"},{\"name\":\"reply_to\",\"type\":\"flags.3?MessageReplyHeader\"},{\"name\":\"entities\",\"type\":\"flags.7?Vector\"},{\"name\":\"ttl_period\",\"type\":\"flags.25?int\"}],\"type\":\"Updates\"},{\"id\":2027216577,\"predicate\":\"updateShort\",\"params\":[{\"name\":\"update\",\"type\":\"Update\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":1918567619,\"predicate\":\"updatesCombined\",\"params\":[{\"name\":\"updates\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"seq_start\",\"type\":\"int\"},{\"name\":\"seq\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":1957577280,\"predicate\":\"updates\",\"params\":[{\"name\":\"updates\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"seq\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":-1916114267,\"predicate\":\"photos.photos\",\"params\":[{\"name\":\"photos\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"photos.Photos\"},{\"id\":352657236,\"predicate\":\"photos.photosSlice\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"photos\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"photos.Photos\"},{\"id\":539045032,\"predicate\":\"photos.photo\",\"params\":[{\"name\":\"photo\",\"type\":\"Photo\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"photos.Photo\"},{\"id\":157948117,\"predicate\":\"upload.file\",\"params\":[{\"name\":\"type\",\"type\":\"storage.FileType\"},{\"name\":\"mtime\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"upload.File\"},{\"id\":414687501,\"predicate\":\"dcOption\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"ipv6\",\"type\":\"flags.0?true\"},{\"name\":\"media_only\",\"type\":\"flags.1?true\"},{\"name\":\"tcpo_only\",\"type\":\"flags.2?true\"},{\"name\":\"cdn\",\"type\":\"flags.3?true\"},{\"name\":\"static\",\"type\":\"flags.4?true\"},{\"name\":\"this_port_only\",\"type\":\"flags.5?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"ip_address\",\"type\":\"string\"},{\"name\":\"port\",\"type\":\"int\"},{\"name\":\"secret\",\"type\":\"flags.10?bytes\"}],\"type\":\"DcOption\"},{\"id\":589653676,\"predicate\":\"config\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"phonecalls_enabled\",\"type\":\"flags.1?true\"},{\"name\":\"default_p2p_contacts\",\"type\":\"flags.3?true\"},{\"name\":\"preload_featured_stickers\",\"type\":\"flags.4?true\"},{\"name\":\"ignore_phone_entities\",\"type\":\"flags.5?true\"},{\"name\":\"revoke_pm_inbox\",\"type\":\"flags.6?true\"},{\"name\":\"blocked_mode\",\"type\":\"flags.8?true\"},{\"name\":\"pfs_enabled\",\"type\":\"flags.13?true\"},{\"name\":\"force_try_ipv6\",\"type\":\"flags.14?true\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"expires\",\"type\":\"int\"},{\"name\":\"test_mode\",\"type\":\"Bool\"},{\"name\":\"this_dc\",\"type\":\"int\"},{\"name\":\"dc_options\",\"type\":\"Vector\"},{\"name\":\"dc_txt_domain_name\",\"type\":\"string\"},{\"name\":\"chat_size_max\",\"type\":\"int\"},{\"name\":\"megagroup_size_max\",\"type\":\"int\"},{\"name\":\"forwarded_count_max\",\"type\":\"int\"},{\"name\":\"online_update_period_ms\",\"type\":\"int\"},{\"name\":\"offline_blur_timeout_ms\",\"type\":\"int\"},{\"name\":\"offline_idle_timeout_ms\",\"type\":\"int\"},{\"name\":\"online_cloud_timeout_ms\",\"type\":\"int\"},{\"name\":\"notify_cloud_delay_ms\",\"type\":\"int\"},{\"name\":\"notify_default_delay_ms\",\"type\":\"int\"},{\"name\":\"push_chat_period_ms\",\"type\":\"int\"},{\"name\":\"push_chat_limit\",\"type\":\"int\"},{\"name\":\"saved_gifs_limit\",\"type\":\"int\"},{\"name\":\"edit_time_limit\",\"type\":\"int\"},{\"name\":\"revoke_time_limit\",\"type\":\"int\"},{\"name\":\"revoke_pm_time_limit\",\"type\":\"int\"},{\"name\":\"rating_e_decay\",\"type\":\"int\"},{\"name\":\"stickers_recent_limit\",\"type\":\"int\"},{\"name\":\"stickers_faved_limit\",\"type\":\"int\"},{\"name\":\"channels_read_media_period\",\"type\":\"int\"},{\"name\":\"tmp_sessions\",\"type\":\"flags.0?int\"},{\"name\":\"pinned_dialogs_count_max\",\"type\":\"int\"},{\"name\":\"pinned_infolder_count_max\",\"type\":\"int\"},{\"name\":\"call_receive_timeout_ms\",\"type\":\"int\"},{\"name\":\"call_ring_timeout_ms\",\"type\":\"int\"},{\"name\":\"call_connect_timeout_ms\",\"type\":\"int\"},{\"name\":\"call_packet_timeout_ms\",\"type\":\"int\"},{\"name\":\"me_url_prefix\",\"type\":\"string\"},{\"name\":\"autoupdate_url_prefix\",\"type\":\"flags.7?string\"},{\"name\":\"gif_search_username\",\"type\":\"flags.9?string\"},{\"name\":\"venue_search_username\",\"type\":\"flags.10?string\"},{\"name\":\"img_search_username\",\"type\":\"flags.11?string\"},{\"name\":\"static_maps_provider\",\"type\":\"flags.12?string\"},{\"name\":\"caption_length_max\",\"type\":\"int\"},{\"name\":\"message_length_max\",\"type\":\"int\"},{\"name\":\"webfile_dc_id\",\"type\":\"int\"},{\"name\":\"suggested_lang_code\",\"type\":\"flags.2?string\"},{\"name\":\"lang_pack_version\",\"type\":\"flags.2?int\"},{\"name\":\"base_lang_pack_version\",\"type\":\"flags.2?int\"},{\"name\":\"reactions_default\",\"type\":\"flags.15?Reaction\"}],\"type\":\"Config\"},{\"id\":-1910892683,\"predicate\":\"nearestDc\",\"params\":[{\"name\":\"country\",\"type\":\"string\"},{\"name\":\"this_dc\",\"type\":\"int\"},{\"name\":\"nearest_dc\",\"type\":\"int\"}],\"type\":\"NearestDc\"},{\"id\":-860107216,\"predicate\":\"help.appUpdate\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"can_not_skip\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"string\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"Vector\"},{\"name\":\"document\",\"type\":\"flags.1?Document\"},{\"name\":\"url\",\"type\":\"flags.2?string\"},{\"name\":\"sticker\",\"type\":\"flags.3?Document\"}],\"type\":\"help.AppUpdate\"},{\"id\":-1000708810,\"predicate\":\"help.noAppUpdate\",\"params\":[],\"type\":\"help.AppUpdate\"},{\"id\":415997816,\"predicate\":\"help.inviteText\",\"params\":[{\"name\":\"message\",\"type\":\"string\"}],\"type\":\"help.InviteText\"},{\"id\":314359194,\"predicate\":\"updateNewEncryptedMessage\",\"params\":[{\"name\":\"message\",\"type\":\"EncryptedMessage\"},{\"name\":\"qts\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":386986326,\"predicate\":\"updateEncryptedChatTyping\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1264392051,\"predicate\":\"updateEncryption\",\"params\":[{\"name\":\"chat\",\"type\":\"EncryptedChat\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":956179895,\"predicate\":\"updateEncryptedMessagesRead\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"max_date\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1417756512,\"predicate\":\"encryptedChatEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"EncryptedChat\"},{\"id\":1722964307,\"predicate\":\"encryptedChatWaiting\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"participant_id\",\"type\":\"long\"}],\"type\":\"EncryptedChat\"},{\"id\":1223809356,\"predicate\":\"encryptedChatRequested\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"folder_id\",\"type\":\"flags.0?int\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"participant_id\",\"type\":\"long\"},{\"name\":\"g_a\",\"type\":\"bytes\"}],\"type\":\"EncryptedChat\"},{\"id\":1643173063,\"predicate\":\"encryptedChat\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"participant_id\",\"type\":\"long\"},{\"name\":\"g_a_or_b\",\"type\":\"bytes\"},{\"name\":\"key_fingerprint\",\"type\":\"long\"}],\"type\":\"EncryptedChat\"},{\"id\":505183301,\"predicate\":\"encryptedChatDiscarded\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"history_deleted\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"EncryptedChat\"},{\"id\":-247351839,\"predicate\":\"inputEncryptedChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputEncryptedChat\"},{\"id\":-1038136962,\"predicate\":\"encryptedFileEmpty\",\"params\":[],\"type\":\"EncryptedFile\"},{\"id\":-1476358952,\"predicate\":\"encryptedFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"size\",\"type\":\"long\"},{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"key_fingerprint\",\"type\":\"int\"}],\"type\":\"EncryptedFile\"},{\"id\":406307684,\"predicate\":\"inputEncryptedFileEmpty\",\"params\":[],\"type\":\"InputEncryptedFile\"},{\"id\":1690108678,\"predicate\":\"inputEncryptedFileUploaded\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"parts\",\"type\":\"int\"},{\"name\":\"md5_checksum\",\"type\":\"string\"},{\"name\":\"key_fingerprint\",\"type\":\"int\"}],\"type\":\"InputEncryptedFile\"},{\"id\":1511503333,\"predicate\":\"inputEncryptedFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputEncryptedFile\"},{\"id\":-182231723,\"predicate\":\"inputEncryptedFileLocation\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputFileLocation\"},{\"id\":-317144808,\"predicate\":\"encryptedMessage\",\"params\":[{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"},{\"name\":\"file\",\"type\":\"EncryptedFile\"}],\"type\":\"EncryptedMessage\"},{\"id\":594758406,\"predicate\":\"encryptedMessageService\",\"params\":[{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"EncryptedMessage\"},{\"id\":-1058912715,\"predicate\":\"messages.dhConfigNotModified\",\"params\":[{\"name\":\"random\",\"type\":\"bytes\"}],\"type\":\"messages.DhConfig\"},{\"id\":740433629,\"predicate\":\"messages.dhConfig\",\"params\":[{\"name\":\"g\",\"type\":\"int\"},{\"name\":\"p\",\"type\":\"bytes\"},{\"name\":\"version\",\"type\":\"int\"},{\"name\":\"random\",\"type\":\"bytes\"}],\"type\":\"messages.DhConfig\"},{\"id\":1443858741,\"predicate\":\"messages.sentEncryptedMessage\",\"params\":[{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"messages.SentEncryptedMessage\"},{\"id\":-1802240206,\"predicate\":\"messages.sentEncryptedFile\",\"params\":[{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"file\",\"type\":\"EncryptedFile\"}],\"type\":\"messages.SentEncryptedMessage\"},{\"id\":-95482955,\"predicate\":\"inputFileBig\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"parts\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}],\"type\":\"InputFile\"},{\"id\":767652808,\"predicate\":\"inputEncryptedFileBigUploaded\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"parts\",\"type\":\"int\"},{\"name\":\"key_fingerprint\",\"type\":\"int\"}],\"type\":\"InputEncryptedFile\"},{\"id\":1037718609,\"predicate\":\"updateChatParticipantAdd\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"inviter_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-483443337,\"predicate\":\"updateChatParticipantDelete\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1906403213,\"predicate\":\"updateDcOptions\",\"params\":[{\"name\":\"dc_options\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":1530447553,\"predicate\":\"inputMediaUploadedDocument\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"nosound_video\",\"type\":\"flags.3?true\"},{\"name\":\"force_file\",\"type\":\"flags.4?true\"},{\"name\":\"spoiler\",\"type\":\"flags.5?true\"},{\"name\":\"file\",\"type\":\"InputFile\"},{\"name\":\"thumb\",\"type\":\"flags.2?InputFile\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"attributes\",\"type\":\"Vector\"},{\"name\":\"stickers\",\"type\":\"flags.0?Vector\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.1?int\"}],\"type\":\"InputMedia\"},{\"id\":860303448,\"predicate\":\"inputMediaDocument\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"spoiler\",\"type\":\"flags.2?true\"},{\"name\":\"id\",\"type\":\"InputDocument\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.0?int\"},{\"name\":\"query\",\"type\":\"flags.1?string\"}],\"type\":\"InputMedia\"},{\"id\":-1666158377,\"predicate\":\"messageMediaDocument\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"nopremium\",\"type\":\"flags.3?true\"},{\"name\":\"spoiler\",\"type\":\"flags.4?true\"},{\"name\":\"document\",\"type\":\"flags.0?Document\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.2?int\"}],\"type\":\"MessageMedia\"},{\"id\":1928391342,\"predicate\":\"inputDocumentEmpty\",\"params\":[],\"type\":\"InputDocument\"},{\"id\":448771445,\"predicate\":\"inputDocument\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"}],\"type\":\"InputDocument\"},{\"id\":-1160743548,\"predicate\":\"inputDocumentFileLocation\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"},{\"name\":\"thumb_size\",\"type\":\"string\"}],\"type\":\"InputFileLocation\"},{\"id\":922273905,\"predicate\":\"documentEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"Document\"},{\"id\":-1881881384,\"predicate\":\"document\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"size\",\"type\":\"long\"},{\"name\":\"thumbs\",\"type\":\"flags.0?Vector\"},{\"name\":\"video_thumbs\",\"type\":\"flags.1?Vector\"},{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"attributes\",\"type\":\"Vector\"}],\"type\":\"Document\"},{\"id\":398898678,\"predicate\":\"help.support\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"user\",\"type\":\"User\"}],\"type\":\"help.Support\"},{\"id\":-1613493288,\"predicate\":\"notifyPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"}],\"type\":\"NotifyPeer\"},{\"id\":-1261946036,\"predicate\":\"notifyUsers\",\"params\":[],\"type\":\"NotifyPeer\"},{\"id\":-1073230141,\"predicate\":\"notifyChats\",\"params\":[],\"type\":\"NotifyPeer\"},{\"id\":-1094555409,\"predicate\":\"updateNotifySettings\",\"params\":[{\"name\":\"peer\",\"type\":\"NotifyPeer\"},{\"name\":\"notify_settings\",\"type\":\"PeerNotifySettings\"}],\"type\":\"Update\"},{\"id\":381645902,\"predicate\":\"sendMessageTypingAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":-44119819,\"predicate\":\"sendMessageCancelAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":-1584933265,\"predicate\":\"sendMessageRecordVideoAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":-378127636,\"predicate\":\"sendMessageUploadVideoAction\",\"params\":[{\"name\":\"progress\",\"type\":\"int\"}],\"type\":\"SendMessageAction\"},{\"id\":-718310409,\"predicate\":\"sendMessageRecordAudioAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":-212740181,\"predicate\":\"sendMessageUploadAudioAction\",\"params\":[{\"name\":\"progress\",\"type\":\"int\"}],\"type\":\"SendMessageAction\"},{\"id\":-774682074,\"predicate\":\"sendMessageUploadPhotoAction\",\"params\":[{\"name\":\"progress\",\"type\":\"int\"}],\"type\":\"SendMessageAction\"},{\"id\":-1441998364,\"predicate\":\"sendMessageUploadDocumentAction\",\"params\":[{\"name\":\"progress\",\"type\":\"int\"}],\"type\":\"SendMessageAction\"},{\"id\":393186209,\"predicate\":\"sendMessageGeoLocationAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":1653390447,\"predicate\":\"sendMessageChooseContactAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":-1290580579,\"predicate\":\"contacts.found\",\"params\":[{\"name\":\"my_results\",\"type\":\"Vector\"},{\"name\":\"results\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.Found\"},{\"id\":-337352679,\"predicate\":\"updateServiceNotification\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"popup\",\"type\":\"flags.0?true\"},{\"name\":\"inbox_date\",\"type\":\"flags.1?int\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"media\",\"type\":\"MessageMedia\"},{\"name\":\"entities\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":-496024847,\"predicate\":\"userStatusRecently\",\"params\":[],\"type\":\"UserStatus\"},{\"id\":129960444,\"predicate\":\"userStatusLastWeek\",\"params\":[],\"type\":\"UserStatus\"},{\"id\":2011940674,\"predicate\":\"userStatusLastMonth\",\"params\":[],\"type\":\"UserStatus\"},{\"id\":-298113238,\"predicate\":\"updatePrivacy\",\"params\":[{\"name\":\"key\",\"type\":\"PrivacyKey\"},{\"name\":\"rules\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":1335282456,\"predicate\":\"inputPrivacyKeyStatusTimestamp\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":-1137792208,\"predicate\":\"privacyKeyStatusTimestamp\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":218751099,\"predicate\":\"inputPrivacyValueAllowContacts\",\"params\":[],\"type\":\"InputPrivacyRule\"},{\"id\":407582158,\"predicate\":\"inputPrivacyValueAllowAll\",\"params\":[],\"type\":\"InputPrivacyRule\"},{\"id\":320652927,\"predicate\":\"inputPrivacyValueAllowUsers\",\"params\":[{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"InputPrivacyRule\"},{\"id\":195371015,\"predicate\":\"inputPrivacyValueDisallowContacts\",\"params\":[],\"type\":\"InputPrivacyRule\"},{\"id\":-697604407,\"predicate\":\"inputPrivacyValueDisallowAll\",\"params\":[],\"type\":\"InputPrivacyRule\"},{\"id\":-1877932953,\"predicate\":\"inputPrivacyValueDisallowUsers\",\"params\":[{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"InputPrivacyRule\"},{\"id\":-123988,\"predicate\":\"privacyValueAllowContacts\",\"params\":[],\"type\":\"PrivacyRule\"},{\"id\":1698855810,\"predicate\":\"privacyValueAllowAll\",\"params\":[],\"type\":\"PrivacyRule\"},{\"id\":-1198497870,\"predicate\":\"privacyValueAllowUsers\",\"params\":[{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"PrivacyRule\"},{\"id\":-125240806,\"predicate\":\"privacyValueDisallowContacts\",\"params\":[],\"type\":\"PrivacyRule\"},{\"id\":-1955338397,\"predicate\":\"privacyValueDisallowAll\",\"params\":[],\"type\":\"PrivacyRule\"},{\"id\":-463335103,\"predicate\":\"privacyValueDisallowUsers\",\"params\":[{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"PrivacyRule\"},{\"id\":1352683077,\"predicate\":\"account.privacyRules\",\"params\":[{\"name\":\"rules\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"account.PrivacyRules\"},{\"id\":-1194283041,\"predicate\":\"accountDaysTTL\",\"params\":[{\"name\":\"days\",\"type\":\"int\"}],\"type\":\"AccountDaysTTL\"},{\"id\":88680979,\"predicate\":\"updateUserPhone\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"phone\",\"type\":\"string\"}],\"type\":\"Update\"},{\"id\":1815593308,\"predicate\":\"documentAttributeImageSize\",\"params\":[{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"}],\"type\":\"DocumentAttribute\"},{\"id\":297109817,\"predicate\":\"documentAttributeAnimated\",\"params\":[],\"type\":\"DocumentAttribute\"},{\"id\":1662637586,\"predicate\":\"documentAttributeSticker\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"mask\",\"type\":\"flags.1?true\"},{\"name\":\"alt\",\"type\":\"string\"},{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"mask_coords\",\"type\":\"flags.0?MaskCoords\"}],\"type\":\"DocumentAttribute\"},{\"id\":250621158,\"predicate\":\"documentAttributeVideo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"round_message\",\"type\":\"flags.0?true\"},{\"name\":\"supports_streaming\",\"type\":\"flags.1?true\"},{\"name\":\"duration\",\"type\":\"int\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"}],\"type\":\"DocumentAttribute\"},{\"id\":-1739392570,\"predicate\":\"documentAttributeAudio\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"voice\",\"type\":\"flags.10?true\"},{\"name\":\"duration\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"flags.0?string\"},{\"name\":\"performer\",\"type\":\"flags.1?string\"},{\"name\":\"waveform\",\"type\":\"flags.2?bytes\"}],\"type\":\"DocumentAttribute\"},{\"id\":358154344,\"predicate\":\"documentAttributeFilename\",\"params\":[{\"name\":\"file_name\",\"type\":\"string\"}],\"type\":\"DocumentAttribute\"},{\"id\":-244016606,\"predicate\":\"messages.stickersNotModified\",\"params\":[],\"type\":\"messages.Stickers\"},{\"id\":816245886,\"predicate\":\"messages.stickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"stickers\",\"type\":\"Vector\"}],\"type\":\"messages.Stickers\"},{\"id\":313694676,\"predicate\":\"stickerPack\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"},{\"name\":\"documents\",\"type\":\"Vector\"}],\"type\":\"StickerPack\"},{\"id\":-395967805,\"predicate\":\"messages.allStickersNotModified\",\"params\":[],\"type\":\"messages.AllStickers\"},{\"id\":-843329861,\"predicate\":\"messages.allStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"sets\",\"type\":\"Vector\"}],\"type\":\"messages.AllStickers\"},{\"id\":-1667805217,\"predicate\":\"updateReadHistoryInbox\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"folder_id\",\"type\":\"flags.0?int\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"still_unread_count\",\"type\":\"int\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":791617983,\"predicate\":\"updateReadHistoryOutbox\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-2066640507,\"predicate\":\"messages.affectedMessages\",\"params\":[{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"messages.AffectedMessages\"},{\"id\":2139689491,\"predicate\":\"updateWebPage\",\"params\":[{\"name\":\"webpage\",\"type\":\"WebPage\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-350980120,\"predicate\":\"webPageEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"WebPage\"},{\"id\":-981018084,\"predicate\":\"webPagePending\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"WebPage\"},{\"id\":-392411726,\"predicate\":\"webPage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"display_url\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"type\",\"type\":\"flags.0?string\"},{\"name\":\"site_name\",\"type\":\"flags.1?string\"},{\"name\":\"title\",\"type\":\"flags.2?string\"},{\"name\":\"description\",\"type\":\"flags.3?string\"},{\"name\":\"photo\",\"type\":\"flags.4?Photo\"},{\"name\":\"embed_url\",\"type\":\"flags.5?string\"},{\"name\":\"embed_type\",\"type\":\"flags.5?string\"},{\"name\":\"embed_width\",\"type\":\"flags.6?int\"},{\"name\":\"embed_height\",\"type\":\"flags.6?int\"},{\"name\":\"duration\",\"type\":\"flags.7?int\"},{\"name\":\"author\",\"type\":\"flags.8?string\"},{\"name\":\"document\",\"type\":\"flags.9?Document\"},{\"name\":\"cached_page\",\"type\":\"flags.10?Page\"},{\"name\":\"attributes\",\"type\":\"flags.12?Vector\"}],\"type\":\"WebPage\"},{\"id\":-1557277184,\"predicate\":\"messageMediaWebPage\",\"params\":[{\"name\":\"webpage\",\"type\":\"WebPage\"}],\"type\":\"MessageMedia\"},{\"id\":-1392388579,\"predicate\":\"authorization\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"current\",\"type\":\"flags.0?true\"},{\"name\":\"official_app\",\"type\":\"flags.1?true\"},{\"name\":\"password_pending\",\"type\":\"flags.2?true\"},{\"name\":\"encrypted_requests_disabled\",\"type\":\"flags.3?true\"},{\"name\":\"call_requests_disabled\",\"type\":\"flags.4?true\"},{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"device_model\",\"type\":\"string\"},{\"name\":\"platform\",\"type\":\"string\"},{\"name\":\"system_version\",\"type\":\"string\"},{\"name\":\"api_id\",\"type\":\"int\"},{\"name\":\"app_name\",\"type\":\"string\"},{\"name\":\"app_version\",\"type\":\"string\"},{\"name\":\"date_created\",\"type\":\"int\"},{\"name\":\"date_active\",\"type\":\"int\"},{\"name\":\"ip\",\"type\":\"string\"},{\"name\":\"country\",\"type\":\"string\"},{\"name\":\"region\",\"type\":\"string\"}],\"type\":\"Authorization\"},{\"id\":1275039392,\"predicate\":\"account.authorizations\",\"params\":[{\"name\":\"authorization_ttl_days\",\"type\":\"int\"},{\"name\":\"authorizations\",\"type\":\"Vector\"}],\"type\":\"account.Authorizations\"},{\"id\":-1787080453,\"predicate\":\"account.password\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"has_recovery\",\"type\":\"flags.0?true\"},{\"name\":\"has_secure_values\",\"type\":\"flags.1?true\"},{\"name\":\"has_password\",\"type\":\"flags.2?true\"},{\"name\":\"current_algo\",\"type\":\"flags.2?PasswordKdfAlgo\"},{\"name\":\"srp_B\",\"type\":\"flags.2?bytes\"},{\"name\":\"srp_id\",\"type\":\"flags.2?long\"},{\"name\":\"hint\",\"type\":\"flags.3?string\"},{\"name\":\"email_unconfirmed_pattern\",\"type\":\"flags.4?string\"},{\"name\":\"new_algo\",\"type\":\"PasswordKdfAlgo\"},{\"name\":\"new_secure_algo\",\"type\":\"SecurePasswordKdfAlgo\"},{\"name\":\"secure_random\",\"type\":\"bytes\"},{\"name\":\"pending_reset_date\",\"type\":\"flags.5?int\"},{\"name\":\"login_email_pattern\",\"type\":\"flags.6?string\"}],\"type\":\"account.Password\"},{\"id\":-1705233435,\"predicate\":\"account.passwordSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"email\",\"type\":\"flags.0?string\"},{\"name\":\"secure_settings\",\"type\":\"flags.1?SecureSecretSettings\"}],\"type\":\"account.PasswordSettings\"},{\"id\":-1036572727,\"predicate\":\"account.passwordInputSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"new_algo\",\"type\":\"flags.0?PasswordKdfAlgo\"},{\"name\":\"new_password_hash\",\"type\":\"flags.0?bytes\"},{\"name\":\"hint\",\"type\":\"flags.0?string\"},{\"name\":\"email\",\"type\":\"flags.1?string\"},{\"name\":\"new_secure_settings\",\"type\":\"flags.2?SecureSecretSettings\"}],\"type\":\"account.PasswordInputSettings\"},{\"id\":326715557,\"predicate\":\"auth.passwordRecovery\",\"params\":[{\"name\":\"email_pattern\",\"type\":\"string\"}],\"type\":\"auth.PasswordRecovery\"},{\"id\":-1052959727,\"predicate\":\"inputMediaVenue\",\"params\":[{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"string\"},{\"name\":\"provider\",\"type\":\"string\"},{\"name\":\"venue_id\",\"type\":\"string\"},{\"name\":\"venue_type\",\"type\":\"string\"}],\"type\":\"InputMedia\"},{\"id\":784356159,\"predicate\":\"messageMediaVenue\",\"params\":[{\"name\":\"geo\",\"type\":\"GeoPoint\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"string\"},{\"name\":\"provider\",\"type\":\"string\"},{\"name\":\"venue_id\",\"type\":\"string\"},{\"name\":\"venue_type\",\"type\":\"string\"}],\"type\":\"MessageMedia\"},{\"id\":-1551583367,\"predicate\":\"receivedNotifyMessage\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"flags\",\"type\":\"int\"}],\"type\":\"ReceivedNotifyMessage\"},{\"id\":179611673,\"predicate\":\"chatInviteExported\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"revoked\",\"type\":\"flags.0?true\"},{\"name\":\"permanent\",\"type\":\"flags.5?true\"},{\"name\":\"request_needed\",\"type\":\"flags.6?true\"},{\"name\":\"link\",\"type\":\"string\"},{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"start_date\",\"type\":\"flags.4?int\"},{\"name\":\"expire_date\",\"type\":\"flags.1?int\"},{\"name\":\"usage_limit\",\"type\":\"flags.2?int\"},{\"name\":\"usage\",\"type\":\"flags.3?int\"},{\"name\":\"requested\",\"type\":\"flags.7?int\"},{\"name\":\"title\",\"type\":\"flags.8?string\"}],\"type\":\"ExportedChatInvite\"},{\"id\":1516793212,\"predicate\":\"chatInviteAlready\",\"params\":[{\"name\":\"chat\",\"type\":\"Chat\"}],\"type\":\"ChatInvite\"},{\"id\":806110401,\"predicate\":\"chatInvite\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel\",\"type\":\"flags.0?true\"},{\"name\":\"broadcast\",\"type\":\"flags.1?true\"},{\"name\":\"public\",\"type\":\"flags.2?true\"},{\"name\":\"megagroup\",\"type\":\"flags.3?true\"},{\"name\":\"request_needed\",\"type\":\"flags.6?true\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"about\",\"type\":\"flags.5?string\"},{\"name\":\"photo\",\"type\":\"Photo\"},{\"name\":\"participants_count\",\"type\":\"int\"},{\"name\":\"participants\",\"type\":\"flags.4?Vector\"}],\"type\":\"ChatInvite\"},{\"id\":51520707,\"predicate\":\"messageActionChatJoinedByLink\",\"params\":[{\"name\":\"inviter_id\",\"type\":\"long\"}],\"type\":\"MessageAction\"},{\"id\":1757493555,\"predicate\":\"updateReadMessagesContents\",\"params\":[{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-4838507,\"predicate\":\"inputStickerSetEmpty\",\"params\":[],\"type\":\"InputStickerSet\"},{\"id\":-1645763991,\"predicate\":\"inputStickerSetID\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputStickerSet\"},{\"id\":-2044933984,\"predicate\":\"inputStickerSetShortName\",\"params\":[{\"name\":\"short_name\",\"type\":\"string\"}],\"type\":\"InputStickerSet\"},{\"id\":768691932,\"predicate\":\"stickerSet\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"archived\",\"type\":\"flags.1?true\"},{\"name\":\"official\",\"type\":\"flags.2?true\"},{\"name\":\"masks\",\"type\":\"flags.3?true\"},{\"name\":\"animated\",\"type\":\"flags.5?true\"},{\"name\":\"videos\",\"type\":\"flags.6?true\"},{\"name\":\"emojis\",\"type\":\"flags.7?true\"},{\"name\":\"installed_date\",\"type\":\"flags.0?int\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"short_name\",\"type\":\"string\"},{\"name\":\"thumbs\",\"type\":\"flags.4?Vector\"},{\"name\":\"thumb_dc_id\",\"type\":\"flags.4?int\"},{\"name\":\"thumb_version\",\"type\":\"flags.4?int\"},{\"name\":\"thumb_document_id\",\"type\":\"flags.8?long\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"StickerSet\"},{\"id\":1846886166,\"predicate\":\"messages.stickerSet\",\"params\":[{\"name\":\"set\",\"type\":\"StickerSet\"},{\"name\":\"packs\",\"type\":\"Vector\"},{\"name\":\"keywords\",\"type\":\"Vector\"},{\"name\":\"documents\",\"type\":\"Vector\"}],\"type\":\"messages.StickerSet\"},{\"id\":-1885878744,\"predicate\":\"user\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"self\",\"type\":\"flags.10?true\"},{\"name\":\"contact\",\"type\":\"flags.11?true\"},{\"name\":\"mutual_contact\",\"type\":\"flags.12?true\"},{\"name\":\"deleted\",\"type\":\"flags.13?true\"},{\"name\":\"bot\",\"type\":\"flags.14?true\"},{\"name\":\"bot_chat_history\",\"type\":\"flags.15?true\"},{\"name\":\"bot_nochats\",\"type\":\"flags.16?true\"},{\"name\":\"verified\",\"type\":\"flags.17?true\"},{\"name\":\"restricted\",\"type\":\"flags.18?true\"},{\"name\":\"min\",\"type\":\"flags.20?true\"},{\"name\":\"bot_inline_geo\",\"type\":\"flags.21?true\"},{\"name\":\"support\",\"type\":\"flags.23?true\"},{\"name\":\"scam\",\"type\":\"flags.24?true\"},{\"name\":\"apply_min_photo\",\"type\":\"flags.25?true\"},{\"name\":\"fake\",\"type\":\"flags.26?true\"},{\"name\":\"bot_attach_menu\",\"type\":\"flags.27?true\"},{\"name\":\"premium\",\"type\":\"flags.28?true\"},{\"name\":\"attach_menu_enabled\",\"type\":\"flags.29?true\"},{\"name\":\"flags2\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"flags.0?long\"},{\"name\":\"first_name\",\"type\":\"flags.1?string\"},{\"name\":\"last_name\",\"type\":\"flags.2?string\"},{\"name\":\"username\",\"type\":\"flags.3?string\"},{\"name\":\"phone\",\"type\":\"flags.4?string\"},{\"name\":\"photo\",\"type\":\"flags.5?UserProfilePhoto\"},{\"name\":\"status\",\"type\":\"flags.6?UserStatus\"},{\"name\":\"bot_info_version\",\"type\":\"flags.14?int\"},{\"name\":\"restriction_reason\",\"type\":\"flags.18?Vector\"},{\"name\":\"bot_inline_placeholder\",\"type\":\"flags.19?string\"},{\"name\":\"lang_code\",\"type\":\"flags.22?string\"},{\"name\":\"emoji_status\",\"type\":\"flags.30?EmojiStatus\"},{\"name\":\"usernames\",\"type\":\"flags2.0?Vector\"}],\"type\":\"User\"},{\"id\":-1032140601,\"predicate\":\"botCommand\",\"params\":[{\"name\":\"command\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"}],\"type\":\"BotCommand\"},{\"id\":-1892676777,\"predicate\":\"botInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"user_id\",\"type\":\"flags.0?long\"},{\"name\":\"description\",\"type\":\"flags.1?string\"},{\"name\":\"description_photo\",\"type\":\"flags.4?Photo\"},{\"name\":\"description_document\",\"type\":\"flags.5?Document\"},{\"name\":\"commands\",\"type\":\"flags.2?Vector\"},{\"name\":\"menu_button\",\"type\":\"flags.3?BotMenuButton\"}],\"type\":\"BotInfo\"},{\"id\":-1560655744,\"predicate\":\"keyboardButton\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":2002815875,\"predicate\":\"keyboardButtonRow\",\"params\":[{\"name\":\"buttons\",\"type\":\"Vector\"}],\"type\":\"KeyboardButtonRow\"},{\"id\":-1606526075,\"predicate\":\"replyKeyboardHide\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"selective\",\"type\":\"flags.2?true\"}],\"type\":\"ReplyMarkup\"},{\"id\":-2035021048,\"predicate\":\"replyKeyboardForceReply\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"single_use\",\"type\":\"flags.1?true\"},{\"name\":\"selective\",\"type\":\"flags.2?true\"},{\"name\":\"placeholder\",\"type\":\"flags.3?string\"}],\"type\":\"ReplyMarkup\"},{\"id\":-2049074735,\"predicate\":\"replyKeyboardMarkup\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"resize\",\"type\":\"flags.0?true\"},{\"name\":\"single_use\",\"type\":\"flags.1?true\"},{\"name\":\"selective\",\"type\":\"flags.2?true\"},{\"name\":\"persistent\",\"type\":\"flags.4?true\"},{\"name\":\"rows\",\"type\":\"Vector\"},{\"name\":\"placeholder\",\"type\":\"flags.3?string\"}],\"type\":\"ReplyMarkup\"},{\"id\":-571955892,\"predicate\":\"inputPeerUser\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputPeer\"},{\"id\":-233744186,\"predicate\":\"inputUser\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputUser\"},{\"id\":-1148011883,\"predicate\":\"messageEntityUnknown\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":-100378723,\"predicate\":\"messageEntityMention\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":1868782349,\"predicate\":\"messageEntityHashtag\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":1827637959,\"predicate\":\"messageEntityBotCommand\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":1859134776,\"predicate\":\"messageEntityUrl\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":1692693954,\"predicate\":\"messageEntityEmail\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":-1117713463,\"predicate\":\"messageEntityBold\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":-2106619040,\"predicate\":\"messageEntityItalic\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":681706865,\"predicate\":\"messageEntityCode\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":1938967520,\"predicate\":\"messageEntityPre\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"},{\"name\":\"language\",\"type\":\"string\"}],\"type\":\"MessageEntity\"},{\"id\":1990644519,\"predicate\":\"messageEntityTextUrl\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"},{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"MessageEntity\"},{\"id\":-1877614335,\"predicate\":\"updateShortSentMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"out\",\"type\":\"flags.1?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"media\",\"type\":\"flags.9?MessageMedia\"},{\"name\":\"entities\",\"type\":\"flags.7?Vector\"},{\"name\":\"ttl_period\",\"type\":\"flags.25?int\"}],\"type\":\"Updates\"},{\"id\":-292807034,\"predicate\":\"inputChannelEmpty\",\"params\":[],\"type\":\"InputChannel\"},{\"id\":-212145112,\"predicate\":\"inputChannel\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputChannel\"},{\"id\":-1566230754,\"predicate\":\"peerChannel\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"}],\"type\":\"Peer\"},{\"id\":666680316,\"predicate\":\"inputPeerChannel\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputPeer\"},{\"id\":-2094689180,\"predicate\":\"channel\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"creator\",\"type\":\"flags.0?true\"},{\"name\":\"left\",\"type\":\"flags.2?true\"},{\"name\":\"broadcast\",\"type\":\"flags.5?true\"},{\"name\":\"verified\",\"type\":\"flags.7?true\"},{\"name\":\"megagroup\",\"type\":\"flags.8?true\"},{\"name\":\"restricted\",\"type\":\"flags.9?true\"},{\"name\":\"signatures\",\"type\":\"flags.11?true\"},{\"name\":\"min\",\"type\":\"flags.12?true\"},{\"name\":\"scam\",\"type\":\"flags.19?true\"},{\"name\":\"has_link\",\"type\":\"flags.20?true\"},{\"name\":\"has_geo\",\"type\":\"flags.21?true\"},{\"name\":\"slowmode_enabled\",\"type\":\"flags.22?true\"},{\"name\":\"call_active\",\"type\":\"flags.23?true\"},{\"name\":\"call_not_empty\",\"type\":\"flags.24?true\"},{\"name\":\"fake\",\"type\":\"flags.25?true\"},{\"name\":\"gigagroup\",\"type\":\"flags.26?true\"},{\"name\":\"noforwards\",\"type\":\"flags.27?true\"},{\"name\":\"join_to_send\",\"type\":\"flags.28?true\"},{\"name\":\"join_request\",\"type\":\"flags.29?true\"},{\"name\":\"forum\",\"type\":\"flags.30?true\"},{\"name\":\"flags2\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"flags.13?long\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"username\",\"type\":\"flags.6?string\"},{\"name\":\"photo\",\"type\":\"ChatPhoto\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"restriction_reason\",\"type\":\"flags.9?Vector\"},{\"name\":\"admin_rights\",\"type\":\"flags.14?ChatAdminRights\"},{\"name\":\"banned_rights\",\"type\":\"flags.15?ChatBannedRights\"},{\"name\":\"default_banned_rights\",\"type\":\"flags.18?ChatBannedRights\"},{\"name\":\"participants_count\",\"type\":\"flags.17?int\"},{\"name\":\"usernames\",\"type\":\"flags2.0?Vector\"}],\"type\":\"Chat\"},{\"id\":399807445,\"predicate\":\"channelForbidden\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"broadcast\",\"type\":\"flags.5?true\"},{\"name\":\"megagroup\",\"type\":\"flags.8?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"until_date\",\"type\":\"flags.16?int\"}],\"type\":\"Chat\"},{\"id\":2131196633,\"predicate\":\"contacts.resolvedPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.ResolvedPeer\"},{\"id\":-231385849,\"predicate\":\"channelFull\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"can_view_participants\",\"type\":\"flags.3?true\"},{\"name\":\"can_set_username\",\"type\":\"flags.6?true\"},{\"name\":\"can_set_stickers\",\"type\":\"flags.7?true\"},{\"name\":\"hidden_prehistory\",\"type\":\"flags.10?true\"},{\"name\":\"can_set_location\",\"type\":\"flags.16?true\"},{\"name\":\"has_scheduled\",\"type\":\"flags.19?true\"},{\"name\":\"can_view_stats\",\"type\":\"flags.20?true\"},{\"name\":\"blocked\",\"type\":\"flags.22?true\"},{\"name\":\"flags2\",\"type\":\"#\"},{\"name\":\"can_delete_channel\",\"type\":\"flags2.0?true\"},{\"name\":\"antispam\",\"type\":\"flags2.1?true\"},{\"name\":\"participants_hidden\",\"type\":\"flags2.2?true\"},{\"name\":\"translations_disabled\",\"type\":\"flags2.3?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"about\",\"type\":\"string\"},{\"name\":\"participants_count\",\"type\":\"flags.0?int\"},{\"name\":\"admins_count\",\"type\":\"flags.1?int\"},{\"name\":\"kicked_count\",\"type\":\"flags.2?int\"},{\"name\":\"banned_count\",\"type\":\"flags.2?int\"},{\"name\":\"online_count\",\"type\":\"flags.13?int\"},{\"name\":\"read_inbox_max_id\",\"type\":\"int\"},{\"name\":\"read_outbox_max_id\",\"type\":\"int\"},{\"name\":\"unread_count\",\"type\":\"int\"},{\"name\":\"chat_photo\",\"type\":\"Photo\"},{\"name\":\"notify_settings\",\"type\":\"PeerNotifySettings\"},{\"name\":\"exported_invite\",\"type\":\"flags.23?ExportedChatInvite\"},{\"name\":\"bot_info\",\"type\":\"Vector\"},{\"name\":\"migrated_from_chat_id\",\"type\":\"flags.4?long\"},{\"name\":\"migrated_from_max_id\",\"type\":\"flags.4?int\"},{\"name\":\"pinned_msg_id\",\"type\":\"flags.5?int\"},{\"name\":\"stickerset\",\"type\":\"flags.8?StickerSet\"},{\"name\":\"available_min_id\",\"type\":\"flags.9?int\"},{\"name\":\"folder_id\",\"type\":\"flags.11?int\"},{\"name\":\"linked_chat_id\",\"type\":\"flags.14?long\"},{\"name\":\"location\",\"type\":\"flags.15?ChannelLocation\"},{\"name\":\"slowmode_seconds\",\"type\":\"flags.17?int\"},{\"name\":\"slowmode_next_send_date\",\"type\":\"flags.18?int\"},{\"name\":\"stats_dc\",\"type\":\"flags.12?int\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"call\",\"type\":\"flags.21?InputGroupCall\"},{\"name\":\"ttl_period\",\"type\":\"flags.24?int\"},{\"name\":\"pending_suggestions\",\"type\":\"flags.25?Vector\"},{\"name\":\"groupcall_default_join_as\",\"type\":\"flags.26?Peer\"},{\"name\":\"theme_emoticon\",\"type\":\"flags.27?string\"},{\"name\":\"requests_pending\",\"type\":\"flags.28?int\"},{\"name\":\"recent_requesters\",\"type\":\"flags.28?Vector\"},{\"name\":\"default_send_as\",\"type\":\"flags.29?Peer\"},{\"name\":\"available_reactions\",\"type\":\"flags.30?ChatReactions\"}],\"type\":\"ChatFull\"},{\"id\":182649427,\"predicate\":\"messageRange\",\"params\":[{\"name\":\"min_id\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"MessageRange\"},{\"id\":-948520370,\"predicate\":\"messages.channelMessages\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"inexact\",\"type\":\"flags.1?true\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"offset_id_offset\",\"type\":\"flags.2?int\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"topics\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":-1781355374,\"predicate\":\"messageActionChannelCreate\",\"params\":[{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":277713951,\"predicate\":\"updateChannelTooLong\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"pts\",\"type\":\"flags.0?int\"}],\"type\":\"Update\"},{\"id\":1666927625,\"predicate\":\"updateChannel\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"}],\"type\":\"Update\"},{\"id\":1656358105,\"predicate\":\"updateNewChannelMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1842450928,\"predicate\":\"updateReadChannelInbox\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"folder_id\",\"type\":\"flags.0?int\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"still_unread_count\",\"type\":\"int\"},{\"name\":\"pts\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1020437742,\"predicate\":\"updateDeleteChannelMessages\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-232346616,\"predicate\":\"updateChannelMessageViews\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"views\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":1041346555,\"predicate\":\"updates.channelDifferenceEmpty\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"final\",\"type\":\"flags.0?true\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"timeout\",\"type\":\"flags.1?int\"}],\"type\":\"updates.ChannelDifference\"},{\"id\":-1531132162,\"predicate\":\"updates.channelDifferenceTooLong\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"final\",\"type\":\"flags.0?true\"},{\"name\":\"timeout\",\"type\":\"flags.1?int\"},{\"name\":\"dialog\",\"type\":\"Dialog\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"updates.ChannelDifference\"},{\"id\":543450958,\"predicate\":\"updates.channelDifference\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"final\",\"type\":\"flags.0?true\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"timeout\",\"type\":\"flags.1?int\"},{\"name\":\"new_messages\",\"type\":\"Vector\"},{\"name\":\"other_updates\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"updates.ChannelDifference\"},{\"id\":-1798033689,\"predicate\":\"channelMessagesFilterEmpty\",\"params\":[],\"type\":\"ChannelMessagesFilter\"},{\"id\":-847783593,\"predicate\":\"channelMessagesFilter\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"exclude_new_messages\",\"type\":\"flags.1?true\"},{\"name\":\"ranges\",\"type\":\"Vector\"}],\"type\":\"ChannelMessagesFilter\"},{\"id\":-1072953408,\"predicate\":\"channelParticipant\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"ChannelParticipant\"},{\"id\":900251559,\"predicate\":\"channelParticipantSelf\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"via_request\",\"type\":\"flags.0?true\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"inviter_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"ChannelParticipant\"},{\"id\":803602899,\"predicate\":\"channelParticipantCreator\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"admin_rights\",\"type\":\"ChatAdminRights\"},{\"name\":\"rank\",\"type\":\"flags.0?string\"}],\"type\":\"ChannelParticipant\"},{\"id\":-566281095,\"predicate\":\"channelParticipantsRecent\",\"params\":[],\"type\":\"ChannelParticipantsFilter\"},{\"id\":-1268741783,\"predicate\":\"channelParticipantsAdmins\",\"params\":[],\"type\":\"ChannelParticipantsFilter\"},{\"id\":-1548400251,\"predicate\":\"channelParticipantsKicked\",\"params\":[{\"name\":\"q\",\"type\":\"string\"}],\"type\":\"ChannelParticipantsFilter\"},{\"id\":-1699676497,\"predicate\":\"channels.channelParticipants\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"participants\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"channels.ChannelParticipants\"},{\"id\":-541588713,\"predicate\":\"channels.channelParticipant\",\"params\":[{\"name\":\"participant\",\"type\":\"ChannelParticipant\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"channels.ChannelParticipant\"},{\"id\":-462696732,\"predicate\":\"chatParticipantCreator\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"ChatParticipant\"},{\"id\":-1600962725,\"predicate\":\"chatParticipantAdmin\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"inviter_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"ChatParticipant\"},{\"id\":-674602590,\"predicate\":\"updateChatParticipantAdmin\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"is_admin\",\"type\":\"Bool\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-519864430,\"predicate\":\"messageActionChatMigrateTo\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"}],\"type\":\"MessageAction\"},{\"id\":-365344535,\"predicate\":\"messageActionChannelMigrateFrom\",\"params\":[{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"chat_id\",\"type\":\"long\"}],\"type\":\"MessageAction\"},{\"id\":-1328445861,\"predicate\":\"channelParticipantsBots\",\"params\":[],\"type\":\"ChannelParticipantsFilter\"},{\"id\":2013922064,\"predicate\":\"help.termsOfService\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"popup\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"DataJSON\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"Vector\"},{\"name\":\"min_age_confirm\",\"type\":\"flags.1?int\"}],\"type\":\"help.TermsOfService\"},{\"id\":1753886890,\"predicate\":\"updateNewStickerSet\",\"params\":[{\"name\":\"stickerset\",\"type\":\"messages.StickerSet\"}],\"type\":\"Update\"},{\"id\":196268545,\"predicate\":\"updateStickerSetsOrder\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"masks\",\"type\":\"flags.0?true\"},{\"name\":\"emojis\",\"type\":\"flags.1?true\"},{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":834816008,\"predicate\":\"updateStickerSets\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"masks\",\"type\":\"flags.0?true\"},{\"name\":\"emojis\",\"type\":\"flags.1?true\"}],\"type\":\"Update\"},{\"id\":-402498398,\"predicate\":\"messages.savedGifsNotModified\",\"params\":[],\"type\":\"messages.SavedGifs\"},{\"id\":-2069878259,\"predicate\":\"messages.savedGifs\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"gifs\",\"type\":\"Vector\"}],\"type\":\"messages.SavedGifs\"},{\"id\":-1821035490,\"predicate\":\"updateSavedGifs\",\"params\":[],\"type\":\"Update\"},{\"id\":864077702,\"predicate\":\"inputBotInlineMessageMediaAuto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.1?Vector\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":1036876423,\"predicate\":\"inputBotInlineMessageText\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.0?true\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.1?Vector\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":-2000710887,\"predicate\":\"inputBotInlineResult\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"flags.1?string\"},{\"name\":\"description\",\"type\":\"flags.2?string\"},{\"name\":\"url\",\"type\":\"flags.3?string\"},{\"name\":\"thumb\",\"type\":\"flags.4?InputWebDocument\"},{\"name\":\"content\",\"type\":\"flags.5?InputWebDocument\"},{\"name\":\"send_message\",\"type\":\"InputBotInlineMessage\"}],\"type\":\"InputBotInlineResult\"},{\"id\":1984755728,\"predicate\":\"botInlineMessageMediaAuto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.1?Vector\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"BotInlineMessage\"},{\"id\":-1937807902,\"predicate\":\"botInlineMessageText\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.0?true\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.1?Vector\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"BotInlineMessage\"},{\"id\":295067450,\"predicate\":\"botInlineResult\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"flags.1?string\"},{\"name\":\"description\",\"type\":\"flags.2?string\"},{\"name\":\"url\",\"type\":\"flags.3?string\"},{\"name\":\"thumb\",\"type\":\"flags.4?WebDocument\"},{\"name\":\"content\",\"type\":\"flags.5?WebDocument\"},{\"name\":\"send_message\",\"type\":\"BotInlineMessage\"}],\"type\":\"BotInlineResult\"},{\"id\":-1803769784,\"predicate\":\"messages.botResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"gallery\",\"type\":\"flags.0?true\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"next_offset\",\"type\":\"flags.1?string\"},{\"name\":\"switch_pm\",\"type\":\"flags.2?InlineBotSwitchPM\"},{\"name\":\"results\",\"type\":\"Vector\"},{\"name\":\"cache_time\",\"type\":\"int\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.BotResults\"},{\"id\":1232025500,\"predicate\":\"updateBotInlineQuery\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"query\",\"type\":\"string\"},{\"name\":\"geo\",\"type\":\"flags.0?GeoPoint\"},{\"name\":\"peer_type\",\"type\":\"flags.1?InlineQueryPeerType\"},{\"name\":\"offset\",\"type\":\"string\"}],\"type\":\"Update\"},{\"id\":317794823,\"predicate\":\"updateBotInlineSend\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"query\",\"type\":\"string\"},{\"name\":\"geo\",\"type\":\"flags.0?GeoPoint\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"msg_id\",\"type\":\"flags.1?InputBotInlineMessageID\"}],\"type\":\"Update\"},{\"id\":1358283666,\"predicate\":\"inputMessagesFilterVoice\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":928101534,\"predicate\":\"inputMessagesFilterMusic\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1107622874,\"predicate\":\"inputPrivacyKeyChatInvite\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":1343122938,\"predicate\":\"privacyKeyChatInvite\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":1571494644,\"predicate\":\"exportedMessageLink\",\"params\":[{\"name\":\"link\",\"type\":\"string\"},{\"name\":\"html\",\"type\":\"string\"}],\"type\":\"ExportedMessageLink\"},{\"id\":1601666510,\"predicate\":\"messageFwdHeader\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"imported\",\"type\":\"flags.7?true\"},{\"name\":\"from_id\",\"type\":\"flags.0?Peer\"},{\"name\":\"from_name\",\"type\":\"flags.5?string\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"channel_post\",\"type\":\"flags.2?int\"},{\"name\":\"post_author\",\"type\":\"flags.3?string\"},{\"name\":\"saved_from_peer\",\"type\":\"flags.4?Peer\"},{\"name\":\"saved_from_msg_id\",\"type\":\"flags.4?int\"},{\"name\":\"psa_type\",\"type\":\"flags.6?string\"}],\"type\":\"MessageFwdHeader\"},{\"id\":457133559,\"predicate\":\"updateEditChannelMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1799538451,\"predicate\":\"messageActionPinMessage\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":1923290508,\"predicate\":\"auth.codeTypeSms\",\"params\":[],\"type\":\"auth.CodeType\"},{\"id\":1948046307,\"predicate\":\"auth.codeTypeCall\",\"params\":[],\"type\":\"auth.CodeType\"},{\"id\":577556219,\"predicate\":\"auth.codeTypeFlashCall\",\"params\":[],\"type\":\"auth.CodeType\"},{\"id\":1035688326,\"predicate\":\"auth.sentCodeTypeApp\",\"params\":[{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"auth.SentCodeType\"},{\"id\":-1073693790,\"predicate\":\"auth.sentCodeTypeSms\",\"params\":[{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"auth.SentCodeType\"},{\"id\":1398007207,\"predicate\":\"auth.sentCodeTypeCall\",\"params\":[{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"auth.SentCodeType\"},{\"id\":-1425815847,\"predicate\":\"auth.sentCodeTypeFlashCall\",\"params\":[{\"name\":\"pattern\",\"type\":\"string\"}],\"type\":\"auth.SentCodeType\"},{\"id\":629866245,\"predicate\":\"keyboardButtonUrl\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":901503851,\"predicate\":\"keyboardButtonCallback\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"requires_password\",\"type\":\"flags.0?true\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"type\":\"KeyboardButton\"},{\"id\":-1318425559,\"predicate\":\"keyboardButtonRequestPhone\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":-59151553,\"predicate\":\"keyboardButtonRequestGeoLocation\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":90744648,\"predicate\":\"keyboardButtonSwitchInline\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"same_peer\",\"type\":\"flags.0?true\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"query\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":1218642516,\"predicate\":\"replyInlineMarkup\",\"params\":[{\"name\":\"rows\",\"type\":\"Vector\"}],\"type\":\"ReplyMarkup\"},{\"id\":911761060,\"predicate\":\"messages.botCallbackAnswer\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"alert\",\"type\":\"flags.1?true\"},{\"name\":\"has_url\",\"type\":\"flags.3?true\"},{\"name\":\"native_ui\",\"type\":\"flags.4?true\"},{\"name\":\"message\",\"type\":\"flags.0?string\"},{\"name\":\"url\",\"type\":\"flags.2?string\"},{\"name\":\"cache_time\",\"type\":\"int\"}],\"type\":\"messages.BotCallbackAnswer\"},{\"id\":-1177566067,\"predicate\":\"updateBotCallbackQuery\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"chat_instance\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"flags.0?bytes\"},{\"name\":\"game_short_name\",\"type\":\"flags.1?string\"}],\"type\":\"Update\"},{\"id\":649453030,\"predicate\":\"messages.messageEditData\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"caption\",\"type\":\"flags.0?true\"}],\"type\":\"messages.MessageEditData\"},{\"id\":-469536605,\"predicate\":\"updateEditMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1768777083,\"predicate\":\"inputBotInlineMessageMediaGeo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"heading\",\"type\":\"flags.0?int\"},{\"name\":\"period\",\"type\":\"flags.1?int\"},{\"name\":\"proximity_notification_radius\",\"type\":\"flags.3?int\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":1098628881,\"predicate\":\"inputBotInlineMessageMediaVenue\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"string\"},{\"name\":\"provider\",\"type\":\"string\"},{\"name\":\"venue_id\",\"type\":\"string\"},{\"name\":\"venue_type\",\"type\":\"string\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":-1494368259,\"predicate\":\"inputBotInlineMessageMediaContact\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"vcard\",\"type\":\"string\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":85477117,\"predicate\":\"botInlineMessageMediaGeo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"geo\",\"type\":\"GeoPoint\"},{\"name\":\"heading\",\"type\":\"flags.0?int\"},{\"name\":\"period\",\"type\":\"flags.1?int\"},{\"name\":\"proximity_notification_radius\",\"type\":\"flags.3?int\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"BotInlineMessage\"},{\"id\":-1970903652,\"predicate\":\"botInlineMessageMediaVenue\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"geo\",\"type\":\"GeoPoint\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"string\"},{\"name\":\"provider\",\"type\":\"string\"},{\"name\":\"venue_id\",\"type\":\"string\"},{\"name\":\"venue_type\",\"type\":\"string\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"BotInlineMessage\"},{\"id\":416402882,\"predicate\":\"botInlineMessageMediaContact\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"vcard\",\"type\":\"string\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"BotInlineMessage\"},{\"id\":-1462213465,\"predicate\":\"inputBotInlineResultPhoto\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"InputPhoto\"},{\"name\":\"send_message\",\"type\":\"InputBotInlineMessage\"}],\"type\":\"InputBotInlineResult\"},{\"id\":-459324,\"predicate\":\"inputBotInlineResultDocument\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"flags.1?string\"},{\"name\":\"description\",\"type\":\"flags.2?string\"},{\"name\":\"document\",\"type\":\"InputDocument\"},{\"name\":\"send_message\",\"type\":\"InputBotInlineMessage\"}],\"type\":\"InputBotInlineResult\"},{\"id\":400266251,\"predicate\":\"botInlineMediaResult\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.0?Photo\"},{\"name\":\"document\",\"type\":\"flags.1?Document\"},{\"name\":\"title\",\"type\":\"flags.2?string\"},{\"name\":\"description\",\"type\":\"flags.3?string\"},{\"name\":\"send_message\",\"type\":\"BotInlineMessage\"}],\"type\":\"BotInlineResult\"},{\"id\":-1995686519,\"predicate\":\"inputBotInlineMessageID\",\"params\":[{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputBotInlineMessageID\"},{\"id\":1763610706,\"predicate\":\"updateInlineBotCallbackQuery\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"msg_id\",\"type\":\"InputBotInlineMessageID\"},{\"name\":\"chat_instance\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"flags.0?bytes\"},{\"name\":\"game_short_name\",\"type\":\"flags.1?string\"}],\"type\":\"Update\"},{\"id\":1008755359,\"predicate\":\"inlineBotSwitchPM\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"start_param\",\"type\":\"string\"}],\"type\":\"InlineBotSwitchPM\"},{\"id\":863093588,\"predicate\":\"messages.peerDialogs\",\"params\":[{\"name\":\"dialogs\",\"type\":\"Vector\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"state\",\"type\":\"updates.State\"}],\"type\":\"messages.PeerDialogs\"},{\"id\":-305282981,\"predicate\":\"topPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"rating\",\"type\":\"double\"}],\"type\":\"TopPeer\"},{\"id\":-1419371685,\"predicate\":\"topPeerCategoryBotsPM\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":344356834,\"predicate\":\"topPeerCategoryBotsInline\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":104314861,\"predicate\":\"topPeerCategoryCorrespondents\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":-1122524854,\"predicate\":\"topPeerCategoryGroups\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":371037736,\"predicate\":\"topPeerCategoryChannels\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":-75283823,\"predicate\":\"topPeerCategoryPeers\",\"params\":[{\"name\":\"category\",\"type\":\"TopPeerCategory\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"peers\",\"type\":\"Vector\"}],\"type\":\"TopPeerCategoryPeers\"},{\"id\":-567906571,\"predicate\":\"contacts.topPeersNotModified\",\"params\":[],\"type\":\"contacts.TopPeers\"},{\"id\":1891070632,\"predicate\":\"contacts.topPeers\",\"params\":[{\"name\":\"categories\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.TopPeers\"},{\"id\":-595914432,\"predicate\":\"messageEntityMentionName\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"MessageEntity\"},{\"id\":546203849,\"predicate\":\"inputMessageEntityMentionName\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"MessageEntity\"},{\"id\":975236280,\"predicate\":\"inputMessagesFilterChatPhotos\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1218471511,\"predicate\":\"updateReadChannelOutbox\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":457829485,\"predicate\":\"updateDraftMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"draft\",\"type\":\"DraftMessage\"}],\"type\":\"Update\"},{\"id\":453805082,\"predicate\":\"draftMessageEmpty\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"date\",\"type\":\"flags.0?int\"}],\"type\":\"DraftMessage\"},{\"id\":-40996577,\"predicate\":\"draftMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.1?true\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"DraftMessage\"},{\"id\":-1615153660,\"predicate\":\"messageActionHistoryClear\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":-958657434,\"predicate\":\"messages.featuredStickersNotModified\",\"params\":[{\"name\":\"count\",\"type\":\"int\"}],\"type\":\"messages.FeaturedStickers\"},{\"id\":-1103615738,\"predicate\":\"messages.featuredStickers\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"premium\",\"type\":\"flags.0?true\"},{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"sets\",\"type\":\"Vector\"},{\"name\":\"unread\",\"type\":\"Vector\"}],\"type\":\"messages.FeaturedStickers\"},{\"id\":1461528386,\"predicate\":\"updateReadFeaturedStickers\",\"params\":[],\"type\":\"Update\"},{\"id\":186120336,\"predicate\":\"messages.recentStickersNotModified\",\"params\":[],\"type\":\"messages.RecentStickers\"},{\"id\":-1999405994,\"predicate\":\"messages.recentStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"packs\",\"type\":\"Vector\"},{\"name\":\"stickers\",\"type\":\"Vector\"},{\"name\":\"dates\",\"type\":\"Vector\"}],\"type\":\"messages.RecentStickers\"},{\"id\":-1706939360,\"predicate\":\"updateRecentStickers\",\"params\":[],\"type\":\"Update\"},{\"id\":1338747336,\"predicate\":\"messages.archivedStickers\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"sets\",\"type\":\"Vector\"}],\"type\":\"messages.ArchivedStickers\"},{\"id\":946083368,\"predicate\":\"messages.stickerSetInstallResultSuccess\",\"params\":[],\"type\":\"messages.StickerSetInstallResult\"},{\"id\":904138920,\"predicate\":\"messages.stickerSetInstallResultArchive\",\"params\":[{\"name\":\"sets\",\"type\":\"Vector\"}],\"type\":\"messages.StickerSetInstallResult\"},{\"id\":1678812626,\"predicate\":\"stickerSetCovered\",\"params\":[{\"name\":\"set\",\"type\":\"StickerSet\"},{\"name\":\"cover\",\"type\":\"Document\"}],\"type\":\"StickerSetCovered\"},{\"id\":-1574314746,\"predicate\":\"updateConfig\",\"params\":[],\"type\":\"Update\"},{\"id\":861169551,\"predicate\":\"updatePtsChanged\",\"params\":[],\"type\":\"Update\"},{\"id\":-440664550,\"predicate\":\"inputMediaPhotoExternal\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"spoiler\",\"type\":\"flags.1?true\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.0?int\"}],\"type\":\"InputMedia\"},{\"id\":-78455655,\"predicate\":\"inputMediaDocumentExternal\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"spoiler\",\"type\":\"flags.1?true\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.0?int\"}],\"type\":\"InputMedia\"},{\"id\":872932635,\"predicate\":\"stickerSetMultiCovered\",\"params\":[{\"name\":\"set\",\"type\":\"StickerSet\"},{\"name\":\"covers\",\"type\":\"Vector\"}],\"type\":\"StickerSetCovered\"},{\"id\":-1361650766,\"predicate\":\"maskCoords\",\"params\":[{\"name\":\"n\",\"type\":\"int\"},{\"name\":\"x\",\"type\":\"double\"},{\"name\":\"y\",\"type\":\"double\"},{\"name\":\"zoom\",\"type\":\"double\"}],\"type\":\"MaskCoords\"},{\"id\":-1744710921,\"predicate\":\"documentAttributeHasStickers\",\"params\":[],\"type\":\"DocumentAttribute\"},{\"id\":1251549527,\"predicate\":\"inputStickeredMediaPhoto\",\"params\":[{\"name\":\"id\",\"type\":\"InputPhoto\"}],\"type\":\"InputStickeredMedia\"},{\"id\":70813275,\"predicate\":\"inputStickeredMediaDocument\",\"params\":[{\"name\":\"id\",\"type\":\"InputDocument\"}],\"type\":\"InputStickeredMedia\"},{\"id\":-1107729093,\"predicate\":\"game\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"short_name\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"Photo\"},{\"name\":\"document\",\"type\":\"flags.0?Document\"}],\"type\":\"Game\"},{\"id\":1336154098,\"predicate\":\"inputBotInlineResultGame\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"short_name\",\"type\":\"string\"},{\"name\":\"send_message\",\"type\":\"InputBotInlineMessage\"}],\"type\":\"InputBotInlineResult\"},{\"id\":1262639204,\"predicate\":\"inputBotInlineMessageGame\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":-38694904,\"predicate\":\"messageMediaGame\",\"params\":[{\"name\":\"game\",\"type\":\"Game\"}],\"type\":\"MessageMedia\"},{\"id\":-750828557,\"predicate\":\"inputMediaGame\",\"params\":[{\"name\":\"id\",\"type\":\"InputGame\"}],\"type\":\"InputMedia\"},{\"id\":53231223,\"predicate\":\"inputGameID\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputGame\"},{\"id\":-1020139510,\"predicate\":\"inputGameShortName\",\"params\":[{\"name\":\"bot_id\",\"type\":\"InputUser\"},{\"name\":\"short_name\",\"type\":\"string\"}],\"type\":\"InputGame\"},{\"id\":1358175439,\"predicate\":\"keyboardButtonGame\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":-1834538890,\"predicate\":\"messageActionGameScore\",\"params\":[{\"name\":\"game_id\",\"type\":\"long\"},{\"name\":\"score\",\"type\":\"int\"}],\"type\":\"MessageAction\"},{\"id\":1940093419,\"predicate\":\"highScore\",\"params\":[{\"name\":\"pos\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"score\",\"type\":\"int\"}],\"type\":\"HighScore\"},{\"id\":-1707344487,\"predicate\":\"messages.highScores\",\"params\":[{\"name\":\"scores\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.HighScores\"},{\"id\":1258196845,\"predicate\":\"updates.differenceTooLong\",\"params\":[{\"name\":\"pts\",\"type\":\"int\"}],\"type\":\"updates.Difference\"},{\"id\":791390623,\"predicate\":\"updateChannelWebPage\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"webpage\",\"type\":\"WebPage\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1663561404,\"predicate\":\"messages.chatsSlice\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"messages.Chats\"},{\"id\":-599948721,\"predicate\":\"textEmpty\",\"params\":[],\"type\":\"RichText\"},{\"id\":1950782688,\"predicate\":\"textPlain\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"RichText\"},{\"id\":1730456516,\"predicate\":\"textBold\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":-653089380,\"predicate\":\"textItalic\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":-1054465340,\"predicate\":\"textUnderline\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":-1678197867,\"predicate\":\"textStrike\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":1816074681,\"predicate\":\"textFixed\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":1009288385,\"predicate\":\"textUrl\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"webpage_id\",\"type\":\"long\"}],\"type\":\"RichText\"},{\"id\":-564523562,\"predicate\":\"textEmail\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"email\",\"type\":\"string\"}],\"type\":\"RichText\"},{\"id\":2120376535,\"predicate\":\"textConcat\",\"params\":[{\"name\":\"texts\",\"type\":\"Vector\"}],\"type\":\"RichText\"},{\"id\":324435594,\"predicate\":\"pageBlockUnsupported\",\"params\":[],\"type\":\"PageBlock\"},{\"id\":1890305021,\"predicate\":\"pageBlockTitle\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":-1879401953,\"predicate\":\"pageBlockSubtitle\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":-1162877472,\"predicate\":\"pageBlockAuthorDate\",\"params\":[{\"name\":\"author\",\"type\":\"RichText\"},{\"name\":\"published_date\",\"type\":\"int\"}],\"type\":\"PageBlock\"},{\"id\":-1076861716,\"predicate\":\"pageBlockHeader\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":-248793375,\"predicate\":\"pageBlockSubheader\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":1182402406,\"predicate\":\"pageBlockParagraph\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":-1066346178,\"predicate\":\"pageBlockPreformatted\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"language\",\"type\":\"string\"}],\"type\":\"PageBlock\"},{\"id\":1216809369,\"predicate\":\"pageBlockFooter\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":-618614392,\"predicate\":\"pageBlockDivider\",\"params\":[],\"type\":\"PageBlock\"},{\"id\":-837994576,\"predicate\":\"pageBlockAnchor\",\"params\":[{\"name\":\"name\",\"type\":\"string\"}],\"type\":\"PageBlock\"},{\"id\":-454524911,\"predicate\":\"pageBlockList\",\"params\":[{\"name\":\"items\",\"type\":\"Vector\"}],\"type\":\"PageBlock\"},{\"id\":641563686,\"predicate\":\"pageBlockBlockquote\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"caption\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":1329878739,\"predicate\":\"pageBlockPullquote\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"caption\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":391759200,\"predicate\":\"pageBlockPhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"photo_id\",\"type\":\"long\"},{\"name\":\"caption\",\"type\":\"PageCaption\"},{\"name\":\"url\",\"type\":\"flags.0?string\"},{\"name\":\"webpage_id\",\"type\":\"flags.0?long\"}],\"type\":\"PageBlock\"},{\"id\":2089805750,\"predicate\":\"pageBlockVideo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"autoplay\",\"type\":\"flags.0?true\"},{\"name\":\"loop\",\"type\":\"flags.1?true\"},{\"name\":\"video_id\",\"type\":\"long\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":972174080,\"predicate\":\"pageBlockCover\",\"params\":[{\"name\":\"cover\",\"type\":\"PageBlock\"}],\"type\":\"PageBlock\"},{\"id\":-1468953147,\"predicate\":\"pageBlockEmbed\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"full_width\",\"type\":\"flags.0?true\"},{\"name\":\"allow_scrolling\",\"type\":\"flags.3?true\"},{\"name\":\"url\",\"type\":\"flags.1?string\"},{\"name\":\"html\",\"type\":\"flags.2?string\"},{\"name\":\"poster_photo_id\",\"type\":\"flags.4?long\"},{\"name\":\"w\",\"type\":\"flags.5?int\"},{\"name\":\"h\",\"type\":\"flags.5?int\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":-229005301,\"predicate\":\"pageBlockEmbedPost\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"webpage_id\",\"type\":\"long\"},{\"name\":\"author_photo_id\",\"type\":\"long\"},{\"name\":\"author\",\"type\":\"string\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"blocks\",\"type\":\"Vector\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":1705048653,\"predicate\":\"pageBlockCollage\",\"params\":[{\"name\":\"items\",\"type\":\"Vector\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":52401552,\"predicate\":\"pageBlockSlideshow\",\"params\":[{\"name\":\"items\",\"type\":\"Vector\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":1930545681,\"predicate\":\"webPageNotModified\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"cached_page_views\",\"type\":\"flags.0?int\"}],\"type\":\"WebPage\"},{\"id\":-88417185,\"predicate\":\"inputPrivacyKeyPhoneCall\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":1030105979,\"predicate\":\"privacyKeyPhoneCall\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":-580219064,\"predicate\":\"sendMessageGamePlayAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":-2048646399,\"predicate\":\"phoneCallDiscardReasonMissed\",\"params\":[],\"type\":\"PhoneCallDiscardReason\"},{\"id\":-527056480,\"predicate\":\"phoneCallDiscardReasonDisconnect\",\"params\":[],\"type\":\"PhoneCallDiscardReason\"},{\"id\":1471006352,\"predicate\":\"phoneCallDiscardReasonHangup\",\"params\":[],\"type\":\"PhoneCallDiscardReason\"},{\"id\":-84416311,\"predicate\":\"phoneCallDiscardReasonBusy\",\"params\":[],\"type\":\"PhoneCallDiscardReason\"},{\"id\":1852826908,\"predicate\":\"updateDialogPinned\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.0?true\"},{\"name\":\"folder_id\",\"type\":\"flags.1?int\"},{\"name\":\"peer\",\"type\":\"DialogPeer\"}],\"type\":\"Update\"},{\"id\":-99664734,\"predicate\":\"updatePinnedDialogs\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"folder_id\",\"type\":\"flags.1?int\"},{\"name\":\"order\",\"type\":\"flags.0?Vector\"}],\"type\":\"Update\"},{\"id\":2104790276,\"predicate\":\"dataJSON\",\"params\":[{\"name\":\"data\",\"type\":\"string\"}],\"type\":\"DataJSON\"},{\"id\":-2095595325,\"predicate\":\"updateBotWebhookJSON\",\"params\":[{\"name\":\"data\",\"type\":\"DataJSON\"}],\"type\":\"Update\"},{\"id\":-1684914010,\"predicate\":\"updateBotWebhookJSONQuery\",\"params\":[{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"DataJSON\"},{\"name\":\"timeout\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-886477832,\"predicate\":\"labeledPrice\",\"params\":[{\"name\":\"label\",\"type\":\"string\"},{\"name\":\"amount\",\"type\":\"long\"}],\"type\":\"LabeledPrice\"},{\"id\":1048946971,\"predicate\":\"invoice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"test\",\"type\":\"flags.0?true\"},{\"name\":\"name_requested\",\"type\":\"flags.1?true\"},{\"name\":\"phone_requested\",\"type\":\"flags.2?true\"},{\"name\":\"email_requested\",\"type\":\"flags.3?true\"},{\"name\":\"shipping_address_requested\",\"type\":\"flags.4?true\"},{\"name\":\"flexible\",\"type\":\"flags.5?true\"},{\"name\":\"phone_to_provider\",\"type\":\"flags.6?true\"},{\"name\":\"email_to_provider\",\"type\":\"flags.7?true\"},{\"name\":\"recurring\",\"type\":\"flags.9?true\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"prices\",\"type\":\"Vector\"},{\"name\":\"max_tip_amount\",\"type\":\"flags.8?long\"},{\"name\":\"suggested_tip_amounts\",\"type\":\"flags.8?Vector\"},{\"name\":\"recurring_terms_url\",\"type\":\"flags.9?string\"}],\"type\":\"Invoice\"},{\"id\":-1900697899,\"predicate\":\"inputMediaInvoice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.0?InputWebDocument\"},{\"name\":\"invoice\",\"type\":\"Invoice\"},{\"name\":\"payload\",\"type\":\"bytes\"},{\"name\":\"provider\",\"type\":\"string\"},{\"name\":\"provider_data\",\"type\":\"DataJSON\"},{\"name\":\"start_param\",\"type\":\"flags.1?string\"},{\"name\":\"extended_media\",\"type\":\"flags.2?InputMedia\"}],\"type\":\"InputMedia\"},{\"id\":-368917890,\"predicate\":\"paymentCharge\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"provider_charge_id\",\"type\":\"string\"}],\"type\":\"PaymentCharge\"},{\"id\":-1892568281,\"predicate\":\"messageActionPaymentSentMe\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"recurring_init\",\"type\":\"flags.2?true\"},{\"name\":\"recurring_used\",\"type\":\"flags.3?true\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"total_amount\",\"type\":\"long\"},{\"name\":\"payload\",\"type\":\"bytes\"},{\"name\":\"info\",\"type\":\"flags.0?PaymentRequestedInfo\"},{\"name\":\"shipping_option_id\",\"type\":\"flags.1?string\"},{\"name\":\"charge\",\"type\":\"PaymentCharge\"}],\"type\":\"MessageAction\"},{\"id\":-156940077,\"predicate\":\"messageMediaInvoice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"shipping_address_requested\",\"type\":\"flags.1?true\"},{\"name\":\"test\",\"type\":\"flags.3?true\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.0?WebDocument\"},{\"name\":\"receipt_msg_id\",\"type\":\"flags.2?int\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"total_amount\",\"type\":\"long\"},{\"name\":\"start_param\",\"type\":\"string\"},{\"name\":\"extended_media\",\"type\":\"flags.4?MessageExtendedMedia\"}],\"type\":\"MessageMedia\"},{\"id\":512535275,\"predicate\":\"postAddress\",\"params\":[{\"name\":\"street_line1\",\"type\":\"string\"},{\"name\":\"street_line2\",\"type\":\"string\"},{\"name\":\"city\",\"type\":\"string\"},{\"name\":\"state\",\"type\":\"string\"},{\"name\":\"country_iso2\",\"type\":\"string\"},{\"name\":\"post_code\",\"type\":\"string\"}],\"type\":\"PostAddress\"},{\"id\":-1868808300,\"predicate\":\"paymentRequestedInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"name\",\"type\":\"flags.0?string\"},{\"name\":\"phone\",\"type\":\"flags.1?string\"},{\"name\":\"email\",\"type\":\"flags.2?string\"},{\"name\":\"shipping_address\",\"type\":\"flags.3?PostAddress\"}],\"type\":\"PaymentRequestedInfo\"},{\"id\":-1344716869,\"predicate\":\"keyboardButtonBuy\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":-1776926890,\"predicate\":\"messageActionPaymentSent\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"recurring_init\",\"type\":\"flags.2?true\"},{\"name\":\"recurring_used\",\"type\":\"flags.3?true\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"total_amount\",\"type\":\"long\"},{\"name\":\"invoice_slug\",\"type\":\"flags.0?string\"}],\"type\":\"MessageAction\"},{\"id\":-842892769,\"predicate\":\"paymentSavedCredentialsCard\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"PaymentSavedCredentials\"},{\"id\":475467473,\"predicate\":\"webDocument\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"attributes\",\"type\":\"Vector\"}],\"type\":\"WebDocument\"},{\"id\":-1678949555,\"predicate\":\"inputWebDocument\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"attributes\",\"type\":\"Vector\"}],\"type\":\"InputWebDocument\"},{\"id\":-1036396922,\"predicate\":\"inputWebFileLocation\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputWebFileLocation\"},{\"id\":568808380,\"predicate\":\"upload.webFile\",\"params\":[{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"file_type\",\"type\":\"storage.FileType\"},{\"name\":\"mtime\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"upload.WebFile\"},{\"id\":-1610250415,\"predicate\":\"payments.paymentForm\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"can_save_credentials\",\"type\":\"flags.2?true\"},{\"name\":\"password_missing\",\"type\":\"flags.3?true\"},{\"name\":\"form_id\",\"type\":\"long\"},{\"name\":\"bot_id\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.5?WebDocument\"},{\"name\":\"invoice\",\"type\":\"Invoice\"},{\"name\":\"provider_id\",\"type\":\"long\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"native_provider\",\"type\":\"flags.4?string\"},{\"name\":\"native_params\",\"type\":\"flags.4?DataJSON\"},{\"name\":\"additional_methods\",\"type\":\"flags.6?Vector\"},{\"name\":\"saved_info\",\"type\":\"flags.0?PaymentRequestedInfo\"},{\"name\":\"saved_credentials\",\"type\":\"flags.1?Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"payments.PaymentForm\"},{\"id\":-784000893,\"predicate\":\"payments.validatedRequestedInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"flags.0?string\"},{\"name\":\"shipping_options\",\"type\":\"flags.1?Vector\"}],\"type\":\"payments.ValidatedRequestedInfo\"},{\"id\":1314881805,\"predicate\":\"payments.paymentResult\",\"params\":[{\"name\":\"updates\",\"type\":\"Updates\"}],\"type\":\"payments.PaymentResult\"},{\"id\":1891958275,\"predicate\":\"payments.paymentReceipt\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"bot_id\",\"type\":\"long\"},{\"name\":\"provider_id\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.2?WebDocument\"},{\"name\":\"invoice\",\"type\":\"Invoice\"},{\"name\":\"info\",\"type\":\"flags.0?PaymentRequestedInfo\"},{\"name\":\"shipping\",\"type\":\"flags.1?ShippingOption\"},{\"name\":\"tip_amount\",\"type\":\"flags.3?long\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"total_amount\",\"type\":\"long\"},{\"name\":\"credentials_title\",\"type\":\"string\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"payments.PaymentReceipt\"},{\"id\":-74456004,\"predicate\":\"payments.savedInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"has_saved_credentials\",\"type\":\"flags.1?true\"},{\"name\":\"saved_info\",\"type\":\"flags.0?PaymentRequestedInfo\"}],\"type\":\"payments.SavedInfo\"},{\"id\":-1056001329,\"predicate\":\"inputPaymentCredentialsSaved\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"tmp_password\",\"type\":\"bytes\"}],\"type\":\"InputPaymentCredentials\"},{\"id\":873977640,\"predicate\":\"inputPaymentCredentials\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"save\",\"type\":\"flags.0?true\"},{\"name\":\"data\",\"type\":\"DataJSON\"}],\"type\":\"InputPaymentCredentials\"},{\"id\":-614138572,\"predicate\":\"account.tmpPassword\",\"params\":[{\"name\":\"tmp_password\",\"type\":\"bytes\"},{\"name\":\"valid_until\",\"type\":\"int\"}],\"type\":\"account.TmpPassword\"},{\"id\":-1239335713,\"predicate\":\"shippingOption\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"prices\",\"type\":\"Vector\"}],\"type\":\"ShippingOption\"},{\"id\":-1246823043,\"predicate\":\"updateBotShippingQuery\",\"params\":[{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"payload\",\"type\":\"bytes\"},{\"name\":\"shipping_address\",\"type\":\"PostAddress\"}],\"type\":\"Update\"},{\"id\":-1934976362,\"predicate\":\"updateBotPrecheckoutQuery\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"payload\",\"type\":\"bytes\"},{\"name\":\"info\",\"type\":\"flags.0?PaymentRequestedInfo\"},{\"name\":\"shipping_option_id\",\"type\":\"flags.1?string\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"total_amount\",\"type\":\"long\"}],\"type\":\"Update\"},{\"id\":-6249322,\"predicate\":\"inputStickerSetItem\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"document\",\"type\":\"InputDocument\"},{\"name\":\"emoji\",\"type\":\"string\"},{\"name\":\"mask_coords\",\"type\":\"flags.0?MaskCoords\"}],\"type\":\"InputStickerSetItem\"},{\"id\":-1425052898,\"predicate\":\"updatePhoneCall\",\"params\":[{\"name\":\"phone_call\",\"type\":\"PhoneCall\"}],\"type\":\"Update\"},{\"id\":506920429,\"predicate\":\"inputPhoneCall\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputPhoneCall\"},{\"id\":1399245077,\"predicate\":\"phoneCallEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"PhoneCall\"},{\"id\":-987599081,\"predicate\":\"phoneCallWaiting\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.6?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"participant_id\",\"type\":\"long\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"},{\"name\":\"receive_date\",\"type\":\"flags.0?int\"}],\"type\":\"PhoneCall\"},{\"id\":347139340,\"predicate\":\"phoneCallRequested\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.6?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"participant_id\",\"type\":\"long\"},{\"name\":\"g_a_hash\",\"type\":\"bytes\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"}],\"type\":\"PhoneCall\"},{\"id\":912311057,\"predicate\":\"phoneCallAccepted\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.6?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"participant_id\",\"type\":\"long\"},{\"name\":\"g_b\",\"type\":\"bytes\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"}],\"type\":\"PhoneCall\"},{\"id\":-1770029977,\"predicate\":\"phoneCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"p2p_allowed\",\"type\":\"flags.5?true\"},{\"name\":\"video\",\"type\":\"flags.6?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"participant_id\",\"type\":\"long\"},{\"name\":\"g_a_or_b\",\"type\":\"bytes\"},{\"name\":\"key_fingerprint\",\"type\":\"long\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"},{\"name\":\"connections\",\"type\":\"Vector\"},{\"name\":\"start_date\",\"type\":\"int\"}],\"type\":\"PhoneCall\"},{\"id\":1355435489,\"predicate\":\"phoneCallDiscarded\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"need_rating\",\"type\":\"flags.2?true\"},{\"name\":\"need_debug\",\"type\":\"flags.3?true\"},{\"name\":\"video\",\"type\":\"flags.6?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"reason\",\"type\":\"flags.0?PhoneCallDiscardReason\"},{\"name\":\"duration\",\"type\":\"flags.1?int\"}],\"type\":\"PhoneCall\"},{\"id\":-1665063993,\"predicate\":\"phoneConnection\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"tcp\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"ip\",\"type\":\"string\"},{\"name\":\"ipv6\",\"type\":\"string\"},{\"name\":\"port\",\"type\":\"int\"},{\"name\":\"peer_tag\",\"type\":\"bytes\"}],\"type\":\"PhoneConnection\"},{\"id\":-58224696,\"predicate\":\"phoneCallProtocol\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"udp_p2p\",\"type\":\"flags.0?true\"},{\"name\":\"udp_reflector\",\"type\":\"flags.1?true\"},{\"name\":\"min_layer\",\"type\":\"int\"},{\"name\":\"max_layer\",\"type\":\"int\"},{\"name\":\"library_versions\",\"type\":\"Vector\"}],\"type\":\"PhoneCallProtocol\"},{\"id\":-326966976,\"predicate\":\"phone.phoneCall\",\"params\":[{\"name\":\"phone_call\",\"type\":\"PhoneCall\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"phone.PhoneCall\"},{\"id\":-2134272152,\"predicate\":\"inputMessagesFilterPhoneCalls\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"missed\",\"type\":\"flags.0?true\"}],\"type\":\"MessagesFilter\"},{\"id\":-2132731265,\"predicate\":\"messageActionPhoneCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.2?true\"},{\"name\":\"call_id\",\"type\":\"long\"},{\"name\":\"reason\",\"type\":\"flags.0?PhoneCallDiscardReason\"},{\"name\":\"duration\",\"type\":\"flags.1?int\"}],\"type\":\"MessageAction\"},{\"id\":2054952868,\"predicate\":\"inputMessagesFilterRoundVoice\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1253451181,\"predicate\":\"inputMessagesFilterRoundVideo\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1997373508,\"predicate\":\"sendMessageRecordRoundAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":608050278,\"predicate\":\"sendMessageUploadRoundAction\",\"params\":[{\"name\":\"progress\",\"type\":\"int\"}],\"type\":\"SendMessageAction\"},{\"id\":-242427324,\"predicate\":\"upload.fileCdnRedirect\",\"params\":[{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"file_token\",\"type\":\"bytes\"},{\"name\":\"encryption_key\",\"type\":\"bytes\"},{\"name\":\"encryption_iv\",\"type\":\"bytes\"},{\"name\":\"file_hashes\",\"type\":\"Vector\"}],\"type\":\"upload.File\"},{\"id\":-290921362,\"predicate\":\"upload.cdnFileReuploadNeeded\",\"params\":[{\"name\":\"request_token\",\"type\":\"bytes\"}],\"type\":\"upload.CdnFile\"},{\"id\":-1449145777,\"predicate\":\"upload.cdnFile\",\"params\":[{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"upload.CdnFile\"},{\"id\":-914167110,\"predicate\":\"cdnPublicKey\",\"params\":[{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"public_key\",\"type\":\"string\"}],\"type\":\"CdnPublicKey\"},{\"id\":1462101002,\"predicate\":\"cdnConfig\",\"params\":[{\"name\":\"public_keys\",\"type\":\"Vector\"}],\"type\":\"CdnConfig\"},{\"id\":-283684427,\"predicate\":\"pageBlockChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"Chat\"}],\"type\":\"PageBlock\"},{\"id\":-892239370,\"predicate\":\"langPackString\",\"params\":[{\"name\":\"key\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"string\"}],\"type\":\"LangPackString\"},{\"id\":1816636575,\"predicate\":\"langPackStringPluralized\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"key\",\"type\":\"string\"},{\"name\":\"zero_value\",\"type\":\"flags.0?string\"},{\"name\":\"one_value\",\"type\":\"flags.1?string\"},{\"name\":\"two_value\",\"type\":\"flags.2?string\"},{\"name\":\"few_value\",\"type\":\"flags.3?string\"},{\"name\":\"many_value\",\"type\":\"flags.4?string\"},{\"name\":\"other_value\",\"type\":\"string\"}],\"type\":\"LangPackString\"},{\"id\":695856818,\"predicate\":\"langPackStringDeleted\",\"params\":[{\"name\":\"key\",\"type\":\"string\"}],\"type\":\"LangPackString\"},{\"id\":-209337866,\"predicate\":\"langPackDifference\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"from_version\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"int\"},{\"name\":\"strings\",\"type\":\"Vector\"}],\"type\":\"LangPackDifference\"},{\"id\":-288727837,\"predicate\":\"langPackLanguage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"official\",\"type\":\"flags.0?true\"},{\"name\":\"rtl\",\"type\":\"flags.2?true\"},{\"name\":\"beta\",\"type\":\"flags.3?true\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"native_name\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"base_lang_code\",\"type\":\"flags.1?string\"},{\"name\":\"plural_code\",\"type\":\"string\"},{\"name\":\"strings_count\",\"type\":\"int\"},{\"name\":\"translated_count\",\"type\":\"int\"},{\"name\":\"translations_url\",\"type\":\"string\"}],\"type\":\"LangPackLanguage\"},{\"id\":1180041828,\"predicate\":\"updateLangPackTooLong\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"Update\"},{\"id\":1442983757,\"predicate\":\"updateLangPack\",\"params\":[{\"name\":\"difference\",\"type\":\"LangPackDifference\"}],\"type\":\"Update\"},{\"id\":885242707,\"predicate\":\"channelParticipantAdmin\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"can_edit\",\"type\":\"flags.0?true\"},{\"name\":\"self\",\"type\":\"flags.1?true\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"inviter_id\",\"type\":\"flags.1?long\"},{\"name\":\"promoted_by\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_rights\",\"type\":\"ChatAdminRights\"},{\"name\":\"rank\",\"type\":\"flags.2?string\"}],\"type\":\"ChannelParticipant\"},{\"id\":1844969806,\"predicate\":\"channelParticipantBanned\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"left\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"kicked_by\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"banned_rights\",\"type\":\"ChatBannedRights\"}],\"type\":\"ChannelParticipant\"},{\"id\":338142689,\"predicate\":\"channelParticipantsBanned\",\"params\":[{\"name\":\"q\",\"type\":\"string\"}],\"type\":\"ChannelParticipantsFilter\"},{\"id\":106343499,\"predicate\":\"channelParticipantsSearch\",\"params\":[{\"name\":\"q\",\"type\":\"string\"}],\"type\":\"ChannelParticipantsFilter\"},{\"id\":-421545947,\"predicate\":\"channelAdminLogEventActionChangeTitle\",\"params\":[{\"name\":\"prev_value\",\"type\":\"string\"},{\"name\":\"new_value\",\"type\":\"string\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1427671598,\"predicate\":\"channelAdminLogEventActionChangeAbout\",\"params\":[{\"name\":\"prev_value\",\"type\":\"string\"},{\"name\":\"new_value\",\"type\":\"string\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1783299128,\"predicate\":\"channelAdminLogEventActionChangeUsername\",\"params\":[{\"name\":\"prev_value\",\"type\":\"string\"},{\"name\":\"new_value\",\"type\":\"string\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1129042607,\"predicate\":\"channelAdminLogEventActionChangePhoto\",\"params\":[{\"name\":\"prev_photo\",\"type\":\"Photo\"},{\"name\":\"new_photo\",\"type\":\"Photo\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":460916654,\"predicate\":\"channelAdminLogEventActionToggleInvites\",\"params\":[{\"name\":\"new_value\",\"type\":\"Bool\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":648939889,\"predicate\":\"channelAdminLogEventActionToggleSignatures\",\"params\":[{\"name\":\"new_value\",\"type\":\"Bool\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-370660328,\"predicate\":\"channelAdminLogEventActionUpdatePinned\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1889215493,\"predicate\":\"channelAdminLogEventActionEditMessage\",\"params\":[{\"name\":\"prev_message\",\"type\":\"Message\"},{\"name\":\"new_message\",\"type\":\"Message\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1121994683,\"predicate\":\"channelAdminLogEventActionDeleteMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":405815507,\"predicate\":\"channelAdminLogEventActionParticipantJoin\",\"params\":[],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-124291086,\"predicate\":\"channelAdminLogEventActionParticipantLeave\",\"params\":[],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-484690728,\"predicate\":\"channelAdminLogEventActionParticipantInvite\",\"params\":[{\"name\":\"participant\",\"type\":\"ChannelParticipant\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-422036098,\"predicate\":\"channelAdminLogEventActionParticipantToggleBan\",\"params\":[{\"name\":\"prev_participant\",\"type\":\"ChannelParticipant\"},{\"name\":\"new_participant\",\"type\":\"ChannelParticipant\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-714643696,\"predicate\":\"channelAdminLogEventActionParticipantToggleAdmin\",\"params\":[{\"name\":\"prev_participant\",\"type\":\"ChannelParticipant\"},{\"name\":\"new_participant\",\"type\":\"ChannelParticipant\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":531458253,\"predicate\":\"channelAdminLogEvent\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"action\",\"type\":\"ChannelAdminLogEventAction\"}],\"type\":\"ChannelAdminLogEvent\"},{\"id\":-309659827,\"predicate\":\"channels.adminLogResults\",\"params\":[{\"name\":\"events\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"channels.AdminLogResults\"},{\"id\":-368018716,\"predicate\":\"channelAdminLogEventsFilter\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"join\",\"type\":\"flags.0?true\"},{\"name\":\"leave\",\"type\":\"flags.1?true\"},{\"name\":\"invite\",\"type\":\"flags.2?true\"},{\"name\":\"ban\",\"type\":\"flags.3?true\"},{\"name\":\"unban\",\"type\":\"flags.4?true\"},{\"name\":\"kick\",\"type\":\"flags.5?true\"},{\"name\":\"unkick\",\"type\":\"flags.6?true\"},{\"name\":\"promote\",\"type\":\"flags.7?true\"},{\"name\":\"demote\",\"type\":\"flags.8?true\"},{\"name\":\"info\",\"type\":\"flags.9?true\"},{\"name\":\"settings\",\"type\":\"flags.10?true\"},{\"name\":\"pinned\",\"type\":\"flags.11?true\"},{\"name\":\"edit\",\"type\":\"flags.12?true\"},{\"name\":\"delete\",\"type\":\"flags.13?true\"},{\"name\":\"group_call\",\"type\":\"flags.14?true\"},{\"name\":\"invites\",\"type\":\"flags.15?true\"},{\"name\":\"send\",\"type\":\"flags.16?true\"},{\"name\":\"forums\",\"type\":\"flags.17?true\"}],\"type\":\"ChannelAdminLogEventsFilter\"},{\"id\":511092620,\"predicate\":\"topPeerCategoryPhoneCalls\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":-2143067670,\"predicate\":\"pageBlockAudio\",\"params\":[{\"name\":\"audio_id\",\"type\":\"long\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":1558266229,\"predicate\":\"popularContact\",\"params\":[{\"name\":\"client_id\",\"type\":\"long\"},{\"name\":\"importers\",\"type\":\"int\"}],\"type\":\"PopularContact\"},{\"id\":1200788123,\"predicate\":\"messageActionScreenshotTaken\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":-1634752813,\"predicate\":\"messages.favedStickersNotModified\",\"params\":[],\"type\":\"messages.FavedStickers\"},{\"id\":750063767,\"predicate\":\"messages.favedStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"packs\",\"type\":\"Vector\"},{\"name\":\"stickers\",\"type\":\"Vector\"}],\"type\":\"messages.FavedStickers\"},{\"id\":-451831443,\"predicate\":\"updateFavedStickers\",\"params\":[],\"type\":\"Update\"},{\"id\":-366410403,\"predicate\":\"updateChannelReadMessagesContents\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"messages\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":-1040652646,\"predicate\":\"inputMessagesFilterMyMentions\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":1887741886,\"predicate\":\"updateContactsReset\",\"params\":[],\"type\":\"Update\"},{\"id\":-1312568665,\"predicate\":\"channelAdminLogEventActionChangeStickerSet\",\"params\":[{\"name\":\"prev_stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"new_stickerset\",\"type\":\"InputStickerSet\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-85549226,\"predicate\":\"messageActionCustomAction\",\"params\":[{\"name\":\"message\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":178373535,\"predicate\":\"inputPaymentCredentialsApplePay\",\"params\":[{\"name\":\"payment_data\",\"type\":\"DataJSON\"}],\"type\":\"InputPaymentCredentials\"},{\"id\":-419271411,\"predicate\":\"inputMessagesFilterGeo\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-530392189,\"predicate\":\"inputMessagesFilterContacts\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1304443240,\"predicate\":\"updateChannelAvailableMessages\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"available_min_id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":1599903217,\"predicate\":\"channelAdminLogEventActionTogglePreHistoryHidden\",\"params\":[{\"name\":\"new_value\",\"type\":\"Bool\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-1759532989,\"predicate\":\"inputMediaGeoLive\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"stopped\",\"type\":\"flags.0?true\"},{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"heading\",\"type\":\"flags.2?int\"},{\"name\":\"period\",\"type\":\"flags.1?int\"},{\"name\":\"proximity_notification_radius\",\"type\":\"flags.3?int\"}],\"type\":\"InputMedia\"},{\"id\":-1186937242,\"predicate\":\"messageMediaGeoLive\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"geo\",\"type\":\"GeoPoint\"},{\"name\":\"heading\",\"type\":\"flags.0?int\"},{\"name\":\"period\",\"type\":\"int\"},{\"name\":\"proximity_notification_radius\",\"type\":\"flags.1?int\"}],\"type\":\"MessageMedia\"},{\"id\":1189204285,\"predicate\":\"recentMeUrlUnknown\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"RecentMeUrl\"},{\"id\":-1188296222,\"predicate\":\"recentMeUrlUser\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"RecentMeUrl\"},{\"id\":-1294306862,\"predicate\":\"recentMeUrlChat\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"chat_id\",\"type\":\"long\"}],\"type\":\"RecentMeUrl\"},{\"id\":-347535331,\"predicate\":\"recentMeUrlChatInvite\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"chat_invite\",\"type\":\"ChatInvite\"}],\"type\":\"RecentMeUrl\"},{\"id\":-1140172836,\"predicate\":\"recentMeUrlStickerSet\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"set\",\"type\":\"StickerSetCovered\"}],\"type\":\"RecentMeUrl\"},{\"id\":235081943,\"predicate\":\"help.recentMeUrls\",\"params\":[{\"name\":\"urls\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"help.RecentMeUrls\"},{\"id\":-266911767,\"predicate\":\"channels.channelParticipantsNotModified\",\"params\":[],\"type\":\"channels.ChannelParticipants\"},{\"id\":1951620897,\"predicate\":\"messages.messagesNotModified\",\"params\":[{\"name\":\"count\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":482797855,\"predicate\":\"inputSingleMedia\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"media\",\"type\":\"InputMedia\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.0?Vector\"}],\"type\":\"InputSingleMedia\"},{\"id\":-1493633966,\"predicate\":\"webAuthorization\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"bot_id\",\"type\":\"long\"},{\"name\":\"domain\",\"type\":\"string\"},{\"name\":\"browser\",\"type\":\"string\"},{\"name\":\"platform\",\"type\":\"string\"},{\"name\":\"date_created\",\"type\":\"int\"},{\"name\":\"date_active\",\"type\":\"int\"},{\"name\":\"ip\",\"type\":\"string\"},{\"name\":\"region\",\"type\":\"string\"}],\"type\":\"WebAuthorization\"},{\"id\":-313079300,\"predicate\":\"account.webAuthorizations\",\"params\":[{\"name\":\"authorizations\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"account.WebAuthorizations\"},{\"id\":-1502174430,\"predicate\":\"inputMessageID\",\"params\":[{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"InputMessage\"},{\"id\":-1160215659,\"predicate\":\"inputMessageReplyTo\",\"params\":[{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"InputMessage\"},{\"id\":-2037963464,\"predicate\":\"inputMessagePinned\",\"params\":[],\"type\":\"InputMessage\"},{\"id\":-1687559349,\"predicate\":\"messageEntityPhone\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":1280209983,\"predicate\":\"messageEntityCashtag\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":-1410748418,\"predicate\":\"messageActionBotAllowed\",\"params\":[{\"name\":\"domain\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":-55902537,\"predicate\":\"inputDialogPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"InputDialogPeer\"},{\"id\":-445792507,\"predicate\":\"dialogPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"}],\"type\":\"DialogPeer\"},{\"id\":223655517,\"predicate\":\"messages.foundStickerSetsNotModified\",\"params\":[],\"type\":\"messages.FoundStickerSets\"},{\"id\":-1963942446,\"predicate\":\"messages.foundStickerSets\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"sets\",\"type\":\"Vector\"}],\"type\":\"messages.FoundStickerSets\"},{\"id\":-207944868,\"predicate\":\"fileHash\",\"params\":[{\"name\":\"offset\",\"type\":\"long\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"bytes\"}],\"type\":\"FileHash\"},{\"id\":-104284986,\"predicate\":\"webDocumentNoProxy\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"attributes\",\"type\":\"Vector\"}],\"type\":\"WebDocument\"},{\"id\":1968737087,\"predicate\":\"inputClientProxy\",\"params\":[{\"name\":\"address\",\"type\":\"string\"},{\"name\":\"port\",\"type\":\"int\"}],\"type\":\"InputClientProxy\"},{\"id\":-483352705,\"predicate\":\"help.termsOfServiceUpdateEmpty\",\"params\":[{\"name\":\"expires\",\"type\":\"int\"}],\"type\":\"help.TermsOfServiceUpdate\"},{\"id\":686618977,\"predicate\":\"help.termsOfServiceUpdate\",\"params\":[{\"name\":\"expires\",\"type\":\"int\"},{\"name\":\"terms_of_service\",\"type\":\"help.TermsOfService\"}],\"type\":\"help.TermsOfServiceUpdate\"},{\"id\":859091184,\"predicate\":\"inputSecureFileUploaded\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"parts\",\"type\":\"int\"},{\"name\":\"md5_checksum\",\"type\":\"string\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"secret\",\"type\":\"bytes\"}],\"type\":\"InputSecureFile\"},{\"id\":1399317950,\"predicate\":\"inputSecureFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputSecureFile\"},{\"id\":-876089816,\"predicate\":\"inputSecureFileLocation\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputFileLocation\"},{\"id\":1679398724,\"predicate\":\"secureFileEmpty\",\"params\":[],\"type\":\"SecureFile\"},{\"id\":2097791614,\"predicate\":\"secureFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"size\",\"type\":\"long\"},{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"secret\",\"type\":\"bytes\"}],\"type\":\"SecureFile\"},{\"id\":-1964327229,\"predicate\":\"secureData\",\"params\":[{\"name\":\"data\",\"type\":\"bytes\"},{\"name\":\"data_hash\",\"type\":\"bytes\"},{\"name\":\"secret\",\"type\":\"bytes\"}],\"type\":\"SecureData\"},{\"id\":2103482845,\"predicate\":\"securePlainPhone\",\"params\":[{\"name\":\"phone\",\"type\":\"string\"}],\"type\":\"SecurePlainData\"},{\"id\":569137759,\"predicate\":\"securePlainEmail\",\"params\":[{\"name\":\"email\",\"type\":\"string\"}],\"type\":\"SecurePlainData\"},{\"id\":-1658158621,\"predicate\":\"secureValueTypePersonalDetails\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":1034709504,\"predicate\":\"secureValueTypePassport\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":115615172,\"predicate\":\"secureValueTypeDriverLicense\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-1596951477,\"predicate\":\"secureValueTypeIdentityCard\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-1717268701,\"predicate\":\"secureValueTypeInternalPassport\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-874308058,\"predicate\":\"secureValueTypeAddress\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-63531698,\"predicate\":\"secureValueTypeUtilityBill\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-1995211763,\"predicate\":\"secureValueTypeBankStatement\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-1954007928,\"predicate\":\"secureValueTypeRentalAgreement\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-1713143702,\"predicate\":\"secureValueTypePassportRegistration\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-368907213,\"predicate\":\"secureValueTypeTemporaryRegistration\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-1289704741,\"predicate\":\"secureValueTypePhone\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":-1908627474,\"predicate\":\"secureValueTypeEmail\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":411017418,\"predicate\":\"secureValue\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"data\",\"type\":\"flags.0?SecureData\"},{\"name\":\"front_side\",\"type\":\"flags.1?SecureFile\"},{\"name\":\"reverse_side\",\"type\":\"flags.2?SecureFile\"},{\"name\":\"selfie\",\"type\":\"flags.3?SecureFile\"},{\"name\":\"translation\",\"type\":\"flags.6?Vector\"},{\"name\":\"files\",\"type\":\"flags.4?Vector\"},{\"name\":\"plain_data\",\"type\":\"flags.5?SecurePlainData\"},{\"name\":\"hash\",\"type\":\"bytes\"}],\"type\":\"SecureValue\"},{\"id\":-618540889,\"predicate\":\"inputSecureValue\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"data\",\"type\":\"flags.0?SecureData\"},{\"name\":\"front_side\",\"type\":\"flags.1?InputSecureFile\"},{\"name\":\"reverse_side\",\"type\":\"flags.2?InputSecureFile\"},{\"name\":\"selfie\",\"type\":\"flags.3?InputSecureFile\"},{\"name\":\"translation\",\"type\":\"flags.6?Vector\"},{\"name\":\"files\",\"type\":\"flags.4?Vector\"},{\"name\":\"plain_data\",\"type\":\"flags.5?SecurePlainData\"}],\"type\":\"InputSecureValue\"},{\"id\":-316748368,\"predicate\":\"secureValueHash\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"hash\",\"type\":\"bytes\"}],\"type\":\"SecureValueHash\"},{\"id\":-391902247,\"predicate\":\"secureValueErrorData\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"data_hash\",\"type\":\"bytes\"},{\"name\":\"field\",\"type\":\"string\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":12467706,\"predicate\":\"secureValueErrorFrontSide\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":-2037765467,\"predicate\":\"secureValueErrorReverseSide\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":-449327402,\"predicate\":\"secureValueErrorSelfie\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":2054162547,\"predicate\":\"secureValueErrorFile\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":1717706985,\"predicate\":\"secureValueErrorFiles\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"Vector\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":871426631,\"predicate\":\"secureCredentialsEncrypted\",\"params\":[{\"name\":\"data\",\"type\":\"bytes\"},{\"name\":\"hash\",\"type\":\"bytes\"},{\"name\":\"secret\",\"type\":\"bytes\"}],\"type\":\"SecureCredentialsEncrypted\"},{\"id\":-1389486888,\"predicate\":\"account.authorizationForm\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"required_types\",\"type\":\"Vector\"},{\"name\":\"values\",\"type\":\"Vector\"},{\"name\":\"errors\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"privacy_policy_url\",\"type\":\"flags.0?string\"}],\"type\":\"account.AuthorizationForm\"},{\"id\":-2128640689,\"predicate\":\"account.sentEmailCode\",\"params\":[{\"name\":\"email_pattern\",\"type\":\"string\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"account.SentEmailCode\"},{\"id\":455635795,\"predicate\":\"messageActionSecureValuesSentMe\",\"params\":[{\"name\":\"values\",\"type\":\"Vector\"},{\"name\":\"credentials\",\"type\":\"SecureCredentialsEncrypted\"}],\"type\":\"MessageAction\"},{\"id\":-648257196,\"predicate\":\"messageActionSecureValuesSent\",\"params\":[{\"name\":\"types\",\"type\":\"Vector\"}],\"type\":\"MessageAction\"},{\"id\":1722786150,\"predicate\":\"help.deepLinkInfoEmpty\",\"params\":[],\"type\":\"help.DeepLinkInfo\"},{\"id\":1783556146,\"predicate\":\"help.deepLinkInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"update_app\",\"type\":\"flags.0?true\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.1?Vector\"}],\"type\":\"help.DeepLinkInfo\"},{\"id\":289586518,\"predicate\":\"savedPhoneContact\",\"params\":[{\"name\":\"phone\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"SavedContact\"},{\"id\":1304052993,\"predicate\":\"account.takeout\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"account.Takeout\"},{\"id\":700340377,\"predicate\":\"inputTakeoutFileLocation\",\"params\":[],\"type\":\"InputFileLocation\"},{\"id\":-513517117,\"predicate\":\"updateDialogUnreadMark\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"unread\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"DialogPeer\"}],\"type\":\"Update\"},{\"id\":-253500010,\"predicate\":\"messages.dialogsNotModified\",\"params\":[{\"name\":\"count\",\"type\":\"int\"}],\"type\":\"messages.Dialogs\"},{\"id\":-1625153079,\"predicate\":\"inputWebFileGeoPointLocation\",\"params\":[{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"},{\"name\":\"zoom\",\"type\":\"int\"},{\"name\":\"scale\",\"type\":\"int\"}],\"type\":\"InputWebFileLocation\"},{\"id\":-1255369827,\"predicate\":\"contacts.topPeersDisabled\",\"params\":[],\"type\":\"contacts.TopPeers\"},{\"id\":-1685456582,\"predicate\":\"inputReportReasonCopyright\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":-732254058,\"predicate\":\"passwordKdfAlgoUnknown\",\"params\":[],\"type\":\"PasswordKdfAlgo\"},{\"id\":4883767,\"predicate\":\"securePasswordKdfAlgoUnknown\",\"params\":[],\"type\":\"SecurePasswordKdfAlgo\"},{\"id\":-1141711456,\"predicate\":\"securePasswordKdfAlgoPBKDF2HMACSHA512iter100000\",\"params\":[{\"name\":\"salt\",\"type\":\"bytes\"}],\"type\":\"SecurePasswordKdfAlgo\"},{\"id\":-2042159726,\"predicate\":\"securePasswordKdfAlgoSHA512\",\"params\":[{\"name\":\"salt\",\"type\":\"bytes\"}],\"type\":\"SecurePasswordKdfAlgo\"},{\"id\":354925740,\"predicate\":\"secureSecretSettings\",\"params\":[{\"name\":\"secure_algo\",\"type\":\"SecurePasswordKdfAlgo\"},{\"name\":\"secure_secret\",\"type\":\"bytes\"},{\"name\":\"secure_secret_id\",\"type\":\"long\"}],\"type\":\"SecureSecretSettings\"},{\"id\":982592842,\"predicate\":\"passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow\",\"params\":[{\"name\":\"salt1\",\"type\":\"bytes\"},{\"name\":\"salt2\",\"type\":\"bytes\"},{\"name\":\"g\",\"type\":\"int\"},{\"name\":\"p\",\"type\":\"bytes\"}],\"type\":\"PasswordKdfAlgo\"},{\"id\":-1736378792,\"predicate\":\"inputCheckPasswordEmpty\",\"params\":[],\"type\":\"InputCheckPasswordSRP\"},{\"id\":-763367294,\"predicate\":\"inputCheckPasswordSRP\",\"params\":[{\"name\":\"srp_id\",\"type\":\"long\"},{\"name\":\"A\",\"type\":\"bytes\"},{\"name\":\"M1\",\"type\":\"bytes\"}],\"type\":\"InputCheckPasswordSRP\"},{\"id\":-2036501105,\"predicate\":\"secureValueError\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":-1592506512,\"predicate\":\"secureValueErrorTranslationFile\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":878931416,\"predicate\":\"secureValueErrorTranslationFiles\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"Vector\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":-2103600678,\"predicate\":\"secureRequiredType\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"native_names\",\"type\":\"flags.0?true\"},{\"name\":\"selfie_required\",\"type\":\"flags.1?true\"},{\"name\":\"translation_required\",\"type\":\"flags.2?true\"},{\"name\":\"type\",\"type\":\"SecureValueType\"}],\"type\":\"SecureRequiredType\"},{\"id\":41187252,\"predicate\":\"secureRequiredTypeOneOf\",\"params\":[{\"name\":\"types\",\"type\":\"Vector\"}],\"type\":\"SecureRequiredType\"},{\"id\":-1078332329,\"predicate\":\"help.passportConfigNotModified\",\"params\":[],\"type\":\"help.PassportConfig\"},{\"id\":-1600596305,\"predicate\":\"help.passportConfig\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"countries_langs\",\"type\":\"DataJSON\"}],\"type\":\"help.PassportConfig\"},{\"id\":488313413,\"predicate\":\"inputAppEvent\",\"params\":[{\"name\":\"time\",\"type\":\"double\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"peer\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"JSONValue\"}],\"type\":\"InputAppEvent\"},{\"id\":-1059185703,\"predicate\":\"jsonObjectValue\",\"params\":[{\"name\":\"key\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"JSONValue\"}],\"type\":\"JSONObjectValue\"},{\"id\":1064139624,\"predicate\":\"jsonNull\",\"params\":[],\"type\":\"JSONValue\"},{\"id\":-952869270,\"predicate\":\"jsonBool\",\"params\":[{\"name\":\"value\",\"type\":\"Bool\"}],\"type\":\"JSONValue\"},{\"id\":736157604,\"predicate\":\"jsonNumber\",\"params\":[{\"name\":\"value\",\"type\":\"double\"}],\"type\":\"JSONValue\"},{\"id\":-1222740358,\"predicate\":\"jsonString\",\"params\":[{\"name\":\"value\",\"type\":\"string\"}],\"type\":\"JSONValue\"},{\"id\":-146520221,\"predicate\":\"jsonArray\",\"params\":[{\"name\":\"value\",\"type\":\"Vector\"}],\"type\":\"JSONValue\"},{\"id\":-1715350371,\"predicate\":\"jsonObject\",\"params\":[{\"name\":\"value\",\"type\":\"Vector\"}],\"type\":\"JSONValue\"},{\"id\":-1311015810,\"predicate\":\"inputNotifyBroadcasts\",\"params\":[],\"type\":\"InputNotifyPeer\"},{\"id\":-703403793,\"predicate\":\"notifyBroadcasts\",\"params\":[],\"type\":\"NotifyPeer\"},{\"id\":-311786236,\"predicate\":\"textSubscript\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":-939827711,\"predicate\":\"textSuperscript\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":55281185,\"predicate\":\"textMarked\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":483104362,\"predicate\":\"textPhone\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"phone\",\"type\":\"string\"}],\"type\":\"RichText\"},{\"id\":136105807,\"predicate\":\"textImage\",\"params\":[{\"name\":\"document_id\",\"type\":\"long\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"}],\"type\":\"RichText\"},{\"id\":504660880,\"predicate\":\"pageBlockKicker\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":878078826,\"predicate\":\"pageTableCell\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"header\",\"type\":\"flags.0?true\"},{\"name\":\"align_center\",\"type\":\"flags.3?true\"},{\"name\":\"align_right\",\"type\":\"flags.4?true\"},{\"name\":\"valign_middle\",\"type\":\"flags.5?true\"},{\"name\":\"valign_bottom\",\"type\":\"flags.6?true\"},{\"name\":\"text\",\"type\":\"flags.7?RichText\"},{\"name\":\"colspan\",\"type\":\"flags.1?int\"},{\"name\":\"rowspan\",\"type\":\"flags.2?int\"}],\"type\":\"PageTableCell\"},{\"id\":-524237339,\"predicate\":\"pageTableRow\",\"params\":[{\"name\":\"cells\",\"type\":\"Vector\"}],\"type\":\"PageTableRow\"},{\"id\":-1085412734,\"predicate\":\"pageBlockTable\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"bordered\",\"type\":\"flags.0?true\"},{\"name\":\"striped\",\"type\":\"flags.1?true\"},{\"name\":\"title\",\"type\":\"RichText\"},{\"name\":\"rows\",\"type\":\"Vector\"}],\"type\":\"PageBlock\"},{\"id\":1869903447,\"predicate\":\"pageCaption\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"credit\",\"type\":\"RichText\"}],\"type\":\"PageCaption\"},{\"id\":-1188055347,\"predicate\":\"pageListItemText\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageListItem\"},{\"id\":635466748,\"predicate\":\"pageListItemBlocks\",\"params\":[{\"name\":\"blocks\",\"type\":\"Vector\"}],\"type\":\"PageListItem\"},{\"id\":1577484359,\"predicate\":\"pageListOrderedItemText\",\"params\":[{\"name\":\"num\",\"type\":\"string\"},{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageListOrderedItem\"},{\"id\":-1730311882,\"predicate\":\"pageListOrderedItemBlocks\",\"params\":[{\"name\":\"num\",\"type\":\"string\"},{\"name\":\"blocks\",\"type\":\"Vector\"}],\"type\":\"PageListOrderedItem\"},{\"id\":-1702174239,\"predicate\":\"pageBlockOrderedList\",\"params\":[{\"name\":\"items\",\"type\":\"Vector\"}],\"type\":\"PageBlock\"},{\"id\":1987480557,\"predicate\":\"pageBlockDetails\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"open\",\"type\":\"flags.0?true\"},{\"name\":\"blocks\",\"type\":\"Vector\"},{\"name\":\"title\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":-1282352120,\"predicate\":\"pageRelatedArticle\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"webpage_id\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"flags.0?string\"},{\"name\":\"description\",\"type\":\"flags.1?string\"},{\"name\":\"photo_id\",\"type\":\"flags.2?long\"},{\"name\":\"author\",\"type\":\"flags.3?string\"},{\"name\":\"published_date\",\"type\":\"flags.4?int\"}],\"type\":\"PageRelatedArticle\"},{\"id\":370236054,\"predicate\":\"pageBlockRelatedArticles\",\"params\":[{\"name\":\"title\",\"type\":\"RichText\"},{\"name\":\"articles\",\"type\":\"Vector\"}],\"type\":\"PageBlock\"},{\"id\":-1538310410,\"predicate\":\"pageBlockMap\",\"params\":[{\"name\":\"geo\",\"type\":\"GeoPoint\"},{\"name\":\"zoom\",\"type\":\"int\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":-1738178803,\"predicate\":\"page\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"part\",\"type\":\"flags.0?true\"},{\"name\":\"rtl\",\"type\":\"flags.1?true\"},{\"name\":\"v2\",\"type\":\"flags.2?true\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"blocks\",\"type\":\"Vector\"},{\"name\":\"photos\",\"type\":\"Vector\"},{\"name\":\"documents\",\"type\":\"Vector\"},{\"name\":\"views\",\"type\":\"flags.3?int\"}],\"type\":\"Page\"},{\"id\":-610373422,\"predicate\":\"inputPrivacyKeyPhoneP2P\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":961092808,\"predicate\":\"privacyKeyPhoneP2P\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":894777186,\"predicate\":\"textAnchor\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"name\",\"type\":\"string\"}],\"type\":\"RichText\"},{\"id\":-1945767479,\"predicate\":\"help.supportName\",\"params\":[{\"name\":\"name\",\"type\":\"string\"}],\"type\":\"help.SupportName\"},{\"id\":-206688531,\"predicate\":\"help.userInfoEmpty\",\"params\":[],\"type\":\"help.UserInfo\"},{\"id\":32192344,\"predicate\":\"help.userInfo\",\"params\":[{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"Vector\"},{\"name\":\"author\",\"type\":\"string\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"help.UserInfo\"},{\"id\":-202219658,\"predicate\":\"messageActionContactSignUp\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":-1398708869,\"predicate\":\"updateMessagePoll\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"poll_id\",\"type\":\"long\"},{\"name\":\"poll\",\"type\":\"flags.0?Poll\"},{\"name\":\"results\",\"type\":\"PollResults\"}],\"type\":\"Update\"},{\"id\":1823064809,\"predicate\":\"pollAnswer\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"option\",\"type\":\"bytes\"}],\"type\":\"PollAnswer\"},{\"id\":-2032041631,\"predicate\":\"poll\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"closed\",\"type\":\"flags.0?true\"},{\"name\":\"public_voters\",\"type\":\"flags.1?true\"},{\"name\":\"multiple_choice\",\"type\":\"flags.2?true\"},{\"name\":\"quiz\",\"type\":\"flags.3?true\"},{\"name\":\"question\",\"type\":\"string\"},{\"name\":\"answers\",\"type\":\"Vector\"},{\"name\":\"close_period\",\"type\":\"flags.4?int\"},{\"name\":\"close_date\",\"type\":\"flags.5?int\"}],\"type\":\"Poll\"},{\"id\":997055186,\"predicate\":\"pollAnswerVoters\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"chosen\",\"type\":\"flags.0?true\"},{\"name\":\"correct\",\"type\":\"flags.1?true\"},{\"name\":\"option\",\"type\":\"bytes\"},{\"name\":\"voters\",\"type\":\"int\"}],\"type\":\"PollAnswerVoters\"},{\"id\":-591909213,\"predicate\":\"pollResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"min\",\"type\":\"flags.0?true\"},{\"name\":\"results\",\"type\":\"flags.1?Vector\"},{\"name\":\"total_voters\",\"type\":\"flags.2?int\"},{\"name\":\"recent_voters\",\"type\":\"flags.3?Vector\"},{\"name\":\"solution\",\"type\":\"flags.4?string\"},{\"name\":\"solution_entities\",\"type\":\"flags.4?Vector\"}],\"type\":\"PollResults\"},{\"id\":261416433,\"predicate\":\"inputMediaPoll\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"poll\",\"type\":\"Poll\"},{\"name\":\"correct_answers\",\"type\":\"flags.0?Vector\"},{\"name\":\"solution\",\"type\":\"flags.1?string\"},{\"name\":\"solution_entities\",\"type\":\"flags.1?Vector\"}],\"type\":\"InputMedia\"},{\"id\":1272375192,\"predicate\":\"messageMediaPoll\",\"params\":[{\"name\":\"poll\",\"type\":\"Poll\"},{\"name\":\"results\",\"type\":\"PollResults\"}],\"type\":\"MessageMedia\"},{\"id\":-264117680,\"predicate\":\"chatOnlines\",\"params\":[{\"name\":\"onlines\",\"type\":\"int\"}],\"type\":\"ChatOnlines\"},{\"id\":1202287072,\"predicate\":\"statsURL\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"StatsURL\"},{\"id\":-525288402,\"predicate\":\"photoStrippedSize\",\"params\":[{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"PhotoSize\"},{\"id\":1605510357,\"predicate\":\"chatAdminRights\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"change_info\",\"type\":\"flags.0?true\"},{\"name\":\"post_messages\",\"type\":\"flags.1?true\"},{\"name\":\"edit_messages\",\"type\":\"flags.2?true\"},{\"name\":\"delete_messages\",\"type\":\"flags.3?true\"},{\"name\":\"ban_users\",\"type\":\"flags.4?true\"},{\"name\":\"invite_users\",\"type\":\"flags.5?true\"},{\"name\":\"pin_messages\",\"type\":\"flags.7?true\"},{\"name\":\"add_admins\",\"type\":\"flags.9?true\"},{\"name\":\"anonymous\",\"type\":\"flags.10?true\"},{\"name\":\"manage_call\",\"type\":\"flags.11?true\"},{\"name\":\"other\",\"type\":\"flags.12?true\"},{\"name\":\"manage_topics\",\"type\":\"flags.13?true\"}],\"type\":\"ChatAdminRights\"},{\"id\":-1626209256,\"predicate\":\"chatBannedRights\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"view_messages\",\"type\":\"flags.0?true\"},{\"name\":\"send_messages\",\"type\":\"flags.1?true\"},{\"name\":\"send_media\",\"type\":\"flags.2?true\"},{\"name\":\"send_stickers\",\"type\":\"flags.3?true\"},{\"name\":\"send_gifs\",\"type\":\"flags.4?true\"},{\"name\":\"send_games\",\"type\":\"flags.5?true\"},{\"name\":\"send_inline\",\"type\":\"flags.6?true\"},{\"name\":\"embed_links\",\"type\":\"flags.7?true\"},{\"name\":\"send_polls\",\"type\":\"flags.8?true\"},{\"name\":\"change_info\",\"type\":\"flags.10?true\"},{\"name\":\"invite_users\",\"type\":\"flags.15?true\"},{\"name\":\"pin_messages\",\"type\":\"flags.17?true\"},{\"name\":\"manage_topics\",\"type\":\"flags.18?true\"},{\"name\":\"send_photos\",\"type\":\"flags.19?true\"},{\"name\":\"send_videos\",\"type\":\"flags.20?true\"},{\"name\":\"send_roundvideos\",\"type\":\"flags.21?true\"},{\"name\":\"send_audios\",\"type\":\"flags.22?true\"},{\"name\":\"send_voices\",\"type\":\"flags.23?true\"},{\"name\":\"send_docs\",\"type\":\"flags.24?true\"},{\"name\":\"send_plain\",\"type\":\"flags.25?true\"},{\"name\":\"until_date\",\"type\":\"int\"}],\"type\":\"ChatBannedRights\"},{\"id\":1421875280,\"predicate\":\"updateChatDefaultBannedRights\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"default_banned_rights\",\"type\":\"ChatBannedRights\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-433014407,\"predicate\":\"inputWallPaper\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputWallPaper\"},{\"id\":1913199744,\"predicate\":\"inputWallPaperSlug\",\"params\":[{\"name\":\"slug\",\"type\":\"string\"}],\"type\":\"InputWallPaper\"},{\"id\":-1150621555,\"predicate\":\"channelParticipantsContacts\",\"params\":[{\"name\":\"q\",\"type\":\"string\"}],\"type\":\"ChannelParticipantsFilter\"},{\"id\":771095562,\"predicate\":\"channelAdminLogEventActionDefaultBannedRights\",\"params\":[{\"name\":\"prev_banned_rights\",\"type\":\"ChatBannedRights\"},{\"name\":\"new_banned_rights\",\"type\":\"ChatBannedRights\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-1895328189,\"predicate\":\"channelAdminLogEventActionStopPoll\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":471437699,\"predicate\":\"account.wallPapersNotModified\",\"params\":[],\"type\":\"account.WallPapers\"},{\"id\":-842824308,\"predicate\":\"account.wallPapers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"wallpapers\",\"type\":\"Vector\"}],\"type\":\"account.WallPapers\"},{\"id\":-1390068360,\"predicate\":\"codeSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"allow_flashcall\",\"type\":\"flags.0?true\"},{\"name\":\"current_number\",\"type\":\"flags.1?true\"},{\"name\":\"allow_app_hash\",\"type\":\"flags.4?true\"},{\"name\":\"allow_missed_call\",\"type\":\"flags.5?true\"},{\"name\":\"allow_firebase\",\"type\":\"flags.7?true\"},{\"name\":\"logout_tokens\",\"type\":\"flags.6?Vector\"},{\"name\":\"token\",\"type\":\"flags.8?string\"},{\"name\":\"app_sandbox\",\"type\":\"flags.8?Bool\"}],\"type\":\"CodeSettings\"},{\"id\":499236004,\"predicate\":\"wallPaperSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"blur\",\"type\":\"flags.1?true\"},{\"name\":\"motion\",\"type\":\"flags.2?true\"},{\"name\":\"background_color\",\"type\":\"flags.0?int\"},{\"name\":\"second_background_color\",\"type\":\"flags.4?int\"},{\"name\":\"third_background_color\",\"type\":\"flags.5?int\"},{\"name\":\"fourth_background_color\",\"type\":\"flags.6?int\"},{\"name\":\"intensity\",\"type\":\"flags.3?int\"},{\"name\":\"rotation\",\"type\":\"flags.4?int\"}],\"type\":\"WallPaperSettings\"},{\"id\":-1896171181,\"predicate\":\"autoDownloadSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"disabled\",\"type\":\"flags.0?true\"},{\"name\":\"video_preload_large\",\"type\":\"flags.1?true\"},{\"name\":\"audio_preload_next\",\"type\":\"flags.2?true\"},{\"name\":\"phonecalls_less_data\",\"type\":\"flags.3?true\"},{\"name\":\"photo_size_max\",\"type\":\"int\"},{\"name\":\"video_size_max\",\"type\":\"long\"},{\"name\":\"file_size_max\",\"type\":\"long\"},{\"name\":\"video_upload_maxbitrate\",\"type\":\"int\"}],\"type\":\"AutoDownloadSettings\"},{\"id\":1674235686,\"predicate\":\"account.autoDownloadSettings\",\"params\":[{\"name\":\"low\",\"type\":\"AutoDownloadSettings\"},{\"name\":\"medium\",\"type\":\"AutoDownloadSettings\"},{\"name\":\"high\",\"type\":\"AutoDownloadSettings\"}],\"type\":\"account.AutoDownloadSettings\"},{\"id\":-709641735,\"predicate\":\"emojiKeyword\",\"params\":[{\"name\":\"keyword\",\"type\":\"string\"},{\"name\":\"emoticons\",\"type\":\"Vector\"}],\"type\":\"EmojiKeyword\"},{\"id\":594408994,\"predicate\":\"emojiKeywordDeleted\",\"params\":[{\"name\":\"keyword\",\"type\":\"string\"},{\"name\":\"emoticons\",\"type\":\"Vector\"}],\"type\":\"EmojiKeyword\"},{\"id\":1556570557,\"predicate\":\"emojiKeywordsDifference\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"from_version\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"int\"},{\"name\":\"keywords\",\"type\":\"Vector\"}],\"type\":\"EmojiKeywordsDifference\"},{\"id\":-1519029347,\"predicate\":\"emojiURL\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"EmojiURL\"},{\"id\":-1275374751,\"predicate\":\"emojiLanguage\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"EmojiLanguage\"},{\"id\":-1529000952,\"predicate\":\"inputPrivacyKeyForwards\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":1777096355,\"predicate\":\"privacyKeyForwards\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":1461304012,\"predicate\":\"inputPrivacyKeyProfilePhoto\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":-1777000467,\"predicate\":\"privacyKeyProfilePhoto\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":1075322878,\"predicate\":\"inputPhotoFileLocation\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"},{\"name\":\"thumb_size\",\"type\":\"string\"}],\"type\":\"InputFileLocation\"},{\"id\":-667654413,\"predicate\":\"inputPhotoLegacyFileLocation\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"},{\"name\":\"volume_id\",\"type\":\"long\"},{\"name\":\"local_id\",\"type\":\"int\"},{\"name\":\"secret\",\"type\":\"long\"}],\"type\":\"InputFileLocation\"},{\"id\":925204121,\"predicate\":\"inputPeerPhotoFileLocation\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"big\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"photo_id\",\"type\":\"long\"}],\"type\":\"InputFileLocation\"},{\"id\":-1652231205,\"predicate\":\"inputStickerSetThumb\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"thumb_version\",\"type\":\"int\"}],\"type\":\"InputFileLocation\"},{\"id\":-11252123,\"predicate\":\"folder\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"autofill_new_broadcasts\",\"type\":\"flags.0?true\"},{\"name\":\"autofill_public_groups\",\"type\":\"flags.1?true\"},{\"name\":\"autofill_new_correspondents\",\"type\":\"flags.2?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.3?ChatPhoto\"}],\"type\":\"Folder\"},{\"id\":1908216652,\"predicate\":\"dialogFolder\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.2?true\"},{\"name\":\"folder\",\"type\":\"Folder\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"top_message\",\"type\":\"int\"},{\"name\":\"unread_muted_peers_count\",\"type\":\"int\"},{\"name\":\"unread_unmuted_peers_count\",\"type\":\"int\"},{\"name\":\"unread_muted_messages_count\",\"type\":\"int\"},{\"name\":\"unread_unmuted_messages_count\",\"type\":\"int\"}],\"type\":\"Dialog\"},{\"id\":1684014375,\"predicate\":\"inputDialogPeerFolder\",\"params\":[{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"InputDialogPeer\"},{\"id\":1363483106,\"predicate\":\"dialogPeerFolder\",\"params\":[{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"DialogPeer\"},{\"id\":-70073706,\"predicate\":\"inputFolderPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"InputFolderPeer\"},{\"id\":-373643672,\"predicate\":\"folderPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"FolderPeer\"},{\"id\":422972864,\"predicate\":\"updateFolderPeers\",\"params\":[{\"name\":\"folder_peers\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":497305826,\"predicate\":\"inputUserFromMessage\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"InputUser\"},{\"id\":1536380829,\"predicate\":\"inputChannelFromMessage\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"channel_id\",\"type\":\"long\"}],\"type\":\"InputChannel\"},{\"id\":-1468331492,\"predicate\":\"inputPeerUserFromMessage\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"InputPeer\"},{\"id\":-1121318848,\"predicate\":\"inputPeerChannelFromMessage\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"channel_id\",\"type\":\"long\"}],\"type\":\"InputPeer\"},{\"id\":55761658,\"predicate\":\"inputPrivacyKeyPhoneNumber\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":-778378131,\"predicate\":\"privacyKeyPhoneNumber\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":-1472172887,\"predicate\":\"topPeerCategoryForwardUsers\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":-68239120,\"predicate\":\"topPeerCategoryForwardChats\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":84703944,\"predicate\":\"channelAdminLogEventActionChangeLinkedChat\",\"params\":[{\"name\":\"prev_value\",\"type\":\"long\"},{\"name\":\"new_value\",\"type\":\"long\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-398136321,\"predicate\":\"messages.searchCounter\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"inexact\",\"type\":\"flags.1?true\"},{\"name\":\"filter\",\"type\":\"MessagesFilter\"},{\"name\":\"count\",\"type\":\"int\"}],\"type\":\"messages.SearchCounter\"},{\"id\":280464681,\"predicate\":\"keyboardButtonUrlAuth\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"fwd_text\",\"type\":\"flags.0?string\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"button_id\",\"type\":\"int\"}],\"type\":\"KeyboardButton\"},{\"id\":-802258988,\"predicate\":\"inputKeyboardButtonUrlAuth\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"request_write_access\",\"type\":\"flags.0?true\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"fwd_text\",\"type\":\"flags.1?string\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"bot\",\"type\":\"InputUser\"}],\"type\":\"KeyboardButton\"},{\"id\":-1831650802,\"predicate\":\"urlAuthResultRequest\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"request_write_access\",\"type\":\"flags.0?true\"},{\"name\":\"bot\",\"type\":\"User\"},{\"name\":\"domain\",\"type\":\"string\"}],\"type\":\"UrlAuthResult\"},{\"id\":-1886646706,\"predicate\":\"urlAuthResultAccepted\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"UrlAuthResult\"},{\"id\":-1445536993,\"predicate\":\"urlAuthResultDefault\",\"params\":[],\"type\":\"UrlAuthResult\"},{\"id\":-2079962673,\"predicate\":\"inputPrivacyValueAllowChatParticipants\",\"params\":[{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"InputPrivacyRule\"},{\"id\":-380694650,\"predicate\":\"inputPrivacyValueDisallowChatParticipants\",\"params\":[{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"InputPrivacyRule\"},{\"id\":1796427406,\"predicate\":\"privacyValueAllowChatParticipants\",\"params\":[{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"PrivacyRule\"},{\"id\":1103656293,\"predicate\":\"privacyValueDisallowChatParticipants\",\"params\":[{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"PrivacyRule\"},{\"id\":-1672577397,\"predicate\":\"messageEntityUnderline\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":-1090087980,\"predicate\":\"messageEntityStrike\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":34469328,\"predicate\":\"messageEntityBlockquote\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":1786671974,\"predicate\":\"updatePeerSettings\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"settings\",\"type\":\"PeerSettings\"}],\"type\":\"Update\"},{\"id\":-1078612597,\"predicate\":\"channelLocationEmpty\",\"params\":[],\"type\":\"ChannelLocation\"},{\"id\":547062491,\"predicate\":\"channelLocation\",\"params\":[{\"name\":\"geo_point\",\"type\":\"GeoPoint\"},{\"name\":\"address\",\"type\":\"string\"}],\"type\":\"ChannelLocation\"},{\"id\":-901375139,\"predicate\":\"peerLocated\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"expires\",\"type\":\"int\"},{\"name\":\"distance\",\"type\":\"int\"}],\"type\":\"PeerLocated\"},{\"id\":-1263546448,\"predicate\":\"updatePeerLocated\",\"params\":[{\"name\":\"peers\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":241923758,\"predicate\":\"channelAdminLogEventActionChangeLocation\",\"params\":[{\"name\":\"prev_value\",\"type\":\"ChannelLocation\"},{\"name\":\"new_value\",\"type\":\"ChannelLocation\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-606798099,\"predicate\":\"inputReportReasonGeoIrrelevant\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":1401984889,\"predicate\":\"channelAdminLogEventActionToggleSlowMode\",\"params\":[{\"name\":\"prev_value\",\"type\":\"int\"},{\"name\":\"new_value\",\"type\":\"int\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1148485274,\"predicate\":\"auth.authorizationSignUpRequired\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"terms_of_service\",\"type\":\"flags.0?help.TermsOfService\"}],\"type\":\"auth.Authorization\"},{\"id\":-666824391,\"predicate\":\"payments.paymentVerificationNeeded\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"payments.PaymentResult\"},{\"id\":42402760,\"predicate\":\"inputStickerSetAnimatedEmoji\",\"params\":[],\"type\":\"InputStickerSet\"},{\"id\":967122427,\"predicate\":\"updateNewScheduledMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"}],\"type\":\"Update\"},{\"id\":-1870238482,\"predicate\":\"updateDeleteScheduledMessages\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"messages\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":-797791052,\"predicate\":\"restrictionReason\",\"params\":[{\"name\":\"platform\",\"type\":\"string\"},{\"name\":\"reason\",\"type\":\"string\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"RestrictionReason\"},{\"id\":1012306921,\"predicate\":\"inputTheme\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputTheme\"},{\"id\":-175567375,\"predicate\":\"inputThemeSlug\",\"params\":[{\"name\":\"slug\",\"type\":\"string\"}],\"type\":\"InputTheme\"},{\"id\":-1609668650,\"predicate\":\"theme\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"creator\",\"type\":\"flags.0?true\"},{\"name\":\"default\",\"type\":\"flags.1?true\"},{\"name\":\"for_chat\",\"type\":\"flags.5?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"slug\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"document\",\"type\":\"flags.2?Document\"},{\"name\":\"settings\",\"type\":\"flags.3?Vector\"},{\"name\":\"emoticon\",\"type\":\"flags.6?string\"},{\"name\":\"installs_count\",\"type\":\"flags.4?int\"}],\"type\":\"Theme\"},{\"id\":-199313886,\"predicate\":\"account.themesNotModified\",\"params\":[],\"type\":\"account.Themes\"},{\"id\":-1707242387,\"predicate\":\"account.themes\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"themes\",\"type\":\"Vector\"}],\"type\":\"account.Themes\"},{\"id\":-2112423005,\"predicate\":\"updateTheme\",\"params\":[{\"name\":\"theme\",\"type\":\"Theme\"}],\"type\":\"Update\"},{\"id\":-786326563,\"predicate\":\"inputPrivacyKeyAddedByPhone\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":1124062251,\"predicate\":\"privacyKeyAddedByPhone\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":-2027964103,\"predicate\":\"updateGeoLiveViewed\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":1448076945,\"predicate\":\"updateLoginToken\",\"params\":[],\"type\":\"Update\"},{\"id\":1654593920,\"predicate\":\"auth.loginToken\",\"params\":[{\"name\":\"expires\",\"type\":\"int\"},{\"name\":\"token\",\"type\":\"bytes\"}],\"type\":\"auth.LoginToken\"},{\"id\":110008598,\"predicate\":\"auth.loginTokenMigrateTo\",\"params\":[{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"token\",\"type\":\"bytes\"}],\"type\":\"auth.LoginToken\"},{\"id\":957176926,\"predicate\":\"auth.loginTokenSuccess\",\"params\":[{\"name\":\"authorization\",\"type\":\"auth.Authorization\"}],\"type\":\"auth.LoginToken\"},{\"id\":1474462241,\"predicate\":\"account.contentSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"sensitive_enabled\",\"type\":\"flags.0?true\"},{\"name\":\"sensitive_can_change\",\"type\":\"flags.1?true\"}],\"type\":\"account.ContentSettings\"},{\"id\":-1456996667,\"predicate\":\"messages.inactiveChats\",\"params\":[{\"name\":\"dates\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.InactiveChats\"},{\"id\":-1012849566,\"predicate\":\"baseThemeClassic\",\"params\":[],\"type\":\"BaseTheme\"},{\"id\":-69724536,\"predicate\":\"baseThemeDay\",\"params\":[],\"type\":\"BaseTheme\"},{\"id\":-1212997976,\"predicate\":\"baseThemeNight\",\"params\":[],\"type\":\"BaseTheme\"},{\"id\":1834973166,\"predicate\":\"baseThemeTinted\",\"params\":[],\"type\":\"BaseTheme\"},{\"id\":1527845466,\"predicate\":\"baseThemeArctic\",\"params\":[],\"type\":\"BaseTheme\"},{\"id\":-1770371538,\"predicate\":\"inputWallPaperNoFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"InputWallPaper\"},{\"id\":-528465642,\"predicate\":\"wallPaperNoFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"default\",\"type\":\"flags.1?true\"},{\"name\":\"dark\",\"type\":\"flags.4?true\"},{\"name\":\"settings\",\"type\":\"flags.2?WallPaperSettings\"}],\"type\":\"WallPaper\"},{\"id\":-1881255857,\"predicate\":\"inputThemeSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"message_colors_animated\",\"type\":\"flags.2?true\"},{\"name\":\"base_theme\",\"type\":\"BaseTheme\"},{\"name\":\"accent_color\",\"type\":\"int\"},{\"name\":\"outbox_accent_color\",\"type\":\"flags.3?int\"},{\"name\":\"message_colors\",\"type\":\"flags.0?Vector\"},{\"name\":\"wallpaper\",\"type\":\"flags.1?InputWallPaper\"},{\"name\":\"wallpaper_settings\",\"type\":\"flags.1?WallPaperSettings\"}],\"type\":\"InputThemeSettings\"},{\"id\":-94849324,\"predicate\":\"themeSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"message_colors_animated\",\"type\":\"flags.2?true\"},{\"name\":\"base_theme\",\"type\":\"BaseTheme\"},{\"name\":\"accent_color\",\"type\":\"int\"},{\"name\":\"outbox_accent_color\",\"type\":\"flags.3?int\"},{\"name\":\"message_colors\",\"type\":\"flags.0?Vector\"},{\"name\":\"wallpaper\",\"type\":\"flags.1?WallPaper\"}],\"type\":\"ThemeSettings\"},{\"id\":1421174295,\"predicate\":\"webPageAttributeTheme\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"documents\",\"type\":\"flags.0?Vector\"},{\"name\":\"settings\",\"type\":\"flags.1?ThemeSettings\"}],\"type\":\"WebPageAttribute\"},{\"id\":274961865,\"predicate\":\"updateMessagePollVote\",\"params\":[{\"name\":\"poll_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"options\",\"type\":\"Vector\"},{\"name\":\"qts\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":886196148,\"predicate\":\"messageUserVote\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"option\",\"type\":\"bytes\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"MessageUserVote\"},{\"id\":1017491692,\"predicate\":\"messageUserVoteInputOption\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"MessageUserVote\"},{\"id\":-1973033641,\"predicate\":\"messageUserVoteMultiple\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"options\",\"type\":\"Vector\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"MessageUserVote\"},{\"id\":136574537,\"predicate\":\"messages.votesList\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"votes\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"next_offset\",\"type\":\"flags.0?string\"}],\"type\":\"messages.VotesList\"},{\"id\":-1144565411,\"predicate\":\"keyboardButtonRequestPoll\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"quiz\",\"type\":\"flags.0?Bool\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":1981704948,\"predicate\":\"messageEntityBankCard\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":-177732982,\"predicate\":\"bankCardOpenUrl\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"name\",\"type\":\"string\"}],\"type\":\"BankCardOpenUrl\"},{\"id\":1042605427,\"predicate\":\"payments.bankCardData\",\"params\":[{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"open_urls\",\"type\":\"Vector\"}],\"type\":\"payments.BankCardData\"},{\"id\":-118740917,\"predicate\":\"peerSelfLocated\",\"params\":[{\"name\":\"expires\",\"type\":\"int\"}],\"type\":\"PeerLocated\"},{\"id\":1949890536,\"predicate\":\"dialogFilter\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"contacts\",\"type\":\"flags.0?true\"},{\"name\":\"non_contacts\",\"type\":\"flags.1?true\"},{\"name\":\"groups\",\"type\":\"flags.2?true\"},{\"name\":\"broadcasts\",\"type\":\"flags.3?true\"},{\"name\":\"bots\",\"type\":\"flags.4?true\"},{\"name\":\"exclude_muted\",\"type\":\"flags.11?true\"},{\"name\":\"exclude_read\",\"type\":\"flags.12?true\"},{\"name\":\"exclude_archived\",\"type\":\"flags.13?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"emoticon\",\"type\":\"flags.25?string\"},{\"name\":\"pinned_peers\",\"type\":\"Vector\"},{\"name\":\"include_peers\",\"type\":\"Vector\"},{\"name\":\"exclude_peers\",\"type\":\"Vector\"}],\"type\":\"DialogFilter\"},{\"id\":2004110666,\"predicate\":\"dialogFilterSuggested\",\"params\":[{\"name\":\"filter\",\"type\":\"DialogFilter\"},{\"name\":\"description\",\"type\":\"string\"}],\"type\":\"DialogFilterSuggested\"},{\"id\":654302845,\"predicate\":\"updateDialogFilter\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"filter\",\"type\":\"flags.0?DialogFilter\"}],\"type\":\"Update\"},{\"id\":-1512627963,\"predicate\":\"updateDialogFilterOrder\",\"params\":[{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":889491791,\"predicate\":\"updateDialogFilters\",\"params\":[],\"type\":\"Update\"},{\"id\":-1237848657,\"predicate\":\"statsDateRangeDays\",\"params\":[{\"name\":\"min_date\",\"type\":\"int\"},{\"name\":\"max_date\",\"type\":\"int\"}],\"type\":\"StatsDateRangeDays\"},{\"id\":-884757282,\"predicate\":\"statsAbsValueAndPrev\",\"params\":[{\"name\":\"current\",\"type\":\"double\"},{\"name\":\"previous\",\"type\":\"double\"}],\"type\":\"StatsAbsValueAndPrev\"},{\"id\":-875679776,\"predicate\":\"statsPercentValue\",\"params\":[{\"name\":\"part\",\"type\":\"double\"},{\"name\":\"total\",\"type\":\"double\"}],\"type\":\"StatsPercentValue\"},{\"id\":1244130093,\"predicate\":\"statsGraphAsync\",\"params\":[{\"name\":\"token\",\"type\":\"string\"}],\"type\":\"StatsGraph\"},{\"id\":-1092839390,\"predicate\":\"statsGraphError\",\"params\":[{\"name\":\"error\",\"type\":\"string\"}],\"type\":\"StatsGraph\"},{\"id\":-1901828938,\"predicate\":\"statsGraph\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"json\",\"type\":\"DataJSON\"},{\"name\":\"zoom_token\",\"type\":\"flags.0?string\"}],\"type\":\"StatsGraph\"},{\"id\":-1387279939,\"predicate\":\"messageInteractionCounters\",\"params\":[{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"views\",\"type\":\"int\"},{\"name\":\"forwards\",\"type\":\"int\"}],\"type\":\"MessageInteractionCounters\"},{\"id\":-1107852396,\"predicate\":\"stats.broadcastStats\",\"params\":[{\"name\":\"period\",\"type\":\"StatsDateRangeDays\"},{\"name\":\"followers\",\"type\":\"StatsAbsValueAndPrev\"},{\"name\":\"views_per_post\",\"type\":\"StatsAbsValueAndPrev\"},{\"name\":\"shares_per_post\",\"type\":\"StatsAbsValueAndPrev\"},{\"name\":\"enabled_notifications\",\"type\":\"StatsPercentValue\"},{\"name\":\"growth_graph\",\"type\":\"StatsGraph\"},{\"name\":\"followers_graph\",\"type\":\"StatsGraph\"},{\"name\":\"mute_graph\",\"type\":\"StatsGraph\"},{\"name\":\"top_hours_graph\",\"type\":\"StatsGraph\"},{\"name\":\"interactions_graph\",\"type\":\"StatsGraph\"},{\"name\":\"iv_interactions_graph\",\"type\":\"StatsGraph\"},{\"name\":\"views_by_source_graph\",\"type\":\"StatsGraph\"},{\"name\":\"new_followers_by_source_graph\",\"type\":\"StatsGraph\"},{\"name\":\"languages_graph\",\"type\":\"StatsGraph\"},{\"name\":\"recent_message_interactions\",\"type\":\"Vector\"}],\"type\":\"stats.BroadcastStats\"},{\"id\":-428884101,\"predicate\":\"inputMediaDice\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"}],\"type\":\"InputMedia\"},{\"id\":1065280907,\"predicate\":\"messageMediaDice\",\"params\":[{\"name\":\"value\",\"type\":\"int\"},{\"name\":\"emoticon\",\"type\":\"string\"}],\"type\":\"MessageMedia\"},{\"id\":-427863538,\"predicate\":\"inputStickerSetDice\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"}],\"type\":\"InputStickerSet\"},{\"id\":-1728664459,\"predicate\":\"help.promoDataEmpty\",\"params\":[{\"name\":\"expires\",\"type\":\"int\"}],\"type\":\"help.PromoData\"},{\"id\":-1942390465,\"predicate\":\"help.promoData\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"proxy\",\"type\":\"flags.0?true\"},{\"name\":\"expires\",\"type\":\"int\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"psa_type\",\"type\":\"flags.1?string\"},{\"name\":\"psa_message\",\"type\":\"flags.2?string\"}],\"type\":\"help.PromoData\"},{\"id\":-567037804,\"predicate\":\"videoSize\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"},{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"video_start_ts\",\"type\":\"flags.0?double\"}],\"type\":\"VideoSize\"},{\"id\":643940105,\"predicate\":\"updatePhoneCallSignalingData\",\"params\":[{\"name\":\"phone_call_id\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"type\":\"Update\"},{\"id\":1634294960,\"predicate\":\"chatInvitePeek\",\"params\":[{\"name\":\"chat\",\"type\":\"Chat\"},{\"name\":\"expires\",\"type\":\"int\"}],\"type\":\"ChatInvite\"},{\"id\":-1660637285,\"predicate\":\"statsGroupTopPoster\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"messages\",\"type\":\"int\"},{\"name\":\"avg_chars\",\"type\":\"int\"}],\"type\":\"StatsGroupTopPoster\"},{\"id\":-682079097,\"predicate\":\"statsGroupTopAdmin\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"deleted\",\"type\":\"int\"},{\"name\":\"kicked\",\"type\":\"int\"},{\"name\":\"banned\",\"type\":\"int\"}],\"type\":\"StatsGroupTopAdmin\"},{\"id\":1398765469,\"predicate\":\"statsGroupTopInviter\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"invitations\",\"type\":\"int\"}],\"type\":\"StatsGroupTopInviter\"},{\"id\":-276825834,\"predicate\":\"stats.megagroupStats\",\"params\":[{\"name\":\"period\",\"type\":\"StatsDateRangeDays\"},{\"name\":\"members\",\"type\":\"StatsAbsValueAndPrev\"},{\"name\":\"messages\",\"type\":\"StatsAbsValueAndPrev\"},{\"name\":\"viewers\",\"type\":\"StatsAbsValueAndPrev\"},{\"name\":\"posters\",\"type\":\"StatsAbsValueAndPrev\"},{\"name\":\"growth_graph\",\"type\":\"StatsGraph\"},{\"name\":\"members_graph\",\"type\":\"StatsGraph\"},{\"name\":\"new_members_by_source_graph\",\"type\":\"StatsGraph\"},{\"name\":\"languages_graph\",\"type\":\"StatsGraph\"},{\"name\":\"messages_graph\",\"type\":\"StatsGraph\"},{\"name\":\"actions_graph\",\"type\":\"StatsGraph\"},{\"name\":\"top_hours_graph\",\"type\":\"StatsGraph\"},{\"name\":\"weekdays_graph\",\"type\":\"StatsGraph\"},{\"name\":\"top_posters\",\"type\":\"Vector\"},{\"name\":\"top_admins\",\"type\":\"Vector\"},{\"name\":\"top_inviters\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"stats.MegagroupStats\"},{\"id\":-1096616924,\"predicate\":\"globalPrivacySettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"archive_and_mute_new_noncontact_peers\",\"type\":\"flags.0?Bool\"}],\"type\":\"GlobalPrivacySettings\"},{\"id\":1667228533,\"predicate\":\"phoneConnectionWebrtc\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"turn\",\"type\":\"flags.0?true\"},{\"name\":\"stun\",\"type\":\"flags.1?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"ip\",\"type\":\"string\"},{\"name\":\"ipv6\",\"type\":\"string\"},{\"name\":\"port\",\"type\":\"int\"},{\"name\":\"username\",\"type\":\"string\"},{\"name\":\"password\",\"type\":\"string\"}],\"type\":\"PhoneConnection\"},{\"id\":1107543535,\"predicate\":\"help.countryCode\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"country_code\",\"type\":\"string\"},{\"name\":\"prefixes\",\"type\":\"flags.0?Vector\"},{\"name\":\"patterns\",\"type\":\"flags.1?Vector\"}],\"type\":\"help.CountryCode\"},{\"id\":-1014526429,\"predicate\":\"help.country\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"hidden\",\"type\":\"flags.0?true\"},{\"name\":\"iso2\",\"type\":\"string\"},{\"name\":\"default_name\",\"type\":\"string\"},{\"name\":\"name\",\"type\":\"flags.1?string\"},{\"name\":\"country_codes\",\"type\":\"Vector\"}],\"type\":\"help.Country\"},{\"id\":-1815339214,\"predicate\":\"help.countriesListNotModified\",\"params\":[],\"type\":\"help.CountriesList\"},{\"id\":-2016381538,\"predicate\":\"help.countriesList\",\"params\":[{\"name\":\"countries\",\"type\":\"Vector\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"help.CountriesList\"},{\"id\":1163625789,\"predicate\":\"messageViews\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"views\",\"type\":\"flags.0?int\"},{\"name\":\"forwards\",\"type\":\"flags.1?int\"},{\"name\":\"replies\",\"type\":\"flags.2?MessageReplies\"}],\"type\":\"MessageViews\"},{\"id\":-761649164,\"predicate\":\"updateChannelMessageForwards\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"forwards\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-96535659,\"predicate\":\"photoSizeProgressive\",\"params\":[{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"},{\"name\":\"sizes\",\"type\":\"Vector\"}],\"type\":\"PhotoSize\"},{\"id\":-1228606141,\"predicate\":\"messages.messageViews\",\"params\":[{\"name\":\"views\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.MessageViews\"},{\"id\":-693004986,\"predicate\":\"updateReadChannelDiscussionInbox\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"top_msg_id\",\"type\":\"int\"},{\"name\":\"read_max_id\",\"type\":\"int\"},{\"name\":\"broadcast_id\",\"type\":\"flags.0?long\"},{\"name\":\"broadcast_post\",\"type\":\"flags.0?int\"}],\"type\":\"Update\"},{\"id\":1767677564,\"predicate\":\"updateReadChannelDiscussionOutbox\",\"params\":[{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"top_msg_id\",\"type\":\"int\"},{\"name\":\"read_max_id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1506535550,\"predicate\":\"messages.discussionMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"max_id\",\"type\":\"flags.0?int\"},{\"name\":\"read_inbox_max_id\",\"type\":\"flags.1?int\"},{\"name\":\"read_outbox_max_id\",\"type\":\"flags.2?int\"},{\"name\":\"unread_count\",\"type\":\"int\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.DiscussionMessage\"},{\"id\":-1495959709,\"predicate\":\"messageReplyHeader\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"reply_to_scheduled\",\"type\":\"flags.2?true\"},{\"name\":\"forum_topic\",\"type\":\"flags.3?true\"},{\"name\":\"reply_to_msg_id\",\"type\":\"int\"},{\"name\":\"reply_to_peer_id\",\"type\":\"flags.0?Peer\"},{\"name\":\"reply_to_top_id\",\"type\":\"flags.1?int\"}],\"type\":\"MessageReplyHeader\"},{\"id\":-2083123262,\"predicate\":\"messageReplies\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"comments\",\"type\":\"flags.0?true\"},{\"name\":\"replies\",\"type\":\"int\"},{\"name\":\"replies_pts\",\"type\":\"int\"},{\"name\":\"recent_repliers\",\"type\":\"flags.1?Vector\"},{\"name\":\"channel_id\",\"type\":\"flags.0?long\"},{\"name\":\"max_id\",\"type\":\"flags.2?int\"},{\"name\":\"read_max_id\",\"type\":\"flags.3?int\"}],\"type\":\"MessageReplies\"},{\"id\":610945826,\"predicate\":\"updatePeerBlocked\",\"params\":[{\"name\":\"peer_id\",\"type\":\"Peer\"},{\"name\":\"blocked\",\"type\":\"Bool\"}],\"type\":\"Update\"},{\"id\":-386039788,\"predicate\":\"peerBlocked\",\"params\":[{\"name\":\"peer_id\",\"type\":\"Peer\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"PeerBlocked\"},{\"id\":-1937192669,\"predicate\":\"updateChannelUserTyping\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"from_id\",\"type\":\"Peer\"},{\"name\":\"action\",\"type\":\"SendMessageAction\"}],\"type\":\"Update\"},{\"id\":-1392895362,\"predicate\":\"inputMessageCallbackQuery\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"query_id\",\"type\":\"long\"}],\"type\":\"InputMessage\"},{\"id\":453242886,\"predicate\":\"channelParticipantLeft\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"}],\"type\":\"ChannelParticipant\"},{\"id\":-531931925,\"predicate\":\"channelParticipantsMentions\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"q\",\"type\":\"flags.0?string\"},{\"name\":\"top_msg_id\",\"type\":\"flags.1?int\"}],\"type\":\"ChannelParticipantsFilter\"},{\"id\":-309990731,\"predicate\":\"updatePinnedMessages\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":1538885128,\"predicate\":\"updatePinnedChannelMessages\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.0?true\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":464520273,\"predicate\":\"inputMessagesFilterPinned\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":-1986399595,\"predicate\":\"stats.messageStats\",\"params\":[{\"name\":\"views_graph\",\"type\":\"StatsGraph\"}],\"type\":\"stats.MessageStats\"},{\"id\":-1730095465,\"predicate\":\"messageActionGeoProximityReached\",\"params\":[{\"name\":\"from_id\",\"type\":\"Peer\"},{\"name\":\"to_id\",\"type\":\"Peer\"},{\"name\":\"distance\",\"type\":\"int\"}],\"type\":\"MessageAction\"},{\"id\":-668906175,\"predicate\":\"photoPathSize\",\"params\":[{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"PhotoSize\"},{\"id\":-651419003,\"predicate\":\"speakingInGroupCallAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":2004925620,\"predicate\":\"groupCallDiscarded\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"duration\",\"type\":\"int\"}],\"type\":\"GroupCall\"},{\"id\":-711498484,\"predicate\":\"groupCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"join_muted\",\"type\":\"flags.1?true\"},{\"name\":\"can_change_join_muted\",\"type\":\"flags.2?true\"},{\"name\":\"join_date_asc\",\"type\":\"flags.6?true\"},{\"name\":\"schedule_start_subscribed\",\"type\":\"flags.8?true\"},{\"name\":\"can_start_video\",\"type\":\"flags.9?true\"},{\"name\":\"record_video_active\",\"type\":\"flags.11?true\"},{\"name\":\"rtmp_stream\",\"type\":\"flags.12?true\"},{\"name\":\"listeners_hidden\",\"type\":\"flags.13?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"participants_count\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"flags.3?string\"},{\"name\":\"stream_dc_id\",\"type\":\"flags.4?int\"},{\"name\":\"record_start_date\",\"type\":\"flags.5?int\"},{\"name\":\"schedule_date\",\"type\":\"flags.7?int\"},{\"name\":\"unmuted_video_count\",\"type\":\"flags.10?int\"},{\"name\":\"unmuted_video_limit\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"GroupCall\"},{\"id\":-659913713,\"predicate\":\"inputGroupCall\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputGroupCall\"},{\"id\":2047704898,\"predicate\":\"messageActionGroupCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"duration\",\"type\":\"flags.0?int\"}],\"type\":\"MessageAction\"},{\"id\":1345295095,\"predicate\":\"messageActionInviteToGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"MessageAction\"},{\"id\":-341428482,\"predicate\":\"groupCallParticipant\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"muted\",\"type\":\"flags.0?true\"},{\"name\":\"left\",\"type\":\"flags.1?true\"},{\"name\":\"can_self_unmute\",\"type\":\"flags.2?true\"},{\"name\":\"just_joined\",\"type\":\"flags.4?true\"},{\"name\":\"versioned\",\"type\":\"flags.5?true\"},{\"name\":\"min\",\"type\":\"flags.8?true\"},{\"name\":\"muted_by_you\",\"type\":\"flags.9?true\"},{\"name\":\"volume_by_admin\",\"type\":\"flags.10?true\"},{\"name\":\"self\",\"type\":\"flags.12?true\"},{\"name\":\"video_joined\",\"type\":\"flags.15?true\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"active_date\",\"type\":\"flags.3?int\"},{\"name\":\"source\",\"type\":\"int\"},{\"name\":\"volume\",\"type\":\"flags.7?int\"},{\"name\":\"about\",\"type\":\"flags.11?string\"},{\"name\":\"raise_hand_rating\",\"type\":\"flags.13?long\"},{\"name\":\"video\",\"type\":\"flags.6?GroupCallParticipantVideo\"},{\"name\":\"presentation\",\"type\":\"flags.14?GroupCallParticipantVideo\"}],\"type\":\"GroupCallParticipant\"},{\"id\":-124097970,\"predicate\":\"updateChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"}],\"type\":\"Update\"},{\"id\":-219423922,\"predicate\":\"updateGroupCallParticipants\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"participants\",\"type\":\"Vector\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":347227392,\"predicate\":\"updateGroupCall\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"call\",\"type\":\"GroupCall\"}],\"type\":\"Update\"},{\"id\":-1636664659,\"predicate\":\"phone.groupCall\",\"params\":[{\"name\":\"call\",\"type\":\"GroupCall\"},{\"name\":\"participants\",\"type\":\"Vector\"},{\"name\":\"participants_next_offset\",\"type\":\"string\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"phone.GroupCall\"},{\"id\":-193506890,\"predicate\":\"phone.groupParticipants\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"participants\",\"type\":\"Vector\"},{\"name\":\"next_offset\",\"type\":\"string\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"phone.GroupParticipants\"},{\"id\":813821341,\"predicate\":\"inlineQueryPeerTypeSameBotPM\",\"params\":[],\"type\":\"InlineQueryPeerType\"},{\"id\":-2093215828,\"predicate\":\"inlineQueryPeerTypePM\",\"params\":[],\"type\":\"InlineQueryPeerType\"},{\"id\":-681130742,\"predicate\":\"inlineQueryPeerTypeChat\",\"params\":[],\"type\":\"InlineQueryPeerType\"},{\"id\":1589952067,\"predicate\":\"inlineQueryPeerTypeMegagroup\",\"params\":[],\"type\":\"InlineQueryPeerType\"},{\"id\":1664413338,\"predicate\":\"inlineQueryPeerTypeBroadcast\",\"params\":[],\"type\":\"InlineQueryPeerType\"},{\"id\":589338437,\"predicate\":\"channelAdminLogEventActionStartGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-610299584,\"predicate\":\"channelAdminLogEventActionDiscardGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-115071790,\"predicate\":\"channelAdminLogEventActionParticipantMute\",\"params\":[{\"name\":\"participant\",\"type\":\"GroupCallParticipant\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-431740480,\"predicate\":\"channelAdminLogEventActionParticipantUnmute\",\"params\":[{\"name\":\"participant\",\"type\":\"GroupCallParticipant\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1456906823,\"predicate\":\"channelAdminLogEventActionToggleGroupCallSetting\",\"params\":[{\"name\":\"join_muted\",\"type\":\"Bool\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-1966921727,\"predicate\":\"inputPaymentCredentialsGooglePay\",\"params\":[{\"name\":\"payment_token\",\"type\":\"DataJSON\"}],\"type\":\"InputPaymentCredentials\"},{\"id\":375566091,\"predicate\":\"messages.historyImport\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"messages.HistoryImport\"},{\"id\":-606432698,\"predicate\":\"sendMessageHistoryImportAction\",\"params\":[{\"name\":\"progress\",\"type\":\"int\"}],\"type\":\"SendMessageAction\"},{\"id\":1578088377,\"predicate\":\"messages.historyImportParsed\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pm\",\"type\":\"flags.0?true\"},{\"name\":\"group\",\"type\":\"flags.1?true\"},{\"name\":\"title\",\"type\":\"flags.2?string\"}],\"type\":\"messages.HistoryImportParsed\"},{\"id\":-170010905,\"predicate\":\"inputReportReasonFake\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":-275956116,\"predicate\":\"messages.affectedFoundMessages\",\"params\":[{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"},{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"messages\",\"type\":\"Vector\"}],\"type\":\"messages.AffectedFoundMessages\"},{\"id\":1007897979,\"predicate\":\"messageActionSetMessagesTTL\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"period\",\"type\":\"int\"},{\"name\":\"auto_setting_from\",\"type\":\"flags.0?long\"}],\"type\":\"MessageAction\"},{\"id\":-1147422299,\"predicate\":\"updatePeerHistoryTTL\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"ttl_period\",\"type\":\"flags.0?int\"}],\"type\":\"Update\"},{\"id\":-796432838,\"predicate\":\"updateChatParticipant\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"actor_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"prev_participant\",\"type\":\"flags.0?ChatParticipant\"},{\"name\":\"new_participant\",\"type\":\"flags.1?ChatParticipant\"},{\"name\":\"invite\",\"type\":\"flags.2?ExportedChatInvite\"},{\"name\":\"qts\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1738720581,\"predicate\":\"updateChannelParticipant\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"actor_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"prev_participant\",\"type\":\"flags.0?ChannelParticipant\"},{\"name\":\"new_participant\",\"type\":\"flags.1?ChannelParticipant\"},{\"name\":\"invite\",\"type\":\"flags.2?ExportedChatInvite\"},{\"name\":\"qts\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-997782967,\"predicate\":\"updateBotStopped\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"stopped\",\"type\":\"Bool\"},{\"name\":\"qts\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1940201511,\"predicate\":\"chatInviteImporter\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"requested\",\"type\":\"flags.0?true\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"about\",\"type\":\"flags.2?string\"},{\"name\":\"approved_by\",\"type\":\"flags.1?long\"}],\"type\":\"ChatInviteImporter\"},{\"id\":-1111085620,\"predicate\":\"messages.exportedChatInvites\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"invites\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.ExportedChatInvites\"},{\"id\":410107472,\"predicate\":\"messages.exportedChatInvite\",\"params\":[{\"name\":\"invite\",\"type\":\"ExportedChatInvite\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.ExportedChatInvite\"},{\"id\":572915951,\"predicate\":\"messages.exportedChatInviteReplaced\",\"params\":[{\"name\":\"invite\",\"type\":\"ExportedChatInvite\"},{\"name\":\"new_invite\",\"type\":\"ExportedChatInvite\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.ExportedChatInvite\"},{\"id\":-2118733814,\"predicate\":\"messages.chatInviteImporters\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"importers\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.ChatInviteImporters\"},{\"id\":-219353309,\"predicate\":\"chatAdminWithInvites\",\"params\":[{\"name\":\"admin_id\",\"type\":\"long\"},{\"name\":\"invites_count\",\"type\":\"int\"},{\"name\":\"revoked_invites_count\",\"type\":\"int\"}],\"type\":\"ChatAdminWithInvites\"},{\"id\":-1231326505,\"predicate\":\"messages.chatAdminsWithInvites\",\"params\":[{\"name\":\"admins\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.ChatAdminsWithInvites\"},{\"id\":1557846647,\"predicate\":\"channelAdminLogEventActionParticipantJoinByInvite\",\"params\":[{\"name\":\"invite\",\"type\":\"ExportedChatInvite\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1515256996,\"predicate\":\"channelAdminLogEventActionExportedInviteDelete\",\"params\":[{\"name\":\"invite\",\"type\":\"ExportedChatInvite\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1091179342,\"predicate\":\"channelAdminLogEventActionExportedInviteRevoke\",\"params\":[{\"name\":\"invite\",\"type\":\"ExportedChatInvite\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-384910503,\"predicate\":\"channelAdminLogEventActionExportedInviteEdit\",\"params\":[{\"name\":\"prev_invite\",\"type\":\"ExportedChatInvite\"},{\"name\":\"new_invite\",\"type\":\"ExportedChatInvite\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1048537159,\"predicate\":\"channelAdminLogEventActionParticipantVolume\",\"params\":[{\"name\":\"participant\",\"type\":\"GroupCallParticipant\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1855199800,\"predicate\":\"channelAdminLogEventActionChangeHistoryTTL\",\"params\":[{\"name\":\"prev_value\",\"type\":\"int\"},{\"name\":\"new_value\",\"type\":\"int\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-1571952873,\"predicate\":\"messages.checkedHistoryImportPeer\",\"params\":[{\"name\":\"confirm_text\",\"type\":\"string\"}],\"type\":\"messages.CheckedHistoryImportPeer\"},{\"id\":93890858,\"predicate\":\"inputGroupCallStream\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"time_ms\",\"type\":\"long\"},{\"name\":\"scale\",\"type\":\"int\"},{\"name\":\"video_channel\",\"type\":\"flags.0?int\"},{\"name\":\"video_quality\",\"type\":\"flags.0?int\"}],\"type\":\"InputFileLocation\"},{\"id\":-1343921601,\"predicate\":\"phone.joinAsPeers\",\"params\":[{\"name\":\"peers\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"phone.JoinAsPeers\"},{\"id\":541839704,\"predicate\":\"phone.exportedGroupCallInvite\",\"params\":[{\"name\":\"link\",\"type\":\"string\"}],\"type\":\"phone.ExportedGroupCallInvite\"},{\"id\":-672693723,\"predicate\":\"inputBotInlineMessageMediaInvoice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.0?InputWebDocument\"},{\"name\":\"invoice\",\"type\":\"Invoice\"},{\"name\":\"payload\",\"type\":\"bytes\"},{\"name\":\"provider\",\"type\":\"string\"},{\"name\":\"provider_data\",\"type\":\"DataJSON\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":894081801,\"predicate\":\"botInlineMessageMediaInvoice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"shipping_address_requested\",\"type\":\"flags.1?true\"},{\"name\":\"test\",\"type\":\"flags.3?true\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.0?WebDocument\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"total_amount\",\"type\":\"long\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"BotInlineMessage\"},{\"id\":-1281329567,\"predicate\":\"messageActionGroupCallScheduled\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"schedule_date\",\"type\":\"int\"}],\"type\":\"MessageAction\"},{\"id\":-592373577,\"predicate\":\"groupCallParticipantVideoSourceGroup\",\"params\":[{\"name\":\"semantics\",\"type\":\"string\"},{\"name\":\"sources\",\"type\":\"Vector\"}],\"type\":\"GroupCallParticipantVideoSourceGroup\"},{\"id\":1735736008,\"predicate\":\"groupCallParticipantVideo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"paused\",\"type\":\"flags.0?true\"},{\"name\":\"endpoint\",\"type\":\"string\"},{\"name\":\"source_groups\",\"type\":\"Vector\"},{\"name\":\"audio_source\",\"type\":\"flags.1?int\"}],\"type\":\"GroupCallParticipantVideo\"},{\"id\":192428418,\"predicate\":\"updateGroupCallConnection\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"presentation\",\"type\":\"flags.0?true\"},{\"name\":\"params\",\"type\":\"DataJSON\"}],\"type\":\"Update\"},{\"id\":-2046910401,\"predicate\":\"stickers.suggestedShortName\",\"params\":[{\"name\":\"short_name\",\"type\":\"string\"}],\"type\":\"stickers.SuggestedShortName\"},{\"id\":795652779,\"predicate\":\"botCommandScopeDefault\",\"params\":[],\"type\":\"BotCommandScope\"},{\"id\":1011811544,\"predicate\":\"botCommandScopeUsers\",\"params\":[],\"type\":\"BotCommandScope\"},{\"id\":1877059713,\"predicate\":\"botCommandScopeChats\",\"params\":[],\"type\":\"BotCommandScope\"},{\"id\":-1180016534,\"predicate\":\"botCommandScopeChatAdmins\",\"params\":[],\"type\":\"BotCommandScope\"},{\"id\":-610432643,\"predicate\":\"botCommandScopePeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"BotCommandScope\"},{\"id\":1071145937,\"predicate\":\"botCommandScopePeerAdmins\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"BotCommandScope\"},{\"id\":169026035,\"predicate\":\"botCommandScopePeerUser\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"BotCommandScope\"},{\"id\":-478701471,\"predicate\":\"account.resetPasswordFailedWait\",\"params\":[{\"name\":\"retry_date\",\"type\":\"int\"}],\"type\":\"account.ResetPasswordResult\"},{\"id\":-370148227,\"predicate\":\"account.resetPasswordRequestedWait\",\"params\":[{\"name\":\"until_date\",\"type\":\"int\"}],\"type\":\"account.ResetPasswordResult\"},{\"id\":-383330754,\"predicate\":\"account.resetPasswordOk\",\"params\":[],\"type\":\"account.ResetPasswordResult\"},{\"id\":1299263278,\"predicate\":\"updateBotCommands\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"bot_id\",\"type\":\"long\"},{\"name\":\"commands\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":-1434950843,\"predicate\":\"messageActionSetChatTheme\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":-1336228175,\"predicate\":\"sendMessageChooseStickerAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":981691896,\"predicate\":\"sponsoredMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"recommended\",\"type\":\"flags.5?true\"},{\"name\":\"show_peer_photo\",\"type\":\"flags.6?true\"},{\"name\":\"random_id\",\"type\":\"bytes\"},{\"name\":\"from_id\",\"type\":\"flags.3?Peer\"},{\"name\":\"chat_invite\",\"type\":\"flags.4?ChatInvite\"},{\"name\":\"chat_invite_hash\",\"type\":\"flags.4?string\"},{\"name\":\"channel_post\",\"type\":\"flags.2?int\"},{\"name\":\"start_param\",\"type\":\"flags.0?string\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.1?Vector\"}],\"type\":\"SponsoredMessage\"},{\"id\":-907141753,\"predicate\":\"messages.sponsoredMessages\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"posts_between\",\"type\":\"flags.0?int\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.SponsoredMessages\"},{\"id\":215889721,\"predicate\":\"inputStickerSetAnimatedEmojiAnimations\",\"params\":[],\"type\":\"InputStickerSet\"},{\"id\":630664139,\"predicate\":\"sendMessageEmojiInteraction\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"interaction\",\"type\":\"DataJSON\"}],\"type\":\"SendMessageAction\"},{\"id\":-1234857938,\"predicate\":\"sendMessageEmojiInteractionSeen\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"}],\"type\":\"SendMessageAction\"},{\"id\":-1227287081,\"predicate\":\"inputBotInlineMessageID64\",\"params\":[{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"owner_id\",\"type\":\"long\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputBotInlineMessageID\"},{\"id\":-911191137,\"predicate\":\"searchResultsCalendarPeriod\",\"params\":[{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"min_msg_id\",\"type\":\"int\"},{\"name\":\"max_msg_id\",\"type\":\"int\"},{\"name\":\"count\",\"type\":\"int\"}],\"type\":\"SearchResultsCalendarPeriod\"},{\"id\":343859772,\"predicate\":\"messages.searchResultsCalendar\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"inexact\",\"type\":\"flags.0?true\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"min_date\",\"type\":\"int\"},{\"name\":\"min_msg_id\",\"type\":\"int\"},{\"name\":\"offset_id_offset\",\"type\":\"flags.1?int\"},{\"name\":\"periods\",\"type\":\"Vector\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.SearchResultsCalendar\"},{\"id\":2137295719,\"predicate\":\"searchResultPosition\",\"params\":[{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"offset\",\"type\":\"int\"}],\"type\":\"SearchResultsPosition\"},{\"id\":1404185519,\"predicate\":\"messages.searchResultsPositions\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"positions\",\"type\":\"Vector\"}],\"type\":\"messages.SearchResultsPositions\"},{\"id\":-339958837,\"predicate\":\"messageActionChatJoinedByRequest\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":1885586395,\"predicate\":\"updatePendingJoinRequests\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"requests_pending\",\"type\":\"int\"},{\"name\":\"recent_requesters\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":299870598,\"predicate\":\"updateBotChatInviteRequester\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"about\",\"type\":\"string\"},{\"name\":\"invite\",\"type\":\"ExportedChatInvite\"},{\"name\":\"qts\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":-1347021750,\"predicate\":\"channelAdminLogEventActionParticipantJoinByRequest\",\"params\":[{\"name\":\"invite\",\"type\":\"ExportedChatInvite\"},{\"name\":\"approved_by\",\"type\":\"long\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-376962181,\"predicate\":\"inputKeyboardButtonUserProfile\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"KeyboardButton\"},{\"id\":814112961,\"predicate\":\"keyboardButtonUserProfile\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"KeyboardButton\"},{\"id\":-191450938,\"predicate\":\"channels.sendAsPeers\",\"params\":[{\"name\":\"peers\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"channels.SendAsPeers\"},{\"id\":-886388890,\"predicate\":\"channelAdminLogEventActionToggleNoForwards\",\"params\":[{\"name\":\"new_value\",\"type\":\"Bool\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-738646805,\"predicate\":\"messages.stickerSetNotModified\",\"params\":[],\"type\":\"messages.StickerSet\"},{\"id\":997004590,\"predicate\":\"users.userFull\",\"params\":[{\"name\":\"full_user\",\"type\":\"UserFull\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"users.UserFull\"},{\"id\":1753266509,\"predicate\":\"messages.peerSettings\",\"params\":[{\"name\":\"settings\",\"type\":\"PeerSettings\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.PeerSettings\"},{\"id\":663693416,\"predicate\":\"channelAdminLogEventActionSendMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-702884114,\"predicate\":\"auth.codeTypeMissedCall\",\"params\":[],\"type\":\"auth.CodeType\"},{\"id\":-2113903484,\"predicate\":\"auth.sentCodeTypeMissedCall\",\"params\":[{\"name\":\"prefix\",\"type\":\"string\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"auth.SentCodeType\"},{\"id\":-1012759713,\"predicate\":\"auth.loggedOut\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"future_auth_token\",\"type\":\"flags.0?bytes\"}],\"type\":\"auth.LoggedOut\"},{\"id\":1578843320,\"predicate\":\"updateMessageReactions\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"reactions\",\"type\":\"MessageReactions\"}],\"type\":\"Update\"},{\"id\":-1546531968,\"predicate\":\"reactionCount\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"chosen_order\",\"type\":\"flags.0?int\"},{\"name\":\"reaction\",\"type\":\"Reaction\"},{\"name\":\"count\",\"type\":\"int\"}],\"type\":\"ReactionCount\"},{\"id\":1328256121,\"predicate\":\"messageReactions\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"min\",\"type\":\"flags.0?true\"},{\"name\":\"can_see_list\",\"type\":\"flags.2?true\"},{\"name\":\"results\",\"type\":\"Vector\"},{\"name\":\"recent_reactions\",\"type\":\"flags.1?Vector\"}],\"type\":\"MessageReactions\"},{\"id\":834488621,\"predicate\":\"messages.messageReactionsList\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"reactions\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"next_offset\",\"type\":\"flags.0?string\"}],\"type\":\"messages.MessageReactionsList\"},{\"id\":-1065882623,\"predicate\":\"availableReaction\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"inactive\",\"type\":\"flags.0?true\"},{\"name\":\"premium\",\"type\":\"flags.2?true\"},{\"name\":\"reaction\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"static_icon\",\"type\":\"Document\"},{\"name\":\"appear_animation\",\"type\":\"Document\"},{\"name\":\"select_animation\",\"type\":\"Document\"},{\"name\":\"activate_animation\",\"type\":\"Document\"},{\"name\":\"effect_animation\",\"type\":\"Document\"},{\"name\":\"around_animation\",\"type\":\"flags.1?Document\"},{\"name\":\"center_icon\",\"type\":\"flags.1?Document\"}],\"type\":\"AvailableReaction\"},{\"id\":-1626924713,\"predicate\":\"messages.availableReactionsNotModified\",\"params\":[],\"type\":\"messages.AvailableReactions\"},{\"id\":1989032621,\"predicate\":\"messages.availableReactions\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"reactions\",\"type\":\"Vector\"}],\"type\":\"messages.AvailableReactions\"},{\"id\":852137487,\"predicate\":\"messageEntitySpoiler\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":-1102180616,\"predicate\":\"channelAdminLogEventActionChangeAvailableReactions\",\"params\":[{\"name\":\"prev_value\",\"type\":\"ChatReactions\"},{\"name\":\"new_value\",\"type\":\"ChatReactions\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-1319698788,\"predicate\":\"messagePeerReaction\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"big\",\"type\":\"flags.0?true\"},{\"name\":\"unread\",\"type\":\"flags.1?true\"},{\"name\":\"peer_id\",\"type\":\"Peer\"},{\"name\":\"reaction\",\"type\":\"Reaction\"}],\"type\":\"MessagePeerReaction\"},{\"id\":-2132064081,\"predicate\":\"groupCallStreamChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"int\"},{\"name\":\"scale\",\"type\":\"int\"},{\"name\":\"last_timestamp_ms\",\"type\":\"long\"}],\"type\":\"GroupCallStreamChannel\"},{\"id\":-790330702,\"predicate\":\"phone.groupCallStreamChannels\",\"params\":[{\"name\":\"channels\",\"type\":\"Vector\"}],\"type\":\"phone.GroupCallStreamChannels\"},{\"id\":177124030,\"predicate\":\"inputReportReasonIllegalDrugs\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":-1631091139,\"predicate\":\"inputReportReasonPersonalDetails\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":767505458,\"predicate\":\"phone.groupCallStreamRtmpUrl\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"key\",\"type\":\"string\"}],\"type\":\"phone.GroupCallStreamRtmpUrl\"},{\"id\":1165423600,\"predicate\":\"attachMenuBotIconColor\",\"params\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"color\",\"type\":\"int\"}],\"type\":\"AttachMenuBotIconColor\"},{\"id\":-1297663893,\"predicate\":\"attachMenuBotIcon\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"icon\",\"type\":\"Document\"},{\"name\":\"colors\",\"type\":\"flags.0?Vector\"}],\"type\":\"AttachMenuBotIcon\"},{\"id\":-928371502,\"predicate\":\"attachMenuBot\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"inactive\",\"type\":\"flags.0?true\"},{\"name\":\"has_settings\",\"type\":\"flags.1?true\"},{\"name\":\"request_write_access\",\"type\":\"flags.2?true\"},{\"name\":\"bot_id\",\"type\":\"long\"},{\"name\":\"short_name\",\"type\":\"string\"},{\"name\":\"peer_types\",\"type\":\"Vector\"},{\"name\":\"icons\",\"type\":\"Vector\"}],\"type\":\"AttachMenuBot\"},{\"id\":-237467044,\"predicate\":\"attachMenuBotsNotModified\",\"params\":[],\"type\":\"AttachMenuBots\"},{\"id\":1011024320,\"predicate\":\"attachMenuBots\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"bots\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"AttachMenuBots\"},{\"id\":-1816172929,\"predicate\":\"attachMenuBotsBot\",\"params\":[{\"name\":\"bot\",\"type\":\"AttachMenuBot\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"AttachMenuBotsBot\"},{\"id\":397910539,\"predicate\":\"updateAttachMenuBots\",\"params\":[],\"type\":\"Update\"},{\"id\":202659196,\"predicate\":\"webViewResultUrl\",\"params\":[{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"WebViewResult\"},{\"id\":-2010155333,\"predicate\":\"simpleWebViewResultUrl\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"SimpleWebViewResult\"},{\"id\":211046684,\"predicate\":\"webViewMessageSent\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"msg_id\",\"type\":\"flags.0?InputBotInlineMessageID\"}],\"type\":\"WebViewMessageSent\"},{\"id\":361936797,\"predicate\":\"updateWebViewResultSent\",\"params\":[{\"name\":\"query_id\",\"type\":\"long\"}],\"type\":\"Update\"},{\"id\":326529584,\"predicate\":\"keyboardButtonWebView\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":-1598009252,\"predicate\":\"keyboardButtonSimpleWebView\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":1205698681,\"predicate\":\"messageActionWebViewDataSentMe\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"data\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":-1262252875,\"predicate\":\"messageActionWebViewDataSent\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":347625491,\"predicate\":\"updateBotMenuButton\",\"params\":[{\"name\":\"bot_id\",\"type\":\"long\"},{\"name\":\"button\",\"type\":\"BotMenuButton\"}],\"type\":\"Update\"},{\"id\":1966318984,\"predicate\":\"botMenuButtonDefault\",\"params\":[],\"type\":\"BotMenuButton\"},{\"id\":1113113093,\"predicate\":\"botMenuButtonCommands\",\"params\":[],\"type\":\"BotMenuButton\"},{\"id\":-944407322,\"predicate\":\"botMenuButton\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"BotMenuButton\"},{\"id\":-67704655,\"predicate\":\"account.savedRingtonesNotModified\",\"params\":[],\"type\":\"account.SavedRingtones\"},{\"id\":-1041683259,\"predicate\":\"account.savedRingtones\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"ringtones\",\"type\":\"Vector\"}],\"type\":\"account.SavedRingtones\"},{\"id\":1960361625,\"predicate\":\"updateSavedRingtones\",\"params\":[],\"type\":\"Update\"},{\"id\":-1746354498,\"predicate\":\"notificationSoundDefault\",\"params\":[],\"type\":\"NotificationSound\"},{\"id\":1863070943,\"predicate\":\"notificationSoundNone\",\"params\":[],\"type\":\"NotificationSound\"},{\"id\":-2096391452,\"predicate\":\"notificationSoundLocal\",\"params\":[{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"data\",\"type\":\"string\"}],\"type\":\"NotificationSound\"},{\"id\":-9666487,\"predicate\":\"notificationSoundRingtone\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"NotificationSound\"},{\"id\":-1222230163,\"predicate\":\"account.savedRingtone\",\"params\":[],\"type\":\"account.SavedRingtone\"},{\"id\":523271863,\"predicate\":\"account.savedRingtoneConverted\",\"params\":[{\"name\":\"document\",\"type\":\"Document\"}],\"type\":\"account.SavedRingtone\"},{\"id\":2104224014,\"predicate\":\"attachMenuPeerTypeSameBotPM\",\"params\":[],\"type\":\"AttachMenuPeerType\"},{\"id\":-1020528102,\"predicate\":\"attachMenuPeerTypeBotPM\",\"params\":[],\"type\":\"AttachMenuPeerType\"},{\"id\":-247016673,\"predicate\":\"attachMenuPeerTypePM\",\"params\":[],\"type\":\"AttachMenuPeerType\"},{\"id\":84480319,\"predicate\":\"attachMenuPeerTypeChat\",\"params\":[],\"type\":\"AttachMenuPeerType\"},{\"id\":2080104188,\"predicate\":\"attachMenuPeerTypeBroadcast\",\"params\":[],\"type\":\"AttachMenuPeerType\"},{\"id\":-317687113,\"predicate\":\"chatInvitePublicJoinRequests\",\"params\":[],\"type\":\"ExportedChatInvite\"},{\"id\":-977967015,\"predicate\":\"inputInvoiceMessage\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"InputInvoice\"},{\"id\":-1020867857,\"predicate\":\"inputInvoiceSlug\",\"params\":[{\"name\":\"slug\",\"type\":\"string\"}],\"type\":\"InputInvoice\"},{\"id\":-1362048039,\"predicate\":\"payments.exportedInvoice\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"payments.ExportedInvoice\"},{\"id\":8703322,\"predicate\":\"updateTranscribedAudio\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pending\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"transcription_id\",\"type\":\"long\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"Update\"},{\"id\":-1821037486,\"predicate\":\"messages.transcribedAudio\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pending\",\"type\":\"flags.0?true\"},{\"name\":\"transcription_id\",\"type\":\"long\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"messages.TranscribedAudio\"},{\"id\":909284270,\"predicate\":\"dialogFilterDefault\",\"params\":[],\"type\":\"DialogFilter\"},{\"id\":1395946908,\"predicate\":\"help.premiumPromo\",\"params\":[{\"name\":\"status_text\",\"type\":\"string\"},{\"name\":\"status_entities\",\"type\":\"Vector\"},{\"name\":\"video_sections\",\"type\":\"Vector\"},{\"name\":\"videos\",\"type\":\"Vector\"},{\"name\":\"period_options\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"help.PremiumPromo\"},{\"id\":-925956616,\"predicate\":\"messageEntityCustomEmoji\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"},{\"name\":\"document_id\",\"type\":\"long\"}],\"type\":\"MessageEntity\"},{\"id\":-48981863,\"predicate\":\"documentAttributeCustomEmoji\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"free\",\"type\":\"flags.0?true\"},{\"name\":\"text_color\",\"type\":\"flags.1?true\"},{\"name\":\"alt\",\"type\":\"string\"},{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"}],\"type\":\"DocumentAttribute\"},{\"id\":1087454222,\"predicate\":\"stickerSetFullCovered\",\"params\":[{\"name\":\"set\",\"type\":\"StickerSet\"},{\"name\":\"packs\",\"type\":\"Vector\"},{\"name\":\"keywords\",\"type\":\"Vector\"},{\"name\":\"documents\",\"type\":\"Vector\"}],\"type\":\"StickerSetCovered\"},{\"id\":-1502273946,\"predicate\":\"inputStorePaymentPremiumSubscription\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"restore\",\"type\":\"flags.0?true\"},{\"name\":\"upgrade\",\"type\":\"flags.1?true\"}],\"type\":\"InputStorePaymentPurpose\"},{\"id\":1634697192,\"predicate\":\"inputStorePaymentGiftPremium\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"amount\",\"type\":\"long\"}],\"type\":\"InputStorePaymentPurpose\"},{\"id\":-1415514682,\"predicate\":\"messageActionGiftPremium\",\"params\":[{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"amount\",\"type\":\"long\"},{\"name\":\"months\",\"type\":\"int\"}],\"type\":\"MessageAction\"},{\"id\":1958953753,\"predicate\":\"premiumGiftOption\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"months\",\"type\":\"int\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"amount\",\"type\":\"long\"},{\"name\":\"bot_url\",\"type\":\"string\"},{\"name\":\"store_product\",\"type\":\"flags.0?string\"}],\"type\":\"PremiumGiftOption\"},{\"id\":-930399486,\"predicate\":\"inputStickerSetPremiumGifts\",\"params\":[],\"type\":\"InputStickerSet\"},{\"id\":-78886548,\"predicate\":\"updateReadFeaturedEmojiStickers\",\"params\":[],\"type\":\"Update\"},{\"id\":-1360618136,\"predicate\":\"inputPrivacyKeyVoiceMessages\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":110621716,\"predicate\":\"privacyKeyVoiceMessages\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":-1996951013,\"predicate\":\"paymentFormMethod\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"PaymentFormMethod\"},{\"id\":-193992412,\"predicate\":\"inputWebFileAudioAlbumThumbLocation\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"small\",\"type\":\"flags.2?true\"},{\"name\":\"document\",\"type\":\"flags.0?InputDocument\"},{\"name\":\"title\",\"type\":\"flags.1?string\"},{\"name\":\"performer\",\"type\":\"flags.1?string\"}],\"type\":\"InputWebFileLocation\"},{\"id\":183518013,\"predicate\":\"bots.premiumGiftsOptions\",\"params\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"gifts\",\"type\":\"Vector\"}],\"type\":\"bots.PremiumGiftsOptions\"},{\"id\":769727150,\"predicate\":\"emojiStatusEmpty\",\"params\":[],\"type\":\"EmojiStatus\"},{\"id\":-1835310691,\"predicate\":\"emojiStatus\",\"params\":[{\"name\":\"document_id\",\"type\":\"long\"}],\"type\":\"EmojiStatus\"},{\"id\":-97474361,\"predicate\":\"emojiStatusUntil\",\"params\":[{\"name\":\"document_id\",\"type\":\"long\"},{\"name\":\"until\",\"type\":\"int\"}],\"type\":\"EmojiStatus\"},{\"id\":674706841,\"predicate\":\"updateUserEmojiStatus\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"},{\"name\":\"emoji_status\",\"type\":\"EmojiStatus\"}],\"type\":\"Update\"},{\"id\":821314523,\"predicate\":\"updateRecentEmojiStatuses\",\"params\":[],\"type\":\"Update\"},{\"id\":-796072379,\"predicate\":\"account.emojiStatusesNotModified\",\"params\":[],\"type\":\"account.EmojiStatuses\"},{\"id\":-1866176559,\"predicate\":\"account.emojiStatuses\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"statuses\",\"type\":\"Vector\"}],\"type\":\"account.EmojiStatuses\"},{\"id\":2046153753,\"predicate\":\"reactionEmpty\",\"params\":[],\"type\":\"Reaction\"},{\"id\":455247544,\"predicate\":\"reactionEmoji\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"}],\"type\":\"Reaction\"},{\"id\":-1992950669,\"predicate\":\"reactionCustomEmoji\",\"params\":[{\"name\":\"document_id\",\"type\":\"long\"}],\"type\":\"Reaction\"},{\"id\":-352570692,\"predicate\":\"chatReactionsNone\",\"params\":[],\"type\":\"ChatReactions\"},{\"id\":1385335754,\"predicate\":\"chatReactionsAll\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"allow_custom\",\"type\":\"flags.0?true\"}],\"type\":\"ChatReactions\"},{\"id\":1713193015,\"predicate\":\"chatReactionsSome\",\"params\":[{\"name\":\"reactions\",\"type\":\"Vector\"}],\"type\":\"ChatReactions\"},{\"id\":-1334846497,\"predicate\":\"messages.reactionsNotModified\",\"params\":[],\"type\":\"messages.Reactions\"},{\"id\":-352454890,\"predicate\":\"messages.reactions\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"reactions\",\"type\":\"Vector\"}],\"type\":\"messages.Reactions\"},{\"id\":1870160884,\"predicate\":\"updateRecentReactions\",\"params\":[],\"type\":\"Update\"},{\"id\":-2030252155,\"predicate\":\"updateMoveStickerSetToTop\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"masks\",\"type\":\"flags.0?true\"},{\"name\":\"emojis\",\"type\":\"flags.1?true\"},{\"name\":\"stickerset\",\"type\":\"long\"}],\"type\":\"Update\"},{\"id\":1511364673,\"predicate\":\"auth.sentCodeTypeEmailCode\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"apple_signin_allowed\",\"type\":\"flags.0?true\"},{\"name\":\"google_signin_allowed\",\"type\":\"flags.1?true\"},{\"name\":\"email_pattern\",\"type\":\"string\"},{\"name\":\"length\",\"type\":\"int\"},{\"name\":\"next_phone_login_date\",\"type\":\"flags.2?int\"}],\"type\":\"auth.SentCodeType\"},{\"id\":-1521934870,\"predicate\":\"auth.sentCodeTypeSetUpEmailRequired\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"apple_signin_allowed\",\"type\":\"flags.0?true\"},{\"name\":\"google_signin_allowed\",\"type\":\"flags.1?true\"}],\"type\":\"auth.SentCodeType\"},{\"id\":1128644211,\"predicate\":\"emailVerifyPurposeLoginSetup\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"}],\"type\":\"EmailVerifyPurpose\"},{\"id\":1383932651,\"predicate\":\"emailVerifyPurposeLoginChange\",\"params\":[],\"type\":\"EmailVerifyPurpose\"},{\"id\":-1141565819,\"predicate\":\"emailVerifyPurposePassport\",\"params\":[],\"type\":\"EmailVerifyPurpose\"},{\"id\":-1842457175,\"predicate\":\"emailVerificationCode\",\"params\":[{\"name\":\"code\",\"type\":\"string\"}],\"type\":\"EmailVerification\"},{\"id\":-611279166,\"predicate\":\"emailVerificationGoogle\",\"params\":[{\"name\":\"token\",\"type\":\"string\"}],\"type\":\"EmailVerification\"},{\"id\":-1764723459,\"predicate\":\"emailVerificationApple\",\"params\":[{\"name\":\"token\",\"type\":\"string\"}],\"type\":\"EmailVerification\"},{\"id\":731303195,\"predicate\":\"account.emailVerified\",\"params\":[{\"name\":\"email\",\"type\":\"string\"}],\"type\":\"account.EmailVerified\"},{\"id\":-507835039,\"predicate\":\"account.emailVerifiedLogin\",\"params\":[{\"name\":\"email\",\"type\":\"string\"},{\"name\":\"sent_code\",\"type\":\"auth.SentCode\"}],\"type\":\"account.EmailVerified\"},{\"id\":1596792306,\"predicate\":\"premiumSubscriptionOption\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"current\",\"type\":\"flags.1?true\"},{\"name\":\"can_purchase_upgrade\",\"type\":\"flags.2?true\"},{\"name\":\"transaction\",\"type\":\"flags.3?string\"},{\"name\":\"months\",\"type\":\"int\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"amount\",\"type\":\"long\"},{\"name\":\"bot_url\",\"type\":\"string\"},{\"name\":\"store_product\",\"type\":\"flags.0?string\"}],\"type\":\"PremiumSubscriptionOption\"},{\"id\":80008398,\"predicate\":\"inputStickerSetEmojiGenericAnimations\",\"params\":[],\"type\":\"InputStickerSet\"},{\"id\":701560302,\"predicate\":\"inputStickerSetEmojiDefaultStatuses\",\"params\":[],\"type\":\"InputStickerSet\"},{\"id\":-1206095820,\"predicate\":\"sendAsPeer\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"premium_required\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"Peer\"}],\"type\":\"SendAsPeer\"},{\"id\":-1386050360,\"predicate\":\"messageExtendedMediaPreview\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"w\",\"type\":\"flags.0?int\"},{\"name\":\"h\",\"type\":\"flags.0?int\"},{\"name\":\"thumb\",\"type\":\"flags.1?PhotoSize\"},{\"name\":\"video_duration\",\"type\":\"flags.2?int\"}],\"type\":\"MessageExtendedMedia\"},{\"id\":-297296796,\"predicate\":\"messageExtendedMedia\",\"params\":[{\"name\":\"media\",\"type\":\"MessageMedia\"}],\"type\":\"MessageExtendedMedia\"},{\"id\":1517529484,\"predicate\":\"updateMessageExtendedMedia\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"extended_media\",\"type\":\"MessageExtendedMedia\"}],\"type\":\"Update\"},{\"id\":-50416996,\"predicate\":\"stickerKeyword\",\"params\":[{\"name\":\"document_id\",\"type\":\"long\"},{\"name\":\"keyword\",\"type\":\"Vector\"}],\"type\":\"StickerKeyword\"},{\"id\":-1274595769,\"predicate\":\"username\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"editable\",\"type\":\"flags.0?true\"},{\"name\":\"active\",\"type\":\"flags.1?true\"},{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"Username\"},{\"id\":-263212119,\"predicate\":\"channelAdminLogEventActionChangeUsernames\",\"params\":[{\"name\":\"prev_value\",\"type\":\"Vector\"},{\"name\":\"new_value\",\"type\":\"Vector\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":46949251,\"predicate\":\"channelAdminLogEventActionToggleForum\",\"params\":[{\"name\":\"new_value\",\"type\":\"Bool\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1483767080,\"predicate\":\"channelAdminLogEventActionCreateTopic\",\"params\":[{\"name\":\"topic\",\"type\":\"ForumTopic\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-261103096,\"predicate\":\"channelAdminLogEventActionEditTopic\",\"params\":[{\"name\":\"prev_topic\",\"type\":\"ForumTopic\"},{\"name\":\"new_topic\",\"type\":\"ForumTopic\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":-1374254839,\"predicate\":\"channelAdminLogEventActionDeleteTopic\",\"params\":[{\"name\":\"topic\",\"type\":\"ForumTopic\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1569535291,\"predicate\":\"channelAdminLogEventActionPinTopic\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"prev_topic\",\"type\":\"flags.0?ForumTopic\"},{\"name\":\"new_topic\",\"type\":\"flags.1?ForumTopic\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":37687451,\"predicate\":\"forumTopicDeleted\",\"params\":[{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"ForumTopic\"},{\"id\":1903173033,\"predicate\":\"forumTopic\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"my\",\"type\":\"flags.1?true\"},{\"name\":\"closed\",\"type\":\"flags.2?true\"},{\"name\":\"pinned\",\"type\":\"flags.3?true\"},{\"name\":\"short\",\"type\":\"flags.5?true\"},{\"name\":\"hidden\",\"type\":\"flags.6?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"icon_color\",\"type\":\"int\"},{\"name\":\"icon_emoji_id\",\"type\":\"flags.0?long\"},{\"name\":\"top_message\",\"type\":\"int\"},{\"name\":\"read_inbox_max_id\",\"type\":\"int\"},{\"name\":\"read_outbox_max_id\",\"type\":\"int\"},{\"name\":\"unread_count\",\"type\":\"int\"},{\"name\":\"unread_mentions_count\",\"type\":\"int\"},{\"name\":\"unread_reactions_count\",\"type\":\"int\"},{\"name\":\"from_id\",\"type\":\"Peer\"},{\"name\":\"notify_settings\",\"type\":\"PeerNotifySettings\"},{\"name\":\"draft\",\"type\":\"flags.4?DraftMessage\"}],\"type\":\"ForumTopic\"},{\"id\":913709011,\"predicate\":\"messages.forumTopics\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"order_by_create_date\",\"type\":\"flags.0?true\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"topics\",\"type\":\"Vector\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"}],\"type\":\"messages.ForumTopics\"},{\"id\":228168278,\"predicate\":\"messageActionTopicCreate\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"icon_color\",\"type\":\"int\"},{\"name\":\"icon_emoji_id\",\"type\":\"flags.0?long\"}],\"type\":\"MessageAction\"},{\"id\":-1064024032,\"predicate\":\"messageActionTopicEdit\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"title\",\"type\":\"flags.0?string\"},{\"name\":\"icon_emoji_id\",\"type\":\"flags.1?long\"},{\"name\":\"closed\",\"type\":\"flags.2?Bool\"},{\"name\":\"hidden\",\"type\":\"flags.3?Bool\"}],\"type\":\"MessageAction\"},{\"id\":422509539,\"predicate\":\"updateChannelPinnedTopic\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.0?true\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"topic_id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":1548122514,\"predicate\":\"inputNotifyForumTopic\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"int\"}],\"type\":\"InputNotifyPeer\"},{\"id\":577659656,\"predicate\":\"notifyForumTopic\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"top_msg_id\",\"type\":\"int\"}],\"type\":\"NotifyPeer\"},{\"id\":1153562857,\"predicate\":\"inputStickerSetEmojiDefaultTopicIcons\",\"params\":[],\"type\":\"InputStickerSet\"},{\"id\":406407439,\"predicate\":\"messages.sponsoredMessagesEmpty\",\"params\":[],\"type\":\"messages.SponsoredMessages\"},{\"id\":-31881726,\"predicate\":\"updateChannelPinnedTopics\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel_id\",\"type\":\"long\"},{\"name\":\"order\",\"type\":\"flags.0?Vector\"}],\"type\":\"Update\"},{\"id\":1135897376,\"predicate\":\"defaultHistoryTTL\",\"params\":[{\"name\":\"period\",\"type\":\"int\"}],\"type\":\"DefaultHistoryTTL\"},{\"id\":116234636,\"predicate\":\"auth.codeTypeFragmentSms\",\"params\":[],\"type\":\"auth.CodeType\"},{\"id\":-648651719,\"predicate\":\"auth.sentCodeTypeFragmentSms\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"auth.SentCodeType\"},{\"id\":1103040667,\"predicate\":\"exportedContactToken\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"expires\",\"type\":\"int\"}],\"type\":\"ExportedContactToken\"},{\"id\":1693675004,\"predicate\":\"channelAdminLogEventActionToggleAntiSpam\",\"params\":[{\"name\":\"new_value\",\"type\":\"Bool\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":1474192222,\"predicate\":\"messageActionSuggestProfilePhoto\",\"params\":[{\"name\":\"photo\",\"type\":\"Photo\"}],\"type\":\"MessageAction\"},{\"id\":-404267113,\"predicate\":\"messageActionAttachMenuBotAllowed\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":2008112412,\"predicate\":\"stickerSetNoCovered\",\"params\":[{\"name\":\"set\",\"type\":\"StickerSet\"}],\"type\":\"StickerSetCovered\"},{\"id\":542282808,\"predicate\":\"updateUser\",\"params\":[{\"name\":\"user_id\",\"type\":\"long\"}],\"type\":\"Update\"},{\"id\":596704836,\"predicate\":\"auth.sentCodeSuccess\",\"params\":[{\"name\":\"authorization\",\"type\":\"auth.Authorization\"}],\"type\":\"auth.SentCode\"},{\"id\":-25742243,\"predicate\":\"messageActionRequestedPeer\",\"params\":[{\"name\":\"button_id\",\"type\":\"int\"},{\"name\":\"peer\",\"type\":\"Peer\"}],\"type\":\"MessageAction\"},{\"id\":1597737472,\"predicate\":\"requestPeerTypeUser\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"bot\",\"type\":\"flags.0?Bool\"},{\"name\":\"premium\",\"type\":\"flags.1?Bool\"}],\"type\":\"RequestPeerType\"},{\"id\":-906990053,\"predicate\":\"requestPeerTypeChat\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"creator\",\"type\":\"flags.0?true\"},{\"name\":\"bot_participant\",\"type\":\"flags.5?true\"},{\"name\":\"has_username\",\"type\":\"flags.3?Bool\"},{\"name\":\"forum\",\"type\":\"flags.4?Bool\"},{\"name\":\"user_admin_rights\",\"type\":\"flags.1?ChatAdminRights\"},{\"name\":\"bot_admin_rights\",\"type\":\"flags.2?ChatAdminRights\"}],\"type\":\"RequestPeerType\"},{\"id\":865857388,\"predicate\":\"requestPeerTypeBroadcast\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"creator\",\"type\":\"flags.0?true\"},{\"name\":\"has_username\",\"type\":\"flags.3?Bool\"},{\"name\":\"user_admin_rights\",\"type\":\"flags.1?ChatAdminRights\"},{\"name\":\"bot_admin_rights\",\"type\":\"flags.2?ChatAdminRights\"}],\"type\":\"RequestPeerType\"},{\"id\":218842764,\"predicate\":\"keyboardButtonRequestPeer\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"button_id\",\"type\":\"int\"},{\"name\":\"peer_type\",\"type\":\"RequestPeerType\"}],\"type\":\"KeyboardButton\"},{\"id\":1209970170,\"predicate\":\"emojiListNotModified\",\"params\":[],\"type\":\"EmojiList\"},{\"id\":2048790993,\"predicate\":\"emojiList\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"document_id\",\"type\":\"Vector\"}],\"type\":\"EmojiList\"},{\"id\":-444918734,\"predicate\":\"auth.sentCodeTypeFirebaseSms\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"nonce\",\"type\":\"flags.0?bytes\"},{\"name\":\"receipt\",\"type\":\"flags.1?string\"},{\"name\":\"push_timeout\",\"type\":\"flags.1?int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"auth.SentCodeType\"},{\"id\":2056961449,\"predicate\":\"emojiGroup\",\"params\":[{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"icon_emoji_id\",\"type\":\"long\"},{\"name\":\"emoticons\",\"type\":\"Vector\"}],\"type\":\"EmojiGroup\"},{\"id\":1874111879,\"predicate\":\"messages.emojiGroupsNotModified\",\"params\":[],\"type\":\"messages.EmojiGroups\"},{\"id\":-2011186869,\"predicate\":\"messages.emojiGroups\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"groups\",\"type\":\"Vector\"}],\"type\":\"messages.EmojiGroups\"},{\"id\":-128171716,\"predicate\":\"videoSizeEmojiMarkup\",\"params\":[{\"name\":\"emoji_id\",\"type\":\"long\"},{\"name\":\"background_colors\",\"type\":\"Vector\"}],\"type\":\"VideoSize\"},{\"id\":228623102,\"predicate\":\"videoSizeStickerMarkup\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"sticker_id\",\"type\":\"long\"},{\"name\":\"background_colors\",\"type\":\"Vector\"}],\"type\":\"VideoSize\"},{\"id\":1964978502,\"predicate\":\"textWithEntities\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"Vector\"}],\"type\":\"TextWithEntities\"},{\"id\":870003448,\"predicate\":\"messages.translateResult\",\"params\":[{\"name\":\"result\",\"type\":\"Vector\"}],\"type\":\"messages.TranslatedText\"},{\"id\":-934791986,\"predicate\":\"autoSaveSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"photos\",\"type\":\"flags.0?true\"},{\"name\":\"videos\",\"type\":\"flags.1?true\"},{\"name\":\"video_max_size\",\"type\":\"flags.2?long\"}],\"type\":\"AutoSaveSettings\"},{\"id\":-2124403385,\"predicate\":\"autoSaveException\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"settings\",\"type\":\"AutoSaveSettings\"}],\"type\":\"AutoSaveException\"},{\"id\":1279133341,\"predicate\":\"account.autoSaveSettings\",\"params\":[{\"name\":\"users_settings\",\"type\":\"AutoSaveSettings\"},{\"name\":\"chats_settings\",\"type\":\"AutoSaveSettings\"},{\"name\":\"broadcasts_settings\",\"type\":\"AutoSaveSettings\"},{\"name\":\"exceptions\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"account.AutoSaveSettings\"},{\"id\":-335171433,\"predicate\":\"updateAutoSaveSettings\",\"params\":[],\"type\":\"Update\"}],\"methods\":[{\"id\":-878758099,\"method\":\"invokeAfterMsg\",\"params\":[{\"name\":\"msg_id\",\"type\":\"long\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":1036301552,\"method\":\"invokeAfterMsgs\",\"params\":[{\"name\":\"msg_ids\",\"type\":\"Vector\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":-1502141361,\"method\":\"auth.sendCode\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"api_id\",\"type\":\"int\"},{\"name\":\"api_hash\",\"type\":\"string\"},{\"name\":\"settings\",\"type\":\"CodeSettings\"}],\"type\":\"auth.SentCode\"},{\"id\":-2131827673,\"method\":\"auth.signUp\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"}],\"type\":\"auth.Authorization\"},{\"id\":-1923962543,\"method\":\"auth.signIn\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"phone_code\",\"type\":\"flags.0?string\"},{\"name\":\"email_verification\",\"type\":\"flags.1?EmailVerification\"}],\"type\":\"auth.Authorization\"},{\"id\":1047706137,\"method\":\"auth.logOut\",\"params\":[],\"type\":\"auth.LoggedOut\"},{\"id\":-1616179942,\"method\":\"auth.resetAuthorizations\",\"params\":[],\"type\":\"Bool\"},{\"id\":-440401971,\"method\":\"auth.exportAuthorization\",\"params\":[{\"name\":\"dc_id\",\"type\":\"int\"}],\"type\":\"auth.ExportedAuthorization\"},{\"id\":-1518699091,\"method\":\"auth.importAuthorization\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"auth.Authorization\"},{\"id\":-841733627,\"method\":\"auth.bindTempAuthKey\",\"params\":[{\"name\":\"perm_auth_key_id\",\"type\":\"long\"},{\"name\":\"nonce\",\"type\":\"long\"},{\"name\":\"expires_at\",\"type\":\"int\"},{\"name\":\"encrypted_message\",\"type\":\"bytes\"}],\"type\":\"Bool\"},{\"id\":-326762118,\"method\":\"account.registerDevice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_muted\",\"type\":\"flags.0?true\"},{\"name\":\"token_type\",\"type\":\"int\"},{\"name\":\"token\",\"type\":\"string\"},{\"name\":\"app_sandbox\",\"type\":\"Bool\"},{\"name\":\"secret\",\"type\":\"bytes\"},{\"name\":\"other_uids\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":1779249670,\"method\":\"account.unregisterDevice\",\"params\":[{\"name\":\"token_type\",\"type\":\"int\"},{\"name\":\"token\",\"type\":\"string\"},{\"name\":\"other_uids\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-2067899501,\"method\":\"account.updateNotifySettings\",\"params\":[{\"name\":\"peer\",\"type\":\"InputNotifyPeer\"},{\"name\":\"settings\",\"type\":\"InputPeerNotifySettings\"}],\"type\":\"Bool\"},{\"id\":313765169,\"method\":\"account.getNotifySettings\",\"params\":[{\"name\":\"peer\",\"type\":\"InputNotifyPeer\"}],\"type\":\"PeerNotifySettings\"},{\"id\":-612493497,\"method\":\"account.resetNotifySettings\",\"params\":[],\"type\":\"Bool\"},{\"id\":2018596725,\"method\":\"account.updateProfile\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"first_name\",\"type\":\"flags.0?string\"},{\"name\":\"last_name\",\"type\":\"flags.1?string\"},{\"name\":\"about\",\"type\":\"flags.2?string\"}],\"type\":\"User\"},{\"id\":1713919532,\"method\":\"account.updateStatus\",\"params\":[{\"name\":\"offline\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":127302966,\"method\":\"account.getWallPapers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"account.WallPapers\"},{\"id\":-977650298,\"method\":\"account.reportPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reason\",\"type\":\"ReportReason\"},{\"name\":\"message\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":227648840,\"method\":\"users.getUsers\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":-1240508136,\"method\":\"users.getFullUser\",\"params\":[{\"name\":\"id\",\"type\":\"InputUser\"}],\"type\":\"users.UserFull\"},{\"id\":2061264541,\"method\":\"contacts.getContactIDs\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"Vector\"},{\"id\":-995929106,\"method\":\"contacts.getStatuses\",\"params\":[],\"type\":\"Vector\"},{\"id\":1574346258,\"method\":\"contacts.getContacts\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"contacts.Contacts\"},{\"id\":746589157,\"method\":\"contacts.importContacts\",\"params\":[{\"name\":\"contacts\",\"type\":\"Vector\"}],\"type\":\"contacts.ImportedContacts\"},{\"id\":157945344,\"method\":\"contacts.deleteContacts\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":269745566,\"method\":\"contacts.deleteByPhones\",\"params\":[{\"name\":\"phones\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":1758204945,\"method\":\"contacts.block\",\"params\":[{\"name\":\"id\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-1096393392,\"method\":\"contacts.unblock\",\"params\":[{\"name\":\"id\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-176409329,\"method\":\"contacts.getBlocked\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"contacts.Blocked\"},{\"id\":1673946374,\"method\":\"messages.getMessages\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":-1594569905,\"method\":\"messages.getDialogs\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"exclude_pinned\",\"type\":\"flags.0?true\"},{\"name\":\"folder_id\",\"type\":\"flags.1?int\"},{\"name\":\"offset_date\",\"type\":\"int\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"offset_peer\",\"type\":\"InputPeer\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Dialogs\"},{\"id\":1143203525,\"method\":\"messages.getHistory\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"offset_date\",\"type\":\"int\"},{\"name\":\"add_offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"min_id\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Messages\"},{\"id\":-1593989278,\"method\":\"messages.search\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"from_id\",\"type\":\"flags.0?InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.1?int\"},{\"name\":\"filter\",\"type\":\"MessagesFilter\"},{\"name\":\"min_date\",\"type\":\"int\"},{\"name\":\"max_date\",\"type\":\"int\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"add_offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"min_id\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Messages\"},{\"id\":238054714,\"method\":\"messages.readHistory\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"messages.AffectedMessages\"},{\"id\":-1332768214,\"method\":\"messages.deleteHistory\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"just_clear\",\"type\":\"flags.0?true\"},{\"name\":\"revoke\",\"type\":\"flags.1?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"min_date\",\"type\":\"flags.2?int\"},{\"name\":\"max_date\",\"type\":\"flags.3?int\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":-443640366,\"method\":\"messages.deleteMessages\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"revoke\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.AffectedMessages\"},{\"id\":94983360,\"method\":\"messages.receivedMessages\",\"params\":[{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"Vector\"},{\"id\":1486110434,\"method\":\"messages.setTyping\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"action\",\"type\":\"SendMessageAction\"}],\"type\":\"Bool\"},{\"id\":482476935,\"method\":\"messages.sendMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.1?true\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"background\",\"type\":\"flags.6?true\"},{\"name\":\"clear_draft\",\"type\":\"flags.7?true\"},{\"name\":\"noforwards\",\"type\":\"flags.14?true\"},{\"name\":\"update_stickersets_order\",\"type\":\"flags.15?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"top_msg_id\",\"type\":\"flags.9?int\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"},{\"name\":\"schedule_date\",\"type\":\"flags.10?int\"},{\"name\":\"send_as\",\"type\":\"flags.13?InputPeer\"}],\"type\":\"Updates\"},{\"id\":1967638886,\"method\":\"messages.sendMedia\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"background\",\"type\":\"flags.6?true\"},{\"name\":\"clear_draft\",\"type\":\"flags.7?true\"},{\"name\":\"noforwards\",\"type\":\"flags.14?true\"},{\"name\":\"update_stickersets_order\",\"type\":\"flags.15?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"top_msg_id\",\"type\":\"flags.9?int\"},{\"name\":\"media\",\"type\":\"InputMedia\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"},{\"name\":\"schedule_date\",\"type\":\"flags.10?int\"},{\"name\":\"send_as\",\"type\":\"flags.13?InputPeer\"}],\"type\":\"Updates\"},{\"id\":-966673468,\"method\":\"messages.forwardMessages\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"background\",\"type\":\"flags.6?true\"},{\"name\":\"with_my_score\",\"type\":\"flags.8?true\"},{\"name\":\"drop_author\",\"type\":\"flags.11?true\"},{\"name\":\"drop_media_captions\",\"type\":\"flags.12?true\"},{\"name\":\"noforwards\",\"type\":\"flags.14?true\"},{\"name\":\"from_peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"},{\"name\":\"random_id\",\"type\":\"Vector\"},{\"name\":\"to_peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.9?int\"},{\"name\":\"schedule_date\",\"type\":\"flags.10?int\"},{\"name\":\"send_as\",\"type\":\"flags.13?InputPeer\"}],\"type\":\"Updates\"},{\"id\":-820669733,\"method\":\"messages.reportSpam\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-270948702,\"method\":\"messages.getPeerSettings\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"messages.PeerSettings\"},{\"id\":-1991005362,\"method\":\"messages.report\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"},{\"name\":\"reason\",\"type\":\"ReportReason\"},{\"name\":\"message\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":1240027791,\"method\":\"messages.getChats\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.Chats\"},{\"id\":-1364194508,\"method\":\"messages.getFullChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"}],\"type\":\"messages.ChatFull\"},{\"id\":1937260541,\"method\":\"messages.editChatTitle\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":903730804,\"method\":\"messages.editChatPhoto\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"photo\",\"type\":\"InputChatPhoto\"}],\"type\":\"Updates\"},{\"id\":-230206493,\"method\":\"messages.addChatUser\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"fwd_limit\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":-1575461717,\"method\":\"messages.deleteChatUser\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"revoke_history\",\"type\":\"flags.0?true\"},{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"Updates\"},{\"id\":3450904,\"method\":\"messages.createChat\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"ttl_period\",\"type\":\"flags.0?int\"}],\"type\":\"Updates\"},{\"id\":-304838614,\"method\":\"updates.getState\",\"params\":[],\"type\":\"updates.State\"},{\"id\":630429265,\"method\":\"updates.getDifference\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_total_limit\",\"type\":\"flags.0?int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"qts\",\"type\":\"int\"}],\"type\":\"updates.Difference\"},{\"id\":473782614,\"method\":\"photos.updateProfilePhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"fallback\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"InputPhoto\"}],\"type\":\"photos.Photo\"},{\"id\":154966609,\"method\":\"photos.uploadProfilePhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"fallback\",\"type\":\"flags.3?true\"},{\"name\":\"file\",\"type\":\"flags.0?InputFile\"},{\"name\":\"video\",\"type\":\"flags.1?InputFile\"},{\"name\":\"video_start_ts\",\"type\":\"flags.2?double\"},{\"name\":\"video_emoji_markup\",\"type\":\"flags.4?VideoSize\"}],\"type\":\"photos.Photo\"},{\"id\":-2016444625,\"method\":\"photos.deletePhotos\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":-1291540959,\"method\":\"upload.saveFilePart\",\"params\":[{\"name\":\"file_id\",\"type\":\"long\"},{\"name\":\"file_part\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"Bool\"},{\"id\":-1101843010,\"method\":\"upload.getFile\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"precise\",\"type\":\"flags.0?true\"},{\"name\":\"cdn_supported\",\"type\":\"flags.1?true\"},{\"name\":\"location\",\"type\":\"InputFileLocation\"},{\"name\":\"offset\",\"type\":\"long\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"upload.File\"},{\"id\":-990308245,\"method\":\"help.getConfig\",\"params\":[],\"type\":\"Config\"},{\"id\":531836966,\"method\":\"help.getNearestDc\",\"params\":[],\"type\":\"NearestDc\"},{\"id\":1378703997,\"method\":\"help.getAppUpdate\",\"params\":[{\"name\":\"source\",\"type\":\"string\"}],\"type\":\"help.AppUpdate\"},{\"id\":1295590211,\"method\":\"help.getInviteText\",\"params\":[],\"type\":\"help.InviteText\"},{\"id\":-1848823128,\"method\":\"photos.getUserPhotos\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"long\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"photos.Photos\"},{\"id\":651135312,\"method\":\"messages.getDhConfig\",\"params\":[{\"name\":\"version\",\"type\":\"int\"},{\"name\":\"random_length\",\"type\":\"int\"}],\"type\":\"messages.DhConfig\"},{\"id\":-162681021,\"method\":\"messages.requestEncryption\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"random_id\",\"type\":\"int\"},{\"name\":\"g_a\",\"type\":\"bytes\"}],\"type\":\"EncryptedChat\"},{\"id\":1035731989,\"method\":\"messages.acceptEncryption\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"g_b\",\"type\":\"bytes\"},{\"name\":\"key_fingerprint\",\"type\":\"long\"}],\"type\":\"EncryptedChat\"},{\"id\":-208425312,\"method\":\"messages.discardEncryption\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"delete_history\",\"type\":\"flags.0?true\"},{\"name\":\"chat_id\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":2031374829,\"method\":\"messages.setEncryptedTyping\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"typing\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":2135648522,\"method\":\"messages.readEncryptedHistory\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"max_date\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":1157265941,\"method\":\"messages.sendEncrypted\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"type\":\"messages.SentEncryptedMessage\"},{\"id\":1431914525,\"method\":\"messages.sendEncryptedFile\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"bytes\"},{\"name\":\"file\",\"type\":\"InputEncryptedFile\"}],\"type\":\"messages.SentEncryptedMessage\"},{\"id\":852769188,\"method\":\"messages.sendEncryptedService\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"type\":\"messages.SentEncryptedMessage\"},{\"id\":1436924774,\"method\":\"messages.receivedQueue\",\"params\":[{\"name\":\"max_qts\",\"type\":\"int\"}],\"type\":\"Vector\"},{\"id\":1259113487,\"method\":\"messages.reportEncryptedSpam\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"}],\"type\":\"Bool\"},{\"id\":-562337987,\"method\":\"upload.saveBigFilePart\",\"params\":[{\"name\":\"file_id\",\"type\":\"long\"},{\"name\":\"file_part\",\"type\":\"int\"},{\"name\":\"file_total_parts\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"Bool\"},{\"id\":-1043505495,\"method\":\"initConnection\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"api_id\",\"type\":\"int\"},{\"name\":\"device_model\",\"type\":\"string\"},{\"name\":\"system_version\",\"type\":\"string\"},{\"name\":\"app_version\",\"type\":\"string\"},{\"name\":\"system_lang_code\",\"type\":\"string\"},{\"name\":\"lang_pack\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"proxy\",\"type\":\"flags.0?InputClientProxy\"},{\"name\":\"params\",\"type\":\"flags.1?JSONValue\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":-1663104819,\"method\":\"help.getSupport\",\"params\":[],\"type\":\"help.Support\"},{\"id\":916930423,\"method\":\"messages.readMessageContents\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.AffectedMessages\"},{\"id\":655677548,\"method\":\"account.checkUsername\",\"params\":[{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":1040964988,\"method\":\"account.updateUsername\",\"params\":[{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"User\"},{\"id\":301470424,\"method\":\"contacts.search\",\"params\":[{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"contacts.Found\"},{\"id\":-623130288,\"method\":\"account.getPrivacy\",\"params\":[{\"name\":\"key\",\"type\":\"InputPrivacyKey\"}],\"type\":\"account.PrivacyRules\"},{\"id\":-906486552,\"method\":\"account.setPrivacy\",\"params\":[{\"name\":\"key\",\"type\":\"InputPrivacyKey\"},{\"name\":\"rules\",\"type\":\"Vector\"}],\"type\":\"account.PrivacyRules\"},{\"id\":-1564422284,\"method\":\"account.deleteAccount\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"reason\",\"type\":\"string\"},{\"name\":\"password\",\"type\":\"flags.0?InputCheckPasswordSRP\"}],\"type\":\"Bool\"},{\"id\":150761757,\"method\":\"account.getAccountTTL\",\"params\":[],\"type\":\"AccountDaysTTL\"},{\"id\":608323678,\"method\":\"account.setAccountTTL\",\"params\":[{\"name\":\"ttl\",\"type\":\"AccountDaysTTL\"}],\"type\":\"Bool\"},{\"id\":-627372787,\"method\":\"invokeWithLayer\",\"params\":[{\"name\":\"layer\",\"type\":\"int\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":-113456221,\"method\":\"contacts.resolveUsername\",\"params\":[{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"contacts.ResolvedPeer\"},{\"id\":-2108208411,\"method\":\"account.sendChangePhoneCode\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"settings\",\"type\":\"CodeSettings\"}],\"type\":\"auth.SentCode\"},{\"id\":1891839707,\"method\":\"account.changePhone\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"phone_code\",\"type\":\"string\"}],\"type\":\"User\"},{\"id\":-710552671,\"method\":\"messages.getStickers\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Stickers\"},{\"id\":-1197432408,\"method\":\"messages.getAllStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.AllStickers\"},{\"id\":954152242,\"method\":\"account.updateDeviceLocked\",\"params\":[{\"name\":\"period\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":1738800940,\"method\":\"auth.importBotAuthorization\",\"params\":[{\"name\":\"flags\",\"type\":\"int\"},{\"name\":\"api_id\",\"type\":\"int\"},{\"name\":\"api_hash\",\"type\":\"string\"},{\"name\":\"bot_auth_token\",\"type\":\"string\"}],\"type\":\"auth.Authorization\"},{\"id\":-1956073268,\"method\":\"messages.getWebPagePreview\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"}],\"type\":\"MessageMedia\"},{\"id\":-484392616,\"method\":\"account.getAuthorizations\",\"params\":[],\"type\":\"account.Authorizations\"},{\"id\":-545786948,\"method\":\"account.resetAuthorization\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"Bool\"},{\"id\":1418342645,\"method\":\"account.getPassword\",\"params\":[],\"type\":\"account.Password\"},{\"id\":-1663767815,\"method\":\"account.getPasswordSettings\",\"params\":[{\"name\":\"password\",\"type\":\"InputCheckPasswordSRP\"}],\"type\":\"account.PasswordSettings\"},{\"id\":-1516564433,\"method\":\"account.updatePasswordSettings\",\"params\":[{\"name\":\"password\",\"type\":\"InputCheckPasswordSRP\"},{\"name\":\"new_settings\",\"type\":\"account.PasswordInputSettings\"}],\"type\":\"Bool\"},{\"id\":-779399914,\"method\":\"auth.checkPassword\",\"params\":[{\"name\":\"password\",\"type\":\"InputCheckPasswordSRP\"}],\"type\":\"auth.Authorization\"},{\"id\":-661144474,\"method\":\"auth.requestPasswordRecovery\",\"params\":[],\"type\":\"auth.PasswordRecovery\"},{\"id\":923364464,\"method\":\"auth.recoverPassword\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"code\",\"type\":\"string\"},{\"name\":\"new_settings\",\"type\":\"flags.0?account.PasswordInputSettings\"}],\"type\":\"auth.Authorization\"},{\"id\":-1080796745,\"method\":\"invokeWithoutUpdates\",\"params\":[{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":-1607670315,\"method\":\"messages.exportChatInvite\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"legacy_revoke_permanent\",\"type\":\"flags.2?true\"},{\"name\":\"request_needed\",\"type\":\"flags.3?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"expire_date\",\"type\":\"flags.0?int\"},{\"name\":\"usage_limit\",\"type\":\"flags.1?int\"},{\"name\":\"title\",\"type\":\"flags.4?string\"}],\"type\":\"ExportedChatInvite\"},{\"id\":1051570619,\"method\":\"messages.checkChatInvite\",\"params\":[{\"name\":\"hash\",\"type\":\"string\"}],\"type\":\"ChatInvite\"},{\"id\":1817183516,\"method\":\"messages.importChatInvite\",\"params\":[{\"name\":\"hash\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":-928977804,\"method\":\"messages.getStickerSet\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.StickerSet\"},{\"id\":-946871200,\"method\":\"messages.installStickerSet\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"archived\",\"type\":\"Bool\"}],\"type\":\"messages.StickerSetInstallResult\"},{\"id\":-110209570,\"method\":\"messages.uninstallStickerSet\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"}],\"type\":\"Bool\"},{\"id\":-421563528,\"method\":\"messages.startBot\",\"params\":[{\"name\":\"bot\",\"type\":\"InputUser\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"start_param\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":-1877938321,\"method\":\"help.getAppChangelog\",\"params\":[{\"name\":\"prev_app_version\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":1468322785,\"method\":\"messages.getMessagesViews\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"},{\"name\":\"increment\",\"type\":\"Bool\"}],\"type\":\"messages.MessageViews\"},{\"id\":-871347913,\"method\":\"channels.readHistory\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":-2067661490,\"method\":\"channels.deleteMessages\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.AffectedMessages\"},{\"id\":-196443371,\"method\":\"channels.reportSpam\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"participant\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-1383294429,\"method\":\"channels.getMessages\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":2010044880,\"method\":\"channels.getParticipants\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"filter\",\"type\":\"ChannelParticipantsFilter\"},{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"channels.ChannelParticipants\"},{\"id\":-1599378234,\"method\":\"channels.getParticipant\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"participant\",\"type\":\"InputPeer\"}],\"type\":\"channels.ChannelParticipant\"},{\"id\":176122811,\"method\":\"channels.getChannels\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.Chats\"},{\"id\":141781513,\"method\":\"channels.getFullChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"messages.ChatFull\"},{\"id\":-1862244601,\"method\":\"channels.createChannel\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"broadcast\",\"type\":\"flags.0?true\"},{\"name\":\"megagroup\",\"type\":\"flags.1?true\"},{\"name\":\"for_import\",\"type\":\"flags.3?true\"},{\"name\":\"forum\",\"type\":\"flags.5?true\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"about\",\"type\":\"string\"},{\"name\":\"geo_point\",\"type\":\"flags.2?InputGeoPoint\"},{\"name\":\"address\",\"type\":\"flags.2?string\"},{\"name\":\"ttl_period\",\"type\":\"flags.4?int\"}],\"type\":\"Updates\"},{\"id\":-751007486,\"method\":\"channels.editAdmin\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"admin_rights\",\"type\":\"ChatAdminRights\"},{\"name\":\"rank\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":1450044624,\"method\":\"channels.editTitle\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":-248621111,\"method\":\"channels.editPhoto\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"photo\",\"type\":\"InputChatPhoto\"}],\"type\":\"Updates\"},{\"id\":283557164,\"method\":\"channels.checkUsername\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":890549214,\"method\":\"channels.updateUsername\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":615851205,\"method\":\"channels.joinChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"Updates\"},{\"id\":-130635115,\"method\":\"channels.leaveChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"Updates\"},{\"id\":429865580,\"method\":\"channels.inviteToChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":-1072619549,\"method\":\"channels.deleteChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"Updates\"},{\"id\":51854712,\"method\":\"updates.getChannelDifference\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"force\",\"type\":\"flags.0?true\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"filter\",\"type\":\"ChannelMessagesFilter\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"updates.ChannelDifference\"},{\"id\":-1470377534,\"method\":\"messages.editChatAdmin\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"is_admin\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":-1568189671,\"method\":\"messages.migrateChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"}],\"type\":\"Updates\"},{\"id\":1271290010,\"method\":\"messages.searchGlobal\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"folder_id\",\"type\":\"flags.0?int\"},{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"filter\",\"type\":\"MessagesFilter\"},{\"name\":\"min_date\",\"type\":\"int\"},{\"name\":\"max_date\",\"type\":\"int\"},{\"name\":\"offset_rate\",\"type\":\"int\"},{\"name\":\"offset_peer\",\"type\":\"InputPeer\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":2016638777,\"method\":\"messages.reorderStickerSets\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"masks\",\"type\":\"flags.0?true\"},{\"name\":\"emojis\",\"type\":\"flags.1?true\"},{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-1309538785,\"method\":\"messages.getDocumentByHash\",\"params\":[{\"name\":\"sha256\",\"type\":\"bytes\"},{\"name\":\"size\",\"type\":\"long\"},{\"name\":\"mime_type\",\"type\":\"string\"}],\"type\":\"Document\"},{\"id\":1559270965,\"method\":\"messages.getSavedGifs\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.SavedGifs\"},{\"id\":846868683,\"method\":\"messages.saveGif\",\"params\":[{\"name\":\"id\",\"type\":\"InputDocument\"},{\"name\":\"unsave\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":1364105629,\"method\":\"messages.getInlineBotResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"bot\",\"type\":\"InputUser\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"geo_point\",\"type\":\"flags.0?InputGeoPoint\"},{\"name\":\"query\",\"type\":\"string\"},{\"name\":\"offset\",\"type\":\"string\"}],\"type\":\"messages.BotResults\"},{\"id\":-346119674,\"method\":\"messages.setInlineBotResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"gallery\",\"type\":\"flags.0?true\"},{\"name\":\"private\",\"type\":\"flags.1?true\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"results\",\"type\":\"Vector\"},{\"name\":\"cache_time\",\"type\":\"int\"},{\"name\":\"next_offset\",\"type\":\"flags.2?string\"},{\"name\":\"switch_pm\",\"type\":\"flags.3?InlineBotSwitchPM\"}],\"type\":\"Bool\"},{\"id\":-738468661,\"method\":\"messages.sendInlineBotResult\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"background\",\"type\":\"flags.6?true\"},{\"name\":\"clear_draft\",\"type\":\"flags.7?true\"},{\"name\":\"hide_via\",\"type\":\"flags.11?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"top_msg_id\",\"type\":\"flags.9?int\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"schedule_date\",\"type\":\"flags.10?int\"},{\"name\":\"send_as\",\"type\":\"flags.13?InputPeer\"}],\"type\":\"Updates\"},{\"id\":-432034325,\"method\":\"channels.exportMessageLink\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"grouped\",\"type\":\"flags.0?true\"},{\"name\":\"thread\",\"type\":\"flags.1?true\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"ExportedMessageLink\"},{\"id\":527021574,\"method\":\"channels.toggleSignatures\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":1056025023,\"method\":\"auth.resendCode\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"}],\"type\":\"auth.SentCode\"},{\"id\":520357240,\"method\":\"auth.cancelCode\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":-39416522,\"method\":\"messages.getMessageEditData\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"messages.MessageEditData\"},{\"id\":1224152952,\"method\":\"messages.editMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.1?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"message\",\"type\":\"flags.11?string\"},{\"name\":\"media\",\"type\":\"flags.14?InputMedia\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"},{\"name\":\"schedule_date\",\"type\":\"flags.15?int\"}],\"type\":\"Updates\"},{\"id\":-2091549254,\"method\":\"messages.editInlineBotMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.1?true\"},{\"name\":\"id\",\"type\":\"InputBotInlineMessageID\"},{\"name\":\"message\",\"type\":\"flags.11?string\"},{\"name\":\"media\",\"type\":\"flags.14?InputMedia\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"}],\"type\":\"Bool\"},{\"id\":-1824339449,\"method\":\"messages.getBotCallbackAnswer\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"game\",\"type\":\"flags.1?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"data\",\"type\":\"flags.0?bytes\"},{\"name\":\"password\",\"type\":\"flags.2?InputCheckPasswordSRP\"}],\"type\":\"messages.BotCallbackAnswer\"},{\"id\":-712043766,\"method\":\"messages.setBotCallbackAnswer\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"alert\",\"type\":\"flags.1?true\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"message\",\"type\":\"flags.0?string\"},{\"name\":\"url\",\"type\":\"flags.2?string\"},{\"name\":\"cache_time\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":-1758168906,\"method\":\"contacts.getTopPeers\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"correspondents\",\"type\":\"flags.0?true\"},{\"name\":\"bots_pm\",\"type\":\"flags.1?true\"},{\"name\":\"bots_inline\",\"type\":\"flags.2?true\"},{\"name\":\"phone_calls\",\"type\":\"flags.3?true\"},{\"name\":\"forward_users\",\"type\":\"flags.4?true\"},{\"name\":\"forward_chats\",\"type\":\"flags.5?true\"},{\"name\":\"groups\",\"type\":\"flags.10?true\"},{\"name\":\"channels\",\"type\":\"flags.15?true\"},{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"contacts.TopPeers\"},{\"id\":451113900,\"method\":\"contacts.resetTopPeerRating\",\"params\":[{\"name\":\"category\",\"type\":\"TopPeerCategory\"},{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-462373635,\"method\":\"messages.getPeerDialogs\",\"params\":[{\"name\":\"peers\",\"type\":\"Vector\"}],\"type\":\"messages.PeerDialogs\"},{\"id\":-1271718337,\"method\":\"messages.saveDraft\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.1?true\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"top_msg_id\",\"type\":\"flags.2?int\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"}],\"type\":\"Bool\"},{\"id\":1782549861,\"method\":\"messages.getAllDrafts\",\"params\":[],\"type\":\"Updates\"},{\"id\":1685588756,\"method\":\"messages.getFeaturedStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.FeaturedStickers\"},{\"id\":1527873830,\"method\":\"messages.readFeaturedStickers\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-1649852357,\"method\":\"messages.getRecentStickers\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"attached\",\"type\":\"flags.0?true\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.RecentStickers\"},{\"id\":958863608,\"method\":\"messages.saveRecentSticker\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"attached\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"InputDocument\"},{\"name\":\"unsave\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":-1986437075,\"method\":\"messages.clearRecentStickers\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"attached\",\"type\":\"flags.0?true\"}],\"type\":\"Bool\"},{\"id\":1475442322,\"method\":\"messages.getArchivedStickers\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"masks\",\"type\":\"flags.0?true\"},{\"name\":\"emojis\",\"type\":\"flags.1?true\"},{\"name\":\"offset_id\",\"type\":\"long\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.ArchivedStickers\"},{\"id\":457157256,\"method\":\"account.sendConfirmPhoneCode\",\"params\":[{\"name\":\"hash\",\"type\":\"string\"},{\"name\":\"settings\",\"type\":\"CodeSettings\"}],\"type\":\"auth.SentCode\"},{\"id\":1596029123,\"method\":\"account.confirmPhone\",\"params\":[{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"phone_code\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":-122669393,\"method\":\"channels.getAdminedPublicChannels\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"by_location\",\"type\":\"flags.0?true\"},{\"name\":\"check_limit\",\"type\":\"flags.1?true\"}],\"type\":\"messages.Chats\"},{\"id\":1678738104,\"method\":\"messages.getMaskStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.AllStickers\"},{\"id\":-866424884,\"method\":\"messages.getAttachedStickers\",\"params\":[{\"name\":\"media\",\"type\":\"InputStickeredMedia\"}],\"type\":\"Vector\"},{\"id\":-1907842680,\"method\":\"auth.dropTempAuthKeys\",\"params\":[{\"name\":\"except_auth_keys\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-1896289088,\"method\":\"messages.setGameScore\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"edit_message\",\"type\":\"flags.0?true\"},{\"name\":\"force\",\"type\":\"flags.1?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"score\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":363700068,\"method\":\"messages.setInlineGameScore\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"edit_message\",\"type\":\"flags.0?true\"},{\"name\":\"force\",\"type\":\"flags.1?true\"},{\"name\":\"id\",\"type\":\"InputBotInlineMessageID\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"score\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":-400399203,\"method\":\"messages.getGameHighScores\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"messages.HighScores\"},{\"id\":258170395,\"method\":\"messages.getInlineGameHighScores\",\"params\":[{\"name\":\"id\",\"type\":\"InputBotInlineMessageID\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"messages.HighScores\"},{\"id\":-468934396,\"method\":\"messages.getCommonChats\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"max_id\",\"type\":\"long\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.Chats\"},{\"id\":-2023787330,\"method\":\"messages.getAllChats\",\"params\":[{\"name\":\"except_ids\",\"type\":\"Vector\"}],\"type\":\"messages.Chats\"},{\"id\":-333262899,\"method\":\"help.setBotUpdatesStatus\",\"params\":[{\"name\":\"pending_updates_count\",\"type\":\"int\"},{\"name\":\"message\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":852135825,\"method\":\"messages.getWebPage\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"WebPage\"},{\"id\":-1489903017,\"method\":\"messages.toggleDialogPin\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputDialogPeer\"}],\"type\":\"Bool\"},{\"id\":991616823,\"method\":\"messages.reorderPinnedDialogs\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"force\",\"type\":\"flags.0?true\"},{\"name\":\"folder_id\",\"type\":\"int\"},{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-692498958,\"method\":\"messages.getPinnedDialogs\",\"params\":[{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"messages.PeerDialogs\"},{\"id\":-1440257555,\"method\":\"bots.sendCustomRequest\",\"params\":[{\"name\":\"custom_method\",\"type\":\"string\"},{\"name\":\"params\",\"type\":\"DataJSON\"}],\"type\":\"DataJSON\"},{\"id\":-434028723,\"method\":\"bots.answerWebhookJSONQuery\",\"params\":[{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"DataJSON\"}],\"type\":\"Bool\"},{\"id\":619086221,\"method\":\"upload.getWebFile\",\"params\":[{\"name\":\"location\",\"type\":\"InputWebFileLocation\"},{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"upload.WebFile\"},{\"id\":924093883,\"method\":\"payments.getPaymentForm\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"invoice\",\"type\":\"InputInvoice\"},{\"name\":\"theme_params\",\"type\":\"flags.0?DataJSON\"}],\"type\":\"payments.PaymentForm\"},{\"id\":611897804,\"method\":\"payments.getPaymentReceipt\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"payments.PaymentReceipt\"},{\"id\":-1228345045,\"method\":\"payments.validateRequestedInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"save\",\"type\":\"flags.0?true\"},{\"name\":\"invoice\",\"type\":\"InputInvoice\"},{\"name\":\"info\",\"type\":\"PaymentRequestedInfo\"}],\"type\":\"payments.ValidatedRequestedInfo\"},{\"id\":755192367,\"method\":\"payments.sendPaymentForm\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"form_id\",\"type\":\"long\"},{\"name\":\"invoice\",\"type\":\"InputInvoice\"},{\"name\":\"requested_info_id\",\"type\":\"flags.0?string\"},{\"name\":\"shipping_option_id\",\"type\":\"flags.1?string\"},{\"name\":\"credentials\",\"type\":\"InputPaymentCredentials\"},{\"name\":\"tip_amount\",\"type\":\"flags.2?long\"}],\"type\":\"payments.PaymentResult\"},{\"id\":1151208273,\"method\":\"account.getTmpPassword\",\"params\":[{\"name\":\"password\",\"type\":\"InputCheckPasswordSRP\"},{\"name\":\"period\",\"type\":\"int\"}],\"type\":\"account.TmpPassword\"},{\"id\":578650699,\"method\":\"payments.getSavedInfo\",\"params\":[],\"type\":\"payments.SavedInfo\"},{\"id\":-667062079,\"method\":\"payments.clearSavedInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"credentials\",\"type\":\"flags.0?true\"},{\"name\":\"info\",\"type\":\"flags.1?true\"}],\"type\":\"Bool\"},{\"id\":-436833542,\"method\":\"messages.setBotShippingResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"error\",\"type\":\"flags.0?string\"},{\"name\":\"shipping_options\",\"type\":\"flags.1?Vector\"}],\"type\":\"Bool\"},{\"id\":163765653,\"method\":\"messages.setBotPrecheckoutResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"success\",\"type\":\"flags.1?true\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"error\",\"type\":\"flags.0?string\"}],\"type\":\"Bool\"},{\"id\":-1876841625,\"method\":\"stickers.createStickerSet\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"masks\",\"type\":\"flags.0?true\"},{\"name\":\"animated\",\"type\":\"flags.1?true\"},{\"name\":\"videos\",\"type\":\"flags.4?true\"},{\"name\":\"emojis\",\"type\":\"flags.5?true\"},{\"name\":\"text_color\",\"type\":\"flags.6?true\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"short_name\",\"type\":\"string\"},{\"name\":\"thumb\",\"type\":\"flags.2?InputDocument\"},{\"name\":\"stickers\",\"type\":\"Vector\"},{\"name\":\"software\",\"type\":\"flags.3?string\"}],\"type\":\"messages.StickerSet\"},{\"id\":-143257775,\"method\":\"stickers.removeStickerFromSet\",\"params\":[{\"name\":\"sticker\",\"type\":\"InputDocument\"}],\"type\":\"messages.StickerSet\"},{\"id\":-4795190,\"method\":\"stickers.changeStickerPosition\",\"params\":[{\"name\":\"sticker\",\"type\":\"InputDocument\"},{\"name\":\"position\",\"type\":\"int\"}],\"type\":\"messages.StickerSet\"},{\"id\":-2041315650,\"method\":\"stickers.addStickerToSet\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"sticker\",\"type\":\"InputStickerSetItem\"}],\"type\":\"messages.StickerSet\"},{\"id\":1369162417,\"method\":\"messages.uploadMedia\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"media\",\"type\":\"InputMedia\"}],\"type\":\"MessageMedia\"},{\"id\":1430593449,\"method\":\"phone.getCallConfig\",\"params\":[],\"type\":\"DataJSON\"},{\"id\":1124046573,\"method\":\"phone.requestCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.0?true\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"random_id\",\"type\":\"int\"},{\"name\":\"g_a_hash\",\"type\":\"bytes\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"}],\"type\":\"phone.PhoneCall\"},{\"id\":1003664544,\"method\":\"phone.acceptCall\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"g_b\",\"type\":\"bytes\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"}],\"type\":\"phone.PhoneCall\"},{\"id\":788404002,\"method\":\"phone.confirmCall\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"g_a\",\"type\":\"bytes\"},{\"name\":\"key_fingerprint\",\"type\":\"long\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"}],\"type\":\"phone.PhoneCall\"},{\"id\":399855457,\"method\":\"phone.receivedCall\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPhoneCall\"}],\"type\":\"Bool\"},{\"id\":-1295269440,\"method\":\"phone.discardCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"duration\",\"type\":\"int\"},{\"name\":\"reason\",\"type\":\"PhoneCallDiscardReason\"},{\"name\":\"connection_id\",\"type\":\"long\"}],\"type\":\"Updates\"},{\"id\":1508562471,\"method\":\"phone.setCallRating\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"user_initiative\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"rating\",\"type\":\"int\"},{\"name\":\"comment\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":662363518,\"method\":\"phone.saveCallDebug\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"debug\",\"type\":\"DataJSON\"}],\"type\":\"Bool\"},{\"id\":962554330,\"method\":\"upload.getCdnFile\",\"params\":[{\"name\":\"file_token\",\"type\":\"bytes\"},{\"name\":\"offset\",\"type\":\"long\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"upload.CdnFile\"},{\"id\":-1691921240,\"method\":\"upload.reuploadCdnFile\",\"params\":[{\"name\":\"file_token\",\"type\":\"bytes\"},{\"name\":\"request_token\",\"type\":\"bytes\"}],\"type\":\"Vector\"},{\"id\":1375900482,\"method\":\"help.getCdnConfig\",\"params\":[],\"type\":\"CdnConfig\"},{\"id\":-219008246,\"method\":\"langpack.getLangPack\",\"params\":[{\"name\":\"lang_pack\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"LangPackDifference\"},{\"id\":-269862909,\"method\":\"langpack.getStrings\",\"params\":[{\"name\":\"lang_pack\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"keys\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":-845657435,\"method\":\"langpack.getDifference\",\"params\":[{\"name\":\"lang_pack\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"from_version\",\"type\":\"int\"}],\"type\":\"LangPackDifference\"},{\"id\":1120311183,\"method\":\"langpack.getLanguages\",\"params\":[{\"name\":\"lang_pack\",\"type\":\"string\"}],\"type\":\"Vector\"},{\"id\":-1763259007,\"method\":\"channels.editBanned\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"participant\",\"type\":\"InputPeer\"},{\"name\":\"banned_rights\",\"type\":\"ChatBannedRights\"}],\"type\":\"Updates\"},{\"id\":870184064,\"method\":\"channels.getAdminLog\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"events_filter\",\"type\":\"flags.0?ChannelAdminLogEventsFilter\"},{\"name\":\"admins\",\"type\":\"flags.1?Vector\"},{\"name\":\"max_id\",\"type\":\"long\"},{\"name\":\"min_id\",\"type\":\"long\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"channels.AdminLogResults\"},{\"id\":-1847836879,\"method\":\"upload.getCdnFileHashes\",\"params\":[{\"name\":\"file_token\",\"type\":\"bytes\"},{\"name\":\"offset\",\"type\":\"long\"}],\"type\":\"Vector\"},{\"id\":-914493408,\"method\":\"messages.sendScreenshotNotification\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reply_to_msg_id\",\"type\":\"int\"},{\"name\":\"random_id\",\"type\":\"long\"}],\"type\":\"Updates\"},{\"id\":-359881479,\"method\":\"channels.setStickers\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"}],\"type\":\"Bool\"},{\"id\":82946729,\"method\":\"messages.getFavedStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.FavedStickers\"},{\"id\":-1174420133,\"method\":\"messages.faveSticker\",\"params\":[{\"name\":\"id\",\"type\":\"InputDocument\"},{\"name\":\"unfave\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":-357180360,\"method\":\"channels.readMessageContents\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-2020263951,\"method\":\"contacts.resetSaved\",\"params\":[],\"type\":\"Bool\"},{\"id\":-251140208,\"method\":\"messages.getUnreadMentions\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"add_offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"min_id\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":-1683319225,\"method\":\"channels.deleteHistory\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"for_everyone\",\"type\":\"flags.0?true\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":1036054804,\"method\":\"help.getRecentMeUrls\",\"params\":[{\"name\":\"referer\",\"type\":\"string\"}],\"type\":\"help.RecentMeUrls\"},{\"id\":-356796084,\"method\":\"channels.togglePreHistoryHidden\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":921026381,\"method\":\"messages.readMentions\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":1881817312,\"method\":\"messages.getRecentLocations\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Messages\"},{\"id\":-1225713124,\"method\":\"messages.sendMultiMedia\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"background\",\"type\":\"flags.6?true\"},{\"name\":\"clear_draft\",\"type\":\"flags.7?true\"},{\"name\":\"noforwards\",\"type\":\"flags.14?true\"},{\"name\":\"update_stickersets_order\",\"type\":\"flags.15?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"top_msg_id\",\"type\":\"flags.9?int\"},{\"name\":\"multi_media\",\"type\":\"Vector\"},{\"name\":\"schedule_date\",\"type\":\"flags.10?int\"},{\"name\":\"send_as\",\"type\":\"flags.13?InputPeer\"}],\"type\":\"Updates\"},{\"id\":1347929239,\"method\":\"messages.uploadEncryptedFile\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"file\",\"type\":\"InputEncryptedFile\"}],\"type\":\"EncryptedFile\"},{\"id\":405695855,\"method\":\"account.getWebAuthorizations\",\"params\":[],\"type\":\"account.WebAuthorizations\"},{\"id\":755087855,\"method\":\"account.resetWebAuthorization\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"Bool\"},{\"id\":1747789204,\"method\":\"account.resetWebAuthorizations\",\"params\":[],\"type\":\"Bool\"},{\"id\":896555914,\"method\":\"messages.searchStickerSets\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"exclude_featured\",\"type\":\"flags.0?true\"},{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.FoundStickerSets\"},{\"id\":-1856595926,\"method\":\"upload.getFileHashes\",\"params\":[{\"name\":\"location\",\"type\":\"InputFileLocation\"},{\"name\":\"offset\",\"type\":\"long\"}],\"type\":\"Vector\"},{\"id\":749019089,\"method\":\"help.getTermsOfServiceUpdate\",\"params\":[],\"type\":\"help.TermsOfServiceUpdate\"},{\"id\":-294455398,\"method\":\"help.acceptTermsOfService\",\"params\":[{\"name\":\"id\",\"type\":\"DataJSON\"}],\"type\":\"Bool\"},{\"id\":-1299661699,\"method\":\"account.getAllSecureValues\",\"params\":[],\"type\":\"Vector\"},{\"id\":1936088002,\"method\":\"account.getSecureValue\",\"params\":[{\"name\":\"types\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":-1986010339,\"method\":\"account.saveSecureValue\",\"params\":[{\"name\":\"value\",\"type\":\"InputSecureValue\"},{\"name\":\"secure_secret_id\",\"type\":\"long\"}],\"type\":\"SecureValue\"},{\"id\":-1199522741,\"method\":\"account.deleteSecureValue\",\"params\":[{\"name\":\"types\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-1865902923,\"method\":\"users.setSecureValueErrors\",\"params\":[{\"name\":\"id\",\"type\":\"InputUser\"},{\"name\":\"errors\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-1456907910,\"method\":\"account.getAuthorizationForm\",\"params\":[{\"name\":\"bot_id\",\"type\":\"long\"},{\"name\":\"scope\",\"type\":\"string\"},{\"name\":\"public_key\",\"type\":\"string\"}],\"type\":\"account.AuthorizationForm\"},{\"id\":-202552205,\"method\":\"account.acceptAuthorization\",\"params\":[{\"name\":\"bot_id\",\"type\":\"long\"},{\"name\":\"scope\",\"type\":\"string\"},{\"name\":\"public_key\",\"type\":\"string\"},{\"name\":\"value_hashes\",\"type\":\"Vector\"},{\"name\":\"credentials\",\"type\":\"SecureCredentialsEncrypted\"}],\"type\":\"Bool\"},{\"id\":-1516022023,\"method\":\"account.sendVerifyPhoneCode\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"settings\",\"type\":\"CodeSettings\"}],\"type\":\"auth.SentCode\"},{\"id\":1305716726,\"method\":\"account.verifyPhone\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"phone_code\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":-1730136133,\"method\":\"account.sendVerifyEmailCode\",\"params\":[{\"name\":\"purpose\",\"type\":\"EmailVerifyPurpose\"},{\"name\":\"email\",\"type\":\"string\"}],\"type\":\"account.SentEmailCode\"},{\"id\":53322959,\"method\":\"account.verifyEmail\",\"params\":[{\"name\":\"purpose\",\"type\":\"EmailVerifyPurpose\"},{\"name\":\"verification\",\"type\":\"EmailVerification\"}],\"type\":\"account.EmailVerified\"},{\"id\":1072547679,\"method\":\"help.getDeepLinkInfo\",\"params\":[{\"name\":\"path\",\"type\":\"string\"}],\"type\":\"help.DeepLinkInfo\"},{\"id\":-2098076769,\"method\":\"contacts.getSaved\",\"params\":[],\"type\":\"Vector\"},{\"id\":-2092831552,\"method\":\"channels.getLeftChannels\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"}],\"type\":\"messages.Chats\"},{\"id\":-1896617296,\"method\":\"account.initTakeoutSession\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"contacts\",\"type\":\"flags.0?true\"},{\"name\":\"message_users\",\"type\":\"flags.1?true\"},{\"name\":\"message_chats\",\"type\":\"flags.2?true\"},{\"name\":\"message_megagroups\",\"type\":\"flags.3?true\"},{\"name\":\"message_channels\",\"type\":\"flags.4?true\"},{\"name\":\"files\",\"type\":\"flags.5?true\"},{\"name\":\"file_max_size\",\"type\":\"flags.5?long\"}],\"type\":\"account.Takeout\"},{\"id\":489050862,\"method\":\"account.finishTakeoutSession\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"success\",\"type\":\"flags.0?true\"}],\"type\":\"Bool\"},{\"id\":486505992,\"method\":\"messages.getSplitRanges\",\"params\":[],\"type\":\"Vector\"},{\"id\":911373810,\"method\":\"invokeWithMessagesRange\",\"params\":[{\"name\":\"range\",\"type\":\"MessageRange\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":-1398145746,\"method\":\"invokeWithTakeout\",\"params\":[{\"name\":\"takeout_id\",\"type\":\"long\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":-1031349873,\"method\":\"messages.markDialogUnread\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"unread\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputDialogPeer\"}],\"type\":\"Bool\"},{\"id\":585256482,\"method\":\"messages.getDialogUnreadMarks\",\"params\":[],\"type\":\"Vector\"},{\"id\":-2062238246,\"method\":\"contacts.toggleTopPeers\",\"params\":[{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":2119757468,\"method\":\"messages.clearAllDrafts\",\"params\":[],\"type\":\"Bool\"},{\"id\":-1735311088,\"method\":\"help.getAppConfig\",\"params\":[],\"type\":\"JSONValue\"},{\"id\":1862465352,\"method\":\"help.saveAppLog\",\"params\":[{\"name\":\"events\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-966677240,\"method\":\"help.getPassportConfig\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"help.PassportConfig\"},{\"id\":1784243458,\"method\":\"langpack.getLanguage\",\"params\":[{\"name\":\"lang_pack\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"LangPackLanguage\"},{\"id\":-760547348,\"method\":\"messages.updatePinnedMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.0?true\"},{\"name\":\"unpin\",\"type\":\"flags.1?true\"},{\"name\":\"pm_oneside\",\"type\":\"flags.2?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":-1881204448,\"method\":\"account.confirmPasswordEmail\",\"params\":[{\"name\":\"code\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":2055154197,\"method\":\"account.resendPasswordEmail\",\"params\":[],\"type\":\"Bool\"},{\"id\":-1043606090,\"method\":\"account.cancelPasswordEmail\",\"params\":[],\"type\":\"Bool\"},{\"id\":-748624084,\"method\":\"help.getSupportName\",\"params\":[],\"type\":\"help.SupportName\"},{\"id\":59377875,\"method\":\"help.getUserInfo\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"help.UserInfo\"},{\"id\":1723407216,\"method\":\"help.editUserInfo\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"Vector\"}],\"type\":\"help.UserInfo\"},{\"id\":-1626880216,\"method\":\"account.getContactSignUpNotification\",\"params\":[],\"type\":\"Bool\"},{\"id\":-806076575,\"method\":\"account.setContactSignUpNotification\",\"params\":[{\"name\":\"silent\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":1398240377,\"method\":\"account.getNotifyExceptions\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"compare_sound\",\"type\":\"flags.1?true\"},{\"name\":\"peer\",\"type\":\"flags.0?InputNotifyPeer\"}],\"type\":\"Updates\"},{\"id\":283795844,\"method\":\"messages.sendVote\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"options\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":1941660731,\"method\":\"messages.getPollResults\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":1848369232,\"method\":\"messages.getOnlines\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"ChatOnlines\"},{\"id\":-554301545,\"method\":\"messages.editChatAbout\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"about\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":-1517917375,\"method\":\"messages.editChatDefaultBannedRights\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"banned_rights\",\"type\":\"ChatBannedRights\"}],\"type\":\"Updates\"},{\"id\":-57811990,\"method\":\"account.getWallPaper\",\"params\":[{\"name\":\"wallpaper\",\"type\":\"InputWallPaper\"}],\"type\":\"WallPaper\"},{\"id\":-578472351,\"method\":\"account.uploadWallPaper\",\"params\":[{\"name\":\"file\",\"type\":\"InputFile\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"settings\",\"type\":\"WallPaperSettings\"}],\"type\":\"WallPaper\"},{\"id\":1817860919,\"method\":\"account.saveWallPaper\",\"params\":[{\"name\":\"wallpaper\",\"type\":\"InputWallPaper\"},{\"name\":\"unsave\",\"type\":\"Bool\"},{\"name\":\"settings\",\"type\":\"WallPaperSettings\"}],\"type\":\"Bool\"},{\"id\":-18000023,\"method\":\"account.installWallPaper\",\"params\":[{\"name\":\"wallpaper\",\"type\":\"InputWallPaper\"},{\"name\":\"settings\",\"type\":\"WallPaperSettings\"}],\"type\":\"Bool\"},{\"id\":-1153722364,\"method\":\"account.resetWallPapers\",\"params\":[],\"type\":\"Bool\"},{\"id\":1457130303,\"method\":\"account.getAutoDownloadSettings\",\"params\":[],\"type\":\"account.AutoDownloadSettings\"},{\"id\":1995661875,\"method\":\"account.saveAutoDownloadSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"low\",\"type\":\"flags.0?true\"},{\"name\":\"high\",\"type\":\"flags.1?true\"},{\"name\":\"settings\",\"type\":\"AutoDownloadSettings\"}],\"type\":\"Bool\"},{\"id\":899735650,\"method\":\"messages.getEmojiKeywords\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"EmojiKeywordsDifference\"},{\"id\":352892591,\"method\":\"messages.getEmojiKeywordsDifference\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"from_version\",\"type\":\"int\"}],\"type\":\"EmojiKeywordsDifference\"},{\"id\":1318675378,\"method\":\"messages.getEmojiKeywordsLanguages\",\"params\":[{\"name\":\"lang_codes\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":-709817306,\"method\":\"messages.getEmojiURL\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"EmojiURL\"},{\"id\":1749536939,\"method\":\"folders.editPeerFolders\",\"params\":[{\"name\":\"folder_peers\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":472471681,\"method\":\"folders.deleteFolder\",\"params\":[{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":11435201,\"method\":\"messages.getSearchCounters\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"filters\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":-170208392,\"method\":\"channels.getGroupsForDiscussion\",\"params\":[],\"type\":\"messages.Chats\"},{\"id\":1079520178,\"method\":\"channels.setDiscussionGroup\",\"params\":[{\"name\":\"broadcast\",\"type\":\"InputChannel\"},{\"name\":\"group\",\"type\":\"InputChannel\"}],\"type\":\"Bool\"},{\"id\":428848198,\"method\":\"messages.requestUrlAuth\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"flags.1?InputPeer\"},{\"name\":\"msg_id\",\"type\":\"flags.1?int\"},{\"name\":\"button_id\",\"type\":\"flags.1?int\"},{\"name\":\"url\",\"type\":\"flags.2?string\"}],\"type\":\"UrlAuthResult\"},{\"id\":-1322487515,\"method\":\"messages.acceptUrlAuth\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"write_allowed\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"flags.1?InputPeer\"},{\"name\":\"msg_id\",\"type\":\"flags.1?int\"},{\"name\":\"button_id\",\"type\":\"flags.1?int\"},{\"name\":\"url\",\"type\":\"flags.2?string\"}],\"type\":\"UrlAuthResult\"},{\"id\":1336717624,\"method\":\"messages.hidePeerSettingsBar\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-386636848,\"method\":\"contacts.addContact\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"add_phone_privacy_exception\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"InputUser\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"phone\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":-130964977,\"method\":\"contacts.acceptContact\",\"params\":[{\"name\":\"id\",\"type\":\"InputUser\"}],\"type\":\"Updates\"},{\"id\":-1892102881,\"method\":\"channels.editCreator\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"password\",\"type\":\"InputCheckPasswordSRP\"}],\"type\":\"Updates\"},{\"id\":-750207932,\"method\":\"contacts.getLocated\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"background\",\"type\":\"flags.1?true\"},{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"self_expires\",\"type\":\"flags.0?int\"}],\"type\":\"Updates\"},{\"id\":1491484525,\"method\":\"channels.editLocation\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"address\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":-304832784,\"method\":\"channels.toggleSlowMode\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"seconds\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":-183077365,\"method\":\"messages.getScheduledHistory\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Messages\"},{\"id\":-1111817116,\"method\":\"messages.getScheduledMessages\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":-1120369398,\"method\":\"messages.sendScheduledMessages\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":1504586518,\"method\":\"messages.deleteScheduledMessages\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":473805619,\"method\":\"account.uploadTheme\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"file\",\"type\":\"InputFile\"},{\"name\":\"thumb\",\"type\":\"flags.0?InputFile\"},{\"name\":\"file_name\",\"type\":\"string\"},{\"name\":\"mime_type\",\"type\":\"string\"}],\"type\":\"Document\"},{\"id\":1697530880,\"method\":\"account.createTheme\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"slug\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"document\",\"type\":\"flags.2?InputDocument\"},{\"name\":\"settings\",\"type\":\"flags.3?Vector\"}],\"type\":\"Theme\"},{\"id\":737414348,\"method\":\"account.updateTheme\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"format\",\"type\":\"string\"},{\"name\":\"theme\",\"type\":\"InputTheme\"},{\"name\":\"slug\",\"type\":\"flags.0?string\"},{\"name\":\"title\",\"type\":\"flags.1?string\"},{\"name\":\"document\",\"type\":\"flags.2?InputDocument\"},{\"name\":\"settings\",\"type\":\"flags.3?Vector\"}],\"type\":\"Theme\"},{\"id\":-229175188,\"method\":\"account.saveTheme\",\"params\":[{\"name\":\"theme\",\"type\":\"InputTheme\"},{\"name\":\"unsave\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":-953697477,\"method\":\"account.installTheme\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"dark\",\"type\":\"flags.0?true\"},{\"name\":\"theme\",\"type\":\"flags.1?InputTheme\"},{\"name\":\"format\",\"type\":\"flags.2?string\"},{\"name\":\"base_theme\",\"type\":\"flags.3?BaseTheme\"}],\"type\":\"Bool\"},{\"id\":978872812,\"method\":\"account.getTheme\",\"params\":[{\"name\":\"format\",\"type\":\"string\"},{\"name\":\"theme\",\"type\":\"InputTheme\"}],\"type\":\"Theme\"},{\"id\":1913054296,\"method\":\"account.getThemes\",\"params\":[{\"name\":\"format\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"account.Themes\"},{\"id\":-1210022402,\"method\":\"auth.exportLoginToken\",\"params\":[{\"name\":\"api_id\",\"type\":\"int\"},{\"name\":\"api_hash\",\"type\":\"string\"},{\"name\":\"except_ids\",\"type\":\"Vector\"}],\"type\":\"auth.LoginToken\"},{\"id\":-1783866140,\"method\":\"auth.importLoginToken\",\"params\":[{\"name\":\"token\",\"type\":\"bytes\"}],\"type\":\"auth.LoginToken\"},{\"id\":-392909491,\"method\":\"auth.acceptLoginToken\",\"params\":[{\"name\":\"token\",\"type\":\"bytes\"}],\"type\":\"Authorization\"},{\"id\":-1250643605,\"method\":\"account.setContentSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"sensitive_enabled\",\"type\":\"flags.0?true\"}],\"type\":\"Bool\"},{\"id\":-1952756306,\"method\":\"account.getContentSettings\",\"params\":[],\"type\":\"account.ContentSettings\"},{\"id\":300429806,\"method\":\"channels.getInactiveChannels\",\"params\":[],\"type\":\"messages.InactiveChats\"},{\"id\":1705865692,\"method\":\"account.getMultiWallPapers\",\"params\":[{\"name\":\"wallpapers\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":-1200736242,\"method\":\"messages.getPollVotes\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"option\",\"type\":\"flags.0?bytes\"},{\"name\":\"offset\",\"type\":\"flags.1?string\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.VotesList\"},{\"id\":-1257951254,\"method\":\"messages.toggleStickerSets\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"uninstall\",\"type\":\"flags.0?true\"},{\"name\":\"archive\",\"type\":\"flags.1?true\"},{\"name\":\"unarchive\",\"type\":\"flags.2?true\"},{\"name\":\"stickersets\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":779736953,\"method\":\"payments.getBankCardData\",\"params\":[{\"name\":\"number\",\"type\":\"string\"}],\"type\":\"payments.BankCardData\"},{\"id\":-241247891,\"method\":\"messages.getDialogFilters\",\"params\":[],\"type\":\"Vector\"},{\"id\":-1566780372,\"method\":\"messages.getSuggestedDialogFilters\",\"params\":[],\"type\":\"Vector\"},{\"id\":450142282,\"method\":\"messages.updateDialogFilter\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"filter\",\"type\":\"flags.0?DialogFilter\"}],\"type\":\"Bool\"},{\"id\":-983318044,\"method\":\"messages.updateDialogFiltersOrder\",\"params\":[{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":-1421720550,\"method\":\"stats.getBroadcastStats\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"dark\",\"type\":\"flags.0?true\"},{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"stats.BroadcastStats\"},{\"id\":1646092192,\"method\":\"stats.loadAsyncGraph\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"token\",\"type\":\"string\"},{\"name\":\"x\",\"type\":\"flags.0?long\"}],\"type\":\"StatsGraph\"},{\"id\":-1707717072,\"method\":\"stickers.setStickerSetThumb\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"thumb\",\"type\":\"InputDocument\"}],\"type\":\"messages.StickerSet\"},{\"id\":85399130,\"method\":\"bots.setBotCommands\",\"params\":[{\"name\":\"scope\",\"type\":\"BotCommandScope\"},{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"commands\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":2127598753,\"method\":\"messages.getOldFeaturedStickers\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.FeaturedStickers\"},{\"id\":-1063816159,\"method\":\"help.getPromoData\",\"params\":[],\"type\":\"help.PromoData\"},{\"id\":505748629,\"method\":\"help.hidePromoData\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-8744061,\"method\":\"phone.sendSignalingData\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"type\":\"Bool\"},{\"id\":-589330937,\"method\":\"stats.getMegagroupStats\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"dark\",\"type\":\"flags.0?true\"},{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"stats.MegagroupStats\"},{\"id\":-349483786,\"method\":\"account.getGlobalPrivacySettings\",\"params\":[],\"type\":\"GlobalPrivacySettings\"},{\"id\":517647042,\"method\":\"account.setGlobalPrivacySettings\",\"params\":[{\"name\":\"settings\",\"type\":\"GlobalPrivacySettings\"}],\"type\":\"GlobalPrivacySettings\"},{\"id\":-183649631,\"method\":\"help.dismissSuggestion\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"suggestion\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":1935116200,\"method\":\"help.getCountriesList\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"help.CountriesList\"},{\"id\":584962828,\"method\":\"messages.getReplies\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"offset_date\",\"type\":\"int\"},{\"name\":\"add_offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"min_id\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Messages\"},{\"id\":1147761405,\"method\":\"messages.getDiscussionMessage\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"messages.DiscussionMessage\"},{\"id\":-147740172,\"method\":\"messages.readDiscussion\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"read_max_id\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":698914348,\"method\":\"contacts.blockFromReplies\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"delete_message\",\"type\":\"flags.0?true\"},{\"name\":\"delete_history\",\"type\":\"flags.1?true\"},{\"name\":\"report_spam\",\"type\":\"flags.2?true\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":1445996571,\"method\":\"stats.getMessagePublicForwards\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"offset_rate\",\"type\":\"int\"},{\"name\":\"offset_peer\",\"type\":\"InputPeer\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":-1226791947,\"method\":\"stats.getMessageStats\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"dark\",\"type\":\"flags.0?true\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"stats.MessageStats\"},{\"id\":-299714136,\"method\":\"messages.unpinAllMessages\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":1221445336,\"method\":\"phone.createGroupCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"rtmp_stream\",\"type\":\"flags.2?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"random_id\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"flags.0?string\"},{\"name\":\"schedule_date\",\"type\":\"flags.1?int\"}],\"type\":\"Updates\"},{\"id\":-1322057861,\"method\":\"phone.joinGroupCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"muted\",\"type\":\"flags.0?true\"},{\"name\":\"video_stopped\",\"type\":\"flags.2?true\"},{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"join_as\",\"type\":\"InputPeer\"},{\"name\":\"invite_hash\",\"type\":\"flags.1?string\"},{\"name\":\"params\",\"type\":\"DataJSON\"}],\"type\":\"Updates\"},{\"id\":1342404601,\"method\":\"phone.leaveGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"source\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":2067345760,\"method\":\"phone.inviteToGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":2054648117,\"method\":\"phone.discardGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"}],\"type\":\"Updates\"},{\"id\":1958458429,\"method\":\"phone.toggleGroupCallSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"reset_invite_hash\",\"type\":\"flags.1?true\"},{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"join_muted\",\"type\":\"flags.0?Bool\"}],\"type\":\"Updates\"},{\"id\":68699611,\"method\":\"phone.getGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"phone.GroupCall\"},{\"id\":-984033109,\"method\":\"phone.getGroupParticipants\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"ids\",\"type\":\"Vector\"},{\"name\":\"sources\",\"type\":\"Vector\"},{\"name\":\"offset\",\"type\":\"string\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"phone.GroupParticipants\"},{\"id\":-1248003721,\"method\":\"phone.checkGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"sources\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":1540419152,\"method\":\"messages.deleteChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"long\"}],\"type\":\"Bool\"},{\"id\":-104078327,\"method\":\"messages.deletePhoneCallHistory\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"revoke\",\"type\":\"flags.0?true\"}],\"type\":\"messages.AffectedFoundMessages\"},{\"id\":1140726259,\"method\":\"messages.checkHistoryImport\",\"params\":[{\"name\":\"import_head\",\"type\":\"string\"}],\"type\":\"messages.HistoryImportParsed\"},{\"id\":873008187,\"method\":\"messages.initHistoryImport\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"file\",\"type\":\"InputFile\"},{\"name\":\"media_count\",\"type\":\"int\"}],\"type\":\"messages.HistoryImport\"},{\"id\":713433234,\"method\":\"messages.uploadImportedMedia\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"import_id\",\"type\":\"long\"},{\"name\":\"file_name\",\"type\":\"string\"},{\"name\":\"media\",\"type\":\"InputMedia\"}],\"type\":\"MessageMedia\"},{\"id\":-1271008444,\"method\":\"messages.startHistoryImport\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"import_id\",\"type\":\"long\"}],\"type\":\"Bool\"},{\"id\":-1565154314,\"method\":\"messages.getExportedChatInvites\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"revoked\",\"type\":\"flags.3?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"admin_id\",\"type\":\"InputUser\"},{\"name\":\"offset_date\",\"type\":\"flags.2?int\"},{\"name\":\"offset_link\",\"type\":\"flags.2?string\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.ExportedChatInvites\"},{\"id\":1937010524,\"method\":\"messages.getExportedChatInvite\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"link\",\"type\":\"string\"}],\"type\":\"messages.ExportedChatInvite\"},{\"id\":-1110823051,\"method\":\"messages.editExportedChatInvite\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"revoked\",\"type\":\"flags.2?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"link\",\"type\":\"string\"},{\"name\":\"expire_date\",\"type\":\"flags.0?int\"},{\"name\":\"usage_limit\",\"type\":\"flags.1?int\"},{\"name\":\"request_needed\",\"type\":\"flags.3?Bool\"},{\"name\":\"title\",\"type\":\"flags.4?string\"}],\"type\":\"messages.ExportedChatInvite\"},{\"id\":1452833749,\"method\":\"messages.deleteRevokedExportedChatInvites\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"admin_id\",\"type\":\"InputUser\"}],\"type\":\"Bool\"},{\"id\":-731601877,\"method\":\"messages.deleteExportedChatInvite\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"link\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":958457583,\"method\":\"messages.getAdminsWithInvites\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"messages.ChatAdminsWithInvites\"},{\"id\":-553329330,\"method\":\"messages.getChatInviteImporters\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"requested\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"link\",\"type\":\"flags.1?string\"},{\"name\":\"q\",\"type\":\"flags.2?string\"},{\"name\":\"offset_date\",\"type\":\"int\"},{\"name\":\"offset_user\",\"type\":\"InputUser\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.ChatInviteImporters\"},{\"id\":-1207017500,\"method\":\"messages.setHistoryTTL\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"period\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":-91437323,\"method\":\"account.reportProfilePhoto\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"photo_id\",\"type\":\"InputPhoto\"},{\"name\":\"reason\",\"type\":\"ReportReason\"},{\"name\":\"message\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":187239529,\"method\":\"channels.convertToGigagroup\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"Updates\"},{\"id\":1573261059,\"method\":\"messages.checkHistoryImportPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"messages.CheckedHistoryImportPeer\"},{\"id\":-248985848,\"method\":\"phone.toggleGroupCallRecord\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"start\",\"type\":\"flags.0?true\"},{\"name\":\"video\",\"type\":\"flags.2?true\"},{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"title\",\"type\":\"flags.1?string\"},{\"name\":\"video_portrait\",\"type\":\"flags.2?Bool\"}],\"type\":\"Updates\"},{\"id\":-1524155713,\"method\":\"phone.editGroupCallParticipant\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"participant\",\"type\":\"InputPeer\"},{\"name\":\"muted\",\"type\":\"flags.0?Bool\"},{\"name\":\"volume\",\"type\":\"flags.1?int\"},{\"name\":\"raise_hand\",\"type\":\"flags.2?Bool\"},{\"name\":\"video_stopped\",\"type\":\"flags.3?Bool\"},{\"name\":\"video_paused\",\"type\":\"flags.4?Bool\"},{\"name\":\"presentation_paused\",\"type\":\"flags.5?Bool\"}],\"type\":\"Updates\"},{\"id\":480685066,\"method\":\"phone.editGroupCallTitle\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":-277077702,\"method\":\"phone.getGroupCallJoinAs\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"phone.JoinAsPeers\"},{\"id\":-425040769,\"method\":\"phone.exportGroupCallInvite\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"can_self_unmute\",\"type\":\"flags.0?true\"},{\"name\":\"call\",\"type\":\"InputGroupCall\"}],\"type\":\"phone.ExportedGroupCallInvite\"},{\"id\":563885286,\"method\":\"phone.toggleGroupCallStartSubscription\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"subscribed\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":1451287362,\"method\":\"phone.startScheduledGroupCall\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"}],\"type\":\"Updates\"},{\"id\":1465786252,\"method\":\"phone.saveDefaultGroupCallJoinAs\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"join_as\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-873829436,\"method\":\"phone.joinGroupCallPresentation\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"},{\"name\":\"params\",\"type\":\"DataJSON\"}],\"type\":\"Updates\"},{\"id\":475058500,\"method\":\"phone.leaveGroupCallPresentation\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"}],\"type\":\"Updates\"},{\"id\":676017721,\"method\":\"stickers.checkShortName\",\"params\":[{\"name\":\"short_name\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":1303364867,\"method\":\"stickers.suggestShortName\",\"params\":[{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"stickers.SuggestedShortName\"},{\"id\":1032708345,\"method\":\"bots.resetBotCommands\",\"params\":[{\"name\":\"scope\",\"type\":\"BotCommandScope\"},{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":-481554986,\"method\":\"bots.getBotCommands\",\"params\":[{\"name\":\"scope\",\"type\":\"BotCommandScope\"},{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"Vector\"},{\"id\":-1828139493,\"method\":\"account.resetPassword\",\"params\":[],\"type\":\"account.ResetPasswordResult\"},{\"id\":1284770294,\"method\":\"account.declinePasswordReset\",\"params\":[],\"type\":\"Bool\"},{\"id\":221691769,\"method\":\"auth.checkRecoveryPassword\",\"params\":[{\"name\":\"code\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":-700916087,\"method\":\"account.getChatThemes\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"account.Themes\"},{\"id\":-432283329,\"method\":\"messages.setChatTheme\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"emoticon\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":-1095836780,\"method\":\"channels.viewSponsoredMessage\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"random_id\",\"type\":\"bytes\"}],\"type\":\"Bool\"},{\"id\":-333377601,\"method\":\"channels.getSponsoredMessages\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"messages.SponsoredMessages\"},{\"id\":745510839,\"method\":\"messages.getMessageReadParticipants\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"Vector\"},{\"id\":1240514025,\"method\":\"messages.getSearchResultsCalendar\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"filter\",\"type\":\"MessagesFilter\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"offset_date\",\"type\":\"int\"}],\"type\":\"messages.SearchResultsCalendar\"},{\"id\":1855292323,\"method\":\"messages.getSearchResultsPositions\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"filter\",\"type\":\"MessagesFilter\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.SearchResultsPositions\"},{\"id\":2145904661,\"method\":\"messages.hideChatJoinRequest\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"approved\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"Updates\"},{\"id\":-528091926,\"method\":\"messages.hideAllChatJoinRequests\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"approved\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"link\",\"type\":\"flags.1?string\"}],\"type\":\"Updates\"},{\"id\":-1323389022,\"method\":\"messages.toggleNoForwards\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":-855777386,\"method\":\"messages.saveDefaultSendAs\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"send_as\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":231174382,\"method\":\"channels.getSendAs\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"channels.SendAsPeers\"},{\"id\":-1081501024,\"method\":\"account.setAuthorizationTTL\",\"params\":[{\"name\":\"authorization_ttl_days\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":1089766498,\"method\":\"account.changeAuthorizationSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"encrypted_requests_disabled\",\"type\":\"flags.0?Bool\"},{\"name\":\"call_requests_disabled\",\"type\":\"flags.1?Bool\"}],\"type\":\"Bool\"},{\"id\":913655003,\"method\":\"channels.deleteParticipantHistory\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"participant\",\"type\":\"InputPeer\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":-754091820,\"method\":\"messages.sendReaction\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"big\",\"type\":\"flags.1?true\"},{\"name\":\"add_to_recent\",\"type\":\"flags.2?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"reaction\",\"type\":\"flags.0?Vector\"}],\"type\":\"Updates\"},{\"id\":-1950707482,\"method\":\"messages.getMessagesReactions\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":1176190792,\"method\":\"messages.getMessageReactionsList\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"reaction\",\"type\":\"flags.0?Reaction\"},{\"name\":\"offset\",\"type\":\"flags.1?string\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.MessageReactionsList\"},{\"id\":-21928079,\"method\":\"messages.setChatAvailableReactions\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"available_reactions\",\"type\":\"ChatReactions\"}],\"type\":\"Updates\"},{\"id\":417243308,\"method\":\"messages.getAvailableReactions\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.AvailableReactions\"},{\"id\":1330094102,\"method\":\"messages.setDefaultReaction\",\"params\":[{\"name\":\"reaction\",\"type\":\"Reaction\"}],\"type\":\"Bool\"},{\"id\":1662529584,\"method\":\"messages.translateText\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"flags.0?InputPeer\"},{\"name\":\"id\",\"type\":\"flags.0?Vector\"},{\"name\":\"text\",\"type\":\"flags.1?Vector\"},{\"name\":\"to_lang\",\"type\":\"string\"}],\"type\":\"messages.TranslatedText\"},{\"id\":841173339,\"method\":\"messages.getUnreadReactions\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"add_offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"min_id\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":1420459918,\"method\":\"messages.readReactions\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"top_msg_id\",\"type\":\"flags.0?int\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":-1963375804,\"method\":\"contacts.resolvePhone\",\"params\":[{\"name\":\"phone\",\"type\":\"string\"}],\"type\":\"contacts.ResolvedPeer\"},{\"id\":447879488,\"method\":\"phone.getGroupCallStreamChannels\",\"params\":[{\"name\":\"call\",\"type\":\"InputGroupCall\"}],\"type\":\"phone.GroupCallStreamChannels\"},{\"id\":-558650433,\"method\":\"phone.getGroupCallStreamRtmpUrl\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"revoke\",\"type\":\"Bool\"}],\"type\":\"phone.GroupCallStreamRtmpUrl\"},{\"id\":276705696,\"method\":\"messages.searchSentMedia\",\"params\":[{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"filter\",\"type\":\"MessagesFilter\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":385663691,\"method\":\"messages.getAttachMenuBots\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"AttachMenuBots\"},{\"id\":1998676370,\"method\":\"messages.getAttachMenuBot\",\"params\":[{\"name\":\"bot\",\"type\":\"InputUser\"}],\"type\":\"AttachMenuBotsBot\"},{\"id\":1777704297,\"method\":\"messages.toggleBotInAttachMenu\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"write_allowed\",\"type\":\"flags.0?true\"},{\"name\":\"bot\",\"type\":\"InputUser\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":395003915,\"method\":\"messages.requestWebView\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"from_bot_menu\",\"type\":\"flags.4?true\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"bot\",\"type\":\"InputUser\"},{\"name\":\"url\",\"type\":\"flags.1?string\"},{\"name\":\"start_param\",\"type\":\"flags.3?string\"},{\"name\":\"theme_params\",\"type\":\"flags.2?DataJSON\"},{\"name\":\"platform\",\"type\":\"string\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"top_msg_id\",\"type\":\"flags.9?int\"},{\"name\":\"send_as\",\"type\":\"flags.13?InputPeer\"}],\"type\":\"WebViewResult\"},{\"id\":2146648841,\"method\":\"messages.prolongWebView\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"bot\",\"type\":\"InputUser\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"top_msg_id\",\"type\":\"flags.9?int\"},{\"name\":\"send_as\",\"type\":\"flags.13?InputPeer\"}],\"type\":\"Bool\"},{\"id\":698084494,\"method\":\"messages.requestSimpleWebView\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"bot\",\"type\":\"InputUser\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"theme_params\",\"type\":\"flags.0?DataJSON\"},{\"name\":\"platform\",\"type\":\"string\"}],\"type\":\"SimpleWebViewResult\"},{\"id\":172168437,\"method\":\"messages.sendWebViewResultMessage\",\"params\":[{\"name\":\"bot_query_id\",\"type\":\"string\"},{\"name\":\"result\",\"type\":\"InputBotInlineResult\"}],\"type\":\"WebViewMessageSent\"},{\"id\":-603831608,\"method\":\"messages.sendWebViewData\",\"params\":[{\"name\":\"bot\",\"type\":\"InputUser\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"button_text\",\"type\":\"string\"},{\"name\":\"data\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":1157944655,\"method\":\"bots.setBotMenuButton\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"button\",\"type\":\"BotMenuButton\"}],\"type\":\"Bool\"},{\"id\":-1671369944,\"method\":\"bots.getBotMenuButton\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"BotMenuButton\"},{\"id\":-510647672,\"method\":\"account.getSavedRingtones\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"account.SavedRingtones\"},{\"id\":1038768899,\"method\":\"account.saveRingtone\",\"params\":[{\"name\":\"id\",\"type\":\"InputDocument\"},{\"name\":\"unsave\",\"type\":\"Bool\"}],\"type\":\"account.SavedRingtone\"},{\"id\":-2095414366,\"method\":\"account.uploadRingtone\",\"params\":[{\"name\":\"file\",\"type\":\"InputFile\"},{\"name\":\"file_name\",\"type\":\"string\"},{\"name\":\"mime_type\",\"type\":\"string\"}],\"type\":\"Document\"},{\"id\":2021942497,\"method\":\"bots.setBotBroadcastDefaultAdminRights\",\"params\":[{\"name\":\"admin_rights\",\"type\":\"ChatAdminRights\"}],\"type\":\"Bool\"},{\"id\":-1839281686,\"method\":\"bots.setBotGroupDefaultAdminRights\",\"params\":[{\"name\":\"admin_rights\",\"type\":\"ChatAdminRights\"}],\"type\":\"Bool\"},{\"id\":1092913030,\"method\":\"phone.saveCallLog\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"file\",\"type\":\"InputFile\"}],\"type\":\"Bool\"},{\"id\":-456419968,\"method\":\"channels.toggleJoinToSend\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":1277789622,\"method\":\"channels.toggleJoinRequest\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":261206117,\"method\":\"payments.exportInvoice\",\"params\":[{\"name\":\"invoice_media\",\"type\":\"InputMedia\"}],\"type\":\"payments.ExportedInvoice\"},{\"id\":647928393,\"method\":\"messages.transcribeAudio\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"messages.TranscribedAudio\"},{\"id\":2132608815,\"method\":\"messages.rateTranscribedAudio\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"transcription_id\",\"type\":\"long\"},{\"name\":\"good\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":-2131921795,\"method\":\"payments.assignAppStoreTransaction\",\"params\":[{\"name\":\"receipt\",\"type\":\"bytes\"},{\"name\":\"purpose\",\"type\":\"InputStorePaymentPurpose\"}],\"type\":\"Updates\"},{\"id\":-537046829,\"method\":\"payments.assignPlayMarketTransaction\",\"params\":[{\"name\":\"receipt\",\"type\":\"DataJSON\"},{\"name\":\"purpose\",\"type\":\"InputStorePaymentPurpose\"}],\"type\":\"Updates\"},{\"id\":-1614700874,\"method\":\"payments.canPurchasePremium\",\"params\":[{\"name\":\"purpose\",\"type\":\"InputStorePaymentPurpose\"}],\"type\":\"Bool\"},{\"id\":-1206152236,\"method\":\"help.getPremiumPromo\",\"params\":[],\"type\":\"help.PremiumPromo\"},{\"id\":-643100844,\"method\":\"messages.getCustomEmojiDocuments\",\"params\":[{\"name\":\"document_id\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":-67329649,\"method\":\"messages.getEmojiStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.AllStickers\"},{\"id\":248473398,\"method\":\"messages.getFeaturedEmojiStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.FeaturedStickers\"},{\"id\":-70001045,\"method\":\"account.updateEmojiStatus\",\"params\":[{\"name\":\"emoji_status\",\"type\":\"EmojiStatus\"}],\"type\":\"Bool\"},{\"id\":-696962170,\"method\":\"account.getDefaultEmojiStatuses\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"account.EmojiStatuses\"},{\"id\":257392901,\"method\":\"account.getRecentEmojiStatuses\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"account.EmojiStatuses\"},{\"id\":404757166,\"method\":\"account.clearRecentEmojiStatuses\",\"params\":[],\"type\":\"Bool\"},{\"id\":1063567478,\"method\":\"messages.reportReaction\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"reaction_peer\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-1149164102,\"method\":\"messages.getTopReactions\",\"params\":[{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Reactions\"},{\"id\":960896434,\"method\":\"messages.getRecentReactions\",\"params\":[{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"messages.Reactions\"},{\"id\":-1644236876,\"method\":\"messages.clearRecentReactions\",\"params\":[],\"type\":\"Bool\"},{\"id\":-2064119788,\"method\":\"messages.getExtendedMedia\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":767062953,\"method\":\"auth.importWebTokenAuthorization\",\"params\":[{\"name\":\"api_id\",\"type\":\"int\"},{\"name\":\"api_hash\",\"type\":\"string\"},{\"name\":\"web_auth_token\",\"type\":\"string\"}],\"type\":\"auth.Authorization\"},{\"id\":-279966037,\"method\":\"account.reorderUsernames\",\"params\":[{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":1490465654,\"method\":\"account.toggleUsername\",\"params\":[{\"name\":\"username\",\"type\":\"string\"},{\"name\":\"active\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":-1268978403,\"method\":\"channels.reorderUsernames\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":1358053637,\"method\":\"channels.toggleUsername\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"username\",\"type\":\"string\"},{\"name\":\"active\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":170155475,\"method\":\"channels.deactivateAllUsernames\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"Bool\"},{\"id\":-1540781271,\"method\":\"channels.toggleForum\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":-200539612,\"method\":\"channels.createForumTopic\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"icon_color\",\"type\":\"flags.0?int\"},{\"name\":\"icon_emoji_id\",\"type\":\"flags.3?long\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"send_as\",\"type\":\"flags.2?InputPeer\"}],\"type\":\"Updates\"},{\"id\":233136337,\"method\":\"channels.getForumTopics\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"q\",\"type\":\"flags.0?string\"},{\"name\":\"offset_date\",\"type\":\"int\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"offset_topic\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.ForumTopics\"},{\"id\":-1333584199,\"method\":\"channels.getForumTopicsByID\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"topics\",\"type\":\"Vector\"}],\"type\":\"messages.ForumTopics\"},{\"id\":-186670715,\"method\":\"channels.editForumTopic\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"topic_id\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"flags.0?string\"},{\"name\":\"icon_emoji_id\",\"type\":\"flags.1?long\"},{\"name\":\"closed\",\"type\":\"flags.2?Bool\"},{\"name\":\"hidden\",\"type\":\"flags.3?Bool\"}],\"type\":\"Updates\"},{\"id\":1814925350,\"method\":\"channels.updatePinnedForumTopic\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"topic_id\",\"type\":\"int\"},{\"name\":\"pinned\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":876830509,\"method\":\"channels.deleteTopicHistory\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"top_msg_id\",\"type\":\"int\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":693150095,\"method\":\"channels.reorderPinnedForumTopics\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"force\",\"type\":\"flags.0?true\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":1760814315,\"method\":\"channels.toggleAntiSpam\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":-1471109485,\"method\":\"channels.reportAntiSpamFalsePositive\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":-1632299963,\"method\":\"messages.setDefaultHistoryTTL\",\"params\":[{\"name\":\"period\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":1703637384,\"method\":\"messages.getDefaultHistoryTTL\",\"params\":[],\"type\":\"DefaultHistoryTTL\"},{\"id\":-127582169,\"method\":\"contacts.exportContactToken\",\"params\":[],\"type\":\"ExportedContactToken\"},{\"id\":318789512,\"method\":\"contacts.importContactToken\",\"params\":[{\"name\":\"token\",\"type\":\"string\"}],\"type\":\"User\"},{\"id\":-515093903,\"method\":\"photos.uploadContactProfilePhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"suggest\",\"type\":\"flags.3?true\"},{\"name\":\"save\",\"type\":\"flags.4?true\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"file\",\"type\":\"flags.0?InputFile\"},{\"name\":\"video\",\"type\":\"flags.1?InputFile\"},{\"name\":\"video_start_ts\",\"type\":\"flags.2?double\"},{\"name\":\"video_emoji_markup\",\"type\":\"flags.5?VideoSize\"}],\"type\":\"photos.Photo\"},{\"id\":1785624660,\"method\":\"channels.toggleParticipantsHidden\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":-29831141,\"method\":\"messages.sendBotRequestedPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"button_id\",\"type\":\"int\"},{\"name\":\"requested_peer\",\"type\":\"InputPeer\"}],\"type\":\"Updates\"},{\"id\":-495647960,\"method\":\"account.getDefaultProfilePhotoEmojis\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"EmojiList\"},{\"id\":-1856479058,\"method\":\"account.getDefaultGroupPhotoEmojis\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"EmojiList\"},{\"id\":-1991881904,\"method\":\"auth.requestFirebaseSms\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"safety_net_token\",\"type\":\"flags.0?string\"},{\"name\":\"ios_push_secret\",\"type\":\"flags.1?string\"}],\"type\":\"Bool\"},{\"id\":1955122779,\"method\":\"messages.getEmojiGroups\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.EmojiGroups\"},{\"id\":785209037,\"method\":\"messages.getEmojiStatusGroups\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.EmojiGroups\"},{\"id\":564480243,\"method\":\"messages.getEmojiProfilePhotoGroups\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.EmojiGroups\"},{\"id\":739360983,\"method\":\"messages.searchCustomEmoji\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"EmojiList\"},{\"id\":-461589127,\"method\":\"messages.togglePeerTranslations\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"disabled\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":-1379156774,\"method\":\"account.getAutoSaveSettings\",\"params\":[],\"type\":\"account.AutoSaveSettings\"},{\"id\":-694451359,\"method\":\"account.saveAutoSaveSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"users\",\"type\":\"flags.0?true\"},{\"name\":\"chats\",\"type\":\"flags.1?true\"},{\"name\":\"broadcasts\",\"type\":\"flags.2?true\"},{\"name\":\"peer\",\"type\":\"flags.3?InputPeer\"},{\"name\":\"settings\",\"type\":\"AutoSaveSettings\"}],\"type\":\"Bool\"},{\"id\":1404829728,\"method\":\"account.deleteAutoSaveExceptions\",\"params\":[],\"type\":\"Bool\"}]},\"layer\":152} as {\n MTProto: {\n constructors: MTProtoConstructor[],\n methods: MTProtoMethod[],\n constructorsIndex?: {[id: number]: number}\n },\n API: {\n constructors: MTProtoConstructor[],\n methods: MTProtoMethod[],\n constructorsIndex?: {[id: number]: number}\n },\n layer: number,\n};\n","export default function intToUint(val: number) {\n // return val < 0 ? val + 4294967296 : val; // 0 <= val <= Infinity\n return val >>> 0; // (4294967296 >>> 0) === 0; 0 <= val <= 4294967295\n}\n","import bigInt from 'big-integer';\nimport intToUint from '../number/intToUint';\n\nexport default function ulongFromInts(high: number, low: number) {\n high = intToUint(high), low = intToUint(low);\n return bigInt(high).shiftLeft(32).add(bigInt(low));\n}\n","import bigInt from 'big-integer';\n\nexport const safeBigInt = bigInt(Number.MAX_SAFE_INTEGER);\nexport const ulongBigInt = bigInt(bigInt[2]).pow(64);\nexport const longBigInt = ulongBigInt.divide(bigInt[2]);\n","import bigInt from 'big-integer';\nimport { longBigInt, ulongBigInt } from './bigIntConstants';\n\nexport function bigIntFromBytes(bytes: Uint8Array | number[], base = 256) {\n return bigInt.fromArray(bytes instanceof Uint8Array ? [...bytes] : bytes, base);\n}\n\nexport function bigIntToBytes(bigInt: bigInt.BigInteger) {\n return new Uint8Array(bigInt.toArray(256).value);\n}\n\nexport function bigIntToSigned(bigInt: bigInt.BigInteger) {\n return bigInt.greater(longBigInt) ? bigInt.minus(ulongBigInt) : bigInt;\n}\n\nexport function bigIntToUnsigned(bigInt: bigInt.BigInteger) {\n return bigInt.isNegative() ? ulongBigInt.add(bigInt) : bigInt;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport Schema, {MTProtoConstructor} from './schema';\nimport {JSONValue} from '../../layer';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport bytesToHex from '../../helpers/bytes/bytesToHex';\nimport isObject from '../../helpers/object/isObject';\nimport gzipUncompress from '../../helpers/gzipUncompress';\nimport bigInt from 'big-integer';\nimport ulongFromInts from '../../helpers/long/ulongFromInts';\nimport {safeBigInt} from '../../helpers/bigInt/bigIntConstants';\nimport {bigIntToSigned, bigIntToUnsigned} from '../../helpers/bigInt/bigIntConversion';\n\nconst boolFalse = +Schema.API.constructors.find((c) => c.predicate === 'boolFalse').id;\nconst boolTrue = +Schema.API.constructors.find((c) => c.predicate === 'boolTrue').id;\nconst vector = +Schema.API.constructors.find((c) => c.predicate === 'vector').id;\nconst gzipPacked = +Schema.MTProto.constructors.find((c) => c.predicate === 'gzip_packed').id;\n\n// * using slice to have a new buffer, otherwise the buffer will be copied to main thread\nconst sliceMethod: 'slice' | 'subarray' = 'slice'; // subarray\n\nclass TLSerialization {\n private maxLength = 2048; // 2Kb\n private offset = 0; // in bytes\n private mtproto = false;\n private debug = false;// Modes.debug;\n\n private buffer: ArrayBuffer;\n private intView: Int32Array;\n private byteView: Uint8Array;\n\n constructor(options: Partial<{startMaxLength: number, mtproto: true}> = {}) {\n this.maxLength = options.startMaxLength || 2048; // 2Kb\n this.mtproto = options.mtproto || false;\n this.createBuffer();\n }\n\n public createBuffer() {\n this.buffer = new ArrayBuffer(this.maxLength);\n this.intView = new Int32Array(this.buffer);\n this.byteView = new Uint8Array(this.buffer);\n }\n\n public getArray() {\n const resultBuffer = new ArrayBuffer(this.offset);\n\n // let perf = performance.now();\n /* const resultUint8: any = new Uint8Array(resultBuffer);\n resultUint8.set(this.byteView.subarray(0, this.offset)); */\n // console.log('perf uint8', performance.now() - perf);\n\n // perf = performance.now();\n const resultInt32 = new Int32Array(resultBuffer);\n resultInt32.set(this.intView.subarray(0, this.offset / 4));\n // console.log('perf int32', performance.now() - perf);\n\n /* if(resultUint8.buffer.byteLength !== resultInt32.buffer.byteLength) {\n console.error(resultUint8, resultInt32);\n } */\n\n return resultInt32;\n }\n\n public getBuffer() {\n return this.getArray().buffer;\n }\n\n public getBytes(typed: true): Uint8Array;\n public getBytes(typed?: false): number[];\n public getBytes(typed: boolean = true): number[] | Uint8Array {\n if(typed) {\n const resultBuffer = new ArrayBuffer(this.offset);\n const resultArray = new Uint8Array(resultBuffer);\n\n resultArray.set(this.byteView.subarray(0, this.offset));\n\n return resultArray;\n }\n\n const bytes: number[] = new Array(this.offset);\n for(let i = 0; i < this.offset; ++i) {\n bytes[i] = this.byteView[i];\n }\n return bytes;\n }\n\n public getOffset() {\n return this.offset;\n }\n\n public checkLength(needBytes: number) {\n if(this.offset + needBytes < this.maxLength) {\n return;\n }\n\n // console.log('Increase buffer start', this.offset, needBytes, this.maxLength, this.byteView.slice(0, 32));\n this.maxLength = Math.ceil(Math.max(this.maxLength * 2, this.offset + needBytes + 16) / 4) * 4;\n const previousBuffer = this.buffer;\n // const previousByteView = this.byteView;\n const previousArray = new Int32Array(previousBuffer);\n\n this.createBuffer();\n\n new Int32Array(this.buffer).set(previousArray);\n /* console.log('Increase buffer end', this.offset, needBytes, this.maxLength, this.byteView.slice(0, 32),\n bytesCmp(previousByteView, this.byteView.slice(0, previousByteView.length))); */\n }\n\n public writeInt(i: number, field: string) {\n this.debug && console.log('>>>', i.toString(16), i, field);\n\n const offset = this.offset / 4;\n this.checkLength(4);\n this.intView[offset] = i;\n this.offset += 4;\n\n return offset;\n }\n\n public storeInt(i: number, field?: string) {\n return this.writeInt(i, (field || '') + ':int');\n }\n\n public storeBool(i: boolean, field?: string) {\n if(i) {\n this.writeInt(boolTrue, (field || '') + ':bool');\n } else {\n this.writeInt(boolFalse, (field || '') + ':bool');\n }\n }\n\n public storeLongP(iHigh: number, iLow: number, field?: string) {\n this.writeInt(iLow, (field || '') + ':long[low]');\n this.writeInt(iHigh, (field || '') + ':long[high]');\n }\n\n public storeLong(sLong: Array | string | number, field?: string) {\n if(Array.isArray(sLong)) {\n if(sLong.length === 2) {\n return this.storeLongP(sLong[0], sLong[1], field);\n } else {\n return this.storeIntBytes(sLong, 64, field);\n }\n }\n\n const _bigInt = bigIntToUnsigned(bigInt(sLong as string));\n const {quotient, remainder} = _bigInt.divmod(0x100000000);\n const high = quotient.toJSNumber();\n const low = remainder.toJSNumber();\n\n this.writeInt(low, (field || '') + ':long[low]');\n this.writeInt(high, (field || '') + ':long[high]');\n }\n\n public storeDouble(f: any, field?: string) {\n const buffer = new ArrayBuffer(8);\n const intView = new Int32Array(buffer);\n const doubleView = new Float64Array(buffer);\n\n doubleView[0] = f;\n\n this.writeInt(intView[0], (field || '') + ':double[low]');\n this.writeInt(intView[1], (field || '') + ':double[high]');\n }\n\n public storeString(s: string, field?: string) {\n this.debug && console.log('>>>', s, (field || '') + ':string');\n\n if(s === undefined) {\n s = '';\n }\n const sUTF8 = unescape(encodeURIComponent(s));\n\n this.checkLength(sUTF8.length + 8);\n\n const len = sUTF8.length;\n if(len <= 253) {\n this.byteView[this.offset++] = len;\n } else {\n this.byteView[this.offset++] = 254;\n this.byteView[this.offset++] = len & 0xFF;\n this.byteView[this.offset++] = (len & 0xFF00) >> 8;\n this.byteView[this.offset++] = (len & 0xFF0000) >> 16;\n }\n for(let i = 0; i < len; ++i) {\n this.byteView[this.offset++] = sUTF8.charCodeAt(i);\n }\n\n // Padding\n while(this.offset % 4) {\n this.byteView[this.offset++] = 0;\n }\n }\n\n public storeBytes(bytes: ArrayBuffer | Uint8Array | number[], field?: string) {\n if(bytes instanceof ArrayBuffer) {\n bytes = new Uint8Array(bytes);\n } else if(bytes === undefined) {\n bytes = [];\n }\n\n this.debug && console.log('>>>', bytesToHex(bytes as number[]), (field || '') + ':bytes');\n\n // if uint8array was json.stringified, then will be: {'0': 123, '1': 123}\n const len = (bytes as Uint8Array).length;\n this.checkLength(len + 8);\n if(len <= 253) {\n this.byteView[this.offset++] = len;\n } else {\n this.byteView[this.offset++] = 254;\n this.byteView[this.offset++] = len & 0xFF;\n this.byteView[this.offset++] = (len & 0xFF00) >> 8;\n this.byteView[this.offset++] = (len & 0xFF0000) >> 16;\n }\n\n this.byteView.set(bytes as Uint8Array, this.offset);\n this.offset += len;\n\n // Padding\n while(this.offset % 4) {\n this.byteView[this.offset++] = 0;\n }\n }\n\n public storeIntBytes(bytes: ArrayBuffer | Uint8Array | number[], bits: number, field?: string) {\n if(bytes instanceof ArrayBuffer) {\n bytes = new Uint8Array(bytes);\n }\n\n const len = (bytes as Uint8Array).length;\n if((bits % 32) || (len * 8) !== bits) {\n const error = new Error('Invalid bits: ' + bits + ', ' + len);\n console.error(error, bytes, field);\n throw error;\n }\n\n this.debug && console.log('>>>', bytesToHex(bytes as Uint8Array), (field || '') + ':int' + bits);\n this.checkLength(len);\n\n this.byteView.set(bytes as Uint8Array, this.offset);\n this.offset += len;\n }\n\n public storeRawBytes(bytes: ArrayLike, field?: string) {\n if(bytes instanceof ArrayBuffer) {\n bytes = new Uint8Array(bytes);\n }\n\n const len = bytes.length;\n\n this.debug && console.log('>>>', bytesToHex(bytes), (field || ''));\n this.checkLength(len);\n\n this.byteView.set(bytes, this.offset);\n this.offset += len;\n }\n\n public storeMethod(methodName: string, params: any) {\n const schema = this.mtproto ? Schema.MTProto : Schema.API;\n const methodData = schema.methods.find((m) => m.method === methodName);\n\n if(!methodData) {\n throw new Error('No method ' + methodName + ' found');\n }\n\n this.storeInt(methodData.id, methodName + '[id]');\n\n const pFlags = params.pFlags || params; // * support pFlags, though am not expecting it to be there\n const flagsOffsets: {[paramName: string]: number} = {};\n // console.log('storeMethod', len, methodData);\n for(const param of methodData.params) {\n let type = param.type;\n\n if(type.indexOf('?') !== -1) {\n const condType = type.split('?');\n const fieldBit = condType[0].split('.');\n\n if(!(params[fieldBit[0]] & (1 << +fieldBit[1]))) {\n if(condType[1] === 'true' ? pFlags[param.name] : params[param.name] !== undefined) {\n // console.log('storeMethod autocompleting', methodName, param.name, params[param.name], type);\n params[fieldBit[0]] |= 1 << +fieldBit[1];\n } else {\n continue;\n }\n }\n\n // console.log('storeMethod', methodName, fieldBit, params[fieldBit[0]], params, param, condType, !!(params[fieldBit[0]] & (1 << +fieldBit[1])));\n type = condType[1];\n }\n\n // console.log('storeMethod', methodName, param.name, params[param.name], type);\n const result = this.storeObject(params[param.name], type, methodName + '[' + param.name + ']');\n\n if(type === '#') {\n params[param.name] = params[param.name] || 0;\n flagsOffsets[param.name] = result as number;\n }\n }\n\n for(const paramName in flagsOffsets) {\n this.intView[flagsOffsets[paramName]] = params[paramName];\n }\n\n return methodData.type;\n }\n\n public storeObject(obj: any, type: string, field?: string) {\n // console.log('storeObject', obj, type, field, this.offset, this.getBytes(true).hex);\n switch(type) {\n case '#':\n obj = obj || 0;\n case 'int':\n return this.storeInt(obj, field);\n case 'long':\n return this.storeLong(obj, field);\n case 'int128':\n return this.storeIntBytes(obj, 128, field);\n case 'int256':\n return this.storeIntBytes(obj, 256, field);\n case 'int512':\n return this.storeIntBytes(obj, 512, field);\n case 'string':\n return this.storeString(obj, field);\n case 'bytes':\n return this.storeBytes(obj, field);\n case 'double':\n return this.storeDouble(obj, field);\n case 'Bool':\n return this.storeBool(obj, field);\n case 'true':\n return\n }\n\n if(Array.isArray(obj)) {\n if(type.substr(0, 6) === 'Vector') {\n this.writeInt(vector, field + '[id]');\n } else if(type.substr(0, 6) !== 'vector') {\n throw new Error('Invalid vector type ' + type);\n }\n\n const itemType = type.substr(7, type.length - 8); // for \"Vector\"\n this.writeInt(obj.length, field + '[count]');\n for(let i = 0; i < obj.length; ++i) {\n this.storeObject(obj[i], itemType, field + '[' + i + ']');\n }\n\n return true;\n } else if(type.substr(0, 6).toLowerCase() === 'vector') {\n throw new Error('Invalid vector object');\n }\n\n if(!isObject(obj)) {\n throw new Error('Invalid object for type ' + type);\n }\n\n const schema = this.mtproto ? Schema.MTProto : Schema.API;\n const predicate = obj['_'];\n let isBare = false;\n const constructorData: MTProtoConstructor = schema.constructors.find((c) => c.predicate === predicate);\n\n if(isBare = (type.charAt(0) === '%')) {\n type = type.substr(1);\n }\n\n if(!constructorData) {\n throw new Error('No predicate ' + predicate + ' found');\n }\n\n if(predicate === type) {\n isBare = true;\n }\n\n if(!isBare) {\n this.writeInt(constructorData.id, field + '[' + predicate + '][id]');\n }\n\n const pFlags = obj.pFlags;\n const flagsOffsets: {[paramName: string]: number} = {};\n // console.log('storeObject', len, constructorData);\n for(const param of constructorData.params) {\n let type = param.type;\n\n // console.log('storeObject', param, type);\n if(type.indexOf('?') !== -1) {\n const condType = type.split('?');\n const fieldBit = condType[0].split('.');\n\n // console.log('storeObject fieldBit', fieldBit, obj[fieldBit[0]]);\n\n if(!(obj[fieldBit[0]] & (1 << +fieldBit[1]))) {\n if(condType[1] === 'true' ? pFlags && pFlags[param.name] : obj[param.name] !== undefined) {\n // console.log('storeObject autocompleting', param.name, obj[param.name], type);\n obj[fieldBit[0]] |= 1 << +fieldBit[1];\n } else {\n continue;\n }\n }\n\n type = condType[1];\n }\n // console.log('storeObject', param, type);\n\n const result = this.storeObject(obj[param.name], type, field + '[' + predicate + '][' + param.name + ']');\n\n if(type === '#') {\n obj[param.name] = obj[param.name] || 0;\n flagsOffsets[param.name] = result as number;\n }\n }\n\n for(const paramName in flagsOffsets) {\n this.intView[flagsOffsets[paramName]] = obj[paramName];\n }\n\n return constructorData.type;\n }\n}\n\nclass TLDeserialization {\n private offset = 0; // in bytes\n private override: {[key: string]: (result: any, field: string) => void};\n\n private buffer: ArrayBuffer;\n private intView: Int32Array;\n private byteView: Uint8Array;\n\n // this.debug =\n private mtproto: boolean = false;\n private debug: boolean;\n\n constructor(buffer: ArrayBuffer | Uint8Array, options: Partial<{override: any, mtproto: true, debug: true}> = {}) {\n // buffer = addPadding(buffer, 4, true); // fix 21.01.2020 for wss\n if(buffer instanceof ArrayBuffer) {\n this.buffer = buffer;\n this.intView = new Int32Array(buffer);\n this.byteView = new Uint8Array(this.buffer);\n } else {\n this.buffer = buffer.buffer;\n this.intView = new Int32Array(buffer.buffer);\n this.byteView = buffer;\n }\n\n // console.log(this.intView);\n\n this.override = options.override || {};\n this.mtproto = !!options.mtproto;\n this.debug = options.debug !== undefined ? options.debug : /* Modes.debug */false;\n }\n\n /* public setMtproto(mtproto: boolean) {\n this.mtproto = mtproto;\n } */\n\n private readInt(field: string) {\n // if(this.offset >= this.intView.length * 4) {\n if((this.byteView.length - this.offset) < 4) {\n console.error(this.byteView, this.offset);\n throw new Error('Nothing to fetch: ' + field);\n }\n\n const i = this.intView[this.offset / 4];\n // const i = new Uint32Array(this.byteView.buffer.slice(this.offset, this.offset + 4))[0];\n\n this.debug &&/* || field.includes('[dialog][read_outbox_max_id]') */\n console.log('<<<', i.toString(16), i, field,\n this.byteView.slice(this.offset - 16, this.offset + 16),\n bytesToHex(this.byteView.slice(this.offset - 16, this.offset + 16)));\n\n this.offset += 4;\n\n return i;\n }\n\n public fetchInt(field?: string) {\n return this.readInt((field || '') + ':int');\n }\n\n public fetchDouble(field?: string) {\n const buffer = new ArrayBuffer(8);\n const intView = new Int32Array(buffer);\n const doubleView = new Float64Array(buffer);\n\n intView[0] = this.readInt((field || '') + ':double[low]'),\n intView[1] = this.readInt((field || '') + ':double[high]');\n\n return doubleView[0];\n }\n\n // ! it should've been signed\n public fetchLong(field?: string): FetchLongAs {\n const iLow = this.readInt((field || '') + ':long[low]');\n const iHigh = this.readInt((field || '') + ':long[high]');\n\n let ulong = ulongFromInts(iHigh, iLow);\n if(/* !unsigned && */!this.mtproto) { // make it signed\n ulong = bigIntToSigned(ulong);\n }\n\n if(!this.mtproto) {\n if(safeBigInt.greaterOrEquals(ulong.abs())) {\n // @ts-ignore\n return ulong.toJSNumber();\n }\n }\n\n // @ts-ignore\n return ulong.toString(10);\n }\n\n public fetchBool(field?: string): boolean {\n const i = this.readInt((field || '') + ':bool');\n if(i === boolTrue) {\n return true;\n } else if(i === boolFalse) {\n return false;\n }\n\n this.offset -= 4;\n return this.fetchObject('Object', field);\n }\n\n public fetchString(field?: string): string {\n let len = this.byteView[this.offset++];\n\n if(len === 254) {\n len = this.byteView[this.offset++] |\n (this.byteView[this.offset++] << 8) |\n (this.byteView[this.offset++] << 16);\n }\n\n let sUTF8 = '';\n for(let i = 0; i < len; ++i) {\n sUTF8 += String.fromCharCode(this.byteView[this.offset++]);\n }\n\n // Padding\n while(this.offset % 4) {\n ++this.offset;\n }\n\n let s: string;\n try {\n s = decodeURIComponent(escape(sUTF8));\n } catch(e) {\n s = sUTF8;\n }\n\n this.debug && console.log('<<<', s, (field || '') + ':string');\n\n return s;\n }\n\n public fetchBytes(field?: string) {\n let len = this.byteView[this.offset++];\n\n if(len === 254) {\n len = this.byteView[this.offset++] |\n (this.byteView[this.offset++] << 8) |\n (this.byteView[this.offset++] << 16);\n }\n\n const bytes = this.byteView[sliceMethod](this.offset, this.offset + len);\n this.offset += len;\n\n // Padding\n while(this.offset % 4) {\n ++this.offset;\n }\n\n this.debug && console.log('<<<', bytesToHex(bytes), (field || '') + ':bytes');\n\n return bytes;\n }\n\n public fetchIntBytes(bits: number, typed: true, field?: string): Uint8Array;\n public fetchIntBytes(bits: number, typed?: false, field?: string): number[];\n public fetchIntBytes(bits: number, typed: boolean = true, field?: string) {\n if(bits % 32) {\n throw new Error('Invalid bits: ' + bits);\n }\n\n const len = bits / 8;\n if(typed) {\n const result = this.byteView[sliceMethod](this.offset, this.offset + len);\n this.offset += len;\n return result;\n }\n\n const bytes: number[] = new Array(len);\n for(let i = 0; i < len; ++i) {\n bytes[i] = this.byteView[this.offset++];\n }\n\n this.debug && console.log('<<<', bytesToHex(bytes), (field || '') + ':int' + bits);\n\n return bytes;\n }\n\n public fetchRawBytes(len: number | false, typed: true, field: string): Uint8Array;\n public fetchRawBytes(len: number | false, typed: false, field: string): number[];\n public fetchRawBytes(len: number | false, typed: boolean = true, field: string) {\n if(len === false) {\n len = this.readInt((field || '') + '_length');\n if(len > this.byteView.byteLength) {\n throw new Error('Invalid raw bytes length: ' + len + ', buffer len: ' + this.byteView.byteLength);\n }\n }\n\n if(typed) {\n const bytes = new Uint8Array(len);\n bytes.set(this.byteView[sliceMethod](this.offset, this.offset + len));\n this.offset += len;\n return bytes;\n }\n\n const bytes: number[] = new Array(len);\n for(let i = 0; i < len; ++i) {\n bytes[i] = this.byteView[this.offset++];\n }\n\n this.debug && console.log('<<<', bytesToHex(bytes), (field || ''));\n\n return bytes;\n }\n\n private fetchVector(type: string, field?: string) {\n const len = this.readInt(field + '[count]');\n const result: any[] = new Array(len);\n if(len > 0) {\n const itemType = type.substr(7, type.length - 8); // for \"Vector\"\n for(let i = 0; i < len; ++i) {\n result[i] = this.fetchObject(itemType, field + '[' + i + ']');\n }\n }\n\n return result;\n }\n\n public fetchObject(type: string, field?: string): any {\n switch(type) {\n case '#':\n case 'int':\n return this.fetchInt(field);\n case 'long':\n return this.fetchLong(field);\n case 'int128':\n return this.fetchIntBytes(128, true, field);\n case 'int256':\n return this.fetchIntBytes(256, true, field);\n case 'int512':\n return this.fetchIntBytes(512, true, field);\n case 'string':\n return this.fetchString(field);\n case 'bytes':\n return this.fetchBytes(field);\n case 'double':\n return this.fetchDouble(field);\n case 'Bool':\n return this.fetchBool(field);\n case 'true':\n return true;\n }\n\n field = field || type || 'Object';\n\n if(type.charAt(0) === 'v' && type.substr(1, 5) === 'ector') {\n return this.fetchVector(type, field);\n }\n\n const schema = this.mtproto ? Schema.MTProto : Schema.API;\n let constructorData: MTProtoConstructor = null;\n let fallback = false;\n\n if(type.charAt(0) === '%') {\n const checkType = type.substr(1);\n constructorData = schema.constructors.find((c) => c.type === checkType);\n if(!constructorData) {\n throw new Error('Constructor not found for type: ' + type);\n }\n }/* else if(type.charAt(0) >= 97 && type.charAt(0) <= 122) {\n constructorData = schema.constructors.find((c) => c.predicate === type);\n if(!constructorData) {\n throw new Error('Constructor not found for predicate: ' + type);\n }\n } */ else {\n const constructorCmp = this.readInt(field + '[id]');\n\n if(constructorCmp === gzipPacked) { // Gzip packed\n const compressed = this.fetchBytes(field + '[packed_string]');\n const uncompressed = gzipUncompress(compressed) as Uint8Array;\n const newDeserializer = new TLDeserialization(uncompressed); // rpc_result is packed here\n\n return newDeserializer.fetchObject(type, field);\n }\n\n if(constructorCmp === vector) {\n return this.fetchVector(type, field);\n }\n\n let index = schema.constructorsIndex;\n if(!index) {\n schema.constructorsIndex = index = {};\n for(let i = 0, len = schema.constructors.length; i < len; ++i) {\n index[schema.constructors[i].id] = i;\n }\n }\n\n const i = index[constructorCmp];\n if(i !== undefined) {\n constructorData = schema.constructors[i];\n }\n\n if(!constructorData && this.mtproto) {\n const schemaFallback = Schema.API;\n for(let i = 0, len = schemaFallback.constructors.length; i < len; ++i) {\n if(+schemaFallback.constructors[i].id === constructorCmp) {\n constructorData = schemaFallback.constructors[i];\n\n delete this.mtproto;\n fallback = true;\n break;\n }\n }\n }\n\n if(!constructorData) {\n console.error('Constructor not found:', constructorCmp);\n\n let int1: number, int2: number;\n try {\n int1 = this.fetchInt(field);\n int2 = this.fetchInt(field);\n } catch(err) {\n\n }\n\n throw new Error('Constructor not found: ' + constructorCmp + ' ' + int1 + ' ' + int2 + ' ' + field);\n }\n }\n\n const predicate = constructorData.predicate;\n\n const result: any = {'_': predicate};\n const overrideKey = (this.mtproto ? 'mt_' : '') + predicate;\n if(this.override[overrideKey]) {\n this.override[overrideKey](result, field + '[' + predicate + ']');\n } else {\n for(let i = 0, len = constructorData.params.length; i < len; ++i) {\n const param = constructorData.params[i];\n let type = param.type;\n\n if(type === '#' && result.pFlags === undefined) {\n result.pFlags = {};\n }\n\n const isCond = type.indexOf('?') !== -1;\n if(isCond) {\n const condType = type.split('?');\n const fieldBit = condType[0].split('.');\n\n if(!(result[fieldBit[0]] & (1 << +fieldBit[1]))) {\n continue;\n }\n\n type = condType[1];\n }\n\n const value = this.fetchObject(type, field + '[' + predicate + '][' + param.name + ']');\n\n if(isCond && type === 'true') {\n result.pFlags[param.name] = value;\n } else {\n result[param.name] = value;\n }\n }\n }\n\n if(fallback) {\n this.mtproto = true;\n }\n\n if(type === 'JSONValue') {\n return this.formatJSONValue(result);\n }\n\n return result;\n }\n\n private formatJSONValue(jsonValue: JSONValue): any {\n if(!jsonValue._) return jsonValue;\n switch(jsonValue._) {\n case 'jsonNull':\n return null;\n case 'jsonObject': {\n const out: any = {};\n const objectValues = jsonValue.value;\n for(let i = 0, length = objectValues.length; i < length; ++i) {\n const objectValue = objectValues[i];\n out[objectValue.key] = this.formatJSONValue(objectValue.value);\n }\n return out;\n }\n default:\n return jsonValue.value;\n }\n }\n\n public getOffset() {\n return this.offset;\n }\n\n public setOffset(offset: number) {\n this.offset = offset;\n }\n\n /* public fetchEnd() {\n if(this.offset !== this.byteView.length) {\n throw new Error('Fetch end with non-empty buffer');\n }\n\n return true;\n } */\n}\n\nMOUNT_CLASS_TO.TLDeserialization = TLDeserialization;\nMOUNT_CLASS_TO.TLSerialization = TLSerialization;\nexport {TLDeserialization, TLSerialization};\n","// export function gzipUncompress(bytes: ArrayBuffer, toString: true): string;\n\n// @ts-ignore\nimport pako from 'pako/dist/pako_inflate.min.js';\n// import dT from './dT';\n\n// export function gzipUncompress(bytes: ArrayBuffer, toString?: false): Uint8Array;\nexport default function gzipUncompress(bytes: ArrayBuffer, toString?: boolean): string | Uint8Array {\n // console.log(dT(), 'Gzip uncompress start');\n const result = pako.inflate(bytes, toString ? {to: 'string'} : undefined);\n // console.log(dT(), 'Gzip uncompress finish'/* , result */);\n return result;\n}\n","import randomize from '../array/randomize';\nimport bufferConcats from './bufferConcats';\n\nexport default function addPadding(\n bytes: T,\n blockSize: number = 16,\n zeroes?: boolean,\n blockSizeAsTotalLength = false,\n prepend = false\n): T {\n const len = (bytes as ArrayBuffer).byteLength || (bytes as Uint8Array).length;\n const needPadding = blockSizeAsTotalLength ? blockSize - len : blockSize - (len % blockSize);\n if(needPadding > 0 && needPadding < blockSize) {\n // //console.log('addPadding()', len, blockSize, needPadding);\n const padding = new Uint8Array(needPadding);\n if(zeroes) {\n for(let i = 0; i < needPadding; ++i) {\n padding[i] = 0;\n }\n } else {\n randomize(padding);\n }\n\n if(bytes instanceof ArrayBuffer) {\n return (prepend ? bufferConcats(padding, bytes) : bufferConcats(bytes, padding)).buffer as T;\n } else if(bytes instanceof Uint8Array) {\n return (prepend ? bufferConcats(padding, bytes) : bufferConcats(bytes, padding)) as T;\n } else {\n // @ts-ignore\n return (prepend ? [...padding].concat(bytes) : bytes.concat([...padding])) as T;\n }\n }\n\n return bytes;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {TLDeserialization, TLSerialization} from './tl_utils';\nimport CryptoWorker from '../crypto/cryptoMessagePort';\nimport sessionStorage from '../sessionStorage';\nimport Schema from './schema';\nimport {NetworkerFactory} from './networkerFactory';\nimport {logger, LogTypes} from '../logger';\nimport {InvokeApiOptions} from '../../types';\nimport longToBytes from '../../helpers/long/longToBytes';\nimport MTTransport from './transports/transport';\nimport {nextRandomUint, randomLong} from '../../helpers/random';\nimport App from '../../config/app';\nimport DEBUG from '../../config/debug';\nimport Modes from '../../config/modes';\nimport noop from '../../helpers/noop';\n\n \nimport HTTP from './transports/http';\n \n\nimport type TcpObfuscated from './transports/tcpObfuscated';\nimport bigInt from 'big-integer';\nimport {ConnectionStatus} from './connectionStatus';\nimport ctx from '../../environment/ctx';\nimport bufferConcats from '../../helpers/bytes/bufferConcats';\nimport bytesCmp from '../../helpers/bytes/bytesCmp';\nimport bytesToHex from '../../helpers/bytes/bytesToHex';\nimport convertToUint8Array from '../../helpers/bytes/convertToUint8Array';\nimport isObject from '../../helpers/object/isObject';\nimport forEachReverse from '../../helpers/array/forEachReverse';\nimport sortLongsArray from '../../helpers/long/sortLongsArray';\nimport randomize from '../../helpers/array/randomize';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport pause from '../../helpers/schedulers/pause';\nimport {getEnvironment} from '../../environment/utils';\nimport {TimeManager} from './timeManager';\n\n// console.error('networker included!', new Error().stack);\n\nexport type MTMessageOptions = InvokeApiOptions & Partial<{\n noResponse: true, // http_wait\n longPoll: true,\n\n notContentRelated: true, // ACK\n noSchedule: true,\n // withResult: true,\n messageId: MTLong,\n}>;\n\nexport type MTMessage = InvokeApiOptions & MTMessageOptions & {\n msg_id: MTLong,\n seq_no: number,\n body?: Uint8Array | number[],\n isAPI?: boolean,\n // only these four are important\n\n acked?: boolean,\n\n deferred?: CancellablePromise,\n\n container?: boolean,\n inner?: MTLong[],\n\n // below - options\n\n notContentRelated?: true,\n noSchedule?: true,\n\n resultType?: string,\n\n longPoll?: true,\n noResponse?: true, // only with http (http_wait for longPoll)\n};\n\nconst DRAIN_TIMEOUT = 10000;\nconst delays: {\n [k in 'client' | 'file']: {\n disconnectDelayMin: number,\n disconnectDelayMax: number,\n pingInterval: number,\n pingMaxTime: number,\n connectionTimeout: number\n }\n} = {\n client: {\n disconnectDelayMin: 7,\n disconnectDelayMax: 20,\n pingInterval: 2000,\n pingMaxTime: 5,\n connectionTimeout: 5000\n },\n file: {\n disconnectDelayMin: 10,\n disconnectDelayMax: 24,\n pingInterval: 3000,\n pingMaxTime: 7,\n connectionTimeout: 7500\n }\n};\nconst RESEND_OPTIONS: MTMessageOptions = {\n noSchedule: true,\n notContentRelated: true\n};\nlet invokeAfterMsgConstructor: number;\nlet networkerTempId = 0;\n\nexport default class MTPNetworker {\n private authKeyUint8: Uint8Array;\n\n public isFileNetworker: boolean;\n private isFileUpload: boolean;\n private isFileDownload: boolean;\n\n private lastServerMessages: Array = [];\n\n private sentMessages: {\n [msgId: MTLong]: MTMessage\n } = {};\n\n private pendingMessages: {[msgId: MTLong]: number} = {};\n private pendingAcks: Array = [];\n private pendingResendReq: MTLong[] = [];\n // private pendingResendAnsReq: MTLong[] = [];\n public connectionInited: boolean;\n\n private nextReqTimeout: number;\n private nextReq: number = 0;\n\n \n private longPollInterval: number;\n private longPollPending: number;\n private checkConnectionRetryAt: number;\n private checkConnectionTimeout: number;\n private checkConnectionPeriod = 0;\n private sleepAfter: number;\n private offline = false;\n private sendingLongPoll: boolean;\n \n\n private seqNo: number;\n private prevSessionId: Uint8Array;\n private sessionId: Uint8Array;\n private serverSalt: Uint8Array;\n\n private lastResendReq: {\n reqMsgId: MTLong,\n msgIds: MTPNetworker['pendingResendReq']\n };\n // private lastResendAnsReq: MTPNetworker['lastResendReq'];\n\n private name: string;\n private log: ReturnType;\n\n public isOnline = false;\n private status: ConnectionStatus = ConnectionStatus.Closed;\n private lastResponseTime = 0;\n\n private debug = DEBUG /* && false */ || Modes.debug;\n\n public activeRequests = 0;\n\n public onDrain: () => void;\n private onDrainTimeout: number;\n\n public transport: MTTransport;\n\n \n private pingDelayDisconnectDeferred: CancellablePromise;\n private pingPromise: Promise;\n // private pingInterval: number;\n private lastPingTime: number;\n private lastPingStartTime: number;\n private lastPingDelayDisconnectId: string;\n \n // public onConnectionStatusChange: (online: boolean) => void;\n\n // private debugRequests: Array<{before: Uint8Array, after: Uint8Array}> = [];\n\n private delays: typeof delays[keyof typeof delays];\n // private getNewTimeOffset: boolean;\n\n constructor(\n private networkerFactory: NetworkerFactory,\n private timeManager: TimeManager,\n public dcId: number,\n private authKey: Uint8Array,\n private authKeyId: Uint8Array,\n serverSalt: Uint8Array,\n options: InvokeApiOptions = {}\n ) {\n this.authKeyUint8 = convertToUint8Array(this.authKey);\n this.serverSalt = convertToUint8Array(serverSalt);\n\n this.isFileUpload = !!options.fileUpload;\n this.isFileDownload = !!options.fileDownload;\n this.isFileNetworker = this.isFileUpload || this.isFileDownload;\n this.delays = this.isFileNetworker ? delays.file : delays.client;\n\n const suffix = this.isFileUpload ? '-U' : this.isFileDownload ? '-D' : '';\n this.name = 'NET-' + dcId + suffix;\n // this.log = logger(this.name, this.upload && this.dcId === 2 ? LogLevels.debug | LogLevels.warn | LogLevels.log | LogLevels.error : LogLevels.error);\n this.log = logger(this.name + (suffix ? '' : '-C') + '-' + networkerTempId++, LogTypes.Log/* | LogTypes.Debug */ | LogTypes.Error | LogTypes.Warn);\n this.log('constructor'/* , this.authKey, this.authKeyID, this.serverSalt */);\n\n // Test resend after bad_server_salt\n /* if(this.dcId === 2 && this.upload) {\n //timeManager.applyServerTime((Date.now() / 1000 - 86400) | 0);\n this.serverSalt[0] = 0;\n } */\n\n this.updateSession();\n\n // if(!NetworkerFactory.offlineInited) {\n // NetworkerFactory.offlineInited = true;\n // /* rootScope.offline = true\n // rootScope.offlineConnecting = true */\n // }\n }\n\n private updateSession() {\n this.seqNo = 0;\n this.prevSessionId = this.sessionId;\n this.sessionId = randomize(new Uint8Array(8));\n }\n\n /* private clearContainers() {\n for(const messageId in this.sentMessages) {\n const message = this.sentMessages[messageId];\n if(message.container) {\n delete this.sentMessages[messageId];\n }\n }\n } */\n\n private updateSentMessage(sentMessageId: string) {\n const sentMessage = this.sentMessages[sentMessageId];\n if(!sentMessage) {\n return false;\n }\n\n if(sentMessage.container) {\n forEachReverse(sentMessage.inner, (innerSentMessageId, idx) => {\n const innerSentMessage = this.updateSentMessage(innerSentMessageId);\n if(!innerSentMessage) {\n sentMessage.inner.splice(idx, 1);\n } else {\n sentMessage.inner[idx] = innerSentMessage.msg_id;\n }\n });\n }\n\n sentMessage.msg_id = this.timeManager.generateId();\n sentMessage.seq_no = this.generateSeqNo(sentMessage.notContentRelated || sentMessage.container);\n\n if(this.debug) {\n this.log(`updateSentMessage, old=${sentMessageId}, new=${sentMessage.msg_id}`);\n }\n\n this.sentMessages[sentMessage.msg_id] = sentMessage;\n delete this.sentMessages[sentMessageId];\n\n return sentMessage;\n }\n\n private generateSeqNo(notContentRelated?: boolean) {\n let seqNo = this.seqNo * 2;\n\n if(!notContentRelated) {\n seqNo++;\n this.seqNo++;\n }\n\n return seqNo;\n }\n\n public wrapMtpCall(method: string, params: any, options: MTMessageOptions) {\n const serializer = new TLSerialization({mtproto: true});\n\n serializer.storeMethod(method, params);\n\n const messageId = this.timeManager.generateId();\n const seqNo = this.generateSeqNo();\n const message = {\n msg_id: messageId,\n seq_no: seqNo,\n body: serializer.getBytes(true)\n };\n\n if(Modes.debug) {\n this.log('MT call', method, params, messageId, seqNo);\n }\n\n return this.pushMessage(message, options);\n }\n\n public wrapMtpMessage(object: any, options: MTMessageOptions) {\n const serializer = new TLSerialization({mtproto: true});\n serializer.storeObject(object, 'Object');\n\n const messageId = this.timeManager.generateId();\n const seqNo = this.generateSeqNo(options.notContentRelated);\n const message = {\n msg_id: messageId,\n seq_no: seqNo,\n body: serializer.getBytes(true)\n };\n\n if(Modes.debug) {\n this.log('MT message', object, messageId, seqNo);\n }\n\n return this.pushMessage(message, options);\n }\n\n public wrapApiCall(method: string, params: any = {}, options: InvokeApiOptions = {}) {\n const serializer = new TLSerialization(options);\n\n if(!this.connectionInited) { // this will call once for each new session\n // /////this.log('Wrap api call !this.connectionInited');\n\n const invokeWithLayer = Schema.API.methods.find((m) => m.method === 'invokeWithLayer');\n if(!invokeWithLayer) throw new Error('no invokeWithLayer!');\n serializer.storeInt(+invokeWithLayer.id, 'invokeWithLayer');\n\n // @ts-ignore\n serializer.storeInt(Schema.layer, 'layer');\n\n const initConnection = Schema.API.methods.find((m) => m.method === 'initConnection');\n if(!initConnection) throw new Error('no initConnection!');\n\n serializer.storeInt(+initConnection.id, 'initConnection');\n serializer.storeInt(0x0, 'flags');\n serializer.storeInt(App.id, 'api_id');\n serializer.storeString(getEnvironment().USER_AGENT || 'Unknown UserAgent', 'device_model');\n serializer.storeString(navigator.platform || 'Unknown Platform', 'system_version');\n serializer.storeString(App.version + (App.isMainDomain ? ' ' + App.suffix : ''), 'app_version');\n serializer.storeString(navigator.language || 'en', 'system_lang_code');\n serializer.storeString(App.langPack, 'lang_pack');\n serializer.storeString(this.networkerFactory.language, 'lang_code');\n // serializer.storeInt(0x0, 'proxy');\n /* serializer.storeMethod('initConnection', {\n 'flags': 0,\n 'api_id': App.id,\n 'device_model': navigator.userAgent || 'Unknown UserAgent',\n 'system_version': navigator.platform || 'Unknown Platform',\n 'app_version': App.version,\n 'system_lang_code': navigator.language || 'en',\n 'lang_pack': '',\n 'lang_code': navigator.language || 'en'\n }); */\n }\n\n if(options.afterMessageId) {\n if(invokeAfterMsgConstructor === undefined) {\n const m = Schema.API.methods.find((m) => m.method === 'invokeAfterMsg');\n invokeAfterMsgConstructor = m ? +m.id : 0;\n }\n\n if(invokeAfterMsgConstructor) {\n // if(this.debug) {\n // this.log('invokeApi: store invokeAfterMsg');\n // }\n\n serializer.storeInt(invokeAfterMsgConstructor, 'invokeAfterMsg');\n serializer.storeLong(options.afterMessageId, 'msg_id');\n } else {\n this.log.error('no invokeAfterMsg!');\n }\n }\n\n options.resultType = serializer.storeMethod(method, params);\n\n /* if(method === 'account.updateNotifySettings') {\n this.log('api call body:', serializer.getBytes(true));\n } */\n\n const messageId = this.timeManager.generateId();\n const seqNo = this.generateSeqNo();\n const message = {\n msg_id: messageId,\n seq_no: seqNo,\n body: serializer.getBytes(true),\n isAPI: true\n };\n\n if(Modes.debug/* || true */) {\n this.log('Api call', method, message, params, options);\n } else if(this.debug) {\n this.log('Api call', method, params, options);\n }\n\n return this.pushMessage(message, options);\n }\n\n public changeTransport(transport?: MTTransport) {\n const oldTransport = this.transport;\n if(oldTransport) {\n oldTransport.destroy();\n\n if(this.nextReqTimeout) {\n clearTimeout(this.nextReqTimeout);\n this.nextReqTimeout = 0;\n this.nextReq = 0;\n }\n\n this.connectionInited = false;\n\n \n if(this.longPollInterval !== undefined) {\n clearInterval(this.longPollInterval);\n this.longPollInterval = undefined;\n }\n\n this.clearCheckConnectionTimeout();\n \n }\n\n this.log('change transport', transport, oldTransport);\n\n \n this.clearPingDelayDisconnect();\n\n // if(this.pingInterval !== undefined) {\n // clearInterval(this.pingInterval);\n // this.pingInterval = undefined;\n // }\n\n // this.clearPing();\n \n\n this.transport = transport;\n if(!transport) {\n return;\n }\n\n transport.networker = this;\n\n \n \n if(transport instanceof HTTP) {\n \n this.longPollInterval = ctx.setInterval(this.checkLongPoll, 10000);\n this.checkLongPoll();\n this.checkConnection('changed transport');\n \n }\n \n \n\n \n // * handle outcoming dead socket, server will close the connection\n if((transport as TcpObfuscated).connection) {\n // this.sendPingDelayDisconnect();\n\n if(transport.connected) {\n this.setConnectionStatus(ConnectionStatus.Connected);\n }\n\n // this.pingInterval = ctx.setInterval(this.sendPing, PING_INTERVAL);\n // this.sendPing();\n }\n \n\n this.resend();\n }\n\n public destroy() {\n this.log('destroy');\n }\n\n public forceReconnectTimeout() {\n if((this.transport as TcpObfuscated).reconnect) {\n (this.transport as TcpObfuscated).reconnect();\n } else {\n this.resend();\n }\n }\n\n public forceReconnect() {\n if((this.transport as TcpObfuscated).forceReconnect) {\n (this.transport as TcpObfuscated).forceReconnect();\n } else {\n this.checkConnection('force reconnect');\n }\n }\n\n /* private clearPing() {\n if(this.pingPromise) {\n this.pingPromise = undefined;\n }\n\n this.lastPingTime = undefined;\n }\n\n private sendPing = () => {\n // return;\n\n // if(!(this.transport as TcpObfuscated).connected) {\n // this.clearPing();\n // return;\n // }\n\n if(this.pingPromise) {\n return;\n }\n\n const startTime = Date.now();\n this.log('sendPing: ping', startTime);\n const promise = this.pingPromise = this.wrapMtpCall('ping', {\n ping_id: randomLong()\n }, {\n notContentRelated: true\n }).then(() => {\n const elapsedTime = Date.now() - startTime;\n this.lastPingTime = elapsedTime / 1000;\n this.log('sendPing: pong', elapsedTime);\n\n setTimeout(() => {\n if(this.pingPromise !== promise) {\n return;\n }\n\n this.pingPromise = undefined;\n this.sendPing();\n }, Math.max(0, PING_INTERVAL - elapsedTime));\n });\n }; */\n\n private clearPingDelayDisconnect() {\n const deferred = this.pingDelayDisconnectDeferred;\n this.pingDelayDisconnectDeferred = undefined;\n this.lastPingDelayDisconnectId = undefined;\n\n if(deferred) {\n deferred.reject();\n }\n }\n\n private sendPingDelayDisconnect = () => {\n // return;\n\n if(this.pingDelayDisconnectDeferred || !this.transport || !this.transport.connected) return;\n\n /* if(!this.isOnline) {\n if((this.transport as TcpObfuscated).connected) {\n (this.transport as TcpObfuscated).connection.close();\n }\n\n return;\n } */\n\n const deferred = this.pingDelayDisconnectDeferred = deferredPromise();\n const delays = this.delays;\n const pingMaxTime = this.delays.pingMaxTime;\n const lastPingTime = Math.min(this.lastPingTime ?? 0, pingMaxTime);\n const disconnectDelay = Math.round(delays.disconnectDelayMin + lastPingTime / pingMaxTime * (delays.disconnectDelayMax - delays.disconnectDelayMin));\n const timeoutTime = disconnectDelay * 1000;\n const startTime = this.lastPingStartTime = Date.now();\n const pingId = this.lastPingDelayDisconnectId = randomLong();\n const options: MTMessageOptions = {notContentRelated: true};\n this.wrapMtpCall('ping_delay_disconnect', {\n ping_id: pingId,\n disconnect_delay: disconnectDelay\n }, options);\n\n const log = this.log.bindPrefix('sendPingDelayDisconnect');\n this.debug && log.debug(`ping, timeout=${timeoutTime}, lastPingTime=${this.lastPingTime}, msgId=${options.messageId}, pingId=${pingId}`);\n const rejectTimeout = ctx.setTimeout(deferred.reject, timeoutTime);\n\n const onResolved = (reason: string) => {\n clearTimeout(rejectTimeout);\n const elapsedTime = Date.now() - startTime;\n this.lastPingTime = elapsedTime / 1000;\n this.debug && log.debug(`pong, reason='${reason}', time=${lastPingTime}, msgId=${options.messageId}`);\n if(elapsedTime > timeoutTime) {\n throw undefined;\n } else {\n return pause(Math.max(0, this.delays.pingInterval - elapsedTime/* timeoutTime - elapsedTime - PING_INTERVAL */));\n }\n };\n\n const onTimeout = () => {\n clearTimeout(rejectTimeout);\n const transport = this.transport as TcpObfuscated;\n if(this.pingDelayDisconnectDeferred !== deferred || !transport?.connection) {\n return;\n }\n\n log.error('catch, closing connection', this.lastPingTime, options.messageId);\n transport.connection.close();\n };\n\n const onFinally = () => {\n if(this.pingDelayDisconnectDeferred !== deferred) {\n return;\n }\n\n this.pingDelayDisconnectDeferred = undefined;\n this.sendPingDelayDisconnect();\n };\n\n deferred\n .then(onResolved)\n .catch(onTimeout)\n .finally(onFinally);\n };\n\n \n private checkLongPoll = () => {\n const isClean = this.cleanupSent();\n // this.log.error('Check lp', this.longPollPending, this.dcId, isClean, this);\n if((this.longPollPending && Date.now() < this.longPollPending) ||\n this.offline ||\n this.isStopped() ||\n this.isFileNetworker) {\n // this.log('No lp this time');\n return false;\n }\n\n sessionStorage.get('dc').then((baseDcId) => {\n if(isClean && (\n baseDcId !== this.dcId ||\n (this.sleepAfter && Date.now() > this.sleepAfter)\n )) {\n // console.warn(dT(), 'Send long-poll for DC is delayed', this.dcId, this.sleepAfter);\n return;\n }\n\n this.sendLongPoll();\n });\n };\n\n private sendLongPoll() {\n if(this.sendingLongPoll) return;\n this.sendingLongPoll = true;\n const maxWait = 25000;\n\n this.longPollPending = Date.now() + maxWait;\n this.debug && this.log.debug('sendLongPoll', this.longPollPending);\n\n this.wrapMtpCall('http_wait', {\n max_delay: 500,\n wait_after: 150,\n max_wait: maxWait\n }, {\n noResponse: true,\n // notContentRelated: true,\n longPoll: true\n }).then(() => {\n this.longPollPending = undefined;\n setTimeout(this.checkLongPoll, 0);\n }, (error: ErrorEvent) => {\n this.log('Long-poll failed', error);\n }).finally(() => {\n this.sendingLongPoll = undefined;\n });\n }\n\n private checkConnection = (event: Event | string) => {\n this.debug && this.log('Check connection', event);\n this.clearCheckConnectionTimeout();\n\n if(!this.transport) {\n this.log.warn('No transport for checkConnection');\n return;\n }\n\n const serializer = new TLSerialization({mtproto: true});\n const pingId = randomLong();\n\n serializer.storeMethod('ping', {\n ping_id: pingId\n });\n\n const pingMessage = {\n msg_id: this.timeManager.generateId(),\n seq_no: this.generateSeqNo(true),\n body: serializer.getBytes(true)\n };\n\n if(this.offline) {\n this.setConnectionStatus(ConnectionStatus.Connecting);\n }\n\n this.sendEncryptedRequest(pingMessage).then(() => {\n this.toggleOffline(false);\n }, () => {\n this.debug && this.log('Delay', this.checkConnectionPeriod * 1000);\n this.checkConnectionTimeout = ctx.setTimeout(() => this.checkConnection('from failed checkConnection request'), this.checkConnectionPeriod * 1000 | 0);\n this.checkConnectionPeriod = Math.min(60, this.checkConnectionPeriod * 1.5);\n });\n };\n\n private clearCheckConnectionTimeout() {\n if(this.checkConnectionTimeout !== undefined) {\n clearTimeout(this.checkConnectionTimeout);\n this.checkConnectionTimeout = undefined;\n }\n }\n\n private toggleOffline(offline: boolean) {\n if(this.offline !== offline) {\n this.offline = offline;\n\n this.clearCheckConnectionTimeout();\n if(offline) {\n clearTimeout(this.nextReqTimeout);\n this.nextReqTimeout = 0;\n this.nextReq = 0;\n\n if(this.checkConnectionPeriod < 1.5) {\n this.checkConnectionPeriod = 0;\n }\n\n const delay = this.checkConnectionPeriod * 1000 | 0;\n this.checkConnectionRetryAt = Date.now() + delay;\n this.setConnectionStatus(ConnectionStatus.Closed, this.checkConnectionRetryAt);\n this.checkConnectionTimeout = ctx.setTimeout(() => this.checkConnection('from toggleOfline'), delay);\n this.checkConnectionPeriod = Math.min(30, (1 + this.checkConnectionPeriod) * 1.5);\n\n \n \n \n \n } else {\n this.setConnectionStatus(ConnectionStatus.Connected);\n this.checkLongPoll();\n\n this.scheduleRequest();\n\n \n \n \n \n }\n }\n\n this.setConnectionStatus(offline ? ConnectionStatus.Closed : ConnectionStatus.Connected, offline ? this.checkConnectionRetryAt : undefined);\n }\n\n private handleSentEncryptedRequestHTTP(promise: ReturnType, message: MTMessage, noResponseMsgs: string[]) {\n // let timeout = setTimeout(() => {\n // this.log.error('handleSentEncryptedRequestHTTP timeout', promise, message, noResponseMsgs);\n // }, 5e3);\n\n promise.then((result) => {\n this.toggleOffline(false);\n // this.log('parse for', message);\n return this.parseResponse(result).then((response) => {\n this.debug && this.log.debug('Server response', response);\n\n this.processMessage(response.response, response.messageId, response.sessionId);\n\n this.checkLongPoll();\n this.checkConnectionPeriod = Math.max(1.1, Math.sqrt(this.checkConnectionPeriod));\n\n return true;\n });\n }, (error) => {\n this.log.error('Encrypted request failed', error, message);\n\n this.pushResend(message.msg_id);\n this.toggleOffline(true);\n\n return false;\n }).then((shouldResolve) => {\n // clearTimeout(timeout);\n const sentMessages = this.sentMessages;\n noResponseMsgs.forEach((msgId) => {\n const sentMessage = sentMessages[msgId];\n if(sentMessage) {\n const deferred = sentMessage.deferred;\n delete sentMessages[msgId];\n delete this.pendingMessages[msgId];\n shouldResolve ? deferred.resolve() : deferred.reject();\n }\n });\n });\n }\n \n\n // тут можно сделать таймаут и выводить дисконнект\n private pushMessage(message: {\n msg_id: string,\n seq_no: number,\n body: Uint8Array | number[],\n isAPI?: boolean\n }, options: MTMessageOptions) {\n let promise: CancellablePromise;\n if(!options.notContentRelated || options.noResponse) {\n promise = deferredPromise();\n }\n\n this.sentMessages[message.msg_id] = Object.assign(\n message,\n options,\n promise ? {deferred: promise} : undefined\n );\n\n // this.log.error('Networker pushMessage:', this.sentMessages[message.msg_id]);\n\n this.pendingMessages[message.msg_id] = 0;\n\n if(!options.noSchedule) {\n this.scheduleRequest();\n }\n\n if(isObject(options)) {\n options.messageId = message.msg_id;\n }\n\n return promise;\n }\n\n public attachPromise(promise: Promise, message: MTMessage) {\n const canIncrement = true;\n const timeout = setTimeout(() => {\n if(this.lastResponseTime && (Date.now() - this.lastResponseTime) < this.delays.connectionTimeout) {\n return;\n }\n\n this.log.error('timeout', message);\n if(this.isOnline) {\n this.setConnectionStatus(ConnectionStatus.TimedOut);\n }\n\n /* this.getEncryptedOutput(message).then((bytes) => {\n this.log.error('timeout encrypted', bytes);\n }); */\n }, this.delays.connectionTimeout);\n\n promise.catch(noop).finally(() => {\n clearTimeout(timeout);\n this.setConnectionStatus(ConnectionStatus.Connected);\n\n if(canIncrement) {\n --this.activeRequests;\n this.setDrainTimeout();\n }\n });\n\n if(canIncrement) {\n ++this.activeRequests;\n if(this.onDrainTimeout !== undefined) {\n clearTimeout(this.onDrainTimeout);\n this.onDrainTimeout = undefined;\n }\n }\n }\n\n public setDrainTimeout() {\n if(!this.activeRequests && this.onDrain && this.onDrainTimeout === undefined) {\n this.onDrainTimeout = ctx.setTimeout(() => {\n this.onDrainTimeout = undefined;\n this.log('drain');\n this.onDrain();\n }, DRAIN_TIMEOUT);\n }\n }\n\n public setConnectionStatus(status: ConnectionStatus, retryAt?: number) {\n const isOnline = status === ConnectionStatus.Connected;\n const willChange = this.status !== status;\n this.isOnline = isOnline;\n this.status = status;\n\n if(willChange) {\n if(this.networkerFactory.onConnectionStatusChange) {\n this.networkerFactory.onConnectionStatusChange({\n _: 'networkerStatus',\n status,\n dcId: this.dcId,\n name: this.name,\n isFileNetworker: this.isFileNetworker,\n isFileDownload: this.isFileDownload,\n isFileUpload: this.isFileUpload,\n retryAt\n });\n }\n\n if(this.isOnline) {\n this.scheduleRequest();\n }\n\n if((this.transport as TcpObfuscated)?.connection) {\n this.clearPingDelayDisconnect();\n this.sendPingDelayDisconnect();\n }\n\n // this.getNewTimeOffset = true;\n }\n /* if(this.onConnectionStatusChange) {\n this.onConnectionStatusChange(this.isOnline);\n } */\n }\n\n private pushResend(messageId: string, delay = 100) {\n const value = delay ? Date.now() + delay : 0;\n const sentMessage = this.sentMessages[messageId];\n if(sentMessage.container) {\n for(const innerMsgId of sentMessage.inner) {\n this.pendingMessages[innerMsgId] = value;\n }\n } else {\n this.pendingMessages[messageId] = value;\n }\n\n if(sentMessage.acked) {\n this.log.error('pushResend: acked message?', sentMessage);\n }\n\n if(this.debug) {\n this.log.debug('pushResend:', messageId, sentMessage, this.pendingMessages, delay);\n }\n\n this.scheduleRequest(delay);\n }\n\n // * correct, fully checked\n private async getMsgKey(dataWithPadding: Uint8Array, isOut: boolean) {\n const x = isOut ? 0 : 8;\n const msgKeyLargePlain = bufferConcats(this.authKeyUint8.subarray(88 + x, 88 + x + 32), dataWithPadding);\n\n const msgKeyLarge = await CryptoWorker.invokeCrypto('sha256', msgKeyLargePlain);\n const msgKey = new Uint8Array(msgKeyLarge).subarray(8, 24);\n return msgKey;\n };\n\n // * correct, fully checked\n private getAesKeyIv(msgKey: Uint8Array, isOut: boolean): Promise<[Uint8Array, Uint8Array]> {\n const x = isOut ? 0 : 8;\n const sha2aText = new Uint8Array(52);\n const sha2bText = new Uint8Array(52);\n const promises: Array> = [];\n\n sha2aText.set(msgKey, 0);\n sha2aText.set(this.authKeyUint8.subarray(x, x + 36), 16);\n promises.push(CryptoWorker.invokeCrypto('sha256', sha2aText));\n\n sha2bText.set(this.authKeyUint8.subarray(40 + x, 40 + x + 36), 0);\n sha2bText.set(msgKey, 36);\n promises.push(CryptoWorker.invokeCrypto('sha256', sha2bText));\n\n return Promise.all(promises).then((results) => {\n const aesKey = new Uint8Array(32);\n const aesIv = new Uint8Array(32);\n const sha2a = new Uint8Array(results[0]);\n const sha2b = new Uint8Array(results[1]);\n\n aesKey.set(sha2a.subarray(0, 8));\n aesKey.set(sha2b.subarray(8, 24), 8);\n aesKey.set(sha2a.subarray(24, 32), 24);\n\n aesIv.set(sha2b.subarray(0, 8));\n aesIv.set(sha2a.subarray(8, 24), 8);\n aesIv.set(sha2b.subarray(24, 32), 24);\n\n return [aesKey, aesIv];\n });\n }\n\n public isStopped() {\n return this.networkerFactory.akStopped && !this.isFileNetworker;\n }\n\n private performScheduledRequest() {\n if(this.isStopped()) {\n return false;\n }\n\n if(this.pendingAcks.length) {\n const ackMsgIds = this.pendingAcks.slice();\n\n // this.log('acking messages', ackMsgIDs)\n this.wrapMtpMessage({\n _: 'msgs_ack',\n msg_ids: ackMsgIds\n }, {\n notContentRelated: true,\n noSchedule: true\n });\n }\n\n const pendingResendReqLength = this.pendingResendReq.length;\n if(pendingResendReqLength) {\n const options: MTMessageOptions = {...RESEND_OPTIONS};\n const msgIds = this.pendingResendReq.splice(0, pendingResendReqLength);\n this.wrapMtpMessage({\n _: 'msg_resend_req',\n msg_ids: msgIds\n }, options);\n\n this.log('resend: resending requests', options.messageId, msgIds);\n /* this.lastResendReq = {\n reqMsgId: options.messageId,\n msgIds: msgIds\n }; */\n\n // this.pendingResendReq.length = 0;\n }\n\n // if(this.pendingResendAnsReq.length) {\n // const options: MTMessageOptions = {...RESEND_OPTIONS};\n // const msgIds = this.pendingResendAnsReq.slice();\n // this.wrapMtpMessage({\n // _: 'msg_resend_ans_req',\n // msg_ids: msgIds\n // }, options);\n\n // this.log('resend: requesting answers', options.messageId, msgIds);\n // this.lastResendAnsReq = {\n // reqMsgId: options.messageId,\n // msgIds: msgIds\n // };\n\n // // this.pendingResendAnsReq.length = 0;\n // }\n\n let outMessage: MTMessage;\n const messages: typeof outMessage[] = [];\n\n // const currentTime = Date.now();\n let messagesByteLen = 0;\n\n \n let hasApiCall = false;\n let hasHttpWait = false;\n \n\n let lengthOverflow = false;\n\n // * Сюда никогда не попадут контейнеры, так как их не будет в pendingMessages\n const keys = sortLongsArray(Object.keys(this.pendingMessages));\n for(const messageId of keys) {\n // const value = this.pendingMessages[messageId];\n\n // if(!value || value <= currentTime) {\n const message = this.sentMessages[messageId];\n if(message && message.body) {\n /* if(message.fileUpload) {\n this.log('performScheduledRequest message:', message, message.body.length, (message.body as Uint8Array).byteLength, (message.body as Uint8Array).buffer.byteLength);\n } */\n\n const messageByteLength = message.body.length + 32;\n\n if((messagesByteLen + messageByteLength) > 655360) { // 640 Kb\n this.log.warn('lengthOverflow', message, messages);\n lengthOverflow = true;\n\n if(outMessage) { // if it's not a first message\n break;\n }\n }\n\n messages.push(message);\n messagesByteLen += messageByteLength;\n\n \n if(message.isAPI) {\n hasApiCall = true;\n } else if(message.longPoll) {\n hasHttpWait = true;\n }\n \n\n outMessage = message;\n } else {\n // this.log(message, messageId)\n }\n\n delete this.pendingMessages[messageId];\n // }\n }\n\n \n \n if(this.transport instanceof HTTP)\n \n if(hasApiCall && !hasHttpWait) {\n const serializer = new TLSerialization({mtproto: true});\n serializer.storeMethod('http_wait', {\n max_delay: 500,\n wait_after: 150,\n max_wait: 3000\n });\n\n messages.push({\n msg_id: this.timeManager.generateId(),\n seq_no: this.generateSeqNo(),\n body: serializer.getBytes(true)\n });\n }\n \n\n if(!messages.length) {\n // this.log('no scheduled messages')\n return;\n }\n\n \n const noResponseMsgs: Array = messages.filter((message) => message.noResponse).map((message) => message.msg_id);\n \n\n if(messages.length > 1) {\n const container = this.generateContainerMessage(messagesByteLen, messages);\n outMessage = container.messageWithBody;\n\n this.sentMessages[outMessage.msg_id] = container.message;\n } else {\n this.sentMessages[outMessage.msg_id] = outMessage;\n }\n\n this.pendingAcks = [];\n\n const promise = this.sendEncryptedRequest(outMessage);\n\n \n \n if(this.transport instanceof HTTP)\n \n this.handleSentEncryptedRequestHTTP(promise, outMessage, noResponseMsgs);\n \n\n \n \n if(!(this.transport instanceof HTTP))\n \n this.cleanupSent(); // ! WARNING\n \n\n if(lengthOverflow) {\n this.scheduleRequest();\n }\n }\n\n private generateContainerMessage(messagesByteLen: number, messages: MTMessage[]) {\n const container = new TLSerialization({\n mtproto: true,\n startMaxLength: messagesByteLen + 64\n });\n\n container.storeInt(0x73f1f8dc, 'CONTAINER[id]');\n container.storeInt(messages.length, 'CONTAINER[count]');\n\n const innerMessages: string[] = [];\n messages.forEach((message, i) => {\n innerMessages.push(message.msg_id);\n // this.log('Pushing to container:', message.msg_id);\n container.storeLong(message.msg_id, 'CONTAINER[' + i + '][msg_id]');\n container.storeInt(message.seq_no, 'CONTAINER[' + i + '][seq_no]');\n container.storeInt(message.body.length, 'CONTAINER[' + i + '][bytes]');\n container.storeRawBytes(message.body, 'CONTAINER[' + i + '][body]');\n });\n\n const message: MTMessage = {\n msg_id: this.timeManager.generateId(),\n seq_no: this.generateSeqNo(true),\n container: true,\n inner: innerMessages\n };\n\n if(Modes.debug/* || true */) {\n this.log.warn('Container', innerMessages, message.msg_id, message.seq_no);\n }\n\n return {\n message,\n messageWithBody: Object.assign({body: container.getBytes(true)}, message)\n };\n }\n\n private async getEncryptedMessage(dataWithPadding: Uint8Array) {\n const msgKey = await this.getMsgKey(dataWithPadding, true);\n const keyIv = await this.getAesKeyIv(msgKey, true);\n // this.log('after msg key iv')\n\n const encryptedBytes = await CryptoWorker.invokeCrypto('aes-encrypt', dataWithPadding, keyIv[0], keyIv[1]);\n // this.log('Finish encrypt')\n\n return {\n bytes: encryptedBytes,\n msgKey\n };\n }\n\n private getDecryptedMessage(msgKey: Uint8Array, encryptedData: Uint8Array) {\n // this.log('get decrypted start')\n return this.getAesKeyIv(msgKey, false).then((keyIv) => {\n // this.log('after msg key iv')\n return CryptoWorker.invokeCrypto('aes-decrypt', encryptedData, keyIv[0], keyIv[1]);\n });\n }\n\n private getEncryptedOutput(message: MTMessage) {\n /* if(DEBUG) {\n this.log.debug('Send encrypted', message, this.authKeyId);\n } */\n /* if(!this.isOnline) {\n this.log('trying to send message when offline:', Object.assign({}, message));\n //debugger;\n } */\n\n const data = new TLSerialization({\n startMaxLength: message.body.length + 2048\n });\n\n data.storeIntBytes(this.serverSalt, 64, 'salt');\n data.storeIntBytes(this.sessionId, 64, 'session_id');\n\n data.storeLong(message.msg_id, 'message_id');\n data.storeInt(message.seq_no, 'seq_no');\n\n data.storeInt(message.body.length, 'message_data_length');\n data.storeRawBytes(message.body, 'message_data');\n\n /* const des = new TLDeserialization(data.getBuffer().slice(16));\n const desSalt = des.fetchLong();\n const desSessionId = des.fetchLong();\n\n if(!this.isOnline) {\n this.log.error('trying to send message when offline', message, new Uint8Array(des.buffer), desSalt, desSessionId);\n } */\n\n /* const messageDataLength = message.body.length;\n let canBeLength = 0; // bytes\n canBeLength += 8;\n canBeLength += 8;\n canBeLength += 8;\n canBeLength += 4;\n canBeLength += 4;\n canBeLength += message.body.length; */\n\n const dataBuffer = data.getBuffer();\n\n /* if(dataBuffer.byteLength !== canBeLength || !bytesCmp(new Uint8Array(dataBuffer.slice(dataBuffer.byteLength - message.body.length)), new Uint8Array(message.body))) {\n this.log.error('wrong length', dataBuffer, canBeLength, message.msg_id);\n } */\n\n const paddingLength = (16 - (data.getOffset() % 16)) + 16 * (1 + nextRandomUint(8) % 5);\n const padding = /* (message as any).padding || */randomize(new Uint8Array(paddingLength))/* .fill(0) */;\n /* const padding = [167, 148, 207, 226, 86, 192, 193, 57, 124, 153, 174, 145, 159, 1, 5, 70, 127, 157,\n 51, 241, 46, 85, 141, 212, 139, 234, 213, 164, 197, 116, 245, 70, 184, 40, 40, 201, 233, 211, 150,\n 94, 57, 84, 1, 135, 108, 253, 34, 139, 222, 208, 71, 214, 90, 67, 36, 28, 167, 148, 207, 226, 86, 192, 193, 57, 124, 153, 174, 145, 159, 1, 5, 70, 127, 157,\n 51, 241, 46, 85, 141, 212, 139, 234, 213, 164, 197, 116, 245, 70, 184, 40, 40, 201, 233, 211, 150,\n 94, 57, 84, 1, 135, 108, 253, 34, 139, 222, 208, 71, 214, 90, 67, 36, 28].slice(0, paddingLength); */\n\n // (message as any).padding = padding;\n\n const dataWithPadding = bufferConcats(dataBuffer, padding);\n // this.log('Adding padding', dataBuffer, padding, dataWithPadding)\n // this.log('auth_key_id', bytesToHex(self.authKeyID))\n\n /* if(dataWithPadding.byteLength % 16) {\n this.log.error('aaa', dataWithPadding, paddingLength);\n }\n\n if(message.fileUpload) {\n this.log('Send encrypted: body length:', (message.body as ArrayBuffer).byteLength, paddingLength, dataWithPadding);\n } */\n\n // * full next block is correct\n return this.getEncryptedMessage(dataWithPadding).then((encryptedResult) => {\n /* if(DEBUG) {\n this.log('Got encrypted out message', encryptedResult);\n } */\n\n const request = new TLSerialization({\n startMaxLength: encryptedResult.bytes.length + 256\n });\n request.storeIntBytes(this.authKeyId, 64, 'auth_key_id');\n request.storeIntBytes(encryptedResult.msgKey, 128, 'msg_key');\n request.storeRawBytes(encryptedResult.bytes, 'encrypted_data');\n\n const requestData = request.getBytes(true);\n\n // if(this.isFileNetworker) {\n // //this.log('Send encrypted: requestData length:', requestData.length, requestData.length % 16, paddingLength % 16, paddingLength, data.offset, encryptedResult.msgKey.length % 16, encryptedResult.bytes.length % 16);\n // //this.log('Send encrypted: messageId:', message.msg_id, requestData.length);\n // //this.log('Send encrypted:', message, new Uint8Array(bufferConcat(des.buffer, padding)), requestData, this.serverSalt.hex, this.sessionId.hex/* new Uint8Array(des.buffer) */);\n // this.debugRequests.push({before: new Uint8Array(bufferConcat(des.buffer, padding)), after: requestData});\n // }\n\n return requestData;\n });\n }\n\n private async sendEncryptedRequest(message: MTMessage) {\n const requestData = await this.getEncryptedOutput(message);\n\n if(!this.transport) {\n this.log.error('trying to send something when offline', this.transport, this);\n }\n\n this.debug && this.log.debug('sending:', message, [message.msg_id].concat(message.inner || []), requestData.length);\n const promise: Promise = this.transport ? this.transport.send(requestData) as any : Promise.reject({});\n // this.debug && this.log.debug('sendEncryptedRequest: launched message into space:', message, promise);\n\n \n \n \n\n \n if(!(this.transport instanceof HTTP)) return promise;\n \n\n const baseError: ApiError = {\n code: 406,\n type: 'NETWORK_BAD_RESPONSE',\n // @ts-ignore\n transport: this.transport\n };\n\n return promise.then((result) => {\n if(!result?.byteLength) {\n throw baseError;\n }\n\n // this.debug && this.log.debug('sendEncryptedRequest: got response for:', message, [message.msg_id].concat(message.inner || []));\n return result;\n }, (error) => {\n if(!error.message && !error.type) {\n error = Object.assign(baseError, {\n type: 'NETWORK_BAD_REQUEST',\n originalError: error\n });\n }\n\n throw error;\n });\n \n }\n\n public parseResponse(responseBuffer: Uint8Array) {\n // const perf = performance.now();\n /* if(this.debug) {\n this.log.debug('Start parsing response', responseBuffer);\n } */\n\n this.lastResponseTime = Date.now();\n\n const deserializer = new TLDeserialization(responseBuffer);\n\n const authKeyId = deserializer.fetchIntBytes(64, true, 'auth_key_id');\n if(!bytesCmp(authKeyId, this.authKeyId)) {\n throw new Error('[MT] Invalid server auth_key_id: ' + bytesToHex(authKeyId));\n }\n\n const msgKey = deserializer.fetchIntBytes(128, true, 'msg_key');\n const encryptedData = deserializer.fetchRawBytes(responseBuffer.byteLength - deserializer.getOffset(), true, 'encrypted_data');\n\n return this.getDecryptedMessage(msgKey, encryptedData).then((dataWithPadding) => {\n // this.log('after decrypt')\n return this.getMsgKey(dataWithPadding, false).then((calcMsgKey) => {\n if(!bytesCmp(msgKey, calcMsgKey)) {\n this.log.warn('[MT] msg_keys', msgKey, calcMsgKey);\n this.updateSession(); // fix 28.01.2020\n throw new Error('[MT] server msgKey mismatch, updating session');\n }\n // this.log('after msgKey check')\n\n let deserializer = new TLDeserialization(dataWithPadding, {mtproto: true});\n\n /* const salt = */deserializer.fetchIntBytes(64, true, 'salt'); // need\n const sessionId = deserializer.fetchIntBytes(64, true, 'session_id');\n const messageId = deserializer.fetchLong('message_id');\n\n if(!bytesCmp(sessionId, this.sessionId) &&\n (!this.prevSessionId || !bytesCmp(sessionId, this.prevSessionId))) {\n this.log.warn('Sessions', sessionId, this.sessionId, this.prevSessionId, dataWithPadding);\n // this.updateSession();\n // this.sessionID = sessionID;\n throw new Error('[MT] Invalid server session_id: ' + bytesToHex(sessionId));\n }\n\n const seqNo = deserializer.fetchInt('seq_no');\n\n const totalLength = dataWithPadding.byteLength;\n\n const messageBodyLength = deserializer.fetchInt('message_data[length]');\n let offset = deserializer.getOffset();\n\n if((messageBodyLength % 4) ||\n messageBodyLength > totalLength - offset) {\n throw new Error('[MT] Invalid body length: ' + messageBodyLength);\n }\n const messageBody = deserializer.fetchRawBytes(messageBodyLength, true, 'message_data');\n\n offset = deserializer.getOffset();\n const paddingLength = totalLength - offset;\n if(paddingLength < 12 || paddingLength > 1024) {\n throw new Error('[MT] Invalid padding length: ' + paddingLength);\n }\n\n // let buffer = bytesToArrayBuffer(messageBody);\n deserializer = new TLDeserialization(/* buffer */messageBody, {\n mtproto: true,\n override: {\n mt_message: (result: any, field: string) => {\n result.msg_id = deserializer.fetchLong(field + '[msg_id]');\n result.seqno = deserializer.fetchInt(field + '[seqno]');\n result.bytes = deserializer.fetchInt(field + '[bytes]');\n\n const offset = deserializer.getOffset();\n\n // self.log('mt_message!!!!!', result, field);\n\n try {\n result.body = deserializer.fetchObject('Object', field + '[body]');\n } catch(e) {\n this.log.error('parse error', (e as Error).message, (e as Error).stack);\n result.body = {\n _: 'parse_error',\n error: e\n };\n }\n\n if(deserializer.getOffset() !== offset + result.bytes) {\n // console.warn(dT(), 'set offset', this.offset, offset, result.bytes)\n // this.log(result)\n deserializer.setOffset(offset + result.bytes);\n }\n // this.log('override message', result)\n },\n mt_rpc_result: (result: any, field: any) => {\n result.req_msg_id = deserializer.fetchLong(field + '[req_msg_id]');\n\n const sentMessage = this.sentMessages[result.req_msg_id];\n const type = sentMessage && sentMessage.resultType || 'Object';\n\n if(result.req_msg_id && !sentMessage) {\n // console.warn(dT(), 'Result for unknown message', result);\n return;\n }\n\n // deserializer.setMtproto(false);\n result.result = deserializer.fetchObject(type, field + '[result]');\n // deserializer.setMtproto(true);\n // self.log(dT(), 'override rpc_result', sentMessage, type, result);\n }\n }\n });\n\n const response = deserializer.fetchObject('', 'INPUT');\n // this.log.error('Parse response time:', performance.now() - perf);\n return {\n response,\n messageId,\n sessionId,\n seqNo\n };\n });\n });\n }\n\n private applyServerSalt(newServerSalt: string) {\n const serverSalt = longToBytes(newServerSalt);\n\n sessionStorage.set({\n ['dc' + this.dcId + '_server_salt']: bytesToHex(serverSalt)\n });\n\n this.serverSalt = new Uint8Array(serverSalt);\n }\n\n // ! таймаут очень сильно тормозит скорость работы сокета (даже нулевой)\n public scheduleRequest(delay?: number) {\n /* if(!this.isOnline) {\n return;\n } */\n\n \n \n if(this.transport instanceof HTTP) {\n \n if(this.offline) {\n this.checkConnection('forced schedule');\n }\n\n delay ||= 0; // set zero timeout to pack other messages too\n \n }\n \n \n\n const nextReq = Date.now() + (delay || 0);\n if(this.nextReq && (delay === undefined || this.nextReq <= nextReq)) {\n // this.debug && this.log('scheduleRequest: nextReq', this.nextReq, nextReq);\n return;\n }\n\n // this.debug && this.log('scheduleRequest: delay', delay);\n\n /* if(this.nextReqTimeout) {\n return;\n } */\n\n // const perf = performance.now();\n if(this.nextReqTimeout) {\n clearTimeout(this.nextReqTimeout);\n }\n\n const cb = () => {\n // this.debug && this.log('scheduleRequest: timeout delay was:', performance.now() - perf);\n\n this.nextReqTimeout = 0;\n this.nextReq = 0;\n\n \n \n if(this.transport instanceof HTTP)\n \n if(this.offline) {\n // this.log('Cancel scheduled');\n return;\n }\n \n\n this.performScheduledRequest();\n };\n\n this.nextReq = nextReq;\n\n if(delay !== undefined) {\n this.nextReqTimeout = ctx.setTimeout(cb, delay);\n } else {\n cb();\n }\n }\n\n private ackMessage(msgId: MTLong) {\n // this.log('ack message', msgID)\n this.pendingAcks.push(msgId);\n\n let delay: number;\n\n \n \n if(this.transport instanceof HTTP)\n \n delay = 30000;\n \n\n this.scheduleRequest(delay);\n }\n\n private reqResend(msgId: MTLong/* , isAnswer?: boolean */) {\n if(this.debug) {\n this.log.debug('Req resend', msgId/* , isAnswer */);\n }\n\n // (isAnswer ? this.pendingResendAnsReq : this.pendingResendReq).push(msgId);\n this.pendingResendReq.push(msgId);\n this.scheduleRequest(100);\n }\n\n public cleanupSent() {\n let notEmpty = false;\n const sentMessages = this.sentMessages;\n // this.log('clean start', this.dcId/*, sentMessages*/)\n Object.keys(sentMessages).forEach((msgId) => {\n const message = sentMessages[msgId];\n\n // this.log('clean iter', msgID, message)\n if(message.notContentRelated && this.pendingMessages[msgId] === undefined) {\n // this.log('clean notContentRelated', msgID)\n delete sentMessages[msgId];\n } else if(message.container) {\n for(const innerMsgId of message.inner) {\n if(sentMessages[innerMsgId] !== undefined) {\n // this.log('clean failed, found', msgID, message.inner[i], sentMessages[message.inner[i]].seq_no)\n notEmpty = true;\n return;\n }\n }\n // this.log('clean container', msgID)\n delete sentMessages[msgId];\n } else {\n notEmpty = true;\n }\n });\n\n return !notEmpty;\n }\n\n private processMessageAck(messageId: Long) {\n const sentMessage = this.sentMessages[messageId];\n if(sentMessage && !sentMessage.acked) {\n // delete sentMessage.body;\n sentMessage.acked = true;\n }\n }\n\n private processError(rawError: {error_message: string, error_code: number}): ApiError {\n const matches = (rawError.error_message || '').match(/^([A-Z_0-9]+\\b)(: (.+))?/) || [];\n rawError.error_code = rawError.error_code;\n\n return {\n code: !rawError.error_code || rawError.error_code <= 0 ? 500 : rawError.error_code,\n type: matches[1] as any || 'UNKNOWN',\n description: matches[3] || ('CODE#' + rawError.error_code + ' ' + rawError.error_message),\n originalError: rawError\n };\n }\n\n /**\n * * только для сокета\n * TODO: consider about containers resend\n */\n public resend() {\n const sentMessages = this.sentMessages;\n for(const id in sentMessages) {\n const msg = sentMessages[id];\n if(msg.body || msg.container) {\n this.pushResend(id);\n }\n }\n\n if((this.transport as TcpObfuscated).connection) {\n this.clearPingDelayDisconnect();\n this.sendPingDelayDisconnect();\n }\n }\n\n /* public requestMessageStatus() {\n const ids: string[] = [];\n for(const id in this.sentMessages) {\n const message = this.sentMessages[id];\n if(message.isAPI && message.fileUpload) {\n ids.push(message.msg_id);\n }\n }\n\n this.wrapMtpMessage({\n _: 'msgs_state_req',\n msg_ids: ids\n }, {\n notContentRelated: true\n }).then((res) => {\n this.log('status', res);\n });\n } */\n\n private applyServerTime(messageId: string) {\n const serverTime = bigInt(messageId).shiftRight(32).toJSNumber();\n this.log('applying server time', serverTime);\n return this.timeManager.applyServerTime(serverTime);\n }\n\n // * https://core.telegram.org/mtproto/service_messages_about_messages#notice-of-ignored-error-message\n public processMessage(message: any, messageId: MTLong, sessionId: Uint8Array | number[]) {\n if(message._ === 'messageEmpty') {\n this.log.warn('processMessage: messageEmpty', message, messageId);\n return;\n }\n\n // messageId = messageId.toString();\n\n const msgidInt = parseInt(messageId.substr(0, -10), 10);\n if(msgidInt % 2) {\n this.log.warn('Server even message id: ', messageId, message);\n return;\n }\n\n if(this.debug) {\n this.log.debug('process message', message, messageId);\n }\n\n if(this.pingDelayDisconnectDeferred) {\n this.pingDelayDisconnectDeferred.resolve('any message');\n }\n\n // let changedTimeOffset: boolean;\n // if(this.getNewTimeOffset) {\n // changedTimeOffset = this.applyServerTime(messageId);\n // this.getNewTimeOffset = undefined;\n // }\n\n switch(message._) {\n case 'msg_container': {\n for(const innerMessage of message.messages) {\n this.processMessage(innerMessage, innerMessage.msg_id, sessionId);\n }\n\n break;\n }\n\n case 'bad_server_salt': {\n this.log('Bad server salt', message);\n\n this.applyServerSalt(message.new_server_salt);\n\n if(this.sentMessages[message.bad_msg_id]) {\n this.pushResend(message.bad_msg_id);\n }\n\n this.ackMessage(messageId);\n\n // simulate disconnect\n /* try {\n this.log('networker state:', this);\n // @ts-ignore\n this.transport.ws.close(1000);\n } catch(err) {\n this.log.error('transport', this.transport, err);\n } */\n\n break;\n }\n\n case 'bad_msg_notification': {\n this.log.error('Bad msg notification', message);\n\n switch(message.error_code) {\n case 16: // * msg_id too low\n case 17: // * msg_id too high\n case 32: // * msg_seqno too low\n case 33: // * msg_seqno too high\n case 64: { // * invalid container\n // if(changedTimeOffset === undefined) {\n // changedTimeOffset = this.applyServerTime(messageId);\n // }\n\n const changedTimeOffset = this.applyServerTime(messageId);\n if(message.error_code === 17 || changedTimeOffset) {\n this.log('Update session');\n this.updateSession();\n }\n\n const badMessage = this.updateSentMessage(message.bad_msg_id);\n if(badMessage) this.pushResend(badMessage.msg_id); // fix 23.01.2020\n // this.ackMessage(messageId);\n }\n\n // * invalid container\n /* case 64: {\n const badMessage = this.sentMessages[message.bad_msg_id];\n if(badMessage) {\n for(const msgId of badMessage.inner) {\n if(this.sentMessages[msgId] !== undefined) {\n this.updateSentMessage\n }\n }\n const inner = badMessage.inner;\n }\n } */\n }\n\n break;\n }\n\n case 'message': {\n if(this.lastServerMessages.indexOf(messageId) !== -1) {\n // console.warn('[MT] Server same messageId: ', messageId)\n this.ackMessage(messageId);\n return;\n }\n\n this.lastServerMessages.push(messageId);\n if(this.lastServerMessages.length > 100) {\n this.lastServerMessages.shift();\n }\n\n this.processMessage(message.body, message.msg_id, sessionId);\n break;\n }\n\n case 'new_session_created': {\n this.ackMessage(messageId);\n\n if(this.debug) {\n this.log.debug('new_session_created', message);\n }\n // this.updateSession();\n\n this.processMessageAck(message.first_msg_id);\n this.applyServerSalt(message.server_salt);\n\n sessionStorage.get('dc').then((baseDcId) => {\n if(baseDcId === this.dcId && !this.isFileNetworker && this.networkerFactory.updatesProcessor) {\n this.networkerFactory.updatesProcessor(message);\n }\n });\n break;\n }\n\n case 'msgs_ack': {\n this.debug && this.log('got acks', message.msg_ids);\n for(const msgId of message.msg_ids) {\n this.processMessageAck(msgId);\n }\n\n break;\n }\n\n case 'msg_detailed_info': {\n const sentMessage = this.sentMessages[message.msg_id];\n if(!sentMessage) {\n this.ackMessage(message.answer_msg_id);\n break;\n }/* else if(sentMessage.acked) {\n this.reqResend(message.answer_msg_id, true);\n }\n\n break; */\n }\n\n case 'msg_new_detailed_info': {\n if(this.pendingAcks.indexOf(message.answer_msg_id) !== -1) {\n break;\n }\n\n this.reqResend(message.answer_msg_id);\n break;\n }\n\n case 'msgs_state_info': {\n this.ackMessage(message.answer_msg_id);\n const arr = [\n [this.lastResendReq, this.pendingResendReq] as const\n // [this.lastResendAnsReq, this.pendingResendAnsReq] as const\n ];\n\n for(const [lastResend, pendingResend] of arr) {\n if(lastResend?.reqMsgId === message.req_msg_id && pendingResend.length) {\n for(const badMsgId of lastResend.msgIds) {\n const pos = pendingResend.indexOf(badMsgId);\n if(pos !== -1) {\n pendingResend.splice(pos, 1);\n }\n }\n }\n }\n\n break;\n }\n\n case 'rpc_result': {\n this.ackMessage(messageId);\n\n const sentMessageId = message.req_msg_id;\n const sentMessage = this.sentMessages[sentMessageId];\n\n if(this.debug) {\n this.log('Rpc response', message.result, sentMessage);\n }\n\n this.processMessageAck(sentMessageId);\n if(sentMessage) {\n const deferred = sentMessage.deferred;\n if(message.result._ === 'rpc_error') {\n const error = this.processError(message.result);\n this.log('Rpc error', error);\n if(deferred) {\n deferred.reject(error);\n }\n } else {\n if(deferred) {\n deferred.resolve(message.result);\n }\n\n if(sentMessage.isAPI && !this.connectionInited) {\n this.connectionInited = true;\n }\n }\n\n delete this.sentMessages[sentMessageId];\n } else {\n if(this.debug) {\n this.log('Rpc result for unknown message:', sentMessageId, message);\n }\n }\n\n break;\n }\n\n case 'pong': { // * https://core.telegram.org/mtproto/service_messages#ping-messages-pingpong - These messages don't require acknowledgments\n /* const sentMessageId = message.msg_id;\n const sentMessage = this.sentMessages[sentMessageId];\n\n if(sentMessage) {\n sentMessage.deferred.resolve(message);\n delete this.sentMessages[sentMessageId];\n } */\n const pingId = message.ping_id;\n if(this.lastPingDelayDisconnectId === pingId) {\n const deferred = this.pingDelayDisconnectDeferred;\n if(deferred) {\n deferred.resolve('pong');\n } else {\n this.log('ping deferred deleted', pingId);\n }\n }\n\n break;\n }\n\n default:\n this.ackMessage(messageId);\n\n /* if(this.debug) {\n this.log.debug('Update', message);\n } */\n\n if(this.networkerFactory.updatesProcessor !== null) {\n this.networkerFactory.updatesProcessor(message);\n }\n break;\n }\n }\n}\n","import bigInt from 'big-integer';\n\nexport default function sortLongsArray(arr: string[]) {\n return arr.map((long) => {\n return bigInt(long);\n }).sort((a, b) => {\n return a.compare(b);\n }).map((bigInt) => {\n return bigInt.toString(10);\n });\n}\n","import addPadding from '../bytes/addPadding';\nimport bigInt from 'big-integer';\nimport {bigIntToBytes} from '../bigInt/bigIntConversion';\n\nexport default function longToBytes(sLong: string) {\n const bigIntBytes = bigIntToBytes(bigInt(sLong)).reverse();\n const bytes = addPadding(bigIntBytes, 8, true, false, false);\n // console.log('longToBytes', bytes, bigIntBytes);\n\n return bytes;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport type {ConnectionStatusChange} from './connectionStatus';\nimport MTPNetworker from './networker';\nimport {InvokeApiOptions} from '../../types';\nimport App from '../../config/app';\nimport indexOfAndSplice from '../../helpers/array/indexOfAndSplice';\nimport {AppManager} from '../appManagers/manager';\n\nexport class NetworkerFactory extends AppManager {\n private networkers: MTPNetworker[] = [];\n public language = navigator.language || App.langPackCode;\n public updatesProcessor: (obj: any) => void = null;\n // public onConnectionStatusChange: (status: ConnectionStatusChange) => void = null;\n public akStopped = false;\n\n public onConnectionStatusChange(status: ConnectionStatusChange) {\n this.rootScope.dispatchEvent('connection_status_change', status);\n // ({type: 'connectionStatusChange', payload: status});\n }\n\n public removeNetworker(networker: MTPNetworker) {\n indexOfAndSplice(this.networkers, networker);\n }\n\n public setUpdatesProcessor(callback: (obj: any) => void) {\n this.updatesProcessor = callback;\n }\n\n public getNetworker(dcId: number, authKey: Uint8Array, authKeyId: Uint8Array, serverSalt: Uint8Array, options: InvokeApiOptions) {\n // console.log('NetworkerFactory: creating new instance of MTPNetworker:', dcId, options);\n const networker = new MTPNetworker(this, this.timeManager, dcId, authKey, authKeyId, serverSalt, options);\n this.networkers.push(networker);\n return networker;\n }\n\n public startAll() {\n if(this.akStopped) {\n const stoppedNetworkers = this.networkers.filter((networker) => networker.isStopped());\n\n this.akStopped = false;\n this.updatesProcessor && this.updatesProcessor({_: 'new_session_created'});\n\n for(const networker of stoppedNetworkers) {\n networker.scheduleRequest();\n }\n }\n }\n\n public stopAll() {\n this.akStopped = true;\n }\n\n public setLanguage(langCode: string) {\n this.language = langCode;\n for(const networker of this.networkers) {\n if(!networker.isFileNetworker) {\n networker.connectionInited = false;\n }\n }\n }\n\n public unsetConnectionInited() {\n for(const networker of this.networkers) {\n networker.connectionInited = false;\n }\n }\n\n public forceReconnectTimeout() {\n for(const networker of this.networkers) {\n networker.forceReconnectTimeout();\n }\n }\n\n public forceReconnect() {\n for(const networker of this.networkers) {\n if(!networker.isFileNetworker) {\n networker.forceReconnect();\n break;\n }\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {TLSerialization} from './tl_utils';\nimport cryptoWorker from '../crypto/cryptoMessagePort';\nimport Modes from '../../config/modes';\nimport bytesFromHex from '../../helpers/bytes/bytesFromHex';\nimport bytesToHex from '../../helpers/bytes/bytesToHex';\nimport bigInt from 'big-integer';\n\nexport type RSAPublicKeyHex = {\n modulus: string,\n exponent: string\n};\n\nexport class RSAKeysManager {\n /**\n * Server public key, obtained from here: https://core.telegram.org/api/obtaining_api_id\n *\n *\n * -----BEGIN RSA PUBLIC KEY-----\n * MIIBCgKCAQEA6LszBcC1LGzyr992NzE0ieY+BSaOW622Aa9Bd4ZHLl+TuFQ4lo4g\n * 5nKaMBwK/BIb9xUfg0Q29/2mgIR6Zr9krM7HjuIcCzFvDtr+L0GQjae9H0pRB2OO\n * 62cECs5HKhT5DZ98K33vmWiLowc621dQuwKWSQKjWf50XYFw42h21P2KXUGyp2y/\n * +aEyZ+uVgLLQbRA1dEjSDZ2iGRy12Mk5gpYc397aYp438fsJoHIgJ2lgMv5h7WY9\n * t6N/byY9Nw9p21Og3AoXSL2q/2IJ1WRUhebgAdGVMlV1fkuOQoEzR7EdpqtQD9Cs\n * 5+bfo3Nhmcyvk5ftB0WkJ9z6bNZ7yxrP8wIDAQAB\n * -----END RSA PUBLIC KEY-----\n *\n * -----BEGIN RSA PUBLIC KEY-----\n * MIIBCgKCAQEBadMIUYSKhyznMh+Pg+OxTLyDZrWEjQIPZC3oJCtuZX7qUxgcWqFX\n * Q1952TSY8S8NYuz12sK9Fvp+lil1hIG0U/cuPsK08VB1hB4VA+p0S46fGwVsRovq\n * 4qUiUIzQSjSHDASuXTOinlYEHwmg/GaLc5G7qhePWa0p9YmqYR5Ha3xHJywcXZrn\n * yE3nC9igL96Aanqv+Prbu1N+r9vAgZeHh9cfbtbV8WWwruOANOTEv2ctQLR0dfr9\n * MwQXNePTPQlYsO9HNIGS1LWe7hZFtGBAVJH92F7Kig68WqHM3PIZ6Sq7N0VSzfzL\n * b11Z/YHz2UXYtXADwL/m5pTpKBUtJBXkOQIDAQAB\n * -----END RSA PUBLIC KEY-----\n *\n * Bytes can be got via\n * $ openssl rsa -in rsa.pem -RSAPublicKey_in -pubout > pub.pem\n * $ openssl rsa -pubin -in pub.pem -text -noout\n */\n\n /* private publisKeysHex = [{\n modulus: 'c150023e2f70db7985ded064759cfecf0af328e69a41daf4d6f01b538135a6f91f8f8b2a0ec9ba9720ce352efcf6c5680ffc424bd634864902de0b4bd6d49f4e580230e3ae97d95c8b19442b3c0a10d8f5633fecedd6926a7f6dab0ddb7d457f9ea81b8465fcd6fffeed114011df91c059caedaf97625f6c96ecc74725556934ef781d866b34f011fce4d835a090196e9a5f0e4449af7eb697ddb9076494ca5f81104a305b6dd27665722c46b60e5df680fb16b210607ef217652e60236c255f6a28315f4083a96791d7214bf64c1df4fd0db1944fb26a2a57031b32eee64ad15a8ba68885cde74a5bfc920f6abf59ba5c75506373e7130f9042da922179251f',\n exponent: '010001'\n }, {\n modulus: 'aeec36c8ffc109cb099624685b97815415657bd76d8c9c3e398103d7ad16c9bba6f525ed0412d7ae2c2de2b44e77d72cbf4b7438709a4e646a05c43427c7f184debf72947519680e651500890c6832796dd11f772c25ff8f576755afe055b0a3752c696eb7d8da0d8be1faf38c9bdd97ce0a77d3916230c4032167100edd0f9e7a3a9b602d04367b689536af0d64b613ccba7962939d3b57682beb6dae5b608130b2e52aca78ba023cf6ce806b1dc49c72cf928a7199d22e3d7ac84e47bc9427d0236945d10dbd15177bab413fbf0edfda09f014c7a7da088dde9759702ca760af2b8e4e97cc055c617bd74c3d97008635b98dc4d621b4891da9fb0473047927',\n exponent: '010001'\n }, {\n modulus: 'bdf2c77d81f6afd47bd30f29ac76e55adfe70e487e5e48297e5a9055c9c07d2b93b4ed3994d3eca5098bf18d978d54f8b7c713eb10247607e69af9ef44f38e28f8b439f257a11572945cc0406fe3f37bb92b79112db69eedf2dc71584a661638ea5becb9e23585074b80d57d9f5710dd30d2da940e0ada2f1b878397dc1a72b5ce2531b6f7dd158e09c828d03450ca0ff8a174deacebcaa22dde84ef66ad370f259d18af806638012da0ca4a70baa83d9c158f3552bc9158e69bf332a45809e1c36905a5caa12348dd57941a482131be7b2355a5f4635374f3bd3ddf5ff925bf4809ee27c1e67d9120c5fe08a9de458b1b4a3c5d0a428437f2beca81f4e2d5ff',\n exponent: '010001'\n }, {\n modulus: 'b3f762b739be98f343eb1921cf0148cfa27ff7af02b6471213fed9daa0098976e667750324f1abcea4c31e43b7d11f1579133f2b3d9fe27474e462058884e5e1b123be9cbbc6a443b2925c08520e7325e6f1a6d50e117eb61ea49d2534c8bb4d2ae4153fabe832b9edf4c5755fdd8b19940b81d1d96cf433d19e6a22968a85dc80f0312f596bd2530c1cfb28b5fe019ac9bc25cd9c2a5d8a0f3a1c0c79bcca524d315b5e21b5c26b46babe3d75d06d1cd33329ec782a0f22891ed1db42a1d6c0dea431428bc4d7aabdcf3e0eb6fda4e23eb7733e7727e9a1915580796c55188d2596d2665ad1182ba7abf15aaa5a8b779ea996317a20ae044b820bff35b6e8a1',\n exponent: '010001'\n }, {\n modulus: 'be6a71558ee577ff03023cfa17aab4e6c86383cff8a7ad38edb9fafe6f323f2d5106cbc8cafb83b869cffd1ccf121cd743d509e589e68765c96601e813dc5b9dfc4be415c7a6526132d0035ca33d6d6075d4f535122a1cdfe017041f1088d1419f65c8e5490ee613e16dbf662698c0f54870f0475fa893fc41eb55b08ff1ac211bc045ded31be27d12c96d8d3cfc6a7ae8aa50bf2ee0f30ed507cc2581e3dec56de94f5dc0a7abee0be990b893f2887bd2c6310a1e0a9e3e38bd34fded2541508dc102a9c9b4c95effd9dd2dfe96c29be647d6c69d66ca500843cfaed6e440196f1dbe0e2e22163c61ca48c79116fa77216726749a976a1c4b0944b5121e8c01',\n exponent: '010001'\n }]; */\n\n private testPublicKeysHex: RSAPublicKeyHex[] = [{\n modulus: 'c8c11d635691fac091dd9489aedced2932aa8a0bcefef05fa800892d9b52ed03200865c9e97211cb2ee6c7ae96d3fb0e15aeffd66019b44a08a240cfdd2868a85e1f54d6fa5deaa041f6941ddf302690d61dc476385c2fa655142353cb4e4b59f6e5b6584db76fe8b1370263246c010c93d011014113ebdf987d093f9d37c2be48352d69a1683f8f6e6c2167983c761e3ab169fde5daaa12123fa1beab621e4da5935e9c198f82f35eae583a99386d8110ea6bd1abb0f568759f62694419ea5f69847c43462abef858b4cb5edc84e7b9226cd7bd7e183aa974a712c079dde85b9dc063b8a5c08e8f859c0ee5dcd824c7807f20153361a7f63cfd2a433a1be7f5',\n exponent: '010001'\n }];\n\n private publisKeysHex: RSAPublicKeyHex[] = [{\n // modulus: '00e8bb3305c0b52c6cf2afdf7637313489e63e05268e5badb601af417786472e5f93b85438968e20e6729a301c0afc121bf7151f834436f7fda680847a66bf64accec78ee21c0b316f0edafe2f41908da7bd1f4a5107638eeb67040ace472a14f90d9f7c2b7def99688ba3073adb5750bb02964902a359fe745d8170e36876d4fd8a5d41b2a76cbff9a13267eb9580b2d06d10357448d20d9da2191cb5d8c93982961cdfdeda629e37f1fb09a0722027696032fe61ed663db7a37f6f263d370f69db53a0dc0a1748bdaaff6209d5645485e6e001d1953255757e4b8e42813347b11da6ab500fd0ace7e6dfa3736199ccaf9397ed0745a427dcfa6cd67bcb1acff3',\n modulus: 'e8bb3305c0b52c6cf2afdf7637313489e63e05268e5badb601af417786472e5f93b85438968e20e6729a301c0afc121bf7151f834436f7fda680847a66bf64accec78ee21c0b316f0edafe2f41908da7bd1f4a5107638eeb67040ace472a14f90d9f7c2b7def99688ba3073adb5750bb02964902a359fe745d8170e36876d4fd8a5d41b2a76cbff9a13267eb9580b2d06d10357448d20d9da2191cb5d8c93982961cdfdeda629e37f1fb09a0722027696032fe61ed663db7a37f6f263d370f69db53a0dc0a1748bdaaff6209d5645485e6e001d1953255757e4b8e42813347b11da6ab500fd0ace7e6dfa3736199ccaf9397ed0745a427dcfa6cd67bcb1acff3',\n exponent: '010001'\n }];\n\n private publicKeysParsed: {\n [hex: string]: RSAPublicKeyHex\n } = {};\n private prepared = false;\n private preparePromise: Promise = null;\n\n constructor() {\n if(Modes.test) {\n this.publisKeysHex = this.testPublicKeysHex;\n }\n }\n\n public prepare(): Promise {\n if(this.preparePromise) return this.preparePromise;\n else if(this.prepared) {\n return Promise.resolve();\n }\n\n return this.preparePromise = Promise.all(this.publisKeysHex.map((keyParsed) => {\n const RSAPublicKey = new TLSerialization();\n RSAPublicKey.storeBytes(bytesFromHex(keyParsed.modulus), 'n');\n RSAPublicKey.storeBytes(bytesFromHex(keyParsed.exponent), 'e');\n\n const buffer = RSAPublicKey.getBuffer();\n\n return cryptoWorker.invokeCrypto('sha1', buffer).then((bytes) => {\n const fingerprintBytes = bytes.slice(-8);\n fingerprintBytes.reverse();\n\n this.publicKeysParsed[bytesToHex(fingerprintBytes).toLowerCase()] = {\n modulus: keyParsed.modulus,\n exponent: keyParsed.exponent\n };\n });\n })).then(() => {\n this.prepared = true;\n\n // console.log('[MT] Prepared keys');\n this.preparePromise = null;\n });\n }\n\n public async select(fingerprints: Array) {\n await this.prepare();\n\n for(let i = 0; i < fingerprints.length; ++i) {\n let fingerprintHex = bigInt(fingerprints[i]).toString(16).toLowerCase();\n\n if(fingerprintHex.length < 16) {\n fingerprintHex = new Array(16 - fingerprintHex.length).fill('0').join('') + fingerprintHex;\n }\n\n // console.log(fingerprintHex, this.publicKeysParsed);\n const foundKey = this.publicKeysParsed[fingerprintHex];\n if(foundKey) {\n return Object.assign({\n fingerprint: fingerprints[i]\n }, foundKey);\n }\n }\n }\n}\n\nexport default new RSAKeysManager();\n","export default function bytesXor(bytes1: Uint8Array, bytes2: Uint8Array) {\n const len = bytes1.length;\n const bytes = new Uint8Array(len);\n\n for(let i = 0; i < len; ++i) {\n bytes[i] = bytes1[i] ^ bytes2[i];\n }\n\n return bytes;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\n \nimport transportController from './transports/controller';\n \n\nimport {TLSerialization, TLDeserialization} from './tl_utils';\nimport {TransportType} from './dcConfigurator';\nimport rsaKeysManager from './rsaKeysManager';\n\nimport CryptoWorker from '../crypto/cryptoMessagePort';\n\nimport {logger, LogTypes} from '../logger';\nimport DEBUG from '../../config/debug';\nimport {Awaited, DcId} from '../../types';\nimport addPadding from '../../helpers/bytes/addPadding';\nimport bytesCmp from '../../helpers/bytes/bytesCmp';\nimport bytesFromHex from '../../helpers/bytes/bytesFromHex';\nimport bytesToHex from '../../helpers/bytes/bytesToHex';\nimport bytesXor from '../../helpers/bytes/bytesXor';\nimport {bigIntFromBytes} from '../../helpers/bigInt/bigIntConversion';\nimport bigInt from 'big-integer';\nimport randomize from '../../helpers/array/randomize';\nimport {AppManager} from '../appManagers/manager';\n\n/* let fNewNonce: any = bytesFromHex('8761970c24cb2329b5b2459752c502f3057cb7e8dbab200e526e8767fdc73b3c').reverse();\nlet fNonce: any = bytesFromHex('b597720d11faa5914ef485c529cde414').reverse();\nlet fResult: any = new Uint8Array(bytesFromHex('000000000000000001b473a0661b285e480000006324160514e4cd29c585f44e91a5fa110d7297b5c0c4134c84893db5715ecd56af5ed618082182053cc5de91cd00000015c4b51c02000000a5b7f709355fc30b216be86c022bb4c3'));\n\nfNewNonce = false;\nfNonce = false;\nfResult = false; */\n\ntype AuthOptions = {\n dcId: number,\n nonce: Uint8Array,\n\n serverNonce?: Uint8Array,\n pq?: Uint8Array,\n fingerprints?: string[],\n publicKey?: {\n modulus: string,\n exponent: string,\n fingerprint: string\n },\n\n // good\n p?: Uint8Array,\n q?: Uint8Array,\n\n newNonce?: Uint8Array,\n\n retry?: number,\n\n b?: Uint8Array,\n g?: number,\n gA?: Uint8Array,\n dhPrime?: Uint8Array,\n\n tmpAesKey?: Uint8Array,\n tmpAesIv?: Uint8Array,\n\n authKeyId?: Uint8Array,\n authKey?: Uint8Array,\n serverSalt?: Uint8Array,\n\n localTime?: number,\n serverTime?: any,\n};\n\ntype ResPQ = {\n _: 'resPQ';\n nonce: Uint8Array;\n pq: Uint8Array;\n server_nonce: Uint8Array;\n server_public_key_fingerprints: string[];\n};\n\ntype P_Q_inner_data = {\n _: 'p_q_inner_data_dc';\n pq: Uint8Array;\n p: Uint8Array;\n q: Uint8Array;\n nonce: Uint8Array;\n server_nonce: Uint8Array;\n new_nonce: Uint8Array;\n dc: number;\n};\n\ntype req_DH_params = {\n nonce: Uint8Array;\n server_nonce: Uint8Array;\n p: Uint8Array;\n q: Uint8Array;\n public_key_fingerprint: string;\n encrypted_data: Uint8Array;\n};\n\nexport class Authorizer extends AppManager {\n private cached: {\n [dcId: DcId]: Promise\n };\n\n private log: ReturnType;\n\n private transportType: TransportType;\n\n \n private getTransportTypePromise: Promise;\n \n\n protected after() {\n this.cached = {};\n this.log = logger(`AUTHORIZER`, LogTypes.Error | LogTypes.Log);\n }\n\n private sendPlainRequest(dcId: DcId, requestArray: Uint8Array) {\n const requestLength = requestArray.byteLength;\n\n const header = new TLSerialization();\n header.storeLongP(0, 0, 'auth_key_id');\n header.storeLong(this.timeManager.generateId(), 'msg_id');\n header.storeInt(requestLength, 'request_length');\n\n const headerArray = header.getBytes(true) as Uint8Array;\n const resultArray = new Uint8Array(headerArray.byteLength + requestLength);\n resultArray.set(headerArray);\n resultArray.set(requestArray, headerArray.length);\n\n const transport = this.dcConfigurator.chooseServer(dcId, 'client', this.transportType);\n const baseError = {\n code: 406,\n type: 'NETWORK_BAD_RESPONSE'\n };\n\n if(DEBUG) {\n this.log('mtpSendPlainRequest: creating requestPromise');\n }\n\n const promise = transport.send(resultArray) as any as Promise;\n return promise.then((result) => {\n if(DEBUG) {\n this.log('mtpSendPlainRequest: in good sector', result);\n }\n\n if(!result || !result.byteLength) {\n throw baseError;\n }\n\n try {\n /* result = fResult ? fResult : result;\n fResult = new Uint8Array(0); */\n\n const deserializer = new TLDeserialization(result, {mtproto: true});\n\n if(result.length === 4) {\n const errorCode = deserializer.fetchInt();\n this.log.error('mtpSendPlainRequest: wrong response, error code:', errorCode);\n throw errorCode;\n }\n\n const auth_key_id = deserializer.fetchLong('auth_key_id');\n if(auth_key_id !== '0') this.log.error('auth_key_id !== 0', auth_key_id);\n\n const msg_id = deserializer.fetchLong('msg_id');\n if(msg_id === '0') this.log.error('msg_id === 0', msg_id);\n\n const msg_len = deserializer.fetchInt('msg_len');\n if(!msg_len) this.log.error('no msg_len', msg_len);\n\n return deserializer;\n } catch(e) {\n this.log.error('mtpSendPlainRequest: deserialization went bad', e);\n const error = Object.assign(baseError, {originalError: e});\n throw error;\n }\n }, (error) => {\n if(!error.message && !error.type) {\n error = Object.assign(baseError, {\n originalError: error\n });\n }\n\n throw error;\n });\n }\n\n private async sendReqPQ(auth: AuthOptions) {\n const request = new TLSerialization({mtproto: true});\n\n request.storeMethod('req_pq_multi', {nonce: auth.nonce});\n\n if(DEBUG) {\n this.log('Send req_pq', bytesToHex(auth.nonce));\n }\n\n let deserializer: Awaited>;\n try {\n const promise = this.sendPlainRequest(auth.dcId, request.getBytes(true));\n rsaKeysManager.prepare();\n deserializer = await promise;\n } catch(error) {\n this.log.error('req_pq error', (error as Error).message);\n throw error;\n }\n\n const response: ResPQ = deserializer.fetchObject('ResPQ');\n\n if(response._ !== 'resPQ') {\n throw new Error('[MT] resPQ response invalid: ' + response._);\n }\n\n if(!bytesCmp(auth.nonce, response.nonce)) {\n this.log.error(auth.nonce, response.nonce);\n throw new Error('[MT] resPQ nonce mismatch');\n }\n\n auth.serverNonce = response.server_nonce; // need\n auth.pq = response.pq;\n auth.fingerprints = response.server_public_key_fingerprints;\n\n if(DEBUG) {\n this.log('Got ResPQ', bytesToHex(auth.serverNonce), bytesToHex(auth.pq), auth.fingerprints);\n }\n\n const publicKey = await rsaKeysManager.select(auth.fingerprints);\n if(!publicKey) {\n throw new Error('[MT] No public key found');\n }\n\n auth.publicKey = publicKey;\n\n if(DEBUG) {\n this.log('PQ factorization start', auth.pq);\n }\n\n // let pAndQ: Awaited>;\n try {\n var pAndQ = await CryptoWorker.invokeCrypto('factorize', auth.pq);\n } catch(error) {\n this.log.error('worker error factorize', error);\n throw error;\n }\n\n auth.p = pAndQ[0];\n auth.q = pAndQ[1];\n\n if(DEBUG) {\n this.log('PQ factorization done', pAndQ);\n }\n\n return this.sendReqDhParams(auth);\n }\n\n private async sendReqDhParams(auth: AuthOptions): Promise {\n auth.newNonce = randomize(new Uint8Array(32));\n\n const p_q_inner_data_dc: P_Q_inner_data = {\n _: 'p_q_inner_data_dc',\n pq: auth.pq,\n p: auth.p,\n q: auth.q,\n nonce: auth.nonce,\n server_nonce: auth.serverNonce,\n new_nonce: auth.newNonce,\n dc: 0\n };\n\n const pQInnerDataSerialization = new TLSerialization({mtproto: true});\n pQInnerDataSerialization.storeObject(p_q_inner_data_dc, 'P_Q_inner_data', 'DECRYPTED_DATA');\n\n const data = pQInnerDataSerialization.getBytes(true);\n if(data.length > 144) {\n throw 'DH_params: data is more than 144 bytes!';\n }\n\n const dataWithPadding = addPadding(data, 192, false, true, false);\n const dataPadReversed = dataWithPadding.slice().reverse();\n\n const getKeyAesEncrypted = async() => {\n for(;;) {\n const tempKey = randomize(new Uint8Array(32));\n const dataWithHash = dataPadReversed.concat(await CryptoWorker.invokeCrypto('sha256', tempKey.concat(dataWithPadding)));\n if(dataWithHash.length !== 224) {\n throw 'DH_params: dataWithHash !== 224 bytes!';\n }\n\n const aesEncrypted = await CryptoWorker.invokeCrypto('aes-encrypt', dataWithHash, tempKey, new Uint8Array([0]));\n const tempKeyXor = bytesXor(tempKey, await CryptoWorker.invokeCrypto('sha256', aesEncrypted));\n const keyAesEncrypted = tempKeyXor.concat(aesEncrypted);\n\n const keyAesEncryptedBigInt = bigIntFromBytes(keyAesEncrypted);\n const publicKeyModulusBigInt = bigInt(auth.publicKey.modulus, 16);\n\n if(keyAesEncryptedBigInt.compare(publicKeyModulusBigInt) === -1) {\n return keyAesEncrypted;\n }\n }\n };\n\n const keyAesEncrypted = await getKeyAesEncrypted();\n const encryptedData = addPadding(await CryptoWorker.invokeCrypto('rsa-encrypt', keyAesEncrypted, auth.publicKey), 256, true, true, true);\n\n const req_DH_params: req_DH_params = {\n nonce: auth.nonce,\n server_nonce: auth.serverNonce,\n p: auth.p,\n q: auth.q,\n public_key_fingerprint: auth.publicKey.fingerprint,\n encrypted_data: encryptedData\n };\n\n const request = new TLSerialization({mtproto: true});\n request.storeMethod('req_DH_params', req_DH_params);\n\n const requestBytes = request.getBytes(true);\n\n if(DEBUG) {\n this.log('Send req_DH_params', req_DH_params/* , requestBytes.hex */);\n }\n\n let deserializer: Awaited>;\n try {\n deserializer = await this.sendPlainRequest(auth.dcId, requestBytes);\n } catch(error) {\n this.log.error('Send req_DH_params FAIL!', error);\n throw error;\n }\n\n const response = deserializer.fetchObject('Server_DH_Params', 'RESPONSE');\n\n if(DEBUG) {\n this.log('Sent req_DH_params, response:', response);\n }\n\n if(response._ !== 'server_DH_params_fail' && response._ !== 'server_DH_params_ok') {\n throw new Error('[MT] Server_DH_Params response invalid: ' + response._);\n }\n\n if(!bytesCmp(auth.nonce, response.nonce)) {\n throw new Error('[MT] Server_DH_Params nonce mismatch');\n }\n\n if(!bytesCmp(auth.serverNonce, response.server_nonce)) {\n throw new Error('[MT] Server_DH_Params server_nonce mismatch');\n }\n\n if(response._ === 'server_DH_params_fail') {\n const newNonceHash = (await CryptoWorker.invokeCrypto('sha1', auth.newNonce)).slice(-16);\n if(!bytesCmp(newNonceHash, response.new_nonce_hash)) {\n throw new Error('[MT] server_DH_params_fail new_nonce_hash mismatch');\n }\n\n throw new Error('[MT] server_DH_params_fail');\n }\n\n // fill auth object\n try {\n await this.decryptServerDhDataAnswer(auth, response.encrypted_answer);\n } catch(e) {\n this.log.error('mtpDecryptServerDhDataAnswer FAILED!', e);\n throw e;\n }\n\n // console.log(dT(), 'mtpSendReqDhParams: executing mtpSendSetClientDhParams...');\n\n return this.sendSetClientDhParams(auth);\n }\n\n private async decryptServerDhDataAnswer(auth: AuthOptions, encryptedAnswer: any) {\n auth.localTime = Date.now();\n\n // ! can't concat Array with Uint8Array!\n auth.tmpAesKey = (await CryptoWorker.invokeCrypto('sha1', auth.newNonce.concat(auth.serverNonce)))\n .concat((await CryptoWorker.invokeCrypto('sha1', auth.serverNonce.concat(auth.newNonce))).slice(0, 12));\n\n auth.tmpAesIv = (await CryptoWorker.invokeCrypto('sha1', auth.serverNonce.concat(auth.newNonce))).slice(12)\n .concat(await CryptoWorker.invokeCrypto('sha1', auth.newNonce.concat(auth.newNonce)), auth.newNonce.slice(0, 4));\n\n const answerWithHash = new Uint8Array(await CryptoWorker.invokeCrypto('aes-decrypt', encryptedAnswer, auth.tmpAesKey, auth.tmpAesIv));\n\n const hash = answerWithHash.slice(0, 20);\n const answerWithPadding = answerWithHash.slice(20);\n\n const deserializer = new TLDeserialization(answerWithPadding, {mtproto: true});\n const response = deserializer.fetchObject('Server_DH_inner_data');\n\n if(response._ !== 'server_DH_inner_data') {\n throw new Error('[MT] server_DH_inner_data response invalid: ' + response);\n }\n\n if(!bytesCmp(auth.nonce, response.nonce)) {\n throw new Error('[MT] server_DH_inner_data nonce mismatch');\n }\n\n if(!bytesCmp(auth.serverNonce, response.server_nonce)) {\n throw new Error('[MT] server_DH_inner_data serverNonce mismatch');\n }\n\n if(DEBUG) {\n this.log('Done decrypting answer');\n }\n auth.g = response.g;\n auth.dhPrime = response.dh_prime;\n auth.gA = response.g_a;\n auth.serverTime = response.server_time;\n auth.retry = 0;\n\n this.verifyDhParams(auth.g, auth.dhPrime, auth.gA);\n\n const offset = deserializer.getOffset();\n\n if(!bytesCmp(hash, await CryptoWorker.invokeCrypto('sha1', answerWithPadding.slice(0, offset)))) {\n throw new Error('[MT] server_DH_inner_data SHA1 mismatch');\n }\n\n this.timeManager.applyServerTime(auth.serverTime, auth.localTime);\n }\n\n private verifyDhParams(g: number, dhPrime: Uint8Array, gA: Uint8Array) {\n if(DEBUG) {\n this.log('Verifying DH params', g, dhPrime, gA);\n }\n\n const dhPrimeHex = bytesToHex(dhPrime);\n if(g !== 3 || dhPrimeHex !== 'c71caeb9c6b1c9048e6c522f70f13f73980d40238e3e21c14934d037563d930f48198a0aa7c14058229493d22530f4dbfa336f6e0ac925139543aed44cce7c3720fd51f69458705ac68cd4fe6b6b13abdc9746512969328454f18faf8c595f642477fe96bb2a941d5bcd1d4ac8cc49880708fa9b378e3c4f3a9060bee67cf9a4a4a695811051907e162753b56b0f6b410dba74d8a84b2a14b3144e0ef1284754fd17ed950d5965b4b9dd46582db1178d169c6bc465b0d6ff9ca3928fef5b9ae4e418fc15e83ebea0f87fa9ff5eed70050ded2849f47bf959d956850ce929851f0d8115f635b105ee2e4e15d04b2454bf6f4fadf034b10403119cd8e3b92fcc5b') {\n // The verified value is from https://core.telegram.org/mtproto/security_guidelines\n throw new Error('[MT] DH params are not verified: unknown dhPrime');\n }\n\n if(DEBUG) {\n this.log('dhPrime cmp OK');\n }\n\n const gABigInt = bigIntFromBytes(gA);\n const dhPrimeBigInt = bigInt(dhPrimeHex, 16);\n\n if(gABigInt.compare(bigInt.one) <= 0) {\n throw new Error('[MT] DH params are not verified: gA <= 1');\n }\n\n if(gABigInt.compare(dhPrimeBigInt.subtract(bigInt.one)) >= 0) {\n throw new Error('[MT] DH params are not verified: gA >= dhPrime - 1');\n }\n\n if(DEBUG) {\n this.log('1 < gA < dhPrime-1 OK');\n }\n\n const twoPow = bigInt(2).pow(2048 - 64);\n\n if(gABigInt.compare(twoPow) < 0) {\n throw new Error('[MT] DH params are not verified: gA < 2^{2048-64}');\n }\n if(gABigInt.compare(dhPrimeBigInt.subtract(twoPow)) >= 0) {\n throw new Error('[MT] DH params are not verified: gA > dhPrime - 2^{2048-64}');\n }\n\n if(DEBUG) {\n this.log('2^{2048-64} < gA < dhPrime-2^{2048-64} OK');\n }\n\n return true;\n }\n\n private async sendSetClientDhParams(auth: AuthOptions): Promise {\n const gBytes = bytesFromHex(auth.g.toString(16));\n\n auth.b = randomize(new Uint8Array(256));\n // MTProto.secureRandom.nextBytes(auth.b);\n\n // let gB: Awaited>;\n try {\n var gB = await CryptoWorker.invokeCrypto('mod-pow', gBytes, auth.b, auth.dhPrime);\n } catch(error) {\n throw error;\n }\n\n const data = new TLSerialization({mtproto: true});\n data.storeObject({\n _: 'client_DH_inner_data',\n nonce: auth.nonce,\n server_nonce: auth.serverNonce,\n retry_id: [0, auth.retry++],\n g_b: gB\n }, 'Client_DH_Inner_Data');\n\n const dataWithHash = (await CryptoWorker.invokeCrypto('sha1', data.getBuffer())).concat(data.getBytes(true));\n const encryptedData = await CryptoWorker.invokeCrypto('aes-encrypt', dataWithHash, auth.tmpAesKey, auth.tmpAesIv);\n\n const request = new TLSerialization({mtproto: true});\n request.storeMethod('set_client_DH_params', {\n nonce: auth.nonce,\n server_nonce: auth.serverNonce,\n encrypted_data: encryptedData\n });\n\n if(DEBUG) {\n this.log('Send set_client_DH_params');\n }\n\n let deserializer: Awaited>;\n try {\n deserializer = await this.sendPlainRequest(auth.dcId, request.getBytes(true));\n } catch(err) {\n throw err;\n }\n\n const response = deserializer.fetchObject('Set_client_DH_params_answer');\n\n if(response._ !== 'dh_gen_ok' && response._ !== 'dh_gen_retry' && response._ !== 'dh_gen_fail') {\n throw new Error('[MT] Set_client_DH_params_answer response invalid: ' + response._);\n }\n\n if(!bytesCmp(auth.nonce, response.nonce)) {\n throw new Error('[MT] Set_client_DH_params_answer nonce mismatch');\n }\n\n if(!bytesCmp(auth.serverNonce, response.server_nonce)) {\n throw new Error('[MT] Set_client_DH_params_answer server_nonce mismatch');\n }\n\n // let authKey: Uint8Array;\n try {\n var authKey = await CryptoWorker.invokeCrypto('mod-pow', auth.gA, auth.b, auth.dhPrime);\n } catch(err) {\n throw authKey;\n }\n\n const authKeyHash = await CryptoWorker.invokeCrypto('sha1', authKey),\n authKeyAux = authKeyHash.slice(0, 8),\n authKeyId = authKeyHash.slice(-8);\n\n if(DEBUG) {\n this.log('Got Set_client_DH_params_answer', response._, authKey);\n }\n switch(response._) {\n case 'dh_gen_ok': {\n const newNonceHash1 = (await CryptoWorker.invokeCrypto('sha1', auth.newNonce.concat([1], authKeyAux))).slice(-16);\n\n if(!bytesCmp(newNonceHash1, response.new_nonce_hash1)) {\n this.log.error('Set_client_DH_params_answer new_nonce_hash1 mismatch', newNonceHash1, response);\n throw new Error('new_nonce_hash1 mismatch');\n }\n\n const serverSalt = bytesXor(auth.newNonce.slice(0, 8), auth.serverNonce.slice(0, 8));\n if(DEBUG) {\n this.log('Auth successfull!', authKeyId, authKey, serverSalt);\n }\n\n auth.authKeyId = authKeyId;\n auth.authKey = authKey;\n auth.serverSalt = serverSalt;\n\n return auth;\n }\n\n case 'dh_gen_retry': {\n const newNonceHash2 = (await CryptoWorker.invokeCrypto('sha1', auth.newNonce.concat([2], authKeyAux))).slice(-16);\n if(!bytesCmp(newNonceHash2, response.new_nonce_hash2)) {\n throw new Error('[MT] Set_client_DH_params_answer new_nonce_hash2 mismatch');\n }\n\n return this.sendSetClientDhParams(auth);\n }\n\n case 'dh_gen_fail': {\n const newNonceHash3 = (await CryptoWorker.invokeCrypto('sha1', auth.newNonce.concat([3], authKeyAux))).slice(-16);\n if(!bytesCmp(newNonceHash3, response.new_nonce_hash3)) {\n throw new Error('[MT] Set_client_DH_params_answer new_nonce_hash3 mismatch');\n }\n\n throw new Error('[MT] Set_client_DH_params_answer fail');\n }\n }\n }\n\n \n private getTransportType() {\n if(this.getTransportTypePromise) return this.getTransportTypePromise;\n return this.getTransportTypePromise = transportController.pingTransports().then(({websocket}) => {\n this.transportType = websocket ? 'websocket' : 'https';\n this.log('will use transport:', this.transportType);\n });\n }\n \n\n public auth(dcId: DcId) {\n let promise = this.cached[dcId];\n if(promise) {\n return promise;\n }\n\n promise = new Promise(async(resolve, reject) => {\n \n await this.getTransportType();\n \n\n let error: ApiError;\n let _try = 1;\n while(_try++ <= 3) {\n try {\n const auth: AuthOptions = {\n dcId,\n nonce: randomize(new Uint8Array(16))\n };\n\n const promise = this.sendReqPQ(auth);\n resolve(await promise);\n return;\n } catch(err) {\n error = err;\n }\n }\n\n reject(error);\n });\n\n return this.cached[dcId] = promise;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport sessionStorage from '../sessionStorage';\nimport {nextRandomUint} from '../../helpers/random';\nimport {WorkerTaskVoidTemplate} from '../../types';\nimport ulongFromInts from '../../helpers/long/ulongFromInts';\nimport {AppManager} from '../appManagers/manager';\n\n/*\nlet lol: any = {};\nfor(var i = 0; i < 100; i++) {\n timeManager.generateId();\n}\n*/\n\nexport interface ApplyServerTimeOffsetTask extends WorkerTaskVoidTemplate {\n type: 'applyServerTimeOffset',\n payload: TimeManager['timeOffset']\n};\n\nexport class TimeManager extends AppManager {\n private lastMessageId: [number, number];\n private timeOffset: number;\n\n /* private midnightNoOffset: number;\n private midnightOffseted: Date;\n\n private midnightOffset: number; */\n\n /* private timeParams: {\n midnightOffset: number,\n serverTimeOffset: number\n }; */\n\n protected after() {\n this.lastMessageId = [0, 0];\n this.timeOffset = 0;\n\n sessionStorage.get('server_time_offset').then((to) => {\n if(to) {\n this.timeOffset = to;\n }\n });\n\n\n // * migrated from ServerTimeManager\n /* const timestampNow = tsNow(true);\n this.midnightNoOffset = timestampNow - (timestampNow % 86400);\n this.midnightOffseted = new Date();\n this.midnightOffseted.setHours(0, 0, 0, 0);\n\n this.midnightOffset = this.midnightNoOffset - (Math.floor(+this.midnightOffseted / 1000)); */\n\n /* this.timeParams = {\n midnightOffset: this.midnightOffset,\n serverTimeOffset: this.serverTimeOffset\n }; */\n }\n\n public getServerTimeOffset() {\n return this.timeOffset;\n }\n\n public generateId(): string {\n const timeTicks = Date.now(),\n timeSec = Math.floor(timeTicks / 1000) + this.timeOffset,\n timeMSec = timeTicks % 1000,\n random = nextRandomUint(16);\n\n let messageId: TimeManager['lastMessageId'] = [timeSec, (timeMSec << 21) | (random << 3) | 4];\n if(this.lastMessageId[0] > messageId[0] ||\n this.lastMessageId[0] === messageId[0] && this.lastMessageId[1] >= messageId[1]) {\n messageId = [this.lastMessageId[0], this.lastMessageId[1] + 4];\n }\n\n this.lastMessageId = messageId;\n\n const ret = ulongFromInts(messageId[0], messageId[1]).toString(10);\n\n // if(lol[ret]) {\n // console.error('[TimeManager]: Generated SAME msg id', messageId, this.timeOffset, ret);\n // }\n // lol[ret] = true;\n\n // console.log('[TimeManager]: Generated msg id', messageId, this.timeOffset, ret);\n\n return ret\n }\n\n public applyServerTime(serverTime: number, localTime?: number) {\n localTime = (localTime || Date.now()) / 1000 | 0;\n const newTimeOffset = serverTime - localTime;\n const changed = Math.abs(this.timeOffset - newTimeOffset) > 10;\n this.lastMessageId = [0, 0];\n\n if(this.timeOffset !== newTimeOffset) {\n sessionStorage.set({\n server_time_offset: newTimeOffset\n });\n\n this.timeOffset = newTimeOffset;\n }\n\n // console.log('[TimeManager]: Apply server time', serverTime, localTime, newTimeOffset, changed);\n\n return changed;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {DocumentAttribute, WebDocument} from '../../layer';\n\nexport default class AppWebDocsManager {\n public saveWebDocument(webDocument: WebDocument) {\n if(!webDocument) {\n return;\n }\n\n const attribute: DocumentAttribute.documentAttributeImageSize = webDocument.attributes.find((attribute) => attribute._ === 'documentAttributeImageSize') as any;\n if(attribute) {\n webDocument.w = attribute.w;\n webDocument.h = attribute.h;\n }\n\n return webDocument;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {InputInvoice, InputPaymentCredentials, PaymentRequestedInfo, PaymentsPaymentForm} from '../../layer';\nimport {AppManager} from './manager';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\n\nexport default class AppPaymentsManager extends AppManager {\n public getInputInvoiceBySlug(slug: string): InputInvoice.inputInvoiceSlug {\n return {\n _: 'inputInvoiceSlug',\n slug\n };\n }\n\n public getInputInvoiceByPeerId(peerId: PeerId, mid: number): InputInvoice.inputInvoiceMessage {\n return {\n _: 'inputInvoiceMessage',\n peer: this.appPeersManager.getInputPeerById(peerId),\n msg_id: getServerMessageId(mid)\n };\n }\n\n public getPaymentForm(invoice: InputInvoice) {\n return this.apiManager.invokeApi('payments.getPaymentForm', {\n invoice\n }).then((paymentForm) => {\n this.appUsersManager.saveApiUsers(paymentForm.users);\n\n return paymentForm;\n });\n }\n\n public getPaymentReceipt(peerId: PeerId, mid: number) {\n return this.apiManager.invokeApi('payments.getPaymentReceipt', {\n peer: this.appPeersManager.getInputPeerById(peerId),\n msg_id: getServerMessageId(mid)\n }).then((paymentForm) => {\n this.appUsersManager.saveApiUsers(paymentForm.users);\n\n return paymentForm;\n });\n }\n\n public validateRequestedInfo(invoice: InputInvoice, info: PaymentRequestedInfo, save?: boolean) {\n return this.apiManager.invokeApi('payments.validateRequestedInfo', {\n save,\n invoice,\n info\n });\n }\n\n public sendPaymentForm(\n invoice: InputInvoice,\n formId: PaymentsPaymentForm['form_id'],\n requestedInfoId: string,\n shippingOptionId: string,\n credentials: InputPaymentCredentials,\n tipAmount?: number\n ) {\n return this.apiManager.invokeApi('payments.sendPaymentForm', {\n form_id: formId,\n invoice,\n requested_info_id: requestedInfoId,\n shipping_option_id: shippingOptionId,\n credentials,\n tip_amount: tipAmount || undefined\n }).then((result) => {\n if(result._ === 'payments.paymentResult') {\n this.apiUpdatesManager.processUpdateMessage(result.updates);\n }\n\n return result;\n });\n }\n\n public clearSavedInfo(info?: boolean, credentials?: boolean) {\n return this.apiManager.invokeApi('payments.clearSavedInfo', {\n info,\n credentials\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MessageSendingParams} from './appMessagesManager';\nimport {AppManager} from './manager';\nimport {AttachMenuBots, AttachMenuBot, Update, DataJSON} from '../../layer';\nimport assumeType from '../../helpers/assumeType';\nimport makeError from '../../helpers/makeError';\nimport getAttachMenuBotIcon from './utils/attachMenuBots/getAttachMenuBotIcon';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\n\nexport default class AppAttachMenuBotsManager extends AppManager {\n private attachMenuBots: Map;\n private attachMenuBotsArr: AttachMenuBot[];\n\n protected after() {\n this.clear(true);\n\n this.apiUpdatesManager.addMultipleEventsListeners({\n updateAttachMenuBots: this.onUpdateAttachMenuBots\n });\n }\n\n public clear = (init = false) => {\n if(!init) {\n this.attachMenuBots.clear();\n this.attachMenuBotsArr = undefined;\n } else {\n this.attachMenuBots = new Map();\n }\n };\n\n private onUpdateAttachMenuBots = (update: Update.updateAttachMenuBots) => {\n this.clear();\n this.getAttachMenuBots();\n };\n\n public saveAttachMenuBot(attachMenuBot: AttachMenuBot) {\n this.attachMenuBots.set(attachMenuBot.bot_id, attachMenuBot);\n const icon = getAttachMenuBotIcon(attachMenuBot);\n icon.icon = this.appDocsManager.saveDoc(icon.icon, {type: 'attachMenuBotIcon', botId: attachMenuBot.bot_id});\n return attachMenuBot;\n }\n\n public saveAttachMenuBots(attachMenuBots: AttachMenuBot[]) {\n if((attachMenuBots as any).saved) return;\n (attachMenuBots as any).saved = true;\n attachMenuBots.forEach((user) => this.saveAttachMenuBot(user));\n }\n\n public getAttachMenuBots() {\n return this.attachMenuBotsArr ?? this.apiManager.invokeApiSingleProcess({\n method: 'messages.getAttachMenuBots',\n processResult: (attachMenuBots) => {\n assumeType(attachMenuBots);\n this.appUsersManager.saveApiUsers(attachMenuBots.users);\n this.saveAttachMenuBots(attachMenuBots.bots);\n // ! temporary\n return this.attachMenuBotsArr = attachMenuBots.bots.slice(0, 0);\n }\n });\n }\n\n public getAttachMenuBotCached(botId: BotId) {\n return this.attachMenuBots.get(botId);\n }\n\n public getAttachMenuBot(botId: BotId, overwrite?: boolean) {\n if(!this.appUsersManager.isAttachMenuBot(botId) || true) {\n throw makeError('BOT_INVALID');\n }\n\n return (!overwrite && this.getAttachMenuBotCached(botId)) ?? this.apiManager.invokeApiSingleProcess({\n method: 'messages.getAttachMenuBot',\n params: {\n bot: this.appUsersManager.getUserInput(botId)\n },\n processResult: (attachMenuBotsBot) => {\n this.appUsersManager.saveApiUsers(attachMenuBotsBot.users);\n const attachMenuBot = this.saveAttachMenuBot(attachMenuBotsBot.bot);\n return attachMenuBot;\n }\n });\n }\n\n public requestWebView(options: MessageSendingParams & {\n botId: BotId,\n peerId: PeerId,\n // platform: string,\n startParam?: string,\n fromBotMenu?: boolean,\n url?: string,\n themeParams?: DataJSON\n }) {\n const {\n botId,\n peerId,\n url,\n fromBotMenu,\n themeParams,\n // platform,\n replyToMsgId,\n silent,\n sendAsPeerId,\n startParam,\n threadId\n } = options;\n\n const platform = 'web';\n\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.requestWebView',\n params: {\n peer: this.appPeersManager.getInputPeerById(peerId),\n bot: this.appUsersManager.getUserInput(botId),\n silent,\n platform,\n url,\n reply_to_msg_id: replyToMsgId ? getServerMessageId(replyToMsgId) : undefined,\n from_bot_menu: fromBotMenu,\n theme_params: themeParams,\n send_as: sendAsPeerId ? this.appPeersManager.getInputPeerById(sendAsPeerId) : undefined,\n start_param: startParam,\n top_msg_id: threadId ? getServerMessageId(threadId) : undefined\n },\n processResult: (result) => {\n console.log(result);\n return result;\n }\n });\n }\n\n public prolongWebView(options: MessageSendingParams & {\n peerId: PeerId,\n botId: BotId,\n queryId: string | number\n }) {\n return this.apiManager.invokeApiSingleProcess({\n method: 'messages.prolongWebView',\n params: {\n peer: this.appPeersManager.getInputPeerById(options.peerId),\n bot: this.appUsersManager.getUserInput(options.botId),\n query_id: options.queryId,\n silent: options.silent,\n reply_to_msg_id: options.replyToMsgId ? getServerMessageId(options.replyToMsgId) : undefined,\n send_as: options.sendAsPeerId ? this.appPeersManager.getInputPeerById(options.sendAsPeerId) : undefined,\n top_msg_id: options.threadId ? getServerMessageId(options.threadId) : undefined\n },\n processResult: (result) => {\n console.log(result);\n }\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {UrlAuthResult} from '../../layer';\nimport {AppManager} from './manager';\nimport getServerMessageId from './utils/messageId/getServerMessageId';\n\nexport default class AppSeamlessLoginManager extends AppManager {\n public requestUrlAuth(url: string, peerId?: PeerId, mid?: number, buttonId?: number) {\n return this.apiManager.invokeApi('messages.requestUrlAuth', {\n button_id: buttonId,\n msg_id: mid ? getServerMessageId(mid) : undefined,\n peer: peerId ? this.appPeersManager.getInputPeerById(peerId) : undefined,\n url\n }).then((urlAuthResult) => {\n if(urlAuthResult._ === 'urlAuthResultRequest') {\n this.appUsersManager.saveApiUser(urlAuthResult.bot);\n }\n\n return urlAuthResult;\n });\n }\n\n public acceptUrlAuth(url: string, peerId?: PeerId, mid?: number, buttonId?: number, writeAllowed?: boolean) {\n return this.apiManager.invokeApi('messages.acceptUrlAuth', {\n button_id: buttonId,\n msg_id: mid ? getServerMessageId(mid) : undefined,\n peer: peerId ? this.appPeersManager.getInputPeerById(peerId) : undefined,\n url,\n write_allowed: writeAllowed\n }).then((urlAuthResult) => {\n return urlAuthResult as Exclude;\n });\n }\n\n public getWebAuthorizations() {\n return this.apiManager.invokeApi('account.getWebAuthorizations').then((webAuthorizations) => {\n this.appUsersManager.saveApiUsers(webAuthorizations.users);\n return webAuthorizations.authorizations;\n });\n }\n\n public resetWebAuthorization(hash: Long) {\n return this.apiManager.invokeApi('account.resetWebAuthorization', {\n hash\n });\n }\n\n public resetWebAuthorizations() {\n return this.apiManager.invokeApi('account.resetWebAuthorizations');\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport assumeType from '../../helpers/assumeType';\nimport {AccountThemes, AccountWallPapers, InputWallPaper, WallPaper} from '../../layer';\nimport {AppManager} from './manager';\n\ntype WallPaperId = WallPaper['id'];\n\nexport default class AppThemesManager extends AppManager {\n private wallPapers: {[id: WallPaperId]: WallPaper};\n\n protected after() {\n this.wallPapers = {};\n }\n\n private saveWallPaper(wallPaper: WallPaper) {\n if(!wallPaper) {\n return wallPaper;\n }\n // const oldWallPaper = this.wallPapers[wallPaper.id];\n\n // ! IT'S BROKEN NOW. SERVER RETURNS SAME ID FOR DIFFERENT WALLPAPERS\n // if(oldWallPaper) {\n // console.log('rewrite', {...oldWallPaper}, {...wallPaper});\n // }\n\n if(wallPaper._ !== 'wallPaperNoFile') {\n wallPaper.document = this.appDocsManager.saveDoc(wallPaper.document, {type: 'wallPaper', wallPaperId: wallPaper.id});\n }\n\n // if(oldWallPaper) {\n // return Object.assign(oldWallPaper, wallPaper);\n // } else {\n this.wallPapers[wallPaper.id] = wallPaper;\n // }\n\n return wallPaper;\n }\n\n public getWallPaper(inputWallPaper: InputWallPaper) {\n return this.apiManager.invokeApiSingleProcess({\n method: 'account.getWallPaper',\n params: {wallpaper: inputWallPaper},\n processResult: (wallPaper) => {\n return this.saveWallPaper(wallPaper);\n }\n });\n }\n\n public getInputWallPaper(wallPaper: WallPaper | string): InputWallPaper {\n if(typeof(wallPaper) === 'string') {\n return {_: 'inputWallPaperSlug', slug: wallPaper};\n } else if(wallPaper._ === 'wallPaperNoFile') {\n return {_: 'inputWallPaperNoFile', id: wallPaper.id};\n } else {\n return {_: 'inputWallPaper', id: wallPaper.id, access_hash: wallPaper.access_hash};\n }\n }\n\n public getWallPaperById(id: WallPaperId) {\n const wallPaper = this.wallPapers[id];\n return this.getWallPaper(this.getInputWallPaper(wallPaper));\n }\n\n public getThemes() {\n return this.apiManager.invokeApiSingleProcess({\n method: 'account.getThemes',\n params: {format: 'macos', hash: 0},\n processResult: (accountThemes) => {\n assumeType(accountThemes);\n\n accountThemes.themes.forEach((theme) => {\n if(!theme.settings) {\n return;\n }\n\n theme.settings.forEach((themeSettings) => {\n themeSettings.wallpaper = this.saveWallPaper(themeSettings.wallpaper);\n });\n });\n\n return accountThemes.themes;\n }\n });\n }\n\n public getWallPapers() {\n return this.apiManager.invokeApiHashable({method: 'account.getWallPapers'}).then((accountWallpapers) => {\n const wallPapers = (accountWallpapers as AccountWallPapers.accountWallPapers).wallpapers;\n wallPapers.forEach((wallPaper, idx, arr) => {\n arr[idx] = this.saveWallPaper(wallPaper);\n });\n\n return wallPapers;\n });\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport App from '../../config/app';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\nimport callbackify from '../../helpers/callbackify';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport cryptoMessagePort from '../crypto/cryptoMessagePort';\nimport MTProtoMessagePort from '../mtproto/mtprotoMessagePort';\nimport appStateManager from './appStateManager';\nimport {AppStoragesManager} from './appStoragesManager';\nimport createManagers from './createManagers';\n\ntype Managers = Awaited>;\n\nexport class AppManagersManager {\n private managers: Managers | Promise;\n private cryptoWorkersURLs: string[];\n private cryptoPortsAttached: number;\n private cryptoPortPromise: CancellablePromise;\n\n constructor() {\n this.cryptoWorkersURLs = [];\n this.cryptoPortsAttached = 0;\n this.cryptoPortPromise = deferredPromise();\n this.cryptoPortPromise.then(() => {\n this.cryptoPortPromise = undefined;\n });\n }\n\n public start() {\n const port = MTProtoMessagePort.getInstance();\n\n port.addEventListener('manager', ({name, method, args}) => {\n return callbackify(this.getManagers(), (managers) => {\n // @ts-ignore\n const manager = managers[name];\n return manager[method].apply(manager, args);\n });\n });\n\n port.addEventListener('cryptoPort', (payload, source, event) => {\n const port = event.ports[0];\n if(this.cryptoPortsAttached >= this.cryptoWorkersURLs.length) {\n port.close();\n return;\n }\n\n ++this.cryptoPortsAttached;\n cryptoMessagePort.attachPort(port);\n this.cryptoPortPromise?.resolve();\n });\n\n port.addEventListener('createProxyWorkerURLs', ({originalUrl, blob}) => {\n let length = this.cryptoWorkersURLs.length;\n if(!length) {\n this.cryptoWorkersURLs.push(originalUrl);\n ++length;\n }\n\n const maxLength = App.cryptoWorkers;\n if(length === maxLength) {\n return this.cryptoWorkersURLs;\n }\n\n const newURLs = new Array(maxLength - length).fill(undefined).map(() => URL.createObjectURL(blob));\n this.cryptoWorkersURLs.push(...newURLs);\n return this.cryptoWorkersURLs;\n });\n }\n\n public async createManagers() {\n const appStoragesManager = new AppStoragesManager();\n\n await Promise.all([\n // new Promise(() => {}),\n appStoragesManager.loadStorages(),\n this.cryptoPortPromise\n ]);\n\n const managers = await createManagers(appStoragesManager, appStateManager.userId);\n return this.managers = managers;\n }\n\n public getManagers() {\n return this.managers ??= this.createManagers();\n }\n}\n\nconst appManagersManager = new AppManagersManager();\nMOUNT_CLASS_TO && (MOUNT_CLASS_TO.appManagersManager = appManagersManager);\nexport default appManagersManager;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {PasswordManager} from '../mtproto/passwordManager';\nimport {ReferenceDatabase} from '../mtproto/referenceDatabase';\nimport DialogsStorage from '../storages/dialogs';\nimport FiltersStorage from '../storages/filters';\nimport {ApiUpdatesManager} from './apiUpdatesManager';\nimport {AppAvatarsManager} from './appAvatarsManager';\nimport {AppCallsManager} from './appCallsManager';\nimport {AppChatsManager} from './appChatsManager';\nimport {AppDocsManager} from './appDocsManager';\nimport {AppDraftsManager} from './appDraftsManager';\nimport {AppEmojiManager} from './appEmojiManager';\nimport {AppGroupCallsManager} from './appGroupCallsManager';\nimport {AppInlineBotsManager} from './appInlineBotsManager';\nimport {AppMessagesIdsManager} from './appMessagesIdsManager';\nimport {AppMessagesManager} from './appMessagesManager';\nimport {AppNotificationsManager} from './appNotificationsManager';\nimport {AppPeersManager} from './appPeersManager';\nimport {AppPhotosManager} from './appPhotosManager';\nimport {AppPollsManager} from './appPollsManager';\nimport {AppPrivacyManager} from './appPrivacyManager';\nimport {AppProfileManager} from './appProfileManager';\nimport {AppReactionsManager} from './appReactionsManager';\nimport {AppStickersManager} from './appStickersManager';\nimport {AppUsersManager} from './appUsersManager';\nimport {AppWebPagesManager} from './appWebPagesManager';\nimport {ApiFileManager} from '../mtproto/apiFileManager';\nimport {ApiManager} from '../mtproto/apiManager';\nimport ctx from '../../environment/ctx';\nimport PeersStorage from '../storages/peers';\nimport ThumbsStorage from '../storages/thumbs';\nimport {NetworkerFactory} from '../mtproto/networkerFactory';\nimport {RootScope} from '../rootScope';\nimport {Authorizer} from '../mtproto/authorizer';\nimport {DcConfigurator} from '../mtproto/dcConfigurator';\nimport {TimeManager} from '../mtproto/timeManager';\nimport {AppStoragesManager} from './appStoragesManager';\nimport cryptoMessagePort from '../crypto/cryptoMessagePort';\nimport appStateManager from './appStateManager';\nimport filterUnique from '../../helpers/array/filterUnique';\nimport AppWebDocsManager from './appWebDocsManager';\nimport AppPaymentsManager from './appPaymentsManager';\nimport AppAttachMenuBotsManager from './appAttachMenuBotsManager';\nimport AppSeamlessLoginManager from './appSeamlessLoginManager';\nimport AppThemesManager from './appThemesManager';\n\nexport default function createManagers(appStoragesManager: AppStoragesManager, userId: UserId) {\n const managers = {\n appPeersManager: new AppPeersManager,\n appChatsManager: new AppChatsManager,\n appDocsManager: new AppDocsManager,\n appPhotosManager: new AppPhotosManager,\n appPollsManager: new AppPollsManager,\n appUsersManager: new AppUsersManager,\n appWebPagesManager: new AppWebPagesManager,\n appDraftsManager: new AppDraftsManager,\n appProfileManager: new AppProfileManager,\n appNotificationsManager: new AppNotificationsManager,\n apiUpdatesManager: new ApiUpdatesManager,\n appAvatarsManager: new AppAvatarsManager,\n appGroupCallsManager: new AppGroupCallsManager,\n appCallsManager: new AppCallsManager,\n appReactionsManager: new AppReactionsManager,\n appMessagesManager: new AppMessagesManager,\n appMessagesIdsManager: new AppMessagesIdsManager,\n appPrivacyManager: new AppPrivacyManager,\n appInlineBotsManager: new AppInlineBotsManager,\n appStickersManager: new AppStickersManager,\n referenceDatabase: new ReferenceDatabase,\n appEmojiManager: new AppEmojiManager,\n filtersStorage: new FiltersStorage,\n dialogsStorage: new DialogsStorage,\n apiManager: new ApiManager,\n cryptoWorker: cryptoMessagePort,\n passwordManager: new PasswordManager,\n apiFileManager: new ApiFileManager,\n peersStorage: new PeersStorage,\n thumbsStorage: new ThumbsStorage,\n networkerFactory: new NetworkerFactory,\n rootScope: new RootScope,\n authorizer: new Authorizer,\n dcConfigurator: new DcConfigurator,\n timeManager: new TimeManager,\n appStoragesManager: appStoragesManager,\n appStateManager: appStateManager,\n appWebDocsManager: new AppWebDocsManager,\n appPaymentsManager: new AppPaymentsManager,\n appAttachMenuBotsManager: new AppAttachMenuBotsManager,\n appSeamlessLoginManager: new AppSeamlessLoginManager,\n appThemesManager: new AppThemesManager\n };\n\n type T = typeof managers;\n\n for(const name in managers) {\n const manager = managers[name as keyof T];\n if(!manager) {\n continue;\n }\n\n if((manager as AppMessagesManager).setManagers) {\n (manager as AppMessagesManager).setManagers(managers as any);\n delete (manager as AppMessagesManager).setManagers;\n }\n\n // @ts-ignore\n ctx[name] = manager;\n }\n\n const promises: Array void) | void> | void>[] = [];\n let names = Object.keys(managers) as (keyof T)[];\n names.unshift('appUsersManager', 'appChatsManager', 'appNotificationsManager', 'appMessagesManager', 'dialogsStorage');\n names = filterUnique(names);\n for(const name of names) {\n const manager = managers[name];\n if((manager as any)?.after) {\n // console.log('injecting after', name);\n const result = (manager as any).after();\n promises.push(result);\n\n // if(result instanceof Promise) {\n // result.then(() => {\n // console.log('injected after', name);\n // });\n // }\n }\n }\n\n if(userId) {\n managers.apiManager.setUserAuth(userId);\n }\n\n return Promise.all(promises).then(() => managers);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// just to include\nimport '../polyfill';\nimport '../../helpers/peerIdPolyfill';\n\nimport cryptoWorker from '../crypto/cryptoMessagePort';\nimport {setEnvironment} from '../../environment/utils';\nimport appStateManager from '../appManagers/appStateManager';\nimport transportController from './transports/controller';\nimport MTProtoMessagePort from './mtprotoMessagePort';\nimport RESET_STORAGES_PROMISE from '../appManagers/utils/storages/resetStoragesPromise';\nimport appManagersManager from '../appManagers/appManagersManager';\nimport listenMessagePort from '../../helpers/listenMessagePort';\nimport {logger} from '../logger';\nimport {State} from '../../config/state';\nimport toggleStorages from '../../helpers/toggleStorages';\nimport appTabsManager from '../appManagers/appTabsManager';\nimport ServiceMessagePort from '../serviceWorker/serviceMessagePort';\nimport callbackify from '../../helpers/callbackify';\n\nlet _isServiceWorkerOnline = true;\nexport function isServiceWorkerOnline() {\n return _isServiceWorkerOnline;\n}\n\nlet serviceMessagePort: ServiceMessagePort, _serviceMessagePort: MessagePort;\nexport function getServiceMessagePort() {\n return _isServiceWorkerOnline ? serviceMessagePort : undefined;\n}\n\nconst log = logger('MTPROTO');\n// let haveState = false;\n\nconst port = new MTProtoMessagePort();\nport.addMultipleEventsListeners({\n environment: (environment) => {\n setEnvironment(environment);\n\n transportController.waitForWebSocket();\n },\n\n crypto: ({method, args}) => {\n return cryptoWorker.invokeCrypto(method as any, ...args as any);\n },\n\n state: ({state, resetStorages, pushedKeys, newVersion, oldVersion, userId}) => {\n // if(haveState) {\n // return;\n // }\n\n log('got state', state, pushedKeys);\n\n appStateManager.userId = userId;\n appStateManager.newVersion = newVersion;\n appStateManager.oldVersion = oldVersion;\n\n (Object.keys(state) as any as (keyof State)[]).forEach((key) => {\n appStateManager.pushToState(key, state[key], true, !pushedKeys.includes(key));\n });\n\n RESET_STORAGES_PROMISE.resolve(resetStorages);\n // haveState = true;\n },\n\n toggleStorages: ({enabled, clearWrite}) => {\n return toggleStorages(enabled, clearWrite);\n },\n\n event: (payload, source) => {\n log('will redirect event', payload, source);\n port.invokeExceptSource('event', payload, source);\n },\n\n serviceWorkerOnline: (online) => {\n _isServiceWorkerOnline = online;\n },\n\n serviceWorkerPort: (payload, source, event) => {\n if(serviceMessagePort) {\n serviceMessagePort.detachPort(_serviceMessagePort);\n _serviceMessagePort = undefined;\n } else {\n serviceMessagePort = new ServiceMessagePort();\n serviceMessagePort.addMultipleEventsListeners({\n requestFilePart: (payload) => {\n return callbackify(appManagersManager.getManagers(), (managers) => {\n const {docId, dcId, offset, limit} = payload;\n return managers.appDocsManager.requestDocPart(docId, dcId, offset, limit);\n });\n }\n });\n }\n\n // * port can be undefined in the future\n if(_serviceMessagePort = event.ports[0]) {\n serviceMessagePort.attachPort(_serviceMessagePort);\n }\n },\n\n createObjectURL: (blob) => {\n return URL.createObjectURL(blob);\n }\n\n // socketProxy: (task) => {\n // const socketTask = task.payload;\n // const id = socketTask.id;\n\n // const socketProxied = socketsProxied.get(id);\n // if(socketTask.type === 'message') {\n // socketProxied.dispatchEvent('message', socketTask.payload);\n // } else if(socketTask.type === 'open') {\n // socketProxied.dispatchEvent('open');\n // } else if(socketTask.type === 'close') {\n // socketProxied.dispatchEvent('close');\n // socketsProxied.delete(id);\n // }\n // },\n});\n\nlog('MTProto start');\n\nappManagersManager.start();\nappManagersManager.getManagers();\nappTabsManager.start();\n\n// let sentHello = false;\nlistenMessagePort(port, (source) => {\n appTabsManager.addTab(source);\n\n // port.invokeVoid('hello', undefined, source);\n // if(!sentHello) {\n // port.invokeVoid('hello', undefined, source);\n // sentHello = true;\n // }\n}, (source) => {\n appTabsManager.deleteTab(source);\n});\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type SuperMessagePort from '../lib/mtproto/superMessagePort';\nimport ctx from '../environment/ctx';\n\nexport default function listenMessagePort(\n messagePort: SuperMessagePort,\n onConnect?: (source: MessageEventSource) => void,\n onDisconnect?: (source: MessageEventSource) => void\n) {\n const attachPort = (listenPort: any, sendPort: any) => {\n messagePort.attachListenPort(listenPort);\n sendPort && messagePort.attachSendPort(sendPort);\n onConnect?.(listenPort);\n };\n\n messagePort.setOnPortDisconnect(onDisconnect);\n\n if(typeof(SharedWorkerGlobalScope) !== 'undefined') {\n (ctx as any as SharedWorkerGlobalScope).addEventListener('connect', (e) => attachPort(e.source, e.source));\n } else if(typeof(ServiceWorkerGlobalScope) !== 'undefined') {\n attachPort(ctx, null);\n } else {\n attachPort(ctx, ctx);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {MyDialogFilter} from '../storages/filters';\n\n/**\n * Legacy Webogram's format, don't change dcID to camelCase. date is timestamp\n */\nexport type UserAuth = {dcID: number | string, date: number, id: PeerId};\nexport type REAL_FOLDER_ID = 0 | 1;\n\nexport const NULL_PEER_ID: PeerId = 0;\nexport const REPLIES_PEER_ID: PeerId = 1271266957;\nexport const REPLIES_HIDDEN_CHANNEL_ID: ChatId = 777;\nexport const SERVICE_PEER_ID: PeerId = 777000;\nexport const MUTE_UNTIL = 0x7FFFFFFF;\nexport const BOT_START_PARAM = '';\nexport const MAX_FILE_SAVE_SIZE = 20 * 1024 * 1024;\nexport const THUMB_TYPE_FULL = '';\nexport const TOPIC_COLORS = [0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, 0xFB6F5F];\nexport const ATTACH_MENU_BOT_ICON_NAME = 'default_static';\nexport const GENERAL_TOPIC_ID = 4295032831;\nexport const T_ME_PREFIXES = new Set(['web', 'k', 'z']);\n\nexport const FOLDER_ID_ALL: REAL_FOLDER_ID = 0;\nexport const FOLDER_ID_ARCHIVE: REAL_FOLDER_ID = 1;\nexport const REAL_FOLDERS: Set = new Set([FOLDER_ID_ALL, FOLDER_ID_ARCHIVE]);\nexport const START_LOCAL_ID = Math.max(...Array.from(REAL_FOLDERS)) + 1 as MyDialogFilter['localId'];\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport emojiRegExp from '../../vendor/emoji/regex';\nimport {MessageEntity} from '../../layer';\n\nconst EmojiHelper = {\n emojiMap: (code: string) => { return code; },\n shortcuts: [] as any,\n emojis: [] as any\n};\n\nexport const ALPHA_CHARS_REG_EXP = 'a-z' +\n '\\\\u00c0-\\\\u00d6\\\\u00d8-\\\\u00f6\\\\u00f8-\\\\u00ff' + // Latin-1\n '\\\\u0100-\\\\u024f' + // Latin Extended A and B\n '\\\\u0253\\\\u0254\\\\u0256\\\\u0257\\\\u0259\\\\u025b\\\\u0263\\\\u0268\\\\u026f\\\\u0272\\\\u0289\\\\u028b' + // IPA Extensions\n '\\\\u02bb' + // Hawaiian\n '\\\\u0300-\\\\u036f' + // Combining diacritics\n '\\\\u1e00-\\\\u1eff' + // Latin Extended Additional (mostly for Vietnamese)\n '\\\\u0400-\\\\u04ff\\\\u0500-\\\\u0527' + // Cyrillic\n '\\\\u2de0-\\\\u2dff\\\\ua640-\\\\ua69f' + // Cyrillic Extended A/B\n '\\\\u0591-\\\\u05bf\\\\u05c1-\\\\u05c2\\\\u05c4-\\\\u05c5\\\\u05c7' +\n '\\\\u05d0-\\\\u05ea\\\\u05f0-\\\\u05f4' + // Hebrew\n '\\\\ufb1d-\\\\ufb28\\\\ufb2a-\\\\ufb36\\\\ufb38-\\\\ufb3c\\\\ufb3e\\\\ufb40-\\\\ufb41' +\n '\\\\ufb43-\\\\ufb44\\\\ufb46-\\\\ufb4f' + // Hebrew Pres. Forms\n '\\\\u0610-\\\\u061a\\\\u0620-\\\\u065f\\\\u066e-\\\\u06d3\\\\u06d5-\\\\u06dc' +\n '\\\\u06de-\\\\u06e8\\\\u06ea-\\\\u06ef\\\\u06fa-\\\\u06fc\\\\u06ff' + // Arabic\n '\\\\u0750-\\\\u077f\\\\u08a0\\\\u08a2-\\\\u08ac\\\\u08e4-\\\\u08fe' + // Arabic Supplement and Extended A\n '\\\\ufb50-\\\\ufbb1\\\\ufbd3-\\\\ufd3d\\\\ufd50-\\\\ufd8f\\\\ufd92-\\\\ufdc7\\\\ufdf0-\\\\ufdfb' + // Pres. Forms A\n '\\\\ufe70-\\\\ufe74\\\\ufe76-\\\\ufefc' + // Pres. Forms B\n '\\\\u200c' + // Zero-Width Non-Joiner\n '\\\\u0e01-\\\\u0e3a\\\\u0e40-\\\\u0e4e' + // Thai\n '\\\\u1100-\\\\u11ff\\\\u3130-\\\\u3185\\\\uA960-\\\\uA97F\\\\uAC00-\\\\uD7AF\\\\uD7B0-\\\\uD7FF' + // Hangul (Korean)\n '\\\\u3003\\\\u3005\\\\u303b' + // Kanji/Han iteration marks\n '\\\\uff21-\\\\uff3a\\\\uff41-\\\\uff5a' + // full width Alphabet\n '\\\\uff66-\\\\uff9f' + // half width Katakana\n '\\\\uffa1-\\\\uffdc'; // half width Hangul (Korean)\nexport const ALPHA_NUMERIC_REG_EXP = '0-9\\_' + ALPHA_CHARS_REG_EXP;\nexport const DOMAIN_ADD_CHARS = '\\u00b7';\n// Based on Regular Expression for URL validation by Diego Perini\nexport const URL_ALPHANUMERIC_REG_EXP_PART = '[' + ALPHA_CHARS_REG_EXP + '0-9]';\nexport const URL_PROTOCOL_REG_EXP_PART = '((?:https?|ftp)://|mailto:)?';\nexport const URL_REG_EXP = URL_PROTOCOL_REG_EXP_PART +\n // user:pass authentication\n '(?:' + URL_ALPHANUMERIC_REG_EXP_PART + '{1,64}(?::' + URL_ALPHANUMERIC_REG_EXP_PART + '{0,64})?@)?' +\n '(?:' +\n // sindresorhus/ip-regexp\n '(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}' +\n '|' +\n // host name\n URL_ALPHANUMERIC_REG_EXP_PART + '[' + ALPHA_CHARS_REG_EXP + DOMAIN_ADD_CHARS + '0-9\\-]{0,64}' +\n // domain name\n '(?:\\\\.' + URL_ALPHANUMERIC_REG_EXP_PART + '[' + ALPHA_CHARS_REG_EXP + DOMAIN_ADD_CHARS + '0-9\\-]{0,64}){0,10}' +\n // TLD identifier\n '(?:\\\\.(xn--[0-9a-z]{2,16}|[' + ALPHA_CHARS_REG_EXP + ']{2,24}))' +\n ')' +\n // port number\n '(?::\\\\d{2,5})?' +\n // resource path\n '(?:/(?:\\\\S{0,255}[^\\\\s.;,(\\\\[\\\\]{}<>\"\\'])?)?';\nexport const URL_PROTOCOL_REG_EXP = new RegExp('^' + URL_PROTOCOL_REG_EXP_PART.slice(0, -1), 'i');\nexport const URL_ANY_PROTOCOL_REG_EXP = /^((?:[^\\/]+?):\\/\\/|mailto:)/;\nexport const USERNAME_REG_EXP = '[a-zA-Z\\\\d_]{5,32}';\nexport const TIMESTAMP_REG_EXP = '(?:\\\\s|^)((?:\\\\d{1,2}:)?(?:[0-5]?[0-9]):(?:[0-5][0-9]))(?:\\\\s|$)';\nexport const BOT_COMMAND_REG_EXP = '\\\\/([a-zA-Z\\\\d_]{1,32})(?:@(' + USERNAME_REG_EXP + '))?(\\\\b|$)';\nexport const FULL_REG_EXP = new RegExp('(^| )(@)(' + USERNAME_REG_EXP + ')|(' + URL_REG_EXP + ')|(\\\\n)|(' + emojiRegExp + ')|(^|[\\\\s\\\\(\\\\]])(#[' + ALPHA_NUMERIC_REG_EXP + ']{2,64})|(^|\\\\s)' + BOT_COMMAND_REG_EXP + '|' + TIMESTAMP_REG_EXP + '', 'i');\nexport const EMAIL_REG_EXP = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n// const markdownTestRegExp = /[`_*@~]/;\nexport const MARKDOWN_REG_EXP = /(^|\\s|\\n)(````?)([\\s\\S]+?)(````?)([\\s\\n\\.,:?!;]|$)|(^|\\s|\\x01)(`|~~|\\*\\*|__|_-_|\\|\\|)([^\\n]+?)\\7([\\x01\\s\\.,:?!;]|$)|@(\\d+)\\s*\\((.+?)\\)|(\\[(.+?)\\]\\((.+?)\\))/m;\nexport const SITE_HASHTAGS: {[siteName: string]: string} = {\n 'Telegram': 'tg://search_hashtag?hashtag={1}',\n 'Twitter': 'https://twitter.com/hashtag/{1}',\n 'Instagram': 'https://instagram.com/explore/tags/{1}/',\n 'Google Plus': 'https://plus.google.com/explore/{1}'\n};\n\n// export const SITE_MENTIONS: {[siteName in 'Telegram' | 'Twitter' | 'Instagram' | 'GitHub']: string} = {\n// Telegram: '#{1}',\n// Twitter: 'https://twitter.com/{1}',\n// Instagram: 'https://instagram.com/{1}/',\n// GitHub: 'https://github.com/{1}'\n// };\n\nexport const MARKDOWN_ENTITIES: {[markdown: string]: MessageEntity['_']} = {\n '`': 'messageEntityCode',\n '``': 'messageEntityPre',\n '**': 'messageEntityBold',\n '__': 'messageEntityItalic',\n '~~': 'messageEntityStrike',\n '_-_': 'messageEntityUnderline',\n '||': 'messageEntitySpoiler'\n};\n\nexport const MARKDOWN_ENTITIES_TYPES = new Set(Object.values(MARKDOWN_ENTITIES));\n\nexport const PASS_CONFLICTING_ENTITIES: Set = new Set([\n 'messageEntityEmoji',\n 'messageEntityLinebreak',\n 'messageEntityCaret'\n]);\nfor(const i in MARKDOWN_ENTITIES) {\n PASS_CONFLICTING_ENTITIES.add(MARKDOWN_ENTITIES[i]);\n}\n\nexport const PHONE_NUMBER_REG_EXP = /^\\+\\d+$/;\n\n/* export function parseEmojis(text: string) {\n return text.replace(/:([a-z0-9\\-\\+\\*_]+?):/gi, function (all, shortcut) {\n var emojiCode = EmojiHelper.shortcuts[shortcut]\n if (emojiCode !== undefined) {\n return EmojiHelper.emojis[emojiCode][0]\n }\n return all\n })\n} */\n\n\n/* export function replaceUrlEncodings(urlWithEncoded: string) {\n return urlWithEncoded.replace(/(%[A-Z\\d]{2})+/g, (str) => {\n try {\n return decodeURIComponent(str);\n } catch (e) {\n return str;\n }\n });\n} */\n","// https://github.com/twitter/twemoji-parser/blob/master/src/lib/regex.js\n\nexport function encodeEmoji(emojiText: string) {\n const codepoints = toCodePoints(removeVS16s(emojiText)).join('-');\n return codepoints;\n}\n\nconst vs16RegExp = /\\uFE0F/g;\n// avoid using a string literal like '\\u200D' here because minifiers expand it inline\nconst zeroWidthJoiner = String.fromCharCode(0x200d);\n\nconst removeVS16s = (rawEmoji: string) => (rawEmoji.indexOf(zeroWidthJoiner) < 0 ? rawEmoji.replace(vs16RegExp, '') : rawEmoji);\n\nexport function toCodePoints(unicodeSurrogates: string): Array {\n const points = [];\n let char = 0;\n let previous = 0;\n let i = 0;\n while(i < unicodeSurrogates.length) {\n char = unicodeSurrogates.charCodeAt(i++);\n if(previous) {\n points.push((0x10000 + ((previous - 0xd800) << 10) + (char - 0xdc00)).toString(16));\n previous = 0;\n } else if(char > 0xd800 && char <= 0xdbff) {\n previous = char;\n } else {\n points.push(char.toString(16));\n }\n }\n\n if(points.length && points[0].length === 2) {\n points[0] = '00' + points[0];\n }\n\n return points;\n}\n\nexport function getEmojiToneIndex(input: string) {\n const match = input.match(/[\\uDFFB-\\uDFFF]/);\n return match ? 5 - (57343 - match[0].charCodeAt(0)) : 0;\n}\n\nconst VIRTUAL_COUNTRIES_EMOJIS: Map = new Map([\n ['FT', '🏴‍☠']\n]);\n\nexport function getCountryEmoji(iso2: string) {\n return VIRTUAL_COUNTRIES_EMOJIS.get(iso2) ??\n String.fromCharCode(55356, 56741 + iso2.charCodeAt(0), 55356, 56741 + iso2.charCodeAt(1));\n}\n\nexport function emojiFromCodePoints(codePoints: string) {\n return codePoints.split('-').reduce((prev, curr) => prev + String.fromCodePoint(parseInt(curr, 16)), '');\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [699,211,147,85,110], () => (__webpack_require__(9092)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames not based on template\n\tif (chunkId === 85) return \"85.887945ef5f43bc205112.bundle.js\";\n\tif (chunkId === 110) return \"110.109af56006a419549840.bundle.js\";\n\t// return url for filenames based on template\n\treturn \"\" + ({\"211\":\"npm.big-integer\",\"699\":\"npm.pako\"}[chunkId] || chunkId) + \".\" + {\"8\":\"93d2f33af815eb0455aa\",\"104\":\"be090b1ee184fa23f913\",\"147\":\"52e5e3f41bb7eb15ae10\",\"211\":\"363d763daad0ee4e2741\",\"301\":\"95838a8203f23dd1ce8f\",\"642\":\"be93122d1116ecdc9322\",\"699\":\"89deb457201f16c93925\"}[chunkId] + \".chunk.js\";\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","(() => {\n if (typeof __webpack_require__ !== 'undefined') {\n var oldGetScript = __webpack_require__.u;\n var oldLoadScript = __webpack_require__.e;\n var queryMap = {};\n var countMap = {};\n var getRetryDelay = function () {\n return 3000;\n };\n __webpack_require__.u = function (chunkId) {\n var result = oldGetScript(chunkId);\n return (\n result +\n (queryMap.hasOwnProperty(chunkId) ? '?' + queryMap[chunkId] : '')\n );\n };\n __webpack_require__.e = function (chunkId) {\n var result = oldLoadScript(chunkId);\n return result.catch(function (error) {\n var retries = countMap.hasOwnProperty(chunkId)\n ? countMap[chunkId]\n : 999999;\n if (retries < 1) {\n var realSrc = oldGetScript(chunkId);\n error.message =\n 'Loading chunk ' +\n chunkId +\n ' failed after 999999 retries.\\n(' +\n realSrc +\n ')';\n error.request = realSrc;\n throw error;\n }\n return new Promise(function (resolve) {\n var retryAttempt = 999999 - retries + 1;\n setTimeout(function () {\n var retryAttemptString = '&retry-attempt=' + retryAttempt;\n var cacheBust = (function () {\n return Date.now();\n })();\n +retryAttemptString;\n queryMap[chunkId] = cacheBust;\n countMap[chunkId] = retries - 1;\n resolve(__webpack_require__.e(chunkId));\n }, getRetryDelay(retryAttempt));\n });\n });\n };\n }\n})();\n","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t678: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = this[\"webpackChunktweb\"] = this[\"webpackChunktweb\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","next","DEBUG","MOUNT_CLASS_TO","window","self","EmojiVersions","Emoji","version","Object","assign","USER_AGENT","navigator","userAgent","IS_SAFARI","search","toLowerCase","indexOf","test","vendor","platform","maxTouchPoints","match","IS_FIREFOX","undefined","badCharsRe","trimRe","C2L","cleanSearchText","text","latinize","processSearchText","clearBadChars","ignoreCase","options","hasTag","includeTag","charAt","originalText","replace","clearBadCharsAndTrim","ch","latinizeCh","latinizeString","fixCyrillic","FILENAME_JOINER","getFileNameByLocation","location","ext","length","str","_","id","thumb_size","filter","Boolean","join","photo_id","pFlags","big","stickerset","short_name","emoticon","thumb_version","volume_id","local_id","url","console","error","downloadId","getFileURL","type","encodeURIComponent","JSON","stringify","platforms","Set","ignore","getRestrictionReason","reasons","find","reason","has","isRestricted","ignoreRestrictionReasons","clear","forEach","add","getPeerId","peerId","isPeerId","userId","user_id","toPeerId","chatId","channel_id","chat_id","isUser","peerParams","substr","split","IDB","constructor","db","this","name","storageIsAvailable","log","openDatabase","INSTANCES","push","isAvailable","createNew","openDbPromise","createIndexes","os","store","indexNames","Array","from","indexName","deleteIndex","indexes","index","contains","createIndex","keyPath","objectParameters","request","indexedDB","open","Promise","reject","message","finished","setTimeout","onerror","resolve","onsuccess","event","result","calledNew","onclose","e","onabort","transaction","target","close","onversionchange","onupgradeneeded","warn","oldVersion","newVersion","stores","objectStoreNames","objectStore","createObjectStore","static","instance","preserve","storage","IDBStorage","storeName","idb","create","delete","entryName","isArray","concat","getObjectStore","promises","map","save","value","idx","put","get","mode","callback","perf","performance","now","then","onError","clearTimeout","timeout","onComplete","results","requests","r","waitForTransactionComplete","oncomplete","callbackResult","left","onRequestFinished","i","getAll","environment","getEnvironment","setEnvironment","env","RootScope","super","myId","connectionStatus","premium","addEventListener","isNew","isPremium","dispatchEventSingle","status","dispatchEvent","args","invokeVoid","settings","getConnectionStatus","getPremium","state","stateStorage","getState","setByKey","key","object","splitted","getDeepProperty","slice","pop","setDeepProperty","first","pushToState","direct","onlyLocal","setKeyValueToStorage","set","HTTP","dcId","logSuffix","pending","debug","logTypes","Log","logger","connected","_send","body","fetch","method","response","arrayBuffer","buffer","TextDecoder","decode","Uint8Array","setConnected","err","destroyed","destroy","send","networker","promise","releasePending","releasing","splice","pause","Socket","handleOpen","handleError","handleClose","removeListeners","handleMessage","data","byteLength","ws","connect","removeEventListener","WebSocket","binaryType","randomize","arr","crypto","Error","getRandomValues","Obfuscation","_process","operation","cryptoMessagePort","transfer","init","codec","idPromise","release","initPayload","val","val2","reversedPayload","reverse","encKey","encIv","decKey","decIv","process","obfuscateTag","encrypted","encode","payload","tag","encodePacket","len","header","readPacket","bytesToHex","bytes","toString","TcpObfuscated","Connection","retryTimeout","abridged","obfuscation","autoReconnect","onOpen","connection","setConnectionStatus","cleanupSent","resend","onMessage","parseResponse","processMessage","messageId","sessionId","catch","shift","onClose","needTimeout","retryAt","time","Date","diff","lastCloseTime","isNaN","reconnectTimeout","ctx","reconnect","bodySent","forceReconnect","setAutoReconnect","once","enable","changeUrl","encodeBody","toEncode","encoded","releasingPending","sent","TEST_SUFFIX","getTelegramConnectionSuffix","connectionType","constructTelegramWebSocketUrl","suffix","path","DcConfigurator","sslSubdomains","dcOptions","host","port","chosenServers","transportSocket","chosenServer","oooohLetMeLive","transportHTTP","dcOption","chooseServer","transportType","reuse","hasOwnProperty","client","download","upload","servers","transports","transport","obj","indexOfAndSplice","MTTransportController","opened","Map","waitForWebSocket","pingTransports","dcConfigurator","https","websocket","httpPromise","websocketPromise","socket","isFulfilled","isRejected","isHttpAvailable","isWebSocketAvailable","all","pinging","setTransportValue","setTransportOpened","setTransportClosed","AppManager","setManagers","managers","loadStorages","storages","recordPromise","storagesKeys","keys","storagesPromises","storagesResults","resetStorages","size","loadStoragesInner","AppStoragesManager","names","createStorages","loadStorage","PasswordManager","apiManager","invokeApi","updateSettings","currentHashPromise","newHashPromise","params","password","new_settings","hint","email","currentPassword","cryptoWorker","invokeCrypto","newAlgo","new_algo","salt1","newPassword","hashes","new_password_hash","getInputCheckPassword","check","inputCheckPassword","auth","setUser","user","confirmPasswordEmail","code","resendPasswordEmail","cancelPasswordEmail","ReferenceDatabase","contexts","links","saveContext","reference","context","getContexts","_context","deepEqual","getReferenceByLink","getContext","values","deleteContext","refreshReference","c","appMessagesManager","reloadMessages","refreshEmojiesSoundsPromise","appStickersManager","getAnimatedEmojiSounds","appProfileManager","getProfile","appEmojiManager","getCustomEmojiDocuments","docId","appAttachMenuBotsManager","getAttachMenuBot","botId","appThemesManager","getWallPaperById","wallPaperId","hex","newHex","newContext","makeError","safeReplaceObject","wasObject","newObject","getPeerIdsFromMessage","peerIds","fromId","viaBotId","fwdFromId","media","contactUserId","recentVoters","recent_voters","recentReactions","recent_reactions","reaction","peer_id","action","userIds","users","inviter_id","chatIds","recentRepliers","recent_repliers","reply","setDialogIndex","dialog","indexKey","GLOBAL_FOLDER_ID","DialogsStorage","allDialogsLoaded","pinnedOrders","folderId","saveAllDialogsLoaded","resetPinnedOrder","savePinnedOrders","forumTopics","folders","dialogsOffsetDate","dialogsNum","dialogsIndex","cachedResults","query","count","dialogs","onUpdateFolderPeers","update","folder_peers","folderPeer","folder_id","peer","appPeersManager","dropDialog","pinned","handleDialogUnpinning","generateIndexForDialog","pushDialog","scheduleHandleNewDialogs","onUpdateDialogPinned","getDialogOnly","handleDialogTogglePinned","onUpdateChannelPinnedTopic","topicId","generateMessageId","topic_id","topic","getForumTopic","getFilterIdForForum","onUpdatePinnedDialogs","order","handleDialogsPinned","dialogsResult","applyDialogs","d","onUpdateChannelPinnedTopics","filterId","limit","getLimit","channel","appChatsManager","getChannelInput","toChatId","offset_date","offset_id","offset_topic","processTopics","topics","after","rootScope","appUsersManager","getSelf","peerText","getPeerSearchText","indexObject","onFilterUpdate","getCachedDialogs","processDialogForFilter","processDialogForFilters","getDialogIndexKeyByFilterId","processChangedUnreadOrUnmuted","chat","getChat","dropDialogOnDeletion","enabled","flushForumTopicsCache","apiUpdatesManager","addMultipleEventsListeners","updateFolderPeers","updateDialogPinned","updateChannelPinnedTopic","updatePinnedDialogs","updateChannelPinnedTopics","appStateManager","appStoragesManager","getCache","_order","getPinnedOrders","setDialogsFromState","bind","appDraftsManager","addMissedDialogs","top_message","getServerMessageId","topMessage","saveMessages","saveDialog","ignoreOffsetDate","getMessageByPeer","reloadConversation","isDialogsLoaded","setDialogsLoaded","loaded","isForum","isFilterIdForForum","defineNotNumerableProperties","every","orders","isDialogPinned","filtersStorage","getFilter","isPinned","pinnedPeerIds","getOffsetDate","offsetDate","Math","min","sort","a","b","generateFolder","folder","unreadMessagesCount","unreadPeerIds","unreadUnmutedPeerIds","getFolder","forumTopic","getDialogKey","isTopic","getFolderDialogs","skipMigrated","hidden","migratedTo","getNextDialog","currentPeerId","findIndex","getDialogIndexKey","localId","isDialogUnmuted","appNotificationsManager","isPeerLocalMuted","respectType","threadId","getFolderUnreadCount","unreadUnmutedCount","unreadCount","arrays","setDialogIndexInFilter","isRealFolder","testDialogForFilter","pinnedIds","pinnedKey","pinnedIndex","generateDialogIndex","generateDialogPinnedDateByIndex","getDialogIndex","getDialog","verify","skipped","getDialogOrTopic","isObject","date","tsNow","timeManager","getServerTimeOffset","noIndex","filters","getFilters","cmp","wasIndex","wasDialog","wasDialogIndex","newDialogIndex","prepareFolderUnreadCountModifyingByDialog","insertInDescendSortedArray","prepareDialogUnreadCountModifying","toggle","callbacks","wasUnreadCount","getDialogUnreadCount","wasUnmuted","newUnreadCount","newUnmuted","addMessagesCount","modifyFolderUnreadCount","toggleDialog","toggleUnmuted","forumUnreadCount","getForumUnreadCount","hasUnmuted","some","max","dispatchUnreadTimeout","_folder","justReturn","noPinnedOrderUpdate","topDate","generateDialogPinnedDate","channelId","isChannel","draft","dialogKey","unshift","setDialogToState","pts","historyStorage","getHistoryStorage","messagesStorage","getHistoryMessagesStorage","history","incomingMessage","mid","getMessageFromStorage","is_outgoing","peersStorage","requestPeersForKey","isAnyChat","newPts","getChannelState","requestPeer","saveGlobalOffset","getForumTopicsCache","getDialogOffsetDate","savedGlobalOffsetDate","savedOffsetDate","dropDialogFromFolders","foundDialog","wasPinned","keepLocal","clearDialogFromState","releasePeer","dropDialogWithEvent","dropped","items","forEachReverse","assumeType","saveApiUsers","saveApiChats","chats","messages","updatedDialogs","topMid","topPendingMid","pendingTopMsgs","topPendingMessage","maxId","cache","getUpdateCache","getUpdateAfterReloadKey","updates","newUpdatesAfterReloadToHandle","saveUpdate","canSaveDialogByPeerId","isDialog","wasDialogBefore","wasTopMessage","generateTempMessageId","from_id","getOutputPeer","deleted","out","isOutgoing","migrated_to","deactivated","migratedToPeer","migratedFromTo","migratedToFrom","read_inbox_max_id","read_outbox_max_id","saveDraft","isOut","unread","unread_count","isEnd","insertSlice","setEnd","mergeReplyKeyboard","readMaxId","readOutboxMaxId","savePeerSettings","notify_settings","addChannelState","releaseUnreadCount","dialogsStorage","processTopicUpdate","oldTopic","isIconChanged","icon_emoji_id","isTitleChanged","title","isChanged","getDialogs","offsetIndex","fillContactsResult","fillContacts","cached","reloadMissingDialogsPromise","reloadMissingPeerIds","realFolderId","curDialogStorage","d1","d2","offset","loadedAll","isEnoughDialogs","isTopEnd","getTopMessages","deletedTopics","getTopicPromises","getForumTopicById","getTopicsPromise","ids","fullfillLeft","messagesForumTopics","getForumTopicOrReload","callbackify","processTopicsPromise","f","reduce","acc","v","newPinned","convertment","PREPENDED_FILTERS","LOCAL_FILTER","flags","exclude_peers","include_peers","pinned_peers","excludePeerIds","includePeerIds","FiltersStorage","filtersArr","reloadedPeerIds","localFilters","generateLocalFilter","clearFilters","onUpdateDialogFilter","saveDialogFilter","findAndSplice","onUpdateDialogFilters","oldFilters","copy","getDialogFilters","_filterId","onUpdateDialogFilterOrder","includes","setLocalId","updateDialogFilter","updateDialogFilters","updateDialogFilterOrder","prependFilters","allChatsFilter","archiveFilter","allChatsFilterIndex","exclude_archived","exclude_unarchived","exclude_read","isDialogUnread","exclude_muted","unread_mentions_count","broadcasts","isBroadcast","groups","isAnyGroup","toUserId","isBot","bots","non_contacts","isContact","contacts","testDialogForFilterId","toggleDialogPin","getConfig","pinned_infolder_count_max","getInputPeerById","createDialogFilter","prepend","remove","getOutputDialogFilter","bool","updateDialogFiltersOrder","filterIncludedPinnedPeers","peers","reloadDialogs","inputPeer","isAlreadyReloaded","reloadPromises","missingPeerIds","overwrite","invokeApiSingle","getSuggestedDialogsFilters","silent","to","oldFilter","_filter","isFilterIdAvailable","applyMixins","derivedCtor","constructors","baseCtor","getOwnPropertyNames","prototype","getOwnPropertyDescriptor","defineProperty","ApiUpdatesManager","updatesState","pendingPtsUpdates","pendingSeqUpdates","syncPending","syncLoading","channelStates","attached","subscriptions","processUpdateMessage","updateMessage","processOpts","seq","seqStart","seq_start","forceGetDifference","processUpdate","toId","fwd_from","reply_to","entities","pts_count","override","_constructor","setProxy","Proxy","saveUpdatesState","us","popPendingSeqUpdate","nextSeq","pendingUpdatesData","seqAwaiting","ptsAwaiting","clearStatePendingSync","popPendingPtsUpdate","curState","curPts","goodPts","goodIndex","getDifference","processLocalUpdate","wasSyncing","pts_total_limit","qts","differenceResult","other_updates","new_messages","apiMessage","nextState","intermediate_state","onDifferenceTooLong","justAName","getChannelDifference","channelState","bindPrefix","lastDifferenceTime","final","lastPtsUpdateTime","fwdHeader","hasUser","post","hasChat","popPts","popSeq","subscribeToChannelUpdates","subscription","cb","interval","unsubscribeFromChannelUpdates","force","clearInterval","attach","langCode","noErrorBox","stateResult","setUpdatesProcessor","strs","en","ru","getChangelog","lang","res","ok","langStr","parseMarkdown","inbox_date","languages","filterUnique","language","AppAvatarsManager","savedAvatarURLs","removeFromAvatarsCache","isAvatarCached","saved","loadAvatar","photo","peerPhotoFileLocation","downloadOptions","dc_id","limitPart","apiFileManager","blob","URL","createObjectURL","AppCallsManager","calls","IS_CALL_SUPPORTED","updatePhoneCall","saveCall","phone_call","updatePhoneCallSignalingData","callId","phone_call_id","computeKey","g_b","p","call","isDiscarded","oldCall","getCall","getCallInput","access_hash","savePhonePhoneCall","phonePhoneCall","generateDh","random_length","dhConfig","requestCall","protocol","g_a_hash","video","getUserInput","random_id","discardCall","duration","connection_id","AppChatsManager","isPeerNeeded","modifyUsernamesCache","onChatUpdated","onUpdateChannelParticipant","clearCache","onUpdateChatDefaultBannedRights","default_banned_rights","updateChannelParticipant","updateChatDefaultBannedRights","getFromCache","apiChats","saveApiChat","oldChat","participants_count","changedUsername","setUsernameToCache","oldPhotoId","newPhotoId","toggledForum","forum","changedPhoto","changedTitle","changedAnyBadge","verified","scam","fake","hasRights","rights","isThread","editChatDefaultBannedRights","banned_rights","until_date","isMegagroup","megagroup","isInChat","good","getInputPeer","getChannelInputPeer","getChatInputPeer","allowMin","getChatString","createChannel","inviteToChannel","input","usersInputs","u","createChat","leaveChannel","joinChannel","addChatUser","fwdLimit","fwd_limit","deleteChatUser","leaveChat","leave","deleteChannel","deleteChat","migrateChat","updateUsername","username","doNotRefresh","refreshChatAfterRequest","editPhoto","inputFile","inputChatPhoto","file","editTitle","editAbout","about","editBanned","participant","getParticipantPeerId","wasChannel","timestamp","actor_id","prev_participant","new_participant","kicked_by","clearChannelParticipantBannedRights","kickFromChannel","view_messages","kickFromChat","resolveChannel","messagesChats","togglePreHistoryHidden","toggleSignatures","toggleNoForwards","setChatAvailableReactions","reactions","chatFull","getCachedFullChat","available_reactions","getSendAs","invokeApiSingleProcess","processResult","sendAsPeers","importChatInvite","hash","checkUsername","getSponsoredMessage","invokeApiCacheable","cacheSeconds","sponsoredMessages","sponsoredMessage","viewSponsoredMessage","randomId","checkChatInvite","chatInvite","toggleUsername","active","reorderUsernames","deactivateAllUsernames","makeChannelPrivate","getChannels","toggleForum","editForumTopic","iconEmojiId","closed","createForumTopic","iconColor","channelFull","getChannelFull","sendAsInputPeer","default_send_as","icon_color","send_as","updatePinnedForumTopic","wrapUrl","unsafe","matchUrlProtocol","tgMeMatch","telescoPeMatch","tgMatch","onclick","prefix","pathname","fullPath","I18n","pluralRules","cacheLangPackPromise","setLangCode","lastRequestedLangCode","lastRequestedNormalizedLangCode","updateAmPm","timeFormat","dateTimeFormat","getDateTimeFormat","hour","minute","hour12","setHours","amText","format","amPmCache","am","pmText","pm","loadLocalLangPack","defaultCode","langSign","countries","strings","formatLocalStrings","default","saveLangPack","from_version","lang_code","local","loadLangPack","web","requestedServerLanguage","lang_pack","polyfillPromise","pushTo","langPack","appVersion","applyLangPack","currentLangCode","Intl","PluralRules","string","countriesList","country","langPackKey","default_name","lastAppliedLangCode","cachedDateTimeFormats","document","querySelectorAll","element","weakMap","superFormatter","indexHolder","lastIndex","p1","p2","p3","p4","createElement","append","lastIndexOf","wrappedUrl","href","setAttribute","DocumentFragment","firstChild","textContent","formatted","arg","pushNextArgument","plain","select","item","Node","isRTL","setRTL","rtl","getCacheLangPack","finally","setTimeFormat","haveToUpdate","IntlDateElement","getStrings","getLangPack","langPack1","langPack2","localLangPack1","localLangPack2","l","_Intl","WeakMap","IntlElementBase","classList","property","IntlElement","safeAssign","dataset","compareAndUpdate","json","DateTimeFormat","hours","getHours","getMinutes","capitalizeFirstLetter","i18n","i18n_","_i18n","months","days","getWeekNumber","UTC","getFullYear","getMonth","getDate","dayNum","getUTCDay","setUTCDate","getUTCDate","yearStart","getUTCFullYear","ceil","getTime","today","year","day","month","weekday","minYear","yearPattern","RegExp","monthYearOrDayPattern","yearOrDayAndMonthPattern","shortDate","longDate","numberOfDaysEachMonth","createForMonthYear","dates","selectedYear","currentYear","setFullYear","minDate","setMonth","maxDate","formatterMonthYear","createForDayMonth","validDateForMonth","formatterDayMonth","formatterYearMax","formatWeekLong","getDay","q","safeReplaceArrayInObject","trim","dayOfWeek","setDate","getDayOfWeek","distance","setTime","matches","exec","g1","g2","k","g3","parseInt","k1","EXTENSION_MIME_TYPE_MAP","pdf","tgv","tgs","wav","mp3","ogg","jpeg","jpg","png","gif","webp","mp4","webm","mov","svg","MIME_TYPE_EXTENSION_MAP","uploadWallPaperTempId","AppDocsManager","onServiceWorkerFail","docs","doc","supportsStreaming","thumbsStorage","deleteCacheContext","stickerCachedThumbs","uploadingWallPapers","online","saveDoc","oldDoc","file_reference","referenceDatabase","attributes","attribute","file_name","wrapPlainText","voice","mime_type","w","h","round_message","alt","stickerEmojiRaw","stickerSetInput","thumbs","IS_WEBP_SUPPORTED","sticker","IS_WEBM_SUPPORTED","animated","mappedMimeType","joiner","monthAsNumber","noSeconds","getSeconds","leadingZero","noTime","getFullDate","isServiceWorkerOnline","getCacheContext","setCacheContextURL","thumb","getDocumentDownloadOptions","getDocumentURL","getDoc","downloadDoc","queueId","onlyCache","downloadMedia","getLottieCachedThumb","toneIndex","saveLottiePreview","width","height","saveWebPConvertedStrippedThumb","stickerThumbConverted","prepareWallPaperUpload","cacheContext","wallpaper","slug","uploadWallPaper","fileName","wallPaper","downloaded","getGifs","invokeApiHashable","gifs","requestDocPart","requestFilePart","getDocumentInputFileLocation","AppDraftsManager","drafts","updateDraftMessage","notify","getKey","getDraft","getAllDrafts","getAllDraftPromise","apiDraft","processApiDraft","isEmptyDraft","reply_to_msg_id","syncDraft","localDraft","saveOnServer","serverDraft","draftsAreEqual","draftObj","getInputEntities","no_webpage","top_msg_id","saveLocalDraft","clearAllDrafts","combined","clearDraft","emptyDraft","setDraft","EMOJI_LANG_PACK","keywords","AppEmojiManager","keywordLangPacks","indexedLangPacks","getKeywordsPromises","recent","getRecentEmojisPromises","getCustomEmojiDocumentPromises","getEmojiKeywords","storageKey","pack","validateInitObject","keywordsDifference","packKeywords","keyword","emoticons","getBothEmojiKeywords","networkerFactory","native","getRecentEmojis","indexEmojis","searchEmojis","emojis","POPULAR_EMOJI","recentEmoji","recentCustomEmoji","pushRecentEmoji","emoji","fixEmoji","docIds","document_id","documents","appDocsManager","getCachedCustomEmojiDocuments","setDebouncedGetCustomEmojiDocuments","getCustomEmojiDocumentsPromise","allIds","getCustomEmojiDocument","getCustomEmojis","getEmojiStickers","AppGroupCallsManager","groupCalls","participants","nextOffsets","updateGroupCall","saveGroupCall","updateGroupCallParticipants","groupCallId","saveApiParticipants","groupCall","getCachedParticipants","prepareToSavingNextOffset","nextOffsetsMap","nextOffset","setNextOffset","newNextOffset","saveApiParticipant","skipCounterUpdating","oldParticipant","hasLeft","muted","can_self_unmute","getGroupCall","modified","just_joined","apiParticipants","editParticipant","getGroupCallInput","getInputPeerSelf","volume","raise_hand","raiseHand","video_paused","videoPaused","video_stopped","videoStopped","presentation_paused","presentationPaused","getGroupCallFull","participants_next_offset","shouldUpdate","createGroupCall","scheduleDate","schedule_date","getGroupCallParticipants","sources","groupCallParticipants","next_offset","hangUp","discard","groupCallInput","source","join_as","joinGroupCall","isMuted","joinVideo","leaveGroupCallPresentation","getPhotoInput","getPhotoMediaInput","ttl_seconds","getMediaInput","AppInlineBotsManager","inlineResults","setHash","getGeoInput","geo","lat","long","accuracy_radius","getInlineResults","bot","geo_point","stopTime","botResults","queryId","query_id","appPhotosManager","savePhoto","generateQId","pushPopularBot","getTopPeers","topPeers","botPeerId","topPeer","rating","switchToPM","fromPeerId","startParam","startBot","checkSwitchReturn","getUser","bot_inline_placeholder","peerData","switchInlineQuery","getPeerUsername","callbackButtonClick","button","msg_id","sendInlineResult","queryAndResultIds","inlineResult","queryID","resultID","resultId","send_message","reply_markup","replyMarkup","sendText","inputMedia","messageMedia","caption","sendMessage","geoPoint","address","provider","venue_id","venue_type","phone_number","first_name","last_name","vcard","description","currency","total_amount","shipping_address_requested","start_param","sendOther","AppMessagesIdsManager","tempNum","num","splitStringByLength","maxLength","lastSliceStartIndex","arrayIndex","cut","end","part","_arrayIndex","partLength","appTabsManager","tabs","start","getTabs","tab","addTab","deleteTab","getDocumentInput","setBooleanFlag","processAfter","AppMessagesManager","pendingByRandomId","pendingByMessageId","pendingAfterMsgs","tempFinalizeCallbacks","sendSmthLazyLoadQueue","needSingleMessages","extendedMedia","maxSeenId","newDialogsToHandle","notificationsToHandle","reloadConversationsPeers","groupedTempId","typings","unreadMentions","goToNextMentionPromises","batchUpdates","middleware","clean","uploadFilePromises","messagesStorageByPeerId","groupedMessagesStorage","scheduledMessagesStorage","historiesStorage","threadsStorage","searchesStorage","pinnedMessages","threadsServiceMessagesIdsStorage","threadsToReplies","handleNewDialogs","newMaxSeenId","updateMap","processDialog","isDialogDefined","incrementMaxSeenId","handleNotifications","notificationsHandlePromise","notifyPeerToHandle","getNotifyPeerSettings","peerTypeNotifySettings","mentioned","notifyAboutMessage","fwdCount","onUpdateMessageId","onUpdateNewMessage","getMessagePeer","isLocalThreadUpdate","createMessageStorage","threadKey","getThreadKey","handleNewUpdateAfterReload","threadStorage","reply_to_peer_id","reply_to_mid","receiptMessage","checkPendingMessage","updateMessageRepliesIfNeeded","ignoreExisting","findSlice","firstSlice","forceUserOnline","handleNewMessage","inboxUnread","modifyCachedMentions","setDialogTopMessage","notifyPeer","onUpdateMessageReactions","recentReaction","previousReactions","previousRecentReactions","show_previews","peerReaction","pushBatchUpdate","batchUpdateReactions","setDialogToStateIfMessageIsTop","onUpdateDialogUnreadMark","unread_mark","onUpdateEditMessage","oldMessage","newMessage","handleEditedMessage","isTopMessage","clear_history","dispatchEditEvent","newReactions","grouped_id","onUpdateReadHistory","max_id","read_max_id","getObjectKeysAndSort","stillUnreadCount","still_unread_count","newUnreadMentionsCount","foundAffected","repliesKey","getReadMaxIdIfUnread","messageThreadId","getMessageThreadId","setCount","threadKeyPart","onUpdateReadMessagesContents","topMsgId","mids","findPeerIdByMids","media_unread","fixDialogUnreadMentionsIfNoMessage","onUpdateChannelAvailableMessages","availableMinId","available_min_id","onUpdateDeleteMessages","threadKeys","historyUpdated","handleDeletedMessages","threadsStorages","msgs","affected","onUpdateChannel","needDialog","getPeerActiveUsernames","onUpdateChannelReload","flushStoragesByPeerId","onUpdateChannelMessageViews","views","batchUpdateViews","onUpdateServiceNotification","popup","phone","onUpdatePinnedMessages","missingMessages","werePinned","getPinnedMessagesKey","hiddenPinnedMessages","onUpdateNotifySettings","onUpdateNewScheduledMessage","isScheduled","onUpdateDeleteScheduledMessages","onUpdateMessageExtendedMedia","extended_media","onUpdateTranscribedAudio","batch","toDispatch","getMessagesFromMap","previousResults","changedResults","reactionCount","previousReactionCount","_reactionCount","reactionsEqual","chosen_order","updateMessageID","updateNewDiscussionMessage","updateNewMessage","updateNewChannelMessage","updateDialogUnreadMark","updateEditMessage","updateEditChannelMessage","updateMessageReactions","updateReadChannelDiscussionInbox","updateReadChannelDiscussionOutbox","updateReadHistoryInbox","updateReadHistoryOutbox","updateReadChannelInbox","updateReadChannelOutbox","updateChannelReadMessagesContents","updateReadMessagesContents","updateChannelAvailableMessages","updateDeleteMessages","updateDeleteChannelMessages","updateChannel","updateChannelReload","updateChannelMessageViews","updateServiceNotification","updatePinnedMessages","updatePinnedChannelMessages","updateNotifySettings","updateNewScheduledMessage","updateDeleteScheduledMessages","updateMessageExtendedMedia","updateTranscribedAudio","filterFunc","getScheduledMessagesStorage","webpage","appWebPagesManager","getCachedWebPage","drop","poll","appPollsManager","pollToMessages","startsWith","batchUpdatesDebounced","debounce","details","maxSeenMsgId","sendEntites","entity","invokeAfterMessageIsSent","tempId","callbackName","finalize","editMessage","is_scheduled","newMedia","noWebPage","handled","transcribeAudio","transcription_id","processError","replyToMsgId","MAX_LENGTH","message_length_max","webPage","getPeerMigratedTo","generateOutgoingMessage","toggleError","onMessagesSendError","sentRequestOptions","afterMessageId","sendAs","sendAsPeerId","apiPromise","invokeApiAfter","clear_draft","update_stickersets_order","updateStickersetOrder","wrapMessageEntities","beforeMessageSending","sequential","noop","sendFile","attachType","apiFileName","fileType","File","isDocument","Blob","isPhoto","IMAGE_MIME_TYPES_SUPPORTED","strippedPhotoSize","strippedBytes","actionName","isVoiceMessage","waveform","isMedia","photoSize","sizes","objectURL","VIDEO_MIME_TYPES_SUPPORTED","videoAttribute","isRoundMessage","supports_streaming","noSound","thumbCacheContext","sentDeferred","spoiler","uploadingFileName","getFileNameForUpload","uploaded","uploadPromise","load","thumbUploadPromise","cancelPendingMessage","setTyping","addNotifyListener","progress","percents","floor","done","total","notifyAll","force_file","isGroupedItem","background","ret","sendAlbum","sendFileDetails","groupId","o","invoke","multiMedia","multi_media","originalInputMedia","inputSingleMedia","inputs","sendContact","contactPeerId","getContactMediaInput","pollId","savePoll","total_voters","getPoll","getPhoto","postAuthor","getPeer","signatures","generateFromId","post_author","generateFlags","generateReplyHeader","via_bot_id","replies","generateReplies","replyToTopId","originalMessage","forum_topic","reply_to_top_id","linked_chat_id","comments","replies_pts","isAnonymousSending","generateForwardHeader","isUserHidden","from_name","userFull","getCachedFullUser","private_forward_name","channel_post","saved_from_msg_id","saved_from_peer","generateFakeAvatarMessage","Number","MAX_SAFE_INTEGER","getUploadPromise","uploadFileName","admin_rights","anonymous","pendingData","fillConversations","chatHistoryStorage","maxSeenIdIncremented","hasPrepend","noIdsDialogs","setFolderId","setMessageUnreadByDialog","folderDialogs","dialogsLength","slicedDialogs","offset_peer","offsetPeerId","forwardMessages","config","overflowMids","forwarded_count_max","dropCaptions","dropAuthor","newMids","newMessages","replyToMid","replyToMessageIdx","newReplyToMid","getStickerEffectThumb","nopremium","group","from_peer","to_peer","with_my_score","withMyScore","drop_author","drop_media_captions","generateEmptyMessage","getMessagesStorageByKey","s","getMessagesStorage","getMessageById","cantForwardDeleteMids","cantForward","cantDelete","canForward","canDeleteMessage","reloadConversationOrTopic","inputDialogPeer","getInputDialogPeerById","reloadConversationsPromise","inputDialogPeers","currentState","doFlushHistory","just_clear","revoke","affectedHistory","flushHistory","justClear","getHistory","historyResult","getTypingKey","ss","hidePinnedMessages","getPinnedMessage","getSearch","inputFilter","getPinnedMessagesCount","getPinnedMessagesMaxId","updatePinnedMessage","unpin","pm_oneside","unpinAllMessages","unpinAll","getAlbumText","getGroupsFirstMessage","minMid","getMidsByAlbum","groupedId","getMessagesByAlbum","getMidsByMessage","filterMessages","appMessagesIdsManager","saveMessage","isMessage","replyTo","overwriting","msgId","savedFromPeerId","savedFromMid","savedFrom","mediaContext","unsupported","originalDoc","messageKey","getMessageKeyForPendingWebPage","saveWebPage","appWebDocsManager","saveWebDocument","extendedMediaMedia","totalEntities","migrateFrom","migrateTo","video_sizes","appGroupCallsManager","migrateChecks","getFirstMessageToEdit","goodMessage","myPeerId","canEditMessage","apiEntities","myEntities","parseEntities","mergeEntities","reportMessages","editPeerFolders","getDialogPeer","markDialogUnread","read","fromChat","canMessageBeEdited","kind","goodMedias","edit_time_limit","getReplyKeyboard","messageReplyMarkup","lastReplyMarkup","selective","maxOutId","single_use","getSearchStorage","getSearchCounters","canCache","isPeerRestricted","func","filterMessagesByInputFilterFromStorage","_storage","filterMessagesByInputFilter","nextRate","backLimit","offset_id_offset","next_rate","foundMsgs","min_date","max_date","add_offset","min_id","offsetId","offsetMessage","offset_rate","searchResult","foundCount","subscribeRepliesThread","getDiscussionMessage","generateThreadServiceStartMessage","maxMessageId","serviceStartMessage","is_single","getThreadServiceMessageId","getMessageWithReplies","newMaxId","unsetEnd","newDialogsHandlePromise","deleteMessages","isRecursion","creator","delete_messages","serverMessageIds","affectedMessages","readHistory","triedToReadMaxId","readPromise","getPeerString","readAllHistory","getUnreadMentionsKey","slicedArray","fixUnreadMentionsCountIfNeeded","goToNextMention","loadNextPromise","loadNextMentions","last","getUnreadMentions","mergeHistoryResult","minId","messagesMessages","readMessages","msgIds","getHistoryStorageTransferable","historySerialized","toJSON","inputNotifyPeer","getInputNotifyPeerById","ignorePeerId","getNotifyPeerTypeSettings","getNotifySettings","isMessageIsTopMessage","threadMessage","broadcastEventName","pendingMessage","finalizePendingMessage","mutePeer","validatePeerSettings","muteUntil","mute_until","togglePeerMute","mute","canSendToPeer","canSendToUser","finalMessage","tempMessage","finalizePendingMessageCallbacks","newPhoto","newDoc","newPhotoSize","oldCacheContext","getPhotoDownloadOptions","thumbSize","polls","handleReleasingMessage","getMessageReactionsListAndReadParticipants","skipReadParticipants","skipReactionsList","emptyMessageReactionsList","canViewMessageReadParticipants","getMessageReadParticipants","appReactionsManager","getMessageReactionsList","messageReactionsList","readParticipantsPeerIds","filteredReadParticipants","readPeerId","reactionsCount","readParticipants","appConfig","getAppConfig","chat_read_mark_size_threshold","chat_read_mark_expire_period","incrementMessageViews","increment","chatPeerIds","idleStartTime","getScheduledMessageByPeer","getScheduledMessages","sendScheduledMessages","deleteScheduledMessages","getMessageWithCommentReplies","isFetchIntervalNeeded","getNewHistory","isBottomEnd","getEnds","offsetIdOffset","haveSlice","sliceMe","fulfilled","fillHistoryStorage","constructSlice","isHistoryResultEnd","topWasMeantToLoad","bottomWasMeantToLoad","abs","topLoaded","bottomLoaded","wasMaxId","requestHistory","deleteSlice","oldestMessage","foundSlice","_historyResult","fetchSingleMessages","fetchSingleMessagesPromise","requestPromises","getMessagesResult","getExtendedMedia","toRequest","fetchMessageReplyTo","replyToPeerId","typing","smth","deleteWebPageFromPending","updatePollToMessage","groupedStorage","albums","dispatchAlbumEdit","deletedMids","noforwards","noForwards","getElementCallback","newMap","peerIdStr","saveDefaultSendAs","convertInputKeyToKey","inputKey","AppNotificationsManager","peerSettings","notifyUsers","notifyChats","notifyBroadcasts","notifyForumTopic","checkMuteUntil","checkMuteUntilTimeout","closestMuteUntil","peerNotifySettings","typeKey","checkMuteUntilThrottled","throttle","isPeerType","notifySettings","getNotifyPeerTypePromise","getContactSignUpNotification","notifyContactsSignUp","setContactSignUpNotification","getPeerKey","getPeerMuted","getPeerLocalSettings","n","peerKey","typeNotifySettings","AppPeersManager","canPinMessage","getPeerPhoto","getUserString","getRestrictionReasonText","restriction_reason","getUserInputPeer","getUserSearchText","getDialogType","getDeleteButtonText","AppPhotosManager","photos","oldPhoto","Infinity","getUserPhotos","inputUser","photosResult","photoIds","photoId","AppPollsManager","updateMessagePoll","poll_id","saveResults","chosenIndexes","answer","chosen","getInputMediaPoll","correctAnswers","solution","solutionEntities","correct_answers","solution_entities","sendVote","optionIds","answers","option","getResults","getVotes","votesList","stopPoll","newPoll","AppPrivacyManager","privacy","updatePrivacy","rules","setPrivacy","privacyRules","inputRule","rule","getPrivacy","privacyKey","getGlobalPrivacySettings","setGlobalPrivacySettings","PEER_FULL_TTL","AppProfileManager","usersFull","chatsFull","fullExpiration","onUpdateChatParticipants","onUpdateChatParticipantAdd","_participants","onUpdateChatParticipantDelete","onUpdateUserTyping","getTypingsKey","typingsInPeer","t","cancelAction","getChatFull","onUpdatePeerBlocked","blocked","updateChatParticipants","updateChatParticipantAdd","updateChatParticipantDelete","updateUserTyping","updateChatUserTyping","updateChannelUserTyping","updatePeerBlocked","fullChat","updated","call_active","hasChatPhoto","chat_photo","refreshFullPeer","invalidateChannelParticipants","usersUserFull","full_user","profile_photo","botInfo","bot_info","referenceContext","description_document","description_photo","getProfileByPeerId","getCachedProfileByPeerId","getFullPhoto","profile","full_chat","getChatInviteLink","exported_invite","link","exportedInvite","getParticipants","getChannelParticipants","chatParticipants","createSearchIndex","chatParticipant","found","filteredParticipants","getParticipant","getChannelParticipant","broadcast","channelParticipant","fullChannel","getMentions","processUserIds","ratingMap","cP","updateProfile","saveApiUser","uploadProfilePhoto","updateResult","strippedThumb","stripped_thumb","deletePhotos","deletedList","verifyParticipantForOnlineCount","reduceParticipantsForOnlineCount","getOnlines","chatInfo","channelParticipants","onlines","getPeerTypings","canGiftPremium","callbackifyAll","SAVE_DOC_KEYS","REFERENCE_CONTEXT","AppReactionsManager","availableReactions","getAvailableReactions","sendReactionPromises","lastSendingTimes","availableReaction","around_animation","static_icon","appear_animation","center_icon","messagesAvailableReactions","getActiveAvailableReactions","inactive","getAvailableReactionsForPeer","activeAvailableReactions","unshiftQuickReaction","getQuickReaction","quickReaction","chatAvailableReactions","filteredChatAvailableReactions","unshiftQuickReactionInner","getAvailableReactionsByMessage","isReactionActive","reactions_default","getReactionCached","getReaction","getMessagesReactions","setDefaultReaction","sendReaction","lastSendingTimeKey","unsetReactionCount","canSeeList","can_see_list","chosenReactions","unsetReactions","chosenReactionIdx","chosenReactionCount","chosenReactionsLength","reactionCountIdx","id1","id2","promiseKey","editMessageUpdateIdx","editMessageUpdate","LOCAL_IDS","EMOJI","EMOJI_ANIMATIONS","PREMIUM_GIFTS","GENERIC_ANIMATIONS","DEFAULT_STATUSES","DEFAULT_TOPIC_ICONS","LOCAL_IDS_SET","AppStickersManager","getStickerSetPromises","getStickersByEmoticonsPromises","sounds","processAllStickersResult","allStickers","sets","stickerSet","videos","getAnimatedEmojiStickerSet","getGreetingStickersPromise","getGreetingStickersTimeout","getGreetingSticker","onStickersUpdated","updateNewStickerSet","saveStickerSet","updateRecentStickers","updateFavedStickers","updateMoveStickerSetToTop","updateStickerSetsOrder","masks","stickers","getFavedStickersStickers","getRecentStickersStickers","justPreload","getStickersByEmoticon","greetingStickers","random","saveStickers","canUseStickerSetCache","useCache","refreshTime","getStickerSet","cachedSet","getStickerSetInput","saveById","getLocalStickerSet","animations","getAnimatedEmojiSoundsPromise","emojies_sounds","sound","bytesStr","atob","file_reference_base64","charCodeAt","this_dc","getRecentStickers","recentStickers","saveRecentSticker","unsave","_doc","docEmoticon","faved","cleanEmoji","getAnimatedEmojiSticker","isAnimation","packs","getAnimatedEmojiSoundDocument","preloadAnimatedEmojiSticker","preloadEmojiPromise","preloadAnimatedEmojiStickerAnimation","animation","preloadSticker","isPremiumEffect","video_thumbs","newSet","setToCache","needSave","installed_date","getStickerSetThumbDownloadOptions","thumb_dc_id","isAnimated","mimeType","getFeaturedStickers","covered","getPromoPremiumStickers","getPremiumStickers","getFavedStickers","favedStickers","getFavedStickersLimit","faveSticker","unfave","toggleStickerSet","archived","toggleStickerSets","searchStickerSets","excludeFeatured","exclude_featured","foundSaved","cover","getAllStickers","preloadStickerSets","includeOurStickers","includeServerStickers","cacheKey","messagesStickers","installedSets","foundStickers","cachedStickersAnimated","cachedStickersStatic","iteratePacks","clearRecentStickers","reorderStickerSets","AppUsersManager","usernames","getTopPeersPromises","contactsIndex","contactsFillPromise","contactsList","updatedContactsList","updateUsersStatuses","timestampNow","updateUserStatus","setInterval","expires","was_online","setUserToStateIfNeeded","updateUserName","contactsListCachedTime","contact","mutual_contact","pushContact","recentSearch","onContactsModified","fromServer","pushRecentSearch","clearRecentSearch","resolveUsername","resolvedPeer","processResolvedPeer","resolvePhone","popContact","getContacts","includeSaved","sortBy","_contactsList","userId1","userId2","sortName1","sortName","sortName2","localeCompare","status1","getUserStatusForSort","myUserId","testSelfSearch","getContactsPeerIds","toggleBlock","block","apiUsers","cleanedUsernames","cleanUsername","searchUsername","oldPeer","oldUser","fullName","wasContact","newContact","onContactUpdated","checkPremium","isUserOnlineVisible","getUserStatus","isRegularUser","getUserPhone","isAnonymous","fragment_prefixes","isAttachMenuBot","bot_attach_menu","support","isNonContactUser","eventTimestamp","importContact","importContacts","phones","inputContacts","j","client_id","importedContactsResult","imported","importedContact","topPeersCache","cachedTime","categories","getBlocked","contactsBlocked","getLocated","self_expires","searchContacts","my_results","curIsContact","setUserStatus","offline","updateMyOnlineStatus","addContact","addPhonePrivacyException","add_phone_privacy_exception","deleteContacts","getCommonChats","photoTypeSet","AppWebPagesManager","webpages","pendingWebPages","updateWebPage","apiWebPage","oldWebPage","isUpdated","siteName","site_name","shortTitle","author","pendingSet","getWebPage","readBlobAsArrayBuffer","readBlobAs","fileNameRFC","escape","DownloadWriter","serviceMessagePort","getServiceMessagePort","write","chunk","saveToStorage","DownloadStorage","getFile","prepareWriting","headers","cancel","getWriter","MIN_PART_SIZE","IGNORE_ERRORS","ApiFileManager","cacheStorage","downloadStorage","downloadPromises","uploadPromises","downloadPulls","downloadActives","refreshReferencePromises","maxUploadParts","maxDownloadParts","uncompressTGS","uncompressTGV","svgIndex","__","fixFirefoxSvg","TextEncoder","convertWebp","convertOpus","webFileDcId","webfile_dc_id","upload_max_fileparts_premium","upload_max_fileparts_default","downloadRequest","activeDelta","downloadPull","downloadCheck","downloadLimit","setQueueId","getFileStorage","cancelDownload","canceled","requestWebFilePart","checkCancel","isLocalWebFile","extension","file_type","mtime","fileDownload","getDelta","checkedReference","getLimitPart","isUpload","maxParts","maxPartSize","inputFileLocation","isDownloading","getDownload","getUpload","getConvertMethod","IS_OPUS_SUPPORTED","allocateDeferredPromises","startOffset","delayed","writeDeferred","writePromise","originalMimeType","convertMethod","getDownloadFileNameFromOptions","cacheFileName","errorHandler","prepared","isWebFile","cachePrepared","downloadPrepared","possibleSize","_errorHandler","writer","truncate","downloadFileName","readBlobAsUint8Array","requestPart","dispatchProgress","throttledDispatchProgress","superpuper","isFinal","getParts","replaceParts","processedResult","getDownloadMediaDetails","downloadMediaURL","downloadMediaVoid","fileSize","isBigFile","partSize","totalParts","fileId","resultInputFile","parts","md5_checksum","resolved","it","_part","doneParts","file_id","file_part","file_total_parts","fileUpload","generator","ApiManagerMethods","apiPromisesSingleProcess","apiPromisesSingle","apiPromisesCacheable","afterMessageIdTemp","setUserAuth","prepareTempMessageId","queryJSON","newResult","oldPromise","getNewPromise","newPromise","ignore_restriction_reasons","pin","folderPin","bio","topicPin","ApiManager","cachedNetworkers","cachedExportPromise","gettingNetworkers","baseDcId","afterMessageTempIds","changeTransportType","updateConfig","iterateNetworkers","getTransportType","connections","dcs","array","oldTransportType","oldObject","oldGetKey","newGetKey","info","changeNetworkerTransport","getBaseDcId","sessionStorage","setBaseDcId","userAuth","dcID","user_auth","wasDcId","getNetworker","setOnDrainIfNeeded","dc","logOut","loggingOut","storageKeys","storageResult","logoutPromises","ignoreErrors","toggleStorages","generateNetworkerGetKey","networkers","maxNetworkers","isOnline","ak","authKeyHex","serverSaltHex","authKey","bytesFromHex","authKeyId","serverSalt","authorizer","_error","newTransportType","removeTransport","stack","getNetworkerVoid","oldTransport","changeTransport","onNetworkerDrain","onDrain","removeNetworker","isFileNetworker","canRelease","setDrainTimeout","updatesProcessor","cachedNetworker","startTime","isStopped","performRequest","wrapApiCall","exportResolve","exportReject","exportedAuth","newDcId","unsetConnectionInited","rawError","waitTime","floodMaxTimeout","attachPromise","originalError","PeersStorage","neededPeers","singlePeerMap","thumbFullSize","ThumbsStorage","thumbsCache","intToUint","ulongFromInts","high","low","shiftLeft","safeBigInt","ulongBigInt","pow","longBigInt","divide","bigIntFromBytes","base","boolFalse","predicate","boolTrue","vector","gzipPacked","sliceMethod","TLSerialization","mtproto","startMaxLength","createBuffer","ArrayBuffer","intView","Int32Array","byteView","getArray","resultBuffer","resultInt32","subarray","getBuffer","getBytes","typed","resultArray","getOffset","checkLength","needBytes","previousBuffer","previousArray","writeInt","field","storeInt","storeBool","storeLongP","iHigh","iLow","storeLong","sLong","storeIntBytes","_bigInt","bigInt","isNegative","quotient","remainder","divmod","toJSNumber","storeDouble","Float64Array","storeString","sUTF8","unescape","storeBytes","bits","storeRawBytes","storeMethod","methodName","methodData","methods","m","flagsOffsets","param","condType","fieldBit","storeObject","paramName","itemType","schema","isBare","constructorData","TLDeserialization","readInt","fetchInt","fetchDouble","doubleView","fetchLong","ulong","greater","minus","greaterOrEquals","fetchBool","fetchObject","fetchString","String","fromCharCode","decodeURIComponent","fetchBytes","fetchIntBytes","fetchRawBytes","fetchVector","fallback","checkType","constructorCmp","uncompressed","constructorsIndex","schemaFallback","int1","int2","overrideKey","isCond","formatJSONValue","jsonValue","objectValues","objectValue","setOffset","addPadding","blockSize","zeroes","blockSizeAsTotalLength","needPadding","padding","bufferConcats","delays","disconnectDelayMin","disconnectDelayMax","pingInterval","pingMaxTime","connectionTimeout","RESEND_OPTIONS","noSchedule","notContentRelated","invokeAfterMsgConstructor","networkerTempId","MTPNetworker","lastServerMessages","sentMessages","pendingMessages","pendingAcks","pendingResendReq","nextReq","checkConnectionPeriod","lastResponseTime","activeRequests","sendPingDelayDisconnect","pingDelayDisconnectDeferred","lastPingTime","disconnectDelay","round","timeoutTime","lastPingStartTime","pingId","lastPingDelayDisconnectId","wrapMtpCall","ping_id","disconnect_delay","rejectTimeout","elapsedTime","checkLongPoll","isClean","longPollPending","sleepAfter","sendLongPoll","checkConnection","clearCheckConnectionTimeout","serializer","pingMessage","generateId","seq_no","generateSeqNo","sendEncryptedRequest","toggleOffline","checkConnectionTimeout","authKeyUint8","convertToUint8Array","isFileUpload","isFileDownload","updateSession","seqNo","prevSessionId","updateSentMessage","sentMessageId","sentMessage","container","inner","innerSentMessageId","innerSentMessage","pushMessage","wrapMtpMessage","connectionInited","invokeWithLayer","initConnection","resultType","isAPI","nextReqTimeout","longPollInterval","clearPingDelayDisconnect","forceReconnectTimeout","sendingLongPoll","max_delay","wait_after","max_wait","noResponse","longPoll","delay","checkConnectionRetryAt","scheduleRequest","handleSentEncryptedRequestHTTP","noResponseMsgs","sqrt","pushResend","shouldResolve","onDrainTimeout","willChange","onConnectionStatusChange","innerMsgId","acked","getMsgKey","dataWithPadding","x","msgKeyLargePlain","msgKeyLarge","getAesKeyIv","msgKey","sha2aText","sha2bText","aesKey","aesIv","sha2a","sha2b","akStopped","performScheduledRequest","ackMsgIds","msg_ids","pendingResendReqLength","outMessage","messagesByteLen","hasApiCall","hasHttpWait","lengthOverflow","compare","messageByteLength","generateContainerMessage","messageWithBody","innerMessages","getEncryptedMessage","keyIv","getDecryptedMessage","encryptedData","getEncryptedOutput","dataBuffer","paddingLength","encryptedResult","requestData","baseError","responseBuffer","deserializer","bytesCmp","calcMsgKey","totalLength","messageBodyLength","messageBody","mt_message","seqno","mt_rpc_result","req_msg_id","applyServerSalt","newServerSalt","toArray","ackMessage","reqResend","notEmpty","processMessageAck","error_message","error_code","msg","applyServerTime","serverTime","shiftRight","innerMessage","new_server_salt","bad_msg_id","changedTimeOffset","badMessage","first_msg_id","server_salt","answer_msg_id","lastResendReq","lastResend","pendingResend","reqMsgId","badMsgId","pos","NetworkerFactory","startAll","stoppedNetworkers","stopAll","setLanguage","testPublicKeysHex","modulus","exponent","publisKeysHex","publicKeysParsed","preparePromise","prepare","keyParsed","RSAPublicKey","fingerprintBytes","fingerprints","fingerprintHex","fill","foundKey","fingerprint","bytesXor","bytes1","bytes2","Authorizer","sendPlainRequest","requestArray","requestLength","headerArray","errorCode","auth_key_id","msg_len","sendReqPQ","nonce","rsaKeysManager","serverNonce","server_nonce","pq","server_public_key_fingerprints","publicKey","pAndQ","sendReqDhParams","newNonce","p_q_inner_data_dc","new_nonce","pQInnerDataSerialization","dataPadReversed","keyAesEncrypted","tempKey","dataWithHash","aesEncrypted","keyAesEncryptedBigInt","publicKeyModulusBigInt","getKeyAesEncrypted","req_DH_params","public_key_fingerprint","encrypted_data","requestBytes","newNonceHash","new_nonce_hash","decryptServerDhDataAnswer","encrypted_answer","sendSetClientDhParams","encryptedAnswer","localTime","tmpAesKey","tmpAesIv","answerWithHash","answerWithPadding","g","dhPrime","dh_prime","gA","g_a","server_time","retry","verifyDhParams","dhPrimeHex","gABigInt","dhPrimeBigInt","subtract","twoPow","gBytes","gB","retry_id","authKeyHash","authKeyAux","newNonceHash1","new_nonce_hash1","newNonceHash2","new_nonce_hash2","newNonceHash3","new_nonce_hash3","getTransportTypePromise","_try","TimeManager","lastMessageId","timeOffset","timeTicks","newTimeOffset","changed","server_time_offset","AppWebDocsManager","webDocument","AppPaymentsManager","getInputInvoiceBySlug","getInputInvoiceByPeerId","getPaymentForm","invoice","paymentForm","getPaymentReceipt","validateRequestedInfo","sendPaymentForm","formId","requestedInfoId","shippingOptionId","credentials","tipAmount","form_id","requested_info_id","shipping_option_id","tip_amount","clearSavedInfo","AppAttachMenuBotsManager","attachMenuBots","attachMenuBotsArr","onUpdateAttachMenuBots","getAttachMenuBots","updateAttachMenuBots","saveAttachMenuBot","attachMenuBot","bot_id","icon","getAttachMenuBotIcon","saveAttachMenuBots","getAttachMenuBotCached","requestWebView","fromBotMenu","themeParams","from_bot_menu","theme_params","prolongWebView","AppSeamlessLoginManager","requestUrlAuth","buttonId","button_id","urlAuthResult","acceptUrlAuth","writeAllowed","write_allowed","getWebAuthorizations","webAuthorizations","authorizations","resetWebAuthorization","resetWebAuthorizations","AppThemesManager","wallPapers","saveWallPaper","getWallPaper","inputWallPaper","getInputWallPaper","getThemes","accountThemes","themes","theme","themeSettings","getWallPapers","accountWallpapers","wallpapers","appManagersManager","cryptoWorkersURLs","cryptoPortsAttached","cryptoPortPromise","getManagers","manager","apply","ports","originalUrl","newURLs","createManagers","appAvatarsManager","appCallsManager","appPrivacyManager","appInlineBotsManager","passwordManager","appPaymentsManager","appSeamlessLoginManager","_serviceMessagePort","_isServiceWorkerOnline","pushedKeys","clearWrite","invokeExceptSource","serviceWorkerOnline","serviceWorkerPort","detachPort","attachPort","messagePort","onConnect","onDisconnect","listenPort","sendPort","attachListenPort","attachSendPort","setOnPortDisconnect","listenMessagePort","NULL_PEER_ID","REPLIES_PEER_ID","REPLIES_HIDDEN_CHANNEL_ID","SERVICE_PEER_ID","MUTE_UNTIL","MAX_FILE_SAVE_SIZE","THUMB_TYPE_FULL","ATTACH_MENU_BOT_ICON_NAME","GENERAL_TOPIC_ID","T_ME_PREFIXES","FOLDER_ID_ALL","FOLDER_ID_ARCHIVE","REAL_FOLDERS","START_LOCAL_ID","ALPHA_CHARS_REG_EXP","ALPHA_NUMERIC_REG_EXP","URL_ALPHANUMERIC_REG_EXP_PART","URL_PROTOCOL_REG_EXP_PART","URL_REG_EXP","URL_ANY_PROTOCOL_REG_EXP","USERNAME_REG_EXP","BOT_COMMAND_REG_EXP","FULL_REG_EXP","EMAIL_REG_EXP","MARKDOWN_REG_EXP","MARKDOWN_ENTITIES","MARKDOWN_ENTITIES_TYPES","PASS_CONFLICTING_ENTITIES","PHONE_NUMBER_REG_EXP","encodeEmoji","emojiText","unicodeSurrogates","points","char","previous","toCodePoints","removeVS16s","vs16RegExp","zeroWidthJoiner","rawEmoji","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","__webpack_exports__","O","chunkIds","fn","priority","notFulfilled","getter","__esModule","definition","enumerable","chunkId","miniCssF","globalThis","Function","prop","Symbol","toStringTag","nmd","paths","children","scriptUrl","importScripts","currentScript","src","scripts","getElementsByTagName","oldGetScript","oldLoadScript","queryMap","countMap","retries","realSrc","cacheBust","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","moreModules","runtime"],"sourceRoot":""} \ No newline at end of file diff --git a/public/report.html b/public/report.html index c45018f4..02e86548 100644 --- a/public/report.html +++ b/public/report.html @@ -3,7 +3,7 @@ - tweb [7 Mar 2023 at 12:43] + tweb [8 Mar 2023 at 01:25] diff --git a/public/sw.a4cbb23cb45b5ad95353.chunk.js b/public/sw.ee91e25d52a3425cb42c.chunk.js similarity index 99% rename from public/sw.a4cbb23cb45b5ad95353.chunk.js rename to public/sw.ee91e25d52a3425cb42c.chunk.js index bbb1d840..e41c6e2c 100644 --- a/public/sw.a4cbb23cb45b5ad95353.chunk.js +++ b/public/sw.ee91e25d52a3425cb42c.chunk.js @@ -1,2 +1,2 @@ (()=>{"use strict";var e,t,n={410:(e,t,n)=>{n.d(t,{GO:()=>r,ZP:()=>i});const o=n(1267).Z.debug,r="undefined"!=typeof window?window:self,i=o},4762:(e,t,n)=>{n.d(t,{IS_FIREFOX:()=>s,IS_SAFARI:()=>i});var o=n(6761);const r=navigator?navigator.userAgent:null,i=(navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i),navigator.userAgent.toLowerCase().indexOf("android"),/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor),(/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&o.Z.MSStream,!!("safari"in o.Z)||!(!r||!(/\b(iPad|iPhone|iPod)\b/.test(r)||r.match("Safari")&&!r.match("Chrome")))),s=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;(void 0===navigator.maxTouchPoints||navigator.maxTouchPoints>0)&&navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i)},1352:(e,t,n)=>{n.d(t,{FK:()=>s,N5:()=>r,SU:()=>o,kC:()=>i});const o="undefined"!=typeof ServiceWorkerGlobalScope&&self instanceof ServiceWorkerGlobalScope,r="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&!o,i=r||o,s=()=>self.clients.matchAll({includeUncontrolled:!1,type:"window"}),a=(e,...t)=>{try{e.postMessage(...t)}catch(e){console.error("[worker] postMessage error:",e,t)}},c=(e,...t)=>{s().then((n=>{n.length&&n.slice(e?0:-1).forEach((e=>{a(e,...t)}))}))};o&&c.bind(null,!1),o&&c.bind(null,!0)},5003:(e,t,n)=>{n.d(t,{kg:()=>f,v9:()=>o});var o,r=n(410),i=n(4762),s=n(1352),a=n(5289);!function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Log=4]="Log",e[e.Debug=8]="Debug"}(o||(o={}));const c=[o.None,o.Error,o.Warn,o.Log,o.Debug],l=!(i.IS_SAFARI||i.IS_FIREFOX),u="",h="",d=[["debug",o.Debug],["info",o.Log],["warn",o.Warn],["error",o.Error],["assert",o.Error],["trace",o.Log],["group",o.Log],["groupCollapsed",o.Log],["groupEnd",o.Log]];function f(e,t=o.Log|o.Warn|o.Error,n=!1,i=""){let g;r.ZP||n||(t=o.Error),l?i||(s.SU?i=u:s.N5&&(i=h)):i="";const p=i;i=i?`%s ${i}%s`:"%s";const m=function(...n){return t&o.Log&&console.log(i,(0,a.Z)(),e,...n)};return d.forEach((([n,o])=>{m[n]=function(...r){return t&o&&console[n](i,(0,a.Z)(),e,...r)}})),m.setPrefix=function(t){g=t,e="["+t+"]"},m.setPrefix(e),m.setLevel=function(e){t=c.slice(0,e+1).reduce(((e,t)=>e|t),0)},m.bindPrefix=function(e){return f(`${g}] [${e}`,t,n,p)},m}},6350:(e,t,n)=>{n.d(t,{Vp:()=>ee,cM:()=>Y,j6:()=>ne});var o=n(5003);function r(e){return new Promise((t=>{setTimeout(t,e)}))}const i=self,s="cachedAssets";function a(e){return e.ok&&200===e.status}function c(e){return Promise.race([e,r(1e4).then((()=>Promise.reject()))])}function l(){}function u(){const e={isFulfilled:!1,isRejected:!1,notify:()=>{},notifyAll:(...t)=>{e.lastNotify=t,e.listeners.forEach((e=>e(...t)))},listeners:[],addNotifyListener:t=>{e.lastNotify&&t(...e.lastNotify),e.listeners.push(t)}},t=new Promise(((n,o)=>{e.resolve=e=>{t.isFulfilled||t.isRejected||(t.isFulfilled=!0,n(e))},e.reject=(...e)=>{t.isRejected||t.isFulfilled||(t.isRejected=!0,o(...e))}}));return t.catch(l).finally((()=>{t.notify=t.notifyAll=t.lastNotify=null,t.listeners.length=0,t.cancel&&(t.cancel=l)})),Object.assign(t,e),t}var h=n(6761),d=n(1267);function f(e,t=""){Array.isArray(e)||(e=[e]);const n=function(e){return-1===["image/jpeg","image/png","image/gif","image/svg+xml","image/webp","image/bmp","video/mp4","video/webm","video/quicktime","audio/ogg","audio/mpeg","audio/mp4","audio/wav","application/json","application/pdf"].indexOf(e)?"application/octet-stream":e}(t);return new Blob(e,{type:n})}class g{constructor(e,t,n){this.mimeType=e,this.size=t,this.saveFileCallback=n,this.bytes=new Uint8Array(t)}write(e,t){return n=this,o=void 0,i=function*(){const n=t+e.byteLength;if(n>this.bytes.byteLength){const e=new Uint8Array(n);e.set(this.bytes,0),this.bytes=e}this.bytes.set(e,t)},new((r=void 0)||(r=Promise))((function(e,t){function s(e){try{c(i.next(e))}catch(e){t(e)}}function a(e){try{c(i.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}c((i=i.apply(n,o||[])).next())}));var n,o,r,i}truncate(){this.bytes=new Uint8Array}trim(e){this.bytes=this.bytes.slice(0,e)}finalize(e=!0){const t=f(this.bytes,this.mimeType);return e&&this.saveFileCallback&&this.saveFileCallback(t),t}getParts(){return this.bytes}replaceParts(e){this.bytes=e}}var p=n(5471);class m{constructor(e){this.dbName=e,this.useStorage=!0,d.Z.test&&(this.dbName+="_test"),m.STORAGES.length&&(this.useStorage=m.STORAGES[0].useStorage),this.openDatabase(),m.STORAGES.push(this)}openDatabase(){var e;return null!==(e=this.openDbPromise)&&void 0!==e?e:this.openDbPromise=caches.open(this.dbName)}delete(e){return this.timeoutOperation((t=>t.delete("/"+e)))}deleteAll(){return caches.delete(this.dbName)}get(e){return this.timeoutOperation((t=>t.match("/"+e)))}save(e,t){return this.timeoutOperation((n=>n.put("/"+e,t)))}getFile(e,t="blob"){return this.get(e).then((e=>{if(!e)throw(0,p.Z)("NO_ENTRY_FOUND");return e[t]()}))}saveFile(e,t){t instanceof Blob||(t=f(t));const n=new Response(t,{headers:{"Content-Length":""+t.size}});return this.save(e,n).then((()=>t))}timeoutOperation(e){return this.useStorage?new Promise(((t,n)=>{return o=this,r=void 0,s=function*(){let o=!1;const r=setTimeout((()=>{n(),o=!0}),15e3);try{const n=yield this.openDatabase();if(!n)throw this.useStorage=!1,this.openDbPromise=void 0,"no cache?";const r=yield e(n);if(o)return;t(r)}catch(e){n(e)}clearTimeout(r)},new((i=void 0)||(i=Promise))((function(e,t){function n(e){try{c(s.next(e))}catch(e){t(e)}}function a(e){try{c(s.throw(e))}catch(e){t(e)}}function c(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i((function(e){e(o)}))).then(n,a)}c((s=s.apply(o,r||[])).next())}));var o,r,i,s})):Promise.reject((0,p.Z)("STORAGE_OFFLINE"))}prepareWriting(e,t,n){return{deferred:u(),getWriter:()=>new g(n,t,(t=>this.saveFile(e,t).catch((()=>t))))}}static toggleStorage(e,t){return Promise.all(this.STORAGES.map((n=>{if(n.useStorage=e,t)return e?void 0:n.deleteAll()})))}}m.STORAGES=[];const v=new Map,w=new m("cachedStreamChunks"),y="Time-Cached";setInterval((()=>w.timeoutOperation((e=>e.keys().then((t=>{const n=new Map,o=Date.now()/1e3|0;for(const e of t){const t=e.url.match(/\/(\d+?)\?/);t&&!n.has(t[1])&&n.set(t[1],e)}const r=[];for(const[t,i]of n){const n=e.match(i).then((n=>{if(+n.headers.get(y)+86400<=o)return Y("will delete stream chunk:",t),e.delete(i,{ignoreSearch:!0,ignoreVary:!0})}));r.push(n)}return Promise.all(r)}))))),18e5),setInterval((()=>{const e=ee();for(const[t,n]of v)if(t!==e){for(const e in n)n[e].reject();v.delete(t)}}),12e4);const b=new Map;class P{constructor(e){this.info=e,this.loadedOffsets=new Set,this.destroy=()=>{b.delete(this.id)},this.id=P.getId(e),b.set(this.id,this),this.limitPart=e.size>78643200?O:S,this.destroyDebounced=function(e,t,n=!0,o=!0){let r,i,s,a,c=!1;const u=t=>{const n=s,o=a;try{n(e.apply(null,t))}catch(e){console.error("debounce error",e),o(e)}},d=(...e)=>{i||(i=new Promise(((e,t)=>(s=e,a=t)))),r?(clearTimeout(r),c=!0,a(),i=new Promise(((e,t)=>(s=e,a=t)))):n&&(u(e),c=!1);const d=h.Z.setTimeout((()=>{!o||n&&!c||u(e),r===d&&(r=i=s=a=void 0,c=!1)}),t);return r=d,i.catch(l),i};return d.clearTimeout=()=>{r&&(h.Z.clearTimeout(r),a(),r=i=s=a=void 0,c=!1)},d.isDebounced=()=>!!r,d}(this.destroy,15e4,!1,!0)}requestFilePartFromWorker(e,t,n=!1){return o=this,r=void 0,s=function*(){const o={docId:this.id,dcId:this.info.dcId,offset:e,limit:t},r=JSON.stringify(o),i=ee();let s=v.get(i);s||v.set(i,s={});let a=s[r];if(a)return a.then((e=>e.bytes));this.loadedOffsets.add(e),a=s[r]=u(),ne.invoke("requestFilePart",o,void 0,i).then(a.resolve,a.reject).finally((()=>{s[r]===a&&(delete s[r],Object.keys(s).length||v.delete(i))}));const c=a.then((e=>e.bytes));return this.saveChunkToCache(c,e,t),!n&&this.preloadChunks(e,e+15*this.limitPart),c},new((i=void 0)||(i=Promise))((function(e,t){function n(e){try{c(s.next(e))}catch(e){t(e)}}function a(e){try{c(s.throw(e))}catch(e){t(e)}}function c(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i((function(e){e(o)}))).then(n,a)}c((s=s.apply(o,r||[])).next())}));var o,r,i,s}requestFilePartFromCache(e,t,n){const o=this.getChunkKey(e,t);return w.getFile(o).then((e=>n?new Uint8Array:function(e){return function(e){return function(e,t){return new Promise((t=>{const n=new FileReader;n.addEventListener("loadend",(e=>{t(e.target.result)})),n.readAsArrayBuffer(e)}))}(e)}(e).then((e=>new Uint8Array(e)))}(e)),(e=>{e.type}))}requestFilePart(e,t,n){return this.requestFilePartFromCache(e,t,n).then((o=>o||this.requestFilePartFromWorker(e,t,n)))}saveChunkToCache(e,t,n){return e.then((e=>{const o=this.getChunkKey(t,n),r=new Response(e,{headers:{"Content-Length":""+e.length,"Content-Type":"application/octet-stream",[y]:""+(Date.now()/1e3|0)}});return w.save(o,r)}))}preloadChunk(e){this.loadedOffsets.has(e)||(this.loadedOffsets.add(e),this.requestFilePart(e,this.limitPart,!0))}preloadChunks(e,t){if(t>this.info.size&&(t=this.info.size),e)for(;e{n===i&&o===i+r||(e=e.slice(n-i,o-i+1));const t={"Accept-Ranges":"bytes","Content-Range":`bytes ${n}-${n+e.byteLength-1}/${this.info.size||"*"}`,"Content-Length":`${e.byteLength}`};return this.info.mimeType&&(t["Content-Type"]=this.info.mimeType),new Response(e,{status:206,statusText:"Partial Content",headers:t})}))}getChunkKey(e,t){return this.id+"?offset="+e+"&limit="+t}static get(e){var t;return null!==(t=b.get(this.getId(e)))&&void 0!==t?t:new P(e)}static getId(e){return e.location.id}}const S=524288,O=1048576;function k(e,t=2048){return e-e%t}var A=n(4762);function C(e,t){const n=Object.keys,o=typeof e;return e&&t&&"object"===o&&o===typeof t?n(e).length===n(t).length&&n(e).every((n=>C(e[n],t[n]))):e===t}class T{constructor(e){!function(e,t){if(t)for(const n in t)void 0!==t[n]&&(e[n]=t[n])}(this,e),d.Z.test&&(this.name+="_test"),this.storageIsAvailable=!0,this.log=(0,o.kg)(["IDB",e.name].join("-")),this.log("constructor"),this.openDatabase(!0),T.INSTANCES.push(this)}isAvailable(){return this.storageIsAvailable}openDatabase(e=!1){if(this.openDbPromise&&!e)return this.openDbPromise;const t=(e,t)=>{var n;const o=Array.from(e.indexNames);for(const t of o)e.deleteIndex(t);if(null===(n=t.indexes)||void 0===n?void 0:n.length)for(const n of t.indexes)e.indexNames.contains(n.indexName)||e.createIndex(n.indexName,n.keyPath,n.objectParameters)};try{var n=indexedDB.open(this.name,this.version);if(!n)return Promise.reject()}catch(e){return this.log.error("error opening db",e.message),this.storageIsAvailable=!1,Promise.reject(e)}let o=!1;return setTimeout((()=>{o||n.onerror((0,p.Z)("IDB_CREATE_TIMEOUT"))}),3e3),this.openDbPromise=new Promise(((e,r)=>{n.onsuccess=t=>{o=!0;const i=n.result;let s=!1;this.log("Opened"),i.onerror=e=>{this.storageIsAvailable=!1,this.log.error("Error creating/accessing IndexedDB database",e),r(e)},i.onclose=e=>{this.log.error("closed:",e),!s&&this.openDatabase()},i.onabort=e=>{this.log.error("abort:",e);const t=e.target;this.openDatabase(s=!0),t.onerror&&t.onerror(e),i.close()},i.onversionchange=e=>{this.log.error("onversionchange, lol?")},e(this.db=i)},n.onerror=e=>{o=!0,this.storageIsAvailable=!1,this.log.error("Error creating/accessing IndexedDB database",e),r(e)},n.onupgradeneeded=e=>{o=!0,this.log.warn("performing idb upgrade from",e.oldVersion,"to",e.newVersion);const n=e.target,r=n.result;this.stores.forEach((e=>{if(r.objectStoreNames.contains(e.name)){const o=n.transaction.objectStore(e.name);t(o,e)}else((e,n)=>{const o=e.createObjectStore(n.name);t(o,n)})(r,e)}))}}))}static create(e){var t;return null!==(t=this.INSTANCES.find((t=>t.name===e.name)))&&void 0!==t?t:new T(e)}static closeDatabases(e){this.INSTANCES.forEach((t=>{if(e&&e===t)return;const n=t.db;n&&(n.onclose=()=>{},n.close())}))}}T.INSTANCES=[];class j{constructor(e,t){this.storeName=t,this.log=(0,o.kg)(["IDB",e.name,t].join("-")),this.idb=T.create(e)}delete(e,t){const n=Array.isArray(e);return n||(e=[].concat(e)),this.getObjectStore("readwrite",(t=>{const o=e.map((e=>t.delete(e)));return n?o:o[0]}),"",t)}clear(e){return this.getObjectStore("readwrite",(e=>e.clear()),"",e)}save(e,t,n){const o=Array.isArray(e);return o||(e=[].concat(e),t=[].concat(t)),this.getObjectStore("readwrite",(n=>{const r=e.map(((e,o)=>n.put(t[o],e)));return o?r:r[0]}),"",n)}get(e,t){const n=Array.isArray(e);if(n){if(!e.length)return Promise.resolve([])}else{if(!e)return;e=[].concat(e)}return this.getObjectStore("readonly",(t=>{const o=e.map((e=>t.get(e)));return n?o:o[0]}),"",t)}getObjectStore(e,t,n,o=this.storeName){let r;return n&&(r=performance.now(),this.log(n+": start")),this.idb.openDatabase().then((i=>new Promise(((s,a)=>{const c=i.transaction([o],e),l=()=>{clearTimeout(d),a(c.error)},u=()=>{clearTimeout(d),n&&this.log(n+": end",performance.now()-r);const e=p.map((e=>e.result));s(g?e:e[0])};c.onerror=l;const h="readwrite"===e;h&&(c.oncomplete=()=>u());const d=setTimeout((()=>{this.log.error("transaction not finished",c,n)}),1e4),f=t(c.objectStore(o)),g=Array.isArray(f),p=g?f:[].concat(f);if(h)return;const m=p.length;let v=m;const w=()=>{c.error||--v||u()};for(let e=0;ee.getAll()),"",e)}}const x=self,E=location.protocol+"//"+location.hostname+location.pathname.split("/").slice(0,-1).join("/")+"/";let _=0,I=!0;const N={push_mute_until:0,push_lang:{push_message_nopreview:"You have a new message",push_action_mute1d:"Mute for 24H",push_action_settings:"Settings"},push_settings:{}},D=new class{constructor(e,t,n){this.defaults=n,this.cache={},this.storage=new j(e,t)}getDefault(e){const t=this.defaults[e];return"function"==typeof t?t():t}get(e){return this.cache.hasOwnProperty(e)?this.cache[e]:this.storage.get(e).then((e=>e),(()=>{})).then((t=>this.cache.hasOwnProperty(e)?this.cache[e]:(null!=t||(t=this.getDefault(e)),this.cache[e]=t)))}getCached(e){const t=this.get(e);if(t instanceof Promise)throw"no property";return t}set(e,t){var n,o,r,i,s;return o=this,r=void 0,s=function*(){if(!C(null!==(n=this.cache[e])&&void 0!==n?n:this.defaults[e],t)){this.cache[e]=t;try{this.storage.save(e,t)}catch(e){}}},new((i=void 0)||(i=Promise))((function(e,t){function n(e){try{c(s.next(e))}catch(e){t(e)}}function a(e){try{c(s.throw(e))}catch(e){t(e)}}function c(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i((function(e){e(o)}))).then(n,a)}c((s=s.apply(o,r||[])).next())}))}}({name:"tweb",version:7,stores:[{name:"session"},{name:"stickerSets"},{name:"users"},{name:"chats"},{name:"dialogs"},{name:"messages"}]},"session",N);for(const e in N)D.get(e);x.addEventListener("push",(e=>{const t=e.data.json();Y("push",Object.assign({},t));try{const[n,o,r]=[D.getCached("push_mute_until"),D.getCached("push_settings"),D.getCached("push_lang")],i=Date.now();if(L()&&n&&i{Y.error("Show notification promise",e)}))}(t,o,r);e.waitUntil(s)}catch(t){Y(t);const n="fix",o=x.registration.showNotification("Telegram",{tag:n});o.then((()=>{W(n)})),e.waitUntil(o)}})),x.addEventListener("notificationclick",(e=>{const t=e.notification;Y("on notification click",t),t.close();const n=e.action;if("mute1d"===n&&L())return Y("[SW] mute for 1d"),void D.set("push_mute_until",Date.now()+864e5);const o=t.data;if(!o)return;const r=x.clients.matchAll({type:"window"}).then((e=>{o.action=n,R=o;for(let t=0;tx.clients.openWindow(e.baseUrl||E)))})).catch((e=>{Y.error("Clients.matchAll error",e)}));e.waitUntil(r)})),x.addEventListener("notificationclose",(function(e){var t;t=e.notification,F.delete(t)}));const F=new Set;let R;function W(e){for(const t of F)try{if(e&&t.tag!==e)continue;t.close(),F.delete(t)}catch(e){}let t;return t="getNotifications"in x.registration?x.registration.getNotifications({tag:e}).then((e=>{for(let t=0,n=e.length;t{Y.error("Offline register SW error",e)})):Promise.resolve(),t}function L(){return A.IS_FIREFOX}const M=new Set;var q=n(153),U=n(410);class Z extends q.Z{constructor(){super("SERVICE"),U.GO&&(U.GO.serviceMessagePort=this)}}var G=n(1352);const z=new Map,$=(0,p.Z)("UNKNOWN");self.downloadMap=z;const B={download:e=>{const{id:t}=e;if(z.has(t))return Promise.reject($);const n=new CountQueuingStrategy({highWaterMark:1}),o=u();let r;o.then((()=>{setTimeout((()=>{z.delete(t)}),5e3)}),(()=>{z.delete(t)}));const i=new ReadableStream({start:e=>{r=e},cancel:e=>{o.reject($)}},n),s=Object.assign(Object.assign({},e),{readableStream:i,promise:o,controller:r});return z.set(t,s),o.catch((()=>{throw $}))},downloadChunk:({id:e,chunk:t})=>{const n=z.get(e);return n?n.controller.enqueue(t):Promise.reject()},downloadFinalize:e=>{const t=z.get(e);return t?(t.promise.resolve(),t.controller.close()):Promise.reject()},downloadCancel:e=>{const t=z.get(e);if(t)return t.promise.reject(),t.controller.error()}};function V(e,t){const n=r(100).then((()=>{const e=z.get(t);if(!e||e.used)return;e.used=!0;const n=e.readableStream;return new Response(n,{headers:e.headers})}));e.respondWith(n)}function K(){if(z.size)for(const[e,t]of z)t.controller.error()}const X={};function J(e,t){const n=e.request.formData().then((t=>(function(e,t){var n,o,r,i,s;o=this,r=void 0,s=function*(){try{Y("share data",e);const o=function(e){return{files:e.getAll("files"),title:e.get("title"),text:e.get("text"),url:e.get("url")}}(e);(null!==(n=X[t])&&void 0!==n?n:X[t]=[]).push(o)}catch(e){Y.warn("something wrong with the data",e)}},new((i=void 0)||(i=Promise))((function(e,t){function n(e){try{c(s.next(e))}catch(e){t(e)}}function a(e){try{c(s.throw(e))}catch(e){t(e)}}function c(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i((function(e){e(o)}))).then(n,a)}c((s=s.apply(o,r||[])).next())}))}(t,e.resultingClientId),Response.redirect(".."))));e.respondWith(n)}const Y=(0,o.kg)("SW",o.v9.Error|o.v9.Debug|o.v9.Log|o.v9.Warn,!0),H=self;let Q;const ee=()=>Q,te=e=>{Y("window connected",e.id,"windows before",ie.size),"none"!==e.frameType?(Y("windows",Array.from(ie)),ne.invokeVoid("hello",void 0,e),(e=>{ie.size||Q||(Y("sending message port for mtproto"),(e=>{const t=new MessageChannel;ne.attachPort(Q=t.port1),ne.invokeVoid("port",void 0,e,[t.port2])})(e))})(e),ie.set(e.id,e),function(e){const t=X[e.id];t&&(delete X[e.id],Y("releasing share events to client:",e.id,"length:",t.length),t.forEach((t=>{ne.invokeVoid("share",t,e)})))}(e)):Y.warn("maybe a bugged Safari starting window",e.id)},ne=new Z;ne.addMultipleEventsListeners({notificationsClear:W,toggleStorages:({enabled:e,clearWrite:t})=>{m.toggleStorage(e,t)},pushPing:(e,t)=>{!function(e,t){_=Date.now(),I=e.localNotifications,R&&t&&(ne.invokeVoid("pushClick",R,t),R=void 0),e.lang&&D.set("push_lang",e.lang),e.settings&&D.set("push_settings",e.settings)}(e,t)},hello:(e,t)=>{te(t)},shownNotification:function(e){M.add(e)}});const{onDownloadFetch:oe,onClosedWindows:re}=function(e){return e.addMultipleEventsListeners(B),{onDownloadFetch:V,onClosedWindows:K}}(ne);(0,G.FK)().then((e=>{Y(`got ${e.length} windows from the start`),e.forEach((e=>{te(e)}))}));const ie=new Map;self.connectedWindows=ie,function(e,t,n){const o=(t,n)=>{e.attachListenPort(t),n&&e.attachSendPort(n)};e.setOnPortDisconnect((e=>{Y("something has disconnected",e),e instanceof WindowClient&&ie.has(e.id)?(ie.delete(e.id),Y("window disconnected, left",ie.size),ie.size||(Y.warn("no windows left"),Q&&(ne.detachPort(Q),Q=void 0),re())):Y.warn("it is not a window")})),"undefined"!=typeof SharedWorkerGlobalScope?h.Z.addEventListener("connect",(e=>o(e.source,e.source))):"undefined"!=typeof ServiceWorkerGlobalScope?o(h.Z,null):o(h.Z,h.Z)}(ne);const se=e=>{if(!A.IS_SAFARI&&0===e.request.url.indexOf(location.origin+"/")&&e.request.url.match(/\.(js|css|jpe?g|json|wasm|png|mp3|svg|tgs|ico|woff2?|ttf|webmanifest?)(?:\?.*)?$/))return e.respondWith(function(e){return t=this,n=void 0,r=function*(){try{const t=yield c(i.caches.open(s)),n=yield c(t.match(e.request,{ignoreVary:!0}));if(n&&a(n))return n;const o={Vary:"*"};let r=yield fetch(e.request,{headers:o});if(a(r))t.put(e.request,r.clone());else if(304===r.status){const n=e.request.url.replace(/\?.+$/,"")+"?"+(1e5*Math.random()|0);r=yield fetch(n,{headers:o}),a(r)&&t.put(e.request,r.clone())}return r}catch(t){return fetch(e.request)}},new((o=void 0)||(o=Promise))((function(e,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(s,a)}c((r=r.apply(t,n||[])).next())}));var t,n,o,r}(e));try{const[t,n]=e.request.url.split("/").slice(-2);switch(t){case"stream":!function(e,t){const n=function(e){if(!e)return[0,0];const[,t]=e.split("="),n=t.split(", "),[o,r]=n[0].split("-");return[+o,+r||0]}(e.request.headers.get("Range")),o=JSON.parse(decodeURIComponent(t)),r=P.get(o);e.respondWith(Promise.race([(45e3,new Promise((e=>{setTimeout((()=>{e(new Response("",{status:408,statusText:"Request timed out."}))}),45e3)}))),r.requestRange(n)]))}(e,n);break;case"download":oe(e,n);break;case"share":J(e);break;case"ping":e.respondWith(new Response("pong"))}}catch(t){Y.error("fetch error",t),e.respondWith(new Response("",{status:500,statusText:"Internal Server Error",headers:{"Cache-Control":"no-cache"}}))}},ae=()=>{H.onfetch=se};H.addEventListener("install",(e=>{Y("installing"),e.waitUntil(H.skipWaiting().then((()=>Y("skipped waiting"))))})),H.addEventListener("activate",(e=>{Y("activating",H),e.waitUntil(H.caches.delete(s).then((()=>Y("cleared assets cache")))),e.waitUntil(H.clients.claim().then((()=>Y("claimed clients"))))})),H.onoffline=H.ononline=ae,ae()}},o={};function r(e){var t=o[e];if(void 0!==t)return t.exports;var i=o[e]={exports:{}};return n[e](i,i.exports,r),i.exports}r.m=n,r.x=()=>{var e=r.O(void 0,[85],(()=>r(6350)));return r.O(e)},e=[],r.O=(t,n,o,i)=>{if(!n){var s=1/0;for(u=0;u=i)&&Object.keys(r.O).every((e=>r.O[e](n[c])))?n.splice(c--,1):(a=!1,i0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[n,o,i]},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>e+".887945ef5f43bc205112.bundle.js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{if(void 0!==r){var e=r.u,t=r.e,n={},o={};r.u=function(t){return e(t)+(n.hasOwnProperty(t)?"?"+n[t]:"")},r.e=function(i){return t(i).catch((function(t){var s=o.hasOwnProperty(i)?o[i]:999999;if(s<1){var a=e(i);throw t.message="Loading chunk "+i+" failed after 999999 retries.\n("+a+")",t.request=a,t}return new Promise((function(e){setTimeout((function(){var t=Date.now();n[i]=t,o[i]=s-1,e(r.e(i))}),3e3)}))}))}}})(),(()=>{var e={670:1};r.f.i=(t,n)=>{e[t]||importScripts(r.p+r.u(t))};var t=this.webpackChunktweb=this.webpackChunktweb||[],n=t.push.bind(t);t.push=t=>{var[o,i,s]=t;for(var a in i)r.o(i,a)&&(r.m[a]=i[a]);for(s&&s(r);o.length;)e[o.pop()]=1;n(t)}})(),t=r.x,r.x=()=>r.e(85).then(t),r.x()})(); -//# sourceMappingURL=sw.a4cbb23cb45b5ad95353.chunk.js.map \ No newline at end of file +//# sourceMappingURL=sw.ee91e25d52a3425cb42c.chunk.js.map \ No newline at end of file diff --git a/public/sw.a4cbb23cb45b5ad95353.chunk.js.map b/public/sw.ee91e25d52a3425cb42c.chunk.js.map similarity index 99% rename from public/sw.a4cbb23cb45b5ad95353.chunk.js.map rename to public/sw.ee91e25d52a3425cb42c.chunk.js.map index 41098dd6..c9369441 100644 --- a/public/sw.a4cbb23cb45b5ad95353.chunk.js.map +++ b/public/sw.ee91e25d52a3425cb42c.chunk.js.map @@ -1 +1 @@ -{"version":3,"file":"sw.a4cbb23cb45b5ad95353.chunk.js","mappings":"uBAAIA,ECAAC,E,4CCQG,MACMC,E,QAAoB,QAEpBC,EADuB,oBAAb,OAA2BC,OAASC,KAE3D,G,yECJO,MAAMC,EAAaC,UAAYA,UAAUC,UAAY,KAU/CC,GATWF,UAAUC,UAAUE,OAAO,yBACzBH,UAAUC,UAAUG,cAAcC,QAAQ,WACzC,SAASC,KAAKN,UAAUC,YAAc,aAAaK,KAAKN,UAAUO,SAG7D,mBAAmBD,KAAKN,UAAUQ,WACxC,aAAvBR,UAAUQ,UAA2BR,UAAUS,eAAiB,IAC/D,gBAEwB,oBAAuBV,KAAe,yBAAyBO,KAAKP,IAAkBA,EAAWW,MAAM,YAAcX,EAAWW,MAAM,aACrJC,EAAaX,UAAUC,UAAUG,cAAcC,QAAQ,YAAc,QAI3BO,IAA7BZ,UAAUS,gBAAgCT,UAAUS,eAAiB,IAAMT,UAAUC,UAAUE,OAAO,iH,8DChBzH,MAAMU,EAAwD,oBAA7BC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AAuB,iBAAIA,KAAuB,kBAAK,GAC5Eya,EAA6BD,EAAmB3b,KAAKrD,KAAKgf,GAC9DA,EAAmB3b,KAvBC+P,IACnB,IAAKsJ,EAAUwC,EAAaC,GAAW/L,EACvC,IAAI,IAAI8I,KAAYgD,EAChBjD,EAAoBkB,EAAE+B,EAAahD,KACrCD,EAAoBM,EAAEL,GAAYgD,EAAYhD,IAIhD,IADGiD,GAASA,EAAQlD,GACdS,EAAS7c,QACdkf,EAAgBrC,EAAS0C,OAAS,EACnCH,EAA2B7L,EAAK,C,KvCnB7B9V,EAAO2e,EAAoB1O,EAC/B0O,EAAoB1O,EAAI,IAChB0O,EAAoBlQ,EAAE,IAAIpM,KAAKrC,GwCDb2e,EAAoB1O,G","sources":["webpack://tweb/webpack/runtime/chunk loaded","webpack://tweb/webpack/runtime/startup chunk dependencies","webpack://tweb/./src/config/debug.ts","webpack://tweb/./src/environment/userAgent.ts","webpack://tweb/./src/helpers/context.ts","webpack://tweb/./src/lib/logger.ts","webpack://tweb/./src/helpers/schedulers/pause.ts","webpack://tweb/./src/lib/serviceWorker/cache.ts","webpack://tweb/./src/helpers/noop.ts","webpack://tweb/./src/helpers/cancellablePromise.ts","webpack://tweb/./src/helpers/blob/blobConstruct.ts","webpack://tweb/./src/helpers/blob/blobSafeMimeType.ts","webpack://tweb/./src/lib/files/memoryWriter.ts","webpack://tweb/./src/lib/files/cacheStorage.ts","webpack://tweb/./src/lib/serviceWorker/stream.ts","webpack://tweb/./src/helpers/schedulers/debounce.ts","webpack://tweb/./src/helpers/blob/readBlobAsUint8Array.ts","webpack://tweb/./src/helpers/blob/readBlobAsArrayBuffer.ts","webpack://tweb/./src/helpers/blob/readBlobAs.ts","webpack://tweb/./src/helpers/object/deepEqual.ts","webpack://tweb/./src/lib/files/idb.ts","webpack://tweb/./src/helpers/object/safeAssign.ts","webpack://tweb/./src/lib/serviceWorker/push.ts","webpack://tweb/./src/config/databases/state.ts","webpack://tweb/./src/config/notifications.ts","webpack://tweb/./src/lib/serviceWorker/serviceMessagePort.ts","webpack://tweb/./src/lib/serviceWorker/download.ts","webpack://tweb/./src/lib/serviceWorker/share.ts","webpack://tweb/./src/lib/serviceWorker/index.service.ts","webpack://tweb/./src/helpers/listenMessagePort.ts","webpack://tweb/./src/lib/serviceWorker/timeout.ts","webpack://tweb/webpack/bootstrap","webpack://tweb/webpack/runtime/define property getters","webpack://tweb/webpack/runtime/ensure chunk","webpack://tweb/webpack/runtime/get javascript chunk filename","webpack://tweb/webpack/runtime/get mini-css chunk filename","webpack://tweb/webpack/runtime/global","webpack://tweb/webpack/runtime/hasOwnProperty shorthand","webpack://tweb/webpack/runtime/publicPath","webpack://tweb/webpack/runtime/compat","webpack://tweb/webpack/runtime/importScripts chunk loading","webpack://tweb/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn __webpack_require__.e(85).then(next);\n};","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Modes from './modes';\n\nexport const IS_BETA = process.env.NODE_ENV !== 'production';\nexport const DEBUG = (IS_BETA || Modes.debug)/* && false */;\nconst ctx: any = typeof(window) !== 'undefined' ? window : self;\nexport const MOUNT_CLASS_TO: any = DEBUG || true/* && false */ ? ctx : {};\nexport default DEBUG;\n\n// let m = DEBUG;\n/* if(!DEBUG) {\n ctx.sandpitTurtle = () => {\n //if(!m) {\n for(let i in MOUNT_CLASS_TO) {\n ctx[i] = MOUNT_CLASS_TO[i];\n }\n //m = true;\n //}\n\n //DEBUG = !DEBUG;\n };\n} */\n\n/* export const superDebug = (object: any, key: string) => {\n var d = object[key];\n var beforeStr = '', afterStr = '';\n for(var r of d) {\n beforeStr += r.before.hex + '\\n';\n afterStr += r.after.hex + '\\n';\n }\n\n beforeStr = beforeStr.trim();\n afterStr = afterStr.trim();\n //var beforeStr = d.map((r) => r.before.hex).join('\\n');\n //var afterStr = d.map((r) => r.after.hex).join('\\n');\n\n var dada = (name: string, str: string) => {\n var a = document.createElement('a');\n a.target = '_blank';\n a.download = name + '.txt';\n a.href = URL.createObjectURL(new Blob([str], {\n type: 'text/plain'\n }));\n document.body.append(a);\n a.click();\n };\n\n dada(key + '_' + 'before', beforeStr);\n dada(key + '_' + 'after', afterStr);\n}\n\nMOUNT_CLASS_TO.superDebug = superDebug; */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ctx from './ctx';\n\nexport const USER_AGENT = navigator ? navigator.userAgent : null;\nexport const IS_APPLE = navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i) !== -1;\nexport const IS_ANDROID = navigator.userAgent.toLowerCase().indexOf('android') !== -1;\nexport const IS_CHROMIUM = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);\n\n// https://stackoverflow.com/a/58065241\nexport const IS_APPLE_MOBILE = (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&\n !(ctx as any).MSStream;\n\nexport const IS_SAFARI = !!('safari' in ctx) || !!(USER_AGENT && (/\\b(iPad|iPhone|iPod)\\b/.test(USER_AGENT) || (!!USER_AGENT.match('Safari') && !USER_AGENT.match('Chrome'))))/* || true */;\nexport const IS_FIREFOX = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n\nexport const IS_MOBILE_SAFARI = IS_SAFARI && IS_APPLE_MOBILE;\n\nexport const IS_MOBILE = (navigator.maxTouchPoints === undefined || navigator.maxTouchPoints > 0) && navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i) != -1;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// в SW может быть сразу две переменных TRUE\nexport const IS_SERVICE_WORKER = typeof ServiceWorkerGlobalScope !== 'undefined' && self instanceof ServiceWorkerGlobalScope;\nexport const IS_WEB_WORKER = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope && !IS_SERVICE_WORKER;\nexport const IS_WORKER = IS_WEB_WORKER || IS_SERVICE_WORKER;\n\nexport const getWindowClients = () => {\n return (self as any as ServiceWorkerGlobalScope)\n .clients\n .matchAll({includeUncontrolled: false, type: 'window'});\n};\n\nexport const getLastWindowClient = () => getWindowClients().then((windowClients) => windowClients.slice(-1)[0]);\n\nconst postMessage = (listener: WindowClient | DedicatedWorkerGlobalScope, ...args: any[]) => {\n try {\n // @ts-ignore\n listener.postMessage(...args);\n } catch(err) {\n console.error('[worker] postMessage error:', err, args);\n }\n};\n\nconst notifyServiceWorker = (all: boolean, ...args: any[]) => {\n getWindowClients().then((listeners) => {\n if(!listeners.length) {\n // console.trace('no listeners?', self, listeners);\n return;\n }\n\n listeners.slice(all ? 0 : -1).forEach((listener) => {\n postMessage(listener, ...args);\n });\n });\n};\n\nconst notifyWorker = (...args: any[]) => {\n postMessage(self as any as DedicatedWorkerGlobalScope, ...args);\n};\n\nconst noop = () => {};\n\nexport const notifySomeone = IS_SERVICE_WORKER ? notifyServiceWorker.bind(null, false) : (IS_WEB_WORKER ? notifyWorker : noop);\nexport const notifyAll = IS_SERVICE_WORKER ? notifyServiceWorker.bind(null, true) : (IS_WEB_WORKER ? notifyWorker : noop);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport DEBUG from '../config/debug';\nimport {IS_FIREFOX, IS_SAFARI} from '../environment/userAgent';\nimport {IS_SERVICE_WORKER, IS_WEB_WORKER} from '../helpers/context';\nimport dT from '../helpers/dT';\n\nexport enum LogTypes {\n None = 0,\n Error = 1,\n Warn = 2,\n Log = 4,\n Debug = 8\n};\n\nexport const LOG_LEVELS = [LogTypes.None, LogTypes.Error, LogTypes.Warn, LogTypes.Log, LogTypes.Debug];\n\nconst IS_WEBKIT = IS_SAFARI || IS_FIREFOX;\n\n// let getCallerFunctionNameFromLine: (line: string) => string;\n// if(IS_WEBKIT) {\n// getCallerFunctionNameFromLine = (line) => {\n// const splitted = line.split('@');\n// return splitted[0];\n// };\n// } else {\n// getCallerFunctionNameFromLine = (line: string) => {\n// const splitted = line.trim().split(' ');\n// if(splitted.length === 3) {\n// return splitted[1].slice(splitted[1].lastIndexOf('.') + 1);\n// }\n// };\n// }\n\nconst STYLES_SUPPORTED = !IS_WEBKIT;\n// const LINE_INDEX = IS_WEBKIT ? 2 : 3;\n\n// function getCallerFunctionName() {\n// const stack = new Error().stack;\n// const lines = stack.split('\\n');\n// const line = lines[LINE_INDEX] || lines[lines.length - 1];\n// // const match = line.match(/\\.([^\\.]+?)\\s/);\n// // line = match ? match[1] : line.trim();\n// const caller = getCallerFunctionNameFromLine(line) || '';\n// return '[' + caller + ']';\n// }\n\nexport const LOGGER_STYLES = {\n reset: '\\x1b[0m',\n bright: '\\x1b[1m',\n dim: '\\x1b[2m',\n underscore: '\\x1b[4m',\n blink: '\\x1b[5m',\n reverse: '\\x1b[7m',\n hidden: '\\x1b[8m',\n // Foreground (text) colors\n fg: {\n black: '\\x1b[30m',\n red: '\\x1b[31m',\n green: '\\x1b[32m',\n yellow: '\\x1b[33m',\n blue: '\\x1b[34m',\n magenta: '\\x1b[35m',\n cyan: '\\x1b[36m',\n white: '\\x1b[37m'\n },\n // Background colors\n bg: {\n black: '\\x1b[40m',\n red: '\\x1b[41m',\n green: '\\x1b[42m',\n yellow: '\\x1b[43m',\n blue: '\\x1b[44m',\n magenta: '\\x1b[45m',\n cyan: '\\x1b[46m',\n white: '\\x1b[47m'\n }\n};\n\nexport type Logger = {\n (...args: any[]): void;\n warn(...args: any[]): void;\n info(...args: any[]): void;\n error(...args: any[]): void;\n trace(...args: any[]): void;\n debug(...args: any[]): void;\n assert(...args: any[]): void;\n // log(...args: any[]): void;\n group(...args: any[]): void;\n groupCollapsed(...args: any[]): void;\n groupEnd(...args: any[]): void;\n setPrefix(newPrefix: string): void;\n setLevel(level: 0 | 1 | 2 | 3 | 4): void;\n bindPrefix(prefix: string): Logger;\n};\n\nconst methods: ['debug' | 'info' | 'warn' | 'error' | 'assert' | 'trace'/* | 'log' */ | 'group' | 'groupCollapsed' | 'groupEnd', LogTypes][] = [\n ['debug', LogTypes.Debug],\n ['info', LogTypes.Log],\n ['warn', LogTypes.Warn],\n ['error', LogTypes.Error],\n ['assert', LogTypes.Error],\n ['trace', LogTypes.Log],\n ['group', LogTypes.Log],\n ['groupCollapsed', LogTypes.Log],\n ['groupEnd', LogTypes.Log]\n // [\"log\", LogTypes.Log]\n];\n\nexport function logger(prefix: string, type: LogTypes = LogTypes.Log | LogTypes.Warn | LogTypes.Error, ignoreDebugReset = false, style = ''): Logger {\n let originalPrefix: string;\n if(!DEBUG && !ignoreDebugReset/* || true */) {\n type = LogTypes.Error;\n }\n\n if(!STYLES_SUPPORTED) {\n style = '';\n } else if(!style) {\n if(IS_SERVICE_WORKER) style = LOGGER_STYLES.fg.yellow;\n else if(IS_WEB_WORKER) style = LOGGER_STYLES.fg.cyan;\n }\n\n const originalStyle = style;\n if(style) style = `%s ${style}%s`;\n else style = '%s';\n\n // level = LogLevels.log | LogLevels.warn | LogLevels.error | LogLevels.debug\n\n const log: Logger = function(...args: any[]) {\n return type & LogTypes.Log && console.log(style, dT(), prefix, /* getCallerFunctionName(), */ ...args);\n } as any;\n\n methods.forEach(([method, logType]) => {\n log[method] = function(...args: any[]) {\n return type & logType && console[method](style, dT(), prefix, /* getCallerFunctionName(), */ ...args);\n };\n });\n\n log.setPrefix = function(newPrefix: string) {\n originalPrefix = newPrefix;\n prefix = '[' + newPrefix + ']';\n };\n\n log.setPrefix(prefix);\n\n log.setLevel = function(level: 0 | 1 | 2 | 3 | 4) {\n type = LOG_LEVELS.slice(0, level + 1).reduce((acc, v) => acc | v, 0) as any;\n };\n\n log.bindPrefix = function(prefix: string) {\n return logger(`${originalPrefix}] [${prefix}`, type, ignoreDebugReset, originalStyle);\n };\n\n return log;\n};\n","export default function pause(ms: number) {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport pause from '../../helpers/schedulers/pause';\n\nconst ctx = self as any as ServiceWorkerGlobalScope;\nexport const CACHE_ASSETS_NAME = 'cachedAssets';\n\nfunction isCorrectResponse(response: Response) {\n return response.ok && response.status === 200;\n}\n\nfunction timeoutRace>(promise: T) {\n return Promise.race([\n promise,\n pause(10000).then(() => Promise.reject())\n ]);\n}\n\nexport async function requestCache(event: FetchEvent) {\n try {\n // const cache = await ctx.caches.open(CACHE_ASSETS_NAME);\n const cache = await timeoutRace(ctx.caches.open(CACHE_ASSETS_NAME));\n const file = await timeoutRace(cache.match(event.request, {ignoreVary: true}));\n\n if(file && isCorrectResponse(file)) {\n return file;\n }\n\n const headers: HeadersInit = {'Vary': '*'};\n let response = await fetch(event.request, {headers});\n if(isCorrectResponse(response)) {\n cache.put(event.request, response.clone());\n } else if(response.status === 304) { // possible fix for 304 in Safari\n const url = event.request.url.replace(/\\?.+$/, '') + '?' + (Math.random() * 100000 | 0);\n response = await fetch(url, {headers});\n if(isCorrectResponse(response)) {\n cache.put(event.request, response.clone());\n }\n }\n\n return response;\n } catch(err) {\n return fetch(event.request);\n }\n}\n","export default function noop() {}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport noop from './noop';\n\nexport interface CancellablePromise extends Promise {\n resolve?: (value: T) => void,\n reject?: (...args: any[]) => void,\n cancel?: (reason?: any) => void,\n\n notify?: (...args: any[]) => void,\n notifyAll?: (...args: any[]) => void,\n lastNotify?: any,\n listeners?: Array<(...args: any[]) => void>,\n addNotifyListener?: (callback: (...args: any[]) => void) => void,\n\n isFulfilled?: boolean,\n isRejected?: boolean\n}\n\nexport default function deferredPromise() {\n const deferredHelper: any = {\n isFulfilled: false,\n isRejected: false,\n\n notify: () => {},\n notifyAll: (...args: any[]) => {\n deferredHelper.lastNotify = args;\n deferredHelper.listeners.forEach((callback: any) => callback(...args));\n },\n\n listeners: [],\n addNotifyListener: (callback: (...args: any[]) => void) => {\n if(deferredHelper.lastNotify) {\n callback(...deferredHelper.lastNotify);\n }\n\n deferredHelper.listeners.push(callback);\n }\n };\n\n const deferred: CancellablePromise = new Promise((resolve, reject) => {\n deferredHelper.resolve = (value: T) => {\n if(deferred.isFulfilled || deferred.isRejected) return;\n\n deferred.isFulfilled = true;\n resolve(value);\n };\n\n deferredHelper.reject = (...args: any[]) => {\n if(deferred.isRejected || deferred.isFulfilled) return;\n\n deferred.isRejected = true;\n reject(...args);\n };\n });\n\n // @ts-ignore\n /* deferred.then = (resolve: (value: T) => any, reject: (...args: any[]) => any) => {\n const n = deferredPromise>();\n\n }; */\n\n deferred.catch(noop).finally(() => {\n deferred.notify = deferred.notifyAll = deferred.lastNotify = null;\n deferred.listeners.length = 0;\n\n if(deferred.cancel) {\n deferred.cancel = noop;\n }\n });\n\n Object.assign(deferred, deferredHelper);\n\n return deferred;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport blobSafeMimeType from './blobSafeMimeType';\n\nexport default function blobConstruct(blobParts: Array | T, mimeType: string = ''): Blob {\n if(!Array.isArray(blobParts)) {\n blobParts = [blobParts];\n }\n\n const safeMimeType = blobSafeMimeType(mimeType);\n const blob = new Blob(blobParts, {type: safeMimeType});\n return blob;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\n// https://www.iana.org/assignments/media-types/media-types.xhtml\nexport default function blobSafeMimeType(mimeType: string) {\n if([\n 'image/jpeg',\n 'image/png',\n 'image/gif',\n 'image/svg+xml',\n 'image/webp',\n 'image/bmp',\n 'video/mp4',\n 'video/webm',\n 'video/quicktime',\n 'audio/ogg',\n 'audio/mpeg',\n 'audio/mp4',\n 'audio/wav', // though it is not in list\n 'application/json',\n 'application/pdf'\n ].indexOf(mimeType) === -1) {\n return 'application/octet-stream';\n }\n\n return mimeType;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport blobConstruct from '../../helpers/blob/blobConstruct';\nimport StreamWriter from './streamWriter';\n\nexport default class MemoryWriter implements StreamWriter {\n private bytes: Uint8Array;\n\n constructor(\n private mimeType: string,\n private size: number,\n private saveFileCallback?: (blob: Blob) => Promise\n ) {\n this.bytes = new Uint8Array(size);\n }\n\n public async write(part: Uint8Array, offset: number) {\n // sometimes file size can be bigger than the prov\n const endOffset = offset + part.byteLength;\n if(endOffset > this.bytes.byteLength) {\n const newBytes = new Uint8Array(endOffset);\n newBytes.set(this.bytes, 0);\n this.bytes = newBytes;\n }\n\n this.bytes.set(part, offset);\n };\n\n public truncate() {\n this.bytes = new Uint8Array();\n }\n\n public trim(size: number) {\n this.bytes = this.bytes.slice(0, size);\n }\n\n public finalize(saveToStorage = true) {\n const blob = blobConstruct(this.bytes, this.mimeType);\n\n if(saveToStorage && this.saveFileCallback) {\n this.saveFileCallback(blob);\n }\n\n return blob;\n }\n\n public getParts() {\n return this.bytes;\n }\n\n public replaceParts(parts: Uint8Array) {\n this.bytes = parts;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Modes from '../../config/modes';\nimport blobConstruct from '../../helpers/blob/blobConstruct';\nimport MemoryWriter from './memoryWriter';\nimport FileManager from './memoryWriter';\nimport FileStorage from './fileStorage';\nimport makeError from '../../helpers/makeError';\nimport deferredPromise from '../../helpers/cancellablePromise';\n\nexport type CacheStorageDbName = 'cachedFiles' | 'cachedStreamChunks' | 'cachedAssets';\n\nexport default class CacheStorageController implements FileStorage {\n private static STORAGES: CacheStorageController[] = [];\n private openDbPromise: Promise;\n\n private useStorage = true;\n\n // private log: ReturnType = logger('CS');\n\n constructor(private dbName: CacheStorageDbName) {\n if(Modes.test) {\n this.dbName += '_test';\n }\n\n if(CacheStorageController.STORAGES.length) {\n this.useStorage = CacheStorageController.STORAGES[0].useStorage;\n }\n\n this.openDatabase();\n CacheStorageController.STORAGES.push(this);\n }\n\n private openDatabase(): Promise {\n return this.openDbPromise ?? (this.openDbPromise = caches.open(this.dbName));\n }\n\n public delete(entryName: string) {\n return this.timeoutOperation((cache) => cache.delete('/' + entryName));\n }\n\n public deleteAll() {\n return caches.delete(this.dbName);\n }\n\n public get(entryName: string) {\n return this.timeoutOperation((cache) => cache.match('/' + entryName));\n }\n\n public save(entryName: string, response: Response) {\n // return new Promise((resolve) => {}); // DEBUG\n return this.timeoutOperation((cache) => cache.put('/' + entryName, response));\n }\n\n public getFile(fileName: string, method: 'blob' | 'json' | 'text' = 'blob'): Promise {\n // if(method === 'blob') {\n // return Promise.reject(makeError('NO_ENTRY_FOUND'));\n // }\n\n // const str = `get fileName: ${fileName}`;\n // console.time(str);\n return this.get(fileName).then((response) => {\n if(!response) {\n // console.warn('getFile:', response, fileName);\n throw makeError('NO_ENTRY_FOUND');\n }\n\n const promise = response[method]();\n // promise.then(() => {\n // console.timeEnd(str);\n // });\n return promise;\n });\n }\n\n public saveFile(fileName: string, blob: Blob | Uint8Array) {\n // return Promise.resolve(blobConstruct([blob]));\n if(!(blob instanceof Blob)) {\n blob = blobConstruct(blob);\n }\n\n const response = new Response(blob, {\n headers: {\n 'Content-Length': '' + blob.size\n }\n });\n\n return this.save(fileName, response).then(() => blob as Blob);\n }\n\n public timeoutOperation(callback: (cache: Cache) => Promise) {\n if(!this.useStorage) {\n return Promise.reject(makeError('STORAGE_OFFLINE'));\n }\n\n return new Promise(async(resolve, reject) => {\n let rejected = false;\n const timeout = setTimeout(() => {\n reject();\n // console.warn('CACHESTORAGE TIMEOUT');\n rejected = true;\n }, 15e3);\n\n try {\n const cache = await this.openDatabase();\n if(!cache) {\n this.useStorage = false;\n this.openDbPromise = undefined;\n throw 'no cache?';\n }\n\n const res = await callback(cache);\n\n if(rejected) return;\n resolve(res);\n } catch(err) {\n reject(err);\n }\n\n clearTimeout(timeout);\n });\n }\n\n public prepareWriting(fileName: string, fileSize: number, mimeType: string) {\n return {\n deferred: deferredPromise(),\n getWriter: () => {\n const writer = new MemoryWriter(mimeType, fileSize, (blob) => {\n return this.saveFile(fileName, blob).catch(() => blob);\n });\n\n return writer;\n }\n };\n }\n\n public static toggleStorage(enabled: boolean, clearWrite: boolean) {\n return Promise.all(this.STORAGES.map((storage) => {\n storage.useStorage = enabled;\n\n if(!clearWrite) {\n return;\n }\n\n if(!enabled) {\n return storage.deleteAll();\n }\n }));\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport readBlobAsUint8Array from '../../helpers/blob/readBlobAsUint8Array';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport debounce from '../../helpers/schedulers/debounce';\nimport {InputFileLocation} from '../../layer';\nimport CacheStorageController from '../files/cacheStorage';\nimport {DownloadOptions, MyUploadFile} from '../mtproto/apiFileManager';\nimport {getMtprotoMessagePort, log, serviceMessagePort} from './index.service';\nimport {ServiceRequestFilePartTaskPayload} from './serviceMessagePort';\nimport timeout from './timeout';\n\nconst deferredPromises: Map}> = new Map();\nconst cacheStorage = new CacheStorageController('cachedStreamChunks');\nconst CHUNK_TTL = 86400;\nconst CHUNK_CACHED_TIME_HEADER = 'Time-Cached';\nconst USE_CACHE = true;\n\nconst clearOldChunks = () => {\n return cacheStorage.timeoutOperation((cache) => {\n return cache.keys().then((requests) => {\n const filtered: Map = new Map();\n const timestamp = Date.now() / 1000 | 0;\n for(const request of requests) {\n const match = request.url.match(/\\/(\\d+?)\\?/);\n if(match && !filtered.has(match[1])) {\n filtered.set(match[1], request);\n }\n }\n\n const promises: Promise[] = [];\n for(const [id, request] of filtered) {\n const promise = cache.match(request).then((response) => {\n if((+response.headers.get(CHUNK_CACHED_TIME_HEADER) + CHUNK_TTL) <= timestamp) {\n log('will delete stream chunk:', id);\n return cache.delete(request, {ignoreSearch: true, ignoreVary: true});\n }\n });\n\n promises.push(promise);\n }\n\n return Promise.all(promises);\n });\n });\n};\n\nsetInterval(clearOldChunks, 1800e3);\nsetInterval(() => {\n const mtprotoMessagePort = getMtprotoMessagePort();\n for(const [messagePort, promises] of deferredPromises) {\n if(messagePort !== mtprotoMessagePort) {\n for(const taskId in promises) {\n const promise = promises[taskId];\n promise.reject();\n }\n\n deferredPromises.delete(messagePort);\n }\n }\n}, 120e3);\n\ntype StreamRange = [number, number];\ntype StreamId = DocId;\nconst streams: Map = new Map();\nclass Stream {\n private destroyDebounced: () => void;\n private id: StreamId;\n private limitPart: number;\n private loadedOffsets: Set = new Set();\n\n constructor(private info: DownloadOptions) {\n this.id = Stream.getId(info);\n streams.set(this.id, this);\n\n // ! если грузить очень большое видео чанками по 512Кб в мобильном Safari, то стрим не запустится\n this.limitPart = info.size > (75 * 1024 * 1024) ? STREAM_CHUNK_UPPER_LIMIT : STREAM_CHUNK_MIDDLE_LIMIT;\n this.destroyDebounced = debounce(this.destroy, 150000, false, true);\n }\n\n private destroy = () => {\n streams.delete(this.id);\n };\n\n private async requestFilePartFromWorker(alignedOffset: number, limit: number, fromPreload = false) {\n const payload: ServiceRequestFilePartTaskPayload = {\n docId: this.id,\n dcId: this.info.dcId,\n offset: alignedOffset,\n limit\n };\n\n const taskId = JSON.stringify(payload);\n\n const mtprotoMessagePort = getMtprotoMessagePort();\n let promises = deferredPromises.get(mtprotoMessagePort);\n if(!promises) {\n deferredPromises.set(mtprotoMessagePort, promises = {});\n }\n\n let deferred = promises[taskId];\n if(deferred) {\n return deferred.then((uploadFile) => uploadFile.bytes);\n }\n\n this.loadedOffsets.add(alignedOffset);\n\n deferred = promises[taskId] = deferredPromise();\n\n serviceMessagePort.invoke('requestFilePart', payload, undefined, mtprotoMessagePort)\n .then(deferred.resolve, deferred.reject).finally(() => {\n if(promises[taskId] === deferred) {\n delete promises[taskId];\n\n if(!Object.keys(promises).length) {\n deferredPromises.delete(mtprotoMessagePort);\n }\n }\n });\n\n const bytesPromise = deferred.then((uploadFile) => uploadFile.bytes);\n\n if(USE_CACHE) {\n this.saveChunkToCache(bytesPromise, alignedOffset, limit);\n !fromPreload && this.preloadChunks(alignedOffset, alignedOffset + (this.limitPart * 15));\n }\n\n return bytesPromise;\n }\n\n private requestFilePartFromCache(alignedOffset: number, limit: number, fromPreload?: boolean) {\n if(!USE_CACHE) {\n return Promise.resolve();\n }\n\n const key = this.getChunkKey(alignedOffset, limit);\n return cacheStorage.getFile(key).then((blob: Blob) => {\n return fromPreload ? new Uint8Array() : readBlobAsUint8Array(blob);\n }, (error: ApiError) => {\n if(error.type === 'NO_ENTRY_FOUND') {\n return;\n }\n });\n }\n\n private requestFilePart(alignedOffset: number, limit: number, fromPreload?: boolean) {\n return this.requestFilePartFromCache(alignedOffset, limit, fromPreload).then((bytes) => {\n return bytes || this.requestFilePartFromWorker(alignedOffset, limit, fromPreload);\n });\n }\n\n private saveChunkToCache(deferred: Promise, alignedOffset: number, limit: number) {\n return deferred.then((bytes) => {\n const key = this.getChunkKey(alignedOffset, limit);\n const response = new Response(bytes, {\n headers: {\n 'Content-Length': '' + bytes.length,\n 'Content-Type': 'application/octet-stream',\n [CHUNK_CACHED_TIME_HEADER]: '' + (Date.now() / 1000 | 0)\n }\n });\n\n return cacheStorage.save(key, response);\n });\n }\n\n private preloadChunk(offset: number) {\n if(this.loadedOffsets.has(offset)) {\n return;\n }\n\n this.loadedOffsets.add(offset);\n this.requestFilePart(offset, this.limitPart, true);\n }\n\n private preloadChunks(offset: number, end: number) {\n if(end > this.info.size) {\n end = this.info.size;\n }\n\n if(!offset) { // load last chunk for bounds\n this.preloadChunk(alignOffset(offset, this.limitPart));\n } else { // don't preload next chunks before the start\n for(; offset < end; offset += this.limitPart) {\n this.preloadChunk(offset);\n }\n }\n }\n\n public requestRange(range: StreamRange) {\n this.destroyDebounced();\n\n const possibleResponse = responseForSafariFirstRange(range, this.info.mimeType, this.info.size);\n if(possibleResponse) {\n return possibleResponse;\n }\n\n let [offset, end] = range;\n\n /* if(info.size > limitPart && isSafari && offset === limitPart) {\n //end = info.size - 1;\n //offset = info.size - 1 - limitPart;\n offset = info.size - (info.size % limitPart);\n } */\n\n const limit = end && end < this.limitPart ? alignLimit(end - offset + 1) : this.limitPart;\n const alignedOffset = alignOffset(offset, limit);\n\n if(!end) {\n end = Math.min(offset + limit, this.info.size - 1);\n }\n\n return this.requestFilePart(alignedOffset, limit).then((ab) => {\n // log.debug('[stream] requestFilePart result:', result);\n\n // if(isSafari) {\n if(offset !== alignedOffset || end !== (alignedOffset + limit)) {\n ab = ab.slice(offset - alignedOffset, end - alignedOffset + 1);\n }\n\n const headers: Record = {\n 'Accept-Ranges': 'bytes',\n 'Content-Range': `bytes ${offset}-${offset + ab.byteLength - 1}/${this.info.size || '*'}`,\n 'Content-Length': `${ab.byteLength}`\n };\n\n if(this.info.mimeType) {\n headers['Content-Type'] = this.info.mimeType;\n }\n\n // simulate slow connection\n // setTimeout(() => {\n return new Response(ab, {\n status: 206,\n statusText: 'Partial Content',\n headers\n });\n // }, 2.5e3);\n });\n }\n\n private getChunkKey(alignedOffset: number, limit: number) {\n return this.id + '?offset=' + alignedOffset + '&limit=' + limit;\n }\n\n public static get(info: DownloadOptions) {\n return streams.get(this.getId(info)) ?? new Stream(info);\n }\n\n private static getId(info: DownloadOptions) {\n return (info.location as InputFileLocation.inputDocumentFileLocation).id;\n }\n}\n\nexport default function onStreamFetch(event: FetchEvent, params: string) {\n const range = parseRange(event.request.headers.get('Range'));\n const info: DownloadOptions = JSON.parse(decodeURIComponent(params));\n const stream = Stream.get(info);\n\n // log.debug('[stream]', url, offset, end);\n\n event.respondWith(Promise.race([\n timeout(45 * 1000),\n stream.requestRange(range)\n ]));\n}\n\nfunction responseForSafariFirstRange(range: StreamRange, mimeType: string, size: number): Response {\n if(range[0] === 0 && range[1] === 1) {\n return new Response(new Uint8Array(2).buffer, {\n status: 206,\n statusText: 'Partial Content',\n headers: {\n 'Accept-Ranges': 'bytes',\n 'Content-Range': `bytes 0-1/${size || '*'}`,\n 'Content-Length': '2',\n 'Content-Type': mimeType || 'video/mp4'\n }\n });\n }\n\n return null;\n}\n\n/* const STREAM_CHUNK_UPPER_LIMIT = 256 * 1024;\nconst SMALLEST_CHUNK_LIMIT = 256 * 4; */\n/* const STREAM_CHUNK_UPPER_LIMIT = 1024 * 1024;\nconst SMALLEST_CHUNK_LIMIT = 1024 * 4; */\nconst STREAM_CHUNK_MIDDLE_LIMIT = 512 * 1024;\nconst STREAM_CHUNK_UPPER_LIMIT = 1024 * 1024;\nconst SMALLEST_CHUNK_LIMIT = 512 * 4;\n\nfunction parseRange(header: string): StreamRange {\n if(!header) return [0, 0];\n const [, chunks] = header.split('=');\n const ranges = chunks.split(', ');\n const [offset, end] = ranges[0].split('-');\n\n return [+offset, +end || 0];\n}\n\nfunction alignOffset(offset: number, base = SMALLEST_CHUNK_LIMIT) {\n return offset - (offset % base);\n}\n\nfunction alignLimit(limit: number) {\n return 2 ** Math.ceil(Math.log(limit) / Math.log(2));\n}\n","// * Jolly Cobra's schedulers\n\nimport ctx from '../../environment/ctx';\nimport {AnyFunction, Awaited} from '../../types';\nimport noop from '../noop';\n\nexport type DebounceReturnType = {\n (...args: Parameters): Promise>>;\n clearTimeout(): void;\n isDebounced(): boolean;\n};\n\nexport default function debounce(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n shouldRunLast = true\n): DebounceReturnType {\n let waitingTimeout: number;\n let waitingPromise: Promise>>, resolve: (result: any) => void, reject: () => void;\n let hadNewCall = false;\n\n const invoke = (args: Parameters) => {\n const _resolve = resolve, _reject = reject;\n try {\n const result = fn.apply(null, args);\n _resolve(result);\n } catch(err) {\n console.error('debounce error', err);\n // @ts-ignore\n _reject(err);\n }\n };\n\n const debounce = (...args: Parameters) => {\n if(!waitingPromise) waitingPromise = new Promise((_resolve, _reject) => (resolve = _resolve, reject = _reject));\n\n if(waitingTimeout) {\n clearTimeout(waitingTimeout);\n hadNewCall = true;\n reject();\n waitingPromise = new Promise((_resolve, _reject) => (resolve = _resolve, reject = _reject));\n } else if(shouldRunFirst) {\n invoke(args);\n hadNewCall = false;\n }\n\n const _waitingTimeout = ctx.setTimeout(() => {\n // will run if should run last or first but with new call\n if(shouldRunLast && (!shouldRunFirst || hadNewCall)) {\n invoke(args);\n }\n\n // if debounce was called during invoking\n if(waitingTimeout === _waitingTimeout) {\n waitingTimeout = waitingPromise = resolve = reject = undefined;\n hadNewCall = false;\n }\n }, ms);\n\n waitingTimeout = _waitingTimeout;\n waitingPromise.catch(noop);\n return waitingPromise;\n };\n\n debounce.clearTimeout = () => {\n if(waitingTimeout) {\n ctx.clearTimeout(waitingTimeout);\n reject();\n waitingTimeout = waitingPromise = resolve = reject = undefined;\n hadNewCall = false;\n }\n };\n\n debounce.isDebounced = () => !!waitingTimeout;\n\n return debounce;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport readBlobAsArrayBuffer from './readBlobAsArrayBuffer';\n\nexport default function readBlobAsUint8Array(blob: Blob) {\n return readBlobAsArrayBuffer(blob).then((buffer) => new Uint8Array(buffer));\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport readBlobAs from './readBlobAs';\n\nexport default function readBlobAsArrayBuffer(blob: Blob) {\n return readBlobAs(blob, 'readAsArrayBuffer');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import { IS_WEB_WORKER } from \"../context\";\n\n// const id = IS_WEB_WORKER ? Math.random() * 0x1000 | 0 : 0;\nexport default function readBlobAs(blob: Blob, method: 'readAsText'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsDataURL'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsArrayBuffer'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsArrayBuffer' | 'readAsText' | 'readAsDataURL'): Promise {\n // const perf = performance.now();\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.addEventListener('loadend', (e) => {\n // console.log(`readBlobAs [${id}] ${method} time ${performance.now() - perf}`);\n resolve(e.target.result);\n });\n reader[method](blob);\n });\n}\n","export default function deepEqual(x: any, y: any): boolean {\n const ok = Object.keys, tx = typeof x, ty = typeof y;\n return x && y && tx === 'object' && tx === ty ? (\n ok(x).length === ok(y).length &&\n ok(x).every((key) => deepEqual(x[key], y[key]))\n ) : (x === y);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {Database} from '../../config/databases';\nimport Modes from '../../config/modes';\nimport makeError from '../../helpers/makeError';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport {logger} from '../logger';\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/createIndex\n */\nexport type IDBIndex = {\n indexName: string,\n keyPath: string,\n objectParameters: IDBIndexParameters\n};\n\nexport type IDBStore = {\n name: string,\n indexes?: IDBIndex[]\n};\n\nexport type IDBOptions = {\n name?: string,\n storeName: string,\n stores?: IDBStore[],\n version?: number\n};\n\nconst DEBUG = false;\n\nexport class IDB {\n private static INSTANCES: IDB[] = [];\n private openDbPromise: Promise;\n private db: IDBDatabase;\n private storageIsAvailable: boolean;\n private log: ReturnType;\n private name: string;\n private version: number;\n private stores: IDBStore[];\n\n constructor(db: Database) {\n safeAssign(this, db);\n\n if(Modes.test) {\n this.name += '_test';\n }\n\n this.storageIsAvailable = true;\n this.log = logger(['IDB', db.name].join('-'));\n this.log('constructor');\n\n this.openDatabase(true);\n\n IDB.INSTANCES.push(this);\n }\n\n public isAvailable() {\n return this.storageIsAvailable;\n }\n\n public openDatabase(createNew = false): Promise {\n if(this.openDbPromise && !createNew) {\n return this.openDbPromise;\n }\n\n const createIndexes = (os: IDBObjectStore, store: IDBStore) => {\n const indexNames = Array.from(os.indexNames);\n for(const indexName of indexNames) {\n os.deleteIndex(indexName);\n }\n\n if(!store.indexes?.length) {\n return;\n }\n\n for(const index of store.indexes) {\n if(os.indexNames.contains(index.indexName)) {\n continue;\n }\n\n os.createIndex(index.indexName, index.keyPath, index.objectParameters);\n }\n };\n\n const createObjectStore = (db: IDBDatabase, store: IDBStore) => {\n const os = db.createObjectStore(store.name);\n createIndexes(os, store);\n };\n\n try {\n var request = indexedDB.open(this.name, this.version);\n\n if(!request) {\n return Promise.reject();\n }\n } catch(error) {\n this.log.error('error opening db', (error as Error).message);\n this.storageIsAvailable = false;\n return Promise.reject(error);\n }\n\n let finished = false;\n setTimeout(() => {\n if(!finished) {\n request.onerror(makeError('IDB_CREATE_TIMEOUT') as Event);\n }\n }, 3000);\n\n return this.openDbPromise = new Promise((resolve, reject) => {\n request.onsuccess = (event) => {\n finished = true;\n const db = request.result;\n let calledNew = false;\n\n this.log('Opened');\n\n db.onerror = (error) => {\n this.storageIsAvailable = false;\n this.log.error('Error creating/accessing IndexedDB database', error);\n reject(error);\n };\n\n db.onclose = (e) => {\n this.log.error('closed:', e);\n !calledNew && this.openDatabase();\n };\n\n db.onabort = (e) => {\n this.log.error('abort:', e);\n const transaction = e.target as IDBTransaction;\n\n this.openDatabase(calledNew = true);\n\n if(transaction.onerror) {\n transaction.onerror(e);\n }\n\n db.close();\n };\n\n db.onversionchange = (e) => {\n this.log.error('onversionchange, lol?');\n };\n\n resolve(this.db = db);\n };\n\n request.onerror = (event) => {\n finished = true;\n this.storageIsAvailable = false;\n this.log.error('Error creating/accessing IndexedDB database', event);\n reject(event);\n };\n\n request.onupgradeneeded = (event) => {\n finished = true;\n this.log.warn('performing idb upgrade from', event.oldVersion, 'to', event.newVersion);\n\n const target = event.target as IDBOpenDBRequest;\n const db = target.result;\n this.stores.forEach((store) => {\n /* if(db.objectStoreNames.contains(store.name)) {\n //if(event.oldVersion === 1) {\n db.deleteObjectStore(store.name);\n //}\n } */\n\n if(!db.objectStoreNames.contains(store.name)) {\n createObjectStore(db, store);\n } else {\n const txn = target.transaction;\n const os = txn.objectStore(store.name);\n createIndexes(os, store);\n }\n });\n };\n });\n }\n\n public static create>(db: T) {\n return this.INSTANCES.find((instance) => instance.name === db.name) ?? new IDB(db);\n }\n\n public static closeDatabases(preserve?: IDB) {\n this.INSTANCES.forEach((storage) => {\n if(preserve && preserve === storage) {\n return;\n }\n\n const db = storage.db;\n if(db) {\n db.onclose = () => {};\n db.close();\n }\n });\n }\n}\n\nexport default class IDBStorage, StoreName extends string = T['stores'][0]['name']> {\n private log: ReturnType;\n private storeName: T['stores'][0]['name'];\n private idb: IDB;\n\n constructor(db: T, storeName: typeof db['stores'][0]['name']) {\n this.storeName = storeName;\n this.log = logger(['IDB', db.name, storeName].join('-'));\n this.idb = IDB.create(db);\n }\n\n /**\n * ! WARNING ! function requires at least one opened connection\n */\n /* public static clearObjectStores() {\n const storage = this.STORAGES[0];\n this.closeDatabases(storage);\n\n const names = Array.from(storage.db.objectStoreNames);\n const promises = names.map((name) => storage.clear(name));\n return Promise.all(promises);\n } */\n\n /* public static deleteDatabase() {\n this.closeDatabases();\n\n const storages = this.STORAGES;\n const dbNames = Array.from(new Set(storages.map((storage) => storage.name)));\n const promises = dbNames.map((dbName) => {\n return new Promise((resolve, reject) => {\n const deleteRequest = indexedDB.deleteDatabase(dbName);\n\n deleteRequest.onerror = () => {\n reject();\n };\n\n deleteRequest.onsuccess = () => {\n resolve();\n };\n });\n });\n\n return Promise.all(promises);\n } */\n\n public delete(entryName: string | string[], storeName?: StoreName): Promise {\n // return Promise.resolve();\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n entryName = [].concat(entryName);\n }\n\n return this.getObjectStore('readwrite', (objectStore) => {\n const promises = (entryName as string[]).map((entryName) => objectStore.delete(entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'delete: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n public clear(storeName?: StoreName): Promise {\n return this.getObjectStore('readwrite', (objectStore) => objectStore.clear(), DEBUG ? 'clear' : '', storeName);\n }\n\n public save(entryName: string | string[], value: any | any[], storeName?: StoreName) {\n // const handleError = (error: Error) => {\n // this.log.error('save: transaction error:', entryName, value, db, error, error && error.name);\n // if((!error || error.name === 'InvalidStateError')/* && false */) {\n // setTimeout(() => {\n // this.save(entryName, value);\n // }, 2e3);\n // } else {\n // //console.error('IndexedDB saveFile transaction error:', error, error && error.name);\n // }\n // };\n\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n entryName = [].concat(entryName);\n value = [].concat(value);\n }\n\n return this.getObjectStore('readwrite', (objectStore) => {\n const promises = (entryName as string[]).map((entryName, idx) => objectStore.put(value[idx], entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'save: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n // public saveFile(fileName: string, blob: Blob | Uint8Array) {\n // //return Promise.resolve(blobConstruct([blob]));\n // if(!(blob instanceof Blob)) {\n // blob = blobConstruct(blob);\n // }\n\n // return this.save(fileName, blob);\n // }\n\n /* public saveFileBase64(db: IDBDatabase, fileName: string, blob: Blob | any): Promise {\n if(this.getBlobSize(blob) > 10 * 1024 * 1024) {\n return Promise.reject();\n }\n\n if(!(blob instanceof Blob)) {\n var safeMimeType = blobSafeMimeType(blob.type || 'image/jpeg');\n var address = 'data:' + safeMimeType + ';base64,' + bytesToBase64(blob);\n return this.storagePutB64String(db, fileName, address).then(() => {\n return blob;\n });\n }\n\n try {\n var reader = new FileReader();\n } catch (e) {\n this.storageIsAvailable = false;\n return Promise.reject();\n }\n\n let promise = new Promise((resolve, reject) => {\n reader.onloadend = () => {\n this.storagePutB64String(db, fileName, reader.result as string).then(() => {\n resolve(blob);\n }, reject);\n }\n\n reader.onerror = reject;\n });\n\n\n try {\n reader.readAsDataURL(blob);\n } catch (e) {\n this.storageIsAvailable = false;\n return Promise.reject();\n }\n\n return promise;\n }\n\n public storagePutB64String(db: IDBDatabase, fileName: string, b64string: string) {\n try {\n var objectStore = db.transaction([this.storeName], 'readwrite')\n .objectStore(this.storeName);\n var request = objectStore.put(b64string, fileName);\n } catch(error) {\n this.storageIsAvailable = false;\n return Promise.reject(error);\n }\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n resolve();\n };\n\n request.onerror = reject;\n });\n }\n\n public getBlobSize(blob: any) {\n return blob.size || blob.byteLength || blob.length;\n } */\n\n public get(entryName: string[], storeName?: StoreName): Promise;\n public get(entryName: string, storeName?: StoreName): Promise;\n public get(entryName: string | string[], storeName?: StoreName): Promise | Promise {\n // return Promise.reject();\n\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n if(!entryName) {\n return undefined;\n }\n\n entryName = [].concat(entryName);\n } else if(!entryName.length) {\n return Promise.resolve([]) as any;\n }\n\n return this.getObjectStore('readonly', (objectStore) => {\n const promises = (entryName as string[]).map((entryName) => objectStore.get(entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'get: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n private getObjectStore(\n mode: IDBTransactionMode,\n callback: (objectStore: IDBObjectStore) => IDBRequest | IDBRequest[],\n log?: string,\n storeName = this.storeName\n ) {\n let perf: number;\n\n if(log) {\n perf = performance.now();\n this.log(log + ': start');\n }\n\n return this.idb.openDatabase().then((db) => {\n return new Promise((resolve, reject) => {\n /* if(mode === 'readwrite') {\n return;\n } */\n\n const transaction = db.transaction([storeName], mode);\n\n const onError = () => {\n clearTimeout(timeout);\n reject(transaction.error);\n };\n\n // let resolved = false;\n const onComplete = (/* what: string */) => {\n clearTimeout(timeout);\n\n if(log) {\n this.log(log + ': end', performance.now() - perf/* , what */);\n }\n\n // if(resolved) {\n // return;\n // }\n\n // resolved = true;\n const results = requests.map((r) => r.result);\n resolve(isArray ? results : results[0]);\n };\n\n transaction.onerror = onError;\n\n // * have to wait while clearing or setting something\n const waitForTransactionComplete = mode === 'readwrite';\n if(waitForTransactionComplete) {\n transaction.oncomplete = () => onComplete(/* 'transaction' */);\n }\n\n const timeout = setTimeout(() => {\n this.log.error('transaction not finished', transaction, log);\n }, 10000);\n\n /* transaction.addEventListener('abort', (e) => {\n //handleError();\n this.log.error('IndexedDB: transaction abort!', transaction.error);\n }); */\n\n const callbackResult = callback(transaction.objectStore(storeName));\n\n const isArray = Array.isArray(callbackResult);\n const requests: IDBRequest[] = isArray ? callbackResult : [].concat(callbackResult) as any;\n\n if(waitForTransactionComplete) {\n return;\n }\n\n const length = requests.length;\n let left = length;\n\n const onRequestFinished = () => {\n if(transaction.error) {\n return;\n }\n\n if(!--left) {\n onComplete(/* 'requests' */);\n }\n };\n\n for(let i = 0; i < length; ++i) {\n const request = requests[i];\n request.onerror = onError;\n request.onsuccess = onRequestFinished;\n }\n });\n });\n }\n\n public getAll(storeName?: StoreName): Promise {\n return this.getObjectStore('readonly', (objectStore) => objectStore.getAll(), DEBUG ? 'getAll' : '', storeName);\n }\n\n /* public getAllKeys(): Promise> {\n console.time('getAllEntries');\n return this.openDatabase().then((db) => {\n var objectStore = db.transaction([this.storeName], 'readonly')\n .objectStore(this.storeName);\n var request = objectStore.getAllKeys();\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n // @ts-ignore\n var result = event.target.result;\n resolve(result);\n console.timeEnd('getAllEntries');\n }\n\n request.onerror = reject;\n });\n });\n } */\n\n /* public isFileExists(fileName: string): Promise {\n console.time('isFileExists');\n return this.openDatabase().then((db) => {\n var objectStore = db.transaction([this.storeName], 'readonly')\n .objectStore(this.storeName);\n var request = objectStore.openCursor(fileName);\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n // @ts-ignore\n var cursor = event.target.result;\n resolve(!!cursor);\n console.timeEnd('isFileExists');\n }\n\n request.onerror = reject;\n });\n });\n } */\n\n /* public getFileWriter(fileName: string, mimeType: string) {\n var fakeWriter = FileManager.getFakeFileWriter(mimeType, (blob) => {\n return this.saveFile(fileName, blob);\n });\n\n return Promise.resolve(fakeWriter);\n } */\n}\n","export default function safeAssign(object: T, fromObject: any) {\n if(fromObject) {\n for(const i in fromObject) {\n if(fromObject[i] !== undefined) {\n // @ts-ignore\n object[i] = fromObject[i];\n }\n }\n }\n\n return object;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {Database} from '../../config/databases';\nimport DATABASE_STATE from '../../config/databases/state';\nimport {NOTIFICATION_BADGE_PATH, NOTIFICATION_ICON_PATH} from '../../config/notifications';\nimport {IS_FIREFOX, IS_MOBILE} from '../../environment/userAgent';\nimport deepEqual from '../../helpers/object/deepEqual';\nimport IDBStorage from '../files/idb';\nimport {log, serviceMessagePort} from './index.service';\nimport {ServicePushPingTaskPayload} from './serviceMessagePort';\n\nconst ctx = self as any as ServiceWorkerGlobalScope;\nconst defaultBaseUrl = location.protocol + '//' + location.hostname + location.pathname.split('/').slice(0, -1).join('/') + '/';\n\n// as in webPushApiManager.ts\nconst PING_PUSH_TIMEOUT = 10000 + 1500;\nlet lastPingTime = 0;\nlet localNotificationsAvailable = true;\n\nexport type PushNotificationObject = {\n loc_key: string,\n loc_args: string[],\n // user_id: number, // should be number\n custom: {\n channel_id?: string, // should be number\n chat_id?: string, // should be number\n from_id?: string, // should be number\n msg_id: string,\n peerId?: string, // should be number\n silent?: string // can be '1'\n },\n sound?: string,\n random_id: number,\n badge?: string, // should be number\n description: string,\n mute: string, // should be number\n title: string,\n message?: string,\n} & {\n action?: 'mute1d' | 'push_settings', // will be set before postMessage to main thread\n};\n\nclass SomethingGetter, Storage extends Record> {\n private cache: Partial = {};\n private storage: IDBStorage;\n\n constructor(\n db: T,\n storeName: typeof db['stores'][number]['name'],\n private defaults: {\n [Property in keyof Storage]: ((value: Storage[Property]) => Storage[Property]) | Storage[Property]\n }\n ) {\n this.storage = new IDBStorage(db, storeName);\n }\n\n private getDefault(key: T) {\n const callback = this.defaults[key];\n return typeof(callback) === 'function' ? callback() : callback;\n }\n\n public get(key: T) {\n if(this.cache.hasOwnProperty(key)) {\n return this.cache[key];\n }\n\n const promise = this.storage.get(key as string) as Promise;\n return promise.then((value) => value, () => undefined as Storage[T]).then((value) => {\n if(this.cache.hasOwnProperty(key)) {\n return this.cache[key];\n }\n\n value ??= this.getDefault(key);\n\n return this.cache[key] = value;\n });\n }\n\n public getCached(key: T) {\n const value = this.get(key);\n if(value instanceof Promise) {\n throw 'no property';\n }\n\n return value;\n }\n\n public async set(key: T, value: Storage[T]) {\n const cached = this.cache[key] ?? this.defaults[key];\n if(deepEqual(cached, value)) {\n return;\n }\n\n this.cache[key] = value;\n\n try {\n this.storage.save(key as string, value);\n } catch(err) {\n\n }\n }\n}\n\ntype PushStorage = {\n push_mute_until: number,\n push_lang: Partial\n push_settings: Partial\n};\n\nconst defaults: PushStorage = {\n push_mute_until: 0,\n push_lang: {\n push_message_nopreview: 'You have a new message',\n push_action_mute1d: 'Mute for 24H',\n push_action_settings: 'Settings'\n },\n push_settings: {}\n};\n\nconst getter = new SomethingGetter(DATABASE_STATE, 'session', defaults);\n\n// fill cache\nfor(const i in defaults) {\n getter.get(i as keyof PushStorage);\n}\n\nctx.addEventListener('push', (event) => {\n const obj: PushNotificationObject = event.data.json();\n log('push', {...obj});\n\n try {\n const [muteUntil, settings, lang] = [\n getter.getCached('push_mute_until'),\n getter.getCached('push_settings'),\n getter.getCached('push_lang')\n ];\n\n const nowTime = Date.now();\n if(\n userInvisibleIsSupported() &&\n muteUntil &&\n nowTime < muteUntil\n ) {\n throw `supress notification because mute for ${Math.ceil((muteUntil - nowTime) / 60000)} min`;\n }\n\n const hasActiveWindows = (Date.now() - lastPingTime) <= PING_PUSH_TIMEOUT && localNotificationsAvailable;\n if(hasActiveWindows) {\n throw 'supress notification because some instance is alive';\n }\n\n const notificationPromise = fireNotification(obj, settings, lang);\n event.waitUntil(notificationPromise);\n } catch(err) {\n log(err);\n\n const tag = 'fix';\n const notificationPromise = ctx.registration.showNotification('Telegram', {tag});\n\n notificationPromise.then(() => {\n closeAllNotifications(tag);\n });\n\n event.waitUntil(notificationPromise);\n }\n});\n\nctx.addEventListener('notificationclick', (event) => {\n const notification = event.notification;\n log('on notification click', notification);\n notification.close();\n\n const action = event.action as PushNotificationObject['action'];\n if(action === 'mute1d' && userInvisibleIsSupported()) {\n log('[SW] mute for 1d');\n getter.set('push_mute_until', Date.now() + 86400e3);\n return;\n }\n\n const data: PushNotificationObject = notification.data;\n if(!data) {\n return;\n }\n\n const promise = ctx.clients.matchAll({\n type: 'window'\n }).then((clientList) => {\n data.action = action;\n pendingNotification = data;\n for(let i = 0; i < clientList.length; ++i) {\n const client = clientList[i];\n if('focus' in client) {\n client.focus();\n serviceMessagePort.invokeVoid('pushClick', pendingNotification, client);\n pendingNotification = undefined;\n return;\n }\n }\n\n if(ctx.clients.openWindow) {\n return Promise.resolve(getter.get('push_settings')).then((settings) => {\n return ctx.clients.openWindow(settings.baseUrl || defaultBaseUrl);\n });\n }\n }).catch((error) => {\n log.error('Clients.matchAll error', error);\n })\n\n event.waitUntil(promise);\n});\n\nctx.addEventListener('notificationclose', onCloseNotification);\n\nconst notifications: Set = new Set();\nlet pendingNotification: PushNotificationObject;\nfunction pushToNotifications(notification: Notification) {\n if(!notifications.has(notification)) {\n notifications.add(notification);\n // @ts-ignore\n notification.onclose = onCloseNotification;\n }\n}\n\nfunction onCloseNotification(event: NotificationEvent) {\n removeFromNotifications(event.notification)\n}\n\nfunction removeFromNotifications(notification: Notification) {\n notifications.delete(notification);\n}\n\nexport function closeAllNotifications(tag?: string) {\n for(const notification of notifications) {\n try {\n if(tag && notification.tag !== tag) {\n continue;\n }\n\n notification.close();\n notifications.delete(notification);\n } catch(e) {}\n }\n\n let promise: Promise;\n if('getNotifications' in ctx.registration) {\n promise = ctx.registration.getNotifications({tag}).then((notifications) => {\n for(let i = 0, len = notifications.length; i < len; ++i) {\n try {\n notifications[i].close();\n } catch(e) {}\n }\n }).catch((error) => {\n log.error('Offline register SW error', error);\n });\n } else {\n promise = Promise.resolve();\n }\n\n return promise;\n}\n\nfunction userInvisibleIsSupported() {\n return IS_FIREFOX;\n}\n\nfunction fireNotification(obj: PushNotificationObject, settings: PushStorage['push_settings'], lang: PushStorage['push_lang']) {\n let title = obj.title || 'Telegram';\n let body = obj.description || '';\n let peerId: string;\n\n if(obj.custom) {\n if(obj.custom.channel_id) {\n peerId = '' + -obj.custom.channel_id;\n } else if(obj.custom.chat_id) {\n peerId = '' + -obj.custom.chat_id;\n } else {\n peerId = obj.custom.from_id || '';\n }\n }\n\n obj.custom.peerId = '' + peerId;\n let tag = 'peer' + peerId;\n\n const messageKey = peerId + '_' + obj.custom.msg_id;\n if(ignoreMessages) {\n const error = 'ignoring push';\n log.warn(error, obj);\n ignoreMessages.delete(messageKey);\n throw error;\n }\n\n if(settings?.nopreview) {\n title = 'Telegram';\n body = lang.push_message_nopreview;\n tag = 'unknown_peer';\n }\n\n const actions: (Omit & {action: PushNotificationObject['action']})[] = [{\n action: 'mute1d',\n title: lang.push_action_mute1d\n }/* , {\n action: 'push_settings',\n title: lang.push_action_settings || 'Settings'\n } */];\n\n const notificationOptions: NotificationOptions = {\n body,\n icon: NOTIFICATION_ICON_PATH,\n tag,\n data: obj,\n actions,\n badge: NOTIFICATION_BADGE_PATH,\n silent: obj.custom.silent === '1'\n };\n\n log('show notify', title, body, obj, notificationOptions);\n\n const notificationPromise = ctx.registration.showNotification(title, notificationOptions);\n\n return notificationPromise.catch((error) => {\n log.error('Show notification promise', error);\n });\n}\n\nexport function onPing(payload: ServicePushPingTaskPayload, source?: MessageEventSource) {\n lastPingTime = Date.now();\n localNotificationsAvailable = payload.localNotifications;\n\n if(pendingNotification && source) {\n serviceMessagePort.invokeVoid('pushClick', pendingNotification, source);\n pendingNotification = undefined;\n }\n\n if(payload.lang) {\n getter.set('push_lang', payload.lang);\n }\n\n if(payload.settings) {\n getter.set('push_settings', payload.settings);\n }\n}\n\nconst ignoreMessages: Set = new Set();\nexport function onShownNotification(payload: string) {\n ignoreMessages.add(payload);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Database} from '.';\nimport type {IDBIndex} from '../../lib/files/idb';\n\nconst DATABASE_STATE: Database<'session' | 'stickerSets' | 'users' | 'chats' | 'messages' | 'dialogs'> = {\n name: 'tweb',\n version: 7,\n stores: [{\n name: 'session'\n }, {\n name: 'stickerSets'\n }, {\n name: 'users'\n }, {\n name: 'chats'\n }, {\n name: 'dialogs'\n // indexes: [\n // ...(new Array(20 + 2).fill(0)).map((_, idx) => {\n // const name = `index_${idx}`;\n // const index: IDBIndex = {\n // indexName: name,\n // keyPath: name,\n // objectParameters: {}\n // };\n\n // return index\n // })\n // ]\n }, {\n name: 'messages'\n }]\n};\n\nexport default DATABASE_STATE;\n","export const NOTIFICATION_ICON_PATH = 'assets/img/logo_filled_rounded.png';\nexport const NOTIFICATION_BADGE_PATH = 'assets/img/logo_plain.svg'; // masked\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {WebPushApiManager} from '../mtproto/webPushApiManager';\nimport type {PushNotificationObject} from './push';\nimport type {MyUploadFile} from '../mtproto/apiFileManager';\nimport SuperMessagePort from '../mtproto/superMessagePort';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\n\nexport type ServicePushPingTaskPayload = {\n localNotifications: boolean,\n lang: {\n push_action_mute1d: string\n push_action_settings: string\n push_message_nopreview: string\n },\n settings: WebPushApiManager['settings']\n};\n\nexport type ServiceRequestFilePartTaskPayload = {\n docId: DocId,\n dcId: number,\n offset: number,\n limit: number\n};\n\nexport type ServiceDownloadTaskPayload = {\n headers: any,\n id: string\n};\n\nexport type ServiceEvent = {\n port: (payload: void, source: MessageEventSource, event: MessageEvent) => void\n};\n\nexport default class ServiceMessagePort extends SuperMessagePort<{\n // from main thread to service worker\n notificationsClear: () => void,\n toggleStorages: (payload: {enabled: boolean, clearWrite: boolean}) => void,\n pushPing: (payload: ServicePushPingTaskPayload, source: MessageEventSource, event: MessageEvent) => void,\n hello: (payload: void, source: MessageEventSource, event: MessageEvent) => void,\n shownNotification: (payload: string) => void,\n\n // from mtproto worker\n download: (payload: ServiceDownloadTaskPayload) => void,\n downloadChunk: (payload: {id: ServiceDownloadTaskPayload['id'], chunk: Uint8Array}) => void\n downloadFinalize: (payload: ServiceDownloadTaskPayload['id']) => void,\n downloadCancel: (payload: ServiceDownloadTaskPayload['id']) => void\n}, {\n // to main thread\n pushClick: (payload: PushNotificationObject) => void,\n hello: (payload: void, source: MessageEventSource) => void,\n share: (payload: ShareData) => void,\n\n // to mtproto worker\n requestFilePart: (payload: ServiceRequestFilePartTaskPayload) => Promise | MyUploadFile\n} & ServiceEvent, Master> {\n constructor() {\n super('SERVICE');\n\n MOUNT_CLASS_TO && (MOUNT_CLASS_TO.serviceMessagePort = this);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {ServiceDownloadTaskPayload} from './serviceMessagePort';\nimport type ServiceMessagePort from './serviceMessagePort';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport makeError from '../../helpers/makeError';\nimport pause from '../../helpers/schedulers/pause';\n\ntype DownloadType = Uint8Array;\ntype DownloadItem = ServiceDownloadTaskPayload & {\n // transformStream: TransformStream,\n readableStream: ReadableStream,\n // writableStream: WritableStream,\n // writer: WritableStreamDefaultWriter,\n // controller: TransformStreamDefaultController,\n controller: ReadableStreamController,\n promise: CancellablePromise,\n // downloadPromise: Promise,\n used?: boolean\n};\nconst downloadMap: Map = new Map();\nconst DOWNLOAD_ERROR = makeError('UNKNOWN');\nconst DOWNLOAD_TEST = false;\n\n(self as any).downloadMap = downloadMap;\n\ntype A = Parameters['addMultipleEventsListeners']>[0];\n\nconst events: A = {\n download: (payload) => {\n const {id} = payload;\n if(downloadMap.has(id)) {\n return Promise.reject(DOWNLOAD_ERROR);\n }\n\n // const y = (20 * 1024 * 1024) / payload.limitPart;\n // const strategy = new ByteLengthQueuingStrategy({highWaterMark: y});\n // let controller: TransformStreamDefaultController;\n const strategy = new CountQueuingStrategy({highWaterMark: 1});\n // const transformStream = new TransformStream(/* {\n // start: (_controller) => controller = _controller,\n // }, */undefined, strategy, strategy);\n\n // const {readable, writable} = transformStream;\n // const writer = writable.getWriter();\n\n const promise = deferredPromise();\n promise.then(() => {\n setTimeout(() => {\n downloadMap.delete(id);\n }, 5e3);\n }, () => {\n downloadMap.delete(id);\n });\n\n // writer.closed.then(promise.resolve, promise.reject);\n\n let controller: ReadableStreamController;\n const readable = new ReadableStream({\n start: (_controller) => {\n controller = _controller;\n },\n\n cancel: (reason) => {\n promise.reject(DOWNLOAD_ERROR);\n }\n }, strategy);\n\n // writer.closed.catch(noop).finally(() => {\n // log.error('closed writer');\n // onEnd();\n // });\n\n // const downloadPromise = writer.closed.catch(() => {throw DOWNLOAD_ERROR;});\n const item: DownloadItem = {\n ...payload,\n // transformStream,\n readableStream: readable,\n // writableStream: writable,\n // writer,\n // downloadPromise,\n promise,\n controller\n };\n\n downloadMap.set(id, item);\n\n // return downloadPromise;\n return promise.catch(() => {throw DOWNLOAD_ERROR});\n },\n\n downloadChunk: ({id, chunk}) => {\n const item = downloadMap.get(id);\n if(!item) {\n return Promise.reject();\n }\n\n // return item.controller.enqueue(chunk);\n // return item.writer.write(chunk);\n // @ts-ignore\n return item.controller.enqueue(chunk);\n },\n\n downloadFinalize: (id) => {\n const item = downloadMap.get(id);\n if(!item) {\n return Promise.reject();\n }\n\n item.promise.resolve();\n // return item.controller.terminate();\n // return item.writer.close();\n return item.controller.close();\n },\n\n downloadCancel: (id) => {\n const item = downloadMap.get(id);\n if(!item) {\n return;\n }\n\n item.promise.reject();\n // return item.controller.error();\n // return item.writer.abort();\n return item.controller.error();\n }\n};\n\nexport default function handleDownload(serviceMessagePort: ServiceMessagePort) {\n serviceMessagePort.addMultipleEventsListeners(events);\n\n return {\n onDownloadFetch,\n onClosedWindows: cancelAllDownloads\n };\n}\n\nfunction onDownloadFetch(event: FetchEvent, params: string) {\n const promise = pause(100).then(() => {\n const item = downloadMap.get(params);\n if(!item || (item.used && !DOWNLOAD_TEST)) {\n return;\n }\n\n item.used = true;\n const stream = item.readableStream;\n const response = new Response(stream, {headers: item.headers});\n return response;\n });\n\n event.respondWith(promise);\n}\n\nfunction cancelAllDownloads() {\n if(downloadMap.size) {\n for(const [id, item] of downloadMap) {\n // item.writer.abort().catch(noop);\n item.controller.error();\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {log, serviceMessagePort} from './index.service';\n\nconst deferred: {[id: string]: ShareData[]} = {};\n\nfunction parseFormData(formData: FormData): ShareData {\n return {\n files: formData.getAll('files') as File[],\n title: formData.get('title') as string,\n text: formData.get('text') as string,\n url: formData.get('url') as string\n };\n}\n\nasync function processShareEvent(formData: FormData, clientId: string) {\n try {\n log('share data', formData);\n const data = parseFormData(formData);\n (deferred[clientId] ??= []).push(data);\n } catch(err) {\n log.warn('something wrong with the data', err);\n }\n};\n\nexport function checkWindowClientForDeferredShare(windowClient: WindowClient) {\n const arr = deferred[windowClient.id];\n if(!arr) {\n return;\n }\n\n delete deferred[windowClient.id];\n\n log('releasing share events to client:', windowClient.id, 'length:', arr.length);\n arr.forEach((data) => {\n serviceMessagePort.invokeVoid('share', data, windowClient);\n });\n}\n\nexport default function onShareFetch(event: FetchEvent, params: string) {\n const promise = event.request.formData()\n .then((formData) => {\n processShareEvent(formData, event.resultingClientId)\n return Response.redirect('..');\n });\n\n event.respondWith(promise);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n \n \n \n\nimport {logger, LogTypes} from '../logger';\nimport {CACHE_ASSETS_NAME, requestCache} from './cache';\nimport onStreamFetch from './stream';\nimport {closeAllNotifications, onPing, onShownNotification} from './push';\nimport CacheStorageController from '../files/cacheStorage';\nimport {IS_SAFARI} from '../../environment/userAgent';\nimport ServiceMessagePort from './serviceMessagePort';\nimport listenMessagePort from '../../helpers/listenMessagePort';\nimport {getWindowClients} from '../../helpers/context';\nimport {MessageSendPort} from '../mtproto/superMessagePort';\nimport handleDownload from './download';\nimport onShareFetch, {checkWindowClientForDeferredShare} from './share';\n\nexport const log = logger('SW', LogTypes.Error | LogTypes.Debug | LogTypes.Log | LogTypes.Warn, true);\nconst ctx = self as any as ServiceWorkerGlobalScope;\n\n \nlet _mtprotoMessagePort: MessagePort;\nexport const getMtprotoMessagePort = () => _mtprotoMessagePort;\n\nconst sendMessagePort = (source: MessageSendPort) => {\n const channel = new MessageChannel();\n serviceMessagePort.attachPort(_mtprotoMessagePort = channel.port1);\n serviceMessagePort.invokeVoid('port', undefined, source, [channel.port2]);\n};\n\nconst sendMessagePortIfNeeded = (source: MessageSendPort) => {\n if(!connectedWindows.size && !_mtprotoMessagePort) {\n log('sending message port for mtproto');\n sendMessagePort(source);\n }\n};\n\nconst onWindowConnected = (source: WindowClient) => {\n log('window connected', source.id, 'windows before', connectedWindows.size);\n\n if(source.frameType === 'none') {\n log.warn('maybe a bugged Safari starting window', source.id);\n return;\n }\n\n log('windows', Array.from(connectedWindows));\n serviceMessagePort.invokeVoid('hello', undefined, source);\n sendMessagePortIfNeeded(source);\n connectedWindows.set(source.id, source);\n\n checkWindowClientForDeferredShare(source);\n};\n\nexport const serviceMessagePort = new ServiceMessagePort();\nserviceMessagePort.addMultipleEventsListeners({\n notificationsClear: closeAllNotifications,\n\n toggleStorages: ({enabled, clearWrite}) => {\n CacheStorageController.toggleStorage(enabled, clearWrite);\n },\n\n pushPing: (payload, source) => {\n onPing(payload, source);\n },\n\n hello: (payload, source) => {\n onWindowConnected(source as any as WindowClient);\n },\n\n shownNotification: onShownNotification\n});\n\nconst {\n onDownloadFetch,\n onClosedWindows: onDownloadClosedWindows\n} = handleDownload(serviceMessagePort);\n\n// * service worker can be killed, so won't get 'hello' event\ngetWindowClients().then((windowClients) => {\n log(`got ${windowClients.length} windows from the start`);\n windowClients.forEach((windowClient) => {\n onWindowConnected(windowClient);\n });\n});\n\nconst connectedWindows: Map = new Map();\n(self as any).connectedWindows = connectedWindows;\nlistenMessagePort(serviceMessagePort, undefined, (source) => {\n log('something has disconnected', source);\n const isWindowClient = source instanceof WindowClient;\n if(!isWindowClient || !connectedWindows.has(source.id)) {\n log.warn('it is not a window');\n return;\n }\n\n connectedWindows.delete(source.id);\n log('window disconnected, left', connectedWindows.size);\n if(!connectedWindows.size) {\n log.warn('no windows left');\n\n if(_mtprotoMessagePort) {\n serviceMessagePort.detachPort(_mtprotoMessagePort);\n _mtprotoMessagePort = undefined;\n }\n\n onDownloadClosedWindows();\n }\n});\n \n\nconst onFetch = (event: FetchEvent): void => {\n \n if(\n !IS_SAFARI &&\n event.request.url.indexOf(location.origin + '/') === 0 &&\n event.request.url.match(/\\.(js|css|jpe?g|json|wasm|png|mp3|svg|tgs|ico|woff2?|ttf|webmanifest?)(?:\\?.*)?$/)\n ) {\n return event.respondWith(requestCache(event));\n }\n \n\n try {\n // const [, url, scope, params] = /http[:s]+\\/\\/.*?(\\/(.*?)(?:$|\\/(.*)$))/.exec(event.request.url) || [];\n const [scope, params] = event.request.url.split('/').slice(-2);\n\n // log.debug('[fetch]:', event);\n\n switch(scope) {\n case 'stream': {\n onStreamFetch(event, params);\n break;\n }\n\n case 'download': {\n onDownloadFetch(event, params);\n break;\n }\n\n case 'share': {\n onShareFetch(event, params);\n break;\n }\n\n case 'ping': {\n event.respondWith(new Response('pong'));\n break;\n }\n }\n } catch(err) {\n log.error('fetch error', err);\n event.respondWith(new Response('', {\n status: 500,\n statusText: 'Internal Server Error',\n headers: {'Cache-Control': 'no-cache'}\n }));\n }\n};\n\nconst onChangeState = () => {\n ctx.onfetch = onFetch;\n};\n\nctx.addEventListener('install', (event) => {\n log('installing');\n event.waitUntil(ctx.skipWaiting().then(() => log('skipped waiting'))); // Activate worker immediately\n});\n\nctx.addEventListener('activate', (event) => {\n log('activating', ctx);\n event.waitUntil(ctx.caches.delete(CACHE_ASSETS_NAME).then(() => log('cleared assets cache')));\n event.waitUntil(ctx.clients.claim().then(() => log('claimed clients')));\n});\n\n// ctx.onerror = (error) => {\n// log.error('error:', error);\n// };\n\n// ctx.onunhandledrejection = (error) => {\n// log.error('onunhandledrejection:', error);\n// };\n\nctx.onoffline = ctx.ononline = onChangeState;\n\nonChangeState();\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type SuperMessagePort from '../lib/mtproto/superMessagePort';\nimport ctx from '../environment/ctx';\n\nexport default function listenMessagePort(\n messagePort: SuperMessagePort,\n onConnect?: (source: MessageEventSource) => void,\n onDisconnect?: (source: MessageEventSource) => void\n) {\n const attachPort = (listenPort: any, sendPort: any) => {\n messagePort.attachListenPort(listenPort);\n sendPort && messagePort.attachSendPort(sendPort);\n onConnect?.(listenPort);\n };\n\n messagePort.setOnPortDisconnect(onDisconnect);\n\n if(typeof(SharedWorkerGlobalScope) !== 'undefined') {\n (ctx as any as SharedWorkerGlobalScope).addEventListener('connect', (e) => attachPort(e.source, e.source));\n } else if(typeof(ServiceWorkerGlobalScope) !== 'undefined') {\n attachPort(ctx, null);\n } else {\n attachPort(ctx, ctx);\n }\n}\n","export default function timeout(delay: number): Promise {\n return new Promise(((resolve) => {\n setTimeout(() => {\n resolve(new Response('', {\n status: 408,\n statusText: 'Request timed out.'\n }));\n }, delay);\n }));\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [85], () => (__webpack_require__(6350)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".\" + \"887945ef5f43bc205112\" + \".bundle.js\";\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","(() => {\n if (typeof __webpack_require__ !== 'undefined') {\n var oldGetScript = __webpack_require__.u;\n var oldLoadScript = __webpack_require__.e;\n var queryMap = {};\n var countMap = {};\n var getRetryDelay = function () {\n return 3000;\n };\n __webpack_require__.u = function (chunkId) {\n var result = oldGetScript(chunkId);\n return (\n result +\n (queryMap.hasOwnProperty(chunkId) ? '?' + queryMap[chunkId] : '')\n );\n };\n __webpack_require__.e = function (chunkId) {\n var result = oldLoadScript(chunkId);\n return result.catch(function (error) {\n var retries = countMap.hasOwnProperty(chunkId)\n ? countMap[chunkId]\n : 999999;\n if (retries < 1) {\n var realSrc = oldGetScript(chunkId);\n error.message =\n 'Loading chunk ' +\n chunkId +\n ' failed after 999999 retries.\\n(' +\n realSrc +\n ')';\n error.request = realSrc;\n throw error;\n }\n return new Promise(function (resolve) {\n var retryAttempt = 999999 - retries + 1;\n setTimeout(function () {\n var retryAttemptString = '&retry-attempt=' + retryAttempt;\n var cacheBust = (function () {\n return Date.now();\n })();\n +retryAttemptString;\n queryMap[chunkId] = cacheBust;\n countMap[chunkId] = retries - 1;\n resolve(__webpack_require__.e(chunkId));\n }, getRetryDelay(retryAttempt));\n });\n });\n };\n }\n})();\n","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t670: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = this[\"webpackChunktweb\"] = this[\"webpackChunktweb\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","next","DEBUG","MOUNT_CLASS_TO","window","self","USER_AGENT","navigator","userAgent","IS_SAFARI","search","toLowerCase","indexOf","test","vendor","platform","maxTouchPoints","match","IS_FIREFOX","undefined","IS_SERVICE_WORKER","ServiceWorkerGlobalScope","IS_WEB_WORKER","WorkerGlobalScope","IS_WORKER","getWindowClients","clients","matchAll","includeUncontrolled","type","postMessage","listener","args","err","console","error","notifyServiceWorker","all","then","listeners","length","slice","forEach","bind","LogTypes","LOG_LEVELS","None","Error","Warn","Log","Debug","STYLES_SUPPORTED","LOGGER_STYLES","methods","logger","prefix","ignoreDebugReset","style","originalPrefix","originalStyle","log","method","logType","setPrefix","newPrefix","setLevel","level","reduce","acc","v","bindPrefix","pause","ms","Promise","resolve","setTimeout","ctx","CACHE_ASSETS_NAME","isCorrectResponse","response","ok","status","timeoutRace","promise","race","reject","noop","deferredPromise","deferredHelper","isFulfilled","isRejected","notify","notifyAll","lastNotify","callback","addNotifyListener","push","value","catch","finally","cancel","Object","assign","blobConstruct","blobParts","mimeType","Array","isArray","safeMimeType","blobSafeMimeType","Blob","MemoryWriter","constructor","size","saveFileCallback","this","bytes","Uint8Array","write","part","offset","endOffset","byteLength","newBytes","set","truncate","trim","finalize","saveToStorage","blob","getParts","replaceParts","parts","CacheStorageController","dbName","useStorage","STORAGES","openDatabase","openDbPromise","caches","open","delete","entryName","timeoutOperation","cache","deleteAll","get","save","put","getFile","fileName","makeError","saveFile","Response","headers","rejected","timeout","res","clearTimeout","prepareWriting","fileSize","getWriter","static","enabled","clearWrite","map","storage","deferredPromises","Map","cacheStorage","CHUNK_CACHED_TIME_HEADER","setInterval","keys","requests","filtered","timestamp","Date","now","request","url","has","promises","id","ignoreSearch","ignoreVary","mtprotoMessagePort","getMtprotoMessagePort","messagePort","taskId","streams","Stream","info","loadedOffsets","Set","destroy","getId","limitPart","STREAM_CHUNK_UPPER_LIMIT","STREAM_CHUNK_MIDDLE_LIMIT","destroyDebounced","fn","shouldRunFirst","shouldRunLast","waitingTimeout","waitingPromise","hadNewCall","invoke","_resolve","_reject","apply","debounce","_waitingTimeout","isDebounced","requestFilePartFromWorker","alignedOffset","limit","fromPreload","payload","docId","dcId","JSON","stringify","uploadFile","add","serviceMessagePort","bytesPromise","saveChunkToCache","preloadChunks","requestFilePartFromCache","key","getChunkKey","reader","FileReader","addEventListener","e","target","result","readBlobAs","readBlobAsArrayBuffer","buffer","readBlobAsUint8Array","requestFilePart","preloadChunk","end","alignOffset","requestRange","range","possibleResponse","statusText","responseForSafariFirstRange","Math","ceil","alignLimit","min","ab","location","base","deepEqual","x","y","tx","every","IDB","db","object","fromObject","i","safeAssign","name","storageIsAvailable","join","INSTANCES","isAvailable","createNew","createIndexes","os","store","indexNames","from","indexName","deleteIndex","indexes","index","contains","createIndex","keyPath","objectParameters","indexedDB","version","message","finished","onerror","onsuccess","event","calledNew","onclose","onabort","transaction","close","onversionchange","onupgradeneeded","warn","oldVersion","newVersion","stores","objectStoreNames","objectStore","createObjectStore","find","instance","preserve","IDBStorage","storeName","idb","create","concat","getObjectStore","clear","idx","mode","perf","performance","onError","onComplete","results","r","waitForTransactionComplete","oncomplete","callbackResult","left","onRequestFinished","getAll","defaultBaseUrl","protocol","hostname","pathname","split","lastPingTime","localNotificationsAvailable","defaults","push_mute_until","push_lang","push_message_nopreview","push_action_mute1d","push_action_settings","push_settings","getter","getDefault","hasOwnProperty","getCached","obj","data","json","muteUntil","settings","lang","nowTime","userInvisibleIsSupported","notificationPromise","peerId","title","body","description","custom","channel_id","chat_id","from_id","tag","messageKey","msg_id","ignoreMessages","nopreview","notificationOptions","icon","actions","action","badge","silent","registration","showNotification","fireNotification","waitUntil","closeAllNotifications","notification","clientList","pendingNotification","client","focus","invokeVoid","openWindow","baseUrl","notifications","getNotifications","len","ServiceMessagePort","super","downloadMap","DOWNLOAD_ERROR","events","download","strategy","CountQueuingStrategy","highWaterMark","controller","readable","ReadableStream","start","_controller","reason","item","readableStream","downloadChunk","chunk","enqueue","downloadFinalize","downloadCancel","onDownloadFetch","params","used","stream","respondWith","cancelAllDownloads","onShareFetch","formData","clientId","files","text","parseFormData","processShareEvent","resultingClientId","redirect","_mtprotoMessagePort","onWindowConnected","source","connectedWindows","frameType","channel","MessageChannel","attachPort","port1","port2","sendMessagePort","sendMessagePortIfNeeded","windowClient","arr","checkWindowClientForDeferredShare","addMultipleEventsListeners","notificationsClear","toggleStorages","toggleStorage","pushPing","localNotifications","onPing","hello","shownNotification","onClosedWindows","onDownloadClosedWindows","handleDownload","windowClients","onConnect","onDisconnect","listenPort","sendPort","attachListenPort","attachSendPort","setOnPortDisconnect","WindowClient","detachPort","listenMessagePort","onFetch","origin","file","fetch","clone","replace","random","requestCache","scope","header","chunks","ranges","parseRange","parse","decodeURIComponent","onStreamFetch","onChangeState","onfetch","skipWaiting","claim","onoffline","ononline","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","m","__webpack_exports__","O","chunkIds","priority","notFulfilled","Infinity","fulfilled","j","splice","d","definition","o","defineProperty","enumerable","f","chunkId","u","miniCssF","g","globalThis","Function","prop","prototype","call","scriptUrl","importScripts","document","currentScript","src","scripts","getElementsByTagName","p","oldGetScript","oldLoadScript","queryMap","countMap","retries","realSrc","cacheBust","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","moreModules","runtime","pop"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"sw.ee91e25d52a3425cb42c.chunk.js","mappings":"uBAAIA,ECAAC,E,4CCQG,MACMC,E,QAAoB,QAEpBC,EADuB,oBAAb,OAA2BC,OAASC,KAE3D,G,yECJO,MAAMC,EAAaC,UAAYA,UAAUC,UAAY,KAU/CC,GATWF,UAAUC,UAAUE,OAAO,yBACzBH,UAAUC,UAAUG,cAAcC,QAAQ,WACzC,SAASC,KAAKN,UAAUC,YAAc,aAAaK,KAAKN,UAAUO,SAG7D,mBAAmBD,KAAKN,UAAUQ,WACxC,aAAvBR,UAAUQ,UAA2BR,UAAUS,eAAiB,IAC/D,gBAEwB,oBAAuBV,KAAe,yBAAyBO,KAAKP,IAAkBA,EAAWW,MAAM,YAAcX,EAAWW,MAAM,aACr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rB,IAAK,GAgBN9C,EAAoBqB,EAAEvP,EAAI,CAACwP,EAAS7U,KAE/BqW,EAAgBxB,IAElBU,cAAchC,EAAoBsC,EAAItC,EAAoBuB,EAAED,GAE9D,EAGD,IAAIyB,EAAqBxa,KAAuB,iBAAIA,KAAuB,kBAAK,GAC5Eya,EAA6BD,EAAmB3b,KAAKrD,KAAKgf,GAC9DA,EAAmB3b,KAvBC+P,IACnB,IAAKsJ,EAAUwC,EAAaC,GAAW/L,EACvC,IAAI,IAAI8I,KAAYgD,EAChBjD,EAAoBkB,EAAE+B,EAAahD,KACrCD,EAAoBM,EAAEL,GAAYgD,EAAYhD,IAIhD,IADGiD,GAASA,EAAQlD,GACdS,EAAS7c,QACdkf,EAAgBrC,EAAS0C,OAAS,EACnCH,EAA2B7L,EAAK,C,KvCnB7B9V,EAAO2e,EAAoB1O,EAC/B0O,EAAoB1O,EAAI,IAChB0O,EAAoBlQ,EAAE,IAAIpM,KAAKrC,GwCDb2e,EAAoB1O,G","sources":["webpack://tweb/webpack/runtime/chunk loaded","webpack://tweb/webpack/runtime/startup chunk dependencies","webpack://tweb/./src/config/debug.ts","webpack://tweb/./src/environment/userAgent.ts","webpack://tweb/./src/helpers/context.ts","webpack://tweb/./src/lib/logger.ts","webpack://tweb/./src/helpers/schedulers/pause.ts","webpack://tweb/./src/lib/serviceWorker/cache.ts","webpack://tweb/./src/helpers/noop.ts","webpack://tweb/./src/helpers/cancellablePromise.ts","webpack://tweb/./src/helpers/blob/blobConstruct.ts","webpack://tweb/./src/helpers/blob/blobSafeMimeType.ts","webpack://tweb/./src/lib/files/memoryWriter.ts","webpack://tweb/./src/lib/files/cacheStorage.ts","webpack://tweb/./src/lib/serviceWorker/stream.ts","webpack://tweb/./src/helpers/schedulers/debounce.ts","webpack://tweb/./src/helpers/blob/readBlobAsUint8Array.ts","webpack://tweb/./src/helpers/blob/readBlobAsArrayBuffer.ts","webpack://tweb/./src/helpers/blob/readBlobAs.ts","webpack://tweb/./src/helpers/object/deepEqual.ts","webpack://tweb/./src/lib/files/idb.ts","webpack://tweb/./src/helpers/object/safeAssign.ts","webpack://tweb/./src/lib/serviceWorker/push.ts","webpack://tweb/./src/config/databases/state.ts","webpack://tweb/./src/config/notifications.ts","webpack://tweb/./src/lib/serviceWorker/serviceMessagePort.ts","webpack://tweb/./src/lib/serviceWorker/download.ts","webpack://tweb/./src/lib/serviceWorker/share.ts","webpack://tweb/./src/lib/serviceWorker/index.service.ts","webpack://tweb/./src/helpers/listenMessagePort.ts","webpack://tweb/./src/lib/serviceWorker/timeout.ts","webpack://tweb/webpack/bootstrap","webpack://tweb/webpack/runtime/define property getters","webpack://tweb/webpack/runtime/ensure chunk","webpack://tweb/webpack/runtime/get javascript chunk filename","webpack://tweb/webpack/runtime/get mini-css chunk filename","webpack://tweb/webpack/runtime/global","webpack://tweb/webpack/runtime/hasOwnProperty shorthand","webpack://tweb/webpack/runtime/publicPath","webpack://tweb/webpack/runtime/compat","webpack://tweb/webpack/runtime/importScripts chunk loading","webpack://tweb/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn __webpack_require__.e(85).then(next);\n};","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Modes from './modes';\n\nexport const IS_BETA = process.env.NODE_ENV !== 'production';\nexport const DEBUG = (IS_BETA || Modes.debug)/* && false */;\nconst ctx: any = typeof(window) !== 'undefined' ? window : self;\nexport const MOUNT_CLASS_TO: any = DEBUG || true/* && false */ ? ctx : {};\nexport default DEBUG;\n\n// let m = DEBUG;\n/* if(!DEBUG) {\n ctx.sandpitTurtle = () => {\n //if(!m) {\n for(let i in MOUNT_CLASS_TO) {\n ctx[i] = MOUNT_CLASS_TO[i];\n }\n //m = true;\n //}\n\n //DEBUG = !DEBUG;\n };\n} */\n\n/* export const superDebug = (object: any, key: string) => {\n var d = object[key];\n var beforeStr = '', afterStr = '';\n for(var r of d) {\n beforeStr += r.before.hex + '\\n';\n afterStr += r.after.hex + '\\n';\n }\n\n beforeStr = beforeStr.trim();\n afterStr = afterStr.trim();\n //var beforeStr = d.map((r) => r.before.hex).join('\\n');\n //var afterStr = d.map((r) => r.after.hex).join('\\n');\n\n var dada = (name: string, str: string) => {\n var a = document.createElement('a');\n a.target = '_blank';\n a.download = name + '.txt';\n a.href = URL.createObjectURL(new Blob([str], {\n type: 'text/plain'\n }));\n document.body.append(a);\n a.click();\n };\n\n dada(key + '_' + 'before', beforeStr);\n dada(key + '_' + 'after', afterStr);\n}\n\nMOUNT_CLASS_TO.superDebug = superDebug; */\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport ctx from './ctx';\n\nexport const USER_AGENT = navigator ? navigator.userAgent : null;\nexport const IS_APPLE = navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i) !== -1;\nexport const IS_ANDROID = navigator.userAgent.toLowerCase().indexOf('android') !== -1;\nexport const IS_CHROMIUM = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);\n\n// https://stackoverflow.com/a/58065241\nexport const IS_APPLE_MOBILE = (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&\n !(ctx as any).MSStream;\n\nexport const IS_SAFARI = !!('safari' in ctx) || !!(USER_AGENT && (/\\b(iPad|iPhone|iPod)\\b/.test(USER_AGENT) || (!!USER_AGENT.match('Safari') && !USER_AGENT.match('Chrome'))))/* || true */;\nexport const IS_FIREFOX = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n\nexport const IS_MOBILE_SAFARI = IS_SAFARI && IS_APPLE_MOBILE;\n\nexport const IS_MOBILE = (navigator.maxTouchPoints === undefined || navigator.maxTouchPoints > 0) && navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i) != -1;\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// в SW может быть сразу две переменных TRUE\nexport const IS_SERVICE_WORKER = typeof ServiceWorkerGlobalScope !== 'undefined' && self instanceof ServiceWorkerGlobalScope;\nexport const IS_WEB_WORKER = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope && !IS_SERVICE_WORKER;\nexport const IS_WORKER = IS_WEB_WORKER || IS_SERVICE_WORKER;\n\nexport const getWindowClients = () => {\n return (self as any as ServiceWorkerGlobalScope)\n .clients\n .matchAll({includeUncontrolled: false, type: 'window'});\n};\n\nexport const getLastWindowClient = () => getWindowClients().then((windowClients) => windowClients.slice(-1)[0]);\n\nconst postMessage = (listener: WindowClient | DedicatedWorkerGlobalScope, ...args: any[]) => {\n try {\n // @ts-ignore\n listener.postMessage(...args);\n } catch(err) {\n console.error('[worker] postMessage error:', err, args);\n }\n};\n\nconst notifyServiceWorker = (all: boolean, ...args: any[]) => {\n getWindowClients().then((listeners) => {\n if(!listeners.length) {\n // console.trace('no listeners?', self, listeners);\n return;\n }\n\n listeners.slice(all ? 0 : -1).forEach((listener) => {\n postMessage(listener, ...args);\n });\n });\n};\n\nconst notifyWorker = (...args: any[]) => {\n postMessage(self as any as DedicatedWorkerGlobalScope, ...args);\n};\n\nconst noop = () => {};\n\nexport const notifySomeone = IS_SERVICE_WORKER ? notifyServiceWorker.bind(null, false) : (IS_WEB_WORKER ? notifyWorker : noop);\nexport const notifyAll = IS_SERVICE_WORKER ? notifyServiceWorker.bind(null, true) : (IS_WEB_WORKER ? notifyWorker : noop);\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport DEBUG from '../config/debug';\nimport {IS_FIREFOX, IS_SAFARI} from '../environment/userAgent';\nimport {IS_SERVICE_WORKER, IS_WEB_WORKER} from '../helpers/context';\nimport dT from '../helpers/dT';\n\nexport enum LogTypes {\n None = 0,\n Error = 1,\n Warn = 2,\n Log = 4,\n Debug = 8\n};\n\nexport const LOG_LEVELS = [LogTypes.None, LogTypes.Error, LogTypes.Warn, LogTypes.Log, LogTypes.Debug];\n\nconst IS_WEBKIT = IS_SAFARI || IS_FIREFOX;\n\n// let getCallerFunctionNameFromLine: (line: string) => string;\n// if(IS_WEBKIT) {\n// getCallerFunctionNameFromLine = (line) => {\n// const splitted = line.split('@');\n// return splitted[0];\n// };\n// } else {\n// getCallerFunctionNameFromLine = (line: string) => {\n// const splitted = line.trim().split(' ');\n// if(splitted.length === 3) {\n// return splitted[1].slice(splitted[1].lastIndexOf('.') + 1);\n// }\n// };\n// }\n\nconst STYLES_SUPPORTED = !IS_WEBKIT;\n// const LINE_INDEX = IS_WEBKIT ? 2 : 3;\n\n// function getCallerFunctionName() {\n// const stack = new Error().stack;\n// const lines = stack.split('\\n');\n// const line = lines[LINE_INDEX] || lines[lines.length - 1];\n// // const match = line.match(/\\.([^\\.]+?)\\s/);\n// // line = match ? match[1] : line.trim();\n// const caller = getCallerFunctionNameFromLine(line) || '';\n// return '[' + caller + ']';\n// }\n\nexport const LOGGER_STYLES = {\n reset: '\\x1b[0m',\n bright: '\\x1b[1m',\n dim: '\\x1b[2m',\n underscore: '\\x1b[4m',\n blink: '\\x1b[5m',\n reverse: '\\x1b[7m',\n hidden: '\\x1b[8m',\n // Foreground (text) colors\n fg: {\n black: '\\x1b[30m',\n red: '\\x1b[31m',\n green: '\\x1b[32m',\n yellow: '\\x1b[33m',\n blue: '\\x1b[34m',\n magenta: '\\x1b[35m',\n cyan: '\\x1b[36m',\n white: '\\x1b[37m'\n },\n // Background colors\n bg: {\n black: '\\x1b[40m',\n red: '\\x1b[41m',\n green: '\\x1b[42m',\n yellow: '\\x1b[43m',\n blue: '\\x1b[44m',\n magenta: '\\x1b[45m',\n cyan: '\\x1b[46m',\n white: '\\x1b[47m'\n }\n};\n\nexport type Logger = {\n (...args: any[]): void;\n warn(...args: any[]): void;\n info(...args: any[]): void;\n error(...args: any[]): void;\n trace(...args: any[]): void;\n debug(...args: any[]): void;\n assert(...args: any[]): void;\n // log(...args: any[]): void;\n group(...args: any[]): void;\n groupCollapsed(...args: any[]): void;\n groupEnd(...args: any[]): void;\n setPrefix(newPrefix: string): void;\n setLevel(level: 0 | 1 | 2 | 3 | 4): void;\n bindPrefix(prefix: string): Logger;\n};\n\nconst methods: ['debug' | 'info' | 'warn' | 'error' | 'assert' | 'trace'/* | 'log' */ | 'group' | 'groupCollapsed' | 'groupEnd', LogTypes][] = [\n ['debug', LogTypes.Debug],\n ['info', LogTypes.Log],\n ['warn', LogTypes.Warn],\n ['error', LogTypes.Error],\n ['assert', LogTypes.Error],\n ['trace', LogTypes.Log],\n ['group', LogTypes.Log],\n ['groupCollapsed', LogTypes.Log],\n ['groupEnd', LogTypes.Log]\n // [\"log\", LogTypes.Log]\n];\n\nexport function logger(prefix: string, type: LogTypes = LogTypes.Log | LogTypes.Warn | LogTypes.Error, ignoreDebugReset = false, style = ''): Logger {\n let originalPrefix: string;\n if(!DEBUG && !ignoreDebugReset/* || true */) {\n type = LogTypes.Error;\n }\n\n if(!STYLES_SUPPORTED) {\n style = '';\n } else if(!style) {\n if(IS_SERVICE_WORKER) style = LOGGER_STYLES.fg.yellow;\n else if(IS_WEB_WORKER) style = LOGGER_STYLES.fg.cyan;\n }\n\n const originalStyle = style;\n if(style) style = `%s ${style}%s`;\n else style = '%s';\n\n // level = LogLevels.log | LogLevels.warn | LogLevels.error | LogLevels.debug\n\n const log: Logger = function(...args: any[]) {\n return type & LogTypes.Log && console.log(style, dT(), prefix, /* getCallerFunctionName(), */ ...args);\n } as any;\n\n methods.forEach(([method, logType]) => {\n log[method] = function(...args: any[]) {\n return type & logType && console[method](style, dT(), prefix, /* getCallerFunctionName(), */ ...args);\n };\n });\n\n log.setPrefix = function(newPrefix: string) {\n originalPrefix = newPrefix;\n prefix = '[' + newPrefix + ']';\n };\n\n log.setPrefix(prefix);\n\n log.setLevel = function(level: 0 | 1 | 2 | 3 | 4) {\n type = LOG_LEVELS.slice(0, level + 1).reduce((acc, v) => acc | v, 0) as any;\n };\n\n log.bindPrefix = function(prefix: string) {\n return logger(`${originalPrefix}] [${prefix}`, type, ignoreDebugReset, originalStyle);\n };\n\n return log;\n};\n","export default function pause(ms: number) {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport pause from '../../helpers/schedulers/pause';\n\nconst ctx = self as any as ServiceWorkerGlobalScope;\nexport const CACHE_ASSETS_NAME = 'cachedAssets';\n\nfunction isCorrectResponse(response: Response) {\n return response.ok && response.status === 200;\n}\n\nfunction timeoutRace>(promise: T) {\n return Promise.race([\n promise,\n pause(10000).then(() => Promise.reject())\n ]);\n}\n\nexport async function requestCache(event: FetchEvent) {\n try {\n // const cache = await ctx.caches.open(CACHE_ASSETS_NAME);\n const cache = await timeoutRace(ctx.caches.open(CACHE_ASSETS_NAME));\n const file = await timeoutRace(cache.match(event.request, {ignoreVary: true}));\n\n if(file && isCorrectResponse(file)) {\n return file;\n }\n\n const headers: HeadersInit = {'Vary': '*'};\n let response = await fetch(event.request, {headers});\n if(isCorrectResponse(response)) {\n cache.put(event.request, response.clone());\n } else if(response.status === 304) { // possible fix for 304 in Safari\n const url = event.request.url.replace(/\\?.+$/, '') + '?' + (Math.random() * 100000 | 0);\n response = await fetch(url, {headers});\n if(isCorrectResponse(response)) {\n cache.put(event.request, response.clone());\n }\n }\n\n return response;\n } catch(err) {\n return fetch(event.request);\n }\n}\n","export default function noop() {}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport noop from './noop';\n\nexport interface CancellablePromise extends Promise {\n resolve?: (value: T) => void,\n reject?: (...args: any[]) => void,\n cancel?: (reason?: any) => void,\n\n notify?: (...args: any[]) => void,\n notifyAll?: (...args: any[]) => void,\n lastNotify?: any,\n listeners?: Array<(...args: any[]) => void>,\n addNotifyListener?: (callback: (...args: any[]) => void) => void,\n\n isFulfilled?: boolean,\n isRejected?: boolean\n}\n\nexport default function deferredPromise() {\n const deferredHelper: any = {\n isFulfilled: false,\n isRejected: false,\n\n notify: () => {},\n notifyAll: (...args: any[]) => {\n deferredHelper.lastNotify = args;\n deferredHelper.listeners.forEach((callback: any) => callback(...args));\n },\n\n listeners: [],\n addNotifyListener: (callback: (...args: any[]) => void) => {\n if(deferredHelper.lastNotify) {\n callback(...deferredHelper.lastNotify);\n }\n\n deferredHelper.listeners.push(callback);\n }\n };\n\n const deferred: CancellablePromise = new Promise((resolve, reject) => {\n deferredHelper.resolve = (value: T) => {\n if(deferred.isFulfilled || deferred.isRejected) return;\n\n deferred.isFulfilled = true;\n resolve(value);\n };\n\n deferredHelper.reject = (...args: any[]) => {\n if(deferred.isRejected || deferred.isFulfilled) return;\n\n deferred.isRejected = true;\n reject(...args);\n };\n });\n\n // @ts-ignore\n /* deferred.then = (resolve: (value: T) => any, reject: (...args: any[]) => any) => {\n const n = deferredPromise>();\n\n }; */\n\n deferred.catch(noop).finally(() => {\n deferred.notify = deferred.notifyAll = deferred.lastNotify = null;\n deferred.listeners.length = 0;\n\n if(deferred.cancel) {\n deferred.cancel = noop;\n }\n });\n\n Object.assign(deferred, deferredHelper);\n\n return deferred;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport blobSafeMimeType from './blobSafeMimeType';\n\nexport default function blobConstruct(blobParts: Array | T, mimeType: string = ''): Blob {\n if(!Array.isArray(blobParts)) {\n blobParts = [blobParts];\n }\n\n const safeMimeType = blobSafeMimeType(mimeType);\n const blob = new Blob(blobParts, {type: safeMimeType});\n return blob;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\n// https://www.iana.org/assignments/media-types/media-types.xhtml\nexport default function blobSafeMimeType(mimeType: string) {\n if([\n 'image/jpeg',\n 'image/png',\n 'image/gif',\n 'image/svg+xml',\n 'image/webp',\n 'image/bmp',\n 'video/mp4',\n 'video/webm',\n 'video/quicktime',\n 'audio/ogg',\n 'audio/mpeg',\n 'audio/mp4',\n 'audio/wav', // though it is not in list\n 'application/json',\n 'application/pdf'\n ].indexOf(mimeType) === -1) {\n return 'application/octet-stream';\n }\n\n return mimeType;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport blobConstruct from '../../helpers/blob/blobConstruct';\nimport StreamWriter from './streamWriter';\n\nexport default class MemoryWriter implements StreamWriter {\n private bytes: Uint8Array;\n\n constructor(\n private mimeType: string,\n private size: number,\n private saveFileCallback?: (blob: Blob) => Promise\n ) {\n this.bytes = new Uint8Array(size);\n }\n\n public async write(part: Uint8Array, offset: number) {\n // sometimes file size can be bigger than the prov\n const endOffset = offset + part.byteLength;\n if(endOffset > this.bytes.byteLength) {\n const newBytes = new Uint8Array(endOffset);\n newBytes.set(this.bytes, 0);\n this.bytes = newBytes;\n }\n\n this.bytes.set(part, offset);\n };\n\n public truncate() {\n this.bytes = new Uint8Array();\n }\n\n public trim(size: number) {\n this.bytes = this.bytes.slice(0, size);\n }\n\n public finalize(saveToStorage = true) {\n const blob = blobConstruct(this.bytes, this.mimeType);\n\n if(saveToStorage && this.saveFileCallback) {\n this.saveFileCallback(blob);\n }\n\n return blob;\n }\n\n public getParts() {\n return this.bytes;\n }\n\n public replaceParts(parts: Uint8Array) {\n this.bytes = parts;\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport Modes from '../../config/modes';\nimport blobConstruct from '../../helpers/blob/blobConstruct';\nimport MemoryWriter from './memoryWriter';\nimport FileManager from './memoryWriter';\nimport FileStorage from './fileStorage';\nimport makeError from '../../helpers/makeError';\nimport deferredPromise from '../../helpers/cancellablePromise';\n\nexport type CacheStorageDbName = 'cachedFiles' | 'cachedStreamChunks' | 'cachedAssets';\n\nexport default class CacheStorageController implements FileStorage {\n private static STORAGES: CacheStorageController[] = [];\n private openDbPromise: Promise;\n\n private useStorage = true;\n\n // private log: ReturnType = logger('CS');\n\n constructor(private dbName: CacheStorageDbName) {\n if(Modes.test) {\n this.dbName += '_test';\n }\n\n if(CacheStorageController.STORAGES.length) {\n this.useStorage = CacheStorageController.STORAGES[0].useStorage;\n }\n\n this.openDatabase();\n CacheStorageController.STORAGES.push(this);\n }\n\n private openDatabase(): Promise {\n return this.openDbPromise ?? (this.openDbPromise = caches.open(this.dbName));\n }\n\n public delete(entryName: string) {\n return this.timeoutOperation((cache) => cache.delete('/' + entryName));\n }\n\n public deleteAll() {\n return caches.delete(this.dbName);\n }\n\n public get(entryName: string) {\n return this.timeoutOperation((cache) => cache.match('/' + entryName));\n }\n\n public save(entryName: string, response: Response) {\n // return new Promise((resolve) => {}); // DEBUG\n return this.timeoutOperation((cache) => cache.put('/' + entryName, response));\n }\n\n public getFile(fileName: string, method: 'blob' | 'json' | 'text' = 'blob'): Promise {\n // if(method === 'blob') {\n // return Promise.reject(makeError('NO_ENTRY_FOUND'));\n // }\n\n // const str = `get fileName: ${fileName}`;\n // console.time(str);\n return this.get(fileName).then((response) => {\n if(!response) {\n // console.warn('getFile:', response, fileName);\n throw makeError('NO_ENTRY_FOUND');\n }\n\n const promise = response[method]();\n // promise.then(() => {\n // console.timeEnd(str);\n // });\n return promise;\n });\n }\n\n public saveFile(fileName: string, blob: Blob | Uint8Array) {\n // return Promise.resolve(blobConstruct([blob]));\n if(!(blob instanceof Blob)) {\n blob = blobConstruct(blob);\n }\n\n const response = new Response(blob, {\n headers: {\n 'Content-Length': '' + blob.size\n }\n });\n\n return this.save(fileName, response).then(() => blob as Blob);\n }\n\n public timeoutOperation(callback: (cache: Cache) => Promise) {\n if(!this.useStorage) {\n return Promise.reject(makeError('STORAGE_OFFLINE'));\n }\n\n return new Promise(async(resolve, reject) => {\n let rejected = false;\n const timeout = setTimeout(() => {\n reject();\n // console.warn('CACHESTORAGE TIMEOUT');\n rejected = true;\n }, 15e3);\n\n try {\n const cache = await this.openDatabase();\n if(!cache) {\n this.useStorage = false;\n this.openDbPromise = undefined;\n throw 'no cache?';\n }\n\n const res = await callback(cache);\n\n if(rejected) return;\n resolve(res);\n } catch(err) {\n reject(err);\n }\n\n clearTimeout(timeout);\n });\n }\n\n public prepareWriting(fileName: string, fileSize: number, mimeType: string) {\n return {\n deferred: deferredPromise(),\n getWriter: () => {\n const writer = new MemoryWriter(mimeType, fileSize, (blob) => {\n return this.saveFile(fileName, blob).catch(() => blob);\n });\n\n return writer;\n }\n };\n }\n\n public static toggleStorage(enabled: boolean, clearWrite: boolean) {\n return Promise.all(this.STORAGES.map((storage) => {\n storage.useStorage = enabled;\n\n if(!clearWrite) {\n return;\n }\n\n if(!enabled) {\n return storage.deleteAll();\n }\n }));\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport readBlobAsUint8Array from '../../helpers/blob/readBlobAsUint8Array';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport debounce from '../../helpers/schedulers/debounce';\nimport {InputFileLocation} from '../../layer';\nimport CacheStorageController from '../files/cacheStorage';\nimport {DownloadOptions, MyUploadFile} from '../mtproto/apiFileManager';\nimport {getMtprotoMessagePort, log, serviceMessagePort} from './index.service';\nimport {ServiceRequestFilePartTaskPayload} from './serviceMessagePort';\nimport timeout from './timeout';\n\nconst deferredPromises: Map}> = new Map();\nconst cacheStorage = new CacheStorageController('cachedStreamChunks');\nconst CHUNK_TTL = 86400;\nconst CHUNK_CACHED_TIME_HEADER = 'Time-Cached';\nconst USE_CACHE = true;\n\nconst clearOldChunks = () => {\n return cacheStorage.timeoutOperation((cache) => {\n return cache.keys().then((requests) => {\n const filtered: Map = new Map();\n const timestamp = Date.now() / 1000 | 0;\n for(const request of requests) {\n const match = request.url.match(/\\/(\\d+?)\\?/);\n if(match && !filtered.has(match[1])) {\n filtered.set(match[1], request);\n }\n }\n\n const promises: Promise[] = [];\n for(const [id, request] of filtered) {\n const promise = cache.match(request).then((response) => {\n if((+response.headers.get(CHUNK_CACHED_TIME_HEADER) + CHUNK_TTL) <= timestamp) {\n log('will delete stream chunk:', id);\n return cache.delete(request, {ignoreSearch: true, ignoreVary: true});\n }\n });\n\n promises.push(promise);\n }\n\n return Promise.all(promises);\n });\n });\n};\n\nsetInterval(clearOldChunks, 1800e3);\nsetInterval(() => {\n const mtprotoMessagePort = getMtprotoMessagePort();\n for(const [messagePort, promises] of deferredPromises) {\n if(messagePort !== mtprotoMessagePort) {\n for(const taskId in promises) {\n const promise = promises[taskId];\n promise.reject();\n }\n\n deferredPromises.delete(messagePort);\n }\n }\n}, 120e3);\n\ntype StreamRange = [number, number];\ntype StreamId = DocId;\nconst streams: Map = new Map();\nclass Stream {\n private destroyDebounced: () => void;\n private id: StreamId;\n private limitPart: number;\n private loadedOffsets: Set = new Set();\n\n constructor(private info: DownloadOptions) {\n this.id = Stream.getId(info);\n streams.set(this.id, this);\n\n // ! если грузить очень большое видео чанками по 512Кб в мобильном Safari, то стрим не запустится\n this.limitPart = info.size > (75 * 1024 * 1024) ? STREAM_CHUNK_UPPER_LIMIT : STREAM_CHUNK_MIDDLE_LIMIT;\n this.destroyDebounced = debounce(this.destroy, 150000, false, true);\n }\n\n private destroy = () => {\n streams.delete(this.id);\n };\n\n private async requestFilePartFromWorker(alignedOffset: number, limit: number, fromPreload = false) {\n const payload: ServiceRequestFilePartTaskPayload = {\n docId: this.id,\n dcId: this.info.dcId,\n offset: alignedOffset,\n limit\n };\n\n const taskId = JSON.stringify(payload);\n\n const mtprotoMessagePort = getMtprotoMessagePort();\n let promises = deferredPromises.get(mtprotoMessagePort);\n if(!promises) {\n deferredPromises.set(mtprotoMessagePort, promises = {});\n }\n\n let deferred = promises[taskId];\n if(deferred) {\n return deferred.then((uploadFile) => uploadFile.bytes);\n }\n\n this.loadedOffsets.add(alignedOffset);\n\n deferred = promises[taskId] = deferredPromise();\n\n serviceMessagePort.invoke('requestFilePart', payload, undefined, mtprotoMessagePort)\n .then(deferred.resolve, deferred.reject).finally(() => {\n if(promises[taskId] === deferred) {\n delete promises[taskId];\n\n if(!Object.keys(promises).length) {\n deferredPromises.delete(mtprotoMessagePort);\n }\n }\n });\n\n const bytesPromise = deferred.then((uploadFile) => uploadFile.bytes);\n\n if(USE_CACHE) {\n this.saveChunkToCache(bytesPromise, alignedOffset, limit);\n !fromPreload && this.preloadChunks(alignedOffset, alignedOffset + (this.limitPart * 15));\n }\n\n return bytesPromise;\n }\n\n private requestFilePartFromCache(alignedOffset: number, limit: number, fromPreload?: boolean) {\n if(!USE_CACHE) {\n return Promise.resolve();\n }\n\n const key = this.getChunkKey(alignedOffset, limit);\n return cacheStorage.getFile(key).then((blob: Blob) => {\n return fromPreload ? new Uint8Array() : readBlobAsUint8Array(blob);\n }, (error: ApiError) => {\n if(error.type === 'NO_ENTRY_FOUND') {\n return;\n }\n });\n }\n\n private requestFilePart(alignedOffset: number, limit: number, fromPreload?: boolean) {\n return this.requestFilePartFromCache(alignedOffset, limit, fromPreload).then((bytes) => {\n return bytes || this.requestFilePartFromWorker(alignedOffset, limit, fromPreload);\n });\n }\n\n private saveChunkToCache(deferred: Promise, alignedOffset: number, limit: number) {\n return deferred.then((bytes) => {\n const key = this.getChunkKey(alignedOffset, limit);\n const response = new Response(bytes, {\n headers: {\n 'Content-Length': '' + bytes.length,\n 'Content-Type': 'application/octet-stream',\n [CHUNK_CACHED_TIME_HEADER]: '' + (Date.now() / 1000 | 0)\n }\n });\n\n return cacheStorage.save(key, response);\n });\n }\n\n private preloadChunk(offset: number) {\n if(this.loadedOffsets.has(offset)) {\n return;\n }\n\n this.loadedOffsets.add(offset);\n this.requestFilePart(offset, this.limitPart, true);\n }\n\n private preloadChunks(offset: number, end: number) {\n if(end > this.info.size) {\n end = this.info.size;\n }\n\n if(!offset) { // load last chunk for bounds\n this.preloadChunk(alignOffset(offset, this.limitPart));\n } else { // don't preload next chunks before the start\n for(; offset < end; offset += this.limitPart) {\n this.preloadChunk(offset);\n }\n }\n }\n\n public requestRange(range: StreamRange) {\n this.destroyDebounced();\n\n const possibleResponse = responseForSafariFirstRange(range, this.info.mimeType, this.info.size);\n if(possibleResponse) {\n return possibleResponse;\n }\n\n let [offset, end] = range;\n\n /* if(info.size > limitPart && isSafari && offset === limitPart) {\n //end = info.size - 1;\n //offset = info.size - 1 - limitPart;\n offset = info.size - (info.size % limitPart);\n } */\n\n const limit = end && end < this.limitPart ? alignLimit(end - offset + 1) : this.limitPart;\n const alignedOffset = alignOffset(offset, limit);\n\n if(!end) {\n end = Math.min(offset + limit, this.info.size - 1);\n }\n\n return this.requestFilePart(alignedOffset, limit).then((ab) => {\n // log.debug('[stream] requestFilePart result:', result);\n\n // if(isSafari) {\n if(offset !== alignedOffset || end !== (alignedOffset + limit)) {\n ab = ab.slice(offset - alignedOffset, end - alignedOffset + 1);\n }\n\n const headers: Record = {\n 'Accept-Ranges': 'bytes',\n 'Content-Range': `bytes ${offset}-${offset + ab.byteLength - 1}/${this.info.size || '*'}`,\n 'Content-Length': `${ab.byteLength}`\n };\n\n if(this.info.mimeType) {\n headers['Content-Type'] = this.info.mimeType;\n }\n\n // simulate slow connection\n // setTimeout(() => {\n return new Response(ab, {\n status: 206,\n statusText: 'Partial Content',\n headers\n });\n // }, 2.5e3);\n });\n }\n\n private getChunkKey(alignedOffset: number, limit: number) {\n return this.id + '?offset=' + alignedOffset + '&limit=' + limit;\n }\n\n public static get(info: DownloadOptions) {\n return streams.get(this.getId(info)) ?? new Stream(info);\n }\n\n private static getId(info: DownloadOptions) {\n return (info.location as InputFileLocation.inputDocumentFileLocation).id;\n }\n}\n\nexport default function onStreamFetch(event: FetchEvent, params: string) {\n const range = parseRange(event.request.headers.get('Range'));\n const info: DownloadOptions = JSON.parse(decodeURIComponent(params));\n const stream = Stream.get(info);\n\n // log.debug('[stream]', url, offset, end);\n\n event.respondWith(Promise.race([\n timeout(45 * 1000),\n stream.requestRange(range)\n ]));\n}\n\nfunction responseForSafariFirstRange(range: StreamRange, mimeType: string, size: number): Response {\n if(range[0] === 0 && range[1] === 1) {\n return new Response(new Uint8Array(2).buffer, {\n status: 206,\n statusText: 'Partial Content',\n headers: {\n 'Accept-Ranges': 'bytes',\n 'Content-Range': `bytes 0-1/${size || '*'}`,\n 'Content-Length': '2',\n 'Content-Type': mimeType || 'video/mp4'\n }\n });\n }\n\n return null;\n}\n\n/* const STREAM_CHUNK_UPPER_LIMIT = 256 * 1024;\nconst SMALLEST_CHUNK_LIMIT = 256 * 4; */\n/* const STREAM_CHUNK_UPPER_LIMIT = 1024 * 1024;\nconst SMALLEST_CHUNK_LIMIT = 1024 * 4; */\nconst STREAM_CHUNK_MIDDLE_LIMIT = 512 * 1024;\nconst STREAM_CHUNK_UPPER_LIMIT = 1024 * 1024;\nconst SMALLEST_CHUNK_LIMIT = 512 * 4;\n\nfunction parseRange(header: string): StreamRange {\n if(!header) return [0, 0];\n const [, chunks] = header.split('=');\n const ranges = chunks.split(', ');\n const [offset, end] = ranges[0].split('-');\n\n return [+offset, +end || 0];\n}\n\nfunction alignOffset(offset: number, base = SMALLEST_CHUNK_LIMIT) {\n return offset - (offset % base);\n}\n\nfunction alignLimit(limit: number) {\n return 2 ** Math.ceil(Math.log(limit) / Math.log(2));\n}\n","// * Jolly Cobra's schedulers\n\nimport ctx from '../../environment/ctx';\nimport {AnyFunction, Awaited} from '../../types';\nimport noop from '../noop';\n\nexport type DebounceReturnType = {\n (...args: Parameters): Promise>>;\n clearTimeout(): void;\n isDebounced(): boolean;\n};\n\nexport default function debounce(\n fn: F,\n ms: number,\n shouldRunFirst = true,\n shouldRunLast = true\n): DebounceReturnType {\n let waitingTimeout: number;\n let waitingPromise: Promise>>, resolve: (result: any) => void, reject: () => void;\n let hadNewCall = false;\n\n const invoke = (args: Parameters) => {\n const _resolve = resolve, _reject = reject;\n try {\n const result = fn.apply(null, args);\n _resolve(result);\n } catch(err) {\n console.error('debounce error', err);\n // @ts-ignore\n _reject(err);\n }\n };\n\n const debounce = (...args: Parameters) => {\n if(!waitingPromise) waitingPromise = new Promise((_resolve, _reject) => (resolve = _resolve, reject = _reject));\n\n if(waitingTimeout) {\n clearTimeout(waitingTimeout);\n hadNewCall = true;\n reject();\n waitingPromise = new Promise((_resolve, _reject) => (resolve = _resolve, reject = _reject));\n } else if(shouldRunFirst) {\n invoke(args);\n hadNewCall = false;\n }\n\n const _waitingTimeout = ctx.setTimeout(() => {\n // will run if should run last or first but with new call\n if(shouldRunLast && (!shouldRunFirst || hadNewCall)) {\n invoke(args);\n }\n\n // if debounce was called during invoking\n if(waitingTimeout === _waitingTimeout) {\n waitingTimeout = waitingPromise = resolve = reject = undefined;\n hadNewCall = false;\n }\n }, ms);\n\n waitingTimeout = _waitingTimeout;\n waitingPromise.catch(noop);\n return waitingPromise;\n };\n\n debounce.clearTimeout = () => {\n if(waitingTimeout) {\n ctx.clearTimeout(waitingTimeout);\n reject();\n waitingTimeout = waitingPromise = resolve = reject = undefined;\n hadNewCall = false;\n }\n };\n\n debounce.isDebounced = () => !!waitingTimeout;\n\n return debounce;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport readBlobAsArrayBuffer from './readBlobAsArrayBuffer';\n\nexport default function readBlobAsUint8Array(blob: Blob) {\n return readBlobAsArrayBuffer(blob).then((buffer) => new Uint8Array(buffer));\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport readBlobAs from './readBlobAs';\n\nexport default function readBlobAsArrayBuffer(blob: Blob) {\n return readBlobAs(blob, 'readAsArrayBuffer');\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n// import { IS_WEB_WORKER } from \"../context\";\n\n// const id = IS_WEB_WORKER ? Math.random() * 0x1000 | 0 : 0;\nexport default function readBlobAs(blob: Blob, method: 'readAsText'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsDataURL'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsArrayBuffer'): Promise;\nexport default function readBlobAs(blob: Blob, method: 'readAsArrayBuffer' | 'readAsText' | 'readAsDataURL'): Promise {\n // const perf = performance.now();\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.addEventListener('loadend', (e) => {\n // console.log(`readBlobAs [${id}] ${method} time ${performance.now() - perf}`);\n resolve(e.target.result);\n });\n reader[method](blob);\n });\n}\n","export default function deepEqual(x: any, y: any): boolean {\n const ok = Object.keys, tx = typeof x, ty = typeof y;\n return x && y && tx === 'object' && tx === ty ? (\n ok(x).length === ok(y).length &&\n ok(x).every((key) => deepEqual(x[key], y[key]))\n ) : (x === y);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {Database} from '../../config/databases';\nimport Modes from '../../config/modes';\nimport makeError from '../../helpers/makeError';\nimport safeAssign from '../../helpers/object/safeAssign';\nimport {logger} from '../logger';\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/createIndex\n */\nexport type IDBIndex = {\n indexName: string,\n keyPath: string,\n objectParameters: IDBIndexParameters\n};\n\nexport type IDBStore = {\n name: string,\n indexes?: IDBIndex[]\n};\n\nexport type IDBOptions = {\n name?: string,\n storeName: string,\n stores?: IDBStore[],\n version?: number\n};\n\nconst DEBUG = false;\n\nexport class IDB {\n private static INSTANCES: IDB[] = [];\n private openDbPromise: Promise;\n private db: IDBDatabase;\n private storageIsAvailable: boolean;\n private log: ReturnType;\n private name: string;\n private version: number;\n private stores: IDBStore[];\n\n constructor(db: Database) {\n safeAssign(this, db);\n\n if(Modes.test) {\n this.name += '_test';\n }\n\n this.storageIsAvailable = true;\n this.log = logger(['IDB', db.name].join('-'));\n this.log('constructor');\n\n this.openDatabase(true);\n\n IDB.INSTANCES.push(this);\n }\n\n public isAvailable() {\n return this.storageIsAvailable;\n }\n\n public openDatabase(createNew = false): Promise {\n if(this.openDbPromise && !createNew) {\n return this.openDbPromise;\n }\n\n const createIndexes = (os: IDBObjectStore, store: IDBStore) => {\n const indexNames = Array.from(os.indexNames);\n for(const indexName of indexNames) {\n os.deleteIndex(indexName);\n }\n\n if(!store.indexes?.length) {\n return;\n }\n\n for(const index of store.indexes) {\n if(os.indexNames.contains(index.indexName)) {\n continue;\n }\n\n os.createIndex(index.indexName, index.keyPath, index.objectParameters);\n }\n };\n\n const createObjectStore = (db: IDBDatabase, store: IDBStore) => {\n const os = db.createObjectStore(store.name);\n createIndexes(os, store);\n };\n\n try {\n var request = indexedDB.open(this.name, this.version);\n\n if(!request) {\n return Promise.reject();\n }\n } catch(error) {\n this.log.error('error opening db', (error as Error).message);\n this.storageIsAvailable = false;\n return Promise.reject(error);\n }\n\n let finished = false;\n setTimeout(() => {\n if(!finished) {\n request.onerror(makeError('IDB_CREATE_TIMEOUT') as Event);\n }\n }, 3000);\n\n return this.openDbPromise = new Promise((resolve, reject) => {\n request.onsuccess = (event) => {\n finished = true;\n const db = request.result;\n let calledNew = false;\n\n this.log('Opened');\n\n db.onerror = (error) => {\n this.storageIsAvailable = false;\n this.log.error('Error creating/accessing IndexedDB database', error);\n reject(error);\n };\n\n db.onclose = (e) => {\n this.log.error('closed:', e);\n !calledNew && this.openDatabase();\n };\n\n db.onabort = (e) => {\n this.log.error('abort:', e);\n const transaction = e.target as IDBTransaction;\n\n this.openDatabase(calledNew = true);\n\n if(transaction.onerror) {\n transaction.onerror(e);\n }\n\n db.close();\n };\n\n db.onversionchange = (e) => {\n this.log.error('onversionchange, lol?');\n };\n\n resolve(this.db = db);\n };\n\n request.onerror = (event) => {\n finished = true;\n this.storageIsAvailable = false;\n this.log.error('Error creating/accessing IndexedDB database', event);\n reject(event);\n };\n\n request.onupgradeneeded = (event) => {\n finished = true;\n this.log.warn('performing idb upgrade from', event.oldVersion, 'to', event.newVersion);\n\n const target = event.target as IDBOpenDBRequest;\n const db = target.result;\n this.stores.forEach((store) => {\n /* if(db.objectStoreNames.contains(store.name)) {\n //if(event.oldVersion === 1) {\n db.deleteObjectStore(store.name);\n //}\n } */\n\n if(!db.objectStoreNames.contains(store.name)) {\n createObjectStore(db, store);\n } else {\n const txn = target.transaction;\n const os = txn.objectStore(store.name);\n createIndexes(os, store);\n }\n });\n };\n });\n }\n\n public static create>(db: T) {\n return this.INSTANCES.find((instance) => instance.name === db.name) ?? new IDB(db);\n }\n\n public static closeDatabases(preserve?: IDB) {\n this.INSTANCES.forEach((storage) => {\n if(preserve && preserve === storage) {\n return;\n }\n\n const db = storage.db;\n if(db) {\n db.onclose = () => {};\n db.close();\n }\n });\n }\n}\n\nexport default class IDBStorage, StoreName extends string = T['stores'][0]['name']> {\n private log: ReturnType;\n private storeName: T['stores'][0]['name'];\n private idb: IDB;\n\n constructor(db: T, storeName: typeof db['stores'][0]['name']) {\n this.storeName = storeName;\n this.log = logger(['IDB', db.name, storeName].join('-'));\n this.idb = IDB.create(db);\n }\n\n /**\n * ! WARNING ! function requires at least one opened connection\n */\n /* public static clearObjectStores() {\n const storage = this.STORAGES[0];\n this.closeDatabases(storage);\n\n const names = Array.from(storage.db.objectStoreNames);\n const promises = names.map((name) => storage.clear(name));\n return Promise.all(promises);\n } */\n\n /* public static deleteDatabase() {\n this.closeDatabases();\n\n const storages = this.STORAGES;\n const dbNames = Array.from(new Set(storages.map((storage) => storage.name)));\n const promises = dbNames.map((dbName) => {\n return new Promise((resolve, reject) => {\n const deleteRequest = indexedDB.deleteDatabase(dbName);\n\n deleteRequest.onerror = () => {\n reject();\n };\n\n deleteRequest.onsuccess = () => {\n resolve();\n };\n });\n });\n\n return Promise.all(promises);\n } */\n\n public delete(entryName: string | string[], storeName?: StoreName): Promise {\n // return Promise.resolve();\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n entryName = [].concat(entryName);\n }\n\n return this.getObjectStore('readwrite', (objectStore) => {\n const promises = (entryName as string[]).map((entryName) => objectStore.delete(entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'delete: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n public clear(storeName?: StoreName): Promise {\n return this.getObjectStore('readwrite', (objectStore) => objectStore.clear(), DEBUG ? 'clear' : '', storeName);\n }\n\n public save(entryName: string | string[], value: any | any[], storeName?: StoreName) {\n // const handleError = (error: Error) => {\n // this.log.error('save: transaction error:', entryName, value, db, error, error && error.name);\n // if((!error || error.name === 'InvalidStateError')/* && false */) {\n // setTimeout(() => {\n // this.save(entryName, value);\n // }, 2e3);\n // } else {\n // //console.error('IndexedDB saveFile transaction error:', error, error && error.name);\n // }\n // };\n\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n entryName = [].concat(entryName);\n value = [].concat(value);\n }\n\n return this.getObjectStore('readwrite', (objectStore) => {\n const promises = (entryName as string[]).map((entryName, idx) => objectStore.put(value[idx], entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'save: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n // public saveFile(fileName: string, blob: Blob | Uint8Array) {\n // //return Promise.resolve(blobConstruct([blob]));\n // if(!(blob instanceof Blob)) {\n // blob = blobConstruct(blob);\n // }\n\n // return this.save(fileName, blob);\n // }\n\n /* public saveFileBase64(db: IDBDatabase, fileName: string, blob: Blob | any): Promise {\n if(this.getBlobSize(blob) > 10 * 1024 * 1024) {\n return Promise.reject();\n }\n\n if(!(blob instanceof Blob)) {\n var safeMimeType = blobSafeMimeType(blob.type || 'image/jpeg');\n var address = 'data:' + safeMimeType + ';base64,' + bytesToBase64(blob);\n return this.storagePutB64String(db, fileName, address).then(() => {\n return blob;\n });\n }\n\n try {\n var reader = new FileReader();\n } catch (e) {\n this.storageIsAvailable = false;\n return Promise.reject();\n }\n\n let promise = new Promise((resolve, reject) => {\n reader.onloadend = () => {\n this.storagePutB64String(db, fileName, reader.result as string).then(() => {\n resolve(blob);\n }, reject);\n }\n\n reader.onerror = reject;\n });\n\n\n try {\n reader.readAsDataURL(blob);\n } catch (e) {\n this.storageIsAvailable = false;\n return Promise.reject();\n }\n\n return promise;\n }\n\n public storagePutB64String(db: IDBDatabase, fileName: string, b64string: string) {\n try {\n var objectStore = db.transaction([this.storeName], 'readwrite')\n .objectStore(this.storeName);\n var request = objectStore.put(b64string, fileName);\n } catch(error) {\n this.storageIsAvailable = false;\n return Promise.reject(error);\n }\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n resolve();\n };\n\n request.onerror = reject;\n });\n }\n\n public getBlobSize(blob: any) {\n return blob.size || blob.byteLength || blob.length;\n } */\n\n public get(entryName: string[], storeName?: StoreName): Promise;\n public get(entryName: string, storeName?: StoreName): Promise;\n public get(entryName: string | string[], storeName?: StoreName): Promise | Promise {\n // return Promise.reject();\n\n const isArray = Array.isArray(entryName);\n if(!isArray) {\n if(!entryName) {\n return undefined;\n }\n\n entryName = [].concat(entryName);\n } else if(!entryName.length) {\n return Promise.resolve([]) as any;\n }\n\n return this.getObjectStore('readonly', (objectStore) => {\n const promises = (entryName as string[]).map((entryName) => objectStore.get(entryName));\n return isArray ? promises : promises[0];\n }, DEBUG ? 'get: ' + (entryName as string[]).join(', ') : '', storeName);\n }\n\n private getObjectStore(\n mode: IDBTransactionMode,\n callback: (objectStore: IDBObjectStore) => IDBRequest | IDBRequest[],\n log?: string,\n storeName = this.storeName\n ) {\n let perf: number;\n\n if(log) {\n perf = performance.now();\n this.log(log + ': start');\n }\n\n return this.idb.openDatabase().then((db) => {\n return new Promise((resolve, reject) => {\n /* if(mode === 'readwrite') {\n return;\n } */\n\n const transaction = db.transaction([storeName], mode);\n\n const onError = () => {\n clearTimeout(timeout);\n reject(transaction.error);\n };\n\n // let resolved = false;\n const onComplete = (/* what: string */) => {\n clearTimeout(timeout);\n\n if(log) {\n this.log(log + ': end', performance.now() - perf/* , what */);\n }\n\n // if(resolved) {\n // return;\n // }\n\n // resolved = true;\n const results = requests.map((r) => r.result);\n resolve(isArray ? results : results[0]);\n };\n\n transaction.onerror = onError;\n\n // * have to wait while clearing or setting something\n const waitForTransactionComplete = mode === 'readwrite';\n if(waitForTransactionComplete) {\n transaction.oncomplete = () => onComplete(/* 'transaction' */);\n }\n\n const timeout = setTimeout(() => {\n this.log.error('transaction not finished', transaction, log);\n }, 10000);\n\n /* transaction.addEventListener('abort', (e) => {\n //handleError();\n this.log.error('IndexedDB: transaction abort!', transaction.error);\n }); */\n\n const callbackResult = callback(transaction.objectStore(storeName));\n\n const isArray = Array.isArray(callbackResult);\n const requests: IDBRequest[] = isArray ? callbackResult : [].concat(callbackResult) as any;\n\n if(waitForTransactionComplete) {\n return;\n }\n\n const length = requests.length;\n let left = length;\n\n const onRequestFinished = () => {\n if(transaction.error) {\n return;\n }\n\n if(!--left) {\n onComplete(/* 'requests' */);\n }\n };\n\n for(let i = 0; i < length; ++i) {\n const request = requests[i];\n request.onerror = onError;\n request.onsuccess = onRequestFinished;\n }\n });\n });\n }\n\n public getAll(storeName?: StoreName): Promise {\n return this.getObjectStore('readonly', (objectStore) => objectStore.getAll(), DEBUG ? 'getAll' : '', storeName);\n }\n\n /* public getAllKeys(): Promise> {\n console.time('getAllEntries');\n return this.openDatabase().then((db) => {\n var objectStore = db.transaction([this.storeName], 'readonly')\n .objectStore(this.storeName);\n var request = objectStore.getAllKeys();\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n // @ts-ignore\n var result = event.target.result;\n resolve(result);\n console.timeEnd('getAllEntries');\n }\n\n request.onerror = reject;\n });\n });\n } */\n\n /* public isFileExists(fileName: string): Promise {\n console.time('isFileExists');\n return this.openDatabase().then((db) => {\n var objectStore = db.transaction([this.storeName], 'readonly')\n .objectStore(this.storeName);\n var request = objectStore.openCursor(fileName);\n\n return new Promise((resolve, reject) => {\n request.onsuccess = function(event) {\n // @ts-ignore\n var cursor = event.target.result;\n resolve(!!cursor);\n console.timeEnd('isFileExists');\n }\n\n request.onerror = reject;\n });\n });\n } */\n\n /* public getFileWriter(fileName: string, mimeType: string) {\n var fakeWriter = FileManager.getFakeFileWriter(mimeType, (blob) => {\n return this.saveFile(fileName, blob);\n });\n\n return Promise.resolve(fakeWriter);\n } */\n}\n","export default function safeAssign(object: T, fromObject: any) {\n if(fromObject) {\n for(const i in fromObject) {\n if(fromObject[i] !== undefined) {\n // @ts-ignore\n object[i] = fromObject[i];\n }\n }\n }\n\n return object;\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n *\n * Originally from:\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\n\nimport {Database} from '../../config/databases';\nimport DATABASE_STATE from '../../config/databases/state';\nimport {NOTIFICATION_BADGE_PATH, NOTIFICATION_ICON_PATH} from '../../config/notifications';\nimport {IS_FIREFOX, IS_MOBILE} from '../../environment/userAgent';\nimport deepEqual from '../../helpers/object/deepEqual';\nimport IDBStorage from '../files/idb';\nimport {log, serviceMessagePort} from './index.service';\nimport {ServicePushPingTaskPayload} from './serviceMessagePort';\n\nconst ctx = self as any as ServiceWorkerGlobalScope;\nconst defaultBaseUrl = location.protocol + '//' + location.hostname + location.pathname.split('/').slice(0, -1).join('/') + '/';\n\n// as in webPushApiManager.ts\nconst PING_PUSH_TIMEOUT = 10000 + 1500;\nlet lastPingTime = 0;\nlet localNotificationsAvailable = true;\n\nexport type PushNotificationObject = {\n loc_key: string,\n loc_args: string[],\n // user_id: number, // should be number\n custom: {\n channel_id?: string, // should be number\n chat_id?: string, // should be number\n from_id?: string, // should be number\n msg_id: string,\n peerId?: string, // should be number\n silent?: string // can be '1'\n },\n sound?: string,\n random_id: number,\n badge?: string, // should be number\n description: string,\n mute: string, // should be number\n title: string,\n message?: string,\n} & {\n action?: 'mute1d' | 'push_settings', // will be set before postMessage to main thread\n};\n\nclass SomethingGetter, Storage extends Record> {\n private cache: Partial = {};\n private storage: IDBStorage;\n\n constructor(\n db: T,\n storeName: typeof db['stores'][number]['name'],\n private defaults: {\n [Property in keyof Storage]: ((value: Storage[Property]) => Storage[Property]) | Storage[Property]\n }\n ) {\n this.storage = new IDBStorage(db, storeName);\n }\n\n private getDefault(key: T) {\n const callback = this.defaults[key];\n return typeof(callback) === 'function' ? callback() : callback;\n }\n\n public get(key: T) {\n if(this.cache.hasOwnProperty(key)) {\n return this.cache[key];\n }\n\n const promise = this.storage.get(key as string) as Promise;\n return promise.then((value) => value, () => undefined as Storage[T]).then((value) => {\n if(this.cache.hasOwnProperty(key)) {\n return this.cache[key];\n }\n\n value ??= this.getDefault(key);\n\n return this.cache[key] = value;\n });\n }\n\n public getCached(key: T) {\n const value = this.get(key);\n if(value instanceof Promise) {\n throw 'no property';\n }\n\n return value;\n }\n\n public async set(key: T, value: Storage[T]) {\n const cached = this.cache[key] ?? this.defaults[key];\n if(deepEqual(cached, value)) {\n return;\n }\n\n this.cache[key] = value;\n\n try {\n this.storage.save(key as string, value);\n } catch(err) {\n\n }\n }\n}\n\ntype PushStorage = {\n push_mute_until: number,\n push_lang: Partial\n push_settings: Partial\n};\n\nconst defaults: PushStorage = {\n push_mute_until: 0,\n push_lang: {\n push_message_nopreview: 'You have a new message',\n push_action_mute1d: 'Mute for 24H',\n push_action_settings: 'Settings'\n },\n push_settings: {}\n};\n\nconst getter = new SomethingGetter(DATABASE_STATE, 'session', defaults);\n\n// fill cache\nfor(const i in defaults) {\n getter.get(i as keyof PushStorage);\n}\n\nctx.addEventListener('push', (event) => {\n const obj: PushNotificationObject = event.data.json();\n log('push', {...obj});\n\n try {\n const [muteUntil, settings, lang] = [\n getter.getCached('push_mute_until'),\n getter.getCached('push_settings'),\n getter.getCached('push_lang')\n ];\n\n const nowTime = Date.now();\n if(\n userInvisibleIsSupported() &&\n muteUntil &&\n nowTime < muteUntil\n ) {\n throw `supress notification because mute for ${Math.ceil((muteUntil - nowTime) / 60000)} min`;\n }\n\n const hasActiveWindows = (Date.now() - lastPingTime) <= PING_PUSH_TIMEOUT && localNotificationsAvailable;\n if(hasActiveWindows) {\n throw 'supress notification because some instance is alive';\n }\n\n const notificationPromise = fireNotification(obj, settings, lang);\n event.waitUntil(notificationPromise);\n } catch(err) {\n log(err);\n\n const tag = 'fix';\n const notificationPromise = ctx.registration.showNotification('Telegram', {tag});\n\n notificationPromise.then(() => {\n closeAllNotifications(tag);\n });\n\n event.waitUntil(notificationPromise);\n }\n});\n\nctx.addEventListener('notificationclick', (event) => {\n const notification = event.notification;\n log('on notification click', notification);\n notification.close();\n\n const action = event.action as PushNotificationObject['action'];\n if(action === 'mute1d' && userInvisibleIsSupported()) {\n log('[SW] mute for 1d');\n getter.set('push_mute_until', Date.now() + 86400e3);\n return;\n }\n\n const data: PushNotificationObject = notification.data;\n if(!data) {\n return;\n }\n\n const promise = ctx.clients.matchAll({\n type: 'window'\n }).then((clientList) => {\n data.action = action;\n pendingNotification = data;\n for(let i = 0; i < clientList.length; ++i) {\n const client = clientList[i];\n if('focus' in client) {\n client.focus();\n serviceMessagePort.invokeVoid('pushClick', pendingNotification, client);\n pendingNotification = undefined;\n return;\n }\n }\n\n if(ctx.clients.openWindow) {\n return Promise.resolve(getter.get('push_settings')).then((settings) => {\n return ctx.clients.openWindow(settings.baseUrl || defaultBaseUrl);\n });\n }\n }).catch((error) => {\n log.error('Clients.matchAll error', error);\n })\n\n event.waitUntil(promise);\n});\n\nctx.addEventListener('notificationclose', onCloseNotification);\n\nconst notifications: Set = new Set();\nlet pendingNotification: PushNotificationObject;\nfunction pushToNotifications(notification: Notification) {\n if(!notifications.has(notification)) {\n notifications.add(notification);\n // @ts-ignore\n notification.onclose = onCloseNotification;\n }\n}\n\nfunction onCloseNotification(event: NotificationEvent) {\n removeFromNotifications(event.notification)\n}\n\nfunction removeFromNotifications(notification: Notification) {\n notifications.delete(notification);\n}\n\nexport function closeAllNotifications(tag?: string) {\n for(const notification of notifications) {\n try {\n if(tag && notification.tag !== tag) {\n continue;\n }\n\n notification.close();\n notifications.delete(notification);\n } catch(e) {}\n }\n\n let promise: Promise;\n if('getNotifications' in ctx.registration) {\n promise = ctx.registration.getNotifications({tag}).then((notifications) => {\n for(let i = 0, len = notifications.length; i < len; ++i) {\n try {\n notifications[i].close();\n } catch(e) {}\n }\n }).catch((error) => {\n log.error('Offline register SW error', error);\n });\n } else {\n promise = Promise.resolve();\n }\n\n return promise;\n}\n\nfunction userInvisibleIsSupported() {\n return IS_FIREFOX;\n}\n\nfunction fireNotification(obj: PushNotificationObject, settings: PushStorage['push_settings'], lang: PushStorage['push_lang']) {\n let title = obj.title || 'Telegram';\n let body = obj.description || '';\n let peerId: string;\n\n if(obj.custom) {\n if(obj.custom.channel_id) {\n peerId = '' + -obj.custom.channel_id;\n } else if(obj.custom.chat_id) {\n peerId = '' + -obj.custom.chat_id;\n } else {\n peerId = obj.custom.from_id || '';\n }\n }\n\n obj.custom.peerId = '' + peerId;\n let tag = 'peer' + peerId;\n\n const messageKey = peerId + '_' + obj.custom.msg_id;\n if(ignoreMessages) {\n const error = 'ignoring push';\n log.warn(error, obj);\n ignoreMessages.delete(messageKey);\n throw error;\n }\n\n if(settings?.nopreview) {\n title = 'Telegram';\n body = lang.push_message_nopreview;\n tag = 'unknown_peer';\n }\n\n const actions: (Omit & {action: PushNotificationObject['action']})[] = [{\n action: 'mute1d',\n title: lang.push_action_mute1d\n }/* , {\n action: 'push_settings',\n title: lang.push_action_settings || 'Settings'\n } */];\n\n const notificationOptions: NotificationOptions = {\n body,\n icon: NOTIFICATION_ICON_PATH,\n tag,\n data: obj,\n actions,\n badge: NOTIFICATION_BADGE_PATH,\n silent: obj.custom.silent === '1'\n };\n\n log('show notify', title, body, obj, notificationOptions);\n\n const notificationPromise = ctx.registration.showNotification(title, notificationOptions);\n\n return notificationPromise.catch((error) => {\n log.error('Show notification promise', error);\n });\n}\n\nexport function onPing(payload: ServicePushPingTaskPayload, source?: MessageEventSource) {\n lastPingTime = Date.now();\n localNotificationsAvailable = payload.localNotifications;\n\n if(pendingNotification && source) {\n serviceMessagePort.invokeVoid('pushClick', pendingNotification, source);\n pendingNotification = undefined;\n }\n\n if(payload.lang) {\n getter.set('push_lang', payload.lang);\n }\n\n if(payload.settings) {\n getter.set('push_settings', payload.settings);\n }\n}\n\nconst ignoreMessages: Set = new Set();\nexport function onShownNotification(payload: string) {\n ignoreMessages.add(payload);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {Database} from '.';\nimport type {IDBIndex} from '../../lib/files/idb';\n\nconst DATABASE_STATE: Database<'session' | 'stickerSets' | 'users' | 'chats' | 'messages' | 'dialogs'> = {\n name: 'tweb',\n version: 7,\n stores: [{\n name: 'session'\n }, {\n name: 'stickerSets'\n }, {\n name: 'users'\n }, {\n name: 'chats'\n }, {\n name: 'dialogs'\n // indexes: [\n // ...(new Array(20 + 2).fill(0)).map((_, idx) => {\n // const name = `index_${idx}`;\n // const index: IDBIndex = {\n // indexName: name,\n // keyPath: name,\n // objectParameters: {}\n // };\n\n // return index\n // })\n // ]\n }, {\n name: 'messages'\n }]\n};\n\nexport default DATABASE_STATE;\n","export const NOTIFICATION_ICON_PATH = 'assets/img/logo_filled_rounded.png';\nexport const NOTIFICATION_BADGE_PATH = 'assets/img/logo_plain.svg'; // masked\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {WebPushApiManager} from '../mtproto/webPushApiManager';\nimport type {PushNotificationObject} from './push';\nimport type {MyUploadFile} from '../mtproto/apiFileManager';\nimport SuperMessagePort from '../mtproto/superMessagePort';\nimport {MOUNT_CLASS_TO} from '../../config/debug';\n\nexport type ServicePushPingTaskPayload = {\n localNotifications: boolean,\n lang: {\n push_action_mute1d: string\n push_action_settings: string\n push_message_nopreview: string\n },\n settings: WebPushApiManager['settings']\n};\n\nexport type ServiceRequestFilePartTaskPayload = {\n docId: DocId,\n dcId: number,\n offset: number,\n limit: number\n};\n\nexport type ServiceDownloadTaskPayload = {\n headers: any,\n id: string\n};\n\nexport type ServiceEvent = {\n port: (payload: void, source: MessageEventSource, event: MessageEvent) => void\n};\n\nexport default class ServiceMessagePort extends SuperMessagePort<{\n // from main thread to service worker\n notificationsClear: () => void,\n toggleStorages: (payload: {enabled: boolean, clearWrite: boolean}) => void,\n pushPing: (payload: ServicePushPingTaskPayload, source: MessageEventSource, event: MessageEvent) => void,\n hello: (payload: void, source: MessageEventSource, event: MessageEvent) => void,\n shownNotification: (payload: string) => void,\n\n // from mtproto worker\n download: (payload: ServiceDownloadTaskPayload) => void,\n downloadChunk: (payload: {id: ServiceDownloadTaskPayload['id'], chunk: Uint8Array}) => void\n downloadFinalize: (payload: ServiceDownloadTaskPayload['id']) => void,\n downloadCancel: (payload: ServiceDownloadTaskPayload['id']) => void\n}, {\n // to main thread\n pushClick: (payload: PushNotificationObject) => void,\n hello: (payload: void, source: MessageEventSource) => void,\n share: (payload: ShareData) => void,\n\n // to mtproto worker\n requestFilePart: (payload: ServiceRequestFilePartTaskPayload) => Promise | MyUploadFile\n} & ServiceEvent, Master> {\n constructor() {\n super('SERVICE');\n\n MOUNT_CLASS_TO && (MOUNT_CLASS_TO.serviceMessagePort = this);\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type {ServiceDownloadTaskPayload} from './serviceMessagePort';\nimport type ServiceMessagePort from './serviceMessagePort';\nimport deferredPromise, {CancellablePromise} from '../../helpers/cancellablePromise';\nimport makeError from '../../helpers/makeError';\nimport pause from '../../helpers/schedulers/pause';\n\ntype DownloadType = Uint8Array;\ntype DownloadItem = ServiceDownloadTaskPayload & {\n // transformStream: TransformStream,\n readableStream: ReadableStream,\n // writableStream: WritableStream,\n // writer: WritableStreamDefaultWriter,\n // controller: TransformStreamDefaultController,\n controller: ReadableStreamController,\n promise: CancellablePromise,\n // downloadPromise: Promise,\n used?: boolean\n};\nconst downloadMap: Map = new Map();\nconst DOWNLOAD_ERROR = makeError('UNKNOWN');\nconst DOWNLOAD_TEST = false;\n\n(self as any).downloadMap = downloadMap;\n\ntype A = Parameters['addMultipleEventsListeners']>[0];\n\nconst events: A = {\n download: (payload) => {\n const {id} = payload;\n if(downloadMap.has(id)) {\n return Promise.reject(DOWNLOAD_ERROR);\n }\n\n // const y = (20 * 1024 * 1024) / payload.limitPart;\n // const strategy = new ByteLengthQueuingStrategy({highWaterMark: y});\n // let controller: TransformStreamDefaultController;\n const strategy = new CountQueuingStrategy({highWaterMark: 1});\n // const transformStream = new TransformStream(/* {\n // start: (_controller) => controller = _controller,\n // }, */undefined, strategy, strategy);\n\n // const {readable, writable} = transformStream;\n // const writer = writable.getWriter();\n\n const promise = deferredPromise();\n promise.then(() => {\n setTimeout(() => {\n downloadMap.delete(id);\n }, 5e3);\n }, () => {\n downloadMap.delete(id);\n });\n\n // writer.closed.then(promise.resolve, promise.reject);\n\n let controller: ReadableStreamController;\n const readable = new ReadableStream({\n start: (_controller) => {\n controller = _controller;\n },\n\n cancel: (reason) => {\n promise.reject(DOWNLOAD_ERROR);\n }\n }, strategy);\n\n // writer.closed.catch(noop).finally(() => {\n // log.error('closed writer');\n // onEnd();\n // });\n\n // const downloadPromise = writer.closed.catch(() => {throw DOWNLOAD_ERROR;});\n const item: DownloadItem = {\n ...payload,\n // transformStream,\n readableStream: readable,\n // writableStream: writable,\n // writer,\n // downloadPromise,\n promise,\n controller\n };\n\n downloadMap.set(id, item);\n\n // return downloadPromise;\n return promise.catch(() => {throw DOWNLOAD_ERROR});\n },\n\n downloadChunk: ({id, chunk}) => {\n const item = downloadMap.get(id);\n if(!item) {\n return Promise.reject();\n }\n\n // return item.controller.enqueue(chunk);\n // return item.writer.write(chunk);\n // @ts-ignore\n return item.controller.enqueue(chunk);\n },\n\n downloadFinalize: (id) => {\n const item = downloadMap.get(id);\n if(!item) {\n return Promise.reject();\n }\n\n item.promise.resolve();\n // return item.controller.terminate();\n // return item.writer.close();\n return item.controller.close();\n },\n\n downloadCancel: (id) => {\n const item = downloadMap.get(id);\n if(!item) {\n return;\n }\n\n item.promise.reject();\n // return item.controller.error();\n // return item.writer.abort();\n return item.controller.error();\n }\n};\n\nexport default function handleDownload(serviceMessagePort: ServiceMessagePort) {\n serviceMessagePort.addMultipleEventsListeners(events);\n\n return {\n onDownloadFetch,\n onClosedWindows: cancelAllDownloads\n };\n}\n\nfunction onDownloadFetch(event: FetchEvent, params: string) {\n const promise = pause(100).then(() => {\n const item = downloadMap.get(params);\n if(!item || (item.used && !DOWNLOAD_TEST)) {\n return;\n }\n\n item.used = true;\n const stream = item.readableStream;\n const response = new Response(stream, {headers: item.headers});\n return response;\n });\n\n event.respondWith(promise);\n}\n\nfunction cancelAllDownloads() {\n if(downloadMap.size) {\n for(const [id, item] of downloadMap) {\n // item.writer.abort().catch(noop);\n item.controller.error();\n }\n }\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport {log, serviceMessagePort} from './index.service';\n\nconst deferred: {[id: string]: ShareData[]} = {};\n\nfunction parseFormData(formData: FormData): ShareData {\n return {\n files: formData.getAll('files') as File[],\n title: formData.get('title') as string,\n text: formData.get('text') as string,\n url: formData.get('url') as string\n };\n}\n\nasync function processShareEvent(formData: FormData, clientId: string) {\n try {\n log('share data', formData);\n const data = parseFormData(formData);\n (deferred[clientId] ??= []).push(data);\n } catch(err) {\n log.warn('something wrong with the data', err);\n }\n};\n\nexport function checkWindowClientForDeferredShare(windowClient: WindowClient) {\n const arr = deferred[windowClient.id];\n if(!arr) {\n return;\n }\n\n delete deferred[windowClient.id];\n\n log('releasing share events to client:', windowClient.id, 'length:', arr.length);\n arr.forEach((data) => {\n serviceMessagePort.invokeVoid('share', data, windowClient);\n });\n}\n\nexport default function onShareFetch(event: FetchEvent, params: string) {\n const promise = event.request.formData()\n .then((formData) => {\n processShareEvent(formData, event.resultingClientId)\n return Response.redirect('..');\n });\n\n event.respondWith(promise);\n}\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\n \n \n \n\nimport {logger, LogTypes} from '../logger';\nimport {CACHE_ASSETS_NAME, requestCache} from './cache';\nimport onStreamFetch from './stream';\nimport {closeAllNotifications, onPing, onShownNotification} from './push';\nimport CacheStorageController from '../files/cacheStorage';\nimport {IS_SAFARI} from '../../environment/userAgent';\nimport ServiceMessagePort from './serviceMessagePort';\nimport listenMessagePort from '../../helpers/listenMessagePort';\nimport {getWindowClients} from '../../helpers/context';\nimport {MessageSendPort} from '../mtproto/superMessagePort';\nimport handleDownload from './download';\nimport onShareFetch, {checkWindowClientForDeferredShare} from './share';\n\nexport const log = logger('SW', LogTypes.Error | LogTypes.Debug | LogTypes.Log | LogTypes.Warn, true);\nconst ctx = self as any as ServiceWorkerGlobalScope;\n\n \nlet _mtprotoMessagePort: MessagePort;\nexport const getMtprotoMessagePort = () => _mtprotoMessagePort;\n\nconst sendMessagePort = (source: MessageSendPort) => {\n const channel = new MessageChannel();\n serviceMessagePort.attachPort(_mtprotoMessagePort = channel.port1);\n serviceMessagePort.invokeVoid('port', undefined, source, [channel.port2]);\n};\n\nconst sendMessagePortIfNeeded = (source: MessageSendPort) => {\n if(!connectedWindows.size && !_mtprotoMessagePort) {\n log('sending message port for mtproto');\n sendMessagePort(source);\n }\n};\n\nconst onWindowConnected = (source: WindowClient) => {\n log('window connected', source.id, 'windows before', connectedWindows.size);\n\n if(source.frameType === 'none') {\n log.warn('maybe a bugged Safari starting window', source.id);\n return;\n }\n\n log('windows', Array.from(connectedWindows));\n serviceMessagePort.invokeVoid('hello', undefined, source);\n sendMessagePortIfNeeded(source);\n connectedWindows.set(source.id, source);\n\n checkWindowClientForDeferredShare(source);\n};\n\nexport const serviceMessagePort = new ServiceMessagePort();\nserviceMessagePort.addMultipleEventsListeners({\n notificationsClear: closeAllNotifications,\n\n toggleStorages: ({enabled, clearWrite}) => {\n CacheStorageController.toggleStorage(enabled, clearWrite);\n },\n\n pushPing: (payload, source) => {\n onPing(payload, source);\n },\n\n hello: (payload, source) => {\n onWindowConnected(source as any as WindowClient);\n },\n\n shownNotification: onShownNotification\n});\n\nconst {\n onDownloadFetch,\n onClosedWindows: onDownloadClosedWindows\n} = handleDownload(serviceMessagePort);\n\n// * service worker can be killed, so won't get 'hello' event\ngetWindowClients().then((windowClients) => {\n log(`got ${windowClients.length} windows from the start`);\n windowClients.forEach((windowClient) => {\n onWindowConnected(windowClient);\n });\n});\n\nconst connectedWindows: Map = new Map();\n(self as any).connectedWindows = connectedWindows;\nlistenMessagePort(serviceMessagePort, undefined, (source) => {\n log('something has disconnected', source);\n const isWindowClient = source instanceof WindowClient;\n if(!isWindowClient || !connectedWindows.has(source.id)) {\n log.warn('it is not a window');\n return;\n }\n\n connectedWindows.delete(source.id);\n log('window disconnected, left', connectedWindows.size);\n if(!connectedWindows.size) {\n log.warn('no windows left');\n\n if(_mtprotoMessagePort) {\n serviceMessagePort.detachPort(_mtprotoMessagePort);\n _mtprotoMessagePort = undefined;\n }\n\n onDownloadClosedWindows();\n }\n});\n \n\nconst onFetch = (event: FetchEvent): void => {\n \n if(\n !IS_SAFARI &&\n event.request.url.indexOf(location.origin + '/') === 0 &&\n event.request.url.match(/\\.(js|css|jpe?g|json|wasm|png|mp3|svg|tgs|ico|woff2?|ttf|webmanifest?)(?:\\?.*)?$/)\n ) {\n return event.respondWith(requestCache(event));\n }\n \n\n try {\n // const [, url, scope, params] = /http[:s]+\\/\\/.*?(\\/(.*?)(?:$|\\/(.*)$))/.exec(event.request.url) || [];\n const [scope, params] = event.request.url.split('/').slice(-2);\n\n // log.debug('[fetch]:', event);\n\n switch(scope) {\n case 'stream': {\n onStreamFetch(event, params);\n break;\n }\n\n case 'download': {\n onDownloadFetch(event, params);\n break;\n }\n\n case 'share': {\n onShareFetch(event, params);\n break;\n }\n\n case 'ping': {\n event.respondWith(new Response('pong'));\n break;\n }\n }\n } catch(err) {\n log.error('fetch error', err);\n event.respondWith(new Response('', {\n status: 500,\n statusText: 'Internal Server Error',\n headers: {'Cache-Control': 'no-cache'}\n }));\n }\n};\n\nconst onChangeState = () => {\n ctx.onfetch = onFetch;\n};\n\nctx.addEventListener('install', (event) => {\n log('installing');\n event.waitUntil(ctx.skipWaiting().then(() => log('skipped waiting'))); // Activate worker immediately\n});\n\nctx.addEventListener('activate', (event) => {\n log('activating', ctx);\n event.waitUntil(ctx.caches.delete(CACHE_ASSETS_NAME).then(() => log('cleared assets cache')));\n event.waitUntil(ctx.clients.claim().then(() => log('claimed clients')));\n});\n\n// ctx.onerror = (error) => {\n// log.error('error:', error);\n// };\n\n// ctx.onunhandledrejection = (error) => {\n// log.error('onunhandledrejection:', error);\n// };\n\nctx.onoffline = ctx.ononline = onChangeState;\n\nonChangeState();\n","/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nimport type SuperMessagePort from '../lib/mtproto/superMessagePort';\nimport ctx from '../environment/ctx';\n\nexport default function listenMessagePort(\n messagePort: SuperMessagePort,\n onConnect?: (source: MessageEventSource) => void,\n onDisconnect?: (source: MessageEventSource) => void\n) {\n const attachPort = (listenPort: any, sendPort: any) => {\n messagePort.attachListenPort(listenPort);\n sendPort && messagePort.attachSendPort(sendPort);\n onConnect?.(listenPort);\n };\n\n messagePort.setOnPortDisconnect(onDisconnect);\n\n if(typeof(SharedWorkerGlobalScope) !== 'undefined') {\n (ctx as any as SharedWorkerGlobalScope).addEventListener('connect', (e) => attachPort(e.source, e.source));\n } else if(typeof(ServiceWorkerGlobalScope) !== 'undefined') {\n attachPort(ctx, null);\n } else {\n attachPort(ctx, ctx);\n }\n}\n","export default function timeout(delay: number): Promise {\n return new Promise(((resolve) => {\n setTimeout(() => {\n resolve(new Response('', {\n status: 408,\n statusText: 'Request timed out.'\n }));\n }, delay);\n }));\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [85], () => (__webpack_require__(6350)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".\" + \"887945ef5f43bc205112\" + \".bundle.js\";\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","(() => {\n if (typeof __webpack_require__ !== 'undefined') {\n var oldGetScript = __webpack_require__.u;\n var oldLoadScript = __webpack_require__.e;\n var queryMap = {};\n var countMap = {};\n var getRetryDelay = function () {\n return 3000;\n };\n __webpack_require__.u = function (chunkId) {\n var result = oldGetScript(chunkId);\n return (\n result +\n (queryMap.hasOwnProperty(chunkId) ? '?' + queryMap[chunkId] : '')\n );\n };\n __webpack_require__.e = function (chunkId) {\n var result = oldLoadScript(chunkId);\n return result.catch(function (error) {\n var retries = countMap.hasOwnProperty(chunkId)\n ? countMap[chunkId]\n : 999999;\n if (retries < 1) {\n var realSrc = oldGetScript(chunkId);\n error.message =\n 'Loading chunk ' +\n chunkId +\n ' failed after 999999 retries.\\n(' +\n realSrc +\n ')';\n error.request = realSrc;\n throw error;\n }\n return new Promise(function (resolve) {\n var retryAttempt = 999999 - retries + 1;\n setTimeout(function () {\n var retryAttemptString = '&retry-attempt=' + retryAttempt;\n var cacheBust = (function () {\n return Date.now();\n })();\n +retryAttemptString;\n queryMap[chunkId] = cacheBust;\n countMap[chunkId] = retries - 1;\n resolve(__webpack_require__.e(chunkId));\n }, getRetryDelay(retryAttempt));\n });\n });\n };\n }\n})();\n","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t670: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = this[\"webpackChunktweb\"] = this[\"webpackChunktweb\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","next","DEBUG","MOUNT_CLASS_TO","window","self","USER_AGENT","navigator","userAgent","IS_SAFARI","search","toLowerCase","indexOf","test","vendor","platform","maxTouchPoints","match","IS_FIREFOX","undefined","IS_SERVICE_WORKER","ServiceWorkerGlobalScope","IS_WEB_WORKER","WorkerGlobalScope","IS_WORKER","getWindowClients","clients","matchAll","includeUncontrolled","type","postMessage","listener","args","err","console","error","notifyServiceWorker","all","then","listeners","length","slice","forEach","bind","LogTypes","LOG_LEVELS","None","Error","Warn","Log","Debug","STYLES_SUPPORTED","LOGGER_STYLES","methods","logger","prefix","ignoreDebugReset","style","originalPrefix","originalStyle","log","method","logType","setPrefix","newPrefix","setLevel","level","reduce","acc","v","bindPrefix","pause","ms","Promise","resolve","setTimeout","ctx","CACHE_ASSETS_NAME","isCorrectResponse","response","ok","status","timeoutRace","promise","race","reject","noop","deferredPromise","deferredHelper","isFulfilled","isRejected","notify","notifyAll","lastNotify","callback","addNotifyListener","push","value","catch","finally","cancel","Object","assign","blobConstruct","blobParts","mimeType","Array","isArray","safeMimeType","blobSafeMimeType","Blob","MemoryWriter","constructor","size","saveFileCallback","this","bytes","Uint8Array","write","part","offset","endOffset","byteLength","newBytes","set","truncate","trim","finalize","saveToStorage","blob","getParts","replaceParts","parts","CacheStorageController","dbName","useStorage","STORAGES","openDatabase","openDbPromise","caches","open","delete","entryName","timeoutOperation","cache","deleteAll","get","save","put","getFile","fileName","makeError","saveFile","Response","headers","rejected","timeout","res","clearTimeout","prepareWriting","fileSize","getWriter","static","enabled","clearWrite","map","storage","deferredPromises","Map","cacheStorage","CHUNK_CACHED_TIME_HEADER","setInterval","keys","requests","filtered","timestamp","Date","now","request","url","has","promises","id","ignoreSearch","ignoreVary","mtprotoMessagePort","getMtprotoMessagePort","messagePort","taskId","streams","Stream","info","loadedOffsets","Set","destroy","getId","limitPart","STREAM_CHUNK_UPPER_LIMIT","STREAM_CHUNK_MIDDLE_LIMIT","destroyDebounced","fn","shouldRunFirst","shouldRunLast","waitingTimeout","waitingPromise","hadNewCall","invoke","_resolve","_reject","apply","debounce","_waitingTimeout","isDebounced","requestFilePartFromWorker","alignedOffset","limit","fromPreload","payload","docId","dcId","JSON","stringify","uploadFile","add","serviceMessagePort","bytesPromise","saveChunkToCache","preloadChunks","requestFilePartFromCache","key","getChunkKey","reader","FileReader","addEventListener","e","target","result","readBlobAs","readBlobAsArrayBuffer","buffer","readBlobAsUint8Array","requestFilePart","preloadChunk","end","alignOffset","requestRange","range","possibleResponse","statusText","responseForSafariFirstRange","Math","ceil","alignLimit","min","ab","location","base","deepEqual","x","y","tx","every","IDB","db","object","fromObject","i","safeAssign","name","storageIsAvailable","join","INSTANCES","isAvailable","createNew","createIndexes","os","store","indexNames","from","indexName","deleteIndex","indexes","index","contains","createIndex","keyPath","objectParameters","indexedDB","version","message","finished","onerror","onsuccess","event","calledNew","onclose","onabort","transaction","close","onversionchange","onupgradeneeded","warn","oldVersion","newVersion","stores","objectStoreNames","objectStore","createObjectStore","find","instance","preserve","IDBStorage","storeName","idb","create","concat","getObjectStore","clear","idx","mode","perf","performance","onError","onComplete","results","r","waitForTransactionComplete","oncomplete","callbackResult","left","onRequestFinished","getAll","defaultBaseUrl","protocol","hostname","pathname","split","lastPingTime","localNotificationsAvailable","defaults","push_mute_until","push_lang","push_message_nopreview","push_action_mute1d","push_action_settings","push_settings","getter","getDefault","hasOwnProperty","getCached","obj","data","json","muteUntil","settings","lang","nowTime","userInvisibleIsSupported","notificationPromise","peerId","title","body","description","custom","channel_id","chat_id","from_id","tag","messageKey","msg_id","ignoreMessages","nopreview","notificationOptions","icon","actions","action","badge","silent","registration","showNotification","fireNotification","waitUntil","closeAllNotifications","notification","clientList","pendingNotification","client","focus","invokeVoid","openWindow","baseUrl","notifications","getNotifications","len","ServiceMessagePort","super","downloadMap","DOWNLOAD_ERROR","events","download","strategy","CountQueuingStrategy","highWaterMark","controller","readable","ReadableStream","start","_controller","reason","item","readableStream","downloadChunk","chunk","enqueue","downloadFinalize","downloadCancel","onDownloadFetch","params","used","stream","respondWith","cancelAllDownloads","onShareFetch","formData","clientId","files","text","parseFormData","processShareEvent","resultingClientId","redirect","_mtprotoMessagePort","onWindowConnected","source","connectedWindows","frameType","channel","MessageChannel","attachPort","port1","port2","sendMessagePort","sendMessagePortIfNeeded","windowClient","arr","checkWindowClientForDeferredShare","addMultipleEventsListeners","notificationsClear","toggleStorages","toggleStorage","pushPing","localNotifications","onPing","hello","shownNotification","onClosedWindows","onDownloadClosedWindows","handleDownload","windowClients","onConnect","onDisconnect","listenPort","sendPort","attachListenPort","attachSendPort","setOnPortDisconnect","WindowClient","detachPort","listenMessagePort","onFetch","origin","file","fetch","clone","replace","random","requestCache","scope","header","chunks","ranges","parseRange","parse","decodeURIComponent","onStreamFetch","onChangeState","onfetch","skipWaiting","claim","onoffline","ononline","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","m","__webpack_exports__","O","chunkIds","priority","notFulfilled","Infinity","fulfilled","j","splice","d","definition","o","defineProperty","enumerable","f","chunkId","u","miniCssF","g","globalThis","Function","prop","prototype","call","scriptUrl","importScripts","document","currentScript","src","scripts","getElementsByTagName","p","oldGetScript","oldLoadScript","queryMap","countMap","retries","realSrc","cacheBust","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","moreModules","runtime","pop"],"sourceRoot":""} \ No newline at end of file diff --git a/public/version b/public/version index d074b6a2..ccf7b940 100644 --- a/public/version +++ b/public/version @@ -1 +1 @@ -1.7.3 (314) \ No newline at end of file +1.7.3 (315) \ No newline at end of file